From: support Date: Wed, 14 Sep 2022 10:04:26 +0000 (+0000) Subject: Built motion from commit 7b0fe325.|2.6.15 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;/%22avatar.png//%27?a=commitdiff_plain;h=d51a0250047c2cf3c46d26643ae8cb7d188a8017;p=motion2.git Built motion from commit 7b0fe325.|2.6.15 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index c1065e1..143afd6 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-09-13T15:41:49.318Z", + "time": "2022-09-14T09:56:19.074Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 2978dc0..44f3444 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-09-13T15:41:49.318Z", + "time": "2022-09-14T09:56:19.074Z", "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 377d8c2..300900a 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 _0x2be9=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','sequelize','getDataValue','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot'];(function(_0x22663b,_0xc8c6e3){var _0x310d0a=function(_0x151e66){while(--_0x151e66){_0x22663b['push'](_0x22663b['shift']());}};_0x310d0a(++_0xc8c6e3);}(_0x2be9,0x1c6));var _0x92be=function(_0x4d270e,_0x409796){_0x4d270e=_0x4d270e-0x0;var _0x377f75=_0x2be9[_0x4d270e];return _0x377f75;};'use strict';var Sequelize=require(_0x92be('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2ecd65){return this[_0x92be('0x1')]('action');}},'action':{'type':Sequelize[_0x92be('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x92be('0x3'),_0x92be('0x4'),_0x92be('0x5'),_0x92be('0x6'),_0x92be('0x7'),_0x92be('0x8'),_0x92be('0x9'),_0x92be('0xa')]],'msg':_0x92be('0xb')}},'comment':_0x92be('0xb')},'data1':{'type':Sequelize[_0x92be('0x2')](0x1000),'comment':_0x92be('0xc')},'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[_0x92be('0x2')](0x1000),'comment':_0x92be('0xd')},'data4':{'type':Sequelize[_0x92be('0x2')](0x1000),'comments':_0x92be('0xe')},'data5':{'type':Sequelize[_0x92be('0x2')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x92be('0xf')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0xed8e=['bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','integration','jscripty','browser'];(function(_0x2e7702,_0x4cabfd){var _0x350ce7=function(_0x8ee440){while(--_0x8ee440){_0x2e7702['push'](_0x2e7702['shift']());}};_0x350ce7(++_0x4cabfd);}(_0xed8e,0x14d));var _0xeed8=function(_0x1781e3,_0x187097){_0x1781e3=_0x1781e3-0x0;var _0x33acb8=_0xed8e[_0x1781e3];return _0x33acb8;};'use strict';var Sequelize=require(_0xeed8('0x0'));module[_0xeed8('0x1')]={'name':{'type':Sequelize[_0xeed8('0x2')],'get':function(_0x16a979){return this[_0xeed8('0x3')](_0xeed8('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xeed8('0x5'),_0xeed8('0x6'),'motionbar',_0xeed8('0x7'),'urlForward',_0xeed8('0x8'),_0xeed8('0x9'),_0xeed8('0xa')]],'msg':_0xeed8('0xb')}},'comment':_0xeed8('0xb')},'data1':{'type':Sequelize[_0xeed8('0xc')](0x1000),'comment':_0xeed8('0xd')},'data2':{'type':Sequelize[_0xeed8('0xc')](0x1000),'comment':_0xeed8('0xe')},'data3':{'type':Sequelize[_0xeed8('0xc')](0x1000),'comment':_0xeed8('0xf')},'data4':{'type':Sequelize[_0xeed8('0xc')](0x1000),'comments':_0xeed8('0x10')},'data5':{'type':Sequelize[_0xeed8('0xc')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xeed8('0xc')],'comments':_0xeed8('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 1d66df1..cd538c8 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 _0x9971=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','error','stack','name','send','body','Action','find','params','then','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x503564,_0x55867e){var _0x4be9fd=function(_0x41c543){while(--_0x41c543){_0x503564['push'](_0x503564['shift']());}};_0x4be9fd(++_0x55867e);}(_0x9971,0x84));var _0x1997=function(_0x478abd,_0x353a4a){_0x478abd=_0x478abd-0x0;var _0x23e2b7=_0x9971[_0x478abd];return _0x23e2b7;};'use strict';var emlformat=require(_0x1997('0x0'));var rimraf=require(_0x1997('0x1'));var zipdir=require(_0x1997('0x2'));var jsonpatch=require(_0x1997('0x3'));var rp=require(_0x1997('0x4'));var moment=require(_0x1997('0x5'));var BPromise=require(_0x1997('0x6'));var Mustache=require(_0x1997('0x7'));var util=require(_0x1997('0x8'));var path=require(_0x1997('0x9'));var sox=require(_0x1997('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1997('0xb'));var _=require('lodash');var squel=require(_0x1997('0xc'));var crypto=require(_0x1997('0xd'));var jsforce=require(_0x1997('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1997('0xf'));var Redis=require('ioredis');var authService=require(_0x1997('0x10'));var qs=require(_0x1997('0x11'));var as=require(_0x1997('0x12'));var hardwareService=require(_0x1997('0x13'));var logger=require(_0x1997('0x14'))(_0x1997('0x15'));var utils=require(_0x1997('0x16'));var config=require(_0x1997('0x17'));var licenseUtil=require(_0x1997('0x18'));var db=require(_0x1997('0x19'))['db'];function respondWithStatusCode(_0x3d97f0,_0x151a18){_0x151a18=_0x151a18||0xcc;return function(_0x3e48fe){if(_0x3e48fe){return _0x3d97f0[_0x1997('0x1a')](_0x151a18);}return _0x3d97f0['status'](_0x151a18)[_0x1997('0x1b')]();};}function respondWithResult(_0x4ff512,_0x3da72a){_0x3da72a=_0x3da72a||0xc8;return function(_0x5cdbfd){if(_0x5cdbfd){return _0x4ff512[_0x1997('0x1c')](_0x3da72a)[_0x1997('0x1d')](_0x5cdbfd);}};}function respondWithFilteredResult(_0x2353c7,_0x40ff1b){return function(_0x2e9b88){if(_0x2e9b88){var _0x26c257=typeof _0x40ff1b[_0x1997('0x1e')]===_0x1997('0x1f')&&typeof _0x40ff1b[_0x1997('0x20')]===_0x1997('0x1f');var _0x2add5a=_0x2e9b88[_0x1997('0x21')];var _0x4253e0=_0x26c257?0x0:_0x40ff1b[_0x1997('0x1e')];var _0x39562e=_0x26c257?_0x2e9b88[_0x1997('0x21')]:_0x40ff1b[_0x1997('0x1e')]+_0x40ff1b[_0x1997('0x20')];var _0x2f2271;if(_0x39562e>=_0x2add5a){_0x39562e=_0x2add5a;_0x2f2271=0xc8;}else{_0x2f2271=0xce;}_0x2353c7[_0x1997('0x1c')](_0x2f2271);return _0x2353c7[_0x1997('0x22')](_0x1997('0x23'),_0x4253e0+'-'+_0x39562e+'/'+_0x2add5a)[_0x1997('0x1d')](_0x2e9b88);}return null;};}function patchUpdates(_0xcbe1f2){return function(_0x300e43){try{jsonpatch['apply'](_0x300e43,_0xcbe1f2,!![]);}catch(_0x5844db){return BPromise[_0x1997('0x24')](_0x5844db);}return _0x300e43[_0x1997('0x25')]();};}function saveUpdates(_0x267db7,_0x530baa){return function(_0x33528a){if(_0x33528a){return _0x33528a[_0x1997('0x26')](_0x267db7)['then'](function(_0x5d9529){return _0x5d9529;});}return null;};}function removeEntity(_0x57a3f5,_0x47698d){return function(_0x4df6ea){if(_0x4df6ea){return _0x4df6ea[_0x1997('0x27')]()['then'](function(){_0x57a3f5[_0x1997('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17f404,_0x54a340){return function(_0x20a206){if(!_0x20a206){_0x17f404[_0x1997('0x1a')](0x194);}return _0x20a206;};}function handleError(_0x4bcc1f,_0x43ba47){_0x43ba47=_0x43ba47||0x1f4;return function(_0x585eaa){logger[_0x1997('0x28')](_0x585eaa[_0x1997('0x29')]);if(_0x585eaa[_0x1997('0x2a')]){delete _0x585eaa['name'];}_0x4bcc1f['status'](_0x43ba47)[_0x1997('0x2b')](_0x585eaa);};}exports[_0x1997('0x26')]=function(_0x48cb99,_0x2d8954){if(_0x48cb99[_0x1997('0x2c')]['id']){delete _0x48cb99['body']['id'];}return db[_0x1997('0x2d')][_0x1997('0x2e')]({'where':{'id':_0x48cb99[_0x1997('0x2f')]['id']}})[_0x1997('0x30')](handleEntityNotFound(_0x2d8954,null))[_0x1997('0x30')](saveUpdates(_0x48cb99[_0x1997('0x2c')],null))['then'](respondWithResult(_0x2d8954,null))[_0x1997('0x31')](handleError(_0x2d8954,null));};exports[_0x1997('0x27')]=function(_0x5d4f06,_0x36f2da){return db[_0x1997('0x2d')]['find']({'where':{'id':_0x5d4f06[_0x1997('0x2f')]['id']}})[_0x1997('0x30')](handleEntityNotFound(_0x36f2da,null))[_0x1997('0x30')](removeEntity(_0x36f2da,null))[_0x1997('0x31')](handleError(_0x36f2da,null));}; \ No newline at end of file +var _0xc1e5=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','then','destroy','sendStatus','error','stack','name','send','update','body','find','params','catch','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x37dd78,_0x6e31b7){var _0x39cd1b=function(_0x3c9171){while(--_0x3c9171){_0x37dd78['push'](_0x37dd78['shift']());}};_0x39cd1b(++_0x6e31b7);}(_0xc1e5,0x85));var _0x5c1e=function(_0x3390de,_0x4fecd1){_0x3390de=_0x3390de-0x0;var _0x4abd4b=_0xc1e5[_0x3390de];return _0x4abd4b;};'use strict';var emlformat=require(_0x5c1e('0x0'));var rimraf=require(_0x5c1e('0x1'));var zipdir=require(_0x5c1e('0x2'));var jsonpatch=require(_0x5c1e('0x3'));var rp=require(_0x5c1e('0x4'));var moment=require(_0x5c1e('0x5'));var BPromise=require(_0x5c1e('0x6'));var Mustache=require('mustache');var util=require(_0x5c1e('0x7'));var path=require(_0x5c1e('0x8'));var sox=require('sox');var csv=require(_0x5c1e('0x9'));var ejs=require(_0x5c1e('0xa'));var fs=require('fs');var fs_extra=require(_0x5c1e('0xb'));var _=require(_0x5c1e('0xc'));var squel=require(_0x5c1e('0xd'));var crypto=require(_0x5c1e('0xe'));var jsforce=require(_0x5c1e('0xf'));var deskjs=require(_0x5c1e('0x10'));var toCsv=require(_0x5c1e('0x9'));var querystring=require('querystring');var Papa=require(_0x5c1e('0x11'));var Redis=require(_0x5c1e('0x12'));var authService=require(_0x5c1e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5c1e('0x14'));var hardwareService=require(_0x5c1e('0x15'));var logger=require(_0x5c1e('0x16'))('api');var utils=require(_0x5c1e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5c1e('0x18'));var db=require(_0x5c1e('0x19'))['db'];function respondWithStatusCode(_0x56a677,_0x166be4){_0x166be4=_0x166be4||0xcc;return function(_0x2d761a){if(_0x2d761a){return _0x56a677['sendStatus'](_0x166be4);}return _0x56a677[_0x5c1e('0x1a')](_0x166be4)[_0x5c1e('0x1b')]();};}function respondWithResult(_0x51073b,_0x154650){_0x154650=_0x154650||0xc8;return function(_0x51a76f){if(_0x51a76f){return _0x51073b[_0x5c1e('0x1a')](_0x154650)['json'](_0x51a76f);}};}function respondWithFilteredResult(_0x307f72,_0x251ba1){return function(_0x2b6b66){if(_0x2b6b66){var _0x55923f=typeof _0x251ba1[_0x5c1e('0x1c')]===_0x5c1e('0x1d')&&typeof _0x251ba1[_0x5c1e('0x1e')]===_0x5c1e('0x1d');var _0x251d0c=_0x2b6b66['count'];var _0x46d39f=_0x55923f?0x0:_0x251ba1[_0x5c1e('0x1c')];var _0x5729f6=_0x55923f?_0x2b6b66[_0x5c1e('0x1f')]:_0x251ba1['offset']+_0x251ba1['limit'];var _0x58d27e;if(_0x5729f6>=_0x251d0c){_0x5729f6=_0x251d0c;_0x58d27e=0xc8;}else{_0x58d27e=0xce;}_0x307f72[_0x5c1e('0x1a')](_0x58d27e);return _0x307f72[_0x5c1e('0x20')](_0x5c1e('0x21'),_0x46d39f+'-'+_0x5729f6+'/'+_0x251d0c)[_0x5c1e('0x22')](_0x2b6b66);}return null;};}function patchUpdates(_0x168200){return function(_0x3097c0){try{jsonpatch[_0x5c1e('0x23')](_0x3097c0,_0x168200,!![]);}catch(_0xd51208){return BPromise['reject'](_0xd51208);}return _0x3097c0['save']();};}function saveUpdates(_0x3ad3d8,_0x62eeca){return function(_0x5073ce){if(_0x5073ce){return _0x5073ce['update'](_0x3ad3d8)[_0x5c1e('0x24')](function(_0x49d8f6){return _0x49d8f6;});}return null;};}function removeEntity(_0x1efc34,_0xc4a4e){return function(_0x4afd0c){if(_0x4afd0c){return _0x4afd0c[_0x5c1e('0x25')]()[_0x5c1e('0x24')](function(){_0x1efc34[_0x5c1e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e4ed7,_0x4d4d62){return function(_0x77c36){if(!_0x77c36){_0x5e4ed7[_0x5c1e('0x26')](0x194);}return _0x77c36;};}function handleError(_0xc41ace,_0x4facab){_0x4facab=_0x4facab||0x1f4;return function(_0x3dab81){logger[_0x5c1e('0x27')](_0x3dab81[_0x5c1e('0x28')]);if(_0x3dab81[_0x5c1e('0x29')]){delete _0x3dab81['name'];}_0xc41ace['status'](_0x4facab)[_0x5c1e('0x2a')](_0x3dab81);};}exports[_0x5c1e('0x2b')]=function(_0x194458,_0x3c8d4e){if(_0x194458[_0x5c1e('0x2c')]['id']){delete _0x194458[_0x5c1e('0x2c')]['id'];}return db['Action'][_0x5c1e('0x2d')]({'where':{'id':_0x194458[_0x5c1e('0x2e')]['id']}})[_0x5c1e('0x24')](handleEntityNotFound(_0x3c8d4e,null))[_0x5c1e('0x24')](saveUpdates(_0x194458['body'],null))['then'](respondWithResult(_0x3c8d4e,null))[_0x5c1e('0x2f')](handleError(_0x3c8d4e,null));};exports[_0x5c1e('0x25')]=function(_0x4f7b9,_0x338fb9){return db[_0x5c1e('0x30')][_0x5c1e('0x2d')]({'where':{'id':_0x4f7b9['params']['id']}})[_0x5c1e('0x24')](handleEntityNotFound(_0x338fb9,null))[_0x5c1e('0x24')](removeEntity(_0x338fb9,null))[_0x5c1e('0x2f')](handleError(_0x338fb9,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 8e6720b..3286417 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 _0x1339=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Action','tools_actions','../../config/logger','api'];(function(_0xb15182,_0x48d8fb){var _0x4a8749=function(_0x28684d){while(--_0x28684d){_0xb15182['push'](_0xb15182['shift']());}};_0x4a8749(++_0x48d8fb);}(_0x1339,0x1ed));var _0x9133=function(_0x4c534c,_0x253245){_0x4c534c=_0x4c534c-0x0;var _0x4a075f=_0x1339[_0x4c534c];return _0x4a075f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9133('0x0'))(_0x9133('0x1'));var moment=require(_0x9133('0x2'));var BPromise=require(_0x9133('0x3'));var rp=require(_0x9133('0x4'));var fs=require('fs');var path=require(_0x9133('0x5'));var rimraf=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var attributes=require('./action.attributes');module[_0x9133('0x8')]=function(_0x855473,_0x379915){return _0x855473['define'](_0x9133('0x9'),attributes,{'tableName':_0x9133('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x489a=['bluebird','request-promise','path','rimraf','./action.attributes','define','Action','tools_actions','lodash','util','../../config/logger','moment'];(function(_0x256360,_0x5127b){var _0x1175f1=function(_0x7cfbbf){while(--_0x7cfbbf){_0x256360['push'](_0x256360['shift']());}};_0x1175f1(++_0x5127b);}(_0x489a,0x1c4));var _0xa489=function(_0x23d7c5,_0x2a7547){_0x23d7c5=_0x23d7c5-0x0;var _0x350950=_0x489a[_0x23d7c5];return _0x350950;};'use strict';var _=require(_0xa489('0x0'));var util=require(_0xa489('0x1'));var logger=require(_0xa489('0x2'))('api');var moment=require(_0xa489('0x3'));var BPromise=require(_0xa489('0x4'));var rp=require(_0xa489('0x5'));var fs=require('fs');var path=require(_0xa489('0x6'));var rimraf=require(_0xa489('0x7'));var config=require('../../config/environment');var attributes=require(_0xa489('0x8'));module['exports']=function(_0x5666fc,_0x3bb04a){return _0x5666fc[_0xa489('0x9')](_0xa489('0xa'),attributes,{'tableName':_0xa489('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index b59db26..55c5f8a 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3ae42b,_0x3f0d1b){_0x3ae42b=_0x3ae42b-0x0;var _0x22e828=_0x1cb9[_0x3ae42b];return _0x22e828;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file +var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4eb841,_0x5c3f51){_0x4eb841=_0x4eb841-0x0;var _0x52557f=_0x1cb9[_0x4eb841];return _0x52557f;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 9256e2b..feaaf7d 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 _0xaea0=['delete','/:id','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update'];(function(_0x17b17a,_0x7ddf03){var _0x3c0e44=function(_0x4a86a1){while(--_0x4a86a1){_0x17b17a['push'](_0x17b17a['shift']());}};_0x3c0e44(++_0x7ddf03);}(_0xaea0,0xc3));var _0x0aea=function(_0x903228,_0x42c429){_0x903228=_0x903228-0x0;var _0xcec81d=_0xaea0[_0x903228];return _0xcec81d;};'use strict';var multer=require('multer');var util=require(_0x0aea('0x0'));var path=require(_0x0aea('0x1'));var timeout=require(_0x0aea('0x2'));var express=require(_0x0aea('0x3'));var router=express[_0x0aea('0x4')]();var fs_extra=require(_0x0aea('0x5'));var auth=require(_0x0aea('0x6'));var interaction=require(_0x0aea('0x7'));var config=require(_0x0aea('0x8'));var controller=require(_0x0aea('0x9'));router[_0x0aea('0xa')]('/:id',auth[_0x0aea('0xb')](),controller[_0x0aea('0xc')]);router[_0x0aea('0xd')](_0x0aea('0xe'),auth[_0x0aea('0xb')](),controller['destroy']);module[_0x0aea('0xf')]=router; \ No newline at end of file +var _0x59e9=['/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','isAuthenticated','delete'];(function(_0x389832,_0x10a4a9){var _0x59429e=function(_0x5f3562){while(--_0x5f3562){_0x389832['push'](_0x389832['shift']());}};_0x59429e(++_0x10a4a9);}(_0x59e9,0x173));var _0x959e=function(_0x3a7d3a,_0x3e14a8){_0x3a7d3a=_0x3a7d3a-0x0;var _0x5a0252=_0x59e9[_0x3a7d3a];return _0x5a0252;};'use strict';var multer=require(_0x959e('0x0'));var util=require(_0x959e('0x1'));var path=require(_0x959e('0x2'));var timeout=require(_0x959e('0x3'));var express=require(_0x959e('0x4'));var router=express[_0x959e('0x5')]();var fs_extra=require(_0x959e('0x6'));var auth=require(_0x959e('0x7'));var interaction=require(_0x959e('0x8'));var config=require('../../config/environment');var controller=require(_0x959e('0x9'));router[_0x959e('0xa')]('/:id',auth[_0x959e('0xb')](),controller['update']);router[_0x959e('0xc')](_0x959e('0xd'),auth['isAuthenticated'](),controller[_0x959e('0xe')]);module[_0x959e('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 81916f4..c78550a 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 _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x207a02,_0x278c56){var _0xd995c3=function(_0x24e415){while(--_0x24e415){_0x207a02['push'](_0x207a02['shift']());}};_0xd995c3(++_0x278c56);}(_0xdc97,0x13b));var _0x7dc9=function(_0x345c51,_0x2545c5){_0x345c51=_0x345c51-0x0;var _0x57bedf=_0xdc97[_0x345c51];return _0x57bedf;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}}; \ No newline at end of file +var _0x31f0=['sequelize','STRING','TEXT'];(function(_0x58d8bd,_0x2ffe00){var _0x5c06f5=function(_0x3ca641){while(--_0x3ca641){_0x58d8bd['push'](_0x58d8bd['shift']());}};_0x5c06f5(++_0x2ffe00);}(_0x31f0,0xb7));var _0x031f=function(_0x1f0486,_0x3bbb5d){_0x1f0486=_0x1f0486-0x0;var _0xc3e1c4=_0x31f0[_0x1f0486];return _0xc3e1c4;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'name':{'type':Sequelize[_0x031f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x031f('0x1')]},'table':{'type':Sequelize[_0x031f('0x1')]},'conditions':{'type':Sequelize[_0x031f('0x2')]},'joins':{'type':Sequelize[_0x031f('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 571ba8e..2c95d1d 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 _0x4af2=['limit','undefined','count','Content-Range','apply','reject','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','select','from','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','parse','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','IS\x20NOT\x20NULL','IS\x20EMPTY','getFields','Sequelize','AnalyticMetric','keyBy','metric','DESC','clone','output','web','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../files/reports','countTable','COUNT(*)','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','dbH','sendStatus','status','end','json','offset'];(function(_0x460cac,_0x246028){var _0x26f3ab=function(_0x5ef8ab){while(--_0x5ef8ab){_0x460cac['push'](_0x460cac['shift']());}};_0x26f3ab(++_0x246028);}(_0x4af2,0x1d7));var _0x24af=function(_0x4697bd,_0x7863ef){_0x4697bd=_0x4697bd-0x0;var _0x104247=_0x4af2[_0x4697bd];return _0x104247;};'use strict';var emlformat=require(_0x24af('0x0'));var rimraf=require(_0x24af('0x1'));var zipdir=require(_0x24af('0x2'));var jsonpatch=require(_0x24af('0x3'));var rp=require(_0x24af('0x4'));var moment=require('moment');var BPromise=require(_0x24af('0x5'));var Mustache=require(_0x24af('0x6'));var util=require(_0x24af('0x7'));var path=require(_0x24af('0x8'));var sox=require(_0x24af('0x9'));var csv=require(_0x24af('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x24af('0xb'));var squel=require(_0x24af('0xc'));var crypto=require('crypto');var jsforce=require(_0x24af('0xd'));var deskjs=require(_0x24af('0xe'));var toCsv=require('to-csv');var querystring=require(_0x24af('0xf'));var Papa=require('papaparse');var Redis=require(_0x24af('0x10'));var authService=require(_0x24af('0x11'));var qs=require(_0x24af('0x12'));var as=require(_0x24af('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x24af('0x14'))(_0x24af('0x15'));var utils=require(_0x24af('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require(_0x24af('0x17'))[_0x24af('0x18')];function respondWithStatusCode(_0x5b2b3e,_0x48ea05){_0x48ea05=_0x48ea05||0xcc;return function(_0x1964a1){if(_0x1964a1){return _0x5b2b3e[_0x24af('0x19')](_0x48ea05);}return _0x5b2b3e[_0x24af('0x1a')](_0x48ea05)[_0x24af('0x1b')]();};}function respondWithResult(_0xf6a39f,_0x1ccd6d){_0x1ccd6d=_0x1ccd6d||0xc8;return function(_0x2a1ddc){if(_0x2a1ddc){return _0xf6a39f[_0x24af('0x1a')](_0x1ccd6d)[_0x24af('0x1c')](_0x2a1ddc);}};}function respondWithFilteredResult(_0xd3c5a,_0x47e62a){return function(_0x5ab676){if(_0x5ab676){var _0xaf8693=typeof _0x47e62a[_0x24af('0x1d')]==='undefined'&&typeof _0x47e62a[_0x24af('0x1e')]===_0x24af('0x1f');var _0x5c8758=_0x5ab676[_0x24af('0x20')];var _0x386d7f=_0xaf8693?0x0:_0x47e62a[_0x24af('0x1d')];var _0x516bfe=_0xaf8693?_0x5ab676[_0x24af('0x20')]:_0x47e62a[_0x24af('0x1d')]+_0x47e62a[_0x24af('0x1e')];var _0x36b254;if(_0x516bfe>=_0x5c8758){_0x516bfe=_0x5c8758;_0x36b254=0xc8;}else{_0x36b254=0xce;}_0xd3c5a[_0x24af('0x1a')](_0x36b254);return _0xd3c5a['set'](_0x24af('0x21'),_0x386d7f+'-'+_0x516bfe+'/'+_0x5c8758)[_0x24af('0x1c')](_0x5ab676);}return null;};}function patchUpdates(_0xcaea02){return function(_0x330b38){try{jsonpatch[_0x24af('0x22')](_0x330b38,_0xcaea02,!![]);}catch(_0x2676b0){return BPromise[_0x24af('0x23')](_0x2676b0);}return _0x330b38['save']();};}function saveUpdates(_0xf01400,_0xfab509){return function(_0x31150b){if(_0x31150b){return _0x31150b[_0x24af('0x24')](_0xf01400)[_0x24af('0x25')](function(_0x50c6dc){return _0x50c6dc;});}return null;};}function removeEntity(_0x4d2a5e,_0x39a574){return function(_0x5d8aef){if(_0x5d8aef){return _0x5d8aef[_0x24af('0x26')]()[_0x24af('0x25')](function(){var _0x24639a=_0x5d8aef[_0x24af('0x27')]({'plain':!![]});var _0x5022e8=_0x24af('0x28');return db[_0x24af('0x29')]['destroy']({'where':{'type':_0x5022e8,'resourceId':_0x24639a['id']}})['then'](function(){return _0x5d8aef;});})[_0x24af('0x25')](function(){_0x4d2a5e[_0x24af('0x1a')](0xcc)[_0x24af('0x1b')]();});}};}function handleEntityNotFound(_0x20e3c3,_0x1d4440){return function(_0x2ee5cd){if(!_0x2ee5cd){_0x20e3c3[_0x24af('0x19')](0x194);}return _0x2ee5cd;};}function handleError(_0x51e58b,_0x3024b2){_0x3024b2=_0x3024b2||0x1f4;return function(_0x156a08){logger[_0x24af('0x2a')](_0x156a08[_0x24af('0x2b')]);if(_0x156a08['name']){delete _0x156a08['name'];}_0x51e58b[_0x24af('0x1a')](_0x3024b2)['send'](_0x156a08);};}exports[_0x24af('0x2c')]=function(_0x420368,_0x41950d){var _0x27a598={},_0x5271ca={},_0x214a79={'count':0x0,'rows':[]};var _0x76066f=_[_0x24af('0x2d')](db[_0x24af('0x2e')][_0x24af('0x2f')],function(_0x5de550){return{'name':_0x5de550[_0x24af('0x30')],'type':_0x5de550[_0x24af('0x31')][_0x24af('0x32')]};});_0x5271ca[_0x24af('0x33')]=_[_0x24af('0x2d')](_0x76066f,_0x24af('0x34'));_0x5271ca[_0x24af('0x35')]=_[_0x24af('0x36')](_0x420368[_0x24af('0x35')]);_0x5271ca[_0x24af('0x37')]=_[_0x24af('0x38')](_0x5271ca[_0x24af('0x33')],_0x5271ca[_0x24af('0x35')]);_0x27a598[_0x24af('0x39')]=_[_0x24af('0x38')](_0x5271ca[_0x24af('0x33')],qs[_0x24af('0x3a')](_0x420368[_0x24af('0x35')][_0x24af('0x3a')]));_0x27a598[_0x24af('0x39')]=_0x27a598['attributes'][_0x24af('0x3b')]?_0x27a598['attributes']:_0x5271ca[_0x24af('0x33')];if(!_0x420368[_0x24af('0x35')][_0x24af('0x3c')](_0x24af('0x3d'))){_0x27a598[_0x24af('0x1e')]=qs['limit'](_0x420368[_0x24af('0x35')][_0x24af('0x1e')]);_0x27a598[_0x24af('0x1d')]=qs[_0x24af('0x1d')](_0x420368[_0x24af('0x35')][_0x24af('0x1d')]);}_0x27a598[_0x24af('0x3e')]=qs[_0x24af('0x3f')](_0x420368[_0x24af('0x35')][_0x24af('0x3f')]);_0x27a598[_0x24af('0x40')]=qs[_0x24af('0x37')](_[_0x24af('0x41')](_0x420368[_0x24af('0x35')],_0x5271ca[_0x24af('0x37')]),_0x76066f);if(_0x420368['query']['filter']){_0x27a598[_0x24af('0x40')]=_[_0x24af('0x42')](_0x27a598[_0x24af('0x40')],{'$or':_[_0x24af('0x2d')](_0x76066f,function(_0x2bb34e){if(_0x2bb34e[_0x24af('0x31')]!==_0x24af('0x43')){var _0x3e71a3={};_0x3e71a3[_0x2bb34e[_0x24af('0x34')]]={'$like':'%'+_0x420368['query'][_0x24af('0x44')]+'%'};return _0x3e71a3;}})});}_0x27a598=_[_0x24af('0x42')]({},_0x27a598,_0x420368[_0x24af('0x45')]);var _0x576c1f={'where':_0x27a598['where']};return db[_0x24af('0x2e')][_0x24af('0x20')](_0x576c1f)[_0x24af('0x25')](function(_0x41fa91){_0x214a79[_0x24af('0x20')]=_0x41fa91;if(_0x420368[_0x24af('0x35')][_0x24af('0x46')]){_0x27a598[_0x24af('0x47')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x24af('0x48')](_0x27a598);})[_0x24af('0x25')](function(_0x7eb1a6){_0x214a79[_0x24af('0x49')]=_0x7eb1a6;return _0x214a79;})[_0x24af('0x25')](respondWithFilteredResult(_0x41950d,_0x27a598))[_0x24af('0x4a')](handleError(_0x41950d,null));};exports['show']=function(_0x19ea3d,_0x36f38c){var _0x537e36={'raw':![],'where':{'id':_0x19ea3d[_0x24af('0x4b')]['id']}},_0x147779={};_0x147779[_0x24af('0x33')]=_[_0x24af('0x36')](db[_0x24af('0x2e')][_0x24af('0x2f')]);_0x147779[_0x24af('0x35')]=_[_0x24af('0x36')](_0x19ea3d[_0x24af('0x35')]);_0x147779['filters']=_[_0x24af('0x38')](_0x147779[_0x24af('0x33')],_0x147779['query']);_0x537e36[_0x24af('0x39')]=_['intersection'](_0x147779[_0x24af('0x33')],qs[_0x24af('0x3a')](_0x19ea3d[_0x24af('0x35')][_0x24af('0x3a')]));_0x537e36[_0x24af('0x39')]=_0x537e36[_0x24af('0x39')][_0x24af('0x3b')]?_0x537e36[_0x24af('0x39')]:_0x147779[_0x24af('0x33')];if(_0x19ea3d[_0x24af('0x35')][_0x24af('0x46')]){_0x537e36[_0x24af('0x47')]=[{'all':!![]}];}_0x537e36=_[_0x24af('0x42')]({},_0x537e36,_0x19ea3d[_0x24af('0x45')]);return db[_0x24af('0x2e')][_0x24af('0x4c')](_0x537e36)[_0x24af('0x25')](handleEntityNotFound(_0x36f38c,null))['then'](respondWithResult(_0x36f38c,null))[_0x24af('0x4a')](handleError(_0x36f38c,null));};exports[_0x24af('0x4d')]=function(_0x142520,_0x92cd6e){return db[_0x24af('0x2e')][_0x24af('0x4d')](_0x142520[_0x24af('0x4e')],{})[_0x24af('0x25')](function(_0x5bfe92){var _0x574309=_0x142520['user'][_0x24af('0x27')]({'plain':!![]});if(!_0x574309)throw new Error(_0x24af('0x4f'));if(_0x574309['role']===_0x24af('0x50')){var _0x4d857f=_0x5bfe92['get']({'plain':!![]});var _0xfa3e7a=_0x24af('0x51');return db[_0x24af('0x52')][_0x24af('0x4c')]({'where':{'name':_0xfa3e7a,'userProfileId':_0x574309[_0x24af('0x53')]},'raw':!![]})[_0x24af('0x25')](function(_0xbe797f){if(_0xbe797f&&_0xbe797f[_0x24af('0x54')]===0x0){return db[_0x24af('0x29')]['create']({'name':_0x4d857f[_0x24af('0x34')],'resourceId':_0x4d857f['id'],'type':_0x24af('0x28'),'sectionId':_0xbe797f['id']},{})[_0x24af('0x25')](function(){return _0x5bfe92;});}else{return _0x5bfe92;}})['catch'](function(_0x5e3165){logger['error'](_0x24af('0x55'),_0x5e3165);throw _0x5e3165;});}return _0x5bfe92;})[_0x24af('0x25')](respondWithResult(_0x92cd6e,0xc9))[_0x24af('0x4a')](handleError(_0x92cd6e,null));};exports[_0x24af('0x24')]=function(_0x37b7c0,_0x44bafa){if(_0x37b7c0[_0x24af('0x4e')]['id']){delete _0x37b7c0[_0x24af('0x4e')]['id'];}return db[_0x24af('0x2e')]['find']({'where':{'id':_0x37b7c0[_0x24af('0x4b')]['id']}})[_0x24af('0x25')](handleEntityNotFound(_0x44bafa,null))[_0x24af('0x25')](saveUpdates(_0x37b7c0[_0x24af('0x4e')],null))['then'](respondWithResult(_0x44bafa,null))[_0x24af('0x4a')](handleError(_0x44bafa,null));};exports[_0x24af('0x26')]=function(_0x4bf9a0,_0x41e6a1){return db[_0x24af('0x2e')][_0x24af('0x4c')]({'where':{'id':_0x4bf9a0['params']['id']}})['then'](handleEntityNotFound(_0x41e6a1,null))[_0x24af('0x25')](removeEntity(_0x41e6a1,null))[_0x24af('0x4a')](handleError(_0x41e6a1,null));};exports['preview']=function(_0x29bae1,_0x49dbe3){var _0x3d92dd=0xa;var _0x5be1d0=[_0x24af('0x56'),'left_join',_0x24af('0x57'),_0x24af('0x58')];var _0x2cfa66={'SUM':_0x24af('0x59'),'COUNT':_0x24af('0x5a'),'COUNT DISTINCT':_0x24af('0x5b'),'MAX':_0x24af('0x5c'),'MIN':_0x24af('0x5d'),'AVG':_0x24af('0x5e'),'GROUP_CONCAT':_0x24af('0x5f'),'GROUP_CONCAT ASC':_0x24af('0x60'),'GROUP_CONCAT DESC':_0x24af('0x61')};var _0x3522d1={'SEC_TO_TIME':_0x24af('0x62'),'DATE':_0x24af('0x63'),'HOUR':_0x24af('0x64'),'ROUND':_0x24af('0x65'),'UNIX_TIMESTAMP':_0x24af('0x66')};var _0x36d2d8=function(_0x471bdd){return!_[_0x24af('0x67')]([_0x24af('0x68'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x24af('0x69')],_0x471bdd);};var _0x21b9ca=function(_0x4b3a24){if(!_0x4b3a24||!_0x4b3a24[_0x24af('0x6a')][_0x24af('0x3b')]){return'';}for(var _0x28fa48='(',_0x3dfc92=0x0;_0x3dfc92<_0x4b3a24[_0x24af('0x6a')]['length'];_0x3dfc92+=0x1){_0x3dfc92>0x0&&(_0x28fa48+='\x20'+_0x4b3a24[_0x24af('0x6b')]+'\x20');_0x28fa48+=_0x4b3a24[_0x24af('0x6a')][_0x3dfc92][_0x24af('0x6c')]?_0x21b9ca(_0x4b3a24['rules'][_0x3dfc92]['group']):_0x4b3a24[_0x24af('0x6a')][_0x3dfc92][_0x24af('0x6d')]+'\x20'+_0x4b3a24['rules'][_0x3dfc92][_0x24af('0x6e')]+(_0x36d2d8(_0x4b3a24[_0x24af('0x6a')][_0x3dfc92]['condition'])?'\x20'+_0x4b3a24[_0x24af('0x6a')][_0x3dfc92][_0x24af('0x6f')]:'');}return _0x28fa48+')';};var _0x1b52a7={'where':{'id':_0x29bae1['params']['id']}},_0x3a00ab,_0xfe7388,_0x1bfafe,_0x51a24f,_0x1792cf;_0x1b52a7=_['merge']({},_0x1b52a7,_0x29bae1[_0x24af('0x45')]);return db[_0x24af('0x2e')][_0x24af('0x4c')](_0x1b52a7)['then'](function(_0x304d60){if(_0x304d60){_0x3a00ab=_0x304d60;return _0x304d60['getFields']();}return null;})[_0x24af('0x25')](function(_0x5c52ff){if(_0x5c52ff){if(!_0x5c52ff[_0x24af('0x3b')]){throw new db['Sequelize'][(_0x24af('0x70'))](_0x24af('0x71'),0x193);}_0xfe7388=_0x5c52ff;return db['AnalyticMetric'][_0x24af('0x48')]({'raw':!![]});}return null;})[_0x24af('0x25')](function(_0x5b78e1){if(_0x5b78e1){_0x1bfafe=_['keyBy'](_0x5b78e1,'id');var _0x4e75db;var _0x2ad921=squel[_0x24af('0x72')]();_0x2ad921[_0x24af('0x73')](_0x3a00ab['table']);for(var _0xaba8bf=0x0;_0xaba8bf<_0xfe7388[_0x24af('0x3b')];_0xaba8bf+=0x1){_0x4e75db=_0xfe7388[_0xaba8bf][_0x24af('0x74')]?_0x1bfafe[_0xfe7388[_0xaba8bf][_0x24af('0x74')]]['metric']:_0xfe7388[_0xaba8bf][_0x24af('0x6d')];_0x4e75db=_0xfe7388[_0xaba8bf][_0x24af('0x75')]?_[_0x24af('0x76')](_0x2cfa66[_0xfe7388[_0xaba8bf][_0x24af('0x75')]],'%s',_0x4e75db):_0x4e75db;_0x4e75db=_0xfe7388[_0xaba8bf][_0x24af('0x77')]?_['replace'](_0x3522d1[_0xfe7388[_0xaba8bf][_0x24af('0x77')]],'%s',_0x4e75db):_0x4e75db;if(_0xfe7388[_0xaba8bf][_0x24af('0x78')]){_0x2ad921[_0x24af('0x6c')](_0x4e75db);}_0xfe7388[_0xaba8bf][_0x24af('0x79')]&&_0x2ad921[_0x24af('0x3e')](_0x4e75db,_0xfe7388[_0xaba8bf][_0x24af('0x79')]==='DESC'?![]:!![]);_0x2ad921[_0x24af('0x6d')](_0x4e75db,_0xfe7388[_0xaba8bf][_0x24af('0x7a')]||_0x4e75db);}if(_0x3a00ab[_0x24af('0x7b')]){_0x3a00ab['joins']=JSON['parse'](_0x3a00ab['joins']);for(var _0x37a036=0x0;_0x37a036<_0x3a00ab[_0x24af('0x7b')][_0x24af('0x3b')];_0x37a036+=0x1){if(_0x3a00ab[_0x24af('0x7b')][_0x37a036][_0x24af('0x31')]&&_[_0x24af('0x67')](_0x5be1d0,_0x3a00ab[_0x24af('0x7b')][_0x37a036][_0x24af('0x31')])&&_0x3a00ab[_0x24af('0x7b')][_0x37a036][_0x24af('0x7c')]&&_0x3a00ab[_0x24af('0x7b')][_0x37a036][_0x24af('0x7d')]&&_0x3a00ab[_0x24af('0x7b')][_0x37a036]['foreignKey']){_0x2ad921[_0x3a00ab[_0x24af('0x7b')][_0x37a036][_0x24af('0x31')]](_0x3a00ab[_0x24af('0x7b')][_0x37a036][_0x24af('0x7d')],null,util[_0x24af('0x77')](_0x24af('0x7e'),_0x3a00ab[_0x24af('0x7f')],_0x3a00ab[_0x24af('0x7b')][_0x37a036]['parentKey'],_0x3a00ab[_0x24af('0x7b')][_0x37a036][_0x24af('0x7d')],_0x3a00ab['joins'][_0x37a036][_0x24af('0x80')]));}}}if(_0x3a00ab[_0x24af('0x81')]){_0x3a00ab[_0x24af('0x81')]=JSON[_0x24af('0x82')](_0x3a00ab[_0x24af('0x81')]);_0x2ad921[_0x24af('0x40')](_0x21b9ca(_0x3a00ab['conditions']['group']));}_0x1792cf=_0x2ad921['clone']();_0x2ad921[_0x24af('0x1e')](_0x3d92dd);_0x2ad921[_0x24af('0x1d')](0x0);logger[_0x24af('0x83')](_0x24af('0x84'),_0x2ad921[_0x24af('0x85')]());return dbH[_0x24af('0x86')][_0x24af('0x35')](_0x2ad921[_0x24af('0x85')](),{'type':dbH['sequelize'][_0x24af('0x87')][_0x24af('0x88')]});}})[_0x24af('0x25')](respondWithResult(_0x49dbe3,null))[_0x24af('0x4a')](handleError(_0x49dbe3,null));};function runReport(_0x5a394d,_0xd2b632,_0x6889c3){var _0x361bcb=_0xd2b632['name'];var _0x1ec66b=0xa;var _0xc49d4b=[_0x24af('0x56'),_0x24af('0x89'),_0x24af('0x57'),'cross_join'];var _0x50f95e={'SUM':_0x24af('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x24af('0x5b'),'MAX':_0x24af('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x24af('0x5f'),'GROUP_CONCAT ASC':_0x24af('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5558bb={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x24af('0x63'),'HOUR':_0x24af('0x64'),'ROUND':_0x24af('0x65'),'UNIX_TIMESTAMP':_0x24af('0x66')};var _0x4292d8=function(_0x3f5cb4){return!_[_0x24af('0x67')]([_0x24af('0x68'),_0x24af('0x8a'),_0x24af('0x8b'),_0x24af('0x69')],_0x3f5cb4);};var _0xb8ba3b=function(_0x5c09cd){if(!_0x5c09cd||!_0x5c09cd['rules'][_0x24af('0x3b')]){return'';}for(var _0x4f1ac3='(',_0xfe62e4=0x0;_0xfe62e4<_0x5c09cd[_0x24af('0x6a')][_0x24af('0x3b')];_0xfe62e4+=0x1){_0xfe62e4>0x0&&(_0x4f1ac3+='\x20'+_0x5c09cd[_0x24af('0x6b')]+'\x20');_0x4f1ac3+=_0x5c09cd[_0x24af('0x6a')][_0xfe62e4]['group']?_0xb8ba3b(_0x5c09cd[_0x24af('0x6a')][_0xfe62e4][_0x24af('0x6c')]):_0x5c09cd[_0x24af('0x6a')][_0xfe62e4][_0x24af('0x6d')]+'\x20'+_0x5c09cd[_0x24af('0x6a')][_0xfe62e4][_0x24af('0x6e')]+(_0x4292d8(_0x5c09cd[_0x24af('0x6a')][_0xfe62e4]['condition'])?'\x20'+_0x5c09cd['rules'][_0xfe62e4][_0x24af('0x6f')]:'');}return _0x4f1ac3+')';};var _0x3560b3={'where':{'id':_0x5a394d['id']}},_0x2d73af,_0x2057d1,_0x5a6104,_0x689746,_0x4d1606;_0x3560b3=_[_0x24af('0x42')]({},_0x3560b3,_0x6889c3);return db['AnalyticCustomReport']['find'](_0x3560b3)[_0x24af('0x25')](function(_0x37c4f){if(_0x37c4f){_0x2d73af=_0x37c4f;return _0x37c4f[_0x24af('0x8c')]();}return null;})[_0x24af('0x25')](function(_0x1111d1){if(_0x1111d1){if(!_0x1111d1['length']){throw new db[(_0x24af('0x8d'))][(_0x24af('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2057d1=_0x1111d1;return db[_0x24af('0x8e')][_0x24af('0x48')]({'raw':!![]});}return null;})[_0x24af('0x25')](function(_0x5a0d62){if(_0x5a0d62){_0x5a6104=_[_0x24af('0x8f')](_0x5a0d62,'id');var _0x36e49a;var _0xd3984d=squel[_0x24af('0x72')]();_0xd3984d[_0x24af('0x73')](_0x2d73af['table']);for(var _0x267531=0x0;_0x267531<_0x2057d1[_0x24af('0x3b')];_0x267531+=0x1){_0x36e49a=_0x2057d1[_0x267531][_0x24af('0x74')]?_0x5a6104[_0x2057d1[_0x267531]['MetricId']][_0x24af('0x90')]:_0x2057d1[_0x267531][_0x24af('0x6d')];_0x36e49a=_0x2057d1[_0x267531][_0x24af('0x75')]?_[_0x24af('0x76')](_0x50f95e[_0x2057d1[_0x267531]['function']],'%s',_0x36e49a):_0x36e49a;_0x36e49a=_0x2057d1[_0x267531][_0x24af('0x77')]?_['replace'](_0x5558bb[_0x2057d1[_0x267531]['format']],'%s',_0x36e49a):_0x36e49a;if(_0x2057d1[_0x267531]['groupBy']){_0xd3984d[_0x24af('0x6c')](_0x36e49a);}_0x2057d1[_0x267531][_0x24af('0x79')]&&_0xd3984d[_0x24af('0x3e')](_0x36e49a,_0x2057d1[_0x267531][_0x24af('0x79')]===_0x24af('0x91')?![]:!![]);_0xd3984d[_0x24af('0x6d')](_0x36e49a,_0x2057d1[_0x267531]['alias']||_0x36e49a);}if(_0x2d73af[_0x24af('0x7b')]){_0x2d73af['joins']=JSON[_0x24af('0x82')](_0x2d73af[_0x24af('0x7b')]);for(var _0x5773c9=0x0;_0x5773c9<_0x2d73af['joins'][_0x24af('0x3b')];_0x5773c9+=0x1){if(_0x2d73af[_0x24af('0x7b')][_0x5773c9][_0x24af('0x31')]&&_[_0x24af('0x67')](_0xc49d4b,_0x2d73af[_0x24af('0x7b')][_0x5773c9][_0x24af('0x31')])&&_0x2d73af['joins'][_0x5773c9]['parentKey']&&_0x2d73af[_0x24af('0x7b')][_0x5773c9]['foreignTable']&&_0x2d73af['joins'][_0x5773c9][_0x24af('0x80')]){_0xd3984d[_0x2d73af[_0x24af('0x7b')][_0x5773c9][_0x24af('0x31')]](_0x2d73af[_0x24af('0x7b')][_0x5773c9]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x2d73af[_0x24af('0x7f')],_0x2d73af['joins'][_0x5773c9][_0x24af('0x7c')],_0x2d73af[_0x24af('0x7b')][_0x5773c9][_0x24af('0x7d')],_0x2d73af[_0x24af('0x7b')][_0x5773c9][_0x24af('0x80')]));}}}if(_0x2d73af[_0x24af('0x81')]){_0x2d73af[_0x24af('0x81')]=JSON[_0x24af('0x82')](_0x2d73af[_0x24af('0x81')]);_0xd3984d[_0x24af('0x40')](_0xb8ba3b(_0x2d73af['conditions']['group']));}_0x4d1606=_0xd3984d[_0x24af('0x92')]();_0xd3984d[_0x24af('0x1e')](_0x1ec66b);_0xd3984d[_0x24af('0x1d')](0x0);return;}})['then'](function(){if(_0xd2b632[_0x24af('0x93')]===_0x24af('0x94')){return null;}var _0x379bcf=_[_0x24af('0x42')](_0xd2b632,{'name':_0xd2b632[_0x24af('0x95')]||_0xd2b632[_0x24af('0x34')]||_0x2d73af[_0x24af('0x34')],'basename':_0x361bcb,'savename':util['format'](_0x24af('0x96'),_0xd2b632['name']||_0x2d73af[_0x24af('0x34')],require('randomstring')[_0x24af('0x97')](0x4),_0xd2b632[_0x24af('0x93')]||_0x24af('0x98')),'reportId':_0x2d73af['id'],'reportType':_0x24af('0x99')});return db[_0x24af('0x9a')]['create'](_0x379bcf,{'raw':!![]});})[_0x24af('0x25')](function(_0x22ae6f){if(_0x2d73af[_0x24af('0x7f')]===_0x24af('0x9b')){_0x4d1606[_0x24af('0x40')](_0x2d73af[_0x24af('0x7f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xd2b632[_0x24af('0x9c')],_0xd2b632[_0x24af('0x9d')]);}else{_0x4d1606[_0x24af('0x40')](_0x2d73af[_0x24af('0x7f')]+_0x24af('0x9e'),_0xd2b632[_0x24af('0x9c')],_0xd2b632['endDate']);}if(_0x22ae6f){logger[_0x24af('0x9f')]('Run\x20Query:',_0x4d1606[_0x24af('0x85')]());require(_0x24af('0xa0'))[_0x24af('0xa1')](path[_0x24af('0x56')](__dirname,'../../components/export/',_0x22ae6f[_0x24af('0x93')]),[_0x22ae6f['id'],_0x4d1606[_0x24af('0x85')](),path[_0x24af('0x56')](__dirname,_0x24af('0xa2'),_0x22ae6f['savename']),_0x361bcb]);return _0x22ae6f;}else{var _0x18082b=squel[_0x24af('0x72')]();_0x18082b['from']('('+_0x4d1606[_0x24af('0x85')]()+')',_0x24af('0xa3'));_0x18082b[_0x24af('0x6d')](_0x24af('0xa4'),'count');_0x4d1606['limit'](_0xd2b632[_0x24af('0x1e')]||_0x1ec66b);_0x4d1606[_0x24af('0x1d')](_0xd2b632['offset']||0x0);return dbH[_0x24af('0x86')][_0x24af('0x35')](_0x18082b[_0x24af('0x85')](),{'type':dbH[_0x24af('0x86')][_0x24af('0x87')][_0x24af('0x88')]})[_0x24af('0x25')](function(_0x115400){if(!_0x115400[_0x24af('0x3b')]){_0x689746=0x0;}else{_0x689746=_0x115400[0x0][_0x24af('0x20')]||0x0;}return dbH[_0x24af('0x86')][_0x24af('0x35')](_0x4d1606[_0x24af('0x85')](),{'type':dbH[_0x24af('0x86')][_0x24af('0x87')][_0x24af('0x88')]});})['then'](function(_0x3c3339){return{'rows':_0x3c3339||[],'count':_0x689746};});}});}exports[_0x24af('0xa5')]=function(_0x902c42,_0x22a04d){return runReport(_0x902c42['params'],_0x902c42[_0x24af('0x35')],_0x902c42[_0x24af('0x45')])[_0x24af('0x25')](respondWithResult(_0x22a04d,null))[_0x24af('0x4a')](handleError(_0x22a04d,null));};exports[_0x24af('0xa6')]=runReport;exports[_0x24af('0x35')]=function(_0x37836e,_0x2f083b){var _0x456b3b=0xa;var _0x1c69a1=['join',_0x24af('0x89'),'right_join',_0x24af('0x58')];var _0x5635d9={'SUM':_0x24af('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x24af('0x5b'),'MAX':_0x24af('0x5c'),'MIN':_0x24af('0x5d'),'AVG':_0x24af('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x24af('0x60'),'GROUP_CONCAT DESC':_0x24af('0x61')};var _0x41a722={'SEC_TO_TIME':_0x24af('0x62'),'DATE':_0x24af('0x63'),'HOUR':_0x24af('0x64'),'ROUND':_0x24af('0x65'),'UNIX_TIMESTAMP':_0x24af('0x66')};var _0x30d5bc=function(_0x423b76){return!_['includes']([_0x24af('0x68'),_0x24af('0x8a'),'IS\x20EMPTY',_0x24af('0x69')],_0x423b76);};var _0x317e29=function(_0x41320f){if(!_0x41320f||!_0x41320f[_0x24af('0x6a')][_0x24af('0x3b')]){return'';}for(var _0x2f13a9='(',_0x21f0fd=0x0;_0x21f0fd<_0x41320f['rules'][_0x24af('0x3b')];_0x21f0fd+=0x1){_0x21f0fd>0x0&&(_0x2f13a9+='\x20'+_0x41320f[_0x24af('0x6b')]+'\x20');_0x2f13a9+=_0x41320f[_0x24af('0x6a')][_0x21f0fd][_0x24af('0x6c')]?_0x317e29(_0x41320f[_0x24af('0x6a')][_0x21f0fd]['group']):_0x41320f[_0x24af('0x6a')][_0x21f0fd][_0x24af('0x6d')]+'\x20'+_0x41320f[_0x24af('0x6a')][_0x21f0fd][_0x24af('0x6e')]+(_0x30d5bc(_0x41320f[_0x24af('0x6a')][_0x21f0fd][_0x24af('0x6e')])?'\x20'+_0x41320f[_0x24af('0x6a')][_0x21f0fd][_0x24af('0x6f')]:'');}return _0x2f13a9+')';};var _0x59d87d={'where':{'id':_0x37836e[_0x24af('0x4b')]['id']}},_0x4886ca,_0x308f91,_0x184575,_0x4cff40,_0x49f38f;_0x59d87d=_[_0x24af('0x42')]({},_0x59d87d,_0x37836e[_0x24af('0x45')]);return db['AnalyticCustomReport'][_0x24af('0x4c')](_0x59d87d)['then'](function(_0x16c2b8){if(_0x16c2b8){_0x4886ca=_0x16c2b8;return _0x16c2b8[_0x24af('0x8c')]();}return null;})[_0x24af('0x25')](function(_0x505d0c){if(_0x505d0c){if(!_0x505d0c[_0x24af('0x3b')]){throw new db[(_0x24af('0x8d'))][(_0x24af('0x70'))](_0x24af('0x71'),0x193);}_0x308f91=_0x505d0c;return db[_0x24af('0x8e')][_0x24af('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1737a4){if(_0x1737a4){_0x184575=_[_0x24af('0x8f')](_0x1737a4,'id');var _0x2f722b;var _0x395998=squel[_0x24af('0x72')]();_0x395998[_0x24af('0x73')](_0x4886ca['table']);for(var _0x18733d=0x0;_0x18733d<_0x308f91[_0x24af('0x3b')];_0x18733d+=0x1){_0x2f722b=_0x308f91[_0x18733d][_0x24af('0x74')]?_0x184575[_0x308f91[_0x18733d][_0x24af('0x74')]][_0x24af('0x90')]:_0x308f91[_0x18733d][_0x24af('0x6d')];_0x2f722b=_0x308f91[_0x18733d][_0x24af('0x75')]?_[_0x24af('0x76')](_0x5635d9[_0x308f91[_0x18733d][_0x24af('0x75')]],'%s',_0x2f722b):_0x2f722b;_0x2f722b=_0x308f91[_0x18733d][_0x24af('0x77')]?_[_0x24af('0x76')](_0x41a722[_0x308f91[_0x18733d][_0x24af('0x77')]],'%s',_0x2f722b):_0x2f722b;if(_0x308f91[_0x18733d][_0x24af('0x78')]){_0x395998[_0x24af('0x6c')](_0x2f722b);}_0x308f91[_0x18733d][_0x24af('0x79')]&&_0x395998['order'](_0x2f722b,_0x308f91[_0x18733d][_0x24af('0x79')]===_0x24af('0x91')?![]:!![]);_0x395998[_0x24af('0x6d')](_0x2f722b,_0x308f91[_0x18733d][_0x24af('0x7a')]||_0x2f722b);}if(_0x4886ca[_0x24af('0x7b')]){_0x4886ca[_0x24af('0x7b')]=JSON[_0x24af('0x82')](_0x4886ca[_0x24af('0x7b')]);for(var _0x610648=0x0;_0x610648<_0x4886ca[_0x24af('0x7b')][_0x24af('0x3b')];_0x610648+=0x1){if(_0x4886ca['joins'][_0x610648][_0x24af('0x31')]&&_[_0x24af('0x67')](_0x1c69a1,_0x4886ca[_0x24af('0x7b')][_0x610648]['type'])&&_0x4886ca[_0x24af('0x7b')][_0x610648][_0x24af('0x7c')]&&_0x4886ca[_0x24af('0x7b')][_0x610648][_0x24af('0x7d')]&&_0x4886ca[_0x24af('0x7b')][_0x610648]['foreignKey']){_0x395998[_0x4886ca[_0x24af('0x7b')][_0x610648][_0x24af('0x31')]](_0x4886ca[_0x24af('0x7b')][_0x610648][_0x24af('0x7d')],null,util['format'](_0x24af('0x7e'),_0x4886ca[_0x24af('0x7f')],_0x4886ca[_0x24af('0x7b')][_0x610648][_0x24af('0x7c')],_0x4886ca[_0x24af('0x7b')][_0x610648][_0x24af('0x7d')],_0x4886ca['joins'][_0x610648][_0x24af('0x80')]));}}}if(_0x4886ca['conditions']){_0x4886ca[_0x24af('0x81')]=JSON[_0x24af('0x82')](_0x4886ca[_0x24af('0x81')]);_0x395998[_0x24af('0x40')](_0x317e29(_0x4886ca[_0x24af('0x81')][_0x24af('0x6c')]));}_0x49f38f=_0x395998[_0x24af('0x92')]();_0x395998[_0x24af('0x1e')](_0x456b3b);_0x395998[_0x24af('0x1d')](0x0);logger['debug'](_0x24af('0x84'),_0x395998['toString']());return dbH[_0x24af('0x86')][_0x24af('0x35')](_0x395998[_0x24af('0x85')](),{'type':dbH[_0x24af('0x86')]['QueryTypes']['SELECT']});}})[_0x24af('0x25')](function(){return{'sql':_0x49f38f[_0x24af('0x85')]()};})[_0x24af('0x25')](respondWithResult(_0x2f083b,null))[_0x24af('0x4a')](handleError(_0x2f083b,null));}; \ No newline at end of file +var _0x7235=['keyBy','from','groupBy','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','sequelize','QueryTypes','runReport','right_join','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','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','json','offset','limit','count','status','set','Content-Range','reject','save','then','destroy','get','UserProfileResource','end','error','stack','name','send','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','AnalyticCustomReport','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','SELECT','left_join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','condition'];(function(_0x25eecc,_0x4b5973){var _0x1aff79=function(_0x59564f){while(--_0x59564f){_0x25eecc['push'](_0x25eecc['shift']());}};_0x1aff79(++_0x4b5973);}(_0x7235,0xc5));var _0x5723=function(_0x481475,_0x8045e5){_0x481475=_0x481475-0x0;var _0x18deba=_0x7235[_0x481475];return _0x18deba;};'use strict';var emlformat=require(_0x5723('0x0'));var rimraf=require(_0x5723('0x1'));var zipdir=require(_0x5723('0x2'));var jsonpatch=require(_0x5723('0x3'));var rp=require(_0x5723('0x4'));var moment=require(_0x5723('0x5'));var BPromise=require(_0x5723('0x6'));var Mustache=require('mustache');var util=require(_0x5723('0x7'));var path=require('path');var sox=require(_0x5723('0x8'));var csv=require(_0x5723('0x9'));var ejs=require(_0x5723('0xa'));var fs=require('fs');var fs_extra=require(_0x5723('0xb'));var _=require(_0x5723('0xc'));var squel=require(_0x5723('0xd'));var crypto=require(_0x5723('0xe'));var jsforce=require(_0x5723('0xf'));var deskjs=require(_0x5723('0x10'));var toCsv=require(_0x5723('0x9'));var querystring=require(_0x5723('0x11'));var Papa=require('papaparse');var Redis=require(_0x5723('0x12'));var authService=require(_0x5723('0x13'));var qs=require(_0x5723('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5723('0x15'));var logger=require(_0x5723('0x16'))(_0x5723('0x17'));var utils=require(_0x5723('0x18'));var config=require(_0x5723('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require(_0x5723('0x1a'))[_0x5723('0x1b')];function respondWithStatusCode(_0x274900,_0x2bda57){_0x2bda57=_0x2bda57||0xcc;return function(_0x1911b8){if(_0x1911b8){return _0x274900[_0x5723('0x1c')](_0x2bda57);}return _0x274900['status'](_0x2bda57)['end']();};}function respondWithResult(_0x333152,_0x211c66){_0x211c66=_0x211c66||0xc8;return function(_0x2fc2d6){if(_0x2fc2d6){return _0x333152['status'](_0x211c66)[_0x5723('0x1d')](_0x2fc2d6);}};}function respondWithFilteredResult(_0x542f91,_0x33d74e){return function(_0x48ac04){if(_0x48ac04){var _0x44a3c0=typeof _0x33d74e[_0x5723('0x1e')]==='undefined'&&typeof _0x33d74e[_0x5723('0x1f')]==='undefined';var _0x5f2ef3=_0x48ac04[_0x5723('0x20')];var _0x2ea346=_0x44a3c0?0x0:_0x33d74e['offset'];var _0x4e86fc=_0x44a3c0?_0x48ac04[_0x5723('0x20')]:_0x33d74e['offset']+_0x33d74e[_0x5723('0x1f')];var _0x32d8af;if(_0x4e86fc>=_0x5f2ef3){_0x4e86fc=_0x5f2ef3;_0x32d8af=0xc8;}else{_0x32d8af=0xce;}_0x542f91[_0x5723('0x21')](_0x32d8af);return _0x542f91[_0x5723('0x22')](_0x5723('0x23'),_0x2ea346+'-'+_0x4e86fc+'/'+_0x5f2ef3)['json'](_0x48ac04);}return null;};}function patchUpdates(_0x19de69){return function(_0x5d5ff9){try{jsonpatch['apply'](_0x5d5ff9,_0x19de69,!![]);}catch(_0x3c1edb){return BPromise[_0x5723('0x24')](_0x3c1edb);}return _0x5d5ff9[_0x5723('0x25')]();};}function saveUpdates(_0x3b85c5,_0x107968){return function(_0x2967a5){if(_0x2967a5){return _0x2967a5['update'](_0x3b85c5)[_0x5723('0x26')](function(_0x5d52a5){return _0x5d52a5;});}return null;};}function removeEntity(_0x1a4254,_0x3ae1a0){return function(_0x1a0100){if(_0x1a0100){return _0x1a0100[_0x5723('0x27')]()[_0x5723('0x26')](function(){var _0x3a0278=_0x1a0100[_0x5723('0x28')]({'plain':!![]});var _0x3b4262='CustomReports';return db[_0x5723('0x29')][_0x5723('0x27')]({'where':{'type':_0x3b4262,'resourceId':_0x3a0278['id']}})[_0x5723('0x26')](function(){return _0x1a0100;});})[_0x5723('0x26')](function(){_0x1a4254[_0x5723('0x21')](0xcc)[_0x5723('0x2a')]();});}};}function handleEntityNotFound(_0x9432e1,_0x4599f3){return function(_0x4db799){if(!_0x4db799){_0x9432e1[_0x5723('0x1c')](0x194);}return _0x4db799;};}function handleError(_0x5adfea,_0x4d164b){_0x4d164b=_0x4d164b||0x1f4;return function(_0x51587b){logger[_0x5723('0x2b')](_0x51587b[_0x5723('0x2c')]);if(_0x51587b[_0x5723('0x2d')]){delete _0x51587b[_0x5723('0x2d')];}_0x5adfea[_0x5723('0x21')](_0x4d164b)[_0x5723('0x2e')](_0x51587b);};}exports['index']=function(_0xd4f3e5,_0x4fa41d){var _0x3dd43b={},_0x4d277c={},_0x225a35={'count':0x0,'rows':[]};var _0x50e5bc=_[_0x5723('0x2f')](db['AnalyticCustomReport']['rawAttributes'],function(_0x443b7c){return{'name':_0x443b7c[_0x5723('0x30')],'type':_0x443b7c[_0x5723('0x31')][_0x5723('0x32')]};});_0x4d277c[_0x5723('0x33')]=_[_0x5723('0x2f')](_0x50e5bc,_0x5723('0x2d'));_0x4d277c[_0x5723('0x34')]=_['keys'](_0xd4f3e5[_0x5723('0x34')]);_0x4d277c[_0x5723('0x35')]=_[_0x5723('0x36')](_0x4d277c[_0x5723('0x33')],_0x4d277c[_0x5723('0x34')]);_0x3dd43b['attributes']=_[_0x5723('0x36')](_0x4d277c[_0x5723('0x33')],qs['fields'](_0xd4f3e5[_0x5723('0x34')][_0x5723('0x37')]));_0x3dd43b[_0x5723('0x38')]=_0x3dd43b['attributes'][_0x5723('0x39')]?_0x3dd43b['attributes']:_0x4d277c['model'];if(!_0xd4f3e5['query'][_0x5723('0x3a')](_0x5723('0x3b'))){_0x3dd43b[_0x5723('0x1f')]=qs[_0x5723('0x1f')](_0xd4f3e5[_0x5723('0x34')][_0x5723('0x1f')]);_0x3dd43b[_0x5723('0x1e')]=qs[_0x5723('0x1e')](_0xd4f3e5[_0x5723('0x34')]['offset']);}_0x3dd43b[_0x5723('0x3c')]=qs[_0x5723('0x3d')](_0xd4f3e5[_0x5723('0x34')]['sort']);_0x3dd43b[_0x5723('0x3e')]=qs[_0x5723('0x35')](_[_0x5723('0x3f')](_0xd4f3e5[_0x5723('0x34')],_0x4d277c[_0x5723('0x35')]),_0x50e5bc);if(_0xd4f3e5[_0x5723('0x34')][_0x5723('0x40')]){_0x3dd43b[_0x5723('0x3e')]=_[_0x5723('0x41')](_0x3dd43b[_0x5723('0x3e')],{'$or':_[_0x5723('0x2f')](_0x50e5bc,function(_0x400b56){if(_0x400b56[_0x5723('0x31')]!==_0x5723('0x42')){var _0x332c6d={};_0x332c6d[_0x400b56['name']]={'$like':'%'+_0xd4f3e5['query'][_0x5723('0x40')]+'%'};return _0x332c6d;}})});}_0x3dd43b=_[_0x5723('0x41')]({},_0x3dd43b,_0xd4f3e5[_0x5723('0x43')]);var _0x52312d={'where':_0x3dd43b[_0x5723('0x3e')]};return db['AnalyticCustomReport']['count'](_0x52312d)[_0x5723('0x26')](function(_0x474f82){_0x225a35[_0x5723('0x20')]=_0x474f82;if(_0xd4f3e5[_0x5723('0x34')][_0x5723('0x44')]){_0x3dd43b[_0x5723('0x45')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x5723('0x46')](_0x3dd43b);})[_0x5723('0x26')](function(_0x1c207c){_0x225a35['rows']=_0x1c207c;return _0x225a35;})['then'](respondWithFilteredResult(_0x4fa41d,_0x3dd43b))[_0x5723('0x47')](handleError(_0x4fa41d,null));};exports[_0x5723('0x48')]=function(_0x3374c4,_0x10014d){var _0x41f455={'raw':![],'where':{'id':_0x3374c4[_0x5723('0x49')]['id']}},_0xab2f1c={};_0xab2f1c['model']=_[_0x5723('0x4a')](db['AnalyticCustomReport'][_0x5723('0x4b')]);_0xab2f1c['query']=_[_0x5723('0x4a')](_0x3374c4[_0x5723('0x34')]);_0xab2f1c[_0x5723('0x35')]=_[_0x5723('0x36')](_0xab2f1c[_0x5723('0x33')],_0xab2f1c[_0x5723('0x34')]);_0x41f455[_0x5723('0x38')]=_[_0x5723('0x36')](_0xab2f1c[_0x5723('0x33')],qs['fields'](_0x3374c4['query'][_0x5723('0x37')]));_0x41f455[_0x5723('0x38')]=_0x41f455[_0x5723('0x38')]['length']?_0x41f455[_0x5723('0x38')]:_0xab2f1c[_0x5723('0x33')];if(_0x3374c4['query'][_0x5723('0x44')]){_0x41f455['include']=[{'all':!![]}];}_0x41f455=_[_0x5723('0x41')]({},_0x41f455,_0x3374c4['options']);return db[_0x5723('0x4c')][_0x5723('0x4d')](_0x41f455)[_0x5723('0x26')](handleEntityNotFound(_0x10014d,null))[_0x5723('0x26')](respondWithResult(_0x10014d,null))[_0x5723('0x47')](handleError(_0x10014d,null));};exports['create']=function(_0x280bb5,_0x3d417a){return db[_0x5723('0x4c')][_0x5723('0x4e')](_0x280bb5['body'],{})[_0x5723('0x26')](function(_0x2df7ad){var _0x3cdc1e=_0x280bb5[_0x5723('0x4f')]['get']({'plain':!![]});if(!_0x3cdc1e)throw new Error(_0x5723('0x50'));if(_0x3cdc1e[_0x5723('0x51')]===_0x5723('0x4f')){var _0x5c3d58=_0x2df7ad[_0x5723('0x28')]({'plain':!![]});var _0x145d69=_0x5723('0x52');return db[_0x5723('0x53')][_0x5723('0x4d')]({'where':{'name':_0x145d69,'userProfileId':_0x3cdc1e['userProfileId']},'raw':!![]})[_0x5723('0x26')](function(_0x1b0fab){if(_0x1b0fab&&_0x1b0fab[_0x5723('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x5c3d58[_0x5723('0x2d')],'resourceId':_0x5c3d58['id'],'type':_0x5723('0x55'),'sectionId':_0x1b0fab['id']},{})[_0x5723('0x26')](function(){return _0x2df7ad;});}else{return _0x2df7ad;}})['catch'](function(_0x1f47a3){logger[_0x5723('0x2b')](_0x5723('0x56'),_0x1f47a3);throw _0x1f47a3;});}return _0x2df7ad;})[_0x5723('0x26')](respondWithResult(_0x3d417a,0xc9))[_0x5723('0x47')](handleError(_0x3d417a,null));};exports[_0x5723('0x57')]=function(_0x5d7fa7,_0xc4a4d0){if(_0x5d7fa7['body']['id']){delete _0x5d7fa7[_0x5723('0x58')]['id'];}return db[_0x5723('0x4c')]['find']({'where':{'id':_0x5d7fa7['params']['id']}})['then'](handleEntityNotFound(_0xc4a4d0,null))[_0x5723('0x26')](saveUpdates(_0x5d7fa7[_0x5723('0x58')],null))['then'](respondWithResult(_0xc4a4d0,null))[_0x5723('0x47')](handleError(_0xc4a4d0,null));};exports['destroy']=function(_0x215298,_0x3002c1){return db['AnalyticCustomReport'][_0x5723('0x4d')]({'where':{'id':_0x215298[_0x5723('0x49')]['id']}})[_0x5723('0x26')](handleEntityNotFound(_0x3002c1,null))[_0x5723('0x26')](removeEntity(_0x3002c1,null))['catch'](handleError(_0x3002c1,null));};exports[_0x5723('0x59')]=function(_0x2a14b8,_0x45b37d){var _0x3d9613=0xa;var _0x54c94c=[_0x5723('0x5a'),'left_join','right_join',_0x5723('0x5b')];var _0x307e9a={'SUM':_0x5723('0x5c'),'COUNT':_0x5723('0x5d'),'COUNT DISTINCT':_0x5723('0x5e'),'MAX':_0x5723('0x5f'),'MIN':_0x5723('0x60'),'AVG':_0x5723('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5723('0x62'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5d2bba={'SEC_TO_TIME':_0x5723('0x63'),'DATE':_0x5723('0x64'),'HOUR':_0x5723('0x65'),'ROUND':_0x5723('0x66'),'UNIX_TIMESTAMP':_0x5723('0x67')};var _0x223a21=function(_0x4618ae){return!_['includes']([_0x5723('0x68'),_0x5723('0x69'),_0x5723('0x6a'),_0x5723('0x6b')],_0x4618ae);};var _0x6a61b3=function(_0x2e49c5){if(!_0x2e49c5||!_0x2e49c5[_0x5723('0x6c')][_0x5723('0x39')]){return'';}for(var _0x27d03b='(',_0x1ce986=0x0;_0x1ce986<_0x2e49c5[_0x5723('0x6c')][_0x5723('0x39')];_0x1ce986+=0x1){_0x1ce986>0x0&&(_0x27d03b+='\x20'+_0x2e49c5[_0x5723('0x6d')]+'\x20');_0x27d03b+=_0x2e49c5[_0x5723('0x6c')][_0x1ce986][_0x5723('0x6e')]?_0x6a61b3(_0x2e49c5[_0x5723('0x6c')][_0x1ce986][_0x5723('0x6e')]):_0x2e49c5['rules'][_0x1ce986][_0x5723('0x6f')]+'\x20'+_0x2e49c5[_0x5723('0x6c')][_0x1ce986]['condition']+(_0x223a21(_0x2e49c5[_0x5723('0x6c')][_0x1ce986]['condition'])?'\x20'+_0x2e49c5[_0x5723('0x6c')][_0x1ce986][_0x5723('0x70')]:'');}return _0x27d03b+')';};var _0x469a0d={'where':{'id':_0x2a14b8[_0x5723('0x49')]['id']}},_0x5bfe85,_0x2cbdd2,_0x27667a,_0x223112,_0x1951b5;_0x469a0d=_[_0x5723('0x41')]({},_0x469a0d,_0x2a14b8['options']);return db[_0x5723('0x4c')][_0x5723('0x4d')](_0x469a0d)[_0x5723('0x26')](function(_0x56062b){if(_0x56062b){_0x5bfe85=_0x56062b;return _0x56062b[_0x5723('0x71')]();}return null;})['then'](function(_0x4ac47a){if(_0x4ac47a){if(!_0x4ac47a[_0x5723('0x39')]){throw new db[(_0x5723('0x72'))][(_0x5723('0x73'))](_0x5723('0x74'),0x193);}_0x2cbdd2=_0x4ac47a;return db[_0x5723('0x75')][_0x5723('0x46')]({'raw':!![]});}return null;})['then'](function(_0x2c73b3){if(_0x2c73b3){_0x27667a=_['keyBy'](_0x2c73b3,'id');var _0x3dd0a3;var _0x4d259a=squel[_0x5723('0x76')]();_0x4d259a['from'](_0x5bfe85[_0x5723('0x77')]);for(var _0x101cbb=0x0;_0x101cbb<_0x2cbdd2[_0x5723('0x39')];_0x101cbb+=0x1){_0x3dd0a3=_0x2cbdd2[_0x101cbb][_0x5723('0x78')]?_0x27667a[_0x2cbdd2[_0x101cbb][_0x5723('0x78')]][_0x5723('0x79')]:_0x2cbdd2[_0x101cbb][_0x5723('0x6f')];_0x3dd0a3=_0x2cbdd2[_0x101cbb][_0x5723('0x7a')]?_[_0x5723('0x7b')](_0x307e9a[_0x2cbdd2[_0x101cbb][_0x5723('0x7a')]],'%s',_0x3dd0a3):_0x3dd0a3;_0x3dd0a3=_0x2cbdd2[_0x101cbb][_0x5723('0x7c')]?_['replace'](_0x5d2bba[_0x2cbdd2[_0x101cbb][_0x5723('0x7c')]],'%s',_0x3dd0a3):_0x3dd0a3;if(_0x2cbdd2[_0x101cbb]['groupBy']){_0x4d259a['group'](_0x3dd0a3);}_0x2cbdd2[_0x101cbb][_0x5723('0x7d')]&&_0x4d259a['order'](_0x3dd0a3,_0x2cbdd2[_0x101cbb][_0x5723('0x7d')]===_0x5723('0x7e')?![]:!![]);_0x4d259a[_0x5723('0x6f')](_0x3dd0a3,_0x2cbdd2[_0x101cbb][_0x5723('0x7f')]||_0x3dd0a3);}if(_0x5bfe85[_0x5723('0x80')]){_0x5bfe85['joins']=JSON[_0x5723('0x81')](_0x5bfe85[_0x5723('0x80')]);for(var _0x36d80b=0x0;_0x36d80b<_0x5bfe85[_0x5723('0x80')][_0x5723('0x39')];_0x36d80b+=0x1){if(_0x5bfe85[_0x5723('0x80')][_0x36d80b][_0x5723('0x31')]&&_[_0x5723('0x82')](_0x54c94c,_0x5bfe85[_0x5723('0x80')][_0x36d80b][_0x5723('0x31')])&&_0x5bfe85[_0x5723('0x80')][_0x36d80b][_0x5723('0x83')]&&_0x5bfe85[_0x5723('0x80')][_0x36d80b][_0x5723('0x84')]&&_0x5bfe85[_0x5723('0x80')][_0x36d80b][_0x5723('0x85')]){_0x4d259a[_0x5bfe85[_0x5723('0x80')][_0x36d80b]['type']](_0x5bfe85[_0x5723('0x80')][_0x36d80b][_0x5723('0x84')],null,util['format'](_0x5723('0x86'),_0x5bfe85['table'],_0x5bfe85[_0x5723('0x80')][_0x36d80b][_0x5723('0x83')],_0x5bfe85['joins'][_0x36d80b]['foreignTable'],_0x5bfe85[_0x5723('0x80')][_0x36d80b]['foreignKey']));}}}if(_0x5bfe85[_0x5723('0x87')]){_0x5bfe85[_0x5723('0x87')]=JSON[_0x5723('0x81')](_0x5bfe85[_0x5723('0x87')]);_0x4d259a[_0x5723('0x3e')](_0x6a61b3(_0x5bfe85['conditions']['group']));}_0x1951b5=_0x4d259a[_0x5723('0x88')]();_0x4d259a[_0x5723('0x1f')](_0x3d9613);_0x4d259a[_0x5723('0x1e')](0x0);logger[_0x5723('0x89')](_0x5723('0x8a'),_0x4d259a[_0x5723('0x8b')]());return dbH['sequelize'][_0x5723('0x34')](_0x4d259a['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5723('0x8c')]});}})[_0x5723('0x26')](respondWithResult(_0x45b37d,null))['catch'](handleError(_0x45b37d,null));};function runReport(_0x18c056,_0xd3ff58,_0x1c2bf7){var _0x28e148=_0xd3ff58[_0x5723('0x2d')];var _0x577455=0xa;var _0x45b0f6=[_0x5723('0x5a'),_0x5723('0x8d'),'right_join',_0x5723('0x5b')];var _0x369218={'SUM':_0x5723('0x5c'),'COUNT':_0x5723('0x5d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5723('0x5f'),'MIN':'MIN(%s)','AVG':_0x5723('0x61'),'GROUP_CONCAT':_0x5723('0x8e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x5723('0x8f')};var _0x122d3b={'SEC_TO_TIME':_0x5723('0x63'),'DATE':_0x5723('0x64'),'HOUR':_0x5723('0x65'),'ROUND':_0x5723('0x66'),'UNIX_TIMESTAMP':_0x5723('0x67')};var _0x59e0f7=function(_0x3b3866){return!_[_0x5723('0x82')]([_0x5723('0x68'),_0x5723('0x69'),'IS\x20EMPTY',_0x5723('0x6b')],_0x3b3866);};var _0x46469e=function(_0x25983b){if(!_0x25983b||!_0x25983b[_0x5723('0x6c')][_0x5723('0x39')]){return'';}for(var _0x4fe8db='(',_0x1e9860=0x0;_0x1e9860<_0x25983b[_0x5723('0x6c')]['length'];_0x1e9860+=0x1){_0x1e9860>0x0&&(_0x4fe8db+='\x20'+_0x25983b[_0x5723('0x6d')]+'\x20');_0x4fe8db+=_0x25983b[_0x5723('0x6c')][_0x1e9860][_0x5723('0x6e')]?_0x46469e(_0x25983b[_0x5723('0x6c')][_0x1e9860]['group']):_0x25983b[_0x5723('0x6c')][_0x1e9860]['field']+'\x20'+_0x25983b['rules'][_0x1e9860][_0x5723('0x90')]+(_0x59e0f7(_0x25983b['rules'][_0x1e9860][_0x5723('0x90')])?'\x20'+_0x25983b['rules'][_0x1e9860][_0x5723('0x70')]:'');}return _0x4fe8db+')';};var _0x41897f={'where':{'id':_0x18c056['id']}},_0x597c2a,_0x2c897a,_0x192218,_0x1fb757,_0x373143;_0x41897f=_[_0x5723('0x41')]({},_0x41897f,_0x1c2bf7);return db['AnalyticCustomReport'][_0x5723('0x4d')](_0x41897f)[_0x5723('0x26')](function(_0x3d03cb){if(_0x3d03cb){_0x597c2a=_0x3d03cb;return _0x3d03cb['getFields']();}return null;})[_0x5723('0x26')](function(_0x26dfad){if(_0x26dfad){if(!_0x26dfad[_0x5723('0x39')]){throw new db[(_0x5723('0x72'))][(_0x5723('0x73'))](_0x5723('0x74'),0x193);}_0x2c897a=_0x26dfad;return db['AnalyticMetric'][_0x5723('0x46')]({'raw':!![]});}return null;})[_0x5723('0x26')](function(_0x15d68d){if(_0x15d68d){_0x192218=_[_0x5723('0x91')](_0x15d68d,'id');var _0x563776;var _0x181e5b=squel[_0x5723('0x76')]();_0x181e5b[_0x5723('0x92')](_0x597c2a[_0x5723('0x77')]);for(var _0x1375bd=0x0;_0x1375bd<_0x2c897a['length'];_0x1375bd+=0x1){_0x563776=_0x2c897a[_0x1375bd]['MetricId']?_0x192218[_0x2c897a[_0x1375bd][_0x5723('0x78')]]['metric']:_0x2c897a[_0x1375bd]['field'];_0x563776=_0x2c897a[_0x1375bd][_0x5723('0x7a')]?_[_0x5723('0x7b')](_0x369218[_0x2c897a[_0x1375bd]['function']],'%s',_0x563776):_0x563776;_0x563776=_0x2c897a[_0x1375bd]['format']?_[_0x5723('0x7b')](_0x122d3b[_0x2c897a[_0x1375bd]['format']],'%s',_0x563776):_0x563776;if(_0x2c897a[_0x1375bd][_0x5723('0x93')]){_0x181e5b['group'](_0x563776);}_0x2c897a[_0x1375bd]['orderBy']&&_0x181e5b['order'](_0x563776,_0x2c897a[_0x1375bd][_0x5723('0x7d')]===_0x5723('0x7e')?![]:!![]);_0x181e5b[_0x5723('0x6f')](_0x563776,_0x2c897a[_0x1375bd][_0x5723('0x7f')]||_0x563776);}if(_0x597c2a['joins']){_0x597c2a[_0x5723('0x80')]=JSON['parse'](_0x597c2a[_0x5723('0x80')]);for(var _0xd3934a=0x0;_0xd3934a<_0x597c2a[_0x5723('0x80')]['length'];_0xd3934a+=0x1){if(_0x597c2a[_0x5723('0x80')][_0xd3934a][_0x5723('0x31')]&&_['includes'](_0x45b0f6,_0x597c2a[_0x5723('0x80')][_0xd3934a][_0x5723('0x31')])&&_0x597c2a[_0x5723('0x80')][_0xd3934a][_0x5723('0x83')]&&_0x597c2a[_0x5723('0x80')][_0xd3934a][_0x5723('0x84')]&&_0x597c2a[_0x5723('0x80')][_0xd3934a][_0x5723('0x85')]){_0x181e5b[_0x597c2a[_0x5723('0x80')][_0xd3934a][_0x5723('0x31')]](_0x597c2a['joins'][_0xd3934a][_0x5723('0x84')],null,util[_0x5723('0x7c')](_0x5723('0x86'),_0x597c2a['table'],_0x597c2a[_0x5723('0x80')][_0xd3934a]['parentKey'],_0x597c2a[_0x5723('0x80')][_0xd3934a][_0x5723('0x84')],_0x597c2a[_0x5723('0x80')][_0xd3934a]['foreignKey']));}}}if(_0x597c2a[_0x5723('0x87')]){_0x597c2a[_0x5723('0x87')]=JSON[_0x5723('0x81')](_0x597c2a[_0x5723('0x87')]);_0x181e5b[_0x5723('0x3e')](_0x46469e(_0x597c2a[_0x5723('0x87')][_0x5723('0x6e')]));}_0x373143=_0x181e5b['clone']();_0x181e5b[_0x5723('0x1f')](_0x577455);_0x181e5b[_0x5723('0x1e')](0x0);return;}})[_0x5723('0x26')](function(){if(_0xd3ff58[_0x5723('0x94')]==='web'){return null;}var _0x4c238f=_['merge'](_0xd3ff58,{'name':_0xd3ff58[_0x5723('0x95')]||_0xd3ff58['name']||_0x597c2a[_0x5723('0x2d')],'basename':_0x28e148,'savename':util[_0x5723('0x7c')](_0x5723('0x96'),_0xd3ff58[_0x5723('0x2d')]||_0x597c2a['name'],require(_0x5723('0x97'))[_0x5723('0x98')](0x4),_0xd3ff58['output']||_0x5723('0x99')),'reportId':_0x597c2a['id'],'reportType':_0x5723('0x9a')});return db[_0x5723('0x9b')]['create'](_0x4c238f,{'raw':!![]});})[_0x5723('0x26')](function(_0x3ebb57){if(_0x597c2a[_0x5723('0x77')]===_0x5723('0x9c')){_0x373143[_0x5723('0x3e')](_0x597c2a['table']+_0x5723('0x9d'),_0xd3ff58[_0x5723('0x9e')],_0xd3ff58[_0x5723('0x9f')]);}else{_0x373143[_0x5723('0x3e')](_0x597c2a[_0x5723('0x77')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xd3ff58[_0x5723('0x9e')],_0xd3ff58['endDate']);}if(_0x3ebb57){logger[_0x5723('0xa0')]('Run\x20Query:',_0x373143[_0x5723('0x8b')]());require(_0x5723('0xa1'))['fork'](path[_0x5723('0x5a')](__dirname,_0x5723('0xa2'),_0x3ebb57[_0x5723('0x94')]),[_0x3ebb57['id'],_0x373143[_0x5723('0x8b')](),path[_0x5723('0x5a')](__dirname,_0x5723('0xa3'),_0x3ebb57[_0x5723('0xa4')]),_0x28e148]);return _0x3ebb57;}else{var _0x2e6b07=squel[_0x5723('0x76')]();_0x2e6b07[_0x5723('0x92')]('('+_0x373143['toString']()+')',_0x5723('0xa5'));_0x2e6b07['field'](_0x5723('0xa6'),_0x5723('0x20'));_0x373143[_0x5723('0x1f')](_0xd3ff58[_0x5723('0x1f')]||_0x577455);_0x373143[_0x5723('0x1e')](_0xd3ff58[_0x5723('0x1e')]||0x0);return dbH[_0x5723('0xa7')][_0x5723('0x34')](_0x2e6b07[_0x5723('0x8b')](),{'type':dbH[_0x5723('0xa7')]['QueryTypes']['SELECT']})[_0x5723('0x26')](function(_0x2176a4){if(!_0x2176a4[_0x5723('0x39')]){_0x1fb757=0x0;}else{_0x1fb757=_0x2176a4[0x0][_0x5723('0x20')]||0x0;}return dbH[_0x5723('0xa7')][_0x5723('0x34')](_0x373143[_0x5723('0x8b')](),{'type':dbH[_0x5723('0xa7')][_0x5723('0xa8')][_0x5723('0x8c')]});})[_0x5723('0x26')](function(_0xdf28d){return{'rows':_0xdf28d||[],'count':_0x1fb757};});}});}exports['run']=function(_0x1d5c99,_0x42bd1a){return runReport(_0x1d5c99[_0x5723('0x49')],_0x1d5c99[_0x5723('0x34')],_0x1d5c99['options'])[_0x5723('0x26')](respondWithResult(_0x42bd1a,null))['catch'](handleError(_0x42bd1a,null));};exports[_0x5723('0xa9')]=runReport;exports[_0x5723('0x34')]=function(_0x47b801,_0xbd1f26){var _0x45f92d=0xa;var _0x5a0ebb=[_0x5723('0x5a'),_0x5723('0x8d'),_0x5723('0xaa'),_0x5723('0x5b')];var _0x54e981={'SUM':_0x5723('0x5c'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5723('0x5f'),'MIN':_0x5723('0x60'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x5723('0x8e'),'GROUP_CONCAT ASC':_0x5723('0x62'),'GROUP_CONCAT DESC':_0x5723('0x8f')};var _0xffeddd={'SEC_TO_TIME':_0x5723('0x63'),'DATE':'DATE(%s)','HOUR':_0x5723('0x65'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5723('0x67')};var _0x1e8402=function(_0x3ac53d){return!_[_0x5723('0x82')]([_0x5723('0x68'),'IS\x20NOT\x20NULL',_0x5723('0x6a'),'IS\x20NOT\x20EMPTY'],_0x3ac53d);};var _0x203c9d=function(_0x29da22){if(!_0x29da22||!_0x29da22[_0x5723('0x6c')][_0x5723('0x39')]){return'';}for(var _0x18ed66='(',_0x21e997=0x0;_0x21e997<_0x29da22[_0x5723('0x6c')][_0x5723('0x39')];_0x21e997+=0x1){_0x21e997>0x0&&(_0x18ed66+='\x20'+_0x29da22[_0x5723('0x6d')]+'\x20');_0x18ed66+=_0x29da22['rules'][_0x21e997][_0x5723('0x6e')]?_0x203c9d(_0x29da22[_0x5723('0x6c')][_0x21e997][_0x5723('0x6e')]):_0x29da22[_0x5723('0x6c')][_0x21e997][_0x5723('0x6f')]+'\x20'+_0x29da22[_0x5723('0x6c')][_0x21e997][_0x5723('0x90')]+(_0x1e8402(_0x29da22[_0x5723('0x6c')][_0x21e997][_0x5723('0x90')])?'\x20'+_0x29da22[_0x5723('0x6c')][_0x21e997][_0x5723('0x70')]:'');}return _0x18ed66+')';};var _0x5915eb={'where':{'id':_0x47b801[_0x5723('0x49')]['id']}},_0x1bfe29,_0x2996cb,_0x57edae,_0x471df2,_0x1f8d9b;_0x5915eb=_['merge']({},_0x5915eb,_0x47b801['options']);return db[_0x5723('0x4c')][_0x5723('0x4d')](_0x5915eb)[_0x5723('0x26')](function(_0x43abe3){if(_0x43abe3){_0x1bfe29=_0x43abe3;return _0x43abe3['getFields']();}return null;})[_0x5723('0x26')](function(_0x1e3bd4){if(_0x1e3bd4){if(!_0x1e3bd4['length']){throw new db[(_0x5723('0x72'))]['ValidationErrorItem'](_0x5723('0x74'),0x193);}_0x2996cb=_0x1e3bd4;return db[_0x5723('0x75')][_0x5723('0x46')]({'raw':!![]});}return null;})['then'](function(_0x40656d){if(_0x40656d){_0x57edae=_['keyBy'](_0x40656d,'id');var _0x5e57c7;var _0x123034=squel['select']();_0x123034[_0x5723('0x92')](_0x1bfe29[_0x5723('0x77')]);for(var _0xa79251=0x0;_0xa79251<_0x2996cb['length'];_0xa79251+=0x1){_0x5e57c7=_0x2996cb[_0xa79251][_0x5723('0x78')]?_0x57edae[_0x2996cb[_0xa79251][_0x5723('0x78')]][_0x5723('0x79')]:_0x2996cb[_0xa79251]['field'];_0x5e57c7=_0x2996cb[_0xa79251][_0x5723('0x7a')]?_[_0x5723('0x7b')](_0x54e981[_0x2996cb[_0xa79251][_0x5723('0x7a')]],'%s',_0x5e57c7):_0x5e57c7;_0x5e57c7=_0x2996cb[_0xa79251][_0x5723('0x7c')]?_[_0x5723('0x7b')](_0xffeddd[_0x2996cb[_0xa79251][_0x5723('0x7c')]],'%s',_0x5e57c7):_0x5e57c7;if(_0x2996cb[_0xa79251][_0x5723('0x93')]){_0x123034['group'](_0x5e57c7);}_0x2996cb[_0xa79251][_0x5723('0x7d')]&&_0x123034[_0x5723('0x3c')](_0x5e57c7,_0x2996cb[_0xa79251]['orderBy']==='DESC'?![]:!![]);_0x123034[_0x5723('0x6f')](_0x5e57c7,_0x2996cb[_0xa79251][_0x5723('0x7f')]||_0x5e57c7);}if(_0x1bfe29[_0x5723('0x80')]){_0x1bfe29[_0x5723('0x80')]=JSON['parse'](_0x1bfe29[_0x5723('0x80')]);for(var _0x1b146e=0x0;_0x1b146e<_0x1bfe29['joins'][_0x5723('0x39')];_0x1b146e+=0x1){if(_0x1bfe29['joins'][_0x1b146e][_0x5723('0x31')]&&_['includes'](_0x5a0ebb,_0x1bfe29[_0x5723('0x80')][_0x1b146e]['type'])&&_0x1bfe29[_0x5723('0x80')][_0x1b146e][_0x5723('0x83')]&&_0x1bfe29[_0x5723('0x80')][_0x1b146e][_0x5723('0x84')]&&_0x1bfe29[_0x5723('0x80')][_0x1b146e][_0x5723('0x85')]){_0x123034[_0x1bfe29[_0x5723('0x80')][_0x1b146e][_0x5723('0x31')]](_0x1bfe29['joins'][_0x1b146e]['foreignTable'],null,util[_0x5723('0x7c')](_0x5723('0x86'),_0x1bfe29['table'],_0x1bfe29[_0x5723('0x80')][_0x1b146e][_0x5723('0x83')],_0x1bfe29[_0x5723('0x80')][_0x1b146e][_0x5723('0x84')],_0x1bfe29[_0x5723('0x80')][_0x1b146e][_0x5723('0x85')]));}}}if(_0x1bfe29[_0x5723('0x87')]){_0x1bfe29['conditions']=JSON[_0x5723('0x81')](_0x1bfe29['conditions']);_0x123034[_0x5723('0x3e')](_0x203c9d(_0x1bfe29['conditions'][_0x5723('0x6e')]));}_0x1f8d9b=_0x123034[_0x5723('0x88')]();_0x123034[_0x5723('0x1f')](_0x45f92d);_0x123034['offset'](0x0);logger[_0x5723('0x89')]('Limited\x20Query:',_0x123034[_0x5723('0x8b')]());return dbH[_0x5723('0xa7')][_0x5723('0x34')](_0x123034[_0x5723('0x8b')](),{'type':dbH[_0x5723('0xa7')][_0x5723('0xa8')][_0x5723('0x8c')]});}})[_0x5723('0x26')](function(){return{'sql':_0x1f8d9b[_0x5723('0x8b')]()};})['then'](respondWithResult(_0xbd1f26,null))[_0x5723('0x47')](handleError(_0xbd1f26,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 9e30550..cbd4f91 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 _0xe002=['moment','bluebird','request-promise','path','./analyticCustomReport.attributes','exports','lodash','util','../../config/logger','api'];(function(_0x42f0d1,_0x45fe4a){var _0x43f981=function(_0x5882e8){while(--_0x5882e8){_0x42f0d1['push'](_0x42f0d1['shift']());}};_0x43f981(++_0x45fe4a);}(_0xe002,0xba));var _0x2e00=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0xe002[_0xc82d1a];return _0x32fad2;};'use strict';var _=require(_0x2e00('0x0'));var util=require(_0x2e00('0x1'));var logger=require(_0x2e00('0x2'))(_0x2e00('0x3'));var moment=require(_0x2e00('0x4'));var BPromise=require(_0x2e00('0x5'));var rp=require(_0x2e00('0x6'));var fs=require('fs');var path=require(_0x2e00('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2e00('0x8'));module[_0x2e00('0x9')]=function(_0x351339,_0x11cb7c){return _0x351339['define']('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81ee=['exports','define','AnalyticCustomReport','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment','./analyticCustomReport.attributes'];(function(_0x511d75,_0x3b50bc){var _0x37a68d=function(_0x49698f){while(--_0x49698f){_0x511d75['push'](_0x511d75['shift']());}};_0x37a68d(++_0x3b50bc);}(_0x81ee,0xdf));var _0xe81e=function(_0x4a503d,_0x1bf7ed){_0x4a503d=_0x4a503d-0x0;var _0x1add04=_0x81ee[_0x4a503d];return _0x1add04;};'use strict';var _=require(_0xe81e('0x0'));var util=require(_0xe81e('0x1'));var logger=require(_0xe81e('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe81e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe81e('0x4'));var config=require(_0xe81e('0x5'));var attributes=require(_0xe81e('0x6'));module[_0xe81e('0x7')]=function(_0x187430,_0x566fd0){return _0x187430[_0xe81e('0x8')](_0xe81e('0x9'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 5912bca..71291a1 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 _0x335a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','AnalyticCustomReport,\x20%s,\x20%s','message','result','lodash'];(function(_0x3b0912,_0x39d739){var _0xa8f339=function(_0x6a31ab){while(--_0x6a31ab){_0x3b0912['push'](_0x3b0912['shift']());}};_0xa8f339(++_0x39d739);}(_0x335a,0x1df));var _0xa335=function(_0x5cf4f2,_0x4dea23){_0x5cf4f2=_0x5cf4f2-0x0;var _0x257949=_0x335a[_0x5cf4f2];return _0x257949;};'use strict';var _=require(_0xa335('0x0'));var util=require('util');var moment=require(_0xa335('0x1'));var BPromise=require(_0xa335('0x2'));var rs=require(_0xa335('0x3'));var fs=require('fs');var Redis=require(_0xa335('0x4'));var db=require(_0xa335('0x5'))['db'];var utils=require(_0xa335('0x6'));var logger=require(_0xa335('0x7'))(_0xa335('0x8'));var config=require('../../config/environment');var jayson=require(_0xa335('0x9'));var client=jayson['client'][_0xa335('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x249e7b,_0x194325,_0x515eb7){return new BPromise(function(_0x73d4ef,_0x22e081){return client[_0xa335('0xb')](_0x249e7b,_0x515eb7)['then'](function(_0x35493c){logger[_0xa335('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x194325,_0xa335('0xd'));logger[_0xa335('0xe')](_0xa335('0xf'),_0x194325,_0xa335('0xd'),JSON['stringify'](_0x35493c));if(_0x35493c[_0xa335('0x10')]){if(_0x35493c[_0xa335('0x10')]['code']===0x1f4){logger[_0xa335('0x10')](_0xa335('0x11'),_0x194325,_0x35493c[_0xa335('0x10')][_0xa335('0x12')]);return _0x22e081(_0x35493c[_0xa335('0x10')]['message']);}logger['error'](_0xa335('0x11'),_0x194325,_0x35493c[_0xa335('0x10')][_0xa335('0x12')]);return _0x73d4ef(_0x35493c[_0xa335('0x10')][_0xa335('0x12')]);}else{logger[_0xa335('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x194325,_0xa335('0xd'));_0x73d4ef(_0x35493c[_0xa335('0x13')]['message']);}})['catch'](function(_0x2878af){logger[_0xa335('0x10')](_0xa335('0x11'),_0x194325,_0x2878af);_0x22e081(_0x2878af);});});} \ No newline at end of file +var _0x37d8=['debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x3321f0,_0x507b32){var _0x331846=function(_0x459186){while(--_0x459186){_0x3321f0['push'](_0x3321f0['shift']());}};_0x331846(++_0x507b32);}(_0x37d8,0x171));var _0x837d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x37d8[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x837d('0x0'));var util=require('util');var moment=require(_0x837d('0x1'));var BPromise=require(_0x837d('0x2'));var rs=require(_0x837d('0x3'));var fs=require('fs');var Redis=require(_0x837d('0x4'));var db=require(_0x837d('0x5'))['db'];var utils=require(_0x837d('0x6'));var logger=require('../../config/logger')(_0x837d('0x7'));var config=require('../../config/environment');var jayson=require(_0x837d('0x8'));var client=jayson[_0x837d('0x9')][_0x837d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14d4cc,_0x3f255e,_0x5b6460){return new BPromise(function(_0x11401d,_0x10a2ea){return client[_0x837d('0xb')](_0x14d4cc,_0x5b6460)[_0x837d('0xc')](function(_0x15b48d){logger[_0x837d('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3f255e,_0x837d('0xe'));logger[_0x837d('0xf')](_0x837d('0x10'),_0x3f255e,_0x837d('0xe'),JSON[_0x837d('0x11')](_0x15b48d));if(_0x15b48d[_0x837d('0x12')]){if(_0x15b48d['error'][_0x837d('0x13')]===0x1f4){logger[_0x837d('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3f255e,_0x15b48d[_0x837d('0x12')][_0x837d('0x14')]);return _0x10a2ea(_0x15b48d['error'][_0x837d('0x14')]);}logger[_0x837d('0x12')](_0x837d('0x15'),_0x3f255e,_0x15b48d[_0x837d('0x12')][_0x837d('0x14')]);return _0x11401d(_0x15b48d[_0x837d('0x12')]['message']);}else{logger['info'](_0x837d('0x15'),_0x3f255e,_0x837d('0xe'));_0x11401d(_0x15b48d[_0x837d('0x16')][_0x837d('0x14')]);}})[_0x837d('0x17')](function(_0x4d6d4d){logger['error'](_0x837d('0x15'),_0x3f255e,_0x4d6d4d);_0x10a2ea(_0x4d6d4d);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index d121643..328a679 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 _0x6d97=['/:id/query','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run'];(function(_0xf7c076,_0x351a0e){var _0x2dd7c0=function(_0x3a8da1){while(--_0x3a8da1){_0xf7c076['push'](_0xf7c076['shift']());}};_0x2dd7c0(++_0x351a0e);}(_0x6d97,0x1be));var _0x76d9=function(_0x50f92b,_0x32fab3){_0x50f92b=_0x50f92b-0x0;var _0x5cedbc=_0x6d97[_0x50f92b];return _0x5cedbc;};'use strict';var multer=require(_0x76d9('0x0'));var util=require(_0x76d9('0x1'));var path=require(_0x76d9('0x2'));var timeout=require(_0x76d9('0x3'));var express=require(_0x76d9('0x4'));var router=express[_0x76d9('0x5')]();var fs_extra=require(_0x76d9('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x76d9('0x7'));var config=require(_0x76d9('0x8'));var controller=require('./analyticCustomReport.controller');router[_0x76d9('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x76d9('0xa'),auth[_0x76d9('0xb')](),controller[_0x76d9('0xc')]);router[_0x76d9('0x9')](_0x76d9('0xd'),auth[_0x76d9('0xb')](),controller[_0x76d9('0xe')]);router[_0x76d9('0x9')](_0x76d9('0xf'),auth['isAuthenticated'](),controller['run']);router['get'](_0x76d9('0x10'),auth[_0x76d9('0xb')](),controller['query']);router['post']('/',auth[_0x76d9('0xb')](),controller[_0x76d9('0x11')]);router['put'](_0x76d9('0xa'),auth[_0x76d9('0xb')](),controller[_0x76d9('0x12')]);router[_0x76d9('0x13')](_0x76d9('0xa'),auth['isAuthenticated'](),controller[_0x76d9('0x14')]);module['exports']=router; \ No newline at end of file +var _0xee54=['get','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','/:id','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xee54,0x184));var _0x4ee5=function(_0x373dfc,_0x3653d8){_0x373dfc=_0x373dfc-0x0;var _0x19a305=_0xee54[_0x373dfc];return _0x19a305;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ee5('0x0'));var timeout=require(_0x4ee5('0x1'));var express=require(_0x4ee5('0x2'));var router=express[_0x4ee5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4ee5('0x4'));var interaction=require(_0x4ee5('0x5'));var config=require(_0x4ee5('0x6'));var controller=require(_0x4ee5('0x7'));router['get']('/',auth[_0x4ee5('0x8')](),controller[_0x4ee5('0x9')]);router['get'](_0x4ee5('0xa'),auth[_0x4ee5('0x8')](),controller[_0x4ee5('0xb')]);router[_0x4ee5('0xc')](_0x4ee5('0xd'),auth[_0x4ee5('0x8')](),controller[_0x4ee5('0xe')]);router[_0x4ee5('0xc')](_0x4ee5('0xf'),auth[_0x4ee5('0x8')](),controller[_0x4ee5('0x10')]);router[_0x4ee5('0xc')](_0x4ee5('0x11'),auth[_0x4ee5('0x8')](),controller[_0x4ee5('0x12')]);router[_0x4ee5('0x13')]('/',auth[_0x4ee5('0x8')](),controller[_0x4ee5('0x14')]);router['put'](_0x4ee5('0xa'),auth[_0x4ee5('0x8')](),controller[_0x4ee5('0x15')]);router[_0x4ee5('0x16')](_0x4ee5('0xa'),auth[_0x4ee5('0x8')](),controller[_0x4ee5('0x17')]);module[_0x4ee5('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 6835891..ed8c648 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 _0x8958=['TEXT','exports'];(function(_0x99ff94,_0x47a1b1){var _0x1b5bc0=function(_0x25821f){while(--_0x25821f){_0x99ff94['push'](_0x99ff94['shift']());}};_0x1b5bc0(++_0x47a1b1);}(_0x8958,0x93));var _0x8895=function(_0x2ad231,_0x3b2095){_0x2ad231=_0x2ad231-0x0;var _0x4e05df=_0x8958[_0x2ad231];return _0x4e05df;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8895('0x1')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x6f47=['TEXT','exports','STRING'];(function(_0xe58a55,_0x3bdfcd){var _0x295932=function(_0x211d8d){while(--_0x211d8d){_0xe58a55['push'](_0xe58a55['shift']());}};_0x295932(++_0x3bdfcd);}(_0x6f47,0xc7));var _0x76f4=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x6f47[_0x2a6809];return _0x11c371;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'name':{'type':Sequelize[_0x76f4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x76f4('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x76f4('0x2')]},'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 28f975f..f5095dc 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 _0x4975=['set','Content-Range','save','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','index','AnalyticDefaultReport','rawAttributes','type','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','body','role','user','Reports','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','SUM(%s)','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','joins','includes','parentKey','foreignKey','foreignTable','conditions','parse','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','HOUR(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','alias','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','cross_join','getFields','replace','clone','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x5c35ca,_0x2a253f){var _0xe026ac=function(_0x4272bf){while(--_0x4272bf){_0x5c35ca['push'](_0x5c35ca['shift']());}};_0xe026ac(++_0x2a253f);}(_0x4975,0x86));var _0x5497=function(_0x3701e1,_0x45b69e){_0x3701e1=_0x3701e1-0x0;var _0x5e46a8=_0x4975[_0x3701e1];return _0x5e46a8;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];var dbH=require(_0x5497('0x17'))[_0x5497('0x18')];function respondWithStatusCode(_0x984990,_0x747dc7){_0x747dc7=_0x747dc7||0xcc;return function(_0x365144){if(_0x365144){return _0x984990[_0x5497('0x19')](_0x747dc7);}return _0x984990[_0x5497('0x1a')](_0x747dc7)[_0x5497('0x1b')]();};}function respondWithResult(_0x1a4c74,_0x55f590){_0x55f590=_0x55f590||0xc8;return function(_0x11b0a9){if(_0x11b0a9){return _0x1a4c74['status'](_0x55f590)[_0x5497('0x1c')](_0x11b0a9);}};}function respondWithFilteredResult(_0x2bfd8a,_0x19e5f3){return function(_0x3ce50b){if(_0x3ce50b){var _0x37c18e=typeof _0x19e5f3[_0x5497('0x1d')]===_0x5497('0x1e')&&typeof _0x19e5f3['limit']==='undefined';var _0x3f4d20=_0x3ce50b[_0x5497('0x1f')];var _0x3a47fd=_0x37c18e?0x0:_0x19e5f3['offset'];var _0xbf1ba7=_0x37c18e?_0x3ce50b[_0x5497('0x1f')]:_0x19e5f3[_0x5497('0x1d')]+_0x19e5f3[_0x5497('0x20')];var _0x1b1b43;if(_0xbf1ba7>=_0x3f4d20){_0xbf1ba7=_0x3f4d20;_0x1b1b43=0xc8;}else{_0x1b1b43=0xce;}_0x2bfd8a[_0x5497('0x1a')](_0x1b1b43);return _0x2bfd8a[_0x5497('0x21')](_0x5497('0x22'),_0x3a47fd+'-'+_0xbf1ba7+'/'+_0x3f4d20)[_0x5497('0x1c')](_0x3ce50b);}return null;};}function patchUpdates(_0x3f54ef){return function(_0x186065){try{jsonpatch['apply'](_0x186065,_0x3f54ef,!![]);}catch(_0x720767){return BPromise['reject'](_0x720767);}return _0x186065[_0x5497('0x23')]();};}function saveUpdates(_0xd0868d,_0x44265c){return function(_0x2f587d){if(_0x2f587d){return _0x2f587d[_0x5497('0x24')](_0xd0868d)[_0x5497('0x25')](function(_0x5018fa){return _0x5018fa;});}return null;};}function removeEntity(_0x54043a,_0x1eefce){return function(_0x34b97f){if(_0x34b97f){return _0x34b97f[_0x5497('0x26')]()[_0x5497('0x25')](function(){var _0x5223b5=_0x34b97f[_0x5497('0x27')]({'plain':!![]});var _0x57268c=_0x5497('0x28');return db[_0x5497('0x29')][_0x5497('0x26')]({'where':{'type':_0x57268c,'resourceId':_0x5223b5['id']}})[_0x5497('0x25')](function(){return _0x34b97f;});})[_0x5497('0x25')](function(){_0x54043a[_0x5497('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af5f4,_0x5406e2){return function(_0x583d06){if(!_0x583d06){_0x4af5f4['sendStatus'](0x194);}return _0x583d06;};}function handleError(_0x39a2b7,_0x48d146){_0x48d146=_0x48d146||0x1f4;return function(_0x5e9356){logger[_0x5497('0x2a')](_0x5e9356[_0x5497('0x2b')]);if(_0x5e9356[_0x5497('0x2c')]){delete _0x5e9356['name'];}_0x39a2b7['status'](_0x48d146)['send'](_0x5e9356);};}exports[_0x5497('0x2d')]=function(_0x471e0b,_0xf4c117){var _0x5b8f79={},_0x489f71={},_0x594866={'count':0x0,'rows':[]};var _0xa28dd8=_['map'](db[_0x5497('0x2e')][_0x5497('0x2f')],function(_0x77c575){return{'name':_0x77c575['fieldName'],'type':_0x77c575[_0x5497('0x30')][_0x5497('0x31')]};});_0x489f71['model']=_[_0x5497('0x32')](_0xa28dd8,_0x5497('0x2c'));_0x489f71[_0x5497('0x33')]=_['keys'](_0x471e0b[_0x5497('0x33')]);_0x489f71[_0x5497('0x34')]=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],_0x489f71[_0x5497('0x33')]);_0x5b8f79['attributes']=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],qs['fields'](_0x471e0b[_0x5497('0x33')][_0x5497('0x37')]));_0x5b8f79[_0x5497('0x38')]=_0x5b8f79[_0x5497('0x38')][_0x5497('0x39')]?_0x5b8f79[_0x5497('0x38')]:_0x489f71['model'];if(!_0x471e0b[_0x5497('0x33')]['hasOwnProperty'](_0x5497('0x3a'))){_0x5b8f79[_0x5497('0x20')]=qs[_0x5497('0x20')](_0x471e0b['query']['limit']);_0x5b8f79[_0x5497('0x1d')]=qs[_0x5497('0x1d')](_0x471e0b[_0x5497('0x33')][_0x5497('0x1d')]);}_0x5b8f79[_0x5497('0x3b')]=qs[_0x5497('0x3c')](_0x471e0b['query'][_0x5497('0x3c')]);_0x5b8f79[_0x5497('0x3d')]=qs[_0x5497('0x34')](_[_0x5497('0x3e')](_0x471e0b[_0x5497('0x33')],_0x489f71[_0x5497('0x34')]),_0xa28dd8);if(_0x471e0b[_0x5497('0x33')][_0x5497('0x3f')]){_0x5b8f79[_0x5497('0x3d')]=_['merge'](_0x5b8f79[_0x5497('0x3d')],{'$or':_[_0x5497('0x32')](_0xa28dd8,function(_0x1e9616){if(_0x1e9616[_0x5497('0x30')]!==_0x5497('0x40')){var _0xa5ebe6={};_0xa5ebe6[_0x1e9616[_0x5497('0x2c')]]={'$like':'%'+_0x471e0b['query'][_0x5497('0x3f')]+'%'};return _0xa5ebe6;}})});}_0x5b8f79=_[_0x5497('0x41')]({},_0x5b8f79,_0x471e0b[_0x5497('0x42')]);var _0x35993c={'where':_0x5b8f79[_0x5497('0x3d')]};return db[_0x5497('0x2e')][_0x5497('0x1f')](_0x35993c)['then'](function(_0x2137bd){_0x594866[_0x5497('0x1f')]=_0x2137bd;if(_0x471e0b[_0x5497('0x33')][_0x5497('0x43')]){_0x5b8f79[_0x5497('0x44')]=[{'all':!![]}];}return db[_0x5497('0x2e')][_0x5497('0x45')](_0x5b8f79);})[_0x5497('0x25')](function(_0x2021ae){_0x594866[_0x5497('0x46')]=_0x2021ae;return _0x594866;})['then'](respondWithFilteredResult(_0xf4c117,_0x5b8f79))[_0x5497('0x47')](handleError(_0xf4c117,null));};exports['show']=function(_0x40822a,_0x9fc24){var _0x26ef01={'raw':!![],'where':{'id':_0x40822a[_0x5497('0x48')]['id']}},_0x3602ec={};_0x3602ec['model']=_[_0x5497('0x49')](db[_0x5497('0x2e')]['rawAttributes']);_0x3602ec[_0x5497('0x33')]=_['keys'](_0x40822a[_0x5497('0x33')]);_0x3602ec['filters']=_[_0x5497('0x35')](_0x3602ec[_0x5497('0x36')],_0x3602ec[_0x5497('0x33')]);_0x26ef01[_0x5497('0x38')]=_[_0x5497('0x35')](_0x3602ec['model'],qs['fields'](_0x40822a['query']['fields']));_0x26ef01[_0x5497('0x38')]=_0x26ef01[_0x5497('0x38')][_0x5497('0x39')]?_0x26ef01[_0x5497('0x38')]:_0x3602ec[_0x5497('0x36')];if(_0x40822a[_0x5497('0x33')][_0x5497('0x43')]){_0x26ef01[_0x5497('0x44')]=[{'all':!![]}];}_0x26ef01=_[_0x5497('0x41')]({},_0x26ef01,_0x40822a['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x26ef01)[_0x5497('0x25')](handleEntityNotFound(_0x9fc24,null))['then'](respondWithResult(_0x9fc24,null))[_0x5497('0x47')](handleError(_0x9fc24,null));};exports['create']=function(_0x12ffbc,_0x31f1ba){return db[_0x5497('0x2e')]['create'](_0x12ffbc[_0x5497('0x4b')],{})[_0x5497('0x25')](function(_0x515c3e){var _0x3abc92=_0x12ffbc['user'][_0x5497('0x27')]({'plain':!![]});if(!_0x3abc92)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3abc92[_0x5497('0x4c')]===_0x5497('0x4d')){var _0x26fd9f=_0x515c3e[_0x5497('0x27')]({'plain':!![]});var _0x25e80c=_0x5497('0x4e');return db[_0x5497('0x4f')][_0x5497('0x4a')]({'where':{'name':_0x25e80c,'userProfileId':_0x3abc92['userProfileId']},'raw':!![]})[_0x5497('0x25')](function(_0x5b2c22){if(_0x5b2c22&&_0x5b2c22['autoAssociation']===0x0){return db[_0x5497('0x29')][_0x5497('0x50')]({'name':_0x26fd9f['name'],'resourceId':_0x26fd9f['id'],'type':_0x5497('0x28'),'sectionId':_0x5b2c22['id']},{})[_0x5497('0x25')](function(){return _0x515c3e;});}else{return _0x515c3e;}})[_0x5497('0x47')](function(_0x3094c7){logger['error'](_0x5497('0x51'),_0x3094c7);throw _0x3094c7;});}return _0x515c3e;})['then'](respondWithResult(_0x31f1ba,0xc9))['catch'](handleError(_0x31f1ba,null));};exports[_0x5497('0x24')]=function(_0x33dd07,_0x2f7ec8){if(_0x33dd07['body']['id']){delete _0x33dd07['body']['id'];}return db[_0x5497('0x2e')]['find']({'where':{'id':_0x33dd07[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f7ec8,null))[_0x5497('0x25')](saveUpdates(_0x33dd07['body'],null))[_0x5497('0x25')](respondWithResult(_0x2f7ec8,null))[_0x5497('0x47')](handleError(_0x2f7ec8,null));};exports['destroy']=function(_0x418f17,_0x5dccfb){return db['AnalyticDefaultReport'][_0x5497('0x4a')]({'where':{'id':_0x418f17[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x5dccfb,null))[_0x5497('0x25')](removeEntity(_0x5dccfb,null))[_0x5497('0x47')](handleError(_0x5dccfb,null));};exports[_0x5497('0x52')]=function(_0x28b2a3,_0x3fca40){var _0x25c75e=0xa;var _0x590be7=[_0x5497('0x53'),'left_join','right_join','cross_join'];var _0x1f3965={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5497('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x25f349={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x425995=function(_0xc783ce){return!_['includes']([_0x5497('0x5e'),_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0xc783ce);};var _0x5823f6=function(_0x31271c){if(!_0x31271c||!_0x31271c[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x542bcf='(',_0x1ab48f=0x0;_0x1ab48f<_0x31271c['rules']['length'];_0x1ab48f+=0x1){_0x1ab48f>0x0&&(_0x542bcf+='\x20'+_0x31271c['operator']+'\x20');_0x542bcf+=_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x63')]?_0x5823f6(_0x31271c[_0x5497('0x62')][_0x1ab48f]['group']):_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x64')]+'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x65')]+(_0x425995(_0x31271c['rules'][_0x1ab48f][_0x5497('0x65')])?'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x66')]:'');}return _0x542bcf+')';};var _0x49617c={'where':{'id':_0x28b2a3[_0x5497('0x48')]['id']}},_0x164de1,_0x465bed,_0xb3eec2,_0x4368e3,_0x1467c4;_0x49617c=_[_0x5497('0x41')]({},_0x49617c,_0x28b2a3['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x49617c)[_0x5497('0x25')](function(_0x20efea){if(_0x20efea){_0x164de1=_0x20efea;return _0x20efea['getFields']();}return null;})['then'](function(_0x4a7360){if(_0x4a7360){if(!_0x4a7360[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x465bed=_0x4a7360;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x464df3){if(_0x464df3){_0xb3eec2=_[_0x5497('0x6a')](_0x464df3,'id');var _0x4338d4;var _0x3f38bf=squel[_0x5497('0x6b')]();_0x3f38bf[_0x5497('0x6c')](_0x164de1[_0x5497('0x6d')]);for(var _0x1fc6ad=0x0;_0x1fc6ad<_0x465bed['length'];_0x1fc6ad+=0x1){_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x6e')]?_0xb3eec2[_0x465bed[_0x1fc6ad][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x465bed[_0x1fc6ad]['field'];_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x70')]?_['replace'](_0x1f3965[_0x465bed[_0x1fc6ad][_0x5497('0x70')]],'%s',_0x4338d4):_0x4338d4;_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x71')]?_['replace'](_0x25f349[_0x465bed[_0x1fc6ad][_0x5497('0x71')]],'%s',_0x4338d4):_0x4338d4;if(_0x465bed[_0x1fc6ad][_0x5497('0x72')]){_0x3f38bf[_0x5497('0x63')](_0x4338d4);}_0x465bed[_0x1fc6ad][_0x5497('0x73')]&&_0x3f38bf['order'](_0x4338d4,_0x465bed[_0x1fc6ad][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x3f38bf[_0x5497('0x64')](_0x4338d4,_0x465bed[_0x1fc6ad]['alias']||_0x4338d4);}if(_0x164de1[_0x5497('0x75')]){_0x164de1[_0x5497('0x75')]=JSON['parse'](_0x164de1[_0x5497('0x75')]);for(var _0xebe694=0x0;_0xebe694<_0x164de1[_0x5497('0x75')]['length'];_0xebe694+=0x1){if(_0x164de1['joins'][_0xebe694][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x590be7,_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x30')])&&_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x77')]&&_0x164de1[_0x5497('0x75')][_0xebe694]['foreignTable']&&_0x164de1['joins'][_0xebe694][_0x5497('0x78')]){_0x3f38bf[_0x164de1[_0x5497('0x75')][_0xebe694]['type']](_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],null,util[_0x5497('0x71')]('%s.%s\x20=\x20%s.%s',_0x164de1[_0x5497('0x6d')],_0x164de1[_0x5497('0x75')][_0xebe694]['parentKey'],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x78')]));}}}if(_0x164de1[_0x5497('0x7a')]){_0x164de1['conditions']=JSON[_0x5497('0x7b')](_0x164de1[_0x5497('0x7a')]);_0x3f38bf[_0x5497('0x3d')](_0x5823f6(_0x164de1[_0x5497('0x7a')][_0x5497('0x63')]));}_0x1467c4=_0x3f38bf['clone']();_0x3f38bf[_0x5497('0x20')](_0x25c75e);_0x3f38bf[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')](_0x5497('0x7d'),_0x3f38bf['toString']());return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x3f38bf['toString'](),{'type':dbH[_0x5497('0x7e')][_0x5497('0x7f')][_0x5497('0x80')]});}})[_0x5497('0x25')](respondWithResult(_0x3fca40,null))['catch'](handleError(_0x3fca40,null));};function runReport(_0x547de7,_0x4ff64f,_0x5343d5){var _0x594761=_0x4ff64f[_0x5497('0x2c')];var _0x2375cc=0xa;var _0x15d0da=[_0x5497('0x53'),_0x5497('0x81'),'right_join','cross_join'];var _0x392987={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x4c41c4={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x22b019=function(_0x4aa4ba){return!_[_0x5497('0x76')](['IS\x20NULL',_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0x4aa4ba);};var _0x5b0f9d=function(_0x59960b){if(!_0x59960b||!_0x59960b[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x953b31='(',_0xeb52c9=0x0;_0xeb52c9<_0x59960b[_0x5497('0x62')][_0x5497('0x39')];_0xeb52c9+=0x1){_0xeb52c9>0x0&&(_0x953b31+='\x20'+_0x59960b[_0x5497('0x86')]+'\x20');_0x953b31+=_0x59960b[_0x5497('0x62')][_0xeb52c9]['group']?_0x5b0f9d(_0x59960b['rules'][_0xeb52c9]['group']):_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x64')]+'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x65')]+(_0x22b019(_0x59960b['rules'][_0xeb52c9]['condition'])?'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x66')]:'');}return _0x953b31+')';};var _0x5dd9bc={'where':{'id':_0x547de7['id']}},_0x83b240,_0x2fc11a,_0x3ce2ee,_0x36c09f,_0x51e9fb;_0x5dd9bc=_['merge']({},_0x5dd9bc,_0x5343d5);return db['AnalyticDefaultReport']['find'](_0x5dd9bc)['then'](function(_0x497295){if(_0x497295){_0x83b240=_0x497295;return _0x497295['getFields']();}return null;})[_0x5497('0x25')](function(_0x5aa5e1){if(_0x5aa5e1){if(!_0x5aa5e1[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))](_0x5497('0x87'),0x193);}_0x2fc11a=_0x5aa5e1;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})['then'](function(_0x77d52c){if(_0x77d52c){_0x3ce2ee=_['keyBy'](_0x77d52c,'id');var _0x15a67d;var _0x2721b2=squel[_0x5497('0x6b')]();_0x2721b2[_0x5497('0x6c')](_0x83b240[_0x5497('0x6d')]);for(var _0x38fa59=0x0;_0x38fa59<_0x2fc11a[_0x5497('0x39')];_0x38fa59+=0x1){_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x6e')]?_0x3ce2ee[_0x2fc11a[_0x38fa59][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x2fc11a[_0x38fa59]['field'];_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x70')]?_['replace'](_0x392987[_0x2fc11a[_0x38fa59][_0x5497('0x70')]],'%s',_0x15a67d):_0x15a67d;_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x71')]?_['replace'](_0x4c41c4[_0x2fc11a[_0x38fa59][_0x5497('0x71')]],'%s',_0x15a67d):_0x15a67d;if(_0x2fc11a[_0x38fa59][_0x5497('0x72')]){_0x2721b2[_0x5497('0x63')](_0x15a67d);}_0x2fc11a[_0x38fa59][_0x5497('0x73')]&&_0x2721b2[_0x5497('0x3b')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x2721b2[_0x5497('0x64')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x88')]||_0x15a67d);}if(_0x83b240[_0x5497('0x75')]){_0x83b240[_0x5497('0x75')]=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x75')]);for(var _0x22426e=0x0;_0x22426e<_0x83b240['joins'][_0x5497('0x39')];_0x22426e+=0x1){if(_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x15d0da,_0x83b240[_0x5497('0x75')][_0x22426e]['type'])&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')]&&_0x83b240['joins'][_0x22426e]['foreignTable']&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]){_0x2721b2[_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]](_0x83b240[_0x5497('0x75')][_0x22426e]['foreignTable'],null,util['format'](_0x5497('0x89'),_0x83b240['table'],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x79')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]));}}}if(_0x83b240['conditions']){_0x83b240['conditions']=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x7a')]);_0x2721b2[_0x5497('0x3d')](_0x5b0f9d(_0x83b240['conditions'][_0x5497('0x63')]));}_0x51e9fb=_0x2721b2['clone']();_0x2721b2[_0x5497('0x20')](_0x2375cc);_0x2721b2['offset'](0x0);return;}})['then'](function(){if(_0x4ff64f[_0x5497('0x8a')]===_0x5497('0x8b')){return null;}var _0x4ce768=_[_0x5497('0x41')](_0x4ff64f,{'name':_0x4ff64f[_0x5497('0x8c')]||_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],'basename':_0x594761,'savename':util['format'](_0x5497('0x8d'),_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],require(_0x5497('0x8e'))[_0x5497('0x8f')](0x4),_0x4ff64f['output']||_0x5497('0x90')),'reportId':_0x83b240['id'],'reportType':'default'});return db[_0x5497('0x91')][_0x5497('0x50')](_0x4ce768,{'raw':!![]});})[_0x5497('0x25')](function(_0x314db4){if(_0x83b240[_0x5497('0x6d')]===_0x5497('0x92')){_0x51e9fb[_0x5497('0x3d')](_0x83b240[_0x5497('0x6d')]+_0x5497('0x93'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}else{_0x51e9fb['where'](_0x83b240[_0x5497('0x6d')]+_0x5497('0x96'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}if(_0x314db4){logger[_0x5497('0x97')](_0x5497('0x98'),_0x51e9fb[_0x5497('0x99')]());require(_0x5497('0x9a'))[_0x5497('0x9b')](path[_0x5497('0x53')](__dirname,_0x5497('0x9c'),_0x314db4['output']),[_0x314db4['id'],_0x51e9fb[_0x5497('0x99')](),path[_0x5497('0x53')](__dirname,_0x5497('0x9d'),_0x314db4[_0x5497('0x9e')]),_0x594761]);return _0x314db4;}else{var _0x46be08=squel[_0x5497('0x6b')]();_0x46be08[_0x5497('0x6c')]('('+_0x51e9fb[_0x5497('0x99')]()+')',_0x5497('0x9f'));_0x46be08[_0x5497('0x64')](_0x5497('0xa0'),_0x5497('0x1f'));_0x51e9fb[_0x5497('0x20')](_0x4ff64f[_0x5497('0x20')]||_0x2375cc);_0x51e9fb['offset'](_0x4ff64f['offset']||0x0);return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x46be08[_0x5497('0x99')](),{'type':dbH['sequelize'][_0x5497('0x7f')][_0x5497('0x80')]})[_0x5497('0x25')](function(_0x2bd48c){if(!_0x2bd48c[_0x5497('0x39')]){_0x36c09f=0x0;}else{_0x36c09f=_0x2bd48c[0x0][_0x5497('0x1f')]||0x0;}return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x51e9fb['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5497('0x80')]});})[_0x5497('0x25')](function(_0x4dab6a){return{'rows':_0x4dab6a||[],'count':_0x36c09f};});}});}exports[_0x5497('0xa1')]=function(_0x27f42b,_0x1bef85){return runReport(_0x27f42b['params'],_0x27f42b[_0x5497('0x33')],_0x27f42b['options'])[_0x5497('0x25')](respondWithResult(_0x1bef85,null))[_0x5497('0x47')](handleError(_0x1bef85,null));};exports[_0x5497('0xa2')]=runReport;exports['query']=function(_0x1c3dad,_0xfba062){var _0x494cc3=0xa;var _0x401f04=[_0x5497('0x53'),_0x5497('0x81'),'right_join',_0x5497('0xa3')];var _0x1a5c32={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x1dfb76={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x5c2517=function(_0x367929){return!_[_0x5497('0x76')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5497('0x60'),_0x5497('0x61')],_0x367929);};var _0x2fd2e3=function(_0x2fe770){if(!_0x2fe770||!_0x2fe770['rules'][_0x5497('0x39')]){return'';}for(var _0x1299cd='(',_0x4c2b14=0x0;_0x4c2b14<_0x2fe770['rules'][_0x5497('0x39')];_0x4c2b14+=0x1){_0x4c2b14>0x0&&(_0x1299cd+='\x20'+_0x2fe770[_0x5497('0x86')]+'\x20');_0x1299cd+=_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x63')]?_0x2fd2e3(_0x2fe770[_0x5497('0x62')][_0x4c2b14]['group']):_0x2fe770['rules'][_0x4c2b14][_0x5497('0x64')]+'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14]['condition']+(_0x5c2517(_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x65')])?'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x66')]:'');}return _0x1299cd+')';};var _0x358ec5={'where':{'id':_0x1c3dad['params']['id']}},_0x5cddbc,_0x188d21,_0xf92129,_0x2d5cc1,_0x4f9228;_0x358ec5=_[_0x5497('0x41')]({},_0x358ec5,_0x1c3dad[_0x5497('0x42')]);return db[_0x5497('0x2e')]['find'](_0x358ec5)[_0x5497('0x25')](function(_0x30a248){if(_0x30a248){_0x5cddbc=_0x30a248;return _0x30a248[_0x5497('0xa4')]();}return null;})['then'](function(_0x1d4c76){if(_0x1d4c76){if(!_0x1d4c76[_0x5497('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0x5497('0x87'),0x193);}_0x188d21=_0x1d4c76;return db[_0x5497('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x5001d5){if(_0x5001d5){_0xf92129=_[_0x5497('0x6a')](_0x5001d5,'id');var _0x2c58e6;var _0x300f3e=squel[_0x5497('0x6b')]();_0x300f3e[_0x5497('0x6c')](_0x5cddbc[_0x5497('0x6d')]);for(var _0x23732d=0x0;_0x23732d<_0x188d21['length'];_0x23732d+=0x1){_0x2c58e6=_0x188d21[_0x23732d]['MetricId']?_0xf92129[_0x188d21[_0x23732d][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x188d21[_0x23732d]['field'];_0x2c58e6=_0x188d21[_0x23732d]['function']?_[_0x5497('0xa5')](_0x1a5c32[_0x188d21[_0x23732d][_0x5497('0x70')]],'%s',_0x2c58e6):_0x2c58e6;_0x2c58e6=_0x188d21[_0x23732d][_0x5497('0x71')]?_[_0x5497('0xa5')](_0x1dfb76[_0x188d21[_0x23732d][_0x5497('0x71')]],'%s',_0x2c58e6):_0x2c58e6;if(_0x188d21[_0x23732d][_0x5497('0x72')]){_0x300f3e['group'](_0x2c58e6);}_0x188d21[_0x23732d][_0x5497('0x73')]&&_0x300f3e[_0x5497('0x3b')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x300f3e[_0x5497('0x64')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x88')]||_0x2c58e6);}if(_0x5cddbc['joins']){_0x5cddbc[_0x5497('0x75')]=JSON['parse'](_0x5cddbc[_0x5497('0x75')]);for(var _0x261804=0x0;_0x261804<_0x5cddbc[_0x5497('0x75')]['length'];_0x261804+=0x1){if(_0x5cddbc[_0x5497('0x75')][_0x261804]['type']&&_['includes'](_0x401f04,_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')])&&_0x5cddbc['joins'][_0x261804][_0x5497('0x77')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]){_0x300f3e[_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')]](_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],null,util['format'](_0x5497('0x89'),_0x5cddbc[_0x5497('0x6d')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x77')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]));}}}if(_0x5cddbc[_0x5497('0x7a')]){_0x5cddbc[_0x5497('0x7a')]=JSON[_0x5497('0x7b')](_0x5cddbc[_0x5497('0x7a')]);_0x300f3e[_0x5497('0x3d')](_0x2fd2e3(_0x5cddbc[_0x5497('0x7a')][_0x5497('0x63')]));}_0x4f9228=_0x300f3e[_0x5497('0xa6')]();_0x300f3e[_0x5497('0x20')](_0x494cc3);_0x300f3e[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')]('Limited\x20Query:',_0x300f3e[_0x5497('0x99')]());return dbH[_0x5497('0x7e')]['query'](_0x300f3e['toString'](),{'type':dbH[_0x5497('0x7e')]['QueryTypes'][_0x5497('0x80')]});}})[_0x5497('0x25')](function(){return{'sql':_0x4f9228[_0x5497('0x99')]()};})[_0x5497('0x25')](respondWithResult(_0xfba062,null))[_0x5497('0x47')](handleError(_0xfba062,null));}; \ No newline at end of file +var _0xc6ac=['keyBy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','DefaultReports','UserProfileResource','stack','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','name','query','keys','filters','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','intersection','length','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','field','condition','value','Sequelize','AnalyticMetric','select','from','table','MetricId','replace','format','group','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','COUNT(%s)','COUNT(DISTINCT\x20%s)','IS\x20NOT\x20EMPTY','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','metric','function','groupBy','orderBy','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','getFields'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x383e35,_0x57ebee){_0x383e35=_0x383e35-0x0;var _0x149af8=_0xc6ac[_0x383e35];return _0x149af8;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xcc6a('0x1b')];function respondWithStatusCode(_0x211444,_0x4300c0){_0x4300c0=_0x4300c0||0xcc;return function(_0x559a0a){if(_0x559a0a){return _0x211444['sendStatus'](_0x4300c0);}return _0x211444[_0xcc6a('0x1c')](_0x4300c0)[_0xcc6a('0x1d')]();};}function respondWithResult(_0x43710d,_0x348af7){_0x348af7=_0x348af7||0xc8;return function(_0x96f9de){if(_0x96f9de){return _0x43710d[_0xcc6a('0x1c')](_0x348af7)[_0xcc6a('0x1e')](_0x96f9de);}};}function respondWithFilteredResult(_0x403b18,_0x56ffb0){return function(_0x4e628f){if(_0x4e628f){var _0x4d021a=typeof _0x56ffb0[_0xcc6a('0x1f')]===_0xcc6a('0x20')&&typeof _0x56ffb0[_0xcc6a('0x21')]===_0xcc6a('0x20');var _0x33079c=_0x4e628f[_0xcc6a('0x22')];var _0x2d9585=_0x4d021a?0x0:_0x56ffb0[_0xcc6a('0x1f')];var _0x374e51=_0x4d021a?_0x4e628f[_0xcc6a('0x22')]:_0x56ffb0[_0xcc6a('0x1f')]+_0x56ffb0['limit'];var _0xfec60f;if(_0x374e51>=_0x33079c){_0x374e51=_0x33079c;_0xfec60f=0xc8;}else{_0xfec60f=0xce;}_0x403b18[_0xcc6a('0x1c')](_0xfec60f);return _0x403b18[_0xcc6a('0x23')](_0xcc6a('0x24'),_0x2d9585+'-'+_0x374e51+'/'+_0x33079c)[_0xcc6a('0x1e')](_0x4e628f);}return null;};}function patchUpdates(_0x30b8ed){return function(_0x36c80f){try{jsonpatch[_0xcc6a('0x25')](_0x36c80f,_0x30b8ed,!![]);}catch(_0x2254a8){return BPromise[_0xcc6a('0x26')](_0x2254a8);}return _0x36c80f[_0xcc6a('0x27')]();};}function saveUpdates(_0x845088,_0x51be9a){return function(_0x41c4c8){if(_0x41c4c8){return _0x41c4c8[_0xcc6a('0x28')](_0x845088)[_0xcc6a('0x29')](function(_0x581aae){return _0x581aae;});}return null;};}function removeEntity(_0x10016a,_0x294486){return function(_0x3a00e5){if(_0x3a00e5){return _0x3a00e5[_0xcc6a('0x2a')]()[_0xcc6a('0x29')](function(){var _0x5fc697=_0x3a00e5['get']({'plain':!![]});var _0x26def8=_0xcc6a('0x2b');return db[_0xcc6a('0x2c')]['destroy']({'where':{'type':_0x26def8,'resourceId':_0x5fc697['id']}})[_0xcc6a('0x29')](function(){return _0x3a00e5;});})[_0xcc6a('0x29')](function(){_0x10016a['status'](0xcc)[_0xcc6a('0x1d')]();});}};}function handleEntityNotFound(_0x8b1b2b,_0x3233d1){return function(_0x473f88){if(!_0x473f88){_0x8b1b2b['sendStatus'](0x194);}return _0x473f88;};}function handleError(_0x194aab,_0x3cf14c){_0x3cf14c=_0x3cf14c||0x1f4;return function(_0x2c6d88){logger['error'](_0x2c6d88[_0xcc6a('0x2d')]);if(_0x2c6d88['name']){delete _0x2c6d88['name'];}_0x194aab[_0xcc6a('0x1c')](_0x3cf14c)[_0xcc6a('0x2e')](_0x2c6d88);};}exports[_0xcc6a('0x2f')]=function(_0x11b481,_0x2b575d){var _0x131138={},_0x4e2de4={},_0x7b2b54={'count':0x0,'rows':[]};var _0x28e3c3=_[_0xcc6a('0x30')](db[_0xcc6a('0x31')][_0xcc6a('0x32')],function(_0x152ebd){return{'name':_0x152ebd[_0xcc6a('0x33')],'type':_0x152ebd[_0xcc6a('0x34')]['key']};});_0x4e2de4[_0xcc6a('0x35')]=_[_0xcc6a('0x30')](_0x28e3c3,_0xcc6a('0x36'));_0x4e2de4[_0xcc6a('0x37')]=_[_0xcc6a('0x38')](_0x11b481[_0xcc6a('0x37')]);_0x4e2de4[_0xcc6a('0x39')]=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],_0x4e2de4['query']);_0x131138['attributes']=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3a')]));_0x131138[_0xcc6a('0x3b')]=_0x131138['attributes']['length']?_0x131138[_0xcc6a('0x3b')]:_0x4e2de4[_0xcc6a('0x35')];if(!_0x11b481[_0xcc6a('0x37')]['hasOwnProperty'](_0xcc6a('0x3c'))){_0x131138[_0xcc6a('0x21')]=qs[_0xcc6a('0x21')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x21')]);_0x131138[_0xcc6a('0x1f')]=qs[_0xcc6a('0x1f')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x1f')]);}_0x131138[_0xcc6a('0x3d')]=qs[_0xcc6a('0x3e')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3e')]);_0x131138[_0xcc6a('0x3f')]=qs[_0xcc6a('0x39')](_[_0xcc6a('0x40')](_0x11b481[_0xcc6a('0x37')],_0x4e2de4[_0xcc6a('0x39')]),_0x28e3c3);if(_0x11b481['query']['filter']){_0x131138[_0xcc6a('0x3f')]=_[_0xcc6a('0x41')](_0x131138[_0xcc6a('0x3f')],{'$or':_[_0xcc6a('0x30')](_0x28e3c3,function(_0x1e628b){if(_0x1e628b[_0xcc6a('0x34')]!==_0xcc6a('0x42')){var _0x1199f1={};_0x1199f1[_0x1e628b['name']]={'$like':'%'+_0x11b481['query'][_0xcc6a('0x43')]+'%'};return _0x1199f1;}})});}_0x131138=_['merge']({},_0x131138,_0x11b481['options']);var _0x5cf1ba={'where':_0x131138[_0xcc6a('0x3f')]};return db[_0xcc6a('0x31')][_0xcc6a('0x22')](_0x5cf1ba)[_0xcc6a('0x29')](function(_0xe8056f){_0x7b2b54['count']=_0xe8056f;if(_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x44')]){_0x131138[_0xcc6a('0x45')]=[{'all':!![]}];}return db[_0xcc6a('0x31')][_0xcc6a('0x46')](_0x131138);})[_0xcc6a('0x29')](function(_0x54f862){_0x7b2b54[_0xcc6a('0x47')]=_0x54f862;return _0x7b2b54;})[_0xcc6a('0x29')](respondWithFilteredResult(_0x2b575d,_0x131138))[_0xcc6a('0x48')](handleError(_0x2b575d,null));};exports[_0xcc6a('0x49')]=function(_0x494904,_0x1fe723){var _0x4a9cea={'raw':!![],'where':{'id':_0x494904[_0xcc6a('0x4a')]['id']}},_0x351529={};_0x351529[_0xcc6a('0x35')]=_['keys'](db[_0xcc6a('0x31')][_0xcc6a('0x32')]);_0x351529[_0xcc6a('0x37')]=_['keys'](_0x494904['query']);_0x351529[_0xcc6a('0x39')]=_[_0xcc6a('0x4b')](_0x351529[_0xcc6a('0x35')],_0x351529[_0xcc6a('0x37')]);_0x4a9cea[_0xcc6a('0x3b')]=_['intersection'](_0x351529[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x494904['query'][_0xcc6a('0x3a')]));_0x4a9cea[_0xcc6a('0x3b')]=_0x4a9cea[_0xcc6a('0x3b')][_0xcc6a('0x4c')]?_0x4a9cea[_0xcc6a('0x3b')]:_0x351529[_0xcc6a('0x35')];if(_0x494904['query']['includeAll']){_0x4a9cea['include']=[{'all':!![]}];}_0x4a9cea=_[_0xcc6a('0x41')]({},_0x4a9cea,_0x494904[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4a9cea)['then'](handleEntityNotFound(_0x1fe723,null))[_0xcc6a('0x29')](respondWithResult(_0x1fe723,null))['catch'](handleError(_0x1fe723,null));};exports[_0xcc6a('0x4f')]=function(_0x4299ca,_0xcfc540){return db[_0xcc6a('0x31')][_0xcc6a('0x4f')](_0x4299ca[_0xcc6a('0x50')],{})['then'](function(_0x1a3b82){var _0x7288b2=_0x4299ca[_0xcc6a('0x51')][_0xcc6a('0x52')]({'plain':!![]});if(!_0x7288b2)throw new Error(_0xcc6a('0x53'));if(_0x7288b2[_0xcc6a('0x54')]===_0xcc6a('0x51')){var _0x392805=_0x1a3b82[_0xcc6a('0x52')]({'plain':!![]});var _0x30d0ef='Reports';return db[_0xcc6a('0x55')][_0xcc6a('0x4e')]({'where':{'name':_0x30d0ef,'userProfileId':_0x7288b2[_0xcc6a('0x56')]},'raw':!![]})[_0xcc6a('0x29')](function(_0x14f5e5){if(_0x14f5e5&&_0x14f5e5[_0xcc6a('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x392805[_0xcc6a('0x36')],'resourceId':_0x392805['id'],'type':'DefaultReports','sectionId':_0x14f5e5['id']},{})[_0xcc6a('0x29')](function(){return _0x1a3b82;});}else{return _0x1a3b82;}})[_0xcc6a('0x48')](function(_0x2b5782){logger[_0xcc6a('0x58')](_0xcc6a('0x59'),_0x2b5782);throw _0x2b5782;});}return _0x1a3b82;})[_0xcc6a('0x29')](respondWithResult(_0xcfc540,0xc9))[_0xcc6a('0x48')](handleError(_0xcfc540,null));};exports[_0xcc6a('0x28')]=function(_0x68b823,_0x27b074){if(_0x68b823[_0xcc6a('0x50')]['id']){delete _0x68b823['body']['id'];}return db[_0xcc6a('0x31')]['find']({'where':{'id':_0x68b823[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x27b074,null))[_0xcc6a('0x29')](saveUpdates(_0x68b823['body'],null))[_0xcc6a('0x29')](respondWithResult(_0x27b074,null))['catch'](handleError(_0x27b074,null));};exports[_0xcc6a('0x2a')]=function(_0x5db3b5,_0x3c0b1c){return db[_0xcc6a('0x31')][_0xcc6a('0x4e')]({'where':{'id':_0x5db3b5[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x3c0b1c,null))[_0xcc6a('0x29')](removeEntity(_0x3c0b1c,null))[_0xcc6a('0x48')](handleError(_0x3c0b1c,null));};exports[_0xcc6a('0x5a')]=function(_0x506311,_0x14d3ff){var _0x56d512=0xa;var _0x3a6b7e=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x586789={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x389e5f={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2cc561=function(_0x483aa4){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x483aa4);};var _0x46d93b=function(_0x4ed702){if(!_0x4ed702||!_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x20a16b='(',_0x19a578=0x0;_0x19a578<_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')];_0x19a578+=0x1){_0x19a578>0x0&&(_0x20a16b+='\x20'+_0x4ed702[_0xcc6a('0x6f')]+'\x20');_0x20a16b+=_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['group']?_0x46d93b(_0x4ed702['rules'][_0x19a578]['group']):_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x70')]+'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['condition']+(_0x2cc561(_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x71')])?'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x72')]:'');}return _0x20a16b+')';};var _0x5e1c69={'where':{'id':_0x506311['params']['id']}},_0x481d25,_0xaec5e8,_0x41527b,_0x4403d3,_0x386a74;_0x5e1c69=_[_0xcc6a('0x41')]({},_0x5e1c69,_0x506311[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x5e1c69)[_0xcc6a('0x29')](function(_0x55d129){if(_0x55d129){_0x481d25=_0x55d129;return _0x55d129['getFields']();}return null;})[_0xcc6a('0x29')](function(_0xd1a27b){if(_0xd1a27b){if(!_0xd1a27b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xaec5e8=_0xd1a27b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x421d0b){if(_0x421d0b){_0x41527b=_['keyBy'](_0x421d0b,'id');var _0x4a8863;var _0x58e6b4=squel[_0xcc6a('0x75')]();_0x58e6b4[_0xcc6a('0x76')](_0x481d25[_0xcc6a('0x77')]);for(var _0x729b2=0x0;_0x729b2<_0xaec5e8['length'];_0x729b2+=0x1){_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x78')]?_0x41527b[_0xaec5e8[_0x729b2][_0xcc6a('0x78')]]['metric']:_0xaec5e8[_0x729b2][_0xcc6a('0x70')];_0x4a8863=_0xaec5e8[_0x729b2]['function']?_[_0xcc6a('0x79')](_0x586789[_0xaec5e8[_0x729b2]['function']],'%s',_0x4a8863):_0x4a8863;_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x389e5f[_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]],'%s',_0x4a8863):_0x4a8863;if(_0xaec5e8[_0x729b2]['groupBy']){_0x58e6b4[_0xcc6a('0x7b')](_0x4a8863);}_0xaec5e8[_0x729b2]['orderBy']&&_0x58e6b4[_0xcc6a('0x3d')](_0x4a8863,_0xaec5e8[_0x729b2]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x58e6b4[_0xcc6a('0x70')](_0x4a8863,_0xaec5e8[_0x729b2][_0xcc6a('0x7d')]||_0x4a8863);}if(_0x481d25[_0xcc6a('0x7e')]){_0x481d25[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x481d25['joins']);for(var _0x18f5dc=0x0;_0x18f5dc<_0x481d25[_0xcc6a('0x7e')][_0xcc6a('0x4c')];_0x18f5dc+=0x1){if(_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]&&_['includes'](_0x3a6b7e,_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')])&&_0x481d25['joins'][_0x18f5dc]['parentKey']&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x80')]&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]){_0x58e6b4[_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]](_0x481d25['joins'][_0x18f5dc][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x481d25[_0xcc6a('0x77')],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x83')],_0x481d25['joins'][_0x18f5dc]['foreignTable'],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]));}}}if(_0x481d25[_0xcc6a('0x84')]){_0x481d25[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x481d25[_0xcc6a('0x84')]);_0x58e6b4[_0xcc6a('0x3f')](_0x46d93b(_0x481d25['conditions'][_0xcc6a('0x7b')]));}_0x386a74=_0x58e6b4[_0xcc6a('0x85')]();_0x58e6b4[_0xcc6a('0x21')](_0x56d512);_0x58e6b4[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x58e6b4['toString']());return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x58e6b4[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')][_0xcc6a('0x8b')]});}})[_0xcc6a('0x29')](respondWithResult(_0x14d3ff,null))[_0xcc6a('0x48')](handleError(_0x14d3ff,null));};function runReport(_0x2a25df,_0x1f1ff7,_0x565bcd){var _0x45c45f=_0x1f1ff7[_0xcc6a('0x36')];var _0x58cd56=0xa;var _0x1848dd=[_0xcc6a('0x8c'),_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x5abd5c={'SUM':_0xcc6a('0x5e'),'COUNT':_0xcc6a('0x8d'),'COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x5be65b={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2b5c15=function(_0x3207b2){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0xcc6a('0x8f')],_0x3207b2);};var _0x58fdb3=function(_0xb4b2b4){if(!_0xb4b2b4||!_0xb4b2b4[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x275e15='(',_0x53b419=0x0;_0x53b419<_0xb4b2b4[_0xcc6a('0x6e')]['length'];_0x53b419+=0x1){_0x53b419>0x0&&(_0x275e15+='\x20'+_0xb4b2b4[_0xcc6a('0x6f')]+'\x20');_0x275e15+=_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]?_0x58fdb3(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]):_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x70')]+'\x20'+_0xb4b2b4['rules'][_0x53b419][_0xcc6a('0x71')]+(_0x2b5c15(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x71')])?'\x20'+_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x72')]:'');}return _0x275e15+')';};var _0x4473ab={'where':{'id':_0x2a25df['id']}},_0x558e2f,_0x14a957,_0x350766,_0x589bff,_0x5661b5;_0x4473ab=_[_0xcc6a('0x41')]({},_0x4473ab,_0x565bcd);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4473ab)[_0xcc6a('0x29')](function(_0x2f0b79){if(_0x2f0b79){_0x558e2f=_0x2f0b79;return _0x2f0b79['getFields']();}return null;})[_0xcc6a('0x29')](function(_0x4a268b){if(_0x4a268b){if(!_0x4a268b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x14a957=_0x4a268b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x1f4c4e){if(_0x1f4c4e){_0x350766=_['keyBy'](_0x1f4c4e,'id');var _0x312431;var _0x2a850c=squel[_0xcc6a('0x75')]();_0x2a850c['from'](_0x558e2f[_0xcc6a('0x77')]);for(var _0xd5b9f3=0x0;_0xd5b9f3<_0x14a957[_0xcc6a('0x4c')];_0xd5b9f3+=0x1){_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]?_0x350766[_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x14a957[_0xd5b9f3][_0xcc6a('0x70')];_0x312431=_0x14a957[_0xd5b9f3]['function']?_[_0xcc6a('0x79')](_0x5abd5c[_0x14a957[_0xd5b9f3][_0xcc6a('0x93')]],'%s',_0x312431):_0x312431;_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x5be65b[_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]],'%s',_0x312431):_0x312431;if(_0x14a957[_0xd5b9f3][_0xcc6a('0x94')]){_0x2a850c[_0xcc6a('0x7b')](_0x312431);}_0x14a957[_0xd5b9f3][_0xcc6a('0x95')]&&_0x2a850c['order'](_0x312431,_0x14a957[_0xd5b9f3]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x2a850c['field'](_0x312431,_0x14a957[_0xd5b9f3][_0xcc6a('0x7d')]||_0x312431);}if(_0x558e2f[_0xcc6a('0x7e')]){_0x558e2f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x7e')]);for(var _0x1f7ee5=0x0;_0x1f7ee5<_0x558e2f[_0xcc6a('0x7e')]['length'];_0x1f7ee5+=0x1){if(_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type']&&_['includes'](_0x1848dd,_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type'])&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')]&&_0x558e2f['joins'][_0x1f7ee5]['foreignTable']&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['foreignKey']){_0x2a850c[_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x34')]](_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x558e2f['table'],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],_0x558e2f['joins'][_0x1f7ee5][_0xcc6a('0x81')]));}}}if(_0x558e2f[_0xcc6a('0x84')]){_0x558e2f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x84')]);_0x2a850c[_0xcc6a('0x3f')](_0x58fdb3(_0x558e2f[_0xcc6a('0x84')]['group']));}_0x5661b5=_0x2a850c[_0xcc6a('0x85')]();_0x2a850c[_0xcc6a('0x21')](_0x58cd56);_0x2a850c['offset'](0x0);return;}})[_0xcc6a('0x29')](function(){if(_0x1f1ff7[_0xcc6a('0x96')]===_0xcc6a('0x97')){return null;}var _0x2297ea=_[_0xcc6a('0x41')](_0x1f1ff7,{'name':_0x1f1ff7[_0xcc6a('0x98')]||_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],'basename':_0x45c45f,'savename':util[_0xcc6a('0x7a')](_0xcc6a('0x99'),_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],require(_0xcc6a('0x9a'))[_0xcc6a('0x9b')](0x4),_0x1f1ff7['output']||'csv'),'reportId':_0x558e2f['id'],'reportType':_0xcc6a('0x9c')});return db[_0xcc6a('0x9d')]['create'](_0x2297ea,{'raw':!![]});})[_0xcc6a('0x29')](function(_0x1e74a4){if(_0x558e2f[_0xcc6a('0x77')]==='cdr'){_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0x9e'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7['endDate']);}else{_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0xa0'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7[_0xcc6a('0xa1')]);}if(_0x1e74a4){logger[_0xcc6a('0xa2')](_0xcc6a('0xa3'),_0x5661b5[_0xcc6a('0x89')]());require('child_process')['fork'](path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa4'),_0x1e74a4[_0xcc6a('0x96')]),[_0x1e74a4['id'],_0x5661b5['toString'](),path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa5'),_0x1e74a4[_0xcc6a('0xa6')]),_0x45c45f]);return _0x1e74a4;}else{var _0x3b7b43=squel['select']();_0x3b7b43[_0xcc6a('0x76')]('('+_0x5661b5[_0xcc6a('0x89')]()+')',_0xcc6a('0xa7'));_0x3b7b43['field'](_0xcc6a('0xa8'),'count');_0x5661b5[_0xcc6a('0x21')](_0x1f1ff7[_0xcc6a('0x21')]||_0x58cd56);_0x5661b5['offset'](_0x1f1ff7[_0xcc6a('0x1f')]||0x0);return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x3b7b43[_0xcc6a('0x89')](),{'type':dbH[_0xcc6a('0x88')][_0xcc6a('0x8a')][_0xcc6a('0x8b')]})[_0xcc6a('0x29')](function(_0x25ba57){if(!_0x25ba57[_0xcc6a('0x4c')]){_0x589bff=0x0;}else{_0x589bff=_0x25ba57[0x0][_0xcc6a('0x22')]||0x0;}return dbH['sequelize']['query'](_0x5661b5[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});})['then'](function(_0x32ced0){return{'rows':_0x32ced0||[],'count':_0x589bff};});}});}exports[_0xcc6a('0xa9')]=function(_0xc638ae,_0x3367e8){return runReport(_0xc638ae['params'],_0xc638ae[_0xcc6a('0x37')],_0xc638ae['options'])['then'](respondWithResult(_0x3367e8,null))[_0xcc6a('0x48')](handleError(_0x3367e8,null));};exports[_0xcc6a('0xaa')]=runReport;exports[_0xcc6a('0x37')]=function(_0x38d805,_0x3f5f97){var _0x399eb6=0xa;var _0x2ae391=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x50b948={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x1d2ae0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x41d17b=function(_0x1827e6){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),'IS\x20NOT\x20NULL',_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x1827e6);};var _0xa70fa=function(_0x33ec76){if(!_0x33ec76||!_0x33ec76[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x30162c='(',_0x48746a=0x0;_0x48746a<_0x33ec76['rules'][_0xcc6a('0x4c')];_0x48746a+=0x1){_0x48746a>0x0&&(_0x30162c+='\x20'+_0x33ec76[_0xcc6a('0x6f')]+'\x20');_0x30162c+=_0x33ec76['rules'][_0x48746a][_0xcc6a('0x7b')]?_0xa70fa(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x7b')]):_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x70')]+'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['condition']+(_0x41d17b(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x71')])?'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['value']:'');}return _0x30162c+')';};var _0x54f0e4={'where':{'id':_0x38d805[_0xcc6a('0x4a')]['id']}},_0x559f4f,_0x545b15,_0x17a4e1,_0x5a7da7,_0x434c8b;_0x54f0e4=_['merge']({},_0x54f0e4,_0x38d805[_0xcc6a('0x4d')]);return db['AnalyticDefaultReport'][_0xcc6a('0x4e')](_0x54f0e4)[_0xcc6a('0x29')](function(_0xe9231f){if(_0xe9231f){_0x559f4f=_0xe9231f;return _0xe9231f[_0xcc6a('0xab')]();}return null;})[_0xcc6a('0x29')](function(_0x197961){if(_0x197961){if(!_0x197961[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x545b15=_0x197961;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x171a2a){if(_0x171a2a){_0x17a4e1=_[_0xcc6a('0xac')](_0x171a2a,'id');var _0x13860b;var _0x3b52f7=squel[_0xcc6a('0x75')]();_0x3b52f7[_0xcc6a('0x76')](_0x559f4f[_0xcc6a('0x77')]);for(var _0x319f4a=0x0;_0x319f4a<_0x545b15[_0xcc6a('0x4c')];_0x319f4a+=0x1){_0x13860b=_0x545b15[_0x319f4a]['MetricId']?_0x17a4e1[_0x545b15[_0x319f4a][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x545b15[_0x319f4a][_0xcc6a('0x70')];_0x13860b=_0x545b15[_0x319f4a]['function']?_[_0xcc6a('0x79')](_0x50b948[_0x545b15[_0x319f4a][_0xcc6a('0x93')]],'%s',_0x13860b):_0x13860b;_0x13860b=_0x545b15[_0x319f4a]['format']?_[_0xcc6a('0x79')](_0x1d2ae0[_0x545b15[_0x319f4a][_0xcc6a('0x7a')]],'%s',_0x13860b):_0x13860b;if(_0x545b15[_0x319f4a]['groupBy']){_0x3b52f7[_0xcc6a('0x7b')](_0x13860b);}_0x545b15[_0x319f4a][_0xcc6a('0x95')]&&_0x3b52f7[_0xcc6a('0x3d')](_0x13860b,_0x545b15[_0x319f4a][_0xcc6a('0x95')]===_0xcc6a('0x7c')?![]:!![]);_0x3b52f7[_0xcc6a('0x70')](_0x13860b,_0x545b15[_0x319f4a]['alias']||_0x13860b);}if(_0x559f4f['joins']){_0x559f4f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x559f4f['joins']);for(var _0x154885=0x0;_0x154885<_0x559f4f['joins'][_0xcc6a('0x4c')];_0x154885+=0x1){if(_0x559f4f['joins'][_0x154885][_0xcc6a('0x34')]&&_[_0xcc6a('0x6a')](_0x2ae391,_0x559f4f[_0xcc6a('0x7e')][_0x154885]['type'])&&_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')]&&_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignTable']&&_0x559f4f['joins'][_0x154885]['foreignKey']){_0x3b52f7[_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x34')]](_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x559f4f[_0xcc6a('0x77')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignKey']));}}}if(_0x559f4f[_0xcc6a('0x84')]){_0x559f4f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x559f4f['conditions']);_0x3b52f7[_0xcc6a('0x3f')](_0xa70fa(_0x559f4f[_0xcc6a('0x84')][_0xcc6a('0x7b')]));}_0x434c8b=_0x3b52f7['clone']();_0x3b52f7[_0xcc6a('0x21')](_0x399eb6);_0x3b52f7[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x3b52f7['toString']());return dbH[_0xcc6a('0x88')]['query'](_0x3b52f7['toString'](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});}})['then'](function(){return{'sql':_0x434c8b[_0xcc6a('0x89')]()};})[_0xcc6a('0x29')](respondWithResult(_0x3f5f97,null))[_0xcc6a('0x48')](handleError(_0x3f5f97,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 42ee86b..9b487f2 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 _0x0f4b=['rimraf','define','analytics_default_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5e1be2,_0xfabb80){var _0x15cadd=function(_0xffd4e4){while(--_0xffd4e4){_0x5e1be2['push'](_0x5e1be2['shift']());}};_0x15cadd(++_0xfabb80);}(_0x0f4b,0x99));var _0xb0f4=function(_0x47c4f1,_0x1c5182){_0x47c4f1=_0x47c4f1-0x0;var _0x524053=_0x0f4b[_0x47c4f1];return _0x524053;};'use strict';var _=require(_0xb0f4('0x0'));var util=require(_0xb0f4('0x1'));var logger=require(_0xb0f4('0x2'))('api');var moment=require(_0xb0f4('0x3'));var BPromise=require(_0xb0f4('0x4'));var rp=require(_0xb0f4('0x5'));var fs=require('fs');var path=require(_0xb0f4('0x6'));var rimraf=require(_0xb0f4('0x7'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x3253a5,_0x3a694d){return _0x3253a5[_0xb0f4('0x8')]('AnalyticDefaultReport',attributes,{'tableName':_0xb0f4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f86=['../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8f86,0x162));var _0x68f8=function(_0x1e804c,_0x47d42d){_0x1e804c=_0x1e804c-0x0;var _0x31b58=_0x8f86[_0x1e804c];return _0x31b58;};'use strict';var _=require(_0x68f8('0x0'));var util=require(_0x68f8('0x1'));var logger=require(_0x68f8('0x2'))(_0x68f8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x68f8('0x4'));var fs=require('fs');var path=require(_0x68f8('0x5'));var rimraf=require('rimraf');var config=require(_0x68f8('0x6'));var attributes=require(_0x68f8('0x7'));module[_0x68f8('0x8')]=function(_0x43f8fb,_0x54d672){return _0x43f8fb[_0x68f8('0x9')](_0x68f8('0xa'),attributes,{'tableName':_0x68f8('0xb'),'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 d27d9aa..bb448a1 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 _0xaf9f=['client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0xaf9f,0x68));var _0xfaf9=function(_0x139b85,_0x5e0691){_0x139b85=_0x139b85-0x0;var _0x1e833f=_0xaf9f[_0x139b85];return _0x1e833f;};'use strict';var _=require(_0xfaf9('0x0'));var util=require(_0xfaf9('0x1'));var moment=require(_0xfaf9('0x2'));var BPromise=require(_0xfaf9('0x3'));var rs=require(_0xfaf9('0x4'));var fs=require('fs');var Redis=require(_0xfaf9('0x5'));var db=require(_0xfaf9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfaf9('0x7'))(_0xfaf9('0x8'));var config=require(_0xfaf9('0x9'));var jayson=require(_0xfaf9('0xa'));var client=jayson[_0xfaf9('0xb')][_0xfaf9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x35f269,_0x17a2e3,_0xc9fc88){return new BPromise(function(_0xf635e7,_0x1a3dcc){return client[_0xfaf9('0xd')](_0x35f269,_0xc9fc88)['then'](function(_0x58f045){logger[_0xfaf9('0xe')](_0xfaf9('0xf'),_0x17a2e3,_0xfaf9('0x10'));logger[_0xfaf9('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x17a2e3,'request\x20sent',JSON[_0xfaf9('0x12')](_0x58f045));if(_0x58f045['error']){if(_0x58f045[_0xfaf9('0x13')][_0xfaf9('0x14')]===0x1f4){logger[_0xfaf9('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x17a2e3,_0x58f045[_0xfaf9('0x13')]['message']);return _0x1a3dcc(_0x58f045[_0xfaf9('0x13')][_0xfaf9('0x15')]);}logger[_0xfaf9('0x13')](_0xfaf9('0xf'),_0x17a2e3,_0x58f045[_0xfaf9('0x13')][_0xfaf9('0x15')]);return _0xf635e7(_0x58f045[_0xfaf9('0x13')][_0xfaf9('0x15')]);}else{logger[_0xfaf9('0xe')](_0xfaf9('0xf'),_0x17a2e3,_0xfaf9('0x10'));_0xf635e7(_0x58f045['result'][_0xfaf9('0x15')]);}})[_0xfaf9('0x16')](function(_0xd3eca0){logger['error'](_0xfaf9('0xf'),_0x17a2e3,_0xd3eca0);_0x1a3dcc(_0xd3eca0);});});} \ No newline at end of file +var _0x3dc8=['http','then','info','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticDefaultReport,\x20%s,\x20%s','result','catch','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x3b27d3,_0x2c4d9b){var _0x247327=function(_0x3d8dd4){while(--_0x3d8dd4){_0x3b27d3['push'](_0x3b27d3['shift']());}};_0x247327(++_0x2c4d9b);}(_0x3dc8,0x162));var _0x83dc=function(_0x41c7d8,_0x7db48c){_0x41c7d8=_0x41c7d8-0x0;var _0x3d46d0=_0x3dc8[_0x41c7d8];return _0x3d46d0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x83dc('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x83dc('0x1'))['db'];var utils=require(_0x83dc('0x2'));var logger=require(_0x83dc('0x3'))('rpc');var config=require(_0x83dc('0x4'));var jayson=require(_0x83dc('0x5'));var client=jayson[_0x83dc('0x6')][_0x83dc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x37fd1c,_0x5a337d,_0x36ced2){return new BPromise(function(_0x6c0986,_0x237dba){return client['request'](_0x37fd1c,_0x36ced2)[_0x83dc('0x8')](function(_0x1ec8c0){logger[_0x83dc('0x9')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5a337d,_0x83dc('0xa'));logger['debug'](_0x83dc('0xb'),_0x5a337d,_0x83dc('0xa'),JSON[_0x83dc('0xc')](_0x1ec8c0));if(_0x1ec8c0[_0x83dc('0xd')]){if(_0x1ec8c0['error'][_0x83dc('0xe')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x5a337d,_0x1ec8c0[_0x83dc('0xd')][_0x83dc('0xf')]);return _0x237dba(_0x1ec8c0[_0x83dc('0xd')]['message']);}logger[_0x83dc('0xd')](_0x83dc('0x10'),_0x5a337d,_0x1ec8c0[_0x83dc('0xd')][_0x83dc('0xf')]);return _0x6c0986(_0x1ec8c0[_0x83dc('0xd')][_0x83dc('0xf')]);}else{logger['info'](_0x83dc('0x10'),_0x5a337d,_0x83dc('0xa'));_0x6c0986(_0x1ec8c0[_0x83dc('0x11')]['message']);}})[_0x83dc('0x12')](function(_0x5b939d){logger[_0x83dc('0xd')](_0x83dc('0x10'),_0x5a337d,_0x5b939d);_0x237dba(_0x5b939d);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index cbde3a6..86650cb 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 _0x435d=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/preview','preview','query','post','/:id'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x435d,0x96));var _0xd435=function(_0x586ba0,_0x49a28f){_0x586ba0=_0x586ba0-0x0;var _0x2a4277=_0x435d[_0x586ba0];return _0x2a4277;};'use strict';var multer=require(_0xd435('0x0'));var util=require(_0xd435('0x1'));var path=require(_0xd435('0x2'));var timeout=require(_0xd435('0x3'));var express=require(_0xd435('0x4'));var router=express[_0xd435('0x5')]();var fs_extra=require(_0xd435('0x6'));var auth=require(_0xd435('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd435('0x8'));var controller=require('./analyticDefaultReport.controller');router[_0xd435('0x9')]('/',auth[_0xd435('0xa')](),controller[_0xd435('0xb')]);router['get']('/:id',auth[_0xd435('0xa')](),controller[_0xd435('0xc')]);router['get'](_0xd435('0xd'),auth[_0xd435('0xa')](),controller[_0xd435('0xe')]);router[_0xd435('0x9')]('/:id/run',auth[_0xd435('0xa')](),controller['run']);router[_0xd435('0x9')]('/:id/query',auth['isAuthenticated'](),controller[_0xd435('0xf')]);router[_0xd435('0x10')]('/',auth[_0xd435('0xa')](),controller['create']);router['put'](_0xd435('0x11'),auth['isAuthenticated'](),controller[_0xd435('0x12')]);router[_0xd435('0x13')](_0xd435('0x11'),auth[_0xd435('0xa')](),controller[_0xd435('0x14')]);module['exports']=router; \ No newline at end of file +var _0x2bbb=['index','/:id','show','get','/:id/run','run','/:id/query','query','post','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated'];(function(_0x122509,_0xc1ee11){var _0x1f5220=function(_0x40ff21){while(--_0x40ff21){_0x122509['push'](_0x122509['shift']());}};_0x1f5220(++_0xc1ee11);}(_0x2bbb,0x1d9));var _0xb2bb=function(_0x48df6d,_0x8e91a){_0x48df6d=_0x48df6d-0x0;var _0x2afe14=_0x2bbb[_0x48df6d];return _0x2afe14;};'use strict';var multer=require(_0xb2bb('0x0'));var util=require(_0xb2bb('0x1'));var path=require(_0xb2bb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb2bb('0x3')]();var fs_extra=require(_0xb2bb('0x4'));var auth=require(_0xb2bb('0x5'));var interaction=require(_0xb2bb('0x6'));var config=require(_0xb2bb('0x7'));var controller=require(_0xb2bb('0x8'));router['get']('/',auth[_0xb2bb('0x9')](),controller[_0xb2bb('0xa')]);router['get'](_0xb2bb('0xb'),auth['isAuthenticated'](),controller[_0xb2bb('0xc')]);router[_0xb2bb('0xd')]('/:id/preview',auth[_0xb2bb('0x9')](),controller['preview']);router[_0xb2bb('0xd')](_0xb2bb('0xe'),auth[_0xb2bb('0x9')](),controller[_0xb2bb('0xf')]);router[_0xb2bb('0xd')](_0xb2bb('0x10'),auth['isAuthenticated'](),controller[_0xb2bb('0x11')]);router[_0xb2bb('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xb2bb('0xb'),auth[_0xb2bb('0x9')](),controller[_0xb2bb('0x13')]);router[_0xb2bb('0x14')](_0xb2bb('0xb'),auth[_0xb2bb('0x9')](),controller[_0xb2bb('0x15')]);module[_0xb2bb('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index ebc5d3c..1e1b372 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 _0x11ce=['DATE','ENUM','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING','csv','pdf'];(function(_0x5d0345,_0x54340d){var _0x254913=function(_0x11c182){while(--_0x11c182){_0x5d0345['push'](_0x5d0345['shift']());}};_0x254913(++_0x54340d);}(_0x11ce,0x1e5));var _0xe11c=function(_0x377322,_0x2e0097){_0x377322=_0x377322-0x0;var _0x5dac66=_0x11ce[_0x377322];return _0x5dac66;};'use strict';var Sequelize=require(_0xe11c('0x0'));var moment=require('moment');module[_0xe11c('0x1')]={'name':{'type':Sequelize[_0xe11c('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xe11c('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xe11c('0x3'),_0xe11c('0x4'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xe11c('0x5')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xe11c('0x6')]('manual',_0xe11c('0x7')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xe11c('0x8')](0xb)[_0xe11c('0x9')]},'reportType':{'type':Sequelize[_0xe11c('0x2')]}}; \ No newline at end of file +var _0x9aad=['manual','INTEGER','UNSIGNED','exports','STRING','ENUM','csv','xlsx','DATE','Loading'];(function(_0x1b8524,_0x1bb669){var _0x81418d=function(_0x5f5795){while(--_0x5f5795){_0x1b8524['push'](_0x1b8524['shift']());}};_0x81418d(++_0x1bb669);}(_0x9aad,0x193));var _0xd9aa=function(_0x368b9e,_0x2ae528){_0x368b9e=_0x368b9e-0x0;var _0x8dc3ea=_0x9aad[_0x368b9e];return _0x8dc3ea;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xd9aa('0x0')]={'name':{'type':Sequelize[_0xd9aa('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0xd9aa('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0xd9aa('0x2')](_0xd9aa('0x3'),'pdf',_0xd9aa('0x4')),'allowNull':![],'defaultValue':_0xd9aa('0x3')},'savename':{'type':Sequelize[_0xd9aa('0x1')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xd9aa('0x5')]},'status':{'type':Sequelize[_0xd9aa('0x1')],'defaultValue':_0xd9aa('0x6')},'type':{'type':Sequelize['ENUM'](_0xd9aa('0x7'),'scheduled'),'allowNull':![],'defaultValue':_0xd9aa('0x7')},'reportId':{'type':Sequelize[_0xd9aa('0x8')](0xb)[_0xd9aa('0x9')]},'reportType':{'type':Sequelize[_0xd9aa('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 8448f62..8bbd63b 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 _0xb9fe=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','output','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','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','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','UserProfileResource','end','error','stack','name','map','AnalyticExtractedReport','rawAttributes','fieldName','type','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','keys','includeAll','find','create','body'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb9fe,0xd0));var _0xeb9f=function(_0x567d62,_0x5ccdea){_0x567d62=_0x567d62-0x0;var _0x360462=_0xb9fe[_0x567d62];return _0x360462;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xeb9f('0x0'));var jsonpatch=require(_0xeb9f('0x1'));var rp=require('request-promise');var moment=require(_0xeb9f('0x2'));var BPromise=require(_0xeb9f('0x3'));var Mustache=require(_0xeb9f('0x4'));var util=require(_0xeb9f('0x5'));var path=require(_0xeb9f('0x6'));var sox=require(_0xeb9f('0x7'));var csv=require(_0xeb9f('0x8'));var ejs=require(_0xeb9f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb9f('0xa'));var squel=require(_0xeb9f('0xb'));var crypto=require(_0xeb9f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xeb9f('0xd'));var toCsv=require(_0xeb9f('0x8'));var querystring=require('querystring');var Papa=require(_0xeb9f('0xe'));var Redis=require(_0xeb9f('0xf'));var authService=require(_0xeb9f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xeb9f('0x11'));var hardwareService=require(_0xeb9f('0x12'));var logger=require(_0xeb9f('0x13'))(_0xeb9f('0x14'));var utils=require(_0xeb9f('0x15'));var config=require(_0xeb9f('0x16'));var licenseUtil=require(_0xeb9f('0x17'));var db=require(_0xeb9f('0x18'))['db'];function respondWithStatusCode(_0x536397,_0x24c264){_0x24c264=_0x24c264||0xcc;return function(_0x179d65){if(_0x179d65){return _0x536397[_0xeb9f('0x19')](_0x24c264);}return _0x536397[_0xeb9f('0x1a')](_0x24c264)['end']();};}function respondWithResult(_0x135794,_0x41e5ec){_0x41e5ec=_0x41e5ec||0xc8;return function(_0x266642){if(_0x266642){return _0x135794[_0xeb9f('0x1a')](_0x41e5ec)[_0xeb9f('0x1b')](_0x266642);}};}function respondWithFilteredResult(_0x3cbd61,_0x262453){return function(_0x3399d3){if(_0x3399d3){var _0x279066=typeof _0x262453[_0xeb9f('0x1c')]===_0xeb9f('0x1d')&&typeof _0x262453[_0xeb9f('0x1e')]===_0xeb9f('0x1d');var _0x20c40a=_0x3399d3['count'];var _0x7cc2ab=_0x279066?0x0:_0x262453['offset'];var _0x35b46e=_0x279066?_0x3399d3[_0xeb9f('0x1f')]:_0x262453[_0xeb9f('0x1c')]+_0x262453['limit'];var _0x16570a;if(_0x35b46e>=_0x20c40a){_0x35b46e=_0x20c40a;_0x16570a=0xc8;}else{_0x16570a=0xce;}_0x3cbd61[_0xeb9f('0x1a')](_0x16570a);return _0x3cbd61[_0xeb9f('0x20')](_0xeb9f('0x21'),_0x7cc2ab+'-'+_0x35b46e+'/'+_0x20c40a)['json'](_0x3399d3);}return null;};}function patchUpdates(_0x5f2933){return function(_0xa484fc){try{jsonpatch['apply'](_0xa484fc,_0x5f2933,!![]);}catch(_0x2e0a1f){return BPromise[_0xeb9f('0x22')](_0x2e0a1f);}return _0xa484fc[_0xeb9f('0x23')]();};}function saveUpdates(_0x38fffc,_0x273d91){return function(_0x314942){if(_0x314942){return _0x314942['update'](_0x38fffc)[_0xeb9f('0x24')](function(_0x457373){return _0x457373;});}return null;};}function removeEntity(_0x89f140,_0x501230){return function(_0x55b2ac){if(_0x55b2ac){return _0x55b2ac[_0xeb9f('0x25')]()[_0xeb9f('0x24')](function(){var _0x17368a=_0x55b2ac[_0xeb9f('0x26')]({'plain':!![]});var _0x58d878='ExtractedReports';return db[_0xeb9f('0x27')]['destroy']({'where':{'type':_0x58d878,'resourceId':_0x17368a['id']}})[_0xeb9f('0x24')](function(){return _0x55b2ac;});})[_0xeb9f('0x24')](function(){_0x89f140[_0xeb9f('0x1a')](0xcc)[_0xeb9f('0x28')]();});}};}function handleEntityNotFound(_0x33d717,_0x2fa000){return function(_0xa43327){if(!_0xa43327){_0x33d717['sendStatus'](0x194);}return _0xa43327;};}function handleError(_0x3fdce2,_0xf69cf4){_0xf69cf4=_0xf69cf4||0x1f4;return function(_0x3af383){logger[_0xeb9f('0x29')](_0x3af383[_0xeb9f('0x2a')]);if(_0x3af383[_0xeb9f('0x2b')]){delete _0x3af383['name'];}_0x3fdce2[_0xeb9f('0x1a')](_0xf69cf4)['send'](_0x3af383);};}exports['index']=function(_0x491b0c,_0x48c093){var _0x2e8159={},_0x4dcfb0={},_0x2fb1a2={'count':0x0,'rows':[]};var _0x478f7b=_[_0xeb9f('0x2c')](db[_0xeb9f('0x2d')][_0xeb9f('0x2e')],function(_0x4819b7){return{'name':_0x4819b7[_0xeb9f('0x2f')],'type':_0x4819b7[_0xeb9f('0x30')]['key']};});_0x4dcfb0['model']=_[_0xeb9f('0x2c')](_0x478f7b,'name');_0x4dcfb0['query']=_['keys'](_0x491b0c['query']);_0x4dcfb0[_0xeb9f('0x31')]=_[_0xeb9f('0x32')](_0x4dcfb0[_0xeb9f('0x33')],_0x4dcfb0[_0xeb9f('0x34')]);_0x2e8159[_0xeb9f('0x35')]=_[_0xeb9f('0x32')](_0x4dcfb0[_0xeb9f('0x33')],qs[_0xeb9f('0x36')](_0x491b0c['query'][_0xeb9f('0x36')]));_0x2e8159[_0xeb9f('0x35')]=_0x2e8159['attributes'][_0xeb9f('0x37')]?_0x2e8159[_0xeb9f('0x35')]:_0x4dcfb0[_0xeb9f('0x33')];if(!_0x491b0c[_0xeb9f('0x34')][_0xeb9f('0x38')]('nolimit')){_0x2e8159[_0xeb9f('0x1e')]=qs['limit'](_0x491b0c[_0xeb9f('0x34')]['limit']);_0x2e8159[_0xeb9f('0x1c')]=qs[_0xeb9f('0x1c')](_0x491b0c[_0xeb9f('0x34')][_0xeb9f('0x1c')]);}_0x2e8159[_0xeb9f('0x39')]=qs[_0xeb9f('0x3a')](_0x491b0c['query'][_0xeb9f('0x3a')]);_0x2e8159[_0xeb9f('0x3b')]=qs[_0xeb9f('0x31')](_['pick'](_0x491b0c[_0xeb9f('0x34')],_0x4dcfb0[_0xeb9f('0x31')]),_0x478f7b);if(_0x491b0c['query']['filter']){_0x2e8159['where']=_[_0xeb9f('0x3c')](_0x2e8159[_0xeb9f('0x3b')],{'$or':_[_0xeb9f('0x2c')](_0x478f7b,function(_0x12384a){if(_0x12384a[_0xeb9f('0x30')]!==_0xeb9f('0x3d')){var _0x92b1cc={};_0x92b1cc[_0x12384a[_0xeb9f('0x2b')]]={'$like':'%'+_0x491b0c[_0xeb9f('0x34')][_0xeb9f('0x3e')]+'%'};return _0x92b1cc;}})});}_0x2e8159=_[_0xeb9f('0x3c')]({},_0x2e8159,_0x491b0c[_0xeb9f('0x3f')]);var _0x5d2103={'where':_0x2e8159[_0xeb9f('0x3b')]};return db[_0xeb9f('0x2d')]['count'](_0x5d2103)[_0xeb9f('0x24')](function(_0xb33b2e){_0x2fb1a2['count']=_0xb33b2e;if(_0x491b0c['query']['includeAll']){_0x2e8159[_0xeb9f('0x40')]=[{'all':!![]}];}return db[_0xeb9f('0x2d')][_0xeb9f('0x41')](_0x2e8159);})[_0xeb9f('0x24')](function(_0x359640){_0x2fb1a2[_0xeb9f('0x42')]=_0x359640;return _0x2fb1a2;})[_0xeb9f('0x24')](respondWithFilteredResult(_0x48c093,_0x2e8159))[_0xeb9f('0x43')](handleError(_0x48c093,null));};exports['show']=function(_0x42f178,_0x1a9827){var _0x14845c={'raw':!![],'where':{'id':_0x42f178[_0xeb9f('0x44')]['id']}},_0x27eb3e={};_0x27eb3e[_0xeb9f('0x33')]=_[_0xeb9f('0x45')](db[_0xeb9f('0x2d')][_0xeb9f('0x2e')]);_0x27eb3e[_0xeb9f('0x34')]=_[_0xeb9f('0x45')](_0x42f178['query']);_0x27eb3e[_0xeb9f('0x31')]=_[_0xeb9f('0x32')](_0x27eb3e[_0xeb9f('0x33')],_0x27eb3e[_0xeb9f('0x34')]);_0x14845c['attributes']=_[_0xeb9f('0x32')](_0x27eb3e[_0xeb9f('0x33')],qs['fields'](_0x42f178[_0xeb9f('0x34')][_0xeb9f('0x36')]));_0x14845c[_0xeb9f('0x35')]=_0x14845c[_0xeb9f('0x35')]['length']?_0x14845c[_0xeb9f('0x35')]:_0x27eb3e[_0xeb9f('0x33')];if(_0x42f178['query'][_0xeb9f('0x46')]){_0x14845c['include']=[{'all':!![]}];}_0x14845c=_[_0xeb9f('0x3c')]({},_0x14845c,_0x42f178['options']);return db['AnalyticExtractedReport'][_0xeb9f('0x47')](_0x14845c)[_0xeb9f('0x24')](handleEntityNotFound(_0x1a9827,null))[_0xeb9f('0x24')](respondWithResult(_0x1a9827,null))['catch'](handleError(_0x1a9827,null));};exports['create']=function(_0x5dc841,_0x4684e8){return db[_0xeb9f('0x2d')][_0xeb9f('0x48')](_0x5dc841[_0xeb9f('0x49')],{})[_0xeb9f('0x24')](function(_0x5acda9){var _0x50bd1a=_0x5dc841[_0xeb9f('0x4a')]['get']({'plain':!![]});if(!_0x50bd1a)throw new Error(_0xeb9f('0x4b'));if(_0x50bd1a['role']===_0xeb9f('0x4a')){var _0x47e17f=_0x5acda9[_0xeb9f('0x26')]({'plain':!![]});var _0xb4a31b=_0xeb9f('0x4c');return db[_0xeb9f('0x4d')][_0xeb9f('0x47')]({'where':{'name':_0xb4a31b,'userProfileId':_0x50bd1a[_0xeb9f('0x4e')]},'raw':!![]})[_0xeb9f('0x24')](function(_0x10dcaa){if(_0x10dcaa&&_0x10dcaa[_0xeb9f('0x4f')]===0x0){return db[_0xeb9f('0x27')]['create']({'name':_0x47e17f[_0xeb9f('0x2b')],'resourceId':_0x47e17f['id'],'type':_0x10dcaa['name'],'sectionId':_0x10dcaa['id']},{})[_0xeb9f('0x24')](function(){return _0x5acda9;});}else{return _0x5acda9;}})['catch'](function(_0x3207fd){logger[_0xeb9f('0x29')](_0xeb9f('0x50'),_0x3207fd);throw _0x3207fd;});}return _0x5acda9;})[_0xeb9f('0x24')](respondWithResult(_0x4684e8,0xc9))[_0xeb9f('0x43')](handleError(_0x4684e8,null));};exports[_0xeb9f('0x51')]=function(_0x5f031b,_0x528a78){if(_0x5f031b[_0xeb9f('0x49')]['id']){delete _0x5f031b[_0xeb9f('0x49')]['id'];}return db[_0xeb9f('0x2d')]['find']({'where':{'id':_0x5f031b[_0xeb9f('0x44')]['id']}})[_0xeb9f('0x24')](handleEntityNotFound(_0x528a78,null))[_0xeb9f('0x24')](saveUpdates(_0x5f031b[_0xeb9f('0x49')],null))['then'](respondWithResult(_0x528a78,null))[_0xeb9f('0x43')](handleError(_0x528a78,null));};exports['destroy']=function(_0x2447fd,_0x21c164){return db[_0xeb9f('0x2d')]['find']({'where':{'id':_0x2447fd[_0xeb9f('0x44')]['id']}})[_0xeb9f('0x24')](handleEntityNotFound(_0x21c164,null))[_0xeb9f('0x24')](removeEntity(_0x21c164,null))[_0xeb9f('0x43')](handleError(_0x21c164,null));};exports[_0xeb9f('0x52')]=function(_0x13578a,_0x370f7c,_0x16239d){return db[_0xeb9f('0x2d')][_0xeb9f('0x47')]({'where':{'id':_0x13578a[_0xeb9f('0x44')]['id']},'attributes':[_0xeb9f('0x2b'),_0xeb9f('0x53'),_0xeb9f('0x54'),_0xeb9f('0x55')],'raw':!![]})[_0xeb9f('0x24')](handleEntityNotFound(_0x370f7c,null))[_0xeb9f('0x24')](function(_0x19907a){if(_0x19907a){if(!fs['existsSync'](path[_0xeb9f('0x56')](config['root'],_0xeb9f('0x57'),_0x19907a[_0xeb9f('0x54')]))){throw new db[(_0xeb9f('0x58'))][(_0xeb9f('0x59'))](_0xeb9f('0x5a'));}if(_0x13578a[_0xeb9f('0x34')][_0xeb9f('0x5b')]){return _0x370f7c[_0xeb9f('0x19')](0xc8);}return _0x370f7c[_0xeb9f('0x52')](path['join'](config[_0xeb9f('0x5c')],_0xeb9f('0x57'),_0x19907a[_0xeb9f('0x54')]),util[_0xeb9f('0x5d')]('%s.%s',_0x19907a['basename']||_0x19907a[_0xeb9f('0x2b')],_0x19907a[_0xeb9f('0x55')]['toLowerCase']()));}})[_0xeb9f('0x43')](handleError(_0x370f7c,null));}; \ No newline at end of file +var _0xe9f9=['model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','AnalyticExtractedReport','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','update','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','exists','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','index','fieldName','type','key'];(function(_0x35d2d6,_0x14e944){var _0x1637d5=function(_0x327b04){while(--_0x327b04){_0x35d2d6['push'](_0x35d2d6['shift']());}};_0x1637d5(++_0x14e944);}(_0xe9f9,0x91));var _0x9e9f=function(_0x4ed4db,_0x5588fe){_0x4ed4db=_0x4ed4db-0x0;var _0x326691=_0xe9f9[_0x4ed4db];return _0x326691;};'use strict';var emlformat=require(_0x9e9f('0x0'));var rimraf=require(_0x9e9f('0x1'));var zipdir=require(_0x9e9f('0x2'));var jsonpatch=require(_0x9e9f('0x3'));var rp=require(_0x9e9f('0x4'));var moment=require('moment');var BPromise=require(_0x9e9f('0x5'));var Mustache=require(_0x9e9f('0x6'));var util=require(_0x9e9f('0x7'));var path=require('path');var sox=require(_0x9e9f('0x8'));var csv=require('to-csv');var ejs=require(_0x9e9f('0x9'));var fs=require('fs');var fs_extra=require(_0x9e9f('0xa'));var _=require('lodash');var squel=require(_0x9e9f('0xb'));var crypto=require(_0x9e9f('0xc'));var jsforce=require(_0x9e9f('0xd'));var deskjs=require(_0x9e9f('0xe'));var toCsv=require(_0x9e9f('0xf'));var querystring=require(_0x9e9f('0x10'));var Papa=require(_0x9e9f('0x11'));var Redis=require(_0x9e9f('0x12'));var authService=require(_0x9e9f('0x13'));var qs=require(_0x9e9f('0x14'));var as=require(_0x9e9f('0x15'));var hardwareService=require(_0x9e9f('0x16'));var logger=require(_0x9e9f('0x17'))(_0x9e9f('0x18'));var utils=require(_0x9e9f('0x19'));var config=require(_0x9e9f('0x1a'));var licenseUtil=require(_0x9e9f('0x1b'));var db=require(_0x9e9f('0x1c'))['db'];function respondWithStatusCode(_0x25a17b,_0x4635ae){_0x4635ae=_0x4635ae||0xcc;return function(_0x87e89a){if(_0x87e89a){return _0x25a17b['sendStatus'](_0x4635ae);}return _0x25a17b[_0x9e9f('0x1d')](_0x4635ae)[_0x9e9f('0x1e')]();};}function respondWithResult(_0x4f187b,_0x195d8a){_0x195d8a=_0x195d8a||0xc8;return function(_0x208f56){if(_0x208f56){return _0x4f187b[_0x9e9f('0x1d')](_0x195d8a)[_0x9e9f('0x1f')](_0x208f56);}};}function respondWithFilteredResult(_0xb9e7bb,_0x5adc1c){return function(_0x1233a4){if(_0x1233a4){var _0x1dbe8e=typeof _0x5adc1c[_0x9e9f('0x20')]===_0x9e9f('0x21')&&typeof _0x5adc1c[_0x9e9f('0x22')]===_0x9e9f('0x21');var _0x2757ba=_0x1233a4['count'];var _0x3803fb=_0x1dbe8e?0x0:_0x5adc1c['offset'];var _0x3d959a=_0x1dbe8e?_0x1233a4[_0x9e9f('0x23')]:_0x5adc1c[_0x9e9f('0x20')]+_0x5adc1c[_0x9e9f('0x22')];var _0x1c9823;if(_0x3d959a>=_0x2757ba){_0x3d959a=_0x2757ba;_0x1c9823=0xc8;}else{_0x1c9823=0xce;}_0xb9e7bb[_0x9e9f('0x1d')](_0x1c9823);return _0xb9e7bb[_0x9e9f('0x24')](_0x9e9f('0x25'),_0x3803fb+'-'+_0x3d959a+'/'+_0x2757ba)['json'](_0x1233a4);}return null;};}function patchUpdates(_0x588bb1){return function(_0x23fb0){try{jsonpatch['apply'](_0x23fb0,_0x588bb1,!![]);}catch(_0x4d98e1){return BPromise[_0x9e9f('0x26')](_0x4d98e1);}return _0x23fb0['save']();};}function saveUpdates(_0x541433,_0x5b1881){return function(_0x4dfefa){if(_0x4dfefa){return _0x4dfefa['update'](_0x541433)[_0x9e9f('0x27')](function(_0x421b7e){return _0x421b7e;});}return null;};}function removeEntity(_0x50eb50,_0x3de374){return function(_0x450e75){if(_0x450e75){return _0x450e75[_0x9e9f('0x28')]()['then'](function(){var _0x407430=_0x450e75[_0x9e9f('0x29')]({'plain':!![]});var _0x4939d4=_0x9e9f('0x2a');return db[_0x9e9f('0x2b')]['destroy']({'where':{'type':_0x4939d4,'resourceId':_0x407430['id']}})[_0x9e9f('0x27')](function(){return _0x450e75;});})[_0x9e9f('0x27')](function(){_0x50eb50['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bdd80,_0x1a9f96){return function(_0x188488){if(!_0x188488){_0x2bdd80[_0x9e9f('0x2c')](0x194);}return _0x188488;};}function handleError(_0x7137d,_0x5a5fb1){_0x5a5fb1=_0x5a5fb1||0x1f4;return function(_0xcfeb26){logger[_0x9e9f('0x2d')](_0xcfeb26[_0x9e9f('0x2e')]);if(_0xcfeb26[_0x9e9f('0x2f')]){delete _0xcfeb26[_0x9e9f('0x2f')];}_0x7137d[_0x9e9f('0x1d')](_0x5a5fb1)[_0x9e9f('0x30')](_0xcfeb26);};}exports[_0x9e9f('0x31')]=function(_0x48bf37,_0x3e2dfa){var _0x4c72d8={},_0xfae401={},_0x100a05={'count':0x0,'rows':[]};var _0x1f8177=_['map'](db['AnalyticExtractedReport']['rawAttributes'],function(_0x5badf3){return{'name':_0x5badf3[_0x9e9f('0x32')],'type':_0x5badf3[_0x9e9f('0x33')][_0x9e9f('0x34')]};});_0xfae401[_0x9e9f('0x35')]=_[_0x9e9f('0x36')](_0x1f8177,_0x9e9f('0x2f'));_0xfae401[_0x9e9f('0x37')]=_[_0x9e9f('0x38')](_0x48bf37['query']);_0xfae401[_0x9e9f('0x39')]=_['intersection'](_0xfae401[_0x9e9f('0x35')],_0xfae401[_0x9e9f('0x37')]);_0x4c72d8[_0x9e9f('0x3a')]=_[_0x9e9f('0x3b')](_0xfae401[_0x9e9f('0x35')],qs[_0x9e9f('0x3c')](_0x48bf37['query'][_0x9e9f('0x3c')]));_0x4c72d8[_0x9e9f('0x3a')]=_0x4c72d8['attributes'][_0x9e9f('0x3d')]?_0x4c72d8['attributes']:_0xfae401[_0x9e9f('0x35')];if(!_0x48bf37[_0x9e9f('0x37')][_0x9e9f('0x3e')]('nolimit')){_0x4c72d8[_0x9e9f('0x22')]=qs[_0x9e9f('0x22')](_0x48bf37[_0x9e9f('0x37')]['limit']);_0x4c72d8['offset']=qs[_0x9e9f('0x20')](_0x48bf37[_0x9e9f('0x37')][_0x9e9f('0x20')]);}_0x4c72d8[_0x9e9f('0x3f')]=qs[_0x9e9f('0x40')](_0x48bf37[_0x9e9f('0x37')][_0x9e9f('0x40')]);_0x4c72d8[_0x9e9f('0x41')]=qs[_0x9e9f('0x39')](_[_0x9e9f('0x42')](_0x48bf37[_0x9e9f('0x37')],_0xfae401[_0x9e9f('0x39')]),_0x1f8177);if(_0x48bf37[_0x9e9f('0x37')][_0x9e9f('0x43')]){_0x4c72d8[_0x9e9f('0x41')]=_[_0x9e9f('0x44')](_0x4c72d8[_0x9e9f('0x41')],{'$or':_['map'](_0x1f8177,function(_0x261c2b){if(_0x261c2b[_0x9e9f('0x33')]!==_0x9e9f('0x45')){var _0x333dd5={};_0x333dd5[_0x261c2b[_0x9e9f('0x2f')]]={'$like':'%'+_0x48bf37['query'][_0x9e9f('0x43')]+'%'};return _0x333dd5;}})});}_0x4c72d8=_[_0x9e9f('0x44')]({},_0x4c72d8,_0x48bf37[_0x9e9f('0x46')]);var _0x59c290={'where':_0x4c72d8[_0x9e9f('0x41')]};return db['AnalyticExtractedReport'][_0x9e9f('0x23')](_0x59c290)['then'](function(_0x5da307){_0x100a05[_0x9e9f('0x23')]=_0x5da307;if(_0x48bf37['query'][_0x9e9f('0x47')]){_0x4c72d8[_0x9e9f('0x48')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x9e9f('0x49')](_0x4c72d8);})['then'](function(_0x1a0910){_0x100a05[_0x9e9f('0x4a')]=_0x1a0910;return _0x100a05;})['then'](respondWithFilteredResult(_0x3e2dfa,_0x4c72d8))[_0x9e9f('0x4b')](handleError(_0x3e2dfa,null));};exports[_0x9e9f('0x4c')]=function(_0x52e03a,_0x2c128b){var _0x2d6d25={'raw':!![],'where':{'id':_0x52e03a[_0x9e9f('0x4d')]['id']}},_0x4f75ca={};_0x4f75ca[_0x9e9f('0x35')]=_['keys'](db[_0x9e9f('0x4e')]['rawAttributes']);_0x4f75ca[_0x9e9f('0x37')]=_[_0x9e9f('0x38')](_0x52e03a[_0x9e9f('0x37')]);_0x4f75ca[_0x9e9f('0x39')]=_['intersection'](_0x4f75ca[_0x9e9f('0x35')],_0x4f75ca['query']);_0x2d6d25['attributes']=_[_0x9e9f('0x3b')](_0x4f75ca[_0x9e9f('0x35')],qs[_0x9e9f('0x3c')](_0x52e03a['query'][_0x9e9f('0x3c')]));_0x2d6d25['attributes']=_0x2d6d25[_0x9e9f('0x3a')][_0x9e9f('0x3d')]?_0x2d6d25[_0x9e9f('0x3a')]:_0x4f75ca[_0x9e9f('0x35')];if(_0x52e03a[_0x9e9f('0x37')][_0x9e9f('0x47')]){_0x2d6d25[_0x9e9f('0x48')]=[{'all':!![]}];}_0x2d6d25=_[_0x9e9f('0x44')]({},_0x2d6d25,_0x52e03a['options']);return db[_0x9e9f('0x4e')][_0x9e9f('0x4f')](_0x2d6d25)[_0x9e9f('0x27')](handleEntityNotFound(_0x2c128b,null))[_0x9e9f('0x27')](respondWithResult(_0x2c128b,null))['catch'](handleError(_0x2c128b,null));};exports['create']=function(_0x216657,_0x13bbf8){return db[_0x9e9f('0x4e')][_0x9e9f('0x50')](_0x216657[_0x9e9f('0x51')],{})[_0x9e9f('0x27')](function(_0xc8b194){var _0x1d334a=_0x216657[_0x9e9f('0x52')][_0x9e9f('0x29')]({'plain':!![]});if(!_0x1d334a)throw new Error(_0x9e9f('0x53'));if(_0x1d334a[_0x9e9f('0x54')]===_0x9e9f('0x52')){var _0x32aad2=_0xc8b194[_0x9e9f('0x29')]({'plain':!![]});var _0x45ce49='ExtractedReports';return db['UserProfileSection'][_0x9e9f('0x4f')]({'where':{'name':_0x45ce49,'userProfileId':_0x1d334a['userProfileId']},'raw':!![]})[_0x9e9f('0x27')](function(_0x35b2cb){if(_0x35b2cb&&_0x35b2cb[_0x9e9f('0x55')]===0x0){return db[_0x9e9f('0x2b')][_0x9e9f('0x50')]({'name':_0x32aad2[_0x9e9f('0x2f')],'resourceId':_0x32aad2['id'],'type':_0x35b2cb[_0x9e9f('0x2f')],'sectionId':_0x35b2cb['id']},{})['then'](function(){return _0xc8b194;});}else{return _0xc8b194;}})['catch'](function(_0x34eeeb){logger[_0x9e9f('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x34eeeb);throw _0x34eeeb;});}return _0xc8b194;})['then'](respondWithResult(_0x13bbf8,0xc9))[_0x9e9f('0x4b')](handleError(_0x13bbf8,null));};exports[_0x9e9f('0x56')]=function(_0x2676cc,_0x24c6c7){if(_0x2676cc['body']['id']){delete _0x2676cc[_0x9e9f('0x51')]['id'];}return db[_0x9e9f('0x4e')]['find']({'where':{'id':_0x2676cc[_0x9e9f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x24c6c7,null))[_0x9e9f('0x27')](saveUpdates(_0x2676cc[_0x9e9f('0x51')],null))[_0x9e9f('0x27')](respondWithResult(_0x24c6c7,null))[_0x9e9f('0x4b')](handleError(_0x24c6c7,null));};exports[_0x9e9f('0x28')]=function(_0x2abf55,_0x30bfd8){return db[_0x9e9f('0x4e')][_0x9e9f('0x4f')]({'where':{'id':_0x2abf55[_0x9e9f('0x4d')]['id']}})[_0x9e9f('0x27')](handleEntityNotFound(_0x30bfd8,null))[_0x9e9f('0x27')](removeEntity(_0x30bfd8,null))[_0x9e9f('0x4b')](handleError(_0x30bfd8,null));};exports[_0x9e9f('0x57')]=function(_0x27ad1b,_0x5d48e4,_0x1da310){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x27ad1b[_0x9e9f('0x4d')]['id']},'attributes':[_0x9e9f('0x2f'),_0x9e9f('0x58'),_0x9e9f('0x59'),_0x9e9f('0x5a')],'raw':!![]})[_0x9e9f('0x27')](handleEntityNotFound(_0x5d48e4,null))[_0x9e9f('0x27')](function(_0xd80095){if(_0xd80095){if(!fs[_0x9e9f('0x5b')](path[_0x9e9f('0x5c')](config[_0x9e9f('0x5d')],_0x9e9f('0x5e'),_0xd80095[_0x9e9f('0x59')]))){throw new db[(_0x9e9f('0x5f'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x27ad1b[_0x9e9f('0x37')][_0x9e9f('0x60')]){return _0x5d48e4[_0x9e9f('0x2c')](0xc8);}return _0x5d48e4[_0x9e9f('0x57')](path[_0x9e9f('0x5c')](config[_0x9e9f('0x5d')],_0x9e9f('0x5e'),_0xd80095['savename']),util['format'](_0x9e9f('0x61'),_0xd80095[_0x9e9f('0x58')]||_0xd80095[_0x9e9f('0x2f')],_0xd80095['output'][_0x9e9f('0x62')]()));}})[_0x9e9f('0x4b')](handleError(_0x5d48e4,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 16ba4f2..b076f5b 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 _0x8e13=['define','AnalyticExtractedReport','analytics_extracted_reports','util','moment','bluebird','request-promise','rimraf'];(function(_0xaa20b8,_0x1ad9c0){var _0x28f4b6=function(_0xe3d628){while(--_0xe3d628){_0xaa20b8['push'](_0xaa20b8['shift']());}};_0x28f4b6(++_0x1ad9c0);}(_0x8e13,0xfb));var _0x38e1=function(_0x3eeb52,_0x188530){_0x3eeb52=_0x3eeb52-0x0;var _0x362915=_0x8e13[_0x3eeb52];return _0x362915;};'use strict';var _=require('lodash');var util=require(_0x38e1('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x38e1('0x1'));var BPromise=require(_0x38e1('0x2'));var rp=require(_0x38e1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x38e1('0x4'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x3187dc,_0x6cd59b){return _0x3187dc[_0x38e1('0x5')](_0x38e1('0x6'),attributes,{'tableName':_0x38e1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4d8=['api','moment','bluebird','request-promise','path','rimraf','./analyticExtractedReport.attributes','define','lodash','../../config/logger'];(function(_0x1f018b,_0x8640d9){var _0x5f39a4=function(_0x3e87c5){while(--_0x3e87c5){_0x1f018b['push'](_0x1f018b['shift']());}};_0x5f39a4(++_0x8640d9);}(_0xd4d8,0xee));var _0x8d4d=function(_0x42ab91,_0x2a0179){_0x42ab91=_0x42ab91-0x0;var _0x259d35=_0xd4d8[_0x42ab91];return _0x259d35;};'use strict';var _=require(_0x8d4d('0x0'));var util=require('util');var logger=require(_0x8d4d('0x1'))(_0x8d4d('0x2'));var moment=require(_0x8d4d('0x3'));var BPromise=require(_0x8d4d('0x4'));var rp=require(_0x8d4d('0x5'));var fs=require('fs');var path=require(_0x8d4d('0x6'));var rimraf=require(_0x8d4d('0x7'));var config=require('../../config/environment');var attributes=require(_0x8d4d('0x8'));module['exports']=function(_0x3db03d,_0x4c396a){return _0x3db03d[_0x8d4d('0x9')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 64a43d2..6d12d59 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 _0xf500=['../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x5e6cb8,_0x16cf56){var _0x3faeb3=function(_0x1a7355){while(--_0x1a7355){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x3faeb3(++_0x16cf56);}(_0xf500,0x9a));var _0x0f50=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xf500[_0x344a3f];return _0x264712;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0f50('0x0'));var BPromise=require(_0x0f50('0x1'));var rs=require(_0x0f50('0x2'));var fs=require('fs');var Redis=require(_0x0f50('0x3'));var db=require(_0x0f50('0x4'))['db'];var utils=require(_0x0f50('0x5'));var logger=require('../../config/logger')(_0x0f50('0x6'));var config=require(_0x0f50('0x7'));var jayson=require(_0x0f50('0x8'));var client=jayson[_0x0f50('0x9')][_0x0f50('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e0d80,_0x1209aa,_0x56596f){return new BPromise(function(_0x4cce68,_0x1f5ef0){return client[_0x0f50('0xb')](_0x4e0d80,_0x56596f)[_0x0f50('0xc')](function(_0x5115ed){logger[_0x0f50('0xd')](_0x0f50('0xe'),_0x1209aa,_0x0f50('0xf'));logger[_0x0f50('0x10')](_0x0f50('0x11'),_0x1209aa,'request\x20sent',JSON[_0x0f50('0x12')](_0x5115ed));if(_0x5115ed[_0x0f50('0x13')]){if(_0x5115ed[_0x0f50('0x13')][_0x0f50('0x14')]===0x1f4){logger[_0x0f50('0x13')](_0x0f50('0xe'),_0x1209aa,_0x5115ed[_0x0f50('0x13')][_0x0f50('0x15')]);return _0x1f5ef0(_0x5115ed[_0x0f50('0x13')][_0x0f50('0x15')]);}logger['error'](_0x0f50('0xe'),_0x1209aa,_0x5115ed['error']['message']);return _0x4cce68(_0x5115ed[_0x0f50('0x13')][_0x0f50('0x15')]);}else{logger[_0x0f50('0xd')](_0x0f50('0xe'),_0x1209aa,'request\x20sent');_0x4cce68(_0x5115ed[_0x0f50('0x16')]['message']);}})['catch'](function(_0xff2322){logger[_0x0f50('0x13')](_0x0f50('0xe'),_0x1209aa,_0xff2322);_0x1f5ef0(_0xff2322);});});} \ No newline at end of file +var _0xf263=['rpc','../../config/environment','jayson/promise','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xf263,0x149));var _0x3f26=function(_0x4cf8d4,_0x5aee73){_0x4cf8d4=_0x4cf8d4-0x0;var _0x2c1beb=_0xf263[_0x4cf8d4];return _0x2c1beb;};'use strict';var _=require(_0x3f26('0x0'));var util=require(_0x3f26('0x1'));var moment=require(_0x3f26('0x2'));var BPromise=require(_0x3f26('0x3'));var rs=require(_0x3f26('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f26('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f26('0x6'))(_0x3f26('0x7'));var config=require(_0x3f26('0x8'));var jayson=require(_0x3f26('0x9'));var client=jayson['client'][_0x3f26('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ae1ad,_0x48392a,_0x50fb53){return new BPromise(function(_0x25f9bd,_0x202d88){return client[_0x3f26('0xb')](_0x3ae1ad,_0x50fb53)['then'](function(_0x219fc5){logger[_0x3f26('0xc')](_0x3f26('0xd'),_0x48392a,_0x3f26('0xe'));logger[_0x3f26('0xf')](_0x3f26('0x10'),_0x48392a,_0x3f26('0xe'),JSON[_0x3f26('0x11')](_0x219fc5));if(_0x219fc5[_0x3f26('0x12')]){if(_0x219fc5[_0x3f26('0x12')]['code']===0x1f4){logger['error'](_0x3f26('0xd'),_0x48392a,_0x219fc5[_0x3f26('0x12')][_0x3f26('0x13')]);return _0x202d88(_0x219fc5[_0x3f26('0x12')]['message']);}logger[_0x3f26('0x12')](_0x3f26('0xd'),_0x48392a,_0x219fc5[_0x3f26('0x12')][_0x3f26('0x13')]);return _0x25f9bd(_0x219fc5['error'][_0x3f26('0x13')]);}else{logger[_0x3f26('0xc')](_0x3f26('0xd'),_0x48392a,_0x3f26('0xe'));_0x25f9bd(_0x219fc5['result'][_0x3f26('0x13')]);}})[_0x3f26('0x14')](function(_0x3bcf44){logger[_0x3f26('0x12')](_0x3f26('0xd'),_0x48392a,_0x3bcf44);_0x202d88(_0x3bcf44);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index caa4658..fe2d78d 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 _0xf926=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','show','download','post','create','put','update','destroy','exports'];(function(_0x41bd33,_0x8dd533){var _0x1ef83a=function(_0x5821aa){while(--_0x5821aa){_0x41bd33['push'](_0x41bd33['shift']());}};_0x1ef83a(++_0x8dd533);}(_0xf926,0xd2));var _0x6f92=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf926[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x6f92('0x0'));var util=require(_0x6f92('0x1'));var path=require(_0x6f92('0x2'));var timeout=require(_0x6f92('0x3'));var express=require(_0x6f92('0x4'));var router=express['Router']();var fs_extra=require(_0x6f92('0x5'));var auth=require(_0x6f92('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6f92('0x7'));var controller=require(_0x6f92('0x8'));router[_0x6f92('0x9')]('/',auth['isAuthenticated'](),controller[_0x6f92('0xa')]);router[_0x6f92('0x9')](_0x6f92('0xb'),auth[_0x6f92('0xc')](),controller[_0x6f92('0xd')]);router[_0x6f92('0x9')]('/:id/download',auth[_0x6f92('0xc')](),controller[_0x6f92('0xe')]);router[_0x6f92('0xf')]('/',auth[_0x6f92('0xc')](),controller[_0x6f92('0x10')]);router[_0x6f92('0x11')](_0x6f92('0xb'),auth[_0x6f92('0xc')](),controller[_0x6f92('0x12')]);router['delete'](_0x6f92('0xb'),auth[_0x6f92('0xc')](),controller[_0x6f92('0x13')]);module[_0x6f92('0x14')]=router; \ No newline at end of file +var _0x8ec5=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','destroy','exports','util','path','connect-timeout'];(function(_0x582e57,_0x85fded){var _0xfef0e6=function(_0x4b78be){while(--_0x4b78be){_0x582e57['push'](_0x582e57['shift']());}};_0xfef0e6(++_0x85fded);}(_0x8ec5,0x1a1));var _0x58ec=function(_0x3782cb,_0x46f0be){_0x3782cb=_0x3782cb-0x0;var _0x557f9a=_0x8ec5[_0x3782cb];return _0x557f9a;};'use strict';var multer=require('multer');var util=require(_0x58ec('0x0'));var path=require(_0x58ec('0x1'));var timeout=require(_0x58ec('0x2'));var express=require(_0x58ec('0x3'));var router=express[_0x58ec('0x4')]();var fs_extra=require(_0x58ec('0x5'));var auth=require(_0x58ec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x58ec('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x58ec('0x8')]('/',auth[_0x58ec('0x9')](),controller[_0x58ec('0xa')]);router[_0x58ec('0x8')](_0x58ec('0xb'),auth[_0x58ec('0x9')](),controller[_0x58ec('0xc')]);router[_0x58ec('0x8')](_0x58ec('0xd'),auth[_0x58ec('0x9')](),controller[_0x58ec('0xe')]);router[_0x58ec('0xf')]('/',auth[_0x58ec('0x9')](),controller[_0x58ec('0x10')]);router[_0x58ec('0x11')](_0x58ec('0xb'),auth[_0x58ec('0x9')](),controller[_0x58ec('0x12')]);router['delete'](_0x58ec('0xb'),auth[_0x58ec('0x9')](),controller[_0x58ec('0x13')]);module[_0x58ec('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index e496292..f4448b8 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 _0x6b3b=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x4e783c,_0x51a362){var _0x2fbd6d=function(_0x513e00){while(--_0x513e00){_0x4e783c['push'](_0x4e783c['shift']());}};_0x2fbd6d(++_0x51a362);}(_0x6b3b,0xc3));var _0xb6b3=function(_0x340294,_0x2775a9){_0x340294=_0x340294-0x0;var _0x23baf6=_0x6b3b[_0x340294];return _0x23baf6;};'use strict';var Sequelize=require(_0xb6b3('0x0'));module[_0xb6b3('0x1')]={'field':{'type':Sequelize[_0xb6b3('0x2')]},'alias':{'type':Sequelize[_0xb6b3('0x3')]},'function':{'type':Sequelize[_0xb6b3('0x3')]},'format':{'type':Sequelize[_0xb6b3('0x3')]},'groupBy':{'type':Sequelize[_0xb6b3('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb6b3('0x3')]},'custom':{'type':Sequelize[_0xb6b3('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x3f78=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f78,0x9a));var _0x83f7=function(_0x30033a,_0x5ce4a6){_0x30033a=_0x30033a-0x0;var _0x5e3518=_0x3f78[_0x30033a];return _0x5e3518;};'use strict';var Sequelize=require(_0x83f7('0x0'));module[_0x83f7('0x1')]={'field':{'type':Sequelize[_0x83f7('0x2')]},'alias':{'type':Sequelize[_0x83f7('0x3')]},'function':{'type':Sequelize[_0x83f7('0x3')]},'format':{'type':Sequelize[_0x83f7('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x83f7('0x3')]},'custom':{'type':Sequelize[_0x83f7('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 c723e1d..db27f9d 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 _0x3503=['merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','bulkCreate','bulkDestroy','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x185c5e,_0x1b05f5){var _0x14053a=function(_0xd55b4){while(--_0xd55b4){_0x185c5e['push'](_0x185c5e['shift']());}};_0x14053a(++_0x1b05f5);}(_0x3503,0x1ad));var _0x3350=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x3503[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x3350('0x0'));var rimraf=require(_0x3350('0x1'));var zipdir=require(_0x3350('0x2'));var jsonpatch=require(_0x3350('0x3'));var rp=require(_0x3350('0x4'));var moment=require(_0x3350('0x5'));var BPromise=require(_0x3350('0x6'));var Mustache=require('mustache');var util=require(_0x3350('0x7'));var path=require(_0x3350('0x8'));var sox=require(_0x3350('0x9'));var csv=require(_0x3350('0xa'));var ejs=require(_0x3350('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3350('0xc'));var deskjs=require(_0x3350('0xd'));var toCsv=require(_0x3350('0xa'));var querystring=require(_0x3350('0xe'));var Papa=require(_0x3350('0xf'));var Redis=require(_0x3350('0x10'));var authService=require(_0x3350('0x11'));var qs=require(_0x3350('0x12'));var as=require(_0x3350('0x13'));var hardwareService=require(_0x3350('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x3350('0x15'));var config=require(_0x3350('0x16'));var licenseUtil=require(_0x3350('0x17'));var db=require(_0x3350('0x18'))['db'];function respondWithStatusCode(_0x41be3f,_0x4f22e3){_0x4f22e3=_0x4f22e3||0xcc;return function(_0x24eb43){if(_0x24eb43){return _0x41be3f[_0x3350('0x19')](_0x4f22e3);}return _0x41be3f[_0x3350('0x1a')](_0x4f22e3)['end']();};}function respondWithResult(_0x46968f,_0x527c08){_0x527c08=_0x527c08||0xc8;return function(_0x861206){if(_0x861206){return _0x46968f[_0x3350('0x1a')](_0x527c08)[_0x3350('0x1b')](_0x861206);}};}function respondWithFilteredResult(_0x484c79,_0x286dce){return function(_0x1dc9f8){if(_0x1dc9f8){var _0x527c26=typeof _0x286dce['offset']==='undefined'&&typeof _0x286dce['limit']===_0x3350('0x1c');var _0x347d81=_0x1dc9f8[_0x3350('0x1d')];var _0x53068b=_0x527c26?0x0:_0x286dce['offset'];var _0x100384=_0x527c26?_0x1dc9f8[_0x3350('0x1d')]:_0x286dce[_0x3350('0x1e')]+_0x286dce[_0x3350('0x1f')];var _0x337b6a;if(_0x100384>=_0x347d81){_0x100384=_0x347d81;_0x337b6a=0xc8;}else{_0x337b6a=0xce;}_0x484c79['status'](_0x337b6a);return _0x484c79[_0x3350('0x20')](_0x3350('0x21'),_0x53068b+'-'+_0x100384+'/'+_0x347d81)[_0x3350('0x1b')](_0x1dc9f8);}return null;};}function patchUpdates(_0x1f880b){return function(_0x5301fd){try{jsonpatch[_0x3350('0x22')](_0x5301fd,_0x1f880b,!![]);}catch(_0x4a41e2){return BPromise[_0x3350('0x23')](_0x4a41e2);}return _0x5301fd[_0x3350('0x24')]();};}function saveUpdates(_0x109409,_0x23e8d8){return function(_0x44b90e){if(_0x44b90e){return _0x44b90e[_0x3350('0x25')](_0x109409)['then'](function(_0x4235a9){return _0x4235a9;});}return null;};}function removeEntity(_0x469775,_0x6a8f3e){return function(_0x42e38c){if(_0x42e38c){return _0x42e38c[_0x3350('0x26')]()[_0x3350('0x27')](function(){_0x469775['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4edc17,_0x2d39bd){return function(_0x45eec6){if(!_0x45eec6){_0x4edc17[_0x3350('0x19')](0x194);}return _0x45eec6;};}function handleError(_0x3f0558,_0x162af7){_0x162af7=_0x162af7||0x1f4;return function(_0x5977cf){logger['error'](_0x5977cf[_0x3350('0x28')]);if(_0x5977cf[_0x3350('0x29')]){delete _0x5977cf[_0x3350('0x29')];}_0x3f0558[_0x3350('0x1a')](_0x162af7)[_0x3350('0x2a')](_0x5977cf);};}exports[_0x3350('0x2b')]=function(_0x318efa,_0x30a577){var _0x4afc77={},_0x5633a0={},_0x56879c={'count':0x0,'rows':[]};var _0x74e27=_[_0x3350('0x2c')](db[_0x3350('0x2d')][_0x3350('0x2e')],function(_0x3540f4){return{'name':_0x3540f4[_0x3350('0x2f')],'type':_0x3540f4['type'][_0x3350('0x30')]};});_0x5633a0[_0x3350('0x31')]=_[_0x3350('0x2c')](_0x74e27,_0x3350('0x29'));_0x5633a0['query']=_[_0x3350('0x32')](_0x318efa[_0x3350('0x33')]);_0x5633a0[_0x3350('0x34')]=_[_0x3350('0x35')](_0x5633a0[_0x3350('0x31')],_0x5633a0[_0x3350('0x33')]);_0x4afc77[_0x3350('0x36')]=_[_0x3350('0x35')](_0x5633a0[_0x3350('0x31')],qs['fields'](_0x318efa[_0x3350('0x33')]['fields']));_0x4afc77[_0x3350('0x36')]=_0x4afc77[_0x3350('0x36')][_0x3350('0x37')]?_0x4afc77['attributes']:_0x5633a0[_0x3350('0x31')];if(!_0x318efa['query'][_0x3350('0x38')](_0x3350('0x39'))){_0x4afc77[_0x3350('0x1f')]=qs[_0x3350('0x1f')](_0x318efa[_0x3350('0x33')][_0x3350('0x1f')]);_0x4afc77[_0x3350('0x1e')]=qs['offset'](_0x318efa[_0x3350('0x33')][_0x3350('0x1e')]);}_0x4afc77[_0x3350('0x3a')]=qs[_0x3350('0x3b')](_0x318efa[_0x3350('0x33')][_0x3350('0x3b')]);_0x4afc77['where']=qs[_0x3350('0x34')](_[_0x3350('0x3c')](_0x318efa[_0x3350('0x33')],_0x5633a0['filters']),_0x74e27);if(_0x318efa[_0x3350('0x33')][_0x3350('0x3d')]){_0x4afc77[_0x3350('0x3e')]=_[_0x3350('0x3f')](_0x4afc77[_0x3350('0x3e')],{'$or':_[_0x3350('0x2c')](_0x74e27,function(_0x215704){if(_0x215704['type']!==_0x3350('0x40')){var _0x14343c={};_0x14343c[_0x215704[_0x3350('0x29')]]={'$like':'%'+_0x318efa['query']['filter']+'%'};return _0x14343c;}})});}_0x4afc77=_['merge']({},_0x4afc77,_0x318efa['options']);var _0x348238={'where':_0x4afc77[_0x3350('0x3e')]};return db[_0x3350('0x2d')][_0x3350('0x1d')](_0x348238)[_0x3350('0x27')](function(_0x1942b7){_0x56879c[_0x3350('0x1d')]=_0x1942b7;if(_0x318efa[_0x3350('0x33')][_0x3350('0x41')]){_0x4afc77[_0x3350('0x42')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x3350('0x43')](_0x4afc77);})[_0x3350('0x27')](function(_0xb54fa0){_0x56879c[_0x3350('0x44')]=_0xb54fa0;return _0x56879c;})[_0x3350('0x27')](respondWithFilteredResult(_0x30a577,_0x4afc77))[_0x3350('0x45')](handleError(_0x30a577,null));};exports[_0x3350('0x46')]=function(_0x54ec7f,_0x1af97d){var _0x24d648={'raw':![],'where':{'id':_0x54ec7f[_0x3350('0x47')]['id']}},_0x56ba90={};_0x56ba90[_0x3350('0x31')]=_[_0x3350('0x32')](db['AnalyticFieldReport'][_0x3350('0x2e')]);_0x56ba90['query']=_[_0x3350('0x32')](_0x54ec7f[_0x3350('0x33')]);_0x56ba90['filters']=_[_0x3350('0x35')](_0x56ba90[_0x3350('0x31')],_0x56ba90[_0x3350('0x33')]);_0x24d648[_0x3350('0x36')]=_['intersection'](_0x56ba90[_0x3350('0x31')],qs[_0x3350('0x48')](_0x54ec7f[_0x3350('0x33')][_0x3350('0x48')]));_0x24d648[_0x3350('0x36')]=_0x24d648['attributes'][_0x3350('0x37')]?_0x24d648[_0x3350('0x36')]:_0x56ba90[_0x3350('0x31')];if(_0x54ec7f['query'][_0x3350('0x41')]){_0x24d648[_0x3350('0x42')]=[{'all':!![]}];}_0x24d648=_[_0x3350('0x3f')]({},_0x24d648,_0x54ec7f['options']);return db['AnalyticFieldReport'][_0x3350('0x49')](_0x24d648)[_0x3350('0x27')](handleEntityNotFound(_0x1af97d,null))[_0x3350('0x27')](respondWithResult(_0x1af97d,null))[_0x3350('0x45')](handleError(_0x1af97d,null));};exports[_0x3350('0x4a')]=function(_0x77699c,_0x30a402){return db[_0x3350('0x2d')]['create'](_0x77699c[_0x3350('0x4b')],{})['then'](respondWithResult(_0x30a402,0xc9))[_0x3350('0x45')](handleError(_0x30a402,null));};exports[_0x3350('0x4c')]=function(_0x27a2bb,_0x435689){return db[_0x3350('0x2d')][_0x3350('0x4c')](_0x27a2bb[_0x3350('0x4b')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x435689,0xc9))[_0x3350('0x45')](handleError(_0x435689,null));};exports[_0x3350('0x25')]=function(_0x5e4702,_0x283578){if(_0x5e4702[_0x3350('0x4b')]['id']){delete _0x5e4702['body']['id'];}return db['AnalyticFieldReport'][_0x3350('0x49')]({'where':{'id':_0x5e4702[_0x3350('0x47')]['id']}})[_0x3350('0x27')](handleEntityNotFound(_0x283578,null))[_0x3350('0x27')](saveUpdates(_0x5e4702['body'],null))[_0x3350('0x27')](respondWithResult(_0x283578,null))[_0x3350('0x45')](handleError(_0x283578,null));};exports[_0x3350('0x26')]=function(_0x403f82,_0x10b497){return db[_0x3350('0x2d')][_0x3350('0x49')]({'where':{'id':_0x403f82[_0x3350('0x47')]['id']}})[_0x3350('0x27')](handleEntityNotFound(_0x10b497,null))[_0x3350('0x27')](removeEntity(_0x10b497,null))[_0x3350('0x45')](handleError(_0x10b497,null));};exports[_0x3350('0x4d')]=function(_0xaac246,_0x27c5f7){return db[_0x3350('0x2d')][_0x3350('0x26')]({'where':{'id':_0xaac246[_0x3350('0x33')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x3350('0x27')](respondWithResult(_0x27c5f7,0xcc))[_0x3350('0x45')](handleError(_0x27c5f7,null));};exports['addFields']=function(_0x326dca,_0x12b1c4,_0x297736){return db['AnalyticCustomReport'][_0x3350('0x4e')]({'where':{'id':_0x326dca[_0x3350('0x47')]['id']}})[_0x3350('0x27')](handleEntityNotFound(_0x12b1c4,null))[_0x3350('0x27')](function(_0x311128){if(_0x311128){return db[_0x3350('0x4f')][_0x3350('0x50')](function(_0x6a3070){return db['AnalyticFieldReport'][_0x3350('0x26')]({'where':{'CustomReportId':_0x326dca[_0x3350('0x47')]['id']},'transaction':_0x6a3070})[_0x3350('0x27')](function(_0x33d24d){var _0x1dceb9=_[_0x3350('0x2c')](_0x326dca['body'],function(_0x39dd4f){delete _0x39dd4f['id'];_0x39dd4f[_0x3350('0x51')]=_0x326dca['params']['id'];return _0x39dd4f;});return db[_0x3350('0x2d')][_0x3350('0x4c')](_0x1dceb9,{'transaction':_0x6a3070});});})[_0x3350('0x27')](function(){return db[_0x3350('0x2d')][_0x3350('0x43')]({'where':{'CustomReportId':_0x326dca[_0x3350('0x47')]['id']}});});}})[_0x3350('0x27')](respondWithResult(_0x12b1c4,null))[_0x3350('0x45')](handleError(_0x12b1c4,null));}; \ No newline at end of file +var _0xd2cd=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','AnalyticFieldReport','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','merge','catch','create','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse'];(function(_0x30b9d6,_0x2ad4ea){var _0x5f4d07=function(_0xc507f1){while(--_0xc507f1){_0x30b9d6['push'](_0x30b9d6['shift']());}};_0x5f4d07(++_0x2ad4ea);}(_0xd2cd,0x14f));var _0xdd2c=function(_0xe0dee2,_0x35d2a8){_0xe0dee2=_0xe0dee2-0x0;var _0x568ed0=_0xd2cd[_0xe0dee2];return _0x568ed0;};'use strict';var emlformat=require(_0xdd2c('0x0'));var rimraf=require(_0xdd2c('0x1'));var zipdir=require(_0xdd2c('0x2'));var jsonpatch=require(_0xdd2c('0x3'));var rp=require(_0xdd2c('0x4'));var moment=require(_0xdd2c('0x5'));var BPromise=require(_0xdd2c('0x6'));var Mustache=require(_0xdd2c('0x7'));var util=require(_0xdd2c('0x8'));var path=require('path');var sox=require(_0xdd2c('0x9'));var csv=require('to-csv');var ejs=require(_0xdd2c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdd2c('0xb'));var crypto=require(_0xdd2c('0xc'));var jsforce=require(_0xdd2c('0xd'));var deskjs=require(_0xdd2c('0xe'));var toCsv=require(_0xdd2c('0xf'));var querystring=require('querystring');var Papa=require(_0xdd2c('0x10'));var Redis=require(_0xdd2c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdd2c('0x12'));var as=require(_0xdd2c('0x13'));var hardwareService=require(_0xdd2c('0x14'));var logger=require(_0xdd2c('0x15'))(_0xdd2c('0x16'));var utils=require(_0xdd2c('0x17'));var config=require(_0xdd2c('0x18'));var licenseUtil=require(_0xdd2c('0x19'));var db=require(_0xdd2c('0x1a'))['db'];function respondWithStatusCode(_0x447453,_0x238934){_0x238934=_0x238934||0xcc;return function(_0x4b505c){if(_0x4b505c){return _0x447453[_0xdd2c('0x1b')](_0x238934);}return _0x447453[_0xdd2c('0x1c')](_0x238934)[_0xdd2c('0x1d')]();};}function respondWithResult(_0x32920c,_0x2524b4){_0x2524b4=_0x2524b4||0xc8;return function(_0x1b4d35){if(_0x1b4d35){return _0x32920c[_0xdd2c('0x1c')](_0x2524b4)[_0xdd2c('0x1e')](_0x1b4d35);}};}function respondWithFilteredResult(_0x550cd6,_0x5a4f82){return function(_0x30d7b8){if(_0x30d7b8){var _0x4321cf=typeof _0x5a4f82[_0xdd2c('0x1f')]===_0xdd2c('0x20')&&typeof _0x5a4f82[_0xdd2c('0x21')]===_0xdd2c('0x20');var _0x1bc142=_0x30d7b8[_0xdd2c('0x22')];var _0x1b69f2=_0x4321cf?0x0:_0x5a4f82[_0xdd2c('0x1f')];var _0x11af89=_0x4321cf?_0x30d7b8['count']:_0x5a4f82[_0xdd2c('0x1f')]+_0x5a4f82[_0xdd2c('0x21')];var _0x48584f;if(_0x11af89>=_0x1bc142){_0x11af89=_0x1bc142;_0x48584f=0xc8;}else{_0x48584f=0xce;}_0x550cd6[_0xdd2c('0x1c')](_0x48584f);return _0x550cd6['set'](_0xdd2c('0x23'),_0x1b69f2+'-'+_0x11af89+'/'+_0x1bc142)[_0xdd2c('0x1e')](_0x30d7b8);}return null;};}function patchUpdates(_0x1cdcc3){return function(_0x2c01a6){try{jsonpatch[_0xdd2c('0x24')](_0x2c01a6,_0x1cdcc3,!![]);}catch(_0x48f473){return BPromise[_0xdd2c('0x25')](_0x48f473);}return _0x2c01a6[_0xdd2c('0x26')]();};}function saveUpdates(_0xecea5a,_0x4c2c90){return function(_0x1049b9){if(_0x1049b9){return _0x1049b9[_0xdd2c('0x27')](_0xecea5a)[_0xdd2c('0x28')](function(_0x40b625){return _0x40b625;});}return null;};}function removeEntity(_0x4d4444,_0x5d44aa){return function(_0x8b670c){if(_0x8b670c){return _0x8b670c[_0xdd2c('0x29')]()[_0xdd2c('0x28')](function(){_0x4d4444['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x27c043,_0x3b4cfb){return function(_0x3130dd){if(!_0x3130dd){_0x27c043[_0xdd2c('0x1b')](0x194);}return _0x3130dd;};}function handleError(_0x1a2cd0,_0x25f91a){_0x25f91a=_0x25f91a||0x1f4;return function(_0x43b623){logger[_0xdd2c('0x2a')](_0x43b623[_0xdd2c('0x2b')]);if(_0x43b623[_0xdd2c('0x2c')]){delete _0x43b623['name'];}_0x1a2cd0[_0xdd2c('0x1c')](_0x25f91a)['send'](_0x43b623);};}exports[_0xdd2c('0x2d')]=function(_0x2144bd,_0x350c5a){var _0x584168={},_0x3cde73={},_0x33df32={'count':0x0,'rows':[]};var _0x1059ac=_[_0xdd2c('0x2e')](db[_0xdd2c('0x2f')]['rawAttributes'],function(_0x972a97){return{'name':_0x972a97[_0xdd2c('0x30')],'type':_0x972a97[_0xdd2c('0x31')][_0xdd2c('0x32')]};});_0x3cde73[_0xdd2c('0x33')]=_[_0xdd2c('0x2e')](_0x1059ac,_0xdd2c('0x2c'));_0x3cde73['query']=_[_0xdd2c('0x34')](_0x2144bd[_0xdd2c('0x35')]);_0x3cde73[_0xdd2c('0x36')]=_[_0xdd2c('0x37')](_0x3cde73[_0xdd2c('0x33')],_0x3cde73['query']);_0x584168['attributes']=_['intersection'](_0x3cde73[_0xdd2c('0x33')],qs[_0xdd2c('0x38')](_0x2144bd[_0xdd2c('0x35')]['fields']));_0x584168['attributes']=_0x584168[_0xdd2c('0x39')][_0xdd2c('0x3a')]?_0x584168[_0xdd2c('0x39')]:_0x3cde73[_0xdd2c('0x33')];if(!_0x2144bd[_0xdd2c('0x35')]['hasOwnProperty'](_0xdd2c('0x3b'))){_0x584168[_0xdd2c('0x21')]=qs['limit'](_0x2144bd[_0xdd2c('0x35')][_0xdd2c('0x21')]);_0x584168[_0xdd2c('0x1f')]=qs[_0xdd2c('0x1f')](_0x2144bd[_0xdd2c('0x35')][_0xdd2c('0x1f')]);}_0x584168[_0xdd2c('0x3c')]=qs[_0xdd2c('0x3d')](_0x2144bd[_0xdd2c('0x35')][_0xdd2c('0x3d')]);_0x584168[_0xdd2c('0x3e')]=qs[_0xdd2c('0x36')](_[_0xdd2c('0x3f')](_0x2144bd[_0xdd2c('0x35')],_0x3cde73[_0xdd2c('0x36')]),_0x1059ac);if(_0x2144bd[_0xdd2c('0x35')][_0xdd2c('0x40')]){_0x584168[_0xdd2c('0x3e')]=_['merge'](_0x584168[_0xdd2c('0x3e')],{'$or':_[_0xdd2c('0x2e')](_0x1059ac,function(_0x3b5393){if(_0x3b5393['type']!==_0xdd2c('0x41')){var _0x324d29={};_0x324d29[_0x3b5393[_0xdd2c('0x2c')]]={'$like':'%'+_0x2144bd[_0xdd2c('0x35')][_0xdd2c('0x40')]+'%'};return _0x324d29;}})});}_0x584168=_['merge']({},_0x584168,_0x2144bd[_0xdd2c('0x42')]);var _0x50d5cb={'where':_0x584168[_0xdd2c('0x3e')]};return db[_0xdd2c('0x2f')][_0xdd2c('0x22')](_0x50d5cb)[_0xdd2c('0x28')](function(_0x306a2a){_0x33df32['count']=_0x306a2a;if(_0x2144bd['query'][_0xdd2c('0x43')]){_0x584168[_0xdd2c('0x44')]=[{'all':!![]}];}return db[_0xdd2c('0x2f')][_0xdd2c('0x45')](_0x584168);})[_0xdd2c('0x28')](function(_0x5c3700){_0x33df32[_0xdd2c('0x46')]=_0x5c3700;return _0x33df32;})[_0xdd2c('0x28')](respondWithFilteredResult(_0x350c5a,_0x584168))['catch'](handleError(_0x350c5a,null));};exports[_0xdd2c('0x47')]=function(_0x7e5f72,_0x40aa19){var _0x4e3712={'raw':![],'where':{'id':_0x7e5f72[_0xdd2c('0x48')]['id']}},_0x31e04f={};_0x31e04f[_0xdd2c('0x33')]=_[_0xdd2c('0x34')](db['AnalyticFieldReport'][_0xdd2c('0x49')]);_0x31e04f[_0xdd2c('0x35')]=_[_0xdd2c('0x34')](_0x7e5f72['query']);_0x31e04f[_0xdd2c('0x36')]=_[_0xdd2c('0x37')](_0x31e04f[_0xdd2c('0x33')],_0x31e04f['query']);_0x4e3712[_0xdd2c('0x39')]=_[_0xdd2c('0x37')](_0x31e04f[_0xdd2c('0x33')],qs[_0xdd2c('0x38')](_0x7e5f72['query']['fields']));_0x4e3712[_0xdd2c('0x39')]=_0x4e3712[_0xdd2c('0x39')][_0xdd2c('0x3a')]?_0x4e3712[_0xdd2c('0x39')]:_0x31e04f[_0xdd2c('0x33')];if(_0x7e5f72['query']['includeAll']){_0x4e3712[_0xdd2c('0x44')]=[{'all':!![]}];}_0x4e3712=_[_0xdd2c('0x4a')]({},_0x4e3712,_0x7e5f72['options']);return db[_0xdd2c('0x2f')]['find'](_0x4e3712)['then'](handleEntityNotFound(_0x40aa19,null))[_0xdd2c('0x28')](respondWithResult(_0x40aa19,null))[_0xdd2c('0x4b')](handleError(_0x40aa19,null));};exports[_0xdd2c('0x4c')]=function(_0x9d2248,_0x1e01a6){return db['AnalyticFieldReport']['create'](_0x9d2248[_0xdd2c('0x4d')],{})[_0xdd2c('0x28')](respondWithResult(_0x1e01a6,0xc9))[_0xdd2c('0x4b')](handleError(_0x1e01a6,null));};exports['bulkCreate']=function(_0x38f5a3,_0x1c721d){return db[_0xdd2c('0x2f')][_0xdd2c('0x4e')](_0x38f5a3[_0xdd2c('0x4d')],{'raw':![],'individualHooks':!![]})[_0xdd2c('0x28')](respondWithResult(_0x1c721d,0xc9))[_0xdd2c('0x4b')](handleError(_0x1c721d,null));};exports['update']=function(_0x3120fe,_0x43aa33){if(_0x3120fe[_0xdd2c('0x4d')]['id']){delete _0x3120fe[_0xdd2c('0x4d')]['id'];}return db[_0xdd2c('0x2f')][_0xdd2c('0x4f')]({'where':{'id':_0x3120fe[_0xdd2c('0x48')]['id']}})['then'](handleEntityNotFound(_0x43aa33,null))[_0xdd2c('0x28')](saveUpdates(_0x3120fe['body'],null))['then'](respondWithResult(_0x43aa33,null))[_0xdd2c('0x4b')](handleError(_0x43aa33,null));};exports[_0xdd2c('0x29')]=function(_0x59ec0f,_0x113f19){return db['AnalyticFieldReport'][_0xdd2c('0x4f')]({'where':{'id':_0x59ec0f[_0xdd2c('0x48')]['id']}})[_0xdd2c('0x28')](handleEntityNotFound(_0x113f19,null))[_0xdd2c('0x28')](removeEntity(_0x113f19,null))[_0xdd2c('0x4b')](handleError(_0x113f19,null));};exports[_0xdd2c('0x50')]=function(_0xac54ce,_0x569df1){return db['AnalyticFieldReport'][_0xdd2c('0x29')]({'where':{'id':_0xac54ce['query'][_0xdd2c('0x51')]||[]},'raw':![],'individualHooks':!![]})[_0xdd2c('0x28')](respondWithResult(_0x569df1,0xcc))[_0xdd2c('0x4b')](handleError(_0x569df1,null));};exports[_0xdd2c('0x52')]=function(_0x14ed1f,_0x5a651b,_0x149338){return db[_0xdd2c('0x53')][_0xdd2c('0x54')]({'where':{'id':_0x14ed1f[_0xdd2c('0x48')]['id']}})[_0xdd2c('0x28')](handleEntityNotFound(_0x5a651b,null))[_0xdd2c('0x28')](function(_0x3cc5b9){if(_0x3cc5b9){return db[_0xdd2c('0x55')][_0xdd2c('0x56')](function(_0x913ccd){return db[_0xdd2c('0x2f')]['destroy']({'where':{'CustomReportId':_0x14ed1f['params']['id']},'transaction':_0x913ccd})['then'](function(_0x77a343){var _0x255f49=_['map'](_0x14ed1f['body'],function(_0x28f512){delete _0x28f512['id'];_0x28f512[_0xdd2c('0x57')]=_0x14ed1f[_0xdd2c('0x48')]['id'];return _0x28f512;});return db[_0xdd2c('0x2f')][_0xdd2c('0x4e')](_0x255f49,{'transaction':_0x913ccd});});})['then'](function(){return db[_0xdd2c('0x2f')][_0xdd2c('0x45')]({'where':{'CustomReportId':_0x14ed1f['params']['id']}});});}})[_0xdd2c('0x28')](respondWithResult(_0x5a651b,null))[_0xdd2c('0x4b')](handleError(_0x5a651b,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 38e4e57..ab0f127 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 _0x6acf=['analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise','path','./analyticFieldReport.attributes','define'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6acf,0x17d));var _0xf6ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6acf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf6ac('0x0'));var util=require(_0xf6ac('0x1'));var logger=require(_0xf6ac('0x2'))(_0xf6ac('0x3'));var moment=require(_0xf6ac('0x4'));var BPromise=require('bluebird');var rp=require(_0xf6ac('0x5'));var fs=require('fs');var path=require(_0xf6ac('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf6ac('0x7'));module['exports']=function(_0x3536d8,_0x30dace){return _0x3536d8[_0xf6ac('0x8')]('AnalyticFieldReport',attributes,{'tableName':_0xf6ac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x95a4=['bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','lodash','../../config/logger','api','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x95a4,0x17d));var _0x495a=function(_0xbd97f4,_0x8b5779){_0xbd97f4=_0xbd97f4-0x0;var _0x11ee12=_0x95a4[_0xbd97f4];return _0x11ee12;};'use strict';var _=require(_0x495a('0x0'));var util=require('util');var logger=require(_0x495a('0x1'))(_0x495a('0x2'));var moment=require(_0x495a('0x3'));var BPromise=require(_0x495a('0x4'));var rp=require(_0x495a('0x5'));var fs=require('fs');var path=require(_0x495a('0x6'));var rimraf=require('rimraf');var config=require(_0x495a('0x7'));var attributes=require(_0x495a('0x8'));module['exports']=function(_0x272c8f,_0x3a3ae4){return _0x272c8f[_0x495a('0x9')](_0x495a('0xa'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 3f95826..917c6a1 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 _0x1a7f=['../../config/environment','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','result','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x52ddc8,_0xada5d6){var _0x41e9c3=function(_0x432441){while(--_0x432441){_0x52ddc8['push'](_0x52ddc8['shift']());}};_0x41e9c3(++_0xada5d6);}(_0x1a7f,0xcc));var _0xf1a7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1a7f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xf1a7('0x0'));var moment=require(_0xf1a7('0x1'));var BPromise=require(_0xf1a7('0x2'));var rs=require(_0xf1a7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf1a7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf1a7('0x5'))('rpc');var config=require(_0xf1a7('0x6'));var jayson=require(_0xf1a7('0x7'));var client=jayson['client'][_0xf1a7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x44a238,_0x4b2867,_0x2910e4){return new BPromise(function(_0x3ce10a,_0x2fb837){return client[_0xf1a7('0x9')](_0x44a238,_0x2910e4)[_0xf1a7('0xa')](function(_0x595e96){logger[_0xf1a7('0xb')](_0xf1a7('0xc'),_0x4b2867,'request\x20sent');logger[_0xf1a7('0xd')](_0xf1a7('0xe'),_0x4b2867,_0xf1a7('0xf'),JSON[_0xf1a7('0x10')](_0x595e96));if(_0x595e96[_0xf1a7('0x11')]){if(_0x595e96[_0xf1a7('0x11')]['code']===0x1f4){logger['error'](_0xf1a7('0xc'),_0x4b2867,_0x595e96[_0xf1a7('0x11')]['message']);return _0x2fb837(_0x595e96[_0xf1a7('0x11')]['message']);}logger[_0xf1a7('0x11')](_0xf1a7('0xc'),_0x4b2867,_0x595e96[_0xf1a7('0x11')]['message']);return _0x3ce10a(_0x595e96[_0xf1a7('0x11')]['message']);}else{logger[_0xf1a7('0xb')](_0xf1a7('0xc'),_0x4b2867,'request\x20sent');_0x3ce10a(_0x595e96[_0xf1a7('0x12')][_0xf1a7('0x13')]);}})[_0xf1a7('0x14')](function(_0x4ac35a){logger[_0xf1a7('0x11')](_0xf1a7('0xc'),_0x4b2867,_0x4ac35a);_0x2fb837(_0x4ac35a);});});} \ No newline at end of file +var _0xdb8f=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0xdb8f,0x1b3));var _0xfdb8=function(_0x243d52,_0x2d5634){_0x243d52=_0x243d52-0x0;var _0xbbf923=_0xdb8f[_0x243d52];return _0xbbf923;};'use strict';var _=require(_0xfdb8('0x0'));var util=require(_0xfdb8('0x1'));var moment=require(_0xfdb8('0x2'));var BPromise=require('bluebird');var rs=require(_0xfdb8('0x3'));var fs=require('fs');var Redis=require(_0xfdb8('0x4'));var db=require(_0xfdb8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfdb8('0x6'))(_0xfdb8('0x7'));var config=require(_0xfdb8('0x8'));var jayson=require(_0xfdb8('0x9'));var client=jayson['client'][_0xfdb8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34dc69,_0x4ebaef,_0x4aaa53){return new BPromise(function(_0x497403,_0x3d4898){return client[_0xfdb8('0xb')](_0x34dc69,_0x4aaa53)[_0xfdb8('0xc')](function(_0x3a2f83){logger[_0xfdb8('0xd')](_0xfdb8('0xe'),_0x4ebaef,_0xfdb8('0xf'));logger[_0xfdb8('0x10')](_0xfdb8('0x11'),_0x4ebaef,_0xfdb8('0xf'),JSON['stringify'](_0x3a2f83));if(_0x3a2f83[_0xfdb8('0x12')]){if(_0x3a2f83[_0xfdb8('0x12')][_0xfdb8('0x13')]===0x1f4){logger[_0xfdb8('0x12')](_0xfdb8('0xe'),_0x4ebaef,_0x3a2f83['error'][_0xfdb8('0x14')]);return _0x3d4898(_0x3a2f83['error'][_0xfdb8('0x14')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x4ebaef,_0x3a2f83[_0xfdb8('0x12')][_0xfdb8('0x14')]);return _0x497403(_0x3a2f83[_0xfdb8('0x12')][_0xfdb8('0x14')]);}else{logger[_0xfdb8('0xd')](_0xfdb8('0xe'),_0x4ebaef,_0xfdb8('0xf'));_0x497403(_0x3a2f83[_0xfdb8('0x15')][_0xfdb8('0x14')]);}})[_0xfdb8('0x16')](function(_0x2c9614){logger[_0xfdb8('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4ebaef,_0x2c9614);_0x3d4898(_0x2c9614);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index a20f527..29ba26c 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(_0x596f79,_0x515167){var _0x46bccc=function(_0x393c75){while(--_0x393c75){_0x596f79['push'](_0x596f79['shift']());}};_0x46bccc(++_0x515167);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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(_0x4512c2,_0x4aed17){var _0x22b433=function(_0x5c3099){while(--_0x5c3099){_0x4512c2['push'](_0x4512c2['shift']());}};_0x22b433(++_0x4aed17);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 99387e7..82e7409 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 _0xe3db=['sequelize','exports','name','STRING','TEXT'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xe3db,0xc8));var _0xbe3d=function(_0x30f289,_0x351110){_0x30f289=_0x30f289-0x0;var _0x319435=_0xe3db[_0x30f289];return _0x319435;};'use strict';var Sequelize=require(_0xbe3d('0x0'));module[_0xbe3d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbe3d('0x2')},'table':{'type':Sequelize[_0xbe3d('0x3')]},'metric':{'type':Sequelize[_0xbe3d('0x4')]},'description':{'type':Sequelize[_0xbe3d('0x3')]}}; \ No newline at end of file +var _0x195e=['TEXT','sequelize','exports','STRING','name'];(function(_0x44085a,_0x4381c5){var _0xec581a=function(_0x33120b){while(--_0x33120b){_0x44085a['push'](_0x44085a['shift']());}};_0xec581a(++_0x4381c5);}(_0x195e,0xfb));var _0xe195=function(_0x5a77eb,_0x1ed02d){_0x5a77eb=_0x5a77eb-0x0;var _0x1b3299=_0x195e[_0x5a77eb];return _0x1b3299;};'use strict';var Sequelize=require(_0xe195('0x0'));module[_0xe195('0x1')]={'name':{'type':Sequelize[_0xe195('0x2')],'allowNull':![],'unique':_0xe195('0x3')},'table':{'type':Sequelize[_0xe195('0x2')]},'metric':{'type':Sequelize[_0xe195('0x4')]},'description':{'type':Sequelize[_0xe195('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 3ece0c5..b88d09c 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 _0x6aa7=['json','apply','reject','save','update','then','destroy','get','Metrics','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','catch','error','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range'];(function(_0x5d1aea,_0x2a2fb8){var _0x1a91b6=function(_0x5609ec){while(--_0x5609ec){_0x5d1aea['push'](_0x5d1aea['shift']());}};_0x1a91b6(++_0x2a2fb8);}(_0x6aa7,0x178));var _0x76aa=function(_0x1b5ce2,_0x167e9d){_0x1b5ce2=_0x1b5ce2-0x0;var _0x2d08a3=_0x6aa7[_0x1b5ce2];return _0x2d08a3;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xcc;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0x19')](_0x5df49c);}return _0x112c39[_0x76aa('0x1a')](_0x5df49c)[_0x76aa('0x1b')]();};}function respondWithResult(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xc8;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1a')](_0x4e309f)['json'](_0x5f5b59);}};}function respondWithFilteredResult(_0x180d92,_0x319bf1){return function(_0x5cf594){if(_0x5cf594){var _0x2111c7=typeof _0x319bf1['offset']===_0x76aa('0x1c')&&typeof _0x319bf1['limit']===_0x76aa('0x1c');var _0x413cf6=_0x5cf594[_0x76aa('0x1d')];var _0x21c16d=_0x2111c7?0x0:_0x319bf1[_0x76aa('0x1e')];var _0x3ead3f=_0x2111c7?_0x5cf594['count']:_0x319bf1['offset']+_0x319bf1[_0x76aa('0x1f')];var _0x454dd3;if(_0x3ead3f>=_0x413cf6){_0x3ead3f=_0x413cf6;_0x454dd3=0xc8;}else{_0x454dd3=0xce;}_0x180d92[_0x76aa('0x1a')](_0x454dd3);return _0x180d92[_0x76aa('0x20')](_0x76aa('0x21'),_0x21c16d+'-'+_0x3ead3f+'/'+_0x413cf6)[_0x76aa('0x22')](_0x5cf594);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){var _0x2cba6d=_0x3cd039[_0x76aa('0x29')]({'plain':!![]});var _0x26b75e=_0x76aa('0x2a');return db['UserProfileResource'][_0x76aa('0x28')]({'where':{'type':_0x26b75e,'resourceId':_0x2cba6d['id']}})[_0x76aa('0x27')](function(){return _0x3cd039;});})[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x2f9316,_0x25a803){return function(_0x282d0a){if(!_0x282d0a){_0x2f9316[_0x76aa('0x19')](0x194);}return _0x282d0a;};}function handleError(_0x1bdc3d,_0x545b06){_0x545b06=_0x545b06||0x1f4;return function(_0x3fcb7f){logger['error'](_0x3fcb7f[_0x76aa('0x2b')]);if(_0x3fcb7f[_0x76aa('0x2c')]){delete _0x3fcb7f[_0x76aa('0x2c')];}_0x1bdc3d[_0x76aa('0x1a')](_0x545b06)[_0x76aa('0x2d')](_0x3fcb7f);};}exports[_0x76aa('0x2e')]=function(_0x2ee0f9,_0x3827ec){var _0x19fd4f={},_0x3ea05a={},_0x5edcd8={'count':0x0,'rows':[]};var _0x430ad6=_[_0x76aa('0x2f')](db[_0x76aa('0x30')][_0x76aa('0x31')],function(_0x458ac3){return{'name':_0x458ac3[_0x76aa('0x32')],'type':_0x458ac3[_0x76aa('0x33')]['key']};});_0x3ea05a[_0x76aa('0x34')]=_[_0x76aa('0x2f')](_0x430ad6,'name');_0x3ea05a[_0x76aa('0x35')]=_['keys'](_0x2ee0f9[_0x76aa('0x35')]);_0x3ea05a['filters']=_[_0x76aa('0x36')](_0x3ea05a['model'],_0x3ea05a['query']);_0x19fd4f[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x3ea05a[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x2ee0f9['query']['fields']));_0x19fd4f[_0x76aa('0x37')]=_0x19fd4f[_0x76aa('0x37')][_0x76aa('0x39')]?_0x19fd4f[_0x76aa('0x37')]:_0x3ea05a[_0x76aa('0x34')];if(!_0x2ee0f9['query'][_0x76aa('0x3a')]('nolimit')){_0x19fd4f['limit']=qs[_0x76aa('0x1f')](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1f')]);_0x19fd4f[_0x76aa('0x1e')]=qs['offset'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1e')]);}_0x19fd4f[_0x76aa('0x3b')]=qs['sort'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x3c')]);_0x19fd4f[_0x76aa('0x3d')]=qs[_0x76aa('0x3e')](_[_0x76aa('0x3f')](_0x2ee0f9[_0x76aa('0x35')],_0x3ea05a[_0x76aa('0x3e')]),_0x430ad6);if(_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]){_0x19fd4f['where']=_[_0x76aa('0x41')](_0x19fd4f[_0x76aa('0x3d')],{'$or':_[_0x76aa('0x2f')](_0x430ad6,function(_0xa824e8){if(_0xa824e8[_0x76aa('0x33')]!==_0x76aa('0x42')){var _0x572fdb={};_0x572fdb[_0xa824e8['name']]={'$like':'%'+_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]+'%'};return _0x572fdb;}})});}_0x19fd4f=_[_0x76aa('0x41')]({},_0x19fd4f,_0x2ee0f9[_0x76aa('0x43')]);var _0x50599f={'where':_0x19fd4f[_0x76aa('0x3d')]};return db[_0x76aa('0x30')][_0x76aa('0x1d')](_0x50599f)[_0x76aa('0x27')](function(_0x1138b5){_0x5edcd8['count']=_0x1138b5;if(_0x2ee0f9[_0x76aa('0x35')]['includeAll']){_0x19fd4f[_0x76aa('0x44')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x19fd4f);})['then'](function(_0x144f0a){_0x5edcd8['rows']=_0x144f0a;return _0x5edcd8;})['then'](respondWithFilteredResult(_0x3827ec,_0x19fd4f))['catch'](handleError(_0x3827ec,null));};exports[_0x76aa('0x45')]=function(_0x3fd153,_0x116dc5){var _0x2c0744={'raw':!![],'where':{'id':_0x3fd153['params']['id']}},_0x27a52e={};_0x27a52e[_0x76aa('0x34')]=_[_0x76aa('0x46')](db[_0x76aa('0x30')][_0x76aa('0x31')]);_0x27a52e[_0x76aa('0x35')]=_['keys'](_0x3fd153[_0x76aa('0x35')]);_0x27a52e[_0x76aa('0x3e')]=_['intersection'](_0x27a52e[_0x76aa('0x34')],_0x27a52e['query']);_0x2c0744[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x27a52e[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x3fd153[_0x76aa('0x35')][_0x76aa('0x38')]));_0x2c0744[_0x76aa('0x37')]=_0x2c0744[_0x76aa('0x37')][_0x76aa('0x39')]?_0x2c0744[_0x76aa('0x37')]:_0x27a52e['model'];if(_0x3fd153[_0x76aa('0x35')]['includeAll']){_0x2c0744[_0x76aa('0x44')]=[{'all':!![]}];}_0x2c0744=_[_0x76aa('0x41')]({},_0x2c0744,_0x3fd153[_0x76aa('0x43')]);return db[_0x76aa('0x30')]['find'](_0x2c0744)['then'](handleEntityNotFound(_0x116dc5,null))[_0x76aa('0x27')](respondWithResult(_0x116dc5,null))['catch'](handleError(_0x116dc5,null));};exports[_0x76aa('0x47')]=function(_0x302a0c,_0x4315b3){return db[_0x76aa('0x30')][_0x76aa('0x47')](_0x302a0c[_0x76aa('0x48')],{})['then'](function(_0x564546){var _0x2fcf8f=_0x302a0c[_0x76aa('0x49')][_0x76aa('0x29')]({'plain':!![]});if(!_0x2fcf8f)throw new Error(_0x76aa('0x4a'));if(_0x2fcf8f[_0x76aa('0x4b')]===_0x76aa('0x49')){var _0x4c52d5=_0x564546[_0x76aa('0x29')]({'plain':!![]});var _0x2d631e=_0x76aa('0x2a');return db['UserProfileSection'][_0x76aa('0x4c')]({'where':{'name':_0x2d631e,'userProfileId':_0x2fcf8f['userProfileId']},'raw':!![]})[_0x76aa('0x27')](function(_0x5e1d84){if(_0x5e1d84&&_0x5e1d84[_0x76aa('0x4d')]===0x0){return db[_0x76aa('0x4e')][_0x76aa('0x47')]({'name':_0x4c52d5[_0x76aa('0x2c')],'resourceId':_0x4c52d5['id'],'type':_0x5e1d84[_0x76aa('0x2c')],'sectionId':_0x5e1d84['id']},{})[_0x76aa('0x27')](function(){return _0x564546;});}else{return _0x564546;}})[_0x76aa('0x4f')](function(_0x4f2c2b){logger[_0x76aa('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f2c2b);throw _0x4f2c2b;});}return _0x564546;})[_0x76aa('0x27')](respondWithResult(_0x4315b3,0xc9))[_0x76aa('0x4f')](handleError(_0x4315b3,null));};exports[_0x76aa('0x26')]=function(_0x53be10,_0x3fa7ec){if(_0x53be10[_0x76aa('0x48')]['id']){delete _0x53be10[_0x76aa('0x48')]['id'];}return db['AnalyticMetric'][_0x76aa('0x4c')]({'where':{'id':_0x53be10[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x3fa7ec,null))[_0x76aa('0x27')](saveUpdates(_0x53be10['body'],null))[_0x76aa('0x27')](respondWithResult(_0x3fa7ec,null))[_0x76aa('0x4f')](handleError(_0x3fa7ec,null));};exports[_0x76aa('0x28')]=function(_0x410933,_0x2027f8){return db[_0x76aa('0x30')]['find']({'where':{'id':_0x410933[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x2027f8,null))[_0x76aa('0x27')](removeEntity(_0x2027f8,null))[_0x76aa('0x4f')](handleError(_0x2027f8,null));}; \ No newline at end of file +var _0x5fc3=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','merge','create','body'];(function(_0x291f89,_0x337249){var _0x6a2fb9=function(_0x59234e){while(--_0x59234e){_0x291f89['push'](_0x291f89['shift']());}};_0x6a2fb9(++_0x337249);}(_0x5fc3,0xa8));var _0x35fc=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x5fc3[_0x565c49];return _0x20ca34;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){var _0x561bf8=_0x55e9e7[_0x35fc('0x26')]({'plain':!![]});var _0x5a93df=_0x35fc('0x27');return db['UserProfileResource'][_0x35fc('0x25')]({'where':{'type':_0x5a93df,'resourceId':_0x561bf8['id']}})['then'](function(){return _0x55e9e7;});})[_0x35fc('0x24')](function(){_0x2d8183[_0x35fc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519264,_0x47774c){return function(_0x58edb6){if(!_0x58edb6){_0x519264[_0x35fc('0x17')](0x194);}return _0x58edb6;};}function handleError(_0x1a5d92,_0x57001c){_0x57001c=_0x57001c||0x1f4;return function(_0x26b7cb){logger[_0x35fc('0x28')](_0x26b7cb[_0x35fc('0x29')]);if(_0x26b7cb[_0x35fc('0x2a')]){delete _0x26b7cb[_0x35fc('0x2a')];}_0x1a5d92[_0x35fc('0x18')](_0x57001c)[_0x35fc('0x2b')](_0x26b7cb);};}exports[_0x35fc('0x2c')]=function(_0x54aedc,_0x1cd1ae){var _0x220931={},_0x22af18={},_0x52acc5={'count':0x0,'rows':[]};var _0xe79f52=_[_0x35fc('0x2d')](db[_0x35fc('0x2e')][_0x35fc('0x2f')],function(_0xd8a4ca){return{'name':_0xd8a4ca[_0x35fc('0x30')],'type':_0xd8a4ca[_0x35fc('0x31')][_0x35fc('0x32')]};});_0x22af18[_0x35fc('0x33')]=_[_0x35fc('0x2d')](_0xe79f52,'name');_0x22af18['query']=_[_0x35fc('0x34')](_0x54aedc['query']);_0x22af18[_0x35fc('0x35')]=_[_0x35fc('0x36')](_0x22af18[_0x35fc('0x33')],_0x22af18[_0x35fc('0x37')]);_0x220931[_0x35fc('0x38')]=_[_0x35fc('0x36')](_0x22af18['model'],qs[_0x35fc('0x39')](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x39')]));_0x220931[_0x35fc('0x38')]=_0x220931[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x220931['attributes']:_0x22af18[_0x35fc('0x33')];if(!_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3b')]('nolimit')){_0x220931[_0x35fc('0x1c')]=qs['limit'](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x1c')]);_0x220931[_0x35fc('0x1a')]=qs[_0x35fc('0x1a')](_0x54aedc['query']['offset']);}_0x220931['order']=qs[_0x35fc('0x3c')](_0x54aedc['query'][_0x35fc('0x3c')]);_0x220931['where']=qs[_0x35fc('0x35')](_[_0x35fc('0x3d')](_0x54aedc[_0x35fc('0x37')],_0x22af18[_0x35fc('0x35')]),_0xe79f52);if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]){_0x220931[_0x35fc('0x3f')]=_['merge'](_0x220931[_0x35fc('0x3f')],{'$or':_[_0x35fc('0x2d')](_0xe79f52,function(_0x4e0ce3){if(_0x4e0ce3[_0x35fc('0x31')]!==_0x35fc('0x40')){var _0x1aac67={};_0x1aac67[_0x4e0ce3[_0x35fc('0x2a')]]={'$like':'%'+_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]+'%'};return _0x1aac67;}})});}_0x220931=_['merge']({},_0x220931,_0x54aedc[_0x35fc('0x41')]);var _0x267858={'where':_0x220931[_0x35fc('0x3f')]};return db['AnalyticMetric'][_0x35fc('0x1d')](_0x267858)[_0x35fc('0x24')](function(_0x596919){_0x52acc5[_0x35fc('0x1d')]=_0x596919;if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x42')]){_0x220931[_0x35fc('0x43')]=[{'all':!![]}];}return db[_0x35fc('0x2e')][_0x35fc('0x44')](_0x220931);})[_0x35fc('0x24')](function(_0x3ec51f){_0x52acc5['rows']=_0x3ec51f;return _0x52acc5;})['then'](respondWithFilteredResult(_0x1cd1ae,_0x220931))[_0x35fc('0x45')](handleError(_0x1cd1ae,null));};exports[_0x35fc('0x46')]=function(_0x4fdc6d,_0x5c2e5c){var _0x4ff202={'raw':!![],'where':{'id':_0x4fdc6d[_0x35fc('0x47')]['id']}},_0x79677d={};_0x79677d['model']=_[_0x35fc('0x34')](db[_0x35fc('0x2e')][_0x35fc('0x2f')]);_0x79677d[_0x35fc('0x37')]=_['keys'](_0x4fdc6d['query']);_0x79677d['filters']=_['intersection'](_0x79677d['model'],_0x79677d[_0x35fc('0x37')]);_0x4ff202[_0x35fc('0x38')]=_['intersection'](_0x79677d[_0x35fc('0x33')],qs['fields'](_0x4fdc6d[_0x35fc('0x37')][_0x35fc('0x39')]));_0x4ff202[_0x35fc('0x38')]=_0x4ff202[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x4ff202['attributes']:_0x79677d[_0x35fc('0x33')];if(_0x4fdc6d[_0x35fc('0x37')]['includeAll']){_0x4ff202[_0x35fc('0x43')]=[{'all':!![]}];}_0x4ff202=_[_0x35fc('0x48')]({},_0x4ff202,_0x4fdc6d[_0x35fc('0x41')]);return db[_0x35fc('0x2e')]['find'](_0x4ff202)[_0x35fc('0x24')](handleEntityNotFound(_0x5c2e5c,null))['then'](respondWithResult(_0x5c2e5c,null))['catch'](handleError(_0x5c2e5c,null));};exports[_0x35fc('0x49')]=function(_0x9db7e8,_0x18dc78){return db[_0x35fc('0x2e')][_0x35fc('0x49')](_0x9db7e8[_0x35fc('0x4a')],{})[_0x35fc('0x24')](function(_0x16afa6){var _0x4f555f=_0x9db7e8[_0x35fc('0x4b')][_0x35fc('0x26')]({'plain':!![]});if(!_0x4f555f)throw new Error(_0x35fc('0x4c'));if(_0x4f555f[_0x35fc('0x4d')]===_0x35fc('0x4b')){var _0x1e3221=_0x16afa6[_0x35fc('0x26')]({'plain':!![]});var _0x347a4a=_0x35fc('0x27');return db[_0x35fc('0x4e')][_0x35fc('0x4f')]({'where':{'name':_0x347a4a,'userProfileId':_0x4f555f[_0x35fc('0x50')]},'raw':!![]})[_0x35fc('0x24')](function(_0x3146e2){if(_0x3146e2&&_0x3146e2['autoAssociation']===0x0){return db['UserProfileResource'][_0x35fc('0x49')]({'name':_0x1e3221[_0x35fc('0x2a')],'resourceId':_0x1e3221['id'],'type':_0x3146e2[_0x35fc('0x2a')],'sectionId':_0x3146e2['id']},{})[_0x35fc('0x24')](function(){return _0x16afa6;});}else{return _0x16afa6;}})[_0x35fc('0x45')](function(_0x3e6494){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e6494);throw _0x3e6494;});}return _0x16afa6;})[_0x35fc('0x24')](respondWithResult(_0x18dc78,0xc9))[_0x35fc('0x45')](handleError(_0x18dc78,null));};exports[_0x35fc('0x23')]=function(_0x38bc78,_0x5b2595){if(_0x38bc78[_0x35fc('0x4a')]['id']){delete _0x38bc78[_0x35fc('0x4a')]['id'];}return db['AnalyticMetric'][_0x35fc('0x4f')]({'where':{'id':_0x38bc78[_0x35fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b2595,null))[_0x35fc('0x24')](saveUpdates(_0x38bc78[_0x35fc('0x4a')],null))[_0x35fc('0x24')](respondWithResult(_0x5b2595,null))[_0x35fc('0x45')](handleError(_0x5b2595,null));};exports['destroy']=function(_0x4de34b,_0x502a15){return db[_0x35fc('0x2e')][_0x35fc('0x4f')]({'where':{'id':_0x4de34b['params']['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0x502a15,null))[_0x35fc('0x24')](removeEntity(_0x502a15,null))[_0x35fc('0x45')](handleError(_0x502a15,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 0a20f2d..8fedbf0 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 _0x36bb=['../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0xc8a62b,_0x4e1b0b){var _0x454c14=function(_0x790b69){while(--_0x790b69){_0xc8a62b['push'](_0xc8a62b['shift']());}};_0x454c14(++_0x4e1b0b);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb36b('0x0'));var util=require(_0xb36b('0x1'));var logger=require(_0xb36b('0x2'))('api');var moment=require(_0xb36b('0x3'));var BPromise=require(_0xb36b('0x4'));var rp=require(_0xb36b('0x5'));var fs=require('fs');var path=require(_0xb36b('0x6'));var rimraf=require(_0xb36b('0x7'));var config=require(_0xb36b('0x8'));var attributes=require(_0xb36b('0x9'));module[_0xb36b('0xa')]=function(_0x439ccc,_0x418837){return _0x439ccc[_0xb36b('0xb')](_0xb36b('0xc'),attributes,{'tableName':_0xb36b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8af=['analytics_metrics','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric'];(function(_0x25a048,_0x17f8cc){var _0x5b6d18=function(_0x5c4d6e){while(--_0x5c4d6e){_0x25a048['push'](_0x25a048['shift']());}};_0x5b6d18(++_0x17f8cc);}(_0xd8af,0x18d));var _0xfd8a=function(_0x5a2ad2,_0x5b44ab){_0x5a2ad2=_0x5a2ad2-0x0;var _0x4c0f1a=_0xd8af[_0x5a2ad2];return _0x4c0f1a;};'use strict';var _=require(_0xfd8a('0x0'));var util=require(_0xfd8a('0x1'));var logger=require(_0xfd8a('0x2'))(_0xfd8a('0x3'));var moment=require(_0xfd8a('0x4'));var BPromise=require('bluebird');var rp=require(_0xfd8a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfd8a('0x6'));var config=require(_0xfd8a('0x7'));var attributes=require(_0xfd8a('0x8'));module['exports']=function(_0x44c7ed,_0x4c7603){return _0x44c7ed[_0xfd8a('0x9')](_0xfd8a('0xa'),attributes,{'tableName':_0xfd8a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 5aaec96..9e4dab1 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 _0x8b7e=['AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','code','error','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','request\x20sent','debug'];(function(_0x418549,_0x11b13d){var _0x288826=function(_0x3c0411){while(--_0x3c0411){_0x418549['push'](_0x418549['shift']());}};_0x288826(++_0x11b13d);}(_0x8b7e,0xee));var _0xe8b7=function(_0x4e9b03,_0x523457){_0x4e9b03=_0x4e9b03-0x0;var _0x2ca16a=_0x8b7e[_0x4e9b03];return _0x2ca16a;};'use strict';var _=require(_0xe8b7('0x0'));var util=require(_0xe8b7('0x1'));var moment=require('moment');var BPromise=require(_0xe8b7('0x2'));var rs=require(_0xe8b7('0x3'));var fs=require('fs');var Redis=require(_0xe8b7('0x4'));var db=require(_0xe8b7('0x5'))['db'];var utils=require(_0xe8b7('0x6'));var logger=require('../../config/logger')(_0xe8b7('0x7'));var config=require('../../config/environment');var jayson=require(_0xe8b7('0x8'));var client=jayson['client'][_0xe8b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xed1f35,_0x30fd0d,_0x3b2731){return new BPromise(function(_0x3e0817,_0x1cbf6f){return client[_0xe8b7('0xa')](_0xed1f35,_0x3b2731)[_0xe8b7('0xb')](function(_0x14ac61){logger[_0xe8b7('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x30fd0d,_0xe8b7('0xd'));logger[_0xe8b7('0xe')](_0xe8b7('0xf'),_0x30fd0d,_0xe8b7('0xd'),JSON[_0xe8b7('0x10')](_0x14ac61));if(_0x14ac61['error']){if(_0x14ac61['error'][_0xe8b7('0x11')]===0x1f4){logger[_0xe8b7('0x12')](_0xe8b7('0x13'),_0x30fd0d,_0x14ac61[_0xe8b7('0x12')][_0xe8b7('0x14')]);return _0x1cbf6f(_0x14ac61[_0xe8b7('0x12')][_0xe8b7('0x14')]);}logger[_0xe8b7('0x12')](_0xe8b7('0x13'),_0x30fd0d,_0x14ac61[_0xe8b7('0x12')][_0xe8b7('0x14')]);return _0x3e0817(_0x14ac61[_0xe8b7('0x12')][_0xe8b7('0x14')]);}else{logger['info'](_0xe8b7('0x13'),_0x30fd0d,'request\x20sent');_0x3e0817(_0x14ac61[_0xe8b7('0x15')]['message']);}})[_0xe8b7('0x16')](function(_0x50748c){logger['error'](_0xe8b7('0x13'),_0x30fd0d,_0x50748c);_0x1cbf6f(_0x50748c);});});} \ No newline at end of file +var _0x411b=['../../config/logger','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x142e13,_0x211cde){var _0x51f6e1=function(_0xc4925c){while(--_0xc4925c){_0x142e13['push'](_0x142e13['shift']());}};_0x51f6e1(++_0x211cde);}(_0x411b,0x19d));var _0xb411=function(_0x296796,_0x52dcb8){_0x296796=_0x296796-0x0;var _0x4bf398=_0x411b[_0x296796];return _0x4bf398;};'use strict';var _=require(_0xb411('0x0'));var util=require(_0xb411('0x1'));var moment=require(_0xb411('0x2'));var BPromise=require('bluebird');var rs=require(_0xb411('0x3'));var fs=require('fs');var Redis=require(_0xb411('0x4'));var db=require(_0xb411('0x5'))['db'];var utils=require(_0xb411('0x6'));var logger=require(_0xb411('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb411('0x8'));var client=jayson[_0xb411('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bd33d,_0x20062e,_0x4790f2){return new BPromise(function(_0x55c435,_0x3f0614){return client[_0xb411('0xa')](_0x4bd33d,_0x4790f2)[_0xb411('0xb')](function(_0x4edd54){logger[_0xb411('0xc')](_0xb411('0xd'),_0x20062e,_0xb411('0xe'));logger['debug'](_0xb411('0xf'),_0x20062e,_0xb411('0xe'),JSON['stringify'](_0x4edd54));if(_0x4edd54[_0xb411('0x10')]){if(_0x4edd54[_0xb411('0x10')][_0xb411('0x11')]===0x1f4){logger[_0xb411('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x20062e,_0x4edd54[_0xb411('0x10')][_0xb411('0x12')]);return _0x3f0614(_0x4edd54['error']['message']);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x20062e,_0x4edd54[_0xb411('0x10')][_0xb411('0x12')]);return _0x55c435(_0x4edd54['error'][_0xb411('0x12')]);}else{logger['info'](_0xb411('0xd'),_0x20062e,_0xb411('0xe'));_0x55c435(_0x4edd54[_0xb411('0x13')]['message']);}})['catch'](function(_0x361283){logger['error'](_0xb411('0xd'),_0x20062e,_0x361283);_0x3f0614(_0x361283);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 9ffadf9..1c3579c 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 _0x8085=['create','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x8085,0x71));var _0x5808=function(_0x58547b,_0x4b89c2){_0x58547b=_0x58547b-0x0;var _0x1d3fd2=_0x8085[_0x58547b];return _0x1d3fd2;};'use strict';var multer=require(_0x5808('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5808('0x1'));var express=require(_0x5808('0x2'));var router=express[_0x5808('0x3')]();var fs_extra=require(_0x5808('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5808('0x5'));var controller=require(_0x5808('0x6'));router['get']('/',auth[_0x5808('0x7')](),controller[_0x5808('0x8')]);router[_0x5808('0x9')](_0x5808('0xa'),auth[_0x5808('0x7')](),controller[_0x5808('0xb')]);router[_0x5808('0xc')]('/',auth[_0x5808('0x7')](),controller[_0x5808('0xd')]);router[_0x5808('0xe')](_0x5808('0xa'),auth[_0x5808('0x7')](),controller[_0x5808('0xf')]);router[_0x5808('0x10')](_0x5808('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x5808('0x11')]=router; \ No newline at end of file +var _0x94ba=['isAuthenticated','index','get','/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x463dbe,_0x34e39f){var _0x1795d2=function(_0xa46cb5){while(--_0xa46cb5){_0x463dbe['push'](_0x463dbe['shift']());}};_0x1795d2(++_0x34e39f);}(_0x94ba,0xbe));var _0xa94b=function(_0x47b15f,_0x103e93){_0x47b15f=_0x47b15f-0x0;var _0x55bf25=_0x94ba[_0x47b15f];return _0x55bf25;};'use strict';var multer=require(_0xa94b('0x0'));var util=require(_0xa94b('0x1'));var path=require(_0xa94b('0x2'));var timeout=require(_0xa94b('0x3'));var express=require(_0xa94b('0x4'));var router=express['Router']();var fs_extra=require(_0xa94b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa94b('0x6'));var config=require(_0xa94b('0x7'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0xa94b('0x8')](),controller[_0xa94b('0x9')]);router[_0xa94b('0xa')](_0xa94b('0xb'),auth['isAuthenticated'](),controller[_0xa94b('0xc')]);router[_0xa94b('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa94b('0xe')](_0xa94b('0xb'),auth[_0xa94b('0x8')](),controller['update']);router[_0xa94b('0xf')](_0xa94b('0xb'),auth[_0xa94b('0x8')](),controller[_0xa94b('0x10')]);module[_0xa94b('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 1744142..ecbc61f 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 _0x0d60=['exports'];(function(_0x38159c,_0x13039f){var _0x1577fe=function(_0x1dffb2){while(--_0x1dffb2){_0x38159c['push'](_0x38159c['shift']());}};_0x1577fe(++_0x13039f);}(_0x0d60,0x1f0));var _0x00d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0d60[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x00d6('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x6ff6=['exports','sequelize'];(function(_0x55abba,_0x33640d){var _0x18ffc0=function(_0x1640d0){while(--_0x1640d0){_0x55abba['push'](_0x55abba['shift']());}};_0x18ffc0(++_0x33640d);}(_0x6ff6,0x115));var _0x66ff=function(_0x595c57,_0x415b75){_0x595c57=_0x595c57-0x0;var _0x227198=_0x6ff6[_0x595c57];return _0x227198;};'use strict';var Sequelize=require(_0x66ff('0x0'));module[_0x66ff('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index ea6af8d..e8697d1 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 _0x3ad4=['where','pick','filters','filter','merge','VIRTUAL','AnalyticTreeReport','includeAll','include','rows','show','params','keys','rawAttributes','length','options','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','status','send','index','map','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x2c6df1,_0x5bc0b0){var _0x37daba=function(_0x311f77){while(--_0x311f77){_0x2c6df1['push'](_0x2c6df1['shift']());}};_0x37daba(++_0x5bc0b0);}(_0x3ad4,0x10a));var _0x43ad=function(_0x47e7dd,_0x51b041){_0x47e7dd=_0x47e7dd-0x0;var _0x38501f=_0x3ad4[_0x47e7dd];return _0x38501f;};'use strict';var emlformat=require(_0x43ad('0x0'));var rimraf=require(_0x43ad('0x1'));var zipdir=require(_0x43ad('0x2'));var jsonpatch=require(_0x43ad('0x3'));var rp=require(_0x43ad('0x4'));var moment=require(_0x43ad('0x5'));var BPromise=require(_0x43ad('0x6'));var Mustache=require(_0x43ad('0x7'));var util=require(_0x43ad('0x8'));var path=require(_0x43ad('0x9'));var sox=require(_0x43ad('0xa'));var csv=require('to-csv');var ejs=require(_0x43ad('0xb'));var fs=require('fs');var fs_extra=require(_0x43ad('0xc'));var _=require('lodash');var squel=require(_0x43ad('0xd'));var crypto=require('crypto');var jsforce=require(_0x43ad('0xe'));var deskjs=require(_0x43ad('0xf'));var toCsv=require(_0x43ad('0x10'));var querystring=require(_0x43ad('0x11'));var Papa=require(_0x43ad('0x12'));var Redis=require(_0x43ad('0x13'));var authService=require(_0x43ad('0x14'));var qs=require(_0x43ad('0x15'));var as=require(_0x43ad('0x16'));var hardwareService=require(_0x43ad('0x17'));var logger=require(_0x43ad('0x18'))(_0x43ad('0x19'));var utils=require(_0x43ad('0x1a'));var config=require(_0x43ad('0x1b'));var licenseUtil=require(_0x43ad('0x1c'));var db=require(_0x43ad('0x1d'))['db'];function respondWithStatusCode(_0x5a2170,_0x5dc983){_0x5dc983=_0x5dc983||0xcc;return function(_0x570105){if(_0x570105){return _0x5a2170[_0x43ad('0x1e')](_0x5dc983);}return _0x5a2170['status'](_0x5dc983)[_0x43ad('0x1f')]();};}function respondWithResult(_0x2313d0,_0xbfb7dd){_0xbfb7dd=_0xbfb7dd||0xc8;return function(_0x38ac5a){if(_0x38ac5a){return _0x2313d0['status'](_0xbfb7dd)[_0x43ad('0x20')](_0x38ac5a);}};}function respondWithFilteredResult(_0x30f8f6,_0xd60ff3){return function(_0x272dec){if(_0x272dec){var _0x3a84f0=typeof _0xd60ff3[_0x43ad('0x21')]===_0x43ad('0x22')&&typeof _0xd60ff3['limit']===_0x43ad('0x22');var _0x378110=_0x272dec[_0x43ad('0x23')];var _0x29248d=_0x3a84f0?0x0:_0xd60ff3['offset'];var _0x314a85=_0x3a84f0?_0x272dec[_0x43ad('0x23')]:_0xd60ff3[_0x43ad('0x21')]+_0xd60ff3[_0x43ad('0x24')];var _0x5cc0c4;if(_0x314a85>=_0x378110){_0x314a85=_0x378110;_0x5cc0c4=0xc8;}else{_0x5cc0c4=0xce;}_0x30f8f6['status'](_0x5cc0c4);return _0x30f8f6['set'](_0x43ad('0x25'),_0x29248d+'-'+_0x314a85+'/'+_0x378110)[_0x43ad('0x20')](_0x272dec);}return null;};}function patchUpdates(_0x23dd4a){return function(_0x2cc0ed){try{jsonpatch[_0x43ad('0x26')](_0x2cc0ed,_0x23dd4a,!![]);}catch(_0x135862){return BPromise[_0x43ad('0x27')](_0x135862);}return _0x2cc0ed[_0x43ad('0x28')]();};}function saveUpdates(_0x4f0277,_0x428429){return function(_0x28ba97){if(_0x28ba97){return _0x28ba97[_0x43ad('0x29')](_0x4f0277)[_0x43ad('0x2a')](function(_0x230de3){return _0x230de3;});}return null;};}function removeEntity(_0x2746fa,_0x1f1878){return function(_0x3b4f8f){if(_0x3b4f8f){return _0x3b4f8f['destroy']()[_0x43ad('0x2a')](function(){_0x2746fa['status'](0xcc)[_0x43ad('0x1f')]();});}};}function handleEntityNotFound(_0x5ac5dc,_0x389d66){return function(_0x4f8362){if(!_0x4f8362){_0x5ac5dc[_0x43ad('0x1e')](0x194);}return _0x4f8362;};}function handleError(_0x5e5e4c,_0x4f4245){_0x4f4245=_0x4f4245||0x1f4;return function(_0x2c8098){logger[_0x43ad('0x2b')](_0x2c8098[_0x43ad('0x2c')]);if(_0x2c8098[_0x43ad('0x2d')]){delete _0x2c8098[_0x43ad('0x2d')];}_0x5e5e4c[_0x43ad('0x2e')](_0x4f4245)[_0x43ad('0x2f')](_0x2c8098);};}exports[_0x43ad('0x30')]=function(_0x209ed9,_0x211a75){var _0x4f006e={},_0x276d0d={},_0x4859d4={'count':0x0,'rows':[]};var _0x5e7490=_[_0x43ad('0x31')](db['AnalyticTreeReport']['rawAttributes'],function(_0x3a1843){return{'name':_0x3a1843[_0x43ad('0x32')],'type':_0x3a1843[_0x43ad('0x33')][_0x43ad('0x34')]};});_0x276d0d[_0x43ad('0x35')]=_[_0x43ad('0x31')](_0x5e7490,'name');_0x276d0d[_0x43ad('0x36')]=_['keys'](_0x209ed9[_0x43ad('0x36')]);_0x276d0d['filters']=_[_0x43ad('0x37')](_0x276d0d[_0x43ad('0x35')],_0x276d0d[_0x43ad('0x36')]);_0x4f006e[_0x43ad('0x38')]=_[_0x43ad('0x37')](_0x276d0d[_0x43ad('0x35')],qs[_0x43ad('0x39')](_0x209ed9[_0x43ad('0x36')][_0x43ad('0x39')]));_0x4f006e[_0x43ad('0x38')]=_0x4f006e[_0x43ad('0x38')]['length']?_0x4f006e[_0x43ad('0x38')]:_0x276d0d['model'];if(!_0x209ed9[_0x43ad('0x36')][_0x43ad('0x3a')](_0x43ad('0x3b'))){_0x4f006e['limit']=qs[_0x43ad('0x24')](_0x209ed9[_0x43ad('0x36')][_0x43ad('0x24')]);_0x4f006e['offset']=qs[_0x43ad('0x21')](_0x209ed9['query'][_0x43ad('0x21')]);}_0x4f006e[_0x43ad('0x3c')]=qs[_0x43ad('0x3d')](_0x209ed9[_0x43ad('0x36')]['sort']);_0x4f006e[_0x43ad('0x3e')]=qs['filters'](_[_0x43ad('0x3f')](_0x209ed9[_0x43ad('0x36')],_0x276d0d[_0x43ad('0x40')]),_0x5e7490);if(_0x209ed9['query'][_0x43ad('0x41')]){_0x4f006e[_0x43ad('0x3e')]=_[_0x43ad('0x42')](_0x4f006e[_0x43ad('0x3e')],{'$or':_[_0x43ad('0x31')](_0x5e7490,function(_0x42fc1e){if(_0x42fc1e[_0x43ad('0x33')]!==_0x43ad('0x43')){var _0x21b8ba={};_0x21b8ba[_0x42fc1e['name']]={'$like':'%'+_0x209ed9[_0x43ad('0x36')][_0x43ad('0x41')]+'%'};return _0x21b8ba;}})});}_0x4f006e=_[_0x43ad('0x42')]({},_0x4f006e,_0x209ed9['options']);var _0x21bfb2={'where':_0x4f006e[_0x43ad('0x3e')]};return db[_0x43ad('0x44')][_0x43ad('0x23')](_0x21bfb2)[_0x43ad('0x2a')](function(_0x111d31){_0x4859d4['count']=_0x111d31;if(_0x209ed9[_0x43ad('0x36')][_0x43ad('0x45')]){_0x4f006e[_0x43ad('0x46')]=[{'all':!![]}];}return db[_0x43ad('0x44')]['findAll'](_0x4f006e);})['then'](function(_0x4ad8d9){_0x4859d4[_0x43ad('0x47')]=_0x4ad8d9;return _0x4859d4;})['then'](respondWithFilteredResult(_0x211a75,_0x4f006e))['catch'](handleError(_0x211a75,null));};exports[_0x43ad('0x48')]=function(_0x21426d,_0x3b4b1f){var _0x2ebb5c={'raw':!![],'where':{'id':_0x21426d[_0x43ad('0x49')]['id']}},_0x3e8af3={};_0x3e8af3[_0x43ad('0x35')]=_[_0x43ad('0x4a')](db['AnalyticTreeReport'][_0x43ad('0x4b')]);_0x3e8af3['query']=_['keys'](_0x21426d['query']);_0x3e8af3['filters']=_[_0x43ad('0x37')](_0x3e8af3['model'],_0x3e8af3[_0x43ad('0x36')]);_0x2ebb5c[_0x43ad('0x38')]=_['intersection'](_0x3e8af3['model'],qs[_0x43ad('0x39')](_0x21426d['query'][_0x43ad('0x39')]));_0x2ebb5c[_0x43ad('0x38')]=_0x2ebb5c[_0x43ad('0x38')][_0x43ad('0x4c')]?_0x2ebb5c[_0x43ad('0x38')]:_0x3e8af3[_0x43ad('0x35')];if(_0x21426d[_0x43ad('0x36')]['includeAll']){_0x2ebb5c[_0x43ad('0x46')]=[{'all':!![]}];}_0x2ebb5c=_[_0x43ad('0x42')]({},_0x2ebb5c,_0x21426d[_0x43ad('0x4d')]);return db[_0x43ad('0x44')][_0x43ad('0x4e')](_0x2ebb5c)[_0x43ad('0x2a')](handleEntityNotFound(_0x3b4b1f,null))[_0x43ad('0x2a')](respondWithResult(_0x3b4b1f,null))['catch'](handleError(_0x3b4b1f,null));};exports[_0x43ad('0x4f')]=function(_0x1006eb,_0x5d678e){return db[_0x43ad('0x44')][_0x43ad('0x4f')](_0x1006eb[_0x43ad('0x50')],{})[_0x43ad('0x2a')](respondWithResult(_0x5d678e,0xc9))[_0x43ad('0x51')](handleError(_0x5d678e,null));};exports[_0x43ad('0x29')]=function(_0x3b76c7,_0x244fb0){if(_0x3b76c7[_0x43ad('0x50')]['id']){delete _0x3b76c7[_0x43ad('0x50')]['id'];}return db[_0x43ad('0x44')][_0x43ad('0x4e')]({'where':{'id':_0x3b76c7['params']['id']}})[_0x43ad('0x2a')](handleEntityNotFound(_0x244fb0,null))[_0x43ad('0x2a')](saveUpdates(_0x3b76c7[_0x43ad('0x50')],null))[_0x43ad('0x2a')](respondWithResult(_0x244fb0,null))[_0x43ad('0x51')](handleError(_0x244fb0,null));};exports['destroy']=function(_0x4ad27d,_0x3e8075){return db[_0x43ad('0x44')][_0x43ad('0x4e')]({'where':{'id':_0x4ad27d['params']['id']}})[_0x43ad('0x2a')](handleEntityNotFound(_0x3e8075,null))['then'](removeEntity(_0x3e8075,null))[_0x43ad('0x51')](handleError(_0x3e8075,null));}; \ No newline at end of file +var _0xe38b=['destroy','end','sendStatus','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','count','set','Content-Range','apply','update','then'];(function(_0x30b640,_0x368c12){var _0x67bdb9=function(_0x149d42){while(--_0x149d42){_0x30b640['push'](_0x30b640['shift']());}};_0x67bdb9(++_0x368c12);}(_0xe38b,0x1cb));var _0xbe38=function(_0x24da84,_0x3cdec2){_0x24da84=_0x24da84-0x0;var _0x339545=_0xe38b[_0x24da84];return _0x339545;};'use strict';var emlformat=require(_0xbe38('0x0'));var rimraf=require(_0xbe38('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbe38('0x2'));var BPromise=require(_0xbe38('0x3'));var Mustache=require(_0xbe38('0x4'));var util=require(_0xbe38('0x5'));var path=require(_0xbe38('0x6'));var sox=require('sox');var csv=require(_0xbe38('0x7'));var ejs=require(_0xbe38('0x8'));var fs=require('fs');var fs_extra=require(_0xbe38('0x9'));var _=require(_0xbe38('0xa'));var squel=require(_0xbe38('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbe38('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbe38('0xd'));var Papa=require('papaparse');var Redis=require(_0xbe38('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xbe38('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe38('0x10'));var logger=require(_0xbe38('0x11'))(_0xbe38('0x12'));var utils=require('../../config/utils');var config=require(_0xbe38('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xbe38('0x14'))['db'];function respondWithStatusCode(_0x296b42,_0x446338){_0x446338=_0x446338||0xcc;return function(_0x1b8bf9){if(_0x1b8bf9){return _0x296b42['sendStatus'](_0x446338);}return _0x296b42[_0xbe38('0x15')](_0x446338)['end']();};}function respondWithResult(_0x431f6a,_0x5aad8f){_0x5aad8f=_0x5aad8f||0xc8;return function(_0x2bcdc4){if(_0x2bcdc4){return _0x431f6a[_0xbe38('0x15')](_0x5aad8f)[_0xbe38('0x16')](_0x2bcdc4);}};}function respondWithFilteredResult(_0x2b9b27,_0x2338b5){return function(_0x51d5db){if(_0x51d5db){var _0x336d15=typeof _0x2338b5[_0xbe38('0x17')]===_0xbe38('0x18')&&typeof _0x2338b5['limit']===_0xbe38('0x18');var _0x3aa7ac=_0x51d5db[_0xbe38('0x19')];var _0x5a1b3f=_0x336d15?0x0:_0x2338b5[_0xbe38('0x17')];var _0x1e2eaf=_0x336d15?_0x51d5db[_0xbe38('0x19')]:_0x2338b5[_0xbe38('0x17')]+_0x2338b5['limit'];var _0x3157f0;if(_0x1e2eaf>=_0x3aa7ac){_0x1e2eaf=_0x3aa7ac;_0x3157f0=0xc8;}else{_0x3157f0=0xce;}_0x2b9b27['status'](_0x3157f0);return _0x2b9b27[_0xbe38('0x1a')](_0xbe38('0x1b'),_0x5a1b3f+'-'+_0x1e2eaf+'/'+_0x3aa7ac)[_0xbe38('0x16')](_0x51d5db);}return null;};}function patchUpdates(_0x1797a2){return function(_0x26e4f2){try{jsonpatch[_0xbe38('0x1c')](_0x26e4f2,_0x1797a2,!![]);}catch(_0x36c620){return BPromise['reject'](_0x36c620);}return _0x26e4f2['save']();};}function saveUpdates(_0x4096de,_0x14da9b){return function(_0x264d32){if(_0x264d32){return _0x264d32[_0xbe38('0x1d')](_0x4096de)[_0xbe38('0x1e')](function(_0xea9c0){return _0xea9c0;});}return null;};}function removeEntity(_0x95086c,_0x2cf35a){return function(_0x152cdb){if(_0x152cdb){return _0x152cdb[_0xbe38('0x1f')]()[_0xbe38('0x1e')](function(){_0x95086c[_0xbe38('0x15')](0xcc)[_0xbe38('0x20')]();});}};}function handleEntityNotFound(_0x4cf268,_0x412c34){return function(_0x18a943){if(!_0x18a943){_0x4cf268[_0xbe38('0x21')](0x194);}return _0x18a943;};}function handleError(_0x148d56,_0x4b7e3d){_0x4b7e3d=_0x4b7e3d||0x1f4;return function(_0x4a7a1d){logger['error'](_0x4a7a1d[_0xbe38('0x22')]);if(_0x4a7a1d[_0xbe38('0x23')]){delete _0x4a7a1d[_0xbe38('0x23')];}_0x148d56[_0xbe38('0x15')](_0x4b7e3d)[_0xbe38('0x24')](_0x4a7a1d);};}exports['index']=function(_0x2f4e82,_0x4bede8){var _0x327f4b={},_0x475f36={},_0x23f22e={'count':0x0,'rows':[]};var _0x3c6ee2=_[_0xbe38('0x25')](db[_0xbe38('0x26')][_0xbe38('0x27')],function(_0x48b0a8){return{'name':_0x48b0a8[_0xbe38('0x28')],'type':_0x48b0a8[_0xbe38('0x29')][_0xbe38('0x2a')]};});_0x475f36[_0xbe38('0x2b')]=_[_0xbe38('0x25')](_0x3c6ee2,_0xbe38('0x23'));_0x475f36[_0xbe38('0x2c')]=_[_0xbe38('0x2d')](_0x2f4e82[_0xbe38('0x2c')]);_0x475f36[_0xbe38('0x2e')]=_[_0xbe38('0x2f')](_0x475f36['model'],_0x475f36['query']);_0x327f4b['attributes']=_[_0xbe38('0x2f')](_0x475f36[_0xbe38('0x2b')],qs['fields'](_0x2f4e82[_0xbe38('0x2c')][_0xbe38('0x30')]));_0x327f4b[_0xbe38('0x31')]=_0x327f4b[_0xbe38('0x31')][_0xbe38('0x32')]?_0x327f4b['attributes']:_0x475f36[_0xbe38('0x2b')];if(!_0x2f4e82['query'][_0xbe38('0x33')]('nolimit')){_0x327f4b['limit']=qs[_0xbe38('0x34')](_0x2f4e82[_0xbe38('0x2c')]['limit']);_0x327f4b[_0xbe38('0x17')]=qs[_0xbe38('0x17')](_0x2f4e82[_0xbe38('0x2c')][_0xbe38('0x17')]);}_0x327f4b[_0xbe38('0x35')]=qs['sort'](_0x2f4e82['query'][_0xbe38('0x36')]);_0x327f4b[_0xbe38('0x37')]=qs['filters'](_[_0xbe38('0x38')](_0x2f4e82[_0xbe38('0x2c')],_0x475f36['filters']),_0x3c6ee2);if(_0x2f4e82['query'][_0xbe38('0x39')]){_0x327f4b[_0xbe38('0x37')]=_[_0xbe38('0x3a')](_0x327f4b[_0xbe38('0x37')],{'$or':_[_0xbe38('0x25')](_0x3c6ee2,function(_0x503264){if(_0x503264[_0xbe38('0x29')]!==_0xbe38('0x3b')){var _0x1c6b22={};_0x1c6b22[_0x503264[_0xbe38('0x23')]]={'$like':'%'+_0x2f4e82[_0xbe38('0x2c')][_0xbe38('0x39')]+'%'};return _0x1c6b22;}})});}_0x327f4b=_[_0xbe38('0x3a')]({},_0x327f4b,_0x2f4e82[_0xbe38('0x3c')]);var _0x119e82={'where':_0x327f4b['where']};return db[_0xbe38('0x26')][_0xbe38('0x19')](_0x119e82)['then'](function(_0x1b535c){_0x23f22e[_0xbe38('0x19')]=_0x1b535c;if(_0x2f4e82['query'][_0xbe38('0x3d')]){_0x327f4b[_0xbe38('0x3e')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x327f4b);})[_0xbe38('0x1e')](function(_0x500609){_0x23f22e[_0xbe38('0x3f')]=_0x500609;return _0x23f22e;})[_0xbe38('0x1e')](respondWithFilteredResult(_0x4bede8,_0x327f4b))[_0xbe38('0x40')](handleError(_0x4bede8,null));};exports[_0xbe38('0x41')]=function(_0x22a53c,_0xa7a7f1){var _0x136b6b={'raw':!![],'where':{'id':_0x22a53c[_0xbe38('0x42')]['id']}},_0x556843={};_0x556843['model']=_[_0xbe38('0x2d')](db[_0xbe38('0x26')]['rawAttributes']);_0x556843[_0xbe38('0x2c')]=_[_0xbe38('0x2d')](_0x22a53c['query']);_0x556843['filters']=_[_0xbe38('0x2f')](_0x556843[_0xbe38('0x2b')],_0x556843[_0xbe38('0x2c')]);_0x136b6b['attributes']=_[_0xbe38('0x2f')](_0x556843[_0xbe38('0x2b')],qs[_0xbe38('0x30')](_0x22a53c[_0xbe38('0x2c')][_0xbe38('0x30')]));_0x136b6b[_0xbe38('0x31')]=_0x136b6b['attributes'][_0xbe38('0x32')]?_0x136b6b['attributes']:_0x556843['model'];if(_0x22a53c[_0xbe38('0x2c')][_0xbe38('0x3d')]){_0x136b6b[_0xbe38('0x3e')]=[{'all':!![]}];}_0x136b6b=_[_0xbe38('0x3a')]({},_0x136b6b,_0x22a53c['options']);return db[_0xbe38('0x26')][_0xbe38('0x43')](_0x136b6b)[_0xbe38('0x1e')](handleEntityNotFound(_0xa7a7f1,null))[_0xbe38('0x1e')](respondWithResult(_0xa7a7f1,null))[_0xbe38('0x40')](handleError(_0xa7a7f1,null));};exports[_0xbe38('0x44')]=function(_0x45701a,_0x3b24c4){return db[_0xbe38('0x26')]['create'](_0x45701a[_0xbe38('0x45')],{})[_0xbe38('0x1e')](respondWithResult(_0x3b24c4,0xc9))['catch'](handleError(_0x3b24c4,null));};exports[_0xbe38('0x1d')]=function(_0x2551d8,_0x3b6428){if(_0x2551d8[_0xbe38('0x45')]['id']){delete _0x2551d8[_0xbe38('0x45')]['id'];}return db[_0xbe38('0x26')][_0xbe38('0x43')]({'where':{'id':_0x2551d8[_0xbe38('0x42')]['id']}})[_0xbe38('0x1e')](handleEntityNotFound(_0x3b6428,null))[_0xbe38('0x1e')](saveUpdates(_0x2551d8[_0xbe38('0x45')],null))[_0xbe38('0x1e')](respondWithResult(_0x3b6428,null))[_0xbe38('0x40')](handleError(_0x3b6428,null));};exports['destroy']=function(_0x2240fc,_0x480eff){return db[_0xbe38('0x26')][_0xbe38('0x43')]({'where':{'id':_0x2240fc['params']['id']}})[_0xbe38('0x1e')](handleEntityNotFound(_0x480eff,null))[_0xbe38('0x1e')](removeEntity(_0x480eff,null))['catch'](handleError(_0x480eff,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 5faecf0..b3f8fa1 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 _0x4644=['../../config/environment','./analyticTreeReport.attributes','exports','define','lodash','util','bluebird','request-promise','path','rimraf'];(function(_0x466c87,_0x3f2a31){var _0x391415=function(_0x1d0f66){while(--_0x1d0f66){_0x466c87['push'](_0x466c87['shift']());}};_0x391415(++_0x3f2a31);}(_0x4644,0x180));var _0x4464=function(_0x466cc8,_0x203996){_0x466cc8=_0x466cc8-0x0;var _0x3edc41=_0x4644[_0x466cc8];return _0x3edc41;};'use strict';var _=require(_0x4464('0x0'));var util=require(_0x4464('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4464('0x2'));var rp=require(_0x4464('0x3'));var fs=require('fs');var path=require(_0x4464('0x4'));var rimraf=require(_0x4464('0x5'));var config=require(_0x4464('0x6'));var attributes=require(_0x4464('0x7'));module[_0x4464('0x8')]=function(_0x478c91,_0x8cc86){return _0x478c91[_0x4464('0x9')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1dbe=['request-promise','rimraf','../../config/environment','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x23a33f,_0x413c03){var _0x56e720=function(_0x21a646){while(--_0x21a646){_0x23a33f['push'](_0x23a33f['shift']());}};_0x56e720(++_0x413c03);}(_0x1dbe,0x102));var _0xe1db=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dbe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe1db('0x0'));var util=require(_0xe1db('0x1'));var logger=require(_0xe1db('0x2'))(_0xe1db('0x3'));var moment=require(_0xe1db('0x4'));var BPromise=require(_0xe1db('0x5'));var rp=require(_0xe1db('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe1db('0x7'));var config=require(_0xe1db('0x8'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x1efcc5,_0x321135){return _0x1efcc5[_0xe1db('0x9')](_0xe1db('0xa'),attributes,{'tableName':_0xe1db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 8121871..3b05a4f 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x79c52f,_0x5bd9d3){var _0x37f2a8=function(_0x53d6f2){while(--_0x53d6f2){_0x79c52f['push'](_0x79c52f['shift']());}};_0x37f2a8(++_0x5bd9d3);}(_0x2ef3,0xba));var _0x32ef=function(_0x136e19,_0x3b2f5f){_0x136e19=_0x136e19-0x0;var _0x114dcf=_0x2ef3[_0x136e19];return _0x114dcf;};'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')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x5958bf,_0x4bd0ce){var _0x15c777=function(_0x2a3aa7){while(--_0x2a3aa7){_0x5958bf['push'](_0x5958bf['shift']());}};_0x15c777(++_0x4bd0ce);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xc4aa[_0x209941];return _0x1e8729;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index b374400..47c7b78 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 _0x11bb=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra'];(function(_0x3ccb93,_0x4adbbf){var _0x5f3149=function(_0x1786e3){while(--_0x1786e3){_0x3ccb93['push'](_0x3ccb93['shift']());}};_0x5f3149(++_0x4adbbf);}(_0x11bb,0x93));var _0xb11b=function(_0x4b249a,_0x35bcc6){_0x4b249a=_0x4b249a-0x0;var _0x283084=_0x11bb[_0x4b249a];return _0x283084;};'use strict';var multer=require(_0xb11b('0x0'));var util=require('util');var path=require(_0xb11b('0x1'));var timeout=require(_0xb11b('0x2'));var express=require('express');var router=express[_0xb11b('0x3')]();var fs_extra=require(_0xb11b('0x4'));var auth=require(_0xb11b('0x5'));var interaction=require(_0xb11b('0x6'));var config=require(_0xb11b('0x7'));var controller=require(_0xb11b('0x8'));router[_0xb11b('0x9')]('/',auth[_0xb11b('0xa')](),controller[_0xb11b('0xb')]);router[_0xb11b('0x9')](_0xb11b('0xc'),auth[_0xb11b('0xa')](),controller[_0xb11b('0xd')]);router[_0xb11b('0xe')]('/',auth[_0xb11b('0xa')](),controller[_0xb11b('0xf')]);router['put'](_0xb11b('0xc'),auth['isAuthenticated'](),controller[_0xb11b('0x10')]);router[_0xb11b('0x11')](_0xb11b('0xc'),auth[_0xb11b('0xa')](),controller[_0xb11b('0x12')]);module['exports']=router; \ No newline at end of file +var _0xd251=['/:id','show','post','create','put','exports','util','path','express','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','isAuthenticated','index'];(function(_0x115a8b,_0x58d048){var _0x193669=function(_0x50a5b4){while(--_0x50a5b4){_0x115a8b['push'](_0x115a8b['shift']());}};_0x193669(++_0x58d048);}(_0xd251,0xca));var _0x1d25=function(_0x5c7a9d,_0x1ec964){_0x5c7a9d=_0x5c7a9d-0x0;var _0x3819a9=_0xd251[_0x5c7a9d];return _0x3819a9;};'use strict';var multer=require('multer');var util=require(_0x1d25('0x0'));var path=require(_0x1d25('0x1'));var timeout=require('connect-timeout');var express=require(_0x1d25('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1d25('0x3'));var interaction=require(_0x1d25('0x4'));var config=require('../../config/environment');var controller=require(_0x1d25('0x5'));router['get']('/',auth[_0x1d25('0x6')](),controller[_0x1d25('0x7')]);router['get'](_0x1d25('0x8'),auth[_0x1d25('0x6')](),controller[_0x1d25('0x9')]);router[_0x1d25('0xa')]('/',auth['isAuthenticated'](),controller[_0x1d25('0xb')]);router[_0x1d25('0xc')](_0x1d25('0x8'),auth[_0x1d25('0x6')](),controller['update']);router['delete'](_0x1d25('0x8'),auth[_0x1d25('0x6')](),controller['destroy']);module[_0x1d25('0xd')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 5649ae8..438658e 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 _0xb377=['sequelize','exports','STRING'];(function(_0x42bafd,_0x3f0fe3){var _0x2ed705=function(_0x4311ea){while(--_0x4311ea){_0x42bafd['push'](_0x42bafd['shift']());}};_0x2ed705(++_0x3f0fe3);}(_0xb377,0x1b6));var _0x7b37=function(_0x165a10,_0x362dd5){_0x165a10=_0x165a10-0x0;var _0x1316b3=_0xb377[_0x165a10];return _0x1316b3;};'use strict';var Sequelize=require(_0x7b37('0x0'));module[_0x7b37('0x1')]={'name':{'type':Sequelize[_0x7b37('0x2')]},'basename':{'type':Sequelize[_0x7b37('0x2')]},'type':{'type':Sequelize[_0x7b37('0x2')]}}; \ No newline at end of file +var _0xe4b8=['exports','STRING','sequelize'];(function(_0x12dc7b,_0x49d6d1){var _0x1f37ce=function(_0x43c824){while(--_0x43c824){_0x12dc7b['push'](_0x12dc7b['shift']());}};_0x1f37ce(++_0x49d6d1);}(_0xe4b8,0x179));var _0x8e4b=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xe4b8[_0x1203f];return _0x365f0a;};'use strict';var Sequelize=require(_0x8e4b('0x0'));module[_0x8e4b('0x1')]={'name':{'type':Sequelize[_0x8e4b('0x2')]},'basename':{'type':Sequelize[_0x8e4b('0x2')]},'type':{'type':Sequelize[_0x8e4b('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index b094270..264a8ac 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 _0x1ec0=['clone','include','get','createdAt','updatedAt','body','create','file','basename','filename','mimetype','download','findOne','join','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','name','send','index','Attachment','rawAttributes','type','model','map','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','params','keys','find'];(function(_0xf7f177,_0x2b11e5){var _0x1811e7=function(_0x40792a){while(--_0x40792a){_0xf7f177['push'](_0xf7f177['shift']());}};_0x1811e7(++_0x2b11e5);}(_0x1ec0,0x15f));var _0x01ec=function(_0x38dcff,_0x129a00){_0x38dcff=_0x38dcff-0x0;var _0x17c442=_0x1ec0[_0x38dcff];return _0x17c442;};'use strict';var emlformat=require(_0x01ec('0x0'));var rimraf=require(_0x01ec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x01ec('0x2'));var rp=require(_0x01ec('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x01ec('0x4'));var util=require(_0x01ec('0x5'));var path=require(_0x01ec('0x6'));var sox=require('sox');var csv=require(_0x01ec('0x7'));var ejs=require(_0x01ec('0x8'));var fs=require('fs');var fs_extra=require(_0x01ec('0x9'));var _=require(_0x01ec('0xa'));var squel=require('squel');var crypto=require(_0x01ec('0xb'));var jsforce=require(_0x01ec('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x01ec('0x7'));var querystring=require(_0x01ec('0xd'));var Papa=require(_0x01ec('0xe'));var Redis=require(_0x01ec('0xf'));var authService=require(_0x01ec('0x10'));var qs=require(_0x01ec('0x11'));var as=require(_0x01ec('0x12'));var hardwareService=require(_0x01ec('0x13'));var logger=require(_0x01ec('0x14'))(_0x01ec('0x15'));var utils=require(_0x01ec('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x01ec('0x17'));var db=require(_0x01ec('0x18'))['db'];function respondWithStatusCode(_0x45cea3,_0x475d00){_0x475d00=_0x475d00||0xcc;return function(_0xbe2a59){if(_0xbe2a59){return _0x45cea3[_0x01ec('0x19')](_0x475d00);}return _0x45cea3[_0x01ec('0x1a')](_0x475d00)[_0x01ec('0x1b')]();};}function respondWithResult(_0x1ef04b,_0xfd3ffc){_0xfd3ffc=_0xfd3ffc||0xc8;return function(_0x19efb0){if(_0x19efb0){return _0x1ef04b[_0x01ec('0x1a')](_0xfd3ffc)['json'](_0x19efb0);}};}function respondWithFilteredResult(_0x4c03a6,_0x344206){return function(_0x59ca14){if(_0x59ca14){var _0x3c8300=typeof _0x344206[_0x01ec('0x1c')]===_0x01ec('0x1d')&&typeof _0x344206[_0x01ec('0x1e')]===_0x01ec('0x1d');var _0x2bdc4f=_0x59ca14[_0x01ec('0x1f')];var _0x338c2e=_0x3c8300?0x0:_0x344206['offset'];var _0x4ee0f2=_0x3c8300?_0x59ca14[_0x01ec('0x1f')]:_0x344206[_0x01ec('0x1c')]+_0x344206[_0x01ec('0x1e')];var _0x2e1325;if(_0x4ee0f2>=_0x2bdc4f){_0x4ee0f2=_0x2bdc4f;_0x2e1325=0xc8;}else{_0x2e1325=0xce;}_0x4c03a6[_0x01ec('0x1a')](_0x2e1325);return _0x4c03a6[_0x01ec('0x20')](_0x01ec('0x21'),_0x338c2e+'-'+_0x4ee0f2+'/'+_0x2bdc4f)[_0x01ec('0x22')](_0x59ca14);}return null;};}function patchUpdates(_0x1e6224){return function(_0x484c8f){try{jsonpatch[_0x01ec('0x23')](_0x484c8f,_0x1e6224,!![]);}catch(_0x12dbda){return BPromise['reject'](_0x12dbda);}return _0x484c8f[_0x01ec('0x24')]();};}function saveUpdates(_0x2a19b9,_0x331062){return function(_0x37a40f){if(_0x37a40f){return _0x37a40f[_0x01ec('0x25')](_0x2a19b9)[_0x01ec('0x26')](function(_0x16dca7){return _0x16dca7;});}return null;};}function removeEntity(_0x2f09d7,_0x4f4ed8){return function(_0x158547){if(_0x158547){return _0x158547[_0x01ec('0x27')]()[_0x01ec('0x26')](function(){_0x2f09d7[_0x01ec('0x1a')](0xcc)[_0x01ec('0x1b')]();});}};}function handleEntityNotFound(_0x426349,_0x1963f4){return function(_0x2666e2){if(!_0x2666e2){_0x426349[_0x01ec('0x19')](0x194);}return _0x2666e2;};}function handleError(_0x488224,_0x2d4903){_0x2d4903=_0x2d4903||0x1f4;return function(_0x50532f){logger[_0x01ec('0x28')](_0x50532f['stack']);if(_0x50532f[_0x01ec('0x29')]){delete _0x50532f[_0x01ec('0x29')];}_0x488224[_0x01ec('0x1a')](_0x2d4903)[_0x01ec('0x2a')](_0x50532f);};}exports[_0x01ec('0x2b')]=function(_0x3db707,_0x52db17){var _0x441a23={},_0x315b25={},_0x392c9b={'count':0x0,'rows':[]};var _0xec28=_['map'](db[_0x01ec('0x2c')][_0x01ec('0x2d')],function(_0x195d20){return{'name':_0x195d20['fieldName'],'type':_0x195d20[_0x01ec('0x2e')]['key']};});_0x315b25[_0x01ec('0x2f')]=_[_0x01ec('0x30')](_0xec28,_0x01ec('0x29'));_0x315b25[_0x01ec('0x31')]=_['keys'](_0x3db707[_0x01ec('0x31')]);_0x315b25[_0x01ec('0x32')]=_[_0x01ec('0x33')](_0x315b25[_0x01ec('0x2f')],_0x315b25['query']);_0x441a23['attributes']=_[_0x01ec('0x33')](_0x315b25['model'],qs[_0x01ec('0x34')](_0x3db707['query']['fields']));_0x441a23[_0x01ec('0x35')]=_0x441a23[_0x01ec('0x35')][_0x01ec('0x36')]?_0x441a23[_0x01ec('0x35')]:_0x315b25['model'];if(!_0x3db707[_0x01ec('0x31')]['hasOwnProperty'](_0x01ec('0x37'))){_0x441a23[_0x01ec('0x1e')]=qs[_0x01ec('0x1e')](_0x3db707[_0x01ec('0x31')][_0x01ec('0x1e')]);_0x441a23[_0x01ec('0x1c')]=qs[_0x01ec('0x1c')](_0x3db707[_0x01ec('0x31')][_0x01ec('0x1c')]);}_0x441a23[_0x01ec('0x38')]=qs[_0x01ec('0x39')](_0x3db707[_0x01ec('0x31')]['sort']);_0x441a23[_0x01ec('0x3a')]=qs['filters'](_[_0x01ec('0x3b')](_0x3db707[_0x01ec('0x31')],_0x315b25[_0x01ec('0x32')]),_0xec28);if(_0x3db707[_0x01ec('0x31')][_0x01ec('0x3c')]){_0x441a23[_0x01ec('0x3a')]=_[_0x01ec('0x3d')](_0x441a23[_0x01ec('0x3a')],{'$or':_[_0x01ec('0x30')](_0xec28,function(_0x4d132d){if(_0x4d132d[_0x01ec('0x2e')]!==_0x01ec('0x3e')){var _0x3b7c42={};_0x3b7c42[_0x4d132d[_0x01ec('0x29')]]={'$like':'%'+_0x3db707[_0x01ec('0x31')][_0x01ec('0x3c')]+'%'};return _0x3b7c42;}})});}_0x441a23=_[_0x01ec('0x3d')]({},_0x441a23,_0x3db707[_0x01ec('0x3f')]);var _0x1676ec={'where':_0x441a23[_0x01ec('0x3a')]};return db[_0x01ec('0x2c')]['count'](_0x1676ec)[_0x01ec('0x26')](function(_0x2c35a2){_0x392c9b[_0x01ec('0x1f')]=_0x2c35a2;if(_0x3db707[_0x01ec('0x31')][_0x01ec('0x40')]){_0x441a23['include']=[{'all':!![]}];}return db['Attachment']['findAll'](_0x441a23);})[_0x01ec('0x26')](function(_0x57b79b){_0x392c9b['rows']=_0x57b79b;return _0x392c9b;})['then'](respondWithFilteredResult(_0x52db17,_0x441a23))[_0x01ec('0x41')](handleError(_0x52db17,null));};exports['show']=function(_0x3eec29,_0xf13e62){var _0x5958da={'raw':!![],'where':{'id':_0x3eec29[_0x01ec('0x42')]['id']}},_0x13ceaf={};_0x13ceaf[_0x01ec('0x2f')]=_[_0x01ec('0x43')](db[_0x01ec('0x2c')]['rawAttributes']);_0x13ceaf[_0x01ec('0x31')]=_['keys'](_0x3eec29[_0x01ec('0x31')]);_0x13ceaf['filters']=_[_0x01ec('0x33')](_0x13ceaf['model'],_0x13ceaf[_0x01ec('0x31')]);_0x5958da[_0x01ec('0x35')]=_[_0x01ec('0x33')](_0x13ceaf['model'],qs['fields'](_0x3eec29['query'][_0x01ec('0x34')]));_0x5958da[_0x01ec('0x35')]=_0x5958da[_0x01ec('0x35')][_0x01ec('0x36')]?_0x5958da[_0x01ec('0x35')]:_0x13ceaf[_0x01ec('0x2f')];if(_0x3eec29[_0x01ec('0x31')][_0x01ec('0x40')]){_0x5958da['include']=[{'all':!![]}];}_0x5958da=_[_0x01ec('0x3d')]({},_0x5958da,_0x3eec29[_0x01ec('0x3f')]);return db[_0x01ec('0x2c')][_0x01ec('0x44')](_0x5958da)[_0x01ec('0x26')](handleEntityNotFound(_0xf13e62,null))['then'](respondWithResult(_0xf13e62,null))['catch'](handleError(_0xf13e62,null));};exports[_0x01ec('0x45')]=function(_0xadb924,_0x467882){var _0xafc639={'where':{'id':_0xadb924[_0x01ec('0x42')]['id']}},_0x4ba35f={};_0x4ba35f[_0x01ec('0x2f')]=_[_0x01ec('0x43')](db[_0x01ec('0x2c')][_0x01ec('0x2d')]);_0xafc639[_0x01ec('0x35')]=_[_0x01ec('0x33')](_0x4ba35f[_0x01ec('0x2f')],qs[_0x01ec('0x34')](_0xadb924['query'][_0x01ec('0x34')]));_0xafc639['attributes']=_0xafc639[_0x01ec('0x35')][_0x01ec('0x36')]?_0xafc639[_0x01ec('0x35')]:_0x4ba35f[_0x01ec('0x2f')];if(_0xadb924[_0x01ec('0x31')]['includeAll']){_0xafc639[_0x01ec('0x46')]=[{'all':!![]}];}_0xafc639=_[_0x01ec('0x3d')]({},_0xafc639,_0xadb924[_0x01ec('0x3f')]);return db[_0x01ec('0x2c')]['find'](_0xafc639)['then'](handleEntityNotFound(_0x467882,null))[_0x01ec('0x26')](function(_0x50cd70){if(_0x50cd70){var _0x5974a9=_0x50cd70[_0x01ec('0x47')]({'plain':!![]});_0x5974a9=qs['omit'](_0x5974a9,['id',_0x01ec('0x48'),_0x01ec('0x49')]);_0xadb924['body']=_['omit'](_0xadb924[_0x01ec('0x4a')],['id',_0x01ec('0x48'),_0x01ec('0x49')]);return db['Attachment'][_0x01ec('0x4b')](_[_0x01ec('0x3d')](_0x5974a9,_0xadb924[_0x01ec('0x4a')]),{'include':_0xadb924['query'][_0x01ec('0x40')]?[{'all':!![]}]:undefined});}})[_0x01ec('0x26')](respondWithResult(_0x467882,0xc9))[_0x01ec('0x41')](handleError(_0x467882,null));};exports[_0x01ec('0x25')]=function(_0x4cbfa0,_0x15dc35){if(_0x4cbfa0[_0x01ec('0x4a')]['id']){delete _0x4cbfa0['body']['id'];}return db[_0x01ec('0x2c')][_0x01ec('0x44')]({'where':{'id':_0x4cbfa0[_0x01ec('0x42')]['id']}})[_0x01ec('0x26')](handleEntityNotFound(_0x15dc35,null))[_0x01ec('0x26')](saveUpdates(_0x4cbfa0[_0x01ec('0x4a')],null))[_0x01ec('0x26')](respondWithResult(_0x15dc35,null))[_0x01ec('0x41')](handleError(_0x15dc35,null));};exports[_0x01ec('0x27')]=function(_0x1070cf,_0x10b853){return db['Attachment'][_0x01ec('0x44')]({'where':{'id':_0x1070cf['params']['id']}})[_0x01ec('0x26')](handleEntityNotFound(_0x10b853,null))[_0x01ec('0x26')](removeEntity(_0x10b853,null))[_0x01ec('0x41')](handleError(_0x10b853,null));};exports[_0x01ec('0x4b')]=function(_0x4b0791,_0x3318dd,_0x20f6a5){_0x4b0791[_0x01ec('0x4a')]['name']=_0x4b0791[_0x01ec('0x4c')]['originalname'];_0x4b0791[_0x01ec('0x4a')][_0x01ec('0x4d')]=_0x4b0791[_0x01ec('0x4c')][_0x01ec('0x4e')];_0x4b0791[_0x01ec('0x4a')]['type']=_0x4b0791['file'][_0x01ec('0x4f')];return db['Attachment'][_0x01ec('0x4b')](_0x4b0791[_0x01ec('0x4a')])[_0x01ec('0x26')](respondWithResult(_0x3318dd,0xc9))[_0x01ec('0x41')](handleError(_0x3318dd,null));};exports[_0x01ec('0x50')]=function(_0x35a93d,_0x525444,_0x57bdb4){return db[_0x01ec('0x2c')][_0x01ec('0x51')]({'where':{'id':_0x35a93d[_0x01ec('0x42')]['id']},'raw':!![]})[_0x01ec('0x26')](handleEntityNotFound(_0x525444,null))[_0x01ec('0x26')](function(_0x36d9d8){if(_0x36d9d8){var _0x4b90c5=_0x36d9d8['ChatOfflineMessageId']!==null;var _0x1f4926=path[_0x01ec('0x52')](config['root'],'server/files/attachments/');if(_0x4b90c5){_0x1f4926=path[_0x01ec('0x52')](_0x1f4926,_0x01ec('0x53'));}var _0x51ae97=path['join'](_0x1f4926,_0x36d9d8['basename']);return _0x525444[_0x01ec('0x50')](_0x51ae97);}})[_0x01ec('0x41')](handleError(_0x525444,null));}; \ No newline at end of file +var _0xccbb=['map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Attachment','includeAll','include','findAll','rows','catch','show','clone','get','omit','createdAt','updatedAt','body','params','destroy','find','create','originalname','basename','file','filename','findOne','ChatOfflineMessageId','join','root','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xccbb,0xf0));var _0xbccb=function(_0x385b5c,_0x527ff4){_0x385b5c=_0x385b5c-0x0;var _0x5530fa=_0xccbb[_0x385b5c];return _0x5530fa;};'use strict';var emlformat=require(_0xbccb('0x0'));var rimraf=require(_0xbccb('0x1'));var zipdir=require(_0xbccb('0x2'));var jsonpatch=require(_0xbccb('0x3'));var rp=require(_0xbccb('0x4'));var moment=require(_0xbccb('0x5'));var BPromise=require(_0xbccb('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xbccb('0x7'));var csv=require(_0xbccb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbccb('0x9'));var _=require(_0xbccb('0xa'));var squel=require(_0xbccb('0xb'));var crypto=require(_0xbccb('0xc'));var jsforce=require(_0xbccb('0xd'));var deskjs=require(_0xbccb('0xe'));var toCsv=require(_0xbccb('0x8'));var querystring=require(_0xbccb('0xf'));var Papa=require(_0xbccb('0x10'));var Redis=require('ioredis');var authService=require(_0xbccb('0x11'));var qs=require(_0xbccb('0x12'));var as=require(_0xbccb('0x13'));var hardwareService=require(_0xbccb('0x14'));var logger=require('../../config/logger')(_0xbccb('0x15'));var utils=require(_0xbccb('0x16'));var config=require(_0xbccb('0x17'));var licenseUtil=require(_0xbccb('0x18'));var db=require(_0xbccb('0x19'))['db'];function respondWithStatusCode(_0x86a6e2,_0x7b663d){_0x7b663d=_0x7b663d||0xcc;return function(_0x2154a3){if(_0x2154a3){return _0x86a6e2[_0xbccb('0x1a')](_0x7b663d);}return _0x86a6e2['status'](_0x7b663d)[_0xbccb('0x1b')]();};}function respondWithResult(_0x156b58,_0x440354){_0x440354=_0x440354||0xc8;return function(_0x217f7c){if(_0x217f7c){return _0x156b58[_0xbccb('0x1c')](_0x440354)['json'](_0x217f7c);}};}function respondWithFilteredResult(_0xf40a9e,_0x2af522){return function(_0x138acb){if(_0x138acb){var _0x4a3ba9=typeof _0x2af522['offset']===_0xbccb('0x1d')&&typeof _0x2af522[_0xbccb('0x1e')]===_0xbccb('0x1d');var _0x12626f=_0x138acb[_0xbccb('0x1f')];var _0x2e3c50=_0x4a3ba9?0x0:_0x2af522[_0xbccb('0x20')];var _0x465f2f=_0x4a3ba9?_0x138acb['count']:_0x2af522['offset']+_0x2af522[_0xbccb('0x1e')];var _0x376692;if(_0x465f2f>=_0x12626f){_0x465f2f=_0x12626f;_0x376692=0xc8;}else{_0x376692=0xce;}_0xf40a9e['status'](_0x376692);return _0xf40a9e[_0xbccb('0x21')](_0xbccb('0x22'),_0x2e3c50+'-'+_0x465f2f+'/'+_0x12626f)[_0xbccb('0x23')](_0x138acb);}return null;};}function patchUpdates(_0x4b5d66){return function(_0x52f09f){try{jsonpatch[_0xbccb('0x24')](_0x52f09f,_0x4b5d66,!![]);}catch(_0xaf04c8){return BPromise[_0xbccb('0x25')](_0xaf04c8);}return _0x52f09f[_0xbccb('0x26')]();};}function saveUpdates(_0x2e81d7,_0x1cb985){return function(_0x19b2a){if(_0x19b2a){return _0x19b2a[_0xbccb('0x27')](_0x2e81d7)[_0xbccb('0x28')](function(_0xd9533a){return _0xd9533a;});}return null;};}function removeEntity(_0x22caa9,_0x495141){return function(_0x2730db){if(_0x2730db){return _0x2730db['destroy']()['then'](function(){_0x22caa9[_0xbccb('0x1c')](0xcc)[_0xbccb('0x1b')]();});}};}function handleEntityNotFound(_0x6a71c8,_0x220fc2){return function(_0x35cd25){if(!_0x35cd25){_0x6a71c8[_0xbccb('0x1a')](0x194);}return _0x35cd25;};}function handleError(_0x29a373,_0x2b13b){_0x2b13b=_0x2b13b||0x1f4;return function(_0x4d075b){logger[_0xbccb('0x29')](_0x4d075b[_0xbccb('0x2a')]);if(_0x4d075b[_0xbccb('0x2b')]){delete _0x4d075b[_0xbccb('0x2b')];}_0x29a373[_0xbccb('0x1c')](_0x2b13b)[_0xbccb('0x2c')](_0x4d075b);};}exports['index']=function(_0x3ed099,_0x246b84){var _0x134864={},_0x34013d={},_0x4650b3={'count':0x0,'rows':[]};var _0x20737a=_[_0xbccb('0x2d')](db['Attachment'][_0xbccb('0x2e')],function(_0x14e20a){return{'name':_0x14e20a[_0xbccb('0x2f')],'type':_0x14e20a[_0xbccb('0x30')][_0xbccb('0x31')]};});_0x34013d['model']=_[_0xbccb('0x2d')](_0x20737a,_0xbccb('0x2b'));_0x34013d[_0xbccb('0x32')]=_[_0xbccb('0x33')](_0x3ed099[_0xbccb('0x32')]);_0x34013d[_0xbccb('0x34')]=_[_0xbccb('0x35')](_0x34013d[_0xbccb('0x36')],_0x34013d[_0xbccb('0x32')]);_0x134864['attributes']=_[_0xbccb('0x35')](_0x34013d['model'],qs[_0xbccb('0x37')](_0x3ed099[_0xbccb('0x32')][_0xbccb('0x37')]));_0x134864[_0xbccb('0x38')]=_0x134864[_0xbccb('0x38')][_0xbccb('0x39')]?_0x134864[_0xbccb('0x38')]:_0x34013d['model'];if(!_0x3ed099[_0xbccb('0x32')][_0xbccb('0x3a')](_0xbccb('0x3b'))){_0x134864[_0xbccb('0x1e')]=qs[_0xbccb('0x1e')](_0x3ed099[_0xbccb('0x32')][_0xbccb('0x1e')]);_0x134864[_0xbccb('0x20')]=qs[_0xbccb('0x20')](_0x3ed099[_0xbccb('0x32')][_0xbccb('0x20')]);}_0x134864[_0xbccb('0x3c')]=qs[_0xbccb('0x3d')](_0x3ed099[_0xbccb('0x32')][_0xbccb('0x3d')]);_0x134864[_0xbccb('0x3e')]=qs[_0xbccb('0x34')](_[_0xbccb('0x3f')](_0x3ed099[_0xbccb('0x32')],_0x34013d['filters']),_0x20737a);if(_0x3ed099['query'][_0xbccb('0x40')]){_0x134864[_0xbccb('0x3e')]=_[_0xbccb('0x41')](_0x134864['where'],{'$or':_[_0xbccb('0x2d')](_0x20737a,function(_0x41586b){if(_0x41586b[_0xbccb('0x30')]!==_0xbccb('0x42')){var _0x2e28c6={};_0x2e28c6[_0x41586b[_0xbccb('0x2b')]]={'$like':'%'+_0x3ed099[_0xbccb('0x32')]['filter']+'%'};return _0x2e28c6;}})});}_0x134864=_['merge']({},_0x134864,_0x3ed099[_0xbccb('0x43')]);var _0x1a3039={'where':_0x134864['where']};return db[_0xbccb('0x44')][_0xbccb('0x1f')](_0x1a3039)[_0xbccb('0x28')](function(_0x316a18){_0x4650b3[_0xbccb('0x1f')]=_0x316a18;if(_0x3ed099[_0xbccb('0x32')][_0xbccb('0x45')]){_0x134864[_0xbccb('0x46')]=[{'all':!![]}];}return db[_0xbccb('0x44')][_0xbccb('0x47')](_0x134864);})['then'](function(_0x23c86d){_0x4650b3[_0xbccb('0x48')]=_0x23c86d;return _0x4650b3;})[_0xbccb('0x28')](respondWithFilteredResult(_0x246b84,_0x134864))[_0xbccb('0x49')](handleError(_0x246b84,null));};exports[_0xbccb('0x4a')]=function(_0x1480a4,_0x59d74a){var _0x44e40c={'raw':!![],'where':{'id':_0x1480a4['params']['id']}},_0x18ba29={};_0x18ba29[_0xbccb('0x36')]=_[_0xbccb('0x33')](db[_0xbccb('0x44')][_0xbccb('0x2e')]);_0x18ba29[_0xbccb('0x32')]=_[_0xbccb('0x33')](_0x1480a4[_0xbccb('0x32')]);_0x18ba29[_0xbccb('0x34')]=_[_0xbccb('0x35')](_0x18ba29[_0xbccb('0x36')],_0x18ba29['query']);_0x44e40c[_0xbccb('0x38')]=_[_0xbccb('0x35')](_0x18ba29['model'],qs[_0xbccb('0x37')](_0x1480a4[_0xbccb('0x32')][_0xbccb('0x37')]));_0x44e40c[_0xbccb('0x38')]=_0x44e40c[_0xbccb('0x38')]['length']?_0x44e40c['attributes']:_0x18ba29['model'];if(_0x1480a4['query'][_0xbccb('0x45')]){_0x44e40c[_0xbccb('0x46')]=[{'all':!![]}];}_0x44e40c=_[_0xbccb('0x41')]({},_0x44e40c,_0x1480a4[_0xbccb('0x43')]);return db[_0xbccb('0x44')]['find'](_0x44e40c)[_0xbccb('0x28')](handleEntityNotFound(_0x59d74a,null))[_0xbccb('0x28')](respondWithResult(_0x59d74a,null))['catch'](handleError(_0x59d74a,null));};exports[_0xbccb('0x4b')]=function(_0x14a062,_0x178d5b){var _0x118def={'where':{'id':_0x14a062['params']['id']}},_0x342712={};_0x342712[_0xbccb('0x36')]=_[_0xbccb('0x33')](db[_0xbccb('0x44')][_0xbccb('0x2e')]);_0x118def[_0xbccb('0x38')]=_[_0xbccb('0x35')](_0x342712[_0xbccb('0x36')],qs[_0xbccb('0x37')](_0x14a062[_0xbccb('0x32')][_0xbccb('0x37')]));_0x118def[_0xbccb('0x38')]=_0x118def[_0xbccb('0x38')]['length']?_0x118def[_0xbccb('0x38')]:_0x342712['model'];if(_0x14a062['query']['includeAll']){_0x118def['include']=[{'all':!![]}];}_0x118def=_['merge']({},_0x118def,_0x14a062[_0xbccb('0x43')]);return db['Attachment']['find'](_0x118def)['then'](handleEntityNotFound(_0x178d5b,null))[_0xbccb('0x28')](function(_0x1668b4){if(_0x1668b4){var _0x5ca6b6=_0x1668b4[_0xbccb('0x4c')]({'plain':!![]});_0x5ca6b6=qs[_0xbccb('0x4d')](_0x5ca6b6,['id',_0xbccb('0x4e'),_0xbccb('0x4f')]);_0x14a062['body']=_[_0xbccb('0x4d')](_0x14a062['body'],['id',_0xbccb('0x4e'),_0xbccb('0x4f')]);return db[_0xbccb('0x44')]['create'](_[_0xbccb('0x41')](_0x5ca6b6,_0x14a062[_0xbccb('0x50')]),{'include':_0x14a062[_0xbccb('0x32')][_0xbccb('0x45')]?[{'all':!![]}]:undefined});}})[_0xbccb('0x28')](respondWithResult(_0x178d5b,0xc9))[_0xbccb('0x49')](handleError(_0x178d5b,null));};exports[_0xbccb('0x27')]=function(_0x449a6b,_0x333bad){if(_0x449a6b[_0xbccb('0x50')]['id']){delete _0x449a6b[_0xbccb('0x50')]['id'];}return db[_0xbccb('0x44')]['find']({'where':{'id':_0x449a6b[_0xbccb('0x51')]['id']}})[_0xbccb('0x28')](handleEntityNotFound(_0x333bad,null))[_0xbccb('0x28')](saveUpdates(_0x449a6b[_0xbccb('0x50')],null))[_0xbccb('0x28')](respondWithResult(_0x333bad,null))[_0xbccb('0x49')](handleError(_0x333bad,null));};exports[_0xbccb('0x52')]=function(_0x1b6c2c,_0x271a16){return db['Attachment'][_0xbccb('0x53')]({'where':{'id':_0x1b6c2c['params']['id']}})['then'](handleEntityNotFound(_0x271a16,null))[_0xbccb('0x28')](removeEntity(_0x271a16,null))[_0xbccb('0x49')](handleError(_0x271a16,null));};exports[_0xbccb('0x54')]=function(_0xa83236,_0x1b3d75,_0x41a157){_0xa83236[_0xbccb('0x50')][_0xbccb('0x2b')]=_0xa83236['file'][_0xbccb('0x55')];_0xa83236[_0xbccb('0x50')][_0xbccb('0x56')]=_0xa83236[_0xbccb('0x57')][_0xbccb('0x58')];_0xa83236['body']['type']=_0xa83236[_0xbccb('0x57')]['mimetype'];return db[_0xbccb('0x44')][_0xbccb('0x54')](_0xa83236[_0xbccb('0x50')])[_0xbccb('0x28')](respondWithResult(_0x1b3d75,0xc9))[_0xbccb('0x49')](handleError(_0x1b3d75,null));};exports['download']=function(_0x5cca5a,_0x5990a6,_0x54325e){return db['Attachment'][_0xbccb('0x59')]({'where':{'id':_0x5cca5a[_0xbccb('0x51')]['id']},'raw':!![]})[_0xbccb('0x28')](handleEntityNotFound(_0x5990a6,null))[_0xbccb('0x28')](function(_0x5c7675){if(_0x5c7675){var _0x38b618=_0x5c7675[_0xbccb('0x5a')]!==null;var _0x22a307=path[_0xbccb('0x5b')](config[_0xbccb('0x5c')],'server/files/attachments/');if(_0x38b618){_0x22a307=path[_0xbccb('0x5b')](_0x22a307,_0xbccb('0x5d'));}var _0x26a893=path['join'](_0x22a307,_0x5c7675['basename']);return _0x5990a6[_0xbccb('0x5e')](_0x26a893);}})['catch'](handleError(_0x5990a6,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index d79b742..483e204 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 _0x4ea1=['request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3e4f85,_0x545dba){var _0x4d4f94=function(_0x59ef74){while(--_0x59ef74){_0x3e4f85['push'](_0x3e4f85['shift']());}};_0x4d4f94(++_0x545dba);}(_0x4ea1,0x1c9));var _0x14ea=function(_0x146237,_0x54a9f4){_0x146237=_0x146237-0x0;var _0x736d1b=_0x4ea1[_0x146237];return _0x736d1b;};'use strict';var _=require(_0x14ea('0x0'));var util=require(_0x14ea('0x1'));var logger=require(_0x14ea('0x2'))('api');var moment=require(_0x14ea('0x3'));var BPromise=require(_0x14ea('0x4'));var rp=require(_0x14ea('0x5'));var fs=require('fs');var path=require(_0x14ea('0x6'));var rimraf=require(_0x14ea('0x7'));var config=require(_0x14ea('0x8'));var attributes=require(_0x14ea('0x9'));module[_0x14ea('0xa')]=function(_0x30b415,_0x421c59){return _0x30b415[_0x14ea('0xb')](_0x14ea('0xc'),attributes,{'tableName':_0x14ea('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ed7=['Attachment','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports'];(function(_0x354f55,_0x1b2923){var _0x223f6b=function(_0x3ece83){while(--_0x3ece83){_0x354f55['push'](_0x354f55['shift']());}};_0x223f6b(++_0x1b2923);}(_0x5ed7,0xd0));var _0x75ed=function(_0x2204b8,_0xed74f5){_0x2204b8=_0x2204b8-0x0;var _0x3bf14f=_0x5ed7[_0x2204b8];return _0x3bf14f;};'use strict';var _=require(_0x75ed('0x0'));var util=require('util');var logger=require(_0x75ed('0x1'))(_0x75ed('0x2'));var moment=require(_0x75ed('0x3'));var BPromise=require(_0x75ed('0x4'));var rp=require(_0x75ed('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75ed('0x6'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x75ed('0x7')]=function(_0x30c87d,_0x51ed1a){return _0x30c87d['define'](_0x75ed('0x8'),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 dfad147..c6843a2 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 _0x13c0=['message','result','catch','CreateAttachment','create','body','options','raw','then','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x55fb3d,_0x302b19){var _0x5671a7=function(_0x10aced){while(--_0x10aced){_0x55fb3d['push'](_0x55fb3d['shift']());}};_0x5671a7(++_0x302b19);}(_0x13c0,0x79));var _0x013c=function(_0x139ff6,_0xddca5){_0x139ff6=_0x139ff6-0x0;var _0x71b083=_0x13c0[_0x139ff6];return _0x71b083;};'use strict';var _=require(_0x013c('0x0'));var util=require(_0x013c('0x1'));var moment=require(_0x013c('0x2'));var BPromise=require(_0x013c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x013c('0x4'));var logger=require(_0x013c('0x5'))(_0x013c('0x6'));var config=require(_0x013c('0x7'));var jayson=require(_0x013c('0x8'));var client=jayson[_0x013c('0x9')][_0x013c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3decb5,_0x50caf2,_0x4cf99d){return new BPromise(function(_0x593053,_0x27c830){return client[_0x013c('0xb')](_0x3decb5,_0x4cf99d)['then'](function(_0x28c3a0){logger[_0x013c('0xc')](_0x013c('0xd'),_0x50caf2,_0x013c('0xe'));logger[_0x013c('0xf')](_0x013c('0x10'),_0x50caf2,_0x013c('0xe'),JSON[_0x013c('0x11')](_0x28c3a0));if(_0x28c3a0[_0x013c('0x12')]){if(_0x28c3a0[_0x013c('0x12')]['code']===0x1f4){logger['error'](_0x013c('0xd'),_0x50caf2,_0x28c3a0[_0x013c('0x12')][_0x013c('0x13')]);return _0x27c830(_0x28c3a0[_0x013c('0x12')]['message']);}logger[_0x013c('0x12')](_0x013c('0xd'),_0x50caf2,_0x28c3a0[_0x013c('0x12')][_0x013c('0x13')]);return _0x593053(_0x28c3a0[_0x013c('0x12')]['message']);}else{logger[_0x013c('0xc')](_0x013c('0xd'),_0x50caf2,_0x013c('0xe'));_0x593053(_0x28c3a0[_0x013c('0x14')][_0x013c('0x13')]);}})[_0x013c('0x15')](function(_0x6b8b5){logger[_0x013c('0x12')](_0x013c('0xd'),_0x50caf2,_0x6b8b5);_0x27c830(_0x6b8b5);});});}exports[_0x013c('0x16')]=function(_0x34d59f){var _0x4268cf=this;return new Promise(function(_0x25eb26,_0x5a9142){return db['Attachment'][_0x013c('0x17')](_0x34d59f[_0x013c('0x18')],{'raw':_0x34d59f['options']?_0x34d59f[_0x013c('0x19')][_0x013c('0x1a')]===undefined?!![]:![]:!![]})[_0x013c('0x1b')](function(_0x38bac2){logger[_0x013c('0xc')]('CreateAttachment',_0x34d59f);logger[_0x013c('0xf')](_0x013c('0x16'),_0x34d59f,JSON['stringify'](_0x38bac2));_0x25eb26(_0x38bac2);})[_0x013c('0x15')](function(_0x82f9f1){logger['error']('CreateAttachment',_0x82f9f1[_0x013c('0x13')],_0x34d59f);_0x5a9142(_0x4268cf[_0x013c('0x12')](0x1f4,_0x82f9f1[_0x013c('0x13')]));});});}; \ No newline at end of file +var _0xee39=['create','body','options','raw','then','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Attachment,\x20%s,\x20%s','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateAttachment','Attachment'];(function(_0x29806d,_0x296c13){var _0x3b8361=function(_0x58e84d){while(--_0x58e84d){_0x29806d['push'](_0x29806d['shift']());}};_0x3b8361(++_0x296c13);}(_0xee39,0x1e6));var _0x9ee3=function(_0x244e46,_0x5a2dd3){_0x244e46=_0x244e46-0x0;var _0x1bacd5=_0xee39[_0x244e46];return _0x1bacd5;};'use strict';var _=require(_0x9ee3('0x0'));var util=require(_0x9ee3('0x1'));var moment=require(_0x9ee3('0x2'));var BPromise=require('bluebird');var rs=require(_0x9ee3('0x3'));var fs=require('fs');var Redis=require(_0x9ee3('0x4'));var db=require(_0x9ee3('0x5'))['db'];var utils=require(_0x9ee3('0x6'));var logger=require(_0x9ee3('0x7'))(_0x9ee3('0x8'));var config=require(_0x9ee3('0x9'));var jayson=require(_0x9ee3('0xa'));var client=jayson[_0x9ee3('0xb')][_0x9ee3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4dc1eb,_0x10e9e6,_0x22264c){return new BPromise(function(_0x22c8fc,_0x4d1a57){return client[_0x9ee3('0xd')](_0x4dc1eb,_0x22264c)['then'](function(_0x1bde67){logger['info'](_0x9ee3('0xe'),_0x10e9e6,'request\x20sent');logger['debug'](_0x9ee3('0xf'),_0x10e9e6,'request\x20sent',JSON[_0x9ee3('0x10')](_0x1bde67));if(_0x1bde67['error']){if(_0x1bde67[_0x9ee3('0x11')][_0x9ee3('0x12')]===0x1f4){logger[_0x9ee3('0x11')](_0x9ee3('0xe'),_0x10e9e6,_0x1bde67[_0x9ee3('0x11')][_0x9ee3('0x13')]);return _0x4d1a57(_0x1bde67[_0x9ee3('0x11')]['message']);}logger[_0x9ee3('0x11')](_0x9ee3('0xe'),_0x10e9e6,_0x1bde67[_0x9ee3('0x11')]['message']);return _0x22c8fc(_0x1bde67[_0x9ee3('0x11')][_0x9ee3('0x13')]);}else{logger[_0x9ee3('0x14')](_0x9ee3('0xe'),_0x10e9e6,'request\x20sent');_0x22c8fc(_0x1bde67['result'][_0x9ee3('0x13')]);}})[_0x9ee3('0x15')](function(_0x456bf7){logger[_0x9ee3('0x11')](_0x9ee3('0xe'),_0x10e9e6,_0x456bf7);_0x4d1a57(_0x456bf7);});});}exports[_0x9ee3('0x16')]=function(_0x4a0de5){var _0x4a987a=this;return new Promise(function(_0x1f937f,_0x1342e2){return db[_0x9ee3('0x17')][_0x9ee3('0x18')](_0x4a0de5[_0x9ee3('0x19')],{'raw':_0x4a0de5[_0x9ee3('0x1a')]?_0x4a0de5[_0x9ee3('0x1a')][_0x9ee3('0x1b')]===undefined?!![]:![]:!![]})[_0x9ee3('0x1c')](function(_0x80671d){logger['info'](_0x9ee3('0x16'),_0x4a0de5);logger[_0x9ee3('0x1d')](_0x9ee3('0x16'),_0x4a0de5,JSON[_0x9ee3('0x10')](_0x80671d));_0x1f937f(_0x80671d);})[_0x9ee3('0x15')](function(_0x44bc5a){logger['error'](_0x9ee3('0x16'),_0x44bc5a[_0x9ee3('0x13')],_0x4a0de5);_0x1342e2(_0x4a987a[_0x9ee3('0x11')](0x1f4,_0x44bc5a[_0x9ee3('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index d291d94..2e2a58d 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(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5b47d9,_0x1327ce){_0x5b47d9=_0x5b47d9-0x0;var _0x4151f0=_0x0b0e[_0x5b47d9];return _0x4151f0;};'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(_0xa7075c,_0x49eae0){var _0x5ca75f=function(_0x2f7982){while(--_0x2f7982){_0xa7075c['push'](_0xa7075c['shift']());}};_0x5ca75f(++_0x49eae0);}(_0xb10b,0x12a));var _0xbb10=function(_0x1eb4e0,_0x4ebc2d){_0x1eb4e0=_0x1eb4e0-0x0;var _0x18ec21=_0xb10b[_0x1eb4e0];return _0x18ec21;};'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 c83f7f8..78caf2d 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 _0x5c89=['admin','user','agent','disabled','blockDuration','add','minutes','clearBlockUser','getLicense','catch','status','send','message','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','use','ad-login','passport','passport-local','Strategy','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','role','blocked','blockedAt'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x5c89,0x182));var _0x95c8=function(_0x1b2454,_0x6b04ad){_0x1b2454=_0x1b2454-0x0;var _0x13a165=_0x5c89[_0x1b2454];return _0x13a165;};'use strict';var passport=require(_0x95c8('0x0'));var LocalStrategy=require(_0x95c8('0x1'))[_0x95c8('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require('bluebird');var util=require('util');var db=require(_0x95c8('0x3'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x95c8('0x4'));var config=require(_0x95c8('0x5'));var logger=require(_0x95c8('0x6'))(_0x95c8('0x7'));function isActiveDirectoryConfigured(_0x39831e){var _0x1ca32b=![];if(typeof _0x39831e[_0x95c8('0x8')]!==_0x95c8('0x9')){_0x1ca32b=_0x39831e[_0x95c8('0x8')][_0x95c8('0xa')]&&_0x39831e['activedirectory'][_0x95c8('0xb')]&&_0x39831e['activedirectory'][_0x95c8('0xc')];}return _0x1ca32b;}function adAuthenticate(_0x3db4c3,_0x118fbd,_0x297ba7){return new BPromise(function(_0x461743,_0x40be94){try{var _0x58dace=new ActiveDirectory(_0x3db4c3);_0x58dace[_0x95c8('0xd')](_0x118fbd,_0x297ba7,function(_0x4eb414,_0x17b731){if(_0x4eb414){logger[_0x95c8('0xe')](_0x95c8('0xf'),_0x118fbd,util['inspect'](_0x4eb414,{'showHidden':![],'depth':null}));_0x40be94(_0x95c8('0x10'));}else if(!_0x17b731){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x118fbd);_0x40be94('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x461743(_0x17b731);}});}catch(_0x59109f){_0x40be94(_0x59109f);}});}function ActiveDirectoryAuthenticate(_0x259511,_0x5b5657,_0x5bdcc2,_0x4c472c){var _0x1bb2c0,_0x288c76;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x95c8('0x11'),_0x5b5657);return _0x4c472c(null,![],{'message':_0x95c8('0x10')});}return db[_0x95c8('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0x95c8('0x13'),'blockDuration'],'raw':!![]})[_0x95c8('0x14')](function(_0x18f73c){_0x1bb2c0=_0x18f73c;if(!_0x1bb2c0[_0x95c8('0x13')]){logger[_0x95c8('0xe')](_0x95c8('0x15'),_0x5b5657);throw new Error(_0x95c8('0x10'));}return _0x259511[_0x95c8('0x16')]({'attributes':['id',_0x95c8('0x17'),_0x95c8('0x18'),'salt',_0x95c8('0x19'),'disabled',_0x95c8('0x1a'),_0x95c8('0x1b'),'online'],'where':{'name':_0x5b5657,'role':{'$or':[_0x95c8('0x1c'),_0x95c8('0x1d'),_0x95c8('0x1e')]},'adSsoEnabled':!![]}});})[_0x95c8('0x14')](function(_0x4c759f){if(!_0x4c759f||_0x4c759f&&_0x4c759f[_0x95c8('0x17')]!==_0x5b5657){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x288c76=_0x4c759f;var _0x2f6036=_0x288c76[_0x95c8('0x17')]+'@'+config[_0x95c8('0x8')]['domain'];return adAuthenticate(config[_0x95c8('0x8')],_0x2f6036,_0x5bdcc2);})[_0x95c8('0x14')](function(_0x4e6192){if(_0x288c76[_0x95c8('0x1f')]){throw new Error(_0x95c8('0x10'));}if(_0x1bb2c0[_0x95c8('0x20')]>0x0){if(_0x288c76[_0x95c8('0x1a')]){if(moment(_0x288c76['blockedAt'])[_0x95c8('0x21')](_0x1bb2c0[_0x95c8('0x20')],_0x95c8('0x22'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x95c8('0x23')](_0x288c76,0x0,![],null)[_0x95c8('0x14')](function(){return utils[_0x95c8('0x24')](_0x288c76);})['then'](function(){return _0x4c472c(null,_0x288c76);});}else{return utils[_0x95c8('0x24')](_0x288c76)[_0x95c8('0x14')](function(){return _0x4c472c(null,_0x288c76);});}}else{return utils[_0x95c8('0x24')](_0x288c76)['then'](function(){return _0x4c472c(null,_0x288c76);});}})[_0x95c8('0x25')](function(_0x5a93ba){return _0x4c472c(null,![],_0x5a93ba);});}function handleError(_0x1b45a5,_0x441532,_0x34ce77){return _0x1b45a5[_0x95c8('0x26')](_0x441532||0x1f4)[_0x95c8('0x27')]({'message':_0x34ce77?_0x34ce77[_0x95c8('0x28')]||_0x34ce77:''});}exports['login']=function(_0x369f2a,_0x870066,_0x311ca9){passport[_0x95c8('0xd')]('ad-login',function(_0x39fdbc,_0x4d7340,_0x4d76ed){var _0x2e8abd=_0x39fdbc||_0x4d76ed;if(_0x2e8abd){return handleError(_0x870066,0x191,_0x2e8abd);}if(!_0x4d7340){return handleError(_0x870066,0x194,{'message':_0x95c8('0x29')});}else{var _0x16c2a4={'payload':{'id':_0x4d7340['id'],'role':_0x4d7340[_0x95c8('0x19')]},'options':{'expiresIn':0x15180}};return authService[_0x95c8('0x2a')](_0x16c2a4)[_0x95c8('0x14')](function(_0x2fcd3d){_0x870066['json']({'id':_0x4d7340['id'],'token':_0x2fcd3d,'statusCall':'','isAlreadyLogged':_0x4d7340[_0x95c8('0x2b')]});});}})(_0x369f2a,_0x870066,_0x311ca9);};passport[_0x95c8('0x2c')](_0x95c8('0x2d'),new LocalStrategy({'usernameField':_0x95c8('0x17'),'passwordField':_0x95c8('0x18')},function(_0x2e658b,_0x1de48c,_0x33dacc){return ActiveDirectoryAuthenticate(db['User'],_0x2e658b,_0x1de48c,_0x33dacc);})); \ No newline at end of file +var _0x9d94=['activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','undefined','activedirectory','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','admin','user','add','minutes','clearBlockUser','getLicense','send','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','use','User','passport','Strategy'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x9d94,0x11e));var _0x49d9=function(_0x56a77e,_0x5f2d5d){_0x56a77e=_0x56a77e-0x0;var _0x2eca06=_0x9d94[_0x56a77e];return _0x2eca06;};'use strict';var passport=require(_0x49d9('0x0'));var LocalStrategy=require('passport-local')[_0x49d9('0x1')];var moment=require('moment');var ActiveDirectory=require(_0x49d9('0x2'));var BPromise=require(_0x49d9('0x3'));var util=require(_0x49d9('0x4'));var db=require(_0x49d9('0x5'))['db'];var authService=require(_0x49d9('0x6'));var utils=require(_0x49d9('0x7'));var config=require(_0x49d9('0x8'));var logger=require(_0x49d9('0x9'))('api');function isActiveDirectoryConfigured(_0x385571){var _0x25a172=![];if(typeof _0x385571['activedirectory']!==_0x49d9('0xa')){_0x25a172=_0x385571[_0x49d9('0xb')][_0x49d9('0xc')]&&_0x385571[_0x49d9('0xb')]['url']&&_0x385571[_0x49d9('0xb')][_0x49d9('0xd')];}return _0x25a172;}function adAuthenticate(_0x4efc8f,_0x590cb3,_0x508230){return new BPromise(function(_0x2950f9,_0x1ac297){try{var _0x336edc=new ActiveDirectory(_0x4efc8f);_0x336edc['authenticate'](_0x590cb3,_0x508230,function(_0x148966,_0x1bbe29){if(_0x148966){logger[_0x49d9('0xe')](_0x49d9('0xf'),_0x590cb3,util[_0x49d9('0x10')](_0x148966,{'showHidden':![],'depth':null}));_0x1ac297(_0x49d9('0x11'));}else if(!_0x1bbe29){logger['error'](_0x49d9('0x12'),_0x590cb3);_0x1ac297(_0x49d9('0x11'));}else{_0x2950f9(_0x1bbe29);}});}catch(_0x5aa85d){_0x1ac297(_0x5aa85d);}});}function ActiveDirectoryAuthenticate(_0x19e258,_0x2254cf,_0x1e4c49,_0x128a37){var _0x1dc822,_0x8d1b1f;if(!isActiveDirectoryConfigured(config)){logger[_0x49d9('0xe')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x2254cf);return _0x128a37(null,![],{'message':_0x49d9('0x11')});}return db['Setting'][_0x49d9('0x13')]({'where':{'id':0x1},'attributes':[_0x49d9('0x14'),_0x49d9('0x15')],'raw':!![]})[_0x49d9('0x16')](function(_0x238022){_0x1dc822=_0x238022;if(!_0x1dc822['adSsoEnabled']){logger[_0x49d9('0xe')](_0x49d9('0x17'),_0x2254cf);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x19e258[_0x49d9('0x13')]({'attributes':['id',_0x49d9('0x18'),_0x49d9('0x19'),_0x49d9('0x1a'),_0x49d9('0x1b'),_0x49d9('0x1c'),_0x49d9('0x1d'),_0x49d9('0x1e'),'online'],'where':{'name':_0x2254cf,'role':{'$or':[_0x49d9('0x1f'),_0x49d9('0x20'),'agent']},'adSsoEnabled':!![]}});})[_0x49d9('0x16')](function(_0x47291a){if(!_0x47291a||_0x47291a&&_0x47291a['name']!==_0x2254cf){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x8d1b1f=_0x47291a;var _0x11497a=_0x8d1b1f[_0x49d9('0x18')]+'@'+config[_0x49d9('0xb')][_0x49d9('0xd')];return adAuthenticate(config['activedirectory'],_0x11497a,_0x1e4c49);})[_0x49d9('0x16')](function(_0x4b8fbf){if(_0x8d1b1f[_0x49d9('0x1c')]){throw new Error(_0x49d9('0x11'));}if(_0x1dc822[_0x49d9('0x15')]>0x0){if(_0x8d1b1f[_0x49d9('0x1d')]){if(moment(_0x8d1b1f[_0x49d9('0x1e')])[_0x49d9('0x21')](_0x1dc822[_0x49d9('0x15')],_0x49d9('0x22'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x49d9('0x23')](_0x8d1b1f,0x0,![],null)[_0x49d9('0x16')](function(){return utils['getLicense'](_0x8d1b1f);})[_0x49d9('0x16')](function(){return _0x128a37(null,_0x8d1b1f);});}else{return utils['getLicense'](_0x8d1b1f)[_0x49d9('0x16')](function(){return _0x128a37(null,_0x8d1b1f);});}}else{return utils[_0x49d9('0x24')](_0x8d1b1f)[_0x49d9('0x16')](function(){return _0x128a37(null,_0x8d1b1f);});}})['catch'](function(_0x33cff8){return _0x128a37(null,![],_0x33cff8);});}function handleError(_0x574fc0,_0x2af378,_0x599bb3){return _0x574fc0['status'](_0x2af378||0x1f4)[_0x49d9('0x25')]({'message':_0x599bb3?_0x599bb3[_0x49d9('0x26')]||_0x599bb3:''});}exports[_0x49d9('0x27')]=function(_0x1f87d5,_0x9db538,_0x5e4ee5){passport[_0x49d9('0x28')](_0x49d9('0x29'),function(_0x33dbbb,_0x1c527d,_0x5448cd){var _0x3afe6f=_0x33dbbb||_0x5448cd;if(_0x3afe6f){return handleError(_0x9db538,0x191,_0x3afe6f);}if(!_0x1c527d){return handleError(_0x9db538,0x194,{'message':_0x49d9('0x2a')});}else{var _0x471499={'payload':{'id':_0x1c527d['id'],'role':_0x1c527d[_0x49d9('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0x49d9('0x2b')](_0x471499)[_0x49d9('0x16')](function(_0x222385){_0x9db538[_0x49d9('0x2c')]({'id':_0x1c527d['id'],'token':_0x222385,'statusCall':'','isAlreadyLogged':_0x1c527d[_0x49d9('0x2d')]});});}})(_0x1f87d5,_0x9db538,_0x5e4ee5);};passport[_0x49d9('0x2e')]('ad-login',new LocalStrategy({'usernameField':_0x49d9('0x18'),'passwordField':_0x49d9('0x19')},function(_0x43d975,_0x45faf6,_0x52dd4){return ActiveDirectoryAuthenticate(db[_0x49d9('0x2f')],_0x43d975,_0x45faf6,_0x52dd4);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 902e7d0..f246e34 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 _0x7fef=['Router','post','login','exports'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x7fef,0x6c));var _0xf7fe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7fef[_0x321bb2];return _0x9c12ed;};'use strict';var express=require('express');var router=express[_0xf7fe('0x0')]();var controller=require('./authActiveDirectory.controller');router[_0xf7fe('0x1')]('/',controller[_0xf7fe('0x2')]);module[_0xf7fe('0x3')]=router; \ No newline at end of file +var _0x3bb2=['Router','./authActiveDirectory.controller','login','express'];(function(_0x454cee,_0x47a520){var _0x12e884=function(_0x50d5b7){while(--_0x50d5b7){_0x454cee['push'](_0x454cee['shift']());}};_0x12e884(++_0x47a520);}(_0x3bb2,0xd7));var _0x23bb=function(_0x3ef525,_0xe12832){_0x3ef525=_0x3ef525-0x0;var _0xcb28b0=_0x3bb2[_0x3ef525];return _0xcb28b0;};'use strict';var express=require(_0x23bb('0x0'));var router=express[_0x23bb('0x1')]();var controller=require(_0x23bb('0x2'));router['post']('/',controller[_0x23bb('0x3')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 9ffb5ff..89b0d23 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(_0x4a8563,_0x519be5){var _0x1e66cb=function(_0x3f1250){while(--_0x3f1250){_0x4a8563['push'](_0x4a8563['shift']());}};_0x1e66cb(++_0x519be5);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 _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(_0x1d64b0,_0x4d4725){var _0x28fd02=function(_0x137968){while(--_0x137968){_0x1d64b0['push'](_0x1d64b0['shift']());}};_0x28fd02(++_0x4d4725);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 9809717..3fc3ad6 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 _0xf7fc=['isMiddleware','exports','express','Router','./authGoogle.controller','../../components/auth/service','login','get','callback'];(function(_0x94b526,_0x411024){var _0x116aa8=function(_0x5b459f){while(--_0x5b459f){_0x94b526['push'](_0x94b526['shift']());}};_0x116aa8(++_0x411024);}(_0xf7fc,0x92));var _0xcf7f=function(_0xd9eff2,_0x44c28d){_0xd9eff2=_0xd9eff2-0x0;var _0x35c947=_0xf7fc[_0xd9eff2];return _0x35c947;};'use strict';var express=require(_0xcf7f('0x0'));var passport=require('passport');var router=express[_0xcf7f('0x1')]();var controller=require(_0xcf7f('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0xcf7f('0x3'));router['get']('/',controller[_0xcf7f('0x4')]);router[_0xcf7f('0x5')]('/callback',controller[_0xcf7f('0x6')],authService[_0xcf7f('0x7')],userController[_0xcf7f('0x4')],authService['setTokenCookie']);module[_0xcf7f('0x8')]=router; \ No newline at end of file +var _0x4e92=['../../components/auth/service','get','login','/callback','callback','setTokenCookie','exports','express','passport','../user/user.controller.js'];(function(_0x5ca5d1,_0x2c27f1){var _0x89feb8=function(_0x4d9eed){while(--_0x4d9eed){_0x5ca5d1['push'](_0x5ca5d1['shift']());}};_0x89feb8(++_0x2c27f1);}(_0x4e92,0xed));var _0x24e9=function(_0x434903,_0x2bae84){_0x434903=_0x434903-0x0;var _0x31021e=_0x4e92[_0x434903];return _0x31021e;};'use strict';var express=require(_0x24e9('0x0'));var passport=require(_0x24e9('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0x24e9('0x2'));var authService=require(_0x24e9('0x3'));router[_0x24e9('0x4')]('/',controller[_0x24e9('0x5')]);router['get'](_0x24e9('0x6'),controller[_0x24e9('0x7')],authService['isMiddleware'],userController['login'],authService[_0x24e9('0x8')]);module[_0x24e9('0x9')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index c2a5c08..9288ffe 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 _0x7dd2=['error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','authenticate','local-login','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','findOne','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','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','https://','/reset/','reset','User','find','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','blockDuration','then','name','password','role','disabled','blocked','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','minutes','clearBlockUser','allowedLoginAttempts','getLicense','catch','MailAccount','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','request'];(function(_0x507901,_0x58b9f8){var _0x1aced2=function(_0x40e8dd){while(--_0x40e8dd){_0x507901['push'](_0x507901['shift']());}};_0x1aced2(++_0x58b9f8);}(_0x7dd2,0x11d));var _0x27dd=function(_0x4b55a2,_0x1559ce){_0x4b55a2=_0x4b55a2-0x0;var _0x11d72a=_0x7dd2[_0x4b55a2];return _0x11d72a;};'use strict';var util=require(_0x27dd('0x0'));var passport=require(_0x27dd('0x1'));var LocalStrategy=require(_0x27dd('0x2'))[_0x27dd('0x3')];var jayson=require(_0x27dd('0x4'));var _=require(_0x27dd('0x5'));var rs=require(_0x27dd('0x6'));var moment=require(_0x27dd('0x7'));var db=require(_0x27dd('0x8'))['db'];var authService=require(_0x27dd('0x9'));var utils=require(_0x27dd('0xa'));var client=jayson[_0x27dd('0xb')][_0x27dd('0xc')]({'port':0x232b});function localAuthenticate(_0x3bbefe,_0x296864,_0x3ebe72,_0x1c5c00){var _0x1b5832,_0x1fd241;return db[_0x27dd('0xd')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x27dd('0xe')],'raw':!![]})[_0x27dd('0xf')](function(_0x38575e){_0x1b5832=_0x38575e;return _0x3bbefe['findOne']({'attributes':['id',_0x27dd('0x10'),_0x27dd('0x11'),'salt',_0x27dd('0x12'),_0x27dd('0x13'),_0x27dd('0x14'),'blockedAt',_0x27dd('0x15')],'where':{'name':_0x296864,'role':{'$or':[_0x27dd('0x16'),_0x27dd('0x17'),_0x27dd('0x18')]}}});})[_0x27dd('0xf')](function(_0x218270){if(!_0x218270||_0x218270&&_0x218270[_0x27dd('0x10')]!==_0x296864){throw new Error(_0x27dd('0x19'));}else{_0x1fd241=_0x218270;return _0x1fd241;}})[_0x27dd('0xf')](function(){_0x1fd241['authenticate'](_0x3ebe72,function(_0x1a8442,_0x3bfa75){var _0x590add=_0x1fd241[_0x27dd('0x15')]+0x1;if(_0x1a8442){return _0x1c5c00(_0x1a8442);}else if(!_0x3bfa75){if(_0x1fd241[_0x27dd('0x13')]){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}else if(_0x1b5832['allowedLoginAttempts']>0x0){if(_0x1fd241[_0x27dd('0x14')]){if(_0x1b5832[_0x27dd('0xe')]>0x0){if(moment(_0x1fd241[_0x27dd('0x1a')])[_0x27dd('0x1b')](_0x1b5832['blockDuration'],_0x27dd('0x1c'))>moment()){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}else{return utils[_0x27dd('0x1d')](_0x1fd241,_0x590add,![],null)[_0x27dd('0xf')](function(){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});});}}else{return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}}else{if(_0x590add>=_0x1b5832['allowedLoginAttempts']){return utils['clearBlockUser'](_0x1fd241,0x0,!![],moment())[_0x27dd('0xf')](function(){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});});}else{return utils[_0x27dd('0x1d')](_0x1fd241,_0x590add,![],null)[_0x27dd('0xf')](function(){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});});}}}else{return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}}else{if(_0x1fd241[_0x27dd('0x13')]){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}else if(_0x1b5832[_0x27dd('0x1e')]>0x0){if(_0x1fd241['blocked']){if(_0x1b5832[_0x27dd('0xe')]>0x0){if(moment(_0x1fd241['blockedAt'])[_0x27dd('0x1b')](_0x1b5832[_0x27dd('0xe')],_0x27dd('0x1c'))>moment()){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}else{return utils[_0x27dd('0x1d')](_0x1fd241,0x0,![],null)['then'](function(){return utils[_0x27dd('0x1f')](_0x1fd241);})[_0x27dd('0xf')](function(){return _0x1c5c00(null,_0x1fd241);});}}else{return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}}else{return utils['clearBlockUser'](_0x1fd241,0x0,![],null)[_0x27dd('0xf')](function(){return utils['getLicense'](_0x1fd241);})[_0x27dd('0xf')](function(){return _0x1c5c00(null,_0x1fd241);})[_0x27dd('0x20')](function(_0x4f6feb){return _0x1c5c00(null,![],_0x4f6feb);});}}else{if(_0x1fd241[_0x27dd('0x14')]){return _0x1c5c00(null,![],{'message':_0x27dd('0x19')});}else{return utils[_0x27dd('0x1f')](_0x1fd241)[_0x27dd('0xf')](function(){return _0x1c5c00(null,_0x1fd241);});}}}});})[_0x27dd('0x20')](function(_0x103ca6){return _0x1c5c00(null,![],_0x103ca6);});}function sendServiceMail(_0x167c79){return db[_0x27dd('0x21')]['find']({'where':{'service':!![]},'attributes':['id',_0x27dd('0x10'),_0x27dd('0x22')],'include':[{'model':db[_0x27dd('0x23')],'as':_0x27dd('0x24'),'include':[{'model':db[_0x27dd('0x25')],'as':'CloudProvider'}]}]})['then'](function(_0x4d9b46){if(!_0x4d9b46){throw new Error(_0x27dd('0x26'));}var _0x35e3e4=_0x4d9b46[_0x27dd('0x27')]();var _0x456f5c={'account':_0x35e3e4,'message':_['merge']({'from':util[_0x27dd('0x28')](_0x27dd('0x29'),_0x4d9b46[_0x27dd('0x10')],_0x4d9b46['email']||_0x4d9b46[_0x27dd('0x24')][_0x27dd('0x17')])},_0x167c79)};return client[_0x27dd('0x2a')]('SendMail',_0x456f5c);})[_0x27dd('0xf')](function(_0x3d0377){if(_0x3d0377[_0x27dd('0x2b')]){throw new Error(util['format'](_0x27dd('0x2c'),_0x3d0377['error'][_0x27dd('0x2d')]||JSON[_0x27dd('0x2e')](_0x3d0377['error'])));}return!![];});}function handleError(_0x331c77,_0x36ad10,_0x2e87e1){return _0x331c77[_0x27dd('0x2f')](_0x36ad10||0x1f4)[_0x27dd('0x30')]({'message':_0x2e87e1?_0x2e87e1[_0x27dd('0x2d')]||_0x2e87e1:''});}exports[_0x27dd('0x31')]=function(_0x158726,_0x4872f7,_0x16761c){passport[_0x27dd('0x32')](_0x27dd('0x33'),function(_0x563554,_0x34930a,_0x11d7e9){var _0x5203e4=_0x563554||_0x11d7e9;if(_0x5203e4){return handleError(_0x4872f7,0x191,_0x5203e4);}if(!_0x34930a){return handleError(_0x4872f7,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x467bbf={'payload':{'id':_0x34930a['id'],'role':_0x34930a['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x467bbf)[_0x27dd('0xf')](function(_0x203b58){_0x4872f7[_0x27dd('0x34')]({'id':_0x34930a['id'],'token':_0x203b58,'statusCall':'','isAlreadyLogged':_0x34930a[_0x27dd('0x35')]});});}})(_0x158726,_0x4872f7,_0x16761c);};exports[_0x27dd('0x36')]=function(_0x348a50,_0x42445f){if(!_0x348a50[_0x27dd('0x37')][_0x27dd('0x22')]){return handleError(_0x42445f,0x1f4,{'message':_0x27dd('0x38')});}var _0x2f643f=rs[_0x27dd('0x39')]();_0x348a50[_0x27dd('0x37')]['email']=_0x348a50[_0x27dd('0x37')][_0x27dd('0x22')][_0x27dd('0x3a')]()[_0x27dd('0x3b')]();var _0x18b332;return db[_0x27dd('0xd')][_0x27dd('0x3c')]({'where':{'id':0x1},'attributes':[_0x27dd('0x1e'),_0x27dd('0xe')],'raw':!![]})[_0x27dd('0xf')](function(_0x27842a){_0x18b332=_0x27842a;return db['User']['find']({'where':{'email':_0x348a50[_0x27dd('0x37')][_0x27dd('0x22')]}});})[_0x27dd('0xf')](function(_0x51cba5){if(!_0x51cba5){throw new Error(_0x27dd('0x3d'));}if(_0x51cba5[_0x27dd('0x13')]){throw new Error(_0x27dd('0x3e'));}if(_0x51cba5[_0x27dd('0x14')]){if(moment(_0x51cba5[_0x27dd('0x1a')])[_0x27dd('0x1b')](_0x18b332[_0x27dd('0xe')],_0x27dd('0x1c'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x51cba5[_0x27dd('0x14')]=![];_0x51cba5[_0x27dd('0x1a')]=null;}}_0x51cba5[_0x27dd('0x3f')]=_0x2f643f;_0x51cba5[_0x27dd('0x40')]=Date['now']()+0x36ee80;return _0x51cba5[_0x27dd('0x41')]();})[_0x27dd('0xf')](function(){return sendServiceMail({'to':_0x348a50[_0x27dd('0x37')][_0x27dd('0x22')],'subject':_0x27dd('0x42'),'text':_0x27dd('0x43')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x27dd('0x44')+_0x348a50['headers']['host']+_0x27dd('0x45')+_0x2f643f+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x27dd('0xf')](function(){_0x42445f[_0x27dd('0x2f')](0xc8)[_0x27dd('0x30')]({'message':'Reset\x20Email\x20sent!'});})[_0x27dd('0x20')](function(_0x35f404){return handleError(_0x42445f,0x1f4,_0x35f404);});};exports[_0x27dd('0x46')]=function(_0x2d22e3,_0x13d17a){return db[_0x27dd('0x47')][_0x27dd('0x48')]({'where':{'resetPasswordToken':_0x2d22e3['params'][_0x27dd('0x49')],'resetPasswordExpires':{'$gt':Date[_0x27dd('0x4a')]()}}})[_0x27dd('0xf')](function(_0x113446){if(!_0x113446){throw new Error(_0x27dd('0x4b'));}return db[_0x27dd('0xd')][_0x27dd('0x3c')]({'attributes':['id',_0x27dd('0x4c'),_0x27dd('0x4d'),_0x27dd('0x4e')]})[_0x27dd('0xf')](function(_0xf4ae9c){if(_0xf4ae9c['securePassword'])authService[_0x27dd('0x4f')](_0x2d22e3[_0x27dd('0x37')][_0x27dd('0x11')]);if(!_0xf4ae9c[_0x27dd('0x4d')]||!_0x113446[_0x27dd('0x50')])return _0x113446;authService[_0x27dd('0x51')](_0x2d22e3[_0x27dd('0x37')][_0x27dd('0x11')],_0x113446['previousPasswords'],_0xf4ae9c[_0x27dd('0x4e')]);return _0x113446;})[_0x27dd('0xf')](function(){_0x113446[_0x27dd('0x11')]=_0x2d22e3[_0x27dd('0x37')]['password'];_0x113446[_0x27dd('0x3f')]=null;_0x113446[_0x27dd('0x40')]=null;return _0x113446[_0x27dd('0x41')]();});})[_0x27dd('0xf')](function(){_0x13d17a[_0x27dd('0x2f')](0xc8)['send']({'message':'Password\x20reset!'});})['catch'](function(_0x4ff33d){return handleError(_0x13d17a,0x1f4,_0x4ff33d);});};passport['use'](_0x27dd('0x33'),new LocalStrategy({'usernameField':_0x27dd('0x10'),'passwordField':'password'},function(_0x2b6359,_0x14b47a,_0x23804e){return localAuthenticate(db[_0x27dd('0x47')],_0x2b6359,_0x14b47a,_0x23804e);})); \ No newline at end of file +var _0x616e=['now','save','body','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','host','/reset/','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','use','util','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','blockDuration','then','name','password','salt','role','blockedAt','loginAttempts','admin','user','agent','authenticate','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blocked','minutes','clearBlockUser','add','getLicense','catch','MailAccount','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','message','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken'];(function(_0x1b5b4e,_0x14bbd9){var _0x3f4ff4=function(_0x2973a6){while(--_0x2973a6){_0x1b5b4e['push'](_0x1b5b4e['shift']());}};_0x3f4ff4(++_0x14bbd9);}(_0x616e,0x111));var _0xe616=function(_0x1ca890,_0x21d0d3){_0x1ca890=_0x1ca890-0x0;var _0x3f8e01=_0x616e[_0x1ca890];return _0x3f8e01;};'use strict';var util=require(_0xe616('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0xe616('0x1')];var jayson=require(_0xe616('0x2'));var _=require('lodash');var rs=require(_0xe616('0x3'));var moment=require(_0xe616('0x4'));var db=require(_0xe616('0x5'))['db'];var authService=require(_0xe616('0x6'));var utils=require(_0xe616('0x7'));var client=jayson[_0xe616('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x4052c6,_0xad3a8,_0x359cc8,_0x2b75dc){var _0x37cdf7,_0x176998;return db[_0xe616('0x9')][_0xe616('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xe616('0xb')],'raw':!![]})[_0xe616('0xc')](function(_0x4cf55e){_0x37cdf7=_0x4cf55e;return _0x4052c6['findOne']({'attributes':['id',_0xe616('0xd'),_0xe616('0xe'),_0xe616('0xf'),_0xe616('0x10'),'disabled','blocked',_0xe616('0x11'),_0xe616('0x12')],'where':{'name':_0xad3a8,'role':{'$or':[_0xe616('0x13'),_0xe616('0x14'),_0xe616('0x15')]}}});})[_0xe616('0xc')](function(_0x50753d){if(!_0x50753d||_0x50753d&&_0x50753d[_0xe616('0xd')]!==_0xad3a8){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x176998=_0x50753d;return _0x176998;}})[_0xe616('0xc')](function(){_0x176998[_0xe616('0x16')](_0x359cc8,function(_0x9c9e77,_0xbd9f6){var _0x42bdb0=_0x176998['loginAttempts']+0x1;if(_0x9c9e77){return _0x2b75dc(_0x9c9e77);}else if(!_0xbd9f6){if(_0x176998[_0xe616('0x17')]){return _0x2b75dc(null,![],{'message':_0xe616('0x18')});}else if(_0x37cdf7[_0xe616('0x19')]>0x0){if(_0x176998[_0xe616('0x1a')]){if(_0x37cdf7[_0xe616('0xb')]>0x0){if(moment(_0x176998[_0xe616('0x11')])['add'](_0x37cdf7[_0xe616('0xb')],_0xe616('0x1b'))>moment()){return _0x2b75dc(null,![],{'message':_0xe616('0x18')});}else{return utils[_0xe616('0x1c')](_0x176998,_0x42bdb0,![],null)[_0xe616('0xc')](function(){return _0x2b75dc(null,![],{'message':_0xe616('0x18')});});}}else{return _0x2b75dc(null,![],{'message':_0xe616('0x18')});}}else{if(_0x42bdb0>=_0x37cdf7[_0xe616('0x19')]){return utils[_0xe616('0x1c')](_0x176998,0x0,!![],moment())[_0xe616('0xc')](function(){return _0x2b75dc(null,![],{'message':_0xe616('0x18')});});}else{return utils['clearBlockUser'](_0x176998,_0x42bdb0,![],null)[_0xe616('0xc')](function(){return _0x2b75dc(null,![],{'message':_0xe616('0x18')});});}}}else{return _0x2b75dc(null,![],{'message':_0xe616('0x18')});}}else{if(_0x176998[_0xe616('0x17')]){return _0x2b75dc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x37cdf7[_0xe616('0x19')]>0x0){if(_0x176998['blocked']){if(_0x37cdf7['blockDuration']>0x0){if(moment(_0x176998[_0xe616('0x11')])[_0xe616('0x1d')](_0x37cdf7[_0xe616('0xb')],_0xe616('0x1b'))>moment()){return _0x2b75dc(null,![],{'message':_0xe616('0x18')});}else{return utils[_0xe616('0x1c')](_0x176998,0x0,![],null)[_0xe616('0xc')](function(){return utils[_0xe616('0x1e')](_0x176998);})['then'](function(){return _0x2b75dc(null,_0x176998);});}}else{return _0x2b75dc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x176998,0x0,![],null)[_0xe616('0xc')](function(){return utils[_0xe616('0x1e')](_0x176998);})[_0xe616('0xc')](function(){return _0x2b75dc(null,_0x176998);})[_0xe616('0x1f')](function(_0x379321){return _0x2b75dc(null,![],_0x379321);});}}else{if(_0x176998[_0xe616('0x1a')]){return _0x2b75dc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xe616('0x1e')](_0x176998)[_0xe616('0xc')](function(){return _0x2b75dc(null,_0x176998);});}}}});})['catch'](function(_0x1b0c3c){return _0x2b75dc(null,![],_0x1b0c3c);});}function sendServiceMail(_0x43f46a){return db[_0xe616('0x20')]['find']({'where':{'service':!![]},'attributes':['id',_0xe616('0xd'),_0xe616('0x21')],'include':[{'model':db[_0xe616('0x22')],'as':_0xe616('0x23'),'include':[{'model':db['CloudProvider'],'as':_0xe616('0x24')}]}]})['then'](function(_0x3e5cea){if(!_0x3e5cea){throw new Error(_0xe616('0x25'));}var _0x18402c=_0x3e5cea[_0xe616('0x26')]();var _0x278d59={'account':_0x18402c,'message':_[_0xe616('0x27')]({'from':util[_0xe616('0x28')](_0xe616('0x29'),_0x3e5cea[_0xe616('0xd')],_0x3e5cea[_0xe616('0x21')]||_0x3e5cea['Smtp'][_0xe616('0x14')])},_0x43f46a)};return client[_0xe616('0x2a')](_0xe616('0x2b'),_0x278d59);})[_0xe616('0xc')](function(_0x5c558e){if(_0x5c558e[_0xe616('0x2c')]){throw new Error(util[_0xe616('0x28')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x5c558e[_0xe616('0x2c')][_0xe616('0x2d')]||JSON['stringify'](_0x5c558e['error'])));}return!![];});}function handleError(_0x45de73,_0xe6ba70,_0x367088){return _0x45de73[_0xe616('0x2e')](_0xe6ba70||0x1f4)[_0xe616('0x2f')]({'message':_0x367088?_0x367088[_0xe616('0x2d')]||_0x367088:''});}exports[_0xe616('0x30')]=function(_0x41d140,_0x9314e0,_0x2fa5e0){passport[_0xe616('0x16')](_0xe616('0x31'),function(_0x3555aa,_0x3df887,_0x39aba4){var _0x559889=_0x3555aa||_0x39aba4;if(_0x559889){return handleError(_0x9314e0,0x191,_0x559889);}if(!_0x3df887){return handleError(_0x9314e0,0x194,{'message':_0xe616('0x32')});}else{var _0x2baffb={'payload':{'id':_0x3df887['id'],'role':_0x3df887[_0xe616('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0xe616('0x33')](_0x2baffb)[_0xe616('0xc')](function(_0x7854a5){_0x9314e0[_0xe616('0x34')]({'id':_0x3df887['id'],'token':_0x7854a5,'statusCall':'','isAlreadyLogged':_0x3df887[_0xe616('0x35')]});});}})(_0x41d140,_0x9314e0,_0x2fa5e0);};exports[_0xe616('0x36')]=function(_0x5b1f50,_0x582a4e){if(!_0x5b1f50['body'][_0xe616('0x21')]){return handleError(_0x582a4e,0x1f4,{'message':_0xe616('0x37')});}var _0x5815d7=rs['generate']();_0x5b1f50['body'][_0xe616('0x21')]=_0x5b1f50['body'][_0xe616('0x21')][_0xe616('0x38')]()[_0xe616('0x39')]();var _0x4173c6;return db[_0xe616('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0xe616('0x19'),_0xe616('0xb')],'raw':!![]})[_0xe616('0xc')](function(_0x47e1b4){_0x4173c6=_0x47e1b4;return db[_0xe616('0x3a')][_0xe616('0x3b')]({'where':{'email':_0x5b1f50['body']['email']}});})['then'](function(_0x5346fd){if(!_0x5346fd){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x5346fd[_0xe616('0x17')]){throw new Error(_0xe616('0x3c'));}if(_0x5346fd[_0xe616('0x1a')]){if(moment(_0x5346fd[_0xe616('0x11')])[_0xe616('0x1d')](_0x4173c6[_0xe616('0xb')],'minutes')>moment()){throw new Error(_0xe616('0x3d'));}else{_0x5346fd['blocked']=![];_0x5346fd['blockedAt']=null;}}_0x5346fd[_0xe616('0x3e')]=_0x5815d7;_0x5346fd['resetPasswordExpires']=Date[_0xe616('0x3f')]()+0x36ee80;return _0x5346fd[_0xe616('0x40')]();})['then'](function(){return sendServiceMail({'to':_0x5b1f50[_0xe616('0x41')]['email'],'subject':_0xe616('0x42'),'text':_0xe616('0x43')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xe616('0x44')+_0x5b1f50[_0xe616('0x45')][_0xe616('0x46')]+_0xe616('0x47')+_0x5815d7+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0x582a4e[_0xe616('0x2e')](0xc8)[_0xe616('0x2f')]({'message':_0xe616('0x48')});})[_0xe616('0x1f')](function(_0x32beec){return handleError(_0x582a4e,0x1f4,_0x32beec);});};exports[_0xe616('0x49')]=function(_0x173d02,_0x5079d8){return db['User'][_0xe616('0x3b')]({'where':{'resetPasswordToken':_0x173d02[_0xe616('0x4a')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x3abc4d){if(!_0x3abc4d){throw new Error(_0xe616('0x4b'));}return db[_0xe616('0x9')][_0xe616('0xa')]({'attributes':['id',_0xe616('0x4c'),_0xe616('0x4d'),_0xe616('0x4e')]})[_0xe616('0xc')](function(_0x41d766){if(_0x41d766[_0xe616('0x4c')])authService[_0xe616('0x4f')](_0x173d02[_0xe616('0x41')][_0xe616('0xe')]);if(!_0x41d766[_0xe616('0x4d')]||!_0x3abc4d[_0xe616('0x50')])return _0x3abc4d;authService[_0xe616('0x51')](_0x173d02['body'][_0xe616('0xe')],_0x3abc4d['previousPasswords'],_0x41d766['passwordHistoryLimit']);return _0x3abc4d;})[_0xe616('0xc')](function(){_0x3abc4d[_0xe616('0xe')]=_0x173d02[_0xe616('0x41')][_0xe616('0xe')];_0x3abc4d[_0xe616('0x3e')]=null;_0x3abc4d[_0xe616('0x52')]=null;return _0x3abc4d['save']();});})['then'](function(){_0x5079d8[_0xe616('0x2e')](0xc8)[_0xe616('0x2f')]({'message':'Password\x20reset!'});})['catch'](function(_0x1bde4c){return handleError(_0x5079d8,0x1f4,_0x1bde4c);});};passport[_0xe616('0x53')](_0xe616('0x31'),new LocalStrategy({'usernameField':_0xe616('0xd'),'passwordField':_0xe616('0xe')},function(_0x4c58f4,_0x185bca,_0x28a9fc){return localAuthenticate(db['User'],_0x4c58f4,_0x185bca,_0x28a9fc);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 783f780..71084b7 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 _0x9425=['post','login','/forgot','forgot','reset','exports','Router'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x9425,0x1db));var _0x5942=function(_0xfad0ef,_0x4a78e0){_0xfad0ef=_0xfad0ef-0x0;var _0x43bde4=_0x9425[_0xfad0ef];return _0x43bde4;};'use strict';var express=require('express');var router=express[_0x5942('0x0')]();var controller=require('./authLocal.controller');router[_0x5942('0x1')]('/',controller[_0x5942('0x2')]);router[_0x5942('0x1')](_0x5942('0x3'),controller[_0x5942('0x4')]);router['post']('/reset/:token',controller[_0x5942('0x5')]);module[_0x5942('0x6')]=router; \ No newline at end of file +var _0x0a9c=['post','/forgot','forgot','/reset/:token','reset','exports','express','./authLocal.controller'];(function(_0x50b9f9,_0x36909f){var _0x5f3d43=function(_0x3bd6f4){while(--_0x3bd6f4){_0x50b9f9['push'](_0x50b9f9['shift']());}};_0x5f3d43(++_0x36909f);}(_0x0a9c,0x1be));var _0xc0a9=function(_0x431aea,_0x405d3a){_0x431aea=_0x431aea-0x0;var _0x27782b=_0x0a9c[_0x431aea];return _0x27782b;};'use strict';var express=require(_0xc0a9('0x0'));var router=express['Router']();var controller=require(_0xc0a9('0x1'));router[_0xc0a9('0x2')]('/',controller['login']);router[_0xc0a9('0x2')](_0xc0a9('0x3'),controller[_0xc0a9('0x4')]);router[_0xc0a9('0x2')](_0xc0a9('0x5'),controller[_0xc0a9('0x6')]);module[_0xc0a9('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 4380ea0..039bf5f 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 _0x1e08=['STRING','BOOLEAN','sequelize','exports'];(function(_0xe5a22,_0x45eca4){var _0x49ef68=function(_0x4b0f62){while(--_0x4b0f62){_0xe5a22['push'](_0xe5a22['shift']());}};_0x49ef68(++_0x45eca4);}(_0x1e08,0xae));var _0x81e0=function(_0x39c745,_0xa4b72a){_0x39c745=_0x39c745-0x0;var _0x3b4c9c=_0x1e08[_0x39c745];return _0x3b4c9c;};'use strict';var Sequelize=require(_0x81e0('0x0'));module[_0x81e0('0x1')]={'name':{'type':Sequelize[_0x81e0('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x81e0('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0xd9d7=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x1cf429,_0x4ec40f){var _0x621bbe=function(_0x28e2f7){while(--_0x28e2f7){_0x1cf429['push'](_0x1cf429['shift']());}};_0x621bbe(++_0x4ec40f);}(_0xd9d7,0x173));var _0x7d9d=function(_0x486efc,_0x1cca6a){_0x486efc=_0x486efc-0x0;var _0x42ae7e=_0xd9d7[_0x486efc];return _0x42ae7e;};'use strict';var Sequelize=require(_0x7d9d('0x0'));module[_0x7d9d('0x1')]={'name':{'type':Sequelize[_0x7d9d('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x7d9d('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x7d9d('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x7d9d('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 32ad10d..85210d7 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 _0xf7a4=['lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','limit','filters','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','fields','include','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','sort','filter','addActions','Action','order','pick','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra'];(function(_0x56259d,_0x20aef8){var _0x507ffb=function(_0x200c27){while(--_0x200c27){_0x56259d['push'](_0x56259d['shift']());}};_0x507ffb(++_0x20aef8);}(_0xf7a4,0xf7));var _0x4f7a=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xf7a4[_0x9c2427];return _0x51984f;};'use strict';var emlformat=require(_0x4f7a('0x0'));var rimraf=require(_0x4f7a('0x1'));var zipdir=require(_0x4f7a('0x2'));var jsonpatch=require(_0x4f7a('0x3'));var rp=require(_0x4f7a('0x4'));var moment=require(_0x4f7a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4f7a('0x6'));var sox=require(_0x4f7a('0x7'));var csv=require(_0x4f7a('0x8'));var ejs=require(_0x4f7a('0x9'));var fs=require('fs');var fs_extra=require(_0x4f7a('0xa'));var _=require(_0x4f7a('0xb'));var squel=require(_0x4f7a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4f7a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4f7a('0xe'));var Papa=require('papaparse');var Redis=require(_0x4f7a('0xf'));var authService=require(_0x4f7a('0x10'));var qs=require(_0x4f7a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f7a('0x12'));var logger=require(_0x4f7a('0x13'))(_0x4f7a('0x14'));var utils=require(_0x4f7a('0x15'));var config=require(_0x4f7a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4f7a('0x17'))['db'];function respondWithStatusCode(_0x118dac,_0x32b573){_0x32b573=_0x32b573||0xcc;return function(_0x447794){if(_0x447794){return _0x118dac[_0x4f7a('0x18')](_0x32b573);}return _0x118dac[_0x4f7a('0x19')](_0x32b573)['end']();};}function respondWithResult(_0x3d2394,_0x179ca1){_0x179ca1=_0x179ca1||0xc8;return function(_0x403062){if(_0x403062){return _0x3d2394[_0x4f7a('0x19')](_0x179ca1)[_0x4f7a('0x1a')](_0x403062);}};}function respondWithFilteredResult(_0x199673,_0x1156ca){return function(_0x3e1956){if(_0x3e1956){var _0x2c514a=typeof _0x1156ca[_0x4f7a('0x1b')]===_0x4f7a('0x1c')&&typeof _0x1156ca['limit']===_0x4f7a('0x1c');var _0x3fee96=_0x3e1956['count'];var _0x2c38ad=_0x2c514a?0x0:_0x1156ca[_0x4f7a('0x1b')];var _0xf040d9=_0x2c514a?_0x3e1956[_0x4f7a('0x1d')]:_0x1156ca[_0x4f7a('0x1b')]+_0x1156ca['limit'];var _0x127b31;if(_0xf040d9>=_0x3fee96){_0xf040d9=_0x3fee96;_0x127b31=0xc8;}else{_0x127b31=0xce;}_0x199673['status'](_0x127b31);return _0x199673[_0x4f7a('0x1e')](_0x4f7a('0x1f'),_0x2c38ad+'-'+_0xf040d9+'/'+_0x3fee96)[_0x4f7a('0x1a')](_0x3e1956);}return null;};}function patchUpdates(_0x294aa9){return function(_0xaa28cb){try{jsonpatch[_0x4f7a('0x20')](_0xaa28cb,_0x294aa9,!![]);}catch(_0x5dbc37){return BPromise[_0x4f7a('0x21')](_0x5dbc37);}return _0xaa28cb['save']();};}function saveUpdates(_0x39c200,_0x9aee9b){return function(_0xa660a3){if(_0xa660a3){return _0xa660a3[_0x4f7a('0x22')](_0x39c200)[_0x4f7a('0x23')](function(_0x2799a8){return _0x2799a8;});}return null;};}function removeEntity(_0x59026b,_0x2f2b15){return function(_0x2e7888){if(_0x2e7888){return _0x2e7888[_0x4f7a('0x24')]()[_0x4f7a('0x23')](function(){_0x59026b['status'](0xcc)[_0x4f7a('0x25')]();});}};}function handleEntityNotFound(_0x3ff6be,_0x501be6){return function(_0x5e34ad){if(!_0x5e34ad){_0x3ff6be[_0x4f7a('0x18')](0x194);}return _0x5e34ad;};}function handleError(_0x4ca0ea,_0x4909eb){_0x4909eb=_0x4909eb||0x1f4;return function(_0x1a5654){logger[_0x4f7a('0x26')](_0x1a5654[_0x4f7a('0x27')]);if(_0x1a5654[_0x4f7a('0x28')]){delete _0x1a5654[_0x4f7a('0x28')];}_0x4ca0ea[_0x4f7a('0x19')](_0x4909eb)[_0x4f7a('0x29')](_0x1a5654);};}exports[_0x4f7a('0x2a')]=function(_0x10c774,_0x11144f){var _0x56c228={},_0x2c0756={},_0x885cfa={'count':0x0,'rows':[]};var _0x5c6fe5=_[_0x4f7a('0x2b')](db[_0x4f7a('0x2c')][_0x4f7a('0x2d')],function(_0x3b5a5a){return{'name':_0x3b5a5a[_0x4f7a('0x2e')],'type':_0x3b5a5a[_0x4f7a('0x2f')][_0x4f7a('0x30')]};});_0x2c0756[_0x4f7a('0x31')]=_[_0x4f7a('0x2b')](_0x5c6fe5,_0x4f7a('0x28'));_0x2c0756[_0x4f7a('0x32')]=_['keys'](_0x10c774[_0x4f7a('0x32')]);_0x2c0756['filters']=_[_0x4f7a('0x33')](_0x2c0756[_0x4f7a('0x31')],_0x2c0756[_0x4f7a('0x32')]);_0x56c228[_0x4f7a('0x34')]=_[_0x4f7a('0x33')](_0x2c0756[_0x4f7a('0x31')],qs['fields'](_0x10c774[_0x4f7a('0x32')]['fields']));_0x56c228['attributes']=_0x56c228[_0x4f7a('0x34')][_0x4f7a('0x35')]?_0x56c228[_0x4f7a('0x34')]:_0x2c0756[_0x4f7a('0x31')];if(!_0x10c774[_0x4f7a('0x32')][_0x4f7a('0x36')](_0x4f7a('0x37'))){_0x56c228[_0x4f7a('0x38')]=qs['limit'](_0x10c774[_0x4f7a('0x32')][_0x4f7a('0x38')]);_0x56c228[_0x4f7a('0x1b')]=qs[_0x4f7a('0x1b')](_0x10c774[_0x4f7a('0x32')]['offset']);}_0x56c228['order']=qs['sort'](_0x10c774[_0x4f7a('0x32')]['sort']);_0x56c228['where']=qs[_0x4f7a('0x39')](_['pick'](_0x10c774[_0x4f7a('0x32')],_0x2c0756[_0x4f7a('0x39')]),_0x5c6fe5);if(_0x10c774['query']['filter']){_0x56c228[_0x4f7a('0x3a')]=_[_0x4f7a('0x3b')](_0x56c228[_0x4f7a('0x3a')],{'$or':_['map'](_0x5c6fe5,function(_0x7f084b){if(_0x7f084b[_0x4f7a('0x2f')]!==_0x4f7a('0x3c')){var _0x3e14bc={};_0x3e14bc[_0x7f084b[_0x4f7a('0x28')]]={'$like':'%'+_0x10c774[_0x4f7a('0x32')]['filter']+'%'};return _0x3e14bc;}})});}_0x56c228=_[_0x4f7a('0x3b')]({},_0x56c228,_0x10c774[_0x4f7a('0x3d')]);var _0x183dbd={'where':_0x56c228[_0x4f7a('0x3a')]};return db[_0x4f7a('0x2c')][_0x4f7a('0x1d')](_0x183dbd)[_0x4f7a('0x23')](function(_0x54e6df){_0x885cfa[_0x4f7a('0x1d')]=_0x54e6df;if(_0x10c774[_0x4f7a('0x32')][_0x4f7a('0x3e')]){_0x56c228['include']=[{'all':!![]}];}return db['Automation'][_0x4f7a('0x3f')](_0x56c228);})[_0x4f7a('0x23')](function(_0x19ebe7){_0x885cfa['rows']=_0x19ebe7;return _0x885cfa;})[_0x4f7a('0x23')](respondWithFilteredResult(_0x11144f,_0x56c228))[_0x4f7a('0x40')](handleError(_0x11144f,null));};exports[_0x4f7a('0x41')]=function(_0x4a7ee1,_0x426f8f){var _0x54c5e2={'raw':![],'where':{'id':_0x4a7ee1[_0x4f7a('0x42')]['id']}},_0x38fa11={};_0x38fa11[_0x4f7a('0x31')]=_[_0x4f7a('0x43')](db[_0x4f7a('0x2c')][_0x4f7a('0x2d')]);_0x38fa11[_0x4f7a('0x32')]=_['keys'](_0x4a7ee1[_0x4f7a('0x32')]);_0x38fa11['filters']=_[_0x4f7a('0x33')](_0x38fa11['model'],_0x38fa11[_0x4f7a('0x32')]);_0x54c5e2[_0x4f7a('0x34')]=_['intersection'](_0x38fa11[_0x4f7a('0x31')],qs[_0x4f7a('0x44')](_0x4a7ee1[_0x4f7a('0x32')][_0x4f7a('0x44')]));_0x54c5e2[_0x4f7a('0x34')]=_0x54c5e2[_0x4f7a('0x34')]['length']?_0x54c5e2['attributes']:_0x38fa11[_0x4f7a('0x31')];if(_0x4a7ee1['query']['includeAll']){_0x54c5e2[_0x4f7a('0x45')]=[{'all':!![]}];}_0x54c5e2=_[_0x4f7a('0x3b')]({},_0x54c5e2,_0x4a7ee1[_0x4f7a('0x3d')]);return db[_0x4f7a('0x2c')][_0x4f7a('0x46')](_0x54c5e2)[_0x4f7a('0x23')](handleEntityNotFound(_0x426f8f,null))[_0x4f7a('0x23')](respondWithResult(_0x426f8f,null))[_0x4f7a('0x40')](handleError(_0x426f8f,null));};exports[_0x4f7a('0x47')]=function(_0x16bb02,_0x13eeb2){return db['Automation'][_0x4f7a('0x47')](_0x16bb02[_0x4f7a('0x48')],{})['then'](respondWithResult(_0x13eeb2,0xc9))['catch'](handleError(_0x13eeb2,null));};exports['update']=function(_0x45276e,_0x171a77){if(_0x45276e['body']['id']){delete _0x45276e[_0x4f7a('0x48')]['id'];}return db[_0x4f7a('0x2c')][_0x4f7a('0x46')]({'where':{'id':_0x45276e['params']['id']}})['then'](handleEntityNotFound(_0x171a77,null))[_0x4f7a('0x23')](saveUpdates(_0x45276e[_0x4f7a('0x48')],null))[_0x4f7a('0x23')](respondWithResult(_0x171a77,null))[_0x4f7a('0x40')](handleError(_0x171a77,null));};exports[_0x4f7a('0x24')]=function(_0x524f25,_0xa3ab19){return db[_0x4f7a('0x2c')][_0x4f7a('0x46')]({'where':{'id':_0x524f25[_0x4f7a('0x42')]['id']}})['then'](handleEntityNotFound(_0xa3ab19,null))[_0x4f7a('0x23')](removeEntity(_0xa3ab19,null))[_0x4f7a('0x40')](handleError(_0xa3ab19,null));};exports[_0x4f7a('0x49')]=function(_0x18919f,_0x1467c2,_0x27f5c3){return db[_0x4f7a('0x4a')][_0x4f7a('0x46')]({'where':{'id':_0x18919f['params']['id']}})[_0x4f7a('0x23')](handleEntityNotFound(_0x1467c2,null))[_0x4f7a('0x23')](function(_0x62a1c2){if(_0x62a1c2){return _0x62a1c2[_0x4f7a('0x49')](_0x18919f[_0x4f7a('0x48')][_0x4f7a('0x4b')],_[_0x4f7a('0x4c')](_0x18919f[_0x4f7a('0x48')],[_0x4f7a('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x1467c2,null))[_0x4f7a('0x40')](handleError(_0x1467c2,null));};exports[_0x4f7a('0x4d')]=function(_0x101674,_0x345f9a,_0x10cd64){var _0x258fc4={};var _0x70a142={};var _0x2c04d8;var _0x7fd197;return db[_0x4f7a('0x2c')][_0x4f7a('0x4e')]({'where':{'id':_0x101674[_0x4f7a('0x42')]['id']}})[_0x4f7a('0x23')](handleEntityNotFound(_0x345f9a,null))['then'](function(_0x51c017){if(_0x51c017){_0x2c04d8=_0x51c017;_0x70a142[_0x4f7a('0x31')]=_['keys'](db[_0x4f7a('0x4a')][_0x4f7a('0x2d')]);_0x70a142[_0x4f7a('0x32')]=_[_0x4f7a('0x43')](_0x101674[_0x4f7a('0x32')]);_0x70a142[_0x4f7a('0x39')]=_[_0x4f7a('0x33')](_0x70a142[_0x4f7a('0x31')],_0x70a142['query']);_0x258fc4[_0x4f7a('0x34')]=_[_0x4f7a('0x33')](_0x70a142[_0x4f7a('0x31')],qs[_0x4f7a('0x44')](_0x101674[_0x4f7a('0x32')][_0x4f7a('0x44')]));_0x258fc4[_0x4f7a('0x34')]=_0x258fc4[_0x4f7a('0x34')][_0x4f7a('0x35')]?_0x258fc4['attributes']:_0x70a142[_0x4f7a('0x31')];_0x258fc4['order']=qs[_0x4f7a('0x4f')](_0x101674[_0x4f7a('0x32')][_0x4f7a('0x4f')]);_0x258fc4[_0x4f7a('0x3a')]=qs[_0x4f7a('0x39')](_['pick'](_0x101674['query'],_0x70a142['filters']));if(_0x101674[_0x4f7a('0x32')][_0x4f7a('0x50')]){_0x258fc4[_0x4f7a('0x3a')]=_[_0x4f7a('0x3b')](_0x258fc4['where'],{'$or':_[_0x4f7a('0x2b')](_0x258fc4['attributes'],function(_0x222549){var _0x5306be={};_0x5306be[_0x222549]={'$like':'%'+_0x101674[_0x4f7a('0x32')]['filter']+'%'};return _0x5306be;})});}_0x258fc4=_[_0x4f7a('0x3b')]({},_0x258fc4,_0x101674[_0x4f7a('0x3d')]);return _0x2c04d8[_0x4f7a('0x4d')](_0x258fc4);}})['then'](function(_0x8616a9){if(_0x8616a9){_0x7fd197=_0x8616a9[_0x4f7a('0x35')];if(!_0x101674[_0x4f7a('0x32')][_0x4f7a('0x36')](_0x4f7a('0x37'))){_0x258fc4[_0x4f7a('0x38')]=qs[_0x4f7a('0x38')](_0x101674[_0x4f7a('0x32')]['limit']);_0x258fc4[_0x4f7a('0x1b')]=qs[_0x4f7a('0x1b')](_0x101674[_0x4f7a('0x32')]['offset']);}return _0x2c04d8[_0x4f7a('0x4d')](_0x258fc4);}})['then'](function(_0x2c1916){if(_0x2c1916){return _0x2c1916?{'count':_0x7fd197,'rows':_0x2c1916}:null;}})['then'](respondWithResult(_0x345f9a,null))[_0x4f7a('0x40')](handleError(_0x345f9a,null));};exports[_0x4f7a('0x51')]=function(_0x32c202,_0x3a7ae5,_0x57b16f){return db[_0x4f7a('0x52')][_0x4f7a('0x46')]({'where':{'id':_0x32c202[_0x4f7a('0x42')]['id']}})[_0x4f7a('0x23')](handleEntityNotFound(_0x3a7ae5,null))[_0x4f7a('0x23')](function(_0x2b0104){if(_0x2b0104){return _0x2b0104[_0x4f7a('0x51')](_0x32c202[_0x4f7a('0x48')][_0x4f7a('0x4b')],_[_0x4f7a('0x4c')](_0x32c202['body'],[_0x4f7a('0x4b'),'id'])||{});}})[_0x4f7a('0x23')](respondWithResult(_0x3a7ae5,null))[_0x4f7a('0x40')](handleError(_0x3a7ae5,null));};exports['getActions']=function(_0xa83e40,_0x290d0b,_0x2585df){var _0x45ab82={};var _0x151e4c={};var _0x2ebdd;var _0x3ca5d6;return db['Automation']['findOne']({'where':{'id':_0xa83e40['params']['id']}})[_0x4f7a('0x23')](handleEntityNotFound(_0x290d0b,null))['then'](function(_0x105549){if(_0x105549){_0x2ebdd=_0x105549;_0x151e4c[_0x4f7a('0x31')]=_[_0x4f7a('0x43')](db[_0x4f7a('0x52')][_0x4f7a('0x2d')]);_0x151e4c[_0x4f7a('0x32')]=_[_0x4f7a('0x43')](_0xa83e40[_0x4f7a('0x32')]);_0x151e4c[_0x4f7a('0x39')]=_[_0x4f7a('0x33')](_0x151e4c['model'],_0x151e4c['query']);_0x45ab82[_0x4f7a('0x34')]=_[_0x4f7a('0x33')](_0x151e4c[_0x4f7a('0x31')],qs['fields'](_0xa83e40[_0x4f7a('0x32')][_0x4f7a('0x44')]));_0x45ab82[_0x4f7a('0x34')]=_0x45ab82['attributes'][_0x4f7a('0x35')]?_0x45ab82[_0x4f7a('0x34')]:_0x151e4c[_0x4f7a('0x31')];_0x45ab82[_0x4f7a('0x53')]=qs[_0x4f7a('0x4f')](_0xa83e40[_0x4f7a('0x32')][_0x4f7a('0x4f')]);_0x45ab82[_0x4f7a('0x3a')]=qs['filters'](_[_0x4f7a('0x54')](_0xa83e40[_0x4f7a('0x32')],_0x151e4c[_0x4f7a('0x39')]));if(_0xa83e40[_0x4f7a('0x32')]['filter']){_0x45ab82['where']=_[_0x4f7a('0x3b')](_0x45ab82[_0x4f7a('0x3a')],{'$or':_[_0x4f7a('0x2b')](_0x45ab82['attributes'],function(_0x11bc52){var _0x589244={};_0x589244[_0x11bc52]={'$like':'%'+_0xa83e40[_0x4f7a('0x32')][_0x4f7a('0x50')]+'%'};return _0x589244;})});}_0x45ab82=_['merge']({},_0x45ab82,_0xa83e40[_0x4f7a('0x3d')]);return _0x2ebdd[_0x4f7a('0x55')](_0x45ab82);}})[_0x4f7a('0x23')](function(_0x66e603){if(_0x66e603){_0x3ca5d6=_0x66e603['length'];if(!_0xa83e40[_0x4f7a('0x32')][_0x4f7a('0x36')](_0x4f7a('0x37'))){_0x45ab82[_0x4f7a('0x38')]=qs[_0x4f7a('0x38')](_0xa83e40['query'][_0x4f7a('0x38')]);_0x45ab82[_0x4f7a('0x1b')]=qs['offset'](_0xa83e40['query']['offset']);}return _0x2ebdd[_0x4f7a('0x55')](_0x45ab82);}})[_0x4f7a('0x23')](function(_0x57c9a4){if(_0x57c9a4){return _0x57c9a4?{'count':_0x3ca5d6,'rows':_0x57c9a4}:null;}})[_0x4f7a('0x23')](respondWithResult(_0x290d0b,null))[_0x4f7a('0x40')](handleError(_0x290d0b,null));}; \ No newline at end of file +var _0x7c6a=['squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','reject','update','then','destroy','end','error','stack','name','send','index','map','Automation','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','create','body','find','addConditions','ids','omit','getConditions','Condition','length','addActions','Action','getActions','findOne','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x3b6cc2,_0x2bbb89){var _0x292300=function(_0x3f02bf){while(--_0x3f02bf){_0x3b6cc2['push'](_0x3b6cc2['shift']());}};_0x292300(++_0x2bbb89);}(_0x7c6a,0x1eb));var _0xa7c6=function(_0x2ea6fe,_0x549575){_0x2ea6fe=_0x2ea6fe-0x0;var _0x368a32=_0x7c6a[_0x2ea6fe];return _0x368a32;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa7c6('0x0'));var zipdir=require(_0xa7c6('0x1'));var jsonpatch=require(_0xa7c6('0x2'));var rp=require(_0xa7c6('0x3'));var moment=require('moment');var BPromise=require(_0xa7c6('0x4'));var Mustache=require(_0xa7c6('0x5'));var util=require(_0xa7c6('0x6'));var path=require(_0xa7c6('0x7'));var sox=require(_0xa7c6('0x8'));var csv=require(_0xa7c6('0x9'));var ejs=require(_0xa7c6('0xa'));var fs=require('fs');var fs_extra=require(_0xa7c6('0xb'));var _=require(_0xa7c6('0xc'));var squel=require(_0xa7c6('0xd'));var crypto=require(_0xa7c6('0xe'));var jsforce=require(_0xa7c6('0xf'));var deskjs=require(_0xa7c6('0x10'));var toCsv=require(_0xa7c6('0x9'));var querystring=require(_0xa7c6('0x11'));var Papa=require(_0xa7c6('0x12'));var Redis=require('ioredis');var authService=require(_0xa7c6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa7c6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa7c6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa7c6('0x16'));var db=require(_0xa7c6('0x17'))['db'];function respondWithStatusCode(_0x16f7d0,_0x101ff3){_0x101ff3=_0x101ff3||0xcc;return function(_0x3379af){if(_0x3379af){return _0x16f7d0[_0xa7c6('0x18')](_0x101ff3);}return _0x16f7d0[_0xa7c6('0x19')](_0x101ff3)['end']();};}function respondWithResult(_0x25ba92,_0x477448){_0x477448=_0x477448||0xc8;return function(_0x5af902){if(_0x5af902){return _0x25ba92['status'](_0x477448)[_0xa7c6('0x1a')](_0x5af902);}};}function respondWithFilteredResult(_0x565bf9,_0x8eec6){return function(_0x2be04f){if(_0x2be04f){var _0x47d8ae=typeof _0x8eec6['offset']===_0xa7c6('0x1b')&&typeof _0x8eec6[_0xa7c6('0x1c')]==='undefined';var _0x3cd46a=_0x2be04f[_0xa7c6('0x1d')];var _0x36b97d=_0x47d8ae?0x0:_0x8eec6['offset'];var _0x3c77a8=_0x47d8ae?_0x2be04f[_0xa7c6('0x1d')]:_0x8eec6[_0xa7c6('0x1e')]+_0x8eec6[_0xa7c6('0x1c')];var _0x19fd91;if(_0x3c77a8>=_0x3cd46a){_0x3c77a8=_0x3cd46a;_0x19fd91=0xc8;}else{_0x19fd91=0xce;}_0x565bf9['status'](_0x19fd91);return _0x565bf9[_0xa7c6('0x1f')]('Content-Range',_0x36b97d+'-'+_0x3c77a8+'/'+_0x3cd46a)[_0xa7c6('0x1a')](_0x2be04f);}return null;};}function patchUpdates(_0x21f20f){return function(_0x33a359){try{jsonpatch['apply'](_0x33a359,_0x21f20f,!![]);}catch(_0xb7c7a7){return BPromise[_0xa7c6('0x20')](_0xb7c7a7);}return _0x33a359['save']();};}function saveUpdates(_0x1a2b9c,_0x5dadda){return function(_0x236c28){if(_0x236c28){return _0x236c28[_0xa7c6('0x21')](_0x1a2b9c)[_0xa7c6('0x22')](function(_0x423c1a){return _0x423c1a;});}return null;};}function removeEntity(_0x44cb77,_0x4ab6ea){return function(_0x3fee84){if(_0x3fee84){return _0x3fee84[_0xa7c6('0x23')]()[_0xa7c6('0x22')](function(){_0x44cb77[_0xa7c6('0x19')](0xcc)[_0xa7c6('0x24')]();});}};}function handleEntityNotFound(_0x2909a0,_0x32bd68){return function(_0x327dbd){if(!_0x327dbd){_0x2909a0[_0xa7c6('0x18')](0x194);}return _0x327dbd;};}function handleError(_0x5ebcab,_0x31335d){_0x31335d=_0x31335d||0x1f4;return function(_0x4a8abb){logger[_0xa7c6('0x25')](_0x4a8abb[_0xa7c6('0x26')]);if(_0x4a8abb[_0xa7c6('0x27')]){delete _0x4a8abb['name'];}_0x5ebcab['status'](_0x31335d)[_0xa7c6('0x28')](_0x4a8abb);};}exports[_0xa7c6('0x29')]=function(_0x143068,_0xacd8ff){var _0x3ee0e8={},_0x38c092={},_0x121365={'count':0x0,'rows':[]};var _0xba3c3f=_[_0xa7c6('0x2a')](db[_0xa7c6('0x2b')]['rawAttributes'],function(_0x13e01f){return{'name':_0x13e01f[_0xa7c6('0x2c')],'type':_0x13e01f[_0xa7c6('0x2d')][_0xa7c6('0x2e')]};});_0x38c092[_0xa7c6('0x2f')]=_[_0xa7c6('0x2a')](_0xba3c3f,'name');_0x38c092[_0xa7c6('0x30')]=_[_0xa7c6('0x31')](_0x143068[_0xa7c6('0x30')]);_0x38c092[_0xa7c6('0x32')]=_['intersection'](_0x38c092[_0xa7c6('0x2f')],_0x38c092[_0xa7c6('0x30')]);_0x3ee0e8[_0xa7c6('0x33')]=_[_0xa7c6('0x34')](_0x38c092['model'],qs[_0xa7c6('0x35')](_0x143068['query'][_0xa7c6('0x35')]));_0x3ee0e8['attributes']=_0x3ee0e8[_0xa7c6('0x33')]['length']?_0x3ee0e8[_0xa7c6('0x33')]:_0x38c092[_0xa7c6('0x2f')];if(!_0x143068[_0xa7c6('0x30')][_0xa7c6('0x36')](_0xa7c6('0x37'))){_0x3ee0e8[_0xa7c6('0x1c')]=qs[_0xa7c6('0x1c')](_0x143068[_0xa7c6('0x30')][_0xa7c6('0x1c')]);_0x3ee0e8[_0xa7c6('0x1e')]=qs['offset'](_0x143068[_0xa7c6('0x30')][_0xa7c6('0x1e')]);}_0x3ee0e8[_0xa7c6('0x38')]=qs[_0xa7c6('0x39')](_0x143068['query'][_0xa7c6('0x39')]);_0x3ee0e8[_0xa7c6('0x3a')]=qs['filters'](_[_0xa7c6('0x3b')](_0x143068[_0xa7c6('0x30')],_0x38c092['filters']),_0xba3c3f);if(_0x143068[_0xa7c6('0x30')][_0xa7c6('0x3c')]){_0x3ee0e8[_0xa7c6('0x3a')]=_[_0xa7c6('0x3d')](_0x3ee0e8[_0xa7c6('0x3a')],{'$or':_['map'](_0xba3c3f,function(_0x3a808c){if(_0x3a808c[_0xa7c6('0x2d')]!==_0xa7c6('0x3e')){var _0xcefaab={};_0xcefaab[_0x3a808c[_0xa7c6('0x27')]]={'$like':'%'+_0x143068[_0xa7c6('0x30')][_0xa7c6('0x3c')]+'%'};return _0xcefaab;}})});}_0x3ee0e8=_[_0xa7c6('0x3d')]({},_0x3ee0e8,_0x143068[_0xa7c6('0x3f')]);var _0x4c7375={'where':_0x3ee0e8['where']};return db[_0xa7c6('0x2b')][_0xa7c6('0x1d')](_0x4c7375)[_0xa7c6('0x22')](function(_0x3c834b){_0x121365[_0xa7c6('0x1d')]=_0x3c834b;if(_0x143068[_0xa7c6('0x30')][_0xa7c6('0x40')]){_0x3ee0e8[_0xa7c6('0x41')]=[{'all':!![]}];}return db['Automation'][_0xa7c6('0x42')](_0x3ee0e8);})[_0xa7c6('0x22')](function(_0x540d68){_0x121365['rows']=_0x540d68;return _0x121365;})[_0xa7c6('0x22')](respondWithFilteredResult(_0xacd8ff,_0x3ee0e8))[_0xa7c6('0x43')](handleError(_0xacd8ff,null));};exports[_0xa7c6('0x44')]=function(_0x5c6619,_0x286c15){var _0x460610={'raw':![],'where':{'id':_0x5c6619[_0xa7c6('0x45')]['id']}},_0x2f2cc={};_0x2f2cc[_0xa7c6('0x2f')]=_[_0xa7c6('0x31')](db[_0xa7c6('0x2b')][_0xa7c6('0x46')]);_0x2f2cc['query']=_[_0xa7c6('0x31')](_0x5c6619['query']);_0x2f2cc['filters']=_[_0xa7c6('0x34')](_0x2f2cc['model'],_0x2f2cc[_0xa7c6('0x30')]);_0x460610[_0xa7c6('0x33')]=_[_0xa7c6('0x34')](_0x2f2cc['model'],qs[_0xa7c6('0x35')](_0x5c6619['query'][_0xa7c6('0x35')]));_0x460610[_0xa7c6('0x33')]=_0x460610[_0xa7c6('0x33')]['length']?_0x460610[_0xa7c6('0x33')]:_0x2f2cc[_0xa7c6('0x2f')];if(_0x5c6619[_0xa7c6('0x30')][_0xa7c6('0x40')]){_0x460610[_0xa7c6('0x41')]=[{'all':!![]}];}_0x460610=_['merge']({},_0x460610,_0x5c6619[_0xa7c6('0x3f')]);return db[_0xa7c6('0x2b')]['find'](_0x460610)[_0xa7c6('0x22')](handleEntityNotFound(_0x286c15,null))[_0xa7c6('0x22')](respondWithResult(_0x286c15,null))[_0xa7c6('0x43')](handleError(_0x286c15,null));};exports[_0xa7c6('0x47')]=function(_0x4066ad,_0x357e12){return db[_0xa7c6('0x2b')][_0xa7c6('0x47')](_0x4066ad['body'],{})[_0xa7c6('0x22')](respondWithResult(_0x357e12,0xc9))['catch'](handleError(_0x357e12,null));};exports[_0xa7c6('0x21')]=function(_0x44b984,_0x273b44){if(_0x44b984[_0xa7c6('0x48')]['id']){delete _0x44b984[_0xa7c6('0x48')]['id'];}return db[_0xa7c6('0x2b')][_0xa7c6('0x49')]({'where':{'id':_0x44b984[_0xa7c6('0x45')]['id']}})[_0xa7c6('0x22')](handleEntityNotFound(_0x273b44,null))[_0xa7c6('0x22')](saveUpdates(_0x44b984['body'],null))['then'](respondWithResult(_0x273b44,null))[_0xa7c6('0x43')](handleError(_0x273b44,null));};exports[_0xa7c6('0x23')]=function(_0x406471,_0x24908a){return db[_0xa7c6('0x2b')][_0xa7c6('0x49')]({'where':{'id':_0x406471[_0xa7c6('0x45')]['id']}})[_0xa7c6('0x22')](handleEntityNotFound(_0x24908a,null))['then'](removeEntity(_0x24908a,null))[_0xa7c6('0x43')](handleError(_0x24908a,null));};exports[_0xa7c6('0x4a')]=function(_0x299f33,_0x488fd9,_0x5967d8){return db['Condition'][_0xa7c6('0x49')]({'where':{'id':_0x299f33[_0xa7c6('0x45')]['id']}})[_0xa7c6('0x22')](handleEntityNotFound(_0x488fd9,null))['then'](function(_0x162937){if(_0x162937){return _0x162937['addConditions'](_0x299f33[_0xa7c6('0x48')][_0xa7c6('0x4b')],_[_0xa7c6('0x4c')](_0x299f33[_0xa7c6('0x48')],['ids','id'])||{});}})[_0xa7c6('0x22')](respondWithResult(_0x488fd9,null))[_0xa7c6('0x43')](handleError(_0x488fd9,null));};exports[_0xa7c6('0x4d')]=function(_0x58e949,_0x354309,_0x25835d){var _0x3983c5={};var _0x262d7b={};var _0x5267d1;var _0x381406;return db['Automation']['findOne']({'where':{'id':_0x58e949[_0xa7c6('0x45')]['id']}})[_0xa7c6('0x22')](handleEntityNotFound(_0x354309,null))[_0xa7c6('0x22')](function(_0x3dcade){if(_0x3dcade){_0x5267d1=_0x3dcade;_0x262d7b[_0xa7c6('0x2f')]=_[_0xa7c6('0x31')](db[_0xa7c6('0x4e')][_0xa7c6('0x46')]);_0x262d7b['query']=_[_0xa7c6('0x31')](_0x58e949[_0xa7c6('0x30')]);_0x262d7b[_0xa7c6('0x32')]=_['intersection'](_0x262d7b[_0xa7c6('0x2f')],_0x262d7b[_0xa7c6('0x30')]);_0x3983c5[_0xa7c6('0x33')]=_['intersection'](_0x262d7b[_0xa7c6('0x2f')],qs[_0xa7c6('0x35')](_0x58e949['query'][_0xa7c6('0x35')]));_0x3983c5[_0xa7c6('0x33')]=_0x3983c5[_0xa7c6('0x33')][_0xa7c6('0x4f')]?_0x3983c5[_0xa7c6('0x33')]:_0x262d7b['model'];_0x3983c5['order']=qs['sort'](_0x58e949[_0xa7c6('0x30')][_0xa7c6('0x39')]);_0x3983c5[_0xa7c6('0x3a')]=qs[_0xa7c6('0x32')](_[_0xa7c6('0x3b')](_0x58e949[_0xa7c6('0x30')],_0x262d7b[_0xa7c6('0x32')]));if(_0x58e949['query'][_0xa7c6('0x3c')]){_0x3983c5[_0xa7c6('0x3a')]=_[_0xa7c6('0x3d')](_0x3983c5[_0xa7c6('0x3a')],{'$or':_[_0xa7c6('0x2a')](_0x3983c5['attributes'],function(_0x14dfbf){var _0x557ed2={};_0x557ed2[_0x14dfbf]={'$like':'%'+_0x58e949[_0xa7c6('0x30')][_0xa7c6('0x3c')]+'%'};return _0x557ed2;})});}_0x3983c5=_['merge']({},_0x3983c5,_0x58e949[_0xa7c6('0x3f')]);return _0x5267d1['getConditions'](_0x3983c5);}})[_0xa7c6('0x22')](function(_0x3b70ff){if(_0x3b70ff){_0x381406=_0x3b70ff[_0xa7c6('0x4f')];if(!_0x58e949[_0xa7c6('0x30')][_0xa7c6('0x36')](_0xa7c6('0x37'))){_0x3983c5[_0xa7c6('0x1c')]=qs[_0xa7c6('0x1c')](_0x58e949[_0xa7c6('0x30')][_0xa7c6('0x1c')]);_0x3983c5[_0xa7c6('0x1e')]=qs[_0xa7c6('0x1e')](_0x58e949[_0xa7c6('0x30')][_0xa7c6('0x1e')]);}return _0x5267d1[_0xa7c6('0x4d')](_0x3983c5);}})['then'](function(_0x3a251f){if(_0x3a251f){return _0x3a251f?{'count':_0x381406,'rows':_0x3a251f}:null;}})[_0xa7c6('0x22')](respondWithResult(_0x354309,null))[_0xa7c6('0x43')](handleError(_0x354309,null));};exports[_0xa7c6('0x50')]=function(_0x5e5380,_0x1d111c,_0x4bee17){return db[_0xa7c6('0x51')]['find']({'where':{'id':_0x5e5380[_0xa7c6('0x45')]['id']}})['then'](handleEntityNotFound(_0x1d111c,null))[_0xa7c6('0x22')](function(_0x4fb82a){if(_0x4fb82a){return _0x4fb82a[_0xa7c6('0x50')](_0x5e5380[_0xa7c6('0x48')][_0xa7c6('0x4b')],_[_0xa7c6('0x4c')](_0x5e5380[_0xa7c6('0x48')],[_0xa7c6('0x4b'),'id'])||{});}})[_0xa7c6('0x22')](respondWithResult(_0x1d111c,null))[_0xa7c6('0x43')](handleError(_0x1d111c,null));};exports[_0xa7c6('0x52')]=function(_0x157a1f,_0x2d6aaf,_0x1fb5aa){var _0xc4c53a={};var _0x530137={};var _0x198822;var _0x3ba8dd;return db[_0xa7c6('0x2b')][_0xa7c6('0x53')]({'where':{'id':_0x157a1f[_0xa7c6('0x45')]['id']}})['then'](handleEntityNotFound(_0x2d6aaf,null))[_0xa7c6('0x22')](function(_0x19fe84){if(_0x19fe84){_0x198822=_0x19fe84;_0x530137[_0xa7c6('0x2f')]=_[_0xa7c6('0x31')](db[_0xa7c6('0x51')][_0xa7c6('0x46')]);_0x530137[_0xa7c6('0x30')]=_['keys'](_0x157a1f[_0xa7c6('0x30')]);_0x530137[_0xa7c6('0x32')]=_[_0xa7c6('0x34')](_0x530137[_0xa7c6('0x2f')],_0x530137['query']);_0xc4c53a[_0xa7c6('0x33')]=_['intersection'](_0x530137[_0xa7c6('0x2f')],qs['fields'](_0x157a1f[_0xa7c6('0x30')][_0xa7c6('0x35')]));_0xc4c53a[_0xa7c6('0x33')]=_0xc4c53a[_0xa7c6('0x33')][_0xa7c6('0x4f')]?_0xc4c53a[_0xa7c6('0x33')]:_0x530137[_0xa7c6('0x2f')];_0xc4c53a['order']=qs[_0xa7c6('0x39')](_0x157a1f[_0xa7c6('0x30')][_0xa7c6('0x39')]);_0xc4c53a['where']=qs[_0xa7c6('0x32')](_[_0xa7c6('0x3b')](_0x157a1f[_0xa7c6('0x30')],_0x530137[_0xa7c6('0x32')]));if(_0x157a1f[_0xa7c6('0x30')][_0xa7c6('0x3c')]){_0xc4c53a[_0xa7c6('0x3a')]=_[_0xa7c6('0x3d')](_0xc4c53a[_0xa7c6('0x3a')],{'$or':_[_0xa7c6('0x2a')](_0xc4c53a['attributes'],function(_0x44ba21){var _0xfd7f33={};_0xfd7f33[_0x44ba21]={'$like':'%'+_0x157a1f[_0xa7c6('0x30')][_0xa7c6('0x3c')]+'%'};return _0xfd7f33;})});}_0xc4c53a=_[_0xa7c6('0x3d')]({},_0xc4c53a,_0x157a1f[_0xa7c6('0x3f')]);return _0x198822[_0xa7c6('0x52')](_0xc4c53a);}})['then'](function(_0xd762a8){if(_0xd762a8){_0x3ba8dd=_0xd762a8[_0xa7c6('0x4f')];if(!_0x157a1f[_0xa7c6('0x30')]['hasOwnProperty']('nolimit')){_0xc4c53a['limit']=qs['limit'](_0x157a1f[_0xa7c6('0x30')][_0xa7c6('0x1c')]);_0xc4c53a[_0xa7c6('0x1e')]=qs[_0xa7c6('0x1e')](_0x157a1f['query']['offset']);}return _0x198822[_0xa7c6('0x52')](_0xc4c53a);}})[_0xa7c6('0x22')](function(_0x519b1f){if(_0x519b1f){return _0x519b1f?{'count':_0x3ba8dd,'rows':_0x519b1f}:null;}})[_0xa7c6('0x22')](respondWithResult(_0x2d6aaf,null))[_0xa7c6('0x43')](handleError(_0x2d6aaf,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index dfcf1b7..a16de99 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 _0x78b1=['./automation.attributes','exports','define','Automation','tools_automations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x78b1,0x1d3));var _0x178b=function(_0x3a50de,_0x1654be){_0x3a50de=_0x3a50de-0x0;var _0x5b205f=_0x78b1[_0x3a50de];return _0x5b205f;};'use strict';var _=require(_0x178b('0x0'));var util=require(_0x178b('0x1'));var logger=require('../../config/logger')(_0x178b('0x2'));var moment=require(_0x178b('0x3'));var BPromise=require(_0x178b('0x4'));var rp=require(_0x178b('0x5'));var fs=require('fs');var path=require(_0x178b('0x6'));var rimraf=require(_0x178b('0x7'));var config=require(_0x178b('0x8'));var attributes=require(_0x178b('0x9'));module[_0x178b('0xa')]=function(_0x29b052,_0x59aad5){return _0x29b052[_0x178b('0xb')](_0x178b('0xc'),attributes,{'tableName':_0x178b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f85=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','tools_automations','util'];(function(_0x2700cd,_0x499355){var _0x351be3=function(_0x34eba9){while(--_0x34eba9){_0x2700cd['push'](_0x2700cd['shift']());}};_0x351be3(++_0x499355);}(_0x8f85,0x1cb));var _0x58f8=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x8f85[_0x2235bf];return _0x4c3a64;};'use strict';var _=require('lodash');var util=require(_0x58f8('0x0'));var logger=require(_0x58f8('0x1'))('api');var moment=require(_0x58f8('0x2'));var BPromise=require(_0x58f8('0x3'));var rp=require(_0x58f8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x58f8('0x5'));var config=require(_0x58f8('0x6'));var attributes=require('./automation.attributes');module[_0x58f8('0x7')]=function(_0x1700ae,_0x299f67){return _0x1700ae[_0x58f8('0x8')]('Automation',attributes,{'tableName':_0x58f8('0x9'),'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 97b8468..043230e 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 _0xc17d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x38d45b,_0x54c034){var _0x112c3d=function(_0x48713b){while(--_0x48713b){_0x38d45b['push'](_0x38d45b['shift']());}};_0x112c3d(++_0x54c034);}(_0xc17d,0x96));var _0xdc17=function(_0x2026b5,_0x3c9568){_0x2026b5=_0x2026b5-0x0;var _0x1fc628=_0xc17d[_0x2026b5];return _0x1fc628;};'use strict';var _=require(_0xdc17('0x0'));var util=require(_0xdc17('0x1'));var moment=require(_0xdc17('0x2'));var BPromise=require(_0xdc17('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc17('0x4'));var db=require(_0xdc17('0x5'))['db'];var utils=require(_0xdc17('0x6'));var logger=require(_0xdc17('0x7'))('rpc');var config=require(_0xdc17('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdc17('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52a11b,_0x16ac50,_0x373463){return new BPromise(function(_0x53143d,_0x5ccdc5){return client[_0xdc17('0xa')](_0x52a11b,_0x373463)[_0xdc17('0xb')](function(_0x17c626){logger[_0xdc17('0xc')](_0xdc17('0xd'),_0x16ac50,_0xdc17('0xe'));logger[_0xdc17('0xf')](_0xdc17('0x10'),_0x16ac50,'request\x20sent',JSON[_0xdc17('0x11')](_0x17c626));if(_0x17c626[_0xdc17('0x12')]){if(_0x17c626[_0xdc17('0x12')]['code']===0x1f4){logger[_0xdc17('0x12')]('Automation,\x20%s,\x20%s',_0x16ac50,_0x17c626[_0xdc17('0x12')][_0xdc17('0x13')]);return _0x5ccdc5(_0x17c626['error'][_0xdc17('0x13')]);}logger[_0xdc17('0x12')]('Automation,\x20%s,\x20%s',_0x16ac50,_0x17c626[_0xdc17('0x12')]['message']);return _0x53143d(_0x17c626[_0xdc17('0x12')][_0xdc17('0x13')]);}else{logger['info'](_0xdc17('0xd'),_0x16ac50,_0xdc17('0xe'));_0x53143d(_0x17c626[_0xdc17('0x14')][_0xdc17('0x13')]);}})[_0xdc17('0x15')](function(_0x3adc90){logger['error'](_0xdc17('0xd'),_0x16ac50,_0x3adc90);_0x5ccdc5(_0x3adc90);});});} \ No newline at end of file +var _0x8d62=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','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'];(function(_0x463303,_0x1c9593){var _0x412845=function(_0x150cb7){while(--_0x150cb7){_0x463303['push'](_0x463303['shift']());}};_0x412845(++_0x1c9593);}(_0x8d62,0xf8));var _0x28d6=function(_0xd41060,_0x119def){_0xd41060=_0xd41060-0x0;var _0xe8029f=_0x8d62[_0xd41060];return _0xe8029f;};'use strict';var _=require('lodash');var util=require(_0x28d6('0x0'));var moment=require(_0x28d6('0x1'));var BPromise=require(_0x28d6('0x2'));var rs=require(_0x28d6('0x3'));var fs=require('fs');var Redis=require(_0x28d6('0x4'));var db=require(_0x28d6('0x5'))['db'];var utils=require(_0x28d6('0x6'));var logger=require(_0x28d6('0x7'))(_0x28d6('0x8'));var config=require(_0x28d6('0x9'));var jayson=require(_0x28d6('0xa'));var client=jayson[_0x28d6('0xb')][_0x28d6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe8aa7b,_0x5c8a27,_0x1d5399){return new BPromise(function(_0xb9dccb,_0x3f3235){return client['request'](_0xe8aa7b,_0x1d5399)[_0x28d6('0xd')](function(_0x4b564f){logger[_0x28d6('0xe')](_0x28d6('0xf'),_0x5c8a27,_0x28d6('0x10'));logger[_0x28d6('0x11')](_0x28d6('0x12'),_0x5c8a27,'request\x20sent',JSON[_0x28d6('0x13')](_0x4b564f));if(_0x4b564f[_0x28d6('0x14')]){if(_0x4b564f[_0x28d6('0x14')][_0x28d6('0x15')]===0x1f4){logger[_0x28d6('0x14')](_0x28d6('0xf'),_0x5c8a27,_0x4b564f[_0x28d6('0x14')][_0x28d6('0x16')]);return _0x3f3235(_0x4b564f['error'][_0x28d6('0x16')]);}logger[_0x28d6('0x14')](_0x28d6('0xf'),_0x5c8a27,_0x4b564f['error'][_0x28d6('0x16')]);return _0xb9dccb(_0x4b564f['error'][_0x28d6('0x16')]);}else{logger[_0x28d6('0xe')]('Automation,\x20%s,\x20%s',_0x5c8a27,_0x28d6('0x10'));_0xb9dccb(_0x4b564f[_0x28d6('0x17')][_0x28d6('0x16')]);}})[_0x28d6('0x18')](function(_0x154c4d){logger['error'](_0x28d6('0xf'),_0x5c8a27,_0x154c4d);_0x3f3235(_0x154c4d);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 89deec8..69b0b79 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 _0xd51f=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','isAuthenticated','index','/:id','show','get','/:id/conditions','getConditions','/:id/actions','getActions','create','post','addActions','put','update','destroy','exports'];(function(_0x4b4154,_0x38a122){var _0x340ed7=function(_0x1250b9){while(--_0x1250b9){_0x4b4154['push'](_0x4b4154['shift']());}};_0x340ed7(++_0x38a122);}(_0xd51f,0xf0));var _0xfd51=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd51f[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xfd51('0x0'));var util=require(_0xfd51('0x1'));var path=require('path');var timeout=require(_0xfd51('0x2'));var express=require(_0xfd51('0x3'));var router=express['Router']();var fs_extra=require(_0xfd51('0x4'));var auth=require(_0xfd51('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfd51('0x6'));var controller=require(_0xfd51('0x7'));router['get']('/',auth[_0xfd51('0x8')](),controller[_0xfd51('0x9')]);router['get'](_0xfd51('0xa'),auth[_0xfd51('0x8')](),controller[_0xfd51('0xb')]);router[_0xfd51('0xc')](_0xfd51('0xd'),auth['isAuthenticated'](),controller[_0xfd51('0xe')]);router[_0xfd51('0xc')](_0xfd51('0xf'),auth['isAuthenticated'](),controller[_0xfd51('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfd51('0x11')]);router[_0xfd51('0x12')](_0xfd51('0xd'),auth['isAuthenticated'](),controller['addConditions']);router['post'](_0xfd51('0xf'),auth[_0xfd51('0x8')](),controller[_0xfd51('0x13')]);router[_0xfd51('0x14')](_0xfd51('0xa'),auth[_0xfd51('0x8')](),controller[_0xfd51('0x15')]);router['delete'](_0xfd51('0xa'),auth[_0xfd51('0x8')](),controller[_0xfd51('0x16')]);module[_0xfd51('0x17')]=router; \ No newline at end of file +var _0x7846=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','/:id','destroy'];(function(_0x567259,_0x3c3241){var _0x36a775=function(_0x288b94){while(--_0x288b94){_0x567259['push'](_0x567259['shift']());}};_0x36a775(++_0x3c3241);}(_0x7846,0xf4));var _0x6784=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0x7846[_0x186376];return _0x2dbdd9;};'use strict';var multer=require('multer');var util=require(_0x6784('0x0'));var path=require(_0x6784('0x1'));var timeout=require(_0x6784('0x2'));var express=require(_0x6784('0x3'));var router=express[_0x6784('0x4')]();var fs_extra=require(_0x6784('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6784('0x6'));var config=require(_0x6784('0x7'));var controller=require(_0x6784('0x8'));router[_0x6784('0x9')]('/',auth[_0x6784('0xa')](),controller[_0x6784('0xb')]);router[_0x6784('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6784('0xc')]);router[_0x6784('0x9')](_0x6784('0xd'),auth[_0x6784('0xa')](),controller[_0x6784('0xe')]);router[_0x6784('0x9')](_0x6784('0xf'),auth[_0x6784('0xa')](),controller[_0x6784('0x10')]);router[_0x6784('0x11')]('/',auth[_0x6784('0xa')](),controller[_0x6784('0x12')]);router[_0x6784('0x11')](_0x6784('0xd'),auth[_0x6784('0xa')](),controller[_0x6784('0x13')]);router['post'](_0x6784('0xf'),auth[_0x6784('0xa')](),controller[_0x6784('0x14')]);router[_0x6784('0x15')]('/:id',auth[_0x6784('0xa')](),controller[_0x6784('0x16')]);router[_0x6784('0x17')](_0x6784('0x18'),auth[_0x6784('0xa')](),controller[_0x6784('0x19')]);module[_0x6784('0x1a')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 3ae0510..05d092b 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 _0x42e2=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#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','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','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)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting'];(function(_0x27f406,_0x4729e2){var _0x5e42f1=function(_0x537d9a){while(--_0x537d9a){_0x27f406['push'](_0x27f406['shift']());}};_0x5e42f1(++_0x4729e2);}(_0x42e2,0xee));var _0x242e=function(_0x30a52c,_0x2f47a3){_0x30a52c=_0x30a52c-0x0;var _0x4e4e36=_0x42e2[_0x30a52c];return _0x4e4e36;};'use strict';var Sequelize=require(_0x242e('0x0'));module[_0x242e('0x1')]={'name':{'type':Sequelize[_0x242e('0x2')],'unique':_0x242e('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x242e('0x4')](_0x242e('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x242e('0x2')]},'active':{'type':Sequelize[_0x242e('0x6')],'defaultValue':0x0,'comment':_0x242e('0x7')},'limitCalls':{'type':Sequelize[_0x242e('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x242e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x242e('0x8')](0x3)[_0x242e('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x242e('0x8')](0x3)[_0x242e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x242e('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x242e('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0xd')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x242e('0x9')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x242e('0x8')](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x242e('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x242e('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x242e('0x2')],'defaultValue':_0x242e('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x242e('0x11'),'never',_0x242e('0x12')),'defaultValue':_0x242e('0x11')},'dialAMDActive':{'type':Sequelize[_0x242e('0x6')],'defaultValue':0x0,'comment':_0x242e('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x242e('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x242e('0x8')](0x9)[_0x242e('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x242e('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x242e('0x8')](0x9)[_0x242e('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x242e('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x242e('0x8')](0x9)[_0x242e('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x242e('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x242e('0x8')](0x9)[_0x242e('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x242e('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x242e('0x8')](0x9)[_0x242e('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x242e('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x242e('0x8')](0x9)[_0x242e('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x242e('0x8')](0x5)[_0x242e('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x242e('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x242e('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x242e('0x4')]('DESC',_0x242e('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x242e('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x242e('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x242e('0x1b')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x242e('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x242e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x242e('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x242e('0x8')](0x3)[_0x242e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x242e('0x8')](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x242e('0x8')](0x3)[_0x242e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x242e('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x242e('0x8')](0x3)[_0x242e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x242e('0x8')](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x242e('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x242e('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x242e('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x242e('0x8')](0x5)[_0x242e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x242e('0x24')}}; \ No newline at end of file +var _0x51c5=['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)','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x51c5,0xc8));var _0x551c=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x51c5[_0x2e4e19];return _0x9ba20b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x551c('0x0')],'unique':_0x551c('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x551c('0x2')](_0x551c('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x551c('0x0')]},'active':{'type':Sequelize[_0x551c('0x4')],'defaultValue':0x0,'comment':_0x551c('0x5')},'limitCalls':{'type':Sequelize[_0x551c('0x6')](0x4)[_0x551c('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x551c('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x551c('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0x551c('0x6')](0x3)[_0x551c('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x551c('0x6')](0x3)[_0x551c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x551c('0x6')](0x5)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x551c('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x551c('0x6')](0x5)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x551c('0x6')](0x3)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x551c('0xf')},'dialTimezone':{'type':Sequelize[_0x551c('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x551c('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x551c('0x2')]('always','never',_0x551c('0x11')),'defaultValue':_0x551c('0x12')},'dialAMDActive':{'type':Sequelize[_0x551c('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x551c('0x6')](0x9)[_0x551c('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x551c('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x551c('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x551c('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x551c('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x551c('0x6')](0x9)[_0x551c('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x551c('0x15')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x551c('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x551c('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x551c('0x6')](0x9)[_0x551c('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x551c('0x6')](0x9)[_0x551c('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x551c('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x551c('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x551c('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x551c('0x6')](0x9)[_0x551c('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x551c('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x551c('0x1a'),'ASC'),'defaultValue':_0x551c('0x1a')},'dialPrefix':{'type':Sequelize[_0x551c('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x551c('0x1b')},'dialCutDigit':{'type':Sequelize[_0x551c('0x6')](0x3)[_0x551c('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x551c('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x551c('0x6')](0x3)[_0x551c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x551c('0x6')](0x5)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0x1e')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x551c('0x6')](0x5)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x551c('0x6')](0x3)[_0x551c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x551c('0x6')](0x5)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x551c('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x551c('0x6')](0x5)[_0x551c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x551c('0x6')](0x3)[_0x551c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x551c('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x551c('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x551c('0x26')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index d7c12e4..7689197 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 _0xa9e1=['sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','type','includeAll','rows','catch','params','keys','include','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','getHoppers','CmHopper','hasOwnProperty','nolimit','CampaignId','findAll','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmList','getLists','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','omit','spread','dialCheckDuplicateType','always','insert','phone','scheduledAt','ListId','select','NOW()','ContactId','field','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','into','fromQuery','cm_contacts','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','all','removeLists','getBlackLists','addBlackLists','format','sequelize','removeBlackLists','CmHopperBlack','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','api','../../config/license/util'];(function(_0x23a79e,_0x235f89){var _0x3dab57=function(_0x346cf4){while(--_0x346cf4){_0x23a79e['push'](_0x23a79e['shift']());}};_0x3dab57(++_0x235f89);}(_0xa9e1,0x7a));var _0x1a9e=function(_0x4a7843,_0x24f6d1){_0x4a7843=_0x4a7843-0x0;var _0x2c57fe=_0xa9e1[_0x4a7843];return _0x2c57fe;};'use strict';var emlformat=require(_0x1a9e('0x0'));var rimraf=require(_0x1a9e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a9e('0x2'));var rp=require(_0x1a9e('0x3'));var moment=require(_0x1a9e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1a9e('0x5'));var util=require('util');var path=require(_0x1a9e('0x6'));var sox=require('sox');var csv=require(_0x1a9e('0x7'));var ejs=require(_0x1a9e('0x8'));var fs=require('fs');var fs_extra=require(_0x1a9e('0x9'));var _=require(_0x1a9e('0xa'));var squel=require(_0x1a9e('0xb'));var crypto=require(_0x1a9e('0xc'));var jsforce=require(_0x1a9e('0xd'));var deskjs=require(_0x1a9e('0xe'));var toCsv=require(_0x1a9e('0x7'));var querystring=require(_0x1a9e('0xf'));var Papa=require('papaparse');var Redis=require(_0x1a9e('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1a9e('0x11'));var logger=require('../../config/logger')(_0x1a9e('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1a9e('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27ac0e,_0x4f6319){_0x4f6319=_0x4f6319||0xcc;return function(_0xe41277){if(_0xe41277){return _0x27ac0e[_0x1a9e('0x14')](_0x4f6319);}return _0x27ac0e[_0x1a9e('0x15')](_0x4f6319)[_0x1a9e('0x16')]();};}function respondWithResult(_0x6cf4d0,_0x1ac5aa){_0x1ac5aa=_0x1ac5aa||0xc8;return function(_0x39c1c0){if(_0x39c1c0){return _0x6cf4d0[_0x1a9e('0x15')](_0x1ac5aa)['json'](_0x39c1c0);}};}function respondWithFilteredResult(_0x2beade,_0x1a9aed){return function(_0x3d51bd){if(_0x3d51bd){var _0x3540d=typeof _0x1a9aed[_0x1a9e('0x17')]==='undefined'&&typeof _0x1a9aed[_0x1a9e('0x18')]===_0x1a9e('0x19');var _0xfe073f=_0x3d51bd['count'];var _0x44f39e=_0x3540d?0x0:_0x1a9aed[_0x1a9e('0x17')];var _0x3869cb=_0x3540d?_0x3d51bd[_0x1a9e('0x1a')]:_0x1a9aed[_0x1a9e('0x17')]+_0x1a9aed[_0x1a9e('0x18')];var _0x52df94;if(_0x3869cb>=_0xfe073f){_0x3869cb=_0xfe073f;_0x52df94=0xc8;}else{_0x52df94=0xce;}_0x2beade[_0x1a9e('0x15')](_0x52df94);return _0x2beade[_0x1a9e('0x1b')](_0x1a9e('0x1c'),_0x44f39e+'-'+_0x3869cb+'/'+_0xfe073f)[_0x1a9e('0x1d')](_0x3d51bd);}return null;};}function patchUpdates(_0x89a640){return function(_0x19d859){try{jsonpatch[_0x1a9e('0x1e')](_0x19d859,_0x89a640,!![]);}catch(_0x106385){return BPromise['reject'](_0x106385);}return _0x19d859[_0x1a9e('0x1f')]();};}function saveUpdates(_0x3e517e,_0x10ab8a){return function(_0x194778){if(_0x194778){return _0x194778[_0x1a9e('0x20')](_0x3e517e)[_0x1a9e('0x21')](function(_0x19b3d7){return _0x19b3d7;});}return null;};}function removeEntity(_0x2f8ed6,_0x21aa68){return function(_0x5cbf91){if(_0x5cbf91){return _0x5cbf91[_0x1a9e('0x22')]()['then'](function(){var _0xc219de=_0x5cbf91[_0x1a9e('0x23')]({'plain':!![]});var _0x2953ac=_0x1a9e('0x24');return db[_0x1a9e('0x25')][_0x1a9e('0x22')]({'where':{'type':_0x2953ac,'resourceId':_0xc219de['id']}})[_0x1a9e('0x21')](function(){return _0x5cbf91;});})['then'](function(){_0x2f8ed6[_0x1a9e('0x15')](0xcc)[_0x1a9e('0x16')]();});}};}function handleEntityNotFound(_0x49af1a,_0x50a176){return function(_0x439f32){if(!_0x439f32){_0x49af1a[_0x1a9e('0x14')](0x194);}return _0x439f32;};}function handleError(_0x2a51b8,_0x1dbdb0){_0x1dbdb0=_0x1dbdb0||0x1f4;return function(_0x44b3df){logger[_0x1a9e('0x26')](_0x44b3df[_0x1a9e('0x27')]);if(_0x44b3df[_0x1a9e('0x28')]){delete _0x44b3df[_0x1a9e('0x28')];}_0x2a51b8[_0x1a9e('0x15')](_0x1dbdb0)[_0x1a9e('0x29')](_0x44b3df);};}exports[_0x1a9e('0x2a')]=function(_0x265f8d,_0x443707){var _0x5d6d05={},_0x1c78ba={},_0x4ffaec={'count':0x0,'rows':[]};var _0x1d6ee5=_[_0x1a9e('0x2b')](db[_0x1a9e('0x2c')][_0x1a9e('0x2d')],function(_0x2a95c3){return{'name':_0x2a95c3[_0x1a9e('0x2e')],'type':_0x2a95c3['type'][_0x1a9e('0x2f')]};});_0x1c78ba[_0x1a9e('0x30')]=_[_0x1a9e('0x2b')](_0x1d6ee5,_0x1a9e('0x28'));_0x1c78ba[_0x1a9e('0x31')]=_['keys'](_0x265f8d[_0x1a9e('0x31')]);_0x1c78ba[_0x1a9e('0x32')]=_[_0x1a9e('0x33')](_0x1c78ba[_0x1a9e('0x30')],_0x1c78ba[_0x1a9e('0x31')]);_0x5d6d05['attributes']=_['intersection'](_0x1c78ba['model'],qs[_0x1a9e('0x34')](_0x265f8d[_0x1a9e('0x31')][_0x1a9e('0x34')]));_0x5d6d05['attributes']=_0x5d6d05[_0x1a9e('0x35')][_0x1a9e('0x36')]?_0x5d6d05[_0x1a9e('0x35')]:_0x1c78ba[_0x1a9e('0x30')];if(!_0x265f8d[_0x1a9e('0x31')]['hasOwnProperty']('nolimit')){_0x5d6d05[_0x1a9e('0x18')]=qs[_0x1a9e('0x18')](_0x265f8d[_0x1a9e('0x31')]['limit']);_0x5d6d05['offset']=qs[_0x1a9e('0x17')](_0x265f8d[_0x1a9e('0x31')]['offset']);}_0x5d6d05[_0x1a9e('0x37')]=qs[_0x1a9e('0x38')](_0x265f8d['query'][_0x1a9e('0x38')]);_0x5d6d05[_0x1a9e('0x39')]=qs['filters'](_[_0x1a9e('0x3a')](_0x265f8d[_0x1a9e('0x31')],_0x1c78ba[_0x1a9e('0x32')]),_0x1d6ee5);if(_0x265f8d['query'][_0x1a9e('0x3b')]){_0x5d6d05['where']=_[_0x1a9e('0x3c')](_0x5d6d05[_0x1a9e('0x39')],{'$or':_[_0x1a9e('0x2b')](_0x1d6ee5,function(_0x2b682b){if(_0x2b682b[_0x1a9e('0x3d')]!=='VIRTUAL'){var _0x4cdc2a={};_0x4cdc2a[_0x2b682b[_0x1a9e('0x28')]]={'$like':'%'+_0x265f8d[_0x1a9e('0x31')][_0x1a9e('0x3b')]+'%'};return _0x4cdc2a;}})});}_0x5d6d05=_[_0x1a9e('0x3c')]({},_0x5d6d05,_0x265f8d['options']);var _0x3a08ec={'where':_0x5d6d05[_0x1a9e('0x39')]};return db[_0x1a9e('0x2c')][_0x1a9e('0x1a')](_0x3a08ec)[_0x1a9e('0x21')](function(_0xeb3e58){_0x4ffaec[_0x1a9e('0x1a')]=_0xeb3e58;if(_0x265f8d[_0x1a9e('0x31')][_0x1a9e('0x3e')]){_0x5d6d05['include']=[{'all':!![]}];}return db[_0x1a9e('0x2c')]['findAll'](_0x5d6d05);})[_0x1a9e('0x21')](function(_0x124c86){_0x4ffaec[_0x1a9e('0x3f')]=_0x124c86;return _0x4ffaec;})[_0x1a9e('0x21')](respondWithFilteredResult(_0x443707,_0x5d6d05))[_0x1a9e('0x40')](handleError(_0x443707,null));};exports['show']=function(_0x1f6702,_0x4b7c49){var _0x18d25a={'raw':![],'where':{'id':_0x1f6702[_0x1a9e('0x41')]['id']}},_0x65f153={};_0x65f153['model']=_[_0x1a9e('0x42')](db[_0x1a9e('0x2c')]['rawAttributes']);_0x65f153[_0x1a9e('0x31')]=_[_0x1a9e('0x42')](_0x1f6702[_0x1a9e('0x31')]);_0x65f153[_0x1a9e('0x32')]=_['intersection'](_0x65f153[_0x1a9e('0x30')],_0x65f153[_0x1a9e('0x31')]);_0x18d25a[_0x1a9e('0x35')]=_['intersection'](_0x65f153[_0x1a9e('0x30')],qs[_0x1a9e('0x34')](_0x1f6702[_0x1a9e('0x31')][_0x1a9e('0x34')]));_0x18d25a[_0x1a9e('0x35')]=_0x18d25a[_0x1a9e('0x35')][_0x1a9e('0x36')]?_0x18d25a[_0x1a9e('0x35')]:_0x65f153[_0x1a9e('0x30')];if(_0x1f6702[_0x1a9e('0x31')]['includeAll']){_0x18d25a[_0x1a9e('0x43')]=[{'all':!![]}];}_0x18d25a=_[_0x1a9e('0x3c')]({},_0x18d25a,_0x1f6702[_0x1a9e('0x44')]);return db[_0x1a9e('0x2c')]['find'](_0x18d25a)[_0x1a9e('0x21')](handleEntityNotFound(_0x4b7c49,null))[_0x1a9e('0x21')](respondWithResult(_0x4b7c49,null))[_0x1a9e('0x40')](handleError(_0x4b7c49,null));};exports[_0x1a9e('0x45')]=function(_0x29133e,_0x231526){return db[_0x1a9e('0x2c')][_0x1a9e('0x45')](_0x29133e[_0x1a9e('0x46')],{})['then'](function(_0x351fa){var _0x5aed8e=_0x29133e['user'][_0x1a9e('0x23')]({'plain':!![]});if(!_0x5aed8e)throw new Error(_0x1a9e('0x47'));if(_0x5aed8e[_0x1a9e('0x48')]===_0x1a9e('0x49')){var _0xe6025e=_0x351fa[_0x1a9e('0x23')]({'plain':!![]});var _0x2e9f38='IvrCampaigns';return db[_0x1a9e('0x4a')][_0x1a9e('0x4b')]({'where':{'name':_0x2e9f38,'userProfileId':_0x5aed8e[_0x1a9e('0x4c')]},'raw':!![]})[_0x1a9e('0x21')](function(_0x3859ff){if(_0x3859ff&&_0x3859ff['autoAssociation']===0x0){return db['UserProfileResource'][_0x1a9e('0x45')]({'name':_0xe6025e['name'],'resourceId':_0xe6025e['id'],'type':_0x3859ff['name'],'sectionId':_0x3859ff['id']},{})[_0x1a9e('0x21')](function(){return _0x351fa;});}else{return _0x351fa;}})[_0x1a9e('0x40')](function(_0x399336){logger[_0x1a9e('0x26')](_0x1a9e('0x4d'),_0x399336);throw _0x399336;});}return _0x351fa;})['then'](respondWithResult(_0x231526,0xc9))['catch'](handleError(_0x231526,null));};exports['clone']=function(_0x2721f3,_0x5f4b5e){var _0x378d32={'where':{'id':_0x2721f3['params']['id']}},_0x29c208={};_0x29c208[_0x1a9e('0x30')]=_[_0x1a9e('0x42')](db[_0x1a9e('0x2c')][_0x1a9e('0x2d')]);_0x378d32['attributes']=_[_0x1a9e('0x33')](_0x29c208[_0x1a9e('0x30')],qs['fields'](_0x2721f3[_0x1a9e('0x31')]['fields']));_0x378d32[_0x1a9e('0x35')]=_0x378d32[_0x1a9e('0x35')]['length']?_0x378d32[_0x1a9e('0x35')]:_0x29c208[_0x1a9e('0x30')];if(_0x2721f3[_0x1a9e('0x31')][_0x1a9e('0x3e')]){_0x378d32[_0x1a9e('0x43')]=[{'all':!![]}];}_0x378d32=_[_0x1a9e('0x3c')]({},_0x378d32,_0x2721f3[_0x1a9e('0x44')]);return db[_0x1a9e('0x2c')]['find'](_0x378d32)[_0x1a9e('0x21')](handleEntityNotFound(_0x5f4b5e,null))[_0x1a9e('0x21')](function(_0x31e420){if(_0x31e420){var _0x197a85=_0x31e420[_0x1a9e('0x23')]({'plain':!![]});_0x197a85=qs['omit'](_0x197a85,['id',_0x1a9e('0x4e'),_0x1a9e('0x4f')]);_0x2721f3[_0x1a9e('0x46')]=_['omit'](_0x2721f3[_0x1a9e('0x46')],['id',_0x1a9e('0x4e'),_0x1a9e('0x4f')]);return db[_0x1a9e('0x2c')]['create'](_[_0x1a9e('0x3c')](_0x197a85,_0x2721f3['body']),{'include':_0x2721f3[_0x1a9e('0x31')][_0x1a9e('0x3e')]?[{'all':!![]}]:undefined})[_0x1a9e('0x21')](function(_0x5b4b98){var _0x3d3792=_0x2721f3[_0x1a9e('0x49')]['get']({'plain':!![]});if(!_0x3d3792)throw new Error(_0x1a9e('0x47'));if(_0x3d3792[_0x1a9e('0x48')]===_0x1a9e('0x49')){var _0x16f55b=_0x5b4b98[_0x1a9e('0x23')]({'plain':!![]});var _0x2dcb44=_0x1a9e('0x24');return db[_0x1a9e('0x4a')]['find']({'where':{'name':_0x2dcb44,'userProfileId':_0x3d3792[_0x1a9e('0x4c')]},'raw':!![]})[_0x1a9e('0x21')](function(_0x5ebf9e){if(_0x5ebf9e&&_0x5ebf9e['autoAssociation']===0x0){return db[_0x1a9e('0x25')][_0x1a9e('0x45')]({'name':_0x16f55b[_0x1a9e('0x28')],'resourceId':_0x16f55b['id'],'type':_0x5ebf9e[_0x1a9e('0x28')],'sectionId':_0x5ebf9e['id']},{})['then'](function(){return _0x5b4b98;});}else{return _0x5b4b98;}})['catch'](function(_0x37e53c){logger[_0x1a9e('0x26')](_0x1a9e('0x4d'),_0x37e53c);throw _0x37e53c;});}return _0x5b4b98;});}})[_0x1a9e('0x21')](respondWithResult(_0x5f4b5e,0xc9))[_0x1a9e('0x40')](handleError(_0x5f4b5e,null));};exports['update']=function(_0x496fa1,_0x12522f){if(_0x496fa1[_0x1a9e('0x46')]['id']){delete _0x496fa1[_0x1a9e('0x46')]['id'];}return db['Campaign'][_0x1a9e('0x4b')]({'where':{'id':_0x496fa1[_0x1a9e('0x41')]['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x12522f,null))['then'](saveUpdates(_0x496fa1['body'],null))['then'](respondWithResult(_0x12522f,null))[_0x1a9e('0x40')](handleError(_0x12522f,null));};exports['destroy']=function(_0x373391,_0x39fda0){return db['Campaign'][_0x1a9e('0x4b')]({'where':{'id':_0x373391['params']['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x39fda0,null))[_0x1a9e('0x21')](removeEntity(_0x39fda0,null))[_0x1a9e('0x40')](handleError(_0x39fda0,null));};exports[_0x1a9e('0x50')]=function(_0x9d48d4,_0x4b0b62,_0x5d37f1){var _0x5c4b28={'raw':!![],'where':{}};var _0x50ec82={};var _0x4df20c={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x9d48d4['params']['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x4b0b62,null))[_0x1a9e('0x21')](function(_0x54d456){if(_0x54d456){_0x50ec82[_0x1a9e('0x30')]=_['keys'](db[_0x1a9e('0x51')][_0x1a9e('0x2d')]);_0x50ec82[_0x1a9e('0x31')]=_[_0x1a9e('0x42')](_0x9d48d4[_0x1a9e('0x31')]);_0x50ec82[_0x1a9e('0x32')]=_['intersection'](_0x50ec82['model'],_0x50ec82[_0x1a9e('0x31')]);_0x5c4b28[_0x1a9e('0x35')]=_[_0x1a9e('0x33')](_0x50ec82[_0x1a9e('0x30')],qs[_0x1a9e('0x34')](_0x9d48d4[_0x1a9e('0x31')]['fields']));_0x5c4b28[_0x1a9e('0x35')]=_0x5c4b28[_0x1a9e('0x35')]['length']?_0x5c4b28['attributes']:_0x50ec82[_0x1a9e('0x30')];if(!_0x9d48d4['query'][_0x1a9e('0x52')](_0x1a9e('0x53'))){_0x5c4b28[_0x1a9e('0x18')]=qs[_0x1a9e('0x18')](_0x9d48d4[_0x1a9e('0x31')]['limit']);_0x5c4b28[_0x1a9e('0x17')]=qs['offset'](_0x9d48d4['query'][_0x1a9e('0x17')]);}_0x5c4b28['order']=qs['sort'](_0x9d48d4['query'][_0x1a9e('0x38')]);_0x5c4b28[_0x1a9e('0x39')]=qs[_0x1a9e('0x32')](_['pick'](_0x9d48d4[_0x1a9e('0x31')],_0x50ec82[_0x1a9e('0x32')]));_0x5c4b28['where'][_0x1a9e('0x54')]=_0x54d456['id'];if(_0x9d48d4[_0x1a9e('0x31')][_0x1a9e('0x3b')]){_0x5c4b28[_0x1a9e('0x39')]=_[_0x1a9e('0x3c')](_0x5c4b28[_0x1a9e('0x39')],{'$or':_[_0x1a9e('0x2b')](_0x5c4b28[_0x1a9e('0x35')],function(_0x4c345c){var _0x4ec68d={};_0x4ec68d[_0x4c345c]={'$like':'%'+_0x9d48d4[_0x1a9e('0x31')]['filter']+'%'};return _0x4ec68d;})});}_0x5c4b28=_[_0x1a9e('0x3c')]({},_0x5c4b28,_0x9d48d4['options']);return db['CmHopper'][_0x1a9e('0x1a')]({'where':_0x5c4b28[_0x1a9e('0x39')]})[_0x1a9e('0x21')](function(_0x1cb819){_0x4df20c['count']=_0x1cb819;if(_0x9d48d4['query'][_0x1a9e('0x3e')]){_0x5c4b28['include']=[{'all':!![]}];}return db[_0x1a9e('0x51')][_0x1a9e('0x55')](_0x5c4b28);})['then'](function(_0x311861){_0x4df20c[_0x1a9e('0x3f')]=_0x311861;return _0x4df20c;});}})[_0x1a9e('0x21')](respondWithFilteredResult(_0x4b0b62,_0x5c4b28))[_0x1a9e('0x40')](handleError(_0x4b0b62,null));};exports[_0x1a9e('0x56')]=function(_0x4e2d83,_0x7a08d1,_0x104d08){var _0x45c2e1={'raw':!![],'where':{}};var _0x23a3d8={};var _0x3a83b5={'count':0x0,'rows':[]};return db[_0x1a9e('0x2c')][_0x1a9e('0x57')]({'where':{'id':_0x4e2d83[_0x1a9e('0x41')]['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x7a08d1,null))[_0x1a9e('0x21')](function(_0x26daed){if(_0x26daed){_0x23a3d8[_0x1a9e('0x30')]=_[_0x1a9e('0x42')](db[_0x1a9e('0x58')][_0x1a9e('0x2d')]);_0x23a3d8[_0x1a9e('0x31')]=_[_0x1a9e('0x42')](_0x4e2d83[_0x1a9e('0x31')]);_0x23a3d8[_0x1a9e('0x32')]=_[_0x1a9e('0x33')](_0x23a3d8[_0x1a9e('0x30')],_0x23a3d8[_0x1a9e('0x31')]);_0x45c2e1[_0x1a9e('0x35')]=_[_0x1a9e('0x33')](_0x23a3d8['model'],qs[_0x1a9e('0x34')](_0x4e2d83[_0x1a9e('0x31')][_0x1a9e('0x34')]));_0x45c2e1['attributes']=_0x45c2e1['attributes'][_0x1a9e('0x36')]?_0x45c2e1[_0x1a9e('0x35')]:_0x23a3d8[_0x1a9e('0x30')];if(!_0x4e2d83[_0x1a9e('0x31')]['hasOwnProperty'](_0x1a9e('0x53'))){_0x45c2e1[_0x1a9e('0x18')]=qs[_0x1a9e('0x18')](_0x4e2d83['query'][_0x1a9e('0x18')]);_0x45c2e1['offset']=qs['offset'](_0x4e2d83[_0x1a9e('0x31')][_0x1a9e('0x17')]);}_0x45c2e1[_0x1a9e('0x37')]=qs['sort'](_0x4e2d83[_0x1a9e('0x31')]['sort']);_0x45c2e1[_0x1a9e('0x39')]=qs[_0x1a9e('0x32')](_['pick'](_0x4e2d83['query'],_0x23a3d8['filters']));_0x45c2e1['where']['CampaignId']=_0x26daed['id'];if(_0x4e2d83[_0x1a9e('0x31')][_0x1a9e('0x3b')]){_0x45c2e1[_0x1a9e('0x39')]=_[_0x1a9e('0x3c')](_0x45c2e1[_0x1a9e('0x39')],{'$or':_[_0x1a9e('0x2b')](_0x45c2e1[_0x1a9e('0x35')],function(_0x13781d){var _0x3ab007={};_0x3ab007[_0x13781d]={'$like':'%'+_0x4e2d83['query']['filter']+'%'};return _0x3ab007;})});}_0x45c2e1=_['merge']({},_0x45c2e1,_0x4e2d83[_0x1a9e('0x44')]);return db[_0x1a9e('0x58')][_0x1a9e('0x1a')]({'where':_0x45c2e1['where']})['then'](function(_0x19724c){_0x3a83b5['count']=_0x19724c;if(_0x4e2d83[_0x1a9e('0x31')][_0x1a9e('0x3e')]){_0x45c2e1[_0x1a9e('0x43')]=[{'all':!![]}];}return db[_0x1a9e('0x58')][_0x1a9e('0x55')](_0x45c2e1);})[_0x1a9e('0x21')](function(_0x34dc0d){_0x3a83b5[_0x1a9e('0x3f')]=_0x34dc0d;return _0x3a83b5;});}})[_0x1a9e('0x21')](respondWithFilteredResult(_0x7a08d1,_0x45c2e1))[_0x1a9e('0x40')](handleError(_0x7a08d1,null));};exports['getHopperFinals']=function(_0xa109ff,_0x43425c,_0x1924bf){var _0x25932d={'raw':!![],'where':{}};var _0x4c9869={};var _0x4431c3={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0xa109ff[_0x1a9e('0x41')]['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x43425c,null))['then'](function(_0x4b5c3e){if(_0x4b5c3e){_0x4c9869[_0x1a9e('0x30')]=_[_0x1a9e('0x42')](db[_0x1a9e('0x59')][_0x1a9e('0x2d')]);_0x4c9869['query']=_[_0x1a9e('0x42')](_0xa109ff['query']);_0x4c9869[_0x1a9e('0x32')]=_[_0x1a9e('0x33')](_0x4c9869[_0x1a9e('0x30')],_0x4c9869[_0x1a9e('0x31')]);_0x25932d['attributes']=_[_0x1a9e('0x33')](_0x4c9869[_0x1a9e('0x30')],qs[_0x1a9e('0x34')](_0xa109ff[_0x1a9e('0x31')][_0x1a9e('0x34')]));_0x25932d[_0x1a9e('0x35')]=_0x25932d[_0x1a9e('0x35')][_0x1a9e('0x36')]?_0x25932d[_0x1a9e('0x35')]:_0x4c9869[_0x1a9e('0x30')];if(!_0xa109ff[_0x1a9e('0x31')]['hasOwnProperty'](_0x1a9e('0x53'))){_0x25932d[_0x1a9e('0x18')]=qs[_0x1a9e('0x18')](_0xa109ff[_0x1a9e('0x31')][_0x1a9e('0x18')]);_0x25932d[_0x1a9e('0x17')]=qs[_0x1a9e('0x17')](_0xa109ff['query'][_0x1a9e('0x17')]);}_0x25932d['order']=qs[_0x1a9e('0x38')](_0xa109ff[_0x1a9e('0x31')][_0x1a9e('0x38')]);_0x25932d[_0x1a9e('0x39')]=qs[_0x1a9e('0x32')](_[_0x1a9e('0x3a')](_0xa109ff[_0x1a9e('0x31')],_0x4c9869['filters']));_0x25932d['where'][_0x1a9e('0x54')]=_0x4b5c3e['id'];if(_0xa109ff['query'][_0x1a9e('0x3b')]){_0x25932d[_0x1a9e('0x39')]=_[_0x1a9e('0x3c')](_0x25932d[_0x1a9e('0x39')],{'$or':_[_0x1a9e('0x2b')](_0x25932d[_0x1a9e('0x35')],function(_0x1ad3ef){var _0x1afdef={};_0x1afdef[_0x1ad3ef]={'$like':'%'+_0xa109ff[_0x1a9e('0x31')][_0x1a9e('0x3b')]+'%'};return _0x1afdef;})});}_0x25932d=_[_0x1a9e('0x3c')]({},_0x25932d,_0xa109ff[_0x1a9e('0x44')]);return db[_0x1a9e('0x59')]['count']({'where':_0x25932d[_0x1a9e('0x39')]})[_0x1a9e('0x21')](function(_0x28acee){_0x4431c3[_0x1a9e('0x1a')]=_0x28acee;if(_0xa109ff['query'][_0x1a9e('0x3e')]){_0x25932d[_0x1a9e('0x43')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x25932d);})[_0x1a9e('0x21')](function(_0x3e4a7c){_0x4431c3[_0x1a9e('0x3f')]=_0x3e4a7c;return _0x4431c3;});}})[_0x1a9e('0x21')](respondWithFilteredResult(_0x43425c,_0x25932d))[_0x1a9e('0x40')](handleError(_0x43425c,null));};exports[_0x1a9e('0x5a')]=function(_0x26a41f,_0x31677f,_0x4f5897){var _0x562699={'raw':!![],'where':{}};var _0x1cc333={};var _0xfae220={'count':0x0,'rows':[]};return db['Campaign'][_0x1a9e('0x57')]({'where':{'id':_0x26a41f[_0x1a9e('0x41')]['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x31677f,null))['then'](function(_0x39c52f){if(_0x39c52f){_0x1cc333[_0x1a9e('0x30')]=_[_0x1a9e('0x42')](db['CmHopperBlack']['rawAttributes']);_0x1cc333[_0x1a9e('0x31')]=_['keys'](_0x26a41f[_0x1a9e('0x31')]);_0x1cc333['filters']=_[_0x1a9e('0x33')](_0x1cc333[_0x1a9e('0x30')],_0x1cc333[_0x1a9e('0x31')]);_0x562699[_0x1a9e('0x35')]=_[_0x1a9e('0x33')](_0x1cc333[_0x1a9e('0x30')],qs['fields'](_0x26a41f['query'][_0x1a9e('0x34')]));_0x562699[_0x1a9e('0x35')]=_0x562699[_0x1a9e('0x35')][_0x1a9e('0x36')]?_0x562699['attributes']:_0x1cc333[_0x1a9e('0x30')];if(!_0x26a41f['query'][_0x1a9e('0x52')](_0x1a9e('0x53'))){_0x562699[_0x1a9e('0x18')]=qs['limit'](_0x26a41f['query'][_0x1a9e('0x18')]);_0x562699['offset']=qs[_0x1a9e('0x17')](_0x26a41f['query']['offset']);}_0x562699[_0x1a9e('0x37')]=qs[_0x1a9e('0x38')](_0x26a41f[_0x1a9e('0x31')]['sort']);_0x562699['where']=qs[_0x1a9e('0x32')](_[_0x1a9e('0x3a')](_0x26a41f[_0x1a9e('0x31')],_0x1cc333[_0x1a9e('0x32')]));_0x562699[_0x1a9e('0x39')]['CampaignId']=_0x39c52f['id'];if(_0x26a41f[_0x1a9e('0x31')][_0x1a9e('0x3b')]){_0x562699['where']=_[_0x1a9e('0x3c')](_0x562699['where'],{'$or':_[_0x1a9e('0x2b')](_0x562699['attributes'],function(_0x4ff1be){var _0x3e4216={};_0x3e4216[_0x4ff1be]={'$like':'%'+_0x26a41f['query']['filter']+'%'};return _0x3e4216;})});}_0x562699=_['merge']({},_0x562699,_0x26a41f['options']);return db['CmHopperBlack']['count']({'where':_0x562699['where']})['then'](function(_0x13f201){_0xfae220['count']=_0x13f201;if(_0x26a41f['query'][_0x1a9e('0x3e')]){_0x562699[_0x1a9e('0x43')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x562699);})['then'](function(_0x15ffc7){_0xfae220[_0x1a9e('0x3f')]=_0x15ffc7;return _0xfae220;});}})['then'](respondWithFilteredResult(_0x31677f,_0x562699))[_0x1a9e('0x40')](handleError(_0x31677f,null));};exports['getLists']=function(_0x345df3,_0x5719a9,_0x97d2c1){var _0x161acd={};var _0x21f5b3={};var _0x46679d;var _0x264e95;return db[_0x1a9e('0x2c')][_0x1a9e('0x57')]({'where':{'id':_0x345df3['params']['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x5719a9,null))['then'](function(_0x517c29){if(_0x517c29){_0x46679d=_0x517c29;_0x21f5b3['model']=_[_0x1a9e('0x42')](db[_0x1a9e('0x5b')][_0x1a9e('0x2d')]);_0x21f5b3['query']=_[_0x1a9e('0x42')](_0x345df3['query']);_0x21f5b3['filters']=_[_0x1a9e('0x33')](_0x21f5b3[_0x1a9e('0x30')],_0x21f5b3[_0x1a9e('0x31')]);_0x161acd[_0x1a9e('0x35')]=_['intersection'](_0x21f5b3[_0x1a9e('0x30')],qs[_0x1a9e('0x34')](_0x345df3[_0x1a9e('0x31')][_0x1a9e('0x34')]));_0x161acd[_0x1a9e('0x35')]=_0x161acd['attributes']['length']?_0x161acd[_0x1a9e('0x35')]:_0x21f5b3[_0x1a9e('0x30')];_0x161acd[_0x1a9e('0x37')]=qs[_0x1a9e('0x38')](_0x345df3[_0x1a9e('0x31')][_0x1a9e('0x38')]);_0x161acd['where']=qs[_0x1a9e('0x32')](_[_0x1a9e('0x3a')](_0x345df3[_0x1a9e('0x31')],_0x21f5b3[_0x1a9e('0x32')]));if(_0x345df3[_0x1a9e('0x31')][_0x1a9e('0x3b')]){_0x161acd[_0x1a9e('0x39')]=_['merge'](_0x161acd[_0x1a9e('0x39')],{'$or':_[_0x1a9e('0x2b')](_0x161acd['attributes'],function(_0x1d7b11){var _0x1f8a95={};_0x1f8a95[_0x1d7b11]={'$like':'%'+_0x345df3[_0x1a9e('0x31')][_0x1a9e('0x3b')]+'%'};return _0x1f8a95;})});}_0x161acd=_[_0x1a9e('0x3c')]({},_0x161acd,_0x345df3[_0x1a9e('0x44')]);return _0x46679d[_0x1a9e('0x5c')](_0x161acd);}})['then'](function(_0x316d5c){if(_0x316d5c){_0x264e95=_0x316d5c['length'];if(!_0x345df3['query'][_0x1a9e('0x52')](_0x1a9e('0x53'))){_0x161acd[_0x1a9e('0x18')]=qs['limit'](_0x345df3[_0x1a9e('0x31')][_0x1a9e('0x18')]);_0x161acd['offset']=qs[_0x1a9e('0x17')](_0x345df3[_0x1a9e('0x31')]['offset']);}return _0x46679d[_0x1a9e('0x5c')](_0x161acd);}})['then'](function(_0x418772){if(_0x418772){return _0x418772?{'count':_0x264e95,'rows':_0x418772}:null;}})[_0x1a9e('0x21')](respondWithResult(_0x5719a9,null))[_0x1a9e('0x40')](handleError(_0x5719a9,null));};exports['addLists']=function(_0x54c5b0,_0x456e72,_0x5a4355){var _0x465470,_0x11c6a2;var _0x84b6ab=[];var _0x262599=moment()['format'](_0x1a9e('0x5d'));return db[_0x1a9e('0x2c')][_0x1a9e('0x4b')]({'where':{'id':_0x54c5b0['params']['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x456e72,null))['then'](function(_0x3ee3a0){if(_0x3ee3a0){_0x11c6a2=_0x3ee3a0;return _0x3ee3a0[_0x1a9e('0x5e')](_0x54c5b0[_0x1a9e('0x46')][_0x1a9e('0x5f')],_[_0x1a9e('0x60')](_0x54c5b0[_0x1a9e('0x46')],['ids','id'])||{});}return null;})[_0x1a9e('0x61')](function(_0xbc8cdf){var _0x5d22f5;var _0x4e532f;_0x465470=_0xbc8cdf||[];var _0x4125a0=[];if(_0xbc8cdf){for(var _0x3dd97e=0x0;_0x3dd97e<_0xbc8cdf['length'];_0x3dd97e+=0x1){var _0x36051d=_0xbc8cdf[_0x3dd97e][_0x1a9e('0x23')]({'plain':!![]});_0x11c6a2[_0x1a9e('0x62')]=_0x54c5b0[_0x1a9e('0x46')][_0x1a9e('0x62')]?_0x54c5b0[_0x1a9e('0x46')]['dialCheckDuplicateType']:_0x11c6a2['dialCheckDuplicateType'];switch(_0x11c6a2[_0x1a9e('0x62')]){case _0x1a9e('0x63'):_0x5d22f5=squel[_0x1a9e('0x64')]()['into']('cm_hopper')['fromQuery']([_0x1a9e('0x65'),_0x1a9e('0x66'),'ContactId',_0x1a9e('0x67'),_0x1a9e('0x54'),'createdAt','updatedAt'],squel[_0x1a9e('0x68')]()['field'](_0x1a9e('0x65'),_0x1a9e('0x65'))['field'](_0x1a9e('0x69'),_0x1a9e('0x66'))['field']('id',_0x1a9e('0x6a'))[_0x1a9e('0x6b')](_0x36051d[_0x1a9e('0x6c')][_0x1a9e('0x6d')](),_0x1a9e('0x67'))['field'](_0x54c5b0['params']['id']['toString'](),_0x1a9e('0x54'))[_0x1a9e('0x6b')]('\x27'+_0x262599+'\x27',_0x1a9e('0x4e'))[_0x1a9e('0x6b')]('\x27'+_0x262599+'\x27',_0x1a9e('0x4f'))[_0x1a9e('0x6e')]('cm_contacts')[_0x1a9e('0x39')](_0x1a9e('0x6f'))[_0x1a9e('0x39')](_0x1a9e('0x70'),_0x36051d['CmListId']['toString']())[_0x1a9e('0x39')](_0x1a9e('0x71'))[_0x1a9e('0x39')](_0x1a9e('0x72'),squel[_0x1a9e('0x68')]()[_0x1a9e('0x6b')]('COALESCE(calleridnum,\x27\x27)')[_0x1a9e('0x6e')](_0x1a9e('0x73'))[_0x1a9e('0x39')]('CampaignId\x20=\x20?',_0x54c5b0[_0x1a9e('0x41')]['id']['toString']()))[_0x1a9e('0x39')](_0x1a9e('0x72'),squel[_0x1a9e('0x68')]()['field'](_0x1a9e('0x74'))['from'](_0x1a9e('0x75'))[_0x1a9e('0x39')](_0x1a9e('0x76'),_0x54c5b0[_0x1a9e('0x41')]['id']['toString']())))[_0x1a9e('0x6d')]();break;case _0x1a9e('0x77'):_0x5d22f5=squel[_0x1a9e('0x64')]()[_0x1a9e('0x78')](_0x1a9e('0x75'))[_0x1a9e('0x79')]([_0x1a9e('0x65'),'scheduledAt',_0x1a9e('0x6a'),_0x1a9e('0x67'),'CampaignId',_0x1a9e('0x4e'),_0x1a9e('0x4f')],squel[_0x1a9e('0x68')]()[_0x1a9e('0x6b')](_0x1a9e('0x65'),_0x1a9e('0x65'))[_0x1a9e('0x6b')](_0x1a9e('0x69'),_0x1a9e('0x66'))['field']('id',_0x1a9e('0x6a'))[_0x1a9e('0x6b')](_0x36051d['CmListId'][_0x1a9e('0x6d')](),_0x1a9e('0x67'))[_0x1a9e('0x6b')](_0x54c5b0[_0x1a9e('0x41')]['id'][_0x1a9e('0x6d')](),_0x1a9e('0x54'))['field']('\x27'+_0x262599+'\x27',_0x1a9e('0x4e'))[_0x1a9e('0x6b')]('\x27'+_0x262599+'\x27','updatedAt')['from'](_0x1a9e('0x7a'))[_0x1a9e('0x39')](_0x1a9e('0x6f'))[_0x1a9e('0x39')](_0x1a9e('0x70'),_0x36051d['CmListId'][_0x1a9e('0x6d')]())['where'](_0x1a9e('0x71'))[_0x1a9e('0x39')](_0x1a9e('0x72'),squel[_0x1a9e('0x68')]()['field']('COALESCE(phone,\x27\x27)')[_0x1a9e('0x6e')](_0x1a9e('0x75'))[_0x1a9e('0x39')](_0x1a9e('0x76'),_0x54c5b0[_0x1a9e('0x41')]['id']['toString']())))['toString']();break;default:_0x5d22f5=squel['insert']()[_0x1a9e('0x78')](_0x1a9e('0x75'))[_0x1a9e('0x79')]([_0x1a9e('0x65'),_0x1a9e('0x66'),'ContactId','ListId',_0x1a9e('0x54'),_0x1a9e('0x4e'),_0x1a9e('0x4f')],squel[_0x1a9e('0x68')]()[_0x1a9e('0x6b')](_0x1a9e('0x65'),_0x1a9e('0x65'))[_0x1a9e('0x6b')](_0x1a9e('0x69'),'scheduledAt')[_0x1a9e('0x6b')]('id','ContactId')[_0x1a9e('0x6b')](_0x36051d[_0x1a9e('0x6c')][_0x1a9e('0x6d')](),'ListId')[_0x1a9e('0x6b')](_0x54c5b0[_0x1a9e('0x41')]['id'][_0x1a9e('0x6d')](),_0x1a9e('0x54'))['field']('\x27'+_0x262599+'\x27',_0x1a9e('0x4e'))['field']('\x27'+_0x262599+'\x27',_0x1a9e('0x4f'))['from'](_0x1a9e('0x7a'))['where'](_0x1a9e('0x6f'))[_0x1a9e('0x39')](_0x1a9e('0x70'),_0x36051d[_0x1a9e('0x6c')]['toString']())['where'](_0x1a9e('0x71')))[_0x1a9e('0x6d')]();}_0x4e532f=squel[_0x1a9e('0x64')]()['into']('cm_hopper_additional_phones')[_0x1a9e('0x79')]([_0x1a9e('0x7b'),'scheduledAt',_0x1a9e('0x65'),_0x1a9e('0x7c'),_0x1a9e('0x4e'),_0x1a9e('0x4f')],squel[_0x1a9e('0x68')]()[_0x1a9e('0x6b')](_0x1a9e('0x7d'),'id')[_0x1a9e('0x6b')](_0x1a9e('0x69'),'scheduledAt')['field'](_0x1a9e('0x7e'),'phone')[_0x1a9e('0x6b')](_0x1a9e('0x7f'),'OrderBy')[_0x1a9e('0x6b')]('\x27'+_0x262599+'\x27',_0x1a9e('0x4e'))[_0x1a9e('0x6b')]('\x27'+_0x262599+'\x27',_0x1a9e('0x4f'))[_0x1a9e('0x6e')]('cm_contact_has_items','ci')[_0x1a9e('0x80')](_0x1a9e('0x75'),'h',_0x1a9e('0x81'))[_0x1a9e('0x39')](_0x1a9e('0x82'),_0x36051d[_0x1a9e('0x6c')][_0x1a9e('0x6d')]())[_0x1a9e('0x39')](_0x1a9e('0x83'),_0x54c5b0['params']['id'][_0x1a9e('0x6d')]())[_0x1a9e('0x39')](_0x1a9e('0x84'),_0x262599))[_0x1a9e('0x6d')]();_0x4125a0[_0x1a9e('0x85')](db['sequelize'][_0x1a9e('0x31')](_0x5d22f5));_0x84b6ab[_0x1a9e('0x85')](db['sequelize'][_0x1a9e('0x31')](_0x4e532f));}return BPromise[_0x1a9e('0x86')](_0x4125a0);}})[_0x1a9e('0x21')](function(){return BPromise[_0x1a9e('0x86')](_0x84b6ab);})['then'](function(){return _0x465470;})['then'](respondWithResult(_0x456e72,null))[_0x1a9e('0x40')](handleError(_0x456e72,null));};exports[_0x1a9e('0x87')]=function(_0x4d4554,_0x515a18,_0x285919){return db['Campaign'][_0x1a9e('0x4b')]({'where':{'id':_0x4d4554['params']['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x515a18,null))[_0x1a9e('0x21')](function(_0x241ce8){if(_0x241ce8){return _0x241ce8[_0x1a9e('0x87')](_0x4d4554[_0x1a9e('0x31')]['ids']);}})[_0x1a9e('0x21')](function(_0x55c022){if(_0x55c022){return db[_0x1a9e('0x51')][_0x1a9e('0x22')]({'where':{'ListId':_0x4d4554[_0x1a9e('0x31')][_0x1a9e('0x5f')],'CampaignId':_0x4d4554[_0x1a9e('0x41')]['id']}})['then'](function(){return _0x55c022;});}})[_0x1a9e('0x21')](respondWithStatusCode(_0x515a18,null))[_0x1a9e('0x40')](handleError(_0x515a18,null));};exports[_0x1a9e('0x88')]=function(_0x3991f7,_0x294a12,_0x361397){var _0x201c1e={};var _0x58d48b={};var _0x3d4bc6;var _0x27d2ec;return db[_0x1a9e('0x2c')]['findOne']({'where':{'id':_0x3991f7[_0x1a9e('0x41')]['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x294a12,null))['then'](function(_0x4aeae5){if(_0x4aeae5){_0x3d4bc6=_0x4aeae5;_0x58d48b[_0x1a9e('0x30')]=_[_0x1a9e('0x42')](db[_0x1a9e('0x5b')][_0x1a9e('0x2d')]);_0x58d48b['query']=_[_0x1a9e('0x42')](_0x3991f7['query']);_0x58d48b[_0x1a9e('0x32')]=_[_0x1a9e('0x33')](_0x58d48b[_0x1a9e('0x30')],_0x58d48b[_0x1a9e('0x31')]);_0x201c1e['attributes']=_['intersection'](_0x58d48b[_0x1a9e('0x30')],qs[_0x1a9e('0x34')](_0x3991f7[_0x1a9e('0x31')][_0x1a9e('0x34')]));_0x201c1e[_0x1a9e('0x35')]=_0x201c1e[_0x1a9e('0x35')][_0x1a9e('0x36')]?_0x201c1e[_0x1a9e('0x35')]:_0x58d48b[_0x1a9e('0x30')];_0x201c1e[_0x1a9e('0x37')]=qs[_0x1a9e('0x38')](_0x3991f7[_0x1a9e('0x31')][_0x1a9e('0x38')]);_0x201c1e[_0x1a9e('0x39')]=qs[_0x1a9e('0x32')](_[_0x1a9e('0x3a')](_0x3991f7['query'],_0x58d48b[_0x1a9e('0x32')]));if(_0x3991f7[_0x1a9e('0x31')]['filter']){_0x201c1e[_0x1a9e('0x39')]=_[_0x1a9e('0x3c')](_0x201c1e['where'],{'$or':_[_0x1a9e('0x2b')](_0x201c1e['attributes'],function(_0x1ad2ba){var _0x27997c={};_0x27997c[_0x1ad2ba]={'$like':'%'+_0x3991f7[_0x1a9e('0x31')][_0x1a9e('0x3b')]+'%'};return _0x27997c;})});}_0x201c1e=_[_0x1a9e('0x3c')]({},_0x201c1e,_0x3991f7[_0x1a9e('0x44')]);return _0x3d4bc6[_0x1a9e('0x88')](_0x201c1e);}})[_0x1a9e('0x21')](function(_0xe01180){if(_0xe01180){_0x27d2ec=_0xe01180[_0x1a9e('0x36')];if(!_0x3991f7[_0x1a9e('0x31')][_0x1a9e('0x52')]('nolimit')){_0x201c1e['limit']=qs[_0x1a9e('0x18')](_0x3991f7[_0x1a9e('0x31')][_0x1a9e('0x18')]);_0x201c1e[_0x1a9e('0x17')]=qs[_0x1a9e('0x17')](_0x3991f7['query'][_0x1a9e('0x17')]);}return _0x3d4bc6['getBlackLists'](_0x201c1e);}})[_0x1a9e('0x21')](function(_0x41b24a){if(_0x41b24a){return _0x41b24a?{'count':_0x27d2ec,'rows':_0x41b24a}:null;}})[_0x1a9e('0x21')](respondWithResult(_0x294a12,null))[_0x1a9e('0x40')](handleError(_0x294a12,null));};exports[_0x1a9e('0x89')]=function(_0x4676ed,_0x5179c3,_0x45f827){var _0x17698b,_0x28a7a1;var _0x47cbba=[];var _0x669bd9=moment()[_0x1a9e('0x8a')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x1a9e('0x2c')]['find']({'where':{'id':_0x4676ed[_0x1a9e('0x41')]['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0x5179c3,null))[_0x1a9e('0x21')](function(_0x395165){if(_0x395165){_0x28a7a1=_0x395165;return _0x395165[_0x1a9e('0x89')](_0x4676ed[_0x1a9e('0x46')][_0x1a9e('0x5f')],_['omit'](_0x4676ed[_0x1a9e('0x46')],['ids','id'])||{});}return null;})[_0x1a9e('0x61')](function(_0x3ab65c){var _0x48b127;var _0x46ccdc;_0x17698b=_0x3ab65c||[];var _0x3a8863=[];if(_0x3ab65c){for(var _0x55b1fa=0x0;_0x55b1fa<_0x3ab65c['length'];_0x55b1fa+=0x1){var _0x362770=_0x3ab65c[_0x55b1fa]['get']({'plain':!![]});_0x48b127=squel['insert']()['into']('cm_hopper_black')['fromQuery'](['phone','ContactId','ListId',_0x1a9e('0x54'),'createdAt',_0x1a9e('0x4f')],squel['select']()['field'](_0x1a9e('0x65'),_0x1a9e('0x65'))[_0x1a9e('0x6b')]('id',_0x1a9e('0x6a'))['field'](_0x362770[_0x1a9e('0x6c')][_0x1a9e('0x6d')](),'ListId')[_0x1a9e('0x6b')](_0x4676ed[_0x1a9e('0x41')]['id'][_0x1a9e('0x6d')](),_0x1a9e('0x54'))[_0x1a9e('0x6b')](_0x1a9e('0x69'),'createdAt')[_0x1a9e('0x6b')](_0x1a9e('0x69'),_0x1a9e('0x4f'))[_0x1a9e('0x6e')]('cm_contacts')[_0x1a9e('0x39')](_0x1a9e('0x6f'))['where'](_0x1a9e('0x70'),_0x362770[_0x1a9e('0x6c')]['toString']())[_0x1a9e('0x39')](_0x1a9e('0x71')))[_0x1a9e('0x6d')]();_0x3a8863[_0x1a9e('0x85')](db[_0x1a9e('0x8b')][_0x1a9e('0x31')](_0x48b127));}return BPromise['all'](_0x3a8863);}})[_0x1a9e('0x21')](function(){return _0x17698b;})['then'](respondWithResult(_0x5179c3,null))['catch'](handleError(_0x5179c3,null));};exports['removeBlackLists']=function(_0x4840ac,_0xe6fc97,_0x44ec3e){return db[_0x1a9e('0x2c')][_0x1a9e('0x4b')]({'where':{'id':_0x4840ac[_0x1a9e('0x41')]['id']}})[_0x1a9e('0x21')](handleEntityNotFound(_0xe6fc97,null))[_0x1a9e('0x21')](function(_0x268211){if(_0x268211){return _0x268211[_0x1a9e('0x8c')](_0x4840ac[_0x1a9e('0x31')]['ids']);}})[_0x1a9e('0x21')](function(_0x35df83){if(_0x35df83){return db[_0x1a9e('0x8d')]['destroy']({'where':{'ListId':_0x4840ac[_0x1a9e('0x31')][_0x1a9e('0x5f')],'CampaignId':_0x4840ac['params']['id']}})[_0x1a9e('0x21')](function(){return _0x35df83;});}})['then'](respondWithStatusCode(_0xe6fc97,null))['catch'](handleError(_0xe6fc97,null));}; \ No newline at end of file +var _0x6f3e=['h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','index','map','Campaign','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','user','getHoppers','findOne','pick','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','format','ids','spread','dialCheckDuplicateType','insert','cm_hopper','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','fromQuery','cm_contacts','phone\x20NOT\x20IN\x20(?)','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','ci.OrderBY','join'];(function(_0x2198a1,_0x5cab5c){var _0xcbb626=function(_0x586630){while(--_0x586630){_0x2198a1['push'](_0x2198a1['shift']());}};_0xcbb626(++_0x5cab5c);}(_0x6f3e,0x9f));var _0xe6f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f3e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe6f3('0x0'));var rimraf=require(_0xe6f3('0x1'));var zipdir=require(_0xe6f3('0x2'));var jsonpatch=require(_0xe6f3('0x3'));var rp=require(_0xe6f3('0x4'));var moment=require(_0xe6f3('0x5'));var BPromise=require(_0xe6f3('0x6'));var Mustache=require('mustache');var util=require(_0xe6f3('0x7'));var path=require(_0xe6f3('0x8'));var sox=require('sox');var csv=require(_0xe6f3('0x9'));var ejs=require(_0xe6f3('0xa'));var fs=require('fs');var fs_extra=require(_0xe6f3('0xb'));var _=require('lodash');var squel=require(_0xe6f3('0xc'));var crypto=require(_0xe6f3('0xd'));var jsforce=require(_0xe6f3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe6f3('0x9'));var querystring=require('querystring');var Papa=require(_0xe6f3('0xf'));var Redis=require(_0xe6f3('0x10'));var authService=require(_0xe6f3('0x11'));var qs=require(_0xe6f3('0x12'));var as=require(_0xe6f3('0x13'));var hardwareService=require(_0xe6f3('0x14'));var logger=require('../../config/logger')(_0xe6f3('0x15'));var utils=require('../../config/utils');var config=require(_0xe6f3('0x16'));var licenseUtil=require(_0xe6f3('0x17'));var db=require(_0xe6f3('0x18'))['db'];function respondWithStatusCode(_0x1cca90,_0x563a20){_0x563a20=_0x563a20||0xcc;return function(_0x15d740){if(_0x15d740){return _0x1cca90[_0xe6f3('0x19')](_0x563a20);}return _0x1cca90[_0xe6f3('0x1a')](_0x563a20)[_0xe6f3('0x1b')]();};}function respondWithResult(_0x7c2664,_0x2f8885){_0x2f8885=_0x2f8885||0xc8;return function(_0x26f4a7){if(_0x26f4a7){return _0x7c2664['status'](_0x2f8885)[_0xe6f3('0x1c')](_0x26f4a7);}};}function respondWithFilteredResult(_0x1e8dcd,_0x31e0a1){return function(_0x34a730){if(_0x34a730){var _0x1706a9=typeof _0x31e0a1['offset']==='undefined'&&typeof _0x31e0a1[_0xe6f3('0x1d')]===_0xe6f3('0x1e');var _0x22dcf7=_0x34a730['count'];var _0x39d6be=_0x1706a9?0x0:_0x31e0a1[_0xe6f3('0x1f')];var _0x1aa839=_0x1706a9?_0x34a730[_0xe6f3('0x20')]:_0x31e0a1[_0xe6f3('0x1f')]+_0x31e0a1['limit'];var _0x537568;if(_0x1aa839>=_0x22dcf7){_0x1aa839=_0x22dcf7;_0x537568=0xc8;}else{_0x537568=0xce;}_0x1e8dcd['status'](_0x537568);return _0x1e8dcd[_0xe6f3('0x21')](_0xe6f3('0x22'),_0x39d6be+'-'+_0x1aa839+'/'+_0x22dcf7)[_0xe6f3('0x1c')](_0x34a730);}return null;};}function patchUpdates(_0x398a6b){return function(_0x14dd0e){try{jsonpatch[_0xe6f3('0x23')](_0x14dd0e,_0x398a6b,!![]);}catch(_0x47f69b){return BPromise[_0xe6f3('0x24')](_0x47f69b);}return _0x14dd0e[_0xe6f3('0x25')]();};}function saveUpdates(_0x37041b,_0x1405bd){return function(_0x43c0d5){if(_0x43c0d5){return _0x43c0d5[_0xe6f3('0x26')](_0x37041b)[_0xe6f3('0x27')](function(_0x4d75d3){return _0x4d75d3;});}return null;};}function removeEntity(_0x4b1bf2,_0x88ed03){return function(_0x3989c5){if(_0x3989c5){return _0x3989c5[_0xe6f3('0x28')]()[_0xe6f3('0x27')](function(){var _0x617847=_0x3989c5[_0xe6f3('0x29')]({'plain':!![]});var _0x5b1a12=_0xe6f3('0x2a');return db[_0xe6f3('0x2b')][_0xe6f3('0x28')]({'where':{'type':_0x5b1a12,'resourceId':_0x617847['id']}})[_0xe6f3('0x27')](function(){return _0x3989c5;});})['then'](function(){_0x4b1bf2['status'](0xcc)[_0xe6f3('0x1b')]();});}};}function handleEntityNotFound(_0x3eef65,_0x482cef){return function(_0x5e5f44){if(!_0x5e5f44){_0x3eef65[_0xe6f3('0x19')](0x194);}return _0x5e5f44;};}function handleError(_0x19691c,_0x37a5a5){_0x37a5a5=_0x37a5a5||0x1f4;return function(_0x4627de){logger[_0xe6f3('0x2c')](_0x4627de[_0xe6f3('0x2d')]);if(_0x4627de[_0xe6f3('0x2e')]){delete _0x4627de['name'];}_0x19691c[_0xe6f3('0x1a')](_0x37a5a5)['send'](_0x4627de);};}exports[_0xe6f3('0x2f')]=function(_0x104677,_0x473064){var _0x5c8494={},_0x34ad3c={},_0x5163e0={'count':0x0,'rows':[]};var _0x359c2d=_[_0xe6f3('0x30')](db[_0xe6f3('0x31')][_0xe6f3('0x32')],function(_0x498a16){return{'name':_0x498a16[_0xe6f3('0x33')],'type':_0x498a16[_0xe6f3('0x34')]['key']};});_0x34ad3c[_0xe6f3('0x35')]=_[_0xe6f3('0x30')](_0x359c2d,_0xe6f3('0x2e'));_0x34ad3c[_0xe6f3('0x36')]=_[_0xe6f3('0x37')](_0x104677[_0xe6f3('0x36')]);_0x34ad3c[_0xe6f3('0x38')]=_['intersection'](_0x34ad3c[_0xe6f3('0x35')],_0x34ad3c[_0xe6f3('0x36')]);_0x5c8494[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x34ad3c['model'],qs[_0xe6f3('0x3b')](_0x104677[_0xe6f3('0x36')]['fields']));_0x5c8494['attributes']=_0x5c8494[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x5c8494[_0xe6f3('0x39')]:_0x34ad3c[_0xe6f3('0x35')];if(!_0x104677['query'][_0xe6f3('0x3d')](_0xe6f3('0x3e'))){_0x5c8494['limit']=qs['limit'](_0x104677[_0xe6f3('0x36')][_0xe6f3('0x1d')]);_0x5c8494[_0xe6f3('0x1f')]=qs[_0xe6f3('0x1f')](_0x104677[_0xe6f3('0x36')]['offset']);}_0x5c8494[_0xe6f3('0x3f')]=qs[_0xe6f3('0x40')](_0x104677[_0xe6f3('0x36')][_0xe6f3('0x40')]);_0x5c8494['where']=qs[_0xe6f3('0x38')](_['pick'](_0x104677[_0xe6f3('0x36')],_0x34ad3c[_0xe6f3('0x38')]),_0x359c2d);if(_0x104677[_0xe6f3('0x36')][_0xe6f3('0x41')]){_0x5c8494['where']=_['merge'](_0x5c8494[_0xe6f3('0x42')],{'$or':_[_0xe6f3('0x30')](_0x359c2d,function(_0x30a160){if(_0x30a160[_0xe6f3('0x34')]!==_0xe6f3('0x43')){var _0x51bd3f={};_0x51bd3f[_0x30a160[_0xe6f3('0x2e')]]={'$like':'%'+_0x104677[_0xe6f3('0x36')][_0xe6f3('0x41')]+'%'};return _0x51bd3f;}})});}_0x5c8494=_[_0xe6f3('0x44')]({},_0x5c8494,_0x104677[_0xe6f3('0x45')]);var _0x1badac={'where':_0x5c8494['where']};return db[_0xe6f3('0x31')][_0xe6f3('0x20')](_0x1badac)['then'](function(_0x2e5108){_0x5163e0[_0xe6f3('0x20')]=_0x2e5108;if(_0x104677[_0xe6f3('0x36')][_0xe6f3('0x46')]){_0x5c8494[_0xe6f3('0x47')]=[{'all':!![]}];}return db[_0xe6f3('0x31')][_0xe6f3('0x48')](_0x5c8494);})[_0xe6f3('0x27')](function(_0x25f946){_0x5163e0[_0xe6f3('0x49')]=_0x25f946;return _0x5163e0;})[_0xe6f3('0x27')](respondWithFilteredResult(_0x473064,_0x5c8494))[_0xe6f3('0x4a')](handleError(_0x473064,null));};exports[_0xe6f3('0x4b')]=function(_0x21f142,_0x24ce66){var _0x127583={'raw':![],'where':{'id':_0x21f142[_0xe6f3('0x4c')]['id']}},_0x2fde49={};_0x2fde49[_0xe6f3('0x35')]=_[_0xe6f3('0x37')](db[_0xe6f3('0x31')][_0xe6f3('0x32')]);_0x2fde49['query']=_[_0xe6f3('0x37')](_0x21f142[_0xe6f3('0x36')]);_0x2fde49[_0xe6f3('0x38')]=_['intersection'](_0x2fde49[_0xe6f3('0x35')],_0x2fde49[_0xe6f3('0x36')]);_0x127583[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x2fde49[_0xe6f3('0x35')],qs[_0xe6f3('0x3b')](_0x21f142['query'][_0xe6f3('0x3b')]));_0x127583[_0xe6f3('0x39')]=_0x127583[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x127583[_0xe6f3('0x39')]:_0x2fde49['model'];if(_0x21f142['query']['includeAll']){_0x127583['include']=[{'all':!![]}];}_0x127583=_[_0xe6f3('0x44')]({},_0x127583,_0x21f142[_0xe6f3('0x45')]);return db[_0xe6f3('0x31')][_0xe6f3('0x4d')](_0x127583)[_0xe6f3('0x27')](handleEntityNotFound(_0x24ce66,null))['then'](respondWithResult(_0x24ce66,null))[_0xe6f3('0x4a')](handleError(_0x24ce66,null));};exports[_0xe6f3('0x4e')]=function(_0x33e3a9,_0x19e0c7){return db['Campaign'][_0xe6f3('0x4e')](_0x33e3a9[_0xe6f3('0x4f')],{})[_0xe6f3('0x27')](function(_0xc305e3){var _0xcfc2c=_0x33e3a9['user']['get']({'plain':!![]});if(!_0xcfc2c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xcfc2c[_0xe6f3('0x50')]==='user'){var _0x392ec6=_0xc305e3[_0xe6f3('0x29')]({'plain':!![]});var _0x473adf=_0xe6f3('0x2a');return db[_0xe6f3('0x51')][_0xe6f3('0x4d')]({'where':{'name':_0x473adf,'userProfileId':_0xcfc2c[_0xe6f3('0x52')]},'raw':!![]})[_0xe6f3('0x27')](function(_0x358d5b){if(_0x358d5b&&_0x358d5b[_0xe6f3('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x392ec6[_0xe6f3('0x2e')],'resourceId':_0x392ec6['id'],'type':_0x358d5b[_0xe6f3('0x2e')],'sectionId':_0x358d5b['id']},{})[_0xe6f3('0x27')](function(){return _0xc305e3;});}else{return _0xc305e3;}})[_0xe6f3('0x4a')](function(_0x5ec345){logger[_0xe6f3('0x2c')](_0xe6f3('0x54'),_0x5ec345);throw _0x5ec345;});}return _0xc305e3;})['then'](respondWithResult(_0x19e0c7,0xc9))[_0xe6f3('0x4a')](handleError(_0x19e0c7,null));};exports[_0xe6f3('0x55')]=function(_0x20fa56,_0x11df4f){var _0x47fe00={'where':{'id':_0x20fa56['params']['id']}},_0xe23956={};_0xe23956[_0xe6f3('0x35')]=_['keys'](db[_0xe6f3('0x31')][_0xe6f3('0x32')]);_0x47fe00[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0xe23956[_0xe6f3('0x35')],qs[_0xe6f3('0x3b')](_0x20fa56[_0xe6f3('0x36')][_0xe6f3('0x3b')]));_0x47fe00[_0xe6f3('0x39')]=_0x47fe00[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x47fe00[_0xe6f3('0x39')]:_0xe23956[_0xe6f3('0x35')];if(_0x20fa56[_0xe6f3('0x36')]['includeAll']){_0x47fe00['include']=[{'all':!![]}];}_0x47fe00=_[_0xe6f3('0x44')]({},_0x47fe00,_0x20fa56[_0xe6f3('0x45')]);return db['Campaign'][_0xe6f3('0x4d')](_0x47fe00)[_0xe6f3('0x27')](handleEntityNotFound(_0x11df4f,null))['then'](function(_0x52e8af){if(_0x52e8af){var _0x5af456=_0x52e8af[_0xe6f3('0x29')]({'plain':!![]});_0x5af456=qs[_0xe6f3('0x56')](_0x5af456,['id',_0xe6f3('0x57'),_0xe6f3('0x58')]);_0x20fa56[_0xe6f3('0x4f')]=_['omit'](_0x20fa56[_0xe6f3('0x4f')],['id',_0xe6f3('0x57'),_0xe6f3('0x58')]);return db[_0xe6f3('0x31')][_0xe6f3('0x4e')](_[_0xe6f3('0x44')](_0x5af456,_0x20fa56[_0xe6f3('0x4f')]),{'include':_0x20fa56[_0xe6f3('0x36')][_0xe6f3('0x46')]?[{'all':!![]}]:undefined})[_0xe6f3('0x27')](function(_0x1024d0){var _0x15e297=_0x20fa56[_0xe6f3('0x59')][_0xe6f3('0x29')]({'plain':!![]});if(!_0x15e297)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15e297[_0xe6f3('0x50')]===_0xe6f3('0x59')){var _0x2ded8e=_0x1024d0[_0xe6f3('0x29')]({'plain':!![]});var _0x2900b2=_0xe6f3('0x2a');return db[_0xe6f3('0x51')]['find']({'where':{'name':_0x2900b2,'userProfileId':_0x15e297[_0xe6f3('0x52')]},'raw':!![]})[_0xe6f3('0x27')](function(_0x3cb9de){if(_0x3cb9de&&_0x3cb9de[_0xe6f3('0x53')]===0x0){return db[_0xe6f3('0x2b')][_0xe6f3('0x4e')]({'name':_0x2ded8e['name'],'resourceId':_0x2ded8e['id'],'type':_0x3cb9de[_0xe6f3('0x2e')],'sectionId':_0x3cb9de['id']},{})[_0xe6f3('0x27')](function(){return _0x1024d0;});}else{return _0x1024d0;}})[_0xe6f3('0x4a')](function(_0x1cf8ae){logger[_0xe6f3('0x2c')](_0xe6f3('0x54'),_0x1cf8ae);throw _0x1cf8ae;});}return _0x1024d0;});}})['then'](respondWithResult(_0x11df4f,0xc9))[_0xe6f3('0x4a')](handleError(_0x11df4f,null));};exports[_0xe6f3('0x26')]=function(_0x171950,_0xc37282){if(_0x171950[_0xe6f3('0x4f')]['id']){delete _0x171950['body']['id'];}return db['Campaign']['find']({'where':{'id':_0x171950[_0xe6f3('0x4c')]['id']}})['then'](handleEntityNotFound(_0xc37282,null))[_0xe6f3('0x27')](saveUpdates(_0x171950[_0xe6f3('0x4f')],null))[_0xe6f3('0x27')](respondWithResult(_0xc37282,null))[_0xe6f3('0x4a')](handleError(_0xc37282,null));};exports[_0xe6f3('0x28')]=function(_0x1caf9b,_0x48b8d1){return db[_0xe6f3('0x31')]['find']({'where':{'id':_0x1caf9b['params']['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x48b8d1,null))[_0xe6f3('0x27')](removeEntity(_0x48b8d1,null))[_0xe6f3('0x4a')](handleError(_0x48b8d1,null));};exports[_0xe6f3('0x5a')]=function(_0x24bd75,_0x2807bf,_0x24dbd2){var _0x29428b={'raw':!![],'where':{}};var _0x5e825c={};var _0x38c1c4={'count':0x0,'rows':[]};return db[_0xe6f3('0x31')][_0xe6f3('0x5b')]({'where':{'id':_0x24bd75[_0xe6f3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2807bf,null))[_0xe6f3('0x27')](function(_0x4875e9){if(_0x4875e9){_0x5e825c[_0xe6f3('0x35')]=_['keys'](db['CmHopper'][_0xe6f3('0x32')]);_0x5e825c[_0xe6f3('0x36')]=_['keys'](_0x24bd75['query']);_0x5e825c[_0xe6f3('0x38')]=_[_0xe6f3('0x3a')](_0x5e825c[_0xe6f3('0x35')],_0x5e825c['query']);_0x29428b[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x5e825c['model'],qs['fields'](_0x24bd75[_0xe6f3('0x36')][_0xe6f3('0x3b')]));_0x29428b[_0xe6f3('0x39')]=_0x29428b[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x29428b['attributes']:_0x5e825c[_0xe6f3('0x35')];if(!_0x24bd75['query'][_0xe6f3('0x3d')](_0xe6f3('0x3e'))){_0x29428b[_0xe6f3('0x1d')]=qs[_0xe6f3('0x1d')](_0x24bd75[_0xe6f3('0x36')][_0xe6f3('0x1d')]);_0x29428b['offset']=qs[_0xe6f3('0x1f')](_0x24bd75[_0xe6f3('0x36')]['offset']);}_0x29428b[_0xe6f3('0x3f')]=qs[_0xe6f3('0x40')](_0x24bd75[_0xe6f3('0x36')][_0xe6f3('0x40')]);_0x29428b[_0xe6f3('0x42')]=qs[_0xe6f3('0x38')](_[_0xe6f3('0x5c')](_0x24bd75[_0xe6f3('0x36')],_0x5e825c[_0xe6f3('0x38')]));_0x29428b[_0xe6f3('0x42')][_0xe6f3('0x5d')]=_0x4875e9['id'];if(_0x24bd75[_0xe6f3('0x36')]['filter']){_0x29428b[_0xe6f3('0x42')]=_[_0xe6f3('0x44')](_0x29428b['where'],{'$or':_['map'](_0x29428b[_0xe6f3('0x39')],function(_0x30d5f7){var _0x799399={};_0x799399[_0x30d5f7]={'$like':'%'+_0x24bd75[_0xe6f3('0x36')][_0xe6f3('0x41')]+'%'};return _0x799399;})});}_0x29428b=_[_0xe6f3('0x44')]({},_0x29428b,_0x24bd75['options']);return db[_0xe6f3('0x5e')][_0xe6f3('0x20')]({'where':_0x29428b[_0xe6f3('0x42')]})[_0xe6f3('0x27')](function(_0x3e18fa){_0x38c1c4[_0xe6f3('0x20')]=_0x3e18fa;if(_0x24bd75['query'][_0xe6f3('0x46')]){_0x29428b[_0xe6f3('0x47')]=[{'all':!![]}];}return db['CmHopper'][_0xe6f3('0x48')](_0x29428b);})['then'](function(_0x2b22a0){_0x38c1c4['rows']=_0x2b22a0;return _0x38c1c4;});}})[_0xe6f3('0x27')](respondWithFilteredResult(_0x2807bf,_0x29428b))[_0xe6f3('0x4a')](handleError(_0x2807bf,null));};exports[_0xe6f3('0x5f')]=function(_0x221bd9,_0x11d640,_0x229477){var _0x53eb94={'raw':!![],'where':{}};var _0x13212f={};var _0x4e533a={'count':0x0,'rows':[]};return db[_0xe6f3('0x31')][_0xe6f3('0x5b')]({'where':{'id':_0x221bd9[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x11d640,null))[_0xe6f3('0x27')](function(_0x13f260){if(_0x13f260){_0x13212f[_0xe6f3('0x35')]=_['keys'](db[_0xe6f3('0x60')][_0xe6f3('0x32')]);_0x13212f[_0xe6f3('0x36')]=_['keys'](_0x221bd9['query']);_0x13212f[_0xe6f3('0x38')]=_[_0xe6f3('0x3a')](_0x13212f[_0xe6f3('0x35')],_0x13212f['query']);_0x53eb94[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x13212f[_0xe6f3('0x35')],qs[_0xe6f3('0x3b')](_0x221bd9[_0xe6f3('0x36')]['fields']));_0x53eb94[_0xe6f3('0x39')]=_0x53eb94[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x53eb94['attributes']:_0x13212f[_0xe6f3('0x35')];if(!_0x221bd9[_0xe6f3('0x36')]['hasOwnProperty']('nolimit')){_0x53eb94[_0xe6f3('0x1d')]=qs['limit'](_0x221bd9[_0xe6f3('0x36')]['limit']);_0x53eb94['offset']=qs['offset'](_0x221bd9['query'][_0xe6f3('0x1f')]);}_0x53eb94[_0xe6f3('0x3f')]=qs['sort'](_0x221bd9[_0xe6f3('0x36')]['sort']);_0x53eb94[_0xe6f3('0x42')]=qs[_0xe6f3('0x38')](_[_0xe6f3('0x5c')](_0x221bd9[_0xe6f3('0x36')],_0x13212f[_0xe6f3('0x38')]));_0x53eb94[_0xe6f3('0x42')]['CampaignId']=_0x13f260['id'];if(_0x221bd9[_0xe6f3('0x36')][_0xe6f3('0x41')]){_0x53eb94[_0xe6f3('0x42')]=_[_0xe6f3('0x44')](_0x53eb94[_0xe6f3('0x42')],{'$or':_[_0xe6f3('0x30')](_0x53eb94['attributes'],function(_0x596b21){var _0x32929b={};_0x32929b[_0x596b21]={'$like':'%'+_0x221bd9[_0xe6f3('0x36')][_0xe6f3('0x41')]+'%'};return _0x32929b;})});}_0x53eb94=_['merge']({},_0x53eb94,_0x221bd9['options']);return db['CmHopperHistory'][_0xe6f3('0x20')]({'where':_0x53eb94[_0xe6f3('0x42')]})[_0xe6f3('0x27')](function(_0x845b5c){_0x4e533a[_0xe6f3('0x20')]=_0x845b5c;if(_0x221bd9[_0xe6f3('0x36')][_0xe6f3('0x46')]){_0x53eb94['include']=[{'all':!![]}];}return db[_0xe6f3('0x60')][_0xe6f3('0x48')](_0x53eb94);})['then'](function(_0x5ab162){_0x4e533a[_0xe6f3('0x49')]=_0x5ab162;return _0x4e533a;});}})[_0xe6f3('0x27')](respondWithFilteredResult(_0x11d640,_0x53eb94))[_0xe6f3('0x4a')](handleError(_0x11d640,null));};exports[_0xe6f3('0x61')]=function(_0x103b1e,_0x5447d5,_0x34bdad){var _0x3682ca={'raw':!![],'where':{}};var _0x32bce8={};var _0x58202c={'count':0x0,'rows':[]};return db[_0xe6f3('0x31')][_0xe6f3('0x5b')]({'where':{'id':_0x103b1e[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x5447d5,null))[_0xe6f3('0x27')](function(_0x4ab738){if(_0x4ab738){_0x32bce8[_0xe6f3('0x35')]=_[_0xe6f3('0x37')](db[_0xe6f3('0x62')][_0xe6f3('0x32')]);_0x32bce8['query']=_[_0xe6f3('0x37')](_0x103b1e[_0xe6f3('0x36')]);_0x32bce8['filters']=_[_0xe6f3('0x3a')](_0x32bce8[_0xe6f3('0x35')],_0x32bce8[_0xe6f3('0x36')]);_0x3682ca[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x32bce8[_0xe6f3('0x35')],qs[_0xe6f3('0x3b')](_0x103b1e[_0xe6f3('0x36')][_0xe6f3('0x3b')]));_0x3682ca['attributes']=_0x3682ca[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x3682ca[_0xe6f3('0x39')]:_0x32bce8['model'];if(!_0x103b1e[_0xe6f3('0x36')][_0xe6f3('0x3d')](_0xe6f3('0x3e'))){_0x3682ca['limit']=qs['limit'](_0x103b1e[_0xe6f3('0x36')][_0xe6f3('0x1d')]);_0x3682ca[_0xe6f3('0x1f')]=qs[_0xe6f3('0x1f')](_0x103b1e['query'][_0xe6f3('0x1f')]);}_0x3682ca[_0xe6f3('0x3f')]=qs['sort'](_0x103b1e[_0xe6f3('0x36')][_0xe6f3('0x40')]);_0x3682ca[_0xe6f3('0x42')]=qs[_0xe6f3('0x38')](_[_0xe6f3('0x5c')](_0x103b1e[_0xe6f3('0x36')],_0x32bce8[_0xe6f3('0x38')]));_0x3682ca['where'][_0xe6f3('0x5d')]=_0x4ab738['id'];if(_0x103b1e[_0xe6f3('0x36')][_0xe6f3('0x41')]){_0x3682ca[_0xe6f3('0x42')]=_[_0xe6f3('0x44')](_0x3682ca['where'],{'$or':_[_0xe6f3('0x30')](_0x3682ca['attributes'],function(_0xbf614b){var _0x36be9d={};_0x36be9d[_0xbf614b]={'$like':'%'+_0x103b1e[_0xe6f3('0x36')][_0xe6f3('0x41')]+'%'};return _0x36be9d;})});}_0x3682ca=_[_0xe6f3('0x44')]({},_0x3682ca,_0x103b1e[_0xe6f3('0x45')]);return db[_0xe6f3('0x62')]['count']({'where':_0x3682ca['where']})[_0xe6f3('0x27')](function(_0x3264af){_0x58202c[_0xe6f3('0x20')]=_0x3264af;if(_0x103b1e[_0xe6f3('0x36')][_0xe6f3('0x46')]){_0x3682ca['include']=[{'all':!![]}];}return db[_0xe6f3('0x62')][_0xe6f3('0x48')](_0x3682ca);})[_0xe6f3('0x27')](function(_0x347f39){_0x58202c['rows']=_0x347f39;return _0x58202c;});}})['then'](respondWithFilteredResult(_0x5447d5,_0x3682ca))['catch'](handleError(_0x5447d5,null));};exports['getHopperBlacks']=function(_0x5d1470,_0x423088,_0x46ae4a){var _0xf8052c={'raw':!![],'where':{}};var _0x547fa2={};var _0x1eb4b3={'count':0x0,'rows':[]};return db['Campaign'][_0xe6f3('0x5b')]({'where':{'id':_0x5d1470['params']['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x423088,null))[_0xe6f3('0x27')](function(_0x2d8b5b){if(_0x2d8b5b){_0x547fa2[_0xe6f3('0x35')]=_['keys'](db[_0xe6f3('0x63')][_0xe6f3('0x32')]);_0x547fa2[_0xe6f3('0x36')]=_[_0xe6f3('0x37')](_0x5d1470[_0xe6f3('0x36')]);_0x547fa2[_0xe6f3('0x38')]=_[_0xe6f3('0x3a')](_0x547fa2[_0xe6f3('0x35')],_0x547fa2[_0xe6f3('0x36')]);_0xf8052c[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x547fa2[_0xe6f3('0x35')],qs[_0xe6f3('0x3b')](_0x5d1470[_0xe6f3('0x36')]['fields']));_0xf8052c['attributes']=_0xf8052c['attributes'][_0xe6f3('0x3c')]?_0xf8052c[_0xe6f3('0x39')]:_0x547fa2[_0xe6f3('0x35')];if(!_0x5d1470[_0xe6f3('0x36')][_0xe6f3('0x3d')](_0xe6f3('0x3e'))){_0xf8052c[_0xe6f3('0x1d')]=qs[_0xe6f3('0x1d')](_0x5d1470[_0xe6f3('0x36')][_0xe6f3('0x1d')]);_0xf8052c[_0xe6f3('0x1f')]=qs['offset'](_0x5d1470['query'][_0xe6f3('0x1f')]);}_0xf8052c['order']=qs['sort'](_0x5d1470[_0xe6f3('0x36')]['sort']);_0xf8052c['where']=qs[_0xe6f3('0x38')](_[_0xe6f3('0x5c')](_0x5d1470['query'],_0x547fa2[_0xe6f3('0x38')]));_0xf8052c[_0xe6f3('0x42')]['CampaignId']=_0x2d8b5b['id'];if(_0x5d1470[_0xe6f3('0x36')][_0xe6f3('0x41')]){_0xf8052c[_0xe6f3('0x42')]=_['merge'](_0xf8052c[_0xe6f3('0x42')],{'$or':_['map'](_0xf8052c[_0xe6f3('0x39')],function(_0x13a6b4){var _0x8a722d={};_0x8a722d[_0x13a6b4]={'$like':'%'+_0x5d1470['query'][_0xe6f3('0x41')]+'%'};return _0x8a722d;})});}_0xf8052c=_[_0xe6f3('0x44')]({},_0xf8052c,_0x5d1470[_0xe6f3('0x45')]);return db[_0xe6f3('0x63')][_0xe6f3('0x20')]({'where':_0xf8052c[_0xe6f3('0x42')]})[_0xe6f3('0x27')](function(_0x3fea28){_0x1eb4b3['count']=_0x3fea28;if(_0x5d1470['query']['includeAll']){_0xf8052c[_0xe6f3('0x47')]=[{'all':!![]}];}return db[_0xe6f3('0x63')][_0xe6f3('0x48')](_0xf8052c);})[_0xe6f3('0x27')](function(_0xa2bb66){_0x1eb4b3[_0xe6f3('0x49')]=_0xa2bb66;return _0x1eb4b3;});}})[_0xe6f3('0x27')](respondWithFilteredResult(_0x423088,_0xf8052c))[_0xe6f3('0x4a')](handleError(_0x423088,null));};exports['getLists']=function(_0x13ae5b,_0x10eb2b,_0x54e719){var _0x354f1e={};var _0x5f528a={};var _0x3c79e5;var _0x4f4c1f;return db[_0xe6f3('0x31')][_0xe6f3('0x5b')]({'where':{'id':_0x13ae5b[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x10eb2b,null))[_0xe6f3('0x27')](function(_0x3cb4f4){if(_0x3cb4f4){_0x3c79e5=_0x3cb4f4;_0x5f528a[_0xe6f3('0x35')]=_[_0xe6f3('0x37')](db['CmList'][_0xe6f3('0x32')]);_0x5f528a['query']=_[_0xe6f3('0x37')](_0x13ae5b[_0xe6f3('0x36')]);_0x5f528a[_0xe6f3('0x38')]=_[_0xe6f3('0x3a')](_0x5f528a[_0xe6f3('0x35')],_0x5f528a[_0xe6f3('0x36')]);_0x354f1e[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x5f528a[_0xe6f3('0x35')],qs['fields'](_0x13ae5b[_0xe6f3('0x36')]['fields']));_0x354f1e[_0xe6f3('0x39')]=_0x354f1e[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x354f1e['attributes']:_0x5f528a[_0xe6f3('0x35')];_0x354f1e[_0xe6f3('0x3f')]=qs[_0xe6f3('0x40')](_0x13ae5b[_0xe6f3('0x36')][_0xe6f3('0x40')]);_0x354f1e[_0xe6f3('0x42')]=qs[_0xe6f3('0x38')](_[_0xe6f3('0x5c')](_0x13ae5b[_0xe6f3('0x36')],_0x5f528a[_0xe6f3('0x38')]));if(_0x13ae5b[_0xe6f3('0x36')]['filter']){_0x354f1e[_0xe6f3('0x42')]=_[_0xe6f3('0x44')](_0x354f1e['where'],{'$or':_[_0xe6f3('0x30')](_0x354f1e[_0xe6f3('0x39')],function(_0xe04f93){var _0x30e569={};_0x30e569[_0xe04f93]={'$like':'%'+_0x13ae5b[_0xe6f3('0x36')][_0xe6f3('0x41')]+'%'};return _0x30e569;})});}_0x354f1e=_[_0xe6f3('0x44')]({},_0x354f1e,_0x13ae5b[_0xe6f3('0x45')]);return _0x3c79e5[_0xe6f3('0x64')](_0x354f1e);}})[_0xe6f3('0x27')](function(_0x5479bd){if(_0x5479bd){_0x4f4c1f=_0x5479bd[_0xe6f3('0x3c')];if(!_0x13ae5b[_0xe6f3('0x36')][_0xe6f3('0x3d')]('nolimit')){_0x354f1e[_0xe6f3('0x1d')]=qs[_0xe6f3('0x1d')](_0x13ae5b[_0xe6f3('0x36')]['limit']);_0x354f1e['offset']=qs[_0xe6f3('0x1f')](_0x13ae5b[_0xe6f3('0x36')][_0xe6f3('0x1f')]);}return _0x3c79e5['getLists'](_0x354f1e);}})[_0xe6f3('0x27')](function(_0x1a9cdc){if(_0x1a9cdc){return _0x1a9cdc?{'count':_0x4f4c1f,'rows':_0x1a9cdc}:null;}})[_0xe6f3('0x27')](respondWithResult(_0x10eb2b,null))[_0xe6f3('0x4a')](handleError(_0x10eb2b,null));};exports['addLists']=function(_0x69990a,_0x817aa2,_0x54963a){var _0x20e015,_0x4bb525;var _0x123626=[];var _0x25224a=moment()[_0xe6f3('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xe6f3('0x31')][_0xe6f3('0x4d')]({'where':{'id':_0x69990a[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x817aa2,null))[_0xe6f3('0x27')](function(_0x5cb788){if(_0x5cb788){_0x4bb525=_0x5cb788;return _0x5cb788['addLists'](_0x69990a[_0xe6f3('0x4f')][_0xe6f3('0x66')],_[_0xe6f3('0x56')](_0x69990a[_0xe6f3('0x4f')],[_0xe6f3('0x66'),'id'])||{});}return null;})[_0xe6f3('0x67')](function(_0x3ca584){var _0xe73186;var _0x157b70;_0x20e015=_0x3ca584||[];var _0x2557c4=[];if(_0x3ca584){for(var _0x2fb222=0x0;_0x2fb222<_0x3ca584[_0xe6f3('0x3c')];_0x2fb222+=0x1){var _0x5333c7=_0x3ca584[_0x2fb222]['get']({'plain':!![]});_0x4bb525[_0xe6f3('0x68')]=_0x69990a[_0xe6f3('0x4f')]['dialCheckDuplicateType']?_0x69990a[_0xe6f3('0x4f')]['dialCheckDuplicateType']:_0x4bb525[_0xe6f3('0x68')];switch(_0x4bb525[_0xe6f3('0x68')]){case'always':_0xe73186=squel[_0xe6f3('0x69')]()['into'](_0xe6f3('0x6a'))['fromQuery']([_0xe6f3('0x6b'),_0xe6f3('0x6c'),_0xe6f3('0x6d'),_0xe6f3('0x6e'),_0xe6f3('0x5d'),_0xe6f3('0x57'),_0xe6f3('0x58')],squel['select']()[_0xe6f3('0x6f')]('phone',_0xe6f3('0x6b'))['field'](_0xe6f3('0x70'),_0xe6f3('0x6c'))['field']('id',_0xe6f3('0x6d'))['field'](_0x5333c7[_0xe6f3('0x71')][_0xe6f3('0x72')](),_0xe6f3('0x6e'))[_0xe6f3('0x6f')](_0x69990a[_0xe6f3('0x4c')]['id']['toString'](),_0xe6f3('0x5d'))[_0xe6f3('0x6f')]('\x27'+_0x25224a+'\x27',_0xe6f3('0x57'))[_0xe6f3('0x6f')]('\x27'+_0x25224a+'\x27','updatedAt')[_0xe6f3('0x73')]('cm_contacts')[_0xe6f3('0x42')](_0xe6f3('0x74'))['where'](_0xe6f3('0x75'),_0x5333c7[_0xe6f3('0x71')][_0xe6f3('0x72')]())[_0xe6f3('0x42')](_0xe6f3('0x76'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xe6f3('0x77')]()[_0xe6f3('0x6f')](_0xe6f3('0x78'))[_0xe6f3('0x73')](_0xe6f3('0x79'))[_0xe6f3('0x42')](_0xe6f3('0x7a'),_0x69990a[_0xe6f3('0x4c')]['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xe6f3('0x77')]()['field'](_0xe6f3('0x7b'))[_0xe6f3('0x73')](_0xe6f3('0x6a'))[_0xe6f3('0x42')](_0xe6f3('0x7a'),_0x69990a[_0xe6f3('0x4c')]['id'][_0xe6f3('0x72')]())))['toString']();break;case'onlyIfOpen':_0xe73186=squel[_0xe6f3('0x69')]()['into'](_0xe6f3('0x6a'))[_0xe6f3('0x7c')]([_0xe6f3('0x6b'),'scheduledAt','ContactId',_0xe6f3('0x6e'),'CampaignId',_0xe6f3('0x57'),'updatedAt'],squel[_0xe6f3('0x77')]()[_0xe6f3('0x6f')](_0xe6f3('0x6b'),_0xe6f3('0x6b'))[_0xe6f3('0x6f')]('NOW()',_0xe6f3('0x6c'))['field']('id',_0xe6f3('0x6d'))[_0xe6f3('0x6f')](_0x5333c7[_0xe6f3('0x71')][_0xe6f3('0x72')](),'ListId')[_0xe6f3('0x6f')](_0x69990a['params']['id']['toString'](),_0xe6f3('0x5d'))['field']('\x27'+_0x25224a+'\x27',_0xe6f3('0x57'))[_0xe6f3('0x6f')]('\x27'+_0x25224a+'\x27',_0xe6f3('0x58'))[_0xe6f3('0x73')](_0xe6f3('0x7d'))['where'](_0xe6f3('0x74'))['where'](_0xe6f3('0x75'),_0x5333c7['CmListId'][_0xe6f3('0x72')]())[_0xe6f3('0x42')](_0xe6f3('0x76'))[_0xe6f3('0x42')](_0xe6f3('0x7e'),squel[_0xe6f3('0x77')]()[_0xe6f3('0x6f')](_0xe6f3('0x7b'))[_0xe6f3('0x73')](_0xe6f3('0x6a'))['where']('CampaignId\x20=\x20?',_0x69990a[_0xe6f3('0x4c')]['id'][_0xe6f3('0x72')]())))['toString']();break;default:_0xe73186=squel[_0xe6f3('0x69')]()['into'](_0xe6f3('0x6a'))['fromQuery']([_0xe6f3('0x6b'),_0xe6f3('0x6c'),_0xe6f3('0x6d'),_0xe6f3('0x6e'),'CampaignId','createdAt',_0xe6f3('0x58')],squel[_0xe6f3('0x77')]()[_0xe6f3('0x6f')](_0xe6f3('0x6b'),_0xe6f3('0x6b'))[_0xe6f3('0x6f')]('NOW()',_0xe6f3('0x6c'))[_0xe6f3('0x6f')]('id',_0xe6f3('0x6d'))[_0xe6f3('0x6f')](_0x5333c7[_0xe6f3('0x71')][_0xe6f3('0x72')](),_0xe6f3('0x6e'))[_0xe6f3('0x6f')](_0x69990a[_0xe6f3('0x4c')]['id']['toString'](),_0xe6f3('0x5d'))['field']('\x27'+_0x25224a+'\x27','createdAt')['field']('\x27'+_0x25224a+'\x27',_0xe6f3('0x58'))[_0xe6f3('0x73')](_0xe6f3('0x7d'))['where']('deletedAt\x20IS\x20NULL')[_0xe6f3('0x42')](_0xe6f3('0x75'),_0x5333c7[_0xe6f3('0x71')][_0xe6f3('0x72')]())[_0xe6f3('0x42')](_0xe6f3('0x76')))['toString']();}_0x157b70=squel['insert']()['into'](_0xe6f3('0x7f'))[_0xe6f3('0x7c')]([_0xe6f3('0x80'),_0xe6f3('0x6c'),'phone',_0xe6f3('0x81'),'createdAt',_0xe6f3('0x58')],squel['select']()[_0xe6f3('0x6f')]('h.id','id')[_0xe6f3('0x6f')](_0xe6f3('0x70'),_0xe6f3('0x6c'))[_0xe6f3('0x6f')](_0xe6f3('0x82'),_0xe6f3('0x6b'))[_0xe6f3('0x6f')](_0xe6f3('0x83'),_0xe6f3('0x81'))[_0xe6f3('0x6f')]('\x27'+_0x25224a+'\x27',_0xe6f3('0x57'))['field']('\x27'+_0x25224a+'\x27',_0xe6f3('0x58'))[_0xe6f3('0x73')]('cm_contact_has_items','ci')[_0xe6f3('0x84')](_0xe6f3('0x6a'),'h',_0xe6f3('0x85'))[_0xe6f3('0x42')]('h.ListId\x20=\x20?',_0x5333c7[_0xe6f3('0x71')][_0xe6f3('0x72')]())[_0xe6f3('0x42')](_0xe6f3('0x86'),_0x69990a[_0xe6f3('0x4c')]['id']['toString']())[_0xe6f3('0x42')](_0xe6f3('0x87'),_0x25224a))[_0xe6f3('0x72')]();_0x2557c4[_0xe6f3('0x88')](db['sequelize']['query'](_0xe73186));_0x123626[_0xe6f3('0x88')](db[_0xe6f3('0x89')][_0xe6f3('0x36')](_0x157b70));}return BPromise[_0xe6f3('0x8a')](_0x2557c4);}})[_0xe6f3('0x27')](function(){return BPromise['all'](_0x123626);})[_0xe6f3('0x27')](function(){return _0x20e015;})['then'](respondWithResult(_0x817aa2,null))[_0xe6f3('0x4a')](handleError(_0x817aa2,null));};exports[_0xe6f3('0x8b')]=function(_0x5105d2,_0x3f0acb,_0x1cd3f3){return db[_0xe6f3('0x31')][_0xe6f3('0x4d')]({'where':{'id':_0x5105d2[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x3f0acb,null))[_0xe6f3('0x27')](function(_0x2eb815){if(_0x2eb815){return _0x2eb815['removeLists'](_0x5105d2['query']['ids']);}})[_0xe6f3('0x27')](function(_0x1b4916){if(_0x1b4916){return db[_0xe6f3('0x5e')][_0xe6f3('0x28')]({'where':{'ListId':_0x5105d2[_0xe6f3('0x36')][_0xe6f3('0x66')],'CampaignId':_0x5105d2[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](function(){return _0x1b4916;});}})['then'](respondWithStatusCode(_0x3f0acb,null))[_0xe6f3('0x4a')](handleError(_0x3f0acb,null));};exports[_0xe6f3('0x8c')]=function(_0x546296,_0x10a22f,_0x2a4df1){var _0x24b1ca={};var _0x492e69={};var _0x14e8fc;var _0x4db105;return db[_0xe6f3('0x31')][_0xe6f3('0x5b')]({'where':{'id':_0x546296[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x10a22f,null))[_0xe6f3('0x27')](function(_0x45b410){if(_0x45b410){_0x14e8fc=_0x45b410;_0x492e69[_0xe6f3('0x35')]=_[_0xe6f3('0x37')](db[_0xe6f3('0x8d')][_0xe6f3('0x32')]);_0x492e69[_0xe6f3('0x36')]=_[_0xe6f3('0x37')](_0x546296[_0xe6f3('0x36')]);_0x492e69[_0xe6f3('0x38')]=_[_0xe6f3('0x3a')](_0x492e69['model'],_0x492e69[_0xe6f3('0x36')]);_0x24b1ca[_0xe6f3('0x39')]=_[_0xe6f3('0x3a')](_0x492e69[_0xe6f3('0x35')],qs[_0xe6f3('0x3b')](_0x546296[_0xe6f3('0x36')]['fields']));_0x24b1ca[_0xe6f3('0x39')]=_0x24b1ca[_0xe6f3('0x39')][_0xe6f3('0x3c')]?_0x24b1ca['attributes']:_0x492e69['model'];_0x24b1ca['order']=qs[_0xe6f3('0x40')](_0x546296[_0xe6f3('0x36')][_0xe6f3('0x40')]);_0x24b1ca['where']=qs[_0xe6f3('0x38')](_[_0xe6f3('0x5c')](_0x546296[_0xe6f3('0x36')],_0x492e69[_0xe6f3('0x38')]));if(_0x546296[_0xe6f3('0x36')][_0xe6f3('0x41')]){_0x24b1ca[_0xe6f3('0x42')]=_[_0xe6f3('0x44')](_0x24b1ca[_0xe6f3('0x42')],{'$or':_['map'](_0x24b1ca[_0xe6f3('0x39')],function(_0x43e42b){var _0x273dad={};_0x273dad[_0x43e42b]={'$like':'%'+_0x546296[_0xe6f3('0x36')][_0xe6f3('0x41')]+'%'};return _0x273dad;})});}_0x24b1ca=_['merge']({},_0x24b1ca,_0x546296[_0xe6f3('0x45')]);return _0x14e8fc[_0xe6f3('0x8c')](_0x24b1ca);}})[_0xe6f3('0x27')](function(_0x1f93e1){if(_0x1f93e1){_0x4db105=_0x1f93e1[_0xe6f3('0x3c')];if(!_0x546296[_0xe6f3('0x36')][_0xe6f3('0x3d')](_0xe6f3('0x3e'))){_0x24b1ca['limit']=qs['limit'](_0x546296[_0xe6f3('0x36')][_0xe6f3('0x1d')]);_0x24b1ca['offset']=qs[_0xe6f3('0x1f')](_0x546296[_0xe6f3('0x36')][_0xe6f3('0x1f')]);}return _0x14e8fc[_0xe6f3('0x8c')](_0x24b1ca);}})['then'](function(_0x314a32){if(_0x314a32){return _0x314a32?{'count':_0x4db105,'rows':_0x314a32}:null;}})[_0xe6f3('0x27')](respondWithResult(_0x10a22f,null))[_0xe6f3('0x4a')](handleError(_0x10a22f,null));};exports[_0xe6f3('0x8e')]=function(_0x2cfc20,_0x3a9926,_0x4b461f){var _0xc2cdd8,_0x5a4ccf;var _0x1a8205=[];var _0x5ac6c0=moment()[_0xe6f3('0x65')](_0xe6f3('0x8f'));return db['Campaign']['find']({'where':{'id':_0x2cfc20[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x3a9926,null))[_0xe6f3('0x27')](function(_0x32167a){if(_0x32167a){_0x5a4ccf=_0x32167a;return _0x32167a[_0xe6f3('0x8e')](_0x2cfc20['body'][_0xe6f3('0x66')],_[_0xe6f3('0x56')](_0x2cfc20[_0xe6f3('0x4f')],['ids','id'])||{});}return null;})[_0xe6f3('0x67')](function(_0x337df8){var _0x115fcf;var _0x1c20f5;_0xc2cdd8=_0x337df8||[];var _0x37204c=[];if(_0x337df8){for(var _0x51c01f=0x0;_0x51c01f<_0x337df8[_0xe6f3('0x3c')];_0x51c01f+=0x1){var _0x4b40f7=_0x337df8[_0x51c01f][_0xe6f3('0x29')]({'plain':!![]});_0x115fcf=squel[_0xe6f3('0x69')]()['into'](_0xe6f3('0x90'))['fromQuery']([_0xe6f3('0x6b'),_0xe6f3('0x6d'),_0xe6f3('0x6e'),_0xe6f3('0x5d'),_0xe6f3('0x57'),_0xe6f3('0x58')],squel[_0xe6f3('0x77')]()[_0xe6f3('0x6f')]('phone',_0xe6f3('0x6b'))[_0xe6f3('0x6f')]('id','ContactId')[_0xe6f3('0x6f')](_0x4b40f7[_0xe6f3('0x71')]['toString'](),_0xe6f3('0x6e'))[_0xe6f3('0x6f')](_0x2cfc20['params']['id']['toString'](),_0xe6f3('0x5d'))[_0xe6f3('0x6f')](_0xe6f3('0x70'),_0xe6f3('0x57'))[_0xe6f3('0x6f')](_0xe6f3('0x70'),_0xe6f3('0x58'))[_0xe6f3('0x73')](_0xe6f3('0x7d'))['where'](_0xe6f3('0x74'))[_0xe6f3('0x42')]('ListId\x20=\x20?',_0x4b40f7[_0xe6f3('0x71')][_0xe6f3('0x72')]())[_0xe6f3('0x42')](_0xe6f3('0x76')))[_0xe6f3('0x72')]();_0x37204c[_0xe6f3('0x88')](db[_0xe6f3('0x89')][_0xe6f3('0x36')](_0x115fcf));}return BPromise[_0xe6f3('0x8a')](_0x37204c);}})['then'](function(){return _0xc2cdd8;})[_0xe6f3('0x27')](respondWithResult(_0x3a9926,null))['catch'](handleError(_0x3a9926,null));};exports[_0xe6f3('0x91')]=function(_0x498bb1,_0x2baf8c,_0x5b2063){return db[_0xe6f3('0x31')][_0xe6f3('0x4d')]({'where':{'id':_0x498bb1[_0xe6f3('0x4c')]['id']}})[_0xe6f3('0x27')](handleEntityNotFound(_0x2baf8c,null))[_0xe6f3('0x27')](function(_0x3ba927){if(_0x3ba927){return _0x3ba927[_0xe6f3('0x91')](_0x498bb1[_0xe6f3('0x36')]['ids']);}})[_0xe6f3('0x27')](function(_0x11ba37){if(_0x11ba37){return db[_0xe6f3('0x63')]['destroy']({'where':{'ListId':_0x498bb1['query'][_0xe6f3('0x66')],'CampaignId':_0x498bb1['params']['id']}})['then'](function(){return _0x11ba37;});}})['then'](respondWithStatusCode(_0x2baf8c,null))[_0xe6f3('0x4a')](handleError(_0x2baf8c,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 8888607..17a6d80 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1ea50c,_0x3dd2e7){var _0x37e769=function(_0x2dcb20){while(--_0x2dcb20){_0x1ea50c['push'](_0x1ea50c['shift']());}};_0x37e769(++_0x3dd2e7);}(_0x7a54,0x106));var _0x47a5=function(_0x1c97c0,_0xaf8fc8){_0x1c97c0=_0x1c97c0-0x0;var _0x40e517=_0x7a54[_0x1c97c0];return _0x40e517;};'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 98a0794..c1f4a27 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 _0x94dc=['attributes','limit','include','map','model','GetCampaign','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','raw','where'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x94dc,0xb1));var _0xc94d=function(_0x5cc4e4,_0x83347a){_0x5cc4e4=_0x5cc4e4-0x0;var _0x3fa242=_0x94dc[_0x5cc4e4];return _0x3fa242;};'use strict';var _=require(_0xc94d('0x0'));var util=require('util');var moment=require(_0xc94d('0x1'));var BPromise=require('bluebird');var rs=require(_0xc94d('0x2'));var fs=require('fs');var Redis=require(_0xc94d('0x3'));var db=require(_0xc94d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc94d('0x5'))(_0xc94d('0x6'));var config=require(_0xc94d('0x7'));var jayson=require(_0xc94d('0x8'));var client=jayson[_0xc94d('0x9')][_0xc94d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb7275c,_0x5776ab,_0x2f9757){return new BPromise(function(_0xbe5904,_0x15265c){return client[_0xc94d('0xb')](_0xb7275c,_0x2f9757)[_0xc94d('0xc')](function(_0x579245){logger[_0xc94d('0xd')](_0xc94d('0xe'),_0x5776ab,_0xc94d('0xf'));logger[_0xc94d('0x10')](_0xc94d('0x11'),_0x5776ab,_0xc94d('0xf'),JSON['stringify'](_0x579245));if(_0x579245[_0xc94d('0x12')]){if(_0x579245[_0xc94d('0x12')][_0xc94d('0x13')]===0x1f4){logger[_0xc94d('0x12')]('Campaign,\x20%s,\x20%s',_0x5776ab,_0x579245['error']['message']);return _0x15265c(_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);}logger[_0xc94d('0x12')](_0xc94d('0xe'),_0x5776ab,_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);return _0xbe5904(_0x579245[_0xc94d('0x12')][_0xc94d('0x14')]);}else{logger[_0xc94d('0xd')](_0xc94d('0xe'),_0x5776ab,_0xc94d('0xf'));_0xbe5904(_0x579245[_0xc94d('0x15')][_0xc94d('0x14')]);}})[_0xc94d('0x16')](function(_0x19508d){logger['error']('Campaign,\x20%s,\x20%s',_0x5776ab,_0x19508d);_0x15265c(_0x19508d);});});}exports['GetCampaign']=function(_0x48b879){var _0x345259=this;return new Promise(function(_0x4784a2,_0x4f7287){return db['Campaign'][_0xc94d('0x17')]({'raw':_0x48b879[_0xc94d('0x18')]?_0x48b879['options'][_0xc94d('0x19')]===undefined?!![]:![]:!![],'where':_0x48b879[_0xc94d('0x18')]?_0x48b879[_0xc94d('0x18')][_0xc94d('0x1a')]||null:null,'attributes':_0x48b879[_0xc94d('0x18')]?_0x48b879[_0xc94d('0x18')][_0xc94d('0x1b')]||null:null,'limit':_0x48b879[_0xc94d('0x18')]?_0x48b879[_0xc94d('0x18')][_0xc94d('0x1c')]||null:null,'include':_0x48b879['options']?_0x48b879[_0xc94d('0x18')][_0xc94d('0x1d')]?_[_0xc94d('0x1e')](_0x48b879[_0xc94d('0x18')][_0xc94d('0x1d')],function(_0x557bfb){return{'model':db[_0x557bfb['model']],'as':_0x557bfb['as'],'attributes':_0x557bfb['attributes'],'include':_0x557bfb[_0xc94d('0x1d')]?_[_0xc94d('0x1e')](_0x557bfb[_0xc94d('0x1d')],function(_0x1de964){return{'model':db[_0x1de964['model']],'as':_0x1de964['as'],'attributes':_0x1de964['attributes'],'include':_0x1de964[_0xc94d('0x1d')]?_['map'](_0x1de964[_0xc94d('0x1d')],function(_0x362ff4){return{'model':db[_0x362ff4[_0xc94d('0x1f')]],'as':_0x362ff4['as'],'attributes':_0x362ff4['attributes']};}):[]};}):[]};}):[]:[]})[_0xc94d('0xc')](function(_0x196b59){logger[_0xc94d('0xd')](_0xc94d('0x20'),_0x48b879);logger[_0xc94d('0x10')]('GetCampaign',_0x48b879,JSON[_0xc94d('0x21')](_0x196b59));_0x4784a2(_0x196b59);})[_0xc94d('0x16')](function(_0x3a2342){logger[_0xc94d('0x12')](_0xc94d('0x20'),_0x3a2342['message'],_0x48b879);_0x4f7287(_0x345259[_0xc94d('0x12')](0x1f4,_0x3a2342[_0xc94d('0x14')]));});});}; \ No newline at end of file +var _0xa37e=['debug','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetCampaign','Campaign','findAll','options','raw','where','limit','include','map','model','attributes'];(function(_0x2a5030,_0x5416a5){var _0xe7ee51=function(_0x1bdaaf){while(--_0x1bdaaf){_0x2a5030['push'](_0x2a5030['shift']());}};_0xe7ee51(++_0x5416a5);}(_0xa37e,0x97));var _0xea37=function(_0x597de2,_0x241b83){_0x597de2=_0x597de2-0x0;var _0x59a86e=_0xa37e[_0x597de2];return _0x59a86e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xea37('0x0'));var BPromise=require(_0xea37('0x1'));var rs=require(_0xea37('0x2'));var fs=require('fs');var Redis=require(_0xea37('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xea37('0x4'));var logger=require('../../config/logger')(_0xea37('0x5'));var config=require(_0xea37('0x6'));var jayson=require(_0xea37('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36c489,_0x4a9e08,_0x4ae081){return new BPromise(function(_0x2c2890,_0x1401e1){return client[_0xea37('0x8')](_0x36c489,_0x4ae081)[_0xea37('0x9')](function(_0x5e4ebe){logger[_0xea37('0xa')](_0xea37('0xb'),_0x4a9e08,_0xea37('0xc'));logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x4a9e08,_0xea37('0xc'),JSON[_0xea37('0xd')](_0x5e4ebe));if(_0x5e4ebe[_0xea37('0xe')]){if(_0x5e4ebe['error'][_0xea37('0xf')]===0x1f4){logger[_0xea37('0xe')](_0xea37('0xb'),_0x4a9e08,_0x5e4ebe['error'][_0xea37('0x10')]);return _0x1401e1(_0x5e4ebe[_0xea37('0xe')]['message']);}logger[_0xea37('0xe')]('Campaign,\x20%s,\x20%s',_0x4a9e08,_0x5e4ebe[_0xea37('0xe')]['message']);return _0x2c2890(_0x5e4ebe[_0xea37('0xe')][_0xea37('0x10')]);}else{logger[_0xea37('0xa')](_0xea37('0xb'),_0x4a9e08,'request\x20sent');_0x2c2890(_0x5e4ebe[_0xea37('0x11')]['message']);}})['catch'](function(_0x3ae3cc){logger['error'](_0xea37('0xb'),_0x4a9e08,_0x3ae3cc);_0x1401e1(_0x3ae3cc);});});}exports[_0xea37('0x12')]=function(_0x4ef3c9){var _0x2242f0=this;return new Promise(function(_0x465d3b,_0x5427e7){return db[_0xea37('0x13')][_0xea37('0x14')]({'raw':_0x4ef3c9[_0xea37('0x15')]?_0x4ef3c9[_0xea37('0x15')][_0xea37('0x16')]===undefined?!![]:![]:!![],'where':_0x4ef3c9[_0xea37('0x15')]?_0x4ef3c9[_0xea37('0x15')][_0xea37('0x17')]||null:null,'attributes':_0x4ef3c9[_0xea37('0x15')]?_0x4ef3c9[_0xea37('0x15')]['attributes']||null:null,'limit':_0x4ef3c9[_0xea37('0x15')]?_0x4ef3c9[_0xea37('0x15')][_0xea37('0x18')]||null:null,'include':_0x4ef3c9['options']?_0x4ef3c9['options'][_0xea37('0x19')]?_[_0xea37('0x1a')](_0x4ef3c9[_0xea37('0x15')][_0xea37('0x19')],function(_0x4996e9){return{'model':db[_0x4996e9[_0xea37('0x1b')]],'as':_0x4996e9['as'],'attributes':_0x4996e9['attributes'],'include':_0x4996e9['include']?_['map'](_0x4996e9[_0xea37('0x19')],function(_0x4ff973){return{'model':db[_0x4ff973[_0xea37('0x1b')]],'as':_0x4ff973['as'],'attributes':_0x4ff973[_0xea37('0x1c')],'include':_0x4ff973[_0xea37('0x19')]?_[_0xea37('0x1a')](_0x4ff973[_0xea37('0x19')],function(_0xb99cc6){return{'model':db[_0xb99cc6['model']],'as':_0xb99cc6['as'],'attributes':_0xb99cc6[_0xea37('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x477e25){logger[_0xea37('0xa')]('GetCampaign',_0x4ef3c9);logger[_0xea37('0x1d')](_0xea37('0x12'),_0x4ef3c9,JSON[_0xea37('0xd')](_0x477e25));_0x465d3b(_0x477e25);})['catch'](function(_0xe5b07a){logger[_0xea37('0xe')](_0xea37('0x12'),_0xe5b07a[_0xea37('0x10')],_0x4ef3c9);_0x5427e7(_0x2242f0['error'](0x1f4,_0xe5b07a[_0xea37('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 5705728..4f951ca 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 _0x28a1=['/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','addLists','addBlackLists','update','destroy','delete','removeLists','removeBlackLists','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id','isAuthenticated','show','/:id/hoppers','getHoppers'];(function(_0x2c98cc,_0x230805){var _0x51f0ee=function(_0xe91305){while(--_0xe91305){_0x2c98cc['push'](_0x2c98cc['shift']());}};_0x51f0ee(++_0x230805);}(_0x28a1,0x145));var _0x128a=function(_0x5f08a6,_0x400121){_0x5f08a6=_0x5f08a6-0x0;var _0x5d0641=_0x28a1[_0x5f08a6];return _0x5d0641;};'use strict';var multer=require(_0x128a('0x0'));var util=require(_0x128a('0x1'));var path=require('path');var timeout=require(_0x128a('0x2'));var express=require(_0x128a('0x3'));var router=express[_0x128a('0x4')]();var fs_extra=require(_0x128a('0x5'));var auth=require(_0x128a('0x6'));var interaction=require(_0x128a('0x7'));var config=require(_0x128a('0x8'));var controller=require(_0x128a('0x9'));router[_0x128a('0xa')]('/',auth['isAuthenticated'](),controller[_0x128a('0xb')]);router[_0x128a('0xa')](_0x128a('0xc'),auth[_0x128a('0xd')](),controller[_0x128a('0xe')]);router[_0x128a('0xa')](_0x128a('0xf'),auth['isAuthenticated'](),controller[_0x128a('0x10')]);router[_0x128a('0xa')](_0x128a('0x11'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x128a('0xa')](_0x128a('0x12'),auth[_0x128a('0xd')](),controller[_0x128a('0x13')]);router[_0x128a('0xa')](_0x128a('0x14'),auth[_0x128a('0xd')](),controller[_0x128a('0x15')]);router['get']('/:id/lists',auth[_0x128a('0xd')](),controller[_0x128a('0x16')]);router[_0x128a('0xa')](_0x128a('0x17'),auth[_0x128a('0xd')](),controller[_0x128a('0x18')]);router[_0x128a('0x19')]('/',auth[_0x128a('0xd')](),controller[_0x128a('0x1a')]);router[_0x128a('0x19')](_0x128a('0x1b'),auth[_0x128a('0xd')](),controller[_0x128a('0x1c')]);router[_0x128a('0x19')](_0x128a('0x1d'),auth['isAuthenticated'](),controller[_0x128a('0x1e')]);router[_0x128a('0x19')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x128a('0x1f')]);router['put'](_0x128a('0xc'),auth[_0x128a('0xd')](),controller[_0x128a('0x20')]);router['delete'](_0x128a('0xc'),auth['isAuthenticated'](),controller[_0x128a('0x21')]);router[_0x128a('0x22')]('/:id/lists',auth[_0x128a('0xd')](),controller[_0x128a('0x23')]);router[_0x128a('0x22')](_0x128a('0x17'),auth[_0x128a('0xd')](),controller[_0x128a('0x24')]);module[_0x128a('0x25')]=router; \ No newline at end of file +var _0x0137=['path','connect-timeout','express','Router','fs-extra','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addLists','addBlackLists','put','update','delete','/:id','removeLists','multer'];(function(_0x38ce4c,_0xfdbe8c){var _0x5d4544=function(_0x503537){while(--_0x503537){_0x38ce4c['push'](_0x38ce4c['shift']());}};_0x5d4544(++_0xfdbe8c);}(_0x0137,0xa4));var _0x7013=function(_0x118c30,_0x7eb1eb){_0x118c30=_0x118c30-0x0;var _0x569999=_0x0137[_0x118c30];return _0x569999;};'use strict';var multer=require(_0x7013('0x0'));var util=require('util');var path=require(_0x7013('0x1'));var timeout=require(_0x7013('0x2'));var express=require(_0x7013('0x3'));var router=express[_0x7013('0x4')]();var fs_extra=require(_0x7013('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7013('0x6'));var controller=require(_0x7013('0x7'));router[_0x7013('0x8')]('/',auth[_0x7013('0x9')](),controller[_0x7013('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7013('0xb')]);router[_0x7013('0x8')](_0x7013('0xc'),auth['isAuthenticated'](),controller[_0x7013('0xd')]);router[_0x7013('0x8')]('/:id/hopper_histories',auth[_0x7013('0x9')](),controller[_0x7013('0xe')]);router[_0x7013('0x8')](_0x7013('0xf'),auth[_0x7013('0x9')](),controller[_0x7013('0x10')]);router[_0x7013('0x8')](_0x7013('0x11'),auth[_0x7013('0x9')](),controller['getHopperBlacks']);router['get'](_0x7013('0x12'),auth[_0x7013('0x9')](),controller[_0x7013('0x13')]);router[_0x7013('0x8')](_0x7013('0x14'),auth[_0x7013('0x9')](),controller[_0x7013('0x15')]);router['post']('/',auth[_0x7013('0x9')](),controller[_0x7013('0x16')]);router[_0x7013('0x17')](_0x7013('0x18'),auth[_0x7013('0x9')](),controller[_0x7013('0x19')]);router[_0x7013('0x17')](_0x7013('0x12'),auth['isAuthenticated'](),controller[_0x7013('0x1a')]);router['post']('/:id/blacklists',auth[_0x7013('0x9')](),controller[_0x7013('0x1b')]);router[_0x7013('0x1c')]('/:id',auth[_0x7013('0x9')](),controller[_0x7013('0x1d')]);router[_0x7013('0x1e')](_0x7013('0x1f'),auth[_0x7013('0x9')](),controller['destroy']);router['delete'](_0x7013('0x12'),auth[_0x7013('0x9')](),controller[_0x7013('0x20')]);router[_0x7013('0x1e')]('/:id/blacklists',auth[_0x7013('0x9')](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 0992a3b..cbff88c 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 _0xcbb2=['sequelize','exports','STRING','TEXT','getDataValue','key'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcbb2,0x1e6));var _0x2cbb=function(_0x399367,_0x38084a){_0x399367=_0x399367-0x0;var _0x3f2434=_0xcbb2[_0x399367];return _0x3f2434;};'use strict';var Sequelize=require(_0x2cbb('0x0'));module[_0x2cbb('0x1')]={'key':{'type':Sequelize[_0x2cbb('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x2cbb('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x2cbb('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x2cbb('0x4')](_0x2cbb('0x5'));}}}; \ No newline at end of file +var _0xc081=['TEXT','VIRTUAL','key','exports','STRING'];(function(_0x60157f,_0x22d244){var _0x109db1=function(_0x5cf069){while(--_0x5cf069){_0x60157f['push'](_0x60157f['shift']());}};_0x109db1(++_0x22d244);}(_0xc081,0x143));var _0x1c08=function(_0x21f9c2,_0x2b3d2a){_0x21f9c2=_0x21f9c2-0x0;var _0x3da17f=_0xc081[_0x21f9c2];return _0x3da17f;};'use strict';var Sequelize=require('sequelize');module[_0x1c08('0x0')]={'key':{'type':Sequelize[_0x1c08('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x1c08('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1c08('0x1')]},'name':{'type':Sequelize[_0x1c08('0x3')],'get':function(){return this['getDataValue'](_0x1c08('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index e09f569..a59b7a6 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 _0x77fb=['filter','where','merge','options','include','findAll','rows','catch','show','params','includeAll','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','get','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','UserProfileResource','then','stack','name','index','map','CannedAnswer','rawAttributes','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x3c46bf,_0x22ea4f){var _0x24efe6=function(_0x2c5288){while(--_0x2c5288){_0x3c46bf['push'](_0x3c46bf['shift']());}};_0x24efe6(++_0x22ea4f);}(_0x77fb,0xc3));var _0xb77f=function(_0x390784,_0x513443){_0x390784=_0x390784-0x0;var _0x311d00=_0x77fb[_0x390784];return _0x311d00;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb77f('0x0'));var zipdir=require(_0xb77f('0x1'));var jsonpatch=require(_0xb77f('0x2'));var rp=require('request-promise');var moment=require(_0xb77f('0x3'));var BPromise=require(_0xb77f('0x4'));var Mustache=require('mustache');var util=require(_0xb77f('0x5'));var path=require(_0xb77f('0x6'));var sox=require(_0xb77f('0x7'));var csv=require('to-csv');var ejs=require(_0xb77f('0x8'));var fs=require('fs');var fs_extra=require(_0xb77f('0x9'));var _=require('lodash');var squel=require(_0xb77f('0xa'));var crypto=require(_0xb77f('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb77f('0xc'));var querystring=require(_0xb77f('0xd'));var Papa=require('papaparse');var Redis=require(_0xb77f('0xe'));var authService=require(_0xb77f('0xf'));var qs=require(_0xb77f('0x10'));var as=require(_0xb77f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb77f('0x12'))(_0xb77f('0x13'));var utils=require(_0xb77f('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30612b,_0x5d9a9c){_0x5d9a9c=_0x5d9a9c||0xcc;return function(_0x333a76){if(_0x333a76){return _0x30612b[_0xb77f('0x15')](_0x5d9a9c);}return _0x30612b['status'](_0x5d9a9c)[_0xb77f('0x16')]();};}function respondWithResult(_0x3a061c,_0x1b0dd8){_0x1b0dd8=_0x1b0dd8||0xc8;return function(_0x519b8d){if(_0x519b8d){return _0x3a061c[_0xb77f('0x17')](_0x1b0dd8)[_0xb77f('0x18')](_0x519b8d);}};}function respondWithFilteredResult(_0x26e7af,_0x203485){return function(_0x387a7f){if(_0x387a7f){var _0x4f24e8=typeof _0x203485[_0xb77f('0x19')]===_0xb77f('0x1a')&&typeof _0x203485['limit']===_0xb77f('0x1a');var _0x792b5a=_0x387a7f[_0xb77f('0x1b')];var _0x36155b=_0x4f24e8?0x0:_0x203485[_0xb77f('0x19')];var _0xad2918=_0x4f24e8?_0x387a7f[_0xb77f('0x1b')]:_0x203485['offset']+_0x203485[_0xb77f('0x1c')];var _0x521528;if(_0xad2918>=_0x792b5a){_0xad2918=_0x792b5a;_0x521528=0xc8;}else{_0x521528=0xce;}_0x26e7af[_0xb77f('0x17')](_0x521528);return _0x26e7af[_0xb77f('0x1d')](_0xb77f('0x1e'),_0x36155b+'-'+_0xad2918+'/'+_0x792b5a)[_0xb77f('0x18')](_0x387a7f);}return null;};}function patchUpdates(_0x43f4d8){return function(_0x16ecd2){try{jsonpatch[_0xb77f('0x1f')](_0x16ecd2,_0x43f4d8,!![]);}catch(_0x394a3d){return BPromise[_0xb77f('0x20')](_0x394a3d);}return _0x16ecd2['save']();};}function saveUpdates(_0x2c621d,_0x23f514){return function(_0x3aaef1){if(_0x3aaef1){return _0x3aaef1[_0xb77f('0x21')](_0x2c621d)['then'](function(_0x5deede){return _0x5deede;});}return null;};}function removeEntity(_0x3391aa,_0x5377a8){return function(_0x569e45){if(_0x569e45){return _0x569e45[_0xb77f('0x22')]()['then'](function(){var _0x3232e4=_0x569e45['get']({'plain':!![]});var _0x3c28ff='CannedAnswers';return db[_0xb77f('0x23')][_0xb77f('0x22')]({'where':{'type':_0x3c28ff,'resourceId':_0x3232e4['id']}})[_0xb77f('0x24')](function(){return _0x569e45;});})[_0xb77f('0x24')](function(){_0x3391aa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3201c9,_0x2d4ea5){return function(_0x3d5252){if(!_0x3d5252){_0x3201c9['sendStatus'](0x194);}return _0x3d5252;};}function handleError(_0x3117e2,_0x29a314){_0x29a314=_0x29a314||0x1f4;return function(_0x48146b){logger['error'](_0x48146b[_0xb77f('0x25')]);if(_0x48146b[_0xb77f('0x26')]){delete _0x48146b[_0xb77f('0x26')];}_0x3117e2[_0xb77f('0x17')](_0x29a314)['send'](_0x48146b);};}exports[_0xb77f('0x27')]=function(_0x168c5a,_0x2be1a6){var _0x39e613={},_0x5b48be={},_0x3f4782={'count':0x0,'rows':[]};var _0x451ed0=_[_0xb77f('0x28')](db[_0xb77f('0x29')][_0xb77f('0x2a')],function(_0x19a9ad){return{'name':_0x19a9ad['fieldName'],'type':_0x19a9ad['type'][_0xb77f('0x2b')]};});_0x5b48be[_0xb77f('0x2c')]=_[_0xb77f('0x28')](_0x451ed0,'name');_0x5b48be['query']=_[_0xb77f('0x2d')](_0x168c5a[_0xb77f('0x2e')]);_0x5b48be[_0xb77f('0x2f')]=_['intersection'](_0x5b48be['model'],_0x5b48be['query']);_0x39e613[_0xb77f('0x30')]=_[_0xb77f('0x31')](_0x5b48be[_0xb77f('0x2c')],qs[_0xb77f('0x32')](_0x168c5a[_0xb77f('0x2e')][_0xb77f('0x32')]));_0x39e613[_0xb77f('0x30')]=_0x39e613[_0xb77f('0x30')][_0xb77f('0x33')]?_0x39e613[_0xb77f('0x30')]:_0x5b48be['model'];if(!_0x168c5a[_0xb77f('0x2e')][_0xb77f('0x34')](_0xb77f('0x35'))){_0x39e613[_0xb77f('0x1c')]=qs[_0xb77f('0x1c')](_0x168c5a[_0xb77f('0x2e')][_0xb77f('0x1c')]);_0x39e613[_0xb77f('0x19')]=qs['offset'](_0x168c5a[_0xb77f('0x2e')][_0xb77f('0x19')]);}_0x39e613[_0xb77f('0x36')]=qs[_0xb77f('0x37')](_0x168c5a[_0xb77f('0x2e')][_0xb77f('0x37')]);_0x39e613['where']=qs[_0xb77f('0x2f')](_[_0xb77f('0x38')](_0x168c5a[_0xb77f('0x2e')],_0x5b48be[_0xb77f('0x2f')]),_0x451ed0);if(_0x168c5a['query'][_0xb77f('0x39')]){_0x39e613[_0xb77f('0x3a')]=_['merge'](_0x39e613[_0xb77f('0x3a')],{'$or':[{'key':{'$like':'%'+_0x168c5a[_0xb77f('0x2e')][_0xb77f('0x39')]+'%'}},{'value':{'$like':'%'+_0x168c5a[_0xb77f('0x2e')][_0xb77f('0x39')]+'%'}}]});}_0x39e613=_[_0xb77f('0x3b')]({},_0x39e613,_0x168c5a[_0xb77f('0x3c')]);var _0x1fd1fc={'where':_0x39e613[_0xb77f('0x3a')]};return db[_0xb77f('0x29')][_0xb77f('0x1b')](_0x1fd1fc)['then'](function(_0x2b8b9a){_0x3f4782[_0xb77f('0x1b')]=_0x2b8b9a;if(_0x168c5a[_0xb77f('0x2e')]['includeAll']){_0x39e613[_0xb77f('0x3d')]=[{'all':!![]}];}return db['CannedAnswer'][_0xb77f('0x3e')](_0x39e613);})[_0xb77f('0x24')](function(_0x3cad5f){_0x3f4782[_0xb77f('0x3f')]=_0x3cad5f;return _0x3f4782;})['then'](respondWithFilteredResult(_0x2be1a6,_0x39e613))[_0xb77f('0x40')](handleError(_0x2be1a6,null));};exports[_0xb77f('0x41')]=function(_0x326247,_0xf46e27){var _0x401a23={'raw':!![],'where':{'id':_0x326247[_0xb77f('0x42')]['id']}},_0x494364={};_0x494364[_0xb77f('0x2c')]=_[_0xb77f('0x2d')](db['CannedAnswer'][_0xb77f('0x2a')]);_0x494364['query']=_[_0xb77f('0x2d')](_0x326247[_0xb77f('0x2e')]);_0x494364[_0xb77f('0x2f')]=_[_0xb77f('0x31')](_0x494364[_0xb77f('0x2c')],_0x494364[_0xb77f('0x2e')]);_0x401a23[_0xb77f('0x30')]=_['intersection'](_0x494364['model'],qs[_0xb77f('0x32')](_0x326247[_0xb77f('0x2e')]['fields']));_0x401a23['attributes']=_0x401a23[_0xb77f('0x30')][_0xb77f('0x33')]?_0x401a23['attributes']:_0x494364[_0xb77f('0x2c')];if(_0x326247[_0xb77f('0x2e')][_0xb77f('0x43')]){_0x401a23['include']=[{'all':!![]}];}_0x401a23=_[_0xb77f('0x3b')]({},_0x401a23,_0x326247[_0xb77f('0x3c')]);return db[_0xb77f('0x29')][_0xb77f('0x44')](_0x401a23)['then'](handleEntityNotFound(_0xf46e27,null))[_0xb77f('0x24')](respondWithResult(_0xf46e27,null))[_0xb77f('0x40')](handleError(_0xf46e27,null));};exports[_0xb77f('0x21')]=function(_0x45221b,_0x1aff03){if(_0x45221b[_0xb77f('0x45')]['id']){delete _0x45221b['body']['id'];}return db[_0xb77f('0x29')][_0xb77f('0x44')]({'where':{'id':_0x45221b[_0xb77f('0x42')]['id']}})['then'](handleEntityNotFound(_0x1aff03,null))[_0xb77f('0x24')](saveUpdates(_0x45221b['body'],null))['then'](respondWithResult(_0x1aff03,null))[_0xb77f('0x40')](handleError(_0x1aff03,null));};exports[_0xb77f('0x22')]=function(_0x3d97d2,_0x21f16c){return db[_0xb77f('0x29')][_0xb77f('0x44')]({'where':{'id':_0x3d97d2[_0xb77f('0x42')]['id']}})[_0xb77f('0x24')](handleEntityNotFound(_0x21f16c,null))[_0xb77f('0x24')](removeEntity(_0x21f16c,null))[_0xb77f('0x40')](handleError(_0x21f16c,null));};exports['create']=function(_0x1b4dd4,_0xd5f64d){var _0x15c49d={'key':_0x1b4dd4[_0xb77f('0x45')][_0xb77f('0x2b')]};if(_0x1b4dd4['body'][_0xb77f('0x46')]){_0x15c49d[_0xb77f('0x46')]=_0x1b4dd4[_0xb77f('0x45')][_0xb77f('0x46')];}else if(_0x1b4dd4[_0xb77f('0x45')][_0xb77f('0x47')]){_0x15c49d[_0xb77f('0x47')]=_0x1b4dd4[_0xb77f('0x45')]['SmsAccountId'];}else if(_0x1b4dd4[_0xb77f('0x45')]['OpenchannelAccountId']){_0x15c49d[_0xb77f('0x48')]=_0x1b4dd4['body']['OpenchannelAccountId'];}else if(_0x1b4dd4[_0xb77f('0x45')][_0xb77f('0x49')]){_0x15c49d[_0xb77f('0x49')]=_0x1b4dd4[_0xb77f('0x45')][_0xb77f('0x49')];}return db[_0xb77f('0x29')][_0xb77f('0x44')]({'where':_0x15c49d})[_0xb77f('0x24')](function(_0x165b43){if(_0x165b43){throw new db[(_0xb77f('0x4a'))][(_0xb77f('0x4b'))](_0xb77f('0x4c'));}return db[_0xb77f('0x29')][_0xb77f('0x4d')](_0x1b4dd4[_0xb77f('0x45')]);})[_0xb77f('0x24')](function(_0x9d1c94){var _0x4702bd=_0x1b4dd4[_0xb77f('0x4e')][_0xb77f('0x4f')]({'plain':!![]});if(!_0x4702bd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4702bd['role']==='user'){var _0x57011a=_0x9d1c94['get']({'plain':!![]});return db['UserProfileSection'][_0xb77f('0x44')]({'where':{'name':'CannedAnswers','userProfileId':_0x4702bd[_0xb77f('0x50')]},'raw':!![]})[_0xb77f('0x24')](function(_0x421198){if(_0x421198&&_0x421198[_0xb77f('0x51')]===0x0){return db[_0xb77f('0x23')][_0xb77f('0x4d')]({'name':_0x57011a['name'],'resourceId':_0x57011a['id'],'type':_0x421198['name'],'sectionId':_0x421198['id']},{})[_0xb77f('0x24')](function(){return _0x9d1c94;});}else{return _0x9d1c94;}})['catch'](function(_0x40cfac){logger[_0xb77f('0x52')](_0xb77f('0x53'),_0x40cfac);throw _0x40cfac;});}return _0x9d1c94;})[_0xb77f('0x24')](respondWithResult(_0xd5f64d,0xc9))['catch'](handleError(_0xd5f64d,null));}; \ No newline at end of file +var _0xf188=['destroy','then','get','CannedAnswers','UserProfileResource','error','stack','send','index','map','rawAttributes','fieldName','type','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','CannedAnswer','includeAll','findAll','rows','catch','params','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply'];(function(_0x2b49bc,_0x47b636){var _0x43cc65=function(_0x236ec3){while(--_0x236ec3){_0x2b49bc['push'](_0x2b49bc['shift']());}};_0x43cc65(++_0x47b636);}(_0xf188,0x8c));var _0x8f18=function(_0x579d37,_0x378bc1){_0x579d37=_0x579d37-0x0;var _0x431c5b=_0xf188[_0x579d37];return _0x431c5b;};'use strict';var emlformat=require(_0x8f18('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8f18('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8f18('0x2'));var BPromise=require(_0x8f18('0x3'));var Mustache=require('mustache');var util=require(_0x8f18('0x4'));var path=require(_0x8f18('0x5'));var sox=require(_0x8f18('0x6'));var csv=require(_0x8f18('0x7'));var ejs=require(_0x8f18('0x8'));var fs=require('fs');var fs_extra=require(_0x8f18('0x9'));var _=require(_0x8f18('0xa'));var squel=require(_0x8f18('0xb'));var crypto=require(_0x8f18('0xc'));var jsforce=require(_0x8f18('0xd'));var deskjs=require(_0x8f18('0xe'));var toCsv=require(_0x8f18('0x7'));var querystring=require('querystring');var Papa=require(_0x8f18('0xf'));var Redis=require(_0x8f18('0x10'));var authService=require(_0x8f18('0x11'));var qs=require(_0x8f18('0x12'));var as=require(_0x8f18('0x13'));var hardwareService=require(_0x8f18('0x14'));var logger=require(_0x8f18('0x15'))(_0x8f18('0x16'));var utils=require(_0x8f18('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8f18('0x18'));var db=require(_0x8f18('0x19'))['db'];function respondWithStatusCode(_0x1f83ba,_0x4a17ab){_0x4a17ab=_0x4a17ab||0xcc;return function(_0x45ca90){if(_0x45ca90){return _0x1f83ba[_0x8f18('0x1a')](_0x4a17ab);}return _0x1f83ba[_0x8f18('0x1b')](_0x4a17ab)[_0x8f18('0x1c')]();};}function respondWithResult(_0x2ab3f4,_0xaa5b68){_0xaa5b68=_0xaa5b68||0xc8;return function(_0x426799){if(_0x426799){return _0x2ab3f4['status'](_0xaa5b68)[_0x8f18('0x1d')](_0x426799);}};}function respondWithFilteredResult(_0xb46859,_0xb5c6aa){return function(_0xf154b2){if(_0xf154b2){var _0x52f2ce=typeof _0xb5c6aa[_0x8f18('0x1e')]==='undefined'&&typeof _0xb5c6aa[_0x8f18('0x1f')]==='undefined';var _0x5b5e13=_0xf154b2[_0x8f18('0x20')];var _0x5401eb=_0x52f2ce?0x0:_0xb5c6aa['offset'];var _0x1e09c0=_0x52f2ce?_0xf154b2[_0x8f18('0x20')]:_0xb5c6aa[_0x8f18('0x1e')]+_0xb5c6aa[_0x8f18('0x1f')];var _0x50bf4d;if(_0x1e09c0>=_0x5b5e13){_0x1e09c0=_0x5b5e13;_0x50bf4d=0xc8;}else{_0x50bf4d=0xce;}_0xb46859[_0x8f18('0x1b')](_0x50bf4d);return _0xb46859[_0x8f18('0x21')](_0x8f18('0x22'),_0x5401eb+'-'+_0x1e09c0+'/'+_0x5b5e13)[_0x8f18('0x1d')](_0xf154b2);}return null;};}function patchUpdates(_0x4c86c9){return function(_0x106166){try{jsonpatch[_0x8f18('0x23')](_0x106166,_0x4c86c9,!![]);}catch(_0x5122f4){return BPromise['reject'](_0x5122f4);}return _0x106166['save']();};}function saveUpdates(_0x38defb,_0x4f87b5){return function(_0x396241){if(_0x396241){return _0x396241['update'](_0x38defb)['then'](function(_0x2bdd0f){return _0x2bdd0f;});}return null;};}function removeEntity(_0x297ccc,_0x423b3a){return function(_0x2a4066){if(_0x2a4066){return _0x2a4066[_0x8f18('0x24')]()[_0x8f18('0x25')](function(){var _0x3dc979=_0x2a4066[_0x8f18('0x26')]({'plain':!![]});var _0x6c536b=_0x8f18('0x27');return db[_0x8f18('0x28')][_0x8f18('0x24')]({'where':{'type':_0x6c536b,'resourceId':_0x3dc979['id']}})[_0x8f18('0x25')](function(){return _0x2a4066;});})[_0x8f18('0x25')](function(){_0x297ccc[_0x8f18('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x277281,_0x2822f2){return function(_0x4dba87){if(!_0x4dba87){_0x277281[_0x8f18('0x1a')](0x194);}return _0x4dba87;};}function handleError(_0x1450fb,_0x5bbf05){_0x5bbf05=_0x5bbf05||0x1f4;return function(_0xb5e20f){logger[_0x8f18('0x29')](_0xb5e20f[_0x8f18('0x2a')]);if(_0xb5e20f['name']){delete _0xb5e20f['name'];}_0x1450fb[_0x8f18('0x1b')](_0x5bbf05)[_0x8f18('0x2b')](_0xb5e20f);};}exports[_0x8f18('0x2c')]=function(_0x5c9f70,_0x14bf47){var _0x41e970={},_0x282933={},_0x421c75={'count':0x0,'rows':[]};var _0x48479a=_[_0x8f18('0x2d')](db['CannedAnswer'][_0x8f18('0x2e')],function(_0x3ea112){return{'name':_0x3ea112[_0x8f18('0x2f')],'type':_0x3ea112[_0x8f18('0x30')]['key']};});_0x282933[_0x8f18('0x31')]=_[_0x8f18('0x2d')](_0x48479a,_0x8f18('0x32'));_0x282933['query']=_[_0x8f18('0x33')](_0x5c9f70[_0x8f18('0x34')]);_0x282933[_0x8f18('0x35')]=_[_0x8f18('0x36')](_0x282933['model'],_0x282933[_0x8f18('0x34')]);_0x41e970[_0x8f18('0x37')]=_[_0x8f18('0x36')](_0x282933['model'],qs[_0x8f18('0x38')](_0x5c9f70[_0x8f18('0x34')][_0x8f18('0x38')]));_0x41e970[_0x8f18('0x37')]=_0x41e970[_0x8f18('0x37')][_0x8f18('0x39')]?_0x41e970[_0x8f18('0x37')]:_0x282933[_0x8f18('0x31')];if(!_0x5c9f70['query'][_0x8f18('0x3a')](_0x8f18('0x3b'))){_0x41e970[_0x8f18('0x1f')]=qs[_0x8f18('0x1f')](_0x5c9f70['query'][_0x8f18('0x1f')]);_0x41e970[_0x8f18('0x1e')]=qs[_0x8f18('0x1e')](_0x5c9f70[_0x8f18('0x34')]['offset']);}_0x41e970['order']=qs[_0x8f18('0x3c')](_0x5c9f70[_0x8f18('0x34')]['sort']);_0x41e970[_0x8f18('0x3d')]=qs['filters'](_[_0x8f18('0x3e')](_0x5c9f70[_0x8f18('0x34')],_0x282933[_0x8f18('0x35')]),_0x48479a);if(_0x5c9f70[_0x8f18('0x34')][_0x8f18('0x3f')]){_0x41e970[_0x8f18('0x3d')]=_[_0x8f18('0x40')](_0x41e970[_0x8f18('0x3d')],{'$or':[{'key':{'$like':'%'+_0x5c9f70[_0x8f18('0x34')][_0x8f18('0x3f')]+'%'}},{'value':{'$like':'%'+_0x5c9f70[_0x8f18('0x34')]['filter']+'%'}}]});}_0x41e970=_['merge']({},_0x41e970,_0x5c9f70[_0x8f18('0x41')]);var _0x36558a={'where':_0x41e970[_0x8f18('0x3d')]};return db[_0x8f18('0x42')]['count'](_0x36558a)[_0x8f18('0x25')](function(_0x2ba4f4){_0x421c75['count']=_0x2ba4f4;if(_0x5c9f70[_0x8f18('0x34')][_0x8f18('0x43')]){_0x41e970['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x8f18('0x44')](_0x41e970);})['then'](function(_0xfe3c3b){_0x421c75[_0x8f18('0x45')]=_0xfe3c3b;return _0x421c75;})[_0x8f18('0x25')](respondWithFilteredResult(_0x14bf47,_0x41e970))[_0x8f18('0x46')](handleError(_0x14bf47,null));};exports['show']=function(_0x10be9b,_0x3c04ec){var _0x5afece={'raw':!![],'where':{'id':_0x10be9b[_0x8f18('0x47')]['id']}},_0x5879df={};_0x5879df[_0x8f18('0x31')]=_[_0x8f18('0x33')](db[_0x8f18('0x42')][_0x8f18('0x2e')]);_0x5879df[_0x8f18('0x34')]=_[_0x8f18('0x33')](_0x10be9b[_0x8f18('0x34')]);_0x5879df['filters']=_[_0x8f18('0x36')](_0x5879df[_0x8f18('0x31')],_0x5879df['query']);_0x5afece['attributes']=_[_0x8f18('0x36')](_0x5879df[_0x8f18('0x31')],qs[_0x8f18('0x38')](_0x10be9b[_0x8f18('0x34')][_0x8f18('0x38')]));_0x5afece[_0x8f18('0x37')]=_0x5afece[_0x8f18('0x37')]['length']?_0x5afece[_0x8f18('0x37')]:_0x5879df['model'];if(_0x10be9b[_0x8f18('0x34')][_0x8f18('0x43')]){_0x5afece['include']=[{'all':!![]}];}_0x5afece=_['merge']({},_0x5afece,_0x10be9b['options']);return db[_0x8f18('0x42')][_0x8f18('0x48')](_0x5afece)[_0x8f18('0x25')](handleEntityNotFound(_0x3c04ec,null))[_0x8f18('0x25')](respondWithResult(_0x3c04ec,null))[_0x8f18('0x46')](handleError(_0x3c04ec,null));};exports['update']=function(_0x4f0c05,_0x2c6b4c){if(_0x4f0c05[_0x8f18('0x49')]['id']){delete _0x4f0c05['body']['id'];}return db[_0x8f18('0x42')]['find']({'where':{'id':_0x4f0c05[_0x8f18('0x47')]['id']}})['then'](handleEntityNotFound(_0x2c6b4c,null))[_0x8f18('0x25')](saveUpdates(_0x4f0c05['body'],null))['then'](respondWithResult(_0x2c6b4c,null))[_0x8f18('0x46')](handleError(_0x2c6b4c,null));};exports[_0x8f18('0x24')]=function(_0x3e6e8e,_0x59f282){return db[_0x8f18('0x42')]['find']({'where':{'id':_0x3e6e8e[_0x8f18('0x47')]['id']}})[_0x8f18('0x25')](handleEntityNotFound(_0x59f282,null))['then'](removeEntity(_0x59f282,null))['catch'](handleError(_0x59f282,null));};exports[_0x8f18('0x4a')]=function(_0x2f0c0c,_0x59522d){var _0xaa8ee3={'key':_0x2f0c0c[_0x8f18('0x49')][_0x8f18('0x4b')]};if(_0x2f0c0c[_0x8f18('0x49')]['MailAccountId']){_0xaa8ee3[_0x8f18('0x4c')]=_0x2f0c0c[_0x8f18('0x49')][_0x8f18('0x4c')];}else if(_0x2f0c0c[_0x8f18('0x49')][_0x8f18('0x4d')]){_0xaa8ee3[_0x8f18('0x4d')]=_0x2f0c0c['body'][_0x8f18('0x4d')];}else if(_0x2f0c0c[_0x8f18('0x49')][_0x8f18('0x4e')]){_0xaa8ee3['OpenchannelAccountId']=_0x2f0c0c[_0x8f18('0x49')][_0x8f18('0x4e')];}else if(_0x2f0c0c['body']['ChatWebsiteId']){_0xaa8ee3[_0x8f18('0x4f')]=_0x2f0c0c[_0x8f18('0x49')][_0x8f18('0x4f')];}return db[_0x8f18('0x42')][_0x8f18('0x48')]({'where':_0xaa8ee3})['then'](function(_0x331056){if(_0x331056){throw new db[(_0x8f18('0x50'))][(_0x8f18('0x51'))](_0x8f18('0x52'));}return db[_0x8f18('0x42')][_0x8f18('0x4a')](_0x2f0c0c[_0x8f18('0x49')]);})[_0x8f18('0x25')](function(_0x3874e6){var _0x432a29=_0x2f0c0c[_0x8f18('0x53')][_0x8f18('0x26')]({'plain':!![]});if(!_0x432a29)throw new Error(_0x8f18('0x54'));if(_0x432a29['role']===_0x8f18('0x53')){var _0x162cb3=_0x3874e6[_0x8f18('0x26')]({'plain':!![]});return db[_0x8f18('0x55')]['find']({'where':{'name':_0x8f18('0x27'),'userProfileId':_0x432a29['userProfileId']},'raw':!![]})[_0x8f18('0x25')](function(_0x2248be){if(_0x2248be&&_0x2248be[_0x8f18('0x56')]===0x0){return db[_0x8f18('0x28')][_0x8f18('0x4a')]({'name':_0x162cb3[_0x8f18('0x32')],'resourceId':_0x162cb3['id'],'type':_0x2248be[_0x8f18('0x32')],'sectionId':_0x2248be['id']},{})[_0x8f18('0x25')](function(){return _0x3874e6;});}else{return _0x3874e6;}})[_0x8f18('0x46')](function(_0x516ed5){logger[_0x8f18('0x29')](_0x8f18('0x57'),_0x516ed5);throw _0x516ed5;});}return _0x3874e6;})[_0x8f18('0x25')](respondWithResult(_0x59522d,0xc9))[_0x8f18('0x46')](handleError(_0x59522d,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 3e95d9d..bc922bc 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 _0x8f09=['tools_canned_answers','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer'];(function(_0x58a4ac,_0x43fd42){var _0x545810=function(_0x308e65){while(--_0x308e65){_0x58a4ac['push'](_0x58a4ac['shift']());}};_0x545810(++_0x43fd42);}(_0x8f09,0x157));var _0x98f0=function(_0x2f2d97,_0x43fcb9){_0x2f2d97=_0x2f2d97-0x0;var _0x1c0a52=_0x8f09[_0x2f2d97];return _0x1c0a52;};'use strict';var _=require(_0x98f0('0x0'));var util=require('util');var logger=require(_0x98f0('0x1'))('api');var moment=require('moment');var BPromise=require(_0x98f0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x98f0('0x3'));var rimraf=require(_0x98f0('0x4'));var config=require(_0x98f0('0x5'));var attributes=require(_0x98f0('0x6'));module['exports']=function(_0x92b6b2,_0x94ffa2){return _0x92b6b2[_0x98f0('0x7')](_0x98f0('0x8'),attributes,{'tableName':_0x98f0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x98f0('0xa')});}; \ No newline at end of file +var _0xea10=['rimraf','../../config/environment','./cannedAnswer.attributes','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xea10,0x95));var _0x0ea1=function(_0x32abbe,_0x4649c2){_0x32abbe=_0x32abbe-0x0;var _0x40ea67=_0xea10[_0x32abbe];return _0x40ea67;};'use strict';var _=require(_0x0ea1('0x0'));var util=require(_0x0ea1('0x1'));var logger=require('../../config/logger')(_0x0ea1('0x2'));var moment=require(_0x0ea1('0x3'));var BPromise=require(_0x0ea1('0x4'));var rp=require(_0x0ea1('0x5'));var fs=require('fs');var path=require(_0x0ea1('0x6'));var rimraf=require(_0x0ea1('0x7'));var config=require(_0x0ea1('0x8'));var attributes=require(_0x0ea1('0x9'));module['exports']=function(_0xd81f3e,_0xeb349b){return _0xd81f3e['define']('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0ea1('0xa'),'collate':_0x0ea1('0xb')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 0043e7e..b8a2eaa 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(_0x2b39f8,_0x4d8c2e){var _0x273fc6=function(_0x2e4201){while(--_0x2e4201){_0x2b39f8['push'](_0x2b39f8['shift']());}};_0x273fc6(++_0x4d8c2e);}(_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','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(_0x4e8a09,_0x3f02ec){var _0x23b670=function(_0x27b3bc){while(--_0x27b3bc){_0x4e8a09['push'](_0x4e8a09['shift']());}};_0x23b670(++_0x3f02ec);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 49b9003..f670c6d 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 _0xf954=['/:id','isAuthenticated','show','post','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get'];(function(_0x4f50ac,_0x7efc91){var _0x62030d=function(_0x356907){while(--_0x356907){_0x4f50ac['push'](_0x4f50ac['shift']());}};_0x62030d(++_0x7efc91);}(_0xf954,0x106));var _0x4f95=function(_0x42f6ca,_0x268900){_0x42f6ca=_0x42f6ca-0x0;var _0x509ea9=_0xf954[_0x42f6ca];return _0x509ea9;};'use strict';var multer=require(_0x4f95('0x0'));var util=require(_0x4f95('0x1'));var path=require(_0x4f95('0x2'));var timeout=require(_0x4f95('0x3'));var express=require(_0x4f95('0x4'));var router=express[_0x4f95('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4f95('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f95('0x7'));var controller=require(_0x4f95('0x8'));router[_0x4f95('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4f95('0xa'),auth[_0x4f95('0xb')](),controller[_0x4f95('0xc')]);router[_0x4f95('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4f95('0xe')]);router[_0x4f95('0xf')](_0x4f95('0xa'),auth[_0x4f95('0xb')](),controller[_0x4f95('0x10')]);module['exports']=router; \ No newline at end of file +var _0x98a1=['./cannedAnswer.controller','isAuthenticated','index','get','/:id','show','post','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x98a1,0x171));var _0x198a=function(_0x1cf1cc,_0x2e63b2){_0x1cf1cc=_0x1cf1cc-0x0;var _0x1d5fb8=_0x98a1[_0x1cf1cc];return _0x1d5fb8;};'use strict';var multer=require('multer');var util=require(_0x198a('0x0'));var path=require(_0x198a('0x1'));var timeout=require(_0x198a('0x2'));var express=require(_0x198a('0x3'));var router=express[_0x198a('0x4')]();var fs_extra=require(_0x198a('0x5'));var auth=require(_0x198a('0x6'));var interaction=require(_0x198a('0x7'));var config=require(_0x198a('0x8'));var controller=require(_0x198a('0x9'));router['get']('/',auth[_0x198a('0xa')](),controller[_0x198a('0xb')]);router[_0x198a('0xc')](_0x198a('0xd'),auth['isAuthenticated'](),controller[_0x198a('0xe')]);router[_0x198a('0xf')]('/',auth[_0x198a('0xa')](),controller['create']);router['put'](_0x198a('0xd'),auth['isAuthenticated'](),controller[_0x198a('0x10')]);router['delete'](_0x198a('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x198a('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 8b1f48d..e954256 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 _0xbe0f=['exports','STRING','INTEGER','sequelize'];(function(_0x2113d6,_0x45e5f5){var _0x14554c=function(_0xc5f39a){while(--_0xc5f39a){_0x2113d6['push'](_0x2113d6['shift']());}};_0x14554c(++_0x45e5f5);}(_0xbe0f,0x1d3));var _0xfbe0=function(_0x8bd3fe,_0x4efbf8){_0x8bd3fe=_0x8bd3fe-0x0;var _0x3ef569=_0xbe0f[_0x8bd3fe];return _0x3ef569;};'use strict';var Sequelize=require(_0xfbe0('0x0'));module[_0xfbe0('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xfbe0('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xfbe0('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xfbe0('0x2')]},'dstchannel':{'type':Sequelize[_0xfbe0('0x2')]},'lastapp':{'type':Sequelize[_0xfbe0('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xfbe0('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xfbe0('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xfbe0('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xfbe0('0x2')]},'userfield':{'type':Sequelize[_0xfbe0('0x2')]},'uniqueid':{'type':Sequelize[_0xfbe0('0x2')]},'linkedid':{'type':Sequelize[_0xfbe0('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xfbe0('0x2')]},'type':{'type':Sequelize[_0xfbe0('0x2')]},'tag':{'type':Sequelize[_0xfbe0('0x2')]}}; \ No newline at end of file +var _0x138d=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x143558,_0x2e9f17){var _0x426caa=function(_0x5b2213){while(--_0x5b2213){_0x143558['push'](_0x143558['shift']());}};_0x426caa(++_0x2e9f17);}(_0x138d,0x1ab));var _0xd138=function(_0x325a08,_0x571fff){_0x325a08=_0x325a08-0x0;var _0x436e01=_0x138d[_0x325a08];return _0x436e01;};'use strict';var Sequelize=require(_0xd138('0x0'));module[_0xd138('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xd138('0x2')},'clid':{'type':Sequelize[_0xd138('0x3')]},'src':{'type':Sequelize[_0xd138('0x3')]},'dst':{'type':Sequelize[_0xd138('0x3')]},'dcontext':{'type':Sequelize[_0xd138('0x3')]},'channel':{'type':Sequelize[_0xd138('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xd138('0x3')]},'lastdata':{'type':Sequelize[_0xd138('0x3')]},'duration':{'type':Sequelize[_0xd138('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd138('0x3')]},'amaflags':{'type':Sequelize[_0xd138('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xd138('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xd138('0x3')]},'sequence':{'type':Sequelize[_0xd138('0x3')]},'peeraccount':{'type':Sequelize[_0xd138('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xd138('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 814245a..17fbd33 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 _0x2d17=['destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','apply','then','error','name','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Cdr','count','includeAll','include','findAll','rows','show','params','find','catch','create','update','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d17,0x17e));var _0x72d1=function(_0x33c383,_0x202cbe){_0x33c383=_0x33c383-0x0;var _0x49bc8c=_0x2d17[_0x33c383];return _0x49bc8c;};'use strict';var emlformat=require(_0x72d1('0x0'));var rimraf=require(_0x72d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x72d1('0x2'));var rp=require(_0x72d1('0x3'));var moment=require('moment');var BPromise=require(_0x72d1('0x4'));var Mustache=require(_0x72d1('0x5'));var util=require('util');var path=require(_0x72d1('0x6'));var sox=require('sox');var csv=require(_0x72d1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x72d1('0x8'));var _=require(_0x72d1('0x9'));var squel=require('squel');var crypto=require(_0x72d1('0xa'));var jsforce=require(_0x72d1('0xb'));var deskjs=require(_0x72d1('0xc'));var toCsv=require('to-csv');var querystring=require(_0x72d1('0xd'));var Papa=require(_0x72d1('0xe'));var Redis=require(_0x72d1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x72d1('0x10'));var as=require(_0x72d1('0x11'));var hardwareService=require(_0x72d1('0x12'));var logger=require(_0x72d1('0x13'))(_0x72d1('0x14'));var utils=require(_0x72d1('0x15'));var config=require(_0x72d1('0x16'));var licenseUtil=require(_0x72d1('0x17'));var db=require(_0x72d1('0x18'))['db'];function respondWithStatusCode(_0x2f5a78,_0x5ad4df){_0x5ad4df=_0x5ad4df||0xcc;return function(_0x3cd1ae){if(_0x3cd1ae){return _0x2f5a78[_0x72d1('0x19')](_0x5ad4df);}return _0x2f5a78[_0x72d1('0x1a')](_0x5ad4df)[_0x72d1('0x1b')]();};}function respondWithResult(_0x22ac6f,_0x685a27){_0x685a27=_0x685a27||0xc8;return function(_0x143718){if(_0x143718){return _0x22ac6f[_0x72d1('0x1a')](_0x685a27)[_0x72d1('0x1c')](_0x143718);}};}function respondWithFilteredResult(_0x3f190f,_0x21c85e){return function(_0x23a238){if(_0x23a238){var _0x8d458=typeof _0x21c85e['offset']===_0x72d1('0x1d')&&typeof _0x21c85e['limit']===_0x72d1('0x1d');var _0x2c9851=_0x23a238['count'];var _0x1061b7=_0x8d458?0x0:_0x21c85e[_0x72d1('0x1e')];var _0x1ca18d=_0x8d458?_0x23a238['count']:_0x21c85e['offset']+_0x21c85e[_0x72d1('0x1f')];var _0x10d464;if(_0x1ca18d>=_0x2c9851){_0x1ca18d=_0x2c9851;_0x10d464=0xc8;}else{_0x10d464=0xce;}_0x3f190f[_0x72d1('0x1a')](_0x10d464);return _0x3f190f[_0x72d1('0x20')](_0x72d1('0x21'),_0x1061b7+'-'+_0x1ca18d+'/'+_0x2c9851)[_0x72d1('0x1c')](_0x23a238);}return null;};}function patchUpdates(_0x1e2411){return function(_0x5c7982){try{jsonpatch[_0x72d1('0x22')](_0x5c7982,_0x1e2411,!![]);}catch(_0x56e8d3){return BPromise['reject'](_0x56e8d3);}return _0x5c7982['save']();};}function saveUpdates(_0x585243,_0x445985){return function(_0x374602){if(_0x374602){return _0x374602['update'](_0x585243)[_0x72d1('0x23')](function(_0x256dc1){return _0x256dc1;});}return null;};}function removeEntity(_0x492086,_0x1431ee){return function(_0x26fa35){if(_0x26fa35){return _0x26fa35['destroy']()['then'](function(){_0x492086[_0x72d1('0x1a')](0xcc)[_0x72d1('0x1b')]();});}};}function handleEntityNotFound(_0x2f661,_0x2f879f){return function(_0xdf6a69){if(!_0xdf6a69){_0x2f661[_0x72d1('0x19')](0x194);}return _0xdf6a69;};}function handleError(_0x163bec,_0x589f7c){_0x589f7c=_0x589f7c||0x1f4;return function(_0x57ec9e){logger[_0x72d1('0x24')](_0x57ec9e['stack']);if(_0x57ec9e[_0x72d1('0x25')]){delete _0x57ec9e[_0x72d1('0x25')];}_0x163bec[_0x72d1('0x1a')](_0x589f7c)['send'](_0x57ec9e);};}exports[_0x72d1('0x26')]=function(_0x4c4c41,_0x707cd0){var _0x20055f={},_0x32588f={},_0x2cc0c8={'count':0x0,'rows':[]};var _0x51242b=_[_0x72d1('0x27')](db['Cdr'][_0x72d1('0x28')],function(_0x32dc5e){return{'name':_0x32dc5e['fieldName'],'type':_0x32dc5e[_0x72d1('0x29')][_0x72d1('0x2a')]};});_0x32588f[_0x72d1('0x2b')]=_[_0x72d1('0x27')](_0x51242b,_0x72d1('0x25'));_0x32588f['query']=_[_0x72d1('0x2c')](_0x4c4c41[_0x72d1('0x2d')]);_0x32588f[_0x72d1('0x2e')]=_['intersection'](_0x32588f[_0x72d1('0x2b')],_0x32588f[_0x72d1('0x2d')]);_0x20055f['attributes']=_[_0x72d1('0x2f')](_0x32588f[_0x72d1('0x2b')],qs[_0x72d1('0x30')](_0x4c4c41['query'][_0x72d1('0x30')]));_0x20055f['attributes']=_0x20055f[_0x72d1('0x31')][_0x72d1('0x32')]?_0x20055f[_0x72d1('0x31')]:_0x32588f[_0x72d1('0x2b')];if(!_0x4c4c41[_0x72d1('0x2d')][_0x72d1('0x33')](_0x72d1('0x34'))){_0x20055f[_0x72d1('0x1f')]=qs[_0x72d1('0x1f')](_0x4c4c41[_0x72d1('0x2d')][_0x72d1('0x1f')]);_0x20055f['offset']=qs[_0x72d1('0x1e')](_0x4c4c41[_0x72d1('0x2d')][_0x72d1('0x1e')]);}_0x20055f[_0x72d1('0x35')]=qs['sort'](_0x4c4c41[_0x72d1('0x2d')][_0x72d1('0x36')]);_0x20055f[_0x72d1('0x37')]=qs['filters'](_[_0x72d1('0x38')](_0x4c4c41[_0x72d1('0x2d')],_0x32588f[_0x72d1('0x2e')]),_0x51242b);if(_0x4c4c41['query'][_0x72d1('0x39')]){_0x20055f[_0x72d1('0x37')]=_[_0x72d1('0x3a')](_0x20055f['where'],{'$or':_[_0x72d1('0x27')](_0x51242b,function(_0x40cdbd){if(_0x40cdbd[_0x72d1('0x29')]!==_0x72d1('0x3b')){var _0x44c4f5={};_0x44c4f5[_0x40cdbd[_0x72d1('0x25')]]={'$like':'%'+_0x4c4c41[_0x72d1('0x2d')]['filter']+'%'};return _0x44c4f5;}})});}_0x20055f=_[_0x72d1('0x3a')]({},_0x20055f,_0x4c4c41[_0x72d1('0x3c')]);var _0x440ac5={'where':_0x20055f[_0x72d1('0x37')]};return db[_0x72d1('0x3d')][_0x72d1('0x3e')](_0x440ac5)[_0x72d1('0x23')](function(_0x1d4fdf){_0x2cc0c8['count']=_0x1d4fdf;if(_0x4c4c41[_0x72d1('0x2d')][_0x72d1('0x3f')]){_0x20055f[_0x72d1('0x40')]=[{'all':!![]}];}return db[_0x72d1('0x3d')][_0x72d1('0x41')](_0x20055f);})[_0x72d1('0x23')](function(_0xb911fa){_0x2cc0c8[_0x72d1('0x42')]=_0xb911fa;return _0x2cc0c8;})['then'](respondWithFilteredResult(_0x707cd0,_0x20055f))['catch'](handleError(_0x707cd0,null));};exports[_0x72d1('0x43')]=function(_0x881d97,_0x824c17){var _0x21d361={'raw':!![],'where':{'id':_0x881d97[_0x72d1('0x44')]['id']}},_0x5a6bc4={};_0x5a6bc4[_0x72d1('0x2b')]=_['keys'](db[_0x72d1('0x3d')]['rawAttributes']);_0x5a6bc4[_0x72d1('0x2d')]=_[_0x72d1('0x2c')](_0x881d97['query']);_0x5a6bc4[_0x72d1('0x2e')]=_['intersection'](_0x5a6bc4['model'],_0x5a6bc4['query']);_0x21d361[_0x72d1('0x31')]=_['intersection'](_0x5a6bc4[_0x72d1('0x2b')],qs[_0x72d1('0x30')](_0x881d97[_0x72d1('0x2d')]['fields']));_0x21d361['attributes']=_0x21d361[_0x72d1('0x31')]['length']?_0x21d361['attributes']:_0x5a6bc4[_0x72d1('0x2b')];if(_0x881d97[_0x72d1('0x2d')][_0x72d1('0x3f')]){_0x21d361['include']=[{'all':!![]}];}_0x21d361=_['merge']({},_0x21d361,_0x881d97['options']);return db['Cdr'][_0x72d1('0x45')](_0x21d361)[_0x72d1('0x23')](handleEntityNotFound(_0x824c17,null))[_0x72d1('0x23')](respondWithResult(_0x824c17,null))[_0x72d1('0x46')](handleError(_0x824c17,null));};exports[_0x72d1('0x47')]=function(_0x1ba64e,_0x1d1465){return db[_0x72d1('0x3d')][_0x72d1('0x47')](_0x1ba64e['body'],{})[_0x72d1('0x23')](respondWithResult(_0x1d1465,0xc9))[_0x72d1('0x46')](handleError(_0x1d1465,null));};exports[_0x72d1('0x48')]=function(_0x51b1a9,_0x418e6f){if(_0x51b1a9[_0x72d1('0x49')]['id']){delete _0x51b1a9[_0x72d1('0x49')]['id'];}return db['Cdr'][_0x72d1('0x45')]({'where':{'id':_0x51b1a9[_0x72d1('0x44')]['id']}})[_0x72d1('0x23')](handleEntityNotFound(_0x418e6f,null))[_0x72d1('0x23')](saveUpdates(_0x51b1a9['body'],null))['then'](respondWithResult(_0x418e6f,null))[_0x72d1('0x46')](handleError(_0x418e6f,null));};exports[_0x72d1('0x4a')]=function(_0x1a8dd2,_0x5ad683){return db[_0x72d1('0x3d')][_0x72d1('0x45')]({'where':{'id':_0x1a8dd2[_0x72d1('0x44')]['id']}})[_0x72d1('0x23')](handleEntityNotFound(_0x5ad683,null))[_0x72d1('0x23')](removeEntity(_0x5ad683,null))[_0x72d1('0x46')](handleError(_0x5ad683,null));};exports[_0x72d1('0x4b')]=function(_0xebe855,_0x12870c){return db[_0x72d1('0x3d')][_0x72d1('0x4b')]()['then'](respondWithResult(_0x12870c,null))[_0x72d1('0x46')](handleError(_0x12870c,null));}; \ No newline at end of file +var _0x3c6c=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','Cdr','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x2cf37f,_0x2217b7){var _0x1bd369=function(_0x12d071){while(--_0x12d071){_0x2cf37f['push'](_0x2cf37f['shift']());}};_0x1bd369(++_0x2217b7);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x161a85,_0x5740c5){_0x161a85=_0x161a85-0x0;var _0x427798=_0x3c6c[_0x161a85];return _0x427798;};'use strict';var emlformat=require(_0xc3c6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc3c6('0x1'));var jsonpatch=require(_0xc3c6('0x2'));var rp=require(_0xc3c6('0x3'));var moment=require(_0xc3c6('0x4'));var BPromise=require(_0xc3c6('0x5'));var Mustache=require(_0xc3c6('0x6'));var util=require(_0xc3c6('0x7'));var path=require(_0xc3c6('0x8'));var sox=require('sox');var csv=require(_0xc3c6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc3c6('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc3c6('0x9'));var querystring=require(_0xc3c6('0xb'));var Papa=require('papaparse');var Redis=require(_0xc3c6('0xc'));var authService=require(_0xc3c6('0xd'));var qs=require(_0xc3c6('0xe'));var as=require(_0xc3c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc3c6('0x10'))(_0xc3c6('0x11'));var utils=require(_0xc3c6('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc3c6('0x13'))['db'];function respondWithStatusCode(_0x407147,_0x1d18e3){_0x1d18e3=_0x1d18e3||0xcc;return function(_0x648a0){if(_0x648a0){return _0x407147[_0xc3c6('0x14')](_0x1d18e3);}return _0x407147[_0xc3c6('0x15')](_0x1d18e3)[_0xc3c6('0x16')]();};}function respondWithResult(_0x28a431,_0x34eeeb){_0x34eeeb=_0x34eeeb||0xc8;return function(_0x55c1d8){if(_0x55c1d8){return _0x28a431[_0xc3c6('0x15')](_0x34eeeb)[_0xc3c6('0x17')](_0x55c1d8);}};}function respondWithFilteredResult(_0x37a6a8,_0x25d2bd){return function(_0x283506){if(_0x283506){var _0x42c631=typeof _0x25d2bd[_0xc3c6('0x18')]===_0xc3c6('0x19')&&typeof _0x25d2bd[_0xc3c6('0x1a')]===_0xc3c6('0x19');var _0x64c62a=_0x283506[_0xc3c6('0x1b')];var _0x26c9b0=_0x42c631?0x0:_0x25d2bd[_0xc3c6('0x18')];var _0x3003e1=_0x42c631?_0x283506[_0xc3c6('0x1b')]:_0x25d2bd['offset']+_0x25d2bd[_0xc3c6('0x1a')];var _0x5a2456;if(_0x3003e1>=_0x64c62a){_0x3003e1=_0x64c62a;_0x5a2456=0xc8;}else{_0x5a2456=0xce;}_0x37a6a8[_0xc3c6('0x15')](_0x5a2456);return _0x37a6a8[_0xc3c6('0x1c')](_0xc3c6('0x1d'),_0x26c9b0+'-'+_0x3003e1+'/'+_0x64c62a)[_0xc3c6('0x17')](_0x283506);}return null;};}function patchUpdates(_0xfe2f70){return function(_0x3490a2){try{jsonpatch[_0xc3c6('0x1e')](_0x3490a2,_0xfe2f70,!![]);}catch(_0x22aa76){return BPromise[_0xc3c6('0x1f')](_0x22aa76);}return _0x3490a2[_0xc3c6('0x20')]();};}function saveUpdates(_0x2a99a0,_0x392d20){return function(_0x3d03b0){if(_0x3d03b0){return _0x3d03b0[_0xc3c6('0x21')](_0x2a99a0)['then'](function(_0x24fb2d){return _0x24fb2d;});}return null;};}function removeEntity(_0x40893b,_0x2bced6){return function(_0x565a86){if(_0x565a86){return _0x565a86[_0xc3c6('0x22')]()[_0xc3c6('0x23')](function(){_0x40893b[_0xc3c6('0x15')](0xcc)[_0xc3c6('0x16')]();});}};}function handleEntityNotFound(_0x2bc9bf,_0x47808f){return function(_0x1a0e3b){if(!_0x1a0e3b){_0x2bc9bf['sendStatus'](0x194);}return _0x1a0e3b;};}function handleError(_0x104e80,_0x13b909){_0x13b909=_0x13b909||0x1f4;return function(_0x4ca76f){logger[_0xc3c6('0x24')](_0x4ca76f[_0xc3c6('0x25')]);if(_0x4ca76f[_0xc3c6('0x26')]){delete _0x4ca76f[_0xc3c6('0x26')];}_0x104e80[_0xc3c6('0x15')](_0x13b909)[_0xc3c6('0x27')](_0x4ca76f);};}exports[_0xc3c6('0x28')]=function(_0x2e4094,_0x1f1d36){var _0x478a4b={},_0xb047b1={},_0x4571f4={'count':0x0,'rows':[]};var _0x31975e=_[_0xc3c6('0x29')](db['Cdr'][_0xc3c6('0x2a')],function(_0x1bcc34){return{'name':_0x1bcc34[_0xc3c6('0x2b')],'type':_0x1bcc34[_0xc3c6('0x2c')][_0xc3c6('0x2d')]};});_0xb047b1[_0xc3c6('0x2e')]=_['map'](_0x31975e,_0xc3c6('0x26'));_0xb047b1[_0xc3c6('0x2f')]=_[_0xc3c6('0x30')](_0x2e4094[_0xc3c6('0x2f')]);_0xb047b1[_0xc3c6('0x31')]=_['intersection'](_0xb047b1[_0xc3c6('0x2e')],_0xb047b1[_0xc3c6('0x2f')]);_0x478a4b[_0xc3c6('0x32')]=_[_0xc3c6('0x33')](_0xb047b1[_0xc3c6('0x2e')],qs[_0xc3c6('0x34')](_0x2e4094[_0xc3c6('0x2f')]['fields']));_0x478a4b[_0xc3c6('0x32')]=_0x478a4b['attributes'][_0xc3c6('0x35')]?_0x478a4b[_0xc3c6('0x32')]:_0xb047b1[_0xc3c6('0x2e')];if(!_0x2e4094[_0xc3c6('0x2f')][_0xc3c6('0x36')](_0xc3c6('0x37'))){_0x478a4b['limit']=qs[_0xc3c6('0x1a')](_0x2e4094[_0xc3c6('0x2f')]['limit']);_0x478a4b[_0xc3c6('0x18')]=qs[_0xc3c6('0x18')](_0x2e4094[_0xc3c6('0x2f')][_0xc3c6('0x18')]);}_0x478a4b[_0xc3c6('0x38')]=qs[_0xc3c6('0x39')](_0x2e4094[_0xc3c6('0x2f')]['sort']);_0x478a4b['where']=qs[_0xc3c6('0x31')](_[_0xc3c6('0x3a')](_0x2e4094[_0xc3c6('0x2f')],_0xb047b1[_0xc3c6('0x31')]),_0x31975e);if(_0x2e4094[_0xc3c6('0x2f')]['filter']){_0x478a4b[_0xc3c6('0x3b')]=_[_0xc3c6('0x3c')](_0x478a4b[_0xc3c6('0x3b')],{'$or':_[_0xc3c6('0x29')](_0x31975e,function(_0x1eb423){if(_0x1eb423[_0xc3c6('0x2c')]!==_0xc3c6('0x3d')){var _0xada6f={};_0xada6f[_0x1eb423[_0xc3c6('0x26')]]={'$like':'%'+_0x2e4094['query'][_0xc3c6('0x3e')]+'%'};return _0xada6f;}})});}_0x478a4b=_[_0xc3c6('0x3c')]({},_0x478a4b,_0x2e4094[_0xc3c6('0x3f')]);var _0x316605={'where':_0x478a4b[_0xc3c6('0x3b')]};return db[_0xc3c6('0x40')][_0xc3c6('0x1b')](_0x316605)[_0xc3c6('0x23')](function(_0x59b2d9){_0x4571f4[_0xc3c6('0x1b')]=_0x59b2d9;if(_0x2e4094[_0xc3c6('0x2f')]['includeAll']){_0x478a4b[_0xc3c6('0x41')]=[{'all':!![]}];}return db['Cdr'][_0xc3c6('0x42')](_0x478a4b);})[_0xc3c6('0x23')](function(_0x25bb1e){_0x4571f4[_0xc3c6('0x43')]=_0x25bb1e;return _0x4571f4;})[_0xc3c6('0x23')](respondWithFilteredResult(_0x1f1d36,_0x478a4b))[_0xc3c6('0x44')](handleError(_0x1f1d36,null));};exports[_0xc3c6('0x45')]=function(_0x998388,_0x572339){var _0xda8652={'raw':!![],'where':{'id':_0x998388[_0xc3c6('0x46')]['id']}},_0x570d11={};_0x570d11[_0xc3c6('0x2e')]=_[_0xc3c6('0x30')](db[_0xc3c6('0x40')]['rawAttributes']);_0x570d11['query']=_[_0xc3c6('0x30')](_0x998388[_0xc3c6('0x2f')]);_0x570d11[_0xc3c6('0x31')]=_[_0xc3c6('0x33')](_0x570d11['model'],_0x570d11[_0xc3c6('0x2f')]);_0xda8652[_0xc3c6('0x32')]=_[_0xc3c6('0x33')](_0x570d11[_0xc3c6('0x2e')],qs[_0xc3c6('0x34')](_0x998388[_0xc3c6('0x2f')][_0xc3c6('0x34')]));_0xda8652['attributes']=_0xda8652['attributes'][_0xc3c6('0x35')]?_0xda8652[_0xc3c6('0x32')]:_0x570d11['model'];if(_0x998388[_0xc3c6('0x2f')][_0xc3c6('0x47')]){_0xda8652['include']=[{'all':!![]}];}_0xda8652=_[_0xc3c6('0x3c')]({},_0xda8652,_0x998388[_0xc3c6('0x3f')]);return db['Cdr'][_0xc3c6('0x48')](_0xda8652)[_0xc3c6('0x23')](handleEntityNotFound(_0x572339,null))[_0xc3c6('0x23')](respondWithResult(_0x572339,null))[_0xc3c6('0x44')](handleError(_0x572339,null));};exports[_0xc3c6('0x49')]=function(_0x333698,_0x508731){return db[_0xc3c6('0x40')][_0xc3c6('0x49')](_0x333698[_0xc3c6('0x4a')],{})[_0xc3c6('0x23')](respondWithResult(_0x508731,0xc9))[_0xc3c6('0x44')](handleError(_0x508731,null));};exports[_0xc3c6('0x21')]=function(_0x21b8a0,_0x55b8bc){if(_0x21b8a0['body']['id']){delete _0x21b8a0[_0xc3c6('0x4a')]['id'];}return db[_0xc3c6('0x40')][_0xc3c6('0x48')]({'where':{'id':_0x21b8a0[_0xc3c6('0x46')]['id']}})['then'](handleEntityNotFound(_0x55b8bc,null))['then'](saveUpdates(_0x21b8a0[_0xc3c6('0x4a')],null))[_0xc3c6('0x23')](respondWithResult(_0x55b8bc,null))[_0xc3c6('0x44')](handleError(_0x55b8bc,null));};exports[_0xc3c6('0x22')]=function(_0x34ed73,_0x313277){return db[_0xc3c6('0x40')][_0xc3c6('0x48')]({'where':{'id':_0x34ed73[_0xc3c6('0x46')]['id']}})[_0xc3c6('0x23')](handleEntityNotFound(_0x313277,null))[_0xc3c6('0x23')](removeEntity(_0x313277,null))[_0xc3c6('0x44')](handleError(_0x313277,null));};exports[_0xc3c6('0x4b')]=function(_0xc84c69,_0xad293e){return db[_0xc3c6('0x40')]['describe']()[_0xc3c6('0x23')](respondWithResult(_0xad293e,null))[_0xc3c6('0x44')](handleError(_0xad293e,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 40002fa..62bdacb 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x5f221f,_0xe2f7be){var _0x49d4cd=function(_0x459135){while(--_0x459135){_0x5f221f['push'](_0x5f221f['shift']());}};_0x49d4cd(++_0xe2f7be);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0xd5aef5,_0x1c0460){var _0xe67900=function(_0x9d33f4){while(--_0x9d33f4){_0xd5aef5['push'](_0xd5aef5['shift']());}};_0xe67900(++_0x1c0460);}(_0x7a54,0x106));var _0x47a5=function(_0x48afef,_0x298040){_0x48afef=_0x48afef-0x0;var _0x1dba70=_0x7a54[_0x48afef];return _0x1dba70;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 343e8b2..a6194f7 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 _0x6bc6=['message','Cdr,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','request\x20sent','stringify','error','code'];(function(_0x335853,_0x1e1bac){var _0x2b282f=function(_0x19c11b){while(--_0x19c11b){_0x335853['push'](_0x335853['shift']());}};_0x2b282f(++_0x1e1bac);}(_0x6bc6,0x6f));var _0x66bc=function(_0x16ae34,_0x1dc6d){_0x16ae34=_0x16ae34-0x0;var _0x184836=_0x6bc6[_0x16ae34];return _0x184836;};'use strict';var _=require(_0x66bc('0x0'));var util=require('util');var moment=require(_0x66bc('0x1'));var BPromise=require(_0x66bc('0x2'));var rs=require(_0x66bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x66bc('0x4'))['db'];var utils=require(_0x66bc('0x5'));var logger=require(_0x66bc('0x6'))('rpc');var config=require(_0x66bc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x66bc('0x8')][_0x66bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27226d,_0x18cc85,_0x30bb4b){return new BPromise(function(_0x1f4579,_0x19c77e){return client['request'](_0x27226d,_0x30bb4b)['then'](function(_0x3bc18b){logger[_0x66bc('0xa')]('Cdr,\x20%s,\x20%s',_0x18cc85,_0x66bc('0xb'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x18cc85,'request\x20sent',JSON[_0x66bc('0xc')](_0x3bc18b));if(_0x3bc18b[_0x66bc('0xd')]){if(_0x3bc18b['error'][_0x66bc('0xe')]===0x1f4){logger[_0x66bc('0xd')]('Cdr,\x20%s,\x20%s',_0x18cc85,_0x3bc18b[_0x66bc('0xd')][_0x66bc('0xf')]);return _0x19c77e(_0x3bc18b[_0x66bc('0xd')][_0x66bc('0xf')]);}logger[_0x66bc('0xd')](_0x66bc('0x10'),_0x18cc85,_0x3bc18b['error'][_0x66bc('0xf')]);return _0x1f4579(_0x3bc18b[_0x66bc('0xd')][_0x66bc('0xf')]);}else{logger[_0x66bc('0xa')]('Cdr,\x20%s,\x20%s',_0x18cc85,'request\x20sent');_0x1f4579(_0x3bc18b[_0x66bc('0x11')][_0x66bc('0xf')]);}})['catch'](function(_0x375ddd){logger[_0x66bc('0xd')](_0x66bc('0x10'),_0x18cc85,_0x375ddd);_0x19c77e(_0x375ddd);});});} \ No newline at end of file +var _0xad31=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xad31,0x1d3));var _0x1ad3=function(_0x31881f,_0x5c505b){_0x31881f=_0x31881f-0x0;var _0x52c79a=_0xad31[_0x31881f];return _0x52c79a;};'use strict';var _=require(_0x1ad3('0x0'));var util=require(_0x1ad3('0x1'));var moment=require(_0x1ad3('0x2'));var BPromise=require(_0x1ad3('0x3'));var rs=require(_0x1ad3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ad3('0x5'))['db'];var utils=require(_0x1ad3('0x6'));var logger=require(_0x1ad3('0x7'))(_0x1ad3('0x8'));var config=require(_0x1ad3('0x9'));var jayson=require(_0x1ad3('0xa'));var client=jayson[_0x1ad3('0xb')][_0x1ad3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2079a4,_0x53ecde,_0x499cba){return new BPromise(function(_0x43cf92,_0x23c76a){return client[_0x1ad3('0xd')](_0x2079a4,_0x499cba)[_0x1ad3('0xe')](function(_0x420704){logger[_0x1ad3('0xf')](_0x1ad3('0x10'),_0x53ecde,_0x1ad3('0x11'));logger[_0x1ad3('0x12')](_0x1ad3('0x13'),_0x53ecde,_0x1ad3('0x11'),JSON['stringify'](_0x420704));if(_0x420704['error']){if(_0x420704['error'][_0x1ad3('0x14')]===0x1f4){logger[_0x1ad3('0x15')](_0x1ad3('0x10'),_0x53ecde,_0x420704[_0x1ad3('0x15')][_0x1ad3('0x16')]);return _0x23c76a(_0x420704[_0x1ad3('0x15')][_0x1ad3('0x16')]);}logger['error'](_0x1ad3('0x10'),_0x53ecde,_0x420704[_0x1ad3('0x15')]['message']);return _0x43cf92(_0x420704[_0x1ad3('0x15')][_0x1ad3('0x16')]);}else{logger[_0x1ad3('0xf')]('Cdr,\x20%s,\x20%s',_0x53ecde,'request\x20sent');_0x43cf92(_0x420704[_0x1ad3('0x17')][_0x1ad3('0x16')]);}})[_0x1ad3('0x18')](function(_0x2f99f5){logger['error'](_0x1ad3('0x10'),_0x53ecde,_0x2f99f5);_0x23c76a(_0x2f99f5);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 5396aea..62c374a 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(_0x20a63e,_0xcb0bea){var _0x56fe3d=function(_0x2d4208){while(--_0x2d4208){_0x20a63e['push'](_0x20a63e['shift']());}};_0x56fe3d(++_0xcb0bea);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./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 _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(_0x2c3a88,_0x48637e){var _0x4a7925=function(_0x15780f){while(--_0x15780f){_0x2c3a88['push'](_0x2c3a88['shift']());}};_0x4a7925(++_0x48637e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index b12526c..ec854f1 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 _0xc57d=['STRING','sequelize','exports','TEXT'];(function(_0x29c2c8,_0x3f77fe){var _0x15ec2d=function(_0x8a6c8d){while(--_0x8a6c8d){_0x29c2c8['push'](_0x29c2c8['shift']());}};_0x15ec2d(++_0x3f77fe);}(_0xc57d,0x111));var _0xdc57=function(_0x45dbff,_0x13a782){_0x45dbff=_0x45dbff-0x0;var _0x25e2f0=_0xc57d[_0x45dbff];return _0x25e2f0;};'use strict';var Sequelize=require(_0xdc57('0x0'));module[_0xdc57('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xdc57('0x2')]()},'description':{'type':Sequelize[_0xdc57('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x4c6b=['exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x33a694,_0x9b6640){var _0x41ff01=function(_0x4c38b7){while(--_0x4c38b7){_0x33a694['push'](_0x33a694['shift']());}};_0x41ff01(++_0x9b6640);}(_0x4c6b,0xf0));var _0xb4c6=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x4c6b[_0x565ed7];return _0x183ad7;};'use strict';var Sequelize=require('sequelize');module[_0xb4c6('0x0')]={'priority':{'type':Sequelize[_0xb4c6('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb4c6('0x2')],'allowNull':![],'defaultValue':_0xb4c6('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xb4c6('0x2')]},'interval':{'type':Sequelize[_0xb4c6('0x2')],'defaultValue':_0xb4c6('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 83d7c31..17a6a36 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 _0x95af=['merge','options','find','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','intersection','attributes','fields','length','includeAll','include'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x95af,0x173));var _0xf95a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x95af[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xf95a('0x0'));var rimraf=require(_0xf95a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf95a('0x2'));var rp=require(_0xf95a('0x3'));var moment=require(_0xf95a('0x4'));var BPromise=require(_0xf95a('0x5'));var Mustache=require(_0xf95a('0x6'));var util=require(_0xf95a('0x7'));var path=require(_0xf95a('0x8'));var sox=require('sox');var csv=require(_0xf95a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf95a('0xa'));var _=require('lodash');var squel=require(_0xf95a('0xb'));var crypto=require(_0xf95a('0xc'));var jsforce=require(_0xf95a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf95a('0x9'));var querystring=require(_0xf95a('0xe'));var Papa=require('papaparse');var Redis=require(_0xf95a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf95a('0x10'));var as=require(_0xf95a('0x11'));var hardwareService=require(_0xf95a('0x12'));var logger=require(_0xf95a('0x13'))(_0xf95a('0x14'));var utils=require(_0xf95a('0x15'));var config=require(_0xf95a('0x16'));var licenseUtil=require(_0xf95a('0x17'));var db=require(_0xf95a('0x18'))['db'];function respondWithStatusCode(_0xc428f7,_0x2d9d0a){_0x2d9d0a=_0x2d9d0a||0xcc;return function(_0x22e042){if(_0x22e042){return _0xc428f7['sendStatus'](_0x2d9d0a);}return _0xc428f7[_0xf95a('0x19')](_0x2d9d0a)[_0xf95a('0x1a')]();};}function respondWithResult(_0x3b43d1,_0x570be5){_0x570be5=_0x570be5||0xc8;return function(_0x5449a0){if(_0x5449a0){return _0x3b43d1['status'](_0x570be5)[_0xf95a('0x1b')](_0x5449a0);}};}function respondWithFilteredResult(_0x54b9bc,_0x210561){return function(_0x2848b6){if(_0x2848b6){var _0x30fb30=typeof _0x210561['offset']===_0xf95a('0x1c')&&typeof _0x210561[_0xf95a('0x1d')]===_0xf95a('0x1c');var _0x3b47dc=_0x2848b6[_0xf95a('0x1e')];var _0x2991d1=_0x30fb30?0x0:_0x210561[_0xf95a('0x1f')];var _0x2144e4=_0x30fb30?_0x2848b6['count']:_0x210561[_0xf95a('0x1f')]+_0x210561[_0xf95a('0x1d')];var _0x2aefd7;if(_0x2144e4>=_0x3b47dc){_0x2144e4=_0x3b47dc;_0x2aefd7=0xc8;}else{_0x2aefd7=0xce;}_0x54b9bc[_0xf95a('0x19')](_0x2aefd7);return _0x54b9bc[_0xf95a('0x20')](_0xf95a('0x21'),_0x2991d1+'-'+_0x2144e4+'/'+_0x3b47dc)[_0xf95a('0x1b')](_0x2848b6);}return null;};}function patchUpdates(_0x53ffb1){return function(_0x57f0dd){try{jsonpatch[_0xf95a('0x22')](_0x57f0dd,_0x53ffb1,!![]);}catch(_0x3fea2f){return BPromise[_0xf95a('0x23')](_0x3fea2f);}return _0x57f0dd[_0xf95a('0x24')]();};}function saveUpdates(_0xdf912c,_0x3f3e07){return function(_0xc8cf5b){if(_0xc8cf5b){return _0xc8cf5b['update'](_0xdf912c)[_0xf95a('0x25')](function(_0x1c9a37){return _0x1c9a37;});}return null;};}function removeEntity(_0xaa985e,_0x4bbcca){return function(_0x3822f4){if(_0x3822f4){return _0x3822f4[_0xf95a('0x26')]()[_0xf95a('0x25')](function(){_0xaa985e[_0xf95a('0x19')](0xcc)[_0xf95a('0x1a')]();});}};}function handleEntityNotFound(_0x43d3c3,_0xa9ab6d){return function(_0x3f25a2){if(!_0x3f25a2){_0x43d3c3[_0xf95a('0x27')](0x194);}return _0x3f25a2;};}function handleError(_0x411812,_0x3a3761){_0x3a3761=_0x3a3761||0x1f4;return function(_0x4f82b4){logger[_0xf95a('0x28')](_0x4f82b4['stack']);if(_0x4f82b4[_0xf95a('0x29')]){delete _0x4f82b4['name'];}_0x411812[_0xf95a('0x19')](_0x3a3761)[_0xf95a('0x2a')](_0x4f82b4);};}exports[_0xf95a('0x2b')]=function(_0x495f46,_0x42a5b4){var _0x538168={'raw':!![],'where':{'id':_0x495f46[_0xf95a('0x2c')]['id']}},_0x2fd126={};_0x2fd126[_0xf95a('0x2d')]=_[_0xf95a('0x2e')](db[_0xf95a('0x2f')][_0xf95a('0x30')]);_0x2fd126[_0xf95a('0x31')]=_[_0xf95a('0x2e')](_0x495f46[_0xf95a('0x31')]);_0x2fd126['filters']=_[_0xf95a('0x32')](_0x2fd126[_0xf95a('0x2d')],_0x2fd126[_0xf95a('0x31')]);_0x538168[_0xf95a('0x33')]=_[_0xf95a('0x32')](_0x2fd126['model'],qs[_0xf95a('0x34')](_0x495f46[_0xf95a('0x31')][_0xf95a('0x34')]));_0x538168[_0xf95a('0x33')]=_0x538168['attributes'][_0xf95a('0x35')]?_0x538168[_0xf95a('0x33')]:_0x2fd126[_0xf95a('0x2d')];if(_0x495f46[_0xf95a('0x31')][_0xf95a('0x36')]){_0x538168[_0xf95a('0x37')]=[{'all':!![]}];}_0x538168=_[_0xf95a('0x38')]({},_0x538168,_0x495f46[_0xf95a('0x39')]);return db['ChatApplication'][_0xf95a('0x3a')](_0x538168)[_0xf95a('0x25')](handleEntityNotFound(_0x42a5b4,null))[_0xf95a('0x25')](respondWithResult(_0x42a5b4,null))[_0xf95a('0x3b')](handleError(_0x42a5b4,null));};exports['update']=function(_0x3e0749,_0x545b9f){if(_0x3e0749[_0xf95a('0x3c')]['id']){delete _0x3e0749['body']['id'];}return db[_0xf95a('0x2f')]['find']({'where':{'id':_0x3e0749[_0xf95a('0x2c')]['id']}})['then'](handleEntityNotFound(_0x545b9f,null))[_0xf95a('0x25')](saveUpdates(_0x3e0749[_0xf95a('0x3c')],null))[_0xf95a('0x25')](respondWithResult(_0x545b9f,null))[_0xf95a('0x3b')](handleError(_0x545b9f,null));};exports[_0xf95a('0x26')]=function(_0x1d55c7,_0x37b78c){return db[_0xf95a('0x2f')][_0xf95a('0x3a')]({'where':{'id':_0x1d55c7[_0xf95a('0x2c')]['id']}})['then'](handleEntityNotFound(_0x37b78c,null))['then'](removeEntity(_0x37b78c,null))['catch'](handleError(_0x37b78c,null));}; \ No newline at end of file +var _0x97c1=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','name','send','show','rawAttributes','keys','query','intersection','attributes','model','fields','includeAll','include','merge','options','ChatApplication','catch','body','find','params','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','to-csv'];(function(_0x582c18,_0x19969a){var _0x485f24=function(_0xdfad1d){while(--_0xdfad1d){_0x582c18['push'](_0x582c18['shift']());}};_0x485f24(++_0x19969a);}(_0x97c1,0xdf));var _0x197c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x97c1[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x197c('0x0'));var rimraf=require(_0x197c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x197c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x197c('0x3'));var Mustache=require(_0x197c('0x4'));var util=require(_0x197c('0x5'));var path=require(_0x197c('0x6'));var sox=require(_0x197c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x197c('0x8'));var _=require(_0x197c('0x9'));var squel=require(_0x197c('0xa'));var crypto=require(_0x197c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x197c('0xc'));var querystring=require('querystring');var Papa=require(_0x197c('0xd'));var Redis=require(_0x197c('0xe'));var authService=require(_0x197c('0xf'));var qs=require(_0x197c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x197c('0x11'));var logger=require(_0x197c('0x12'))(_0x197c('0x13'));var utils=require(_0x197c('0x14'));var config=require(_0x197c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x197c('0x16'))['db'];function respondWithStatusCode(_0x668f8,_0x27e46f){_0x27e46f=_0x27e46f||0xcc;return function(_0x1adcfa){if(_0x1adcfa){return _0x668f8['sendStatus'](_0x27e46f);}return _0x668f8[_0x197c('0x17')](_0x27e46f)[_0x197c('0x18')]();};}function respondWithResult(_0x5a7e1c,_0xf735ce){_0xf735ce=_0xf735ce||0xc8;return function(_0x188ff2){if(_0x188ff2){return _0x5a7e1c[_0x197c('0x17')](_0xf735ce)['json'](_0x188ff2);}};}function respondWithFilteredResult(_0x5194c3,_0x422dfa){return function(_0x2bc612){if(_0x2bc612){var _0x2083d4=typeof _0x422dfa[_0x197c('0x19')]===_0x197c('0x1a')&&typeof _0x422dfa[_0x197c('0x1b')]===_0x197c('0x1a');var _0x75beba=_0x2bc612['count'];var _0x372311=_0x2083d4?0x0:_0x422dfa['offset'];var _0x50ac52=_0x2083d4?_0x2bc612[_0x197c('0x1c')]:_0x422dfa[_0x197c('0x19')]+_0x422dfa[_0x197c('0x1b')];var _0x2ce10d;if(_0x50ac52>=_0x75beba){_0x50ac52=_0x75beba;_0x2ce10d=0xc8;}else{_0x2ce10d=0xce;}_0x5194c3['status'](_0x2ce10d);return _0x5194c3[_0x197c('0x1d')](_0x197c('0x1e'),_0x372311+'-'+_0x50ac52+'/'+_0x75beba)[_0x197c('0x1f')](_0x2bc612);}return null;};}function patchUpdates(_0x5c278a){return function(_0x1adb43){try{jsonpatch[_0x197c('0x20')](_0x1adb43,_0x5c278a,!![]);}catch(_0x3b5c4c){return BPromise[_0x197c('0x21')](_0x3b5c4c);}return _0x1adb43[_0x197c('0x22')]();};}function saveUpdates(_0x3c2151,_0x362bbf){return function(_0x2092a0){if(_0x2092a0){return _0x2092a0[_0x197c('0x23')](_0x3c2151)[_0x197c('0x24')](function(_0x29b266){return _0x29b266;});}return null;};}function removeEntity(_0x177bc9,_0x174942){return function(_0x2a1310){if(_0x2a1310){return _0x2a1310[_0x197c('0x25')]()[_0x197c('0x24')](function(){_0x177bc9['status'](0xcc)[_0x197c('0x18')]();});}};}function handleEntityNotFound(_0x2911dd,_0x2b6319){return function(_0x499051){if(!_0x499051){_0x2911dd[_0x197c('0x26')](0x194);}return _0x499051;};}function handleError(_0x3331ac,_0x4c3337){_0x4c3337=_0x4c3337||0x1f4;return function(_0x5e7bc9){logger[_0x197c('0x27')](_0x5e7bc9['stack']);if(_0x5e7bc9[_0x197c('0x28')]){delete _0x5e7bc9[_0x197c('0x28')];}_0x3331ac[_0x197c('0x17')](_0x4c3337)[_0x197c('0x29')](_0x5e7bc9);};}exports[_0x197c('0x2a')]=function(_0x3cdcd8,_0x2b6154){var _0x215df1={'raw':!![],'where':{'id':_0x3cdcd8['params']['id']}},_0x4422d1={};_0x4422d1['model']=_['keys'](db['ChatApplication'][_0x197c('0x2b')]);_0x4422d1['query']=_[_0x197c('0x2c')](_0x3cdcd8[_0x197c('0x2d')]);_0x4422d1['filters']=_[_0x197c('0x2e')](_0x4422d1['model'],_0x4422d1[_0x197c('0x2d')]);_0x215df1[_0x197c('0x2f')]=_[_0x197c('0x2e')](_0x4422d1[_0x197c('0x30')],qs[_0x197c('0x31')](_0x3cdcd8[_0x197c('0x2d')][_0x197c('0x31')]));_0x215df1[_0x197c('0x2f')]=_0x215df1[_0x197c('0x2f')]['length']?_0x215df1['attributes']:_0x4422d1[_0x197c('0x30')];if(_0x3cdcd8[_0x197c('0x2d')][_0x197c('0x32')]){_0x215df1[_0x197c('0x33')]=[{'all':!![]}];}_0x215df1=_[_0x197c('0x34')]({},_0x215df1,_0x3cdcd8[_0x197c('0x35')]);return db[_0x197c('0x36')]['find'](_0x215df1)['then'](handleEntityNotFound(_0x2b6154,null))[_0x197c('0x24')](respondWithResult(_0x2b6154,null))[_0x197c('0x37')](handleError(_0x2b6154,null));};exports['update']=function(_0x5bebe7,_0x3cdaa1){if(_0x5bebe7[_0x197c('0x38')]['id']){delete _0x5bebe7[_0x197c('0x38')]['id'];}return db[_0x197c('0x36')][_0x197c('0x39')]({'where':{'id':_0x5bebe7[_0x197c('0x3a')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x3cdaa1,null))[_0x197c('0x24')](saveUpdates(_0x5bebe7[_0x197c('0x38')],null))['then'](respondWithResult(_0x3cdaa1,null))[_0x197c('0x37')](handleError(_0x3cdaa1,null));};exports[_0x197c('0x25')]=function(_0x358900,_0x41269e){return db[_0x197c('0x36')][_0x197c('0x39')]({'where':{'id':_0x358900['params']['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x41269e,null))[_0x197c('0x24')](removeEntity(_0x41269e,null))[_0x197c('0x37')](handleError(_0x41269e,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index ce5a70d..d6346c0 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 _0x3b8e=['request-promise','../../config/environment','exports','chat_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird'];(function(_0x210343,_0x3f65ae){var _0x6f1f7=function(_0x15e243){while(--_0x15e243){_0x210343['push'](_0x210343['shift']());}};_0x6f1f7(++_0x3f65ae);}(_0x3b8e,0x10b));var _0xe3b8=function(_0x222e2d,_0x4cff0c){_0x222e2d=_0x222e2d-0x0;var _0x3dbbac=_0x3b8e[_0x222e2d];return _0x3dbbac;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe3b8('0x0'))('api');var moment=require(_0xe3b8('0x1'));var BPromise=require(_0xe3b8('0x2'));var rp=require(_0xe3b8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe3b8('0x4'));var attributes=require('./chatApplication.attributes');module[_0xe3b8('0x5')]=function(_0x4b0bf0,_0x540432){return _0x4b0bf0['define']('ChatApplication',attributes,{'tableName':_0xe3b8('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe3b8('0x7'),'collate':_0xe3b8('0x8')});}; \ No newline at end of file +var _0xeb0d=['../../config/environment','./chatApplication.attributes','exports','define','chat_applications','utf8mb4','lodash','moment','bluebird','path','rimraf'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0xeb0d,0xe2));var _0xdeb0=function(_0x50d7c7,_0x3cef1d){_0x50d7c7=_0x50d7c7-0x0;var _0x5cb0f5=_0xeb0d[_0x50d7c7];return _0x5cb0f5;};'use strict';var _=require(_0xdeb0('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xdeb0('0x1'));var BPromise=require(_0xdeb0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdeb0('0x3'));var rimraf=require(_0xdeb0('0x4'));var config=require(_0xdeb0('0x5'));var attributes=require(_0xdeb0('0x6'));module[_0xdeb0('0x7')]=function(_0x13d486,_0xc48108){return _0x13d486[_0xdeb0('0x8')]('ChatApplication',attributes,{'tableName':_0xdeb0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdeb0('0xa'),'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 a1107ec..8283254 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 _0x9986=['../../config/environment','jayson/promise','client','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','../../config/logger'];(function(_0x25f341,_0x2847ab){var _0x219b50=function(_0x1f2ae8){while(--_0x1f2ae8){_0x25f341['push'](_0x25f341['shift']());}};_0x219b50(++_0x2847ab);}(_0x9986,0x12c));var _0x6998=function(_0x1f7af5,_0x5902ba){_0x1f7af5=_0x1f7af5-0x0;var _0x576a87=_0x9986[_0x1f7af5];return _0x576a87;};'use strict';var _=require(_0x6998('0x0'));var util=require('util');var moment=require(_0x6998('0x1'));var BPromise=require(_0x6998('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(_0x6998('0x3'))('rpc');var config=require(_0x6998('0x4'));var jayson=require(_0x6998('0x5'));var client=jayson[_0x6998('0x6')][_0x6998('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x7d9df4,_0x54e75c,_0x46efae){return new BPromise(function(_0x478b88,_0x3769a5){return client[_0x6998('0x8')](_0x7d9df4,_0x46efae)['then'](function(_0x17b363){logger[_0x6998('0x9')](_0x6998('0xa'),_0x54e75c,_0x6998('0xb'));logger[_0x6998('0xc')](_0x6998('0xd'),_0x54e75c,_0x6998('0xb'),JSON[_0x6998('0xe')](_0x17b363));if(_0x17b363['error']){if(_0x17b363[_0x6998('0xf')]['code']===0x1f4){logger[_0x6998('0xf')]('ChatApplication,\x20%s,\x20%s',_0x54e75c,_0x17b363[_0x6998('0xf')][_0x6998('0x10')]);return _0x3769a5(_0x17b363['error'][_0x6998('0x10')]);}logger[_0x6998('0xf')]('ChatApplication,\x20%s,\x20%s',_0x54e75c,_0x17b363[_0x6998('0xf')][_0x6998('0x10')]);return _0x478b88(_0x17b363[_0x6998('0xf')]['message']);}else{logger[_0x6998('0x9')](_0x6998('0xa'),_0x54e75c,_0x6998('0xb'));_0x478b88(_0x17b363[_0x6998('0x11')][_0x6998('0x10')]);}})[_0x6998('0x12')](function(_0x10e9ea){logger[_0x6998('0xf')](_0x6998('0xa'),_0x54e75c,_0x10e9ea);_0x3769a5(_0x10e9ea);});});} \ No newline at end of file +var _0xea9b=['../../config/environment','jayson/promise','client','request','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3452d1,_0x2be075){var _0x4a6a2c=function(_0x20620a){while(--_0x20620a){_0x3452d1['push'](_0x3452d1['shift']());}};_0x4a6a2c(++_0x2be075);}(_0xea9b,0xdf));var _0xbea9=function(_0x162780,_0x47f2e2){_0x162780=_0x162780-0x0;var _0x1ea2dc=_0xea9b[_0x162780];return _0x1ea2dc;};'use strict';var _=require('lodash');var util=require(_0xbea9('0x0'));var moment=require('moment');var BPromise=require(_0xbea9('0x1'));var rs=require(_0xbea9('0x2'));var fs=require('fs');var Redis=require(_0xbea9('0x3'));var db=require(_0xbea9('0x4'))['db'];var utils=require(_0xbea9('0x5'));var logger=require(_0xbea9('0x6'))(_0xbea9('0x7'));var config=require(_0xbea9('0x8'));var jayson=require(_0xbea9('0x9'));var client=jayson[_0xbea9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf563e5,_0x5d47c6,_0x101e5b){return new BPromise(function(_0x403fe5,_0x3a1f7a){return client[_0xbea9('0xb')](_0xf563e5,_0x101e5b)['then'](function(_0x2b2818){logger[_0xbea9('0xc')](_0xbea9('0xd'),_0x5d47c6,'request\x20sent');logger[_0xbea9('0xe')](_0xbea9('0xf'),_0x5d47c6,_0xbea9('0x10'),JSON[_0xbea9('0x11')](_0x2b2818));if(_0x2b2818[_0xbea9('0x12')]){if(_0x2b2818[_0xbea9('0x12')]['code']===0x1f4){logger['error'](_0xbea9('0xd'),_0x5d47c6,_0x2b2818[_0xbea9('0x12')]['message']);return _0x3a1f7a(_0x2b2818['error'][_0xbea9('0x13')]);}logger[_0xbea9('0x12')](_0xbea9('0xd'),_0x5d47c6,_0x2b2818[_0xbea9('0x12')]['message']);return _0x403fe5(_0x2b2818[_0xbea9('0x12')][_0xbea9('0x13')]);}else{logger['info'](_0xbea9('0xd'),_0x5d47c6,_0xbea9('0x10'));_0x403fe5(_0x2b2818['result'][_0xbea9('0x13')]);}})[_0xbea9('0x14')](function(_0xa72f3c){logger[_0xbea9('0x12')]('ChatApplication,\x20%s,\x20%s',_0x5d47c6,_0xa72f3c);_0x3a1f7a(_0xa72f3c);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index a18d5d0..a48ddd7 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 _0x6d92=['get','isAuthenticated','show','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0x27e5f2,_0x4e5d65){var _0x543d96=function(_0x38732c){while(--_0x38732c){_0x27e5f2['push'](_0x27e5f2['shift']());}};_0x543d96(++_0x4e5d65);}(_0x6d92,0x8e));var _0x26d9=function(_0x3160b1,_0x1af397){_0x3160b1=_0x3160b1-0x0;var _0x5242c9=_0x6d92[_0x3160b1];return _0x5242c9;};'use strict';var multer=require(_0x26d9('0x0'));var util=require(_0x26d9('0x1'));var path=require(_0x26d9('0x2'));var timeout=require(_0x26d9('0x3'));var express=require(_0x26d9('0x4'));var router=express[_0x26d9('0x5')]();var fs_extra=require(_0x26d9('0x6'));var auth=require(_0x26d9('0x7'));var interaction=require(_0x26d9('0x8'));var config=require(_0x26d9('0x9'));var controller=require(_0x26d9('0xa'));router[_0x26d9('0xb')]('/:id',auth[_0x26d9('0xc')](),controller[_0x26d9('0xd')]);router['put'](_0x26d9('0xe'),auth[_0x26d9('0xc')](),controller['update']);router[_0x26d9('0xf')](_0x26d9('0xe'),auth[_0x26d9('0xc')](),controller['destroy']);module[_0x26d9('0x10')]=router; \ No newline at end of file +var _0xd0d4=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','put','/:id','update','destroy'];(function(_0x14f53b,_0x3fea28){var _0x10b218=function(_0x3813e6){while(--_0x3813e6){_0x14f53b['push'](_0x14f53b['shift']());}};_0x10b218(++_0x3fea28);}(_0xd0d4,0x18d));var _0x4d0d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd0d4[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x4d0d('0x0'));var util=require(_0x4d0d('0x1'));var path=require('path');var timeout=require(_0x4d0d('0x2'));var express=require(_0x4d0d('0x3'));var router=express[_0x4d0d('0x4')]();var fs_extra=require(_0x4d0d('0x5'));var auth=require(_0x4d0d('0x6'));var interaction=require(_0x4d0d('0x7'));var config=require(_0x4d0d('0x8'));var controller=require(_0x4d0d('0x9'));router[_0x4d0d('0xa')]('/:id',auth[_0x4d0d('0xb')](),controller[_0x4d0d('0xc')]);router[_0x4d0d('0xd')](_0x4d0d('0xe'),auth[_0x4d0d('0xb')](),controller[_0x4d0d('0xf')]);router['delete'](_0x4d0d('0xe'),auth[_0x4d0d('0xb')](),controller[_0x4d0d('0x10')]);module[_0x4d0d('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 00779cb..2f80b4d 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 _0xc08a=['exports','STRING','BOOLEAN','sequelize'];(function(_0x2c87f6,_0x525c2a){var _0x431a13=function(_0x50bb5a){while(--_0x50bb5a){_0x2c87f6['push'](_0x2c87f6['shift']());}};_0x431a13(++_0x525c2a);}(_0xc08a,0x167));var _0xac08=function(_0x253c5d,_0x3928ae){_0x253c5d=_0x253c5d-0x0;var _0x1b984c=_0xc08a[_0x253c5d];return _0x1b984c;};'use strict';var Sequelize=require(_0xac08('0x0'));module[_0xac08('0x1')]={'name':{'type':Sequelize[_0xac08('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xac08('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x87b4=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x87b4,0xaa));var _0x487b=function(_0x4d4a09,_0x2ce4b3){_0x4d4a09=_0x4d4a09-0x0;var _0xc3ab96=_0x87b4[_0x4d4a09];return _0xc3ab96;};'use strict';var Sequelize=require(_0x487b('0x0'));module[_0x487b('0x1')]={'name':{'type':Sequelize[_0x487b('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x487b('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index eafc752..0050927 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 _0xcea1=['jsforce','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','destroy','then','sendStatus','error','stack','name','index','map','ChatGroup','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','getUnread','toInteger','addMembers','ids','getMembers','findOne','User','order','hasOwnProperty','removeMembers','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','lodash','crypto'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xcea1,0xb2));var _0x1cea=function(_0x58f555,_0x552ef2){_0x58f555=_0x58f555-0x0;var _0x4eb99b=_0xcea1[_0x58f555];return _0x4eb99b;};'use strict';var emlformat=require(_0x1cea('0x0'));var rimraf=require(_0x1cea('0x1'));var zipdir=require(_0x1cea('0x2'));var jsonpatch=require(_0x1cea('0x3'));var rp=require(_0x1cea('0x4'));var moment=require('moment');var BPromise=require(_0x1cea('0x5'));var Mustache=require(_0x1cea('0x6'));var util=require(_0x1cea('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1cea('0x8'));var squel=require('squel');var crypto=require(_0x1cea('0x9'));var jsforce=require(_0x1cea('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x1cea('0xb'));var querystring=require(_0x1cea('0xc'));var Papa=require(_0x1cea('0xd'));var Redis=require(_0x1cea('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1cea('0xf'));var logger=require(_0x1cea('0x10'))(_0x1cea('0x11'));var utils=require(_0x1cea('0x12'));var config=require(_0x1cea('0x13'));var licenseUtil=require(_0x1cea('0x14'));var db=require(_0x1cea('0x15'))['db'];config[_0x1cea('0x16')]=_[_0x1cea('0x17')](config[_0x1cea('0x16')],{'host':_0x1cea('0x18'),'port':0x18eb});var socket=require(_0x1cea('0x19'))(new Redis(config[_0x1cea('0x16')]));require('./chatGroup.socket')[_0x1cea('0x1a')](socket);function respondWithStatusCode(_0x4a7c6c,_0x28d188){_0x28d188=_0x28d188||0xcc;return function(_0x33decc){if(_0x33decc){return _0x4a7c6c['sendStatus'](_0x28d188);}return _0x4a7c6c[_0x1cea('0x1b')](_0x28d188)[_0x1cea('0x1c')]();};}function respondWithResult(_0x481005,_0x4f5558){_0x4f5558=_0x4f5558||0xc8;return function(_0x6017a0){if(_0x6017a0){return _0x481005['status'](_0x4f5558)[_0x1cea('0x1d')](_0x6017a0);}};}function respondWithFilteredResult(_0x441e72,_0x251cb9){return function(_0x1c2771){if(_0x1c2771){var _0x776718=typeof _0x251cb9[_0x1cea('0x1e')]==='undefined'&&typeof _0x251cb9[_0x1cea('0x1f')]===_0x1cea('0x20');var _0x3fef0e=_0x1c2771['count'];var _0x100b88=_0x776718?0x0:_0x251cb9[_0x1cea('0x1e')];var _0x28a513=_0x776718?_0x1c2771[_0x1cea('0x21')]:_0x251cb9[_0x1cea('0x1e')]+_0x251cb9['limit'];var _0x87853e;if(_0x28a513>=_0x3fef0e){_0x28a513=_0x3fef0e;_0x87853e=0xc8;}else{_0x87853e=0xce;}_0x441e72[_0x1cea('0x1b')](_0x87853e);return _0x441e72[_0x1cea('0x22')](_0x1cea('0x23'),_0x100b88+'-'+_0x28a513+'/'+_0x3fef0e)[_0x1cea('0x1d')](_0x1c2771);}return null;};}function patchUpdates(_0x5d6f69){return function(_0x440b67){try{jsonpatch[_0x1cea('0x24')](_0x440b67,_0x5d6f69,!![]);}catch(_0x46224d){return BPromise['reject'](_0x46224d);}return _0x440b67[_0x1cea('0x25')]();};}function saveUpdates(_0x17d0c0,_0x2e7a3d){return function(_0x194822){if(_0x194822){return _0x194822['update'](_0x17d0c0)['then'](function(_0x216815){return _0x216815;});}return null;};}function removeEntity(_0x3e8f35,_0x4f7ac0){return function(_0x283cae){if(_0x283cae){return _0x283cae[_0x1cea('0x26')]()[_0x1cea('0x27')](function(){_0x3e8f35[_0x1cea('0x1b')](0xcc)[_0x1cea('0x1c')]();});}};}function handleEntityNotFound(_0x6bf211,_0x4f7fe9){return function(_0x11eff6){if(!_0x11eff6){_0x6bf211[_0x1cea('0x28')](0x194);}return _0x11eff6;};}function handleError(_0x6d9a5,_0x3ee099){_0x3ee099=_0x3ee099||0x1f4;return function(_0x3e6cc8){logger[_0x1cea('0x29')](_0x3e6cc8[_0x1cea('0x2a')]);if(_0x3e6cc8['name']){delete _0x3e6cc8[_0x1cea('0x2b')];}_0x6d9a5['status'](_0x3ee099)['send'](_0x3e6cc8);};}exports[_0x1cea('0x2c')]=function(_0x446508,_0xc8e1df){var _0xb0b538={},_0x2150a2={},_0x3f7324={'count':0x0,'rows':[]};var _0x41826c=_[_0x1cea('0x2d')](db[_0x1cea('0x2e')][_0x1cea('0x2f')],function(_0x3fc89d){return{'name':_0x3fc89d[_0x1cea('0x30')],'type':_0x3fc89d[_0x1cea('0x31')]['key']};});_0x2150a2[_0x1cea('0x32')]=_[_0x1cea('0x2d')](_0x41826c,_0x1cea('0x2b'));_0x2150a2['query']=_[_0x1cea('0x33')](_0x446508[_0x1cea('0x34')]);_0x2150a2['filters']=_['intersection'](_0x2150a2[_0x1cea('0x32')],_0x2150a2[_0x1cea('0x34')]);_0xb0b538['attributes']=_[_0x1cea('0x35')](_0x2150a2[_0x1cea('0x32')],qs[_0x1cea('0x36')](_0x446508[_0x1cea('0x34')]['fields']));_0xb0b538[_0x1cea('0x37')]=_0xb0b538[_0x1cea('0x37')][_0x1cea('0x38')]?_0xb0b538['attributes']:_0x2150a2[_0x1cea('0x32')];if(!_0x446508[_0x1cea('0x34')]['hasOwnProperty'](_0x1cea('0x39'))){_0xb0b538[_0x1cea('0x1f')]=qs[_0x1cea('0x1f')](_0x446508[_0x1cea('0x34')][_0x1cea('0x1f')]);_0xb0b538[_0x1cea('0x1e')]=qs[_0x1cea('0x1e')](_0x446508['query'][_0x1cea('0x1e')]);}_0xb0b538['order']=qs[_0x1cea('0x3a')](_0x446508[_0x1cea('0x34')][_0x1cea('0x3a')]);_0xb0b538[_0x1cea('0x3b')]=qs[_0x1cea('0x3c')](_[_0x1cea('0x3d')](_0x446508[_0x1cea('0x34')],_0x2150a2['filters']),_0x41826c);if(_0x446508[_0x1cea('0x34')][_0x1cea('0x3e')]){_0xb0b538[_0x1cea('0x3b')]=_[_0x1cea('0x3f')](_0xb0b538[_0x1cea('0x3b')],{'$or':_[_0x1cea('0x2d')](_0x41826c,function(_0x115c2a){if(_0x115c2a[_0x1cea('0x31')]!==_0x1cea('0x40')){var _0x9fcd93={};_0x9fcd93[_0x115c2a['name']]={'$like':'%'+_0x446508[_0x1cea('0x34')][_0x1cea('0x3e')]+'%'};return _0x9fcd93;}})});}_0xb0b538=_['merge']({},_0xb0b538,_0x446508[_0x1cea('0x41')]);var _0x19cd24={'where':_0xb0b538[_0x1cea('0x3b')]};return db[_0x1cea('0x2e')][_0x1cea('0x21')](_0x19cd24)[_0x1cea('0x27')](function(_0x12a51b){_0x3f7324['count']=_0x12a51b;if(_0x446508[_0x1cea('0x34')][_0x1cea('0x42')]){_0xb0b538[_0x1cea('0x43')]=[{'all':!![]}];}return db[_0x1cea('0x2e')][_0x1cea('0x44')](_0xb0b538);})['then'](function(_0x1b3b29){_0x3f7324[_0x1cea('0x45')]=_0x1b3b29;return _0x3f7324;})['then'](respondWithFilteredResult(_0xc8e1df,_0xb0b538))[_0x1cea('0x46')](handleError(_0xc8e1df,null));};exports[_0x1cea('0x47')]=function(_0x1699a0,_0x6411f2){var _0xb91035={'raw':!![],'where':{'id':_0x1699a0[_0x1cea('0x48')]['id']}},_0x3e0b92={};_0x3e0b92[_0x1cea('0x32')]=_[_0x1cea('0x33')](db[_0x1cea('0x2e')]['rawAttributes']);_0x3e0b92['query']=_[_0x1cea('0x33')](_0x1699a0[_0x1cea('0x34')]);_0x3e0b92[_0x1cea('0x3c')]=_[_0x1cea('0x35')](_0x3e0b92['model'],_0x3e0b92[_0x1cea('0x34')]);_0xb91035['attributes']=_[_0x1cea('0x35')](_0x3e0b92[_0x1cea('0x32')],qs[_0x1cea('0x36')](_0x1699a0[_0x1cea('0x34')][_0x1cea('0x36')]));_0xb91035[_0x1cea('0x37')]=_0xb91035[_0x1cea('0x37')][_0x1cea('0x38')]?_0xb91035[_0x1cea('0x37')]:_0x3e0b92[_0x1cea('0x32')];if(_0x1699a0[_0x1cea('0x34')]['includeAll']){_0xb91035[_0x1cea('0x43')]=[{'all':!![]}];}_0xb91035=_[_0x1cea('0x3f')]({},_0xb91035,_0x1699a0['options']);return db[_0x1cea('0x2e')][_0x1cea('0x49')](_0xb91035)[_0x1cea('0x27')](handleEntityNotFound(_0x6411f2,null))[_0x1cea('0x27')](respondWithResult(_0x6411f2,null))[_0x1cea('0x46')](handleError(_0x6411f2,null));};exports[_0x1cea('0x4a')]=function(_0x42effa,_0x58b960){return db[_0x1cea('0x2e')]['create'](_0x42effa[_0x1cea('0x4b')],{})[_0x1cea('0x27')](respondWithResult(_0x58b960,0xc9))[_0x1cea('0x46')](handleError(_0x58b960,null));};exports['update']=function(_0x32f583,_0x217588){if(_0x32f583['body']['id']){delete _0x32f583[_0x1cea('0x4b')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x32f583['params']['id']}})['then'](handleEntityNotFound(_0x217588,null))[_0x1cea('0x27')](saveUpdates(_0x32f583[_0x1cea('0x4b')],null))[_0x1cea('0x27')](respondWithResult(_0x217588,null))[_0x1cea('0x46')](handleError(_0x217588,null));};exports[_0x1cea('0x26')]=function(_0x23a1e2,_0x5eda10){return db[_0x1cea('0x2e')][_0x1cea('0x49')]({'where':{'id':_0x23a1e2['params']['id']}})[_0x1cea('0x27')](handleEntityNotFound(_0x5eda10,null))[_0x1cea('0x27')](removeEntity(_0x5eda10,null))[_0x1cea('0x46')](handleError(_0x5eda10,null));};exports[_0x1cea('0x4c')]=function(_0x51ba61,_0x241496){return db['ChatGroup'][_0x1cea('0x4c')]()[_0x1cea('0x27')](respondWithResult(_0x241496,null))[_0x1cea('0x46')](handleError(_0x241496,null));};exports[_0x1cea('0x4d')]=function(_0x38a68d,_0x349b14,_0x1ecb24){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x38a68d['params']['id'],'ToId':_0x38a68d['user']['id'],'read':![]}})[_0x1cea('0x27')](function(_0x2c8b41){return{'id':_[_0x1cea('0x4e')](_0x38a68d['params']['id']),'count':_0x2c8b41};})['then'](respondWithResult(_0x349b14,null))[_0x1cea('0x46')](handleError(_0x349b14,null));};exports[_0x1cea('0x4f')]=function(_0x130bd8,_0x19a0a4,_0x45742){return db['ChatGroup']['find']({'where':{'id':_0x130bd8[_0x1cea('0x48')]['id']}})[_0x1cea('0x27')](handleEntityNotFound(_0x19a0a4,null))['then'](function(_0x96102f){if(_0x96102f){return _0x96102f['addMembers'](_0x130bd8[_0x1cea('0x4b')][_0x1cea('0x50')],_['omit'](_0x130bd8[_0x1cea('0x4b')],[_0x1cea('0x50'),'id'])||{});}})[_0x1cea('0x27')](respondWithResult(_0x19a0a4,null))[_0x1cea('0x46')](handleError(_0x19a0a4,null));};exports[_0x1cea('0x51')]=function(_0x8edf37,_0x5cd58b,_0x1340f3){var _0x1e82e3={};var _0x359bb9={};var _0x8d96ca;var _0xd81d1d;return db[_0x1cea('0x2e')][_0x1cea('0x52')]({'where':{'id':_0x8edf37[_0x1cea('0x48')]['id']}})['then'](handleEntityNotFound(_0x5cd58b,null))[_0x1cea('0x27')](function(_0x1d99c5){if(_0x1d99c5){_0x8d96ca=_0x1d99c5;_0x359bb9[_0x1cea('0x32')]=_[_0x1cea('0x33')](db[_0x1cea('0x53')][_0x1cea('0x2f')]);_0x359bb9[_0x1cea('0x34')]=_['keys'](_0x8edf37[_0x1cea('0x34')]);_0x359bb9[_0x1cea('0x3c')]=_['intersection'](_0x359bb9['model'],_0x359bb9[_0x1cea('0x34')]);_0x1e82e3['attributes']=_[_0x1cea('0x35')](_0x359bb9['model'],qs['fields'](_0x8edf37['query'][_0x1cea('0x36')]));_0x1e82e3['attributes']=_0x1e82e3['attributes']['length']?_0x1e82e3[_0x1cea('0x37')]:_0x359bb9[_0x1cea('0x32')];_0x1e82e3[_0x1cea('0x54')]=qs[_0x1cea('0x3a')](_0x8edf37[_0x1cea('0x34')][_0x1cea('0x3a')]);_0x1e82e3[_0x1cea('0x3b')]=qs[_0x1cea('0x3c')](_[_0x1cea('0x3d')](_0x8edf37[_0x1cea('0x34')],_0x359bb9[_0x1cea('0x3c')]));if(_0x8edf37['query'][_0x1cea('0x3e')]){_0x1e82e3[_0x1cea('0x3b')]=_[_0x1cea('0x3f')](_0x1e82e3[_0x1cea('0x3b')],{'$or':_['map'](_0x1e82e3[_0x1cea('0x37')],function(_0x11b2ba){var _0x34b677={};_0x34b677[_0x11b2ba]={'$like':'%'+_0x8edf37['query'][_0x1cea('0x3e')]+'%'};return _0x34b677;})});}_0x1e82e3=_['merge']({},_0x1e82e3,_0x8edf37[_0x1cea('0x41')]);return _0x8d96ca[_0x1cea('0x51')](_0x1e82e3);}})[_0x1cea('0x27')](function(_0x392ca9){if(_0x392ca9){_0xd81d1d=_0x392ca9[_0x1cea('0x38')];if(!_0x8edf37[_0x1cea('0x34')][_0x1cea('0x55')](_0x1cea('0x39'))){_0x1e82e3[_0x1cea('0x1f')]=qs[_0x1cea('0x1f')](_0x8edf37['query'][_0x1cea('0x1f')]);_0x1e82e3[_0x1cea('0x1e')]=qs[_0x1cea('0x1e')](_0x8edf37[_0x1cea('0x34')][_0x1cea('0x1e')]);}return _0x8d96ca[_0x1cea('0x51')](_0x1e82e3);}})['then'](function(_0x277c1e){if(_0x277c1e){return _0x277c1e?{'count':_0xd81d1d,'rows':_0x277c1e}:null;}})[_0x1cea('0x27')](respondWithResult(_0x5cd58b,null))['catch'](handleError(_0x5cd58b,null));};exports[_0x1cea('0x56')]=function(_0x370a23,_0x401d16,_0xa4c4ac){return db['ChatGroup'][_0x1cea('0x49')]({'where':{'id':_0x370a23['params']['id']}})[_0x1cea('0x27')](handleEntityNotFound(_0x401d16,null))[_0x1cea('0x27')](function(_0x13fa3d){if(_0x13fa3d){return _0x13fa3d[_0x1cea('0x56')](_0x370a23[_0x1cea('0x34')][_0x1cea('0x50')]);}})[_0x1cea('0x27')](respondWithStatusCode(_0x401d16,null))[_0x1cea('0x46')](handleError(_0x401d16,null));};exports[_0x1cea('0x57')]=function(_0x531c35,_0x5cdfd5,_0x2f4a49){if(_0x531c35[_0x1cea('0x4b')]['id']){delete _0x531c35[_0x1cea('0x4b')]['id'];}return db[_0x1cea('0x2e')][_0x1cea('0x49')]({'where':{'id':_0x531c35['params']['id']}})[_0x1cea('0x27')](handleEntityNotFound(_0x5cdfd5,null))[_0x1cea('0x27')](function(_0x2f5abf){if(_0x2f5abf){_0x531c35[_0x1cea('0x4b')][_0x1cea('0x58')]=_0x2f5abf['id'];return db['ChatInternalMessage'][_0x1cea('0x4a')](_0x531c35[_0x1cea('0x4b')]);}})[_0x1cea('0x27')](respondWithResult(_0x5cdfd5,null))[_0x1cea('0x46')](handleError(_0x5cdfd5,null));};exports['getMessages']=function(_0x3740a3,_0x3ec81a,_0x24afcd){var _0x249951={};var _0x2c467d={};var _0x1ba903;var _0x820dfa;return db[_0x1cea('0x2e')][_0x1cea('0x52')]({'where':{'id':_0x3740a3[_0x1cea('0x48')]['id']}})[_0x1cea('0x27')](handleEntityNotFound(_0x3ec81a,null))[_0x1cea('0x27')](function(_0x1c4d15){if(_0x1c4d15){_0x1ba903=_0x1c4d15;_0x2c467d[_0x1cea('0x32')]=_['keys'](db['ChatInternalMessage'][_0x1cea('0x2f')]);_0x2c467d['query']=_[_0x1cea('0x33')](_0x3740a3[_0x1cea('0x34')]);_0x2c467d[_0x1cea('0x3c')]=_['intersection'](_0x2c467d[_0x1cea('0x32')],_0x2c467d[_0x1cea('0x34')]);_0x249951[_0x1cea('0x37')]=_[_0x1cea('0x35')](_0x2c467d[_0x1cea('0x32')],qs['fields'](_0x3740a3['query'][_0x1cea('0x36')]));_0x249951[_0x1cea('0x37')]=_0x249951['attributes'][_0x1cea('0x38')]?_0x249951['attributes']:_0x2c467d[_0x1cea('0x32')];_0x249951['order']=qs['sort'](_0x3740a3[_0x1cea('0x34')]['sort']);_0x249951[_0x1cea('0x3b')]=qs['filters'](_[_0x1cea('0x3d')](_0x3740a3[_0x1cea('0x34')],_0x2c467d[_0x1cea('0x3c')]));if(_0x3740a3[_0x1cea('0x34')]['filter']){_0x249951[_0x1cea('0x3b')]=_[_0x1cea('0x3f')](_0x249951['where'],{'$or':_[_0x1cea('0x2d')](_0x249951[_0x1cea('0x37')],function(_0x42a0a3){var _0x4c1228={};_0x4c1228[_0x42a0a3]={'$like':'%'+_0x3740a3[_0x1cea('0x34')][_0x1cea('0x3e')]+'%'};return _0x4c1228;})});}if(_0x3740a3['query'][_0x1cea('0x59')]){var _0x11914c=_0x3740a3[_0x1cea('0x34')][_0x1cea('0x59')][_0x1cea('0x5a')](',');var _0x330fe2={};_0x330fe2[_0x11914c[0x0]]={'$gte':moment(_0x11914c[0x1])[_0x1cea('0x5b')](_0x1cea('0x5c'))};_0x249951[_0x1cea('0x3b')]=_[_0x1cea('0x3f')](_0x249951['where'],_0x330fe2);}_0x249951=_['merge']({},_0x249951,_0x3740a3[_0x1cea('0x41')]);return _0x1ba903[_0x1cea('0x5d')](_0x249951);}})[_0x1cea('0x27')](function(_0xc5c618){if(_0xc5c618){_0x820dfa=_0xc5c618[_0x1cea('0x38')];if(!_0x3740a3[_0x1cea('0x34')][_0x1cea('0x55')](_0x1cea('0x39'))){_0x249951['limit']=qs['limit'](_0x3740a3[_0x1cea('0x34')][_0x1cea('0x1f')]);_0x249951['offset']=qs[_0x1cea('0x1e')](_0x3740a3[_0x1cea('0x34')][_0x1cea('0x1e')]);}return _0x1ba903[_0x1cea('0x5d')](_0x249951);}})['then'](function(_0x58744c){if(_0x58744c){return _0x58744c?{'count':_0x820dfa,'rows':_0x58744c}:null;}})[_0x1cea('0x27')](respondWithResult(_0x3ec81a,null))['catch'](handleError(_0x3ec81a,null));}; \ No newline at end of file +var _0xbcb5=['catch','show','rawAttributes','length','find','create','body','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','User','getMembers','removeMembers','ChatGroupId','getMessages','$gte','format','zip-dir','fast-json-patch','moment','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','ChatGroup','includeAll','include','findAll','rows'];(function(_0x4f18a4,_0x4522ea){var _0x23a9bc=function(_0x3302a3){while(--_0x3302a3){_0x4f18a4['push'](_0x4f18a4['shift']());}};_0x23a9bc(++_0x4522ea);}(_0xbcb5,0x134));var _0x5bcb=function(_0x2aa36f,_0x2e549e){_0x2aa36f=_0x2aa36f-0x0;var _0x5f5a0c=_0xbcb5[_0x2aa36f];return _0x5f5a0c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5bcb('0x0'));var jsonpatch=require(_0x5bcb('0x1'));var rp=require('request-promise');var moment=require(_0x5bcb('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5bcb('0x3'));var path=require(_0x5bcb('0x4'));var sox=require(_0x5bcb('0x5'));var csv=require('to-csv');var ejs=require(_0x5bcb('0x6'));var fs=require('fs');var fs_extra=require(_0x5bcb('0x7'));var _=require(_0x5bcb('0x8'));var squel=require('squel');var crypto=require(_0x5bcb('0x9'));var jsforce=require(_0x5bcb('0xa'));var deskjs=require(_0x5bcb('0xb'));var toCsv=require(_0x5bcb('0xc'));var querystring=require(_0x5bcb('0xd'));var Papa=require(_0x5bcb('0xe'));var Redis=require(_0x5bcb('0xf'));var authService=require(_0x5bcb('0x10'));var qs=require(_0x5bcb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bcb('0x12'));var logger=require('../../config/logger')(_0x5bcb('0x13'));var utils=require(_0x5bcb('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5bcb('0x15'));var db=require(_0x5bcb('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x5bcb('0x17'),'port':0x18eb});var socket=require(_0x5bcb('0x18'))(new Redis(config[_0x5bcb('0x19')]));require('./chatGroup.socket')[_0x5bcb('0x1a')](socket);function respondWithStatusCode(_0xedf2ab,_0xbaa5f4){_0xbaa5f4=_0xbaa5f4||0xcc;return function(_0x237a66){if(_0x237a66){return _0xedf2ab[_0x5bcb('0x1b')](_0xbaa5f4);}return _0xedf2ab[_0x5bcb('0x1c')](_0xbaa5f4)[_0x5bcb('0x1d')]();};}function respondWithResult(_0x265220,_0x42a397){_0x42a397=_0x42a397||0xc8;return function(_0x19f2a0){if(_0x19f2a0){return _0x265220[_0x5bcb('0x1c')](_0x42a397)[_0x5bcb('0x1e')](_0x19f2a0);}};}function respondWithFilteredResult(_0x1e3cf6,_0x5edde5){return function(_0x308e35){if(_0x308e35){var _0x522250=typeof _0x5edde5[_0x5bcb('0x1f')]===_0x5bcb('0x20')&&typeof _0x5edde5[_0x5bcb('0x21')]===_0x5bcb('0x20');var _0x164310=_0x308e35[_0x5bcb('0x22')];var _0x3bc3d4=_0x522250?0x0:_0x5edde5[_0x5bcb('0x1f')];var _0x10d056=_0x522250?_0x308e35[_0x5bcb('0x22')]:_0x5edde5['offset']+_0x5edde5[_0x5bcb('0x21')];var _0x3eaea6;if(_0x10d056>=_0x164310){_0x10d056=_0x164310;_0x3eaea6=0xc8;}else{_0x3eaea6=0xce;}_0x1e3cf6['status'](_0x3eaea6);return _0x1e3cf6[_0x5bcb('0x23')](_0x5bcb('0x24'),_0x3bc3d4+'-'+_0x10d056+'/'+_0x164310)[_0x5bcb('0x1e')](_0x308e35);}return null;};}function patchUpdates(_0x2172dd){return function(_0x3ca324){try{jsonpatch[_0x5bcb('0x25')](_0x3ca324,_0x2172dd,!![]);}catch(_0x1752ee){return BPromise[_0x5bcb('0x26')](_0x1752ee);}return _0x3ca324[_0x5bcb('0x27')]();};}function saveUpdates(_0x57ef9f,_0x513ab4){return function(_0x146e85){if(_0x146e85){return _0x146e85[_0x5bcb('0x28')](_0x57ef9f)[_0x5bcb('0x29')](function(_0x2308fe){return _0x2308fe;});}return null;};}function removeEntity(_0x28ac04,_0x1a8864){return function(_0x32fc45){if(_0x32fc45){return _0x32fc45[_0x5bcb('0x2a')]()[_0x5bcb('0x29')](function(){_0x28ac04['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x263f21,_0x277fa6){return function(_0x2507cc){if(!_0x2507cc){_0x263f21[_0x5bcb('0x1b')](0x194);}return _0x2507cc;};}function handleError(_0x1ba918,_0x3199e9){_0x3199e9=_0x3199e9||0x1f4;return function(_0xc8d637){logger['error'](_0xc8d637['stack']);if(_0xc8d637['name']){delete _0xc8d637[_0x5bcb('0x2b')];}_0x1ba918[_0x5bcb('0x1c')](_0x3199e9)[_0x5bcb('0x2c')](_0xc8d637);};}exports[_0x5bcb('0x2d')]=function(_0xf09d0b,_0x2feeba){var _0x47560d={},_0x20cede={},_0x296f5b={'count':0x0,'rows':[]};var _0x290c51=_[_0x5bcb('0x2e')](db['ChatGroup']['rawAttributes'],function(_0x2826e3){return{'name':_0x2826e3[_0x5bcb('0x2f')],'type':_0x2826e3['type'][_0x5bcb('0x30')]};});_0x20cede[_0x5bcb('0x31')]=_['map'](_0x290c51,'name');_0x20cede['query']=_[_0x5bcb('0x32')](_0xf09d0b[_0x5bcb('0x33')]);_0x20cede[_0x5bcb('0x34')]=_[_0x5bcb('0x35')](_0x20cede[_0x5bcb('0x31')],_0x20cede[_0x5bcb('0x33')]);_0x47560d[_0x5bcb('0x36')]=_['intersection'](_0x20cede[_0x5bcb('0x31')],qs[_0x5bcb('0x37')](_0xf09d0b[_0x5bcb('0x33')]['fields']));_0x47560d['attributes']=_0x47560d[_0x5bcb('0x36')]['length']?_0x47560d[_0x5bcb('0x36')]:_0x20cede['model'];if(!_0xf09d0b['query'][_0x5bcb('0x38')](_0x5bcb('0x39'))){_0x47560d[_0x5bcb('0x21')]=qs[_0x5bcb('0x21')](_0xf09d0b[_0x5bcb('0x33')][_0x5bcb('0x21')]);_0x47560d[_0x5bcb('0x1f')]=qs['offset'](_0xf09d0b[_0x5bcb('0x33')][_0x5bcb('0x1f')]);}_0x47560d[_0x5bcb('0x3a')]=qs[_0x5bcb('0x3b')](_0xf09d0b[_0x5bcb('0x33')][_0x5bcb('0x3b')]);_0x47560d['where']=qs[_0x5bcb('0x34')](_[_0x5bcb('0x3c')](_0xf09d0b[_0x5bcb('0x33')],_0x20cede[_0x5bcb('0x34')]),_0x290c51);if(_0xf09d0b[_0x5bcb('0x33')][_0x5bcb('0x3d')]){_0x47560d[_0x5bcb('0x3e')]=_[_0x5bcb('0x3f')](_0x47560d[_0x5bcb('0x3e')],{'$or':_[_0x5bcb('0x2e')](_0x290c51,function(_0x27ab6c){if(_0x27ab6c[_0x5bcb('0x40')]!==_0x5bcb('0x41')){var _0x3bd363={};_0x3bd363[_0x27ab6c[_0x5bcb('0x2b')]]={'$like':'%'+_0xf09d0b['query'][_0x5bcb('0x3d')]+'%'};return _0x3bd363;}})});}_0x47560d=_[_0x5bcb('0x3f')]({},_0x47560d,_0xf09d0b[_0x5bcb('0x42')]);var _0x169694={'where':_0x47560d[_0x5bcb('0x3e')]};return db[_0x5bcb('0x43')][_0x5bcb('0x22')](_0x169694)[_0x5bcb('0x29')](function(_0x2d9ed2){_0x296f5b[_0x5bcb('0x22')]=_0x2d9ed2;if(_0xf09d0b[_0x5bcb('0x33')][_0x5bcb('0x44')]){_0x47560d[_0x5bcb('0x45')]=[{'all':!![]}];}return db[_0x5bcb('0x43')][_0x5bcb('0x46')](_0x47560d);})['then'](function(_0x10dabb){_0x296f5b[_0x5bcb('0x47')]=_0x10dabb;return _0x296f5b;})[_0x5bcb('0x29')](respondWithFilteredResult(_0x2feeba,_0x47560d))[_0x5bcb('0x48')](handleError(_0x2feeba,null));};exports[_0x5bcb('0x49')]=function(_0x30435c,_0x3d7b54){var _0x33bb6f={'raw':!![],'where':{'id':_0x30435c['params']['id']}},_0x2840de={};_0x2840de[_0x5bcb('0x31')]=_[_0x5bcb('0x32')](db[_0x5bcb('0x43')][_0x5bcb('0x4a')]);_0x2840de['query']=_[_0x5bcb('0x32')](_0x30435c[_0x5bcb('0x33')]);_0x2840de[_0x5bcb('0x34')]=_[_0x5bcb('0x35')](_0x2840de[_0x5bcb('0x31')],_0x2840de['query']);_0x33bb6f['attributes']=_[_0x5bcb('0x35')](_0x2840de[_0x5bcb('0x31')],qs['fields'](_0x30435c[_0x5bcb('0x33')][_0x5bcb('0x37')]));_0x33bb6f[_0x5bcb('0x36')]=_0x33bb6f['attributes'][_0x5bcb('0x4b')]?_0x33bb6f[_0x5bcb('0x36')]:_0x2840de['model'];if(_0x30435c[_0x5bcb('0x33')][_0x5bcb('0x44')]){_0x33bb6f[_0x5bcb('0x45')]=[{'all':!![]}];}_0x33bb6f=_[_0x5bcb('0x3f')]({},_0x33bb6f,_0x30435c[_0x5bcb('0x42')]);return db[_0x5bcb('0x43')][_0x5bcb('0x4c')](_0x33bb6f)[_0x5bcb('0x29')](handleEntityNotFound(_0x3d7b54,null))[_0x5bcb('0x29')](respondWithResult(_0x3d7b54,null))[_0x5bcb('0x48')](handleError(_0x3d7b54,null));};exports[_0x5bcb('0x4d')]=function(_0x2b34b1,_0x316030){return db['ChatGroup']['create'](_0x2b34b1['body'],{})[_0x5bcb('0x29')](respondWithResult(_0x316030,0xc9))[_0x5bcb('0x48')](handleError(_0x316030,null));};exports[_0x5bcb('0x28')]=function(_0x6046c2,_0x570897){if(_0x6046c2[_0x5bcb('0x4e')]['id']){delete _0x6046c2[_0x5bcb('0x4e')]['id'];}return db['ChatGroup'][_0x5bcb('0x4c')]({'where':{'id':_0x6046c2[_0x5bcb('0x4f')]['id']}})[_0x5bcb('0x29')](handleEntityNotFound(_0x570897,null))['then'](saveUpdates(_0x6046c2[_0x5bcb('0x4e')],null))[_0x5bcb('0x29')](respondWithResult(_0x570897,null))[_0x5bcb('0x48')](handleError(_0x570897,null));};exports['destroy']=function(_0x270f77,_0x343a95){return db['ChatGroup'][_0x5bcb('0x4c')]({'where':{'id':_0x270f77[_0x5bcb('0x4f')]['id']}})['then'](handleEntityNotFound(_0x343a95,null))[_0x5bcb('0x29')](removeEntity(_0x343a95,null))[_0x5bcb('0x48')](handleError(_0x343a95,null));};exports['describe']=function(_0x11050a,_0x2eaf6b){return db[_0x5bcb('0x43')][_0x5bcb('0x50')]()[_0x5bcb('0x29')](respondWithResult(_0x2eaf6b,null))[_0x5bcb('0x48')](handleError(_0x2eaf6b,null));};exports[_0x5bcb('0x51')]=function(_0x14ce95,_0x4adc34,_0x33eaf5){return db[_0x5bcb('0x52')][_0x5bcb('0x22')]({'where':{'ChatGroupId':_0x14ce95[_0x5bcb('0x4f')]['id'],'ToId':_0x14ce95[_0x5bcb('0x53')]['id'],'read':![]}})['then'](function(_0x185b80){return{'id':_[_0x5bcb('0x54')](_0x14ce95[_0x5bcb('0x4f')]['id']),'count':_0x185b80};})[_0x5bcb('0x29')](respondWithResult(_0x4adc34,null))[_0x5bcb('0x48')](handleError(_0x4adc34,null));};exports[_0x5bcb('0x55')]=function(_0x25ed51,_0x4e0bee,_0x402b74){return db[_0x5bcb('0x43')][_0x5bcb('0x4c')]({'where':{'id':_0x25ed51[_0x5bcb('0x4f')]['id']}})[_0x5bcb('0x29')](handleEntityNotFound(_0x4e0bee,null))[_0x5bcb('0x29')](function(_0x2c0f77){if(_0x2c0f77){return _0x2c0f77[_0x5bcb('0x55')](_0x25ed51[_0x5bcb('0x4e')][_0x5bcb('0x56')],_[_0x5bcb('0x57')](_0x25ed51['body'],[_0x5bcb('0x56'),'id'])||{});}})[_0x5bcb('0x29')](respondWithResult(_0x4e0bee,null))[_0x5bcb('0x48')](handleError(_0x4e0bee,null));};exports['getMembers']=function(_0x525166,_0x4e1935,_0x471c83){var _0x350fbb={};var _0x3e448f={};var _0x34d407;var _0x26a65;return db['ChatGroup']['findOne']({'where':{'id':_0x525166[_0x5bcb('0x4f')]['id']}})[_0x5bcb('0x29')](handleEntityNotFound(_0x4e1935,null))[_0x5bcb('0x29')](function(_0x3648b0){if(_0x3648b0){_0x34d407=_0x3648b0;_0x3e448f[_0x5bcb('0x31')]=_[_0x5bcb('0x32')](db[_0x5bcb('0x58')][_0x5bcb('0x4a')]);_0x3e448f[_0x5bcb('0x33')]=_[_0x5bcb('0x32')](_0x525166['query']);_0x3e448f[_0x5bcb('0x34')]=_[_0x5bcb('0x35')](_0x3e448f[_0x5bcb('0x31')],_0x3e448f[_0x5bcb('0x33')]);_0x350fbb['attributes']=_[_0x5bcb('0x35')](_0x3e448f[_0x5bcb('0x31')],qs['fields'](_0x525166[_0x5bcb('0x33')]['fields']));_0x350fbb[_0x5bcb('0x36')]=_0x350fbb[_0x5bcb('0x36')][_0x5bcb('0x4b')]?_0x350fbb[_0x5bcb('0x36')]:_0x3e448f['model'];_0x350fbb[_0x5bcb('0x3a')]=qs['sort'](_0x525166[_0x5bcb('0x33')][_0x5bcb('0x3b')]);_0x350fbb[_0x5bcb('0x3e')]=qs[_0x5bcb('0x34')](_[_0x5bcb('0x3c')](_0x525166['query'],_0x3e448f[_0x5bcb('0x34')]));if(_0x525166['query'][_0x5bcb('0x3d')]){_0x350fbb[_0x5bcb('0x3e')]=_[_0x5bcb('0x3f')](_0x350fbb[_0x5bcb('0x3e')],{'$or':_['map'](_0x350fbb[_0x5bcb('0x36')],function(_0xabe3b5){var _0x27506e={};_0x27506e[_0xabe3b5]={'$like':'%'+_0x525166[_0x5bcb('0x33')][_0x5bcb('0x3d')]+'%'};return _0x27506e;})});}_0x350fbb=_[_0x5bcb('0x3f')]({},_0x350fbb,_0x525166['options']);return _0x34d407[_0x5bcb('0x59')](_0x350fbb);}})[_0x5bcb('0x29')](function(_0x44115b){if(_0x44115b){_0x26a65=_0x44115b[_0x5bcb('0x4b')];if(!_0x525166[_0x5bcb('0x33')][_0x5bcb('0x38')](_0x5bcb('0x39'))){_0x350fbb[_0x5bcb('0x21')]=qs[_0x5bcb('0x21')](_0x525166[_0x5bcb('0x33')]['limit']);_0x350fbb['offset']=qs[_0x5bcb('0x1f')](_0x525166[_0x5bcb('0x33')][_0x5bcb('0x1f')]);}return _0x34d407['getMembers'](_0x350fbb);}})['then'](function(_0x5c7ace){if(_0x5c7ace){return _0x5c7ace?{'count':_0x26a65,'rows':_0x5c7ace}:null;}})['then'](respondWithResult(_0x4e1935,null))[_0x5bcb('0x48')](handleError(_0x4e1935,null));};exports[_0x5bcb('0x5a')]=function(_0x441a28,_0x186e1d,_0x25a317){return db[_0x5bcb('0x43')][_0x5bcb('0x4c')]({'where':{'id':_0x441a28[_0x5bcb('0x4f')]['id']}})[_0x5bcb('0x29')](handleEntityNotFound(_0x186e1d,null))['then'](function(_0x4ecdf6){if(_0x4ecdf6){return _0x4ecdf6[_0x5bcb('0x5a')](_0x441a28[_0x5bcb('0x33')][_0x5bcb('0x56')]);}})[_0x5bcb('0x29')](respondWithStatusCode(_0x186e1d,null))['catch'](handleError(_0x186e1d,null));};exports['addMessage']=function(_0x5ba6ac,_0x475779,_0x522b04){if(_0x5ba6ac['body']['id']){delete _0x5ba6ac[_0x5bcb('0x4e')]['id'];}return db[_0x5bcb('0x43')]['find']({'where':{'id':_0x5ba6ac['params']['id']}})[_0x5bcb('0x29')](handleEntityNotFound(_0x475779,null))['then'](function(_0x1bd757){if(_0x1bd757){_0x5ba6ac['body'][_0x5bcb('0x5b')]=_0x1bd757['id'];return db[_0x5bcb('0x52')][_0x5bcb('0x4d')](_0x5ba6ac[_0x5bcb('0x4e')]);}})[_0x5bcb('0x29')](respondWithResult(_0x475779,null))[_0x5bcb('0x48')](handleError(_0x475779,null));};exports[_0x5bcb('0x5c')]=function(_0x2bfc1f,_0x29cf71,_0xb55a4f){var _0x583665={};var _0x5e656c={};var _0x240902;var _0x4347b6;return db['ChatGroup']['findOne']({'where':{'id':_0x2bfc1f['params']['id']}})['then'](handleEntityNotFound(_0x29cf71,null))['then'](function(_0xf0d662){if(_0xf0d662){_0x240902=_0xf0d662;_0x5e656c['model']=_[_0x5bcb('0x32')](db['ChatInternalMessage']['rawAttributes']);_0x5e656c[_0x5bcb('0x33')]=_['keys'](_0x2bfc1f[_0x5bcb('0x33')]);_0x5e656c['filters']=_[_0x5bcb('0x35')](_0x5e656c[_0x5bcb('0x31')],_0x5e656c[_0x5bcb('0x33')]);_0x583665[_0x5bcb('0x36')]=_[_0x5bcb('0x35')](_0x5e656c['model'],qs[_0x5bcb('0x37')](_0x2bfc1f[_0x5bcb('0x33')][_0x5bcb('0x37')]));_0x583665[_0x5bcb('0x36')]=_0x583665[_0x5bcb('0x36')]['length']?_0x583665['attributes']:_0x5e656c[_0x5bcb('0x31')];_0x583665['order']=qs[_0x5bcb('0x3b')](_0x2bfc1f['query'][_0x5bcb('0x3b')]);_0x583665[_0x5bcb('0x3e')]=qs[_0x5bcb('0x34')](_['pick'](_0x2bfc1f[_0x5bcb('0x33')],_0x5e656c['filters']));if(_0x2bfc1f[_0x5bcb('0x33')][_0x5bcb('0x3d')]){_0x583665[_0x5bcb('0x3e')]=_[_0x5bcb('0x3f')](_0x583665['where'],{'$or':_['map'](_0x583665[_0x5bcb('0x36')],function(_0x3cfb5a){var _0x8c54ed={};_0x8c54ed[_0x3cfb5a]={'$like':'%'+_0x2bfc1f['query'][_0x5bcb('0x3d')]+'%'};return _0x8c54ed;})});}if(_0x2bfc1f['query'][_0x5bcb('0x5d')]){var _0x4a8a6e=_0x2bfc1f[_0x5bcb('0x33')][_0x5bcb('0x5d')]['split'](',');var _0xe06610={};_0xe06610[_0x4a8a6e[0x0]]={'$gte':moment(_0x4a8a6e[0x1])[_0x5bcb('0x5e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x583665[_0x5bcb('0x3e')]=_[_0x5bcb('0x3f')](_0x583665['where'],_0xe06610);}_0x583665=_['merge']({},_0x583665,_0x2bfc1f[_0x5bcb('0x42')]);return _0x240902[_0x5bcb('0x5c')](_0x583665);}})[_0x5bcb('0x29')](function(_0x1ac874){if(_0x1ac874){_0x4347b6=_0x1ac874[_0x5bcb('0x4b')];if(!_0x2bfc1f[_0x5bcb('0x33')][_0x5bcb('0x38')]('nolimit')){_0x583665[_0x5bcb('0x21')]=qs[_0x5bcb('0x21')](_0x2bfc1f[_0x5bcb('0x33')]['limit']);_0x583665[_0x5bcb('0x1f')]=qs[_0x5bcb('0x1f')](_0x2bfc1f[_0x5bcb('0x33')][_0x5bcb('0x1f')]);}return _0x240902['getMessages'](_0x583665);}})[_0x5bcb('0x29')](function(_0x57c723){if(_0x57c723){return _0x57c723?{'count':_0x4347b6,'rows':_0x57c723}:null;}})[_0x5bcb('0x29')](respondWithResult(_0x29cf71,null))[_0x5bcb('0x48')](handleError(_0x29cf71,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 14d3ea3..17071df 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 _0xfb93=['hasOwnProperty','events','../../mysqldb','ChatGroup','setMaxListeners','update','remove','emit'];(function(_0xccb896,_0x3d6c86){var _0x412b5e=function(_0x4346fa){while(--_0x4346fa){_0xccb896['push'](_0xccb896['shift']());}};_0x412b5e(++_0x3d6c86);}(_0xfb93,0x111));var _0x3fb9=function(_0x595275,_0x1b5d9a){_0x595275=_0x595275-0x0;var _0x528e02=_0xfb93[_0x595275];return _0x528e02;};'use strict';var EventEmitter=require(_0x3fb9('0x0'));var ChatGroup=require(_0x3fb9('0x1'))['db'][_0x3fb9('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x3fb9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3fb9('0x4'),'afterDestroy':_0x3fb9('0x5')};function emitEvent(_0x492ff9){return function(_0x49ac35,_0x4d5ec9,_0x131e5a){ChatGroupEvents[_0x3fb9('0x6')](_0x492ff9+':'+_0x49ac35['id'],_0x49ac35);ChatGroupEvents[_0x3fb9('0x6')](_0x492ff9,_0x49ac35);_0x131e5a(null);};}for(var e in events){if(events[_0x3fb9('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x84d6=['setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb','ChatGroup'];(function(_0x14a6f7,_0x586f25){var _0x42c47d=function(_0x2ed1c8){while(--_0x2ed1c8){_0x14a6f7['push'](_0x14a6f7['shift']());}};_0x42c47d(++_0x586f25);}(_0x84d6,0x180));var _0x684d=function(_0x40ba45,_0x13be71){_0x40ba45=_0x40ba45-0x0;var _0x4e290e=_0x84d6[_0x40ba45];return _0x4e290e;};'use strict';var EventEmitter=require(_0x684d('0x0'));var ChatGroup=require(_0x684d('0x1'))['db'][_0x684d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x684d('0x3')](0x0);var events={'afterCreate':_0x684d('0x4'),'afterUpdate':_0x684d('0x5'),'afterDestroy':_0x684d('0x6')};function emitEvent(_0x917d4d){return function(_0xb449ca,_0x26fcbe,_0x34c9b6){ChatGroupEvents[_0x684d('0x7')](_0x917d4d+':'+_0xb449ca['id'],_0xb449ca);ChatGroupEvents[_0x684d('0x7')](_0x917d4d,_0xb449ca);_0x34c9b6(null);};}for(var e in events){if(events[_0x684d('0x8')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 86d03a5..fad15b5 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 _0x9a3a=['api','request-promise','path','rimraf','../../config/environment','exports','define','ChatGroup','util','../../config/logger'];(function(_0x16f41b,_0x5e0f92){var _0x321c3b=function(_0x5253f0){while(--_0x5253f0){_0x16f41b['push'](_0x16f41b['shift']());}};_0x321c3b(++_0x5e0f92);}(_0x9a3a,0xc6));var _0xa9a3=function(_0x17c3d9,_0x53c486){_0x17c3d9=_0x17c3d9-0x0;var _0x497c0f=_0x9a3a[_0x17c3d9];return _0x497c0f;};'use strict';var _=require('lodash');var util=require(_0xa9a3('0x0'));var logger=require(_0xa9a3('0x1'))(_0xa9a3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa9a3('0x3'));var fs=require('fs');var path=require(_0xa9a3('0x4'));var rimraf=require(_0xa9a3('0x5'));var config=require(_0xa9a3('0x6'));var attributes=require('./chatGroup.attributes');module[_0xa9a3('0x7')]=function(_0x3abf7d,_0x406d34){return _0x3abf7d[_0xa9a3('0x8')](_0xa9a3('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc12b=['exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xc12b,0x64));var _0xbc12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc12b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbc12('0x0'));var util=require(_0xbc12('0x1'));var logger=require(_0xbc12('0x2'))('api');var moment=require(_0xbc12('0x3'));var BPromise=require('bluebird');var rp=require(_0xbc12('0x4'));var fs=require('fs');var path=require(_0xbc12('0x5'));var rimraf=require(_0xbc12('0x6'));var config=require(_0xbc12('0x7'));var attributes=require('./chatGroup.attributes');module[_0xbc12('0x8')]=function(_0x3d3dbd,_0x559364){return _0x3d3dbd[_0xbc12('0x9')](_0xbc12('0xa'),attributes,{'tableName':_0xbc12('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 4ab7f2b..9909a42 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 _0xfd2f=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','redis','defaults','localhost','./chatGroup.socket','register','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xfd2f,0x14a));var _0xffd2=function(_0xd33ad7,_0x46b20a){_0xd33ad7=_0xd33ad7-0x0;var _0x3040bb=_0xfd2f[_0xd33ad7];return _0x3040bb;};'use strict';var _=require(_0xffd2('0x0'));var util=require(_0xffd2('0x1'));var moment=require(_0xffd2('0x2'));var BPromise=require('bluebird');var rs=require(_0xffd2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xffd2('0x4'))['db'];var utils=require(_0xffd2('0x5'));var logger=require('../../config/logger')(_0xffd2('0x6'));var config=require(_0xffd2('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xffd2('0x8')]=_[_0xffd2('0x9')](config['redis'],{'host':_0xffd2('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xffd2('0xb'))[_0xffd2('0xc')](socket);function respondWithRpcPromise(_0x242109,_0xececd8,_0x4be9e4){return new BPromise(function(_0x179c11,_0x5292bd){return client['request'](_0x242109,_0x4be9e4)['then'](function(_0x2cac45){logger[_0xffd2('0xd')](_0xffd2('0xe'),_0xececd8,_0xffd2('0xf'));logger[_0xffd2('0x10')](_0xffd2('0x11'),_0xececd8,_0xffd2('0xf'),JSON['stringify'](_0x2cac45));if(_0x2cac45['error']){if(_0x2cac45['error']['code']===0x1f4){logger[_0xffd2('0x12')](_0xffd2('0xe'),_0xececd8,_0x2cac45['error'][_0xffd2('0x13')]);return _0x5292bd(_0x2cac45[_0xffd2('0x12')][_0xffd2('0x13')]);}logger[_0xffd2('0x12')](_0xffd2('0xe'),_0xececd8,_0x2cac45[_0xffd2('0x12')][_0xffd2('0x13')]);return _0x179c11(_0x2cac45[_0xffd2('0x12')][_0xffd2('0x13')]);}else{logger['info'](_0xffd2('0xe'),_0xececd8,_0xffd2('0xf'));_0x179c11(_0x2cac45[_0xffd2('0x14')]['message']);}})[_0xffd2('0x15')](function(_0x21f344){logger[_0xffd2('0x12')](_0xffd2('0xe'),_0xececd8,_0x21f344);_0x5292bd(_0x21f344);});});} \ No newline at end of file +var _0x3c70=['defaults','localhost','socket.io-emitter','register','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatGroup,\x20%s,\x20%s','request\x20sent','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c70,0x10c));var _0x03c7=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x3c70[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x03c7('0x0'));var util=require(_0x03c7('0x1'));var moment=require(_0x03c7('0x2'));var BPromise=require('bluebird');var rs=require(_0x03c7('0x3'));var fs=require('fs');var Redis=require(_0x03c7('0x4'));var db=require(_0x03c7('0x5'))['db'];var utils=require(_0x03c7('0x6'));var logger=require(_0x03c7('0x7'))(_0x03c7('0x8'));var config=require('../../config/environment');var jayson=require(_0x03c7('0x9'));var client=jayson['client'][_0x03c7('0xa')]({'port':0x232a});config[_0x03c7('0xb')]=_[_0x03c7('0xc')](config['redis'],{'host':_0x03c7('0xd'),'port':0x18eb});var socket=require(_0x03c7('0xe'))(new Redis(config[_0x03c7('0xb')]));require('./chatGroup.socket')[_0x03c7('0xf')](socket);function respondWithRpcPromise(_0x48c3f7,_0x103052,_0x20c6c8){return new BPromise(function(_0x57c8fb,_0x856199){return client[_0x03c7('0x10')](_0x48c3f7,_0x20c6c8)[_0x03c7('0x11')](function(_0xf98747){logger[_0x03c7('0x12')]('ChatGroup,\x20%s,\x20%s',_0x103052,'request\x20sent');logger[_0x03c7('0x13')](_0x03c7('0x14'),_0x103052,'request\x20sent',JSON[_0x03c7('0x15')](_0xf98747));if(_0xf98747[_0x03c7('0x16')]){if(_0xf98747[_0x03c7('0x16')][_0x03c7('0x17')]===0x1f4){logger[_0x03c7('0x16')]('ChatGroup,\x20%s,\x20%s',_0x103052,_0xf98747[_0x03c7('0x16')]['message']);return _0x856199(_0xf98747[_0x03c7('0x16')][_0x03c7('0x18')]);}logger['error'](_0x03c7('0x19'),_0x103052,_0xf98747[_0x03c7('0x16')][_0x03c7('0x18')]);return _0x57c8fb(_0xf98747['error'][_0x03c7('0x18')]);}else{logger[_0x03c7('0x12')](_0x03c7('0x19'),_0x103052,_0x03c7('0x1a'));_0x57c8fb(_0xf98747[_0x03c7('0x1b')][_0x03c7('0x18')]);}})['catch'](function(_0x571108){logger[_0x03c7('0x16')](_0x03c7('0x19'),_0x103052,_0x571108);_0x856199(_0x571108);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 3dcade7..d8c2519 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 _0x686e=['register','./chatGroup.events','save','remove','update','emit'];(function(_0x486451,_0xe0e65e){var _0x585456=function(_0x2417ff){while(--_0x2417ff){_0x486451['push'](_0x486451['shift']());}};_0x585456(++_0xe0e65e);}(_0x686e,0x1db));var _0xe686=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x686e[_0x3dd15e];return _0x231fd0;};'use strict';var ChatGroupEvents=require(_0xe686('0x0'));var events=[_0xe686('0x1'),_0xe686('0x2'),_0xe686('0x3')];function createListener(_0x42a6b3,_0x5c936f){return function(_0xf51c49){_0x5c936f[_0xe686('0x4')](_0x42a6b3,_0xf51c49);};}function removeListener(_0x57d6bb,_0x3e90d5){return function(){ChatGroupEvents['removeListener'](_0x57d6bb,_0x3e90d5);};}exports[_0xe686('0x5')]=function(_0x5a9681){for(var _0x48485b=0x0,_0x9457f6=events['length'];_0x48485b<_0x9457f6;_0x48485b++){var _0x1f802f=events[_0x48485b];var _0x1cc96a=createListener('chatGroup:'+_0x1f802f,_0x5a9681);ChatGroupEvents['on'](_0x1f802f,_0x1cc96a);}}; \ No newline at end of file +var _0x0a82=['removeListener','register','chatGroup:','./chatGroup.events','save','update','emit'];(function(_0x138d3d,_0x41a640){var _0x2e1cac=function(_0x1a2a8b){while(--_0x1a2a8b){_0x138d3d['push'](_0x138d3d['shift']());}};_0x2e1cac(++_0x41a640);}(_0x0a82,0x137));var _0x20a8=function(_0x1147e7,_0x22494d){_0x1147e7=_0x1147e7-0x0;var _0x3438bf=_0x0a82[_0x1147e7];return _0x3438bf;};'use strict';var ChatGroupEvents=require(_0x20a8('0x0'));var events=[_0x20a8('0x1'),'remove',_0x20a8('0x2')];function createListener(_0x5eeec1,_0x10e28f){return function(_0x32f1c9){_0x10e28f[_0x20a8('0x3')](_0x5eeec1,_0x32f1c9);};}function removeListener(_0xa96946,_0x154037){return function(){ChatGroupEvents[_0x20a8('0x4')](_0xa96946,_0x154037);};}exports[_0x20a8('0x5')]=function(_0x13b380){for(var _0x4e5924=0x0,_0x5a8f47=events['length'];_0x4e5924<_0x5a8f47;_0x4e5924++){var _0x298e20=events[_0x4e5924];var _0x63d692=createListener(_0x20a8('0x6')+_0x298e20,_0x13b380);ChatGroupEvents['on'](_0x298e20,_0x63d692);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 629a415..f93b279 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 _0x7013=['destroy','removeMembers','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/unread','getUnread','getMembers','getMessages','post','create','/:id/members','addMembers','/:id/messages','addMessage','put','update','delete'];(function(_0x22ee1e,_0x3eff80){var _0x49a5c9=function(_0x373480){while(--_0x373480){_0x22ee1e['push'](_0x22ee1e['shift']());}};_0x49a5c9(++_0x3eff80);}(_0x7013,0x16b));var _0x3701=function(_0x3d1c4c,_0xfc49f0){_0x3d1c4c=_0x3d1c4c-0x0;var _0xa03358=_0x7013[_0x3d1c4c];return _0xa03358;};'use strict';var multer=require(_0x3701('0x0'));var util=require(_0x3701('0x1'));var path=require(_0x3701('0x2'));var timeout=require('connect-timeout');var express=require(_0x3701('0x3'));var router=express[_0x3701('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3701('0x5'));var interaction=require(_0x3701('0x6'));var config=require(_0x3701('0x7'));var controller=require('./chatGroup.controller');router[_0x3701('0x8')]('/',auth[_0x3701('0x9')](),controller[_0x3701('0xa')]);router[_0x3701('0x8')]('/describe',auth[_0x3701('0x9')](),controller[_0x3701('0xb')]);router[_0x3701('0x8')](_0x3701('0xc'),auth[_0x3701('0x9')](),controller[_0x3701('0xd')]);router['get'](_0x3701('0xe'),auth[_0x3701('0x9')](),controller[_0x3701('0xf')]);router['get']('/:id/members',auth['isAuthenticated'](),controller[_0x3701('0x10')]);router[_0x3701('0x8')]('/:id/messages',auth[_0x3701('0x9')](),controller[_0x3701('0x11')]);router[_0x3701('0x12')]('/',auth[_0x3701('0x9')](),controller[_0x3701('0x13')]);router[_0x3701('0x12')](_0x3701('0x14'),auth['isAuthenticated'](),controller[_0x3701('0x15')]);router[_0x3701('0x12')](_0x3701('0x16'),auth[_0x3701('0x9')](),controller[_0x3701('0x17')]);router[_0x3701('0x18')](_0x3701('0xc'),auth[_0x3701('0x9')](),controller[_0x3701('0x19')]);router[_0x3701('0x1a')]('/:id',auth[_0x3701('0x9')](),controller[_0x3701('0x1b')]);router[_0x3701('0x1a')](_0x3701('0x14'),auth[_0x3701('0x9')](),controller[_0x3701('0x1c')]);module[_0x3701('0x1d')]=router; \ No newline at end of file +var _0x93b2=['express','Router','fs-extra','../../components/auth/service','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','show','/:id/unread','getUnread','/:id/members','post','create','addMembers','put','update','destroy','delete','removeMembers','exports','multer','util','path','connect-timeout'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x93b2,0xb9));var _0x293b=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x93b2[_0x35885a];return _0xe86249;};'use strict';var multer=require(_0x293b('0x0'));var util=require(_0x293b('0x1'));var path=require(_0x293b('0x2'));var timeout=require(_0x293b('0x3'));var express=require(_0x293b('0x4'));var router=express[_0x293b('0x5')]();var fs_extra=require(_0x293b('0x6'));var auth=require(_0x293b('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x293b('0x8'));router[_0x293b('0x9')]('/',auth[_0x293b('0xa')](),controller[_0x293b('0xb')]);router['get']('/describe',auth[_0x293b('0xa')](),controller[_0x293b('0xc')]);router[_0x293b('0x9')](_0x293b('0xd'),auth[_0x293b('0xa')](),controller[_0x293b('0xe')]);router[_0x293b('0x9')](_0x293b('0xf'),auth[_0x293b('0xa')](),controller[_0x293b('0x10')]);router[_0x293b('0x9')](_0x293b('0x11'),auth[_0x293b('0xa')](),controller['getMembers']);router['get']('/:id/messages',auth[_0x293b('0xa')](),controller['getMessages']);router[_0x293b('0x12')]('/',auth[_0x293b('0xa')](),controller[_0x293b('0x13')]);router[_0x293b('0x12')]('/:id/members',auth['isAuthenticated'](),controller[_0x293b('0x14')]);router['post']('/:id/messages',auth[_0x293b('0xa')](),controller['addMessage']);router[_0x293b('0x15')](_0x293b('0xd'),auth[_0x293b('0xa')](),controller[_0x293b('0x16')]);router['delete'](_0x293b('0xd'),auth['isAuthenticated'](),controller[_0x293b('0x17')]);router[_0x293b('0x18')]('/:id/members',auth[_0x293b('0xa')](),controller[_0x293b('0x19')]);module[_0x293b('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 013a24d..62288cc 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 _0xa693=['exports','BOOLEAN','INTEGER','ENUM','star','TEXT','STRING','DATE','long','out','sequelize'];(function(_0x54c529,_0x2bcd83){var _0x40bc2b=function(_0x9562c3){while(--_0x9562c3){_0x54c529['push'](_0x54c529['shift']());}};_0x40bc2b(++_0x2bcd83);}(_0xa693,0xf1));var _0x3a69=function(_0x2aefb6,_0x1bd384){_0x2aefb6=_0x2aefb6-0x0;var _0x202772=_0xa693[_0x2aefb6];return _0x202772;};'use strict';var Sequelize=require(_0x3a69('0x0'));module[_0x3a69('0x1')]={'closed':{'type':Sequelize[_0x3a69('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3a69('0x3')]},'ratingType':{'type':Sequelize[_0x3a69('0x4')](_0x3a69('0x5'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x3a69('0x6')]},'mailTranscript':{'type':Sequelize[_0x3a69('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3a69('0x8')]},'disposition':{'type':Sequelize[_0x3a69('0x7')]},'secondDisposition':{'type':Sequelize[_0x3a69('0x7')]},'thirdDisposition':{'type':Sequelize[_0x3a69('0x7')]},'note':{'type':Sequelize[_0x3a69('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x3a69('0x7')]},'osName':{'type':Sequelize[_0x3a69('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x3a69('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x3a69('0x7')]},'formData':{'type':Sequelize[_0x3a69('0x6')](_0x3a69('0x9'))},'read1stAt':{'type':Sequelize[_0x3a69('0x8')]},'lastMsgAt':{'type':Sequelize[_0x3a69('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3a69('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3a69('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x3a69('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x3a69('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x7033=['star','thumb','TEXT','STRING','DATE','long','ENUM','sequelize','exports','BOOLEAN','INTEGER'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7033,0x19e));var _0x3703=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7033[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x3703('0x0'));module[_0x3703('0x1')]={'closed':{'type':Sequelize[_0x3703('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3703('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0x3703('0x4'),_0x3703('0x5')),'defaultValue':_0x3703('0x4')},'ratingMessage':{'type':Sequelize[_0x3703('0x6')]},'pathTranscript':{'type':Sequelize[_0x3703('0x6')]},'mailTranscript':{'type':Sequelize[_0x3703('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3703('0x8')]},'disposition':{'type':Sequelize[_0x3703('0x7')]},'secondDisposition':{'type':Sequelize[_0x3703('0x7')]},'thirdDisposition':{'type':Sequelize[_0x3703('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x3703('0x7')]},'osVersion':{'type':Sequelize[_0x3703('0x7')]},'deviceModel':{'type':Sequelize[_0x3703('0x7')]},'deviceVendor':{'type':Sequelize[_0x3703('0x7')]},'deviceType':{'type':Sequelize[_0x3703('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x3703('0x7')]},'formData':{'type':Sequelize[_0x3703('0x6')](_0x3703('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x3703('0xa')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3703('0x7')]},'customerPort':{'type':Sequelize[_0x3703('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x3703('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x3703('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 0577331..467844d 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 _0x4dc0=['show','params','model','keys','ChatInteraction','query','filters','intersection','attributes','fields','includeAll','include','options','find','create','update','destroy','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','fullname','email','POST','isNull','follow','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','basename','Attachment','attachmentDownload','closed','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','mailTranscript','now','pathTranscript','Messages','User','CmContact','ContactId','length','format','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','MailAccount','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','hasOwnProperty','order','sort','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','nolimit','pick','ChatInteractionId','push','setTags','Tag','color','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','transcript-%d-%s.zip','firstName','lastName','read','Owner','get','mkdirSync','Chat','N.A.','closedAt','disposition','browserName','osName','referer','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','Contact','value','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','download','err','unlinkSync','rimraf','zip-dir','moment','bluebird','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','stack','name','send','render','merge','body','agent','interaction','account','index','map','type','key','getOptions','chat','user'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x4dc0,0x168));var _0x04dc=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x4dc0[_0x47b58b];return _0x46bebe;};'use strict';var rimraf=require(_0x04dc('0x0'));var zipdir=require(_0x04dc('0x1'));var rp=require('request-promise');var moment=require(_0x04dc('0x2'));var BPromise=require(_0x04dc('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x04dc('0x4'));var ejs=require(_0x04dc('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x04dc('0x6'));var interaction=require(_0x04dc('0x7'));var qs=require(_0x04dc('0x8'));var pdf=require(_0x04dc('0x9'));var logger=require('../../config/logger')('api');var config=require(_0x04dc('0xa'));var db=require(_0x04dc('0xb'))['db'];config[_0x04dc('0xc')]=_[_0x04dc('0xd')](config[_0x04dc('0xc')],{'host':_0x04dc('0xe'),'port':0x18eb});var socket=require(_0x04dc('0xf'))(new Redis(config[_0x04dc('0xc')]));require(_0x04dc('0x10'))[_0x04dc('0x11')](socket);var jayson=require(_0x04dc('0x12'));var client=jayson[_0x04dc('0x13')][_0x04dc('0x14')]({'port':0x232b});var client9004=jayson[_0x04dc('0x13')][_0x04dc('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x401d46,_0x514af8,_0x23b6e1,_0x27c3c4){return new BPromise(function(_0x1f6ef8,_0x9b3fab){var _0x7395f5=_0x27c3c4||client;return _0x7395f5[_0x04dc('0x15')](_0x401d46,_0x23b6e1)[_0x04dc('0x16')](function(_0x2f84bf){logger['info'](_0x04dc('0x17'),_0x514af8,_0x04dc('0x18'));logger[_0x04dc('0x19')](_0x04dc('0x1a'),_0x514af8,_0x04dc('0x18'),JSON['stringify'](_0x2f84bf));if(_0x2f84bf[_0x04dc('0x1b')]){if(_0x2f84bf[_0x04dc('0x1b')][_0x04dc('0x1c')]===0x1f4){logger['error'](_0x04dc('0x17'),_0x514af8,_0x2f84bf[_0x04dc('0x1b')][_0x04dc('0x1d')]);return _0x9b3fab(_0x2f84bf[_0x04dc('0x1b')][_0x04dc('0x1d')]);}logger[_0x04dc('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x514af8,_0x2f84bf['error'][_0x04dc('0x1d')]);return _0x1f6ef8(_0x2f84bf['error']['message']);}else{logger[_0x04dc('0x1e')](_0x04dc('0x17'),_0x514af8,_0x04dc('0x18'));_0x1f6ef8(_0x2f84bf[_0x04dc('0x1f')]['message']);}})[_0x04dc('0x20')](function(_0x532095){logger[_0x04dc('0x1b')](_0x04dc('0x17'),_0x514af8,_0x532095);_0x9b3fab(_0x532095);});});}function respondWithStatusCode(_0x5f221a,_0x237db6){_0x237db6=_0x237db6||0xcc;return function(_0x540d6e){if(_0x540d6e){return _0x5f221a[_0x04dc('0x21')](_0x237db6);}return _0x5f221a[_0x04dc('0x22')](_0x237db6)[_0x04dc('0x23')]();};}function respondWithResult(_0x16f515,_0x91661a){_0x91661a=_0x91661a||0xc8;return function(_0x48a072){if(_0x48a072){return _0x16f515[_0x04dc('0x22')](_0x91661a)[_0x04dc('0x24')](_0x48a072);}};}function respondWithFilteredResult(_0x3fa53,_0xd1cccb){return function(_0x45622e){if(_0x45622e){var _0x39d82f=typeof _0xd1cccb[_0x04dc('0x25')]==='undefined'&&typeof _0xd1cccb[_0x04dc('0x26')]==='undefined';var _0xf9328e=_0x45622e['count'];var _0x4aeb50=_0x39d82f?0x0:_0xd1cccb[_0x04dc('0x25')];var _0x5e5556=_0x39d82f?_0x45622e[_0x04dc('0x27')]:_0xd1cccb['offset']+_0xd1cccb[_0x04dc('0x26')];var _0x165342;if(_0x5e5556>=_0xf9328e){_0x5e5556=_0xf9328e;_0x165342=0xc8;}else{_0x165342=0xce;}_0x3fa53[_0x04dc('0x22')](_0x165342);return _0x3fa53[_0x04dc('0x28')](_0x04dc('0x29'),_0x4aeb50+'-'+_0x5e5556+'/'+_0xf9328e)[_0x04dc('0x24')](_0x45622e);}return null;};}function saveUpdates(_0x17ce7c){return function(_0x2f0b92){if(_0x2f0b92){return _0x2f0b92['update'](_0x17ce7c)['then'](function(_0x36b0e1){return _0x36b0e1;});}return null;};}function removeEntity(_0x188680){return function(_0x4df92c){if(_0x4df92c){return _0x4df92c['destroy']()[_0x04dc('0x16')](function(){_0x188680[_0x04dc('0x22')](0xcc)[_0x04dc('0x23')]();});}};}function handleEntityNotFound(_0x2dfdf4){return function(_0x1cca42){if(!_0x1cca42){_0x2dfdf4[_0x04dc('0x21')](0x194);}return _0x1cca42;};}function handleError(_0x34077c,_0x13ff61){_0x13ff61=_0x13ff61||0x1f4;return function(_0x160a5c){logger['error'](_0x160a5c[_0x04dc('0x2a')]);if(_0x160a5c[_0x04dc('0x2b')]){delete _0x160a5c[_0x04dc('0x2b')];}_0x34077c[_0x04dc('0x22')](_0x13ff61)[_0x04dc('0x2c')](_0x160a5c);};}function getMustacheRender(_0x383d2f,_0x1b0e24){return Mustache[_0x04dc('0x2d')](_0x383d2f,_[_0x04dc('0x2e')](_0x1b0e24[_0x04dc('0x2f')],{'contact':_0x1b0e24['contact'],'message':_0x1b0e24[_0x04dc('0x1d')],'agent':_0x1b0e24[_0x04dc('0x30')],'interaction':_0x1b0e24[_0x04dc('0x31')],'account':_0x1b0e24[_0x04dc('0x32')]}))||'';}exports[_0x04dc('0x33')]=function(_0x3205bf,_0x3c1742){var _0xc35e78={};var _0x4f7d6f=_[_0x04dc('0x34')](db['ChatInteraction']['rawAttributes'],function(_0xf8f423){return{'name':_0xf8f423['fieldName'],'type':_0xf8f423[_0x04dc('0x35')][_0x04dc('0x36')]};});_0xc35e78=qs[_0x04dc('0x37')](_0x4f7d6f,_0x3205bf);return interaction['findAll'](_0x04dc('0x38'),_0x3205bf['query'],_0x3205bf[_0x04dc('0x39')],_0xc35e78,_0x4f7d6f)['then'](respondWithFilteredResult(_0x3c1742,_0xc35e78))[_0x04dc('0x20')](handleError(_0x3c1742,null));};exports[_0x04dc('0x3a')]=function(_0x1c4427,_0x32b5e5){var _0x4c76bb={'raw':![],'where':{'id':_0x1c4427[_0x04dc('0x3b')]['id']}},_0x24534c={};_0x24534c[_0x04dc('0x3c')]=_[_0x04dc('0x3d')](db[_0x04dc('0x3e')]['rawAttributes']);_0x24534c['query']=_['keys'](_0x1c4427[_0x04dc('0x3f')]);_0x24534c[_0x04dc('0x40')]=_[_0x04dc('0x41')](_0x24534c[_0x04dc('0x3c')],_0x24534c[_0x04dc('0x3f')]);_0x4c76bb[_0x04dc('0x42')]=_[_0x04dc('0x41')](_0x24534c[_0x04dc('0x3c')],qs[_0x04dc('0x43')](_0x1c4427['query'][_0x04dc('0x43')]));_0x4c76bb[_0x04dc('0x42')]=_0x4c76bb['attributes']['length']?_0x4c76bb['attributes']:_0x24534c[_0x04dc('0x3c')];if(_0x1c4427[_0x04dc('0x3f')][_0x04dc('0x44')]){_0x4c76bb[_0x04dc('0x45')]=[{'all':!![]}];}_0x4c76bb=_[_0x04dc('0x2e')]({},_0x4c76bb,_0x1c4427[_0x04dc('0x46')]);return db['ChatInteraction'][_0x04dc('0x47')](_0x4c76bb)[_0x04dc('0x16')](handleEntityNotFound(_0x32b5e5,null))['then'](respondWithResult(_0x32b5e5,null))[_0x04dc('0x20')](handleError(_0x32b5e5,null));};exports[_0x04dc('0x48')]=function(_0x801dd1,_0x5927f1){return db[_0x04dc('0x3e')]['create'](_0x801dd1[_0x04dc('0x2f')],{})['then'](respondWithResult(_0x5927f1,0xc9))[_0x04dc('0x20')](handleError(_0x5927f1,null));};exports[_0x04dc('0x49')]=function(_0x4e0835,_0x425c5b){if(_0x4e0835['body']['id']){delete _0x4e0835[_0x04dc('0x2f')]['id'];}return db[_0x04dc('0x3e')]['find']({'where':{'id':_0x4e0835[_0x04dc('0x3b')]['id']}})[_0x04dc('0x16')](handleEntityNotFound(_0x425c5b,null))[_0x04dc('0x16')](saveUpdates(_0x4e0835[_0x04dc('0x2f')],null))['then'](respondWithResult(_0x425c5b,null))[_0x04dc('0x20')](handleError(_0x425c5b,null));};exports[_0x04dc('0x4a')]=function(_0x24bd2a,_0x43358f){return db['ChatInteraction'][_0x04dc('0x47')]({'where':{'id':_0x24bd2a[_0x04dc('0x3b')]['id']}})['then'](handleEntityNotFound(_0x43358f,null))[_0x04dc('0x16')](removeEntity(_0x43358f,null))[_0x04dc('0x20')](handleError(_0x43358f,null));};exports[_0x04dc('0x4b')]=function(_0x81237d,_0x4c32d6){return db['ChatInteraction'][_0x04dc('0x4b')]()[_0x04dc('0x16')](respondWithResult(_0x4c32d6,null))[_0x04dc('0x20')](handleError(_0x4c32d6,null));};exports[_0x04dc('0x4c')]=function(_0x5e08ec,_0x5a2e5a){var _0x1f2aca=_0x5e08ec['params']['id'];var _0x1048ed;var _0x19dd4a;var _0x4cfe9b;return db[_0x04dc('0x3e')][_0x04dc('0x4d')]({'where':{'id':_0x1f2aca}})[_0x04dc('0x16')](function(_0x1b7c83){_0x1048ed=_0x1b7c83;return db[_0x04dc('0x4e')][_0x04dc('0x4d')]({'where':{'id':_0x1b7c83[_0x04dc('0x4f')]},'attributes':['id','vidaooApiKey',_0x04dc('0x50'),_0x04dc('0x51'),_0x04dc('0x52'),_0x04dc('0x53')],'raw':!![]});})[_0x04dc('0x16')](function(_0x5bd876){if(_0x5bd876&&_0x5bd876[_0x04dc('0x54')]&&_0x5bd876[_0x04dc('0x50')]){_0x19dd4a=_0x5bd876;var _0x35711c={'interaction':{'id':_0x1f2aca},'agent':{'id':_0x5e08ec['user']['id'],'name':_0x5e08ec[_0x04dc('0x39')]['name'],'fullname':_0x5e08ec[_0x04dc('0x39')][_0x04dc('0x55')],'email':_0x5e08ec[_0x04dc('0x39')][_0x04dc('0x56')]},'contact':_0x5e08ec[_0x04dc('0x2f')]['contact'],'account':_0x5e08ec[_0x04dc('0x2f')]['account']};var _0x364636={'rejectUnauthorized':![],'method':_0x04dc('0x57'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x5bd876[_0x04dc('0x54')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5e08ec['user'][_0x04dc('0x56')]],'buttons':null,'topic':_0x19dd4a[_0x04dc('0x51')],'note':_[_0x04dc('0x58')](_0x19dd4a[_0x04dc('0x52')])?null:getMustacheRender(_0x19dd4a[_0x04dc('0x52')],_0x35711c),'metadata':null},'redirect':_0x04dc('0x59'),'json':!![]};try{if(!_[_0x04dc('0x58')](_0x19dd4a[_0x04dc('0x53')])){var _0x270143=getMustacheRender(_0x19dd4a[_0x04dc('0x53')],_0x35711c);var _0xebff68=JSON[_0x04dc('0x5a')](_0x270143);_0x364636['body']['metadata']=_0xebff68;}}catch(_0x4673f0){throw new db[(_0x04dc('0x5b'))][(_0x04dc('0x5c'))](_0x04dc('0x5d'));}return rp(_0x364636);}else{throw new db[(_0x04dc('0x5b'))][(_0x04dc('0x5c'))](_0x04dc('0x5e'));}})[_0x04dc('0x16')](function(_0x399054){_0x4cfe9b=_0x399054;if(_0x4cfe9b['id']){var _0x2e9ad8={'body':_0x4cfe9b[_0x04dc('0x5f')],'ChatWebsiteId':_0x19dd4a['id'],'ChatInteractionId':_0x1048ed['id'],'direction':_0x04dc('0x60'),'UserId':_0x5e08ec[_0x04dc('0x39')]['id']};return db[_0x04dc('0x61')]['create'](_0x2e9ad8,{});}else{throw new db[(_0x04dc('0x5b'))][(_0x04dc('0x5c'))](_0x04dc('0x62'));}})[_0x04dc('0x16')](function(){return _0x1048ed[_0x04dc('0x63')]({'vidaooSessionId':_0x4cfe9b['id']});})[_0x04dc('0x16')](respondWithResult(_0x5a2e5a,null))[_0x04dc('0x20')](handleError(_0x5a2e5a,null));};exports[_0x04dc('0x64')]=function(_0x8d67e7,_0x3718e6){if(_0x8d67e7[_0x04dc('0x2f')]['id']){delete _0x8d67e7[_0x04dc('0x2f')]['id'];}return db[_0x04dc('0x3e')][_0x04dc('0x47')]({'where':{'id':_0x8d67e7[_0x04dc('0x3b')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x04dc('0x16')](handleEntityNotFound(_0x3718e6,null))[_0x04dc('0x16')](saveUpdates(_0x8d67e7['body'],null))[_0x04dc('0x16')](respondWithResult(_0x3718e6,null))[_0x04dc('0x20')](handleError(_0x3718e6,null));};exports[_0x04dc('0x65')]=function(_0x451b7e,_0x2c1282){if(_0x451b7e['body']['id']){delete _0x451b7e['body']['id'];}return db['ChatInteraction'][_0x04dc('0x47')]({'where':{'id':_0x451b7e[_0x04dc('0x3b')]['id']}})[_0x04dc('0x16')](function(_0x3c5462){if(!_0x3c5462){logger[_0x04dc('0x1b')](_0x04dc('0x66'),_0x04dc('0x65'),0x194,_0x04dc('0x67'));_0x2c1282[_0x04dc('0x21')](0x194);}else{if(_0x3c5462[_0x04dc('0x68')]){throw new db['Sequelize'][(_0x04dc('0x5c'))](_0x04dc('0x69'));}}return _0x3c5462;})[_0x04dc('0x16')](function(_0x1a0f28){if(_0x1a0f28){return _0x1a0f28['update']({'closed':_0x451b7e[_0x04dc('0x2f')]['closed'],'disposition':_0x451b7e[_0x04dc('0x2f')]['disposition']})[_0x04dc('0x16')](function(_0x10ba54){return _0x10ba54;});}})['then'](function(){return respondWithRpcPromise(_0x04dc('0x6a'),'abandon',_0x451b7e[_0x04dc('0x2f')],client9004);})[_0x04dc('0x16')](respondWithResult(_0x2c1282,null))[_0x04dc('0x20')](handleError(_0x2c1282,null));};exports[_0x04dc('0x6b')]=function(_0x20286a,_0x5579dc){_0x20286a[_0x04dc('0x2f')][_0x04dc('0x2b')]=_0x20286a[_0x04dc('0x6c')][_0x04dc('0x6d')];_0x20286a[_0x04dc('0x2f')][_0x04dc('0x6e')]=_0x20286a['file']['filename'];_0x20286a[_0x04dc('0x2f')]['type']=_0x20286a[_0x04dc('0x6c')]['mimetype'];return db[_0x04dc('0x6f')][_0x04dc('0x48')](_0x20286a[_0x04dc('0x2f')])[_0x04dc('0x16')](respondWithResult(_0x5579dc,0xc9))['catch'](handleError(_0x5579dc,null));};exports[_0x04dc('0x70')]=function(_0x53f90c,_0x19d573){return db[_0x04dc('0x3e')][_0x04dc('0x4d')]({'where':{'id':_0x53f90c[_0x04dc('0x3b')]['id']},'raw':!![]})[_0x04dc('0x16')](handleEntityNotFound(_0x19d573,null))['then'](function(_0x4d429b){if(_0x4d429b){if(_0x4d429b[_0x04dc('0x71')]){return _0x19d573[_0x04dc('0x22')](0x193)[_0x04dc('0x24')]({'status':0x193,'message':'Unauthorized'});}return db[_0x04dc('0x6f')][_0x04dc('0x4d')]({'where':{'id':_0x53f90c[_0x04dc('0x3f')][_0x04dc('0x72')]},'raw':!![]})[_0x04dc('0x16')](handleEntityNotFound(_0x19d573,null));}})[_0x04dc('0x16')](function(_0x1948fb){if(_0x1948fb){var _0x5882a0=_0x1948fb[_0x04dc('0x73')]!==null;var _0x244f72=path[_0x04dc('0x74')](config[_0x04dc('0x75')],_0x04dc('0x76'));if(_0x5882a0){_0x244f72=path[_0x04dc('0x74')](_0x244f72,_0x04dc('0x77'));}var _0x212b44=path['join'](_0x244f72,_0x1948fb[_0x04dc('0x6e')]);return _0x19d573['download'](_0x212b44);}})[_0x04dc('0x20')](handleError(_0x19d573,null));};exports['close']=function(_0x39a152,_0x200d13){var _0x4b6542=null;var _0x57112e=null;var _0x333f74=null;if(_0x39a152['body']['id']){delete _0x39a152['body']['id'];}if(_0x39a152[_0x04dc('0x2f')][_0x04dc('0x78')]){_0x333f74=path[_0x04dc('0x74')](config[_0x04dc('0x75')],'server/files/chat/upload/',util['format']('transcript-%s.txt',Date[_0x04dc('0x79')]()));_0x39a152[_0x04dc('0x2f')][_0x04dc('0x7a')]=_0x333f74;}return db[_0x04dc('0x3e')][_0x04dc('0x47')]({'where':{'id':_0x39a152[_0x04dc('0x3b')]['id']},'include':[{'model':db[_0x04dc('0x61')],'as':_0x04dc('0x7b'),'include':[{'model':db[_0x04dc('0x7c')],'as':_0x04dc('0x7c')}]}]})['then'](handleEntityNotFound(_0x200d13,null))['then'](saveUpdates(_0x39a152[_0x04dc('0x2f')],null))[_0x04dc('0x16')](function(_0x285457){if(_0x285457){_0x4b6542=_0x285457;return db[_0x04dc('0x4e')]['find']({'where':{'id':_0x4b6542[_0x04dc('0x4f')]}});}})[_0x04dc('0x16')](function(_0x1a0704){if(_0x1a0704){_0x57112e=_0x1a0704;return db[_0x04dc('0x7d')][_0x04dc('0x47')]({'where':{'id':_0x4b6542[_0x04dc('0x7e')]}});}})[_0x04dc('0x16')](function(_0x2ab98d){if(_0x2ab98d){if(_0x333f74){var _0x28f626=null;for(var _0x465691=0x1;_0x465691<_0x4b6542[_0x04dc('0x7b')][_0x04dc('0x7f')];++_0x465691){_0x28f626=_0x4b6542['Messages'][_0x465691];var _0x43782e=_0x28f626[_0x04dc('0x68')]?util[_0x04dc('0x80')](_0x04dc('0x81'),_0x57112e[_0x04dc('0x82')],_0x28f626[_0x04dc('0x68')]):_0x04dc('0x83');var _0x453875=_0x39a152['body'][_0x04dc('0x84')]||util[_0x04dc('0x80')]('%s%d',_0x04dc('0x85'),_0x28f626['ContactId']);switch(_0x57112e[_0x04dc('0x86')]){case _0x04dc('0x87'):_0x43782e=_0x28f626['UserId']?util[_0x04dc('0x80')](_0x04dc('0x81'),_0x57112e[_0x04dc('0x82')],_0x28f626['UserId']):'System';break;case'agent_alias':_0x43782e=_0x28f626[_0x04dc('0x68')]?_0x28f626[_0x04dc('0x7c')][_0x04dc('0x88')]||_0x28f626[_0x04dc('0x7c')][_0x04dc('0x55')]:_0x04dc('0x83');break;case _0x04dc('0x89'):_0x43782e=_0x28f626[_0x04dc('0x68')]?_0x28f626[_0x04dc('0x7c')]['fullname']:_0x04dc('0x83');break;default:_0x43782e=_0x28f626['UserId']?util[_0x04dc('0x80')]('%s%d',_0x57112e['agentAlias'],_0x28f626[_0x04dc('0x68')]):_0x04dc('0x83');}var _0x240a6a=util[_0x04dc('0x80')](_0x04dc('0x8a'),moment(_0x28f626[_0x04dc('0x8b')])[_0x04dc('0x80')]('MM/DD/YYYY\x20HH:mm:ss'),_0x28f626[_0x04dc('0x8c')]==='in'?_0x453875:_0x43782e,_0x28f626[_0x04dc('0x2f')]);if(!_0x28f626[_0x04dc('0x8d')]){fs[_0x04dc('0x8e')](_0x333f74,_0x240a6a);}}return db[_0x04dc('0x8f')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x04dc('0x90')],'as':_0x04dc('0x90'),'raw':!![]}]}]});}}})[_0x04dc('0x16')](function(_0x84b7b9){if(!_0x84b7b9||!_0x84b7b9['Smtp']||!_0x39a152[_0x04dc('0x2f')])return _0x4b6542;var _0x1bcf76=_0x84b7b9[_0x04dc('0x91')]();return respondWithRpcPromise(_0x04dc('0x92'),_0x04dc('0x93'),{'account':_0x1bcf76,'message':{'from':util[_0x04dc('0x80')](_0x04dc('0x94'),_0x84b7b9[_0x04dc('0x2b')],_0x84b7b9[_0x04dc('0x56')]||_0x84b7b9['Smtp'][_0x04dc('0x39')]),'to':_0x39a152[_0x04dc('0x2f')][_0x04dc('0x78')],'subject':_0x04dc('0x95'),'text':util['format'](_0x04dc('0x96'),_0x39a152[_0x04dc('0x2f')][_0x04dc('0x78')]),'attachments':[{'path':_0x333f74}]}})[_0x04dc('0x16')](function(){return _0x4b6542;})[_0x04dc('0x20')](function(_0x2a7195){logger[_0x04dc('0x1b')](_0x2a7195);});})[_0x04dc('0x16')](respondWithStatusCode(_0x200d13,0xc8))['catch'](handleError(_0x200d13,null));};exports[_0x04dc('0x97')]=function(_0xae1370,_0x110315){return db[_0x04dc('0x61')]['find']({'where':{'id':_0xae1370[_0x04dc('0x3b')]['id']}})['then'](handleEntityNotFound(_0x110315,null))[_0x04dc('0x16')](function(_0x50cb2f){if(_0x50cb2f){return _0x50cb2f['addMessage'](_0xae1370['body']['ids'],_[_0x04dc('0x98')](_0xae1370[_0x04dc('0x2f')],[_0x04dc('0x99'),'id'])||{});}})[_0x04dc('0x16')](respondWithResult(_0x110315,null))[_0x04dc('0x20')](handleError(_0x110315,null));};exports[_0x04dc('0x9a')]=function(_0x3b2d59,_0x1d3f9b){var _0x99a2cc={'raw':![],'where':{}};var _0x19bf61={};var _0xde2ec4={'count':0x0,'rows':[]};return db[_0x04dc('0x3e')][_0x04dc('0x4d')]({'where':{'id':_0x3b2d59[_0x04dc('0x3b')]['id']}})['then'](handleEntityNotFound(_0x1d3f9b,null))['then'](function(_0x2d6404){if(_0x2d6404){_0x19bf61[_0x04dc('0x3c')]=_['keys'](db[_0x04dc('0x61')]['rawAttributes']);_0x19bf61[_0x04dc('0x3f')]=_[_0x04dc('0x3d')](_0x3b2d59['query']);_0x19bf61['filters']=_[_0x04dc('0x41')](_0x19bf61[_0x04dc('0x3c')],_0x19bf61['query']);_0x99a2cc['attributes']=_['intersection'](_0x19bf61[_0x04dc('0x3c')],qs[_0x04dc('0x43')](_0x3b2d59[_0x04dc('0x3f')][_0x04dc('0x43')]));_0x99a2cc['attributes']=_0x99a2cc[_0x04dc('0x42')]['length']?_0x99a2cc[_0x04dc('0x42')]:_0x19bf61[_0x04dc('0x3c')];if(!_0x3b2d59[_0x04dc('0x3f')][_0x04dc('0x9b')]('nolimit')){_0x99a2cc[_0x04dc('0x26')]=qs['limit'](_0x3b2d59[_0x04dc('0x3f')][_0x04dc('0x26')]);_0x99a2cc[_0x04dc('0x25')]=qs[_0x04dc('0x25')](_0x3b2d59[_0x04dc('0x3f')][_0x04dc('0x25')]);}_0x99a2cc[_0x04dc('0x9c')]=qs[_0x04dc('0x9d')](_0x3b2d59[_0x04dc('0x3f')]['sort']);_0x99a2cc[_0x04dc('0x9e')]=qs[_0x04dc('0x40')](_['pick'](_0x3b2d59['query'],_0x19bf61[_0x04dc('0x40')]));_0x99a2cc[_0x04dc('0x9e')]['ChatInteractionId']=_0x2d6404['id'];if(_0x3b2d59[_0x04dc('0x3f')]['filter']){_0x99a2cc[_0x04dc('0x9e')]=_[_0x04dc('0x2e')](_0x99a2cc[_0x04dc('0x9e')],{'$or':_[_0x04dc('0x34')](_0x99a2cc[_0x04dc('0x42')],function(_0x1e627e){var _0x5b2895={};_0x5b2895[_0x1e627e]={'$like':'%'+_0x3b2d59['query'][_0x04dc('0x9f')]+'%'};return _0x5b2895;})});}if(_0x3b2d59['query']['$gte']){var _0x161cce=_0x3b2d59[_0x04dc('0x3f')][_0x04dc('0xa0')][_0x04dc('0xa1')](',');var _0x3a428f={};_0x3a428f[_0x161cce[0x0]]={'$gte':moment(_0x161cce[0x1])[_0x04dc('0x80')](_0x04dc('0xa2'))};_0x99a2cc[_0x04dc('0x9e')]=_[_0x04dc('0x2e')](_0x99a2cc['where'],_0x3a428f);}_0x99a2cc=_[_0x04dc('0x2e')]({},_0x99a2cc,_0x3b2d59[_0x04dc('0x46')]);return db[_0x04dc('0x61')][_0x04dc('0x27')]({'where':_0x99a2cc[_0x04dc('0x9e')]})[_0x04dc('0x16')](function(_0x119dbc){_0xde2ec4[_0x04dc('0x27')]=_0x119dbc;if(_0x3b2d59[_0x04dc('0x3f')][_0x04dc('0x44')]){_0x99a2cc[_0x04dc('0x45')]=[{'all':!![]}];}return db[_0x04dc('0x61')][_0x04dc('0xa3')](_0x99a2cc);})[_0x04dc('0x16')](function(_0x4dd095){_0xde2ec4[_0x04dc('0xa4')]=_0x4dd095;return _0xde2ec4;});}})['then'](respondWithFilteredResult(_0x1d3f9b,_0x99a2cc))[_0x04dc('0x20')](handleError(_0x1d3f9b,null));};exports[_0x04dc('0xa5')]=function(_0x26e847,_0xb1f572){var _0x3e28aa={'where':{}},_0x105a52={},_0x155f87={'count':0x0,'rows':[]};return db[_0x04dc('0x3e')]['findOne']({'where':{'id':_0x26e847['params']['id']}})['then'](handleEntityNotFound(_0xb1f572,null))['then'](function(_0x346b59){if(_0x346b59){_0x105a52[_0x04dc('0x3c')]=_[_0x04dc('0x3d')](db[_0x04dc('0x61')]['rawAttributes']);_0x105a52[_0x04dc('0x3f')]=_[_0x04dc('0x3d')](_0x26e847[_0x04dc('0x3f')]);_0x105a52['filters']=_[_0x04dc('0x41')](_0x105a52['model'],_0x105a52['query']);_0x3e28aa[_0x04dc('0x42')]=_[_0x04dc('0x41')](_0x105a52[_0x04dc('0x3c')],qs[_0x04dc('0x43')](_0x26e847[_0x04dc('0x3f')]['fields']));_0x3e28aa['attributes']=_0x3e28aa[_0x04dc('0x42')][_0x04dc('0x7f')]?_0x3e28aa[_0x04dc('0x42')]:_0x105a52[_0x04dc('0x3c')];if(!_0x26e847[_0x04dc('0x3f')][_0x04dc('0x9b')](_0x04dc('0xa6'))){_0x3e28aa[_0x04dc('0x26')]=qs[_0x04dc('0x26')](_0x26e847[_0x04dc('0x3f')][_0x04dc('0x26')]);_0x3e28aa[_0x04dc('0x25')]=qs[_0x04dc('0x25')](_0x26e847[_0x04dc('0x3f')][_0x04dc('0x25')]);}_0x3e28aa[_0x04dc('0x9c')]=qs[_0x04dc('0x9d')](_0x26e847[_0x04dc('0x3f')][_0x04dc('0x9d')]);_0x3e28aa[_0x04dc('0x9e')]=qs[_0x04dc('0x40')](_[_0x04dc('0xa7')](_0x26e847[_0x04dc('0x3f')],_0x105a52[_0x04dc('0x40')]));_0x3e28aa[_0x04dc('0x9e')][_0x04dc('0xa8')]=_0x346b59['id'];if(_0x26e847[_0x04dc('0x3f')][_0x04dc('0x9f')]){_0x3e28aa['where']=_[_0x04dc('0x2e')](_0x3e28aa[_0x04dc('0x9e')],{'$or':_['map'](_0x3e28aa[_0x04dc('0x42')],function(_0x58da5e){var _0x1bd2b5={};_0x1bd2b5[_0x58da5e]={'$like':'%'+_0x26e847[_0x04dc('0x3f')][_0x04dc('0x9f')]+'%'};return _0x1bd2b5;})});}_0x3e28aa[_0x04dc('0x9e')][_0x04dc('0x8d')]=![];if(_0x26e847[_0x04dc('0x3f')]['id']){_0x3e28aa[_0x04dc('0x9e')]['id']={'$gt':_0x26e847['query']['id']};}_0x3e28aa=_[_0x04dc('0x2e')]({},_0x3e28aa,_0x26e847[_0x04dc('0x46')]);return db[_0x04dc('0x61')][_0x04dc('0x27')]({'where':_0x3e28aa['where']})['then'](function(_0x35691b){_0x155f87[_0x04dc('0x27')]=_0x35691b;_0x3e28aa[_0x04dc('0x45')]=[];if(_0x26e847['query']['includeAgent']){_0x3e28aa[_0x04dc('0x45')][_0x04dc('0xa9')]({'model':db[_0x04dc('0x7c')],'as':_0x04dc('0x7c'),'attributes':['id',_0x04dc('0x55'),_0x04dc('0x88')]});}if(_0x26e847['query'][_0x04dc('0x44')]){_0x3e28aa[_0x04dc('0x45')]=[{'all':!![]}];}return db[_0x04dc('0x61')][_0x04dc('0xa3')](_0x3e28aa);})['then'](function(_0xa219d5){_0x155f87[_0x04dc('0xa4')]=_0xa219d5;return _0x155f87;});}})[_0x04dc('0x16')](respondWithFilteredResult(_0xb1f572,_0x3e28aa))[_0x04dc('0x20')](handleError(_0xb1f572,null));};exports['addTags']=function(_0x52a3f7,_0x560069){return db[_0x04dc('0x3e')][_0x04dc('0x47')]({'where':{'id':_0x52a3f7[_0x04dc('0x3b')]['id']}})['then'](handleEntityNotFound(_0x560069,null))[_0x04dc('0x16')](function(_0xaecba4){if(_0xaecba4){return _0xaecba4[_0x04dc('0xaa')](_0x52a3f7[_0x04dc('0x2f')][_0x04dc('0x99')],_['omit'](_0x52a3f7[_0x04dc('0x2f')],[_0x04dc('0x99'),'id'])||{})['spread'](function(){return db[_0x04dc('0xab')][_0x04dc('0xa3')]({'attributes':['id',_0x04dc('0x2b'),_0x04dc('0xac')],'where':{'id':_0x52a3f7[_0x04dc('0x2f')]['ids']}});})[_0x04dc('0x16')](function(_0x602284){socket[_0x04dc('0xad')](_0x04dc('0xae'),{'id':Number(_0x52a3f7['params']['id']),'tags':_0x602284||[]});return{'id':Number(_0x52a3f7[_0x04dc('0x3b')]['id']),'tags':_0x602284||[]};});}})['then'](respondWithResult(_0x560069,null))[_0x04dc('0x20')](handleError(_0x560069,null));};exports[_0x04dc('0xaf')]=function(_0x36c31d,_0x310f3c){return db[_0x04dc('0x3e')][_0x04dc('0x47')]({'where':{'id':_0x36c31d[_0x04dc('0x3b')]['id']}})[_0x04dc('0x16')](handleEntityNotFound(_0x310f3c,null))[_0x04dc('0x16')](function(_0x5181b3){if(_0x5181b3){return _0x5181b3[_0x04dc('0xaf')](_0x36c31d['query']['ids']);}})['then'](respondWithStatusCode(_0x310f3c,null))[_0x04dc('0x20')](handleError(_0x310f3c,null));};exports['download']=function(_0x4db98f,_0xe71324){var _0x90b90=moment()[_0x04dc('0xb0')]()['toString']();var _0x39fd99=path[_0x04dc('0x74')](config[_0x04dc('0x75')],_0x04dc('0xb1'),_0x04dc('0xb2'),_0x04dc('0xb3'));var _0x14e602=path[_0x04dc('0x74')](config[_0x04dc('0x75')],'server','files','attachments');var _0x324247=path['join'](_0x39fd99,_0x90b90);var _0xb84238=util[_0x04dc('0x80')](_0x04dc('0xb4'),_0x4db98f[_0x04dc('0x3b')]['id'],_0x90b90);var _0x1a42f2=path['join'](_0x39fd99,_0xb84238);var _0x5d6ae9=[];_0x5d6ae9[_0x04dc('0xa9')]({'model':db[_0x04dc('0x7c')],'as':_0x04dc('0x7c'),'attributes':['id',_0x04dc('0x55')],'raw':!![]});_0x5d6ae9[_0x04dc('0xa9')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x04dc('0xb5'),_0x04dc('0xb6')],'raw':!![]});if(_0x4db98f['query']['attachments']){_0x5d6ae9['push']({'model':db['Attachment'],'as':_0x04dc('0x6f'),'raw':!![]});}var _0x5cf151=[{'model':db[_0x04dc('0x61')],'as':_0x04dc('0x7b'),'attributes':['id','body','createdAt',_0x04dc('0x8c'),_0x04dc('0x8d'),_0x04dc('0xb7')],'include':_0x5d6ae9}];_0x5cf151[_0x04dc('0xa9')]({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0x04dc('0x2b')]});_0x5cf151[_0x04dc('0xa9')]({'model':db[_0x04dc('0x7c')],'as':_0x04dc('0xb8'),'attributes':['id',_0x04dc('0x55')]});return db[_0x04dc('0x3e')][_0x04dc('0x47')]({'where':{'id':_0x4db98f['params']['id']},'include':_0x5cf151})[_0x04dc('0x16')](handleEntityNotFound(_0xe71324,null))[_0x04dc('0x16')](function(_0x14bd5e){if(_0x14bd5e){var _0x10e98a=_0x14bd5e[_0x04dc('0xb9')]({'plain':!![]});fs[_0x04dc('0xba')](_0x324247);var _0x303e1d={'channel':_0x04dc('0xbb'),'account':_0x10e98a['Account'][_0x04dc('0x2b')],'agent':_0x10e98a[_0x04dc('0xb8')]?_0x10e98a[_0x04dc('0xb8')][_0x04dc('0x55')]:_0x04dc('0xbc'),'createdAt':moment(_0x10e98a['createdAt'])[_0x04dc('0x80')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x10e98a[_0x04dc('0x71')]?moment(_0x10e98a[_0x04dc('0xbd')])[_0x04dc('0x80')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x10e98a[_0x04dc('0xbe')],'chatInfo':{'browser':_0x10e98a[_0x04dc('0xbf')],'os':_0x10e98a[_0x04dc('0xc0')],'referer':_0x10e98a[_0x04dc('0xc1')],'customerIp':_0x10e98a['customerIp'],'customerPort':_0x10e98a[_0x04dc('0xc2')]?_0x10e98a['customerPort']:_0x04dc('0xbc')},'messages':_(_0x10e98a[_0x04dc('0x7b')])[_0x04dc('0xc3')]()[_0x04dc('0x9f')]({'secret':![]})[_0x04dc('0x34')](function(_0x551102){if(_0x551102[_0x04dc('0x6f')]){var _0x5876c3=path[_0x04dc('0x74')](_0x14e602,_0x551102[_0x04dc('0x6f')]['basename']);if(fs[_0x04dc('0xc4')](_0x5876c3)){fs[_0x04dc('0xc5')](_0x5876c3)[_0x04dc('0xc6')](fs[_0x04dc('0xc7')](path['join'](_0x324247,_0x551102[_0x04dc('0x6f')]['basename'])));}}return{'date':moment(_0x551102[_0x04dc('0x8b')])[_0x04dc('0x80')](_0x04dc('0xa2'))['toString'](),'sender':_0x551102[_0x04dc('0x8c')]===_0x04dc('0x60')?_0x551102[_0x04dc('0x7c')]?_0x551102['User']['fullname']:_0x04dc('0x83'):_0x551102[_0x04dc('0xc8')][_0x04dc('0xb5')]+(_0x551102['Contact'][_0x04dc('0xb6')]?'\x20'+_0x551102['Contact'][_0x04dc('0xb6')]:''),'body':_0x551102[_0x04dc('0x6f')]?_0x551102['Attachment']['basename']:_0x551102[_0x04dc('0x2f')],'direction':_0x551102[_0x04dc('0x8c')]===_0x04dc('0x60')?'A':'C','secret':_0x551102['secret'],'read':_0x551102[_0x04dc('0xb7')],'attachment':_0x551102[_0x04dc('0x6f')]};})[_0x04dc('0xc9')]()};return ejs['renderFile'](path[_0x04dc('0x74')](config[_0x04dc('0x75')],'server',_0x04dc('0xca'),_0x04dc('0xcb')),{'interaction':_0x303e1d})[_0x04dc('0x16')](function(_0x54549b){var _0x4d84c5=path[_0x04dc('0x74')](_0x324247,'transcript-'+_0x10e98a['id']+'-'+_0x90b90+_0x04dc('0xcc'));var _0x392c7d={'path':_0x4d84c5,'channel':_0x04dc('0xbb'),'interactionId':_0x10e98a['id']};return pdf[_0x04dc('0xcd')](_0x54549b,_0x392c7d);})[_0x04dc('0x16')](function(){return new Promise(function(_0x3670dd,_0x1a53d2){zipdir(_0x324247,{'saveTo':_0x1a42f2},function(_0xe095b2,_0x204817){if(_0xe095b2)return _0x1a53d2(_0xe095b2);return _0x3670dd(_0x204817);});})['then'](function(){return new BPromise(function(_0x42d3a5,_0x1845bd){rimraf(_0x324247,function(_0x4ec2d7){if(_0x4ec2d7)_0x1845bd(_0x4ec2d7);return _0x42d3a5();});});})[_0x04dc('0x16')](function(){return _0xe71324[_0x04dc('0xce')](_0x1a42f2,_0xb84238,function(_0x4534d0){if(_0x4534d0){logger[_0x04dc('0x1b')](_0x04dc('0xcf'),_0x4534d0);}else{fs[_0x04dc('0xd0')](_0x1a42f2);}});});});}else{return _0xe71324[_0x04dc('0x21')](0xc8);}})[_0x04dc('0x20')](handleError(_0xe71324,null));}; \ No newline at end of file +var _0x48c7=['includeAgent','setTags','Tag','color','emit','removeTags','unix','toString','server','files','transcript-%d-%s.zip','push','firstName','lastName','read','Account','Owner','get','mkdirSync','closedAt','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Chat','err','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','../../components/interaction/service','../../components/parsers/qs','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','destroy','stack','name','send','render','body','contact','account','map','ChatInteraction','fieldName','type','key','getOptions','chat','user','show','params','model','rawAttributes','query','keys','filters','fields','attributes','length','includeAll','include','merge','options','find','create','describe','findOne','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooApiKey','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','closed','disposition','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','join','server/files/attachments/','offline-chat/','download','close','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','User','ContactId','Messages','agentAlias','Visitor','agentIdentifier','website_alias','%s%d','System','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','intersection','sort','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','hasOwnProperty','nolimit','order','pick','secret'];(function(_0x5637bf,_0x43fde4){var _0x56852a=function(_0x315f99){while(--_0x315f99){_0x5637bf['push'](_0x5637bf['shift']());}};_0x56852a(++_0x43fde4);}(_0x48c7,0x1c3));var _0x748c=function(_0x5285f9,_0x2bd7d7){_0x5285f9=_0x5285f9-0x0;var _0x6edc0c=_0x48c7[_0x5285f9];return _0x6edc0c;};'use strict';var rimraf=require(_0x748c('0x0'));var zipdir=require('zip-dir');var rp=require(_0x748c('0x1'));var moment=require(_0x748c('0x2'));var BPromise=require(_0x748c('0x3'));var Mustache=require(_0x748c('0x4'));var util=require(_0x748c('0x5'));var path=require(_0x748c('0x6'));var ejs=require(_0x748c('0x7'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x748c('0x8'));var qs=require(_0x748c('0x9'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x748c('0xa'));var config=require('../../config/environment');var db=require(_0x748c('0xb'))['db'];config[_0x748c('0xc')]=_[_0x748c('0xd')](config[_0x748c('0xc')],{'host':_0x748c('0xe'),'port':0x18eb});var socket=require(_0x748c('0xf'))(new Redis(config[_0x748c('0xc')]));require(_0x748c('0x10'))[_0x748c('0x11')](socket);var jayson=require(_0x748c('0x12'));var client=jayson[_0x748c('0x13')]['http']({'port':0x232b});var client9004=jayson['client'][_0x748c('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x552d30,_0x3d24f5,_0x5c2290,_0x394188){return new BPromise(function(_0x5b2326,_0x5e6c59){var _0x3cc317=_0x394188||client;return _0x3cc317[_0x748c('0x15')](_0x552d30,_0x5c2290)[_0x748c('0x16')](function(_0x8b4ae3){logger[_0x748c('0x17')](_0x748c('0x18'),_0x3d24f5,_0x748c('0x19'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3d24f5,_0x748c('0x19'),JSON[_0x748c('0x1a')](_0x8b4ae3));if(_0x8b4ae3[_0x748c('0x1b')]){if(_0x8b4ae3[_0x748c('0x1b')][_0x748c('0x1c')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x3d24f5,_0x8b4ae3[_0x748c('0x1b')][_0x748c('0x1d')]);return _0x5e6c59(_0x8b4ae3[_0x748c('0x1b')][_0x748c('0x1d')]);}logger['error'](_0x748c('0x18'),_0x3d24f5,_0x8b4ae3[_0x748c('0x1b')][_0x748c('0x1d')]);return _0x5b2326(_0x8b4ae3[_0x748c('0x1b')][_0x748c('0x1d')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x3d24f5,'request\x20sent');_0x5b2326(_0x8b4ae3[_0x748c('0x1e')][_0x748c('0x1d')]);}})[_0x748c('0x1f')](function(_0x23e44c){logger['error'](_0x748c('0x18'),_0x3d24f5,_0x23e44c);_0x5e6c59(_0x23e44c);});});}function respondWithStatusCode(_0x5579e1,_0x2ee69f){_0x2ee69f=_0x2ee69f||0xcc;return function(_0xf54003){if(_0xf54003){return _0x5579e1[_0x748c('0x20')](_0x2ee69f);}return _0x5579e1[_0x748c('0x21')](_0x2ee69f)[_0x748c('0x22')]();};}function respondWithResult(_0x3e1406,_0x1043c7){_0x1043c7=_0x1043c7||0xc8;return function(_0x1ce179){if(_0x1ce179){return _0x3e1406[_0x748c('0x21')](_0x1043c7)[_0x748c('0x23')](_0x1ce179);}};}function respondWithFilteredResult(_0x3976aa,_0x3da752){return function(_0x5c7a80){if(_0x5c7a80){var _0x530707=typeof _0x3da752['offset']===_0x748c('0x24')&&typeof _0x3da752[_0x748c('0x25')]===_0x748c('0x24');var _0x37f20e=_0x5c7a80[_0x748c('0x26')];var _0x37d6ef=_0x530707?0x0:_0x3da752['offset'];var _0x386e9a=_0x530707?_0x5c7a80[_0x748c('0x26')]:_0x3da752[_0x748c('0x27')]+_0x3da752['limit'];var _0x420fde;if(_0x386e9a>=_0x37f20e){_0x386e9a=_0x37f20e;_0x420fde=0xc8;}else{_0x420fde=0xce;}_0x3976aa[_0x748c('0x21')](_0x420fde);return _0x3976aa[_0x748c('0x28')](_0x748c('0x29'),_0x37d6ef+'-'+_0x386e9a+'/'+_0x37f20e)[_0x748c('0x23')](_0x5c7a80);}return null;};}function saveUpdates(_0xb7a6c7){return function(_0x3cfe2a){if(_0x3cfe2a){return _0x3cfe2a[_0x748c('0x2a')](_0xb7a6c7)[_0x748c('0x16')](function(_0x2a3801){return _0x2a3801;});}return null;};}function removeEntity(_0x50d8bf){return function(_0x1ea6b0){if(_0x1ea6b0){return _0x1ea6b0[_0x748c('0x2b')]()[_0x748c('0x16')](function(){_0x50d8bf[_0x748c('0x21')](0xcc)[_0x748c('0x22')]();});}};}function handleEntityNotFound(_0x2bc698){return function(_0xdd9dc6){if(!_0xdd9dc6){_0x2bc698[_0x748c('0x20')](0x194);}return _0xdd9dc6;};}function handleError(_0x3e6532,_0x11a48f){_0x11a48f=_0x11a48f||0x1f4;return function(_0xad7e0c){logger['error'](_0xad7e0c[_0x748c('0x2c')]);if(_0xad7e0c[_0x748c('0x2d')]){delete _0xad7e0c[_0x748c('0x2d')];}_0x3e6532[_0x748c('0x21')](_0x11a48f)[_0x748c('0x2e')](_0xad7e0c);};}function getMustacheRender(_0x5551af,_0x59e779){return Mustache[_0x748c('0x2f')](_0x5551af,_['merge'](_0x59e779[_0x748c('0x30')],{'contact':_0x59e779[_0x748c('0x31')],'message':_0x59e779[_0x748c('0x1d')],'agent':_0x59e779['agent'],'interaction':_0x59e779['interaction'],'account':_0x59e779[_0x748c('0x32')]}))||'';}exports['index']=function(_0x2af656,_0x4deab3){var _0xce15cd={};var _0x3d68ab=_[_0x748c('0x33')](db[_0x748c('0x34')]['rawAttributes'],function(_0x27bd22){return{'name':_0x27bd22[_0x748c('0x35')],'type':_0x27bd22[_0x748c('0x36')][_0x748c('0x37')]};});_0xce15cd=qs[_0x748c('0x38')](_0x3d68ab,_0x2af656);return interaction['findAll'](_0x748c('0x39'),_0x2af656['query'],_0x2af656[_0x748c('0x3a')],_0xce15cd,_0x3d68ab)[_0x748c('0x16')](respondWithFilteredResult(_0x4deab3,_0xce15cd))[_0x748c('0x1f')](handleError(_0x4deab3,null));};exports[_0x748c('0x3b')]=function(_0x4cf2ce,_0x22d125){var _0x26a1d5={'raw':![],'where':{'id':_0x4cf2ce[_0x748c('0x3c')]['id']}},_0x34f57c={};_0x34f57c[_0x748c('0x3d')]=_['keys'](db[_0x748c('0x34')][_0x748c('0x3e')]);_0x34f57c[_0x748c('0x3f')]=_[_0x748c('0x40')](_0x4cf2ce[_0x748c('0x3f')]);_0x34f57c[_0x748c('0x41')]=_['intersection'](_0x34f57c[_0x748c('0x3d')],_0x34f57c[_0x748c('0x3f')]);_0x26a1d5['attributes']=_['intersection'](_0x34f57c[_0x748c('0x3d')],qs[_0x748c('0x42')](_0x4cf2ce[_0x748c('0x3f')][_0x748c('0x42')]));_0x26a1d5[_0x748c('0x43')]=_0x26a1d5['attributes'][_0x748c('0x44')]?_0x26a1d5[_0x748c('0x43')]:_0x34f57c[_0x748c('0x3d')];if(_0x4cf2ce[_0x748c('0x3f')][_0x748c('0x45')]){_0x26a1d5[_0x748c('0x46')]=[{'all':!![]}];}_0x26a1d5=_[_0x748c('0x47')]({},_0x26a1d5,_0x4cf2ce[_0x748c('0x48')]);return db[_0x748c('0x34')][_0x748c('0x49')](_0x26a1d5)[_0x748c('0x16')](handleEntityNotFound(_0x22d125,null))['then'](respondWithResult(_0x22d125,null))[_0x748c('0x1f')](handleError(_0x22d125,null));};exports[_0x748c('0x4a')]=function(_0x52599c,_0x561f81){return db[_0x748c('0x34')][_0x748c('0x4a')](_0x52599c['body'],{})[_0x748c('0x16')](respondWithResult(_0x561f81,0xc9))[_0x748c('0x1f')](handleError(_0x561f81,null));};exports[_0x748c('0x2a')]=function(_0x4d0a50,_0x56d1c1){if(_0x4d0a50[_0x748c('0x30')]['id']){delete _0x4d0a50[_0x748c('0x30')]['id'];}return db[_0x748c('0x34')][_0x748c('0x49')]({'where':{'id':_0x4d0a50[_0x748c('0x3c')]['id']}})[_0x748c('0x16')](handleEntityNotFound(_0x56d1c1,null))[_0x748c('0x16')](saveUpdates(_0x4d0a50['body'],null))[_0x748c('0x16')](respondWithResult(_0x56d1c1,null))['catch'](handleError(_0x56d1c1,null));};exports['destroy']=function(_0x14670d,_0x13fd26){return db['ChatInteraction'][_0x748c('0x49')]({'where':{'id':_0x14670d[_0x748c('0x3c')]['id']}})['then'](handleEntityNotFound(_0x13fd26,null))[_0x748c('0x16')](removeEntity(_0x13fd26,null))[_0x748c('0x1f')](handleError(_0x13fd26,null));};exports[_0x748c('0x4b')]=function(_0x3029f9,_0x52c7d6){return db[_0x748c('0x34')][_0x748c('0x4b')]()[_0x748c('0x16')](respondWithResult(_0x52c7d6,null))[_0x748c('0x1f')](handleError(_0x52c7d6,null));};exports['createVidaooSession']=function(_0x3c5b46,_0x3088a5){var _0x2e8f67=_0x3c5b46[_0x748c('0x3c')]['id'];var _0x4f342a;var _0xffc2c3;var _0x514825;return db['ChatInteraction'][_0x748c('0x4c')]({'where':{'id':_0x2e8f67}})[_0x748c('0x16')](function(_0x125857){_0x4f342a=_0x125857;return db['ChatWebsite'][_0x748c('0x4c')]({'where':{'id':_0x125857[_0x748c('0x4d')]},'attributes':['id','vidaooApiKey',_0x748c('0x4e'),_0x748c('0x4f'),_0x748c('0x50'),_0x748c('0x51')],'raw':!![]});})[_0x748c('0x16')](function(_0xe65988){if(_0xe65988&&_0xe65988['vidaooApiKey']&&_0xe65988[_0x748c('0x4e')]){_0xffc2c3=_0xe65988;var _0x295c9c={'interaction':{'id':_0x2e8f67},'agent':{'id':_0x3c5b46[_0x748c('0x3a')]['id'],'name':_0x3c5b46['user']['name'],'fullname':_0x3c5b46[_0x748c('0x3a')][_0x748c('0x52')],'email':_0x3c5b46[_0x748c('0x3a')][_0x748c('0x53')]},'contact':_0x3c5b46[_0x748c('0x30')][_0x748c('0x31')],'account':_0x3c5b46[_0x748c('0x30')][_0x748c('0x32')]};var _0x3e805b={'rejectUnauthorized':![],'method':_0x748c('0x54'),'url':_0x748c('0x55'),'headers':{'X-APIKEY':_0xe65988[_0x748c('0x56')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3c5b46[_0x748c('0x3a')][_0x748c('0x53')]],'buttons':null,'topic':_0xffc2c3[_0x748c('0x4f')],'note':_[_0x748c('0x57')](_0xffc2c3['vidaooNote'])?null:getMustacheRender(_0xffc2c3[_0x748c('0x50')],_0x295c9c),'metadata':null},'redirect':_0x748c('0x58'),'json':!![]};try{if(!_[_0x748c('0x57')](_0xffc2c3['vidaooMetadata'])){var _0x20e454=getMustacheRender(_0xffc2c3[_0x748c('0x51')],_0x295c9c);var _0x13c4e2=JSON[_0x748c('0x59')](_0x20e454);_0x3e805b['body'][_0x748c('0x5a')]=_0x13c4e2;}}catch(_0x188633){throw new db[(_0x748c('0x5b'))][(_0x748c('0x5c'))](_0x748c('0x5d'));}return rp(_0x3e805b);}else{throw new db['Sequelize'][(_0x748c('0x5c'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x1cf4ac){_0x514825=_0x1cf4ac;if(_0x514825['id']){var _0x5e55fc={'body':_0x514825['join_url'],'ChatWebsiteId':_0xffc2c3['id'],'ChatInteractionId':_0x4f342a['id'],'direction':'out','UserId':_0x3c5b46['user']['id']};return db[_0x748c('0x5e')][_0x748c('0x4a')](_0x5e55fc,{});}else{throw new db[(_0x748c('0x5b'))][(_0x748c('0x5c'))](_0x748c('0x5f'));}})[_0x748c('0x16')](function(){return _0x4f342a[_0x748c('0x60')]({'vidaooSessionId':_0x514825['id']});})['then'](respondWithResult(_0x3088a5,null))[_0x748c('0x1f')](handleError(_0x3088a5,null));};exports[_0x748c('0x61')]=function(_0x161cef,_0xf19973){if(_0x161cef[_0x748c('0x30')]['id']){delete _0x161cef[_0x748c('0x30')]['id'];}return db[_0x748c('0x34')][_0x748c('0x49')]({'where':{'id':_0x161cef['params']['id']},'include':[{'model':db[_0x748c('0x62')],'as':_0x748c('0x63')}]})[_0x748c('0x16')](handleEntityNotFound(_0xf19973,null))[_0x748c('0x16')](saveUpdates(_0x161cef[_0x748c('0x30')],null))['then'](respondWithResult(_0xf19973,null))[_0x748c('0x1f')](handleError(_0xf19973,null));};exports[_0x748c('0x64')]=function(_0x3404c5,_0x59e2ba){if(_0x3404c5[_0x748c('0x30')]['id']){delete _0x3404c5[_0x748c('0x30')]['id'];}return db[_0x748c('0x34')][_0x748c('0x49')]({'where':{'id':_0x3404c5[_0x748c('0x3c')]['id']}})[_0x748c('0x16')](function(_0xc6e39b){if(!_0xc6e39b){logger['error'](_0x748c('0x65'),'abandon',0x194,_0x748c('0x66'));_0x59e2ba['sendStatus'](0x194);}else{if(_0xc6e39b[_0x748c('0x67')]){throw new db[(_0x748c('0x5b'))][(_0x748c('0x5c'))]('Interaction\x20already\x20assigned');}}return _0xc6e39b;})[_0x748c('0x16')](function(_0x4ae3fc){if(_0x4ae3fc){return _0x4ae3fc[_0x748c('0x2a')]({'closed':_0x3404c5[_0x748c('0x30')][_0x748c('0x68')],'disposition':_0x3404c5[_0x748c('0x30')][_0x748c('0x69')]})[_0x748c('0x16')](function(_0x39d0bf){return _0x39d0bf;});}})[_0x748c('0x16')](function(){return respondWithRpcPromise(_0x748c('0x6a'),'abandon',_0x3404c5['body'],client9004);})[_0x748c('0x16')](respondWithResult(_0x59e2ba,null))[_0x748c('0x1f')](handleError(_0x59e2ba,null));};exports[_0x748c('0x6b')]=function(_0x427b49,_0x47784c){_0x427b49[_0x748c('0x30')][_0x748c('0x2d')]=_0x427b49['file'][_0x748c('0x6c')];_0x427b49[_0x748c('0x30')][_0x748c('0x6d')]=_0x427b49[_0x748c('0x6e')][_0x748c('0x6f')];_0x427b49[_0x748c('0x30')][_0x748c('0x36')]=_0x427b49['file'][_0x748c('0x70')];return db[_0x748c('0x71')][_0x748c('0x4a')](_0x427b49[_0x748c('0x30')])[_0x748c('0x16')](respondWithResult(_0x47784c,0xc9))[_0x748c('0x1f')](handleError(_0x47784c,null));};exports[_0x748c('0x72')]=function(_0x191bcd,_0x587fa5){return db[_0x748c('0x34')][_0x748c('0x4c')]({'where':{'id':_0x191bcd[_0x748c('0x3c')]['id']},'raw':!![]})[_0x748c('0x16')](handleEntityNotFound(_0x587fa5,null))[_0x748c('0x16')](function(_0x88b355){if(_0x88b355){if(_0x88b355[_0x748c('0x68')]){return _0x587fa5[_0x748c('0x21')](0x193)[_0x748c('0x23')]({'status':0x193,'message':_0x748c('0x73')});}return db[_0x748c('0x71')][_0x748c('0x4c')]({'where':{'id':_0x191bcd[_0x748c('0x3f')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x587fa5,null));}})['then'](function(_0x269b89){if(_0x269b89){var _0x3648d3=_0x269b89['ChatOfflineMessageId']!==null;var _0x2a3b88=path[_0x748c('0x74')](config['root'],_0x748c('0x75'));if(_0x3648d3){_0x2a3b88=path[_0x748c('0x74')](_0x2a3b88,_0x748c('0x76'));}var _0x27cee3=path[_0x748c('0x74')](_0x2a3b88,_0x269b89[_0x748c('0x6d')]);return _0x587fa5[_0x748c('0x77')](_0x27cee3);}})['catch'](handleError(_0x587fa5,null));};exports[_0x748c('0x78')]=function(_0x548ae1,_0x1fade1){var _0x391f39=null;var _0x47d239=null;var _0x29a62d=null;if(_0x548ae1['body']['id']){delete _0x548ae1['body']['id'];}if(_0x548ae1[_0x748c('0x30')]['mailTranscript']){_0x29a62d=path[_0x748c('0x74')](config[_0x748c('0x79')],_0x748c('0x7a'),util[_0x748c('0x7b')](_0x748c('0x7c'),Date[_0x748c('0x7d')]()));_0x548ae1[_0x748c('0x30')][_0x748c('0x7e')]=_0x29a62d;}return db[_0x748c('0x34')][_0x748c('0x49')]({'where':{'id':_0x548ae1[_0x748c('0x3c')]['id']},'include':[{'model':db[_0x748c('0x5e')],'as':'Messages','include':[{'model':db[_0x748c('0x7f')],'as':_0x748c('0x7f')}]}]})[_0x748c('0x16')](handleEntityNotFound(_0x1fade1,null))[_0x748c('0x16')](saveUpdates(_0x548ae1[_0x748c('0x30')],null))[_0x748c('0x16')](function(_0x1c331c){if(_0x1c331c){_0x391f39=_0x1c331c;return db['ChatWebsite'][_0x748c('0x49')]({'where':{'id':_0x391f39['ChatWebsiteId']}});}})[_0x748c('0x16')](function(_0x1fe033){if(_0x1fe033){_0x47d239=_0x1fe033;return db[_0x748c('0x62')][_0x748c('0x49')]({'where':{'id':_0x391f39[_0x748c('0x80')]}});}})[_0x748c('0x16')](function(_0x339a03){if(_0x339a03){if(_0x29a62d){var _0x5c0dc8=null;for(var _0x4b7fc5=0x1;_0x4b7fc5<_0x391f39[_0x748c('0x81')]['length'];++_0x4b7fc5){_0x5c0dc8=_0x391f39[_0x748c('0x81')][_0x4b7fc5];var _0x468208=_0x5c0dc8['UserId']?util[_0x748c('0x7b')]('%s%d',_0x47d239[_0x748c('0x82')],_0x5c0dc8[_0x748c('0x67')]):'System';var _0x50e2fc=_0x548ae1[_0x748c('0x30')]['customer']||util['format']('%s%d',_0x748c('0x83'),_0x5c0dc8[_0x748c('0x80')]);switch(_0x47d239[_0x748c('0x84')]){case _0x748c('0x85'):_0x468208=_0x5c0dc8['UserId']?util[_0x748c('0x7b')](_0x748c('0x86'),_0x47d239['agentAlias'],_0x5c0dc8[_0x748c('0x67')]):_0x748c('0x87');break;case _0x748c('0x88'):_0x468208=_0x5c0dc8[_0x748c('0x67')]?_0x5c0dc8[_0x748c('0x7f')][_0x748c('0x89')]||_0x5c0dc8[_0x748c('0x7f')][_0x748c('0x52')]:_0x748c('0x87');break;case'agent_fullname':_0x468208=_0x5c0dc8['UserId']?_0x5c0dc8[_0x748c('0x7f')][_0x748c('0x52')]:'System';break;default:_0x468208=_0x5c0dc8[_0x748c('0x67')]?util[_0x748c('0x7b')](_0x748c('0x86'),_0x47d239[_0x748c('0x82')],_0x5c0dc8[_0x748c('0x67')]):_0x748c('0x87');}var _0x1140ee=util[_0x748c('0x7b')](_0x748c('0x8a'),moment(_0x5c0dc8[_0x748c('0x8b')])[_0x748c('0x7b')](_0x748c('0x8c')),_0x5c0dc8[_0x748c('0x8d')]==='in'?_0x50e2fc:_0x468208,_0x5c0dc8[_0x748c('0x30')]);if(!_0x5c0dc8['secret']){fs['appendFileSync'](_0x29a62d,_0x1140ee);}}return db[_0x748c('0x8e')][_0x748c('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0x748c('0x8f')],'as':_0x748c('0x90'),'raw':!![],'include':[{'model':db[_0x748c('0x91')],'as':_0x748c('0x91'),'raw':!![]}]}]});}}})['then'](function(_0x5ebb4c){if(!_0x5ebb4c||!_0x5ebb4c[_0x748c('0x90')]||!_0x548ae1[_0x748c('0x30')])return _0x391f39;var _0x5ab3a3=_0x5ebb4c[_0x748c('0x92')]();return respondWithRpcPromise(_0x748c('0x93'),_0x748c('0x94'),{'account':_0x5ab3a3,'message':{'from':util[_0x748c('0x7b')](_0x748c('0x95'),_0x5ebb4c[_0x748c('0x2d')],_0x5ebb4c[_0x748c('0x53')]||_0x5ebb4c[_0x748c('0x90')]['user']),'to':_0x548ae1[_0x748c('0x30')][_0x748c('0x96')],'subject':_0x748c('0x97'),'text':util['format'](_0x748c('0x98'),_0x548ae1['body'][_0x748c('0x96')]),'attachments':[{'path':_0x29a62d}]}})[_0x748c('0x16')](function(){return _0x391f39;})['catch'](function(_0x43f612){logger[_0x748c('0x1b')](_0x43f612);});})[_0x748c('0x16')](respondWithStatusCode(_0x1fade1,0xc8))[_0x748c('0x1f')](handleError(_0x1fade1,null));};exports[_0x748c('0x99')]=function(_0x5b40a0,_0x11362a){return db['ChatMessage']['find']({'where':{'id':_0x5b40a0['params']['id']}})[_0x748c('0x16')](handleEntityNotFound(_0x11362a,null))[_0x748c('0x16')](function(_0x245445){if(_0x245445){return _0x245445[_0x748c('0x99')](_0x5b40a0['body']['ids'],_['omit'](_0x5b40a0[_0x748c('0x30')],[_0x748c('0x9a'),'id'])||{});}})[_0x748c('0x16')](respondWithResult(_0x11362a,null))['catch'](handleError(_0x11362a,null));};exports[_0x748c('0x9b')]=function(_0x49b2fb,_0x2b652f){var _0x57c2ac={'raw':![],'where':{}};var _0x1f2379={};var _0x11a3da={'count':0x0,'rows':[]};return db[_0x748c('0x34')][_0x748c('0x4c')]({'where':{'id':_0x49b2fb['params']['id']}})[_0x748c('0x16')](handleEntityNotFound(_0x2b652f,null))[_0x748c('0x16')](function(_0xc14dd6){if(_0xc14dd6){_0x1f2379[_0x748c('0x3d')]=_[_0x748c('0x40')](db['ChatMessage']['rawAttributes']);_0x1f2379['query']=_['keys'](_0x49b2fb['query']);_0x1f2379[_0x748c('0x41')]=_[_0x748c('0x9c')](_0x1f2379[_0x748c('0x3d')],_0x1f2379['query']);_0x57c2ac[_0x748c('0x43')]=_[_0x748c('0x9c')](_0x1f2379[_0x748c('0x3d')],qs[_0x748c('0x42')](_0x49b2fb[_0x748c('0x3f')][_0x748c('0x42')]));_0x57c2ac[_0x748c('0x43')]=_0x57c2ac[_0x748c('0x43')][_0x748c('0x44')]?_0x57c2ac[_0x748c('0x43')]:_0x1f2379[_0x748c('0x3d')];if(!_0x49b2fb[_0x748c('0x3f')]['hasOwnProperty']('nolimit')){_0x57c2ac[_0x748c('0x25')]=qs[_0x748c('0x25')](_0x49b2fb[_0x748c('0x3f')]['limit']);_0x57c2ac[_0x748c('0x27')]=qs[_0x748c('0x27')](_0x49b2fb[_0x748c('0x3f')]['offset']);}_0x57c2ac['order']=qs[_0x748c('0x9d')](_0x49b2fb[_0x748c('0x3f')][_0x748c('0x9d')]);_0x57c2ac[_0x748c('0x9e')]=qs[_0x748c('0x41')](_['pick'](_0x49b2fb['query'],_0x1f2379[_0x748c('0x41')]));_0x57c2ac[_0x748c('0x9e')][_0x748c('0x9f')]=_0xc14dd6['id'];if(_0x49b2fb[_0x748c('0x3f')][_0x748c('0xa0')]){_0x57c2ac[_0x748c('0x9e')]=_[_0x748c('0x47')](_0x57c2ac[_0x748c('0x9e')],{'$or':_[_0x748c('0x33')](_0x57c2ac[_0x748c('0x43')],function(_0x215f11){var _0x317f4a={};_0x317f4a[_0x215f11]={'$like':'%'+_0x49b2fb['query'][_0x748c('0xa0')]+'%'};return _0x317f4a;})});}if(_0x49b2fb[_0x748c('0x3f')][_0x748c('0xa1')]){var _0x379f14=_0x49b2fb[_0x748c('0x3f')][_0x748c('0xa1')][_0x748c('0xa2')](',');var _0x29a108={};_0x29a108[_0x379f14[0x0]]={'$gte':moment(_0x379f14[0x1])[_0x748c('0x7b')](_0x748c('0xa3'))};_0x57c2ac[_0x748c('0x9e')]=_['merge'](_0x57c2ac[_0x748c('0x9e')],_0x29a108);}_0x57c2ac=_[_0x748c('0x47')]({},_0x57c2ac,_0x49b2fb[_0x748c('0x48')]);return db['ChatMessage'][_0x748c('0x26')]({'where':_0x57c2ac[_0x748c('0x9e')]})['then'](function(_0x465230){_0x11a3da[_0x748c('0x26')]=_0x465230;if(_0x49b2fb['query'][_0x748c('0x45')]){_0x57c2ac[_0x748c('0x46')]=[{'all':!![]}];}return db['ChatMessage'][_0x748c('0xa4')](_0x57c2ac);})[_0x748c('0x16')](function(_0xa8d724){_0x11a3da['rows']=_0xa8d724;return _0x11a3da;});}})[_0x748c('0x16')](respondWithFilteredResult(_0x2b652f,_0x57c2ac))[_0x748c('0x1f')](handleError(_0x2b652f,null));};exports['getMyMessages']=function(_0x60b5c1,_0x2e3e66){var _0x395bda={'where':{}},_0x550d43={},_0xa2d4ca={'count':0x0,'rows':[]};return db[_0x748c('0x34')][_0x748c('0x4c')]({'where':{'id':_0x60b5c1[_0x748c('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2e3e66,null))[_0x748c('0x16')](function(_0x1d2180){if(_0x1d2180){_0x550d43[_0x748c('0x3d')]=_[_0x748c('0x40')](db[_0x748c('0x5e')][_0x748c('0x3e')]);_0x550d43[_0x748c('0x3f')]=_['keys'](_0x60b5c1[_0x748c('0x3f')]);_0x550d43[_0x748c('0x41')]=_['intersection'](_0x550d43[_0x748c('0x3d')],_0x550d43[_0x748c('0x3f')]);_0x395bda['attributes']=_[_0x748c('0x9c')](_0x550d43[_0x748c('0x3d')],qs[_0x748c('0x42')](_0x60b5c1[_0x748c('0x3f')][_0x748c('0x42')]));_0x395bda[_0x748c('0x43')]=_0x395bda['attributes'][_0x748c('0x44')]?_0x395bda[_0x748c('0x43')]:_0x550d43[_0x748c('0x3d')];if(!_0x60b5c1[_0x748c('0x3f')][_0x748c('0xa5')](_0x748c('0xa6'))){_0x395bda['limit']=qs[_0x748c('0x25')](_0x60b5c1[_0x748c('0x3f')][_0x748c('0x25')]);_0x395bda[_0x748c('0x27')]=qs[_0x748c('0x27')](_0x60b5c1[_0x748c('0x3f')][_0x748c('0x27')]);}_0x395bda[_0x748c('0xa7')]=qs[_0x748c('0x9d')](_0x60b5c1[_0x748c('0x3f')]['sort']);_0x395bda[_0x748c('0x9e')]=qs[_0x748c('0x41')](_[_0x748c('0xa8')](_0x60b5c1[_0x748c('0x3f')],_0x550d43['filters']));_0x395bda[_0x748c('0x9e')][_0x748c('0x9f')]=_0x1d2180['id'];if(_0x60b5c1[_0x748c('0x3f')][_0x748c('0xa0')]){_0x395bda[_0x748c('0x9e')]=_['merge'](_0x395bda[_0x748c('0x9e')],{'$or':_[_0x748c('0x33')](_0x395bda[_0x748c('0x43')],function(_0x2c1cc6){var _0x492fe4={};_0x492fe4[_0x2c1cc6]={'$like':'%'+_0x60b5c1['query'][_0x748c('0xa0')]+'%'};return _0x492fe4;})});}_0x395bda[_0x748c('0x9e')][_0x748c('0xa9')]=![];if(_0x60b5c1[_0x748c('0x3f')]['id']){_0x395bda[_0x748c('0x9e')]['id']={'$gt':_0x60b5c1[_0x748c('0x3f')]['id']};}_0x395bda=_[_0x748c('0x47')]({},_0x395bda,_0x60b5c1[_0x748c('0x48')]);return db['ChatMessage'][_0x748c('0x26')]({'where':_0x395bda[_0x748c('0x9e')]})[_0x748c('0x16')](function(_0x2e45a4){_0xa2d4ca[_0x748c('0x26')]=_0x2e45a4;_0x395bda[_0x748c('0x46')]=[];if(_0x60b5c1['query'][_0x748c('0xaa')]){_0x395bda['include']['push']({'model':db[_0x748c('0x7f')],'as':_0x748c('0x7f'),'attributes':['id',_0x748c('0x52'),_0x748c('0x89')]});}if(_0x60b5c1[_0x748c('0x3f')][_0x748c('0x45')]){_0x395bda['include']=[{'all':!![]}];}return db['ChatMessage'][_0x748c('0xa4')](_0x395bda);})[_0x748c('0x16')](function(_0x533f34){_0xa2d4ca['rows']=_0x533f34;return _0xa2d4ca;});}})['then'](respondWithFilteredResult(_0x2e3e66,_0x395bda))[_0x748c('0x1f')](handleError(_0x2e3e66,null));};exports['addTags']=function(_0x106fb7,_0x56dd0b){return db[_0x748c('0x34')][_0x748c('0x49')]({'where':{'id':_0x106fb7[_0x748c('0x3c')]['id']}})[_0x748c('0x16')](handleEntityNotFound(_0x56dd0b,null))['then'](function(_0x3c814d){if(_0x3c814d){return _0x3c814d[_0x748c('0xab')](_0x106fb7[_0x748c('0x30')][_0x748c('0x9a')],_['omit'](_0x106fb7['body'],[_0x748c('0x9a'),'id'])||{})['spread'](function(){return db[_0x748c('0xac')][_0x748c('0xa4')]({'attributes':['id',_0x748c('0x2d'),_0x748c('0xad')],'where':{'id':_0x106fb7[_0x748c('0x30')][_0x748c('0x9a')]}});})[_0x748c('0x16')](function(_0x1de4ad){socket[_0x748c('0xae')]('chatInteractionTags:save',{'id':Number(_0x106fb7[_0x748c('0x3c')]['id']),'tags':_0x1de4ad||[]});return{'id':Number(_0x106fb7['params']['id']),'tags':_0x1de4ad||[]};});}})['then'](respondWithResult(_0x56dd0b,null))['catch'](handleError(_0x56dd0b,null));};exports[_0x748c('0xaf')]=function(_0x19b2e1,_0x389179){return db['ChatInteraction'][_0x748c('0x49')]({'where':{'id':_0x19b2e1['params']['id']}})[_0x748c('0x16')](handleEntityNotFound(_0x389179,null))['then'](function(_0x483c7e){if(_0x483c7e){return _0x483c7e[_0x748c('0xaf')](_0x19b2e1[_0x748c('0x3f')][_0x748c('0x9a')]);}})['then'](respondWithStatusCode(_0x389179,null))[_0x748c('0x1f')](handleError(_0x389179,null));};exports[_0x748c('0x77')]=function(_0x164b70,_0x37e99e){var _0x32062e=moment()[_0x748c('0xb0')]()[_0x748c('0xb1')]();var _0x163319=path[_0x748c('0x74')](config[_0x748c('0x79')],_0x748c('0xb2'),'files','tmp');var _0x11d584=path[_0x748c('0x74')](config[_0x748c('0x79')],_0x748c('0xb2'),_0x748c('0xb3'),'attachments');var _0x502499=path['join'](_0x163319,_0x32062e);var _0x2616f9=util['format'](_0x748c('0xb4'),_0x164b70['params']['id'],_0x32062e);var _0x38dd53=path[_0x748c('0x74')](_0x163319,_0x2616f9);var _0x16c8e8=[];_0x16c8e8[_0x748c('0xb5')]({'model':db[_0x748c('0x7f')],'as':_0x748c('0x7f'),'attributes':['id',_0x748c('0x52')],'raw':!![]});_0x16c8e8[_0x748c('0xb5')]({'model':db[_0x748c('0x62')],'as':_0x748c('0x63'),'attributes':['id',_0x748c('0xb6'),_0x748c('0xb7')],'raw':!![]});if(_0x164b70[_0x748c('0x3f')]['attachments']){_0x16c8e8[_0x748c('0xb5')]({'model':db[_0x748c('0x71')],'as':'Attachment','raw':!![]});}var _0x30685c=[{'model':db[_0x748c('0x5e')],'as':_0x748c('0x81'),'attributes':['id',_0x748c('0x30'),_0x748c('0x8b'),'direction',_0x748c('0xa9'),_0x748c('0xb8')],'include':_0x16c8e8}];_0x30685c[_0x748c('0xb5')]({'model':db['ChatWebsite'],'as':_0x748c('0xb9'),'attributes':['id','name']});_0x30685c[_0x748c('0xb5')]({'model':db[_0x748c('0x7f')],'as':_0x748c('0xba'),'attributes':['id',_0x748c('0x52')]});return db[_0x748c('0x34')][_0x748c('0x49')]({'where':{'id':_0x164b70['params']['id']},'include':_0x30685c})[_0x748c('0x16')](handleEntityNotFound(_0x37e99e,null))[_0x748c('0x16')](function(_0x460186){if(_0x460186){var _0x25215a=_0x460186[_0x748c('0xbb')]({'plain':!![]});fs[_0x748c('0xbc')](_0x502499);var _0x33c53a={'channel':'Chat','account':_0x25215a[_0x748c('0xb9')]['name'],'agent':_0x25215a['Owner']?_0x25215a[_0x748c('0xba')][_0x748c('0x52')]:'N.A.','createdAt':moment(_0x25215a['createdAt'])[_0x748c('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x25215a[_0x748c('0x68')]?moment(_0x25215a[_0x748c('0xbd')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x748c('0xb1')]():'','disposition':_0x25215a[_0x748c('0x69')],'chatInfo':{'browser':_0x25215a['browserName'],'os':_0x25215a[_0x748c('0xbe')],'referer':_0x25215a[_0x748c('0xbf')],'customerIp':_0x25215a[_0x748c('0xc0')],'customerPort':_0x25215a['customerPort']?_0x25215a[_0x748c('0xc1')]:'N.A.'},'messages':_(_0x25215a[_0x748c('0x81')])[_0x748c('0xc2')]()[_0x748c('0xa0')]({'secret':![]})['map'](function(_0x2fb608){if(_0x2fb608[_0x748c('0x71')]){var _0xc12fae=path['join'](_0x11d584,_0x2fb608[_0x748c('0x71')][_0x748c('0x6d')]);if(fs[_0x748c('0xc3')](_0xc12fae)){fs[_0x748c('0xc4')](_0xc12fae)[_0x748c('0xc5')](fs['createWriteStream'](path[_0x748c('0x74')](_0x502499,_0x2fb608[_0x748c('0x71')][_0x748c('0x6d')])));}}return{'date':moment(_0x2fb608[_0x748c('0x8b')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x2fb608['direction']===_0x748c('0xc6')?_0x2fb608[_0x748c('0x7f')]?_0x2fb608[_0x748c('0x7f')][_0x748c('0x52')]:_0x748c('0x87'):_0x2fb608[_0x748c('0x63')][_0x748c('0xb6')]+(_0x2fb608['Contact']['lastName']?'\x20'+_0x2fb608[_0x748c('0x63')][_0x748c('0xb7')]:''),'body':_0x2fb608[_0x748c('0x71')]?_0x2fb608[_0x748c('0x71')][_0x748c('0x6d')]:_0x2fb608[_0x748c('0x30')],'direction':_0x2fb608[_0x748c('0x8d')]==='out'?'A':'C','secret':_0x2fb608[_0x748c('0xa9')],'read':_0x2fb608['read'],'attachment':_0x2fb608[_0x748c('0x71')]};})['value']()};return ejs[_0x748c('0xc7')](path[_0x748c('0x74')](config['root'],_0x748c('0xb2'),_0x748c('0xc8'),_0x748c('0xc9')),{'interaction':_0x33c53a})['then'](function(_0x8225b9){var _0xcd7506=path[_0x748c('0x74')](_0x502499,_0x748c('0xca')+_0x25215a['id']+'-'+_0x32062e+_0x748c('0xcb'));var _0x5a5a90={'path':_0xcd7506,'channel':_0x748c('0xcc'),'interactionId':_0x25215a['id']};return pdf['createPdfFromHTML'](_0x8225b9,_0x5a5a90);})[_0x748c('0x16')](function(){return new Promise(function(_0xafd4d2,_0x49d053){zipdir(_0x502499,{'saveTo':_0x38dd53},function(_0x3ddb34,_0x5eb960){if(_0x3ddb34)return _0x49d053(_0x3ddb34);return _0xafd4d2(_0x5eb960);});})[_0x748c('0x16')](function(){return new BPromise(function(_0x5bf18f,_0x4bd855){rimraf(_0x502499,function(_0x5cbf2f){if(_0x5cbf2f)_0x4bd855(_0x5cbf2f);return _0x5bf18f();});});})[_0x748c('0x16')](function(){return _0x37e99e['download'](_0x38dd53,_0x2616f9,function(_0xbcbf66){if(_0xbcbf66){logger[_0x748c('0x1b')](_0x748c('0xcd'),_0xbcbf66);}else{fs[_0x748c('0xce')](_0x38dd53);}});});});}else{return _0x37e99e[_0x748c('0x20')](0xc8);}})['catch'](handleError(_0x37e99e,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index df6d7b1..fe819bd 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 _0x3163=['Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','save','update','remove','getUsers','then','setDataValue'];(function(_0x5583f,_0x36b976){var _0x196941=function(_0x5472fb){while(--_0x5472fb){_0x5583f['push'](_0x5583f['shift']());}};_0x196941(++_0x36b976);}(_0x3163,0x1d6));var _0x3316=function(_0x240b53,_0x3c3c8d){_0x240b53=_0x240b53-0x0;var _0x1af3db=_0x3163[_0x240b53];return _0x1af3db;};'use strict';var EventEmitter=require(_0x3316('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x3316('0x1')];var ChatMessage=require(_0x3316('0x2'))['db'][_0x3316('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3316('0x4'),'afterUpdate':_0x3316('0x5'),'afterDestroy':_0x3316('0x6')};function emitEvent(_0x440ca7){return function(_0x372ef8,_0x1bdbfc,_0x1307ca){_0x372ef8[_0x3316('0x7')]({'attributes':['id'],'raw':!![]})[_0x3316('0x8')](function(_0x41bbd0){_0x372ef8[_0x3316('0x9')](_0x3316('0xa'),_0x41bbd0[_0x3316('0xb')](function(_0x38bf76){return{'id':_0x38bf76['id']};}));return ChatMessage[_0x3316('0xc')]({'where':{'ChatInteractionId':_0x372ef8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3316('0x8')](function(_0x400cda){_0x372ef8[_0x3316('0x9')](_0x3316('0xd'),_0x400cda[_0x3316('0xe')]);ChatInteractionEvents['emit'](_0x440ca7+':'+_0x372ef8['id'],_0x372ef8);ChatInteractionEvents[_0x3316('0xf')](_0x440ca7,_0x372ef8);_0x1307ca(null);})[_0x3316('0x10')](_0x1307ca(null));};}for(var e in events){if(events[_0x3316('0x11')](e)){var event=events[e];ChatInteraction[_0x3316('0x12')](e,emitEvent(event));}}module[_0x3316('0x13')]=ChatInteractionEvents; \ No newline at end of file +var _0x86f9=['setDataValue','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','then','Users','map','findAll'];(function(_0xd7e544,_0x4811bf){var _0x3dbcf7=function(_0x1641e0){while(--_0x1641e0){_0xd7e544['push'](_0xd7e544['shift']());}};_0x3dbcf7(++_0x4811bf);}(_0x86f9,0xcd));var _0x986f=function(_0x2a558d,_0x2df0ff){_0x2a558d=_0x2a558d-0x0;var _0xa7bc9c=_0x86f9[_0x2a558d];return _0xa7bc9c;};'use strict';var EventEmitter=require(_0x986f('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0x986f('0x1'))['db'][_0x986f('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x986f('0x3')](0x0);var events={'afterCreate':_0x986f('0x4'),'afterUpdate':_0x986f('0x5'),'afterDestroy':_0x986f('0x6')};function emitEvent(_0x191e0b){return function(_0x3fc4a5,_0x4f69c0,_0x2f843c){_0x3fc4a5['getUsers']({'attributes':['id'],'raw':!![]})[_0x986f('0x7')](function(_0x2a49a8){_0x3fc4a5['setDataValue'](_0x986f('0x8'),_0x2a49a8[_0x986f('0x9')](function(_0x14159d){return{'id':_0x14159d['id']};}));return ChatMessage[_0x986f('0xa')]({'where':{'ChatInteractionId':_0x3fc4a5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x986f('0x7')](function(_0x1edd72){_0x3fc4a5[_0x986f('0xb')]('unreadMessages',_0x1edd72[_0x986f('0xc')]);ChatInteractionEvents[_0x986f('0xd')](_0x191e0b+':'+_0x3fc4a5['id'],_0x3fc4a5);ChatInteractionEvents[_0x986f('0xd')](_0x191e0b,_0x3fc4a5);_0x2f843c(null);})[_0x986f('0xe')](_0x2f843c(null));};}for(var e in events){if(events[_0x986f('0xf')](e)){var event=events[e];ChatInteraction[_0x986f('0x10')](e,emitEvent(event));}}module[_0x986f('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index e56ff9b..3dc5f7c 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 _0x0914=['bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','format','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x2a3367,_0x25913a){var _0x230264=function(_0xffa54a){while(--_0xffa54a){_0x2a3367['push'](_0x2a3367['shift']());}};_0x230264(++_0x25913a);}(_0x0914,0xfc));var _0x4091=function(_0x50ce73,_0x3dcbf2){_0x50ce73=_0x50ce73-0x0;var _0x25e3a4=_0x0914[_0x50ce73];return _0x25e3a4;};'use strict';var _=require(_0x4091('0x0'));var util=require(_0x4091('0x1'));var logger=require(_0x4091('0x2'))(_0x4091('0x3'));var moment=require('moment');var BPromise=require(_0x4091('0x4'));var rp=require(_0x4091('0x5'));var fs=require('fs');var path=require(_0x4091('0x6'));var rimraf=require(_0x4091('0x7'));var config=require(_0x4091('0x8'));var attributes=require(_0x4091('0x9'));module['exports']=function(_0x559611,_0x5f3e75){return _0x559611[_0x4091('0xa')](_0x4091('0xb'),attributes,{'tableName':_0x4091('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x29f6ef,_0x44a05a,_0x535207){if(_0x29f6ef[_0x4091('0xd')]('closed')){_0x29f6ef['closedAt']=moment()[_0x4091('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x535207(null,_0x29f6ef);}},'charset':'utf8mb4','collate':_0x4091('0xf')});}; \ No newline at end of file +var _0x44c4=['format','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','closedAt'];(function(_0x29e54f,_0x33535a){var _0x4c619f=function(_0xc98342){while(--_0xc98342){_0x29e54f['push'](_0x29e54f['shift']());}};_0x4c619f(++_0x33535a);}(_0x44c4,0x11f));var _0x444c=function(_0x3385c1,_0x16921b){_0x3385c1=_0x3385c1-0x0;var _0x3a19fd=_0x44c4[_0x3385c1];return _0x3a19fd;};'use strict';var _=require('lodash');var util=require(_0x444c('0x0'));var logger=require(_0x444c('0x1'))(_0x444c('0x2'));var moment=require(_0x444c('0x3'));var BPromise=require(_0x444c('0x4'));var rp=require(_0x444c('0x5'));var fs=require('fs');var path=require(_0x444c('0x6'));var rimraf=require(_0x444c('0x7'));var config=require('../../config/environment');var attributes=require(_0x444c('0x8'));module[_0x444c('0x9')]=function(_0x5f5603,_0x3a3454){return _0x5f5603['define'](_0x444c('0xa'),attributes,{'tableName':_0x444c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x193487,_0x4a9c30,_0x583b16){if(_0x193487['changed']('closed')){_0x193487[_0x444c('0xc')]=moment()[_0x444c('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x583b16(null,_0x193487);}},'charset':_0x444c('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index e9ce50a..f84e024 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 _0x4763=['raw','where','attributes','limit','AddTagsToChatInteraction','find','ids','omit','spread','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateChatInteraction','ChatInteraction','update','body','options'];(function(_0x18eb38,_0x479d4a){var _0x4e8faf=function(_0x926c3f){while(--_0x926c3f){_0x18eb38['push'](_0x18eb38['shift']());}};_0x4e8faf(++_0x479d4a);}(_0x4763,0xb2));var _0x3476=function(_0x37a8e2,_0x4d5aae){_0x37a8e2=_0x37a8e2-0x0;var _0xcf2950=_0x4763[_0x37a8e2];return _0xcf2950;};'use strict';var _=require('lodash');var util=require(_0x3476('0x0'));var moment=require(_0x3476('0x1'));var BPromise=require('bluebird');var rs=require(_0x3476('0x2'));var fs=require('fs');var Redis=require(_0x3476('0x3'));var db=require(_0x3476('0x4'))['db'];var utils=require(_0x3476('0x5'));var logger=require('../../config/logger')(_0x3476('0x6'));var config=require(_0x3476('0x7'));var jayson=require(_0x3476('0x8'));var client=jayson[_0x3476('0x9')][_0x3476('0xa')]({'port':0x232a});config[_0x3476('0xb')]=_[_0x3476('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3476('0xd'))(new Redis(config[_0x3476('0xb')]));require('./chatInteraction.socket')[_0x3476('0xe')](socket);function respondWithRpcPromise(_0x5517f2,_0x176cc3,_0x45b82f){return new BPromise(function(_0x1f5d06,_0x47cce5){return client[_0x3476('0xf')](_0x5517f2,_0x45b82f)[_0x3476('0x10')](function(_0x5415f7){logger[_0x3476('0x11')](_0x3476('0x12'),_0x176cc3,_0x3476('0x13'));logger[_0x3476('0x14')](_0x3476('0x15'),_0x176cc3,'request\x20sent',JSON[_0x3476('0x16')](_0x5415f7));if(_0x5415f7[_0x3476('0x17')]){if(_0x5415f7[_0x3476('0x17')][_0x3476('0x18')]===0x1f4){logger[_0x3476('0x17')](_0x3476('0x12'),_0x176cc3,_0x5415f7[_0x3476('0x17')][_0x3476('0x19')]);return _0x47cce5(_0x5415f7[_0x3476('0x17')][_0x3476('0x19')]);}logger[_0x3476('0x17')](_0x3476('0x12'),_0x176cc3,_0x5415f7[_0x3476('0x17')]['message']);return _0x1f5d06(_0x5415f7[_0x3476('0x17')]['message']);}else{logger['info'](_0x3476('0x12'),_0x176cc3,'request\x20sent');_0x1f5d06(_0x5415f7['result'][_0x3476('0x19')]);}})[_0x3476('0x1a')](function(_0x2a740a){logger['error'](_0x3476('0x12'),_0x176cc3,_0x2a740a);_0x47cce5(_0x2a740a);});});}exports[_0x3476('0x1b')]=function(_0x3d16d0){var _0x4dc412=this;return new Promise(function(_0x3f2d5e,_0x198ae8){return db[_0x3476('0x1c')][_0x3476('0x1d')](_0x3d16d0[_0x3476('0x1e')],{'raw':_0x3d16d0[_0x3476('0x1f')]?_0x3d16d0['options'][_0x3476('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d16d0['options']?_0x3d16d0['options'][_0x3476('0x21')]||null:null,'attributes':_0x3d16d0[_0x3476('0x1f')]?_0x3d16d0['options'][_0x3476('0x22')]||null:null,'limit':_0x3d16d0[_0x3476('0x1f')]?_0x3d16d0[_0x3476('0x1f')][_0x3476('0x23')]||null:null})[_0x3476('0x10')](function(_0x5455af){logger[_0x3476('0x11')](_0x3476('0x1b'),_0x3d16d0);logger[_0x3476('0x14')](_0x3476('0x1b'),_0x3d16d0,JSON[_0x3476('0x16')](_0x5455af));_0x3f2d5e(_0x5455af);})[_0x3476('0x1a')](function(_0x36fd1c){logger[_0x3476('0x17')]('UpdateChatInteraction',_0x36fd1c[_0x3476('0x19')],_0x3d16d0);_0x198ae8(_0x4dc412['error'](0x1f4,_0x36fd1c['message']));});});};exports[_0x3476('0x24')]=function(_0x41be69){return new Promise(function(_0x100d3c,_0x5b2a5b){return db[_0x3476('0x1c')][_0x3476('0x25')]({'where':_0x41be69[_0x3476('0x1f')]?_0x41be69['options']['where']||null:null})[_0x3476('0x10')](function(_0x12dbf3){if(_0x12dbf3){return _0x12dbf3['addTags'](_0x41be69[_0x3476('0x1e')][_0x3476('0x26')],_[_0x3476('0x27')](_0x41be69[_0x3476('0x1e')],['ids','id'])||{});}})[_0x3476('0x28')](function(_0x4ec8d4){logger[_0x3476('0x11')](_0x3476('0x29'),_0x41be69);logger['debug'](_0x3476('0x29'),_0x41be69,JSON[_0x3476('0x16')](_0x4ec8d4));_0x100d3c(_0x4ec8d4);})['catch'](function(_0x4cf892){logger[_0x3476('0x17')]('AddTags',_0x4cf892[_0x3476('0x19')],_0x41be69);_0x5b2a5b(_this[_0x3476('0x17')](0x1f4,_0x4cf892[_0x3476('0x19')]));});});}; \ No newline at end of file +var _0x4633=['ioredis','../../config/logger','../../config/environment','http','defaults','socket.io-emitter','register','then','info','request\x20sent','debug','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','ChatInteraction','update','body','options','raw','attributes','limit','UpdateChatInteraction','catch','AddTagsToChatInteraction','where','addTags','ids','spread','AddTags','lodash','util','bluebird'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x4633,0x66));var _0x3463=function(_0x50b475,_0x96fff7){_0x50b475=_0x50b475-0x0;var _0x418b3d=_0x4633[_0x50b475];return _0x418b3d;};'use strict';var _=require(_0x3463('0x0'));var util=require(_0x3463('0x1'));var moment=require('moment');var BPromise=require(_0x3463('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3463('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3463('0x4'))('rpc');var config=require(_0x3463('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3463('0x6')]({'port':0x232a});config['redis']=_[_0x3463('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3463('0x8'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x3463('0x9')](socket);function respondWithRpcPromise(_0x3db661,_0x17886d,_0x20e2b5){return new BPromise(function(_0x4657a3,_0x59fe32){return client['request'](_0x3db661,_0x20e2b5)[_0x3463('0xa')](function(_0x44d77d){logger[_0x3463('0xb')]('ChatInteraction,\x20%s,\x20%s',_0x17886d,_0x3463('0xc'));logger[_0x3463('0xd')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x17886d,_0x3463('0xc'),JSON[_0x3463('0xe')](_0x44d77d));if(_0x44d77d[_0x3463('0xf')]){if(_0x44d77d[_0x3463('0xf')][_0x3463('0x10')]===0x1f4){logger[_0x3463('0xf')](_0x3463('0x11'),_0x17886d,_0x44d77d[_0x3463('0xf')][_0x3463('0x12')]);return _0x59fe32(_0x44d77d[_0x3463('0xf')][_0x3463('0x12')]);}logger[_0x3463('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x17886d,_0x44d77d[_0x3463('0xf')][_0x3463('0x12')]);return _0x4657a3(_0x44d77d[_0x3463('0xf')]['message']);}else{logger[_0x3463('0xb')]('ChatInteraction,\x20%s,\x20%s',_0x17886d,_0x3463('0xc'));_0x4657a3(_0x44d77d[_0x3463('0x13')][_0x3463('0x12')]);}})['catch'](function(_0x5448c5){logger[_0x3463('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x17886d,_0x5448c5);_0x59fe32(_0x5448c5);});});}exports['UpdateChatInteraction']=function(_0x3b0722){var _0x23ba19=this;return new Promise(function(_0x1ca25b,_0x2925fd){return db[_0x3463('0x14')][_0x3463('0x15')](_0x3b0722[_0x3463('0x16')],{'raw':_0x3b0722[_0x3463('0x17')]?_0x3b0722['options'][_0x3463('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b0722[_0x3463('0x17')]?_0x3b0722[_0x3463('0x17')]['where']||null:null,'attributes':_0x3b0722[_0x3463('0x17')]?_0x3b0722[_0x3463('0x17')][_0x3463('0x19')]||null:null,'limit':_0x3b0722[_0x3463('0x17')]?_0x3b0722['options'][_0x3463('0x1a')]||null:null})['then'](function(_0x20d433){logger['info'](_0x3463('0x1b'),_0x3b0722);logger[_0x3463('0xd')](_0x3463('0x1b'),_0x3b0722,JSON[_0x3463('0xe')](_0x20d433));_0x1ca25b(_0x20d433);})[_0x3463('0x1c')](function(_0x5cdb52){logger[_0x3463('0xf')](_0x3463('0x1b'),_0x5cdb52[_0x3463('0x12')],_0x3b0722);_0x2925fd(_0x23ba19[_0x3463('0xf')](0x1f4,_0x5cdb52['message']));});});};exports[_0x3463('0x1d')]=function(_0x4f8fea){return new Promise(function(_0x254f1b,_0x48a994){return db[_0x3463('0x14')]['find']({'where':_0x4f8fea['options']?_0x4f8fea[_0x3463('0x17')][_0x3463('0x1e')]||null:null})['then'](function(_0x4eaf8f){if(_0x4eaf8f){return _0x4eaf8f[_0x3463('0x1f')](_0x4f8fea['body'][_0x3463('0x20')],_['omit'](_0x4f8fea[_0x3463('0x16')],[_0x3463('0x20'),'id'])||{});}})[_0x3463('0x21')](function(_0x5599e8){logger[_0x3463('0xb')](_0x3463('0x22'),_0x4f8fea);logger['debug']('AddTags',_0x4f8fea,JSON['stringify'](_0x5599e8));_0x254f1b(_0x5599e8);})[_0x3463('0x1c')](function(_0x194967){logger[_0x3463('0xf')]('AddTags',_0x194967[_0x3463('0x12')],_0x4f8fea);_0x48a994(_this[_0x3463('0xf')](0x1f4,_0x194967[_0x3463('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 0fb730f..a817635 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 _0x16c2=['chatInteraction:','./chatInteraction.events','save','remove','update','removeListener','length'];(function(_0x4b2662,_0x1fc9fa){var _0x47dd9d=function(_0x40d3fe){while(--_0x40d3fe){_0x4b2662['push'](_0x4b2662['shift']());}};_0x47dd9d(++_0x1fc9fa);}(_0x16c2,0x19e));var _0x216c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16c2[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInteractionEvents=require(_0x216c('0x0'));var events=[_0x216c('0x1'),_0x216c('0x2'),_0x216c('0x3')];function createListener(_0x43149f,_0x5a49c7){return function(_0x4069d5){_0x5a49c7['emit'](_0x43149f,_0x4069d5);};}function removeListener(_0x138378,_0x51ea03){return function(){ChatInteractionEvents[_0x216c('0x4')](_0x138378,_0x51ea03);};}exports['register']=function(_0x8833ab){for(var _0x2c9b60=0x0,_0xa734e5=events[_0x216c('0x5')];_0x2c9b60<_0xa734e5;_0x2c9b60++){var _0x3e3b5a=events[_0x2c9b60];var _0x239f12=createListener(_0x216c('0x6')+_0x3e3b5a,_0x8833ab);ChatInteractionEvents['on'](_0x3e3b5a,_0x239f12);}}; \ No newline at end of file +var _0x133a=['register','length','chatInteraction:','save','remove','update','emit','removeListener'];(function(_0x2c54dd,_0x22d4a2){var _0x3dccba=function(_0x7ba02c){while(--_0x7ba02c){_0x2c54dd['push'](_0x2c54dd['shift']());}};_0x3dccba(++_0x22d4a2);}(_0x133a,0xcb));var _0xa133=function(_0x2d90cc,_0x45bb4e){_0x2d90cc=_0x2d90cc-0x0;var _0x227a99=_0x133a[_0x2d90cc];return _0x227a99;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xa133('0x0'),_0xa133('0x1'),_0xa133('0x2')];function createListener(_0x31ee7a,_0x5f0eea){return function(_0x30e2cb){_0x5f0eea[_0xa133('0x3')](_0x31ee7a,_0x30e2cb);};}function removeListener(_0x2841ba,_0x52f874){return function(){ChatInteractionEvents[_0xa133('0x4')](_0x2841ba,_0x52f874);};}exports[_0xa133('0x5')]=function(_0x17fe9b){for(var _0x1e16a7=0x0,_0x56fbbf=events[_0xa133('0x6')];_0x1e16a7<_0x56fbbf;_0x1e16a7++){var _0x1fdfa5=events[_0x1e16a7];var _0x15ba48=createListener(_0xa133('0x7')+_0x1fdfa5,_0x17fe9b);ChatInteractionEvents['on'](_0x1fdfa5,_0x15ba48);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 636477e..76ea473 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 _0xbda1=['%s-%s','now','originalname','replace','single','file','attachmentUpload','addMessage','/:id/tags','tracked','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chat','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','index','get','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','format'];(function(_0x59f860,_0x24716c){var _0x2d558a=function(_0x474b8a){while(--_0x474b8a){_0x59f860['push'](_0x59f860['shift']());}};_0x2d558a(++_0x24716c);}(_0xbda1,0x1b1));var _0x1bda=function(_0x636991,_0x17d479){_0x636991=_0x636991-0x0;var _0x5a2224=_0xbda1[_0x636991];return _0x5a2224;};'use strict';var multer=require(_0x1bda('0x0'));var util=require(_0x1bda('0x1'));var path=require(_0x1bda('0x2'));var timeout=require(_0x1bda('0x3'));var express=require('express');var router=express[_0x1bda('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1bda('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1bda('0x6')]);router[_0x1bda('0x7')](_0x1bda('0x8'),auth[_0x1bda('0x9')](),controller[_0x1bda('0xa')]);router[_0x1bda('0x7')](_0x1bda('0xb'),auth[_0x1bda('0xc')](),controller['show']);router[_0x1bda('0x7')](_0x1bda('0xd'),auth[_0x1bda('0xc')](),controller['attachmentDownload']);router['get'](_0x1bda('0xe'),auth['isAuthenticated'](),controller[_0x1bda('0xf')]);router[_0x1bda('0x7')](_0x1bda('0x10'),auth[_0x1bda('0xc')](),controller[_0x1bda('0x11')]);router[_0x1bda('0x7')](_0x1bda('0x12'),auth['isAuthenticated'](),controller[_0x1bda('0x13')]);router[_0x1bda('0x14')]('/',auth['isAuthenticated'](),controller[_0x1bda('0x15')]);router[_0x1bda('0x14')](_0x1bda('0x16'),auth[_0x1bda('0x9')](),controller[_0x1bda('0x17')]);var upload=multer({'storage':multer[_0x1bda('0x18')]({'destination':function(_0x94399d,_0x564148,_0x1e89f3){_0x1e89f3(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x2cf6d5,_0x1901dc,_0x42ade7){_0x42ade7(null,util[_0x1bda('0x19')](_0x1bda('0x1a'),Date[_0x1bda('0x1b')](),_0x1901dc[_0x1bda('0x1c')][_0x1bda('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x1bda('0x14')]('/:id/attachment_upload',upload[_0x1bda('0x1e')](_0x1bda('0x1f')),controller[_0x1bda('0x20')]);router[_0x1bda('0x14')]('/:id/messages',auth[_0x1bda('0xc')](),controller[_0x1bda('0x21')]);router[_0x1bda('0x14')](_0x1bda('0x22'),auth['isAuthenticated'](),interaction[_0x1bda('0x23')]('chat','chatinteraction:addtags'),controller[_0x1bda('0x24')]);router[_0x1bda('0x25')](_0x1bda('0xb'),auth[_0x1bda('0x9')](),interaction[_0x1bda('0x23')]('chat',_0x1bda('0x26')),controller[_0x1bda('0x27')]);router[_0x1bda('0x25')](_0x1bda('0x28'),controller[_0x1bda('0x29')]);router[_0x1bda('0x25')](_0x1bda('0x2a'),auth['isChatInteractionAuthorized'](),controller[_0x1bda('0x2b')]);router['put']('/:id/close',controller[_0x1bda('0x2c')]);router[_0x1bda('0x2d')](_0x1bda('0xb'),auth[_0x1bda('0x9')](),interaction[_0x1bda('0x23')](_0x1bda('0x2e'),_0x1bda('0x2f')),controller[_0x1bda('0x30')]);router[_0x1bda('0x2d')]('/:id/tags',auth['isAuthenticated'](),controller[_0x1bda('0x31')]);module[_0x1bda('0x32')]=router; \ No newline at end of file +var _0xe459=['/:id/vidaoo','diskStorage','join','root','format','originalname','replace','/:id/attachment_upload','file','addMessage','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update','/:id/custom_update','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','post','create'];(function(_0x1b0afd,_0x367934){var _0x4ba0d2=function(_0x4755b8){while(--_0x4755b8){_0x1b0afd['push'](_0x1b0afd['shift']());}};_0x4ba0d2(++_0x367934);}(_0xe459,0x7a));var _0x9e45=function(_0x59a68a,_0xc0c564){_0x59a68a=_0x59a68a-0x0;var _0x1e114d=_0xe459[_0x59a68a];return _0x1e114d;};'use strict';var multer=require(_0x9e45('0x0'));var util=require('util');var path=require(_0x9e45('0x1'));var timeout=require(_0x9e45('0x2'));var express=require(_0x9e45('0x3'));var router=express['Router']();var fs_extra=require(_0x9e45('0x4'));var auth=require(_0x9e45('0x5'));var interaction=require(_0x9e45('0x6'));var config=require('../../config/environment');var controller=require(_0x9e45('0x7'));router[_0x9e45('0x8')]('/',auth[_0x9e45('0x9')](),controller[_0x9e45('0xa')]);router[_0x9e45('0x8')](_0x9e45('0xb'),auth[_0x9e45('0x9')](),controller[_0x9e45('0xc')]);router['get'](_0x9e45('0xd'),auth[_0x9e45('0xe')](),controller[_0x9e45('0xf')]);router[_0x9e45('0x8')]('/:id/attachment_download',auth[_0x9e45('0xe')](),controller[_0x9e45('0x10')]);router[_0x9e45('0x8')]('/:id/messages',auth[_0x9e45('0x9')](),controller[_0x9e45('0x11')]);router[_0x9e45('0x8')](_0x9e45('0x12'),auth['isChatInteractionAuthorized'](),controller[_0x9e45('0x13')]);router['get']('/:id/download',auth[_0x9e45('0x9')](),controller['download']);router[_0x9e45('0x14')]('/',auth['isAuthenticated'](),controller[_0x9e45('0x15')]);router[_0x9e45('0x14')](_0x9e45('0x16'),auth[_0x9e45('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x9e45('0x17')]({'destination':function(_0x500f6e,_0x41b56d,_0x538f2f){_0x538f2f(null,path[_0x9e45('0x18')](config[_0x9e45('0x19')],'server/files/attachments/'));},'filename':function(_0x3846bd,_0x13806e,_0x1e3690){_0x1e3690(null,util[_0x9e45('0x1a')]('%s-%s',Date['now'](),_0x13806e[_0x9e45('0x1b')][_0x9e45('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9e45('0x14')](_0x9e45('0x1d'),upload['single'](_0x9e45('0x1e')),controller['attachmentUpload']);router[_0x9e45('0x14')]('/:id/messages',auth[_0x9e45('0xe')](),controller[_0x9e45('0x1f')]);router[_0x9e45('0x14')](_0x9e45('0x20'),auth['isAuthenticated'](),interaction[_0x9e45('0x21')](_0x9e45('0x22'),'chatinteraction:addtags'),controller[_0x9e45('0x23')]);router[_0x9e45('0x24')](_0x9e45('0xd'),auth['isAuthenticated'](),interaction[_0x9e45('0x21')](_0x9e45('0x22'),_0x9e45('0x25')),controller[_0x9e45('0x26')]);router['put'](_0x9e45('0x27'),controller['customUpdate']);router[_0x9e45('0x24')](_0x9e45('0x28'),auth[_0x9e45('0xe')](),controller[_0x9e45('0x29')]);router[_0x9e45('0x24')](_0x9e45('0x2a'),controller[_0x9e45('0x2b')]);router[_0x9e45('0x2c')](_0x9e45('0xd'),auth[_0x9e45('0x9')](),interaction['tracked']('chat',_0x9e45('0x2d')),controller[_0x9e45('0x2e')]);router[_0x9e45('0x2c')](_0x9e45('0x20'),auth[_0x9e45('0x9')](),controller['removeTags']);module[_0x9e45('0x2f')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 4c9e398..0321b3f 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 _0x3574=['INTEGER','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x3e1da3,_0x432031){var _0xe03e0=function(_0x5b6de7){while(--_0x5b6de7){_0x3e1da3['push'](_0x3e1da3['shift']());}};_0xe03e0(++_0x432031);}(_0x3574,0x11b));var _0x4357=function(_0x3e4531,_0x4d7cee){_0x3e4531=_0x3e4531-0x0;var _0x5f2b05=_0x3574[_0x3e4531];return _0x5f2b05;};'use strict';var Sequelize=require(_0x4357('0x0'));module[_0x4357('0x1')]={'body':{'type':Sequelize[_0x4357('0x2')](_0x4357('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4357('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x4357('0x5')]}}; \ No newline at end of file +var _0x18ec=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x437eda,_0x35eaa6){var _0x35b585=function(_0x23c15a){while(--_0x23c15a){_0x437eda['push'](_0x437eda['shift']());}};_0x35b585(++_0x35eaa6);}(_0x18ec,0xb4));var _0xc18e=function(_0x5ab69c,_0x52f26b){_0x5ab69c=_0x5ab69c-0x0;var _0x112e12=_0x18ec[_0x5ab69c];return _0x112e12;};'use strict';var Sequelize=require(_0xc18e('0x0'));module[_0xc18e('0x1')]={'body':{'type':Sequelize[_0xc18e('0x2')](_0xc18e('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc18e('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xc18e('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index b454c29..f8bf888 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 _0x95da=['body','describe','get','createdAt','lastMessage','lastMessageAt','format','getUsers','User','agent','admin','user','fullname','internal','online','lastLoginAt','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','isEmpty','messages','push','FromId','ToId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','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/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatInternalMessage.socket','register','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','length','find','create'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x95da,0x1d5));var _0xa95d=function(_0x37624e,_0x58edc9){_0x37624e=_0x37624e-0x0;var _0x279e86=_0x95da[_0x37624e];return _0x279e86;};'use strict';var emlformat=require(_0xa95d('0x0'));var rimraf=require(_0xa95d('0x1'));var zipdir=require(_0xa95d('0x2'));var jsonpatch=require(_0xa95d('0x3'));var rp=require('request-promise');var moment=require(_0xa95d('0x4'));var BPromise=require(_0xa95d('0x5'));var Mustache=require('mustache');var util=require(_0xa95d('0x6'));var path=require(_0xa95d('0x7'));var sox=require(_0xa95d('0x8'));var csv=require(_0xa95d('0x9'));var ejs=require(_0xa95d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa95d('0xb'));var squel=require(_0xa95d('0xc'));var crypto=require(_0xa95d('0xd'));var jsforce=require(_0xa95d('0xe'));var deskjs=require(_0xa95d('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa95d('0x10'));var Papa=require('papaparse');var Redis=require(_0xa95d('0x11'));var authService=require(_0xa95d('0x12'));var qs=require(_0xa95d('0x13'));var as=require(_0xa95d('0x14'));var hardwareService=require(_0xa95d('0x15'));var logger=require(_0xa95d('0x16'))(_0xa95d('0x17'));var utils=require(_0xa95d('0x18'));var config=require(_0xa95d('0x19'));var licenseUtil=require(_0xa95d('0x1a'));var db=require(_0xa95d('0x1b'))['db'];config[_0xa95d('0x1c')]=_[_0xa95d('0x1d')](config[_0xa95d('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa95d('0x1c')]));require(_0xa95d('0x1e'))[_0xa95d('0x1f')](socket);function respondWithStatusCode(_0x37ff31,_0x89d779){_0x89d779=_0x89d779||0xcc;return function(_0x20f744){if(_0x20f744){return _0x37ff31['sendStatus'](_0x89d779);}return _0x37ff31[_0xa95d('0x20')](_0x89d779)[_0xa95d('0x21')]();};}function respondWithResult(_0x4029e0,_0x44538b){_0x44538b=_0x44538b||0xc8;return function(_0xf9b8c2){if(_0xf9b8c2){return _0x4029e0[_0xa95d('0x20')](_0x44538b)[_0xa95d('0x22')](_0xf9b8c2);}};}function respondWithFilteredResult(_0x70c319,_0x22597a){return function(_0x12ce6d){if(_0x12ce6d){var _0x5e4090=typeof _0x22597a[_0xa95d('0x23')]===_0xa95d('0x24')&&typeof _0x22597a[_0xa95d('0x25')]===_0xa95d('0x24');var _0x1a1e9c=_0x12ce6d[_0xa95d('0x26')];var _0x34439f=_0x5e4090?0x0:_0x22597a[_0xa95d('0x23')];var _0x38e0ac=_0x5e4090?_0x12ce6d['count']:_0x22597a[_0xa95d('0x23')]+_0x22597a['limit'];var _0x267743;if(_0x38e0ac>=_0x1a1e9c){_0x38e0ac=_0x1a1e9c;_0x267743=0xc8;}else{_0x267743=0xce;}_0x70c319['status'](_0x267743);return _0x70c319[_0xa95d('0x27')]('Content-Range',_0x34439f+'-'+_0x38e0ac+'/'+_0x1a1e9c)[_0xa95d('0x22')](_0x12ce6d);}return null;};}function patchUpdates(_0x1a9be2){return function(_0x5d5bd9){try{jsonpatch[_0xa95d('0x28')](_0x5d5bd9,_0x1a9be2,!![]);}catch(_0x231ad1){return BPromise[_0xa95d('0x29')](_0x231ad1);}return _0x5d5bd9[_0xa95d('0x2a')]();};}function saveUpdates(_0xe56e8f,_0x102e31){return function(_0x2ac9a8){if(_0x2ac9a8){return _0x2ac9a8[_0xa95d('0x2b')](_0xe56e8f)[_0xa95d('0x2c')](function(_0x434dea){return _0x434dea;});}return null;};}function removeEntity(_0x37b8ae,_0x38eb7e){return function(_0x59a9c5){if(_0x59a9c5){return _0x59a9c5[_0xa95d('0x2d')]()[_0xa95d('0x2c')](function(){_0x37b8ae[_0xa95d('0x20')](0xcc)[_0xa95d('0x21')]();});}};}function handleEntityNotFound(_0x7bfbbc,_0x23dbf4){return function(_0x45edac){if(!_0x45edac){_0x7bfbbc[_0xa95d('0x2e')](0x194);}return _0x45edac;};}function handleError(_0x197ed7,_0x5d6fc1){_0x5d6fc1=_0x5d6fc1||0x1f4;return function(_0xc0e63a){logger['error'](_0xc0e63a[_0xa95d('0x2f')]);if(_0xc0e63a[_0xa95d('0x30')]){delete _0xc0e63a[_0xa95d('0x30')];}_0x197ed7[_0xa95d('0x20')](_0x5d6fc1)['send'](_0xc0e63a);};}exports[_0xa95d('0x31')]=function(_0x523039,_0x3c39a6){var _0xe620ca={},_0x59da05={},_0x304fab={'count':0x0,'rows':[]};var _0x31d49b=_[_0xa95d('0x32')](db[_0xa95d('0x33')][_0xa95d('0x34')],function(_0x4c7ae6){return{'name':_0x4c7ae6[_0xa95d('0x35')],'type':_0x4c7ae6[_0xa95d('0x36')][_0xa95d('0x37')]};});_0x59da05['model']=_[_0xa95d('0x32')](_0x31d49b,_0xa95d('0x30'));_0x59da05[_0xa95d('0x38')]=_[_0xa95d('0x39')](_0x523039['query']);_0x59da05[_0xa95d('0x3a')]=_['intersection'](_0x59da05[_0xa95d('0x3b')],_0x59da05[_0xa95d('0x38')]);_0xe620ca[_0xa95d('0x3c')]=_[_0xa95d('0x3d')](_0x59da05[_0xa95d('0x3b')],qs['fields'](_0x523039[_0xa95d('0x38')][_0xa95d('0x3e')]));_0xe620ca[_0xa95d('0x3c')]=_0xe620ca[_0xa95d('0x3c')]['length']?_0xe620ca[_0xa95d('0x3c')]:_0x59da05[_0xa95d('0x3b')];if(!_0x523039['query'][_0xa95d('0x3f')](_0xa95d('0x40'))){_0xe620ca[_0xa95d('0x25')]=qs[_0xa95d('0x25')](_0x523039[_0xa95d('0x38')]['limit']);_0xe620ca[_0xa95d('0x23')]=qs[_0xa95d('0x23')](_0x523039['query'][_0xa95d('0x23')]);}_0xe620ca[_0xa95d('0x41')]=qs[_0xa95d('0x42')](_0x523039[_0xa95d('0x38')][_0xa95d('0x42')]);_0xe620ca[_0xa95d('0x43')]=qs[_0xa95d('0x3a')](_['pick'](_0x523039[_0xa95d('0x38')],_0x59da05[_0xa95d('0x3a')]),_0x31d49b);if(_0x523039['query']['filter']){_0xe620ca[_0xa95d('0x43')]=_[_0xa95d('0x44')](_0xe620ca[_0xa95d('0x43')],{'$or':_[_0xa95d('0x32')](_0x31d49b,function(_0x3a5257){if(_0x3a5257['type']!==_0xa95d('0x45')){var _0x42beb2={};_0x42beb2[_0x3a5257['name']]={'$like':'%'+_0x523039[_0xa95d('0x38')][_0xa95d('0x46')]+'%'};return _0x42beb2;}})});}_0xe620ca=_['merge']({},_0xe620ca,_0x523039[_0xa95d('0x47')]);var _0x1a0551={'where':_0xe620ca['where']};return db['ChatInternalMessage']['count'](_0x1a0551)[_0xa95d('0x2c')](function(_0x4104bc){_0x304fab[_0xa95d('0x26')]=_0x4104bc;if(_0x523039['query'][_0xa95d('0x48')]){_0xe620ca[_0xa95d('0x49')]=[{'all':!![]}];}return db[_0xa95d('0x33')][_0xa95d('0x4a')](_0xe620ca);})[_0xa95d('0x2c')](function(_0x193c79){_0x304fab[_0xa95d('0x4b')]=_0x193c79;return _0x304fab;})[_0xa95d('0x2c')](respondWithFilteredResult(_0x3c39a6,_0xe620ca))[_0xa95d('0x4c')](handleError(_0x3c39a6,null));};exports['show']=function(_0x49a787,_0x4d3b38){var _0x244d7c={'raw':!![],'where':{'id':_0x49a787[_0xa95d('0x4d')]['id']}},_0x2948a3={};_0x2948a3[_0xa95d('0x3b')]=_[_0xa95d('0x39')](db['ChatInternalMessage']['rawAttributes']);_0x2948a3[_0xa95d('0x38')]=_[_0xa95d('0x39')](_0x49a787['query']);_0x2948a3[_0xa95d('0x3a')]=_[_0xa95d('0x3d')](_0x2948a3['model'],_0x2948a3[_0xa95d('0x38')]);_0x244d7c[_0xa95d('0x3c')]=_[_0xa95d('0x3d')](_0x2948a3[_0xa95d('0x3b')],qs[_0xa95d('0x3e')](_0x49a787['query'][_0xa95d('0x3e')]));_0x244d7c[_0xa95d('0x3c')]=_0x244d7c[_0xa95d('0x3c')][_0xa95d('0x4e')]?_0x244d7c[_0xa95d('0x3c')]:_0x2948a3[_0xa95d('0x3b')];if(_0x49a787[_0xa95d('0x38')][_0xa95d('0x48')]){_0x244d7c['include']=[{'all':!![]}];}_0x244d7c=_[_0xa95d('0x44')]({},_0x244d7c,_0x49a787[_0xa95d('0x47')]);return db[_0xa95d('0x33')][_0xa95d('0x4f')](_0x244d7c)[_0xa95d('0x2c')](handleEntityNotFound(_0x4d3b38,null))[_0xa95d('0x2c')](respondWithResult(_0x4d3b38,null))['catch'](handleError(_0x4d3b38,null));};exports[_0xa95d('0x50')]=function(_0x40a9ba,_0x2c476e){return db['ChatInternalMessage'][_0xa95d('0x50')](_0x40a9ba[_0xa95d('0x51')],{})[_0xa95d('0x2c')](respondWithResult(_0x2c476e,0xc9))[_0xa95d('0x4c')](handleError(_0x2c476e,null));};exports['update']=function(_0x20a92e,_0xaeb6b3){if(_0x20a92e['body']['id']){delete _0x20a92e[_0xa95d('0x51')]['id'];}return db[_0xa95d('0x33')]['find']({'where':{'id':_0x20a92e[_0xa95d('0x4d')]['id']}})[_0xa95d('0x2c')](handleEntityNotFound(_0xaeb6b3,null))[_0xa95d('0x2c')](saveUpdates(_0x20a92e[_0xa95d('0x51')],null))[_0xa95d('0x2c')](respondWithResult(_0xaeb6b3,null))[_0xa95d('0x4c')](handleError(_0xaeb6b3,null));};exports[_0xa95d('0x2d')]=function(_0xae3350,_0x52efa1){return db[_0xa95d('0x33')][_0xa95d('0x4f')]({'where':{'id':_0xae3350[_0xa95d('0x4d')]['id']}})[_0xa95d('0x2c')](handleEntityNotFound(_0x52efa1,null))[_0xa95d('0x2c')](removeEntity(_0x52efa1,null))[_0xa95d('0x4c')](handleError(_0x52efa1,null));};exports[_0xa95d('0x52')]=function(_0x529a27,_0x10d22b){return db[_0xa95d('0x33')][_0xa95d('0x52')]()[_0xa95d('0x2c')](respondWithResult(_0x10d22b,null))[_0xa95d('0x4c')](handleError(_0x10d22b,null));};function wrapUser(_0x44ef41){return function(_0x235f76){var _0x1c28b7=_0x44ef41[_0xa95d('0x53')]({'plain':!![]});_0x1c28b7['messages']=[];if(_0x235f76){_0x1c28b7['lastMessageAt']=_0x235f76[_0xa95d('0x54')];_0x1c28b7[_0xa95d('0x55')]=_0x235f76;}else{_0x1c28b7[_0xa95d('0x56')]=moment(0x0)[_0xa95d('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0x1c28b7['lastMessage']={};}return _0x1c28b7;};}exports[_0xa95d('0x58')]=function(_0x1cce2b,_0xff6ce9,_0x5941dd){var _0x11a9b0=[];return db[_0xa95d('0x59')]['findAll']({'where':{'role':[_0xa95d('0x5a'),_0xa95d('0x5b'),_0xa95d('0x5c')]},'attributes':['id',_0xa95d('0x5d'),_0xa95d('0x30'),'role','userpic',_0xa95d('0x5e'),_0xa95d('0x5f'),_0xa95d('0x60'),'allowmessenger',_0xa95d('0x61')],'order':qs[_0xa95d('0x42')](_0xa95d('0x62')),'include':[{'model':db['VoiceQueue'],'as':_0xa95d('0x63'),'attributes':['id',_0xa95d('0x30'),_0xa95d('0x36')],'through':{'attributes':[]}}]})[_0xa95d('0x2c')](function(_0x404402){if(_0x404402){var _0x50e92f=_0x1cce2b[_0xa95d('0x5c')][_0xa95d('0x53')]({'plain':!![]});if(!_0x50e92f)throw new Error(_0xa95d('0x64'));if(_0x50e92f[_0xa95d('0x65')]===_0xa95d('0x5c')){return db['UserProfileSection'][_0xa95d('0x4f')]({'where':{'name':'Agents','userProfileId':_0x50e92f['userProfileId']},'raw':!![]})[_0xa95d('0x2c')](function(_0x4dfec9){if(_0x4dfec9){if(_0x4dfec9[_0xa95d('0x66')]===0x0){return db['UserProfileResource'][_0xa95d('0x4a')]({'where':{'sectionId':_0x4dfec9['id']},'raw':!![]})[_0xa95d('0x2c')](function(_0x2b7c7f){var _0x3c334e=[];if(_[_0xa95d('0x67')](_0x2b7c7f)){_0x3c334e=_[_0xa95d('0x46')](_0x404402,function(_0x20d30f){if(_0x20d30f[_0xa95d('0x65')]!=='agent'){return _0x20d30f;}});return _0x3c334e;}else{for(var _0x2fde9a=0x0;_0x2fde9a<_0x404402[_0xa95d('0x4e')];_0x2fde9a++){var _0x368e0d=_0x404402[_0x2fde9a];if(_0x368e0d[_0xa95d('0x65')]===_0xa95d('0x5a')){var _0x20df9d=_[_0xa95d('0x4f')](_0x2b7c7f,function(_0x2702e4){return _0x2702e4['resourceId']===_0x368e0d['id'];});if(_0x20df9d)_0x3c334e['push'](_0x368e0d);}else{_0x3c334e['push'](_0x368e0d);}}return _0x3c334e;}});}else{return _0x404402;}}else{var _0x53bf5e=_['filter'](_0x404402,function(_0x47c05d){if(_0x47c05d['role']!==_0xa95d('0x5a')){return _0x47c05d;}});return _0x53bf5e;}});}else{return _0x404402;}}})[_0xa95d('0x2c')](function(_0x5475b5){var _0x427e3e=[];if(_0x5475b5){_0x11a9b0=_0x5475b5;for(var _0x4a528f=0x0;_0x4a528f<_0x5475b5['length'];_0x4a528f+=0x1){_0x11a9b0[_0x4a528f][_0xa95d('0x68')]=[];_0x427e3e[_0xa95d('0x69')](db['ChatInternalMessage'][_0xa95d('0x4f')]({'where':{'FromId':[_0x1cce2b[_0xa95d('0x5c')]['id'],_0x5475b5[_0x4a528f]['id']],'ToId':[_0x1cce2b[_0xa95d('0x5c')]['id'],_0x5475b5[_0x4a528f]['id']],'ChatGroupId':null},'attributes':['id',_0xa95d('0x54'),_0xa95d('0x6a'),_0xa95d('0x6b'),'read','body'],'order':qs[_0xa95d('0x42')](_0xa95d('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa95d('0x2c')](wrapUser(_0x5475b5[_0x4a528f])));}return BPromise[_0xa95d('0x6d')](_0x427e3e);}return[];})['then'](function(_0xaefbf){return{'rows':_0xaefbf,'count':_0xaefbf['length']};})['then'](respondWithResult(_0xff6ce9,null))[_0xa95d('0x4c')](handleError(_0xff6ce9,null));}; \ No newline at end of file +var _0x2bb9=['merge','VIRTUAL','filter','includeAll','include','show','params','filters','options','find','create','body','catch','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','findAll','agent','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','save','update','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick'];(function(_0x19bdd2,_0x152c0f){var _0x218bcf=function(_0x112b8c){while(--_0x112b8c){_0x19bdd2['push'](_0x19bdd2['shift']());}};_0x218bcf(++_0x152c0f);}(_0x2bb9,0x16e));var _0x92bb=function(_0x513cbb,_0x5bbea5){_0x513cbb=_0x513cbb-0x0;var _0x481b9e=_0x2bb9[_0x513cbb];return _0x481b9e;};'use strict';var emlformat=require(_0x92bb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x92bb('0x1'));var jsonpatch=require(_0x92bb('0x2'));var rp=require(_0x92bb('0x3'));var moment=require(_0x92bb('0x4'));var BPromise=require(_0x92bb('0x5'));var Mustache=require(_0x92bb('0x6'));var util=require(_0x92bb('0x7'));var path=require(_0x92bb('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x92bb('0x9'));var squel=require(_0x92bb('0xa'));var crypto=require('crypto');var jsforce=require(_0x92bb('0xb'));var deskjs=require(_0x92bb('0xc'));var toCsv=require(_0x92bb('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x92bb('0xe'));var qs=require(_0x92bb('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x92bb('0x10'));var logger=require(_0x92bb('0x11'))(_0x92bb('0x12'));var utils=require(_0x92bb('0x13'));var config=require(_0x92bb('0x14'));var licenseUtil=require(_0x92bb('0x15'));var db=require(_0x92bb('0x16'))['db'];config['redis']=_[_0x92bb('0x17')](config[_0x92bb('0x18')],{'host':_0x92bb('0x19'),'port':0x18eb});var socket=require(_0x92bb('0x1a'))(new Redis(config[_0x92bb('0x18')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x5049b4,_0x549532){_0x549532=_0x549532||0xcc;return function(_0x59bba2){if(_0x59bba2){return _0x5049b4[_0x92bb('0x1b')](_0x549532);}return _0x5049b4[_0x92bb('0x1c')](_0x549532)[_0x92bb('0x1d')]();};}function respondWithResult(_0x4e996d,_0x2c95f2){_0x2c95f2=_0x2c95f2||0xc8;return function(_0x3c7fde){if(_0x3c7fde){return _0x4e996d[_0x92bb('0x1c')](_0x2c95f2)['json'](_0x3c7fde);}};}function respondWithFilteredResult(_0xcf57bc,_0x4d1477){return function(_0x564b7f){if(_0x564b7f){var _0x1222ce=typeof _0x4d1477[_0x92bb('0x1e')]==='undefined'&&typeof _0x4d1477[_0x92bb('0x1f')]==='undefined';var _0x33fd01=_0x564b7f[_0x92bb('0x20')];var _0x513338=_0x1222ce?0x0:_0x4d1477[_0x92bb('0x1e')];var _0x3f3ac0=_0x1222ce?_0x564b7f[_0x92bb('0x20')]:_0x4d1477[_0x92bb('0x1e')]+_0x4d1477[_0x92bb('0x1f')];var _0x30c08e;if(_0x3f3ac0>=_0x33fd01){_0x3f3ac0=_0x33fd01;_0x30c08e=0xc8;}else{_0x30c08e=0xce;}_0xcf57bc[_0x92bb('0x1c')](_0x30c08e);return _0xcf57bc[_0x92bb('0x21')](_0x92bb('0x22'),_0x513338+'-'+_0x3f3ac0+'/'+_0x33fd01)[_0x92bb('0x23')](_0x564b7f);}return null;};}function patchUpdates(_0x725571){return function(_0x275158){try{jsonpatch[_0x92bb('0x24')](_0x275158,_0x725571,!![]);}catch(_0x5ef69d){return BPromise['reject'](_0x5ef69d);}return _0x275158[_0x92bb('0x25')]();};}function saveUpdates(_0x37c400,_0x527eb0){return function(_0x3a1452){if(_0x3a1452){return _0x3a1452[_0x92bb('0x26')](_0x37c400)['then'](function(_0x87c619){return _0x87c619;});}return null;};}function removeEntity(_0x323007,_0x4d926e){return function(_0x39f8a1){if(_0x39f8a1){return _0x39f8a1['destroy']()[_0x92bb('0x27')](function(){_0x323007['status'](0xcc)[_0x92bb('0x1d')]();});}};}function handleEntityNotFound(_0x1e83c1,_0x513b45){return function(_0x179985){if(!_0x179985){_0x1e83c1[_0x92bb('0x1b')](0x194);}return _0x179985;};}function handleError(_0x22cd1a,_0x4853b9){_0x4853b9=_0x4853b9||0x1f4;return function(_0xe58677){logger[_0x92bb('0x28')](_0xe58677[_0x92bb('0x29')]);if(_0xe58677[_0x92bb('0x2a')]){delete _0xe58677[_0x92bb('0x2a')];}_0x22cd1a[_0x92bb('0x1c')](_0x4853b9)[_0x92bb('0x2b')](_0xe58677);};}exports[_0x92bb('0x2c')]=function(_0x66f374,_0x51f3de){var _0x2d5f13={},_0x164c6b={},_0x4592c5={'count':0x0,'rows':[]};var _0x4dc6b6=_[_0x92bb('0x2d')](db[_0x92bb('0x2e')][_0x92bb('0x2f')],function(_0x2689d8){return{'name':_0x2689d8['fieldName'],'type':_0x2689d8[_0x92bb('0x30')][_0x92bb('0x31')]};});_0x164c6b[_0x92bb('0x32')]=_[_0x92bb('0x2d')](_0x4dc6b6,_0x92bb('0x2a'));_0x164c6b[_0x92bb('0x33')]=_[_0x92bb('0x34')](_0x66f374['query']);_0x164c6b['filters']=_[_0x92bb('0x35')](_0x164c6b[_0x92bb('0x32')],_0x164c6b[_0x92bb('0x33')]);_0x2d5f13['attributes']=_[_0x92bb('0x35')](_0x164c6b[_0x92bb('0x32')],qs[_0x92bb('0x36')](_0x66f374['query']['fields']));_0x2d5f13[_0x92bb('0x37')]=_0x2d5f13['attributes'][_0x92bb('0x38')]?_0x2d5f13['attributes']:_0x164c6b[_0x92bb('0x32')];if(!_0x66f374[_0x92bb('0x33')][_0x92bb('0x39')]('nolimit')){_0x2d5f13[_0x92bb('0x1f')]=qs[_0x92bb('0x1f')](_0x66f374[_0x92bb('0x33')][_0x92bb('0x1f')]);_0x2d5f13[_0x92bb('0x1e')]=qs[_0x92bb('0x1e')](_0x66f374['query'][_0x92bb('0x1e')]);}_0x2d5f13[_0x92bb('0x3a')]=qs[_0x92bb('0x3b')](_0x66f374['query'][_0x92bb('0x3b')]);_0x2d5f13[_0x92bb('0x3c')]=qs['filters'](_[_0x92bb('0x3d')](_0x66f374['query'],_0x164c6b['filters']),_0x4dc6b6);if(_0x66f374['query']['filter']){_0x2d5f13[_0x92bb('0x3c')]=_[_0x92bb('0x3e')](_0x2d5f13['where'],{'$or':_[_0x92bb('0x2d')](_0x4dc6b6,function(_0x5762fa){if(_0x5762fa['type']!==_0x92bb('0x3f')){var _0x56b35f={};_0x56b35f[_0x5762fa[_0x92bb('0x2a')]]={'$like':'%'+_0x66f374[_0x92bb('0x33')][_0x92bb('0x40')]+'%'};return _0x56b35f;}})});}_0x2d5f13=_[_0x92bb('0x3e')]({},_0x2d5f13,_0x66f374['options']);var _0x5b3558={'where':_0x2d5f13['where']};return db[_0x92bb('0x2e')][_0x92bb('0x20')](_0x5b3558)['then'](function(_0x4a8053){_0x4592c5['count']=_0x4a8053;if(_0x66f374[_0x92bb('0x33')][_0x92bb('0x41')]){_0x2d5f13[_0x92bb('0x42')]=[{'all':!![]}];}return db[_0x92bb('0x2e')]['findAll'](_0x2d5f13);})[_0x92bb('0x27')](function(_0x2541bb){_0x4592c5['rows']=_0x2541bb;return _0x4592c5;})[_0x92bb('0x27')](respondWithFilteredResult(_0x51f3de,_0x2d5f13))['catch'](handleError(_0x51f3de,null));};exports[_0x92bb('0x43')]=function(_0xfd485a,_0x53fd31){var _0x34c66c={'raw':!![],'where':{'id':_0xfd485a[_0x92bb('0x44')]['id']}},_0x23d7a0={};_0x23d7a0['model']=_[_0x92bb('0x34')](db['ChatInternalMessage'][_0x92bb('0x2f')]);_0x23d7a0[_0x92bb('0x33')]=_[_0x92bb('0x34')](_0xfd485a['query']);_0x23d7a0[_0x92bb('0x45')]=_[_0x92bb('0x35')](_0x23d7a0[_0x92bb('0x32')],_0x23d7a0['query']);_0x34c66c['attributes']=_['intersection'](_0x23d7a0['model'],qs[_0x92bb('0x36')](_0xfd485a['query'][_0x92bb('0x36')]));_0x34c66c['attributes']=_0x34c66c['attributes']['length']?_0x34c66c[_0x92bb('0x37')]:_0x23d7a0[_0x92bb('0x32')];if(_0xfd485a[_0x92bb('0x33')]['includeAll']){_0x34c66c[_0x92bb('0x42')]=[{'all':!![]}];}_0x34c66c=_[_0x92bb('0x3e')]({},_0x34c66c,_0xfd485a[_0x92bb('0x46')]);return db['ChatInternalMessage'][_0x92bb('0x47')](_0x34c66c)['then'](handleEntityNotFound(_0x53fd31,null))[_0x92bb('0x27')](respondWithResult(_0x53fd31,null))['catch'](handleError(_0x53fd31,null));};exports[_0x92bb('0x48')]=function(_0x454e19,_0x3745d6){return db[_0x92bb('0x2e')]['create'](_0x454e19[_0x92bb('0x49')],{})['then'](respondWithResult(_0x3745d6,0xc9))[_0x92bb('0x4a')](handleError(_0x3745d6,null));};exports[_0x92bb('0x26')]=function(_0x568cdd,_0x1cc939){if(_0x568cdd[_0x92bb('0x49')]['id']){delete _0x568cdd[_0x92bb('0x49')]['id'];}return db[_0x92bb('0x2e')][_0x92bb('0x47')]({'where':{'id':_0x568cdd[_0x92bb('0x44')]['id']}})[_0x92bb('0x27')](handleEntityNotFound(_0x1cc939,null))[_0x92bb('0x27')](saveUpdates(_0x568cdd[_0x92bb('0x49')],null))['then'](respondWithResult(_0x1cc939,null))[_0x92bb('0x4a')](handleError(_0x1cc939,null));};exports['destroy']=function(_0x5eccc5,_0x661ef){return db[_0x92bb('0x2e')][_0x92bb('0x47')]({'where':{'id':_0x5eccc5[_0x92bb('0x44')]['id']}})['then'](handleEntityNotFound(_0x661ef,null))[_0x92bb('0x27')](removeEntity(_0x661ef,null))[_0x92bb('0x4a')](handleError(_0x661ef,null));};exports[_0x92bb('0x4b')]=function(_0xe91c9b,_0x189595){return db[_0x92bb('0x2e')][_0x92bb('0x4b')]()[_0x92bb('0x27')](respondWithResult(_0x189595,null))[_0x92bb('0x4a')](handleError(_0x189595,null));};function wrapUser(_0x44d6f4){return function(_0x302cb2){var _0x24dfdb=_0x44d6f4[_0x92bb('0x4c')]({'plain':!![]});_0x24dfdb[_0x92bb('0x4d')]=[];if(_0x302cb2){_0x24dfdb[_0x92bb('0x4e')]=_0x302cb2[_0x92bb('0x4f')];_0x24dfdb[_0x92bb('0x50')]=_0x302cb2;}else{_0x24dfdb[_0x92bb('0x4e')]=moment(0x0)[_0x92bb('0x51')](_0x92bb('0x52'));_0x24dfdb[_0x92bb('0x50')]={};}return _0x24dfdb;};}exports[_0x92bb('0x53')]=function(_0x3e27a1,_0x52433f,_0x2e8cdc){var _0x445d78=[];return db[_0x92bb('0x54')]['findAll']({'where':{'role':['agent',_0x92bb('0x55'),_0x92bb('0x56')]},'attributes':['id','fullname',_0x92bb('0x2a'),'role','userpic',_0x92bb('0x57'),_0x92bb('0x58'),_0x92bb('0x59'),_0x92bb('0x5a'),'showWebBar'],'order':qs[_0x92bb('0x3b')](_0x92bb('0x5b')),'include':[{'model':db[_0x92bb('0x5c')],'as':_0x92bb('0x5d'),'attributes':['id',_0x92bb('0x2a'),'type'],'through':{'attributes':[]}}]})[_0x92bb('0x27')](function(_0x2ba634){if(_0x2ba634){var _0x3356bd=_0x3e27a1[_0x92bb('0x56')][_0x92bb('0x4c')]({'plain':!![]});if(!_0x3356bd)throw new Error(_0x92bb('0x5e'));if(_0x3356bd[_0x92bb('0x5f')]==='user'){return db[_0x92bb('0x60')][_0x92bb('0x47')]({'where':{'name':'Agents','userProfileId':_0x3356bd['userProfileId']},'raw':!![]})[_0x92bb('0x27')](function(_0xf906d0){if(_0xf906d0){if(_0xf906d0[_0x92bb('0x61')]===0x0){return db['UserProfileResource'][_0x92bb('0x62')]({'where':{'sectionId':_0xf906d0['id']},'raw':!![]})[_0x92bb('0x27')](function(_0x20e01f){var _0xc827e8=[];if(_['isEmpty'](_0x20e01f)){_0xc827e8=_[_0x92bb('0x40')](_0x2ba634,function(_0x2c1507){if(_0x2c1507['role']!==_0x92bb('0x63')){return _0x2c1507;}});return _0xc827e8;}else{for(var _0x420ef7=0x0;_0x420ef7<_0x2ba634['length'];_0x420ef7++){var _0x5350f5=_0x2ba634[_0x420ef7];if(_0x5350f5['role']===_0x92bb('0x63')){var _0x39199a=_[_0x92bb('0x47')](_0x20e01f,function(_0x512076){return _0x512076[_0x92bb('0x64')]===_0x5350f5['id'];});if(_0x39199a)_0xc827e8[_0x92bb('0x65')](_0x5350f5);}else{_0xc827e8['push'](_0x5350f5);}}return _0xc827e8;}});}else{return _0x2ba634;}}else{var _0x1bab42=_['filter'](_0x2ba634,function(_0x55ecf1){if(_0x55ecf1[_0x92bb('0x5f')]!=='agent'){return _0x55ecf1;}});return _0x1bab42;}});}else{return _0x2ba634;}}})[_0x92bb('0x27')](function(_0xe6254f){var _0x19ce2b=[];if(_0xe6254f){_0x445d78=_0xe6254f;for(var _0x2bc1d6=0x0;_0x2bc1d6<_0xe6254f[_0x92bb('0x38')];_0x2bc1d6+=0x1){_0x445d78[_0x2bc1d6]['messages']=[];_0x19ce2b[_0x92bb('0x65')](db[_0x92bb('0x2e')][_0x92bb('0x47')]({'where':{'FromId':[_0x3e27a1[_0x92bb('0x56')]['id'],_0xe6254f[_0x2bc1d6]['id']],'ToId':[_0x3e27a1['user']['id'],_0xe6254f[_0x2bc1d6]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x92bb('0x66'),_0x92bb('0x67'),_0x92bb('0x68'),_0x92bb('0x49')],'order':qs[_0x92bb('0x3b')](_0x92bb('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0xe6254f[_0x2bc1d6])));}return BPromise[_0x92bb('0x6a')](_0x19ce2b);}return[];})[_0x92bb('0x27')](function(_0x515639){return{'rows':_0x515639,'count':_0x515639[_0x92bb('0x38')]};})[_0x92bb('0x27')](respondWithResult(_0x52433f,null))[_0x92bb('0x4a')](handleError(_0x52433f,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 77c7af8..aaf5337 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 _0xec25=['hook','exports','events','setMaxListeners','update','remove','emit'];(function(_0x1000a4,_0x5ac0b7){var _0x9d47e7=function(_0x407580){while(--_0x407580){_0x1000a4['push'](_0x1000a4['shift']());}};_0x9d47e7(++_0x5ac0b7);}(_0xec25,0x136));var _0x5ec2=function(_0x11fa62,_0x26435b){_0x11fa62=_0x11fa62-0x0;var _0x4fe256=_0xec25[_0x11fa62];return _0x4fe256;};'use strict';var EventEmitter=require(_0x5ec2('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x5ec2('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5ec2('0x2'),'afterDestroy':_0x5ec2('0x3')};function emitEvent(_0x4f0513){return function(_0x2e4d23,_0x5f1aa6,_0x55aa6c){ChatInternalMessageEvents[_0x5ec2('0x4')](_0x4f0513+':'+_0x2e4d23['id'],_0x2e4d23);ChatInternalMessageEvents[_0x5ec2('0x4')](_0x4f0513,_0x2e4d23);_0x55aa6c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x5ec2('0x5')](e,emitEvent(event));}}module[_0x5ec2('0x6')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x00ca=['events','../../mysqldb','save','remove','emit','hasOwnProperty'];(function(_0x2ed636,_0x3e4f62){var _0x39224c=function(_0x379fcd){while(--_0x379fcd){_0x2ed636['push'](_0x2ed636['shift']());}};_0x39224c(++_0x3e4f62);}(_0x00ca,0x96));var _0xa00c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x00ca[_0x502c7d];return _0x30b7ed;};'use strict';var EventEmitter=require(_0xa00c('0x0'));var ChatInternalMessage=require(_0xa00c('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa00c('0x2'),'afterUpdate':'update','afterDestroy':_0xa00c('0x3')};function emitEvent(_0x5d01cd){return function(_0x1b8f74,_0xe42dbd,_0x31b9e7){ChatInternalMessageEvents[_0xa00c('0x4')](_0x5d01cd+':'+_0x1b8f74['id'],_0x1b8f74);ChatInternalMessageEvents[_0xa00c('0x4')](_0x5d01cd,_0x1b8f74);_0x31b9e7(null);};}for(var e in events){if(events[_0xa00c('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index a18edca..2f4d538 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 _0xe744=['rimraf','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','path'];(function(_0x42a9ef,_0x30f310){var _0x521ca0=function(_0x2688a9){while(--_0x2688a9){_0x42a9ef['push'](_0x42a9ef['shift']());}};_0x521ca0(++_0x30f310);}(_0xe744,0x11b));var _0x4e74=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xe744[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0x4e74('0x0'));var util=require(_0x4e74('0x1'));var logger=require('../../config/logger')(_0x4e74('0x2'));var moment=require('moment');var BPromise=require(_0x4e74('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e74('0x4'));var rimraf=require(_0x4e74('0x5'));var config=require(_0x4e74('0x6'));var attributes=require(_0x4e74('0x7'));module[_0x4e74('0x8')]=function(_0x3a91f8,_0x453096){return _0x3a91f8['define'](_0x4e74('0x9'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4e74('0xa'),'collate':_0x4e74('0xb')});}; \ No newline at end of file +var _0x9005=['define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./chatInternalMessage.attributes','exports'];(function(_0x321327,_0x4965b){var _0x33be38=function(_0x27e02c){while(--_0x27e02c){_0x321327['push'](_0x321327['shift']());}};_0x33be38(++_0x4965b);}(_0x9005,0x138));var _0x5900=function(_0x420a5b,_0x26c365){_0x420a5b=_0x420a5b-0x0;var _0x1a4f26=_0x9005[_0x420a5b];return _0x1a4f26;};'use strict';var _=require(_0x5900('0x0'));var util=require(_0x5900('0x1'));var logger=require(_0x5900('0x2'))(_0x5900('0x3'));var moment=require(_0x5900('0x4'));var BPromise=require(_0x5900('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5900('0x6'));var rimraf=require(_0x5900('0x7'));var config=require('../../config/environment');var attributes=require(_0x5900('0x8'));module[_0x5900('0x9')]=function(_0x5c5447,_0x243850){return _0x5c5447[_0x5900('0xa')](_0x5900('0xb'),attributes,{'tableName':_0x5900('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5900('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 7471494..a6802d8 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 _0xc913=['result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x4bee59,_0x48f132){var _0x3ed6bb=function(_0x2b6c48){while(--_0x2b6c48){_0x4bee59['push'](_0x4bee59['shift']());}};_0x3ed6bb(++_0x48f132);}(_0xc913,0xd9));var _0x3c91=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xc913[_0x2160a9];return _0xa88cf7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3c91('0x0'));var BPromise=require(_0x3c91('0x1'));var rs=require(_0x3c91('0x2'));var fs=require('fs');var Redis=require(_0x3c91('0x3'));var db=require(_0x3c91('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3c91('0x5'))(_0x3c91('0x6'));var config=require(_0x3c91('0x7'));var jayson=require(_0x3c91('0x8'));var client=jayson[_0x3c91('0x9')][_0x3c91('0xa')]({'port':0x232a});config['redis']=_[_0x3c91('0xb')](config[_0x3c91('0xc')],{'host':_0x3c91('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3c91('0xe'))[_0x3c91('0xf')](socket);function respondWithRpcPromise(_0x459f45,_0x4c769d,_0x86299f){return new BPromise(function(_0x4ebcee,_0x7057d0){return client[_0x3c91('0x10')](_0x459f45,_0x86299f)[_0x3c91('0x11')](function(_0x455fe5){logger['info'](_0x3c91('0x12'),_0x4c769d,_0x3c91('0x13'));logger[_0x3c91('0x14')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x4c769d,_0x3c91('0x13'),JSON[_0x3c91('0x15')](_0x455fe5));if(_0x455fe5[_0x3c91('0x16')]){if(_0x455fe5[_0x3c91('0x16')][_0x3c91('0x17')]===0x1f4){logger[_0x3c91('0x16')](_0x3c91('0x12'),_0x4c769d,_0x455fe5[_0x3c91('0x16')][_0x3c91('0x18')]);return _0x7057d0(_0x455fe5['error'][_0x3c91('0x18')]);}logger[_0x3c91('0x16')](_0x3c91('0x12'),_0x4c769d,_0x455fe5[_0x3c91('0x16')]['message']);return _0x4ebcee(_0x455fe5[_0x3c91('0x16')]['message']);}else{logger[_0x3c91('0x19')](_0x3c91('0x12'),_0x4c769d,'request\x20sent');_0x4ebcee(_0x455fe5[_0x3c91('0x1a')][_0x3c91('0x18')]);}})['catch'](function(_0x45deb9){logger[_0x3c91('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x4c769d,_0x45deb9);_0x7057d0(_0x45deb9);});});} \ No newline at end of file +var _0xb877=['then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request'];(function(_0x508232,_0x43af25){var _0x2b761d=function(_0x306a62){while(--_0x306a62){_0x508232['push'](_0x508232['shift']());}};_0x2b761d(++_0x43af25);}(_0xb877,0x1cb));var _0x7b87=function(_0x13b433,_0x285036){_0x13b433=_0x13b433-0x0;var _0x4db0aa=_0xb877[_0x13b433];return _0x4db0aa;};'use strict';var _=require(_0x7b87('0x0'));var util=require(_0x7b87('0x1'));var moment=require(_0x7b87('0x2'));var BPromise=require(_0x7b87('0x3'));var rs=require(_0x7b87('0x4'));var fs=require('fs');var Redis=require(_0x7b87('0x5'));var db=require(_0x7b87('0x6'))['db'];var utils=require(_0x7b87('0x7'));var logger=require(_0x7b87('0x8'))(_0x7b87('0x9'));var config=require(_0x7b87('0xa'));var jayson=require(_0x7b87('0xb'));var client=jayson[_0x7b87('0xc')][_0x7b87('0xd')]({'port':0x232a});config[_0x7b87('0xe')]=_[_0x7b87('0xf')](config[_0x7b87('0xe')],{'host':_0x7b87('0x10'),'port':0x18eb});var socket=require(_0x7b87('0x11'))(new Redis(config[_0x7b87('0xe')]));require(_0x7b87('0x12'))[_0x7b87('0x13')](socket);function respondWithRpcPromise(_0x5a0e91,_0xa8d5cc,_0x3215c7){return new BPromise(function(_0x222760,_0x2f6040){return client[_0x7b87('0x14')](_0x5a0e91,_0x3215c7)[_0x7b87('0x15')](function(_0x466403){logger[_0x7b87('0x16')](_0x7b87('0x17'),_0xa8d5cc,_0x7b87('0x18'));logger[_0x7b87('0x19')](_0x7b87('0x1a'),_0xa8d5cc,'request\x20sent',JSON['stringify'](_0x466403));if(_0x466403['error']){if(_0x466403['error']['code']===0x1f4){logger[_0x7b87('0x1b')](_0x7b87('0x17'),_0xa8d5cc,_0x466403[_0x7b87('0x1b')][_0x7b87('0x1c')]);return _0x2f6040(_0x466403[_0x7b87('0x1b')][_0x7b87('0x1c')]);}logger[_0x7b87('0x1b')](_0x7b87('0x17'),_0xa8d5cc,_0x466403['error']['message']);return _0x222760(_0x466403[_0x7b87('0x1b')][_0x7b87('0x1c')]);}else{logger[_0x7b87('0x16')](_0x7b87('0x17'),_0xa8d5cc,_0x7b87('0x18'));_0x222760(_0x466403[_0x7b87('0x1d')][_0x7b87('0x1c')]);}})['catch'](function(_0x4456c7){logger[_0x7b87('0x1b')]('ChatInternalMessage,\x20%s,\x20%s',_0xa8d5cc,_0x4456c7);_0x2f6040(_0x4456c7);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 9356e76..76a6b9a 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 _0xbacc=['register','./chatInternalMessage.events','save','remove','update','emit','removeListener'];(function(_0x1034ca,_0x14ecd6){var _0x1a023a=function(_0x2cfa65){while(--_0x2cfa65){_0x1034ca['push'](_0x1034ca['shift']());}};_0x1a023a(++_0x14ecd6);}(_0xbacc,0x182));var _0xcbac=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0xbacc[_0x42f009];return _0x22a1e0;};'use strict';var ChatInternalMessageEvents=require(_0xcbac('0x0'));var events=[_0xcbac('0x1'),_0xcbac('0x2'),_0xcbac('0x3')];function createListener(_0x59bc2d,_0x28f045){return function(_0x85139b){_0x28f045[_0xcbac('0x4')](_0x59bc2d,_0x85139b);};}function removeListener(_0xd3bec9,_0x32973c){return function(){ChatInternalMessageEvents[_0xcbac('0x5')](_0xd3bec9,_0x32973c);};}exports[_0xcbac('0x6')]=function(_0x455760){for(var _0x141a0b=0x0,_0x17e8ad=events['length'];_0x141a0b<_0x17e8ad;_0x141a0b++){var _0x5e18ab=events[_0x141a0b];var _0x3dd945=createListener('chatInternalMessage:'+_0x5e18ab,_0x455760);ChatInternalMessageEvents['on'](_0x5e18ab,_0x3dd945);}}; \ No newline at end of file +var _0xdc9c=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','update'];(function(_0x197884,_0x4ecf5f){var _0x33b1af=function(_0x4fae72){while(--_0x4fae72){_0x197884['push'](_0x197884['shift']());}};_0x33b1af(++_0x4ecf5f);}(_0xdc9c,0x9d));var _0xcdc9=function(_0x30a0c0,_0x41014c){_0x30a0c0=_0x30a0c0-0x0;var _0x42cbdf=_0xdc9c[_0x30a0c0];return _0x42cbdf;};'use strict';var ChatInternalMessageEvents=require(_0xcdc9('0x0'));var events=[_0xcdc9('0x1'),'remove',_0xcdc9('0x2')];function createListener(_0x152b40,_0x8d4057){return function(_0x42f536){_0x8d4057[_0xcdc9('0x3')](_0x152b40,_0x42f536);};}function removeListener(_0x23bc59,_0x1139d6){return function(){ChatInternalMessageEvents[_0xcdc9('0x4')](_0x23bc59,_0x1139d6);};}exports[_0xcdc9('0x5')]=function(_0x446c89){for(var _0x502830=0x0,_0x3a71bc=events[_0xcdc9('0x6')];_0x502830<_0x3a71bc;_0x502830++){var _0x104dae=events[_0x502830];var _0x27d0c3=createListener(_0xcdc9('0x7')+_0x104dae,_0x446c89);ChatInternalMessageEvents['on'](_0x104dae,_0x27d0c3);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 46f00c3..c4a2fd5 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 _0x0ec8=['express','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','getUsers','post','/:id','update','delete','destroy','exports','multer','util'];(function(_0x74118b,_0x239694){var _0x257525=function(_0x531db8){while(--_0x531db8){_0x74118b['push'](_0x74118b['shift']());}};_0x257525(++_0x239694);}(_0x0ec8,0x167));var _0x80ec=function(_0x3dbc19,_0x2ac491){_0x3dbc19=_0x3dbc19-0x0;var _0x50a54e=_0x0ec8[_0x3dbc19];return _0x50a54e;};'use strict';var multer=require(_0x80ec('0x0'));var util=require(_0x80ec('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x80ec('0x2'));var router=express['Router']();var fs_extra=require(_0x80ec('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x80ec('0x4'));var config=require(_0x80ec('0x5'));var controller=require(_0x80ec('0x6'));router[_0x80ec('0x7')]('/',auth[_0x80ec('0x8')](),controller['index']);router[_0x80ec('0x7')](_0x80ec('0x9'),auth[_0x80ec('0x8')](),controller[_0x80ec('0xa')]);router[_0x80ec('0x7')](_0x80ec('0xb'),auth['isAuthenticated'](),controller[_0x80ec('0xc')]);router[_0x80ec('0x7')]('/:id',auth[_0x80ec('0x8')](),controller['show']);router[_0x80ec('0xd')]('/',auth[_0x80ec('0x8')](),controller['create']);router['put'](_0x80ec('0xe'),controller[_0x80ec('0xf')]);router[_0x80ec('0x10')](_0x80ec('0xe'),auth['isAuthenticated'](),controller[_0x80ec('0x11')]);module[_0x80ec('0x12')]=router; \ No newline at end of file +var _0xdac2=['path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','describe','/users','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x22d292,_0x2d85fd){var _0x36a152=function(_0xb76399){while(--_0xb76399){_0x22d292['push'](_0x22d292['shift']());}};_0x36a152(++_0x2d85fd);}(_0xdac2,0x72));var _0x2dac=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0xdac2[_0x22f8ab];return _0x2a70e5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2dac('0x0'));var timeout=require(_0x2dac('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2dac('0x2'));var auth=require(_0x2dac('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2dac('0x4'));var controller=require(_0x2dac('0x5'));router[_0x2dac('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2dac('0x6')](_0x2dac('0x7'),auth[_0x2dac('0x8')](),controller[_0x2dac('0x9')]);router[_0x2dac('0x6')](_0x2dac('0xa'),auth[_0x2dac('0x8')](),controller['getUsers']);router[_0x2dac('0x6')](_0x2dac('0xb'),auth[_0x2dac('0x8')](),controller[_0x2dac('0xc')]);router[_0x2dac('0xd')]('/',auth[_0x2dac('0x8')](),controller[_0x2dac('0xe')]);router[_0x2dac('0xf')](_0x2dac('0xb'),controller['update']);router[_0x2dac('0x10')](_0x2dac('0xb'),auth[_0x2dac('0x8')](),controller[_0x2dac('0x11')]);module[_0x2dac('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index cfbd012..f5cf779 100644 --- a/server/api/chatMessage/chatMessage.attributes.js +++ b/server/api/chatMessage/chatMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x65c9=['exports','medium','BOOLEAN','ENUM','out','DATE','STRING','TEXT','sequelize'];(function(_0x5a6503,_0x4935fd){var _0x3692ab=function(_0x27c9ee){while(--_0x27c9ee){_0x5a6503['push'](_0x5a6503['shift']());}};_0x3692ab(++_0x4935fd);}(_0x65c9,0x182));var _0x965c=function(_0x5ed682,_0x3a7d4c){_0x5ed682=_0x5ed682-0x0;var _0x3024be=_0x65c9[_0x5ed682];return _0x3024be;};'use strict';var Sequelize=require(_0x965c('0x0'));module[_0x965c('0x1')]={'body':{'type':Sequelize['TEXT'](_0x965c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x965c('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x965c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x965c('0x4')]('in',_0x965c('0x5')),'defaultValue':_0x965c('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x965c('0x6')]},'providerName':{'type':Sequelize[_0x965c('0x7')]},'providerResponse':{'type':Sequelize[_0x965c('0x8')]}}; \ No newline at end of file +var _0x4c71=['STRING','TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x3d9ec7,_0x59d1f3){var _0x500f81=function(_0x39dad8){while(--_0x39dad8){_0x3d9ec7['push'](_0x3d9ec7['shift']());}};_0x500f81(++_0x59d1f3);}(_0x4c71,0x12b));var _0x14c7=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x4c71[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0x14c7('0x0'));module[_0x14c7('0x1')]={'body':{'type':Sequelize['TEXT'](_0x14c7('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x14c7('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x14c7('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x14c7('0x4')]('in',_0x14c7('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x14c7('0x6')]},'providerName':{'type':Sequelize[_0x14c7('0x7')]},'providerResponse':{'type':Sequelize[_0x14c7('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index caa4ecc..6654b10 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 _0x9158=['ChatMessage','fieldName','type','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','chat-interactions','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','ChatInteractionId','RejectMessage','rejectMessage','ContactId','contact','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./chatMessage.socket','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','name','index'];(function(_0x22377a,_0x3397cb){var _0x36f105=function(_0x2174cc){while(--_0x2174cc){_0x22377a['push'](_0x22377a['shift']());}};_0x36f105(++_0x3397cb);}(_0x9158,0xcc));var _0x8915=function(_0xd58577,_0x4a704e){_0xd58577=_0xd58577-0x0;var _0x2dc319=_0x9158[_0xd58577];return _0x2dc319;};'use strict';var emlformat=require(_0x8915('0x0'));var rimraf=require(_0x8915('0x1'));var zipdir=require(_0x8915('0x2'));var jsonpatch=require(_0x8915('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8915('0x4'));var Mustache=require('mustache');var util=require(_0x8915('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8915('0x6'));var ejs=require(_0x8915('0x7'));var fs=require('fs');var fs_extra=require(_0x8915('0x8'));var _=require('lodash');var squel=require(_0x8915('0x9'));var crypto=require(_0x8915('0xa'));var jsforce=require(_0x8915('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8915('0x6'));var querystring=require(_0x8915('0xc'));var Papa=require(_0x8915('0xd'));var Redis=require(_0x8915('0xe'));var authService=require(_0x8915('0xf'));var qs=require(_0x8915('0x10'));var as=require(_0x8915('0x11'));var hardwareService=require(_0x8915('0x12'));var logger=require(_0x8915('0x13'))(_0x8915('0x14'));var utils=require(_0x8915('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8915('0x16'));var db=require('../../mysqldb')['db'];config[_0x8915('0x17')]=_[_0x8915('0x18')](config['redis'],{'host':_0x8915('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8915('0x17')]));require(_0x8915('0x1a'))['register'](socket);var jayson=require(_0x8915('0x1b'));var client=jayson[_0x8915('0x1c')][_0x8915('0x1d')]({'port':0x232c});var client9002=jayson[_0x8915('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x251f07,_0x545f70,_0x520004,_0xd054cc){return new BPromise(function(_0x415dd5,_0x5ae0aa){var _0x3932f3=_0xd054cc||client;return _0x3932f3[_0x8915('0x1e')](_0x251f07,_0x520004)[_0x8915('0x1f')](function(_0x25e23b){logger[_0x8915('0x20')](_0x8915('0x21'),_0x545f70,_0x8915('0x22'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x545f70,_0x8915('0x22'),JSON[_0x8915('0x23')](_0x25e23b));if(_0x25e23b['error']){if(_0x25e23b[_0x8915('0x24')][_0x8915('0x25')]===0x1f4){logger[_0x8915('0x24')]('ChatMessage,\x20%s,\x20%s',_0x545f70,_0x25e23b[_0x8915('0x24')][_0x8915('0x26')]);return _0x5ae0aa(_0x25e23b['error'][_0x8915('0x26')]);}logger[_0x8915('0x24')](_0x8915('0x21'),_0x545f70,_0x25e23b[_0x8915('0x24')][_0x8915('0x26')]);return _0x415dd5(_0x25e23b[_0x8915('0x24')][_0x8915('0x26')]);}else{logger[_0x8915('0x20')]('ChatMessage,\x20%s,\x20%s',_0x545f70,_0x8915('0x22'));_0x415dd5(_0x25e23b[_0x8915('0x27')][_0x8915('0x26')]);}})['catch'](function(_0x62f920){logger[_0x8915('0x24')](_0x8915('0x21'),_0x545f70,_0x62f920);_0x5ae0aa(_0x62f920);});});}function respondWithStatusCode(_0x637d72,_0x4bfa67){_0x4bfa67=_0x4bfa67||0xcc;return function(_0x369b65){if(_0x369b65){return _0x637d72[_0x8915('0x28')](_0x4bfa67);}return _0x637d72[_0x8915('0x29')](_0x4bfa67)['end']();};}function respondWithResult(_0x1de901,_0x42ae76){_0x42ae76=_0x42ae76||0xc8;return function(_0x3005a9){if(_0x3005a9){return _0x1de901[_0x8915('0x29')](_0x42ae76)['json'](_0x3005a9);}};}function respondWithFilteredResult(_0x3dedf2,_0x10a1e1){return function(_0x542639){if(_0x542639){var _0x1c3132=typeof _0x10a1e1[_0x8915('0x2a')]===_0x8915('0x2b')&&typeof _0x10a1e1[_0x8915('0x2c')]===_0x8915('0x2b');var _0x5400f5=_0x542639[_0x8915('0x2d')];var _0xffecec=_0x1c3132?0x0:_0x10a1e1[_0x8915('0x2a')];var _0x5f5324=_0x1c3132?_0x542639[_0x8915('0x2d')]:_0x10a1e1[_0x8915('0x2a')]+_0x10a1e1[_0x8915('0x2c')];var _0x1032e9;if(_0x5f5324>=_0x5400f5){_0x5f5324=_0x5400f5;_0x1032e9=0xc8;}else{_0x1032e9=0xce;}_0x3dedf2['status'](_0x1032e9);return _0x3dedf2[_0x8915('0x2e')]('Content-Range',_0xffecec+'-'+_0x5f5324+'/'+_0x5400f5)[_0x8915('0x2f')](_0x542639);}return null;};}function patchUpdates(_0x12a613){return function(_0x19c6a8){try{jsonpatch[_0x8915('0x30')](_0x19c6a8,_0x12a613,!![]);}catch(_0x2fd813){return BPromise[_0x8915('0x31')](_0x2fd813);}return _0x19c6a8[_0x8915('0x32')]();};}function saveUpdates(_0x3a29d7,_0xe22ef9){return function(_0x2089f8){if(_0x2089f8){return _0x2089f8[_0x8915('0x33')](_0x3a29d7)[_0x8915('0x1f')](function(_0x2210ba){return _0x2210ba;});}return null;};}function removeEntity(_0x168233,_0x538d61){return function(_0x2b7e08){if(_0x2b7e08){return _0x2b7e08[_0x8915('0x34')]()['then'](function(){_0x168233['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4116e6,_0x5c9dd6){return function(_0x509532){if(!_0x509532){_0x4116e6[_0x8915('0x28')](0x194);}return _0x509532;};}function handleError(_0x135876,_0x25726f){_0x25726f=_0x25726f||0x1f4;return function(_0x243115){logger[_0x8915('0x24')](_0x243115[_0x8915('0x35')]);if(_0x243115[_0x8915('0x36')]){delete _0x243115['name'];}_0x135876['status'](_0x25726f)['send'](_0x243115);};}exports[_0x8915('0x37')]=function(_0x7350b4,_0x1a65d1){var _0x57cf14={},_0xb7bd1d={},_0x117e6e={'count':0x0,'rows':[]};var _0x234ee9=_['map'](db[_0x8915('0x38')]['rawAttributes'],function(_0xf28aef){return{'name':_0xf28aef[_0x8915('0x39')],'type':_0xf28aef[_0x8915('0x3a')]['key']};});_0xb7bd1d[_0x8915('0x3b')]=_[_0x8915('0x3c')](_0x234ee9,_0x8915('0x36'));_0xb7bd1d[_0x8915('0x3d')]=_[_0x8915('0x3e')](_0x7350b4[_0x8915('0x3d')]);_0xb7bd1d['filters']=_[_0x8915('0x3f')](_0xb7bd1d[_0x8915('0x3b')],_0xb7bd1d['query']);_0x57cf14['attributes']=_[_0x8915('0x3f')](_0xb7bd1d[_0x8915('0x3b')],qs[_0x8915('0x40')](_0x7350b4[_0x8915('0x3d')][_0x8915('0x40')]));_0x57cf14[_0x8915('0x41')]=_0x57cf14[_0x8915('0x41')][_0x8915('0x42')]?_0x57cf14[_0x8915('0x41')]:_0xb7bd1d[_0x8915('0x3b')];if(!_0x7350b4[_0x8915('0x3d')][_0x8915('0x43')](_0x8915('0x44'))){_0x57cf14[_0x8915('0x2c')]=qs['limit'](_0x7350b4['query']['limit']);_0x57cf14[_0x8915('0x2a')]=qs['offset'](_0x7350b4[_0x8915('0x3d')]['offset']);}_0x57cf14[_0x8915('0x45')]=qs['sort'](_0x7350b4[_0x8915('0x3d')][_0x8915('0x46')]);_0x57cf14[_0x8915('0x47')]=qs[_0x8915('0x48')](_['pick'](_0x7350b4[_0x8915('0x3d')],_0xb7bd1d[_0x8915('0x48')]),_0x234ee9);if(_0x7350b4['query'][_0x8915('0x49')]){_0x57cf14[_0x8915('0x47')]=_[_0x8915('0x4a')](_0x57cf14[_0x8915('0x47')],{'$or':_[_0x8915('0x3c')](_0x234ee9,function(_0x56f25e){if(_0x56f25e['type']!==_0x8915('0x4b')){var _0x3e5949={};_0x3e5949[_0x56f25e['name']]={'$like':'%'+_0x7350b4[_0x8915('0x3d')][_0x8915('0x49')]+'%'};return _0x3e5949;}})});}_0x57cf14=_[_0x8915('0x4a')]({},_0x57cf14,_0x7350b4[_0x8915('0x4c')]);var _0x45a813={'where':_0x57cf14[_0x8915('0x47')]};return db[_0x8915('0x38')][_0x8915('0x2d')](_0x45a813)['then'](function(_0x535dca){_0x117e6e[_0x8915('0x2d')]=_0x535dca;if(_0x7350b4[_0x8915('0x3d')]['includeAll']){_0x57cf14[_0x8915('0x4d')]=[{'all':!![]}];}return db[_0x8915('0x38')][_0x8915('0x4e')](_0x57cf14);})[_0x8915('0x1f')](function(_0x35ee56){_0x117e6e[_0x8915('0x4f')]=_0x35ee56;return _0x117e6e;})['then'](respondWithFilteredResult(_0x1a65d1,_0x57cf14))[_0x8915('0x50')](handleError(_0x1a65d1,null));};exports[_0x8915('0x51')]=function(_0x5c82f4,_0x1d43e1){var _0x5eacb0={'raw':!![],'where':{'id':_0x5c82f4[_0x8915('0x52')]['id']}},_0x3d63c2={};_0x3d63c2[_0x8915('0x3b')]=_[_0x8915('0x3e')](db['ChatMessage'][_0x8915('0x53')]);_0x3d63c2['query']=_[_0x8915('0x3e')](_0x5c82f4[_0x8915('0x3d')]);_0x3d63c2[_0x8915('0x48')]=_['intersection'](_0x3d63c2[_0x8915('0x3b')],_0x3d63c2[_0x8915('0x3d')]);_0x5eacb0[_0x8915('0x41')]=_[_0x8915('0x3f')](_0x3d63c2[_0x8915('0x3b')],qs[_0x8915('0x40')](_0x5c82f4[_0x8915('0x3d')][_0x8915('0x40')]));_0x5eacb0['attributes']=_0x5eacb0['attributes']['length']?_0x5eacb0[_0x8915('0x41')]:_0x3d63c2[_0x8915('0x3b')];if(_0x5c82f4[_0x8915('0x3d')][_0x8915('0x54')]){_0x5eacb0[_0x8915('0x4d')]=[{'all':!![]}];}_0x5eacb0=_['merge']({},_0x5eacb0,_0x5c82f4[_0x8915('0x4c')]);return db[_0x8915('0x38')][_0x8915('0x55')](_0x5eacb0)[_0x8915('0x1f')](handleEntityNotFound(_0x1d43e1,null))['then'](respondWithResult(_0x1d43e1,null))[_0x8915('0x50')](handleError(_0x1d43e1,null));};exports[_0x8915('0x56')]=function(_0xa4ae81,_0x2b199b){return db[_0x8915('0x38')][_0x8915('0x56')](_0xa4ae81[_0x8915('0x57')],{})[_0x8915('0x1f')](respondWithResult(_0x2b199b,0xc9))[_0x8915('0x50')](handleError(_0x2b199b,null));};exports[_0x8915('0x33')]=function(_0x36bbab,_0x5b7028){if(_0x36bbab['body']['id']){delete _0x36bbab[_0x8915('0x57')]['id'];}return db[_0x8915('0x38')][_0x8915('0x55')]({'where':{'id':_0x36bbab[_0x8915('0x52')]['id']}})[_0x8915('0x1f')](handleEntityNotFound(_0x5b7028,null))[_0x8915('0x1f')](saveUpdates(_0x36bbab[_0x8915('0x57')],null))['then'](respondWithResult(_0x5b7028,null))['catch'](handleError(_0x5b7028,null));};exports[_0x8915('0x34')]=function(_0x1f120b,_0x214309){return db[_0x8915('0x38')][_0x8915('0x55')]({'where':{'id':_0x1f120b[_0x8915('0x52')]['id']}})['then'](handleEntityNotFound(_0x214309,null))[_0x8915('0x1f')](removeEntity(_0x214309,null))[_0x8915('0x50')](handleError(_0x214309,null));};exports[_0x8915('0x58')]=function(_0x3756ff,_0x3aeb7e){return db[_0x8915('0x38')][_0x8915('0x58')]()[_0x8915('0x1f')](respondWithResult(_0x3aeb7e,null))[_0x8915('0x50')](handleError(_0x3aeb7e,null));};var interaction_log=require(_0x8915('0x13'))(_0x8915('0x59'));exports['accept']=function(_0x12563b,_0x236412,_0x474c56){var _0x30fda5={'agent':{},'channel':_0x8915('0x5a')};if(_0x12563b[_0x8915('0x57')]['id']){delete _0x12563b['body']['id'];}_0x12563b[_0x8915('0x57')]['read']=!![];_0x12563b['body'][_0x8915('0x5b')]=moment()[_0x8915('0x5c')](_0x8915('0x5d'));_0x12563b[_0x8915('0x57')][_0x8915('0x5e')]=_0x12563b[_0x8915('0x57')][_0x8915('0x5e')]||_0x12563b['user']['id'];_0x30fda5[_0x8915('0x5f')]['id']=_0x12563b[_0x8915('0x57')][_0x8915('0x5e')];return db[_0x8915('0x38')]['find']({'where':{'id':_0x12563b[_0x8915('0x52')]['id'],'UserId':null}})[_0x8915('0x1f')](handleEntityNotFound(_0x236412,null))[_0x8915('0x1f')](saveUpdates(_0x12563b[_0x8915('0x57')],null))[_0x8915('0x1f')](function(_0x9900e7){if(_0x9900e7){_0x30fda5['message']=_0x9900e7[_0x8915('0x60')]({'plain':!![]});return db[_0x8915('0x61')]['find']({'where':{'id':_0x9900e7['ChatInteractionId']}});}return null;})[_0x8915('0x1f')](handleEntityNotFound(_0x236412,null))[_0x8915('0x1f')](function(_0x44b8a7){if(_0x44b8a7){return _0x44b8a7[_0x8915('0x33')]({'UserId':_0x12563b[_0x8915('0x57')][_0x8915('0x5e')],'read1stAt':_[_0x8915('0x62')](_0x44b8a7[_0x8915('0x63')])?moment()[_0x8915('0x5c')](_0x8915('0x5d')):undefined});}return null;})[_0x8915('0x1f')](function(_0x2e4241){if(_0x2e4241){_0x30fda5[_0x8915('0x64')]=_0x2e4241[_0x8915('0x60')]({'plain':!![]});interaction_log[_0x8915('0x20')](_0x8915('0x65'),_0x12563b[_0x8915('0x66')]['id'],_0x12563b[_0x8915('0x66')][_0x8915('0x36')],_0x12563b['user'][_0x8915('0x67')],_0x30fda5[_0x8915('0x64')]['id'],_0x12563b[_0x8915('0x57')]?JSON[_0x8915('0x23')](_0x12563b['body']):'null');return respondWithRpcPromise(_0x8915('0x68'),_0x8915('0x69'),_0x30fda5);}return null;})[_0x8915('0x1f')](function(_0x3a177c){var _0x55fb40=_0x8915('0x6a')+_0x3a177c[_0x8915('0x26')]['ContactId'];return db[_0x8915('0x6b')][_0x8915('0x3d')](_0x55fb40,{'type':db[_0x8915('0x6c')][_0x8915('0x6d')][_0x8915('0x6e')],'raw':!![]})[_0x8915('0x1f')](function(_0x400f62){return _0x400f62;});})[_0x8915('0x1f')](function(_0x7ce557){if(_0x7ce557){_0x30fda5[_0x8915('0x26')]['contact']=_0x7ce557[0x0];if(!_0x12563b[_0x8915('0x57')][_0x8915('0x5e')])return;return db[_0x8915('0x6f')][_0x8915('0x55')]({'where':{'id':_0x12563b[_0x8915('0x57')][_0x8915('0x5e')],'role':_0x8915('0x5f')},'attributes':['id',_0x8915('0x36'),_0x8915('0x70'),_0x8915('0x71'),_0x8915('0x72')],'raw':!![]});}return null;})[_0x8915('0x1f')](function(_0x19210e){if(!_0x19210e)return null;_0x30fda5['message'][_0x8915('0x5f')]=_0x19210e;return _0x30fda5;})[_0x8915('0x1f')](function(_0x570536){if(_0x570536){if(_0x12563b[_0x8915('0x57')][_0x8915('0x73')]){_0x30fda5[_0x8915('0x26')][_0x8915('0x74')]=util[_0x8915('0x5c')](_0x8915('0x75'),_0x12563b[_0x8915('0x66')][_0x8915('0x36')]);_0x30fda5[_0x8915('0x26')][_0x8915('0x76')]=_0x30fda5[_0x8915('0x76')];_0x30fda5['message']['motionChannel']=_0x30fda5['channel'];_0x30fda5[_0x8915('0x26')][_0x8915('0x77')]='accept';return respondWithRpcPromise(_0x8915('0x78'),'EventManager',{'event':_0x8915('0x79'),'message':_[_0x8915('0x4a')](_0x30fda5[_0x8915('0x26')],JSON[_0x8915('0x7a')](_0x30fda5[_0x8915('0x64')]['formData']))},client9002)[_0x8915('0x1f')](function(){return _0x30fda5;});}return _0x30fda5;}return null;})['then'](respondWithResult(_0x236412,null))[_0x8915('0x50')](handleError(_0x236412,null));};var interaction_log=require(_0x8915('0x13'))(_0x8915('0x59'));exports['reject']=function(_0x31135c,_0x595a02,_0x7a587c){var _0x4e4dc8={'agent':{},'channel':_0x8915('0x5a')};if(_0x31135c[_0x8915('0x57')]['id']){delete _0x31135c[_0x8915('0x57')]['id'];}_0x31135c[_0x8915('0x57')][_0x8915('0x5e')]=_0x31135c[_0x8915('0x57')][_0x8915('0x5e')]||_0x31135c[_0x8915('0x66')]['id'];_0x4e4dc8[_0x8915('0x5f')]['id']=_0x31135c['body'][_0x8915('0x5e')];return db[_0x8915('0x38')][_0x8915('0x55')]({'where':{'id':_0x31135c[_0x8915('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x595a02,null))[_0x8915('0x1f')](function(_0x192a44){if(_0x192a44){_0x4e4dc8[_0x8915('0x26')]=_0x192a44['get']({'plain':!![]});return db[_0x8915('0x61')][_0x8915('0x55')]({'where':{'id':_0x192a44[_0x8915('0x7b')]}});}return null;})[_0x8915('0x1f')](handleEntityNotFound(_0x595a02,null))[_0x8915('0x1f')](function(_0x20e03a){if(_0x20e03a){_0x4e4dc8[_0x8915('0x64')]=_0x20e03a[_0x8915('0x60')]({'plain':!![]});interaction_log[_0x8915('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x31135c[_0x8915('0x66')]['id'],_0x31135c[_0x8915('0x66')][_0x8915('0x36')],_0x31135c[_0x8915('0x66')][_0x8915('0x67')],_0x4e4dc8[_0x8915('0x64')]['id'],_0x31135c[_0x8915('0x57')]?JSON['stringify'](_0x31135c['body']):'null');return respondWithRpcPromise(_0x8915('0x7c'),_0x8915('0x7d'),_0x4e4dc8);}return null;})['then'](function(_0x17c8c5){var _0x19da56='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x17c8c5[_0x8915('0x26')][_0x8915('0x7e')];return db[_0x8915('0x6b')]['query'](_0x19da56,{'type':db['Sequelize'][_0x8915('0x6d')][_0x8915('0x6e')],'raw':!![]})[_0x8915('0x1f')](function(_0x551855){return _0x551855;});})[_0x8915('0x1f')](function(_0x58a4fc){if(_0x58a4fc){_0x4e4dc8[_0x8915('0x26')][_0x8915('0x7f')]=_0x58a4fc[0x0];if(!_0x31135c[_0x8915('0x57')]['UserId'])return;return db[_0x8915('0x6f')][_0x8915('0x55')]({'where':{'id':_0x31135c['body'][_0x8915('0x5e')],'role':_0x8915('0x5f')},'attributes':['id',_0x8915('0x36'),_0x8915('0x70'),'email',_0x8915('0x72')],'raw':!![]});}return null;})['then'](function(_0x242267){if(!_0x242267)return null;_0x4e4dc8[_0x8915('0x26')][_0x8915('0x5f')]=_0x242267;return _0x4e4dc8;})[_0x8915('0x1f')](function(_0x5aefdf){if(_0x5aefdf){_0x5aefdf[_0x8915('0x26')][_0x8915('0x74')]=util['format']('SIP/%s',_0x31135c['user'][_0x8915('0x36')]);_0x5aefdf[_0x8915('0x26')]['channel']=_0x4e4dc8[_0x8915('0x76')];_0x5aefdf[_0x8915('0x26')][_0x8915('0x80')]=_0x4e4dc8[_0x8915('0x76')];_0x5aefdf['message'][_0x8915('0x77')]=_0x8915('0x31');respondWithRpcPromise(_0x8915('0x78'),'EventManager',{'event':_0x8915('0x81'),'message':_[_0x8915('0x4a')](_0x4e4dc8['message'],JSON[_0x8915('0x7a')](_0x4e4dc8[_0x8915('0x64')]['formData']))},client9002);return _0x4e4dc8;}return null;})[_0x8915('0x1f')](respondWithResult(_0x595a02,null))[_0x8915('0x50')](handleError(_0x595a02,null));}; \ No newline at end of file +var _0xbae0=['fullname','internal','channel','motionChannel','event','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT','email','interface','rejectmessage','parse','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','sendStatus','name','send','map','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','ChatMessage','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact','User'];(function(_0x1e3aac,_0x5118ba){var _0x4e72d0=function(_0x15648c){while(--_0x15648c){_0x1e3aac['push'](_0x1e3aac['shift']());}};_0x4e72d0(++_0x5118ba);}(_0xbae0,0x198));var _0x0bae=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0xbae0[_0x2c0dc0];return _0x4c0990;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0bae('0x0'));var zipdir=require(_0x0bae('0x1'));var jsonpatch=require(_0x0bae('0x2'));var rp=require('request-promise');var moment=require(_0x0bae('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0bae('0x4'));var util=require(_0x0bae('0x5'));var path=require(_0x0bae('0x6'));var sox=require(_0x0bae('0x7'));var csv=require(_0x0bae('0x8'));var ejs=require(_0x0bae('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0bae('0xa'));var squel=require(_0x0bae('0xb'));var crypto=require('crypto');var jsforce=require(_0x0bae('0xc'));var deskjs=require(_0x0bae('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0bae('0xe'));var Papa=require(_0x0bae('0xf'));var Redis=require(_0x0bae('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0bae('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0bae('0x12'))(_0x0bae('0x13'));var utils=require(_0x0bae('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0bae('0x15'))['db'];config[_0x0bae('0x16')]=_[_0x0bae('0x17')](config[_0x0bae('0x16')],{'host':_0x0bae('0x18'),'port':0x18eb});var socket=require(_0x0bae('0x19'))(new Redis(config[_0x0bae('0x16')]));require(_0x0bae('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x0bae('0x1b')][_0x0bae('0x1c')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59863d,_0x47532d,_0x3339b1,_0x18d4fb){return new BPromise(function(_0x1fc5d0,_0x29b2e4){var _0x2503ea=_0x18d4fb||client;return _0x2503ea[_0x0bae('0x1d')](_0x59863d,_0x3339b1)[_0x0bae('0x1e')](function(_0x4ab4ae){logger[_0x0bae('0x1f')](_0x0bae('0x20'),_0x47532d,_0x0bae('0x21'));logger[_0x0bae('0x22')](_0x0bae('0x23'),_0x47532d,_0x0bae('0x21'),JSON[_0x0bae('0x24')](_0x4ab4ae));if(_0x4ab4ae[_0x0bae('0x25')]){if(_0x4ab4ae[_0x0bae('0x25')][_0x0bae('0x26')]===0x1f4){logger['error'](_0x0bae('0x20'),_0x47532d,_0x4ab4ae[_0x0bae('0x25')][_0x0bae('0x27')]);return _0x29b2e4(_0x4ab4ae[_0x0bae('0x25')][_0x0bae('0x27')]);}logger[_0x0bae('0x25')](_0x0bae('0x20'),_0x47532d,_0x4ab4ae[_0x0bae('0x25')][_0x0bae('0x27')]);return _0x1fc5d0(_0x4ab4ae[_0x0bae('0x25')][_0x0bae('0x27')]);}else{logger[_0x0bae('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x47532d,_0x0bae('0x21'));_0x1fc5d0(_0x4ab4ae[_0x0bae('0x28')][_0x0bae('0x27')]);}})['catch'](function(_0x5c681c){logger[_0x0bae('0x25')](_0x0bae('0x20'),_0x47532d,_0x5c681c);_0x29b2e4(_0x5c681c);});});}function respondWithStatusCode(_0x2fbf18,_0xec47e1){_0xec47e1=_0xec47e1||0xcc;return function(_0x928f78){if(_0x928f78){return _0x2fbf18['sendStatus'](_0xec47e1);}return _0x2fbf18['status'](_0xec47e1)[_0x0bae('0x29')]();};}function respondWithResult(_0x451b59,_0x4b39e3){_0x4b39e3=_0x4b39e3||0xc8;return function(_0x4a5ca6){if(_0x4a5ca6){return _0x451b59[_0x0bae('0x2a')](_0x4b39e3)[_0x0bae('0x2b')](_0x4a5ca6);}};}function respondWithFilteredResult(_0x30e5b5,_0x2bfca5){return function(_0x5f71e6){if(_0x5f71e6){var _0x253647=typeof _0x2bfca5['offset']===_0x0bae('0x2c')&&typeof _0x2bfca5[_0x0bae('0x2d')]===_0x0bae('0x2c');var _0x774b09=_0x5f71e6[_0x0bae('0x2e')];var _0x27d9e7=_0x253647?0x0:_0x2bfca5[_0x0bae('0x2f')];var _0x4494da=_0x253647?_0x5f71e6[_0x0bae('0x2e')]:_0x2bfca5[_0x0bae('0x2f')]+_0x2bfca5[_0x0bae('0x2d')];var _0x13941e;if(_0x4494da>=_0x774b09){_0x4494da=_0x774b09;_0x13941e=0xc8;}else{_0x13941e=0xce;}_0x30e5b5['status'](_0x13941e);return _0x30e5b5[_0x0bae('0x30')](_0x0bae('0x31'),_0x27d9e7+'-'+_0x4494da+'/'+_0x774b09)[_0x0bae('0x2b')](_0x5f71e6);}return null;};}function patchUpdates(_0x39b9c3){return function(_0x566f5c){try{jsonpatch['apply'](_0x566f5c,_0x39b9c3,!![]);}catch(_0x3989e8){return BPromise[_0x0bae('0x32')](_0x3989e8);}return _0x566f5c[_0x0bae('0x33')]();};}function saveUpdates(_0x468075,_0x378d02){return function(_0x213c9c){if(_0x213c9c){return _0x213c9c[_0x0bae('0x34')](_0x468075)[_0x0bae('0x1e')](function(_0x49179c){return _0x49179c;});}return null;};}function removeEntity(_0x16a51f,_0xb7ee57){return function(_0x23b688){if(_0x23b688){return _0x23b688[_0x0bae('0x35')]()[_0x0bae('0x1e')](function(){_0x16a51f[_0x0bae('0x2a')](0xcc)[_0x0bae('0x29')]();});}};}function handleEntityNotFound(_0x50ea7c,_0x4ae12f){return function(_0x505e0d){if(!_0x505e0d){_0x50ea7c[_0x0bae('0x36')](0x194);}return _0x505e0d;};}function handleError(_0x1cd2f2,_0x6d5d68){_0x6d5d68=_0x6d5d68||0x1f4;return function(_0x31ee1e){logger[_0x0bae('0x25')](_0x31ee1e['stack']);if(_0x31ee1e[_0x0bae('0x37')]){delete _0x31ee1e[_0x0bae('0x37')];}_0x1cd2f2[_0x0bae('0x2a')](_0x6d5d68)[_0x0bae('0x38')](_0x31ee1e);};}exports['index']=function(_0x54ed09,_0x4d3a13){var _0x3a2af3={},_0x24e3e1={},_0x3e8d93={'count':0x0,'rows':[]};var _0x455869=_[_0x0bae('0x39')](db['ChatMessage']['rawAttributes'],function(_0x590e49){return{'name':_0x590e49['fieldName'],'type':_0x590e49['type'][_0x0bae('0x3a')]};});_0x24e3e1[_0x0bae('0x3b')]=_[_0x0bae('0x39')](_0x455869,_0x0bae('0x37'));_0x24e3e1['query']=_[_0x0bae('0x3c')](_0x54ed09[_0x0bae('0x3d')]);_0x24e3e1[_0x0bae('0x3e')]=_[_0x0bae('0x3f')](_0x24e3e1['model'],_0x24e3e1[_0x0bae('0x3d')]);_0x3a2af3['attributes']=_[_0x0bae('0x3f')](_0x24e3e1['model'],qs[_0x0bae('0x40')](_0x54ed09[_0x0bae('0x3d')]['fields']));_0x3a2af3['attributes']=_0x3a2af3[_0x0bae('0x41')]['length']?_0x3a2af3['attributes']:_0x24e3e1[_0x0bae('0x3b')];if(!_0x54ed09[_0x0bae('0x3d')][_0x0bae('0x42')]('nolimit')){_0x3a2af3[_0x0bae('0x2d')]=qs[_0x0bae('0x2d')](_0x54ed09[_0x0bae('0x3d')][_0x0bae('0x2d')]);_0x3a2af3[_0x0bae('0x2f')]=qs[_0x0bae('0x2f')](_0x54ed09['query'][_0x0bae('0x2f')]);}_0x3a2af3[_0x0bae('0x43')]=qs['sort'](_0x54ed09['query'][_0x0bae('0x44')]);_0x3a2af3[_0x0bae('0x45')]=qs[_0x0bae('0x3e')](_[_0x0bae('0x46')](_0x54ed09[_0x0bae('0x3d')],_0x24e3e1[_0x0bae('0x3e')]),_0x455869);if(_0x54ed09['query']['filter']){_0x3a2af3['where']=_[_0x0bae('0x47')](_0x3a2af3['where'],{'$or':_['map'](_0x455869,function(_0x327dd2){if(_0x327dd2[_0x0bae('0x48')]!==_0x0bae('0x49')){var _0x2ca4be={};_0x2ca4be[_0x327dd2[_0x0bae('0x37')]]={'$like':'%'+_0x54ed09[_0x0bae('0x3d')][_0x0bae('0x4a')]+'%'};return _0x2ca4be;}})});}_0x3a2af3=_[_0x0bae('0x47')]({},_0x3a2af3,_0x54ed09['options']);var _0x1efe2d={'where':_0x3a2af3[_0x0bae('0x45')]};return db[_0x0bae('0x4b')]['count'](_0x1efe2d)['then'](function(_0x6a49b1){_0x3e8d93['count']=_0x6a49b1;if(_0x54ed09[_0x0bae('0x3d')][_0x0bae('0x4c')]){_0x3a2af3[_0x0bae('0x4d')]=[{'all':!![]}];}return db[_0x0bae('0x4b')][_0x0bae('0x4e')](_0x3a2af3);})[_0x0bae('0x1e')](function(_0xca3ec5){_0x3e8d93[_0x0bae('0x4f')]=_0xca3ec5;return _0x3e8d93;})[_0x0bae('0x1e')](respondWithFilteredResult(_0x4d3a13,_0x3a2af3))[_0x0bae('0x50')](handleError(_0x4d3a13,null));};exports[_0x0bae('0x51')]=function(_0x398bff,_0x14e0c8){var _0x514e26={'raw':!![],'where':{'id':_0x398bff[_0x0bae('0x52')]['id']}},_0x3ff432={};_0x3ff432[_0x0bae('0x3b')]=_['keys'](db[_0x0bae('0x4b')][_0x0bae('0x53')]);_0x3ff432[_0x0bae('0x3d')]=_[_0x0bae('0x3c')](_0x398bff[_0x0bae('0x3d')]);_0x3ff432[_0x0bae('0x3e')]=_[_0x0bae('0x3f')](_0x3ff432[_0x0bae('0x3b')],_0x3ff432[_0x0bae('0x3d')]);_0x514e26[_0x0bae('0x41')]=_['intersection'](_0x3ff432['model'],qs['fields'](_0x398bff[_0x0bae('0x3d')][_0x0bae('0x40')]));_0x514e26[_0x0bae('0x41')]=_0x514e26['attributes'][_0x0bae('0x54')]?_0x514e26['attributes']:_0x3ff432[_0x0bae('0x3b')];if(_0x398bff[_0x0bae('0x3d')][_0x0bae('0x4c')]){_0x514e26[_0x0bae('0x4d')]=[{'all':!![]}];}_0x514e26=_[_0x0bae('0x47')]({},_0x514e26,_0x398bff[_0x0bae('0x55')]);return db[_0x0bae('0x4b')][_0x0bae('0x56')](_0x514e26)[_0x0bae('0x1e')](handleEntityNotFound(_0x14e0c8,null))[_0x0bae('0x1e')](respondWithResult(_0x14e0c8,null))[_0x0bae('0x50')](handleError(_0x14e0c8,null));};exports[_0x0bae('0x57')]=function(_0x5b1a15,_0x501a4b){return db[_0x0bae('0x4b')]['create'](_0x5b1a15[_0x0bae('0x58')],{})[_0x0bae('0x1e')](respondWithResult(_0x501a4b,0xc9))[_0x0bae('0x50')](handleError(_0x501a4b,null));};exports[_0x0bae('0x34')]=function(_0x4d0876,_0xba0e87){if(_0x4d0876[_0x0bae('0x58')]['id']){delete _0x4d0876[_0x0bae('0x58')]['id'];}return db['ChatMessage'][_0x0bae('0x56')]({'where':{'id':_0x4d0876[_0x0bae('0x52')]['id']}})[_0x0bae('0x1e')](handleEntityNotFound(_0xba0e87,null))[_0x0bae('0x1e')](saveUpdates(_0x4d0876['body'],null))[_0x0bae('0x1e')](respondWithResult(_0xba0e87,null))[_0x0bae('0x50')](handleError(_0xba0e87,null));};exports[_0x0bae('0x35')]=function(_0x321a67,_0x861fee){return db[_0x0bae('0x4b')][_0x0bae('0x56')]({'where':{'id':_0x321a67['params']['id']}})['then'](handleEntityNotFound(_0x861fee,null))['then'](removeEntity(_0x861fee,null))[_0x0bae('0x50')](handleError(_0x861fee,null));};exports[_0x0bae('0x59')]=function(_0x99e466,_0x5139fa){return db[_0x0bae('0x4b')][_0x0bae('0x59')]()[_0x0bae('0x1e')](respondWithResult(_0x5139fa,null))['catch'](handleError(_0x5139fa,null));};var interaction_log=require(_0x0bae('0x12'))(_0x0bae('0x5a'));exports[_0x0bae('0x5b')]=function(_0x135285,_0x439d3a,_0x52d067){var _0x172591={'agent':{},'channel':_0x0bae('0x5c')};if(_0x135285[_0x0bae('0x58')]['id']){delete _0x135285[_0x0bae('0x58')]['id'];}_0x135285['body'][_0x0bae('0x5d')]=!![];_0x135285[_0x0bae('0x58')][_0x0bae('0x5e')]=moment()[_0x0bae('0x5f')](_0x0bae('0x60'));_0x135285['body'][_0x0bae('0x61')]=_0x135285[_0x0bae('0x58')]['UserId']||_0x135285[_0x0bae('0x62')]['id'];_0x172591[_0x0bae('0x63')]['id']=_0x135285[_0x0bae('0x58')]['UserId'];return db[_0x0bae('0x4b')][_0x0bae('0x56')]({'where':{'id':_0x135285['params']['id'],'UserId':null}})[_0x0bae('0x1e')](handleEntityNotFound(_0x439d3a,null))[_0x0bae('0x1e')](saveUpdates(_0x135285[_0x0bae('0x58')],null))[_0x0bae('0x1e')](function(_0x485178){if(_0x485178){_0x172591[_0x0bae('0x27')]=_0x485178[_0x0bae('0x64')]({'plain':!![]});return db[_0x0bae('0x65')][_0x0bae('0x56')]({'where':{'id':_0x485178[_0x0bae('0x66')]}});}return null;})[_0x0bae('0x1e')](handleEntityNotFound(_0x439d3a,null))[_0x0bae('0x1e')](function(_0x6a1dc9){if(_0x6a1dc9){return _0x6a1dc9[_0x0bae('0x34')]({'UserId':_0x135285[_0x0bae('0x58')]['UserId'],'read1stAt':_[_0x0bae('0x67')](_0x6a1dc9[_0x0bae('0x68')])?moment()[_0x0bae('0x5f')](_0x0bae('0x60')):undefined});}return null;})[_0x0bae('0x1e')](function(_0x249608){if(_0x249608){_0x172591[_0x0bae('0x69')]=_0x249608['get']({'plain':!![]});interaction_log[_0x0bae('0x1f')](_0x0bae('0x6a'),_0x135285[_0x0bae('0x62')]['id'],_0x135285[_0x0bae('0x62')][_0x0bae('0x37')],_0x135285[_0x0bae('0x62')][_0x0bae('0x6b')],_0x172591[_0x0bae('0x69')]['id'],_0x135285[_0x0bae('0x58')]?JSON[_0x0bae('0x24')](_0x135285['body']):_0x0bae('0x6c'));return respondWithRpcPromise(_0x0bae('0x6d'),'acceptMessage',_0x172591);}return null;})[_0x0bae('0x1e')](function(_0x409c0d){var _0x2a05c3=_0x0bae('0x6e')+_0x409c0d['message'][_0x0bae('0x6f')];return db[_0x0bae('0x70')][_0x0bae('0x3d')](_0x2a05c3,{'type':db['Sequelize'][_0x0bae('0x71')]['SELECT'],'raw':!![]})[_0x0bae('0x1e')](function(_0x57307c){return _0x57307c;});})[_0x0bae('0x1e')](function(_0x4d0c34){if(_0x4d0c34){_0x172591['message'][_0x0bae('0x72')]=_0x4d0c34[0x0];if(!_0x135285['body'][_0x0bae('0x61')])return;return db[_0x0bae('0x73')][_0x0bae('0x56')]({'where':{'id':_0x135285['body'][_0x0bae('0x61')],'role':'agent'},'attributes':['id',_0x0bae('0x37'),_0x0bae('0x74'),'email',_0x0bae('0x75')],'raw':!![]});}return null;})[_0x0bae('0x1e')](function(_0x877096){if(!_0x877096)return null;_0x172591[_0x0bae('0x27')]['agent']=_0x877096;return _0x172591;})[_0x0bae('0x1e')](function(_0x4b17ac){if(_0x4b17ac){if(_0x135285[_0x0bae('0x58')]['manual']){_0x172591['message']['interface']=util['format']('SIP/%s',_0x135285[_0x0bae('0x62')][_0x0bae('0x37')]);_0x172591[_0x0bae('0x27')][_0x0bae('0x76')]=_0x172591[_0x0bae('0x76')];_0x172591[_0x0bae('0x27')][_0x0bae('0x77')]=_0x172591[_0x0bae('0x76')];_0x172591[_0x0bae('0x27')][_0x0bae('0x78')]=_0x0bae('0x5b');return respondWithRpcPromise(_0x0bae('0x79'),_0x0bae('0x79'),{'event':_0x0bae('0x7a'),'message':_[_0x0bae('0x47')](_0x172591[_0x0bae('0x27')],JSON['parse'](_0x172591[_0x0bae('0x69')][_0x0bae('0x7b')]))},client9002)['then'](function(){return _0x172591;});}return _0x172591;}return null;})[_0x0bae('0x1e')](respondWithResult(_0x439d3a,null))[_0x0bae('0x50')](handleError(_0x439d3a,null));};var interaction_log=require(_0x0bae('0x12'))(_0x0bae('0x5a'));exports[_0x0bae('0x32')]=function(_0x3700b5,_0x18ce9c,_0x5f0489){var _0x2d168d={'agent':{},'channel':_0x0bae('0x5c')};if(_0x3700b5['body']['id']){delete _0x3700b5['body']['id'];}_0x3700b5[_0x0bae('0x58')]['UserId']=_0x3700b5['body']['UserId']||_0x3700b5[_0x0bae('0x62')]['id'];_0x2d168d[_0x0bae('0x63')]['id']=_0x3700b5[_0x0bae('0x58')][_0x0bae('0x61')];return db[_0x0bae('0x4b')][_0x0bae('0x56')]({'where':{'id':_0x3700b5[_0x0bae('0x52')]['id'],'UserId':null}})[_0x0bae('0x1e')](handleEntityNotFound(_0x18ce9c,null))[_0x0bae('0x1e')](function(_0x2ce5e2){if(_0x2ce5e2){_0x2d168d[_0x0bae('0x27')]=_0x2ce5e2['get']({'plain':!![]});return db[_0x0bae('0x65')][_0x0bae('0x56')]({'where':{'id':_0x2ce5e2['ChatInteractionId']}});}return null;})[_0x0bae('0x1e')](handleEntityNotFound(_0x18ce9c,null))['then'](function(_0x1d436e){if(_0x1d436e){_0x2d168d[_0x0bae('0x69')]=_0x1d436e[_0x0bae('0x64')]({'plain':!![]});interaction_log[_0x0bae('0x1f')](_0x0bae('0x7c'),_0x3700b5['user']['id'],_0x3700b5['user'][_0x0bae('0x37')],_0x3700b5[_0x0bae('0x62')][_0x0bae('0x6b')],_0x2d168d[_0x0bae('0x69')]['id'],_0x3700b5[_0x0bae('0x58')]?JSON[_0x0bae('0x24')](_0x3700b5[_0x0bae('0x58')]):_0x0bae('0x6c'));return respondWithRpcPromise('RejectMessage',_0x0bae('0x7d'),_0x2d168d);}return null;})[_0x0bae('0x1e')](function(_0x541cd3){var _0x17db3c=_0x0bae('0x6e')+_0x541cd3['message'][_0x0bae('0x6f')];return db[_0x0bae('0x70')]['query'](_0x17db3c,{'type':db['Sequelize'][_0x0bae('0x71')][_0x0bae('0x7e')],'raw':!![]})['then'](function(_0xbc6b6d){return _0xbc6b6d;});})[_0x0bae('0x1e')](function(_0x206328){if(_0x206328){_0x2d168d[_0x0bae('0x27')]['contact']=_0x206328[0x0];if(!_0x3700b5['body'][_0x0bae('0x61')])return;return db[_0x0bae('0x73')][_0x0bae('0x56')]({'where':{'id':_0x3700b5[_0x0bae('0x58')][_0x0bae('0x61')],'role':_0x0bae('0x63')},'attributes':['id',_0x0bae('0x37'),'fullname',_0x0bae('0x7f'),_0x0bae('0x75')],'raw':!![]});}return null;})['then'](function(_0x37acfe){if(!_0x37acfe)return null;_0x2d168d[_0x0bae('0x27')][_0x0bae('0x63')]=_0x37acfe;return _0x2d168d;})[_0x0bae('0x1e')](function(_0x4892c8){if(_0x4892c8){_0x4892c8[_0x0bae('0x27')][_0x0bae('0x80')]=util[_0x0bae('0x5f')]('SIP/%s',_0x3700b5[_0x0bae('0x62')]['name']);_0x4892c8[_0x0bae('0x27')][_0x0bae('0x76')]=_0x2d168d[_0x0bae('0x76')];_0x4892c8[_0x0bae('0x27')][_0x0bae('0x77')]=_0x2d168d[_0x0bae('0x76')];_0x4892c8[_0x0bae('0x27')][_0x0bae('0x78')]=_0x0bae('0x32');respondWithRpcPromise('EventManager',_0x0bae('0x79'),{'event':_0x0bae('0x81'),'message':_[_0x0bae('0x47')](_0x2d168d[_0x0bae('0x27')],JSON[_0x0bae('0x82')](_0x2d168d[_0x0bae('0x69')][_0x0bae('0x7b')]))},client9002);return _0x2d168d;}return null;})['then'](respondWithResult(_0x18ce9c,null))[_0x0bae('0x50')](handleError(_0x18ce9c,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index bbe86aa..1010557 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 _0x4e3b=['setMaxListeners','update','emit','hasOwnProperty','exports','events','../../mysqldb','ChatMessage'];(function(_0x466bc5,_0x3a0f2a){var _0x138952=function(_0x392fa2){while(--_0x392fa2){_0x466bc5['push'](_0x466bc5['shift']());}};_0x138952(++_0x3a0f2a);}(_0x4e3b,0x175));var _0xb4e3=function(_0x1fcaf1,_0x21c3c2){_0x1fcaf1=_0x1fcaf1-0x0;var _0x55f464=_0x4e3b[_0x1fcaf1];return _0x55f464;};'use strict';var EventEmitter=require(_0xb4e3('0x0'));var ChatMessage=require(_0xb4e3('0x1'))['db'][_0xb4e3('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb4e3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb4e3('0x4'),'afterDestroy':'remove'};function emitEvent(_0xe6c91a){return function(_0x370963,_0x315d1a,_0x547e66){ChatMessageEvents[_0xb4e3('0x5')](_0xe6c91a+':'+_0x370963['id'],_0x370963);ChatMessageEvents[_0xb4e3('0x5')](_0xe6c91a,_0x370963);_0x547e66(null);};}for(var e in events){if(events[_0xb4e3('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xb4e3('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0xfbc5=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','ChatMessage'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xfbc5,0xdf));var _0x5fbc=function(_0x4df3bb,_0x5aef0b){_0x4df3bb=_0x4df3bb-0x0;var _0x58c001=_0xfbc5[_0x4df3bb];return _0x58c001;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x5fbc('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x5fbc('0x1')](0x0);var events={'afterCreate':_0x5fbc('0x2'),'afterUpdate':_0x5fbc('0x3'),'afterDestroy':_0x5fbc('0x4')};function emitEvent(_0x36dee7){return function(_0x53f1dc,_0x29b65d,_0x5229b4){ChatMessageEvents[_0x5fbc('0x5')](_0x36dee7+':'+_0x53f1dc['id'],_0x53f1dc);ChatMessageEvents[_0x5fbc('0x5')](_0x36dee7,_0x53f1dc);_0x5229b4(null);};}for(var e in events){if(events[_0x5fbc('0x6')](e)){var event=events[e];ChatMessage[_0x5fbc('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index cb8cd90..e64a346 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 _0xd9ca=['UserId','ChatInteraction','ChatInteractionId','then','createdAt','direction','error','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','fti_chat_messages','body','models','toLowerCase','secret','isNil'];(function(_0x33d608,_0x3a299b){var _0x4cd78a=function(_0x5ed735){while(--_0x5ed735){_0x33d608['push'](_0x33d608['shift']());}};_0x4cd78a(++_0x3a299b);}(_0xd9ca,0x1a0));var _0xad9c=function(_0x337717,_0x3c4288){_0x337717=_0x337717-0x0;var _0x35bf96=_0xd9ca[_0x337717];return _0x35bf96;};'use strict';var _=require(_0xad9c('0x0'));var util=require(_0xad9c('0x1'));var logger=require(_0xad9c('0x2'))('api');var moment=require(_0xad9c('0x3'));var BPromise=require(_0xad9c('0x4'));var rp=require(_0xad9c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xad9c('0x6'));var config=require(_0xad9c('0x7'));var attributes=require('./chatMessage.attributes');module[_0xad9c('0x8')]=function(_0x42b0b9,_0xe37208){return _0x42b0b9[_0xad9c('0x9')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xad9c('0xa'),'fields':[_0xad9c('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x89de23,_0x1d0aa5,_0x4f0323){var _0x4f580a=_0x42b0b9[_0xad9c('0xc')];var _0x354fac=_0x89de23['get']({'plain':!![]});if(_0x354fac['direction']['toLowerCase']()==='in'||_0x354fac['direction'][_0xad9c('0xd')]()==='out'&&!_0x354fac[_0xad9c('0xe')]&&!_[_0xad9c('0xf')](_0x354fac[_0xad9c('0x10')])){_0x4f580a[_0xad9c('0x11')]['findOne']({'where':{'id':_0x354fac[_0xad9c('0x12')]}})[_0xad9c('0x13')](function(_0x3a8615){if(_0x3a8615){_0x3a8615['update']({'lastMsgAt':_0x354fac[_0xad9c('0x14')],'lastMsgDirection':_0x354fac[_0xad9c('0x15')][_0xad9c('0xd')]()});}})['catch'](function(_0x2c13c0){console[_0xad9c('0x16')](_0x2c13c0);});}_0x4f0323();}},'charset':_0xad9c('0x17'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1bdf=['UserId','findOne','ChatInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil'];(function(_0x117473,_0x485375){var _0x38711a=function(_0x33e119){while(--_0x33e119){_0x117473['push'](_0x117473['shift']());}};_0x38711a(++_0x485375);}(_0x1bdf,0x15e));var _0xf1bd=function(_0x8e73ee,_0x3d0eb3){_0x8e73ee=_0x8e73ee-0x0;var _0x1e812a=_0x1bdf[_0x8e73ee];return _0x1e812a;};'use strict';var _=require(_0xf1bd('0x0'));var util=require('util');var logger=require(_0xf1bd('0x1'))(_0xf1bd('0x2'));var moment=require(_0xf1bd('0x3'));var BPromise=require(_0xf1bd('0x4'));var rp=require(_0xf1bd('0x5'));var fs=require('fs');var path=require(_0xf1bd('0x6'));var rimraf=require(_0xf1bd('0x7'));var config=require(_0xf1bd('0x8'));var attributes=require('./chatMessage.attributes');module[_0xf1bd('0x9')]=function(_0x3b300c,_0xb39866){return _0x3b300c['define'](_0xf1bd('0xa'),attributes,{'tableName':_0xf1bd('0xb'),'paranoid':![],'indexes':[{'name':_0xf1bd('0xc'),'fields':[_0xf1bd('0xd')],'type':_0xf1bd('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x312083,_0x3e8cd4,_0x2bcba9){var _0x439d07=_0x3b300c[_0xf1bd('0xf')];var _0xad44d5=_0x312083[_0xf1bd('0x10')]({'plain':!![]});if(_0xad44d5[_0xf1bd('0x11')][_0xf1bd('0x12')]()==='in'||_0xad44d5[_0xf1bd('0x11')]['toLowerCase']()===_0xf1bd('0x13')&&!_0xad44d5[_0xf1bd('0x14')]&&!_[_0xf1bd('0x15')](_0xad44d5[_0xf1bd('0x16')])){_0x439d07['ChatInteraction'][_0xf1bd('0x17')]({'where':{'id':_0xad44d5[_0xf1bd('0x18')]}})[_0xf1bd('0x19')](function(_0x206788){if(_0x206788){_0x206788[_0xf1bd('0x1a')]({'lastMsgAt':_0xad44d5[_0xf1bd('0x1b')],'lastMsgDirection':_0xad44d5[_0xf1bd('0x11')]['toLowerCase']()});}})['catch'](function(_0x32b16e){console[_0xf1bd('0x1c')](_0x32b16e);});}_0x2bcba9();}},'charset':_0xf1bd('0x1d'),'collate':_0xf1bd('0x1e')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index ea5ad94..70c068d 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 _0xdccf=['then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatMessage.socket','register'];(function(_0xa3400,_0x3a980a){var _0x33dba2=function(_0x5e988b){while(--_0x5e988b){_0xa3400['push'](_0xa3400['shift']());}};_0x33dba2(++_0x3a980a);}(_0xdccf,0x95));var _0xfdcc=function(_0x32fa44,_0xfb5e6a){_0x32fa44=_0x32fa44-0x0;var _0x47c603=_0xdccf[_0x32fa44];return _0x47c603;};'use strict';var _=require(_0xfdcc('0x0'));var util=require(_0xfdcc('0x1'));var moment=require('moment');var BPromise=require(_0xfdcc('0x2'));var rs=require(_0xfdcc('0x3'));var fs=require('fs');var Redis=require(_0xfdcc('0x4'));var db=require(_0xfdcc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfdcc('0x6'))(_0xfdcc('0x7'));var config=require(_0xfdcc('0x8'));var jayson=require(_0xfdcc('0x9'));var client=jayson[_0xfdcc('0xa')][_0xfdcc('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xfdcc('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xfdcc('0xd'))(new Redis(config[_0xfdcc('0xc')]));require(_0xfdcc('0xe'))[_0xfdcc('0xf')](socket);function respondWithRpcPromise(_0x5ba2c8,_0x14f89d,_0x515fe1){return new BPromise(function(_0x516d23,_0x28aa0e){return client['request'](_0x5ba2c8,_0x515fe1)[_0xfdcc('0x10')](function(_0x1595f9){logger[_0xfdcc('0x11')](_0xfdcc('0x12'),_0x14f89d,_0xfdcc('0x13'));logger[_0xfdcc('0x14')](_0xfdcc('0x15'),_0x14f89d,_0xfdcc('0x13'),JSON[_0xfdcc('0x16')](_0x1595f9));if(_0x1595f9[_0xfdcc('0x17')]){if(_0x1595f9[_0xfdcc('0x17')][_0xfdcc('0x18')]===0x1f4){logger[_0xfdcc('0x17')]('ChatMessage,\x20%s,\x20%s',_0x14f89d,_0x1595f9['error'][_0xfdcc('0x19')]);return _0x28aa0e(_0x1595f9[_0xfdcc('0x17')][_0xfdcc('0x19')]);}logger[_0xfdcc('0x17')](_0xfdcc('0x12'),_0x14f89d,_0x1595f9[_0xfdcc('0x17')][_0xfdcc('0x19')]);return _0x516d23(_0x1595f9['error'][_0xfdcc('0x19')]);}else{logger[_0xfdcc('0x11')]('ChatMessage,\x20%s,\x20%s',_0x14f89d,'request\x20sent');_0x516d23(_0x1595f9[_0xfdcc('0x1a')][_0xfdcc('0x19')]);}})[_0xfdcc('0x1b')](function(_0xbd44db){logger['error'](_0xfdcc('0x12'),_0x14f89d,_0xbd44db);_0x28aa0e(_0xbd44db);});});}exports[_0xfdcc('0x1c')]=function(_0x59e9fe){var _0x44e3c5=this;return new Promise(function(_0x1f6b3d,_0x362a7c){return db[_0xfdcc('0x1d')][_0xfdcc('0x1e')](_0x59e9fe['body'],{'raw':_0x59e9fe['options']?_0x59e9fe[_0xfdcc('0x1f')][_0xfdcc('0x20')]===undefined?!![]:![]:!![]})[_0xfdcc('0x10')](function(_0x13eb1c){logger[_0xfdcc('0x11')](_0xfdcc('0x1c'),_0x59e9fe);logger['debug'](_0xfdcc('0x1c'),_0x59e9fe,JSON['stringify'](_0x13eb1c));_0x1f6b3d(_0x13eb1c);})[_0xfdcc('0x1b')](function(_0x21d622){logger[_0xfdcc('0x17')]('CreateChatMessage',_0x21d622[_0xfdcc('0x19')],_0x59e9fe);_0x362a7c(_0x44e3c5[_0xfdcc('0x17')](0x1f4,_0x21d622['message']));});});}; \ No newline at end of file +var _0x04e7=['code','message','result','ChatMessage','options','raw','CreateChatMessage','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x04e7,0x121));var _0x704e=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x04e7[_0x26b80e];return _0x84a8a8;};'use strict';var _=require(_0x704e('0x0'));var util=require(_0x704e('0x1'));var moment=require(_0x704e('0x2'));var BPromise=require(_0x704e('0x3'));var rs=require(_0x704e('0x4'));var fs=require('fs');var Redis=require(_0x704e('0x5'));var db=require(_0x704e('0x6'))['db'];var utils=require(_0x704e('0x7'));var logger=require(_0x704e('0x8'))(_0x704e('0x9'));var config=require(_0x704e('0xa'));var jayson=require(_0x704e('0xb'));var client=jayson['client'][_0x704e('0xc')]({'port':0x232a});config[_0x704e('0xd')]=_[_0x704e('0xe')](config[_0x704e('0xd')],{'host':_0x704e('0xf'),'port':0x18eb});var socket=require(_0x704e('0x10'))(new Redis(config[_0x704e('0xd')]));require(_0x704e('0x11'))[_0x704e('0x12')](socket);function respondWithRpcPromise(_0xc0d178,_0x1a2f74,_0x458537){return new BPromise(function(_0x48dc9b,_0x3c80dd){return client[_0x704e('0x13')](_0xc0d178,_0x458537)[_0x704e('0x14')](function(_0x42c150){logger[_0x704e('0x15')](_0x704e('0x16'),_0x1a2f74,_0x704e('0x17'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1a2f74,_0x704e('0x17'),JSON[_0x704e('0x18')](_0x42c150));if(_0x42c150[_0x704e('0x19')]){if(_0x42c150[_0x704e('0x19')][_0x704e('0x1a')]===0x1f4){logger[_0x704e('0x19')](_0x704e('0x16'),_0x1a2f74,_0x42c150[_0x704e('0x19')]['message']);return _0x3c80dd(_0x42c150[_0x704e('0x19')][_0x704e('0x1b')]);}logger[_0x704e('0x19')]('ChatMessage,\x20%s,\x20%s',_0x1a2f74,_0x42c150[_0x704e('0x19')][_0x704e('0x1b')]);return _0x48dc9b(_0x42c150[_0x704e('0x19')]['message']);}else{logger[_0x704e('0x15')](_0x704e('0x16'),_0x1a2f74,_0x704e('0x17'));_0x48dc9b(_0x42c150[_0x704e('0x1c')][_0x704e('0x1b')]);}})['catch'](function(_0x333524){logger['error'](_0x704e('0x16'),_0x1a2f74,_0x333524);_0x3c80dd(_0x333524);});});}exports['CreateChatMessage']=function(_0x5e0542){var _0x5bd786=this;return new Promise(function(_0x295d5a,_0x361cb7){return db[_0x704e('0x1d')]['create'](_0x5e0542['body'],{'raw':_0x5e0542[_0x704e('0x1e')]?_0x5e0542[_0x704e('0x1e')][_0x704e('0x1f')]===undefined?!![]:![]:!![]})[_0x704e('0x14')](function(_0x418322){logger[_0x704e('0x15')](_0x704e('0x20'),_0x5e0542);logger[_0x704e('0x21')](_0x704e('0x20'),_0x5e0542,JSON[_0x704e('0x18')](_0x418322));_0x295d5a(_0x418322);})[_0x704e('0x22')](function(_0x5554d0){logger['error'](_0x704e('0x20'),_0x5554d0[_0x704e('0x1b')],_0x5e0542);_0x361cb7(_0x5bd786[_0x704e('0x19')](0x1f4,_0x5554d0[_0x704e('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 2db1b75..bf392d5 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 _0x9ab0=['save','remove','update','emit','length','chatMessage:','./chatMessage.events'];(function(_0x65d16d,_0x19b3fd){var _0x2df98a=function(_0x25def9){while(--_0x25def9){_0x65d16d['push'](_0x65d16d['shift']());}};_0x2df98a(++_0x19b3fd);}(_0x9ab0,0x195));var _0x09ab=function(_0x1fbc26,_0x80e0f){_0x1fbc26=_0x1fbc26-0x0;var _0x43a85d=_0x9ab0[_0x1fbc26];return _0x43a85d;};'use strict';var ChatMessageEvents=require(_0x09ab('0x0'));var events=[_0x09ab('0x1'),_0x09ab('0x2'),_0x09ab('0x3')];function createListener(_0x38fee4,_0x428fc1){return function(_0x38c30a){_0x428fc1[_0x09ab('0x4')](_0x38fee4,_0x38c30a);};}function removeListener(_0x3c0cd0,_0x4bb59a){return function(){ChatMessageEvents['removeListener'](_0x3c0cd0,_0x4bb59a);};}exports['register']=function(_0x3144ec){for(var _0x387ac8=0x0,_0x241bd1=events[_0x09ab('0x5')];_0x387ac8<_0x241bd1;_0x387ac8++){var _0x610663=events[_0x387ac8];var _0x464d64=createListener(_0x09ab('0x6')+_0x610663,_0x3144ec);ChatMessageEvents['on'](_0x610663,_0x464d64);}}; \ No newline at end of file +var _0x3e9d=['chatMessage:','./chatMessage.events','save','update','removeListener','register','length'];(function(_0xf711da,_0x5dfce7){var _0x219748=function(_0x39d857){while(--_0x39d857){_0xf711da['push'](_0xf711da['shift']());}};_0x219748(++_0x5dfce7);}(_0x3e9d,0x1ba));var _0xd3e9=function(_0x1e6e99,_0x2ef9ac){_0x1e6e99=_0x1e6e99-0x0;var _0x41d4f3=_0x3e9d[_0x1e6e99];return _0x41d4f3;};'use strict';var ChatMessageEvents=require(_0xd3e9('0x0'));var events=[_0xd3e9('0x1'),'remove',_0xd3e9('0x2')];function createListener(_0x4bc1c3,_0x328e91){return function(_0x2ebba5){_0x328e91['emit'](_0x4bc1c3,_0x2ebba5);};}function removeListener(_0x4887ba,_0xa499a3){return function(){ChatMessageEvents[_0xd3e9('0x3')](_0x4887ba,_0xa499a3);};}exports[_0xd3e9('0x4')]=function(_0x3dea0a){for(var _0x568eea=0x0,_0x4dc1de=events[_0xd3e9('0x5')];_0x568eea<_0x4dc1de;_0x568eea++){var _0x140f2d=events[_0x568eea];var _0x45364e=createListener(_0xd3e9('0x6')+_0x140f2d,_0x3dea0a);ChatMessageEvents['on'](_0x140f2d,_0x45364e);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index e853d4e..cb556b7 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 _0x05fa=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','describe','/:id','show','isAuthenticated','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','path','connect-timeout','express','Router'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x05fa,0x181));var _0xa05f=function(_0x50425c,_0x11f5dc){_0x50425c=_0x50425c-0x0;var _0x4093a4=_0x05fa[_0x50425c];return _0x4093a4;};'use strict';var multer=require(_0xa05f('0x0'));var util=require('util');var path=require(_0xa05f('0x1'));var timeout=require(_0xa05f('0x2'));var express=require(_0xa05f('0x3'));var router=express[_0xa05f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa05f('0x5'));var interaction=require(_0xa05f('0x6'));var config=require(_0xa05f('0x7'));var controller=require(_0xa05f('0x8'));router[_0xa05f('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa05f('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xa05f('0xa')]);router[_0xa05f('0x9')](_0xa05f('0xb'),auth['isAuthenticated'](),controller[_0xa05f('0xc')]);router['post']('/',auth[_0xa05f('0xd')](),interaction[_0xa05f('0xe')](_0xa05f('0xf'),_0xa05f('0x10')),controller[_0xa05f('0x11')]);router[_0xa05f('0x12')]('/:id',controller[_0xa05f('0x13')]);router['put'](_0xa05f('0x14'),auth[_0xa05f('0xd')](),controller[_0xa05f('0x15')]);router['put'](_0xa05f('0x16'),auth[_0xa05f('0xd')](),controller[_0xa05f('0x17')]);router[_0xa05f('0x18')]('/:id',auth[_0xa05f('0xd')](),controller[_0xa05f('0x19')]);module['exports']=router; \ No newline at end of file +var _0xe5a5=['post','chat','chatmessage:create','create','update','accept','put','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','describe','/:id'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xe5a5,0x15b));var _0x5e5a=function(_0x480e53,_0x5c8da4){_0x480e53=_0x480e53-0x0;var _0x12c12f=_0xe5a5[_0x480e53];return _0x12c12f;};'use strict';var multer=require(_0x5e5a('0x0'));var util=require(_0x5e5a('0x1'));var path=require(_0x5e5a('0x2'));var timeout=require(_0x5e5a('0x3'));var express=require('express');var router=express[_0x5e5a('0x4')]();var fs_extra=require(_0x5e5a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5e5a('0x6'));var config=require(_0x5e5a('0x7'));var controller=require('./chatMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x5e5a('0x8')]);router[_0x5e5a('0x9')]('/describe',auth[_0x5e5a('0xa')](),controller[_0x5e5a('0xb')]);router[_0x5e5a('0x9')](_0x5e5a('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x5e5a('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x5e5a('0xe'),_0x5e5a('0xf')),controller[_0x5e5a('0x10')]);router['put'](_0x5e5a('0xc'),controller[_0x5e5a('0x11')]);router['put']('/:id/accept',auth[_0x5e5a('0xa')](),controller[_0x5e5a('0x12')]);router[_0x5e5a('0x13')](_0x5e5a('0x14'),auth[_0x5e5a('0xa')](),controller[_0x5e5a('0x15')]);router[_0x5e5a('0x16')](_0x5e5a('0xc'),auth['isAuthenticated'](),controller[_0x5e5a('0x17')]);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 6c1206e..20f4c50 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 _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x1b9cfa,_0x36281e){var _0x1ed4d3=function(_0x2bed19){while(--_0x2bed19){_0x1b9cfa['push'](_0x1b9cfa['shift']());}};_0x1ed4d3(++_0x36281e);}(_0xdb28,0x106));var _0x8db2=function(_0x57503e,_0x52d747){_0x57503e=_0x57503e-0x0;var _0x214e59=_0xdb28[_0x57503e];return _0x214e59;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x36fec3,_0x455039){var _0x5bba9c=function(_0x3b8353){while(--_0x3b8353){_0x36fec3['push'](_0x36fec3['shift']());}};_0x5bba9c(++_0x455039);}(_0xdb28,0x106));var _0x8db2=function(_0x28dac0,_0x40b8ad){_0x28dac0=_0x28dac0-0x0;var _0x26efbc=_0xdb28[_0x28dac0];return _0x26efbc;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 9f61463..9f559d4 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x7a54,0x106));var _0x47a5=function(_0x3e8f74,_0x5219d9){_0x3e8f74=_0x3e8f74-0x0;var _0x1619e4=_0x7a54[_0x3e8f74];return _0x1619e4;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x7a54,0x106));var _0x47a5=function(_0x10beef,_0x4c26e1){_0x10beef=_0x10beef-0x0;var _0x244288=_0x7a54[_0x10beef];return _0x244288;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 5cdae2d..391d845 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 _0xaf0d=['hasOwnProperty','../../mysqldb','ChatOfflineMessage','emit'];(function(_0x11ff7f,_0x5bf87c){var _0xcca7bc=function(_0x4e77c0){while(--_0x4e77c0){_0x11ff7f['push'](_0x11ff7f['shift']());}};_0xcca7bc(++_0x5bf87c);}(_0xaf0d,0x6d));var _0xdaf0=function(_0x3c718c,_0x4cc3bf){_0x3c718c=_0x3c718c-0x0;var _0x46aefc=_0xaf0d[_0x3c718c];return _0x46aefc;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0xdaf0('0x0'))['db'][_0xdaf0('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5c0ebc){return function(_0x1b6f35,_0x21a3fa,_0xe9d8f4){ChatOfflineMessageEvents['emit'](_0x5c0ebc+':'+_0x1b6f35['id'],_0x1b6f35);ChatOfflineMessageEvents[_0xdaf0('0x2')](_0x5c0ebc,_0x1b6f35);_0xe9d8f4(null);};}for(var e in events){if(events[_0xdaf0('0x3')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0xd5fc=['emit','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x1d978e,_0x30032a){var _0x2fe0c9=function(_0x1b661c){while(--_0x1b661c){_0x1d978e['push'](_0x1d978e['shift']());}};_0x2fe0c9(++_0x30032a);}(_0xd5fc,0x11a));var _0xcd5f=function(_0x332e1,_0x225f10){_0x332e1=_0x332e1-0x0;var _0x41380b=_0xd5fc[_0x332e1];return _0x41380b;};'use strict';var EventEmitter=require(_0xcd5f('0x0'));var ChatOfflineMessage=require(_0xcd5f('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xcd5f('0x2')](0x0);var events={'afterCreate':_0xcd5f('0x3'),'afterUpdate':_0xcd5f('0x4'),'afterDestroy':'remove'};function emitEvent(_0xbd0dc4){return function(_0x2897ed,_0x4ab81b,_0xf83ba0){ChatOfflineMessageEvents[_0xcd5f('0x5')](_0xbd0dc4+':'+_0x2897ed['id'],_0x2897ed);ChatOfflineMessageEvents[_0xcd5f('0x5')](_0xbd0dc4,_0x2897ed);_0xf83ba0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xcd5f('0x6')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 3fa3bb7..934bf66 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 _0x0f18=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','exports'];(function(_0x17c483,_0xc69535){var _0x112bdb=function(_0x19adb9){while(--_0x19adb9){_0x17c483['push'](_0x17c483['shift']());}};_0x112bdb(++_0xc69535);}(_0x0f18,0x90));var _0x80f1=function(_0x3f1710,_0x3877a2){_0x3f1710=_0x3f1710-0x0;var _0x528458=_0x0f18[_0x3f1710];return _0x528458;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x80f1('0x0')]=function(_0x1f6d29){return _0x1f6d29['define'](_0x80f1('0x1'),attributes,{'tableName':_0x80f1('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x80f1('0x3'),'collate':_0x80f1('0x4')});}; \ No newline at end of file +var _0x3af1=['define','ChatOfflineMessage','./chatOfflineMessage.attributes','exports'];(function(_0x2e4e85,_0x37262f){var _0x52f763=function(_0x26c195){while(--_0x26c195){_0x2e4e85['push'](_0x2e4e85['shift']());}};_0x52f763(++_0x37262f);}(_0x3af1,0xfe));var _0x13af=function(_0x36f340,_0x218b82){_0x36f340=_0x36f340-0x0;var _0x48ac0e=_0x3af1[_0x36f340];return _0x48ac0e;};'use strict';var attributes=require(_0x13af('0x0'));module[_0x13af('0x1')]=function(_0x2fa3e2){return _0x2fa3e2[_0x13af('0x2')](_0x13af('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 6d1c295..918c37e 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 _0xa728=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','code','error','message','result','lodash','util','moment','bluebird'];(function(_0x3b5141,_0x2beaf2){var _0x431f71=function(_0x71318b){while(--_0x71318b){_0x3b5141['push'](_0x3b5141['shift']());}};_0x431f71(++_0x2beaf2);}(_0xa728,0xb4));var _0x8a72=function(_0x315a95,_0x580ecd){_0x315a95=_0x315a95-0x0;var _0x2e485e=_0xa728[_0x315a95];return _0x2e485e;};'use strict';var _=require(_0x8a72('0x0'));var util=require(_0x8a72('0x1'));var moment=require(_0x8a72('0x2'));var BPromise=require(_0x8a72('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a72('0x4'));var db=require(_0x8a72('0x5'))['db'];var utils=require(_0x8a72('0x6'));var logger=require(_0x8a72('0x7'))('rpc');var config=require(_0x8a72('0x8'));var jayson=require(_0x8a72('0x9'));var client=jayson[_0x8a72('0xa')][_0x8a72('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44a8a9,_0x3d004a,_0x1421d2){return new BPromise(function(_0x23f5df,_0x3bcf8a){return client[_0x8a72('0xc')](_0x44a8a9,_0x1421d2)[_0x8a72('0xd')](function(_0x327e53){logger[_0x8a72('0xe')](_0x8a72('0xf'),_0x3d004a,_0x8a72('0x10'));logger[_0x8a72('0x11')](_0x8a72('0x12'),_0x3d004a,_0x8a72('0x10'),JSON['stringify'](_0x327e53));if(_0x327e53['error']){if(_0x327e53['error'][_0x8a72('0x13')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3d004a,_0x327e53[_0x8a72('0x14')][_0x8a72('0x15')]);return _0x3bcf8a(_0x327e53[_0x8a72('0x14')][_0x8a72('0x15')]);}logger['error'](_0x8a72('0xf'),_0x3d004a,_0x327e53[_0x8a72('0x14')][_0x8a72('0x15')]);return _0x23f5df(_0x327e53['error'][_0x8a72('0x15')]);}else{logger[_0x8a72('0xe')](_0x8a72('0xf'),_0x3d004a,_0x8a72('0x10'));_0x23f5df(_0x327e53[_0x8a72('0x16')][_0x8a72('0x15')]);}})['catch'](function(_0x36f20b){logger['error'](_0x8a72('0xf'),_0x3d004a,_0x36f20b);_0x3bcf8a(_0x36f20b);});});} \ No newline at end of file +var _0x4974=['request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatOfflineMessage,\x20%s,\x20%s','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x5d6e30,_0xc21d51){var _0x3d3f3b=function(_0x33597b){while(--_0x33597b){_0x5d6e30['push'](_0x5d6e30['shift']());}};_0x3d3f3b(++_0xc21d51);}(_0x4974,0x127));var _0x4497=function(_0x42f58d,_0x44a5a3){_0x42f58d=_0x42f58d-0x0;var _0x3207f5=_0x4974[_0x42f58d];return _0x3207f5;};'use strict';var _=require(_0x4497('0x0'));var util=require('util');var moment=require(_0x4497('0x1'));var BPromise=require(_0x4497('0x2'));var rs=require(_0x4497('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4497('0x4'))['db'];var utils=require(_0x4497('0x5'));var logger=require('../../config/logger')(_0x4497('0x6'));var config=require(_0x4497('0x7'));var jayson=require(_0x4497('0x8'));var client=jayson['client'][_0x4497('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x445e3c,_0x571aa8,_0x9acff7){return new BPromise(function(_0x484983,_0x4ebfdf){return client[_0x4497('0xa')](_0x445e3c,_0x9acff7)[_0x4497('0xb')](function(_0x487f6a){logger[_0x4497('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x571aa8,_0x4497('0xd'));logger[_0x4497('0xe')](_0x4497('0xf'),_0x571aa8,'request\x20sent',JSON[_0x4497('0x10')](_0x487f6a));if(_0x487f6a[_0x4497('0x11')]){if(_0x487f6a[_0x4497('0x11')][_0x4497('0x12')]===0x1f4){logger[_0x4497('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x571aa8,_0x487f6a[_0x4497('0x11')][_0x4497('0x13')]);return _0x4ebfdf(_0x487f6a[_0x4497('0x11')][_0x4497('0x13')]);}logger[_0x4497('0x11')](_0x4497('0x14'),_0x571aa8,_0x487f6a[_0x4497('0x11')][_0x4497('0x13')]);return _0x484983(_0x487f6a['error'][_0x4497('0x13')]);}else{logger[_0x4497('0xc')](_0x4497('0x14'),_0x571aa8,_0x4497('0xd'));_0x484983(_0x487f6a['result'][_0x4497('0x13')]);}})[_0x4497('0x15')](function(_0x3db095){logger[_0x4497('0x11')](_0x4497('0x14'),_0x571aa8,_0x3db095);_0x4ebfdf(_0x3db095);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 91524b8..87a99ed 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 _0x3308=['./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xc298ad,_0xea4dc2){var _0x11b2e6=function(_0xe2314f){while(--_0xe2314f){_0xc298ad['push'](_0xc298ad['shift']());}};_0x11b2e6(++_0xea4dc2);}(_0x3308,0x116));var _0x8330=function(_0x192430,_0x6763ba){_0x192430=_0x192430-0x0;var _0x179c80=_0x3308[_0x192430];return _0x179c80;};'use strict';var multer=require(_0x8330('0x0'));var util=require(_0x8330('0x1'));var path=require(_0x8330('0x2'));var timeout=require(_0x8330('0x3'));var express=require(_0x8330('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8330('0x5'));var interaction=require(_0x8330('0x6'));var config=require(_0x8330('0x7'));var controller=require(_0x8330('0x8'));router[_0x8330('0x9')]('/',auth[_0x8330('0xa')](),controller[_0x8330('0xb')]);router[_0x8330('0x9')](_0x8330('0xc'),auth[_0x8330('0xa')](),controller[_0x8330('0xd')]);router[_0x8330('0x9')](_0x8330('0xe'),auth[_0x8330('0xa')](),controller[_0x8330('0xf')]);router[_0x8330('0x10')]('/',auth['isAuthenticated'](),controller[_0x8330('0x11')]);router[_0x8330('0x12')](_0x8330('0xe'),auth[_0x8330('0xa')](),controller['update']);router[_0x8330('0x13')](_0x8330('0xe'),auth[_0x8330('0xa')](),controller[_0x8330('0x14')]);module[_0x8330('0x15')]=router; \ No newline at end of file +var _0x1f5f=['post','create','put','/:id','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','describe'];(function(_0x30f06f,_0x160eaf){var _0x7e3a80=function(_0x47fa04){while(--_0x47fa04){_0x30f06f['push'](_0x30f06f['shift']());}};_0x7e3a80(++_0x160eaf);}(_0x1f5f,0x116));var _0xf1f5=function(_0x2eeb79,_0x5c81e3){_0x2eeb79=_0x2eeb79-0x0;var _0x91495d=_0x1f5f[_0x2eeb79];return _0x91495d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf1f5('0x0'));var timeout=require('connect-timeout');var express=require(_0xf1f5('0x1'));var router=express[_0xf1f5('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf1f5('0x3'));var interaction=require(_0xf1f5('0x4'));var config=require('../../config/environment');var controller=require(_0xf1f5('0x5'));router[_0xf1f5('0x6')]('/',auth[_0xf1f5('0x7')](),controller[_0xf1f5('0x8')]);router['get']('/describe',auth[_0xf1f5('0x7')](),controller[_0xf1f5('0x9')]);router[_0xf1f5('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf1f5('0xa')]('/',auth[_0xf1f5('0x7')](),controller[_0xf1f5('0xb')]);router[_0xf1f5('0xc')](_0xf1f5('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xf1f5('0xd'),auth[_0xf1f5('0x7')](),controller[_0xf1f5('0xe')]);module[_0xf1f5('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index f05a7b4..35615b4 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 _0xa19c=['INTEGER','sequelize','exports','STRING','mouseOver','timeout'];(function(_0x3798d8,_0xc1aacf){var _0x345c15=function(_0x617d97){while(--_0x617d97){_0x3798d8['push'](_0x3798d8['shift']());}};_0x345c15(++_0xc1aacf);}(_0xa19c,0x11b));var _0xca19=function(_0x40f9a9,_0x171ffd){_0x40f9a9=_0x40f9a9-0x0;var _0x39672c=_0xa19c[_0x40f9a9];return _0x39672c;};'use strict';var Sequelize=require(_0xca19('0x0'));module[_0xca19('0x1')]={'name':{'type':Sequelize[_0xca19('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xca19('0x3'),_0xca19('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xca19('0x2')]},'timeout':{'type':Sequelize[_0xca19('0x5')]}}; \ No newline at end of file +var _0x974d=['ENUM','INTEGER','sequelize','exports','STRING'];(function(_0x58cb96,_0x3d7cec){var _0x58b556=function(_0x2455d2){while(--_0x2455d2){_0x58cb96['push'](_0x58cb96['shift']());}};_0x58b556(++_0x3d7cec);}(_0x974d,0x115));var _0xd974=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x974d[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xd974('0x0'));module[_0xd974('0x1')]={'name':{'type':Sequelize[_0xd974('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xd974('0x3')]('mouseOver','timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd974('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index d981465..06c8b7d 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 _0x0845=['name','params','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','model','attributes','fields','length','include','merge','find','catch','body','update','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','destroy','then','end','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0845,0x125));var _0x5084=function(_0x3f5859,_0x38ecde){_0x3f5859=_0x3f5859-0x0;var _0x18465a=_0x0845[_0x3f5859];return _0x18465a;};'use strict';var emlformat=require(_0x5084('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5084('0x1'));var rp=require(_0x5084('0x2'));var moment=require(_0x5084('0x3'));var BPromise=require(_0x5084('0x4'));var Mustache=require(_0x5084('0x5'));var util=require(_0x5084('0x6'));var path=require('path');var sox=require(_0x5084('0x7'));var csv=require(_0x5084('0x8'));var ejs=require(_0x5084('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5084('0xa'));var jsforce=require(_0x5084('0xb'));var deskjs=require(_0x5084('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5084('0xd'));var Redis=require(_0x5084('0xe'));var authService=require(_0x5084('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5084('0x10'));var hardwareService=require(_0x5084('0x11'));var logger=require(_0x5084('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x5084('0x13'));var licenseUtil=require(_0x5084('0x14'));var db=require(_0x5084('0x15'))['db'];function respondWithStatusCode(_0x1bc737,_0x35355a){_0x35355a=_0x35355a||0xcc;return function(_0x86dc11){if(_0x86dc11){return _0x1bc737[_0x5084('0x16')](_0x35355a);}return _0x1bc737[_0x5084('0x17')](_0x35355a)['end']();};}function respondWithResult(_0x2e3f5b,_0x2b92d9){_0x2b92d9=_0x2b92d9||0xc8;return function(_0x3c48e5){if(_0x3c48e5){return _0x2e3f5b['status'](_0x2b92d9)[_0x5084('0x18')](_0x3c48e5);}};}function respondWithFilteredResult(_0xd4ff23,_0x27023b){return function(_0x263642){if(_0x263642){var _0x4918e2=typeof _0x27023b[_0x5084('0x19')]==='undefined'&&typeof _0x27023b[_0x5084('0x1a')]===_0x5084('0x1b');var _0x300efc=_0x263642[_0x5084('0x1c')];var _0x2072b8=_0x4918e2?0x0:_0x27023b[_0x5084('0x19')];var _0x369fb5=_0x4918e2?_0x263642[_0x5084('0x1c')]:_0x27023b[_0x5084('0x19')]+_0x27023b[_0x5084('0x1a')];var _0x35e563;if(_0x369fb5>=_0x300efc){_0x369fb5=_0x300efc;_0x35e563=0xc8;}else{_0x35e563=0xce;}_0xd4ff23[_0x5084('0x17')](_0x35e563);return _0xd4ff23[_0x5084('0x1d')](_0x5084('0x1e'),_0x2072b8+'-'+_0x369fb5+'/'+_0x300efc)[_0x5084('0x18')](_0x263642);}return null;};}function patchUpdates(_0x2f1889){return function(_0xa92a15){try{jsonpatch[_0x5084('0x1f')](_0xa92a15,_0x2f1889,!![]);}catch(_0x1843b9){return BPromise[_0x5084('0x20')](_0x1843b9);}return _0xa92a15['save']();};}function saveUpdates(_0x44461a,_0xd4080b){return function(_0x330ffa){if(_0x330ffa){return _0x330ffa['update'](_0x44461a)['then'](function(_0x5461db){return _0x5461db;});}return null;};}function removeEntity(_0xc14e05,_0x224c29){return function(_0x4a2f3f){if(_0x4a2f3f){return _0x4a2f3f[_0x5084('0x21')]()[_0x5084('0x22')](function(){_0xc14e05['status'](0xcc)[_0x5084('0x23')]();});}};}function handleEntityNotFound(_0xfe242a,_0xed0d17){return function(_0x2d01e1){if(!_0x2d01e1){_0xfe242a[_0x5084('0x16')](0x194);}return _0x2d01e1;};}function handleError(_0x146b21,_0x55b6e0){_0x55b6e0=_0x55b6e0||0x1f4;return function(_0x11b910){logger[_0x5084('0x24')](_0x11b910['stack']);if(_0x11b910[_0x5084('0x25')]){delete _0x11b910[_0x5084('0x25')];}_0x146b21['status'](_0x55b6e0)['send'](_0x11b910);};}exports['show']=function(_0xca5b2d,_0x177853){var _0x2538bb={'raw':!![],'where':{'id':_0xca5b2d[_0x5084('0x26')]['id']}},_0x5760e2={};_0x5760e2['model']=_[_0x5084('0x27')](db[_0x5084('0x28')][_0x5084('0x29')]);_0x5760e2[_0x5084('0x2a')]=_[_0x5084('0x27')](_0xca5b2d[_0x5084('0x2a')]);_0x5760e2[_0x5084('0x2b')]=_[_0x5084('0x2c')](_0x5760e2[_0x5084('0x2d')],_0x5760e2[_0x5084('0x2a')]);_0x2538bb[_0x5084('0x2e')]=_[_0x5084('0x2c')](_0x5760e2['model'],qs[_0x5084('0x2f')](_0xca5b2d[_0x5084('0x2a')]['fields']));_0x2538bb['attributes']=_0x2538bb[_0x5084('0x2e')][_0x5084('0x30')]?_0x2538bb[_0x5084('0x2e')]:_0x5760e2['model'];if(_0xca5b2d[_0x5084('0x2a')]['includeAll']){_0x2538bb[_0x5084('0x31')]=[{'all':!![]}];}_0x2538bb=_[_0x5084('0x32')]({},_0x2538bb,_0xca5b2d['options']);return db[_0x5084('0x28')][_0x5084('0x33')](_0x2538bb)[_0x5084('0x22')](handleEntityNotFound(_0x177853,null))[_0x5084('0x22')](respondWithResult(_0x177853,null))[_0x5084('0x34')](handleError(_0x177853,null));};exports['create']=function(_0xae716c,_0x7191e1){return db[_0x5084('0x28')]['create'](_0xae716c[_0x5084('0x35')],{})[_0x5084('0x22')](respondWithResult(_0x7191e1,0xc9))[_0x5084('0x34')](handleError(_0x7191e1,null));};exports[_0x5084('0x36')]=function(_0xefdab2,_0x4cdfc0){if(_0xefdab2[_0x5084('0x35')]['id']){delete _0xefdab2[_0x5084('0x35')]['id'];}return db[_0x5084('0x28')]['find']({'where':{'id':_0xefdab2[_0x5084('0x26')]['id']}})[_0x5084('0x22')](handleEntityNotFound(_0x4cdfc0,null))[_0x5084('0x22')](saveUpdates(_0xefdab2[_0x5084('0x35')],null))[_0x5084('0x22')](respondWithResult(_0x4cdfc0,null))['catch'](handleError(_0x4cdfc0,null));};exports['destroy']=function(_0x5a93b9,_0x57a746){return db['ChatProactiveAction'][_0x5084('0x33')]({'where':{'id':_0x5a93b9['params']['id']}})['then'](handleEntityNotFound(_0x57a746,null))[_0x5084('0x22')](removeEntity(_0x57a746,null))[_0x5084('0x34')](handleError(_0x57a746,null));}; \ No newline at end of file +var _0xf3a7=['papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','attributes','fields','merge','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x14884f,_0x382384){var _0x36acae=function(_0x3ec689){while(--_0x3ec689){_0x14884f['push'](_0x14884f['shift']());}};_0x36acae(++_0x382384);}(_0xf3a7,0x99));var _0x7f3a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3a7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f3a('0x0'));var zipdir=require(_0x7f3a('0x1'));var jsonpatch=require(_0x7f3a('0x2'));var rp=require(_0x7f3a('0x3'));var moment=require(_0x7f3a('0x4'));var BPromise=require(_0x7f3a('0x5'));var Mustache=require(_0x7f3a('0x6'));var util=require(_0x7f3a('0x7'));var path=require(_0x7f3a('0x8'));var sox=require(_0x7f3a('0x9'));var csv=require('to-csv');var ejs=require(_0x7f3a('0xa'));var fs=require('fs');var fs_extra=require(_0x7f3a('0xb'));var _=require(_0x7f3a('0xc'));var squel=require(_0x7f3a('0xd'));var crypto=require(_0x7f3a('0xe'));var jsforce=require(_0x7f3a('0xf'));var deskjs=require(_0x7f3a('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7f3a('0x11'));var Papa=require(_0x7f3a('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7f3a('0x13'));var as=require(_0x7f3a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f3a('0x15'))('api');var utils=require(_0x7f3a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7f3a('0x17'));var db=require(_0x7f3a('0x18'))['db'];function respondWithStatusCode(_0x200efc,_0x424ccb){_0x424ccb=_0x424ccb||0xcc;return function(_0x46b8e3){if(_0x46b8e3){return _0x200efc[_0x7f3a('0x19')](_0x424ccb);}return _0x200efc[_0x7f3a('0x1a')](_0x424ccb)[_0x7f3a('0x1b')]();};}function respondWithResult(_0x42b28f,_0x4b775b){_0x4b775b=_0x4b775b||0xc8;return function(_0x2bb3e4){if(_0x2bb3e4){return _0x42b28f['status'](_0x4b775b)[_0x7f3a('0x1c')](_0x2bb3e4);}};}function respondWithFilteredResult(_0x238e50,_0x17d457){return function(_0x3310fc){if(_0x3310fc){var _0x22112c=typeof _0x17d457[_0x7f3a('0x1d')]===_0x7f3a('0x1e')&&typeof _0x17d457['limit']===_0x7f3a('0x1e');var _0x1a9dab=_0x3310fc['count'];var _0x2eefb1=_0x22112c?0x0:_0x17d457[_0x7f3a('0x1d')];var _0x235e64=_0x22112c?_0x3310fc[_0x7f3a('0x1f')]:_0x17d457['offset']+_0x17d457['limit'];var _0x2d2164;if(_0x235e64>=_0x1a9dab){_0x235e64=_0x1a9dab;_0x2d2164=0xc8;}else{_0x2d2164=0xce;}_0x238e50[_0x7f3a('0x1a')](_0x2d2164);return _0x238e50[_0x7f3a('0x20')](_0x7f3a('0x21'),_0x2eefb1+'-'+_0x235e64+'/'+_0x1a9dab)[_0x7f3a('0x1c')](_0x3310fc);}return null;};}function patchUpdates(_0x48032d){return function(_0x44d250){try{jsonpatch[_0x7f3a('0x22')](_0x44d250,_0x48032d,!![]);}catch(_0x17f0e8){return BPromise[_0x7f3a('0x23')](_0x17f0e8);}return _0x44d250[_0x7f3a('0x24')]();};}function saveUpdates(_0x144067,_0x7c55cb){return function(_0x203067){if(_0x203067){return _0x203067[_0x7f3a('0x25')](_0x144067)[_0x7f3a('0x26')](function(_0x5c96a2){return _0x5c96a2;});}return null;};}function removeEntity(_0x537819,_0x4d5d4d){return function(_0x22cb57){if(_0x22cb57){return _0x22cb57[_0x7f3a('0x27')]()[_0x7f3a('0x26')](function(){_0x537819['status'](0xcc)[_0x7f3a('0x1b')]();});}};}function handleEntityNotFound(_0x38ccbf,_0x2505de){return function(_0x3479dc){if(!_0x3479dc){_0x38ccbf[_0x7f3a('0x19')](0x194);}return _0x3479dc;};}function handleError(_0x198cb8,_0x204266){_0x204266=_0x204266||0x1f4;return function(_0x1f48d6){logger[_0x7f3a('0x28')](_0x1f48d6['stack']);if(_0x1f48d6[_0x7f3a('0x29')]){delete _0x1f48d6[_0x7f3a('0x29')];}_0x198cb8[_0x7f3a('0x1a')](_0x204266)[_0x7f3a('0x2a')](_0x1f48d6);};}exports[_0x7f3a('0x2b')]=function(_0x440e28,_0x43940b){var _0x180700={'raw':!![],'where':{'id':_0x440e28[_0x7f3a('0x2c')]['id']}},_0x160f7e={};_0x160f7e[_0x7f3a('0x2d')]=_[_0x7f3a('0x2e')](db[_0x7f3a('0x2f')][_0x7f3a('0x30')]);_0x160f7e['query']=_[_0x7f3a('0x2e')](_0x440e28[_0x7f3a('0x31')]);_0x160f7e['filters']=_['intersection'](_0x160f7e[_0x7f3a('0x2d')],_0x160f7e[_0x7f3a('0x31')]);_0x180700[_0x7f3a('0x32')]=_['intersection'](_0x160f7e[_0x7f3a('0x2d')],qs[_0x7f3a('0x33')](_0x440e28[_0x7f3a('0x31')]['fields']));_0x180700[_0x7f3a('0x32')]=_0x180700[_0x7f3a('0x32')]['length']?_0x180700[_0x7f3a('0x32')]:_0x160f7e[_0x7f3a('0x2d')];if(_0x440e28['query']['includeAll']){_0x180700['include']=[{'all':!![]}];}_0x180700=_[_0x7f3a('0x34')]({},_0x180700,_0x440e28['options']);return db[_0x7f3a('0x2f')][_0x7f3a('0x35')](_0x180700)[_0x7f3a('0x26')](handleEntityNotFound(_0x43940b,null))[_0x7f3a('0x26')](respondWithResult(_0x43940b,null))[_0x7f3a('0x36')](handleError(_0x43940b,null));};exports[_0x7f3a('0x37')]=function(_0x954157,_0x2e7a3f){return db[_0x7f3a('0x2f')][_0x7f3a('0x37')](_0x954157[_0x7f3a('0x38')],{})['then'](respondWithResult(_0x2e7a3f,0xc9))['catch'](handleError(_0x2e7a3f,null));};exports[_0x7f3a('0x25')]=function(_0x489c66,_0x4da5fe){if(_0x489c66[_0x7f3a('0x38')]['id']){delete _0x489c66[_0x7f3a('0x38')]['id'];}return db[_0x7f3a('0x2f')]['find']({'where':{'id':_0x489c66[_0x7f3a('0x2c')]['id']}})['then'](handleEntityNotFound(_0x4da5fe,null))[_0x7f3a('0x26')](saveUpdates(_0x489c66[_0x7f3a('0x38')],null))['then'](respondWithResult(_0x4da5fe,null))[_0x7f3a('0x36')](handleError(_0x4da5fe,null));};exports[_0x7f3a('0x27')]=function(_0xf74b87,_0x3e0006){return db[_0x7f3a('0x2f')][_0x7f3a('0x35')]({'where':{'id':_0xf74b87[_0x7f3a('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3e0006,null))['then'](removeEntity(_0x3e0006,null))[_0x7f3a('0x36')](handleError(_0x3e0006,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 0ecead4..5f955d6 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 _0xf79a=['request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util','../../config/logger','api'];(function(_0x6cd197,_0x33df63){var _0x3480c7=function(_0x16dbb4){while(--_0x16dbb4){_0x6cd197['push'](_0x6cd197['shift']());}};_0x3480c7(++_0x33df63);}(_0xf79a,0x10f));var _0xaf79=function(_0x47076d,_0x26e4b5){_0x47076d=_0x47076d-0x0;var _0x59d3d2=_0xf79a[_0x47076d];return _0x59d3d2;};'use strict';var _=require(_0xaf79('0x0'));var util=require(_0xaf79('0x1'));var logger=require(_0xaf79('0x2'))(_0xaf79('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaf79('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf79('0x5'));var config=require(_0xaf79('0x6'));var attributes=require(_0xaf79('0x7'));module[_0xaf79('0x8')]=function(_0x1b66d8,_0x181748){return _0x1b66d8[_0xaf79('0x9')]('ChatProactiveAction',attributes,{'tableName':_0xaf79('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0bc8=['rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2b815b,_0x2c2f7c){var _0x58c082=function(_0x2b64eb){while(--_0x2b64eb){_0x2b815b['push'](_0x2b815b['shift']());}};_0x58c082(++_0x2c2f7c);}(_0x0bc8,0xae));var _0x80bc=function(_0x37a803,_0x39b66a){_0x37a803=_0x37a803-0x0;var _0x306045=_0x0bc8[_0x37a803];return _0x306045;};'use strict';var _=require(_0x80bc('0x0'));var util=require(_0x80bc('0x1'));var logger=require(_0x80bc('0x2'))(_0x80bc('0x3'));var moment=require(_0x80bc('0x4'));var BPromise=require(_0x80bc('0x5'));var rp=require(_0x80bc('0x6'));var fs=require('fs');var path=require(_0x80bc('0x7'));var rimraf=require(_0x80bc('0x8'));var config=require(_0x80bc('0x9'));var attributes=require(_0x80bc('0xa'));module[_0x80bc('0xb')]=function(_0x2aef1b,_0x364ae3){return _0x2aef1b[_0x80bc('0xc')]('ChatProactiveAction',attributes,{'tableName':_0x80bc('0xd'),'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 5711bad..84afb44 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 _0x3785=['rpc','jayson/promise','client','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x3785,0x1f1));var _0x5378=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x3785[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x5378('0x0'));var util=require('util');var moment=require(_0x5378('0x1'));var BPromise=require(_0x5378('0x2'));var rs=require(_0x5378('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5378('0x4'))['db'];var utils=require(_0x5378('0x5'));var logger=require(_0x5378('0x6'))(_0x5378('0x7'));var config=require('../../config/environment');var jayson=require(_0x5378('0x8'));var client=jayson[_0x5378('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3472e6,_0x4ec8d0,_0x51be6e){return new BPromise(function(_0x24664e,_0x156917){return client['request'](_0x3472e6,_0x51be6e)[_0x5378('0xa')](function(_0x294484){logger['info'](_0x5378('0xb'),_0x4ec8d0,_0x5378('0xc'));logger[_0x5378('0xd')](_0x5378('0xe'),_0x4ec8d0,'request\x20sent',JSON[_0x5378('0xf')](_0x294484));if(_0x294484[_0x5378('0x10')]){if(_0x294484[_0x5378('0x10')][_0x5378('0x11')]===0x1f4){logger['error'](_0x5378('0xb'),_0x4ec8d0,_0x294484['error']['message']);return _0x156917(_0x294484[_0x5378('0x10')][_0x5378('0x12')]);}logger['error'](_0x5378('0xb'),_0x4ec8d0,_0x294484['error'][_0x5378('0x12')]);return _0x24664e(_0x294484[_0x5378('0x10')][_0x5378('0x12')]);}else{logger[_0x5378('0x13')](_0x5378('0xb'),_0x4ec8d0,'request\x20sent');_0x24664e(_0x294484['result'][_0x5378('0x12')]);}})[_0x5378('0x14')](function(_0x3576a6){logger[_0x5378('0x10')](_0x5378('0xb'),_0x4ec8d0,_0x3576a6);_0x156917(_0x3576a6);});});} \ No newline at end of file +var _0x1a94=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch'];(function(_0x5cdc88,_0x1d0650){var _0x132a99=function(_0x51c5f6){while(--_0x51c5f6){_0x5cdc88['push'](_0x5cdc88['shift']());}};_0x132a99(++_0x1d0650);}(_0x1a94,0x1a2));var _0x41a9=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x1a94[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x41a9('0x0'));var util=require(_0x41a9('0x1'));var moment=require(_0x41a9('0x2'));var BPromise=require(_0x41a9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x41a9('0x4'));var db=require(_0x41a9('0x5'))['db'];var utils=require(_0x41a9('0x6'));var logger=require(_0x41a9('0x7'))(_0x41a9('0x8'));var config=require(_0x41a9('0x9'));var jayson=require(_0x41a9('0xa'));var client=jayson[_0x41a9('0xb')][_0x41a9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f58c4,_0x1c7db4,_0x13eaa9){return new BPromise(function(_0x3a11c9,_0x4d628a){return client['request'](_0x2f58c4,_0x13eaa9)['then'](function(_0x5b888b){logger[_0x41a9('0xd')](_0x41a9('0xe'),_0x1c7db4,'request\x20sent');logger['debug'](_0x41a9('0xf'),_0x1c7db4,'request\x20sent',JSON[_0x41a9('0x10')](_0x5b888b));if(_0x5b888b[_0x41a9('0x11')]){if(_0x5b888b[_0x41a9('0x11')]['code']===0x1f4){logger[_0x41a9('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x1c7db4,_0x5b888b['error'][_0x41a9('0x12')]);return _0x4d628a(_0x5b888b[_0x41a9('0x11')][_0x41a9('0x12')]);}logger[_0x41a9('0x11')](_0x41a9('0xe'),_0x1c7db4,_0x5b888b['error'][_0x41a9('0x12')]);return _0x3a11c9(_0x5b888b['error'][_0x41a9('0x12')]);}else{logger[_0x41a9('0xd')](_0x41a9('0xe'),_0x1c7db4,_0x41a9('0x13'));_0x3a11c9(_0x5b888b[_0x41a9('0x14')][_0x41a9('0x12')]);}})[_0x41a9('0x15')](function(_0x554a07){logger[_0x41a9('0x11')](_0x41a9('0xe'),_0x1c7db4,_0x554a07);_0x4d628a(_0x554a07);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index e79431c..4d9b394 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 _0x8d0e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','isAuthenticated','show','post','create','put','/:id','delete','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x4a53ca,_0x4eac98){_0x4a53ca=_0x4a53ca-0x0;var _0x451cfc=_0x8d0e[_0x4a53ca];return _0x451cfc;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var fs_extra=require(_0xe8d0('0x6'));var auth=require(_0xe8d0('0x7'));var interaction=require(_0xe8d0('0x8'));var config=require('../../config/environment');var controller=require(_0xe8d0('0x9'));router['get']('/:id',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xb')]);router[_0xe8d0('0xc')]('/',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xd')]);router[_0xe8d0('0xe')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['update']);router[_0xe8d0('0x10')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5fd1=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','update','multer','path','connect-timeout','express'];(function(_0x347380,_0x55914d){var _0x410b4c=function(_0x1e48a4){while(--_0x1e48a4){_0x347380['push'](_0x347380['shift']());}};_0x410b4c(++_0x55914d);}(_0x5fd1,0x155));var _0x15fd=function(_0x2a2674,_0x308160){_0x2a2674=_0x2a2674-0x0;var _0x42c11f=_0x5fd1[_0x2a2674];return _0x42c11f;};'use strict';var multer=require(_0x15fd('0x0'));var util=require('util');var path=require(_0x15fd('0x1'));var timeout=require(_0x15fd('0x2'));var express=require(_0x15fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x15fd('0x4'));var interaction=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x15fd('0x7')](_0x15fd('0x8'),auth[_0x15fd('0x9')](),controller[_0x15fd('0xa')]);router[_0x15fd('0xb')]('/',auth['isAuthenticated'](),controller[_0x15fd('0xc')]);router[_0x15fd('0xd')](_0x15fd('0x8'),auth['isAuthenticated'](),controller[_0x15fd('0xe')]);router['delete'](_0x15fd('0x8'),auth[_0x15fd('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index fac58a6..213ab8f 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 _0x8247=['INTEGER','rrmemory','sequelize','STRING'];(function(_0x431ff8,_0x4085dd){var _0x84ccd4=function(_0x1fd1b5){while(--_0x1fd1b5){_0x431ff8['push'](_0x431ff8['shift']());}};_0x84ccd4(++_0x4085dd);}(_0x8247,0x13e));var _0x7824=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x8247[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require(_0x7824('0x0'));module['exports']={'name':{'type':Sequelize[_0x7824('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7824('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7824('0x3'),'beepall','roundrobin')}}; \ No newline at end of file +var _0xdeb9=['rrmemory','beepall','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x24ffb4,_0x2072aa){var _0x404ce4=function(_0x48e0c1){while(--_0x48e0c1){_0x24ffb4['push'](_0x24ffb4['shift']());}};_0x404ce4(++_0x2072aa);}(_0xdeb9,0x6a));var _0x9deb=function(_0x36a1b6,_0x5b56ef){_0x36a1b6=_0x36a1b6-0x0;var _0x5f5a09=_0xdeb9[_0x36a1b6];return _0x5f5a09;};'use strict';var Sequelize=require(_0x9deb('0x0'));module[_0x9deb('0x1')]={'name':{'type':Sequelize[_0x9deb('0x2')],'unique':_0x9deb('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9deb('0x2')]},'timeout':{'type':Sequelize[_0x9deb('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9deb('0x5')](_0x9deb('0x6'),_0x9deb('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 4bf610d..d07d9d9 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 _0x9578=['rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','http','request','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','reject','then','ChatQueues','destroy','end','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','params','fields','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','ChatQueueId','UserChatQueue','findAll','User','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','pick','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','select','field','from','team_has_chat_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','isArray','getAgents'];(function(_0x3cb765,_0x3cebd0){var _0x7f6785=function(_0x551462){while(--_0x551462){_0x3cb765['push'](_0x3cb765['shift']());}};_0x7f6785(++_0x3cebd0);}(_0x9578,0x96));var _0x8957=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9578[_0x5608a3];return _0x1ed50a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8957('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8957('0x1'));var rp=require(_0x8957('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8957('0x3'));var util=require(_0x8957('0x4'));var path=require(_0x8957('0x5'));var sox=require(_0x8957('0x6'));var csv=require(_0x8957('0x7'));var ejs=require(_0x8957('0x8'));var fs=require('fs');var fs_extra=require(_0x8957('0x9'));var _=require(_0x8957('0xa'));var squel=require('squel');var crypto=require(_0x8957('0xb'));var jsforce=require(_0x8957('0xc'));var deskjs=require(_0x8957('0xd'));var toCsv=require(_0x8957('0x7'));var querystring=require(_0x8957('0xe'));var Papa=require(_0x8957('0xf'));var Redis=require(_0x8957('0x10'));var authService=require(_0x8957('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8957('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8957('0x13'))(_0x8957('0x14'));var utils=require('../../config/utils');var config=require(_0x8957('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x8957('0x16')]=_[_0x8957('0x17')](config[_0x8957('0x16')],{'host':_0x8957('0x18'),'port':0x18eb});var socket=require(_0x8957('0x19'))(new Redis(config[_0x8957('0x16')]));require(_0x8957('0x1a'))[_0x8957('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x8957('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x3e5460,_0x11bb4d,_0x51b16d,_0x138353){return new BPromise(function(_0x17a125,_0x4e50ba){var _0x5b9cbf=_0x138353||client;return _0x5b9cbf[_0x8957('0x1d')](_0x3e5460,_0x51b16d)['then'](function(_0x26a87d){logger['info']('ChatQueue,\x20%s,\x20%s',_0x11bb4d,'request\x20sent');logger[_0x8957('0x1e')](_0x8957('0x1f'),_0x11bb4d,_0x8957('0x20'),JSON[_0x8957('0x21')](_0x26a87d));if(_0x26a87d[_0x8957('0x22')]){if(_0x26a87d[_0x8957('0x22')][_0x8957('0x23')]===0x1f4){logger[_0x8957('0x22')](_0x8957('0x24'),_0x11bb4d,_0x26a87d[_0x8957('0x22')][_0x8957('0x25')]);return _0x4e50ba(_0x26a87d['error'][_0x8957('0x25')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x11bb4d,_0x26a87d[_0x8957('0x22')][_0x8957('0x25')]);return _0x17a125(_0x26a87d['error'][_0x8957('0x25')]);}else{logger[_0x8957('0x26')](_0x8957('0x24'),_0x11bb4d,_0x8957('0x20'));_0x17a125(_0x26a87d[_0x8957('0x27')][_0x8957('0x25')]);}})[_0x8957('0x28')](function(_0x157aeb){logger[_0x8957('0x22')](_0x8957('0x24'),_0x11bb4d,_0x157aeb);_0x4e50ba(_0x157aeb);});});}function respondWithStatusCode(_0x3170de,_0x30303a){_0x30303a=_0x30303a||0xcc;return function(_0x173fde){if(_0x173fde){return _0x3170de[_0x8957('0x29')](_0x30303a);}return _0x3170de[_0x8957('0x2a')](_0x30303a)['end']();};}function respondWithResult(_0x26351a,_0x2de29c){_0x2de29c=_0x2de29c||0xc8;return function(_0x2f856b){if(_0x2f856b){return _0x26351a[_0x8957('0x2a')](_0x2de29c)[_0x8957('0x2b')](_0x2f856b);}};}function respondWithFilteredResult(_0x3a3b5d,_0x543727){return function(_0x2f021c){if(_0x2f021c){var _0x203031=typeof _0x543727[_0x8957('0x2c')]===_0x8957('0x2d')&&typeof _0x543727[_0x8957('0x2e')]===_0x8957('0x2d');var _0x5bbd23=_0x2f021c[_0x8957('0x2f')];var _0x10adb7=_0x203031?0x0:_0x543727[_0x8957('0x2c')];var _0x53e233=_0x203031?_0x2f021c[_0x8957('0x2f')]:_0x543727[_0x8957('0x2c')]+_0x543727[_0x8957('0x2e')];var _0x456da0;if(_0x53e233>=_0x5bbd23){_0x53e233=_0x5bbd23;_0x456da0=0xc8;}else{_0x456da0=0xce;}_0x3a3b5d[_0x8957('0x2a')](_0x456da0);return _0x3a3b5d[_0x8957('0x30')]('Content-Range',_0x10adb7+'-'+_0x53e233+'/'+_0x5bbd23)['json'](_0x2f021c);}return null;};}function patchUpdates(_0x435bf1){return function(_0x42aea2){try{jsonpatch['apply'](_0x42aea2,_0x435bf1,!![]);}catch(_0x4a6647){return BPromise[_0x8957('0x31')](_0x4a6647);}return _0x42aea2['save']();};}function saveUpdates(_0x4236c3,_0xc56603){return function(_0x30b1d8){if(_0x30b1d8){return _0x30b1d8['update'](_0x4236c3)['then'](function(_0x137798){return _0x137798;});}return null;};}function removeEntity(_0x4bb9e1,_0xba3b64){return function(_0x147f21){if(_0x147f21){return _0x147f21['destroy']()[_0x8957('0x32')](function(){var _0x262d6d=_0x147f21['get']({'plain':!![]});var _0x1a0875=_0x8957('0x33');return db['UserProfileResource'][_0x8957('0x34')]({'where':{'type':_0x1a0875,'resourceId':_0x262d6d['id']}})[_0x8957('0x32')](function(){return _0x147f21;});})[_0x8957('0x32')](function(){_0x4bb9e1[_0x8957('0x2a')](0xcc)[_0x8957('0x35')]();});}};}function handleEntityNotFound(_0x4beff9,_0x502c03){return function(_0x3400ba){if(!_0x3400ba){_0x4beff9['sendStatus'](0x194);}return _0x3400ba;};}function handleError(_0x52bd02,_0x4648ca){_0x4648ca=_0x4648ca||0x1f4;return function(_0x23d088){logger[_0x8957('0x22')](_0x23d088['stack']);if(_0x23d088[_0x8957('0x36')]){delete _0x23d088['name'];}_0x52bd02[_0x8957('0x2a')](_0x4648ca)[_0x8957('0x37')](_0x23d088);};}exports[_0x8957('0x38')]=function(_0x1c4ead,_0x638d38){var _0x2fd873={},_0x481b8f={},_0x54330f={'count':0x0,'rows':[]};var _0x2e3c82=_['map'](db[_0x8957('0x39')][_0x8957('0x3a')],function(_0x4c4102){return{'name':_0x4c4102[_0x8957('0x3b')],'type':_0x4c4102[_0x8957('0x3c')][_0x8957('0x3d')]};});_0x481b8f[_0x8957('0x3e')]=_[_0x8957('0x3f')](_0x2e3c82,_0x8957('0x36'));_0x481b8f[_0x8957('0x40')]=_[_0x8957('0x41')](_0x1c4ead[_0x8957('0x40')]);_0x481b8f[_0x8957('0x42')]=_[_0x8957('0x43')](_0x481b8f['model'],_0x481b8f[_0x8957('0x40')]);_0x2fd873[_0x8957('0x44')]=_[_0x8957('0x43')](_0x481b8f['model'],qs['fields'](_0x1c4ead['query']['fields']));_0x2fd873['attributes']=_0x2fd873[_0x8957('0x44')]['length']?_0x2fd873[_0x8957('0x44')]:_0x481b8f[_0x8957('0x3e')];if(!_0x1c4ead[_0x8957('0x40')][_0x8957('0x45')](_0x8957('0x46'))){_0x2fd873['limit']=qs['limit'](_0x1c4ead[_0x8957('0x40')][_0x8957('0x2e')]);_0x2fd873[_0x8957('0x2c')]=qs[_0x8957('0x2c')](_0x1c4ead[_0x8957('0x40')][_0x8957('0x2c')]);}_0x2fd873[_0x8957('0x47')]=qs[_0x8957('0x48')](_0x1c4ead[_0x8957('0x40')][_0x8957('0x48')]);_0x2fd873[_0x8957('0x49')]=qs[_0x8957('0x42')](_['pick'](_0x1c4ead['query'],_0x481b8f[_0x8957('0x42')]),_0x2e3c82);if(_0x1c4ead[_0x8957('0x40')]['filter']){_0x2fd873[_0x8957('0x49')]=_[_0x8957('0x4a')](_0x2fd873[_0x8957('0x49')],{'$or':_['map'](_0x2e3c82,function(_0x2d0d3d){if(_0x2d0d3d[_0x8957('0x3c')]!==_0x8957('0x4b')){var _0x607a86={};_0x607a86[_0x2d0d3d[_0x8957('0x36')]]={'$like':'%'+_0x1c4ead[_0x8957('0x40')][_0x8957('0x4c')]+'%'};return _0x607a86;}})});}_0x2fd873=_[_0x8957('0x4a')]({},_0x2fd873,_0x1c4ead[_0x8957('0x4d')]);var _0x24ca09={'where':_0x2fd873[_0x8957('0x49')]};return db['ChatQueue'][_0x8957('0x2f')](_0x24ca09)[_0x8957('0x32')](function(_0x2cd6c4){_0x54330f['count']=_0x2cd6c4;if(_0x1c4ead[_0x8957('0x40')][_0x8957('0x4e')]){_0x2fd873[_0x8957('0x4f')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x2fd873);})['then'](function(_0x1f2b97){_0x54330f[_0x8957('0x50')]=_0x1f2b97;return _0x54330f;})[_0x8957('0x32')](respondWithFilteredResult(_0x638d38,_0x2fd873))[_0x8957('0x28')](handleError(_0x638d38,null));};exports['show']=function(_0x5ae477,_0x5da1cd){var _0x45dff4={'raw':!![],'where':{'id':_0x5ae477[_0x8957('0x51')]['id']}},_0x388441={};_0x388441['model']=_[_0x8957('0x41')](db[_0x8957('0x39')][_0x8957('0x3a')]);_0x388441[_0x8957('0x40')]=_[_0x8957('0x41')](_0x5ae477[_0x8957('0x40')]);_0x388441['filters']=_['intersection'](_0x388441[_0x8957('0x3e')],_0x388441[_0x8957('0x40')]);_0x45dff4[_0x8957('0x44')]=_['intersection'](_0x388441['model'],qs[_0x8957('0x52')](_0x5ae477[_0x8957('0x40')]['fields']));_0x45dff4[_0x8957('0x44')]=_0x45dff4[_0x8957('0x44')][_0x8957('0x53')]?_0x45dff4['attributes']:_0x388441[_0x8957('0x3e')];if(_0x5ae477[_0x8957('0x40')][_0x8957('0x4e')]){_0x45dff4[_0x8957('0x4f')]=[{'all':!![]}];}_0x45dff4=_[_0x8957('0x4a')]({},_0x45dff4,_0x5ae477[_0x8957('0x4d')]);return db[_0x8957('0x39')][_0x8957('0x54')](_0x45dff4)[_0x8957('0x32')](handleEntityNotFound(_0x5da1cd,null))[_0x8957('0x32')](respondWithResult(_0x5da1cd,null))[_0x8957('0x28')](handleError(_0x5da1cd,null));};exports[_0x8957('0x55')]=function(_0x295915,_0x423f78){return db[_0x8957('0x39')][_0x8957('0x55')](_0x295915[_0x8957('0x56')],{})[_0x8957('0x32')](function(_0xc56038){var _0x4ec3c4=_0x295915[_0x8957('0x57')][_0x8957('0x58')]({'plain':!![]});if(!_0x4ec3c4)throw new Error(_0x8957('0x59'));if(_0x4ec3c4[_0x8957('0x5a')]===_0x8957('0x57')){var _0x1911c3=_0xc56038[_0x8957('0x58')]({'plain':!![]});var _0xa5ee1b='ChatQueues';return db[_0x8957('0x5b')]['find']({'where':{'name':_0xa5ee1b,'userProfileId':_0x4ec3c4[_0x8957('0x5c')]},'raw':!![]})[_0x8957('0x32')](function(_0x2988bc){if(_0x2988bc&&_0x2988bc['autoAssociation']===0x0){return db[_0x8957('0x5d')]['create']({'name':_0x1911c3['name'],'resourceId':_0x1911c3['id'],'type':_0x2988bc[_0x8957('0x36')],'sectionId':_0x2988bc['id']},{})[_0x8957('0x32')](function(){return _0xc56038;});}else{return _0xc56038;}})[_0x8957('0x28')](function(_0x2fa4b8){logger['error'](_0x8957('0x5e'),_0x2fa4b8);throw _0x2fa4b8;});}return _0xc56038;})[_0x8957('0x32')](respondWithResult(_0x423f78,0xc9))[_0x8957('0x28')](handleError(_0x423f78,null));};exports[_0x8957('0x5f')]=function(_0x2d8780,_0x50309d){if(_0x2d8780[_0x8957('0x56')]['id']){delete _0x2d8780[_0x8957('0x56')]['id'];}return db[_0x8957('0x39')][_0x8957('0x54')]({'where':{'id':_0x2d8780['params']['id']}})[_0x8957('0x32')](handleEntityNotFound(_0x50309d,null))['then'](saveUpdates(_0x2d8780[_0x8957('0x56')],null))['then'](respondWithResult(_0x50309d,null))[_0x8957('0x28')](handleError(_0x50309d,null));};exports[_0x8957('0x34')]=function(_0x3ade11,_0x2accad){return db[_0x8957('0x39')][_0x8957('0x54')]({'where':{'id':_0x3ade11[_0x8957('0x51')]['id']}})['then'](handleEntityNotFound(_0x2accad,null))[_0x8957('0x32')](removeEntity(_0x2accad,null))[_0x8957('0x28')](handleError(_0x2accad,null));};exports[_0x8957('0x60')]=function(_0x53b325,_0x345c5d){return db[_0x8957('0x39')]['describe']()[_0x8957('0x32')](respondWithResult(_0x345c5d,null))[_0x8957('0x28')](handleError(_0x345c5d,null));};exports['getMembers']=function(_0xc61f9e,_0x1d08dc,_0x583d00){var _0x244559={'raw':!![],'where':{}},_0x324e5e={},_0x4af6df;return db[_0x8957('0x39')][_0x8957('0x61')]({'where':{'id':_0xc61f9e['params']['id']}})[_0x8957('0x32')](handleEntityNotFound(_0x1d08dc,null))[_0x8957('0x32')](function(_0x2fc0d1){if(_0x2fc0d1){_0x4af6df=_0x2fc0d1[_0x8957('0x58')]({'plain':!![]});_0x324e5e['model']=_[_0x8957('0x41')](db['UserChatQueue'][_0x8957('0x3a')]);_0x324e5e[_0x8957('0x40')]=_[_0x8957('0x41')](_0xc61f9e[_0x8957('0x40')]);_0x324e5e['filters']=_['intersection'](_0x324e5e[_0x8957('0x3e')],_0x324e5e[_0x8957('0x40')]);_0x244559[_0x8957('0x44')]=_[_0x8957('0x43')](_0x324e5e[_0x8957('0x3e')],qs['fields'](_0xc61f9e[_0x8957('0x40')][_0x8957('0x52')]));_0x244559['attributes']=_0x244559[_0x8957('0x44')]['length']?_0x244559[_0x8957('0x44')]:_0x324e5e[_0x8957('0x3e')];if(!_0xc61f9e[_0x8957('0x40')]['hasOwnProperty'](_0x8957('0x46'))){_0x244559[_0x8957('0x2e')]=qs[_0x8957('0x2e')](_0xc61f9e['query'][_0x8957('0x2e')]);_0x244559['offset']=qs[_0x8957('0x2c')](_0xc61f9e['query']['offset']);}_0x244559[_0x8957('0x47')]=qs[_0x8957('0x48')](_0xc61f9e[_0x8957('0x40')][_0x8957('0x48')]);_0x244559['where']=qs[_0x8957('0x42')](_['pick'](_0xc61f9e['query'],_0x324e5e['filters']));_0x244559[_0x8957('0x49')][_0x8957('0x62')]=_0x2fc0d1['id'];if(_0xc61f9e['query'][_0x8957('0x4c')]){_0x244559[_0x8957('0x49')]=_['merge'](_0x244559[_0x8957('0x49')],{'$or':_[_0x8957('0x3f')](_0x244559[_0x8957('0x44')],function(_0x4af118){var _0x35ed92={};_0x35ed92[_0x4af118]={'$like':'%'+_0xc61f9e[_0x8957('0x40')]['filter']+'%'};return _0x35ed92;})});}_0x244559=_[_0x8957('0x4a')]({},_0x244559,_0xc61f9e['options']);return db[_0x8957('0x63')][_0x8957('0x64')](_0x244559);}})[_0x8957('0x32')](function(_0x1b8e5a){if(_0x1b8e5a){return db[_0x8957('0x65')]['findAndCountAll']({'where':{'id':_[_0x8957('0x3f')](_0x1b8e5a,_0x8957('0x66')),'role':_0x8957('0x67')},'attributes':['id',_0x8957('0x36'),'chatPause',_0x8957('0x68'),_0x8957('0x69')]});}})[_0x8957('0x32')](function(_0x1a0cf6){if(_0x1a0cf6){return{'count':_0x1a0cf6[_0x8957('0x2f')],'rows':_[_0x8957('0x3f')](_0x1a0cf6[_0x8957('0x50')],function(_0x3c6a09){return{'membername':_0x3c6a09[_0x8957('0x36')],'UserId':_0x3c6a09['id'],'queue_name':_0x4af6df[_0x8957('0x36')],'ChatQueueId':_0x4af6df['id'],'interface':util[_0x8957('0x6a')](_0x8957('0x6b'),_0x8957('0x6c'),_0x3c6a09['name']),'penalty':0x0,'paused':_0x3c6a09['chatPause'],'createdAt':_0x3c6a09[_0x8957('0x69')],'updatedAt':_0x3c6a09[_0x8957('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8957('0x32')](respondWithFilteredResult(_0x1d08dc,_0x244559))['catch'](handleError(_0x1d08dc,null));};exports[_0x8957('0x6d')]=function(_0x27b9d6,_0x490810,_0x458771){var _0x7d7f08={};var _0x5e8031={};var _0x26f3f9;var _0x11df7e;return db['ChatQueue'][_0x8957('0x61')]({'where':{'id':_0x27b9d6[_0x8957('0x51')]['id']}})['then'](handleEntityNotFound(_0x490810,null))[_0x8957('0x32')](function(_0x30747f){if(_0x30747f){_0x26f3f9=_0x30747f;_0x5e8031[_0x8957('0x3e')]=_['keys'](db[_0x8957('0x6e')][_0x8957('0x3a')]);_0x5e8031['query']=_[_0x8957('0x41')](_0x27b9d6[_0x8957('0x40')]);_0x5e8031[_0x8957('0x42')]=_['intersection'](_0x5e8031[_0x8957('0x3e')],_0x5e8031['query']);_0x7d7f08[_0x8957('0x44')]=_['intersection'](_0x5e8031['model'],qs[_0x8957('0x52')](_0x27b9d6[_0x8957('0x40')][_0x8957('0x52')]));_0x7d7f08['attributes']=_0x7d7f08[_0x8957('0x44')][_0x8957('0x53')]?_0x7d7f08[_0x8957('0x44')]:_0x5e8031[_0x8957('0x3e')];_0x7d7f08[_0x8957('0x47')]=qs[_0x8957('0x48')](_0x27b9d6[_0x8957('0x40')]['sort']);_0x7d7f08[_0x8957('0x49')]=qs[_0x8957('0x42')](_[_0x8957('0x6f')](_0x27b9d6[_0x8957('0x40')],_0x5e8031[_0x8957('0x42')]));if(_0x27b9d6['query']['filter']){_0x7d7f08['where']=_[_0x8957('0x4a')](_0x7d7f08[_0x8957('0x49')],{'$or':_[_0x8957('0x3f')](_0x7d7f08['attributes'],function(_0x3b53c3){var _0xe2ebca={};_0xe2ebca[_0x3b53c3]={'$like':'%'+_0x27b9d6[_0x8957('0x40')][_0x8957('0x4c')]+'%'};return _0xe2ebca;})});}_0x7d7f08=_[_0x8957('0x4a')]({},_0x7d7f08,_0x27b9d6[_0x8957('0x4d')]);return _0x26f3f9[_0x8957('0x6d')](_0x7d7f08);}})['then'](function(_0x1998f8){if(_0x1998f8){_0x11df7e=_0x1998f8[_0x8957('0x53')];if(!_0x27b9d6['query'][_0x8957('0x45')](_0x8957('0x46'))){_0x7d7f08[_0x8957('0x2e')]=qs[_0x8957('0x2e')](_0x27b9d6[_0x8957('0x40')][_0x8957('0x2e')]);_0x7d7f08['offset']=qs[_0x8957('0x2c')](_0x27b9d6[_0x8957('0x40')][_0x8957('0x2c')]);}return _0x26f3f9[_0x8957('0x6d')](_0x7d7f08);}})['then'](function(_0x17801c){if(_0x17801c){return _0x17801c?{'count':_0x11df7e,'rows':_0x17801c}:null;}})[_0x8957('0x32')](respondWithResult(_0x490810,null))[_0x8957('0x28')](handleError(_0x490810,null));};exports[_0x8957('0x70')]=function(_0x1a7aa5,_0x450391,_0x3d76db){var _0x38803a=_0x1a7aa5['body'][_0x8957('0x71')];return db[_0x8957('0x6e')][_0x8957('0x64')]({'where':{'id':_0x38803a},'attributes':['id'],'include':[{'model':db[_0x8957('0x65')],'as':_0x8957('0x72'),'attributes':['id',_0x8957('0x36'),_0x8957('0x73'),'voicePause',_0x8957('0x74')],'raw':!![]}]})[_0x8957('0x32')](function(_0x46d875){if(_0x46d875){var _0x24bcfc=_[_0x8957('0x75')](_0x46d875,function(_0x34a486){var _0x3c8a21=_0x34a486['get']({'plain':!![]});return _0x3c8a21[_0x8957('0x72')];});return db['ChatQueue'][_0x8957('0x54')]({'where':{'id':_0x1a7aa5['params']['id']}})[_0x8957('0x32')](function(_0x5bd011){return db[_0x8957('0x76')][_0x8957('0x77')](function(_0x411eb5){return _0x5bd011[_0x8957('0x70')](_0x38803a,{'transaction':_0x411eb5})[_0x8957('0x32')](function(){return BPromise[_0x8957('0x78')](_0x24bcfc,function(_0x22bad1){return db['UserChatQueue'][_0x8957('0x79')]({'where':{'UserId':_0x22bad1['id'],'ChatQueueId':_0x1a7aa5['params']['id']},'transaction':_0x411eb5});});})['then'](function(){_0x24bcfc[_0x8957('0x7a')](function(_0x22c0e8){socket[_0x8957('0x7b')](_0x8957('0x7c'),{'UserId':_0x22c0e8['id'],'ChatQueueId':_0x5bd011['id']});});});});});}})['then'](respondWithStatusCode(_0x450391,null))['catch'](handleError(_0x450391,null));};exports['removeTeams']=function(_0x170738,_0x429006,_0x48be85){return db[_0x8957('0x6e')][_0x8957('0x64')]({'where':{'id':_0x170738[_0x8957('0x40')][_0x8957('0x71')]},'attributes':['id'],'include':[{'model':db[_0x8957('0x65')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8957('0x32')](handleEntityNotFound(_0x429006,null))[_0x8957('0x32')](function(_0x5ea1cb){var _0x183903=_[_0x8957('0x3f')](_0x5ea1cb,'id');var _0x2c0b8a=[];var _0x29ede0=[];var _0x592131=squel[_0x8957('0x7d')]();_0x592131[_0x8957('0x7e')]('tq.TeamId')[_0x8957('0x7f')](_0x8957('0x80'),'tq')[_0x8957('0x81')](_0x8957('0x82'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('ChatQueueId\x20=\x20?',_0x170738[_0x8957('0x51')]['id']);for(var _0x45dd75=0x0;_0x45dd75<_0x5ea1cb[_0x8957('0x53')];_0x45dd75+=0x1){let _0xd7d0e7=_0x5ea1cb[_0x45dd75];for(var _0x4db31a=0x0;_0x4db31a<_0xd7d0e7[_0x8957('0x72')][_0x8957('0x53')];_0x4db31a+=0x1){let _0x5f0180=_0xd7d0e7[_0x8957('0x72')][_0x4db31a];var _0x27de4c=_0x592131[_0x8957('0x83')]();_0x27de4c[_0x8957('0x49')](_0x8957('0x84'),_0x5f0180['id']);_0x29ede0[_0x8957('0x85')](db[_0x8957('0x76')][_0x8957('0x40')](_0x27de4c[_0x8957('0x86')](),{'type':db[_0x8957('0x76')][_0x8957('0x87')][_0x8957('0x88')]})[_0x8957('0x32')](function(_0x28f973){if(_0x28f973[_0x8957('0x53')]===0x1){return _0x5f0180['id'];}else{var _0x9bdcb8=_[_0x8957('0x89')](_[_0x8957('0x3f')](_0x28f973,_0x8957('0x8a')),function(_0x3858c3){return _[_0x8957('0x8b')](_0x183903,_0x3858c3);});if(_0x9bdcb8){return _0x5f0180['id'];}}}));}}return BPromise[_0x8957('0x8c')](_0x29ede0)['then'](function(_0x3bf7d3){_0x2c0b8a=_(_0x2c0b8a)['union'](_0x3bf7d3)[_0x8957('0x8d')]()[_0x8957('0x8e')]();return db[_0x8957('0x39')][_0x8957('0x54')]({'where':{'id':_0x170738[_0x8957('0x51')]['id']}})[_0x8957('0x32')](function(_0xf31a63){return db[_0x8957('0x76')][_0x8957('0x77')](function(_0x7155e5){return _0xf31a63['removeTeams'](_0x170738['query'][_0x8957('0x71')],{'transaction':_0x7155e5})['then'](function(){if(!_[_0x8957('0x8f')](_0x2c0b8a)){return _0xf31a63[_0x8957('0x90')](_0x2c0b8a,{'transaction':_0x7155e5});}})['then'](function(){_0x2c0b8a[_0x8957('0x7a')](function(_0x299eae){socket[_0x8957('0x7b')](_0x8957('0x91'),{'UserId':_0x299eae,'ChatQueueId':_0xf31a63['id']});});});});});});})[_0x8957('0x32')](respondWithStatusCode(_0x429006,null))['catch'](handleError(_0x429006,null));};exports[_0x8957('0x92')]=function(_0x41c583,_0xa28514,_0x1f5221){return db[_0x8957('0x39')][_0x8957('0x54')]({'where':{'id':_0x41c583[_0x8957('0x51')]['id']}})[_0x8957('0x32')](handleEntityNotFound(_0xa28514,null))[_0x8957('0x32')](function(_0x5e9eea){if(_0x5e9eea){return _0x5e9eea[_0x8957('0x92')](_0x41c583[_0x8957('0x56')][_0x8957('0x71')],_['omit'](_0x41c583[_0x8957('0x56')],[_0x8957('0x71'),'id'])||{})[_0x8957('0x93')](function(_0x51982d){for(var _0x15889a=0x0;_0x15889a<_0x41c583['body'][_0x8957('0x71')][_0x8957('0x53')];_0x15889a+=0x1){socket[_0x8957('0x7b')]('userChatQueue:save',{'UserId':Number(_0x41c583[_0x8957('0x56')][_0x8957('0x71')][_0x15889a]),'ChatQueueId':Number(_0x41c583['params']['id'])});}return _0x51982d;});}})['then'](respondWithResult(_0xa28514,null))[_0x8957('0x28')](handleError(_0xa28514,null));};exports[_0x8957('0x90')]=function(_0x36bea4,_0x4658f5,_0x312f48){return db[_0x8957('0x39')][_0x8957('0x54')]({'where':{'id':_0x36bea4[_0x8957('0x51')]['id']}})[_0x8957('0x32')](handleEntityNotFound(_0x4658f5,null))[_0x8957('0x32')](function(_0x5e2c66){if(_0x5e2c66){return _0x5e2c66[_0x8957('0x90')](_0x36bea4[_0x8957('0x40')]['ids'])[_0x8957('0x32')](function(){if(_[_0x8957('0x94')](_0x36bea4[_0x8957('0x40')][_0x8957('0x71')])){for(var _0x1d0292=0x0;_0x1d0292<_0x36bea4[_0x8957('0x40')][_0x8957('0x71')]['length'];_0x1d0292+=0x1){socket[_0x8957('0x7b')]('userChatQueue:remove',{'UserId':Number(_0x36bea4['query'][_0x8957('0x71')][_0x1d0292]),'ChatQueueId':Number(_0x36bea4[_0x8957('0x51')]['id'])});}}else{socket[_0x8957('0x7b')]('userChatQueue:remove',{'UserId':Number(_0x36bea4['query'][_0x8957('0x71')]),'ChatQueueId':Number(_0x36bea4[_0x8957('0x51')]['id'])});}});}})[_0x8957('0x32')](respondWithStatusCode(_0x4658f5,null))['catch'](handleError(_0x4658f5,null));};exports[_0x8957('0x95')]=function(_0x537298,_0x49fcbc,_0x24979e){var _0xcf80c0={};var _0x99bc8a={};var _0x7c9fe7;var _0x4251e0;return db[_0x8957('0x39')][_0x8957('0x61')]({'where':{'id':_0x537298[_0x8957('0x51')]['id']}})[_0x8957('0x32')](handleEntityNotFound(_0x49fcbc,null))[_0x8957('0x32')](function(_0x4bb36a){if(_0x4bb36a){_0x7c9fe7=_0x4bb36a;_0x99bc8a[_0x8957('0x3e')]=_[_0x8957('0x41')](db[_0x8957('0x65')]['rawAttributes']);_0x99bc8a[_0x8957('0x40')]=_[_0x8957('0x41')](_0x537298['query']);_0x99bc8a[_0x8957('0x42')]=_[_0x8957('0x43')](_0x99bc8a[_0x8957('0x3e')],_0x99bc8a[_0x8957('0x40')]);_0xcf80c0[_0x8957('0x44')]=_[_0x8957('0x43')](_0x99bc8a[_0x8957('0x3e')],qs[_0x8957('0x52')](_0x537298[_0x8957('0x40')][_0x8957('0x52')]));_0xcf80c0[_0x8957('0x44')]=_0xcf80c0[_0x8957('0x44')][_0x8957('0x53')]?_0xcf80c0[_0x8957('0x44')]:_0x99bc8a[_0x8957('0x3e')];_0xcf80c0[_0x8957('0x47')]=qs[_0x8957('0x48')](_0x537298[_0x8957('0x40')][_0x8957('0x48')]);_0xcf80c0[_0x8957('0x49')]=qs[_0x8957('0x42')](_['pick'](_0x537298['query'],_0x99bc8a[_0x8957('0x42')]));if(_0x537298[_0x8957('0x40')][_0x8957('0x4c')]){_0xcf80c0[_0x8957('0x49')]=_['merge'](_0xcf80c0['where'],{'$or':_[_0x8957('0x3f')](_0xcf80c0[_0x8957('0x44')],function(_0x2a9da6){var _0xf06866={};_0xf06866[_0x2a9da6]={'$like':'%'+_0x537298[_0x8957('0x40')]['filter']+'%'};return _0xf06866;})});}_0xcf80c0=_[_0x8957('0x4a')]({},_0xcf80c0,_0x537298[_0x8957('0x4d')]);return _0x7c9fe7[_0x8957('0x95')](_0xcf80c0);}})[_0x8957('0x32')](function(_0x513be4){if(_0x513be4){_0x4251e0=_0x513be4['length'];if(!_0x537298[_0x8957('0x40')]['hasOwnProperty'](_0x8957('0x46'))){_0xcf80c0[_0x8957('0x2e')]=qs[_0x8957('0x2e')](_0x537298['query']['limit']);_0xcf80c0[_0x8957('0x2c')]=qs[_0x8957('0x2c')](_0x537298[_0x8957('0x40')][_0x8957('0x2c')]);}return _0x7c9fe7[_0x8957('0x95')](_0xcf80c0);}})[_0x8957('0x32')](function(_0x2eb43d){if(_0x2eb43d){return _0x2eb43d?{'count':_0x4251e0,'rows':_0x2eb43d}:null;}})['then'](respondWithResult(_0x49fcbc,null))[_0x8957('0x28')](handleError(_0x49fcbc,null));}; \ No newline at end of file +var _0xcda8=['ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','client','http','then','info','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatQueue,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','get','end','name','send','index','map','ChatQueue','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserChatQueue','ChatQueueId','findAll','User','findAndCountAll','agent','updatedAt','format','%s/%s','SIP','chatPause','getTeams','Team','addTeams','Agents','online','flatMap','transaction','findOrCreate','emit','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xcda8,0xae));var _0x8cda=function(_0x44db0b,_0xa3ed2b){_0x44db0b=_0x44db0b-0x0;var _0x41e3c1=_0xcda8[_0x44db0b];return _0x41e3c1;};'use strict';var emlformat=require(_0x8cda('0x0'));var rimraf=require(_0x8cda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8cda('0x2'));var rp=require(_0x8cda('0x3'));var moment=require(_0x8cda('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8cda('0x5'));var util=require(_0x8cda('0x6'));var path=require(_0x8cda('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8cda('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8cda('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8cda('0xa'));var deskjs=require(_0x8cda('0xb'));var toCsv=require(_0x8cda('0xc'));var querystring=require('querystring');var Papa=require(_0x8cda('0xd'));var Redis=require(_0x8cda('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8cda('0xf'));var as=require(_0x8cda('0x10'));var hardwareService=require(_0x8cda('0x11'));var logger=require(_0x8cda('0x12'))(_0x8cda('0x13'));var utils=require(_0x8cda('0x14'));var config=require(_0x8cda('0x15'));var licenseUtil=require(_0x8cda('0x16'));var db=require(_0x8cda('0x17'))['db'];config[_0x8cda('0x18')]=_[_0x8cda('0x19')](config['redis'],{'host':_0x8cda('0x1a'),'port':0x18eb});var socket=require(_0x8cda('0x1b'))(new Redis(config['redis']));require(_0x8cda('0x1c'))[_0x8cda('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8cda('0x1e')][_0x8cda('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3d6774,_0x23cbf2,_0x2de49e,_0x350393){return new BPromise(function(_0x1c69bb,_0x5a79bf){var _0x33a9c0=_0x350393||client;return _0x33a9c0['request'](_0x3d6774,_0x2de49e)[_0x8cda('0x20')](function(_0x4dc95b){logger[_0x8cda('0x21')]('ChatQueue,\x20%s,\x20%s',_0x23cbf2,'request\x20sent');logger['debug'](_0x8cda('0x22'),_0x23cbf2,'request\x20sent',JSON[_0x8cda('0x23')](_0x4dc95b));if(_0x4dc95b[_0x8cda('0x24')]){if(_0x4dc95b['error']['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x23cbf2,_0x4dc95b['error']['message']);return _0x5a79bf(_0x4dc95b['error'][_0x8cda('0x25')]);}logger[_0x8cda('0x24')](_0x8cda('0x26'),_0x23cbf2,_0x4dc95b[_0x8cda('0x24')]['message']);return _0x1c69bb(_0x4dc95b[_0x8cda('0x24')][_0x8cda('0x25')]);}else{logger[_0x8cda('0x21')](_0x8cda('0x26'),_0x23cbf2,'request\x20sent');_0x1c69bb(_0x4dc95b[_0x8cda('0x27')][_0x8cda('0x25')]);}})[_0x8cda('0x28')](function(_0x16c6f4){logger[_0x8cda('0x24')]('ChatQueue,\x20%s,\x20%s',_0x23cbf2,_0x16c6f4);_0x5a79bf(_0x16c6f4);});});}function respondWithStatusCode(_0x317ae5,_0x37a196){_0x37a196=_0x37a196||0xcc;return function(_0x414f6f){if(_0x414f6f){return _0x317ae5[_0x8cda('0x29')](_0x37a196);}return _0x317ae5[_0x8cda('0x2a')](_0x37a196)['end']();};}function respondWithResult(_0x197186,_0x4b7c41){_0x4b7c41=_0x4b7c41||0xc8;return function(_0x4da37d){if(_0x4da37d){return _0x197186[_0x8cda('0x2a')](_0x4b7c41)[_0x8cda('0x2b')](_0x4da37d);}};}function respondWithFilteredResult(_0x370945,_0x38c810){return function(_0x1977f4){if(_0x1977f4){var _0x13bdc0=typeof _0x38c810[_0x8cda('0x2c')]==='undefined'&&typeof _0x38c810[_0x8cda('0x2d')]===_0x8cda('0x2e');var _0x560514=_0x1977f4[_0x8cda('0x2f')];var _0x5dc0b5=_0x13bdc0?0x0:_0x38c810['offset'];var _0x4be0bc=_0x13bdc0?_0x1977f4[_0x8cda('0x2f')]:_0x38c810['offset']+_0x38c810[_0x8cda('0x2d')];var _0x55bd8e;if(_0x4be0bc>=_0x560514){_0x4be0bc=_0x560514;_0x55bd8e=0xc8;}else{_0x55bd8e=0xce;}_0x370945[_0x8cda('0x2a')](_0x55bd8e);return _0x370945[_0x8cda('0x30')](_0x8cda('0x31'),_0x5dc0b5+'-'+_0x4be0bc+'/'+_0x560514)[_0x8cda('0x2b')](_0x1977f4);}return null;};}function patchUpdates(_0x23117d){return function(_0x47de89){try{jsonpatch[_0x8cda('0x32')](_0x47de89,_0x23117d,!![]);}catch(_0x4c45db){return BPromise[_0x8cda('0x33')](_0x4c45db);}return _0x47de89[_0x8cda('0x34')]();};}function saveUpdates(_0x2bf076,_0x34ca95){return function(_0x167de5){if(_0x167de5){return _0x167de5['update'](_0x2bf076)[_0x8cda('0x20')](function(_0x546deb){return _0x546deb;});}return null;};}function removeEntity(_0x39402f,_0xa6ec07){return function(_0x3f1722){if(_0x3f1722){return _0x3f1722[_0x8cda('0x35')]()[_0x8cda('0x20')](function(){var _0x3689a0=_0x3f1722[_0x8cda('0x36')]({'plain':!![]});var _0x11df3e='ChatQueues';return db['UserProfileResource'][_0x8cda('0x35')]({'where':{'type':_0x11df3e,'resourceId':_0x3689a0['id']}})[_0x8cda('0x20')](function(){return _0x3f1722;});})['then'](function(){_0x39402f['status'](0xcc)[_0x8cda('0x37')]();});}};}function handleEntityNotFound(_0x3a383f,_0x5614dc){return function(_0x4af9d3){if(!_0x4af9d3){_0x3a383f['sendStatus'](0x194);}return _0x4af9d3;};}function handleError(_0x77ef49,_0x17e0f9){_0x17e0f9=_0x17e0f9||0x1f4;return function(_0x136ef7){logger['error'](_0x136ef7['stack']);if(_0x136ef7[_0x8cda('0x38')]){delete _0x136ef7[_0x8cda('0x38')];}_0x77ef49[_0x8cda('0x2a')](_0x17e0f9)[_0x8cda('0x39')](_0x136ef7);};}exports[_0x8cda('0x3a')]=function(_0x2ab9bc,_0x5da9cd){var _0x2464f5={},_0x2b7dbe={},_0x12a4a6={'count':0x0,'rows':[]};var _0x28d854=_[_0x8cda('0x3b')](db[_0x8cda('0x3c')][_0x8cda('0x3d')],function(_0x8adf09){return{'name':_0x8adf09['fieldName'],'type':_0x8adf09[_0x8cda('0x3e')][_0x8cda('0x3f')]};});_0x2b7dbe[_0x8cda('0x40')]=_[_0x8cda('0x3b')](_0x28d854,_0x8cda('0x38'));_0x2b7dbe['query']=_[_0x8cda('0x41')](_0x2ab9bc[_0x8cda('0x42')]);_0x2b7dbe[_0x8cda('0x43')]=_[_0x8cda('0x44')](_0x2b7dbe['model'],_0x2b7dbe['query']);_0x2464f5['attributes']=_['intersection'](_0x2b7dbe[_0x8cda('0x40')],qs[_0x8cda('0x45')](_0x2ab9bc[_0x8cda('0x42')][_0x8cda('0x45')]));_0x2464f5['attributes']=_0x2464f5['attributes']['length']?_0x2464f5[_0x8cda('0x46')]:_0x2b7dbe[_0x8cda('0x40')];if(!_0x2ab9bc[_0x8cda('0x42')][_0x8cda('0x47')](_0x8cda('0x48'))){_0x2464f5[_0x8cda('0x2d')]=qs[_0x8cda('0x2d')](_0x2ab9bc[_0x8cda('0x42')][_0x8cda('0x2d')]);_0x2464f5['offset']=qs['offset'](_0x2ab9bc['query'][_0x8cda('0x2c')]);}_0x2464f5[_0x8cda('0x49')]=qs[_0x8cda('0x4a')](_0x2ab9bc[_0x8cda('0x42')][_0x8cda('0x4a')]);_0x2464f5[_0x8cda('0x4b')]=qs[_0x8cda('0x43')](_[_0x8cda('0x4c')](_0x2ab9bc[_0x8cda('0x42')],_0x2b7dbe['filters']),_0x28d854);if(_0x2ab9bc['query'][_0x8cda('0x4d')]){_0x2464f5[_0x8cda('0x4b')]=_[_0x8cda('0x4e')](_0x2464f5['where'],{'$or':_[_0x8cda('0x3b')](_0x28d854,function(_0x27287e){if(_0x27287e[_0x8cda('0x3e')]!==_0x8cda('0x4f')){var _0x323e33={};_0x323e33[_0x27287e[_0x8cda('0x38')]]={'$like':'%'+_0x2ab9bc[_0x8cda('0x42')][_0x8cda('0x4d')]+'%'};return _0x323e33;}})});}_0x2464f5=_['merge']({},_0x2464f5,_0x2ab9bc['options']);var _0x317d18={'where':_0x2464f5[_0x8cda('0x4b')]};return db[_0x8cda('0x3c')][_0x8cda('0x2f')](_0x317d18)['then'](function(_0x3441d9){_0x12a4a6[_0x8cda('0x2f')]=_0x3441d9;if(_0x2ab9bc[_0x8cda('0x42')][_0x8cda('0x50')]){_0x2464f5[_0x8cda('0x51')]=[{'all':!![]}];}return db[_0x8cda('0x3c')]['findAll'](_0x2464f5);})[_0x8cda('0x20')](function(_0x2759a2){_0x12a4a6[_0x8cda('0x52')]=_0x2759a2;return _0x12a4a6;})['then'](respondWithFilteredResult(_0x5da9cd,_0x2464f5))[_0x8cda('0x28')](handleError(_0x5da9cd,null));};exports[_0x8cda('0x53')]=function(_0x3e20f6,_0x30cbad){var _0x21c676={'raw':!![],'where':{'id':_0x3e20f6[_0x8cda('0x54')]['id']}},_0x15ce5b={};_0x15ce5b[_0x8cda('0x40')]=_[_0x8cda('0x41')](db[_0x8cda('0x3c')][_0x8cda('0x3d')]);_0x15ce5b[_0x8cda('0x42')]=_[_0x8cda('0x41')](_0x3e20f6['query']);_0x15ce5b['filters']=_[_0x8cda('0x44')](_0x15ce5b[_0x8cda('0x40')],_0x15ce5b[_0x8cda('0x42')]);_0x21c676['attributes']=_[_0x8cda('0x44')](_0x15ce5b[_0x8cda('0x40')],qs[_0x8cda('0x45')](_0x3e20f6[_0x8cda('0x42')][_0x8cda('0x45')]));_0x21c676[_0x8cda('0x46')]=_0x21c676['attributes'][_0x8cda('0x55')]?_0x21c676['attributes']:_0x15ce5b['model'];if(_0x3e20f6[_0x8cda('0x42')][_0x8cda('0x50')]){_0x21c676['include']=[{'all':!![]}];}_0x21c676=_['merge']({},_0x21c676,_0x3e20f6[_0x8cda('0x56')]);return db[_0x8cda('0x3c')]['find'](_0x21c676)[_0x8cda('0x20')](handleEntityNotFound(_0x30cbad,null))[_0x8cda('0x20')](respondWithResult(_0x30cbad,null))[_0x8cda('0x28')](handleError(_0x30cbad,null));};exports[_0x8cda('0x57')]=function(_0x3d623c,_0x583b1e){return db[_0x8cda('0x3c')]['create'](_0x3d623c[_0x8cda('0x58')],{})[_0x8cda('0x20')](function(_0x4d110e){var _0x437613=_0x3d623c[_0x8cda('0x59')][_0x8cda('0x36')]({'plain':!![]});if(!_0x437613)throw new Error(_0x8cda('0x5a'));if(_0x437613[_0x8cda('0x5b')]===_0x8cda('0x59')){var _0x431598=_0x4d110e[_0x8cda('0x36')]({'plain':!![]});var _0x5f29af='ChatQueues';return db['UserProfileSection'][_0x8cda('0x5c')]({'where':{'name':_0x5f29af,'userProfileId':_0x437613['userProfileId']},'raw':!![]})[_0x8cda('0x20')](function(_0x5c97cd){if(_0x5c97cd&&_0x5c97cd[_0x8cda('0x5d')]===0x0){return db[_0x8cda('0x5e')][_0x8cda('0x57')]({'name':_0x431598['name'],'resourceId':_0x431598['id'],'type':_0x5c97cd[_0x8cda('0x38')],'sectionId':_0x5c97cd['id']},{})['then'](function(){return _0x4d110e;});}else{return _0x4d110e;}})['catch'](function(_0x270054){logger[_0x8cda('0x24')](_0x8cda('0x5f'),_0x270054);throw _0x270054;});}return _0x4d110e;})[_0x8cda('0x20')](respondWithResult(_0x583b1e,0xc9))[_0x8cda('0x28')](handleError(_0x583b1e,null));};exports[_0x8cda('0x60')]=function(_0x859e1e,_0x10bdd8){if(_0x859e1e[_0x8cda('0x58')]['id']){delete _0x859e1e[_0x8cda('0x58')]['id'];}return db[_0x8cda('0x3c')][_0x8cda('0x5c')]({'where':{'id':_0x859e1e[_0x8cda('0x54')]['id']}})['then'](handleEntityNotFound(_0x10bdd8,null))[_0x8cda('0x20')](saveUpdates(_0x859e1e[_0x8cda('0x58')],null))[_0x8cda('0x20')](respondWithResult(_0x10bdd8,null))['catch'](handleError(_0x10bdd8,null));};exports[_0x8cda('0x35')]=function(_0x526987,_0x4839a0){return db[_0x8cda('0x3c')]['find']({'where':{'id':_0x526987[_0x8cda('0x54')]['id']}})[_0x8cda('0x20')](handleEntityNotFound(_0x4839a0,null))[_0x8cda('0x20')](removeEntity(_0x4839a0,null))['catch'](handleError(_0x4839a0,null));};exports[_0x8cda('0x61')]=function(_0x32adef,_0x50c686){return db[_0x8cda('0x3c')][_0x8cda('0x61')]()['then'](respondWithResult(_0x50c686,null))[_0x8cda('0x28')](handleError(_0x50c686,null));};exports['getMembers']=function(_0x4a86e7,_0x5bbf4c,_0x2471a0){var _0x152d02={'raw':!![],'where':{}},_0x1986b2={},_0x5d3f96;return db['ChatQueue'][_0x8cda('0x62')]({'where':{'id':_0x4a86e7[_0x8cda('0x54')]['id']}})[_0x8cda('0x20')](handleEntityNotFound(_0x5bbf4c,null))[_0x8cda('0x20')](function(_0x5a00f8){if(_0x5a00f8){_0x5d3f96=_0x5a00f8[_0x8cda('0x36')]({'plain':!![]});_0x1986b2[_0x8cda('0x40')]=_['keys'](db[_0x8cda('0x63')][_0x8cda('0x3d')]);_0x1986b2[_0x8cda('0x42')]=_[_0x8cda('0x41')](_0x4a86e7[_0x8cda('0x42')]);_0x1986b2[_0x8cda('0x43')]=_['intersection'](_0x1986b2[_0x8cda('0x40')],_0x1986b2[_0x8cda('0x42')]);_0x152d02[_0x8cda('0x46')]=_[_0x8cda('0x44')](_0x1986b2['model'],qs['fields'](_0x4a86e7[_0x8cda('0x42')][_0x8cda('0x45')]));_0x152d02[_0x8cda('0x46')]=_0x152d02[_0x8cda('0x46')][_0x8cda('0x55')]?_0x152d02[_0x8cda('0x46')]:_0x1986b2[_0x8cda('0x40')];if(!_0x4a86e7[_0x8cda('0x42')]['hasOwnProperty'](_0x8cda('0x48'))){_0x152d02[_0x8cda('0x2d')]=qs[_0x8cda('0x2d')](_0x4a86e7[_0x8cda('0x42')][_0x8cda('0x2d')]);_0x152d02[_0x8cda('0x2c')]=qs[_0x8cda('0x2c')](_0x4a86e7['query']['offset']);}_0x152d02['order']=qs['sort'](_0x4a86e7['query']['sort']);_0x152d02[_0x8cda('0x4b')]=qs['filters'](_[_0x8cda('0x4c')](_0x4a86e7[_0x8cda('0x42')],_0x1986b2['filters']));_0x152d02[_0x8cda('0x4b')][_0x8cda('0x64')]=_0x5a00f8['id'];if(_0x4a86e7[_0x8cda('0x42')][_0x8cda('0x4d')]){_0x152d02[_0x8cda('0x4b')]=_['merge'](_0x152d02[_0x8cda('0x4b')],{'$or':_['map'](_0x152d02['attributes'],function(_0x4e8fba){var _0x20590e={};_0x20590e[_0x4e8fba]={'$like':'%'+_0x4a86e7[_0x8cda('0x42')][_0x8cda('0x4d')]+'%'};return _0x20590e;})});}_0x152d02=_['merge']({},_0x152d02,_0x4a86e7[_0x8cda('0x56')]);return db[_0x8cda('0x63')][_0x8cda('0x65')](_0x152d02);}})[_0x8cda('0x20')](function(_0x57130f){if(_0x57130f){return db[_0x8cda('0x66')][_0x8cda('0x67')]({'where':{'id':_[_0x8cda('0x3b')](_0x57130f,'UserId'),'role':_0x8cda('0x68')},'attributes':['id',_0x8cda('0x38'),'chatPause',_0x8cda('0x69'),'createdAt']});}})[_0x8cda('0x20')](function(_0x35536d){if(_0x35536d){return{'count':_0x35536d[_0x8cda('0x2f')],'rows':_[_0x8cda('0x3b')](_0x35536d[_0x8cda('0x52')],function(_0x3f1c28){return{'membername':_0x3f1c28['name'],'UserId':_0x3f1c28['id'],'queue_name':_0x5d3f96[_0x8cda('0x38')],'ChatQueueId':_0x5d3f96['id'],'interface':util[_0x8cda('0x6a')](_0x8cda('0x6b'),_0x8cda('0x6c'),_0x3f1c28['name']),'penalty':0x0,'paused':_0x3f1c28[_0x8cda('0x6d')],'createdAt':_0x3f1c28['createdAt'],'updatedAt':_0x3f1c28['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8cda('0x20')](respondWithFilteredResult(_0x5bbf4c,_0x152d02))[_0x8cda('0x28')](handleError(_0x5bbf4c,null));};exports[_0x8cda('0x6e')]=function(_0x56cc53,_0x18d251,_0x174d67){var _0x524284={};var _0x5ca26b={};var _0x4c5726;var _0x2d6f40;return db[_0x8cda('0x3c')][_0x8cda('0x62')]({'where':{'id':_0x56cc53['params']['id']}})['then'](handleEntityNotFound(_0x18d251,null))['then'](function(_0x23d4b2){if(_0x23d4b2){_0x4c5726=_0x23d4b2;_0x5ca26b[_0x8cda('0x40')]=_['keys'](db[_0x8cda('0x6f')][_0x8cda('0x3d')]);_0x5ca26b['query']=_['keys'](_0x56cc53[_0x8cda('0x42')]);_0x5ca26b[_0x8cda('0x43')]=_[_0x8cda('0x44')](_0x5ca26b[_0x8cda('0x40')],_0x5ca26b[_0x8cda('0x42')]);_0x524284[_0x8cda('0x46')]=_[_0x8cda('0x44')](_0x5ca26b[_0x8cda('0x40')],qs['fields'](_0x56cc53[_0x8cda('0x42')]['fields']));_0x524284[_0x8cda('0x46')]=_0x524284[_0x8cda('0x46')][_0x8cda('0x55')]?_0x524284[_0x8cda('0x46')]:_0x5ca26b[_0x8cda('0x40')];_0x524284[_0x8cda('0x49')]=qs[_0x8cda('0x4a')](_0x56cc53[_0x8cda('0x42')][_0x8cda('0x4a')]);_0x524284['where']=qs['filters'](_[_0x8cda('0x4c')](_0x56cc53[_0x8cda('0x42')],_0x5ca26b[_0x8cda('0x43')]));if(_0x56cc53[_0x8cda('0x42')][_0x8cda('0x4d')]){_0x524284[_0x8cda('0x4b')]=_[_0x8cda('0x4e')](_0x524284[_0x8cda('0x4b')],{'$or':_['map'](_0x524284[_0x8cda('0x46')],function(_0x33dfd1){var _0x5c21b0={};_0x5c21b0[_0x33dfd1]={'$like':'%'+_0x56cc53[_0x8cda('0x42')][_0x8cda('0x4d')]+'%'};return _0x5c21b0;})});}_0x524284=_['merge']({},_0x524284,_0x56cc53['options']);return _0x4c5726[_0x8cda('0x6e')](_0x524284);}})['then'](function(_0x12a87b){if(_0x12a87b){_0x2d6f40=_0x12a87b[_0x8cda('0x55')];if(!_0x56cc53[_0x8cda('0x42')]['hasOwnProperty'](_0x8cda('0x48'))){_0x524284['limit']=qs[_0x8cda('0x2d')](_0x56cc53[_0x8cda('0x42')]['limit']);_0x524284[_0x8cda('0x2c')]=qs['offset'](_0x56cc53['query'][_0x8cda('0x2c')]);}return _0x4c5726[_0x8cda('0x6e')](_0x524284);}})['then'](function(_0x4eecb7){if(_0x4eecb7){return _0x4eecb7?{'count':_0x2d6f40,'rows':_0x4eecb7}:null;}})[_0x8cda('0x20')](respondWithResult(_0x18d251,null))[_0x8cda('0x28')](handleError(_0x18d251,null));};exports[_0x8cda('0x70')]=function(_0x1f4c0a,_0x20a183,_0x1b6b62){var _0x4c07cb=_0x1f4c0a[_0x8cda('0x58')]['ids'];return db[_0x8cda('0x6f')][_0x8cda('0x65')]({'where':{'id':_0x4c07cb},'attributes':['id'],'include':[{'model':db[_0x8cda('0x66')],'as':_0x8cda('0x71'),'attributes':['id',_0x8cda('0x38'),_0x8cda('0x72'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x4e09fb){if(_0x4e09fb){var _0x503922=_[_0x8cda('0x73')](_0x4e09fb,function(_0x4c3c83){var _0x242933=_0x4c3c83[_0x8cda('0x36')]({'plain':!![]});return _0x242933[_0x8cda('0x71')];});return db[_0x8cda('0x3c')]['find']({'where':{'id':_0x1f4c0a[_0x8cda('0x54')]['id']}})[_0x8cda('0x20')](function(_0x42403c){return db['sequelize'][_0x8cda('0x74')](function(_0x51c87b){return _0x42403c[_0x8cda('0x70')](_0x4c07cb,{'transaction':_0x51c87b})[_0x8cda('0x20')](function(){return BPromise['each'](_0x503922,function(_0xe9aef){return db[_0x8cda('0x63')][_0x8cda('0x75')]({'where':{'UserId':_0xe9aef['id'],'ChatQueueId':_0x1f4c0a[_0x8cda('0x54')]['id']},'transaction':_0x51c87b});});})[_0x8cda('0x20')](function(){_0x503922['forEach'](function(_0x108553){socket[_0x8cda('0x76')](_0x8cda('0x77'),{'UserId':_0x108553['id'],'ChatQueueId':_0x42403c['id']});});});});});}})['then'](respondWithStatusCode(_0x20a183,null))[_0x8cda('0x28')](handleError(_0x20a183,null));};exports[_0x8cda('0x78')]=function(_0x235bd1,_0x586f64,_0x2147fd){return db['Team']['findAll']({'where':{'id':_0x235bd1[_0x8cda('0x42')][_0x8cda('0x79')]},'attributes':['id'],'include':[{'model':db[_0x8cda('0x66')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8cda('0x20')](handleEntityNotFound(_0x586f64,null))['then'](function(_0x45c3d7){var _0x3caab0=_[_0x8cda('0x3b')](_0x45c3d7,'id');var _0x5cbe9a=[];var _0x12d5bd=[];var _0x57b0ba=squel[_0x8cda('0x7a')]();_0x57b0ba[_0x8cda('0x7b')](_0x8cda('0x7c'))[_0x8cda('0x7d')](_0x8cda('0x7e'),'tq')[_0x8cda('0x7f')](_0x8cda('0x80'),'ut',_0x8cda('0x81'))[_0x8cda('0x4b')](_0x8cda('0x82'),_0x235bd1[_0x8cda('0x54')]['id']);for(var _0x235fb7=0x0;_0x235fb7<_0x45c3d7[_0x8cda('0x55')];_0x235fb7+=0x1){let _0x2d581c=_0x45c3d7[_0x235fb7];for(var _0xd46336=0x0;_0xd46336<_0x2d581c['Agents'][_0x8cda('0x55')];_0xd46336+=0x1){let _0x39cdcd=_0x2d581c[_0x8cda('0x71')][_0xd46336];var _0x444b76=_0x57b0ba[_0x8cda('0x83')]();_0x444b76[_0x8cda('0x4b')](_0x8cda('0x84'),_0x39cdcd['id']);_0x12d5bd[_0x8cda('0x85')](db[_0x8cda('0x86')]['query'](_0x444b76[_0x8cda('0x87')](),{'type':db['sequelize'][_0x8cda('0x88')][_0x8cda('0x89')]})['then'](function(_0x3f1249){if(_0x3f1249['length']===0x1){return _0x39cdcd['id'];}else{var _0x508ef2=_[_0x8cda('0x8a')](_[_0x8cda('0x3b')](_0x3f1249,_0x8cda('0x8b')),function(_0x44dd2d){return _['includes'](_0x3caab0,_0x44dd2d);});if(_0x508ef2){return _0x39cdcd['id'];}}}));}}return BPromise[_0x8cda('0x8c')](_0x12d5bd)[_0x8cda('0x20')](function(_0x38d1cc){_0x5cbe9a=_(_0x5cbe9a)[_0x8cda('0x8d')](_0x38d1cc)[_0x8cda('0x8e')]()[_0x8cda('0x8f')]();return db[_0x8cda('0x3c')][_0x8cda('0x5c')]({'where':{'id':_0x235bd1[_0x8cda('0x54')]['id']}})[_0x8cda('0x20')](function(_0x3c38da){return db[_0x8cda('0x86')][_0x8cda('0x74')](function(_0x15489a){return _0x3c38da[_0x8cda('0x78')](_0x235bd1[_0x8cda('0x42')][_0x8cda('0x79')],{'transaction':_0x15489a})['then'](function(){if(!_[_0x8cda('0x90')](_0x5cbe9a)){return _0x3c38da[_0x8cda('0x91')](_0x5cbe9a,{'transaction':_0x15489a});}})[_0x8cda('0x20')](function(){_0x5cbe9a[_0x8cda('0x92')](function(_0x313dd5){socket['emit'](_0x8cda('0x93'),{'UserId':_0x313dd5,'ChatQueueId':_0x3c38da['id']});});});});});});})[_0x8cda('0x20')](respondWithStatusCode(_0x586f64,null))[_0x8cda('0x28')](handleError(_0x586f64,null));};exports[_0x8cda('0x94')]=function(_0x7dcb63,_0x5c996b,_0x1ec324){return db[_0x8cda('0x3c')][_0x8cda('0x5c')]({'where':{'id':_0x7dcb63[_0x8cda('0x54')]['id']}})[_0x8cda('0x20')](handleEntityNotFound(_0x5c996b,null))[_0x8cda('0x20')](function(_0x248fd7){if(_0x248fd7){return _0x248fd7[_0x8cda('0x94')](_0x7dcb63['body'][_0x8cda('0x79')],_[_0x8cda('0x95')](_0x7dcb63[_0x8cda('0x58')],[_0x8cda('0x79'),'id'])||{})[_0x8cda('0x96')](function(_0x3c14bd){for(var _0x325b9d=0x0;_0x325b9d<_0x7dcb63['body'][_0x8cda('0x79')][_0x8cda('0x55')];_0x325b9d+=0x1){socket[_0x8cda('0x76')]('userChatQueue:save',{'UserId':Number(_0x7dcb63[_0x8cda('0x58')][_0x8cda('0x79')][_0x325b9d]),'ChatQueueId':Number(_0x7dcb63[_0x8cda('0x54')]['id'])});}return _0x3c14bd;});}})['then'](respondWithResult(_0x5c996b,null))[_0x8cda('0x28')](handleError(_0x5c996b,null));};exports[_0x8cda('0x91')]=function(_0x5dc255,_0x3476b8,_0x4b52f4){return db['ChatQueue']['find']({'where':{'id':_0x5dc255['params']['id']}})[_0x8cda('0x20')](handleEntityNotFound(_0x3476b8,null))['then'](function(_0x281422){if(_0x281422){return _0x281422[_0x8cda('0x91')](_0x5dc255[_0x8cda('0x42')][_0x8cda('0x79')])[_0x8cda('0x20')](function(){if(_[_0x8cda('0x97')](_0x5dc255[_0x8cda('0x42')]['ids'])){for(var _0x2e80ce=0x0;_0x2e80ce<_0x5dc255[_0x8cda('0x42')][_0x8cda('0x79')][_0x8cda('0x55')];_0x2e80ce+=0x1){socket[_0x8cda('0x76')](_0x8cda('0x93'),{'UserId':Number(_0x5dc255[_0x8cda('0x42')][_0x8cda('0x79')][_0x2e80ce]),'ChatQueueId':Number(_0x5dc255[_0x8cda('0x54')]['id'])});}}else{socket[_0x8cda('0x76')]('userChatQueue:remove',{'UserId':Number(_0x5dc255[_0x8cda('0x42')]['ids']),'ChatQueueId':Number(_0x5dc255[_0x8cda('0x54')]['id'])});}});}})[_0x8cda('0x20')](respondWithStatusCode(_0x3476b8,null))[_0x8cda('0x28')](handleError(_0x3476b8,null));};exports[_0x8cda('0x98')]=function(_0x276352,_0x458192,_0x507977){var _0x5e886a={};var _0x5e92b5={};var _0x138cf6;var _0x263684;return db[_0x8cda('0x3c')][_0x8cda('0x62')]({'where':{'id':_0x276352[_0x8cda('0x54')]['id']}})['then'](handleEntityNotFound(_0x458192,null))[_0x8cda('0x20')](function(_0x455926){if(_0x455926){_0x138cf6=_0x455926;_0x5e92b5[_0x8cda('0x40')]=_[_0x8cda('0x41')](db[_0x8cda('0x66')]['rawAttributes']);_0x5e92b5['query']=_[_0x8cda('0x41')](_0x276352[_0x8cda('0x42')]);_0x5e92b5['filters']=_[_0x8cda('0x44')](_0x5e92b5[_0x8cda('0x40')],_0x5e92b5[_0x8cda('0x42')]);_0x5e886a[_0x8cda('0x46')]=_[_0x8cda('0x44')](_0x5e92b5[_0x8cda('0x40')],qs['fields'](_0x276352[_0x8cda('0x42')]['fields']));_0x5e886a[_0x8cda('0x46')]=_0x5e886a[_0x8cda('0x46')][_0x8cda('0x55')]?_0x5e886a[_0x8cda('0x46')]:_0x5e92b5[_0x8cda('0x40')];_0x5e886a[_0x8cda('0x49')]=qs[_0x8cda('0x4a')](_0x276352[_0x8cda('0x42')][_0x8cda('0x4a')]);_0x5e886a['where']=qs[_0x8cda('0x43')](_[_0x8cda('0x4c')](_0x276352[_0x8cda('0x42')],_0x5e92b5['filters']));if(_0x276352[_0x8cda('0x42')]['filter']){_0x5e886a[_0x8cda('0x4b')]=_[_0x8cda('0x4e')](_0x5e886a[_0x8cda('0x4b')],{'$or':_[_0x8cda('0x3b')](_0x5e886a['attributes'],function(_0x30bc88){var _0x1b65a7={};_0x1b65a7[_0x30bc88]={'$like':'%'+_0x276352[_0x8cda('0x42')]['filter']+'%'};return _0x1b65a7;})});}_0x5e886a=_[_0x8cda('0x4e')]({},_0x5e886a,_0x276352['options']);return _0x138cf6[_0x8cda('0x98')](_0x5e886a);}})['then'](function(_0x97d7c6){if(_0x97d7c6){_0x263684=_0x97d7c6['length'];if(!_0x276352[_0x8cda('0x42')][_0x8cda('0x47')](_0x8cda('0x48'))){_0x5e886a[_0x8cda('0x2d')]=qs[_0x8cda('0x2d')](_0x276352[_0x8cda('0x42')][_0x8cda('0x2d')]);_0x5e886a[_0x8cda('0x2c')]=qs[_0x8cda('0x2c')](_0x276352[_0x8cda('0x42')][_0x8cda('0x2c')]);}return _0x138cf6['getAgents'](_0x5e886a);}})[_0x8cda('0x20')](function(_0x3dd673){if(_0x3dd673){return _0x3dd673?{'count':_0x263684,'rows':_0x3dd673}:null;}})[_0x8cda('0x20')](respondWithResult(_0x458192,null))[_0x8cda('0x28')](handleError(_0x458192,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 876b194..ba5ffe2 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 _0x79c6=['hook','events','ChatQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0xaedb4b,_0x21f783){var _0xcea7e=function(_0x25f015){while(--_0x25f015){_0xaedb4b['push'](_0xaedb4b['shift']());}};_0xcea7e(++_0x21f783);}(_0x79c6,0x81));var _0x679c=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x79c6[_0x176329];return _0x31997c;};'use strict';var EventEmitter=require(_0x679c('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x679c('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x679c('0x2')](0x0);var events={'afterCreate':_0x679c('0x3'),'afterUpdate':_0x679c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x56d9bf){return function(_0x596e9c,_0x3e24f6,_0x1b87a5){ChatQueueEvents[_0x679c('0x5')](_0x56d9bf+':'+_0x596e9c['id'],_0x596e9c);ChatQueueEvents[_0x679c('0x5')](_0x56d9bf,_0x596e9c);_0x1b87a5(null);};}for(var e in events){if(events[_0x679c('0x6')](e)){var event=events[e];ChatQueue[_0x679c('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0xdb78=['setMaxListeners','update','remove','emit','exports','events','../../mysqldb','ChatQueue'];(function(_0x2614bc,_0x4ef1ec){var _0x5a1655=function(_0x6bfabc){while(--_0x6bfabc){_0x2614bc['push'](_0x2614bc['shift']());}};_0x5a1655(++_0x4ef1ec);}(_0xdb78,0x1ed));var _0x8db7=function(_0x2bfbf1,_0x24600e){_0x2bfbf1=_0x2bfbf1-0x0;var _0x3d8538=_0xdb78[_0x2bfbf1];return _0x3d8538;};'use strict';var EventEmitter=require(_0x8db7('0x0'));var ChatQueue=require(_0x8db7('0x1'))['db'][_0x8db7('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8db7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db7('0x4'),'afterDestroy':_0x8db7('0x5')};function emitEvent(_0x22cb52){return function(_0x1eedb4,_0x81742d,_0x5b75da){ChatQueueEvents[_0x8db7('0x6')](_0x22cb52+':'+_0x1eedb4['id'],_0x1eedb4);ChatQueueEvents[_0x8db7('0x6')](_0x22cb52,_0x1eedb4);_0x5b75da(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x8db7('0x7')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 278df53..4fae10b 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 _0x65f4=['../../config/logger','moment','request-promise','../../config/environment','./chatQueue.attributes','define','chat_queues','lodash','util'];(function(_0x3c7d53,_0x2826d0){var _0x2c8387=function(_0x21f0e8){while(--_0x21f0e8){_0x3c7d53['push'](_0x3c7d53['shift']());}};_0x2c8387(++_0x2826d0);}(_0x65f4,0x166));var _0x465f=function(_0x192c75,_0x1b53a1){_0x192c75=_0x192c75-0x0;var _0x28647a=_0x65f4[_0x192c75];return _0x28647a;};'use strict';var _=require(_0x465f('0x0'));var util=require(_0x465f('0x1'));var logger=require(_0x465f('0x2'))('api');var moment=require(_0x465f('0x3'));var BPromise=require('bluebird');var rp=require(_0x465f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x465f('0x5'));var attributes=require(_0x465f('0x6'));module['exports']=function(_0xe552ad,_0x3d1f75){return _0xe552ad[_0x465f('0x7')]('ChatQueue',attributes,{'tableName':_0x465f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x461b=['api','moment','path','rimraf','../../config/environment','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger'];(function(_0x92171f,_0x4d4647){var _0x1331af=function(_0x413fea){while(--_0x413fea){_0x92171f['push'](_0x92171f['shift']());}};_0x1331af(++_0x4d4647);}(_0x461b,0x189));var _0xb461=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x461b[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xb461('0x0'));var util=require(_0xb461('0x1'));var logger=require(_0xb461('0x2'))(_0xb461('0x3'));var moment=require(_0xb461('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb461('0x5'));var rimraf=require(_0xb461('0x6'));var config=require(_0xb461('0x7'));var attributes=require('./chatQueue.attributes');module[_0xb461('0x8')]=function(_0x44871,_0x4f321f){return _0x44871[_0xb461('0x9')](_0xb461('0xa'),attributes,{'tableName':_0xb461('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 7b04b55..c1487ac 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 _0xffe1=['client','http','redis','defaults','localhost','register','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','where','include','model','attributes','map','debug','ShowChatQueue','find','raw','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1cb4dd,_0x14f8f8){var _0x2a11ce=function(_0x523005){while(--_0x523005){_0x1cb4dd['push'](_0x1cb4dd['shift']());}};_0x2a11ce(++_0x14f8f8);}(_0xffe1,0x187));var _0x1ffe=function(_0x293a23,_0x4f5e44){_0x293a23=_0x293a23-0x0;var _0xd8ec7e=_0xffe1[_0x293a23];return _0xd8ec7e;};'use strict';var _=require(_0x1ffe('0x0'));var util=require(_0x1ffe('0x1'));var moment=require('moment');var BPromise=require(_0x1ffe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ffe('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1ffe('0x4'));var logger=require(_0x1ffe('0x5'))(_0x1ffe('0x6'));var config=require(_0x1ffe('0x7'));var jayson=require(_0x1ffe('0x8'));var client=jayson[_0x1ffe('0x9')][_0x1ffe('0xa')]({'port':0x232a});config[_0x1ffe('0xb')]=_[_0x1ffe('0xc')](config['redis'],{'host':_0x1ffe('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1ffe('0xb')]));require('./chatQueue.socket')[_0x1ffe('0xe')](socket);function respondWithRpcPromise(_0x5b21eb,_0x3acf97,_0x1fc0b9){return new BPromise(function(_0x51be1e,_0x45bfb9){return client[_0x1ffe('0xf')](_0x5b21eb,_0x1fc0b9)[_0x1ffe('0x10')](function(_0x2aa80b){logger[_0x1ffe('0x11')](_0x1ffe('0x12'),_0x3acf97,'request\x20sent');logger['debug'](_0x1ffe('0x13'),_0x3acf97,_0x1ffe('0x14'),JSON[_0x1ffe('0x15')](_0x2aa80b));if(_0x2aa80b[_0x1ffe('0x16')]){if(_0x2aa80b[_0x1ffe('0x16')][_0x1ffe('0x17')]===0x1f4){logger[_0x1ffe('0x16')]('ChatQueue,\x20%s,\x20%s',_0x3acf97,_0x2aa80b[_0x1ffe('0x16')][_0x1ffe('0x18')]);return _0x45bfb9(_0x2aa80b[_0x1ffe('0x16')][_0x1ffe('0x18')]);}logger[_0x1ffe('0x16')](_0x1ffe('0x12'),_0x3acf97,_0x2aa80b[_0x1ffe('0x16')]['message']);return _0x51be1e(_0x2aa80b['error']['message']);}else{logger[_0x1ffe('0x11')]('ChatQueue,\x20%s,\x20%s',_0x3acf97,_0x1ffe('0x14'));_0x51be1e(_0x2aa80b[_0x1ffe('0x19')][_0x1ffe('0x18')]);}})[_0x1ffe('0x1a')](function(_0x1cc248){logger['error'](_0x1ffe('0x12'),_0x3acf97,_0x1cc248);_0x45bfb9(_0x1cc248);});});}exports[_0x1ffe('0x1b')]=function(_0x473018){var _0x3f6ff4=this;return new Promise(function(_0x237695,_0x280598){return db[_0x1ffe('0x1c')][_0x1ffe('0x1d')]({'raw':_0x473018[_0x1ffe('0x1e')]?_0x473018['options']['raw']===undefined?!![]:![]:!![],'where':_0x473018[_0x1ffe('0x1e')]?_0x473018[_0x1ffe('0x1e')][_0x1ffe('0x1f')]||null:null,'attributes':_0x473018[_0x1ffe('0x1e')]?_0x473018['options']['attributes']||null:null,'limit':_0x473018[_0x1ffe('0x1e')]?_0x473018['options']['limit']||null:null,'include':_0x473018[_0x1ffe('0x1e')]?_0x473018[_0x1ffe('0x1e')]['include']?_['map'](_0x473018['options'][_0x1ffe('0x20')],function(_0x145259){return{'model':db[_0x145259[_0x1ffe('0x21')]],'as':_0x145259['as'],'attributes':_0x145259[_0x1ffe('0x22')],'include':_0x145259['include']?_[_0x1ffe('0x23')](_0x145259['include'],function(_0x266304){return{'model':db[_0x266304['model']],'as':_0x266304['as'],'attributes':_0x266304[_0x1ffe('0x22')],'include':_0x266304[_0x1ffe('0x20')]?_[_0x1ffe('0x23')](_0x266304[_0x1ffe('0x20')],function(_0x56bee3){return{'model':db[_0x56bee3[_0x1ffe('0x21')]],'as':_0x56bee3['as'],'attributes':_0x56bee3[_0x1ffe('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1ffe('0x10')](function(_0x14a0bb){logger[_0x1ffe('0x11')](_0x1ffe('0x1b'),_0x473018);logger[_0x1ffe('0x24')](_0x1ffe('0x1b'),_0x473018,JSON[_0x1ffe('0x15')](_0x14a0bb));_0x237695(_0x14a0bb);})[_0x1ffe('0x1a')](function(_0x1e697f){logger[_0x1ffe('0x16')]('GetChatQueue',_0x1e697f[_0x1ffe('0x18')],_0x473018);_0x280598(_0x3f6ff4[_0x1ffe('0x16')](0x1f4,_0x1e697f[_0x1ffe('0x18')]));});});};exports[_0x1ffe('0x25')]=function(_0x9d6faa){var _0x2dccb1=this;return new Promise(function(_0xf5417e,_0x200669){return db[_0x1ffe('0x1c')][_0x1ffe('0x26')]({'raw':_0x9d6faa[_0x1ffe('0x1e')]?_0x9d6faa[_0x1ffe('0x1e')][_0x1ffe('0x27')]===undefined?!![]:![]:!![],'where':_0x9d6faa[_0x1ffe('0x1e')]?_0x9d6faa[_0x1ffe('0x1e')]['where']||null:null,'attributes':_0x9d6faa[_0x1ffe('0x1e')]?_0x9d6faa[_0x1ffe('0x1e')]['attributes']||null:null,'include':_0x9d6faa['options']?_0x9d6faa['options'][_0x1ffe('0x20')]?_[_0x1ffe('0x23')](_0x9d6faa[_0x1ffe('0x1e')]['include'],function(_0x35bfd2){return{'model':db[_0x35bfd2[_0x1ffe('0x21')]],'as':_0x35bfd2['as'],'attributes':_0x35bfd2[_0x1ffe('0x22')],'include':_0x35bfd2[_0x1ffe('0x20')]?_[_0x1ffe('0x23')](_0x35bfd2[_0x1ffe('0x20')],function(_0x3c6723){return{'model':db[_0x3c6723[_0x1ffe('0x21')]],'as':_0x3c6723['as'],'attributes':_0x3c6723['attributes'],'include':_0x3c6723[_0x1ffe('0x20')]?_[_0x1ffe('0x23')](_0x3c6723['include'],function(_0x232db2){return{'model':db[_0x232db2[_0x1ffe('0x21')]],'as':_0x232db2['as'],'attributes':_0x232db2[_0x1ffe('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1ffe('0x10')](function(_0x254255){logger['info'](_0x1ffe('0x25'),_0x9d6faa);logger[_0x1ffe('0x24')](_0x1ffe('0x25'),_0x9d6faa,JSON[_0x1ffe('0x15')](_0x254255));_0xf5417e(_0x254255);})[_0x1ffe('0x1a')](function(_0x530673){logger[_0x1ffe('0x16')](_0x1ffe('0x25'),_0x530673[_0x1ffe('0x18')],_0x9d6faa);_0x200669(_0x2dccb1[_0x1ffe('0x16')](0x1f4,_0x530673[_0x1ffe('0x18')]));});});}; \ No newline at end of file +var _0xb0ca=['info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueue','findAll','options','where','limit','include','model','attributes','map','GetChatQueue','ShowChatQueue','find','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xb0ca,0x1b2));var _0xab0c=function(_0x3ca784,_0x23816d){_0x3ca784=_0x3ca784-0x0;var _0x6f8e7=_0xb0ca[_0x3ca784];return _0x6f8e7;};'use strict';var _=require('lodash');var util=require(_0xab0c('0x0'));var moment=require('moment');var BPromise=require(_0xab0c('0x1'));var rs=require(_0xab0c('0x2'));var fs=require('fs');var Redis=require(_0xab0c('0x3'));var db=require(_0xab0c('0x4'))['db'];var utils=require(_0xab0c('0x5'));var logger=require(_0xab0c('0x6'))(_0xab0c('0x7'));var config=require('../../config/environment');var jayson=require(_0xab0c('0x8'));var client=jayson[_0xab0c('0x9')][_0xab0c('0xa')]({'port':0x232a});config[_0xab0c('0xb')]=_[_0xab0c('0xc')](config[_0xab0c('0xb')],{'host':_0xab0c('0xd'),'port':0x18eb});var socket=require(_0xab0c('0xe'))(new Redis(config[_0xab0c('0xb')]));require('./chatQueue.socket')[_0xab0c('0xf')](socket);function respondWithRpcPromise(_0x15db71,_0x52df38,_0xb79b41){return new BPromise(function(_0x17bff7,_0x11a4ae){return client['request'](_0x15db71,_0xb79b41)[_0xab0c('0x10')](function(_0x53a944){logger[_0xab0c('0x11')](_0xab0c('0x12'),_0x52df38,_0xab0c('0x13'));logger[_0xab0c('0x14')](_0xab0c('0x15'),_0x52df38,_0xab0c('0x13'),JSON[_0xab0c('0x16')](_0x53a944));if(_0x53a944[_0xab0c('0x17')]){if(_0x53a944[_0xab0c('0x17')][_0xab0c('0x18')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x52df38,_0x53a944[_0xab0c('0x17')][_0xab0c('0x19')]);return _0x11a4ae(_0x53a944[_0xab0c('0x17')][_0xab0c('0x19')]);}logger[_0xab0c('0x17')](_0xab0c('0x12'),_0x52df38,_0x53a944[_0xab0c('0x17')][_0xab0c('0x19')]);return _0x17bff7(_0x53a944[_0xab0c('0x17')][_0xab0c('0x19')]);}else{logger[_0xab0c('0x11')](_0xab0c('0x12'),_0x52df38,_0xab0c('0x13'));_0x17bff7(_0x53a944[_0xab0c('0x1a')][_0xab0c('0x19')]);}})[_0xab0c('0x1b')](function(_0x44c6f4){logger[_0xab0c('0x17')](_0xab0c('0x12'),_0x52df38,_0x44c6f4);_0x11a4ae(_0x44c6f4);});});}exports['GetChatQueue']=function(_0x29b873){var _0x4ad10e=this;return new Promise(function(_0x36794d,_0x870902){return db[_0xab0c('0x1c')][_0xab0c('0x1d')]({'raw':_0x29b873[_0xab0c('0x1e')]?_0x29b873[_0xab0c('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x29b873[_0xab0c('0x1e')]?_0x29b873[_0xab0c('0x1e')][_0xab0c('0x1f')]||null:null,'attributes':_0x29b873['options']?_0x29b873[_0xab0c('0x1e')]['attributes']||null:null,'limit':_0x29b873[_0xab0c('0x1e')]?_0x29b873[_0xab0c('0x1e')][_0xab0c('0x20')]||null:null,'include':_0x29b873['options']?_0x29b873[_0xab0c('0x1e')][_0xab0c('0x21')]?_['map'](_0x29b873[_0xab0c('0x1e')][_0xab0c('0x21')],function(_0xfe7099){return{'model':db[_0xfe7099[_0xab0c('0x22')]],'as':_0xfe7099['as'],'attributes':_0xfe7099[_0xab0c('0x23')],'include':_0xfe7099[_0xab0c('0x21')]?_[_0xab0c('0x24')](_0xfe7099[_0xab0c('0x21')],function(_0x3ce281){return{'model':db[_0x3ce281[_0xab0c('0x22')]],'as':_0x3ce281['as'],'attributes':_0x3ce281[_0xab0c('0x23')],'include':_0x3ce281[_0xab0c('0x21')]?_[_0xab0c('0x24')](_0x3ce281['include'],function(_0x70f07f){return{'model':db[_0x70f07f[_0xab0c('0x22')]],'as':_0x70f07f['as'],'attributes':_0x70f07f[_0xab0c('0x23')]};}):[]};}):[]};}):[]:[]})[_0xab0c('0x10')](function(_0x47a239){logger['info']('GetChatQueue',_0x29b873);logger['debug'](_0xab0c('0x25'),_0x29b873,JSON[_0xab0c('0x16')](_0x47a239));_0x36794d(_0x47a239);})[_0xab0c('0x1b')](function(_0x3e6b6e){logger[_0xab0c('0x17')]('GetChatQueue',_0x3e6b6e['message'],_0x29b873);_0x870902(_0x4ad10e[_0xab0c('0x17')](0x1f4,_0x3e6b6e[_0xab0c('0x19')]));});});};exports[_0xab0c('0x26')]=function(_0xe36cea){var _0x2bccdb=this;return new Promise(function(_0x577c31,_0x582536){return db['ChatQueue'][_0xab0c('0x27')]({'raw':_0xe36cea[_0xab0c('0x1e')]?_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x28')]===undefined?!![]:![]:!![],'where':_0xe36cea[_0xab0c('0x1e')]?_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x1f')]||null:null,'attributes':_0xe36cea[_0xab0c('0x1e')]?_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x23')]||null:null,'include':_0xe36cea[_0xab0c('0x1e')]?_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x21')]?_['map'](_0xe36cea[_0xab0c('0x1e')][_0xab0c('0x21')],function(_0x366ade){return{'model':db[_0x366ade[_0xab0c('0x22')]],'as':_0x366ade['as'],'attributes':_0x366ade[_0xab0c('0x23')],'include':_0x366ade['include']?_['map'](_0x366ade['include'],function(_0x4c5f21){return{'model':db[_0x4c5f21[_0xab0c('0x22')]],'as':_0x4c5f21['as'],'attributes':_0x4c5f21['attributes'],'include':_0x4c5f21['include']?_[_0xab0c('0x24')](_0x4c5f21[_0xab0c('0x21')],function(_0xd1a5fb){return{'model':db[_0xd1a5fb[_0xab0c('0x22')]],'as':_0xd1a5fb['as'],'attributes':_0xd1a5fb['attributes']};}):[]};}):[]};}):[]:[]})[_0xab0c('0x10')](function(_0x16048c){logger[_0xab0c('0x11')](_0xab0c('0x26'),_0xe36cea);logger['debug'](_0xab0c('0x26'),_0xe36cea,JSON[_0xab0c('0x16')](_0x16048c));_0x577c31(_0x16048c);})[_0xab0c('0x1b')](function(_0x2dbd55){logger[_0xab0c('0x17')](_0xab0c('0x26'),_0x2dbd55[_0xab0c('0x19')],_0xe36cea);_0x582536(_0x2bccdb['error'](0x1f4,_0x2dbd55[_0xab0c('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 87b1efc..445f43c 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 _0x72b1=['register','length','./chatQueue.events','remove','update','emit','removeListener'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x72b1,0x16e));var _0x172b=function(_0x28e366,_0x478cf6){_0x28e366=_0x28e366-0x0;var _0x9ff0da=_0x72b1[_0x28e366];return _0x9ff0da;};'use strict';var ChatQueueEvents=require(_0x172b('0x0'));var events=['save',_0x172b('0x1'),_0x172b('0x2')];function createListener(_0x42b795,_0x18fd16){return function(_0x23bc7a){_0x18fd16[_0x172b('0x3')](_0x42b795,_0x23bc7a);};}function removeListener(_0x2c1d6e,_0x558038){return function(){ChatQueueEvents[_0x172b('0x4')](_0x2c1d6e,_0x558038);};}exports[_0x172b('0x5')]=function(_0x475fd6){for(var _0x222624=0x0,_0x571994=events[_0x172b('0x6')];_0x222624<_0x571994;_0x222624++){var _0x517363=events[_0x222624];var _0x1f98e9=createListener('chatQueue:'+_0x517363,_0x475fd6);ChatQueueEvents['on'](_0x517363,_0x1f98e9);}}; \ No newline at end of file +var _0x032e=['removeListener','register','length','chatQueue:','./chatQueue.events','remove','update','emit'];(function(_0x56cf67,_0x375d15){var _0x117fb6=function(_0x5e84ae){while(--_0x5e84ae){_0x56cf67['push'](_0x56cf67['shift']());}};_0x117fb6(++_0x375d15);}(_0x032e,0x124));var _0xe032=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x032e[_0x29b609];return _0x54c952;};'use strict';var ChatQueueEvents=require(_0xe032('0x0'));var events=['save',_0xe032('0x1'),_0xe032('0x2')];function createListener(_0x5ca562,_0x4afba2){return function(_0x45ab5b){_0x4afba2[_0xe032('0x3')](_0x5ca562,_0x45ab5b);};}function removeListener(_0x2f44f6,_0x1983cc){return function(){ChatQueueEvents[_0xe032('0x4')](_0x2f44f6,_0x1983cc);};}exports[_0xe032('0x5')]=function(_0x2ba8a0){for(var _0x33ad0b=0x0,_0x37432f=events[_0xe032('0x6')];_0x33ad0b<_0x37432f;_0x33ad0b++){var _0x3289b0=events[_0x33ad0b];var _0xd84027=createListener(_0xe032('0x7')+_0x3289b0,_0x2ba8a0);ChatQueueEvents['on'](_0x3289b0,_0xd84027);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 1f9883b..d6c529a 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xee1fc0,_0x43572c){var _0x4f9676=function(_0x44ad3c){while(--_0x44ad3c){_0xee1fc0['push'](_0xee1fc0['shift']());}};_0x4f9676(++_0x43572c);}(_0x008c,0x188));var _0xc008=function(_0x2e561f,_0x1b1660){_0x2e561f=_0x2e561f-0x0;var _0x4160ea=_0x008c[_0x2e561f];return _0x4160ea;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _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(_0x5555e3,_0x2fb654){var _0x120341=function(_0x435663){while(--_0x435663){_0x5555e3['push'](_0x5555e3['shift']());}};_0x120341(++_0x2fb654);}(_0xe14b,0x93));var _0xbe14=function(_0x45ab94,_0x1927ea){_0x45ab94=_0x45ab94-0x0;var _0x3985ad=_0xe14b[_0x45ab94];return _0x3985ad;};'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 ba35808..4bd7e9b 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 _0xabe0=['DATE','moment','sequelize','exports','STRING'];(function(_0x1af5b0,_0x37a477){var _0x3d9fe7=function(_0x2b021e){while(--_0x2b021e){_0x1af5b0['push'](_0x1af5b0['shift']());}};_0x3d9fe7(++_0x37a477);}(_0xabe0,0x182));var _0x0abe=function(_0x179794,_0x2fe676){_0x179794=_0x179794-0x0;var _0x264065=_0xabe0[_0x179794];return _0x264065;};'use strict';var moment=require(_0x0abe('0x0'));var Sequelize=require(_0x0abe('0x1'));module[_0x0abe('0x2')]={'uniqueid':{'type':Sequelize[_0x0abe('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0abe('0x3')]},'joinAt':{'type':Sequelize[_0x0abe('0x4')]},'leaveAt':{'type':Sequelize[_0x0abe('0x4')]},'acceptAt':{'type':Sequelize[_0x0abe('0x4')]},'exitAt':{'type':Sequelize[_0x0abe('0x4')]},'reason':{'type':Sequelize[_0x0abe('0x3')]}}; \ No newline at end of file +var _0x514f=['sequelize','exports','STRING','DATE','moment'];(function(_0x299efe,_0x5e1129){var _0x53c2b8=function(_0x983907){while(--_0x983907){_0x299efe['push'](_0x299efe['shift']());}};_0x53c2b8(++_0x5e1129);}(_0x514f,0x167));var _0xf514=function(_0xe66452,_0x57a652){_0xe66452=_0xe66452-0x0;var _0x4ac5c6=_0x514f[_0xe66452];return _0x4ac5c6;};'use strict';var moment=require(_0xf514('0x0'));var Sequelize=require(_0xf514('0x1'));module[_0xf514('0x2')]={'uniqueid':{'type':Sequelize[_0xf514('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf514('0x3')]},'joinAt':{'type':Sequelize[_0xf514('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf514('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index c163daf..e423831 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 _0xf8bb=['apply','then','destroy','sendStatus','stack','name','send','index','map','ChatQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','count','include','findAll','catch','show','params','length','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','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','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range'];(function(_0xfba9b5,_0x3873d8){var _0x328a52=function(_0x2e5d74){while(--_0x2e5d74){_0xfba9b5['push'](_0xfba9b5['shift']());}};_0x328a52(++_0x3873d8);}(_0xf8bb,0x111));var _0xbf8b=function(_0x160e01,_0x1bbb9f){_0x160e01=_0x160e01-0x0;var _0x39a2b3=_0xf8bb[_0x160e01];return _0x39a2b3;};'use strict';var emlformat=require(_0xbf8b('0x0'));var rimraf=require(_0xbf8b('0x1'));var zipdir=require(_0xbf8b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbf8b('0x3'));var moment=require(_0xbf8b('0x4'));var BPromise=require(_0xbf8b('0x5'));var Mustache=require(_0xbf8b('0x6'));var util=require(_0xbf8b('0x7'));var path=require(_0xbf8b('0x8'));var sox=require(_0xbf8b('0x9'));var csv=require(_0xbf8b('0xa'));var ejs=require(_0xbf8b('0xb'));var fs=require('fs');var fs_extra=require(_0xbf8b('0xc'));var _=require(_0xbf8b('0xd'));var squel=require(_0xbf8b('0xe'));var crypto=require(_0xbf8b('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xbf8b('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbf8b('0x11'));var Redis=require('ioredis');var authService=require(_0xbf8b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbf8b('0x13'));var hardwareService=require(_0xbf8b('0x14'));var logger=require(_0xbf8b('0x15'))(_0xbf8b('0x16'));var utils=require(_0xbf8b('0x17'));var config=require(_0xbf8b('0x18'));var licenseUtil=require(_0xbf8b('0x19'));var db=require(_0xbf8b('0x1a'))['db'];function respondWithStatusCode(_0x59055d,_0x3e3bfb){_0x3e3bfb=_0x3e3bfb||0xcc;return function(_0xeffd6d){if(_0xeffd6d){return _0x59055d['sendStatus'](_0x3e3bfb);}return _0x59055d[_0xbf8b('0x1b')](_0x3e3bfb)[_0xbf8b('0x1c')]();};}function respondWithResult(_0x19f654,_0x1ed0d1){_0x1ed0d1=_0x1ed0d1||0xc8;return function(_0x2b7daf){if(_0x2b7daf){return _0x19f654[_0xbf8b('0x1b')](_0x1ed0d1)[_0xbf8b('0x1d')](_0x2b7daf);}};}function respondWithFilteredResult(_0x2709a7,_0x36875d){return function(_0x3b4e5b){if(_0x3b4e5b){var _0x56cb78=typeof _0x36875d[_0xbf8b('0x1e')]===_0xbf8b('0x1f')&&typeof _0x36875d[_0xbf8b('0x20')]===_0xbf8b('0x1f');var _0x3c09f4=_0x3b4e5b['count'];var _0x3bab93=_0x56cb78?0x0:_0x36875d[_0xbf8b('0x1e')];var _0x460f3d=_0x56cb78?_0x3b4e5b['count']:_0x36875d[_0xbf8b('0x1e')]+_0x36875d[_0xbf8b('0x20')];var _0x2d6bda;if(_0x460f3d>=_0x3c09f4){_0x460f3d=_0x3c09f4;_0x2d6bda=0xc8;}else{_0x2d6bda=0xce;}_0x2709a7['status'](_0x2d6bda);return _0x2709a7[_0xbf8b('0x21')](_0xbf8b('0x22'),_0x3bab93+'-'+_0x460f3d+'/'+_0x3c09f4)[_0xbf8b('0x1d')](_0x3b4e5b);}return null;};}function patchUpdates(_0x461bb8){return function(_0x2ba7e4){try{jsonpatch[_0xbf8b('0x23')](_0x2ba7e4,_0x461bb8,!![]);}catch(_0x4b7209){return BPromise['reject'](_0x4b7209);}return _0x2ba7e4['save']();};}function saveUpdates(_0x153c19,_0x4f36e5){return function(_0x3d4b1a){if(_0x3d4b1a){return _0x3d4b1a['update'](_0x153c19)[_0xbf8b('0x24')](function(_0x4dbb2b){return _0x4dbb2b;});}return null;};}function removeEntity(_0x5dc254,_0x3be6ef){return function(_0x35e83f){if(_0x35e83f){return _0x35e83f[_0xbf8b('0x25')]()[_0xbf8b('0x24')](function(){_0x5dc254[_0xbf8b('0x1b')](0xcc)[_0xbf8b('0x1c')]();});}};}function handleEntityNotFound(_0x34089d,_0xd6f4d0){return function(_0x4cc565){if(!_0x4cc565){_0x34089d[_0xbf8b('0x26')](0x194);}return _0x4cc565;};}function handleError(_0x8d94fb,_0x346914){_0x346914=_0x346914||0x1f4;return function(_0x18d1d5){logger['error'](_0x18d1d5[_0xbf8b('0x27')]);if(_0x18d1d5[_0xbf8b('0x28')]){delete _0x18d1d5['name'];}_0x8d94fb[_0xbf8b('0x1b')](_0x346914)[_0xbf8b('0x29')](_0x18d1d5);};}exports[_0xbf8b('0x2a')]=function(_0x276048,_0x1af553){var _0x2ffc94={},_0xc14007={},_0x36722e={'count':0x0,'rows':[]};var _0x3b9275=_[_0xbf8b('0x2b')](db[_0xbf8b('0x2c')][_0xbf8b('0x2d')],function(_0x456269){return{'name':_0x456269['fieldName'],'type':_0x456269[_0xbf8b('0x2e')][_0xbf8b('0x2f')]};});_0xc14007[_0xbf8b('0x30')]=_[_0xbf8b('0x2b')](_0x3b9275,'name');_0xc14007[_0xbf8b('0x31')]=_[_0xbf8b('0x32')](_0x276048[_0xbf8b('0x31')]);_0xc14007[_0xbf8b('0x33')]=_[_0xbf8b('0x34')](_0xc14007[_0xbf8b('0x30')],_0xc14007[_0xbf8b('0x31')]);_0x2ffc94[_0xbf8b('0x35')]=_[_0xbf8b('0x34')](_0xc14007[_0xbf8b('0x30')],qs[_0xbf8b('0x36')](_0x276048[_0xbf8b('0x31')]['fields']));_0x2ffc94[_0xbf8b('0x35')]=_0x2ffc94['attributes']['length']?_0x2ffc94[_0xbf8b('0x35')]:_0xc14007[_0xbf8b('0x30')];if(!_0x276048[_0xbf8b('0x31')][_0xbf8b('0x37')](_0xbf8b('0x38'))){_0x2ffc94['limit']=qs['limit'](_0x276048[_0xbf8b('0x31')][_0xbf8b('0x20')]);_0x2ffc94[_0xbf8b('0x1e')]=qs[_0xbf8b('0x1e')](_0x276048[_0xbf8b('0x31')][_0xbf8b('0x1e')]);}_0x2ffc94[_0xbf8b('0x39')]=qs[_0xbf8b('0x3a')](_0x276048[_0xbf8b('0x31')][_0xbf8b('0x3a')]);_0x2ffc94['where']=qs[_0xbf8b('0x33')](_[_0xbf8b('0x3b')](_0x276048['query'],_0xc14007[_0xbf8b('0x33')]),_0x3b9275);if(_0x276048[_0xbf8b('0x31')][_0xbf8b('0x3c')]){_0x2ffc94[_0xbf8b('0x3d')]=_[_0xbf8b('0x3e')](_0x2ffc94['where'],{'$or':_[_0xbf8b('0x2b')](_0x3b9275,function(_0x4685e1){if(_0x4685e1[_0xbf8b('0x2e')]!==_0xbf8b('0x3f')){var _0x1bdf87={};_0x1bdf87[_0x4685e1[_0xbf8b('0x28')]]={'$like':'%'+_0x276048[_0xbf8b('0x31')][_0xbf8b('0x3c')]+'%'};return _0x1bdf87;}})});}_0x2ffc94=_[_0xbf8b('0x3e')]({},_0x2ffc94,_0x276048['options']);var _0x39eeff={'where':_0x2ffc94[_0xbf8b('0x3d')]};return db[_0xbf8b('0x2c')][_0xbf8b('0x40')](_0x39eeff)[_0xbf8b('0x24')](function(_0x1f0e25){_0x36722e[_0xbf8b('0x40')]=_0x1f0e25;if(_0x276048[_0xbf8b('0x31')]['includeAll']){_0x2ffc94[_0xbf8b('0x41')]=[{'all':!![]}];}return db[_0xbf8b('0x2c')][_0xbf8b('0x42')](_0x2ffc94);})[_0xbf8b('0x24')](function(_0x238df1){_0x36722e['rows']=_0x238df1;return _0x36722e;})['then'](respondWithFilteredResult(_0x1af553,_0x2ffc94))[_0xbf8b('0x43')](handleError(_0x1af553,null));};exports[_0xbf8b('0x44')]=function(_0x5cbe86,_0x4d6a45){var _0x42b1e1={'raw':!![],'where':{'id':_0x5cbe86[_0xbf8b('0x45')]['id']}},_0x263e0c={};_0x263e0c[_0xbf8b('0x30')]=_[_0xbf8b('0x32')](db['ChatQueueReport'][_0xbf8b('0x2d')]);_0x263e0c[_0xbf8b('0x31')]=_[_0xbf8b('0x32')](_0x5cbe86[_0xbf8b('0x31')]);_0x263e0c[_0xbf8b('0x33')]=_['intersection'](_0x263e0c[_0xbf8b('0x30')],_0x263e0c[_0xbf8b('0x31')]);_0x42b1e1[_0xbf8b('0x35')]=_['intersection'](_0x263e0c['model'],qs['fields'](_0x5cbe86[_0xbf8b('0x31')][_0xbf8b('0x36')]));_0x42b1e1[_0xbf8b('0x35')]=_0x42b1e1[_0xbf8b('0x35')][_0xbf8b('0x46')]?_0x42b1e1[_0xbf8b('0x35')]:_0x263e0c[_0xbf8b('0x30')];if(_0x5cbe86[_0xbf8b('0x31')][_0xbf8b('0x47')]){_0x42b1e1[_0xbf8b('0x41')]=[{'all':!![]}];}_0x42b1e1=_[_0xbf8b('0x3e')]({},_0x42b1e1,_0x5cbe86[_0xbf8b('0x48')]);return db[_0xbf8b('0x2c')][_0xbf8b('0x49')](_0x42b1e1)[_0xbf8b('0x24')](handleEntityNotFound(_0x4d6a45,null))[_0xbf8b('0x24')](respondWithResult(_0x4d6a45,null))['catch'](handleError(_0x4d6a45,null));};exports[_0xbf8b('0x4a')]=function(_0x355644,_0x1e3076){return db[_0xbf8b('0x2c')]['create'](_0x355644[_0xbf8b('0x4b')],{})[_0xbf8b('0x24')](respondWithResult(_0x1e3076,0xc9))[_0xbf8b('0x43')](handleError(_0x1e3076,null));};exports['update']=function(_0x3c22d0,_0x2ee446){if(_0x3c22d0[_0xbf8b('0x4b')]['id']){delete _0x3c22d0[_0xbf8b('0x4b')]['id'];}return db[_0xbf8b('0x2c')][_0xbf8b('0x49')]({'where':{'id':_0x3c22d0['params']['id']}})['then'](handleEntityNotFound(_0x2ee446,null))['then'](saveUpdates(_0x3c22d0[_0xbf8b('0x4b')],null))[_0xbf8b('0x24')](respondWithResult(_0x2ee446,null))[_0xbf8b('0x43')](handleError(_0x2ee446,null));};exports['destroy']=function(_0x4da94e,_0x395ea1){return db[_0xbf8b('0x2c')]['find']({'where':{'id':_0x4da94e[_0xbf8b('0x45')]['id']}})[_0xbf8b('0x24')](handleEntityNotFound(_0x395ea1,null))[_0xbf8b('0x24')](removeEntity(_0x395ea1,null))[_0xbf8b('0x43')](handleError(_0x395ea1,null));};exports[_0xbf8b('0x4c')]=function(_0x83800,_0x501215){return db['ChatQueueReport'][_0xbf8b('0x4c')]()['then'](respondWithResult(_0x501215,null))[_0xbf8b('0x43')](handleError(_0x501215,null));}; \ No newline at end of file +var _0x0967=['fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','find','catch','create','body','params','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','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','stack','name','index','map','ChatQueueReport','rawAttributes'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x0967,0x100));var _0x7096=function(_0xe88e51,_0x40daaf){_0xe88e51=_0xe88e51-0x0;var _0x1e0a56=_0x0967[_0xe88e51];return _0x1e0a56;};'use strict';var emlformat=require(_0x7096('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7096('0x1'));var jsonpatch=require(_0x7096('0x2'));var rp=require(_0x7096('0x3'));var moment=require(_0x7096('0x4'));var BPromise=require(_0x7096('0x5'));var Mustache=require(_0x7096('0x6'));var util=require(_0x7096('0x7'));var path=require(_0x7096('0x8'));var sox=require('sox');var csv=require(_0x7096('0x9'));var ejs=require(_0x7096('0xa'));var fs=require('fs');var fs_extra=require(_0x7096('0xb'));var _=require(_0x7096('0xc'));var squel=require(_0x7096('0xd'));var crypto=require(_0x7096('0xe'));var jsforce=require(_0x7096('0xf'));var deskjs=require(_0x7096('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7096('0x11'));var Redis=require(_0x7096('0x12'));var authService=require(_0x7096('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7096('0x14'));var logger=require(_0x7096('0x15'))(_0x7096('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7096('0x17'));var db=require(_0x7096('0x18'))['db'];function respondWithStatusCode(_0x56774c,_0x38274d){_0x38274d=_0x38274d||0xcc;return function(_0x5be71d){if(_0x5be71d){return _0x56774c[_0x7096('0x19')](_0x38274d);}return _0x56774c[_0x7096('0x1a')](_0x38274d)['end']();};}function respondWithResult(_0x2d8ed4,_0x182c05){_0x182c05=_0x182c05||0xc8;return function(_0x15a620){if(_0x15a620){return _0x2d8ed4[_0x7096('0x1a')](_0x182c05)[_0x7096('0x1b')](_0x15a620);}};}function respondWithFilteredResult(_0x40116c,_0x479057){return function(_0x240010){if(_0x240010){var _0x2c02ce=typeof _0x479057[_0x7096('0x1c')]===_0x7096('0x1d')&&typeof _0x479057[_0x7096('0x1e')]==='undefined';var _0x41bc1b=_0x240010[_0x7096('0x1f')];var _0x1ff404=_0x2c02ce?0x0:_0x479057['offset'];var _0x5079e6=_0x2c02ce?_0x240010[_0x7096('0x1f')]:_0x479057['offset']+_0x479057['limit'];var _0x4a0859;if(_0x5079e6>=_0x41bc1b){_0x5079e6=_0x41bc1b;_0x4a0859=0xc8;}else{_0x4a0859=0xce;}_0x40116c[_0x7096('0x1a')](_0x4a0859);return _0x40116c[_0x7096('0x20')](_0x7096('0x21'),_0x1ff404+'-'+_0x5079e6+'/'+_0x41bc1b)[_0x7096('0x1b')](_0x240010);}return null;};}function patchUpdates(_0xbd59a9){return function(_0x221090){try{jsonpatch[_0x7096('0x22')](_0x221090,_0xbd59a9,!![]);}catch(_0x248301){return BPromise['reject'](_0x248301);}return _0x221090[_0x7096('0x23')]();};}function saveUpdates(_0x13390a,_0x41db64){return function(_0x5ab797){if(_0x5ab797){return _0x5ab797[_0x7096('0x24')](_0x13390a)['then'](function(_0x5a0fce){return _0x5a0fce;});}return null;};}function removeEntity(_0x270d61,_0x48849a){return function(_0x5d3146){if(_0x5d3146){return _0x5d3146[_0x7096('0x25')]()['then'](function(){_0x270d61[_0x7096('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f14f9,_0x2bd8ed){return function(_0x4a6423){if(!_0x4a6423){_0x4f14f9[_0x7096('0x19')](0x194);}return _0x4a6423;};}function handleError(_0x4e0f0a,_0x4152d1){_0x4152d1=_0x4152d1||0x1f4;return function(_0xd83be3){logger['error'](_0xd83be3[_0x7096('0x26')]);if(_0xd83be3[_0x7096('0x27')]){delete _0xd83be3['name'];}_0x4e0f0a['status'](_0x4152d1)['send'](_0xd83be3);};}exports[_0x7096('0x28')]=function(_0x2a6126,_0x404697){var _0xc4153a={},_0x5b4531={},_0x433e67={'count':0x0,'rows':[]};var _0x2ee31b=_[_0x7096('0x29')](db[_0x7096('0x2a')][_0x7096('0x2b')],function(_0x474966){return{'name':_0x474966[_0x7096('0x2c')],'type':_0x474966[_0x7096('0x2d')][_0x7096('0x2e')]};});_0x5b4531[_0x7096('0x2f')]=_['map'](_0x2ee31b,'name');_0x5b4531[_0x7096('0x30')]=_[_0x7096('0x31')](_0x2a6126[_0x7096('0x30')]);_0x5b4531['filters']=_[_0x7096('0x32')](_0x5b4531[_0x7096('0x2f')],_0x5b4531[_0x7096('0x30')]);_0xc4153a[_0x7096('0x33')]=_['intersection'](_0x5b4531[_0x7096('0x2f')],qs['fields'](_0x2a6126['query'][_0x7096('0x34')]));_0xc4153a[_0x7096('0x33')]=_0xc4153a[_0x7096('0x33')][_0x7096('0x35')]?_0xc4153a[_0x7096('0x33')]:_0x5b4531['model'];if(!_0x2a6126[_0x7096('0x30')]['hasOwnProperty'](_0x7096('0x36'))){_0xc4153a['limit']=qs[_0x7096('0x1e')](_0x2a6126[_0x7096('0x30')][_0x7096('0x1e')]);_0xc4153a[_0x7096('0x1c')]=qs['offset'](_0x2a6126[_0x7096('0x30')][_0x7096('0x1c')]);}_0xc4153a[_0x7096('0x37')]=qs[_0x7096('0x38')](_0x2a6126[_0x7096('0x30')][_0x7096('0x38')]);_0xc4153a['where']=qs[_0x7096('0x39')](_[_0x7096('0x3a')](_0x2a6126[_0x7096('0x30')],_0x5b4531[_0x7096('0x39')]),_0x2ee31b);if(_0x2a6126[_0x7096('0x30')]['filter']){_0xc4153a['where']=_[_0x7096('0x3b')](_0xc4153a[_0x7096('0x3c')],{'$or':_['map'](_0x2ee31b,function(_0x3a3f89){if(_0x3a3f89[_0x7096('0x2d')]!==_0x7096('0x3d')){var _0x534386={};_0x534386[_0x3a3f89[_0x7096('0x27')]]={'$like':'%'+_0x2a6126[_0x7096('0x30')][_0x7096('0x3e')]+'%'};return _0x534386;}})});}_0xc4153a=_[_0x7096('0x3b')]({},_0xc4153a,_0x2a6126[_0x7096('0x3f')]);var _0x3db223={'where':_0xc4153a['where']};return db[_0x7096('0x2a')]['count'](_0x3db223)[_0x7096('0x40')](function(_0x240ad4){_0x433e67[_0x7096('0x1f')]=_0x240ad4;if(_0x2a6126[_0x7096('0x30')][_0x7096('0x41')]){_0xc4153a[_0x7096('0x42')]=[{'all':!![]}];}return db[_0x7096('0x2a')][_0x7096('0x43')](_0xc4153a);})[_0x7096('0x40')](function(_0xd17348){_0x433e67[_0x7096('0x44')]=_0xd17348;return _0x433e67;})[_0x7096('0x40')](respondWithFilteredResult(_0x404697,_0xc4153a))['catch'](handleError(_0x404697,null));};exports['show']=function(_0x57ee0b,_0x525101){var _0x1d3f20={'raw':!![],'where':{'id':_0x57ee0b['params']['id']}},_0x1778c2={};_0x1778c2[_0x7096('0x2f')]=_[_0x7096('0x31')](db[_0x7096('0x2a')][_0x7096('0x2b')]);_0x1778c2[_0x7096('0x30')]=_['keys'](_0x57ee0b[_0x7096('0x30')]);_0x1778c2['filters']=_[_0x7096('0x32')](_0x1778c2[_0x7096('0x2f')],_0x1778c2[_0x7096('0x30')]);_0x1d3f20[_0x7096('0x33')]=_['intersection'](_0x1778c2['model'],qs['fields'](_0x57ee0b[_0x7096('0x30')][_0x7096('0x34')]));_0x1d3f20['attributes']=_0x1d3f20[_0x7096('0x33')][_0x7096('0x35')]?_0x1d3f20[_0x7096('0x33')]:_0x1778c2[_0x7096('0x2f')];if(_0x57ee0b['query'][_0x7096('0x41')]){_0x1d3f20[_0x7096('0x42')]=[{'all':!![]}];}_0x1d3f20=_['merge']({},_0x1d3f20,_0x57ee0b[_0x7096('0x3f')]);return db['ChatQueueReport'][_0x7096('0x45')](_0x1d3f20)['then'](handleEntityNotFound(_0x525101,null))[_0x7096('0x40')](respondWithResult(_0x525101,null))[_0x7096('0x46')](handleError(_0x525101,null));};exports[_0x7096('0x47')]=function(_0x2cc7e2,_0x1ac3d1){return db[_0x7096('0x2a')][_0x7096('0x47')](_0x2cc7e2[_0x7096('0x48')],{})['then'](respondWithResult(_0x1ac3d1,0xc9))[_0x7096('0x46')](handleError(_0x1ac3d1,null));};exports[_0x7096('0x24')]=function(_0x446c7b,_0x97cbef){if(_0x446c7b['body']['id']){delete _0x446c7b['body']['id'];}return db[_0x7096('0x2a')][_0x7096('0x45')]({'where':{'id':_0x446c7b[_0x7096('0x49')]['id']}})[_0x7096('0x40')](handleEntityNotFound(_0x97cbef,null))[_0x7096('0x40')](saveUpdates(_0x446c7b[_0x7096('0x48')],null))[_0x7096('0x40')](respondWithResult(_0x97cbef,null))[_0x7096('0x46')](handleError(_0x97cbef,null));};exports[_0x7096('0x25')]=function(_0x439646,_0x32c7a8){return db[_0x7096('0x2a')][_0x7096('0x45')]({'where':{'id':_0x439646[_0x7096('0x49')]['id']}})['then'](handleEntityNotFound(_0x32c7a8,null))[_0x7096('0x40')](removeEntity(_0x32c7a8,null))[_0x7096('0x46')](handleError(_0x32c7a8,null));};exports[_0x7096('0x4a')]=function(_0x54616c,_0x3de0bf){return db[_0x7096('0x2a')][_0x7096('0x4a')]()[_0x7096('0x40')](respondWithResult(_0x3de0bf,null))['catch'](handleError(_0x3de0bf,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 154a04b..987ec24 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x4697fa,_0x21c841){var _0x390950=function(_0x3deb8a){while(--_0x3deb8a){_0x4697fa['push'](_0x4697fa['shift']());}};_0x390950(++_0x21c841);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x12f4fc,_0x47ff54){var _0x297cb8=function(_0x5a680c){while(--_0x5a680c){_0x12f4fc['push'](_0x12f4fc['shift']());}};_0x297cb8(++_0x47ff54);}(_0x757a,0xde));var _0xa757=function(_0xbfeba3,_0x215f24){_0xbfeba3=_0xbfeba3-0x0;var _0xf1962a=_0x757a[_0xbfeba3];return _0xf1962a;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 62e5ba2..742c5f8 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 _0x3f40=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','create','body','options','raw','CreateChatQueueReport','ChatQueueReport','update','attributes','limit','UpdateChatQueueReport'];(function(_0x51e8e1,_0x80ed5d){var _0x4b11f3=function(_0x1e5a5d){while(--_0x1e5a5d){_0x51e8e1['push'](_0x51e8e1['shift']());}};_0x4b11f3(++_0x80ed5d);}(_0x3f40,0xe0));var _0x03f4=function(_0x39cbe5,_0x3df7cf){_0x39cbe5=_0x39cbe5-0x0;var _0x3478ed=_0x3f40[_0x39cbe5];return _0x3478ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x03f4('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x03f4('0x1'))['db'];var utils=require(_0x03f4('0x2'));var logger=require(_0x03f4('0x3'))(_0x03f4('0x4'));var config=require('../../config/environment');var jayson=require(_0x03f4('0x5'));var client=jayson[_0x03f4('0x6')][_0x03f4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4ddee9,_0x4ee188,_0x357327){return new BPromise(function(_0x1f8843,_0x155e57){return client['request'](_0x4ddee9,_0x357327)[_0x03f4('0x8')](function(_0x309c4a){logger['info'](_0x03f4('0x9'),_0x4ee188,_0x03f4('0xa'));logger[_0x03f4('0xb')](_0x03f4('0xc'),_0x4ee188,_0x03f4('0xa'),JSON[_0x03f4('0xd')](_0x309c4a));if(_0x309c4a[_0x03f4('0xe')]){if(_0x309c4a['error']['code']===0x1f4){logger[_0x03f4('0xe')](_0x03f4('0x9'),_0x4ee188,_0x309c4a['error'][_0x03f4('0xf')]);return _0x155e57(_0x309c4a[_0x03f4('0xe')]['message']);}logger[_0x03f4('0xe')](_0x03f4('0x9'),_0x4ee188,_0x309c4a[_0x03f4('0xe')][_0x03f4('0xf')]);return _0x1f8843(_0x309c4a['error'][_0x03f4('0xf')]);}else{logger[_0x03f4('0x10')](_0x03f4('0x9'),_0x4ee188,_0x03f4('0xa'));_0x1f8843(_0x309c4a['result']['message']);}})[_0x03f4('0x11')](function(_0xdbc993){logger['error'](_0x03f4('0x9'),_0x4ee188,_0xdbc993);_0x155e57(_0xdbc993);});});}exports['CreateChatQueueReport']=function(_0x48e6ae){var _0x46ee0f=this;return new Promise(function(_0x4a7e6d,_0x59b388){return db['ChatQueueReport'][_0x03f4('0x12')](_0x48e6ae[_0x03f4('0x13')],{'raw':_0x48e6ae['options']?_0x48e6ae[_0x03f4('0x14')][_0x03f4('0x15')]===undefined?!![]:![]:!![]})[_0x03f4('0x8')](function(_0x5e57c9){logger[_0x03f4('0x10')](_0x03f4('0x16'),_0x48e6ae);logger[_0x03f4('0xb')](_0x03f4('0x16'),_0x48e6ae,JSON[_0x03f4('0xd')](_0x5e57c9));_0x4a7e6d(_0x5e57c9);})['catch'](function(_0x458135){logger[_0x03f4('0xe')](_0x03f4('0x16'),_0x458135[_0x03f4('0xf')],_0x48e6ae);_0x59b388(_0x46ee0f[_0x03f4('0xe')](0x1f4,_0x458135[_0x03f4('0xf')]));});});};exports['UpdateChatQueueReport']=function(_0x11fb91){var _0x1a1d10=this;return new Promise(function(_0x4a2b19,_0x3edef1){return db[_0x03f4('0x17')][_0x03f4('0x18')](_0x11fb91[_0x03f4('0x13')],{'raw':_0x11fb91[_0x03f4('0x14')]?_0x11fb91[_0x03f4('0x14')][_0x03f4('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11fb91[_0x03f4('0x14')]?_0x11fb91[_0x03f4('0x14')]['where']||null:null,'attributes':_0x11fb91[_0x03f4('0x14')]?_0x11fb91[_0x03f4('0x14')][_0x03f4('0x19')]||null:null,'limit':_0x11fb91[_0x03f4('0x14')]?_0x11fb91['options'][_0x03f4('0x1a')]||null:null})[_0x03f4('0x8')](function(_0x535279){logger['info'](_0x03f4('0x1b'),_0x11fb91);logger[_0x03f4('0xb')](_0x03f4('0x1b'),_0x11fb91,JSON[_0x03f4('0xd')](_0x535279));_0x4a2b19(_0x535279);})[_0x03f4('0x11')](function(_0x453e88){logger['error']('UpdateChatQueueReport',_0x453e88[_0x03f4('0xf')],_0x11fb91);_0x3edef1(_0x1a1d10[_0x03f4('0xe')](0x1f4,_0x453e88[_0x03f4('0xf')]));});});}; \ No newline at end of file +var _0x5066=['client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','raw','options','where','attributes','UpdateChatQueueReport','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x30b8d5,_0x390f2a){var _0x47fc21=function(_0x4cbb1a){while(--_0x4cbb1a){_0x30b8d5['push'](_0x30b8d5['shift']());}};_0x47fc21(++_0x390f2a);}(_0x5066,0x1a3));var _0x6506=function(_0x5b0f89,_0x303a8b){_0x5b0f89=_0x5b0f89-0x0;var _0x21ae25=_0x5066[_0x5b0f89];return _0x21ae25;};'use strict';var _=require(_0x6506('0x0'));var util=require(_0x6506('0x1'));var moment=require('moment');var BPromise=require(_0x6506('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6506('0x3'));var db=require(_0x6506('0x4'))['db'];var utils=require(_0x6506('0x5'));var logger=require(_0x6506('0x6'))(_0x6506('0x7'));var config=require(_0x6506('0x8'));var jayson=require(_0x6506('0x9'));var client=jayson[_0x6506('0xa')][_0x6506('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ddced,_0x4a3191,_0x4cc9ab){return new BPromise(function(_0x5ca913,_0x374718){return client[_0x6506('0xc')](_0x1ddced,_0x4cc9ab)[_0x6506('0xd')](function(_0x276d86){logger[_0x6506('0xe')](_0x6506('0xf'),_0x4a3191,_0x6506('0x10'));logger[_0x6506('0x11')](_0x6506('0x12'),_0x4a3191,_0x6506('0x10'),JSON[_0x6506('0x13')](_0x276d86));if(_0x276d86[_0x6506('0x14')]){if(_0x276d86[_0x6506('0x14')]['code']===0x1f4){logger['error'](_0x6506('0xf'),_0x4a3191,_0x276d86[_0x6506('0x14')][_0x6506('0x15')]);return _0x374718(_0x276d86['error'][_0x6506('0x15')]);}logger['error'](_0x6506('0xf'),_0x4a3191,_0x276d86[_0x6506('0x14')]['message']);return _0x5ca913(_0x276d86[_0x6506('0x14')][_0x6506('0x15')]);}else{logger[_0x6506('0xe')](_0x6506('0xf'),_0x4a3191,_0x6506('0x10'));_0x5ca913(_0x276d86[_0x6506('0x16')][_0x6506('0x15')]);}})[_0x6506('0x17')](function(_0x2b59fd){logger[_0x6506('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x4a3191,_0x2b59fd);_0x374718(_0x2b59fd);});});}exports[_0x6506('0x18')]=function(_0x429396){var _0x2dc91b=this;return new Promise(function(_0x59f433,_0x5517d3){return db[_0x6506('0x19')][_0x6506('0x1a')](_0x429396[_0x6506('0x1b')],{'raw':_0x429396['options']?_0x429396['options'][_0x6506('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x51572c){logger[_0x6506('0xe')](_0x6506('0x18'),_0x429396);logger[_0x6506('0x11')](_0x6506('0x18'),_0x429396,JSON[_0x6506('0x13')](_0x51572c));_0x59f433(_0x51572c);})[_0x6506('0x17')](function(_0x1c37fa){logger[_0x6506('0x14')](_0x6506('0x18'),_0x1c37fa[_0x6506('0x15')],_0x429396);_0x5517d3(_0x2dc91b[_0x6506('0x14')](0x1f4,_0x1c37fa[_0x6506('0x15')]));});});};exports['UpdateChatQueueReport']=function(_0x3bc6b5){var _0x2b4437=this;return new Promise(function(_0x477805,_0x3e6d7a){return db[_0x6506('0x19')]['update'](_0x3bc6b5[_0x6506('0x1b')],{'raw':_0x3bc6b5[_0x6506('0x1d')]?_0x3bc6b5[_0x6506('0x1d')][_0x6506('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bc6b5[_0x6506('0x1d')]?_0x3bc6b5[_0x6506('0x1d')][_0x6506('0x1e')]||null:null,'attributes':_0x3bc6b5[_0x6506('0x1d')]?_0x3bc6b5[_0x6506('0x1d')][_0x6506('0x1f')]||null:null,'limit':_0x3bc6b5[_0x6506('0x1d')]?_0x3bc6b5[_0x6506('0x1d')]['limit']||null:null})[_0x6506('0xd')](function(_0x5986b6){logger['info'](_0x6506('0x20'),_0x3bc6b5);logger[_0x6506('0x11')](_0x6506('0x20'),_0x3bc6b5,JSON[_0x6506('0x13')](_0x5986b6));_0x477805(_0x5986b6);})[_0x6506('0x17')](function(_0xed9a88){logger[_0x6506('0x14')](_0x6506('0x20'),_0xed9a88['message'],_0x3bc6b5);_0x3e6d7a(_0x2b4437['error'](0x1f4,_0xed9a88[_0x6506('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 3090869..e1336c1 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 _0xde76=['update','delete','util','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put'];(function(_0x52d797,_0x4d28b2){var _0x147d12=function(_0x5a11ac){while(--_0x5a11ac){_0x52d797['push'](_0x52d797['shift']());}};_0x147d12(++_0x4d28b2);}(_0xde76,0x112));var _0x6de7=function(_0x208ef0,_0x3d81b4){_0x208ef0=_0x208ef0-0x0;var _0x4422e6=_0xde76[_0x208ef0];return _0x4422e6;};'use strict';var multer=require('multer');var util=require(_0x6de7('0x0'));var path=require('path');var timeout=require(_0x6de7('0x1'));var express=require(_0x6de7('0x2'));var router=express[_0x6de7('0x3')]();var fs_extra=require(_0x6de7('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6de7('0x5'));var controller=require('./chatQueueReport.controller');router[_0x6de7('0x6')]('/',auth[_0x6de7('0x7')](),controller[_0x6de7('0x8')]);router[_0x6de7('0x6')](_0x6de7('0x9'),auth[_0x6de7('0x7')](),controller[_0x6de7('0xa')]);router[_0x6de7('0x6')](_0x6de7('0xb'),auth[_0x6de7('0x7')](),controller['show']);router[_0x6de7('0xc')]('/',auth['isAuthenticated'](),controller[_0x6de7('0xd')]);router[_0x6de7('0xe')]('/:id',auth[_0x6de7('0x7')](),controller[_0x6de7('0xf')]);router[_0x6de7('0x10')](_0x6de7('0xb'),auth[_0x6de7('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbe44=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x579e76,_0x13b9fe){var _0x532e25=function(_0x42cd6d){while(--_0x42cd6d){_0x579e76['push'](_0x579e76['shift']());}};_0x532e25(++_0x13b9fe);}(_0xbe44,0x175));var _0x4be4=function(_0x511d5c,_0x4d44a0){_0x511d5c=_0x511d5c-0x0;var _0x128d3b=_0xbe44[_0x511d5c];return _0x128d3b;};'use strict';var multer=require(_0x4be4('0x0'));var util=require('util');var path=require(_0x4be4('0x1'));var timeout=require(_0x4be4('0x2'));var express=require(_0x4be4('0x3'));var router=express[_0x4be4('0x4')]();var fs_extra=require(_0x4be4('0x5'));var auth=require(_0x4be4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4be4('0x7'));var controller=require(_0x4be4('0x8'));router[_0x4be4('0x9')]('/',auth['isAuthenticated'](),controller[_0x4be4('0xa')]);router[_0x4be4('0x9')](_0x4be4('0xb'),auth[_0x4be4('0xc')](),controller['describe']);router[_0x4be4('0x9')](_0x4be4('0xd'),auth[_0x4be4('0xc')](),controller[_0x4be4('0xe')]);router[_0x4be4('0xf')]('/',auth[_0x4be4('0xc')](),controller[_0x4be4('0x10')]);router[_0x4be4('0x11')](_0x4be4('0xd'),auth['isAuthenticated'](),controller[_0x4be4('0x12')]);router[_0x4be4('0x13')](_0x4be4('0xd'),auth[_0x4be4('0xc')](),controller[_0x4be4('0x14')]);module[_0x4be4('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 862ef7b..ee3e7d5 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x50e872,_0x4735f9){var _0x9acdac=function(_0xc845c0){while(--_0xc845c0){_0x50e872['push'](_0x50e872['shift']());}};_0x9acdac(++_0x4735f9);}(_0x00bb,0x1d8));var _0xb00b=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x00bb[_0x134c2e];return _0x2825db;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0xf3d3d,_0x18c710){var _0x1e5511=function(_0x2b25e9){while(--_0x2b25e9){_0xf3d3d['push'](_0xf3d3d['shift']());}};_0x1e5511(++_0x18c710);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index cc4f873..af981bb 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 _0x88ee=['fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','options','find','create','body','params','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','map','ChatTransferReport','fieldName','type','key','keys','query','filters','model','attributes','intersection'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x88ee,0x1d2));var _0xe88e=function(_0x3a206c,_0x16eee5){_0x3a206c=_0x3a206c-0x0;var _0x8e1108=_0x88ee[_0x3a206c];return _0x8e1108;};'use strict';var emlformat=require(_0xe88e('0x0'));var rimraf=require(_0xe88e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe88e('0x2'));var moment=require('moment');var BPromise=require(_0xe88e('0x3'));var Mustache=require(_0xe88e('0x4'));var util=require(_0xe88e('0x5'));var path=require('path');var sox=require(_0xe88e('0x6'));var csv=require('to-csv');var ejs=require(_0xe88e('0x7'));var fs=require('fs');var fs_extra=require(_0xe88e('0x8'));var _=require('lodash');var squel=require(_0xe88e('0x9'));var crypto=require(_0xe88e('0xa'));var jsforce=require(_0xe88e('0xb'));var deskjs=require(_0xe88e('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe88e('0xd'));var Papa=require('papaparse');var Redis=require(_0xe88e('0xe'));var authService=require(_0xe88e('0xf'));var qs=require(_0xe88e('0x10'));var as=require(_0xe88e('0x11'));var hardwareService=require(_0xe88e('0x12'));var logger=require('../../config/logger')(_0xe88e('0x13'));var utils=require(_0xe88e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe88e('0x15'));var db=require(_0xe88e('0x16'))['db'];function respondWithStatusCode(_0x30d80c,_0xeb450e){_0xeb450e=_0xeb450e||0xcc;return function(_0x2dd02f){if(_0x2dd02f){return _0x30d80c[_0xe88e('0x17')](_0xeb450e);}return _0x30d80c[_0xe88e('0x18')](_0xeb450e)[_0xe88e('0x19')]();};}function respondWithResult(_0x21968e,_0x56fef8){_0x56fef8=_0x56fef8||0xc8;return function(_0x42d715){if(_0x42d715){return _0x21968e[_0xe88e('0x18')](_0x56fef8)[_0xe88e('0x1a')](_0x42d715);}};}function respondWithFilteredResult(_0x23138d,_0x22fbc2){return function(_0x552b89){if(_0x552b89){var _0xf40036=typeof _0x22fbc2[_0xe88e('0x1b')]===_0xe88e('0x1c')&&typeof _0x22fbc2[_0xe88e('0x1d')]===_0xe88e('0x1c');var _0x6ba0ae=_0x552b89[_0xe88e('0x1e')];var _0x1e1af8=_0xf40036?0x0:_0x22fbc2['offset'];var _0x331e9b=_0xf40036?_0x552b89[_0xe88e('0x1e')]:_0x22fbc2[_0xe88e('0x1b')]+_0x22fbc2[_0xe88e('0x1d')];var _0x1546ff;if(_0x331e9b>=_0x6ba0ae){_0x331e9b=_0x6ba0ae;_0x1546ff=0xc8;}else{_0x1546ff=0xce;}_0x23138d[_0xe88e('0x18')](_0x1546ff);return _0x23138d[_0xe88e('0x1f')](_0xe88e('0x20'),_0x1e1af8+'-'+_0x331e9b+'/'+_0x6ba0ae)[_0xe88e('0x1a')](_0x552b89);}return null;};}function patchUpdates(_0x3fe5cb){return function(_0x2b76d3){try{jsonpatch['apply'](_0x2b76d3,_0x3fe5cb,!![]);}catch(_0x78cb38){return BPromise[_0xe88e('0x21')](_0x78cb38);}return _0x2b76d3[_0xe88e('0x22')]();};}function saveUpdates(_0xcb4593,_0xf42e3c){return function(_0x1f4629){if(_0x1f4629){return _0x1f4629[_0xe88e('0x23')](_0xcb4593)[_0xe88e('0x24')](function(_0x370283){return _0x370283;});}return null;};}function removeEntity(_0x495c05,_0xe3d5f8){return function(_0xdad268){if(_0xdad268){return _0xdad268[_0xe88e('0x25')]()['then'](function(){_0x495c05[_0xe88e('0x18')](0xcc)[_0xe88e('0x19')]();});}};}function handleEntityNotFound(_0x11eecb,_0x7203bb){return function(_0x513c4d){if(!_0x513c4d){_0x11eecb[_0xe88e('0x17')](0x194);}return _0x513c4d;};}function handleError(_0x4c98b7,_0x3b2504){_0x3b2504=_0x3b2504||0x1f4;return function(_0xa7ee2a){logger[_0xe88e('0x26')](_0xa7ee2a[_0xe88e('0x27')]);if(_0xa7ee2a[_0xe88e('0x28')]){delete _0xa7ee2a['name'];}_0x4c98b7[_0xe88e('0x18')](_0x3b2504)['send'](_0xa7ee2a);};}exports['index']=function(_0x2f3526,_0x343759){var _0x4d8560={},_0x577aae={},_0x2b5872={'count':0x0,'rows':[]};var _0x3bbc97=_[_0xe88e('0x29')](db[_0xe88e('0x2a')]['rawAttributes'],function(_0x260d89){return{'name':_0x260d89[_0xe88e('0x2b')],'type':_0x260d89[_0xe88e('0x2c')][_0xe88e('0x2d')]};});_0x577aae['model']=_[_0xe88e('0x29')](_0x3bbc97,_0xe88e('0x28'));_0x577aae['query']=_[_0xe88e('0x2e')](_0x2f3526[_0xe88e('0x2f')]);_0x577aae[_0xe88e('0x30')]=_['intersection'](_0x577aae[_0xe88e('0x31')],_0x577aae[_0xe88e('0x2f')]);_0x4d8560[_0xe88e('0x32')]=_[_0xe88e('0x33')](_0x577aae[_0xe88e('0x31')],qs['fields'](_0x2f3526[_0xe88e('0x2f')][_0xe88e('0x34')]));_0x4d8560[_0xe88e('0x32')]=_0x4d8560[_0xe88e('0x32')]['length']?_0x4d8560[_0xe88e('0x32')]:_0x577aae[_0xe88e('0x31')];if(!_0x2f3526['query']['hasOwnProperty'](_0xe88e('0x35'))){_0x4d8560[_0xe88e('0x1d')]=qs[_0xe88e('0x1d')](_0x2f3526[_0xe88e('0x2f')][_0xe88e('0x1d')]);_0x4d8560[_0xe88e('0x1b')]=qs[_0xe88e('0x1b')](_0x2f3526[_0xe88e('0x2f')][_0xe88e('0x1b')]);}_0x4d8560[_0xe88e('0x36')]=qs[_0xe88e('0x37')](_0x2f3526[_0xe88e('0x2f')][_0xe88e('0x37')]);_0x4d8560[_0xe88e('0x38')]=qs['filters'](_[_0xe88e('0x39')](_0x2f3526[_0xe88e('0x2f')],_0x577aae['filters']),_0x3bbc97);if(_0x2f3526[_0xe88e('0x2f')][_0xe88e('0x3a')]){_0x4d8560[_0xe88e('0x38')]=_[_0xe88e('0x3b')](_0x4d8560[_0xe88e('0x38')],{'$or':_['map'](_0x3bbc97,function(_0x49bca7){if(_0x49bca7[_0xe88e('0x2c')]!==_0xe88e('0x3c')){var _0x1cc035={};_0x1cc035[_0x49bca7['name']]={'$like':'%'+_0x2f3526[_0xe88e('0x2f')][_0xe88e('0x3a')]+'%'};return _0x1cc035;}})});}_0x4d8560=_[_0xe88e('0x3b')]({},_0x4d8560,_0x2f3526['options']);var _0x65b88e={'where':_0x4d8560['where']};return db[_0xe88e('0x2a')][_0xe88e('0x1e')](_0x65b88e)['then'](function(_0x105b84){_0x2b5872['count']=_0x105b84;if(_0x2f3526['query'][_0xe88e('0x3d')]){_0x4d8560[_0xe88e('0x3e')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xe88e('0x3f')](_0x4d8560);})[_0xe88e('0x24')](function(_0x5190c5){_0x2b5872[_0xe88e('0x40')]=_0x5190c5;return _0x2b5872;})[_0xe88e('0x24')](respondWithFilteredResult(_0x343759,_0x4d8560))[_0xe88e('0x41')](handleError(_0x343759,null));};exports[_0xe88e('0x42')]=function(_0x11e561,_0x4fd6ff){var _0x585a11={'raw':!![],'where':{'id':_0x11e561['params']['id']}},_0x46504c={};_0x46504c[_0xe88e('0x31')]=_[_0xe88e('0x2e')](db['ChatTransferReport']['rawAttributes']);_0x46504c[_0xe88e('0x2f')]=_[_0xe88e('0x2e')](_0x11e561[_0xe88e('0x2f')]);_0x46504c[_0xe88e('0x30')]=_[_0xe88e('0x33')](_0x46504c[_0xe88e('0x31')],_0x46504c[_0xe88e('0x2f')]);_0x585a11[_0xe88e('0x32')]=_[_0xe88e('0x33')](_0x46504c[_0xe88e('0x31')],qs['fields'](_0x11e561['query']['fields']));_0x585a11[_0xe88e('0x32')]=_0x585a11[_0xe88e('0x32')][_0xe88e('0x43')]?_0x585a11[_0xe88e('0x32')]:_0x46504c[_0xe88e('0x31')];if(_0x11e561[_0xe88e('0x2f')][_0xe88e('0x3d')]){_0x585a11['include']=[{'all':!![]}];}_0x585a11=_['merge']({},_0x585a11,_0x11e561[_0xe88e('0x44')]);return db[_0xe88e('0x2a')][_0xe88e('0x45')](_0x585a11)[_0xe88e('0x24')](handleEntityNotFound(_0x4fd6ff,null))[_0xe88e('0x24')](respondWithResult(_0x4fd6ff,null))['catch'](handleError(_0x4fd6ff,null));};exports['create']=function(_0x599f32,_0x518e1b){return db[_0xe88e('0x2a')][_0xe88e('0x46')](_0x599f32[_0xe88e('0x47')],{})[_0xe88e('0x24')](respondWithResult(_0x518e1b,0xc9))['catch'](handleError(_0x518e1b,null));};exports[_0xe88e('0x23')]=function(_0x21ce71,_0xcf43e7){if(_0x21ce71[_0xe88e('0x47')]['id']){delete _0x21ce71[_0xe88e('0x47')]['id'];}return db[_0xe88e('0x2a')][_0xe88e('0x45')]({'where':{'id':_0x21ce71['params']['id']}})['then'](handleEntityNotFound(_0xcf43e7,null))[_0xe88e('0x24')](saveUpdates(_0x21ce71['body'],null))['then'](respondWithResult(_0xcf43e7,null))['catch'](handleError(_0xcf43e7,null));};exports[_0xe88e('0x25')]=function(_0xba84c,_0x176517){return db['ChatTransferReport'][_0xe88e('0x45')]({'where':{'id':_0xba84c[_0xe88e('0x48')]['id']}})['then'](handleEntityNotFound(_0x176517,null))['then'](removeEntity(_0x176517,null))[_0xe88e('0x41')](handleError(_0x176517,null));};exports['describe']=function(_0x4f4b8f,_0x375b06){return db[_0xe88e('0x2a')][_0xe88e('0x49')]()['then'](respondWithResult(_0x375b06,null))['catch'](handleError(_0x375b06,null));}; \ No newline at end of file +var _0x7f07=['model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','findAll','catch','params','fields','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','json','undefined','count','offset','limit','status','Content-Range','reject','save','update','destroy','then','sendStatus','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7f07,0x1d0));var _0x77f0=function(_0x32f6b9,_0x2d4aa9){_0x32f6b9=_0x32f6b9-0x0;var _0x267d52=_0x7f07[_0x32f6b9];return _0x267d52;};'use strict';var emlformat=require(_0x77f0('0x0'));var rimraf=require(_0x77f0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x77f0('0x2'));var rp=require(_0x77f0('0x3'));var moment=require(_0x77f0('0x4'));var BPromise=require(_0x77f0('0x5'));var Mustache=require(_0x77f0('0x6'));var util=require(_0x77f0('0x7'));var path=require('path');var sox=require(_0x77f0('0x8'));var csv=require(_0x77f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x77f0('0xa'));var _=require(_0x77f0('0xb'));var squel=require(_0x77f0('0xc'));var crypto=require(_0x77f0('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x77f0('0x9'));var querystring=require(_0x77f0('0xe'));var Papa=require(_0x77f0('0xf'));var Redis=require(_0x77f0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x77f0('0x11'));var as=require(_0x77f0('0x12'));var hardwareService=require(_0x77f0('0x13'));var logger=require(_0x77f0('0x14'))(_0x77f0('0x15'));var utils=require(_0x77f0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x77f0('0x17'));var db=require(_0x77f0('0x18'))['db'];function respondWithStatusCode(_0xe6402c,_0x55cec6){_0x55cec6=_0x55cec6||0xcc;return function(_0xb8a810){if(_0xb8a810){return _0xe6402c['sendStatus'](_0x55cec6);}return _0xe6402c['status'](_0x55cec6)[_0x77f0('0x19')]();};}function respondWithResult(_0x27329b,_0x335e53){_0x335e53=_0x335e53||0xc8;return function(_0x20de43){if(_0x20de43){return _0x27329b['status'](_0x335e53)[_0x77f0('0x1a')](_0x20de43);}};}function respondWithFilteredResult(_0x2474b5,_0xf74c3){return function(_0x281ea2){if(_0x281ea2){var _0xfc507=typeof _0xf74c3['offset']==='undefined'&&typeof _0xf74c3['limit']===_0x77f0('0x1b');var _0x313fd8=_0x281ea2[_0x77f0('0x1c')];var _0x4b4053=_0xfc507?0x0:_0xf74c3[_0x77f0('0x1d')];var _0x4759a4=_0xfc507?_0x281ea2['count']:_0xf74c3[_0x77f0('0x1d')]+_0xf74c3[_0x77f0('0x1e')];var _0x44d9f3;if(_0x4759a4>=_0x313fd8){_0x4759a4=_0x313fd8;_0x44d9f3=0xc8;}else{_0x44d9f3=0xce;}_0x2474b5[_0x77f0('0x1f')](_0x44d9f3);return _0x2474b5['set'](_0x77f0('0x20'),_0x4b4053+'-'+_0x4759a4+'/'+_0x313fd8)[_0x77f0('0x1a')](_0x281ea2);}return null;};}function patchUpdates(_0x39b252){return function(_0x1d9142){try{jsonpatch['apply'](_0x1d9142,_0x39b252,!![]);}catch(_0xffb21f){return BPromise[_0x77f0('0x21')](_0xffb21f);}return _0x1d9142[_0x77f0('0x22')]();};}function saveUpdates(_0x202c3e,_0x5acb54){return function(_0x42930b){if(_0x42930b){return _0x42930b[_0x77f0('0x23')](_0x202c3e)['then'](function(_0x25e23e){return _0x25e23e;});}return null;};}function removeEntity(_0x5d0223,_0x14dbec){return function(_0x5e3b1f){if(_0x5e3b1f){return _0x5e3b1f[_0x77f0('0x24')]()[_0x77f0('0x25')](function(){_0x5d0223[_0x77f0('0x1f')](0xcc)[_0x77f0('0x19')]();});}};}function handleEntityNotFound(_0x57f4e2,_0x373fea){return function(_0x3cc93e){if(!_0x3cc93e){_0x57f4e2[_0x77f0('0x26')](0x194);}return _0x3cc93e;};}function handleError(_0x91400f,_0xa4629){_0xa4629=_0xa4629||0x1f4;return function(_0x5ec4b3){logger['error'](_0x5ec4b3[_0x77f0('0x27')]);if(_0x5ec4b3[_0x77f0('0x28')]){delete _0x5ec4b3['name'];}_0x91400f['status'](_0xa4629)[_0x77f0('0x29')](_0x5ec4b3);};}exports[_0x77f0('0x2a')]=function(_0x4bc0ce,_0x132221){var _0x1c3713={},_0x1a1668={},_0x448a20={'count':0x0,'rows':[]};var _0x1d6ce6=_[_0x77f0('0x2b')](db[_0x77f0('0x2c')][_0x77f0('0x2d')],function(_0x55df40){return{'name':_0x55df40[_0x77f0('0x2e')],'type':_0x55df40['type']['key']};});_0x1a1668[_0x77f0('0x2f')]=_['map'](_0x1d6ce6,'name');_0x1a1668[_0x77f0('0x30')]=_[_0x77f0('0x31')](_0x4bc0ce[_0x77f0('0x30')]);_0x1a1668[_0x77f0('0x32')]=_[_0x77f0('0x33')](_0x1a1668[_0x77f0('0x2f')],_0x1a1668[_0x77f0('0x30')]);_0x1c3713[_0x77f0('0x34')]=_[_0x77f0('0x33')](_0x1a1668[_0x77f0('0x2f')],qs['fields'](_0x4bc0ce[_0x77f0('0x30')]['fields']));_0x1c3713['attributes']=_0x1c3713[_0x77f0('0x34')][_0x77f0('0x35')]?_0x1c3713['attributes']:_0x1a1668['model'];if(!_0x4bc0ce[_0x77f0('0x30')][_0x77f0('0x36')](_0x77f0('0x37'))){_0x1c3713[_0x77f0('0x1e')]=qs['limit'](_0x4bc0ce[_0x77f0('0x30')]['limit']);_0x1c3713[_0x77f0('0x1d')]=qs['offset'](_0x4bc0ce[_0x77f0('0x30')]['offset']);}_0x1c3713[_0x77f0('0x38')]=qs[_0x77f0('0x39')](_0x4bc0ce[_0x77f0('0x30')][_0x77f0('0x39')]);_0x1c3713[_0x77f0('0x3a')]=qs['filters'](_['pick'](_0x4bc0ce[_0x77f0('0x30')],_0x1a1668['filters']),_0x1d6ce6);if(_0x4bc0ce[_0x77f0('0x30')][_0x77f0('0x3b')]){_0x1c3713[_0x77f0('0x3a')]=_[_0x77f0('0x3c')](_0x1c3713[_0x77f0('0x3a')],{'$or':_[_0x77f0('0x2b')](_0x1d6ce6,function(_0x532907){if(_0x532907[_0x77f0('0x3d')]!==_0x77f0('0x3e')){var _0x190fd5={};_0x190fd5[_0x532907['name']]={'$like':'%'+_0x4bc0ce[_0x77f0('0x30')][_0x77f0('0x3b')]+'%'};return _0x190fd5;}})});}_0x1c3713=_[_0x77f0('0x3c')]({},_0x1c3713,_0x4bc0ce['options']);var _0x42b81a={'where':_0x1c3713[_0x77f0('0x3a')]};return db[_0x77f0('0x2c')]['count'](_0x42b81a)['then'](function(_0x4e93e4){_0x448a20[_0x77f0('0x1c')]=_0x4e93e4;if(_0x4bc0ce[_0x77f0('0x30')][_0x77f0('0x3f')]){_0x1c3713['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x77f0('0x40')](_0x1c3713);})[_0x77f0('0x25')](function(_0x104289){_0x448a20['rows']=_0x104289;return _0x448a20;})[_0x77f0('0x25')](respondWithFilteredResult(_0x132221,_0x1c3713))[_0x77f0('0x41')](handleError(_0x132221,null));};exports['show']=function(_0x362341,_0x2b03d){var _0x5815ed={'raw':!![],'where':{'id':_0x362341[_0x77f0('0x42')]['id']}},_0x27082c={};_0x27082c['model']=_['keys'](db[_0x77f0('0x2c')][_0x77f0('0x2d')]);_0x27082c[_0x77f0('0x30')]=_[_0x77f0('0x31')](_0x362341['query']);_0x27082c['filters']=_['intersection'](_0x27082c[_0x77f0('0x2f')],_0x27082c[_0x77f0('0x30')]);_0x5815ed[_0x77f0('0x34')]=_[_0x77f0('0x33')](_0x27082c[_0x77f0('0x2f')],qs['fields'](_0x362341[_0x77f0('0x30')][_0x77f0('0x43')]));_0x5815ed['attributes']=_0x5815ed[_0x77f0('0x34')][_0x77f0('0x35')]?_0x5815ed[_0x77f0('0x34')]:_0x27082c[_0x77f0('0x2f')];if(_0x362341['query'][_0x77f0('0x3f')]){_0x5815ed['include']=[{'all':!![]}];}_0x5815ed=_[_0x77f0('0x3c')]({},_0x5815ed,_0x362341[_0x77f0('0x44')]);return db[_0x77f0('0x2c')][_0x77f0('0x45')](_0x5815ed)[_0x77f0('0x25')](handleEntityNotFound(_0x2b03d,null))[_0x77f0('0x25')](respondWithResult(_0x2b03d,null))[_0x77f0('0x41')](handleError(_0x2b03d,null));};exports[_0x77f0('0x46')]=function(_0x253f68,_0x18588c){return db[_0x77f0('0x2c')][_0x77f0('0x46')](_0x253f68[_0x77f0('0x47')],{})['then'](respondWithResult(_0x18588c,0xc9))[_0x77f0('0x41')](handleError(_0x18588c,null));};exports[_0x77f0('0x23')]=function(_0x9a1a76,_0x3413aa){if(_0x9a1a76[_0x77f0('0x47')]['id']){delete _0x9a1a76[_0x77f0('0x47')]['id'];}return db['ChatTransferReport'][_0x77f0('0x45')]({'where':{'id':_0x9a1a76[_0x77f0('0x42')]['id']}})[_0x77f0('0x25')](handleEntityNotFound(_0x3413aa,null))['then'](saveUpdates(_0x9a1a76[_0x77f0('0x47')],null))[_0x77f0('0x25')](respondWithResult(_0x3413aa,null))[_0x77f0('0x41')](handleError(_0x3413aa,null));};exports[_0x77f0('0x24')]=function(_0x40ffdd,_0x5e8979){return db['ChatTransferReport']['find']({'where':{'id':_0x40ffdd[_0x77f0('0x42')]['id']}})[_0x77f0('0x25')](handleEntityNotFound(_0x5e8979,null))['then'](removeEntity(_0x5e8979,null))[_0x77f0('0x41')](handleError(_0x5e8979,null));};exports[_0x77f0('0x48')]=function(_0x5bd32a,_0x22001c){return db[_0x77f0('0x2c')][_0x77f0('0x48')]()['then'](respondWithResult(_0x22001c,null))['catch'](handleError(_0x22001c,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 685fe41..aca0446 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 _0x66f6=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports'];(function(_0x267d23,_0x5deabf){var _0x1005ed=function(_0x569fcc){while(--_0x569fcc){_0x267d23['push'](_0x267d23['shift']());}};_0x1005ed(++_0x5deabf);}(_0x66f6,0x1b1));var _0x666f=function(_0x18653b,_0x4b27b2){_0x18653b=_0x18653b-0x0;var _0x3b5498=_0x66f6[_0x18653b];return _0x3b5498;};'use strict';var _=require(_0x666f('0x0'));var util=require(_0x666f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x666f('0x2'));var BPromise=require('bluebird');var rp=require(_0x666f('0x3'));var fs=require('fs');var path=require(_0x666f('0x4'));var rimraf=require(_0x666f('0x5'));var config=require(_0x666f('0x6'));var attributes=require(_0x666f('0x7'));module[_0x666f('0x8')]=function(_0x5eae52,_0x2bba3a){return _0x5eae52[_0x666f('0x9')](_0x666f('0xa'),attributes,{'tableName':_0x666f('0xb'),'paranoid':![],'indexes':[{'name':_0x666f('0xc'),'fields':[_0x666f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe76d=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports'];(function(_0x307d9f,_0x231547){var _0x59dac4=function(_0x4f50c8){while(--_0x4f50c8){_0x307d9f['push'](_0x307d9f['shift']());}};_0x59dac4(++_0x231547);}(_0xe76d,0x1cb));var _0xde76=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xe76d[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0xde76('0x0'));var util=require('util');var logger=require(_0xde76('0x1'))('api');var moment=require(_0xde76('0x2'));var BPromise=require(_0xde76('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xde76('0x4'));var rimraf=require(_0xde76('0x5'));var config=require(_0xde76('0x6'));var attributes=require(_0xde76('0x7'));module[_0xde76('0x8')]=function(_0x4dc7aa,_0x39d111){return _0x4dc7aa[_0xde76('0x9')](_0xde76('0xa'),attributes,{'tableName':_0xde76('0xb'),'paranoid':![],'indexes':[{'name':_0xde76('0xc'),'fields':[_0xde76('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 791e36b..f2b7be9 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 _0x6c89=['../../config/environment','jayson/promise','client','request','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','ioredis','../../config/logger','rpc'];(function(_0x1f8469,_0x457bc7){var _0x450377=function(_0x34fc81){while(--_0x34fc81){_0x1f8469['push'](_0x1f8469['shift']());}};_0x450377(++_0x457bc7);}(_0x6c89,0x118));var _0x96c8=function(_0x2e9bbb,_0x2d4412){_0x2e9bbb=_0x2e9bbb-0x0;var _0x464295=_0x6c89[_0x2e9bbb];return _0x464295;};'use strict';var _=require('lodash');var util=require(_0x96c8('0x0'));var moment=require(_0x96c8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x96c8('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x96c8('0x3'))(_0x96c8('0x4'));var config=require(_0x96c8('0x5'));var jayson=require(_0x96c8('0x6'));var client=jayson[_0x96c8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39e7ed,_0x4e0b7c,_0x51ae0c){return new BPromise(function(_0x389518,_0x48156a){return client[_0x96c8('0x8')](_0x39e7ed,_0x51ae0c)['then'](function(_0x41f41c){logger[_0x96c8('0x9')](_0x96c8('0xa'),_0x4e0b7c,'request\x20sent');logger[_0x96c8('0xb')](_0x96c8('0xc'),_0x4e0b7c,_0x96c8('0xd'),JSON[_0x96c8('0xe')](_0x41f41c));if(_0x41f41c[_0x96c8('0xf')]){if(_0x41f41c[_0x96c8('0xf')][_0x96c8('0x10')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x4e0b7c,_0x41f41c[_0x96c8('0xf')]['message']);return _0x48156a(_0x41f41c['error'][_0x96c8('0x11')]);}logger['error'](_0x96c8('0xa'),_0x4e0b7c,_0x41f41c[_0x96c8('0xf')][_0x96c8('0x11')]);return _0x389518(_0x41f41c[_0x96c8('0xf')][_0x96c8('0x11')]);}else{logger[_0x96c8('0x9')](_0x96c8('0xa'),_0x4e0b7c,_0x96c8('0xd'));_0x389518(_0x41f41c[_0x96c8('0x12')][_0x96c8('0x11')]);}})['catch'](function(_0x4743d2){logger[_0x96c8('0xf')](_0x96c8('0xa'),_0x4e0b7c,_0x4743d2);_0x48156a(_0x4743d2);});});} \ No newline at end of file +var _0xa61d=['jayson/promise','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x119739,_0x250ebb){var _0x1fc8e5=function(_0x34eaef){while(--_0x34eaef){_0x119739['push'](_0x119739['shift']());}};_0x1fc8e5(++_0x250ebb);}(_0xa61d,0xfe));var _0xda61=function(_0x8f4ca2,_0xc4ac52){_0x8f4ca2=_0x8f4ca2-0x0;var _0x126663=_0xa61d[_0x8f4ca2];return _0x126663;};'use strict';var _=require(_0xda61('0x0'));var util=require(_0xda61('0x1'));var moment=require(_0xda61('0x2'));var BPromise=require(_0xda61('0x3'));var rs=require(_0xda61('0x4'));var fs=require('fs');var Redis=require(_0xda61('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xda61('0x6'));var logger=require(_0xda61('0x7'))(_0xda61('0x8'));var config=require(_0xda61('0x9'));var jayson=require(_0xda61('0xa'));var client=jayson['client'][_0xda61('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fd5d3,_0x2555bf,_0x7de2b3){return new BPromise(function(_0x2024af,_0x13e822){return client[_0xda61('0xc')](_0x3fd5d3,_0x7de2b3)[_0xda61('0xd')](function(_0x3a1d44){logger[_0xda61('0xe')](_0xda61('0xf'),_0x2555bf,_0xda61('0x10'));logger[_0xda61('0x11')](_0xda61('0x12'),_0x2555bf,_0xda61('0x10'),JSON[_0xda61('0x13')](_0x3a1d44));if(_0x3a1d44[_0xda61('0x14')]){if(_0x3a1d44[_0xda61('0x14')][_0xda61('0x15')]===0x1f4){logger[_0xda61('0x14')](_0xda61('0xf'),_0x2555bf,_0x3a1d44['error'][_0xda61('0x16')]);return _0x13e822(_0x3a1d44[_0xda61('0x14')][_0xda61('0x16')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x2555bf,_0x3a1d44['error'][_0xda61('0x16')]);return _0x2024af(_0x3a1d44[_0xda61('0x14')][_0xda61('0x16')]);}else{logger[_0xda61('0xe')](_0xda61('0xf'),_0x2555bf,_0xda61('0x10'));_0x2024af(_0x3a1d44['result'][_0xda61('0x16')]);}})[_0xda61('0x17')](function(_0x3c9597){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x2555bf,_0x3c9597);_0x13e822(_0x3c9597);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 3a6a4a3..77e338e 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 _0x8fdd=['../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','path','Router','fs-extra','../../components/interaction/service'];(function(_0x1bd155,_0xab1239){var _0x3b67e9=function(_0x299967){while(--_0x299967){_0x1bd155['push'](_0x1bd155['shift']());}};_0x3b67e9(++_0xab1239);}(_0x8fdd,0x177));var _0xd8fd=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x8fdd[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0xd8fd('0x0'));var util=require('util');var path=require(_0xd8fd('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd8fd('0x2')]();var fs_extra=require(_0xd8fd('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd8fd('0x4'));var config=require(_0xd8fd('0x5'));var controller=require(_0xd8fd('0x6'));router[_0xd8fd('0x7')]('/',auth[_0xd8fd('0x8')](),controller[_0xd8fd('0x9')]);router[_0xd8fd('0x7')](_0xd8fd('0xa'),auth['isAuthenticated'](),controller[_0xd8fd('0xb')]);router[_0xd8fd('0x7')](_0xd8fd('0xc'),auth[_0xd8fd('0x8')](),controller[_0xd8fd('0xd')]);router['post']('/',auth[_0xd8fd('0x8')](),controller[_0xd8fd('0xe')]);router[_0xd8fd('0xf')](_0xd8fd('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xd8fd('0x10')](_0xd8fd('0xc'),auth['isAuthenticated'](),controller[_0xd8fd('0x11')]);module[_0xd8fd('0x12')]=router; \ No newline at end of file +var _0x4865=['/describe','/:id','create','put','delete','destroy','exports','multer','util','path','express','Router','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index'];(function(_0x3f6e77,_0x443be1){var _0x3b8ef1=function(_0xbdbf95){while(--_0xbdbf95){_0x3f6e77['push'](_0x3f6e77['shift']());}};_0x3b8ef1(++_0x443be1);}(_0x4865,0x1c1));var _0x5486=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4865[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x5486('0x0'));var util=require(_0x5486('0x1'));var path=require(_0x5486('0x2'));var timeout=require('connect-timeout');var express=require(_0x5486('0x3'));var router=express[_0x5486('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5486('0x5'));var controller=require(_0x5486('0x6'));router[_0x5486('0x7')]('/',auth[_0x5486('0x8')](),controller[_0x5486('0x9')]);router[_0x5486('0x7')](_0x5486('0xa'),auth[_0x5486('0x8')](),controller['describe']);router[_0x5486('0x7')](_0x5486('0xb'),auth[_0x5486('0x8')](),controller['show']);router['post']('/',auth[_0x5486('0x8')](),controller[_0x5486('0xc')]);router[_0x5486('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5486('0xe')](_0x5486('0xb'),auth['isAuthenticated'](),controller[_0x5486('0xf')]);module[_0x5486('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index e4d1229..b66f8a4 100644 --- a/server/api/chatWebsite/chatWebsite.attributes.js +++ b/server/api/chatWebsite/chatWebsite.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee5b=['rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','text','setDataValue','onlineForm','TEXT','textarea','Comments','getDataValue','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#ffffff','INTEGER','BOOLEAN','ENUM'];(function(_0x4a7ab0,_0x5b4374){var _0x2ba110=function(_0x51a6da){while(--_0x51a6da){_0x4a7ab0['push'](_0x4a7ab0['shift']());}};_0x2ba110(++_0x5b4374);}(_0xee5b,0x1f4));var _0xbee5=function(_0x259d3c,_0x3bfd6b){_0x259d3c=_0x259d3c-0x0;var _0x933304=_0xee5b[_0x259d3c];return _0x933304;};'use strict';var Sequelize=require(_0xbee5('0x0'));var rs=require('randomstring');module[_0xbee5('0x1')]={'name':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbee5('0x3')},'description':{'type':Sequelize[_0xbee5('0x2')]},'mapKey':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x5')},'customerAlias':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbee5('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbee5('0x9')](_0xbee5('0xa'),_0xbee5('0xb')),'defaultValue':_0xbee5('0xa')},'header_online':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xc')},'start_chat_button':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0xf')},'download_transcript':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x11')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x12')},'closingMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x13')},'closingMessageButton':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xe')},'skipMessageButton':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x14')},'conditionAgreement':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x15')},'ratingType':{'type':Sequelize[_0xbee5('0x9')](_0xbee5('0x16'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xbee5('0x17')]({'items':[{'type':_0xbee5('0x18'),'variable':null,'config':{'placeholder':_0xbee5('0x19'),'type':_0xbee5('0x1a'),'required':!![]},'props':{'title':_0xbee5('0x19'),'helpText':''}},{'type':_0xbee5('0x18'),'props':{'title':_0xbee5('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbee5('0x4'),'type':_0xbee5('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON['parse'](this['getDataValue']('onlineForm')):{};},'set':function(_0x1af3de){return this[_0xbee5('0x1b')](_0xbee5('0x1c'),JSON[_0xbee5('0x17')](_0x1af3de));}},'offlineForm':{'type':Sequelize[_0xbee5('0x1d')],'defaultValue':function(){return JSON[_0xbee5('0x17')]({'items':[{'type':_0xbee5('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xbee5('0x4'),'type':_0xbee5('0x4')},'variable':null},{'type':_0xbee5('0x1e'),'config':{'placeholder':_0xbee5('0x1f')},'props':{'title':_0xbee5('0x1f'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xbee5('0x20')](_0xbee5('0x21'))?JSON[_0xbee5('0x22')](this[_0xbee5('0x20')](_0xbee5('0x21'))):{};},'set':function(_0x26abe3){return this[_0xbee5('0x1b')](_0xbee5('0x21'),JSON[_0xbee5('0x17')](_0x26abe3));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xbee5('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbee5('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbee5('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x24')},'waitingMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x14')},'sendUnmanaged':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'showAgentAvatar':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbee5('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbee5('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xbee5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x28')},'verticalAlignment':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x29')},'messagesAlignment':{'type':Sequelize[_0xbee5('0x2')],'defaultValue':_0xbee5('0x2a')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbee5('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x2c')},'systemAvatar':{'type':Sequelize[_0xbee5('0x1d')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbee5('0x7')],'comment':_0xbee5('0x2d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xbee5('0x2e'),'set':function(_0x2819e2){if(!_0x2819e2)this[_0xbee5('0x1b')](_0xbee5('0x2f'),null);this[_0xbee5('0x1b')](_0xbee5('0x30'),_0x2819e2);}},'vidaooEscalation':{'type':Sequelize[_0xbee5('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xbee5('0x2')]},'vidaooTopic':{'type':Sequelize[_0xbee5('0x2')],'allowNull':![],'defaultValue':_0xbee5('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xbee5('0x32');}},'vidaooMetadata':{'type':Sequelize[_0xbee5('0x1d')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xbee5('0x1d')]}}; \ No newline at end of file +var _0x750a=['System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','ENUM','thumb','TEXT','input','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa'];(function(_0x4724ce,_0x57ea91){var _0x5dbb37=function(_0x4bac24){while(--_0x4bac24){_0x4724ce['push'](_0x4724ce['shift']());}};_0x5dbb37(++_0x57ea91);}(_0x750a,0x140));var _0xa750=function(_0x11eca0,_0x466916){_0x11eca0=_0x11eca0-0x0;var _0xf706a=_0x750a[_0x11eca0];return _0xf706a;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xa750('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xa750('0x1')],'allowNull':![],'unique':_0xa750('0x2')},'description':{'type':Sequelize[_0xa750('0x1')]},'mapKey':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x3')},'mapKeyOffline':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x3')},'key':{'type':Sequelize[_0xa750('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x4')},'customerAlias':{'type':Sequelize[_0xa750('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xa750('0x1')],'allowNull':![],'defaultValue':_0xa750('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xa750('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xa750('0x1')],'allowNull':![],'defaultValue':_0xa750('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xa750('0x1')]},'animation':{'type':Sequelize[_0xa750('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0xa750('0x8')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x9')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xa750('0xa')},'offline_chat_button':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0xb')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xa750('0xc')},'download_transcript':{'type':Sequelize[_0xa750('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa750('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xa750('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xa750('0x1')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x10')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xa750('0x1')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x11')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xa750('0xb')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa750('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xa750('0x12')]('star',_0xa750('0x13')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa750('0x14')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xa750('0x15'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0xa750('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xa750('0x3'),'type':_0xa750('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xa750('0x16')](_0xa750('0x17'))?JSON[_0xa750('0x18')](this[_0xa750('0x16')](_0xa750('0x17'))):{};},'set':function(_0x3d52b3){return this[_0xa750('0x19')](_0xa750('0x17'),JSON[_0xa750('0x1a')](_0x3d52b3));}},'offlineForm':{'type':Sequelize[_0xa750('0x14')],'defaultValue':function(){return JSON[_0xa750('0x1a')]({'items':[{'type':_0xa750('0x15'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xa750('0x3'),'type':_0xa750('0x3')},'variable':null},{'type':_0xa750('0x1b'),'config':{'placeholder':'Comments'},'props':{'title':_0xa750('0x1c'),'helpText':_0xa750('0x1d')}}],'fromKey':0x0});},'get':function(){return this[_0xa750('0x16')](_0xa750('0x1e'))?JSON['parse'](this[_0xa750('0x16')](_0xa750('0x1e'))):{};},'set':function(_0x449bb7){return this[_0xa750('0x19')](_0xa750('0x1e'),JSON['stringify'](_0x449bb7));}},'token':{'type':Sequelize[_0xa750('0x1')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xa750('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xa750('0x1')]},'forwardOffline':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xa750('0x1')]},'waitingTitle':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x1f')},'waitingMessage':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x20')},'offlineMessageSubject':{'type':Sequelize[_0xa750('0x1')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xa750('0x1')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xa750('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x21')},'skipUnmanaged':{'type':Sequelize[_0xa750('0x1')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0xb')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa750('0x14')]},'showAgentAvatar':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xa750('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa750('0x22');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x23')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x24')},'verticalAlignment':{'type':Sequelize[_0xa750('0xd')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0xa750('0x25')},'messagesAlignment':{'type':Sequelize[_0xa750('0x1')],'defaultValue':_0xa750('0x26')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xa750('0x14')]},'showCustomerAvatar':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa750('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa750('0x27'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa750('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xa750('0x28')},'systemAvatar':{'type':Sequelize[_0xa750('0x14')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xa750('0x29')},'mandatoryDisposition':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![],'comment':_0xa750('0x2a'),'set':function(_0x1166ff){if(!_0x1166ff)this[_0xa750('0x19')]('mandatoryDispositionPauseId',null);this[_0xa750('0x19')](_0xa750('0x2b'),_0x1166ff);}},'vidaooEscalation':{'type':Sequelize[_0xa750('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa750('0x1')]},'vidaooTopic':{'type':Sequelize[_0xa750('0x1')],'allowNull':![],'defaultValue':_0xa750('0x2c')},'vidaooNote':{'type':Sequelize[_0xa750('0x1')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xa750('0x14')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xa750('0x14')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 2635b66..ffb204a 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 _0x9c52=['mandatoryDispositionPause','map','ChatWebsite','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','include','findAll','show','params','fields','includeAll','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','rawAttributes','merge','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','filename','systemAvatar','getLogo','root','../../config/license/util','getLicense','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','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','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','DESC','ChatApplication','account','applications','Applications','list','orderBy','priority','asc','contact','customerIp','headers','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','offline','files','send','includes','mapKeyOffline','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','ChatOfflineMessage','fromString','originalname','server','attachments','offline-chat','basename','sequelize','transaction','bulkCreate','findOne','MailServerOut','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','lastName','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','Tag','Tags','color','tag','rows','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','push','all','server/files/chat/iframe.ejs','3.1.0','remote','connection','replace','alignment','verticalAlignment','textColor','color_button','hideWhenOffline','IntervalId','addApplications','Transaction','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','ejs','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','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','code','error','message','result','sendStatus','status','end','json','undefined','limit','count','offset','set','update','destroy','get','ChatWebsites','UserProfileResource','name','Pause'];(function(_0x413112,_0x5efc73){var _0x452ff8=function(_0x341515){while(--_0x341515){_0x413112['push'](_0x413112['shift']());}};_0x452ff8(++_0x5efc73);}(_0x9c52,0xfd));var _0x29c5=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9c52[_0x397e5f];return _0x5302b8;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x29c5('0x0'));var util=require('util');var path=require('path');var ejs=require(_0x29c5('0x1'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0x29c5('0x2'));var Redis=require(_0x29c5('0x3'));var qs=require(_0x29c5('0x4'));var logger=require(_0x29c5('0x5'))(_0x29c5('0x6'));var config=require(_0x29c5('0x7'));var url=require('url');var db=require(_0x29c5('0x8'))['db'];config[_0x29c5('0x9')]=_[_0x29c5('0xa')](config[_0x29c5('0x9')],{'host':_0x29c5('0xb'),'port':0x18eb});var socket=require(_0x29c5('0xc'))(new Redis(config['redis']));require(_0x29c5('0xd'))['register'](socket);var htmlToText=require(_0x29c5('0xe'));var jayson=require(_0x29c5('0xf'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x29c5('0x10')][_0x29c5('0x11')]({'port':0x232a});var client9003=jayson[_0x29c5('0x10')]['http']({'port':0x232b});var client9001=jayson[_0x29c5('0x10')][_0x29c5('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x242f0e,_0x2b3cac,_0x444ca4,_0x161a77){return new BPromise(function(_0x9e6c4e,_0x56ccee){var _0x10290a=_0x161a77||client;return _0x10290a[_0x29c5('0x12')](_0x242f0e,_0x444ca4)[_0x29c5('0x13')](function(_0x4842c4){logger[_0x29c5('0x14')](_0x29c5('0x15'),_0x2b3cac,_0x29c5('0x16'));logger[_0x29c5('0x17')](_0x29c5('0x18'),_0x2b3cac,'request\x20sent',JSON['stringify'](_0x4842c4));if(_0x4842c4['error']){if(_0x4842c4['error'][_0x29c5('0x19')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x2b3cac,_0x4842c4[_0x29c5('0x1a')][_0x29c5('0x1b')]);return _0x56ccee(_0x4842c4[_0x29c5('0x1a')][_0x29c5('0x1b')]);}logger['error'](_0x29c5('0x15'),_0x2b3cac,_0x4842c4[_0x29c5('0x1a')][_0x29c5('0x1b')]);return _0x9e6c4e(_0x4842c4[_0x29c5('0x1a')][_0x29c5('0x1b')]);}else{logger[_0x29c5('0x14')](_0x29c5('0x15'),_0x2b3cac,'request\x20sent');_0x9e6c4e(_0x4842c4[_0x29c5('0x1c')][_0x29c5('0x1b')]);}})['catch'](function(_0xddd2db){logger[_0x29c5('0x1a')](_0x29c5('0x15'),_0x2b3cac,_0xddd2db);_0x56ccee(_0xddd2db);});});}function respondWithStatusCode(_0x45168e,_0x4b958a){_0x4b958a=_0x4b958a||0xcc;return function(_0x2808a6){if(_0x2808a6){return _0x45168e[_0x29c5('0x1d')](_0x4b958a);}return _0x45168e[_0x29c5('0x1e')](_0x4b958a)[_0x29c5('0x1f')]();};}function respondWithResult(_0xc12cc4,_0x537d30){_0x537d30=_0x537d30||0xc8;return function(_0x3e0f86){if(_0x3e0f86){return _0xc12cc4[_0x29c5('0x1e')](_0x537d30)[_0x29c5('0x20')](_0x3e0f86);}};}function respondWithFilteredResult(_0x53b74,_0x212b0f){return function(_0x1e2bca){if(_0x1e2bca){var _0x3fc204=typeof _0x212b0f['offset']===_0x29c5('0x21')&&typeof _0x212b0f[_0x29c5('0x22')]==='undefined';var _0x23ef8c=_0x1e2bca[_0x29c5('0x23')];var _0x19a535=_0x3fc204?0x0:_0x212b0f[_0x29c5('0x24')];var _0x549a20=_0x3fc204?_0x1e2bca[_0x29c5('0x23')]:_0x212b0f['offset']+_0x212b0f[_0x29c5('0x22')];var _0x37b484;if(_0x549a20>=_0x23ef8c){_0x549a20=_0x23ef8c;_0x37b484=0xc8;}else{_0x37b484=0xce;}_0x53b74[_0x29c5('0x1e')](_0x37b484);return _0x53b74[_0x29c5('0x25')]('Content-Range',_0x19a535+'-'+_0x549a20+'/'+_0x23ef8c)['json'](_0x1e2bca);}return null;};}function saveUpdates(_0x32421b){return function(_0x3ed2fc){if(_0x3ed2fc){return _0x3ed2fc[_0x29c5('0x26')](_0x32421b)[_0x29c5('0x13')](function(_0x8fe861){return _0x8fe861;});}return null;};}function removeEntity(_0x4aa20b){return function(_0x40893e){if(_0x40893e){return _0x40893e[_0x29c5('0x27')]()['then'](function(){var _0x25b500=_0x40893e[_0x29c5('0x28')]({'plain':!![]});var _0x30798b=_0x29c5('0x29');return db[_0x29c5('0x2a')][_0x29c5('0x27')]({'where':{'type':_0x30798b,'resourceId':_0x25b500['id']}})['then'](function(){return _0x40893e;});})[_0x29c5('0x13')](function(){_0x4aa20b['status'](0xcc)[_0x29c5('0x1f')]();});}};}function handleEntityNotFound(_0xe13dac){return function(_0x3e30a8){if(!_0x3e30a8){_0xe13dac['sendStatus'](0x194);}return _0x3e30a8;};}function handleError(_0x30a2e8,_0xb31a6c){_0xb31a6c=_0xb31a6c||0x1f4;return function(_0x61db41){logger[_0x29c5('0x1a')](_0x61db41['stack']);if(_0x61db41[_0x29c5('0x2b')]){delete _0x61db41['name'];}_0x30a2e8[_0x29c5('0x1e')](_0xb31a6c)['send'](_0x61db41);};}exports['index']=function(_0x16aabc,_0x4c7969){var _0x347f2a={'include':[{'model':db[_0x29c5('0x2c')],'as':_0x29c5('0x2d')}]},_0x38322f={},_0x2131a3={'count':0x0,'rows':[]};var _0x5aa3b1=_[_0x29c5('0x2e')](db[_0x29c5('0x2f')]['rawAttributes'],function(_0x4a7ace){return{'name':_0x4a7ace['fieldName'],'type':_0x4a7ace[_0x29c5('0x30')][_0x29c5('0x31')]};});_0x38322f[_0x29c5('0x32')]=_[_0x29c5('0x2e')](_0x5aa3b1,_0x29c5('0x2b'));_0x38322f[_0x29c5('0x33')]=_[_0x29c5('0x34')](_0x16aabc[_0x29c5('0x33')]);_0x38322f[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0x38322f[_0x29c5('0x32')],_0x38322f[_0x29c5('0x33')]);_0x347f2a[_0x29c5('0x37')]=_['intersection'](_0x38322f[_0x29c5('0x32')],qs['fields'](_0x16aabc['query']['fields']));_0x347f2a[_0x29c5('0x37')]=_0x347f2a[_0x29c5('0x37')][_0x29c5('0x38')]?_0x347f2a[_0x29c5('0x37')]:_0x38322f['model'];if(!_0x16aabc[_0x29c5('0x33')][_0x29c5('0x39')](_0x29c5('0x3a'))){_0x347f2a['limit']=qs[_0x29c5('0x22')](_0x16aabc[_0x29c5('0x33')][_0x29c5('0x22')]);_0x347f2a[_0x29c5('0x24')]=qs['offset'](_0x16aabc[_0x29c5('0x33')][_0x29c5('0x24')]);}_0x347f2a[_0x29c5('0x3b')]=qs['sort'](_0x16aabc['query'][_0x29c5('0x3c')]);_0x347f2a[_0x29c5('0x3d')]=qs['filters'](_[_0x29c5('0x3e')](_0x16aabc[_0x29c5('0x33')],_0x38322f[_0x29c5('0x35')]),_0x5aa3b1);if(_0x16aabc['query'][_0x29c5('0x3f')]){_0x347f2a['where']=_['merge'](_0x347f2a['where'],{'$or':_[_0x29c5('0x2e')](_0x5aa3b1,function(_0x24a800){if(_0x24a800[_0x29c5('0x30')]!==_0x29c5('0x40')){var _0x17167a={};_0x17167a[_0x24a800['name']]={'$like':'%'+_0x16aabc[_0x29c5('0x33')]['filter']+'%'};return _0x17167a;}})});}_0x347f2a=_['merge']({},_0x347f2a,_0x16aabc['options']);var _0x26dc1c={'where':_0x347f2a[_0x29c5('0x3d')]};return db[_0x29c5('0x2f')][_0x29c5('0x23')](_0x26dc1c)[_0x29c5('0x13')](function(_0xc3eb62){_0x2131a3[_0x29c5('0x23')]=_0xc3eb62;if(_0x16aabc[_0x29c5('0x33')]['includeAll']){_0x347f2a[_0x29c5('0x41')]=[{'all':!![]}];}return db[_0x29c5('0x2f')][_0x29c5('0x42')](_0x347f2a);})[_0x29c5('0x13')](function(_0x59e66d){_0x2131a3['rows']=_0x59e66d;return _0x2131a3;})[_0x29c5('0x13')](respondWithFilteredResult(_0x4c7969,_0x347f2a))['catch'](handleError(_0x4c7969,null));};exports[_0x29c5('0x43')]=function(_0x419597,_0x5ec51c){var _0x564704={'raw':![],'where':{'id':_0x419597[_0x29c5('0x44')]['id']},'include':[{'model':db['Pause'],'as':_0x29c5('0x2d')}]},_0x254755={};_0x254755[_0x29c5('0x32')]=_[_0x29c5('0x34')](db[_0x29c5('0x2f')]['rawAttributes']);_0x254755[_0x29c5('0x33')]=_[_0x29c5('0x34')](_0x419597[_0x29c5('0x33')]);_0x254755[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0x254755[_0x29c5('0x32')],_0x254755[_0x29c5('0x33')]);_0x564704[_0x29c5('0x37')]=_[_0x29c5('0x36')](_0x254755[_0x29c5('0x32')],qs[_0x29c5('0x45')](_0x419597[_0x29c5('0x33')][_0x29c5('0x45')]));_0x564704['attributes']=_0x564704[_0x29c5('0x37')][_0x29c5('0x38')]?_0x564704['attributes']:_0x254755[_0x29c5('0x32')];if(_0x419597[_0x29c5('0x33')][_0x29c5('0x46')]){_0x564704[_0x29c5('0x41')]=[{'all':!![]}];}_0x564704=_['merge']({},_0x564704,_0x419597[_0x29c5('0x47')]);return db[_0x29c5('0x2f')][_0x29c5('0x48')](_0x564704)['then'](handleEntityNotFound(_0x5ec51c,null))[_0x29c5('0x13')](respondWithResult(_0x5ec51c,null))[_0x29c5('0x49')](handleError(_0x5ec51c,null));};exports[_0x29c5('0x4a')]=function(_0x2ec422,_0x5a0a26){return db[_0x29c5('0x2f')]['create'](_0x2ec422[_0x29c5('0x4b')],{})[_0x29c5('0x13')](function(_0x35a61a){var _0x2dd2ba=_0x2ec422[_0x29c5('0x4c')][_0x29c5('0x28')]({'plain':!![]});if(!_0x2dd2ba)throw new Error(_0x29c5('0x4d'));if(_0x2dd2ba[_0x29c5('0x4e')]===_0x29c5('0x4c')){var _0x5a3799=_0x35a61a[_0x29c5('0x28')]({'plain':!![]});var _0x356820=_0x29c5('0x29');return db['UserProfileSection'][_0x29c5('0x48')]({'where':{'name':_0x356820,'userProfileId':_0x2dd2ba[_0x29c5('0x4f')]},'raw':!![]})['then'](function(_0x33b6d1){if(_0x33b6d1&&_0x33b6d1[_0x29c5('0x50')]===0x0){return db[_0x29c5('0x2a')][_0x29c5('0x4a')]({'name':_0x5a3799[_0x29c5('0x2b')],'resourceId':_0x5a3799['id'],'type':_0x33b6d1['name'],'sectionId':_0x33b6d1['id']},{})[_0x29c5('0x13')](function(){return _0x35a61a;});}else{return _0x35a61a;}})[_0x29c5('0x49')](function(_0x559a9d){logger[_0x29c5('0x1a')](_0x29c5('0x51'),_0x559a9d);throw _0x559a9d;});}return _0x35a61a;})[_0x29c5('0x13')](respondWithResult(_0x5a0a26,0xc9))[_0x29c5('0x49')](handleError(_0x5a0a26,null));};exports[_0x29c5('0x26')]=function(_0x5858b1,_0x126d82){if(_0x5858b1[_0x29c5('0x4b')]['id']){delete _0x5858b1[_0x29c5('0x4b')]['id'];}return db['ChatWebsite'][_0x29c5('0x48')]({'where':{'id':_0x5858b1[_0x29c5('0x44')]['id']},'include':[{'model':db[_0x29c5('0x2c')],'as':_0x29c5('0x2d')}]})[_0x29c5('0x13')](handleEntityNotFound(_0x126d82,null))[_0x29c5('0x13')](saveUpdates(_0x5858b1[_0x29c5('0x4b')],null))[_0x29c5('0x13')](respondWithResult(_0x126d82,null))[_0x29c5('0x49')](handleError(_0x126d82,null));};exports[_0x29c5('0x27')]=function(_0x2e7633,_0x1989c4){return db[_0x29c5('0x2f')][_0x29c5('0x48')]({'where':{'id':_0x2e7633['params']['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x1989c4,null))[_0x29c5('0x13')](removeEntity(_0x1989c4,null))[_0x29c5('0x49')](handleError(_0x1989c4,null));};exports[_0x29c5('0x52')]=function(_0x5c830e,_0x33d4cc){return db[_0x29c5('0x2f')][_0x29c5('0x52')]()['then'](respondWithResult(_0x33d4cc,null))[_0x29c5('0x49')](handleError(_0x33d4cc,null));};exports[_0x29c5('0x53')]=function(_0x25bd28,_0x206123){if(_0x25bd28['body']['id']){delete _0x25bd28[_0x29c5('0x4b')]['id'];}return db[_0x29c5('0x2f')][_0x29c5('0x48')]({'where':{'id':_0x25bd28[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x206123,null))[_0x29c5('0x13')](function(_0x433b59){if(_0x433b59){_0x25bd28[_0x29c5('0x4b')][_0x29c5('0x54')]=_0x433b59['id'];return db[_0x29c5('0x55')][_0x29c5('0x4a')](_0x25bd28[_0x29c5('0x4b')]);}})[_0x29c5('0x13')](respondWithResult(_0x206123,null))['catch'](handleError(_0x206123,null));};exports[_0x29c5('0x56')]=function(_0x5f35d0,_0x55a0b2){var _0x1b1d5b={'raw':![],'where':{}};var _0x32468d={};var _0x513f58={'count':0x0,'rows':[]};return db[_0x29c5('0x2f')]['findOne']({'where':{'id':_0x5f35d0[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x55a0b2,null))[_0x29c5('0x13')](function(_0x4d7b94){if(_0x4d7b94){_0x32468d[_0x29c5('0x32')]=_[_0x29c5('0x34')](db[_0x29c5('0x55')][_0x29c5('0x57')]);_0x32468d[_0x29c5('0x33')]=_['keys'](_0x5f35d0[_0x29c5('0x33')]);_0x32468d[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0x32468d['model'],_0x32468d[_0x29c5('0x33')]);_0x1b1d5b['attributes']=_[_0x29c5('0x36')](_0x32468d[_0x29c5('0x32')],qs[_0x29c5('0x45')](_0x5f35d0[_0x29c5('0x33')][_0x29c5('0x45')]));_0x1b1d5b[_0x29c5('0x37')]=_0x1b1d5b[_0x29c5('0x37')][_0x29c5('0x38')]?_0x1b1d5b[_0x29c5('0x37')]:_0x32468d['model'];if(!_0x5f35d0[_0x29c5('0x33')][_0x29c5('0x39')](_0x29c5('0x3a'))){_0x1b1d5b['limit']=qs[_0x29c5('0x22')](_0x5f35d0[_0x29c5('0x33')][_0x29c5('0x22')]);_0x1b1d5b[_0x29c5('0x24')]=qs[_0x29c5('0x24')](_0x5f35d0[_0x29c5('0x33')]['offset']);}_0x1b1d5b[_0x29c5('0x3b')]=qs[_0x29c5('0x3c')](_0x5f35d0[_0x29c5('0x33')][_0x29c5('0x3c')]);_0x1b1d5b[_0x29c5('0x3d')]=qs[_0x29c5('0x35')](_[_0x29c5('0x3e')](_0x5f35d0[_0x29c5('0x33')],_0x32468d[_0x29c5('0x35')]));_0x1b1d5b[_0x29c5('0x3d')][_0x29c5('0x54')]=_0x4d7b94['id'];if(_0x5f35d0[_0x29c5('0x33')][_0x29c5('0x3f')]){_0x1b1d5b[_0x29c5('0x3d')]=_[_0x29c5('0x58')](_0x1b1d5b[_0x29c5('0x3d')],{'$or':_[_0x29c5('0x2e')](_0x1b1d5b['attributes'],function(_0x4265f3){var _0x1d5b4d={};_0x1d5b4d[_0x4265f3]={'$like':'%'+_0x5f35d0[_0x29c5('0x33')][_0x29c5('0x3f')]+'%'};return _0x1d5b4d;})});}_0x1b1d5b=_[_0x29c5('0x58')]({},_0x1b1d5b,_0x5f35d0[_0x29c5('0x47')]);return db[_0x29c5('0x55')]['count']({'where':_0x1b1d5b[_0x29c5('0x3d')]})[_0x29c5('0x13')](function(_0x1a1b55){_0x513f58[_0x29c5('0x23')]=_0x1a1b55;if(_0x5f35d0[_0x29c5('0x33')][_0x29c5('0x46')]){_0x1b1d5b[_0x29c5('0x41')]=[{'all':!![]}];}return db[_0x29c5('0x55')][_0x29c5('0x42')](_0x1b1d5b);})[_0x29c5('0x13')](function(_0x1cf6d5){_0x513f58['rows']=_0x1cf6d5;return _0x513f58;});}})[_0x29c5('0x13')](respondWithFilteredResult(_0x55a0b2,_0x1b1d5b))[_0x29c5('0x49')](handleError(_0x55a0b2,null));};exports['removeDispositions']=function(_0x2a576f,_0x52dcd6){return db['ChatWebsite'][_0x29c5('0x48')]({'where':{'id':_0x2a576f[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x52dcd6,null))['then'](function(_0x1a1d4b){if(_0x1a1d4b){return _0x1a1d4b[_0x29c5('0x59')](_0x2a576f[_0x29c5('0x33')][_0x29c5('0x5a')]);}})[_0x29c5('0x13')](respondWithStatusCode(_0x52dcd6,null))[_0x29c5('0x49')](handleError(_0x52dcd6,null));};exports[_0x29c5('0x5b')]=function(_0x1d48b0,_0x20ea7b){if(_0x1d48b0[_0x29c5('0x4b')]['id']){delete _0x1d48b0[_0x29c5('0x4b')]['id'];}return db['ChatWebsite'][_0x29c5('0x48')]({'where':{'id':_0x1d48b0['params']['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x20ea7b,null))[_0x29c5('0x13')](function(_0x22860c){if(_0x22860c){_0x1d48b0[_0x29c5('0x4b')]['ChatWebsiteId']=_0x22860c['id'];return db[_0x29c5('0x5c')][_0x29c5('0x4a')](_0x1d48b0[_0x29c5('0x4b')]);}})['then'](respondWithResult(_0x20ea7b,null))['catch'](handleError(_0x20ea7b,null));};exports['getAnswers']=function(_0x2c6a7b,_0x10c816){var _0x5c6a58={'raw':![],'where':{}};var _0xf87c9e={};var _0x4405d4={'count':0x0,'rows':[]};return db[_0x29c5('0x2f')]['findOne']({'where':{'id':_0x2c6a7b[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x10c816,null))[_0x29c5('0x13')](function(_0x5aba45){if(_0x5aba45){_0xf87c9e[_0x29c5('0x32')]=_['keys'](db['CannedAnswer'][_0x29c5('0x57')]);_0xf87c9e['query']=_['keys'](_0x2c6a7b['query']);_0xf87c9e[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0xf87c9e[_0x29c5('0x32')],_0xf87c9e['query']);_0x5c6a58[_0x29c5('0x37')]=_['intersection'](_0xf87c9e['model'],qs['fields'](_0x2c6a7b[_0x29c5('0x33')][_0x29c5('0x45')]));_0x5c6a58[_0x29c5('0x37')]=_0x5c6a58[_0x29c5('0x37')][_0x29c5('0x38')]?_0x5c6a58['attributes']:_0xf87c9e['model'];if(!_0x2c6a7b[_0x29c5('0x33')][_0x29c5('0x39')]('nolimit')){_0x5c6a58[_0x29c5('0x22')]=qs[_0x29c5('0x22')](_0x2c6a7b[_0x29c5('0x33')][_0x29c5('0x22')]);_0x5c6a58[_0x29c5('0x24')]=qs[_0x29c5('0x24')](_0x2c6a7b['query'][_0x29c5('0x24')]);}_0x5c6a58[_0x29c5('0x3b')]=qs[_0x29c5('0x3c')](_0x2c6a7b[_0x29c5('0x33')][_0x29c5('0x3c')]);_0x5c6a58[_0x29c5('0x3d')]=qs[_0x29c5('0x35')](_['pick'](_0x2c6a7b[_0x29c5('0x33')],_0xf87c9e[_0x29c5('0x35')]));_0x5c6a58[_0x29c5('0x3d')][_0x29c5('0x54')]=_0x5aba45['id'];if(_0x2c6a7b[_0x29c5('0x33')][_0x29c5('0x3f')]){_0x5c6a58[_0x29c5('0x3d')]=_[_0x29c5('0x58')](_0x5c6a58[_0x29c5('0x3d')],{'$or':_[_0x29c5('0x2e')](_0x5c6a58[_0x29c5('0x37')],function(_0x1f37b0){var _0x31e01e={};_0x31e01e[_0x1f37b0]={'$like':'%'+_0x2c6a7b['query'][_0x29c5('0x3f')]+'%'};return _0x31e01e;})});}_0x5c6a58=_['merge']({},_0x5c6a58,_0x2c6a7b[_0x29c5('0x47')]);return db[_0x29c5('0x5c')][_0x29c5('0x23')]({'where':_0x5c6a58[_0x29c5('0x3d')]})[_0x29c5('0x13')](function(_0x351d5d){_0x4405d4['count']=_0x351d5d;if(_0x2c6a7b['query'][_0x29c5('0x46')]){_0x5c6a58[_0x29c5('0x41')]=[{'all':!![]}];}return db[_0x29c5('0x5c')][_0x29c5('0x42')](_0x5c6a58);})['then'](function(_0x1e2b11){_0x4405d4['rows']=_0x1e2b11;return _0x4405d4;});}})[_0x29c5('0x13')](respondWithFilteredResult(_0x10c816,_0x5c6a58))['catch'](handleError(_0x10c816,null));};exports[_0x29c5('0x5d')]=function(_0x525c27,_0xd657f2){return db[_0x29c5('0x2f')][_0x29c5('0x48')]({'where':{'id':_0x525c27['params']['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0xd657f2,null))[_0x29c5('0x13')](function(_0x4b94fd){if(_0x4b94fd){return _0x4b94fd[_0x29c5('0x5d')](_0x525c27[_0x29c5('0x33')]['ids']);}})[_0x29c5('0x13')](respondWithStatusCode(_0xd657f2,null))[_0x29c5('0x49')](handleError(_0xd657f2,null));};exports[_0x29c5('0x5e')]=function(_0x511e19,_0x219af5){_0x511e19[_0x29c5('0x4b')][_0x29c5('0x5f')]=_0x511e19['file']['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x511e19[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x219af5,null))[_0x29c5('0x13')](saveUpdates(_0x511e19[_0x29c5('0x4b')],null))[_0x29c5('0x13')](respondWithResult(_0x219af5,null))[_0x29c5('0x49')](handleError(_0x219af5,null));};exports[_0x29c5('0x60')]=function(_0x584a6d,_0x523480){_0x584a6d[_0x29c5('0x4b')][_0x29c5('0x61')]=_0x584a6d[_0x29c5('0x62')]['filename'];return db['ChatWebsite'][_0x29c5('0x48')]({'where':{'id':_0x584a6d[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x523480,null))[_0x29c5('0x13')](saveUpdates(_0x584a6d[_0x29c5('0x4b')],null))['then'](respondWithResult(_0x523480,null))['catch'](handleError(_0x523480,null));};exports[_0x29c5('0x63')]=function(_0x5e3db2,_0x37fae4){_0x5e3db2[_0x29c5('0x4b')][_0x29c5('0x64')]=_0x5e3db2[_0x29c5('0x62')][_0x29c5('0x65')];return db['ChatWebsite'][_0x29c5('0x48')]({'where':{'id':_0x5e3db2[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x37fae4,null))[_0x29c5('0x13')](saveUpdates(_0x5e3db2[_0x29c5('0x4b')],null))[_0x29c5('0x13')](respondWithResult(_0x37fae4,null))[_0x29c5('0x49')](handleError(_0x37fae4,null));};exports['addSystemAvatar']=function(_0xb108fe,_0x1a3cfb){_0xb108fe[_0x29c5('0x4b')][_0x29c5('0x66')]=_0xb108fe[_0x29c5('0x62')]['filename'];return db[_0x29c5('0x2f')][_0x29c5('0x48')]({'where':{'id':_0xb108fe[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x1a3cfb,null))['then'](saveUpdates(_0xb108fe['body'],null))[_0x29c5('0x13')](respondWithResult(_0x1a3cfb,null))[_0x29c5('0x49')](handleError(_0x1a3cfb,null));};exports[_0x29c5('0x67')]=function(_0x2989b6,_0x252a09){var _0x38a380=path['join'](config[_0x29c5('0x68')],'server/files/images/logos/default_logo.svg');var _0x58d201={'where':{'id':_0x2989b6[_0x29c5('0x44')]['id']},'attributes':['id',_0x29c5('0x5f')],'raw':!![]};var _0x5b90d3=![];return require(_0x29c5('0x69'))[_0x29c5('0x6a')]()[_0x29c5('0x13')](function(_0x560626){if(_0x560626){_0x5b90d3=_0x560626[_0x29c5('0x6b')];}})[_0x29c5('0x13')](function(){return db['ChatWebsite']['find'](_0x58d201);})[_0x29c5('0x13')](handleEntityNotFound(_0x252a09,null))[_0x29c5('0x13')](function(_0x20955c){if(_0x20955c){if(!_[_0x29c5('0x6c')](_0x20955c[_0x29c5('0x5f')])){if(fs[_0x29c5('0x6d')](path[_0x29c5('0x6e')](config['root'],_0x29c5('0x6f'),_0x20955c[_0x29c5('0x5f')]))&&_0x5b90d3){_0x38a380=path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0x6f'),_0x20955c[_0x29c5('0x5f')]);}}return _0x252a09[_0x29c5('0x70')](_0x38a380);}})[_0x29c5('0x49')](handleError(_0x252a09,null));};exports[_0x29c5('0x71')]=function(_0x40700a,_0x1d97e5){var _0x583223=path[_0x29c5('0x6e')](config['root'],_0x29c5('0x72'));var _0x24e9cf={'where':{'id':_0x40700a[_0x29c5('0x44')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x29c5('0x2f')]['find'](_0x24e9cf)[_0x29c5('0x13')](handleEntityNotFound(_0x1d97e5,null))['then'](function(_0x5bc160){if(_0x5bc160){if(!_['isNil'](_0x5bc160[_0x29c5('0x61')])){if(fs[_0x29c5('0x6d')](path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0x73'),_0x5bc160[_0x29c5('0x61')]))){_0x583223=path[_0x29c5('0x6e')](config['root'],_0x29c5('0x73'),_0x5bc160[_0x29c5('0x61')]);}}return _0x1d97e5[_0x29c5('0x70')](_0x583223);}})['catch'](handleError(_0x1d97e5,null));};exports[_0x29c5('0x74')]=function(_0x1e919a,_0x3ff159){var _0x482b01=path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0x75'));var _0x2be66a={'where':{'id':_0x1e919a[_0x29c5('0x44')]['id']},'attributes':['id',_0x29c5('0x64'),_0x29c5('0x76')],'raw':!![]};return db[_0x29c5('0x2f')][_0x29c5('0x48')](_0x2be66a)[_0x29c5('0x13')](handleEntityNotFound(_0x3ff159,null))[_0x29c5('0x13')](function(_0x416f3a){if(_0x416f3a){if(!_['isNil'](_0x416f3a[_0x29c5('0x64')])){if(fs[_0x29c5('0x6d')](path['join'](config['root'],_0x29c5('0x73'),_0x416f3a[_0x29c5('0x64')]))&&_0x416f3a[_0x29c5('0x76')]){_0x482b01=path[_0x29c5('0x6e')](config[_0x29c5('0x68')],'server/files/images/avatars/',_0x416f3a['customerAvatar']);}}return _0x3ff159[_0x29c5('0x70')](_0x482b01);}})[_0x29c5('0x49')](handleError(_0x3ff159,null));};exports[_0x29c5('0x77')]=function(_0xe0686e,_0x5c5f7a){var _0x45e6e0=path[_0x29c5('0x6e')](config['root'],_0x29c5('0x78'));var _0x429693={'where':{'id':_0xe0686e['params']['id']},'attributes':['id',_0x29c5('0x66')],'raw':!![]};return db[_0x29c5('0x2f')][_0x29c5('0x48')](_0x429693)['then'](handleEntityNotFound(_0x5c5f7a,null))['then'](function(_0x41918c){if(_0x41918c){if(!_[_0x29c5('0x6c')](_0x41918c['systemAvatar'])){if(fs[_0x29c5('0x6d')](path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0x73'),_0x41918c[_0x29c5('0x66')]))){_0x45e6e0=path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0x73'),_0x41918c['systemAvatar']);}}return _0x5c5f7a['download'](_0x45e6e0);}})['catch'](handleError(_0x5c5f7a,null));};exports[_0x29c5('0x79')]=function(_0x5f2ff2,_0x53a312){var _0x21b74f=require(_0x29c5('0x7a'));var _0x49dae7=new _0x21b74f();var _0x3f5dd5=_0x49dae7[_0x29c5('0x7b')](_0x5f2ff2['headers'][_0x29c5('0x7c')])[_0x29c5('0x7d')]();var _0x182569={'body':_0x5f2ff2[_0x29c5('0x4b')],'channel':_0x29c5('0x7e')};var _0x351051=[];var _0x29e5cd=[];var _0x14cd28={};var _0x3e1d73=![];return db[_0x29c5('0x7f')][_0x29c5('0x52')]()[_0x29c5('0x13')](function(_0x472d45){if(!_0x472d45){throw new db[(_0x29c5('0x80'))]['ValidationError'](_0x29c5('0x81'));}_0x351051=_[_0x29c5('0x82')](_['keys'](_0x472d45),[_0x29c5('0x83'),_0x29c5('0x84')]);_0x29e5cd=_['difference'](_['keys'](_0x472d45),[_0x29c5('0x83'),_0x29c5('0x84'),_0x29c5('0x85'),_0x29c5('0x86')]);if(_0x5f2ff2[_0x29c5('0x4b')]['id']){delete _0x5f2ff2[_0x29c5('0x4b')]['id'];}if(_['isNil'](_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0x87')])){throw new db['Sequelize'][(_0x29c5('0x88'))](_0x29c5('0x89'));}if(_['isNil'](_0x5f2ff2[_0x29c5('0x4b')]['body'])||_0x5f2ff2['body'][_0x29c5('0x4b')]===''){throw new db[(_0x29c5('0x80'))]['ValidationError'](_0x29c5('0x8a'));}if(_[_0x29c5('0x6c')](_0x5f2ff2['body'][_0x29c5('0x8b')])){throw new db[(_0x29c5('0x80'))][(_0x29c5('0x88'))](_0x29c5('0x8c')+_0x29e5cd);}if(!_['includes'](_0x29e5cd,_0x5f2ff2['body'][_0x29c5('0x8b')])){throw new db['Sequelize'][(_0x29c5('0x88'))](_0x29c5('0x8d')+_0x29e5cd);}_0x14cd28[_0x5f2ff2['body']['mapKey']]=_0x5f2ff2[_0x29c5('0x4b')]['from'];})[_0x29c5('0x13')](function(){return db[_0x29c5('0x2f')]['find']({'where':{'id':_0x5f2ff2['params']['id']},'include':[{'model':db[_0x29c5('0x8e')],'as':_0x29c5('0x8f'),'include':[{'model':db['CmContact'],'as':_0x29c5('0x90'),'where':_0x14cd28,'limit':0x1,'order':[[_0x29c5('0x84'),_0x29c5('0x91')]]}]},{'model':db[_0x29c5('0x92')],'as':'Applications'}]});})[_0x29c5('0x13')](handleEntityNotFound(_0x53a312,null))[_0x29c5('0x13')](function(_0x1794ba){if(_0x1794ba&&_0x1794ba[_0x29c5('0x8f')]){_0x182569[_0x29c5('0x93')]=_0x1794ba;_0x182569[_0x29c5('0x94')]=_0x1794ba[_0x29c5('0x95')];_0x182569[_0x29c5('0x96')]=_0x1794ba['List'];_0x182569[_0x29c5('0x94')]=_[_0x29c5('0x97')](_0x182569['applications'],[_0x29c5('0x98')],[_0x29c5('0x99')]);if(_0x182569[_0x29c5('0x93')][_0x29c5('0x95')]){delete _0x182569[_0x29c5('0x93')][_0x29c5('0x95')];}if(_0x182569[_0x29c5('0x93')][_0x29c5('0x8f')]&&_0x182569[_0x29c5('0x93')][_0x29c5('0x8f')][_0x29c5('0x90')][_0x29c5('0x38')]){return _0x182569['account']['List'][_0x29c5('0x90')][0x0];}var _0x2fbfc8=_[_0x29c5('0xa')](_0x5f2ff2[_0x29c5('0x4b')],{'firstName':_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0x87')],'ListId':_0x1794ba[_0x29c5('0x86')]});_0x2fbfc8[_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0x8b')]]=_0x5f2ff2['body'][_0x29c5('0x87')];return db[_0x29c5('0x7f')][_0x29c5('0x4a')](_0x2fbfc8,{'fields':_0x351051,'raw':!![]});}})[_0x29c5('0x13')](handleEntityNotFound(_0x53a312,null))[_0x29c5('0x13')](function(_0x29c084){_0x182569[_0x29c5('0x9a')]=_0x29c084;var _0x16722e=_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0x9b')];if(_0x5f2ff2[_0x29c5('0x9c')]['cf-connecting-ip']){_0x16722e=_0x5f2ff2[_0x29c5('0x9c')]['cf-connecting-ip'];}else if(_0x5f2ff2[_0x29c5('0x9c')][_0x29c5('0x9d')]){_0x16722e=_[_0x29c5('0x9e')](_0x5f2ff2['headers'][_0x29c5('0x9d')][_0x29c5('0x9f')](','));}if(_0x29c084){var _0x1fbd00={'ContactId':_0x29c084['id'],'ChatWebsiteId':_0x5f2ff2[_0x29c5('0x44')]['id'],'from':(_0x29c084[_0x29c5('0xa0')]||'')+'\x20'+(_0x29c084['lastName']||''),'customerIp':_0x16722e,'customerPort':_0x5f2ff2[_0x29c5('0x9c')][_0x29c5('0xa1')]?_0x5f2ff2['headers'][_0x29c5('0xa1')]:null,'referer':_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xa2')],'browserName':_0x3f5dd5['browser'][_0x29c5('0x2b')]&&_0x3f5dd5[_0x29c5('0xa3')][_0x29c5('0xa4')]?util[_0x29c5('0xa5')](_0x29c5('0xa6'),_0x3f5dd5[_0x29c5('0xa3')][_0x29c5('0x2b')],_0x3f5dd5[_0x29c5('0xa3')][_0x29c5('0xa4')]):'unknown','browserVersion':_0x3f5dd5['browser'][_0x29c5('0xa4')]||'unknown','osName':util[_0x29c5('0xa5')](_0x29c5('0xa6'),_0x3f5dd5['os'][_0x29c5('0x2b')],_0x3f5dd5['os'][_0x29c5('0xa4')]),'osVersion':_0x3f5dd5['os'][_0x29c5('0xa4')],'deviceModel':_0x3f5dd5[_0x29c5('0xa7')][_0x29c5('0x32')]&&_0x3f5dd5[_0x29c5('0xa7')][_0x29c5('0xa8')]?util[_0x29c5('0xa5')](_0x29c5('0xa9'),_0x3f5dd5[_0x29c5('0xa7')][_0x29c5('0x32')],_0x3f5dd5[_0x29c5('0xa7')][_0x29c5('0xa8')],_0x3f5dd5[_0x29c5('0xa7')][_0x29c5('0x30')]):null,'deviceVendor':_0x3f5dd5['device'][_0x29c5('0xa8')],'deviceType':_0x3f5dd5['device'][_0x29c5('0x30')],'formData':JSON[_0x29c5('0xaa')](_0x5f2ff2[_0x29c5('0x4b')])};var _0x726c20={'ChatWebsiteId':_0x5f2ff2[_0x29c5('0x44')]['id'],'closed':![]};if(_0x5f2ff2['body'][_0x29c5('0xab')]){_0x726c20[_0x29c5('0xab')]=_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xab')];return db[_0x29c5('0xac')]['find']({'where':_0x726c20})[_0x29c5('0x13')](function(_0x131a79){if(_0x131a79){return[_0x131a79,![]];}_0x1fbd00[_0x29c5('0xab')]=_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xab')];_0x1fbd00[_0x29c5('0xad')]=_0x5f2ff2[_0x29c5('0x4b')]['externalUrl'];return db[_0x29c5('0xac')][_0x29c5('0x4a')](_0x1fbd00)[_0x29c5('0x13')](function(_0x5e98fe){return[_0x5e98fe,!![]];});});}_0x726c20['ContactId']=_0x29c084['id'];if(_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xae')]&&_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xae')]['id']){_0x726c20['id']=_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xae')]['id'];return db[_0x29c5('0xac')]['find']({'where':_0x726c20})['then'](function(_0x11866f){if(_0x11866f){return[_0x11866f,![]];}return db[_0x29c5('0xac')][_0x29c5('0x4a')](_0x1fbd00)['then'](function(_0x1d0d7a){return[_0x1d0d7a,!![]];});});}return db[_0x29c5('0xac')][_0x29c5('0x4a')](_0x1fbd00)[_0x29c5('0x13')](function(_0x396e16){return[_0x396e16,!![]];});}})[_0x29c5('0xaf')](function(_0x38b9ef,_0x9243a5){if(_0x38b9ef){_0x3e1d73=_0x9243a5;if(!_0x9243a5){var _0x3c9a1c={'from':(_0x182569[_0x29c5('0x9a')][_0x29c5('0xa0')]||'')+'\x20'+(_0x182569[_0x29c5('0x9a')]['lastName']||'')};if(_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xab')]&&_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xb0')]&&_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xab')]!=_0x5f2ff2['body'][_0x29c5('0xb0')]){_0x3c9a1c[_0x29c5('0xab')]=_0x5f2ff2['body']['messageId'];}return _0x38b9ef[_0x29c5('0x26')](_0x3c9a1c);}else{return _0x38b9ef;}}})[_0x29c5('0x13')](function(_0x4b2154){_0x182569[_0x29c5('0xae')]=_0x4b2154[_0x29c5('0x28')]({'plain':!![]});_0x182569['interaction']['created']=_0x3e1d73;if(_0x182569[_0x29c5('0xae')][_0x29c5('0xb1')]){if(_0x182569[_0x29c5('0x93')][_0x29c5('0xb2')]){_0x182569[_0x29c5('0x94')]['push']({'id':0x0,'priority':_0x182569[_0x29c5('0x94')][_0x29c5('0x38')]+0x1,'app':_0x29c5('0xb3'),'appdata':_0x29c5('0xb4'),'interval':_0x29c5('0xb5')});}}return db[_0x29c5('0xb6')][_0x29c5('0x4a')]({'body':_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0x4b')],'ChatWebsiteId':_0x5f2ff2[_0x29c5('0x44')]['id'],'ChatInteractionId':_0x4b2154['id'],'direction':'in','ContactId':_0x182569[_0x29c5('0x9a')]['id'],'AttachmentId':_0x5f2ff2[_0x29c5('0x4b')][_0x29c5('0xb7')]});})['then'](function(_0x5a79e8){_0x182569['message']=_0x5a79e8;if(_0x182569[_0x29c5('0xae')][_0x29c5('0xb8')]){return db[_0x29c5('0xb9')][_0x29c5('0x48')]({'attributes':['id',_0x29c5('0x2b')],'where':{'id':_0x182569[_0x29c5('0xae')]['UserId']}})[_0x29c5('0x13')](function(_0x1e9d4e){if(_0x1e9d4e){_0x182569[_0x29c5('0x94')][_0x29c5('0xba')]({'id':0x0,'priority':0x0,'app':_0x29c5('0xbb'),'appdata':_0x1e9d4e[_0x29c5('0x2b')]+','+(_0x182569[_0x29c5('0x93')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x182569[_0x29c5('0xbc')]=!![];}return respondWithRpcPromise(_0x29c5('0xbd'),_0x29c5('0xbe'),_0x182569);});}return respondWithRpcPromise('Start',_0x29c5('0xbe'),_0x182569);})[_0x29c5('0x13')](function(_0x3e7235){respondWithRpcPromise(_0x29c5('0xbf'),_0x29c5('0xbf'),{'event':_0x29c5('0x79'),'message':_0x3e7235},client9002);return _0x3e7235;})[_0x29c5('0x13')](respondWithResult(_0x53a312,null))[_0x29c5('0x49')](handleError(_0x53a312,null));};exports[_0x29c5('0xc0')]=function(_0x1967bb,_0x70c814){var _0x5ab5f3,_0x5a9218,_0x38d4a5;var _0x2091ea=[];var _0x205d2c={};var _0x5e3cde=_0x1967bb[_0x29c5('0xc1')]||[];var _0x55ae34=[];var _0x5144e3;return db['CmContact'][_0x29c5('0x52')]()[_0x29c5('0x13')](function(_0x39bd70){if(!_0x39bd70){throw new db[(_0x29c5('0x80'))]['ValidationError'](_0x29c5('0x81'));}_0x2091ea=_[_0x29c5('0x82')](_[_0x29c5('0x34')](_0x39bd70),[_0x29c5('0x83'),_0x29c5('0x84'),_0x29c5('0x85'),_0x29c5('0x86')]);if(_0x1967bb[_0x29c5('0x4b')]['id']){delete _0x1967bb[_0x29c5('0x4b')]['id'];}if(_['isNil'](_0x1967bb[_0x29c5('0x4b')]['from'])){throw _0x70c814[_0x29c5('0x1e')](0x1f4)[_0x29c5('0xc2')](new db[(_0x29c5('0x80'))][(_0x29c5('0x88'))](_0x29c5('0x89')));}if(_[_0x29c5('0x6c')](_0x1967bb[_0x29c5('0x4b')]['body'])||_0x1967bb[_0x29c5('0x4b')][_0x29c5('0x4b')]===''){throw _0x70c814[_0x29c5('0x1e')](0x1f4)[_0x29c5('0xc2')](new db[(_0x29c5('0x80'))][(_0x29c5('0x88'))](_0x29c5('0x8a')));}if(_[_0x29c5('0x6c')](_0x1967bb[_0x29c5('0x4b')]['mapKeyOffline'])){throw _0x70c814[_0x29c5('0x1e')](0x1f4)[_0x29c5('0xc2')](new db[(_0x29c5('0x80'))][(_0x29c5('0x88'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2091ea));}if(!_[_0x29c5('0xc3')](_0x2091ea,_0x1967bb[_0x29c5('0x4b')][_0x29c5('0xc4')])){throw _0x70c814['status'](0x1f4)[_0x29c5('0xc2')](new db[(_0x29c5('0x80'))][(_0x29c5('0x88'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2091ea));}_0x205d2c[_0x1967bb[_0x29c5('0x4b')][_0x29c5('0xc4')]]=_0x1967bb['body'][_0x29c5('0x87')];})[_0x29c5('0x13')](function(){return db[_0x29c5('0x2f')][_0x29c5('0x48')]({'where':{'id':_0x1967bb[_0x29c5('0x44')]['id']},'include':[{'model':db[_0x29c5('0x8e')],'as':_0x29c5('0x8f')},{'model':db[_0x29c5('0xc5')],'as':_0x29c5('0xc5')}]});})[_0x29c5('0x13')](handleEntityNotFound(_0x70c814,null))[_0x29c5('0x13')](function(_0x212473){if(_0x212473&&_0x212473[_0x29c5('0x8f')]){_0x5a9218=_0x212473;var _0x1bde6d=_[_0x29c5('0xa')](_0x1967bb[_0x29c5('0x4b')],{'firstName':_0x1967bb['body'][_0x29c5('0x87')],'phone':_0x1967bb[_0x29c5('0x4b')][_0x29c5('0x87')],'ListId':_0x212473['ListId']});_0x1bde6d[_0x1967bb[_0x29c5('0x4b')][_0x29c5('0xc4')]]=_0x1967bb[_0x29c5('0x4b')][_0x29c5('0x87')];return db['CmContact']['findOrCreate']({'where':_0x205d2c,'defaults':_0x1bde6d});}})[_0x29c5('0xaf')](function(_0x1d03b3){if(_0x1d03b3){_0x38d4a5=_0x1d03b3;var _0xc2b998=fs[_0x29c5('0xc6')](path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0xc7')),_0x29c5('0xc8'));var _0x29020e=ejs[_0x29c5('0xc9')](_0xc2b998,{'body':_['toPairs'](_0x1967bb[_0x29c5('0x4b')]['body']),'bodyTitle':_0x5a9218['offlineMessageBody']});return db[_0x29c5('0xca')]['create']({'body':_0x29020e,'plainBody':htmlToText[_0x29c5('0xcb')](_0x29020e),'ContactId':_0x1d03b3['id'],'ChatWebsiteId':_0x5a9218['id']});}})['then'](function(_0x2167e1){_0x5144e3=_0x2167e1;if(_0x5e3cde[_0x29c5('0x38')]){var _0x5b8e36=_0x5e3cde['map'](function(_0x4d40d1){return{'name':_0x4d40d1[_0x29c5('0xcc')],'basename':_0x4d40d1[_0x29c5('0x65')],'type':_0x4d40d1['mimetype'],'ChatOfflineMessageId':_0x2167e1['id']};});_0x55ae34=_0x5b8e36['map'](_0x3950ad=>{var _0x24248d={'filename':_0x3950ad[_0x29c5('0x2b')],'path':path['join'](config[_0x29c5('0x68')],_0x29c5('0xcd'),_0x29c5('0xc1'),_0x29c5('0xce'),_0x29c5('0xcf'),_0x3950ad[_0x29c5('0xd0')])};return _0x24248d;});if(!_0x5a9218['openNewInteraction']){return db[_0x29c5('0xd1')][_0x29c5('0xd2')](function(_0x2a1631){return db['Attachment'][_0x29c5('0xd3')](_0x5b8e36,{'transaction':_0x2a1631});});}}})['then'](function(){if(_0x5144e3){_0x5ab5f3=_0x5144e3;return db[_0x29c5('0xc5')][_0x29c5('0xd4')]({'where':{'service':!![]},'include':[{'model':db[_0x29c5('0xd5')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x29c5('0xd6')],'as':_0x29c5('0xd6'),'raw':!![]}]}]});}})[_0x29c5('0x13')](function(_0xd6189d){if(_0xd6189d&&_0xd6189d[_0x29c5('0xd7')]&&_0x5a9218[_0x29c5('0xd8')]&&_0x5a9218[_0x29c5('0xd9')]){var _0x3bdc20=_0xd6189d[_0x29c5('0xda')]();return respondWithRpcPromise(_0x29c5('0xdb'),_0x29c5('0xdc'),{'account':_0x3bdc20,'message':{'from':util['format'](_0x29c5('0xdd'),_0xd6189d['name'],_0xd6189d[_0x29c5('0xde')]||_0xd6189d[_0x29c5('0xd7')][_0x29c5('0x4c')]),'to':_0x5a9218['forwardOfflineAddress'],'subject':_0x5a9218[_0x29c5('0xdf')],'html':_0x5ab5f3[_0x29c5('0x4b')],'attachments':_0x55ae34}},client9003)[_0x29c5('0x13')](function(){return _0x5ab5f3;})[_0x29c5('0x49')](function(_0x28ec64){logger['error'](_0x28ec64);});}})[_0x29c5('0x13')](function(){if(_0x5a9218&&_0x5a9218[_0x29c5('0xe0')]&&_0x5a9218[_0x29c5('0xe1')]){var _0x17253f=[];if(_0x5e3cde[_0x29c5('0x38')]){_0x17253f=_0x5e3cde[_0x29c5('0x2e')](function(_0x250581){return{'name':_0x250581[_0x29c5('0xcc')],'basename':_0x250581['filename'],'type':_0x250581[_0x29c5('0xe2')],'ChatOfflineMessageId':_0x5144e3['id']};});}var _0xfb7b96;if(!_['isNil'](_0x5a9218[_0x29c5('0xe3')])){var _0x5e56d9=_[_0x29c5('0x2e')](_0x1967bb[_0x29c5('0x4b')],function(_0x4570cd){return _0x4570cd;});var _0x378cbe=_[_0x29c5('0xe4')](_0x5e56d9)[0x0];var _0x597fd8=_[_0x29c5('0xe5')](_0x378cbe,function(_0x9ca865){return _0x9ca865;});_0xfb7b96=_0x597fd8[0x1][_0x5a9218[_0x29c5('0xe3')]];}var _0x1d3db8={'from':_0x38d4a5['email'],'firstName':_0x38d4a5[_0x29c5('0xa0')],'lastName':_0x38d4a5[_0x29c5('0xe6')],'mapKey':_0x29c5('0xde'),'message':{'from':_0x38d4a5[_0x29c5('0xde')],'to':_0x5a9218['MailAccount'][_0x29c5('0xde')],'cc':'','subject':_[_0x29c5('0x6c')](_0xfb7b96)?_0x5a9218[_0x29c5('0xdf')]:_0xfb7b96,'messageId':'','sentAt':new Date(),'attach':_0x17253f['length'],'attachments':_0x17253f,'originChannel':_0x29c5('0xe7'),'ChatWebsiteId':_0x5a9218['id'],'ChatOfflineMessageId':_0x5ab5f3['id'],'originTo':_0x5a9218[_0x29c5('0xc5')]['email']},'body':_0x5ab5f3[_0x29c5('0x4b')]};var _0x87b45f={'account':{'id':_0x5a9218['MailAccountId']},'body':_0x1d3db8,'log':_0x29c5('0xe8')};return respondWithRpcPromise(_0x29c5('0xe8'),_0x29c5('0xe9'),_0x87b45f,client9001)[_0x29c5('0x13')](function(){return _0x5ab5f3;})[_0x29c5('0x49')](function(_0x343503){logger[_0x29c5('0x1a')](_0x343503);});}return;})['then'](function(){if(_0x5ab5f3){return _0x5ab5f3;}})[_0x29c5('0x13')](respondWithResult(_0x70c814,null))[_0x29c5('0x49')](function(_0x163978){logger[_0x29c5('0x1a')](_0x29c5('0x49'),_0x163978);for(var _0x207de6 of _0x5e3cde){var _0x53cc6=path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0xcd'),_0x29c5('0xc1'),'attachments',_0x29c5('0xcf'),_0x207de6['filename']);fs_extra[_0x29c5('0xea')](_0x53cc6)[_0x29c5('0x49')](function(_0x4f5c5a){logger['error'](_0x29c5('0xeb'),_0x53cc6,_0x4f5c5a);});}});};exports[_0x29c5('0xec')]=function(_0x4a8274,_0xe88a13){return db[_0x29c5('0xac')][_0x29c5('0x48')]({'where':{'id':_0x4a8274[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0xe88a13,null))[_0x29c5('0x13')](function(_0x4368f1){if(_0x4368f1){return _0x4368f1[_0x29c5('0xec')](_0x4a8274[_0x29c5('0x4b')][_0x29c5('0x5a')],_[_0x29c5('0xed')](_0x4a8274[_0x29c5('0x4b')],[_0x29c5('0x5a'),'id'])||{});}})[_0x29c5('0x13')](respondWithResult(_0xe88a13,null))[_0x29c5('0x49')](handleError(_0xe88a13,null));};exports['getInteractions']=function(_0x217034,_0x463058){var _0x5e56f0={'raw':![],'where':{}};var _0x57af12={};var _0x2fb78a={'count':0x0,'rows':[]};return db[_0x29c5('0x2f')][_0x29c5('0xd4')]({'where':{'id':_0x217034['params']['id']}})['then'](handleEntityNotFound(_0x463058,null))[_0x29c5('0x13')](function(_0x53bef2){if(_0x53bef2){_0x57af12[_0x29c5('0x32')]=_['keys'](db[_0x29c5('0xac')][_0x29c5('0x57')]);_0x57af12[_0x29c5('0x33')]=_[_0x29c5('0x34')](_0x217034[_0x29c5('0x33')]);_0x57af12['filters']=_[_0x29c5('0x36')](_0x57af12[_0x29c5('0x32')],_0x57af12['query']);_0x5e56f0[_0x29c5('0x37')]=_[_0x29c5('0x36')](_0x57af12[_0x29c5('0x32')],qs[_0x29c5('0x45')](_0x217034[_0x29c5('0x33')][_0x29c5('0x45')]));_0x5e56f0[_0x29c5('0x37')]=_0x5e56f0[_0x29c5('0x37')][_0x29c5('0x38')]?_0x5e56f0[_0x29c5('0x37')]:_0x57af12[_0x29c5('0x32')];if(!_0x217034[_0x29c5('0x33')][_0x29c5('0x39')]('nolimit')){_0x5e56f0[_0x29c5('0x22')]=qs[_0x29c5('0x22')](_0x217034[_0x29c5('0x33')][_0x29c5('0x22')]);_0x5e56f0[_0x29c5('0x24')]=qs[_0x29c5('0x24')](_0x217034[_0x29c5('0x33')][_0x29c5('0x24')]);}_0x5e56f0[_0x29c5('0x3b')]=qs[_0x29c5('0x3c')](_0x217034[_0x29c5('0x33')]['sort']);_0x5e56f0['where']=qs[_0x29c5('0x35')](_[_0x29c5('0x3e')](_0x217034[_0x29c5('0x33')],_0x57af12[_0x29c5('0x35')]));_0x5e56f0[_0x29c5('0x3d')][_0x29c5('0x54')]=_0x53bef2['id'];if(_0x217034[_0x29c5('0x33')]['filter']){_0x5e56f0['where']=_[_0x29c5('0x58')](_0x5e56f0['where'],{'$or':_[_0x29c5('0x2e')](_0x5e56f0[_0x29c5('0x37')],function(_0x40c0c2){var _0x4e97bb={};_0x4e97bb[_0x40c0c2]={'$like':'%'+_0x217034['query']['filter']+'%'};return _0x4e97bb;})});}_0x5e56f0=_[_0x29c5('0x58')]({},_0x5e56f0,_0x217034[_0x29c5('0x47')]);return db[_0x29c5('0xac')][_0x29c5('0x23')]({'where':_0x5e56f0[_0x29c5('0x3d')]})[_0x29c5('0x13')](function(_0x4eaf4d){_0x2fb78a[_0x29c5('0x23')]=_0x4eaf4d;if(_0x217034[_0x29c5('0x33')][_0x29c5('0x46')]){_0x5e56f0['include']=[{'model':db[_0x29c5('0x7f')],'as':_0x29c5('0xee'),'required':![]},{'model':db[_0x29c5('0xb9')],'as':_0x29c5('0xef'),'attributes':[_0x29c5('0x2b'),'fullname','internal'],'required':![]},{'model':db[_0x29c5('0xf0')],'as':_0x29c5('0xf1'),'attributes':['id','name',_0x29c5('0xf2')],'where':_0x217034[_0x29c5('0x33')][_0x29c5('0xf3')]?{'id':_0x217034[_0x29c5('0x33')][_0x29c5('0xf3')]}:undefined,'required':_0x217034[_0x29c5('0x33')]['tag']?!![]:![]}];}return db[_0x29c5('0xac')][_0x29c5('0x42')](_0x5e56f0);})[_0x29c5('0x13')](function(_0x187d3c){_0x2fb78a[_0x29c5('0xf4')]=_0x187d3c;return _0x2fb78a;});}})[_0x29c5('0x13')](respondWithFilteredResult(_0x463058,_0x5e56f0))['catch'](handleError(_0x463058,null));};function iftimePromise(_0x18eb85,_0x4c778f){return respondWithRpcPromise(_0x29c5('0xf5'),_0x29c5('0xf6'),{'command':_0x4c778f[_0x29c5('0xf7')]?util[_0x29c5('0xa5')](_0x29c5('0xf8'),_0x18eb85['interval'],_0x4c778f['timezone']):util[_0x29c5('0xa5')](_0x29c5('0xf9'),_0x18eb85['interval'])},client9002)[_0x29c5('0x13')](function(_0x439278){var _0x447be2=_0x439278&&_0x439278['indexOf'](_0x29c5('0xfa'))>=0x0?!![]:![];logger[_0x29c5('0x14')](_0x29c5('0xfb'),_0x4c778f['id'],_0x18eb85['id'],_0x18eb85[_0x29c5('0xfc')],_0x447be2?'ONLINE':_0x29c5('0xfd'),_0x4c778f[_0x29c5('0xf7')]?_0x4c778f['timezone']:_0x29c5('0xfe'));return _0x447be2;})[_0x29c5('0x49')](function(_0x35a081){logger['error'](_0x29c5('0xfb'),_0x4c778f['id'],_0x18eb85['id'],_0x18eb85['interval'],util[_0x29c5('0xff')](_0x35a081,{'showHidden':![],'depth':null}),_0x4c778f[_0x29c5('0xf7')]?_0x4c778f[_0x29c5('0xf7')]:_0x29c5('0xfe'));return![];});}exports[_0x29c5('0xf6')]=function(_0x149fbc,_0x383f7c){var _0x55d274=0x0;var _0xfe70d3=0x0;var _0x34b662=![];var _0x178209;var _0x4f67ed;return db[_0x29c5('0x2f')]['find']({'where':{'id':_0x149fbc[_0x29c5('0x44')]['id']},'include':[{'model':db['Interval'],'as':_0x29c5('0x100'),'include':[{'model':db[_0x29c5('0x100')],'as':_0x29c5('0x101'),'attributes':['id',_0x29c5('0xfc')],'raw':!![]}]}]})[_0x29c5('0x13')](handleEntityNotFound(_0x383f7c,null))['then'](function(_0x3ac6cd){if(_0x3ac6cd){_0x178209=_0x3ac6cd;return _0x3ac6cd[_0x29c5('0x102')]({'raw':!![]});}})['then'](function(_0xfa693e){if(_0x178209){if(_0xfa693e){_0x4f67ed=_0xfa693e;}}return require(_0x29c5('0x69'))[_0x29c5('0x6a')]();})[_0x29c5('0x13')](function(_0x51f4a6){if(_0x51f4a6){_0xfe70d3=_0x51f4a6[_0x29c5('0x103')];_0x34b662=_0x51f4a6[_0x29c5('0x6b')];}})[_0x29c5('0x13')](function(){return db[_0x29c5('0xac')]['count']({'where':{'closed':![]}});})[_0x29c5('0x13')](function(_0x135ce2){_0x55d274=_0x135ce2;if(_0xfe70d3&&_0x135ce2>_0xfe70d3){return db[_0x29c5('0x104')][_0x29c5('0xd4')]({'where':{'id':0x1}})[_0x29c5('0x13')](function(_0xd02839){if(_0xd02839){_0xd02839[_0x29c5('0x105')]('chatLicenseExceeded');}});}})['then'](function(){if(_0x178209[_0x29c5('0x100')]&&_0x178209[_0x29c5('0x100')]['Intervals']){var _0x216cb1=[];for(var _0x6c5005=0x0;_0x6c5005<_0x178209[_0x29c5('0x100')][_0x29c5('0x101')][_0x29c5('0x38')];_0x6c5005++){var _0x4bc8e1=_0x178209['Interval']['Intervals'][_0x6c5005][_0x29c5('0x28')]({'plain':!![]});_0x216cb1[_0x29c5('0x106')](iftimePromise(_0x4bc8e1,_0x178209));}return BPromise[_0x29c5('0x107')](_0x216cb1)[_0x29c5('0x13')](function(_0x3d624e){return _['some'](_0x3d624e);});}else{return!![];}})[_0x29c5('0x13')](function(_0x80b541){var _0x3a761d=fs[_0x29c5('0xc6')](path[_0x29c5('0x6e')](config[_0x29c5('0x68')],_0x29c5('0x108')),_0x29c5('0xc8'));var _0x193f51=new url['URL'](_0x178209['address'])['origin'];var _0x270441=_0x29c5('0x109');var _0x195484=![];var _0x387a43={'chatVersion':_0x270441,'chatWebsiteAddressOrigin':_0x193f51,'remote':_0x178209[_0x29c5('0x10a')],'query':querystring['stringify'](_[_0x29c5('0x58')](_0x178209[_0x29c5('0x28')]({'plain':!![]}),{'customerIp':_0x149fbc[_0x29c5('0x9c')][_0x29c5('0x9d')]||_0x149fbc[_0x29c5('0x9c')]['x-real-ip']||_0x149fbc[_0x29c5('0x10b')]['remoteAddress']||_0x149fbc['ip'],'referer':_0x149fbc[_0x29c5('0x9c')][_0x29c5('0xa2')],'openedInteractions':_0x55d274,'maxInteractions':_0xfe70d3,'virtual':_0x34b662[_0x29c5('0x103')],'online':_0x80b541,'custom':_0x34b662}))[_0x29c5('0x10c')](/'/g,'\x5c\x27')};_0x383f7c[_0x29c5('0xc2')](ejs['render'](Mustache[_0x29c5('0xc9')](_0x3a761d,_0x387a43),{'proactiveActions':_0x4f67ed,'alignment':_0x178209[_0x29c5('0x10d')],'verticalAlignment':_0x178209[_0x29c5('0x10e')],'div_color':_0x178209[_0x29c5('0xf2')],'labelText':_0x178209['labelText'],'text_color':_0x178209[_0x29c5('0x10f')],'text_button_color':_0x178209['textButtonColor'],'button_color':_0x178209[_0x29c5('0x110')],'background_color':_0x178209['backgroundColor'],'hideWhenOffline':_0x178209[_0x29c5('0x111')],'intervalId':_0x178209[_0x29c5('0x112')],'isDevelopment':_0x195484,'chatVersion':_0x270441}));})['catch'](handleError(_0x383f7c,null));};exports[_0x29c5('0x113')]=function(_0x5b123c,_0x4352d7){var _0x9e2e02=_0x5b123c['params']['id'];var _0x36d19b=_0x5b123c[_0x29c5('0x4b')];var _0x3b4b02=0xc8;var _0x58ec10=null;return db['sequelize'][_0x29c5('0xd2')]({'isolationLevel':db['sequelize'][_0x29c5('0x114')]['ISOLATION_LEVELS'][_0x29c5('0x115')]},function(_0x2ef734){return db[_0x29c5('0x2f')][_0x29c5('0xd4')]({'where':{'id':_0x9e2e02},'transaction':_0x2ef734})[_0x29c5('0x13')](function(_0xf9cd4a){if(_0xf9cd4a){return db[_0x29c5('0x92')]['destroy']({'where':{'ChatWebsiteId':_0x9e2e02},'transaction':_0x2ef734})[_0x29c5('0x13')](function(){var _0x36cc79=_[_0x29c5('0x2e')](_0x36d19b,function(_0x9b81eb){_0x9b81eb['ChatWebsiteId']=_0x9e2e02;return _0x9b81eb;});return db[_0x29c5('0x92')][_0x29c5('0xd3')](_0x36cc79,{'transaction':_0x2ef734});});}else{_0x3b4b02=0x194;_0x58ec10=[];}});})[_0x29c5('0x13')](function(){if(_0x3b4b02!==0x194){return db[_0x29c5('0x92')][_0x29c5('0x116')]({'where':{'ChatWebsiteId':_0x9e2e02},'order':_0x29c5('0x98')})['then'](function(_0x99c41a){_0x58ec10=_0x99c41a;});}})[_0x29c5('0x49')](function(_0x2247ff){_0x3b4b02=0x1f4;logger[_0x29c5('0x1a')](_0x2247ff[_0x29c5('0x117')]);if(_0x2247ff[_0x29c5('0x2b')]){delete _0x2247ff[_0x29c5('0x2b')];}_0x58ec10=_0x2247ff;})[_0x29c5('0x118')](function(){if(_0x58ec10===null){_0x4352d7[_0x29c5('0x1d')](_0x3b4b02);}else{if(_0x3b4b02===0x1f4){_0x4352d7['status'](_0x3b4b02)[_0x29c5('0xc2')](_0x58ec10);}else{_0x4352d7['status'](_0x3b4b02)[_0x29c5('0x20')](_0x58ec10);}}});};exports['getApplications']=function(_0x26913e,_0x5cdf81){var _0x38931b={};var _0x21ec3c={};var _0x54e820;var _0x49dddd;return db[_0x29c5('0x2f')][_0x29c5('0xd4')]({'where':{'id':_0x26913e[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x5cdf81,null))[_0x29c5('0x13')](function(_0x3482a7){if(_0x3482a7){_0x54e820=_0x3482a7;_0x21ec3c[_0x29c5('0x32')]=_[_0x29c5('0x34')](db['ChatApplication'][_0x29c5('0x57')]);_0x21ec3c[_0x29c5('0x33')]=_[_0x29c5('0x34')](_0x26913e['query']);_0x21ec3c[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0x21ec3c[_0x29c5('0x32')],_0x21ec3c[_0x29c5('0x33')]);_0x38931b[_0x29c5('0x37')]=_[_0x29c5('0x36')](_0x21ec3c[_0x29c5('0x32')],qs['fields'](_0x26913e[_0x29c5('0x33')][_0x29c5('0x45')]));_0x38931b[_0x29c5('0x37')]=_0x38931b[_0x29c5('0x37')][_0x29c5('0x38')]?_0x38931b['attributes']:_0x21ec3c[_0x29c5('0x32')];_0x38931b[_0x29c5('0x3b')]=qs[_0x29c5('0x3c')](_0x26913e[_0x29c5('0x33')]['sort']);_0x38931b[_0x29c5('0x3d')]=qs[_0x29c5('0x35')](_[_0x29c5('0x3e')](_0x26913e[_0x29c5('0x33')],_0x21ec3c[_0x29c5('0x35')]));if(_0x26913e[_0x29c5('0x33')][_0x29c5('0x3f')]){_0x38931b[_0x29c5('0x3d')]=_[_0x29c5('0x58')](_0x38931b['where'],{'$or':_['map'](_0x38931b[_0x29c5('0x37')],function(_0x4c3d14){var _0x5ee6a4={};_0x5ee6a4[_0x4c3d14]={'$like':'%'+_0x26913e['query'][_0x29c5('0x3f')]+'%'};return _0x5ee6a4;})});}_0x38931b=_[_0x29c5('0x58')]({},_0x38931b,_0x26913e['options']);return _0x54e820[_0x29c5('0x119')](_0x38931b);}})[_0x29c5('0x13')](function(_0x313918){if(_0x313918){_0x49dddd=_0x313918['length'];if(!_0x26913e[_0x29c5('0x33')][_0x29c5('0x39')](_0x29c5('0x3a'))){_0x38931b['limit']=qs[_0x29c5('0x22')](_0x26913e[_0x29c5('0x33')][_0x29c5('0x22')]);_0x38931b[_0x29c5('0x24')]=qs[_0x29c5('0x24')](_0x26913e[_0x29c5('0x33')][_0x29c5('0x24')]);}return _0x54e820[_0x29c5('0x119')](_0x38931b);}})[_0x29c5('0x13')](function(_0x38a480){if(_0x38a480){return _0x38a480?{'count':_0x49dddd,'rows':_0x38a480}:null;}})[_0x29c5('0x13')](respondWithResult(_0x5cdf81,null))[_0x29c5('0x49')](handleError(_0x5cdf81,null));};exports[_0x29c5('0x11a')]=function(_0x4d94b0,_0x1a3281){return db['chatProactiveAction']['find']({'where':{'id':_0x4d94b0[_0x29c5('0x44')]['id']}})['then'](handleEntityNotFound(_0x1a3281,null))[_0x29c5('0x13')](function(_0x5da452){if(_0x5da452){return _0x5da452[_0x29c5('0x11a')](_0x4d94b0[_0x29c5('0x4b')][_0x29c5('0x5a')],_[_0x29c5('0xed')](_0x4d94b0[_0x29c5('0x4b')],[_0x29c5('0x5a'),'id'])||{});}})[_0x29c5('0x13')](respondWithResult(_0x1a3281,null))['catch'](handleError(_0x1a3281,null));};exports['getProactiveActions']=function(_0xd82b90,_0x150dd2){var _0x43070c={};var _0x308f10={};var _0x2029b7;var _0x26997d;return db[_0x29c5('0x2f')][_0x29c5('0xd4')]({'where':{'id':_0xd82b90['params']['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x150dd2,null))[_0x29c5('0x13')](function(_0x44cb19){if(_0x44cb19){_0x2029b7=_0x44cb19;_0x308f10[_0x29c5('0x32')]=_['keys'](db[_0x29c5('0x11b')][_0x29c5('0x57')]);_0x308f10[_0x29c5('0x33')]=_[_0x29c5('0x34')](_0xd82b90[_0x29c5('0x33')]);_0x308f10[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0x308f10[_0x29c5('0x32')],_0x308f10[_0x29c5('0x33')]);_0x43070c[_0x29c5('0x37')]=_[_0x29c5('0x36')](_0x308f10[_0x29c5('0x32')],qs[_0x29c5('0x45')](_0xd82b90[_0x29c5('0x33')][_0x29c5('0x45')]));_0x43070c[_0x29c5('0x37')]=_0x43070c[_0x29c5('0x37')][_0x29c5('0x38')]?_0x43070c[_0x29c5('0x37')]:_0x308f10[_0x29c5('0x32')];_0x43070c[_0x29c5('0x3b')]=qs['sort'](_0xd82b90[_0x29c5('0x33')][_0x29c5('0x3c')]);_0x43070c[_0x29c5('0x3d')]=qs['filters'](_[_0x29c5('0x3e')](_0xd82b90[_0x29c5('0x33')],_0x308f10[_0x29c5('0x35')]));if(_0xd82b90[_0x29c5('0x33')]['filter']){_0x43070c[_0x29c5('0x3d')]=_[_0x29c5('0x58')](_0x43070c[_0x29c5('0x3d')],{'$or':_['map'](_0x43070c[_0x29c5('0x37')],function(_0x555374){var _0xdd9a7b={};_0xdd9a7b[_0x555374]={'$like':'%'+_0xd82b90[_0x29c5('0x33')][_0x29c5('0x3f')]+'%'};return _0xdd9a7b;})});}_0x43070c=_[_0x29c5('0x58')]({},_0x43070c,_0xd82b90[_0x29c5('0x47')]);return _0x2029b7[_0x29c5('0x102')](_0x43070c);}})[_0x29c5('0x13')](function(_0x1d1842){if(_0x1d1842){_0x26997d=_0x1d1842[_0x29c5('0x38')];if(!_0xd82b90['query'][_0x29c5('0x39')](_0x29c5('0x3a'))){_0x43070c['limit']=qs[_0x29c5('0x22')](_0xd82b90[_0x29c5('0x33')][_0x29c5('0x22')]);_0x43070c[_0x29c5('0x24')]=qs[_0x29c5('0x24')](_0xd82b90['query'][_0x29c5('0x24')]);}return _0x2029b7[_0x29c5('0x102')](_0x43070c);}})[_0x29c5('0x13')](function(_0x4f0f82){if(_0x4f0f82){return _0x4f0f82?{'count':_0x26997d,'rows':_0x4f0f82}:null;}})[_0x29c5('0x13')](respondWithResult(_0x150dd2,null))['catch'](handleError(_0x150dd2,null));};exports[_0x29c5('0x11c')]=function(_0x4d9c87,_0x3f3686){var _0x58913a=_0x4d9c87[_0x29c5('0x33')][_0x29c5('0x11d')]===_0x29c5('0x11e')?_0x29c5('0x11f'):_0x29c5('0x120');return db['ChatWebsite']['find']({'attributes':['id',_0x58913a],'where':{'id':_0x4d9c87[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x3f3686,null))['then'](function(_0x37d4b9){if(_0x37d4b9){var _0x380833=_0x37d4b9[_0x58913a];var _0x3d439f=_0x380833&&_0x380833[_0x29c5('0x121')]?_0x380833[_0x29c5('0x121')]:[];_0x3f3686[_0x29c5('0xc2')]({'fromKey':_[_0x29c5('0x6c')](_0x380833[_0x29c5('0x122')])?undefined:_0x380833[_0x29c5('0x122')],'count':_0x3d439f[_0x29c5('0x38')],'rows':_0x3d439f});}})[_0x29c5('0x49')](handleError(_0x3f3686,null));};exports['getOfflineMessages']=function(_0x4c0564,_0x22877e){var _0x38f789={'raw':![],'where':{}};var _0x2c9c19={};var _0x2af551={'count':0x0,'rows':[]};return db[_0x29c5('0x2f')][_0x29c5('0xd4')]({'where':{'id':_0x4c0564[_0x29c5('0x44')]['id']}})['then'](handleEntityNotFound(_0x22877e,null))['then'](function(_0x3e863a){if(_0x3e863a){_0x2c9c19[_0x29c5('0x32')]=_[_0x29c5('0x34')](db[_0x29c5('0xca')][_0x29c5('0x57')]);_0x2c9c19[_0x29c5('0x33')]=_['keys'](_0x4c0564[_0x29c5('0x33')]);_0x2c9c19[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0x2c9c19[_0x29c5('0x32')],_0x2c9c19[_0x29c5('0x33')]);_0x38f789[_0x29c5('0x37')]=_[_0x29c5('0x36')](_0x2c9c19[_0x29c5('0x32')],qs['fields'](_0x4c0564[_0x29c5('0x33')][_0x29c5('0x45')]));_0x38f789[_0x29c5('0x37')]=_0x38f789['attributes'][_0x29c5('0x38')]?_0x38f789[_0x29c5('0x37')]:_0x2c9c19[_0x29c5('0x32')];if(!_0x4c0564[_0x29c5('0x33')]['hasOwnProperty'](_0x29c5('0x3a'))){_0x38f789[_0x29c5('0x22')]=qs[_0x29c5('0x22')](_0x4c0564[_0x29c5('0x33')][_0x29c5('0x22')]);_0x38f789[_0x29c5('0x24')]=qs[_0x29c5('0x24')](_0x4c0564[_0x29c5('0x33')][_0x29c5('0x24')]);}_0x38f789['order']=qs['sort'](_0x4c0564['query'][_0x29c5('0x3c')]);_0x38f789[_0x29c5('0x3d')]=qs[_0x29c5('0x35')](_[_0x29c5('0x3e')](_0x4c0564[_0x29c5('0x33')],_0x2c9c19[_0x29c5('0x35')]));_0x38f789[_0x29c5('0x3d')][_0x29c5('0x54')]=_0x3e863a['id'];if(_0x4c0564[_0x29c5('0x33')][_0x29c5('0x3f')]){_0x38f789[_0x29c5('0x3d')]=_[_0x29c5('0x58')](_0x38f789[_0x29c5('0x3d')],{'$or':_[_0x29c5('0x2e')](_0x38f789[_0x29c5('0x37')],function(_0x1dbd59){var _0x13915c={};_0x13915c[_0x1dbd59]={'$like':'%'+_0x4c0564['query'][_0x29c5('0x3f')]+'%'};return _0x13915c;})});}_0x38f789=_[_0x29c5('0x58')]({},_0x38f789,_0x4c0564['options']);return db['ChatOfflineMessage'][_0x29c5('0x23')]({'where':_0x38f789[_0x29c5('0x3d')]})['then'](function(_0x19d57f){_0x2af551[_0x29c5('0x23')]=_0x19d57f;if(_0x4c0564['query'][_0x29c5('0x46')]){_0x38f789[_0x29c5('0x41')]=[{'all':!![]}];}else{_0x38f789[_0x29c5('0x41')]=[{'model':db[_0x29c5('0x7f')],'as':_0x29c5('0xee'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0x29c5('0xca')][_0x29c5('0x42')](_0x38f789);})[_0x29c5('0x13')](function(_0x5cb948){_0x2af551['rows']=_0x5cb948;return _0x2af551;});}})[_0x29c5('0x13')](respondWithFilteredResult(_0x22877e,_0x38f789))[_0x29c5('0x49')](handleError(_0x22877e,null));};exports[_0x29c5('0x123')]=function(_0x5a73ea,_0x3eeba3){return db[_0x29c5('0x2f')][_0x29c5('0x48')]({'where':{'id':_0x5a73ea[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x3eeba3,null))[_0x29c5('0x13')](function(_0x5dedb4){if(_0x5dedb4){return _0x5dedb4[_0x29c5('0x123')](_0x5a73ea[_0x29c5('0x4b')][_0x29c5('0x5a')],_[_0x29c5('0xed')](_0x5a73ea[_0x29c5('0x4b')],[_0x29c5('0x5a'),'id'])||{})[_0x29c5('0xaf')](function(_0x4609b4){for(var _0xb396d=0x0;_0xb396d<_0x5a73ea[_0x29c5('0x4b')]['ids']['length'];_0xb396d+=0x1){socket[_0x29c5('0x124')](_0x29c5('0x125'),{'UserId':Number(_0x5a73ea['body'][_0x29c5('0x5a')][_0xb396d]),'ChatWebsiteId':Number(_0x5a73ea[_0x29c5('0x44')]['id'])});}return _0x4609b4;});}})[_0x29c5('0x13')](respondWithResult(_0x3eeba3,null))[_0x29c5('0x49')](handleError(_0x3eeba3,null));};exports[_0x29c5('0x126')]=function(_0x1fc9fb,_0x2c6bd6){return db[_0x29c5('0x2f')][_0x29c5('0x48')]({'where':{'id':_0x1fc9fb[_0x29c5('0x44')]['id']}})[_0x29c5('0x13')](handleEntityNotFound(_0x2c6bd6,null))[_0x29c5('0x13')](function(_0x1a72fb){if(_0x1a72fb){return _0x1a72fb[_0x29c5('0x126')](_0x1fc9fb[_0x29c5('0x33')]['ids'])['then'](function(){if(_[_0x29c5('0x127')](_0x1fc9fb['query'][_0x29c5('0x5a')])){for(var _0x1bc7c3=0x0;_0x1bc7c3<_0x1fc9fb[_0x29c5('0x33')][_0x29c5('0x5a')][_0x29c5('0x38')];_0x1bc7c3+=0x1){socket[_0x29c5('0x124')](_0x29c5('0x128'),{'UserId':Number(_0x1fc9fb[_0x29c5('0x33')][_0x29c5('0x5a')][_0x1bc7c3]),'ChatWebsiteId':Number(_0x1fc9fb[_0x29c5('0x44')]['id'])});}}else{socket[_0x29c5('0x124')](_0x29c5('0x128'),{'UserId':Number(_0x1fc9fb['query'][_0x29c5('0x5a')]),'ChatWebsiteId':Number(_0x1fc9fb[_0x29c5('0x44')]['id'])});}});}})[_0x29c5('0x13')](respondWithStatusCode(_0x2c6bd6,null))[_0x29c5('0x49')](handleError(_0x2c6bd6,null));};exports['getAgents']=function(_0xbeb7f9,_0x3a3f65){var _0x47801b={};var _0x3228ff={};var _0x107054;var _0x44fc78;return db['ChatWebsite']['findOne']({'where':{'id':_0xbeb7f9[_0x29c5('0x44')]['id']}})['then'](handleEntityNotFound(_0x3a3f65,null))[_0x29c5('0x13')](function(_0x232569){if(_0x232569){_0x107054=_0x232569;_0x3228ff[_0x29c5('0x32')]=_[_0x29c5('0x34')](db[_0x29c5('0xb9')]['rawAttributes']);_0x3228ff[_0x29c5('0x33')]=_['keys'](_0xbeb7f9['query']);_0x3228ff[_0x29c5('0x35')]=_[_0x29c5('0x36')](_0x3228ff[_0x29c5('0x32')],_0x3228ff[_0x29c5('0x33')]);_0x47801b[_0x29c5('0x37')]=_[_0x29c5('0x36')](_0x3228ff['model'],qs['fields'](_0xbeb7f9[_0x29c5('0x33')]['fields']));_0x47801b[_0x29c5('0x37')]=_0x47801b[_0x29c5('0x37')][_0x29c5('0x38')]?_0x47801b[_0x29c5('0x37')]:_0x3228ff[_0x29c5('0x32')];_0x47801b[_0x29c5('0x3b')]=qs[_0x29c5('0x3c')](_0xbeb7f9['query']['sort']);_0x47801b['where']=qs[_0x29c5('0x35')](_[_0x29c5('0x3e')](_0xbeb7f9[_0x29c5('0x33')],_0x3228ff[_0x29c5('0x35')]));if(_0xbeb7f9[_0x29c5('0x33')][_0x29c5('0x3f')]){_0x47801b[_0x29c5('0x3d')]=_[_0x29c5('0x58')](_0x47801b[_0x29c5('0x3d')],{'$or':_[_0x29c5('0x2e')](_0x47801b['attributes'],function(_0x50803c){var _0x4b0bb1={};_0x4b0bb1[_0x50803c]={'$like':'%'+_0xbeb7f9['query']['filter']+'%'};return _0x4b0bb1;})});}_0x47801b=_[_0x29c5('0x58')]({},_0x47801b,_0xbeb7f9[_0x29c5('0x47')]);return _0x107054['getAgents'](_0x47801b);}})[_0x29c5('0x13')](function(_0x116b0c){if(_0x116b0c){_0x44fc78=_0x116b0c[_0x29c5('0x38')];if(!_0xbeb7f9[_0x29c5('0x33')]['hasOwnProperty'](_0x29c5('0x3a'))){_0x47801b['limit']=qs[_0x29c5('0x22')](_0xbeb7f9[_0x29c5('0x33')]['limit']);_0x47801b[_0x29c5('0x24')]=qs[_0x29c5('0x24')](_0xbeb7f9[_0x29c5('0x33')][_0x29c5('0x24')]);}return _0x107054[_0x29c5('0x129')](_0x47801b);}})[_0x29c5('0x13')](function(_0x3745cf){if(_0x3745cf){return _0x3745cf?{'count':_0x44fc78,'rows':_0x3745cf}:null;}})[_0x29c5('0x13')](respondWithResult(_0x3a3f65,null))['catch'](handleError(_0x3a3f65,null));}; \ No newline at end of file +var _0x9baf=['Applications','account','applications','priority','contact','cf-connecting-ip','headers','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','EventManager','offline','files','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','Attachment','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','email','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','all','some','readFileSync','server/files/chat/iframe.ejs','URL','address','origin','3.1.0','remote','remoteAddress','alignment','verticalAlignment','labelText','textButtonColor','backgroundColor','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','ChatApplication','findAndCountAll','stack','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','mustache','util','ejs','fs-extra','lodash','querystring','ioredis','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','html-to-text','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','update','UserProfileResource','name','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','type','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','ChatWebsites','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','download','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','setUA','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','ValidationError','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','List','CmContact','Contacts'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9baf,0x9d));var _0xf9ba=function(_0x4979f7,_0x334536){_0x4979f7=_0x4979f7-0x0;var _0x219cff=_0x9baf[_0x4979f7];return _0x219cff;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xf9ba('0x0'));var util=require(_0xf9ba('0x1'));var path=require('path');var ejs=require(_0xf9ba('0x2'));var fs=require('fs');var fs_extra=require(_0xf9ba('0x3'));var _=require(_0xf9ba('0x4'));var querystring=require(_0xf9ba('0x5'));var Redis=require(_0xf9ba('0x6'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xf9ba('0x7'));var config=require(_0xf9ba('0x8'));var url=require('url');var db=require('../../mysqldb')['db'];config[_0xf9ba('0x9')]=_[_0xf9ba('0xa')](config[_0xf9ba('0x9')],{'host':_0xf9ba('0xb'),'port':0x18eb});var socket=require(_0xf9ba('0xc'))(new Redis(config[_0xf9ba('0x9')]));require('./chatWebsite.socket')['register'](socket);var htmlToText=require(_0xf9ba('0xd'));var jayson=require(_0xf9ba('0xe'));var client=jayson[_0xf9ba('0xf')][_0xf9ba('0x10')]({'port':0x232c});var client9002=jayson['client'][_0xf9ba('0x10')]({'port':0x232a});var client9003=jayson['client'][_0xf9ba('0x10')]({'port':0x232b});var client9001=jayson[_0xf9ba('0xf')][_0xf9ba('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x231b5d,_0x49d1e7,_0x75e3cd,_0x5b4b3d){return new BPromise(function(_0xceade5,_0x3453cb){var _0x186d26=_0x5b4b3d||client;return _0x186d26[_0xf9ba('0x11')](_0x231b5d,_0x75e3cd)[_0xf9ba('0x12')](function(_0x5a61c4){logger[_0xf9ba('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x49d1e7,_0xf9ba('0x14'));logger[_0xf9ba('0x15')](_0xf9ba('0x16'),_0x49d1e7,_0xf9ba('0x14'),JSON['stringify'](_0x5a61c4));if(_0x5a61c4['error']){if(_0x5a61c4[_0xf9ba('0x17')][_0xf9ba('0x18')]===0x1f4){logger['error'](_0xf9ba('0x19'),_0x49d1e7,_0x5a61c4[_0xf9ba('0x17')]['message']);return _0x3453cb(_0x5a61c4[_0xf9ba('0x17')]['message']);}logger[_0xf9ba('0x17')](_0xf9ba('0x19'),_0x49d1e7,_0x5a61c4[_0xf9ba('0x17')][_0xf9ba('0x1a')]);return _0xceade5(_0x5a61c4['error'][_0xf9ba('0x1a')]);}else{logger['info'](_0xf9ba('0x19'),_0x49d1e7,_0xf9ba('0x14'));_0xceade5(_0x5a61c4[_0xf9ba('0x1b')][_0xf9ba('0x1a')]);}})[_0xf9ba('0x1c')](function(_0x563eac){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x49d1e7,_0x563eac);_0x3453cb(_0x563eac);});});}function respondWithStatusCode(_0x17e6b4,_0x21df90){_0x21df90=_0x21df90||0xcc;return function(_0x112f10){if(_0x112f10){return _0x17e6b4[_0xf9ba('0x1d')](_0x21df90);}return _0x17e6b4[_0xf9ba('0x1e')](_0x21df90)[_0xf9ba('0x1f')]();};}function respondWithResult(_0x3be76f,_0x536d36){_0x536d36=_0x536d36||0xc8;return function(_0xbc737d){if(_0xbc737d){return _0x3be76f[_0xf9ba('0x1e')](_0x536d36)['json'](_0xbc737d);}};}function respondWithFilteredResult(_0x106429,_0x2cf78e){return function(_0x45f99a){if(_0x45f99a){var _0x39cae0=typeof _0x2cf78e[_0xf9ba('0x20')]===_0xf9ba('0x21')&&typeof _0x2cf78e[_0xf9ba('0x22')]==='undefined';var _0x1c032a=_0x45f99a[_0xf9ba('0x23')];var _0x234f7a=_0x39cae0?0x0:_0x2cf78e['offset'];var _0x437b30=_0x39cae0?_0x45f99a['count']:_0x2cf78e['offset']+_0x2cf78e[_0xf9ba('0x22')];var _0x2636f6;if(_0x437b30>=_0x1c032a){_0x437b30=_0x1c032a;_0x2636f6=0xc8;}else{_0x2636f6=0xce;}_0x106429['status'](_0x2636f6);return _0x106429[_0xf9ba('0x24')](_0xf9ba('0x25'),_0x234f7a+'-'+_0x437b30+'/'+_0x1c032a)['json'](_0x45f99a);}return null;};}function saveUpdates(_0x21362d){return function(_0x419ec8){if(_0x419ec8){return _0x419ec8[_0xf9ba('0x26')](_0x21362d)[_0xf9ba('0x12')](function(_0x55b2e2){return _0x55b2e2;});}return null;};}function removeEntity(_0x37fb50){return function(_0x4576ec){if(_0x4576ec){return _0x4576ec['destroy']()[_0xf9ba('0x12')](function(){var _0x5f9cf2=_0x4576ec['get']({'plain':!![]});var _0x14e18a='ChatWebsites';return db[_0xf9ba('0x27')]['destroy']({'where':{'type':_0x14e18a,'resourceId':_0x5f9cf2['id']}})[_0xf9ba('0x12')](function(){return _0x4576ec;});})[_0xf9ba('0x12')](function(){_0x37fb50['status'](0xcc)[_0xf9ba('0x1f')]();});}};}function handleEntityNotFound(_0x1800f2){return function(_0x4a6e20){if(!_0x4a6e20){_0x1800f2[_0xf9ba('0x1d')](0x194);}return _0x4a6e20;};}function handleError(_0x8c3eb2,_0x56d7ea){_0x56d7ea=_0x56d7ea||0x1f4;return function(_0x5748f3){logger[_0xf9ba('0x17')](_0x5748f3['stack']);if(_0x5748f3[_0xf9ba('0x28')]){delete _0x5748f3[_0xf9ba('0x28')];}_0x8c3eb2[_0xf9ba('0x1e')](_0x56d7ea)['send'](_0x5748f3);};}exports[_0xf9ba('0x29')]=function(_0xd3b95,_0x3c602d){var _0x107b97={'include':[{'model':db[_0xf9ba('0x2a')],'as':_0xf9ba('0x2b')}]},_0x10aa01={},_0x3337f2={'count':0x0,'rows':[]};var _0x5c0307=_['map'](db[_0xf9ba('0x2c')][_0xf9ba('0x2d')],function(_0x4eff39){return{'name':_0x4eff39['fieldName'],'type':_0x4eff39[_0xf9ba('0x2e')]['key']};});_0x10aa01[_0xf9ba('0x2f')]=_[_0xf9ba('0x30')](_0x5c0307,'name');_0x10aa01[_0xf9ba('0x31')]=_['keys'](_0xd3b95['query']);_0x10aa01[_0xf9ba('0x32')]=_[_0xf9ba('0x33')](_0x10aa01[_0xf9ba('0x2f')],_0x10aa01[_0xf9ba('0x31')]);_0x107b97[_0xf9ba('0x34')]=_['intersection'](_0x10aa01[_0xf9ba('0x2f')],qs[_0xf9ba('0x35')](_0xd3b95[_0xf9ba('0x31')][_0xf9ba('0x35')]));_0x107b97[_0xf9ba('0x34')]=_0x107b97[_0xf9ba('0x34')][_0xf9ba('0x36')]?_0x107b97[_0xf9ba('0x34')]:_0x10aa01[_0xf9ba('0x2f')];if(!_0xd3b95[_0xf9ba('0x31')]['hasOwnProperty'](_0xf9ba('0x37'))){_0x107b97['limit']=qs[_0xf9ba('0x22')](_0xd3b95[_0xf9ba('0x31')][_0xf9ba('0x22')]);_0x107b97[_0xf9ba('0x20')]=qs[_0xf9ba('0x20')](_0xd3b95['query']['offset']);}_0x107b97[_0xf9ba('0x38')]=qs[_0xf9ba('0x39')](_0xd3b95[_0xf9ba('0x31')][_0xf9ba('0x39')]);_0x107b97['where']=qs[_0xf9ba('0x32')](_[_0xf9ba('0x3a')](_0xd3b95[_0xf9ba('0x31')],_0x10aa01[_0xf9ba('0x32')]),_0x5c0307);if(_0xd3b95[_0xf9ba('0x31')]['filter']){_0x107b97['where']=_['merge'](_0x107b97[_0xf9ba('0x3b')],{'$or':_[_0xf9ba('0x30')](_0x5c0307,function(_0x5bd6d2){if(_0x5bd6d2[_0xf9ba('0x2e')]!==_0xf9ba('0x3c')){var _0x13d45a={};_0x13d45a[_0x5bd6d2['name']]={'$like':'%'+_0xd3b95['query'][_0xf9ba('0x3d')]+'%'};return _0x13d45a;}})});}_0x107b97=_[_0xf9ba('0x3e')]({},_0x107b97,_0xd3b95['options']);var _0x412a37={'where':_0x107b97[_0xf9ba('0x3b')]};return db[_0xf9ba('0x2c')][_0xf9ba('0x23')](_0x412a37)['then'](function(_0x377b0f){_0x3337f2[_0xf9ba('0x23')]=_0x377b0f;if(_0xd3b95[_0xf9ba('0x31')][_0xf9ba('0x3f')]){_0x107b97[_0xf9ba('0x40')]=[{'all':!![]}];}return db[_0xf9ba('0x2c')][_0xf9ba('0x41')](_0x107b97);})[_0xf9ba('0x12')](function(_0x14c45d){_0x3337f2[_0xf9ba('0x42')]=_0x14c45d;return _0x3337f2;})['then'](respondWithFilteredResult(_0x3c602d,_0x107b97))[_0xf9ba('0x1c')](handleError(_0x3c602d,null));};exports[_0xf9ba('0x43')]=function(_0x3b78e3,_0x11e06b){var _0xbe6d0c={'raw':![],'where':{'id':_0x3b78e3[_0xf9ba('0x44')]['id']},'include':[{'model':db[_0xf9ba('0x2a')],'as':_0xf9ba('0x2b')}]},_0x3bcf2d={};_0x3bcf2d['model']=_[_0xf9ba('0x45')](db['ChatWebsite']['rawAttributes']);_0x3bcf2d['query']=_['keys'](_0x3b78e3[_0xf9ba('0x31')]);_0x3bcf2d[_0xf9ba('0x32')]=_[_0xf9ba('0x33')](_0x3bcf2d[_0xf9ba('0x2f')],_0x3bcf2d[_0xf9ba('0x31')]);_0xbe6d0c[_0xf9ba('0x34')]=_[_0xf9ba('0x33')](_0x3bcf2d[_0xf9ba('0x2f')],qs['fields'](_0x3b78e3['query']['fields']));_0xbe6d0c[_0xf9ba('0x34')]=_0xbe6d0c[_0xf9ba('0x34')][_0xf9ba('0x36')]?_0xbe6d0c['attributes']:_0x3bcf2d[_0xf9ba('0x2f')];if(_0x3b78e3[_0xf9ba('0x31')]['includeAll']){_0xbe6d0c[_0xf9ba('0x40')]=[{'all':!![]}];}_0xbe6d0c=_[_0xf9ba('0x3e')]({},_0xbe6d0c,_0x3b78e3[_0xf9ba('0x46')]);return db[_0xf9ba('0x2c')][_0xf9ba('0x47')](_0xbe6d0c)[_0xf9ba('0x12')](handleEntityNotFound(_0x11e06b,null))['then'](respondWithResult(_0x11e06b,null))['catch'](handleError(_0x11e06b,null));};exports['create']=function(_0x5de5c4,_0x3ae30e){return db[_0xf9ba('0x2c')][_0xf9ba('0x48')](_0x5de5c4[_0xf9ba('0x49')],{})['then'](function(_0x3fe343){var _0x1f0bf6=_0x5de5c4[_0xf9ba('0x4a')]['get']({'plain':!![]});if(!_0x1f0bf6)throw new Error(_0xf9ba('0x4b'));if(_0x1f0bf6[_0xf9ba('0x4c')]===_0xf9ba('0x4a')){var _0x48e2ca=_0x3fe343[_0xf9ba('0x4d')]({'plain':!![]});var _0x3eff77=_0xf9ba('0x4e');return db[_0xf9ba('0x4f')][_0xf9ba('0x47')]({'where':{'name':_0x3eff77,'userProfileId':_0x1f0bf6['userProfileId']},'raw':!![]})[_0xf9ba('0x12')](function(_0x325b94){if(_0x325b94&&_0x325b94[_0xf9ba('0x50')]===0x0){return db[_0xf9ba('0x27')][_0xf9ba('0x48')]({'name':_0x48e2ca[_0xf9ba('0x28')],'resourceId':_0x48e2ca['id'],'type':_0x325b94['name'],'sectionId':_0x325b94['id']},{})[_0xf9ba('0x12')](function(){return _0x3fe343;});}else{return _0x3fe343;}})[_0xf9ba('0x1c')](function(_0x21cdac){logger['error'](_0xf9ba('0x51'),_0x21cdac);throw _0x21cdac;});}return _0x3fe343;})[_0xf9ba('0x12')](respondWithResult(_0x3ae30e,0xc9))[_0xf9ba('0x1c')](handleError(_0x3ae30e,null));};exports[_0xf9ba('0x26')]=function(_0x6a7a7c,_0x498c3b){if(_0x6a7a7c[_0xf9ba('0x49')]['id']){delete _0x6a7a7c[_0xf9ba('0x49')]['id'];}return db[_0xf9ba('0x2c')][_0xf9ba('0x47')]({'where':{'id':_0x6a7a7c['params']['id']},'include':[{'model':db[_0xf9ba('0x2a')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x498c3b,null))[_0xf9ba('0x12')](saveUpdates(_0x6a7a7c[_0xf9ba('0x49')],null))[_0xf9ba('0x12')](respondWithResult(_0x498c3b,null))['catch'](handleError(_0x498c3b,null));};exports[_0xf9ba('0x52')]=function(_0x6df306,_0x12482f){return db[_0xf9ba('0x2c')][_0xf9ba('0x47')]({'where':{'id':_0x6df306[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x12482f,null))[_0xf9ba('0x12')](removeEntity(_0x12482f,null))[_0xf9ba('0x1c')](handleError(_0x12482f,null));};exports[_0xf9ba('0x53')]=function(_0x2ab4cb,_0x2e8f9f){return db[_0xf9ba('0x2c')]['describe']()[_0xf9ba('0x12')](respondWithResult(_0x2e8f9f,null))[_0xf9ba('0x1c')](handleError(_0x2e8f9f,null));};exports[_0xf9ba('0x54')]=function(_0x4b8525,_0x25af88){if(_0x4b8525[_0xf9ba('0x49')]['id']){delete _0x4b8525['body']['id'];}return db[_0xf9ba('0x2c')][_0xf9ba('0x47')]({'where':{'id':_0x4b8525[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x25af88,null))[_0xf9ba('0x12')](function(_0x161267){if(_0x161267){_0x4b8525[_0xf9ba('0x49')][_0xf9ba('0x55')]=_0x161267['id'];return db[_0xf9ba('0x56')][_0xf9ba('0x48')](_0x4b8525[_0xf9ba('0x49')]);}})[_0xf9ba('0x12')](respondWithResult(_0x25af88,null))[_0xf9ba('0x1c')](handleError(_0x25af88,null));};exports[_0xf9ba('0x57')]=function(_0x1de30d,_0x3c1015){var _0x3ea210={'raw':![],'where':{}};var _0x322ae1={};var _0xe52863={'count':0x0,'rows':[]};return db[_0xf9ba('0x2c')][_0xf9ba('0x58')]({'where':{'id':_0x1de30d[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x3c1015,null))[_0xf9ba('0x12')](function(_0x1a23ca){if(_0x1a23ca){_0x322ae1[_0xf9ba('0x2f')]=_[_0xf9ba('0x45')](db[_0xf9ba('0x56')][_0xf9ba('0x2d')]);_0x322ae1[_0xf9ba('0x31')]=_[_0xf9ba('0x45')](_0x1de30d[_0xf9ba('0x31')]);_0x322ae1['filters']=_[_0xf9ba('0x33')](_0x322ae1['model'],_0x322ae1[_0xf9ba('0x31')]);_0x3ea210[_0xf9ba('0x34')]=_['intersection'](_0x322ae1['model'],qs[_0xf9ba('0x35')](_0x1de30d[_0xf9ba('0x31')]['fields']));_0x3ea210[_0xf9ba('0x34')]=_0x3ea210[_0xf9ba('0x34')][_0xf9ba('0x36')]?_0x3ea210[_0xf9ba('0x34')]:_0x322ae1[_0xf9ba('0x2f')];if(!_0x1de30d[_0xf9ba('0x31')][_0xf9ba('0x59')](_0xf9ba('0x37'))){_0x3ea210[_0xf9ba('0x22')]=qs[_0xf9ba('0x22')](_0x1de30d[_0xf9ba('0x31')][_0xf9ba('0x22')]);_0x3ea210['offset']=qs[_0xf9ba('0x20')](_0x1de30d[_0xf9ba('0x31')][_0xf9ba('0x20')]);}_0x3ea210[_0xf9ba('0x38')]=qs['sort'](_0x1de30d[_0xf9ba('0x31')][_0xf9ba('0x39')]);_0x3ea210[_0xf9ba('0x3b')]=qs[_0xf9ba('0x32')](_['pick'](_0x1de30d[_0xf9ba('0x31')],_0x322ae1[_0xf9ba('0x32')]));_0x3ea210['where'][_0xf9ba('0x55')]=_0x1a23ca['id'];if(_0x1de30d['query']['filter']){_0x3ea210['where']=_['merge'](_0x3ea210[_0xf9ba('0x3b')],{'$or':_[_0xf9ba('0x30')](_0x3ea210['attributes'],function(_0x4d2272){var _0x589cae={};_0x589cae[_0x4d2272]={'$like':'%'+_0x1de30d[_0xf9ba('0x31')][_0xf9ba('0x3d')]+'%'};return _0x589cae;})});}_0x3ea210=_[_0xf9ba('0x3e')]({},_0x3ea210,_0x1de30d['options']);return db['Disposition'][_0xf9ba('0x23')]({'where':_0x3ea210['where']})[_0xf9ba('0x12')](function(_0xc44237){_0xe52863[_0xf9ba('0x23')]=_0xc44237;if(_0x1de30d[_0xf9ba('0x31')][_0xf9ba('0x3f')]){_0x3ea210[_0xf9ba('0x40')]=[{'all':!![]}];}return db['Disposition'][_0xf9ba('0x41')](_0x3ea210);})[_0xf9ba('0x12')](function(_0x364312){_0xe52863[_0xf9ba('0x42')]=_0x364312;return _0xe52863;});}})[_0xf9ba('0x12')](respondWithFilteredResult(_0x3c1015,_0x3ea210))[_0xf9ba('0x1c')](handleError(_0x3c1015,null));};exports[_0xf9ba('0x5a')]=function(_0x311e5d,_0x546935){return db[_0xf9ba('0x2c')][_0xf9ba('0x47')]({'where':{'id':_0x311e5d['params']['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x546935,null))['then'](function(_0x10b705){if(_0x10b705){return _0x10b705['removeDispositions'](_0x311e5d[_0xf9ba('0x31')]['ids']);}})[_0xf9ba('0x12')](respondWithStatusCode(_0x546935,null))[_0xf9ba('0x1c')](handleError(_0x546935,null));};exports[_0xf9ba('0x5b')]=function(_0x738efb,_0x5d2588){if(_0x738efb[_0xf9ba('0x49')]['id']){delete _0x738efb[_0xf9ba('0x49')]['id'];}return db['ChatWebsite'][_0xf9ba('0x47')]({'where':{'id':_0x738efb[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x5d2588,null))['then'](function(_0x14ea94){if(_0x14ea94){_0x738efb['body'][_0xf9ba('0x55')]=_0x14ea94['id'];return db['CannedAnswer']['create'](_0x738efb['body']);}})[_0xf9ba('0x12')](respondWithResult(_0x5d2588,null))[_0xf9ba('0x1c')](handleError(_0x5d2588,null));};exports[_0xf9ba('0x5c')]=function(_0x33d7c3,_0x3c7b61){var _0x3219a6={'raw':![],'where':{}};var _0xbae3df={};var _0x1cdd92={'count':0x0,'rows':[]};return db[_0xf9ba('0x2c')]['findOne']({'where':{'id':_0x33d7c3['params']['id']}})['then'](handleEntityNotFound(_0x3c7b61,null))[_0xf9ba('0x12')](function(_0x326e4f){if(_0x326e4f){_0xbae3df[_0xf9ba('0x2f')]=_[_0xf9ba('0x45')](db[_0xf9ba('0x5d')][_0xf9ba('0x2d')]);_0xbae3df[_0xf9ba('0x31')]=_[_0xf9ba('0x45')](_0x33d7c3[_0xf9ba('0x31')]);_0xbae3df[_0xf9ba('0x32')]=_[_0xf9ba('0x33')](_0xbae3df[_0xf9ba('0x2f')],_0xbae3df[_0xf9ba('0x31')]);_0x3219a6['attributes']=_['intersection'](_0xbae3df['model'],qs[_0xf9ba('0x35')](_0x33d7c3[_0xf9ba('0x31')][_0xf9ba('0x35')]));_0x3219a6[_0xf9ba('0x34')]=_0x3219a6[_0xf9ba('0x34')][_0xf9ba('0x36')]?_0x3219a6[_0xf9ba('0x34')]:_0xbae3df[_0xf9ba('0x2f')];if(!_0x33d7c3[_0xf9ba('0x31')][_0xf9ba('0x59')](_0xf9ba('0x37'))){_0x3219a6[_0xf9ba('0x22')]=qs[_0xf9ba('0x22')](_0x33d7c3['query']['limit']);_0x3219a6[_0xf9ba('0x20')]=qs[_0xf9ba('0x20')](_0x33d7c3[_0xf9ba('0x31')][_0xf9ba('0x20')]);}_0x3219a6['order']=qs['sort'](_0x33d7c3[_0xf9ba('0x31')]['sort']);_0x3219a6[_0xf9ba('0x3b')]=qs[_0xf9ba('0x32')](_[_0xf9ba('0x3a')](_0x33d7c3['query'],_0xbae3df[_0xf9ba('0x32')]));_0x3219a6[_0xf9ba('0x3b')][_0xf9ba('0x55')]=_0x326e4f['id'];if(_0x33d7c3[_0xf9ba('0x31')]['filter']){_0x3219a6[_0xf9ba('0x3b')]=_[_0xf9ba('0x3e')](_0x3219a6[_0xf9ba('0x3b')],{'$or':_[_0xf9ba('0x30')](_0x3219a6[_0xf9ba('0x34')],function(_0x1fe93a){var _0x7c2f66={};_0x7c2f66[_0x1fe93a]={'$like':'%'+_0x33d7c3[_0xf9ba('0x31')][_0xf9ba('0x3d')]+'%'};return _0x7c2f66;})});}_0x3219a6=_[_0xf9ba('0x3e')]({},_0x3219a6,_0x33d7c3[_0xf9ba('0x46')]);return db[_0xf9ba('0x5d')][_0xf9ba('0x23')]({'where':_0x3219a6[_0xf9ba('0x3b')]})[_0xf9ba('0x12')](function(_0x2f7be9){_0x1cdd92['count']=_0x2f7be9;if(_0x33d7c3['query']['includeAll']){_0x3219a6[_0xf9ba('0x40')]=[{'all':!![]}];}return db[_0xf9ba('0x5d')][_0xf9ba('0x41')](_0x3219a6);})['then'](function(_0x10fa81){_0x1cdd92[_0xf9ba('0x42')]=_0x10fa81;return _0x1cdd92;});}})[_0xf9ba('0x12')](respondWithFilteredResult(_0x3c7b61,_0x3219a6))[_0xf9ba('0x1c')](handleError(_0x3c7b61,null));};exports['removeAnswers']=function(_0x3107c1,_0x2202f0){return db['ChatWebsite'][_0xf9ba('0x47')]({'where':{'id':_0x3107c1[_0xf9ba('0x44')]['id']}})['then'](handleEntityNotFound(_0x2202f0,null))['then'](function(_0x168987){if(_0x168987){return _0x168987[_0xf9ba('0x5e')](_0x3107c1[_0xf9ba('0x31')][_0xf9ba('0x5f')]);}})[_0xf9ba('0x12')](respondWithStatusCode(_0x2202f0,null))[_0xf9ba('0x1c')](handleError(_0x2202f0,null));};exports['addLogo']=function(_0x39c630,_0xe231ae){_0x39c630['body'][_0xf9ba('0x60')]=_0x39c630[_0xf9ba('0x61')]['filename'];return db[_0xf9ba('0x2c')][_0xf9ba('0x47')]({'where':{'id':_0x39c630[_0xf9ba('0x44')]['id']}})['then'](handleEntityNotFound(_0xe231ae,null))[_0xf9ba('0x12')](saveUpdates(_0x39c630[_0xf9ba('0x49')],null))['then'](respondWithResult(_0xe231ae,null))['catch'](handleError(_0xe231ae,null));};exports[_0xf9ba('0x62')]=function(_0xefa5cf,_0x221a90){_0xefa5cf['body'][_0xf9ba('0x63')]=_0xefa5cf[_0xf9ba('0x61')][_0xf9ba('0x64')];return db[_0xf9ba('0x2c')][_0xf9ba('0x47')]({'where':{'id':_0xefa5cf[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x221a90,null))['then'](saveUpdates(_0xefa5cf[_0xf9ba('0x49')],null))[_0xf9ba('0x12')](respondWithResult(_0x221a90,null))[_0xf9ba('0x1c')](handleError(_0x221a90,null));};exports[_0xf9ba('0x65')]=function(_0x41036a,_0x848339){_0x41036a[_0xf9ba('0x49')][_0xf9ba('0x66')]=_0x41036a[_0xf9ba('0x61')][_0xf9ba('0x64')];return db['ChatWebsite'][_0xf9ba('0x47')]({'where':{'id':_0x41036a[_0xf9ba('0x44')]['id']}})['then'](handleEntityNotFound(_0x848339,null))[_0xf9ba('0x12')](saveUpdates(_0x41036a[_0xf9ba('0x49')],null))[_0xf9ba('0x12')](respondWithResult(_0x848339,null))[_0xf9ba('0x1c')](handleError(_0x848339,null));};exports[_0xf9ba('0x67')]=function(_0x23091f,_0x36b0f8){_0x23091f['body']['systemAvatar']=_0x23091f[_0xf9ba('0x61')][_0xf9ba('0x64')];return db['ChatWebsite'][_0xf9ba('0x47')]({'where':{'id':_0x23091f[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x36b0f8,null))[_0xf9ba('0x12')](saveUpdates(_0x23091f[_0xf9ba('0x49')],null))[_0xf9ba('0x12')](respondWithResult(_0x36b0f8,null))[_0xf9ba('0x1c')](handleError(_0x36b0f8,null));};exports['getLogo']=function(_0x1da392,_0x27fbc3){var _0x47c4cf=path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0x6a'));var _0x8f4a13={'where':{'id':_0x1da392[_0xf9ba('0x44')]['id']},'attributes':['id',_0xf9ba('0x60')],'raw':!![]};var _0x229aa1=![];return require(_0xf9ba('0x6b'))[_0xf9ba('0x6c')]()[_0xf9ba('0x12')](function(_0x338c89){if(_0x338c89){_0x229aa1=_0x338c89[_0xf9ba('0x6d')];}})[_0xf9ba('0x12')](function(){return db[_0xf9ba('0x2c')][_0xf9ba('0x47')](_0x8f4a13);})[_0xf9ba('0x12')](handleEntityNotFound(_0x27fbc3,null))['then'](function(_0x17e421){if(_0x17e421){if(!_[_0xf9ba('0x6e')](_0x17e421[_0xf9ba('0x60')])){if(fs[_0xf9ba('0x6f')](path['join'](config[_0xf9ba('0x69')],_0xf9ba('0x70'),_0x17e421[_0xf9ba('0x60')]))&&_0x229aa1){_0x47c4cf=path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0x70'),_0x17e421[_0xf9ba('0x60')]);}}return _0x27fbc3['download'](_0x47c4cf);}})['catch'](handleError(_0x27fbc3,null));};exports[_0xf9ba('0x71')]=function(_0x48e656,_0x2d5815){var _0x59898a=path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0x72'));var _0x2706e7={'where':{'id':_0x48e656['params']['id']},'attributes':['id',_0xf9ba('0x63')],'raw':!![]};return db[_0xf9ba('0x2c')][_0xf9ba('0x47')](_0x2706e7)['then'](handleEntityNotFound(_0x2d5815,null))[_0xf9ba('0x12')](function(_0x447b5c){if(_0x447b5c){if(!_['isNil'](_0x447b5c[_0xf9ba('0x63')])){if(fs['existsSync'](path['join'](config[_0xf9ba('0x69')],_0xf9ba('0x73'),_0x447b5c[_0xf9ba('0x63')]))){_0x59898a=path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0x73'),_0x447b5c[_0xf9ba('0x63')]);}}return _0x2d5815['download'](_0x59898a);}})['catch'](handleError(_0x2d5815,null));};exports[_0xf9ba('0x74')]=function(_0x404649,_0x13ddf1){var _0x3685cc=path['join'](config[_0xf9ba('0x69')],_0xf9ba('0x75'));var _0x31b78f={'where':{'id':_0x404649[_0xf9ba('0x44')]['id']},'attributes':['id',_0xf9ba('0x66'),_0xf9ba('0x76')],'raw':!![]};return db[_0xf9ba('0x2c')][_0xf9ba('0x47')](_0x31b78f)[_0xf9ba('0x12')](handleEntityNotFound(_0x13ddf1,null))[_0xf9ba('0x12')](function(_0x275609){if(_0x275609){if(!_[_0xf9ba('0x6e')](_0x275609[_0xf9ba('0x66')])){if(fs[_0xf9ba('0x6f')](path[_0xf9ba('0x68')](config['root'],_0xf9ba('0x73'),_0x275609['customerAvatar']))&&_0x275609[_0xf9ba('0x76')]){_0x3685cc=path[_0xf9ba('0x68')](config['root'],_0xf9ba('0x73'),_0x275609['customerAvatar']);}}return _0x13ddf1[_0xf9ba('0x77')](_0x3685cc);}})['catch'](handleError(_0x13ddf1,null));};exports[_0xf9ba('0x78')]=function(_0x33f99d,_0x47c217){var _0x1c5739=path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0x79'));var _0x2a902b={'where':{'id':_0x33f99d[_0xf9ba('0x44')]['id']},'attributes':['id',_0xf9ba('0x7a')],'raw':!![]};return db[_0xf9ba('0x2c')]['find'](_0x2a902b)[_0xf9ba('0x12')](handleEntityNotFound(_0x47c217,null))[_0xf9ba('0x12')](function(_0x4e9713){if(_0x4e9713){if(!_[_0xf9ba('0x6e')](_0x4e9713['systemAvatar'])){if(fs[_0xf9ba('0x6f')](path[_0xf9ba('0x68')](config['root'],_0xf9ba('0x73'),_0x4e9713['systemAvatar']))){_0x1c5739=path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0x73'),_0x4e9713[_0xf9ba('0x7a')]);}}return _0x47c217[_0xf9ba('0x77')](_0x1c5739);}})[_0xf9ba('0x1c')](handleError(_0x47c217,null));};exports['notify']=function(_0x33c7fd,_0x37f86d){var _0x3af379=require('user-agent-parser');var _0x304bfd=new _0x3af379();var _0x358b60=_0x304bfd[_0xf9ba('0x7b')](_0x33c7fd['headers']['user-agent'])['getResult']();var _0x18c15d={'body':_0x33c7fd[_0xf9ba('0x49')],'channel':'chat'};var _0x2f3930=[];var _0x2974af=[];var _0x311c58={};var _0x2d55a1=![];return db['CmContact']['describe']()['then'](function(_0x52396b){if(!_0x52396b){throw new db['Sequelize']['ValidationError'](_0xf9ba('0x7c'));}_0x2f3930=_[_0xf9ba('0x7d')](_['keys'](_0x52396b),[_0xf9ba('0x7e'),_0xf9ba('0x7f')]);_0x2974af=_[_0xf9ba('0x7d')](_[_0xf9ba('0x45')](_0x52396b),[_0xf9ba('0x7e'),_0xf9ba('0x7f'),_0xf9ba('0x80'),_0xf9ba('0x81')]);if(_0x33c7fd[_0xf9ba('0x49')]['id']){delete _0x33c7fd['body']['id'];}if(_['isNil'](_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x82')])){throw new db[(_0xf9ba('0x83'))][(_0xf9ba('0x84'))](_0xf9ba('0x85'));}if(_[_0xf9ba('0x6e')](_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x49')])||_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x49')]===''){throw new db[(_0xf9ba('0x83'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x33c7fd['body']['mapKey'])){throw new db[(_0xf9ba('0x83'))][(_0xf9ba('0x84'))](_0xf9ba('0x86')+_0x2974af);}if(!_[_0xf9ba('0x87')](_0x2974af,_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x88')])){throw new db[(_0xf9ba('0x83'))][(_0xf9ba('0x84'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2974af);}_0x311c58[_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x88')]]=_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x82')];})[_0xf9ba('0x12')](function(){return db[_0xf9ba('0x2c')]['find']({'where':{'id':_0x33c7fd[_0xf9ba('0x44')]['id']},'include':[{'model':db[_0xf9ba('0x89')],'as':_0xf9ba('0x8a'),'include':[{'model':db[_0xf9ba('0x8b')],'as':_0xf9ba('0x8c'),'where':_0x311c58,'limit':0x1,'order':[[_0xf9ba('0x7f'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0xf9ba('0x8d')}]});})[_0xf9ba('0x12')](handleEntityNotFound(_0x37f86d,null))['then'](function(_0x3a6d36){if(_0x3a6d36&&_0x3a6d36[_0xf9ba('0x8a')]){_0x18c15d[_0xf9ba('0x8e')]=_0x3a6d36;_0x18c15d[_0xf9ba('0x8f')]=_0x3a6d36[_0xf9ba('0x8d')];_0x18c15d['list']=_0x3a6d36[_0xf9ba('0x8a')];_0x18c15d['applications']=_['orderBy'](_0x18c15d[_0xf9ba('0x8f')],[_0xf9ba('0x90')],['asc']);if(_0x18c15d['account']['Applications']){delete _0x18c15d[_0xf9ba('0x8e')][_0xf9ba('0x8d')];}if(_0x18c15d[_0xf9ba('0x8e')]['List']&&_0x18c15d[_0xf9ba('0x8e')]['List']['Contacts'][_0xf9ba('0x36')]){return _0x18c15d[_0xf9ba('0x8e')]['List']['Contacts'][0x0];}var _0x175782=_['defaults'](_0x33c7fd[_0xf9ba('0x49')],{'firstName':_0x33c7fd[_0xf9ba('0x49')]['from'],'ListId':_0x3a6d36[_0xf9ba('0x81')]});_0x175782[_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x88')]]=_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x82')];return db[_0xf9ba('0x8b')][_0xf9ba('0x48')](_0x175782,{'fields':_0x2f3930,'raw':!![]});}})['then'](handleEntityNotFound(_0x37f86d,null))[_0xf9ba('0x12')](function(_0x19625a){_0x18c15d[_0xf9ba('0x91')]=_0x19625a;var _0x2d1ff6=_0x33c7fd['body']['customerIp'];if(_0x33c7fd['headers']['cf-connecting-ip']){_0x2d1ff6=_0x33c7fd['headers'][_0xf9ba('0x92')];}else if(_0x33c7fd[_0xf9ba('0x93')][_0xf9ba('0x94')]){_0x2d1ff6=_[_0xf9ba('0x95')](_0x33c7fd[_0xf9ba('0x93')][_0xf9ba('0x94')][_0xf9ba('0x96')](','));}if(_0x19625a){var _0x3d16f1={'ContactId':_0x19625a['id'],'ChatWebsiteId':_0x33c7fd[_0xf9ba('0x44')]['id'],'from':(_0x19625a[_0xf9ba('0x97')]||'')+'\x20'+(_0x19625a[_0xf9ba('0x98')]||''),'customerIp':_0x2d1ff6,'customerPort':_0x33c7fd[_0xf9ba('0x93')]['x-real-port']?_0x33c7fd[_0xf9ba('0x93')][_0xf9ba('0x99')]:null,'referer':_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0x9a')],'browserName':_0x358b60[_0xf9ba('0x9b')][_0xf9ba('0x28')]&&_0x358b60['browser'][_0xf9ba('0x9c')]?util[_0xf9ba('0x9d')](_0xf9ba('0x9e'),_0x358b60[_0xf9ba('0x9b')][_0xf9ba('0x28')],_0x358b60['browser']['version']):_0xf9ba('0x9f'),'browserVersion':_0x358b60['browser'][_0xf9ba('0x9c')]||_0xf9ba('0x9f'),'osName':util[_0xf9ba('0x9d')]('%s\x20%s',_0x358b60['os'][_0xf9ba('0x28')],_0x358b60['os'][_0xf9ba('0x9c')]),'osVersion':_0x358b60['os'][_0xf9ba('0x9c')],'deviceModel':_0x358b60['device']['model']&&_0x358b60[_0xf9ba('0xa0')][_0xf9ba('0xa1')]?util['format'](_0xf9ba('0xa2'),_0x358b60[_0xf9ba('0xa0')][_0xf9ba('0x2f')],_0x358b60[_0xf9ba('0xa0')][_0xf9ba('0xa1')],_0x358b60[_0xf9ba('0xa0')][_0xf9ba('0x2e')]):null,'deviceVendor':_0x358b60[_0xf9ba('0xa0')][_0xf9ba('0xa1')],'deviceType':_0x358b60[_0xf9ba('0xa0')]['type'],'formData':JSON[_0xf9ba('0xa3')](_0x33c7fd['body'])};var _0x4d056c={'ChatWebsiteId':_0x33c7fd['params']['id'],'closed':![]};if(_0x33c7fd[_0xf9ba('0x49')]['threadId']){_0x4d056c[_0xf9ba('0xa4')]=_0x33c7fd['body'][_0xf9ba('0xa4')];return db[_0xf9ba('0xa5')]['find']({'where':_0x4d056c})[_0xf9ba('0x12')](function(_0x4a65ca){if(_0x4a65ca){return[_0x4a65ca,![]];}_0x3d16f1['threadId']=_0x33c7fd['body'][_0xf9ba('0xa4')];_0x3d16f1[_0xf9ba('0xa6')]=_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0xa6')];return db[_0xf9ba('0xa5')][_0xf9ba('0x48')](_0x3d16f1)['then'](function(_0x1c4da5){return[_0x1c4da5,!![]];});});}_0x4d056c[_0xf9ba('0xa7')]=_0x19625a['id'];if(_0x33c7fd['body'][_0xf9ba('0xa8')]&&_0x33c7fd[_0xf9ba('0x49')]['interaction']['id']){_0x4d056c['id']=_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0xa8')]['id'];return db[_0xf9ba('0xa5')][_0xf9ba('0x47')]({'where':_0x4d056c})[_0xf9ba('0x12')](function(_0x1d4067){if(_0x1d4067){return[_0x1d4067,![]];}return db['ChatInteraction'][_0xf9ba('0x48')](_0x3d16f1)[_0xf9ba('0x12')](function(_0x2c9999){return[_0x2c9999,!![]];});});}return db[_0xf9ba('0xa5')][_0xf9ba('0x48')](_0x3d16f1)[_0xf9ba('0x12')](function(_0x72c433){return[_0x72c433,!![]];});}})[_0xf9ba('0xa9')](function(_0x4e06c8,_0xcb950d){if(_0x4e06c8){_0x2d55a1=_0xcb950d;if(!_0xcb950d){var _0x515714={'from':(_0x18c15d[_0xf9ba('0x91')][_0xf9ba('0x97')]||'')+'\x20'+(_0x18c15d[_0xf9ba('0x91')][_0xf9ba('0x98')]||'')};if(_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0xa4')]&&_0x33c7fd[_0xf9ba('0x49')]['messageId']&&_0x33c7fd[_0xf9ba('0x49')][_0xf9ba('0xa4')]!=_0x33c7fd[_0xf9ba('0x49')]['messageId']){_0x515714[_0xf9ba('0xa4')]=_0x33c7fd['body'][_0xf9ba('0xaa')];}return _0x4e06c8[_0xf9ba('0x26')](_0x515714);}else{return _0x4e06c8;}}})['then'](function(_0x110a08){_0x18c15d[_0xf9ba('0xa8')]=_0x110a08[_0xf9ba('0x4d')]({'plain':!![]});_0x18c15d[_0xf9ba('0xa8')][_0xf9ba('0xab')]=_0x2d55a1;if(_0x18c15d[_0xf9ba('0xa8')][_0xf9ba('0xab')]){if(_0x18c15d[_0xf9ba('0x8e')][_0xf9ba('0xac')]){_0x18c15d[_0xf9ba('0x8f')][_0xf9ba('0xad')]({'id':0x0,'priority':_0x18c15d[_0xf9ba('0x8f')][_0xf9ba('0x36')]+0x1,'app':_0xf9ba('0xae'),'appdata':_0xf9ba('0xaf'),'interval':_0xf9ba('0xb0')});}}return db[_0xf9ba('0xb1')][_0xf9ba('0x48')]({'body':_0x33c7fd['body']['body'],'ChatWebsiteId':_0x33c7fd[_0xf9ba('0x44')]['id'],'ChatInteractionId':_0x110a08['id'],'direction':'in','ContactId':_0x18c15d[_0xf9ba('0x91')]['id'],'AttachmentId':_0x33c7fd['body'][_0xf9ba('0xb2')]});})[_0xf9ba('0x12')](function(_0x104f98){_0x18c15d[_0xf9ba('0x1a')]=_0x104f98;if(_0x18c15d[_0xf9ba('0xa8')][_0xf9ba('0xb3')]){return db[_0xf9ba('0xb4')][_0xf9ba('0x47')]({'attributes':['id',_0xf9ba('0x28')],'where':{'id':_0x18c15d[_0xf9ba('0xa8')][_0xf9ba('0xb3')]}})['then'](function(_0x1da9cf){if(_0x1da9cf){_0x18c15d[_0xf9ba('0x8f')]['unshift']({'id':0x0,'priority':0x0,'app':_0xf9ba('0xb5'),'appdata':_0x1da9cf[_0xf9ba('0x28')]+','+(_0x18c15d['account'][_0xf9ba('0xb6')]||0xa),'interval':_0xf9ba('0xb0')});_0x18c15d[_0xf9ba('0xb7')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x18c15d);});}return respondWithRpcPromise(_0xf9ba('0xb8'),'startRouting',_0x18c15d);})[_0xf9ba('0x12')](function(_0x11518d){respondWithRpcPromise(_0xf9ba('0xb9'),_0xf9ba('0xb9'),{'event':'notify','message':_0x11518d},client9002);return _0x11518d;})[_0xf9ba('0x12')](respondWithResult(_0x37f86d,null))[_0xf9ba('0x1c')](handleError(_0x37f86d,null));};exports[_0xf9ba('0xba')]=function(_0x5b21d6,_0x1138a4){var _0x12e0e6,_0x54deb4,_0xadfb83;var _0x63731d=[];var _0x4ffcf7={};var _0x1a355a=_0x5b21d6[_0xf9ba('0xbb')]||[];var _0x4b148b=[];var _0x5461fa;return db[_0xf9ba('0x8b')]['describe']()[_0xf9ba('0x12')](function(_0x52aa26){if(!_0x52aa26){throw new db[(_0xf9ba('0x83'))][(_0xf9ba('0x84'))]('no\x20available\x20attributes');}_0x63731d=_[_0xf9ba('0x7d')](_['keys'](_0x52aa26),['createdAt',_0xf9ba('0x7f'),_0xf9ba('0x80'),'ListId']);if(_0x5b21d6[_0xf9ba('0x49')]['id']){delete _0x5b21d6['body']['id'];}if(_[_0xf9ba('0x6e')](_0x5b21d6[_0xf9ba('0x49')][_0xf9ba('0x82')])){throw _0x1138a4[_0xf9ba('0x1e')](0x1f4)[_0xf9ba('0xbc')](new db[(_0xf9ba('0x83'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0xf9ba('0x6e')](_0x5b21d6['body'][_0xf9ba('0x49')])||_0x5b21d6[_0xf9ba('0x49')][_0xf9ba('0x49')]===''){throw _0x1138a4['status'](0x1f4)[_0xf9ba('0xbc')](new db[(_0xf9ba('0x83'))][(_0xf9ba('0x84'))](_0xf9ba('0xbd')));}if(_['isNil'](_0x5b21d6[_0xf9ba('0x49')][_0xf9ba('0xbe')])){throw _0x1138a4[_0xf9ba('0x1e')](0x1f4)[_0xf9ba('0xbc')](new db[(_0xf9ba('0x83'))][(_0xf9ba('0x84'))](_0xf9ba('0xbf')+_0x63731d));}if(!_['includes'](_0x63731d,_0x5b21d6[_0xf9ba('0x49')][_0xf9ba('0xbe')])){throw _0x1138a4[_0xf9ba('0x1e')](0x1f4)[_0xf9ba('0xbc')](new db['Sequelize'][(_0xf9ba('0x84'))](_0xf9ba('0xc0')+_0x63731d));}_0x4ffcf7[_0x5b21d6[_0xf9ba('0x49')]['mapKeyOffline']]=_0x5b21d6['body'][_0xf9ba('0x82')];})[_0xf9ba('0x12')](function(){return db['ChatWebsite'][_0xf9ba('0x47')]({'where':{'id':_0x5b21d6[_0xf9ba('0x44')]['id']},'include':[{'model':db[_0xf9ba('0x89')],'as':_0xf9ba('0x8a')},{'model':db[_0xf9ba('0xc1')],'as':'MailAccount'}]});})[_0xf9ba('0x12')](handleEntityNotFound(_0x1138a4,null))['then'](function(_0x1fda0a){if(_0x1fda0a&&_0x1fda0a[_0xf9ba('0x8a')]){_0x54deb4=_0x1fda0a;var _0x6d3f12=_[_0xf9ba('0xa')](_0x5b21d6[_0xf9ba('0x49')],{'firstName':_0x5b21d6[_0xf9ba('0x49')]['from'],'phone':_0x5b21d6['body']['from'],'ListId':_0x1fda0a['ListId']});_0x6d3f12[_0x5b21d6['body'][_0xf9ba('0xbe')]]=_0x5b21d6[_0xf9ba('0x49')]['from'];return db[_0xf9ba('0x8b')][_0xf9ba('0xc2')]({'where':_0x4ffcf7,'defaults':_0x6d3f12});}})[_0xf9ba('0xa9')](function(_0x387dd0){if(_0x387dd0){_0xadfb83=_0x387dd0;var _0x585aee=fs['readFileSync'](path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0xc3')),_0xf9ba('0xc4'));var _0x3e67c5=ejs[_0xf9ba('0xc5')](_0x585aee,{'body':_['toPairs'](_0x5b21d6[_0xf9ba('0x49')][_0xf9ba('0x49')]),'bodyTitle':_0x54deb4['offlineMessageBody']});return db[_0xf9ba('0xc6')][_0xf9ba('0x48')]({'body':_0x3e67c5,'plainBody':htmlToText[_0xf9ba('0xc7')](_0x3e67c5),'ContactId':_0x387dd0['id'],'ChatWebsiteId':_0x54deb4['id']});}})[_0xf9ba('0x12')](function(_0x3fd2f1){_0x5461fa=_0x3fd2f1;if(_0x1a355a[_0xf9ba('0x36')]){var _0x5b88bb=_0x1a355a[_0xf9ba('0x30')](function(_0x1a2646){return{'name':_0x1a2646[_0xf9ba('0xc8')],'basename':_0x1a2646[_0xf9ba('0x64')],'type':_0x1a2646[_0xf9ba('0xc9')],'ChatOfflineMessageId':_0x3fd2f1['id']};});_0x4b148b=_0x5b88bb[_0xf9ba('0x30')](_0x1321c1=>{var _0x1d0204={'filename':_0x1321c1[_0xf9ba('0x28')],'path':path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0xca'),'files',_0xf9ba('0xcb'),_0xf9ba('0xcc'),_0x1321c1[_0xf9ba('0xcd')])};return _0x1d0204;});if(!_0x54deb4[_0xf9ba('0xce')]){return db['sequelize']['transaction'](function(_0x13f146){return db[_0xf9ba('0xcf')][_0xf9ba('0xd0')](_0x5b88bb,{'transaction':_0x13f146});});}}})[_0xf9ba('0x12')](function(){if(_0x5461fa){_0x12e0e6=_0x5461fa;return db[_0xf9ba('0xc1')][_0xf9ba('0x58')]({'where':{'service':!![]},'include':[{'model':db[_0xf9ba('0xd1')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xf9ba('0xd2')],'as':_0xf9ba('0xd2'),'raw':!![]}]}]});}})[_0xf9ba('0x12')](function(_0x3ced1b){if(_0x3ced1b&&_0x3ced1b[_0xf9ba('0xd3')]&&_0x54deb4[_0xf9ba('0xd4')]&&_0x54deb4[_0xf9ba('0xd5')]){var _0x39d10a=_0x3ced1b[_0xf9ba('0xd6')]();return respondWithRpcPromise('SendMail',_0xf9ba('0xd7'),{'account':_0x39d10a,'message':{'from':util[_0xf9ba('0x9d')](_0xf9ba('0xd8'),_0x3ced1b[_0xf9ba('0x28')],_0x3ced1b['email']||_0x3ced1b['Smtp'][_0xf9ba('0x4a')]),'to':_0x54deb4['forwardOfflineAddress'],'subject':_0x54deb4[_0xf9ba('0xd9')],'html':_0x12e0e6[_0xf9ba('0x49')],'attachments':_0x4b148b}},client9003)[_0xf9ba('0x12')](function(){return _0x12e0e6;})[_0xf9ba('0x1c')](function(_0x160385){logger[_0xf9ba('0x17')](_0x160385);});}})[_0xf9ba('0x12')](function(){if(_0x54deb4&&_0x54deb4[_0xf9ba('0xce')]&&_0x54deb4[_0xf9ba('0xda')]){var _0x1f79bd=[];if(_0x1a355a[_0xf9ba('0x36')]){_0x1f79bd=_0x1a355a['map'](function(_0x31bf88){return{'name':_0x31bf88[_0xf9ba('0xc8')],'basename':_0x31bf88[_0xf9ba('0x64')],'type':_0x31bf88[_0xf9ba('0xc9')],'ChatOfflineMessageId':_0x5461fa['id']};});}var _0x124504;if(!_[_0xf9ba('0x6e')](_0x54deb4[_0xf9ba('0xdb')])){var _0x54b885=_[_0xf9ba('0x30')](_0x5b21d6[_0xf9ba('0x49')],function(_0x55068a){return _0x55068a;});var _0x51cce3=_[_0xf9ba('0xdc')](_0x54b885)[0x0];var _0x9835b6=_[_0xf9ba('0xdd')](_0x51cce3,function(_0x28a22a){return _0x28a22a;});_0x124504=_0x9835b6[0x1][_0x54deb4[_0xf9ba('0xdb')]];}var _0x5d1045={'from':_0xadfb83[_0xf9ba('0xde')],'firstName':_0xadfb83[_0xf9ba('0x97')],'lastName':_0xadfb83[_0xf9ba('0x98')],'mapKey':_0xf9ba('0xde'),'message':{'from':_0xadfb83[_0xf9ba('0xde')],'to':_0x54deb4['MailAccount']['email'],'cc':'','subject':_[_0xf9ba('0x6e')](_0x124504)?_0x54deb4['offlineMessageSubject']:_0x124504,'messageId':'','sentAt':new Date(),'attach':_0x1f79bd[_0xf9ba('0x36')],'attachments':_0x1f79bd,'originChannel':_0xf9ba('0xdf'),'ChatWebsiteId':_0x54deb4['id'],'ChatOfflineMessageId':_0x12e0e6['id'],'originTo':_0x54deb4[_0xf9ba('0xc1')][_0xf9ba('0xde')]},'body':_0x12e0e6[_0xf9ba('0x49')]};var _0x16aca1={'account':{'id':_0x54deb4['MailAccountId']},'body':_0x5d1045,'log':_0xf9ba('0xe0')};return respondWithRpcPromise(_0xf9ba('0xe0'),_0xf9ba('0xe1'),_0x16aca1,client9001)[_0xf9ba('0x12')](function(){return _0x12e0e6;})[_0xf9ba('0x1c')](function(_0x375821){logger[_0xf9ba('0x17')](_0x375821);});}return;})[_0xf9ba('0x12')](function(){if(_0x12e0e6){return _0x12e0e6;}})[_0xf9ba('0x12')](respondWithResult(_0x1138a4,null))[_0xf9ba('0x1c')](function(_0x33a178){logger[_0xf9ba('0x17')](_0xf9ba('0x1c'),_0x33a178);for(var _0xe5cca9 of _0x1a355a){var _0x358b5c=path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],'server',_0xf9ba('0xbb'),_0xf9ba('0xcb'),_0xf9ba('0xcc'),_0xe5cca9['filename']);fs_extra[_0xf9ba('0xe2')](_0x358b5c)[_0xf9ba('0x1c')](function(_0x48ca4d){logger[_0xf9ba('0x17')](_0xf9ba('0xe3'),_0x358b5c,_0x48ca4d);});}});};exports[_0xf9ba('0xe4')]=function(_0x10111d,_0x3a9743){return db[_0xf9ba('0xa5')][_0xf9ba('0x47')]({'where':{'id':_0x10111d[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x3a9743,null))[_0xf9ba('0x12')](function(_0x27e21d){if(_0x27e21d){return _0x27e21d[_0xf9ba('0xe4')](_0x10111d['body'][_0xf9ba('0x5f')],_[_0xf9ba('0xe5')](_0x10111d[_0xf9ba('0x49')],[_0xf9ba('0x5f'),'id'])||{});}})[_0xf9ba('0x12')](respondWithResult(_0x3a9743,null))[_0xf9ba('0x1c')](handleError(_0x3a9743,null));};exports[_0xf9ba('0xe6')]=function(_0x1a71d5,_0x3f71da){var _0x5077f5={'raw':![],'where':{}};var _0x3b0f9e={};var _0x5c6842={'count':0x0,'rows':[]};return db[_0xf9ba('0x2c')]['findOne']({'where':{'id':_0x1a71d5[_0xf9ba('0x44')]['id']}})['then'](handleEntityNotFound(_0x3f71da,null))['then'](function(_0x17a798){if(_0x17a798){_0x3b0f9e[_0xf9ba('0x2f')]=_[_0xf9ba('0x45')](db[_0xf9ba('0xa5')][_0xf9ba('0x2d')]);_0x3b0f9e[_0xf9ba('0x31')]=_[_0xf9ba('0x45')](_0x1a71d5['query']);_0x3b0f9e[_0xf9ba('0x32')]=_[_0xf9ba('0x33')](_0x3b0f9e['model'],_0x3b0f9e[_0xf9ba('0x31')]);_0x5077f5[_0xf9ba('0x34')]=_[_0xf9ba('0x33')](_0x3b0f9e[_0xf9ba('0x2f')],qs['fields'](_0x1a71d5[_0xf9ba('0x31')][_0xf9ba('0x35')]));_0x5077f5[_0xf9ba('0x34')]=_0x5077f5[_0xf9ba('0x34')][_0xf9ba('0x36')]?_0x5077f5[_0xf9ba('0x34')]:_0x3b0f9e[_0xf9ba('0x2f')];if(!_0x1a71d5['query'][_0xf9ba('0x59')]('nolimit')){_0x5077f5[_0xf9ba('0x22')]=qs[_0xf9ba('0x22')](_0x1a71d5[_0xf9ba('0x31')][_0xf9ba('0x22')]);_0x5077f5['offset']=qs[_0xf9ba('0x20')](_0x1a71d5[_0xf9ba('0x31')][_0xf9ba('0x20')]);}_0x5077f5[_0xf9ba('0x38')]=qs[_0xf9ba('0x39')](_0x1a71d5['query'][_0xf9ba('0x39')]);_0x5077f5[_0xf9ba('0x3b')]=qs[_0xf9ba('0x32')](_[_0xf9ba('0x3a')](_0x1a71d5[_0xf9ba('0x31')],_0x3b0f9e[_0xf9ba('0x32')]));_0x5077f5[_0xf9ba('0x3b')]['ChatWebsiteId']=_0x17a798['id'];if(_0x1a71d5['query']['filter']){_0x5077f5['where']=_[_0xf9ba('0x3e')](_0x5077f5['where'],{'$or':_[_0xf9ba('0x30')](_0x5077f5[_0xf9ba('0x34')],function(_0x395bb2){var _0x15487f={};_0x15487f[_0x395bb2]={'$like':'%'+_0x1a71d5[_0xf9ba('0x31')][_0xf9ba('0x3d')]+'%'};return _0x15487f;})});}_0x5077f5=_[_0xf9ba('0x3e')]({},_0x5077f5,_0x1a71d5['options']);return db[_0xf9ba('0xa5')][_0xf9ba('0x23')]({'where':_0x5077f5[_0xf9ba('0x3b')]})[_0xf9ba('0x12')](function(_0x273c14){_0x5c6842[_0xf9ba('0x23')]=_0x273c14;if(_0x1a71d5[_0xf9ba('0x31')][_0xf9ba('0x3f')]){_0x5077f5['include']=[{'model':db[_0xf9ba('0x8b')],'as':_0xf9ba('0xe7'),'required':![]},{'model':db['User'],'as':_0xf9ba('0xe8'),'attributes':[_0xf9ba('0x28'),_0xf9ba('0xe9'),_0xf9ba('0xea')],'required':![]},{'model':db[_0xf9ba('0xeb')],'as':_0xf9ba('0xec'),'attributes':['id',_0xf9ba('0x28'),_0xf9ba('0xed')],'where':_0x1a71d5[_0xf9ba('0x31')]['tag']?{'id':_0x1a71d5[_0xf9ba('0x31')][_0xf9ba('0xee')]}:undefined,'required':_0x1a71d5[_0xf9ba('0x31')][_0xf9ba('0xee')]?!![]:![]}];}return db[_0xf9ba('0xa5')][_0xf9ba('0x41')](_0x5077f5);})[_0xf9ba('0x12')](function(_0x3bc494){_0x5c6842[_0xf9ba('0x42')]=_0x3bc494;return _0x5c6842;});}})[_0xf9ba('0x12')](respondWithFilteredResult(_0x3f71da,_0x5077f5))[_0xf9ba('0x1c')](handleError(_0x3f71da,null));};function iftimePromise(_0x3ff5f6,_0x1c1175){return respondWithRpcPromise(_0xf9ba('0xef'),_0xf9ba('0xf0'),{'command':_0x1c1175[_0xf9ba('0xf1')]?util[_0xf9ba('0x9d')](_0xf9ba('0xf2'),_0x3ff5f6['interval'],_0x1c1175[_0xf9ba('0xf1')]):util[_0xf9ba('0x9d')](_0xf9ba('0xf3'),_0x3ff5f6[_0xf9ba('0xf4')])},client9002)[_0xf9ba('0x12')](function(_0x3dd1f2){var _0x1759db=_0x3dd1f2&&_0x3dd1f2[_0xf9ba('0xf5')](_0xf9ba('0xf6'))>=0x0?!![]:![];logger[_0xf9ba('0x13')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1c1175['id'],_0x3ff5f6['id'],_0x3ff5f6[_0xf9ba('0xf4')],_0x1759db?_0xf9ba('0xf7'):_0xf9ba('0xf8'),_0x1c1175['timezone']?_0x1c1175[_0xf9ba('0xf1')]:_0xf9ba('0xf9'));return _0x1759db;})[_0xf9ba('0x1c')](function(_0x2edf1f){logger[_0xf9ba('0x17')](_0xf9ba('0xfa'),_0x1c1175['id'],_0x3ff5f6['id'],_0x3ff5f6['interval'],util['inspect'](_0x2edf1f,{'showHidden':![],'depth':null}),_0x1c1175['timezone']?_0x1c1175[_0xf9ba('0xf1')]:_0xf9ba('0xf9'));return![];});}exports[_0xf9ba('0xf0')]=function(_0xbd5e6d,_0xf03974){var _0x556c21=0x0;var _0x318caa=0x0;var _0x1b6382=![];var _0x2d1c55;var _0x799d84;return db['ChatWebsite'][_0xf9ba('0x47')]({'where':{'id':_0xbd5e6d[_0xf9ba('0x44')]['id']},'include':[{'model':db[_0xf9ba('0xfb')],'as':_0xf9ba('0xfb'),'include':[{'model':db[_0xf9ba('0xfb')],'as':_0xf9ba('0xfc'),'attributes':['id',_0xf9ba('0xf4')],'raw':!![]}]}]})[_0xf9ba('0x12')](handleEntityNotFound(_0xf03974,null))[_0xf9ba('0x12')](function(_0x4eedfb){if(_0x4eedfb){_0x2d1c55=_0x4eedfb;return _0x4eedfb[_0xf9ba('0xfd')]({'raw':!![]});}})[_0xf9ba('0x12')](function(_0x5351cd){if(_0x2d1c55){if(_0x5351cd){_0x799d84=_0x5351cd;}}return require(_0xf9ba('0x6b'))[_0xf9ba('0x6c')]();})[_0xf9ba('0x12')](function(_0xc7f42f){if(_0xc7f42f){_0x318caa=_0xc7f42f[_0xf9ba('0xfe')];_0x1b6382=_0xc7f42f[_0xf9ba('0x6d')];}})['then'](function(){return db[_0xf9ba('0xa5')]['count']({'where':{'closed':![]}});})[_0xf9ba('0x12')](function(_0x5e1279){_0x556c21=_0x5e1279;if(_0x318caa&&_0x5e1279>_0x318caa){return db['License'][_0xf9ba('0x58')]({'where':{'id':0x1}})[_0xf9ba('0x12')](function(_0x5bce55){if(_0x5bce55){_0x5bce55[_0xf9ba('0xff')](_0xf9ba('0x100'));}});}})[_0xf9ba('0x12')](function(){if(_0x2d1c55[_0xf9ba('0xfb')]&&_0x2d1c55[_0xf9ba('0xfb')]['Intervals']){var _0xbba012=[];for(var _0x1f0e78=0x0;_0x1f0e78<_0x2d1c55['Interval'][_0xf9ba('0xfc')][_0xf9ba('0x36')];_0x1f0e78++){var _0x4ee213=_0x2d1c55[_0xf9ba('0xfb')][_0xf9ba('0xfc')][_0x1f0e78][_0xf9ba('0x4d')]({'plain':!![]});_0xbba012[_0xf9ba('0xad')](iftimePromise(_0x4ee213,_0x2d1c55));}return BPromise[_0xf9ba('0x101')](_0xbba012)[_0xf9ba('0x12')](function(_0x2b6aed){return _[_0xf9ba('0x102')](_0x2b6aed);});}else{return!![];}})['then'](function(_0x37f444){var _0x58aa31=fs[_0xf9ba('0x103')](path[_0xf9ba('0x68')](config[_0xf9ba('0x69')],_0xf9ba('0x104')),'utf8');var _0x15b951=new url[(_0xf9ba('0x105'))](_0x2d1c55[_0xf9ba('0x106')])[_0xf9ba('0x107')];var _0x3cd632=_0xf9ba('0x108');var _0x7e6c0e=![];var _0x25f99f={'chatVersion':_0x3cd632,'chatWebsiteAddressOrigin':_0x15b951,'remote':_0x2d1c55[_0xf9ba('0x109')],'query':querystring[_0xf9ba('0xa3')](_['merge'](_0x2d1c55[_0xf9ba('0x4d')]({'plain':!![]}),{'customerIp':_0xbd5e6d[_0xf9ba('0x93')][_0xf9ba('0x94')]||_0xbd5e6d[_0xf9ba('0x93')]['x-real-ip']||_0xbd5e6d['connection'][_0xf9ba('0x10a')]||_0xbd5e6d['ip'],'referer':_0xbd5e6d[_0xf9ba('0x93')][_0xf9ba('0x9a')],'openedInteractions':_0x556c21,'maxInteractions':_0x318caa,'virtual':_0x1b6382['virtual'],'online':_0x37f444,'custom':_0x1b6382}))['replace'](/'/g,'\x5c\x27')};_0xf03974[_0xf9ba('0xbc')](ejs['render'](Mustache[_0xf9ba('0xc5')](_0x58aa31,_0x25f99f),{'proactiveActions':_0x799d84,'alignment':_0x2d1c55[_0xf9ba('0x10b')],'verticalAlignment':_0x2d1c55[_0xf9ba('0x10c')],'div_color':_0x2d1c55[_0xf9ba('0xed')],'labelText':_0x2d1c55[_0xf9ba('0x10d')],'text_color':_0x2d1c55['textColor'],'text_button_color':_0x2d1c55[_0xf9ba('0x10e')],'button_color':_0x2d1c55['color_button'],'background_color':_0x2d1c55[_0xf9ba('0x10f')],'hideWhenOffline':_0x2d1c55['hideWhenOffline'],'intervalId':_0x2d1c55['IntervalId'],'isDevelopment':_0x7e6c0e,'chatVersion':_0x3cd632}));})['catch'](handleError(_0xf03974,null));};exports[_0xf9ba('0x110')]=function(_0x55deb2,_0x58e8ae){var _0x136338=_0x55deb2['params']['id'];var _0x1dec8f=_0x55deb2[_0xf9ba('0x49')];var _0x2a321e=0xc8;var _0x116d31=null;return db[_0xf9ba('0x111')][_0xf9ba('0x112')]({'isolationLevel':db[_0xf9ba('0x111')][_0xf9ba('0x113')][_0xf9ba('0x114')]['READ_COMMITTED']},function(_0x31b987){return db['ChatWebsite'][_0xf9ba('0x58')]({'where':{'id':_0x136338},'transaction':_0x31b987})['then'](function(_0x75371a){if(_0x75371a){return db[_0xf9ba('0x115')][_0xf9ba('0x52')]({'where':{'ChatWebsiteId':_0x136338},'transaction':_0x31b987})[_0xf9ba('0x12')](function(){var _0x403275=_[_0xf9ba('0x30')](_0x1dec8f,function(_0x2d3de4){_0x2d3de4[_0xf9ba('0x55')]=_0x136338;return _0x2d3de4;});return db[_0xf9ba('0x115')][_0xf9ba('0xd0')](_0x403275,{'transaction':_0x31b987});});}else{_0x2a321e=0x194;_0x116d31=[];}});})[_0xf9ba('0x12')](function(){if(_0x2a321e!==0x194){return db[_0xf9ba('0x115')][_0xf9ba('0x116')]({'where':{'ChatWebsiteId':_0x136338},'order':_0xf9ba('0x90')})[_0xf9ba('0x12')](function(_0xf2cecc){_0x116d31=_0xf2cecc;});}})[_0xf9ba('0x1c')](function(_0x1fd7eb){_0x2a321e=0x1f4;logger['error'](_0x1fd7eb[_0xf9ba('0x117')]);if(_0x1fd7eb[_0xf9ba('0x28')]){delete _0x1fd7eb[_0xf9ba('0x28')];}_0x116d31=_0x1fd7eb;})['finally'](function(){if(_0x116d31===null){_0x58e8ae[_0xf9ba('0x1d')](_0x2a321e);}else{if(_0x2a321e===0x1f4){_0x58e8ae[_0xf9ba('0x1e')](_0x2a321e)['send'](_0x116d31);}else{_0x58e8ae['status'](_0x2a321e)['json'](_0x116d31);}}});};exports[_0xf9ba('0x118')]=function(_0x165d68,_0x58b4af){var _0x5e08a6={};var _0x5b4119={};var _0x3c8bd9;var _0x2210c8;return db[_0xf9ba('0x2c')][_0xf9ba('0x58')]({'where':{'id':_0x165d68[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x58b4af,null))[_0xf9ba('0x12')](function(_0x3a7739){if(_0x3a7739){_0x3c8bd9=_0x3a7739;_0x5b4119[_0xf9ba('0x2f')]=_[_0xf9ba('0x45')](db[_0xf9ba('0x115')][_0xf9ba('0x2d')]);_0x5b4119['query']=_[_0xf9ba('0x45')](_0x165d68['query']);_0x5b4119[_0xf9ba('0x32')]=_[_0xf9ba('0x33')](_0x5b4119[_0xf9ba('0x2f')],_0x5b4119[_0xf9ba('0x31')]);_0x5e08a6[_0xf9ba('0x34')]=_[_0xf9ba('0x33')](_0x5b4119[_0xf9ba('0x2f')],qs[_0xf9ba('0x35')](_0x165d68['query']['fields']));_0x5e08a6[_0xf9ba('0x34')]=_0x5e08a6[_0xf9ba('0x34')]['length']?_0x5e08a6[_0xf9ba('0x34')]:_0x5b4119['model'];_0x5e08a6[_0xf9ba('0x38')]=qs[_0xf9ba('0x39')](_0x165d68['query']['sort']);_0x5e08a6[_0xf9ba('0x3b')]=qs[_0xf9ba('0x32')](_[_0xf9ba('0x3a')](_0x165d68[_0xf9ba('0x31')],_0x5b4119[_0xf9ba('0x32')]));if(_0x165d68[_0xf9ba('0x31')][_0xf9ba('0x3d')]){_0x5e08a6['where']=_[_0xf9ba('0x3e')](_0x5e08a6[_0xf9ba('0x3b')],{'$or':_[_0xf9ba('0x30')](_0x5e08a6[_0xf9ba('0x34')],function(_0x23892d){var _0x7b0dc6={};_0x7b0dc6[_0x23892d]={'$like':'%'+_0x165d68[_0xf9ba('0x31')][_0xf9ba('0x3d')]+'%'};return _0x7b0dc6;})});}_0x5e08a6=_[_0xf9ba('0x3e')]({},_0x5e08a6,_0x165d68[_0xf9ba('0x46')]);return _0x3c8bd9[_0xf9ba('0x118')](_0x5e08a6);}})['then'](function(_0x29b566){if(_0x29b566){_0x2210c8=_0x29b566['length'];if(!_0x165d68[_0xf9ba('0x31')][_0xf9ba('0x59')]('nolimit')){_0x5e08a6['limit']=qs['limit'](_0x165d68[_0xf9ba('0x31')][_0xf9ba('0x22')]);_0x5e08a6[_0xf9ba('0x20')]=qs[_0xf9ba('0x20')](_0x165d68[_0xf9ba('0x31')][_0xf9ba('0x20')]);}return _0x3c8bd9['getApplications'](_0x5e08a6);}})[_0xf9ba('0x12')](function(_0x3fbfb7){if(_0x3fbfb7){return _0x3fbfb7?{'count':_0x2210c8,'rows':_0x3fbfb7}:null;}})[_0xf9ba('0x12')](respondWithResult(_0x58b4af,null))['catch'](handleError(_0x58b4af,null));};exports[_0xf9ba('0x119')]=function(_0x2baa12,_0xcb19ca){return db['chatProactiveAction'][_0xf9ba('0x47')]({'where':{'id':_0x2baa12['params']['id']}})['then'](handleEntityNotFound(_0xcb19ca,null))[_0xf9ba('0x12')](function(_0x5cdfbe){if(_0x5cdfbe){return _0x5cdfbe[_0xf9ba('0x119')](_0x2baa12[_0xf9ba('0x49')][_0xf9ba('0x5f')],_[_0xf9ba('0xe5')](_0x2baa12[_0xf9ba('0x49')],[_0xf9ba('0x5f'),'id'])||{});}})['then'](respondWithResult(_0xcb19ca,null))['catch'](handleError(_0xcb19ca,null));};exports[_0xf9ba('0xfd')]=function(_0x53c0e9,_0x13f46d){var _0x50817f={};var _0x313227={};var _0x1c546b;var _0x8608e9;return db['ChatWebsite'][_0xf9ba('0x58')]({'where':{'id':_0x53c0e9['params']['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x13f46d,null))[_0xf9ba('0x12')](function(_0x31e0e9){if(_0x31e0e9){_0x1c546b=_0x31e0e9;_0x313227[_0xf9ba('0x2f')]=_['keys'](db[_0xf9ba('0x11a')][_0xf9ba('0x2d')]);_0x313227[_0xf9ba('0x31')]=_['keys'](_0x53c0e9['query']);_0x313227[_0xf9ba('0x32')]=_['intersection'](_0x313227[_0xf9ba('0x2f')],_0x313227['query']);_0x50817f[_0xf9ba('0x34')]=_[_0xf9ba('0x33')](_0x313227[_0xf9ba('0x2f')],qs['fields'](_0x53c0e9[_0xf9ba('0x31')][_0xf9ba('0x35')]));_0x50817f['attributes']=_0x50817f[_0xf9ba('0x34')][_0xf9ba('0x36')]?_0x50817f[_0xf9ba('0x34')]:_0x313227[_0xf9ba('0x2f')];_0x50817f[_0xf9ba('0x38')]=qs[_0xf9ba('0x39')](_0x53c0e9[_0xf9ba('0x31')]['sort']);_0x50817f[_0xf9ba('0x3b')]=qs[_0xf9ba('0x32')](_[_0xf9ba('0x3a')](_0x53c0e9[_0xf9ba('0x31')],_0x313227['filters']));if(_0x53c0e9[_0xf9ba('0x31')][_0xf9ba('0x3d')]){_0x50817f[_0xf9ba('0x3b')]=_[_0xf9ba('0x3e')](_0x50817f[_0xf9ba('0x3b')],{'$or':_[_0xf9ba('0x30')](_0x50817f[_0xf9ba('0x34')],function(_0x45042c){var _0x1ae822={};_0x1ae822[_0x45042c]={'$like':'%'+_0x53c0e9[_0xf9ba('0x31')][_0xf9ba('0x3d')]+'%'};return _0x1ae822;})});}_0x50817f=_['merge']({},_0x50817f,_0x53c0e9[_0xf9ba('0x46')]);return _0x1c546b[_0xf9ba('0xfd')](_0x50817f);}})[_0xf9ba('0x12')](function(_0x38a9cf){if(_0x38a9cf){_0x8608e9=_0x38a9cf[_0xf9ba('0x36')];if(!_0x53c0e9[_0xf9ba('0x31')][_0xf9ba('0x59')](_0xf9ba('0x37'))){_0x50817f[_0xf9ba('0x22')]=qs[_0xf9ba('0x22')](_0x53c0e9[_0xf9ba('0x31')]['limit']);_0x50817f[_0xf9ba('0x20')]=qs[_0xf9ba('0x20')](_0x53c0e9['query'][_0xf9ba('0x20')]);}return _0x1c546b[_0xf9ba('0xfd')](_0x50817f);}})['then'](function(_0x461791){if(_0x461791){return _0x461791?{'count':_0x8608e9,'rows':_0x461791}:null;}})[_0xf9ba('0x12')](respondWithResult(_0x13f46d,null))[_0xf9ba('0x1c')](handleError(_0x13f46d,null));};exports[_0xf9ba('0x11b')]=function(_0x507c40,_0x1837a6){var _0x47120a=_0x507c40['query'][_0xf9ba('0x11c')]===_0xf9ba('0x11d')?_0xf9ba('0x11e'):_0xf9ba('0x11f');return db['ChatWebsite'][_0xf9ba('0x47')]({'attributes':['id',_0x47120a],'where':{'id':_0x507c40[_0xf9ba('0x44')]['id']}})['then'](handleEntityNotFound(_0x1837a6,null))[_0xf9ba('0x12')](function(_0x1f2457){if(_0x1f2457){var _0x12e201=_0x1f2457[_0x47120a];var _0x46a453=_0x12e201&&_0x12e201[_0xf9ba('0x120')]?_0x12e201[_0xf9ba('0x120')]:[];_0x1837a6['send']({'fromKey':_[_0xf9ba('0x6e')](_0x12e201[_0xf9ba('0x121')])?undefined:_0x12e201[_0xf9ba('0x121')],'count':_0x46a453[_0xf9ba('0x36')],'rows':_0x46a453});}})[_0xf9ba('0x1c')](handleError(_0x1837a6,null));};exports[_0xf9ba('0x122')]=function(_0x310516,_0x4293e9){var _0x405013={'raw':![],'where':{}};var _0x457094={};var _0x53978b={'count':0x0,'rows':[]};return db[_0xf9ba('0x2c')][_0xf9ba('0x58')]({'where':{'id':_0x310516[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x4293e9,null))[_0xf9ba('0x12')](function(_0x4f0a4e){if(_0x4f0a4e){_0x457094[_0xf9ba('0x2f')]=_['keys'](db[_0xf9ba('0xc6')][_0xf9ba('0x2d')]);_0x457094[_0xf9ba('0x31')]=_[_0xf9ba('0x45')](_0x310516[_0xf9ba('0x31')]);_0x457094[_0xf9ba('0x32')]=_[_0xf9ba('0x33')](_0x457094['model'],_0x457094['query']);_0x405013[_0xf9ba('0x34')]=_[_0xf9ba('0x33')](_0x457094[_0xf9ba('0x2f')],qs[_0xf9ba('0x35')](_0x310516['query'][_0xf9ba('0x35')]));_0x405013[_0xf9ba('0x34')]=_0x405013[_0xf9ba('0x34')]['length']?_0x405013[_0xf9ba('0x34')]:_0x457094[_0xf9ba('0x2f')];if(!_0x310516[_0xf9ba('0x31')]['hasOwnProperty']('nolimit')){_0x405013[_0xf9ba('0x22')]=qs['limit'](_0x310516['query'][_0xf9ba('0x22')]);_0x405013[_0xf9ba('0x20')]=qs[_0xf9ba('0x20')](_0x310516[_0xf9ba('0x31')]['offset']);}_0x405013[_0xf9ba('0x38')]=qs[_0xf9ba('0x39')](_0x310516[_0xf9ba('0x31')][_0xf9ba('0x39')]);_0x405013['where']=qs[_0xf9ba('0x32')](_[_0xf9ba('0x3a')](_0x310516[_0xf9ba('0x31')],_0x457094[_0xf9ba('0x32')]));_0x405013[_0xf9ba('0x3b')]['ChatWebsiteId']=_0x4f0a4e['id'];if(_0x310516[_0xf9ba('0x31')][_0xf9ba('0x3d')]){_0x405013[_0xf9ba('0x3b')]=_['merge'](_0x405013[_0xf9ba('0x3b')],{'$or':_[_0xf9ba('0x30')](_0x405013[_0xf9ba('0x34')],function(_0x54f76e){var _0x143828={};_0x143828[_0x54f76e]={'$like':'%'+_0x310516['query'][_0xf9ba('0x3d')]+'%'};return _0x143828;})});}_0x405013=_[_0xf9ba('0x3e')]({},_0x405013,_0x310516[_0xf9ba('0x46')]);return db[_0xf9ba('0xc6')][_0xf9ba('0x23')]({'where':_0x405013['where']})[_0xf9ba('0x12')](function(_0x310b7c){_0x53978b['count']=_0x310b7c;if(_0x310516[_0xf9ba('0x31')][_0xf9ba('0x3f')]){_0x405013[_0xf9ba('0x40')]=[{'all':!![]}];}else{_0x405013[_0xf9ba('0x40')]=[{'model':db['CmContact'],'as':_0xf9ba('0xe7'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0xf9ba('0xc6')][_0xf9ba('0x41')](_0x405013);})[_0xf9ba('0x12')](function(_0x17c2b4){_0x53978b[_0xf9ba('0x42')]=_0x17c2b4;return _0x53978b;});}})[_0xf9ba('0x12')](respondWithFilteredResult(_0x4293e9,_0x405013))[_0xf9ba('0x1c')](handleError(_0x4293e9,null));};exports[_0xf9ba('0x123')]=function(_0xd52a03,_0x4b4c99){return db['ChatWebsite'][_0xf9ba('0x47')]({'where':{'id':_0xd52a03[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x4b4c99,null))[_0xf9ba('0x12')](function(_0x5a7b9b){if(_0x5a7b9b){return _0x5a7b9b[_0xf9ba('0x123')](_0xd52a03[_0xf9ba('0x49')][_0xf9ba('0x5f')],_[_0xf9ba('0xe5')](_0xd52a03[_0xf9ba('0x49')],['ids','id'])||{})[_0xf9ba('0xa9')](function(_0x118cbe){for(var _0x22fcf2=0x0;_0x22fcf2<_0xd52a03['body'][_0xf9ba('0x5f')][_0xf9ba('0x36')];_0x22fcf2+=0x1){socket['emit'](_0xf9ba('0x124'),{'UserId':Number(_0xd52a03[_0xf9ba('0x49')][_0xf9ba('0x5f')][_0x22fcf2]),'ChatWebsiteId':Number(_0xd52a03[_0xf9ba('0x44')]['id'])});}return _0x118cbe;});}})[_0xf9ba('0x12')](respondWithResult(_0x4b4c99,null))[_0xf9ba('0x1c')](handleError(_0x4b4c99,null));};exports['removeAgents']=function(_0x48add1,_0x1bfd5e){return db[_0xf9ba('0x2c')][_0xf9ba('0x47')]({'where':{'id':_0x48add1[_0xf9ba('0x44')]['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x1bfd5e,null))[_0xf9ba('0x12')](function(_0x24263c){if(_0x24263c){return _0x24263c[_0xf9ba('0x125')](_0x48add1['query'][_0xf9ba('0x5f')])[_0xf9ba('0x12')](function(){if(_[_0xf9ba('0x126')](_0x48add1[_0xf9ba('0x31')][_0xf9ba('0x5f')])){for(var _0x3b88f0=0x0;_0x3b88f0<_0x48add1[_0xf9ba('0x31')][_0xf9ba('0x5f')][_0xf9ba('0x36')];_0x3b88f0+=0x1){socket[_0xf9ba('0x127')](_0xf9ba('0x128'),{'UserId':Number(_0x48add1[_0xf9ba('0x31')][_0xf9ba('0x5f')][_0x3b88f0]),'ChatWebsiteId':Number(_0x48add1[_0xf9ba('0x44')]['id'])});}}else{socket[_0xf9ba('0x127')](_0xf9ba('0x128'),{'UserId':Number(_0x48add1[_0xf9ba('0x31')][_0xf9ba('0x5f')]),'ChatWebsiteId':Number(_0x48add1[_0xf9ba('0x44')]['id'])});}});}})['then'](respondWithStatusCode(_0x1bfd5e,null))[_0xf9ba('0x1c')](handleError(_0x1bfd5e,null));};exports[_0xf9ba('0x129')]=function(_0x1140e4,_0x5ebcf7){var _0x12b50d={};var _0x19e632={};var _0x37bb7b;var _0x403553;return db[_0xf9ba('0x2c')][_0xf9ba('0x58')]({'where':{'id':_0x1140e4['params']['id']}})[_0xf9ba('0x12')](handleEntityNotFound(_0x5ebcf7,null))['then'](function(_0xed6935){if(_0xed6935){_0x37bb7b=_0xed6935;_0x19e632[_0xf9ba('0x2f')]=_['keys'](db[_0xf9ba('0xb4')]['rawAttributes']);_0x19e632[_0xf9ba('0x31')]=_['keys'](_0x1140e4[_0xf9ba('0x31')]);_0x19e632[_0xf9ba('0x32')]=_[_0xf9ba('0x33')](_0x19e632[_0xf9ba('0x2f')],_0x19e632[_0xf9ba('0x31')]);_0x12b50d[_0xf9ba('0x34')]=_['intersection'](_0x19e632[_0xf9ba('0x2f')],qs['fields'](_0x1140e4[_0xf9ba('0x31')]['fields']));_0x12b50d[_0xf9ba('0x34')]=_0x12b50d[_0xf9ba('0x34')][_0xf9ba('0x36')]?_0x12b50d[_0xf9ba('0x34')]:_0x19e632['model'];_0x12b50d[_0xf9ba('0x38')]=qs[_0xf9ba('0x39')](_0x1140e4[_0xf9ba('0x31')][_0xf9ba('0x39')]);_0x12b50d[_0xf9ba('0x3b')]=qs['filters'](_[_0xf9ba('0x3a')](_0x1140e4[_0xf9ba('0x31')],_0x19e632[_0xf9ba('0x32')]));if(_0x1140e4[_0xf9ba('0x31')][_0xf9ba('0x3d')]){_0x12b50d[_0xf9ba('0x3b')]=_[_0xf9ba('0x3e')](_0x12b50d[_0xf9ba('0x3b')],{'$or':_[_0xf9ba('0x30')](_0x12b50d[_0xf9ba('0x34')],function(_0x256764){var _0x252e7e={};_0x252e7e[_0x256764]={'$like':'%'+_0x1140e4[_0xf9ba('0x31')]['filter']+'%'};return _0x252e7e;})});}_0x12b50d=_[_0xf9ba('0x3e')]({},_0x12b50d,_0x1140e4['options']);return _0x37bb7b[_0xf9ba('0x129')](_0x12b50d);}})[_0xf9ba('0x12')](function(_0xa15996){if(_0xa15996){_0x403553=_0xa15996[_0xf9ba('0x36')];if(!_0x1140e4[_0xf9ba('0x31')]['hasOwnProperty'](_0xf9ba('0x37'))){_0x12b50d[_0xf9ba('0x22')]=qs[_0xf9ba('0x22')](_0x1140e4[_0xf9ba('0x31')][_0xf9ba('0x22')]);_0x12b50d[_0xf9ba('0x20')]=qs[_0xf9ba('0x20')](_0x1140e4[_0xf9ba('0x31')][_0xf9ba('0x20')]);}return _0x37bb7b[_0xf9ba('0x129')](_0x12b50d);}})[_0xf9ba('0x12')](function(_0x37e4d6){if(_0x37e4d6){return _0x37e4d6?{'count':_0x403553,'rows':_0x37e4d6}:null;}})[_0xf9ba('0x12')](respondWithResult(_0x5ebcf7,null))[_0xf9ba('0x1c')](handleError(_0x5ebcf7,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 0bc20cf..ba3f166 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 _0x8e94=['emit','hook','events','../../mysqldb','setMaxListeners','update'];(function(_0x33a694,_0x9b6640){var _0x41ff01=function(_0x4c38b7){while(--_0x4c38b7){_0x33a694['push'](_0x33a694['shift']());}};_0x41ff01(++_0x9b6640);}(_0x8e94,0xf8));var _0x48e9=function(_0xdd2348,_0x5d3232){_0xdd2348=_0xdd2348-0x0;var _0x2e0a02=_0x8e94[_0xdd2348];return _0x2e0a02;};'use strict';var EventEmitter=require(_0x48e9('0x0'));var ChatWebsite=require(_0x48e9('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x48e9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x48e9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x127cbf){return function(_0x5f4f1a,_0x506fa6,_0x479c2c){ChatWebsiteEvents[_0x48e9('0x4')](_0x127cbf+':'+_0x5f4f1a['id'],_0x5f4f1a);ChatWebsiteEvents[_0x48e9('0x4')](_0x127cbf,_0x5f4f1a);_0x479c2c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x48e9('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0x379e=['emit','hasOwnProperty','hook','exports','events','save','update','remove'];(function(_0x390259,_0x338589){var _0x17bec9=function(_0x498c7d){while(--_0x498c7d){_0x390259['push'](_0x390259['shift']());}};_0x17bec9(++_0x338589);}(_0x379e,0x104));var _0xe379=function(_0x287829,_0x39e938){_0x287829=_0x287829-0x0;var _0x293992=_0x379e[_0x287829];return _0x293992;};'use strict';var EventEmitter=require(_0xe379('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe379('0x1'),'afterUpdate':_0xe379('0x2'),'afterDestroy':_0xe379('0x3')};function emitEvent(_0x4387fd){return function(_0x3db31a,_0x475418,_0x3ed6c8){ChatWebsiteEvents['emit'](_0x4387fd+':'+_0x3db31a['id'],_0x3db31a);ChatWebsiteEvents[_0xe379('0x4')](_0x4387fd,_0x3db31a);_0x3ed6c8(null);};}for(var e in events){if(events[_0xe379('0x5')](e)){var event=events[e];ChatWebsite[_0xe379('0x6')](e,emitEvent(event));}}module[_0xe379('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 9ecb660..94ee362 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 _0x14a8=['../../config/environment','./chatWebsite.attributes','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x374ada,_0x27b3a5){var _0x449ed8=function(_0x3efc46){while(--_0x3efc46){_0x374ada['push'](_0x374ada['shift']());}};_0x449ed8(++_0x27b3a5);}(_0x14a8,0x95));var _0x814a=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x14a8[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x814a('0x0'));var util=require(_0x814a('0x1'));var logger=require(_0x814a('0x2'))(_0x814a('0x3'));var moment=require('moment');var BPromise=require(_0x814a('0x4'));var rp=require(_0x814a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x814a('0x6'));var config=require(_0x814a('0x7'));var attributes=require(_0x814a('0x8'));module['exports']=function(_0x5e0e99,_0x28d6b0){return _0x5e0e99[_0x814a('0x9')](_0x814a('0xa'),attributes,{'tableName':_0x814a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc5b0=['path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x221443,_0x597dc0){var _0x260530=function(_0x28b5aa){while(--_0x28b5aa){_0x221443['push'](_0x221443['shift']());}};_0x260530(++_0x597dc0);}(_0xc5b0,0x119));var _0x0c5b=function(_0x38eb86,_0x247e47){_0x38eb86=_0x38eb86-0x0;var _0x1f2581=_0xc5b0[_0x38eb86];return _0x1f2581;};'use strict';var _=require(_0x0c5b('0x0'));var util=require('util');var logger=require(_0x0c5b('0x1'))(_0x0c5b('0x2'));var moment=require('moment');var BPromise=require(_0x0c5b('0x3'));var rp=require(_0x0c5b('0x4'));var fs=require('fs');var path=require(_0x0c5b('0x5'));var rimraf=require(_0x0c5b('0x6'));var config=require(_0x0c5b('0x7'));var attributes=require(_0x0c5b('0x8'));module[_0x0c5b('0x9')]=function(_0x567026,_0x319115){return _0x567026[_0x0c5b('0xa')](_0x0c5b('0xb'),attributes,{'tableName':_0x0c5b('0xc'),'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 98435d9..347cae7 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 _0x939e=['message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x170db8,_0x1d7713){var _0x2482fc=function(_0x44bbfd){while(--_0x44bbfd){_0x170db8['push'](_0x170db8['shift']());}};_0x2482fc(++_0x1d7713);}(_0x939e,0x161));var _0xe939=function(_0x4287b6,_0x2d1db7){_0x4287b6=_0x4287b6-0x0;var _0x5a4f7e=_0x939e[_0x4287b6];return _0x5a4f7e;};'use strict';var _=require(_0xe939('0x0'));var util=require(_0xe939('0x1'));var moment=require(_0xe939('0x2'));var BPromise=require('bluebird');var rs=require(_0xe939('0x3'));var fs=require('fs');var Redis=require(_0xe939('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe939('0x5'));var logger=require(_0xe939('0x6'))(_0xe939('0x7'));var config=require(_0xe939('0x8'));var jayson=require(_0xe939('0x9'));var client=jayson['client'][_0xe939('0xa')]({'port':0x232a});config[_0xe939('0xb')]=_[_0xe939('0xc')](config[_0xe939('0xb')],{'host':_0xe939('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe939('0xb')]));require(_0xe939('0xe'))[_0xe939('0xf')](socket);function respondWithRpcPromise(_0x23783a,_0x2c88a7,_0x588595){return new BPromise(function(_0x1bdb75,_0x2e8965){return client[_0xe939('0x10')](_0x23783a,_0x588595)[_0xe939('0x11')](function(_0x24b9c1){logger[_0xe939('0x12')](_0xe939('0x13'),_0x2c88a7,_0xe939('0x14'));logger[_0xe939('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2c88a7,'request\x20sent',JSON[_0xe939('0x16')](_0x24b9c1));if(_0x24b9c1[_0xe939('0x17')]){if(_0x24b9c1[_0xe939('0x17')][_0xe939('0x18')]===0x1f4){logger[_0xe939('0x17')](_0xe939('0x13'),_0x2c88a7,_0x24b9c1[_0xe939('0x17')][_0xe939('0x19')]);return _0x2e8965(_0x24b9c1['error'][_0xe939('0x19')]);}logger[_0xe939('0x17')](_0xe939('0x13'),_0x2c88a7,_0x24b9c1[_0xe939('0x17')][_0xe939('0x19')]);return _0x1bdb75(_0x24b9c1[_0xe939('0x17')][_0xe939('0x19')]);}else{logger[_0xe939('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x2c88a7,_0xe939('0x14'));_0x1bdb75(_0x24b9c1['result'][_0xe939('0x19')]);}})[_0xe939('0x1a')](function(_0x5a7f10){logger[_0xe939('0x17')](_0xe939('0x13'),_0x2c88a7,_0x5a7f10);_0x2e8965(_0x5a7f10);});});} \ No newline at end of file +var _0xdd38=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatWebsite.socket','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3e94d1,_0x2d264e){var _0x5b4d1e=function(_0x2b0e06){while(--_0x2b0e06){_0x3e94d1['push'](_0x3e94d1['shift']());}};_0x5b4d1e(++_0x2d264e);}(_0xdd38,0x180));var _0x8dd3=function(_0x2c6805,_0x46f0c5){_0x2c6805=_0x2c6805-0x0;var _0x523793=_0xdd38[_0x2c6805];return _0x523793;};'use strict';var _=require(_0x8dd3('0x0'));var util=require(_0x8dd3('0x1'));var moment=require(_0x8dd3('0x2'));var BPromise=require(_0x8dd3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8dd3('0x4'));var db=require(_0x8dd3('0x5'))['db'];var utils=require(_0x8dd3('0x6'));var logger=require('../../config/logger')(_0x8dd3('0x7'));var config=require(_0x8dd3('0x8'));var jayson=require(_0x8dd3('0x9'));var client=jayson[_0x8dd3('0xa')][_0x8dd3('0xb')]({'port':0x232a});config[_0x8dd3('0xc')]=_['defaults'](config[_0x8dd3('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x8dd3('0xd'))(new Redis(config['redis']));require(_0x8dd3('0xe'))['register'](socket);function respondWithRpcPromise(_0xcfdd9,_0x18daa4,_0x615a79){return new BPromise(function(_0x5dcc82,_0x440293){return client['request'](_0xcfdd9,_0x615a79)[_0x8dd3('0xf')](function(_0x2b71d4){logger[_0x8dd3('0x10')](_0x8dd3('0x11'),_0x18daa4,_0x8dd3('0x12'));logger[_0x8dd3('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x18daa4,'request\x20sent',JSON[_0x8dd3('0x14')](_0x2b71d4));if(_0x2b71d4[_0x8dd3('0x15')]){if(_0x2b71d4[_0x8dd3('0x15')][_0x8dd3('0x16')]===0x1f4){logger[_0x8dd3('0x15')](_0x8dd3('0x11'),_0x18daa4,_0x2b71d4['error'][_0x8dd3('0x17')]);return _0x440293(_0x2b71d4[_0x8dd3('0x15')][_0x8dd3('0x17')]);}logger[_0x8dd3('0x15')](_0x8dd3('0x11'),_0x18daa4,_0x2b71d4['error'][_0x8dd3('0x17')]);return _0x5dcc82(_0x2b71d4['error'][_0x8dd3('0x17')]);}else{logger['info'](_0x8dd3('0x11'),_0x18daa4,'request\x20sent');_0x5dcc82(_0x2b71d4[_0x8dd3('0x18')][_0x8dd3('0x17')]);}})[_0x8dd3('0x19')](function(_0x1655b9){logger['error'](_0x8dd3('0x11'),_0x18daa4,_0x1655b9);_0x440293(_0x1655b9);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index e8f64e6..4fa3630 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 _0xc594=['remove','update','emit','register','chatWebsite:','./chatWebsite.events','save'];(function(_0x8e9386,_0x3cc60f){var _0x4abf26=function(_0x59de5a){while(--_0x59de5a){_0x8e9386['push'](_0x8e9386['shift']());}};_0x4abf26(++_0x3cc60f);}(_0xc594,0x1cc));var _0x4c59=function(_0xb0c760,_0x276f35){_0xb0c760=_0xb0c760-0x0;var _0x40a475=_0xc594[_0xb0c760];return _0x40a475;};'use strict';var ChatWebsiteEvents=require(_0x4c59('0x0'));var events=[_0x4c59('0x1'),_0x4c59('0x2'),_0x4c59('0x3')];function createListener(_0x43b411,_0x28db2b){return function(_0x3590ea){_0x28db2b[_0x4c59('0x4')](_0x43b411,_0x3590ea);};}function removeListener(_0x5e22f9,_0xadf9b5){return function(){ChatWebsiteEvents['removeListener'](_0x5e22f9,_0xadf9b5);};}exports[_0x4c59('0x5')]=function(_0x3a6581){for(var _0x368a8f=0x0,_0x343796=events['length'];_0x368a8f<_0x343796;_0x368a8f++){var _0x551126=events[_0x368a8f];var _0x37f30e=createListener(_0x4c59('0x6')+_0x551126,_0x3a6581);ChatWebsiteEvents['on'](_0x551126,_0x37f30e);}}; \ No newline at end of file +var _0x4ef8=['length','chatWebsite:','save','update','emit','removeListener','register'];(function(_0x100f72,_0x1fb228){var _0x3b376c=function(_0x30ce91){while(--_0x30ce91){_0x100f72['push'](_0x100f72['shift']());}};_0x3b376c(++_0x1fb228);}(_0x4ef8,0x16e));var _0x84ef=function(_0x4770b5,_0x4ad6c3){_0x4770b5=_0x4770b5-0x0;var _0x331de2=_0x4ef8[_0x4770b5];return _0x331de2;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x84ef('0x0'),'remove',_0x84ef('0x1')];function createListener(_0x51af75,_0x5d32a9){return function(_0x294a44){_0x5d32a9[_0x84ef('0x2')](_0x51af75,_0x294a44);};}function removeListener(_0x3debae,_0x31d4e8){return function(){ChatWebsiteEvents[_0x84ef('0x3')](_0x3debae,_0x31d4e8);};}exports[_0x84ef('0x4')]=function(_0xb6c9a2){for(var _0x2b050a=0x0,_0x33fbc4=events[_0x84ef('0x5')];_0x2b050a<_0x33fbc4;_0x2b050a++){var _0x17596d=events[_0x2b050a];var _0x55e40b=createListener(_0x84ef('0x6')+_0x17596d,_0xb6c9a2);ChatWebsiteEvents['on'](_0x17596d,_0x55e40b);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 1e46a15..73be8e7 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 _0x13c1=['addSystemAvatar','notify','attachments','offline-chat','replace','/:id/offline','any','offline','addInteraction','/:id/applications','addAgents','destroy','delete','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','diskStorage','join','root','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addCustomerAvatar','/:id/system_avatar'];(function(_0x53b253,_0x5d9ea5){var _0xde3bc5=function(_0x5c2a29){while(--_0x5c2a29){_0x53b253['push'](_0x53b253['shift']());}};_0xde3bc5(++_0x5d9ea5);}(_0x13c1,0xdf));var _0x113c=function(_0x34e799,_0x416e7f){_0x34e799=_0x34e799-0x0;var _0x17eeca=_0x13c1[_0x34e799];return _0x17eeca;};'use strict';var multer=require(_0x113c('0x0'));var util=require(_0x113c('0x1'));var path=require(_0x113c('0x2'));var timeout=require(_0x113c('0x3'));var express=require(_0x113c('0x4'));var router=express[_0x113c('0x5')]();var fs_extra=require(_0x113c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x113c('0x7'));var config=require(_0x113c('0x8'));var controller=require(_0x113c('0x9'));router[_0x113c('0xa')]('/',auth[_0x113c('0xb')](),controller[_0x113c('0xc')]);router[_0x113c('0xa')](_0x113c('0xd'),auth[_0x113c('0xb')](),controller[_0x113c('0xe')]);router['get'](_0x113c('0xf'),auth[_0x113c('0xb')](),controller[_0x113c('0x10')]);router['get'](_0x113c('0x11'),auth['isAuthenticated'](),controller[_0x113c('0x12')]);router[_0x113c('0xa')](_0x113c('0x13'),auth['isAuthenticated'](),controller[_0x113c('0x14')]);router[_0x113c('0xa')](_0x113c('0x15'),controller['getLogo']);router[_0x113c('0xa')](_0x113c('0x16'),controller[_0x113c('0x17')]);router[_0x113c('0xa')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x113c('0xa')]('/:id/system_avatar',controller[_0x113c('0x18')]);router[_0x113c('0xa')](_0x113c('0x19'),auth['isAuthenticated'](),controller[_0x113c('0x1a')]);router[_0x113c('0xa')](_0x113c('0x1b'),controller[_0x113c('0x1c')]);router[_0x113c('0xa')]('/:id/applications',auth[_0x113c('0xb')](),controller[_0x113c('0x1d')]);router[_0x113c('0xa')]('/:id/proactive_actions',auth[_0x113c('0xb')](),controller[_0x113c('0x1e')]);router[_0x113c('0xa')](_0x113c('0x1f'),controller[_0x113c('0x20')]);router[_0x113c('0xa')](_0x113c('0x21'),auth[_0x113c('0xb')](),controller[_0x113c('0x22')]);router['get'](_0x113c('0x23'),auth[_0x113c('0xb')](),controller['getAgents']);router[_0x113c('0x24')]('/',auth[_0x113c('0xb')](),controller[_0x113c('0x25')]);router[_0x113c('0x24')](_0x113c('0x11'),auth['isAuthenticated'](),controller[_0x113c('0x26')]);router[_0x113c('0x24')](_0x113c('0x13'),auth['isAuthenticated'](),controller[_0x113c('0x27')]);var upload=multer({'storage':multer[_0x113c('0x28')]({'destination':function(_0x47303b,_0x5e3269,_0x5348cf){_0x5348cf(null,path[_0x113c('0x29')](config[_0x113c('0x2a')],'server/files/images/logos/'));},'filename':function(_0x565cb2,_0x55f3c0,_0x5e5b81){_0x5e5b81(null,util[_0x113c('0x2b')](_0x113c('0x2c'),Date[_0x113c('0x2d')](),_0x55f3c0[_0x113c('0x2e')]));}})});router[_0x113c('0x24')](_0x113c('0x15'),upload[_0x113c('0x2f')](_0x113c('0x30')),controller[_0x113c('0x31')]);var upload=multer({'storage':multer[_0x113c('0x28')]({'destination':function(_0x518506,_0x249e2e,_0x107f58){_0x107f58(null,path['join'](config['root'],_0x113c('0x32')));},'filename':function(_0x37bbb1,_0x39f888,_0x20be3f){_0x20be3f(null,util[_0x113c('0x2b')](_0x113c('0x2c'),Date['now'](),_0x39f888[_0x113c('0x2e')]));}})});router[_0x113c('0x24')]('/:id/avatar',upload[_0x113c('0x2f')]('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0x113c('0x28')]({'destination':function(_0x3f30e5,_0x289a35,_0x25db44){_0x25db44(null,path[_0x113c('0x29')](config[_0x113c('0x2a')],_0x113c('0x32')));},'filename':function(_0x28141d,_0x2d72de,_0x25981c){_0x25981c(null,util['format']('%s-%s',Date[_0x113c('0x2d')](),_0x2d72de[_0x113c('0x2e')]));}})});router[_0x113c('0x24')]('/:id/customer_avatar',upload['single'](_0x113c('0x30')),controller[_0x113c('0x33')]);var upload=multer({'storage':multer[_0x113c('0x28')]({'destination':function(_0x5bb173,_0xea3349,_0x29711e){_0x29711e(null,path[_0x113c('0x29')](config[_0x113c('0x2a')],_0x113c('0x32')));},'filename':function(_0x1758de,_0x43cf56,_0x5e3ea5){_0x5e3ea5(null,util[_0x113c('0x2b')](_0x113c('0x2c'),Date[_0x113c('0x2d')](),_0x43cf56[_0x113c('0x2e')]));}})});router[_0x113c('0x24')](_0x113c('0x34'),upload['single'](_0x113c('0x30')),controller[_0x113c('0x35')]);router[_0x113c('0x24')]('/:id/notify',controller[_0x113c('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x113c('0x28')]({'destination':function(_0x118950,_0x5022f0,_0x790c7f){const _0x45629a=path[_0x113c('0x29')](config[_0x113c('0x2a')],'server/files',_0x113c('0x37'),_0x113c('0x38'));fs_extra['ensureDir'](_0x45629a,function(){_0x790c7f(null,_0x45629a);});},'filename':function(_0x1d3bf0,_0x5dbdb6,_0x1afa69){const _0x5cd09b=_0x5dbdb6['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1da472=path['extname'](_0x5cd09b);const _0x214e0e=Date[_0x113c('0x2d')]()+'-'+_0x5cd09b[_0x113c('0x39')](_0x1da472,'')+_0x1da472;_0x1afa69(null,_0x214e0e);}})});router[_0x113c('0x24')](_0x113c('0x3a'),offlineUploadMulter[_0x113c('0x3b')](),controller[_0x113c('0x3c')]);router[_0x113c('0x24')](_0x113c('0x19'),auth[_0x113c('0xb')](),controller[_0x113c('0x3d')]);router['post'](_0x113c('0x3e'),auth[_0x113c('0xb')](),controller['addApplications']);router[_0x113c('0x24')]('/:id/proactive_actions',auth[_0x113c('0xb')](),controller['addProactiveActions']);router[_0x113c('0x24')]('/:id/users',auth[_0x113c('0xb')](),controller[_0x113c('0x3f')]);router['put'](_0x113c('0xf'),auth[_0x113c('0xb')](),controller['update']);router['delete'](_0x113c('0xf'),auth['isAuthenticated'](),controller[_0x113c('0x40')]);router[_0x113c('0x41')](_0x113c('0x11'),auth[_0x113c('0xb')](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0x113c('0xb')](),controller[_0x113c('0x42')]);router[_0x113c('0x41')](_0x113c('0x23'),auth[_0x113c('0xb')](),controller[_0x113c('0x43')]);module[_0x113c('0x44')]=router; \ No newline at end of file +var _0x2c06=['server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','extname','replace','/:id/offline','any','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','put','/:id','update','destroy','delete','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','single','file','addLogo','now','addAvatar'];(function(_0x2cef86,_0xbae0a6){var _0x46dfd6=function(_0x52e464){while(--_0x52e464){_0x2cef86['push'](_0x2cef86['shift']());}};_0x46dfd6(++_0xbae0a6);}(_0x2c06,0x1b1));var _0x62c0=function(_0x30a5f2,_0x48c746){_0x30a5f2=_0x30a5f2-0x0;var _0x4f9ab9=_0x2c06[_0x30a5f2];return _0x4f9ab9;};'use strict';var multer=require('multer');var util=require(_0x62c0('0x0'));var path=require(_0x62c0('0x1'));var timeout=require(_0x62c0('0x2'));var express=require(_0x62c0('0x3'));var router=express[_0x62c0('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x62c0('0x5'));var config=require(_0x62c0('0x6'));var controller=require(_0x62c0('0x7'));router[_0x62c0('0x8')]('/',auth[_0x62c0('0x9')](),controller[_0x62c0('0xa')]);router[_0x62c0('0x8')](_0x62c0('0xb'),auth[_0x62c0('0x9')](),controller['describe']);router[_0x62c0('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x62c0('0xc')]);router['get'](_0x62c0('0xd'),auth[_0x62c0('0x9')](),controller[_0x62c0('0xe')]);router[_0x62c0('0x8')](_0x62c0('0xf'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x10')]);router[_0x62c0('0x8')](_0x62c0('0x11'),controller[_0x62c0('0x12')]);router[_0x62c0('0x8')](_0x62c0('0x13'),controller['getAvatar']);router[_0x62c0('0x8')](_0x62c0('0x14'),controller[_0x62c0('0x15')]);router['get'](_0x62c0('0x16'),controller[_0x62c0('0x17')]);router[_0x62c0('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x62c0('0x8')](_0x62c0('0x18'),controller['getSnippet']);router[_0x62c0('0x8')](_0x62c0('0x19'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x1a')]);router[_0x62c0('0x8')](_0x62c0('0x1b'),auth['isAuthenticated'](),controller[_0x62c0('0x1c')]);router[_0x62c0('0x8')](_0x62c0('0x1d'),controller['getFields']);router[_0x62c0('0x8')](_0x62c0('0x1e'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x1f')]);router['get'](_0x62c0('0x20'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x21')]);router[_0x62c0('0x22')]('/',auth['isAuthenticated'](),controller[_0x62c0('0x23')]);router[_0x62c0('0x22')](_0x62c0('0xd'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x24')]);router['post']('/:id/canned_answers',auth[_0x62c0('0x9')](),controller[_0x62c0('0x25')]);var upload=multer({'storage':multer[_0x62c0('0x26')]({'destination':function(_0x4e7960,_0x56b23e,_0x3cc1ea){_0x3cc1ea(null,path[_0x62c0('0x27')](config[_0x62c0('0x28')],_0x62c0('0x29')));},'filename':function(_0x47a90e,_0x532125,_0x35ac78){_0x35ac78(null,util[_0x62c0('0x2a')](_0x62c0('0x2b'),Date['now'](),_0x532125[_0x62c0('0x2c')]));}})});router['post'](_0x62c0('0x11'),upload[_0x62c0('0x2d')](_0x62c0('0x2e')),controller[_0x62c0('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x159bc7,_0x209f0d,_0x33dd3b){_0x33dd3b(null,path['join'](config[_0x62c0('0x28')],'server/files/images/avatars/'));},'filename':function(_0x32255b,_0x48870d,_0x1b6cb7){_0x1b6cb7(null,util[_0x62c0('0x2a')](_0x62c0('0x2b'),Date[_0x62c0('0x30')](),_0x48870d['originalname']));}})});router[_0x62c0('0x22')](_0x62c0('0x13'),upload[_0x62c0('0x2d')](_0x62c0('0x2e')),controller[_0x62c0('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4ff74d,_0x29f27c,_0x188b76){_0x188b76(null,path[_0x62c0('0x27')](config[_0x62c0('0x28')],_0x62c0('0x32')));},'filename':function(_0xb10f3b,_0x2be7e9,_0x59bd55){_0x59bd55(null,util[_0x62c0('0x2a')]('%s-%s',Date['now'](),_0x2be7e9[_0x62c0('0x2c')]));}})});router[_0x62c0('0x22')](_0x62c0('0x14'),upload[_0x62c0('0x2d')](_0x62c0('0x2e')),controller[_0x62c0('0x33')]);var upload=multer({'storage':multer[_0x62c0('0x26')]({'destination':function(_0x198385,_0x5b9493,_0x20aca0){_0x20aca0(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x47aabf,_0x4b2ec4,_0x27fc5e){_0x27fc5e(null,util[_0x62c0('0x2a')](_0x62c0('0x2b'),Date['now'](),_0x4b2ec4[_0x62c0('0x2c')]));}})});router[_0x62c0('0x22')]('/:id/system_avatar',upload[_0x62c0('0x2d')](_0x62c0('0x2e')),controller[_0x62c0('0x34')]);router['post'](_0x62c0('0x35'),controller[_0x62c0('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x62c0('0x26')]({'destination':function(_0x5b04a0,_0x22eeea,_0x47c228){const _0x578bed=path['join'](config['root'],'server/files','attachments','offline-chat');fs_extra['ensureDir'](_0x578bed,function(){_0x47c228(null,_0x578bed);});},'filename':function(_0x5008e7,_0x389823,_0x4cfc88){const _0x36179d=_0x389823[_0x62c0('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x275a0b=path[_0x62c0('0x37')](_0x36179d);const _0x4d21b4=Date[_0x62c0('0x30')]()+'-'+_0x36179d[_0x62c0('0x38')](_0x275a0b,'')+_0x275a0b;_0x4cfc88(null,_0x4d21b4);}})});router[_0x62c0('0x22')](_0x62c0('0x39'),offlineUploadMulter[_0x62c0('0x3a')](),controller[_0x62c0('0x3b')]);router['post'](_0x62c0('0x3c'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x3d')]);router[_0x62c0('0x22')](_0x62c0('0x19'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x3e')]);router[_0x62c0('0x22')](_0x62c0('0x1b'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x3f')]);router[_0x62c0('0x22')](_0x62c0('0x20'),auth['isAuthenticated'](),controller['addAgents']);router[_0x62c0('0x40')](_0x62c0('0x41'),auth[_0x62c0('0x9')](),controller[_0x62c0('0x42')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x62c0('0x43')]);router[_0x62c0('0x44')](_0x62c0('0xd'),auth[_0x62c0('0x9')](),controller['removeDispositions']);router[_0x62c0('0x44')](_0x62c0('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x62c0('0x20'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 2f6f57a..f7cc4dd 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 _0xa653=['get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','express','../config/environment','Router','env','production','app'];(function(_0x5f1431,_0x49bea0){var _0x165500=function(_0xdb081a){while(--_0xdb081a){_0x5f1431['push'](_0x5f1431['shift']());}};_0x165500(++_0x49bea0);}(_0xa653,0x15a));var _0x3a65=function(_0xf943eb,_0xa77db5){_0xf943eb=_0xf943eb-0x0;var _0x1f4ba7=_0xa653[_0xf943eb];return _0x1f4ba7;};var beaverLogger=require('beaver-logger/server');var express=require(_0x3a65('0x0'));var auth=require('../components/auth/service');var config=require(_0x3a65('0x1'));var router=express[_0x3a65('0x2')]();var isProduction=config[_0x3a65('0x3')]===_0x3a65('0x4')||![];function clientSideLogs(_0x92ca2f,_0x268748,_0x6bd0fc){var _0x474a76=_0x92ca2f[_0x3a65('0x5')][_0x3a65('0x6')]('client-side-logger');if(!_0x474a76){throw new Error(_0x3a65('0x7'));}return beaverLogger[_0x3a65('0x8')]({'uri':'/client-logs','logger':_0x474a76,'enableCors':!isProduction})(_0x92ca2f,_0x268748,_0x6bd0fc);}router[_0x3a65('0x9')](auth[_0x3a65('0xa')](),clientSideLogs);module['exports']=router; \ No newline at end of file +var _0x6a57=['../components/auth/service','../config/environment','Router','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server'];(function(_0x114c74,_0x188e59){var _0x465157=function(_0x3b70ad){while(--_0x3b70ad){_0x114c74['push'](_0x114c74['shift']());}};_0x465157(++_0x188e59);}(_0x6a57,0x197));var _0x76a5=function(_0x4bdab6,_0xe86f11){_0x4bdab6=_0x4bdab6-0x0;var _0x5e1c1a=_0x6a57[_0x4bdab6];return _0x5e1c1a;};var beaverLogger=require(_0x76a5('0x0'));var express=require('express');var auth=require(_0x76a5('0x1'));var config=require(_0x76a5('0x2'));var router=express[_0x76a5('0x3')]();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x342f99,_0x1c1749,_0x85dfac){var _0x20a73f=_0x342f99[_0x76a5('0x4')][_0x76a5('0x5')](_0x76a5('0x6'));if(!_0x20a73f){throw new Error(_0x76a5('0x7'));}return beaverLogger[_0x76a5('0x8')]({'uri':'/client-logs','logger':_0x20a73f,'enableCors':!isProduction})(_0x342f99,_0x1c1749,_0x85dfac);}router[_0x76a5('0x9')](auth[_0x76a5('0xa')](),clientSideLogs);module[_0x76a5('0xb')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index edab9d8..9559bd9 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 _0x094f=['exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize'];(function(_0xbe59fa,_0x530be0){var _0x135e7e=function(_0x42b33e){while(--_0x42b33e){_0xbe59fa['push'](_0xbe59fa['shift']());}};_0x135e7e(++_0x530be0);}(_0x094f,0x6f));var _0xf094=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x094f[_0x2db12b];return _0x20990b;};'use strict';var Sequelize=require(_0xf094('0x0'));module[_0xf094('0x1')]={'name':{'type':Sequelize[_0xf094('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf094('0x3')](_0xf094('0x4'),_0xf094('0x5'),_0xf094('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xf094('0x3')](_0xf094('0x7'),'Dynamics365')},'data1':{'type':Sequelize[_0xf094('0x2')],'comment':_0xf094('0x8')},'data2':{'type':Sequelize[_0xf094('0x2')],'comment':_0xf094('0x9')},'data3':{'type':Sequelize[_0xf094('0x2')],'comment':_0xf094('0xa')},'data4':{'type':Sequelize[_0xf094('0x2')],'comment':_0xf094('0xb')},'data5':{'type':Sequelize[_0xf094('0xc')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xf094('0xc')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xf094('0xc')],'comment':_0xf094('0xd')}}; \ No newline at end of file +var _0x7898=['MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','AmazonAWS','Google','MicrosoftAzure','ENUM','Outlook365','MicrosoftAzure\x20=>\x20client_id'];(function(_0x7dc834,_0x2ea838){var _0x2b3946=function(_0x133ebf){while(--_0x133ebf){_0x7dc834['push'](_0x7dc834['shift']());}};_0x2b3946(++_0x2ea838);}(_0x7898,0xa0));var _0x8789=function(_0x4639d2,_0x41bf0a){_0x4639d2=_0x4639d2-0x0;var _0x5c1f9d=_0x7898[_0x4639d2];return _0x5c1f9d;};'use strict';var Sequelize=require(_0x8789('0x0'));module[_0x8789('0x1')]={'name':{'type':Sequelize[_0x8789('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x8789('0x3'),_0x8789('0x4'),_0x8789('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x8789('0x6')](_0x8789('0x7'),'Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':_0x8789('0x8')},'data2':{'type':Sequelize[_0x8789('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x8789('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x8789('0x2')],'comment':_0x8789('0x9')},'data5':{'type':Sequelize[_0x8789('0xa')],'comment':_0x8789('0xb')},'data6':{'type':Sequelize[_0x8789('0xa')],'comment':_0x8789('0xc')},'data7':{'type':Sequelize['TEXT'],'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 ef8c3a2..7cef634 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 _0x2317=['defaults','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','service','MicrosoftAzure','data3','catch','show','params','keys','includeAll','find','decryptString','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','encryptString','create','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','access_token','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis'];(function(_0x2d0fff,_0x128adc){var _0x40c5b1=function(_0x2bbb86){while(--_0x2bbb86){_0x2d0fff['push'](_0x2d0fff['shift']());}};_0x40c5b1(++_0x128adc);}(_0x2317,0x11c));var _0x7231=function(_0xf5b1aa,_0x369a5b){_0xf5b1aa=_0xf5b1aa-0x0;var _0x433e1b=_0x2317[_0xf5b1aa];return _0x433e1b;};'use strict';var _=require(_0x7231('0x0'));var Redis=require(_0x7231('0x1'));var qs=require(_0x7231('0x2'));var encryptor=require(_0x7231('0x3'));var config=require(_0x7231('0x4'));var logger=require(_0x7231('0x5'))(_0x7231('0x6'));var db=require(_0x7231('0x7'))['db'];var oauth=require(_0x7231('0x8'));config[_0x7231('0x9')]=_[_0x7231('0xa')](config[_0x7231('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7231('0x9')]));var redis=new Redis(config[_0x7231('0x9')]);function respondWithStatusCode(_0x1be196,_0x2cdb48){_0x2cdb48=_0x2cdb48||0xcc;return function(_0x2f4f69){if(_0x2f4f69){return _0x1be196[_0x7231('0xb')](_0x2cdb48);}return _0x1be196[_0x7231('0xc')](_0x2cdb48)[_0x7231('0xd')]();};}function respondWithResult(_0x207bd9,_0x1d95cf){_0x1d95cf=_0x1d95cf||0xc8;return function(_0x2b4c49){if(_0x2b4c49){return _0x207bd9[_0x7231('0xc')](_0x1d95cf)[_0x7231('0xe')](_0x2b4c49);}};}function respondWithFilteredResult(_0x17a3c7,_0x243b98){return function(_0x55cb80){if(_0x55cb80){var _0xb4b0e7=typeof _0x243b98[_0x7231('0xf')]===_0x7231('0x10')&&typeof _0x243b98[_0x7231('0x11')]===_0x7231('0x10');var _0x2d5244=_0x55cb80[_0x7231('0x12')];var _0x4ae810=_0xb4b0e7?0x0:_0x243b98[_0x7231('0xf')];var _0x5bccf2=_0xb4b0e7?_0x55cb80[_0x7231('0x12')]:_0x243b98[_0x7231('0xf')]+_0x243b98[_0x7231('0x11')];var _0x16ecc1;if(_0x5bccf2>=_0x2d5244){_0x5bccf2=_0x2d5244;_0x16ecc1=0xc8;}else{_0x16ecc1=0xce;}_0x17a3c7['status'](_0x16ecc1);return _0x17a3c7[_0x7231('0x13')](_0x7231('0x14'),_0x4ae810+'-'+_0x5bccf2+'/'+_0x2d5244)[_0x7231('0xe')](_0x55cb80);}return null;};}function saveUpdates(_0x11c337){return function(_0x2b334a){if(_0x2b334a){return _0x2b334a[_0x7231('0x15')](_0x11c337)['then'](function(_0x518775){return _0x518775;});}return null;};}function removeEntity(_0x5da8aa){return function(_0x4b7327){if(_0x4b7327){return _0x4b7327[_0x7231('0x16')]()[_0x7231('0x17')](function(){_0x5da8aa[_0x7231('0xc')](0xcc)[_0x7231('0xd')]();});}};}function handleEntityNotFound(_0x4799c6){return function(_0x5691b0){if(!_0x5691b0){_0x4799c6['sendStatus'](0x194);}return _0x5691b0;};}function handleError(_0x4ed1bc,_0x482c5c){_0x482c5c=_0x482c5c||0x1f4;return function(_0x144d01){logger[_0x7231('0x18')](_0x144d01[_0x7231('0x19')]);if(_0x144d01['name']){delete _0x144d01[_0x7231('0x1a')];}_0x4ed1bc[_0x7231('0xc')](_0x482c5c)[_0x7231('0x1b')](_0x144d01);};}function maskClientSecret(_0x8c7853){return _[_0x7231('0x1c')](_0x8c7853[_0x7231('0x1d')](0x0,0x3),0x14,'*');}exports[_0x7231('0x1e')]=function(_0x1082df,_0x2799ce){var _0x1ae204={},_0x21dd1d={},_0x342032={'count':0x0,'rows':[]};var _0x1d9116=_[_0x7231('0x1f')](db[_0x7231('0x20')][_0x7231('0x21')],function(_0x47ab1b){return{'name':_0x47ab1b[_0x7231('0x22')],'type':_0x47ab1b[_0x7231('0x23')][_0x7231('0x24')]};});_0x21dd1d[_0x7231('0x25')]=_['map'](_0x1d9116,_0x7231('0x1a'));_0x21dd1d[_0x7231('0x26')]=_['keys'](_0x1082df['query']);_0x21dd1d[_0x7231('0x27')]=_[_0x7231('0x28')](_0x21dd1d[_0x7231('0x25')],_0x21dd1d[_0x7231('0x26')]);_0x1ae204[_0x7231('0x29')]=_['intersection'](_0x21dd1d[_0x7231('0x25')],qs[_0x7231('0x2a')](_0x1082df[_0x7231('0x26')]['fields']));_0x1ae204['attributes']=_0x1ae204[_0x7231('0x29')][_0x7231('0x2b')]?_0x1ae204[_0x7231('0x29')]:_0x21dd1d[_0x7231('0x25')];if(!_0x1082df[_0x7231('0x26')]['hasOwnProperty'](_0x7231('0x2c'))){_0x1ae204[_0x7231('0x11')]=qs[_0x7231('0x11')](_0x1082df[_0x7231('0x26')][_0x7231('0x11')]);_0x1ae204[_0x7231('0xf')]=qs[_0x7231('0xf')](_0x1082df[_0x7231('0x26')][_0x7231('0xf')]);}_0x1ae204[_0x7231('0x2d')]=qs[_0x7231('0x2e')](_0x1082df[_0x7231('0x26')][_0x7231('0x2e')]);_0x1ae204[_0x7231('0x2f')]=qs['filters'](_['pick'](_0x1082df[_0x7231('0x26')],_0x21dd1d['filters']),_0x1d9116);if(_0x1082df[_0x7231('0x26')][_0x7231('0x30')]){_0x1ae204[_0x7231('0x2f')]=_['merge'](_0x1ae204[_0x7231('0x2f')],{'$or':_[_0x7231('0x1f')](_0x1d9116,function(_0xbd9259){if(_0xbd9259[_0x7231('0x23')]!==_0x7231('0x31')){var _0x52570b={};_0x52570b[_0xbd9259[_0x7231('0x1a')]]={'$like':'%'+_0x1082df[_0x7231('0x26')][_0x7231('0x30')]+'%'};return _0x52570b;}})});}_0x1ae204=_[_0x7231('0x32')]({},_0x1ae204,_0x1082df[_0x7231('0x33')]);var _0x925f85={'where':_0x1ae204[_0x7231('0x2f')]};return db[_0x7231('0x20')]['count'](_0x925f85)[_0x7231('0x17')](function(_0xb9f64){_0x342032['count']=_0xb9f64;if(_0x1082df[_0x7231('0x26')]['includeAll']){_0x1ae204[_0x7231('0x34')]=[{'all':!![]}];}return db[_0x7231('0x20')][_0x7231('0x35')](_0x1ae204);})[_0x7231('0x17')](function(_0x4ee66e){_0x342032[_0x7231('0x36')]=_[_0x7231('0x1f')](_0x4ee66e,function(_0xd34e37){if(_0xd34e37[_0x7231('0x37')]===_0x7231('0x38')){var _0x1ee97d=encryptor['decryptString'](_0xd34e37[_0x7231('0x39')]);_0xd34e37[_0x7231('0x39')]=maskClientSecret(_0x1ee97d);}return _0xd34e37;});return _0x342032;})[_0x7231('0x17')](respondWithFilteredResult(_0x2799ce,_0x1ae204))[_0x7231('0x3a')](handleError(_0x2799ce,null));};exports[_0x7231('0x3b')]=function(_0x19ed45,_0x7bf722){var _0x37614c={'raw':!![],'where':{'id':_0x19ed45[_0x7231('0x3c')]['id']}},_0x26835e={};_0x26835e[_0x7231('0x25')]=_[_0x7231('0x3d')](db['CloudProvider']['rawAttributes']);_0x26835e['query']=_['keys'](_0x19ed45['query']);_0x26835e[_0x7231('0x27')]=_[_0x7231('0x28')](_0x26835e[_0x7231('0x25')],_0x26835e[_0x7231('0x26')]);_0x37614c[_0x7231('0x29')]=_[_0x7231('0x28')](_0x26835e['model'],qs[_0x7231('0x2a')](_0x19ed45['query'][_0x7231('0x2a')]));_0x37614c[_0x7231('0x29')]=_0x37614c[_0x7231('0x29')][_0x7231('0x2b')]?_0x37614c[_0x7231('0x29')]:_0x26835e[_0x7231('0x25')];if(_0x19ed45['query'][_0x7231('0x3e')]){_0x37614c[_0x7231('0x34')]=[{'all':!![]}];}_0x37614c=_[_0x7231('0x32')]({},_0x37614c,_0x19ed45['options']);return db[_0x7231('0x20')][_0x7231('0x3f')](_0x37614c)[_0x7231('0x17')](handleEntityNotFound(_0x7bf722,null))['then'](function(_0x4d4ba3){if(_0x4d4ba3[_0x7231('0x37')]===_0x7231('0x38')){var _0x463723=encryptor[_0x7231('0x40')](_0x4d4ba3[_0x7231('0x39')]);_0x4d4ba3[_0x7231('0x39')]=maskClientSecret(_0x463723);}return _0x4d4ba3;})[_0x7231('0x17')](respondWithResult(_0x7bf722,null))['catch'](handleError(_0x7bf722,null));};exports['create']=function(_0x53924b,_0x45495f){if(!_0x53924b[_0x7231('0x41')][_0x7231('0x1a')])throw new Error(_0x7231('0x42'));if(!_0x53924b[_0x7231('0x41')][_0x7231('0x37')])throw new Error(_0x7231('0x43'));var _0x58c635=db[_0x7231('0x20')][_0x7231('0x21')][_0x7231('0x37')][_0x7231('0x44')];if(!_0x58c635[_0x7231('0x45')](_0x53924b[_0x7231('0x41')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x58c635['join'](',\x20'));if(_0x53924b[_0x7231('0x41')][_0x7231('0x37')]===_0x7231('0x38')&&_0x53924b[_0x7231('0x41')][_0x7231('0x39')]){_0x53924b[_0x7231('0x41')]['data3']=encryptor[_0x7231('0x46')](_0x53924b['body'][_0x7231('0x39')]);}return db['CloudProvider'][_0x7231('0x47')](_0x53924b[_0x7231('0x41')],{})[_0x7231('0x17')](respondWithResult(_0x45495f,0xc9))[_0x7231('0x3a')](handleError(_0x45495f,null));};exports['update']=function(_0x137130,_0x30025a){if(_0x137130[_0x7231('0x41')]['id']){delete _0x137130[_0x7231('0x41')]['id'];}return db[_0x7231('0x20')][_0x7231('0x3f')]({'where':{'id':_0x137130[_0x7231('0x3c')]['id']}})['then'](handleEntityNotFound(_0x30025a,null))['then'](function(_0x1b095c){if(_0x1b095c['service']===_0x7231('0x38')&&_0x137130[_0x7231('0x41')][_0x7231('0x39')]){_0x137130[_0x7231('0x41')][_0x7231('0x39')]=encryptor[_0x7231('0x46')](_0x137130['body'][_0x7231('0x39')]);}return _0x1b095c;})[_0x7231('0x17')](saveUpdates(_0x137130['body'],null))[_0x7231('0x17')](respondWithResult(_0x30025a,null))[_0x7231('0x3a')](handleError(_0x30025a,null));};exports['destroy']=function(_0x12b9fc,_0xddc985){return db[_0x7231('0x20')][_0x7231('0x3f')]({'where':{'id':_0x12b9fc['params']['id']}})[_0x7231('0x17')](handleEntityNotFound(_0xddc985,null))[_0x7231('0x17')](removeEntity(_0xddc985,null))[_0x7231('0x3a')](handleError(_0xddc985,null));};exports['oauth2MicrosoftAuthorize']=function(_0x5e7f7e,_0x19c5c4){return db[_0x7231('0x20')]['findOne']({'where':{'id':_0x5e7f7e[_0x7231('0x3c')]['id']},'raw':!![]})[_0x7231('0x17')](function(_0x27c079){if(!_0x27c079)return _0x19c5c4[_0x7231('0xb')](0x194);return{'url':oauth[_0x7231('0x48')](_0x27c079,_0x5e7f7e['user']['id'])};})['then'](respondWithResult(_0x19c5c4,null))[_0x7231('0x3a')](handleError(_0x19c5c4,null));};exports[_0x7231('0x49')]=function(_0x507798,_0x17ea72){var _0x2d4db1=_0x507798['body'];var _0x148dd3;var _0xd5c60c;if(_0x2d4db1[_0x7231('0x18')])throw _0x2d4db1;redis[_0x7231('0x4a')](_0x2d4db1[_0x7231('0x4b')])['then'](function(_0x327503){if(!_0x327503)throw new Error(_0x7231('0x4c'));_0x148dd3=JSON[_0x7231('0x4d')](_0x327503);var _0x42388c=Buffer[_0x7231('0x4e')](_0x2d4db1[_0x7231('0x4b')],_0x7231('0x4f'))[_0x7231('0x50')](_0x7231('0x51'));_0xd5c60c=JSON[_0x7231('0x4d')](_0x42388c);if(!oauth[_0x7231('0x52')](_0x2d4db1[_0x7231('0x53')],_0x148dd3[_0x7231('0x54')]))throw new Error(_0x7231('0x55'));redis[_0x7231('0x56')](_0x2d4db1[_0x7231('0x4b')]);return oauth[_0x7231('0x57')](_0x2d4db1['code'],_0x148dd3);})['then'](function(_0x4e5fc1){_0x148dd3[_0x7231('0x58')]=_0x4e5fc1[_0x7231('0x59')];_0x148dd3[_0x7231('0x5a')]=_0x4e5fc1[_0x7231('0x5b')];return db[_0x7231('0x20')][_0x7231('0x15')]({'data5':_0x148dd3[_0x7231('0x58')],'data6':_0x148dd3['data6']},{'where':{'id':_0x148dd3['id']}});})[_0x7231('0x17')](function(){oauth['startRefreshInterval'](_0x148dd3);socket[_0x7231('0x5c')](_0x7231('0x5d'),{'id':_0xd5c60c['id']});return;})[_0x7231('0x17')](respondWithStatusCode(_0x17ea72,null))[_0x7231('0x3a')](function(_0x4e1082){if(_0xd5c60c){socket[_0x7231('0x5c')](_0x7231('0x5e'),{'id':_0xd5c60c['id']});}if(!_0x148dd3){logger[_0x7231('0x18')](_0x7231('0x5f'),_0x4e1082);return _0x17ea72[_0x7231('0xc')](0x1f4)[_0x7231('0x1b')](_0x4e1082[_0x7231('0x60')]);}logger[_0x7231('0x18')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x148dd3['id'],JSON[_0x7231('0x61')](_0x4e1082));});}; \ No newline at end of file +var _0x586e=['index','map','CloudProvider','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','where','pick','filter','merge','options','includeAll','include','rows','service','MicrosoftAzure','decryptString','data3','catch','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','params','destroy','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','Invalid\x20state\x20parameter','parse','state','toString','ascii','isValidIdToken','id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','update','then','end','name','send','padEnd','slice'];(function(_0x44dc86,_0x5d33da){var _0x22b4b7=function(_0x420804){while(--_0x420804){_0x44dc86['push'](_0x44dc86['shift']());}};_0x22b4b7(++_0x5d33da);}(_0x586e,0xa5));var _0xe586=function(_0x44d9ab,_0x76bc69){_0x44d9ab=_0x44d9ab-0x0;var _0x31485e=_0x586e[_0x44d9ab];return _0x31485e;};'use strict';var _=require(_0xe586('0x0'));var Redis=require(_0xe586('0x1'));var qs=require(_0xe586('0x2'));var encryptor=require(_0xe586('0x3'));var config=require(_0xe586('0x4'));var logger=require(_0xe586('0x5'))(_0xe586('0x6'));var db=require(_0xe586('0x7'))['db'];var oauth=require(_0xe586('0x8'));config['redis']=_[_0xe586('0x9')](config[_0xe586('0xa')],{'host':_0xe586('0xb'),'port':0x18eb});var socket=require(_0xe586('0xc'))(new Redis(config[_0xe586('0xa')]));var redis=new Redis(config[_0xe586('0xa')]);function respondWithStatusCode(_0x49bc22,_0x46d5bd){_0x46d5bd=_0x46d5bd||0xcc;return function(_0x13576c){if(_0x13576c){return _0x49bc22[_0xe586('0xd')](_0x46d5bd);}return _0x49bc22[_0xe586('0xe')](_0x46d5bd)['end']();};}function respondWithResult(_0x3d449f,_0x4c4125){_0x4c4125=_0x4c4125||0xc8;return function(_0xcb0cc5){if(_0xcb0cc5){return _0x3d449f[_0xe586('0xe')](_0x4c4125)['json'](_0xcb0cc5);}};}function respondWithFilteredResult(_0x36e265,_0x50de8c){return function(_0x4f530f){if(_0x4f530f){var _0x3705c4=typeof _0x50de8c[_0xe586('0xf')]==='undefined'&&typeof _0x50de8c['limit']===_0xe586('0x10');var _0x3e8b5a=_0x4f530f[_0xe586('0x11')];var _0x1651e8=_0x3705c4?0x0:_0x50de8c['offset'];var _0x10e2b5=_0x3705c4?_0x4f530f[_0xe586('0x11')]:_0x50de8c['offset']+_0x50de8c[_0xe586('0x12')];var _0x4afa74;if(_0x10e2b5>=_0x3e8b5a){_0x10e2b5=_0x3e8b5a;_0x4afa74=0xc8;}else{_0x4afa74=0xce;}_0x36e265[_0xe586('0xe')](_0x4afa74);return _0x36e265[_0xe586('0x13')](_0xe586('0x14'),_0x1651e8+'-'+_0x10e2b5+'/'+_0x3e8b5a)[_0xe586('0x15')](_0x4f530f);}return null;};}function saveUpdates(_0x748f3){return function(_0x28c2cd){if(_0x28c2cd){return _0x28c2cd[_0xe586('0x16')](_0x748f3)['then'](function(_0xa557c2){return _0xa557c2;});}return null;};}function removeEntity(_0x4a401c){return function(_0x340471){if(_0x340471){return _0x340471['destroy']()[_0xe586('0x17')](function(){_0x4a401c[_0xe586('0xe')](0xcc)[_0xe586('0x18')]();});}};}function handleEntityNotFound(_0x8782c3){return function(_0x4114dc){if(!_0x4114dc){_0x8782c3['sendStatus'](0x194);}return _0x4114dc;};}function handleError(_0x497df1,_0x1ed1b8){_0x1ed1b8=_0x1ed1b8||0x1f4;return function(_0x1ba2cc){logger['error'](_0x1ba2cc['stack']);if(_0x1ba2cc[_0xe586('0x19')]){delete _0x1ba2cc[_0xe586('0x19')];}_0x497df1[_0xe586('0xe')](_0x1ed1b8)[_0xe586('0x1a')](_0x1ba2cc);};}function maskClientSecret(_0x111a77){return _[_0xe586('0x1b')](_0x111a77[_0xe586('0x1c')](0x0,0x3),0x14,'*');}exports[_0xe586('0x1d')]=function(_0x54d164,_0x4df6c8){var _0x5590f3={},_0x50f9be={},_0x254e38={'count':0x0,'rows':[]};var _0x250de9=_[_0xe586('0x1e')](db[_0xe586('0x1f')][_0xe586('0x20')],function(_0x5d7463){return{'name':_0x5d7463[_0xe586('0x21')],'type':_0x5d7463[_0xe586('0x22')][_0xe586('0x23')]};});_0x50f9be['model']=_[_0xe586('0x1e')](_0x250de9,_0xe586('0x19'));_0x50f9be['query']=_[_0xe586('0x24')](_0x54d164[_0xe586('0x25')]);_0x50f9be[_0xe586('0x26')]=_[_0xe586('0x27')](_0x50f9be[_0xe586('0x28')],_0x50f9be[_0xe586('0x25')]);_0x5590f3[_0xe586('0x29')]=_[_0xe586('0x27')](_0x50f9be['model'],qs[_0xe586('0x2a')](_0x54d164[_0xe586('0x25')]['fields']));_0x5590f3[_0xe586('0x29')]=_0x5590f3['attributes'][_0xe586('0x2b')]?_0x5590f3[_0xe586('0x29')]:_0x50f9be[_0xe586('0x28')];if(!_0x54d164[_0xe586('0x25')][_0xe586('0x2c')]('nolimit')){_0x5590f3[_0xe586('0x12')]=qs[_0xe586('0x12')](_0x54d164[_0xe586('0x25')][_0xe586('0x12')]);_0x5590f3[_0xe586('0xf')]=qs[_0xe586('0xf')](_0x54d164[_0xe586('0x25')]['offset']);}_0x5590f3['order']=qs['sort'](_0x54d164[_0xe586('0x25')]['sort']);_0x5590f3[_0xe586('0x2d')]=qs['filters'](_[_0xe586('0x2e')](_0x54d164['query'],_0x50f9be[_0xe586('0x26')]),_0x250de9);if(_0x54d164[_0xe586('0x25')][_0xe586('0x2f')]){_0x5590f3[_0xe586('0x2d')]=_['merge'](_0x5590f3[_0xe586('0x2d')],{'$or':_[_0xe586('0x1e')](_0x250de9,function(_0x4651b3){if(_0x4651b3['type']!=='VIRTUAL'){var _0x9b38fa={};_0x9b38fa[_0x4651b3[_0xe586('0x19')]]={'$like':'%'+_0x54d164[_0xe586('0x25')][_0xe586('0x2f')]+'%'};return _0x9b38fa;}})});}_0x5590f3=_[_0xe586('0x30')]({},_0x5590f3,_0x54d164[_0xe586('0x31')]);var _0x338baa={'where':_0x5590f3[_0xe586('0x2d')]};return db[_0xe586('0x1f')][_0xe586('0x11')](_0x338baa)['then'](function(_0x3b1d5f){_0x254e38['count']=_0x3b1d5f;if(_0x54d164[_0xe586('0x25')][_0xe586('0x32')]){_0x5590f3[_0xe586('0x33')]=[{'all':!![]}];}return db[_0xe586('0x1f')]['findAll'](_0x5590f3);})[_0xe586('0x17')](function(_0x4a4cd4){_0x254e38[_0xe586('0x34')]=_[_0xe586('0x1e')](_0x4a4cd4,function(_0x27bc47){if(_0x27bc47[_0xe586('0x35')]===_0xe586('0x36')){var _0x1f0a54=encryptor[_0xe586('0x37')](_0x27bc47[_0xe586('0x38')]);_0x27bc47[_0xe586('0x38')]=maskClientSecret(_0x1f0a54);}return _0x27bc47;});return _0x254e38;})['then'](respondWithFilteredResult(_0x4df6c8,_0x5590f3))[_0xe586('0x39')](handleError(_0x4df6c8,null));};exports['show']=function(_0x173365,_0x5eb080){var _0x44cead={'raw':!![],'where':{'id':_0x173365['params']['id']}},_0x30c3c5={};_0x30c3c5['model']=_['keys'](db[_0xe586('0x1f')][_0xe586('0x20')]);_0x30c3c5['query']=_[_0xe586('0x24')](_0x173365['query']);_0x30c3c5[_0xe586('0x26')]=_[_0xe586('0x27')](_0x30c3c5[_0xe586('0x28')],_0x30c3c5[_0xe586('0x25')]);_0x44cead[_0xe586('0x29')]=_[_0xe586('0x27')](_0x30c3c5[_0xe586('0x28')],qs[_0xe586('0x2a')](_0x173365['query'][_0xe586('0x2a')]));_0x44cead['attributes']=_0x44cead[_0xe586('0x29')][_0xe586('0x2b')]?_0x44cead[_0xe586('0x29')]:_0x30c3c5[_0xe586('0x28')];if(_0x173365['query'][_0xe586('0x32')]){_0x44cead['include']=[{'all':!![]}];}_0x44cead=_[_0xe586('0x30')]({},_0x44cead,_0x173365[_0xe586('0x31')]);return db[_0xe586('0x1f')][_0xe586('0x3a')](_0x44cead)[_0xe586('0x17')](handleEntityNotFound(_0x5eb080,null))[_0xe586('0x17')](function(_0x55a27d){if(_0x55a27d[_0xe586('0x35')]==='MicrosoftAzure'){var _0x4999ba=encryptor[_0xe586('0x37')](_0x55a27d[_0xe586('0x38')]);_0x55a27d[_0xe586('0x38')]=maskClientSecret(_0x4999ba);}return _0x55a27d;})[_0xe586('0x17')](respondWithResult(_0x5eb080,null))[_0xe586('0x39')](handleError(_0x5eb080,null));};exports[_0xe586('0x3b')]=function(_0x332c3f,_0x1c172a){if(!_0x332c3f[_0xe586('0x3c')][_0xe586('0x19')])throw new Error(_0xe586('0x3d'));if(!_0x332c3f['body'][_0xe586('0x35')])throw new Error(_0xe586('0x3e'));var _0x581f74=db[_0xe586('0x1f')][_0xe586('0x20')][_0xe586('0x35')][_0xe586('0x3f')];if(!_0x581f74[_0xe586('0x40')](_0x332c3f[_0xe586('0x3c')][_0xe586('0x35')]))throw new Error(_0xe586('0x41')+_0x581f74[_0xe586('0x42')](',\x20'));if(_0x332c3f[_0xe586('0x3c')]['service']==='MicrosoftAzure'&&_0x332c3f[_0xe586('0x3c')][_0xe586('0x38')]){_0x332c3f[_0xe586('0x3c')]['data3']=encryptor[_0xe586('0x43')](_0x332c3f[_0xe586('0x3c')][_0xe586('0x38')]);}return db[_0xe586('0x1f')]['create'](_0x332c3f[_0xe586('0x3c')],{})[_0xe586('0x17')](respondWithResult(_0x1c172a,0xc9))['catch'](handleError(_0x1c172a,null));};exports[_0xe586('0x16')]=function(_0x5afe38,_0x3a8658){if(_0x5afe38[_0xe586('0x3c')]['id']){delete _0x5afe38['body']['id'];}return db[_0xe586('0x1f')][_0xe586('0x3a')]({'where':{'id':_0x5afe38[_0xe586('0x44')]['id']}})[_0xe586('0x17')](handleEntityNotFound(_0x3a8658,null))[_0xe586('0x17')](function(_0x4f8738){if(_0x4f8738['service']==='MicrosoftAzure'&&_0x5afe38[_0xe586('0x3c')][_0xe586('0x38')]){_0x5afe38[_0xe586('0x3c')][_0xe586('0x38')]=encryptor['encryptString'](_0x5afe38['body']['data3']);}return _0x4f8738;})['then'](saveUpdates(_0x5afe38['body'],null))[_0xe586('0x17')](respondWithResult(_0x3a8658,null))[_0xe586('0x39')](handleError(_0x3a8658,null));};exports[_0xe586('0x45')]=function(_0x137e0e,_0x1547bc){return db[_0xe586('0x1f')][_0xe586('0x3a')]({'where':{'id':_0x137e0e[_0xe586('0x44')]['id']}})[_0xe586('0x17')](handleEntityNotFound(_0x1547bc,null))[_0xe586('0x17')](removeEntity(_0x1547bc,null))[_0xe586('0x39')](handleError(_0x1547bc,null));};exports[_0xe586('0x46')]=function(_0xd9652e,_0x2740e8){return db[_0xe586('0x1f')]['findOne']({'where':{'id':_0xd9652e[_0xe586('0x44')]['id']},'raw':!![]})['then'](function(_0x563f91){if(!_0x563f91)return _0x2740e8[_0xe586('0xd')](0x194);return{'url':oauth[_0xe586('0x47')](_0x563f91,_0xd9652e[_0xe586('0x48')]['id'])};})[_0xe586('0x17')](respondWithResult(_0x2740e8,null))[_0xe586('0x39')](handleError(_0x2740e8,null));};exports[_0xe586('0x49')]=function(_0x189e2c,_0x2d0965){var _0x46a805=_0x189e2c[_0xe586('0x3c')];var _0x4c23ce;var _0x4c557f;if(_0x46a805['error'])throw _0x46a805;redis['get'](_0x46a805['state'])[_0xe586('0x17')](function(_0xa8bb7a){if(!_0xa8bb7a)throw new Error(_0xe586('0x4a'));_0x4c23ce=JSON[_0xe586('0x4b')](_0xa8bb7a);var _0x52ae30=Buffer['from'](_0x46a805[_0xe586('0x4c')],'base64')[_0xe586('0x4d')](_0xe586('0x4e'));_0x4c557f=JSON['parse'](_0x52ae30);if(!oauth[_0xe586('0x4f')](_0x46a805[_0xe586('0x50')],_0x4c23ce['oauth2Claims']))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xe586('0x51')](_0x46a805['state']);return oauth[_0xe586('0x52')](_0x46a805[_0xe586('0x53')],_0x4c23ce);})[_0xe586('0x17')](function(_0x2de782){_0x4c23ce[_0xe586('0x54')]=_0x2de782[_0xe586('0x55')];_0x4c23ce['data6']=_0x2de782[_0xe586('0x56')];return db[_0xe586('0x1f')][_0xe586('0x16')]({'data5':_0x4c23ce[_0xe586('0x54')],'data6':_0x4c23ce[_0xe586('0x57')]},{'where':{'id':_0x4c23ce['id']}});})[_0xe586('0x17')](function(){oauth[_0xe586('0x58')](_0x4c23ce);socket[_0xe586('0x59')](_0xe586('0x5a'),{'id':_0x4c557f['id']});return;})[_0xe586('0x17')](respondWithStatusCode(_0x2d0965,null))[_0xe586('0x39')](function(_0x49897e){if(_0x4c557f){socket[_0xe586('0x59')](_0xe586('0x5b'),{'id':_0x4c557f['id']});}if(!_0x4c23ce){logger[_0xe586('0x5c')](_0xe586('0x5d'),_0x49897e);return _0x2d0965[_0xe586('0xe')](0x1f4)[_0xe586('0x1a')](_0x49897e[_0xe586('0x5e')]);}logger['error'](_0xe586('0x5f'),_0x4c23ce['id'],JSON[_0xe586('0x60')](_0x49897e));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 7521094..a24e894 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 _0x784c=['../../config/environment','./cloudProvider.attributes','define','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x338891,_0x397a05){var _0x4410e5=function(_0x5469ea){while(--_0x5469ea){_0x338891['push'](_0x338891['shift']());}};_0x4410e5(++_0x397a05);}(_0x784c,0x1bb));var _0xc784=function(_0x53ebee,_0x4d7e07){_0x53ebee=_0x53ebee-0x0;var _0x149fe1=_0x784c[_0x53ebee];return _0x149fe1;};'use strict';var _=require(_0xc784('0x0'));var util=require(_0xc784('0x1'));var logger=require('../../config/logger')(_0xc784('0x2'));var moment=require(_0xc784('0x3'));var BPromise=require(_0xc784('0x4'));var rp=require(_0xc784('0x5'));var fs=require('fs');var path=require(_0xc784('0x6'));var rimraf=require(_0xc784('0x7'));var config=require(_0xc784('0x8'));var attributes=require(_0xc784('0x9'));module['exports']=function(_0x48fa7e,_0x3d6da2){return _0x48fa7e[_0xc784('0xa')]('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6ed=['CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define'];(function(_0x4e97df,_0x38deba){var _0x2f132e=function(_0x1fb46f){while(--_0x1fb46f){_0x4e97df['push'](_0x4e97df['shift']());}};_0x2f132e(++_0x38deba);}(_0xc6ed,0x161));var _0xdc6e=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc6ed[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0xdc6e('0x0'));var util=require(_0xdc6e('0x1'));var logger=require(_0xdc6e('0x2'))(_0xdc6e('0x3'));var moment=require('moment');var BPromise=require(_0xdc6e('0x4'));var rp=require(_0xdc6e('0x5'));var fs=require('fs');var path=require(_0xdc6e('0x6'));var rimraf=require('rimraf');var config=require(_0xdc6e('0x7'));var attributes=require(_0xdc6e('0x8'));module[_0xdc6e('0x9')]=function(_0x307def,_0x49ae37){return _0x307def[_0xdc6e('0xa')](_0xdc6e('0xb'),attributes,{'tableName':_0xdc6e('0xc'),'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 a33ecd9..1fae493 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 _0x9992=['findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','moment','request-promise','util','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/token','map','type','join','Outlook365','data7','/.default','replace','{TENANT_ID}','data2','code','id_token','from','toString','base64','client_id','response_type','response_mode','state','prompt','key','value','oauth2/','data1','stringify','decode','payload','issuer','aud','audience','nonce','isAfter','unix','exp','resolve','then','CloudProvider','findOne','refresh_token','data6','data4','decryptString','data3','access_token','update','data5','catch','error','authorization_code','POST','bind','intervals'];(function(_0xf74a9f,_0x483e3b){var _0x53b807=function(_0x6f8aec){while(--_0x6f8aec){_0xf74a9f['push'](_0xf74a9f['shift']());}};_0x53b807(++_0x483e3b);}(_0x9992,0x1c1));var _0x2999=function(_0x36909d,_0x2795f1){_0x36909d=_0x36909d-0x0;var _0x1fd29d=_0x9992[_0x36909d];return _0x1fd29d;};'use strict';var _=require(_0x2999('0x0'));var crypto=require(_0x2999('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x2999('0x2'));var Redis=require('ioredis');var rp=require(_0x2999('0x3'));var util=require(_0x2999('0x4'));var encryptor=require('../../components/encryptor');var config=require(_0x2999('0x5'));var logger=require(_0x2999('0x6'))(_0x2999('0x7'));var schedule=require(_0x2999('0x8'));var db=require(_0x2999('0x9'))['db'];config['redis']=_[_0x2999('0xa')](config[_0x2999('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x2999('0xb')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x2999('0xc'),'email',_0x2999('0xd'),_0x2999('0xe'),'https://outlook.office.com/POP.AccessAsUser.All',_0x2999('0xf')],'Dynamics365':[_0x2999('0x10'),_0x2999('0xd')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x2999('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3b0b20){var _0x1c4829=_[_0x2999('0x12')](AZURE_AUTH_SCOPES[_0x3b0b20['type']]);if(_0x3b0b20[_0x2999('0x13')]==='Dynamics365')_0x1c4829['push'](_0x3b0b20['data7']+'/.default');return _0x1c4829[_0x2999('0x14')]('\x20');}function getAccessTokenScope(_0x25d7d4){if(_0x25d7d4[_0x2999('0x13')]===_0x2999('0x15'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x25d7d4[_0x2999('0x13')]==='Dynamics365')return _0x25d7d4[_0x2999('0x16')]+_0x2999('0x17');}function generateMicrosoftAuthorizationUrl(_0x13846a,_0x4970c9){var _0x3845c1=MICROSOFT_AUTH_URL[_0x2999('0x18')](_0x2999('0x19'),_0x13846a[_0x2999('0x1a')]);var _0x22f9c1=[_0x2999('0x1b'),_0x2999('0x1c')];var _0x5d1059=Buffer[_0x2999('0x1d')](JSON['stringify']({'id':_0x4970c9}))[_0x2999('0x1e')](_0x2999('0x1f'));var _0x43917b=crypto['randomBytes'](0x10)[_0x2999('0x1e')]('hex');var _0x51f2c2=getAuthorizationScopes(_0x13846a);var _0x2b1214=[{'key':_0x2999('0x20'),'value':_0x13846a['data1']},{'key':_0x2999('0x21'),'value':encodeURIComponent(_0x22f9c1[_0x2999('0x14')]('\x20'))},{'key':'redirect_uri','value':_0x13846a['data4']},{'key':_0x2999('0x22'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x51f2c2)},{'key':_0x2999('0x23'),'value':_0x5d1059},{'key':'nonce','value':_0x43917b},{'key':_0x2999('0x24'),'value':'login'}];var _0xfc1fe8=_0x3845c1+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x2b1214,function(_0x54733a){return _0x54733a[_0x2999('0x25')]+'='+_0x54733a[_0x2999('0x26')];})[_0x2999('0x14')]('&');_0x13846a['oauth2Claims']={'issuer':_0x3845c1[_0x2999('0x18')](_0x2999('0x27'),''),'audience':_0x13846a[_0x2999('0x28')],'state':_0x5d1059,'nonce':_0x43917b};redis['set'](_0x5d1059,JSON[_0x2999('0x29')](_0x13846a));return _0xfc1fe8;}function isValidIdToken(_0x361d54,_0x476040){try{var _0x249fbd=jwt[_0x2999('0x2a')](_0x361d54,{'complete':!![]});var _0x50a7bc=_0x249fbd[_0x2999('0x2b')];if(_0x50a7bc['iss']!==_0x476040[_0x2999('0x2c')])return![];if(_0x50a7bc[_0x2999('0x2d')]!==_0x476040[_0x2999('0x2e')])return![];if(_0x50a7bc['nonce']!==_0x476040[_0x2999('0x2f')])return![];if(moment()[_0x2999('0x30')](moment[_0x2999('0x31')](_0x50a7bc[_0x2999('0x32')])))return![];return!![];}catch(_0x5d8437){throw _0x5d8437;}}function refreshOauth2MicrosoftAccessToken(_0x5da605){return Promise[_0x2999('0x33')]()[_0x2999('0x34')](function(){if(_0x5da605['data3'])return _0x5da605;return db[_0x2999('0x35')][_0x2999('0x36')]({'where':{'id':_0x5da605['id']},'raw':!![]});})['then'](function(_0x1c1acd){var _0x55fcd8={'grant_type':_0x2999('0x37'),'refresh_token':_0x1c1acd[_0x2999('0x38')],'scope':getAccessTokenScope(_0x1c1acd),'redirect_uri':_0x1c1acd[_0x2999('0x39')],'client_id':_0x1c1acd[_0x2999('0x28')],'client_secret':encryptor[_0x2999('0x3a')](_0x1c1acd[_0x2999('0x3b')])};var _0x2e5902={'method':'POST','uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x1c1acd['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x55fcd8,'json':!![]};return rp(_0x2e5902);})[_0x2999('0x34')](function(_0x31d4a7){_0x5da605['data5']=_0x31d4a7[_0x2999('0x3c')];_0x5da605['data6']=_0x31d4a7['refresh_token'];return db[_0x2999('0x35')][_0x2999('0x3d')]({'data5':_0x5da605[_0x2999('0x3e')],'data6':_0x5da605[_0x2999('0x38')]},{'where':{'id':_0x5da605['id']}});})[_0x2999('0x34')](function(){return _0x5da605;})[_0x2999('0x3f')](function(_0x31ce9d){logger[_0x2999('0x40')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x5da605['id'],_0x31ce9d);});}function getOauth2MicrosoftAccessToken(_0x367183,_0x10439a){var _0x4656a5={'grant_type':_0x2999('0x41'),'code':_0x367183,'scope':getAccessTokenScope(_0x10439a),'redirect_uri':_0x10439a[_0x2999('0x39')],'client_id':_0x10439a[_0x2999('0x28')],'client_secret':encryptor['decryptString'](_0x10439a[_0x2999('0x3b')])};var _0x57fa32={'method':_0x2999('0x42'),'uri':MICROSOFT_AUTH_URL[_0x2999('0x18')](_0x2999('0x19'),_0x10439a[_0x2999('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4656a5,'json':!![]};return rp(_0x57fa32);}function startRefreshInterval(_0x7222ec){var _0x1198e8=schedule['intervals'];if(_0x1198e8[_0x7222ec['id']])clearInterval(_0x1198e8[_0x7222ec['id']]);_0x1198e8[_0x7222ec['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x2999('0x43')](this,{'id':_0x7222ec['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x2999('0x44')]=_0x1198e8;}function startAllRefreshIntervals(){return db[_0x2999('0x35')][_0x2999('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x4983b7){var _0x575a08=_0x4983b7[_0x2999('0x12')](function(_0x31d555){return refreshOauth2MicrosoftAccessToken(_0x31d555)[_0x2999('0x34')](function(_0x275250){startRefreshInterval(_0x275250);});});return Promise[_0x2999('0x46')](_0x575a08);})[_0x2999('0x3f')](function(_0x3169b8){var _0x362374=_0x3169b8?util[_0x2999('0x47')](_0x3169b8,{'showHidden':![],'depth':null}):'';logger[_0x2999('0x40')](_0x2999('0x48'),_0x362374);});}module[_0x2999('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x1542=['../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','push','data7','/.default','Outlook365','Dynamics365','data2','code','id_token','from','stringify','base64','randomBytes','toString','data1','join','redirect_uri','data4','response_mode','form_post','scope','nonce','prompt','login','key','value','oauth2Claims','oauth2/','decode','payload','iss','issuer','aud','isAfter','unix','then','data3','findOne','refresh_token','data6','decryptString','POST','{TENANT_ID}','data5','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','replace','intervals','bind','map','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','ioredis','request-promise','util','../../components/encryptor'];(function(_0x49ec8d,_0x4804a9){var _0x1d6db3=function(_0x18b3a5){while(--_0x18b3a5){_0x49ec8d['push'](_0x49ec8d['shift']());}};_0x1d6db3(++_0x4804a9);}(_0x1542,0x92));var _0x2154=function(_0x3feb60,_0x2f532d){_0x3feb60=_0x3feb60-0x0;var _0x5d69b9=_0x1542[_0x3feb60];return _0x5d69b9;};'use strict';var _=require(_0x2154('0x0'));var crypto=require(_0x2154('0x1'));var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require(_0x2154('0x2'));var rp=require(_0x2154('0x3'));var util=require(_0x2154('0x4'));var encryptor=require(_0x2154('0x5'));var config=require(_0x2154('0x6'));var logger=require(_0x2154('0x7'))(_0x2154('0x8'));var schedule=require(_0x2154('0x9'));var db=require(_0x2154('0xa'))['db'];config[_0x2154('0xb')]=_['defaults'](config[_0x2154('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x2154('0xb')]);var MICROSOFT_AUTH_URL=_0x2154('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x2154('0xd'),'profile','email',_0x2154('0xe'),_0x2154('0xf'),'https://outlook.office.com/POP.AccessAsUser.All',_0x2154('0x10')],'Dynamics365':['openid',_0x2154('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0x2154('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0x2154('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x27e050){var _0x45e802=_['map'](AZURE_AUTH_SCOPES[_0x27e050[_0x2154('0x13')]]);if(_0x27e050[_0x2154('0x13')]==='Dynamics365')_0x45e802[_0x2154('0x14')](_0x27e050[_0x2154('0x15')]+_0x2154('0x16'));return _0x45e802['join']('\x20');}function getAccessTokenScope(_0x47f4d2){if(_0x47f4d2['type']===_0x2154('0x17'))return _0x2154('0xf');if(_0x47f4d2[_0x2154('0x13')]===_0x2154('0x18'))return _0x47f4d2[_0x2154('0x15')]+_0x2154('0x16');}function generateMicrosoftAuthorizationUrl(_0x3123b2,_0xe19dc8){var _0x3eea36=MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x3123b2[_0x2154('0x19')]);var _0x795a94=[_0x2154('0x1a'),_0x2154('0x1b')];var _0x20a04b=Buffer[_0x2154('0x1c')](JSON[_0x2154('0x1d')]({'id':_0xe19dc8}))['toString'](_0x2154('0x1e'));var _0x141ba0=crypto[_0x2154('0x1f')](0x10)[_0x2154('0x20')]('hex');var _0x58d16a=getAuthorizationScopes(_0x3123b2);var _0x3dee0a=[{'key':'client_id','value':_0x3123b2[_0x2154('0x21')]},{'key':'response_type','value':encodeURIComponent(_0x795a94[_0x2154('0x22')]('\x20'))},{'key':_0x2154('0x23'),'value':_0x3123b2[_0x2154('0x24')]},{'key':_0x2154('0x25'),'value':_0x2154('0x26')},{'key':_0x2154('0x27'),'value':encodeURIComponent(_0x58d16a)},{'key':'state','value':_0x20a04b},{'key':_0x2154('0x28'),'value':_0x141ba0},{'key':_0x2154('0x29'),'value':_0x2154('0x2a')}];var _0xf367b5=_0x3eea36+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x3dee0a,function(_0x5ba770){return _0x5ba770[_0x2154('0x2b')]+'='+_0x5ba770[_0x2154('0x2c')];})['join']('&');_0x3123b2[_0x2154('0x2d')]={'issuer':_0x3eea36['replace'](_0x2154('0x2e'),''),'audience':_0x3123b2[_0x2154('0x21')],'state':_0x20a04b,'nonce':_0x141ba0};redis['set'](_0x20a04b,JSON[_0x2154('0x1d')](_0x3123b2));return _0xf367b5;}function isValidIdToken(_0x3eae87,_0x356500){try{var _0x2c5f5b=jwt[_0x2154('0x2f')](_0x3eae87,{'complete':!![]});var _0x451a72=_0x2c5f5b[_0x2154('0x30')];if(_0x451a72[_0x2154('0x31')]!==_0x356500[_0x2154('0x32')])return![];if(_0x451a72[_0x2154('0x33')]!==_0x356500['audience'])return![];if(_0x451a72[_0x2154('0x28')]!==_0x356500['nonce'])return![];if(moment()[_0x2154('0x34')](moment[_0x2154('0x35')](_0x451a72['exp'])))return![];return!![];}catch(_0x32b66a){throw _0x32b66a;}}function refreshOauth2MicrosoftAccessToken(_0x213f24){return Promise['resolve']()[_0x2154('0x36')](function(){if(_0x213f24[_0x2154('0x37')])return _0x213f24;return db['CloudProvider'][_0x2154('0x38')]({'where':{'id':_0x213f24['id']},'raw':!![]});})['then'](function(_0x2c8d37){var _0x17e4bd={'grant_type':_0x2154('0x39'),'refresh_token':_0x2c8d37[_0x2154('0x3a')],'scope':getAccessTokenScope(_0x2c8d37),'redirect_uri':_0x2c8d37[_0x2154('0x24')],'client_id':_0x2c8d37[_0x2154('0x21')],'client_secret':encryptor[_0x2154('0x3b')](_0x2c8d37[_0x2154('0x37')])};var _0x358cb5={'method':_0x2154('0x3c'),'uri':MICROSOFT_AUTH_URL['replace'](_0x2154('0x3d'),_0x2c8d37[_0x2154('0x19')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x17e4bd,'json':!![]};return rp(_0x358cb5);})[_0x2154('0x36')](function(_0x7ecb24){_0x213f24[_0x2154('0x3e')]=_0x7ecb24[_0x2154('0x3f')];_0x213f24['data6']=_0x7ecb24[_0x2154('0x39')];return db['CloudProvider'][_0x2154('0x40')]({'data5':_0x213f24['data5'],'data6':_0x213f24[_0x2154('0x3a')]},{'where':{'id':_0x213f24['id']}});})[_0x2154('0x36')](function(){return _0x213f24;})[_0x2154('0x41')](function(_0x446cdc){logger['error'](_0x2154('0x42'),_0x213f24['id'],_0x446cdc);});}function getOauth2MicrosoftAccessToken(_0x422bd8,_0x4ae370){var _0x227c26={'grant_type':'authorization_code','code':_0x422bd8,'scope':getAccessTokenScope(_0x4ae370),'redirect_uri':_0x4ae370[_0x2154('0x24')],'client_id':_0x4ae370[_0x2154('0x21')],'client_secret':encryptor['decryptString'](_0x4ae370['data3'])};var _0x1a9a7d={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x2154('0x43')](_0x2154('0x3d'),_0x4ae370[_0x2154('0x19')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x227c26,'json':!![]};return rp(_0x1a9a7d);}function startRefreshInterval(_0x188c45){var _0x21a661=schedule[_0x2154('0x44')];if(_0x21a661[_0x188c45['id']])clearInterval(_0x21a661[_0x188c45['id']]);_0x21a661[_0x188c45['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x2154('0x45')](this,{'id':_0x188c45['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x21a661;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x2154('0x36')](function(_0x198bb1){var _0x2f8ee1=_0x198bb1[_0x2154('0x46')](function(_0x28bf8b){return refreshOauth2MicrosoftAccessToken(_0x28bf8b)['then'](function(_0x4439cb){startRefreshInterval(_0x4439cb);});});return Promise[_0x2154('0x47')](_0x2f8ee1);})[_0x2154('0x41')](function(_0x21f5a4){var _0x1b943e=_0x21f5a4?util[_0x2154('0x48')](_0x21f5a4,{'showHidden':![],'depth':null}):'';logger[_0x2154('0x49')](_0x2154('0x4a'),_0x1b943e);});}module[_0x2154('0x4b')]={'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 61fe1e5..5398f82 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 _0xbca0=['stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xd3b0ac,_0x2f5065){var _0x3d773e=function(_0x2e10d1){while(--_0x2e10d1){_0xd3b0ac['push'](_0xd3b0ac['shift']());}};_0x3d773e(++_0x2f5065);}(_0xbca0,0x8b));var _0x0bca=function(_0x406a19,_0xb75dd7){_0x406a19=_0x406a19-0x0;var _0x254870=_0xbca0[_0x406a19];return _0x254870;};'use strict';var _=require(_0x0bca('0x0'));var util=require(_0x0bca('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0bca('0x2'));var db=require(_0x0bca('0x3'))['db'];var utils=require(_0x0bca('0x4'));var logger=require(_0x0bca('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0bca('0x6'));var client=jayson[_0x0bca('0x7')][_0x0bca('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x454627,_0x4dcba6,_0x48260c){return new BPromise(function(_0x55fbf0,_0x241ca5){return client[_0x0bca('0x9')](_0x454627,_0x48260c)[_0x0bca('0xa')](function(_0x206194){logger[_0x0bca('0xb')]('CloudProvider,\x20%s,\x20%s',_0x4dcba6,'request\x20sent');logger[_0x0bca('0xc')](_0x0bca('0xd'),_0x4dcba6,_0x0bca('0xe'),JSON[_0x0bca('0xf')](_0x206194));if(_0x206194[_0x0bca('0x10')]){if(_0x206194[_0x0bca('0x10')][_0x0bca('0x11')]===0x1f4){logger[_0x0bca('0x10')](_0x0bca('0x12'),_0x4dcba6,_0x206194[_0x0bca('0x10')][_0x0bca('0x13')]);return _0x241ca5(_0x206194[_0x0bca('0x10')][_0x0bca('0x13')]);}logger[_0x0bca('0x10')](_0x0bca('0x12'),_0x4dcba6,_0x206194[_0x0bca('0x10')][_0x0bca('0x13')]);return _0x55fbf0(_0x206194[_0x0bca('0x10')][_0x0bca('0x13')]);}else{logger['info'](_0x0bca('0x12'),_0x4dcba6,_0x0bca('0xe'));_0x55fbf0(_0x206194[_0x0bca('0x14')][_0x0bca('0x13')]);}})[_0x0bca('0x15')](function(_0x2ed970){logger[_0x0bca('0x10')]('CloudProvider,\x20%s,\x20%s',_0x4dcba6,_0x2ed970);_0x241ca5(_0x2ed970);});});} \ No newline at end of file +var _0xe056=['code','message','info','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x428d9a,_0x4e724d){var _0x50da90=function(_0x283946){while(--_0x283946){_0x428d9a['push'](_0x428d9a['shift']());}};_0x50da90(++_0x4e724d);}(_0xe056,0xdb));var _0x6e05=function(_0x555069,_0x23d66a){_0x555069=_0x555069-0x0;var _0x100af7=_0xe056[_0x555069];return _0x100af7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6e05('0x0'));var BPromise=require(_0x6e05('0x1'));var rs=require(_0x6e05('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6e05('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e05('0x4'))(_0x6e05('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6e05('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x390bb6,_0x1c78eb,_0x5dacb2){return new BPromise(function(_0x1a54b7,_0x177b2c){return client[_0x6e05('0x7')](_0x390bb6,_0x5dacb2)[_0x6e05('0x8')](function(_0x13af56){logger['info'](_0x6e05('0x9'),_0x1c78eb,_0x6e05('0xa'));logger[_0x6e05('0xb')](_0x6e05('0xc'),_0x1c78eb,_0x6e05('0xa'),JSON[_0x6e05('0xd')](_0x13af56));if(_0x13af56['error']){if(_0x13af56[_0x6e05('0xe')][_0x6e05('0xf')]===0x1f4){logger[_0x6e05('0xe')]('CloudProvider,\x20%s,\x20%s',_0x1c78eb,_0x13af56[_0x6e05('0xe')][_0x6e05('0x10')]);return _0x177b2c(_0x13af56[_0x6e05('0xe')][_0x6e05('0x10')]);}logger[_0x6e05('0xe')]('CloudProvider,\x20%s,\x20%s',_0x1c78eb,_0x13af56[_0x6e05('0xe')][_0x6e05('0x10')]);return _0x1a54b7(_0x13af56['error']['message']);}else{logger[_0x6e05('0x11')](_0x6e05('0x9'),_0x1c78eb,_0x6e05('0xa'));_0x1a54b7(_0x13af56['result'][_0x6e05('0x10')]);}})['catch'](function(_0x3c3ef0){logger[_0x6e05('0xe')]('CloudProvider,\x20%s,\x20%s',_0x1c78eb,_0x3c3ef0);_0x177b2c(_0x3c3ef0);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 5d5f5e4..deb08f4 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 _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(_0x3831dd,_0x47a03b){var _0x20f1f3=function(_0x1103fa){while(--_0x1103fa){_0x3831dd['push'](_0x3831dd['shift']());}};_0x20f1f3(++_0x47a03b);}(_0x2ef3,0xba));var _0x32ef=function(_0x5d31d7,_0x257edd){_0x5d31d7=_0x5d31d7-0x0;var _0x25eecc=_0x2ef3[_0x5d31d7];return _0x25eecc;};'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 +var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0x1261,0x144));var _0x1126=function(_0x2703cf,_0x526b31){_0x2703cf=_0x2703cf-0x0;var _0x28f18a=_0x1261[_0x2703cf];return _0x28f18a;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 851c767..3d5c217 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 _0x1e9c=['name','STRING','sequelize'];(function(_0x257d79,_0x2861ec){var _0x349ebc=function(_0x8e9bb3){while(--_0x8e9bb3){_0x257d79['push'](_0x257d79['shift']());}};_0x349ebc(++_0x2861ec);}(_0x1e9c,0xec));var _0xc1e9=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x1e9c[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require(_0xc1e9('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xc1e9('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc1e9('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xc1e9('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xc1e9('0x2')]},'type':{'type':Sequelize[_0xc1e9('0x2')]},'street':{'type':Sequelize[_0xc1e9('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xc1e9('0x2')]},'country':{'type':Sequelize[_0xc1e9('0x2')]},'email':{'type':Sequelize[_0xc1e9('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xc1e9('0x2')]},'sStreet':{'type':Sequelize[_0xc1e9('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xc1e9('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7b51=['name','sequelize','exports','STRING'];(function(_0x59c556,_0x3e3be8){var _0x53079b=function(_0x1e1fd3){while(--_0x1e1fd3){_0x59c556['push'](_0x59c556['shift']());}};_0x53079b(++_0x3e3be8);}(_0x7b51,0x1bd));var _0x17b5=function(_0x345e4c,_0x3e73ba){_0x345e4c=_0x345e4c-0x0;var _0x40c41c=_0x7b51[_0x345e4c];return _0x40c41c;};'use strict';var Sequelize=require(_0x17b5('0x0'));module[_0x17b5('0x1')]={'name':{'type':Sequelize[_0x17b5('0x2')],'unique':_0x17b5('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x17b5('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x17b5('0x2')]},'fax':{'type':Sequelize[_0x17b5('0x2')]},'type':{'type':Sequelize[_0x17b5('0x2')]},'street':{'type':Sequelize[_0x17b5('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x17b5('0x2')]},'country':{'type':Sequelize[_0x17b5('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index dfff5b4..0391fd1 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 _0x354e=['name','send','index','CmCompany','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','filter','includeAll','findAll','catch','params','rawAttributes','include','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addContacts','ids','omit','getContacts','CmContact','map','rimraf','zip-dir','request-promise','mustache','util','sox','ejs','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','sendStatus','error','stack'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x354e,0x80));var _0xe354=function(_0x3afa20,_0x555693){_0x3afa20=_0x3afa20-0x0;var _0x2b7f2c=_0x354e[_0x3afa20];return _0x2b7f2c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe354('0x0'));var zipdir=require(_0xe354('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe354('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe354('0x3'));var util=require(_0xe354('0x4'));var path=require('path');var sox=require(_0xe354('0x5'));var csv=require('to-csv');var ejs=require(_0xe354('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe354('0x7'));var crypto=require(_0xe354('0x8'));var jsforce=require(_0xe354('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xe354('0xa'));var querystring=require(_0xe354('0xb'));var Papa=require('papaparse');var Redis=require(_0xe354('0xc'));var authService=require(_0xe354('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xe354('0xe'));var hardwareService=require(_0xe354('0xf'));var logger=require('../../config/logger')(_0xe354('0x10'));var utils=require('../../config/utils');var config=require(_0xe354('0x11'));var licenseUtil=require(_0xe354('0x12'));var db=require(_0xe354('0x13'))['db'];function respondWithStatusCode(_0x24bec2,_0x2ec843){_0x2ec843=_0x2ec843||0xcc;return function(_0xcb9ff){if(_0xcb9ff){return _0x24bec2['sendStatus'](_0x2ec843);}return _0x24bec2['status'](_0x2ec843)[_0xe354('0x14')]();};}function respondWithResult(_0x3359bd,_0x1c0787){_0x1c0787=_0x1c0787||0xc8;return function(_0x514f44){if(_0x514f44){return _0x3359bd[_0xe354('0x15')](_0x1c0787)[_0xe354('0x16')](_0x514f44);}};}function respondWithFilteredResult(_0x325c3c,_0x2ac4f4){return function(_0x1a6356){if(_0x1a6356){var _0x3cadac=typeof _0x2ac4f4[_0xe354('0x17')]==='undefined'&&typeof _0x2ac4f4[_0xe354('0x18')]===_0xe354('0x19');var _0x4ebab9=_0x1a6356[_0xe354('0x1a')];var _0x58f5ac=_0x3cadac?0x0:_0x2ac4f4[_0xe354('0x17')];var _0x1bb833=_0x3cadac?_0x1a6356[_0xe354('0x1a')]:_0x2ac4f4[_0xe354('0x17')]+_0x2ac4f4[_0xe354('0x18')];var _0x1abf71;if(_0x1bb833>=_0x4ebab9){_0x1bb833=_0x4ebab9;_0x1abf71=0xc8;}else{_0x1abf71=0xce;}_0x325c3c['status'](_0x1abf71);return _0x325c3c[_0xe354('0x1b')](_0xe354('0x1c'),_0x58f5ac+'-'+_0x1bb833+'/'+_0x4ebab9)[_0xe354('0x16')](_0x1a6356);}return null;};}function patchUpdates(_0xda949c){return function(_0x188433){try{jsonpatch[_0xe354('0x1d')](_0x188433,_0xda949c,!![]);}catch(_0x13aef3){return BPromise[_0xe354('0x1e')](_0x13aef3);}return _0x188433[_0xe354('0x1f')]();};}function saveUpdates(_0x52d5e9,_0x2165b){return function(_0x302b0d){if(_0x302b0d){return _0x302b0d[_0xe354('0x20')](_0x52d5e9)[_0xe354('0x21')](function(_0xeaf344){return _0xeaf344;});}return null;};}function removeEntity(_0x2cff81,_0x5eb3b5){return function(_0x6549e1){if(_0x6549e1){return _0x6549e1['destroy']()[_0xe354('0x21')](function(){var _0x390574=_0x6549e1[_0xe354('0x22')]({'plain':!![]});var _0x577104='Companies';return db[_0xe354('0x23')][_0xe354('0x24')]({'where':{'type':_0x577104,'resourceId':_0x390574['id']}})[_0xe354('0x21')](function(){return _0x6549e1;});})[_0xe354('0x21')](function(){_0x2cff81[_0xe354('0x15')](0xcc)[_0xe354('0x14')]();});}};}function handleEntityNotFound(_0x4b3c85,_0x415328){return function(_0x5cbebb){if(!_0x5cbebb){_0x4b3c85[_0xe354('0x25')](0x194);}return _0x5cbebb;};}function handleError(_0x13da12,_0x3fb164){_0x3fb164=_0x3fb164||0x1f4;return function(_0x3daf3b){logger[_0xe354('0x26')](_0x3daf3b[_0xe354('0x27')]);if(_0x3daf3b[_0xe354('0x28')]){delete _0x3daf3b[_0xe354('0x28')];}_0x13da12['status'](_0x3fb164)[_0xe354('0x29')](_0x3daf3b);};}exports[_0xe354('0x2a')]=function(_0xa75263,_0x331220){var _0x34824a={},_0x18dba8={},_0x2eb53d={'count':0x0,'rows':[]};return db[_0xe354('0x2b')]['describe']()[_0xe354('0x21')](function(_0x58ba67){_0x18dba8[_0xe354('0x2c')]=_[_0xe354('0x2d')](_0x58ba67);_0x18dba8[_0xe354('0x2e')]=_[_0xe354('0x2d')](_0xa75263['query']);_0x18dba8['filters']=_['intersection'](_0x18dba8[_0xe354('0x2c')],_0x18dba8[_0xe354('0x2e')]);_0x34824a[_0xe354('0x2f')]=_[_0xe354('0x30')](_0x18dba8[_0xe354('0x2c')],qs[_0xe354('0x31')](_0xa75263[_0xe354('0x2e')][_0xe354('0x31')]));_0x34824a['attributes']=_0x34824a[_0xe354('0x2f')][_0xe354('0x32')]?_0x34824a[_0xe354('0x2f')]:_0x18dba8[_0xe354('0x2c')];if(!_0xa75263[_0xe354('0x2e')][_0xe354('0x33')](_0xe354('0x34'))){_0x34824a[_0xe354('0x18')]=qs[_0xe354('0x18')](_0xa75263['query']['limit']);_0x34824a[_0xe354('0x17')]=qs[_0xe354('0x17')](_0xa75263[_0xe354('0x2e')][_0xe354('0x17')]);}_0x34824a[_0xe354('0x35')]=qs[_0xe354('0x36')](_0xa75263[_0xe354('0x2e')][_0xe354('0x36')]);_0x34824a['where']=qs[_0xe354('0x37')](_[_0xe354('0x38')](_0xa75263[_0xe354('0x2e')],_0x18dba8[_0xe354('0x37')]),_0x58ba67);if(_0xa75263['query']['filter']){_0x34824a['where']=_[_0xe354('0x39')](_0x34824a[_0xe354('0x3a')],{'$or':_['map'](_0x34824a['attributes'],function(_0x34f237){var _0x86b963={};_0x86b963[_0x34f237]={'$like':'%'+_0xa75263[_0xe354('0x2e')][_0xe354('0x3b')]+'%'};return _0x86b963;})});}_0x34824a=_[_0xe354('0x39')]({},_0x34824a,_0xa75263['options']);var _0x2e261a={'where':_0x34824a[_0xe354('0x3a')]};return db['CmCompany'][_0xe354('0x1a')](_0x2e261a)[_0xe354('0x21')](function(_0x5da392){_0x2eb53d[_0xe354('0x1a')]=_0x5da392;if(_0xa75263[_0xe354('0x2e')][_0xe354('0x3c')]){_0x34824a['include']=[{'all':!![]}];}return db[_0xe354('0x2b')][_0xe354('0x3d')](_0x34824a);})[_0xe354('0x21')](function(_0x262fb4){_0x2eb53d['rows']=_0x262fb4;return _0x2eb53d;})['then'](respondWithFilteredResult(_0x331220,_0x34824a))[_0xe354('0x3e')](handleError(_0x331220,null));})[_0xe354('0x3e')](handleError(_0x331220,null));};exports['show']=function(_0x3b91dc,_0x517f60){var _0x24f2f3={'raw':![],'where':{'id':_0x3b91dc[_0xe354('0x3f')]['id']}},_0xc91818={};_0xc91818[_0xe354('0x2c')]=_['keys'](db[_0xe354('0x2b')][_0xe354('0x40')]);_0xc91818[_0xe354('0x2e')]=_[_0xe354('0x2d')](_0x3b91dc['query']);_0xc91818[_0xe354('0x37')]=_[_0xe354('0x30')](_0xc91818[_0xe354('0x2c')],_0xc91818[_0xe354('0x2e')]);_0x24f2f3[_0xe354('0x2f')]=_['intersection'](_0xc91818[_0xe354('0x2c')],qs[_0xe354('0x31')](_0x3b91dc[_0xe354('0x2e')][_0xe354('0x31')]));_0x24f2f3[_0xe354('0x2f')]=_0x24f2f3['attributes'][_0xe354('0x32')]?_0x24f2f3['attributes']:_0xc91818[_0xe354('0x2c')];if(_0x3b91dc['query']['includeAll']){_0x24f2f3[_0xe354('0x41')]=[{'all':!![]}];}_0x24f2f3=_[_0xe354('0x39')]({},_0x24f2f3,_0x3b91dc[_0xe354('0x42')]);return db[_0xe354('0x2b')]['find'](_0x24f2f3)[_0xe354('0x21')](handleEntityNotFound(_0x517f60,null))['then'](respondWithResult(_0x517f60,null))[_0xe354('0x3e')](handleError(_0x517f60,null));};exports[_0xe354('0x43')]=function(_0x436d61,_0x1203a8){return db['CmCompany'][_0xe354('0x43')](_0x436d61[_0xe354('0x44')],{})['then'](function(_0x32cc51){var _0x42a584=_0x436d61[_0xe354('0x45')][_0xe354('0x22')]({'plain':!![]});if(!_0x42a584)throw new Error(_0xe354('0x46'));if(_0x42a584['role']===_0xe354('0x45')){var _0x2cde27=_0x32cc51[_0xe354('0x22')]({'plain':!![]});var _0xc105ac=_0xe354('0x47');return db[_0xe354('0x48')]['find']({'where':{'name':_0xc105ac,'userProfileId':_0x42a584[_0xe354('0x49')]},'raw':!![]})[_0xe354('0x21')](function(_0x4625db){if(_0x4625db&&_0x4625db[_0xe354('0x4a')]===0x0){return db[_0xe354('0x23')]['create']({'name':_0x2cde27[_0xe354('0x28')],'resourceId':_0x2cde27['id'],'type':_0x4625db[_0xe354('0x28')],'sectionId':_0x4625db['id']},{})['then'](function(){return _0x32cc51;});}else{return _0x32cc51;}})[_0xe354('0x3e')](function(_0x21f8d2){logger[_0xe354('0x26')](_0xe354('0x4b'),_0x21f8d2);throw _0x21f8d2;});}return _0x32cc51;})['then'](respondWithResult(_0x1203a8,0xc9))[_0xe354('0x3e')](handleError(_0x1203a8,null));};exports[_0xe354('0x20')]=function(_0x26c18b,_0x1efe9c){if(_0x26c18b[_0xe354('0x44')]['id']){delete _0x26c18b['body']['id'];}return db[_0xe354('0x2b')][_0xe354('0x4c')]({'where':{'id':_0x26c18b['params']['id']}})[_0xe354('0x21')](handleEntityNotFound(_0x1efe9c,null))[_0xe354('0x21')](saveUpdates(_0x26c18b[_0xe354('0x44')],null))[_0xe354('0x21')](respondWithResult(_0x1efe9c,null))[_0xe354('0x3e')](handleError(_0x1efe9c,null));};exports[_0xe354('0x24')]=function(_0x1df35c,_0x67664){return db[_0xe354('0x2b')]['find']({'where':{'id':_0x1df35c[_0xe354('0x3f')]['id']}})[_0xe354('0x21')](handleEntityNotFound(_0x67664,null))[_0xe354('0x21')](removeEntity(_0x67664,null))[_0xe354('0x3e')](handleError(_0x67664,null));};exports[_0xe354('0x4d')]=function(_0x3c09d6,_0x806cd0){return db[_0xe354('0x2b')][_0xe354('0x4d')]()[_0xe354('0x21')](respondWithResult(_0x806cd0,null))[_0xe354('0x3e')](handleError(_0x806cd0,null));};exports[_0xe354('0x4e')]=function(_0xa75fb5,_0x5374fa,_0x4fa0ba){return db['CmContact'][_0xe354('0x4c')]({'where':{'id':_0xa75fb5[_0xe354('0x3f')]['id']}})[_0xe354('0x21')](handleEntityNotFound(_0x5374fa,null))[_0xe354('0x21')](function(_0x27271c){if(_0x27271c){return _0x27271c[_0xe354('0x4e')](_0xa75fb5[_0xe354('0x44')][_0xe354('0x4f')],_[_0xe354('0x50')](_0xa75fb5[_0xe354('0x44')],[_0xe354('0x4f'),'id'])||{});}})[_0xe354('0x21')](respondWithResult(_0x5374fa,null))[_0xe354('0x3e')](handleError(_0x5374fa,null));};exports[_0xe354('0x51')]=function(_0x2a47f3,_0xf93e45,_0x45055d){var _0x4d87a0={};var _0x3083b5={};var _0x48f690;var _0x2f2783;return db[_0xe354('0x2b')]['findOne']({'where':{'id':_0x2a47f3[_0xe354('0x3f')]['id']}})[_0xe354('0x21')](handleEntityNotFound(_0xf93e45,null))[_0xe354('0x21')](function(_0x1cf2fa){if(_0x1cf2fa){_0x48f690=_0x1cf2fa;_0x3083b5[_0xe354('0x2c')]=_[_0xe354('0x2d')](db[_0xe354('0x52')][_0xe354('0x40')]);_0x3083b5[_0xe354('0x2e')]=_[_0xe354('0x2d')](_0x2a47f3[_0xe354('0x2e')]);_0x3083b5['filters']=_['intersection'](_0x3083b5[_0xe354('0x2c')],_0x3083b5[_0xe354('0x2e')]);_0x4d87a0[_0xe354('0x2f')]=_[_0xe354('0x30')](_0x3083b5[_0xe354('0x2c')],qs['fields'](_0x2a47f3['query'][_0xe354('0x31')]));_0x4d87a0['attributes']=_0x4d87a0[_0xe354('0x2f')]['length']?_0x4d87a0[_0xe354('0x2f')]:_0x3083b5['model'];_0x4d87a0[_0xe354('0x35')]=qs['sort'](_0x2a47f3[_0xe354('0x2e')]['sort']);_0x4d87a0[_0xe354('0x3a')]=qs[_0xe354('0x37')](_[_0xe354('0x38')](_0x2a47f3['query'],_0x3083b5['filters']));if(_0x2a47f3['query'][_0xe354('0x3b')]){_0x4d87a0[_0xe354('0x3a')]=_[_0xe354('0x39')](_0x4d87a0[_0xe354('0x3a')],{'$or':_[_0xe354('0x53')](_0x4d87a0[_0xe354('0x2f')],function(_0x282379){var _0x38253a={};_0x38253a[_0x282379]={'$like':'%'+_0x2a47f3[_0xe354('0x2e')][_0xe354('0x3b')]+'%'};return _0x38253a;})});}_0x4d87a0=_[_0xe354('0x39')]({},_0x4d87a0,_0x2a47f3[_0xe354('0x42')]);return _0x48f690[_0xe354('0x51')](_0x4d87a0);}})[_0xe354('0x21')](function(_0x189541){if(_0x189541){_0x2f2783=_0x189541[_0xe354('0x32')];if(!_0x2a47f3[_0xe354('0x2e')][_0xe354('0x33')]('nolimit')){_0x4d87a0['limit']=qs[_0xe354('0x18')](_0x2a47f3[_0xe354('0x2e')][_0xe354('0x18')]);_0x4d87a0['offset']=qs['offset'](_0x2a47f3[_0xe354('0x2e')][_0xe354('0x17')]);}return _0x48f690[_0xe354('0x51')](_0x4d87a0);}})['then'](function(_0x20d136){if(_0x20d136){return _0x20d136?{'count':_0x2f2783,'rows':_0x20d136}:null;}})['then'](respondWithResult(_0xf93e45,null))[_0xe354('0x3e')](handleError(_0xf93e45,null));}; \ No newline at end of file +var _0xb6f5=['options','include','findAll','rows','catch','show','rawAttributes','fields','includeAll','find','create','user','role','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addContacts','CmContact','omit','ids','findOne','length','pick','getContacts','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','order','sort','where','filter','merge','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb6f5,0x12b));var _0x5b6f=function(_0x591d44,_0x2b43a3){_0x591d44=_0x591d44-0x0;var _0x41dd26=_0xb6f5[_0x591d44];return _0x41dd26;};'use strict';var emlformat=require(_0x5b6f('0x0'));var rimraf=require(_0x5b6f('0x1'));var zipdir=require(_0x5b6f('0x2'));var jsonpatch=require(_0x5b6f('0x3'));var rp=require('request-promise');var moment=require(_0x5b6f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5b6f('0x5'));var util=require(_0x5b6f('0x6'));var path=require(_0x5b6f('0x7'));var sox=require(_0x5b6f('0x8'));var csv=require(_0x5b6f('0x9'));var ejs=require(_0x5b6f('0xa'));var fs=require('fs');var fs_extra=require(_0x5b6f('0xb'));var _=require(_0x5b6f('0xc'));var squel=require(_0x5b6f('0xd'));var crypto=require(_0x5b6f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5b6f('0xf'));var toCsv=require(_0x5b6f('0x9'));var querystring=require(_0x5b6f('0x10'));var Papa=require(_0x5b6f('0x11'));var Redis=require(_0x5b6f('0x12'));var authService=require(_0x5b6f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5b6f('0x14'));var hardwareService=require(_0x5b6f('0x15'));var logger=require(_0x5b6f('0x16'))('api');var utils=require(_0x5b6f('0x17'));var config=require(_0x5b6f('0x18'));var licenseUtil=require(_0x5b6f('0x19'));var db=require(_0x5b6f('0x1a'))['db'];function respondWithStatusCode(_0x40e793,_0x3c5416){_0x3c5416=_0x3c5416||0xcc;return function(_0x5656a8){if(_0x5656a8){return _0x40e793[_0x5b6f('0x1b')](_0x3c5416);}return _0x40e793[_0x5b6f('0x1c')](_0x3c5416)[_0x5b6f('0x1d')]();};}function respondWithResult(_0xad2576,_0x11dc90){_0x11dc90=_0x11dc90||0xc8;return function(_0x48ef5d){if(_0x48ef5d){return _0xad2576[_0x5b6f('0x1c')](_0x11dc90)[_0x5b6f('0x1e')](_0x48ef5d);}};}function respondWithFilteredResult(_0x15727f,_0x3bb22e){return function(_0x37a666){if(_0x37a666){var _0x32a91a=typeof _0x3bb22e['offset']==='undefined'&&typeof _0x3bb22e['limit']==='undefined';var _0x10753c=_0x37a666[_0x5b6f('0x1f')];var _0x2d47db=_0x32a91a?0x0:_0x3bb22e[_0x5b6f('0x20')];var _0x56fb33=_0x32a91a?_0x37a666[_0x5b6f('0x1f')]:_0x3bb22e['offset']+_0x3bb22e[_0x5b6f('0x21')];var _0x1ccd32;if(_0x56fb33>=_0x10753c){_0x56fb33=_0x10753c;_0x1ccd32=0xc8;}else{_0x1ccd32=0xce;}_0x15727f['status'](_0x1ccd32);return _0x15727f[_0x5b6f('0x22')]('Content-Range',_0x2d47db+'-'+_0x56fb33+'/'+_0x10753c)[_0x5b6f('0x1e')](_0x37a666);}return null;};}function patchUpdates(_0x3bedb4){return function(_0x5b6a38){try{jsonpatch[_0x5b6f('0x23')](_0x5b6a38,_0x3bedb4,!![]);}catch(_0x1b35f4){return BPromise[_0x5b6f('0x24')](_0x1b35f4);}return _0x5b6a38[_0x5b6f('0x25')]();};}function saveUpdates(_0x321a46,_0x3bc5d3){return function(_0xfc45a9){if(_0xfc45a9){return _0xfc45a9['update'](_0x321a46)[_0x5b6f('0x26')](function(_0x3b7cac){return _0x3b7cac;});}return null;};}function removeEntity(_0x1815d6,_0x2cc439){return function(_0x1ab1ff){if(_0x1ab1ff){return _0x1ab1ff[_0x5b6f('0x27')]()[_0x5b6f('0x26')](function(){var _0x3dc244=_0x1ab1ff[_0x5b6f('0x28')]({'plain':!![]});var _0x56d0cf='Companies';return db[_0x5b6f('0x29')][_0x5b6f('0x27')]({'where':{'type':_0x56d0cf,'resourceId':_0x3dc244['id']}})[_0x5b6f('0x26')](function(){return _0x1ab1ff;});})[_0x5b6f('0x26')](function(){_0x1815d6[_0x5b6f('0x1c')](0xcc)[_0x5b6f('0x1d')]();});}};}function handleEntityNotFound(_0x2f85f8,_0x185f2a){return function(_0x1da9a3){if(!_0x1da9a3){_0x2f85f8[_0x5b6f('0x1b')](0x194);}return _0x1da9a3;};}function handleError(_0x586aae,_0x5321d5){_0x5321d5=_0x5321d5||0x1f4;return function(_0x8a07bb){logger[_0x5b6f('0x2a')](_0x8a07bb[_0x5b6f('0x2b')]);if(_0x8a07bb[_0x5b6f('0x2c')]){delete _0x8a07bb[_0x5b6f('0x2c')];}_0x586aae[_0x5b6f('0x1c')](_0x5321d5)[_0x5b6f('0x2d')](_0x8a07bb);};}exports[_0x5b6f('0x2e')]=function(_0x37b9b4,_0x2c6829){var _0x164452={},_0xeb6bfd={},_0x36b213={'count':0x0,'rows':[]};return db[_0x5b6f('0x2f')][_0x5b6f('0x30')]()['then'](function(_0x5be31e){_0xeb6bfd[_0x5b6f('0x31')]=_[_0x5b6f('0x32')](_0x5be31e);_0xeb6bfd['query']=_['keys'](_0x37b9b4[_0x5b6f('0x33')]);_0xeb6bfd[_0x5b6f('0x34')]=_[_0x5b6f('0x35')](_0xeb6bfd[_0x5b6f('0x31')],_0xeb6bfd['query']);_0x164452['attributes']=_[_0x5b6f('0x35')](_0xeb6bfd[_0x5b6f('0x31')],qs['fields'](_0x37b9b4[_0x5b6f('0x33')]['fields']));_0x164452[_0x5b6f('0x36')]=_0x164452[_0x5b6f('0x36')]['length']?_0x164452[_0x5b6f('0x36')]:_0xeb6bfd['model'];if(!_0x37b9b4[_0x5b6f('0x33')]['hasOwnProperty']('nolimit')){_0x164452[_0x5b6f('0x21')]=qs[_0x5b6f('0x21')](_0x37b9b4['query'][_0x5b6f('0x21')]);_0x164452[_0x5b6f('0x20')]=qs[_0x5b6f('0x20')](_0x37b9b4[_0x5b6f('0x33')][_0x5b6f('0x20')]);}_0x164452[_0x5b6f('0x37')]=qs[_0x5b6f('0x38')](_0x37b9b4[_0x5b6f('0x33')][_0x5b6f('0x38')]);_0x164452[_0x5b6f('0x39')]=qs[_0x5b6f('0x34')](_['pick'](_0x37b9b4[_0x5b6f('0x33')],_0xeb6bfd[_0x5b6f('0x34')]),_0x5be31e);if(_0x37b9b4[_0x5b6f('0x33')][_0x5b6f('0x3a')]){_0x164452['where']=_[_0x5b6f('0x3b')](_0x164452['where'],{'$or':_[_0x5b6f('0x3c')](_0x164452['attributes'],function(_0x5ce9b1){var _0x4ae3b4={};_0x4ae3b4[_0x5ce9b1]={'$like':'%'+_0x37b9b4[_0x5b6f('0x33')][_0x5b6f('0x3a')]+'%'};return _0x4ae3b4;})});}_0x164452=_[_0x5b6f('0x3b')]({},_0x164452,_0x37b9b4[_0x5b6f('0x3d')]);var _0x501ddf={'where':_0x164452[_0x5b6f('0x39')]};return db['CmCompany'][_0x5b6f('0x1f')](_0x501ddf)[_0x5b6f('0x26')](function(_0x5863af){_0x36b213[_0x5b6f('0x1f')]=_0x5863af;if(_0x37b9b4[_0x5b6f('0x33')]['includeAll']){_0x164452[_0x5b6f('0x3e')]=[{'all':!![]}];}return db[_0x5b6f('0x2f')][_0x5b6f('0x3f')](_0x164452);})[_0x5b6f('0x26')](function(_0x3886e6){_0x36b213[_0x5b6f('0x40')]=_0x3886e6;return _0x36b213;})[_0x5b6f('0x26')](respondWithFilteredResult(_0x2c6829,_0x164452))[_0x5b6f('0x41')](handleError(_0x2c6829,null));})[_0x5b6f('0x41')](handleError(_0x2c6829,null));};exports[_0x5b6f('0x42')]=function(_0x32b610,_0x375257){var _0x20f284={'raw':![],'where':{'id':_0x32b610['params']['id']}},_0xa83134={};_0xa83134['model']=_[_0x5b6f('0x32')](db[_0x5b6f('0x2f')][_0x5b6f('0x43')]);_0xa83134[_0x5b6f('0x33')]=_['keys'](_0x32b610[_0x5b6f('0x33')]);_0xa83134[_0x5b6f('0x34')]=_[_0x5b6f('0x35')](_0xa83134[_0x5b6f('0x31')],_0xa83134[_0x5b6f('0x33')]);_0x20f284['attributes']=_[_0x5b6f('0x35')](_0xa83134[_0x5b6f('0x31')],qs['fields'](_0x32b610[_0x5b6f('0x33')][_0x5b6f('0x44')]));_0x20f284[_0x5b6f('0x36')]=_0x20f284['attributes']['length']?_0x20f284[_0x5b6f('0x36')]:_0xa83134[_0x5b6f('0x31')];if(_0x32b610[_0x5b6f('0x33')][_0x5b6f('0x45')]){_0x20f284['include']=[{'all':!![]}];}_0x20f284=_[_0x5b6f('0x3b')]({},_0x20f284,_0x32b610[_0x5b6f('0x3d')]);return db[_0x5b6f('0x2f')][_0x5b6f('0x46')](_0x20f284)[_0x5b6f('0x26')](handleEntityNotFound(_0x375257,null))[_0x5b6f('0x26')](respondWithResult(_0x375257,null))[_0x5b6f('0x41')](handleError(_0x375257,null));};exports[_0x5b6f('0x47')]=function(_0x11b256,_0x154419){return db[_0x5b6f('0x2f')]['create'](_0x11b256['body'],{})[_0x5b6f('0x26')](function(_0x3c097c){var _0x3c7f45=_0x11b256[_0x5b6f('0x48')][_0x5b6f('0x28')]({'plain':!![]});if(!_0x3c7f45)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c7f45[_0x5b6f('0x49')]===_0x5b6f('0x48')){var _0x57a04e=_0x3c097c[_0x5b6f('0x28')]({'plain':!![]});var _0x2f178c=_0x5b6f('0x4a');return db[_0x5b6f('0x4b')][_0x5b6f('0x46')]({'where':{'name':_0x2f178c,'userProfileId':_0x3c7f45[_0x5b6f('0x4c')]},'raw':!![]})[_0x5b6f('0x26')](function(_0x3faadc){if(_0x3faadc&&_0x3faadc[_0x5b6f('0x4d')]===0x0){return db[_0x5b6f('0x29')][_0x5b6f('0x47')]({'name':_0x57a04e['name'],'resourceId':_0x57a04e['id'],'type':_0x3faadc[_0x5b6f('0x2c')],'sectionId':_0x3faadc['id']},{})[_0x5b6f('0x26')](function(){return _0x3c097c;});}else{return _0x3c097c;}})[_0x5b6f('0x41')](function(_0x1708ec){logger[_0x5b6f('0x2a')](_0x5b6f('0x4e'),_0x1708ec);throw _0x1708ec;});}return _0x3c097c;})['then'](respondWithResult(_0x154419,0xc9))[_0x5b6f('0x41')](handleError(_0x154419,null));};exports['update']=function(_0x5f9a99,_0x2fa6ff){if(_0x5f9a99[_0x5b6f('0x4f')]['id']){delete _0x5f9a99['body']['id'];}return db[_0x5b6f('0x2f')][_0x5b6f('0x46')]({'where':{'id':_0x5f9a99['params']['id']}})[_0x5b6f('0x26')](handleEntityNotFound(_0x2fa6ff,null))[_0x5b6f('0x26')](saveUpdates(_0x5f9a99[_0x5b6f('0x4f')],null))[_0x5b6f('0x26')](respondWithResult(_0x2fa6ff,null))['catch'](handleError(_0x2fa6ff,null));};exports[_0x5b6f('0x27')]=function(_0x5a4675,_0x1cbc74){return db[_0x5b6f('0x2f')][_0x5b6f('0x46')]({'where':{'id':_0x5a4675[_0x5b6f('0x50')]['id']}})[_0x5b6f('0x26')](handleEntityNotFound(_0x1cbc74,null))[_0x5b6f('0x26')](removeEntity(_0x1cbc74,null))[_0x5b6f('0x41')](handleError(_0x1cbc74,null));};exports['describe']=function(_0x2db212,_0x2f3169){return db['CmCompany'][_0x5b6f('0x30')]()['then'](respondWithResult(_0x2f3169,null))[_0x5b6f('0x41')](handleError(_0x2f3169,null));};exports[_0x5b6f('0x51')]=function(_0x51fce3,_0x18305c,_0x40a330){return db[_0x5b6f('0x52')]['find']({'where':{'id':_0x51fce3[_0x5b6f('0x50')]['id']}})[_0x5b6f('0x26')](handleEntityNotFound(_0x18305c,null))[_0x5b6f('0x26')](function(_0x38676a){if(_0x38676a){return _0x38676a['addContacts'](_0x51fce3[_0x5b6f('0x4f')]['ids'],_[_0x5b6f('0x53')](_0x51fce3[_0x5b6f('0x4f')],[_0x5b6f('0x54'),'id'])||{});}})[_0x5b6f('0x26')](respondWithResult(_0x18305c,null))['catch'](handleError(_0x18305c,null));};exports['getContacts']=function(_0x2c78f4,_0x3995d3,_0x5ee756){var _0x203d4f={};var _0x29ce74={};var _0x11f0ab;var _0x53c24e;return db['CmCompany'][_0x5b6f('0x55')]({'where':{'id':_0x2c78f4[_0x5b6f('0x50')]['id']}})['then'](handleEntityNotFound(_0x3995d3,null))[_0x5b6f('0x26')](function(_0x1eb29f){if(_0x1eb29f){_0x11f0ab=_0x1eb29f;_0x29ce74[_0x5b6f('0x31')]=_[_0x5b6f('0x32')](db[_0x5b6f('0x52')][_0x5b6f('0x43')]);_0x29ce74[_0x5b6f('0x33')]=_[_0x5b6f('0x32')](_0x2c78f4[_0x5b6f('0x33')]);_0x29ce74[_0x5b6f('0x34')]=_[_0x5b6f('0x35')](_0x29ce74[_0x5b6f('0x31')],_0x29ce74['query']);_0x203d4f['attributes']=_[_0x5b6f('0x35')](_0x29ce74['model'],qs['fields'](_0x2c78f4[_0x5b6f('0x33')][_0x5b6f('0x44')]));_0x203d4f['attributes']=_0x203d4f[_0x5b6f('0x36')][_0x5b6f('0x56')]?_0x203d4f[_0x5b6f('0x36')]:_0x29ce74[_0x5b6f('0x31')];_0x203d4f['order']=qs['sort'](_0x2c78f4[_0x5b6f('0x33')][_0x5b6f('0x38')]);_0x203d4f['where']=qs[_0x5b6f('0x34')](_[_0x5b6f('0x57')](_0x2c78f4['query'],_0x29ce74[_0x5b6f('0x34')]));if(_0x2c78f4[_0x5b6f('0x33')][_0x5b6f('0x3a')]){_0x203d4f[_0x5b6f('0x39')]=_[_0x5b6f('0x3b')](_0x203d4f[_0x5b6f('0x39')],{'$or':_[_0x5b6f('0x3c')](_0x203d4f[_0x5b6f('0x36')],function(_0x34ecd6){var _0x30a6c4={};_0x30a6c4[_0x34ecd6]={'$like':'%'+_0x2c78f4[_0x5b6f('0x33')]['filter']+'%'};return _0x30a6c4;})});}_0x203d4f=_[_0x5b6f('0x3b')]({},_0x203d4f,_0x2c78f4['options']);return _0x11f0ab[_0x5b6f('0x58')](_0x203d4f);}})[_0x5b6f('0x26')](function(_0x1dc34a){if(_0x1dc34a){_0x53c24e=_0x1dc34a[_0x5b6f('0x56')];if(!_0x2c78f4['query']['hasOwnProperty'](_0x5b6f('0x59'))){_0x203d4f[_0x5b6f('0x21')]=qs[_0x5b6f('0x21')](_0x2c78f4[_0x5b6f('0x33')][_0x5b6f('0x21')]);_0x203d4f[_0x5b6f('0x20')]=qs['offset'](_0x2c78f4[_0x5b6f('0x33')][_0x5b6f('0x20')]);}return _0x11f0ab[_0x5b6f('0x58')](_0x203d4f);}})[_0x5b6f('0x26')](function(_0x1d255d){if(_0x1d255d){return _0x1d255d?{'count':_0x53c24e,'rows':_0x1d255d}:null;}})['then'](respondWithResult(_0x3995d3,null))[_0x5b6f('0x41')](handleError(_0x3995d3,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index e1fd95b..20c6c57 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 _0x2200=['define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports'];(function(_0x51f06a,_0x469aa1){var _0x596469=function(_0x54a32f){while(--_0x54a32f){_0x51f06a['push'](_0x51f06a['shift']());}};_0x596469(++_0x469aa1);}(_0x2200,0x11b));var _0x0220=function(_0x5a2d3f,_0x27b04e){_0x5a2d3f=_0x5a2d3f-0x0;var _0x5c65d8=_0x2200[_0x5a2d3f];return _0x5c65d8;};'use strict';var _=require(_0x0220('0x0'));var util=require(_0x0220('0x1'));var logger=require(_0x0220('0x2'))(_0x0220('0x3'));var moment=require(_0x0220('0x4'));var BPromise=require(_0x0220('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0220('0x6'));var rimraf=require(_0x0220('0x7'));var config=require(_0x0220('0x8'));var attributes=require(_0x0220('0x9'));module[_0x0220('0xa')]=function(_0xe7a548,_0x3843f6){return _0xe7a548[_0x0220('0xb')](_0x0220('0xc'),attributes,{'tableName':_0x0220('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0615=['CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./cmCompany.attributes','define'];(function(_0x516a73,_0x40da9f){var _0x2c4543=function(_0x1509f7){while(--_0x1509f7){_0x516a73['push'](_0x516a73['shift']());}};_0x2c4543(++_0x40da9f);}(_0x0615,0x1b2));var _0x5061=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x0615[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x5061('0x0'));var util=require(_0x5061('0x1'));var logger=require(_0x5061('0x2'))(_0x5061('0x3'));var moment=require(_0x5061('0x4'));var BPromise=require(_0x5061('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5061('0x6'));var config=require(_0x5061('0x7'));var attributes=require(_0x5061('0x8'));module['exports']=function(_0x393e30,_0x59233f){return _0x393e30[_0x5061('0x9')](_0x5061('0xa'),attributes,{'tableName':_0x5061('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 25ab88d..1093b6a 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 _0xbaa3=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash'];(function(_0x28294a,_0x542642){var _0x3bef7d=function(_0x2229f4){while(--_0x2229f4){_0x28294a['push'](_0x28294a['shift']());}};_0x3bef7d(++_0x542642);}(_0xbaa3,0x1b4));var _0x3baa=function(_0x1635fe,_0x5f1d9f){_0x1635fe=_0x1635fe-0x0;var _0x3c512a=_0xbaa3[_0x1635fe];return _0x3c512a;};'use strict';var _=require(_0x3baa('0x0'));var util=require(_0x3baa('0x1'));var moment=require('moment');var BPromise=require(_0x3baa('0x2'));var rs=require(_0x3baa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3baa('0x4'))['db'];var utils=require(_0x3baa('0x5'));var logger=require(_0x3baa('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3baa('0x7'));var client=jayson[_0x3baa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32bf2d,_0x2e8439,_0x4b476c){return new BPromise(function(_0x1c9217,_0x30fa77){return client['request'](_0x32bf2d,_0x4b476c)[_0x3baa('0x9')](function(_0x5e6b4b){logger['info'](_0x3baa('0xa'),_0x2e8439,_0x3baa('0xb'));logger[_0x3baa('0xc')](_0x3baa('0xd'),_0x2e8439,_0x3baa('0xb'),JSON[_0x3baa('0xe')](_0x5e6b4b));if(_0x5e6b4b['error']){if(_0x5e6b4b[_0x3baa('0xf')]['code']===0x1f4){logger['error'](_0x3baa('0xa'),_0x2e8439,_0x5e6b4b[_0x3baa('0xf')][_0x3baa('0x10')]);return _0x30fa77(_0x5e6b4b[_0x3baa('0xf')][_0x3baa('0x10')]);}logger[_0x3baa('0xf')](_0x3baa('0xa'),_0x2e8439,_0x5e6b4b[_0x3baa('0xf')][_0x3baa('0x10')]);return _0x1c9217(_0x5e6b4b[_0x3baa('0xf')][_0x3baa('0x10')]);}else{logger[_0x3baa('0x11')]('CmCompany,\x20%s,\x20%s',_0x2e8439,_0x3baa('0xb'));_0x1c9217(_0x5e6b4b[_0x3baa('0x12')][_0x3baa('0x10')]);}})['catch'](function(_0x16a36a){logger[_0x3baa('0xf')]('CmCompany,\x20%s,\x20%s',_0x2e8439,_0x16a36a);_0x30fa77(_0x16a36a);});});} \ No newline at end of file +var _0x61d3=['rpc','../../config/environment','http','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x61d3,0x124));var _0x361d=function(_0x3e3d12,_0x5d8c29){_0x3e3d12=_0x3e3d12-0x0;var _0x2685a8=_0x61d3[_0x3e3d12];return _0x2685a8;};'use strict';var _=require('lodash');var util=require(_0x361d('0x0'));var moment=require(_0x361d('0x1'));var BPromise=require(_0x361d('0x2'));var rs=require(_0x361d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x361d('0x4'))['db'];var utils=require(_0x361d('0x5'));var logger=require(_0x361d('0x6'))(_0x361d('0x7'));var config=require(_0x361d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x361d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13ecc7,_0x477d92,_0x58b83e){return new BPromise(function(_0x397b94,_0x2641b5){return client[_0x361d('0xa')](_0x13ecc7,_0x58b83e)[_0x361d('0xb')](function(_0x50c9c6){logger[_0x361d('0xc')]('CmCompany,\x20%s,\x20%s',_0x477d92,_0x361d('0xd'));logger[_0x361d('0xe')](_0x361d('0xf'),_0x477d92,'request\x20sent',JSON[_0x361d('0x10')](_0x50c9c6));if(_0x50c9c6['error']){if(_0x50c9c6[_0x361d('0x11')][_0x361d('0x12')]===0x1f4){logger['error'](_0x361d('0x13'),_0x477d92,_0x50c9c6[_0x361d('0x11')]['message']);return _0x2641b5(_0x50c9c6[_0x361d('0x11')][_0x361d('0x14')]);}logger[_0x361d('0x11')]('CmCompany,\x20%s,\x20%s',_0x477d92,_0x50c9c6[_0x361d('0x11')]['message']);return _0x397b94(_0x50c9c6[_0x361d('0x11')][_0x361d('0x14')]);}else{logger[_0x361d('0xc')](_0x361d('0x13'),_0x477d92,_0x361d('0xd'));_0x397b94(_0x50c9c6[_0x361d('0x15')][_0x361d('0x14')]);}})[_0x361d('0x16')](function(_0x4582d1){logger[_0x361d('0x11')](_0x361d('0x13'),_0x477d92,_0x4582d1);_0x2641b5(_0x4582d1);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index c8a2bc4..66b5ce1 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 _0x5fba=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','multer','util','path','Router'];(function(_0x1a78a5,_0xdbaec1){var _0x4f9141=function(_0x4b06a0){while(--_0x4b06a0){_0x1a78a5['push'](_0x1a78a5['shift']());}};_0x4f9141(++_0xdbaec1);}(_0x5fba,0x128));var _0xa5fb=function(_0x3a8bcb,_0x130205){_0x3a8bcb=_0x3a8bcb-0x0;var _0xa9e3b0=_0x5fba[_0x3a8bcb];return _0xa9e3b0;};'use strict';var multer=require(_0xa5fb('0x0'));var util=require(_0xa5fb('0x1'));var path=require(_0xa5fb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa5fb('0x3')]();var fs_extra=require(_0xa5fb('0x4'));var auth=require(_0xa5fb('0x5'));var interaction=require(_0xa5fb('0x6'));var config=require(_0xa5fb('0x7'));var controller=require('./cmCompany.controller');router[_0xa5fb('0x8')]('/',auth[_0xa5fb('0x9')](),controller[_0xa5fb('0xa')]);router[_0xa5fb('0x8')](_0xa5fb('0xb'),auth[_0xa5fb('0x9')](),controller[_0xa5fb('0xc')]);router['get'](_0xa5fb('0xd'),auth[_0xa5fb('0x9')](),controller[_0xa5fb('0xe')]);router[_0xa5fb('0x8')](_0xa5fb('0xf'),auth[_0xa5fb('0x9')](),controller[_0xa5fb('0x10')]);router[_0xa5fb('0x11')]('/',auth['isAuthenticated'](),controller[_0xa5fb('0x12')]);router[_0xa5fb('0x11')](_0xa5fb('0xf'),auth[_0xa5fb('0x9')](),controller[_0xa5fb('0x13')]);router[_0xa5fb('0x14')](_0xa5fb('0xd'),auth[_0xa5fb('0x9')](),controller[_0xa5fb('0x15')]);router[_0xa5fb('0x16')](_0xa5fb('0xd'),auth[_0xa5fb('0x9')](),controller[_0xa5fb('0x17')]);module[_0xa5fb('0x18')]=router; \ No newline at end of file +var _0xfa41=['create','addContacts','put','update','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post'];(function(_0x118a97,_0x143f67){var _0x1b20c8=function(_0x240fdd){while(--_0x240fdd){_0x118a97['push'](_0x118a97['shift']());}};_0x1b20c8(++_0x143f67);}(_0xfa41,0xeb));var _0x1fa4=function(_0xb99421,_0xaab133){_0xb99421=_0xb99421-0x0;var _0x4b3ec7=_0xfa41[_0xb99421];return _0x4b3ec7;};'use strict';var multer=require(_0x1fa4('0x0'));var util=require('util');var path=require(_0x1fa4('0x1'));var timeout=require('connect-timeout');var express=require(_0x1fa4('0x2'));var router=express[_0x1fa4('0x3')]();var fs_extra=require(_0x1fa4('0x4'));var auth=require(_0x1fa4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1fa4('0x6'));var controller=require(_0x1fa4('0x7'));router[_0x1fa4('0x8')]('/',auth[_0x1fa4('0x9')](),controller[_0x1fa4('0xa')]);router[_0x1fa4('0x8')](_0x1fa4('0xb'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0xc')]);router[_0x1fa4('0x8')](_0x1fa4('0xd'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0xe')]);router[_0x1fa4('0x8')](_0x1fa4('0xf'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0x10')]);router[_0x1fa4('0x11')]('/',auth['isAuthenticated'](),controller[_0x1fa4('0x12')]);router['post'](_0x1fa4('0xf'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0x13')]);router[_0x1fa4('0x14')]('/:id',auth[_0x1fa4('0x9')](),controller[_0x1fa4('0x15')]);router['delete'](_0x1fa4('0xd'),auth[_0x1fa4('0x9')](),controller[_0x1fa4('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 6c22913..7784312 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 _0x1ba3=['sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x3430bb,_0x3a84af){var _0x5855bb=function(_0x1cfc71){while(--_0x1cfc71){_0x3430bb['push'](_0x3430bb['shift']());}};_0x5855bb(++_0x3a84af);}(_0x1ba3,0x1c0));var _0x31ba=function(_0x1793de,_0x4d7233){_0x1793de=_0x1793de-0x0;var _0x4f0309=_0x1ba3[_0x1793de];return _0x4f0309;};'use strict';var _=require('lodash');var Sequelize=require(_0x31ba('0x0'));module[_0x31ba('0x1')]={'firstName':{'type':Sequelize[_0x31ba('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x31ba('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x31ba('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x31ba('0x2')]},'description':{'type':Sequelize[_0x31ba('0x3')]},'phone':{'type':Sequelize[_0x31ba('0x2')]},'mobile':{'type':Sequelize[_0x31ba('0x2')]},'fax':{'type':Sequelize[_0x31ba('0x2')]},'email':{'type':Sequelize[_0x31ba('0x2')]},'url':{'type':Sequelize[_0x31ba('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x31ba('0x2')]},'twitter':{'type':Sequelize[_0x31ba('0x2')]},'skype':{'type':Sequelize[_0x31ba('0x2')]},'teams':{'type':Sequelize[_0x31ba('0x2')]},'viber':{'type':Sequelize[_0x31ba('0x2')]},'line':{'type':Sequelize[_0x31ba('0x2')]},'wechat':{'type':Sequelize[_0x31ba('0x2')]},'telegram':{'type':Sequelize[_0x31ba('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x31ba('0x2')]},'priority':{'type':Sequelize[_0x31ba('0x4')](0x2)[_0x31ba('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x31ba('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x31ba('0x2')]},'utcOffset':{'type':Sequelize[_0x31ba('0x4')]}}; \ No newline at end of file +var _0xdcd8=['TEXT','UNSIGNED','NOW','INTEGER','lodash','sequelize','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdcd8,0xdd));var _0x8dcd=function(_0x184d15,_0x156b5d){_0x184d15=_0x184d15-0x0;var _0x4989da=_0xdcd8[_0x184d15];return _0x4989da;};'use strict';var _=require(_0x8dcd('0x0'));var Sequelize=require(_0x8dcd('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x8dcd('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x8dcd('0x2')]},'street':{'type':Sequelize[_0x8dcd('0x2')]},'postalCode':{'type':Sequelize[_0x8dcd('0x2')]},'city':{'type':Sequelize[_0x8dcd('0x2')]},'country':{'type':Sequelize[_0x8dcd('0x2')]},'dateOfBirth':{'type':Sequelize[_0x8dcd('0x2')]},'description':{'type':Sequelize[_0x8dcd('0x3')]},'phone':{'type':Sequelize[_0x8dcd('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x8dcd('0x2')]},'url':{'type':Sequelize[_0x8dcd('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x8dcd('0x2')]},'teams':{'type':Sequelize[_0x8dcd('0x2')]},'viber':{'type':Sequelize[_0x8dcd('0x2')]},'line':{'type':Sequelize[_0x8dcd('0x2')]},'wechat':{'type':Sequelize[_0x8dcd('0x2')]},'telegram':{'type':Sequelize[_0x8dcd('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x8dcd('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x8dcd('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x8dcd('0x5')]},'dialTimezone':{'type':Sequelize[_0x8dcd('0x2')]},'utcOffset':{'type':Sequelize[_0x8dcd('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index fba7d38..7b13b37 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(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 b4a588c..011e7a1 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 _0x274f=['CmContact','setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0xe0309f,_0x3b87ec){var _0x5bcf5a=function(_0x3b8bfb){while(--_0x3b8bfb){_0xe0309f['push'](_0xe0309f['shift']());}};_0x5bcf5a(++_0x3b87ec);}(_0x274f,0x1ca));var _0xf274=function(_0x1210fa,_0xeaeada){_0x1210fa=_0x1210fa-0x0;var _0x562b4e=_0x274f[_0x1210fa];return _0x562b4e;};'use strict';var EventEmitter=require(_0xf274('0x0'));var CmContact=require(_0xf274('0x1'))['db'][_0xf274('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xf274('0x3')](0x0);var events={'afterCreate':_0xf274('0x4'),'afterUpdate':_0xf274('0x5'),'afterDestroy':_0xf274('0x6')};function emitEvent(_0x106e75){return function(_0x3f132f,_0x48ef92,_0x45a2e6){CmContactEvents[_0xf274('0x7')](_0x106e75+':'+_0x3f132f['id'],_0x3f132f);CmContactEvents['emit'](_0x106e75,_0x3f132f);_0x45a2e6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0xf274('0x8')](e,emitEvent(event));}}module[_0xf274('0x9')]=CmContactEvents; \ No newline at end of file +var _0xc0a2=['exports','events','update','remove','emit'];(function(_0xac0dc6,_0x277c9b){var _0x1feb0a=function(_0x492ef4){while(--_0x492ef4){_0xac0dc6['push'](_0xac0dc6['shift']());}};_0x1feb0a(++_0x277c9b);}(_0xc0a2,0x18c));var _0x2c0a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc0a2[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0x2c0a('0x0'));var CmContact=require('../../mysqldb')['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2c0a('0x1'),'afterDestroy':_0x2c0a('0x2')};function emitEvent(_0x16c619){return function(_0x7455ae,_0x5b2672,_0x250670){CmContactEvents[_0x2c0a('0x3')](_0x16c619+':'+_0x7455ae['id'],_0x7455ae);CmContactEvents[_0x2c0a('0x3')](_0x16c619,_0x7455ae);_0x250670(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x2c0a('0x4')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index a426c5d..ddbcef3 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 _0x0616=['length','get','dialCheckDuplicateType','always','onlyIfOpen','outbound','BlackLists','CmHopperBlack','message','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty','destroy','ContactId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','util','../../config/logger','api','moment','bluebird','request-promise','./cmContact.attributes','exports','define','CmContact','phone','firstName','mobile','fax','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','error','cmContact','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','add','minutes','ret','CmHopper','ListId','priority','callbackUniqueid','catch','cmContact,\x20afterCreate\x20','CmHopperFinal','create','afterCreate','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','CmList','Lists'];(function(_0xb7cb72,_0x19d391){var _0x4b7570=function(_0x5a4a93){while(--_0x5a4a93){_0xb7cb72['push'](_0xb7cb72['shift']());}};_0x4b7570(++_0x19d391);}(_0x0616,0x127));var _0x6061=function(_0x1b0899,_0x179c99){_0x1b0899=_0x1b0899-0x0;var _0x30273f=_0x0616[_0x1b0899];return _0x30273f;};'use strict';var _=require('lodash');var util=require(_0x6061('0x0'));var logger=require(_0x6061('0x1'))(_0x6061('0x2'));var moment=require(_0x6061('0x3'));var BPromise=require(_0x6061('0x4'));var rp=require(_0x6061('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var shared=require('../../config/environment/shared');var attributes=require(_0x6061('0x6'));module[_0x6061('0x7')]=function(_0x4de869,_0x2354f5){return _0x4de869[_0x6061('0x8')](_0x6061('0x9'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x6061('0xa'),'fields':[_0x6061('0xa')]},{'name':'fti_cm_contacts','fields':[_0x6061('0xb'),'lastName','phone',_0x6061('0xc'),_0x6061('0xd'),'email'],'type':_0x6061('0xe')}],'timestamps':!![],'charset':_0x6061('0xf'),'collate':_0x6061('0x10'),'hooks':{'afterCreate':function(_0x159aa6,_0xb5877d,_0x536c75){var _0x31fe12=_0x4de869[_0x6061('0x11')];var _0x43d56a=_0x159aa6['get']({'plain':!![]});function _0x5117ab(){return function(_0x5afd5c){logger[_0x6061('0x12')](_0x6061('0x13'),'afterCreate',util[_0x6061('0x14')](_0x5afd5c,{'showHidden':![],'depth':null}));};}function _0x430a83(_0x18a4e3,_0x4090b0){var _0x2fb0ad=_0x4090b0[_0x6061('0x15')]?_0x4090b0[_0x6061('0x15')]:moment()[_0x6061('0x16')](_0x6061('0x17'));return new BPromise(function(_0xf30814,_0x3b6575){if(_[_0x6061('0x18')](_0x4090b0[_0x6061('0x19')])){_0xf30814({'ret':_0x2fb0ad});}else{_0x31fe12[_0x6061('0x1a')][_0x6061('0x1b')]({'where':{'id':_0x18a4e3['id']}})[_0x6061('0x1c')](function(_0x446e10){if(!_[_0x6061('0x18')](_0x446e10)){var _0x1dd4a7=_0x446e10[_0x6061('0x19')];if(!_[_0x6061('0x18')](_0x1dd4a7)){var _0xd6a6bc=shared[_0x6061('0x1d')];var _0x11ad20=_0xd6a6bc[_0x1dd4a7];var _0x4cc470=_0xd6a6bc[_0x4090b0[_0x6061('0x19')]];if(!_[_0x6061('0x18')](_0x11ad20)&&!_[_0x6061('0x18')](_0x4cc470)){var _0x854af0=_0x11ad20[_0x6061('0x1e')]-_0x4cc470['utcOffset'];_0x2fb0ad=_0x4090b0['scheduledat']?_0x4090b0[_0x6061('0x15')]:moment();var _0x3fc387=moment(_0x2fb0ad)[_0x6061('0x1f')](_0x854af0,_0x6061('0x20'));_0xf30814({'ret':_0x3fc387['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0xf30814({'ret':_0x2fb0ad});}else _0xf30814({'ret':_0x2fb0ad});}else{_0xf30814({'ret':_0x2fb0ad});}});}});return 0xa;}var _0x59b193=function(_0x52a9ae){return new BPromise(function(_0x1c8a58,_0x16def3){_0x430a83(_0x52a9ae,_0x43d56a)['then'](function(_0x5bfe6f){_0x43d56a[_0x6061('0x15')]=_0x5bfe6f[_0x6061('0x21')];_0x31fe12['CmHopper'][_0x6061('0x1b')]({'where':{'phone':_0x43d56a[_0x6061('0xa')],'VoiceQueueId':_0x52a9ae['id']}})[_0x6061('0x1c')](function(_0xf54b57){if(!_['isNil'](_0xf54b57)){throw new Error('cmContact,\x20afterCreate\x20'+_0x43d56a[_0x6061('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x52a9ae['id']);}return _0x31fe12[_0x6061('0x22')]['create']({'phone':_0x43d56a[_0x6061('0xa')],'ContactId':_0x43d56a['id'],'ListId':_0x43d56a[_0x6061('0x23')],'priority':_0x43d56a[_0x6061('0x24')]?_0x43d56a[_0x6061('0x24')]:0x2,'scheduledat':_0x43d56a['scheduledat']?_0x43d56a[_0x6061('0x15')]:moment()[_0x6061('0x16')](_0x6061('0x17')),'callback':_0x43d56a[_0x6061('0x25')]?!![]:![],'callbackuniqueid':_0x43d56a[_0x6061('0x25')]?_0x43d56a[_0x6061('0x25')]:undefined,'callbackat':_0x43d56a[_0x6061('0x25')]?moment()['format'](_0x6061('0x17')):undefined,'VoiceQueueId':_0x52a9ae['id']});})[_0x6061('0x26')](function(_0x273364){_0x16def3(_0x273364);});});});};var _0xc562db=function(_0x4bebd6){return new BPromise(function(_0x238980,_0x395eec){_0x430a83(_0x4bebd6,_0x43d56a)[_0x6061('0x1c')](function(_0x11226a){_0x43d56a['scheduledat']=_0x11226a[_0x6061('0x21')];_0x31fe12[_0x6061('0x22')][_0x6061('0x1b')]({'where':{'phone':_0x43d56a[_0x6061('0xa')],'VoiceQueueId':_0x4bebd6['id']}})[_0x6061('0x1c')](function(_0x2f5d0f){if(!_[_0x6061('0x18')](_0x2f5d0f)){throw new Error(_0x6061('0x27')+_0x43d56a['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x4bebd6['id']);}return _0x31fe12[_0x6061('0x28')][_0x6061('0x1b')]({'where':{'calleridnum':_0x43d56a[_0x6061('0xa')],'VoiceQueueId':_0x4bebd6['id']}});})[_0x6061('0x1c')](function(_0x34db47){if(!_[_0x6061('0x18')](_0x34db47)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x43d56a[_0x6061('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x4bebd6['id']);}return _0x31fe12[_0x6061('0x22')][_0x6061('0x29')]({'phone':_0x43d56a[_0x6061('0xa')],'ContactId':_0x43d56a['id'],'ListId':_0x43d56a[_0x6061('0x23')],'priority':_0x43d56a[_0x6061('0x24')]?_0x43d56a[_0x6061('0x24')]:0x2,'scheduledat':_0x43d56a[_0x6061('0x15')]?_0x43d56a[_0x6061('0x15')]:moment()[_0x6061('0x16')](_0x6061('0x17')),'callback':_0x43d56a[_0x6061('0x25')]?!![]:![],'callbackuniqueid':_0x43d56a['callbackUniqueid']?_0x43d56a[_0x6061('0x25')]:undefined,'callbackat':_0x43d56a['callbackUniqueid']?moment()[_0x6061('0x16')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x4bebd6['id']});})[_0x6061('0x26')](function(_0x550471){_0x395eec(_0x550471);});});});};function _0x100944(){return function(_0x50cd87){logger[_0x6061('0x12')](_0x6061('0x13'),_0x6061('0x2a'),util['inspect'](_0x50cd87,{'showHidden':![],'depth':null}));};}function _0x3f5d51(_0x532feb,_0x6bbcde){var _0x2138c4=_0x6bbcde[_0x6061('0x15')]?_0x6bbcde[_0x6061('0x15')]:moment()[_0x6061('0x16')](_0x6061('0x17'));return new BPromise(function(_0x1fed11,_0x180999){if(_['isNil'](_0x6bbcde[_0x6061('0x19')])){_0x1fed11({'ret':_0x2138c4});}else{_0x31fe12[_0x6061('0x2b')][_0x6061('0x1b')]({'where':{'id':_0x532feb['id']}})['then'](function(_0x92e161){if(!_[_0x6061('0x18')](_0x92e161)){var _0x51b24a=_0x92e161[_0x6061('0x19')];if(!_[_0x6061('0x18')](_0x51b24a)){var _0x3ca23c=shared[_0x6061('0x1d')];var _0x437555=_0x3ca23c[_0x51b24a];var _0x5859c1=_0x3ca23c[_0x6bbcde['dialTimezone']];if(!_[_0x6061('0x18')](_0x437555)&&!_[_0x6061('0x18')](_0x5859c1)){var _0x4685ec=_0x437555[_0x6061('0x1e')]-_0x5859c1[_0x6061('0x1e')];_0x2138c4=_0x6bbcde[_0x6061('0x15')]?_0x6bbcde[_0x6061('0x15')]:moment();var _0x3528c3=moment(_0x2138c4)[_0x6061('0x1f')](_0x4685ec,_0x6061('0x20'));_0x1fed11({'ret':_0x3528c3[_0x6061('0x16')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x1fed11({'ret':_0x2138c4});}else _0x1fed11({'ret':_0x2138c4});}else{_0x1fed11({'ret':_0x2138c4});}});}});return 0xa;}var _0xd8e23b=function(_0x343ae8){return new BPromise(function(_0x5d4ecb,_0x7a0688){_0x3f5d51(_0x343ae8,_0x43d56a)[_0x6061('0x1c')](function(_0x516513){_0x43d56a[_0x6061('0x15')]=_0x516513[_0x6061('0x21')];_0x31fe12[_0x6061('0x22')][_0x6061('0x1b')]({'where':{'phone':_0x43d56a[_0x6061('0xa')],'CampaignId':_0x343ae8['id']}})[_0x6061('0x1c')](function(_0x83a24d){if(!_[_0x6061('0x18')](_0x83a24d)){throw new Error('cmContact,\x20afterCreate\x20'+_0x43d56a[_0x6061('0xa')]+_0x6061('0x2c')+_0x343ae8['id']);}return _0x31fe12['CmHopper']['create']({'phone':_0x43d56a['phone'],'ContactId':_0x43d56a['id'],'ListId':_0x43d56a['ListId'],'priority':_0x43d56a[_0x6061('0x24')]?_0x43d56a[_0x6061('0x24')]:0x2,'scheduledat':_0x43d56a[_0x6061('0x15')]?_0x43d56a[_0x6061('0x15')]:moment()['format'](_0x6061('0x17')),'callback':_0x43d56a['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x43d56a[_0x6061('0x25')]?_0x43d56a['callbackUniqueid']:undefined,'callbackat':_0x43d56a[_0x6061('0x25')]?moment()[_0x6061('0x16')](_0x6061('0x17')):undefined,'CampaignId':_0x343ae8['id']});})[_0x6061('0x26')](function(_0x190b07){_0x7a0688(_0x190b07);});});});};var _0x518e0f=function(_0x1940f6){return new BPromise(function(_0x4626af,_0x47c5c6){_0x3f5d51(_0x1940f6,_0x43d56a)[_0x6061('0x1c')](function(_0x1138f3){_0x43d56a[_0x6061('0x15')]=_0x1138f3['ret'];_0x31fe12[_0x6061('0x22')][_0x6061('0x1b')]({'where':{'phone':_0x43d56a[_0x6061('0xa')],'CampaignId':_0x1940f6['id']}})['then'](function(_0x42d7f){if(!_[_0x6061('0x18')](_0x42d7f)){throw new Error('cmContact,\x20afterCreate\x20'+_0x43d56a[_0x6061('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x1940f6['id']);}return _0x31fe12[_0x6061('0x28')][_0x6061('0x1b')]({'where':{'calleridnum':_0x43d56a['phone'],'CampaignId':_0x1940f6['id']}});})[_0x6061('0x1c')](function(_0x2b1ecb){if(!_['isNil'](_0x2b1ecb)){throw new Error(_0x6061('0x2d')+_0x43d56a[_0x6061('0xa')]+_0x6061('0x2e')+_0x1940f6['id']);}return _0x31fe12[_0x6061('0x22')][_0x6061('0x29')]({'phone':_0x43d56a[_0x6061('0xa')],'ContactId':_0x43d56a['id'],'ListId':_0x43d56a[_0x6061('0x23')],'priority':_0x43d56a[_0x6061('0x24')]?_0x43d56a[_0x6061('0x24')]:0x2,'scheduledat':_0x43d56a[_0x6061('0x15')]?_0x43d56a[_0x6061('0x15')]:moment()[_0x6061('0x16')](_0x6061('0x17')),'callback':_0x43d56a[_0x6061('0x25')]?!![]:![],'callbackuniqueid':_0x43d56a['callbackUniqueid']?_0x43d56a[_0x6061('0x25')]:undefined,'callbackat':_0x43d56a[_0x6061('0x25')]?moment()[_0x6061('0x16')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x1940f6['id']});})[_0x6061('0x26')](function(_0xd90580){_0x47c5c6(_0xd90580);});});});};if(_0x43d56a['ListId']){_0x31fe12[_0x6061('0x1a')][_0x6061('0x2f')]({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType',_0x6061('0x19')],'include':[{'model':_0x31fe12[_0x6061('0x30')],'as':_0x6061('0x31'),'where':{'id':_0x43d56a[_0x6061('0x23')]}}]})['then'](function(_0x556a93){if(_0x556a93){var _0x2bcbcd=[];for(var _0x173927=0x0,_0x34d32c;_0x173927<_0x556a93[_0x6061('0x32')];_0x173927+=0x1){_0x34d32c=_0x556a93[_0x173927][_0x6061('0x33')]({'plain':!![]});switch(_0x34d32c[_0x6061('0x34')]){case _0x6061('0x35'):_0xc562db(_0x34d32c)[_0x6061('0x26')](_0x5117ab());break;case _0x6061('0x36'):_0x59b193(_0x34d32c)[_0x6061('0x26')](_0x5117ab());break;default:_0x3f5d51(_0x34d32c,_0x43d56a)[_0x6061('0x1c')](function(_0x2b0987){_0x43d56a[_0x6061('0x15')]=_0x2b0987['ret'];_0x31fe12[_0x6061('0x22')][_0x6061('0x29')]({'phone':_0x43d56a[_0x6061('0xa')],'ContactId':_0x43d56a['id'],'ListId':_0x43d56a['ListId'],'scheduledat':_0x43d56a[_0x6061('0x15')]?_0x43d56a[_0x6061('0x15')]:moment()[_0x6061('0x16')](_0x6061('0x17')),'priority':_0x43d56a[_0x6061('0x24')]?_0x43d56a[_0x6061('0x24')]:0x2,'callback':_0x43d56a[_0x6061('0x25')]?!![]:![],'callbackuniqueid':_0x43d56a[_0x6061('0x25')]?_0x43d56a[_0x6061('0x25')]:undefined,'callbackat':_0x43d56a['callbackUniqueid']?moment()[_0x6061('0x16')](_0x6061('0x17')):undefined,'VoiceQueueId':_0x34d32c['id']})[_0x6061('0x26')](_0x5117ab());});}}}})[_0x6061('0x1c')](function(){return _0x31fe12['VoiceQueue'][_0x6061('0x2f')]({'where':{'type':_0x6061('0x37')},'attributes':['id'],'include':[{'model':_0x31fe12['CmList'],'as':_0x6061('0x38'),'where':{'id':_0x43d56a[_0x6061('0x23')]}}]})['then'](function(_0x491060){if(_0x491060){var _0x30bc85=[];for(var _0x19ddf5=0x0,_0x35ea0f;_0x19ddf5<_0x491060[_0x6061('0x32')];_0x19ddf5+=0x1){_0x35ea0f=_0x491060[_0x19ddf5][_0x6061('0x33')]({'plain':!![]});_0x31fe12[_0x6061('0x39')][_0x6061('0x29')]({'phone':_0x43d56a['phone'],'ContactId':_0x43d56a['id'],'ListId':_0x43d56a['ListId'],'VoiceQueueId':_0x35ea0f['id']})[_0x6061('0x26')](function(_0x2b37f3){logger[_0x6061('0x12')]('cmContact,\x20%s,\x20%s','afterCreate',_0x2b37f3[_0x6061('0x3a')]);});}}});})[_0x6061('0x1c')](function(){return _0x31fe12[_0x6061('0x2b')][_0x6061('0x2f')]({'attributes':['id',_0x6061('0x34'),'dialTimezone'],'include':[{'model':_0x31fe12[_0x6061('0x30')],'as':_0x6061('0x31'),'where':{'id':_0x43d56a['ListId']}}]})[_0x6061('0x1c')](function(_0xfbaeba){if(_0xfbaeba){var _0x10b57d=[];for(var _0x37bfc4=0x0,_0x2758d3;_0x37bfc4<_0xfbaeba[_0x6061('0x32')];_0x37bfc4+=0x1){_0x2758d3=_0xfbaeba[_0x37bfc4][_0x6061('0x33')]({'plain':!![]});switch(_0x2758d3[_0x6061('0x34')]){case _0x6061('0x35'):_0x518e0f(_0x2758d3)[_0x6061('0x26')](_0x100944());break;case _0x6061('0x36'):_0xd8e23b(_0x2758d3)['catch'](_0x100944());break;default:_0x31fe12[_0x6061('0x22')]['create']({'phone':_0x43d56a[_0x6061('0xa')],'ContactId':_0x43d56a['id'],'ListId':_0x43d56a[_0x6061('0x23')],'scheduledat':_0x43d56a[_0x6061('0x15')]?_0x43d56a[_0x6061('0x15')]:moment()[_0x6061('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x43d56a[_0x6061('0x24')]?_0x43d56a[_0x6061('0x24')]:0x2,'callback':_0x43d56a[_0x6061('0x25')]?!![]:![],'callbackuniqueid':_0x43d56a['callbackUniqueid']?_0x43d56a[_0x6061('0x25')]:undefined,'callbackat':_0x43d56a[_0x6061('0x25')]?moment()[_0x6061('0x16')](_0x6061('0x17')):undefined,'CampaignId':_0x2758d3['id']})[_0x6061('0x26')](_0x100944());}}}});})[_0x6061('0x1c')](function(){return _0x31fe12[_0x6061('0x2b')][_0x6061('0x2f')]({'attributes':['id'],'include':[{'model':_0x31fe12[_0x6061('0x30')],'as':'BlackLists','where':{'id':_0x43d56a[_0x6061('0x23')]}}]})[_0x6061('0x1c')](function(_0x4302e8){if(_0x4302e8){var _0x3971e9=[];for(var _0x5d89a=0x0,_0x5bfda6;_0x5d89a<_0x4302e8[_0x6061('0x32')];_0x5d89a+=0x1){_0x5bfda6=_0x4302e8[_0x5d89a]['get']({'plain':!![]});_0x31fe12[_0x6061('0x39')][_0x6061('0x29')]({'phone':_0x43d56a[_0x6061('0xa')],'ContactId':_0x43d56a['id'],'ListId':_0x43d56a[_0x6061('0x23')],'CampaignId':_0x5bfda6['id']})[_0x6061('0x26')](function(_0x4ff2ac){logger[_0x6061('0x12')](_0x6061('0x3b'),_0x6061('0x2a'),_0x4ff2ac[_0x6061('0x3a')]);});}}});})[_0x6061('0x1c')](function(){_0x536c75();})[_0x6061('0x26')](function(_0x3c43c3){logger[_0x6061('0x12')](_0x6061('0x3b'),_0x6061('0x2a'),_0x3c43c3[_0x6061('0x3a')]);_0x536c75(_0x3c43c3);});}else{_0x536c75(new Error(_0x6061('0x3c')));}},'afterDestroy':function(_0x236222,_0x323ef3,_0x2ad78d){var _0x15909f=_0x4de869['models'];var _0x5d7130=_0x236222[_0x6061('0x33')]({'plain':!![]});return _0x15909f[_0x6061('0x22')][_0x6061('0x2f')]({'raw':!![],'where':{'ListId':_0x5d7130[_0x6061('0x23')],'ContactId':_0x5d7130['id']}})[_0x6061('0x1c')](function(_0x4a098b){if(!_[_0x6061('0x3d')](_0x4a098b)){var _0x387423=[];for(var _0x271d96=0x0;_0x271d96<_0x4a098b[_0x6061('0x32')];_0x271d96+=0x1){var _0x1e58cb=_0x15909f['CmHopper'][_0x6061('0x3e')]({'where':{'ListId':_0x4a098b[_0x271d96]['ListId'],'ContactId':_0x4a098b[_0x271d96][_0x6061('0x3f')],'VoiceQueueId':_0x4a098b[_0x271d96]['VoiceQueueId'],'CampaignId':_0x4a098b[_0x271d96]['CampaignId']}});_0x387423[_0x6061('0x40')](_0x1e58cb);}return BPromise[_0x6061('0x41')](_0x387423);}})[_0x6061('0x1c')](function(_0x48b235){logger[_0x6061('0x42')](_0x6061('0x43'),util[_0x6061('0x14')](_0x48b235,{'showHidden':![],'depth':null}));_0x2ad78d();})[_0x6061('0x26')](function(_0x25a122){logger[_0x6061('0x12')](_0x6061('0x44'),util[_0x6061('0x14')](_0x25a122,{'showHidden':![],'depth':null}));_0x2ad78d(_0x25a122);});}}});}; \ No newline at end of file +var _0x1405=['utf8mb4','models','get','error','cmContact','afterCreate','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','add','minutes','ret','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','create','ListId','inspect','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','Lists','length','always','CmList','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','onlyIfOpen','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','all','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','../../config/environment/shared','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','fax','email','FULLTEXT'];(function(_0x133638,_0x418b24){var _0x2e276d=function(_0x46ad2a){while(--_0x46ad2a){_0x133638['push'](_0x133638['shift']());}};_0x2e276d(++_0x418b24);}(_0x1405,0x1b6));var _0x5140=function(_0x28c89a,_0x5664b0){_0x28c89a=_0x28c89a-0x0;var _0x1888c7=_0x1405[_0x28c89a];return _0x1888c7;};'use strict';var _=require(_0x5140('0x0'));var util=require(_0x5140('0x1'));var logger=require(_0x5140('0x2'))(_0x5140('0x3'));var moment=require('moment');var BPromise=require(_0x5140('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5140('0x5'));var rimraf=require(_0x5140('0x6'));var config=require(_0x5140('0x7'));var shared=require(_0x5140('0x8'));var attributes=require('./cmContact.attributes');module['exports']=function(_0x5c3c17,_0x172d37){return _0x5c3c17['define'](_0x5140('0x9'),attributes,{'tableName':_0x5140('0xa'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0x5140('0xb')]},{'name':_0x5140('0xc'),'fields':[_0x5140('0xd'),_0x5140('0xe'),_0x5140('0xb'),'mobile',_0x5140('0xf'),_0x5140('0x10')],'type':_0x5140('0x11')}],'timestamps':!![],'charset':_0x5140('0x12'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x1c1e3a,_0x121c28,_0x1c9825){var _0x13933a=_0x5c3c17[_0x5140('0x13')];var _0x9623e1=_0x1c1e3a[_0x5140('0x14')]({'plain':!![]});function _0x86e0c5(){return function(_0x426c2e){logger[_0x5140('0x15')](_0x5140('0x16'),_0x5140('0x17'),util['inspect'](_0x426c2e,{'showHidden':![],'depth':null}));};}function _0x151072(_0x3577b1,_0x4c948a){var _0x3eb6c3=_0x4c948a[_0x5140('0x18')]?_0x4c948a['scheduledat']:moment()[_0x5140('0x19')](_0x5140('0x1a'));return new BPromise(function(_0x20847e,_0x9afd0d){if(_[_0x5140('0x1b')](_0x4c948a[_0x5140('0x1c')])){_0x20847e({'ret':_0x3eb6c3});}else{_0x13933a[_0x5140('0x1d')][_0x5140('0x1e')]({'where':{'id':_0x3577b1['id']}})[_0x5140('0x1f')](function(_0x2300c3){if(!_[_0x5140('0x1b')](_0x2300c3)){var _0x47f2e5=_0x2300c3[_0x5140('0x1c')];if(!_[_0x5140('0x1b')](_0x47f2e5)){var _0x353df6=shared[_0x5140('0x20')];var _0x1f0a30=_0x353df6[_0x47f2e5];var _0x133496=_0x353df6[_0x4c948a[_0x5140('0x1c')]];if(!_[_0x5140('0x1b')](_0x1f0a30)&&!_[_0x5140('0x1b')](_0x133496)){var _0xf90ac5=_0x1f0a30[_0x5140('0x21')]-_0x133496[_0x5140('0x21')];_0x3eb6c3=_0x4c948a[_0x5140('0x18')]?_0x4c948a[_0x5140('0x18')]:moment();var _0x2b2313=moment(_0x3eb6c3)[_0x5140('0x22')](_0xf90ac5,_0x5140('0x23'));_0x20847e({'ret':_0x2b2313[_0x5140('0x19')](_0x5140('0x1a'))});}else _0x20847e({'ret':_0x3eb6c3});}else _0x20847e({'ret':_0x3eb6c3});}else{_0x20847e({'ret':_0x3eb6c3});}});}});return 0xa;}var _0xbb09bf=function(_0x37ab47){return new BPromise(function(_0x23040b,_0x31986f){_0x151072(_0x37ab47,_0x9623e1)[_0x5140('0x1f')](function(_0x16e9d8){_0x9623e1[_0x5140('0x18')]=_0x16e9d8[_0x5140('0x24')];_0x13933a['CmHopper']['findOne']({'where':{'phone':_0x9623e1[_0x5140('0xb')],'VoiceQueueId':_0x37ab47['id']}})[_0x5140('0x1f')](function(_0x334902){if(!_[_0x5140('0x1b')](_0x334902)){throw new Error(_0x5140('0x25')+_0x9623e1[_0x5140('0xb')]+_0x5140('0x26')+_0x37ab47['id']);}return _0x13933a[_0x5140('0x27')]['create']({'phone':_0x9623e1[_0x5140('0xb')],'ContactId':_0x9623e1['id'],'ListId':_0x9623e1['ListId'],'priority':_0x9623e1['priority']?_0x9623e1[_0x5140('0x28')]:0x2,'scheduledat':_0x9623e1[_0x5140('0x18')]?_0x9623e1['scheduledat']:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x9623e1[_0x5140('0x29')]?!![]:![],'callbackuniqueid':_0x9623e1[_0x5140('0x29')]?_0x9623e1[_0x5140('0x29')]:undefined,'callbackat':_0x9623e1[_0x5140('0x29')]?moment()[_0x5140('0x19')](_0x5140('0x1a')):undefined,'VoiceQueueId':_0x37ab47['id']});})[_0x5140('0x2a')](function(_0x3e0fa7){_0x31986f(_0x3e0fa7);});});});};var _0x5e9f1f=function(_0x7cc0ab){return new BPromise(function(_0x59d543,_0x4f2108){_0x151072(_0x7cc0ab,_0x9623e1)[_0x5140('0x1f')](function(_0x3edf88){_0x9623e1[_0x5140('0x18')]=_0x3edf88[_0x5140('0x24')];_0x13933a[_0x5140('0x27')][_0x5140('0x1e')]({'where':{'phone':_0x9623e1[_0x5140('0xb')],'VoiceQueueId':_0x7cc0ab['id']}})['then'](function(_0x1028ce){if(!_[_0x5140('0x1b')](_0x1028ce)){throw new Error(_0x5140('0x25')+_0x9623e1[_0x5140('0xb')]+_0x5140('0x2b')+_0x7cc0ab['id']);}return _0x13933a['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x9623e1['phone'],'VoiceQueueId':_0x7cc0ab['id']}});})[_0x5140('0x1f')](function(_0x463161){if(!_[_0x5140('0x1b')](_0x463161)){throw new Error(_0x5140('0x2c')+_0x9623e1[_0x5140('0xb')]+_0x5140('0x2d')+_0x7cc0ab['id']);}return _0x13933a[_0x5140('0x27')][_0x5140('0x2e')]({'phone':_0x9623e1[_0x5140('0xb')],'ContactId':_0x9623e1['id'],'ListId':_0x9623e1[_0x5140('0x2f')],'priority':_0x9623e1[_0x5140('0x28')]?_0x9623e1[_0x5140('0x28')]:0x2,'scheduledat':_0x9623e1[_0x5140('0x18')]?_0x9623e1[_0x5140('0x18')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x9623e1['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x9623e1[_0x5140('0x29')]?_0x9623e1['callbackUniqueid']:undefined,'callbackat':_0x9623e1[_0x5140('0x29')]?moment()[_0x5140('0x19')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x7cc0ab['id']});})[_0x5140('0x2a')](function(_0x222edd){_0x4f2108(_0x222edd);});});});};function _0x59d70c(){return function(_0x219cd8){logger[_0x5140('0x15')](_0x5140('0x16'),'afterCreate',util[_0x5140('0x30')](_0x219cd8,{'showHidden':![],'depth':null}));};}function _0x1d7ab7(_0x24500e,_0x3cad65){var _0x14d62b=_0x3cad65['scheduledat']?_0x3cad65[_0x5140('0x18')]:moment()[_0x5140('0x19')](_0x5140('0x1a'));return new BPromise(function(_0x1ca8fa,_0x1933b1){if(_[_0x5140('0x1b')](_0x3cad65[_0x5140('0x1c')])){_0x1ca8fa({'ret':_0x14d62b});}else{_0x13933a[_0x5140('0x31')][_0x5140('0x1e')]({'where':{'id':_0x24500e['id']}})['then'](function(_0x494101){if(!_[_0x5140('0x1b')](_0x494101)){var _0x54c389=_0x494101[_0x5140('0x1c')];if(!_[_0x5140('0x1b')](_0x54c389)){var _0x45d991=shared[_0x5140('0x20')];var _0x87978a=_0x45d991[_0x54c389];var _0x3a1724=_0x45d991[_0x3cad65[_0x5140('0x1c')]];if(!_[_0x5140('0x1b')](_0x87978a)&&!_[_0x5140('0x1b')](_0x3a1724)){var _0x2e933b=_0x87978a[_0x5140('0x21')]-_0x3a1724[_0x5140('0x21')];_0x14d62b=_0x3cad65[_0x5140('0x18')]?_0x3cad65['scheduledat']:moment();var _0x20c3a7=moment(_0x14d62b)['add'](_0x2e933b,_0x5140('0x23'));_0x1ca8fa({'ret':_0x20c3a7[_0x5140('0x19')](_0x5140('0x1a'))});}else _0x1ca8fa({'ret':_0x14d62b});}else _0x1ca8fa({'ret':_0x14d62b});}else{_0x1ca8fa({'ret':_0x14d62b});}});}});return 0xa;}var _0x2c2e7=function(_0x57f094){return new BPromise(function(_0x2c957a,_0x37dfb3){_0x1d7ab7(_0x57f094,_0x9623e1)['then'](function(_0x49ea55){_0x9623e1[_0x5140('0x18')]=_0x49ea55[_0x5140('0x24')];_0x13933a[_0x5140('0x27')][_0x5140('0x1e')]({'where':{'phone':_0x9623e1[_0x5140('0xb')],'CampaignId':_0x57f094['id']}})['then'](function(_0x399c02){if(!_['isNil'](_0x399c02)){throw new Error(_0x5140('0x25')+_0x9623e1[_0x5140('0xb')]+_0x5140('0x32')+_0x57f094['id']);}return _0x13933a[_0x5140('0x27')]['create']({'phone':_0x9623e1['phone'],'ContactId':_0x9623e1['id'],'ListId':_0x9623e1[_0x5140('0x2f')],'priority':_0x9623e1[_0x5140('0x28')]?_0x9623e1[_0x5140('0x28')]:0x2,'scheduledat':_0x9623e1[_0x5140('0x18')]?_0x9623e1['scheduledat']:moment()[_0x5140('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x9623e1[_0x5140('0x29')]?!![]:![],'callbackuniqueid':_0x9623e1[_0x5140('0x29')]?_0x9623e1[_0x5140('0x29')]:undefined,'callbackat':_0x9623e1[_0x5140('0x29')]?moment()[_0x5140('0x19')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x57f094['id']});})[_0x5140('0x2a')](function(_0x170039){_0x37dfb3(_0x170039);});});});};var _0x123019=function(_0x1dd221){return new BPromise(function(_0x17bffb,_0x1ba2b7){_0x1d7ab7(_0x1dd221,_0x9623e1)[_0x5140('0x1f')](function(_0x3fd4cf){_0x9623e1[_0x5140('0x18')]=_0x3fd4cf[_0x5140('0x24')];_0x13933a[_0x5140('0x27')][_0x5140('0x1e')]({'where':{'phone':_0x9623e1[_0x5140('0xb')],'CampaignId':_0x1dd221['id']}})['then'](function(_0x783ce8){if(!_['isNil'](_0x783ce8)){throw new Error(_0x5140('0x25')+_0x9623e1[_0x5140('0xb')]+_0x5140('0x33')+_0x1dd221['id']);}return _0x13933a[_0x5140('0x34')]['findOne']({'where':{'calleridnum':_0x9623e1['phone'],'CampaignId':_0x1dd221['id']}});})[_0x5140('0x1f')](function(_0x52eb4c){if(!_['isNil'](_0x52eb4c)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x9623e1[_0x5140('0xb')]+_0x5140('0x35')+_0x1dd221['id']);}return _0x13933a[_0x5140('0x27')][_0x5140('0x2e')]({'phone':_0x9623e1[_0x5140('0xb')],'ContactId':_0x9623e1['id'],'ListId':_0x9623e1[_0x5140('0x2f')],'priority':_0x9623e1[_0x5140('0x28')]?_0x9623e1[_0x5140('0x28')]:0x2,'scheduledat':_0x9623e1[_0x5140('0x18')]?_0x9623e1[_0x5140('0x18')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x9623e1[_0x5140('0x29')]?!![]:![],'callbackuniqueid':_0x9623e1[_0x5140('0x29')]?_0x9623e1[_0x5140('0x29')]:undefined,'callbackat':_0x9623e1[_0x5140('0x29')]?moment()[_0x5140('0x19')](_0x5140('0x1a')):undefined,'CampaignId':_0x1dd221['id']});})[_0x5140('0x2a')](function(_0x310a80){_0x1ba2b7(_0x310a80);});});});};if(_0x9623e1['ListId']){_0x13933a['VoiceQueue'][_0x5140('0x36')]({'where':{'type':_0x5140('0x37')},'attributes':['id',_0x5140('0x38'),_0x5140('0x1c')],'include':[{'model':_0x13933a['CmList'],'as':_0x5140('0x39'),'where':{'id':_0x9623e1[_0x5140('0x2f')]}}]})[_0x5140('0x1f')](function(_0x234d2c){if(_0x234d2c){var _0x4d3b93=[];for(var _0x3e23f7=0x0,_0x27c3ad;_0x3e23f7<_0x234d2c[_0x5140('0x3a')];_0x3e23f7+=0x1){_0x27c3ad=_0x234d2c[_0x3e23f7]['get']({'plain':!![]});switch(_0x27c3ad[_0x5140('0x38')]){case _0x5140('0x3b'):_0x5e9f1f(_0x27c3ad)[_0x5140('0x2a')](_0x86e0c5());break;case'onlyIfOpen':_0xbb09bf(_0x27c3ad)[_0x5140('0x2a')](_0x86e0c5());break;default:_0x1d7ab7(_0x27c3ad,_0x9623e1)[_0x5140('0x1f')](function(_0xbcdb9e){_0x9623e1['scheduledat']=_0xbcdb9e['ret'];_0x13933a[_0x5140('0x27')]['create']({'phone':_0x9623e1[_0x5140('0xb')],'ContactId':_0x9623e1['id'],'ListId':_0x9623e1[_0x5140('0x2f')],'scheduledat':_0x9623e1['scheduledat']?_0x9623e1[_0x5140('0x18')]:moment()[_0x5140('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x9623e1[_0x5140('0x28')]?_0x9623e1['priority']:0x2,'callback':_0x9623e1[_0x5140('0x29')]?!![]:![],'callbackuniqueid':_0x9623e1['callbackUniqueid']?_0x9623e1[_0x5140('0x29')]:undefined,'callbackat':_0x9623e1[_0x5140('0x29')]?moment()[_0x5140('0x19')](_0x5140('0x1a')):undefined,'VoiceQueueId':_0x27c3ad['id']})[_0x5140('0x2a')](_0x86e0c5());});}}}})[_0x5140('0x1f')](function(){return _0x13933a['VoiceQueue'][_0x5140('0x36')]({'where':{'type':_0x5140('0x37')},'attributes':['id'],'include':[{'model':_0x13933a[_0x5140('0x3c')],'as':_0x5140('0x3d'),'where':{'id':_0x9623e1[_0x5140('0x2f')]}}]})[_0x5140('0x1f')](function(_0x22dd1e){if(_0x22dd1e){var _0xe67648=[];for(var _0x2c1913=0x0,_0x30487b;_0x2c1913<_0x22dd1e[_0x5140('0x3a')];_0x2c1913+=0x1){_0x30487b=_0x22dd1e[_0x2c1913][_0x5140('0x14')]({'plain':!![]});_0x13933a[_0x5140('0x3e')][_0x5140('0x2e')]({'phone':_0x9623e1['phone'],'ContactId':_0x9623e1['id'],'ListId':_0x9623e1[_0x5140('0x2f')],'VoiceQueueId':_0x30487b['id']})['catch'](function(_0x1096cb){logger[_0x5140('0x15')](_0x5140('0x3f'),_0x5140('0x17'),_0x1096cb[_0x5140('0x40')]);});}}});})[_0x5140('0x1f')](function(){return _0x13933a[_0x5140('0x31')][_0x5140('0x36')]({'attributes':['id','dialCheckDuplicateType',_0x5140('0x1c')],'include':[{'model':_0x13933a[_0x5140('0x3c')],'as':_0x5140('0x39'),'where':{'id':_0x9623e1[_0x5140('0x2f')]}}]})['then'](function(_0xca8a00){if(_0xca8a00){var _0xf357a0=[];for(var _0x3fc6fa=0x0,_0x107b68;_0x3fc6fa<_0xca8a00[_0x5140('0x3a')];_0x3fc6fa+=0x1){_0x107b68=_0xca8a00[_0x3fc6fa][_0x5140('0x14')]({'plain':!![]});switch(_0x107b68[_0x5140('0x38')]){case _0x5140('0x3b'):_0x123019(_0x107b68)[_0x5140('0x2a')](_0x59d70c());break;case _0x5140('0x41'):_0x2c2e7(_0x107b68)[_0x5140('0x2a')](_0x59d70c());break;default:_0x13933a[_0x5140('0x27')][_0x5140('0x2e')]({'phone':_0x9623e1[_0x5140('0xb')],'ContactId':_0x9623e1['id'],'ListId':_0x9623e1[_0x5140('0x2f')],'scheduledat':_0x9623e1[_0x5140('0x18')]?_0x9623e1[_0x5140('0x18')]:moment()[_0x5140('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x9623e1[_0x5140('0x28')]?_0x9623e1[_0x5140('0x28')]:0x2,'callback':_0x9623e1['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x9623e1[_0x5140('0x29')]?_0x9623e1[_0x5140('0x29')]:undefined,'callbackat':_0x9623e1[_0x5140('0x29')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x107b68['id']})[_0x5140('0x2a')](_0x59d70c());}}}});})[_0x5140('0x1f')](function(){return _0x13933a[_0x5140('0x31')][_0x5140('0x36')]({'attributes':['id'],'include':[{'model':_0x13933a[_0x5140('0x3c')],'as':_0x5140('0x3d'),'where':{'id':_0x9623e1[_0x5140('0x2f')]}}]})[_0x5140('0x1f')](function(_0x474844){if(_0x474844){var _0x2c302d=[];for(var _0x141628=0x0,_0x1db2d5;_0x141628<_0x474844[_0x5140('0x3a')];_0x141628+=0x1){_0x1db2d5=_0x474844[_0x141628]['get']({'plain':!![]});_0x13933a[_0x5140('0x3e')][_0x5140('0x2e')]({'phone':_0x9623e1[_0x5140('0xb')],'ContactId':_0x9623e1['id'],'ListId':_0x9623e1[_0x5140('0x2f')],'CampaignId':_0x1db2d5['id']})['catch'](function(_0x421833){logger[_0x5140('0x15')](_0x5140('0x3f'),_0x5140('0x17'),_0x421833[_0x5140('0x40')]);});}}});})[_0x5140('0x1f')](function(){_0x1c9825();})[_0x5140('0x2a')](function(_0x4ba7de){logger['error'](_0x5140('0x3f'),'afterCreate',_0x4ba7de[_0x5140('0x40')]);_0x1c9825(_0x4ba7de);});}else{_0x1c9825(new Error(_0x5140('0x42')));}},'afterDestroy':function(_0x4698dc,_0x3a0588,_0x46cc36){var _0x3bc5d4=_0x5c3c17[_0x5140('0x13')];var _0x4879ef=_0x4698dc[_0x5140('0x14')]({'plain':!![]});return _0x3bc5d4[_0x5140('0x27')][_0x5140('0x36')]({'raw':!![],'where':{'ListId':_0x4879ef[_0x5140('0x2f')],'ContactId':_0x4879ef['id']}})[_0x5140('0x1f')](function(_0x24b0b3){if(!_[_0x5140('0x43')](_0x24b0b3)){var _0x2ed1ec=[];for(var _0x27ad32=0x0;_0x27ad32<_0x24b0b3[_0x5140('0x3a')];_0x27ad32+=0x1){var _0x26864c=_0x3bc5d4['CmHopper'][_0x5140('0x44')]({'where':{'ListId':_0x24b0b3[_0x27ad32]['ListId'],'ContactId':_0x24b0b3[_0x27ad32][_0x5140('0x45')],'VoiceQueueId':_0x24b0b3[_0x27ad32][_0x5140('0x46')],'CampaignId':_0x24b0b3[_0x27ad32][_0x5140('0x47')]}});_0x2ed1ec[_0x5140('0x48')](_0x26864c);}return BPromise[_0x5140('0x49')](_0x2ed1ec);}})[_0x5140('0x1f')](function(_0x350f3b){logger['info'](_0x5140('0x4a'),util[_0x5140('0x30')](_0x350f3b,{'showHidden':![],'depth':null}));_0x46cc36();})['catch'](function(_0x119daf){logger[_0x5140('0x15')](_0x5140('0x4b'),util['inspect'](_0x119daf,{'showHidden':![],'depth':null}));_0x46cc36(_0x119daf);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 5ea2b1d..1bb4ff8 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(_0x46fb50,_0x2f44aa){var _0x4b7a59=function(_0x5e3358){while(--_0x5e3358){_0x46fb50['push'](_0x46fb50['shift']());}};_0x4b7a59(++_0x2f44aa);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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(_0x576279,_0x13b1d7){var _0x490848=function(_0x3da626){while(--_0x3da626){_0x576279['push'](_0x576279['shift']());}};_0x490848(++_0x13b1d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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 05de8e4..b118920 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 _0x8ce3=['sequelize','exports','STRING','INTEGER','PHONE'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x8ce3,0xc3));var _0x38ce=function(_0x38d672,_0xc41411){_0x38d672=_0x38d672-0x0;var _0x33b0ca=_0x8ce3[_0x38d672];return _0x33b0ca;};'use strict';var Sequelize=require(_0x38ce('0x0'));module[_0x38ce('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x38ce('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x38ce('0x3')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x38ce('0x2')],'defaultValue':_0x38ce('0x4')},'OrderBy':{'type':Sequelize[_0x38ce('0x3')],'defaultValue':null},'description':{'type':Sequelize[_0x38ce('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0xa74d=['INTEGER','STRING','PHONE','exports'];(function(_0xe0c564,_0x2ff569){var _0x32e0f6=function(_0x3fd0fc){while(--_0x3fd0fc){_0xe0c564['push'](_0xe0c564['shift']());}};_0x32e0f6(++_0x2ff569);}(_0xa74d,0x1cf));var _0xda74=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0xa74d[_0x265aa2];return _0x447a3a;};'use strict';var Sequelize=require('sequelize');module[_0xda74('0x0')]={'CmContactId':{'type':Sequelize[_0xda74('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0xda74('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xda74('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xda74('0x2')],'defaultValue':_0xda74('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0xda74('0x2')],'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 5bc995f..3872e4d 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 _0xc0b3=['send','index','map','CmContactHasItem','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','params','eml-format','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','json','offset','undefined','count','Content-Range','update','then','destroy','get','CmContactHasItems','UserProfileResource','end','error','stack','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc0b3,0x1aa));var _0x3c0b=function(_0x571c79,_0xbc9fc3){_0x571c79=_0x571c79-0x0;var _0x2aff70=_0xc0b3[_0x571c79];return _0x2aff70;};'use strict';var emlformat=require(_0x3c0b('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(_0x3c0b('0x1'));var Mustache=require(_0x3c0b('0x2'));var util=require(_0x3c0b('0x3'));var path=require(_0x3c0b('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3c0b('0x5'));var fs=require('fs');var fs_extra=require(_0x3c0b('0x6'));var _=require(_0x3c0b('0x7'));var squel=require('squel');var crypto=require(_0x3c0b('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x3c0b('0x9'));var toCsv=require(_0x3c0b('0xa'));var querystring=require(_0x3c0b('0xb'));var Papa=require(_0x3c0b('0xc'));var Redis=require(_0x3c0b('0xd'));var authService=require(_0x3c0b('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x3c0b('0xf'));var hardwareService=require(_0x3c0b('0x10'));var logger=require(_0x3c0b('0x11'))(_0x3c0b('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8d8ddd,_0x218661){_0x218661=_0x218661||0xcc;return function(_0x8e9dcf){if(_0x8e9dcf){return _0x8d8ddd[_0x3c0b('0x13')](_0x218661);}return _0x8d8ddd[_0x3c0b('0x14')](_0x218661)['end']();};}function respondWithResult(_0xcfad92,_0x846275){_0x846275=_0x846275||0xc8;return function(_0x2cdf65){if(_0x2cdf65){return _0xcfad92[_0x3c0b('0x14')](_0x846275)[_0x3c0b('0x15')](_0x2cdf65);}};}function respondWithFilteredResult(_0x17f52d,_0x254c17){return function(_0x2e8482){if(_0x2e8482){var _0x439a2b=typeof _0x254c17[_0x3c0b('0x16')]===_0x3c0b('0x17')&&typeof _0x254c17['limit']===_0x3c0b('0x17');var _0x477203=_0x2e8482['count'];var _0x29b12e=_0x439a2b?0x0:_0x254c17['offset'];var _0x150ffd=_0x439a2b?_0x2e8482[_0x3c0b('0x18')]:_0x254c17[_0x3c0b('0x16')]+_0x254c17['limit'];var _0x580f8b;if(_0x150ffd>=_0x477203){_0x150ffd=_0x477203;_0x580f8b=0xc8;}else{_0x580f8b=0xce;}_0x17f52d[_0x3c0b('0x14')](_0x580f8b);return _0x17f52d['set'](_0x3c0b('0x19'),_0x29b12e+'-'+_0x150ffd+'/'+_0x477203)[_0x3c0b('0x15')](_0x2e8482);}return null;};}function patchUpdates(_0x1e1014){return function(_0x4b9394){try{jsonpatch['apply'](_0x4b9394,_0x1e1014,!![]);}catch(_0x1f11a9){return BPromise['reject'](_0x1f11a9);}return _0x4b9394['save']();};}function saveUpdates(_0x394754,_0x3d6b3e){return function(_0x47fd47){if(_0x47fd47){return _0x47fd47[_0x3c0b('0x1a')](_0x394754)[_0x3c0b('0x1b')](function(_0x422ca9){return _0x422ca9;});}return null;};}function removeEntity(_0x50cd1f,_0x2664c1){return function(_0x4cc3bf){if(_0x4cc3bf){return _0x4cc3bf[_0x3c0b('0x1c')]()[_0x3c0b('0x1b')](function(){var _0x2ebbed=_0x4cc3bf[_0x3c0b('0x1d')]({'plain':!![]});var _0x1d2c51=_0x3c0b('0x1e');return db[_0x3c0b('0x1f')]['destroy']({'where':{'type':_0x1d2c51,'resourceId':_0x2ebbed['id']}})['then'](function(){return _0x4cc3bf;});})[_0x3c0b('0x1b')](function(){_0x50cd1f[_0x3c0b('0x14')](0xcc)[_0x3c0b('0x20')]();});}};}function handleEntityNotFound(_0x3a9b04,_0x55e11f){return function(_0x329c8c){if(!_0x329c8c){_0x3a9b04[_0x3c0b('0x13')](0x194);}return _0x329c8c;};}function handleError(_0x105d1b,_0x2d52fc){_0x2d52fc=_0x2d52fc||0x1f4;return function(_0x5e59d9){logger[_0x3c0b('0x21')](_0x5e59d9[_0x3c0b('0x22')]);if(_0x5e59d9[_0x3c0b('0x23')]){delete _0x5e59d9[_0x3c0b('0x23')];}_0x105d1b['status'](_0x2d52fc)[_0x3c0b('0x24')](_0x5e59d9);};}exports[_0x3c0b('0x25')]=function(_0x3e968c,_0x2356dd){var _0x151127={},_0x4e8cbd={},_0x430379={'count':0x0,'rows':[]};var _0x2ea452=_[_0x3c0b('0x26')](db[_0x3c0b('0x27')][_0x3c0b('0x28')],function(_0x45cb38){return{'name':_0x45cb38['fieldName'],'type':_0x45cb38[_0x3c0b('0x29')][_0x3c0b('0x2a')]};});_0x4e8cbd[_0x3c0b('0x2b')]=_[_0x3c0b('0x26')](_0x2ea452,_0x3c0b('0x23'));_0x4e8cbd[_0x3c0b('0x2c')]=_[_0x3c0b('0x2d')](_0x3e968c['query']);_0x4e8cbd['filters']=_[_0x3c0b('0x2e')](_0x4e8cbd[_0x3c0b('0x2b')],_0x4e8cbd[_0x3c0b('0x2c')]);_0x151127[_0x3c0b('0x2f')]=_[_0x3c0b('0x2e')](_0x4e8cbd['model'],qs[_0x3c0b('0x30')](_0x3e968c['query'][_0x3c0b('0x30')]));_0x151127[_0x3c0b('0x2f')]=_0x151127['attributes'][_0x3c0b('0x31')]?_0x151127[_0x3c0b('0x2f')]:_0x4e8cbd[_0x3c0b('0x2b')];if(!_0x3e968c[_0x3c0b('0x2c')][_0x3c0b('0x32')](_0x3c0b('0x33'))){_0x151127[_0x3c0b('0x34')]=qs['limit'](_0x3e968c[_0x3c0b('0x2c')][_0x3c0b('0x34')]);_0x151127['offset']=qs[_0x3c0b('0x16')](_0x3e968c[_0x3c0b('0x2c')][_0x3c0b('0x16')]);}_0x151127[_0x3c0b('0x35')]=qs[_0x3c0b('0x36')](_0x3e968c[_0x3c0b('0x2c')][_0x3c0b('0x36')]);_0x151127['where']=qs[_0x3c0b('0x37')](_[_0x3c0b('0x38')](_0x3e968c[_0x3c0b('0x2c')],_0x4e8cbd[_0x3c0b('0x37')]),_0x2ea452);if(_0x3e968c[_0x3c0b('0x2c')][_0x3c0b('0x39')]){_0x151127[_0x3c0b('0x3a')]=_[_0x3c0b('0x3b')](_0x151127['where'],{'$or':_[_0x3c0b('0x26')](_0x2ea452,function(_0x207382){if(_0x207382[_0x3c0b('0x29')]!=='VIRTUAL'){var _0x32b6ae={};_0x32b6ae[_0x207382[_0x3c0b('0x23')]]={'$like':'%'+_0x3e968c[_0x3c0b('0x2c')][_0x3c0b('0x39')]+'%'};return _0x32b6ae;}})});}_0x151127=_[_0x3c0b('0x3b')]({},_0x151127,_0x3e968c[_0x3c0b('0x3c')]);var _0x4a2332={'where':_0x151127['where']};return db[_0x3c0b('0x27')][_0x3c0b('0x18')](_0x4a2332)[_0x3c0b('0x1b')](function(_0x318f91){_0x430379[_0x3c0b('0x18')]=_0x318f91;if(_0x3e968c['query'][_0x3c0b('0x3d')]){_0x151127[_0x3c0b('0x3e')]=[{'all':!![]}];}return db[_0x3c0b('0x27')][_0x3c0b('0x3f')](_0x151127);})[_0x3c0b('0x1b')](function(_0x257ebd){_0x430379[_0x3c0b('0x40')]=_0x257ebd;return _0x430379;})[_0x3c0b('0x1b')](respondWithFilteredResult(_0x2356dd,_0x151127))['catch'](handleError(_0x2356dd,null));};exports[_0x3c0b('0x41')]=function(_0x3eb88b,_0x41b27b){var _0x27b0e5={'raw':!![],'where':{'id':_0x3eb88b['params']['id']}},_0x2d77bf={};_0x2d77bf['model']=_[_0x3c0b('0x2d')](db[_0x3c0b('0x27')]['rawAttributes']);_0x2d77bf[_0x3c0b('0x2c')]=_[_0x3c0b('0x2d')](_0x3eb88b[_0x3c0b('0x2c')]);_0x2d77bf[_0x3c0b('0x37')]=_[_0x3c0b('0x2e')](_0x2d77bf[_0x3c0b('0x2b')],_0x2d77bf[_0x3c0b('0x2c')]);_0x27b0e5[_0x3c0b('0x2f')]=_['intersection'](_0x2d77bf[_0x3c0b('0x2b')],qs[_0x3c0b('0x30')](_0x3eb88b['query'][_0x3c0b('0x30')]));_0x27b0e5['attributes']=_0x27b0e5[_0x3c0b('0x2f')]['length']?_0x27b0e5[_0x3c0b('0x2f')]:_0x2d77bf[_0x3c0b('0x2b')];if(_0x3eb88b[_0x3c0b('0x2c')][_0x3c0b('0x3d')]){_0x27b0e5['include']=[{'all':!![]}];}_0x27b0e5=_[_0x3c0b('0x3b')]({},_0x27b0e5,_0x3eb88b[_0x3c0b('0x3c')]);return db[_0x3c0b('0x27')]['find'](_0x27b0e5)['then'](handleEntityNotFound(_0x41b27b,null))[_0x3c0b('0x1b')](respondWithResult(_0x41b27b,null))[_0x3c0b('0x42')](handleError(_0x41b27b,null));};exports[_0x3c0b('0x43')]=function(_0x5cc08a,_0x47f345){return db[_0x3c0b('0x27')][_0x3c0b('0x43')](_0x5cc08a[_0x3c0b('0x44')],{})['then'](function(_0x11ee31){var _0x59d551=_0x5cc08a[_0x3c0b('0x45')]['get']({'plain':!![]});if(!_0x59d551)throw new Error(_0x3c0b('0x46'));if(_0x59d551[_0x3c0b('0x47')]===_0x3c0b('0x45')){var _0x136715=_0x11ee31['get']({'plain':!![]});var _0x4da9fd=_0x3c0b('0x1e');return db[_0x3c0b('0x48')][_0x3c0b('0x49')]({'where':{'name':_0x4da9fd,'userProfileId':_0x59d551[_0x3c0b('0x4a')]},'raw':!![]})[_0x3c0b('0x1b')](function(_0x1e30d8){if(_0x1e30d8&&_0x1e30d8[_0x3c0b('0x4b')]===0x0){return db[_0x3c0b('0x1f')][_0x3c0b('0x43')]({'name':_0x136715[_0x3c0b('0x23')],'resourceId':_0x136715['id'],'type':_0x1e30d8[_0x3c0b('0x23')],'sectionId':_0x1e30d8['id']},{})['then'](function(){return _0x11ee31;});}else{return _0x11ee31;}})['catch'](function(_0xe3a63e){logger[_0x3c0b('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe3a63e);throw _0xe3a63e;});}return _0x11ee31;})[_0x3c0b('0x1b')](respondWithResult(_0x47f345,0xc9))[_0x3c0b('0x42')](handleError(_0x47f345,null));};exports[_0x3c0b('0x1a')]=function(_0x54a951,_0x412cb9){if(_0x54a951[_0x3c0b('0x44')]['id']){delete _0x54a951[_0x3c0b('0x44')]['id'];}return db[_0x3c0b('0x27')][_0x3c0b('0x49')]({'where':{'id':_0x54a951[_0x3c0b('0x4c')]['id']}})[_0x3c0b('0x1b')](handleEntityNotFound(_0x412cb9,null))['then'](saveUpdates(_0x54a951[_0x3c0b('0x44')],null))['then'](respondWithResult(_0x412cb9,null))[_0x3c0b('0x42')](handleError(_0x412cb9,null));};exports[_0x3c0b('0x1c')]=function(_0x2911af,_0x54ce97){return db[_0x3c0b('0x27')]['find']({'where':{'id':_0x2911af[_0x3c0b('0x4c')]['id']}})[_0x3c0b('0x1b')](handleEntityNotFound(_0x54ce97,null))[_0x3c0b('0x1b')](removeEntity(_0x54ce97,null))[_0x3c0b('0x42')](handleError(_0x54ce97,null));}; \ No newline at end of file +var _0x3250=['CmContactHasItem','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CmContactHasItems','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','error','name','send','index'];(function(_0xff6648,_0x40608e){var _0x2b6b96=function(_0x145031){while(--_0x145031){_0xff6648['push'](_0xff6648['shift']());}};_0x2b6b96(++_0x40608e);}(_0x3250,0x1cd));var _0x0325=function(_0x3f959d,_0x2569aa){_0x3f959d=_0x3f959d-0x0;var _0x17cbdc=_0x3250[_0x3f959d];return _0x17cbdc;};'use strict';var emlformat=require(_0x0325('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0325('0x1'));var jsonpatch=require(_0x0325('0x2'));var rp=require(_0x0325('0x3'));var moment=require(_0x0325('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0325('0x5'));var path=require('path');var sox=require(_0x0325('0x6'));var csv=require(_0x0325('0x7'));var ejs=require(_0x0325('0x8'));var fs=require('fs');var fs_extra=require(_0x0325('0x9'));var _=require('lodash');var squel=require(_0x0325('0xa'));var crypto=require('crypto');var jsforce=require(_0x0325('0xb'));var deskjs=require(_0x0325('0xc'));var toCsv=require(_0x0325('0x7'));var querystring=require(_0x0325('0xd'));var Papa=require(_0x0325('0xe'));var Redis=require(_0x0325('0xf'));var authService=require(_0x0325('0x10'));var qs=require(_0x0325('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0325('0x12'));var logger=require('../../config/logger')(_0x0325('0x13'));var utils=require(_0x0325('0x14'));var config=require(_0x0325('0x15'));var licenseUtil=require(_0x0325('0x16'));var db=require(_0x0325('0x17'))['db'];function respondWithStatusCode(_0x3a3164,_0x4f35b5){_0x4f35b5=_0x4f35b5||0xcc;return function(_0x451c87){if(_0x451c87){return _0x3a3164[_0x0325('0x18')](_0x4f35b5);}return _0x3a3164[_0x0325('0x19')](_0x4f35b5)[_0x0325('0x1a')]();};}function respondWithResult(_0x376993,_0x1ba6c9){_0x1ba6c9=_0x1ba6c9||0xc8;return function(_0x2b1074){if(_0x2b1074){return _0x376993[_0x0325('0x19')](_0x1ba6c9)[_0x0325('0x1b')](_0x2b1074);}};}function respondWithFilteredResult(_0x1433d7,_0x504cc6){return function(_0x4ff1f5){if(_0x4ff1f5){var _0x116db4=typeof _0x504cc6[_0x0325('0x1c')]===_0x0325('0x1d')&&typeof _0x504cc6[_0x0325('0x1e')]===_0x0325('0x1d');var _0x43cb5b=_0x4ff1f5['count'];var _0x1388b7=_0x116db4?0x0:_0x504cc6['offset'];var _0x44678a=_0x116db4?_0x4ff1f5[_0x0325('0x1f')]:_0x504cc6[_0x0325('0x1c')]+_0x504cc6[_0x0325('0x1e')];var _0x5a4649;if(_0x44678a>=_0x43cb5b){_0x44678a=_0x43cb5b;_0x5a4649=0xc8;}else{_0x5a4649=0xce;}_0x1433d7[_0x0325('0x19')](_0x5a4649);return _0x1433d7['set'](_0x0325('0x20'),_0x1388b7+'-'+_0x44678a+'/'+_0x43cb5b)[_0x0325('0x1b')](_0x4ff1f5);}return null;};}function patchUpdates(_0x15ec84){return function(_0x592c42){try{jsonpatch['apply'](_0x592c42,_0x15ec84,!![]);}catch(_0x50918f){return BPromise[_0x0325('0x21')](_0x50918f);}return _0x592c42[_0x0325('0x22')]();};}function saveUpdates(_0x1c5dc6,_0x183c9e){return function(_0x2edf02){if(_0x2edf02){return _0x2edf02[_0x0325('0x23')](_0x1c5dc6)[_0x0325('0x24')](function(_0x562996){return _0x562996;});}return null;};}function removeEntity(_0xcf19b4,_0x10153d){return function(_0x5d2745){if(_0x5d2745){return _0x5d2745[_0x0325('0x25')]()[_0x0325('0x24')](function(){var _0x477926=_0x5d2745[_0x0325('0x26')]({'plain':!![]});var _0x2ec30d='CmContactHasItems';return db['UserProfileResource']['destroy']({'where':{'type':_0x2ec30d,'resourceId':_0x477926['id']}})[_0x0325('0x24')](function(){return _0x5d2745;});})[_0x0325('0x24')](function(){_0xcf19b4[_0x0325('0x19')](0xcc)[_0x0325('0x1a')]();});}};}function handleEntityNotFound(_0x222d5a,_0x5025c3){return function(_0x505064){if(!_0x505064){_0x222d5a[_0x0325('0x18')](0x194);}return _0x505064;};}function handleError(_0x280e6a,_0x578eb0){_0x578eb0=_0x578eb0||0x1f4;return function(_0x235934){logger[_0x0325('0x27')](_0x235934['stack']);if(_0x235934[_0x0325('0x28')]){delete _0x235934[_0x0325('0x28')];}_0x280e6a[_0x0325('0x19')](_0x578eb0)[_0x0325('0x29')](_0x235934);};}exports[_0x0325('0x2a')]=function(_0x5713ae,_0x43e443){var _0x43fdd3={},_0x5a3a50={},_0x3ffdc6={'count':0x0,'rows':[]};var _0x18ff83=_['map'](db[_0x0325('0x2b')][_0x0325('0x2c')],function(_0x4afa4f){return{'name':_0x4afa4f[_0x0325('0x2d')],'type':_0x4afa4f[_0x0325('0x2e')][_0x0325('0x2f')]};});_0x5a3a50['model']=_[_0x0325('0x30')](_0x18ff83,_0x0325('0x28'));_0x5a3a50[_0x0325('0x31')]=_[_0x0325('0x32')](_0x5713ae[_0x0325('0x31')]);_0x5a3a50['filters']=_[_0x0325('0x33')](_0x5a3a50[_0x0325('0x34')],_0x5a3a50[_0x0325('0x31')]);_0x43fdd3[_0x0325('0x35')]=_['intersection'](_0x5a3a50[_0x0325('0x34')],qs['fields'](_0x5713ae[_0x0325('0x31')]['fields']));_0x43fdd3[_0x0325('0x35')]=_0x43fdd3[_0x0325('0x35')][_0x0325('0x36')]?_0x43fdd3['attributes']:_0x5a3a50[_0x0325('0x34')];if(!_0x5713ae[_0x0325('0x31')][_0x0325('0x37')](_0x0325('0x38'))){_0x43fdd3[_0x0325('0x1e')]=qs[_0x0325('0x1e')](_0x5713ae['query']['limit']);_0x43fdd3[_0x0325('0x1c')]=qs[_0x0325('0x1c')](_0x5713ae['query'][_0x0325('0x1c')]);}_0x43fdd3[_0x0325('0x39')]=qs[_0x0325('0x3a')](_0x5713ae[_0x0325('0x31')][_0x0325('0x3a')]);_0x43fdd3['where']=qs[_0x0325('0x3b')](_['pick'](_0x5713ae[_0x0325('0x31')],_0x5a3a50[_0x0325('0x3b')]),_0x18ff83);if(_0x5713ae[_0x0325('0x31')][_0x0325('0x3c')]){_0x43fdd3[_0x0325('0x3d')]=_[_0x0325('0x3e')](_0x43fdd3[_0x0325('0x3d')],{'$or':_[_0x0325('0x30')](_0x18ff83,function(_0x1dd99a){if(_0x1dd99a['type']!==_0x0325('0x3f')){var _0x302657={};_0x302657[_0x1dd99a[_0x0325('0x28')]]={'$like':'%'+_0x5713ae[_0x0325('0x31')][_0x0325('0x3c')]+'%'};return _0x302657;}})});}_0x43fdd3=_['merge']({},_0x43fdd3,_0x5713ae[_0x0325('0x40')]);var _0x38d950={'where':_0x43fdd3[_0x0325('0x3d')]};return db[_0x0325('0x2b')][_0x0325('0x1f')](_0x38d950)[_0x0325('0x24')](function(_0x56a5ea){_0x3ffdc6[_0x0325('0x1f')]=_0x56a5ea;if(_0x5713ae[_0x0325('0x31')][_0x0325('0x41')]){_0x43fdd3[_0x0325('0x42')]=[{'all':!![]}];}return db[_0x0325('0x2b')][_0x0325('0x43')](_0x43fdd3);})[_0x0325('0x24')](function(_0x3d498f){_0x3ffdc6[_0x0325('0x44')]=_0x3d498f;return _0x3ffdc6;})['then'](respondWithFilteredResult(_0x43e443,_0x43fdd3))['catch'](handleError(_0x43e443,null));};exports[_0x0325('0x45')]=function(_0x3bbd6d,_0x20fbd7){var _0x407102={'raw':!![],'where':{'id':_0x3bbd6d[_0x0325('0x46')]['id']}},_0xf48268={};_0xf48268[_0x0325('0x34')]=_[_0x0325('0x32')](db[_0x0325('0x2b')]['rawAttributes']);_0xf48268[_0x0325('0x31')]=_[_0x0325('0x32')](_0x3bbd6d[_0x0325('0x31')]);_0xf48268[_0x0325('0x3b')]=_[_0x0325('0x33')](_0xf48268[_0x0325('0x34')],_0xf48268[_0x0325('0x31')]);_0x407102[_0x0325('0x35')]=_['intersection'](_0xf48268['model'],qs[_0x0325('0x47')](_0x3bbd6d[_0x0325('0x31')]['fields']));_0x407102[_0x0325('0x35')]=_0x407102[_0x0325('0x35')][_0x0325('0x36')]?_0x407102['attributes']:_0xf48268['model'];if(_0x3bbd6d['query'][_0x0325('0x41')]){_0x407102[_0x0325('0x42')]=[{'all':!![]}];}_0x407102=_[_0x0325('0x3e')]({},_0x407102,_0x3bbd6d[_0x0325('0x40')]);return db['CmContactHasItem'][_0x0325('0x48')](_0x407102)[_0x0325('0x24')](handleEntityNotFound(_0x20fbd7,null))[_0x0325('0x24')](respondWithResult(_0x20fbd7,null))[_0x0325('0x49')](handleError(_0x20fbd7,null));};exports[_0x0325('0x4a')]=function(_0x104525,_0x44d1e4){return db[_0x0325('0x2b')][_0x0325('0x4a')](_0x104525['body'],{})[_0x0325('0x24')](function(_0x2071f2){var _0x4474dd=_0x104525[_0x0325('0x4b')][_0x0325('0x26')]({'plain':!![]});if(!_0x4474dd)throw new Error(_0x0325('0x4c'));if(_0x4474dd['role']===_0x0325('0x4b')){var _0x254da6=_0x2071f2[_0x0325('0x26')]({'plain':!![]});var _0x2ef449=_0x0325('0x4d');return db[_0x0325('0x4e')][_0x0325('0x48')]({'where':{'name':_0x2ef449,'userProfileId':_0x4474dd[_0x0325('0x4f')]},'raw':!![]})[_0x0325('0x24')](function(_0x2189f1){if(_0x2189f1&&_0x2189f1[_0x0325('0x50')]===0x0){return db[_0x0325('0x51')]['create']({'name':_0x254da6[_0x0325('0x28')],'resourceId':_0x254da6['id'],'type':_0x2189f1[_0x0325('0x28')],'sectionId':_0x2189f1['id']},{})[_0x0325('0x24')](function(){return _0x2071f2;});}else{return _0x2071f2;}})[_0x0325('0x49')](function(_0x4ad52b){logger[_0x0325('0x27')](_0x0325('0x52'),_0x4ad52b);throw _0x4ad52b;});}return _0x2071f2;})[_0x0325('0x24')](respondWithResult(_0x44d1e4,0xc9))['catch'](handleError(_0x44d1e4,null));};exports[_0x0325('0x23')]=function(_0x1234b5,_0x448af2){if(_0x1234b5['body']['id']){delete _0x1234b5[_0x0325('0x53')]['id'];}return db[_0x0325('0x2b')][_0x0325('0x48')]({'where':{'id':_0x1234b5['params']['id']}})[_0x0325('0x24')](handleEntityNotFound(_0x448af2,null))[_0x0325('0x24')](saveUpdates(_0x1234b5[_0x0325('0x53')],null))[_0x0325('0x24')](respondWithResult(_0x448af2,null))[_0x0325('0x49')](handleError(_0x448af2,null));};exports['destroy']=function(_0x45e996,_0x179c79){return db[_0x0325('0x2b')][_0x0325('0x48')]({'where':{'id':_0x45e996[_0x0325('0x46')]['id']}})['then'](handleEntityNotFound(_0x179c79,null))[_0x0325('0x24')](removeEntity(_0x179c79,null))[_0x0325('0x49')](handleError(_0x179c79,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 5ec0987..6b7a212 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 _0x5c94=['./cmContactHasItem.attributes','define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2966de,_0xc756d5){var _0x4e75a2=function(_0x15b554){while(--_0x15b554){_0x2966de['push'](_0x2966de['shift']());}};_0x4e75a2(++_0xc756d5);}(_0x5c94,0x149));var _0x45c9=function(_0x7d248d,_0x32c0f7){_0x7d248d=_0x7d248d-0x0;var _0x48384a=_0x5c94[_0x7d248d];return _0x48384a;};'use strict';var _=require(_0x45c9('0x0'));var util=require(_0x45c9('0x1'));var logger=require(_0x45c9('0x2'))(_0x45c9('0x3'));var moment=require('moment');var BPromise=require(_0x45c9('0x4'));var rp=require(_0x45c9('0x5'));var fs=require('fs');var path=require(_0x45c9('0x6'));var rimraf=require(_0x45c9('0x7'));var config=require(_0x45c9('0x8'));var attributes=require(_0x45c9('0x9'));module['exports']=function(_0x52ad45,_0x4e3d30){return _0x52ad45[_0x45c9('0xa')](_0x45c9('0xb'),attributes,{'tableName':_0x45c9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb449=['./cmContactHasItem.attributes','exports','define','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xb449,0xf3));var _0x9b44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb449[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9b44('0x0'));var util=require(_0x9b44('0x1'));var logger=require(_0x9b44('0x2'))(_0x9b44('0x3'));var moment=require('moment');var BPromise=require(_0x9b44('0x4'));var rp=require(_0x9b44('0x5'));var fs=require('fs');var path=require(_0x9b44('0x6'));var rimraf=require(_0x9b44('0x7'));var config=require(_0x9b44('0x8'));var attributes=require(_0x9b44('0x9'));module[_0x9b44('0xa')]=function(_0x208a1d,_0x360a36){return _0x208a1d[_0x9b44('0xb')]('CmContactHasItem',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 aa73014..8b4ec20 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 _0xcbdd=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xcbdd,0x122));var _0xdcbd=function(_0x1857ce,_0x1ea90a){_0x1857ce=_0x1857ce-0x0;var _0x501d09=_0xcbdd[_0x1857ce];return _0x501d09;};'use strict';var _=require(_0xdcbd('0x0'));var util=require(_0xdcbd('0x1'));var moment=require(_0xdcbd('0x2'));var BPromise=require(_0xdcbd('0x3'));var rs=require(_0xdcbd('0x4'));var fs=require('fs');var Redis=require(_0xdcbd('0x5'));var db=require(_0xdcbd('0x6'))['db'];var utils=require(_0xdcbd('0x7'));var logger=require(_0xdcbd('0x8'))('rpc');var config=require(_0xdcbd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdcbd('0xa')][_0xdcbd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bab49,_0x177942,_0x35e781){return new BPromise(function(_0x5efe54,_0x213cdf){return client[_0xdcbd('0xc')](_0x5bab49,_0x35e781)['then'](function(_0x3a3736){logger[_0xdcbd('0xd')](_0xdcbd('0xe'),_0x177942,_0xdcbd('0xf'));logger[_0xdcbd('0x10')](_0xdcbd('0x11'),_0x177942,_0xdcbd('0xf'),JSON[_0xdcbd('0x12')](_0x3a3736));if(_0x3a3736[_0xdcbd('0x13')]){if(_0x3a3736[_0xdcbd('0x13')][_0xdcbd('0x14')]===0x1f4){logger['error'](_0xdcbd('0xe'),_0x177942,_0x3a3736[_0xdcbd('0x13')][_0xdcbd('0x15')]);return _0x213cdf(_0x3a3736[_0xdcbd('0x13')][_0xdcbd('0x15')]);}logger[_0xdcbd('0x13')](_0xdcbd('0xe'),_0x177942,_0x3a3736[_0xdcbd('0x13')][_0xdcbd('0x15')]);return _0x5efe54(_0x3a3736[_0xdcbd('0x13')][_0xdcbd('0x15')]);}else{logger[_0xdcbd('0xd')](_0xdcbd('0xe'),_0x177942,_0xdcbd('0xf'));_0x5efe54(_0x3a3736[_0xdcbd('0x16')][_0xdcbd('0x15')]);}})[_0xdcbd('0x17')](function(_0x1af17){logger['error'](_0xdcbd('0xe'),_0x177942,_0x1af17);_0x213cdf(_0x1af17);});});} \ No newline at end of file +var _0x9c47=['error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s'];(function(_0x5ca9d9,_0x124cdd){var _0x1cfd98=function(_0x5ef1a9){while(--_0x5ef1a9){_0x5ca9d9['push'](_0x5ca9d9['shift']());}};_0x1cfd98(++_0x124cdd);}(_0x9c47,0x18d));var _0x79c4=function(_0x1166fb,_0x4b4216){_0x1166fb=_0x1166fb-0x0;var _0x200613=_0x9c47[_0x1166fb];return _0x200613;};'use strict';var _=require(_0x79c4('0x0'));var util=require('util');var moment=require(_0x79c4('0x1'));var BPromise=require(_0x79c4('0x2'));var rs=require(_0x79c4('0x3'));var fs=require('fs');var Redis=require(_0x79c4('0x4'));var db=require(_0x79c4('0x5'))['db'];var utils=require(_0x79c4('0x6'));var logger=require(_0x79c4('0x7'))('rpc');var config=require(_0x79c4('0x8'));var jayson=require(_0x79c4('0x9'));var client=jayson[_0x79c4('0xa')][_0x79c4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ca276,_0x50b490,_0x2fda0b){return new BPromise(function(_0x344765,_0x53768f){return client[_0x79c4('0xc')](_0x3ca276,_0x2fda0b)['then'](function(_0x72dafe){logger['info'](_0x79c4('0xd'),_0x50b490,_0x79c4('0xe'));logger[_0x79c4('0xf')](_0x79c4('0x10'),_0x50b490,_0x79c4('0xe'),JSON['stringify'](_0x72dafe));if(_0x72dafe['error']){if(_0x72dafe[_0x79c4('0x11')][_0x79c4('0x12')]===0x1f4){logger[_0x79c4('0x11')](_0x79c4('0xd'),_0x50b490,_0x72dafe[_0x79c4('0x11')][_0x79c4('0x13')]);return _0x53768f(_0x72dafe[_0x79c4('0x11')][_0x79c4('0x13')]);}logger[_0x79c4('0x11')](_0x79c4('0xd'),_0x50b490,_0x72dafe['error']['message']);return _0x344765(_0x72dafe[_0x79c4('0x11')][_0x79c4('0x13')]);}else{logger[_0x79c4('0x14')]('CmContactHasItem,\x20%s,\x20%s',_0x50b490,_0x79c4('0xe'));_0x344765(_0x72dafe[_0x79c4('0x15')][_0x79c4('0x13')]);}})[_0x79c4('0x16')](function(_0x2db500){logger[_0x79c4('0x11')](_0x79c4('0xd'),_0x50b490,_0x2db500);_0x53768f(_0x2db500);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index aa486e3..a6bd748 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 _0x1161=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','show','isAuthenticated','put','delete','destroy','exports'];(function(_0x4d45c1,_0x2beda1){var _0x244478=function(_0x11304c){while(--_0x11304c){_0x4d45c1['push'](_0x4d45c1['shift']());}};_0x244478(++_0x2beda1);}(_0x1161,0xf7));var _0x1116=function(_0x2b58f8,_0x14f865){_0x2b58f8=_0x2b58f8-0x0;var _0x2af05b=_0x1161[_0x2b58f8];return _0x2af05b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1116('0x0'));var router=express[_0x1116('0x1')]();var fs_extra=require(_0x1116('0x2'));var auth=require(_0x1116('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1116('0x4'));var controller=require('./cmContactHasItem.controller');router[_0x1116('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1116('0x5')](_0x1116('0x6'),auth['isAuthenticated'](),controller[_0x1116('0x7')]);router['post']('/',auth[_0x1116('0x8')](),controller['create']);router[_0x1116('0x9')](_0x1116('0x6'),auth[_0x1116('0x8')](),controller['update']);router[_0x1116('0xa')]('/:id',auth[_0x1116('0x8')](),controller[_0x1116('0xb')]);module[_0x1116('0xc')]=router; \ No newline at end of file +var _0xbedc=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xbedc,0x10a));var _0xcbed=function(_0x2b2970,_0x2c72c1){_0x2b2970=_0x2b2970-0x0;var _0x981e4f=_0xbedc[_0x2b2970];return _0x981e4f;};'use strict';var multer=require(_0xcbed('0x0'));var util=require(_0xcbed('0x1'));var path=require(_0xcbed('0x2'));var timeout=require(_0xcbed('0x3'));var express=require('express');var router=express[_0xcbed('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcbed('0x5'));var interaction=require(_0xcbed('0x6'));var config=require(_0xcbed('0x7'));var controller=require(_0xcbed('0x8'));router[_0xcbed('0x9')]('/',auth[_0xcbed('0xa')](),controller[_0xcbed('0xb')]);router[_0xcbed('0x9')](_0xcbed('0xc'),auth[_0xcbed('0xa')](),controller[_0xcbed('0xd')]);router[_0xcbed('0xe')]('/',auth[_0xcbed('0xa')](),controller[_0xcbed('0xf')]);router[_0xcbed('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xcbed('0x11')](_0xcbed('0xc'),auth[_0xcbed('0xa')](),controller['destroy']);module[_0xcbed('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 27931fa..ef1f76c 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 _0x9b30=['stringify','BOOLEAN','ENUM','voice','sequelize','VIRTUAL','getDataValue','setDataValue','alias','STRING','TEXT','type','select','values'];(function(_0x4c11e9,_0x5bfed4){var _0x42b375=function(_0x179657){while(--_0x179657){_0x4c11e9['push'](_0x4c11e9['shift']());}};_0x42b375(++_0x5bfed4);}(_0x9b30,0x162));var _0x09b3=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0x9b30[_0x234ae1];return _0x227ba0;};'use strict';var Sequelize=require(_0x09b3('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x09b3('0x1')],'get':function(_0x26640e){return this[_0x09b3('0x2')]('alias');}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x2763dd){this[_0x09b3('0x3')](_0x09b3('0x4'),_0x2763dd?_0x2763dd:this[_0x09b3('0x2')]('name'));}},'type':{'type':Sequelize[_0x09b3('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x09b3('0x6')]('long'),'get':function(){if(this[_0x09b3('0x2')](_0x09b3('0x7'))===_0x09b3('0x8')){return JSON['parse'](this[_0x09b3('0x2')](_0x09b3('0x9')));}else{return this[_0x09b3('0x2')](_0x09b3('0x9'));}},'set':function(_0x17c6b9){if(Array['isArray'](_0x17c6b9)){this[_0x09b3('0x3')](_0x09b3('0x9'),JSON[_0x09b3('0xa')](_0x17c6b9));}else{this[_0x09b3('0x3')](_0x09b3('0x9'),_0x17c6b9);}}},'required':{'type':Sequelize[_0x09b3('0xb')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x09b3('0xb')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x09b3('0xc')](_0x09b3('0xd'))}}; \ No newline at end of file +var _0x4cc1=['getDataValue','alias','setDataValue','name','STRING','long','type','select','parse','values','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL'];(function(_0x58e32c,_0x309781){var _0x481e60=function(_0x5326ab){while(--_0x5326ab){_0x58e32c['push'](_0x58e32c['shift']());}};_0x481e60(++_0x309781);}(_0x4cc1,0xe6));var _0x14cc=function(_0x2dacca,_0x3b55a5){_0x2dacca=_0x2dacca-0x0;var _0x4e8745=_0x4cc1[_0x2dacca];return _0x4e8745;};'use strict';var Sequelize=require(_0x14cc('0x0'));var _=require(_0x14cc('0x1'));module[_0x14cc('0x2')]={'name':{'type':Sequelize[_0x14cc('0x3')],'get':function(_0x1e3da4){return this[_0x14cc('0x4')](_0x14cc('0x5'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x2ea0c8){this[_0x14cc('0x6')](_0x14cc('0x5'),_0x2ea0c8?_0x2ea0c8:this[_0x14cc('0x4')](_0x14cc('0x7')));}},'type':{'type':Sequelize[_0x14cc('0x8')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x14cc('0x9')),'get':function(){if(this[_0x14cc('0x4')](_0x14cc('0xa'))===_0x14cc('0xb')){return JSON[_0x14cc('0xc')](this[_0x14cc('0x4')]('values'));}else{return this[_0x14cc('0x4')](_0x14cc('0xd'));}},'set':function(_0x1ae009){if(Array['isArray'](_0x1ae009)){this[_0x14cc('0x6')]('values',JSON[_0x14cc('0xe')](_0x1ae009));}else{this[_0x14cc('0x6')](_0x14cc('0xd'),_0x1ae009);}}},'required':{'type':Sequelize[_0x14cc('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x14cc('0x10')](_0x14cc('0x11'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 620bf45..74136b3 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 _0x33d6=['body','create','sequelize','Sequelize','TEXT','text','number','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','cf_%d','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','name','CmCustomField','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','length','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','options','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x33d6,0xad));var _0x633d=function(_0x5b553c,_0x30b06b){_0x5b553c=_0x5b553c-0x0;var _0x28a4e4=_0x33d6[_0x5b553c];return _0x28a4e4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x633d('0x0'));var zipdir=require(_0x633d('0x1'));var jsonpatch=require(_0x633d('0x2'));var rp=require('request-promise');var moment=require(_0x633d('0x3'));var BPromise=require(_0x633d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x633d('0x5'));var sox=require('sox');var csv=require(_0x633d('0x6'));var ejs=require(_0x633d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x633d('0x8'));var squel=require(_0x633d('0x9'));var crypto=require(_0x633d('0xa'));var jsforce=require(_0x633d('0xb'));var deskjs=require(_0x633d('0xc'));var toCsv=require(_0x633d('0x6'));var querystring=require('querystring');var Papa=require(_0x633d('0xd'));var Redis=require('ioredis');var authService=require(_0x633d('0xe'));var qs=require(_0x633d('0xf'));var as=require(_0x633d('0x10'));var hardwareService=require(_0x633d('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x633d('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x633d('0x13'))['db'];function respondWithStatusCode(_0xc68ed3,_0x54e734){_0x54e734=_0x54e734||0xcc;return function(_0x479b90){if(_0x479b90){return _0xc68ed3['sendStatus'](_0x54e734);}return _0xc68ed3[_0x633d('0x14')](_0x54e734)['end']();};}function respondWithResult(_0x63a22,_0x11089e){_0x11089e=_0x11089e||0xc8;return function(_0x290f02){if(_0x290f02){return _0x63a22[_0x633d('0x14')](_0x11089e)[_0x633d('0x15')](_0x290f02);}};}function respondWithFilteredResult(_0x3f8446,_0x259328){return function(_0xddfb9f){if(_0xddfb9f){var _0x194195=typeof _0x259328['offset']===_0x633d('0x16')&&typeof _0x259328[_0x633d('0x17')]==='undefined';var _0x234b5a=_0xddfb9f[_0x633d('0x18')];var _0x1656c3=_0x194195?0x0:_0x259328[_0x633d('0x19')];var _0x24d286=_0x194195?_0xddfb9f[_0x633d('0x18')]:_0x259328[_0x633d('0x19')]+_0x259328[_0x633d('0x17')];var _0x3561b9;if(_0x24d286>=_0x234b5a){_0x24d286=_0x234b5a;_0x3561b9=0xc8;}else{_0x3561b9=0xce;}_0x3f8446[_0x633d('0x14')](_0x3561b9);return _0x3f8446[_0x633d('0x1a')](_0x633d('0x1b'),_0x1656c3+'-'+_0x24d286+'/'+_0x234b5a)[_0x633d('0x15')](_0xddfb9f);}return null;};}function patchUpdates(_0x222ac2){return function(_0x3add34){try{jsonpatch[_0x633d('0x1c')](_0x3add34,_0x222ac2,!![]);}catch(_0x475b84){return BPromise[_0x633d('0x1d')](_0x475b84);}return _0x3add34[_0x633d('0x1e')]();};}function saveUpdates(_0x4863bc,_0xe80ba3){return function(_0x5b0276){if(_0x5b0276){return _0x5b0276[_0x633d('0x1f')](_0x4863bc)[_0x633d('0x20')](function(_0x2035be){return _0x2035be;});}return null;};}function removeEntity(_0x1b042b,_0xd0d36f){return function(_0x246740){if(_0x246740){return _0x246740['destroy']()[_0x633d('0x20')](function(){_0x1b042b[_0x633d('0x14')](0xcc)[_0x633d('0x21')]();});}};}function handleEntityNotFound(_0x58b48d,_0x28b0e2){return function(_0x284052){if(!_0x284052){_0x58b48d[_0x633d('0x22')](0x194);}return _0x284052;};}function handleError(_0x5222bb,_0x3180df){_0x3180df=_0x3180df||0x1f4;return function(_0x8b53fa){logger[_0x633d('0x23')](_0x8b53fa['stack']);if(_0x8b53fa[_0x633d('0x24')]){delete _0x8b53fa[_0x633d('0x24')];}_0x5222bb['status'](_0x3180df)['send'](_0x8b53fa);};}exports['index']=function(_0x26d4ce,_0x5d70b7){var _0x21de3e={},_0x101a12={},_0x444f59={'count':0x0,'rows':[]};var _0x544849=_['map'](db[_0x633d('0x25')]['rawAttributes'],function(_0x715016){return{'name':_0x715016[_0x633d('0x26')],'type':_0x715016[_0x633d('0x27')][_0x633d('0x28')]};});_0x101a12[_0x633d('0x29')]=_['differenceBy'](_[_0x633d('0x2a')](_0x544849,_0x633d('0x24')),[_0x633d('0x24')]);_0x101a12[_0x633d('0x2b')]=_[_0x633d('0x2c')](_0x26d4ce['query']);_0x101a12[_0x633d('0x2d')]=_['intersection'](_0x101a12[_0x633d('0x29')],_0x101a12['query']);_0x21de3e[_0x633d('0x2e')]=_[_0x633d('0x2f')](_0x101a12['model'],qs['fields'](_0x26d4ce[_0x633d('0x2b')]['fields']));_0x21de3e[_0x633d('0x2e')]=_0x21de3e[_0x633d('0x2e')][_0x633d('0x30')]?_0x21de3e['attributes']:_0x101a12[_0x633d('0x29')];if(!_0x26d4ce[_0x633d('0x2b')]['hasOwnProperty'](_0x633d('0x31'))){_0x21de3e[_0x633d('0x17')]=qs[_0x633d('0x17')](_0x26d4ce['query'][_0x633d('0x17')]);_0x21de3e['offset']=qs[_0x633d('0x19')](_0x26d4ce[_0x633d('0x2b')][_0x633d('0x19')]);}_0x21de3e[_0x633d('0x32')]=qs['sort'](_0x26d4ce['query'][_0x633d('0x33')]);_0x21de3e['where']=qs[_0x633d('0x2d')](_['pick'](_0x26d4ce[_0x633d('0x2b')],_0x101a12[_0x633d('0x2d')]),_0x544849);if(_0x26d4ce[_0x633d('0x2b')][_0x633d('0x34')]){_0x21de3e[_0x633d('0x35')]=_[_0x633d('0x36')](_0x21de3e[_0x633d('0x35')],{'$or':_[_0x633d('0x2a')](_0x544849,function(_0xf7d236){if(_0xf7d236[_0x633d('0x27')]!==_0x633d('0x37')){var _0x3ee7d1={};_0x3ee7d1[_0xf7d236[_0x633d('0x24')]]={'$like':'%'+_0x26d4ce[_0x633d('0x2b')][_0x633d('0x34')]+'%'};return _0x3ee7d1;}})});}_0x21de3e=_[_0x633d('0x36')]({},_0x21de3e,_0x26d4ce['options']);var _0x56ef35={'where':_0x21de3e[_0x633d('0x35')]};return db[_0x633d('0x25')][_0x633d('0x18')](_0x56ef35)[_0x633d('0x20')](function(_0x19698e){_0x444f59[_0x633d('0x18')]=_0x19698e;if(_0x26d4ce[_0x633d('0x2b')][_0x633d('0x38')]){_0x21de3e[_0x633d('0x39')]=[{'all':!![]}];}return db[_0x633d('0x25')][_0x633d('0x3a')](_0x21de3e);})[_0x633d('0x20')](function(_0x41b00f){_0x444f59[_0x633d('0x3b')]=_0x41b00f;return _0x444f59;})[_0x633d('0x20')](respondWithFilteredResult(_0x5d70b7,_0x21de3e))[_0x633d('0x3c')](handleError(_0x5d70b7,null));};exports[_0x633d('0x3d')]=function(_0x259f3f,_0x25c1de){var _0x4ad8eb={'raw':!![],'where':{'id':_0x259f3f[_0x633d('0x3e')]['id']}},_0x31f091={};_0x31f091[_0x633d('0x29')]=_[_0x633d('0x2c')](db[_0x633d('0x25')][_0x633d('0x3f')]);_0x31f091[_0x633d('0x2b')]=_[_0x633d('0x2c')](_0x259f3f[_0x633d('0x2b')]);_0x31f091[_0x633d('0x2d')]=_[_0x633d('0x2f')](_0x31f091[_0x633d('0x29')],_0x31f091[_0x633d('0x2b')]);_0x4ad8eb[_0x633d('0x2e')]=_[_0x633d('0x2f')](_0x31f091[_0x633d('0x29')],qs[_0x633d('0x40')](_0x259f3f[_0x633d('0x2b')][_0x633d('0x40')]));_0x4ad8eb[_0x633d('0x2e')]=_0x4ad8eb[_0x633d('0x2e')][_0x633d('0x30')]?_0x4ad8eb[_0x633d('0x2e')]:_0x31f091['model'];if(_0x259f3f['query']['includeAll']){_0x4ad8eb['include']=[{'all':!![]}];}_0x4ad8eb=_[_0x633d('0x36')]({},_0x4ad8eb,_0x259f3f[_0x633d('0x41')]);return db[_0x633d('0x25')][_0x633d('0x42')](_0x4ad8eb)[_0x633d('0x20')](handleEntityNotFound(_0x25c1de,null))[_0x633d('0x20')](respondWithResult(_0x25c1de,null))[_0x633d('0x3c')](handleError(_0x25c1de,null));};exports['update']=function(_0x2f4922,_0x22ec23){if(_0x2f4922[_0x633d('0x43')]['id']){delete _0x2f4922[_0x633d('0x43')]['id'];}return db[_0x633d('0x25')][_0x633d('0x42')]({'where':{'id':_0x2f4922[_0x633d('0x3e')]['id']}})[_0x633d('0x20')](handleEntityNotFound(_0x22ec23,null))['then'](saveUpdates(_0x2f4922[_0x633d('0x43')],null))[_0x633d('0x20')](respondWithResult(_0x22ec23,null))[_0x633d('0x3c')](handleError(_0x22ec23,null));};exports['destroy']=function(_0x3c7c6e,_0x5d117a){return db[_0x633d('0x25')][_0x633d('0x42')]({'where':{'id':_0x3c7c6e[_0x633d('0x3e')]['id']}})[_0x633d('0x20')](handleEntityNotFound(_0x5d117a,null))[_0x633d('0x20')](removeEntity(_0x5d117a,null))[_0x633d('0x3c')](handleError(_0x5d117a,null));};exports[_0x633d('0x44')]=function(_0x293a55,_0x19a1b4){var _0x49e0e3;return db[_0x633d('0x45')]['transaction'](function(_0x4da54a){return db[_0x633d('0x25')][_0x633d('0x44')](_0x293a55[_0x633d('0x43')],{'transaction':_0x4da54a})[_0x633d('0x20')](function(_0x56d5d3){_0x49e0e3=_0x56d5d3;var _0x36984c={'type':db[_0x633d('0x46')][_0x633d('0x47')],'transaction':_0x4da54a};switch(_0x293a55[_0x633d('0x43')][_0x633d('0x27')]){case _0x633d('0x48'):_0x36984c[_0x633d('0x27')]=db[_0x633d('0x46')][_0x633d('0x47')];break;case _0x633d('0x49'):_0x36984c[_0x633d('0x27')]=db[_0x633d('0x46')]['INTEGER'];break;case _0x633d('0x4a'):_0x36984c['type']=db['Sequelize'][_0x633d('0x4b')];_0x36984c['defaultValue']=![];break;default:}return db[_0x633d('0x45')][_0x633d('0x4c')][_0x633d('0x4d')](_0x633d('0x4e'),util['format'](_0x633d('0x4f'),_0x49e0e3['id']),_0x36984c);})[_0x633d('0x20')](function(){return _0x49e0e3;});})[_0x633d('0x20')](respondWithResult(_0x19a1b4,0xc9))['catch'](handleError(_0x19a1b4,null));}; \ No newline at end of file +var _0xf751=['limit','set','apply','save','update','then','destroy','stack','name','send','map','fieldName','type','differenceBy','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','CmCustomField','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','body','sequelize','create','Sequelize','text','TEXT','number','addColumn','cm_contacts','format','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count'];(function(_0x3d66c9,_0x3077ff){var _0x292af8=function(_0x40745a){while(--_0x40745a){_0x3d66c9['push'](_0x3d66c9['shift']());}};_0x292af8(++_0x3077ff);}(_0xf751,0x132));var _0x1f75=function(_0xefd2fd,_0x3a8047){_0xefd2fd=_0xefd2fd-0x0;var _0x391cbe=_0xf751[_0xefd2fd];return _0x391cbe;};'use strict';var emlformat=require(_0x1f75('0x0'));var rimraf=require(_0x1f75('0x1'));var zipdir=require(_0x1f75('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1f75('0x3'));var moment=require(_0x1f75('0x4'));var BPromise=require(_0x1f75('0x5'));var Mustache=require(_0x1f75('0x6'));var util=require('util');var path=require(_0x1f75('0x7'));var sox=require(_0x1f75('0x8'));var csv=require('to-csv');var ejs=require(_0x1f75('0x9'));var fs=require('fs');var fs_extra=require(_0x1f75('0xa'));var _=require(_0x1f75('0xb'));var squel=require(_0x1f75('0xc'));var crypto=require(_0x1f75('0xd'));var jsforce=require(_0x1f75('0xe'));var deskjs=require(_0x1f75('0xf'));var toCsv=require(_0x1f75('0x10'));var querystring=require(_0x1f75('0x11'));var Papa=require('papaparse');var Redis=require(_0x1f75('0x12'));var authService=require(_0x1f75('0x13'));var qs=require(_0x1f75('0x14'));var as=require(_0x1f75('0x15'));var hardwareService=require(_0x1f75('0x16'));var logger=require(_0x1f75('0x17'))(_0x1f75('0x18'));var utils=require(_0x1f75('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x1f75('0x1a'));var db=require(_0x1f75('0x1b'))['db'];function respondWithStatusCode(_0xfc0ea9,_0x5582da){_0x5582da=_0x5582da||0xcc;return function(_0x325c19){if(_0x325c19){return _0xfc0ea9[_0x1f75('0x1c')](_0x5582da);}return _0xfc0ea9[_0x1f75('0x1d')](_0x5582da)['end']();};}function respondWithResult(_0x3b75b9,_0x586842){_0x586842=_0x586842||0xc8;return function(_0x46e8af){if(_0x46e8af){return _0x3b75b9[_0x1f75('0x1d')](_0x586842)[_0x1f75('0x1e')](_0x46e8af);}};}function respondWithFilteredResult(_0x4286f1,_0x52886f){return function(_0x4c8a20){if(_0x4c8a20){var _0x2db0d9=typeof _0x52886f[_0x1f75('0x1f')]===_0x1f75('0x20')&&typeof _0x52886f['limit']===_0x1f75('0x20');var _0x494522=_0x4c8a20[_0x1f75('0x21')];var _0x3b3c03=_0x2db0d9?0x0:_0x52886f['offset'];var _0x25f3a9=_0x2db0d9?_0x4c8a20['count']:_0x52886f[_0x1f75('0x1f')]+_0x52886f[_0x1f75('0x22')];var _0x4fc6dd;if(_0x25f3a9>=_0x494522){_0x25f3a9=_0x494522;_0x4fc6dd=0xc8;}else{_0x4fc6dd=0xce;}_0x4286f1[_0x1f75('0x1d')](_0x4fc6dd);return _0x4286f1[_0x1f75('0x23')]('Content-Range',_0x3b3c03+'-'+_0x25f3a9+'/'+_0x494522)[_0x1f75('0x1e')](_0x4c8a20);}return null;};}function patchUpdates(_0x5119ba){return function(_0x5d871d){try{jsonpatch[_0x1f75('0x24')](_0x5d871d,_0x5119ba,!![]);}catch(_0x2ccdf0){return BPromise['reject'](_0x2ccdf0);}return _0x5d871d[_0x1f75('0x25')]();};}function saveUpdates(_0x512645,_0x4e3892){return function(_0xa57176){if(_0xa57176){return _0xa57176[_0x1f75('0x26')](_0x512645)[_0x1f75('0x27')](function(_0x4bb299){return _0x4bb299;});}return null;};}function removeEntity(_0x355f1a,_0x46b746){return function(_0x55db55){if(_0x55db55){return _0x55db55[_0x1f75('0x28')]()[_0x1f75('0x27')](function(){_0x355f1a[_0x1f75('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44eda3,_0x22e5fb){return function(_0x1ed9ee){if(!_0x1ed9ee){_0x44eda3[_0x1f75('0x1c')](0x194);}return _0x1ed9ee;};}function handleError(_0x131290,_0x569102){_0x569102=_0x569102||0x1f4;return function(_0x541e7f){logger['error'](_0x541e7f[_0x1f75('0x29')]);if(_0x541e7f[_0x1f75('0x2a')]){delete _0x541e7f[_0x1f75('0x2a')];}_0x131290[_0x1f75('0x1d')](_0x569102)[_0x1f75('0x2b')](_0x541e7f);};}exports['index']=function(_0x3253cd,_0x4f1192){var _0x14011f={},_0x2dccdd={},_0x183d00={'count':0x0,'rows':[]};var _0x3e791b=_[_0x1f75('0x2c')](db['CmCustomField']['rawAttributes'],function(_0x596f8f){return{'name':_0x596f8f[_0x1f75('0x2d')],'type':_0x596f8f[_0x1f75('0x2e')]['key']};});_0x2dccdd['model']=_[_0x1f75('0x2f')](_[_0x1f75('0x2c')](_0x3e791b,_0x1f75('0x2a')),['name']);_0x2dccdd[_0x1f75('0x30')]=_[_0x1f75('0x31')](_0x3253cd[_0x1f75('0x30')]);_0x2dccdd[_0x1f75('0x32')]=_[_0x1f75('0x33')](_0x2dccdd[_0x1f75('0x34')],_0x2dccdd[_0x1f75('0x30')]);_0x14011f[_0x1f75('0x35')]=_[_0x1f75('0x33')](_0x2dccdd['model'],qs[_0x1f75('0x36')](_0x3253cd[_0x1f75('0x30')][_0x1f75('0x36')]));_0x14011f[_0x1f75('0x35')]=_0x14011f['attributes'][_0x1f75('0x37')]?_0x14011f[_0x1f75('0x35')]:_0x2dccdd[_0x1f75('0x34')];if(!_0x3253cd[_0x1f75('0x30')][_0x1f75('0x38')](_0x1f75('0x39'))){_0x14011f[_0x1f75('0x22')]=qs[_0x1f75('0x22')](_0x3253cd[_0x1f75('0x30')][_0x1f75('0x22')]);_0x14011f[_0x1f75('0x1f')]=qs[_0x1f75('0x1f')](_0x3253cd['query'][_0x1f75('0x1f')]);}_0x14011f[_0x1f75('0x3a')]=qs['sort'](_0x3253cd[_0x1f75('0x30')]['sort']);_0x14011f[_0x1f75('0x3b')]=qs[_0x1f75('0x32')](_[_0x1f75('0x3c')](_0x3253cd['query'],_0x2dccdd[_0x1f75('0x32')]),_0x3e791b);if(_0x3253cd[_0x1f75('0x30')][_0x1f75('0x3d')]){_0x14011f[_0x1f75('0x3b')]=_[_0x1f75('0x3e')](_0x14011f[_0x1f75('0x3b')],{'$or':_[_0x1f75('0x2c')](_0x3e791b,function(_0x155886){if(_0x155886[_0x1f75('0x2e')]!==_0x1f75('0x3f')){var _0x159049={};_0x159049[_0x155886[_0x1f75('0x2a')]]={'$like':'%'+_0x3253cd['query']['filter']+'%'};return _0x159049;}})});}_0x14011f=_['merge']({},_0x14011f,_0x3253cd[_0x1f75('0x40')]);var _0x399977={'where':_0x14011f[_0x1f75('0x3b')]};return db[_0x1f75('0x41')][_0x1f75('0x21')](_0x399977)['then'](function(_0x11df31){_0x183d00[_0x1f75('0x21')]=_0x11df31;if(_0x3253cd[_0x1f75('0x30')]['includeAll']){_0x14011f['include']=[{'all':!![]}];}return db[_0x1f75('0x41')][_0x1f75('0x42')](_0x14011f);})[_0x1f75('0x27')](function(_0x5452b5){_0x183d00[_0x1f75('0x43')]=_0x5452b5;return _0x183d00;})[_0x1f75('0x27')](respondWithFilteredResult(_0x4f1192,_0x14011f))[_0x1f75('0x44')](handleError(_0x4f1192,null));};exports[_0x1f75('0x45')]=function(_0x3825af,_0x4d9de8){var _0x213d93={'raw':!![],'where':{'id':_0x3825af[_0x1f75('0x46')]['id']}},_0x4768a0={};_0x4768a0[_0x1f75('0x34')]=_['keys'](db[_0x1f75('0x41')][_0x1f75('0x47')]);_0x4768a0[_0x1f75('0x30')]=_[_0x1f75('0x31')](_0x3825af[_0x1f75('0x30')]);_0x4768a0[_0x1f75('0x32')]=_['intersection'](_0x4768a0[_0x1f75('0x34')],_0x4768a0[_0x1f75('0x30')]);_0x213d93[_0x1f75('0x35')]=_[_0x1f75('0x33')](_0x4768a0[_0x1f75('0x34')],qs[_0x1f75('0x36')](_0x3825af[_0x1f75('0x30')][_0x1f75('0x36')]));_0x213d93[_0x1f75('0x35')]=_0x213d93[_0x1f75('0x35')][_0x1f75('0x37')]?_0x213d93[_0x1f75('0x35')]:_0x4768a0['model'];if(_0x3825af[_0x1f75('0x30')][_0x1f75('0x48')]){_0x213d93[_0x1f75('0x49')]=[{'all':!![]}];}_0x213d93=_[_0x1f75('0x3e')]({},_0x213d93,_0x3825af[_0x1f75('0x40')]);return db[_0x1f75('0x41')][_0x1f75('0x4a')](_0x213d93)['then'](handleEntityNotFound(_0x4d9de8,null))['then'](respondWithResult(_0x4d9de8,null))[_0x1f75('0x44')](handleError(_0x4d9de8,null));};exports['update']=function(_0x2b2bae,_0x3756a0){if(_0x2b2bae[_0x1f75('0x4b')]['id']){delete _0x2b2bae[_0x1f75('0x4b')]['id'];}return db[_0x1f75('0x41')]['find']({'where':{'id':_0x2b2bae[_0x1f75('0x46')]['id']}})[_0x1f75('0x27')](handleEntityNotFound(_0x3756a0,null))[_0x1f75('0x27')](saveUpdates(_0x2b2bae[_0x1f75('0x4b')],null))[_0x1f75('0x27')](respondWithResult(_0x3756a0,null))[_0x1f75('0x44')](handleError(_0x3756a0,null));};exports['destroy']=function(_0x5a778e,_0x3b51ac){return db[_0x1f75('0x41')][_0x1f75('0x4a')]({'where':{'id':_0x5a778e[_0x1f75('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b51ac,null))[_0x1f75('0x27')](removeEntity(_0x3b51ac,null))[_0x1f75('0x44')](handleError(_0x3b51ac,null));};exports['create']=function(_0x83a96a,_0x534792){var _0x1e6cd9;return db[_0x1f75('0x4c')]['transaction'](function(_0x5d59d7){return db['CmCustomField'][_0x1f75('0x4d')](_0x83a96a[_0x1f75('0x4b')],{'transaction':_0x5d59d7})[_0x1f75('0x27')](function(_0xf348f6){_0x1e6cd9=_0xf348f6;var _0x25104e={'type':db[_0x1f75('0x4e')]['TEXT'],'transaction':_0x5d59d7};switch(_0x83a96a[_0x1f75('0x4b')][_0x1f75('0x2e')]){case _0x1f75('0x4f'):_0x25104e['type']=db[_0x1f75('0x4e')][_0x1f75('0x50')];break;case _0x1f75('0x51'):_0x25104e['type']=db[_0x1f75('0x4e')]['INTEGER'];break;case'switch':_0x25104e[_0x1f75('0x2e')]=db[_0x1f75('0x4e')]['BOOLEAN'];_0x25104e['defaultValue']=![];break;default:}return db['sequelize']['queryInterface'][_0x1f75('0x52')](_0x1f75('0x53'),util[_0x1f75('0x54')]('cf_%d',_0x1e6cd9['id']),_0x25104e);})[_0x1f75('0x27')](function(){return _0x1e6cd9;});})['then'](respondWithResult(_0x534792,0xc9))[_0x1f75('0x44')](handleError(_0x534792,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 0d568d6..24ad547 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 _0xb059=['lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./cmCustomField.attributes','CmCustomField'];(function(_0x50d874,_0x5defbf){var _0xee453a=function(_0x3a1d34){while(--_0x3a1d34){_0x50d874['push'](_0x50d874['shift']());}};_0xee453a(++_0x5defbf);}(_0xb059,0x15f));var _0x9b05=function(_0x51a32d,_0x2d2326){_0x51a32d=_0x51a32d-0x0;var _0x3eec2d=_0xb059[_0x51a32d];return _0x3eec2d;};'use strict';var _=require(_0x9b05('0x0'));var util=require(_0x9b05('0x1'));var logger=require(_0x9b05('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9b05('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b05('0x4'));var rimraf=require(_0x9b05('0x5'));var config=require(_0x9b05('0x6'));var attributes=require(_0x9b05('0x7'));module['exports']=function(_0x4ef120,_0x238592){return _0x4ef120['define'](_0x9b05('0x8'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5b8=['lodash','api','moment','request-promise','path','rimraf','../../config/environment','define','CmCustomField','cm_custom_fields'];(function(_0x405248,_0x3fb406){var _0x3c5b73=function(_0x383df9){while(--_0x383df9){_0x405248['push'](_0x405248['shift']());}};_0x3c5b73(++_0x3fb406);}(_0xd5b8,0x14a));var _0x8d5b=function(_0x3a7927,_0x1e0251){_0x3a7927=_0x3a7927-0x0;var _0x4791cd=_0xd5b8[_0x3a7927];return _0x4791cd;};'use strict';var _=require(_0x8d5b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8d5b('0x1'));var moment=require(_0x8d5b('0x2'));var BPromise=require('bluebird');var rp=require(_0x8d5b('0x3'));var fs=require('fs');var path=require(_0x8d5b('0x4'));var rimraf=require(_0x8d5b('0x5'));var config=require(_0x8d5b('0x6'));var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x3a426b,_0x197bbc){return _0x3a426b[_0x8d5b('0x7')](_0x8d5b('0x8'),attributes,{'tableName':_0x8d5b('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 7823456..e18e686 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 _0x3f39=['client','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x234087,_0x57023a){var _0x20de31=function(_0x44fc99){while(--_0x44fc99){_0x234087['push'](_0x234087['shift']());}};_0x20de31(++_0x57023a);}(_0x3f39,0xf5));var _0x93f3=function(_0x3251e1,_0x232baf){_0x3251e1=_0x3251e1-0x0;var _0x17867a=_0x3f39[_0x3251e1];return _0x17867a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x93f3('0x0'));var BPromise=require(_0x93f3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x93f3('0x2'));var db=require(_0x93f3('0x3'))['db'];var utils=require(_0x93f3('0x4'));var logger=require(_0x93f3('0x5'))('rpc');var config=require(_0x93f3('0x6'));var jayson=require(_0x93f3('0x7'));var client=jayson[_0x93f3('0x8')][_0x93f3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1784e1,_0x2cb73b,_0x1a3e2e){return new BPromise(function(_0x49918a,_0x40fce0){return client[_0x93f3('0xa')](_0x1784e1,_0x1a3e2e)[_0x93f3('0xb')](function(_0xfce8f){logger['info'](_0x93f3('0xc'),_0x2cb73b,_0x93f3('0xd'));logger[_0x93f3('0xe')](_0x93f3('0xf'),_0x2cb73b,_0x93f3('0xd'),JSON[_0x93f3('0x10')](_0xfce8f));if(_0xfce8f['error']){if(_0xfce8f[_0x93f3('0x11')][_0x93f3('0x12')]===0x1f4){logger[_0x93f3('0x11')](_0x93f3('0xc'),_0x2cb73b,_0xfce8f[_0x93f3('0x11')]['message']);return _0x40fce0(_0xfce8f['error']['message']);}logger[_0x93f3('0x11')](_0x93f3('0xc'),_0x2cb73b,_0xfce8f[_0x93f3('0x11')][_0x93f3('0x13')]);return _0x49918a(_0xfce8f[_0x93f3('0x11')][_0x93f3('0x13')]);}else{logger[_0x93f3('0x14')]('CmCustomField,\x20%s,\x20%s',_0x2cb73b,_0x93f3('0xd'));_0x49918a(_0xfce8f[_0x93f3('0x15')][_0x93f3('0x13')]);}})[_0x93f3('0x16')](function(_0x870ef4){logger['error'](_0x93f3('0xc'),_0x2cb73b,_0x870ef4);_0x40fce0(_0x870ef4);});});} \ No newline at end of file +var _0x4de3=['catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x5f0b6d,_0x159fd5){var _0x3dd638=function(_0x2fd6f1){while(--_0x2fd6f1){_0x5f0b6d['push'](_0x5f0b6d['shift']());}};_0x3dd638(++_0x159fd5);}(_0x4de3,0xc7));var _0x34de=function(_0x1f6b75,_0x139039){_0x1f6b75=_0x1f6b75-0x0;var _0x2a3f91=_0x4de3[_0x1f6b75];return _0x2a3f91;};'use strict';var _=require(_0x34de('0x0'));var util=require('util');var moment=require(_0x34de('0x1'));var BPromise=require(_0x34de('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34de('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x34de('0x4'));var logger=require(_0x34de('0x5'))(_0x34de('0x6'));var config=require(_0x34de('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x34de('0x8')][_0x34de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x337556,_0x268b8f,_0x469ec7){return new BPromise(function(_0x21e250,_0x5e45bb){return client[_0x34de('0xa')](_0x337556,_0x469ec7)[_0x34de('0xb')](function(_0x2a793e){logger[_0x34de('0xc')](_0x34de('0xd'),_0x268b8f,_0x34de('0xe'));logger[_0x34de('0xf')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x268b8f,'request\x20sent',JSON[_0x34de('0x10')](_0x2a793e));if(_0x2a793e[_0x34de('0x11')]){if(_0x2a793e[_0x34de('0x11')][_0x34de('0x12')]===0x1f4){logger[_0x34de('0x11')]('CmCustomField,\x20%s,\x20%s',_0x268b8f,_0x2a793e[_0x34de('0x11')][_0x34de('0x13')]);return _0x5e45bb(_0x2a793e[_0x34de('0x11')][_0x34de('0x13')]);}logger[_0x34de('0x11')](_0x34de('0xd'),_0x268b8f,_0x2a793e['error'][_0x34de('0x13')]);return _0x21e250(_0x2a793e[_0x34de('0x11')][_0x34de('0x13')]);}else{logger['info']('CmCustomField,\x20%s,\x20%s',_0x268b8f,'request\x20sent');_0x21e250(_0x2a793e[_0x34de('0x14')][_0x34de('0x13')]);}})[_0x34de('0x15')](function(_0x3b15ca){logger[_0x34de('0x11')]('CmCustomField,\x20%s,\x20%s',_0x268b8f,_0x3b15ca);_0x5e45bb(_0x3b15ca);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index be702ab..9659d80 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 _0x3468=['../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','fs-extra'];(function(_0x4f2f6f,_0x435d4c){var _0x3c14fc=function(_0x4700a7){while(--_0x4700a7){_0x4f2f6f['push'](_0x4f2f6f['shift']());}};_0x3c14fc(++_0x435d4c);}(_0x3468,0x8d));var _0x8346=function(_0x1a7816,_0x45ab16){_0x1a7816=_0x1a7816-0x0;var _0x31ead2=_0x3468[_0x1a7816];return _0x31ead2;};'use strict';var multer=require(_0x8346('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8346('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8346('0x2'));var auth=require(_0x8346('0x3'));var interaction=require(_0x8346('0x4'));var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router['get']('/',auth[_0x8346('0x5')](),controller['index']);router[_0x8346('0x6')](_0x8346('0x7'),auth[_0x8346('0x5')](),controller[_0x8346('0x8')]);router[_0x8346('0x9')]('/',auth[_0x8346('0x5')](),controller[_0x8346('0xa')]);router[_0x8346('0xb')](_0x8346('0x7'),auth[_0x8346('0x5')](),controller[_0x8346('0xc')]);router[_0x8346('0xd')](_0x8346('0x7'),auth['isAuthenticated'](),controller[_0x8346('0xe')]);module[_0x8346('0xf')]=router; \ No newline at end of file +var _0x1ad9=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x1ad9,0xdb));var _0x91ad=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x1ad9[_0x13ea00];return _0x1f7347;};'use strict';var multer=require(_0x91ad('0x0'));var util=require(_0x91ad('0x1'));var path=require(_0x91ad('0x2'));var timeout=require(_0x91ad('0x3'));var express=require(_0x91ad('0x4'));var router=express[_0x91ad('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x91ad('0x6'));var interaction=require(_0x91ad('0x7'));var config=require(_0x91ad('0x8'));var controller=require(_0x91ad('0x9'));router[_0x91ad('0xa')]('/',auth[_0x91ad('0xb')](),controller[_0x91ad('0xc')]);router[_0x91ad('0xa')]('/:id',auth[_0x91ad('0xb')](),controller[_0x91ad('0xd')]);router[_0x91ad('0xe')]('/',auth[_0x91ad('0xb')](),controller[_0x91ad('0xf')]);router[_0x91ad('0x10')](_0x91ad('0x11'),auth[_0x91ad('0xb')](),controller[_0x91ad('0x12')]);router[_0x91ad('0x13')](_0x91ad('0x11'),auth['isAuthenticated'](),controller[_0x91ad('0x14')]);module[_0x91ad('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 13ed6fb..714901b 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 _0xe32c=['UNSIGNED','contactListQueue','moment','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN'];(function(_0x5e078b,_0x5d0a58){var _0x94b8bc=function(_0x2f9813){while(--_0x2f9813){_0x5e078b['push'](_0x5e078b['shift']());}};_0x94b8bc(++_0x5d0a58);}(_0xe32c,0xd4));var _0xce32=function(_0x50bf5a,_0x807bba){_0x50bf5a=_0x50bf5a-0x0;var _0x4ddc1d=_0xe32c[_0x50bf5a];return _0x4ddc1d;};'use strict';var moment=require(_0xce32('0x0'));var Sequelize=require('sequelize');module[_0xce32('0x1')]={'phone':{'type':Sequelize[_0xce32('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xce32('0x3')],'defaultValue':moment()[_0xce32('0x4')](_0xce32('0x5'))},'countbusyretry':{'type':Sequelize[_0xce32('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xce32('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xce32('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xce32('0x7')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xce32('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xce32('0x3')]},'priority':{'type':Sequelize[_0xce32('0x6')](0x2)[_0xce32('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xce32('0x7')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xce32('0x6')],'unique':_0xce32('0x9')},'ListId':{'type':Sequelize[_0xce32('0x6')],'unique':_0xce32('0x9')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xce32('0x6')],'unique':_0xce32('0x9')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0xce32('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xce32('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xce32('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xce32('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xce32('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xce32('0x2')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xd39b=['format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','DATE'];(function(_0x540109,_0x395b32){var _0x3df990=function(_0x4b1bf7){while(--_0x4b1bf7){_0x540109['push'](_0x540109['shift']());}};_0x3df990(++_0x395b32);}(_0xd39b,0x17b));var _0xbd39=function(_0xbd57fe,_0xc0dda6){_0xbd57fe=_0xbd57fe-0x0;var _0x13c4a5=_0xd39b[_0xbd57fe];return _0x13c4a5;};'use strict';var moment=require(_0xbd39('0x0'));var Sequelize=require(_0xbd39('0x1'));module[_0xbd39('0x2')]={'phone':{'type':Sequelize[_0xbd39('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xbd39('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xbd39('0x5')],'defaultValue':moment()[_0xbd39('0x6')](_0xbd39('0x7'))},'countbusyretry':{'type':Sequelize[_0xbd39('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xbd39('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xbd39('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xbd39('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xbd39('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xbd39('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xbd39('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xbd39('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xbd39('0x8')],'unique':_0xbd39('0xa')},'ListId':{'type':Sequelize[_0xbd39('0x8')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xbd39('0x8')]},'VoiceQueueId':{'type':Sequelize[_0xbd39('0x8')],'unique':_0xbd39('0xa')},'CampaignId':{'type':Sequelize[_0xbd39('0x8')]},'countnosuchnumberretry':{'type':Sequelize[_0xbd39('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xbd39('0x8')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xbd39('0x8')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xbd39('0x8')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xbd39('0x8')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xbd39('0x3')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'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 a80d9b1..917844e 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 _0x8375=['direction','prev','hopperIds','DESC','ASC','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','priority','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','Contact','CmCompany','Company','List','Queue','getPreviewRecall','UPDATE','CmList','update','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','status','moment','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','json','limit','undefined','count','offset','set','Content-Range','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','keys','query','filters','intersection','concat','$or','$gt','$gte','$lte','$ne','$eq','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','$any','attributes','model','fields','length','nolimit','order','sort','where','merge','filter','then','includeAll','include','findAll','catch','show','params','CmHopper','find','create','body','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','createdAt','statedesc','campaign','membername','UserId','user','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','describe','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','format','value'];(function(_0x493720,_0x2e7724){var _0x3cfc8e=function(_0x1ceb74){while(--_0x1ceb74){_0x493720['push'](_0x493720['shift']());}};_0x3cfc8e(++_0x2e7724);}(_0x8375,0xa8));var _0x5837=function(_0x17b520,_0x5524eb){_0x17b520=_0x17b520-0x0;var _0x2cf125=_0x8375[_0x17b520];return _0x2cf125;};'use strict';var moment=require(_0x5837('0x0'));var _=require(_0x5837('0x1'));var qs=require(_0x5837('0x2'));var logger=require('../../config/logger')(_0x5837('0x3'));var shared=require(_0x5837('0x4'));var db=require(_0x5837('0x5'))['db'];function respondWithResult(_0x3a0264,_0x317452){_0x317452=_0x317452||0xc8;return function(_0x1edfc5){if(_0x1edfc5){return _0x3a0264['status'](_0x317452)[_0x5837('0x6')](_0x1edfc5);}};}function respondWithFilteredResult(_0x19491e,_0x365da3){return function(_0x2e383c){if(_0x2e383c){var _0x3b11c3=typeof _0x365da3['offset']==='undefined'&&typeof _0x365da3[_0x5837('0x7')]===_0x5837('0x8');var _0x4a0c44=_0x2e383c[_0x5837('0x9')];var _0x4d0e3c=_0x3b11c3?0x0:_0x365da3[_0x5837('0xa')];var _0x383e5e=_0x3b11c3?_0x2e383c[_0x5837('0x9')]:_0x365da3[_0x5837('0xa')]+_0x365da3[_0x5837('0x7')];var _0x360250;if(_0x383e5e>=_0x4a0c44){_0x383e5e=_0x4a0c44;_0x360250=0xc8;}else{_0x360250=0xce;}_0x19491e['status'](_0x360250);return _0x19491e[_0x5837('0xb')](_0x5837('0xc'),_0x4d0e3c+'-'+_0x383e5e+'/'+_0x4a0c44)[_0x5837('0x6')](_0x2e383c);}return null;};}function saveUpdates(_0x10c1a1,_0x143210){return function(_0x485366){if(_0x485366){return _0x485366['update'](_0x10c1a1)['then'](function(_0x1fb327){return _0x1fb327;});}return null;};}function handleEntityNotFound(_0x111dbf,_0x469903){return function(_0xa5718d){if(!_0xa5718d){_0x111dbf[_0x5837('0xd')](0x194);}return _0xa5718d;};}function handleError(_0x2a7d71,_0x206f02){_0x206f02=_0x206f02||0x1f4;return function(_0x754f39){logger[_0x5837('0xe')](_0x754f39['stack']);if(_0x754f39[_0x5837('0xf')]){delete _0x754f39[_0x5837('0xf')];}_0x2a7d71['status'](_0x206f02)[_0x5837('0x10')](_0x754f39);};}exports[_0x5837('0x11')]=function(_0x3a509b,_0x49279d){var _0x4eaeb9={},_0x4bee08={},_0x38d0c9={'count':0x0,'rows':[]};var _0x3a5386=_[_0x5837('0x12')](db['CmHopper'][_0x5837('0x13')],function(_0x178c4c){return{'name':_0x178c4c[_0x5837('0x14')],'type':_0x178c4c[_0x5837('0x15')]['key']};});_0x4bee08['model']=_['map'](_0x3a5386,_0x5837('0xf'));_0x4bee08['query']=_[_0x5837('0x16')](_0x3a509b[_0x5837('0x17')]);_0x4bee08[_0x5837('0x18')]=_[_0x5837('0x19')](_0x4bee08['model'],_0x4bee08['query']);_0x4bee08[_0x5837('0x18')]=_[_0x5837('0x1a')](_0x4bee08[_0x5837('0x18')],['$and',_0x5837('0x1b'),_0x5837('0x1c'),_0x5837('0x1d'),'$lt',_0x5837('0x1e'),_0x5837('0x1f'),_0x5837('0x20'),'$not','$between',_0x5837('0x21'),_0x5837('0x22'),_0x5837('0x23'),_0x5837('0x24'),_0x5837('0x25'),_0x5837('0x26'),_0x5837('0x27'),_0x5837('0x24'),'$overlap',_0x5837('0x28'),_0x5837('0x29'),_0x5837('0x2a')]);_0x4eaeb9[_0x5837('0x2b')]=_[_0x5837('0x19')](_0x4bee08[_0x5837('0x2c')],qs[_0x5837('0x2d')](_0x3a509b[_0x5837('0x17')]['fields']));_0x4eaeb9['attributes']=_0x4eaeb9[_0x5837('0x2b')][_0x5837('0x2e')]?_0x4eaeb9['attributes']:_0x4bee08[_0x5837('0x2c')];if(!_0x3a509b[_0x5837('0x17')]['hasOwnProperty'](_0x5837('0x2f'))){_0x4eaeb9[_0x5837('0x7')]=qs[_0x5837('0x7')](_0x3a509b['query']['limit']);_0x4eaeb9['offset']=qs[_0x5837('0xa')](_0x3a509b[_0x5837('0x17')][_0x5837('0xa')]);}_0x4eaeb9[_0x5837('0x30')]=qs[_0x5837('0x31')](_0x3a509b['query']['sort']);_0x4eaeb9[_0x5837('0x32')]=qs[_0x5837('0x18')](_['pick'](_0x3a509b['query'],_0x4bee08[_0x5837('0x18')]),_0x3a5386);if(_0x3a509b['query']['filter']){_0x4eaeb9[_0x5837('0x32')]=_[_0x5837('0x33')](_0x4eaeb9['where'],{'$or':_[_0x5837('0x12')](_0x3a5386,function(_0x323981){if(_0x323981[_0x5837('0x15')]!=='VIRTUAL'){var _0xa8c554={};_0xa8c554[_0x323981[_0x5837('0xf')]]={'$like':'%'+_0x3a509b[_0x5837('0x17')][_0x5837('0x34')]+'%'};return _0xa8c554;}})});}_0x4eaeb9=_[_0x5837('0x33')]({},_0x4eaeb9,_0x3a509b['options']);var _0x1d48c8={'where':_0x4eaeb9['where']};return db['CmHopper'][_0x5837('0x9')](_0x1d48c8)[_0x5837('0x35')](function(_0x5f5258){_0x38d0c9[_0x5837('0x9')]=_0x5f5258;if(_0x3a509b[_0x5837('0x17')][_0x5837('0x36')]){_0x4eaeb9[_0x5837('0x37')]=[{'all':!![]}];}return db['CmHopper'][_0x5837('0x38')](_0x4eaeb9);})[_0x5837('0x35')](function(_0x457394){_0x38d0c9['rows']=_0x457394;return _0x38d0c9;})[_0x5837('0x35')](respondWithFilteredResult(_0x49279d,_0x4eaeb9))[_0x5837('0x39')](handleError(_0x49279d,null));};exports[_0x5837('0x3a')]=function(_0x31710b,_0x422953){var _0x76f00d={'raw':!![],'where':{'id':_0x31710b[_0x5837('0x3b')]['id']}},_0xb515bf={};_0xb515bf[_0x5837('0x2c')]=_[_0x5837('0x16')](db[_0x5837('0x3c')][_0x5837('0x13')]);_0xb515bf['query']=_['keys'](_0x31710b[_0x5837('0x17')]);_0xb515bf[_0x5837('0x18')]=_['intersection'](_0xb515bf[_0x5837('0x2c')],_0xb515bf[_0x5837('0x17')]);_0x76f00d[_0x5837('0x2b')]=_['intersection'](_0xb515bf[_0x5837('0x2c')],qs[_0x5837('0x2d')](_0x31710b[_0x5837('0x17')][_0x5837('0x2d')]));_0x76f00d[_0x5837('0x2b')]=_0x76f00d[_0x5837('0x2b')][_0x5837('0x2e')]?_0x76f00d[_0x5837('0x2b')]:_0xb515bf[_0x5837('0x2c')];if(_0x31710b['query'][_0x5837('0x36')]){_0x76f00d[_0x5837('0x37')]=[{'all':!![]}];}_0x76f00d=_[_0x5837('0x33')]({},_0x76f00d,_0x31710b['options']);return db['CmHopper'][_0x5837('0x3d')](_0x76f00d)[_0x5837('0x35')](handleEntityNotFound(_0x422953,null))[_0x5837('0x35')](respondWithResult(_0x422953,null))[_0x5837('0x39')](handleError(_0x422953,null));};exports[_0x5837('0x3e')]=function(_0x33d193,_0x368e80){return db[_0x5837('0x3c')][_0x5837('0x3e')](_0x33d193[_0x5837('0x3f')],{})[_0x5837('0x35')](respondWithResult(_0x368e80,0xc9))[_0x5837('0x39')](handleError(_0x368e80,null));};exports['update']=function(_0x2c129e,_0x4b5264){if(_0x2c129e[_0x5837('0x3f')]['id']){delete _0x2c129e[_0x5837('0x3f')]['id'];}return db['CmHopper'][_0x5837('0x3d')]({'where':{'id':_0x2c129e[_0x5837('0x3b')]['id']}})['then'](handleEntityNotFound(_0x4b5264,null))[_0x5837('0x35')](saveUpdates(_0x2c129e[_0x5837('0x3f')],null))[_0x5837('0x35')](respondWithResult(_0x4b5264,null))[_0x5837('0x39')](handleError(_0x4b5264,null));};exports['describe']=function(_0x55cf2b,_0x3e15fd){return db[_0x5837('0x3c')]['describe']()['then'](respondWithResult(_0x3e15fd,null))['catch'](handleError(_0x3e15fd,null));};exports['destroy']=function(_0x38e987,_0x6423f2){var _0x32c41f;var _0x5e89be=_0x38e987['params']['id'];return db[_0x5837('0x3c')][_0x5837('0x3d')]({'where':{'id':_0x38e987[_0x5837('0x3b')]['id']}})[_0x5837('0x35')](handleEntityNotFound(_0x6423f2,null))[_0x5837('0x35')](function(_0x1e09c1){if(_0x1e09c1){return _0x1e09c1[_0x5837('0x40')]()[_0x5837('0x35')](function(_0x27f7b9){return _0x27f7b9;});}})[_0x5837('0x35')](function(_0x5c5df9){_0x32c41f=_0x5c5df9;if(_0x5c5df9){if(_0x5c5df9[_0x5837('0x41')]||_0x5c5df9[_0x5837('0x42')]){return db[_0x5c5df9['VoiceQueueId']?_0x5837('0x43'):_0x5837('0x44')][_0x5837('0x3d')]({'where':{'id':_0x5c5df9[_0x5837('0x41')]?_0x5c5df9[_0x5837('0x41')]:_0x5c5df9['CampaignId']},'attributes':['id',_0x5837('0xf')],'raw':!![]});}}})[_0x5837('0x35')](function(_0x30d703){var _0x27785a={};if(_0x30d703){_[_0x5837('0x33')](_0x27785a,_[_0x5837('0x45')](_0x32c41f['dataValues'],[_0x5837('0x46'),'updatedAt','id']));_0x27785a['state']=0x15;_0x27785a[_0x5837('0x47')]='deleted';_0x27785a[_0x5837('0x48')]=_0x30d703[_0x5837('0xf')];_0x27785a[_0x5837('0x49')]=_0x38e987['user'][_0x5837('0xf')];_0x27785a[_0x5837('0x4a')]=_0x38e987[_0x5837('0x4b')]['id'];_0x27785a['deleted']=!![];_0x27785a[_0x5837('0x4c')]=moment()['format'](_0x5837('0x4d'));_0x27785a[_0x5837('0x4e')]=_0x32c41f[_0x5837('0x4f')];_0x27785a[_0x5837('0x50')]=_0x32c41f[_0x5837('0x41')]?'queue':_0x5837('0x51');return db[_0x5837('0x52')]['find']({'where':{'id':_0x27785a[_0x5837('0x53')]},'attributes':[_0x5837('0x54'),_0x5837('0x55')]})['then'](function(_0x5787ba){if(!_[_0x5837('0x56')](_0x6423f2)&&!_[_0x5837('0x56')](_0x5787ba[_0x5837('0x54')])){_0x27785a['calleridname']=_0x5787ba[_0x5837('0x54')];if(!_[_0x5837('0x56')](_0x5787ba['lastName'])){_0x27785a[_0x5837('0x57')]+='\x20'+_0x5787ba['lastName'];}}})['finally'](function(){return db[_0x5837('0x58')][_0x5837('0x3e')](_0x27785a);});}})['then'](function(_0x1854f5){return db[_0x5837('0x59')][_0x5837('0x40')]({'where':{'CmHopperId':_0x5e89be}});})[_0x5837('0x35')](function(){return _0x6423f2['status'](0xcc)[_0x5837('0x5a')]();})['catch'](handleError(_0x6423f2,null));};exports[_0x5837('0x5b')]=function(_0x2ee313,_0x55b50d){var _0x5b5d66=[];return db[_0x5837('0x52')][_0x5837('0x5c')]()['then'](function(_0x172e79){_0x5b5d66=_['keys'](_0x172e79);return _0x2ee313[_0x5837('0x4b')][_0x5837('0x5d')]({'where':{'type':_0x5837('0x5e'),'dialActive':!![],'dialMethod':_0x5837('0x5f')},'attributes':['id',_0x5837('0x60'),_0x5837('0x61')],'raw':!![]});})['then'](function(_0x3c88b4){if(_0x3c88b4&&_0x3c88b4[_0x5837('0x2e')]){return db[_0x5837('0x62')][_0x5837('0x63')](function(_0xfeb404){var _0x550ef6={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5837('0x64')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x5837('0x12')](_0x3c88b4,'id')},'$or':[{'UserId':null},{'UserId':_0x2ee313[_0x5837('0x4b')]['id']}]};var _0x263ccb={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3c88b4)['filter']([_0x5837('0x61'),0x0])[_0x5837('0x12')]('id')[_0x5837('0x65')]()},'$or':[{'UserId':null},{'UserId':_0x2ee313[_0x5837('0x4b')]['id']}]};var _0x4af185={'$or':[_0x550ef6,_0x263ccb]};var _0x513dc9=[];if(_0x2ee313[_0x5837('0x3f')][_0x5837('0x66')]&&_0x2ee313[_0x5837('0x3f')]['direction']===_0x5837('0x67')){if(!_['isEmpty'](_0x2ee313[_0x5837('0x3f')][_0x5837('0x68')])){_0x4af185['id']={'$in':_0x2ee313[_0x5837('0x3f')][_0x5837('0x68')]};}_0x513dc9=[['priority','ASC'],['scheduledAt',_0x3c88b4[0x0][_0x5837('0x60')]==='ASC'?_0x5837('0x69'):_0x5837('0x6a')],db['sequelize']['literal'](_0x5837('0x6b')),['id',_0x5837('0x69')]];}else{if(!_[_0x5837('0x6c')](_0x2ee313[_0x5837('0x3f')][_0x5837('0x68')])){_0x4af185['id']={'$notIn':_0x2ee313[_0x5837('0x3f')][_0x5837('0x68')]};}_0x513dc9=[[_0x5837('0x6d'),_0x5837('0x69')],[_0x5837('0x6e'),_0x3c88b4[0x0][_0x5837('0x60')]],db[_0x5837('0x62')]['literal'](_0x5837('0x6f')),['id',_0x5837('0x6a')]];}return db[_0x5837('0x3c')][_0x5837('0x70')]({'attributes':['id',_0x5837('0x71'),_0x5837('0x4f'),_0x5837('0x72')],'where':_0x4af185,'order':_0x513dc9,'transaction':_0xfeb404,'lock':_0xfeb404[_0x5837('0x73')]['UPDATE'],'include':[{'model':db[_0x5837('0x52')],'as':_0x5837('0x74'),'attributes':_0x5b5d66,'include':[{'model':db[_0x5837('0x75')],'as':_0x5837('0x76'),'attributes':['id',_0x5837('0xf')]}]},{'model':db['CmList'],'as':_0x5837('0x77'),'attributes':['id',_0x5837('0xf')]},{'model':db[_0x5837('0x43')],'as':_0x5837('0x78'),'attributes':['id',_0x5837('0xf'),'dialActive']}]})[_0x5837('0x35')](function(_0x562e69){if(_0x562e69){return _0x562e69['update']({'UserId':_0x2ee313[_0x5837('0x4b')]['id']},{'transaction':_0xfeb404});}});});}})[_0x5837('0x35')](handleEntityNotFound(_0x55b50d,null))[_0x5837('0x35')](respondWithResult(_0x55b50d,null))[_0x5837('0x39')](handleError(_0x55b50d,null));};exports[_0x5837('0x79')]=function(_0x35ff75,_0x56303b,_0x54c795){var _0x6e74b=[];var _0x163023=_0x35ff75[_0x5837('0x3b')]['id'];var _0x267b03=_0x35ff75[_0x5837('0x4b')]['id'];return db['CmContact'][_0x5837('0x5c')]()[_0x5837('0x35')](function(_0x55940f){_0x6e74b=_['keys'](_0x55940f);return db[_0x5837('0x62')][_0x5837('0x63')](function(_0x1c91f2){const _0x4d79cb={'id':_0x163023};return db[_0x5837('0x3c')][_0x5837('0x70')]({'attributes':['id','scheduledat',_0x5837('0x72')],'where':_0x4d79cb,'transaction':_0x1c91f2,'lock':_0x1c91f2[_0x5837('0x73')][_0x5837('0x7a')],'include':[{'model':db[_0x5837('0x52')],'as':_0x5837('0x74'),'attributes':_0x6e74b,'include':[{'model':db['CmCompany'],'as':_0x5837('0x76'),'attributes':['id',_0x5837('0xf')]}]},{'model':db[_0x5837('0x7b')],'as':_0x5837('0x77'),'attributes':['id',_0x5837('0xf')]},{'model':db[_0x5837('0x43')],'as':_0x5837('0x78'),'attributes':['id','name','dialActive']}]})[_0x5837('0x35')](function(_0x3ccc20){if(_0x3ccc20){return _0x3ccc20[_0x5837('0x7c')]({'UserId':_0x267b03},{'transaction':_0x1c91f2});}});});})[_0x5837('0x35')](handleEntityNotFound(_0x56303b,null))[_0x5837('0x35')](respondWithResult(_0x56303b,null))[_0x5837('0x39')](handleError(_0x56303b,null));};exports[_0x5837('0x7d')]=function(_0x51994d,_0x4c5af4){return _0x51994d[_0x5837('0x4b')][_0x5837('0x5d')]({'where':{'type':_0x5837('0x5e'),'dialActive':!![],'dialMethod':_0x5837('0x5f')},'attributes':['id'],'raw':!![]})[_0x5837('0x35')](function(_0x574067){if(_0x574067&&_0x574067[_0x5837('0x2e')]){return db[_0x5837('0x3c')][_0x5837('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5837('0x64')](_0x5837('0x4d'))},'VoiceQueueId':{'$in':_[_0x5837('0x12')](_0x574067,'id')},'$or':[{'UserId':null},{'UserId':_0x51994d[_0x5837('0x4b')]['id']}]}});}return 0x0;})[_0x5837('0x35')](function(_0x33ad0f){if(!_[_0x5837('0x56')](_0x33ad0f)&&_[_0x5837('0x7e')](_0x33ad0f)){return _0x4c5af4['status'](0xc8)[_0x5837('0x6')]({'contacts':_0x33ad0f});}else{logger['error'](_0x5837('0x7f'),_0x5837('0x7d'),0x194,_0x5837('0x80'));_0x4c5af4['sendStatus'](0x194);}})[_0x5837('0x39')](handleError(_0x4c5af4,null));};exports[_0x5837('0x81')]=function(_0x47c055,_0x3f0faa){var _0x400680=shared[_0x5837('0x82')];var _0x1eadc8=[];_[_0x5837('0x12')](_0x400680,function(_0x4d274d){_0x1eadc8[_0x5837('0x83')]({'id':_0x4d274d[_0x5837('0xf')],'name':_0x4d274d[_0x5837('0xf')],'utcOffset':_0x4d274d[_0x5837('0x84')]});});return _0x3f0faa['status'](0xc8)[_0x5837('0x6')]({'tz':_0x1eadc8});};exports[_0x5837('0x85')]=function(_0x392604,_0x51f2f9){var _0x3182e6=shared[_0x5837('0x82')];var _0x37f625={};if(!_['isNil'](_0x3182e6[_0x392604['body']['id']]))_0x37f625=_0x3182e6[_0x392604['body']['id']];return _0x51f2f9[_0x5837('0x86')](0xc8)['json'](_0x37f625);}; \ No newline at end of file +var _0x00bb=['find','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','createdAt','updatedAt','deleted','membername','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','CmContact','getVoiceQueues','preview','dialPreviewAutoRecallMe','format','value','direction','prev','isEmpty','ASC','dialOrderByScheduledAt','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','hopperIds','priority','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','Queue','dialActive','getPreviewRecall','transaction','recallme','getOpenContacts','outbound','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','moment','lodash','../../components/parsers/qs','api','../../mysqldb','status','offset','undefined','limit','count','json','update','then','sendStatus','error','name','send','index','CmHopper','rawAttributes','type','model','map','query','intersection','filters','concat','$and','$or','$gte','$lt','$lte','$ne','$between','$like','$notLike','$iLike','$notILike','$overlap','$contains','$any','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','keys'];(function(_0x5eb9e4,_0xfe886d){var _0xf661a4=function(_0x4aaa95){while(--_0x4aaa95){_0x5eb9e4['push'](_0x5eb9e4['shift']());}};_0xf661a4(++_0xfe886d);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x00bb[_0x1d9aa0];return _0x226868;};'use strict';var moment=require(_0xb00b('0x0'));var _=require(_0xb00b('0x1'));var qs=require(_0xb00b('0x2'));var logger=require('../../config/logger')(_0xb00b('0x3'));var shared=require('../../config/environment');var db=require(_0xb00b('0x4'))['db'];function respondWithResult(_0x464fe7,_0x582ef9){_0x582ef9=_0x582ef9||0xc8;return function(_0x14b5d0){if(_0x14b5d0){return _0x464fe7[_0xb00b('0x5')](_0x582ef9)['json'](_0x14b5d0);}};}function respondWithFilteredResult(_0x574cf8,_0x532ffb){return function(_0x36e363){if(_0x36e363){var _0xf737d0=typeof _0x532ffb[_0xb00b('0x6')]===_0xb00b('0x7')&&typeof _0x532ffb[_0xb00b('0x8')]===_0xb00b('0x7');var _0x5b0c03=_0x36e363['count'];var _0x5154d9=_0xf737d0?0x0:_0x532ffb[_0xb00b('0x6')];var _0x5851d4=_0xf737d0?_0x36e363[_0xb00b('0x9')]:_0x532ffb[_0xb00b('0x6')]+_0x532ffb['limit'];var _0x3182db;if(_0x5851d4>=_0x5b0c03){_0x5851d4=_0x5b0c03;_0x3182db=0xc8;}else{_0x3182db=0xce;}_0x574cf8['status'](_0x3182db);return _0x574cf8['set']('Content-Range',_0x5154d9+'-'+_0x5851d4+'/'+_0x5b0c03)[_0xb00b('0xa')](_0x36e363);}return null;};}function saveUpdates(_0x2d8ddf,_0x1be8aa){return function(_0x466b9b){if(_0x466b9b){return _0x466b9b[_0xb00b('0xb')](_0x2d8ddf)[_0xb00b('0xc')](function(_0x4ada81){return _0x4ada81;});}return null;};}function handleEntityNotFound(_0x218de2,_0xb0d42e){return function(_0x482fe6){if(!_0x482fe6){_0x218de2[_0xb00b('0xd')](0x194);}return _0x482fe6;};}function handleError(_0x1084a6,_0x540b79){_0x540b79=_0x540b79||0x1f4;return function(_0x5da36b){logger[_0xb00b('0xe')](_0x5da36b['stack']);if(_0x5da36b['name']){delete _0x5da36b[_0xb00b('0xf')];}_0x1084a6[_0xb00b('0x5')](_0x540b79)[_0xb00b('0x10')](_0x5da36b);};}exports[_0xb00b('0x11')]=function(_0x58d65f,_0x2a7231){var _0x599347={},_0x415f91={},_0x5aa9a0={'count':0x0,'rows':[]};var _0x25d7a0=_['map'](db[_0xb00b('0x12')][_0xb00b('0x13')],function(_0x53ee68){return{'name':_0x53ee68['fieldName'],'type':_0x53ee68[_0xb00b('0x14')]['key']};});_0x415f91[_0xb00b('0x15')]=_[_0xb00b('0x16')](_0x25d7a0,_0xb00b('0xf'));_0x415f91[_0xb00b('0x17')]=_['keys'](_0x58d65f[_0xb00b('0x17')]);_0x415f91['filters']=_[_0xb00b('0x18')](_0x415f91[_0xb00b('0x15')],_0x415f91['query']);_0x415f91[_0xb00b('0x19')]=_[_0xb00b('0x1a')](_0x415f91['filters'],[_0xb00b('0x1b'),_0xb00b('0x1c'),'$gt',_0xb00b('0x1d'),_0xb00b('0x1e'),_0xb00b('0x1f'),_0xb00b('0x20'),'$eq','$not',_0xb00b('0x21'),'$notBetween','$in','$notIn',_0xb00b('0x22'),_0xb00b('0x23'),_0xb00b('0x24'),_0xb00b('0x25'),_0xb00b('0x22'),_0xb00b('0x26'),_0xb00b('0x27'),'$contained',_0xb00b('0x28')]);_0x599347['attributes']=_[_0xb00b('0x18')](_0x415f91[_0xb00b('0x15')],qs[_0xb00b('0x29')](_0x58d65f['query'][_0xb00b('0x29')]));_0x599347[_0xb00b('0x2a')]=_0x599347[_0xb00b('0x2a')][_0xb00b('0x2b')]?_0x599347[_0xb00b('0x2a')]:_0x415f91[_0xb00b('0x15')];if(!_0x58d65f[_0xb00b('0x17')][_0xb00b('0x2c')](_0xb00b('0x2d'))){_0x599347['limit']=qs[_0xb00b('0x8')](_0x58d65f[_0xb00b('0x17')]['limit']);_0x599347[_0xb00b('0x6')]=qs[_0xb00b('0x6')](_0x58d65f['query'][_0xb00b('0x6')]);}_0x599347['order']=qs[_0xb00b('0x2e')](_0x58d65f[_0xb00b('0x17')][_0xb00b('0x2e')]);_0x599347[_0xb00b('0x2f')]=qs[_0xb00b('0x19')](_[_0xb00b('0x30')](_0x58d65f[_0xb00b('0x17')],_0x415f91['filters']),_0x25d7a0);if(_0x58d65f['query']['filter']){_0x599347[_0xb00b('0x2f')]=_[_0xb00b('0x31')](_0x599347[_0xb00b('0x2f')],{'$or':_[_0xb00b('0x16')](_0x25d7a0,function(_0x5cfa60){if(_0x5cfa60[_0xb00b('0x14')]!==_0xb00b('0x32')){var _0x341f46={};_0x341f46[_0x5cfa60[_0xb00b('0xf')]]={'$like':'%'+_0x58d65f[_0xb00b('0x17')][_0xb00b('0x33')]+'%'};return _0x341f46;}})});}_0x599347=_[_0xb00b('0x31')]({},_0x599347,_0x58d65f[_0xb00b('0x34')]);var _0x5efc18={'where':_0x599347['where']};return db[_0xb00b('0x12')]['count'](_0x5efc18)[_0xb00b('0xc')](function(_0x1c5400){_0x5aa9a0[_0xb00b('0x9')]=_0x1c5400;if(_0x58d65f[_0xb00b('0x17')][_0xb00b('0x35')]){_0x599347[_0xb00b('0x36')]=[{'all':!![]}];}return db[_0xb00b('0x12')]['findAll'](_0x599347);})[_0xb00b('0xc')](function(_0x25578e){_0x5aa9a0[_0xb00b('0x37')]=_0x25578e;return _0x5aa9a0;})[_0xb00b('0xc')](respondWithFilteredResult(_0x2a7231,_0x599347))[_0xb00b('0x38')](handleError(_0x2a7231,null));};exports[_0xb00b('0x39')]=function(_0x59fb00,_0x36980a){var _0x3beb8f={'raw':!![],'where':{'id':_0x59fb00[_0xb00b('0x3a')]['id']}},_0x4801e7={};_0x4801e7[_0xb00b('0x15')]=_[_0xb00b('0x3b')](db[_0xb00b('0x12')][_0xb00b('0x13')]);_0x4801e7['query']=_[_0xb00b('0x3b')](_0x59fb00[_0xb00b('0x17')]);_0x4801e7[_0xb00b('0x19')]=_[_0xb00b('0x18')](_0x4801e7['model'],_0x4801e7['query']);_0x3beb8f[_0xb00b('0x2a')]=_[_0xb00b('0x18')](_0x4801e7[_0xb00b('0x15')],qs[_0xb00b('0x29')](_0x59fb00[_0xb00b('0x17')][_0xb00b('0x29')]));_0x3beb8f[_0xb00b('0x2a')]=_0x3beb8f['attributes'][_0xb00b('0x2b')]?_0x3beb8f[_0xb00b('0x2a')]:_0x4801e7[_0xb00b('0x15')];if(_0x59fb00[_0xb00b('0x17')][_0xb00b('0x35')]){_0x3beb8f[_0xb00b('0x36')]=[{'all':!![]}];}_0x3beb8f=_[_0xb00b('0x31')]({},_0x3beb8f,_0x59fb00[_0xb00b('0x34')]);return db[_0xb00b('0x12')][_0xb00b('0x3c')](_0x3beb8f)[_0xb00b('0xc')](handleEntityNotFound(_0x36980a,null))[_0xb00b('0xc')](respondWithResult(_0x36980a,null))['catch'](handleError(_0x36980a,null));};exports[_0xb00b('0x3d')]=function(_0x35a0ba,_0xd07fb8){return db[_0xb00b('0x12')][_0xb00b('0x3d')](_0x35a0ba[_0xb00b('0x3e')],{})[_0xb00b('0xc')](respondWithResult(_0xd07fb8,0xc9))[_0xb00b('0x38')](handleError(_0xd07fb8,null));};exports[_0xb00b('0xb')]=function(_0x103320,_0x1eec12){if(_0x103320[_0xb00b('0x3e')]['id']){delete _0x103320['body']['id'];}return db['CmHopper']['find']({'where':{'id':_0x103320[_0xb00b('0x3a')]['id']}})[_0xb00b('0xc')](handleEntityNotFound(_0x1eec12,null))['then'](saveUpdates(_0x103320[_0xb00b('0x3e')],null))[_0xb00b('0xc')](respondWithResult(_0x1eec12,null))[_0xb00b('0x38')](handleError(_0x1eec12,null));};exports[_0xb00b('0x3f')]=function(_0x4b62b3,_0x58e9cb){return db[_0xb00b('0x12')][_0xb00b('0x3f')]()['then'](respondWithResult(_0x58e9cb,null))['catch'](handleError(_0x58e9cb,null));};exports[_0xb00b('0x40')]=function(_0x3a205d,_0x4e0be4){var _0x2228e9;var _0x47a814=_0x3a205d['params']['id'];return db['CmHopper'][_0xb00b('0x3c')]({'where':{'id':_0x3a205d['params']['id']}})[_0xb00b('0xc')](handleEntityNotFound(_0x4e0be4,null))[_0xb00b('0xc')](function(_0x4b6482){if(_0x4b6482){return _0x4b6482[_0xb00b('0x40')]()[_0xb00b('0xc')](function(_0xda60ca){return _0xda60ca;});}})['then'](function(_0x5bd40c){_0x2228e9=_0x5bd40c;if(_0x5bd40c){if(_0x5bd40c[_0xb00b('0x41')]||_0x5bd40c[_0xb00b('0x42')]){return db[_0x5bd40c['VoiceQueueId']?_0xb00b('0x43'):_0xb00b('0x44')]['find']({'where':{'id':_0x5bd40c[_0xb00b('0x41')]?_0x5bd40c[_0xb00b('0x41')]:_0x5bd40c[_0xb00b('0x42')]},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0x19f907){var _0x398deb={};if(_0x19f907){_[_0xb00b('0x31')](_0x398deb,_[_0xb00b('0x45')](_0x2228e9['dataValues'],[_0xb00b('0x46'),_0xb00b('0x47'),'id']));_0x398deb['state']=0x15;_0x398deb['statedesc']=_0xb00b('0x48');_0x398deb['campaign']=_0x19f907[_0xb00b('0xf')];_0x398deb[_0xb00b('0x49')]=_0x3a205d[_0xb00b('0x4a')][_0xb00b('0xf')];_0x398deb[_0xb00b('0x4b')]=_0x3a205d[_0xb00b('0x4a')]['id'];_0x398deb['deleted']=!![];_0x398deb[_0xb00b('0x4c')]=moment()['format'](_0xb00b('0x4d'));_0x398deb[_0xb00b('0x4e')]=_0x2228e9[_0xb00b('0x4f')];_0x398deb['campaigntype']=_0x2228e9[_0xb00b('0x41')]?_0xb00b('0x50'):_0xb00b('0x51');return db['CmContact'][_0xb00b('0x3c')]({'where':{'id':_0x398deb[_0xb00b('0x52')]},'attributes':[_0xb00b('0x53'),_0xb00b('0x54')]})[_0xb00b('0xc')](function(_0x279467){if(!_[_0xb00b('0x55')](_0x4e0be4)&&!_[_0xb00b('0x55')](_0x279467['firstName'])){_0x398deb[_0xb00b('0x56')]=_0x279467[_0xb00b('0x53')];if(!_[_0xb00b('0x55')](_0x279467['lastName'])){_0x398deb[_0xb00b('0x56')]+='\x20'+_0x279467[_0xb00b('0x54')];}}})[_0xb00b('0x57')](function(){return db[_0xb00b('0x58')][_0xb00b('0x3d')](_0x398deb);});}})['then'](function(_0xfd4ecc){return db[_0xb00b('0x59')][_0xb00b('0x40')]({'where':{'CmHopperId':_0x47a814}});})[_0xb00b('0xc')](function(){return _0x4e0be4['status'](0xcc)[_0xb00b('0x5a')]();})[_0xb00b('0x38')](handleError(_0x4e0be4,null));};exports[_0xb00b('0x5b')]=function(_0x2d73bb,_0x161216){var _0x1e5ed8=[];return db[_0xb00b('0x5c')]['describe']()[_0xb00b('0xc')](function(_0x502822){_0x1e5ed8=_[_0xb00b('0x3b')](_0x502822);return _0x2d73bb['user'][_0xb00b('0x5d')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xb00b('0x5e')},'attributes':['id','dialOrderByScheduledAt',_0xb00b('0x5f')],'raw':!![]});})[_0xb00b('0xc')](function(_0x3bae02){if(_0x3bae02&&_0x3bae02['length']){return db['sequelize']['transaction'](function(_0x21a53d){var _0x3126be={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xb00b('0x60')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xb00b('0x16')](_0x3bae02,'id')},'$or':[{'UserId':null},{'UserId':_0x2d73bb[_0xb00b('0x4a')]['id']}]};var _0xca87d4={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3bae02)[_0xb00b('0x33')]([_0xb00b('0x5f'),0x0])['map']('id')[_0xb00b('0x61')]()},'$or':[{'UserId':null},{'UserId':_0x2d73bb[_0xb00b('0x4a')]['id']}]};var _0x5622a4={'$or':[_0x3126be,_0xca87d4]};var _0xe1316d=[];if(_0x2d73bb[_0xb00b('0x3e')][_0xb00b('0x62')]&&_0x2d73bb['body']['direction']===_0xb00b('0x63')){if(!_[_0xb00b('0x64')](_0x2d73bb[_0xb00b('0x3e')]['hopperIds'])){_0x5622a4['id']={'$in':_0x2d73bb['body']['hopperIds']};}_0xe1316d=[['priority',_0xb00b('0x65')],['scheduledAt',_0x3bae02[0x0][_0xb00b('0x66')]===_0xb00b('0x65')?'DESC':_0xb00b('0x65')],db[_0xb00b('0x67')][_0xb00b('0x68')](_0xb00b('0x69')),['id',_0xb00b('0x6a')]];}else{if(!_['isEmpty'](_0x2d73bb[_0xb00b('0x3e')][_0xb00b('0x6b')])){_0x5622a4['id']={'$notIn':_0x2d73bb[_0xb00b('0x3e')][_0xb00b('0x6b')]};}_0xe1316d=[[_0xb00b('0x6c'),_0xb00b('0x6a')],[_0xb00b('0x6d'),_0x3bae02[0x0]['dialOrderByScheduledAt']],db[_0xb00b('0x67')][_0xb00b('0x68')](_0xb00b('0x6e')),['id',_0xb00b('0x65')]];}return db[_0xb00b('0x12')][_0xb00b('0x6f')]({'attributes':['id',_0xb00b('0x70'),_0xb00b('0x4f'),'recallme'],'where':_0x5622a4,'order':_0xe1316d,'transaction':_0x21a53d,'lock':_0x21a53d[_0xb00b('0x71')][_0xb00b('0x72')],'include':[{'model':db[_0xb00b('0x5c')],'as':_0xb00b('0x73'),'attributes':_0x1e5ed8,'include':[{'model':db[_0xb00b('0x74')],'as':_0xb00b('0x75'),'attributes':['id',_0xb00b('0xf')]}]},{'model':db[_0xb00b('0x76')],'as':'List','attributes':['id',_0xb00b('0xf')]},{'model':db[_0xb00b('0x43')],'as':_0xb00b('0x77'),'attributes':['id',_0xb00b('0xf'),_0xb00b('0x78')]}]})[_0xb00b('0xc')](function(_0x26461a){if(_0x26461a){return _0x26461a['update']({'UserId':_0x2d73bb[_0xb00b('0x4a')]['id']},{'transaction':_0x21a53d});}});});}})[_0xb00b('0xc')](handleEntityNotFound(_0x161216,null))[_0xb00b('0xc')](respondWithResult(_0x161216,null))[_0xb00b('0x38')](handleError(_0x161216,null));};exports[_0xb00b('0x79')]=function(_0x14ccaf,_0x4930f3,_0x39bb6c){var _0x4e95c7=[];var _0x135cbf=_0x14ccaf['params']['id'];var _0x1b255d=_0x14ccaf[_0xb00b('0x4a')]['id'];return db[_0xb00b('0x5c')]['describe']()['then'](function(_0x9ad1c6){_0x4e95c7=_[_0xb00b('0x3b')](_0x9ad1c6);return db[_0xb00b('0x67')][_0xb00b('0x7a')](function(_0x36b3a2){const _0x13e875={'id':_0x135cbf};return db[_0xb00b('0x12')][_0xb00b('0x6f')]({'attributes':['id',_0xb00b('0x70'),_0xb00b('0x7b')],'where':_0x13e875,'transaction':_0x36b3a2,'lock':_0x36b3a2[_0xb00b('0x71')][_0xb00b('0x72')],'include':[{'model':db[_0xb00b('0x5c')],'as':_0xb00b('0x73'),'attributes':_0x4e95c7,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0xb00b('0xf')]}]},{'model':db[_0xb00b('0x76')],'as':'List','attributes':['id','name']},{'model':db[_0xb00b('0x43')],'as':_0xb00b('0x77'),'attributes':['id',_0xb00b('0xf'),'dialActive']}]})[_0xb00b('0xc')](function(_0x3f415a){if(_0x3f415a){return _0x3f415a[_0xb00b('0xb')]({'UserId':_0x1b255d},{'transaction':_0x36b3a2});}});});})[_0xb00b('0xc')](handleEntityNotFound(_0x4930f3,null))[_0xb00b('0xc')](respondWithResult(_0x4930f3,null))[_0xb00b('0x38')](handleError(_0x4930f3,null));};exports[_0xb00b('0x7c')]=function(_0x4a9125,_0x4168cf){return _0x4a9125['user'][_0xb00b('0x5d')]({'where':{'type':_0xb00b('0x7d'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0xb00b('0xc')](function(_0x1099cb){if(_0x1099cb&&_0x1099cb[_0xb00b('0x2b')]){return db[_0xb00b('0x12')][_0xb00b('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xb00b('0x60')](_0xb00b('0x4d'))},'VoiceQueueId':{'$in':_[_0xb00b('0x16')](_0x1099cb,'id')},'$or':[{'UserId':null},{'UserId':_0x4a9125[_0xb00b('0x4a')]['id']}]}});}return 0x0;})[_0xb00b('0xc')](function(_0x2ec3f2){if(!_[_0xb00b('0x55')](_0x2ec3f2)&&_['isNumber'](_0x2ec3f2)){return _0x4168cf[_0xb00b('0x5')](0xc8)[_0xb00b('0xa')]({'contacts':_0x2ec3f2});}else{logger[_0xb00b('0xe')](_0xb00b('0x7e'),'getOpenContacts',0x194,_0xb00b('0x7f'));_0x4168cf[_0xb00b('0xd')](0x194);}})[_0xb00b('0x38')](handleError(_0x4168cf,null));};exports[_0xb00b('0x80')]=function(_0x21471a,_0x5b4d38){var _0x2f1096=shared[_0xb00b('0x81')];var _0xa4fe1e=[];_[_0xb00b('0x16')](_0x2f1096,function(_0x4fb982){_0xa4fe1e[_0xb00b('0x82')]({'id':_0x4fb982['name'],'name':_0x4fb982[_0xb00b('0xf')],'utcOffset':_0x4fb982[_0xb00b('0x83')]});});return _0x5b4d38[_0xb00b('0x5')](0xc8)[_0xb00b('0xa')]({'tz':_0xa4fe1e});};exports[_0xb00b('0x84')]=function(_0x27e051,_0x430e8a){var _0x319977=shared[_0xb00b('0x81')];var _0x1cd071={};if(!_[_0xb00b('0x55')](_0x319977[_0x27e051['body']['id']]))_0x1cd071=_0x319977[_0x27e051[_0xb00b('0x3e')]['id']];return _0x430e8a[_0xb00b('0x5')](0xc8)[_0xb00b('0xa')](_0x1cd071);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index dd9c502..e594e62 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 _0x5d58=['priority','bluebird','request-promise','rimraf','../../config/environment','exports','define','cm_hopper','scheduledat','phone'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d58,0x187));var _0x85d5=function(_0x2bb3e2,_0x4dadb6){_0x2bb3e2=_0x2bb3e2-0x0;var _0xac593c=_0x5d58[_0x2bb3e2];return _0xac593c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x85d5('0x0'));var rp=require(_0x85d5('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var attributes=require('./cmHopper.attributes');module[_0x85d5('0x4')]=function(_0x2d457a,_0x578fad){return _0x2d457a[_0x85d5('0x5')]('CmHopper',attributes,{'tableName':_0x85d5('0x6'),'paranoid':![],'indexes':[{'name':_0x85d5('0x7'),'fields':['scheduledat']},{'name':_0x85d5('0x8'),'fields':['phone']},{'name':_0x85d5('0x9'),'fields':[_0x85d5('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf494=['define','scheduledat','phone','priority','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x4503dc,_0x2007dd){var _0x5a4d80=function(_0x108c9c){while(--_0x108c9c){_0x4503dc['push'](_0x4503dc['shift']());}};_0x5a4d80(++_0x2007dd);}(_0xf494,0x1c6));var _0x4f49=function(_0x5cfb92,_0x5797e6){_0x5cfb92=_0x5cfb92-0x0;var _0x1cd7c2=_0xf494[_0x5cfb92];return _0x1cd7c2;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('0xc')]},{'name':_0x4f49('0xd'),'fields':[_0x4f49('0xd')]},{'name':_0x4f49('0xe'),'fields':[_0x4f49('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index c20cb12..b275f96 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 _0xe0d1=['create','body','CreateCmHopper','UpdateCmHopper','update','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','transaction','UPDATE','Contact','keys','Agent','name','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','sequelize','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','CountReScheduled','GetContactRecallMe','order','LOCK','GetCmHopperPreview','GetContactByPhone','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','interval','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','User','voicePause','List','NOW()','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','bluebird','rpc','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','info','GetCmHopper','debug','catch','message','error','ShowCmHopper','find','then','stringify'];(function(_0x382a31,_0x10d6ee){var _0x729c62=function(_0x3c1a4b){while(--_0x3c1a4b){_0x382a31['push'](_0x382a31['shift']());}};_0x729c62(++_0x10d6ee);}(_0xe0d1,0xd1));var _0x1e0d=function(_0x5c14f6,_0x2979d8){_0x5c14f6=_0x5c14f6-0x0;var _0x4949b3=_0xe0d1[_0x5c14f6];return _0x4949b3;};'use strict';var _=require(_0x1e0d('0x0'));var util=require(_0x1e0d('0x1'));var moment=require(_0x1e0d('0x2'));var BPromise=require(_0x1e0d('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x1e0d('0x4'));exports['GetCmHopper']=function(_0x1b4098){var _0x45c149=this;return new Promise(function(_0x5d237c,_0x399d8c){return db[_0x1e0d('0x5')][_0x1e0d('0x6')]({'raw':_0x1b4098[_0x1e0d('0x7')]?_0x1b4098[_0x1e0d('0x7')][_0x1e0d('0x8')]===undefined?!![]:![]:!![],'where':_0x1b4098[_0x1e0d('0x7')]?_0x1b4098[_0x1e0d('0x7')][_0x1e0d('0x9')]||null:null,'attributes':_0x1b4098[_0x1e0d('0x7')]?_0x1b4098[_0x1e0d('0x7')][_0x1e0d('0xa')]||null:null,'limit':_0x1b4098['options']?_0x1b4098[_0x1e0d('0x7')][_0x1e0d('0xb')]||null:null,'include':_0x1b4098['options']?_0x1b4098[_0x1e0d('0x7')][_0x1e0d('0xc')]?_[_0x1e0d('0xd')](_0x1b4098[_0x1e0d('0x7')]['include'],function(_0x3dd855){return{'model':db[_0x3dd855[_0x1e0d('0xe')]],'as':_0x3dd855['as'],'attributes':_0x3dd855['attributes'],'include':_0x3dd855[_0x1e0d('0xc')]?_[_0x1e0d('0xd')](_0x3dd855[_0x1e0d('0xc')],function(_0x26e848){return{'model':db[_0x26e848[_0x1e0d('0xe')]],'as':_0x26e848['as'],'attributes':_0x26e848['attributes'],'include':_0x26e848[_0x1e0d('0xc')]?_[_0x1e0d('0xd')](_0x26e848['include'],function(_0x543d84){return{'model':db[_0x543d84[_0x1e0d('0xe')]],'as':_0x543d84['as'],'attributes':_0x543d84[_0x1e0d('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x490084){logger[_0x1e0d('0xf')](_0x1e0d('0x10'),_0x1b4098);logger[_0x1e0d('0x11')](_0x1e0d('0x10'),_0x1b4098,JSON['stringify'](_0x490084));_0x5d237c(_0x490084);})[_0x1e0d('0x12')](function(_0x321b4e){logger['error'](_0x1e0d('0x10'),_0x321b4e[_0x1e0d('0x13')],_0x1b4098);_0x399d8c(_0x45c149[_0x1e0d('0x14')](0x1f4,_0x321b4e[_0x1e0d('0x13')]));});});};exports[_0x1e0d('0x15')]=function(_0x4b4623){var _0x4fbc44=this;return new Promise(function(_0x425730,_0xa06ef2){return db[_0x1e0d('0x5')][_0x1e0d('0x16')]({'raw':_0x4b4623[_0x1e0d('0x7')]?_0x4b4623[_0x1e0d('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x4b4623[_0x1e0d('0x7')]?_0x4b4623[_0x1e0d('0x7')][_0x1e0d('0x9')]||null:null,'attributes':_0x4b4623['options']?_0x4b4623[_0x1e0d('0x7')][_0x1e0d('0xa')]||null:null,'include':_0x4b4623['options']?_0x4b4623[_0x1e0d('0x7')][_0x1e0d('0xc')]?_[_0x1e0d('0xd')](_0x4b4623[_0x1e0d('0x7')]['include'],function(_0x6faa6f){return{'model':db[_0x6faa6f[_0x1e0d('0xe')]],'as':_0x6faa6f['as'],'attributes':_0x6faa6f[_0x1e0d('0xa')],'include':_0x6faa6f[_0x1e0d('0xc')]?_[_0x1e0d('0xd')](_0x6faa6f[_0x1e0d('0xc')],function(_0x16fb6c){return{'model':db[_0x16fb6c[_0x1e0d('0xe')]],'as':_0x16fb6c['as'],'attributes':_0x16fb6c['attributes'],'include':_0x16fb6c[_0x1e0d('0xc')]?_['map'](_0x16fb6c[_0x1e0d('0xc')],function(_0x5efea7){return{'model':db[_0x5efea7['model']],'as':_0x5efea7['as'],'attributes':_0x5efea7['attributes']};}):[]};}):[]};}):[]:[]})[_0x1e0d('0x17')](function(_0x4381ac){logger[_0x1e0d('0xf')]('ShowCmHopper',_0x4b4623);logger[_0x1e0d('0x11')](_0x1e0d('0x15'),_0x4b4623,JSON[_0x1e0d('0x18')](_0x4381ac));_0x425730(_0x4381ac);})[_0x1e0d('0x12')](function(_0x2f4c1f){logger[_0x1e0d('0x14')](_0x1e0d('0x15'),_0x2f4c1f[_0x1e0d('0x13')],_0x4b4623);_0xa06ef2(_0x4fbc44[_0x1e0d('0x14')](0x1f4,_0x2f4c1f[_0x1e0d('0x13')]));});});};exports['CreateCmHopper']=function(_0x2a76de){var _0x194f21=this;return new Promise(function(_0x4e254d,_0x20d590){return db[_0x1e0d('0x5')][_0x1e0d('0x19')](_0x2a76de[_0x1e0d('0x1a')],{'raw':_0x2a76de['options']?_0x2a76de['options'][_0x1e0d('0x8')]===undefined?!![]:![]:!![]})[_0x1e0d('0x17')](function(_0x392574){logger[_0x1e0d('0xf')](_0x1e0d('0x1b'),_0x2a76de);logger[_0x1e0d('0x11')](_0x1e0d('0x1b'),_0x2a76de,JSON[_0x1e0d('0x18')](_0x392574));_0x4e254d(_0x392574);})['catch'](function(_0x264e1b){logger[_0x1e0d('0x14')](_0x1e0d('0x1b'),_0x264e1b['message'],_0x2a76de);_0x20d590(_0x194f21[_0x1e0d('0x14')](0x1f4,_0x264e1b[_0x1e0d('0x13')]));});});};exports[_0x1e0d('0x1c')]=function(_0x1b5b14){var _0x3f4f19=this;return new Promise(function(_0x4ef4aa,_0x4dfa7a){return db['CmHopper'][_0x1e0d('0x1d')](_0x1b5b14['body'],{'raw':_0x1b5b14['options']?_0x1b5b14['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b5b14[_0x1e0d('0x7')]?_0x1b5b14[_0x1e0d('0x7')][_0x1e0d('0x9')]||null:null,'attributes':_0x1b5b14['options']?_0x1b5b14[_0x1e0d('0x7')][_0x1e0d('0xa')]||null:null,'limit':_0x1b5b14[_0x1e0d('0x7')]?_0x1b5b14[_0x1e0d('0x7')][_0x1e0d('0xb')]||null:null})[_0x1e0d('0x17')](function(_0x3600af){logger[_0x1e0d('0xf')](_0x1e0d('0x1c'),_0x1b5b14);logger['info']('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x1e0d('0x18')](_0x1b5b14['options'][_0x1e0d('0x9')]),_0x1b5b14[_0x1e0d('0x1a')][_0x1e0d('0x1e')]);logger[_0x1e0d('0x11')](_0x1e0d('0x1c'),_0x1b5b14,JSON[_0x1e0d('0x18')](_0x3600af));_0x4ef4aa(_0x3600af);})[_0x1e0d('0x12')](function(_0x18c07c){logger[_0x1e0d('0x14')](_0x1e0d('0x1c'),_0x18c07c[_0x1e0d('0x13')],_0x1b5b14);_0x4dfa7a(_0x3f4f19[_0x1e0d('0x14')](0x1f4,_0x18c07c[_0x1e0d('0x13')]));});});};exports[_0x1e0d('0x1f')]=function(_0x5d7b48){var _0x2f4774=this;return new Promise(function(_0xb0473a,_0x36b9e2){return db[_0x1e0d('0x5')][_0x1e0d('0x20')]({'where':_0x5d7b48[_0x1e0d('0x7')]?_0x5d7b48['options'][_0x1e0d('0x9')]||null:null})[_0x1e0d('0x17')](function(_0x50b05c){logger[_0x1e0d('0xf')](_0x1e0d('0x1f'),_0x5d7b48);logger[_0x1e0d('0x11')](_0x1e0d('0x1f'),_0x5d7b48,JSON[_0x1e0d('0x18')](_0x50b05c));_0xb0473a(_0x50b05c);})[_0x1e0d('0x12')](function(_0x4a6ceb){logger['error'](_0x1e0d('0x1f'),_0x4a6ceb[_0x1e0d('0x13')],_0x5d7b48);_0x36b9e2(_0x2f4774[_0x1e0d('0x14')](0x1f4,_0x4a6ceb[_0x1e0d('0x13')]));});});};exports[_0x1e0d('0x21')]=function(_0x3aa2b4){var _0x5d0060=this;return new Promise(function(_0x5372c0,_0x10de04){return db[_0x1e0d('0x22')][_0x1e0d('0x23')]()[_0x1e0d('0x17')](function(_0x354fbf){return db['sequelize'][_0x1e0d('0x24')](function(_0x53d84c){return db[_0x1e0d('0x5')][_0x1e0d('0x6')]({'where':_0x3aa2b4[_0x1e0d('0x7')]?_0x3aa2b4[_0x1e0d('0x7')][_0x1e0d('0x9')]||null:null,'attributes':_0x3aa2b4['options']?_0x3aa2b4[_0x1e0d('0x7')]['attributes']||null:null,'limit':_0x3aa2b4[_0x1e0d('0x7')]?_0x3aa2b4[_0x1e0d('0x7')][_0x1e0d('0xb')]||null:null,'order':_0x3aa2b4[_0x1e0d('0x7')]?_0x3aa2b4[_0x1e0d('0x7')]['order']||null:null,'transaction':_0x53d84c,'lock':_0x53d84c['LOCK'][_0x1e0d('0x25')],'include':[{'model':db[_0x1e0d('0x22')],'as':_0x1e0d('0x26'),'attributes':_[_0x1e0d('0x27')](_0x354fbf)},{'model':db['User'],'as':_0x1e0d('0x28'),'attributes':['id',_0x1e0d('0x29'),'voicePause']}]})[_0x1e0d('0x17')](function(_0x4617a4){var _0x256860=[];var _0x569265=[];for(var _0x2e8c63=0x0;_0x2e8c63<_0x4617a4[_0x1e0d('0x2a')];_0x2e8c63+=0x1){var _0x56100b=_0x4617a4[_0x2e8c63][_0x1e0d('0x2b')];if(_0x56100b===null){_0x256860[_0x1e0d('0x2c')](_0x4617a4[_0x2e8c63][_0x1e0d('0x1d')](_0x3aa2b4[_0x1e0d('0x1a')],{'transaction':_0x53d84c}));}else if(!_0x569265[_0x1e0d('0x2d')](_0x56100b)){_0x569265['push'](_0x56100b);_0x256860[_0x1e0d('0x2c')](_0x4617a4[_0x2e8c63][_0x1e0d('0x1d')](_0x3aa2b4[_0x1e0d('0x1a')],{'transaction':_0x53d84c}));}}return BPromise[_0x1e0d('0x2e')](_0x256860);});})[_0x1e0d('0x17')](function(_0x3a12b6){logger[_0x1e0d('0xf')](_0x1e0d('0x21'),_0x3aa2b4);if(_0x3a12b6[_0x1e0d('0x2a')]>0x0){logger['info'](_0x1e0d('0x2f'),_0x3a12b6[0x0]['dataValues']['id'],_0x3a12b6[0x0]['dataValues']['ContactId'],_0x3a12b6[0x0][_0x1e0d('0x30')][_0x1e0d('0x1e')]);}logger[_0x1e0d('0x11')](_0x1e0d('0x21'),_0x3aa2b4,JSON[_0x1e0d('0x18')](_0x3a12b6));_0x5372c0(_0x3a12b6);})[_0x1e0d('0x12')](function(_0x2e38b7){logger['error'](_0x1e0d('0x21'),_0x2e38b7['message'],_0x3aa2b4);_0x10de04(_0x5d0060[_0x1e0d('0x14')](0x1f4,_0x2e38b7['message']));});});});};exports[_0x1e0d('0x31')]=function(_0x4153aa){var _0x32a1a5=this;return new Promise(function(_0x58dffd,_0x5c2216){return db[_0x1e0d('0x32')][_0x1e0d('0x24')](function(_0x17d92f){return db['CmHopperFinal'][_0x1e0d('0x19')](_0x4153aa['body'],{'raw':_0x4153aa[_0x1e0d('0x7')]?_0x4153aa[_0x1e0d('0x7')][_0x1e0d('0x8')]===undefined?!![]:![]:!![],'transaction':_0x17d92f})[_0x1e0d('0x17')](function(){logger[_0x1e0d('0xf')](_0x1e0d('0x33'),JSON[_0x1e0d('0x18')](_0x4153aa[_0x1e0d('0x7')][_0x1e0d('0x9')]),_0x4153aa[_0x1e0d('0x7')][_0x1e0d('0x9')]['active']);return db[_0x1e0d('0x5')][_0x1e0d('0x20')]({'where':_0x4153aa[_0x1e0d('0x7')]?_0x4153aa[_0x1e0d('0x7')][_0x1e0d('0x9')]||null:null,'transaction':_0x17d92f});});})[_0x1e0d('0x17')](function(_0x5ba1b){logger[_0x1e0d('0xf')](_0x1e0d('0x31'),_0x4153aa);logger['debug']('MoveContactManagedDialer',_0x4153aa,JSON[_0x1e0d('0x18')](_0x5ba1b));_0x58dffd(_0x5ba1b);})[_0x1e0d('0x12')](function(_0x2d764f){logger[_0x1e0d('0x14')](_0x1e0d('0x31'),_0x2d764f[_0x1e0d('0x13')],_0x4153aa);_0x5c2216(_0x32a1a5[_0x1e0d('0x14')](0x1f4,_0x2d764f[_0x1e0d('0x13')]));});});};exports['CountReScheduled']=function(_0x29cc53){var _0x24a0d5=this;return new Promise(function(_0x2aa4e3,_0x4a806e){return db[_0x1e0d('0x5')][_0x1e0d('0x6')]({'raw':_0x29cc53[_0x1e0d('0x7')]?_0x29cc53[_0x1e0d('0x7')][_0x1e0d('0x8')]===undefined?!![]:![]:!![],'where':_0x29cc53['options']?_0x29cc53[_0x1e0d('0x7')][_0x1e0d('0x9')]||null:null,'attributes':[[db[_0x1e0d('0x32')]['fn'](_0x1e0d('0x34'),db['sequelize']['fn']('IF',db[_0x1e0d('0x32')][_0x1e0d('0x35')](_0x1e0d('0x36')+util[_0x1e0d('0x37')](_0x1e0d('0x38'),moment()[_0x1e0d('0x37')](_0x1e0d('0x39')))+_0x1e0d('0x3a')))),'contactsRescheduled']]})[_0x1e0d('0x17')](function(_0x12be2a){logger['info'](_0x1e0d('0x3b'),_0x29cc53);logger[_0x1e0d('0x11')]('CountReScheduled',_0x29cc53,JSON[_0x1e0d('0x18')](_0x12be2a));_0x2aa4e3(_0x12be2a);})[_0x1e0d('0x12')](function(_0x14ac6e){logger[_0x1e0d('0x14')](_0x1e0d('0x3b'),_0x14ac6e['message'],_0x29cc53);_0x4a806e(_0x24a0d5[_0x1e0d('0x14')](0x1f4,_0x14ac6e[_0x1e0d('0x13')]));});});};exports[_0x1e0d('0x3c')]=function(_0x3ab2fc){var _0x238164=this;return new Promise(function(_0x34d9f8,_0x26046b){return db[_0x1e0d('0x22')][_0x1e0d('0x23')]()[_0x1e0d('0x17')](function(){return db['sequelize'][_0x1e0d('0x24')](function(_0x6d2366){return db[_0x1e0d('0x5')][_0x1e0d('0x6')]({'where':_0x3ab2fc['options']?_0x3ab2fc[_0x1e0d('0x7')][_0x1e0d('0x9')]||null:null,'attributes':_0x3ab2fc['options']?_0x3ab2fc['options'][_0x1e0d('0xa')]||null:null,'limit':0x1,'order':_0x3ab2fc[_0x1e0d('0x7')]?_0x3ab2fc['options'][_0x1e0d('0x3d')]||null:null,'group':db[_0x1e0d('0x5')][_0x1e0d('0x2b')],'transaction':_0x6d2366,'lock':_0x6d2366[_0x1e0d('0x3e')][_0x1e0d('0x25')],'include':_0x3ab2fc['options']?_0x3ab2fc[_0x1e0d('0x7')][_0x1e0d('0xc')]?_[_0x1e0d('0xd')](_0x3ab2fc[_0x1e0d('0x7')]['include'],function(_0x1041b2){return{'model':db[_0x1041b2[_0x1e0d('0xe')]],'as':_0x1041b2['as'],'attributes':_0x1041b2[_0x1e0d('0xa')],'include':_0x1041b2[_0x1e0d('0xc')]?_['map'](_0x1041b2['include'],function(_0x4f79e3){return{'model':db[_0x4f79e3[_0x1e0d('0xe')]],'as':_0x4f79e3['as'],'attributes':_0x4f79e3[_0x1e0d('0xa')],'include':_0x4f79e3[_0x1e0d('0xc')]?_[_0x1e0d('0xd')](_0x4f79e3['include'],function(_0x115e84){return{'model':db[_0x115e84[_0x1e0d('0xe')]],'as':_0x115e84['as'],'attributes':_0x115e84[_0x1e0d('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x930906){var _0x5e3131=[];for(var _0x5c6395=0x0;_0x5c6395<_0x930906[_0x1e0d('0x2a')];_0x5c6395+=0x1){_0x5e3131[_0x1e0d('0x2c')](_0x930906[_0x5c6395][_0x1e0d('0x1d')](_0x3ab2fc[_0x1e0d('0x1a')],{'transaction':_0x6d2366}));}return BPromise[_0x1e0d('0x2e')](_0x5e3131);});})[_0x1e0d('0x17')](function(_0xfaca53){logger['info'](_0x1e0d('0x3c'),_0x3ab2fc);logger['debug'](_0x1e0d('0x3c'),_0x3ab2fc,JSON[_0x1e0d('0x18')](_0xfaca53));_0x34d9f8(_0xfaca53);})['catch'](function(_0x18082e){logger[_0x1e0d('0x14')](_0x1e0d('0x3c'),_0x18082e[_0x1e0d('0x13')],_0x3ab2fc);_0x26046b(_0x238164[_0x1e0d('0x14')](0x1f4,_0x18082e[_0x1e0d('0x13')]));});});});};exports[_0x1e0d('0x3f')]=function(_0x4b5f86){var _0x348c3c=this;return new Promise(function(_0x16de67,_0x582e31){db[_0x1e0d('0x22')][_0x1e0d('0x23')]()[_0x1e0d('0x17')](function(_0x1d74de){return db['CmHopper'][_0x1e0d('0x6')]({'raw':_0x4b5f86[_0x1e0d('0x7')]?_0x4b5f86[_0x1e0d('0x7')][_0x1e0d('0x8')]===undefined?!![]:![]:!![],'where':_0x4b5f86[_0x1e0d('0x7')]?_0x4b5f86[_0x1e0d('0x7')][_0x1e0d('0x9')]||null:null,'attributes':_0x4b5f86[_0x1e0d('0x7')]?_0x4b5f86[_0x1e0d('0x7')][_0x1e0d('0xa')]||null:null,'limit':_0x4b5f86[_0x1e0d('0x7')]?_0x4b5f86[_0x1e0d('0x7')]['limit']||null:null,'include':_0x4b5f86[_0x1e0d('0x7')]?_0x4b5f86[_0x1e0d('0x7')][_0x1e0d('0xc')]?_['map'](_0x4b5f86[_0x1e0d('0x7')][_0x1e0d('0xc')],function(_0x57d40a){return{'model':db[_0x57d40a[_0x1e0d('0xe')]],'as':_0x57d40a['as'],'attributes':_0x57d40a['as']===_0x1e0d('0x26')?_['keys'](_0x1d74de):_0x57d40a[_0x1e0d('0xa')],'include':_0x57d40a['include']?_[_0x1e0d('0xd')](_0x57d40a['include'],function(_0x5d75a5){return{'model':db[_0x5d75a5['model']],'as':_0x5d75a5['as'],'attributes':_0x5d75a5[_0x1e0d('0xa')],'include':_0x5d75a5[_0x1e0d('0xc')]?_['map'](_0x5d75a5['include'],function(_0x3b061e){return{'model':db[_0x3b061e[_0x1e0d('0xe')]],'as':_0x3b061e['as'],'attributes':_0x3b061e[_0x1e0d('0xa')]};}):[]};}):[]};}):[]:[]})[_0x1e0d('0x17')](function(_0x1479e5){logger[_0x1e0d('0xf')](_0x1e0d('0x10'),_0x4b5f86);logger[_0x1e0d('0x11')](_0x1e0d('0x10'),_0x4b5f86,JSON['stringify'](_0x1479e5));_0x16de67(_0x1479e5);})[_0x1e0d('0x12')](function(_0x178a16){logger[_0x1e0d('0x14')](_0x1e0d('0x10'),_0x178a16[_0x1e0d('0x13')],_0x4b5f86);_0x582e31(_0x348c3c[_0x1e0d('0x14')](0x1f4,_0x178a16[_0x1e0d('0x13')]));});});});};exports[_0x1e0d('0x40')]=function(_0x2c31d7){var _0x22b98e=this;return new Promise(function(_0x3afa1b,_0x13a93b){return db[_0x1e0d('0x22')]['findOne']({'raw':!![],'where':{'phone':_0x2c31d7['options'][_0x1e0d('0x9')][_0x1e0d('0x41')]},'attributes':['id',_0x1e0d('0x42')],'order':[['id',_0x1e0d('0x43')]]})[_0x1e0d('0x17')](function(_0x51e682){logger[_0x1e0d('0xf')](_0x1e0d('0x44'),_0x2c31d7);logger[_0x1e0d('0x11')](_0x1e0d('0x44'),_0x2c31d7,JSON[_0x1e0d('0x18')](_0x51e682));_0x3afa1b(_0x51e682);})[_0x1e0d('0x12')](function(_0x3a2d41){logger[_0x1e0d('0x14')](_0x1e0d('0x44'),_0x3a2d41['message'],_0x2c31d7);_0x13a93b(_0x22b98e[_0x1e0d('0x14')](0x1f4,_0x3a2d41['message']));});});};exports[_0x1e0d('0x45')]=function(_0x4a5d49){var _0x58d46f=this;return new Promise(function(_0x2149fc,_0x326a77){return db[_0x1e0d('0x32')][_0x1e0d('0x24')](function(_0x896d0e){var _0x462d47=_0x4a5d49[_0x1e0d('0x7')]&&_0x4a5d49[_0x1e0d('0x7')]['where']?_0x4a5d49['options'][_0x1e0d('0x9')]:{};return db[_0x1e0d('0x5')][_0x1e0d('0x1d')](_0x4a5d49[_0x1e0d('0x1a')],{'where':_0x462d47,'transaction':_0x896d0e})[_0x1e0d('0x17')](function(_0xd8ce3c){logger[_0x1e0d('0xf')](_0x1e0d('0x45'),_0x4a5d49);logger[_0x1e0d('0x11')]('ResetActiveCalls',_0x4a5d49,JSON[_0x1e0d('0x18')](_0xd8ce3c));_0x2149fc(_0xd8ce3c);})[_0x1e0d('0x12')](function(_0x11551f){logger[_0x1e0d('0x14')](_0x1e0d('0x45'),_0x11551f[_0x1e0d('0x13')],_0x4a5d49);_0x326a77(_0x58d46f[_0x1e0d('0x14')](0x1f4,_0x11551f[_0x1e0d('0x13')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x3dc62f){var _0x30ca70=this;var _0x50672c=_0x3dc62f[_0x1e0d('0x1a')][_0x1e0d('0x9')]['voiceQueueIds'];var _0x2e7664=_0x3dc62f['body']['where'][_0x1e0d('0x46')];var _0x136a13=_0x3dc62f['body']['where']['availableAgentsIds'];return new Promise(function(_0x4535a4,_0x2b658e){return db['CmHopper'][_0x1e0d('0x6')]({'where':{'voiceQueueId':{'$in':_0x50672c},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x1e0d('0x32')][_0x1e0d('0x35')](_0x1e0d('0x47')+_0x2e7664+_0x1e0d('0x48')),'$gt':db[_0x1e0d('0x32')][_0x1e0d('0x35')]('NOW()')}},'UserId':{'$in':_0x136a13}},'include':[{'model':db[_0x1e0d('0x22')],'as':_0x1e0d('0x26')},{'model':db[_0x1e0d('0x49')],'as':'Agent','attributes':['id',_0x1e0d('0x29'),_0x1e0d('0x4a')]},{'model':db['CmList'],'as':_0x1e0d('0x4b')}]})[_0x1e0d('0x17')](function(_0x54bac2){if(_0x54bac2[_0x1e0d('0x2a')]>0x0){return db[_0x1e0d('0x32')][_0x1e0d('0x24')](function(_0x5e52c7){return db[_0x1e0d('0x5')][_0x1e0d('0x1d')]({'recallmeNotifiedDate':db[_0x1e0d('0x32')]['literal'](_0x1e0d('0x4c'))},{'where':{'id':{'$in':_[_0x1e0d('0xd')](_0x54bac2,'id')}},'transaction':_0x5e52c7})[_0x1e0d('0x17')](function(){_0x4535a4(_0x54bac2);})['catch'](function(_0x2764af){logger[_0x1e0d('0x14')](_0x1e0d('0x4d'),_0x2764af[_0x1e0d('0x13')],_0x3dc62f);_0x2b658e(_0x30ca70[_0x1e0d('0x14')](0x1f4,_0x2764af[_0x1e0d('0x13')]));});})[_0x1e0d('0x12')](function(_0xc7e5cb){logger[_0x1e0d('0x14')](_0x1e0d('0x4d'),_0xc7e5cb['message'],_0x3dc62f);_0x2b658e(_0x30ca70[_0x1e0d('0x14')](0x1f4,_0xc7e5cb['message']));});}else{_0x4535a4(_0x54bac2);}});});}; \ No newline at end of file +var _0x9edf=['ContactId','MoveContactManagedDialer','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','all','keys','GetContactByPhone','findOne','phone','dialTimezone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','name','CmList','List','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','options','limit','include','model','attributes','map','then','info','debug','stringify','message','error','ShowCmHopper','where','catch','CreateCmHopper','create','body','UpdateCmHopper','raw','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','findAll','order','LOCK','UPDATE','Contact','User','Agent','voicePause','length','UserId','push','update','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues'];(function(_0x4c1f3a,_0x489fa2){var _0x20e44e=function(_0x365a6b){while(--_0x365a6b){_0x4c1f3a['push'](_0x4c1f3a['shift']());}};_0x20e44e(++_0x489fa2);}(_0x9edf,0x15d));var _0xf9ed=function(_0x48688c,_0x2c3e98){_0x48688c=_0x48688c-0x0;var _0x467f6e=_0x9edf[_0x48688c];return _0x467f6e;};'use strict';var _=require(_0xf9ed('0x0'));var util=require('util');var moment=require(_0xf9ed('0x1'));var BPromise=require(_0xf9ed('0x2'));var db=require(_0xf9ed('0x3'))['db'];var logger=require(_0xf9ed('0x4'))(_0xf9ed('0x5'));exports[_0xf9ed('0x6')]=function(_0x2d83f9){var _0x1122ac=this;return new Promise(function(_0x59fb82,_0x29706a){return db[_0xf9ed('0x7')]['findAll']({'raw':_0x2d83f9[_0xf9ed('0x8')]?_0x2d83f9[_0xf9ed('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x2d83f9['options']?_0x2d83f9['options']['where']||null:null,'attributes':_0x2d83f9['options']?_0x2d83f9[_0xf9ed('0x8')]['attributes']||null:null,'limit':_0x2d83f9['options']?_0x2d83f9[_0xf9ed('0x8')][_0xf9ed('0x9')]||null:null,'include':_0x2d83f9[_0xf9ed('0x8')]?_0x2d83f9[_0xf9ed('0x8')][_0xf9ed('0xa')]?_['map'](_0x2d83f9[_0xf9ed('0x8')][_0xf9ed('0xa')],function(_0x51313d){return{'model':db[_0x51313d[_0xf9ed('0xb')]],'as':_0x51313d['as'],'attributes':_0x51313d[_0xf9ed('0xc')],'include':_0x51313d['include']?_[_0xf9ed('0xd')](_0x51313d['include'],function(_0x4c3f9e){return{'model':db[_0x4c3f9e[_0xf9ed('0xb')]],'as':_0x4c3f9e['as'],'attributes':_0x4c3f9e[_0xf9ed('0xc')],'include':_0x4c3f9e[_0xf9ed('0xa')]?_[_0xf9ed('0xd')](_0x4c3f9e[_0xf9ed('0xa')],function(_0x3af976){return{'model':db[_0x3af976[_0xf9ed('0xb')]],'as':_0x3af976['as'],'attributes':_0x3af976[_0xf9ed('0xc')]};}):[]};}):[]};}):[]:[]})[_0xf9ed('0xe')](function(_0x5ca1c1){logger[_0xf9ed('0xf')]('GetCmHopper',_0x2d83f9);logger[_0xf9ed('0x10')](_0xf9ed('0x6'),_0x2d83f9,JSON[_0xf9ed('0x11')](_0x5ca1c1));_0x59fb82(_0x5ca1c1);})['catch'](function(_0x2841e8){logger['error']('GetCmHopper',_0x2841e8[_0xf9ed('0x12')],_0x2d83f9);_0x29706a(_0x1122ac[_0xf9ed('0x13')](0x1f4,_0x2841e8['message']));});});};exports[_0xf9ed('0x14')]=function(_0x22146f){var _0x257d06=this;return new Promise(function(_0x58e417,_0x47ddfb){return db[_0xf9ed('0x7')]['find']({'raw':_0x22146f['options']?_0x22146f[_0xf9ed('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x22146f[_0xf9ed('0x8')]?_0x22146f[_0xf9ed('0x8')][_0xf9ed('0x15')]||null:null,'attributes':_0x22146f[_0xf9ed('0x8')]?_0x22146f[_0xf9ed('0x8')][_0xf9ed('0xc')]||null:null,'include':_0x22146f[_0xf9ed('0x8')]?_0x22146f[_0xf9ed('0x8')]['include']?_[_0xf9ed('0xd')](_0x22146f[_0xf9ed('0x8')][_0xf9ed('0xa')],function(_0xca97fb){return{'model':db[_0xca97fb[_0xf9ed('0xb')]],'as':_0xca97fb['as'],'attributes':_0xca97fb[_0xf9ed('0xc')],'include':_0xca97fb['include']?_['map'](_0xca97fb[_0xf9ed('0xa')],function(_0x20f281){return{'model':db[_0x20f281[_0xf9ed('0xb')]],'as':_0x20f281['as'],'attributes':_0x20f281[_0xf9ed('0xc')],'include':_0x20f281[_0xf9ed('0xa')]?_[_0xf9ed('0xd')](_0x20f281['include'],function(_0x3a6c44){return{'model':db[_0x3a6c44['model']],'as':_0x3a6c44['as'],'attributes':_0x3a6c44[_0xf9ed('0xc')]};}):[]};}):[]};}):[]:[]})[_0xf9ed('0xe')](function(_0x220983){logger[_0xf9ed('0xf')](_0xf9ed('0x14'),_0x22146f);logger[_0xf9ed('0x10')]('ShowCmHopper',_0x22146f,JSON[_0xf9ed('0x11')](_0x220983));_0x58e417(_0x220983);})[_0xf9ed('0x16')](function(_0x48befc){logger[_0xf9ed('0x13')](_0xf9ed('0x14'),_0x48befc[_0xf9ed('0x12')],_0x22146f);_0x47ddfb(_0x257d06[_0xf9ed('0x13')](0x1f4,_0x48befc[_0xf9ed('0x12')]));});});};exports[_0xf9ed('0x17')]=function(_0x3bb12f){var _0x387cd5=this;return new Promise(function(_0x55e660,_0x2dc446){return db[_0xf9ed('0x7')][_0xf9ed('0x18')](_0x3bb12f[_0xf9ed('0x19')],{'raw':_0x3bb12f['options']?_0x3bb12f[_0xf9ed('0x8')]['raw']===undefined?!![]:![]:!![]})[_0xf9ed('0xe')](function(_0xa9c03d){logger['info'](_0xf9ed('0x17'),_0x3bb12f);logger[_0xf9ed('0x10')](_0xf9ed('0x17'),_0x3bb12f,JSON[_0xf9ed('0x11')](_0xa9c03d));_0x55e660(_0xa9c03d);})[_0xf9ed('0x16')](function(_0x34044d){logger[_0xf9ed('0x13')](_0xf9ed('0x17'),_0x34044d[_0xf9ed('0x12')],_0x3bb12f);_0x2dc446(_0x387cd5[_0xf9ed('0x13')](0x1f4,_0x34044d[_0xf9ed('0x12')]));});});};exports[_0xf9ed('0x1a')]=function(_0x17b2c1){var _0x5cb3f1=this;return new Promise(function(_0x418990,_0x54d7c0){return db['CmHopper']['update'](_0x17b2c1[_0xf9ed('0x19')],{'raw':_0x17b2c1[_0xf9ed('0x8')]?_0x17b2c1[_0xf9ed('0x8')][_0xf9ed('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17b2c1[_0xf9ed('0x8')]?_0x17b2c1['options'][_0xf9ed('0x15')]||null:null,'attributes':_0x17b2c1[_0xf9ed('0x8')]?_0x17b2c1[_0xf9ed('0x8')][_0xf9ed('0xc')]||null:null,'limit':_0x17b2c1['options']?_0x17b2c1[_0xf9ed('0x8')][_0xf9ed('0x9')]||null:null})[_0xf9ed('0xe')](function(_0x3d8a54){logger[_0xf9ed('0xf')](_0xf9ed('0x1a'),_0x17b2c1);logger[_0xf9ed('0xf')](_0xf9ed('0x1c'),JSON[_0xf9ed('0x11')](_0x17b2c1[_0xf9ed('0x8')][_0xf9ed('0x15')]),_0x17b2c1[_0xf9ed('0x19')][_0xf9ed('0x1d')]);logger['debug'](_0xf9ed('0x1a'),_0x17b2c1,JSON['stringify'](_0x3d8a54));_0x418990(_0x3d8a54);})['catch'](function(_0x26315b){logger['error'](_0xf9ed('0x1a'),_0x26315b[_0xf9ed('0x12')],_0x17b2c1);_0x54d7c0(_0x5cb3f1[_0xf9ed('0x13')](0x1f4,_0x26315b[_0xf9ed('0x12')]));});});};exports['DestroyCmHopper']=function(_0x3a6a5e){var _0x6876f4=this;return new Promise(function(_0xe4a241,_0x1fd299){return db[_0xf9ed('0x7')][_0xf9ed('0x1e')]({'where':_0x3a6a5e[_0xf9ed('0x8')]?_0x3a6a5e['options']['where']||null:null})['then'](function(_0x5c9eac){logger[_0xf9ed('0xf')](_0xf9ed('0x1f'),_0x3a6a5e);logger[_0xf9ed('0x10')]('DestroyCmHopper',_0x3a6a5e,JSON['stringify'](_0x5c9eac));_0xe4a241(_0x5c9eac);})[_0xf9ed('0x16')](function(_0xd85736){logger[_0xf9ed('0x13')](_0xf9ed('0x1f'),_0xd85736[_0xf9ed('0x12')],_0x3a6a5e);_0x1fd299(_0x6876f4[_0xf9ed('0x13')](0x1f4,_0xd85736[_0xf9ed('0x12')]));});});};exports[_0xf9ed('0x20')]=function(_0x38aba3){var _0x44f1ea=this;return new Promise(function(_0x142aad,_0x14016f){return db[_0xf9ed('0x21')][_0xf9ed('0x22')]()[_0xf9ed('0xe')](function(_0x28a0e6){return db[_0xf9ed('0x23')][_0xf9ed('0x24')](function(_0x4f6425){return db[_0xf9ed('0x7')][_0xf9ed('0x25')]({'where':_0x38aba3[_0xf9ed('0x8')]?_0x38aba3[_0xf9ed('0x8')][_0xf9ed('0x15')]||null:null,'attributes':_0x38aba3[_0xf9ed('0x8')]?_0x38aba3[_0xf9ed('0x8')]['attributes']||null:null,'limit':_0x38aba3[_0xf9ed('0x8')]?_0x38aba3[_0xf9ed('0x8')][_0xf9ed('0x9')]||null:null,'order':_0x38aba3[_0xf9ed('0x8')]?_0x38aba3['options'][_0xf9ed('0x26')]||null:null,'transaction':_0x4f6425,'lock':_0x4f6425[_0xf9ed('0x27')][_0xf9ed('0x28')],'include':[{'model':db['CmContact'],'as':_0xf9ed('0x29'),'attributes':_['keys'](_0x28a0e6)},{'model':db[_0xf9ed('0x2a')],'as':_0xf9ed('0x2b'),'attributes':['id','name',_0xf9ed('0x2c')]}]})[_0xf9ed('0xe')](function(_0x33bbea){var _0x4c30c6=[];var _0x2716ec=[];for(var _0x47ee77=0x0;_0x47ee77<_0x33bbea[_0xf9ed('0x2d')];_0x47ee77+=0x1){var _0x55e66e=_0x33bbea[_0x47ee77][_0xf9ed('0x2e')];if(_0x55e66e===null){_0x4c30c6[_0xf9ed('0x2f')](_0x33bbea[_0x47ee77]['update'](_0x38aba3[_0xf9ed('0x19')],{'transaction':_0x4f6425}));}else if(!_0x2716ec['includes'](_0x55e66e)){_0x2716ec[_0xf9ed('0x2f')](_0x55e66e);_0x4c30c6[_0xf9ed('0x2f')](_0x33bbea[_0x47ee77][_0xf9ed('0x30')](_0x38aba3['body'],{'transaction':_0x4f6425}));}}return BPromise['all'](_0x4c30c6);});})[_0xf9ed('0xe')](function(_0x1d0710){logger[_0xf9ed('0xf')](_0xf9ed('0x20'),_0x38aba3);if(_0x1d0710[_0xf9ed('0x2d')]>0x0){logger[_0xf9ed('0xf')](_0xf9ed('0x31'),_0x1d0710[0x0][_0xf9ed('0x32')]['id'],_0x1d0710[0x0]['dataValues'][_0xf9ed('0x33')],_0x1d0710[0x0][_0xf9ed('0x32')]['active']);}logger[_0xf9ed('0x10')](_0xf9ed('0x20'),_0x38aba3,JSON[_0xf9ed('0x11')](_0x1d0710));_0x142aad(_0x1d0710);})[_0xf9ed('0x16')](function(_0x577d26){logger[_0xf9ed('0x13')](_0xf9ed('0x20'),_0x577d26['message'],_0x38aba3);_0x14016f(_0x44f1ea['error'](0x1f4,_0x577d26[_0xf9ed('0x12')]));});});});};exports[_0xf9ed('0x34')]=function(_0x36b20e){var _0x3b10d7=this;return new Promise(function(_0x2a795a,_0x40c711){return db[_0xf9ed('0x23')][_0xf9ed('0x24')](function(_0x4b1c1f){return db['CmHopperFinal'][_0xf9ed('0x18')](_0x36b20e[_0xf9ed('0x19')],{'raw':_0x36b20e[_0xf9ed('0x8')]?_0x36b20e[_0xf9ed('0x8')]['raw']===undefined?!![]:![]:!![],'transaction':_0x4b1c1f})[_0xf9ed('0xe')](function(){logger[_0xf9ed('0xf')](_0xf9ed('0x35'),JSON[_0xf9ed('0x11')](_0x36b20e[_0xf9ed('0x8')]['where']),_0x36b20e[_0xf9ed('0x8')]['where'][_0xf9ed('0x1d')]);return db['CmHopper'][_0xf9ed('0x1e')]({'where':_0x36b20e[_0xf9ed('0x8')]?_0x36b20e[_0xf9ed('0x8')]['where']||null:null,'transaction':_0x4b1c1f});});})[_0xf9ed('0xe')](function(_0xfdec8f){logger[_0xf9ed('0xf')](_0xf9ed('0x34'),_0x36b20e);logger['debug']('MoveContactManagedDialer',_0x36b20e,JSON[_0xf9ed('0x11')](_0xfdec8f));_0x2a795a(_0xfdec8f);})[_0xf9ed('0x16')](function(_0x5ae60b){logger['error']('MoveContactManagedDialer',_0x5ae60b[_0xf9ed('0x12')],_0x36b20e);_0x40c711(_0x3b10d7[_0xf9ed('0x13')](0x1f4,_0x5ae60b[_0xf9ed('0x12')]));});});};exports[_0xf9ed('0x36')]=function(_0x439dbc){var _0x2f4e97=this;return new Promise(function(_0x389fb5,_0x381b0b){return db[_0xf9ed('0x7')][_0xf9ed('0x25')]({'raw':_0x439dbc[_0xf9ed('0x8')]?_0x439dbc['options'][_0xf9ed('0x1b')]===undefined?!![]:![]:!![],'where':_0x439dbc['options']?_0x439dbc[_0xf9ed('0x8')]['where']||null:null,'attributes':[[db[_0xf9ed('0x23')]['fn'](_0xf9ed('0x37'),db[_0xf9ed('0x23')]['fn']('IF',db['sequelize'][_0xf9ed('0x38')]('`scheduledat`\x20>=\x20'+util[_0xf9ed('0x39')](_0xf9ed('0x3a'),moment()[_0xf9ed('0x39')](_0xf9ed('0x3b')))+_0xf9ed('0x3c')))),_0xf9ed('0x3d')]]})['then'](function(_0x114fef){logger['info']('CountReScheduled',_0x439dbc);logger[_0xf9ed('0x10')](_0xf9ed('0x36'),_0x439dbc,JSON[_0xf9ed('0x11')](_0x114fef));_0x389fb5(_0x114fef);})[_0xf9ed('0x16')](function(_0x4d37d3){logger['error'](_0xf9ed('0x36'),_0x4d37d3[_0xf9ed('0x12')],_0x439dbc);_0x381b0b(_0x2f4e97[_0xf9ed('0x13')](0x1f4,_0x4d37d3[_0xf9ed('0x12')]));});});};exports['GetContactRecallMe']=function(_0x5d5e12){var _0x33b446=this;return new Promise(function(_0x311371,_0x5a2bd1){return db[_0xf9ed('0x21')][_0xf9ed('0x22')]()[_0xf9ed('0xe')](function(){return db[_0xf9ed('0x23')][_0xf9ed('0x24')](function(_0x886f7c){return db[_0xf9ed('0x7')][_0xf9ed('0x25')]({'where':_0x5d5e12[_0xf9ed('0x8')]?_0x5d5e12[_0xf9ed('0x8')][_0xf9ed('0x15')]||null:null,'attributes':_0x5d5e12[_0xf9ed('0x8')]?_0x5d5e12[_0xf9ed('0x8')]['attributes']||null:null,'limit':0x1,'order':_0x5d5e12[_0xf9ed('0x8')]?_0x5d5e12['options'][_0xf9ed('0x26')]||null:null,'group':db[_0xf9ed('0x7')][_0xf9ed('0x2e')],'transaction':_0x886f7c,'lock':_0x886f7c[_0xf9ed('0x27')][_0xf9ed('0x28')],'include':_0x5d5e12['options']?_0x5d5e12['options'][_0xf9ed('0xa')]?_['map'](_0x5d5e12[_0xf9ed('0x8')][_0xf9ed('0xa')],function(_0x2e26a5){return{'model':db[_0x2e26a5['model']],'as':_0x2e26a5['as'],'attributes':_0x2e26a5['attributes'],'include':_0x2e26a5[_0xf9ed('0xa')]?_['map'](_0x2e26a5[_0xf9ed('0xa')],function(_0x119269){return{'model':db[_0x119269['model']],'as':_0x119269['as'],'attributes':_0x119269['attributes'],'include':_0x119269['include']?_[_0xf9ed('0xd')](_0x119269[_0xf9ed('0xa')],function(_0x401e44){return{'model':db[_0x401e44[_0xf9ed('0xb')]],'as':_0x401e44['as'],'attributes':_0x401e44[_0xf9ed('0xc')]};}):[]};}):[]};}):[]:[]})[_0xf9ed('0xe')](function(_0xae6d96){var _0x49d739=[];for(var _0x560c87=0x0;_0x560c87<_0xae6d96[_0xf9ed('0x2d')];_0x560c87+=0x1){_0x49d739[_0xf9ed('0x2f')](_0xae6d96[_0x560c87][_0xf9ed('0x30')](_0x5d5e12[_0xf9ed('0x19')],{'transaction':_0x886f7c}));}return BPromise[_0xf9ed('0x3e')](_0x49d739);});})[_0xf9ed('0xe')](function(_0x33f8ea){logger[_0xf9ed('0xf')]('GetContactRecallMe',_0x5d5e12);logger[_0xf9ed('0x10')]('GetContactRecallMe',_0x5d5e12,JSON[_0xf9ed('0x11')](_0x33f8ea));_0x311371(_0x33f8ea);})[_0xf9ed('0x16')](function(_0x447bfd){logger['error']('GetContactRecallMe',_0x447bfd[_0xf9ed('0x12')],_0x5d5e12);_0x5a2bd1(_0x33b446[_0xf9ed('0x13')](0x1f4,_0x447bfd[_0xf9ed('0x12')]));});});});};exports['GetCmHopperPreview']=function(_0x297a69){var _0x912bc5=this;return new Promise(function(_0xdf21fd,_0x5a31d4){db['CmContact'][_0xf9ed('0x22')]()[_0xf9ed('0xe')](function(_0x37f9f3){return db[_0xf9ed('0x7')][_0xf9ed('0x25')]({'raw':_0x297a69[_0xf9ed('0x8')]?_0x297a69['options'][_0xf9ed('0x1b')]===undefined?!![]:![]:!![],'where':_0x297a69['options']?_0x297a69[_0xf9ed('0x8')][_0xf9ed('0x15')]||null:null,'attributes':_0x297a69[_0xf9ed('0x8')]?_0x297a69[_0xf9ed('0x8')]['attributes']||null:null,'limit':_0x297a69[_0xf9ed('0x8')]?_0x297a69[_0xf9ed('0x8')]['limit']||null:null,'include':_0x297a69[_0xf9ed('0x8')]?_0x297a69[_0xf9ed('0x8')][_0xf9ed('0xa')]?_[_0xf9ed('0xd')](_0x297a69[_0xf9ed('0x8')][_0xf9ed('0xa')],function(_0x56495e){return{'model':db[_0x56495e['model']],'as':_0x56495e['as'],'attributes':_0x56495e['as']===_0xf9ed('0x29')?_[_0xf9ed('0x3f')](_0x37f9f3):_0x56495e[_0xf9ed('0xc')],'include':_0x56495e[_0xf9ed('0xa')]?_[_0xf9ed('0xd')](_0x56495e[_0xf9ed('0xa')],function(_0x14e447){return{'model':db[_0x14e447[_0xf9ed('0xb')]],'as':_0x14e447['as'],'attributes':_0x14e447[_0xf9ed('0xc')],'include':_0x14e447[_0xf9ed('0xa')]?_[_0xf9ed('0xd')](_0x14e447[_0xf9ed('0xa')],function(_0x1aa569){return{'model':db[_0x1aa569[_0xf9ed('0xb')]],'as':_0x1aa569['as'],'attributes':_0x1aa569[_0xf9ed('0xc')]};}):[]};}):[]};}):[]:[]})[_0xf9ed('0xe')](function(_0x189810){logger[_0xf9ed('0xf')]('GetCmHopper',_0x297a69);logger[_0xf9ed('0x10')](_0xf9ed('0x6'),_0x297a69,JSON[_0xf9ed('0x11')](_0x189810));_0xdf21fd(_0x189810);})[_0xf9ed('0x16')](function(_0x39461a){logger[_0xf9ed('0x13')](_0xf9ed('0x6'),_0x39461a['message'],_0x297a69);_0x5a31d4(_0x912bc5[_0xf9ed('0x13')](0x1f4,_0x39461a[_0xf9ed('0x12')]));});});});};exports[_0xf9ed('0x40')]=function(_0x47bfd9){var _0x124e60=this;return new Promise(function(_0x340320,_0x53a144){return db[_0xf9ed('0x21')][_0xf9ed('0x41')]({'raw':!![],'where':{'phone':_0x47bfd9[_0xf9ed('0x8')][_0xf9ed('0x15')][_0xf9ed('0x42')]},'attributes':['id',_0xf9ed('0x43')],'order':[['id','DESC']]})['then'](function(_0x444a02){logger[_0xf9ed('0xf')]('getContactByPhone',_0x47bfd9);logger[_0xf9ed('0x10')](_0xf9ed('0x44'),_0x47bfd9,JSON[_0xf9ed('0x11')](_0x444a02));_0x340320(_0x444a02);})['catch'](function(_0x266094){logger[_0xf9ed('0x13')](_0xf9ed('0x44'),_0x266094[_0xf9ed('0x12')],_0x47bfd9);_0x53a144(_0x124e60['error'](0x1f4,_0x266094[_0xf9ed('0x12')]));});});};exports[_0xf9ed('0x45')]=function(_0x29c410){var _0x500e11=this;return new Promise(function(_0xcbecb1,_0x2eb793){return db[_0xf9ed('0x23')][_0xf9ed('0x24')](function(_0x57ec55){var _0x3d29bb=_0x29c410[_0xf9ed('0x8')]&&_0x29c410[_0xf9ed('0x8')][_0xf9ed('0x15')]?_0x29c410[_0xf9ed('0x8')][_0xf9ed('0x15')]:{};return db[_0xf9ed('0x7')][_0xf9ed('0x30')](_0x29c410[_0xf9ed('0x19')],{'where':_0x3d29bb,'transaction':_0x57ec55})[_0xf9ed('0xe')](function(_0x39c13e){logger['info'](_0xf9ed('0x45'),_0x29c410);logger[_0xf9ed('0x10')]('ResetActiveCalls',_0x29c410,JSON[_0xf9ed('0x11')](_0x39c13e));_0xcbecb1(_0x39c13e);})[_0xf9ed('0x16')](function(_0x53a50f){logger['error'](_0xf9ed('0x45'),_0x53a50f[_0xf9ed('0x12')],_0x29c410);_0x2eb793(_0x500e11[_0xf9ed('0x13')](0x1f4,_0x53a50f['message']));});});});};exports[_0xf9ed('0x46')]=function(_0x42b82b){var _0x51c95=this;var _0x1a42c9=_0x42b82b[_0xf9ed('0x19')][_0xf9ed('0x15')][_0xf9ed('0x47')];var _0x32ae76=_0x42b82b[_0xf9ed('0x19')][_0xf9ed('0x15')][_0xf9ed('0x48')];var _0x2938c5=_0x42b82b[_0xf9ed('0x19')]['where'][_0xf9ed('0x49')];return new Promise(function(_0x49b327,_0x5097e5){return db['CmHopper'][_0xf9ed('0x25')]({'where':{'voiceQueueId':{'$in':_0x1a42c9},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xf9ed('0x23')][_0xf9ed('0x38')](_0xf9ed('0x4a')+_0x32ae76+_0xf9ed('0x4b')),'$gt':db[_0xf9ed('0x23')][_0xf9ed('0x38')](_0xf9ed('0x4c'))}},'UserId':{'$in':_0x2938c5}},'include':[{'model':db[_0xf9ed('0x21')],'as':'Contact'},{'model':db[_0xf9ed('0x2a')],'as':_0xf9ed('0x2b'),'attributes':['id',_0xf9ed('0x4d'),_0xf9ed('0x2c')]},{'model':db[_0xf9ed('0x4e')],'as':_0xf9ed('0x4f')}]})['then'](function(_0x37024c){if(_0x37024c[_0xf9ed('0x2d')]>0x0){return db['sequelize'][_0xf9ed('0x24')](function(_0x233082){return db['CmHopper'][_0xf9ed('0x30')]({'recallmeNotifiedDate':db[_0xf9ed('0x23')][_0xf9ed('0x38')]('NOW()')},{'where':{'id':{'$in':_[_0xf9ed('0xd')](_0x37024c,'id')}},'transaction':_0x233082})[_0xf9ed('0xe')](function(){_0x49b327(_0x37024c);})[_0xf9ed('0x16')](function(_0x17a1c1){logger[_0xf9ed('0x13')](_0xf9ed('0x46'),_0x17a1c1[_0xf9ed('0x12')],_0x42b82b);_0x5097e5(_0x51c95[_0xf9ed('0x13')](0x1f4,_0x17a1c1['message']));});})[_0xf9ed('0x16')](function(_0x3f1697){logger[_0xf9ed('0x13')](_0xf9ed('0x46'),_0x3f1697[_0xf9ed('0x12')],_0x42b82b);_0x5097e5(_0x51c95[_0xf9ed('0x13')](0x1f4,_0x3f1697[_0xf9ed('0x12')]));});}else{_0x49b327(_0x37024c);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 62931e0..2a8e610 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 _0xe0ad=['/:id','/:id/previewrecall','post','create','/preview','/timezone','getTimezone','update','delete','destroy','exports','Router','../../components/auth/service','./cmHopper.controller','isAuthenticated','get','/opencontacts','/timezones'];(function(_0x16aea0,_0x1ff3a9){var _0x5b2343=function(_0x42a786){while(--_0x42a786){_0x16aea0['push'](_0x16aea0['shift']());}};_0x5b2343(++_0x1ff3a9);}(_0xe0ad,0x197));var _0xde0a=function(_0x332ca0,_0x566ce4){_0x332ca0=_0x332ca0-0x0;var _0x15ae30=_0xe0ad[_0x332ca0];return _0x15ae30;};'use strict';var express=require('express');var router=express[_0xde0a('0x0')]();var auth=require(_0xde0a('0x1'));var controller=require(_0xde0a('0x2'));router['get']('/',auth[_0xde0a('0x3')](),controller['index']);router['get']('/describe',auth[_0xde0a('0x3')](),controller['describe']);router[_0xde0a('0x4')](_0xde0a('0x5'),auth['isAuthenticated'](),controller['getOpenContacts']);router[_0xde0a('0x4')](_0xde0a('0x6'),auth[_0xde0a('0x3')](),controller['getTimezones']);router[_0xde0a('0x4')](_0xde0a('0x7'),auth[_0xde0a('0x3')](),controller['show']);router['get'](_0xde0a('0x8'),auth[_0xde0a('0x3')](),controller['getPreviewRecall']);router[_0xde0a('0x9')]('/',auth[_0xde0a('0x3')](),controller[_0xde0a('0xa')]);router[_0xde0a('0x9')](_0xde0a('0xb'),auth[_0xde0a('0x3')](),controller['getPreview']);router[_0xde0a('0x9')](_0xde0a('0xc'),auth[_0xde0a('0x3')](),controller[_0xde0a('0xd')]);router['put'](_0xde0a('0x7'),auth[_0xde0a('0x3')](),controller[_0xde0a('0xe')]);router[_0xde0a('0xf')]('/:id',auth[_0xde0a('0x3')](),controller[_0xde0a('0x10')]);module[_0xde0a('0x11')]=router; \ No newline at end of file +var _0x032c=['getTimezone','put','update','destroy','exports','express','../../components/auth/service','./cmHopper.controller','isAuthenticated','index','get','/describe','describe','/opencontacts','/timezones','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone'];(function(_0x435d49,_0xe63b56){var _0x40a43d=function(_0x427d95){while(--_0x427d95){_0x435d49['push'](_0x435d49['shift']());}};_0x40a43d(++_0xe63b56);}(_0x032c,0x1c7));var _0xc032=function(_0x74746c,_0x4b0a70){_0x74746c=_0x74746c-0x0;var _0xfdb2f6=_0x032c[_0x74746c];return _0xfdb2f6;};'use strict';var express=require(_0xc032('0x0'));var router=express['Router']();var auth=require(_0xc032('0x1'));var controller=require(_0xc032('0x2'));router['get']('/',auth[_0xc032('0x3')](),controller[_0xc032('0x4')]);router[_0xc032('0x5')](_0xc032('0x6'),auth['isAuthenticated'](),controller[_0xc032('0x7')]);router[_0xc032('0x5')](_0xc032('0x8'),auth[_0xc032('0x3')](),controller['getOpenContacts']);router[_0xc032('0x5')](_0xc032('0x9'),auth[_0xc032('0x3')](),controller[_0xc032('0xa')]);router['get'](_0xc032('0xb'),auth[_0xc032('0x3')](),controller[_0xc032('0xc')]);router[_0xc032('0x5')](_0xc032('0xd'),auth[_0xc032('0x3')](),controller[_0xc032('0xe')]);router[_0xc032('0xf')]('/',auth[_0xc032('0x3')](),controller[_0xc032('0x10')]);router['post'](_0xc032('0x11'),auth['isAuthenticated'](),controller[_0xc032('0x12')]);router['post'](_0xc032('0x13'),auth[_0xc032('0x3')](),controller[_0xc032('0x14')]);router[_0xc032('0x15')](_0xc032('0xb'),auth[_0xc032('0x3')](),controller[_0xc032('0x16')]);router['delete']('/:id',auth[_0xc032('0x3')](),controller[_0xc032('0x17')]);module[_0xc032('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 18d33f4..d8c2240 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 _0x8825=['moment','sequelize','exports','INTEGER','format'];(function(_0x6c5690,_0xf8cf2a){var _0x416f9f=function(_0x43da21){while(--_0x43da21){_0x6c5690['push'](_0x6c5690['shift']());}};_0x416f9f(++_0xf8cf2a);}(_0x8825,0x195));var _0x5882=function(_0x2cb0b7,_0x263a9f){_0x2cb0b7=_0x2cb0b7-0x0;var _0x5366ea=_0x8825[_0x2cb0b7];return _0x5366ea;};'use strict';var moment=require(_0x5882('0x0'));var Sequelize=require(_0x5882('0x1'));module[_0x5882('0x2')]={'CmHopperId':{'type':Sequelize[_0x5882('0x3')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x5882('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x5882('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5882('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5882('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x5882('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5882('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5882('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x83b2=['INTEGER','DATE','moment','sequelize','exports','STRING'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x83b2,0x98));var _0x283b=function(_0x59d3df,_0x19fe6e){_0x59d3df=_0x59d3df-0x0;var _0x82a217=_0x83b2[_0x59d3df];return _0x82a217;};'use strict';var moment=require(_0x283b('0x0'));var Sequelize=require(_0x283b('0x1'));module[_0x283b('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x283b('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x283b('0x4')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x283b('0x5')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x283b('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x283b('0x4')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x283b('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x283b('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x283b('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x283b('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x283b('0x4')],'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 81ad7ce..c2c0f1a 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 _0xaa1e=['intersection','model','fields','attributes','length','query','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','CmHopperAdditionalPhone','includeAll','include','findAll','rows','params','keys','find','catch','create','user','UserProfileSection','userProfileId','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','update','destroy','then','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','send','index','rawAttributes','type','key','map','filters'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xaa1e,0x6c));var _0xeaa1=function(_0x1b2b63,_0x2e8baf){_0x1b2b63=_0x1b2b63-0x0;var _0x3dac77=_0xaa1e[_0x1b2b63];return _0x3dac77;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xeaa1('0x0'));var jsonpatch=require(_0xeaa1('0x1'));var rp=require(_0xeaa1('0x2'));var moment=require(_0xeaa1('0x3'));var BPromise=require(_0xeaa1('0x4'));var Mustache=require(_0xeaa1('0x5'));var util=require(_0xeaa1('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xeaa1('0x7'));var ejs=require(_0xeaa1('0x8'));var fs=require('fs');var fs_extra=require(_0xeaa1('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xeaa1('0xa'));var toCsv=require(_0xeaa1('0x7'));var querystring=require(_0xeaa1('0xb'));var Papa=require(_0xeaa1('0xc'));var Redis=require(_0xeaa1('0xd'));var authService=require(_0xeaa1('0xe'));var qs=require(_0xeaa1('0xf'));var as=require(_0xeaa1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeaa1('0x11'))(_0xeaa1('0x12'));var utils=require(_0xeaa1('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xeaa1('0x14'))['db'];function respondWithStatusCode(_0x3fb0e3,_0x150769){_0x150769=_0x150769||0xcc;return function(_0x295b90){if(_0x295b90){return _0x3fb0e3[_0xeaa1('0x15')](_0x150769);}return _0x3fb0e3[_0xeaa1('0x16')](_0x150769)[_0xeaa1('0x17')]();};}function respondWithResult(_0x34e68b,_0x5fdb6d){_0x5fdb6d=_0x5fdb6d||0xc8;return function(_0x5aaf71){if(_0x5aaf71){return _0x34e68b[_0xeaa1('0x16')](_0x5fdb6d)[_0xeaa1('0x18')](_0x5aaf71);}};}function respondWithFilteredResult(_0x3a59d2,_0x22b19d){return function(_0x4c6490){if(_0x4c6490){var _0x3115a1=typeof _0x22b19d[_0xeaa1('0x19')]==='undefined'&&typeof _0x22b19d[_0xeaa1('0x1a')]===_0xeaa1('0x1b');var _0xdf8cc2=_0x4c6490[_0xeaa1('0x1c')];var _0x3422f9=_0x3115a1?0x0:_0x22b19d[_0xeaa1('0x19')];var _0x360280=_0x3115a1?_0x4c6490[_0xeaa1('0x1c')]:_0x22b19d[_0xeaa1('0x19')]+_0x22b19d[_0xeaa1('0x1a')];var _0x4d5c22;if(_0x360280>=_0xdf8cc2){_0x360280=_0xdf8cc2;_0x4d5c22=0xc8;}else{_0x4d5c22=0xce;}_0x3a59d2[_0xeaa1('0x16')](_0x4d5c22);return _0x3a59d2[_0xeaa1('0x1d')]('Content-Range',_0x3422f9+'-'+_0x360280+'/'+_0xdf8cc2)[_0xeaa1('0x18')](_0x4c6490);}return null;};}function patchUpdates(_0x4d3ebb){return function(_0x574b4b){try{jsonpatch['apply'](_0x574b4b,_0x4d3ebb,!![]);}catch(_0x2eb711){return BPromise[_0xeaa1('0x1e')](_0x2eb711);}return _0x574b4b[_0xeaa1('0x1f')]();};}function saveUpdates(_0x4e5a6e,_0x352971){return function(_0x245cd9){if(_0x245cd9){return _0x245cd9[_0xeaa1('0x20')](_0x4e5a6e)['then'](function(_0x33e60b){return _0x33e60b;});}return null;};}function removeEntity(_0x2c9d42,_0x20ee0e){return function(_0xad0530){if(_0xad0530){return _0xad0530[_0xeaa1('0x21')]()[_0xeaa1('0x22')](function(){var _0x2091c3=_0xad0530[_0xeaa1('0x23')]({'plain':!![]});var _0xa700b1=_0xeaa1('0x24');return db[_0xeaa1('0x25')][_0xeaa1('0x21')]({'where':{'type':_0xa700b1,'resourceId':_0x2091c3['id']}})['then'](function(){return _0xad0530;});})[_0xeaa1('0x22')](function(){_0x2c9d42[_0xeaa1('0x16')](0xcc)[_0xeaa1('0x17')]();});}};}function handleEntityNotFound(_0x49a49c,_0x598b87){return function(_0x8acb4f){if(!_0x8acb4f){_0x49a49c[_0xeaa1('0x15')](0x194);}return _0x8acb4f;};}function handleError(_0x186608,_0x52d6ea){_0x52d6ea=_0x52d6ea||0x1f4;return function(_0x458b89){logger[_0xeaa1('0x26')](_0x458b89[_0xeaa1('0x27')]);if(_0x458b89[_0xeaa1('0x28')]){delete _0x458b89[_0xeaa1('0x28')];}_0x186608['status'](_0x52d6ea)[_0xeaa1('0x29')](_0x458b89);};}exports[_0xeaa1('0x2a')]=function(_0x4eacff,_0x2e2bae){var _0x30337e={},_0x971609={},_0x3018c8={'count':0x0,'rows':[]};var _0x46e26f=_['map'](db['CmHopperAdditionalPhone'][_0xeaa1('0x2b')],function(_0x4fe73c){return{'name':_0x4fe73c['fieldName'],'type':_0x4fe73c[_0xeaa1('0x2c')][_0xeaa1('0x2d')]};});_0x971609['model']=_[_0xeaa1('0x2e')](_0x46e26f,_0xeaa1('0x28'));_0x971609['query']=_['keys'](_0x4eacff['query']);_0x971609[_0xeaa1('0x2f')]=_[_0xeaa1('0x30')](_0x971609[_0xeaa1('0x31')],_0x971609['query']);_0x30337e['attributes']=_[_0xeaa1('0x30')](_0x971609[_0xeaa1('0x31')],qs[_0xeaa1('0x32')](_0x4eacff['query'][_0xeaa1('0x32')]));_0x30337e['attributes']=_0x30337e[_0xeaa1('0x33')][_0xeaa1('0x34')]?_0x30337e[_0xeaa1('0x33')]:_0x971609[_0xeaa1('0x31')];if(!_0x4eacff[_0xeaa1('0x35')][_0xeaa1('0x36')](_0xeaa1('0x37'))){_0x30337e[_0xeaa1('0x1a')]=qs[_0xeaa1('0x1a')](_0x4eacff[_0xeaa1('0x35')][_0xeaa1('0x1a')]);_0x30337e[_0xeaa1('0x19')]=qs[_0xeaa1('0x19')](_0x4eacff['query'][_0xeaa1('0x19')]);}_0x30337e[_0xeaa1('0x38')]=qs['sort'](_0x4eacff[_0xeaa1('0x35')][_0xeaa1('0x39')]);_0x30337e['where']=qs[_0xeaa1('0x2f')](_[_0xeaa1('0x3a')](_0x4eacff['query'],_0x971609['filters']),_0x46e26f);if(_0x4eacff[_0xeaa1('0x35')][_0xeaa1('0x3b')]){_0x30337e[_0xeaa1('0x3c')]=_[_0xeaa1('0x3d')](_0x30337e[_0xeaa1('0x3c')],{'$or':_['map'](_0x46e26f,function(_0x143f9e){if(_0x143f9e[_0xeaa1('0x2c')]!==_0xeaa1('0x3e')){var _0x48f5e6={};_0x48f5e6[_0x143f9e[_0xeaa1('0x28')]]={'$like':'%'+_0x4eacff[_0xeaa1('0x35')][_0xeaa1('0x3b')]+'%'};return _0x48f5e6;}})});}_0x30337e=_['merge']({},_0x30337e,_0x4eacff[_0xeaa1('0x3f')]);var _0x508fea={'where':_0x30337e[_0xeaa1('0x3c')]};return db[_0xeaa1('0x40')][_0xeaa1('0x1c')](_0x508fea)[_0xeaa1('0x22')](function(_0x10aa5a){_0x3018c8[_0xeaa1('0x1c')]=_0x10aa5a;if(_0x4eacff[_0xeaa1('0x35')][_0xeaa1('0x41')]){_0x30337e[_0xeaa1('0x42')]=[{'all':!![]}];}return db[_0xeaa1('0x40')][_0xeaa1('0x43')](_0x30337e);})[_0xeaa1('0x22')](function(_0x1ebcba){_0x3018c8[_0xeaa1('0x44')]=_0x1ebcba;return _0x3018c8;})[_0xeaa1('0x22')](respondWithFilteredResult(_0x2e2bae,_0x30337e))['catch'](handleError(_0x2e2bae,null));};exports['show']=function(_0x1a1bb1,_0x342d19){var _0x5c96b3={'raw':!![],'where':{'id':_0x1a1bb1[_0xeaa1('0x45')]['id']}},_0x981a61={};_0x981a61[_0xeaa1('0x31')]=_[_0xeaa1('0x46')](db[_0xeaa1('0x40')][_0xeaa1('0x2b')]);_0x981a61[_0xeaa1('0x35')]=_[_0xeaa1('0x46')](_0x1a1bb1[_0xeaa1('0x35')]);_0x981a61[_0xeaa1('0x2f')]=_['intersection'](_0x981a61['model'],_0x981a61[_0xeaa1('0x35')]);_0x5c96b3[_0xeaa1('0x33')]=_[_0xeaa1('0x30')](_0x981a61[_0xeaa1('0x31')],qs[_0xeaa1('0x32')](_0x1a1bb1[_0xeaa1('0x35')]['fields']));_0x5c96b3[_0xeaa1('0x33')]=_0x5c96b3['attributes']['length']?_0x5c96b3['attributes']:_0x981a61['model'];if(_0x1a1bb1[_0xeaa1('0x35')][_0xeaa1('0x41')]){_0x5c96b3['include']=[{'all':!![]}];}_0x5c96b3=_[_0xeaa1('0x3d')]({},_0x5c96b3,_0x1a1bb1[_0xeaa1('0x3f')]);return db['CmHopperAdditionalPhone'][_0xeaa1('0x47')](_0x5c96b3)['then'](handleEntityNotFound(_0x342d19,null))[_0xeaa1('0x22')](respondWithResult(_0x342d19,null))[_0xeaa1('0x48')](handleError(_0x342d19,null));};exports[_0xeaa1('0x49')]=function(_0x57e635,_0xbb5828){return db[_0xeaa1('0x40')][_0xeaa1('0x49')](_0x57e635['body'],{})[_0xeaa1('0x22')](function(_0x55cf32){var _0x197ebc=_0x57e635[_0xeaa1('0x4a')][_0xeaa1('0x23')]({'plain':!![]});if(!_0x197ebc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x197ebc['role']===_0xeaa1('0x4a')){var _0xadc270=_0x55cf32[_0xeaa1('0x23')]({'plain':!![]});var _0x487c4e=_0xeaa1('0x24');return db[_0xeaa1('0x4b')]['find']({'where':{'name':_0x487c4e,'userProfileId':_0x197ebc[_0xeaa1('0x4c')]},'raw':!![]})[_0xeaa1('0x22')](function(_0x361465){if(_0x361465&&_0x361465['autoAssociation']===0x0){return db[_0xeaa1('0x25')][_0xeaa1('0x49')]({'name':_0xadc270[_0xeaa1('0x28')],'resourceId':_0xadc270['id'],'type':_0x361465[_0xeaa1('0x28')],'sectionId':_0x361465['id']},{})['then'](function(){return _0x55cf32;});}else{return _0x55cf32;}})[_0xeaa1('0x48')](function(_0x59cd54){logger[_0xeaa1('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59cd54);throw _0x59cd54;});}return _0x55cf32;})['then'](respondWithResult(_0xbb5828,0xc9))[_0xeaa1('0x48')](handleError(_0xbb5828,null));};exports[_0xeaa1('0x20')]=function(_0x2e55a6,_0x48f86d){if(_0x2e55a6['body']['id']){delete _0x2e55a6[_0xeaa1('0x4d')]['id'];}return db[_0xeaa1('0x40')][_0xeaa1('0x47')]({'where':{'id':_0x2e55a6['params']['id']}})[_0xeaa1('0x22')](handleEntityNotFound(_0x48f86d,null))[_0xeaa1('0x22')](saveUpdates(_0x2e55a6[_0xeaa1('0x4d')],null))[_0xeaa1('0x22')](respondWithResult(_0x48f86d,null))[_0xeaa1('0x48')](handleError(_0x48f86d,null));};exports[_0xeaa1('0x21')]=function(_0x5c289e,_0x5928c2){return db[_0xeaa1('0x40')]['find']({'where':{'id':_0x5c289e[_0xeaa1('0x45')]['id']}})[_0xeaa1('0x22')](handleEntityNotFound(_0x5928c2,null))['then'](removeEntity(_0x5928c2,null))['catch'](handleError(_0x5928c2,null));}; \ No newline at end of file +var _0xa173=['type','key','model','map','keys','query','intersection','attributes','fields','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','apply','reject','save','update','then','get','CmHopperAdditionalPhones','error','stack','name','index','CmHopperAdditionalPhone','rawAttributes'];(function(_0x13ebcd,_0x7e6af9){var _0x1c6cd9=function(_0x2dcc6f){while(--_0x2dcc6f){_0x13ebcd['push'](_0x13ebcd['shift']());}};_0x1c6cd9(++_0x7e6af9);}(_0xa173,0x165));var _0x3a17=function(_0x4be681,_0x133c27){_0x4be681=_0x4be681-0x0;var _0x31bb66=_0xa173[_0x4be681];return _0x31bb66;};'use strict';var emlformat=require(_0x3a17('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3a17('0x1'));var rp=require(_0x3a17('0x2'));var moment=require(_0x3a17('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3a17('0x4'));var util=require(_0x3a17('0x5'));var path=require(_0x3a17('0x6'));var sox=require(_0x3a17('0x7'));var csv=require(_0x3a17('0x8'));var ejs=require(_0x3a17('0x9'));var fs=require('fs');var fs_extra=require(_0x3a17('0xa'));var _=require(_0x3a17('0xb'));var squel=require(_0x3a17('0xc'));var crypto=require(_0x3a17('0xd'));var jsforce=require(_0x3a17('0xe'));var deskjs=require(_0x3a17('0xf'));var toCsv=require(_0x3a17('0x8'));var querystring=require('querystring');var Papa=require(_0x3a17('0x10'));var Redis=require(_0x3a17('0x11'));var authService=require(_0x3a17('0x12'));var qs=require(_0x3a17('0x13'));var as=require(_0x3a17('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a17('0x15'))(_0x3a17('0x16'));var utils=require(_0x3a17('0x17'));var config=require(_0x3a17('0x18'));var licenseUtil=require(_0x3a17('0x19'));var db=require(_0x3a17('0x1a'))['db'];function respondWithStatusCode(_0x18e166,_0xf211f7){_0xf211f7=_0xf211f7||0xcc;return function(_0x8a0247){if(_0x8a0247){return _0x18e166[_0x3a17('0x1b')](_0xf211f7);}return _0x18e166[_0x3a17('0x1c')](_0xf211f7)[_0x3a17('0x1d')]();};}function respondWithResult(_0x4b65b4,_0x4ea799){_0x4ea799=_0x4ea799||0xc8;return function(_0x545c29){if(_0x545c29){return _0x4b65b4[_0x3a17('0x1c')](_0x4ea799)['json'](_0x545c29);}};}function respondWithFilteredResult(_0x5a7d6c,_0x1a3cba){return function(_0x4f02ff){if(_0x4f02ff){var _0x5ef3ef=typeof _0x1a3cba[_0x3a17('0x1e')]==='undefined'&&typeof _0x1a3cba[_0x3a17('0x1f')]===_0x3a17('0x20');var _0x18d936=_0x4f02ff['count'];var _0x533544=_0x5ef3ef?0x0:_0x1a3cba[_0x3a17('0x1e')];var _0x3f6b36=_0x5ef3ef?_0x4f02ff[_0x3a17('0x21')]:_0x1a3cba[_0x3a17('0x1e')]+_0x1a3cba['limit'];var _0x9473a5;if(_0x3f6b36>=_0x18d936){_0x3f6b36=_0x18d936;_0x9473a5=0xc8;}else{_0x9473a5=0xce;}_0x5a7d6c[_0x3a17('0x1c')](_0x9473a5);return _0x5a7d6c[_0x3a17('0x22')]('Content-Range',_0x533544+'-'+_0x3f6b36+'/'+_0x18d936)['json'](_0x4f02ff);}return null;};}function patchUpdates(_0x1d02e1){return function(_0x3e7d15){try{jsonpatch[_0x3a17('0x23')](_0x3e7d15,_0x1d02e1,!![]);}catch(_0x45fa4c){return BPromise[_0x3a17('0x24')](_0x45fa4c);}return _0x3e7d15[_0x3a17('0x25')]();};}function saveUpdates(_0x28cce4,_0x35e3fa){return function(_0x52a192){if(_0x52a192){return _0x52a192[_0x3a17('0x26')](_0x28cce4)[_0x3a17('0x27')](function(_0x348c97){return _0x348c97;});}return null;};}function removeEntity(_0x49eec0,_0x177c33){return function(_0x5bc01f){if(_0x5bc01f){return _0x5bc01f['destroy']()[_0x3a17('0x27')](function(){var _0x35bb58=_0x5bc01f[_0x3a17('0x28')]({'plain':!![]});var _0xb1de7f=_0x3a17('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0xb1de7f,'resourceId':_0x35bb58['id']}})['then'](function(){return _0x5bc01f;});})[_0x3a17('0x27')](function(){_0x49eec0[_0x3a17('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bad15,_0x2778c1){return function(_0x4f4614){if(!_0x4f4614){_0x5bad15[_0x3a17('0x1b')](0x194);}return _0x4f4614;};}function handleError(_0xbda20c,_0x52d264){_0x52d264=_0x52d264||0x1f4;return function(_0x3365f9){logger[_0x3a17('0x2a')](_0x3365f9[_0x3a17('0x2b')]);if(_0x3365f9['name']){delete _0x3365f9[_0x3a17('0x2c')];}_0xbda20c['status'](_0x52d264)['send'](_0x3365f9);};}exports[_0x3a17('0x2d')]=function(_0x564cc0,_0x4e2aaa){var _0x52e92c={},_0x5f0eff={},_0x86ce45={'count':0x0,'rows':[]};var _0x3cdfa9=_['map'](db[_0x3a17('0x2e')][_0x3a17('0x2f')],function(_0x1e8bba){return{'name':_0x1e8bba['fieldName'],'type':_0x1e8bba[_0x3a17('0x30')][_0x3a17('0x31')]};});_0x5f0eff[_0x3a17('0x32')]=_[_0x3a17('0x33')](_0x3cdfa9,_0x3a17('0x2c'));_0x5f0eff['query']=_[_0x3a17('0x34')](_0x564cc0[_0x3a17('0x35')]);_0x5f0eff['filters']=_[_0x3a17('0x36')](_0x5f0eff[_0x3a17('0x32')],_0x5f0eff[_0x3a17('0x35')]);_0x52e92c[_0x3a17('0x37')]=_['intersection'](_0x5f0eff[_0x3a17('0x32')],qs[_0x3a17('0x38')](_0x564cc0['query'][_0x3a17('0x38')]));_0x52e92c['attributes']=_0x52e92c[_0x3a17('0x37')]['length']?_0x52e92c[_0x3a17('0x37')]:_0x5f0eff[_0x3a17('0x32')];if(!_0x564cc0[_0x3a17('0x35')]['hasOwnProperty']('nolimit')){_0x52e92c[_0x3a17('0x1f')]=qs['limit'](_0x564cc0[_0x3a17('0x35')][_0x3a17('0x1f')]);_0x52e92c['offset']=qs[_0x3a17('0x1e')](_0x564cc0[_0x3a17('0x35')][_0x3a17('0x1e')]);}_0x52e92c['order']=qs['sort'](_0x564cc0[_0x3a17('0x35')][_0x3a17('0x39')]);_0x52e92c[_0x3a17('0x3a')]=qs['filters'](_['pick'](_0x564cc0[_0x3a17('0x35')],_0x5f0eff[_0x3a17('0x3b')]),_0x3cdfa9);if(_0x564cc0[_0x3a17('0x35')][_0x3a17('0x3c')]){_0x52e92c[_0x3a17('0x3a')]=_['merge'](_0x52e92c['where'],{'$or':_[_0x3a17('0x33')](_0x3cdfa9,function(_0x2465e6){if(_0x2465e6['type']!==_0x3a17('0x3d')){var _0x47f1dc={};_0x47f1dc[_0x2465e6[_0x3a17('0x2c')]]={'$like':'%'+_0x564cc0[_0x3a17('0x35')][_0x3a17('0x3c')]+'%'};return _0x47f1dc;}})});}_0x52e92c=_[_0x3a17('0x3e')]({},_0x52e92c,_0x564cc0[_0x3a17('0x3f')]);var _0x36c829={'where':_0x52e92c[_0x3a17('0x3a')]};return db[_0x3a17('0x2e')][_0x3a17('0x21')](_0x36c829)['then'](function(_0x46c94a){_0x86ce45[_0x3a17('0x21')]=_0x46c94a;if(_0x564cc0['query'][_0x3a17('0x40')]){_0x52e92c[_0x3a17('0x41')]=[{'all':!![]}];}return db[_0x3a17('0x2e')][_0x3a17('0x42')](_0x52e92c);})[_0x3a17('0x27')](function(_0x4fb0b5){_0x86ce45[_0x3a17('0x43')]=_0x4fb0b5;return _0x86ce45;})['then'](respondWithFilteredResult(_0x4e2aaa,_0x52e92c))[_0x3a17('0x44')](handleError(_0x4e2aaa,null));};exports['show']=function(_0x336072,_0x2462be){var _0x2c58f1={'raw':!![],'where':{'id':_0x336072[_0x3a17('0x45')]['id']}},_0x460367={};_0x460367[_0x3a17('0x32')]=_[_0x3a17('0x34')](db[_0x3a17('0x2e')][_0x3a17('0x2f')]);_0x460367[_0x3a17('0x35')]=_[_0x3a17('0x34')](_0x336072[_0x3a17('0x35')]);_0x460367[_0x3a17('0x3b')]=_['intersection'](_0x460367['model'],_0x460367[_0x3a17('0x35')]);_0x2c58f1[_0x3a17('0x37')]=_['intersection'](_0x460367['model'],qs[_0x3a17('0x38')](_0x336072[_0x3a17('0x35')][_0x3a17('0x38')]));_0x2c58f1[_0x3a17('0x37')]=_0x2c58f1[_0x3a17('0x37')][_0x3a17('0x46')]?_0x2c58f1[_0x3a17('0x37')]:_0x460367['model'];if(_0x336072[_0x3a17('0x35')][_0x3a17('0x40')]){_0x2c58f1[_0x3a17('0x41')]=[{'all':!![]}];}_0x2c58f1=_[_0x3a17('0x3e')]({},_0x2c58f1,_0x336072['options']);return db[_0x3a17('0x2e')][_0x3a17('0x47')](_0x2c58f1)[_0x3a17('0x27')](handleEntityNotFound(_0x2462be,null))[_0x3a17('0x27')](respondWithResult(_0x2462be,null))[_0x3a17('0x44')](handleError(_0x2462be,null));};exports[_0x3a17('0x48')]=function(_0x80b21,_0x2cbe5c){return db['CmHopperAdditionalPhone'][_0x3a17('0x48')](_0x80b21[_0x3a17('0x49')],{})[_0x3a17('0x27')](function(_0x24a64e){var _0x51160a=_0x80b21[_0x3a17('0x4a')][_0x3a17('0x28')]({'plain':!![]});if(!_0x51160a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x51160a[_0x3a17('0x4b')]==='user'){var _0x9cce1f=_0x24a64e[_0x3a17('0x28')]({'plain':!![]});var _0x3cc18f='CmHopperAdditionalPhones';return db[_0x3a17('0x4c')][_0x3a17('0x47')]({'where':{'name':_0x3cc18f,'userProfileId':_0x51160a[_0x3a17('0x4d')]},'raw':!![]})['then'](function(_0x1e17a8){if(_0x1e17a8&&_0x1e17a8[_0x3a17('0x4e')]===0x0){return db[_0x3a17('0x4f')][_0x3a17('0x48')]({'name':_0x9cce1f[_0x3a17('0x2c')],'resourceId':_0x9cce1f['id'],'type':_0x1e17a8[_0x3a17('0x2c')],'sectionId':_0x1e17a8['id']},{})[_0x3a17('0x27')](function(){return _0x24a64e;});}else{return _0x24a64e;}})[_0x3a17('0x44')](function(_0xefa3ea){logger[_0x3a17('0x2a')](_0x3a17('0x50'),_0xefa3ea);throw _0xefa3ea;});}return _0x24a64e;})['then'](respondWithResult(_0x2cbe5c,0xc9))['catch'](handleError(_0x2cbe5c,null));};exports[_0x3a17('0x26')]=function(_0x50e363,_0x357dbd){if(_0x50e363['body']['id']){delete _0x50e363[_0x3a17('0x49')]['id'];}return db[_0x3a17('0x2e')][_0x3a17('0x47')]({'where':{'id':_0x50e363[_0x3a17('0x45')]['id']}})[_0x3a17('0x27')](handleEntityNotFound(_0x357dbd,null))['then'](saveUpdates(_0x50e363['body'],null))[_0x3a17('0x27')](respondWithResult(_0x357dbd,null))[_0x3a17('0x44')](handleError(_0x357dbd,null));};exports['destroy']=function(_0x201f87,_0x218ae1){return db[_0x3a17('0x2e')]['find']({'where':{'id':_0x201f87['params']['id']}})[_0x3a17('0x27')](handleEntityNotFound(_0x218ae1,null))[_0x3a17('0x27')](removeEntity(_0x218ae1,null))['catch'](handleError(_0x218ae1,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 3572612..c901f29 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 _0xfa77=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','api'];(function(_0x60286b,_0x3247c1){var _0x5dff69=function(_0x4ecfcf){while(--_0x4ecfcf){_0x60286b['push'](_0x60286b['shift']());}};_0x5dff69(++_0x3247c1);}(_0xfa77,0x129));var _0x7fa7=function(_0x436edf,_0x59c3f7){_0x436edf=_0x436edf-0x0;var _0x33b130=_0xfa77[_0x436edf];return _0x33b130;};'use strict';var _=require(_0x7fa7('0x0'));var util=require(_0x7fa7('0x1'));var logger=require('../../config/logger')(_0x7fa7('0x2'));var moment=require(_0x7fa7('0x3'));var BPromise=require(_0x7fa7('0x4'));var rp=require(_0x7fa7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7fa7('0x6'));var config=require(_0x7fa7('0x7'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x7fa7('0x8')]=function(_0x3e6fdb,_0x4d78b7){return _0x3e6fdb[_0x7fa7('0x9')](_0x7fa7('0xa'),attributes,{'tableName':_0x7fa7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b3d=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b3d,0x1af));var _0xd8b3=function(_0x3a13fa,_0x316feb){_0x3a13fa=_0x3a13fa-0x0;var _0xcf6bc5=_0x8b3d[_0x3a13fa];return _0xcf6bc5;};'use strict';var _=require(_0xd8b3('0x0'));var util=require(_0xd8b3('0x1'));var logger=require(_0xd8b3('0x2'))('api');var moment=require(_0xd8b3('0x3'));var BPromise=require(_0xd8b3('0x4'));var rp=require(_0xd8b3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd8b3('0x6'));var config=require(_0xd8b3('0x7'));var attributes=require(_0xd8b3('0x8'));module['exports']=function(_0x13f7e2,_0x326da5){return _0x13f7e2[_0xd8b3('0x9')](_0xd8b3('0xa'),attributes,{'tableName':_0xd8b3('0xb'),'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 4fb397f..e7082d3 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 _0xe1e3=['isNil','scheduledat','add','minutes','phone','updatedAt','createdAt','sequelize','update','activateAdditionalPhone','IncrementPreviewCounters','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperAdditionalPhone,\x20%s,\x20%s','message','info','result','VerifyAdditionalPhones','ContactId','body','ListId','VoiceQueueId','CampaignId','OrderBy','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','entity','ASC','countabandonedretry','catch','SwapAdditionalPhones','CmHopper','findOne','CmHopperAdditionalPhone','duration','waitTime'];(function(_0x420cd6,_0x48ed67){var _0x4e7082=function(_0x285fd3){while(--_0x285fd3){_0x420cd6['push'](_0x420cd6['shift']());}};_0x4e7082(++_0x48ed67);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x4f2282,_0x5a7c7d){_0x4f2282=_0x4f2282-0x0;var _0x38a499=_0xe1e3[_0x4f2282];return _0x38a499;};'use strict';var _=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var moment=require('moment');var BPromise=require(_0x3e1e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e1e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e1e('0x4'))(_0x3e1e('0x5'));var config=require(_0x3e1e('0x6'));var jayson=require(_0x3e1e('0x7'));var client=jayson[_0x3e1e('0x8')][_0x3e1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55cfba,_0x1574e5,_0x13926d){return new BPromise(function(_0x2f0e12,_0xa67e35){return client[_0x3e1e('0xa')](_0x55cfba,_0x13926d)[_0x3e1e('0xb')](function(_0x5e7d1f){logger['info']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1574e5,_0x3e1e('0xc'));logger['debug'](_0x3e1e('0xd'),_0x1574e5,_0x3e1e('0xc'),JSON[_0x3e1e('0xe')](_0x5e7d1f));if(_0x5e7d1f['error']){if(_0x5e7d1f[_0x3e1e('0xf')]['code']===0x1f4){logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1574e5,_0x5e7d1f['error']['message']);return _0xa67e35(_0x5e7d1f[_0x3e1e('0xf')]['message']);}logger['error'](_0x3e1e('0x10'),_0x1574e5,_0x5e7d1f[_0x3e1e('0xf')][_0x3e1e('0x11')]);return _0x2f0e12(_0x5e7d1f['error']['message']);}else{logger[_0x3e1e('0x12')](_0x3e1e('0x10'),_0x1574e5,'request\x20sent');_0x2f0e12(_0x5e7d1f[_0x3e1e('0x13')][_0x3e1e('0x11')]);}})['catch'](function(_0x11c07f){logger['error'](_0x3e1e('0x10'),_0x1574e5,_0x11c07f);_0xa67e35(_0x11c07f);});});}exports[_0x3e1e('0x14')]=function(_0x1d786c){var _0x39eaa7=this;return new Promise(function(_0x791ed8,_0x1c181b){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x1d786c['body'][_0x3e1e('0x15')],'ListId':_0x1d786c[_0x3e1e('0x16')][_0x3e1e('0x17')],'VoiceQueueId':_0x1d786c['body'][_0x3e1e('0x18')]===undefined?null:_0x1d786c['body'][_0x3e1e('0x18')],'CampaignId':_0x1d786c[_0x3e1e('0x16')][_0x3e1e('0x19')]===undefined?null:_0x1d786c['body'][_0x3e1e('0x19')]}})[_0x3e1e('0xb')](function(_0xefa098){if(_0xefa098!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0xefa098['id'],'OrderBy':{'$gt':_0xefa098[_0x3e1e('0x1a')]}},'order':[[_0x3e1e('0x1a'),'ASC']]})[_0x3e1e('0xb')](function(_0x56ae51){var _0x164b15=0x0;if(_0x56ae51){if(_0x56ae51[_0x3e1e('0x1b')]+_0x56ae51[_0x3e1e('0x1c')]+_0x56ae51[_0x3e1e('0x1d')]+_0x56ae51[_0x3e1e('0x1e')]+_0x56ae51[_0x3e1e('0x1f')]+_0x56ae51['countabandonedretry']+_0x56ae51['countmachineretry']+_0x56ae51[_0x3e1e('0x20')]<_0x1d786c[_0x3e1e('0x21')]['dialGlobalMaxRetry'])_0x164b15=0x1;_0x791ed8({'additional':_0x164b15});}else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0xefa098['id']},'order':[[_0x3e1e('0x1a'),_0x3e1e('0x22')]]})['then'](function(_0x52f966){var _0x5ac814=0x0;if(_0x52f966){if(_0x52f966[_0x3e1e('0x1b')]+_0x52f966[_0x3e1e('0x1c')]+_0x52f966['countnoanswerretry']+_0x52f966[_0x3e1e('0x1e')]+_0x52f966[_0x3e1e('0x1f')]+_0x52f966[_0x3e1e('0x23')]+_0x52f966['countmachineretry']+_0x52f966[_0x3e1e('0x20')]<_0x1d786c['entity']['dialGlobalMaxRetry'])_0x5ac814=0x1;_0x791ed8({'additional':_0x5ac814});}else{_0x791ed8({'additional':0x0});}})['catch'](function(_0x39da8d){logger['error']('VerifyAdditionalPhones',_0x39da8d[_0x3e1e('0x11')]);_0x1c181b(_0x39eaa7[_0x3e1e('0xf')](0x1f4,_0x39da8d[_0x3e1e('0x11')]));});}})[_0x3e1e('0x24')](function(_0xc9762c){logger['error']('VerifyAdditionalPhones',_0xc9762c['message']);_0x1c181b(_0x39eaa7['error'](0x1f4,_0xc9762c[_0x3e1e('0x11')]));});}else _0x791ed8({'additional':0x0});});});};exports[_0x3e1e('0x25')]=function(_0x1c7481){var _0x223bba=this;return new Promise(function(_0x41ecb3,_0x3b9c6e){return db[_0x3e1e('0x26')][_0x3e1e('0x27')]({'raw':!![],'where':{'ContactId':_0x1c7481['body'][_0x3e1e('0x15')],'ListId':_0x1c7481[_0x3e1e('0x16')]['ListId'],'VoiceQueueId':_0x1c7481[_0x3e1e('0x16')][_0x3e1e('0x18')]===undefined?null:_0x1c7481[_0x3e1e('0x16')][_0x3e1e('0x18')],'CampaignId':_0x1c7481['body']['CampaignId']===undefined?null:_0x1c7481[_0x3e1e('0x16')][_0x3e1e('0x19')]}})['then'](function(_0x266958){if(_0x266958!=null){return db[_0x3e1e('0x28')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x266958['id'],'OrderBy':{'$gte':_0x266958[_0x3e1e('0x1a')]}},'order':[[_0x3e1e('0x1a'),_0x3e1e('0x22')]]})[_0x3e1e('0xb')](function(_0x2355f4){if(_0x2355f4)return activateAdditionalPhone(_0x266958,_0x1c7481['body'],_0x2355f4,_0x1c7481[_0x3e1e('0x29')],_0x1c7481[_0x3e1e('0x2a')])[_0x3e1e('0xb')](function(_0xc74497){_0x41ecb3(_0xc74497);});else{return db['CmHopperAdditionalPhone'][_0x3e1e('0x27')]({'raw':!![],'where':{'CmHopperId':_0x266958['id']},'order':[[_0x3e1e('0x1a'),_0x3e1e('0x22')]]})[_0x3e1e('0xb')](function(_0x2cc5c7){if(_0x2cc5c7)return activateAdditionalPhone(_0x266958,_0x1c7481[_0x3e1e('0x16')],_0x2cc5c7,_0x1c7481[_0x3e1e('0x29')],_0x1c7481['waitTime'])[_0x3e1e('0xb')](function(_0x4fdd7c){_0x41ecb3(_0x4fdd7c);});else{_0x41ecb3({'id':_0x266958['id'],'phone':''});}})['catch'](function(_0x4f598e){logger[_0x3e1e('0xf')](_0x3e1e('0x14'),_0x4f598e['message']);_0x3b9c6e(_0x223bba[_0x3e1e('0xf')](0x1f4,_0x4f598e[_0x3e1e('0x11')]));});}})['catch'](function(_0x16d03f){logger[_0x3e1e('0xf')]('VerifyAdditionalPhones',_0x16d03f['message']);_0x3b9c6e(_0x223bba[_0x3e1e('0xf')](0x1f4,_0x16d03f['message']));});}else _0x41ecb3(0x1);});});};function activateAdditionalPhone(_0x4ff868,_0x1ad76d,_0x3d4a8d,_0x148c34,_0x202748){return new Promise(function(_0x377a06,_0x55ea1d){var _0x5b32ad;if(_[_0x3e1e('0x2b')](_0x3d4a8d[_0x3e1e('0x2c')])){_0x3d4a8d[_0x3e1e('0x2c')]=moment();}if(moment()>moment(_0x3d4a8d['scheduledat'])){_0x5b32ad=moment()[_0x3e1e('0x2d')](_0x202748||0x3,_0x3e1e('0x2e'));}else{if(_0x3d4a8d[_0x3e1e('0x1a')]==0x0){_0x5b32ad=moment(_0x3d4a8d['scheduledat']);}else{_0x5b32ad=moment()[_0x3e1e('0x2d')](_0x202748||0x3,'minutes');}}if(_['isNil'](_0x5b32ad)){_0x5b32ad=moment()[_0x3e1e('0x2d')](_0x202748||0x3,_0x3e1e('0x2e'));}var _0x2a1373={'phone':_0x4ff868[_0x3e1e('0x2f')],'active':0x0,'OrderBy':_['isNil'](_0x4ff868['OrderBy'])?0x0:_0x4ff868['OrderBy'],'scheduledat':moment()['add'](_0x148c34||0x1,_0x3e1e('0x2e')),'countbusyretry':_0x1ad76d[_0x3e1e('0x1b')],'countcongestionretry':_0x1ad76d['countcongestionretry'],'countnoanswerretry':_0x1ad76d['countnoanswerretry'],'countnosuchnumberretry':_0x1ad76d[_0x3e1e('0x1e')],'countdropretry':_0x1ad76d[_0x3e1e('0x1f')],'countabandonedretry':_0x1ad76d[_0x3e1e('0x23')],'countmachineretry':_0x1ad76d['countmachineretry'],'countagentrejectretry':_0x1ad76d[_0x3e1e('0x20')],'createdAt':_0x1ad76d['createdAt'],'updatedAt':_0x1ad76d[_0x3e1e('0x30')]};var _0x4713bd={'CmHopperId':_0x4ff868['id'],'phone':_0x3d4a8d[_0x3e1e('0x2f')],'active':0x0,'OrderBy':_[_0x3e1e('0x2b')](_0x3d4a8d[_0x3e1e('0x1a')])?0x0:_0x3d4a8d[_0x3e1e('0x1a')],'scheduledat':_0x5b32ad,'countbusyretry':_0x3d4a8d['countbusyretry'],'countcongestionretry':_0x3d4a8d[_0x3e1e('0x1c')],'countnoanswerretry':_0x3d4a8d[_0x3e1e('0x1d')],'countnosuchnumberretry':_0x3d4a8d['countnosuchnumberretry'],'countdropretry':_0x3d4a8d[_0x3e1e('0x1f')],'countabandonedretry':_0x3d4a8d[_0x3e1e('0x23')],'countmachineretry':_0x3d4a8d['countmachineretry'],'countagentrejectretry':_0x3d4a8d[_0x3e1e('0x20')],'createdAt':_0x3d4a8d[_0x3e1e('0x31')],'updatedAt':_0x3d4a8d[_0x3e1e('0x30')]};return db[_0x3e1e('0x32')]['transaction'](function(_0x108b79){return db[_0x3e1e('0x28')][_0x3e1e('0x33')](_0x2a1373,{'where':{'id':_0x3d4a8d['id']}},{'transaction':_0x108b79})[_0x3e1e('0xb')](function(){return db['CmHopper'][_0x3e1e('0x33')](_0x4713bd,{'where':{'id':_0x4ff868['id']}},{'transaction':_0x108b79});});})[_0x3e1e('0xb')](function(_0x427013){_0x377a06({'id':_0x4ff868['id'],'phone':_0x3d4a8d[_0x3e1e('0x2f')]});})[_0x3e1e('0x24')](function(_0x1df5a8){logger[_0x3e1e('0xf')](_0x3e1e('0x34'),_0x1df5a8['message']);_0x55ea1d({'error':_0x1df5a8[_0x3e1e('0x11')]});});});}exports['IncrementPreviewCounters']=function(_0x5b0d0d){var _0x4c8583=this;return new Promise(function(_0x1c4269,_0x17641c){return db['CmHopper'][_0x3e1e('0x33')](_0x5b0d0d['body']['field'],{'where':{'id':_0x5b0d0d[_0x3e1e('0x16')]['id']}})['then'](function(_0x56f69f){_0x1c4269(_0x56f69f);})['catch'](function(_0x3fc9cb){logger[_0x3e1e('0xf')](_0x3e1e('0x35'),_0x3fc9cb[_0x3e1e('0x11')]);_0x17641c(_0x4c8583[_0x3e1e('0xf')](0x1f4,_0x3fc9cb[_0x3e1e('0x11')]));});});}; \ No newline at end of file +var _0xf350=['activateAdditionalPhone','IncrementPreviewCounters','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopperAdditionalPhone,\x20%s,\x20%s','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','VoiceQueueId','CampaignId','then','OrderBy','ASC','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','catch','SwapAdditionalPhones','ListId','CmHopperAdditionalPhone','duration','isNil','scheduledat','add','minutes','phone','countnoanswerretry','updatedAt','sequelize','update'];(function(_0xe19d21,_0x24bb39){var _0x597448=function(_0x808451){while(--_0x808451){_0xe19d21['push'](_0xe19d21['shift']());}};_0x597448(++_0x24bb39);}(_0xf350,0x1f1));var _0x0f35=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf350[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x0f35('0x0'));var util=require(_0x0f35('0x1'));var moment=require(_0x0f35('0x2'));var BPromise=require(_0x0f35('0x3'));var rs=require(_0x0f35('0x4'));var fs=require('fs');var Redis=require(_0x0f35('0x5'));var db=require(_0x0f35('0x6'))['db'];var utils=require(_0x0f35('0x7'));var logger=require(_0x0f35('0x8'))(_0x0f35('0x9'));var config=require(_0x0f35('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0f35('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb2cd08,_0x243ffc,_0x4e764f){return new BPromise(function(_0x3293df,_0x4a0ef2){return client['request'](_0xb2cd08,_0x4e764f)['then'](function(_0x5d110c){logger[_0x0f35('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x243ffc,_0x0f35('0xd'));logger[_0x0f35('0xe')](_0x0f35('0xf'),_0x243ffc,_0x0f35('0xd'),JSON[_0x0f35('0x10')](_0x5d110c));if(_0x5d110c[_0x0f35('0x11')]){if(_0x5d110c[_0x0f35('0x11')][_0x0f35('0x12')]===0x1f4){logger[_0x0f35('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x243ffc,_0x5d110c[_0x0f35('0x11')][_0x0f35('0x13')]);return _0x4a0ef2(_0x5d110c[_0x0f35('0x11')][_0x0f35('0x13')]);}logger[_0x0f35('0x11')](_0x0f35('0x14'),_0x243ffc,_0x5d110c[_0x0f35('0x11')][_0x0f35('0x13')]);return _0x3293df(_0x5d110c[_0x0f35('0x11')][_0x0f35('0x13')]);}else{logger[_0x0f35('0xc')](_0x0f35('0x14'),_0x243ffc,_0x0f35('0xd'));_0x3293df(_0x5d110c['result']['message']);}})['catch'](function(_0x29e870){logger[_0x0f35('0x11')](_0x0f35('0x14'),_0x243ffc,_0x29e870);_0x4a0ef2(_0x29e870);});});}exports[_0x0f35('0x15')]=function(_0xbca74b){var _0x6cf624=this;return new Promise(function(_0x1f1c72,_0x4451bc){return db[_0x0f35('0x16')][_0x0f35('0x17')]({'raw':!![],'where':{'ContactId':_0xbca74b[_0x0f35('0x18')][_0x0f35('0x19')],'ListId':_0xbca74b[_0x0f35('0x18')]['ListId'],'VoiceQueueId':_0xbca74b[_0x0f35('0x18')]['VoiceQueueId']===undefined?null:_0xbca74b[_0x0f35('0x18')][_0x0f35('0x1a')],'CampaignId':_0xbca74b[_0x0f35('0x18')]['CampaignId']===undefined?null:_0xbca74b[_0x0f35('0x18')][_0x0f35('0x1b')]}})[_0x0f35('0x1c')](function(_0x3cae56){if(_0x3cae56!=null){return db['CmHopperAdditionalPhone'][_0x0f35('0x17')]({'raw':!![],'where':{'CmHopperId':_0x3cae56['id'],'OrderBy':{'$gt':_0x3cae56[_0x0f35('0x1d')]}},'order':[['OrderBy',_0x0f35('0x1e')]]})['then'](function(_0x55d779){var _0x9005cb=0x0;if(_0x55d779){if(_0x55d779[_0x0f35('0x1f')]+_0x55d779[_0x0f35('0x20')]+_0x55d779['countnoanswerretry']+_0x55d779[_0x0f35('0x21')]+_0x55d779[_0x0f35('0x22')]+_0x55d779[_0x0f35('0x23')]+_0x55d779[_0x0f35('0x24')]+_0x55d779[_0x0f35('0x25')]<_0xbca74b['entity'][_0x0f35('0x26')])_0x9005cb=0x1;_0x1f1c72({'additional':_0x9005cb});}else{return db['CmHopperAdditionalPhone'][_0x0f35('0x17')]({'raw':!![],'where':{'CmHopperId':_0x3cae56['id']},'order':[[_0x0f35('0x1d'),'ASC']]})['then'](function(_0x1e8a43){var _0x2c0a9b=0x0;if(_0x1e8a43){if(_0x1e8a43['countbusyretry']+_0x1e8a43[_0x0f35('0x20')]+_0x1e8a43['countnoanswerretry']+_0x1e8a43[_0x0f35('0x21')]+_0x1e8a43[_0x0f35('0x22')]+_0x1e8a43['countabandonedretry']+_0x1e8a43[_0x0f35('0x24')]+_0x1e8a43[_0x0f35('0x25')]<_0xbca74b['entity'][_0x0f35('0x26')])_0x2c0a9b=0x1;_0x1f1c72({'additional':_0x2c0a9b});}else{_0x1f1c72({'additional':0x0});}})[_0x0f35('0x27')](function(_0x170ded){logger[_0x0f35('0x11')](_0x0f35('0x15'),_0x170ded[_0x0f35('0x13')]);_0x4451bc(_0x6cf624[_0x0f35('0x11')](0x1f4,_0x170ded[_0x0f35('0x13')]));});}})[_0x0f35('0x27')](function(_0x1e1df6){logger[_0x0f35('0x11')]('VerifyAdditionalPhones',_0x1e1df6['message']);_0x4451bc(_0x6cf624[_0x0f35('0x11')](0x1f4,_0x1e1df6[_0x0f35('0x13')]));});}else _0x1f1c72({'additional':0x0});});});};exports[_0x0f35('0x28')]=function(_0x209be5){var _0x20c3a5=this;return new Promise(function(_0xde50fb,_0x44bddf){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x209be5[_0x0f35('0x18')][_0x0f35('0x19')],'ListId':_0x209be5['body'][_0x0f35('0x29')],'VoiceQueueId':_0x209be5[_0x0f35('0x18')][_0x0f35('0x1a')]===undefined?null:_0x209be5[_0x0f35('0x18')][_0x0f35('0x1a')],'CampaignId':_0x209be5[_0x0f35('0x18')][_0x0f35('0x1b')]===undefined?null:_0x209be5[_0x0f35('0x18')][_0x0f35('0x1b')]}})[_0x0f35('0x1c')](function(_0x47d19a){if(_0x47d19a!=null){return db[_0x0f35('0x2a')][_0x0f35('0x17')]({'raw':!![],'where':{'CmHopperId':_0x47d19a['id'],'OrderBy':{'$gte':_0x47d19a['OrderBy']}},'order':[[_0x0f35('0x1d'),_0x0f35('0x1e')]]})[_0x0f35('0x1c')](function(_0x1a27a6){if(_0x1a27a6)return activateAdditionalPhone(_0x47d19a,_0x209be5[_0x0f35('0x18')],_0x1a27a6,_0x209be5[_0x0f35('0x2b')],_0x209be5['waitTime'])[_0x0f35('0x1c')](function(_0x3ef6e8){_0xde50fb(_0x3ef6e8);});else{return db[_0x0f35('0x2a')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x47d19a['id']},'order':[[_0x0f35('0x1d'),'ASC']]})[_0x0f35('0x1c')](function(_0x2703d5){if(_0x2703d5)return activateAdditionalPhone(_0x47d19a,_0x209be5[_0x0f35('0x18')],_0x2703d5,_0x209be5[_0x0f35('0x2b')],_0x209be5['waitTime'])[_0x0f35('0x1c')](function(_0x34e768){_0xde50fb(_0x34e768);});else{_0xde50fb({'id':_0x47d19a['id'],'phone':''});}})['catch'](function(_0x7912f6){logger[_0x0f35('0x11')](_0x0f35('0x15'),_0x7912f6[_0x0f35('0x13')]);_0x44bddf(_0x20c3a5[_0x0f35('0x11')](0x1f4,_0x7912f6[_0x0f35('0x13')]));});}})[_0x0f35('0x27')](function(_0x510220){logger[_0x0f35('0x11')](_0x0f35('0x15'),_0x510220[_0x0f35('0x13')]);_0x44bddf(_0x20c3a5['error'](0x1f4,_0x510220[_0x0f35('0x13')]));});}else _0xde50fb(0x1);});});};function activateAdditionalPhone(_0x1a40e3,_0xf569ea,_0x48320c,_0x1ce84c,_0x1f7712){return new Promise(function(_0x533d28,_0x20ac1e){var _0xe98f6f;if(_[_0x0f35('0x2c')](_0x48320c[_0x0f35('0x2d')])){_0x48320c[_0x0f35('0x2d')]=moment();}if(moment()>moment(_0x48320c[_0x0f35('0x2d')])){_0xe98f6f=moment()[_0x0f35('0x2e')](_0x1f7712||0x3,_0x0f35('0x2f'));}else{if(_0x48320c[_0x0f35('0x1d')]==0x0){_0xe98f6f=moment(_0x48320c[_0x0f35('0x2d')]);}else{_0xe98f6f=moment()[_0x0f35('0x2e')](_0x1f7712||0x3,_0x0f35('0x2f'));}}if(_[_0x0f35('0x2c')](_0xe98f6f)){_0xe98f6f=moment()[_0x0f35('0x2e')](_0x1f7712||0x3,_0x0f35('0x2f'));}var _0x3f37bd={'phone':_0x1a40e3[_0x0f35('0x30')],'active':0x0,'OrderBy':_[_0x0f35('0x2c')](_0x1a40e3['OrderBy'])?0x0:_0x1a40e3[_0x0f35('0x1d')],'scheduledat':moment()[_0x0f35('0x2e')](_0x1ce84c||0x1,_0x0f35('0x2f')),'countbusyretry':_0xf569ea[_0x0f35('0x1f')],'countcongestionretry':_0xf569ea[_0x0f35('0x20')],'countnoanswerretry':_0xf569ea[_0x0f35('0x31')],'countnosuchnumberretry':_0xf569ea[_0x0f35('0x21')],'countdropretry':_0xf569ea[_0x0f35('0x22')],'countabandonedretry':_0xf569ea[_0x0f35('0x23')],'countmachineretry':_0xf569ea[_0x0f35('0x24')],'countagentrejectretry':_0xf569ea['countagentrejectretry'],'createdAt':_0xf569ea['createdAt'],'updatedAt':_0xf569ea[_0x0f35('0x32')]};var _0x4f37f4={'CmHopperId':_0x1a40e3['id'],'phone':_0x48320c[_0x0f35('0x30')],'active':0x0,'OrderBy':_[_0x0f35('0x2c')](_0x48320c['OrderBy'])?0x0:_0x48320c['OrderBy'],'scheduledat':_0xe98f6f,'countbusyretry':_0x48320c[_0x0f35('0x1f')],'countcongestionretry':_0x48320c[_0x0f35('0x20')],'countnoanswerretry':_0x48320c['countnoanswerretry'],'countnosuchnumberretry':_0x48320c[_0x0f35('0x21')],'countdropretry':_0x48320c['countdropretry'],'countabandonedretry':_0x48320c[_0x0f35('0x23')],'countmachineretry':_0x48320c[_0x0f35('0x24')],'countagentrejectretry':_0x48320c[_0x0f35('0x25')],'createdAt':_0x48320c['createdAt'],'updatedAt':_0x48320c[_0x0f35('0x32')]};return db[_0x0f35('0x33')]['transaction'](function(_0x268100){return db['CmHopperAdditionalPhone'][_0x0f35('0x34')](_0x3f37bd,{'where':{'id':_0x48320c['id']}},{'transaction':_0x268100})[_0x0f35('0x1c')](function(){return db['CmHopper']['update'](_0x4f37f4,{'where':{'id':_0x1a40e3['id']}},{'transaction':_0x268100});});})[_0x0f35('0x1c')](function(_0x2b7e98){_0x533d28({'id':_0x1a40e3['id'],'phone':_0x48320c[_0x0f35('0x30')]});})[_0x0f35('0x27')](function(_0xb51128){logger[_0x0f35('0x11')](_0x0f35('0x35'),_0xb51128[_0x0f35('0x13')]);_0x20ac1e({'error':_0xb51128[_0x0f35('0x13')]});});});}exports[_0x0f35('0x36')]=function(_0x4d9941){var _0x10949c=this;return new Promise(function(_0x3cfa9d,_0x2e6b48){return db[_0x0f35('0x16')][_0x0f35('0x34')](_0x4d9941[_0x0f35('0x18')]['field'],{'where':{'id':_0x4d9941[_0x0f35('0x18')]['id']}})['then'](function(_0x309fdf){_0x3cfa9d(_0x309fdf);})['catch'](function(_0x4fd296){logger[_0x0f35('0x11')](_0x0f35('0x36'),_0x4fd296[_0x0f35('0x13')]);_0x2e6b48(_0x10949c[_0x0f35('0x11')](0x1f4,_0x4fd296[_0x0f35('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 2f3a2b4..0f10b85 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 _0xfa69=['index','/:id','post','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperAdditionalPhone.controller','get','isAuthenticated'];(function(_0x4abbc1,_0x2450fb){var _0x3e3a65=function(_0x505562){while(--_0x505562){_0x4abbc1['push'](_0x4abbc1['shift']());}};_0x3e3a65(++_0x2450fb);}(_0xfa69,0x1ed));var _0x9fa6=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xfa69[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x9fa6('0x0'));var util=require(_0x9fa6('0x1'));var path=require(_0x9fa6('0x2'));var timeout=require('connect-timeout');var express=require(_0x9fa6('0x3'));var router=express[_0x9fa6('0x4')]();var fs_extra=require(_0x9fa6('0x5'));var auth=require(_0x9fa6('0x6'));var interaction=require(_0x9fa6('0x7'));var config=require('../../config/environment');var controller=require(_0x9fa6('0x8'));router[_0x9fa6('0x9')]('/',auth[_0x9fa6('0xa')](),controller[_0x9fa6('0xb')]);router[_0x9fa6('0x9')](_0x9fa6('0xc'),auth[_0x9fa6('0xa')](),controller['show']);router[_0x9fa6('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9fa6('0xe')](_0x9fa6('0xc'),auth[_0x9fa6('0xa')](),controller[_0x9fa6('0xf')]);router[_0x9fa6('0x10')]('/:id',auth[_0x9fa6('0xa')](),controller['destroy']);module[_0x9fa6('0x11')]=router; \ No newline at end of file +var _0xe35c=['update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x41d215,_0x3efdea){var _0x549c1f=function(_0x5b9501){while(--_0x5b9501){_0x41d215['push'](_0x41d215['shift']());}};_0x549c1f(++_0x3efdea);}(_0xe35c,0xd5));var _0xce35=function(_0x5d3ba2,_0x45b47b){_0x5d3ba2=_0x5d3ba2-0x0;var _0x790c6d=_0xe35c[_0x5d3ba2];return _0x790c6d;};'use strict';var multer=require(_0xce35('0x0'));var util=require(_0xce35('0x1'));var path=require(_0xce35('0x2'));var timeout=require(_0xce35('0x3'));var express=require(_0xce35('0x4'));var router=express[_0xce35('0x5')]();var fs_extra=require(_0xce35('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xce35('0x7'));var config=require(_0xce35('0x8'));var controller=require(_0xce35('0x9'));router[_0xce35('0xa')]('/',auth[_0xce35('0xb')](),controller[_0xce35('0xc')]);router[_0xce35('0xa')](_0xce35('0xd'),auth[_0xce35('0xb')](),controller[_0xce35('0xe')]);router[_0xce35('0xf')]('/',auth[_0xce35('0xb')](),controller[_0xce35('0x10')]);router[_0xce35('0x11')](_0xce35('0xd'),auth[_0xce35('0xb')](),controller[_0xce35('0x12')]);router[_0xce35('0x13')](_0xce35('0xd'),auth[_0xce35('0xb')](),controller['destroy']);module[_0xce35('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 130fb06..46382d8 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 _0x9a8b=['INTEGER','contactListQueue','moment','sequelize','STRING'];(function(_0x3485f8,_0x1b66cf){var _0x1fbba7=function(_0x135b73){while(--_0x135b73){_0x3485f8['push'](_0x3485f8['shift']());}};_0x1fbba7(++_0x1b66cf);}(_0x9a8b,0x1ba));var _0xb9a8=function(_0x3d4fbc,_0x108b8f){_0x3d4fbc=_0x3d4fbc-0x0;var _0x48b154=_0x9a8b[_0x3d4fbc];return _0x48b154;};'use strict';var moment=require(_0xb9a8('0x0'));var Sequelize=require(_0xb9a8('0x1'));module['exports']={'phone':{'type':Sequelize[_0xb9a8('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xb9a8('0x3')],'unique':_0xb9a8('0x4')},'ListId':{'type':Sequelize[_0xb9a8('0x3')],'unique':_0xb9a8('0x4')},'VoiceQueueId':{'type':Sequelize[_0xb9a8('0x3')],'unique':_0xb9a8('0x4')}}; \ No newline at end of file +var _0x6778=['contactListQueue','moment','sequelize','exports','INTEGER'];(function(_0x17be97,_0x49be52){var _0x4901f3=function(_0x790e4a){while(--_0x790e4a){_0x17be97['push'](_0x17be97['shift']());}};_0x4901f3(++_0x49be52);}(_0x6778,0x1d2));var _0x8677=function(_0x4394b6,_0x12357f){_0x4394b6=_0x4394b6-0x0;var _0x360244=_0x6778[_0x4394b6];return _0x360244;};'use strict';var moment=require(_0x8677('0x0'));var Sequelize=require(_0x8677('0x1'));module[_0x8677('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x8677('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x8677('0x3')],'unique':_0x8677('0x4')},'VoiceQueueId':{'type':Sequelize[_0x8677('0x3')],'unique':_0x8677('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 2b1a95d..4a8970f 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 _0x58d8=['../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','CmHopperBlack','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','order','sort','filter','where','merge','type','VIRTUAL','options','findAll','catch','show','includeAll','find','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','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/utils','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x58d8,0xb9));var _0x858d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x58d8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x858d('0x0'));var rimraf=require(_0x858d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x858d('0x2'));var rp=require(_0x858d('0x3'));var moment=require(_0x858d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x858d('0x5'));var sox=require(_0x858d('0x6'));var csv=require(_0x858d('0x7'));var ejs=require(_0x858d('0x8'));var fs=require('fs');var fs_extra=require(_0x858d('0x9'));var _=require(_0x858d('0xa'));var squel=require(_0x858d('0xb'));var crypto=require('crypto');var jsforce=require(_0x858d('0xc'));var deskjs=require(_0x858d('0xd'));var toCsv=require(_0x858d('0x7'));var querystring=require(_0x858d('0xe'));var Papa=require(_0x858d('0xf'));var Redis=require(_0x858d('0x10'));var authService=require(_0x858d('0x11'));var qs=require(_0x858d('0x12'));var as=require(_0x858d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x858d('0x14'));var config=require(_0x858d('0x15'));var licenseUtil=require(_0x858d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ae2b2,_0x3bccc3){_0x3bccc3=_0x3bccc3||0xcc;return function(_0x2e6890){if(_0x2e6890){return _0x3ae2b2[_0x858d('0x17')](_0x3bccc3);}return _0x3ae2b2[_0x858d('0x18')](_0x3bccc3)[_0x858d('0x19')]();};}function respondWithResult(_0xd4f757,_0x40d9d5){_0x40d9d5=_0x40d9d5||0xc8;return function(_0x2515c4){if(_0x2515c4){return _0xd4f757['status'](_0x40d9d5)[_0x858d('0x1a')](_0x2515c4);}};}function respondWithFilteredResult(_0x2b496f,_0x1c559f){return function(_0x22abd2){if(_0x22abd2){var _0x392f04=typeof _0x1c559f[_0x858d('0x1b')]===_0x858d('0x1c')&&typeof _0x1c559f['limit']===_0x858d('0x1c');var _0x316888=_0x22abd2[_0x858d('0x1d')];var _0x3b2be7=_0x392f04?0x0:_0x1c559f['offset'];var _0x4635c5=_0x392f04?_0x22abd2[_0x858d('0x1d')]:_0x1c559f[_0x858d('0x1b')]+_0x1c559f[_0x858d('0x1e')];var _0x62ac25;if(_0x4635c5>=_0x316888){_0x4635c5=_0x316888;_0x62ac25=0xc8;}else{_0x62ac25=0xce;}_0x2b496f[_0x858d('0x18')](_0x62ac25);return _0x2b496f[_0x858d('0x1f')](_0x858d('0x20'),_0x3b2be7+'-'+_0x4635c5+'/'+_0x316888)[_0x858d('0x1a')](_0x22abd2);}return null;};}function patchUpdates(_0xf2696c){return function(_0x3efccb){try{jsonpatch[_0x858d('0x21')](_0x3efccb,_0xf2696c,!![]);}catch(_0x4cd3d5){return BPromise[_0x858d('0x22')](_0x4cd3d5);}return _0x3efccb[_0x858d('0x23')]();};}function saveUpdates(_0x3210f5,_0x394f13){return function(_0x26eb48){if(_0x26eb48){return _0x26eb48[_0x858d('0x24')](_0x3210f5)[_0x858d('0x25')](function(_0x52b602){return _0x52b602;});}return null;};}function removeEntity(_0x4b4894,_0x520a72){return function(_0x2eebe0){if(_0x2eebe0){return _0x2eebe0[_0x858d('0x26')]()[_0x858d('0x25')](function(){_0x4b4894[_0x858d('0x18')](0xcc)[_0x858d('0x19')]();});}};}function handleEntityNotFound(_0x4a28fa,_0x4f7d77){return function(_0x1b6d9d){if(!_0x1b6d9d){_0x4a28fa[_0x858d('0x17')](0x194);}return _0x1b6d9d;};}function handleError(_0x81def6,_0x28d66f){_0x28d66f=_0x28d66f||0x1f4;return function(_0x4ac852){logger[_0x858d('0x27')](_0x4ac852['stack']);if(_0x4ac852[_0x858d('0x28')]){delete _0x4ac852[_0x858d('0x28')];}_0x81def6[_0x858d('0x18')](_0x28d66f)['send'](_0x4ac852);};}exports[_0x858d('0x29')]=function(_0xe3549f,_0x174073){var _0x4b9f14={},_0x246f98={},_0x5491e3={'count':0x0,'rows':[]};var _0x3732a2=_[_0x858d('0x2a')](db[_0x858d('0x2b')][_0x858d('0x2c')],function(_0x42d438){return{'name':_0x42d438[_0x858d('0x2d')],'type':_0x42d438['type'][_0x858d('0x2e')]};});_0x246f98[_0x858d('0x2f')]=_[_0x858d('0x2a')](_0x3732a2,'name');_0x246f98['query']=_[_0x858d('0x30')](_0xe3549f[_0x858d('0x31')]);_0x246f98[_0x858d('0x32')]=_[_0x858d('0x33')](_0x246f98['model'],_0x246f98['query']);_0x4b9f14[_0x858d('0x34')]=_[_0x858d('0x33')](_0x246f98[_0x858d('0x2f')],qs[_0x858d('0x35')](_0xe3549f[_0x858d('0x31')][_0x858d('0x35')]));_0x4b9f14[_0x858d('0x34')]=_0x4b9f14['attributes']['length']?_0x4b9f14['attributes']:_0x246f98['model'];if(!_0xe3549f[_0x858d('0x31')]['hasOwnProperty']('nolimit')){_0x4b9f14[_0x858d('0x1e')]=qs[_0x858d('0x1e')](_0xe3549f[_0x858d('0x31')][_0x858d('0x1e')]);_0x4b9f14[_0x858d('0x1b')]=qs[_0x858d('0x1b')](_0xe3549f[_0x858d('0x31')][_0x858d('0x1b')]);}_0x4b9f14[_0x858d('0x36')]=qs[_0x858d('0x37')](_0xe3549f[_0x858d('0x31')]['sort']);_0x4b9f14['where']=qs[_0x858d('0x32')](_['pick'](_0xe3549f[_0x858d('0x31')],_0x246f98[_0x858d('0x32')]),_0x3732a2);if(_0xe3549f[_0x858d('0x31')][_0x858d('0x38')]){_0x4b9f14[_0x858d('0x39')]=_[_0x858d('0x3a')](_0x4b9f14['where'],{'$or':_[_0x858d('0x2a')](_0x3732a2,function(_0x3e5500){if(_0x3e5500[_0x858d('0x3b')]!==_0x858d('0x3c')){var _0xd591cf={};_0xd591cf[_0x3e5500['name']]={'$like':'%'+_0xe3549f['query'][_0x858d('0x38')]+'%'};return _0xd591cf;}})});}_0x4b9f14=_[_0x858d('0x3a')]({},_0x4b9f14,_0xe3549f[_0x858d('0x3d')]);var _0x20e9e8={'where':_0x4b9f14[_0x858d('0x39')]};return db[_0x858d('0x2b')][_0x858d('0x1d')](_0x20e9e8)[_0x858d('0x25')](function(_0x37ae09){_0x5491e3[_0x858d('0x1d')]=_0x37ae09;if(_0xe3549f[_0x858d('0x31')]['includeAll']){_0x4b9f14['include']=[{'all':!![]}];}return db[_0x858d('0x2b')][_0x858d('0x3e')](_0x4b9f14);})[_0x858d('0x25')](function(_0x27dbc4){_0x5491e3['rows']=_0x27dbc4;return _0x5491e3;})[_0x858d('0x25')](respondWithFilteredResult(_0x174073,_0x4b9f14))[_0x858d('0x3f')](handleError(_0x174073,null));};exports[_0x858d('0x40')]=function(_0x39f241,_0x1bd358){var _0x6cc343={'raw':!![],'where':{'id':_0x39f241['params']['id']}},_0x4766ea={};_0x4766ea[_0x858d('0x2f')]=_[_0x858d('0x30')](db[_0x858d('0x2b')][_0x858d('0x2c')]);_0x4766ea[_0x858d('0x31')]=_[_0x858d('0x30')](_0x39f241[_0x858d('0x31')]);_0x4766ea[_0x858d('0x32')]=_['intersection'](_0x4766ea[_0x858d('0x2f')],_0x4766ea[_0x858d('0x31')]);_0x6cc343['attributes']=_['intersection'](_0x4766ea[_0x858d('0x2f')],qs[_0x858d('0x35')](_0x39f241[_0x858d('0x31')][_0x858d('0x35')]));_0x6cc343[_0x858d('0x34')]=_0x6cc343[_0x858d('0x34')]['length']?_0x6cc343[_0x858d('0x34')]:_0x4766ea[_0x858d('0x2f')];if(_0x39f241[_0x858d('0x31')][_0x858d('0x41')]){_0x6cc343['include']=[{'all':!![]}];}_0x6cc343=_[_0x858d('0x3a')]({},_0x6cc343,_0x39f241[_0x858d('0x3d')]);return db[_0x858d('0x2b')][_0x858d('0x42')](_0x6cc343)[_0x858d('0x25')](handleEntityNotFound(_0x1bd358,null))[_0x858d('0x25')](respondWithResult(_0x1bd358,null))[_0x858d('0x3f')](handleError(_0x1bd358,null));};exports[_0x858d('0x24')]=function(_0x78c822,_0x2462f3){if(_0x78c822[_0x858d('0x43')]['id']){delete _0x78c822[_0x858d('0x43')]['id'];}return db['CmHopperBlack'][_0x858d('0x42')]({'where':{'id':_0x78c822['params']['id']}})[_0x858d('0x25')](handleEntityNotFound(_0x2462f3,null))[_0x858d('0x25')](saveUpdates(_0x78c822[_0x858d('0x43')],null))[_0x858d('0x25')](respondWithResult(_0x2462f3,null))[_0x858d('0x3f')](handleError(_0x2462f3,null));};exports[_0x858d('0x26')]=function(_0x1fa79b,_0x3edfa9){return db[_0x858d('0x2b')]['find']({'where':{'id':_0x1fa79b['params']['id']}})[_0x858d('0x25')](handleEntityNotFound(_0x3edfa9,null))['then'](removeEntity(_0x3edfa9,null))[_0x858d('0x3f')](handleError(_0x3edfa9,null));};exports[_0x858d('0x44')]=function(_0x8ec6ff,_0x3fab79){return db[_0x858d('0x2b')]['describe']()[_0x858d('0x25')](respondWithResult(_0x3fab79,null))[_0x858d('0x3f')](handleError(_0x3fab79,null));}; \ No newline at end of file +var _0x3287=['count','Content-Range','apply','reject','then','destroy','sendStatus','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','keys','query','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filters','filter','merge','includeAll','include','rows','catch','show','options','find','update','body','params','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined'];(function(_0x5b09ac,_0x298dcb){var _0x3ce3ce=function(_0x1bb7b2){while(--_0x1bb7b2){_0x5b09ac['push'](_0x5b09ac['shift']());}};_0x3ce3ce(++_0x298dcb);}(_0x3287,0x6e));var _0x7328=function(_0x4b1a17,_0x1cd2d4){_0x4b1a17=_0x4b1a17-0x0;var _0x309e36=_0x3287[_0x4b1a17];return _0x309e36;};'use strict';var emlformat=require(_0x7328('0x0'));var rimraf=require(_0x7328('0x1'));var zipdir=require(_0x7328('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7328('0x3'));var Mustache=require(_0x7328('0x4'));var util=require(_0x7328('0x5'));var path=require(_0x7328('0x6'));var sox=require(_0x7328('0x7'));var csv=require('to-csv');var ejs=require(_0x7328('0x8'));var fs=require('fs');var fs_extra=require(_0x7328('0x9'));var _=require(_0x7328('0xa'));var squel=require(_0x7328('0xb'));var crypto=require(_0x7328('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7328('0xd'));var toCsv=require(_0x7328('0xe'));var querystring=require(_0x7328('0xf'));var Papa=require(_0x7328('0x10'));var Redis=require(_0x7328('0x11'));var authService=require(_0x7328('0x12'));var qs=require(_0x7328('0x13'));var as=require(_0x7328('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7328('0x15'))(_0x7328('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7328('0x17'));var db=require(_0x7328('0x18'))['db'];function respondWithStatusCode(_0x521d52,_0x51eca3){_0x51eca3=_0x51eca3||0xcc;return function(_0x4cf788){if(_0x4cf788){return _0x521d52['sendStatus'](_0x51eca3);}return _0x521d52[_0x7328('0x19')](_0x51eca3)['end']();};}function respondWithResult(_0x543b18,_0x5017db){_0x5017db=_0x5017db||0xc8;return function(_0x476d8c){if(_0x476d8c){return _0x543b18[_0x7328('0x19')](_0x5017db)[_0x7328('0x1a')](_0x476d8c);}};}function respondWithFilteredResult(_0x1df4da,_0x5df00f){return function(_0x26121f){if(_0x26121f){var _0x365a07=typeof _0x5df00f[_0x7328('0x1b')]==='undefined'&&typeof _0x5df00f[_0x7328('0x1c')]===_0x7328('0x1d');var _0x1703eb=_0x26121f['count'];var _0x2a2e5f=_0x365a07?0x0:_0x5df00f[_0x7328('0x1b')];var _0x495f4f=_0x365a07?_0x26121f[_0x7328('0x1e')]:_0x5df00f[_0x7328('0x1b')]+_0x5df00f[_0x7328('0x1c')];var _0x3b3b32;if(_0x495f4f>=_0x1703eb){_0x495f4f=_0x1703eb;_0x3b3b32=0xc8;}else{_0x3b3b32=0xce;}_0x1df4da['status'](_0x3b3b32);return _0x1df4da['set'](_0x7328('0x1f'),_0x2a2e5f+'-'+_0x495f4f+'/'+_0x1703eb)[_0x7328('0x1a')](_0x26121f);}return null;};}function patchUpdates(_0x3b57af){return function(_0x3205d0){try{jsonpatch[_0x7328('0x20')](_0x3205d0,_0x3b57af,!![]);}catch(_0x57f192){return BPromise[_0x7328('0x21')](_0x57f192);}return _0x3205d0['save']();};}function saveUpdates(_0x531f81,_0x246fcf){return function(_0x16b4d6){if(_0x16b4d6){return _0x16b4d6['update'](_0x531f81)[_0x7328('0x22')](function(_0x457e06){return _0x457e06;});}return null;};}function removeEntity(_0x182fc4,_0x10938f){return function(_0x59a4d9){if(_0x59a4d9){return _0x59a4d9[_0x7328('0x23')]()[_0x7328('0x22')](function(){_0x182fc4[_0x7328('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ad8d4,_0x396012){return function(_0xfe1265){if(!_0xfe1265){_0x2ad8d4[_0x7328('0x24')](0x194);}return _0xfe1265;};}function handleError(_0x51cee7,_0x15ab81){_0x15ab81=_0x15ab81||0x1f4;return function(_0x33d275){logger['error'](_0x33d275['stack']);if(_0x33d275[_0x7328('0x25')]){delete _0x33d275[_0x7328('0x25')];}_0x51cee7[_0x7328('0x19')](_0x15ab81)[_0x7328('0x26')](_0x33d275);};}exports[_0x7328('0x27')]=function(_0x1891d8,_0x1524e8){var _0x256db9={},_0x1bb950={},_0x5c018d={'count':0x0,'rows':[]};var _0x202caa=_[_0x7328('0x28')](db[_0x7328('0x29')][_0x7328('0x2a')],function(_0x184580){return{'name':_0x184580[_0x7328('0x2b')],'type':_0x184580[_0x7328('0x2c')]['key']};});_0x1bb950['model']=_['map'](_0x202caa,_0x7328('0x25'));_0x1bb950['query']=_[_0x7328('0x2d')](_0x1891d8[_0x7328('0x2e')]);_0x1bb950['filters']=_[_0x7328('0x2f')](_0x1bb950[_0x7328('0x30')],_0x1bb950[_0x7328('0x2e')]);_0x256db9['attributes']=_[_0x7328('0x2f')](_0x1bb950[_0x7328('0x30')],qs[_0x7328('0x31')](_0x1891d8[_0x7328('0x2e')][_0x7328('0x31')]));_0x256db9[_0x7328('0x32')]=_0x256db9['attributes'][_0x7328('0x33')]?_0x256db9[_0x7328('0x32')]:_0x1bb950[_0x7328('0x30')];if(!_0x1891d8[_0x7328('0x2e')]['hasOwnProperty'](_0x7328('0x34'))){_0x256db9[_0x7328('0x1c')]=qs[_0x7328('0x1c')](_0x1891d8[_0x7328('0x2e')]['limit']);_0x256db9['offset']=qs[_0x7328('0x1b')](_0x1891d8[_0x7328('0x2e')][_0x7328('0x1b')]);}_0x256db9['order']=qs[_0x7328('0x35')](_0x1891d8[_0x7328('0x2e')][_0x7328('0x35')]);_0x256db9[_0x7328('0x36')]=qs['filters'](_[_0x7328('0x37')](_0x1891d8['query'],_0x1bb950[_0x7328('0x38')]),_0x202caa);if(_0x1891d8[_0x7328('0x2e')]['filter']){_0x256db9['where']=_['merge'](_0x256db9[_0x7328('0x36')],{'$or':_[_0x7328('0x28')](_0x202caa,function(_0x5b7866){if(_0x5b7866[_0x7328('0x2c')]!=='VIRTUAL'){var _0x23ab94={};_0x23ab94[_0x5b7866['name']]={'$like':'%'+_0x1891d8['query'][_0x7328('0x39')]+'%'};return _0x23ab94;}})});}_0x256db9=_[_0x7328('0x3a')]({},_0x256db9,_0x1891d8['options']);var _0x41ef2a={'where':_0x256db9[_0x7328('0x36')]};return db[_0x7328('0x29')][_0x7328('0x1e')](_0x41ef2a)['then'](function(_0x213962){_0x5c018d[_0x7328('0x1e')]=_0x213962;if(_0x1891d8[_0x7328('0x2e')][_0x7328('0x3b')]){_0x256db9[_0x7328('0x3c')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x256db9);})[_0x7328('0x22')](function(_0x202b54){_0x5c018d[_0x7328('0x3d')]=_0x202b54;return _0x5c018d;})[_0x7328('0x22')](respondWithFilteredResult(_0x1524e8,_0x256db9))[_0x7328('0x3e')](handleError(_0x1524e8,null));};exports[_0x7328('0x3f')]=function(_0x722335,_0x59a89a){var _0x14e02c={'raw':!![],'where':{'id':_0x722335['params']['id']}},_0x55bd4a={};_0x55bd4a[_0x7328('0x30')]=_[_0x7328('0x2d')](db['CmHopperBlack'][_0x7328('0x2a')]);_0x55bd4a[_0x7328('0x2e')]=_['keys'](_0x722335[_0x7328('0x2e')]);_0x55bd4a['filters']=_['intersection'](_0x55bd4a[_0x7328('0x30')],_0x55bd4a[_0x7328('0x2e')]);_0x14e02c[_0x7328('0x32')]=_[_0x7328('0x2f')](_0x55bd4a[_0x7328('0x30')],qs['fields'](_0x722335[_0x7328('0x2e')][_0x7328('0x31')]));_0x14e02c[_0x7328('0x32')]=_0x14e02c[_0x7328('0x32')][_0x7328('0x33')]?_0x14e02c[_0x7328('0x32')]:_0x55bd4a[_0x7328('0x30')];if(_0x722335[_0x7328('0x2e')]['includeAll']){_0x14e02c[_0x7328('0x3c')]=[{'all':!![]}];}_0x14e02c=_['merge']({},_0x14e02c,_0x722335[_0x7328('0x40')]);return db[_0x7328('0x29')][_0x7328('0x41')](_0x14e02c)[_0x7328('0x22')](handleEntityNotFound(_0x59a89a,null))['then'](respondWithResult(_0x59a89a,null))[_0x7328('0x3e')](handleError(_0x59a89a,null));};exports[_0x7328('0x42')]=function(_0x297360,_0x42657e){if(_0x297360[_0x7328('0x43')]['id']){delete _0x297360[_0x7328('0x43')]['id'];}return db['CmHopperBlack'][_0x7328('0x41')]({'where':{'id':_0x297360[_0x7328('0x44')]['id']}})['then'](handleEntityNotFound(_0x42657e,null))['then'](saveUpdates(_0x297360[_0x7328('0x43')],null))[_0x7328('0x22')](respondWithResult(_0x42657e,null))['catch'](handleError(_0x42657e,null));};exports['destroy']=function(_0x16ffed,_0x242250){return db['CmHopperBlack'][_0x7328('0x41')]({'where':{'id':_0x16ffed[_0x7328('0x44')]['id']}})[_0x7328('0x22')](handleEntityNotFound(_0x242250,null))['then'](removeEntity(_0x242250,null))[_0x7328('0x3e')](handleError(_0x242250,null));};exports[_0x7328('0x45')]=function(_0x30de73,_0x5882c3){return db[_0x7328('0x29')][_0x7328('0x45')]()[_0x7328('0x22')](respondWithResult(_0x5882c3,null))[_0x7328('0x3e')](handleError(_0x5882c3,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 111b3b6..6f14447 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 _0xadca=['exports','define','cm_hopper_black','lodash','util','../../config/logger','moment','bluebird','rimraf','./cmHopperBlack.attributes'];(function(_0x2f1c29,_0x3fa531){var _0x1d163f=function(_0x9fd7f9){while(--_0x9fd7f9){_0x2f1c29['push'](_0x2f1c29['shift']());}};_0x1d163f(++_0x3fa531);}(_0xadca,0x143));var _0xaadc=function(_0x228f06,_0x187279){_0x228f06=_0x228f06-0x0;var _0x51fe32=_0xadca[_0x228f06];return _0x51fe32;};'use strict';var _=require(_0xaadc('0x0'));var util=require(_0xaadc('0x1'));var logger=require(_0xaadc('0x2'))('api');var moment=require(_0xaadc('0x3'));var BPromise=require(_0xaadc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaadc('0x5'));var config=require('../../config/environment');var attributes=require(_0xaadc('0x6'));module[_0xaadc('0x7')]=function(_0x18b82f,_0x590be4){return _0x18b82f[_0xaadc('0x8')]('CmHopperBlack',attributes,{'tableName':_0xaadc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02ab=['util','../../config/logger','request-promise','path','rimraf','../../config/environment','cm_hopper_black','lodash'];(function(_0x241890,_0x5e5676){var _0x558dd2=function(_0x57b16e){while(--_0x57b16e){_0x241890['push'](_0x241890['shift']());}};_0x558dd2(++_0x5e5676);}(_0x02ab,0xe7));var _0xb02a=function(_0x16723b,_0x30d80c){_0x16723b=_0x16723b-0x0;var _0xc9d4bb=_0x02ab[_0x16723b];return _0xc9d4bb;};'use strict';var _=require(_0xb02a('0x0'));var util=require(_0xb02a('0x1'));var logger=require(_0xb02a('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb02a('0x3'));var fs=require('fs');var path=require(_0xb02a('0x4'));var rimraf=require(_0xb02a('0x5'));var config=require(_0xb02a('0x6'));var attributes=require('./cmHopperBlack.attributes');module['exports']=function(_0x53ee8b,_0x598054){return _0x53ee8b['define']('CmHopperBlack',attributes,{'tableName':_0xb02a('0x7'),'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 03567f3..817a3af 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 _0x51f4=['CmHopperBlack','findAll','options','raw','where','limit','include','map','model','attributes','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','GetCmHopperBlack'];(function(_0x4cb9e7,_0x412d21){var _0x133706=function(_0xccd8e2){while(--_0xccd8e2){_0x4cb9e7['push'](_0x4cb9e7['shift']());}};_0x133706(++_0x412d21);}(_0x51f4,0x103));var _0x451f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x51f4[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x451f('0x0'));var util=require('util');var moment=require(_0x451f('0x1'));var BPromise=require(_0x451f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x451f('0x3'))['db'];var utils=require(_0x451f('0x4'));var logger=require(_0x451f('0x5'))('rpc');var config=require(_0x451f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x451f('0x7')][_0x451f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5883af,_0x4835f9,_0x38e53d){return new BPromise(function(_0x1fc5b7,_0x49c343){return client[_0x451f('0x9')](_0x5883af,_0x38e53d)[_0x451f('0xa')](function(_0x1cb407){logger[_0x451f('0xb')](_0x451f('0xc'),_0x4835f9,_0x451f('0xd'));logger[_0x451f('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x4835f9,_0x451f('0xd'),JSON[_0x451f('0xf')](_0x1cb407));if(_0x1cb407['error']){if(_0x1cb407['error'][_0x451f('0x10')]===0x1f4){logger[_0x451f('0x11')](_0x451f('0xc'),_0x4835f9,_0x1cb407['error'][_0x451f('0x12')]);return _0x49c343(_0x1cb407[_0x451f('0x11')][_0x451f('0x12')]);}logger[_0x451f('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x4835f9,_0x1cb407['error'][_0x451f('0x12')]);return _0x1fc5b7(_0x1cb407['error']['message']);}else{logger[_0x451f('0xb')](_0x451f('0xc'),_0x4835f9,'request\x20sent');_0x1fc5b7(_0x1cb407['result']['message']);}})[_0x451f('0x13')](function(_0x55faaf){logger[_0x451f('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x4835f9,_0x55faaf);_0x49c343(_0x55faaf);});});}exports[_0x451f('0x14')]=function(_0x45826d){var _0x50e8d4=this;return new Promise(function(_0x42220f,_0x3dcdff){return db[_0x451f('0x15')][_0x451f('0x16')]({'raw':_0x45826d['options']?_0x45826d[_0x451f('0x17')][_0x451f('0x18')]===undefined?!![]:![]:!![],'where':_0x45826d['options']?_0x45826d[_0x451f('0x17')][_0x451f('0x19')]||null:null,'attributes':_0x45826d[_0x451f('0x17')]?_0x45826d[_0x451f('0x17')]['attributes']||null:null,'limit':_0x45826d[_0x451f('0x17')]?_0x45826d[_0x451f('0x17')][_0x451f('0x1a')]||null:null,'include':_0x45826d['options']?_0x45826d[_0x451f('0x17')][_0x451f('0x1b')]?_[_0x451f('0x1c')](_0x45826d['options'][_0x451f('0x1b')],function(_0x444b0e){return{'model':db[_0x444b0e[_0x451f('0x1d')]],'as':_0x444b0e['as'],'attributes':_0x444b0e[_0x451f('0x1e')],'include':_0x444b0e['include']?_[_0x451f('0x1c')](_0x444b0e['include'],function(_0x194b92){return{'model':db[_0x194b92[_0x451f('0x1d')]],'as':_0x194b92['as'],'attributes':_0x194b92['attributes'],'include':_0x194b92[_0x451f('0x1b')]?_[_0x451f('0x1c')](_0x194b92[_0x451f('0x1b')],function(_0x5bedee){return{'model':db[_0x5bedee[_0x451f('0x1d')]],'as':_0x5bedee['as'],'attributes':_0x5bedee[_0x451f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x451f('0xa')](function(_0x3556b5){logger[_0x451f('0xb')]('GetCmHopperBlack',_0x45826d);logger[_0x451f('0xe')](_0x451f('0x14'),_0x45826d,JSON['stringify'](_0x3556b5));_0x42220f(_0x3556b5);})[_0x451f('0x13')](function(_0x446c18){logger[_0x451f('0x11')](_0x451f('0x14'),_0x446c18[_0x451f('0x12')],_0x45826d);_0x3dcdff(_0x50e8d4[_0x451f('0x11')](0x1f4,_0x446c18['message']));});});};exports[_0x451f('0x1f')]=function(_0x55c2b8){var _0x2daa1c=this;return new Promise(function(_0x26f41b,_0x2a6af6){return db[_0x451f('0x15')][_0x451f('0x20')](_0x55c2b8[_0x451f('0x21')],{'raw':_0x55c2b8[_0x451f('0x17')]?_0x55c2b8['options'][_0x451f('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55c2b8[_0x451f('0x17')]?_0x55c2b8[_0x451f('0x17')][_0x451f('0x19')]||null:null,'attributes':_0x55c2b8[_0x451f('0x17')]?_0x55c2b8['options']['attributes']||null:null,'limit':_0x55c2b8[_0x451f('0x17')]?_0x55c2b8[_0x451f('0x17')]['limit']||null:null})[_0x451f('0xa')](function(_0x228b42){logger[_0x451f('0xb')]('UpdateCmHopperBlack',_0x55c2b8);logger[_0x451f('0xe')](_0x451f('0x1f'),_0x55c2b8,JSON[_0x451f('0xf')](_0x228b42));_0x26f41b(_0x228b42);})[_0x451f('0x13')](function(_0x56e37f){logger[_0x451f('0x11')]('UpdateCmHopperBlack',_0x56e37f[_0x451f('0x12')],_0x55c2b8);_0x2a6af6(_0x2daa1c[_0x451f('0x11')](0x1f4,_0x56e37f[_0x451f('0x12')]));});});};exports[_0x451f('0x22')]=function(_0x471b7f){var _0x266aac=this;return new Promise(function(_0x4beb90,_0x13bd5f){return db[_0x451f('0x15')]['destroy']({'where':_0x471b7f[_0x451f('0x17')]?_0x471b7f[_0x451f('0x17')][_0x451f('0x19')]||null:null})[_0x451f('0xa')](function(_0x2e51b2){logger['info'](_0x451f('0x22'),_0x471b7f);logger[_0x451f('0xe')](_0x451f('0x22'),_0x471b7f,JSON['stringify'](_0x2e51b2));_0x4beb90(_0x2e51b2);})[_0x451f('0x13')](function(_0x431e1d){logger[_0x451f('0x11')](_0x451f('0x22'),_0x431e1d[_0x451f('0x12')],_0x471b7f);_0x13bd5f(_0x266aac[_0x451f('0x11')](0x1f4,_0x431e1d[_0x451f('0x12')]));});});}; \ No newline at end of file +var _0xaed4=['../../config/environment','jayson/promise','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','CmHopperBlack','update','body','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x127966,_0x3d69e0){var _0x46e664=function(_0x29439c){while(--_0x29439c){_0x127966['push'](_0x127966['shift']());}};_0x46e664(++_0x3d69e0);}(_0xaed4,0xb6));var _0x4aed=function(_0x39eba1,_0x548ec6){_0x39eba1=_0x39eba1-0x0;var _0x5ea861=_0xaed4[_0x39eba1];return _0x5ea861;};'use strict';var _=require(_0x4aed('0x0'));var util=require(_0x4aed('0x1'));var moment=require(_0x4aed('0x2'));var BPromise=require(_0x4aed('0x3'));var rs=require(_0x4aed('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4aed('0x5'));var logger=require(_0x4aed('0x6'))(_0x4aed('0x7'));var config=require(_0x4aed('0x8'));var jayson=require(_0x4aed('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c8bfd,_0x2dc6f9,_0x356d65){return new BPromise(function(_0x1621f5,_0x4e3be3){return client[_0x4aed('0xa')](_0x1c8bfd,_0x356d65)[_0x4aed('0xb')](function(_0x60f8d4){logger[_0x4aed('0xc')](_0x4aed('0xd'),_0x2dc6f9,_0x4aed('0xe'));logger[_0x4aed('0xf')](_0x4aed('0x10'),_0x2dc6f9,_0x4aed('0xe'),JSON[_0x4aed('0x11')](_0x60f8d4));if(_0x60f8d4[_0x4aed('0x12')]){if(_0x60f8d4[_0x4aed('0x12')]['code']===0x1f4){logger[_0x4aed('0x12')](_0x4aed('0xd'),_0x2dc6f9,_0x60f8d4[_0x4aed('0x12')][_0x4aed('0x13')]);return _0x4e3be3(_0x60f8d4[_0x4aed('0x12')][_0x4aed('0x13')]);}logger[_0x4aed('0x12')](_0x4aed('0xd'),_0x2dc6f9,_0x60f8d4[_0x4aed('0x12')][_0x4aed('0x13')]);return _0x1621f5(_0x60f8d4[_0x4aed('0x12')]['message']);}else{logger[_0x4aed('0xc')](_0x4aed('0xd'),_0x2dc6f9,_0x4aed('0xe'));_0x1621f5(_0x60f8d4[_0x4aed('0x14')][_0x4aed('0x13')]);}})[_0x4aed('0x15')](function(_0x3082c3){logger[_0x4aed('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x2dc6f9,_0x3082c3);_0x4e3be3(_0x3082c3);});});}exports[_0x4aed('0x16')]=function(_0x566ecd){var _0x38f262=this;return new Promise(function(_0x4761d2,_0x1cf4e2){return db['CmHopperBlack'][_0x4aed('0x17')]({'raw':_0x566ecd[_0x4aed('0x18')]?_0x566ecd['options'][_0x4aed('0x19')]===undefined?!![]:![]:!![],'where':_0x566ecd[_0x4aed('0x18')]?_0x566ecd[_0x4aed('0x18')][_0x4aed('0x1a')]||null:null,'attributes':_0x566ecd[_0x4aed('0x18')]?_0x566ecd[_0x4aed('0x18')][_0x4aed('0x1b')]||null:null,'limit':_0x566ecd[_0x4aed('0x18')]?_0x566ecd[_0x4aed('0x18')][_0x4aed('0x1c')]||null:null,'include':_0x566ecd[_0x4aed('0x18')]?_0x566ecd[_0x4aed('0x18')][_0x4aed('0x1d')]?_[_0x4aed('0x1e')](_0x566ecd['options'][_0x4aed('0x1d')],function(_0x4ec625){return{'model':db[_0x4ec625[_0x4aed('0x1f')]],'as':_0x4ec625['as'],'attributes':_0x4ec625[_0x4aed('0x1b')],'include':_0x4ec625[_0x4aed('0x1d')]?_[_0x4aed('0x1e')](_0x4ec625[_0x4aed('0x1d')],function(_0x45c4ef){return{'model':db[_0x45c4ef[_0x4aed('0x1f')]],'as':_0x45c4ef['as'],'attributes':_0x45c4ef[_0x4aed('0x1b')],'include':_0x45c4ef[_0x4aed('0x1d')]?_[_0x4aed('0x1e')](_0x45c4ef[_0x4aed('0x1d')],function(_0xa06638){return{'model':db[_0xa06638[_0x4aed('0x1f')]],'as':_0xa06638['as'],'attributes':_0xa06638['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x341508){logger['info'](_0x4aed('0x16'),_0x566ecd);logger[_0x4aed('0xf')](_0x4aed('0x16'),_0x566ecd,JSON[_0x4aed('0x11')](_0x341508));_0x4761d2(_0x341508);})['catch'](function(_0x234c43){logger[_0x4aed('0x12')]('GetCmHopperBlack',_0x234c43[_0x4aed('0x13')],_0x566ecd);_0x1cf4e2(_0x38f262[_0x4aed('0x12')](0x1f4,_0x234c43[_0x4aed('0x13')]));});});};exports['UpdateCmHopperBlack']=function(_0x50cfd2){var _0x3ef671=this;return new Promise(function(_0x3ccd88,_0x20a454){return db[_0x4aed('0x20')][_0x4aed('0x21')](_0x50cfd2[_0x4aed('0x22')],{'raw':_0x50cfd2[_0x4aed('0x18')]?_0x50cfd2[_0x4aed('0x18')][_0x4aed('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50cfd2[_0x4aed('0x18')]?_0x50cfd2[_0x4aed('0x18')][_0x4aed('0x1a')]||null:null,'attributes':_0x50cfd2[_0x4aed('0x18')]?_0x50cfd2[_0x4aed('0x18')][_0x4aed('0x1b')]||null:null,'limit':_0x50cfd2['options']?_0x50cfd2[_0x4aed('0x18')][_0x4aed('0x1c')]||null:null})['then'](function(_0x378917){logger[_0x4aed('0xc')]('UpdateCmHopperBlack',_0x50cfd2);logger[_0x4aed('0xf')](_0x4aed('0x23'),_0x50cfd2,JSON[_0x4aed('0x11')](_0x378917));_0x3ccd88(_0x378917);})['catch'](function(_0x340b28){logger[_0x4aed('0x12')](_0x4aed('0x23'),_0x340b28['message'],_0x50cfd2);_0x20a454(_0x3ef671[_0x4aed('0x12')](0x1f4,_0x340b28['message']));});});};exports[_0x4aed('0x24')]=function(_0x4335e2){var _0x5c9ef8=this;return new Promise(function(_0x2baf05,_0xa88bce){return db['CmHopperBlack'][_0x4aed('0x25')]({'where':_0x4335e2[_0x4aed('0x18')]?_0x4335e2['options']['where']||null:null})[_0x4aed('0xb')](function(_0x5eb002){logger['info'](_0x4aed('0x24'),_0x4335e2);logger[_0x4aed('0xf')](_0x4aed('0x24'),_0x4335e2,JSON[_0x4aed('0x11')](_0x5eb002));_0x2baf05(_0x5eb002);})[_0x4aed('0x15')](function(_0x183a3c){logger[_0x4aed('0x12')]('DestroyCmHopperBlack',_0x183a3c['message'],_0x4335e2);_0xa88bce(_0x5c9ef8[_0x4aed('0x12')](0x1f4,_0x183a3c[_0x4aed('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 403c075..b762c7a 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 _0x68b3=['/:id','show','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x59bf06,_0x41e21c){var _0x2dafe0=function(_0x23559a){while(--_0x23559a){_0x59bf06['push'](_0x59bf06['shift']());}};_0x2dafe0(++_0x41e21c);}(_0x68b3,0x1d8));var _0x368b=function(_0x4aff93,_0x5543b7){_0x4aff93=_0x4aff93-0x0;var _0xd09714=_0x68b3[_0x4aff93];return _0xd09714;};'use strict';var multer=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var path=require(_0x368b('0x2'));var timeout=require(_0x368b('0x3'));var express=require(_0x368b('0x4'));var router=express['Router']();var fs_extra=require(_0x368b('0x5'));var auth=require(_0x368b('0x6'));var interaction=require(_0x368b('0x7'));var config=require(_0x368b('0x8'));var controller=require('./cmHopperBlack.controller');router[_0x368b('0x9')]('/',auth[_0x368b('0xa')](),controller[_0x368b('0xb')]);router[_0x368b('0x9')](_0x368b('0xc'),auth[_0x368b('0xa')](),controller[_0x368b('0xd')]);router[_0x368b('0x9')](_0x368b('0xe'),auth[_0x368b('0xa')](),controller[_0x368b('0xf')]);router['put'](_0x368b('0xe'),auth[_0x368b('0xa')](),controller[_0x368b('0x10')]);router['delete'](_0x368b('0xe'),auth[_0x368b('0xa')](),controller[_0x368b('0x11')]);module['exports']=router; \ No newline at end of file +var _0x5430=['path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','destroy','exports','multer','util'];(function(_0x230783,_0x3f1c0e){var _0x19dd10=function(_0x165817){while(--_0x165817){_0x230783['push'](_0x230783['shift']());}};_0x19dd10(++_0x3f1c0e);}(_0x5430,0x10c));var _0x0543=function(_0x53f085,_0x2dedd9){_0x53f085=_0x53f085-0x0;var _0x41101c=_0x5430[_0x53f085];return _0x41101c;};'use strict';var multer=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var path=require(_0x0543('0x2'));var timeout=require(_0x0543('0x3'));var express=require(_0x0543('0x4'));var router=express[_0x0543('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0543('0x6'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x0543('0x7')]('/',auth[_0x0543('0x8')](),controller[_0x0543('0x9')]);router[_0x0543('0x7')](_0x0543('0xa'),auth['isAuthenticated'](),controller[_0x0543('0xb')]);router[_0x0543('0x7')](_0x0543('0xc'),auth[_0x0543('0x8')](),controller[_0x0543('0xd')]);router[_0x0543('0xe')]('/:id',auth[_0x0543('0x8')](),controller[_0x0543('0xf')]);router['delete'](_0x0543('0xc'),auth[_0x0543('0x8')](),controller[_0x0543('0x10')]);module[_0x0543('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 9ec60dc..b82073d 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 _0x7d59=['exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','diff','BOOLEAN','sequelize'];(function(_0x347541,_0x137cf){var _0x5c0e38=function(_0x32a276){while(--_0x32a276){_0x347541['push'](_0x347541['shift']());}};_0x5c0e38(++_0x137cf);}(_0x7d59,0x1ad));var _0x97d5=function(_0xb4b80e,_0x1f02e8){_0xb4b80e=_0xb4b80e-0x0;var _0x5e4846=_0x7d59[_0xb4b80e];return _0x5e4846;};'use strict';var Sequelize=require(_0x97d5('0x0'));var moment=require('moment');module[_0x97d5('0x1')]={'state':{'type':Sequelize[_0x97d5('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x97d5('0x3')]},'scheduledat':{'type':Sequelize[_0x97d5('0x4')]},'countbusyretry':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x97d5('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x97d5('0x3')]},'calleridname':{'type':Sequelize[_0x97d5('0x3')]},'starttime':{'type':Sequelize[_0x97d5('0x4')]},'responsetime':{'type':Sequelize[_0x97d5('0x4')]},'answertime':{'type':Sequelize[_0x97d5('0x4')]},'droptime':{'type':Sequelize[_0x97d5('0x4')]},'endtime':{'type':Sequelize[_0x97d5('0x4')]},'ringtime':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x97d5('0x3')]},'campaign':{'type':Sequelize[_0x97d5('0x3')]},'campaigntype':{'type':Sequelize[_0x97d5('0x3')]},'membername':{'type':Sequelize[_0x97d5('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x97d5('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x97d5('0x3')]},'dispositionat':{'type':Sequelize[_0x97d5('0x4')],'set':function(_0xf46969){var _0x2bc1be=this[_0x97d5('0x5')](_0x97d5('0x6'));if(_0x2bc1be&&_0xf46969){this[_0x97d5('0x7')]('followuptime',moment(_0xf46969)[_0x97d5('0x8')](moment(_0x2bc1be),'seconds'));}}},'amd':{'type':Sequelize[_0x97d5('0x9')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x97d5('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x97d5('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x97d5('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x97d5('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x97d5('0x4')]},'deleted':{'type':Sequelize[_0x97d5('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x97d5('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x97d5('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc39d=['diff','seconds','BOOLEAN','sequelize','moment','exports','DATE','INTEGER','STRING','endtime','setDataValue'];(function(_0x3bfdfc,_0x596a9c){var _0x5e348c=function(_0x4103c9){while(--_0x4103c9){_0x3bfdfc['push'](_0x3bfdfc['shift']());}};_0x5e348c(++_0x596a9c);}(_0xc39d,0x116));var _0xdc39=function(_0x5950fd,_0x405b7f){_0x5950fd=_0x5950fd-0x0;var _0x32bed7=_0xc39d[_0x5950fd];return _0x32bed7;};'use strict';var Sequelize=require(_0xdc39('0x0'));var moment=require(_0xdc39('0x1'));module[_0xdc39('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xdc39('0x3')]},'countbusyretry':{'type':Sequelize[_0xdc39('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xdc39('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xdc39('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xdc39('0x5')]},'originatecalleridnum':{'type':Sequelize[_0xdc39('0x5')]},'originatecalleridname':{'type':Sequelize[_0xdc39('0x5')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdc39('0x5')]},'starttime':{'type':Sequelize[_0xdc39('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xdc39('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xdc39('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xdc39('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xdc39('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xdc39('0x5')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xdc39('0x5')]},'membername':{'type':Sequelize[_0xdc39('0x5')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xdc39('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xdc39('0x3')],'set':function(_0x504ea8){var _0x4d1630=this['getDataValue'](_0xdc39('0x6'));if(_0x4d1630&&_0x504ea8){this[_0xdc39('0x7')]('followuptime',moment(_0x504ea8)[_0xdc39('0x8')](moment(_0x4d1630),_0xdc39('0x9')));}}},'amd':{'type':Sequelize[_0xdc39('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xdc39('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xdc39('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xdc39('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xdc39('0x3')]},'callback':{'type':Sequelize[_0xdc39('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xdc39('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdc39('0x3')]},'deleted':{'type':Sequelize[_0xdc39('0x5')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xdc39('0x3')]},'recallme':{'type':Sequelize[_0xdc39('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xdc39('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0xdc39('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xdc39('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xdc39('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xdc39('0x4')],'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 34c9819..5c1a020 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 _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(_0x47cfa0,_0x176b87){var _0x386b1d=function(_0x5785e5){while(--_0x5785e5){_0x47cfa0['push'](_0x47cfa0['shift']());}};_0x386b1d(++_0x176b87);}(_0x687b,0x14a));var _0xb687=function(_0x1d5fb9,_0x43aa73){_0x1d5fb9=_0x1d5fb9-0x0;var _0xd72009=_0x687b[_0x1d5fb9];return _0xd72009;};'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 +var _0xba34=['insert','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','state\x20=\x20?','CampaignId\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','CmHopperFinal','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','uniqueid','params','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','NOW()','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign'];(function(_0x19b84f,_0x48765e){var _0x18067b=function(_0x1c69aa){while(--_0x1c69aa){_0x19b84f['push'](_0x19b84f['shift']());}};_0x18067b(++_0x48765e);}(_0xba34,0x119));var _0x4ba3=function(_0x537719,_0x938874){_0x537719=_0x537719-0x0;var _0x452363=_0xba34[_0x537719];return _0x452363;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1073d4,_0x52f55c){_0x52f55c=_0x52f55c||0xcc;return function(_0x256f02){if(_0x256f02){return _0x1073d4[_0x4ba3('0x19')](_0x52f55c);}return _0x1073d4[_0x4ba3('0x1a')](_0x52f55c)[_0x4ba3('0x1b')]();};}function respondWithResult(_0x2bc796,_0x3d2ace){_0x3d2ace=_0x3d2ace||0xc8;return function(_0x3a74f7){if(_0x3a74f7){return _0x2bc796[_0x4ba3('0x1a')](_0x3d2ace)[_0x4ba3('0x1c')](_0x3a74f7);}};}function respondWithFilteredResult(_0x401366,_0x36638b){return function(_0x301359){if(_0x301359){var _0x29a9d1=typeof _0x36638b[_0x4ba3('0x1d')]===_0x4ba3('0x1e')&&typeof _0x36638b[_0x4ba3('0x1f')]==='undefined';var _0x382fd0=_0x301359[_0x4ba3('0x20')];var _0x5ff7ce=_0x29a9d1?0x0:_0x36638b[_0x4ba3('0x1d')];var _0x556290=_0x29a9d1?_0x301359[_0x4ba3('0x20')]:_0x36638b[_0x4ba3('0x1d')]+_0x36638b[_0x4ba3('0x1f')];var _0x1e2ce5;if(_0x556290>=_0x382fd0){_0x556290=_0x382fd0;_0x1e2ce5=0xc8;}else{_0x1e2ce5=0xce;}_0x401366[_0x4ba3('0x1a')](_0x1e2ce5);return _0x401366[_0x4ba3('0x21')]('Content-Range',_0x5ff7ce+'-'+_0x556290+'/'+_0x382fd0)['json'](_0x301359);}return null;};}function patchUpdates(_0x2278b0){return function(_0x579d9f){try{jsonpatch[_0x4ba3('0x22')](_0x579d9f,_0x2278b0,!![]);}catch(_0x163967){return BPromise[_0x4ba3('0x23')](_0x163967);}return _0x579d9f[_0x4ba3('0x24')]();};}function saveUpdates(_0x46f1f5,_0x278a23){return function(_0x4a0823){if(_0x4a0823){return _0x4a0823[_0x4ba3('0x25')](_0x46f1f5)[_0x4ba3('0x26')](function(_0x5c28f9){return _0x5c28f9;});}return null;};}function removeEntity(_0x28bb3d,_0x4ffe39){return function(_0x1ae4de){if(_0x1ae4de){return _0x1ae4de[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){_0x28bb3d[_0x4ba3('0x1a')](0xcc)[_0x4ba3('0x1b')]();});}};}function handleEntityNotFound(_0xe29a49,_0x159596){return function(_0xe1f7d2){if(!_0xe1f7d2){_0xe29a49[_0x4ba3('0x19')](0x194);}return _0xe1f7d2;};}function handleError(_0x2e67a0,_0x50c729){_0x50c729=_0x50c729||0x1f4;return function(_0x252f37){logger[_0x4ba3('0x28')](_0x252f37[_0x4ba3('0x29')]);if(_0x252f37['name']){delete _0x252f37[_0x4ba3('0x2a')];}_0x2e67a0[_0x4ba3('0x1a')](_0x50c729)[_0x4ba3('0x2b')](_0x252f37);};}exports['index']=function(_0x10cae6,_0x843276){var _0x34ecb4={},_0x22394d={},_0x4a339e={'count':0x0,'rows':[]};var _0x590108=_[_0x4ba3('0x2c')](db[_0x4ba3('0x2d')][_0x4ba3('0x2e')],function(_0x19f039){return{'name':_0x19f039[_0x4ba3('0x2f')],'type':_0x19f039[_0x4ba3('0x30')]['key']};});_0x22394d[_0x4ba3('0x31')]=_[_0x4ba3('0x2c')](_0x590108,_0x4ba3('0x2a'));_0x22394d[_0x4ba3('0x32')]=_[_0x4ba3('0x33')](_0x10cae6[_0x4ba3('0x32')]);_0x22394d[_0x4ba3('0x34')]=_[_0x4ba3('0x35')](_0x22394d[_0x4ba3('0x31')],_0x22394d[_0x4ba3('0x32')]);_0x34ecb4['attributes']=_['intersection'](_0x22394d['model'],qs[_0x4ba3('0x36')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x36')]));_0x34ecb4[_0x4ba3('0x37')]=_0x34ecb4[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x34ecb4[_0x4ba3('0x37')]:_0x22394d[_0x4ba3('0x31')];if(!_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x39')](_0x4ba3('0x3a'))){_0x34ecb4[_0x4ba3('0x1f')]=qs['limit'](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x1f')]);_0x34ecb4[_0x4ba3('0x1d')]=qs['offset'](_0x10cae6[_0x4ba3('0x32')]['offset']);}_0x34ecb4[_0x4ba3('0x3b')]=qs[_0x4ba3('0x3c')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x3c')]);_0x34ecb4[_0x4ba3('0x3d')]=qs[_0x4ba3('0x34')](_['pick'](_0x10cae6[_0x4ba3('0x32')],_0x22394d[_0x4ba3('0x34')]),_0x590108);if(_0x10cae6[_0x4ba3('0x32')]['filter']){_0x34ecb4[_0x4ba3('0x3d')]=_[_0x4ba3('0x3e')](_0x34ecb4['where'],{'$or':_[_0x4ba3('0x2c')](_0x590108,function(_0x503777){if(_0x503777['type']!==_0x4ba3('0x3f')){var _0x1acc74={};_0x1acc74[_0x503777[_0x4ba3('0x2a')]]={'$like':'%'+_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x40')]+'%'};return _0x1acc74;}})});}_0x34ecb4=_['merge']({},_0x34ecb4,_0x10cae6[_0x4ba3('0x41')]);var _0x10e4b5={'where':_0x34ecb4[_0x4ba3('0x3d')]};return db[_0x4ba3('0x2d')][_0x4ba3('0x20')](_0x10e4b5)[_0x4ba3('0x26')](function(_0x349af4){_0x4a339e[_0x4ba3('0x20')]=_0x349af4;if(_0x10cae6['query'][_0x4ba3('0x42')]){_0x34ecb4[_0x4ba3('0x43')]=[{'all':!![]}];}return db[_0x4ba3('0x2d')][_0x4ba3('0x44')](_0x34ecb4);})[_0x4ba3('0x26')](function(_0x25b2c9){_0x4a339e[_0x4ba3('0x45')]=_0x25b2c9;return _0x4a339e;})[_0x4ba3('0x26')](respondWithFilteredResult(_0x843276,_0x34ecb4))[_0x4ba3('0x46')](handleError(_0x843276,null));};exports[_0x4ba3('0x47')]=function(_0x3b9a0a,_0x1c58d2){var _0x1d031b={'raw':!![],'where':{'id':_0x3b9a0a['params']['id']}},_0x28b649={};_0x28b649['model']=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x28b649[_0x4ba3('0x32')]=_['keys'](_0x3b9a0a[_0x4ba3('0x32')]);_0x28b649['filters']=_[_0x4ba3('0x35')](_0x28b649[_0x4ba3('0x31')],_0x28b649[_0x4ba3('0x32')]);_0x1d031b[_0x4ba3('0x37')]=_[_0x4ba3('0x35')](_0x28b649['model'],qs[_0x4ba3('0x36')](_0x3b9a0a['query'][_0x4ba3('0x36')]));_0x1d031b['attributes']=_0x1d031b[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x1d031b[_0x4ba3('0x37')]:_0x28b649[_0x4ba3('0x31')];if(_0x3b9a0a[_0x4ba3('0x32')][_0x4ba3('0x42')]){_0x1d031b[_0x4ba3('0x43')]=[{'all':!![]}];}_0x1d031b=_['merge']({},_0x1d031b,_0x3b9a0a[_0x4ba3('0x41')]);return db[_0x4ba3('0x2d')][_0x4ba3('0x48')](_0x1d031b)[_0x4ba3('0x26')](handleEntityNotFound(_0x1c58d2,null))[_0x4ba3('0x26')](respondWithResult(_0x1c58d2,null))['catch'](handleError(_0x1c58d2,null));};exports['describe']=function(_0xa4bbb2,_0x1fe115){return db[_0x4ba3('0x2d')]['describe']()[_0x4ba3('0x26')](respondWithResult(_0x1fe115,null))[_0x4ba3('0x46')](handleError(_0x1fe115,null));};exports[_0x4ba3('0x25')]=function(_0x58648d,_0x47f588){if(_0x58648d[_0x4ba3('0x49')]['uniqueid']){delete _0x58648d[_0x4ba3('0x49')][_0x4ba3('0x4a')];}return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'uniqueid':_0x58648d[_0x4ba3('0x4b')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x47f588,null))['then'](saveUpdates(_0x58648d[_0x4ba3('0x49')],null))[_0x4ba3('0x26')](respondWithResult(_0x47f588,null))['catch'](handleError(_0x47f588,null));};exports[_0x4ba3('0x4c')]=function(_0x12ae6f,_0x156c2d,_0x19d6a3){return db[_0x4ba3('0x2d')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x12ae6f[_0x4ba3('0x4b')]['id']},'attributes':[[db[_0x4ba3('0x4d')]['fn']('COUNT',db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x4f')))),_0x4ba3('0x50')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x52')))),_0x4ba3('0x53')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x4ba3('0x54')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')]['literal'](_0x4ba3('0x55')))),_0x4ba3('0x56')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x57')))),_0x4ba3('0x58')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x4ba3('0x59')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x5a')))),_0x4ba3('0x5b')],[db['sequelize']['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')]['literal'](_0x4ba3('0x5c')))),'answeringMachine']]})[_0x4ba3('0x26')](handleEntityNotFound(_0x156c2d,null))[_0x4ba3('0x26')](respondWithResult(_0x156c2d,null))[_0x4ba3('0x46')](handleError(_0x156c2d,null));};exports[_0x4ba3('0x5d')]=function(_0xf0fd32,_0x4b5289,_0x3d9a7e){return db[_0x4ba3('0x2d')][_0x4ba3('0x44')]({'raw':![],'where':{'CampaignId':_0xf0fd32[_0x4ba3('0x4b')]['id']},'attributes':[[db[_0x4ba3('0x4d')]['fn']('COUNT',db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x4f')))),_0x4ba3('0x50')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x52')))),'noAnswerContacts'],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db['sequelize']['fn']('IF',db['sequelize'][_0x4ba3('0x4e')](_0x4ba3('0x5e')))),'busyContacts'],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db['sequelize'][_0x4ba3('0x4e')](_0x4ba3('0x55')))),_0x4ba3('0x56')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db['sequelize'][_0x4ba3('0x4e')](_0x4ba3('0x57')))),_0x4ba3('0x58')],[db['sequelize']['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x5f')))),_0x4ba3('0x59')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db['sequelize']['fn']('IF',db['sequelize'][_0x4ba3('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0x4ba3('0x5b')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db['sequelize']['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x5c')))),'answeringMachine']]})[_0x4ba3('0x26')](handleEntityNotFound(_0x4b5289,null))['then'](respondWithResult(_0x4b5289,null))[_0x4ba3('0x46')](handleError(_0x4b5289,null));};exports[_0x4ba3('0x60')]=function(_0x5dce8f,_0x37fedb,_0x2ed729){return db[_0x4ba3('0x61')][_0x4ba3('0x48')]({'where':{'id':_0x5dce8f[_0x4ba3('0x4b')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x37fedb,null))[_0x4ba3('0x26')](function(_0x329874){var _0x360127;if(_0x329874){_0x360127=squel['insert']()[_0x4ba3('0x62')](_0x4ba3('0x63'))[_0x4ba3('0x64')]([_0x4ba3('0x65'),_0x4ba3('0x66'),_0x4ba3('0x67'),_0x4ba3('0x68'),_0x4ba3('0x69'),_0x4ba3('0x6a'),_0x4ba3('0x6b')],squel[_0x4ba3('0x6c')]()[_0x4ba3('0x6d')]('ANY_VALUE(calleridnum)',_0x4ba3('0x65'))[_0x4ba3('0x6d')]('NOW()',_0x4ba3('0x66'))[_0x4ba3('0x6d')]('ANY_VALUE(ContactId)','ContactId')[_0x4ba3('0x6d')](_0x4ba3('0x6e'),_0x4ba3('0x68'))[_0x4ba3('0x6d')](_0x4ba3('0x6f'),_0x4ba3('0x69'))[_0x4ba3('0x6d')](_0x4ba3('0x70'),'createdAt')[_0x4ba3('0x6d')]('NOW()',_0x4ba3('0x6b'))[_0x4ba3('0x71')](_0x4ba3('0x72'))[_0x4ba3('0x3d')](_0x4ba3('0x73'),_0x5dce8f[_0x4ba3('0x4b')]['id'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')]('state\x20=\x20?',_0x5dce8f[_0x4ba3('0x49')][_0x4ba3('0x75')][_0x4ba3('0x74')]())['where'](_0x4ba3('0x76'))[_0x4ba3('0x3d')](_0x4ba3('0x77'),squel[_0x4ba3('0x6c')]()[_0x4ba3('0x6d')](_0x4ba3('0x65'))[_0x4ba3('0x71')]('cm_hopper')['where'](_0x4ba3('0x73'),_0x5dce8f['params']['id'][_0x4ba3('0x74')]()))[_0x4ba3('0x3d')](_0x4ba3('0x77'),squel[_0x4ba3('0x6c')]()['field']('calleridnum')[_0x4ba3('0x71')](_0x4ba3('0x72'))['where'](_0x4ba3('0x73'),_0x5dce8f[_0x4ba3('0x4b')]['id'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')](_0x4ba3('0x78')))[_0x4ba3('0x79')](_0x4ba3('0x67')))['toString']();return db[_0x4ba3('0x4d')][_0x4ba3('0x32')](_0x360127);}return[];})[_0x4ba3('0x26')](respondWithResult(_0x37fedb,null))['catch'](handleError(_0x37fedb,null));};exports[_0x4ba3('0x7a')]=function(_0x13dbc4,_0x4e334c,_0x39d1d3){return db[_0x4ba3('0x7b')]['find']({'where':{'id':_0x13dbc4['params']['id']}})['then'](handleEntityNotFound(_0x4e334c,null))['then'](function(_0x206e93){var _0x2d57a7;if(_0x206e93){_0x2d57a7=squel[_0x4ba3('0x7c')]()[_0x4ba3('0x62')](_0x4ba3('0x63'))[_0x4ba3('0x64')]([_0x4ba3('0x65'),'scheduledAt',_0x4ba3('0x67'),'ListId',_0x4ba3('0x7d'),'createdAt',_0x4ba3('0x6b')],squel[_0x4ba3('0x6c')]()[_0x4ba3('0x6d')](_0x4ba3('0x7e'),_0x4ba3('0x65'))['field']('NOW()',_0x4ba3('0x66'))[_0x4ba3('0x6d')](_0x4ba3('0x7f'),_0x4ba3('0x67'))[_0x4ba3('0x6d')](_0x4ba3('0x6e'),_0x4ba3('0x68'))[_0x4ba3('0x6d')](_0x4ba3('0x80'),_0x4ba3('0x7d'))[_0x4ba3('0x6d')](_0x4ba3('0x70'),'createdAt')[_0x4ba3('0x6d')]('NOW()',_0x4ba3('0x6b'))[_0x4ba3('0x71')](_0x4ba3('0x72'))[_0x4ba3('0x3d')]('CampaignId\x20=\x20?',_0x13dbc4[_0x4ba3('0x4b')]['id'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')](_0x4ba3('0x81'),_0x13dbc4['body']['state'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')](_0x4ba3('0x76'))['where'](_0x4ba3('0x77'),squel[_0x4ba3('0x6c')]()[_0x4ba3('0x6d')](_0x4ba3('0x65'))[_0x4ba3('0x71')](_0x4ba3('0x63'))['where'](_0x4ba3('0x82'),_0x13dbc4['params']['id'][_0x4ba3('0x74')]()))[_0x4ba3('0x3d')](_0x4ba3('0x77'),squel[_0x4ba3('0x6c')]()['field'](_0x4ba3('0x83'))[_0x4ba3('0x71')]('cm_hopper_final')[_0x4ba3('0x3d')]('CampaignId\x20=\x20?',_0x13dbc4[_0x4ba3('0x4b')]['id'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')](_0x4ba3('0x78')))[_0x4ba3('0x79')]('ContactId'))['toString']();return db[_0x4ba3('0x4d')][_0x4ba3('0x32')](_0x2d57a7);}return[];})[_0x4ba3('0x26')](respondWithResult(_0x4e334c,null))['catch'](handleError(_0x4e334c,null));};exports[_0x4ba3('0x84')]=function(_0x38a7a8,_0x5553eb,_0x402ab1){return db[_0x4ba3('0x85')][_0x4ba3('0x86')]({'where':{'VoiceQueueId':_0x38a7a8[_0x4ba3('0x49')][_0x4ba3('0x69')],'CampaignId':_0x38a7a8[_0x4ba3('0x49')][_0x4ba3('0x7d')],'ContactId':_0x38a7a8[_0x4ba3('0x49')]['ContactId']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5553eb,null))[_0x4ba3('0x26')](function(_0xfb16a6){if(_0xfb16a6){return _0xfb16a6;}return null;})[_0x4ba3('0x26')](respondWithResult(_0x5553eb,null))[_0x4ba3('0x46')](handleError(_0x5553eb,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 9995533..fbc29ad 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 _0xaf4a=['util','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','calleridnum','uniqueid','lodash'];(function(_0xdf12f,_0x24b65b){var _0x3cc48d=function(_0x3ef029){while(--_0x3ef029){_0xdf12f['push'](_0xdf12f['shift']());}};_0x3cc48d(++_0x24b65b);}(_0xaf4a,0xa8));var _0xaaf4=function(_0x485034,_0x43f507){_0x485034=_0x485034-0x0;var _0x34e386=_0xaf4a[_0x485034];return _0x34e386;};'use strict';var _=require(_0xaaf4('0x0'));var util=require(_0xaaf4('0x1'));var logger=require('../../config/logger')(_0xaaf4('0x2'));var moment=require(_0xaaf4('0x3'));var BPromise=require(_0xaaf4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaaf4('0x5'));var rimraf=require(_0xaaf4('0x6'));var config=require(_0xaaf4('0x7'));var attributes=require(_0xaaf4('0x8'));module[_0xaaf4('0x9')]=function(_0x3db1b6,_0x1e6d7b){return _0x3db1b6['define'](_0xaaf4('0xa'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0xaaf4('0xb'),'fields':['calleridnum']},{'name':_0xaaf4('0xc'),'fields':[_0xaaf4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc033=['calleridnum','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal'];(function(_0x545b71,_0x4f44eb){var _0x26e587=function(_0x293b81){while(--_0x293b81){_0x545b71['push'](_0x545b71['shift']());}};_0x26e587(++_0x4f44eb);}(_0xc033,0x144));var _0x3c03=function(_0x4acfd2,_0x5b9374){_0x4acfd2=_0x4acfd2-0x0;var _0x12afbe=_0xc033[_0x4acfd2];return _0x12afbe;};'use strict';var _=require(_0x3c03('0x0'));var util=require('util');var logger=require(_0x3c03('0x1'))(_0x3c03('0x2'));var moment=require('moment');var BPromise=require(_0x3c03('0x3'));var rp=require(_0x3c03('0x4'));var fs=require('fs');var path=require(_0x3c03('0x5'));var rimraf=require(_0x3c03('0x6'));var config=require(_0x3c03('0x7'));var attributes=require(_0x3c03('0x8'));module[_0x3c03('0x9')]=function(_0x5680fa,_0x116932){return _0x5680fa[_0x3c03('0xa')](_0x3c03('0xb'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x3c03('0xc'),'fields':[_0x3c03('0xc')]},{'name':_0x3c03('0xd'),'fields':[_0x3c03('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 793a5e3..2e55e48 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x56e054,_0x470706){var _0x239882=function(_0xfc0eff){while(--_0xfc0eff){_0x56e054['push'](_0x56e054['shift']());}};_0x239882(++_0x470706);}(_0x7a54,0x106));var _0x47a5=function(_0x5a91f5,_0x223903){_0x5a91f5=_0x5a91f5-0x0;var _0x559ad3=_0x7a54[_0x5a91f5];return _0x559ad3;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3041d0,_0x255b24){var _0xccd584=function(_0x51b109){while(--_0x51b109){_0x3041d0['push'](_0x3041d0['shift']());}};_0xccd584(++_0x255b24);}(_0x7a54,0x106));var _0x47a5=function(_0x19b876,_0x39b214){_0x19b876=_0x19b876-0x0;var _0x2601eb=_0x7a54[_0x19b876];return _0x2601eb;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index d067b33..583990e 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 _0x19a3=['moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id'];(function(_0x2e81a2,_0x4477fc){var _0x27b108=function(_0xcee602){while(--_0xcee602){_0x2e81a2['push'](_0x2e81a2['shift']());}};_0x27b108(++_0x4477fc);}(_0x19a3,0x1d9));var _0x319a=function(_0x157eb6,_0x39d9c0){_0x157eb6=_0x157eb6-0x0;var _0x5da78c=_0x19a3[_0x157eb6];return _0x5da78c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x319a('0x0'));var timeout=require(_0x319a('0x1'));var express=require(_0x319a('0x2'));var router=express[_0x319a('0x3')]();var fs_extra=require(_0x319a('0x4'));var auth=require(_0x319a('0x5'));var interaction=require(_0x319a('0x6'));var config=require(_0x319a('0x7'));var controller=require(_0x319a('0x8'));router[_0x319a('0x9')]('/',auth[_0x319a('0xa')](),controller['index']);router[_0x319a('0x9')]('/describe',auth[_0x319a('0xa')](),controller[_0x319a('0xb')]);router[_0x319a('0x9')](_0x319a('0xc'),auth[_0x319a('0xa')](),controller[_0x319a('0xd')]);router[_0x319a('0x9')](_0x319a('0xe'),auth[_0x319a('0xa')](),controller[_0x319a('0xf')]);router[_0x319a('0x9')](_0x319a('0x10'),auth[_0x319a('0xa')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x319a('0x11')](_0x319a('0x12'),auth[_0x319a('0xa')](),controller[_0x319a('0x13')]);router[_0x319a('0x11')](_0x319a('0x14'),auth[_0x319a('0xa')](),controller[_0x319a('0x15')]);router[_0x319a('0x11')](_0x319a('0x16'),auth[_0x319a('0xa')](),controller[_0x319a('0x17')]);router['put']('/:id',auth[_0x319a('0xa')](),controller[_0x319a('0x18')]);module[_0x319a('0x19')]=router; \ No newline at end of file +var _0x908d=['index','/describe','describe','/:id','show','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0xfcd69d,_0x2101cf){var _0x233b2b=function(_0x2d4f94){while(--_0x2d4f94){_0xfcd69d['push'](_0xfcd69d['shift']());}};_0x233b2b(++_0x2101cf);}(_0x908d,0x176));var _0xd908=function(_0x219951,_0x1298e9){_0x219951=_0x219951-0x0;var _0x45ed82=_0x908d[_0x219951];return _0x45ed82;};'use strict';var multer=require(_0xd908('0x0'));var util=require('util');var path=require(_0xd908('0x1'));var timeout=require(_0xd908('0x2'));var express=require('express');var router=express[_0xd908('0x3')]();var fs_extra=require(_0xd908('0x4'));var auth=require(_0xd908('0x5'));var interaction=require(_0xd908('0x6'));var config=require(_0xd908('0x7'));var controller=require('./cmHopperFinal.controller');router[_0xd908('0x8')]('/',auth[_0xd908('0x9')](),controller[_0xd908('0xa')]);router['get'](_0xd908('0xb'),auth['isAuthenticated'](),controller[_0xd908('0xc')]);router[_0xd908('0x8')](_0xd908('0xd'),auth[_0xd908('0x9')](),controller[_0xd908('0xe')]);router[_0xd908('0x8')]('/voice/queue/countAttributes/:id',auth[_0xd908('0x9')](),controller['countContactsQueueCampaignHopperFinal']);router[_0xd908('0x8')](_0xd908('0xf'),auth[_0xd908('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xd908('0x10')](_0xd908('0x11'),auth[_0xd908('0x9')](),controller[_0xd908('0x12')]);router[_0xd908('0x10')](_0xd908('0x13'),auth[_0xd908('0x9')](),controller[_0xd908('0x14')]);router[_0xd908('0x10')](_0xd908('0x15'),auth[_0xd908('0x9')](),controller[_0xd908('0x16')]);router['put'](_0xd908('0xd'),auth[_0xd908('0x9')](),controller['update']);module[_0xd908('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 536a6c5..50858f5 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 _0xf3d4=['INTEGER','STRING','BOOLEAN','sequelize','DATE'];(function(_0x376c30,_0x33c590){var _0xed9cc9=function(_0xed736b){while(--_0xed736b){_0x376c30['push'](_0x376c30['shift']());}};_0xed9cc9(++_0x33c590);}(_0xf3d4,0x71));var _0x4f3d=function(_0x5a025c,_0xe6c163){_0x5a025c=_0x5a025c-0x0;var _0x5e99d5=_0xf3d4[_0x5a025c];return _0x5e99d5;};'use strict';var Sequelize=require(_0x4f3d('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x4f3d('0x1')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x4f3d('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x4f3d('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x4f3d('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x4f3d('0x1')]},'droptime':{'type':Sequelize[_0x4f3d('0x1')]},'endtime':{'type':Sequelize[_0x4f3d('0x1')]},'ringtime':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x4f3d('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x4f3d('0x3')]},'membername':{'type':Sequelize[_0x4f3d('0x3')]},'reason':{'type':Sequelize[_0x4f3d('0x3')]},'amd':{'type':Sequelize[_0x4f3d('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x4f3d('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4f3d('0x1')]},'recallme':{'type':Sequelize[_0x4f3d('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x4f3d('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4f3d('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x4f3d('0x3')]}}; \ No newline at end of file +var _0xd0e0=['BOOLEAN','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x5538d5,_0x190032){var _0x323b1a=function(_0x179caa){while(--_0x179caa){_0x5538d5['push'](_0x5538d5['shift']());}};_0x323b1a(++_0x190032);}(_0xd0e0,0x103));var _0x0d0e=function(_0x27bb17,_0x50e2e7){_0x27bb17=_0x27bb17-0x0;var _0x41d606=_0xd0e0[_0x27bb17];return _0x41d606;};'use strict';var Sequelize=require(_0x0d0e('0x0'));module[_0x0d0e('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x0d0e('0x2')]},'scheduledat':{'type':Sequelize[_0x0d0e('0x3')]},'countbusyretry':{'type':Sequelize[_0x0d0e('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0d0e('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0d0e('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x0d0e('0x2')]},'originatecalleridname':{'type':Sequelize[_0x0d0e('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x0d0e('0x2')]},'starttime':{'type':Sequelize[_0x0d0e('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x0d0e('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x0d0e('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x0d0e('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0d0e('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0d0e('0x2')]},'campaign':{'type':Sequelize[_0x0d0e('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x0d0e('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x0d0e('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x0d0e('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0d0e('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0d0e('0x3')]},'recallme':{'type':Sequelize[_0x0d0e('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x0d0e('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0d0e('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0d0e('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x0d0e('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index f9b5cf2..40732fc 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 _0x8cba=['destroy','sendStatus','error','name','send','index','map','CmHopperHistory','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','includeAll','findAll','then','rows','catch','show','include','options','find','create','body','describe','uniqueid','eml-format','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','update'];(function(_0x137a02,_0x3b9f1f){var _0x22b253=function(_0x3e2547){while(--_0x3e2547){_0x137a02['push'](_0x137a02['shift']());}};_0x22b253(++_0x3b9f1f);}(_0x8cba,0x72));var _0xa8cb=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0x8cba[_0x4ca333];return _0x13b2e1;};'use strict';var emlformat=require(_0xa8cb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa8cb('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa8cb('0x2'));var Mustache=require(_0xa8cb('0x3'));var util=require('util');var path=require(_0xa8cb('0x4'));var sox=require(_0xa8cb('0x5'));var csv=require(_0xa8cb('0x6'));var ejs=require(_0xa8cb('0x7'));var fs=require('fs');var fs_extra=require(_0xa8cb('0x8'));var _=require(_0xa8cb('0x9'));var squel=require(_0xa8cb('0xa'));var crypto=require(_0xa8cb('0xb'));var jsforce=require(_0xa8cb('0xc'));var deskjs=require(_0xa8cb('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa8cb('0xe'));var Papa=require('papaparse');var Redis=require(_0xa8cb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa8cb('0x10'));var as=require(_0xa8cb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa8cb('0x12'))(_0xa8cb('0x13'));var utils=require(_0xa8cb('0x14'));var config=require(_0xa8cb('0x15'));var licenseUtil=require(_0xa8cb('0x16'));var db=require(_0xa8cb('0x17'))['db'];function respondWithStatusCode(_0x354f2d,_0xef2680){_0xef2680=_0xef2680||0xcc;return function(_0x4694ab){if(_0x4694ab){return _0x354f2d['sendStatus'](_0xef2680);}return _0x354f2d[_0xa8cb('0x18')](_0xef2680)[_0xa8cb('0x19')]();};}function respondWithResult(_0x562b75,_0x565b81){_0x565b81=_0x565b81||0xc8;return function(_0x8db7e){if(_0x8db7e){return _0x562b75[_0xa8cb('0x18')](_0x565b81)[_0xa8cb('0x1a')](_0x8db7e);}};}function respondWithFilteredResult(_0x347a7f,_0x1279a6){return function(_0x184db8){if(_0x184db8){var _0x4b35b2=typeof _0x1279a6[_0xa8cb('0x1b')]===_0xa8cb('0x1c')&&typeof _0x1279a6[_0xa8cb('0x1d')]===_0xa8cb('0x1c');var _0x59634a=_0x184db8[_0xa8cb('0x1e')];var _0x200498=_0x4b35b2?0x0:_0x1279a6[_0xa8cb('0x1b')];var _0x47b5e4=_0x4b35b2?_0x184db8[_0xa8cb('0x1e')]:_0x1279a6['offset']+_0x1279a6[_0xa8cb('0x1d')];var _0x4d4453;if(_0x47b5e4>=_0x59634a){_0x47b5e4=_0x59634a;_0x4d4453=0xc8;}else{_0x4d4453=0xce;}_0x347a7f[_0xa8cb('0x18')](_0x4d4453);return _0x347a7f[_0xa8cb('0x1f')]('Content-Range',_0x200498+'-'+_0x47b5e4+'/'+_0x59634a)['json'](_0x184db8);}return null;};}function patchUpdates(_0x9f7426){return function(_0x7ffb79){try{jsonpatch['apply'](_0x7ffb79,_0x9f7426,!![]);}catch(_0x30ae7e){return BPromise[_0xa8cb('0x20')](_0x30ae7e);}return _0x7ffb79['save']();};}function saveUpdates(_0x544958,_0x5e2cc5){return function(_0x54b920){if(_0x54b920){return _0x54b920[_0xa8cb('0x21')](_0x544958)['then'](function(_0x152e53){return _0x152e53;});}return null;};}function removeEntity(_0x35a2df,_0x3aacda){return function(_0x481dab){if(_0x481dab){return _0x481dab[_0xa8cb('0x22')]()['then'](function(){_0x35a2df['status'](0xcc)[_0xa8cb('0x19')]();});}};}function handleEntityNotFound(_0x10526c,_0x1f4068){return function(_0x42ae22){if(!_0x42ae22){_0x10526c[_0xa8cb('0x23')](0x194);}return _0x42ae22;};}function handleError(_0xd0ce44,_0x1ca707){_0x1ca707=_0x1ca707||0x1f4;return function(_0x10463a){logger[_0xa8cb('0x24')](_0x10463a['stack']);if(_0x10463a[_0xa8cb('0x25')]){delete _0x10463a[_0xa8cb('0x25')];}_0xd0ce44[_0xa8cb('0x18')](_0x1ca707)[_0xa8cb('0x26')](_0x10463a);};}exports[_0xa8cb('0x27')]=function(_0xd0ee4c,_0xf92a20){var _0xa46343={},_0x16e906={},_0x2c07fd={'count':0x0,'rows':[]};var _0x35c904=_[_0xa8cb('0x28')](db[_0xa8cb('0x29')][_0xa8cb('0x2a')],function(_0x2b2460){return{'name':_0x2b2460['fieldName'],'type':_0x2b2460['type'][_0xa8cb('0x2b')]};});_0x16e906[_0xa8cb('0x2c')]=_[_0xa8cb('0x28')](_0x35c904,_0xa8cb('0x25'));_0x16e906[_0xa8cb('0x2d')]=_[_0xa8cb('0x2e')](_0xd0ee4c[_0xa8cb('0x2d')]);_0x16e906[_0xa8cb('0x2f')]=_[_0xa8cb('0x30')](_0x16e906[_0xa8cb('0x2c')],_0x16e906[_0xa8cb('0x2d')]);_0xa46343['attributes']=_[_0xa8cb('0x30')](_0x16e906[_0xa8cb('0x2c')],qs['fields'](_0xd0ee4c[_0xa8cb('0x2d')][_0xa8cb('0x31')]));_0xa46343[_0xa8cb('0x32')]=_0xa46343[_0xa8cb('0x32')][_0xa8cb('0x33')]?_0xa46343[_0xa8cb('0x32')]:_0x16e906[_0xa8cb('0x2c')];if(!_0xd0ee4c[_0xa8cb('0x2d')][_0xa8cb('0x34')](_0xa8cb('0x35'))){_0xa46343[_0xa8cb('0x1d')]=qs[_0xa8cb('0x1d')](_0xd0ee4c[_0xa8cb('0x2d')][_0xa8cb('0x1d')]);_0xa46343[_0xa8cb('0x1b')]=qs['offset'](_0xd0ee4c[_0xa8cb('0x2d')][_0xa8cb('0x1b')]);}_0xa46343[_0xa8cb('0x36')]=qs[_0xa8cb('0x37')](_0xd0ee4c[_0xa8cb('0x2d')][_0xa8cb('0x37')]);_0xa46343['where']=qs[_0xa8cb('0x2f')](_['pick'](_0xd0ee4c[_0xa8cb('0x2d')],_0x16e906[_0xa8cb('0x2f')]),_0x35c904);if(_0xd0ee4c[_0xa8cb('0x2d')][_0xa8cb('0x38')]){_0xa46343[_0xa8cb('0x39')]=_[_0xa8cb('0x3a')](_0xa46343[_0xa8cb('0x39')],{'$or':_[_0xa8cb('0x28')](_0x35c904,function(_0x1c316e){if(_0x1c316e[_0xa8cb('0x3b')]!==_0xa8cb('0x3c')){var _0x440254={};_0x440254[_0x1c316e['name']]={'$like':'%'+_0xd0ee4c['query'][_0xa8cb('0x38')]+'%'};return _0x440254;}})});}_0xa46343=_['merge']({},_0xa46343,_0xd0ee4c['options']);var _0x1213c2={'where':_0xa46343[_0xa8cb('0x39')]};return db[_0xa8cb('0x29')][_0xa8cb('0x1e')](_0x1213c2)['then'](function(_0x1477da){_0x2c07fd['count']=_0x1477da;if(_0xd0ee4c['query'][_0xa8cb('0x3d')]){_0xa46343['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0xa8cb('0x3e')](_0xa46343);})[_0xa8cb('0x3f')](function(_0x22762d){_0x2c07fd[_0xa8cb('0x40')]=_0x22762d;return _0x2c07fd;})[_0xa8cb('0x3f')](respondWithFilteredResult(_0xf92a20,_0xa46343))[_0xa8cb('0x41')](handleError(_0xf92a20,null));};exports[_0xa8cb('0x42')]=function(_0x2efcfe,_0x38d598){var _0x2f7779={'raw':!![],'where':{'id':_0x2efcfe['params']['id']}},_0x1bf852={};_0x1bf852[_0xa8cb('0x2c')]=_['keys'](db[_0xa8cb('0x29')][_0xa8cb('0x2a')]);_0x1bf852[_0xa8cb('0x2d')]=_['keys'](_0x2efcfe[_0xa8cb('0x2d')]);_0x1bf852[_0xa8cb('0x2f')]=_[_0xa8cb('0x30')](_0x1bf852[_0xa8cb('0x2c')],_0x1bf852[_0xa8cb('0x2d')]);_0x2f7779[_0xa8cb('0x32')]=_['intersection'](_0x1bf852[_0xa8cb('0x2c')],qs[_0xa8cb('0x31')](_0x2efcfe[_0xa8cb('0x2d')]['fields']));_0x2f7779[_0xa8cb('0x32')]=_0x2f7779[_0xa8cb('0x32')][_0xa8cb('0x33')]?_0x2f7779[_0xa8cb('0x32')]:_0x1bf852['model'];if(_0x2efcfe[_0xa8cb('0x2d')][_0xa8cb('0x3d')]){_0x2f7779[_0xa8cb('0x43')]=[{'all':!![]}];}_0x2f7779=_[_0xa8cb('0x3a')]({},_0x2f7779,_0x2efcfe[_0xa8cb('0x44')]);return db[_0xa8cb('0x29')][_0xa8cb('0x45')](_0x2f7779)[_0xa8cb('0x3f')](handleEntityNotFound(_0x38d598,null))[_0xa8cb('0x3f')](respondWithResult(_0x38d598,null))[_0xa8cb('0x41')](handleError(_0x38d598,null));};exports[_0xa8cb('0x46')]=function(_0x16243c,_0x30f5af){return db['CmHopperHistory'][_0xa8cb('0x46')](_0x16243c[_0xa8cb('0x47')],{})[_0xa8cb('0x3f')](respondWithResult(_0x30f5af,0xc9))[_0xa8cb('0x41')](handleError(_0x30f5af,null));};exports['describe']=function(_0x12e1c8,_0x4f83b0){return db[_0xa8cb('0x29')][_0xa8cb('0x48')]()[_0xa8cb('0x3f')](respondWithResult(_0x4f83b0,null))['catch'](handleError(_0x4f83b0,null));};exports[_0xa8cb('0x21')]=function(_0x5786c8,_0x337764){if(_0x5786c8[_0xa8cb('0x47')]['uniqueid']){delete _0x5786c8['body'][_0xa8cb('0x49')];}return db[_0xa8cb('0x29')][_0xa8cb('0x45')]({'where':{'uniqueid':_0x5786c8['params']['id']}})[_0xa8cb('0x3f')](handleEntityNotFound(_0x337764,null))[_0xa8cb('0x3f')](saveUpdates(_0x5786c8['body'],null))[_0xa8cb('0x3f')](respondWithResult(_0x337764,null))[_0xa8cb('0x41')](handleError(_0x337764,null));}; \ No newline at end of file +var _0xc0e9=['catch','show','params','intersection','length','create','body','describe','uniqueid','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','json','apply','reject','update','then','end','error','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','hasOwnProperty','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows'];(function(_0x56c4f8,_0x2d4f9d){var _0x58ba92=function(_0x2226ef){while(--_0x2226ef){_0x56c4f8['push'](_0x56c4f8['shift']());}};_0x58ba92(++_0x2d4f9d);}(_0xc0e9,0xe5));var _0x9c0e=function(_0x167a6a,_0x453afb){_0x167a6a=_0x167a6a-0x0;var _0x2333ad=_0xc0e9[_0x167a6a];return _0x2333ad;};'use strict';var emlformat=require(_0x9c0e('0x0'));var rimraf=require(_0x9c0e('0x1'));var zipdir=require(_0x9c0e('0x2'));var jsonpatch=require(_0x9c0e('0x3'));var rp=require(_0x9c0e('0x4'));var moment=require(_0x9c0e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9c0e('0x6'));var util=require(_0x9c0e('0x7'));var path=require(_0x9c0e('0x8'));var sox=require(_0x9c0e('0x9'));var csv=require(_0x9c0e('0xa'));var ejs=require(_0x9c0e('0xb'));var fs=require('fs');var fs_extra=require(_0x9c0e('0xc'));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('querystring');var Papa=require(_0x9c0e('0xd'));var Redis=require(_0x9c0e('0xe'));var authService=require(_0x9c0e('0xf'));var qs=require(_0x9c0e('0x10'));var as=require(_0x9c0e('0x11'));var hardwareService=require(_0x9c0e('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x9c0e('0x13'));var config=require(_0x9c0e('0x14'));var licenseUtil=require(_0x9c0e('0x15'));var db=require(_0x9c0e('0x16'))['db'];function respondWithStatusCode(_0xdbf374,_0x1893c6){_0x1893c6=_0x1893c6||0xcc;return function(_0x5a674e){if(_0x5a674e){return _0xdbf374[_0x9c0e('0x17')](_0x1893c6);}return _0xdbf374[_0x9c0e('0x18')](_0x1893c6)['end']();};}function respondWithResult(_0x19dcd2,_0x252a10){_0x252a10=_0x252a10||0xc8;return function(_0x5dc3de){if(_0x5dc3de){return _0x19dcd2[_0x9c0e('0x18')](_0x252a10)['json'](_0x5dc3de);}};}function respondWithFilteredResult(_0x12779b,_0x3a6de1){return function(_0x579ae0){if(_0x579ae0){var _0x1b6611=typeof _0x3a6de1['offset']===_0x9c0e('0x19')&&typeof _0x3a6de1[_0x9c0e('0x1a')]===_0x9c0e('0x19');var _0xf28112=_0x579ae0[_0x9c0e('0x1b')];var _0x5ccc66=_0x1b6611?0x0:_0x3a6de1[_0x9c0e('0x1c')];var _0x1914e8=_0x1b6611?_0x579ae0['count']:_0x3a6de1[_0x9c0e('0x1c')]+_0x3a6de1['limit'];var _0x554895;if(_0x1914e8>=_0xf28112){_0x1914e8=_0xf28112;_0x554895=0xc8;}else{_0x554895=0xce;}_0x12779b['status'](_0x554895);return _0x12779b[_0x9c0e('0x1d')]('Content-Range',_0x5ccc66+'-'+_0x1914e8+'/'+_0xf28112)[_0x9c0e('0x1e')](_0x579ae0);}return null;};}function patchUpdates(_0x416950){return function(_0x1b32eb){try{jsonpatch[_0x9c0e('0x1f')](_0x1b32eb,_0x416950,!![]);}catch(_0x435d78){return BPromise[_0x9c0e('0x20')](_0x435d78);}return _0x1b32eb['save']();};}function saveUpdates(_0x26d378,_0x5211af){return function(_0x32dc3f){if(_0x32dc3f){return _0x32dc3f[_0x9c0e('0x21')](_0x26d378)[_0x9c0e('0x22')](function(_0x577f80){return _0x577f80;});}return null;};}function removeEntity(_0x54b14b,_0x1b3e74){return function(_0x4f3229){if(_0x4f3229){return _0x4f3229['destroy']()['then'](function(){_0x54b14b['status'](0xcc)[_0x9c0e('0x23')]();});}};}function handleEntityNotFound(_0x5f0707,_0x4b62b5){return function(_0x598afa){if(!_0x598afa){_0x5f0707[_0x9c0e('0x17')](0x194);}return _0x598afa;};}function handleError(_0x25ac5f,_0x3d5278){_0x3d5278=_0x3d5278||0x1f4;return function(_0x255b7e){logger[_0x9c0e('0x24')](_0x255b7e[_0x9c0e('0x25')]);if(_0x255b7e[_0x9c0e('0x26')]){delete _0x255b7e[_0x9c0e('0x26')];}_0x25ac5f[_0x9c0e('0x18')](_0x3d5278)['send'](_0x255b7e);};}exports[_0x9c0e('0x27')]=function(_0x5af60e,_0x1e6dde){var _0xcfad93={},_0x589db1={},_0x1933b3={'count':0x0,'rows':[]};var _0x1f6997=_[_0x9c0e('0x28')](db[_0x9c0e('0x29')][_0x9c0e('0x2a')],function(_0x5d0cbc){return{'name':_0x5d0cbc[_0x9c0e('0x2b')],'type':_0x5d0cbc[_0x9c0e('0x2c')][_0x9c0e('0x2d')]};});_0x589db1['model']=_[_0x9c0e('0x28')](_0x1f6997,_0x9c0e('0x26'));_0x589db1[_0x9c0e('0x2e')]=_[_0x9c0e('0x2f')](_0x5af60e[_0x9c0e('0x2e')]);_0x589db1[_0x9c0e('0x30')]=_['intersection'](_0x589db1[_0x9c0e('0x31')],_0x589db1[_0x9c0e('0x2e')]);_0xcfad93['attributes']=_['intersection'](_0x589db1['model'],qs['fields'](_0x5af60e[_0x9c0e('0x2e')][_0x9c0e('0x32')]));_0xcfad93[_0x9c0e('0x33')]=_0xcfad93['attributes']['length']?_0xcfad93[_0x9c0e('0x33')]:_0x589db1[_0x9c0e('0x31')];if(!_0x5af60e[_0x9c0e('0x2e')][_0x9c0e('0x34')]('nolimit')){_0xcfad93['limit']=qs['limit'](_0x5af60e[_0x9c0e('0x2e')][_0x9c0e('0x1a')]);_0xcfad93['offset']=qs[_0x9c0e('0x1c')](_0x5af60e['query']['offset']);}_0xcfad93['order']=qs[_0x9c0e('0x35')](_0x5af60e[_0x9c0e('0x2e')][_0x9c0e('0x35')]);_0xcfad93['where']=qs[_0x9c0e('0x30')](_[_0x9c0e('0x36')](_0x5af60e[_0x9c0e('0x2e')],_0x589db1[_0x9c0e('0x30')]),_0x1f6997);if(_0x5af60e[_0x9c0e('0x2e')]['filter']){_0xcfad93[_0x9c0e('0x37')]=_[_0x9c0e('0x38')](_0xcfad93['where'],{'$or':_[_0x9c0e('0x28')](_0x1f6997,function(_0x54d4b2){if(_0x54d4b2[_0x9c0e('0x2c')]!==_0x9c0e('0x39')){var _0x26a9a7={};_0x26a9a7[_0x54d4b2['name']]={'$like':'%'+_0x5af60e[_0x9c0e('0x2e')][_0x9c0e('0x3a')]+'%'};return _0x26a9a7;}})});}_0xcfad93=_[_0x9c0e('0x38')]({},_0xcfad93,_0x5af60e[_0x9c0e('0x3b')]);var _0x4b4c7c={'where':_0xcfad93[_0x9c0e('0x37')]};return db[_0x9c0e('0x29')]['count'](_0x4b4c7c)[_0x9c0e('0x22')](function(_0x1ee530){_0x1933b3[_0x9c0e('0x1b')]=_0x1ee530;if(_0x5af60e['query'][_0x9c0e('0x3c')]){_0xcfad93[_0x9c0e('0x3d')]=[{'all':!![]}];}return db[_0x9c0e('0x29')]['findAll'](_0xcfad93);})['then'](function(_0x45dcf5){_0x1933b3[_0x9c0e('0x3e')]=_0x45dcf5;return _0x1933b3;})['then'](respondWithFilteredResult(_0x1e6dde,_0xcfad93))[_0x9c0e('0x3f')](handleError(_0x1e6dde,null));};exports[_0x9c0e('0x40')]=function(_0x39df6c,_0x40f6c5){var _0x2d876e={'raw':!![],'where':{'id':_0x39df6c[_0x9c0e('0x41')]['id']}},_0x1816d9={};_0x1816d9[_0x9c0e('0x31')]=_[_0x9c0e('0x2f')](db['CmHopperHistory'][_0x9c0e('0x2a')]);_0x1816d9[_0x9c0e('0x2e')]=_[_0x9c0e('0x2f')](_0x39df6c[_0x9c0e('0x2e')]);_0x1816d9[_0x9c0e('0x30')]=_[_0x9c0e('0x42')](_0x1816d9[_0x9c0e('0x31')],_0x1816d9['query']);_0x2d876e['attributes']=_[_0x9c0e('0x42')](_0x1816d9['model'],qs[_0x9c0e('0x32')](_0x39df6c['query'][_0x9c0e('0x32')]));_0x2d876e[_0x9c0e('0x33')]=_0x2d876e['attributes'][_0x9c0e('0x43')]?_0x2d876e[_0x9c0e('0x33')]:_0x1816d9[_0x9c0e('0x31')];if(_0x39df6c[_0x9c0e('0x2e')][_0x9c0e('0x3c')]){_0x2d876e['include']=[{'all':!![]}];}_0x2d876e=_[_0x9c0e('0x38')]({},_0x2d876e,_0x39df6c['options']);return db[_0x9c0e('0x29')]['find'](_0x2d876e)[_0x9c0e('0x22')](handleEntityNotFound(_0x40f6c5,null))['then'](respondWithResult(_0x40f6c5,null))['catch'](handleError(_0x40f6c5,null));};exports[_0x9c0e('0x44')]=function(_0xb0a4b7,_0x81a368){return db[_0x9c0e('0x29')]['create'](_0xb0a4b7[_0x9c0e('0x45')],{})[_0x9c0e('0x22')](respondWithResult(_0x81a368,0xc9))[_0x9c0e('0x3f')](handleError(_0x81a368,null));};exports['describe']=function(_0xee4b26,_0x59ca3c){return db[_0x9c0e('0x29')][_0x9c0e('0x46')]()[_0x9c0e('0x22')](respondWithResult(_0x59ca3c,null))[_0x9c0e('0x3f')](handleError(_0x59ca3c,null));};exports[_0x9c0e('0x21')]=function(_0x5824f6,_0x1a87e1){if(_0x5824f6[_0x9c0e('0x45')][_0x9c0e('0x47')]){delete _0x5824f6[_0x9c0e('0x45')][_0x9c0e('0x47')];}return db['CmHopperHistory'][_0x9c0e('0x48')]({'where':{'uniqueid':_0x5824f6[_0x9c0e('0x41')]['id']}})[_0x9c0e('0x22')](handleEntityNotFound(_0x1a87e1,null))[_0x9c0e('0x22')](saveUpdates(_0x5824f6[_0x9c0e('0x45')],null))[_0x9c0e('0x22')](respondWithResult(_0x1a87e1,null))['catch'](handleError(_0x1a87e1,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 9aa892f..0ab89d2 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 _0xd052=['define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','../../config/logger','moment','path','../../config/environment','./cmHopperHistory.attributes'];(function(_0x3713c7,_0x40df49){var _0x3576fe=function(_0x263dab){while(--_0x263dab){_0x3713c7['push'](_0x3713c7['shift']());}};_0x3576fe(++_0x40df49);}(_0xd052,0x69));var _0x2d05=function(_0x3fa37f,_0x397f16){_0x3fa37f=_0x3fa37f-0x0;var _0x5a01d5=_0xd052[_0x3fa37f];return _0x5a01d5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2d05('0x0'))('api');var moment=require(_0x2d05('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d05('0x2'));var rimraf=require('rimraf');var config=require(_0x2d05('0x3'));var attributes=require(_0x2d05('0x4'));module['exports']=function(_0x380979,_0x15de1f){return _0x380979[_0x2d05('0x5')](_0x2d05('0x6'),attributes,{'tableName':_0x2d05('0x7'),'paranoid':![],'indexes':[{'name':_0x2d05('0x8'),'fields':[_0x2d05('0x8')]},{'name':_0x2d05('0x9'),'fields':[_0x2d05('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xca6e=['../../config/environment','exports','CmHopperHistory','endtime','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x1db833,_0x57842d){var _0x45e6fe=function(_0x2645d2){while(--_0x2645d2){_0x1db833['push'](_0x1db833['shift']());}};_0x45e6fe(++_0x57842d);}(_0xca6e,0x1c1));var _0xeca6=function(_0xa8edd0,_0x3c4a95){_0xa8edd0=_0xa8edd0-0x0;var _0x3cda62=_0xca6e[_0xa8edd0];return _0x3cda62;};'use strict';var _=require(_0xeca6('0x0'));var util=require(_0xeca6('0x1'));var logger=require(_0xeca6('0x2'))(_0xeca6('0x3'));var moment=require(_0xeca6('0x4'));var BPromise=require('bluebird');var rp=require(_0xeca6('0x5'));var fs=require('fs');var path=require(_0xeca6('0x6'));var rimraf=require('rimraf');var config=require(_0xeca6('0x7'));var attributes=require('./cmHopperHistory.attributes');module[_0xeca6('0x8')]=function(_0x1d7b16,_0x32cb8d){return _0x1d7b16['define'](_0xeca6('0x9'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xeca6('0xa'),'fields':[_0xeca6('0xa')]},{'name':_0xeca6('0xb'),'fields':[_0xeca6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index b54cfe7..4ec1621 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 _0x8782=['raw','CreateCmHopperHistory','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`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','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','name','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CmHopperHistory','body','options'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0x8782,0x17a));var _0x2878=function(_0x21f75e,_0x3ccd22){_0x21f75e=_0x21f75e-0x0;var _0x5f2c0f=_0x8782[_0x21f75e];return _0x5f2c0f;};'use strict';var _=require(_0x2878('0x0'));var util=require(_0x2878('0x1'));var moment=require(_0x2878('0x2'));var BPromise=require(_0x2878('0x3'));var rs=require(_0x2878('0x4'));var fs=require('fs');var Redis=require(_0x2878('0x5'));var db=require(_0x2878('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2878('0x7'))(_0x2878('0x8'));var config=require(_0x2878('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2878('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fe6d8,_0x428571,_0x2ea986){return new BPromise(function(_0x4ed075,_0x2deb60){return client['request'](_0x2fe6d8,_0x2ea986)[_0x2878('0xb')](function(_0x37cc2c){logger[_0x2878('0xc')](_0x2878('0xd'),_0x428571,_0x2878('0xe'));logger[_0x2878('0xf')](_0x2878('0x10'),_0x428571,_0x2878('0xe'),JSON[_0x2878('0x11')](_0x37cc2c));if(_0x37cc2c[_0x2878('0x12')]){if(_0x37cc2c[_0x2878('0x12')]['code']===0x1f4){logger[_0x2878('0x12')](_0x2878('0xd'),_0x428571,_0x37cc2c['error'][_0x2878('0x13')]);return _0x2deb60(_0x37cc2c[_0x2878('0x12')]['message']);}logger[_0x2878('0x12')](_0x2878('0xd'),_0x428571,_0x37cc2c[_0x2878('0x12')]['message']);return _0x4ed075(_0x37cc2c['error']['message']);}else{logger[_0x2878('0xc')](_0x2878('0xd'),_0x428571,_0x2878('0xe'));_0x4ed075(_0x37cc2c['result'][_0x2878('0x13')]);}})[_0x2878('0x14')](function(_0xab2c51){logger[_0x2878('0x12')](_0x2878('0xd'),_0x428571,_0xab2c51);_0x2deb60(_0xab2c51);});});}exports['CreateCmHopperHistory']=function(_0x5f234d){var _0x2bb9d4=this;return new Promise(function(_0x2b023d,_0x50d78b){return db[_0x2878('0x15')]['create'](_0x5f234d[_0x2878('0x16')],{'raw':_0x5f234d['options']?_0x5f234d[_0x2878('0x17')][_0x2878('0x18')]===undefined?!![]:![]:!![]})[_0x2878('0xb')](function(_0x4401f8){logger[_0x2878('0xc')](_0x2878('0x19'),_0x5f234d);logger[_0x2878('0xf')]('CreateCmHopperHistory',_0x5f234d,JSON[_0x2878('0x11')](_0x4401f8));_0x2b023d(_0x4401f8);})[_0x2878('0x14')](function(_0x23483e){logger[_0x2878('0x12')](_0x2878('0x19'),_0x23483e['message'],_0x5f234d);_0x50d78b(_0x2bb9d4[_0x2878('0x12')](0x1f4,_0x23483e[_0x2878('0x13')]));});});};exports[_0x2878('0x1a')]=function(_0x4ff488){var _0x230bbf=this;return new Promise(function(_0x2a676e,_0x2b1308){return db[_0x2878('0x15')][_0x2878('0x1b')]({'raw':_0x4ff488[_0x2878('0x17')]?_0x4ff488['options']['raw']===undefined?!![]:![]:!![],'where':_0x4ff488[_0x2878('0x17')]?_0x4ff488['options'][_0x2878('0x1c')]||null:null,'attributes':[[db[_0x2878('0x1d')]['fn'](_0x2878('0x1e'),db[_0x2878('0x1d')][_0x2878('0x1f')]('id')),_0x2878('0x20')],[db[_0x2878('0x1d')]['fn'](_0x2878('0x1e'),db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x2878('0x21')],[db[_0x2878('0x1d')]['fn'](_0x2878('0x1e'),db[_0x2878('0x1d')]['fn']('IF',db['sequelize'][_0x2878('0x22')](_0x2878('0x23')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x2878('0x1d')]['fn']('COUNT',db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')](_0x2878('0x24')))),_0x2878('0x25')],[db[_0x2878('0x1d')]['fn'](_0x2878('0x26'),db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')](_0x2878('0x27')))),_0x2878('0x28')],[db[_0x2878('0x1d')]['fn'](_0x2878('0x26'),db['sequelize']['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')](_0x2878('0x29')))),_0x2878('0x2a')]]})[_0x2878('0xb')](function(_0x2bcf55){logger[_0x2878('0xc')](_0x2878('0x1a'),_0x4ff488);logger[_0x2878('0xf')](_0x2878('0x1a'),_0x4ff488,JSON[_0x2878('0x11')](_0x2bcf55));_0x2a676e(_0x2bcf55);})[_0x2878('0x14')](function(_0xa5fd73){logger[_0x2878('0x12')](_0x2878('0x1a'),_0xa5fd73[_0x2878('0x13')],_0x4ff488);_0x2b1308(_0x230bbf[_0x2878('0x12')](0x1f4,_0xa5fd73[_0x2878('0x13')]));});});};exports[_0x2878('0x2b')]=function(_0x1abde4){var _0x3fa2cf=this;return new Promise(function(_0x26484e,_0x99d09d){return db[_0x2878('0x15')][_0x2878('0x1b')]({'raw':_0x1abde4['options']?_0x1abde4[_0x2878('0x17')][_0x2878('0x18')]===undefined?!![]:![]:!![],'where':_0x1abde4['options']?_0x1abde4[_0x2878('0x17')][_0x2878('0x1c')]||null:null,'attributes':[[_0x2878('0x2c'),'name'],[db[_0x2878('0x1d')]['fn']('COUNT',db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')](_0x2878('0x2d')))),'outboundNoSuchCallsDay'],[db[_0x2878('0x1d')]['fn'](_0x2878('0x1e'),db['sequelize']['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')](_0x2878('0x2e')))),'outboundNoAnswerCallsDay'],[db[_0x2878('0x1d')]['fn']('COUNT',db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')](_0x2878('0x2f')))),_0x2878('0x30')],[db[_0x2878('0x1d')]['fn'](_0x2878('0x1e'),db[_0x2878('0x1d')]['fn']('IF',db['sequelize'][_0x2878('0x22')](_0x2878('0x31')))),_0x2878('0x32')],[db['sequelize']['fn'](_0x2878('0x1e'),db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')]['literal']('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db[_0x2878('0x1d')]['fn'](_0x2878('0x1e'),db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')](_0x2878('0x33')))),_0x2878('0x34')],[db[_0x2878('0x1d')]['fn'](_0x2878('0x1e'),db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')](_0x2878('0x35')))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn']('COUNT',db[_0x2878('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x2878('0x36')))),_0x2878('0x37')],[db['sequelize']['fn'](_0x2878('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0x2878('0x22')](_0x2878('0x38')))),_0x2878('0x39')],[db[_0x2878('0x1d')]['fn'](_0x2878('0x1e'),db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')](_0x2878('0x3a')))),_0x2878('0x3b')],[db[_0x2878('0x1d')]['fn'](_0x2878('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0x2878('0x22')](_0x2878('0x3c')))),_0x2878('0x3d')],[db[_0x2878('0x1d')]['fn'](_0x2878('0x1e'),db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')]['literal'](_0x2878('0x3e')))),'outboundAnswerAgiCallsDay'],[db[_0x2878('0x1d')]['fn'](_0x2878('0x1e'),db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')]('`state`\x20=\x2020,\x201,\x20null'))),_0x2878('0x3d')],[db['sequelize']['fn'](_0x2878('0x1e'),db['sequelize']['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')](_0x2878('0x3f')))),'outboundReCallsDay']],'group':[_0x2878('0x2c')]})['then'](function(_0x2a29c0){logger[_0x2878('0xc')]('GetVoiceQueueHopperHistory',_0x1abde4);logger[_0x2878('0xf')](_0x2878('0x2b'),_0x1abde4,JSON[_0x2878('0x11')](_0x2a29c0));_0x26484e(_0x2a29c0);})[_0x2878('0x14')](function(_0x435a9f){logger[_0x2878('0x12')]('GetVoiceQueueHopperHistory',_0x435a9f['message'],_0x1abde4);_0x99d09d(_0x3fa2cf[_0x2878('0x12')](0x1f4,_0x435a9f[_0x2878('0x13')]));});});};exports[_0x2878('0x40')]=function(_0x4f2455){var _0x26c23d=this;return new Promise(function(_0x5e1e37,_0x582cd9){return db[_0x2878('0x15')][_0x2878('0x1b')]({'raw':_0x4f2455['options']?_0x4f2455['options'][_0x2878('0x18')]===undefined?!![]:![]:!![],'where':_0x4f2455[_0x2878('0x17')]?_0x4f2455[_0x2878('0x17')]['where']||null:null,'attributes':[[_0x2878('0x2c'),_0x2878('0x41')],[db[_0x2878('0x1d')]['fn']('COUNT',db[_0x2878('0x1d')][_0x2878('0x1f')]('id')),'ivrTotalCallsDays'],[db[_0x2878('0x1d')]['fn']('COUNT',db[_0x2878('0x1d')]['fn']('IF',db[_0x2878('0x1d')][_0x2878('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0x2878('0x42')]],'group':['campaign']})[_0x2878('0xb')](function(_0x3f6da6){logger[_0x2878('0xc')](_0x2878('0x40'),_0x4f2455);logger['debug'](_0x2878('0x40'),_0x4f2455,JSON[_0x2878('0x11')](_0x3f6da6));_0x5e1e37(_0x3f6da6);})['catch'](function(_0x188d2d){logger[_0x2878('0x12')]('GetCampaignHopperHistory',_0x188d2d[_0x2878('0x13')],_0x4f2455);_0x582cd9(_0x26c23d[_0x2878('0x12')](0x1f4,_0x188d2d[_0x2878('0x13')]));});});}; \ No newline at end of file +var _0x0427=['predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','CmHopperHistory,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','debug','AvgHandleTime','findAll','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0427,0x137));var _0x7042=function(_0x27e6b9,_0x499a12){_0x27e6b9=_0x27e6b9-0x0;var _0x409231=_0x0427[_0x27e6b9];return _0x409231;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7042('0x0'));var BPromise=require(_0x7042('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7042('0x2'));var db=require(_0x7042('0x3'))['db'];var utils=require(_0x7042('0x4'));var logger=require(_0x7042('0x5'))(_0x7042('0x6'));var config=require(_0x7042('0x7'));var jayson=require(_0x7042('0x8'));var client=jayson['client'][_0x7042('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f24b5,_0x25c552,_0x346aa8){return new BPromise(function(_0x295b19,_0x978169){return client[_0x7042('0xa')](_0x2f24b5,_0x346aa8)[_0x7042('0xb')](function(_0x3bd534){logger['info'](_0x7042('0xc'),_0x25c552,'request\x20sent');logger['debug']('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x25c552,'request\x20sent',JSON[_0x7042('0xd')](_0x3bd534));if(_0x3bd534['error']){if(_0x3bd534[_0x7042('0xe')][_0x7042('0xf')]===0x1f4){logger[_0x7042('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x25c552,_0x3bd534['error'][_0x7042('0x10')]);return _0x978169(_0x3bd534[_0x7042('0xe')][_0x7042('0x10')]);}logger[_0x7042('0xe')](_0x7042('0xc'),_0x25c552,_0x3bd534[_0x7042('0xe')]['message']);return _0x295b19(_0x3bd534[_0x7042('0xe')][_0x7042('0x10')]);}else{logger[_0x7042('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x25c552,_0x7042('0x12'));_0x295b19(_0x3bd534[_0x7042('0x13')]['message']);}})[_0x7042('0x14')](function(_0x590edd){logger['error'](_0x7042('0xc'),_0x25c552,_0x590edd);_0x978169(_0x590edd);});});}exports[_0x7042('0x15')]=function(_0x1e69aa){var _0x22d9a8=this;return new Promise(function(_0x6e18fb,_0x544c02){return db[_0x7042('0x16')][_0x7042('0x17')](_0x1e69aa[_0x7042('0x18')],{'raw':_0x1e69aa[_0x7042('0x19')]?_0x1e69aa[_0x7042('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x7042('0xb')](function(_0x580f84){logger[_0x7042('0x11')]('CreateCmHopperHistory',_0x1e69aa);logger[_0x7042('0x1a')](_0x7042('0x15'),_0x1e69aa,JSON[_0x7042('0xd')](_0x580f84));_0x6e18fb(_0x580f84);})[_0x7042('0x14')](function(_0x484c82){logger['error']('CreateCmHopperHistory',_0x484c82[_0x7042('0x10')],_0x1e69aa);_0x544c02(_0x22d9a8[_0x7042('0xe')](0x1f4,_0x484c82[_0x7042('0x10')]));});});};exports[_0x7042('0x1b')]=function(_0x48d529){var _0x12d618=this;return new Promise(function(_0x1d6afa,_0x4611f9){return db[_0x7042('0x16')][_0x7042('0x1c')]({'raw':_0x48d529['options']?_0x48d529[_0x7042('0x19')][_0x7042('0x1d')]===undefined?!![]:![]:!![],'where':_0x48d529[_0x7042('0x19')]?_0x48d529[_0x7042('0x19')][_0x7042('0x1e')]||null:null,'attributes':[[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')][_0x7042('0x21')]('id')),_0x7042('0x22')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db[_0x7042('0x1f')][_0x7042('0x23')](_0x7042('0x24')))),_0x7042('0x25')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x7042('0x23')](_0x7042('0x26')))),_0x7042('0x27')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db[_0x7042('0x1f')]['literal']('`state`\x20=\x2011,\x201,\x20null'))),_0x7042('0x28')],[db[_0x7042('0x1f')]['fn']('AVG',db[_0x7042('0x1f')]['fn']('IF',db[_0x7042('0x1f')]['literal'](_0x7042('0x29')))),_0x7042('0x2a')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x2b'),db[_0x7042('0x1f')]['fn']('IF',db['sequelize'][_0x7042('0x23')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})[_0x7042('0xb')](function(_0x530bf6){logger[_0x7042('0x11')](_0x7042('0x1b'),_0x48d529);logger['debug'](_0x7042('0x1b'),_0x48d529,JSON['stringify'](_0x530bf6));_0x1d6afa(_0x530bf6);})[_0x7042('0x14')](function(_0x1ae147){logger[_0x7042('0xe')](_0x7042('0x1b'),_0x1ae147[_0x7042('0x10')],_0x48d529);_0x4611f9(_0x12d618[_0x7042('0xe')](0x1f4,_0x1ae147[_0x7042('0x10')]));});});};exports[_0x7042('0x2c')]=function(_0x11efb7){var _0x4d42a5=this;return new Promise(function(_0x2a13cc,_0x39702f){return db[_0x7042('0x16')]['findAll']({'raw':_0x11efb7['options']?_0x11efb7[_0x7042('0x19')][_0x7042('0x1d')]===undefined?!![]:![]:!![],'where':_0x11efb7['options']?_0x11efb7[_0x7042('0x19')][_0x7042('0x1e')]||null:null,'attributes':[[_0x7042('0x2d'),_0x7042('0x2e')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db[_0x7042('0x1f')][_0x7042('0x23')](_0x7042('0x2f')))),_0x7042('0x30')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x7042('0x23')](_0x7042('0x31')))),_0x7042('0x32')],[db[_0x7042('0x1f')]['fn']('COUNT',db[_0x7042('0x1f')]['fn']('IF',db[_0x7042('0x1f')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x7042('0x33')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db[_0x7042('0x1f')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x7042('0x34')],[db[_0x7042('0x1f')]['fn']('COUNT',db[_0x7042('0x1f')]['fn']('IF',db[_0x7042('0x1f')][_0x7042('0x23')]('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db['sequelize'][_0x7042('0x23')](_0x7042('0x35')))),'outboundDropCallsDayTimeout'],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db[_0x7042('0x1f')][_0x7042('0x23')](_0x7042('0x36')))),_0x7042('0x37')],[db['sequelize']['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db['sequelize'][_0x7042('0x23')](_0x7042('0x38')))),_0x7042('0x39')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2013,\x201,\x20null'))),_0x7042('0x3a')],[db['sequelize']['fn']('COUNT',db[_0x7042('0x1f')]['fn']('IF',db['sequelize'][_0x7042('0x23')](_0x7042('0x3b')))),_0x7042('0x3c')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db[_0x7042('0x1f')][_0x7042('0x23')](_0x7042('0x3d')))),_0x7042('0x3e')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db['sequelize'][_0x7042('0x23')](_0x7042('0x3f')))),_0x7042('0x40')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db[_0x7042('0x1f')][_0x7042('0x23')](_0x7042('0x41')))),_0x7042('0x3e')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db['sequelize'][_0x7042('0x23')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x7042('0x42')]],'group':[_0x7042('0x2d')]})[_0x7042('0xb')](function(_0x5a0c85){logger['info'](_0x7042('0x2c'),_0x11efb7);logger[_0x7042('0x1a')](_0x7042('0x2c'),_0x11efb7,JSON[_0x7042('0xd')](_0x5a0c85));_0x2a13cc(_0x5a0c85);})['catch'](function(_0x497188){logger[_0x7042('0xe')](_0x7042('0x2c'),_0x497188['message'],_0x11efb7);_0x39702f(_0x4d42a5[_0x7042('0xe')](0x1f4,_0x497188[_0x7042('0x10')]));});});};exports['GetCampaignHopperHistory']=function(_0x1180e2){var _0x2abb79=this;return new Promise(function(_0x578e90,_0x449de2){return db[_0x7042('0x16')][_0x7042('0x1c')]({'raw':_0x1180e2['options']?_0x1180e2[_0x7042('0x19')][_0x7042('0x1d')]===undefined?!![]:![]:!![],'where':_0x1180e2[_0x7042('0x19')]?_0x1180e2[_0x7042('0x19')][_0x7042('0x1e')]||null:null,'attributes':[[_0x7042('0x2d'),_0x7042('0x2e')],[db[_0x7042('0x1f')]['fn'](_0x7042('0x20'),db[_0x7042('0x1f')][_0x7042('0x21')]('id')),_0x7042('0x43')],[db['sequelize']['fn'](_0x7042('0x20'),db[_0x7042('0x1f')]['fn']('IF',db[_0x7042('0x1f')][_0x7042('0x23')](_0x7042('0x24')))),_0x7042('0x44')]],'group':['campaign']})[_0x7042('0xb')](function(_0x17f5c9){logger[_0x7042('0x11')]('GetCampaignHopperHistory',_0x1180e2);logger[_0x7042('0x1a')](_0x7042('0x45'),_0x1180e2,JSON[_0x7042('0xd')](_0x17f5c9));_0x578e90(_0x17f5c9);})[_0x7042('0x14')](function(_0x267cdf){logger[_0x7042('0xe')](_0x7042('0x45'),_0x267cdf[_0x7042('0x10')],_0x1180e2);_0x449de2(_0x2abb79['error'](0x1f4,_0x267cdf[_0x7042('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 4f60713..34f2342 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 _0x304b=['../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','util','connect-timeout','express','Router','fs-extra'];(function(_0x139224,_0x435037){var _0x389fda=function(_0x3481a2){while(--_0x3481a2){_0x139224['push'](_0x139224['shift']());}};_0x389fda(++_0x435037);}(_0x304b,0x164));var _0xb304=function(_0x16be4d,_0x100c7c){_0x16be4d=_0x16be4d-0x0;var _0x1bb71f=_0x304b[_0x16be4d];return _0x1bb71f;};'use strict';var multer=require('multer');var util=require(_0xb304('0x0'));var path=require('path');var timeout=require(_0xb304('0x1'));var express=require(_0xb304('0x2'));var router=express[_0xb304('0x3')]();var fs_extra=require(_0xb304('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb304('0x5'));var config=require(_0xb304('0x6'));var controller=require(_0xb304('0x7'));router[_0xb304('0x8')]('/',auth['isAuthenticated'](),controller[_0xb304('0x9')]);router[_0xb304('0x8')](_0xb304('0xa'),auth[_0xb304('0xb')](),controller[_0xb304('0xc')]);router[_0xb304('0x8')](_0xb304('0xd'),auth['isAuthenticated'](),controller[_0xb304('0xe')]);router[_0xb304('0xf')]('/',auth[_0xb304('0xb')](),controller[_0xb304('0x10')]);router[_0xb304('0x11')]('/:id',auth[_0xb304('0xb')](),controller[_0xb304('0x12')]);module['exports']=router; \ No newline at end of file +var _0x3514=['put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x2a5dc2,_0x4c0500){var _0x1d0b06=function(_0xfb000e){while(--_0xfb000e){_0x2a5dc2['push'](_0x2a5dc2['shift']());}};_0x1d0b06(++_0x4c0500);}(_0x3514,0x1e6));var _0x4351=function(_0x5bc48c,_0x532918){_0x5bc48c=_0x5bc48c-0x0;var _0x4f6e0f=_0x3514[_0x5bc48c];return _0x4f6e0f;};'use strict';var multer=require(_0x4351('0x0'));var util=require(_0x4351('0x1'));var path=require(_0x4351('0x2'));var timeout=require(_0x4351('0x3'));var express=require(_0x4351('0x4'));var router=express[_0x4351('0x5')]();var fs_extra=require(_0x4351('0x6'));var auth=require(_0x4351('0x7'));var interaction=require(_0x4351('0x8'));var config=require(_0x4351('0x9'));var controller=require(_0x4351('0xa'));router[_0x4351('0xb')]('/',auth['isAuthenticated'](),controller[_0x4351('0xc')]);router[_0x4351('0xb')](_0x4351('0xd'),auth[_0x4351('0xe')](),controller[_0x4351('0xf')]);router[_0x4351('0xb')](_0x4351('0x10'),auth[_0x4351('0xe')](),controller[_0x4351('0x11')]);router[_0x4351('0x12')]('/',auth[_0x4351('0xe')](),controller[_0x4351('0x13')]);router[_0x4351('0x14')](_0x4351('0x10'),auth[_0x4351('0xe')](),controller[_0x4351('0x15')]);module[_0x4351('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index cc0a1f3..03bd426 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 _0x4986=['exports','STRING','sequelize'];(function(_0x57cb4f,_0x541f57){var _0x29bb45=function(_0x462bee){while(--_0x462bee){_0x57cb4f['push'](_0x57cb4f['shift']());}};_0x29bb45(++_0x541f57);}(_0x4986,0x6e));var _0x6498=function(_0x117d6c,_0x24d723){_0x117d6c=_0x117d6c-0x0;var _0x2c48ee=_0x4986[_0x117d6c];return _0x2c48ee;};'use strict';var Sequelize=require(_0x6498('0x0'));module[_0x6498('0x1')]={'name':{'type':Sequelize[_0x6498('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x6498('0x2')]}}; \ No newline at end of file +var _0xd1f9=['STRING','name'];(function(_0x57aa81,_0xe9293f){var _0x2cf931=function(_0x1cae05){while(--_0x1cae05){_0x57aa81['push'](_0x57aa81['shift']());}};_0x2cf931(++_0xe9293f);}(_0xd1f9,0x88));var _0x9d1f=function(_0x49b78f,_0x1ccdf7){_0x49b78f=_0x49b78f-0x0;var _0x544d2=_0xd1f9[_0x49b78f];return _0x544d2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9d1f('0x0')],'unique':_0x9d1f('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9d1f('0x0')]},'dialPrefix':{'type':Sequelize[_0x9d1f('0x0')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index c982e5a..0e8c69e 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 _0xd295=['nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','destroy','describe','ListId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','length','each','omit','success','dataValues','push','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','cf_%d','raw','ContactItemType','select','from','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','alias','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','isEmpty','now','writeFileSync','format','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','transaction','addCustomFields','Sequelize','text','TEXT','number','switch','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','get','Lists','UserProfileResource','stack','name','index','map','CmList','rawAttributes','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty'];(function(_0x259ce8,_0x798276){var _0x5ef5c2=function(_0x1bb84e){while(--_0x1bb84e){_0x259ce8['push'](_0x259ce8['shift']());}};_0x5ef5c2(++_0x798276);}(_0xd295,0x10b));var _0x5d29=function(_0x1c742c,_0x50e28a){_0x1c742c=_0x1c742c-0x0;var _0x3aad5d=_0xd295[_0x1c742c];return _0x3aad5d;};'use strict';var emlformat=require(_0x5d29('0x0'));var rimraf=require(_0x5d29('0x1'));var zipdir=require(_0x5d29('0x2'));var jsonpatch=require(_0x5d29('0x3'));var rp=require(_0x5d29('0x4'));var moment=require(_0x5d29('0x5'));var BPromise=require(_0x5d29('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5d29('0x7'));var sox=require('sox');var csv=require(_0x5d29('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5d29('0x9'));var squel=require(_0x5d29('0xa'));var crypto=require(_0x5d29('0xb'));var jsforce=require(_0x5d29('0xc'));var deskjs=require(_0x5d29('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5d29('0xe'));var Papa=require(_0x5d29('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5d29('0x10'));var as=require(_0x5d29('0x11'));var hardwareService=require(_0x5d29('0x12'));var logger=require(_0x5d29('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x5d29('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5d29('0x15'))['db'];var csv_results;config['redis']=_[_0x5d29('0x16')](config['redis'],{'host':_0x5d29('0x17'),'port':0x18eb});var socket=require(_0x5d29('0x18'))(new Redis(config['redis']));require(_0x5d29('0x19'))['register'](socket);function respondWithStatusCode(_0x37eebd,_0x5be847){_0x5be847=_0x5be847||0xcc;return function(_0xc1d246){if(_0xc1d246){return _0x37eebd[_0x5d29('0x1a')](_0x5be847);}return _0x37eebd[_0x5d29('0x1b')](_0x5be847)[_0x5d29('0x1c')]();};}function respondWithResult(_0x445427,_0x325a9e){_0x325a9e=_0x325a9e||0xc8;return function(_0x499dba){if(_0x499dba){return _0x445427['status'](_0x325a9e)['json'](_0x499dba);}};}function respondWithFilteredResult(_0x182040,_0x432071){return function(_0x56ef95){if(_0x56ef95){var _0x5c6394=typeof _0x432071[_0x5d29('0x1d')]===_0x5d29('0x1e')&&typeof _0x432071[_0x5d29('0x1f')]===_0x5d29('0x1e');var _0x53a4af=_0x56ef95[_0x5d29('0x20')];var _0x3f1ed8=_0x5c6394?0x0:_0x432071[_0x5d29('0x1d')];var _0x5c30a3=_0x5c6394?_0x56ef95[_0x5d29('0x20')]:_0x432071['offset']+_0x432071['limit'];var _0xa2f239;if(_0x5c30a3>=_0x53a4af){_0x5c30a3=_0x53a4af;_0xa2f239=0xc8;}else{_0xa2f239=0xce;}_0x182040[_0x5d29('0x1b')](_0xa2f239);return _0x182040['set'](_0x5d29('0x21'),_0x3f1ed8+'-'+_0x5c30a3+'/'+_0x53a4af)[_0x5d29('0x22')](_0x56ef95);}return null;};}function patchUpdates(_0x47d810){return function(_0x3acdce){try{jsonpatch[_0x5d29('0x23')](_0x3acdce,_0x47d810,!![]);}catch(_0x4d315d){return BPromise[_0x5d29('0x24')](_0x4d315d);}return _0x3acdce[_0x5d29('0x25')]();};}function saveUpdates(_0x3e578d,_0x18422f){return function(_0x2a3732){if(_0x2a3732){return _0x2a3732[_0x5d29('0x26')](_0x3e578d)[_0x5d29('0x27')](function(_0x1d5e3f){return _0x1d5e3f;});}return null;};}function removeEntity(_0x209c36,_0x6e737){return function(_0xe3a7b4){if(_0xe3a7b4){return _0xe3a7b4['destroy']()[_0x5d29('0x27')](function(){var _0x22e151=_0xe3a7b4[_0x5d29('0x28')]({'plain':!![]});var _0x13bc77=_0x5d29('0x29');return db[_0x5d29('0x2a')]['destroy']({'where':{'type':_0x13bc77,'resourceId':_0x22e151['id']}})[_0x5d29('0x27')](function(){return _0xe3a7b4;});})[_0x5d29('0x27')](function(){_0x209c36[_0x5d29('0x1b')](0xcc)[_0x5d29('0x1c')]();});}};}function handleEntityNotFound(_0x1546fa,_0x5aa945){return function(_0x3111e9){if(!_0x3111e9){_0x1546fa[_0x5d29('0x1a')](0x194);}return _0x3111e9;};}function handleError(_0x4626f0,_0x2e9311){_0x2e9311=_0x2e9311||0x1f4;return function(_0x41cbe2){logger['error'](_0x41cbe2[_0x5d29('0x2b')]);if(_0x41cbe2[_0x5d29('0x2c')]){delete _0x41cbe2[_0x5d29('0x2c')];}_0x4626f0[_0x5d29('0x1b')](_0x2e9311)['send'](_0x41cbe2);};}exports[_0x5d29('0x2d')]=function(_0x2e7b47,_0x51389f){var _0x3b32dd={},_0x1747bc={},_0x360898={'count':0x0,'rows':[]};var _0x25e713=_[_0x5d29('0x2e')](db[_0x5d29('0x2f')][_0x5d29('0x30')],function(_0x4919b9){return{'name':_0x4919b9['fieldName'],'type':_0x4919b9['type']['key']};});_0x1747bc[_0x5d29('0x31')]=_[_0x5d29('0x2e')](_0x25e713,_0x5d29('0x2c'));_0x1747bc['query']=_[_0x5d29('0x32')](_0x2e7b47['query']);_0x1747bc[_0x5d29('0x33')]=_[_0x5d29('0x34')](_0x1747bc[_0x5d29('0x31')],_0x1747bc[_0x5d29('0x35')]);_0x3b32dd[_0x5d29('0x36')]=_['intersection'](_0x1747bc[_0x5d29('0x31')],qs[_0x5d29('0x37')](_0x2e7b47[_0x5d29('0x35')][_0x5d29('0x37')]));_0x3b32dd[_0x5d29('0x36')]=_0x3b32dd['attributes']['length']?_0x3b32dd[_0x5d29('0x36')]:_0x1747bc[_0x5d29('0x31')];if(!_0x2e7b47[_0x5d29('0x35')][_0x5d29('0x38')](_0x5d29('0x39'))){_0x3b32dd[_0x5d29('0x1f')]=qs[_0x5d29('0x1f')](_0x2e7b47[_0x5d29('0x35')][_0x5d29('0x1f')]);_0x3b32dd[_0x5d29('0x1d')]=qs[_0x5d29('0x1d')](_0x2e7b47[_0x5d29('0x35')]['offset']);}_0x3b32dd[_0x5d29('0x3a')]=qs[_0x5d29('0x3b')](_0x2e7b47[_0x5d29('0x35')][_0x5d29('0x3b')]);_0x3b32dd[_0x5d29('0x3c')]=qs[_0x5d29('0x33')](_[_0x5d29('0x3d')](_0x2e7b47['query'],_0x1747bc[_0x5d29('0x33')]),_0x25e713);if(_0x2e7b47[_0x5d29('0x35')][_0x5d29('0x3e')]){_0x3b32dd[_0x5d29('0x3c')]=_[_0x5d29('0x3f')](_0x3b32dd['where'],{'$or':_[_0x5d29('0x2e')](_0x25e713,function(_0x3b93c2){if(_0x3b93c2[_0x5d29('0x40')]!=='VIRTUAL'){var _0x118f9c={};_0x118f9c[_0x3b93c2[_0x5d29('0x2c')]]={'$like':'%'+_0x2e7b47['query'][_0x5d29('0x3e')]+'%'};return _0x118f9c;}})});}_0x3b32dd=_[_0x5d29('0x3f')]({},_0x3b32dd,_0x2e7b47[_0x5d29('0x41')]);var _0x2ab565={'where':_0x3b32dd[_0x5d29('0x3c')]};return db[_0x5d29('0x2f')][_0x5d29('0x20')](_0x2ab565)[_0x5d29('0x27')](function(_0x2d785a){_0x360898[_0x5d29('0x20')]=_0x2d785a;if(_0x2e7b47['query']['includeAll']){_0x3b32dd[_0x5d29('0x42')]=[{'all':!![]}];}return db[_0x5d29('0x2f')][_0x5d29('0x43')](_0x3b32dd);})['then'](function(_0x5f0d92){_0x360898['rows']=_0x5f0d92;return _0x360898;})['then'](respondWithFilteredResult(_0x51389f,_0x3b32dd))[_0x5d29('0x44')](handleError(_0x51389f,null));};exports[_0x5d29('0x45')]=function(_0x316a2c,_0x1b2450){var _0x32d89b={'raw':![],'where':{'id':_0x316a2c[_0x5d29('0x46')]['id']}},_0x545baa={};_0x545baa['model']=_[_0x5d29('0x32')](db['CmList'][_0x5d29('0x30')]);_0x545baa[_0x5d29('0x35')]=_[_0x5d29('0x32')](_0x316a2c['query']);_0x545baa[_0x5d29('0x33')]=_[_0x5d29('0x34')](_0x545baa[_0x5d29('0x31')],_0x545baa[_0x5d29('0x35')]);_0x32d89b[_0x5d29('0x36')]=_[_0x5d29('0x34')](_0x545baa[_0x5d29('0x31')],qs[_0x5d29('0x37')](_0x316a2c[_0x5d29('0x35')]['fields']));_0x32d89b['attributes']=_0x32d89b[_0x5d29('0x36')]['length']?_0x32d89b[_0x5d29('0x36')]:_0x545baa[_0x5d29('0x31')];if(_0x316a2c[_0x5d29('0x35')][_0x5d29('0x47')]){_0x32d89b[_0x5d29('0x42')]=[{'all':!![]}];}_0x32d89b=_[_0x5d29('0x3f')]({},_0x32d89b,_0x316a2c[_0x5d29('0x41')]);return db[_0x5d29('0x2f')][_0x5d29('0x48')](_0x32d89b)[_0x5d29('0x27')](handleEntityNotFound(_0x1b2450,null))[_0x5d29('0x27')](respondWithResult(_0x1b2450,null))[_0x5d29('0x44')](handleError(_0x1b2450,null));};exports[_0x5d29('0x49')]=function(_0x77a2bc,_0x4a5c8d){return db[_0x5d29('0x2f')][_0x5d29('0x49')](_0x77a2bc[_0x5d29('0x4a')],{})[_0x5d29('0x27')](function(_0x149c17){var _0x22e1b0=_0x77a2bc[_0x5d29('0x4b')][_0x5d29('0x28')]({'plain':!![]});if(!_0x22e1b0)throw new Error(_0x5d29('0x4c'));if(_0x22e1b0[_0x5d29('0x4d')]==='user'){var _0x13ec3c=_0x149c17[_0x5d29('0x28')]({'plain':!![]});var _0xc65fc9=_0x5d29('0x29');return db['UserProfileSection'][_0x5d29('0x48')]({'where':{'name':_0xc65fc9,'userProfileId':_0x22e1b0['userProfileId']},'raw':!![]})[_0x5d29('0x27')](function(_0x255565){if(_0x255565&&_0x255565[_0x5d29('0x4e')]===0x0){return db[_0x5d29('0x2a')][_0x5d29('0x49')]({'name':_0x13ec3c[_0x5d29('0x2c')],'resourceId':_0x13ec3c['id'],'type':_0x255565[_0x5d29('0x2c')],'sectionId':_0x255565['id']},{})[_0x5d29('0x27')](function(){return _0x149c17;});}else{return _0x149c17;}})[_0x5d29('0x44')](function(_0x25f98e){logger[_0x5d29('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x25f98e);throw _0x25f98e;});}return _0x149c17;})[_0x5d29('0x27')](respondWithResult(_0x4a5c8d,0xc9))[_0x5d29('0x44')](handleError(_0x4a5c8d,null));};exports[_0x5d29('0x26')]=function(_0x296d84,_0x55c1c1){if(_0x296d84['body']['id']){delete _0x296d84[_0x5d29('0x4a')]['id'];}return db[_0x5d29('0x2f')]['find']({'where':{'id':_0x296d84[_0x5d29('0x46')]['id']}})[_0x5d29('0x27')](handleEntityNotFound(_0x55c1c1,null))['then'](saveUpdates(_0x296d84[_0x5d29('0x4a')],null))['then'](respondWithResult(_0x55c1c1,null))[_0x5d29('0x44')](handleError(_0x55c1c1,null));};exports[_0x5d29('0x50')]=function(_0x373fd9,_0x1849ad){return db['CmList'][_0x5d29('0x48')]({'where':{'id':_0x373fd9[_0x5d29('0x46')]['id']}})['then'](handleEntityNotFound(_0x1849ad,null))[_0x5d29('0x27')](removeEntity(_0x1849ad,null))[_0x5d29('0x44')](handleError(_0x1849ad,null));};exports[_0x5d29('0x51')]=function(_0x3a22da,_0x4dbacb){return db['CmList'][_0x5d29('0x51')]()[_0x5d29('0x27')](respondWithResult(_0x4dbacb,null))['catch'](handleError(_0x4dbacb,null));};exports['addDisposition']=function(_0x59eda9,_0xf1794e,_0x36df77){if(_0x59eda9[_0x5d29('0x4a')]['id']){delete _0x59eda9['body']['id'];}return db[_0x5d29('0x2f')][_0x5d29('0x48')]({'where':{'id':_0x59eda9[_0x5d29('0x46')]['id']}})[_0x5d29('0x27')](handleEntityNotFound(_0xf1794e,null))[_0x5d29('0x27')](function(_0x342e6f){if(_0x342e6f){_0x59eda9['body'][_0x5d29('0x52')]=_0x342e6f['id'];return db[_0x5d29('0x53')][_0x5d29('0x49')](_0x59eda9['body']);}})[_0x5d29('0x27')](respondWithResult(_0xf1794e,null))[_0x5d29('0x44')](handleError(_0xf1794e,null));};exports[_0x5d29('0x54')]=function(_0x2e6fe7,_0x53385c,_0x28db2b){var _0x1470d9={'raw':![],'where':{}};var _0x5d2849={};var _0x267398={'count':0x0,'rows':[]};return db['CmList'][_0x5d29('0x55')]({'where':{'id':_0x2e6fe7[_0x5d29('0x46')]['id']}})['then'](handleEntityNotFound(_0x53385c,null))[_0x5d29('0x27')](function(_0x323e3b){if(_0x323e3b){_0x5d2849['model']=_[_0x5d29('0x32')](db[_0x5d29('0x53')][_0x5d29('0x30')]);_0x5d2849[_0x5d29('0x35')]=_[_0x5d29('0x32')](_0x2e6fe7['query']);_0x5d2849['filters']=_['intersection'](_0x5d2849[_0x5d29('0x31')],_0x5d2849['query']);_0x1470d9['attributes']=_[_0x5d29('0x34')](_0x5d2849[_0x5d29('0x31')],qs[_0x5d29('0x37')](_0x2e6fe7[_0x5d29('0x35')]['fields']));_0x1470d9[_0x5d29('0x36')]=_0x1470d9[_0x5d29('0x36')]['length']?_0x1470d9[_0x5d29('0x36')]:_0x5d2849[_0x5d29('0x31')];if(!_0x2e6fe7['query']['hasOwnProperty']('nolimit')){_0x1470d9[_0x5d29('0x1f')]=qs[_0x5d29('0x1f')](_0x2e6fe7[_0x5d29('0x35')]['limit']);_0x1470d9[_0x5d29('0x1d')]=qs[_0x5d29('0x1d')](_0x2e6fe7[_0x5d29('0x35')][_0x5d29('0x1d')]);}_0x1470d9[_0x5d29('0x3a')]=qs[_0x5d29('0x3b')](_0x2e6fe7['query'][_0x5d29('0x3b')]);_0x1470d9[_0x5d29('0x3c')]=qs['filters'](_[_0x5d29('0x3d')](_0x2e6fe7['query'],_0x5d2849[_0x5d29('0x33')]));_0x1470d9[_0x5d29('0x3c')][_0x5d29('0x52')]=_0x323e3b['id'];if(_0x2e6fe7['query']['filter']){_0x1470d9['where']=_['merge'](_0x1470d9[_0x5d29('0x3c')],{'$or':_['map'](_0x1470d9[_0x5d29('0x36')],function(_0x1889c0){var _0x5e85e6={};_0x5e85e6[_0x1889c0]={'$like':'%'+_0x2e6fe7[_0x5d29('0x35')][_0x5d29('0x3e')]+'%'};return _0x5e85e6;})});}_0x1470d9=_[_0x5d29('0x3f')]({},_0x1470d9,_0x2e6fe7[_0x5d29('0x41')]);return db[_0x5d29('0x53')]['count']({'where':_0x1470d9[_0x5d29('0x3c')]})[_0x5d29('0x27')](function(_0x3d4c97){_0x267398['count']=_0x3d4c97;if(_0x2e6fe7['query'][_0x5d29('0x47')]){_0x1470d9[_0x5d29('0x42')]=[{'all':!![]}];}return db[_0x5d29('0x53')][_0x5d29('0x43')](_0x1470d9);})[_0x5d29('0x27')](function(_0x3c330a){_0x267398[_0x5d29('0x56')]=_0x3c330a;return _0x267398;});}})[_0x5d29('0x27')](respondWithFilteredResult(_0x53385c,_0x1470d9))[_0x5d29('0x44')](handleError(_0x53385c,null));};exports[_0x5d29('0x57')]=function(_0x5cd762,_0x5bd41c,_0x280266){return db['CmList']['find']({'where':{'id':_0x5cd762['params']['id']}})[_0x5d29('0x27')](handleEntityNotFound(_0x5bd41c,null))[_0x5d29('0x27')](function(_0x205269){if(_0x205269){return _0x205269[_0x5d29('0x57')](_0x5cd762[_0x5d29('0x35')][_0x5d29('0x58')]);}})['then'](respondWithStatusCode(_0x5bd41c,null))[_0x5d29('0x44')](handleError(_0x5bd41c,null));};exports[_0x5d29('0x59')]=function(_0x5f59d8,_0x597336,_0xa07855){return db[_0x5d29('0x2f')][_0x5d29('0x48')]({'where':{'id':_0x5f59d8[_0x5d29('0x46')]['id']}})[_0x5d29('0x27')](handleEntityNotFound(_0x597336,null))[_0x5d29('0x27')](function(_0xa2ddc7){if(_0xa2ddc7){var _0x2765fd=[];var _0xe7efbe={'success':[],'errors':[]};return db[_0x5d29('0x5a')]['describe']()[_0x5d29('0x27')](function(_0x4a376c){if(_0x5f59d8[_0x5d29('0x4a')][_0x5d29('0x5b')]&&_[_0x5d29('0x5c')](_0x5f59d8[_0x5d29('0x4a')][_0x5d29('0x5b')])){if(_0x5f59d8[_0x5d29('0x4a')][_0x5d29('0x5b')]['length']){_0x5f59d8[_0x5d29('0x4a')][_0x5d29('0x5b')]=_0x5f59d8[_0x5d29('0x4a')][_0x5d29('0x5b')][_0x5d29('0x5d')](';')+';';}else{_0x5f59d8['body']['tags']=null;}}else{_0x5f59d8[_0x5d29('0x4a')][_0x5d29('0x5b')]=null;}if(_0x5f59d8[_0x5d29('0x4a')]&&_[_0x5d29('0x5c')](_0x5f59d8[_0x5d29('0x4a')])){for(var _0x6457c8=0x0;_0x6457c8<_0x5f59d8[_0x5d29('0x4a')][_0x5d29('0x5e')];_0x6457c8+=0x1){_0x5f59d8['body'][_0x6457c8]['ListId']=_0x5f59d8[_0x5d29('0x46')]['id'];_0x2765fd['push'](_0x5f59d8[_0x5d29('0x4a')][_0x6457c8]);}return BPromise[_0x5d29('0x5f')](_0x2765fd,function(_0x339726){return db[_0x5d29('0x5a')]['create'](_[_0x5d29('0x60')](_0x339726,[_0x5d29('0x58'),'id'])||{},{'fields':_[_0x5d29('0x32')](_0x4a376c),'raw':!![]})[_0x5d29('0x27')](function(_0xb1b7fc){_0xe7efbe[_0x5d29('0x61')]['push'](_0xb1b7fc[_0x5d29('0x62')]);})[_0x5d29('0x44')](function(_0x42619d){_0xe7efbe['errors'][_0x5d29('0x63')]({'data':_0x339726,'error':_0x42619d[_0x5d29('0x64')]});});})[_0x5d29('0x27')](function(_0x57ed23){return _0xe7efbe;})[_0x5d29('0x44')](function(_0x34b5d7){return _0x34b5d7;});}else{_0x597336['status'](0x190)[_0x5d29('0x22')]({'message':_0x5d29('0x65')});}});}})['then'](respondWithResult(_0x597336,null))[_0x5d29('0x44')](handleError(_0x597336,null));};exports[_0x5d29('0x66')]=function(_0x239dc9,_0x467251,_0x15afc7){var _0x5eee67;return db[_0x5d29('0x2f')]['find']({'where':{'id':_0x239dc9[_0x5d29('0x46')]['id']},'include':[{'model':db[_0x5d29('0x67')],'as':_0x5d29('0x68')}]})[_0x5d29('0x27')](handleEntityNotFound(_0x467251,null))[_0x5d29('0x27')](function(_0x164afc){if(_0x164afc){_0x5eee67=_0x164afc;return db[_0x5d29('0x5a')][_0x5d29('0x30')];}})[_0x5d29('0x27')](function(_0x56b701){if(_0x56b701){var _0x4ae453={};var _0x141633={};_0x141633['model']=_[_0x5d29('0x69')](_[_0x5d29('0x32')](_0x56b701),_[_0x5d29('0x2e')](_0x5eee67['CustomFields'],function(_0x188a4c){return util['format'](_0x5d29('0x6a'),_0x188a4c['id']);}));_0x141633['query']=_[_0x5d29('0x32')](_0x239dc9[_0x5d29('0x35')]);_0x141633[_0x5d29('0x33')]=_[_0x5d29('0x34')](_0x141633['model'],_0x141633[_0x5d29('0x35')]);_0x4ae453[_0x5d29('0x36')]=_[_0x5d29('0x34')](_0x141633[_0x5d29('0x31')],qs['fields'](_0x239dc9[_0x5d29('0x35')][_0x5d29('0x37')]));_0x4ae453[_0x5d29('0x36')]=_0x4ae453[_0x5d29('0x36')][_0x5d29('0x5e')]?_0x4ae453[_0x5d29('0x36')]:_0x141633[_0x5d29('0x31')];if(!_0x239dc9[_0x5d29('0x35')][_0x5d29('0x38')](_0x5d29('0x39'))){_0x4ae453[_0x5d29('0x1f')]=qs[_0x5d29('0x1f')](_0x239dc9[_0x5d29('0x35')][_0x5d29('0x1f')]);_0x4ae453[_0x5d29('0x1d')]=qs['offset'](_0x239dc9[_0x5d29('0x35')]['offset']);}_0x4ae453['order']=qs[_0x5d29('0x3b')](_0x239dc9[_0x5d29('0x35')][_0x5d29('0x3b')]);_0x4ae453[_0x5d29('0x3c')]=qs[_0x5d29('0x33')](_[_0x5d29('0x3d')](_0x239dc9[_0x5d29('0x35')],_0x141633['filters']));_0x4ae453[_0x5d29('0x6b')]=!![];if(_0x239dc9[_0x5d29('0x35')][_0x5d29('0x3e')]){_0x4ae453[_0x5d29('0x3c')]=_[_0x5d29('0x3f')](_0x4ae453['where'],{'$or':_[_0x5d29('0x2e')](_0x4ae453[_0x5d29('0x36')],function(_0x262167){var _0x51ff22={};_0x51ff22[_0x262167]={'$like':'%'+_0x239dc9['query'][_0x5d29('0x3e')]+'%'};return _0x51ff22;})});}_0x4ae453=_['merge']({},_0x4ae453,_0x239dc9['options']);return _0x5eee67[_0x5d29('0x66')](_0x4ae453);}})[_0x5d29('0x27')](respondWithResult(_0x467251,null))['catch'](handleError(_0x467251,null));};exports['getContactsCsv']=function(_0xac94a6,_0x128052,_0x49aae0){var _0x560029;var _0x73ac54;var _0x3b82c3;var _0x1077d3=_0xac94a6[_0x5d29('0x46')]['id'];csv_results=[];return db[_0x5d29('0x6c')][_0x5d29('0x43')]({'attributes':['id',_0x5d29('0x2c')],'raw':!![],'order':['OrderBy']})[_0x5d29('0x27')](function(_0x47aa00){_0x560029=_0x47aa00;var _0x2aaf92=_[_0x5d29('0x32')](db[_0x5d29('0x5a')][_0x5d29('0x30')]);return db[_0x5d29('0x67')][_0x5d29('0x43')]({'raw':!![],'attributes':['id','alias']})[_0x5d29('0x27')](function(_0xa3b7ef){_0x73ac54=_0xa3b7ef;var _0x960aad=squel[_0x5d29('0x6d')]()[_0x5d29('0x37')](_0x2aaf92)[_0x5d29('0x6e')]('cm_contacts','c')[_0x5d29('0x3c')](_0x5d29('0x6f'),_0x1077d3)[_0x5d29('0x3c')](_0x5d29('0x70'))[_0x5d29('0x71')]();for(var _0xa3b483=0x0;_0xa3b483<_0x73ac54[_0x5d29('0x5e')];_0xa3b483++){_0x960aad[_0x5d29('0x72')](_0x5d29('0x73')+_0x73ac54[_0xa3b483]['id'],_0x5d29('0x74')+_0x73ac54[_0xa3b483][_0x5d29('0x75')]);}for(var _0xa3b483=0x0;_0xa3b483<_0x560029[_0x5d29('0x5e')];_0xa3b483++){_0x960aad[_0x5d29('0x72')](squel[_0x5d29('0x6d')]()[_0x5d29('0x72')]('item')['from'](_0x5d29('0x76'))[_0x5d29('0x3c')](_0x5d29('0x77'),_0x560029[_0xa3b483]['id'])[_0x5d29('0x3c')](_0x5d29('0x78')),_0x5d29('0x79')+_0x560029[_0xa3b483][_0x5d29('0x2c')]);_0x960aad['field'](squel['select']()['field'](_0x5d29('0x7a'))[_0x5d29('0x6e')]('cm_contact_has_items')[_0x5d29('0x3c')](_0x5d29('0x77'),_0x560029[_0xa3b483]['id'])[_0x5d29('0x3c')](_0x5d29('0x78')),_0x5d29('0x7b')+_0x560029[_0xa3b483][_0x5d29('0x2c')]);}var _0x1662b1=[];_0x1662b1[_0x5d29('0x63')](_0x960aad['toString']());BPromise[_0x5d29('0x5f')](_0x1662b1,handleQuery)[_0x5d29('0x27')](function(_0x4ebe09){handleQuery(_0x960aad[_0x5d29('0x7c')]());var _0x534bcc=csv_results[0x0];if(!_[_0x5d29('0x7d')](_0x534bcc)){var _0x44c66c=toCsv(_0x534bcc);var _0x2facca=Date[_0x5d29('0x7e')]();fs[_0x5d29('0x7f')](util[_0x5d29('0x80')](_0x5d29('0x81'),_0x1077d3,_0x2facca),_0x44c66c);_0x128052[_0x5d29('0x82')](_0x5d29('0x83'),_0x5d29('0x84')+util['format'](_0x5d29('0x85'),_0x1077d3,_0x2facca));_0x128052[_0x5d29('0x82')](_0x5d29('0x86'),_0x5d29('0x87'));return _0x128052[_0x5d29('0x88')](util[_0x5d29('0x80')](_0x5d29('0x81'),_0x1077d3,_0x2facca));}else{return _0x128052[_0x5d29('0x1a')](0xcc);}});});});};exports[_0x5d29('0x89')]=function(_0x1ff812,_0x3f9a89,_0x123461){var _0x3bdb5a;delete _0x1ff812[_0x5d29('0x4a')]['id'];return db['CmList'][_0x5d29('0x55')]({'where':{'id':_0x1ff812['params']['id']}})['then'](handleEntityNotFound(_0x3f9a89,null))[_0x5d29('0x27')](function(_0x3748bb){if(_0x3748bb){return db['sequelize'][_0x5d29('0x8a')](function(_0xb0c86){return db[_0x5d29('0x67')][_0x5d29('0x49')](_0x1ff812['body'],{'transaction':_0xb0c86})[_0x5d29('0x27')](function(_0x3a4748){_0x3bdb5a=_0x3a4748;return _0x3748bb[_0x5d29('0x8b')](_0x3a4748,{'transaction':_0xb0c86});})[_0x5d29('0x27')](function(){var _0x3ad16d={'type':db[_0x5d29('0x8c')]['TEXT'],'transaction':_0xb0c86};switch(_0x1ff812[_0x5d29('0x4a')][_0x5d29('0x40')]){case _0x5d29('0x8d'):_0x3ad16d[_0x5d29('0x40')]=db[_0x5d29('0x8c')][_0x5d29('0x8e')];break;case _0x5d29('0x8f'):_0x3ad16d[_0x5d29('0x40')]=db[_0x5d29('0x8c')]['INTEGER'];break;case _0x5d29('0x90'):_0x3ad16d[_0x5d29('0x40')]=db[_0x5d29('0x8c')]['BOOLEAN'];_0x3ad16d[_0x5d29('0x91')]=![];break;default:}return db[_0x5d29('0x92')][_0x5d29('0x93')][_0x5d29('0x94')](_0x5d29('0x95'),util[_0x5d29('0x80')](_0x5d29('0x96'),_0x3bdb5a['id']),_0x3ad16d);})[_0x5d29('0x27')](function(){return _0x3bdb5a;});});}})[_0x5d29('0x27')](respondWithResult(_0x3f9a89,null))['catch'](handleError(_0x3f9a89,null));};exports[_0x5d29('0x97')]=function(_0x12e535,_0x5119d7,_0x4f98b0){var _0x38c636={};var _0x82f305={};var _0x320080;var _0x5bac7b;return db['CmList'][_0x5d29('0x55')]({'where':{'id':_0x12e535[_0x5d29('0x46')]['id']}})['then'](handleEntityNotFound(_0x5119d7,null))[_0x5d29('0x27')](function(_0x5bd8b0){if(_0x5bd8b0){_0x320080=_0x5bd8b0;_0x82f305[_0x5d29('0x31')]=_[_0x5d29('0x32')](db[_0x5d29('0x67')][_0x5d29('0x30')]);_0x82f305[_0x5d29('0x35')]=_[_0x5d29('0x32')](_0x12e535[_0x5d29('0x35')]);_0x82f305['filters']=_[_0x5d29('0x34')](_0x82f305[_0x5d29('0x31')],_0x82f305[_0x5d29('0x35')]);_0x38c636[_0x5d29('0x36')]=_[_0x5d29('0x34')](_0x82f305[_0x5d29('0x31')],qs[_0x5d29('0x37')](_0x12e535[_0x5d29('0x35')]['fields']));_0x38c636[_0x5d29('0x36')]=_0x38c636['attributes'][_0x5d29('0x5e')]?_0x38c636[_0x5d29('0x36')]:_0x82f305['model'];_0x38c636['order']=qs[_0x5d29('0x3b')](_0x12e535[_0x5d29('0x35')][_0x5d29('0x3b')]);_0x38c636['where']=qs['filters'](_[_0x5d29('0x3d')](_0x12e535[_0x5d29('0x35')],_0x82f305[_0x5d29('0x33')]));_0x38c636['where']=_[_0x5d29('0x3f')](_0x38c636[_0x5d29('0x3c')],{'$or':[{'ListId':_0x5bd8b0['id']},{'ListId':null}]});if(_0x12e535['query'][_0x5d29('0x3e')]){_0x38c636[_0x5d29('0x3c')]=_[_0x5d29('0x3f')](_0x38c636[_0x5d29('0x3c')],{'$or':_[_0x5d29('0x2e')](_0x38c636[_0x5d29('0x36')],function(_0x2ba394){var _0x400411={};_0x400411[_0x2ba394]={'$like':'%'+_0x12e535['query'][_0x5d29('0x3e')]+'%'};return _0x400411;})});}_0x38c636=_[_0x5d29('0x3f')]({},_0x38c636,_0x12e535[_0x5d29('0x41')]);return db[_0x5d29('0x67')]['findAndCountAll'](_0x38c636);}})[_0x5d29('0x27')](respondWithResult(_0x5119d7,null))[_0x5d29('0x44')](handleError(_0x5119d7,null));};exports[_0x5d29('0x98')]=function(_0x5cfc9f,_0x2544ed){return db[_0x5d29('0x67')]['findAndCountAll']({'where':{'ListId':null}})[_0x5d29('0x27')](handleEntityNotFound(_0x2544ed,null))[_0x5d29('0x27')](function(_0x3d1e0f){return _0x3d1e0f;})[_0x5d29('0x27')](respondWithResult(_0x2544ed,null))[_0x5d29('0x44')](handleError(_0x2544ed,null));};exports[_0x5d29('0x99')]=function(_0x4993c3,_0x5a19d5,_0x2b9902){return db['CmList']['find']({'where':{'id':_0x4993c3[_0x5d29('0x46')]['id']}})[_0x5d29('0x27')](handleEntityNotFound(_0x5a19d5,null))[_0x5d29('0x27')](function(_0x1b8890){if(_0x1b8890){return _0x1b8890[_0x5d29('0x99')](_0x4993c3[_0x5d29('0x4a')][_0x5d29('0x58')],_[_0x5d29('0x60')](_0x4993c3['body'],[_0x5d29('0x58'),'id'])||{})[_0x5d29('0x9a')](function(_0x1b65e2){for(var _0x385d49=0x0;_0x385d49<_0x4993c3[_0x5d29('0x4a')][_0x5d29('0x58')][_0x5d29('0x5e')];_0x385d49+=0x1){socket[_0x5d29('0x9b')](_0x5d29('0x9c'),{'UserId':Number(_0x4993c3[_0x5d29('0x4a')][_0x5d29('0x58')][_0x385d49]),'CmListId':Number(_0x4993c3[_0x5d29('0x46')]['id'])});}return _0x1b65e2;});}})[_0x5d29('0x27')](respondWithResult(_0x5a19d5,null))[_0x5d29('0x44')](handleError(_0x5a19d5,null));};exports[_0x5d29('0x9d')]=function(_0x1fb6bb,_0x133624,_0x5e48f8){return db[_0x5d29('0x2f')][_0x5d29('0x48')]({'where':{'id':_0x1fb6bb['params']['id']}})[_0x5d29('0x27')](handleEntityNotFound(_0x133624,null))['then'](function(_0x585c6f){if(_0x585c6f){return _0x585c6f['removeAgents'](_0x1fb6bb[_0x5d29('0x35')][_0x5d29('0x58')])[_0x5d29('0x27')](function(){if(_[_0x5d29('0x5c')](_0x1fb6bb['query'][_0x5d29('0x58')])){for(var _0x586944=0x0;_0x586944<_0x1fb6bb[_0x5d29('0x35')][_0x5d29('0x58')][_0x5d29('0x5e')];_0x586944+=0x1){socket[_0x5d29('0x9b')]('userCmList:remove',{'UserId':Number(_0x1fb6bb[_0x5d29('0x35')][_0x5d29('0x58')][_0x586944]),'CmListId':Number(_0x1fb6bb[_0x5d29('0x46')]['id'])});}}else{socket['emit'](_0x5d29('0x9e'),{'UserId':Number(_0x1fb6bb[_0x5d29('0x35')][_0x5d29('0x58')]),'CmListId':Number(_0x1fb6bb[_0x5d29('0x46')]['id'])});}});}})['then'](respondWithStatusCode(_0x133624,null))[_0x5d29('0x44')](handleError(_0x133624,null));};exports[_0x5d29('0x9f')]=function(_0x225e95,_0x12d6b7,_0x568ed4){var _0x13e29b={};var _0xc517e5={};var _0x1ba8d9;var _0x28629f;return db[_0x5d29('0x2f')][_0x5d29('0x55')]({'where':{'id':_0x225e95[_0x5d29('0x46')]['id']}})[_0x5d29('0x27')](handleEntityNotFound(_0x12d6b7,null))[_0x5d29('0x27')](function(_0x4e5b09){if(_0x4e5b09){_0x1ba8d9=_0x4e5b09;_0xc517e5[_0x5d29('0x31')]=_[_0x5d29('0x32')](db[_0x5d29('0xa0')]['rawAttributes']);_0xc517e5[_0x5d29('0x35')]=_['keys'](_0x225e95['query']);_0xc517e5[_0x5d29('0x33')]=_[_0x5d29('0x34')](_0xc517e5['model'],_0xc517e5[_0x5d29('0x35')]);_0x13e29b[_0x5d29('0x36')]=_['intersection'](_0xc517e5['model'],qs[_0x5d29('0x37')](_0x225e95[_0x5d29('0x35')][_0x5d29('0x37')]));_0x13e29b[_0x5d29('0x36')]=_0x13e29b['attributes']['length']?_0x13e29b['attributes']:_0xc517e5[_0x5d29('0x31')];_0x13e29b[_0x5d29('0x3a')]=qs[_0x5d29('0x3b')](_0x225e95['query'][_0x5d29('0x3b')]);_0x13e29b[_0x5d29('0x3c')]=qs[_0x5d29('0x33')](_[_0x5d29('0x3d')](_0x225e95[_0x5d29('0x35')],_0xc517e5[_0x5d29('0x33')]));if(_0x225e95[_0x5d29('0x35')][_0x5d29('0x3e')]){_0x13e29b['where']=_[_0x5d29('0x3f')](_0x13e29b[_0x5d29('0x3c')],{'$or':_[_0x5d29('0x2e')](_0x13e29b['attributes'],function(_0x1fdf35){var _0xdae433={};_0xdae433[_0x1fdf35]={'$like':'%'+_0x225e95['query'][_0x5d29('0x3e')]+'%'};return _0xdae433;})});}_0x13e29b=_[_0x5d29('0x3f')]({},_0x13e29b,_0x225e95[_0x5d29('0x41')]);return _0x1ba8d9['getAgents'](_0x13e29b);}})[_0x5d29('0x27')](function(_0x3b6427){if(_0x3b6427){_0x28629f=_0x3b6427[_0x5d29('0x5e')];if(!_0x225e95[_0x5d29('0x35')][_0x5d29('0x38')](_0x5d29('0x39'))){_0x13e29b['limit']=qs['limit'](_0x225e95[_0x5d29('0x35')][_0x5d29('0x1f')]);_0x13e29b[_0x5d29('0x1d')]=qs['offset'](_0x225e95['query']['offset']);}return _0x1ba8d9[_0x5d29('0x9f')](_0x13e29b);}})['then'](function(_0x24a96a){if(_0x24a96a){return _0x24a96a?{'count':_0x28629f,'rows':_0x24a96a}:null;}})['then'](respondWithResult(_0x12d6b7,null))[_0x5d29('0x44')](handleError(_0x12d6b7,null));};function handleQuery(_0x590394){logger[_0x5d29('0xa1')](_0x590394);return db[_0x5d29('0x92')]['query'](_0x590394)['spread'](function(_0x4b1a62){csv_results[_0x5d29('0x63')](_0x4b1a62);})['catch'](function(_0x19c16b){logger[_0x5d29('0x4f')](_0x19c16b[_0x5d29('0x64')]);});} \ No newline at end of file +var _0x9437=['raw','getContactsCsv','ContactItemType','alias','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','field','c.cf_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','Sequelize','TEXT','number','BOOLEAN','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','info','message','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','squel','crypto','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','defaults','redis','socket.io-emitter','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','Lists','UserProfileResource','end','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','filter','CmList','includeAll','findAll','rows','catch','params','include','options','find','create','body','user','get','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','getDispositions','findOne','Disposition','nolimit','removeDispositions','ids','addContacts','CmContact','tags','join','isArray','push','each','omit','success','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','cf_%d','hasOwnProperty'];(function(_0x581008,_0x5e3da3){var _0x2dfaf7=function(_0x366812){while(--_0x366812){_0x581008['push'](_0x581008['shift']());}};_0x2dfaf7(++_0x5e3da3);}(_0x9437,0xd5));var _0x7943=function(_0x1ff21c,_0x2e9f03){_0x1ff21c=_0x1ff21c-0x0;var _0x571f26=_0x9437[_0x1ff21c];return _0x571f26;};'use strict';var emlformat=require(_0x7943('0x0'));var rimraf=require(_0x7943('0x1'));var zipdir=require(_0x7943('0x2'));var jsonpatch=require(_0x7943('0x3'));var rp=require(_0x7943('0x4'));var moment=require(_0x7943('0x5'));var BPromise=require(_0x7943('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7943('0x7'));var sox=require(_0x7943('0x8'));var csv=require(_0x7943('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7943('0xa'));var _=require('lodash');var squel=require(_0x7943('0xb'));var crypto=require(_0x7943('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7943('0xd'));var toCsv=require(_0x7943('0x9'));var querystring=require(_0x7943('0xe'));var Papa=require(_0x7943('0xf'));var Redis=require(_0x7943('0x10'));var authService=require(_0x7943('0x11'));var qs=require(_0x7943('0x12'));var as=require(_0x7943('0x13'));var hardwareService=require(_0x7943('0x14'));var logger=require('../../config/logger')(_0x7943('0x15'));var utils=require(_0x7943('0x16'));var config=require(_0x7943('0x17'));var licenseUtil=require(_0x7943('0x18'));var db=require(_0x7943('0x19'))['db'];var csv_results;config['redis']=_[_0x7943('0x1a')](config[_0x7943('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x7943('0x1c'))(new Redis(config['redis']));require('./cmList.socket')[_0x7943('0x1d')](socket);function respondWithStatusCode(_0x4780fb,_0x387954){_0x387954=_0x387954||0xcc;return function(_0x117591){if(_0x117591){return _0x4780fb[_0x7943('0x1e')](_0x387954);}return _0x4780fb['status'](_0x387954)['end']();};}function respondWithResult(_0x56fce6,_0x4b2bfc){_0x4b2bfc=_0x4b2bfc||0xc8;return function(_0x1ac378){if(_0x1ac378){return _0x56fce6[_0x7943('0x1f')](_0x4b2bfc)[_0x7943('0x20')](_0x1ac378);}};}function respondWithFilteredResult(_0x496811,_0x5f2a01){return function(_0x485538){if(_0x485538){var _0x2c400a=typeof _0x5f2a01['offset']===_0x7943('0x21')&&typeof _0x5f2a01[_0x7943('0x22')]===_0x7943('0x21');var _0x1e8976=_0x485538[_0x7943('0x23')];var _0x4c52b1=_0x2c400a?0x0:_0x5f2a01[_0x7943('0x24')];var _0x10f3a5=_0x2c400a?_0x485538[_0x7943('0x23')]:_0x5f2a01['offset']+_0x5f2a01[_0x7943('0x22')];var _0x46ec73;if(_0x10f3a5>=_0x1e8976){_0x10f3a5=_0x1e8976;_0x46ec73=0xc8;}else{_0x46ec73=0xce;}_0x496811[_0x7943('0x1f')](_0x46ec73);return _0x496811[_0x7943('0x25')](_0x7943('0x26'),_0x4c52b1+'-'+_0x10f3a5+'/'+_0x1e8976)['json'](_0x485538);}return null;};}function patchUpdates(_0x445a0c){return function(_0x135d50){try{jsonpatch[_0x7943('0x27')](_0x135d50,_0x445a0c,!![]);}catch(_0x11e585){return BPromise[_0x7943('0x28')](_0x11e585);}return _0x135d50[_0x7943('0x29')]();};}function saveUpdates(_0x372b30,_0x2c9129){return function(_0x16266f){if(_0x16266f){return _0x16266f[_0x7943('0x2a')](_0x372b30)['then'](function(_0x109087){return _0x109087;});}return null;};}function removeEntity(_0x30b543,_0xc0ffb1){return function(_0x2f4b8){if(_0x2f4b8){return _0x2f4b8[_0x7943('0x2b')]()[_0x7943('0x2c')](function(){var _0x17afa0=_0x2f4b8['get']({'plain':!![]});var _0x481e00=_0x7943('0x2d');return db[_0x7943('0x2e')][_0x7943('0x2b')]({'where':{'type':_0x481e00,'resourceId':_0x17afa0['id']}})[_0x7943('0x2c')](function(){return _0x2f4b8;});})[_0x7943('0x2c')](function(){_0x30b543[_0x7943('0x1f')](0xcc)[_0x7943('0x2f')]();});}};}function handleEntityNotFound(_0xb70622,_0x1958dd){return function(_0x43fd92){if(!_0x43fd92){_0xb70622[_0x7943('0x1e')](0x194);}return _0x43fd92;};}function handleError(_0x384882,_0x3c129c){_0x3c129c=_0x3c129c||0x1f4;return function(_0x41ad66){logger[_0x7943('0x30')](_0x41ad66[_0x7943('0x31')]);if(_0x41ad66[_0x7943('0x32')]){delete _0x41ad66['name'];}_0x384882[_0x7943('0x1f')](_0x3c129c)['send'](_0x41ad66);};}exports[_0x7943('0x33')]=function(_0x2fbf1b,_0x2b6f88){var _0x5e6a9a={},_0xf3307e={},_0x3b9aed={'count':0x0,'rows':[]};var _0x10f25f=_['map'](db['CmList'][_0x7943('0x34')],function(_0x37e5aa){return{'name':_0x37e5aa[_0x7943('0x35')],'type':_0x37e5aa[_0x7943('0x36')][_0x7943('0x37')]};});_0xf3307e[_0x7943('0x38')]=_[_0x7943('0x39')](_0x10f25f,_0x7943('0x32'));_0xf3307e['query']=_[_0x7943('0x3a')](_0x2fbf1b[_0x7943('0x3b')]);_0xf3307e[_0x7943('0x3c')]=_[_0x7943('0x3d')](_0xf3307e[_0x7943('0x38')],_0xf3307e['query']);_0x5e6a9a[_0x7943('0x3e')]=_[_0x7943('0x3d')](_0xf3307e[_0x7943('0x38')],qs[_0x7943('0x3f')](_0x2fbf1b[_0x7943('0x3b')][_0x7943('0x3f')]));_0x5e6a9a[_0x7943('0x3e')]=_0x5e6a9a[_0x7943('0x3e')][_0x7943('0x40')]?_0x5e6a9a[_0x7943('0x3e')]:_0xf3307e[_0x7943('0x38')];if(!_0x2fbf1b[_0x7943('0x3b')]['hasOwnProperty']('nolimit')){_0x5e6a9a['limit']=qs['limit'](_0x2fbf1b[_0x7943('0x3b')][_0x7943('0x22')]);_0x5e6a9a[_0x7943('0x24')]=qs[_0x7943('0x24')](_0x2fbf1b[_0x7943('0x3b')][_0x7943('0x24')]);}_0x5e6a9a[_0x7943('0x41')]=qs[_0x7943('0x42')](_0x2fbf1b['query'][_0x7943('0x42')]);_0x5e6a9a[_0x7943('0x43')]=qs[_0x7943('0x3c')](_[_0x7943('0x44')](_0x2fbf1b[_0x7943('0x3b')],_0xf3307e[_0x7943('0x3c')]),_0x10f25f);if(_0x2fbf1b[_0x7943('0x3b')]['filter']){_0x5e6a9a[_0x7943('0x43')]=_[_0x7943('0x45')](_0x5e6a9a['where'],{'$or':_[_0x7943('0x39')](_0x10f25f,function(_0x448fb6){if(_0x448fb6[_0x7943('0x36')]!=='VIRTUAL'){var _0x1fdfc4={};_0x1fdfc4[_0x448fb6[_0x7943('0x32')]]={'$like':'%'+_0x2fbf1b[_0x7943('0x3b')][_0x7943('0x46')]+'%'};return _0x1fdfc4;}})});}_0x5e6a9a=_[_0x7943('0x45')]({},_0x5e6a9a,_0x2fbf1b['options']);var _0x236e4a={'where':_0x5e6a9a[_0x7943('0x43')]};return db[_0x7943('0x47')][_0x7943('0x23')](_0x236e4a)[_0x7943('0x2c')](function(_0x449ba1){_0x3b9aed[_0x7943('0x23')]=_0x449ba1;if(_0x2fbf1b[_0x7943('0x3b')][_0x7943('0x48')]){_0x5e6a9a['include']=[{'all':!![]}];}return db['CmList'][_0x7943('0x49')](_0x5e6a9a);})[_0x7943('0x2c')](function(_0x1b7cc4){_0x3b9aed[_0x7943('0x4a')]=_0x1b7cc4;return _0x3b9aed;})[_0x7943('0x2c')](respondWithFilteredResult(_0x2b6f88,_0x5e6a9a))[_0x7943('0x4b')](handleError(_0x2b6f88,null));};exports['show']=function(_0xe9fff2,_0x2ff3c6){var _0x414e56={'raw':![],'where':{'id':_0xe9fff2[_0x7943('0x4c')]['id']}},_0x2a8dab={};_0x2a8dab[_0x7943('0x38')]=_[_0x7943('0x3a')](db[_0x7943('0x47')][_0x7943('0x34')]);_0x2a8dab[_0x7943('0x3b')]=_[_0x7943('0x3a')](_0xe9fff2['query']);_0x2a8dab['filters']=_['intersection'](_0x2a8dab[_0x7943('0x38')],_0x2a8dab[_0x7943('0x3b')]);_0x414e56[_0x7943('0x3e')]=_[_0x7943('0x3d')](_0x2a8dab['model'],qs[_0x7943('0x3f')](_0xe9fff2[_0x7943('0x3b')][_0x7943('0x3f')]));_0x414e56[_0x7943('0x3e')]=_0x414e56[_0x7943('0x3e')][_0x7943('0x40')]?_0x414e56[_0x7943('0x3e')]:_0x2a8dab['model'];if(_0xe9fff2[_0x7943('0x3b')][_0x7943('0x48')]){_0x414e56[_0x7943('0x4d')]=[{'all':!![]}];}_0x414e56=_[_0x7943('0x45')]({},_0x414e56,_0xe9fff2[_0x7943('0x4e')]);return db[_0x7943('0x47')][_0x7943('0x4f')](_0x414e56)[_0x7943('0x2c')](handleEntityNotFound(_0x2ff3c6,null))[_0x7943('0x2c')](respondWithResult(_0x2ff3c6,null))[_0x7943('0x4b')](handleError(_0x2ff3c6,null));};exports['create']=function(_0x15ebd7,_0x1e1654){return db['CmList'][_0x7943('0x50')](_0x15ebd7[_0x7943('0x51')],{})[_0x7943('0x2c')](function(_0x4c5ca8){var _0x2e5f55=_0x15ebd7[_0x7943('0x52')][_0x7943('0x53')]({'plain':!![]});if(!_0x2e5f55)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e5f55[_0x7943('0x54')]==='user'){var _0x5b603c=_0x4c5ca8[_0x7943('0x53')]({'plain':!![]});var _0x454519='Lists';return db['UserProfileSection'][_0x7943('0x4f')]({'where':{'name':_0x454519,'userProfileId':_0x2e5f55[_0x7943('0x55')]},'raw':!![]})['then'](function(_0x3b8033){if(_0x3b8033&&_0x3b8033[_0x7943('0x56')]===0x0){return db[_0x7943('0x2e')][_0x7943('0x50')]({'name':_0x5b603c[_0x7943('0x32')],'resourceId':_0x5b603c['id'],'type':_0x3b8033['name'],'sectionId':_0x3b8033['id']},{})[_0x7943('0x2c')](function(){return _0x4c5ca8;});}else{return _0x4c5ca8;}})['catch'](function(_0x3b7485){logger['error'](_0x7943('0x57'),_0x3b7485);throw _0x3b7485;});}return _0x4c5ca8;})['then'](respondWithResult(_0x1e1654,0xc9))['catch'](handleError(_0x1e1654,null));};exports[_0x7943('0x2a')]=function(_0x4160af,_0x264de4){if(_0x4160af[_0x7943('0x51')]['id']){delete _0x4160af['body']['id'];}return db[_0x7943('0x47')][_0x7943('0x4f')]({'where':{'id':_0x4160af[_0x7943('0x4c')]['id']}})[_0x7943('0x2c')](handleEntityNotFound(_0x264de4,null))[_0x7943('0x2c')](saveUpdates(_0x4160af[_0x7943('0x51')],null))['then'](respondWithResult(_0x264de4,null))[_0x7943('0x4b')](handleError(_0x264de4,null));};exports[_0x7943('0x2b')]=function(_0x56c63a,_0x3df790){return db[_0x7943('0x47')]['find']({'where':{'id':_0x56c63a[_0x7943('0x4c')]['id']}})[_0x7943('0x2c')](handleEntityNotFound(_0x3df790,null))[_0x7943('0x2c')](removeEntity(_0x3df790,null))[_0x7943('0x4b')](handleError(_0x3df790,null));};exports['describe']=function(_0x237853,_0x374aed){return db[_0x7943('0x47')][_0x7943('0x58')]()[_0x7943('0x2c')](respondWithResult(_0x374aed,null))['catch'](handleError(_0x374aed,null));};exports[_0x7943('0x59')]=function(_0x5dfd3a,_0x4cb298,_0x187524){if(_0x5dfd3a[_0x7943('0x51')]['id']){delete _0x5dfd3a[_0x7943('0x51')]['id'];}return db['CmList'][_0x7943('0x4f')]({'where':{'id':_0x5dfd3a[_0x7943('0x4c')]['id']}})[_0x7943('0x2c')](handleEntityNotFound(_0x4cb298,null))['then'](function(_0x2e471d){if(_0x2e471d){_0x5dfd3a[_0x7943('0x51')][_0x7943('0x5a')]=_0x2e471d['id'];return db['Disposition']['create'](_0x5dfd3a[_0x7943('0x51')]);}})['then'](respondWithResult(_0x4cb298,null))['catch'](handleError(_0x4cb298,null));};exports[_0x7943('0x5b')]=function(_0x1a17f5,_0x31c9ba,_0x42d694){var _0x2d6ad2={'raw':![],'where':{}};var _0x5a6c4b={};var _0x2b616f={'count':0x0,'rows':[]};return db[_0x7943('0x47')][_0x7943('0x5c')]({'where':{'id':_0x1a17f5['params']['id']}})[_0x7943('0x2c')](handleEntityNotFound(_0x31c9ba,null))[_0x7943('0x2c')](function(_0x348131){if(_0x348131){_0x5a6c4b[_0x7943('0x38')]=_[_0x7943('0x3a')](db[_0x7943('0x5d')]['rawAttributes']);_0x5a6c4b[_0x7943('0x3b')]=_[_0x7943('0x3a')](_0x1a17f5[_0x7943('0x3b')]);_0x5a6c4b[_0x7943('0x3c')]=_['intersection'](_0x5a6c4b['model'],_0x5a6c4b['query']);_0x2d6ad2[_0x7943('0x3e')]=_['intersection'](_0x5a6c4b['model'],qs[_0x7943('0x3f')](_0x1a17f5[_0x7943('0x3b')][_0x7943('0x3f')]));_0x2d6ad2[_0x7943('0x3e')]=_0x2d6ad2[_0x7943('0x3e')][_0x7943('0x40')]?_0x2d6ad2[_0x7943('0x3e')]:_0x5a6c4b[_0x7943('0x38')];if(!_0x1a17f5[_0x7943('0x3b')]['hasOwnProperty'](_0x7943('0x5e'))){_0x2d6ad2[_0x7943('0x22')]=qs[_0x7943('0x22')](_0x1a17f5[_0x7943('0x3b')][_0x7943('0x22')]);_0x2d6ad2[_0x7943('0x24')]=qs['offset'](_0x1a17f5[_0x7943('0x3b')][_0x7943('0x24')]);}_0x2d6ad2[_0x7943('0x41')]=qs[_0x7943('0x42')](_0x1a17f5[_0x7943('0x3b')]['sort']);_0x2d6ad2['where']=qs['filters'](_['pick'](_0x1a17f5[_0x7943('0x3b')],_0x5a6c4b[_0x7943('0x3c')]));_0x2d6ad2[_0x7943('0x43')][_0x7943('0x5a')]=_0x348131['id'];if(_0x1a17f5[_0x7943('0x3b')][_0x7943('0x46')]){_0x2d6ad2[_0x7943('0x43')]=_[_0x7943('0x45')](_0x2d6ad2[_0x7943('0x43')],{'$or':_[_0x7943('0x39')](_0x2d6ad2[_0x7943('0x3e')],function(_0x3a2f3d){var _0x952722={};_0x952722[_0x3a2f3d]={'$like':'%'+_0x1a17f5['query'][_0x7943('0x46')]+'%'};return _0x952722;})});}_0x2d6ad2=_['merge']({},_0x2d6ad2,_0x1a17f5[_0x7943('0x4e')]);return db[_0x7943('0x5d')][_0x7943('0x23')]({'where':_0x2d6ad2[_0x7943('0x43')]})[_0x7943('0x2c')](function(_0x1463a2){_0x2b616f[_0x7943('0x23')]=_0x1463a2;if(_0x1a17f5[_0x7943('0x3b')][_0x7943('0x48')]){_0x2d6ad2[_0x7943('0x4d')]=[{'all':!![]}];}return db[_0x7943('0x5d')][_0x7943('0x49')](_0x2d6ad2);})[_0x7943('0x2c')](function(_0x31c05d){_0x2b616f[_0x7943('0x4a')]=_0x31c05d;return _0x2b616f;});}})['then'](respondWithFilteredResult(_0x31c9ba,_0x2d6ad2))['catch'](handleError(_0x31c9ba,null));};exports[_0x7943('0x5f')]=function(_0x2199c1,_0x254d6d,_0x370989){return db['CmList'][_0x7943('0x4f')]({'where':{'id':_0x2199c1[_0x7943('0x4c')]['id']}})[_0x7943('0x2c')](handleEntityNotFound(_0x254d6d,null))[_0x7943('0x2c')](function(_0x3c796f){if(_0x3c796f){return _0x3c796f[_0x7943('0x5f')](_0x2199c1[_0x7943('0x3b')][_0x7943('0x60')]);}})[_0x7943('0x2c')](respondWithStatusCode(_0x254d6d,null))[_0x7943('0x4b')](handleError(_0x254d6d,null));};exports[_0x7943('0x61')]=function(_0x5ab28d,_0xba6354,_0x4e327f){return db[_0x7943('0x47')][_0x7943('0x4f')]({'where':{'id':_0x5ab28d[_0x7943('0x4c')]['id']}})[_0x7943('0x2c')](handleEntityNotFound(_0xba6354,null))['then'](function(_0x382f85){if(_0x382f85){var _0x4697b2=[];var _0x135e93={'success':[],'errors':[]};return db[_0x7943('0x62')]['describe']()[_0x7943('0x2c')](function(_0x511f98){if(_0x5ab28d['body'][_0x7943('0x63')]&&_['isArray'](_0x5ab28d[_0x7943('0x51')][_0x7943('0x63')])){if(_0x5ab28d[_0x7943('0x51')][_0x7943('0x63')][_0x7943('0x40')]){_0x5ab28d['body'][_0x7943('0x63')]=_0x5ab28d[_0x7943('0x51')]['tags'][_0x7943('0x64')](';')+';';}else{_0x5ab28d[_0x7943('0x51')][_0x7943('0x63')]=null;}}else{_0x5ab28d[_0x7943('0x51')][_0x7943('0x63')]=null;}if(_0x5ab28d['body']&&_[_0x7943('0x65')](_0x5ab28d[_0x7943('0x51')])){for(var _0x403765=0x0;_0x403765<_0x5ab28d['body'][_0x7943('0x40')];_0x403765+=0x1){_0x5ab28d['body'][_0x403765][_0x7943('0x5a')]=_0x5ab28d[_0x7943('0x4c')]['id'];_0x4697b2[_0x7943('0x66')](_0x5ab28d[_0x7943('0x51')][_0x403765]);}return BPromise[_0x7943('0x67')](_0x4697b2,function(_0x4718d0){return db[_0x7943('0x62')][_0x7943('0x50')](_[_0x7943('0x68')](_0x4718d0,['ids','id'])||{},{'fields':_['keys'](_0x511f98),'raw':!![]})[_0x7943('0x2c')](function(_0x31be58){_0x135e93[_0x7943('0x69')]['push'](_0x31be58[_0x7943('0x6a')]);})[_0x7943('0x4b')](function(_0x1af3d4){_0x135e93[_0x7943('0x6b')]['push']({'data':_0x4718d0,'error':_0x1af3d4['message']});});})[_0x7943('0x2c')](function(_0x55eca0){return _0x135e93;})[_0x7943('0x4b')](function(_0x3f9d98){return _0x3f9d98;});}else{_0xba6354[_0x7943('0x1f')](0x190)['json']({'message':_0x7943('0x6c')});}});}})[_0x7943('0x2c')](respondWithResult(_0xba6354,null))['catch'](handleError(_0xba6354,null));};exports[_0x7943('0x6d')]=function(_0x3fe50e,_0x4e584a,_0x3f1804){var _0x2accfa;return db['CmList']['find']({'where':{'id':_0x3fe50e[_0x7943('0x4c')]['id']},'include':[{'model':db[_0x7943('0x6e')],'as':_0x7943('0x6f')}]})[_0x7943('0x2c')](handleEntityNotFound(_0x4e584a,null))[_0x7943('0x2c')](function(_0x505979){if(_0x505979){_0x2accfa=_0x505979;return db['CmContact'][_0x7943('0x34')];}})[_0x7943('0x2c')](function(_0xd942df){if(_0xd942df){var _0x1ce9ff={};var _0x40045b={};_0x40045b[_0x7943('0x38')]=_['concat'](_[_0x7943('0x3a')](_0xd942df),_['map'](_0x2accfa['CustomFields'],function(_0x56045b){return util[_0x7943('0x70')](_0x7943('0x71'),_0x56045b['id']);}));_0x40045b[_0x7943('0x3b')]=_[_0x7943('0x3a')](_0x3fe50e['query']);_0x40045b[_0x7943('0x3c')]=_['intersection'](_0x40045b['model'],_0x40045b['query']);_0x1ce9ff[_0x7943('0x3e')]=_[_0x7943('0x3d')](_0x40045b[_0x7943('0x38')],qs[_0x7943('0x3f')](_0x3fe50e[_0x7943('0x3b')][_0x7943('0x3f')]));_0x1ce9ff[_0x7943('0x3e')]=_0x1ce9ff['attributes']['length']?_0x1ce9ff[_0x7943('0x3e')]:_0x40045b['model'];if(!_0x3fe50e[_0x7943('0x3b')][_0x7943('0x72')](_0x7943('0x5e'))){_0x1ce9ff[_0x7943('0x22')]=qs['limit'](_0x3fe50e[_0x7943('0x3b')]['limit']);_0x1ce9ff[_0x7943('0x24')]=qs[_0x7943('0x24')](_0x3fe50e[_0x7943('0x3b')]['offset']);}_0x1ce9ff[_0x7943('0x41')]=qs['sort'](_0x3fe50e[_0x7943('0x3b')][_0x7943('0x42')]);_0x1ce9ff[_0x7943('0x43')]=qs[_0x7943('0x3c')](_[_0x7943('0x44')](_0x3fe50e['query'],_0x40045b[_0x7943('0x3c')]));_0x1ce9ff[_0x7943('0x73')]=!![];if(_0x3fe50e[_0x7943('0x3b')][_0x7943('0x46')]){_0x1ce9ff['where']=_['merge'](_0x1ce9ff[_0x7943('0x43')],{'$or':_[_0x7943('0x39')](_0x1ce9ff['attributes'],function(_0x4f13ae){var _0x348c55={};_0x348c55[_0x4f13ae]={'$like':'%'+_0x3fe50e[_0x7943('0x3b')]['filter']+'%'};return _0x348c55;})});}_0x1ce9ff=_[_0x7943('0x45')]({},_0x1ce9ff,_0x3fe50e['options']);return _0x2accfa['getContacts'](_0x1ce9ff);}})['then'](respondWithResult(_0x4e584a,null))[_0x7943('0x4b')](handleError(_0x4e584a,null));};exports[_0x7943('0x74')]=function(_0x15772d,_0x2a592d,_0x2c2a5e){var _0x2112e3;var _0x4454ae;var _0x21bb12;var _0x2b6871=_0x15772d[_0x7943('0x4c')]['id'];csv_results=[];return db[_0x7943('0x75')]['findAll']({'attributes':['id',_0x7943('0x32')],'raw':!![],'order':['OrderBy']})[_0x7943('0x2c')](function(_0x2aa758){_0x2112e3=_0x2aa758;var _0x2110e8=_[_0x7943('0x3a')](db['CmContact'][_0x7943('0x34')]);return db[_0x7943('0x6e')][_0x7943('0x49')]({'raw':!![],'attributes':['id',_0x7943('0x76')]})[_0x7943('0x2c')](function(_0x3c83ef){_0x4454ae=_0x3c83ef;var _0x5d6575=squel[_0x7943('0x77')]()[_0x7943('0x3f')](_0x2110e8)[_0x7943('0x78')](_0x7943('0x79'),'c')[_0x7943('0x43')](_0x7943('0x7a'),_0x2b6871)[_0x7943('0x43')](_0x7943('0x7b'))['distinct']();for(var _0x14674c=0x0;_0x14674c<_0x4454ae['length'];_0x14674c++){_0x5d6575[_0x7943('0x7c')](_0x7943('0x7d')+_0x4454ae[_0x14674c]['id'],'customField_'+_0x4454ae[_0x14674c][_0x7943('0x76')]);}for(var _0x14674c=0x0;_0x14674c<_0x2112e3[_0x7943('0x40')];_0x14674c++){_0x5d6575[_0x7943('0x7c')](squel['select']()[_0x7943('0x7c')](_0x7943('0x7e'))[_0x7943('0x78')](_0x7943('0x7f'))[_0x7943('0x43')](_0x7943('0x80'),_0x2112e3[_0x14674c]['id'])[_0x7943('0x43')](_0x7943('0x81')),_0x7943('0x82')+_0x2112e3[_0x14674c][_0x7943('0x32')]);_0x5d6575['field'](squel[_0x7943('0x77')]()[_0x7943('0x7c')](_0x7943('0x83'))[_0x7943('0x78')](_0x7943('0x7f'))[_0x7943('0x43')](_0x7943('0x80'),_0x2112e3[_0x14674c]['id'])[_0x7943('0x43')](_0x7943('0x81')),_0x7943('0x84')+_0x2112e3[_0x14674c]['name']);}var _0x17fcb2=[];_0x17fcb2[_0x7943('0x66')](_0x5d6575['toString']());BPromise[_0x7943('0x67')](_0x17fcb2,handleQuery)[_0x7943('0x2c')](function(_0x44224f){handleQuery(_0x5d6575[_0x7943('0x85')]());var _0x2bdba0=csv_results[0x0];if(!_[_0x7943('0x86')](_0x2bdba0)){var _0x54585a=toCsv(_0x2bdba0);var _0x5d17a8=Date[_0x7943('0x87')]();fs[_0x7943('0x88')](util['format'](_0x7943('0x89'),_0x2b6871,_0x5d17a8),_0x54585a);_0x2a592d[_0x7943('0x8a')](_0x7943('0x8b'),_0x7943('0x8c')+util[_0x7943('0x70')](_0x7943('0x8d'),_0x2b6871,_0x5d17a8));_0x2a592d[_0x7943('0x8a')](_0x7943('0x8e'),_0x7943('0x8f'));return _0x2a592d[_0x7943('0x90')](util[_0x7943('0x70')](_0x7943('0x89'),_0x2b6871,_0x5d17a8));}else{return _0x2a592d[_0x7943('0x1e')](0xcc);}});});});};exports[_0x7943('0x91')]=function(_0x25efd8,_0x50d3b1,_0x59cb82){var _0x11f992;delete _0x25efd8[_0x7943('0x51')]['id'];return db[_0x7943('0x47')][_0x7943('0x5c')]({'where':{'id':_0x25efd8[_0x7943('0x4c')]['id']}})['then'](handleEntityNotFound(_0x50d3b1,null))[_0x7943('0x2c')](function(_0x5e7d8a){if(_0x5e7d8a){return db[_0x7943('0x92')][_0x7943('0x93')](function(_0x28d179){return db[_0x7943('0x6e')][_0x7943('0x50')](_0x25efd8['body'],{'transaction':_0x28d179})['then'](function(_0x39b4ff){_0x11f992=_0x39b4ff;return _0x5e7d8a['addCustomFields'](_0x39b4ff,{'transaction':_0x28d179});})['then'](function(){var _0x34e577={'type':db[_0x7943('0x94')][_0x7943('0x95')],'transaction':_0x28d179};switch(_0x25efd8[_0x7943('0x51')][_0x7943('0x36')]){case'text':_0x34e577[_0x7943('0x36')]=db['Sequelize'][_0x7943('0x95')];break;case _0x7943('0x96'):_0x34e577[_0x7943('0x36')]=db[_0x7943('0x94')]['INTEGER'];break;case'switch':_0x34e577[_0x7943('0x36')]=db[_0x7943('0x94')][_0x7943('0x97')];_0x34e577['defaultValue']=![];break;default:}return db[_0x7943('0x92')]['queryInterface'][_0x7943('0x98')](_0x7943('0x79'),util[_0x7943('0x70')](_0x7943('0x99'),_0x11f992['id']),_0x34e577);})[_0x7943('0x2c')](function(){return _0x11f992;});});}})[_0x7943('0x2c')](respondWithResult(_0x50d3b1,null))['catch'](handleError(_0x50d3b1,null));};exports[_0x7943('0x9a')]=function(_0x2444e4,_0x4e43ac,_0x3c24c5){var _0x247ff0={};var _0x595613={};var _0x264aa0;var _0x4dc9e3;return db[_0x7943('0x47')][_0x7943('0x5c')]({'where':{'id':_0x2444e4[_0x7943('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4e43ac,null))[_0x7943('0x2c')](function(_0x8975f){if(_0x8975f){_0x264aa0=_0x8975f;_0x595613[_0x7943('0x38')]=_[_0x7943('0x3a')](db[_0x7943('0x6e')][_0x7943('0x34')]);_0x595613[_0x7943('0x3b')]=_[_0x7943('0x3a')](_0x2444e4[_0x7943('0x3b')]);_0x595613[_0x7943('0x3c')]=_['intersection'](_0x595613[_0x7943('0x38')],_0x595613[_0x7943('0x3b')]);_0x247ff0[_0x7943('0x3e')]=_[_0x7943('0x3d')](_0x595613[_0x7943('0x38')],qs[_0x7943('0x3f')](_0x2444e4['query'][_0x7943('0x3f')]));_0x247ff0[_0x7943('0x3e')]=_0x247ff0['attributes'][_0x7943('0x40')]?_0x247ff0[_0x7943('0x3e')]:_0x595613['model'];_0x247ff0[_0x7943('0x41')]=qs[_0x7943('0x42')](_0x2444e4[_0x7943('0x3b')][_0x7943('0x42')]);_0x247ff0[_0x7943('0x43')]=qs[_0x7943('0x3c')](_[_0x7943('0x44')](_0x2444e4['query'],_0x595613[_0x7943('0x3c')]));_0x247ff0[_0x7943('0x43')]=_[_0x7943('0x45')](_0x247ff0[_0x7943('0x43')],{'$or':[{'ListId':_0x8975f['id']},{'ListId':null}]});if(_0x2444e4['query'][_0x7943('0x46')]){_0x247ff0[_0x7943('0x43')]=_['merge'](_0x247ff0[_0x7943('0x43')],{'$or':_[_0x7943('0x39')](_0x247ff0[_0x7943('0x3e')],function(_0x43949f){var _0x40c49a={};_0x40c49a[_0x43949f]={'$like':'%'+_0x2444e4['query'][_0x7943('0x46')]+'%'};return _0x40c49a;})});}_0x247ff0=_[_0x7943('0x45')]({},_0x247ff0,_0x2444e4[_0x7943('0x4e')]);return db['CmCustomField'][_0x7943('0x9b')](_0x247ff0);}})['then'](respondWithResult(_0x4e43ac,null))[_0x7943('0x4b')](handleError(_0x4e43ac,null));};exports[_0x7943('0x9c')]=function(_0x3b42a0,_0x33725d){return db[_0x7943('0x6e')][_0x7943('0x9b')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x33725d,null))[_0x7943('0x2c')](function(_0x4ecc7e){return _0x4ecc7e;})['then'](respondWithResult(_0x33725d,null))['catch'](handleError(_0x33725d,null));};exports['addAgents']=function(_0x53db50,_0x3dba1a,_0x396bbd){return db[_0x7943('0x47')]['find']({'where':{'id':_0x53db50[_0x7943('0x4c')]['id']}})[_0x7943('0x2c')](handleEntityNotFound(_0x3dba1a,null))[_0x7943('0x2c')](function(_0x5924cc){if(_0x5924cc){return _0x5924cc['addAgents'](_0x53db50[_0x7943('0x51')]['ids'],_[_0x7943('0x68')](_0x53db50['body'],['ids','id'])||{})['spread'](function(_0x14e4cc){for(var _0x5e63ad=0x0;_0x5e63ad<_0x53db50[_0x7943('0x51')][_0x7943('0x60')][_0x7943('0x40')];_0x5e63ad+=0x1){socket['emit'](_0x7943('0x9d'),{'UserId':Number(_0x53db50[_0x7943('0x51')][_0x7943('0x60')][_0x5e63ad]),'CmListId':Number(_0x53db50[_0x7943('0x4c')]['id'])});}return _0x14e4cc;});}})[_0x7943('0x2c')](respondWithResult(_0x3dba1a,null))[_0x7943('0x4b')](handleError(_0x3dba1a,null));};exports[_0x7943('0x9e')]=function(_0x357a69,_0x40c74d,_0x5dfd0f){return db['CmList'][_0x7943('0x4f')]({'where':{'id':_0x357a69['params']['id']}})[_0x7943('0x2c')](handleEntityNotFound(_0x40c74d,null))[_0x7943('0x2c')](function(_0x382228){if(_0x382228){return _0x382228[_0x7943('0x9e')](_0x357a69[_0x7943('0x3b')][_0x7943('0x60')])[_0x7943('0x2c')](function(){if(_['isArray'](_0x357a69[_0x7943('0x3b')][_0x7943('0x60')])){for(var _0x34e597=0x0;_0x34e597<_0x357a69['query'][_0x7943('0x60')][_0x7943('0x40')];_0x34e597+=0x1){socket[_0x7943('0x9f')](_0x7943('0xa0'),{'UserId':Number(_0x357a69[_0x7943('0x3b')]['ids'][_0x34e597]),'CmListId':Number(_0x357a69[_0x7943('0x4c')]['id'])});}}else{socket[_0x7943('0x9f')](_0x7943('0xa0'),{'UserId':Number(_0x357a69['query'][_0x7943('0x60')]),'CmListId':Number(_0x357a69[_0x7943('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x40c74d,null))['catch'](handleError(_0x40c74d,null));};exports[_0x7943('0xa1')]=function(_0x5f0132,_0x70badf,_0x278db4){var _0x1b7cfa={};var _0x3d25c1={};var _0x45020a;var _0x4a26a0;return db[_0x7943('0x47')][_0x7943('0x5c')]({'where':{'id':_0x5f0132[_0x7943('0x4c')]['id']}})['then'](handleEntityNotFound(_0x70badf,null))['then'](function(_0x3d2c66){if(_0x3d2c66){_0x45020a=_0x3d2c66;_0x3d25c1[_0x7943('0x38')]=_[_0x7943('0x3a')](db['User']['rawAttributes']);_0x3d25c1[_0x7943('0x3b')]=_[_0x7943('0x3a')](_0x5f0132[_0x7943('0x3b')]);_0x3d25c1[_0x7943('0x3c')]=_['intersection'](_0x3d25c1[_0x7943('0x38')],_0x3d25c1[_0x7943('0x3b')]);_0x1b7cfa[_0x7943('0x3e')]=_[_0x7943('0x3d')](_0x3d25c1[_0x7943('0x38')],qs[_0x7943('0x3f')](_0x5f0132['query']['fields']));_0x1b7cfa[_0x7943('0x3e')]=_0x1b7cfa[_0x7943('0x3e')][_0x7943('0x40')]?_0x1b7cfa[_0x7943('0x3e')]:_0x3d25c1[_0x7943('0x38')];_0x1b7cfa[_0x7943('0x41')]=qs[_0x7943('0x42')](_0x5f0132[_0x7943('0x3b')][_0x7943('0x42')]);_0x1b7cfa[_0x7943('0x43')]=qs[_0x7943('0x3c')](_[_0x7943('0x44')](_0x5f0132[_0x7943('0x3b')],_0x3d25c1[_0x7943('0x3c')]));if(_0x5f0132[_0x7943('0x3b')][_0x7943('0x46')]){_0x1b7cfa[_0x7943('0x43')]=_[_0x7943('0x45')](_0x1b7cfa['where'],{'$or':_[_0x7943('0x39')](_0x1b7cfa[_0x7943('0x3e')],function(_0x3bd333){var _0x43b444={};_0x43b444[_0x3bd333]={'$like':'%'+_0x5f0132[_0x7943('0x3b')][_0x7943('0x46')]+'%'};return _0x43b444;})});}_0x1b7cfa=_[_0x7943('0x45')]({},_0x1b7cfa,_0x5f0132[_0x7943('0x4e')]);return _0x45020a[_0x7943('0xa1')](_0x1b7cfa);}})[_0x7943('0x2c')](function(_0x5725f5){if(_0x5725f5){_0x4a26a0=_0x5725f5[_0x7943('0x40')];if(!_0x5f0132[_0x7943('0x3b')][_0x7943('0x72')]('nolimit')){_0x1b7cfa[_0x7943('0x22')]=qs[_0x7943('0x22')](_0x5f0132[_0x7943('0x3b')][_0x7943('0x22')]);_0x1b7cfa[_0x7943('0x24')]=qs[_0x7943('0x24')](_0x5f0132[_0x7943('0x3b')][_0x7943('0x24')]);}return _0x45020a[_0x7943('0xa1')](_0x1b7cfa);}})[_0x7943('0x2c')](function(_0x5e913b){if(_0x5e913b){return _0x5e913b?{'count':_0x4a26a0,'rows':_0x5e913b}:null;}})['then'](respondWithResult(_0x70badf,null))[_0x7943('0x4b')](handleError(_0x70badf,null));};function handleQuery(_0x499806){logger[_0x7943('0xa2')](_0x499806);return db[_0x7943('0x92')][_0x7943('0x3b')](_0x499806)['spread'](function(_0x135309){csv_results[_0x7943('0x66')](_0x135309);})[_0x7943('0x4b')](function(_0x2abe92){logger[_0x7943('0x30')](_0x2abe92[_0x7943('0xa3')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 9315d15..42b9e1b 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x2df4cc,_0x1233c6){var _0x40af8d=function(_0x5e0f2a){while(--_0x5e0f2a){_0x2df4cc['push'](_0x2df4cc['shift']());}};_0x40af8d(++_0x1233c6);}(_0x814b,0x1a2));var _0xb814=function(_0x4653f7,_0x3d3ae3){_0x4653f7=_0x4653f7-0x0;var _0x5454da=_0x814b[_0x4653f7];return _0x5454da;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file +var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x5bc18d,_0x4a1372){var _0x32a08e=function(_0x22d348){while(--_0x22d348){_0x5bc18d['push'](_0x5bc18d['shift']());}};_0x32a08e(++_0x4a1372);}(_0x7217,0x19e));var _0x7721=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x7217[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index db84a39..d02231e 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 _0xd64b=['define','CmList','cm_lists','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x258c5e,_0x407908){var _0x4ce92e=function(_0x1fd85e){while(--_0x1fd85e){_0x258c5e['push'](_0x258c5e['shift']());}};_0x4ce92e(++_0x407908);}(_0xd64b,0xc1));var _0xbd64=function(_0x367577,_0x3c0484){_0x367577=_0x367577-0x0;var _0x1865c6=_0xd64b[_0x367577];return _0x1865c6;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var logger=require(_0xbd64('0x1'))('api');var moment=require(_0xbd64('0x2'));var BPromise=require(_0xbd64('0x3'));var rp=require(_0xbd64('0x4'));var fs=require('fs');var path=require(_0xbd64('0x5'));var rimraf=require(_0xbd64('0x6'));var config=require('../../config/environment');var attributes=require('./cmList.attributes');module['exports']=function(_0x51e87d,_0x58e9e7){return _0x51e87d[_0xbd64('0x7')](_0xbd64('0x8'),attributes,{'tableName':_0xbd64('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99e9=['util','../../config/logger','api','moment','request-promise','path','rimraf','./cmList.attributes','define','CmList'];(function(_0x347d0e,_0x596808){var _0x236754=function(_0x54695c){while(--_0x54695c){_0x347d0e['push'](_0x347d0e['shift']());}};_0x236754(++_0x596808);}(_0x99e9,0xb4));var _0x999e=function(_0x19997d,_0x2c92a4){_0x19997d=_0x19997d-0x0;var _0x49be7f=_0x99e9[_0x19997d];return _0x49be7f;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var logger=require(_0x999e('0x1'))(_0x999e('0x2'));var moment=require(_0x999e('0x3'));var BPromise=require('bluebird');var rp=require(_0x999e('0x4'));var fs=require('fs');var path=require(_0x999e('0x5'));var rimraf=require(_0x999e('0x6'));var config=require('../../config/environment');var attributes=require(_0x999e('0x7'));module['exports']=function(_0x25421f,_0x1bda0a){return _0x25421f[_0x999e('0x8')](_0x999e('0x9'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 88514f1..37011a9 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 _0x1796=['./cmList.socket','register','then','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter'];(function(_0x2f7aa6,_0x5dce5e){var _0x476da5=function(_0x48e0ad){while(--_0x48e0ad){_0x2f7aa6['push'](_0x2f7aa6['shift']());}};_0x476da5(++_0x5dce5e);}(_0x1796,0x1e8));var _0x6179=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x1796[_0x24237f];return _0x48298e;};'use strict';var _=require(_0x6179('0x0'));var util=require('util');var moment=require(_0x6179('0x1'));var BPromise=require(_0x6179('0x2'));var rs=require(_0x6179('0x3'));var fs=require('fs');var Redis=require(_0x6179('0x4'));var db=require(_0x6179('0x5'))['db'];var utils=require(_0x6179('0x6'));var logger=require(_0x6179('0x7'))(_0x6179('0x8'));var config=require(_0x6179('0x9'));var jayson=require(_0x6179('0xa'));var client=jayson[_0x6179('0xb')][_0x6179('0xc')]({'port':0x232a});config[_0x6179('0xd')]=_[_0x6179('0xe')](config[_0x6179('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x6179('0xf'))(new Redis(config[_0x6179('0xd')]));require(_0x6179('0x10'))[_0x6179('0x11')](socket);function respondWithRpcPromise(_0x38a0dd,_0x296720,_0x28b272){return new BPromise(function(_0x2b2626,_0x263e4e){return client['request'](_0x38a0dd,_0x28b272)[_0x6179('0x12')](function(_0x201ef6){logger['info'](_0x6179('0x13'),_0x296720,_0x6179('0x14'));logger['debug'](_0x6179('0x15'),_0x296720,'request\x20sent',JSON[_0x6179('0x16')](_0x201ef6));if(_0x201ef6['error']){if(_0x201ef6[_0x6179('0x17')][_0x6179('0x18')]===0x1f4){logger[_0x6179('0x17')]('CmList,\x20%s,\x20%s',_0x296720,_0x201ef6[_0x6179('0x17')]['message']);return _0x263e4e(_0x201ef6[_0x6179('0x17')][_0x6179('0x19')]);}logger[_0x6179('0x17')](_0x6179('0x13'),_0x296720,_0x201ef6[_0x6179('0x17')][_0x6179('0x19')]);return _0x2b2626(_0x201ef6[_0x6179('0x17')][_0x6179('0x19')]);}else{logger[_0x6179('0x1a')](_0x6179('0x13'),_0x296720,_0x6179('0x14'));_0x2b2626(_0x201ef6[_0x6179('0x1b')][_0x6179('0x19')]);}})['catch'](function(_0x5add91){logger[_0x6179('0x17')]('CmList,\x20%s,\x20%s',_0x296720,_0x5add91);_0x263e4e(_0x5add91);});});} \ No newline at end of file +var _0xa034=['../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','stringify','error','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x17c5ae,_0x233499){var _0x39eab9=function(_0x13f419){while(--_0x13f419){_0x17c5ae['push'](_0x17c5ae['shift']());}};_0x39eab9(++_0x233499);}(_0xa034,0x1d8));var _0x4a03=function(_0x3711e2,_0x1468e1){_0x3711e2=_0x3711e2-0x0;var _0x18a556=_0xa034[_0x3711e2];return _0x18a556;};'use strict';var _=require(_0x4a03('0x0'));var util=require('util');var moment=require(_0x4a03('0x1'));var BPromise=require(_0x4a03('0x2'));var rs=require(_0x4a03('0x3'));var fs=require('fs');var Redis=require(_0x4a03('0x4'));var db=require(_0x4a03('0x5'))['db'];var utils=require(_0x4a03('0x6'));var logger=require('../../config/logger')(_0x4a03('0x7'));var config=require(_0x4a03('0x8'));var jayson=require(_0x4a03('0x9'));var client=jayson[_0x4a03('0xa')][_0x4a03('0xb')]({'port':0x232a});config[_0x4a03('0xc')]=_[_0x4a03('0xd')](config[_0x4a03('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4a03('0xe'))(new Redis(config['redis']));require(_0x4a03('0xf'))[_0x4a03('0x10')](socket);function respondWithRpcPromise(_0x88f54d,_0x3f84c7,_0x485ccc){return new BPromise(function(_0x1ad27a,_0x54203d){return client[_0x4a03('0x11')](_0x88f54d,_0x485ccc)[_0x4a03('0x12')](function(_0x1ce8f5){logger[_0x4a03('0x13')](_0x4a03('0x14'),_0x3f84c7,'request\x20sent');logger['debug']('CmList,\x20%s,\x20%s,\x20%s',_0x3f84c7,'request\x20sent',JSON[_0x4a03('0x15')](_0x1ce8f5));if(_0x1ce8f5[_0x4a03('0x16')]){if(_0x1ce8f5[_0x4a03('0x16')]['code']===0x1f4){logger['error'](_0x4a03('0x14'),_0x3f84c7,_0x1ce8f5[_0x4a03('0x16')][_0x4a03('0x17')]);return _0x54203d(_0x1ce8f5['error']['message']);}logger[_0x4a03('0x16')]('CmList,\x20%s,\x20%s',_0x3f84c7,_0x1ce8f5[_0x4a03('0x16')]['message']);return _0x1ad27a(_0x1ce8f5['error'][_0x4a03('0x17')]);}else{logger[_0x4a03('0x13')](_0x4a03('0x14'),_0x3f84c7,'request\x20sent');_0x1ad27a(_0x1ce8f5['result']['message']);}})['catch'](function(_0x26be15){logger['error'](_0x4a03('0x14'),_0x3f84c7,_0x26be15);_0x54203d(_0x26be15);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index fa72a7d..0fa47c2 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 _0x1a0f=['cmList:','./cmList.events','save','remove','update','emit','removeListener','length'];(function(_0x2b8393,_0x38e1a2){var _0x129421=function(_0x724bdf){while(--_0x724bdf){_0x2b8393['push'](_0x2b8393['shift']());}};_0x129421(++_0x38e1a2);}(_0x1a0f,0x1d9));var _0xf1a0=function(_0x4a3b02,_0x3f5b31){_0x4a3b02=_0x4a3b02-0x0;var _0x40d53c=_0x1a0f[_0x4a3b02];return _0x40d53c;};'use strict';var CmListEvents=require(_0xf1a0('0x0'));var events=[_0xf1a0('0x1'),_0xf1a0('0x2'),_0xf1a0('0x3')];function createListener(_0x1b24a7,_0x12c53b){return function(_0x2e3764){_0x12c53b[_0xf1a0('0x4')](_0x1b24a7,_0x2e3764);};}function removeListener(_0x14a02b,_0x16fb59){return function(){CmListEvents[_0xf1a0('0x5')](_0x14a02b,_0x16fb59);};}exports['register']=function(_0xf95f6a){for(var _0x424be2=0x0,_0x5d45cd=events[_0xf1a0('0x6')];_0x424be2<_0x5d45cd;_0x424be2++){var _0x956685=events[_0x424be2];var _0x24e992=createListener(_0xf1a0('0x7')+_0x956685,_0xf95f6a);CmListEvents['on'](_0x956685,_0x24e992);}}; \ No newline at end of file +var _0x3bae=['update','removeListener','length','./cmList.events','save'];(function(_0x2cc3c1,_0x21d7b6){var _0x3ae7b2=function(_0x533ee6){while(--_0x533ee6){_0x2cc3c1['push'](_0x2cc3c1['shift']());}};_0x3ae7b2(++_0x21d7b6);}(_0x3bae,0x13e));var _0xe3ba=function(_0x24aacf,_0x406a66){_0x24aacf=_0x24aacf-0x0;var _0x32cb33=_0x3bae[_0x24aacf];return _0x32cb33;};'use strict';var CmListEvents=require(_0xe3ba('0x0'));var events=[_0xe3ba('0x1'),'remove',_0xe3ba('0x2')];function createListener(_0x105628,_0x599ab){return function(_0x237bd1){_0x599ab['emit'](_0x105628,_0x237bd1);};}function removeListener(_0x5da55d,_0x101453){return function(){CmListEvents[_0xe3ba('0x3')](_0x5da55d,_0x101453);};}exports['register']=function(_0x20f7d7){for(var _0x2a5bd1=0x0,_0x5ea5a0=events[_0xe3ba('0x4')];_0x2a5bd1<_0x5ea5a0;_0x2a5bd1++){var _0x4e7f7e=events[_0x2a5bd1];var _0x2ce2a1=createListener('cmList:'+_0x4e7f7e,_0x20f7d7);CmListEvents['on'](_0x4e7f7e,_0x2ce2a1);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index e60ab40..f50a75e 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 _0x5b45=['/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','addDisposition','/:id/contacts','addContacts','addCustomField','addAgents','put','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x24dcd4,_0x37b9cc){var _0x64ab7b=function(_0x572353){while(--_0x572353){_0x24dcd4['push'](_0x24dcd4['shift']());}};_0x64ab7b(++_0x37b9cc);}(_0x5b45,0x1d0));var _0x55b4=function(_0x2ac71a,_0x1d2a02){_0x2ac71a=_0x2ac71a-0x0;var _0x3ee904=_0x5b45[_0x2ac71a];return _0x3ee904;};'use strict';var multer=require(_0x55b4('0x0'));var util=require(_0x55b4('0x1'));var path=require(_0x55b4('0x2'));var timeout=require(_0x55b4('0x3'));var express=require(_0x55b4('0x4'));var router=express[_0x55b4('0x5')]();var fs_extra=require(_0x55b4('0x6'));var auth=require(_0x55b4('0x7'));var interaction=require(_0x55b4('0x8'));var config=require(_0x55b4('0x9'));var controller=require(_0x55b4('0xa'));router[_0x55b4('0xb')]('/',auth[_0x55b4('0xc')](),controller[_0x55b4('0xd')]);router[_0x55b4('0xb')](_0x55b4('0xe'),auth[_0x55b4('0xc')](),controller[_0x55b4('0xf')]);router[_0x55b4('0xb')](_0x55b4('0x10'),auth[_0x55b4('0xc')](),controller[_0x55b4('0x11')]);router['get'](_0x55b4('0x12'),auth['isAuthenticated'](),controller[_0x55b4('0x13')]);router['get'](_0x55b4('0x14'),auth[_0x55b4('0xc')](),controller[_0x55b4('0x15')]);router[_0x55b4('0xb')]('/:id/contacts',auth[_0x55b4('0xc')](),controller[_0x55b4('0x16')]);router[_0x55b4('0xb')](_0x55b4('0x17'),auth[_0x55b4('0xc')](),controller[_0x55b4('0x18')]);router[_0x55b4('0xb')](_0x55b4('0x19'),auth[_0x55b4('0xc')](),controller[_0x55b4('0x1a')]);router[_0x55b4('0xb')](_0x55b4('0x1b'),auth[_0x55b4('0xc')](),controller[_0x55b4('0x1c')]);router[_0x55b4('0x1d')]('/',auth[_0x55b4('0xc')](),controller['create']);router[_0x55b4('0x1d')](_0x55b4('0x14'),auth[_0x55b4('0xc')](),controller[_0x55b4('0x1e')]);router[_0x55b4('0x1d')](_0x55b4('0x1f'),auth[_0x55b4('0xc')](),controller[_0x55b4('0x20')]);router[_0x55b4('0x1d')](_0x55b4('0x19'),auth['isAuthenticated'](),controller[_0x55b4('0x21')]);router['post'](_0x55b4('0x1b'),auth['isAuthenticated'](),controller[_0x55b4('0x22')]);router[_0x55b4('0x23')]('/:id',auth[_0x55b4('0xc')](),controller[_0x55b4('0x24')]);router[_0x55b4('0x25')](_0x55b4('0x12'),auth[_0x55b4('0xc')](),controller[_0x55b4('0x26')]);router[_0x55b4('0x25')](_0x55b4('0x14'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x55b4('0x25')](_0x55b4('0x1b'),auth[_0x55b4('0xc')](),controller[_0x55b4('0x27')]);module['exports']=router; \ No newline at end of file +var _0x1f10=['multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./cmList.controller','get','index','/describe','isAuthenticated','describe','/global_fields','/:id','show','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addContacts','addCustomField','addAgents','update','delete','destroy','removeDispositions'];(function(_0x223858,_0x9e9379){var _0x44e6b3=function(_0x1b98df){while(--_0x1b98df){_0x223858['push'](_0x223858['shift']());}};_0x44e6b3(++_0x9e9379);}(_0x1f10,0x69));var _0x01f1=function(_0x34aead,_0x436eba){_0x34aead=_0x34aead-0x0;var _0x5ab3ef=_0x1f10[_0x34aead];return _0x5ab3ef;};'use strict';var multer=require(_0x01f1('0x0'));var util=require(_0x01f1('0x1'));var path=require('path');var timeout=require(_0x01f1('0x2'));var express=require(_0x01f1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x01f1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x01f1('0x5'));var controller=require(_0x01f1('0x6'));router[_0x01f1('0x7')]('/',auth['isAuthenticated'](),controller[_0x01f1('0x8')]);router[_0x01f1('0x7')](_0x01f1('0x9'),auth[_0x01f1('0xa')](),controller[_0x01f1('0xb')]);router[_0x01f1('0x7')](_0x01f1('0xc'),auth[_0x01f1('0xa')](),controller['getGlobalCustomFields']);router[_0x01f1('0x7')](_0x01f1('0xd'),auth[_0x01f1('0xa')](),controller[_0x01f1('0xe')]);router[_0x01f1('0x7')]('/:id/dispositions',auth[_0x01f1('0xa')](),controller[_0x01f1('0xf')]);router[_0x01f1('0x7')](_0x01f1('0x10'),auth[_0x01f1('0xa')](),controller[_0x01f1('0x11')]);router[_0x01f1('0x7')](_0x01f1('0x12'),auth['isAuthenticated'](),controller[_0x01f1('0x13')]);router[_0x01f1('0x7')](_0x01f1('0x14'),auth[_0x01f1('0xa')](),controller[_0x01f1('0x15')]);router['get'](_0x01f1('0x16'),auth['isAuthenticated'](),controller[_0x01f1('0x17')]);router[_0x01f1('0x18')]('/',auth[_0x01f1('0xa')](),controller[_0x01f1('0x19')]);router[_0x01f1('0x18')](_0x01f1('0x1a'),auth[_0x01f1('0xa')](),controller[_0x01f1('0x1b')]);router[_0x01f1('0x18')](_0x01f1('0x10'),auth[_0x01f1('0xa')](),controller[_0x01f1('0x1c')]);router[_0x01f1('0x18')](_0x01f1('0x14'),auth['isAuthenticated'](),controller[_0x01f1('0x1d')]);router[_0x01f1('0x18')](_0x01f1('0x16'),auth[_0x01f1('0xa')](),controller[_0x01f1('0x1e')]);router['put'](_0x01f1('0xd'),auth[_0x01f1('0xa')](),controller[_0x01f1('0x1f')]);router[_0x01f1('0x20')](_0x01f1('0xd'),auth['isAuthenticated'](),controller[_0x01f1('0x21')]);router[_0x01f1('0x20')](_0x01f1('0x1a'),auth[_0x01f1('0xa')](),controller[_0x01f1('0x22')]);router[_0x01f1('0x20')](_0x01f1('0x16'),auth['isAuthenticated'](),controller['removeAgents']);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 bff7a75..4a8f9cd 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 _0x9f1f=['exports','VIRTUAL','field','STRING'];(function(_0x43a0ab,_0xbbe703){var _0x96b3dd=function(_0x7f2c42){while(--_0x7f2c42){_0x43a0ab['push'](_0x43a0ab['shift']());}};_0x96b3dd(++_0xbbe703);}(_0x9f1f,0x90));var _0xf9f1=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x9f1f[_0x32b542];return _0x554d54;};'use strict';var Sequelize=require('sequelize');module[_0xf9f1('0x0')]={'name':{'type':Sequelize[_0xf9f1('0x1')],'get':function(_0x586c7c){return this['getDataValue'](_0xf9f1('0x2'));}},'field':{'type':Sequelize[_0xf9f1('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0xf9f1('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0xf9f1('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0xd4c0=['getDataValue','field','STRING','sequelize','exports','VIRTUAL'];(function(_0x5d5bcb,_0x25e2ea){var _0x4ea5eb=function(_0x36782b){while(--_0x36782b){_0x5d5bcb['push'](_0x5d5bcb['shift']());}};_0x4ea5eb(++_0x25e2ea);}(_0xd4c0,0x177));var _0x0d4c=function(_0x1f2118,_0x157f27){_0x1f2118=_0x1f2118-0x0;var _0x518d0b=_0xd4c0[_0x1f2118];return _0x518d0b;};'use strict';var Sequelize=require(_0x0d4c('0x0'));module[_0x0d4c('0x1')]={'name':{'type':Sequelize[_0x0d4c('0x2')],'get':function(_0x37e1b4){return this[_0x0d4c('0x3')](_0x0d4c('0x4'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0d4c('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0x0d4c('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index a625eaa..4f24e21 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x55acf9,_0x61e7c1){var _0x1830c5=function(_0x317876){while(--_0x317876){_0x55acf9['push'](_0x55acf9['shift']());}};_0x1830c5(++_0x61e7c1);}(_0x7a54,0x106));var _0x47a5=function(_0x536156,_0x2e4620){_0x536156=_0x536156-0x0;var _0x49c860=_0x7a54[_0x536156];return _0x49c860;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x3c0b6e,_0x4f6e62){var _0x2816b4=function(_0x572b65){while(--_0x572b65){_0x3c0b6e['push'](_0x3c0b6e['shift']());}};_0x2816b4(++_0x4f6e62);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index c17ae1a..7377826 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 _0x5ecc=['Condition','util','moment','bluebird','path','rimraf','../../config/environment','./condition.attributes','define'];(function(_0x31ca4c,_0x38802c){var _0x423753=function(_0x55988e){while(--_0x55988e){_0x31ca4c['push'](_0x31ca4c['shift']());}};_0x423753(++_0x38802c);}(_0x5ecc,0x157));var _0xc5ec=function(_0x3adbae,_0x1a6e96){_0x3adbae=_0x3adbae-0x0;var _0xcb7316=_0x5ecc[_0x3adbae];return _0xcb7316;};'use strict';var _=require('lodash');var util=require(_0xc5ec('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xc5ec('0x1'));var BPromise=require(_0xc5ec('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc5ec('0x3'));var rimraf=require(_0xc5ec('0x4'));var config=require(_0xc5ec('0x5'));var attributes=require(_0xc5ec('0x6'));module['exports']=function(_0xaaaa37,_0x477395){return _0xaaaa37[_0xc5ec('0x7')](_0xc5ec('0x8'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x251e=['../../config/logger','moment','request-promise','rimraf','./condition.attributes','define','Condition','tools_conditions','lodash','util'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x251e,0xe4));var _0xe251=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x251e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe251('0x0'));var util=require(_0xe251('0x1'));var logger=require(_0xe251('0x2'))('api');var moment=require(_0xe251('0x3'));var BPromise=require('bluebird');var rp=require(_0xe251('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe251('0x5'));var config=require('../../config/environment');var attributes=require(_0xe251('0x6'));module['exports']=function(_0x504319,_0x2e45a0){return _0x504319[_0xe251('0x7')](_0xe251('0x8'),attributes,{'tableName':_0xe251('0x9'),'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 0b6cb33..c43575d 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 _0x9b6f=['error','Condition,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','stringify'];(function(_0x3e8980,_0x382d5a){var _0x6eaee9=function(_0x12e5e9){while(--_0x12e5e9){_0x3e8980['push'](_0x3e8980['shift']());}};_0x6eaee9(++_0x382d5a);}(_0x9b6f,0xe1));var _0xf9b6=function(_0x2175e3,_0x583ca1){_0x2175e3=_0x2175e3-0x0;var _0x504639=_0x9b6f[_0x2175e3];return _0x504639;};'use strict';var _=require(_0xf9b6('0x0'));var util=require(_0xf9b6('0x1'));var moment=require('moment');var BPromise=require(_0xf9b6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf9b6('0x3'));var db=require(_0xf9b6('0x4'))['db'];var utils=require(_0xf9b6('0x5'));var logger=require('../../config/logger')(_0xf9b6('0x6'));var config=require(_0xf9b6('0x7'));var jayson=require(_0xf9b6('0x8'));var client=jayson['client'][_0xf9b6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ed4a2,_0x5ebf23,_0x76bd2b){return new BPromise(function(_0x2e5bec,_0x2db16f){return client[_0xf9b6('0xa')](_0x2ed4a2,_0x76bd2b)['then'](function(_0x458333){logger[_0xf9b6('0xb')]('Condition,\x20%s,\x20%s',_0x5ebf23,_0xf9b6('0xc'));logger[_0xf9b6('0xd')]('Condition,\x20%s,\x20%s,\x20%s',_0x5ebf23,_0xf9b6('0xc'),JSON[_0xf9b6('0xe')](_0x458333));if(_0x458333['error']){if(_0x458333[_0xf9b6('0xf')]['code']===0x1f4){logger[_0xf9b6('0xf')](_0xf9b6('0x10'),_0x5ebf23,_0x458333[_0xf9b6('0xf')][_0xf9b6('0x11')]);return _0x2db16f(_0x458333['error']['message']);}logger[_0xf9b6('0xf')](_0xf9b6('0x10'),_0x5ebf23,_0x458333['error'][_0xf9b6('0x11')]);return _0x2e5bec(_0x458333[_0xf9b6('0xf')][_0xf9b6('0x11')]);}else{logger[_0xf9b6('0xb')]('Condition,\x20%s,\x20%s',_0x5ebf23,_0xf9b6('0xc'));_0x2e5bec(_0x458333[_0xf9b6('0x12')]['message']);}})[_0xf9b6('0x13')](function(_0x5d72d9){logger['error'](_0xf9b6('0x10'),_0x5ebf23,_0x5d72d9);_0x2db16f(_0x5d72d9);});});} \ No newline at end of file +var _0x96ef=['ioredis','../../mysqldb','../../config/logger','jayson/promise','then','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','lodash','util','moment','bluebird'];(function(_0x51723a,_0x355865){var _0x4ee0c1=function(_0x2275ff){while(--_0x2275ff){_0x51723a['push'](_0x51723a['shift']());}};_0x4ee0c1(++_0x355865);}(_0x96ef,0x1f4));var _0xf96e=function(_0x2457f7,_0xc5b9f2){_0x2457f7=_0x2457f7-0x0;var _0x1e550e=_0x96ef[_0x2457f7];return _0x1e550e;};'use strict';var _=require(_0xf96e('0x0'));var util=require(_0xf96e('0x1'));var moment=require(_0xf96e('0x2'));var BPromise=require(_0xf96e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf96e('0x4'));var db=require(_0xf96e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf96e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf96e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ac10f,_0x267e98,_0x441d7e){return new BPromise(function(_0x2b3df8,_0x4eaf1e){return client['request'](_0x1ac10f,_0x441d7e)[_0xf96e('0x8')](function(_0x2813fc){logger['info'](_0xf96e('0x9'),_0x267e98,'request\x20sent');logger[_0xf96e('0xa')](_0xf96e('0xb'),_0x267e98,_0xf96e('0xc'),JSON[_0xf96e('0xd')](_0x2813fc));if(_0x2813fc[_0xf96e('0xe')]){if(_0x2813fc['error']['code']===0x1f4){logger['error'](_0xf96e('0x9'),_0x267e98,_0x2813fc['error']['message']);return _0x4eaf1e(_0x2813fc[_0xf96e('0xe')]['message']);}logger['error'](_0xf96e('0x9'),_0x267e98,_0x2813fc[_0xf96e('0xe')][_0xf96e('0xf')]);return _0x2b3df8(_0x2813fc[_0xf96e('0xe')][_0xf96e('0xf')]);}else{logger[_0xf96e('0x10')](_0xf96e('0x9'),_0x267e98,'request\x20sent');_0x2b3df8(_0x2813fc[_0xf96e('0x11')][_0xf96e('0xf')]);}})['catch'](function(_0x25d2dc){logger[_0xf96e('0xe')](_0xf96e('0x9'),_0x267e98,_0x25d2dc);_0x4eaf1e(_0x25d2dc);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 8fad0af..18a2933 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 _0x4817=['../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','update','delete','isAuthenticated','destroy','exports','path','express','fs-extra'];(function(_0x19e915,_0x3ac017){var _0x23c76c=function(_0x50ab75){while(--_0x50ab75){_0x19e915['push'](_0x19e915['shift']());}};_0x23c76c(++_0x3ac017);}(_0x4817,0x11b));var _0x7481=function(_0x37357b,_0x4276a5){_0x37357b=_0x37357b-0x0;var _0x5cd404=_0x4817[_0x37357b];return _0x5cd404;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7481('0x0'));var timeout=require('connect-timeout');var express=require(_0x7481('0x1'));var router=express['Router']();var fs_extra=require(_0x7481('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x7481('0x3'));var config=require(_0x7481('0x4'));var controller=require(_0x7481('0x5'));router[_0x7481('0x6')](_0x7481('0x7'),auth['isAuthenticated'](),controller[_0x7481('0x8')]);router[_0x7481('0x9')](_0x7481('0x7'),auth[_0x7481('0xa')](),controller[_0x7481('0xb')]);module[_0x7481('0xc')]=router; \ No newline at end of file +var _0x4d7b=['../../components/auth/service','../../components/interaction/service','put','/:id','isAuthenticated','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra'];(function(_0x19b84f,_0x48765e){var _0x18067b=function(_0x1c69aa){while(--_0x1c69aa){_0x19b84f['push'](_0x19b84f['shift']());}};_0x18067b(++_0x48765e);}(_0x4d7b,0x13d));var _0xb4d7=function(_0x3e14a3,_0x40307a){_0x3e14a3=_0x3e14a3-0x0;var _0x565a84=_0x4d7b[_0x3e14a3];return _0x565a84;};'use strict';var multer=require('multer');var util=require(_0xb4d7('0x0'));var path=require('path');var timeout=require(_0xb4d7('0x1'));var express=require(_0xb4d7('0x2'));var router=express[_0xb4d7('0x3')]();var fs_extra=require(_0xb4d7('0x4'));var auth=require(_0xb4d7('0x5'));var interaction=require(_0xb4d7('0x6'));var config=require('../../config/environment');var controller=require('./condition.controller');router[_0xb4d7('0x7')](_0xb4d7('0x8'),auth[_0xb4d7('0x9')](),controller[_0xb4d7('0xa')]);router[_0xb4d7('0xb')](_0xb4d7('0x8'),auth['isAuthenticated'](),controller[_0xb4d7('0xc')]);module[_0xb4d7('0xd')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index fefc4bf..2b380f3 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 _0x5ff4=['INTEGER','sequelize','exports','STRING','name'];(function(_0x1d9dbf,_0x147530){var _0x2c49b3=function(_0x299abf){while(--_0x299abf){_0x1d9dbf['push'](_0x1d9dbf['shift']());}};_0x2c49b3(++_0x147530);}(_0x5ff4,0x137));var _0x45ff=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x5ff4[_0x1caf6a];return _0x1bf493;};'use strict';var Sequelize=require(_0x45ff('0x0'));module[_0x45ff('0x1')]={'name':{'type':Sequelize[_0x45ff('0x2')],'allowNull':![],'unique':_0x45ff('0x3')},'OrderBy':{'type':Sequelize[_0x45ff('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x45ff('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xbac2=['exports','name','INTEGER','sequelize'];(function(_0x4f4e6f,_0x2c4f17){var _0x3c88ee=function(_0x7c10d1){while(--_0x7c10d1){_0x4f4e6f['push'](_0x4f4e6f['shift']());}};_0x3c88ee(++_0x2c4f17);}(_0xbac2,0x17f));var _0x2bac=function(_0x381372,_0xf0a5a){_0x381372=_0x381372-0x0;var _0x4e959a=_0xbac2[_0x381372];return _0x4e959a;};'use strict';var Sequelize=require(_0x2bac('0x0'));module[_0x2bac('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2bac('0x2')},'OrderBy':{'type':Sequelize[_0x2bac('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 0176d49..9084390 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 _0xb03e=['squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','get','ContactItemTypes','UserProfileResource','error','stack','name','ContactItemType','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','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','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x4cccd5,_0x2c1054){var _0x5f62b9=function(_0x37310e){while(--_0x37310e){_0x4cccd5['push'](_0x4cccd5['shift']());}};_0x5f62b9(++_0x2c1054);}(_0xb03e,0x1eb));var _0xeb03=function(_0x122a3c,_0x4ec18a){_0x122a3c=_0x122a3c-0x0;var _0xae63b9=_0xb03e[_0x122a3c];return _0xae63b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb03('0x0'));var zipdir=require(_0xeb03('0x1'));var jsonpatch=require(_0xeb03('0x2'));var rp=require(_0xeb03('0x3'));var moment=require(_0xeb03('0x4'));var BPromise=require(_0xeb03('0x5'));var Mustache=require(_0xeb03('0x6'));var util=require(_0xeb03('0x7'));var path=require(_0xeb03('0x8'));var sox=require(_0xeb03('0x9'));var csv=require(_0xeb03('0xa'));var ejs=require(_0xeb03('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb03('0xc'));var squel=require(_0xeb03('0xd'));var crypto=require(_0xeb03('0xe'));var jsforce=require(_0xeb03('0xf'));var deskjs=require(_0xeb03('0x10'));var toCsv=require(_0xeb03('0xa'));var querystring=require('querystring');var Papa=require(_0xeb03('0x11'));var Redis=require(_0xeb03('0x12'));var authService=require(_0xeb03('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb03('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb03('0x15'))(_0xeb03('0x16'));var utils=require(_0xeb03('0x17'));var config=require(_0xeb03('0x18'));var licenseUtil=require(_0xeb03('0x19'));var db=require(_0xeb03('0x1a'))['db'];function respondWithStatusCode(_0x367d36,_0x384cbe){_0x384cbe=_0x384cbe||0xcc;return function(_0x97f46d){if(_0x97f46d){return _0x367d36[_0xeb03('0x1b')](_0x384cbe);}return _0x367d36[_0xeb03('0x1c')](_0x384cbe)[_0xeb03('0x1d')]();};}function respondWithResult(_0x4d9c8e,_0x212082){_0x212082=_0x212082||0xc8;return function(_0x100bef){if(_0x100bef){return _0x4d9c8e[_0xeb03('0x1c')](_0x212082)[_0xeb03('0x1e')](_0x100bef);}};}function respondWithFilteredResult(_0x52be5b,_0x15f4fe){return function(_0x36f5d8){if(_0x36f5d8){var _0x3f26ef=typeof _0x15f4fe['offset']===_0xeb03('0x1f')&&typeof _0x15f4fe[_0xeb03('0x20')]===_0xeb03('0x1f');var _0x44716c=_0x36f5d8[_0xeb03('0x21')];var _0x1b4cbd=_0x3f26ef?0x0:_0x15f4fe[_0xeb03('0x22')];var _0x8d6725=_0x3f26ef?_0x36f5d8[_0xeb03('0x21')]:_0x15f4fe[_0xeb03('0x22')]+_0x15f4fe[_0xeb03('0x20')];var _0x2c238d;if(_0x8d6725>=_0x44716c){_0x8d6725=_0x44716c;_0x2c238d=0xc8;}else{_0x2c238d=0xce;}_0x52be5b[_0xeb03('0x1c')](_0x2c238d);return _0x52be5b[_0xeb03('0x23')]('Content-Range',_0x1b4cbd+'-'+_0x8d6725+'/'+_0x44716c)[_0xeb03('0x1e')](_0x36f5d8);}return null;};}function patchUpdates(_0x3855dd){return function(_0x413d3e){try{jsonpatch[_0xeb03('0x24')](_0x413d3e,_0x3855dd,!![]);}catch(_0xe5a1c2){return BPromise[_0xeb03('0x25')](_0xe5a1c2);}return _0x413d3e[_0xeb03('0x26')]();};}function saveUpdates(_0x2c795b,_0x3c3d09){return function(_0x5a704b){if(_0x5a704b){return _0x5a704b[_0xeb03('0x27')](_0x2c795b)[_0xeb03('0x28')](function(_0x11ea85){return _0x11ea85;});}return null;};}function removeEntity(_0x300dc0,_0x2f99e6){return function(_0x5dcda3){if(_0x5dcda3){return _0x5dcda3[_0xeb03('0x29')]()[_0xeb03('0x28')](function(){var _0x16cd4=_0x5dcda3[_0xeb03('0x2a')]({'plain':!![]});var _0x3f276a=_0xeb03('0x2b');return db[_0xeb03('0x2c')][_0xeb03('0x29')]({'where':{'type':_0x3f276a,'resourceId':_0x16cd4['id']}})[_0xeb03('0x28')](function(){return _0x5dcda3;});})['then'](function(){_0x300dc0[_0xeb03('0x1c')](0xcc)[_0xeb03('0x1d')]();});}};}function handleEntityNotFound(_0x2683f9,_0x1ada2e){return function(_0x4cdea6){if(!_0x4cdea6){_0x2683f9['sendStatus'](0x194);}return _0x4cdea6;};}function handleError(_0x1064a5,_0x49e449){_0x49e449=_0x49e449||0x1f4;return function(_0x31a622){logger[_0xeb03('0x2d')](_0x31a622[_0xeb03('0x2e')]);if(_0x31a622['name']){delete _0x31a622[_0xeb03('0x2f')];}_0x1064a5['status'](_0x49e449)['send'](_0x31a622);};}exports['index']=function(_0x538d19,_0x421a27){var _0x433ce8={},_0x5d0cc1={},_0x528479={'count':0x0,'rows':[]};var _0x4d830a=_['map'](db[_0xeb03('0x30')][_0xeb03('0x31')],function(_0x32aff7){return{'name':_0x32aff7[_0xeb03('0x32')],'type':_0x32aff7[_0xeb03('0x33')]['key']};});_0x5d0cc1[_0xeb03('0x34')]=_['map'](_0x4d830a,_0xeb03('0x2f'));_0x5d0cc1[_0xeb03('0x35')]=_[_0xeb03('0x36')](_0x538d19[_0xeb03('0x35')]);_0x5d0cc1[_0xeb03('0x37')]=_[_0xeb03('0x38')](_0x5d0cc1[_0xeb03('0x34')],_0x5d0cc1[_0xeb03('0x35')]);_0x433ce8['attributes']=_[_0xeb03('0x38')](_0x5d0cc1['model'],qs[_0xeb03('0x39')](_0x538d19[_0xeb03('0x35')][_0xeb03('0x39')]));_0x433ce8[_0xeb03('0x3a')]=_0x433ce8[_0xeb03('0x3a')][_0xeb03('0x3b')]?_0x433ce8['attributes']:_0x5d0cc1[_0xeb03('0x34')];if(!_0x538d19['query']['hasOwnProperty']('nolimit')){_0x433ce8[_0xeb03('0x20')]=qs[_0xeb03('0x20')](_0x538d19[_0xeb03('0x35')][_0xeb03('0x20')]);_0x433ce8[_0xeb03('0x22')]=qs['offset'](_0x538d19[_0xeb03('0x35')][_0xeb03('0x22')]);}_0x433ce8[_0xeb03('0x3c')]=qs['sort'](_0x538d19['query'][_0xeb03('0x3d')]);_0x433ce8[_0xeb03('0x3e')]=qs[_0xeb03('0x37')](_['pick'](_0x538d19[_0xeb03('0x35')],_0x5d0cc1[_0xeb03('0x37')]),_0x4d830a);if(_0x538d19['query']['filter']){_0x433ce8[_0xeb03('0x3e')]=_[_0xeb03('0x3f')](_0x433ce8['where'],{'$or':_[_0xeb03('0x40')](_0x4d830a,function(_0x16551c){if(_0x16551c[_0xeb03('0x33')]!==_0xeb03('0x41')){var _0x376088={};_0x376088[_0x16551c[_0xeb03('0x2f')]]={'$like':'%'+_0x538d19[_0xeb03('0x35')][_0xeb03('0x42')]+'%'};return _0x376088;}})});}_0x433ce8=_[_0xeb03('0x3f')]({},_0x433ce8,_0x538d19[_0xeb03('0x43')]);var _0x367d19={'where':_0x433ce8[_0xeb03('0x3e')]};return db[_0xeb03('0x30')][_0xeb03('0x21')](_0x367d19)[_0xeb03('0x28')](function(_0x6b95dd){_0x528479[_0xeb03('0x21')]=_0x6b95dd;if(_0x538d19[_0xeb03('0x35')][_0xeb03('0x44')]){_0x433ce8[_0xeb03('0x45')]=[{'all':!![]}];}return db[_0xeb03('0x30')][_0xeb03('0x46')](_0x433ce8);})[_0xeb03('0x28')](function(_0x5bb7d9){_0x528479['rows']=_0x5bb7d9;return _0x528479;})[_0xeb03('0x28')](respondWithFilteredResult(_0x421a27,_0x433ce8))[_0xeb03('0x47')](handleError(_0x421a27,null));};exports[_0xeb03('0x48')]=function(_0x3c8d42,_0x5e27da){var _0x39ab97={'raw':!![],'where':{'id':_0x3c8d42[_0xeb03('0x49')]['id']}},_0x103c78={};_0x103c78['model']=_[_0xeb03('0x36')](db[_0xeb03('0x30')][_0xeb03('0x31')]);_0x103c78[_0xeb03('0x35')]=_[_0xeb03('0x36')](_0x3c8d42['query']);_0x103c78['filters']=_[_0xeb03('0x38')](_0x103c78['model'],_0x103c78['query']);_0x39ab97['attributes']=_[_0xeb03('0x38')](_0x103c78[_0xeb03('0x34')],qs[_0xeb03('0x39')](_0x3c8d42[_0xeb03('0x35')][_0xeb03('0x39')]));_0x39ab97[_0xeb03('0x3a')]=_0x39ab97['attributes'][_0xeb03('0x3b')]?_0x39ab97['attributes']:_0x103c78['model'];if(_0x3c8d42[_0xeb03('0x35')][_0xeb03('0x44')]){_0x39ab97[_0xeb03('0x45')]=[{'all':!![]}];}_0x39ab97=_['merge']({},_0x39ab97,_0x3c8d42[_0xeb03('0x43')]);return db[_0xeb03('0x30')][_0xeb03('0x4a')](_0x39ab97)[_0xeb03('0x28')](handleEntityNotFound(_0x5e27da,null))[_0xeb03('0x28')](respondWithResult(_0x5e27da,null))['catch'](handleError(_0x5e27da,null));};exports[_0xeb03('0x4b')]=function(_0x4dc1f6,_0x13c295){return db[_0xeb03('0x30')][_0xeb03('0x4b')](_0x4dc1f6[_0xeb03('0x4c')],{})[_0xeb03('0x28')](function(_0x46f4a7){var _0x42e73f=_0x4dc1f6[_0xeb03('0x4d')][_0xeb03('0x2a')]({'plain':!![]});if(!_0x42e73f)throw new Error(_0xeb03('0x4e'));if(_0x42e73f[_0xeb03('0x4f')]===_0xeb03('0x4d')){var _0x2f2066=_0x46f4a7[_0xeb03('0x2a')]({'plain':!![]});var _0x2a7eaf=_0xeb03('0x2b');return db[_0xeb03('0x50')][_0xeb03('0x4a')]({'where':{'name':_0x2a7eaf,'userProfileId':_0x42e73f[_0xeb03('0x51')]},'raw':!![]})[_0xeb03('0x28')](function(_0x353e29){if(_0x353e29&&_0x353e29[_0xeb03('0x52')]===0x0){return db[_0xeb03('0x2c')][_0xeb03('0x4b')]({'name':_0x2f2066['name'],'resourceId':_0x2f2066['id'],'type':_0x353e29[_0xeb03('0x2f')],'sectionId':_0x353e29['id']},{})[_0xeb03('0x28')](function(){return _0x46f4a7;});}else{return _0x46f4a7;}})[_0xeb03('0x47')](function(_0x5405b4){logger[_0xeb03('0x2d')](_0xeb03('0x53'),_0x5405b4);throw _0x5405b4;});}return _0x46f4a7;})[_0xeb03('0x28')](respondWithResult(_0x13c295,0xc9))[_0xeb03('0x47')](handleError(_0x13c295,null));};exports[_0xeb03('0x27')]=function(_0x68d263,_0x3ee370){if(_0x68d263[_0xeb03('0x4c')]['id']){delete _0x68d263[_0xeb03('0x4c')]['id'];}return db[_0xeb03('0x30')][_0xeb03('0x4a')]({'where':{'id':_0x68d263[_0xeb03('0x49')]['id']}})[_0xeb03('0x28')](handleEntityNotFound(_0x3ee370,null))[_0xeb03('0x28')](saveUpdates(_0x68d263['body'],null))[_0xeb03('0x28')](respondWithResult(_0x3ee370,null))[_0xeb03('0x47')](handleError(_0x3ee370,null));};exports[_0xeb03('0x29')]=function(_0x259db7,_0x10fed0){return db[_0xeb03('0x30')][_0xeb03('0x4a')]({'where':{'id':_0x259db7[_0xeb03('0x49')]['id']}})[_0xeb03('0x28')](handleEntityNotFound(_0x10fed0,null))[_0xeb03('0x28')](db['CmContactHasItem'][_0xeb03('0x27')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x259db7[_0xeb03('0x49')]['id']}}))[_0xeb03('0x28')](removeEntity(_0x10fed0,null))[_0xeb03('0x47')](handleError(_0x10fed0,null));}; \ No newline at end of file +var _0x7334=['save','update','then','destroy','get','ContactItemTypes','UserProfileResource','name','send','index','map','ContactItemType','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7334,0x184));var _0x4733=function(_0x472161,_0x5033dd){_0x472161=_0x472161-0x0;var _0x423457=_0x7334[_0x472161];return _0x423457;};'use strict';var emlformat=require(_0x4733('0x0'));var rimraf=require(_0x4733('0x1'));var zipdir=require(_0x4733('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4733('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4733('0x4'));var util=require(_0x4733('0x5'));var path=require(_0x4733('0x6'));var sox=require(_0x4733('0x7'));var csv=require(_0x4733('0x8'));var ejs=require(_0x4733('0x9'));var fs=require('fs');var fs_extra=require(_0x4733('0xa'));var _=require(_0x4733('0xb'));var squel=require(_0x4733('0xc'));var crypto=require(_0x4733('0xd'));var jsforce=require(_0x4733('0xe'));var deskjs=require(_0x4733('0xf'));var toCsv=require(_0x4733('0x8'));var querystring=require(_0x4733('0x10'));var Papa=require(_0x4733('0x11'));var Redis=require(_0x4733('0x12'));var authService=require(_0x4733('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4733('0x14'));var hardwareService=require(_0x4733('0x15'));var logger=require('../../config/logger')(_0x4733('0x16'));var utils=require('../../config/utils');var config=require(_0x4733('0x17'));var licenseUtil=require(_0x4733('0x18'));var db=require(_0x4733('0x19'))['db'];function respondWithStatusCode(_0x461f74,_0x100ecd){_0x100ecd=_0x100ecd||0xcc;return function(_0x1c146c){if(_0x1c146c){return _0x461f74[_0x4733('0x1a')](_0x100ecd);}return _0x461f74['status'](_0x100ecd)[_0x4733('0x1b')]();};}function respondWithResult(_0x543caf,_0x4327f3){_0x4327f3=_0x4327f3||0xc8;return function(_0x1a22e4){if(_0x1a22e4){return _0x543caf[_0x4733('0x1c')](_0x4327f3)[_0x4733('0x1d')](_0x1a22e4);}};}function respondWithFilteredResult(_0x3813df,_0x167016){return function(_0x12f111){if(_0x12f111){var _0x9fff=typeof _0x167016[_0x4733('0x1e')]==='undefined'&&typeof _0x167016[_0x4733('0x1f')]===_0x4733('0x20');var _0x47b129=_0x12f111[_0x4733('0x21')];var _0x1d2fb6=_0x9fff?0x0:_0x167016[_0x4733('0x1e')];var _0x384e0c=_0x9fff?_0x12f111['count']:_0x167016['offset']+_0x167016[_0x4733('0x1f')];var _0x3b730a;if(_0x384e0c>=_0x47b129){_0x384e0c=_0x47b129;_0x3b730a=0xc8;}else{_0x3b730a=0xce;}_0x3813df['status'](_0x3b730a);return _0x3813df[_0x4733('0x22')](_0x4733('0x23'),_0x1d2fb6+'-'+_0x384e0c+'/'+_0x47b129)[_0x4733('0x1d')](_0x12f111);}return null;};}function patchUpdates(_0x7a4e0){return function(_0x493cd3){try{jsonpatch[_0x4733('0x24')](_0x493cd3,_0x7a4e0,!![]);}catch(_0xb45e1){return BPromise['reject'](_0xb45e1);}return _0x493cd3[_0x4733('0x25')]();};}function saveUpdates(_0x18da47,_0x478e34){return function(_0x15a291){if(_0x15a291){return _0x15a291[_0x4733('0x26')](_0x18da47)[_0x4733('0x27')](function(_0x1a0643){return _0x1a0643;});}return null;};}function removeEntity(_0x3a2542,_0x24db74){return function(_0x180049){if(_0x180049){return _0x180049[_0x4733('0x28')]()['then'](function(){var _0x3e6976=_0x180049[_0x4733('0x29')]({'plain':!![]});var _0x7884e5=_0x4733('0x2a');return db[_0x4733('0x2b')][_0x4733('0x28')]({'where':{'type':_0x7884e5,'resourceId':_0x3e6976['id']}})[_0x4733('0x27')](function(){return _0x180049;});})[_0x4733('0x27')](function(){_0x3a2542[_0x4733('0x1c')](0xcc)[_0x4733('0x1b')]();});}};}function handleEntityNotFound(_0x521855,_0x3aeb57){return function(_0x4c91bc){if(!_0x4c91bc){_0x521855['sendStatus'](0x194);}return _0x4c91bc;};}function handleError(_0x24e975,_0x49c516){_0x49c516=_0x49c516||0x1f4;return function(_0xcde4f4){logger['error'](_0xcde4f4['stack']);if(_0xcde4f4['name']){delete _0xcde4f4[_0x4733('0x2c')];}_0x24e975[_0x4733('0x1c')](_0x49c516)[_0x4733('0x2d')](_0xcde4f4);};}exports[_0x4733('0x2e')]=function(_0x4fee4a,_0x538a7c){var _0x50f67e={},_0x2b2757={},_0x56872b={'count':0x0,'rows':[]};var _0x5a4814=_[_0x4733('0x2f')](db[_0x4733('0x30')][_0x4733('0x31')],function(_0x59172a){return{'name':_0x59172a['fieldName'],'type':_0x59172a[_0x4733('0x32')][_0x4733('0x33')]};});_0x2b2757[_0x4733('0x34')]=_[_0x4733('0x2f')](_0x5a4814,_0x4733('0x2c'));_0x2b2757['query']=_[_0x4733('0x35')](_0x4fee4a[_0x4733('0x36')]);_0x2b2757[_0x4733('0x37')]=_[_0x4733('0x38')](_0x2b2757[_0x4733('0x34')],_0x2b2757['query']);_0x50f67e['attributes']=_[_0x4733('0x38')](_0x2b2757[_0x4733('0x34')],qs[_0x4733('0x39')](_0x4fee4a[_0x4733('0x36')][_0x4733('0x39')]));_0x50f67e['attributes']=_0x50f67e[_0x4733('0x3a')][_0x4733('0x3b')]?_0x50f67e[_0x4733('0x3a')]:_0x2b2757['model'];if(!_0x4fee4a[_0x4733('0x36')][_0x4733('0x3c')](_0x4733('0x3d'))){_0x50f67e[_0x4733('0x1f')]=qs[_0x4733('0x1f')](_0x4fee4a[_0x4733('0x36')][_0x4733('0x1f')]);_0x50f67e[_0x4733('0x1e')]=qs['offset'](_0x4fee4a[_0x4733('0x36')]['offset']);}_0x50f67e[_0x4733('0x3e')]=qs[_0x4733('0x3f')](_0x4fee4a[_0x4733('0x36')][_0x4733('0x3f')]);_0x50f67e[_0x4733('0x40')]=qs[_0x4733('0x37')](_[_0x4733('0x41')](_0x4fee4a[_0x4733('0x36')],_0x2b2757['filters']),_0x5a4814);if(_0x4fee4a[_0x4733('0x36')][_0x4733('0x42')]){_0x50f67e['where']=_[_0x4733('0x43')](_0x50f67e[_0x4733('0x40')],{'$or':_['map'](_0x5a4814,function(_0x34aefe){if(_0x34aefe['type']!==_0x4733('0x44')){var _0x4c3073={};_0x4c3073[_0x34aefe[_0x4733('0x2c')]]={'$like':'%'+_0x4fee4a[_0x4733('0x36')]['filter']+'%'};return _0x4c3073;}})});}_0x50f67e=_['merge']({},_0x50f67e,_0x4fee4a[_0x4733('0x45')]);var _0x1d7112={'where':_0x50f67e['where']};return db[_0x4733('0x30')][_0x4733('0x21')](_0x1d7112)[_0x4733('0x27')](function(_0x28ed14){_0x56872b[_0x4733('0x21')]=_0x28ed14;if(_0x4fee4a[_0x4733('0x36')][_0x4733('0x46')]){_0x50f67e[_0x4733('0x47')]=[{'all':!![]}];}return db[_0x4733('0x30')][_0x4733('0x48')](_0x50f67e);})[_0x4733('0x27')](function(_0x1d32df){_0x56872b[_0x4733('0x49')]=_0x1d32df;return _0x56872b;})[_0x4733('0x27')](respondWithFilteredResult(_0x538a7c,_0x50f67e))[_0x4733('0x4a')](handleError(_0x538a7c,null));};exports[_0x4733('0x4b')]=function(_0x297bb1,_0x397088){var _0x50b9cb={'raw':!![],'where':{'id':_0x297bb1[_0x4733('0x4c')]['id']}},_0x1a0c5c={};_0x1a0c5c[_0x4733('0x34')]=_[_0x4733('0x35')](db[_0x4733('0x30')][_0x4733('0x31')]);_0x1a0c5c[_0x4733('0x36')]=_[_0x4733('0x35')](_0x297bb1[_0x4733('0x36')]);_0x1a0c5c[_0x4733('0x37')]=_[_0x4733('0x38')](_0x1a0c5c[_0x4733('0x34')],_0x1a0c5c[_0x4733('0x36')]);_0x50b9cb[_0x4733('0x3a')]=_['intersection'](_0x1a0c5c['model'],qs[_0x4733('0x39')](_0x297bb1[_0x4733('0x36')][_0x4733('0x39')]));_0x50b9cb[_0x4733('0x3a')]=_0x50b9cb[_0x4733('0x3a')][_0x4733('0x3b')]?_0x50b9cb[_0x4733('0x3a')]:_0x1a0c5c[_0x4733('0x34')];if(_0x297bb1[_0x4733('0x36')][_0x4733('0x46')]){_0x50b9cb['include']=[{'all':!![]}];}_0x50b9cb=_['merge']({},_0x50b9cb,_0x297bb1['options']);return db['ContactItemType'][_0x4733('0x4d')](_0x50b9cb)[_0x4733('0x27')](handleEntityNotFound(_0x397088,null))[_0x4733('0x27')](respondWithResult(_0x397088,null))[_0x4733('0x4a')](handleError(_0x397088,null));};exports[_0x4733('0x4e')]=function(_0x45b9cf,_0x1c6abf){return db[_0x4733('0x30')][_0x4733('0x4e')](_0x45b9cf[_0x4733('0x4f')],{})['then'](function(_0x53d70b){var _0x29c93d=_0x45b9cf['user'][_0x4733('0x29')]({'plain':!![]});if(!_0x29c93d)throw new Error(_0x4733('0x50'));if(_0x29c93d[_0x4733('0x51')]==='user'){var _0x3f2a78=_0x53d70b[_0x4733('0x29')]({'plain':!![]});var _0x31ae69=_0x4733('0x2a');return db[_0x4733('0x52')][_0x4733('0x4d')]({'where':{'name':_0x31ae69,'userProfileId':_0x29c93d[_0x4733('0x53')]},'raw':!![]})[_0x4733('0x27')](function(_0x28d428){if(_0x28d428&&_0x28d428['autoAssociation']===0x0){return db[_0x4733('0x2b')][_0x4733('0x4e')]({'name':_0x3f2a78[_0x4733('0x2c')],'resourceId':_0x3f2a78['id'],'type':_0x28d428['name'],'sectionId':_0x28d428['id']},{})[_0x4733('0x27')](function(){return _0x53d70b;});}else{return _0x53d70b;}})[_0x4733('0x4a')](function(_0xafb3f8){logger[_0x4733('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xafb3f8);throw _0xafb3f8;});}return _0x53d70b;})[_0x4733('0x27')](respondWithResult(_0x1c6abf,0xc9))['catch'](handleError(_0x1c6abf,null));};exports[_0x4733('0x26')]=function(_0x3b8165,_0x42405e){if(_0x3b8165[_0x4733('0x4f')]['id']){delete _0x3b8165[_0x4733('0x4f')]['id'];}return db['ContactItemType'][_0x4733('0x4d')]({'where':{'id':_0x3b8165[_0x4733('0x4c')]['id']}})['then'](handleEntityNotFound(_0x42405e,null))['then'](saveUpdates(_0x3b8165[_0x4733('0x4f')],null))[_0x4733('0x27')](respondWithResult(_0x42405e,null))[_0x4733('0x4a')](handleError(_0x42405e,null));};exports[_0x4733('0x28')]=function(_0x422010,_0x972fde){return db[_0x4733('0x30')][_0x4733('0x4d')]({'where':{'id':_0x422010['params']['id']}})['then'](handleEntityNotFound(_0x972fde,null))[_0x4733('0x27')](db['CmContactHasItem'][_0x4733('0x26')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x422010[_0x4733('0x4c')]['id']}}))[_0x4733('0x27')](removeEntity(_0x972fde,null))['catch'](handleError(_0x972fde,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 4a0b71d..fb67ca7 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 _0xf3dc=['moment','bluebird','rimraf','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xf3dc,0x1b6));var _0xcf3d=function(_0x30f897,_0x37455e){_0x30f897=_0x30f897-0x0;var _0x40bfff=_0xf3dc[_0x30f897];return _0x40bfff;};'use strict';var _=require(_0xcf3d('0x0'));var util=require(_0xcf3d('0x1'));var logger=require(_0xcf3d('0x2'))(_0xcf3d('0x3'));var moment=require(_0xcf3d('0x4'));var BPromise=require(_0xcf3d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcf3d('0x6'));var config=require(_0xcf3d('0x7'));var attributes=require(_0xcf3d('0x8'));module[_0xcf3d('0x9')]=function(_0x2ee7b2,_0xc96c93){return _0x2ee7b2[_0xcf3d('0xa')](_0xcf3d('0xb'),attributes,{'tableName':_0xcf3d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2e3=['exports','tools_contact_item_types','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./contactItemType.attributes'];(function(_0x592212,_0x1d87ad){var _0xc18254=function(_0x368716){while(--_0x368716){_0x592212['push'](_0x592212['shift']());}};_0xc18254(++_0x1d87ad);}(_0xd2e3,0x10a));var _0x3d2e=function(_0x53a73f,_0x5907c4){_0x53a73f=_0x53a73f-0x0;var _0x1ab16e=_0xd2e3[_0x53a73f];return _0x1ab16e;};'use strict';var _=require(_0x3d2e('0x0'));var util=require(_0x3d2e('0x1'));var logger=require(_0x3d2e('0x2'))(_0x3d2e('0x3'));var moment=require('moment');var BPromise=require(_0x3d2e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d2e('0x5'));var rimraf=require(_0x3d2e('0x6'));var config=require(_0x3d2e('0x7'));var attributes=require(_0x3d2e('0x8'));module[_0x3d2e('0x9')]=function(_0x1d74f9,_0x10ec04){return _0x1d74f9['define']('ContactItemType',attributes,{'tableName':_0x3d2e('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 14d9255..cd093e8 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 _0xe8c6=['request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xe8c6,0x1bc));var _0x6e8c=function(_0x1c6315,_0x114ff7){_0x1c6315=_0x1c6315-0x0;var _0x19074f=_0xe8c6[_0x1c6315];return _0x19074f;};'use strict';var _=require('lodash');var util=require(_0x6e8c('0x0'));var moment=require(_0x6e8c('0x1'));var BPromise=require(_0x6e8c('0x2'));var rs=require(_0x6e8c('0x3'));var fs=require('fs');var Redis=require(_0x6e8c('0x4'));var db=require(_0x6e8c('0x5'))['db'];var utils=require(_0x6e8c('0x6'));var logger=require(_0x6e8c('0x7'))(_0x6e8c('0x8'));var config=require(_0x6e8c('0x9'));var jayson=require(_0x6e8c('0xa'));var client=jayson['client'][_0x6e8c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x440541,_0x562379,_0x2aff6b){return new BPromise(function(_0x304fd0,_0xa14db9){return client[_0x6e8c('0xc')](_0x440541,_0x2aff6b)[_0x6e8c('0xd')](function(_0x52646b){logger[_0x6e8c('0xe')](_0x6e8c('0xf'),_0x562379,_0x6e8c('0x10'));logger[_0x6e8c('0x11')](_0x6e8c('0x12'),_0x562379,'request\x20sent',JSON[_0x6e8c('0x13')](_0x52646b));if(_0x52646b[_0x6e8c('0x14')]){if(_0x52646b[_0x6e8c('0x14')][_0x6e8c('0x15')]===0x1f4){logger[_0x6e8c('0x14')](_0x6e8c('0xf'),_0x562379,_0x52646b[_0x6e8c('0x14')]['message']);return _0xa14db9(_0x52646b[_0x6e8c('0x14')][_0x6e8c('0x16')]);}logger['error'](_0x6e8c('0xf'),_0x562379,_0x52646b['error'][_0x6e8c('0x16')]);return _0x304fd0(_0x52646b[_0x6e8c('0x14')]['message']);}else{logger[_0x6e8c('0xe')](_0x6e8c('0xf'),_0x562379,_0x6e8c('0x10'));_0x304fd0(_0x52646b[_0x6e8c('0x17')][_0x6e8c('0x16')]);}})['catch'](function(_0x120a47){logger[_0x6e8c('0x14')](_0x6e8c('0xf'),_0x562379,_0x120a47);_0xa14db9(_0x120a47);});});} \ No newline at end of file +var _0x3f72=['request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ContactItemType,\x20%s,\x20%s'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0x3f72,0xaf));var _0x23f7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3f72[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x23f7('0x0'));var util=require(_0x23f7('0x1'));var moment=require(_0x23f7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x23f7('0x3'));var db=require(_0x23f7('0x4'))['db'];var utils=require(_0x23f7('0x5'));var logger=require(_0x23f7('0x6'))(_0x23f7('0x7'));var config=require('../../config/environment');var jayson=require(_0x23f7('0x8'));var client=jayson['client'][_0x23f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cc54a,_0x23e468,_0x2db48b){return new BPromise(function(_0x412d29,_0x258026){return client[_0x23f7('0xa')](_0x5cc54a,_0x2db48b)[_0x23f7('0xb')](function(_0x3a048c){logger[_0x23f7('0xc')](_0x23f7('0xd'),_0x23e468,_0x23f7('0xe'));logger['debug'](_0x23f7('0xf'),_0x23e468,_0x23f7('0xe'),JSON[_0x23f7('0x10')](_0x3a048c));if(_0x3a048c['error']){if(_0x3a048c['error'][_0x23f7('0x11')]===0x1f4){logger[_0x23f7('0x12')](_0x23f7('0xd'),_0x23e468,_0x3a048c[_0x23f7('0x12')][_0x23f7('0x13')]);return _0x258026(_0x3a048c['error'][_0x23f7('0x13')]);}logger[_0x23f7('0x12')](_0x23f7('0xd'),_0x23e468,_0x3a048c[_0x23f7('0x12')]['message']);return _0x412d29(_0x3a048c[_0x23f7('0x12')][_0x23f7('0x13')]);}else{logger[_0x23f7('0xc')](_0x23f7('0xd'),_0x23e468,_0x23f7('0xe'));_0x412d29(_0x3a048c[_0x23f7('0x14')][_0x23f7('0x13')]);}})['catch'](function(_0x2669ab){logger[_0x23f7('0x12')]('ContactItemType,\x20%s,\x20%s',_0x23e468,_0x2669ab);_0x258026(_0x2669ab);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 984b763..9c773c1 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 _0xd1fe=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','/:id','post','create','update','delete','destroy','exports'];(function(_0x1f8053,_0x111077){var _0x174fd8=function(_0x2f92fc){while(--_0x2f92fc){_0x1f8053['push'](_0x1f8053['shift']());}};_0x174fd8(++_0x111077);}(_0xd1fe,0x104));var _0xed1f=function(_0x3c17c2,_0x4f6b4d){_0x3c17c2=_0x3c17c2-0x0;var _0x3a1822=_0xd1fe[_0x3c17c2];return _0x3a1822;};'use strict';var multer=require(_0xed1f('0x0'));var util=require(_0xed1f('0x1'));var path=require(_0xed1f('0x2'));var timeout=require(_0xed1f('0x3'));var express=require(_0xed1f('0x4'));var router=express[_0xed1f('0x5')]();var fs_extra=require(_0xed1f('0x6'));var auth=require(_0xed1f('0x7'));var interaction=require(_0xed1f('0x8'));var config=require(_0xed1f('0x9'));var controller=require(_0xed1f('0xa'));router[_0xed1f('0xb')]('/',auth[_0xed1f('0xc')](),controller['index']);router['get'](_0xed1f('0xd'),auth[_0xed1f('0xc')](),controller['show']);router[_0xed1f('0xe')]('/',auth[_0xed1f('0xc')](),controller[_0xed1f('0xf')]);router['put'](_0xed1f('0xd'),auth['isAuthenticated'](),controller[_0xed1f('0x10')]);router[_0xed1f('0x11')](_0xed1f('0xd'),auth['isAuthenticated'](),controller[_0xed1f('0x12')]);module[_0xed1f('0x13')]=router; \ No newline at end of file +var _0x14cb=['delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','show','post','create','/:id','update'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x14cb,0x1b8));var _0xb14c=function(_0x1808bd,_0x371bce){_0x1808bd=_0x1808bd-0x0;var _0x260b97=_0x14cb[_0x1808bd];return _0x260b97;};'use strict';var multer=require(_0xb14c('0x0'));var util=require('util');var path=require(_0xb14c('0x1'));var timeout=require(_0xb14c('0x2'));var express=require(_0xb14c('0x3'));var router=express[_0xb14c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb14c('0x5'));var interaction=require(_0xb14c('0x6'));var config=require(_0xb14c('0x7'));var controller=require(_0xb14c('0x8'));router[_0xb14c('0x9')]('/',auth[_0xb14c('0xa')](),controller['index']);router[_0xb14c('0x9')]('/:id',auth[_0xb14c('0xa')](),controller[_0xb14c('0xb')]);router[_0xb14c('0xc')]('/',auth[_0xb14c('0xa')](),controller[_0xb14c('0xd')]);router['put'](_0xb14c('0xe'),auth[_0xb14c('0xa')](),controller[_0xb14c('0xf')]);router[_0xb14c('0x10')]('/:id',auth[_0xb14c('0xa')](),controller[_0xb14c('0x11')]);module[_0xb14c('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 5833ba6..05bbce8 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','sequelize'];(function(_0x336296,_0x116e67){var _0x223596=function(_0x37598b){while(--_0x37598b){_0x336296['push'](_0x336296['shift']());}};_0x223596(++_0x116e67);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x104b97,_0x2db793){var _0x33a962=function(_0x10969c){while(--_0x10969c){_0x104b97['push'](_0x104b97['shift']());}};_0x33a962(++_0x2db793);}(_0x757a,0xde));var _0xa757=function(_0x28e326,_0x12d04c){_0x28e326=_0x28e326-0x0;var _0x4eb9f1=_0x757a[_0x28e326];return _0x4eb9f1;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 6e09029..445e657 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 _0x0c58=['attrs','value','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','findOne','order','pick','getItems','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','CustomDashboards','UserProfileResource','stack','name','send','index','Dashboard','rawAttributes','key','map','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','omit','update','type','iframe','attrUrl'];(function(_0x580e1c,_0x57befc){var _0x3ac43c=function(_0x5aadda){while(--_0x5aadda){_0x580e1c['push'](_0x580e1c['shift']());}};_0x3ac43c(++_0x57befc);}(_0x0c58,0xa6));var _0x80c5=function(_0x5d341f,_0x3b57fb){_0x5d341f=_0x5d341f-0x0;var _0x8581f1=_0x0c58[_0x5d341f];return _0x8581f1;};'use strict';var emlformat=require(_0x80c5('0x0'));var rimraf=require(_0x80c5('0x1'));var zipdir=require(_0x80c5('0x2'));var jsonpatch=require(_0x80c5('0x3'));var rp=require('request-promise');var moment=require(_0x80c5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x80c5('0x5'));var path=require(_0x80c5('0x6'));var sox=require(_0x80c5('0x7'));var csv=require('to-csv');var ejs=require(_0x80c5('0x8'));var fs=require('fs');var fs_extra=require(_0x80c5('0x9'));var _=require(_0x80c5('0xa'));var squel=require(_0x80c5('0xb'));var crypto=require(_0x80c5('0xc'));var jsforce=require(_0x80c5('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x80c5('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x80c5('0xf'));var logger=require(_0x80c5('0x10'))(_0x80c5('0x11'));var utils=require(_0x80c5('0x12'));var config=require(_0x80c5('0x13'));var licenseUtil=require(_0x80c5('0x14'));var db=require(_0x80c5('0x15'))['db'];config[_0x80c5('0x16')]=_[_0x80c5('0x17')](config[_0x80c5('0x16')],{'host':_0x80c5('0x18'),'port':0x18eb});var socket=require(_0x80c5('0x19'))(new Redis(config[_0x80c5('0x16')]));require(_0x80c5('0x1a'))[_0x80c5('0x1b')](socket);function respondWithStatusCode(_0x2b367f,_0x587162){_0x587162=_0x587162||0xcc;return function(_0x3c397f){if(_0x3c397f){return _0x2b367f[_0x80c5('0x1c')](_0x587162);}return _0x2b367f[_0x80c5('0x1d')](_0x587162)[_0x80c5('0x1e')]();};}function respondWithResult(_0x4be0e1,_0x37aa7a){_0x37aa7a=_0x37aa7a||0xc8;return function(_0x5660ff){if(_0x5660ff){return _0x4be0e1[_0x80c5('0x1d')](_0x37aa7a)[_0x80c5('0x1f')](_0x5660ff);}};}function respondWithFilteredResult(_0x1f131d,_0x2f270c){return function(_0x3eb2b9){if(_0x3eb2b9){var _0x5357ff=typeof _0x2f270c[_0x80c5('0x20')]===_0x80c5('0x21')&&typeof _0x2f270c['limit']===_0x80c5('0x21');var _0x1aa027=_0x3eb2b9[_0x80c5('0x22')];var _0x278c46=_0x5357ff?0x0:_0x2f270c[_0x80c5('0x20')];var _0x55f5f9=_0x5357ff?_0x3eb2b9[_0x80c5('0x22')]:_0x2f270c[_0x80c5('0x20')]+_0x2f270c[_0x80c5('0x23')];var _0xc27f6b;if(_0x55f5f9>=_0x1aa027){_0x55f5f9=_0x1aa027;_0xc27f6b=0xc8;}else{_0xc27f6b=0xce;}_0x1f131d[_0x80c5('0x1d')](_0xc27f6b);return _0x1f131d[_0x80c5('0x24')](_0x80c5('0x25'),_0x278c46+'-'+_0x55f5f9+'/'+_0x1aa027)['json'](_0x3eb2b9);}return null;};}function patchUpdates(_0x883cb2){return function(_0x48bd4b){try{jsonpatch[_0x80c5('0x26')](_0x48bd4b,_0x883cb2,!![]);}catch(_0x49eb55){return BPromise[_0x80c5('0x27')](_0x49eb55);}return _0x48bd4b[_0x80c5('0x28')]();};}function saveUpdates(_0x5af7b2,_0xb2fd02){return function(_0xfb1dc1){if(_0xfb1dc1){return _0xfb1dc1['update'](_0x5af7b2)[_0x80c5('0x29')](function(_0x1c38ab){return _0x1c38ab;});}return null;};}function removeEntity(_0x8ec1ca,_0x1834e0){return function(_0x467ad7){if(_0x467ad7){return _0x467ad7[_0x80c5('0x2a')]()[_0x80c5('0x29')](function(){var _0x3ab28d=_0x467ad7['get']({'plain':!![]});var _0x79164f=_0x80c5('0x2b');return db[_0x80c5('0x2c')]['destroy']({'where':{'type':_0x79164f,'resourceId':_0x3ab28d['id']}})[_0x80c5('0x29')](function(){return _0x467ad7;});})[_0x80c5('0x29')](function(){_0x8ec1ca[_0x80c5('0x1d')](0xcc)[_0x80c5('0x1e')]();});}};}function handleEntityNotFound(_0x5c0274,_0x1c1cd1){return function(_0x396ace){if(!_0x396ace){_0x5c0274[_0x80c5('0x1c')](0x194);}return _0x396ace;};}function handleError(_0x3db77e,_0xcd812c){_0xcd812c=_0xcd812c||0x1f4;return function(_0x2090e7){logger['error'](_0x2090e7[_0x80c5('0x2d')]);if(_0x2090e7['name']){delete _0x2090e7[_0x80c5('0x2e')];}_0x3db77e['status'](_0xcd812c)[_0x80c5('0x2f')](_0x2090e7);};}exports[_0x80c5('0x30')]=function(_0x212b0c,_0x66c53a){var _0x4aa6a1={},_0xfb8ab4={},_0x4538a5={'count':0x0,'rows':[]};var _0x23dccc=_['map'](db[_0x80c5('0x31')][_0x80c5('0x32')],function(_0x1abf5e){return{'name':_0x1abf5e['fieldName'],'type':_0x1abf5e['type'][_0x80c5('0x33')]};});_0xfb8ab4['model']=_[_0x80c5('0x34')](_0x23dccc,_0x80c5('0x2e'));_0xfb8ab4[_0x80c5('0x35')]=_[_0x80c5('0x36')](_0x212b0c[_0x80c5('0x35')]);_0xfb8ab4[_0x80c5('0x37')]=_[_0x80c5('0x38')](_0xfb8ab4[_0x80c5('0x39')],_0xfb8ab4['query']);_0x4aa6a1['attributes']=_['intersection'](_0xfb8ab4[_0x80c5('0x39')],qs[_0x80c5('0x3a')](_0x212b0c[_0x80c5('0x35')]['fields']));_0x4aa6a1['attributes']=_0x4aa6a1[_0x80c5('0x3b')]['length']?_0x4aa6a1[_0x80c5('0x3b')]:_0xfb8ab4[_0x80c5('0x39')];if(!_0x212b0c[_0x80c5('0x35')][_0x80c5('0x3c')](_0x80c5('0x3d'))){_0x4aa6a1[_0x80c5('0x23')]=qs['limit'](_0x212b0c[_0x80c5('0x35')]['limit']);_0x4aa6a1[_0x80c5('0x20')]=qs['offset'](_0x212b0c[_0x80c5('0x35')][_0x80c5('0x20')]);}_0x4aa6a1['order']=qs[_0x80c5('0x3e')](_0x212b0c[_0x80c5('0x35')][_0x80c5('0x3e')]);_0x4aa6a1[_0x80c5('0x3f')]=qs['filters'](_['pick'](_0x212b0c[_0x80c5('0x35')],_0xfb8ab4[_0x80c5('0x37')]),_0x23dccc);if(_0x212b0c[_0x80c5('0x35')]['filter']){_0x4aa6a1[_0x80c5('0x3f')]=_['merge'](_0x4aa6a1['where'],{'$or':_[_0x80c5('0x34')](_0x23dccc,function(_0x4548d0){if(_0x4548d0['type']!==_0x80c5('0x40')){var _0xe9b65c={};_0xe9b65c[_0x4548d0['name']]={'$like':'%'+_0x212b0c['query'][_0x80c5('0x41')]+'%'};return _0xe9b65c;}})});}_0x4aa6a1=_[_0x80c5('0x42')]({},_0x4aa6a1,_0x212b0c[_0x80c5('0x43')]);var _0x331ba6={'where':_0x4aa6a1[_0x80c5('0x3f')]};return db['Dashboard']['count'](_0x331ba6)[_0x80c5('0x29')](function(_0x4778b5){_0x4538a5[_0x80c5('0x22')]=_0x4778b5;if(_0x212b0c[_0x80c5('0x35')][_0x80c5('0x44')]){_0x4aa6a1[_0x80c5('0x45')]=[{'all':!![]}];}return db['Dashboard'][_0x80c5('0x46')](_0x4aa6a1);})[_0x80c5('0x29')](function(_0x423944){_0x4538a5[_0x80c5('0x47')]=_0x423944;return _0x4538a5;})[_0x80c5('0x29')](respondWithFilteredResult(_0x66c53a,_0x4aa6a1))[_0x80c5('0x48')](handleError(_0x66c53a,null));};exports[_0x80c5('0x49')]=function(_0x10eecb,_0x5a1376){var _0x347601={'raw':![],'where':{'id':_0x10eecb[_0x80c5('0x4a')]['id']}},_0x508f42={};_0x508f42[_0x80c5('0x39')]=_[_0x80c5('0x36')](db['Dashboard'][_0x80c5('0x32')]);_0x508f42[_0x80c5('0x35')]=_[_0x80c5('0x36')](_0x10eecb['query']);_0x508f42[_0x80c5('0x37')]=_['intersection'](_0x508f42[_0x80c5('0x39')],_0x508f42[_0x80c5('0x35')]);_0x347601[_0x80c5('0x3b')]=_[_0x80c5('0x38')](_0x508f42[_0x80c5('0x39')],qs[_0x80c5('0x3a')](_0x10eecb['query'][_0x80c5('0x3a')]));_0x347601[_0x80c5('0x3b')]=_0x347601[_0x80c5('0x3b')][_0x80c5('0x4b')]?_0x347601['attributes']:_0x508f42[_0x80c5('0x39')];if(_0x10eecb['query']['includeAll']){_0x347601['include']=[{'all':!![]}];}_0x347601=_[_0x80c5('0x42')]({},_0x347601,_0x10eecb[_0x80c5('0x43')]);return db[_0x80c5('0x31')][_0x80c5('0x4c')](_0x347601)[_0x80c5('0x29')](handleEntityNotFound(_0x5a1376,null))['then'](respondWithResult(_0x5a1376,null))[_0x80c5('0x48')](handleError(_0x5a1376,null));};exports[_0x80c5('0x4d')]=function(_0x15cb67,_0x4e20c3){return db['Dashboard']['create'](_0x15cb67[_0x80c5('0x4e')],{})['then'](function(_0x1e8245){var _0x3ea49a=_0x15cb67[_0x80c5('0x4f')][_0x80c5('0x50')]({'plain':!![]});if(!_0x3ea49a)throw new Error(_0x80c5('0x51'));if(_0x3ea49a[_0x80c5('0x52')]===_0x80c5('0x4f')){var _0x2293a0=_0x1e8245[_0x80c5('0x50')]({'plain':!![]});var _0x995e3d=_0x80c5('0x2b');return db['UserProfileSection'][_0x80c5('0x4c')]({'where':{'name':_0x995e3d,'userProfileId':_0x3ea49a[_0x80c5('0x53')]},'raw':!![]})[_0x80c5('0x29')](function(_0x3c0fcf){if(_0x3c0fcf&&_0x3c0fcf[_0x80c5('0x54')]===0x0){return db[_0x80c5('0x2c')][_0x80c5('0x4d')]({'name':_0x2293a0[_0x80c5('0x2e')],'resourceId':_0x2293a0['id'],'type':_0x3c0fcf[_0x80c5('0x2e')],'sectionId':_0x3c0fcf['id']},{})[_0x80c5('0x29')](function(){return _0x1e8245;});}else{return _0x1e8245;}})['catch'](function(_0x5d46e9){logger[_0x80c5('0x55')](_0x80c5('0x56'),_0x5d46e9);throw _0x5d46e9;});}return _0x1e8245;})[_0x80c5('0x29')](respondWithResult(_0x4e20c3,0xc9))[_0x80c5('0x48')](handleError(_0x4e20c3,null));};exports[_0x80c5('0x57')]=function(_0x2dc872,_0x8cae7f){var _0xfabf6e={'where':{'id':_0x2dc872[_0x80c5('0x4a')]['id']}},_0x241b65={};_0x241b65[_0x80c5('0x39')]=_['keys'](db[_0x80c5('0x31')][_0x80c5('0x32')]);_0xfabf6e['attributes']=_['intersection'](_0x241b65[_0x80c5('0x39')],qs[_0x80c5('0x3a')](_0x2dc872[_0x80c5('0x35')][_0x80c5('0x3a')]));_0xfabf6e[_0x80c5('0x3b')]=_0xfabf6e[_0x80c5('0x3b')][_0x80c5('0x4b')]?_0xfabf6e['attributes']:_0x241b65[_0x80c5('0x39')];if(_0x2dc872['query'][_0x80c5('0x44')]){_0xfabf6e['include']=[{'all':!![]}];}_0xfabf6e=_['merge']({},_0xfabf6e,_0x2dc872[_0x80c5('0x43')]);return db[_0x80c5('0x31')][_0x80c5('0x4c')](_0xfabf6e)['then'](handleEntityNotFound(_0x8cae7f,null))['then'](function(_0x32dc1b){if(_0x32dc1b){var _0x2147da=_0x32dc1b['get']({'plain':!![]});_0x2147da=qs['omit'](_0x2147da,['id',_0x80c5('0x58'),'updatedAt']);_0x2dc872[_0x80c5('0x4e')]=_[_0x80c5('0x59')](_0x2dc872[_0x80c5('0x4e')],['id','createdAt','updatedAt']);return db[_0x80c5('0x31')][_0x80c5('0x4d')](_[_0x80c5('0x42')](_0x2147da,_0x2dc872[_0x80c5('0x4e')]),{'include':_0x2dc872['query'][_0x80c5('0x44')]?[{'all':!![]}]:undefined})['then'](function(_0xefa68f){var _0x51e97f=_0x2dc872[_0x80c5('0x4f')]['get']({'plain':!![]});if(!_0x51e97f)throw new Error(_0x80c5('0x51'));if(_0x51e97f['role']==='user'){var _0x4ca51c=_0xefa68f[_0x80c5('0x50')]({'plain':!![]});var _0x4eb4c3=_0x80c5('0x2b');return db['UserProfileSection'][_0x80c5('0x4c')]({'where':{'name':_0x4eb4c3,'userProfileId':_0x51e97f[_0x80c5('0x53')]},'raw':!![]})['then'](function(_0x3056c4){if(_0x3056c4&&_0x3056c4[_0x80c5('0x54')]===0x0){return db[_0x80c5('0x2c')]['create']({'name':_0x4ca51c[_0x80c5('0x2e')],'resourceId':_0x4ca51c['id'],'type':_0x3056c4[_0x80c5('0x2e')],'sectionId':_0x3056c4['id']},{})[_0x80c5('0x29')](function(){return _0xefa68f;});}else{return _0xefa68f;}})[_0x80c5('0x48')](function(_0x2990c7){logger[_0x80c5('0x55')](_0x80c5('0x56'),_0x2990c7);throw _0x2990c7;});}return _0xefa68f;});}})[_0x80c5('0x29')](respondWithResult(_0x8cae7f,0xc9))['catch'](handleError(_0x8cae7f,null));};exports[_0x80c5('0x5a')]=function(_0x24e547,_0x16b23c){if(_0x24e547[_0x80c5('0x4e')]['id']){delete _0x24e547['body']['id'];}return db[_0x80c5('0x31')][_0x80c5('0x4c')]({'where':{'id':_0x24e547[_0x80c5('0x4a')]['id']}})[_0x80c5('0x29')](handleEntityNotFound(_0x16b23c,null))[_0x80c5('0x29')](saveUpdates(_0x24e547[_0x80c5('0x4e')],null))['then'](respondWithResult(_0x16b23c,null))[_0x80c5('0x48')](handleError(_0x16b23c,null));};exports['destroy']=function(_0x438c3c,_0x51f595){return db[_0x80c5('0x31')][_0x80c5('0x4c')]({'where':{'id':_0x438c3c['params']['id']}})['then'](handleEntityNotFound(_0x51f595,null))[_0x80c5('0x29')](removeEntity(_0x51f595,null))[_0x80c5('0x48')](handleError(_0x51f595,null));};function widgetAttributes(_0x423b6d){try{switch(_0x423b6d[_0x80c5('0x5b')]){case _0x80c5('0x5c'):return[{'name':_0x80c5('0x5d'),'value':_0x423b6d['attrUrl']||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x0]?_0x423b6d[_0x80c5('0x5e')][0x0][_0x80c5('0x5f')]:undefined)||'https://'}];case _0x80c5('0x60'):return[{'name':_0x80c5('0x61'),'value':_0x423b6d['attrPath']||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x0]?_0x423b6d[_0x80c5('0x5e')][0x0][_0x80c5('0x5f')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x423b6d[_0x80c5('0x62')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d['attrs'][0x0]?_0x423b6d[_0x80c5('0x5e')][0x0][_0x80c5('0x5f')]:undefined)||_0x80c5('0x63')},{'name':_0x80c5('0x64'),'value':_0x423b6d[_0x80c5('0x64')]||(_0x423b6d['attrs']&&_0x423b6d[_0x80c5('0x5e')][0x1]?_0x423b6d[_0x80c5('0x5e')][0x1][_0x80c5('0x5f')]:undefined)||_0x80c5('0x65')},{'name':_0x80c5('0x66'),'value':_0x423b6d[_0x80c5('0x66')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x2]?_0x423b6d[_0x80c5('0x5e')][0x2][_0x80c5('0x5f')]:undefined)||0xc}];case _0x80c5('0x67'):return[{'name':'attrMetric','value':_0x423b6d['attrMetric']||(_0x423b6d['attrs']&&_0x423b6d[_0x80c5('0x5e')][0x0]?_0x423b6d[_0x80c5('0x5e')][0x0][_0x80c5('0x5f')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x423b6d[_0x80c5('0x68')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x1]?_0x423b6d[_0x80c5('0x5e')][0x1][_0x80c5('0x5f')]:undefined)||[]},{'name':_0x80c5('0x66'),'value':_0x423b6d['attrFontSize']||(_0x423b6d['attrs']&&_0x423b6d[_0x80c5('0x5e')][0x2]?_0x423b6d[_0x80c5('0x5e')][0x2][_0x80c5('0x5f')]:undefined)||0x14},{'name':_0x80c5('0x69'),'value':_0x423b6d[_0x80c5('0x69')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x3]?_0x423b6d[_0x80c5('0x5e')][0x3][_0x80c5('0x5f')]:undefined)||_0x80c5('0x6a')},{'name':_0x80c5('0x6b'),'value':_0x423b6d['attrEmailAccounts']||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x4]?_0x423b6d[_0x80c5('0x5e')][0x4]['value']:undefined)||''},{'name':_0x80c5('0x6c'),'value':_0x423b6d[_0x80c5('0x6c')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d['attrs'][0x5]?_0x423b6d[_0x80c5('0x5e')][0x5][_0x80c5('0x5f')]:undefined)||''},{'name':_0x80c5('0x6d'),'value':_0x423b6d[_0x80c5('0x6d')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x6]?_0x423b6d[_0x80c5('0x5e')][0x6][_0x80c5('0x5f')]:undefined)||''},{'name':_0x80c5('0x6e'),'value':_0x423b6d[_0x80c5('0x6e')]||(_0x423b6d['attrs']&&_0x423b6d[_0x80c5('0x5e')][0x7]?_0x423b6d[_0x80c5('0x5e')][0x7][_0x80c5('0x5f')]:undefined)||''},{'name':_0x80c5('0x6f'),'value':_0x423b6d[_0x80c5('0x6f')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x8]?_0x423b6d[_0x80c5('0x5e')][0x8][_0x80c5('0x5f')]:undefined)||''},{'name':_0x80c5('0x70'),'value':_0x423b6d['attrChatWebsites']||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x9]?_0x423b6d[_0x80c5('0x5e')][0x9][_0x80c5('0x5f')]:undefined)||''}];case'multibar-chart':case _0x80c5('0x71'):return[{'name':_0x80c5('0x72'),'value':_0x423b6d[_0x80c5('0x72')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x0]?_0x423b6d['attrs'][0x0][_0x80c5('0x5f')]:undefined)||_0x80c5('0x73')},{'name':_0x80c5('0x74'),'value':_0x423b6d[_0x80c5('0x74')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d['attrs'][0x1]?_0x423b6d[_0x80c5('0x5e')][0x1][_0x80c5('0x5f')]:undefined)||null},{'name':'attrSerie3','value':_0x423b6d[_0x80c5('0x75')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d['attrs'][0x2]?_0x423b6d['attrs'][0x2][_0x80c5('0x5f')]:undefined)||null},{'name':_0x80c5('0x68'),'value':_0x423b6d[_0x80c5('0x68')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x3]?_0x423b6d[_0x80c5('0x5e')][0x3]['value']:undefined)||[]},{'name':_0x80c5('0x69'),'value':_0x423b6d['attrChannel']||(_0x423b6d['attrs']&&_0x423b6d[_0x80c5('0x5e')][0x4]?_0x423b6d[_0x80c5('0x5e')][0x4]['value']:undefined)||'voice'},{'name':_0x80c5('0x6b'),'value':_0x423b6d[_0x80c5('0x6b')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d['attrs'][0x5]?_0x423b6d[_0x80c5('0x5e')][0x5][_0x80c5('0x5f')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x423b6d['attrFaxAccounts']||(_0x423b6d['attrs']&&_0x423b6d[_0x80c5('0x5e')][0x6]?_0x423b6d[_0x80c5('0x5e')][0x6][_0x80c5('0x5f')]:undefined)||''},{'name':_0x80c5('0x6d'),'value':_0x423b6d[_0x80c5('0x6d')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x7]?_0x423b6d[_0x80c5('0x5e')][0x7][_0x80c5('0x5f')]:undefined)||''},{'name':_0x80c5('0x6e'),'value':_0x423b6d[_0x80c5('0x6e')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d['attrs'][0x8]?_0x423b6d[_0x80c5('0x5e')][0x8][_0x80c5('0x5f')]:undefined)||''},{'name':_0x80c5('0x6f'),'value':_0x423b6d['attrWhatsappAccounts']||(_0x423b6d['attrs']&&_0x423b6d['attrs'][0x9]?_0x423b6d[_0x80c5('0x5e')][0x9]['value']:undefined)||''},{'name':_0x80c5('0x70'),'value':_0x423b6d[_0x80c5('0x70')]||(_0x423b6d['attrs']&&_0x423b6d[_0x80c5('0x5e')][0xa]?_0x423b6d[_0x80c5('0x5e')][0xa][_0x80c5('0x5f')]:undefined)||''}];case _0x80c5('0x76'):return[{'name':'attrReport','type':_0x423b6d[_0x80c5('0x77')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x0]?_0x423b6d['attrs'][0x0][_0x80c5('0x5b')]:undefined)||null,'value':_0x423b6d[_0x80c5('0x78')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x0]?_0x423b6d[_0x80c5('0x5e')][0x0][_0x80c5('0x5f')]:undefined)||null},{'name':_0x80c5('0x79'),'value':_0x423b6d[_0x80c5('0x79')]||(_0x423b6d[_0x80c5('0x5e')]&&_0x423b6d[_0x80c5('0x5e')][0x1]?_0x423b6d[_0x80c5('0x5e')][0x1][_0x80c5('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x2f0f80){logger[_0x80c5('0x55')](_0x80c5('0x7a'),JSON['stringify'](_0x2f0f80));return[];}}exports[_0x80c5('0x7b')]=function(_0x3f7f0f,_0x262fa5,_0x57aed8){if(_0x3f7f0f[_0x80c5('0x4e')]['id']){delete _0x3f7f0f[_0x80c5('0x4e')]['id'];}return db[_0x80c5('0x31')]['find']({'where':{'id':_0x3f7f0f['params']['id']}})[_0x80c5('0x29')](handleEntityNotFound(_0x262fa5,null))[_0x80c5('0x29')](function(_0x520274){if(_0x520274){_0x3f7f0f['body'][_0x80c5('0x7c')]=_0x520274['id'];_0x3f7f0f[_0x80c5('0x4e')][_0x80c5('0x5e')]=widgetAttributes(_0x3f7f0f[_0x80c5('0x4e')]);return db[_0x80c5('0x7d')][_0x80c5('0x4d')](_0x3f7f0f[_0x80c5('0x4e')]);}})[_0x80c5('0x29')](respondWithResult(_0x262fa5,null))[_0x80c5('0x48')](handleError(_0x262fa5,null));};exports['getItems']=function(_0x7f5e51,_0x5a91b5,_0x46d9c1){var _0x6aafce={};var _0x15021f={};var _0x3fa32d;var _0x250443;return db[_0x80c5('0x31')][_0x80c5('0x7e')]({'where':{'id':_0x7f5e51['params']['id']}})['then'](handleEntityNotFound(_0x5a91b5,null))[_0x80c5('0x29')](function(_0x47f41c){if(_0x47f41c){_0x3fa32d=_0x47f41c;_0x15021f[_0x80c5('0x39')]=_[_0x80c5('0x36')](db[_0x80c5('0x7d')][_0x80c5('0x32')]);_0x15021f[_0x80c5('0x35')]=_[_0x80c5('0x36')](_0x7f5e51[_0x80c5('0x35')]);_0x15021f[_0x80c5('0x37')]=_[_0x80c5('0x38')](_0x15021f['model'],_0x15021f[_0x80c5('0x35')]);_0x6aafce[_0x80c5('0x3b')]=_[_0x80c5('0x38')](_0x15021f['model'],qs[_0x80c5('0x3a')](_0x7f5e51[_0x80c5('0x35')][_0x80c5('0x3a')]));_0x6aafce['attributes']=_0x6aafce[_0x80c5('0x3b')][_0x80c5('0x4b')]?_0x6aafce[_0x80c5('0x3b')]:_0x15021f[_0x80c5('0x39')];_0x6aafce[_0x80c5('0x7f')]=qs[_0x80c5('0x3e')](_0x7f5e51[_0x80c5('0x35')][_0x80c5('0x3e')]);_0x6aafce[_0x80c5('0x3f')]=qs[_0x80c5('0x37')](_[_0x80c5('0x80')](_0x7f5e51[_0x80c5('0x35')],_0x15021f[_0x80c5('0x37')]));if(_0x7f5e51[_0x80c5('0x35')]['filter']){_0x6aafce[_0x80c5('0x3f')]=_['merge'](_0x6aafce['where'],{'$or':_[_0x80c5('0x34')](_0x6aafce[_0x80c5('0x3b')],function(_0x46cc29){var _0x4f6e7f={};_0x4f6e7f[_0x46cc29]={'$like':'%'+_0x7f5e51[_0x80c5('0x35')][_0x80c5('0x41')]+'%'};return _0x4f6e7f;})});}_0x6aafce=_[_0x80c5('0x42')]({},_0x6aafce,_0x7f5e51[_0x80c5('0x43')]);return _0x3fa32d['getItems'](_0x6aafce);}})[_0x80c5('0x29')](function(_0x175f64){if(_0x175f64){_0x250443=_0x175f64[_0x80c5('0x4b')];if(!_0x7f5e51[_0x80c5('0x35')][_0x80c5('0x3c')](_0x80c5('0x3d'))){_0x6aafce[_0x80c5('0x23')]=qs['limit'](_0x7f5e51['query'][_0x80c5('0x23')]);_0x6aafce[_0x80c5('0x20')]=qs['offset'](_0x7f5e51[_0x80c5('0x35')][_0x80c5('0x20')]);}return _0x3fa32d[_0x80c5('0x81')](_0x6aafce);}})[_0x80c5('0x29')](function(_0x41cc57){if(_0x41cc57){return _0x41cc57?{'count':_0x250443,'rows':_0x41cc57}:null;}})[_0x80c5('0x29')](respondWithResult(_0x5a91b5,null))[_0x80c5('0x48')](handleError(_0x5a91b5,null));}; \ No newline at end of file +var _0x29fa=['querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','sendStatus','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','name','send','index','map','Dashboard','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','clone','find','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','attrs','https://','custom','attrPath','clock','attrHourFormat','value','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie3','attrOpenchannelAccounts','web-report','attrReport','reportType','stringify','DashboardId','DashboardItem','pick','getItems','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x31e5e7,_0x50a4c2){var _0x2fd580=function(_0x40a580){while(--_0x40a580){_0x31e5e7['push'](_0x31e5e7['shift']());}};_0x2fd580(++_0x50a4c2);}(_0x29fa,0x70));var _0xa29f=function(_0x189305,_0x46c43f){_0x189305=_0x189305-0x0;var _0xea3406=_0x29fa[_0x189305];return _0xea3406;};'use strict';var emlformat=require(_0xa29f('0x0'));var rimraf=require(_0xa29f('0x1'));var zipdir=require(_0xa29f('0x2'));var jsonpatch=require(_0xa29f('0x3'));var rp=require('request-promise');var moment=require(_0xa29f('0x4'));var BPromise=require(_0xa29f('0x5'));var Mustache=require(_0xa29f('0x6'));var util=require('util');var path=require(_0xa29f('0x7'));var sox=require(_0xa29f('0x8'));var csv=require(_0xa29f('0x9'));var ejs=require(_0xa29f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa29f('0xb'));var squel=require(_0xa29f('0xc'));var crypto=require(_0xa29f('0xd'));var jsforce=require(_0xa29f('0xe'));var deskjs=require(_0xa29f('0xf'));var toCsv=require(_0xa29f('0x9'));var querystring=require(_0xa29f('0x10'));var Papa=require(_0xa29f('0x11'));var Redis=require(_0xa29f('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa29f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa29f('0x14'))(_0xa29f('0x15'));var utils=require(_0xa29f('0x16'));var config=require(_0xa29f('0x17'));var licenseUtil=require(_0xa29f('0x18'));var db=require(_0xa29f('0x19'))['db'];config[_0xa29f('0x1a')]=_[_0xa29f('0x1b')](config[_0xa29f('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xa29f('0x1c'))(new Redis(config['redis']));require(_0xa29f('0x1d'))['register'](socket);function respondWithStatusCode(_0x1a856a,_0x463308){_0x463308=_0x463308||0xcc;return function(_0x4b148c){if(_0x4b148c){return _0x1a856a[_0xa29f('0x1e')](_0x463308);}return _0x1a856a['status'](_0x463308)['end']();};}function respondWithResult(_0x13cc5e,_0x49090e){_0x49090e=_0x49090e||0xc8;return function(_0x312c85){if(_0x312c85){return _0x13cc5e['status'](_0x49090e)['json'](_0x312c85);}};}function respondWithFilteredResult(_0x1d1419,_0x4ded5d){return function(_0x39dad5){if(_0x39dad5){var _0x396d76=typeof _0x4ded5d[_0xa29f('0x1f')]===_0xa29f('0x20')&&typeof _0x4ded5d[_0xa29f('0x21')]===_0xa29f('0x20');var _0x4d026f=_0x39dad5[_0xa29f('0x22')];var _0x47d351=_0x396d76?0x0:_0x4ded5d[_0xa29f('0x1f')];var _0x56aab6=_0x396d76?_0x39dad5[_0xa29f('0x22')]:_0x4ded5d[_0xa29f('0x1f')]+_0x4ded5d[_0xa29f('0x21')];var _0x25fb27;if(_0x56aab6>=_0x4d026f){_0x56aab6=_0x4d026f;_0x25fb27=0xc8;}else{_0x25fb27=0xce;}_0x1d1419[_0xa29f('0x23')](_0x25fb27);return _0x1d1419[_0xa29f('0x24')](_0xa29f('0x25'),_0x47d351+'-'+_0x56aab6+'/'+_0x4d026f)[_0xa29f('0x26')](_0x39dad5);}return null;};}function patchUpdates(_0x119d08){return function(_0x1503c4){try{jsonpatch[_0xa29f('0x27')](_0x1503c4,_0x119d08,!![]);}catch(_0x5c9753){return BPromise[_0xa29f('0x28')](_0x5c9753);}return _0x1503c4[_0xa29f('0x29')]();};}function saveUpdates(_0x3c0825,_0x3a847b){return function(_0x3de9c1){if(_0x3de9c1){return _0x3de9c1[_0xa29f('0x2a')](_0x3c0825)[_0xa29f('0x2b')](function(_0x1e49f4){return _0x1e49f4;});}return null;};}function removeEntity(_0xa5e6a8,_0x29c97d){return function(_0x2e89f9){if(_0x2e89f9){return _0x2e89f9[_0xa29f('0x2c')]()['then'](function(){var _0xf46ce0=_0x2e89f9[_0xa29f('0x2d')]({'plain':!![]});var _0x5edcaf='CustomDashboards';return db[_0xa29f('0x2e')]['destroy']({'where':{'type':_0x5edcaf,'resourceId':_0xf46ce0['id']}})[_0xa29f('0x2b')](function(){return _0x2e89f9;});})[_0xa29f('0x2b')](function(){_0xa5e6a8[_0xa29f('0x23')](0xcc)[_0xa29f('0x2f')]();});}};}function handleEntityNotFound(_0x22b784,_0x5f61d6){return function(_0xcb5c80){if(!_0xcb5c80){_0x22b784[_0xa29f('0x1e')](0x194);}return _0xcb5c80;};}function handleError(_0x92833f,_0x346ab9){_0x346ab9=_0x346ab9||0x1f4;return function(_0x7b3fa4){logger[_0xa29f('0x30')](_0x7b3fa4['stack']);if(_0x7b3fa4['name']){delete _0x7b3fa4[_0xa29f('0x31')];}_0x92833f[_0xa29f('0x23')](_0x346ab9)[_0xa29f('0x32')](_0x7b3fa4);};}exports[_0xa29f('0x33')]=function(_0x5b06d7,_0x36f853){var _0x421823={},_0xdf44bd={},_0x463133={'count':0x0,'rows':[]};var _0x56d8ed=_[_0xa29f('0x34')](db[_0xa29f('0x35')][_0xa29f('0x36')],function(_0x498901){return{'name':_0x498901['fieldName'],'type':_0x498901[_0xa29f('0x37')][_0xa29f('0x38')]};});_0xdf44bd[_0xa29f('0x39')]=_[_0xa29f('0x34')](_0x56d8ed,_0xa29f('0x31'));_0xdf44bd['query']=_[_0xa29f('0x3a')](_0x5b06d7[_0xa29f('0x3b')]);_0xdf44bd[_0xa29f('0x3c')]=_[_0xa29f('0x3d')](_0xdf44bd[_0xa29f('0x39')],_0xdf44bd['query']);_0x421823[_0xa29f('0x3e')]=_[_0xa29f('0x3d')](_0xdf44bd['model'],qs['fields'](_0x5b06d7['query'][_0xa29f('0x3f')]));_0x421823[_0xa29f('0x3e')]=_0x421823['attributes'][_0xa29f('0x40')]?_0x421823[_0xa29f('0x3e')]:_0xdf44bd[_0xa29f('0x39')];if(!_0x5b06d7['query']['hasOwnProperty'](_0xa29f('0x41'))){_0x421823[_0xa29f('0x21')]=qs['limit'](_0x5b06d7[_0xa29f('0x3b')][_0xa29f('0x21')]);_0x421823[_0xa29f('0x1f')]=qs[_0xa29f('0x1f')](_0x5b06d7[_0xa29f('0x3b')]['offset']);}_0x421823['order']=qs['sort'](_0x5b06d7[_0xa29f('0x3b')][_0xa29f('0x42')]);_0x421823[_0xa29f('0x43')]=qs['filters'](_['pick'](_0x5b06d7[_0xa29f('0x3b')],_0xdf44bd[_0xa29f('0x3c')]),_0x56d8ed);if(_0x5b06d7[_0xa29f('0x3b')][_0xa29f('0x44')]){_0x421823[_0xa29f('0x43')]=_[_0xa29f('0x45')](_0x421823[_0xa29f('0x43')],{'$or':_[_0xa29f('0x34')](_0x56d8ed,function(_0x58acf6){if(_0x58acf6[_0xa29f('0x37')]!==_0xa29f('0x46')){var _0x276221={};_0x276221[_0x58acf6[_0xa29f('0x31')]]={'$like':'%'+_0x5b06d7[_0xa29f('0x3b')][_0xa29f('0x44')]+'%'};return _0x276221;}})});}_0x421823=_[_0xa29f('0x45')]({},_0x421823,_0x5b06d7['options']);var _0x4e9cd6={'where':_0x421823[_0xa29f('0x43')]};return db[_0xa29f('0x35')]['count'](_0x4e9cd6)[_0xa29f('0x2b')](function(_0x5600e7){_0x463133[_0xa29f('0x22')]=_0x5600e7;if(_0x5b06d7[_0xa29f('0x3b')][_0xa29f('0x47')]){_0x421823[_0xa29f('0x48')]=[{'all':!![]}];}return db['Dashboard'][_0xa29f('0x49')](_0x421823);})[_0xa29f('0x2b')](function(_0xb950f4){_0x463133['rows']=_0xb950f4;return _0x463133;})[_0xa29f('0x2b')](respondWithFilteredResult(_0x36f853,_0x421823))['catch'](handleError(_0x36f853,null));};exports[_0xa29f('0x4a')]=function(_0xf1a72e,_0x730601){var _0x12cd99={'raw':![],'where':{'id':_0xf1a72e[_0xa29f('0x4b')]['id']}},_0x154052={};_0x154052[_0xa29f('0x39')]=_['keys'](db[_0xa29f('0x35')]['rawAttributes']);_0x154052[_0xa29f('0x3b')]=_['keys'](_0xf1a72e[_0xa29f('0x3b')]);_0x154052['filters']=_[_0xa29f('0x3d')](_0x154052[_0xa29f('0x39')],_0x154052[_0xa29f('0x3b')]);_0x12cd99[_0xa29f('0x3e')]=_['intersection'](_0x154052[_0xa29f('0x39')],qs['fields'](_0xf1a72e['query'][_0xa29f('0x3f')]));_0x12cd99[_0xa29f('0x3e')]=_0x12cd99['attributes']['length']?_0x12cd99[_0xa29f('0x3e')]:_0x154052[_0xa29f('0x39')];if(_0xf1a72e[_0xa29f('0x3b')][_0xa29f('0x47')]){_0x12cd99[_0xa29f('0x48')]=[{'all':!![]}];}_0x12cd99=_[_0xa29f('0x45')]({},_0x12cd99,_0xf1a72e[_0xa29f('0x4c')]);return db[_0xa29f('0x35')]['find'](_0x12cd99)[_0xa29f('0x2b')](handleEntityNotFound(_0x730601,null))[_0xa29f('0x2b')](respondWithResult(_0x730601,null))[_0xa29f('0x4d')](handleError(_0x730601,null));};exports[_0xa29f('0x4e')]=function(_0xc34def,_0x4cf260){return db['Dashboard'][_0xa29f('0x4e')](_0xc34def[_0xa29f('0x4f')],{})[_0xa29f('0x2b')](function(_0x108cca){var _0x22a8d9=_0xc34def[_0xa29f('0x50')]['get']({'plain':!![]});if(!_0x22a8d9)throw new Error(_0xa29f('0x51'));if(_0x22a8d9[_0xa29f('0x52')]===_0xa29f('0x50')){var _0x38c286=_0x108cca['get']({'plain':!![]});var _0x4a6e8e=_0xa29f('0x53');return db[_0xa29f('0x54')]['find']({'where':{'name':_0x4a6e8e,'userProfileId':_0x22a8d9[_0xa29f('0x55')]},'raw':!![]})[_0xa29f('0x2b')](function(_0x5b2766){if(_0x5b2766&&_0x5b2766[_0xa29f('0x56')]===0x0){return db[_0xa29f('0x2e')][_0xa29f('0x4e')]({'name':_0x38c286[_0xa29f('0x31')],'resourceId':_0x38c286['id'],'type':_0x5b2766[_0xa29f('0x31')],'sectionId':_0x5b2766['id']},{})[_0xa29f('0x2b')](function(){return _0x108cca;});}else{return _0x108cca;}})['catch'](function(_0x1f2714){logger[_0xa29f('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f2714);throw _0x1f2714;});}return _0x108cca;})['then'](respondWithResult(_0x4cf260,0xc9))[_0xa29f('0x4d')](handleError(_0x4cf260,null));};exports[_0xa29f('0x57')]=function(_0x458e43,_0x28f71e){var _0x5edcce={'where':{'id':_0x458e43[_0xa29f('0x4b')]['id']}},_0x4db25f={};_0x4db25f[_0xa29f('0x39')]=_[_0xa29f('0x3a')](db[_0xa29f('0x35')]['rawAttributes']);_0x5edcce['attributes']=_[_0xa29f('0x3d')](_0x4db25f['model'],qs[_0xa29f('0x3f')](_0x458e43[_0xa29f('0x3b')]['fields']));_0x5edcce[_0xa29f('0x3e')]=_0x5edcce[_0xa29f('0x3e')][_0xa29f('0x40')]?_0x5edcce[_0xa29f('0x3e')]:_0x4db25f[_0xa29f('0x39')];if(_0x458e43[_0xa29f('0x3b')][_0xa29f('0x47')]){_0x5edcce[_0xa29f('0x48')]=[{'all':!![]}];}_0x5edcce=_['merge']({},_0x5edcce,_0x458e43[_0xa29f('0x4c')]);return db[_0xa29f('0x35')][_0xa29f('0x58')](_0x5edcce)[_0xa29f('0x2b')](handleEntityNotFound(_0x28f71e,null))[_0xa29f('0x2b')](function(_0x29f184){if(_0x29f184){var _0x2f8f35=_0x29f184[_0xa29f('0x2d')]({'plain':!![]});_0x2f8f35=qs[_0xa29f('0x59')](_0x2f8f35,['id',_0xa29f('0x5a'),_0xa29f('0x5b')]);_0x458e43[_0xa29f('0x4f')]=_['omit'](_0x458e43[_0xa29f('0x4f')],['id',_0xa29f('0x5a'),'updatedAt']);return db['Dashboard'][_0xa29f('0x4e')](_[_0xa29f('0x45')](_0x2f8f35,_0x458e43[_0xa29f('0x4f')]),{'include':_0x458e43[_0xa29f('0x3b')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x433bae){var _0x3e26c6=_0x458e43[_0xa29f('0x50')][_0xa29f('0x2d')]({'plain':!![]});if(!_0x3e26c6)throw new Error(_0xa29f('0x51'));if(_0x3e26c6['role']===_0xa29f('0x50')){var _0xb665ef=_0x433bae[_0xa29f('0x2d')]({'plain':!![]});var _0x85abdd=_0xa29f('0x53');return db[_0xa29f('0x54')]['find']({'where':{'name':_0x85abdd,'userProfileId':_0x3e26c6[_0xa29f('0x55')]},'raw':!![]})['then'](function(_0x37032f){if(_0x37032f&&_0x37032f['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xb665ef['name'],'resourceId':_0xb665ef['id'],'type':_0x37032f[_0xa29f('0x31')],'sectionId':_0x37032f['id']},{})[_0xa29f('0x2b')](function(){return _0x433bae;});}else{return _0x433bae;}})[_0xa29f('0x4d')](function(_0x165cc1){logger[_0xa29f('0x30')](_0xa29f('0x5c'),_0x165cc1);throw _0x165cc1;});}return _0x433bae;});}})['then'](respondWithResult(_0x28f71e,0xc9))['catch'](handleError(_0x28f71e,null));};exports['update']=function(_0x3f8937,_0x72a2e7){if(_0x3f8937[_0xa29f('0x4f')]['id']){delete _0x3f8937[_0xa29f('0x4f')]['id'];}return db[_0xa29f('0x35')][_0xa29f('0x58')]({'where':{'id':_0x3f8937[_0xa29f('0x4b')]['id']}})[_0xa29f('0x2b')](handleEntityNotFound(_0x72a2e7,null))[_0xa29f('0x2b')](saveUpdates(_0x3f8937[_0xa29f('0x4f')],null))[_0xa29f('0x2b')](respondWithResult(_0x72a2e7,null))[_0xa29f('0x4d')](handleError(_0x72a2e7,null));};exports['destroy']=function(_0x1099b9,_0x19e0ff){return db[_0xa29f('0x35')][_0xa29f('0x58')]({'where':{'id':_0x1099b9[_0xa29f('0x4b')]['id']}})[_0xa29f('0x2b')](handleEntityNotFound(_0x19e0ff,null))[_0xa29f('0x2b')](removeEntity(_0x19e0ff,null))[_0xa29f('0x4d')](handleError(_0x19e0ff,null));};function widgetAttributes(_0x1e8a22){try{switch(_0x1e8a22[_0xa29f('0x37')]){case'iframe':return[{'name':'attrUrl','value':_0x1e8a22['attrUrl']||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22['attrs'][0x0]?_0x1e8a22[_0xa29f('0x5d')][0x0]['value']:undefined)||_0xa29f('0x5e')}];case _0xa29f('0x5f'):return[{'name':_0xa29f('0x60'),'value':_0x1e8a22[_0xa29f('0x60')]||(_0x1e8a22['attrs']&&_0x1e8a22[_0xa29f('0x5d')][0x0]?_0x1e8a22['attrs'][0x0]['value']:undefined)||''}];case _0xa29f('0x61'):return[{'name':_0xa29f('0x62'),'value':_0x1e8a22[_0xa29f('0x62')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22['attrs'][0x0]?_0x1e8a22[_0xa29f('0x5d')][0x0][_0xa29f('0x63')]:undefined)||_0xa29f('0x64')},{'name':_0xa29f('0x65'),'value':_0x1e8a22['attrTimezone']||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x1]?_0x1e8a22[_0xa29f('0x5d')][0x1][_0xa29f('0x63')]:undefined)||_0xa29f('0x66')},{'name':_0xa29f('0x67'),'value':_0x1e8a22[_0xa29f('0x67')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x2]?_0x1e8a22['attrs'][0x2][_0xa29f('0x63')]:undefined)||0xc}];case _0xa29f('0x68'):return[{'name':_0xa29f('0x69'),'value':_0x1e8a22['attrMetric']||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x0]?_0x1e8a22[_0xa29f('0x5d')][0x0][_0xa29f('0x63')]:undefined)||_0xa29f('0x6a')},{'name':_0xa29f('0x6b'),'value':_0x1e8a22[_0xa29f('0x6b')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x1]?_0x1e8a22['attrs'][0x1][_0xa29f('0x63')]:undefined)||[]},{'name':_0xa29f('0x67'),'value':_0x1e8a22[_0xa29f('0x67')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x2]?_0x1e8a22[_0xa29f('0x5d')][0x2][_0xa29f('0x63')]:undefined)||0x14},{'name':_0xa29f('0x6c'),'value':_0x1e8a22[_0xa29f('0x6c')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x3]?_0x1e8a22[_0xa29f('0x5d')][0x3]['value']:undefined)||_0xa29f('0x6d')},{'name':_0xa29f('0x6e'),'value':_0x1e8a22[_0xa29f('0x6e')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22['attrs'][0x4]?_0x1e8a22[_0xa29f('0x5d')][0x4][_0xa29f('0x63')]:undefined)||''},{'name':_0xa29f('0x6f'),'value':_0x1e8a22[_0xa29f('0x6f')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x5]?_0x1e8a22[_0xa29f('0x5d')][0x5][_0xa29f('0x63')]:undefined)||''},{'name':_0xa29f('0x70'),'value':_0x1e8a22['attrSmsAccounts']||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x6]?_0x1e8a22['attrs'][0x6][_0xa29f('0x63')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x1e8a22['attrOpenchannelAccounts']||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x7]?_0x1e8a22[_0xa29f('0x5d')][0x7][_0xa29f('0x63')]:undefined)||''},{'name':_0xa29f('0x71'),'value':_0x1e8a22['attrWhatsappAccounts']||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x8]?_0x1e8a22[_0xa29f('0x5d')][0x8][_0xa29f('0x63')]:undefined)||''},{'name':_0xa29f('0x72'),'value':_0x1e8a22[_0xa29f('0x72')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x9]?_0x1e8a22['attrs'][0x9][_0xa29f('0x63')]:undefined)||''}];case _0xa29f('0x73'):case _0xa29f('0x74'):return[{'name':'attrSerie1','value':_0x1e8a22[_0xa29f('0x75')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x0]?_0x1e8a22[_0xa29f('0x5d')][0x0][_0xa29f('0x63')]:undefined)||_0xa29f('0x6a')},{'name':'attrSerie2','value':_0x1e8a22['attrSerie2']||(_0x1e8a22['attrs']&&_0x1e8a22[_0xa29f('0x5d')][0x1]?_0x1e8a22[_0xa29f('0x5d')][0x1][_0xa29f('0x63')]:undefined)||null},{'name':_0xa29f('0x76'),'value':_0x1e8a22[_0xa29f('0x76')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x2]?_0x1e8a22[_0xa29f('0x5d')][0x2][_0xa29f('0x63')]:undefined)||null},{'name':_0xa29f('0x6b'),'value':_0x1e8a22[_0xa29f('0x6b')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x3]?_0x1e8a22[_0xa29f('0x5d')][0x3][_0xa29f('0x63')]:undefined)||[]},{'name':_0xa29f('0x6c'),'value':_0x1e8a22['attrChannel']||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x4]?_0x1e8a22[_0xa29f('0x5d')][0x4][_0xa29f('0x63')]:undefined)||_0xa29f('0x6d')},{'name':_0xa29f('0x6e'),'value':_0x1e8a22[_0xa29f('0x6e')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x5]?_0x1e8a22[_0xa29f('0x5d')][0x5][_0xa29f('0x63')]:undefined)||''},{'name':_0xa29f('0x6f'),'value':_0x1e8a22['attrFaxAccounts']||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22['attrs'][0x6]?_0x1e8a22[_0xa29f('0x5d')][0x6][_0xa29f('0x63')]:undefined)||''},{'name':_0xa29f('0x70'),'value':_0x1e8a22[_0xa29f('0x70')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x7]?_0x1e8a22[_0xa29f('0x5d')][0x7]['value']:undefined)||''},{'name':_0xa29f('0x77'),'value':_0x1e8a22[_0xa29f('0x77')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x8]?_0x1e8a22[_0xa29f('0x5d')][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x1e8a22[_0xa29f('0x71')]||(_0x1e8a22['attrs']&&_0x1e8a22[_0xa29f('0x5d')][0x9]?_0x1e8a22[_0xa29f('0x5d')][0x9][_0xa29f('0x63')]:undefined)||''},{'name':_0xa29f('0x72'),'value':_0x1e8a22[_0xa29f('0x72')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0xa]?_0x1e8a22[_0xa29f('0x5d')][0xa][_0xa29f('0x63')]:undefined)||''}];case _0xa29f('0x78'):return[{'name':_0xa29f('0x79'),'type':_0x1e8a22[_0xa29f('0x7a')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x0]?_0x1e8a22['attrs'][0x0]['type']:undefined)||null,'value':_0x1e8a22[_0xa29f('0x79')]||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x0]?_0x1e8a22[_0xa29f('0x5d')][0x0][_0xa29f('0x63')]:undefined)||null},{'name':'attrRefresh','value':_0x1e8a22['attrRefresh']||(_0x1e8a22[_0xa29f('0x5d')]&&_0x1e8a22[_0xa29f('0x5d')][0x1]?_0x1e8a22[_0xa29f('0x5d')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x350777){logger['error']('widgetAttributes:\x20%s',JSON[_0xa29f('0x7b')](_0x350777));return[];}}exports['addItem']=function(_0x45922a,_0x13c108,_0x5c834c){if(_0x45922a[_0xa29f('0x4f')]['id']){delete _0x45922a['body']['id'];}return db[_0xa29f('0x35')][_0xa29f('0x58')]({'where':{'id':_0x45922a[_0xa29f('0x4b')]['id']}})[_0xa29f('0x2b')](handleEntityNotFound(_0x13c108,null))[_0xa29f('0x2b')](function(_0x45d8af){if(_0x45d8af){_0x45922a['body'][_0xa29f('0x7c')]=_0x45d8af['id'];_0x45922a[_0xa29f('0x4f')][_0xa29f('0x5d')]=widgetAttributes(_0x45922a[_0xa29f('0x4f')]);return db[_0xa29f('0x7d')][_0xa29f('0x4e')](_0x45922a[_0xa29f('0x4f')]);}})['then'](respondWithResult(_0x13c108,null))['catch'](handleError(_0x13c108,null));};exports['getItems']=function(_0x182a52,_0x4f2582,_0x3e180a){var _0x4c435f={};var _0xcdf2ff={};var _0x34fa8d;var _0x5d78dd;return db[_0xa29f('0x35')]['findOne']({'where':{'id':_0x182a52[_0xa29f('0x4b')]['id']}})[_0xa29f('0x2b')](handleEntityNotFound(_0x4f2582,null))['then'](function(_0x28ef96){if(_0x28ef96){_0x34fa8d=_0x28ef96;_0xcdf2ff[_0xa29f('0x39')]=_[_0xa29f('0x3a')](db[_0xa29f('0x7d')][_0xa29f('0x36')]);_0xcdf2ff[_0xa29f('0x3b')]=_['keys'](_0x182a52['query']);_0xcdf2ff[_0xa29f('0x3c')]=_[_0xa29f('0x3d')](_0xcdf2ff['model'],_0xcdf2ff[_0xa29f('0x3b')]);_0x4c435f[_0xa29f('0x3e')]=_[_0xa29f('0x3d')](_0xcdf2ff[_0xa29f('0x39')],qs[_0xa29f('0x3f')](_0x182a52[_0xa29f('0x3b')][_0xa29f('0x3f')]));_0x4c435f[_0xa29f('0x3e')]=_0x4c435f[_0xa29f('0x3e')]['length']?_0x4c435f['attributes']:_0xcdf2ff[_0xa29f('0x39')];_0x4c435f['order']=qs[_0xa29f('0x42')](_0x182a52['query']['sort']);_0x4c435f['where']=qs['filters'](_[_0xa29f('0x7e')](_0x182a52[_0xa29f('0x3b')],_0xcdf2ff[_0xa29f('0x3c')]));if(_0x182a52['query'][_0xa29f('0x44')]){_0x4c435f[_0xa29f('0x43')]=_['merge'](_0x4c435f[_0xa29f('0x43')],{'$or':_[_0xa29f('0x34')](_0x4c435f['attributes'],function(_0x2a228f){var _0x1beb20={};_0x1beb20[_0x2a228f]={'$like':'%'+_0x182a52[_0xa29f('0x3b')]['filter']+'%'};return _0x1beb20;})});}_0x4c435f=_[_0xa29f('0x45')]({},_0x4c435f,_0x182a52[_0xa29f('0x4c')]);return _0x34fa8d[_0xa29f('0x7f')](_0x4c435f);}})[_0xa29f('0x2b')](function(_0x489192){if(_0x489192){_0x5d78dd=_0x489192['length'];if(!_0x182a52['query']['hasOwnProperty'](_0xa29f('0x41'))){_0x4c435f['limit']=qs[_0xa29f('0x21')](_0x182a52[_0xa29f('0x3b')][_0xa29f('0x21')]);_0x4c435f[_0xa29f('0x1f')]=qs[_0xa29f('0x1f')](_0x182a52[_0xa29f('0x3b')][_0xa29f('0x1f')]);}return _0x34fa8d[_0xa29f('0x7f')](_0x4c435f);}})['then'](function(_0x1eda11){if(_0x1eda11){return _0x1eda11?{'count':_0x5d78dd,'rows':_0x1eda11}:null;}})[_0xa29f('0x2b')](respondWithResult(_0x4f2582,null))[_0xa29f('0x4d')](handleError(_0x4f2582,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 74b2d01..df239bf 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 _0x4f88=['hasOwnProperty','exports','events','../../mysqldb','Dashboard','save','update','emit'];(function(_0x10f568,_0x2a58b2){var _0x306173=function(_0x21469d){while(--_0x21469d){_0x10f568['push'](_0x10f568['shift']());}};_0x306173(++_0x2a58b2);}(_0x4f88,0x9a));var _0x84f8=function(_0x2ad008,_0x45c253){_0x2ad008=_0x2ad008-0x0;var _0x4538cf=_0x4f88[_0x2ad008];return _0x4538cf;};'use strict';var EventEmitter=require(_0x84f8('0x0'));var Dashboard=require(_0x84f8('0x1'))['db'][_0x84f8('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x84f8('0x3'),'afterUpdate':_0x84f8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x407ed1){return function(_0x31def4,_0x1b35aa,_0x5a230d){DashboardEvents[_0x84f8('0x5')](_0x407ed1+':'+_0x31def4['id'],_0x31def4);DashboardEvents[_0x84f8('0x5')](_0x407ed1,_0x31def4);_0x5a230d(null);};}for(var e in events){if(events[_0x84f8('0x6')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x84f8('0x7')]=DashboardEvents; \ No newline at end of file +var _0xcf58=['hasOwnProperty','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x322a45,_0x2a3066){var _0x3132af=function(_0xb38d6b){while(--_0xb38d6b){_0x322a45['push'](_0x322a45['shift']());}};_0x3132af(++_0x2a3066);}(_0xcf58,0x86));var _0x8cf5=function(_0x5f297b,_0x5ccc16){_0x5f297b=_0x5f297b-0x0;var _0x597f7e=_0xcf58[_0x5f297b];return _0x597f7e;};'use strict';var EventEmitter=require(_0x8cf5('0x0'));var Dashboard=require(_0x8cf5('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x8cf5('0x2')](0x0);var events={'afterCreate':_0x8cf5('0x3'),'afterUpdate':'update','afterDestroy':_0x8cf5('0x4')};function emitEvent(_0x267892){return function(_0x42133b,_0x15a06f,_0x595846){DashboardEvents[_0x8cf5('0x5')](_0x267892+':'+_0x42133b['id'],_0x42133b);DashboardEvents[_0x8cf5('0x5')](_0x267892,_0x42133b);_0x595846(null);};}for(var e in events){if(events[_0x8cf5('0x6')](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 58ffa63..7fa3855 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 _0x4cfa=['../../config/environment','exports','define','Dashboard','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x5d2bbb,_0xb82d09){var _0x502c6f=function(_0x170ae4){while(--_0x170ae4){_0x5d2bbb['push'](_0x5d2bbb['shift']());}};_0x502c6f(++_0xb82d09);}(_0x4cfa,0x7c));var _0xa4cf=function(_0x45f6ed,_0x1ee60e){_0x45f6ed=_0x45f6ed-0x0;var _0x2cb68b=_0x4cfa[_0x45f6ed];return _0x2cb68b;};'use strict';var _=require(_0xa4cf('0x0'));var util=require(_0xa4cf('0x1'));var logger=require(_0xa4cf('0x2'))(_0xa4cf('0x3'));var moment=require(_0xa4cf('0x4'));var BPromise=require(_0xa4cf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa4cf('0x6'));var rimraf=require(_0xa4cf('0x7'));var config=require(_0xa4cf('0x8'));var attributes=require('./dashboard.attributes');module[_0xa4cf('0x9')]=function(_0x111808,_0x3564d1){return _0x111808[_0xa4cf('0xa')](_0xa4cf('0xb'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81aa=['rimraf','../../config/environment','./dashboard.attributes','define','Dashboard','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x11cc42,_0x313c7d){var _0x45b7e4=function(_0x4ee48b){while(--_0x4ee48b){_0x11cc42['push'](_0x11cc42['shift']());}};_0x45b7e4(++_0x313c7d);}(_0x81aa,0x94));var _0xa81a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x81aa[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xa81a('0x0'));var util=require(_0xa81a('0x1'));var logger=require(_0xa81a('0x2'))('api');var moment=require(_0xa81a('0x3'));var BPromise=require('bluebird');var rp=require(_0xa81a('0x4'));var fs=require('fs');var path=require(_0xa81a('0x5'));var rimraf=require(_0xa81a('0x6'));var config=require(_0xa81a('0x7'));var attributes=require(_0xa81a('0x8'));module['exports']=function(_0x3d3112,_0x2466e9){return _0x3d3112[_0xa81a('0x9')](_0xa81a('0xa'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 73dc096..1d2bc01 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 _0xe733=['moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x3a260f,_0x2bdd12){var _0x1a2696=function(_0xae5751){while(--_0xae5751){_0x3a260f['push'](_0x3a260f['shift']());}};_0x1a2696(++_0x2bdd12);}(_0xe733,0x66));var _0x3e73=function(_0x47094e,_0x55a6d6){_0x47094e=_0x47094e-0x0;var _0x197cbf=_0xe733[_0x47094e];return _0x197cbf;};'use strict';var _=require(_0x3e73('0x0'));var util=require(_0x3e73('0x1'));var moment=require(_0x3e73('0x2'));var BPromise=require(_0x3e73('0x3'));var rs=require(_0x3e73('0x4'));var fs=require('fs');var Redis=require(_0x3e73('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3e73('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3e73('0x7'));var client=jayson[_0x3e73('0x8')][_0x3e73('0x9')]({'port':0x232a});config['redis']=_[_0x3e73('0xa')](config[_0x3e73('0xb')],{'host':_0x3e73('0xc'),'port':0x18eb});var socket=require(_0x3e73('0xd'))(new Redis(config['redis']));require(_0x3e73('0xe'))[_0x3e73('0xf')](socket);function respondWithRpcPromise(_0x2245e7,_0x156a97,_0x3f5e99){return new BPromise(function(_0x1df00a,_0x48eaff){return client['request'](_0x2245e7,_0x3f5e99)[_0x3e73('0x10')](function(_0x24bb05){logger[_0x3e73('0x11')](_0x3e73('0x12'),_0x156a97,_0x3e73('0x13'));logger['debug'](_0x3e73('0x14'),_0x156a97,'request\x20sent',JSON['stringify'](_0x24bb05));if(_0x24bb05['error']){if(_0x24bb05[_0x3e73('0x15')][_0x3e73('0x16')]===0x1f4){logger[_0x3e73('0x15')](_0x3e73('0x12'),_0x156a97,_0x24bb05[_0x3e73('0x15')][_0x3e73('0x17')]);return _0x48eaff(_0x24bb05['error'][_0x3e73('0x17')]);}logger[_0x3e73('0x15')](_0x3e73('0x12'),_0x156a97,_0x24bb05['error'][_0x3e73('0x17')]);return _0x1df00a(_0x24bb05[_0x3e73('0x15')][_0x3e73('0x17')]);}else{logger[_0x3e73('0x11')](_0x3e73('0x12'),_0x156a97,_0x3e73('0x13'));_0x1df00a(_0x24bb05[_0x3e73('0x18')][_0x3e73('0x17')]);}})[_0x3e73('0x19')](function(_0xcb8eb1){logger[_0x3e73('0x15')]('Dashboard,\x20%s,\x20%s',_0x156a97,_0xcb8eb1);_0x48eaff(_0xcb8eb1);});});} \ No newline at end of file +var _0x68a7=['Dashboard,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','rpc','http','redis','socket.io-emitter','./dashboard.socket','register','request','info','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x98492e,_0x2d4fcf){var _0x531c5d=function(_0x58cc5f){while(--_0x58cc5f){_0x98492e['push'](_0x98492e['shift']());}};_0x531c5d(++_0x2d4fcf);}(_0x68a7,0x77));var _0x768a=function(_0x1f6896,_0x1d0112){_0x1f6896=_0x1f6896-0x0;var _0x77da76=_0x68a7[_0x1f6896];return _0x77da76;};'use strict';var _=require(_0x768a('0x0'));var util=require(_0x768a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x768a('0x2'));var fs=require('fs');var Redis=require(_0x768a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x768a('0x4'));var logger=require('../../config/logger')(_0x768a('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x768a('0x6')]({'port':0x232a});config['redis']=_['defaults'](config[_0x768a('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x768a('0x8'))(new Redis(config['redis']));require(_0x768a('0x9'))[_0x768a('0xa')](socket);function respondWithRpcPromise(_0xf01b26,_0x49c060,_0x54d989){return new BPromise(function(_0x35403f,_0x2710e7){return client[_0x768a('0xb')](_0xf01b26,_0x54d989)['then'](function(_0x45c176){logger[_0x768a('0xc')]('Dashboard,\x20%s,\x20%s',_0x49c060,'request\x20sent');logger[_0x768a('0xd')](_0x768a('0xe'),_0x49c060,_0x768a('0xf'),JSON[_0x768a('0x10')](_0x45c176));if(_0x45c176[_0x768a('0x11')]){if(_0x45c176[_0x768a('0x11')][_0x768a('0x12')]===0x1f4){logger['error'](_0x768a('0x13'),_0x49c060,_0x45c176[_0x768a('0x11')][_0x768a('0x14')]);return _0x2710e7(_0x45c176[_0x768a('0x11')]['message']);}logger[_0x768a('0x11')]('Dashboard,\x20%s,\x20%s',_0x49c060,_0x45c176[_0x768a('0x11')][_0x768a('0x14')]);return _0x35403f(_0x45c176[_0x768a('0x11')][_0x768a('0x14')]);}else{logger[_0x768a('0xc')](_0x768a('0x13'),_0x49c060,_0x768a('0xf'));_0x35403f(_0x45c176[_0x768a('0x15')]['message']);}})[_0x768a('0x16')](function(_0x348748){logger[_0x768a('0x11')]('Dashboard,\x20%s,\x20%s',_0x49c060,_0x348748);_0x2710e7(_0x348748);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 59b4e63..4ff40be 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 _0x6169=['length','./dashboard.events','save','remove','update','emit','removeListener','register'];(function(_0x74f951,_0x27bc7e){var _0x381b8c=function(_0x5ccf36){while(--_0x5ccf36){_0x74f951['push'](_0x74f951['shift']());}};_0x381b8c(++_0x27bc7e);}(_0x6169,0x171));var _0x9616=function(_0x111f49,_0x275b3b){_0x111f49=_0x111f49-0x0;var _0x585b90=_0x6169[_0x111f49];return _0x585b90;};'use strict';var DashboardEvents=require(_0x9616('0x0'));var events=[_0x9616('0x1'),_0x9616('0x2'),_0x9616('0x3')];function createListener(_0x5be951,_0x599e9d){return function(_0x109b24){_0x599e9d[_0x9616('0x4')](_0x5be951,_0x109b24);};}function removeListener(_0xe15cb4,_0x28757d){return function(){DashboardEvents[_0x9616('0x5')](_0xe15cb4,_0x28757d);};}exports[_0x9616('0x6')]=function(_0x4113f6){for(var _0x265c5c=0x0,_0x21edf9=events[_0x9616('0x7')];_0x265c5c<_0x21edf9;_0x265c5c++){var _0x539abd=events[_0x265c5c];var _0x11e789=createListener('dashboard:'+_0x539abd,_0x4113f6);DashboardEvents['on'](_0x539abd,_0x11e789);}}; \ No newline at end of file +var _0x4046=['./dashboard.events','save','remove','update','emit','removeListener','register','dashboard:'];(function(_0x522fa1,_0x3628f6){var _0x4d7caa=function(_0x327ee3){while(--_0x327ee3){_0x522fa1['push'](_0x522fa1['shift']());}};_0x4d7caa(++_0x3628f6);}(_0x4046,0x80));var _0x6404=function(_0x14f59f,_0x26fb6e){_0x14f59f=_0x14f59f-0x0;var _0x209f18=_0x4046[_0x14f59f];return _0x209f18;};'use strict';var DashboardEvents=require(_0x6404('0x0'));var events=[_0x6404('0x1'),_0x6404('0x2'),_0x6404('0x3')];function createListener(_0x2cd0f4,_0x333e2e){return function(_0x92efb6){_0x333e2e[_0x6404('0x4')](_0x2cd0f4,_0x92efb6);};}function removeListener(_0x4f83dc,_0x31b0e0){return function(){DashboardEvents[_0x6404('0x5')](_0x4f83dc,_0x31b0e0);};}exports[_0x6404('0x6')]=function(_0x1d12bf){for(var _0x4b97ac=0x0,_0x371ec0=events['length'];_0x4b97ac<_0x371ec0;_0x4b97ac++){var _0x511229=events[_0x4b97ac];var _0x8a8a17=createListener(_0x6404('0x7')+_0x511229,_0x1d12bf);DashboardEvents['on'](_0x511229,_0x8a8a17);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 6cd3816..6217948 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 _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','./dashboard.controller','isAuthenticated','index','/:id','get','/:id/items','getItems','post','/:id/clone','clone','addItem','delete','destroy','exports','multer','path','express','Router'];(function(_0x23bcf0,_0x26f9b5){var _0x18e991=function(_0x3f0493){while(--_0x3f0493){_0x23bcf0['push'](_0x23bcf0['shift']());}};_0x18e991(++_0x26f9b5);}(_0xe706,0x1ca));var _0x6e70=function(_0x45e5f2,_0xc803d0){_0x45e5f2=_0x45e5f2-0x0;var _0x333b0a=_0xe706[_0x45e5f2];return _0x333b0a;};'use strict';var multer=require(_0x6e70('0x0'));var util=require('util');var path=require(_0x6e70('0x1'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x2'));var router=express[_0x6e70('0x3')]();var fs_extra=require(_0x6e70('0x4'));var auth=require(_0x6e70('0x5'));var interaction=require(_0x6e70('0x6'));var config=require('../../config/environment');var controller=require(_0x6e70('0x7'));router['get']('/',auth[_0x6e70('0x8')](),controller[_0x6e70('0x9')]);router['get'](_0x6e70('0xa'),auth[_0x6e70('0x8')](),controller['show']);router[_0x6e70('0xb')](_0x6e70('0xc'),auth[_0x6e70('0x8')](),controller[_0x6e70('0xd')]);router[_0x6e70('0xe')]('/',auth[_0x6e70('0x8')](),controller['create']);router[_0x6e70('0xe')](_0x6e70('0xf'),auth['isAuthenticated'](),controller[_0x6e70('0x10')]);router[_0x6e70('0xe')](_0x6e70('0xc'),auth[_0x6e70('0x8')](),controller[_0x6e70('0x11')]);router['put'](_0x6e70('0xa'),auth[_0x6e70('0x8')](),controller['update']);router[_0x6e70('0x12')]('/:id',auth[_0x6e70('0x8')](),controller[_0x6e70('0x13')]);module[_0x6e70('0x14')]=router; \ No newline at end of file +var _0xfd88=['show','/:id/items','post','create','addItem','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id'];(function(_0x1fdf54,_0x5a646f){var _0x4c5e64=function(_0x1f59ad){while(--_0x1f59ad){_0x1fdf54['push'](_0x1fdf54['shift']());}};_0x4c5e64(++_0x5a646f);}(_0xfd88,0xb9));var _0x8fd8=function(_0x36de10,_0xfe25e8){_0x36de10=_0x36de10-0x0;var _0x58100f=_0xfd88[_0x36de10];return _0x58100f;};'use strict';var multer=require('multer');var util=require(_0x8fd8('0x0'));var path=require(_0x8fd8('0x1'));var timeout=require(_0x8fd8('0x2'));var express=require(_0x8fd8('0x3'));var router=express[_0x8fd8('0x4')]();var fs_extra=require(_0x8fd8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8fd8('0x6'));var config=require(_0x8fd8('0x7'));var controller=require(_0x8fd8('0x8'));router[_0x8fd8('0x9')]('/',auth[_0x8fd8('0xa')](),controller[_0x8fd8('0xb')]);router[_0x8fd8('0x9')](_0x8fd8('0xc'),auth[_0x8fd8('0xa')](),controller[_0x8fd8('0xd')]);router[_0x8fd8('0x9')](_0x8fd8('0xe'),auth[_0x8fd8('0xa')](),controller['getItems']);router[_0x8fd8('0xf')]('/',auth['isAuthenticated'](),controller[_0x8fd8('0x10')]);router['post']('/:id/clone',auth[_0x8fd8('0xa')](),controller['clone']);router[_0x8fd8('0xf')](_0x8fd8('0xe'),auth[_0x8fd8('0xa')](),controller[_0x8fd8('0x11')]);router[_0x8fd8('0x12')](_0x8fd8('0xc'),auth[_0x8fd8('0xa')](),controller[_0x8fd8('0x13')]);router[_0x8fd8('0x14')](_0x8fd8('0xc'),auth[_0x8fd8('0xa')](),controller[_0x8fd8('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 385ba49..425c61e 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 _0x6d38=['INTEGER','STRING','#2196f3','squel','lodash','exports','TEXT','parse','getDataValue','attrs','setDataValue','stringify'];(function(_0x34e6fc,_0x2d5181){var _0x1898fb=function(_0x5abf4a){while(--_0x5abf4a){_0x34e6fc['push'](_0x34e6fc['shift']());}};_0x1898fb(++_0x2d5181);}(_0x6d38,0x1ef));var _0x86d3=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x6d38[_0xefd519];return _0x4bb882;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x86d3('0x0'));var _=require(_0x86d3('0x1'));module[_0x86d3('0x2')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x86d3('0x3')]('long'),'get':function(){try{return JSON[_0x86d3('0x4')](this[_0x86d3('0x5')](_0x86d3('0x6')));}catch(_0x4ef557){return[];}},'set':function(_0x2d8272){try{this[_0x86d3('0x7')](_0x86d3('0x6'),JSON[_0x86d3('0x8')](_0x2d8272));}catch(_0x47e654){this['setDataValue'](_0x86d3('0x6'),JSON[_0x86d3('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x86d3('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x86d3('0x9')]},'background':{'type':Sequelize[_0x86d3('0xa')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x86d3('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x86d3('0xa')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0x2ef3=['parse','attrs','stringify','setDataValue','INTEGER','#2196f3','sequelize','squel','lodash','exports','STRING','long'];(function(_0x4b7640,_0x4d0174){var _0x9c27ed=function(_0x1b359f){while(--_0x1b359f){_0x4b7640['push'](_0x4b7640['shift']());}};_0x9c27ed(++_0x4d0174);}(_0x2ef3,0xba));var _0x32ef=function(_0x50c167,_0x1ab4b2){_0x50c167=_0x50c167-0x0;var _0x22e8b8=_0x2ef3[_0x50c167];return _0x22e8b8;};'use strict';var Sequelize=require(_0x32ef('0x0'));var squel=require(_0x32ef('0x1'));var _=require(_0x32ef('0x2'));module[_0x32ef('0x3')]={'title':{'type':Sequelize[_0x32ef('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x32ef('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x32ef('0x5')),'get':function(){try{return JSON[_0x32ef('0x6')](this['getDataValue'](_0x32ef('0x7')));}catch(_0x37dd1d){return[];}},'set':function(_0x4c8104){try{this['setDataValue'](_0x32ef('0x7'),JSON[_0x32ef('0x8')](_0x4c8104));}catch(_0x367c39){this[_0x32ef('0x9')](_0x32ef('0x7'),JSON[_0x32ef('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x32ef('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x32ef('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x32ef('0xa')]},'col':{'type':Sequelize[_0x32ef('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x32ef('0x4')],'allowNull':![],'defaultValue':_0x32ef('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x32ef('0x4')]},'titleFontSize':{'type':Sequelize[_0x32ef('0xa')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 14eb286..f77c299 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 _0xaaee=['web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','destroy','error','stack','name','send','show','model','DashboardItem','query','keys','filters','intersection','fields','attributes','includeAll','include','merge','then','find','params','catch','type','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3'];(function(_0x3cdcbb,_0x4b3090){var _0x511981=function(_0x4af9d7){while(--_0x4af9d7){_0x3cdcbb['push'](_0x3cdcbb['shift']());}};_0x511981(++_0x4b3090);}(_0xaaee,0x132));var _0xeaae=function(_0x4759f6,_0x478eed){_0x4759f6=_0x4759f6-0x0;var _0x174c81=_0xaaee[_0x4759f6];return _0x174c81;};'use strict';var emlformat=require(_0xeaae('0x0'));var rimraf=require(_0xeaae('0x1'));var zipdir=require(_0xeaae('0x2'));var jsonpatch=require(_0xeaae('0x3'));var rp=require(_0xeaae('0x4'));var moment=require('moment');var BPromise=require(_0xeaae('0x5'));var Mustache=require(_0xeaae('0x6'));var util=require(_0xeaae('0x7'));var path=require(_0xeaae('0x8'));var sox=require(_0xeaae('0x9'));var csv=require(_0xeaae('0xa'));var ejs=require(_0xeaae('0xb'));var fs=require('fs');var fs_extra=require(_0xeaae('0xc'));var _=require(_0xeaae('0xd'));var squel=require(_0xeaae('0xe'));var crypto=require(_0xeaae('0xf'));var jsforce=require(_0xeaae('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xeaae('0xa'));var querystring=require(_0xeaae('0x11'));var Papa=require('papaparse');var Redis=require(_0xeaae('0x12'));var authService=require(_0xeaae('0x13'));var qs=require(_0xeaae('0x14'));var as=require(_0xeaae('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeaae('0x16'));var utils=require(_0xeaae('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xeaae('0x18'));var db=require(_0xeaae('0x19'))['db'];config[_0xeaae('0x1a')]=_[_0xeaae('0x1b')](config['redis'],{'host':_0xeaae('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeaae('0x1a')]));require(_0xeaae('0x1d'))[_0xeaae('0x1e')](socket);function respondWithStatusCode(_0x35a31d,_0x261116){_0x261116=_0x261116||0xcc;return function(_0x29b982){if(_0x29b982){return _0x35a31d[_0xeaae('0x1f')](_0x261116);}return _0x35a31d[_0xeaae('0x20')](_0x261116)[_0xeaae('0x21')]();};}function respondWithResult(_0x39bada,_0x1277cf){_0x1277cf=_0x1277cf||0xc8;return function(_0x29d624){if(_0x29d624){return _0x39bada[_0xeaae('0x20')](_0x1277cf)['json'](_0x29d624);}};}function respondWithFilteredResult(_0x32ec1e,_0x5b3235){return function(_0x3ace1f){if(_0x3ace1f){var _0x10b6bf=typeof _0x5b3235[_0xeaae('0x22')]===_0xeaae('0x23')&&typeof _0x5b3235[_0xeaae('0x24')]===_0xeaae('0x23');var _0xeb2ecf=_0x3ace1f['count'];var _0x39ca53=_0x10b6bf?0x0:_0x5b3235[_0xeaae('0x22')];var _0x344171=_0x10b6bf?_0x3ace1f[_0xeaae('0x25')]:_0x5b3235[_0xeaae('0x22')]+_0x5b3235[_0xeaae('0x24')];var _0x57f8f9;if(_0x344171>=_0xeb2ecf){_0x344171=_0xeb2ecf;_0x57f8f9=0xc8;}else{_0x57f8f9=0xce;}_0x32ec1e[_0xeaae('0x20')](_0x57f8f9);return _0x32ec1e[_0xeaae('0x26')]('Content-Range',_0x39ca53+'-'+_0x344171+'/'+_0xeb2ecf)[_0xeaae('0x27')](_0x3ace1f);}return null;};}function patchUpdates(_0x5b69c1){return function(_0x3a14e6){try{jsonpatch[_0xeaae('0x28')](_0x3a14e6,_0x5b69c1,!![]);}catch(_0x2b7b6f){return BPromise[_0xeaae('0x29')](_0x2b7b6f);}return _0x3a14e6['save']();};}function saveUpdates(_0x445b35,_0x1e429d){return function(_0x324a1e){if(_0x324a1e){return _0x324a1e['update'](_0x445b35)['then'](function(_0x4129ed){return _0x4129ed;});}return null;};}function removeEntity(_0x305c15,_0x2d0ff4){return function(_0x1b37fe){if(_0x1b37fe){return _0x1b37fe[_0xeaae('0x2a')]()['then'](function(){_0x305c15[_0xeaae('0x20')](0xcc)[_0xeaae('0x21')]();});}};}function handleEntityNotFound(_0x54997c,_0x3433c4){return function(_0x3bd47a){if(!_0x3bd47a){_0x54997c[_0xeaae('0x1f')](0x194);}return _0x3bd47a;};}function handleError(_0x38729a,_0x4f4285){_0x4f4285=_0x4f4285||0x1f4;return function(_0x3ec714){logger[_0xeaae('0x2b')](_0x3ec714[_0xeaae('0x2c')]);if(_0x3ec714['name']){delete _0x3ec714[_0xeaae('0x2d')];}_0x38729a[_0xeaae('0x20')](_0x4f4285)[_0xeaae('0x2e')](_0x3ec714);};}exports[_0xeaae('0x2f')]=function(_0x1f09f4,_0x47f796){var _0x1a9967={'raw':![],'where':{'id':_0x1f09f4['params']['id']}},_0x3b73fa={};_0x3b73fa[_0xeaae('0x30')]=_['keys'](db[_0xeaae('0x31')]['rawAttributes']);_0x3b73fa[_0xeaae('0x32')]=_[_0xeaae('0x33')](_0x1f09f4['query']);_0x3b73fa[_0xeaae('0x34')]=_[_0xeaae('0x35')](_0x3b73fa[_0xeaae('0x30')],_0x3b73fa[_0xeaae('0x32')]);_0x1a9967['attributes']=_[_0xeaae('0x35')](_0x3b73fa[_0xeaae('0x30')],qs['fields'](_0x1f09f4['query'][_0xeaae('0x36')]));_0x1a9967[_0xeaae('0x37')]=_0x1a9967[_0xeaae('0x37')]['length']?_0x1a9967[_0xeaae('0x37')]:_0x3b73fa[_0xeaae('0x30')];if(_0x1f09f4[_0xeaae('0x32')][_0xeaae('0x38')]){_0x1a9967[_0xeaae('0x39')]=[{'all':!![]}];}_0x1a9967=_[_0xeaae('0x3a')]({},_0x1a9967,_0x1f09f4['options']);return db[_0xeaae('0x31')]['find'](_0x1a9967)[_0xeaae('0x3b')](handleEntityNotFound(_0x47f796,null))[_0xeaae('0x3b')](respondWithResult(_0x47f796,null))['catch'](handleError(_0x47f796,null));};exports[_0xeaae('0x2a')]=function(_0x15a7de,_0x1aa432){return db['DashboardItem'][_0xeaae('0x3c')]({'where':{'id':_0x15a7de[_0xeaae('0x3d')]['id']}})[_0xeaae('0x3b')](handleEntityNotFound(_0x1aa432,null))[_0xeaae('0x3b')](removeEntity(_0x1aa432,null))[_0xeaae('0x3e')](handleError(_0x1aa432,null));};function widgetAttributes(_0x38d86c){try{switch(_0x38d86c[_0xeaae('0x3f')]){case'iframe':return[{'name':_0xeaae('0x40'),'value':_0x38d86c[_0xeaae('0x40')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x0]?_0x38d86c[_0xeaae('0x41')][0x0][_0xeaae('0x42')]:undefined)||'https://'}];case'custom':return[{'name':_0xeaae('0x43'),'value':_0x38d86c[_0xeaae('0x43')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x0]?_0x38d86c[_0xeaae('0x41')][0x0][_0xeaae('0x42')]:undefined)||''}];case _0xeaae('0x44'):return[{'name':_0xeaae('0x45'),'value':_0x38d86c[_0xeaae('0x45')]||(_0x38d86c['attrs']&&_0x38d86c[_0xeaae('0x41')][0x0]?_0x38d86c['attrs'][0x0][_0xeaae('0x42')]:undefined)||_0xeaae('0x46')},{'name':'attrTimezone','value':_0x38d86c['attrTimezone']||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x1]?_0x38d86c['attrs'][0x1]['value']:undefined)||_0xeaae('0x47')},{'name':_0xeaae('0x48'),'value':_0x38d86c[_0xeaae('0x48')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x2]?_0x38d86c[_0xeaae('0x41')][0x2]['value']:undefined)||0xc}];case _0xeaae('0x49'):return[{'name':'attrMetric','value':_0x38d86c[_0xeaae('0x4a')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x0]?_0x38d86c[_0xeaae('0x41')][0x0]['value']:undefined)||_0xeaae('0x4b')},{'name':_0xeaae('0x4c'),'value':_0x38d86c['attrVoiceQueues']||(_0x38d86c['attrs']&&_0x38d86c['attrs'][0x1]?_0x38d86c['attrs'][0x1]['value']:undefined)||[]},{'name':_0xeaae('0x48'),'value':_0x38d86c[_0xeaae('0x48')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c['attrs'][0x2]?_0x38d86c['attrs'][0x2][_0xeaae('0x42')]:undefined)||0x14},{'name':_0xeaae('0x4d'),'value':_0x38d86c[_0xeaae('0x4d')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x3]?_0x38d86c[_0xeaae('0x41')][0x3][_0xeaae('0x42')]:undefined)||_0xeaae('0x4e')},{'name':_0xeaae('0x4f'),'value':_0x38d86c[_0xeaae('0x4f')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x4]?_0x38d86c['attrs'][0x4][_0xeaae('0x42')]:undefined)||''},{'name':_0xeaae('0x50'),'value':_0x38d86c[_0xeaae('0x50')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x5]?_0x38d86c['attrs'][0x5][_0xeaae('0x42')]:undefined)||''},{'name':_0xeaae('0x51'),'value':_0x38d86c[_0xeaae('0x51')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x6]?_0x38d86c[_0xeaae('0x41')][0x6][_0xeaae('0x42')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x38d86c[_0xeaae('0x52')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c['attrs'][0x7]?_0x38d86c['attrs'][0x7][_0xeaae('0x42')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x38d86c[_0xeaae('0x53')]||(_0x38d86c['attrs']&&_0x38d86c[_0xeaae('0x41')][0x8]?_0x38d86c[_0xeaae('0x41')][0x8][_0xeaae('0x42')]:undefined)||''},{'name':_0xeaae('0x54'),'value':_0x38d86c[_0xeaae('0x54')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x9]?_0x38d86c[_0xeaae('0x41')][0x9][_0xeaae('0x42')]:undefined)||''}];case _0xeaae('0x55'):case _0xeaae('0x56'):return[{'name':_0xeaae('0x57'),'value':_0x38d86c[_0xeaae('0x57')]||(_0x38d86c['attrs']&&_0x38d86c[_0xeaae('0x41')][0x0]?_0x38d86c[_0xeaae('0x41')][0x0][_0xeaae('0x42')]:undefined)||_0xeaae('0x4b')},{'name':_0xeaae('0x58'),'value':_0x38d86c[_0xeaae('0x58')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x1]?_0x38d86c['attrs'][0x1]['value']:undefined)||null},{'name':_0xeaae('0x59'),'value':_0x38d86c[_0xeaae('0x59')]||(_0x38d86c['attrs']&&_0x38d86c[_0xeaae('0x41')][0x2]?_0x38d86c[_0xeaae('0x41')][0x2]['value']:undefined)||null},{'name':_0xeaae('0x4c'),'value':_0x38d86c[_0xeaae('0x4c')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x3]?_0x38d86c[_0xeaae('0x41')][0x3][_0xeaae('0x42')]:undefined)||[]},{'name':'attrChannel','value':_0x38d86c[_0xeaae('0x4d')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x4]?_0x38d86c[_0xeaae('0x41')][0x4][_0xeaae('0x42')]:undefined)||_0xeaae('0x4e')},{'name':_0xeaae('0x4f'),'value':_0x38d86c['attrEmailAccounts']||(_0x38d86c['attrs']&&_0x38d86c[_0xeaae('0x41')][0x5]?_0x38d86c[_0xeaae('0x41')][0x5][_0xeaae('0x42')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x38d86c['attrFaxAccounts']||(_0x38d86c['attrs']&&_0x38d86c[_0xeaae('0x41')][0x6]?_0x38d86c[_0xeaae('0x41')][0x6][_0xeaae('0x42')]:undefined)||''},{'name':_0xeaae('0x51'),'value':_0x38d86c[_0xeaae('0x51')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x7]?_0x38d86c[_0xeaae('0x41')][0x7][_0xeaae('0x42')]:undefined)||''},{'name':_0xeaae('0x52'),'value':_0x38d86c[_0xeaae('0x52')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x8]?_0x38d86c[_0xeaae('0x41')][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x38d86c[_0xeaae('0x53')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x9]?_0x38d86c[_0xeaae('0x41')][0x9][_0xeaae('0x42')]:undefined)||''},{'name':'attrChatWebsites','value':_0x38d86c[_0xeaae('0x54')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0xa]?_0x38d86c[_0xeaae('0x41')][0xa][_0xeaae('0x42')]:undefined)||''}];case _0xeaae('0x5a'):return[{'name':_0xeaae('0x5b'),'type':_0x38d86c[_0xeaae('0x5c')]||(_0x38d86c['attrs']&&_0x38d86c[_0xeaae('0x41')][0x0]?_0x38d86c[_0xeaae('0x41')][0x0][_0xeaae('0x3f')]:undefined)||null,'value':_0x38d86c[_0xeaae('0x5b')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x0]?_0x38d86c[_0xeaae('0x41')][0x0][_0xeaae('0x42')]:undefined)||null},{'name':_0xeaae('0x5d'),'value':_0x38d86c[_0xeaae('0x5d')]||(_0x38d86c[_0xeaae('0x41')]&&_0x38d86c[_0xeaae('0x41')][0x1]?_0x38d86c[_0xeaae('0x41')][0x1][_0xeaae('0x42')]:undefined)||0x0}];default:return[];}}catch(_0x5ac176){logger[_0xeaae('0x2b')](_0xeaae('0x5e'),JSON[_0xeaae('0x5f')](_0x5ac176));return[];}}exports[_0xeaae('0x60')]=function(_0x163d1b,_0x36eb59){if(_0x163d1b[_0xeaae('0x61')]){_0x163d1b[_0xeaae('0x61')][_0xeaae('0x41')]=widgetAttributes(_0x163d1b[_0xeaae('0x61')]);}return db[_0xeaae('0x31')][_0xeaae('0x60')](_0x163d1b[_0xeaae('0x61')],{})['then'](respondWithResult(_0x36eb59,0xc9))[_0xeaae('0x3e')](handleError(_0x36eb59,null));};exports[_0xeaae('0x62')]=function(_0x2899a9,_0x333728){if(_0x2899a9[_0xeaae('0x61')]['id']){delete _0x2899a9[_0xeaae('0x61')]['id'];}_0x2899a9['body'][_0xeaae('0x41')]=widgetAttributes(_0x2899a9[_0xeaae('0x61')]);return db[_0xeaae('0x31')][_0xeaae('0x3c')]({'where':{'id':_0x2899a9[_0xeaae('0x3d')]['id']}})['then'](handleEntityNotFound(_0x333728,null))[_0xeaae('0x3b')](saveUpdates(_0x2899a9[_0xeaae('0x61')],null))[_0xeaae('0x3b')](respondWithResult(_0x333728,null))[_0xeaae('0x3e')](handleError(_0x333728,null));}; \ No newline at end of file +var _0x2cd0=['querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','send','show','params','model','DashboardItem','query','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrRefresh','widgetAttributes:\x20%s','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel'];(function(_0x4f5bc9,_0x2d8bc5){var _0x39796b=function(_0x20910a){while(--_0x20910a){_0x4f5bc9['push'](_0x4f5bc9['shift']());}};_0x39796b(++_0x2d8bc5);}(_0x2cd0,0x10f));var _0x02cd=function(_0x430290,_0x57fea2){_0x430290=_0x430290-0x0;var _0x151f6d=_0x2cd0[_0x430290];return _0x151f6d;};'use strict';var emlformat=require(_0x02cd('0x0'));var rimraf=require(_0x02cd('0x1'));var zipdir=require(_0x02cd('0x2'));var jsonpatch=require(_0x02cd('0x3'));var rp=require(_0x02cd('0x4'));var moment=require(_0x02cd('0x5'));var BPromise=require(_0x02cd('0x6'));var Mustache=require(_0x02cd('0x7'));var util=require('util');var path=require(_0x02cd('0x8'));var sox=require(_0x02cd('0x9'));var csv=require(_0x02cd('0xa'));var ejs=require(_0x02cd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x02cd('0xc'));var squel=require(_0x02cd('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x02cd('0xa'));var querystring=require(_0x02cd('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x02cd('0xf'));var qs=require(_0x02cd('0x10'));var as=require(_0x02cd('0x11'));var hardwareService=require(_0x02cd('0x12'));var logger=require(_0x02cd('0x13'))(_0x02cd('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x02cd('0x15'));var db=require(_0x02cd('0x16'))['db'];config[_0x02cd('0x17')]=_[_0x02cd('0x18')](config[_0x02cd('0x17')],{'host':_0x02cd('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x02cd('0x17')]));require('./dashboardItem.socket')[_0x02cd('0x1a')](socket);function respondWithStatusCode(_0x583620,_0x526499){_0x526499=_0x526499||0xcc;return function(_0x51f190){if(_0x51f190){return _0x583620[_0x02cd('0x1b')](_0x526499);}return _0x583620[_0x02cd('0x1c')](_0x526499)[_0x02cd('0x1d')]();};}function respondWithResult(_0x15b6fe,_0x14ba5c){_0x14ba5c=_0x14ba5c||0xc8;return function(_0x177720){if(_0x177720){return _0x15b6fe[_0x02cd('0x1c')](_0x14ba5c)[_0x02cd('0x1e')](_0x177720);}};}function respondWithFilteredResult(_0xb4115c,_0x2d554b){return function(_0x18c522){if(_0x18c522){var _0x24ca3e=typeof _0x2d554b[_0x02cd('0x1f')]===_0x02cd('0x20')&&typeof _0x2d554b[_0x02cd('0x21')]===_0x02cd('0x20');var _0x4f448b=_0x18c522[_0x02cd('0x22')];var _0x2ba059=_0x24ca3e?0x0:_0x2d554b[_0x02cd('0x1f')];var _0x17c764=_0x24ca3e?_0x18c522[_0x02cd('0x22')]:_0x2d554b[_0x02cd('0x1f')]+_0x2d554b[_0x02cd('0x21')];var _0xd6cc59;if(_0x17c764>=_0x4f448b){_0x17c764=_0x4f448b;_0xd6cc59=0xc8;}else{_0xd6cc59=0xce;}_0xb4115c[_0x02cd('0x1c')](_0xd6cc59);return _0xb4115c[_0x02cd('0x23')](_0x02cd('0x24'),_0x2ba059+'-'+_0x17c764+'/'+_0x4f448b)['json'](_0x18c522);}return null;};}function patchUpdates(_0x2b9809){return function(_0x155e5e){try{jsonpatch[_0x02cd('0x25')](_0x155e5e,_0x2b9809,!![]);}catch(_0x2fb5af){return BPromise['reject'](_0x2fb5af);}return _0x155e5e[_0x02cd('0x26')]();};}function saveUpdates(_0x4e127f,_0x1351fa){return function(_0x397aba){if(_0x397aba){return _0x397aba[_0x02cd('0x27')](_0x4e127f)[_0x02cd('0x28')](function(_0x40e7fa){return _0x40e7fa;});}return null;};}function removeEntity(_0x194c7e,_0x3fd0b0){return function(_0x5e92ed){if(_0x5e92ed){return _0x5e92ed[_0x02cd('0x29')]()[_0x02cd('0x28')](function(){_0x194c7e['status'](0xcc)[_0x02cd('0x1d')]();});}};}function handleEntityNotFound(_0x560027,_0x35f785){return function(_0x490389){if(!_0x490389){_0x560027[_0x02cd('0x1b')](0x194);}return _0x490389;};}function handleError(_0x3651d4,_0x478068){_0x478068=_0x478068||0x1f4;return function(_0x205ee7){logger[_0x02cd('0x2a')](_0x205ee7[_0x02cd('0x2b')]);if(_0x205ee7['name']){delete _0x205ee7['name'];}_0x3651d4[_0x02cd('0x1c')](_0x478068)[_0x02cd('0x2c')](_0x205ee7);};}exports[_0x02cd('0x2d')]=function(_0x296103,_0x5f5283){var _0x561eba={'raw':![],'where':{'id':_0x296103[_0x02cd('0x2e')]['id']}},_0x15a334={};_0x15a334[_0x02cd('0x2f')]=_['keys'](db[_0x02cd('0x30')]['rawAttributes']);_0x15a334[_0x02cd('0x31')]=_['keys'](_0x296103[_0x02cd('0x31')]);_0x15a334['filters']=_[_0x02cd('0x32')](_0x15a334[_0x02cd('0x2f')],_0x15a334[_0x02cd('0x31')]);_0x561eba[_0x02cd('0x33')]=_[_0x02cd('0x32')](_0x15a334['model'],qs[_0x02cd('0x34')](_0x296103['query']['fields']));_0x561eba[_0x02cd('0x33')]=_0x561eba[_0x02cd('0x33')][_0x02cd('0x35')]?_0x561eba[_0x02cd('0x33')]:_0x15a334['model'];if(_0x296103['query'][_0x02cd('0x36')]){_0x561eba[_0x02cd('0x37')]=[{'all':!![]}];}_0x561eba=_[_0x02cd('0x38')]({},_0x561eba,_0x296103[_0x02cd('0x39')]);return db[_0x02cd('0x30')][_0x02cd('0x3a')](_0x561eba)[_0x02cd('0x28')](handleEntityNotFound(_0x5f5283,null))['then'](respondWithResult(_0x5f5283,null))[_0x02cd('0x3b')](handleError(_0x5f5283,null));};exports[_0x02cd('0x29')]=function(_0x4169e4,_0x27b585){return db[_0x02cd('0x30')][_0x02cd('0x3a')]({'where':{'id':_0x4169e4[_0x02cd('0x2e')]['id']}})[_0x02cd('0x28')](handleEntityNotFound(_0x27b585,null))[_0x02cd('0x28')](removeEntity(_0x27b585,null))['catch'](handleError(_0x27b585,null));};function widgetAttributes(_0x349ca8){try{switch(_0x349ca8[_0x02cd('0x3c')]){case _0x02cd('0x3d'):return[{'name':_0x02cd('0x3e'),'value':_0x349ca8[_0x02cd('0x3e')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x0]?_0x349ca8[_0x02cd('0x3f')][0x0][_0x02cd('0x40')]:undefined)||_0x02cd('0x41')}];case _0x02cd('0x42'):return[{'name':_0x02cd('0x43'),'value':_0x349ca8['attrPath']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x0]?_0x349ca8['attrs'][0x0][_0x02cd('0x40')]:undefined)||''}];case'clock':return[{'name':_0x02cd('0x44'),'value':_0x349ca8[_0x02cd('0x44')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x0]?_0x349ca8[_0x02cd('0x3f')][0x0][_0x02cd('0x40')]:undefined)||_0x02cd('0x45')},{'name':'attrTimezone','value':_0x349ca8[_0x02cd('0x46')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x1]?_0x349ca8[_0x02cd('0x3f')][0x1][_0x02cd('0x40')]:undefined)||'0.00'},{'name':_0x02cd('0x47'),'value':_0x349ca8[_0x02cd('0x47')]||(_0x349ca8['attrs']&&_0x349ca8[_0x02cd('0x3f')][0x2]?_0x349ca8[_0x02cd('0x3f')][0x2][_0x02cd('0x40')]:undefined)||0xc}];case _0x02cd('0x48'):return[{'name':_0x02cd('0x49'),'value':_0x349ca8['attrMetric']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0x0]?_0x349ca8[_0x02cd('0x3f')][0x0][_0x02cd('0x40')]:undefined)||_0x02cd('0x4a')},{'name':_0x02cd('0x4b'),'value':_0x349ca8['attrVoiceQueues']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x1]?_0x349ca8[_0x02cd('0x3f')][0x1][_0x02cd('0x40')]:undefined)||[]},{'name':_0x02cd('0x47'),'value':_0x349ca8[_0x02cd('0x47')]||(_0x349ca8['attrs']&&_0x349ca8[_0x02cd('0x3f')][0x2]?_0x349ca8[_0x02cd('0x3f')][0x2][_0x02cd('0x40')]:undefined)||0x14},{'name':'attrChannel','value':_0x349ca8[_0x02cd('0x4c')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0x3]?_0x349ca8['attrs'][0x3][_0x02cd('0x40')]:undefined)||_0x02cd('0x4d')},{'name':_0x02cd('0x4e'),'value':_0x349ca8[_0x02cd('0x4e')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0x4]?_0x349ca8[_0x02cd('0x3f')][0x4]['value']:undefined)||''},{'name':_0x02cd('0x4f'),'value':_0x349ca8[_0x02cd('0x4f')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0x5]?_0x349ca8[_0x02cd('0x3f')][0x5][_0x02cd('0x40')]:undefined)||''},{'name':_0x02cd('0x50'),'value':_0x349ca8[_0x02cd('0x50')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x6]?_0x349ca8[_0x02cd('0x3f')][0x6][_0x02cd('0x40')]:undefined)||''},{'name':_0x02cd('0x51'),'value':_0x349ca8[_0x02cd('0x51')]||(_0x349ca8['attrs']&&_0x349ca8[_0x02cd('0x3f')][0x7]?_0x349ca8[_0x02cd('0x3f')][0x7][_0x02cd('0x40')]:undefined)||''},{'name':_0x02cd('0x52'),'value':_0x349ca8[_0x02cd('0x52')]||(_0x349ca8['attrs']&&_0x349ca8['attrs'][0x8]?_0x349ca8[_0x02cd('0x3f')][0x8]['value']:undefined)||''},{'name':_0x02cd('0x53'),'value':_0x349ca8[_0x02cd('0x53')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x9]?_0x349ca8['attrs'][0x9][_0x02cd('0x40')]:undefined)||''}];case _0x02cd('0x54'):case _0x02cd('0x55'):return[{'name':_0x02cd('0x56'),'value':_0x349ca8['attrSerie1']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0x0]?_0x349ca8[_0x02cd('0x3f')][0x0][_0x02cd('0x40')]:undefined)||'total'},{'name':_0x02cd('0x57'),'value':_0x349ca8[_0x02cd('0x57')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x1]?_0x349ca8[_0x02cd('0x3f')][0x1][_0x02cd('0x40')]:undefined)||null},{'name':_0x02cd('0x58'),'value':_0x349ca8[_0x02cd('0x58')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x2]?_0x349ca8['attrs'][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x349ca8[_0x02cd('0x4b')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x3]?_0x349ca8[_0x02cd('0x3f')][0x3][_0x02cd('0x40')]:undefined)||[]},{'name':_0x02cd('0x4c'),'value':_0x349ca8['attrChannel']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x4]?_0x349ca8['attrs'][0x4][_0x02cd('0x40')]:undefined)||'voice'},{'name':_0x02cd('0x4e'),'value':_0x349ca8['attrEmailAccounts']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x5]?_0x349ca8[_0x02cd('0x3f')][0x5]['value']:undefined)||''},{'name':_0x02cd('0x4f'),'value':_0x349ca8[_0x02cd('0x4f')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x6]?_0x349ca8['attrs'][0x6][_0x02cd('0x40')]:undefined)||''},{'name':_0x02cd('0x50'),'value':_0x349ca8['attrSmsAccounts']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0x7]?_0x349ca8['attrs'][0x7][_0x02cd('0x40')]:undefined)||''},{'name':_0x02cd('0x51'),'value':_0x349ca8[_0x02cd('0x51')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x8]?_0x349ca8['attrs'][0x8]['value']:undefined)||''},{'name':_0x02cd('0x52'),'value':_0x349ca8['attrWhatsappAccounts']||(_0x349ca8['attrs']&&_0x349ca8[_0x02cd('0x3f')][0x9]?_0x349ca8[_0x02cd('0x3f')][0x9][_0x02cd('0x40')]:undefined)||''},{'name':_0x02cd('0x53'),'value':_0x349ca8[_0x02cd('0x53')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0xa]?_0x349ca8[_0x02cd('0x3f')][0xa][_0x02cd('0x40')]:undefined)||''}];case _0x02cd('0x59'):return[{'name':'attrReport','type':_0x349ca8[_0x02cd('0x5a')]||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x0]?_0x349ca8['attrs'][0x0][_0x02cd('0x3c')]:undefined)||null,'value':_0x349ca8['attrReport']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8[_0x02cd('0x3f')][0x0]?_0x349ca8['attrs'][0x0]['value']:undefined)||null},{'name':_0x02cd('0x5b'),'value':_0x349ca8['attrRefresh']||(_0x349ca8[_0x02cd('0x3f')]&&_0x349ca8['attrs'][0x1]?_0x349ca8[_0x02cd('0x3f')][0x1][_0x02cd('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x20e23e){logger['error'](_0x02cd('0x5c'),JSON['stringify'](_0x20e23e));return[];}}exports[_0x02cd('0x5d')]=function(_0x470b48,_0x1f327d){if(_0x470b48[_0x02cd('0x5e')]){_0x470b48[_0x02cd('0x5e')][_0x02cd('0x3f')]=widgetAttributes(_0x470b48['body']);}return db[_0x02cd('0x30')]['create'](_0x470b48[_0x02cd('0x5e')],{})[_0x02cd('0x28')](respondWithResult(_0x1f327d,0xc9))[_0x02cd('0x3b')](handleError(_0x1f327d,null));};exports[_0x02cd('0x27')]=function(_0xe5bd3e,_0x3c4dda){if(_0xe5bd3e['body']['id']){delete _0xe5bd3e[_0x02cd('0x5e')]['id'];}_0xe5bd3e[_0x02cd('0x5e')][_0x02cd('0x3f')]=widgetAttributes(_0xe5bd3e[_0x02cd('0x5e')]);return db[_0x02cd('0x30')][_0x02cd('0x3a')]({'where':{'id':_0xe5bd3e['params']['id']}})[_0x02cd('0x28')](handleEntityNotFound(_0x3c4dda,null))[_0x02cd('0x28')](saveUpdates(_0xe5bd3e['body'],null))[_0x02cd('0x28')](respondWithResult(_0x3c4dda,null))[_0x02cd('0x3b')](handleError(_0x3c4dda,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 86c56d3..14b1d02 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 _0x296e=['update','remove','emit','hook','events','../../mysqldb','DashboardItem'];(function(_0x4ab215,_0x31aa8d){var _0x60a3c6=function(_0x512037){while(--_0x512037){_0x4ab215['push'](_0x4ab215['shift']());}};_0x60a3c6(++_0x31aa8d);}(_0x296e,0x9e));var _0xe296=function(_0x371fdf,_0x20588e){_0x371fdf=_0x371fdf-0x0;var _0x4c92ce=_0x296e[_0x371fdf];return _0x4c92ce;};'use strict';var EventEmitter=require(_0xe296('0x0'));var DashboardItem=require(_0xe296('0x1'))['db'][_0xe296('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe296('0x3'),'afterDestroy':_0xe296('0x4')};function emitEvent(_0x33240d){return function(_0x22ad88,_0x2fa0ac,_0xcb2da3){DashboardItemEvents[_0xe296('0x5')](_0x33240d+':'+_0x22ad88['id'],_0x22ad88);DashboardItemEvents[_0xe296('0x5')](_0x33240d,_0x22ad88);_0xcb2da3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xe296('0x6')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x28f8=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x4fa166,_0x58b7fb){var _0x5dd974=function(_0x342886){while(--_0x342886){_0x4fa166['push'](_0x4fa166['shift']());}};_0x5dd974(++_0x58b7fb);}(_0x28f8,0x10a));var _0x828f=function(_0x1c72b8,_0x104b7e){_0x1c72b8=_0x1c72b8-0x0;var _0x191114=_0x28f8[_0x1c72b8];return _0x191114;};'use strict';var EventEmitter=require(_0x828f('0x0'));var DashboardItem=require(_0x828f('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x828f('0x2')](0x0);var events={'afterCreate':_0x828f('0x3'),'afterUpdate':_0x828f('0x4'),'afterDestroy':_0x828f('0x5')};function emitEvent(_0x44524b){return function(_0x428cd2,_0x2f3463,_0x43d66f){DashboardItemEvents[_0x828f('0x6')](_0x44524b+':'+_0x428cd2['id'],_0x428cd2);DashboardItemEvents['emit'](_0x44524b,_0x428cd2);_0x43d66f(null);};}for(var e in events){if(events[_0x828f('0x7')](e)){var event=events[e];DashboardItem[_0x828f('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index c4dfe61..33a07db 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 _0x61b5=['define','DashboardItem','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports'];(function(_0xa8e944,_0x21f5b6){var _0x5086e3=function(_0x3e3f13){while(--_0x3e3f13){_0xa8e944['push'](_0xa8e944['shift']());}};_0x5086e3(++_0x21f5b6);}(_0x61b5,0x1ca));var _0x561b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x61b5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x561b('0x0'));var util=require(_0x561b('0x1'));var logger=require('../../config/logger')(_0x561b('0x2'));var moment=require(_0x561b('0x3'));var BPromise=require('bluebird');var rp=require(_0x561b('0x4'));var fs=require('fs');var path=require(_0x561b('0x5'));var rimraf=require(_0x561b('0x6'));var config=require(_0x561b('0x7'));var attributes=require(_0x561b('0x8'));module[_0x561b('0x9')]=function(_0x212137,_0x877877){return _0x212137[_0x561b('0xa')](_0x561b('0xb'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb9bd=['exports','define','dashboard_items','lodash','util','../../config/logger','api','moment','path','../../config/environment','./dashboardItem.attributes'];(function(_0x3fd3a3,_0x36c863){var _0xa3e4d5=function(_0x1fd03b){while(--_0x1fd03b){_0x3fd3a3['push'](_0x3fd3a3['shift']());}};_0xa3e4d5(++_0x36c863);}(_0xb9bd,0x9d));var _0xdb9b=function(_0x2cd192,_0x1199fa){_0x2cd192=_0x2cd192-0x0;var _0x430e57=_0xb9bd[_0x2cd192];return _0x430e57;};'use strict';var _=require(_0xdb9b('0x0'));var util=require(_0xdb9b('0x1'));var logger=require(_0xdb9b('0x2'))(_0xdb9b('0x3'));var moment=require(_0xdb9b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb9b('0x5'));var rimraf=require('rimraf');var config=require(_0xdb9b('0x6'));var attributes=require(_0xdb9b('0x7'));module[_0xdb9b('0x8')]=function(_0x58693c,_0x325837){return _0x58693c[_0xdb9b('0x9')]('DashboardItem',attributes,{'tableName':_0xdb9b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 682c4ca..afb9381 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 _0xc546=['code','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xc546,0xa6));var _0x6c54=function(_0x5f37b9,_0x430eb5){_0x5f37b9=_0x5f37b9-0x0;var _0x2b589a=_0xc546[_0x5f37b9];return _0x2b589a;};'use strict';var _=require(_0x6c54('0x0'));var util=require(_0x6c54('0x1'));var moment=require('moment');var BPromise=require(_0x6c54('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c54('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c54('0x4'));var logger=require(_0x6c54('0x5'))(_0x6c54('0x6'));var config=require(_0x6c54('0x7'));var jayson=require(_0x6c54('0x8'));var client=jayson[_0x6c54('0x9')][_0x6c54('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x6c54('0xb')],{'host':_0x6c54('0xc'),'port':0x18eb});var socket=require(_0x6c54('0xd'))(new Redis(config[_0x6c54('0xb')]));require(_0x6c54('0xe'))[_0x6c54('0xf')](socket);function respondWithRpcPromise(_0x53c6a6,_0x360fcb,_0x361027){return new BPromise(function(_0x45af6e,_0x25e999){return client[_0x6c54('0x10')](_0x53c6a6,_0x361027)['then'](function(_0x2b0921){logger[_0x6c54('0x11')](_0x6c54('0x12'),_0x360fcb,_0x6c54('0x13'));logger[_0x6c54('0x14')](_0x6c54('0x15'),_0x360fcb,_0x6c54('0x13'),JSON['stringify'](_0x2b0921));if(_0x2b0921[_0x6c54('0x16')]){if(_0x2b0921[_0x6c54('0x16')][_0x6c54('0x17')]===0x1f4){logger[_0x6c54('0x16')](_0x6c54('0x12'),_0x360fcb,_0x2b0921['error'][_0x6c54('0x18')]);return _0x25e999(_0x2b0921['error'][_0x6c54('0x18')]);}logger[_0x6c54('0x16')](_0x6c54('0x12'),_0x360fcb,_0x2b0921[_0x6c54('0x16')][_0x6c54('0x18')]);return _0x45af6e(_0x2b0921[_0x6c54('0x16')]['message']);}else{logger[_0x6c54('0x11')](_0x6c54('0x12'),_0x360fcb,_0x6c54('0x13'));_0x45af6e(_0x2b0921[_0x6c54('0x19')][_0x6c54('0x18')]);}})[_0x6c54('0x1a')](function(_0x3427ad){logger[_0x6c54('0x16')](_0x6c54('0x12'),_0x360fcb,_0x3427ad);_0x25e999(_0x3427ad);});});} \ No newline at end of file +var _0xb966=['error','message','DashboardItem,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','debug'];(function(_0x1f029b,_0x532b86){var _0x2fe524=function(_0x39d7d0){while(--_0x39d7d0){_0x1f029b['push'](_0x1f029b['shift']());}};_0x2fe524(++_0x532b86);}(_0xb966,0xe4));var _0x6b96=function(_0x1e8fc2,_0x33aac3){_0x1e8fc2=_0x1e8fc2-0x0;var _0x541046=_0xb966[_0x1e8fc2];return _0x541046;};'use strict';var _=require(_0x6b96('0x0'));var util=require(_0x6b96('0x1'));var moment=require(_0x6b96('0x2'));var BPromise=require(_0x6b96('0x3'));var rs=require(_0x6b96('0x4'));var fs=require('fs');var Redis=require(_0x6b96('0x5'));var db=require(_0x6b96('0x6'))['db'];var utils=require(_0x6b96('0x7'));var logger=require(_0x6b96('0x8'))(_0x6b96('0x9'));var config=require(_0x6b96('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6b96('0xb')][_0x6b96('0xc')]({'port':0x232a});config[_0x6b96('0xd')]=_[_0x6b96('0xe')](config[_0x6b96('0xd')],{'host':_0x6b96('0xf'),'port':0x18eb});var socket=require(_0x6b96('0x10'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x6b96('0x11')](socket);function respondWithRpcPromise(_0x241ef9,_0x250cb3,_0x43e5c2){return new BPromise(function(_0x3056f6,_0x328267){return client['request'](_0x241ef9,_0x43e5c2)[_0x6b96('0x12')](function(_0x2e5df6){logger[_0x6b96('0x13')]('DashboardItem,\x20%s,\x20%s',_0x250cb3,_0x6b96('0x14'));logger[_0x6b96('0x15')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x250cb3,_0x6b96('0x14'),JSON['stringify'](_0x2e5df6));if(_0x2e5df6[_0x6b96('0x16')]){if(_0x2e5df6[_0x6b96('0x16')]['code']===0x1f4){logger[_0x6b96('0x16')]('DashboardItem,\x20%s,\x20%s',_0x250cb3,_0x2e5df6[_0x6b96('0x16')][_0x6b96('0x17')]);return _0x328267(_0x2e5df6[_0x6b96('0x16')]['message']);}logger['error'](_0x6b96('0x18'),_0x250cb3,_0x2e5df6[_0x6b96('0x16')][_0x6b96('0x17')]);return _0x3056f6(_0x2e5df6[_0x6b96('0x16')]['message']);}else{logger[_0x6b96('0x13')](_0x6b96('0x18'),_0x250cb3,_0x6b96('0x14'));_0x3056f6(_0x2e5df6['result']['message']);}})['catch'](function(_0x1abe96){logger[_0x6b96('0x16')](_0x6b96('0x18'),_0x250cb3,_0x1abe96);_0x328267(_0x1abe96);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 8c5e66e..24eddbc 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 _0x246d=['register','length','dashboardItem:','./dashboardItem.events','save','remove','emit','removeListener'];(function(_0x5359d2,_0x4b3069){var _0xa7e54=function(_0x402914){while(--_0x402914){_0x5359d2['push'](_0x5359d2['shift']());}};_0xa7e54(++_0x4b3069);}(_0x246d,0x17b));var _0xd246=function(_0x304098,_0xd9f14e){_0x304098=_0x304098-0x0;var _0x4b07f1=_0x246d[_0x304098];return _0x4b07f1;};'use strict';var DashboardItemEvents=require(_0xd246('0x0'));var events=[_0xd246('0x1'),_0xd246('0x2'),'update'];function createListener(_0xeb6aee,_0x28fdf6){return function(_0x17aef5){_0x28fdf6[_0xd246('0x3')](_0xeb6aee,_0x17aef5);};}function removeListener(_0xcbd68c,_0x4e6003){return function(){DashboardItemEvents[_0xd246('0x4')](_0xcbd68c,_0x4e6003);};}exports[_0xd246('0x5')]=function(_0x235aff){for(var _0x17f0b1=0x0,_0x3eddbd=events[_0xd246('0x6')];_0x17f0b1<_0x3eddbd;_0x17f0b1++){var _0x2de238=events[_0x17f0b1];var _0x2d6e11=createListener(_0xd246('0x7')+_0x2de238,_0x235aff);DashboardItemEvents['on'](_0x2de238,_0x2d6e11);}}; \ No newline at end of file +var _0xc237=['remove','update','emit','removeListener','register','length','dashboardItem:'];(function(_0x54e523,_0xfc81fc){var _0x1a8c62=function(_0x37401c){while(--_0x37401c){_0x54e523['push'](_0x54e523['shift']());}};_0x1a8c62(++_0xfc81fc);}(_0xc237,0x7e));var _0x7c23=function(_0x5691f2,_0x1b4aba){_0x5691f2=_0x5691f2-0x0;var _0x1605c6=_0xc237[_0x5691f2];return _0x1605c6;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save',_0x7c23('0x0'),_0x7c23('0x1')];function createListener(_0x57d839,_0x59ec8f){return function(_0x91b75a){_0x59ec8f[_0x7c23('0x2')](_0x57d839,_0x91b75a);};}function removeListener(_0x252363,_0x119c06){return function(){DashboardItemEvents[_0x7c23('0x3')](_0x252363,_0x119c06);};}exports[_0x7c23('0x4')]=function(_0x302ca8){for(var _0x440f14=0x0,_0x46421d=events[_0x7c23('0x5')];_0x440f14<_0x46421d;_0x440f14++){var _0x5e42ed=events[_0x440f14];var _0x51f698=createListener(_0x7c23('0x6')+_0x5e42ed,_0x302ca8);DashboardItemEvents['on'](_0x5e42ed,_0x51f698);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 345a59b..22607ff 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 _0xf277=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','isAuthenticated','show','create','delete','destroy','exports','util'];(function(_0x23ab80,_0x356fd7){var _0x479b23=function(_0xbbc207){while(--_0xbbc207){_0x23ab80['push'](_0x23ab80['shift']());}};_0x479b23(++_0x356fd7);}(_0xf277,0xcb));var _0x7f27=function(_0x1f7ab8,_0x19f57f){_0x1f7ab8=_0x1f7ab8-0x0;var _0x489f4d=_0xf277[_0x1f7ab8];return _0x489f4d;};'use strict';var multer=require('multer');var util=require(_0x7f27('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7f27('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x7f27('0x2'));var interaction=require(_0x7f27('0x3'));var config=require(_0x7f27('0x4'));var controller=require(_0x7f27('0x5'));router['get']('/:id',auth[_0x7f27('0x6')](),controller[_0x7f27('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7f27('0x8')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7f27('0x9')]('/:id',auth[_0x7f27('0x6')](),controller[_0x7f27('0xa')]);module[_0x7f27('0xb')]=router; \ No newline at end of file +var _0x1703=['get','/:id','post','isAuthenticated','create','put','update','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller'];(function(_0xc1d4dc,_0x37e5b0){var _0x327c78=function(_0x2d7343){while(--_0x2d7343){_0xc1d4dc['push'](_0xc1d4dc['shift']());}};_0x327c78(++_0x37e5b0);}(_0x1703,0x6e));var _0x3170=function(_0x711e59,_0x5b35fa){_0x711e59=_0x711e59-0x0;var _0x5edcc7=_0x1703[_0x711e59];return _0x5edcc7;};'use strict';var multer=require(_0x3170('0x0'));var util=require(_0x3170('0x1'));var path=require(_0x3170('0x2'));var timeout=require('connect-timeout');var express=require(_0x3170('0x3'));var router=express['Router']();var fs_extra=require(_0x3170('0x4'));var auth=require(_0x3170('0x5'));var interaction=require(_0x3170('0x6'));var config=require(_0x3170('0x7'));var controller=require(_0x3170('0x8'));router[_0x3170('0x9')](_0x3170('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x3170('0xb')]('/',auth[_0x3170('0xc')](),controller[_0x3170('0xd')]);router[_0x3170('0xe')](_0x3170('0xa'),auth[_0x3170('0xc')](),controller[_0x3170('0xf')]);router['delete'](_0x3170('0xa'),auth[_0x3170('0xc')](),controller['destroy']);module[_0x3170('0x10')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 071ee75..44399ad 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 _0x6be8=['sequelize','exports','STRING','ENUM','first','second','third'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0x6be8,0x103));var _0x86be=function(_0x1eabe2,_0x24666c){_0x1eabe2=_0x1eabe2-0x0;var _0x39adc0=_0x6be8[_0x1eabe2];return _0x39adc0;};'use strict';var Sequelize=require(_0x86be('0x0'));module[_0x86be('0x1')]={'name':{'type':Sequelize[_0x86be('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x86be('0x3')](_0x86be('0x4'),_0x86be('0x5'),_0x86be('0x6')),'allowNull':![],'defaultValue':_0x86be('0x4')},'description':{'type':Sequelize[_0x86be('0x2')]}}; \ No newline at end of file +var _0x75f0=['STRING','second','third','first','sequelize','exports'];(function(_0x31021e,_0x248900){var _0x1e6fe5=function(_0x420acf){while(--_0x420acf){_0x31021e['push'](_0x31021e['shift']());}};_0x1e6fe5(++_0x248900);}(_0x75f0,0x124));var _0x075f=function(_0x12d9ab,_0x4e8449){_0x12d9ab=_0x12d9ab-0x0;var _0x24a304=_0x75f0[_0x12d9ab];return _0x24a304;};'use strict';var Sequelize=require(_0x075f('0x0'));module[_0x075f('0x1')]={'name':{'type':Sequelize[_0x075f('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM']('first',_0x075f('0x3'),_0x075f('0x4')),'allowNull':![],'defaultValue':_0x075f('0x5')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 92c9697..50e266f 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 _0x9fc5=['catch','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','index','map','Disposition','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','includeAll','findAll','rows'];(function(_0xbed58e,_0x314ec7){var _0x39e140=function(_0x133541){while(--_0x133541){_0xbed58e['push'](_0xbed58e['shift']());}};_0x39e140(++_0x314ec7);}(_0x9fc5,0xb6));var _0x59fc=function(_0x4404ff,_0x13d7a9){_0x4404ff=_0x4404ff-0x0;var _0x5e7b19=_0x9fc5[_0x4404ff];return _0x5e7b19;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x59fc('0x0'));var zipdir=require(_0x59fc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x59fc('0x2'));var moment=require(_0x59fc('0x3'));var BPromise=require(_0x59fc('0x4'));var Mustache=require(_0x59fc('0x5'));var util=require(_0x59fc('0x6'));var path=require(_0x59fc('0x7'));var sox=require(_0x59fc('0x8'));var csv=require(_0x59fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x59fc('0xa'));var _=require(_0x59fc('0xb'));var squel=require(_0x59fc('0xc'));var crypto=require('crypto');var jsforce=require(_0x59fc('0xd'));var deskjs=require(_0x59fc('0xe'));var toCsv=require(_0x59fc('0x9'));var querystring=require(_0x59fc('0xf'));var Papa=require(_0x59fc('0x10'));var Redis=require(_0x59fc('0x11'));var authService=require(_0x59fc('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x59fc('0x13'));var hardwareService=require(_0x59fc('0x14'));var logger=require(_0x59fc('0x15'))(_0x59fc('0x16'));var utils=require(_0x59fc('0x17'));var config=require(_0x59fc('0x18'));var licenseUtil=require(_0x59fc('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29ffcc,_0x39b60e){_0x39b60e=_0x39b60e||0xcc;return function(_0x42982d){if(_0x42982d){return _0x29ffcc[_0x59fc('0x1a')](_0x39b60e);}return _0x29ffcc[_0x59fc('0x1b')](_0x39b60e)[_0x59fc('0x1c')]();};}function respondWithResult(_0x1d02d0,_0x19cb0c){_0x19cb0c=_0x19cb0c||0xc8;return function(_0x462fe9){if(_0x462fe9){return _0x1d02d0[_0x59fc('0x1b')](_0x19cb0c)[_0x59fc('0x1d')](_0x462fe9);}};}function respondWithFilteredResult(_0x50365f,_0x386d87){return function(_0x362c6b){if(_0x362c6b){var _0x4e01f6=typeof _0x386d87[_0x59fc('0x1e')]===_0x59fc('0x1f')&&typeof _0x386d87[_0x59fc('0x20')]===_0x59fc('0x1f');var _0x175718=_0x362c6b['count'];var _0x4d72f8=_0x4e01f6?0x0:_0x386d87[_0x59fc('0x1e')];var _0x1ab367=_0x4e01f6?_0x362c6b[_0x59fc('0x21')]:_0x386d87[_0x59fc('0x1e')]+_0x386d87[_0x59fc('0x20')];var _0x2157b3;if(_0x1ab367>=_0x175718){_0x1ab367=_0x175718;_0x2157b3=0xc8;}else{_0x2157b3=0xce;}_0x50365f[_0x59fc('0x1b')](_0x2157b3);return _0x50365f['set'](_0x59fc('0x22'),_0x4d72f8+'-'+_0x1ab367+'/'+_0x175718)['json'](_0x362c6b);}return null;};}function patchUpdates(_0xdcfddb){return function(_0x57a964){try{jsonpatch[_0x59fc('0x23')](_0x57a964,_0xdcfddb,!![]);}catch(_0x25cbdc){return BPromise[_0x59fc('0x24')](_0x25cbdc);}return _0x57a964[_0x59fc('0x25')]();};}function saveUpdates(_0x327b1c,_0x3849bc){return function(_0x4913ff){if(_0x4913ff){return _0x4913ff[_0x59fc('0x26')](_0x327b1c)[_0x59fc('0x27')](function(_0x4b6964){return _0x4b6964;});}return null;};}function removeEntity(_0x4cd81e,_0x3ccb60){return function(_0xa7d026){if(_0xa7d026){return _0xa7d026[_0x59fc('0x28')]()[_0x59fc('0x27')](function(){var _0x188c1d=_0xa7d026[_0x59fc('0x29')]({'plain':!![]});var _0x11e92e=_0x59fc('0x2a');return db[_0x59fc('0x2b')]['destroy']({'where':{'type':_0x11e92e,'resourceId':_0x188c1d['id']}})[_0x59fc('0x27')](function(){return _0xa7d026;});})['then'](function(){_0x4cd81e[_0x59fc('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b9e06,_0x13dd35){return function(_0x5573e5){if(!_0x5573e5){_0x2b9e06[_0x59fc('0x1a')](0x194);}return _0x5573e5;};}function handleError(_0x16e41c,_0x5611e7){_0x5611e7=_0x5611e7||0x1f4;return function(_0x1304ae){logger[_0x59fc('0x2c')](_0x1304ae[_0x59fc('0x2d')]);if(_0x1304ae[_0x59fc('0x2e')]){delete _0x1304ae[_0x59fc('0x2e')];}_0x16e41c['status'](_0x5611e7)[_0x59fc('0x2f')](_0x1304ae);};}exports[_0x59fc('0x30')]=function(_0x177828,_0x554d0f){var _0x15146e={},_0x1dd1a1={},_0x4f5e9f={'count':0x0,'rows':[]};var _0x2059ef=_[_0x59fc('0x31')](db[_0x59fc('0x32')][_0x59fc('0x33')],function(_0x15ac0c){return{'name':_0x15ac0c['fieldName'],'type':_0x15ac0c[_0x59fc('0x34')][_0x59fc('0x35')]};});_0x1dd1a1[_0x59fc('0x36')]=_['map'](_0x2059ef,_0x59fc('0x2e'));_0x1dd1a1['query']=_[_0x59fc('0x37')](_0x177828[_0x59fc('0x38')]);_0x1dd1a1[_0x59fc('0x39')]=_['intersection'](_0x1dd1a1['model'],_0x1dd1a1[_0x59fc('0x38')]);_0x15146e[_0x59fc('0x3a')]=_[_0x59fc('0x3b')](_0x1dd1a1[_0x59fc('0x36')],qs[_0x59fc('0x3c')](_0x177828[_0x59fc('0x38')][_0x59fc('0x3c')]));_0x15146e[_0x59fc('0x3a')]=_0x15146e[_0x59fc('0x3a')][_0x59fc('0x3d')]?_0x15146e[_0x59fc('0x3a')]:_0x1dd1a1[_0x59fc('0x36')];if(!_0x177828[_0x59fc('0x38')][_0x59fc('0x3e')](_0x59fc('0x3f'))){_0x15146e[_0x59fc('0x20')]=qs[_0x59fc('0x20')](_0x177828['query'][_0x59fc('0x20')]);_0x15146e[_0x59fc('0x1e')]=qs[_0x59fc('0x1e')](_0x177828['query']['offset']);}_0x15146e['order']=qs['sort'](_0x177828[_0x59fc('0x38')][_0x59fc('0x40')]);_0x15146e['where']=qs[_0x59fc('0x39')](_[_0x59fc('0x41')](_0x177828[_0x59fc('0x38')],_0x1dd1a1[_0x59fc('0x39')]),_0x2059ef);if(_0x177828[_0x59fc('0x38')][_0x59fc('0x42')]){_0x15146e['where']=_['merge'](_0x15146e[_0x59fc('0x43')],{'$or':_[_0x59fc('0x31')](_0x2059ef,function(_0x4085bb){if(_0x4085bb['type']!==_0x59fc('0x44')){var _0xe53c11={};_0xe53c11[_0x4085bb[_0x59fc('0x2e')]]={'$like':'%'+_0x177828['query']['filter']+'%'};return _0xe53c11;}})});}_0x15146e=_[_0x59fc('0x45')]({},_0x15146e,_0x177828['options']);var _0x48231f={'where':_0x15146e[_0x59fc('0x43')]};return db[_0x59fc('0x32')][_0x59fc('0x21')](_0x48231f)[_0x59fc('0x27')](function(_0x4b3498){_0x4f5e9f[_0x59fc('0x21')]=_0x4b3498;if(_0x177828[_0x59fc('0x38')][_0x59fc('0x46')]){_0x15146e['include']=[{'all':!![]}];}return db[_0x59fc('0x32')][_0x59fc('0x47')](_0x15146e);})[_0x59fc('0x27')](function(_0x2ce34c){_0x4f5e9f[_0x59fc('0x48')]=_0x2ce34c;return _0x4f5e9f;})['then'](respondWithFilteredResult(_0x554d0f,_0x15146e))[_0x59fc('0x49')](handleError(_0x554d0f,null));};exports[_0x59fc('0x4a')]=function(_0x534080,_0xcd6e5a){var _0x31f89a={'raw':!![],'where':{'id':_0x534080[_0x59fc('0x4b')]['id']}},_0x247f72={};_0x247f72['model']=_[_0x59fc('0x37')](db[_0x59fc('0x32')][_0x59fc('0x33')]);_0x247f72[_0x59fc('0x38')]=_['keys'](_0x534080[_0x59fc('0x38')]);_0x247f72[_0x59fc('0x39')]=_[_0x59fc('0x3b')](_0x247f72[_0x59fc('0x36')],_0x247f72[_0x59fc('0x38')]);_0x31f89a[_0x59fc('0x3a')]=_[_0x59fc('0x3b')](_0x247f72[_0x59fc('0x36')],qs[_0x59fc('0x3c')](_0x534080[_0x59fc('0x38')][_0x59fc('0x3c')]));_0x31f89a['attributes']=_0x31f89a[_0x59fc('0x3a')]['length']?_0x31f89a[_0x59fc('0x3a')]:_0x247f72[_0x59fc('0x36')];if(_0x534080['query'][_0x59fc('0x46')]){_0x31f89a[_0x59fc('0x4c')]=[{'all':!![]}];}_0x31f89a=_[_0x59fc('0x45')]({},_0x31f89a,_0x534080['options']);return db[_0x59fc('0x32')][_0x59fc('0x4d')](_0x31f89a)['then'](handleEntityNotFound(_0xcd6e5a,null))[_0x59fc('0x27')](respondWithResult(_0xcd6e5a,null))['catch'](handleError(_0xcd6e5a,null));};exports[_0x59fc('0x4e')]=function(_0x346b31,_0xa7095f){return db[_0x59fc('0x32')][_0x59fc('0x4e')](_0x346b31[_0x59fc('0x4f')],{})[_0x59fc('0x27')](function(_0x43410d){var _0x476f8a=_0x346b31['user'][_0x59fc('0x29')]({'plain':!![]});if(!_0x476f8a)throw new Error(_0x59fc('0x50'));if(_0x476f8a['role']===_0x59fc('0x51')){var _0x286c6c=_0x43410d[_0x59fc('0x29')]({'plain':!![]});var _0x1fe14c=_0x59fc('0x2a');return db[_0x59fc('0x52')][_0x59fc('0x4d')]({'where':{'name':_0x1fe14c,'userProfileId':_0x476f8a['userProfileId']},'raw':!![]})[_0x59fc('0x27')](function(_0x3d2a64){if(_0x3d2a64&&_0x3d2a64[_0x59fc('0x53')]===0x0){return db[_0x59fc('0x2b')][_0x59fc('0x4e')]({'name':_0x286c6c['name'],'resourceId':_0x286c6c['id'],'type':_0x3d2a64[_0x59fc('0x2e')],'sectionId':_0x3d2a64['id']},{})[_0x59fc('0x27')](function(){return _0x43410d;});}else{return _0x43410d;}})[_0x59fc('0x49')](function(_0x11ca2b){logger[_0x59fc('0x2c')](_0x59fc('0x54'),_0x11ca2b);throw _0x11ca2b;});}return _0x43410d;})[_0x59fc('0x27')](respondWithResult(_0xa7095f,0xc9))[_0x59fc('0x49')](handleError(_0xa7095f,null));};exports['update']=function(_0x380156,_0x2f950a){if(_0x380156['body']['id']){delete _0x380156[_0x59fc('0x4f')]['id'];}return db[_0x59fc('0x32')][_0x59fc('0x4d')]({'where':{'id':_0x380156['params']['id']}})[_0x59fc('0x27')](handleEntityNotFound(_0x2f950a,null))[_0x59fc('0x27')](saveUpdates(_0x380156[_0x59fc('0x4f')],null))[_0x59fc('0x27')](respondWithResult(_0x2f950a,null))['catch'](handleError(_0x2f950a,null));};exports[_0x59fc('0x28')]=function(_0x409fde,_0x178768){return db[_0x59fc('0x32')]['find']({'where':{'id':_0x409fde['params']['id']}})[_0x59fc('0x27')](handleEntityNotFound(_0x178768,null))[_0x59fc('0x27')](removeEntity(_0x178768,null))['catch'](handleError(_0x178768,null));}; \ No newline at end of file +var _0x29ae=['Dispositions','UserProfileResource','end','error','stack','name','send','map','Disposition','fieldName','type','model','query','keys','filters','intersection','attributes','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','fields','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x29ae,0x167));var _0xe29a=function(_0x270fa4,_0x1f8546){_0x270fa4=_0x270fa4-0x0;var _0x1239df=_0x29ae[_0x270fa4];return _0x1239df;};'use strict';var emlformat=require(_0xe29a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe29a('0x1'));var moment=require(_0xe29a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe29a('0x3'));var util=require('util');var path=require(_0xe29a('0x4'));var sox=require(_0xe29a('0x5'));var csv=require(_0xe29a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe29a('0x7'));var _=require(_0xe29a('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe29a('0x9'));var deskjs=require(_0xe29a('0xa'));var toCsv=require(_0xe29a('0x6'));var querystring=require(_0xe29a('0xb'));var Papa=require(_0xe29a('0xc'));var Redis=require(_0xe29a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xe29a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe29a('0xf'));var logger=require(_0xe29a('0x10'))(_0xe29a('0x11'));var utils=require(_0xe29a('0x12'));var config=require(_0xe29a('0x13'));var licenseUtil=require(_0xe29a('0x14'));var db=require(_0xe29a('0x15'))['db'];function respondWithStatusCode(_0x210dcc,_0x254cc4){_0x254cc4=_0x254cc4||0xcc;return function(_0x26f895){if(_0x26f895){return _0x210dcc[_0xe29a('0x16')](_0x254cc4);}return _0x210dcc[_0xe29a('0x17')](_0x254cc4)['end']();};}function respondWithResult(_0x5d47de,_0x3282a5){_0x3282a5=_0x3282a5||0xc8;return function(_0x54817c){if(_0x54817c){return _0x5d47de[_0xe29a('0x17')](_0x3282a5)[_0xe29a('0x18')](_0x54817c);}};}function respondWithFilteredResult(_0x2904aa,_0x119b48){return function(_0xdd0d3b){if(_0xdd0d3b){var _0x84ba57=typeof _0x119b48[_0xe29a('0x19')]===_0xe29a('0x1a')&&typeof _0x119b48[_0xe29a('0x1b')]===_0xe29a('0x1a');var _0x4ec604=_0xdd0d3b[_0xe29a('0x1c')];var _0x61ff63=_0x84ba57?0x0:_0x119b48[_0xe29a('0x19')];var _0x17268d=_0x84ba57?_0xdd0d3b[_0xe29a('0x1c')]:_0x119b48[_0xe29a('0x19')]+_0x119b48[_0xe29a('0x1b')];var _0xe62dd7;if(_0x17268d>=_0x4ec604){_0x17268d=_0x4ec604;_0xe62dd7=0xc8;}else{_0xe62dd7=0xce;}_0x2904aa[_0xe29a('0x17')](_0xe62dd7);return _0x2904aa[_0xe29a('0x1d')]('Content-Range',_0x61ff63+'-'+_0x17268d+'/'+_0x4ec604)[_0xe29a('0x18')](_0xdd0d3b);}return null;};}function patchUpdates(_0x52e6e8){return function(_0x2955ae){try{jsonpatch['apply'](_0x2955ae,_0x52e6e8,!![]);}catch(_0x3f876f){return BPromise[_0xe29a('0x1e')](_0x3f876f);}return _0x2955ae[_0xe29a('0x1f')]();};}function saveUpdates(_0x4a155f,_0x568a78){return function(_0x493a6a){if(_0x493a6a){return _0x493a6a[_0xe29a('0x20')](_0x4a155f)[_0xe29a('0x21')](function(_0xe17fb3){return _0xe17fb3;});}return null;};}function removeEntity(_0x4f3021,_0xc93894){return function(_0x489203){if(_0x489203){return _0x489203[_0xe29a('0x22')]()[_0xe29a('0x21')](function(){var _0x22ffab=_0x489203[_0xe29a('0x23')]({'plain':!![]});var _0x391d3a=_0xe29a('0x24');return db[_0xe29a('0x25')][_0xe29a('0x22')]({'where':{'type':_0x391d3a,'resourceId':_0x22ffab['id']}})[_0xe29a('0x21')](function(){return _0x489203;});})[_0xe29a('0x21')](function(){_0x4f3021['status'](0xcc)[_0xe29a('0x26')]();});}};}function handleEntityNotFound(_0x303256,_0x54b9fc){return function(_0x1d1656){if(!_0x1d1656){_0x303256[_0xe29a('0x16')](0x194);}return _0x1d1656;};}function handleError(_0x4462e0,_0x5bf1c1){_0x5bf1c1=_0x5bf1c1||0x1f4;return function(_0x412faa){logger[_0xe29a('0x27')](_0x412faa[_0xe29a('0x28')]);if(_0x412faa['name']){delete _0x412faa[_0xe29a('0x29')];}_0x4462e0[_0xe29a('0x17')](_0x5bf1c1)[_0xe29a('0x2a')](_0x412faa);};}exports['index']=function(_0x1a59d7,_0x2ae50d){var _0x2e73ca={},_0x1f533f={},_0x14fee1={'count':0x0,'rows':[]};var _0x261e8e=_[_0xe29a('0x2b')](db[_0xe29a('0x2c')]['rawAttributes'],function(_0x2368e9){return{'name':_0x2368e9[_0xe29a('0x2d')],'type':_0x2368e9[_0xe29a('0x2e')]['key']};});_0x1f533f[_0xe29a('0x2f')]=_[_0xe29a('0x2b')](_0x261e8e,'name');_0x1f533f[_0xe29a('0x30')]=_[_0xe29a('0x31')](_0x1a59d7[_0xe29a('0x30')]);_0x1f533f[_0xe29a('0x32')]=_[_0xe29a('0x33')](_0x1f533f[_0xe29a('0x2f')],_0x1f533f[_0xe29a('0x30')]);_0x2e73ca[_0xe29a('0x34')]=_[_0xe29a('0x33')](_0x1f533f[_0xe29a('0x2f')],qs['fields'](_0x1a59d7['query']['fields']));_0x2e73ca[_0xe29a('0x34')]=_0x2e73ca['attributes'][_0xe29a('0x35')]?_0x2e73ca[_0xe29a('0x34')]:_0x1f533f[_0xe29a('0x2f')];if(!_0x1a59d7['query']['hasOwnProperty'](_0xe29a('0x36'))){_0x2e73ca[_0xe29a('0x1b')]=qs['limit'](_0x1a59d7[_0xe29a('0x30')][_0xe29a('0x1b')]);_0x2e73ca[_0xe29a('0x19')]=qs[_0xe29a('0x19')](_0x1a59d7[_0xe29a('0x30')][_0xe29a('0x19')]);}_0x2e73ca['order']=qs[_0xe29a('0x37')](_0x1a59d7[_0xe29a('0x30')][_0xe29a('0x37')]);_0x2e73ca['where']=qs[_0xe29a('0x32')](_[_0xe29a('0x38')](_0x1a59d7[_0xe29a('0x30')],_0x1f533f[_0xe29a('0x32')]),_0x261e8e);if(_0x1a59d7[_0xe29a('0x30')][_0xe29a('0x39')]){_0x2e73ca[_0xe29a('0x3a')]=_[_0xe29a('0x3b')](_0x2e73ca[_0xe29a('0x3a')],{'$or':_[_0xe29a('0x2b')](_0x261e8e,function(_0x4800c3){if(_0x4800c3[_0xe29a('0x2e')]!==_0xe29a('0x3c')){var _0x4da83f={};_0x4da83f[_0x4800c3['name']]={'$like':'%'+_0x1a59d7[_0xe29a('0x30')][_0xe29a('0x39')]+'%'};return _0x4da83f;}})});}_0x2e73ca=_[_0xe29a('0x3b')]({},_0x2e73ca,_0x1a59d7[_0xe29a('0x3d')]);var _0x28d911={'where':_0x2e73ca[_0xe29a('0x3a')]};return db[_0xe29a('0x2c')]['count'](_0x28d911)[_0xe29a('0x21')](function(_0x22d78d){_0x14fee1[_0xe29a('0x1c')]=_0x22d78d;if(_0x1a59d7[_0xe29a('0x30')][_0xe29a('0x3e')]){_0x2e73ca['include']=[{'all':!![]}];}return db[_0xe29a('0x2c')][_0xe29a('0x3f')](_0x2e73ca);})['then'](function(_0x3368b2){_0x14fee1[_0xe29a('0x40')]=_0x3368b2;return _0x14fee1;})[_0xe29a('0x21')](respondWithFilteredResult(_0x2ae50d,_0x2e73ca))[_0xe29a('0x41')](handleError(_0x2ae50d,null));};exports[_0xe29a('0x42')]=function(_0x3bc29d,_0x2c211c){var _0xe1ba22={'raw':!![],'where':{'id':_0x3bc29d['params']['id']}},_0x1e2310={};_0x1e2310[_0xe29a('0x2f')]=_[_0xe29a('0x31')](db[_0xe29a('0x2c')][_0xe29a('0x43')]);_0x1e2310[_0xe29a('0x30')]=_[_0xe29a('0x31')](_0x3bc29d['query']);_0x1e2310['filters']=_['intersection'](_0x1e2310[_0xe29a('0x2f')],_0x1e2310[_0xe29a('0x30')]);_0xe1ba22[_0xe29a('0x34')]=_[_0xe29a('0x33')](_0x1e2310[_0xe29a('0x2f')],qs['fields'](_0x3bc29d['query'][_0xe29a('0x44')]));_0xe1ba22[_0xe29a('0x34')]=_0xe1ba22[_0xe29a('0x34')]['length']?_0xe1ba22[_0xe29a('0x34')]:_0x1e2310[_0xe29a('0x2f')];if(_0x3bc29d[_0xe29a('0x30')]['includeAll']){_0xe1ba22[_0xe29a('0x45')]=[{'all':!![]}];}_0xe1ba22=_[_0xe29a('0x3b')]({},_0xe1ba22,_0x3bc29d[_0xe29a('0x3d')]);return db[_0xe29a('0x2c')][_0xe29a('0x46')](_0xe1ba22)[_0xe29a('0x21')](handleEntityNotFound(_0x2c211c,null))[_0xe29a('0x21')](respondWithResult(_0x2c211c,null))['catch'](handleError(_0x2c211c,null));};exports[_0xe29a('0x47')]=function(_0x2a1f1d,_0x18dc09){return db[_0xe29a('0x2c')]['create'](_0x2a1f1d[_0xe29a('0x48')],{})['then'](function(_0x53fbb2){var _0x4822a9=_0x2a1f1d[_0xe29a('0x49')][_0xe29a('0x23')]({'plain':!![]});if(!_0x4822a9)throw new Error(_0xe29a('0x4a'));if(_0x4822a9['role']==='user'){var _0x3510b7=_0x53fbb2['get']({'plain':!![]});var _0x3933a3=_0xe29a('0x24');return db[_0xe29a('0x4b')][_0xe29a('0x46')]({'where':{'name':_0x3933a3,'userProfileId':_0x4822a9[_0xe29a('0x4c')]},'raw':!![]})[_0xe29a('0x21')](function(_0x216a44){if(_0x216a44&&_0x216a44['autoAssociation']===0x0){return db[_0xe29a('0x25')][_0xe29a('0x47')]({'name':_0x3510b7[_0xe29a('0x29')],'resourceId':_0x3510b7['id'],'type':_0x216a44[_0xe29a('0x29')],'sectionId':_0x216a44['id']},{})[_0xe29a('0x21')](function(){return _0x53fbb2;});}else{return _0x53fbb2;}})[_0xe29a('0x41')](function(_0x5ecee0){logger[_0xe29a('0x27')](_0xe29a('0x4d'),_0x5ecee0);throw _0x5ecee0;});}return _0x53fbb2;})[_0xe29a('0x21')](respondWithResult(_0x18dc09,0xc9))[_0xe29a('0x41')](handleError(_0x18dc09,null));};exports['update']=function(_0x23145a,_0x30d824){if(_0x23145a[_0xe29a('0x48')]['id']){delete _0x23145a[_0xe29a('0x48')]['id'];}return db['Disposition'][_0xe29a('0x46')]({'where':{'id':_0x23145a[_0xe29a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x30d824,null))[_0xe29a('0x21')](saveUpdates(_0x23145a['body'],null))[_0xe29a('0x21')](respondWithResult(_0x30d824,null))['catch'](handleError(_0x30d824,null));};exports['destroy']=function(_0x41ccf2,_0x230d74){return db[_0xe29a('0x2c')][_0xe29a('0x46')]({'where':{'id':_0x41ccf2[_0xe29a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x230d74,null))[_0xe29a('0x21')](removeEntity(_0x230d74,null))[_0xe29a('0x41')](handleError(_0x230d74,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 14ad5a5..2c7a60e 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 _0xffc1=['bluebird','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name_chat','name','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','api'];(function(_0xe70ed5,_0x404aab){var _0x515cd9=function(_0x33a3d7){while(--_0x33a3d7){_0xe70ed5['push'](_0xe70ed5['shift']());}};_0x515cd9(++_0x404aab);}(_0xffc1,0x184));var _0x1ffc=function(_0x564eb3,_0x2f301b){_0x564eb3=_0x564eb3-0x0;var _0x2a715c=_0xffc1[_0x564eb3];return _0x2a715c;};'use strict';var _=require(_0x1ffc('0x0'));var util=require(_0x1ffc('0x1'));var logger=require('../../config/logger')(_0x1ffc('0x2'));var moment=require('moment');var BPromise=require(_0x1ffc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1ffc('0x4'));var config=require(_0x1ffc('0x5'));var attributes=require(_0x1ffc('0x6'));module[_0x1ffc('0x7')]=function(_0x5975f7,_0x57ee37){return _0x5975f7[_0x1ffc('0x8')](_0x1ffc('0x9'),attributes,{'tableName':_0x1ffc('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x1ffc('0xb'),'fields':['name','ListId']},{'unique':!![],'name':_0x1ffc('0xc'),'fields':[_0x1ffc('0xd'),'ChatWebsiteId']},{'unique':!![],'name':_0x1ffc('0xe'),'fields':[_0x1ffc('0xd'),_0x1ffc('0xf')]},{'unique':!![],'name':_0x1ffc('0x10'),'fields':['name',_0x1ffc('0x11')]},{'unique':!![],'name':_0x1ffc('0x12'),'fields':[_0x1ffc('0xd'),'FaxAccountId']},{'unique':!![],'name':_0x1ffc('0x13'),'fields':['name',_0x1ffc('0x14')]},{'unique':!![],'name':_0x1ffc('0x15'),'fields':[_0x1ffc('0xd'),_0x1ffc('0x16')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7487=['exports','define','tools_dispositions','ListId','name_chat','name_mail','name','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1bcd40,_0x1c6d08){var _0x474167=function(_0x5ba1bf){while(--_0x5ba1bf){_0x1bcd40['push'](_0x1bcd40['shift']());}};_0x474167(++_0x1c6d08);}(_0x7487,0x1e4));var _0x7748=function(_0x5cab28,_0x307622){_0x5cab28=_0x5cab28-0x0;var _0xa3554d=_0x7487[_0x5cab28];return _0xa3554d;};'use strict';var _=require(_0x7748('0x0'));var util=require(_0x7748('0x1'));var logger=require(_0x7748('0x2'))(_0x7748('0x3'));var moment=require(_0x7748('0x4'));var BPromise=require(_0x7748('0x5'));var rp=require(_0x7748('0x6'));var fs=require('fs');var path=require(_0x7748('0x7'));var rimraf=require(_0x7748('0x8'));var config=require(_0x7748('0x9'));var attributes=require('./disposition.attributes');module[_0x7748('0xa')]=function(_0x5cb762,_0x361c80){return _0x5cb762[_0x7748('0xb')]('Disposition',attributes,{'tableName':_0x7748('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0x7748('0xd')]},{'unique':!![],'name':_0x7748('0xe'),'fields':['name','ChatWebsiteId']},{'unique':!![],'name':_0x7748('0xf'),'fields':[_0x7748('0x10'),_0x7748('0x11')]},{'unique':!![],'name':_0x7748('0x12'),'fields':[_0x7748('0x10'),_0x7748('0x13')]},{'unique':!![],'name':_0x7748('0x14'),'fields':[_0x7748('0x10'),_0x7748('0x15')]},{'unique':!![],'name':_0x7748('0x16'),'fields':[_0x7748('0x10'),_0x7748('0x17')]},{'unique':!![],'name':_0x7748('0x18'),'fields':['name',_0x7748('0x19')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 820894e..22fa6d6 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(_0x761050,_0x59e651){var _0xb5fa1a=function(_0x5781ff){while(--_0x5781ff){_0x761050['push'](_0x761050['shift']());}};_0xb5fa1a(++_0x59e651);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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(_0x31064d,_0x1eb426){var _0x852193=function(_0xe591ea){while(--_0xe591ea){_0x31064d['push'](_0x31064d['shift']());}};_0x852193(++_0x1eb426);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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 e95434b..c866336 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 _0xad49=['delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0xf15381,_0xa2819){var _0x14fa93=function(_0x215bbd){while(--_0x215bbd){_0xf15381['push'](_0xf15381['shift']());}};_0x14fa93(++_0xa2819);}(_0xad49,0x17f));var _0x9ad4=function(_0x4a8400,_0x139894){_0x4a8400=_0x4a8400-0x0;var _0x3c0988=_0xad49[_0x4a8400];return _0x3c0988;};'use strict';var multer=require(_0x9ad4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9ad4('0x1'));var express=require('express');var router=express[_0x9ad4('0x2')]();var fs_extra=require(_0x9ad4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9ad4('0x4'));var config=require(_0x9ad4('0x5'));var controller=require(_0x9ad4('0x6'));router[_0x9ad4('0x7')]('/',auth[_0x9ad4('0x8')](),controller[_0x9ad4('0x9')]);router[_0x9ad4('0x7')](_0x9ad4('0xa'),auth[_0x9ad4('0x8')](),controller[_0x9ad4('0xb')]);router[_0x9ad4('0xc')]('/',auth['isAuthenticated'](),controller[_0x9ad4('0xd')]);router[_0x9ad4('0xe')](_0x9ad4('0xa'),auth[_0x9ad4('0x8')](),controller[_0x9ad4('0xf')]);router[_0x9ad4('0x10')](_0x9ad4('0xa'),auth['isAuthenticated'](),controller[_0x9ad4('0x11')]);module[_0x9ad4('0x12')]=router; \ No newline at end of file +var _0x56b2=['show','post','create','put','/:id','update','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0x56b2,0x1bc));var _0x256b=function(_0x2f696f,_0x39dec1){_0x2f696f=_0x2f696f-0x0;var _0x5b2b4c=_0x56b2[_0x2f696f];return _0x5b2b4c;};'use strict';var multer=require('multer');var util=require(_0x256b('0x0'));var path=require(_0x256b('0x1'));var timeout=require('connect-timeout');var express=require(_0x256b('0x2'));var router=express[_0x256b('0x3')]();var fs_extra=require(_0x256b('0x4'));var auth=require(_0x256b('0x5'));var interaction=require(_0x256b('0x6'));var config=require(_0x256b('0x7'));var controller=require(_0x256b('0x8'));router[_0x256b('0x9')]('/',auth[_0x256b('0xa')](),controller[_0x256b('0xb')]);router[_0x256b('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x256b('0xc')]);router[_0x256b('0xd')]('/',auth[_0x256b('0xa')](),controller[_0x256b('0xe')]);router[_0x256b('0xf')](_0x256b('0x10'),auth[_0x256b('0xa')](),controller[_0x256b('0x11')]);router['delete']('/:id',auth[_0x256b('0xa')](),controller[_0x256b('0x12')]);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 c87a0de..a7ab46d 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 _0x5e08=['v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','yes','localstationid','ENUM','2400','4800','7200','12000','14400','9600'];(function(_0x43ce73,_0x2db82f){var _0x66374c=function(_0x2f159c){while(--_0x2f159c){_0x43ce73['push'](_0x43ce73['shift']());}};_0x66374c(++_0x2db82f);}(_0x5e08,0x1cf));var _0x85e0=function(_0x21d026,_0x3c996e){_0x21d026=_0x21d026-0x0;var _0x3ec1a7=_0x5e08[_0x21d026];return _0x3ec1a7;};'use strict';var Sequelize=require(_0x85e0('0x0'));module[_0x85e0('0x1')]={'name':{'type':Sequelize[_0x85e0('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x85e0('0x2')]},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x85e0('0x3')},'headerinfo':{'type':Sequelize[_0x85e0('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x85e0('0x2')],'unique':_0x85e0('0x4')},'minrate':{'type':Sequelize[_0x85e0('0x5')](_0x85e0('0x6'),_0x85e0('0x7'),_0x85e0('0x8'),'9600',_0x85e0('0x9'),_0x85e0('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x85e0('0x5')](_0x85e0('0x6'),'4800',_0x85e0('0x8'),_0x85e0('0xb'),_0x85e0('0x9'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x85e0('0xc')},'gateway':{'type':Sequelize[_0x85e0('0x2')],'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[_0x85e0('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x85e0('0xe'),_0x85e0('0xf'),_0x85e0('0x10'),_0x85e0('0x11')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x85e0('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x85e0('0x12')],'defaultValue':function(){return _0x85e0('0x13');}},'notificationSound':{'type':Sequelize[_0x85e0('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x85e0('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x85e0('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x85e0('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x85e0('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x85e0('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x85e0('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x85e0('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x85e0('0x15')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x85e0('0x16'),'set':function(_0x30b8e8){if(!_0x30b8e8)this[_0x85e0('0x17')](_0x85e0('0x18'),null);this['setDataValue']('mandatoryDisposition',_0x30b8e8);}}}; \ No newline at end of file +var _0x1e73=['14400','4800','7200','9600','v17,v27,v29','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','localstationid','2400','12000'];(function(_0x495438,_0x1632e2){var _0x3003c5=function(_0x571eaf){while(--_0x571eaf){_0x495438['push'](_0x495438['shift']());}};_0x3003c5(++_0x1632e2);}(_0x1e73,0x1c0));var _0x31e7=function(_0x149083,_0x4047b6){_0x149083=_0x149083-0x0;var _0x4dc74e=_0x1e73[_0x149083];return _0x4dc74e;};'use strict';var Sequelize=require(_0x31e7('0x0'));module[_0x31e7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x31e7('0x2')]},'ecm':{'type':Sequelize[_0x31e7('0x3')](_0x31e7('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x31e7('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x31e7('0x2')],'unique':_0x31e7('0x5')},'minrate':{'type':Sequelize[_0x31e7('0x3')](_0x31e7('0x6'),'4800','7200','9600',_0x31e7('0x7'),_0x31e7('0x8')),'defaultValue':_0x31e7('0x9')},'maxrate':{'type':Sequelize[_0x31e7('0x3')](_0x31e7('0x6'),_0x31e7('0x9'),_0x31e7('0xa'),_0x31e7('0xb'),'12000',_0x31e7('0x8')),'defaultValue':_0x31e7('0x8')},'modem':{'type':Sequelize[_0x31e7('0x2')],'defaultValue':_0x31e7('0xc')},'gateway':{'type':Sequelize[_0x31e7('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x31e7('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x31e7('0x3')](_0x31e7('0xd'),_0x31e7('0xe'),_0x31e7('0xf'),_0x31e7('0x10')),'defaultValue':_0x31e7('0xd')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x31e7('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x31e7('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x31e7('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x31e7('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x31e7('0x13')],'allowNull':!![],'defaultValue':null,'comment':_0x31e7('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x31e7('0x12')],'defaultValue':![],'comment':_0x31e7('0x15'),'set':function(_0x5ed2e0){if(!_0x5ed2e0)this[_0x31e7('0x16')]('mandatoryDispositionPauseId',null);this[_0x31e7('0x16')](_0x31e7('0x17'),_0x5ed2e0);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 4676f3f..7e6d626 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 _0xc459=['params','mandatoryDispositionPause','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','length','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','Contact','User','Owner','fullname','Tag','color','tag','addApplications','sequelize','transaction','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','finally','getApplications','context','from-voip-provider','exten','localstationid','app','Fax\x20Extension','priority','appdata','Answer','push','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','maxrate','modem','FAXOPT(','addAccountApplications','updateAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','FaxMessage','$gte','format','List','CmContact','Contacts','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./faxAccount.socket','jayson/promise','client','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','map','FaxAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show'];(function(_0x25a5a6,_0x178849){var _0x8808bb=function(_0x3e8ac3){while(--_0x3e8ac3){_0x25a5a6['push'](_0x25a5a6['shift']());}};_0x8808bb(++_0x178849);}(_0xc459,0x1f0));var _0x9c45=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc459[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9c45('0x0'));var rimraf=require(_0x9c45('0x1'));var zipdir=require(_0x9c45('0x2'));var jsonpatch=require(_0x9c45('0x3'));var rp=require(_0x9c45('0x4'));var moment=require(_0x9c45('0x5'));var BPromise=require(_0x9c45('0x6'));var Mustache=require('mustache');var util=require(_0x9c45('0x7'));var path=require('path');var sox=require(_0x9c45('0x8'));var csv=require(_0x9c45('0x9'));var ejs=require(_0x9c45('0xa'));var fs=require('fs');var fs_extra=require(_0x9c45('0xb'));var _=require('lodash');var squel=require(_0x9c45('0xc'));var crypto=require('crypto');var jsforce=require(_0x9c45('0xd'));var deskjs=require(_0x9c45('0xe'));var toCsv=require(_0x9c45('0x9'));var querystring=require(_0x9c45('0xf'));var Papa=require(_0x9c45('0x10'));var Redis=require(_0x9c45('0x11'));var authService=require(_0x9c45('0x12'));var qs=require(_0x9c45('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c45('0x14'));var logger=require(_0x9c45('0x15'))(_0x9c45('0x16'));var utils=require(_0x9c45('0x17'));var config=require(_0x9c45('0x18'));var licenseUtil=require(_0x9c45('0x19'));var db=require(_0x9c45('0x1a'))['db'];config[_0x9c45('0x1b')]=_[_0x9c45('0x1c')](config[_0x9c45('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9c45('0x1b')]));require(_0x9c45('0x1d'))['register'](socket);var jayson=require(_0x9c45('0x1e'));var client=jayson[_0x9c45('0x1f')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5d1e7c,_0x50b34f,_0x26ff1b,_0x3efbc5){return new BPromise(function(_0x138bbb,_0x421f0f){var _0x19e65f=_0x3efbc5||client;return _0x19e65f[_0x9c45('0x20')](_0x5d1e7c,_0x26ff1b)[_0x9c45('0x21')](function(_0x2b3008){logger[_0x9c45('0x22')]('FaxAccount,\x20%s,\x20%s',_0x50b34f,_0x9c45('0x23'));logger[_0x9c45('0x24')](_0x9c45('0x25'),_0x50b34f,'request\x20sent',JSON[_0x9c45('0x26')](_0x2b3008));if(_0x2b3008[_0x9c45('0x27')]){if(_0x2b3008[_0x9c45('0x27')][_0x9c45('0x28')]===0x1f4){logger[_0x9c45('0x27')](_0x9c45('0x29'),_0x50b34f,_0x2b3008[_0x9c45('0x27')][_0x9c45('0x2a')]);return _0x421f0f(_0x2b3008[_0x9c45('0x27')][_0x9c45('0x2a')]);}logger[_0x9c45('0x27')](_0x9c45('0x29'),_0x50b34f,_0x2b3008[_0x9c45('0x27')][_0x9c45('0x2a')]);return _0x138bbb(_0x2b3008[_0x9c45('0x27')][_0x9c45('0x2a')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x50b34f,_0x9c45('0x23'));_0x138bbb(_0x2b3008[_0x9c45('0x2b')]['message']);}})[_0x9c45('0x2c')](function(_0x5459a5){logger[_0x9c45('0x27')](_0x9c45('0x29'),_0x50b34f,_0x5459a5);_0x421f0f(_0x5459a5);});});}function respondWithStatusCode(_0x5b3403,_0x133069){_0x133069=_0x133069||0xcc;return function(_0x53a2b5){if(_0x53a2b5){return _0x5b3403[_0x9c45('0x2d')](_0x133069);}return _0x5b3403[_0x9c45('0x2e')](_0x133069)[_0x9c45('0x2f')]();};}function respondWithResult(_0x58536d,_0x304a86){_0x304a86=_0x304a86||0xc8;return function(_0x2caf9d){if(_0x2caf9d){return _0x58536d[_0x9c45('0x2e')](_0x304a86)[_0x9c45('0x30')](_0x2caf9d);}};}function respondWithFilteredResult(_0x5f25a6,_0x574e23){return function(_0x4aea58){if(_0x4aea58){var _0x400ec4=typeof _0x574e23[_0x9c45('0x31')]===_0x9c45('0x32')&&typeof _0x574e23[_0x9c45('0x33')]===_0x9c45('0x32');var _0x3a1162=_0x4aea58['count'];var _0x3c37a9=_0x400ec4?0x0:_0x574e23['offset'];var _0x6a3f8d=_0x400ec4?_0x4aea58[_0x9c45('0x34')]:_0x574e23[_0x9c45('0x31')]+_0x574e23[_0x9c45('0x33')];var _0x9c7b79;if(_0x6a3f8d>=_0x3a1162){_0x6a3f8d=_0x3a1162;_0x9c7b79=0xc8;}else{_0x9c7b79=0xce;}_0x5f25a6['status'](_0x9c7b79);return _0x5f25a6[_0x9c45('0x35')]('Content-Range',_0x3c37a9+'-'+_0x6a3f8d+'/'+_0x3a1162)['json'](_0x4aea58);}return null;};}function patchUpdates(_0x390701){return function(_0x3506da){try{jsonpatch['apply'](_0x3506da,_0x390701,!![]);}catch(_0x4bbf55){return BPromise[_0x9c45('0x36')](_0x4bbf55);}return _0x3506da[_0x9c45('0x37')]();};}function saveUpdates(_0x57efde,_0xb35fdb){return function(_0x55f12a){if(_0x55f12a){return _0x55f12a[_0x9c45('0x38')](_0x57efde)['then'](function(_0x1af1a8){return _0x1af1a8;});}return null;};}function removeEntity(_0x345ed9,_0x178b37){return function(_0x3debb4){if(_0x3debb4){return _0x3debb4[_0x9c45('0x39')]()[_0x9c45('0x21')](function(){var _0x3e32c9=_0x3debb4['get']({'plain':!![]});var _0x421718=_0x9c45('0x3a');return db[_0x9c45('0x3b')][_0x9c45('0x39')]({'where':{'type':_0x421718,'resourceId':_0x3e32c9['id']}})[_0x9c45('0x21')](function(){return _0x3debb4;});})[_0x9c45('0x21')](function(){_0x345ed9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xeef18b,_0x1f3896){return function(_0x2b6e56){if(!_0x2b6e56){_0xeef18b['sendStatus'](0x194);}return _0x2b6e56;};}function handleError(_0x1b6d54,_0x43ee8e){_0x43ee8e=_0x43ee8e||0x1f4;return function(_0x514ad1){logger[_0x9c45('0x27')](_0x514ad1[_0x9c45('0x3c')]);if(_0x514ad1[_0x9c45('0x3d')]){delete _0x514ad1[_0x9c45('0x3d')];}_0x1b6d54[_0x9c45('0x2e')](_0x43ee8e)[_0x9c45('0x3e')](_0x514ad1);};}exports[_0x9c45('0x3f')]=function(_0x3da6c7,_0x4180fd){var _0x38b324={'include':[{'model':db[_0x9c45('0x40')],'as':'mandatoryDispositionPause'}]},_0x1e6dba={},_0x5c6353={'count':0x0,'rows':[]};var _0x2b6490=_[_0x9c45('0x41')](db[_0x9c45('0x42')][_0x9c45('0x43')],function(_0x3c487c){return{'name':_0x3c487c[_0x9c45('0x44')],'type':_0x3c487c[_0x9c45('0x45')][_0x9c45('0x46')]};});_0x1e6dba[_0x9c45('0x47')]=_[_0x9c45('0x41')](_0x2b6490,_0x9c45('0x3d'));_0x1e6dba['query']=_[_0x9c45('0x48')](_0x3da6c7[_0x9c45('0x49')]);_0x1e6dba[_0x9c45('0x4a')]=_[_0x9c45('0x4b')](_0x1e6dba[_0x9c45('0x47')],_0x1e6dba[_0x9c45('0x49')]);_0x38b324['attributes']=_[_0x9c45('0x4b')](_0x1e6dba[_0x9c45('0x47')],qs[_0x9c45('0x4c')](_0x3da6c7[_0x9c45('0x49')][_0x9c45('0x4c')]));_0x38b324[_0x9c45('0x4d')]=_0x38b324[_0x9c45('0x4d')]['length']?_0x38b324['attributes']:_0x1e6dba[_0x9c45('0x47')];if(!_0x3da6c7['query'][_0x9c45('0x4e')](_0x9c45('0x4f'))){_0x38b324[_0x9c45('0x33')]=qs[_0x9c45('0x33')](_0x3da6c7['query'][_0x9c45('0x33')]);_0x38b324['offset']=qs[_0x9c45('0x31')](_0x3da6c7['query'][_0x9c45('0x31')]);}_0x38b324[_0x9c45('0x50')]=qs[_0x9c45('0x51')](_0x3da6c7[_0x9c45('0x49')][_0x9c45('0x51')]);_0x38b324['where']=qs[_0x9c45('0x4a')](_[_0x9c45('0x52')](_0x3da6c7['query'],_0x1e6dba['filters']),_0x2b6490);if(_0x3da6c7['query'][_0x9c45('0x53')]){_0x38b324[_0x9c45('0x54')]=_[_0x9c45('0x55')](_0x38b324[_0x9c45('0x54')],{'$or':_[_0x9c45('0x41')](_0x2b6490,function(_0x580dfc){if(_0x580dfc[_0x9c45('0x45')]!==_0x9c45('0x56')){var _0x2d40ce={};_0x2d40ce[_0x580dfc['name']]={'$like':'%'+_0x3da6c7['query']['filter']+'%'};return _0x2d40ce;}})});}_0x38b324=_[_0x9c45('0x55')]({},_0x38b324,_0x3da6c7[_0x9c45('0x57')]);var _0x2d095b={'where':_0x38b324[_0x9c45('0x54')]};return db['FaxAccount'][_0x9c45('0x34')](_0x2d095b)['then'](function(_0x1c25b4){_0x5c6353[_0x9c45('0x34')]=_0x1c25b4;if(_0x3da6c7[_0x9c45('0x49')]['includeAll']){_0x38b324[_0x9c45('0x58')]=[{'all':!![]}];}return db[_0x9c45('0x42')][_0x9c45('0x59')](_0x38b324);})[_0x9c45('0x21')](function(_0x3c160c){_0x5c6353[_0x9c45('0x5a')]=_0x3c160c;return _0x5c6353;})[_0x9c45('0x21')](respondWithFilteredResult(_0x4180fd,_0x38b324))[_0x9c45('0x2c')](handleError(_0x4180fd,null));};exports[_0x9c45('0x5b')]=function(_0x353b16,_0x2ff491){var _0x33e5b3={'raw':![],'where':{'id':_0x353b16[_0x9c45('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x9c45('0x5d')}]},_0x3bf14c={};_0x3bf14c[_0x9c45('0x47')]=_['keys'](db[_0x9c45('0x42')][_0x9c45('0x43')]);_0x3bf14c['query']=_[_0x9c45('0x48')](_0x353b16[_0x9c45('0x49')]);_0x3bf14c[_0x9c45('0x4a')]=_[_0x9c45('0x4b')](_0x3bf14c[_0x9c45('0x47')],_0x3bf14c[_0x9c45('0x49')]);_0x33e5b3['attributes']=_['intersection'](_0x3bf14c[_0x9c45('0x47')],qs[_0x9c45('0x4c')](_0x353b16[_0x9c45('0x49')]['fields']));_0x33e5b3['attributes']=_0x33e5b3[_0x9c45('0x4d')]['length']?_0x33e5b3[_0x9c45('0x4d')]:_0x3bf14c[_0x9c45('0x47')];if(_0x353b16[_0x9c45('0x49')][_0x9c45('0x5e')]){_0x33e5b3[_0x9c45('0x58')]=[{'all':!![]}];}_0x33e5b3=_[_0x9c45('0x55')]({},_0x33e5b3,_0x353b16[_0x9c45('0x57')]);return db[_0x9c45('0x42')][_0x9c45('0x5f')](_0x33e5b3)[_0x9c45('0x21')](handleEntityNotFound(_0x2ff491,null))[_0x9c45('0x21')](respondWithResult(_0x2ff491,null))['catch'](handleError(_0x2ff491,null));};exports['create']=function(_0x44417c,_0x58acab){return db[_0x9c45('0x42')][_0x9c45('0x60')](_0x44417c[_0x9c45('0x61')],{})[_0x9c45('0x21')](function(_0x41c9ab){var _0x36ae11=_0x44417c[_0x9c45('0x62')][_0x9c45('0x63')]({'plain':!![]});if(!_0x36ae11)throw new Error(_0x9c45('0x64'));if(_0x36ae11[_0x9c45('0x65')]===_0x9c45('0x62')){var _0x4c5d2a=_0x41c9ab[_0x9c45('0x63')]({'plain':!![]});var _0x2e5b92='FaxAccounts';return db[_0x9c45('0x66')][_0x9c45('0x5f')]({'where':{'name':_0x2e5b92,'userProfileId':_0x36ae11[_0x9c45('0x67')]},'raw':!![]})[_0x9c45('0x21')](function(_0x308a94){if(_0x308a94&&_0x308a94['autoAssociation']===0x0){return db['UserProfileResource'][_0x9c45('0x60')]({'name':_0x4c5d2a['name'],'resourceId':_0x4c5d2a['id'],'type':_0x308a94['name'],'sectionId':_0x308a94['id']},{})[_0x9c45('0x21')](function(){return _0x41c9ab;});}else{return _0x41c9ab;}})[_0x9c45('0x2c')](function(_0x24899e){logger[_0x9c45('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24899e);throw _0x24899e;});}return _0x41c9ab;})[_0x9c45('0x21')](respondWithResult(_0x58acab,0xc9))[_0x9c45('0x2c')](handleError(_0x58acab,null));};exports[_0x9c45('0x38')]=function(_0x45f1ea,_0xcc9b84){if(_0x45f1ea[_0x9c45('0x61')]['id']){delete _0x45f1ea[_0x9c45('0x61')]['id'];}return db['FaxAccount'][_0x9c45('0x5f')]({'where':{'id':_0x45f1ea[_0x9c45('0x5c')]['id']},'include':[{'model':db[_0x9c45('0x40')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0xcc9b84,null))[_0x9c45('0x21')](saveUpdates(_0x45f1ea['body'],null))[_0x9c45('0x21')](respondWithResult(_0xcc9b84,null))[_0x9c45('0x2c')](handleError(_0xcc9b84,null));};exports['destroy']=function(_0x105565,_0x4154cf){return db['FaxAccount'][_0x9c45('0x5f')]({'where':{'id':_0x105565[_0x9c45('0x5c')]['id']}})[_0x9c45('0x21')](handleEntityNotFound(_0x4154cf,null))[_0x9c45('0x21')](removeEntity(_0x4154cf,null))[_0x9c45('0x2c')](handleError(_0x4154cf,null));};exports[_0x9c45('0x68')]=function(_0x53b669,_0x2d8a25){return db[_0x9c45('0x42')][_0x9c45('0x68')]()[_0x9c45('0x21')](respondWithResult(_0x2d8a25,null))[_0x9c45('0x2c')](handleError(_0x2d8a25,null));};exports[_0x9c45('0x69')]=function(_0x286990,_0x4e9583,_0xf66b49){if(_0x286990['body']['id']){delete _0x286990[_0x9c45('0x61')]['id'];}return db[_0x9c45('0x42')]['find']({'where':{'id':_0x286990['params']['id']}})[_0x9c45('0x21')](handleEntityNotFound(_0x4e9583,null))[_0x9c45('0x21')](function(_0x230307){if(_0x230307){_0x286990[_0x9c45('0x61')][_0x9c45('0x6a')]=_0x230307['id'];return db[_0x9c45('0x6b')][_0x9c45('0x60')](_0x286990[_0x9c45('0x61')]);}})[_0x9c45('0x21')](respondWithResult(_0x4e9583,null))[_0x9c45('0x2c')](handleError(_0x4e9583,null));};exports[_0x9c45('0x6c')]=function(_0x1ba7d2,_0x4de526,_0xf3edb1){var _0x5a6f28={'raw':![],'where':{}};var _0x22946d={};var _0x3a8aba={'count':0x0,'rows':[]};return db['FaxAccount'][_0x9c45('0x6d')]({'where':{'id':_0x1ba7d2[_0x9c45('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4de526,null))[_0x9c45('0x21')](function(_0x368fc1){if(_0x368fc1){_0x22946d[_0x9c45('0x47')]=_[_0x9c45('0x48')](db[_0x9c45('0x6b')]['rawAttributes']);_0x22946d[_0x9c45('0x49')]=_[_0x9c45('0x48')](_0x1ba7d2[_0x9c45('0x49')]);_0x22946d[_0x9c45('0x4a')]=_['intersection'](_0x22946d[_0x9c45('0x47')],_0x22946d[_0x9c45('0x49')]);_0x5a6f28['attributes']=_[_0x9c45('0x4b')](_0x22946d[_0x9c45('0x47')],qs['fields'](_0x1ba7d2[_0x9c45('0x49')][_0x9c45('0x4c')]));_0x5a6f28[_0x9c45('0x4d')]=_0x5a6f28[_0x9c45('0x4d')][_0x9c45('0x6e')]?_0x5a6f28[_0x9c45('0x4d')]:_0x22946d['model'];if(!_0x1ba7d2['query']['hasOwnProperty']('nolimit')){_0x5a6f28['limit']=qs[_0x9c45('0x33')](_0x1ba7d2[_0x9c45('0x49')][_0x9c45('0x33')]);_0x5a6f28[_0x9c45('0x31')]=qs[_0x9c45('0x31')](_0x1ba7d2['query'][_0x9c45('0x31')]);}_0x5a6f28[_0x9c45('0x50')]=qs['sort'](_0x1ba7d2['query']['sort']);_0x5a6f28[_0x9c45('0x54')]=qs['filters'](_[_0x9c45('0x52')](_0x1ba7d2['query'],_0x22946d['filters']));_0x5a6f28['where'][_0x9c45('0x6a')]=_0x368fc1['id'];if(_0x1ba7d2[_0x9c45('0x49')][_0x9c45('0x53')]){_0x5a6f28[_0x9c45('0x54')]=_[_0x9c45('0x55')](_0x5a6f28[_0x9c45('0x54')],{'$or':_[_0x9c45('0x41')](_0x5a6f28[_0x9c45('0x4d')],function(_0x5ac61d){var _0x185151={};_0x185151[_0x5ac61d]={'$like':'%'+_0x1ba7d2[_0x9c45('0x49')][_0x9c45('0x53')]+'%'};return _0x185151;})});}_0x5a6f28=_[_0x9c45('0x55')]({},_0x5a6f28,_0x1ba7d2['options']);return db[_0x9c45('0x6b')][_0x9c45('0x34')]({'where':_0x5a6f28[_0x9c45('0x54')]})[_0x9c45('0x21')](function(_0x1bf38d){_0x3a8aba[_0x9c45('0x34')]=_0x1bf38d;if(_0x1ba7d2[_0x9c45('0x49')][_0x9c45('0x5e')]){_0x5a6f28[_0x9c45('0x58')]=[{'all':!![]}];}return db[_0x9c45('0x6b')][_0x9c45('0x59')](_0x5a6f28);})[_0x9c45('0x21')](function(_0x4a145e){_0x3a8aba[_0x9c45('0x5a')]=_0x4a145e;return _0x3a8aba;});}})['then'](respondWithFilteredResult(_0x4de526,_0x5a6f28))[_0x9c45('0x2c')](handleError(_0x4de526,null));};exports[_0x9c45('0x6f')]=function(_0x361456,_0x2d9a8b,_0x4ec397){return db['FaxAccount'][_0x9c45('0x5f')]({'where':{'id':_0x361456[_0x9c45('0x5c')]['id']}})[_0x9c45('0x21')](handleEntityNotFound(_0x2d9a8b,null))[_0x9c45('0x21')](function(_0x1f74d0){if(_0x1f74d0){return _0x1f74d0['removeDispositions'](_0x361456[_0x9c45('0x49')][_0x9c45('0x70')]);}})[_0x9c45('0x21')](respondWithStatusCode(_0x2d9a8b,null))[_0x9c45('0x2c')](handleError(_0x2d9a8b,null));};exports[_0x9c45('0x71')]=function(_0xd21491,_0x36f18d,_0x169d46){if(_0xd21491[_0x9c45('0x61')]['id']){delete _0xd21491[_0x9c45('0x61')]['id'];}return db[_0x9c45('0x42')]['find']({'where':{'id':_0xd21491[_0x9c45('0x5c')]['id']}})[_0x9c45('0x21')](handleEntityNotFound(_0x36f18d,null))[_0x9c45('0x21')](function(_0x3c5878){if(_0x3c5878){_0xd21491['body'][_0x9c45('0x6a')]=_0x3c5878['id'];return db[_0x9c45('0x72')][_0x9c45('0x60')](_0xd21491['body']);}})[_0x9c45('0x21')](respondWithResult(_0x36f18d,null))[_0x9c45('0x2c')](handleError(_0x36f18d,null));};exports[_0x9c45('0x73')]=function(_0x1e2aa0,_0x4e20d0,_0x3e0d9d){var _0x2df6ce={'raw':![],'where':{}};var _0x1334c3={};var _0x18e427={'count':0x0,'rows':[]};return db[_0x9c45('0x42')]['findOne']({'where':{'id':_0x1e2aa0[_0x9c45('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4e20d0,null))[_0x9c45('0x21')](function(_0x245db1){if(_0x245db1){_0x1334c3[_0x9c45('0x47')]=_['keys'](db[_0x9c45('0x72')][_0x9c45('0x43')]);_0x1334c3[_0x9c45('0x49')]=_[_0x9c45('0x48')](_0x1e2aa0[_0x9c45('0x49')]);_0x1334c3[_0x9c45('0x4a')]=_['intersection'](_0x1334c3['model'],_0x1334c3[_0x9c45('0x49')]);_0x2df6ce['attributes']=_[_0x9c45('0x4b')](_0x1334c3[_0x9c45('0x47')],qs[_0x9c45('0x4c')](_0x1e2aa0[_0x9c45('0x49')][_0x9c45('0x4c')]));_0x2df6ce[_0x9c45('0x4d')]=_0x2df6ce[_0x9c45('0x4d')][_0x9c45('0x6e')]?_0x2df6ce[_0x9c45('0x4d')]:_0x1334c3[_0x9c45('0x47')];if(!_0x1e2aa0['query']['hasOwnProperty'](_0x9c45('0x4f'))){_0x2df6ce[_0x9c45('0x33')]=qs[_0x9c45('0x33')](_0x1e2aa0[_0x9c45('0x49')][_0x9c45('0x33')]);_0x2df6ce['offset']=qs['offset'](_0x1e2aa0[_0x9c45('0x49')]['offset']);}_0x2df6ce[_0x9c45('0x50')]=qs[_0x9c45('0x51')](_0x1e2aa0[_0x9c45('0x49')][_0x9c45('0x51')]);_0x2df6ce[_0x9c45('0x54')]=qs[_0x9c45('0x4a')](_[_0x9c45('0x52')](_0x1e2aa0[_0x9c45('0x49')],_0x1334c3[_0x9c45('0x4a')]));_0x2df6ce[_0x9c45('0x54')][_0x9c45('0x6a')]=_0x245db1['id'];if(_0x1e2aa0[_0x9c45('0x49')][_0x9c45('0x53')]){_0x2df6ce['where']=_[_0x9c45('0x55')](_0x2df6ce['where'],{'$or':_[_0x9c45('0x41')](_0x2df6ce[_0x9c45('0x4d')],function(_0x89054d){var _0x17a6e5={};_0x17a6e5[_0x89054d]={'$like':'%'+_0x1e2aa0['query'][_0x9c45('0x53')]+'%'};return _0x17a6e5;})});}_0x2df6ce=_[_0x9c45('0x55')]({},_0x2df6ce,_0x1e2aa0[_0x9c45('0x57')]);return db[_0x9c45('0x72')][_0x9c45('0x34')]({'where':_0x2df6ce[_0x9c45('0x54')]})[_0x9c45('0x21')](function(_0x4de117){_0x18e427[_0x9c45('0x34')]=_0x4de117;if(_0x1e2aa0[_0x9c45('0x49')][_0x9c45('0x5e')]){_0x2df6ce[_0x9c45('0x58')]=[{'all':!![]}];}return db[_0x9c45('0x72')][_0x9c45('0x59')](_0x2df6ce);})['then'](function(_0x2d65d1){_0x18e427['rows']=_0x2d65d1;return _0x18e427;});}})[_0x9c45('0x21')](respondWithFilteredResult(_0x4e20d0,_0x2df6ce))[_0x9c45('0x2c')](handleError(_0x4e20d0,null));};exports['removeAnswers']=function(_0x36c12a,_0x4bbfff,_0x3cbcac){return db[_0x9c45('0x42')]['find']({'where':{'id':_0x36c12a[_0x9c45('0x5c')]['id']}})[_0x9c45('0x21')](handleEntityNotFound(_0x4bbfff,null))['then'](function(_0x23a6a2){if(_0x23a6a2){return _0x23a6a2[_0x9c45('0x74')](_0x36c12a[_0x9c45('0x49')][_0x9c45('0x70')]);}})[_0x9c45('0x21')](respondWithStatusCode(_0x4bbfff,null))[_0x9c45('0x2c')](handleError(_0x4bbfff,null));};exports[_0x9c45('0x75')]=function(_0x1661ff,_0x595ec3,_0x54be58){return db[_0x9c45('0x76')][_0x9c45('0x5f')]({'where':{'id':_0x1661ff[_0x9c45('0x5c')]['id']}})[_0x9c45('0x21')](handleEntityNotFound(_0x595ec3,null))[_0x9c45('0x21')](function(_0x5e423b){if(_0x5e423b){return _0x5e423b[_0x9c45('0x75')](_0x1661ff[_0x9c45('0x61')][_0x9c45('0x70')],_[_0x9c45('0x77')](_0x1661ff['body'],[_0x9c45('0x70'),'id'])||{});}})[_0x9c45('0x21')](respondWithResult(_0x595ec3,null))[_0x9c45('0x2c')](handleError(_0x595ec3,null));};exports[_0x9c45('0x78')]=function(_0x1e19b0,_0x4470fd,_0x50b454){var _0x532ea0={'raw':![],'where':{}};var _0x5d4757={};var _0x26ba9b={'count':0x0,'rows':[]};return db[_0x9c45('0x42')][_0x9c45('0x6d')]({'where':{'id':_0x1e19b0['params']['id']}})['then'](handleEntityNotFound(_0x4470fd,null))[_0x9c45('0x21')](function(_0x3b3ede){if(_0x3b3ede){_0x5d4757[_0x9c45('0x47')]=_[_0x9c45('0x48')](db[_0x9c45('0x76')]['rawAttributes']);_0x5d4757[_0x9c45('0x49')]=_[_0x9c45('0x48')](_0x1e19b0[_0x9c45('0x49')]);_0x5d4757[_0x9c45('0x4a')]=_[_0x9c45('0x4b')](_0x5d4757[_0x9c45('0x47')],_0x5d4757['query']);_0x532ea0[_0x9c45('0x4d')]=_[_0x9c45('0x4b')](_0x5d4757[_0x9c45('0x47')],qs[_0x9c45('0x4c')](_0x1e19b0['query'][_0x9c45('0x4c')]));_0x532ea0[_0x9c45('0x4d')]=_0x532ea0[_0x9c45('0x4d')][_0x9c45('0x6e')]?_0x532ea0[_0x9c45('0x4d')]:_0x5d4757[_0x9c45('0x47')];if(!_0x1e19b0[_0x9c45('0x49')][_0x9c45('0x4e')](_0x9c45('0x4f'))){_0x532ea0[_0x9c45('0x33')]=qs[_0x9c45('0x33')](_0x1e19b0[_0x9c45('0x49')][_0x9c45('0x33')]);_0x532ea0[_0x9c45('0x31')]=qs['offset'](_0x1e19b0[_0x9c45('0x49')]['offset']);}_0x532ea0[_0x9c45('0x50')]=qs[_0x9c45('0x51')](_0x1e19b0[_0x9c45('0x49')]['sort']);_0x532ea0['where']=qs[_0x9c45('0x4a')](_[_0x9c45('0x52')](_0x1e19b0[_0x9c45('0x49')],_0x5d4757[_0x9c45('0x4a')]));_0x532ea0[_0x9c45('0x54')][_0x9c45('0x6a')]=_0x3b3ede['id'];if(_0x1e19b0[_0x9c45('0x49')][_0x9c45('0x53')]){_0x532ea0[_0x9c45('0x54')]=_[_0x9c45('0x55')](_0x532ea0['where'],{'$or':_[_0x9c45('0x41')](_0x532ea0['attributes'],function(_0x2de3b8){var _0x5318d2={};_0x5318d2[_0x2de3b8]={'$like':'%'+_0x1e19b0['query'][_0x9c45('0x53')]+'%'};return _0x5318d2;})});}_0x532ea0=_[_0x9c45('0x55')]({},_0x532ea0,_0x1e19b0[_0x9c45('0x57')]);return db[_0x9c45('0x76')][_0x9c45('0x34')]({'where':_0x532ea0[_0x9c45('0x54')]})[_0x9c45('0x21')](function(_0x1e598e){_0x26ba9b['count']=_0x1e598e;if(_0x1e19b0['query'][_0x9c45('0x5e')]){_0x532ea0[_0x9c45('0x58')]=[{'model':db['CmContact'],'as':_0x9c45('0x79'),'required':![]},{'model':db[_0x9c45('0x7a')],'as':_0x9c45('0x7b'),'attributes':['name',_0x9c45('0x7c'),'internal'],'required':![]},{'model':db[_0x9c45('0x7d')],'as':'Tags','attributes':['id',_0x9c45('0x3d'),_0x9c45('0x7e')],'where':_0x1e19b0[_0x9c45('0x49')]['tag']?{'id':_0x1e19b0[_0x9c45('0x49')][_0x9c45('0x7f')]}:undefined,'required':_0x1e19b0[_0x9c45('0x49')][_0x9c45('0x7f')]?!![]:![]}];}return db['FaxInteraction'][_0x9c45('0x59')](_0x532ea0);})[_0x9c45('0x21')](function(_0x48ed99){_0x26ba9b[_0x9c45('0x5a')]=_0x48ed99;return _0x26ba9b;});}})[_0x9c45('0x21')](respondWithFilteredResult(_0x4470fd,_0x532ea0))['catch'](handleError(_0x4470fd,null));};exports[_0x9c45('0x80')]=function(_0x79fe16,_0xa5fc94){var _0x4a9763=_0x79fe16[_0x9c45('0x5c')]['id'];var _0x493239=_0x79fe16['body'];var _0x4c8b0b=0xc8;var _0xb21af2=null;return db[_0x9c45('0x81')][_0x9c45('0x82')]({'isolationLevel':db[_0x9c45('0x81')]['Transaction']['ISOLATION_LEVELS'][_0x9c45('0x83')]},function(_0x34168d){return db[_0x9c45('0x42')][_0x9c45('0x6d')]({'where':{'id':_0x4a9763},'transaction':_0x34168d})[_0x9c45('0x21')](function(_0x494ed2){if(_0x494ed2){return db[_0x9c45('0x84')][_0x9c45('0x39')]({'where':{'FaxAccountId':_0x4a9763},'transaction':_0x34168d})[_0x9c45('0x21')](function(){var _0x1069e6=_['map'](_0x493239,function(_0x56bccd){_0x56bccd[_0x9c45('0x6a')]=_0x4a9763;return _0x56bccd;});return db[_0x9c45('0x84')][_0x9c45('0x85')](_0x1069e6,{'transaction':_0x34168d});});}else{_0x4c8b0b=0x194;_0xb21af2=[];}});})[_0x9c45('0x21')](function(){if(_0x4c8b0b!==0x194){return db[_0x9c45('0x84')][_0x9c45('0x86')]({'where':{'FaxAccountId':_0x4a9763},'order':'priority'})[_0x9c45('0x21')](function(_0x5b4ef){_0xb21af2=_0x5b4ef;});}})[_0x9c45('0x2c')](function(_0x48621d){_0x4c8b0b=0x1f4;logger[_0x9c45('0x27')](_0x48621d[_0x9c45('0x3c')]);if(_0x48621d[_0x9c45('0x3d')]){delete _0x48621d[_0x9c45('0x3d')];}_0xb21af2=_0x48621d;})[_0x9c45('0x87')](function(){if(_0xb21af2===null){_0xa5fc94[_0x9c45('0x2d')](_0x4c8b0b);}else{if(_0x4c8b0b===0x1f4){_0xa5fc94[_0x9c45('0x2e')](_0x4c8b0b)['send'](_0xb21af2);}else{_0xa5fc94[_0x9c45('0x2e')](_0x4c8b0b)[_0x9c45('0x30')](_0xb21af2);}}});};exports['getApplications']=function(_0x56413b,_0xc427fb,_0x44c145){var _0x34bda2={};var _0x1f1fdf={};var _0x4e51eb;var _0x48da89;return db[_0x9c45('0x42')][_0x9c45('0x6d')]({'where':{'id':_0x56413b['params']['id']}})[_0x9c45('0x21')](handleEntityNotFound(_0xc427fb,null))['then'](function(_0x36fb27){if(_0x36fb27){_0x4e51eb=_0x36fb27;_0x1f1fdf['model']=_[_0x9c45('0x48')](db[_0x9c45('0x84')][_0x9c45('0x43')]);_0x1f1fdf['query']=_[_0x9c45('0x48')](_0x56413b[_0x9c45('0x49')]);_0x1f1fdf[_0x9c45('0x4a')]=_[_0x9c45('0x4b')](_0x1f1fdf[_0x9c45('0x47')],_0x1f1fdf[_0x9c45('0x49')]);_0x34bda2['attributes']=_[_0x9c45('0x4b')](_0x1f1fdf[_0x9c45('0x47')],qs['fields'](_0x56413b['query']['fields']));_0x34bda2[_0x9c45('0x4d')]=_0x34bda2[_0x9c45('0x4d')][_0x9c45('0x6e')]?_0x34bda2[_0x9c45('0x4d')]:_0x1f1fdf[_0x9c45('0x47')];_0x34bda2['order']=qs['sort'](_0x56413b[_0x9c45('0x49')]['sort']);_0x34bda2['where']=qs[_0x9c45('0x4a')](_[_0x9c45('0x52')](_0x56413b[_0x9c45('0x49')],_0x1f1fdf[_0x9c45('0x4a')]));if(_0x56413b['query'][_0x9c45('0x53')]){_0x34bda2['where']=_[_0x9c45('0x55')](_0x34bda2[_0x9c45('0x54')],{'$or':_[_0x9c45('0x41')](_0x34bda2['attributes'],function(_0x577513){var _0x4d7d79={};_0x4d7d79[_0x577513]={'$like':'%'+_0x56413b[_0x9c45('0x49')]['filter']+'%'};return _0x4d7d79;})});}_0x34bda2=_['merge']({},_0x34bda2,_0x56413b[_0x9c45('0x57')]);return _0x4e51eb[_0x9c45('0x88')](_0x34bda2);}})['then'](function(_0x22dc45){if(_0x22dc45){_0x48da89=_0x22dc45[_0x9c45('0x6e')];if(!_0x56413b[_0x9c45('0x49')][_0x9c45('0x4e')]('nolimit')){_0x34bda2[_0x9c45('0x33')]=qs['limit'](_0x56413b[_0x9c45('0x49')][_0x9c45('0x33')]);_0x34bda2[_0x9c45('0x31')]=qs[_0x9c45('0x31')](_0x56413b[_0x9c45('0x49')][_0x9c45('0x31')]);}return _0x4e51eb[_0x9c45('0x88')](_0x34bda2);}})[_0x9c45('0x21')](function(_0x584ea9){if(_0x584ea9){return _0x584ea9?{'count':_0x48da89,'rows':_0x584ea9}:null;}})[_0x9c45('0x21')](respondWithResult(_0xc427fb,null))[_0x9c45('0x2c')](handleError(_0xc427fb,null));};function Extension(_0x5ea78d,_0x378876,_0x37fa89,_0x47c3b0){this[_0x9c45('0x89')]=_0x9c45('0x8a');this[_0x9c45('0x8b')]=_0x5ea78d[_0x9c45('0x8c')];this[_0x9c45('0x8d')]=_0x47c3b0;this[_0x9c45('0x45')]='system';this['description']=_0x9c45('0x8e');this[_0x9c45('0x6a')]=_0x5ea78d['id'];this[_0x9c45('0x8f')]=_0x378876;this[_0x9c45('0x90')]=_0x37fa89;}function createExtensionsReciveFax(_0x6f753a){var _0x297520=0x1;var _0x4d6254=[];_0x4d6254['push'](new Extension(_0x6f753a,_0x297520,'',_0x9c45('0x91')));_0x297520+=0x1;_0x4d6254[_0x9c45('0x92')](new Extension(_0x6f753a,_0x297520,_0x9c45('0x93'),_0x9c45('0x94')));_0x297520+=0x1;for(var _0x176a98 in _0x6f753a){if(_0x6f753a['hasOwnProperty'](_0x176a98)&&(_0x176a98===_0x9c45('0x95')||_0x176a98===_0x9c45('0x8c')||_0x176a98===_0x9c45('0x96')||_0x176a98==='faxdetect'||_0x176a98===_0x9c45('0x97')||_0x176a98===_0x9c45('0x98')||_0x176a98==='minrate'||_0x176a98===_0x9c45('0x99')||_0x176a98==='t38timeout')){_0x4d6254[_0x9c45('0x92')](new Extension(_0x6f753a,_0x297520,_0x9c45('0x9a')+_0x176a98+')='+_0x6f753a[_0x176a98],_0x9c45('0x94')));_0x297520+=0x1;}}_0x4d6254['push'](new Extension(_0x6f753a,_0x297520,'6','Wait'));_0x297520+=0x1;_0x4d6254['push'](new Extension(_0x6f753a,_0x297520,'/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax'));_0x297520=0x0;return _0x4d6254;}exports[_0x9c45('0x9b')]=function(_0x231230,_0x562133,_0x187363){var _0x19e514;return db[_0x9c45('0x81')][_0x9c45('0x82')](function(_0x111f7b){return db[_0x9c45('0x42')][_0x9c45('0x60')](_0x231230[_0x9c45('0x61')],{'transaction':_0x111f7b})['then'](function(_0x2bb228){_0x19e514=_0x2bb228[_0x9c45('0x63')]({'plain':!![]});return db['VoiceExtension'][_0x9c45('0x85')](createExtensionsReciveFax(_0x19e514),{'transaction':_0x111f7b});});})['then'](function(){return _0x19e514;})['then'](respondWithResult(_0x562133,null))[_0x9c45('0x2c')](handleError(_0x562133,null));};exports[_0x9c45('0x9c')]=function(_0x3d2840,_0x4f5556,_0x2e86b9){var _0x3627d4;return db[_0x9c45('0x81')]['transaction'](function(_0x6ab263){return db[_0x9c45('0x42')][_0x9c45('0x38')](_0x3d2840[_0x9c45('0x61')],{'where':{'id':_0x3d2840['body']['id']},'transaction':_0x6ab263})[_0x9c45('0x21')](function(_0x1b445e){return db['VoiceExtension'][_0x9c45('0x39')]({'where':{'FaxAccountId':_0x3d2840[_0x9c45('0x61')]['id']},'transaction':_0x6ab263})[_0x9c45('0x21')](function(_0x3560ce){return db[_0x9c45('0x9d')][_0x9c45('0x85')](createExtensionsReciveFax(_[_0x9c45('0x77')](_0x3d2840[_0x9c45('0x61')],[_0x9c45('0x9e'),'key',_0x9c45('0x9f'),_0x9c45('0xa0'),_0x9c45('0xa1'),_0x9c45('0xa2')])),{'transaction':_0x6ab263});});});})['then'](function(){return db['FaxAccount']['findById'](_0x3d2840[_0x9c45('0x61')]['id']);})[_0x9c45('0x21')](respondWithResult(_0x4f5556,null))[_0x9c45('0x2c')](handleError(_0x4f5556,null));};exports['getMessages']=function(_0x16a3eb,_0x3ed788,_0x14a94f){var _0x9ba1ba={'raw':!![],'where':{}};var _0xe72bf9={};var _0x1545fb={'count':0x0,'rows':[]};return db[_0x9c45('0x42')][_0x9c45('0x6d')]({'where':{'id':_0x16a3eb['params']['id']}})[_0x9c45('0x21')](handleEntityNotFound(_0x3ed788,null))[_0x9c45('0x21')](function(_0x5060d0){if(_0x5060d0){_0xe72bf9[_0x9c45('0x47')]=_[_0x9c45('0x48')](db[_0x9c45('0xa3')][_0x9c45('0x43')]);_0xe72bf9[_0x9c45('0x49')]=_[_0x9c45('0x48')](_0x16a3eb[_0x9c45('0x49')]);_0xe72bf9[_0x9c45('0x4a')]=_[_0x9c45('0x4b')](_0xe72bf9[_0x9c45('0x47')],_0xe72bf9[_0x9c45('0x49')]);_0x9ba1ba[_0x9c45('0x4d')]=_[_0x9c45('0x4b')](_0xe72bf9[_0x9c45('0x47')],qs['fields'](_0x16a3eb[_0x9c45('0x49')][_0x9c45('0x4c')]));_0x9ba1ba[_0x9c45('0x4d')]=_0x9ba1ba[_0x9c45('0x4d')]['length']?_0x9ba1ba[_0x9c45('0x4d')]:_0xe72bf9[_0x9c45('0x47')];if(!_0x16a3eb[_0x9c45('0x49')]['hasOwnProperty'](_0x9c45('0x4f'))){_0x9ba1ba[_0x9c45('0x33')]=qs['limit'](_0x16a3eb[_0x9c45('0x49')][_0x9c45('0x33')]);_0x9ba1ba[_0x9c45('0x31')]=qs[_0x9c45('0x31')](_0x16a3eb[_0x9c45('0x49')][_0x9c45('0x31')]);}_0x9ba1ba['order']=qs['sort'](_0x16a3eb[_0x9c45('0x49')][_0x9c45('0x51')]);_0x9ba1ba[_0x9c45('0x54')]=qs[_0x9c45('0x4a')](_[_0x9c45('0x52')](_0x16a3eb[_0x9c45('0x49')],_0xe72bf9[_0x9c45('0x4a')]));_0x9ba1ba[_0x9c45('0x54')][_0x9c45('0x6a')]=_0x5060d0['id'];if(_0x16a3eb[_0x9c45('0x49')][_0x9c45('0x53')]){_0x9ba1ba[_0x9c45('0x54')]=_['merge'](_0x9ba1ba['where'],{'$or':_[_0x9c45('0x41')](_0x9ba1ba[_0x9c45('0x4d')],function(_0x128311){var _0x175230={};_0x175230[_0x128311]={'$like':'%'+_0x16a3eb[_0x9c45('0x49')][_0x9c45('0x53')]+'%'};return _0x175230;})});}if(_0x16a3eb[_0x9c45('0x49')][_0x9c45('0xa4')]){var _0x26ebba=_0x16a3eb[_0x9c45('0x49')]['$gte']['split'](',');var _0x4890a0={};_0x4890a0[_0x26ebba[0x0]]={'$gte':moment(_0x26ebba[0x1])[_0x9c45('0xa5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x9ba1ba[_0x9c45('0x54')]=_['merge'](_0x9ba1ba[_0x9c45('0x54')],_0x4890a0);}_0x9ba1ba=_[_0x9c45('0x55')]({},_0x9ba1ba,_0x16a3eb[_0x9c45('0x57')]);return db['FaxMessage'][_0x9c45('0x34')]({'where':_0x9ba1ba[_0x9c45('0x54')]})[_0x9c45('0x21')](function(_0x2b76f1){_0x1545fb[_0x9c45('0x34')]=_0x2b76f1;if(_0x16a3eb[_0x9c45('0x49')][_0x9c45('0x5e')]){_0x9ba1ba[_0x9c45('0x58')]=[{'all':!![]}];}return db[_0x9c45('0xa3')][_0x9c45('0x59')](_0x9ba1ba);})[_0x9c45('0x21')](function(_0xe254af){_0x1545fb[_0x9c45('0x5a')]=_0xe254af;return _0x1545fb;});}})[_0x9c45('0x21')](respondWithFilteredResult(_0x3ed788,_0x9ba1ba))[_0x9c45('0x2c')](handleError(_0x3ed788,null));};exports[_0x9c45('0x3e')]=function(_0x1d5944,_0x9ed101,_0x5dbf5d){var _0x13d2d8,_0x51a5f1={},_0x2491ea;if(_0x1d5944[_0x9c45('0x61')]['to']){_0x2491ea=_0x1d5944[_0x9c45('0x61')]['to'][0x0];}return db[_0x9c45('0x42')][_0x9c45('0x5f')]({'where':{'id':_0x1d5944[_0x9c45('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0x9c45('0xa6'),'include':[{'model':db[_0x9c45('0xa7')],'as':_0x9c45('0xa8'),'where':{'fax':_0x2491ea},'limit':0x1,'order':[[_0x9c45('0xa0'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x9ed101,null))['then'](function(_0x5d2114){_0x13d2d8=_0x5d2114;if(_0x1d5944[_0x9c45('0x61')][_0x9c45('0xa9')]&&_0x1d5944['body'][_0x9c45('0xa9')][_0x9c45('0x6e')]){for(var _0x541e54=0x0;_0x541e54<_0x1d5944[_0x9c45('0x61')][_0x9c45('0xa9')][_0x9c45('0x6e')];_0x541e54+=0x1){_0x1d5944[_0x9c45('0x61')][_0x9c45('0xa9')][_0x541e54]={'filename':_0x1d5944[_0x9c45('0x61')][_0x9c45('0xa9')][_0x541e54]['name'],'id':_0x1d5944[_0x9c45('0x61')][_0x9c45('0xa9')][_0x541e54]['id'],'path':path[_0x9c45('0xaa')](config[_0x9c45('0xab')],_0x9c45('0xac'),_0x1d5944['body'][_0x9c45('0xa9')][_0x541e54][_0x9c45('0xad')])};}}return respondWithRpcPromise(_0x9c45('0xae'),_0x9c45('0xae'),{'FaxAccountId':_[_0x9c45('0xaf')](_0x1d5944[_0x9c45('0x5c')]['id'])?undefined:_0x1d5944['params']['id'],'path':_['isNil'](_0x1d5944['body'][_0x9c45('0xa9')][0x0][_0x9c45('0xb0')])?undefined:_0x1d5944[_0x9c45('0x61')][_0x9c45('0xa9')][0x0][_0x9c45('0xb0')],'fax':_[_0x9c45('0xaf')](_0x1d5944[_0x9c45('0x61')]['to'][0x0])?undefined:_0x1d5944[_0x9c45('0x61')]['to'][0x0]},client9002);})['then'](function(){if(_0x13d2d8){if(_[_0x9c45('0xaf')](_0x1d5944[_0x9c45('0x61')][_0x9c45('0xb1')])){_0x1d5944[_0x9c45('0x61')][_0x9c45('0xb1')]=util['format'](_0x9c45('0xb2'),_0x13d2d8[_0x9c45('0x3d')],_0x13d2d8[_0x9c45('0xb3')]);}if(_0x13d2d8[_0x9c45('0xa6')]){if(_0x13d2d8[_0x9c45('0xa6')][_0x9c45('0xa8')][_0x9c45('0x6e')]){return _0x13d2d8[_0x9c45('0xa6')][_0x9c45('0xa8')][0x0];}else{return db[_0x9c45('0xa7')]['create'](_[_0x9c45('0x1c')](_0x1d5944[_0x9c45('0x61')],{'firstName':_0x1d5944[_0x9c45('0x61')]['to'][0x0],'phone':_0x1d5944[_0x9c45('0x61')]['to'][0x0],'fax':_0x1d5944['body']['to'][0x0],'ListId':_0x13d2d8[_0x9c45('0xa2')]}));}}else{throw new Error(_0x9c45('0xb4'));}}else{throw new Error(_0x9c45('0xb5'));}})[_0x9c45('0x21')](function(_0x2931a5){if(_0x2931a5){return db[_0x9c45('0x76')][_0x9c45('0x5f')]({'where':{'ContactId':_0x2931a5['id'],'closed':![],'FaxAccountId':_0x13d2d8['id']}})[_0x9c45('0x21')](function(_0x1ff3f7){if(_0x1ff3f7){return[_0x1ff3f7,![]];}return db[_0x9c45('0x76')]['create']({'UserId':_0x1d5944[_0x9c45('0x62')]['id'],'ContactId':_0x2931a5['id'],'FaxAccountId':_0x13d2d8['id'],'fax':_0x1d5944[_0x9c45('0x61')]['to'][0x0],'firstMsgDirection':_0x9c45('0xb6'),'Messages':[_[_0x9c45('0x55')](_0x1d5944['body'],{'read':![],'body':_0x1d5944[_0x9c45('0x61')]['attachments'][0x0][_0x9c45('0xb7')],'FaxAccountId':_0x13d2d8['id'],'UserId':_0x1d5944[_0x9c45('0x62')]['id'],'ContactId':_0x2931a5['id'],'AttachmentId':_0x1d5944[_0x9c45('0x61')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x9c45('0xa3')],'as':_0x9c45('0xb8')}]})['then'](function(_0x42e7d1){return[_0x42e7d1,!![]];});});}else{throw new Error(_0x9c45('0xb9'));}})[_0x9c45('0xba')](function(_0x4274a7,_0x49f3c9){if(_0x49f3c9){return _0x4274a7;}return db[_0x9c45('0xa3')]['create']({'direction':_0x9c45('0xb6'),'read':![],'body':_0x1d5944['body'][_0x9c45('0xa9')][0x0][_0x9c45('0xb7')],'FaxAccountId':_0x13d2d8['id'],'FaxInteractionId':_0x4274a7['id'],'UserId':_0x1d5944['user']['id'],'ContactId':_0x4274a7['ContactId'],'AttachmentId':_0x1d5944['body'][_0x9c45('0xa9')][0x0]['id']})[_0x9c45('0x21')](function(_0x3d79cb){_0x4274a7[_0x9c45('0xbb')][_0x9c45('0xb8')]=[];_0x4274a7[_0x9c45('0xbb')][_0x9c45('0xb8')][_0x9c45('0x92')](_0x3d79cb[_0x9c45('0xbb')]);return _0x4274a7;});})[_0x9c45('0x21')](function(_0x5e8d02){respondWithRpcPromise(_0x9c45('0xbc'),_0x9c45('0xbc'),{'FaxAccountId':_[_0x9c45('0xaf')](_0x1d5944[_0x9c45('0x5c')]['id'])?undefined:_0x1d5944[_0x9c45('0x5c')]['id'],'path':_[_0x9c45('0xaf')](_0x1d5944['body'][_0x9c45('0xa9')][0x0]['path'])?undefined:_0x1d5944['body']['attachments'][0x0][_0x9c45('0xb0')],'fax':_[_0x9c45('0xaf')](_0x1d5944[_0x9c45('0x61')]['to'][0x0])?undefined:_0x1d5944[_0x9c45('0x61')]['to'][0x0],'AttachmentId':_0x1d5944[_0x9c45('0x61')][_0x9c45('0xa9')][0x0]['id']},client9002)[_0x9c45('0x21')](function(_0x228189){logger[_0x9c45('0x22')](_0x9c45('0xbd'),_0x228189);})['catch'](function(_0x20fbb4){logger['info'](_0x9c45('0xbd'),_0x20fbb4);});return _0x5e8d02;})[_0x9c45('0x21')](respondWithResult(_0x9ed101,null))[_0x9c45('0x2c')](handleError(_0x9ed101,null));};exports['addAgents']=function(_0x971708,_0x12bb7b,_0xb96215){return db['FaxAccount'][_0x9c45('0x5f')]({'where':{'id':_0x971708[_0x9c45('0x5c')]['id']}})[_0x9c45('0x21')](handleEntityNotFound(_0x12bb7b,null))[_0x9c45('0x21')](function(_0x620a1f){if(_0x620a1f){return _0x620a1f['addAgents'](_0x971708[_0x9c45('0x61')]['ids'],_[_0x9c45('0x77')](_0x971708[_0x9c45('0x61')],[_0x9c45('0x70'),'id'])||{})[_0x9c45('0xba')](function(_0x58fa08){for(var _0x130c0f=0x0;_0x130c0f<_0x971708[_0x9c45('0x61')]['ids'][_0x9c45('0x6e')];_0x130c0f+=0x1){socket[_0x9c45('0xbe')](_0x9c45('0xbf'),{'UserId':Number(_0x971708[_0x9c45('0x61')]['ids'][_0x130c0f]),'FaxAccountId':Number(_0x971708[_0x9c45('0x5c')]['id'])});}return _0x58fa08;});}})[_0x9c45('0x21')](respondWithResult(_0x12bb7b,null))[_0x9c45('0x2c')](handleError(_0x12bb7b,null));};exports[_0x9c45('0xc0')]=function(_0x8f0ff4,_0x10ff51,_0x34857f){return db['FaxAccount']['find']({'where':{'id':_0x8f0ff4[_0x9c45('0x5c')]['id']}})[_0x9c45('0x21')](handleEntityNotFound(_0x10ff51,null))[_0x9c45('0x21')](function(_0x414b60){if(_0x414b60){return _0x414b60['removeAgents'](_0x8f0ff4[_0x9c45('0x49')][_0x9c45('0x70')])[_0x9c45('0x21')](function(){if(_[_0x9c45('0xc1')](_0x8f0ff4[_0x9c45('0x49')]['ids'])){for(var _0x81233e=0x0;_0x81233e<_0x8f0ff4[_0x9c45('0x49')]['ids'][_0x9c45('0x6e')];_0x81233e+=0x1){socket[_0x9c45('0xbe')](_0x9c45('0xc2'),{'UserId':Number(_0x8f0ff4['query']['ids'][_0x81233e]),'FaxAccountId':Number(_0x8f0ff4[_0x9c45('0x5c')]['id'])});}}else{socket[_0x9c45('0xbe')](_0x9c45('0xc2'),{'UserId':Number(_0x8f0ff4[_0x9c45('0x49')][_0x9c45('0x70')]),'FaxAccountId':Number(_0x8f0ff4['params']['id'])});}});}})[_0x9c45('0x21')](respondWithStatusCode(_0x10ff51,null))[_0x9c45('0x2c')](handleError(_0x10ff51,null));};exports[_0x9c45('0xc3')]=function(_0x46d598,_0x4e874c,_0x1d028f){var _0x14816e={};var _0x33cc2b={};var _0x20d554;var _0x4f9bbf;return db[_0x9c45('0x42')]['findOne']({'where':{'id':_0x46d598['params']['id']}})[_0x9c45('0x21')](handleEntityNotFound(_0x4e874c,null))[_0x9c45('0x21')](function(_0x5ae5fc){if(_0x5ae5fc){_0x20d554=_0x5ae5fc;_0x33cc2b['model']=_['keys'](db[_0x9c45('0x7a')]['rawAttributes']);_0x33cc2b['query']=_[_0x9c45('0x48')](_0x46d598['query']);_0x33cc2b[_0x9c45('0x4a')]=_['intersection'](_0x33cc2b[_0x9c45('0x47')],_0x33cc2b[_0x9c45('0x49')]);_0x14816e[_0x9c45('0x4d')]=_['intersection'](_0x33cc2b[_0x9c45('0x47')],qs[_0x9c45('0x4c')](_0x46d598[_0x9c45('0x49')][_0x9c45('0x4c')]));_0x14816e[_0x9c45('0x4d')]=_0x14816e[_0x9c45('0x4d')][_0x9c45('0x6e')]?_0x14816e[_0x9c45('0x4d')]:_0x33cc2b[_0x9c45('0x47')];_0x14816e[_0x9c45('0x50')]=qs[_0x9c45('0x51')](_0x46d598[_0x9c45('0x49')][_0x9c45('0x51')]);_0x14816e['where']=qs['filters'](_[_0x9c45('0x52')](_0x46d598[_0x9c45('0x49')],_0x33cc2b['filters']));if(_0x46d598[_0x9c45('0x49')][_0x9c45('0x53')]){_0x14816e['where']=_[_0x9c45('0x55')](_0x14816e['where'],{'$or':_[_0x9c45('0x41')](_0x14816e[_0x9c45('0x4d')],function(_0x4c9e34){var _0x5a58d8={};_0x5a58d8[_0x4c9e34]={'$like':'%'+_0x46d598['query'][_0x9c45('0x53')]+'%'};return _0x5a58d8;})});}_0x14816e=_[_0x9c45('0x55')]({},_0x14816e,_0x46d598[_0x9c45('0x57')]);return _0x20d554[_0x9c45('0xc3')](_0x14816e);}})[_0x9c45('0x21')](function(_0x57dfae){if(_0x57dfae){_0x4f9bbf=_0x57dfae['length'];if(!_0x46d598['query']['hasOwnProperty'](_0x9c45('0x4f'))){_0x14816e[_0x9c45('0x33')]=qs[_0x9c45('0x33')](_0x46d598['query'][_0x9c45('0x33')]);_0x14816e[_0x9c45('0x31')]=qs[_0x9c45('0x31')](_0x46d598[_0x9c45('0x49')]['offset']);}return _0x20d554['getAgents'](_0x14816e);}})[_0x9c45('0x21')](function(_0x327462){if(_0x327462){return _0x327462?{'count':_0x4f9bbf,'rows':_0x327462}:null;}})[_0x9c45('0x21')](respondWithResult(_0x4e874c,null))[_0x9c45('0x2c')](handleError(_0x4e874c,null));}; \ No newline at end of file +var _0x15c6=['Content-Range','save','update','destroy','get','UserProfileResource','stack','send','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','name','keys','filters','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','include','findAll','rows','params','Pause','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','describe','FaxAccountId','Disposition','getDispositions','pick','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll','priority','finally','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','appdata','Answer','push','CDR(type)=inbound-fax','Set','gateway','faxdetect','maxrate','minrate','modem','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','tech','updatedAt','ListId','findById','getMessages','FaxMessage','$gte','split','format','CmList','Contacts','attachments','join','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','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','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','set'];(function(_0x1210c8,_0x3dc75d){var _0x337b41=function(_0x10b72b){while(--_0x10b72b){_0x1210c8['push'](_0x1210c8['shift']());}};_0x337b41(++_0x3dc75d);}(_0x15c6,0x93));var _0x615c=function(_0x4eab61,_0x1a6e6d){_0x4eab61=_0x4eab61-0x0;var _0x342426=_0x15c6[_0x4eab61];return _0x342426;};'use strict';var emlformat=require(_0x615c('0x0'));var rimraf=require(_0x615c('0x1'));var zipdir=require(_0x615c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x615c('0x3'));var moment=require(_0x615c('0x4'));var BPromise=require(_0x615c('0x5'));var Mustache=require(_0x615c('0x6'));var util=require(_0x615c('0x7'));var path=require(_0x615c('0x8'));var sox=require(_0x615c('0x9'));var csv=require(_0x615c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x615c('0xb'));var _=require(_0x615c('0xc'));var squel=require(_0x615c('0xd'));var crypto=require(_0x615c('0xe'));var jsforce=require(_0x615c('0xf'));var deskjs=require(_0x615c('0x10'));var toCsv=require(_0x615c('0xa'));var querystring=require('querystring');var Papa=require(_0x615c('0x11'));var Redis=require(_0x615c('0x12'));var authService=require(_0x615c('0x13'));var qs=require(_0x615c('0x14'));var as=require(_0x615c('0x15'));var hardwareService=require(_0x615c('0x16'));var logger=require(_0x615c('0x17'))('api');var utils=require(_0x615c('0x18'));var config=require(_0x615c('0x19'));var licenseUtil=require(_0x615c('0x1a'));var db=require('../../mysqldb')['db'];config[_0x615c('0x1b')]=_[_0x615c('0x1c')](config[_0x615c('0x1b')],{'host':_0x615c('0x1d'),'port':0x18eb});var socket=require(_0x615c('0x1e'))(new Redis(config[_0x615c('0x1b')]));require(_0x615c('0x1f'))[_0x615c('0x20')](socket);var jayson=require(_0x615c('0x21'));var client=jayson[_0x615c('0x22')][_0x615c('0x23')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4383c5,_0x40273e,_0x4500ce,_0x3e89c0){return new BPromise(function(_0x275b59,_0x785f8c){var _0x378491=_0x3e89c0||client;return _0x378491[_0x615c('0x24')](_0x4383c5,_0x4500ce)[_0x615c('0x25')](function(_0x725b8a){logger[_0x615c('0x26')](_0x615c('0x27'),_0x40273e,_0x615c('0x28'));logger[_0x615c('0x29')](_0x615c('0x2a'),_0x40273e,_0x615c('0x28'),JSON[_0x615c('0x2b')](_0x725b8a));if(_0x725b8a[_0x615c('0x2c')]){if(_0x725b8a[_0x615c('0x2c')]['code']===0x1f4){logger[_0x615c('0x2c')](_0x615c('0x27'),_0x40273e,_0x725b8a[_0x615c('0x2c')][_0x615c('0x2d')]);return _0x785f8c(_0x725b8a[_0x615c('0x2c')][_0x615c('0x2d')]);}logger[_0x615c('0x2c')]('FaxAccount,\x20%s,\x20%s',_0x40273e,_0x725b8a[_0x615c('0x2c')][_0x615c('0x2d')]);return _0x275b59(_0x725b8a[_0x615c('0x2c')][_0x615c('0x2d')]);}else{logger[_0x615c('0x26')](_0x615c('0x27'),_0x40273e,_0x615c('0x28'));_0x275b59(_0x725b8a[_0x615c('0x2e')][_0x615c('0x2d')]);}})[_0x615c('0x2f')](function(_0x59c8d9){logger[_0x615c('0x2c')](_0x615c('0x27'),_0x40273e,_0x59c8d9);_0x785f8c(_0x59c8d9);});});}function respondWithStatusCode(_0x3cd69a,_0x31f194){_0x31f194=_0x31f194||0xcc;return function(_0x6357f6){if(_0x6357f6){return _0x3cd69a[_0x615c('0x30')](_0x31f194);}return _0x3cd69a['status'](_0x31f194)[_0x615c('0x31')]();};}function respondWithResult(_0x519af0,_0xabb6fe){_0xabb6fe=_0xabb6fe||0xc8;return function(_0x459e74){if(_0x459e74){return _0x519af0[_0x615c('0x32')](_0xabb6fe)[_0x615c('0x33')](_0x459e74);}};}function respondWithFilteredResult(_0x6a32b0,_0x30d0de){return function(_0x247db8){if(_0x247db8){var _0x209ddf=typeof _0x30d0de[_0x615c('0x34')]==='undefined'&&typeof _0x30d0de[_0x615c('0x35')]===_0x615c('0x36');var _0x5e5631=_0x247db8['count'];var _0x6fc464=_0x209ddf?0x0:_0x30d0de[_0x615c('0x34')];var _0x47d07c=_0x209ddf?_0x247db8['count']:_0x30d0de['offset']+_0x30d0de[_0x615c('0x35')];var _0x3f5971;if(_0x47d07c>=_0x5e5631){_0x47d07c=_0x5e5631;_0x3f5971=0xc8;}else{_0x3f5971=0xce;}_0x6a32b0[_0x615c('0x32')](_0x3f5971);return _0x6a32b0[_0x615c('0x37')](_0x615c('0x38'),_0x6fc464+'-'+_0x47d07c+'/'+_0x5e5631)['json'](_0x247db8);}return null;};}function patchUpdates(_0x31f61e){return function(_0x27d8fd){try{jsonpatch['apply'](_0x27d8fd,_0x31f61e,!![]);}catch(_0x5a0dbd){return BPromise['reject'](_0x5a0dbd);}return _0x27d8fd[_0x615c('0x39')]();};}function saveUpdates(_0x44e5cc,_0x1a4b87){return function(_0x6608a3){if(_0x6608a3){return _0x6608a3[_0x615c('0x3a')](_0x44e5cc)['then'](function(_0xcf41c0){return _0xcf41c0;});}return null;};}function removeEntity(_0x3963c7,_0x5019a4){return function(_0x4e6cd4){if(_0x4e6cd4){return _0x4e6cd4[_0x615c('0x3b')]()[_0x615c('0x25')](function(){var _0x357554=_0x4e6cd4[_0x615c('0x3c')]({'plain':!![]});var _0x4d507d='FaxAccounts';return db[_0x615c('0x3d')][_0x615c('0x3b')]({'where':{'type':_0x4d507d,'resourceId':_0x357554['id']}})[_0x615c('0x25')](function(){return _0x4e6cd4;});})[_0x615c('0x25')](function(){_0x3963c7[_0x615c('0x32')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cbba5,_0x5ddfb6){return function(_0x12005e){if(!_0x12005e){_0x2cbba5[_0x615c('0x30')](0x194);}return _0x12005e;};}function handleError(_0x3fd03e,_0x1adead){_0x1adead=_0x1adead||0x1f4;return function(_0x4efa29){logger[_0x615c('0x2c')](_0x4efa29[_0x615c('0x3e')]);if(_0x4efa29['name']){delete _0x4efa29['name'];}_0x3fd03e[_0x615c('0x32')](_0x1adead)[_0x615c('0x3f')](_0x4efa29);};}exports['index']=function(_0x4ac63e,_0x492a5f){var _0x480932={'include':[{'model':db['Pause'],'as':_0x615c('0x40')}]},_0x39f480={},_0x4d3156={'count':0x0,'rows':[]};var _0x8731e8=_[_0x615c('0x41')](db[_0x615c('0x42')][_0x615c('0x43')],function(_0x4ae3ae){return{'name':_0x4ae3ae[_0x615c('0x44')],'type':_0x4ae3ae[_0x615c('0x45')][_0x615c('0x46')]};});_0x39f480['model']=_[_0x615c('0x41')](_0x8731e8,_0x615c('0x47'));_0x39f480['query']=_[_0x615c('0x48')](_0x4ac63e['query']);_0x39f480[_0x615c('0x49')]=_['intersection'](_0x39f480[_0x615c('0x4a')],_0x39f480[_0x615c('0x4b')]);_0x480932[_0x615c('0x4c')]=_[_0x615c('0x4d')](_0x39f480['model'],qs[_0x615c('0x4e')](_0x4ac63e[_0x615c('0x4b')][_0x615c('0x4e')]));_0x480932['attributes']=_0x480932[_0x615c('0x4c')][_0x615c('0x4f')]?_0x480932[_0x615c('0x4c')]:_0x39f480['model'];if(!_0x4ac63e['query'][_0x615c('0x50')](_0x615c('0x51'))){_0x480932[_0x615c('0x35')]=qs[_0x615c('0x35')](_0x4ac63e[_0x615c('0x4b')][_0x615c('0x35')]);_0x480932[_0x615c('0x34')]=qs[_0x615c('0x34')](_0x4ac63e[_0x615c('0x4b')][_0x615c('0x34')]);}_0x480932[_0x615c('0x52')]=qs[_0x615c('0x53')](_0x4ac63e[_0x615c('0x4b')][_0x615c('0x53')]);_0x480932[_0x615c('0x54')]=qs[_0x615c('0x49')](_['pick'](_0x4ac63e[_0x615c('0x4b')],_0x39f480['filters']),_0x8731e8);if(_0x4ac63e[_0x615c('0x4b')][_0x615c('0x55')]){_0x480932[_0x615c('0x54')]=_[_0x615c('0x56')](_0x480932[_0x615c('0x54')],{'$or':_[_0x615c('0x41')](_0x8731e8,function(_0x31edd8){if(_0x31edd8[_0x615c('0x45')]!==_0x615c('0x57')){var _0x208420={};_0x208420[_0x31edd8['name']]={'$like':'%'+_0x4ac63e['query'][_0x615c('0x55')]+'%'};return _0x208420;}})});}_0x480932=_[_0x615c('0x56')]({},_0x480932,_0x4ac63e[_0x615c('0x58')]);var _0x20a106={'where':_0x480932['where']};return db[_0x615c('0x42')]['count'](_0x20a106)[_0x615c('0x25')](function(_0x591811){_0x4d3156[_0x615c('0x59')]=_0x591811;if(_0x4ac63e[_0x615c('0x4b')]['includeAll']){_0x480932[_0x615c('0x5a')]=[{'all':!![]}];}return db[_0x615c('0x42')][_0x615c('0x5b')](_0x480932);})[_0x615c('0x25')](function(_0x54c0ba){_0x4d3156[_0x615c('0x5c')]=_0x54c0ba;return _0x4d3156;})['then'](respondWithFilteredResult(_0x492a5f,_0x480932))[_0x615c('0x2f')](handleError(_0x492a5f,null));};exports['show']=function(_0x97393f,_0x1510e2){var _0x2b6e88={'raw':![],'where':{'id':_0x97393f[_0x615c('0x5d')]['id']},'include':[{'model':db[_0x615c('0x5e')],'as':_0x615c('0x40')}]},_0x2876d9={};_0x2876d9[_0x615c('0x4a')]=_[_0x615c('0x48')](db[_0x615c('0x42')][_0x615c('0x43')]);_0x2876d9[_0x615c('0x4b')]=_[_0x615c('0x48')](_0x97393f[_0x615c('0x4b')]);_0x2876d9['filters']=_[_0x615c('0x4d')](_0x2876d9[_0x615c('0x4a')],_0x2876d9[_0x615c('0x4b')]);_0x2b6e88[_0x615c('0x4c')]=_[_0x615c('0x4d')](_0x2876d9[_0x615c('0x4a')],qs[_0x615c('0x4e')](_0x97393f['query']['fields']));_0x2b6e88['attributes']=_0x2b6e88[_0x615c('0x4c')][_0x615c('0x4f')]?_0x2b6e88[_0x615c('0x4c')]:_0x2876d9[_0x615c('0x4a')];if(_0x97393f[_0x615c('0x4b')][_0x615c('0x5f')]){_0x2b6e88[_0x615c('0x5a')]=[{'all':!![]}];}_0x2b6e88=_[_0x615c('0x56')]({},_0x2b6e88,_0x97393f[_0x615c('0x58')]);return db[_0x615c('0x42')][_0x615c('0x60')](_0x2b6e88)[_0x615c('0x25')](handleEntityNotFound(_0x1510e2,null))[_0x615c('0x25')](respondWithResult(_0x1510e2,null))['catch'](handleError(_0x1510e2,null));};exports[_0x615c('0x61')]=function(_0x270276,_0x2aefaf){return db[_0x615c('0x42')][_0x615c('0x61')](_0x270276[_0x615c('0x62')],{})['then'](function(_0x42619c){var _0x3dadca=_0x270276['user'][_0x615c('0x3c')]({'plain':!![]});if(!_0x3dadca)throw new Error(_0x615c('0x63'));if(_0x3dadca[_0x615c('0x64')]===_0x615c('0x65')){var _0x4fabe2=_0x42619c['get']({'plain':!![]});var _0x4d5d64=_0x615c('0x66');return db[_0x615c('0x67')][_0x615c('0x60')]({'where':{'name':_0x4d5d64,'userProfileId':_0x3dadca[_0x615c('0x68')]},'raw':!![]})[_0x615c('0x25')](function(_0x529735){if(_0x529735&&_0x529735[_0x615c('0x69')]===0x0){return db['UserProfileResource'][_0x615c('0x61')]({'name':_0x4fabe2[_0x615c('0x47')],'resourceId':_0x4fabe2['id'],'type':_0x529735[_0x615c('0x47')],'sectionId':_0x529735['id']},{})[_0x615c('0x25')](function(){return _0x42619c;});}else{return _0x42619c;}})[_0x615c('0x2f')](function(_0xf022ad){logger[_0x615c('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf022ad);throw _0xf022ad;});}return _0x42619c;})[_0x615c('0x25')](respondWithResult(_0x2aefaf,0xc9))[_0x615c('0x2f')](handleError(_0x2aefaf,null));};exports[_0x615c('0x3a')]=function(_0x4b8633,_0x41d621){if(_0x4b8633[_0x615c('0x62')]['id']){delete _0x4b8633[_0x615c('0x62')]['id'];}return db[_0x615c('0x42')][_0x615c('0x60')]({'where':{'id':_0x4b8633['params']['id']},'include':[{'model':db[_0x615c('0x5e')],'as':_0x615c('0x40')}]})[_0x615c('0x25')](handleEntityNotFound(_0x41d621,null))[_0x615c('0x25')](saveUpdates(_0x4b8633['body'],null))['then'](respondWithResult(_0x41d621,null))['catch'](handleError(_0x41d621,null));};exports['destroy']=function(_0x18974a,_0x3e65f9){return db['FaxAccount'][_0x615c('0x60')]({'where':{'id':_0x18974a[_0x615c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3e65f9,null))[_0x615c('0x25')](removeEntity(_0x3e65f9,null))[_0x615c('0x2f')](handleError(_0x3e65f9,null));};exports[_0x615c('0x6a')]=function(_0x5f5b29,_0x21d8a9){return db[_0x615c('0x42')][_0x615c('0x6a')]()[_0x615c('0x25')](respondWithResult(_0x21d8a9,null))[_0x615c('0x2f')](handleError(_0x21d8a9,null));};exports['addDisposition']=function(_0x304504,_0x45b122,_0x3acbd2){if(_0x304504[_0x615c('0x62')]['id']){delete _0x304504['body']['id'];}return db[_0x615c('0x42')][_0x615c('0x60')]({'where':{'id':_0x304504['params']['id']}})[_0x615c('0x25')](handleEntityNotFound(_0x45b122,null))[_0x615c('0x25')](function(_0x46cb34){if(_0x46cb34){_0x304504[_0x615c('0x62')][_0x615c('0x6b')]=_0x46cb34['id'];return db[_0x615c('0x6c')][_0x615c('0x61')](_0x304504['body']);}})[_0x615c('0x25')](respondWithResult(_0x45b122,null))[_0x615c('0x2f')](handleError(_0x45b122,null));};exports[_0x615c('0x6d')]=function(_0xbe6668,_0x5143fa,_0x4acf55){var _0x369870={'raw':![],'where':{}};var _0x5c1532={};var _0x2e71f2={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0xbe6668[_0x615c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x5143fa,null))[_0x615c('0x25')](function(_0xe4e3a5){if(_0xe4e3a5){_0x5c1532['model']=_[_0x615c('0x48')](db[_0x615c('0x6c')][_0x615c('0x43')]);_0x5c1532[_0x615c('0x4b')]=_['keys'](_0xbe6668[_0x615c('0x4b')]);_0x5c1532['filters']=_[_0x615c('0x4d')](_0x5c1532['model'],_0x5c1532[_0x615c('0x4b')]);_0x369870[_0x615c('0x4c')]=_['intersection'](_0x5c1532[_0x615c('0x4a')],qs[_0x615c('0x4e')](_0xbe6668[_0x615c('0x4b')]['fields']));_0x369870['attributes']=_0x369870[_0x615c('0x4c')][_0x615c('0x4f')]?_0x369870[_0x615c('0x4c')]:_0x5c1532[_0x615c('0x4a')];if(!_0xbe6668[_0x615c('0x4b')]['hasOwnProperty']('nolimit')){_0x369870['limit']=qs[_0x615c('0x35')](_0xbe6668['query'][_0x615c('0x35')]);_0x369870[_0x615c('0x34')]=qs[_0x615c('0x34')](_0xbe6668[_0x615c('0x4b')][_0x615c('0x34')]);}_0x369870['order']=qs['sort'](_0xbe6668[_0x615c('0x4b')][_0x615c('0x53')]);_0x369870[_0x615c('0x54')]=qs['filters'](_[_0x615c('0x6e')](_0xbe6668[_0x615c('0x4b')],_0x5c1532['filters']));_0x369870['where']['FaxAccountId']=_0xe4e3a5['id'];if(_0xbe6668[_0x615c('0x4b')][_0x615c('0x55')]){_0x369870['where']=_[_0x615c('0x56')](_0x369870[_0x615c('0x54')],{'$or':_['map'](_0x369870['attributes'],function(_0x5d2fb8){var _0x56299e={};_0x56299e[_0x5d2fb8]={'$like':'%'+_0xbe6668[_0x615c('0x4b')]['filter']+'%'};return _0x56299e;})});}_0x369870=_[_0x615c('0x56')]({},_0x369870,_0xbe6668[_0x615c('0x58')]);return db[_0x615c('0x6c')]['count']({'where':_0x369870[_0x615c('0x54')]})[_0x615c('0x25')](function(_0x47bcaa){_0x2e71f2['count']=_0x47bcaa;if(_0xbe6668[_0x615c('0x4b')][_0x615c('0x5f')]){_0x369870[_0x615c('0x5a')]=[{'all':!![]}];}return db[_0x615c('0x6c')][_0x615c('0x5b')](_0x369870);})[_0x615c('0x25')](function(_0x55f957){_0x2e71f2['rows']=_0x55f957;return _0x2e71f2;});}})['then'](respondWithFilteredResult(_0x5143fa,_0x369870))[_0x615c('0x2f')](handleError(_0x5143fa,null));};exports[_0x615c('0x6f')]=function(_0x5b1167,_0x2cdde5,_0x4f1e5a){return db[_0x615c('0x42')][_0x615c('0x60')]({'where':{'id':_0x5b1167[_0x615c('0x5d')]['id']}})[_0x615c('0x25')](handleEntityNotFound(_0x2cdde5,null))[_0x615c('0x25')](function(_0x87ce83){if(_0x87ce83){return _0x87ce83[_0x615c('0x6f')](_0x5b1167[_0x615c('0x4b')][_0x615c('0x70')]);}})[_0x615c('0x25')](respondWithStatusCode(_0x2cdde5,null))[_0x615c('0x2f')](handleError(_0x2cdde5,null));};exports[_0x615c('0x71')]=function(_0x1a3b22,_0x2bb4f1,_0x24f25e){if(_0x1a3b22[_0x615c('0x62')]['id']){delete _0x1a3b22['body']['id'];}return db[_0x615c('0x42')][_0x615c('0x60')]({'where':{'id':_0x1a3b22[_0x615c('0x5d')]['id']}})[_0x615c('0x25')](handleEntityNotFound(_0x2bb4f1,null))[_0x615c('0x25')](function(_0x2a45d1){if(_0x2a45d1){_0x1a3b22[_0x615c('0x62')][_0x615c('0x6b')]=_0x2a45d1['id'];return db['CannedAnswer'][_0x615c('0x61')](_0x1a3b22[_0x615c('0x62')]);}})[_0x615c('0x25')](respondWithResult(_0x2bb4f1,null))['catch'](handleError(_0x2bb4f1,null));};exports[_0x615c('0x72')]=function(_0xb604df,_0x51ba3a,_0x5e6997){var _0x159c39={'raw':![],'where':{}};var _0x54bdb1={};var _0x5b97f8={'count':0x0,'rows':[]};return db[_0x615c('0x42')][_0x615c('0x73')]({'where':{'id':_0xb604df[_0x615c('0x5d')]['id']}})[_0x615c('0x25')](handleEntityNotFound(_0x51ba3a,null))['then'](function(_0x5ea448){if(_0x5ea448){_0x54bdb1['model']=_['keys'](db[_0x615c('0x74')][_0x615c('0x43')]);_0x54bdb1['query']=_[_0x615c('0x48')](_0xb604df['query']);_0x54bdb1[_0x615c('0x49')]=_[_0x615c('0x4d')](_0x54bdb1[_0x615c('0x4a')],_0x54bdb1[_0x615c('0x4b')]);_0x159c39[_0x615c('0x4c')]=_[_0x615c('0x4d')](_0x54bdb1[_0x615c('0x4a')],qs[_0x615c('0x4e')](_0xb604df[_0x615c('0x4b')][_0x615c('0x4e')]));_0x159c39['attributes']=_0x159c39[_0x615c('0x4c')][_0x615c('0x4f')]?_0x159c39['attributes']:_0x54bdb1['model'];if(!_0xb604df[_0x615c('0x4b')]['hasOwnProperty'](_0x615c('0x51'))){_0x159c39[_0x615c('0x35')]=qs[_0x615c('0x35')](_0xb604df[_0x615c('0x4b')][_0x615c('0x35')]);_0x159c39[_0x615c('0x34')]=qs[_0x615c('0x34')](_0xb604df[_0x615c('0x4b')]['offset']);}_0x159c39[_0x615c('0x52')]=qs['sort'](_0xb604df[_0x615c('0x4b')]['sort']);_0x159c39[_0x615c('0x54')]=qs[_0x615c('0x49')](_[_0x615c('0x6e')](_0xb604df[_0x615c('0x4b')],_0x54bdb1[_0x615c('0x49')]));_0x159c39[_0x615c('0x54')][_0x615c('0x6b')]=_0x5ea448['id'];if(_0xb604df[_0x615c('0x4b')]['filter']){_0x159c39[_0x615c('0x54')]=_['merge'](_0x159c39[_0x615c('0x54')],{'$or':_[_0x615c('0x41')](_0x159c39['attributes'],function(_0x3ca90e){var _0x112078={};_0x112078[_0x3ca90e]={'$like':'%'+_0xb604df[_0x615c('0x4b')][_0x615c('0x55')]+'%'};return _0x112078;})});}_0x159c39=_[_0x615c('0x56')]({},_0x159c39,_0xb604df['options']);return db['CannedAnswer'][_0x615c('0x59')]({'where':_0x159c39[_0x615c('0x54')]})[_0x615c('0x25')](function(_0x21801a){_0x5b97f8[_0x615c('0x59')]=_0x21801a;if(_0xb604df['query'][_0x615c('0x5f')]){_0x159c39[_0x615c('0x5a')]=[{'all':!![]}];}return db[_0x615c('0x74')][_0x615c('0x5b')](_0x159c39);})['then'](function(_0x55d8db){_0x5b97f8[_0x615c('0x5c')]=_0x55d8db;return _0x5b97f8;});}})[_0x615c('0x25')](respondWithFilteredResult(_0x51ba3a,_0x159c39))[_0x615c('0x2f')](handleError(_0x51ba3a,null));};exports[_0x615c('0x75')]=function(_0x5e16cf,_0x26233a,_0x58aba2){return db[_0x615c('0x42')][_0x615c('0x60')]({'where':{'id':_0x5e16cf[_0x615c('0x5d')]['id']}})[_0x615c('0x25')](handleEntityNotFound(_0x26233a,null))[_0x615c('0x25')](function(_0x1ad241){if(_0x1ad241){return _0x1ad241[_0x615c('0x75')](_0x5e16cf[_0x615c('0x4b')][_0x615c('0x70')]);}})[_0x615c('0x25')](respondWithStatusCode(_0x26233a,null))[_0x615c('0x2f')](handleError(_0x26233a,null));};exports['addInteraction']=function(_0x2ecf99,_0x3f0219,_0x50e02e){return db[_0x615c('0x76')][_0x615c('0x60')]({'where':{'id':_0x2ecf99[_0x615c('0x5d')]['id']}})[_0x615c('0x25')](handleEntityNotFound(_0x3f0219,null))['then'](function(_0x5a669a){if(_0x5a669a){return _0x5a669a[_0x615c('0x77')](_0x2ecf99[_0x615c('0x62')][_0x615c('0x70')],_[_0x615c('0x78')](_0x2ecf99[_0x615c('0x62')],[_0x615c('0x70'),'id'])||{});}})[_0x615c('0x25')](respondWithResult(_0x3f0219,null))[_0x615c('0x2f')](handleError(_0x3f0219,null));};exports[_0x615c('0x79')]=function(_0x1de49b,_0x48a6e8,_0x5ee811){var _0x1fd8cd={'raw':![],'where':{}};var _0x4e3040={};var _0x2fd846={'count':0x0,'rows':[]};return db['FaxAccount'][_0x615c('0x73')]({'where':{'id':_0x1de49b['params']['id']}})[_0x615c('0x25')](handleEntityNotFound(_0x48a6e8,null))['then'](function(_0x14c5be){if(_0x14c5be){_0x4e3040['model']=_[_0x615c('0x48')](db[_0x615c('0x76')][_0x615c('0x43')]);_0x4e3040[_0x615c('0x4b')]=_[_0x615c('0x48')](_0x1de49b[_0x615c('0x4b')]);_0x4e3040['filters']=_[_0x615c('0x4d')](_0x4e3040[_0x615c('0x4a')],_0x4e3040['query']);_0x1fd8cd[_0x615c('0x4c')]=_[_0x615c('0x4d')](_0x4e3040[_0x615c('0x4a')],qs[_0x615c('0x4e')](_0x1de49b[_0x615c('0x4b')][_0x615c('0x4e')]));_0x1fd8cd['attributes']=_0x1fd8cd[_0x615c('0x4c')][_0x615c('0x4f')]?_0x1fd8cd[_0x615c('0x4c')]:_0x4e3040[_0x615c('0x4a')];if(!_0x1de49b[_0x615c('0x4b')]['hasOwnProperty'](_0x615c('0x51'))){_0x1fd8cd[_0x615c('0x35')]=qs['limit'](_0x1de49b[_0x615c('0x4b')][_0x615c('0x35')]);_0x1fd8cd[_0x615c('0x34')]=qs[_0x615c('0x34')](_0x1de49b[_0x615c('0x4b')]['offset']);}_0x1fd8cd['order']=qs[_0x615c('0x53')](_0x1de49b[_0x615c('0x4b')][_0x615c('0x53')]);_0x1fd8cd[_0x615c('0x54')]=qs['filters'](_['pick'](_0x1de49b[_0x615c('0x4b')],_0x4e3040[_0x615c('0x49')]));_0x1fd8cd['where'][_0x615c('0x6b')]=_0x14c5be['id'];if(_0x1de49b['query'][_0x615c('0x55')]){_0x1fd8cd[_0x615c('0x54')]=_[_0x615c('0x56')](_0x1fd8cd[_0x615c('0x54')],{'$or':_[_0x615c('0x41')](_0x1fd8cd[_0x615c('0x4c')],function(_0x11edb0){var _0x3f4209={};_0x3f4209[_0x11edb0]={'$like':'%'+_0x1de49b['query'][_0x615c('0x55')]+'%'};return _0x3f4209;})});}_0x1fd8cd=_[_0x615c('0x56')]({},_0x1fd8cd,_0x1de49b[_0x615c('0x58')]);return db['FaxInteraction'][_0x615c('0x59')]({'where':_0x1fd8cd[_0x615c('0x54')]})[_0x615c('0x25')](function(_0x704f03){_0x2fd846[_0x615c('0x59')]=_0x704f03;if(_0x1de49b[_0x615c('0x4b')][_0x615c('0x5f')]){_0x1fd8cd[_0x615c('0x5a')]=[{'model':db[_0x615c('0x7a')],'as':_0x615c('0x7b'),'required':![]},{'model':db[_0x615c('0x7c')],'as':_0x615c('0x7d'),'attributes':['name',_0x615c('0x7e'),'internal'],'required':![]},{'model':db[_0x615c('0x7f')],'as':_0x615c('0x80'),'attributes':['id',_0x615c('0x47'),_0x615c('0x81')],'where':_0x1de49b[_0x615c('0x4b')]['tag']?{'id':_0x1de49b['query'][_0x615c('0x82')]}:undefined,'required':_0x1de49b[_0x615c('0x4b')]['tag']?!![]:![]}];}return db[_0x615c('0x76')][_0x615c('0x5b')](_0x1fd8cd);})[_0x615c('0x25')](function(_0x2416a9){_0x2fd846[_0x615c('0x5c')]=_0x2416a9;return _0x2fd846;});}})[_0x615c('0x25')](respondWithFilteredResult(_0x48a6e8,_0x1fd8cd))[_0x615c('0x2f')](handleError(_0x48a6e8,null));};exports[_0x615c('0x83')]=function(_0x1a89de,_0x27f896){var _0x2b3120=_0x1a89de[_0x615c('0x5d')]['id'];var _0x138346=_0x1a89de[_0x615c('0x62')];var _0x51ad97=0xc8;var _0x1fa4aa=null;return db[_0x615c('0x84')][_0x615c('0x85')]({'isolationLevel':db['sequelize'][_0x615c('0x86')][_0x615c('0x87')][_0x615c('0x88')]},function(_0x522e41){return db[_0x615c('0x42')][_0x615c('0x73')]({'where':{'id':_0x2b3120},'transaction':_0x522e41})['then'](function(_0x84948){if(_0x84948){return db[_0x615c('0x89')][_0x615c('0x3b')]({'where':{'FaxAccountId':_0x2b3120},'transaction':_0x522e41})[_0x615c('0x25')](function(){var _0x1d33ef=_[_0x615c('0x41')](_0x138346,function(_0x5dc330){_0x5dc330['FaxAccountId']=_0x2b3120;return _0x5dc330;});return db[_0x615c('0x89')]['bulkCreate'](_0x1d33ef,{'transaction':_0x522e41});});}else{_0x51ad97=0x194;_0x1fa4aa=[];}});})[_0x615c('0x25')](function(){if(_0x51ad97!==0x194){return db[_0x615c('0x89')][_0x615c('0x8a')]({'where':{'FaxAccountId':_0x2b3120},'order':_0x615c('0x8b')})[_0x615c('0x25')](function(_0x232832){_0x1fa4aa=_0x232832;});}})[_0x615c('0x2f')](function(_0x34a5b6){_0x51ad97=0x1f4;logger[_0x615c('0x2c')](_0x34a5b6['stack']);if(_0x34a5b6[_0x615c('0x47')]){delete _0x34a5b6[_0x615c('0x47')];}_0x1fa4aa=_0x34a5b6;})[_0x615c('0x8c')](function(){if(_0x1fa4aa===null){_0x27f896['sendStatus'](_0x51ad97);}else{if(_0x51ad97===0x1f4){_0x27f896[_0x615c('0x32')](_0x51ad97)[_0x615c('0x3f')](_0x1fa4aa);}else{_0x27f896[_0x615c('0x32')](_0x51ad97)[_0x615c('0x33')](_0x1fa4aa);}}});};exports['getApplications']=function(_0x3f51ac,_0x3a28c3,_0x13455e){var _0x5232c4={};var _0x1a7797={};var _0x551657;var _0x3503c3;return db['FaxAccount'][_0x615c('0x73')]({'where':{'id':_0x3f51ac[_0x615c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3a28c3,null))['then'](function(_0x20bb7d){if(_0x20bb7d){_0x551657=_0x20bb7d;_0x1a7797[_0x615c('0x4a')]=_[_0x615c('0x48')](db[_0x615c('0x89')][_0x615c('0x43')]);_0x1a7797[_0x615c('0x4b')]=_[_0x615c('0x48')](_0x3f51ac[_0x615c('0x4b')]);_0x1a7797['filters']=_[_0x615c('0x4d')](_0x1a7797[_0x615c('0x4a')],_0x1a7797[_0x615c('0x4b')]);_0x5232c4['attributes']=_[_0x615c('0x4d')](_0x1a7797['model'],qs['fields'](_0x3f51ac[_0x615c('0x4b')][_0x615c('0x4e')]));_0x5232c4['attributes']=_0x5232c4[_0x615c('0x4c')][_0x615c('0x4f')]?_0x5232c4[_0x615c('0x4c')]:_0x1a7797[_0x615c('0x4a')];_0x5232c4[_0x615c('0x52')]=qs['sort'](_0x3f51ac['query']['sort']);_0x5232c4[_0x615c('0x54')]=qs['filters'](_[_0x615c('0x6e')](_0x3f51ac[_0x615c('0x4b')],_0x1a7797['filters']));if(_0x3f51ac[_0x615c('0x4b')][_0x615c('0x55')]){_0x5232c4['where']=_[_0x615c('0x56')](_0x5232c4[_0x615c('0x54')],{'$or':_[_0x615c('0x41')](_0x5232c4['attributes'],function(_0xe4250b){var _0x5b224c={};_0x5b224c[_0xe4250b]={'$like':'%'+_0x3f51ac[_0x615c('0x4b')][_0x615c('0x55')]+'%'};return _0x5b224c;})});}_0x5232c4=_['merge']({},_0x5232c4,_0x3f51ac['options']);return _0x551657['getApplications'](_0x5232c4);}})[_0x615c('0x25')](function(_0x30550f){if(_0x30550f){_0x3503c3=_0x30550f['length'];if(!_0x3f51ac[_0x615c('0x4b')][_0x615c('0x50')](_0x615c('0x51'))){_0x5232c4[_0x615c('0x35')]=qs['limit'](_0x3f51ac[_0x615c('0x4b')][_0x615c('0x35')]);_0x5232c4[_0x615c('0x34')]=qs[_0x615c('0x34')](_0x3f51ac['query'][_0x615c('0x34')]);}return _0x551657['getApplications'](_0x5232c4);}})[_0x615c('0x25')](function(_0x1c0347){if(_0x1c0347){return _0x1c0347?{'count':_0x3503c3,'rows':_0x1c0347}:null;}})[_0x615c('0x25')](respondWithResult(_0x3a28c3,null))['catch'](handleError(_0x3a28c3,null));};function Extension(_0x5f5cbd,_0x5b564b,_0x4ac562,_0x13c429){this['context']=_0x615c('0x8d');this[_0x615c('0x8e')]=_0x5f5cbd[_0x615c('0x8f')];this[_0x615c('0x90')]=_0x13c429;this[_0x615c('0x45')]='system';this[_0x615c('0x91')]=_0x615c('0x92');this['FaxAccountId']=_0x5f5cbd['id'];this['priority']=_0x5b564b;this[_0x615c('0x93')]=_0x4ac562;}function createExtensionsReciveFax(_0x393363){var _0x4f6617=0x1;var _0x1b7594=[];_0x1b7594['push'](new Extension(_0x393363,_0x4f6617,'',_0x615c('0x94')));_0x4f6617+=0x1;_0x1b7594[_0x615c('0x95')](new Extension(_0x393363,_0x4f6617,_0x615c('0x96'),_0x615c('0x97')));_0x4f6617+=0x1;for(var _0x4cba81 in _0x393363){if(_0x393363[_0x615c('0x50')](_0x4cba81)&&(_0x4cba81==='ecm'||_0x4cba81===_0x615c('0x8f')||_0x4cba81===_0x615c('0x98')||_0x4cba81===_0x615c('0x99')||_0x4cba81==='headerinfo'||_0x4cba81===_0x615c('0x9a')||_0x4cba81===_0x615c('0x9b')||_0x4cba81===_0x615c('0x9c')||_0x4cba81===_0x615c('0x9d'))){_0x1b7594[_0x615c('0x95')](new Extension(_0x393363,_0x4f6617,_0x615c('0x9e')+_0x4cba81+')='+_0x393363[_0x4cba81],'Set'));_0x4f6617+=0x1;}}_0x1b7594[_0x615c('0x95')](new Extension(_0x393363,_0x4f6617,'6','Wait'));_0x4f6617+=0x1;_0x1b7594['push'](new Extension(_0x393363,_0x4f6617,_0x615c('0x9f'),_0x615c('0xa0')));_0x4f6617=0x0;return _0x1b7594;}exports[_0x615c('0xa1')]=function(_0x1bc1a5,_0x5a8b58,_0x607bb3){var _0x27dbe4;return db[_0x615c('0x84')][_0x615c('0x85')](function(_0x5780f0){return db['FaxAccount'][_0x615c('0x61')](_0x1bc1a5[_0x615c('0x62')],{'transaction':_0x5780f0})[_0x615c('0x25')](function(_0x173fc2){_0x27dbe4=_0x173fc2[_0x615c('0x3c')]({'plain':!![]});return db[_0x615c('0xa2')][_0x615c('0xa3')](createExtensionsReciveFax(_0x27dbe4),{'transaction':_0x5780f0});});})[_0x615c('0x25')](function(){return _0x27dbe4;})['then'](respondWithResult(_0x5a8b58,null))[_0x615c('0x2f')](handleError(_0x5a8b58,null));};exports[_0x615c('0xa4')]=function(_0x2508bb,_0x450aa7,_0x4cf501){var _0x559dfd;return db['sequelize'][_0x615c('0x85')](function(_0x487af1){return db[_0x615c('0x42')][_0x615c('0x3a')](_0x2508bb['body'],{'where':{'id':_0x2508bb[_0x615c('0x62')]['id']},'transaction':_0x487af1})[_0x615c('0x25')](function(_0x4a6831){return db[_0x615c('0xa2')]['destroy']({'where':{'FaxAccountId':_0x2508bb[_0x615c('0x62')]['id']},'transaction':_0x487af1})[_0x615c('0x25')](function(_0x5c6f7b){return db['VoiceExtension'][_0x615c('0xa3')](createExtensionsReciveFax(_[_0x615c('0x78')](_0x2508bb[_0x615c('0x62')],[_0x615c('0xa5'),'key','createdAt',_0x615c('0xa6'),'TrunkId',_0x615c('0xa7')])),{'transaction':_0x487af1});});});})[_0x615c('0x25')](function(){return db[_0x615c('0x42')][_0x615c('0xa8')](_0x2508bb['body']['id']);})['then'](respondWithResult(_0x450aa7,null))[_0x615c('0x2f')](handleError(_0x450aa7,null));};exports[_0x615c('0xa9')]=function(_0x569a81,_0x41789f,_0x42b565){var _0x6fb62a={'raw':!![],'where':{}};var _0x4e4a09={};var _0x216f90={'count':0x0,'rows':[]};return db[_0x615c('0x42')][_0x615c('0x73')]({'where':{'id':_0x569a81['params']['id']}})[_0x615c('0x25')](handleEntityNotFound(_0x41789f,null))[_0x615c('0x25')](function(_0x57b951){if(_0x57b951){_0x4e4a09[_0x615c('0x4a')]=_[_0x615c('0x48')](db[_0x615c('0xaa')][_0x615c('0x43')]);_0x4e4a09[_0x615c('0x4b')]=_[_0x615c('0x48')](_0x569a81[_0x615c('0x4b')]);_0x4e4a09['filters']=_[_0x615c('0x4d')](_0x4e4a09['model'],_0x4e4a09[_0x615c('0x4b')]);_0x6fb62a[_0x615c('0x4c')]=_[_0x615c('0x4d')](_0x4e4a09[_0x615c('0x4a')],qs[_0x615c('0x4e')](_0x569a81[_0x615c('0x4b')]['fields']));_0x6fb62a[_0x615c('0x4c')]=_0x6fb62a[_0x615c('0x4c')][_0x615c('0x4f')]?_0x6fb62a[_0x615c('0x4c')]:_0x4e4a09[_0x615c('0x4a')];if(!_0x569a81[_0x615c('0x4b')]['hasOwnProperty'](_0x615c('0x51'))){_0x6fb62a[_0x615c('0x35')]=qs[_0x615c('0x35')](_0x569a81[_0x615c('0x4b')]['limit']);_0x6fb62a[_0x615c('0x34')]=qs[_0x615c('0x34')](_0x569a81[_0x615c('0x4b')]['offset']);}_0x6fb62a[_0x615c('0x52')]=qs[_0x615c('0x53')](_0x569a81[_0x615c('0x4b')][_0x615c('0x53')]);_0x6fb62a[_0x615c('0x54')]=qs[_0x615c('0x49')](_[_0x615c('0x6e')](_0x569a81[_0x615c('0x4b')],_0x4e4a09[_0x615c('0x49')]));_0x6fb62a[_0x615c('0x54')]['FaxAccountId']=_0x57b951['id'];if(_0x569a81[_0x615c('0x4b')]['filter']){_0x6fb62a['where']=_['merge'](_0x6fb62a[_0x615c('0x54')],{'$or':_['map'](_0x6fb62a[_0x615c('0x4c')],function(_0x2ac4f1){var _0x30184e={};_0x30184e[_0x2ac4f1]={'$like':'%'+_0x569a81[_0x615c('0x4b')][_0x615c('0x55')]+'%'};return _0x30184e;})});}if(_0x569a81[_0x615c('0x4b')]['$gte']){var _0x2c4e27=_0x569a81[_0x615c('0x4b')][_0x615c('0xab')][_0x615c('0xac')](',');var _0x157c18={};_0x157c18[_0x2c4e27[0x0]]={'$gte':moment(_0x2c4e27[0x1])[_0x615c('0xad')]('YYYY-MM-DD\x20HH:mm:ss')};_0x6fb62a['where']=_[_0x615c('0x56')](_0x6fb62a[_0x615c('0x54')],_0x157c18);}_0x6fb62a=_['merge']({},_0x6fb62a,_0x569a81[_0x615c('0x58')]);return db[_0x615c('0xaa')][_0x615c('0x59')]({'where':_0x6fb62a[_0x615c('0x54')]})[_0x615c('0x25')](function(_0x1ba050){_0x216f90[_0x615c('0x59')]=_0x1ba050;if(_0x569a81['query'][_0x615c('0x5f')]){_0x6fb62a['include']=[{'all':!![]}];}return db[_0x615c('0xaa')][_0x615c('0x5b')](_0x6fb62a);})[_0x615c('0x25')](function(_0x4b25d5){_0x216f90[_0x615c('0x5c')]=_0x4b25d5;return _0x216f90;});}})[_0x615c('0x25')](respondWithFilteredResult(_0x41789f,_0x6fb62a))['catch'](handleError(_0x41789f,null));};exports[_0x615c('0x3f')]=function(_0xd9dd91,_0x2773af,_0x267843){var _0x3902aa,_0x318371={},_0x51351e;if(_0xd9dd91[_0x615c('0x62')]['to']){_0x51351e=_0xd9dd91[_0x615c('0x62')]['to'][0x0];}return db[_0x615c('0x42')]['find']({'where':{'id':_0xd9dd91[_0x615c('0x5d')]['id']},'include':[{'model':db[_0x615c('0xae')],'as':'List','include':[{'model':db['CmContact'],'as':_0x615c('0xaf'),'where':{'fax':_0x51351e},'limit':0x1,'order':[[_0x615c('0xa6'),'DESC']]}]}]})[_0x615c('0x25')](handleEntityNotFound(_0x2773af,null))['then'](function(_0x1c09d1){_0x3902aa=_0x1c09d1;if(_0xd9dd91[_0x615c('0x62')][_0x615c('0xb0')]&&_0xd9dd91['body'][_0x615c('0xb0')][_0x615c('0x4f')]){for(var _0x5b0d1e=0x0;_0x5b0d1e<_0xd9dd91[_0x615c('0x62')][_0x615c('0xb0')][_0x615c('0x4f')];_0x5b0d1e+=0x1){_0xd9dd91[_0x615c('0x62')]['attachments'][_0x5b0d1e]={'filename':_0xd9dd91['body'][_0x615c('0xb0')][_0x5b0d1e][_0x615c('0x47')],'id':_0xd9dd91[_0x615c('0x62')][_0x615c('0xb0')][_0x5b0d1e]['id'],'path':path[_0x615c('0xb1')](config['root'],'server/files/attachments',_0xd9dd91[_0x615c('0x62')][_0x615c('0xb0')][_0x5b0d1e][_0x615c('0xb2')])};}}return respondWithRpcPromise('CheckAfterSend',_0x615c('0xb3'),{'FaxAccountId':_[_0x615c('0xb4')](_0xd9dd91[_0x615c('0x5d')]['id'])?undefined:_0xd9dd91[_0x615c('0x5d')]['id'],'path':_[_0x615c('0xb4')](_0xd9dd91[_0x615c('0x62')][_0x615c('0xb0')][0x0][_0x615c('0x8')])?undefined:_0xd9dd91['body'][_0x615c('0xb0')][0x0]['path'],'fax':_[_0x615c('0xb4')](_0xd9dd91[_0x615c('0x62')]['to'][0x0])?undefined:_0xd9dd91[_0x615c('0x62')]['to'][0x0]},client9002);})['then'](function(){if(_0x3902aa){if(_[_0x615c('0xb4')](_0xd9dd91[_0x615c('0x62')]['from'])){_0xd9dd91['body'][_0x615c('0xb5')]=util[_0x615c('0xad')](_0x615c('0xb6'),_0x3902aa['name'],_0x3902aa[_0x615c('0xb7')]);}if(_0x3902aa[_0x615c('0xb8')]){if(_0x3902aa[_0x615c('0xb8')][_0x615c('0xaf')][_0x615c('0x4f')]){return _0x3902aa[_0x615c('0xb8')]['Contacts'][0x0];}else{return db['CmContact'][_0x615c('0x61')](_['defaults'](_0xd9dd91[_0x615c('0x62')],{'firstName':_0xd9dd91[_0x615c('0x62')]['to'][0x0],'phone':_0xd9dd91[_0x615c('0x62')]['to'][0x0],'fax':_0xd9dd91['body']['to'][0x0],'ListId':_0x3902aa['ListId']}));}}else{throw new Error(_0x615c('0xb9'));}}else{throw new Error(_0x615c('0xba'));}})[_0x615c('0x25')](function(_0x408f64){if(_0x408f64){return db[_0x615c('0x76')][_0x615c('0x60')]({'where':{'ContactId':_0x408f64['id'],'closed':![],'FaxAccountId':_0x3902aa['id']}})[_0x615c('0x25')](function(_0x5dbbeb){if(_0x5dbbeb){return[_0x5dbbeb,![]];}return db['FaxInteraction'][_0x615c('0x61')]({'UserId':_0xd9dd91['user']['id'],'ContactId':_0x408f64['id'],'FaxAccountId':_0x3902aa['id'],'fax':_0xd9dd91[_0x615c('0x62')]['to'][0x0],'firstMsgDirection':_0x615c('0xbb'),'Messages':[_['merge'](_0xd9dd91['body'],{'read':![],'body':_0xd9dd91[_0x615c('0x62')][_0x615c('0xb0')][0x0][_0x615c('0xbc')],'FaxAccountId':_0x3902aa['id'],'UserId':_0xd9dd91[_0x615c('0x65')]['id'],'ContactId':_0x408f64['id'],'AttachmentId':_0xd9dd91[_0x615c('0x62')][_0x615c('0xb0')][0x0]['id']})]},{'include':[{'model':db[_0x615c('0xaa')],'as':_0x615c('0xbd')}]})[_0x615c('0x25')](function(_0x14c8e8){return[_0x14c8e8,!![]];});});}else{throw new Error(_0x615c('0xbe'));}})['spread'](function(_0x226953,_0x3d525d){if(_0x3d525d){return _0x226953;}return db[_0x615c('0xaa')][_0x615c('0x61')]({'direction':_0x615c('0xbb'),'read':![],'body':_0xd9dd91[_0x615c('0x62')]['attachments'][0x0]['filename'],'FaxAccountId':_0x3902aa['id'],'FaxInteractionId':_0x226953['id'],'UserId':_0xd9dd91['user']['id'],'ContactId':_0x226953[_0x615c('0xbf')],'AttachmentId':_0xd9dd91[_0x615c('0x62')]['attachments'][0x0]['id']})[_0x615c('0x25')](function(_0x250a63){_0x226953[_0x615c('0xc0')][_0x615c('0xbd')]=[];_0x226953[_0x615c('0xc0')][_0x615c('0xbd')][_0x615c('0x95')](_0x250a63[_0x615c('0xc0')]);return _0x226953;});})['then'](function(_0x39ef64){respondWithRpcPromise(_0x615c('0xc1'),'SendFax',{'FaxAccountId':_[_0x615c('0xb4')](_0xd9dd91[_0x615c('0x5d')]['id'])?undefined:_0xd9dd91[_0x615c('0x5d')]['id'],'path':_[_0x615c('0xb4')](_0xd9dd91['body'][_0x615c('0xb0')][0x0][_0x615c('0x8')])?undefined:_0xd9dd91[_0x615c('0x62')][_0x615c('0xb0')][0x0][_0x615c('0x8')],'fax':_['isNil'](_0xd9dd91[_0x615c('0x62')]['to'][0x0])?undefined:_0xd9dd91[_0x615c('0x62')]['to'][0x0],'AttachmentId':_0xd9dd91['body'][_0x615c('0xb0')][0x0]['id']},client9002)[_0x615c('0x25')](function(_0x2b8205){logger[_0x615c('0x26')](_0x615c('0xc2'),_0x2b8205);})[_0x615c('0x2f')](function(_0x2b6af9){logger[_0x615c('0x26')]('SendFaxRpc,\x20%s',_0x2b6af9);});return _0x39ef64;})[_0x615c('0x25')](respondWithResult(_0x2773af,null))[_0x615c('0x2f')](handleError(_0x2773af,null));};exports[_0x615c('0xc3')]=function(_0x5eed38,_0x5d188e,_0x31b009){return db['FaxAccount']['find']({'where':{'id':_0x5eed38['params']['id']}})['then'](handleEntityNotFound(_0x5d188e,null))[_0x615c('0x25')](function(_0x46d5d4){if(_0x46d5d4){return _0x46d5d4[_0x615c('0xc3')](_0x5eed38['body'][_0x615c('0x70')],_[_0x615c('0x78')](_0x5eed38[_0x615c('0x62')],[_0x615c('0x70'),'id'])||{})[_0x615c('0xc4')](function(_0x3c82bc){for(var _0x48240a=0x0;_0x48240a<_0x5eed38[_0x615c('0x62')][_0x615c('0x70')][_0x615c('0x4f')];_0x48240a+=0x1){socket['emit'](_0x615c('0xc5'),{'UserId':Number(_0x5eed38[_0x615c('0x62')][_0x615c('0x70')][_0x48240a]),'FaxAccountId':Number(_0x5eed38['params']['id'])});}return _0x3c82bc;});}})[_0x615c('0x25')](respondWithResult(_0x5d188e,null))[_0x615c('0x2f')](handleError(_0x5d188e,null));};exports[_0x615c('0xc6')]=function(_0x100109,_0x1c3554,_0x1da735){return db[_0x615c('0x42')][_0x615c('0x60')]({'where':{'id':_0x100109['params']['id']}})[_0x615c('0x25')](handleEntityNotFound(_0x1c3554,null))[_0x615c('0x25')](function(_0x5927a8){if(_0x5927a8){return _0x5927a8[_0x615c('0xc6')](_0x100109[_0x615c('0x4b')][_0x615c('0x70')])[_0x615c('0x25')](function(){if(_[_0x615c('0xc7')](_0x100109[_0x615c('0x4b')]['ids'])){for(var _0x53f875=0x0;_0x53f875<_0x100109['query'][_0x615c('0x70')][_0x615c('0x4f')];_0x53f875+=0x1){socket[_0x615c('0xc8')](_0x615c('0xc9'),{'UserId':Number(_0x100109[_0x615c('0x4b')][_0x615c('0x70')][_0x53f875]),'FaxAccountId':Number(_0x100109[_0x615c('0x5d')]['id'])});}}else{socket['emit'](_0x615c('0xc9'),{'UserId':Number(_0x100109[_0x615c('0x4b')][_0x615c('0x70')]),'FaxAccountId':Number(_0x100109['params']['id'])});}});}})[_0x615c('0x25')](respondWithStatusCode(_0x1c3554,null))[_0x615c('0x2f')](handleError(_0x1c3554,null));};exports['getAgents']=function(_0x182b36,_0xc5337,_0x3587e7){var _0x615d={};var _0x465f8a={};var _0x2936c8;var _0x38343c;return db[_0x615c('0x42')]['findOne']({'where':{'id':_0x182b36[_0x615c('0x5d')]['id']}})['then'](handleEntityNotFound(_0xc5337,null))['then'](function(_0x14893b){if(_0x14893b){_0x2936c8=_0x14893b;_0x465f8a[_0x615c('0x4a')]=_[_0x615c('0x48')](db[_0x615c('0x7c')]['rawAttributes']);_0x465f8a[_0x615c('0x4b')]=_[_0x615c('0x48')](_0x182b36[_0x615c('0x4b')]);_0x465f8a[_0x615c('0x49')]=_[_0x615c('0x4d')](_0x465f8a[_0x615c('0x4a')],_0x465f8a['query']);_0x615d[_0x615c('0x4c')]=_['intersection'](_0x465f8a[_0x615c('0x4a')],qs['fields'](_0x182b36[_0x615c('0x4b')][_0x615c('0x4e')]));_0x615d[_0x615c('0x4c')]=_0x615d[_0x615c('0x4c')][_0x615c('0x4f')]?_0x615d[_0x615c('0x4c')]:_0x465f8a[_0x615c('0x4a')];_0x615d[_0x615c('0x52')]=qs[_0x615c('0x53')](_0x182b36[_0x615c('0x4b')][_0x615c('0x53')]);_0x615d[_0x615c('0x54')]=qs[_0x615c('0x49')](_[_0x615c('0x6e')](_0x182b36[_0x615c('0x4b')],_0x465f8a[_0x615c('0x49')]));if(_0x182b36[_0x615c('0x4b')]['filter']){_0x615d[_0x615c('0x54')]=_[_0x615c('0x56')](_0x615d['where'],{'$or':_[_0x615c('0x41')](_0x615d['attributes'],function(_0x38df99){var _0x28e3c9={};_0x28e3c9[_0x38df99]={'$like':'%'+_0x182b36[_0x615c('0x4b')][_0x615c('0x55')]+'%'};return _0x28e3c9;})});}_0x615d=_['merge']({},_0x615d,_0x182b36['options']);return _0x2936c8[_0x615c('0xca')](_0x615d);}})['then'](function(_0x2c79cb){if(_0x2c79cb){_0x38343c=_0x2c79cb['length'];if(!_0x182b36[_0x615c('0x4b')]['hasOwnProperty'](_0x615c('0x51'))){_0x615d[_0x615c('0x35')]=qs[_0x615c('0x35')](_0x182b36[_0x615c('0x4b')][_0x615c('0x35')]);_0x615d[_0x615c('0x34')]=qs[_0x615c('0x34')](_0x182b36[_0x615c('0x4b')][_0x615c('0x34')]);}return _0x2936c8[_0x615c('0xca')](_0x615d);}})[_0x615c('0x25')](function(_0x1ef89e){if(_0x1ef89e){return _0x1ef89e?{'count':_0x38343c,'rows':_0x1ef89e}:null;}})[_0x615c('0x25')](respondWithResult(_0xc5337,null))[_0x615c('0x2f')](handleError(_0xc5337,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 1a7a0bd..3cc606e 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 _0xf30d=['../../mysqldb','FaxAccount','setMaxListeners','save','remove','hasOwnProperty','hook','exports'];(function(_0x33c154,_0x434888){var _0x55730a=function(_0x48364b){while(--_0x48364b){_0x33c154['push'](_0x33c154['shift']());}};_0x55730a(++_0x434888);}(_0xf30d,0xd0));var _0xdf30=function(_0x321b9a,_0x3e2db7){_0x321b9a=_0x321b9a-0x0;var _0x125dd5=_0xf30d[_0x321b9a];return _0x125dd5;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xdf30('0x0'))['db'][_0xdf30('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xdf30('0x2')](0x0);var events={'afterCreate':_0xdf30('0x3'),'afterUpdate':'update','afterDestroy':_0xdf30('0x4')};function emitEvent(_0x327822){return function(_0x26f69b,_0x5be838,_0x5388fd){FaxAccountEvents['emit'](_0x327822+':'+_0x26f69b['id'],_0x26f69b);FaxAccountEvents['emit'](_0x327822,_0x26f69b);_0x5388fd(null);};}for(var e in events){if(events[_0xdf30('0x5')](e)){var event=events[e];FaxAccount[_0xdf30('0x6')](e,emitEvent(event));}}module[_0xdf30('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x4ef9=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','save','update','remove'];(function(_0x44cfdd,_0xe5d8da){var _0x737be7=function(_0x41ce1c){while(--_0x41ce1c){_0x44cfdd['push'](_0x44cfdd['shift']());}};_0x737be7(++_0xe5d8da);}(_0x4ef9,0x144));var _0x94ef=function(_0x280820,_0xce9bc7){_0x280820=_0x280820-0x0;var _0x474787=_0x4ef9[_0x280820];return _0x474787;};'use strict';var EventEmitter=require(_0x94ef('0x0'));var FaxAccount=require(_0x94ef('0x1'))['db'][_0x94ef('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x94ef('0x3'),'afterUpdate':_0x94ef('0x4'),'afterDestroy':_0x94ef('0x5')};function emitEvent(_0x53eae1){return function(_0x1a8030,_0x2cb58e,_0x4b2398){FaxAccountEvents[_0x94ef('0x6')](_0x53eae1+':'+_0x1a8030['id'],_0x1a8030);FaxAccountEvents[_0x94ef('0x6')](_0x53eae1,_0x1a8030);_0x4b2398(null);};}for(var e in events){if(events[_0x94ef('0x7')](e)){var event=events[e];FaxAccount[_0x94ef('0x8')](e,emitEvent(event));}}module[_0x94ef('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 61bbdc1..bc20f80 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 _0x96a9=['bluebird','request-promise','path','../../config/environment','./faxAccount.attributes','exports','lodash','util','../../config/logger','moment'];(function(_0x3a8703,_0x32d45c){var _0x40a835=function(_0x58ec73){while(--_0x58ec73){_0x3a8703['push'](_0x3a8703['shift']());}};_0x40a835(++_0x32d45c);}(_0x96a9,0x128));var _0x996a=function(_0x153957,_0x3dac3a){_0x153957=_0x153957-0x0;var _0x2fae35=_0x96a9[_0x153957];return _0x2fae35;};'use strict';var _=require(_0x996a('0x0'));var util=require(_0x996a('0x1'));var logger=require(_0x996a('0x2'))('api');var moment=require(_0x996a('0x3'));var BPromise=require(_0x996a('0x4'));var rp=require(_0x996a('0x5'));var fs=require('fs');var path=require(_0x996a('0x6'));var rimraf=require('rimraf');var config=require(_0x996a('0x7'));var attributes=require(_0x996a('0x8'));module[_0x996a('0x9')]=function(_0x36171a,_0x22187a){return _0x36171a['define']('FaxAccount',attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6174=['bluebird','path','../../config/environment','./faxAccount.attributes','FaxAccount','lodash','../../config/logger','api','moment'];(function(_0x129479,_0x256c7e){var _0x3fa0ce=function(_0x35401f){while(--_0x35401f){_0x129479['push'](_0x129479['shift']());}};_0x3fa0ce(++_0x256c7e);}(_0x6174,0xdd));var _0x4617=function(_0x547cae,_0x565c50){_0x547cae=_0x547cae-0x0;var _0x1e8607=_0x6174[_0x547cae];return _0x1e8607;};'use strict';var _=require(_0x4617('0x0'));var util=require('util');var logger=require(_0x4617('0x1'))(_0x4617('0x2'));var moment=require(_0x4617('0x3'));var BPromise=require(_0x4617('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4617('0x5'));var rimraf=require('rimraf');var config=require(_0x4617('0x6'));var attributes=require(_0x4617('0x7'));module['exports']=function(_0x11d6f0,_0x227e34){return _0x11d6f0['define'](_0x4617('0x8'),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 ef2c410..ada5ef4 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 _0x6ddf=['map','model','attributes','then','debug','stringify','NotifyFaxAccount','body','fax','describe','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','Sequelize','ValidationError','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','FaxAccount','find','account','CmList','List','CmContact','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','asc','Contacts','length','create','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','GetFaxAccount','options','include'];(function(_0xadc014,_0x47f129){var _0x29564c=function(_0x3b904d){while(--_0x3b904d){_0xadc014['push'](_0xadc014['shift']());}};_0x29564c(++_0x47f129);}(_0x6ddf,0xef));var _0xf6dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ddf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf6dd('0x0'));var util=require(_0xf6dd('0x1'));var moment=require(_0xf6dd('0x2'));var BPromise=require('bluebird');var rs=require(_0xf6dd('0x3'));var fs=require('fs');var Redis=require(_0xf6dd('0x4'));var db=require(_0xf6dd('0x5'))['db'];var utils=require(_0xf6dd('0x6'));var logger=require(_0xf6dd('0x7'))(_0xf6dd('0x8'));var config=require('../../config/environment');var jayson=require(_0xf6dd('0x9'));var client=jayson[_0xf6dd('0xa')][_0xf6dd('0xb')]({'port':0x232c});config[_0xf6dd('0xc')]=_[_0xf6dd('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf6dd('0xe'))(new Redis(config[_0xf6dd('0xc')]));require('./faxAccount.socket')[_0xf6dd('0xf')](socket);function respondWithRpcPromise(_0x25539e,_0x133123,_0x2dfda3){return new BPromise(function(_0x5eac2f,_0x524f84){return client[_0xf6dd('0x10')](_0x25539e,_0x2dfda3)['then'](function(_0x4c8f42){logger['info'](_0xf6dd('0x11'),_0x133123,_0xf6dd('0x12'));logger['debug'](_0xf6dd('0x13'),_0x133123,_0xf6dd('0x12'),JSON['stringify'](_0x4c8f42));if(_0x4c8f42[_0xf6dd('0x14')]){if(_0x4c8f42[_0xf6dd('0x14')][_0xf6dd('0x15')]===0x1f4){logger[_0xf6dd('0x14')](_0xf6dd('0x11'),_0x133123,_0x4c8f42[_0xf6dd('0x14')][_0xf6dd('0x16')]);return _0x524f84(_0x4c8f42[_0xf6dd('0x14')]['message']);}logger[_0xf6dd('0x14')]('FaxAccount,\x20%s,\x20%s',_0x133123,_0x4c8f42[_0xf6dd('0x14')][_0xf6dd('0x16')]);return _0x5eac2f(_0x4c8f42[_0xf6dd('0x14')][_0xf6dd('0x16')]);}else{logger[_0xf6dd('0x17')](_0xf6dd('0x11'),_0x133123,_0xf6dd('0x12'));_0x5eac2f(_0x4c8f42['result'][_0xf6dd('0x16')]);}})[_0xf6dd('0x18')](function(_0x1bed1e){logger[_0xf6dd('0x14')](_0xf6dd('0x11'),_0x133123,_0x1bed1e);_0x524f84(_0x1bed1e);});});}exports[_0xf6dd('0x19')]=function(_0xda0b14){var _0x2b8df9=this;return new Promise(function(_0x5b5db1,_0xab36c8){return db['FaxAccount']['findAll']({'raw':_0xda0b14['options']?_0xda0b14[_0xf6dd('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xda0b14[_0xf6dd('0x1a')]?_0xda0b14[_0xf6dd('0x1a')]['where']||null:null,'attributes':_0xda0b14[_0xf6dd('0x1a')]?_0xda0b14[_0xf6dd('0x1a')]['attributes']||null:null,'limit':_0xda0b14[_0xf6dd('0x1a')]?_0xda0b14['options']['limit']||null:null,'include':_0xda0b14[_0xf6dd('0x1a')]?_0xda0b14[_0xf6dd('0x1a')][_0xf6dd('0x1b')]?_[_0xf6dd('0x1c')](_0xda0b14[_0xf6dd('0x1a')][_0xf6dd('0x1b')],function(_0x55856e){return{'model':db[_0x55856e[_0xf6dd('0x1d')]],'as':_0x55856e['as'],'attributes':_0x55856e[_0xf6dd('0x1e')],'include':_0x55856e[_0xf6dd('0x1b')]?_[_0xf6dd('0x1c')](_0x55856e[_0xf6dd('0x1b')],function(_0x2607d8){return{'model':db[_0x2607d8[_0xf6dd('0x1d')]],'as':_0x2607d8['as'],'attributes':_0x2607d8['attributes'],'include':_0x2607d8[_0xf6dd('0x1b')]?_[_0xf6dd('0x1c')](_0x2607d8[_0xf6dd('0x1b')],function(_0x33fa23){return{'model':db[_0x33fa23[_0xf6dd('0x1d')]],'as':_0x33fa23['as'],'attributes':_0x33fa23[_0xf6dd('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf6dd('0x1f')](function(_0x2fb53d){logger[_0xf6dd('0x17')](_0xf6dd('0x19'),_0xda0b14);logger[_0xf6dd('0x20')](_0xf6dd('0x19'),_0xda0b14,JSON[_0xf6dd('0x21')](_0x2fb53d));_0x5b5db1(_0x2fb53d);})[_0xf6dd('0x18')](function(_0x397e4d){logger[_0xf6dd('0x14')](_0xf6dd('0x19'),_0x397e4d[_0xf6dd('0x16')],_0xda0b14);_0xab36c8(_0x2b8df9[_0xf6dd('0x14')](0x1f4,_0x397e4d[_0xf6dd('0x16')]));});});};exports[_0xf6dd('0x22')]=function(_0x24125c,_0x257875,_0x491a0b){var _0x4194be=this;return new Promise(function(_0x31e749,_0x422fb1){var _0x13f609={'body':_0x24125c[_0xf6dd('0x23')],'channel':_0xf6dd('0x24')};var _0x23935a=[];var _0x1d75b1=[];var _0x547fb3={};return db['CmContact'][_0xf6dd('0x25')]()[_0xf6dd('0x1f')](function(_0x47aa8f){if(!_0x47aa8f){throw new db['Sequelize']['ValidationError'](_0xf6dd('0x26'));}_0x23935a=_[_0xf6dd('0x27')](_[_0xf6dd('0x28')](_0x47aa8f),[_0xf6dd('0x29'),_0xf6dd('0x2a')]);_0x1d75b1=_[_0xf6dd('0x27')](_[_0xf6dd('0x28')](_0x47aa8f),[_0xf6dd('0x29'),'updatedAt',_0xf6dd('0x2b'),_0xf6dd('0x2c')]);if(_0x24125c[_0xf6dd('0x23')]['id']){delete _0x24125c[_0xf6dd('0x23')]['id'];}if(_['isNil'](_0x24125c[_0xf6dd('0x23')]['from'])){throw new db[(_0xf6dd('0x2d'))][(_0xf6dd('0x2e'))](_0xf6dd('0x2f'));}if(_[_0xf6dd('0x30')](_0x24125c[_0xf6dd('0x23')][_0xf6dd('0x23')])||_0x24125c['body'][_0xf6dd('0x23')]===''){throw new db[(_0xf6dd('0x2d'))][(_0xf6dd('0x2e'))](_0xf6dd('0x31'));}if(_[_0xf6dd('0x30')](_0x24125c['body'][_0xf6dd('0x32')])){throw new db[(_0xf6dd('0x2d'))][(_0xf6dd('0x2e'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1d75b1);}if(!_['includes'](_0x1d75b1,_0x24125c['body'][_0xf6dd('0x32')])){throw new db[(_0xf6dd('0x2d'))][(_0xf6dd('0x2e'))](_0xf6dd('0x33')+_0x1d75b1);}_0x547fb3[_0x24125c[_0xf6dd('0x23')][_0xf6dd('0x32')]]=_0x24125c[_0xf6dd('0x23')][_0xf6dd('0x34')];})[_0xf6dd('0x1f')](function(){return db[_0xf6dd('0x35')][_0xf6dd('0x36')]({'where':{'id':_0x24125c[_0xf6dd('0x37')]['id']},'include':[{'model':db[_0xf6dd('0x38')],'as':_0xf6dd('0x39'),'include':[{'model':db[_0xf6dd('0x3a')],'as':'Contacts','where':_0x547fb3,'limit':0x1,'order':[[_0xf6dd('0x2a'),_0xf6dd('0x3b')]]}]},{'model':db[_0xf6dd('0x3c')],'as':_0xf6dd('0x3d')}]});})['then'](function(_0x11b7dc){if(_0x11b7dc&&_0x11b7dc[_0xf6dd('0x39')]){var _0x3b70f8=_0x11b7dc[_0xf6dd('0x3e')]({'plain':!![]});_0x13f609['account']=_0x3b70f8;_0x13f609[_0xf6dd('0x3f')]=_0x3b70f8[_0xf6dd('0x3d')];_0x13f609[_0xf6dd('0x40')]=_0x3b70f8[_0xf6dd('0x39')];_0x13f609[_0xf6dd('0x3f')]=_[_0xf6dd('0x41')](_0x13f609[_0xf6dd('0x3f')],[_0xf6dd('0x42')],[_0xf6dd('0x43')]);if(_0x13f609[_0xf6dd('0x37')][_0xf6dd('0x3d')]){delete _0x13f609[_0xf6dd('0x37')][_0xf6dd('0x3d')];}if(_0x13f609[_0xf6dd('0x37')][_0xf6dd('0x39')]&&_0x13f609['account'][_0xf6dd('0x39')][_0xf6dd('0x44')][_0xf6dd('0x45')]){return _0x13f609['account'][_0xf6dd('0x39')][_0xf6dd('0x44')][0x0];}var _0x6f6f52=_[_0xf6dd('0xd')](_0x24125c['body'],{'firstName':_0x24125c['body'][_0xf6dd('0x34')],'ListId':_0x3b70f8[_0xf6dd('0x2c')]});_0x6f6f52[_0x24125c[_0xf6dd('0x23')][_0xf6dd('0x32')]]=_0x24125c['body'][_0xf6dd('0x34')];return db[_0xf6dd('0x3a')][_0xf6dd('0x46')](_0x6f6f52,{'fields':_0x23935a,'raw':!![]});}})['then'](function(_0x390885){_0x13f609['contact']=_0x390885;if(_0x390885){var _0xe5c54a={'ContactId':_0x390885['id'],'FaxAccountId':_0x24125c[_0xf6dd('0x37')]['id'],'fax':_0x390885[_0xf6dd('0x24')]};return db['FaxInteraction'][_0xf6dd('0x36')]({'where':{'ContactId':_0x390885['id'],'closed':![],'FaxAccountId':_0x24125c[_0xf6dd('0x37')]['id']}})['then'](function(_0x460d81){if(_0x460d81){return[_0x460d81,![]];}return db[_0xf6dd('0x47')][_0xf6dd('0x46')](_0xe5c54a)[_0xf6dd('0x1f')](function(_0x278fc6){return[_0x278fc6,!![]];});});}else{throw new Error(_0xf6dd('0x48'));}})[_0xf6dd('0x49')](function(_0x5323dc,_0x4ee5e7){var _0x3d3f0b=_0x5323dc['get']({'plain':!![]});if(_0x4ee5e7){if(_0x13f609[_0xf6dd('0x37')][_0xf6dd('0x4a')]){_0x13f609[_0xf6dd('0x3f')][_0xf6dd('0x4b')]({'id':0x0,'priority':_0x13f609['applications']['length']+0x1,'app':_0xf6dd('0x4c'),'appdata':_0xf6dd('0x4d'),'interval':_0xf6dd('0x4e')});}_0x3d3f0b[_0xf6dd('0x4f')]=!![];}else{_0x3d3f0b['created']=![];}_0x13f609[_0xf6dd('0x50')]=_0x3d3f0b;return db[_0xf6dd('0x51')][_0xf6dd('0x46')]({'body':_0x24125c['body'][_0xf6dd('0x23')],'FaxAccountId':_0x24125c[_0xf6dd('0x37')]['id'],'FaxInteractionId':_0x5323dc['id'],'direction':'in','ContactId':_0x5323dc[_0xf6dd('0x52')],'AttachmentId':_0x24125c[_0xf6dd('0x23')]['AttachmentId']});})[_0xf6dd('0x1f')](function(_0x48633f){_0x13f609['message']=_0x48633f;if(_0x13f609[_0xf6dd('0x50')][_0xf6dd('0x53')]){return db[_0xf6dd('0x54')][_0xf6dd('0x36')]({'attributes':['id','name'],'where':{'id':_0x13f609['interaction'][_0xf6dd('0x53')]}})[_0xf6dd('0x1f')](function(_0x49f89b){if(_0x49f89b){_0x13f609[_0xf6dd('0x3f')][_0xf6dd('0x55')]({'id':0x0,'priority':0x0,'app':_0xf6dd('0x56'),'appdata':_0x49f89b['name']+','+(_0x13f609['account'][_0xf6dd('0x57')]||0xa),'interval':_0xf6dd('0x4e')});}return respondWithRpcPromise(_0xf6dd('0x58'),'startRouting',_0x13f609);});}return respondWithRpcPromise('Start','startRouting',_0x13f609);})[_0xf6dd('0x1f')](function(_0x557181){_0x31e749(_0x557181);})[_0xf6dd('0x18')](function(_0x1eb3d2){_0x422fb1(_0x4194be[_0xf6dd('0x14')](0x1f4,_0x1eb3d2[_0xf6dd('0x16')]));});});}; \ No newline at end of file +var _0xd839=['from','Sequelize','from\x20is\x20mandatory','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','List','Contacts','DESC','get','account','Applications','list','orderBy','priority','asc','length','ListId','create','contact','FaxInteraction','Contact\x20not\x20found','applications','close','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','limit','include','model','map','stringify','NotifyFaxAccount','body','fax','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','createdAt','keys','updatedAt','CompanyId','isNil'];(function(_0x487ab4,_0x1e24e8){var _0x3bef77=function(_0x5ce664){while(--_0x5ce664){_0x487ab4['push'](_0x487ab4['shift']());}};_0x3bef77(++_0x1e24e8);}(_0xd839,0x18f));var _0x9d83=function(_0x4c3359,_0x170c4b){_0x4c3359=_0x4c3359-0x0;var _0x255f0e=_0xd839[_0x4c3359];return _0x255f0e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9d83('0x0'));var BPromise=require(_0x9d83('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d83('0x2'));var db=require(_0x9d83('0x3'))['db'];var utils=require(_0x9d83('0x4'));var logger=require(_0x9d83('0x5'))(_0x9d83('0x6'));var config=require(_0x9d83('0x7'));var jayson=require(_0x9d83('0x8'));var client=jayson[_0x9d83('0x9')][_0x9d83('0xa')]({'port':0x232c});config[_0x9d83('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9d83('0xc'))(new Redis(config[_0x9d83('0xb')]));require(_0x9d83('0xd'))[_0x9d83('0xe')](socket);function respondWithRpcPromise(_0x51aebc,_0x1a2fbe,_0x479d73){return new BPromise(function(_0x232d41,_0x1de5c3){return client[_0x9d83('0xf')](_0x51aebc,_0x479d73)[_0x9d83('0x10')](function(_0x9c752e){logger[_0x9d83('0x11')](_0x9d83('0x12'),_0x1a2fbe,_0x9d83('0x13'));logger[_0x9d83('0x14')](_0x9d83('0x15'),_0x1a2fbe,_0x9d83('0x13'),JSON['stringify'](_0x9c752e));if(_0x9c752e[_0x9d83('0x16')]){if(_0x9c752e['error'][_0x9d83('0x17')]===0x1f4){logger['error'](_0x9d83('0x12'),_0x1a2fbe,_0x9c752e['error'][_0x9d83('0x18')]);return _0x1de5c3(_0x9c752e['error'][_0x9d83('0x18')]);}logger[_0x9d83('0x16')](_0x9d83('0x12'),_0x1a2fbe,_0x9c752e[_0x9d83('0x16')][_0x9d83('0x18')]);return _0x232d41(_0x9c752e[_0x9d83('0x16')][_0x9d83('0x18')]);}else{logger[_0x9d83('0x11')]('FaxAccount,\x20%s,\x20%s',_0x1a2fbe,_0x9d83('0x13'));_0x232d41(_0x9c752e[_0x9d83('0x19')][_0x9d83('0x18')]);}})[_0x9d83('0x1a')](function(_0xbd7efa){logger[_0x9d83('0x16')](_0x9d83('0x12'),_0x1a2fbe,_0xbd7efa);_0x1de5c3(_0xbd7efa);});});}exports[_0x9d83('0x1b')]=function(_0x12b48a){var _0x18cfe4=this;return new Promise(function(_0xa6266,_0x42591c){return db[_0x9d83('0x1c')][_0x9d83('0x1d')]({'raw':_0x12b48a[_0x9d83('0x1e')]?_0x12b48a['options'][_0x9d83('0x1f')]===undefined?!![]:![]:!![],'where':_0x12b48a[_0x9d83('0x1e')]?_0x12b48a[_0x9d83('0x1e')]['where']||null:null,'attributes':_0x12b48a[_0x9d83('0x1e')]?_0x12b48a[_0x9d83('0x1e')][_0x9d83('0x20')]||null:null,'limit':_0x12b48a['options']?_0x12b48a['options'][_0x9d83('0x21')]||null:null,'include':_0x12b48a[_0x9d83('0x1e')]?_0x12b48a[_0x9d83('0x1e')][_0x9d83('0x22')]?_['map'](_0x12b48a[_0x9d83('0x1e')][_0x9d83('0x22')],function(_0x476aa9){return{'model':db[_0x476aa9[_0x9d83('0x23')]],'as':_0x476aa9['as'],'attributes':_0x476aa9[_0x9d83('0x20')],'include':_0x476aa9[_0x9d83('0x22')]?_[_0x9d83('0x24')](_0x476aa9[_0x9d83('0x22')],function(_0x36c78e){return{'model':db[_0x36c78e['model']],'as':_0x36c78e['as'],'attributes':_0x36c78e[_0x9d83('0x20')],'include':_0x36c78e[_0x9d83('0x22')]?_[_0x9d83('0x24')](_0x36c78e[_0x9d83('0x22')],function(_0x3c35ac){return{'model':db[_0x3c35ac[_0x9d83('0x23')]],'as':_0x3c35ac['as'],'attributes':_0x3c35ac[_0x9d83('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9d83('0x10')](function(_0x57979){logger['info']('GetFaxAccount',_0x12b48a);logger[_0x9d83('0x14')](_0x9d83('0x1b'),_0x12b48a,JSON[_0x9d83('0x25')](_0x57979));_0xa6266(_0x57979);})[_0x9d83('0x1a')](function(_0x56b75c){logger[_0x9d83('0x16')](_0x9d83('0x1b'),_0x56b75c['message'],_0x12b48a);_0x42591c(_0x18cfe4['error'](0x1f4,_0x56b75c[_0x9d83('0x18')]));});});};exports[_0x9d83('0x26')]=function(_0x1db097,_0x9dc3d7,_0x5b4c2e){var _0x320c49=this;return new Promise(function(_0x2dc16b,_0x5204d6){var _0x27ade2={'body':_0x1db097[_0x9d83('0x27')],'channel':_0x9d83('0x28')};var _0x3fabf4=[];var _0xfb990c=[];var _0x34c51a={};return db[_0x9d83('0x29')][_0x9d83('0x2a')]()[_0x9d83('0x10')](function(_0x323e0d){if(!_0x323e0d){throw new db['Sequelize'][(_0x9d83('0x2b'))](_0x9d83('0x2c'));}_0x3fabf4=_[_0x9d83('0x2d')](_['keys'](_0x323e0d),[_0x9d83('0x2e'),'updatedAt']);_0xfb990c=_[_0x9d83('0x2d')](_[_0x9d83('0x2f')](_0x323e0d),[_0x9d83('0x2e'),_0x9d83('0x30'),_0x9d83('0x31'),'ListId']);if(_0x1db097[_0x9d83('0x27')]['id']){delete _0x1db097['body']['id'];}if(_[_0x9d83('0x32')](_0x1db097[_0x9d83('0x27')][_0x9d83('0x33')])){throw new db[(_0x9d83('0x34'))][(_0x9d83('0x2b'))](_0x9d83('0x35'));}if(_['isNil'](_0x1db097[_0x9d83('0x27')][_0x9d83('0x27')])||_0x1db097[_0x9d83('0x27')][_0x9d83('0x27')]===''){throw new db['Sequelize'][(_0x9d83('0x2b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9d83('0x32')](_0x1db097[_0x9d83('0x27')]['mapKey'])){throw new db[(_0x9d83('0x34'))][(_0x9d83('0x2b'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xfb990c);}if(!_[_0x9d83('0x36')](_0xfb990c,_0x1db097['body'][_0x9d83('0x37')])){throw new db[(_0x9d83('0x34'))]['ValidationError'](_0x9d83('0x38')+_0xfb990c);}_0x34c51a[_0x1db097['body']['mapKey']]=_0x1db097[_0x9d83('0x27')][_0x9d83('0x33')];})[_0x9d83('0x10')](function(){return db[_0x9d83('0x1c')][_0x9d83('0x39')]({'where':{'id':_0x1db097['account']['id']},'include':[{'model':db[_0x9d83('0x3a')],'as':_0x9d83('0x3b'),'include':[{'model':db[_0x9d83('0x29')],'as':_0x9d83('0x3c'),'where':_0x34c51a,'limit':0x1,'order':[[_0x9d83('0x30'),_0x9d83('0x3d')]]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0x9d83('0x10')](function(_0x5caf56){if(_0x5caf56&&_0x5caf56[_0x9d83('0x3b')]){var _0x5f2a0a=_0x5caf56[_0x9d83('0x3e')]({'plain':!![]});_0x27ade2[_0x9d83('0x3f')]=_0x5f2a0a;_0x27ade2['applications']=_0x5f2a0a[_0x9d83('0x40')];_0x27ade2[_0x9d83('0x41')]=_0x5f2a0a[_0x9d83('0x3b')];_0x27ade2['applications']=_[_0x9d83('0x42')](_0x27ade2['applications'],[_0x9d83('0x43')],[_0x9d83('0x44')]);if(_0x27ade2[_0x9d83('0x3f')][_0x9d83('0x40')]){delete _0x27ade2[_0x9d83('0x3f')][_0x9d83('0x40')];}if(_0x27ade2['account'][_0x9d83('0x3b')]&&_0x27ade2[_0x9d83('0x3f')][_0x9d83('0x3b')][_0x9d83('0x3c')][_0x9d83('0x45')]){return _0x27ade2['account'][_0x9d83('0x3b')][_0x9d83('0x3c')][0x0];}var _0x1494e3=_['defaults'](_0x1db097[_0x9d83('0x27')],{'firstName':_0x1db097[_0x9d83('0x27')][_0x9d83('0x33')],'ListId':_0x5f2a0a[_0x9d83('0x46')]});_0x1494e3[_0x1db097[_0x9d83('0x27')][_0x9d83('0x37')]]=_0x1db097['body'][_0x9d83('0x33')];return db[_0x9d83('0x29')][_0x9d83('0x47')](_0x1494e3,{'fields':_0x3fabf4,'raw':!![]});}})[_0x9d83('0x10')](function(_0x126426){_0x27ade2[_0x9d83('0x48')]=_0x126426;if(_0x126426){var _0x5f49d4={'ContactId':_0x126426['id'],'FaxAccountId':_0x1db097[_0x9d83('0x3f')]['id'],'fax':_0x126426['fax']};return db[_0x9d83('0x49')][_0x9d83('0x39')]({'where':{'ContactId':_0x126426['id'],'closed':![],'FaxAccountId':_0x1db097['account']['id']}})[_0x9d83('0x10')](function(_0x4b796b){if(_0x4b796b){return[_0x4b796b,![]];}return db['FaxInteraction'][_0x9d83('0x47')](_0x5f49d4)['then'](function(_0x23849e){return[_0x23849e,!![]];});});}else{throw new Error(_0x9d83('0x4a'));}})['spread'](function(_0x32fe20,_0x30751c){var _0x292e3a=_0x32fe20[_0x9d83('0x3e')]({'plain':!![]});if(_0x30751c){if(_0x27ade2[_0x9d83('0x3f')]['autoclose']){_0x27ade2[_0x9d83('0x4b')]['push']({'id':0x0,'priority':_0x27ade2[_0x9d83('0x4b')][_0x9d83('0x45')]+0x1,'app':_0x9d83('0x4c'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x292e3a[_0x9d83('0x4d')]=!![];}else{_0x292e3a[_0x9d83('0x4d')]=![];}_0x27ade2[_0x9d83('0x4e')]=_0x292e3a;return db[_0x9d83('0x4f')][_0x9d83('0x47')]({'body':_0x1db097[_0x9d83('0x27')][_0x9d83('0x27')],'FaxAccountId':_0x1db097[_0x9d83('0x3f')]['id'],'FaxInteractionId':_0x32fe20['id'],'direction':'in','ContactId':_0x32fe20[_0x9d83('0x50')],'AttachmentId':_0x1db097['body'][_0x9d83('0x51')]});})['then'](function(_0x3f6449){_0x27ade2[_0x9d83('0x18')]=_0x3f6449;if(_0x27ade2['interaction'][_0x9d83('0x52')]){return db[_0x9d83('0x53')][_0x9d83('0x39')]({'attributes':['id',_0x9d83('0x54')],'where':{'id':_0x27ade2[_0x9d83('0x4e')][_0x9d83('0x52')]}})[_0x9d83('0x10')](function(_0x41180){if(_0x41180){_0x27ade2[_0x9d83('0x4b')][_0x9d83('0x55')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x41180[_0x9d83('0x54')]+','+(_0x27ade2[_0x9d83('0x3f')][_0x9d83('0x56')]||0xa),'interval':_0x9d83('0x57')});}return respondWithRpcPromise(_0x9d83('0x58'),_0x9d83('0x59'),_0x27ade2);});}return respondWithRpcPromise(_0x9d83('0x58'),_0x9d83('0x59'),_0x27ade2);})[_0x9d83('0x10')](function(_0x1c36e5){_0x2dc16b(_0x1c36e5);})['catch'](function(_0x396953){_0x5204d6(_0x320c49[_0x9d83('0x16')](0x1f4,_0x396953[_0x9d83('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 355d75b..c5148d8 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 _0xf4c1=['emit','removeListener','length','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xf4c1,0x64));var _0x1f4c=function(_0x47a4ad,_0x4f1b3e){_0x47a4ad=_0x47a4ad-0x0;var _0x279e19=_0xf4c1[_0x47a4ad];return _0x279e19;};'use strict';var FaxAccountEvents=require(_0x1f4c('0x0'));var events=[_0x1f4c('0x1'),_0x1f4c('0x2'),_0x1f4c('0x3')];function createListener(_0x328bcf,_0x12f3a7){return function(_0x40db77){_0x12f3a7[_0x1f4c('0x4')](_0x328bcf,_0x40db77);};}function removeListener(_0x1dee9d,_0x3bcbfc){return function(){FaxAccountEvents[_0x1f4c('0x5')](_0x1dee9d,_0x3bcbfc);};}exports['register']=function(_0xb25ff4){for(var _0x2d1311=0x0,_0xfad7fc=events[_0x1f4c('0x6')];_0x2d1311<_0xfad7fc;_0x2d1311++){var _0xb0642a=events[_0x2d1311];var _0x24876e=createListener(_0x1f4c('0x7')+_0xb0642a,_0xb25ff4);FaxAccountEvents['on'](_0xb0642a,_0x24876e);}}; \ No newline at end of file +var _0x4ff3=['emit','removeListener','length','faxAccount:','./faxAccount.events','remove','update'];(function(_0x4369c7,_0x2212d3){var _0x351a79=function(_0x18b95c){while(--_0x18b95c){_0x4369c7['push'](_0x4369c7['shift']());}};_0x351a79(++_0x2212d3);}(_0x4ff3,0x1bd));var _0x34ff=function(_0x1229ac,_0x23dab8){_0x1229ac=_0x1229ac-0x0;var _0x536085=_0x4ff3[_0x1229ac];return _0x536085;};'use strict';var FaxAccountEvents=require(_0x34ff('0x0'));var events=['save',_0x34ff('0x1'),_0x34ff('0x2')];function createListener(_0xb2916e,_0x1cb33b){return function(_0x3402c1){_0x1cb33b[_0x34ff('0x3')](_0xb2916e,_0x3402c1);};}function removeListener(_0x7bd462,_0x476eec){return function(){FaxAccountEvents[_0x34ff('0x4')](_0x7bd462,_0x476eec);};}exports['register']=function(_0x44d722){for(var _0x396fd4=0x0,_0x3227a0=events[_0x34ff('0x5')];_0x396fd4<_0x3227a0;_0x396fd4++){var _0x5eda11=events[_0x396fd4];var _0x3f4b27=createListener(_0x34ff('0x6')+_0x5eda11,_0x44d722);FaxAccountEvents['on'](_0x5eda11,_0x3f4b27);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 2c745dd..a0fa8db 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(_0x370f57,_0x1f7518){var _0x1c7e0b=function(_0x123734){while(--_0x123734){_0x370f57['push'](_0x370f57['shift']());}};_0x1c7e0b(++_0x1f7518);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('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(_0x301d29,_0x9ff2b7){var _0x1598a6=function(_0x587ca5){while(--_0x587ca5){_0x301d29['push'](_0x301d29['shift']());}};_0x1598a6(++_0x9ff2b7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 b60199f..4efde94 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 _0x1187=['*,*,*,*','exports','INTEGER','STRING','noop','TEXT'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1187,0x67));var _0x7118=function(_0x5096c5,_0x25833c){_0x5096c5=_0x5096c5-0x0;var _0x263129=_0x1187[_0x5096c5];return _0x263129;};'use strict';var Sequelize=require('sequelize');module[_0x7118('0x0')]={'priority':{'type':Sequelize[_0x7118('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7118('0x2')],'allowNull':![],'defaultValue':_0x7118('0x3')},'appdata':{'type':Sequelize[_0x7118('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x7118('0x2')],'defaultValue':_0x7118('0x5')}}; \ No newline at end of file +var _0xff3a=['TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x455154,_0x45deae){var _0x124dbc=function(_0x69d923){while(--_0x69d923){_0x455154['push'](_0x455154['shift']());}};_0x124dbc(++_0x45deae);}(_0xff3a,0x92));var _0xaff3=function(_0x4f6def,_0x1e4bb8){_0x4f6def=_0x4f6def-0x0;var _0x343106=_0xff3a[_0x4f6def];return _0x343106;};'use strict';var Sequelize=require(_0xaff3('0x0'));module[_0xaff3('0x1')]={'priority':{'type':Sequelize[_0xaff3('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xaff3('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xaff3('0x4')]()},'description':{'type':Sequelize[_0xaff3('0x3')]},'interval':{'type':Sequelize[_0xaff3('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index c7d7802..de3365d 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 _0xaf73=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','then','rows','catch','show','params','length','find','create','body','update','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','sendStatus','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','keys'];(function(_0x332e61,_0x107e15){var _0x287b3a=function(_0x10bf75){while(--_0x10bf75){_0x332e61['push'](_0x332e61['shift']());}};_0x287b3a(++_0x107e15);}(_0xaf73,0x10b));var _0x3af7=function(_0x1e6baa,_0x5a38c7){_0x1e6baa=_0x1e6baa-0x0;var _0x1ec274=_0xaf73[_0x1e6baa];return _0x1ec274;};'use strict';var emlformat=require(_0x3af7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3af7('0x1'));var jsonpatch=require(_0x3af7('0x2'));var rp=require(_0x3af7('0x3'));var moment=require(_0x3af7('0x4'));var BPromise=require(_0x3af7('0x5'));var Mustache=require('mustache');var util=require(_0x3af7('0x6'));var path=require(_0x3af7('0x7'));var sox=require(_0x3af7('0x8'));var csv=require(_0x3af7('0x9'));var ejs=require(_0x3af7('0xa'));var fs=require('fs');var fs_extra=require(_0x3af7('0xb'));var _=require(_0x3af7('0xc'));var squel=require(_0x3af7('0xd'));var crypto=require(_0x3af7('0xe'));var jsforce=require(_0x3af7('0xf'));var deskjs=require(_0x3af7('0x10'));var toCsv=require('to-csv');var querystring=require(_0x3af7('0x11'));var Papa=require(_0x3af7('0x12'));var Redis=require(_0x3af7('0x13'));var authService=require(_0x3af7('0x14'));var qs=require(_0x3af7('0x15'));var as=require(_0x3af7('0x16'));var hardwareService=require(_0x3af7('0x17'));var logger=require(_0x3af7('0x18'))(_0x3af7('0x19'));var utils=require(_0x3af7('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x3af7('0x1b'));var db=require(_0x3af7('0x1c'))['db'];function respondWithStatusCode(_0x55ce01,_0x1e2145){_0x1e2145=_0x1e2145||0xcc;return function(_0x256147){if(_0x256147){return _0x55ce01['sendStatus'](_0x1e2145);}return _0x55ce01[_0x3af7('0x1d')](_0x1e2145)[_0x3af7('0x1e')]();};}function respondWithResult(_0x54c2bf,_0x3f4b3a){_0x3f4b3a=_0x3f4b3a||0xc8;return function(_0x55a61e){if(_0x55a61e){return _0x54c2bf['status'](_0x3f4b3a)[_0x3af7('0x1f')](_0x55a61e);}};}function respondWithFilteredResult(_0x34213c,_0x45f662){return function(_0x17505f){if(_0x17505f){var _0x33905c=typeof _0x45f662['offset']===_0x3af7('0x20')&&typeof _0x45f662[_0x3af7('0x21')]==='undefined';var _0xbe8c3=_0x17505f[_0x3af7('0x22')];var _0x8ec9d9=_0x33905c?0x0:_0x45f662[_0x3af7('0x23')];var _0x3d834b=_0x33905c?_0x17505f[_0x3af7('0x22')]:_0x45f662[_0x3af7('0x23')]+_0x45f662['limit'];var _0x4d437b;if(_0x3d834b>=_0xbe8c3){_0x3d834b=_0xbe8c3;_0x4d437b=0xc8;}else{_0x4d437b=0xce;}_0x34213c[_0x3af7('0x1d')](_0x4d437b);return _0x34213c[_0x3af7('0x24')](_0x3af7('0x25'),_0x8ec9d9+'-'+_0x3d834b+'/'+_0xbe8c3)[_0x3af7('0x1f')](_0x17505f);}return null;};}function patchUpdates(_0x58af64){return function(_0x7e3265){try{jsonpatch[_0x3af7('0x26')](_0x7e3265,_0x58af64,!![]);}catch(_0x1da6db){return BPromise['reject'](_0x1da6db);}return _0x7e3265[_0x3af7('0x27')]();};}function saveUpdates(_0x4cc725,_0x1bd3c2){return function(_0x5e54cd){if(_0x5e54cd){return _0x5e54cd['update'](_0x4cc725)['then'](function(_0x2e3d8f){return _0x2e3d8f;});}return null;};}function removeEntity(_0x94abb7,_0x34e459){return function(_0x6b6267){if(_0x6b6267){return _0x6b6267['destroy']()['then'](function(){_0x94abb7[_0x3af7('0x1d')](0xcc)[_0x3af7('0x1e')]();});}};}function handleEntityNotFound(_0x51665e,_0x4da41d){return function(_0x2d262a){if(!_0x2d262a){_0x51665e[_0x3af7('0x28')](0x194);}return _0x2d262a;};}function handleError(_0x5597bc,_0x37956a){_0x37956a=_0x37956a||0x1f4;return function(_0x489148){logger['error'](_0x489148[_0x3af7('0x29')]);if(_0x489148[_0x3af7('0x2a')]){delete _0x489148[_0x3af7('0x2a')];}_0x5597bc[_0x3af7('0x1d')](_0x37956a)[_0x3af7('0x2b')](_0x489148);};}exports[_0x3af7('0x2c')]=function(_0x47b36f,_0x5b030e){var _0x5620bc={},_0x2697f5={},_0x292d12={'count':0x0,'rows':[]};var _0x3153a1=_[_0x3af7('0x2d')](db[_0x3af7('0x2e')][_0x3af7('0x2f')],function(_0xc47923){return{'name':_0xc47923[_0x3af7('0x30')],'type':_0xc47923[_0x3af7('0x31')][_0x3af7('0x32')]};});_0x2697f5[_0x3af7('0x33')]=_[_0x3af7('0x2d')](_0x3153a1,_0x3af7('0x2a'));_0x2697f5['query']=_[_0x3af7('0x34')](_0x47b36f[_0x3af7('0x35')]);_0x2697f5[_0x3af7('0x36')]=_[_0x3af7('0x37')](_0x2697f5['model'],_0x2697f5['query']);_0x5620bc[_0x3af7('0x38')]=_[_0x3af7('0x37')](_0x2697f5[_0x3af7('0x33')],qs[_0x3af7('0x39')](_0x47b36f['query']['fields']));_0x5620bc['attributes']=_0x5620bc[_0x3af7('0x38')]['length']?_0x5620bc[_0x3af7('0x38')]:_0x2697f5['model'];if(!_0x47b36f[_0x3af7('0x35')][_0x3af7('0x3a')](_0x3af7('0x3b'))){_0x5620bc[_0x3af7('0x21')]=qs[_0x3af7('0x21')](_0x47b36f[_0x3af7('0x35')][_0x3af7('0x21')]);_0x5620bc[_0x3af7('0x23')]=qs[_0x3af7('0x23')](_0x47b36f['query'][_0x3af7('0x23')]);}_0x5620bc[_0x3af7('0x3c')]=qs[_0x3af7('0x3d')](_0x47b36f[_0x3af7('0x35')][_0x3af7('0x3d')]);_0x5620bc[_0x3af7('0x3e')]=qs[_0x3af7('0x36')](_[_0x3af7('0x3f')](_0x47b36f[_0x3af7('0x35')],_0x2697f5[_0x3af7('0x36')]),_0x3153a1);if(_0x47b36f['query'][_0x3af7('0x40')]){_0x5620bc[_0x3af7('0x3e')]=_['merge'](_0x5620bc[_0x3af7('0x3e')],{'$or':_[_0x3af7('0x2d')](_0x3153a1,function(_0x53e599){if(_0x53e599[_0x3af7('0x31')]!=='VIRTUAL'){var _0x509a4c={};_0x509a4c[_0x53e599[_0x3af7('0x2a')]]={'$like':'%'+_0x47b36f['query'][_0x3af7('0x40')]+'%'};return _0x509a4c;}})});}_0x5620bc=_[_0x3af7('0x41')]({},_0x5620bc,_0x47b36f[_0x3af7('0x42')]);var _0x2646c5={'where':_0x5620bc[_0x3af7('0x3e')]};return db[_0x3af7('0x2e')][_0x3af7('0x22')](_0x2646c5)['then'](function(_0x4020ce){_0x292d12[_0x3af7('0x22')]=_0x4020ce;if(_0x47b36f[_0x3af7('0x35')][_0x3af7('0x43')]){_0x5620bc[_0x3af7('0x44')]=[{'all':!![]}];}return db[_0x3af7('0x2e')]['findAll'](_0x5620bc);})[_0x3af7('0x45')](function(_0x25034d){_0x292d12[_0x3af7('0x46')]=_0x25034d;return _0x292d12;})[_0x3af7('0x45')](respondWithFilteredResult(_0x5b030e,_0x5620bc))[_0x3af7('0x47')](handleError(_0x5b030e,null));};exports[_0x3af7('0x48')]=function(_0x23f642,_0x3bc3f7){var _0x54bab7={'raw':!![],'where':{'id':_0x23f642[_0x3af7('0x49')]['id']}},_0x13579b={};_0x13579b[_0x3af7('0x33')]=_[_0x3af7('0x34')](db[_0x3af7('0x2e')][_0x3af7('0x2f')]);_0x13579b[_0x3af7('0x35')]=_[_0x3af7('0x34')](_0x23f642['query']);_0x13579b[_0x3af7('0x36')]=_[_0x3af7('0x37')](_0x13579b[_0x3af7('0x33')],_0x13579b[_0x3af7('0x35')]);_0x54bab7['attributes']=_[_0x3af7('0x37')](_0x13579b[_0x3af7('0x33')],qs['fields'](_0x23f642[_0x3af7('0x35')][_0x3af7('0x39')]));_0x54bab7['attributes']=_0x54bab7[_0x3af7('0x38')][_0x3af7('0x4a')]?_0x54bab7[_0x3af7('0x38')]:_0x13579b['model'];if(_0x23f642[_0x3af7('0x35')][_0x3af7('0x43')]){_0x54bab7[_0x3af7('0x44')]=[{'all':!![]}];}_0x54bab7=_[_0x3af7('0x41')]({},_0x54bab7,_0x23f642[_0x3af7('0x42')]);return db[_0x3af7('0x2e')][_0x3af7('0x4b')](_0x54bab7)[_0x3af7('0x45')](handleEntityNotFound(_0x3bc3f7,null))[_0x3af7('0x45')](respondWithResult(_0x3bc3f7,null))['catch'](handleError(_0x3bc3f7,null));};exports[_0x3af7('0x4c')]=function(_0x2d9391,_0x14a6ea){return db['FaxApplication']['create'](_0x2d9391[_0x3af7('0x4d')],{})[_0x3af7('0x45')](respondWithResult(_0x14a6ea,0xc9))[_0x3af7('0x47')](handleError(_0x14a6ea,null));};exports[_0x3af7('0x4e')]=function(_0x389884,_0x2d1787){if(_0x389884[_0x3af7('0x4d')]['id']){delete _0x389884[_0x3af7('0x4d')]['id'];}return db['FaxApplication'][_0x3af7('0x4b')]({'where':{'id':_0x389884[_0x3af7('0x49')]['id']}})[_0x3af7('0x45')](handleEntityNotFound(_0x2d1787,null))['then'](saveUpdates(_0x389884[_0x3af7('0x4d')],null))['then'](respondWithResult(_0x2d1787,null))[_0x3af7('0x47')](handleError(_0x2d1787,null));};exports[_0x3af7('0x4f')]=function(_0x11a6bc,_0x585489){return db['FaxApplication'][_0x3af7('0x4b')]({'where':{'id':_0x11a6bc['params']['id']}})[_0x3af7('0x45')](handleEntityNotFound(_0x585489,null))[_0x3af7('0x45')](removeEntity(_0x585489,null))[_0x3af7('0x47')](handleError(_0x585489,null));}; \ No newline at end of file +var _0x1958=['limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','FaxApplication','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','length','include','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1958,0xc5));var _0x8195=function(_0x3480e9,_0x1ce980){_0x3480e9=_0x3480e9-0x0;var _0x389aad=_0x1958[_0x3480e9];return _0x389aad;};'use strict';var emlformat=require(_0x8195('0x0'));var rimraf=require(_0x8195('0x1'));var zipdir=require(_0x8195('0x2'));var jsonpatch=require(_0x8195('0x3'));var rp=require(_0x8195('0x4'));var moment=require(_0x8195('0x5'));var BPromise=require(_0x8195('0x6'));var Mustache=require('mustache');var util=require(_0x8195('0x7'));var path=require(_0x8195('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8195('0x9'));var fs=require('fs');var fs_extra=require(_0x8195('0xa'));var _=require(_0x8195('0xb'));var squel=require(_0x8195('0xc'));var crypto=require(_0x8195('0xd'));var jsforce=require(_0x8195('0xe'));var deskjs=require(_0x8195('0xf'));var toCsv=require(_0x8195('0x10'));var querystring=require('querystring');var Papa=require(_0x8195('0x11'));var Redis=require('ioredis');var authService=require(_0x8195('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8195('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8195('0x14'));var utils=require(_0x8195('0x15'));var config=require(_0x8195('0x16'));var licenseUtil=require(_0x8195('0x17'));var db=require(_0x8195('0x18'))['db'];function respondWithStatusCode(_0x53de5f,_0x3488b1){_0x3488b1=_0x3488b1||0xcc;return function(_0x1d7df3){if(_0x1d7df3){return _0x53de5f[_0x8195('0x19')](_0x3488b1);}return _0x53de5f[_0x8195('0x1a')](_0x3488b1)[_0x8195('0x1b')]();};}function respondWithResult(_0x59b762,_0x11a543){_0x11a543=_0x11a543||0xc8;return function(_0x58958d){if(_0x58958d){return _0x59b762[_0x8195('0x1a')](_0x11a543)[_0x8195('0x1c')](_0x58958d);}};}function respondWithFilteredResult(_0x4e3fc7,_0x43ee16){return function(_0x6c1fb5){if(_0x6c1fb5){var _0x39d91a=typeof _0x43ee16[_0x8195('0x1d')]===_0x8195('0x1e')&&typeof _0x43ee16[_0x8195('0x1f')]==='undefined';var _0x530840=_0x6c1fb5['count'];var _0x1cdccb=_0x39d91a?0x0:_0x43ee16[_0x8195('0x1d')];var _0x215e18=_0x39d91a?_0x6c1fb5[_0x8195('0x20')]:_0x43ee16[_0x8195('0x1d')]+_0x43ee16[_0x8195('0x1f')];var _0x9dea18;if(_0x215e18>=_0x530840){_0x215e18=_0x530840;_0x9dea18=0xc8;}else{_0x9dea18=0xce;}_0x4e3fc7[_0x8195('0x1a')](_0x9dea18);return _0x4e3fc7['set'](_0x8195('0x21'),_0x1cdccb+'-'+_0x215e18+'/'+_0x530840)['json'](_0x6c1fb5);}return null;};}function patchUpdates(_0x189ba4){return function(_0x2ff981){try{jsonpatch[_0x8195('0x22')](_0x2ff981,_0x189ba4,!![]);}catch(_0x5dfb1e){return BPromise[_0x8195('0x23')](_0x5dfb1e);}return _0x2ff981[_0x8195('0x24')]();};}function saveUpdates(_0x8daaf,_0x3ddf54){return function(_0x172374){if(_0x172374){return _0x172374[_0x8195('0x25')](_0x8daaf)[_0x8195('0x26')](function(_0x1d3689){return _0x1d3689;});}return null;};}function removeEntity(_0x2734c7,_0x5f128f){return function(_0x508d87){if(_0x508d87){return _0x508d87[_0x8195('0x27')]()[_0x8195('0x26')](function(){_0x2734c7['status'](0xcc)[_0x8195('0x1b')]();});}};}function handleEntityNotFound(_0x11abfd,_0x562779){return function(_0x5daa96){if(!_0x5daa96){_0x11abfd[_0x8195('0x19')](0x194);}return _0x5daa96;};}function handleError(_0x26089d,_0x94d0d6){_0x94d0d6=_0x94d0d6||0x1f4;return function(_0x22d8c0){logger['error'](_0x22d8c0[_0x8195('0x28')]);if(_0x22d8c0[_0x8195('0x29')]){delete _0x22d8c0[_0x8195('0x29')];}_0x26089d['status'](_0x94d0d6)[_0x8195('0x2a')](_0x22d8c0);};}exports['index']=function(_0x5baac6,_0x1723fb){var _0x5bc256={},_0x564ab1={},_0x52a69e={'count':0x0,'rows':[]};var _0x1f6108=_['map'](db[_0x8195('0x2b')][_0x8195('0x2c')],function(_0x51dbd8){return{'name':_0x51dbd8[_0x8195('0x2d')],'type':_0x51dbd8[_0x8195('0x2e')][_0x8195('0x2f')]};});_0x564ab1[_0x8195('0x30')]=_[_0x8195('0x31')](_0x1f6108,_0x8195('0x29'));_0x564ab1['query']=_[_0x8195('0x32')](_0x5baac6[_0x8195('0x33')]);_0x564ab1['filters']=_[_0x8195('0x34')](_0x564ab1[_0x8195('0x30')],_0x564ab1[_0x8195('0x33')]);_0x5bc256[_0x8195('0x35')]=_[_0x8195('0x34')](_0x564ab1['model'],qs[_0x8195('0x36')](_0x5baac6[_0x8195('0x33')][_0x8195('0x36')]));_0x5bc256[_0x8195('0x35')]=_0x5bc256[_0x8195('0x35')]['length']?_0x5bc256[_0x8195('0x35')]:_0x564ab1[_0x8195('0x30')];if(!_0x5baac6[_0x8195('0x33')][_0x8195('0x37')](_0x8195('0x38'))){_0x5bc256['limit']=qs['limit'](_0x5baac6['query']['limit']);_0x5bc256[_0x8195('0x1d')]=qs[_0x8195('0x1d')](_0x5baac6['query']['offset']);}_0x5bc256[_0x8195('0x39')]=qs[_0x8195('0x3a')](_0x5baac6[_0x8195('0x33')][_0x8195('0x3a')]);_0x5bc256[_0x8195('0x3b')]=qs[_0x8195('0x3c')](_[_0x8195('0x3d')](_0x5baac6[_0x8195('0x33')],_0x564ab1[_0x8195('0x3c')]),_0x1f6108);if(_0x5baac6[_0x8195('0x33')][_0x8195('0x3e')]){_0x5bc256[_0x8195('0x3b')]=_[_0x8195('0x3f')](_0x5bc256[_0x8195('0x3b')],{'$or':_['map'](_0x1f6108,function(_0x504dd1){if(_0x504dd1[_0x8195('0x2e')]!==_0x8195('0x40')){var _0x25a48c={};_0x25a48c[_0x504dd1[_0x8195('0x29')]]={'$like':'%'+_0x5baac6[_0x8195('0x33')]['filter']+'%'};return _0x25a48c;}})});}_0x5bc256=_[_0x8195('0x3f')]({},_0x5bc256,_0x5baac6['options']);var _0x62b170={'where':_0x5bc256['where']};return db['FaxApplication']['count'](_0x62b170)[_0x8195('0x26')](function(_0x5979d3){_0x52a69e['count']=_0x5979d3;if(_0x5baac6[_0x8195('0x33')][_0x8195('0x41')]){_0x5bc256['include']=[{'all':!![]}];}return db[_0x8195('0x2b')]['findAll'](_0x5bc256);})[_0x8195('0x26')](function(_0x2e187f){_0x52a69e[_0x8195('0x42')]=_0x2e187f;return _0x52a69e;})[_0x8195('0x26')](respondWithFilteredResult(_0x1723fb,_0x5bc256))[_0x8195('0x43')](handleError(_0x1723fb,null));};exports[_0x8195('0x44')]=function(_0x2ab6b6,_0x4ec1f6){var _0x5f2471={'raw':!![],'where':{'id':_0x2ab6b6['params']['id']}},_0x5eb107={};_0x5eb107[_0x8195('0x30')]=_[_0x8195('0x32')](db[_0x8195('0x2b')]['rawAttributes']);_0x5eb107[_0x8195('0x33')]=_[_0x8195('0x32')](_0x2ab6b6[_0x8195('0x33')]);_0x5eb107[_0x8195('0x3c')]=_['intersection'](_0x5eb107[_0x8195('0x30')],_0x5eb107[_0x8195('0x33')]);_0x5f2471['attributes']=_[_0x8195('0x34')](_0x5eb107[_0x8195('0x30')],qs[_0x8195('0x36')](_0x2ab6b6['query'][_0x8195('0x36')]));_0x5f2471['attributes']=_0x5f2471['attributes'][_0x8195('0x45')]?_0x5f2471[_0x8195('0x35')]:_0x5eb107['model'];if(_0x2ab6b6[_0x8195('0x33')]['includeAll']){_0x5f2471[_0x8195('0x46')]=[{'all':!![]}];}_0x5f2471=_['merge']({},_0x5f2471,_0x2ab6b6[_0x8195('0x47')]);return db[_0x8195('0x2b')][_0x8195('0x48')](_0x5f2471)[_0x8195('0x26')](handleEntityNotFound(_0x4ec1f6,null))[_0x8195('0x26')](respondWithResult(_0x4ec1f6,null))['catch'](handleError(_0x4ec1f6,null));};exports[_0x8195('0x49')]=function(_0x5546e4,_0x3af4f2){return db[_0x8195('0x2b')][_0x8195('0x49')](_0x5546e4[_0x8195('0x4a')],{})[_0x8195('0x26')](respondWithResult(_0x3af4f2,0xc9))['catch'](handleError(_0x3af4f2,null));};exports[_0x8195('0x25')]=function(_0x2e9c50,_0x305447){if(_0x2e9c50[_0x8195('0x4a')]['id']){delete _0x2e9c50['body']['id'];}return db[_0x8195('0x2b')][_0x8195('0x48')]({'where':{'id':_0x2e9c50[_0x8195('0x4b')]['id']}})[_0x8195('0x26')](handleEntityNotFound(_0x305447,null))['then'](saveUpdates(_0x2e9c50[_0x8195('0x4a')],null))['then'](respondWithResult(_0x305447,null))['catch'](handleError(_0x305447,null));};exports['destroy']=function(_0x432529,_0x1c2a93){return db['FaxApplication'][_0x8195('0x48')]({'where':{'id':_0x432529[_0x8195('0x4b')]['id']}})[_0x8195('0x26')](handleEntityNotFound(_0x1c2a93,null))[_0x8195('0x26')](removeEntity(_0x1c2a93,null))['catch'](handleError(_0x1c2a93,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 3cf529c..0adc044 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 _0x7d8d=['util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4_unicode_ci'];(function(_0x4d187f,_0x3aa94a){var _0x4893a6=function(_0x24555e){while(--_0x24555e){_0x4d187f['push'](_0x4d187f['shift']());}};_0x4893a6(++_0x3aa94a);}(_0x7d8d,0x155));var _0xd7d8=function(_0xc460f0,_0x4756a3){_0xc460f0=_0xc460f0-0x0;var _0x489521=_0x7d8d[_0xc460f0];return _0x489521;};'use strict';var _=require('lodash');var util=require(_0xd7d8('0x0'));var logger=require(_0xd7d8('0x1'))('api');var moment=require(_0xd7d8('0x2'));var BPromise=require(_0xd7d8('0x3'));var rp=require(_0xd7d8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd7d8('0x5'));var attributes=require(_0xd7d8('0x6'));module[_0xd7d8('0x7')]=function(_0x2f66c7,_0x4c7edc){return _0x2f66c7[_0xd7d8('0x8')]('FaxApplication',attributes,{'tableName':_0xd7d8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd7d8('0xa')});}; \ No newline at end of file +var _0x67e3=['define','fax_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','rimraf','./faxApplication.attributes','exports'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0x67e3,0xc4));var _0x367e=function(_0x2ed07f,_0x343012){_0x2ed07f=_0x2ed07f-0x0;var _0x3b5ad1=_0x67e3[_0x2ed07f];return _0x3b5ad1;};'use strict';var _=require('lodash');var util=require(_0x367e('0x0'));var logger=require(_0x367e('0x1'))(_0x367e('0x2'));var moment=require('moment');var BPromise=require(_0x367e('0x3'));var rp=require(_0x367e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x367e('0x5'));var config=require('../../config/environment');var attributes=require(_0x367e('0x6'));module[_0x367e('0x7')]=function(_0x12ce3c,_0x40638a){return _0x12ce3c[_0x367e('0x8')]('FaxApplication',attributes,{'tableName':_0x367e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x367e('0xa'),'collate':_0x367e('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 15cad35..d280d9a 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 _0x53cf=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','FaxApplication,\x20%s,\x20%s','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','limit','lodash','util'];(function(_0x4e5552,_0x19ec4e){var _0x60a338=function(_0x40c70e){while(--_0x40c70e){_0x4e5552['push'](_0x4e5552['shift']());}};_0x60a338(++_0x19ec4e);}(_0x53cf,0x1b0));var _0xf53c=function(_0xbca3b8,_0x220ac6){_0xbca3b8=_0xbca3b8-0x0;var _0x16deb7=_0x53cf[_0xbca3b8];return _0x16deb7;};'use strict';var _=require(_0xf53c('0x0'));var util=require(_0xf53c('0x1'));var moment=require(_0xf53c('0x2'));var BPromise=require(_0xf53c('0x3'));var rs=require(_0xf53c('0x4'));var fs=require('fs');var Redis=require(_0xf53c('0x5'));var db=require(_0xf53c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf53c('0x7'))(_0xf53c('0x8'));var config=require(_0xf53c('0x9'));var jayson=require(_0xf53c('0xa'));var client=jayson[_0xf53c('0xb')][_0xf53c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33f534,_0x129883,_0x50687d){return new BPromise(function(_0x52a320,_0x1146e0){return client['request'](_0x33f534,_0x50687d)[_0xf53c('0xd')](function(_0x44bb0a){logger[_0xf53c('0xe')]('FaxApplication,\x20%s,\x20%s',_0x129883,_0xf53c('0xf'));logger[_0xf53c('0x10')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x129883,'request\x20sent',JSON[_0xf53c('0x11')](_0x44bb0a));if(_0x44bb0a[_0xf53c('0x12')]){if(_0x44bb0a['error']['code']===0x1f4){logger[_0xf53c('0x12')](_0xf53c('0x13'),_0x129883,_0x44bb0a[_0xf53c('0x12')][_0xf53c('0x14')]);return _0x1146e0(_0x44bb0a[_0xf53c('0x12')][_0xf53c('0x14')]);}logger[_0xf53c('0x12')](_0xf53c('0x13'),_0x129883,_0x44bb0a[_0xf53c('0x12')][_0xf53c('0x14')]);return _0x52a320(_0x44bb0a[_0xf53c('0x12')]['message']);}else{logger[_0xf53c('0xe')](_0xf53c('0x13'),_0x129883,_0xf53c('0xf'));_0x52a320(_0x44bb0a[_0xf53c('0x15')][_0xf53c('0x14')]);}})[_0xf53c('0x16')](function(_0x489c3a){logger['error'](_0xf53c('0x13'),_0x129883,_0x489c3a);_0x1146e0(_0x489c3a);});});}exports[_0xf53c('0x17')]=function(_0x1de5f7){var _0x10ed2a=this;return new Promise(function(_0x50d120,_0x3c64b7){return db[_0xf53c('0x18')][_0xf53c('0x19')](_0x1de5f7[_0xf53c('0x1a')],{'raw':_0x1de5f7[_0xf53c('0x1b')]?_0x1de5f7[_0xf53c('0x1b')][_0xf53c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1de5f7[_0xf53c('0x1b')]?_0x1de5f7[_0xf53c('0x1b')][_0xf53c('0x1d')]||null:null,'attributes':_0x1de5f7[_0xf53c('0x1b')]?_0x1de5f7[_0xf53c('0x1b')]['attributes']||null:null,'limit':_0x1de5f7[_0xf53c('0x1b')]?_0x1de5f7[_0xf53c('0x1b')][_0xf53c('0x1e')]||null:null})[_0xf53c('0xd')](function(_0x90e4f1){logger[_0xf53c('0xe')](_0xf53c('0x17'),_0x1de5f7);logger['debug'](_0xf53c('0x17'),_0x1de5f7,JSON[_0xf53c('0x11')](_0x90e4f1));_0x50d120(_0x90e4f1);})[_0xf53c('0x16')](function(_0x2dab5a){logger[_0xf53c('0x12')](_0xf53c('0x17'),_0x2dab5a['message'],_0x1de5f7);_0x3c64b7(_0x10ed2a['error'](0x1f4,_0x2dab5a[_0xf53c('0x14')]));});});}; \ No newline at end of file +var _0x1522=['http','request','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','UpdateFaxApplication','FaxApplication','body','options','raw','where','attributes','limit','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x236f12,_0x4c7faf){var _0x32969a=function(_0x3a3e1d){while(--_0x3a3e1d){_0x236f12['push'](_0x236f12['shift']());}};_0x32969a(++_0x4c7faf);}(_0x1522,0x95));var _0x2152=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1522[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2152('0x0'));var util=require(_0x2152('0x1'));var moment=require(_0x2152('0x2'));var BPromise=require(_0x2152('0x3'));var rs=require(_0x2152('0x4'));var fs=require('fs');var Redis=require(_0x2152('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2152('0x6'));var logger=require(_0x2152('0x7'))(_0x2152('0x8'));var config=require('../../config/environment');var jayson=require(_0x2152('0x9'));var client=jayson[_0x2152('0xa')][_0x2152('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4bbc6,_0x2b56e5,_0x21b683){return new BPromise(function(_0x51caca,_0xc547ac){return client[_0x2152('0xc')](_0x4bbc6,_0x21b683)[_0x2152('0xd')](function(_0x42454e){logger['info'](_0x2152('0xe'),_0x2b56e5,_0x2152('0xf'));logger[_0x2152('0x10')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x2b56e5,_0x2152('0xf'),JSON[_0x2152('0x11')](_0x42454e));if(_0x42454e[_0x2152('0x12')]){if(_0x42454e['error'][_0x2152('0x13')]===0x1f4){logger[_0x2152('0x12')](_0x2152('0xe'),_0x2b56e5,_0x42454e[_0x2152('0x12')][_0x2152('0x14')]);return _0xc547ac(_0x42454e['error'][_0x2152('0x14')]);}logger[_0x2152('0x12')](_0x2152('0xe'),_0x2b56e5,_0x42454e['error']['message']);return _0x51caca(_0x42454e['error'][_0x2152('0x14')]);}else{logger[_0x2152('0x15')]('FaxApplication,\x20%s,\x20%s',_0x2b56e5,_0x2152('0xf'));_0x51caca(_0x42454e[_0x2152('0x16')][_0x2152('0x14')]);}})['catch'](function(_0x40d008){logger[_0x2152('0x12')](_0x2152('0xe'),_0x2b56e5,_0x40d008);_0xc547ac(_0x40d008);});});}exports[_0x2152('0x17')]=function(_0x3ad7f2){var _0x1a5133=this;return new Promise(function(_0x3742e5,_0x24d496){return db[_0x2152('0x18')]['update'](_0x3ad7f2[_0x2152('0x19')],{'raw':_0x3ad7f2[_0x2152('0x1a')]?_0x3ad7f2[_0x2152('0x1a')][_0x2152('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ad7f2[_0x2152('0x1a')]?_0x3ad7f2['options'][_0x2152('0x1c')]||null:null,'attributes':_0x3ad7f2[_0x2152('0x1a')]?_0x3ad7f2[_0x2152('0x1a')][_0x2152('0x1d')]||null:null,'limit':_0x3ad7f2[_0x2152('0x1a')]?_0x3ad7f2['options'][_0x2152('0x1e')]||null:null})[_0x2152('0xd')](function(_0x12582f){logger['info'](_0x2152('0x17'),_0x3ad7f2);logger[_0x2152('0x10')](_0x2152('0x17'),_0x3ad7f2,JSON['stringify'](_0x12582f));_0x3742e5(_0x12582f);})[_0x2152('0x1f')](function(_0x17f1c1){logger[_0x2152('0x12')](_0x2152('0x17'),_0x17f1c1[_0x2152('0x14')],_0x3ad7f2);_0x24d496(_0x1a5133[_0x2152('0x12')](0x1f4,_0x17f1c1[_0x2152('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 8062d6e..6d779d4 100644 --- a/server/api/faxApplication/index.js +++ b/server/api/faxApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4f4=['../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x58581e,_0x3a3aef){var _0x1a0645=function(_0x3d09fc){while(--_0x3d09fc){_0x58581e['push'](_0x58581e['shift']());}};_0x1a0645(++_0x3a3aef);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x5713d5,_0x35fd3b){_0x5713d5=_0x5713d5-0x0;var _0x3fdddf=_0xf4f4[_0x5713d5];return _0x3fdddf;};'use strict';var multer=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var path=require('path');var timeout=require(_0x4f4f('0x2'));var express=require(_0x4f4f('0x3'));var router=express[_0x4f4f('0x4')]();var fs_extra=require(_0x4f4f('0x5'));var auth=require(_0x4f4f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f4f('0x7'));var controller=require('./faxApplication.controller');router[_0x4f4f('0x8')]('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xa')]);router[_0x4f4f('0x8')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xc')]);router[_0x4f4f('0xd')]('/',auth['isAuthenticated'](),controller[_0x4f4f('0xe')]);router[_0x4f4f('0xf')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x10')]);router[_0x4f4f('0x11')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe511=['/:id','isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','show','post','put'];(function(_0x5c0e79,_0x3a5fc5){var _0x1a647c=function(_0xf24522){while(--_0xf24522){_0x5c0e79['push'](_0x5c0e79['shift']());}};_0x1a647c(++_0x3a5fc5);}(_0xe511,0x16f));var _0x1e51=function(_0x15131a,_0x204bcd){_0x15131a=_0x15131a-0x0;var _0x8f309b=_0xe511[_0x15131a];return _0x8f309b;};'use strict';var multer=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var path=require('path');var timeout=require(_0x1e51('0x2'));var express=require('express');var router=express[_0x1e51('0x3')]();var fs_extra=require(_0x1e51('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var controller=require(_0x1e51('0x7'));router[_0x1e51('0x8')]('/',auth['isAuthenticated'](),controller[_0x1e51('0x9')]);router[_0x1e51('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1e51('0xa')]);router[_0x1e51('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1e51('0xc')](_0x1e51('0xd'),auth[_0x1e51('0xe')](),controller[_0x1e51('0xf')]);router[_0x1e51('0x10')](_0x1e51('0xd'),auth['isAuthenticated'](),controller[_0x1e51('0x11')]);module[_0x1e51('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index b684f22..6c72e8d 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 _0x221f=['BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x221f,0x19d));var _0xf221=function(_0x4c9d58,_0x1c83f0){_0x4c9d58=_0x4c9d58-0x0;var _0x3ad22d=_0x221f[_0x4c9d58];return _0x3ad22d;};'use strict';var Sequelize=require(_0xf221('0x0'));module['exports']={'closed':{'type':Sequelize[_0xf221('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf221('0x2')]},'disposition':{'type':Sequelize[_0xf221('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xf221('0x3')]},'note':{'type':Sequelize[_0xf221('0x3')]},'read1stAt':{'type':Sequelize[_0xf221('0x2')]},'fax':{'type':Sequelize[_0xf221('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xf221('0x4')]('in',_0xf221('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf221('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xf221('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x5074=['out','exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0x807ec1,_0x248b9f){var _0x383adb=function(_0x41378e){while(--_0x41378e){_0x807ec1['push'](_0x807ec1['shift']());}};_0x383adb(++_0x248b9f);}(_0x5074,0x1e7));var _0x4507=function(_0x4f6d08,_0x1b3dd0){_0x4f6d08=_0x4f6d08-0x0;var _0x53a9c6=_0x5074[_0x4f6d08];return _0x53a9c6;};'use strict';var Sequelize=require('sequelize');module[_0x4507('0x0')]={'closed':{'type':Sequelize[_0x4507('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x4507('0x2')]},'secondDisposition':{'type':Sequelize[_0x4507('0x2')]},'thirdDisposition':{'type':Sequelize[_0x4507('0x2')]},'note':{'type':Sequelize[_0x4507('0x2')]},'read1stAt':{'type':Sequelize[_0x4507('0x3')]},'fax':{'type':Sequelize[_0x4507('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x4507('0x4')]('in',_0x4507('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4507('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4507('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index e596b62..254e1b5 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 _0x5eec=['spread','Tag','color','emit','faxInteractionTags:save','removeTags','unix','join','root','files','server','attachments','transcript-%d-%s.zip','push','Attachment','Messages','get','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','download','log','err','unlinkSync','zip-dir','bluebird','path','lodash','ioredis','../../components/interaction/service','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','update','then','destroy','error','name','send','index','map','FaxInteraction','fieldName','type','key','getOptions','query','catch','show','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','include','find','create','body','describe','addMessage','FaxMessage','ids','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','FaxInteractionId','merge','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','addTags','setTags'];(function(_0x1f8b4b,_0x2fa500){var _0x2a8bc3=function(_0x1cb55e){while(--_0x1cb55e){_0x1f8b4b['push'](_0x1f8b4b['shift']());}};_0x2a8bc3(++_0x2fa500);}(_0x5eec,0xe7));var _0xc5ee=function(_0x59a1e0,_0x35c08a){_0x59a1e0=_0x59a1e0-0x0;var _0x369422=_0x5eec[_0x59a1e0];return _0x369422;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xc5ee('0x0'));var moment=require('moment');var BPromise=require(_0xc5ee('0x1'));var util=require('util');var path=require(_0xc5ee('0x2'));var fs=require('fs');var _=require(_0xc5ee('0x3'));var Redis=require(_0xc5ee('0x4'));var interaction=require(_0xc5ee('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0xc5ee('0x6'))(_0xc5ee('0x7'));var config=require('../../config/environment');var db=require(_0xc5ee('0x8'))['db'];config[_0xc5ee('0x9')]=_[_0xc5ee('0xa')](config[_0xc5ee('0x9')],{'host':_0xc5ee('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc5ee('0x9')]));require(_0xc5ee('0xc'))[_0xc5ee('0xd')](socket);function respondWithStatusCode(_0x4aa4fd,_0xba59e){_0xba59e=_0xba59e||0xcc;return function(_0x5a7ed3){if(_0x5a7ed3){return _0x4aa4fd[_0xc5ee('0xe')](_0xba59e);}return _0x4aa4fd['status'](_0xba59e)[_0xc5ee('0xf')]();};}function respondWithResult(_0x1306fb,_0x33541a){_0x33541a=_0x33541a||0xc8;return function(_0x3de156){if(_0x3de156){return _0x1306fb[_0xc5ee('0x10')](_0x33541a)[_0xc5ee('0x11')](_0x3de156);}};}function respondWithFilteredResult(_0x13ee92,_0x2c77ef){return function(_0x59074b){if(_0x59074b){var _0x1d55a3=typeof _0x2c77ef['offset']===_0xc5ee('0x12')&&typeof _0x2c77ef[_0xc5ee('0x13')]===_0xc5ee('0x12');var _0x38e1ce=_0x59074b[_0xc5ee('0x14')];var _0x514164=_0x1d55a3?0x0:_0x2c77ef[_0xc5ee('0x15')];var _0x2e50ba=_0x1d55a3?_0x59074b[_0xc5ee('0x14')]:_0x2c77ef[_0xc5ee('0x15')]+_0x2c77ef['limit'];var _0x32097a;if(_0x2e50ba>=_0x38e1ce){_0x2e50ba=_0x38e1ce;_0x32097a=0xc8;}else{_0x32097a=0xce;}_0x13ee92[_0xc5ee('0x10')](_0x32097a);return _0x13ee92[_0xc5ee('0x16')]('Content-Range',_0x514164+'-'+_0x2e50ba+'/'+_0x38e1ce)[_0xc5ee('0x11')](_0x59074b);}return null;};}function saveUpdates(_0x1a54f1){return function(_0x261f1e){if(_0x261f1e){return _0x261f1e[_0xc5ee('0x17')](_0x1a54f1)[_0xc5ee('0x18')](function(_0x2237ef){return _0x2237ef;});}return null;};}function removeEntity(_0x1074c5){return function(_0x6a30f8){if(_0x6a30f8){return _0x6a30f8[_0xc5ee('0x19')]()['then'](function(){_0x1074c5[_0xc5ee('0x10')](0xcc)[_0xc5ee('0xf')]();});}};}function handleEntityNotFound(_0x30312e){return function(_0x64b417){if(!_0x64b417){_0x30312e[_0xc5ee('0xe')](0x194);}return _0x64b417;};}function handleError(_0x4d6cc8,_0x4e14ab){_0x4e14ab=_0x4e14ab||0x1f4;return function(_0x56d084){logger[_0xc5ee('0x1a')](_0x56d084['stack']);if(_0x56d084[_0xc5ee('0x1b')]){delete _0x56d084[_0xc5ee('0x1b')];}_0x4d6cc8[_0xc5ee('0x10')](_0x4e14ab)[_0xc5ee('0x1c')](_0x56d084);};}exports[_0xc5ee('0x1d')]=function(_0x67f8c7,_0x10e71b){var _0x10a8e0={};var _0x5b2cfc=_[_0xc5ee('0x1e')](db[_0xc5ee('0x1f')]['rawAttributes'],function(_0x2430db){return{'name':_0x2430db[_0xc5ee('0x20')],'type':_0x2430db[_0xc5ee('0x21')][_0xc5ee('0x22')]};});_0x10a8e0=qs[_0xc5ee('0x23')](_0x5b2cfc,_0x67f8c7);return interaction['findAll']('fax',_0x67f8c7[_0xc5ee('0x24')],_0x67f8c7['user'],_0x10a8e0,_0x5b2cfc)[_0xc5ee('0x18')](respondWithFilteredResult(_0x10e71b,_0x10a8e0))[_0xc5ee('0x25')](handleError(_0x10e71b,null));};exports[_0xc5ee('0x26')]=function(_0xae65a0,_0xfbcc97){var _0x5f382d={'raw':![],'where':{'id':_0xae65a0[_0xc5ee('0x27')]['id']}},_0x1abd13={};_0x1abd13[_0xc5ee('0x28')]=_[_0xc5ee('0x29')](db[_0xc5ee('0x1f')][_0xc5ee('0x2a')]);_0x1abd13[_0xc5ee('0x24')]=_[_0xc5ee('0x29')](_0xae65a0[_0xc5ee('0x24')]);_0x1abd13[_0xc5ee('0x2b')]=_[_0xc5ee('0x2c')](_0x1abd13[_0xc5ee('0x28')],_0x1abd13[_0xc5ee('0x24')]);_0x5f382d[_0xc5ee('0x2d')]=_[_0xc5ee('0x2c')](_0x1abd13[_0xc5ee('0x28')],qs[_0xc5ee('0x2e')](_0xae65a0[_0xc5ee('0x24')][_0xc5ee('0x2e')]));_0x5f382d[_0xc5ee('0x2d')]=_0x5f382d['attributes'][_0xc5ee('0x2f')]?_0x5f382d['attributes']:_0x1abd13['model'];if(_0xae65a0['query'][_0xc5ee('0x30')]){_0x5f382d[_0xc5ee('0x31')]=[{'all':!![]}];}_0x5f382d=_['merge']({},_0x5f382d,_0xae65a0['options']);return db[_0xc5ee('0x1f')][_0xc5ee('0x32')](_0x5f382d)[_0xc5ee('0x18')](handleEntityNotFound(_0xfbcc97,null))['then'](respondWithResult(_0xfbcc97,null))[_0xc5ee('0x25')](handleError(_0xfbcc97,null));};exports[_0xc5ee('0x33')]=function(_0x3a0a09,_0x3c533b){return db[_0xc5ee('0x1f')][_0xc5ee('0x33')](_0x3a0a09[_0xc5ee('0x34')],{})[_0xc5ee('0x18')](respondWithResult(_0x3c533b,0xc9))['catch'](handleError(_0x3c533b,null));};exports[_0xc5ee('0x17')]=function(_0x421f14,_0x2c0059){if(_0x421f14[_0xc5ee('0x34')]['id']){delete _0x421f14[_0xc5ee('0x34')]['id'];}return db[_0xc5ee('0x1f')][_0xc5ee('0x32')]({'where':{'id':_0x421f14['params']['id']}})[_0xc5ee('0x18')](handleEntityNotFound(_0x2c0059,null))[_0xc5ee('0x18')](saveUpdates(_0x421f14[_0xc5ee('0x34')],null))[_0xc5ee('0x18')](respondWithResult(_0x2c0059,null))['catch'](handleError(_0x2c0059,null));};exports[_0xc5ee('0x19')]=function(_0x3ca388,_0x5e76d8){return db[_0xc5ee('0x1f')][_0xc5ee('0x32')]({'where':{'id':_0x3ca388[_0xc5ee('0x27')]['id']}})[_0xc5ee('0x18')](handleEntityNotFound(_0x5e76d8,null))[_0xc5ee('0x18')](removeEntity(_0x5e76d8,null))[_0xc5ee('0x25')](handleError(_0x5e76d8,null));};exports[_0xc5ee('0x35')]=function(_0x4f74d4,_0xe9d03f){return db[_0xc5ee('0x1f')][_0xc5ee('0x35')]()[_0xc5ee('0x18')](respondWithResult(_0xe9d03f,null))[_0xc5ee('0x25')](handleError(_0xe9d03f,null));};exports[_0xc5ee('0x36')]=function(_0x197c6c,_0x29e914){return db[_0xc5ee('0x37')]['find']({'where':{'id':_0x197c6c['params']['id']}})[_0xc5ee('0x18')](handleEntityNotFound(_0x29e914,null))[_0xc5ee('0x18')](function(_0x53ad47){if(_0x53ad47){return _0x53ad47[_0xc5ee('0x36')](_0x197c6c[_0xc5ee('0x34')][_0xc5ee('0x38')],_['omit'](_0x197c6c[_0xc5ee('0x34')],[_0xc5ee('0x38'),'id'])||{});}})[_0xc5ee('0x18')](respondWithResult(_0x29e914,null))[_0xc5ee('0x25')](handleError(_0x29e914,null));};exports[_0xc5ee('0x39')]=function(_0x3bfef0,_0x2eccc3){var _0x3b075c={'raw':![],'where':{}};var _0x22739b={};var _0x4786f6={'count':0x0,'rows':[]};return db['FaxInteraction']['findOne']({'where':{'id':_0x3bfef0[_0xc5ee('0x27')]['id']}})[_0xc5ee('0x18')](handleEntityNotFound(_0x2eccc3,null))[_0xc5ee('0x18')](function(_0xd46ba){if(_0xd46ba){_0x22739b[_0xc5ee('0x28')]=_['keys'](db[_0xc5ee('0x37')]['rawAttributes']);_0x22739b[_0xc5ee('0x24')]=_['keys'](_0x3bfef0['query']);_0x22739b[_0xc5ee('0x2b')]=_[_0xc5ee('0x2c')](_0x22739b['model'],_0x22739b['query']);_0x3b075c['attributes']=_[_0xc5ee('0x2c')](_0x22739b[_0xc5ee('0x28')],qs[_0xc5ee('0x2e')](_0x3bfef0[_0xc5ee('0x24')][_0xc5ee('0x2e')]));_0x3b075c[_0xc5ee('0x2d')]=_0x3b075c[_0xc5ee('0x2d')][_0xc5ee('0x2f')]?_0x3b075c['attributes']:_0x22739b[_0xc5ee('0x28')];if(!_0x3bfef0[_0xc5ee('0x24')][_0xc5ee('0x3a')](_0xc5ee('0x3b'))){_0x3b075c[_0xc5ee('0x13')]=qs[_0xc5ee('0x13')](_0x3bfef0[_0xc5ee('0x24')][_0xc5ee('0x13')]);_0x3b075c[_0xc5ee('0x15')]=qs[_0xc5ee('0x15')](_0x3bfef0['query']['offset']);}_0x3b075c[_0xc5ee('0x3c')]=qs[_0xc5ee('0x3d')](_0x3bfef0[_0xc5ee('0x24')][_0xc5ee('0x3d')]);_0x3b075c[_0xc5ee('0x3e')]=qs['filters'](_[_0xc5ee('0x3f')](_0x3bfef0['query'],_0x22739b[_0xc5ee('0x2b')]));_0x3b075c[_0xc5ee('0x3e')][_0xc5ee('0x40')]=_0xd46ba['id'];if(_0x3bfef0[_0xc5ee('0x24')]['filter']){_0x3b075c[_0xc5ee('0x3e')]=_[_0xc5ee('0x41')](_0x3b075c['where'],{'$or':_['map'](_0x3b075c['attributes'],function(_0x1a58ca){var _0x451b7f={};_0x451b7f[_0x1a58ca]={'$like':'%'+_0x3bfef0[_0xc5ee('0x24')][_0xc5ee('0x42')]+'%'};return _0x451b7f;})});}if(_0x3bfef0[_0xc5ee('0x24')][_0xc5ee('0x43')]){var _0x3bf394=_0x3bfef0[_0xc5ee('0x24')]['$gte']['split'](',');var _0x2c7387={};_0x2c7387[_0x3bf394[0x0]]={'$gte':moment(_0x3bf394[0x1])[_0xc5ee('0x44')](_0xc5ee('0x45'))};_0x3b075c[_0xc5ee('0x3e')]=_[_0xc5ee('0x41')](_0x3b075c[_0xc5ee('0x3e')],_0x2c7387);}_0x3b075c=_[_0xc5ee('0x41')]({},_0x3b075c,_0x3bfef0[_0xc5ee('0x46')]);return db[_0xc5ee('0x37')]['count']({'where':_0x3b075c['where']})[_0xc5ee('0x18')](function(_0x939256){_0x4786f6[_0xc5ee('0x14')]=_0x939256;if(_0x3bfef0[_0xc5ee('0x24')][_0xc5ee('0x30')]){_0x3b075c['include']=[{'all':!![]}];}return db['FaxMessage'][_0xc5ee('0x47')](_0x3b075c);})[_0xc5ee('0x18')](function(_0x1c379a){_0x4786f6[_0xc5ee('0x48')]=_0x1c379a;return _0x4786f6;});}})[_0xc5ee('0x18')](respondWithFilteredResult(_0x2eccc3,_0x3b075c))[_0xc5ee('0x25')](handleError(_0x2eccc3,null));};exports[_0xc5ee('0x49')]=function(_0x3175d0,_0x5db64c){return db['FaxInteraction'][_0xc5ee('0x32')]({'where':{'id':_0x3175d0[_0xc5ee('0x27')]['id']}})[_0xc5ee('0x18')](handleEntityNotFound(_0x5db64c,null))['then'](function(_0x5abe78){if(_0x5abe78){return _0x5abe78[_0xc5ee('0x4a')](_0x3175d0[_0xc5ee('0x34')][_0xc5ee('0x38')],_['omit'](_0x3175d0[_0xc5ee('0x34')],['ids','id'])||{})[_0xc5ee('0x4b')](function(){return db[_0xc5ee('0x4c')][_0xc5ee('0x47')]({'attributes':['id','name',_0xc5ee('0x4d')],'where':{'id':_0x3175d0[_0xc5ee('0x34')][_0xc5ee('0x38')]}});})[_0xc5ee('0x18')](function(_0x37aefa){socket[_0xc5ee('0x4e')](_0xc5ee('0x4f'),{'id':Number(_0x3175d0[_0xc5ee('0x27')]['id']),'tags':_0x37aefa||[]});return{'id':Number(_0x3175d0[_0xc5ee('0x27')]['id']),'tags':_0x37aefa||[]};});}})['then'](respondWithResult(_0x5db64c,null))[_0xc5ee('0x25')](handleError(_0x5db64c,null));};exports[_0xc5ee('0x50')]=function(_0x5e5f44,_0x48eda3){return db[_0xc5ee('0x1f')][_0xc5ee('0x32')]({'where':{'id':_0x5e5f44['params']['id']}})[_0xc5ee('0x18')](handleEntityNotFound(_0x48eda3,null))['then'](function(_0x2a76d8){if(_0x2a76d8){return _0x2a76d8[_0xc5ee('0x50')](_0x5e5f44[_0xc5ee('0x24')][_0xc5ee('0x38')]);}})[_0xc5ee('0x18')](respondWithStatusCode(_0x48eda3,null))[_0xc5ee('0x25')](handleError(_0x48eda3,null));};exports['download']=function(_0x32cd8c,_0x3df35a){var _0x460d65=moment()[_0xc5ee('0x51')]()['toString']();var _0x3b7537=path[_0xc5ee('0x52')](config[_0xc5ee('0x53')],'server',_0xc5ee('0x54'),'tmp');var _0x215ec3=path['join'](config[_0xc5ee('0x53')],_0xc5ee('0x55'),_0xc5ee('0x54'),_0xc5ee('0x56'));var _0x16e604=path[_0xc5ee('0x52')](_0x3b7537,_0x460d65);var _0x3d3372=util[_0xc5ee('0x44')](_0xc5ee('0x57'),_0x32cd8c[_0xc5ee('0x27')]['id'],_0x460d65);var _0x55e00b=path[_0xc5ee('0x52')](_0x3b7537,_0x3d3372);var _0x36d4b9=[];_0x36d4b9[_0xc5ee('0x58')]({'model':db[_0xc5ee('0x59')],'as':_0xc5ee('0x59'),'raw':!![]});var _0x364cc0=[{'model':db[_0xc5ee('0x37')],'as':_0xc5ee('0x5a'),'attributes':['id','body','createdAt'],'include':_0x36d4b9}];return db[_0xc5ee('0x1f')][_0xc5ee('0x32')]({'where':{'id':_0x32cd8c[_0xc5ee('0x27')]['id']},'include':_0x364cc0})[_0xc5ee('0x18')](handleEntityNotFound(_0x3df35a,null))[_0xc5ee('0x18')](function(_0x41d4c9){if(_0x41d4c9&&_0x41d4c9[_0xc5ee('0x5a')]){var _0x4e5477=_0x41d4c9[_0xc5ee('0x5b')]({'plain':!![]});fs['mkdirSync'](_0x16e604);for(var _0x366b05=0x0;_0x366b05<_0x4e5477[_0xc5ee('0x5a')][_0xc5ee('0x2f')];_0x366b05++){var _0xde76d=_0x4e5477[_0xc5ee('0x5a')][_0x366b05][_0xc5ee('0x59')];if(_0xde76d){var _0x2e1f6e=path[_0xc5ee('0x52')](_0x215ec3,_0xde76d[_0xc5ee('0x5c')]);if(fs[_0xc5ee('0x5d')](_0x2e1f6e)){fs[_0xc5ee('0x5e')](_0x2e1f6e)[_0xc5ee('0x5f')](fs[_0xc5ee('0x60')](path[_0xc5ee('0x52')](_0x16e604,_0xde76d[_0xc5ee('0x5c')])));}}}return BPromise[_0xc5ee('0x61')]()[_0xc5ee('0x18')](function(){return new BPromise(function(_0x440085,_0x4486f2){zipdir(_0x16e604,{'saveTo':_0x55e00b},function(_0x3f65d1,_0x4735c4){if(_0x3f65d1)return _0x4486f2(_0x3f65d1);return _0x440085(_0x4735c4);});})[_0xc5ee('0x18')](function(){return new BPromise(function(_0x4f6b94,_0x246e9e){rimraf(_0x16e604,function(_0xa2a96a){if(_0xa2a96a)_0x246e9e(_0xa2a96a);return _0x4f6b94();});});})[_0xc5ee('0x18')](function(){return _0x3df35a[_0xc5ee('0x62')](_0x55e00b,_0x3d3372,function(_0xfc8e41){if(_0xfc8e41){console[_0xc5ee('0x63')](_0xc5ee('0x64'),_0xfc8e41);}else{fs[_0xc5ee('0x65')](_0x55e00b);}});});});}else{return _0x3df35a[_0xc5ee('0xe')](0xc8);}})[_0xc5ee('0x25')](handleError(_0x3df35a,null));}; \ No newline at end of file +var _0xc27b=['update','describe','FaxMessage','addMessage','ids','omit','getMessages','findOne','length','hasOwnProperty','nolimit','order','sort','where','FaxInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','merge','options','findAll','rows','addTags','setTags','spread','color','emit','faxInteractionTags:save','removeTags','download','unix','root','server','files','join','attachments','format','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','mkdirSync','basename','existsSync','createReadStream','resolve','err','unlinkSync','rimraf','zip-dir','moment','bluebird','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','then','destroy','sendStatus','error','stack','name','index','map','FaxInteraction','rawAttributes','fieldName','key','getOptions','query','user','catch','show','params','keys','filters','intersection','model','fields','attributes','includeAll','include','find','create','body'];(function(_0x4ba380,_0x259bee){var _0x4b111b=function(_0x2bf227){while(--_0x2bf227){_0x4ba380['push'](_0x4ba380['shift']());}};_0x4b111b(++_0x259bee);}(_0xc27b,0x9c));var _0xbc27=function(_0x579c21,_0xe642a){_0x579c21=_0x579c21-0x0;var _0x12aa22=_0xc27b[_0x579c21];return _0x12aa22;};'use strict';var rimraf=require(_0xbc27('0x0'));var zipdir=require(_0xbc27('0x1'));var moment=require(_0xbc27('0x2'));var BPromise=require(_0xbc27('0x3'));var util=require('util');var path=require(_0xbc27('0x4'));var fs=require('fs');var _=require(_0xbc27('0x5'));var Redis=require('ioredis');var interaction=require(_0xbc27('0x6'));var qs=require(_0xbc27('0x7'));var logger=require(_0xbc27('0x8'))(_0xbc27('0x9'));var config=require(_0xbc27('0xa'));var db=require(_0xbc27('0xb'))['db'];config[_0xbc27('0xc')]=_[_0xbc27('0xd')](config[_0xbc27('0xc')],{'host':_0xbc27('0xe'),'port':0x18eb});var socket=require(_0xbc27('0xf'))(new Redis(config[_0xbc27('0xc')]));require(_0xbc27('0x10'))[_0xbc27('0x11')](socket);function respondWithStatusCode(_0x5817f7,_0x3a2e3e){_0x3a2e3e=_0x3a2e3e||0xcc;return function(_0x162d80){if(_0x162d80){return _0x5817f7['sendStatus'](_0x3a2e3e);}return _0x5817f7[_0xbc27('0x12')](_0x3a2e3e)[_0xbc27('0x13')]();};}function respondWithResult(_0x2c1652,_0x57c940){_0x57c940=_0x57c940||0xc8;return function(_0x1dbb6f){if(_0x1dbb6f){return _0x2c1652[_0xbc27('0x12')](_0x57c940)[_0xbc27('0x14')](_0x1dbb6f);}};}function respondWithFilteredResult(_0x1d67fc,_0x16b965){return function(_0x2c8a6a){if(_0x2c8a6a){var _0x19e1c7=typeof _0x16b965[_0xbc27('0x15')]==='undefined'&&typeof _0x16b965[_0xbc27('0x16')]===_0xbc27('0x17');var _0x2ed457=_0x2c8a6a[_0xbc27('0x18')];var _0xa36cae=_0x19e1c7?0x0:_0x16b965['offset'];var _0x2c50f6=_0x19e1c7?_0x2c8a6a[_0xbc27('0x18')]:_0x16b965['offset']+_0x16b965[_0xbc27('0x16')];var _0x30cfae;if(_0x2c50f6>=_0x2ed457){_0x2c50f6=_0x2ed457;_0x30cfae=0xc8;}else{_0x30cfae=0xce;}_0x1d67fc[_0xbc27('0x12')](_0x30cfae);return _0x1d67fc[_0xbc27('0x19')](_0xbc27('0x1a'),_0xa36cae+'-'+_0x2c50f6+'/'+_0x2ed457)[_0xbc27('0x14')](_0x2c8a6a);}return null;};}function saveUpdates(_0x5afa28){return function(_0x157c57){if(_0x157c57){return _0x157c57['update'](_0x5afa28)[_0xbc27('0x1b')](function(_0x22cee0){return _0x22cee0;});}return null;};}function removeEntity(_0x5179e9){return function(_0x496f68){if(_0x496f68){return _0x496f68[_0xbc27('0x1c')]()[_0xbc27('0x1b')](function(){_0x5179e9[_0xbc27('0x12')](0xcc)[_0xbc27('0x13')]();});}};}function handleEntityNotFound(_0x44473e){return function(_0x2a4a03){if(!_0x2a4a03){_0x44473e[_0xbc27('0x1d')](0x194);}return _0x2a4a03;};}function handleError(_0x22f7fa,_0x3eb0be){_0x3eb0be=_0x3eb0be||0x1f4;return function(_0x44ad14){logger[_0xbc27('0x1e')](_0x44ad14[_0xbc27('0x1f')]);if(_0x44ad14[_0xbc27('0x20')]){delete _0x44ad14[_0xbc27('0x20')];}_0x22f7fa['status'](_0x3eb0be)['send'](_0x44ad14);};}exports[_0xbc27('0x21')]=function(_0x20e978,_0x2cbe69){var _0x685df={};var _0x38b3b1=_[_0xbc27('0x22')](db[_0xbc27('0x23')][_0xbc27('0x24')],function(_0x1ec0d2){return{'name':_0x1ec0d2[_0xbc27('0x25')],'type':_0x1ec0d2['type'][_0xbc27('0x26')]};});_0x685df=qs[_0xbc27('0x27')](_0x38b3b1,_0x20e978);return interaction['findAll']('fax',_0x20e978[_0xbc27('0x28')],_0x20e978[_0xbc27('0x29')],_0x685df,_0x38b3b1)['then'](respondWithFilteredResult(_0x2cbe69,_0x685df))[_0xbc27('0x2a')](handleError(_0x2cbe69,null));};exports[_0xbc27('0x2b')]=function(_0x241415,_0x78d7ac){var _0x3444a9={'raw':![],'where':{'id':_0x241415[_0xbc27('0x2c')]['id']}},_0x44b7f3={};_0x44b7f3['model']=_['keys'](db['FaxInteraction'][_0xbc27('0x24')]);_0x44b7f3[_0xbc27('0x28')]=_[_0xbc27('0x2d')](_0x241415[_0xbc27('0x28')]);_0x44b7f3[_0xbc27('0x2e')]=_[_0xbc27('0x2f')](_0x44b7f3['model'],_0x44b7f3[_0xbc27('0x28')]);_0x3444a9['attributes']=_[_0xbc27('0x2f')](_0x44b7f3[_0xbc27('0x30')],qs[_0xbc27('0x31')](_0x241415['query'][_0xbc27('0x31')]));_0x3444a9[_0xbc27('0x32')]=_0x3444a9[_0xbc27('0x32')]['length']?_0x3444a9[_0xbc27('0x32')]:_0x44b7f3['model'];if(_0x241415[_0xbc27('0x28')][_0xbc27('0x33')]){_0x3444a9[_0xbc27('0x34')]=[{'all':!![]}];}_0x3444a9=_['merge']({},_0x3444a9,_0x241415['options']);return db[_0xbc27('0x23')][_0xbc27('0x35')](_0x3444a9)[_0xbc27('0x1b')](handleEntityNotFound(_0x78d7ac,null))[_0xbc27('0x1b')](respondWithResult(_0x78d7ac,null))[_0xbc27('0x2a')](handleError(_0x78d7ac,null));};exports[_0xbc27('0x36')]=function(_0xc3270a,_0x3d4b64){return db[_0xbc27('0x23')][_0xbc27('0x36')](_0xc3270a[_0xbc27('0x37')],{})[_0xbc27('0x1b')](respondWithResult(_0x3d4b64,0xc9))[_0xbc27('0x2a')](handleError(_0x3d4b64,null));};exports[_0xbc27('0x38')]=function(_0x17beea,_0x5cf2e9){if(_0x17beea['body']['id']){delete _0x17beea[_0xbc27('0x37')]['id'];}return db[_0xbc27('0x23')][_0xbc27('0x35')]({'where':{'id':_0x17beea['params']['id']}})[_0xbc27('0x1b')](handleEntityNotFound(_0x5cf2e9,null))[_0xbc27('0x1b')](saveUpdates(_0x17beea[_0xbc27('0x37')],null))[_0xbc27('0x1b')](respondWithResult(_0x5cf2e9,null))[_0xbc27('0x2a')](handleError(_0x5cf2e9,null));};exports[_0xbc27('0x1c')]=function(_0x48b858,_0x566f2c){return db[_0xbc27('0x23')][_0xbc27('0x35')]({'where':{'id':_0x48b858[_0xbc27('0x2c')]['id']}})[_0xbc27('0x1b')](handleEntityNotFound(_0x566f2c,null))['then'](removeEntity(_0x566f2c,null))['catch'](handleError(_0x566f2c,null));};exports[_0xbc27('0x39')]=function(_0x5f30e9,_0x429a44){return db[_0xbc27('0x23')][_0xbc27('0x39')]()[_0xbc27('0x1b')](respondWithResult(_0x429a44,null))['catch'](handleError(_0x429a44,null));};exports['addMessage']=function(_0x11a287,_0x4ff43e){return db[_0xbc27('0x3a')][_0xbc27('0x35')]({'where':{'id':_0x11a287['params']['id']}})[_0xbc27('0x1b')](handleEntityNotFound(_0x4ff43e,null))['then'](function(_0x5000ba){if(_0x5000ba){return _0x5000ba[_0xbc27('0x3b')](_0x11a287[_0xbc27('0x37')][_0xbc27('0x3c')],_[_0xbc27('0x3d')](_0x11a287[_0xbc27('0x37')],[_0xbc27('0x3c'),'id'])||{});}})[_0xbc27('0x1b')](respondWithResult(_0x4ff43e,null))[_0xbc27('0x2a')](handleError(_0x4ff43e,null));};exports[_0xbc27('0x3e')]=function(_0x428034,_0xf5ae4f){var _0x465522={'raw':![],'where':{}};var _0x5c4e4d={};var _0x5d6338={'count':0x0,'rows':[]};return db[_0xbc27('0x23')][_0xbc27('0x3f')]({'where':{'id':_0x428034[_0xbc27('0x2c')]['id']}})[_0xbc27('0x1b')](handleEntityNotFound(_0xf5ae4f,null))[_0xbc27('0x1b')](function(_0x61fd97){if(_0x61fd97){_0x5c4e4d[_0xbc27('0x30')]=_[_0xbc27('0x2d')](db['FaxMessage']['rawAttributes']);_0x5c4e4d[_0xbc27('0x28')]=_[_0xbc27('0x2d')](_0x428034[_0xbc27('0x28')]);_0x5c4e4d[_0xbc27('0x2e')]=_[_0xbc27('0x2f')](_0x5c4e4d['model'],_0x5c4e4d[_0xbc27('0x28')]);_0x465522[_0xbc27('0x32')]=_['intersection'](_0x5c4e4d[_0xbc27('0x30')],qs[_0xbc27('0x31')](_0x428034[_0xbc27('0x28')]['fields']));_0x465522['attributes']=_0x465522['attributes'][_0xbc27('0x40')]?_0x465522[_0xbc27('0x32')]:_0x5c4e4d['model'];if(!_0x428034[_0xbc27('0x28')][_0xbc27('0x41')](_0xbc27('0x42'))){_0x465522[_0xbc27('0x16')]=qs[_0xbc27('0x16')](_0x428034[_0xbc27('0x28')][_0xbc27('0x16')]);_0x465522[_0xbc27('0x15')]=qs[_0xbc27('0x15')](_0x428034[_0xbc27('0x28')][_0xbc27('0x15')]);}_0x465522[_0xbc27('0x43')]=qs[_0xbc27('0x44')](_0x428034['query']['sort']);_0x465522[_0xbc27('0x45')]=qs[_0xbc27('0x2e')](_['pick'](_0x428034[_0xbc27('0x28')],_0x5c4e4d['filters']));_0x465522[_0xbc27('0x45')][_0xbc27('0x46')]=_0x61fd97['id'];if(_0x428034[_0xbc27('0x28')][_0xbc27('0x47')]){_0x465522['where']=_['merge'](_0x465522['where'],{'$or':_['map'](_0x465522['attributes'],function(_0x9bda8a){var _0x46f6ff={};_0x46f6ff[_0x9bda8a]={'$like':'%'+_0x428034[_0xbc27('0x28')][_0xbc27('0x47')]+'%'};return _0x46f6ff;})});}if(_0x428034[_0xbc27('0x28')][_0xbc27('0x48')]){var _0x48d43e=_0x428034['query']['$gte'][_0xbc27('0x49')](',');var _0x4323de={};_0x4323de[_0x48d43e[0x0]]={'$gte':moment(_0x48d43e[0x1])['format'](_0xbc27('0x4a'))};_0x465522['where']=_[_0xbc27('0x4b')](_0x465522[_0xbc27('0x45')],_0x4323de);}_0x465522=_[_0xbc27('0x4b')]({},_0x465522,_0x428034[_0xbc27('0x4c')]);return db[_0xbc27('0x3a')][_0xbc27('0x18')]({'where':_0x465522[_0xbc27('0x45')]})[_0xbc27('0x1b')](function(_0x2b0e58){_0x5d6338[_0xbc27('0x18')]=_0x2b0e58;if(_0x428034[_0xbc27('0x28')][_0xbc27('0x33')]){_0x465522[_0xbc27('0x34')]=[{'all':!![]}];}return db['FaxMessage'][_0xbc27('0x4d')](_0x465522);})[_0xbc27('0x1b')](function(_0x5718db){_0x5d6338[_0xbc27('0x4e')]=_0x5718db;return _0x5d6338;});}})[_0xbc27('0x1b')](respondWithFilteredResult(_0xf5ae4f,_0x465522))['catch'](handleError(_0xf5ae4f,null));};exports[_0xbc27('0x4f')]=function(_0x2aac95,_0x48d672){return db['FaxInteraction'][_0xbc27('0x35')]({'where':{'id':_0x2aac95[_0xbc27('0x2c')]['id']}})[_0xbc27('0x1b')](handleEntityNotFound(_0x48d672,null))['then'](function(_0x4f4bbe){if(_0x4f4bbe){return _0x4f4bbe[_0xbc27('0x50')](_0x2aac95['body'][_0xbc27('0x3c')],_['omit'](_0x2aac95['body'],[_0xbc27('0x3c'),'id'])||{})[_0xbc27('0x51')](function(){return db['Tag'][_0xbc27('0x4d')]({'attributes':['id',_0xbc27('0x20'),_0xbc27('0x52')],'where':{'id':_0x2aac95[_0xbc27('0x37')][_0xbc27('0x3c')]}});})['then'](function(_0x4d64e3){socket[_0xbc27('0x53')](_0xbc27('0x54'),{'id':Number(_0x2aac95['params']['id']),'tags':_0x4d64e3||[]});return{'id':Number(_0x2aac95['params']['id']),'tags':_0x4d64e3||[]};});}})[_0xbc27('0x1b')](respondWithResult(_0x48d672,null))[_0xbc27('0x2a')](handleError(_0x48d672,null));};exports[_0xbc27('0x55')]=function(_0x5c8e3d,_0x30472d){return db[_0xbc27('0x23')][_0xbc27('0x35')]({'where':{'id':_0x5c8e3d[_0xbc27('0x2c')]['id']}})[_0xbc27('0x1b')](handleEntityNotFound(_0x30472d,null))['then'](function(_0x58f187){if(_0x58f187){return _0x58f187[_0xbc27('0x55')](_0x5c8e3d[_0xbc27('0x28')]['ids']);}})['then'](respondWithStatusCode(_0x30472d,null))[_0xbc27('0x2a')](handleError(_0x30472d,null));};exports[_0xbc27('0x56')]=function(_0x3c4e87,_0x5dbb3f){var _0x5b4bff=moment()[_0xbc27('0x57')]()['toString']();var _0x4d8b24=path['join'](config[_0xbc27('0x58')],_0xbc27('0x59'),_0xbc27('0x5a'),'tmp');var _0xa81a5e=path[_0xbc27('0x5b')](config[_0xbc27('0x58')],_0xbc27('0x59'),'files',_0xbc27('0x5c'));var _0x16b58f=path[_0xbc27('0x5b')](_0x4d8b24,_0x5b4bff);var _0x41c839=util[_0xbc27('0x5d')](_0xbc27('0x5e'),_0x3c4e87[_0xbc27('0x2c')]['id'],_0x5b4bff);var _0x4c96aa=path[_0xbc27('0x5b')](_0x4d8b24,_0x41c839);var _0x2c60f7=[];_0x2c60f7[_0xbc27('0x5f')]({'model':db[_0xbc27('0x60')],'as':'Attachment','raw':!![]});var _0x10a185=[{'model':db[_0xbc27('0x3a')],'as':_0xbc27('0x61'),'attributes':['id',_0xbc27('0x37'),_0xbc27('0x62')],'include':_0x2c60f7}];return db[_0xbc27('0x23')][_0xbc27('0x35')]({'where':{'id':_0x3c4e87[_0xbc27('0x2c')]['id']},'include':_0x10a185})['then'](handleEntityNotFound(_0x5dbb3f,null))['then'](function(_0x16db89){if(_0x16db89&&_0x16db89['Messages']){var _0x22d863=_0x16db89['get']({'plain':!![]});fs[_0xbc27('0x63')](_0x16b58f);for(var _0x1b28be=0x0;_0x1b28be<_0x22d863[_0xbc27('0x61')]['length'];_0x1b28be++){var _0x1e745d=_0x22d863[_0xbc27('0x61')][_0x1b28be][_0xbc27('0x60')];if(_0x1e745d){var _0x5e2ec8=path[_0xbc27('0x5b')](_0xa81a5e,_0x1e745d[_0xbc27('0x64')]);if(fs[_0xbc27('0x65')](_0x5e2ec8)){fs[_0xbc27('0x66')](_0x5e2ec8)['pipe'](fs['createWriteStream'](path[_0xbc27('0x5b')](_0x16b58f,_0x1e745d[_0xbc27('0x64')])));}}}return BPromise[_0xbc27('0x67')]()[_0xbc27('0x1b')](function(){return new BPromise(function(_0x19ba11,_0x14db03){zipdir(_0x16b58f,{'saveTo':_0x4c96aa},function(_0x432170,_0x31efdd){if(_0x432170)return _0x14db03(_0x432170);return _0x19ba11(_0x31efdd);});})[_0xbc27('0x1b')](function(){return new BPromise(function(_0x413d77,_0x497e45){rimraf(_0x16b58f,function(_0x17c60f){if(_0x17c60f)_0x497e45(_0x17c60f);return _0x413d77();});});})['then'](function(){return _0x5dbb3f[_0xbc27('0x56')](_0x4c96aa,_0x41c839,function(_0x59684b){if(_0x59684b){console['log'](_0xbc27('0x68'),_0x59684b);}else{fs[_0xbc27('0x69')](_0x4c96aa);}});});});}else{return _0x5dbb3f[_0xbc27('0x1d')](0xc8);}})[_0xbc27('0x2a')](handleError(_0x5dbb3f,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index b69092a..906a58d 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 _0x6a38=['then','findAll','setDataValue','unreadMessages','length','emit','catch','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers'];(function(_0x45b1ca,_0x3611c3){var _0x3e9ebf=function(_0x156d54){while(--_0x156d54){_0x45b1ca['push'](_0x45b1ca['shift']());}};_0x3e9ebf(++_0x3611c3);}(_0x6a38,0x128));var _0x86a3=function(_0x3e18be,_0x4d3bfa){_0x3e18be=_0x3e18be-0x0;var _0x37932c=_0x6a38[_0x3e18be];return _0x37932c;};'use strict';var EventEmitter=require(_0x86a3('0x0'));var FaxInteraction=require(_0x86a3('0x1'))['db'][_0x86a3('0x2')];var FaxMessage=require(_0x86a3('0x1'))['db'][_0x86a3('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x86a3('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x86a3('0x5'),'afterDestroy':_0x86a3('0x6')};function emitEvent(_0x11a2ad){return function(_0x2dc10a,_0x5d3359,_0x3c0e08){_0x2dc10a[_0x86a3('0x7')]({'attributes':['id'],'raw':!![]})[_0x86a3('0x8')](function(_0x3cb7e1){_0x2dc10a['setDataValue']('Users',_0x3cb7e1['map'](function(_0x206e8e){return{'id':_0x206e8e['id']};}));return FaxMessage[_0x86a3('0x9')]({'where':{'FaxInteractionId':_0x2dc10a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2a0937){_0x2dc10a[_0x86a3('0xa')](_0x86a3('0xb'),_0x2a0937[_0x86a3('0xc')]);FaxInteractionEvents[_0x86a3('0xd')](_0x11a2ad+':'+_0x2dc10a['id'],_0x2dc10a);FaxInteractionEvents[_0x86a3('0xd')](_0x11a2ad,_0x2dc10a);_0x3c0e08(null);})[_0x86a3('0xe')](_0x3c0e08(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x86a3('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0xab8a=['setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','hook','events','../../mysqldb','FaxMessage','save','update','getUsers','then'];(function(_0x544125,_0x743ffa){var _0x193a8a=function(_0x5ecc7e){while(--_0x5ecc7e){_0x544125['push'](_0x544125['shift']());}};_0x193a8a(++_0x743ffa);}(_0xab8a,0x1bb));var _0xaab8=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xab8a[_0x525c7b];return _0x27b33e;};'use strict';var EventEmitter=require(_0xaab8('0x0'));var FaxInteraction=require(_0xaab8('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0xaab8('0x1'))['db'][_0xaab8('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaab8('0x3'),'afterUpdate':_0xaab8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x45d214){return function(_0xd8a2fa,_0x1d1acc,_0x2726de){_0xd8a2fa[_0xaab8('0x5')]({'attributes':['id'],'raw':!![]})[_0xaab8('0x6')](function(_0x346d9c){_0xd8a2fa[_0xaab8('0x7')](_0xaab8('0x8'),_0x346d9c['map'](function(_0x30b4c1){return{'id':_0x30b4c1['id']};}));return FaxMessage[_0xaab8('0x9')]({'where':{'FaxInteractionId':_0xd8a2fa['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaab8('0x6')](function(_0x52a326){_0xd8a2fa[_0xaab8('0x7')](_0xaab8('0xa'),_0x52a326[_0xaab8('0xb')]);FaxInteractionEvents[_0xaab8('0xc')](_0x45d214+':'+_0xd8a2fa['id'],_0xd8a2fa);FaxInteractionEvents[_0xaab8('0xc')](_0x45d214,_0xd8a2fa);_0x2726de(null);})['catch'](_0x2726de(null));};}for(var e in events){if(events[_0xaab8('0xd')](e)){var event=events[e];FaxInteraction[_0xaab8('0xe')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 0bb37d3..7f5e225 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 _0xc65b=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util'];(function(_0x5269b6,_0x28ace6){var _0x15e3c2=function(_0x4eda38){while(--_0x4eda38){_0x5269b6['push'](_0x5269b6['shift']());}};_0x15e3c2(++_0x28ace6);}(_0xc65b,0x12f));var _0xbc65=function(_0x140adf,_0x2342f8){_0x140adf=_0x140adf-0x0;var _0x3c1f69=_0xc65b[_0x140adf];return _0x3c1f69;};'use strict';var _=require('lodash');var util=require(_0xbc65('0x0'));var logger=require(_0xbc65('0x1'))(_0xbc65('0x2'));var moment=require(_0xbc65('0x3'));var BPromise=require(_0xbc65('0x4'));var rp=require(_0xbc65('0x5'));var fs=require('fs');var path=require(_0xbc65('0x6'));var rimraf=require('rimraf');var config=require(_0xbc65('0x7'));var attributes=require(_0xbc65('0x8'));module['exports']=function(_0x3c96ef,_0x50b936){return _0x3c96ef[_0xbc65('0x9')](_0xbc65('0xa'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4cece1,_0x23e5ce,_0x993129){if(_0x4cece1[_0xbc65('0xb')](_0xbc65('0xc'))){_0x4cece1[_0xbc65('0xd')]=moment()[_0xbc65('0xe')](_0xbc65('0xf'));}_0x993129(null,_0x4cece1);}}});}; \ No newline at end of file +var _0xfb21=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','bluebird','path','rimraf','../../config/environment','exports','define','fax_interactions','closed','closedAt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb21,0xeb));var _0x1fb2=function(_0x3878b2,_0x18adcb){_0x3878b2=_0x3878b2-0x0;var _0xa3cf1c=_0xfb21[_0x3878b2];return _0xa3cf1c;};'use strict';var _=require(_0x1fb2('0x0'));var util=require(_0x1fb2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1fb2('0x2'));var BPromise=require(_0x1fb2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fb2('0x4'));var rimraf=require(_0x1fb2('0x5'));var config=require(_0x1fb2('0x6'));var attributes=require('./faxInteraction.attributes');module[_0x1fb2('0x7')]=function(_0x58a4c1,_0x5b090){return _0x58a4c1[_0x1fb2('0x8')]('FaxInteraction',attributes,{'tableName':_0x1fb2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2b7adf,_0x1ef978,_0x1271bf){if(_0x2b7adf['changed'](_0x1fb2('0xa'))){_0x2b7adf[_0x1fb2('0xb')]=moment()['format'](_0x1fb2('0xc'));}_0x1271bf(null,_0x2b7adf);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 96d7598..1aadfe5 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 _0x4c98=['redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','attributes','debug','AddTagsToFaxInteraction','find','then','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x4c98,0x1bb));var _0x84c9=function(_0x52a9c8,_0x4f4878){_0x52a9c8=_0x52a9c8-0x0;var _0x59e05d=_0x4c98[_0x52a9c8];return _0x59e05d;};'use strict';var _=require('lodash');var util=require(_0x84c9('0x0'));var moment=require(_0x84c9('0x1'));var BPromise=require(_0x84c9('0x2'));var rs=require(_0x84c9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x84c9('0x4'))['db'];var utils=require(_0x84c9('0x5'));var logger=require('../../config/logger')(_0x84c9('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x84c9('0x7')]['http']({'port':0x232a});config[_0x84c9('0x8')]=_[_0x84c9('0x9')](config['redis'],{'host':_0x84c9('0xa'),'port':0x18eb});var socket=require(_0x84c9('0xb'))(new Redis(config[_0x84c9('0x8')]));require(_0x84c9('0xc'))[_0x84c9('0xd')](socket);function respondWithRpcPromise(_0x582fca,_0xa5a47a,_0xeeb6e8){return new BPromise(function(_0x2221c1,_0x190032){return client[_0x84c9('0xe')](_0x582fca,_0xeeb6e8)['then'](function(_0x2b61ce){logger[_0x84c9('0xf')](_0x84c9('0x10'),_0xa5a47a,_0x84c9('0x11'));logger['debug'](_0x84c9('0x12'),_0xa5a47a,_0x84c9('0x11'),JSON[_0x84c9('0x13')](_0x2b61ce));if(_0x2b61ce[_0x84c9('0x14')]){if(_0x2b61ce[_0x84c9('0x14')][_0x84c9('0x15')]===0x1f4){logger[_0x84c9('0x14')](_0x84c9('0x10'),_0xa5a47a,_0x2b61ce['error'][_0x84c9('0x16')]);return _0x190032(_0x2b61ce['error'][_0x84c9('0x16')]);}logger[_0x84c9('0x14')](_0x84c9('0x10'),_0xa5a47a,_0x2b61ce[_0x84c9('0x14')]['message']);return _0x2221c1(_0x2b61ce['error']['message']);}else{logger[_0x84c9('0xf')](_0x84c9('0x10'),_0xa5a47a,_0x84c9('0x11'));_0x2221c1(_0x2b61ce[_0x84c9('0x17')]['message']);}})[_0x84c9('0x18')](function(_0x44e111){logger['error'](_0x84c9('0x10'),_0xa5a47a,_0x44e111);_0x190032(_0x44e111);});});}exports[_0x84c9('0x19')]=function(_0x236aba){var _0x4507dd=this;return new Promise(function(_0x36de87,_0x469da3){return db[_0x84c9('0x1a')][_0x84c9('0x1b')](_0x236aba[_0x84c9('0x1c')],{'raw':_0x236aba['options']?_0x236aba[_0x84c9('0x1d')][_0x84c9('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x236aba[_0x84c9('0x1d')]?_0x236aba[_0x84c9('0x1d')]['where']||null:null,'attributes':_0x236aba[_0x84c9('0x1d')]?_0x236aba[_0x84c9('0x1d')][_0x84c9('0x1f')]||null:null,'limit':_0x236aba['options']?_0x236aba[_0x84c9('0x1d')]['limit']||null:null})['then'](function(_0x531d0f){logger['info'](_0x84c9('0x19'),_0x236aba);logger[_0x84c9('0x20')](_0x84c9('0x19'),_0x236aba,JSON[_0x84c9('0x13')](_0x531d0f));_0x36de87(_0x531d0f);})[_0x84c9('0x18')](function(_0x23a377){logger[_0x84c9('0x14')](_0x84c9('0x19'),_0x23a377[_0x84c9('0x16')],_0x236aba);_0x469da3(_0x4507dd[_0x84c9('0x14')](0x1f4,_0x23a377[_0x84c9('0x16')]));});});};exports[_0x84c9('0x21')]=function(_0x27be56){return new Promise(function(_0x533f56,_0x3d1ac6){return db[_0x84c9('0x1a')][_0x84c9('0x22')]({'where':_0x27be56[_0x84c9('0x1d')]?_0x27be56[_0x84c9('0x1d')]['where']||null:null})[_0x84c9('0x23')](function(_0xdf001){if(_0xdf001){return _0xdf001[_0x84c9('0x24')](_0x27be56['body'][_0x84c9('0x25')],_[_0x84c9('0x26')](_0x27be56['body'],[_0x84c9('0x25'),'id'])||{});}})[_0x84c9('0x27')](function(_0x3fdeea){logger['info'](_0x84c9('0x28'),_0x27be56);logger[_0x84c9('0x20')](_0x84c9('0x28'),_0x27be56,JSON[_0x84c9('0x13')](_0x3fdeea));_0x533f56(_0x3fdeea);})[_0x84c9('0x18')](function(_0x488c47){logger[_0x84c9('0x14')](_0x84c9('0x28'),_0x488c47[_0x84c9('0x16')],_0x27be56);_0x3d1ac6(_this[_0x84c9('0x14')](0x1f4,_0x488c47[_0x84c9('0x16')]));});});}; \ No newline at end of file +var _0x3441=['AddTagsToFaxInteraction','find','addTags','body','ids','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','localhost','redis','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateFaxInteraction','update','options','raw','info'];(function(_0x2b6d24,_0x3393b1){var _0x2f2224=function(_0xa28314){while(--_0xa28314){_0x2b6d24['push'](_0x2b6d24['shift']());}};_0x2f2224(++_0x3393b1);}(_0x3441,0x15d));var _0x1344=function(_0x18e815,_0x171312){_0x18e815=_0x18e815-0x0;var _0x3ae01b=_0x3441[_0x18e815];return _0x3ae01b;};'use strict';var _=require(_0x1344('0x0'));var util=require(_0x1344('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1344('0x2'));var fs=require('fs');var Redis=require(_0x1344('0x3'));var db=require(_0x1344('0x4'))['db'];var utils=require(_0x1344('0x5'));var logger=require(_0x1344('0x6'))(_0x1344('0x7'));var config=require(_0x1344('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1344('0x9')][_0x1344('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x1344('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1344('0xc')]));require(_0x1344('0xd'))[_0x1344('0xe')](socket);function respondWithRpcPromise(_0x908046,_0x5b3141,_0x5398c3){return new BPromise(function(_0xb48bb,_0x1255f){return client[_0x1344('0xf')](_0x908046,_0x5398c3)[_0x1344('0x10')](function(_0x1f645f){logger['info'](_0x1344('0x11'),_0x5b3141,_0x1344('0x12'));logger[_0x1344('0x13')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x5b3141,'request\x20sent',JSON[_0x1344('0x14')](_0x1f645f));if(_0x1f645f['error']){if(_0x1f645f[_0x1344('0x15')][_0x1344('0x16')]===0x1f4){logger[_0x1344('0x15')](_0x1344('0x11'),_0x5b3141,_0x1f645f['error'][_0x1344('0x17')]);return _0x1255f(_0x1f645f[_0x1344('0x15')][_0x1344('0x17')]);}logger[_0x1344('0x15')](_0x1344('0x11'),_0x5b3141,_0x1f645f[_0x1344('0x15')][_0x1344('0x17')]);return _0xb48bb(_0x1f645f[_0x1344('0x15')][_0x1344('0x17')]);}else{logger['info'](_0x1344('0x11'),_0x5b3141,_0x1344('0x12'));_0xb48bb(_0x1f645f[_0x1344('0x18')]['message']);}})[_0x1344('0x19')](function(_0x1d33b7){logger[_0x1344('0x15')](_0x1344('0x11'),_0x5b3141,_0x1d33b7);_0x1255f(_0x1d33b7);});});}exports[_0x1344('0x1a')]=function(_0x3e818a){var _0x5e1521=this;return new Promise(function(_0x473dd3,_0x589a2e){return db['FaxInteraction'][_0x1344('0x1b')](_0x3e818a['body'],{'raw':_0x3e818a[_0x1344('0x1c')]?_0x3e818a[_0x1344('0x1c')][_0x1344('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e818a[_0x1344('0x1c')]?_0x3e818a[_0x1344('0x1c')]['where']||null:null,'attributes':_0x3e818a['options']?_0x3e818a[_0x1344('0x1c')]['attributes']||null:null,'limit':_0x3e818a[_0x1344('0x1c')]?_0x3e818a[_0x1344('0x1c')]['limit']||null:null})[_0x1344('0x10')](function(_0xe7618e){logger[_0x1344('0x1e')]('UpdateFaxInteraction',_0x3e818a);logger[_0x1344('0x13')](_0x1344('0x1a'),_0x3e818a,JSON[_0x1344('0x14')](_0xe7618e));_0x473dd3(_0xe7618e);})[_0x1344('0x19')](function(_0x1ac705){logger[_0x1344('0x15')](_0x1344('0x1a'),_0x1ac705[_0x1344('0x17')],_0x3e818a);_0x589a2e(_0x5e1521['error'](0x1f4,_0x1ac705['message']));});});};exports[_0x1344('0x1f')]=function(_0x24f5d0){return new Promise(function(_0x5bdaa2,_0x598857){return db['FaxInteraction'][_0x1344('0x20')]({'where':_0x24f5d0['options']?_0x24f5d0['options']['where']||null:null})[_0x1344('0x10')](function(_0x3da5d6){if(_0x3da5d6){return _0x3da5d6[_0x1344('0x21')](_0x24f5d0[_0x1344('0x22')][_0x1344('0x23')],_['omit'](_0x24f5d0[_0x1344('0x22')],[_0x1344('0x23'),'id'])||{});}})[_0x1344('0x24')](function(_0x312334){logger[_0x1344('0x1e')](_0x1344('0x25'),_0x24f5d0);logger[_0x1344('0x13')](_0x1344('0x25'),_0x24f5d0,JSON[_0x1344('0x14')](_0x312334));_0x5bdaa2(_0x312334);})[_0x1344('0x19')](function(_0x4f3734){logger['error'](_0x1344('0x25'),_0x4f3734[_0x1344('0x17')],_0x24f5d0);_0x598857(_this[_0x1344('0x15')](0x1f4,_0x4f3734[_0x1344('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index a146615..30e3fd8 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 _0xc2f9=['remove','register','length','./faxInteraction.events'];(function(_0x3b445e,_0xdee370){var _0x2f28af=function(_0x5c4a0b){while(--_0x5c4a0b){_0x3b445e['push'](_0x3b445e['shift']());}};_0x2f28af(++_0xdee370);}(_0xc2f9,0x173));var _0x9c2f=function(_0x304d06,_0x3d0f41){_0x304d06=_0x304d06-0x0;var _0x456d41=_0xc2f9[_0x304d06];return _0x456d41;};'use strict';var FaxInteractionEvents=require(_0x9c2f('0x0'));var events=['save',_0x9c2f('0x1'),'update'];function createListener(_0x33f8e8,_0x4c1eb8){return function(_0x133059){_0x4c1eb8['emit'](_0x33f8e8,_0x133059);};}function removeListener(_0x552efc,_0x4a056d){return function(){FaxInteractionEvents['removeListener'](_0x552efc,_0x4a056d);};}exports[_0x9c2f('0x2')]=function(_0x3c7797){for(var _0x14adeb=0x0,_0x3a86d1=events[_0x9c2f('0x3')];_0x14adeb<_0x3a86d1;_0x14adeb++){var _0x24f092=events[_0x14adeb];var _0x309e64=createListener('faxInteraction:'+_0x24f092,_0x3c7797);FaxInteractionEvents['on'](_0x24f092,_0x309e64);}}; \ No newline at end of file +var _0x4211=['removeListener','register','faxInteraction:','./faxInteraction.events','save','remove'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x4211,0x165));var _0x1421=function(_0x33676b,_0x442eae){_0x33676b=_0x33676b-0x0;var _0x51a25e=_0x4211[_0x33676b];return _0x51a25e;};'use strict';var FaxInteractionEvents=require(_0x1421('0x0'));var events=[_0x1421('0x1'),_0x1421('0x2'),'update'];function createListener(_0x34eb19,_0x148e8a){return function(_0x35c6b2){_0x148e8a['emit'](_0x34eb19,_0x35c6b2);};}function removeListener(_0x25429d,_0x19753d){return function(){FaxInteractionEvents[_0x1421('0x3')](_0x25429d,_0x19753d);};}exports[_0x1421('0x4')]=function(_0x447cd1){for(var _0x3fa4b0=0x0,_0x4dfd62=events['length'];_0x3fa4b0<_0x4dfd62;_0x3fa4b0++){var _0xaac547=events[_0x3fa4b0];var _0x19e24a=createListener(_0x1421('0x5')+_0xaac547,_0x447cd1);FaxInteractionEvents['on'](_0xaac547,_0x19e24a);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 9f29cef..dc22745 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 _0x6110=['update','delete','/:id/tags','removeTags','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','tracked','fax','faxinteraction:addtags','addTags','faxinteraction:update'];(function(_0x5be795,_0x342597){var _0x2631fa=function(_0x1038d5){while(--_0x1038d5){_0x5be795['push'](_0x5be795['shift']());}};_0x2631fa(++_0x342597);}(_0x6110,0x1d6));var _0x0611=function(_0x324360,_0x3d83a8){_0x324360=_0x324360-0x0;var _0x314aba=_0x6110[_0x324360];return _0x314aba;};'use strict';var multer=require(_0x0611('0x0'));var util=require('util');var path=require(_0x0611('0x1'));var timeout=require(_0x0611('0x2'));var express=require(_0x0611('0x3'));var router=express['Router']();var fs_extra=require(_0x0611('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0611('0x5'));var config=require(_0x0611('0x6'));var controller=require(_0x0611('0x7'));router[_0x0611('0x8')]('/',auth[_0x0611('0x9')](),controller[_0x0611('0xa')]);router[_0x0611('0x8')](_0x0611('0xb'),auth['isAuthenticated'](),controller[_0x0611('0xc')]);router[_0x0611('0x8')](_0x0611('0xd'),auth['isAuthenticated'](),controller[_0x0611('0xe')]);router[_0x0611('0x8')](_0x0611('0xf'),auth[_0x0611('0x9')](),controller[_0x0611('0x10')]);router['get']('/:id/download',auth[_0x0611('0x9')](),controller[_0x0611('0x11')]);router[_0x0611('0x12')]('/',auth[_0x0611('0x9')](),controller[_0x0611('0x13')]);router[_0x0611('0x12')](_0x0611('0xf'),auth[_0x0611('0x9')](),controller[_0x0611('0x14')]);router[_0x0611('0x12')]('/:id/tags',auth[_0x0611('0x9')](),interaction[_0x0611('0x15')](_0x0611('0x16'),_0x0611('0x17')),controller[_0x0611('0x18')]);router['put'](_0x0611('0xd'),auth[_0x0611('0x9')](),interaction[_0x0611('0x15')](_0x0611('0x16'),_0x0611('0x19')),controller[_0x0611('0x1a')]);router[_0x0611('0x1b')]('/:id',auth[_0x0611('0x9')](),interaction[_0x0611('0x15')](_0x0611('0x16'),'faxinteraction:destroy'),controller['destroy']);router[_0x0611('0x1b')](_0x0611('0x1c'),auth[_0x0611('0x9')](),controller[_0x0611('0x1d')]);module[_0x0611('0x1e')]=router; \ No newline at end of file +var _0xd344=['download','create','post','/:id/tags','tracked','fax','addTags','put','/:id','faxinteraction:update','update','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download'];(function(_0x4068a3,_0x1c2cd3){var _0xcdea1=function(_0x1eabe1){while(--_0x1eabe1){_0x4068a3['push'](_0x4068a3['shift']());}};_0xcdea1(++_0x1c2cd3);}(_0xd344,0x104));var _0x4d34=function(_0x26cd09,_0x4eef34){_0x26cd09=_0x26cd09-0x0;var _0x1754f0=_0xd344[_0x26cd09];return _0x1754f0;};'use strict';var multer=require(_0x4d34('0x0'));var util=require(_0x4d34('0x1'));var path=require(_0x4d34('0x2'));var timeout=require(_0x4d34('0x3'));var express=require(_0x4d34('0x4'));var router=express[_0x4d34('0x5')]();var fs_extra=require(_0x4d34('0x6'));var auth=require(_0x4d34('0x7'));var interaction=require(_0x4d34('0x8'));var config=require(_0x4d34('0x9'));var controller=require(_0x4d34('0xa'));router[_0x4d34('0xb')]('/',auth[_0x4d34('0xc')](),controller[_0x4d34('0xd')]);router[_0x4d34('0xb')](_0x4d34('0xe'),auth['isAuthenticated'](),controller[_0x4d34('0xf')]);router[_0x4d34('0xb')]('/:id',auth[_0x4d34('0xc')](),controller[_0x4d34('0x10')]);router[_0x4d34('0xb')](_0x4d34('0x11'),auth[_0x4d34('0xc')](),controller[_0x4d34('0x12')]);router[_0x4d34('0xb')](_0x4d34('0x13'),auth[_0x4d34('0xc')](),controller[_0x4d34('0x14')]);router['post']('/',auth[_0x4d34('0xc')](),controller[_0x4d34('0x15')]);router[_0x4d34('0x16')](_0x4d34('0x11'),auth['isAuthenticated'](),controller['addMessage']);router[_0x4d34('0x16')](_0x4d34('0x17'),auth['isAuthenticated'](),interaction[_0x4d34('0x18')](_0x4d34('0x19'),'faxinteraction:addtags'),controller[_0x4d34('0x1a')]);router[_0x4d34('0x1b')](_0x4d34('0x1c'),auth[_0x4d34('0xc')](),interaction['tracked'](_0x4d34('0x19'),_0x4d34('0x1d')),controller[_0x4d34('0x1e')]);router['delete'](_0x4d34('0x1c'),auth['isAuthenticated'](),interaction['tracked'](_0x4d34('0x19'),_0x4d34('0x1f')),controller[_0x4d34('0x20')]);router['delete'](_0x4d34('0x17'),auth[_0x4d34('0xc')](),controller[_0x4d34('0x21')]);module[_0x4d34('0x22')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index dea3bd7..12c76ff 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 _0xab5b=['sequelize','exports','medium','BOOLEAN','out','DATE'];(function(_0x263ffd,_0x1d9006){var _0x426356=function(_0x2cd6f6){while(--_0x2cd6f6){_0x263ffd['push'](_0x263ffd['shift']());}};_0x426356(++_0x1d9006);}(_0xab5b,0x11a));var _0xbab5=function(_0xcb95ba,_0x16dd5c){_0xcb95ba=_0xcb95ba-0x0;var _0x3867f9=_0xab5b[_0xcb95ba];return _0x3867f9;};'use strict';var Sequelize=require(_0xbab5('0x0'));module[_0xbab5('0x1')]={'body':{'type':Sequelize['TEXT'](_0xbab5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xbab5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xbab5('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xbab5('0x5')]}}; \ No newline at end of file +var _0x8388=['TEXT','medium','ENUM','out','DATE','sequelize','exports'];(function(_0x29a730,_0xa04b4d){var _0x40d450=function(_0x4feb79){while(--_0x4feb79){_0x29a730['push'](_0x29a730['shift']());}};_0x40d450(++_0xa04b4d);}(_0x8388,0x18d));var _0x8838=function(_0x44474f,_0x431580){_0x44474f=_0x44474f-0x0;var _0x427d97=_0x8388[_0x44474f];return _0x427d97;};'use strict';var Sequelize=require(_0x8838('0x0'));module[_0x8838('0x1')]={'body':{'type':Sequelize[_0x8838('0x2')](_0x8838('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8838('0x4')]('in',_0x8838('0x5')),'defaultValue':_0x8838('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x8838('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x8838('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 494f27c..610bb06 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 _0x30f1=['request\x20sent','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','stack','name','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','FaxMessage','includeAll','include','findAll','rows','show','keys','filters','find','body','params','describe','../../config/logger','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','SELECT','contact','fullname','manual','SIP/%s','channel','EventManager','get','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','QueryTypes','internal','interface','motionChannel','event','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','join','server','files','attachments','download','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','debug','FaxMessage,\x20%s,\x20%s,\x20%s'];(function(_0x9d201d,_0x208b82){var _0x11b768=function(_0x59a62c){while(--_0x59a62c){_0x9d201d['push'](_0x9d201d['shift']());}};_0x11b768(++_0x208b82);}(_0x30f1,0xfa));var _0x130f=function(_0x49c330,_0x308197){_0x49c330=_0x49c330-0x0;var _0x49f43b=_0x30f1[_0x49c330];return _0x49f43b;};'use strict';var emlformat=require(_0x130f('0x0'));var rimraf=require(_0x130f('0x1'));var zipdir=require(_0x130f('0x2'));var jsonpatch=require(_0x130f('0x3'));var rp=require(_0x130f('0x4'));var moment=require(_0x130f('0x5'));var BPromise=require(_0x130f('0x6'));var Mustache=require(_0x130f('0x7'));var util=require(_0x130f('0x8'));var path=require('path');var sox=require(_0x130f('0x9'));var csv=require('to-csv');var ejs=require(_0x130f('0xa'));var fs=require('fs');var fs_extra=require(_0x130f('0xb'));var _=require(_0x130f('0xc'));var squel=require(_0x130f('0xd'));var crypto=require(_0x130f('0xe'));var jsforce=require(_0x130f('0xf'));var deskjs=require(_0x130f('0x10'));var toCsv=require(_0x130f('0x11'));var querystring=require('querystring');var Papa=require(_0x130f('0x12'));var Redis=require(_0x130f('0x13'));var authService=require(_0x130f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x130f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x130f('0x16'));var utils=require('../../config/utils');var config=require(_0x130f('0x17'));var licenseUtil=require(_0x130f('0x18'));var db=require('../../mysqldb')['db'];config[_0x130f('0x19')]=_[_0x130f('0x1a')](config['redis'],{'host':_0x130f('0x1b'),'port':0x18eb});var socket=require(_0x130f('0x1c'))(new Redis(config[_0x130f('0x19')]));require(_0x130f('0x1d'))[_0x130f('0x1e')](socket);var jayson=require(_0x130f('0x1f'));var client=jayson[_0x130f('0x20')][_0x130f('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x130f('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x502991,_0x3e0378,_0x4fdc94,_0x290892){return new BPromise(function(_0x689d24,_0x523ea1){var _0x3e8847=_0x290892||client;return _0x3e8847[_0x130f('0x22')](_0x502991,_0x4fdc94)[_0x130f('0x23')](function(_0x5771cf){logger['info']('FaxMessage,\x20%s,\x20%s',_0x3e0378,'request\x20sent');logger[_0x130f('0x24')](_0x130f('0x25'),_0x3e0378,_0x130f('0x26'),JSON[_0x130f('0x27')](_0x5771cf));if(_0x5771cf[_0x130f('0x28')]){if(_0x5771cf[_0x130f('0x28')][_0x130f('0x29')]===0x1f4){logger[_0x130f('0x28')](_0x130f('0x2a'),_0x3e0378,_0x5771cf['error']['message']);return _0x523ea1(_0x5771cf[_0x130f('0x28')][_0x130f('0x2b')]);}logger[_0x130f('0x28')](_0x130f('0x2a'),_0x3e0378,_0x5771cf[_0x130f('0x28')][_0x130f('0x2b')]);return _0x689d24(_0x5771cf[_0x130f('0x28')]['message']);}else{logger[_0x130f('0x2c')](_0x130f('0x2a'),_0x3e0378,_0x130f('0x26'));_0x689d24(_0x5771cf[_0x130f('0x2d')]['message']);}})[_0x130f('0x2e')](function(_0x453fd9){logger[_0x130f('0x28')]('FaxMessage,\x20%s,\x20%s',_0x3e0378,_0x453fd9);_0x523ea1(_0x453fd9);});});}function respondWithStatusCode(_0x1ec0e5,_0x48d3ac){_0x48d3ac=_0x48d3ac||0xcc;return function(_0x3950a3){if(_0x3950a3){return _0x1ec0e5[_0x130f('0x2f')](_0x48d3ac);}return _0x1ec0e5['status'](_0x48d3ac)[_0x130f('0x30')]();};}function respondWithResult(_0x11798f,_0x2f2893){_0x2f2893=_0x2f2893||0xc8;return function(_0x5181f8){if(_0x5181f8){return _0x11798f[_0x130f('0x31')](_0x2f2893)[_0x130f('0x32')](_0x5181f8);}};}function respondWithFilteredResult(_0x38a234,_0x4ddaf4){return function(_0x618b81){if(_0x618b81){var _0x1fe4e0=typeof _0x4ddaf4[_0x130f('0x33')]===_0x130f('0x34')&&typeof _0x4ddaf4[_0x130f('0x35')]==='undefined';var _0x269965=_0x618b81[_0x130f('0x36')];var _0x177de8=_0x1fe4e0?0x0:_0x4ddaf4['offset'];var _0x3993f9=_0x1fe4e0?_0x618b81[_0x130f('0x36')]:_0x4ddaf4[_0x130f('0x33')]+_0x4ddaf4['limit'];var _0xa42fb0;if(_0x3993f9>=_0x269965){_0x3993f9=_0x269965;_0xa42fb0=0xc8;}else{_0xa42fb0=0xce;}_0x38a234[_0x130f('0x31')](_0xa42fb0);return _0x38a234['set'](_0x130f('0x37'),_0x177de8+'-'+_0x3993f9+'/'+_0x269965)['json'](_0x618b81);}return null;};}function patchUpdates(_0x750f38){return function(_0x49bfde){try{jsonpatch[_0x130f('0x38')](_0x49bfde,_0x750f38,!![]);}catch(_0xf6171){return BPromise[_0x130f('0x39')](_0xf6171);}return _0x49bfde[_0x130f('0x3a')]();};}function saveUpdates(_0x12e7f4,_0x333285){return function(_0x34c3de){if(_0x34c3de){return _0x34c3de[_0x130f('0x3b')](_0x12e7f4)[_0x130f('0x23')](function(_0x25eb22){return _0x25eb22;});}return null;};}function removeEntity(_0x31cf3e,_0xa83c56){return function(_0x87d487){if(_0x87d487){return _0x87d487[_0x130f('0x3c')]()[_0x130f('0x23')](function(){_0x31cf3e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47dc39,_0x5d7b5f){return function(_0x5bc05a){if(!_0x5bc05a){_0x47dc39[_0x130f('0x2f')](0x194);}return _0x5bc05a;};}function handleError(_0x33a2cb,_0x39cdba){_0x39cdba=_0x39cdba||0x1f4;return function(_0x5ef231){logger['error'](_0x5ef231[_0x130f('0x3d')]);if(_0x5ef231[_0x130f('0x3e')]){delete _0x5ef231[_0x130f('0x3e')];}_0x33a2cb['status'](_0x39cdba)['send'](_0x5ef231);};}exports['index']=function(_0x273ee2,_0x1ba217){var _0x19141c={},_0x84e455={},_0x5703c6={'count':0x0,'rows':[]};var _0x1120e5=_[_0x130f('0x3f')](db['FaxMessage'][_0x130f('0x40')],function(_0x30fb4d){return{'name':_0x30fb4d[_0x130f('0x41')],'type':_0x30fb4d[_0x130f('0x42')]['key']};});_0x84e455[_0x130f('0x43')]=_[_0x130f('0x3f')](_0x1120e5,_0x130f('0x3e'));_0x84e455[_0x130f('0x44')]=_['keys'](_0x273ee2[_0x130f('0x44')]);_0x84e455['filters']=_[_0x130f('0x45')](_0x84e455[_0x130f('0x43')],_0x84e455[_0x130f('0x44')]);_0x19141c[_0x130f('0x46')]=_[_0x130f('0x45')](_0x84e455[_0x130f('0x43')],qs[_0x130f('0x47')](_0x273ee2[_0x130f('0x44')][_0x130f('0x47')]));_0x19141c['attributes']=_0x19141c['attributes'][_0x130f('0x48')]?_0x19141c[_0x130f('0x46')]:_0x84e455[_0x130f('0x43')];if(!_0x273ee2['query'][_0x130f('0x49')](_0x130f('0x4a'))){_0x19141c[_0x130f('0x35')]=qs[_0x130f('0x35')](_0x273ee2[_0x130f('0x44')]['limit']);_0x19141c['offset']=qs[_0x130f('0x33')](_0x273ee2[_0x130f('0x44')]['offset']);}_0x19141c['order']=qs['sort'](_0x273ee2['query'][_0x130f('0x4b')]);_0x19141c[_0x130f('0x4c')]=qs['filters'](_[_0x130f('0x4d')](_0x273ee2[_0x130f('0x44')],_0x84e455['filters']),_0x1120e5);if(_0x273ee2[_0x130f('0x44')][_0x130f('0x4e')]){_0x19141c['where']=_[_0x130f('0x4f')](_0x19141c[_0x130f('0x4c')],{'$or':_[_0x130f('0x3f')](_0x1120e5,function(_0x240c1a){if(_0x240c1a['type']!=='VIRTUAL'){var _0x803dd3={};_0x803dd3[_0x240c1a[_0x130f('0x3e')]]={'$like':'%'+_0x273ee2[_0x130f('0x44')]['filter']+'%'};return _0x803dd3;}})});}_0x19141c=_['merge']({},_0x19141c,_0x273ee2[_0x130f('0x50')]);var _0x172600={'where':_0x19141c[_0x130f('0x4c')]};return db[_0x130f('0x51')][_0x130f('0x36')](_0x172600)[_0x130f('0x23')](function(_0x985b96){_0x5703c6[_0x130f('0x36')]=_0x985b96;if(_0x273ee2['query'][_0x130f('0x52')]){_0x19141c[_0x130f('0x53')]=[{'all':!![]}];}return db['FaxMessage'][_0x130f('0x54')](_0x19141c);})[_0x130f('0x23')](function(_0x2a74ee){_0x5703c6[_0x130f('0x55')]=_0x2a74ee;return _0x5703c6;})[_0x130f('0x23')](respondWithFilteredResult(_0x1ba217,_0x19141c))[_0x130f('0x2e')](handleError(_0x1ba217,null));};exports[_0x130f('0x56')]=function(_0x3e749c,_0x2e8bf4){var _0x2b819e={'raw':!![],'where':{'id':_0x3e749c['params']['id']}},_0x11f3df={};_0x11f3df[_0x130f('0x43')]=_[_0x130f('0x57')](db[_0x130f('0x51')]['rawAttributes']);_0x11f3df[_0x130f('0x44')]=_[_0x130f('0x57')](_0x3e749c[_0x130f('0x44')]);_0x11f3df[_0x130f('0x58')]=_[_0x130f('0x45')](_0x11f3df[_0x130f('0x43')],_0x11f3df[_0x130f('0x44')]);_0x2b819e['attributes']=_[_0x130f('0x45')](_0x11f3df[_0x130f('0x43')],qs[_0x130f('0x47')](_0x3e749c[_0x130f('0x44')][_0x130f('0x47')]));_0x2b819e[_0x130f('0x46')]=_0x2b819e[_0x130f('0x46')][_0x130f('0x48')]?_0x2b819e[_0x130f('0x46')]:_0x11f3df[_0x130f('0x43')];if(_0x3e749c[_0x130f('0x44')][_0x130f('0x52')]){_0x2b819e[_0x130f('0x53')]=[{'all':!![]}];}_0x2b819e=_[_0x130f('0x4f')]({},_0x2b819e,_0x3e749c['options']);return db[_0x130f('0x51')][_0x130f('0x59')](_0x2b819e)[_0x130f('0x23')](handleEntityNotFound(_0x2e8bf4,null))['then'](respondWithResult(_0x2e8bf4,null))[_0x130f('0x2e')](handleError(_0x2e8bf4,null));};exports[_0x130f('0x3b')]=function(_0xc360a9,_0x42ca90){if(_0xc360a9['body']['id']){delete _0xc360a9[_0x130f('0x5a')]['id'];}return db['FaxMessage'][_0x130f('0x59')]({'where':{'id':_0xc360a9[_0x130f('0x5b')]['id']}})['then'](handleEntityNotFound(_0x42ca90,null))[_0x130f('0x23')](saveUpdates(_0xc360a9['body'],null))[_0x130f('0x23')](respondWithResult(_0x42ca90,null))[_0x130f('0x2e')](handleError(_0x42ca90,null));};exports[_0x130f('0x3c')]=function(_0x20448a,_0x24b606){return db['FaxMessage'][_0x130f('0x59')]({'where':{'id':_0x20448a[_0x130f('0x5b')]['id']}})[_0x130f('0x23')](handleEntityNotFound(_0x24b606,null))['then'](removeEntity(_0x24b606,null))[_0x130f('0x2e')](handleError(_0x24b606,null));};exports[_0x130f('0x5c')]=function(_0x2eaef4,_0x157873){return db['FaxMessage']['describe']()[_0x130f('0x23')](respondWithResult(_0x157873,null))[_0x130f('0x2e')](handleError(_0x157873,null));};var interaction_log=require(_0x130f('0x5d'))(_0x130f('0x5e'));exports[_0x130f('0x5f')]=function(_0x34ba89,_0x84e840,_0x163e41){var _0x311944={'agent':{},'channel':_0x130f('0x60')};if(_0x34ba89[_0x130f('0x5a')]['id']){delete _0x34ba89[_0x130f('0x5a')]['id'];}_0x34ba89[_0x130f('0x5a')][_0x130f('0x61')]=!![];_0x34ba89[_0x130f('0x5a')][_0x130f('0x62')]=moment()[_0x130f('0x63')](_0x130f('0x64'));_0x34ba89[_0x130f('0x5a')][_0x130f('0x65')]=_0x34ba89[_0x130f('0x5a')][_0x130f('0x65')]||_0x34ba89[_0x130f('0x66')]['id'];_0x311944[_0x130f('0x67')]['id']=_0x34ba89[_0x130f('0x5a')]['UserId'];return db[_0x130f('0x51')][_0x130f('0x59')]({'where':{'id':_0x34ba89[_0x130f('0x5b')]['id'],'UserId':null}})[_0x130f('0x23')](handleEntityNotFound(_0x84e840,null))['then'](saveUpdates(_0x34ba89['body'],null))['then'](function(_0x240f4a){if(_0x240f4a){_0x311944[_0x130f('0x2b')]=_0x240f4a['get']({'plain':!![]});return db[_0x130f('0x68')][_0x130f('0x59')]({'where':{'id':_0x240f4a[_0x130f('0x69')]}});}return null;})[_0x130f('0x23')](handleEntityNotFound(_0x84e840,null))[_0x130f('0x23')](function(_0xff8339){if(_0xff8339){return _0xff8339[_0x130f('0x3b')]({'UserId':_0x34ba89[_0x130f('0x5a')][_0x130f('0x65')],'read1stAt':_[_0x130f('0x6a')](_0xff8339[_0x130f('0x6b')])?moment()[_0x130f('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x130f('0x23')](function(_0x2c17bf){if(_0x2c17bf){_0x311944[_0x130f('0x6c')]=_0x2c17bf['get']({'plain':!![]});interaction_log[_0x130f('0x2c')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x34ba89[_0x130f('0x66')]['id'],_0x34ba89[_0x130f('0x66')]['name'],_0x34ba89[_0x130f('0x66')][_0x130f('0x6d')],_0x311944[_0x130f('0x6c')]['id'],_0x34ba89[_0x130f('0x5a')]?JSON[_0x130f('0x27')](_0x34ba89[_0x130f('0x5a')]):_0x130f('0x6e'));return respondWithRpcPromise(_0x130f('0x6f'),'acceptMessage',_0x311944);}return null;})[_0x130f('0x23')](function(_0x338613){var _0x325b58=_0x130f('0x70')+_0x338613[_0x130f('0x2b')][_0x130f('0x71')];return db['sequelize'][_0x130f('0x44')](_0x325b58,{'type':db['Sequelize']['QueryTypes'][_0x130f('0x72')],'raw':!![]})[_0x130f('0x23')](function(_0x58ef65){return _0x58ef65;});})[_0x130f('0x23')](function(_0x5b5e66){if(_0x5b5e66){_0x311944[_0x130f('0x2b')][_0x130f('0x73')]=_0x5b5e66[0x0];if(!_0x34ba89[_0x130f('0x5a')]['UserId'])return;return db['User'][_0x130f('0x59')]({'where':{'id':_0x34ba89['body'][_0x130f('0x65')],'role':_0x130f('0x67')},'attributes':['id','name',_0x130f('0x74'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x94a990){if(!_0x94a990)return null;_0x311944[_0x130f('0x2b')][_0x130f('0x67')]=_0x94a990;return _0x311944;})[_0x130f('0x23')](function(_0x5cf887){if(_0x5cf887){if(_0x34ba89[_0x130f('0x5a')][_0x130f('0x75')]){_0x311944['message']['interface']=util[_0x130f('0x63')](_0x130f('0x76'),_0x34ba89['user'][_0x130f('0x3e')]);_0x311944[_0x130f('0x2b')]['channel']=_0x311944[_0x130f('0x77')];_0x311944[_0x130f('0x2b')]['motionChannel']=_0x311944[_0x130f('0x77')];_0x311944[_0x130f('0x2b')]['event']=_0x130f('0x5f');return respondWithRpcPromise(_0x130f('0x78'),_0x130f('0x78'),{'event':'acceptmessage','message':_0x311944[_0x130f('0x2b')]},client9002)[_0x130f('0x23')](function(){return _0x311944;});}return _0x311944;}return null;})[_0x130f('0x23')](respondWithResult(_0x84e840,null))['catch'](handleError(_0x84e840,null));};var interaction_log=require(_0x130f('0x5d'))(_0x130f('0x5e'));exports[_0x130f('0x39')]=function(_0x1d400c,_0x48edfe,_0xd5a63e){var _0x258e88={'agent':{},'channel':_0x130f('0x60')};if(_0x1d400c[_0x130f('0x5a')]['id']){delete _0x1d400c[_0x130f('0x5a')]['id'];}_0x1d400c[_0x130f('0x5a')][_0x130f('0x65')]=_0x1d400c[_0x130f('0x5a')][_0x130f('0x65')]||_0x1d400c[_0x130f('0x66')]['id'];_0x258e88[_0x130f('0x67')]['id']=_0x1d400c['body']['UserId'];return db['FaxMessage'][_0x130f('0x59')]({'where':{'id':_0x1d400c[_0x130f('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x48edfe,null))[_0x130f('0x23')](function(_0x3c3290){if(_0x3c3290){_0x258e88['message']=_0x3c3290[_0x130f('0x79')]({'plain':!![]});return db[_0x130f('0x68')][_0x130f('0x59')]({'where':{'id':_0x3c3290[_0x130f('0x69')]}});}return null;})[_0x130f('0x23')](handleEntityNotFound(_0x48edfe,null))[_0x130f('0x23')](function(_0x580a2d){if(_0x580a2d){_0x258e88[_0x130f('0x6c')]=_0x580a2d['get']({'plain':!![]});interaction_log[_0x130f('0x2c')](_0x130f('0x7a'),_0x1d400c['user']['id'],_0x1d400c['user']['name'],_0x1d400c[_0x130f('0x66')]['role'],_0x258e88[_0x130f('0x6c')]['id'],_0x1d400c['body']?JSON[_0x130f('0x27')](_0x1d400c[_0x130f('0x5a')]):_0x130f('0x6e'));return respondWithRpcPromise('RejectMessage',_0x130f('0x7b'),_0x258e88);}return null;})[_0x130f('0x23')](function(_0x34c416){var _0x1a4ab7=_0x130f('0x70')+_0x34c416[_0x130f('0x2b')][_0x130f('0x71')];return db['sequelize'][_0x130f('0x44')](_0x1a4ab7,{'type':db['Sequelize'][_0x130f('0x7c')][_0x130f('0x72')],'raw':!![]})[_0x130f('0x23')](function(_0x3ef78c){return _0x3ef78c;});})[_0x130f('0x23')](function(_0x6615bc){if(_0x6615bc){_0x258e88[_0x130f('0x2b')][_0x130f('0x73')]=_0x6615bc[0x0];if(!_0x1d400c[_0x130f('0x5a')][_0x130f('0x65')])return;return db['User'][_0x130f('0x59')]({'where':{'id':_0x1d400c[_0x130f('0x5a')][_0x130f('0x65')],'role':'agent'},'attributes':['id','name',_0x130f('0x74'),'email',_0x130f('0x7d')],'raw':!![]});}return null;})[_0x130f('0x23')](function(_0x450ba1){if(!_0x450ba1)return null;_0x258e88[_0x130f('0x2b')][_0x130f('0x67')]=_0x450ba1;return _0x258e88;})['then'](function(_0x416dc9){if(_0x416dc9){_0x416dc9[_0x130f('0x2b')][_0x130f('0x7e')]=util[_0x130f('0x63')](_0x130f('0x76'),_0x1d400c['user'][_0x130f('0x3e')]);_0x416dc9[_0x130f('0x2b')][_0x130f('0x77')]=_0x258e88['channel'];_0x416dc9[_0x130f('0x2b')][_0x130f('0x7f')]=_0x258e88[_0x130f('0x77')];_0x416dc9[_0x130f('0x2b')][_0x130f('0x80')]=_0x130f('0x39');respondWithRpcPromise('EventManager',_0x130f('0x78'),{'event':_0x130f('0x81'),'message':_0x416dc9[_0x130f('0x2b')]},client9002);return _0x258e88;}return null;})['then'](respondWithResult(_0x48edfe,null))['catch'](handleError(_0x48edfe,null));};exports[_0x130f('0x82')]=function(_0x371b17,_0x4e7cc7){var _0x16e2fb;return db[_0x130f('0x51')]['create'](_0x371b17[_0x130f('0x5a')],{})[_0x130f('0x23')](function(_0x324fde){_0x16e2fb=_0x324fde;return db[_0x130f('0x83')][_0x130f('0x84')]({'where':{'id':_0x16e2fb[_0x130f('0x71')]}});})[_0x130f('0x23')](function(_0x12d8e8){if(_[_0x130f('0x6a')](_0x12d8e8)){return;}else{_0x16e2fb['fax']=_0x12d8e8[_0x130f('0x60')];return db[_0x130f('0x85')][_0x130f('0x84')]({'where':{'id':_0x16e2fb[_0x130f('0x86')]}});}})[_0x130f('0x23')](function(_0x20630d){return respondWithRpcPromise(_0x130f('0x87'),_0x130f('0x87'),{'FaxAccountId':_[_0x130f('0x6a')](_0x371b17[_0x130f('0x5a')])?undefined:_0x371b17[_0x130f('0x5a')][_0x130f('0x88')],'path':_[_0x130f('0x6a')](_0x20630d)?undefined:util[_0x130f('0x63')](_0x130f('0x89'),_0x20630d['basename']),'fax':_[_0x130f('0x6a')](_0x16e2fb[_0x130f('0x60')])?undefined:_0x16e2fb[_0x130f('0x60')],'AttachmentId':_0x16e2fb[_0x130f('0x86')]},client9002);})['then'](respondWithResult(_0x4e7cc7,0xc9))['catch'](handleError(_0x4e7cc7,null));};exports['download']=function(_0x4c2718,_0x3fdfdc){var _0x3d48ce=path[_0x130f('0x8a')](config['root'],_0x130f('0x8b'),_0x130f('0x8c'),_0x130f('0x8d'));return db[_0x130f('0x51')][_0x130f('0x59')]({'where':{'id':_0x4c2718[_0x130f('0x5b')]['id']},'include':[{'model':db[_0x130f('0x85')],'as':_0x130f('0x85')}]})[_0x130f('0x23')](handleEntityNotFound(_0x3fdfdc,null))['then'](function(_0x973838){if(_0x973838){return _0x3fdfdc[_0x130f('0x8e')](path[_0x130f('0x8a')](_0x3d48ce,_0x973838['Attachment'][_0x130f('0x8f')]));}})['catch'](handleError(_0x3fdfdc,null));}; \ No newline at end of file +var _0x5ba8=['AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','User','fullname','email','internal','SIP/%s','channel','motionChannel','event','acceptmessage','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','ContactId','sequelize','contact','interface','EventManager','rejectmessage','create','CmContact','findOne','Attachment','SendFax','isNil','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','root','server','files','attachments','join','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','client','http','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','model','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','FaxMessage','includeAll','include','rows','show','params','keys','intersection','find','body','describe','fax-interactions','accept','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null'];(function(_0x132311,_0x361a66){var _0x18bfa0=function(_0x534265){while(--_0x534265){_0x132311['push'](_0x132311['shift']());}};_0x18bfa0(++_0x361a66);}(_0x5ba8,0x146));var _0x85ba=function(_0x9a6e6a,_0x4855c0){_0x9a6e6a=_0x9a6e6a-0x0;var _0x3a22ef=_0x5ba8[_0x9a6e6a];return _0x3a22ef;};'use strict';var emlformat=require(_0x85ba('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x85ba('0x1'));var rp=require(_0x85ba('0x2'));var moment=require(_0x85ba('0x3'));var BPromise=require(_0x85ba('0x4'));var Mustache=require(_0x85ba('0x5'));var util=require('util');var path=require(_0x85ba('0x6'));var sox=require(_0x85ba('0x7'));var csv=require(_0x85ba('0x8'));var ejs=require(_0x85ba('0x9'));var fs=require('fs');var fs_extra=require(_0x85ba('0xa'));var _=require('lodash');var squel=require(_0x85ba('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x85ba('0xc'));var toCsv=require(_0x85ba('0x8'));var querystring=require('querystring');var Papa=require(_0x85ba('0xd'));var Redis=require('ioredis');var authService=require(_0x85ba('0xe'));var qs=require(_0x85ba('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x85ba('0x10'));var logger=require(_0x85ba('0x11'))(_0x85ba('0x12'));var utils=require(_0x85ba('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x85ba('0x14')]=_[_0x85ba('0x15')](config[_0x85ba('0x14')],{'host':_0x85ba('0x16'),'port':0x18eb});var socket=require(_0x85ba('0x17'))(new Redis(config[_0x85ba('0x14')]));require(_0x85ba('0x18'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x85ba('0x19')]['http']({'port':0x232c});var client9002=jayson['client'][_0x85ba('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x30442,_0x1f5dee,_0x40097f,_0x40ddce){return new BPromise(function(_0x143cf9,_0x5b2e9e){var _0x1626dc=_0x40ddce||client;return _0x1626dc[_0x85ba('0x1b')](_0x30442,_0x40097f)[_0x85ba('0x1c')](function(_0x1b6c22){logger['info'](_0x85ba('0x1d'),_0x1f5dee,_0x85ba('0x1e'));logger[_0x85ba('0x1f')](_0x85ba('0x20'),_0x1f5dee,_0x85ba('0x1e'),JSON[_0x85ba('0x21')](_0x1b6c22));if(_0x1b6c22[_0x85ba('0x22')]){if(_0x1b6c22[_0x85ba('0x22')][_0x85ba('0x23')]===0x1f4){logger[_0x85ba('0x22')](_0x85ba('0x1d'),_0x1f5dee,_0x1b6c22[_0x85ba('0x22')][_0x85ba('0x24')]);return _0x5b2e9e(_0x1b6c22[_0x85ba('0x22')][_0x85ba('0x24')]);}logger[_0x85ba('0x22')]('FaxMessage,\x20%s,\x20%s',_0x1f5dee,_0x1b6c22['error'][_0x85ba('0x24')]);return _0x143cf9(_0x1b6c22[_0x85ba('0x22')]['message']);}else{logger[_0x85ba('0x25')](_0x85ba('0x1d'),_0x1f5dee,_0x85ba('0x1e'));_0x143cf9(_0x1b6c22[_0x85ba('0x26')][_0x85ba('0x24')]);}})[_0x85ba('0x27')](function(_0x3bd7b0){logger[_0x85ba('0x22')](_0x85ba('0x1d'),_0x1f5dee,_0x3bd7b0);_0x5b2e9e(_0x3bd7b0);});});}function respondWithStatusCode(_0x2aeb74,_0x5dc94b){_0x5dc94b=_0x5dc94b||0xcc;return function(_0x450d20){if(_0x450d20){return _0x2aeb74['sendStatus'](_0x5dc94b);}return _0x2aeb74[_0x85ba('0x28')](_0x5dc94b)[_0x85ba('0x29')]();};}function respondWithResult(_0x2d7940,_0x3469ea){_0x3469ea=_0x3469ea||0xc8;return function(_0x3c8572){if(_0x3c8572){return _0x2d7940['status'](_0x3469ea)[_0x85ba('0x2a')](_0x3c8572);}};}function respondWithFilteredResult(_0x5d3fd7,_0x3ea5f4){return function(_0x909668){if(_0x909668){var _0x50b7da=typeof _0x3ea5f4[_0x85ba('0x2b')]===_0x85ba('0x2c')&&typeof _0x3ea5f4[_0x85ba('0x2d')]===_0x85ba('0x2c');var _0x3fcfc7=_0x909668[_0x85ba('0x2e')];var _0xca8219=_0x50b7da?0x0:_0x3ea5f4['offset'];var _0x19208e=_0x50b7da?_0x909668[_0x85ba('0x2e')]:_0x3ea5f4[_0x85ba('0x2b')]+_0x3ea5f4['limit'];var _0x1734d7;if(_0x19208e>=_0x3fcfc7){_0x19208e=_0x3fcfc7;_0x1734d7=0xc8;}else{_0x1734d7=0xce;}_0x5d3fd7[_0x85ba('0x28')](_0x1734d7);return _0x5d3fd7[_0x85ba('0x2f')](_0x85ba('0x30'),_0xca8219+'-'+_0x19208e+'/'+_0x3fcfc7)['json'](_0x909668);}return null;};}function patchUpdates(_0x13f2a2){return function(_0x57f94d){try{jsonpatch[_0x85ba('0x31')](_0x57f94d,_0x13f2a2,!![]);}catch(_0x1ace54){return BPromise[_0x85ba('0x32')](_0x1ace54);}return _0x57f94d[_0x85ba('0x33')]();};}function saveUpdates(_0x5dd803,_0x4afd6b){return function(_0x272734){if(_0x272734){return _0x272734[_0x85ba('0x34')](_0x5dd803)[_0x85ba('0x1c')](function(_0x380969){return _0x380969;});}return null;};}function removeEntity(_0x2e3e8e,_0x624189){return function(_0xa8199a){if(_0xa8199a){return _0xa8199a[_0x85ba('0x35')]()[_0x85ba('0x1c')](function(){_0x2e3e8e[_0x85ba('0x28')](0xcc)[_0x85ba('0x29')]();});}};}function handleEntityNotFound(_0x5d9891,_0x22a413){return function(_0x45606e){if(!_0x45606e){_0x5d9891[_0x85ba('0x36')](0x194);}return _0x45606e;};}function handleError(_0x122e39,_0x44af8b){_0x44af8b=_0x44af8b||0x1f4;return function(_0x2c4acf){logger[_0x85ba('0x22')](_0x2c4acf[_0x85ba('0x37')]);if(_0x2c4acf[_0x85ba('0x38')]){delete _0x2c4acf[_0x85ba('0x38')];}_0x122e39[_0x85ba('0x28')](_0x44af8b)[_0x85ba('0x39')](_0x2c4acf);};}exports[_0x85ba('0x3a')]=function(_0x4950fd,_0x13590f){var _0x5c9c3f={},_0x455335={},_0x2dd875={'count':0x0,'rows':[]};var _0x4288b8=_[_0x85ba('0x3b')](db['FaxMessage'][_0x85ba('0x3c')],function(_0x2a50c5){return{'name':_0x2a50c5[_0x85ba('0x3d')],'type':_0x2a50c5[_0x85ba('0x3e')]['key']};});_0x455335['model']=_['map'](_0x4288b8,_0x85ba('0x38'));_0x455335[_0x85ba('0x3f')]=_['keys'](_0x4950fd[_0x85ba('0x3f')]);_0x455335[_0x85ba('0x40')]=_['intersection'](_0x455335[_0x85ba('0x41')],_0x455335['query']);_0x5c9c3f[_0x85ba('0x42')]=_['intersection'](_0x455335[_0x85ba('0x41')],qs[_0x85ba('0x43')](_0x4950fd[_0x85ba('0x3f')][_0x85ba('0x43')]));_0x5c9c3f[_0x85ba('0x42')]=_0x5c9c3f['attributes'][_0x85ba('0x44')]?_0x5c9c3f['attributes']:_0x455335[_0x85ba('0x41')];if(!_0x4950fd['query'][_0x85ba('0x45')]('nolimit')){_0x5c9c3f['limit']=qs[_0x85ba('0x2d')](_0x4950fd[_0x85ba('0x3f')][_0x85ba('0x2d')]);_0x5c9c3f[_0x85ba('0x2b')]=qs[_0x85ba('0x2b')](_0x4950fd[_0x85ba('0x3f')][_0x85ba('0x2b')]);}_0x5c9c3f[_0x85ba('0x46')]=qs['sort'](_0x4950fd[_0x85ba('0x3f')]['sort']);_0x5c9c3f[_0x85ba('0x47')]=qs[_0x85ba('0x40')](_[_0x85ba('0x48')](_0x4950fd[_0x85ba('0x3f')],_0x455335[_0x85ba('0x40')]),_0x4288b8);if(_0x4950fd['query'][_0x85ba('0x49')]){_0x5c9c3f[_0x85ba('0x47')]=_[_0x85ba('0x4a')](_0x5c9c3f[_0x85ba('0x47')],{'$or':_[_0x85ba('0x3b')](_0x4288b8,function(_0x574c16){if(_0x574c16['type']!==_0x85ba('0x4b')){var _0x40c4b4={};_0x40c4b4[_0x574c16[_0x85ba('0x38')]]={'$like':'%'+_0x4950fd[_0x85ba('0x3f')][_0x85ba('0x49')]+'%'};return _0x40c4b4;}})});}_0x5c9c3f=_[_0x85ba('0x4a')]({},_0x5c9c3f,_0x4950fd[_0x85ba('0x4c')]);var _0x55361c={'where':_0x5c9c3f['where']};return db[_0x85ba('0x4d')][_0x85ba('0x2e')](_0x55361c)['then'](function(_0x216686){_0x2dd875[_0x85ba('0x2e')]=_0x216686;if(_0x4950fd['query'][_0x85ba('0x4e')]){_0x5c9c3f[_0x85ba('0x4f')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x5c9c3f);})[_0x85ba('0x1c')](function(_0x3f3397){_0x2dd875[_0x85ba('0x50')]=_0x3f3397;return _0x2dd875;})[_0x85ba('0x1c')](respondWithFilteredResult(_0x13590f,_0x5c9c3f))[_0x85ba('0x27')](handleError(_0x13590f,null));};exports[_0x85ba('0x51')]=function(_0x10e4dd,_0x4643e7){var _0x158bbf={'raw':!![],'where':{'id':_0x10e4dd[_0x85ba('0x52')]['id']}},_0x198f46={};_0x198f46[_0x85ba('0x41')]=_[_0x85ba('0x53')](db[_0x85ba('0x4d')]['rawAttributes']);_0x198f46[_0x85ba('0x3f')]=_[_0x85ba('0x53')](_0x10e4dd[_0x85ba('0x3f')]);_0x198f46[_0x85ba('0x40')]=_['intersection'](_0x198f46[_0x85ba('0x41')],_0x198f46[_0x85ba('0x3f')]);_0x158bbf['attributes']=_[_0x85ba('0x54')](_0x198f46[_0x85ba('0x41')],qs[_0x85ba('0x43')](_0x10e4dd['query'][_0x85ba('0x43')]));_0x158bbf[_0x85ba('0x42')]=_0x158bbf[_0x85ba('0x42')]['length']?_0x158bbf[_0x85ba('0x42')]:_0x198f46['model'];if(_0x10e4dd['query'][_0x85ba('0x4e')]){_0x158bbf[_0x85ba('0x4f')]=[{'all':!![]}];}_0x158bbf=_[_0x85ba('0x4a')]({},_0x158bbf,_0x10e4dd['options']);return db['FaxMessage'][_0x85ba('0x55')](_0x158bbf)[_0x85ba('0x1c')](handleEntityNotFound(_0x4643e7,null))[_0x85ba('0x1c')](respondWithResult(_0x4643e7,null))['catch'](handleError(_0x4643e7,null));};exports[_0x85ba('0x34')]=function(_0x5a6fdb,_0x5779cc){if(_0x5a6fdb['body']['id']){delete _0x5a6fdb[_0x85ba('0x56')]['id'];}return db[_0x85ba('0x4d')]['find']({'where':{'id':_0x5a6fdb['params']['id']}})[_0x85ba('0x1c')](handleEntityNotFound(_0x5779cc,null))['then'](saveUpdates(_0x5a6fdb['body'],null))[_0x85ba('0x1c')](respondWithResult(_0x5779cc,null))[_0x85ba('0x27')](handleError(_0x5779cc,null));};exports[_0x85ba('0x35')]=function(_0x144258,_0x2b6393){return db[_0x85ba('0x4d')]['find']({'where':{'id':_0x144258[_0x85ba('0x52')]['id']}})['then'](handleEntityNotFound(_0x2b6393,null))[_0x85ba('0x1c')](removeEntity(_0x2b6393,null))[_0x85ba('0x27')](handleError(_0x2b6393,null));};exports[_0x85ba('0x57')]=function(_0x5530b4,_0x123177){return db[_0x85ba('0x4d')]['describe']()[_0x85ba('0x1c')](respondWithResult(_0x123177,null))['catch'](handleError(_0x123177,null));};var interaction_log=require(_0x85ba('0x11'))(_0x85ba('0x58'));exports[_0x85ba('0x59')]=function(_0x3bd105,_0xd6dac8,_0x49fdbb){var _0x4c49fb={'agent':{},'channel':_0x85ba('0x5a')};if(_0x3bd105[_0x85ba('0x56')]['id']){delete _0x3bd105[_0x85ba('0x56')]['id'];}_0x3bd105[_0x85ba('0x56')]['read']=!![];_0x3bd105[_0x85ba('0x56')][_0x85ba('0x5b')]=moment()[_0x85ba('0x5c')](_0x85ba('0x5d'));_0x3bd105[_0x85ba('0x56')][_0x85ba('0x5e')]=_0x3bd105[_0x85ba('0x56')][_0x85ba('0x5e')]||_0x3bd105[_0x85ba('0x5f')]['id'];_0x4c49fb[_0x85ba('0x60')]['id']=_0x3bd105[_0x85ba('0x56')][_0x85ba('0x5e')];return db['FaxMessage'][_0x85ba('0x55')]({'where':{'id':_0x3bd105[_0x85ba('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xd6dac8,null))[_0x85ba('0x1c')](saveUpdates(_0x3bd105[_0x85ba('0x56')],null))[_0x85ba('0x1c')](function(_0x5d514a){if(_0x5d514a){_0x4c49fb[_0x85ba('0x24')]=_0x5d514a[_0x85ba('0x61')]({'plain':!![]});return db[_0x85ba('0x62')][_0x85ba('0x55')]({'where':{'id':_0x5d514a['FaxInteractionId']}});}return null;})[_0x85ba('0x1c')](handleEntityNotFound(_0xd6dac8,null))[_0x85ba('0x1c')](function(_0x40ddd3){if(_0x40ddd3){return _0x40ddd3['update']({'UserId':_0x3bd105[_0x85ba('0x56')][_0x85ba('0x5e')],'read1stAt':_['isNil'](_0x40ddd3[_0x85ba('0x63')])?moment()[_0x85ba('0x5c')](_0x85ba('0x5d')):undefined});}return null;})[_0x85ba('0x1c')](function(_0x182bd2){if(_0x182bd2){_0x4c49fb[_0x85ba('0x64')]=_0x182bd2['get']({'plain':!![]});interaction_log[_0x85ba('0x25')](_0x85ba('0x65'),_0x3bd105[_0x85ba('0x5f')]['id'],_0x3bd105['user']['name'],_0x3bd105[_0x85ba('0x5f')]['role'],_0x4c49fb[_0x85ba('0x64')]['id'],_0x3bd105['body']?JSON[_0x85ba('0x21')](_0x3bd105[_0x85ba('0x56')]):_0x85ba('0x66'));return respondWithRpcPromise(_0x85ba('0x67'),_0x85ba('0x68'),_0x4c49fb);}return null;})[_0x85ba('0x1c')](function(_0x556985){var _0x51982b=_0x85ba('0x69')+_0x556985[_0x85ba('0x24')]['ContactId'];return db['sequelize']['query'](_0x51982b,{'type':db[_0x85ba('0x6a')][_0x85ba('0x6b')]['SELECT'],'raw':!![]})['then'](function(_0x33e5ce){return _0x33e5ce;});})[_0x85ba('0x1c')](function(_0x42462a){if(_0x42462a){_0x4c49fb[_0x85ba('0x24')]['contact']=_0x42462a[0x0];if(!_0x3bd105[_0x85ba('0x56')][_0x85ba('0x5e')])return;return db[_0x85ba('0x6c')]['find']({'where':{'id':_0x3bd105['body']['UserId'],'role':_0x85ba('0x60')},'attributes':['id','name',_0x85ba('0x6d'),_0x85ba('0x6e'),_0x85ba('0x6f')],'raw':!![]});}return null;})['then'](function(_0x2a103a){if(!_0x2a103a)return null;_0x4c49fb[_0x85ba('0x24')][_0x85ba('0x60')]=_0x2a103a;return _0x4c49fb;})[_0x85ba('0x1c')](function(_0x5bbeeb){if(_0x5bbeeb){if(_0x3bd105[_0x85ba('0x56')]['manual']){_0x4c49fb[_0x85ba('0x24')]['interface']=util[_0x85ba('0x5c')](_0x85ba('0x70'),_0x3bd105[_0x85ba('0x5f')][_0x85ba('0x38')]);_0x4c49fb[_0x85ba('0x24')][_0x85ba('0x71')]=_0x4c49fb['channel'];_0x4c49fb[_0x85ba('0x24')][_0x85ba('0x72')]=_0x4c49fb[_0x85ba('0x71')];_0x4c49fb[_0x85ba('0x24')][_0x85ba('0x73')]=_0x85ba('0x59');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x85ba('0x74'),'message':_0x4c49fb[_0x85ba('0x24')]},client9002)['then'](function(){return _0x4c49fb;});}return _0x4c49fb;}return null;})['then'](respondWithResult(_0xd6dac8,null))[_0x85ba('0x27')](handleError(_0xd6dac8,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x85ba('0x32')]=function(_0x411e19,_0x2608e0,_0xc1697e){var _0x5f3bc2={'agent':{},'channel':'fax'};if(_0x411e19[_0x85ba('0x56')]['id']){delete _0x411e19[_0x85ba('0x56')]['id'];}_0x411e19[_0x85ba('0x56')][_0x85ba('0x5e')]=_0x411e19['body'][_0x85ba('0x5e')]||_0x411e19[_0x85ba('0x5f')]['id'];_0x5f3bc2['agent']['id']=_0x411e19[_0x85ba('0x56')][_0x85ba('0x5e')];return db[_0x85ba('0x4d')]['find']({'where':{'id':_0x411e19[_0x85ba('0x52')]['id'],'UserId':null}})[_0x85ba('0x1c')](handleEntityNotFound(_0x2608e0,null))[_0x85ba('0x1c')](function(_0x235843){if(_0x235843){_0x5f3bc2['message']=_0x235843[_0x85ba('0x61')]({'plain':!![]});return db[_0x85ba('0x62')]['find']({'where':{'id':_0x235843[_0x85ba('0x75')]}});}return null;})[_0x85ba('0x1c')](handleEntityNotFound(_0x2608e0,null))[_0x85ba('0x1c')](function(_0x4bf9e1){if(_0x4bf9e1){_0x5f3bc2[_0x85ba('0x64')]=_0x4bf9e1[_0x85ba('0x61')]({'plain':!![]});interaction_log['info'](_0x85ba('0x76'),_0x411e19[_0x85ba('0x5f')]['id'],_0x411e19[_0x85ba('0x5f')][_0x85ba('0x38')],_0x411e19[_0x85ba('0x5f')][_0x85ba('0x77')],_0x5f3bc2['interaction']['id'],_0x411e19[_0x85ba('0x56')]?JSON[_0x85ba('0x21')](_0x411e19[_0x85ba('0x56')]):_0x85ba('0x66'));return respondWithRpcPromise(_0x85ba('0x78'),'rejectMessage',_0x5f3bc2);}return null;})[_0x85ba('0x1c')](function(_0x26187a){var _0x455a31=_0x85ba('0x69')+_0x26187a['message'][_0x85ba('0x79')];return db[_0x85ba('0x7a')][_0x85ba('0x3f')](_0x455a31,{'type':db[_0x85ba('0x6a')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x4acb15){return _0x4acb15;});})['then'](function(_0x33c492){if(_0x33c492){_0x5f3bc2[_0x85ba('0x24')][_0x85ba('0x7b')]=_0x33c492[0x0];if(!_0x411e19[_0x85ba('0x56')][_0x85ba('0x5e')])return;return db[_0x85ba('0x6c')]['find']({'where':{'id':_0x411e19['body'][_0x85ba('0x5e')],'role':_0x85ba('0x60')},'attributes':['id',_0x85ba('0x38'),_0x85ba('0x6d'),'email',_0x85ba('0x6f')],'raw':!![]});}return null;})['then'](function(_0x122f2d){if(!_0x122f2d)return null;_0x5f3bc2['message']['agent']=_0x122f2d;return _0x5f3bc2;})[_0x85ba('0x1c')](function(_0x167e6c){if(_0x167e6c){_0x167e6c[_0x85ba('0x24')][_0x85ba('0x7c')]=util[_0x85ba('0x5c')](_0x85ba('0x70'),_0x411e19[_0x85ba('0x5f')][_0x85ba('0x38')]);_0x167e6c[_0x85ba('0x24')][_0x85ba('0x71')]=_0x5f3bc2[_0x85ba('0x71')];_0x167e6c[_0x85ba('0x24')][_0x85ba('0x72')]=_0x5f3bc2[_0x85ba('0x71')];_0x167e6c['message'][_0x85ba('0x73')]=_0x85ba('0x32');respondWithRpcPromise(_0x85ba('0x7d'),_0x85ba('0x7d'),{'event':_0x85ba('0x7e'),'message':_0x167e6c[_0x85ba('0x24')]},client9002);return _0x5f3bc2;}return null;})[_0x85ba('0x1c')](respondWithResult(_0x2608e0,null))[_0x85ba('0x27')](handleError(_0x2608e0,null));};exports[_0x85ba('0x7f')]=function(_0x9d0bbf,_0x51b687){var _0xfd39;return db[_0x85ba('0x4d')]['create'](_0x9d0bbf[_0x85ba('0x56')],{})[_0x85ba('0x1c')](function(_0x2ac974){_0xfd39=_0x2ac974;return db[_0x85ba('0x80')][_0x85ba('0x81')]({'where':{'id':_0xfd39[_0x85ba('0x79')]}});})[_0x85ba('0x1c')](function(_0x2c1a27){if(_['isNil'](_0x2c1a27)){return;}else{_0xfd39['fax']=_0x2c1a27[_0x85ba('0x5a')];return db[_0x85ba('0x82')][_0x85ba('0x81')]({'where':{'id':_0xfd39['AttachmentId']}});}})[_0x85ba('0x1c')](function(_0x5366d7){return respondWithRpcPromise('SendFax',_0x85ba('0x83'),{'FaxAccountId':_[_0x85ba('0x84')](_0x9d0bbf[_0x85ba('0x56')])?undefined:_0x9d0bbf['body'][_0x85ba('0x85')],'path':_[_0x85ba('0x84')](_0x5366d7)?undefined:util['format'](_0x85ba('0x86'),_0x5366d7[_0x85ba('0x87')]),'fax':_['isNil'](_0xfd39[_0x85ba('0x5a')])?undefined:_0xfd39[_0x85ba('0x5a')],'AttachmentId':_0xfd39[_0x85ba('0x88')]},client9002);})['then'](respondWithResult(_0x51b687,0xc9))[_0x85ba('0x27')](handleError(_0x51b687,null));};exports[_0x85ba('0x89')]=function(_0x5dff39,_0x26c086){var _0x422132=path['join'](config[_0x85ba('0x8a')],_0x85ba('0x8b'),_0x85ba('0x8c'),_0x85ba('0x8d'));return db['FaxMessage']['find']({'where':{'id':_0x5dff39[_0x85ba('0x52')]['id']},'include':[{'model':db[_0x85ba('0x82')],'as':_0x85ba('0x82')}]})[_0x85ba('0x1c')](handleEntityNotFound(_0x26c086,null))[_0x85ba('0x1c')](function(_0x244323){if(_0x244323){return _0x26c086['download'](path[_0x85ba('0x8e')](_0x422132,_0x244323[_0x85ba('0x82')][_0x85ba('0x87')]));}})[_0x85ba('0x27')](handleError(_0x26c086,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 6dbe5a3..cd90d71 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 _0x9505=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners'];(function(_0x4f28e1,_0x34536b){var _0x5e629c=function(_0x1dd972){while(--_0x1dd972){_0x4f28e1['push'](_0x4f28e1['shift']());}};_0x5e629c(++_0x34536b);}(_0x9505,0x1e5));var _0x5950=function(_0x284777,_0x1b3c27){_0x284777=_0x284777-0x0;var _0x37dfe9=_0x9505[_0x284777];return _0x37dfe9;};'use strict';var EventEmitter=require(_0x5950('0x0'));var FaxMessage=require(_0x5950('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x5950('0x2')](0x0);var events={'afterCreate':_0x5950('0x3'),'afterUpdate':_0x5950('0x4'),'afterDestroy':_0x5950('0x5')};function emitEvent(_0x1344e4){return function(_0x4d3220,_0x48219e,_0x2494fc){FaxMessageEvents[_0x5950('0x6')](_0x1344e4+':'+_0x4d3220['id'],_0x4d3220);FaxMessageEvents[_0x5950('0x6')](_0x1344e4,_0x4d3220);_0x2494fc(null);};}for(var e in events){if(events[_0x5950('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0xc9ab=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage'];(function(_0x1e95d1,_0x189454){var _0x3e3f59=function(_0x4aae4b){while(--_0x4aae4b){_0x1e95d1['push'](_0x1e95d1['shift']());}};_0x3e3f59(++_0x189454);}(_0xc9ab,0x125));var _0xbc9a=function(_0xc8ffa5,_0x1fd15f){_0xc8ffa5=_0xc8ffa5-0x0;var _0x35bc1b=_0xc9ab[_0xc8ffa5];return _0x35bc1b;};'use strict';var EventEmitter=require(_0xbc9a('0x0'));var FaxMessage=require(_0xbc9a('0x1'))['db'][_0xbc9a('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xbc9a('0x3')};function emitEvent(_0x20e8eb){return function(_0x23d40c,_0x33e557,_0x16f84d){FaxMessageEvents[_0xbc9a('0x4')](_0x20e8eb+':'+_0x23d40c['id'],_0x23d40c);FaxMessageEvents[_0xbc9a('0x4')](_0x20e8eb,_0x23d40c);_0x16f84d(null);};}for(var e in events){if(events[_0xbc9a('0x5')](e)){var event=events[e];FaxMessage[_0xbc9a('0x6')](e,emitEvent(event));}}module[_0xbc9a('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 3c15b84..9c5b129 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 _0xfe18=['./faxMessage.attributes','exports','FaxMessage','fax_messages','body','FULLTEXT','direction','toLowerCase','out','isNil','UserId','FaxInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x403f05,_0x3dc2db){var _0x220c4a=function(_0x2a0f37){while(--_0x2a0f37){_0x403f05['push'](_0x403f05['shift']());}};_0x220c4a(++_0x3dc2db);}(_0xfe18,0x19c));var _0x8fe1=function(_0x2204ef,_0x10b4eb){_0x2204ef=_0x2204ef-0x0;var _0x4ac9f2=_0xfe18[_0x2204ef];return _0x4ac9f2;};'use strict';var _=require(_0x8fe1('0x0'));var util=require(_0x8fe1('0x1'));var logger=require('../../config/logger')(_0x8fe1('0x2'));var moment=require(_0x8fe1('0x3'));var BPromise=require(_0x8fe1('0x4'));var rp=require(_0x8fe1('0x5'));var fs=require('fs');var path=require(_0x8fe1('0x6'));var rimraf=require('rimraf');var config=require(_0x8fe1('0x7'));var attributes=require(_0x8fe1('0x8'));module[_0x8fe1('0x9')]=function(_0x4d05a9,_0x55bf09){return _0x4d05a9['define'](_0x8fe1('0xa'),attributes,{'tableName':_0x8fe1('0xb'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x8fe1('0xc')],'type':_0x8fe1('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x33acf2,_0x13c2a0,_0x490269){var _0x42d0cc=_0x4d05a9['models'];var _0x2e5b5e=_0x33acf2['get']({'plain':!![]});if(_0x2e5b5e['direction']['toLowerCase']()==='in'||_0x2e5b5e[_0x8fe1('0xe')][_0x8fe1('0xf')]()===_0x8fe1('0x10')&&!_0x2e5b5e['secret']&&!_[_0x8fe1('0x11')](_0x2e5b5e[_0x8fe1('0x12')])){_0x42d0cc[_0x8fe1('0x13')][_0x8fe1('0x14')]({'where':{'id':_0x2e5b5e['FaxInteractionId']}})[_0x8fe1('0x15')](function(_0x5258e2){if(_0x5258e2){_0x5258e2[_0x8fe1('0x16')]({'lastMsgAt':_0x2e5b5e[_0x8fe1('0x17')],'lastMsgDirection':_0x2e5b5e[_0x8fe1('0xe')][_0x8fe1('0xf')]()});}})[_0x8fe1('0x18')](function(_0x177158){console[_0x8fe1('0x19')](_0x177158);});}_0x490269();}},'charset':_0x8fe1('0x1a'),'collate':_0x8fe1('0x1b')});}; \ No newline at end of file +var _0x8483=['request-promise','path','../../config/environment','./faxMessage.attributes','exports','fax_messages','fti_fax_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird'];(function(_0x56b2e4,_0x3e4439){var _0x1e688f=function(_0x384fae){while(--_0x384fae){_0x56b2e4['push'](_0x56b2e4['shift']());}};_0x1e688f(++_0x3e4439);}(_0x8483,0x73));var _0x3848=function(_0x217419,_0x187e73){_0x217419=_0x217419-0x0;var _0x2282ee=_0x8483[_0x217419];return _0x2282ee;};'use strict';var _=require(_0x3848('0x0'));var util=require(_0x3848('0x1'));var logger=require(_0x3848('0x2'))('api');var moment=require(_0x3848('0x3'));var BPromise=require(_0x3848('0x4'));var rp=require(_0x3848('0x5'));var fs=require('fs');var path=require(_0x3848('0x6'));var rimraf=require('rimraf');var config=require(_0x3848('0x7'));var attributes=require(_0x3848('0x8'));module[_0x3848('0x9')]=function(_0xedf675,_0x471f59){return _0xedf675['define']('FaxMessage',attributes,{'tableName':_0x3848('0xa'),'paranoid':![],'indexes':[{'name':_0x3848('0xb'),'fields':[_0x3848('0xc')],'type':_0x3848('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x48d6c9,_0x1b851f,_0x2e1940){var _0x40efe4=_0xedf675['models'];var _0x3592bc=_0x48d6c9[_0x3848('0xe')]({'plain':!![]});if(_0x3592bc[_0x3848('0xf')][_0x3848('0x10')]()==='in'||_0x3592bc[_0x3848('0xf')][_0x3848('0x10')]()===_0x3848('0x11')&&!_0x3592bc[_0x3848('0x12')]&&!_[_0x3848('0x13')](_0x3592bc[_0x3848('0x14')])){_0x40efe4[_0x3848('0x15')][_0x3848('0x16')]({'where':{'id':_0x3592bc[_0x3848('0x17')]}})['then'](function(_0x43e04f){if(_0x43e04f){_0x43e04f[_0x3848('0x18')]({'lastMsgAt':_0x3592bc[_0x3848('0x19')],'lastMsgDirection':_0x3592bc[_0x3848('0xf')][_0x3848('0x10')]()});}})[_0x3848('0x1a')](function(_0x4b2e6a){console[_0x3848('0x1b')](_0x4b2e6a);});}_0x2e1940();}},'charset':_0x3848('0x1c'),'collate':_0x3848('0x1d')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 5f6f316..12bd73a 100644 --- a/server/api/faxMessage/faxMessage.rpc.js +++ b/server/api/faxMessage/faxMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','catch','options','raw','then','CreateFaxMessage','attributes','limit','UpdateFaxMessage','stringify','lodash','util','moment','bluebird'];(function(_0x577f24,_0x415e8c){var _0x4b82f7=function(_0x5239f9){while(--_0x5239f9){_0x577f24['push'](_0x577f24['shift']());}};_0x4b82f7(++_0x415e8c);}(_0x008c,0x188));var _0xc008=function(_0x5ee71e,_0x28e6bf){_0x5ee71e=_0x5ee71e-0x0;var _0x1675b1=_0x008c[_0x5ee71e];return _0x1675b1;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});config[_0xc008('0xd')]=_['defaults'](config[_0xc008('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xc008('0xe'))(new Redis(config['redis']));require('./faxMessage.socket')[_0xc008('0xf')](socket);function respondWithRpcPromise(_0x7231b4,_0x57c46d,_0x51ba7d){return new BPromise(function(_0x543eb8,_0x1eacfa){return client[_0xc008('0x10')](_0x7231b4,_0x51ba7d)['then'](function(_0xae2dab){logger[_0xc008('0x11')](_0xc008('0x12'),_0x57c46d,_0xc008('0x13'));logger[_0xc008('0x14')](_0xc008('0x15'),_0x57c46d,_0xc008('0x13'),JSON['stringify'](_0xae2dab));if(_0xae2dab['error']){if(_0xae2dab[_0xc008('0x16')]['code']===0x1f4){logger[_0xc008('0x16')](_0xc008('0x12'),_0x57c46d,_0xae2dab[_0xc008('0x16')][_0xc008('0x17')]);return _0x1eacfa(_0xae2dab[_0xc008('0x16')]['message']);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x57c46d,_0xae2dab[_0xc008('0x16')][_0xc008('0x17')]);return _0x543eb8(_0xae2dab[_0xc008('0x16')][_0xc008('0x17')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x57c46d,'request\x20sent');_0x543eb8(_0xae2dab['result'][_0xc008('0x17')]);}})[_0xc008('0x18')](function(_0x501137){logger[_0xc008('0x16')]('FaxMessage,\x20%s,\x20%s',_0x57c46d,_0x501137);_0x1eacfa(_0x501137);});});}exports['CreateFaxMessage']=function(_0x543e5d){var _0x50261c=this;return new Promise(function(_0x5754a0,_0x4b9726){return db['FaxMessage']['create'](_0x543e5d['body'],{'raw':_0x543e5d['options']?_0x543e5d[_0xc008('0x19')][_0xc008('0x1a')]===undefined?!![]:![]:!![]})[_0xc008('0x1b')](function(_0x415af3){logger[_0xc008('0x11')](_0xc008('0x1c'),_0x543e5d);logger['debug'](_0xc008('0x1c'),_0x543e5d,JSON['stringify'](_0x415af3));_0x5754a0(_0x415af3);})['catch'](function(_0x218599){logger[_0xc008('0x16')](_0xc008('0x1c'),_0x218599[_0xc008('0x17')],_0x543e5d);_0x4b9726(_0x50261c['error'](0x1f4,_0x218599['message']));});});};exports['UpdateFaxMessage']=function(_0x3f7b07){var _0x15dade=this;return new Promise(function(_0x92c582,_0x2e31c2){return db['FaxMessage']['update'](_0x3f7b07['body'],{'raw':_0x3f7b07['options']?_0x3f7b07['options'][_0xc008('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f7b07[_0xc008('0x19')]?_0x3f7b07[_0xc008('0x19')]['where']||null:null,'attributes':_0x3f7b07[_0xc008('0x19')]?_0x3f7b07[_0xc008('0x19')][_0xc008('0x1d')]||null:null,'limit':_0x3f7b07[_0xc008('0x19')]?_0x3f7b07['options'][_0xc008('0x1e')]||null:null})[_0xc008('0x1b')](function(_0x53ed35){logger['info']('UpdateFaxMessage',_0x3f7b07);logger[_0xc008('0x14')](_0xc008('0x1f'),_0x3f7b07,JSON[_0xc008('0x20')](_0x53ed35));_0x92c582(_0x53ed35);})[_0xc008('0x18')](function(_0x1de04b){logger[_0xc008('0x16')](_0xc008('0x1f'),_0x1de04b[_0xc008('0x17')],_0x3f7b07);_0x2e31c2(_0x15dade[_0xc008('0x16')](0x1f4,_0x1de04b[_0xc008('0x17')]));});});}; \ No newline at end of file +var _0x4ea3=['message','result','catch','body','options','CreateFaxMessage','update','where','attributes','UpdateFaxMessage','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5b8f6d,_0x15ecd0){var _0x729fba=function(_0xfeecfc){while(--_0xfeecfc){_0x5b8f6d['push'](_0x5b8f6d['shift']());}};_0x729fba(++_0x15ecd0);}(_0x4ea3,0x70));var _0x34ea=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4ea3[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var moment=require(_0x34ea('0x2'));var BPromise=require(_0x34ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x34ea('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x34ea('0x6'));var jayson=require(_0x34ea('0x7'));var client=jayson[_0x34ea('0x8')][_0x34ea('0x9')]({'port':0x232a});config[_0x34ea('0xa')]=_[_0x34ea('0xb')](config[_0x34ea('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x34ea('0xc'))(new Redis(config[_0x34ea('0xa')]));require(_0x34ea('0xd'))['register'](socket);function respondWithRpcPromise(_0x301b98,_0xea1be2,_0x5126de){return new BPromise(function(_0x4a76b1,_0x5bd8b6){return client[_0x34ea('0xe')](_0x301b98,_0x5126de)[_0x34ea('0xf')](function(_0x58bb0d){logger[_0x34ea('0x10')](_0x34ea('0x11'),_0xea1be2,_0x34ea('0x12'));logger[_0x34ea('0x13')](_0x34ea('0x14'),_0xea1be2,_0x34ea('0x12'),JSON[_0x34ea('0x15')](_0x58bb0d));if(_0x58bb0d[_0x34ea('0x16')]){if(_0x58bb0d[_0x34ea('0x16')][_0x34ea('0x17')]===0x1f4){logger[_0x34ea('0x16')]('FaxMessage,\x20%s,\x20%s',_0xea1be2,_0x58bb0d[_0x34ea('0x16')][_0x34ea('0x18')]);return _0x5bd8b6(_0x58bb0d[_0x34ea('0x16')][_0x34ea('0x18')]);}logger[_0x34ea('0x16')]('FaxMessage,\x20%s,\x20%s',_0xea1be2,_0x58bb0d[_0x34ea('0x16')][_0x34ea('0x18')]);return _0x4a76b1(_0x58bb0d[_0x34ea('0x16')][_0x34ea('0x18')]);}else{logger['info'](_0x34ea('0x11'),_0xea1be2,_0x34ea('0x12'));_0x4a76b1(_0x58bb0d[_0x34ea('0x19')]['message']);}})[_0x34ea('0x1a')](function(_0x1353de){logger[_0x34ea('0x16')](_0x34ea('0x11'),_0xea1be2,_0x1353de);_0x5bd8b6(_0x1353de);});});}exports['CreateFaxMessage']=function(_0x2eea57){var _0x35328c=this;return new Promise(function(_0x287aaa,_0x247ee7){return db['FaxMessage']['create'](_0x2eea57[_0x34ea('0x1b')],{'raw':_0x2eea57[_0x34ea('0x1c')]?_0x2eea57[_0x34ea('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2eafc6){logger[_0x34ea('0x10')](_0x34ea('0x1d'),_0x2eea57);logger[_0x34ea('0x13')](_0x34ea('0x1d'),_0x2eea57,JSON[_0x34ea('0x15')](_0x2eafc6));_0x287aaa(_0x2eafc6);})['catch'](function(_0xf24962){logger[_0x34ea('0x16')](_0x34ea('0x1d'),_0xf24962[_0x34ea('0x18')],_0x2eea57);_0x247ee7(_0x35328c['error'](0x1f4,_0xf24962['message']));});});};exports['UpdateFaxMessage']=function(_0x142709){var _0x187306=this;return new Promise(function(_0x37c214,_0x4204d7){return db['FaxMessage'][_0x34ea('0x1e')](_0x142709[_0x34ea('0x1b')],{'raw':_0x142709[_0x34ea('0x1c')]?_0x142709['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x142709['options']?_0x142709['options'][_0x34ea('0x1f')]||null:null,'attributes':_0x142709[_0x34ea('0x1c')]?_0x142709[_0x34ea('0x1c')][_0x34ea('0x20')]||null:null,'limit':_0x142709['options']?_0x142709[_0x34ea('0x1c')]['limit']||null:null})[_0x34ea('0xf')](function(_0x4f2b77){logger[_0x34ea('0x10')](_0x34ea('0x21'),_0x142709);logger[_0x34ea('0x13')]('UpdateFaxMessage',_0x142709,JSON[_0x34ea('0x15')](_0x4f2b77));_0x37c214(_0x4f2b77);})[_0x34ea('0x1a')](function(_0x55c8ba){logger[_0x34ea('0x16')]('UpdateFaxMessage',_0x55c8ba[_0x34ea('0x18')],_0x142709);_0x4204d7(_0x187306[_0x34ea('0x16')](0x1f4,_0x55c8ba[_0x34ea('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index f059601..c77604d 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 _0x97a5=['removeListener','faxMessage:','./faxMessage.events','save','remove'];(function(_0x5a405b,_0x4e0417){var _0x59810d=function(_0x22b33f){while(--_0x22b33f){_0x5a405b['push'](_0x5a405b['shift']());}};_0x59810d(++_0x4e0417);}(_0x97a5,0x1d8));var _0x597a=function(_0x1b2d37,_0x27293c){_0x1b2d37=_0x1b2d37-0x0;var _0x1671b1=_0x97a5[_0x1b2d37];return _0x1671b1;};'use strict';var FaxMessageEvents=require(_0x597a('0x0'));var events=[_0x597a('0x1'),_0x597a('0x2'),'update'];function createListener(_0x48b7c1,_0x3a5b5d){return function(_0x50e3f0){_0x3a5b5d['emit'](_0x48b7c1,_0x50e3f0);};}function removeListener(_0x489fd4,_0x47856a){return function(){FaxMessageEvents[_0x597a('0x3')](_0x489fd4,_0x47856a);};}exports['register']=function(_0x206a24){for(var _0x1d2cef=0x0,_0x24737e=events['length'];_0x1d2cef<_0x24737e;_0x1d2cef++){var _0x35f59c=events[_0x1d2cef];var _0x40ec0f=createListener(_0x597a('0x4')+_0x35f59c,_0x206a24);FaxMessageEvents['on'](_0x35f59c,_0x40ec0f);}}; \ No newline at end of file +var _0x96aa=['update','emit','removeListener','register','length','faxMessage:','./faxMessage.events','save','remove'];(function(_0x4be8be,_0x35672c){var _0x1dd44b=function(_0x1c38f8){while(--_0x1c38f8){_0x4be8be['push'](_0x4be8be['shift']());}};_0x1dd44b(++_0x35672c);}(_0x96aa,0x114));var _0xa96a=function(_0x247851,_0x4f964b){_0x247851=_0x247851-0x0;var _0x276acb=_0x96aa[_0x247851];return _0x276acb;};'use strict';var FaxMessageEvents=require(_0xa96a('0x0'));var events=[_0xa96a('0x1'),_0xa96a('0x2'),_0xa96a('0x3')];function createListener(_0x5216e4,_0x25543d){return function(_0xe8ad9e){_0x25543d[_0xa96a('0x4')](_0x5216e4,_0xe8ad9e);};}function removeListener(_0xad1482,_0x3aa524){return function(){FaxMessageEvents[_0xa96a('0x5')](_0xad1482,_0x3aa524);};}exports[_0xa96a('0x6')]=function(_0x77880b){for(var _0x27da05=0x0,_0x518658=events[_0xa96a('0x7')];_0x27da05<_0x518658;_0x27da05++){var _0xf43c1f=events[_0x27da05];var _0x580fde=createListener(_0xa96a('0x8')+_0xf43c1f,_0x77880b);FaxMessageEvents['on'](_0xf43c1f,_0x580fde);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 761cdb1..b5d492e 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 _0x6f7a=['tracked','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','show','download','post'];(function(_0x527a53,_0x3265d6){var _0x2332f5=function(_0x3b2d90){while(--_0x3b2d90){_0x527a53['push'](_0x527a53['shift']());}};_0x2332f5(++_0x3265d6);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x18b73a,_0x1861ee){_0x18b73a=_0x18b73a-0x0;var _0x36b204=_0x6f7a[_0x18b73a];return _0x36b204;};'use strict';var multer=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var path=require(_0xa6f7('0x2'));var timeout=require(_0xa6f7('0x3'));var express=require('express');var router=express[_0xa6f7('0x4')]();var fs_extra=require(_0xa6f7('0x5'));var auth=require(_0xa6f7('0x6'));var interaction=require(_0xa6f7('0x7'));var config=require(_0xa6f7('0x8'));var controller=require(_0xa6f7('0x9'));router[_0xa6f7('0xa')]('/',auth[_0xa6f7('0xb')](),controller[_0xa6f7('0xc')]);router[_0xa6f7('0xa')](_0xa6f7('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xa6f7('0xa')](_0xa6f7('0xe'),auth[_0xa6f7('0xb')](),controller[_0xa6f7('0xf')]);router[_0xa6f7('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0xa6f7('0x10')]);router[_0xa6f7('0x11')]('/',auth['isAuthenticated'](),interaction[_0xa6f7('0x12')]('fax',_0xa6f7('0x13')),controller[_0xa6f7('0x14')]);router[_0xa6f7('0x15')](_0xa6f7('0xe'),auth['isAuthenticated'](),controller[_0xa6f7('0x16')]);router['put'](_0xa6f7('0x17'),auth[_0xa6f7('0xb')](),controller[_0xa6f7('0x18')]);router['put'](_0xa6f7('0x19'),auth['isAuthenticated'](),controller[_0xa6f7('0x1a')]);router['delete'](_0xa6f7('0xe'),auth[_0xa6f7('0xb')](),controller[_0xa6f7('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x9bde=['index','/describe','isAuthenticated','describe','/:id','show','download','post','fax','faxmessage:create','create','put','/:id/accept','/:id/reject','reject','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get'];(function(_0x3e59c8,_0x5ec82d){var _0x5a1273=function(_0x502dba){while(--_0x502dba){_0x3e59c8['push'](_0x3e59c8['shift']());}};_0x5a1273(++_0x5ec82d);}(_0x9bde,0xe1));var _0xe9bd=function(_0x59630d,_0x49af34){_0x59630d=_0x59630d-0x0;var _0x3402ed=_0x9bde[_0x59630d];return _0x3402ed;};'use strict';var multer=require('multer');var util=require(_0xe9bd('0x0'));var path=require('path');var timeout=require(_0xe9bd('0x1'));var express=require('express');var router=express[_0xe9bd('0x2')]();var fs_extra=require(_0xe9bd('0x3'));var auth=require(_0xe9bd('0x4'));var interaction=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var controller=require(_0xe9bd('0x7'));router[_0xe9bd('0x8')]('/',auth['isAuthenticated'](),controller[_0xe9bd('0x9')]);router[_0xe9bd('0x8')](_0xe9bd('0xa'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xc')]);router[_0xe9bd('0x8')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xe')]);router[_0xe9bd('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xe9bd('0xf')]);router[_0xe9bd('0x10')]('/',auth[_0xe9bd('0xb')](),interaction['tracked'](_0xe9bd('0x11'),_0xe9bd('0x12')),controller[_0xe9bd('0x13')]);router[_0xe9bd('0x14')]('/:id',auth[_0xe9bd('0xb')](),controller['update']);router[_0xe9bd('0x14')](_0xe9bd('0x15'),auth[_0xe9bd('0xb')](),controller['accept']);router['put'](_0xe9bd('0x16'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0x17')]);router[_0xe9bd('0x18')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 74bfef5..a80d3f8 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 _0x202a=['INTEGER','roundrobin','exports','STRING','name'];(function(_0xb1496a,_0x190543){var _0x301916=function(_0x4e17ab){while(--_0x4e17ab){_0xb1496a['push'](_0xb1496a['shift']());}};_0x301916(++_0x190543);}(_0x202a,0xc0));var _0xa202=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x202a[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0xa202('0x0')]={'name':{'type':Sequelize[_0xa202('0x1')],'unique':_0xa202('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa202('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0xa202('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa202('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x50c1=['STRING','ENUM','beepall','INTEGER','sequelize'];(function(_0x3eb63b,_0x2824ea){var _0x108d39=function(_0x369ba2){while(--_0x369ba2){_0x3eb63b['push'](_0x3eb63b['shift']());}};_0x108d39(++_0x2824ea);}(_0x50c1,0x171));var _0x150c=function(_0x4e5967,_0x4f209d){_0x4e5967=_0x4e5967-0x0;var _0x2fc6df=_0x50c1[_0x4e5967];return _0x2fc6df;};'use strict';var Sequelize=require(_0x150c('0x0'));module['exports']={'name':{'type':Sequelize[_0x150c('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x150c('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x150c('0x2')]('rrmemory',_0x150c('0x3'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x150c('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 71128b6..4a9b5db 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 _0x7279=['lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./faxQueue.socket','register','status','json','offset','limit','undefined','count','set','apply','reject','save','then','get','destroy','sendStatus','stack','name','index','map','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','FaxQueue','findAll','rows','catch','show','params','length','find','create','body','user','UserProfileSection','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','keys','UserFaxQueue','rawAttributes','order','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','User','Agents','online','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','removeTeams','select','field','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','all','compact','value','emit','userFaxQueue:remove','addAgents','spread','removeAgents','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x26a7b9,_0x1d6981){var _0xcef96d=function(_0x4f95b2){while(--_0x4f95b2){_0x26a7b9['push'](_0x26a7b9['shift']());}};_0xcef96d(++_0x1d6981);}(_0x7279,0xff));var _0x9727=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7279[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9727('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9727('0x1'));var rp=require(_0x9727('0x2'));var moment=require(_0x9727('0x3'));var BPromise=require(_0x9727('0x4'));var Mustache=require('mustache');var util=require(_0x9727('0x5'));var path=require(_0x9727('0x6'));var sox=require(_0x9727('0x7'));var csv=require(_0x9727('0x8'));var ejs=require(_0x9727('0x9'));var fs=require('fs');var fs_extra=require(_0x9727('0xa'));var _=require(_0x9727('0xb'));var squel=require(_0x9727('0xc'));var crypto=require(_0x9727('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9727('0x8'));var querystring=require(_0x9727('0xe'));var Papa=require(_0x9727('0xf'));var Redis=require('ioredis');var authService=require(_0x9727('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9727('0x11'))(_0x9727('0x12'));var utils=require(_0x9727('0x13'));var config=require(_0x9727('0x14'));var licenseUtil=require(_0x9727('0x15'));var db=require(_0x9727('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x9727('0x17'),'port':0x18eb});var socket=require(_0x9727('0x18'))(new Redis(config[_0x9727('0x19')]));require(_0x9727('0x1a'))[_0x9727('0x1b')](socket);function respondWithStatusCode(_0x19b10b,_0x10f067){_0x10f067=_0x10f067||0xcc;return function(_0x22e1b5){if(_0x22e1b5){return _0x19b10b['sendStatus'](_0x10f067);}return _0x19b10b[_0x9727('0x1c')](_0x10f067)['end']();};}function respondWithResult(_0x14d5fc,_0x133fa6){_0x133fa6=_0x133fa6||0xc8;return function(_0x3ea242){if(_0x3ea242){return _0x14d5fc[_0x9727('0x1c')](_0x133fa6)[_0x9727('0x1d')](_0x3ea242);}};}function respondWithFilteredResult(_0x44ffaa,_0x30203e){return function(_0x3f2215){if(_0x3f2215){var _0x153e69=typeof _0x30203e[_0x9727('0x1e')]==='undefined'&&typeof _0x30203e[_0x9727('0x1f')]===_0x9727('0x20');var _0x57c84f=_0x3f2215[_0x9727('0x21')];var _0x19b203=_0x153e69?0x0:_0x30203e[_0x9727('0x1e')];var _0x3a160b=_0x153e69?_0x3f2215['count']:_0x30203e[_0x9727('0x1e')]+_0x30203e['limit'];var _0x47efb7;if(_0x3a160b>=_0x57c84f){_0x3a160b=_0x57c84f;_0x47efb7=0xc8;}else{_0x47efb7=0xce;}_0x44ffaa[_0x9727('0x1c')](_0x47efb7);return _0x44ffaa[_0x9727('0x22')]('Content-Range',_0x19b203+'-'+_0x3a160b+'/'+_0x57c84f)[_0x9727('0x1d')](_0x3f2215);}return null;};}function patchUpdates(_0x3a2bba){return function(_0x2f026f){try{jsonpatch[_0x9727('0x23')](_0x2f026f,_0x3a2bba,!![]);}catch(_0xeb77c1){return BPromise[_0x9727('0x24')](_0xeb77c1);}return _0x2f026f[_0x9727('0x25')]();};}function saveUpdates(_0x2d6b7d,_0x129355){return function(_0x5352be){if(_0x5352be){return _0x5352be['update'](_0x2d6b7d)[_0x9727('0x26')](function(_0x38d57e){return _0x38d57e;});}return null;};}function removeEntity(_0x5d4a56,_0x4d66ef){return function(_0x579d61){if(_0x579d61){return _0x579d61['destroy']()[_0x9727('0x26')](function(){var _0x42e497=_0x579d61[_0x9727('0x27')]({'plain':!![]});var _0x2ba845='FaxQueues';return db['UserProfileResource'][_0x9727('0x28')]({'where':{'type':_0x2ba845,'resourceId':_0x42e497['id']}})[_0x9727('0x26')](function(){return _0x579d61;});})['then'](function(){_0x5d4a56[_0x9727('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cc610,_0x22ae10){return function(_0x470c1c){if(!_0x470c1c){_0x2cc610[_0x9727('0x29')](0x194);}return _0x470c1c;};}function handleError(_0x3c5a64,_0x13f7b1){_0x13f7b1=_0x13f7b1||0x1f4;return function(_0x594569){logger['error'](_0x594569[_0x9727('0x2a')]);if(_0x594569[_0x9727('0x2b')]){delete _0x594569[_0x9727('0x2b')];}_0x3c5a64[_0x9727('0x1c')](_0x13f7b1)['send'](_0x594569);};}exports[_0x9727('0x2c')]=function(_0x5039c9,_0x49b950){var _0x19e3c4={},_0x1fe0df={},_0x6377d8={'count':0x0,'rows':[]};var _0x38c4ed=_[_0x9727('0x2d')](db['FaxQueue']['rawAttributes'],function(_0x45cbf8){return{'name':_0x45cbf8[_0x9727('0x2e')],'type':_0x45cbf8[_0x9727('0x2f')]['key']};});_0x1fe0df[_0x9727('0x30')]=_[_0x9727('0x2d')](_0x38c4ed,_0x9727('0x2b'));_0x1fe0df[_0x9727('0x31')]=_['keys'](_0x5039c9[_0x9727('0x31')]);_0x1fe0df['filters']=_[_0x9727('0x32')](_0x1fe0df[_0x9727('0x30')],_0x1fe0df[_0x9727('0x31')]);_0x19e3c4[_0x9727('0x33')]=_[_0x9727('0x32')](_0x1fe0df['model'],qs[_0x9727('0x34')](_0x5039c9['query'][_0x9727('0x34')]));_0x19e3c4[_0x9727('0x33')]=_0x19e3c4['attributes']['length']?_0x19e3c4['attributes']:_0x1fe0df['model'];if(!_0x5039c9['query'][_0x9727('0x35')](_0x9727('0x36'))){_0x19e3c4[_0x9727('0x1f')]=qs[_0x9727('0x1f')](_0x5039c9[_0x9727('0x31')][_0x9727('0x1f')]);_0x19e3c4[_0x9727('0x1e')]=qs['offset'](_0x5039c9[_0x9727('0x31')][_0x9727('0x1e')]);}_0x19e3c4['order']=qs[_0x9727('0x37')](_0x5039c9[_0x9727('0x31')]['sort']);_0x19e3c4[_0x9727('0x38')]=qs[_0x9727('0x39')](_[_0x9727('0x3a')](_0x5039c9['query'],_0x1fe0df[_0x9727('0x39')]),_0x38c4ed);if(_0x5039c9[_0x9727('0x31')][_0x9727('0x3b')]){_0x19e3c4['where']=_[_0x9727('0x3c')](_0x19e3c4['where'],{'$or':_['map'](_0x38c4ed,function(_0x10d50a){if(_0x10d50a[_0x9727('0x2f')]!==_0x9727('0x3d')){var _0x57fc34={};_0x57fc34[_0x10d50a[_0x9727('0x2b')]]={'$like':'%'+_0x5039c9[_0x9727('0x31')][_0x9727('0x3b')]+'%'};return _0x57fc34;}})});}_0x19e3c4=_[_0x9727('0x3c')]({},_0x19e3c4,_0x5039c9[_0x9727('0x3e')]);var _0x4a7d25={'where':_0x19e3c4[_0x9727('0x38')]};return db[_0x9727('0x3f')][_0x9727('0x21')](_0x4a7d25)['then'](function(_0x31f59e){_0x6377d8[_0x9727('0x21')]=_0x31f59e;if(_0x5039c9[_0x9727('0x31')]['includeAll']){_0x19e3c4['include']=[{'all':!![]}];}return db[_0x9727('0x3f')][_0x9727('0x40')](_0x19e3c4);})[_0x9727('0x26')](function(_0x545328){_0x6377d8[_0x9727('0x41')]=_0x545328;return _0x6377d8;})[_0x9727('0x26')](respondWithFilteredResult(_0x49b950,_0x19e3c4))[_0x9727('0x42')](handleError(_0x49b950,null));};exports[_0x9727('0x43')]=function(_0x4b0873,_0x4edb63){var _0x1b5a4b={'raw':!![],'where':{'id':_0x4b0873[_0x9727('0x44')]['id']}},_0x5708cf={};_0x5708cf[_0x9727('0x30')]=_['keys'](db['FaxQueue']['rawAttributes']);_0x5708cf[_0x9727('0x31')]=_['keys'](_0x4b0873[_0x9727('0x31')]);_0x5708cf[_0x9727('0x39')]=_[_0x9727('0x32')](_0x5708cf[_0x9727('0x30')],_0x5708cf[_0x9727('0x31')]);_0x1b5a4b[_0x9727('0x33')]=_[_0x9727('0x32')](_0x5708cf[_0x9727('0x30')],qs[_0x9727('0x34')](_0x4b0873[_0x9727('0x31')][_0x9727('0x34')]));_0x1b5a4b['attributes']=_0x1b5a4b[_0x9727('0x33')][_0x9727('0x45')]?_0x1b5a4b[_0x9727('0x33')]:_0x5708cf[_0x9727('0x30')];if(_0x4b0873[_0x9727('0x31')]['includeAll']){_0x1b5a4b['include']=[{'all':!![]}];}_0x1b5a4b=_['merge']({},_0x1b5a4b,_0x4b0873[_0x9727('0x3e')]);return db[_0x9727('0x3f')][_0x9727('0x46')](_0x1b5a4b)['then'](handleEntityNotFound(_0x4edb63,null))[_0x9727('0x26')](respondWithResult(_0x4edb63,null))[_0x9727('0x42')](handleError(_0x4edb63,null));};exports[_0x9727('0x47')]=function(_0x51a337,_0x16a78c){return db[_0x9727('0x3f')][_0x9727('0x47')](_0x51a337[_0x9727('0x48')],{})[_0x9727('0x26')](function(_0x109fa8){var _0x3ddcff=_0x51a337[_0x9727('0x49')][_0x9727('0x27')]({'plain':!![]});if(!_0x3ddcff)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ddcff['role']===_0x9727('0x49')){var _0xa4a0dd=_0x109fa8[_0x9727('0x27')]({'plain':!![]});var _0x23b5ce='FaxQueues';return db[_0x9727('0x4a')][_0x9727('0x46')]({'where':{'name':_0x23b5ce,'userProfileId':_0x3ddcff['userProfileId']},'raw':!![]})[_0x9727('0x26')](function(_0x117528){if(_0x117528&&_0x117528[_0x9727('0x4b')]===0x0){return db[_0x9727('0x4c')]['create']({'name':_0xa4a0dd[_0x9727('0x2b')],'resourceId':_0xa4a0dd['id'],'type':_0x117528[_0x9727('0x2b')],'sectionId':_0x117528['id']},{})[_0x9727('0x26')](function(){return _0x109fa8;});}else{return _0x109fa8;}})[_0x9727('0x42')](function(_0x30dd6c){logger[_0x9727('0x4d')](_0x9727('0x4e'),_0x30dd6c);throw _0x30dd6c;});}return _0x109fa8;})[_0x9727('0x26')](respondWithResult(_0x16a78c,0xc9))[_0x9727('0x42')](handleError(_0x16a78c,null));};exports[_0x9727('0x4f')]=function(_0x3c4e79,_0x3bad38){if(_0x3c4e79['body']['id']){delete _0x3c4e79[_0x9727('0x48')]['id'];}return db[_0x9727('0x3f')][_0x9727('0x46')]({'where':{'id':_0x3c4e79[_0x9727('0x44')]['id']}})[_0x9727('0x26')](handleEntityNotFound(_0x3bad38,null))[_0x9727('0x26')](saveUpdates(_0x3c4e79['body'],null))[_0x9727('0x26')](respondWithResult(_0x3bad38,null))[_0x9727('0x42')](handleError(_0x3bad38,null));};exports[_0x9727('0x28')]=function(_0x2e2ed5,_0x54c302){return db['FaxQueue']['find']({'where':{'id':_0x2e2ed5[_0x9727('0x44')]['id']}})['then'](handleEntityNotFound(_0x54c302,null))[_0x9727('0x26')](removeEntity(_0x54c302,null))['catch'](handleError(_0x54c302,null));};exports[_0x9727('0x50')]=function(_0x245847,_0x220fc5){return db[_0x9727('0x3f')][_0x9727('0x50')]()['then'](respondWithResult(_0x220fc5,null))[_0x9727('0x42')](handleError(_0x220fc5,null));};exports[_0x9727('0x51')]=function(_0xfdb715,_0x4c5f46,_0x1d71fd){var _0xe54d39={'raw':!![],'where':{}},_0x3cc0b2={},_0x5582c7;return db['FaxQueue'][_0x9727('0x52')]({'where':{'id':_0xfdb715[_0x9727('0x44')]['id']}})[_0x9727('0x26')](handleEntityNotFound(_0x4c5f46,null))['then'](function(_0x39d320){if(_0x39d320){_0x5582c7=_0x39d320[_0x9727('0x27')]({'plain':!![]});_0x3cc0b2[_0x9727('0x30')]=_[_0x9727('0x53')](db[_0x9727('0x54')][_0x9727('0x55')]);_0x3cc0b2[_0x9727('0x31')]=_[_0x9727('0x53')](_0xfdb715[_0x9727('0x31')]);_0x3cc0b2[_0x9727('0x39')]=_[_0x9727('0x32')](_0x3cc0b2[_0x9727('0x30')],_0x3cc0b2['query']);_0xe54d39[_0x9727('0x33')]=_['intersection'](_0x3cc0b2[_0x9727('0x30')],qs[_0x9727('0x34')](_0xfdb715[_0x9727('0x31')][_0x9727('0x34')]));_0xe54d39[_0x9727('0x33')]=_0xe54d39[_0x9727('0x33')][_0x9727('0x45')]?_0xe54d39[_0x9727('0x33')]:_0x3cc0b2[_0x9727('0x30')];if(!_0xfdb715['query'][_0x9727('0x35')](_0x9727('0x36'))){_0xe54d39['limit']=qs['limit'](_0xfdb715[_0x9727('0x31')][_0x9727('0x1f')]);_0xe54d39[_0x9727('0x1e')]=qs[_0x9727('0x1e')](_0xfdb715['query'][_0x9727('0x1e')]);}_0xe54d39[_0x9727('0x56')]=qs[_0x9727('0x37')](_0xfdb715['query'][_0x9727('0x37')]);_0xe54d39[_0x9727('0x38')]=qs['filters'](_[_0x9727('0x3a')](_0xfdb715['query'],_0x3cc0b2[_0x9727('0x39')]));_0xe54d39[_0x9727('0x38')]['FaxQueueId']=_0x39d320['id'];if(_0xfdb715[_0x9727('0x31')][_0x9727('0x3b')]){_0xe54d39[_0x9727('0x38')]=_['merge'](_0xe54d39[_0x9727('0x38')],{'$or':_[_0x9727('0x2d')](_0xe54d39[_0x9727('0x33')],function(_0x25ab67){var _0x23096e={};_0x23096e[_0x25ab67]={'$like':'%'+_0xfdb715['query']['filter']+'%'};return _0x23096e;})});}_0xe54d39=_[_0x9727('0x3c')]({},_0xe54d39,_0xfdb715[_0x9727('0x3e')]);return db[_0x9727('0x54')][_0x9727('0x40')](_0xe54d39);}})[_0x9727('0x26')](function(_0x387e08){if(_0x387e08){return db['User'][_0x9727('0x57')]({'where':{'id':_[_0x9727('0x2d')](_0x387e08,_0x9727('0x58')),'role':_0x9727('0x59')},'attributes':['id',_0x9727('0x2b'),_0x9727('0x5a'),_0x9727('0x5b'),_0x9727('0x5c')]});}})['then'](function(_0x2d11dd){if(_0x2d11dd){return{'count':_0x2d11dd[_0x9727('0x21')],'rows':_[_0x9727('0x2d')](_0x2d11dd['rows'],function(_0x17b1d2){return{'membername':_0x17b1d2[_0x9727('0x2b')],'UserId':_0x17b1d2['id'],'queue_name':_0x5582c7[_0x9727('0x2b')],'FaxQueueId':_0x5582c7['id'],'interface':util[_0x9727('0x5d')](_0x9727('0x5e'),_0x9727('0x5f'),_0x17b1d2[_0x9727('0x2b')]),'penalty':0x0,'paused':_0x17b1d2['faxPause'],'createdAt':_0x17b1d2[_0x9727('0x5c')],'updatedAt':_0x17b1d2[_0x9727('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9727('0x26')](respondWithFilteredResult(_0x4c5f46,_0xe54d39))[_0x9727('0x42')](handleError(_0x4c5f46,null));};exports[_0x9727('0x60')]=function(_0x1f6ce3,_0x9a4672,_0x169a75){var _0x22be3b={};var _0x5985a4={};var _0x2ee492;var _0x3d3fa9;return db[_0x9727('0x3f')][_0x9727('0x52')]({'where':{'id':_0x1f6ce3[_0x9727('0x44')]['id']}})[_0x9727('0x26')](handleEntityNotFound(_0x9a4672,null))[_0x9727('0x26')](function(_0x1ee0b4){if(_0x1ee0b4){_0x2ee492=_0x1ee0b4;_0x5985a4['model']=_['keys'](db[_0x9727('0x61')][_0x9727('0x55')]);_0x5985a4['query']=_['keys'](_0x1f6ce3['query']);_0x5985a4[_0x9727('0x39')]=_[_0x9727('0x32')](_0x5985a4[_0x9727('0x30')],_0x5985a4[_0x9727('0x31')]);_0x22be3b[_0x9727('0x33')]=_['intersection'](_0x5985a4['model'],qs[_0x9727('0x34')](_0x1f6ce3['query'][_0x9727('0x34')]));_0x22be3b[_0x9727('0x33')]=_0x22be3b[_0x9727('0x33')]['length']?_0x22be3b[_0x9727('0x33')]:_0x5985a4[_0x9727('0x30')];_0x22be3b[_0x9727('0x56')]=qs[_0x9727('0x37')](_0x1f6ce3[_0x9727('0x31')]['sort']);_0x22be3b[_0x9727('0x38')]=qs['filters'](_[_0x9727('0x3a')](_0x1f6ce3[_0x9727('0x31')],_0x5985a4[_0x9727('0x39')]));if(_0x1f6ce3[_0x9727('0x31')][_0x9727('0x3b')]){_0x22be3b[_0x9727('0x38')]=_['merge'](_0x22be3b[_0x9727('0x38')],{'$or':_[_0x9727('0x2d')](_0x22be3b[_0x9727('0x33')],function(_0x12409a){var _0x25b19c={};_0x25b19c[_0x12409a]={'$like':'%'+_0x1f6ce3['query'][_0x9727('0x3b')]+'%'};return _0x25b19c;})});}_0x22be3b=_['merge']({},_0x22be3b,_0x1f6ce3[_0x9727('0x3e')]);return _0x2ee492[_0x9727('0x60')](_0x22be3b);}})[_0x9727('0x26')](function(_0x1f1053){if(_0x1f1053){_0x3d3fa9=_0x1f1053[_0x9727('0x45')];if(!_0x1f6ce3[_0x9727('0x31')][_0x9727('0x35')](_0x9727('0x36'))){_0x22be3b[_0x9727('0x1f')]=qs[_0x9727('0x1f')](_0x1f6ce3[_0x9727('0x31')]['limit']);_0x22be3b[_0x9727('0x1e')]=qs['offset'](_0x1f6ce3[_0x9727('0x31')]['offset']);}return _0x2ee492[_0x9727('0x60')](_0x22be3b);}})[_0x9727('0x26')](function(_0x55c40e){if(_0x55c40e){return _0x55c40e?{'count':_0x3d3fa9,'rows':_0x55c40e}:null;}})['then'](respondWithResult(_0x9a4672,null))[_0x9727('0x42')](handleError(_0x9a4672,null));};exports['addTeams']=function(_0x1ec7c8,_0x4fb036,_0x42a679){var _0x56a383=_0x1ec7c8[_0x9727('0x48')][_0x9727('0x62')];return db[_0x9727('0x61')][_0x9727('0x40')]({'where':{'id':_0x56a383},'attributes':['id'],'include':[{'model':db[_0x9727('0x63')],'as':_0x9727('0x64'),'attributes':['id','name',_0x9727('0x65'),'voicePause',_0x9727('0x66')],'raw':!![]}]})['then'](function(_0x4287f9){if(_0x4287f9){var _0xae6c15=_[_0x9727('0x67')](_0x4287f9,function(_0x550581){var _0x4a6c71=_0x550581['get']({'plain':!![]});return _0x4a6c71['Agents'];});return db[_0x9727('0x3f')][_0x9727('0x46')]({'where':{'id':_0x1ec7c8[_0x9727('0x44')]['id']}})['then'](function(_0x49016a){return db[_0x9727('0x68')][_0x9727('0x69')](function(_0x50e813){return _0x49016a[_0x9727('0x6a')](_0x56a383,{'transaction':_0x50e813})[_0x9727('0x26')](function(){return BPromise[_0x9727('0x6b')](_0xae6c15,function(_0x40dfcd){return db[_0x9727('0x54')][_0x9727('0x6c')]({'where':{'UserId':_0x40dfcd['id'],'FaxQueueId':_0x1ec7c8[_0x9727('0x44')]['id']},'transaction':_0x50e813});});})[_0x9727('0x26')](function(){_0xae6c15['forEach'](function(_0x496d33){socket['emit']('userFaxQueue:save',{'UserId':_0x496d33['id'],'FaxQueueId':_0x49016a['id']});});});});});}})[_0x9727('0x26')](respondWithStatusCode(_0x4fb036,null))[_0x9727('0x42')](handleError(_0x4fb036,null));};exports[_0x9727('0x6d')]=function(_0x302d74,_0x2c99e2,_0x399994){return db[_0x9727('0x61')][_0x9727('0x40')]({'where':{'id':_0x302d74[_0x9727('0x31')][_0x9727('0x62')]},'attributes':['id'],'include':[{'model':db[_0x9727('0x63')],'as':_0x9727('0x64'),'attributes':['id'],'raw':!![]}]})[_0x9727('0x26')](handleEntityNotFound(_0x2c99e2,null))[_0x9727('0x26')](function(_0x493451){var _0x37cfdf=_[_0x9727('0x2d')](_0x493451,'id');var _0x2a879b=[];var _0x429fe7=[];var _0x831218=squel[_0x9727('0x6e')]();_0x831218[_0x9727('0x6f')]('tq.TeamId')[_0x9727('0x70')](_0x9727('0x71'),'tq')[_0x9727('0x72')]('user_has_teams','ut',_0x9727('0x73'))['where'](_0x9727('0x74'),_0x302d74[_0x9727('0x44')]['id']);for(var _0x2b805a=0x0;_0x2b805a<_0x493451[_0x9727('0x45')];_0x2b805a+=0x1){let _0x48cdfb=_0x493451[_0x2b805a];for(var _0x253dda=0x0;_0x253dda<_0x48cdfb[_0x9727('0x64')]['length'];_0x253dda+=0x1){let _0x327088=_0x48cdfb[_0x9727('0x64')][_0x253dda];var _0x5c6338=_0x831218[_0x9727('0x75')]();_0x5c6338[_0x9727('0x38')](_0x9727('0x76'),_0x327088['id']);_0x429fe7[_0x9727('0x77')](db[_0x9727('0x68')][_0x9727('0x31')](_0x5c6338[_0x9727('0x78')](),{'type':db[_0x9727('0x68')]['QueryTypes']['SELECT']})[_0x9727('0x26')](function(_0x15473a){if(_0x15473a[_0x9727('0x45')]===0x1){return _0x327088['id'];}else{var _0x2cc7dc=_[_0x9727('0x79')](_['map'](_0x15473a,_0x9727('0x7a')),function(_0x940b25){return _[_0x9727('0x7b')](_0x37cfdf,_0x940b25);});if(_0x2cc7dc){return _0x327088['id'];}}}));}}return BPromise[_0x9727('0x7c')](_0x429fe7)[_0x9727('0x26')](function(_0x3b0522){_0x2a879b=_(_0x2a879b)['union'](_0x3b0522)[_0x9727('0x7d')]()[_0x9727('0x7e')]();return db[_0x9727('0x3f')][_0x9727('0x46')]({'where':{'id':_0x302d74[_0x9727('0x44')]['id']}})[_0x9727('0x26')](function(_0x37e689){return db[_0x9727('0x68')][_0x9727('0x69')](function(_0x29c7f1){return _0x37e689['removeTeams'](_0x302d74[_0x9727('0x31')][_0x9727('0x62')],{'transaction':_0x29c7f1})[_0x9727('0x26')](function(){if(!_['isEmpty'](_0x2a879b)){return _0x37e689['removeAgents'](_0x2a879b,{'transaction':_0x29c7f1});}})['then'](function(){_0x2a879b['forEach'](function(_0x53f215){socket[_0x9727('0x7f')](_0x9727('0x80'),{'UserId':_0x53f215,'FaxQueueId':_0x37e689['id']});});});});});});})['then'](respondWithStatusCode(_0x2c99e2,null))[_0x9727('0x42')](handleError(_0x2c99e2,null));};exports[_0x9727('0x81')]=function(_0x64428f,_0xed4a5c,_0xe43e79){return db[_0x9727('0x3f')][_0x9727('0x46')]({'where':{'id':_0x64428f[_0x9727('0x44')]['id']}})[_0x9727('0x26')](handleEntityNotFound(_0xed4a5c,null))[_0x9727('0x26')](function(_0x21ee9e){if(_0x21ee9e){return _0x21ee9e[_0x9727('0x81')](_0x64428f[_0x9727('0x48')][_0x9727('0x62')],_['omit'](_0x64428f[_0x9727('0x48')],[_0x9727('0x62'),'id'])||{})[_0x9727('0x82')](function(_0x5086a9){for(var _0x4f287a=0x0;_0x4f287a<_0x64428f['body'][_0x9727('0x62')][_0x9727('0x45')];_0x4f287a+=0x1){socket['emit']('userFaxQueue:save',{'UserId':Number(_0x64428f[_0x9727('0x48')][_0x9727('0x62')][_0x4f287a]),'FaxQueueId':Number(_0x64428f[_0x9727('0x44')]['id'])});}return _0x5086a9;});}})[_0x9727('0x26')](respondWithResult(_0xed4a5c,null))['catch'](handleError(_0xed4a5c,null));};exports[_0x9727('0x83')]=function(_0x445641,_0x5eec9d,_0x469af2){return db[_0x9727('0x3f')][_0x9727('0x46')]({'where':{'id':_0x445641[_0x9727('0x44')]['id']}})[_0x9727('0x26')](handleEntityNotFound(_0x5eec9d,null))[_0x9727('0x26')](function(_0xe3db05){if(_0xe3db05){return _0xe3db05['removeAgents'](_0x445641[_0x9727('0x31')][_0x9727('0x62')])['then'](function(){if(_['isArray'](_0x445641[_0x9727('0x31')][_0x9727('0x62')])){for(var _0x36fb12=0x0;_0x36fb12<_0x445641[_0x9727('0x31')][_0x9727('0x62')][_0x9727('0x45')];_0x36fb12+=0x1){socket[_0x9727('0x7f')](_0x9727('0x80'),{'UserId':Number(_0x445641[_0x9727('0x31')][_0x9727('0x62')][_0x36fb12]),'FaxQueueId':Number(_0x445641[_0x9727('0x44')]['id'])});}}else{socket[_0x9727('0x7f')](_0x9727('0x80'),{'UserId':Number(_0x445641[_0x9727('0x31')][_0x9727('0x62')]),'FaxQueueId':Number(_0x445641[_0x9727('0x44')]['id'])});}});}})['then'](respondWithStatusCode(_0x5eec9d,null))['catch'](handleError(_0x5eec9d,null));};exports[_0x9727('0x84')]=function(_0x2eb587,_0x551361,_0x261383){var _0x27110c={};var _0x2d9ff1={};var _0x36fcc0;var _0x2b1ae6;return db[_0x9727('0x3f')][_0x9727('0x52')]({'where':{'id':_0x2eb587['params']['id']}})['then'](handleEntityNotFound(_0x551361,null))[_0x9727('0x26')](function(_0x3c774b){if(_0x3c774b){_0x36fcc0=_0x3c774b;_0x2d9ff1['model']=_['keys'](db[_0x9727('0x63')][_0x9727('0x55')]);_0x2d9ff1[_0x9727('0x31')]=_[_0x9727('0x53')](_0x2eb587[_0x9727('0x31')]);_0x2d9ff1['filters']=_[_0x9727('0x32')](_0x2d9ff1[_0x9727('0x30')],_0x2d9ff1[_0x9727('0x31')]);_0x27110c[_0x9727('0x33')]=_[_0x9727('0x32')](_0x2d9ff1[_0x9727('0x30')],qs[_0x9727('0x34')](_0x2eb587['query']['fields']));_0x27110c[_0x9727('0x33')]=_0x27110c[_0x9727('0x33')][_0x9727('0x45')]?_0x27110c[_0x9727('0x33')]:_0x2d9ff1['model'];_0x27110c[_0x9727('0x56')]=qs[_0x9727('0x37')](_0x2eb587[_0x9727('0x31')]['sort']);_0x27110c['where']=qs[_0x9727('0x39')](_['pick'](_0x2eb587[_0x9727('0x31')],_0x2d9ff1[_0x9727('0x39')]));if(_0x2eb587[_0x9727('0x31')]['filter']){_0x27110c[_0x9727('0x38')]=_['merge'](_0x27110c[_0x9727('0x38')],{'$or':_[_0x9727('0x2d')](_0x27110c['attributes'],function(_0x2b7b19){var _0x42f73e={};_0x42f73e[_0x2b7b19]={'$like':'%'+_0x2eb587[_0x9727('0x31')]['filter']+'%'};return _0x42f73e;})});}_0x27110c=_[_0x9727('0x3c')]({},_0x27110c,_0x2eb587[_0x9727('0x3e')]);return _0x36fcc0[_0x9727('0x84')](_0x27110c);}})[_0x9727('0x26')](function(_0x519b2){if(_0x519b2){_0x2b1ae6=_0x519b2[_0x9727('0x45')];if(!_0x2eb587[_0x9727('0x31')][_0x9727('0x35')](_0x9727('0x36'))){_0x27110c[_0x9727('0x1f')]=qs[_0x9727('0x1f')](_0x2eb587[_0x9727('0x31')][_0x9727('0x1f')]);_0x27110c[_0x9727('0x1e')]=qs[_0x9727('0x1e')](_0x2eb587['query'][_0x9727('0x1e')]);}return _0x36fcc0[_0x9727('0x84')](_0x27110c);}})[_0x9727('0x26')](function(_0x3b8515){if(_0x3b8515){return _0x3b8515?{'count':_0x2b1ae6,'rows':_0x3b8515}:null;}})[_0x9727('0x26')](respondWithResult(_0x551361,null))[_0x9727('0x42')](handleError(_0x551361,null));}; \ No newline at end of file +var _0x7f44=['transaction','removeTeams','isEmpty','emit','addAgents','removeAgents','isArray','userFaxQueue:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./faxQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','get','FaxQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','FaxQueue','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','filter','VIRTUAL','options','includeAll','findAll','include','merge','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','destroy','describe','rawAttributes','pick','FaxQueueId','UserFaxQueue','User','UserId','agent','faxPause','updatedAt','createdAt','rows','%s/%s','SIP','getTeams','findOne','Team','hasOwnProperty','nolimit','addTeams','ids','online','voicePause','interface','sequelize','each','forEach','userFaxQueue:save','Agents','field','from','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value'];(function(_0x354fa9,_0x554970){var _0x2eae07=function(_0x5cdd61){while(--_0x5cdd61){_0x354fa9['push'](_0x354fa9['shift']());}};_0x2eae07(++_0x554970);}(_0x7f44,0x91));var _0x47f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7f44[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x47f4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47f4('0x1'));var rp=require(_0x47f4('0x2'));var moment=require(_0x47f4('0x3'));var BPromise=require(_0x47f4('0x4'));var Mustache=require(_0x47f4('0x5'));var util=require(_0x47f4('0x6'));var path=require('path');var sox=require(_0x47f4('0x7'));var csv=require(_0x47f4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47f4('0x9'));var _=require(_0x47f4('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x47f4('0xb'));var deskjs=require(_0x47f4('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x47f4('0xd'));var Redis=require('ioredis');var authService=require(_0x47f4('0xe'));var qs=require(_0x47f4('0xf'));var as=require(_0x47f4('0x10'));var hardwareService=require(_0x47f4('0x11'));var logger=require(_0x47f4('0x12'))(_0x47f4('0x13'));var utils=require('../../config/utils');var config=require(_0x47f4('0x14'));var licenseUtil=require(_0x47f4('0x15'));var db=require(_0x47f4('0x16'))['db'];config[_0x47f4('0x17')]=_['defaults'](config[_0x47f4('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x47f4('0x18'))(new Redis(config[_0x47f4('0x17')]));require(_0x47f4('0x19'))[_0x47f4('0x1a')](socket);function respondWithStatusCode(_0x4047ba,_0x1c6f46){_0x1c6f46=_0x1c6f46||0xcc;return function(_0x1101c6){if(_0x1101c6){return _0x4047ba['sendStatus'](_0x1c6f46);}return _0x4047ba[_0x47f4('0x1b')](_0x1c6f46)[_0x47f4('0x1c')]();};}function respondWithResult(_0x561224,_0x50e377){_0x50e377=_0x50e377||0xc8;return function(_0x3bd671){if(_0x3bd671){return _0x561224['status'](_0x50e377)[_0x47f4('0x1d')](_0x3bd671);}};}function respondWithFilteredResult(_0x3e3a6d,_0x52c898){return function(_0x246ac9){if(_0x246ac9){var _0x1cf138=typeof _0x52c898[_0x47f4('0x1e')]===_0x47f4('0x1f')&&typeof _0x52c898[_0x47f4('0x20')]===_0x47f4('0x1f');var _0x2cf429=_0x246ac9[_0x47f4('0x21')];var _0x33fe73=_0x1cf138?0x0:_0x52c898[_0x47f4('0x1e')];var _0x25f96f=_0x1cf138?_0x246ac9[_0x47f4('0x21')]:_0x52c898[_0x47f4('0x1e')]+_0x52c898['limit'];var _0x31a230;if(_0x25f96f>=_0x2cf429){_0x25f96f=_0x2cf429;_0x31a230=0xc8;}else{_0x31a230=0xce;}_0x3e3a6d[_0x47f4('0x1b')](_0x31a230);return _0x3e3a6d[_0x47f4('0x22')](_0x47f4('0x23'),_0x33fe73+'-'+_0x25f96f+'/'+_0x2cf429)[_0x47f4('0x1d')](_0x246ac9);}return null;};}function patchUpdates(_0x48b5de){return function(_0x2de95f){try{jsonpatch[_0x47f4('0x24')](_0x2de95f,_0x48b5de,!![]);}catch(_0x4b008e){return BPromise[_0x47f4('0x25')](_0x4b008e);}return _0x2de95f['save']();};}function saveUpdates(_0x435507,_0x4618ce){return function(_0xd0ce81){if(_0xd0ce81){return _0xd0ce81['update'](_0x435507)[_0x47f4('0x26')](function(_0x50afb8){return _0x50afb8;});}return null;};}function removeEntity(_0x1bb676,_0x4c4ad4){return function(_0x45d039){if(_0x45d039){return _0x45d039['destroy']()[_0x47f4('0x26')](function(){var _0x375092=_0x45d039[_0x47f4('0x27')]({'plain':!![]});var _0x3408ed=_0x47f4('0x28');return db[_0x47f4('0x29')]['destroy']({'where':{'type':_0x3408ed,'resourceId':_0x375092['id']}})[_0x47f4('0x26')](function(){return _0x45d039;});})[_0x47f4('0x26')](function(){_0x1bb676[_0x47f4('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c0507,_0x32c5e4){return function(_0x55189b){if(!_0x55189b){_0x2c0507[_0x47f4('0x2a')](0x194);}return _0x55189b;};}function handleError(_0x419ac8,_0x29f8cc){_0x29f8cc=_0x29f8cc||0x1f4;return function(_0x57dd4b){logger[_0x47f4('0x2b')](_0x57dd4b[_0x47f4('0x2c')]);if(_0x57dd4b[_0x47f4('0x2d')]){delete _0x57dd4b[_0x47f4('0x2d')];}_0x419ac8[_0x47f4('0x1b')](_0x29f8cc)[_0x47f4('0x2e')](_0x57dd4b);};}exports[_0x47f4('0x2f')]=function(_0x562e92,_0x78f334){var _0x2054a6={},_0x10cb57={},_0x365d70={'count':0x0,'rows':[]};var _0x1f6864=_[_0x47f4('0x30')](db[_0x47f4('0x31')]['rawAttributes'],function(_0x4426e5){return{'name':_0x4426e5['fieldName'],'type':_0x4426e5['type'][_0x47f4('0x32')]};});_0x10cb57[_0x47f4('0x33')]=_[_0x47f4('0x30')](_0x1f6864,_0x47f4('0x2d'));_0x10cb57['query']=_[_0x47f4('0x34')](_0x562e92[_0x47f4('0x35')]);_0x10cb57[_0x47f4('0x36')]=_[_0x47f4('0x37')](_0x10cb57[_0x47f4('0x33')],_0x10cb57[_0x47f4('0x35')]);_0x2054a6[_0x47f4('0x38')]=_['intersection'](_0x10cb57['model'],qs['fields'](_0x562e92[_0x47f4('0x35')][_0x47f4('0x39')]));_0x2054a6['attributes']=_0x2054a6['attributes'][_0x47f4('0x3a')]?_0x2054a6[_0x47f4('0x38')]:_0x10cb57[_0x47f4('0x33')];if(!_0x562e92['query']['hasOwnProperty']('nolimit')){_0x2054a6['limit']=qs[_0x47f4('0x20')](_0x562e92[_0x47f4('0x35')]['limit']);_0x2054a6[_0x47f4('0x1e')]=qs['offset'](_0x562e92[_0x47f4('0x35')]['offset']);}_0x2054a6[_0x47f4('0x3b')]=qs[_0x47f4('0x3c')](_0x562e92[_0x47f4('0x35')][_0x47f4('0x3c')]);_0x2054a6[_0x47f4('0x3d')]=qs[_0x47f4('0x36')](_['pick'](_0x562e92['query'],_0x10cb57[_0x47f4('0x36')]),_0x1f6864);if(_0x562e92[_0x47f4('0x35')][_0x47f4('0x3e')]){_0x2054a6[_0x47f4('0x3d')]=_['merge'](_0x2054a6[_0x47f4('0x3d')],{'$or':_[_0x47f4('0x30')](_0x1f6864,function(_0x153bd9){if(_0x153bd9['type']!==_0x47f4('0x3f')){var _0x2a537c={};_0x2a537c[_0x153bd9[_0x47f4('0x2d')]]={'$like':'%'+_0x562e92[_0x47f4('0x35')][_0x47f4('0x3e')]+'%'};return _0x2a537c;}})});}_0x2054a6=_['merge']({},_0x2054a6,_0x562e92[_0x47f4('0x40')]);var _0x121dbd={'where':_0x2054a6[_0x47f4('0x3d')]};return db[_0x47f4('0x31')][_0x47f4('0x21')](_0x121dbd)[_0x47f4('0x26')](function(_0x53954e){_0x365d70['count']=_0x53954e;if(_0x562e92[_0x47f4('0x35')][_0x47f4('0x41')]){_0x2054a6['include']=[{'all':!![]}];}return db['FaxQueue'][_0x47f4('0x42')](_0x2054a6);})['then'](function(_0x177afd){_0x365d70['rows']=_0x177afd;return _0x365d70;})[_0x47f4('0x26')](respondWithFilteredResult(_0x78f334,_0x2054a6))['catch'](handleError(_0x78f334,null));};exports['show']=function(_0x4be719,_0x1e879b){var _0x59c7ab={'raw':!![],'where':{'id':_0x4be719['params']['id']}},_0x274612={};_0x274612[_0x47f4('0x33')]=_[_0x47f4('0x34')](db[_0x47f4('0x31')]['rawAttributes']);_0x274612['query']=_[_0x47f4('0x34')](_0x4be719['query']);_0x274612[_0x47f4('0x36')]=_[_0x47f4('0x37')](_0x274612[_0x47f4('0x33')],_0x274612['query']);_0x59c7ab[_0x47f4('0x38')]=_[_0x47f4('0x37')](_0x274612[_0x47f4('0x33')],qs[_0x47f4('0x39')](_0x4be719[_0x47f4('0x35')][_0x47f4('0x39')]));_0x59c7ab[_0x47f4('0x38')]=_0x59c7ab['attributes'][_0x47f4('0x3a')]?_0x59c7ab['attributes']:_0x274612[_0x47f4('0x33')];if(_0x4be719[_0x47f4('0x35')][_0x47f4('0x41')]){_0x59c7ab[_0x47f4('0x43')]=[{'all':!![]}];}_0x59c7ab=_[_0x47f4('0x44')]({},_0x59c7ab,_0x4be719[_0x47f4('0x40')]);return db[_0x47f4('0x31')][_0x47f4('0x45')](_0x59c7ab)[_0x47f4('0x26')](handleEntityNotFound(_0x1e879b,null))[_0x47f4('0x26')](respondWithResult(_0x1e879b,null))[_0x47f4('0x46')](handleError(_0x1e879b,null));};exports['create']=function(_0x23ae53,_0x145285){return db['FaxQueue'][_0x47f4('0x47')](_0x23ae53['body'],{})[_0x47f4('0x26')](function(_0x1acab9){var _0x4e0109=_0x23ae53[_0x47f4('0x48')][_0x47f4('0x27')]({'plain':!![]});if(!_0x4e0109)throw new Error(_0x47f4('0x49'));if(_0x4e0109[_0x47f4('0x4a')]==='user'){var _0x240136=_0x1acab9[_0x47f4('0x27')]({'plain':!![]});var _0x5de4bd='FaxQueues';return db[_0x47f4('0x4b')][_0x47f4('0x45')]({'where':{'name':_0x5de4bd,'userProfileId':_0x4e0109[_0x47f4('0x4c')]},'raw':!![]})[_0x47f4('0x26')](function(_0x2c6ff0){if(_0x2c6ff0&&_0x2c6ff0['autoAssociation']===0x0){return db[_0x47f4('0x29')][_0x47f4('0x47')]({'name':_0x240136['name'],'resourceId':_0x240136['id'],'type':_0x2c6ff0['name'],'sectionId':_0x2c6ff0['id']},{})[_0x47f4('0x26')](function(){return _0x1acab9;});}else{return _0x1acab9;}})[_0x47f4('0x46')](function(_0x474238){logger['error'](_0x47f4('0x4d'),_0x474238);throw _0x474238;});}return _0x1acab9;})[_0x47f4('0x26')](respondWithResult(_0x145285,0xc9))[_0x47f4('0x46')](handleError(_0x145285,null));};exports[_0x47f4('0x4e')]=function(_0x4d27ca,_0x3286f6){if(_0x4d27ca[_0x47f4('0x4f')]['id']){delete _0x4d27ca[_0x47f4('0x4f')]['id'];}return db[_0x47f4('0x31')][_0x47f4('0x45')]({'where':{'id':_0x4d27ca[_0x47f4('0x50')]['id']}})[_0x47f4('0x26')](handleEntityNotFound(_0x3286f6,null))['then'](saveUpdates(_0x4d27ca[_0x47f4('0x4f')],null))[_0x47f4('0x26')](respondWithResult(_0x3286f6,null))[_0x47f4('0x46')](handleError(_0x3286f6,null));};exports[_0x47f4('0x51')]=function(_0x13df53,_0x4cf0c4){return db['FaxQueue'][_0x47f4('0x45')]({'where':{'id':_0x13df53[_0x47f4('0x50')]['id']}})[_0x47f4('0x26')](handleEntityNotFound(_0x4cf0c4,null))['then'](removeEntity(_0x4cf0c4,null))['catch'](handleError(_0x4cf0c4,null));};exports[_0x47f4('0x52')]=function(_0x3c2ca1,_0x58960e){return db[_0x47f4('0x31')][_0x47f4('0x52')]()[_0x47f4('0x26')](respondWithResult(_0x58960e,null))[_0x47f4('0x46')](handleError(_0x58960e,null));};exports['getMembers']=function(_0x248c76,_0x320dd0,_0x303a96){var _0x3866de={'raw':!![],'where':{}},_0x4fc5ae={},_0x53ac83;return db[_0x47f4('0x31')]['findOne']({'where':{'id':_0x248c76['params']['id']}})[_0x47f4('0x26')](handleEntityNotFound(_0x320dd0,null))[_0x47f4('0x26')](function(_0x14065d){if(_0x14065d){_0x53ac83=_0x14065d[_0x47f4('0x27')]({'plain':!![]});_0x4fc5ae['model']=_['keys'](db['UserFaxQueue'][_0x47f4('0x53')]);_0x4fc5ae['query']=_['keys'](_0x248c76[_0x47f4('0x35')]);_0x4fc5ae[_0x47f4('0x36')]=_[_0x47f4('0x37')](_0x4fc5ae['model'],_0x4fc5ae[_0x47f4('0x35')]);_0x3866de[_0x47f4('0x38')]=_[_0x47f4('0x37')](_0x4fc5ae[_0x47f4('0x33')],qs['fields'](_0x248c76[_0x47f4('0x35')]['fields']));_0x3866de[_0x47f4('0x38')]=_0x3866de[_0x47f4('0x38')]['length']?_0x3866de[_0x47f4('0x38')]:_0x4fc5ae['model'];if(!_0x248c76[_0x47f4('0x35')]['hasOwnProperty']('nolimit')){_0x3866de[_0x47f4('0x20')]=qs[_0x47f4('0x20')](_0x248c76[_0x47f4('0x35')][_0x47f4('0x20')]);_0x3866de[_0x47f4('0x1e')]=qs[_0x47f4('0x1e')](_0x248c76[_0x47f4('0x35')]['offset']);}_0x3866de[_0x47f4('0x3b')]=qs[_0x47f4('0x3c')](_0x248c76[_0x47f4('0x35')][_0x47f4('0x3c')]);_0x3866de[_0x47f4('0x3d')]=qs[_0x47f4('0x36')](_[_0x47f4('0x54')](_0x248c76[_0x47f4('0x35')],_0x4fc5ae[_0x47f4('0x36')]));_0x3866de['where'][_0x47f4('0x55')]=_0x14065d['id'];if(_0x248c76[_0x47f4('0x35')][_0x47f4('0x3e')]){_0x3866de[_0x47f4('0x3d')]=_[_0x47f4('0x44')](_0x3866de[_0x47f4('0x3d')],{'$or':_[_0x47f4('0x30')](_0x3866de[_0x47f4('0x38')],function(_0x495c85){var _0x4340f5={};_0x4340f5[_0x495c85]={'$like':'%'+_0x248c76[_0x47f4('0x35')]['filter']+'%'};return _0x4340f5;})});}_0x3866de=_[_0x47f4('0x44')]({},_0x3866de,_0x248c76[_0x47f4('0x40')]);return db[_0x47f4('0x56')][_0x47f4('0x42')](_0x3866de);}})[_0x47f4('0x26')](function(_0x1148e1){if(_0x1148e1){return db[_0x47f4('0x57')]['findAndCountAll']({'where':{'id':_[_0x47f4('0x30')](_0x1148e1,_0x47f4('0x58')),'role':_0x47f4('0x59')},'attributes':['id','name',_0x47f4('0x5a'),_0x47f4('0x5b'),_0x47f4('0x5c')]});}})[_0x47f4('0x26')](function(_0x87862a){if(_0x87862a){return{'count':_0x87862a[_0x47f4('0x21')],'rows':_[_0x47f4('0x30')](_0x87862a[_0x47f4('0x5d')],function(_0x253b51){return{'membername':_0x253b51[_0x47f4('0x2d')],'UserId':_0x253b51['id'],'queue_name':_0x53ac83[_0x47f4('0x2d')],'FaxQueueId':_0x53ac83['id'],'interface':util['format'](_0x47f4('0x5e'),_0x47f4('0x5f'),_0x253b51[_0x47f4('0x2d')]),'penalty':0x0,'paused':_0x253b51['faxPause'],'createdAt':_0x253b51['createdAt'],'updatedAt':_0x253b51['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x320dd0,_0x3866de))[_0x47f4('0x46')](handleError(_0x320dd0,null));};exports[_0x47f4('0x60')]=function(_0x17c7f9,_0x4c4280,_0x89abcc){var _0x43eb88={};var _0x13a26d={};var _0x371936;var _0x5280d2;return db[_0x47f4('0x31')][_0x47f4('0x61')]({'where':{'id':_0x17c7f9[_0x47f4('0x50')]['id']}})[_0x47f4('0x26')](handleEntityNotFound(_0x4c4280,null))[_0x47f4('0x26')](function(_0x266855){if(_0x266855){_0x371936=_0x266855;_0x13a26d[_0x47f4('0x33')]=_[_0x47f4('0x34')](db[_0x47f4('0x62')]['rawAttributes']);_0x13a26d['query']=_[_0x47f4('0x34')](_0x17c7f9[_0x47f4('0x35')]);_0x13a26d[_0x47f4('0x36')]=_[_0x47f4('0x37')](_0x13a26d[_0x47f4('0x33')],_0x13a26d['query']);_0x43eb88[_0x47f4('0x38')]=_[_0x47f4('0x37')](_0x13a26d[_0x47f4('0x33')],qs[_0x47f4('0x39')](_0x17c7f9[_0x47f4('0x35')][_0x47f4('0x39')]));_0x43eb88[_0x47f4('0x38')]=_0x43eb88['attributes'][_0x47f4('0x3a')]?_0x43eb88[_0x47f4('0x38')]:_0x13a26d[_0x47f4('0x33')];_0x43eb88[_0x47f4('0x3b')]=qs['sort'](_0x17c7f9[_0x47f4('0x35')][_0x47f4('0x3c')]);_0x43eb88[_0x47f4('0x3d')]=qs[_0x47f4('0x36')](_[_0x47f4('0x54')](_0x17c7f9[_0x47f4('0x35')],_0x13a26d['filters']));if(_0x17c7f9[_0x47f4('0x35')][_0x47f4('0x3e')]){_0x43eb88['where']=_[_0x47f4('0x44')](_0x43eb88['where'],{'$or':_[_0x47f4('0x30')](_0x43eb88[_0x47f4('0x38')],function(_0x5105a7){var _0x46bcf6={};_0x46bcf6[_0x5105a7]={'$like':'%'+_0x17c7f9[_0x47f4('0x35')]['filter']+'%'};return _0x46bcf6;})});}_0x43eb88=_[_0x47f4('0x44')]({},_0x43eb88,_0x17c7f9['options']);return _0x371936['getTeams'](_0x43eb88);}})['then'](function(_0x2352c2){if(_0x2352c2){_0x5280d2=_0x2352c2[_0x47f4('0x3a')];if(!_0x17c7f9[_0x47f4('0x35')][_0x47f4('0x63')](_0x47f4('0x64'))){_0x43eb88[_0x47f4('0x20')]=qs[_0x47f4('0x20')](_0x17c7f9[_0x47f4('0x35')]['limit']);_0x43eb88['offset']=qs[_0x47f4('0x1e')](_0x17c7f9[_0x47f4('0x35')][_0x47f4('0x1e')]);}return _0x371936[_0x47f4('0x60')](_0x43eb88);}})[_0x47f4('0x26')](function(_0x5719be){if(_0x5719be){return _0x5719be?{'count':_0x5280d2,'rows':_0x5719be}:null;}})[_0x47f4('0x26')](respondWithResult(_0x4c4280,null))[_0x47f4('0x46')](handleError(_0x4c4280,null));};exports[_0x47f4('0x65')]=function(_0x1cf3c3,_0xe1b13a,_0x3f5c99){var _0x2abd6d=_0x1cf3c3[_0x47f4('0x4f')][_0x47f4('0x66')];return db['Team']['findAll']({'where':{'id':_0x2abd6d},'attributes':['id'],'include':[{'model':db[_0x47f4('0x57')],'as':'Agents','attributes':['id',_0x47f4('0x2d'),_0x47f4('0x67'),_0x47f4('0x68'),_0x47f4('0x69')],'raw':!![]}]})[_0x47f4('0x26')](function(_0x379a8a){if(_0x379a8a){var _0x1c5fec=_['flatMap'](_0x379a8a,function(_0x32f3bf){var _0x2b8fd6=_0x32f3bf[_0x47f4('0x27')]({'plain':!![]});return _0x2b8fd6['Agents'];});return db[_0x47f4('0x31')][_0x47f4('0x45')]({'where':{'id':_0x1cf3c3[_0x47f4('0x50')]['id']}})['then'](function(_0x2f44f3){return db[_0x47f4('0x6a')]['transaction'](function(_0x193c68){return _0x2f44f3[_0x47f4('0x65')](_0x2abd6d,{'transaction':_0x193c68})['then'](function(){return BPromise[_0x47f4('0x6b')](_0x1c5fec,function(_0x1b98ea){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x1b98ea['id'],'FaxQueueId':_0x1cf3c3[_0x47f4('0x50')]['id']},'transaction':_0x193c68});});})[_0x47f4('0x26')](function(){_0x1c5fec[_0x47f4('0x6c')](function(_0x1757e7){socket['emit'](_0x47f4('0x6d'),{'UserId':_0x1757e7['id'],'FaxQueueId':_0x2f44f3['id']});});});});});}})[_0x47f4('0x26')](respondWithStatusCode(_0xe1b13a,null))[_0x47f4('0x46')](handleError(_0xe1b13a,null));};exports['removeTeams']=function(_0x3a6864,_0x1757e6,_0xd0151c){return db[_0x47f4('0x62')][_0x47f4('0x42')]({'where':{'id':_0x3a6864[_0x47f4('0x35')][_0x47f4('0x66')]},'attributes':['id'],'include':[{'model':db[_0x47f4('0x57')],'as':_0x47f4('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x47f4('0x26')](handleEntityNotFound(_0x1757e6,null))[_0x47f4('0x26')](function(_0x48a323){var _0x26f953=_[_0x47f4('0x30')](_0x48a323,'id');var _0xcfe9ec=[];var _0x13c3de=[];var _0x4a5937=squel['select']();_0x4a5937[_0x47f4('0x6f')]('tq.TeamId')[_0x47f4('0x70')]('team_has_fax_queues','tq')[_0x47f4('0x71')]('user_has_teams','ut',_0x47f4('0x72'))[_0x47f4('0x3d')](_0x47f4('0x73'),_0x3a6864[_0x47f4('0x50')]['id']);for(var _0x25f23f=0x0;_0x25f23f<_0x48a323[_0x47f4('0x3a')];_0x25f23f+=0x1){let _0x22522f=_0x48a323[_0x25f23f];for(var _0x50da1f=0x0;_0x50da1f<_0x22522f[_0x47f4('0x6e')][_0x47f4('0x3a')];_0x50da1f+=0x1){let _0x8efeb9=_0x22522f[_0x47f4('0x6e')][_0x50da1f];var _0x181976=_0x4a5937[_0x47f4('0x74')]();_0x181976[_0x47f4('0x3d')](_0x47f4('0x75'),_0x8efeb9['id']);_0x13c3de['push'](db[_0x47f4('0x6a')][_0x47f4('0x35')](_0x181976['toString'](),{'type':db[_0x47f4('0x6a')][_0x47f4('0x76')][_0x47f4('0x77')]})[_0x47f4('0x26')](function(_0x3f0be3){if(_0x3f0be3[_0x47f4('0x3a')]===0x1){return _0x8efeb9['id'];}else{var _0xb4a643=_[_0x47f4('0x78')](_['map'](_0x3f0be3,_0x47f4('0x79')),function(_0x4037c5){return _[_0x47f4('0x7a')](_0x26f953,_0x4037c5);});if(_0xb4a643){return _0x8efeb9['id'];}}}));}}return BPromise[_0x47f4('0x7b')](_0x13c3de)[_0x47f4('0x26')](function(_0x4678ec){_0xcfe9ec=_(_0xcfe9ec)[_0x47f4('0x7c')](_0x4678ec)[_0x47f4('0x7d')]()[_0x47f4('0x7e')]();return db['FaxQueue']['find']({'where':{'id':_0x3a6864[_0x47f4('0x50')]['id']}})[_0x47f4('0x26')](function(_0x4cd865){return db[_0x47f4('0x6a')][_0x47f4('0x7f')](function(_0x418f2c){return _0x4cd865[_0x47f4('0x80')](_0x3a6864[_0x47f4('0x35')]['ids'],{'transaction':_0x418f2c})['then'](function(){if(!_[_0x47f4('0x81')](_0xcfe9ec)){return _0x4cd865['removeAgents'](_0xcfe9ec,{'transaction':_0x418f2c});}})[_0x47f4('0x26')](function(){_0xcfe9ec[_0x47f4('0x6c')](function(_0x167532){socket[_0x47f4('0x82')]('userFaxQueue:remove',{'UserId':_0x167532,'FaxQueueId':_0x4cd865['id']});});});});});});})['then'](respondWithStatusCode(_0x1757e6,null))['catch'](handleError(_0x1757e6,null));};exports[_0x47f4('0x83')]=function(_0x27ddd5,_0x3a045,_0x543db1){return db[_0x47f4('0x31')][_0x47f4('0x45')]({'where':{'id':_0x27ddd5[_0x47f4('0x50')]['id']}})['then'](handleEntityNotFound(_0x3a045,null))['then'](function(_0x2c5eb5){if(_0x2c5eb5){return _0x2c5eb5[_0x47f4('0x83')](_0x27ddd5[_0x47f4('0x4f')][_0x47f4('0x66')],_['omit'](_0x27ddd5[_0x47f4('0x4f')],['ids','id'])||{})['spread'](function(_0xb6c107){for(var _0x52cb03=0x0;_0x52cb03<_0x27ddd5[_0x47f4('0x4f')][_0x47f4('0x66')]['length'];_0x52cb03+=0x1){socket[_0x47f4('0x82')](_0x47f4('0x6d'),{'UserId':Number(_0x27ddd5[_0x47f4('0x4f')][_0x47f4('0x66')][_0x52cb03]),'FaxQueueId':Number(_0x27ddd5[_0x47f4('0x50')]['id'])});}return _0xb6c107;});}})[_0x47f4('0x26')](respondWithResult(_0x3a045,null))['catch'](handleError(_0x3a045,null));};exports[_0x47f4('0x84')]=function(_0x58be66,_0xc95923,_0x5e54d5){return db['FaxQueue'][_0x47f4('0x45')]({'where':{'id':_0x58be66[_0x47f4('0x50')]['id']}})[_0x47f4('0x26')](handleEntityNotFound(_0xc95923,null))['then'](function(_0x4ebea5){if(_0x4ebea5){return _0x4ebea5[_0x47f4('0x84')](_0x58be66[_0x47f4('0x35')][_0x47f4('0x66')])['then'](function(){if(_[_0x47f4('0x85')](_0x58be66['query']['ids'])){for(var _0x4bd33b=0x0;_0x4bd33b<_0x58be66[_0x47f4('0x35')][_0x47f4('0x66')][_0x47f4('0x3a')];_0x4bd33b+=0x1){socket[_0x47f4('0x82')](_0x47f4('0x86'),{'UserId':Number(_0x58be66[_0x47f4('0x35')][_0x47f4('0x66')][_0x4bd33b]),'FaxQueueId':Number(_0x58be66[_0x47f4('0x50')]['id'])});}}else{socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x58be66[_0x47f4('0x35')][_0x47f4('0x66')]),'FaxQueueId':Number(_0x58be66[_0x47f4('0x50')]['id'])});}});}})[_0x47f4('0x26')](respondWithStatusCode(_0xc95923,null))[_0x47f4('0x46')](handleError(_0xc95923,null));};exports[_0x47f4('0x87')]=function(_0x22d7ec,_0x31d418,_0x2761b5){var _0x450096={};var _0x432dff={};var _0x5b5aef;var _0x16a7c3;return db[_0x47f4('0x31')][_0x47f4('0x61')]({'where':{'id':_0x22d7ec[_0x47f4('0x50')]['id']}})[_0x47f4('0x26')](handleEntityNotFound(_0x31d418,null))[_0x47f4('0x26')](function(_0x18b0a3){if(_0x18b0a3){_0x5b5aef=_0x18b0a3;_0x432dff['model']=_[_0x47f4('0x34')](db[_0x47f4('0x57')][_0x47f4('0x53')]);_0x432dff[_0x47f4('0x35')]=_['keys'](_0x22d7ec[_0x47f4('0x35')]);_0x432dff[_0x47f4('0x36')]=_['intersection'](_0x432dff['model'],_0x432dff[_0x47f4('0x35')]);_0x450096[_0x47f4('0x38')]=_[_0x47f4('0x37')](_0x432dff[_0x47f4('0x33')],qs[_0x47f4('0x39')](_0x22d7ec[_0x47f4('0x35')]['fields']));_0x450096[_0x47f4('0x38')]=_0x450096[_0x47f4('0x38')][_0x47f4('0x3a')]?_0x450096[_0x47f4('0x38')]:_0x432dff[_0x47f4('0x33')];_0x450096[_0x47f4('0x3b')]=qs['sort'](_0x22d7ec[_0x47f4('0x35')]['sort']);_0x450096[_0x47f4('0x3d')]=qs[_0x47f4('0x36')](_[_0x47f4('0x54')](_0x22d7ec[_0x47f4('0x35')],_0x432dff[_0x47f4('0x36')]));if(_0x22d7ec[_0x47f4('0x35')][_0x47f4('0x3e')]){_0x450096[_0x47f4('0x3d')]=_[_0x47f4('0x44')](_0x450096[_0x47f4('0x3d')],{'$or':_[_0x47f4('0x30')](_0x450096['attributes'],function(_0x204cd5){var _0x5b2d8a={};_0x5b2d8a[_0x204cd5]={'$like':'%'+_0x22d7ec[_0x47f4('0x35')][_0x47f4('0x3e')]+'%'};return _0x5b2d8a;})});}_0x450096=_[_0x47f4('0x44')]({},_0x450096,_0x22d7ec['options']);return _0x5b5aef[_0x47f4('0x87')](_0x450096);}})[_0x47f4('0x26')](function(_0x5f1103){if(_0x5f1103){_0x16a7c3=_0x5f1103[_0x47f4('0x3a')];if(!_0x22d7ec['query'][_0x47f4('0x63')](_0x47f4('0x64'))){_0x450096[_0x47f4('0x20')]=qs[_0x47f4('0x20')](_0x22d7ec['query'][_0x47f4('0x20')]);_0x450096['offset']=qs[_0x47f4('0x1e')](_0x22d7ec[_0x47f4('0x35')][_0x47f4('0x1e')]);}return _0x5b5aef[_0x47f4('0x87')](_0x450096);}})['then'](function(_0x5abb71){if(_0x5abb71){return _0x5abb71?{'count':_0x16a7c3,'rows':_0x5abb71}:null;}})[_0x47f4('0x26')](respondWithResult(_0x31d418,null))[_0x47f4('0x46')](handleError(_0x31d418,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 44b4d20..32cfcd0 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 _0x87da=['emit','hasOwnProperty','exports','events','../../mysqldb','FaxQueue','setMaxListeners','update','remove'];(function(_0x996463,_0x748873){var _0x4bac2d=function(_0xcc9d4c){while(--_0xcc9d4c){_0x996463['push'](_0x996463['shift']());}};_0x4bac2d(++_0x748873);}(_0x87da,0x108));var _0xa87d=function(_0x43bcf9,_0x3a43a3){_0x43bcf9=_0x43bcf9-0x0;var _0x3806ba=_0x87da[_0x43bcf9];return _0x3806ba;};'use strict';var EventEmitter=require(_0xa87d('0x0'));var FaxQueue=require(_0xa87d('0x1'))['db'][_0xa87d('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xa87d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa87d('0x4'),'afterDestroy':_0xa87d('0x5')};function emitEvent(_0x242ad3){return function(_0x1934b1,_0x2c7065,_0x5d6b07){FaxQueueEvents[_0xa87d('0x6')](_0x242ad3+':'+_0x1934b1['id'],_0x1934b1);FaxQueueEvents[_0xa87d('0x6')](_0x242ad3,_0x1934b1);_0x5d6b07(null);};}for(var e in events){if(events[_0xa87d('0x7')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xa87d('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0x8056=['hasOwnProperty','exports','events','FaxQueue','setMaxListeners','update','remove','emit'];(function(_0x4ce205,_0x7744a3){var _0x4a702c=function(_0xcf753c){while(--_0xcf753c){_0x4ce205['push'](_0x4ce205['shift']());}};_0x4a702c(++_0x7744a3);}(_0x8056,0x6a));var _0x6805=function(_0xce4604,_0x5e98ad){_0xce4604=_0xce4604-0x0;var _0x474352=_0x8056[_0xce4604];return _0x474352;};'use strict';var EventEmitter=require(_0x6805('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x6805('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x6805('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6805('0x3'),'afterDestroy':_0x6805('0x4')};function emitEvent(_0x5442e7){return function(_0x129e71,_0x44d4da,_0x6df369){FaxQueueEvents[_0x6805('0x5')](_0x5442e7+':'+_0x129e71['id'],_0x129e71);FaxQueueEvents[_0x6805('0x5')](_0x5442e7,_0x129e71);_0x6df369(null);};}for(var e in events){if(events[_0x6805('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x6805('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index baad4f3..06cc12e 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 _0xcc92=['../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','moment','bluebird','rimraf'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xcc92,0x1f2));var _0x2cc9=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0xcc92[_0x4ae625];return _0x31accf;};'use strict';var _=require(_0x2cc9('0x0'));var util=require(_0x2cc9('0x1'));var logger=require(_0x2cc9('0x2'))('api');var moment=require(_0x2cc9('0x3'));var BPromise=require(_0x2cc9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2cc9('0x5'));var config=require(_0x2cc9('0x6'));var attributes=require(_0x2cc9('0x7'));module[_0x2cc9('0x8')]=function(_0xea56aa,_0x2e6703){return _0xea56aa[_0x2cc9('0x9')](_0x2cc9('0xa'),attributes,{'tableName':_0x2cc9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbfd7=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','fax_queues','lodash','util'];(function(_0x274a03,_0xa661ae){var _0x53b6dc=function(_0x29a5df){while(--_0x29a5df){_0x274a03['push'](_0x274a03['shift']());}};_0x53b6dc(++_0xa661ae);}(_0xbfd7,0x1e2));var _0x7bfd=function(_0x26ca44,_0x4611e2){_0x26ca44=_0x26ca44-0x0;var _0x4a126d=_0xbfd7[_0x26ca44];return _0x4a126d;};'use strict';var _=require(_0x7bfd('0x0'));var util=require(_0x7bfd('0x1'));var logger=require(_0x7bfd('0x2'))('api');var moment=require(_0x7bfd('0x3'));var BPromise=require(_0x7bfd('0x4'));var rp=require(_0x7bfd('0x5'));var fs=require('fs');var path=require(_0x7bfd('0x6'));var rimraf=require(_0x7bfd('0x7'));var config=require(_0x7bfd('0x8'));var attributes=require('./faxQueue.attributes');module['exports']=function(_0x4b271c,_0x53931d){return _0x4b271c[_0x7bfd('0x9')]('FaxQueue',attributes,{'tableName':_0x7bfd('0xa'),'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 1d204e4..bb25601 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 _0x54a6=['../../config/environment','jayson/promise','client','redis','defaults','localhost','register','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','FaxQueue,\x20%s,\x20%s','message','result','catch','FaxQueue','findAll','raw','options','where','attributes','include','map','model','stringify','ShowFaxQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x12caf6,_0x3a207a){var _0x1249f0=function(_0x2ce31f){while(--_0x2ce31f){_0x12caf6['push'](_0x12caf6['shift']());}};_0x1249f0(++_0x3a207a);}(_0x54a6,0xa4));var _0x654a=function(_0x2caaf0,_0x59fa15){_0x2caaf0=_0x2caaf0-0x0;var _0x204cd7=_0x54a6[_0x2caaf0];return _0x204cd7;};'use strict';var _=require(_0x654a('0x0'));var util=require(_0x654a('0x1'));var moment=require(_0x654a('0x2'));var BPromise=require(_0x654a('0x3'));var rs=require(_0x654a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x654a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x654a('0x6'));var jayson=require(_0x654a('0x7'));var client=jayson[_0x654a('0x8')]['http']({'port':0x232a});config[_0x654a('0x9')]=_[_0x654a('0xa')](config[_0x654a('0x9')],{'host':_0x654a('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x654a('0x9')]));require('./faxQueue.socket')[_0x654a('0xc')](socket);function respondWithRpcPromise(_0x4f6421,_0x28e26c,_0x164545){return new BPromise(function(_0x5cb528,_0x2a5c5c){return client['request'](_0x4f6421,_0x164545)[_0x654a('0xd')](function(_0x4b1e2b){logger[_0x654a('0xe')]('FaxQueue,\x20%s,\x20%s',_0x28e26c,_0x654a('0xf'));logger[_0x654a('0x10')](_0x654a('0x11'),_0x28e26c,_0x654a('0xf'),JSON['stringify'](_0x4b1e2b));if(_0x4b1e2b['error']){if(_0x4b1e2b[_0x654a('0x12')]['code']===0x1f4){logger[_0x654a('0x12')](_0x654a('0x13'),_0x28e26c,_0x4b1e2b[_0x654a('0x12')][_0x654a('0x14')]);return _0x2a5c5c(_0x4b1e2b[_0x654a('0x12')][_0x654a('0x14')]);}logger[_0x654a('0x12')](_0x654a('0x13'),_0x28e26c,_0x4b1e2b[_0x654a('0x12')][_0x654a('0x14')]);return _0x5cb528(_0x4b1e2b[_0x654a('0x12')][_0x654a('0x14')]);}else{logger[_0x654a('0xe')]('FaxQueue,\x20%s,\x20%s',_0x28e26c,_0x654a('0xf'));_0x5cb528(_0x4b1e2b[_0x654a('0x15')][_0x654a('0x14')]);}})[_0x654a('0x16')](function(_0x7e4b7a){logger[_0x654a('0x12')]('FaxQueue,\x20%s,\x20%s',_0x28e26c,_0x7e4b7a);_0x2a5c5c(_0x7e4b7a);});});}exports['GetFaxQueue']=function(_0x46de11){var _0x56648d=this;return new Promise(function(_0x5c7ef5,_0x522c99){return db[_0x654a('0x17')][_0x654a('0x18')]({'raw':_0x46de11['options']?_0x46de11['options'][_0x654a('0x19')]===undefined?!![]:![]:!![],'where':_0x46de11[_0x654a('0x1a')]?_0x46de11[_0x654a('0x1a')][_0x654a('0x1b')]||null:null,'attributes':_0x46de11[_0x654a('0x1a')]?_0x46de11['options'][_0x654a('0x1c')]||null:null,'limit':_0x46de11[_0x654a('0x1a')]?_0x46de11[_0x654a('0x1a')]['limit']||null:null,'include':_0x46de11[_0x654a('0x1a')]?_0x46de11[_0x654a('0x1a')][_0x654a('0x1d')]?_[_0x654a('0x1e')](_0x46de11[_0x654a('0x1a')][_0x654a('0x1d')],function(_0x4ccd61){return{'model':db[_0x4ccd61[_0x654a('0x1f')]],'as':_0x4ccd61['as'],'attributes':_0x4ccd61['attributes'],'include':_0x4ccd61[_0x654a('0x1d')]?_[_0x654a('0x1e')](_0x4ccd61[_0x654a('0x1d')],function(_0x1129ce){return{'model':db[_0x1129ce[_0x654a('0x1f')]],'as':_0x1129ce['as'],'attributes':_0x1129ce[_0x654a('0x1c')],'include':_0x1129ce[_0x654a('0x1d')]?_[_0x654a('0x1e')](_0x1129ce[_0x654a('0x1d')],function(_0x1ddb1c){return{'model':db[_0x1ddb1c[_0x654a('0x1f')]],'as':_0x1ddb1c['as'],'attributes':_0x1ddb1c[_0x654a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x654a('0xd')](function(_0x39dadb){logger[_0x654a('0xe')]('GetFaxQueue',_0x46de11);logger['debug']('GetFaxQueue',_0x46de11,JSON[_0x654a('0x20')](_0x39dadb));_0x5c7ef5(_0x39dadb);})['catch'](function(_0x5c3d45){logger[_0x654a('0x12')]('GetFaxQueue',_0x5c3d45[_0x654a('0x14')],_0x46de11);_0x522c99(_0x56648d[_0x654a('0x12')](0x1f4,_0x5c3d45[_0x654a('0x14')]));});});};exports['ShowFaxQueue']=function(_0x123b7b){var _0x6da949=this;return new Promise(function(_0x5c723f,_0x199e4a){return db[_0x654a('0x17')]['find']({'raw':_0x123b7b[_0x654a('0x1a')]?_0x123b7b[_0x654a('0x1a')][_0x654a('0x19')]===undefined?!![]:![]:!![],'where':_0x123b7b[_0x654a('0x1a')]?_0x123b7b[_0x654a('0x1a')][_0x654a('0x1b')]||null:null,'attributes':_0x123b7b['options']?_0x123b7b[_0x654a('0x1a')]['attributes']||null:null,'include':_0x123b7b[_0x654a('0x1a')]?_0x123b7b['options'][_0x654a('0x1d')]?_[_0x654a('0x1e')](_0x123b7b[_0x654a('0x1a')][_0x654a('0x1d')],function(_0x568260){return{'model':db[_0x568260[_0x654a('0x1f')]],'as':_0x568260['as'],'attributes':_0x568260[_0x654a('0x1c')],'include':_0x568260[_0x654a('0x1d')]?_[_0x654a('0x1e')](_0x568260[_0x654a('0x1d')],function(_0xdb94c){return{'model':db[_0xdb94c[_0x654a('0x1f')]],'as':_0xdb94c['as'],'attributes':_0xdb94c['attributes'],'include':_0xdb94c[_0x654a('0x1d')]?_[_0x654a('0x1e')](_0xdb94c[_0x654a('0x1d')],function(_0x5a61f8){return{'model':db[_0x5a61f8[_0x654a('0x1f')]],'as':_0x5a61f8['as'],'attributes':_0x5a61f8[_0x654a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x654a('0xd')](function(_0x1bc017){logger['info']('ShowFaxQueue',_0x123b7b);logger['debug'](_0x654a('0x21'),_0x123b7b,JSON['stringify'](_0x1bc017));_0x5c723f(_0x1bc017);})[_0x654a('0x16')](function(_0xbd592){logger['error'](_0x654a('0x21'),_0xbd592['message'],_0x123b7b);_0x199e4a(_0x6da949[_0x654a('0x12')](0x1f4,_0xbd592[_0x654a('0x14')]));});});}; \ No newline at end of file +var _0xf813=['code','FaxQueue,\x20%s,\x20%s','message','result','GetFaxQueue','FaxQueue','findAll','options','raw','where','limit','include','map','model','attributes','stringify','ShowFaxQueue','find','catch','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x750904,_0x95afa9){var _0x4f3b85=function(_0x1ff3a3){while(--_0x1ff3a3){_0x750904['push'](_0x750904['shift']());}};_0x4f3b85(++_0x95afa9);}(_0xf813,0x1e7));var _0x3f81=function(_0x1e4c37,_0xdf253e){_0x1e4c37=_0x1e4c37-0x0;var _0xec3469=_0xf813[_0x1e4c37];return _0xec3469;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3f81('0x0'));var fs=require('fs');var Redis=require(_0x3f81('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x3f81('0x2'));var logger=require(_0x3f81('0x3'))(_0x3f81('0x4'));var config=require('../../config/environment');var jayson=require(_0x3f81('0x5'));var client=jayson[_0x3f81('0x6')][_0x3f81('0x7')]({'port':0x232a});config[_0x3f81('0x8')]=_[_0x3f81('0x9')](config[_0x3f81('0x8')],{'host':_0x3f81('0xa'),'port':0x18eb});var socket=require(_0x3f81('0xb'))(new Redis(config[_0x3f81('0x8')]));require('./faxQueue.socket')[_0x3f81('0xc')](socket);function respondWithRpcPromise(_0x266310,_0x554d31,_0x270bbb){return new BPromise(function(_0x38b235,_0x2684da){return client[_0x3f81('0xd')](_0x266310,_0x270bbb)[_0x3f81('0xe')](function(_0x62e221){logger[_0x3f81('0xf')]('FaxQueue,\x20%s,\x20%s',_0x554d31,_0x3f81('0x10'));logger[_0x3f81('0x11')](_0x3f81('0x12'),_0x554d31,_0x3f81('0x10'),JSON['stringify'](_0x62e221));if(_0x62e221['error']){if(_0x62e221[_0x3f81('0x13')][_0x3f81('0x14')]===0x1f4){logger[_0x3f81('0x13')](_0x3f81('0x15'),_0x554d31,_0x62e221[_0x3f81('0x13')][_0x3f81('0x16')]);return _0x2684da(_0x62e221['error'][_0x3f81('0x16')]);}logger['error']('FaxQueue,\x20%s,\x20%s',_0x554d31,_0x62e221['error'][_0x3f81('0x16')]);return _0x38b235(_0x62e221[_0x3f81('0x13')][_0x3f81('0x16')]);}else{logger[_0x3f81('0xf')](_0x3f81('0x15'),_0x554d31,_0x3f81('0x10'));_0x38b235(_0x62e221[_0x3f81('0x17')][_0x3f81('0x16')]);}})['catch'](function(_0x55a41a){logger['error'](_0x3f81('0x15'),_0x554d31,_0x55a41a);_0x2684da(_0x55a41a);});});}exports[_0x3f81('0x18')]=function(_0x215596){var _0x4c0a6c=this;return new Promise(function(_0x5a3a14,_0x54e1d5){return db[_0x3f81('0x19')][_0x3f81('0x1a')]({'raw':_0x215596[_0x3f81('0x1b')]?_0x215596[_0x3f81('0x1b')][_0x3f81('0x1c')]===undefined?!![]:![]:!![],'where':_0x215596[_0x3f81('0x1b')]?_0x215596[_0x3f81('0x1b')][_0x3f81('0x1d')]||null:null,'attributes':_0x215596['options']?_0x215596['options']['attributes']||null:null,'limit':_0x215596[_0x3f81('0x1b')]?_0x215596['options'][_0x3f81('0x1e')]||null:null,'include':_0x215596['options']?_0x215596[_0x3f81('0x1b')][_0x3f81('0x1f')]?_[_0x3f81('0x20')](_0x215596[_0x3f81('0x1b')][_0x3f81('0x1f')],function(_0x1dd02b){return{'model':db[_0x1dd02b[_0x3f81('0x21')]],'as':_0x1dd02b['as'],'attributes':_0x1dd02b[_0x3f81('0x22')],'include':_0x1dd02b[_0x3f81('0x1f')]?_[_0x3f81('0x20')](_0x1dd02b[_0x3f81('0x1f')],function(_0x1305fa){return{'model':db[_0x1305fa['model']],'as':_0x1305fa['as'],'attributes':_0x1305fa[_0x3f81('0x22')],'include':_0x1305fa[_0x3f81('0x1f')]?_[_0x3f81('0x20')](_0x1305fa[_0x3f81('0x1f')],function(_0xa016f){return{'model':db[_0xa016f[_0x3f81('0x21')]],'as':_0xa016f['as'],'attributes':_0xa016f[_0x3f81('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3758db){logger['info'](_0x3f81('0x18'),_0x215596);logger[_0x3f81('0x11')](_0x3f81('0x18'),_0x215596,JSON[_0x3f81('0x23')](_0x3758db));_0x5a3a14(_0x3758db);})['catch'](function(_0x259d9f){logger[_0x3f81('0x13')](_0x3f81('0x18'),_0x259d9f[_0x3f81('0x16')],_0x215596);_0x54e1d5(_0x4c0a6c['error'](0x1f4,_0x259d9f[_0x3f81('0x16')]));});});};exports[_0x3f81('0x24')]=function(_0x4aa52c){var _0x4c56a1=this;return new Promise(function(_0x7edebe,_0x516343){return db[_0x3f81('0x19')][_0x3f81('0x25')]({'raw':_0x4aa52c[_0x3f81('0x1b')]?_0x4aa52c[_0x3f81('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4aa52c[_0x3f81('0x1b')]?_0x4aa52c['options'][_0x3f81('0x1d')]||null:null,'attributes':_0x4aa52c[_0x3f81('0x1b')]?_0x4aa52c['options'][_0x3f81('0x22')]||null:null,'include':_0x4aa52c[_0x3f81('0x1b')]?_0x4aa52c[_0x3f81('0x1b')]['include']?_[_0x3f81('0x20')](_0x4aa52c['options'][_0x3f81('0x1f')],function(_0x3b6838){return{'model':db[_0x3b6838['model']],'as':_0x3b6838['as'],'attributes':_0x3b6838[_0x3f81('0x22')],'include':_0x3b6838['include']?_['map'](_0x3b6838['include'],function(_0x2c36c3){return{'model':db[_0x2c36c3[_0x3f81('0x21')]],'as':_0x2c36c3['as'],'attributes':_0x2c36c3[_0x3f81('0x22')],'include':_0x2c36c3[_0x3f81('0x1f')]?_[_0x3f81('0x20')](_0x2c36c3[_0x3f81('0x1f')],function(_0x4725b5){return{'model':db[_0x4725b5['model']],'as':_0x4725b5['as'],'attributes':_0x4725b5[_0x3f81('0x22')]};}):[]};}):[]};}):[]:[]})[_0x3f81('0xe')](function(_0x135d46){logger[_0x3f81('0xf')](_0x3f81('0x24'),_0x4aa52c);logger[_0x3f81('0x11')]('ShowFaxQueue',_0x4aa52c,JSON[_0x3f81('0x23')](_0x135d46));_0x7edebe(_0x135d46);})[_0x3f81('0x26')](function(_0x43794d){logger[_0x3f81('0x13')]('ShowFaxQueue',_0x43794d['message'],_0x4aa52c);_0x516343(_0x4c56a1[_0x3f81('0x13')](0x1f4,_0x43794d[_0x3f81('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 2aaa4c8..b9e8c41 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 _0xbea5=['removeListener','register','length','faxQueue:','./faxQueue.events','save','remove','update'];(function(_0x256d97,_0x17b56d){var _0x487ee1=function(_0x4aa474){while(--_0x4aa474){_0x256d97['push'](_0x256d97['shift']());}};_0x487ee1(++_0x17b56d);}(_0xbea5,0x13c));var _0x5bea=function(_0x349a9e,_0x473cb8){_0x349a9e=_0x349a9e-0x0;var _0x24c207=_0xbea5[_0x349a9e];return _0x24c207;};'use strict';var FaxQueueEvents=require(_0x5bea('0x0'));var events=[_0x5bea('0x1'),_0x5bea('0x2'),_0x5bea('0x3')];function createListener(_0x2885a2,_0x5e6ec3){return function(_0x544acf){_0x5e6ec3['emit'](_0x2885a2,_0x544acf);};}function removeListener(_0x1d12aa,_0x4007fa){return function(){FaxQueueEvents[_0x5bea('0x4')](_0x1d12aa,_0x4007fa);};}exports[_0x5bea('0x5')]=function(_0x115efa){for(var _0x20c132=0x0,_0x250fdd=events[_0x5bea('0x6')];_0x20c132<_0x250fdd;_0x20c132++){var _0x3a0192=events[_0x20c132];var _0x2585c1=createListener(_0x5bea('0x7')+_0x3a0192,_0x115efa);FaxQueueEvents['on'](_0x3a0192,_0x2585c1);}}; \ No newline at end of file +var _0xa482=['remove','update','emit','removeListener','register','length','faxQueue:','./faxQueue.events','save'];(function(_0x5bcfaa,_0x2a40fc){var _0x258316=function(_0x4eaabb){while(--_0x4eaabb){_0x5bcfaa['push'](_0x5bcfaa['shift']());}};_0x258316(++_0x2a40fc);}(_0xa482,0x181));var _0x2a48=function(_0x5277e3,_0x4a48b2){_0x5277e3=_0x5277e3-0x0;var _0x465ef5=_0xa482[_0x5277e3];return _0x465ef5;};'use strict';var FaxQueueEvents=require(_0x2a48('0x0'));var events=[_0x2a48('0x1'),_0x2a48('0x2'),_0x2a48('0x3')];function createListener(_0x291bc9,_0xde9fd9){return function(_0x5ee9a0){_0xde9fd9[_0x2a48('0x4')](_0x291bc9,_0x5ee9a0);};}function removeListener(_0x2b458d,_0x379940){return function(){FaxQueueEvents[_0x2a48('0x5')](_0x2b458d,_0x379940);};}exports[_0x2a48('0x6')]=function(_0x26cf5d){for(var _0x2d69e8=0x0,_0x389bfc=events[_0x2a48('0x7')];_0x2d69e8<_0x389bfc;_0x2d69e8++){var _0x423494=events[_0x2d69e8];var _0x50f009=createListener(_0x2a48('0x8')+_0x423494,_0x26cf5d);FaxQueueEvents['on'](_0x423494,_0x50f009);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 41fe863..a9ef008 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 _0x33af=['destroy','removeTeams','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','show','/:id/members','getMembers','getTeams','/:id/users','post','/:id/teams','addTeams','addAgents','put','delete','/:id'];(function(_0x529a0f,_0x2b6479){var _0x12c826=function(_0x1bdb59){while(--_0x1bdb59){_0x529a0f['push'](_0x529a0f['shift']());}};_0x12c826(++_0x2b6479);}(_0x33af,0xec));var _0xf33a=function(_0x3b085,_0x250543){_0x3b085=_0x3b085-0x0;var _0x476a57=_0x33af[_0x3b085];return _0x476a57;};'use strict';var multer=require('multer');var util=require(_0xf33a('0x0'));var path=require('path');var timeout=require(_0xf33a('0x1'));var express=require(_0xf33a('0x2'));var router=express[_0xf33a('0x3')]();var fs_extra=require(_0xf33a('0x4'));var auth=require(_0xf33a('0x5'));var interaction=require(_0xf33a('0x6'));var config=require('../../config/environment');var controller=require(_0xf33a('0x7'));router[_0xf33a('0x8')]('/',auth['isAuthenticated'](),controller[_0xf33a('0x9')]);router[_0xf33a('0x8')](_0xf33a('0xa'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xc')]);router[_0xf33a('0x8')]('/:id',auth[_0xf33a('0xb')](),controller[_0xf33a('0xd')]);router[_0xf33a('0x8')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xf')]);router['get']('/:id/teams',auth[_0xf33a('0xb')](),controller[_0xf33a('0x10')]);router[_0xf33a('0x8')](_0xf33a('0x11'),auth[_0xf33a('0xb')](),controller['getAgents']);router[_0xf33a('0x12')]('/',auth[_0xf33a('0xb')](),controller['create']);router['post'](_0xf33a('0x13'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x14')]);router[_0xf33a('0x12')](_0xf33a('0x11'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x15')]);router[_0xf33a('0x16')]('/:id',auth[_0xf33a('0xb')](),controller['update']);router[_0xf33a('0x17')](_0xf33a('0x18'),auth['isAuthenticated'](),controller[_0xf33a('0x19')]);router[_0xf33a('0x17')]('/:id/teams',auth[_0xf33a('0xb')](),controller[_0xf33a('0x1a')]);router[_0xf33a('0x17')](_0xf33a('0x11'),auth['isAuthenticated'](),controller[_0xf33a('0x1b')]);module[_0xf33a('0x1c')]=router; \ No newline at end of file +var _0x553a=['/:id/users','getAgents','create','post','addTeams','put','/:id','destroy','delete','removeTeams','removeAgents','util','connect-timeout','express','Router','../../components/interaction/service','get','/describe','isAuthenticated','show','getMembers','/:id/teams','getTeams'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x553a,0x192));var _0xa553=function(_0x4d729f,_0x52bf8b){_0x4d729f=_0x4d729f-0x0;var _0x5ce12a=_0x553a[_0x4d729f];return _0x5ce12a;};'use strict';var multer=require('multer');var util=require(_0xa553('0x0'));var path=require('path');var timeout=require(_0xa553('0x1'));var express=require(_0xa553('0x2'));var router=express[_0xa553('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa553('0x4'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0xa553('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa553('0x5')](_0xa553('0x6'),auth[_0xa553('0x7')](),controller['describe']);router[_0xa553('0x5')]('/:id',auth[_0xa553('0x7')](),controller[_0xa553('0x8')]);router[_0xa553('0x5')]('/:id/members',auth['isAuthenticated'](),controller[_0xa553('0x9')]);router['get'](_0xa553('0xa'),auth[_0xa553('0x7')](),controller[_0xa553('0xb')]);router['get'](_0xa553('0xc'),auth[_0xa553('0x7')](),controller[_0xa553('0xd')]);router['post']('/',auth[_0xa553('0x7')](),controller[_0xa553('0xe')]);router[_0xa553('0xf')]('/:id/teams',auth['isAuthenticated'](),controller[_0xa553('0x10')]);router[_0xa553('0xf')](_0xa553('0xc'),auth[_0xa553('0x7')](),controller['addAgents']);router[_0xa553('0x11')]('/:id',auth[_0xa553('0x7')](),controller['update']);router['delete'](_0xa553('0x12'),auth['isAuthenticated'](),controller[_0xa553('0x13')]);router[_0xa553('0x14')](_0xa553('0xa'),auth['isAuthenticated'](),controller[_0xa553('0x15')]);router[_0xa553('0x14')]('/:id/users',auth[_0xa553('0x7')](),controller[_0xa553('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 3a8b50d..c2f06e6 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 _0x742f=['moment','sequelize','exports','STRING','DATE'];(function(_0x1009c6,_0x548277){var _0x40dc08=function(_0x11218c){while(--_0x11218c){_0x1009c6['push'](_0x1009c6['shift']());}};_0x40dc08(++_0x548277);}(_0x742f,0x131));var _0xf742=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x742f[_0x2b4411];return _0x8e41ef;};'use strict';var moment=require(_0xf742('0x0'));var Sequelize=require(_0xf742('0x1'));module[_0xf742('0x2')]={'uniqueid':{'type':Sequelize[_0xf742('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf742('0x3')]},'joinAt':{'type':Sequelize[_0xf742('0x4')]},'leaveAt':{'type':Sequelize[_0xf742('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xf742('0x3')]}}; \ No newline at end of file +var _0xfc17=['DATE','moment','sequelize','exports','STRING'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0xfc17,0x1b4));var _0x7fc1=function(_0xedc976,_0x28e892){_0xedc976=_0xedc976-0x0;var _0x3d74ca=_0xfc17[_0xedc976];return _0x3d74ca;};'use strict';var moment=require(_0x7fc1('0x0'));var Sequelize=require(_0x7fc1('0x1'));module[_0x7fc1('0x2')]={'uniqueid':{'type':Sequelize[_0x7fc1('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7fc1('0x4')]},'leaveAt':{'type':Sequelize[_0x7fc1('0x4')]},'acceptAt':{'type':Sequelize[_0x7fc1('0x4')]},'exitAt':{'type':Sequelize[_0x7fc1('0x4')]},'reason':{'type':Sequelize[_0x7fc1('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index e6c105c..f40475e 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 _0x44a3=['../../config/logger','../../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','send','index','FaxQueueReport','rawAttributes','model','map','keys','query','filters','intersection','attributes','length','nolimit','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x29dc78,_0x6305e5){var _0x24e5d8=function(_0x24fc44){while(--_0x24fc44){_0x29dc78['push'](_0x29dc78['shift']());}};_0x24e5d8(++_0x6305e5);}(_0x44a3,0x1a9));var _0x344a=function(_0x5ac4b6,_0x4d9360){_0x5ac4b6=_0x5ac4b6-0x0;var _0x29ced8=_0x44a3[_0x5ac4b6];return _0x29ced8;};'use strict';var emlformat=require(_0x344a('0x0'));var rimraf=require(_0x344a('0x1'));var zipdir=require(_0x344a('0x2'));var jsonpatch=require(_0x344a('0x3'));var rp=require(_0x344a('0x4'));var moment=require(_0x344a('0x5'));var BPromise=require(_0x344a('0x6'));var Mustache=require(_0x344a('0x7'));var util=require('util');var path=require(_0x344a('0x8'));var sox=require(_0x344a('0x9'));var csv=require(_0x344a('0xa'));var ejs=require(_0x344a('0xb'));var fs=require('fs');var fs_extra=require(_0x344a('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x344a('0xd'));var toCsv=require(_0x344a('0xa'));var querystring=require(_0x344a('0xe'));var Papa=require(_0x344a('0xf'));var Redis=require(_0x344a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x344a('0x11'));var as=require(_0x344a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x344a('0x13'))('api');var utils=require(_0x344a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x344a('0x15'));var db=require(_0x344a('0x16'))['db'];function respondWithStatusCode(_0x57e42e,_0x4a69ea){_0x4a69ea=_0x4a69ea||0xcc;return function(_0x304b70){if(_0x304b70){return _0x57e42e[_0x344a('0x17')](_0x4a69ea);}return _0x57e42e[_0x344a('0x18')](_0x4a69ea)[_0x344a('0x19')]();};}function respondWithResult(_0x5a0df6,_0x133ad4){_0x133ad4=_0x133ad4||0xc8;return function(_0x4ee562){if(_0x4ee562){return _0x5a0df6[_0x344a('0x18')](_0x133ad4)[_0x344a('0x1a')](_0x4ee562);}};}function respondWithFilteredResult(_0xce0f65,_0x6e1639){return function(_0x58c8cd){if(_0x58c8cd){var _0x54a643=typeof _0x6e1639[_0x344a('0x1b')]===_0x344a('0x1c')&&typeof _0x6e1639[_0x344a('0x1d')]===_0x344a('0x1c');var _0x48b3ab=_0x58c8cd[_0x344a('0x1e')];var _0x277c06=_0x54a643?0x0:_0x6e1639['offset'];var _0x9fe854=_0x54a643?_0x58c8cd[_0x344a('0x1e')]:_0x6e1639[_0x344a('0x1b')]+_0x6e1639[_0x344a('0x1d')];var _0x13b382;if(_0x9fe854>=_0x48b3ab){_0x9fe854=_0x48b3ab;_0x13b382=0xc8;}else{_0x13b382=0xce;}_0xce0f65[_0x344a('0x18')](_0x13b382);return _0xce0f65[_0x344a('0x1f')](_0x344a('0x20'),_0x277c06+'-'+_0x9fe854+'/'+_0x48b3ab)[_0x344a('0x1a')](_0x58c8cd);}return null;};}function patchUpdates(_0x450922){return function(_0x4b3552){try{jsonpatch[_0x344a('0x21')](_0x4b3552,_0x450922,!![]);}catch(_0x4232eb){return BPromise[_0x344a('0x22')](_0x4232eb);}return _0x4b3552[_0x344a('0x23')]();};}function saveUpdates(_0x240be3,_0x80ae12){return function(_0x185303){if(_0x185303){return _0x185303[_0x344a('0x24')](_0x240be3)[_0x344a('0x25')](function(_0x27f527){return _0x27f527;});}return null;};}function removeEntity(_0x90070c,_0x3b2ab9){return function(_0x5ce9da){if(_0x5ce9da){return _0x5ce9da[_0x344a('0x26')]()['then'](function(){_0x90070c[_0x344a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a5e49,_0x484f97){return function(_0x36c920){if(!_0x36c920){_0x2a5e49[_0x344a('0x17')](0x194);}return _0x36c920;};}function handleError(_0x2ebae9,_0x16d404){_0x16d404=_0x16d404||0x1f4;return function(_0x26f059){logger[_0x344a('0x27')](_0x26f059[_0x344a('0x28')]);if(_0x26f059[_0x344a('0x29')]){delete _0x26f059['name'];}_0x2ebae9[_0x344a('0x18')](_0x16d404)[_0x344a('0x2a')](_0x26f059);};}exports[_0x344a('0x2b')]=function(_0xc02d6,_0x14bd54){var _0x2d72c9={},_0x5b877d={},_0x3d25fe={'count':0x0,'rows':[]};var _0x49bbf8=_['map'](db[_0x344a('0x2c')][_0x344a('0x2d')],function(_0x5a36bb){return{'name':_0x5a36bb['fieldName'],'type':_0x5a36bb['type']['key']};});_0x5b877d[_0x344a('0x2e')]=_[_0x344a('0x2f')](_0x49bbf8,_0x344a('0x29'));_0x5b877d['query']=_[_0x344a('0x30')](_0xc02d6[_0x344a('0x31')]);_0x5b877d[_0x344a('0x32')]=_[_0x344a('0x33')](_0x5b877d[_0x344a('0x2e')],_0x5b877d[_0x344a('0x31')]);_0x2d72c9[_0x344a('0x34')]=_['intersection'](_0x5b877d[_0x344a('0x2e')],qs['fields'](_0xc02d6['query']['fields']));_0x2d72c9[_0x344a('0x34')]=_0x2d72c9[_0x344a('0x34')][_0x344a('0x35')]?_0x2d72c9[_0x344a('0x34')]:_0x5b877d[_0x344a('0x2e')];if(!_0xc02d6[_0x344a('0x31')]['hasOwnProperty'](_0x344a('0x36'))){_0x2d72c9[_0x344a('0x1d')]=qs[_0x344a('0x1d')](_0xc02d6['query'][_0x344a('0x1d')]);_0x2d72c9[_0x344a('0x1b')]=qs[_0x344a('0x1b')](_0xc02d6[_0x344a('0x31')][_0x344a('0x1b')]);}_0x2d72c9['order']=qs[_0x344a('0x37')](_0xc02d6[_0x344a('0x31')][_0x344a('0x37')]);_0x2d72c9[_0x344a('0x38')]=qs[_0x344a('0x32')](_['pick'](_0xc02d6[_0x344a('0x31')],_0x5b877d[_0x344a('0x32')]),_0x49bbf8);if(_0xc02d6[_0x344a('0x31')][_0x344a('0x39')]){_0x2d72c9[_0x344a('0x38')]=_['merge'](_0x2d72c9[_0x344a('0x38')],{'$or':_[_0x344a('0x2f')](_0x49bbf8,function(_0x1f52dc){if(_0x1f52dc[_0x344a('0x3a')]!==_0x344a('0x3b')){var _0x27d2d5={};_0x27d2d5[_0x1f52dc[_0x344a('0x29')]]={'$like':'%'+_0xc02d6[_0x344a('0x31')]['filter']+'%'};return _0x27d2d5;}})});}_0x2d72c9=_[_0x344a('0x3c')]({},_0x2d72c9,_0xc02d6[_0x344a('0x3d')]);var _0x3d34c3={'where':_0x2d72c9[_0x344a('0x38')]};return db[_0x344a('0x2c')]['count'](_0x3d34c3)[_0x344a('0x25')](function(_0x2736e9){_0x3d25fe[_0x344a('0x1e')]=_0x2736e9;if(_0xc02d6[_0x344a('0x31')][_0x344a('0x3e')]){_0x2d72c9[_0x344a('0x3f')]=[{'all':!![]}];}return db[_0x344a('0x2c')][_0x344a('0x40')](_0x2d72c9);})[_0x344a('0x25')](function(_0x4b1bac){_0x3d25fe[_0x344a('0x41')]=_0x4b1bac;return _0x3d25fe;})[_0x344a('0x25')](respondWithFilteredResult(_0x14bd54,_0x2d72c9))[_0x344a('0x42')](handleError(_0x14bd54,null));};exports[_0x344a('0x43')]=function(_0x4f9dc2,_0x32bfa6){var _0x3069ca={'raw':!![],'where':{'id':_0x4f9dc2[_0x344a('0x44')]['id']}},_0x2b0ee9={};_0x2b0ee9[_0x344a('0x2e')]=_[_0x344a('0x30')](db[_0x344a('0x2c')][_0x344a('0x2d')]);_0x2b0ee9[_0x344a('0x31')]=_[_0x344a('0x30')](_0x4f9dc2[_0x344a('0x31')]);_0x2b0ee9['filters']=_[_0x344a('0x33')](_0x2b0ee9[_0x344a('0x2e')],_0x2b0ee9['query']);_0x3069ca[_0x344a('0x34')]=_[_0x344a('0x33')](_0x2b0ee9['model'],qs[_0x344a('0x45')](_0x4f9dc2[_0x344a('0x31')]['fields']));_0x3069ca[_0x344a('0x34')]=_0x3069ca[_0x344a('0x34')][_0x344a('0x35')]?_0x3069ca['attributes']:_0x2b0ee9[_0x344a('0x2e')];if(_0x4f9dc2['query'][_0x344a('0x3e')]){_0x3069ca[_0x344a('0x3f')]=[{'all':!![]}];}_0x3069ca=_[_0x344a('0x3c')]({},_0x3069ca,_0x4f9dc2[_0x344a('0x3d')]);return db['FaxQueueReport']['find'](_0x3069ca)[_0x344a('0x25')](handleEntityNotFound(_0x32bfa6,null))[_0x344a('0x25')](respondWithResult(_0x32bfa6,null))[_0x344a('0x42')](handleError(_0x32bfa6,null));};exports[_0x344a('0x46')]=function(_0x300c9f,_0xa3c8f0){return db[_0x344a('0x2c')][_0x344a('0x46')](_0x300c9f[_0x344a('0x47')],{})[_0x344a('0x25')](respondWithResult(_0xa3c8f0,0xc9))['catch'](handleError(_0xa3c8f0,null));};exports[_0x344a('0x24')]=function(_0x2d9858,_0x6fad37){if(_0x2d9858[_0x344a('0x47')]['id']){delete _0x2d9858['body']['id'];}return db[_0x344a('0x2c')]['find']({'where':{'id':_0x2d9858['params']['id']}})[_0x344a('0x25')](handleEntityNotFound(_0x6fad37,null))[_0x344a('0x25')](saveUpdates(_0x2d9858['body'],null))[_0x344a('0x25')](respondWithResult(_0x6fad37,null))[_0x344a('0x42')](handleError(_0x6fad37,null));};exports[_0x344a('0x26')]=function(_0x226f41,_0x51e411){return db[_0x344a('0x2c')][_0x344a('0x48')]({'where':{'id':_0x226f41[_0x344a('0x44')]['id']}})[_0x344a('0x25')](handleEntityNotFound(_0x51e411,null))[_0x344a('0x25')](removeEntity(_0x51e411,null))[_0x344a('0x42')](handleError(_0x51e411,null));};exports[_0x344a('0x49')]=function(_0xe9fc2b,_0x292357){return db[_0x344a('0x2c')]['describe']()[_0x344a('0x25')](respondWithResult(_0x292357,null))['catch'](handleError(_0x292357,null));}; \ No newline at end of file +var _0x2ce1=['bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','FaxQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','create','body','find','describe','fast-json-patch','request-promise','moment'];(function(_0x4cb476,_0x10d7e3){var _0x15887f=function(_0x37e726){while(--_0x37e726){_0x4cb476['push'](_0x4cb476['shift']());}};_0x15887f(++_0x10d7e3);}(_0x2ce1,0x8b));var _0x12ce=function(_0x2dc46e,_0x22c800){_0x2dc46e=_0x2dc46e-0x0;var _0x4eb52c=_0x2ce1[_0x2dc46e];return _0x4eb52c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x12ce('0x0'));var rp=require(_0x12ce('0x1'));var moment=require(_0x12ce('0x2'));var BPromise=require(_0x12ce('0x3'));var Mustache=require('mustache');var util=require(_0x12ce('0x4'));var path=require(_0x12ce('0x5'));var sox=require('sox');var csv=require(_0x12ce('0x6'));var ejs=require(_0x12ce('0x7'));var fs=require('fs');var fs_extra=require(_0x12ce('0x8'));var _=require('lodash');var squel=require(_0x12ce('0x9'));var crypto=require('crypto');var jsforce=require(_0x12ce('0xa'));var deskjs=require(_0x12ce('0xb'));var toCsv=require(_0x12ce('0x6'));var querystring=require('querystring');var Papa=require(_0x12ce('0xc'));var Redis=require(_0x12ce('0xd'));var authService=require(_0x12ce('0xe'));var qs=require(_0x12ce('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x12ce('0x10'));var logger=require('../../config/logger')(_0x12ce('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x12ce('0x12'));var db=require(_0x12ce('0x13'))['db'];function respondWithStatusCode(_0x3dcfb4,_0x3d274d){_0x3d274d=_0x3d274d||0xcc;return function(_0x3d1dd0){if(_0x3d1dd0){return _0x3dcfb4[_0x12ce('0x14')](_0x3d274d);}return _0x3dcfb4['status'](_0x3d274d)[_0x12ce('0x15')]();};}function respondWithResult(_0x5cabae,_0x12bcf2){_0x12bcf2=_0x12bcf2||0xc8;return function(_0x132867){if(_0x132867){return _0x5cabae[_0x12ce('0x16')](_0x12bcf2)['json'](_0x132867);}};}function respondWithFilteredResult(_0x2171d2,_0x288cff){return function(_0x2ac396){if(_0x2ac396){var _0x39e4ec=typeof _0x288cff[_0x12ce('0x17')]===_0x12ce('0x18')&&typeof _0x288cff['limit']==='undefined';var _0x1fcf08=_0x2ac396['count'];var _0x40ab14=_0x39e4ec?0x0:_0x288cff[_0x12ce('0x17')];var _0x4955ae=_0x39e4ec?_0x2ac396[_0x12ce('0x19')]:_0x288cff['offset']+_0x288cff[_0x12ce('0x1a')];var _0x524b6b;if(_0x4955ae>=_0x1fcf08){_0x4955ae=_0x1fcf08;_0x524b6b=0xc8;}else{_0x524b6b=0xce;}_0x2171d2[_0x12ce('0x16')](_0x524b6b);return _0x2171d2['set'](_0x12ce('0x1b'),_0x40ab14+'-'+_0x4955ae+'/'+_0x1fcf08)['json'](_0x2ac396);}return null;};}function patchUpdates(_0x3f031e){return function(_0x521adb){try{jsonpatch['apply'](_0x521adb,_0x3f031e,!![]);}catch(_0x385687){return BPromise[_0x12ce('0x1c')](_0x385687);}return _0x521adb[_0x12ce('0x1d')]();};}function saveUpdates(_0x31656e,_0x5cbb85){return function(_0x162811){if(_0x162811){return _0x162811[_0x12ce('0x1e')](_0x31656e)['then'](function(_0x6302d2){return _0x6302d2;});}return null;};}function removeEntity(_0x4c86cd,_0x45a79c){return function(_0x5c4f01){if(_0x5c4f01){return _0x5c4f01[_0x12ce('0x1f')]()[_0x12ce('0x20')](function(){_0x4c86cd[_0x12ce('0x16')](0xcc)[_0x12ce('0x15')]();});}};}function handleEntityNotFound(_0xb2f1c5,_0x186358){return function(_0xb45ebe){if(!_0xb45ebe){_0xb2f1c5[_0x12ce('0x14')](0x194);}return _0xb45ebe;};}function handleError(_0x562a3d,_0x492e77){_0x492e77=_0x492e77||0x1f4;return function(_0x12c75e){logger[_0x12ce('0x21')](_0x12c75e[_0x12ce('0x22')]);if(_0x12c75e[_0x12ce('0x23')]){delete _0x12c75e['name'];}_0x562a3d[_0x12ce('0x16')](_0x492e77)[_0x12ce('0x24')](_0x12c75e);};}exports[_0x12ce('0x25')]=function(_0xf867bf,_0x55ea43){var _0x57fa70={},_0x4e511b={},_0x3ac1e3={'count':0x0,'rows':[]};var _0x10b653=_['map'](db[_0x12ce('0x26')][_0x12ce('0x27')],function(_0x9d00a5){return{'name':_0x9d00a5[_0x12ce('0x28')],'type':_0x9d00a5[_0x12ce('0x29')][_0x12ce('0x2a')]};});_0x4e511b[_0x12ce('0x2b')]=_[_0x12ce('0x2c')](_0x10b653,'name');_0x4e511b[_0x12ce('0x2d')]=_[_0x12ce('0x2e')](_0xf867bf[_0x12ce('0x2d')]);_0x4e511b[_0x12ce('0x2f')]=_[_0x12ce('0x30')](_0x4e511b['model'],_0x4e511b[_0x12ce('0x2d')]);_0x57fa70[_0x12ce('0x31')]=_['intersection'](_0x4e511b['model'],qs['fields'](_0xf867bf[_0x12ce('0x2d')][_0x12ce('0x32')]));_0x57fa70[_0x12ce('0x31')]=_0x57fa70[_0x12ce('0x31')][_0x12ce('0x33')]?_0x57fa70[_0x12ce('0x31')]:_0x4e511b['model'];if(!_0xf867bf[_0x12ce('0x2d')][_0x12ce('0x34')](_0x12ce('0x35'))){_0x57fa70[_0x12ce('0x1a')]=qs[_0x12ce('0x1a')](_0xf867bf[_0x12ce('0x2d')][_0x12ce('0x1a')]);_0x57fa70[_0x12ce('0x17')]=qs['offset'](_0xf867bf[_0x12ce('0x2d')][_0x12ce('0x17')]);}_0x57fa70[_0x12ce('0x36')]=qs['sort'](_0xf867bf[_0x12ce('0x2d')][_0x12ce('0x37')]);_0x57fa70[_0x12ce('0x38')]=qs['filters'](_[_0x12ce('0x39')](_0xf867bf['query'],_0x4e511b['filters']),_0x10b653);if(_0xf867bf[_0x12ce('0x2d')]['filter']){_0x57fa70[_0x12ce('0x38')]=_[_0x12ce('0x3a')](_0x57fa70[_0x12ce('0x38')],{'$or':_['map'](_0x10b653,function(_0x3797d1){if(_0x3797d1[_0x12ce('0x29')]!==_0x12ce('0x3b')){var _0x3c7352={};_0x3c7352[_0x3797d1[_0x12ce('0x23')]]={'$like':'%'+_0xf867bf[_0x12ce('0x2d')]['filter']+'%'};return _0x3c7352;}})});}_0x57fa70=_['merge']({},_0x57fa70,_0xf867bf['options']);var _0x25eb25={'where':_0x57fa70[_0x12ce('0x38')]};return db[_0x12ce('0x26')]['count'](_0x25eb25)[_0x12ce('0x20')](function(_0x25e365){_0x3ac1e3[_0x12ce('0x19')]=_0x25e365;if(_0xf867bf[_0x12ce('0x2d')][_0x12ce('0x3c')]){_0x57fa70[_0x12ce('0x3d')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x12ce('0x3e')](_0x57fa70);})[_0x12ce('0x20')](function(_0x4672ac){_0x3ac1e3['rows']=_0x4672ac;return _0x3ac1e3;})[_0x12ce('0x20')](respondWithFilteredResult(_0x55ea43,_0x57fa70))[_0x12ce('0x3f')](handleError(_0x55ea43,null));};exports[_0x12ce('0x40')]=function(_0x4c2123,_0x5da8de){var _0x357d92={'raw':!![],'where':{'id':_0x4c2123[_0x12ce('0x41')]['id']}},_0xc2bfad={};_0xc2bfad['model']=_[_0x12ce('0x2e')](db[_0x12ce('0x26')][_0x12ce('0x27')]);_0xc2bfad[_0x12ce('0x2d')]=_[_0x12ce('0x2e')](_0x4c2123[_0x12ce('0x2d')]);_0xc2bfad[_0x12ce('0x2f')]=_[_0x12ce('0x30')](_0xc2bfad[_0x12ce('0x2b')],_0xc2bfad[_0x12ce('0x2d')]);_0x357d92[_0x12ce('0x31')]=_['intersection'](_0xc2bfad['model'],qs[_0x12ce('0x32')](_0x4c2123[_0x12ce('0x2d')][_0x12ce('0x32')]));_0x357d92['attributes']=_0x357d92['attributes']['length']?_0x357d92[_0x12ce('0x31')]:_0xc2bfad[_0x12ce('0x2b')];if(_0x4c2123[_0x12ce('0x2d')][_0x12ce('0x3c')]){_0x357d92[_0x12ce('0x3d')]=[{'all':!![]}];}_0x357d92=_[_0x12ce('0x3a')]({},_0x357d92,_0x4c2123[_0x12ce('0x42')]);return db['FaxQueueReport']['find'](_0x357d92)[_0x12ce('0x20')](handleEntityNotFound(_0x5da8de,null))['then'](respondWithResult(_0x5da8de,null))[_0x12ce('0x3f')](handleError(_0x5da8de,null));};exports[_0x12ce('0x43')]=function(_0x1342e9,_0xd17a37){return db[_0x12ce('0x26')][_0x12ce('0x43')](_0x1342e9['body'],{})[_0x12ce('0x20')](respondWithResult(_0xd17a37,0xc9))['catch'](handleError(_0xd17a37,null));};exports[_0x12ce('0x1e')]=function(_0x38eea7,_0x3a5849){if(_0x38eea7[_0x12ce('0x44')]['id']){delete _0x38eea7[_0x12ce('0x44')]['id'];}return db[_0x12ce('0x26')][_0x12ce('0x45')]({'where':{'id':_0x38eea7['params']['id']}})['then'](handleEntityNotFound(_0x3a5849,null))[_0x12ce('0x20')](saveUpdates(_0x38eea7[_0x12ce('0x44')],null))['then'](respondWithResult(_0x3a5849,null))['catch'](handleError(_0x3a5849,null));};exports[_0x12ce('0x1f')]=function(_0x3976eb,_0x7faa73){return db[_0x12ce('0x26')][_0x12ce('0x45')]({'where':{'id':_0x3976eb[_0x12ce('0x41')]['id']}})[_0x12ce('0x20')](handleEntityNotFound(_0x7faa73,null))[_0x12ce('0x20')](removeEntity(_0x7faa73,null))[_0x12ce('0x3f')](handleError(_0x7faa73,null));};exports[_0x12ce('0x46')]=function(_0x40502c,_0x178a0a){return db[_0x12ce('0x26')][_0x12ce('0x46')]()[_0x12ce('0x20')](respondWithResult(_0x178a0a,null))['catch'](handleError(_0x178a0a,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index c8f39e0..5ec1ad9 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 _0x7217=['api','moment','bluebird','request-promise','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger'];(function(_0x2d2b63,_0x277d0a){var _0x5d18f8=function(_0x4eca54){while(--_0x4eca54){_0x2d2b63['push'](_0x2d2b63['shift']());}};_0x5d18f8(++_0x277d0a);}(_0x7217,0x19e));var _0x7721=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x7217[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[{'name':_0x7721('0xc'),'fields':[_0x7721('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5b6895,_0x1b5107){var _0x21f2c0=function(_0x16005e){while(--_0x16005e){_0x5b6895['push'](_0x5b6895['shift']());}};_0x21f2c0(++_0x1b5107);}(_0x53ec,0x192));var _0xc53e=function(_0x415005,_0x595685){_0x415005=_0x415005-0x0;var _0x50002f=_0x53ec[_0x415005];return _0x50002f;};'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'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 50e602c..950309a 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 _0xbe6d=['FaxQueueReport','create','body','options','stringify','UpdateFaxQueueReport','update','where','attributes','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','CreateFaxQueueReport'];(function(_0x4b6c6d,_0xdcb395){var _0xd5788b=function(_0x27dcd2){while(--_0x27dcd2){_0x4b6c6d['push'](_0x4b6c6d['shift']());}};_0xd5788b(++_0xdcb395);}(_0xbe6d,0x1b7));var _0xdbe6=function(_0x28d1cd,_0x192371){_0x28d1cd=_0x28d1cd-0x0;var _0xdcb892=_0xbe6d[_0x28d1cd];return _0xdcb892;};'use strict';var _=require(_0xdbe6('0x0'));var util=require(_0xdbe6('0x1'));var moment=require(_0xdbe6('0x2'));var BPromise=require(_0xdbe6('0x3'));var rs=require(_0xdbe6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdbe6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdbe6('0x6'))(_0xdbe6('0x7'));var config=require(_0xdbe6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdbe6('0x9')][_0xdbe6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x184e36,_0x27fca4,_0x5e0d86){return new BPromise(function(_0x1306d2,_0x28bb0f){return client[_0xdbe6('0xb')](_0x184e36,_0x5e0d86)[_0xdbe6('0xc')](function(_0x43c555){logger[_0xdbe6('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x27fca4,_0xdbe6('0xe'));logger[_0xdbe6('0xf')](_0xdbe6('0x10'),_0x27fca4,'request\x20sent',JSON['stringify'](_0x43c555));if(_0x43c555[_0xdbe6('0x11')]){if(_0x43c555[_0xdbe6('0x11')][_0xdbe6('0x12')]===0x1f4){logger[_0xdbe6('0x11')](_0xdbe6('0x13'),_0x27fca4,_0x43c555[_0xdbe6('0x11')][_0xdbe6('0x14')]);return _0x28bb0f(_0x43c555[_0xdbe6('0x11')][_0xdbe6('0x14')]);}logger[_0xdbe6('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x27fca4,_0x43c555[_0xdbe6('0x11')][_0xdbe6('0x14')]);return _0x1306d2(_0x43c555['error']['message']);}else{logger[_0xdbe6('0xd')](_0xdbe6('0x13'),_0x27fca4,_0xdbe6('0xe'));_0x1306d2(_0x43c555[_0xdbe6('0x15')]['message']);}})['catch'](function(_0xd7fa5b){logger[_0xdbe6('0x11')](_0xdbe6('0x13'),_0x27fca4,_0xd7fa5b);_0x28bb0f(_0xd7fa5b);});});}exports[_0xdbe6('0x16')]=function(_0x43ac5e){var _0x182af8=this;return new Promise(function(_0x5e8aa7,_0x15059a){return db[_0xdbe6('0x17')][_0xdbe6('0x18')](_0x43ac5e[_0xdbe6('0x19')],{'raw':_0x43ac5e[_0xdbe6('0x1a')]?_0x43ac5e['options']['raw']===undefined?!![]:![]:!![]})[_0xdbe6('0xc')](function(_0x23d9fb){logger['info'](_0xdbe6('0x16'),_0x43ac5e);logger[_0xdbe6('0xf')](_0xdbe6('0x16'),_0x43ac5e,JSON[_0xdbe6('0x1b')](_0x23d9fb));_0x5e8aa7(_0x23d9fb);})['catch'](function(_0x561903){logger[_0xdbe6('0x11')](_0xdbe6('0x16'),_0x561903[_0xdbe6('0x14')],_0x43ac5e);_0x15059a(_0x182af8[_0xdbe6('0x11')](0x1f4,_0x561903['message']));});});};exports[_0xdbe6('0x1c')]=function(_0x13c2e9){var _0x6d5b34=this;return new Promise(function(_0x325041,_0x3d5a4e){return db[_0xdbe6('0x17')][_0xdbe6('0x1d')](_0x13c2e9[_0xdbe6('0x19')],{'raw':_0x13c2e9[_0xdbe6('0x1a')]?_0x13c2e9[_0xdbe6('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13c2e9[_0xdbe6('0x1a')]?_0x13c2e9['options'][_0xdbe6('0x1e')]||null:null,'attributes':_0x13c2e9[_0xdbe6('0x1a')]?_0x13c2e9['options'][_0xdbe6('0x1f')]||null:null,'limit':_0x13c2e9[_0xdbe6('0x1a')]?_0x13c2e9[_0xdbe6('0x1a')]['limit']||null:null})[_0xdbe6('0xc')](function(_0x102a33){logger[_0xdbe6('0xd')](_0xdbe6('0x1c'),_0x13c2e9);logger['debug'](_0xdbe6('0x1c'),_0x13c2e9,JSON[_0xdbe6('0x1b')](_0x102a33));_0x325041(_0x102a33);})[_0xdbe6('0x20')](function(_0x558d71){logger[_0xdbe6('0x11')](_0xdbe6('0x1c'),_0x558d71[_0xdbe6('0x14')],_0x13c2e9);_0x3d5a4e(_0x6d5b34[_0xdbe6('0x11')](0x1f4,_0x558d71[_0xdbe6('0x14')]));});});}; \ No newline at end of file +var _0x6bb3=['FaxQueueReport','create','body','options','raw','debug','CreateFaxQueueReport','UpdateFaxQueueReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x57975f,_0x388556){var _0x4793b8=function(_0x652c05){while(--_0x652c05){_0x57975f['push'](_0x57975f['shift']());}};_0x4793b8(++_0x388556);}(_0x6bb3,0x18c));var _0x36bb=function(_0x5e55e0,_0x5e4b37){_0x5e55e0=_0x5e55e0-0x0;var _0x161e2e=_0x6bb3[_0x5e55e0];return _0x161e2e;};'use strict';var _=require(_0x36bb('0x0'));var util=require(_0x36bb('0x1'));var moment=require(_0x36bb('0x2'));var BPromise=require(_0x36bb('0x3'));var rs=require(_0x36bb('0x4'));var fs=require('fs');var Redis=require(_0x36bb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x36bb('0x6'));var logger=require(_0x36bb('0x7'))(_0x36bb('0x8'));var config=require(_0x36bb('0x9'));var jayson=require(_0x36bb('0xa'));var client=jayson['client'][_0x36bb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f39f7,_0x32ba9b,_0x318d1f){return new BPromise(function(_0x4accd4,_0x2be582){return client[_0x36bb('0xc')](_0x2f39f7,_0x318d1f)[_0x36bb('0xd')](function(_0x38f02b){logger[_0x36bb('0xe')](_0x36bb('0xf'),_0x32ba9b,'request\x20sent');logger['debug'](_0x36bb('0x10'),_0x32ba9b,_0x36bb('0x11'),JSON[_0x36bb('0x12')](_0x38f02b));if(_0x38f02b['error']){if(_0x38f02b[_0x36bb('0x13')][_0x36bb('0x14')]===0x1f4){logger[_0x36bb('0x13')](_0x36bb('0xf'),_0x32ba9b,_0x38f02b[_0x36bb('0x13')][_0x36bb('0x15')]);return _0x2be582(_0x38f02b['error'][_0x36bb('0x15')]);}logger[_0x36bb('0x13')](_0x36bb('0xf'),_0x32ba9b,_0x38f02b['error'][_0x36bb('0x15')]);return _0x4accd4(_0x38f02b['error'][_0x36bb('0x15')]);}else{logger[_0x36bb('0xe')](_0x36bb('0xf'),_0x32ba9b,_0x36bb('0x11'));_0x4accd4(_0x38f02b[_0x36bb('0x16')]['message']);}})[_0x36bb('0x17')](function(_0x57a26a){logger[_0x36bb('0x13')](_0x36bb('0xf'),_0x32ba9b,_0x57a26a);_0x2be582(_0x57a26a);});});}exports['CreateFaxQueueReport']=function(_0x4503fc){var _0x442586=this;return new Promise(function(_0x58d78c,_0x12c3bc){return db[_0x36bb('0x18')][_0x36bb('0x19')](_0x4503fc[_0x36bb('0x1a')],{'raw':_0x4503fc[_0x36bb('0x1b')]?_0x4503fc['options'][_0x36bb('0x1c')]===undefined?!![]:![]:!![]})[_0x36bb('0xd')](function(_0x21d583){logger['info']('CreateFaxQueueReport',_0x4503fc);logger[_0x36bb('0x1d')](_0x36bb('0x1e'),_0x4503fc,JSON['stringify'](_0x21d583));_0x58d78c(_0x21d583);})[_0x36bb('0x17')](function(_0x5165c2){logger['error'](_0x36bb('0x1e'),_0x5165c2[_0x36bb('0x15')],_0x4503fc);_0x12c3bc(_0x442586['error'](0x1f4,_0x5165c2['message']));});});};exports[_0x36bb('0x1f')]=function(_0x39cb37){var _0x178afc=this;return new Promise(function(_0x154d6b,_0x59b21a){return db[_0x36bb('0x18')][_0x36bb('0x20')](_0x39cb37[_0x36bb('0x1a')],{'raw':_0x39cb37['options']?_0x39cb37[_0x36bb('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39cb37[_0x36bb('0x1b')]?_0x39cb37[_0x36bb('0x1b')][_0x36bb('0x21')]||null:null,'attributes':_0x39cb37[_0x36bb('0x1b')]?_0x39cb37[_0x36bb('0x1b')][_0x36bb('0x22')]||null:null,'limit':_0x39cb37[_0x36bb('0x1b')]?_0x39cb37[_0x36bb('0x1b')]['limit']||null:null})[_0x36bb('0xd')](function(_0x43967a){logger['info'](_0x36bb('0x1f'),_0x39cb37);logger['debug']('UpdateFaxQueueReport',_0x39cb37,JSON['stringify'](_0x43967a));_0x154d6b(_0x43967a);})['catch'](function(_0x2d8e34){logger['error'](_0x36bb('0x1f'),_0x2d8e34['message'],_0x39cb37);_0x59b21a(_0x178afc['error'](0x1f4,_0x2d8e34['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index ef3f6ed..71f778c 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 _0x3fd6=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete'];(function(_0xed403f,_0x594cae){var _0x34f91e=function(_0x402c79){while(--_0x402c79){_0xed403f['push'](_0xed403f['shift']());}};_0x34f91e(++_0x594cae);}(_0x3fd6,0xdc));var _0x63fd=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x3fd6[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x63fd('0x0'));var util=require(_0x63fd('0x1'));var path=require(_0x63fd('0x2'));var timeout=require(_0x63fd('0x3'));var express=require('express');var router=express[_0x63fd('0x4')]();var fs_extra=require(_0x63fd('0x5'));var auth=require(_0x63fd('0x6'));var interaction=require(_0x63fd('0x7'));var config=require(_0x63fd('0x8'));var controller=require('./faxQueueReport.controller');router[_0x63fd('0x9')]('/',auth[_0x63fd('0xa')](),controller[_0x63fd('0xb')]);router['get'](_0x63fd('0xc'),auth[_0x63fd('0xa')](),controller[_0x63fd('0xd')]);router[_0x63fd('0x9')](_0x63fd('0xe'),auth[_0x63fd('0xa')](),controller['show']);router[_0x63fd('0xf')]('/',auth[_0x63fd('0xa')](),controller[_0x63fd('0x10')]);router[_0x63fd('0x11')](_0x63fd('0xe'),auth[_0x63fd('0xa')](),controller[_0x63fd('0x12')]);router[_0x63fd('0x13')](_0x63fd('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe717=['post','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x1ff94f,_0x2870a4){var _0x5b602f=function(_0xa25013){while(--_0xa25013){_0x1ff94f['push'](_0x1ff94f['shift']());}};_0x5b602f(++_0x2870a4);}(_0xe717,0x1de));var _0x7e71=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe717[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7e71('0x0'));var util=require(_0x7e71('0x1'));var path=require(_0x7e71('0x2'));var timeout=require('connect-timeout');var express=require(_0x7e71('0x3'));var router=express[_0x7e71('0x4')]();var fs_extra=require(_0x7e71('0x5'));var auth=require(_0x7e71('0x6'));var interaction=require(_0x7e71('0x7'));var config=require(_0x7e71('0x8'));var controller=require('./faxQueueReport.controller');router[_0x7e71('0x9')]('/',auth[_0x7e71('0xa')](),controller[_0x7e71('0xb')]);router[_0x7e71('0x9')](_0x7e71('0xc'),auth[_0x7e71('0xa')](),controller[_0x7e71('0xd')]);router[_0x7e71('0x9')](_0x7e71('0xe'),auth[_0x7e71('0xa')](),controller[_0x7e71('0xf')]);router[_0x7e71('0x10')]('/',auth[_0x7e71('0xa')](),controller['create']);router['put'](_0x7e71('0xe'),auth[_0x7e71('0xa')](),controller[_0x7e71('0x11')]);router['delete']('/:id',auth[_0x7e71('0xa')](),controller['destroy']);module[_0x7e71('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index dae573a..c3b88ec 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x588bd1,_0x5a9049){var _0x504ed0=function(_0xfdfc21){while(--_0xfdfc21){_0x588bd1['push'](_0x588bd1['shift']());}};_0x504ed0(++_0x5a9049);}(_0xaa88,0x137));var _0x8aa8=function(_0x4c7b20,_0x361515){_0x4c7b20=_0x4c7b20-0x0;var _0x4872bd=_0xaa88[_0x4c7b20];return _0x4872bd;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x137987,_0x20162c){var _0x597cae=function(_0x48ecb5){while(--_0x48ecb5){_0x137987['push'](_0x137987['shift']());}};_0x597cae(++_0x20162c);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x149083,_0x4047b6){_0x149083=_0x149083-0x0;var _0x4dc74e=_0xf3cd[_0x149083];return _0x4dc74e;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 14e4089..1dc8c62 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 _0xbbed=['attributes','fields','hasOwnProperty','order','sort','where','pick','merge','filter','include','findAll','rows','params','rawAttributes','keys','length','includeAll','options','catch','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','sendStatus','error','stack','name','index','map','FaxTransferReport','type','key','model','query','filters','intersection'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xbbed,0xa8));var _0xdbbe=function(_0x5b6f23,_0x121129){_0x5b6f23=_0x5b6f23-0x0;var _0x1d70df=_0xbbed[_0x5b6f23];return _0x1d70df;};'use strict';var emlformat=require(_0xdbbe('0x0'));var rimraf=require(_0xdbbe('0x1'));var zipdir=require(_0xdbbe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdbbe('0x3'));var moment=require(_0xdbbe('0x4'));var BPromise=require(_0xdbbe('0x5'));var Mustache=require(_0xdbbe('0x6'));var util=require(_0xdbbe('0x7'));var path=require('path');var sox=require(_0xdbbe('0x8'));var csv=require(_0xdbbe('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdbbe('0xa'));var _=require(_0xdbbe('0xb'));var squel=require(_0xdbbe('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdbbe('0xd'));var toCsv=require(_0xdbbe('0x9'));var querystring=require(_0xdbbe('0xe'));var Papa=require(_0xdbbe('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdbbe('0x10'));var as=require(_0xdbbe('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdbbe('0x12'));var utils=require(_0xdbbe('0x13'));var config=require(_0xdbbe('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xdbbe('0x15'))['db'];function respondWithStatusCode(_0x9e6a0d,_0x536fb8){_0x536fb8=_0x536fb8||0xcc;return function(_0x4e56aa){if(_0x4e56aa){return _0x9e6a0d['sendStatus'](_0x536fb8);}return _0x9e6a0d[_0xdbbe('0x16')](_0x536fb8)[_0xdbbe('0x17')]();};}function respondWithResult(_0x378a02,_0x228c11){_0x228c11=_0x228c11||0xc8;return function(_0x5cd2ab){if(_0x5cd2ab){return _0x378a02[_0xdbbe('0x16')](_0x228c11)[_0xdbbe('0x18')](_0x5cd2ab);}};}function respondWithFilteredResult(_0x1f8c0f,_0x109a6c){return function(_0x924aa0){if(_0x924aa0){var _0x1e1acd=typeof _0x109a6c[_0xdbbe('0x19')]===_0xdbbe('0x1a')&&typeof _0x109a6c[_0xdbbe('0x1b')]===_0xdbbe('0x1a');var _0x47f6cc=_0x924aa0[_0xdbbe('0x1c')];var _0x459f55=_0x1e1acd?0x0:_0x109a6c[_0xdbbe('0x19')];var _0x2c0d61=_0x1e1acd?_0x924aa0[_0xdbbe('0x1c')]:_0x109a6c[_0xdbbe('0x19')]+_0x109a6c['limit'];var _0x3f5660;if(_0x2c0d61>=_0x47f6cc){_0x2c0d61=_0x47f6cc;_0x3f5660=0xc8;}else{_0x3f5660=0xce;}_0x1f8c0f[_0xdbbe('0x16')](_0x3f5660);return _0x1f8c0f[_0xdbbe('0x1d')](_0xdbbe('0x1e'),_0x459f55+'-'+_0x2c0d61+'/'+_0x47f6cc)[_0xdbbe('0x18')](_0x924aa0);}return null;};}function patchUpdates(_0x16ac2f){return function(_0x57b95d){try{jsonpatch['apply'](_0x57b95d,_0x16ac2f,!![]);}catch(_0x5986a7){return BPromise[_0xdbbe('0x1f')](_0x5986a7);}return _0x57b95d[_0xdbbe('0x20')]();};}function saveUpdates(_0x297970,_0x9411ad){return function(_0x636e56){if(_0x636e56){return _0x636e56[_0xdbbe('0x21')](_0x297970)[_0xdbbe('0x22')](function(_0x49a432){return _0x49a432;});}return null;};}function removeEntity(_0x278a71,_0x3e8d36){return function(_0x2c2175){if(_0x2c2175){return _0x2c2175['destroy']()['then'](function(){_0x278a71[_0xdbbe('0x16')](0xcc)[_0xdbbe('0x17')]();});}};}function handleEntityNotFound(_0x2c0f47,_0x4f4510){return function(_0x4c14ec){if(!_0x4c14ec){_0x2c0f47[_0xdbbe('0x23')](0x194);}return _0x4c14ec;};}function handleError(_0x4fb52e,_0x178e01){_0x178e01=_0x178e01||0x1f4;return function(_0x35567b){logger[_0xdbbe('0x24')](_0x35567b[_0xdbbe('0x25')]);if(_0x35567b[_0xdbbe('0x26')]){delete _0x35567b[_0xdbbe('0x26')];}_0x4fb52e[_0xdbbe('0x16')](_0x178e01)['send'](_0x35567b);};}exports[_0xdbbe('0x27')]=function(_0x1ceaa3,_0x119740){var _0xda30a5={},_0x5b1104={},_0x4dfda5={'count':0x0,'rows':[]};var _0x484a06=_[_0xdbbe('0x28')](db[_0xdbbe('0x29')]['rawAttributes'],function(_0x5048d0){return{'name':_0x5048d0['fieldName'],'type':_0x5048d0[_0xdbbe('0x2a')][_0xdbbe('0x2b')]};});_0x5b1104[_0xdbbe('0x2c')]=_[_0xdbbe('0x28')](_0x484a06,_0xdbbe('0x26'));_0x5b1104[_0xdbbe('0x2d')]=_['keys'](_0x1ceaa3['query']);_0x5b1104[_0xdbbe('0x2e')]=_[_0xdbbe('0x2f')](_0x5b1104['model'],_0x5b1104[_0xdbbe('0x2d')]);_0xda30a5[_0xdbbe('0x30')]=_[_0xdbbe('0x2f')](_0x5b1104[_0xdbbe('0x2c')],qs[_0xdbbe('0x31')](_0x1ceaa3['query'][_0xdbbe('0x31')]));_0xda30a5[_0xdbbe('0x30')]=_0xda30a5[_0xdbbe('0x30')]['length']?_0xda30a5[_0xdbbe('0x30')]:_0x5b1104[_0xdbbe('0x2c')];if(!_0x1ceaa3[_0xdbbe('0x2d')][_0xdbbe('0x32')]('nolimit')){_0xda30a5[_0xdbbe('0x1b')]=qs[_0xdbbe('0x1b')](_0x1ceaa3['query'][_0xdbbe('0x1b')]);_0xda30a5[_0xdbbe('0x19')]=qs[_0xdbbe('0x19')](_0x1ceaa3[_0xdbbe('0x2d')][_0xdbbe('0x19')]);}_0xda30a5[_0xdbbe('0x33')]=qs['sort'](_0x1ceaa3[_0xdbbe('0x2d')][_0xdbbe('0x34')]);_0xda30a5[_0xdbbe('0x35')]=qs['filters'](_[_0xdbbe('0x36')](_0x1ceaa3[_0xdbbe('0x2d')],_0x5b1104[_0xdbbe('0x2e')]),_0x484a06);if(_0x1ceaa3[_0xdbbe('0x2d')]['filter']){_0xda30a5['where']=_[_0xdbbe('0x37')](_0xda30a5['where'],{'$or':_[_0xdbbe('0x28')](_0x484a06,function(_0x3d275b){if(_0x3d275b[_0xdbbe('0x2a')]!=='VIRTUAL'){var _0x370773={};_0x370773[_0x3d275b[_0xdbbe('0x26')]]={'$like':'%'+_0x1ceaa3['query'][_0xdbbe('0x38')]+'%'};return _0x370773;}})});}_0xda30a5=_[_0xdbbe('0x37')]({},_0xda30a5,_0x1ceaa3['options']);var _0x4d4abc={'where':_0xda30a5[_0xdbbe('0x35')]};return db['FaxTransferReport']['count'](_0x4d4abc)[_0xdbbe('0x22')](function(_0x4db3ef){_0x4dfda5[_0xdbbe('0x1c')]=_0x4db3ef;if(_0x1ceaa3[_0xdbbe('0x2d')]['includeAll']){_0xda30a5[_0xdbbe('0x39')]=[{'all':!![]}];}return db[_0xdbbe('0x29')][_0xdbbe('0x3a')](_0xda30a5);})[_0xdbbe('0x22')](function(_0x4ab5f4){_0x4dfda5[_0xdbbe('0x3b')]=_0x4ab5f4;return _0x4dfda5;})[_0xdbbe('0x22')](respondWithFilteredResult(_0x119740,_0xda30a5))['catch'](handleError(_0x119740,null));};exports['show']=function(_0x2ebf82,_0x736bf3){var _0xfe65eb={'raw':!![],'where':{'id':_0x2ebf82[_0xdbbe('0x3c')]['id']}},_0x45c3fa={};_0x45c3fa['model']=_['keys'](db['FaxTransferReport'][_0xdbbe('0x3d')]);_0x45c3fa[_0xdbbe('0x2d')]=_[_0xdbbe('0x3e')](_0x2ebf82['query']);_0x45c3fa[_0xdbbe('0x2e')]=_[_0xdbbe('0x2f')](_0x45c3fa['model'],_0x45c3fa['query']);_0xfe65eb[_0xdbbe('0x30')]=_[_0xdbbe('0x2f')](_0x45c3fa[_0xdbbe('0x2c')],qs['fields'](_0x2ebf82[_0xdbbe('0x2d')][_0xdbbe('0x31')]));_0xfe65eb[_0xdbbe('0x30')]=_0xfe65eb[_0xdbbe('0x30')][_0xdbbe('0x3f')]?_0xfe65eb['attributes']:_0x45c3fa[_0xdbbe('0x2c')];if(_0x2ebf82[_0xdbbe('0x2d')][_0xdbbe('0x40')]){_0xfe65eb[_0xdbbe('0x39')]=[{'all':!![]}];}_0xfe65eb=_[_0xdbbe('0x37')]({},_0xfe65eb,_0x2ebf82[_0xdbbe('0x41')]);return db[_0xdbbe('0x29')]['find'](_0xfe65eb)[_0xdbbe('0x22')](handleEntityNotFound(_0x736bf3,null))[_0xdbbe('0x22')](respondWithResult(_0x736bf3,null))[_0xdbbe('0x42')](handleError(_0x736bf3,null));};exports[_0xdbbe('0x43')]=function(_0x15c210,_0x3f4fd1){return db[_0xdbbe('0x29')]['create'](_0x15c210[_0xdbbe('0x44')],{})[_0xdbbe('0x22')](respondWithResult(_0x3f4fd1,0xc9))[_0xdbbe('0x42')](handleError(_0x3f4fd1,null));};exports[_0xdbbe('0x21')]=function(_0x2d7840,_0x5bc41b){if(_0x2d7840[_0xdbbe('0x44')]['id']){delete _0x2d7840[_0xdbbe('0x44')]['id'];}return db['FaxTransferReport'][_0xdbbe('0x45')]({'where':{'id':_0x2d7840[_0xdbbe('0x3c')]['id']}})[_0xdbbe('0x22')](handleEntityNotFound(_0x5bc41b,null))['then'](saveUpdates(_0x2d7840[_0xdbbe('0x44')],null))['then'](respondWithResult(_0x5bc41b,null))[_0xdbbe('0x42')](handleError(_0x5bc41b,null));};exports[_0xdbbe('0x46')]=function(_0x1a048e,_0x5673d1){return db[_0xdbbe('0x29')][_0xdbbe('0x45')]({'where':{'id':_0x1a048e[_0xdbbe('0x3c')]['id']}})[_0xdbbe('0x22')](handleEntityNotFound(_0x5673d1,null))['then'](removeEntity(_0x5673d1,null))['catch'](handleError(_0x5673d1,null));};exports[_0xdbbe('0x47')]=function(_0x873ba3,_0x5ac2ea){return db[_0xdbbe('0x29')][_0xdbbe('0x47')]()['then'](respondWithResult(_0x5ac2ea,null))[_0xdbbe('0x42')](handleError(_0x5ac2ea,null));}; \ No newline at end of file +var _0xf49f=['includeAll','include','findAll','catch','show','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','error','name','map','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','FaxTransferReport','then'];(function(_0x313986,_0x4206c5){var _0x417a8b=function(_0x3d1b10){while(--_0x3d1b10){_0x313986['push'](_0x313986['shift']());}};_0x417a8b(++_0x4206c5);}(_0xf49f,0xde));var _0xff49=function(_0x4dad77,_0x4d5f12){_0x4dad77=_0x4dad77-0x0;var _0x3c80a3=_0xf49f[_0x4dad77];return _0x3c80a3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff49('0x0'));var zipdir=require(_0xff49('0x1'));var jsonpatch=require(_0xff49('0x2'));var rp=require(_0xff49('0x3'));var moment=require(_0xff49('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xff49('0x5'));var util=require(_0xff49('0x6'));var path=require(_0xff49('0x7'));var sox=require('sox');var csv=require(_0xff49('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff49('0x9'));var _=require(_0xff49('0xa'));var squel=require(_0xff49('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xff49('0xc'));var toCsv=require(_0xff49('0x8'));var querystring=require(_0xff49('0xd'));var Papa=require(_0xff49('0xe'));var Redis=require(_0xff49('0xf'));var authService=require(_0xff49('0x10'));var qs=require(_0xff49('0x11'));var as=require(_0xff49('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff49('0x13'))(_0xff49('0x14'));var utils=require(_0xff49('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xff49('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b0fef,_0x11ea7a){_0x11ea7a=_0x11ea7a||0xcc;return function(_0x4e75bb){if(_0x4e75bb){return _0x1b0fef[_0xff49('0x17')](_0x11ea7a);}return _0x1b0fef['status'](_0x11ea7a)[_0xff49('0x18')]();};}function respondWithResult(_0x5c544d,_0x1b7b9f){_0x1b7b9f=_0x1b7b9f||0xc8;return function(_0x13f680){if(_0x13f680){return _0x5c544d[_0xff49('0x19')](_0x1b7b9f)['json'](_0x13f680);}};}function respondWithFilteredResult(_0x3099a2,_0x1dfca3){return function(_0x1ce17c){if(_0x1ce17c){var _0x3cfd0f=typeof _0x1dfca3[_0xff49('0x1a')]===_0xff49('0x1b')&&typeof _0x1dfca3[_0xff49('0x1c')]===_0xff49('0x1b');var _0x3d54b1=_0x1ce17c[_0xff49('0x1d')];var _0xd49f93=_0x3cfd0f?0x0:_0x1dfca3[_0xff49('0x1a')];var _0x327638=_0x3cfd0f?_0x1ce17c[_0xff49('0x1d')]:_0x1dfca3[_0xff49('0x1a')]+_0x1dfca3['limit'];var _0x47c005;if(_0x327638>=_0x3d54b1){_0x327638=_0x3d54b1;_0x47c005=0xc8;}else{_0x47c005=0xce;}_0x3099a2['status'](_0x47c005);return _0x3099a2['set'](_0xff49('0x1e'),_0xd49f93+'-'+_0x327638+'/'+_0x3d54b1)[_0xff49('0x1f')](_0x1ce17c);}return null;};}function patchUpdates(_0x299b36){return function(_0x35e963){try{jsonpatch[_0xff49('0x20')](_0x35e963,_0x299b36,!![]);}catch(_0x10e8f2){return BPromise[_0xff49('0x21')](_0x10e8f2);}return _0x35e963[_0xff49('0x22')]();};}function saveUpdates(_0x50d36e,_0x1a9c30){return function(_0x451c80){if(_0x451c80){return _0x451c80[_0xff49('0x23')](_0x50d36e)['then'](function(_0x2ecbf1){return _0x2ecbf1;});}return null;};}function removeEntity(_0x4cd657,_0x554fb5){return function(_0x850963){if(_0x850963){return _0x850963[_0xff49('0x24')]()['then'](function(){_0x4cd657[_0xff49('0x19')](0xcc)[_0xff49('0x18')]();});}};}function handleEntityNotFound(_0x1e4ad0,_0x26a27d){return function(_0x2da03f){if(!_0x2da03f){_0x1e4ad0[_0xff49('0x17')](0x194);}return _0x2da03f;};}function handleError(_0x26b3ac,_0x38ba22){_0x38ba22=_0x38ba22||0x1f4;return function(_0x5096f7){logger[_0xff49('0x25')](_0x5096f7['stack']);if(_0x5096f7[_0xff49('0x26')]){delete _0x5096f7['name'];}_0x26b3ac[_0xff49('0x19')](_0x38ba22)['send'](_0x5096f7);};}exports['index']=function(_0x2ba853,_0x591b5e){var _0x3c94ff={},_0x5571ee={},_0x1fc5e6={'count':0x0,'rows':[]};var _0x2efa3c=_[_0xff49('0x27')](db['FaxTransferReport'][_0xff49('0x28')],function(_0x5d6337){return{'name':_0x5d6337['fieldName'],'type':_0x5d6337[_0xff49('0x29')][_0xff49('0x2a')]};});_0x5571ee['model']=_['map'](_0x2efa3c,'name');_0x5571ee[_0xff49('0x2b')]=_[_0xff49('0x2c')](_0x2ba853[_0xff49('0x2b')]);_0x5571ee[_0xff49('0x2d')]=_[_0xff49('0x2e')](_0x5571ee[_0xff49('0x2f')],_0x5571ee['query']);_0x3c94ff['attributes']=_[_0xff49('0x2e')](_0x5571ee[_0xff49('0x2f')],qs['fields'](_0x2ba853[_0xff49('0x2b')][_0xff49('0x30')]));_0x3c94ff['attributes']=_0x3c94ff[_0xff49('0x31')][_0xff49('0x32')]?_0x3c94ff['attributes']:_0x5571ee[_0xff49('0x2f')];if(!_0x2ba853[_0xff49('0x2b')][_0xff49('0x33')](_0xff49('0x34'))){_0x3c94ff[_0xff49('0x1c')]=qs[_0xff49('0x1c')](_0x2ba853[_0xff49('0x2b')][_0xff49('0x1c')]);_0x3c94ff[_0xff49('0x1a')]=qs[_0xff49('0x1a')](_0x2ba853[_0xff49('0x2b')][_0xff49('0x1a')]);}_0x3c94ff[_0xff49('0x35')]=qs['sort'](_0x2ba853['query'][_0xff49('0x36')]);_0x3c94ff[_0xff49('0x37')]=qs[_0xff49('0x2d')](_[_0xff49('0x38')](_0x2ba853[_0xff49('0x2b')],_0x5571ee['filters']),_0x2efa3c);if(_0x2ba853[_0xff49('0x2b')][_0xff49('0x39')]){_0x3c94ff['where']=_[_0xff49('0x3a')](_0x3c94ff[_0xff49('0x37')],{'$or':_[_0xff49('0x27')](_0x2efa3c,function(_0x470961){if(_0x470961['type']!=='VIRTUAL'){var _0x267f66={};_0x267f66[_0x470961[_0xff49('0x26')]]={'$like':'%'+_0x2ba853['query']['filter']+'%'};return _0x267f66;}})});}_0x3c94ff=_[_0xff49('0x3a')]({},_0x3c94ff,_0x2ba853[_0xff49('0x3b')]);var _0x1734fc={'where':_0x3c94ff[_0xff49('0x37')]};return db[_0xff49('0x3c')][_0xff49('0x1d')](_0x1734fc)[_0xff49('0x3d')](function(_0x55dbab){_0x1fc5e6[_0xff49('0x1d')]=_0x55dbab;if(_0x2ba853['query'][_0xff49('0x3e')]){_0x3c94ff[_0xff49('0x3f')]=[{'all':!![]}];}return db[_0xff49('0x3c')][_0xff49('0x40')](_0x3c94ff);})[_0xff49('0x3d')](function(_0x469e33){_0x1fc5e6['rows']=_0x469e33;return _0x1fc5e6;})[_0xff49('0x3d')](respondWithFilteredResult(_0x591b5e,_0x3c94ff))[_0xff49('0x41')](handleError(_0x591b5e,null));};exports[_0xff49('0x42')]=function(_0x54194a,_0x225393){var _0x276162={'raw':!![],'where':{'id':_0x54194a['params']['id']}},_0x24bfa8={};_0x24bfa8[_0xff49('0x2f')]=_[_0xff49('0x2c')](db['FaxTransferReport'][_0xff49('0x28')]);_0x24bfa8[_0xff49('0x2b')]=_[_0xff49('0x2c')](_0x54194a[_0xff49('0x2b')]);_0x24bfa8[_0xff49('0x2d')]=_[_0xff49('0x2e')](_0x24bfa8['model'],_0x24bfa8[_0xff49('0x2b')]);_0x276162[_0xff49('0x31')]=_[_0xff49('0x2e')](_0x24bfa8[_0xff49('0x2f')],qs[_0xff49('0x30')](_0x54194a['query'][_0xff49('0x30')]));_0x276162[_0xff49('0x31')]=_0x276162[_0xff49('0x31')][_0xff49('0x32')]?_0x276162[_0xff49('0x31')]:_0x24bfa8[_0xff49('0x2f')];if(_0x54194a[_0xff49('0x2b')][_0xff49('0x3e')]){_0x276162['include']=[{'all':!![]}];}_0x276162=_[_0xff49('0x3a')]({},_0x276162,_0x54194a[_0xff49('0x3b')]);return db[_0xff49('0x3c')][_0xff49('0x43')](_0x276162)[_0xff49('0x3d')](handleEntityNotFound(_0x225393,null))[_0xff49('0x3d')](respondWithResult(_0x225393,null))[_0xff49('0x41')](handleError(_0x225393,null));};exports['create']=function(_0x5f0dd4,_0x5232c5){return db[_0xff49('0x3c')][_0xff49('0x44')](_0x5f0dd4[_0xff49('0x45')],{})[_0xff49('0x3d')](respondWithResult(_0x5232c5,0xc9))[_0xff49('0x41')](handleError(_0x5232c5,null));};exports[_0xff49('0x23')]=function(_0x47370c,_0x5539d1){if(_0x47370c[_0xff49('0x45')]['id']){delete _0x47370c[_0xff49('0x45')]['id'];}return db['FaxTransferReport'][_0xff49('0x43')]({'where':{'id':_0x47370c[_0xff49('0x46')]['id']}})[_0xff49('0x3d')](handleEntityNotFound(_0x5539d1,null))['then'](saveUpdates(_0x47370c['body'],null))['then'](respondWithResult(_0x5539d1,null))[_0xff49('0x41')](handleError(_0x5539d1,null));};exports[_0xff49('0x24')]=function(_0x320ff5,_0x29ad94){return db[_0xff49('0x3c')][_0xff49('0x43')]({'where':{'id':_0x320ff5[_0xff49('0x46')]['id']}})[_0xff49('0x3d')](handleEntityNotFound(_0x29ad94,null))['then'](removeEntity(_0x29ad94,null))[_0xff49('0x41')](handleError(_0x29ad94,null));};exports['describe']=function(_0x3e2a31,_0x2d943b){return db['FaxTransferReport']['describe']()[_0xff49('0x3d')](respondWithResult(_0x2d943b,null))[_0xff49('0x41')](handleError(_0x2d943b,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 030cf16..bf57383 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 _0x3704=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','FaxTransferReport','uniqueid','util','../../config/logger'];(function(_0x1906e0,_0x45a2bf){var _0x5657a6=function(_0x27fa24){while(--_0x27fa24){_0x1906e0['push'](_0x1906e0['shift']());}};_0x5657a6(++_0x45a2bf);}(_0x3704,0x6c));var _0x4370=function(_0x51638e,_0x5d449c){_0x51638e=_0x51638e-0x0;var _0x547549=_0x3704[_0x51638e];return _0x547549;};'use strict';var _=require('lodash');var util=require(_0x4370('0x0'));var logger=require(_0x4370('0x1'))('api');var moment=require(_0x4370('0x2'));var BPromise=require(_0x4370('0x3'));var rp=require(_0x4370('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4370('0x5'));var config=require(_0x4370('0x6'));var attributes=require('./faxTransferReport.attributes');module[_0x4370('0x7')]=function(_0x56a11f,_0x5958bf){return _0x56a11f['define'](_0x4370('0x8'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x4370('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd868=['request-promise','path','rimraf','./faxTransferReport.attributes','define','FaxTransferReport','uniqueid','lodash','api','moment','bluebird'];(function(_0x3ba924,_0x3b99f0){var _0x4cc1df=function(_0x15bf28){while(--_0x15bf28){_0x3ba924['push'](_0x3ba924['shift']());}};_0x4cc1df(++_0x3b99f0);}(_0xd868,0xf9));var _0x8d86=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xd868[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0x8d86('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8d86('0x1'));var moment=require(_0x8d86('0x2'));var BPromise=require(_0x8d86('0x3'));var rp=require(_0x8d86('0x4'));var fs=require('fs');var path=require(_0x8d86('0x5'));var rimraf=require(_0x8d86('0x6'));var config=require('../../config/environment');var attributes=require(_0x8d86('0x7'));module['exports']=function(_0x43da91,_0x1e936a){return _0x43da91[_0x8d86('0x8')](_0x8d86('0x9'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x8d86('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 7906938..9503e6d 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 _0x9f18=['rpc','../../config/environment','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x2c94d9,_0x5bc25b){var _0x5edb10=function(_0x12d59d){while(--_0x12d59d){_0x2c94d9['push'](_0x2c94d9['shift']());}};_0x5edb10(++_0x5bc25b);}(_0x9f18,0x12b));var _0x89f1=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x9f18[_0x3070dc];return _0x431489;};'use strict';var _=require(_0x89f1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x89f1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x89f1('0x2'));var db=require(_0x89f1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x89f1('0x4'))(_0x89f1('0x5'));var config=require(_0x89f1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x89f1('0x7')][_0x89f1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2c411b,_0x5eae7d,_0xbce5e4){return new BPromise(function(_0x20e369,_0x5dd19f){return client[_0x89f1('0x9')](_0x2c411b,_0xbce5e4)[_0x89f1('0xa')](function(_0x2365af){logger['info'](_0x89f1('0xb'),_0x5eae7d,_0x89f1('0xc'));logger[_0x89f1('0xd')](_0x89f1('0xe'),_0x5eae7d,_0x89f1('0xc'),JSON['stringify'](_0x2365af));if(_0x2365af['error']){if(_0x2365af[_0x89f1('0xf')]['code']===0x1f4){logger[_0x89f1('0xf')](_0x89f1('0xb'),_0x5eae7d,_0x2365af['error'][_0x89f1('0x10')]);return _0x5dd19f(_0x2365af[_0x89f1('0xf')][_0x89f1('0x10')]);}logger[_0x89f1('0xf')](_0x89f1('0xb'),_0x5eae7d,_0x2365af['error']['message']);return _0x20e369(_0x2365af[_0x89f1('0xf')][_0x89f1('0x10')]);}else{logger['info'](_0x89f1('0xb'),_0x5eae7d,_0x89f1('0xc'));_0x20e369(_0x2365af[_0x89f1('0x11')][_0x89f1('0x10')]);}})[_0x89f1('0x12')](function(_0x2cd334){logger[_0x89f1('0xf')](_0x89f1('0xb'),_0x5eae7d,_0x2cd334);_0x5dd19f(_0x2cd334);});});} \ No newline at end of file +var _0x3246=['FaxTransferReport,\x20%s,\x20%s','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info'];(function(_0x593f0e,_0x3555e7){var _0x116f30=function(_0x4df802){while(--_0x4df802){_0x593f0e['push'](_0x593f0e['shift']());}};_0x116f30(++_0x3555e7);}(_0x3246,0x7f));var _0x6324=function(_0x3afc45,_0x304a38){_0x3afc45=_0x3afc45-0x0;var _0x28df8a=_0x3246[_0x3afc45];return _0x28df8a;};'use strict';var _=require(_0x6324('0x0'));var util=require(_0x6324('0x1'));var moment=require(_0x6324('0x2'));var BPromise=require('bluebird');var rs=require(_0x6324('0x3'));var fs=require('fs');var Redis=require(_0x6324('0x4'));var db=require(_0x6324('0x5'))['db'];var utils=require(_0x6324('0x6'));var logger=require('../../config/logger')(_0x6324('0x7'));var config=require(_0x6324('0x8'));var jayson=require(_0x6324('0x9'));var client=jayson['client'][_0x6324('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b618b,_0x28ab6a,_0xb0ca3){return new BPromise(function(_0x43d06e,_0xf13d7e){return client['request'](_0x5b618b,_0xb0ca3)[_0x6324('0xb')](function(_0x30e2cc){logger[_0x6324('0xc')](_0x6324('0xd'),_0x28ab6a,'request\x20sent');logger['debug'](_0x6324('0xe'),_0x28ab6a,_0x6324('0xf'),JSON['stringify'](_0x30e2cc));if(_0x30e2cc['error']){if(_0x30e2cc[_0x6324('0x10')][_0x6324('0x11')]===0x1f4){logger[_0x6324('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x28ab6a,_0x30e2cc[_0x6324('0x10')][_0x6324('0x12')]);return _0xf13d7e(_0x30e2cc[_0x6324('0x10')][_0x6324('0x12')]);}logger['error'](_0x6324('0xd'),_0x28ab6a,_0x30e2cc[_0x6324('0x10')][_0x6324('0x12')]);return _0x43d06e(_0x30e2cc['error'][_0x6324('0x12')]);}else{logger[_0x6324('0xc')](_0x6324('0xd'),_0x28ab6a,_0x6324('0xf'));_0x43d06e(_0x30e2cc['result'][_0x6324('0x12')]);}})[_0x6324('0x13')](function(_0x30021b){logger[_0x6324('0x10')](_0x6324('0xd'),_0x28ab6a,_0x30021b);_0xf13d7e(_0x30021b);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index d69edc8..5a39f14 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 _0x65fb=['destroy','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','show','post','put','/:id','update','delete'];(function(_0x3cb41d,_0x2d7f6d){var _0x4dc372=function(_0x2e7351){while(--_0x2e7351){_0x3cb41d['push'](_0x3cb41d['shift']());}};_0x4dc372(++_0x2d7f6d);}(_0x65fb,0x17d));var _0xb65f=function(_0x428774,_0x383962){_0x428774=_0x428774-0x0;var _0x53a01c=_0x65fb[_0x428774];return _0x53a01c;};'use strict';var multer=require(_0xb65f('0x0'));var util=require(_0xb65f('0x1'));var path=require('path');var timeout=require(_0xb65f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb65f('0x3'));var auth=require(_0xb65f('0x4'));var interaction=require(_0xb65f('0x5'));var config=require(_0xb65f('0x6'));var controller=require(_0xb65f('0x7'));router[_0xb65f('0x8')]('/',auth[_0xb65f('0x9')](),controller[_0xb65f('0xa')]);router['get'](_0xb65f('0xb'),auth[_0xb65f('0x9')](),controller['describe']);router['get']('/:id',auth[_0xb65f('0x9')](),controller[_0xb65f('0xc')]);router[_0xb65f('0xd')]('/',auth[_0xb65f('0x9')](),controller['create']);router[_0xb65f('0xe')](_0xb65f('0xf'),auth['isAuthenticated'](),controller[_0xb65f('0x10')]);router[_0xb65f('0x11')](_0xb65f('0xf'),auth['isAuthenticated'](),controller[_0xb65f('0x12')]);module['exports']=router; \ No newline at end of file +var _0x0f3e=['./faxTransferReport.controller','get','isAuthenticated','index','/describe','/:id','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x159555,_0x117772){var _0x411e11=function(_0x4d646a){while(--_0x4d646a){_0x159555['push'](_0x159555['shift']());}};_0x411e11(++_0x117772);}(_0x0f3e,0x88));var _0xe0f3=function(_0x16e173,_0x4147c6){_0x16e173=_0x16e173-0x0;var _0x9f44b6=_0x0f3e[_0x16e173];return _0x9f44b6;};'use strict';var multer=require(_0xe0f3('0x0'));var util=require(_0xe0f3('0x1'));var path=require(_0xe0f3('0x2'));var timeout=require(_0xe0f3('0x3'));var express=require(_0xe0f3('0x4'));var router=express[_0xe0f3('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe0f3('0x6'));var config=require(_0xe0f3('0x7'));var controller=require(_0xe0f3('0x8'));router[_0xe0f3('0x9')]('/',auth[_0xe0f3('0xa')](),controller[_0xe0f3('0xb')]);router['get'](_0xe0f3('0xc'),auth[_0xe0f3('0xa')](),controller['describe']);router[_0xe0f3('0x9')](_0xe0f3('0xd'),auth[_0xe0f3('0xa')](),controller['show']);router['post']('/',auth[_0xe0f3('0xa')](),controller[_0xe0f3('0xe')]);router['put'](_0xe0f3('0xd'),auth['isAuthenticated'](),controller[_0xe0f3('0xf')]);router['delete'](_0xe0f3('0xd'),auth['isAuthenticated'](),controller[_0xe0f3('0x10')]);module[_0xe0f3('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 85d8a92..ce6b9dd 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 _0xc9de=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get'];(function(_0x480b87,_0x5ee25d){var _0x371d8d=function(_0x4e0d3e){while(--_0x4e0d3e){_0x480b87['push'](_0x480b87['shift']());}};_0x371d8d(++_0x5ee25d);}(_0xc9de,0x17d));var _0xec9d=function(_0x59288e,_0x326d1e){_0x59288e=_0x59288e-0x0;var _0x558079=_0xc9de[_0x59288e];return _0x558079;};'use strict';var multer=require('multer');var util=require(_0xec9d('0x0'));var path=require('path');var timeout=require(_0xec9d('0x1'));var express=require(_0xec9d('0x2'));var router=express[_0xec9d('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xec9d('0x4'));var config=require(_0xec9d('0x5'));var controller=require(_0xec9d('0x6'));router['get']('/',auth[_0xec9d('0x7')](),controller[_0xec9d('0x8')]);router[_0xec9d('0x9')](_0xec9d('0xa'),auth[_0xec9d('0x7')](),controller[_0xec9d('0xb')]);router[_0xec9d('0x9')](_0xec9d('0xc'),auth['isAuthenticated'](),controller[_0xec9d('0xd')]);router[_0xec9d('0x9')](_0xec9d('0xe'),auth[_0xec9d('0x7')](),controller[_0xec9d('0xf')]);router[_0xec9d('0x10')]('/',auth[_0xec9d('0x7')](),controller[_0xec9d('0x11')]);router[_0xec9d('0x10')](_0xec9d('0xc'),auth[_0xec9d('0x7')](),controller[_0xec9d('0x12')]);router[_0xec9d('0x13')]('/:id',auth[_0xec9d('0x7')](),controller[_0xec9d('0x14')]);router[_0xec9d('0x15')](_0xec9d('0xa'),auth[_0xec9d('0x7')](),controller[_0xec9d('0x16')]);module['exports']=router; \ No newline at end of file +var _0x09d1=['getConfigurations','/:id/fields','getFields','post','addConfiguration','put','/:id','update','delete','destroy','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations'];(function(_0x4b03c9,_0x17ce03){var _0x161ba2=function(_0xb952db){while(--_0xb952db){_0x4b03c9['push'](_0x4b03c9['shift']());}};_0x161ba2(++_0x17ce03);}(_0x09d1,0x17a));var _0x109d=function(_0x4e8eea,_0x3ebbbb){_0x4e8eea=_0x4e8eea-0x0;var _0x1f36ad=_0x09d1[_0x4e8eea];return _0x1f36ad;};'use strict';var multer=require('multer');var util=require(_0x109d('0x0'));var path=require('path');var timeout=require(_0x109d('0x1'));var express=require(_0x109d('0x2'));var router=express['Router']();var fs_extra=require(_0x109d('0x3'));var auth=require(_0x109d('0x4'));var interaction=require(_0x109d('0x5'));var config=require(_0x109d('0x6'));var controller=require(_0x109d('0x7'));router[_0x109d('0x8')]('/',auth[_0x109d('0x9')](),controller[_0x109d('0xa')]);router[_0x109d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x109d('0xb')]);router[_0x109d('0x8')](_0x109d('0xc'),auth['isAuthenticated'](),controller[_0x109d('0xd')]);router[_0x109d('0x8')](_0x109d('0xe'),auth[_0x109d('0x9')](),controller[_0x109d('0xf')]);router[_0x109d('0x10')]('/',auth[_0x109d('0x9')](),controller['create']);router[_0x109d('0x10')](_0x109d('0xc'),auth[_0x109d('0x9')](),controller[_0x109d('0x11')]);router[_0x109d('0x12')](_0x109d('0x13'),auth[_0x109d('0x9')](),controller[_0x109d('0x14')]);router[_0x109d('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x109d('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 743e6a2..a882468 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 _0xfc52=['sequelize','exports','STRING','ENUM','basic','integrationTab'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0xfc52,0x1c8));var _0x2fc5=function(_0x316b3e,_0x47b154){_0x316b3e=_0x316b3e-0x0;var _0x45ba95=_0xfc52[_0x316b3e];return _0x45ba95;};'use strict';var Sequelize=require(_0x2fc5('0x0'));module[_0x2fc5('0x1')]={'name':{'type':Sequelize[_0x2fc5('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x2fc5('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x2fc5('0x3')]('basic'),'defaultValue':_0x2fc5('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x2fc5('0x2')]},'token':{'type':Sequelize[_0x2fc5('0x2')]},'tokenSecret':{'type':Sequelize[_0x2fc5('0x2')]},'serverUrl':{'type':Sequelize[_0x2fc5('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2fc5('0x3')](_0x2fc5('0x5'),'newTab'),'defaultValue':_0x2fc5('0x5')}}; \ No newline at end of file +var _0xdf13=['exports','STRING','ENUM','basic','newTab','integrationTab'];(function(_0x6d2675,_0xffc976){var _0x562241=function(_0x1d3864){while(--_0x1d3864){_0x6d2675['push'](_0x6d2675['shift']());}};_0x562241(++_0xffc976);}(_0xdf13,0xba));var _0x3df1=function(_0x5cd7a3,_0x1aa14f){_0x5cd7a3=_0x5cd7a3-0x0;var _0x21235d=_0xdf13[_0x5cd7a3];return _0x21235d;};'use strict';var Sequelize=require('sequelize');module[_0x3df1('0x0')]={'name':{'type':Sequelize[_0x3df1('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3df1('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x3df1('0x2')](_0x3df1('0x3')),'defaultValue':_0x3df1('0x3')},'password':{'type':Sequelize[_0x3df1('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x3df1('0x1')]},'token':{'type':Sequelize[_0x3df1('0x1')]},'tokenSecret':{'type':Sequelize[_0x3df1('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x3df1('0x4')),'defaultValue':_0x3df1('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 36906c7..b527174 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 _0xa27f=['then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','DeskAccount','includeAll','include','findAll','rows','catch','show','params','find','create','body','DeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','DeskField','getFields','priority','findOne','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','substring','lastIndexOf','GET','format','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update'];(function(_0x1ba78c,_0x2a7f64){var _0x483e00=function(_0x29b721){while(--_0x29b721){_0x1ba78c['push'](_0x1ba78c['shift']());}};_0x483e00(++_0x2a7f64);}(_0xa27f,0x19c));var _0xfa27=function(_0x1667d8,_0x62ff36){_0x1667d8=_0x1667d8-0x0;var _0x36e2d7=_0xa27f[_0x1667d8];return _0x36e2d7;};'use strict';var emlformat=require(_0xfa27('0x0'));var rimraf=require(_0xfa27('0x1'));var zipdir=require(_0xfa27('0x2'));var jsonpatch=require(_0xfa27('0x3'));var rp=require(_0xfa27('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfa27('0x5'));var path=require(_0xfa27('0x6'));var sox=require(_0xfa27('0x7'));var csv=require(_0xfa27('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfa27('0x9'));var _=require(_0xfa27('0xa'));var squel=require(_0xfa27('0xb'));var crypto=require(_0xfa27('0xc'));var jsforce=require(_0xfa27('0xd'));var deskjs=require(_0xfa27('0xe'));var toCsv=require(_0xfa27('0x8'));var querystring=require(_0xfa27('0xf'));var Papa=require('papaparse');var Redis=require(_0xfa27('0x10'));var authService=require(_0xfa27('0x11'));var qs=require(_0xfa27('0x12'));var as=require(_0xfa27('0x13'));var hardwareService=require(_0xfa27('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xfa27('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xfa27('0x16'));function respondWithStatusCode(_0x56667f,_0x337578){_0x337578=_0x337578||0xcc;return function(_0x27189c){if(_0x27189c){return _0x56667f[_0xfa27('0x17')](_0x337578);}return _0x56667f[_0xfa27('0x18')](_0x337578)[_0xfa27('0x19')]();};}function respondWithResult(_0x1bd79d,_0x194542){_0x194542=_0x194542||0xc8;return function(_0x14460f){if(_0x14460f){return _0x1bd79d[_0xfa27('0x18')](_0x194542)[_0xfa27('0x1a')](_0x14460f);}};}function respondWithFilteredResult(_0x5f0031,_0x1b9baf){return function(_0x4855c1){if(_0x4855c1){var _0x22acd0=typeof _0x1b9baf[_0xfa27('0x1b')]===_0xfa27('0x1c')&&typeof _0x1b9baf[_0xfa27('0x1d')]===_0xfa27('0x1c');var _0x42bce5=_0x4855c1[_0xfa27('0x1e')];var _0x4bdcf2=_0x22acd0?0x0:_0x1b9baf[_0xfa27('0x1b')];var _0x30f80a=_0x22acd0?_0x4855c1['count']:_0x1b9baf[_0xfa27('0x1b')]+_0x1b9baf[_0xfa27('0x1d')];var _0x21e54f;if(_0x30f80a>=_0x42bce5){_0x30f80a=_0x42bce5;_0x21e54f=0xc8;}else{_0x21e54f=0xce;}_0x5f0031[_0xfa27('0x18')](_0x21e54f);return _0x5f0031[_0xfa27('0x1f')](_0xfa27('0x20'),_0x4bdcf2+'-'+_0x30f80a+'/'+_0x42bce5)['json'](_0x4855c1);}return null;};}function patchUpdates(_0x30acaf){return function(_0x581cbd){try{jsonpatch[_0xfa27('0x21')](_0x581cbd,_0x30acaf,!![]);}catch(_0x457eb3){return BPromise[_0xfa27('0x22')](_0x457eb3);}return _0x581cbd['save']();};}function saveUpdates(_0x45b785,_0x5946f6){return function(_0x513cbc){if(_0x513cbc){return _0x513cbc[_0xfa27('0x23')](_0x45b785)[_0xfa27('0x24')](function(_0x1b9bb0){return _0x1b9bb0;});}return null;};}function removeEntity(_0x4506bf,_0xc5ce34){return function(_0xfce807){if(_0xfce807){return _0xfce807[_0xfa27('0x25')]()['then'](function(){_0x4506bf[_0xfa27('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e631e,_0x58c099){return function(_0x2c5a8a){if(!_0x2c5a8a){_0x2e631e[_0xfa27('0x17')](0x194);}return _0x2c5a8a;};}function handleError(_0x10fb71,_0x330d14){_0x330d14=_0x330d14||0x1f4;return function(_0x525d46){logger[_0xfa27('0x26')](_0x525d46[_0xfa27('0x27')]);if(_0x525d46[_0xfa27('0x28')]){delete _0x525d46[_0xfa27('0x28')];}_0x10fb71[_0xfa27('0x18')](_0x330d14)[_0xfa27('0x29')](_0x525d46);};}exports[_0xfa27('0x2a')]=function(_0xd2dd93,_0x2f41de){var _0x29753f={},_0x238cb8={},_0x56710e={'count':0x0,'rows':[]};var _0x2a8748=_[_0xfa27('0x2b')](db['DeskAccount']['rawAttributes'],function(_0x5091bd){return{'name':_0x5091bd[_0xfa27('0x2c')],'type':_0x5091bd[_0xfa27('0x2d')][_0xfa27('0x2e')]};});_0x238cb8[_0xfa27('0x2f')]=_[_0xfa27('0x2b')](_0x2a8748,_0xfa27('0x28'));_0x238cb8[_0xfa27('0x30')]=_[_0xfa27('0x31')](_0xd2dd93[_0xfa27('0x30')]);_0x238cb8[_0xfa27('0x32')]=_[_0xfa27('0x33')](_0x238cb8[_0xfa27('0x2f')],_0x238cb8[_0xfa27('0x30')]);_0x29753f[_0xfa27('0x34')]=_[_0xfa27('0x33')](_0x238cb8['model'],qs[_0xfa27('0x35')](_0xd2dd93[_0xfa27('0x30')][_0xfa27('0x35')]));_0x29753f['attributes']=_0x29753f[_0xfa27('0x34')][_0xfa27('0x36')]?_0x29753f[_0xfa27('0x34')]:_0x238cb8[_0xfa27('0x2f')];if(!_0xd2dd93[_0xfa27('0x30')][_0xfa27('0x37')](_0xfa27('0x38'))){_0x29753f[_0xfa27('0x1d')]=qs[_0xfa27('0x1d')](_0xd2dd93['query']['limit']);_0x29753f[_0xfa27('0x1b')]=qs[_0xfa27('0x1b')](_0xd2dd93[_0xfa27('0x30')]['offset']);}_0x29753f[_0xfa27('0x39')]=qs[_0xfa27('0x3a')](_0xd2dd93[_0xfa27('0x30')][_0xfa27('0x3a')]);_0x29753f[_0xfa27('0x3b')]=qs[_0xfa27('0x32')](_[_0xfa27('0x3c')](_0xd2dd93[_0xfa27('0x30')],_0x238cb8[_0xfa27('0x32')]),_0x2a8748);if(_0xd2dd93[_0xfa27('0x30')]['filter']){_0x29753f[_0xfa27('0x3b')]=_[_0xfa27('0x3d')](_0x29753f[_0xfa27('0x3b')],{'$or':_[_0xfa27('0x2b')](_0x2a8748,function(_0x36d6e5){if(_0x36d6e5[_0xfa27('0x2d')]!==_0xfa27('0x3e')){var _0x5699f3={};_0x5699f3[_0x36d6e5['name']]={'$like':'%'+_0xd2dd93[_0xfa27('0x30')][_0xfa27('0x3f')]+'%'};return _0x5699f3;}})});}_0x29753f=_[_0xfa27('0x3d')]({},_0x29753f,_0xd2dd93[_0xfa27('0x40')]);var _0x16f62c={'where':_0x29753f['where']};return db[_0xfa27('0x41')]['count'](_0x16f62c)[_0xfa27('0x24')](function(_0x11efa0){_0x56710e['count']=_0x11efa0;if(_0xd2dd93[_0xfa27('0x30')][_0xfa27('0x42')]){_0x29753f[_0xfa27('0x43')]=[{'all':!![]}];}return db[_0xfa27('0x41')][_0xfa27('0x44')](_0x29753f);})[_0xfa27('0x24')](function(_0x48b53a){_0x56710e[_0xfa27('0x45')]=_0x48b53a;return _0x56710e;})['then'](respondWithFilteredResult(_0x2f41de,_0x29753f))[_0xfa27('0x46')](handleError(_0x2f41de,null));};exports[_0xfa27('0x47')]=function(_0x536597,_0x3172ee){var _0x4d9b38={'raw':![],'where':{'id':_0x536597[_0xfa27('0x48')]['id']}},_0x9d68a2={};_0x9d68a2[_0xfa27('0x2f')]=_[_0xfa27('0x31')](db[_0xfa27('0x41')]['rawAttributes']);_0x9d68a2['query']=_[_0xfa27('0x31')](_0x536597[_0xfa27('0x30')]);_0x9d68a2[_0xfa27('0x32')]=_[_0xfa27('0x33')](_0x9d68a2[_0xfa27('0x2f')],_0x9d68a2[_0xfa27('0x30')]);_0x4d9b38['attributes']=_['intersection'](_0x9d68a2[_0xfa27('0x2f')],qs[_0xfa27('0x35')](_0x536597[_0xfa27('0x30')]['fields']));_0x4d9b38['attributes']=_0x4d9b38[_0xfa27('0x34')]['length']?_0x4d9b38['attributes']:_0x9d68a2[_0xfa27('0x2f')];if(_0x536597[_0xfa27('0x30')]['includeAll']){_0x4d9b38['include']=[{'all':!![]}];}_0x4d9b38=_['merge']({},_0x4d9b38,_0x536597['options']);return db[_0xfa27('0x41')][_0xfa27('0x49')](_0x4d9b38)[_0xfa27('0x24')](handleEntityNotFound(_0x3172ee,null))[_0xfa27('0x24')](respondWithResult(_0x3172ee,null))[_0xfa27('0x46')](handleError(_0x3172ee,null));};exports['create']=function(_0x3a8db1,_0x3b0d86){return db[_0xfa27('0x41')][_0xfa27('0x4a')](_0x3a8db1['body'],{})['then'](respondWithResult(_0x3b0d86,0xc9))[_0xfa27('0x46')](handleError(_0x3b0d86,null));};exports['update']=function(_0x26edd2,_0x213e31){if(_0x26edd2['body']['id']){delete _0x26edd2[_0xfa27('0x4b')]['id'];}return db['DeskAccount'][_0xfa27('0x49')]({'where':{'id':_0x26edd2[_0xfa27('0x48')]['id']}})[_0xfa27('0x24')](handleEntityNotFound(_0x213e31,null))[_0xfa27('0x24')](saveUpdates(_0x26edd2[_0xfa27('0x4b')],null))['then'](respondWithResult(_0x213e31,null))[_0xfa27('0x46')](handleError(_0x213e31,null));};exports[_0xfa27('0x25')]=function(_0x2a9cdb,_0x505457){return db['DeskAccount'][_0xfa27('0x49')]({'where':{'id':_0x2a9cdb['params']['id']}})[_0xfa27('0x24')](handleEntityNotFound(_0x505457,null))['then'](removeEntity(_0x505457,null))[_0xfa27('0x46')](handleError(_0x505457,null));};exports['getConfigurations']=function(_0x10a615,_0x5930b4,_0x589f29){var _0x315c63={};var _0x4860e6={};var _0x4b9b86;var _0x1ce8ec;return db[_0xfa27('0x41')]['findOne']({'where':{'id':_0x10a615['params']['id']}})[_0xfa27('0x24')](handleEntityNotFound(_0x5930b4,null))['then'](function(_0x2fd377){if(_0x2fd377){_0x4b9b86=_0x2fd377;_0x4860e6[_0xfa27('0x2f')]=_['keys'](db[_0xfa27('0x4c')]['rawAttributes']);_0x4860e6['query']=_[_0xfa27('0x31')](_0x10a615[_0xfa27('0x30')]);_0x4860e6[_0xfa27('0x32')]=_[_0xfa27('0x33')](_0x4860e6[_0xfa27('0x2f')],_0x4860e6['query']);_0x315c63['attributes']=_[_0xfa27('0x33')](_0x4860e6[_0xfa27('0x2f')],qs['fields'](_0x10a615[_0xfa27('0x30')]['fields']));_0x315c63[_0xfa27('0x34')]=_0x315c63[_0xfa27('0x34')][_0xfa27('0x36')]?_0x315c63[_0xfa27('0x34')]:_0x4860e6[_0xfa27('0x2f')];_0x315c63['order']=qs['sort'](_0x10a615[_0xfa27('0x30')]['sort']);_0x315c63['where']=qs[_0xfa27('0x32')](_[_0xfa27('0x3c')](_0x10a615[_0xfa27('0x30')],_0x4860e6['filters']));if(_0x10a615[_0xfa27('0x30')][_0xfa27('0x3f')]){_0x315c63[_0xfa27('0x3b')]=_[_0xfa27('0x3d')](_0x315c63[_0xfa27('0x3b')],{'$or':_[_0xfa27('0x2b')](_0x315c63[_0xfa27('0x34')],function(_0x3f9687){var _0x451997={};_0x451997[_0x3f9687]={'$like':'%'+_0x10a615[_0xfa27('0x30')][_0xfa27('0x3f')]+'%'};return _0x451997;})});}_0x315c63=_['merge']({},_0x315c63,_0x10a615[_0xfa27('0x40')]);return _0x4b9b86['getConfigurations'](_0x315c63);}})[_0xfa27('0x24')](function(_0xa6b401){if(_0xa6b401){_0x1ce8ec=_0xa6b401[_0xfa27('0x36')];if(!_0x10a615[_0xfa27('0x30')][_0xfa27('0x37')](_0xfa27('0x38'))){_0x315c63[_0xfa27('0x1d')]=qs[_0xfa27('0x1d')](_0x10a615[_0xfa27('0x30')][_0xfa27('0x1d')]);_0x315c63['offset']=qs['offset'](_0x10a615['query'][_0xfa27('0x1b')]);}return _0x4b9b86[_0xfa27('0x4d')](_0x315c63);}})[_0xfa27('0x24')](function(_0x561cb3){if(_0x561cb3){return _0x561cb3?{'count':_0x1ce8ec,'rows':_0x561cb3}:null;}})['then'](respondWithResult(_0x5930b4,null))['catch'](handleError(_0x5930b4,null));};exports[_0xfa27('0x4e')]=function(_0x53b2b1,_0x4a4051,_0x4548bf){if(_0x53b2b1[_0xfa27('0x4b')]['id']){delete _0x53b2b1['body']['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x53b2b1[_0xfa27('0x48')]['id']}})['then'](handleEntityNotFound(_0x4a4051,null))['then'](function(_0x283770){if(_0x283770){_0x53b2b1[_0xfa27('0x4b')][_0xfa27('0x4f')]=_0x283770['id'];_0x53b2b1[_0xfa27('0x4b')][_0xfa27('0x50')]=integrations[_0xfa27('0x51')](_0x53b2b1[_0xfa27('0x4b')][_0xfa27('0x52')],_0x53b2b1[_0xfa27('0x4b')][_0xfa27('0x2d')]);_0x53b2b1[_0xfa27('0x4b')][_0xfa27('0x53')]=integrations['getDescriptions'](_0x53b2b1[_0xfa27('0x4b')][_0xfa27('0x52')],_0x53b2b1[_0xfa27('0x4b')]['type']);return db['DeskConfiguration'][_0xfa27('0x4a')](_0x53b2b1[_0xfa27('0x4b')],{'include':[{'model':db[_0xfa27('0x54')],'as':_0xfa27('0x50')},{'model':db['DeskField'],'as':_0xfa27('0x53')}]});}return null;})[_0xfa27('0x24')](respondWithResult(_0x4a4051,null))[_0xfa27('0x46')](handleError(_0x4a4051,null));};exports[_0xfa27('0x55')]=function(_0x33a545,_0x56aca1,_0xe81755){var _0x16313b=[{'name':_0xfa27('0x56'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0xa58f98='';return db['DeskAccount'][_0xfa27('0x57')]({'where':{'id':_0x33a545['params']['id']},'attributes':['id',_0xfa27('0x58'),_0xfa27('0x59'),_0xfa27('0x5a'),_0xfa27('0x5b'),_0xfa27('0x5c'),_0xfa27('0x5d'),_0xfa27('0x5e'),_0xfa27('0x5f')]})[_0xfa27('0x24')](handleEntityNotFound(_0x56aca1,null))[_0xfa27('0x24')](function(_0x1c789a){if(_0x1c789a){_0xa58f98=_0x1c789a[_0xfa27('0x58')];var _0x23279d=_0xa58f98['slice'](-0x1);if(_0x23279d==='/'){_0xa58f98=_0xa58f98[_0xfa27('0x60')](0x0,_0xa58f98[_0xfa27('0x61')](_0x23279d));}var _0x4a55dd={'method':_0xfa27('0x62'),'uri':util[_0xfa27('0x63')]('%s/custom_fields',_0xa58f98),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x1c789a[_0xfa27('0x59')]==='basic'){_0x4a55dd['headers']['Authorization']=util[_0xfa27('0x63')](_0xfa27('0x64'),new Buffer(util[_0xfa27('0x63')](_0xfa27('0x65'),_0x1c789a[_0xfa27('0x5a')],_0x1c789a[_0xfa27('0x5b')]))[_0xfa27('0x66')](_0xfa27('0x67')));}return rp(_0x4a55dd)[_0xfa27('0x24')](function(_0x1819c5){return _0x16313b[_0xfa27('0x68')](_['map'](_0x1819c5[_0xfa27('0x69')][_0xfa27('0x6a')],function(_0xcad3c9){return{'id':_0xcad3c9[_0xfa27('0x28')],'name':_0xcad3c9[_0xfa27('0x28')],'type':_0xcad3c9[_0xfa27('0x2d')],'active':_0xcad3c9[_0xfa27('0x6b')],'label':_0xcad3c9['label'],'custom':!![]};}));});}})[_0xfa27('0x24')](function(_0x201fba){return{'count':_0x201fba[_0xfa27('0x36')],'rows':_0x201fba};})['then'](respondWithResult(_0x56aca1,null))['catch'](function(_0x5c1676){var _0x589ca8=_0x33a545[_0xfa27('0x30')]['test']?0x1f4:_0x5c1676['statusCode']||0x1f4;logger[_0xfa27('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0xfa27('0x55'),_0x589ca8,JSON[_0xfa27('0x6c')](_0x5c1676));delete _0x5c1676[_0xfa27('0x28')];if(_0x589ca8===0x191){_0x589ca8=0x190;}_0x56aca1['status'](_0x589ca8)[_0xfa27('0x29')](_0x33a545['query'][_0xfa27('0x6d')]?{'message':_0xfa27('0x6e'),'statusCode':_0x5c1676[_0xfa27('0x6f')]}:_0x5c1676);});}; \ No newline at end of file +var _0x4986=['to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','Content-Range','reject','update','then','error','stack','name','send','index','DeskAccount','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','destroy','getConfigurations','findOne','DeskConfiguration','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','DeskField','Subjects','getFields','priority','remoteUri','username','password','consumerSecret','token','tokenSecret','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','authType','basic','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','active','label','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','path','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x4986,0x146));var _0x6498=function(_0x148c77,_0x300d8f){_0x148c77=_0x148c77-0x0;var _0x2141a1=_0x4986[_0x148c77];return _0x2141a1;};'use strict';var emlformat=require(_0x6498('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6498('0x1'));var jsonpatch=require(_0x6498('0x2'));var rp=require(_0x6498('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6498('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6498('0x5'));var _=require(_0x6498('0x6'));var squel=require(_0x6498('0x7'));var crypto=require('crypto');var jsforce=require(_0x6498('0x8'));var deskjs=require(_0x6498('0x9'));var toCsv=require(_0x6498('0xa'));var querystring=require(_0x6498('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6498('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x6498('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6498('0xe'))(_0x6498('0xf'));var utils=require(_0x6498('0x10'));var config=require(_0x6498('0x11'));var licenseUtil=require(_0x6498('0x12'));var db=require(_0x6498('0x13'))['db'];var integrations=require(_0x6498('0x14'));function respondWithStatusCode(_0xb1011d,_0x479c10){_0x479c10=_0x479c10||0xcc;return function(_0x568843){if(_0x568843){return _0xb1011d[_0x6498('0x15')](_0x479c10);}return _0xb1011d[_0x6498('0x16')](_0x479c10)[_0x6498('0x17')]();};}function respondWithResult(_0x1208e4,_0x47c1ea){_0x47c1ea=_0x47c1ea||0xc8;return function(_0x4943d3){if(_0x4943d3){return _0x1208e4[_0x6498('0x16')](_0x47c1ea)[_0x6498('0x18')](_0x4943d3);}};}function respondWithFilteredResult(_0x2c4318,_0x18e311){return function(_0xe587cd){if(_0xe587cd){var _0x4f30b=typeof _0x18e311['offset']===_0x6498('0x19')&&typeof _0x18e311[_0x6498('0x1a')]===_0x6498('0x19');var _0x27a141=_0xe587cd['count'];var _0x486c4e=_0x4f30b?0x0:_0x18e311['offset'];var _0x129a33=_0x4f30b?_0xe587cd[_0x6498('0x1b')]:_0x18e311['offset']+_0x18e311[_0x6498('0x1a')];var _0x197a8f;if(_0x129a33>=_0x27a141){_0x129a33=_0x27a141;_0x197a8f=0xc8;}else{_0x197a8f=0xce;}_0x2c4318[_0x6498('0x16')](_0x197a8f);return _0x2c4318['set'](_0x6498('0x1c'),_0x486c4e+'-'+_0x129a33+'/'+_0x27a141)[_0x6498('0x18')](_0xe587cd);}return null;};}function patchUpdates(_0x1d2a37){return function(_0x2e2443){try{jsonpatch['apply'](_0x2e2443,_0x1d2a37,!![]);}catch(_0x15def2){return BPromise[_0x6498('0x1d')](_0x15def2);}return _0x2e2443['save']();};}function saveUpdates(_0x340633,_0x5998b3){return function(_0x5dc5f9){if(_0x5dc5f9){return _0x5dc5f9[_0x6498('0x1e')](_0x340633)[_0x6498('0x1f')](function(_0x37e46c){return _0x37e46c;});}return null;};}function removeEntity(_0x174857,_0x299352){return function(_0x362b44){if(_0x362b44){return _0x362b44['destroy']()[_0x6498('0x1f')](function(){_0x174857['status'](0xcc)[_0x6498('0x17')]();});}};}function handleEntityNotFound(_0x1ae3eb,_0x6846d2){return function(_0x487032){if(!_0x487032){_0x1ae3eb['sendStatus'](0x194);}return _0x487032;};}function handleError(_0x33092b,_0x45dc0d){_0x45dc0d=_0x45dc0d||0x1f4;return function(_0x54c9b9){logger[_0x6498('0x20')](_0x54c9b9[_0x6498('0x21')]);if(_0x54c9b9['name']){delete _0x54c9b9[_0x6498('0x22')];}_0x33092b['status'](_0x45dc0d)[_0x6498('0x23')](_0x54c9b9);};}exports[_0x6498('0x24')]=function(_0x417bec,_0x32ae11){var _0x35fd93={},_0x565fe3={},_0x54faa7={'count':0x0,'rows':[]};var _0xc52129=_['map'](db[_0x6498('0x25')]['rawAttributes'],function(_0x5e9352){return{'name':_0x5e9352[_0x6498('0x26')],'type':_0x5e9352['type'][_0x6498('0x27')]};});_0x565fe3[_0x6498('0x28')]=_[_0x6498('0x29')](_0xc52129,_0x6498('0x22'));_0x565fe3[_0x6498('0x2a')]=_['keys'](_0x417bec['query']);_0x565fe3['filters']=_[_0x6498('0x2b')](_0x565fe3[_0x6498('0x28')],_0x565fe3['query']);_0x35fd93[_0x6498('0x2c')]=_[_0x6498('0x2b')](_0x565fe3['model'],qs[_0x6498('0x2d')](_0x417bec[_0x6498('0x2a')][_0x6498('0x2d')]));_0x35fd93[_0x6498('0x2c')]=_0x35fd93[_0x6498('0x2c')][_0x6498('0x2e')]?_0x35fd93[_0x6498('0x2c')]:_0x565fe3[_0x6498('0x28')];if(!_0x417bec[_0x6498('0x2a')][_0x6498('0x2f')]('nolimit')){_0x35fd93[_0x6498('0x1a')]=qs['limit'](_0x417bec['query'][_0x6498('0x1a')]);_0x35fd93[_0x6498('0x30')]=qs['offset'](_0x417bec[_0x6498('0x2a')]['offset']);}_0x35fd93[_0x6498('0x31')]=qs[_0x6498('0x32')](_0x417bec[_0x6498('0x2a')][_0x6498('0x32')]);_0x35fd93[_0x6498('0x33')]=qs[_0x6498('0x34')](_[_0x6498('0x35')](_0x417bec[_0x6498('0x2a')],_0x565fe3[_0x6498('0x34')]),_0xc52129);if(_0x417bec[_0x6498('0x2a')][_0x6498('0x36')]){_0x35fd93[_0x6498('0x33')]=_[_0x6498('0x37')](_0x35fd93[_0x6498('0x33')],{'$or':_['map'](_0xc52129,function(_0x5640f5){if(_0x5640f5[_0x6498('0x38')]!==_0x6498('0x39')){var _0x583b69={};_0x583b69[_0x5640f5['name']]={'$like':'%'+_0x417bec['query']['filter']+'%'};return _0x583b69;}})});}_0x35fd93=_[_0x6498('0x37')]({},_0x35fd93,_0x417bec[_0x6498('0x3a')]);var _0x2c6638={'where':_0x35fd93[_0x6498('0x33')]};return db[_0x6498('0x25')]['count'](_0x2c6638)[_0x6498('0x1f')](function(_0x209c56){_0x54faa7[_0x6498('0x1b')]=_0x209c56;if(_0x417bec[_0x6498('0x2a')]['includeAll']){_0x35fd93[_0x6498('0x3b')]=[{'all':!![]}];}return db[_0x6498('0x25')][_0x6498('0x3c')](_0x35fd93);})[_0x6498('0x1f')](function(_0x2cba51){_0x54faa7[_0x6498('0x3d')]=_0x2cba51;return _0x54faa7;})[_0x6498('0x1f')](respondWithFilteredResult(_0x32ae11,_0x35fd93))[_0x6498('0x3e')](handleError(_0x32ae11,null));};exports[_0x6498('0x3f')]=function(_0x3319d5,_0x3fa5fd){var _0x2ec3b5={'raw':![],'where':{'id':_0x3319d5[_0x6498('0x40')]['id']}},_0x4dddab={};_0x4dddab[_0x6498('0x28')]=_[_0x6498('0x41')](db[_0x6498('0x25')][_0x6498('0x42')]);_0x4dddab[_0x6498('0x2a')]=_[_0x6498('0x41')](_0x3319d5['query']);_0x4dddab['filters']=_[_0x6498('0x2b')](_0x4dddab[_0x6498('0x28')],_0x4dddab['query']);_0x2ec3b5[_0x6498('0x2c')]=_['intersection'](_0x4dddab[_0x6498('0x28')],qs[_0x6498('0x2d')](_0x3319d5[_0x6498('0x2a')][_0x6498('0x2d')]));_0x2ec3b5[_0x6498('0x2c')]=_0x2ec3b5['attributes'][_0x6498('0x2e')]?_0x2ec3b5[_0x6498('0x2c')]:_0x4dddab[_0x6498('0x28')];if(_0x3319d5['query']['includeAll']){_0x2ec3b5[_0x6498('0x3b')]=[{'all':!![]}];}_0x2ec3b5=_['merge']({},_0x2ec3b5,_0x3319d5['options']);return db[_0x6498('0x25')][_0x6498('0x43')](_0x2ec3b5)[_0x6498('0x1f')](handleEntityNotFound(_0x3fa5fd,null))[_0x6498('0x1f')](respondWithResult(_0x3fa5fd,null))[_0x6498('0x3e')](handleError(_0x3fa5fd,null));};exports[_0x6498('0x44')]=function(_0x55389f,_0x1b1d13){return db[_0x6498('0x25')][_0x6498('0x44')](_0x55389f[_0x6498('0x45')],{})['then'](respondWithResult(_0x1b1d13,0xc9))[_0x6498('0x3e')](handleError(_0x1b1d13,null));};exports[_0x6498('0x1e')]=function(_0xb22ea3,_0x4ae227){if(_0xb22ea3[_0x6498('0x45')]['id']){delete _0xb22ea3[_0x6498('0x45')]['id'];}return db[_0x6498('0x25')][_0x6498('0x43')]({'where':{'id':_0xb22ea3['params']['id']}})[_0x6498('0x1f')](handleEntityNotFound(_0x4ae227,null))[_0x6498('0x1f')](saveUpdates(_0xb22ea3[_0x6498('0x45')],null))[_0x6498('0x1f')](respondWithResult(_0x4ae227,null))[_0x6498('0x3e')](handleError(_0x4ae227,null));};exports[_0x6498('0x46')]=function(_0xbab052,_0x5704d8){return db['DeskAccount']['find']({'where':{'id':_0xbab052['params']['id']}})[_0x6498('0x1f')](handleEntityNotFound(_0x5704d8,null))[_0x6498('0x1f')](removeEntity(_0x5704d8,null))[_0x6498('0x3e')](handleError(_0x5704d8,null));};exports[_0x6498('0x47')]=function(_0x1c2e3b,_0x3a3345,_0x3d2b87){var _0xb0e7f2={};var _0x979144={};var _0x5cb1dc;var _0x24b575;return db[_0x6498('0x25')][_0x6498('0x48')]({'where':{'id':_0x1c2e3b[_0x6498('0x40')]['id']}})[_0x6498('0x1f')](handleEntityNotFound(_0x3a3345,null))[_0x6498('0x1f')](function(_0x4c3a63){if(_0x4c3a63){_0x5cb1dc=_0x4c3a63;_0x979144['model']=_[_0x6498('0x41')](db[_0x6498('0x49')][_0x6498('0x42')]);_0x979144[_0x6498('0x2a')]=_['keys'](_0x1c2e3b[_0x6498('0x2a')]);_0x979144[_0x6498('0x34')]=_[_0x6498('0x2b')](_0x979144[_0x6498('0x28')],_0x979144[_0x6498('0x2a')]);_0xb0e7f2[_0x6498('0x2c')]=_[_0x6498('0x2b')](_0x979144[_0x6498('0x28')],qs['fields'](_0x1c2e3b['query']['fields']));_0xb0e7f2['attributes']=_0xb0e7f2[_0x6498('0x2c')][_0x6498('0x2e')]?_0xb0e7f2[_0x6498('0x2c')]:_0x979144[_0x6498('0x28')];_0xb0e7f2[_0x6498('0x31')]=qs['sort'](_0x1c2e3b[_0x6498('0x2a')][_0x6498('0x32')]);_0xb0e7f2[_0x6498('0x33')]=qs['filters'](_['pick'](_0x1c2e3b[_0x6498('0x2a')],_0x979144[_0x6498('0x34')]));if(_0x1c2e3b['query'][_0x6498('0x36')]){_0xb0e7f2[_0x6498('0x33')]=_[_0x6498('0x37')](_0xb0e7f2['where'],{'$or':_['map'](_0xb0e7f2[_0x6498('0x2c')],function(_0x326874){var _0x2fd935={};_0x2fd935[_0x326874]={'$like':'%'+_0x1c2e3b[_0x6498('0x2a')][_0x6498('0x36')]+'%'};return _0x2fd935;})});}_0xb0e7f2=_[_0x6498('0x37')]({},_0xb0e7f2,_0x1c2e3b[_0x6498('0x3a')]);return _0x5cb1dc['getConfigurations'](_0xb0e7f2);}})[_0x6498('0x1f')](function(_0x1a9243){if(_0x1a9243){_0x24b575=_0x1a9243['length'];if(!_0x1c2e3b[_0x6498('0x2a')][_0x6498('0x2f')](_0x6498('0x4a'))){_0xb0e7f2[_0x6498('0x1a')]=qs[_0x6498('0x1a')](_0x1c2e3b[_0x6498('0x2a')]['limit']);_0xb0e7f2[_0x6498('0x30')]=qs[_0x6498('0x30')](_0x1c2e3b['query'][_0x6498('0x30')]);}return _0x5cb1dc['getConfigurations'](_0xb0e7f2);}})[_0x6498('0x1f')](function(_0x4fa27b){if(_0x4fa27b){return _0x4fa27b?{'count':_0x24b575,'rows':_0x4fa27b}:null;}})[_0x6498('0x1f')](respondWithResult(_0x3a3345,null))[_0x6498('0x3e')](handleError(_0x3a3345,null));};exports[_0x6498('0x4b')]=function(_0xb3dc65,_0x3bf624,_0x3fed63){if(_0xb3dc65[_0x6498('0x45')]['id']){delete _0xb3dc65[_0x6498('0x45')]['id'];}return db[_0x6498('0x25')][_0x6498('0x48')]({'where':{'id':_0xb3dc65[_0x6498('0x40')]['id']}})[_0x6498('0x1f')](handleEntityNotFound(_0x3bf624,null))[_0x6498('0x1f')](function(_0x1dccba){if(_0x1dccba){_0xb3dc65['body'][_0x6498('0x4c')]=_0x1dccba['id'];_0xb3dc65[_0x6498('0x45')]['Subjects']=integrations[_0x6498('0x4d')](_0xb3dc65['body'][_0x6498('0x4e')],_0xb3dc65['body']['type']);_0xb3dc65[_0x6498('0x45')][_0x6498('0x4f')]=integrations['getDescriptions'](_0xb3dc65[_0x6498('0x45')][_0x6498('0x4e')],_0xb3dc65[_0x6498('0x45')][_0x6498('0x38')]);return db[_0x6498('0x49')][_0x6498('0x44')](_0xb3dc65[_0x6498('0x45')],{'include':[{'model':db[_0x6498('0x50')],'as':_0x6498('0x51')},{'model':db[_0x6498('0x50')],'as':_0x6498('0x4f')}]});}return null;})[_0x6498('0x1f')](respondWithResult(_0x3bf624,null))[_0x6498('0x3e')](handleError(_0x3bf624,null));};exports[_0x6498('0x52')]=function(_0x5045ef,_0x547962,_0x207fad){var _0x504357=[{'name':_0x6498('0x53'),'label':_0x6498('0x53'),'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 _0x10d1e7='';return db[_0x6498('0x25')][_0x6498('0x48')]({'where':{'id':_0x5045ef[_0x6498('0x40')]['id']},'attributes':['id',_0x6498('0x54'),'authType',_0x6498('0x55'),_0x6498('0x56'),'consumerKey',_0x6498('0x57'),_0x6498('0x58'),_0x6498('0x59')]})[_0x6498('0x1f')](handleEntityNotFound(_0x547962,null))[_0x6498('0x1f')](function(_0x49c4c3){if(_0x49c4c3){_0x10d1e7=_0x49c4c3[_0x6498('0x54')];var _0x28cf1e=_0x10d1e7['slice'](-0x1);if(_0x28cf1e==='/'){_0x10d1e7=_0x10d1e7[_0x6498('0x5a')](0x0,_0x10d1e7[_0x6498('0x5b')](_0x28cf1e));}var _0x269cc1={'method':_0x6498('0x5c'),'uri':util[_0x6498('0x5d')](_0x6498('0x5e'),_0x10d1e7),'headers':{'Content-Type':_0x6498('0x5f'),'Accept':_0x6498('0x5f')},'json':!![]};if(_0x49c4c3[_0x6498('0x60')]===_0x6498('0x61')){_0x269cc1['headers'][_0x6498('0x62')]=util[_0x6498('0x5d')](_0x6498('0x63'),new Buffer(util[_0x6498('0x5d')](_0x6498('0x64'),_0x49c4c3[_0x6498('0x55')],_0x49c4c3[_0x6498('0x56')]))[_0x6498('0x65')](_0x6498('0x66')));}return rp(_0x269cc1)[_0x6498('0x1f')](function(_0x10b7e9){return _0x504357[_0x6498('0x67')](_['map'](_0x10b7e9[_0x6498('0x68')]['entries'],function(_0x514396){return{'id':_0x514396['name'],'name':_0x514396[_0x6498('0x22')],'type':_0x514396[_0x6498('0x38')],'active':_0x514396[_0x6498('0x69')],'label':_0x514396[_0x6498('0x6a')],'custom':!![]};}));});}})[_0x6498('0x1f')](function(_0x383e5b){return{'count':_0x383e5b[_0x6498('0x2e')],'rows':_0x383e5b};})[_0x6498('0x1f')](respondWithResult(_0x547962,null))[_0x6498('0x3e')](function(_0x97fa93){var _0x2c0903=_0x5045ef['query']['test']?0x1f4:_0x97fa93['statusCode']||0x1f4;logger[_0x6498('0x20')](_0x6498('0x6b'),_0x6498('0x52'),_0x2c0903,JSON[_0x6498('0x6c')](_0x97fa93));delete _0x97fa93[_0x6498('0x22')];if(_0x2c0903===0x191){_0x2c0903=0x190;}_0x547962[_0x6498('0x16')](_0x2c0903)[_0x6498('0x23')](_0x5045ef[_0x6498('0x2a')][_0x6498('0x6d')]?{'message':_0x6498('0x6e'),'statusCode':_0x97fa93[_0x6498('0x6f')]}:_0x97fa93);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 1495c84..fa141fa 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 _0xb59e=['api','moment','bluebird','request-promise','path','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util'];(function(_0x469665,_0x394876){var _0x291ab5=function(_0x55c1c7){while(--_0x55c1c7){_0x469665['push'](_0x469665['shift']());}};_0x291ab5(++_0x394876);}(_0xb59e,0x16a));var _0xeb59=function(_0x181f25,_0x3679a2){_0x181f25=_0x181f25-0x0;var _0x1d51f0=_0xb59e[_0x181f25];return _0x1d51f0;};'use strict';var _=require(_0xeb59('0x0'));var util=require(_0xeb59('0x1'));var logger=require('../../config/logger')(_0xeb59('0x2'));var moment=require(_0xeb59('0x3'));var BPromise=require(_0xeb59('0x4'));var rp=require(_0xeb59('0x5'));var fs=require('fs');var path=require(_0xeb59('0x6'));var rimraf=require('rimraf');var config=require(_0xeb59('0x7'));var attributes=require(_0xeb59('0x8'));var integrations=require(_0xeb59('0x9'));module[_0xeb59('0xa')]=function(_0x29253d,_0x4b921b){return _0x29253d[_0xeb59('0xb')](_0xeb59('0xc'),attributes,{'tableName':_0xeb59('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6365=['lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts'];(function(_0x16772e,_0x2b9360){var _0x15653b=function(_0x329e99){while(--_0x329e99){_0x16772e['push'](_0x16772e['shift']());}};_0x15653b(++_0x2b9360);}(_0x6365,0x9c));var _0x5636=function(_0x169fd4,_0x1879a9){_0x169fd4=_0x169fd4-0x0;var _0x1a4a07=_0x6365[_0x169fd4];return _0x1a4a07;};'use strict';var _=require(_0x5636('0x0'));var util=require(_0x5636('0x1'));var logger=require(_0x5636('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5636('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5636('0x4'));var rimraf=require(_0x5636('0x5'));var config=require(_0x5636('0x6'));var attributes=require(_0x5636('0x7'));var integrations=require(_0x5636('0x8'));module[_0x5636('0x9')]=function(_0x27b195,_0x2282de){return _0x27b195[_0x5636('0xa')](_0x5636('0xb'),attributes,{'tableName':_0x5636('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 115dc06..61258b0 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 _0xcb0b=['request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','include','model','ShowDeskAccount','find','map','debug','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x581868,_0x1a4da5){var _0x4f4a19=function(_0x2be8a4){while(--_0x2be8a4){_0x581868['push'](_0x581868['shift']());}};_0x4f4a19(++_0x1a4da5);}(_0xcb0b,0x199));var _0xbcb0=function(_0x56b31c,_0x5e56ea){_0x56b31c=_0x56b31c-0x0;var _0x2e8826=_0xcb0b[_0x56b31c];return _0x2e8826;};'use strict';var _=require('lodash');var util=require(_0xbcb0('0x0'));var moment=require(_0xbcb0('0x1'));var BPromise=require('bluebird');var rs=require(_0xbcb0('0x2'));var fs=require('fs');var Redis=require(_0xbcb0('0x3'));var db=require(_0xbcb0('0x4'))['db'];var utils=require(_0xbcb0('0x5'));var logger=require(_0xbcb0('0x6'))(_0xbcb0('0x7'));var config=require('../../config/environment');var jayson=require(_0xbcb0('0x8'));var client=jayson[_0xbcb0('0x9')][_0xbcb0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ce7a1,_0x1e638e,_0x4e552a){return new BPromise(function(_0x338076,_0x366c6f){return client[_0xbcb0('0xb')](_0x5ce7a1,_0x4e552a)[_0xbcb0('0xc')](function(_0x287471){logger[_0xbcb0('0xd')](_0xbcb0('0xe'),_0x1e638e,_0xbcb0('0xf'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x1e638e,'request\x20sent',JSON[_0xbcb0('0x10')](_0x287471));if(_0x287471['error']){if(_0x287471['error'][_0xbcb0('0x11')]===0x1f4){logger['error'](_0xbcb0('0xe'),_0x1e638e,_0x287471[_0xbcb0('0x12')]['message']);return _0x366c6f(_0x287471[_0xbcb0('0x12')][_0xbcb0('0x13')]);}logger[_0xbcb0('0x12')](_0xbcb0('0xe'),_0x1e638e,_0x287471[_0xbcb0('0x12')][_0xbcb0('0x13')]);return _0x338076(_0x287471[_0xbcb0('0x12')][_0xbcb0('0x13')]);}else{logger[_0xbcb0('0xd')](_0xbcb0('0xe'),_0x1e638e,_0xbcb0('0xf'));_0x338076(_0x287471[_0xbcb0('0x14')][_0xbcb0('0x13')]);}})[_0xbcb0('0x15')](function(_0x3fd1b7){logger[_0xbcb0('0x12')](_0xbcb0('0xe'),_0x1e638e,_0x3fd1b7);_0x366c6f(_0x3fd1b7);});});}exports[_0xbcb0('0x16')]=function(_0x1624bb){var _0x38c77c=this;return new Promise(function(_0x144e8c,_0xbf1ba7){return db[_0xbcb0('0x17')][_0xbcb0('0x18')]({'raw':_0x1624bb[_0xbcb0('0x19')]?_0x1624bb[_0xbcb0('0x19')][_0xbcb0('0x1a')]===undefined?!![]:![]:!![],'where':_0x1624bb[_0xbcb0('0x19')]?_0x1624bb[_0xbcb0('0x19')][_0xbcb0('0x1b')]||null:null,'attributes':_0x1624bb[_0xbcb0('0x19')]?_0x1624bb[_0xbcb0('0x19')][_0xbcb0('0x1c')]||null:null,'limit':_0x1624bb[_0xbcb0('0x19')]?_0x1624bb[_0xbcb0('0x19')]['limit']||null:null,'include':_0x1624bb[_0xbcb0('0x19')]?_0x1624bb[_0xbcb0('0x19')][_0xbcb0('0x1d')]?_['map'](_0x1624bb[_0xbcb0('0x19')]['include'],function(_0x1783b4){return{'model':db[_0x1783b4[_0xbcb0('0x1e')]],'as':_0x1783b4['as'],'attributes':_0x1783b4[_0xbcb0('0x1c')],'include':_0x1783b4['include']?_['map'](_0x1783b4[_0xbcb0('0x1d')],function(_0x1489dd){return{'model':db[_0x1489dd[_0xbcb0('0x1e')]],'as':_0x1489dd['as'],'attributes':_0x1489dd[_0xbcb0('0x1c')],'include':_0x1489dd['include']?_['map'](_0x1489dd[_0xbcb0('0x1d')],function(_0x46c575){return{'model':db[_0x46c575['model']],'as':_0x46c575['as'],'attributes':_0x46c575[_0xbcb0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbcb0('0xc')](function(_0xeb9651){logger[_0xbcb0('0xd')](_0xbcb0('0x16'),_0x1624bb);logger['debug'](_0xbcb0('0x16'),_0x1624bb,JSON[_0xbcb0('0x10')](_0xeb9651));_0x144e8c(_0xeb9651);})[_0xbcb0('0x15')](function(_0x352e54){logger[_0xbcb0('0x12')](_0xbcb0('0x16'),_0x352e54[_0xbcb0('0x13')],_0x1624bb);_0xbf1ba7(_0x38c77c[_0xbcb0('0x12')](0x1f4,_0x352e54[_0xbcb0('0x13')]));});});};exports[_0xbcb0('0x1f')]=function(_0x210e41){var _0x30a470=this;return new Promise(function(_0x2c4ea5,_0x2f3805){return db[_0xbcb0('0x17')][_0xbcb0('0x20')]({'raw':_0x210e41['options']?_0x210e41['options'][_0xbcb0('0x1a')]===undefined?!![]:![]:!![],'where':_0x210e41['options']?_0x210e41[_0xbcb0('0x19')][_0xbcb0('0x1b')]||null:null,'attributes':_0x210e41[_0xbcb0('0x19')]?_0x210e41[_0xbcb0('0x19')][_0xbcb0('0x1c')]||null:null,'include':_0x210e41['options']?_0x210e41[_0xbcb0('0x19')][_0xbcb0('0x1d')]?_['map'](_0x210e41[_0xbcb0('0x19')][_0xbcb0('0x1d')],function(_0x312eff){return{'model':db[_0x312eff[_0xbcb0('0x1e')]],'as':_0x312eff['as'],'attributes':_0x312eff[_0xbcb0('0x1c')],'include':_0x312eff[_0xbcb0('0x1d')]?_['map'](_0x312eff[_0xbcb0('0x1d')],function(_0xbbd1a2){return{'model':db[_0xbbd1a2[_0xbcb0('0x1e')]],'as':_0xbbd1a2['as'],'attributes':_0xbbd1a2[_0xbcb0('0x1c')],'include':_0xbbd1a2[_0xbcb0('0x1d')]?_[_0xbcb0('0x21')](_0xbbd1a2['include'],function(_0x5edcdc){return{'model':db[_0x5edcdc[_0xbcb0('0x1e')]],'as':_0x5edcdc['as'],'attributes':_0x5edcdc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f18f2){logger[_0xbcb0('0xd')]('ShowDeskAccount',_0x210e41);logger[_0xbcb0('0x22')](_0xbcb0('0x1f'),_0x210e41,JSON['stringify'](_0x4f18f2));_0x2c4ea5(_0x4f18f2);})[_0xbcb0('0x15')](function(_0x1f9e7e){logger['error'](_0xbcb0('0x1f'),_0x1f9e7e['message'],_0x210e41);_0x2f3805(_0x30a470['error'](0x1f4,_0x1f9e7e[_0xbcb0('0x13')]));});});}; \ No newline at end of file +var _0x2289=['limit','include','model','attributes','map','then','ShowDeskAccount','find','raw','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetDeskAccount','DeskAccount','findAll','options','where'];(function(_0x3e3bee,_0x4f91fe){var _0x3ae14c=function(_0x3861a0){while(--_0x3861a0){_0x3e3bee['push'](_0x3e3bee['shift']());}};_0x3ae14c(++_0x4f91fe);}(_0x2289,0x11b));var _0x9228=function(_0x2974e4,_0x2029b0){_0x2974e4=_0x2974e4-0x0;var _0x241980=_0x2289[_0x2974e4];return _0x241980;};'use strict';var _=require('lodash');var util=require(_0x9228('0x0'));var moment=require(_0x9228('0x1'));var BPromise=require(_0x9228('0x2'));var rs=require(_0x9228('0x3'));var fs=require('fs');var Redis=require(_0x9228('0x4'));var db=require(_0x9228('0x5'))['db'];var utils=require(_0x9228('0x6'));var logger=require(_0x9228('0x7'))(_0x9228('0x8'));var config=require(_0x9228('0x9'));var jayson=require(_0x9228('0xa'));var client=jayson[_0x9228('0xb')][_0x9228('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f8a63,_0x377e4b,_0x28c251){return new BPromise(function(_0x403fd9,_0x464ec5){return client[_0x9228('0xd')](_0x2f8a63,_0x28c251)['then'](function(_0x3467a2){logger['info'](_0x9228('0xe'),_0x377e4b,_0x9228('0xf'));logger['debug'](_0x9228('0x10'),_0x377e4b,_0x9228('0xf'),JSON[_0x9228('0x11')](_0x3467a2));if(_0x3467a2[_0x9228('0x12')]){if(_0x3467a2[_0x9228('0x12')][_0x9228('0x13')]===0x1f4){logger[_0x9228('0x12')](_0x9228('0xe'),_0x377e4b,_0x3467a2[_0x9228('0x12')]['message']);return _0x464ec5(_0x3467a2['error'][_0x9228('0x14')]);}logger[_0x9228('0x12')]('DeskAccount,\x20%s,\x20%s',_0x377e4b,_0x3467a2[_0x9228('0x12')][_0x9228('0x14')]);return _0x403fd9(_0x3467a2['error'][_0x9228('0x14')]);}else{logger[_0x9228('0x15')]('DeskAccount,\x20%s,\x20%s',_0x377e4b,_0x9228('0xf'));_0x403fd9(_0x3467a2[_0x9228('0x16')][_0x9228('0x14')]);}})[_0x9228('0x17')](function(_0x48efca){logger[_0x9228('0x12')](_0x9228('0xe'),_0x377e4b,_0x48efca);_0x464ec5(_0x48efca);});});}exports[_0x9228('0x18')]=function(_0x4d6fc8){var _0x5c9e4f=this;return new Promise(function(_0x2016b7,_0x438045){return db[_0x9228('0x19')][_0x9228('0x1a')]({'raw':_0x4d6fc8[_0x9228('0x1b')]?_0x4d6fc8[_0x9228('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4d6fc8[_0x9228('0x1b')]?_0x4d6fc8['options'][_0x9228('0x1c')]||null:null,'attributes':_0x4d6fc8[_0x9228('0x1b')]?_0x4d6fc8[_0x9228('0x1b')]['attributes']||null:null,'limit':_0x4d6fc8[_0x9228('0x1b')]?_0x4d6fc8['options'][_0x9228('0x1d')]||null:null,'include':_0x4d6fc8[_0x9228('0x1b')]?_0x4d6fc8[_0x9228('0x1b')][_0x9228('0x1e')]?_['map'](_0x4d6fc8['options'][_0x9228('0x1e')],function(_0x4e4f85){return{'model':db[_0x4e4f85[_0x9228('0x1f')]],'as':_0x4e4f85['as'],'attributes':_0x4e4f85[_0x9228('0x20')],'include':_0x4e4f85[_0x9228('0x1e')]?_[_0x9228('0x21')](_0x4e4f85[_0x9228('0x1e')],function(_0x38ba37){return{'model':db[_0x38ba37[_0x9228('0x1f')]],'as':_0x38ba37['as'],'attributes':_0x38ba37['attributes'],'include':_0x38ba37[_0x9228('0x1e')]?_[_0x9228('0x21')](_0x38ba37[_0x9228('0x1e')],function(_0x19e362){return{'model':db[_0x19e362[_0x9228('0x1f')]],'as':_0x19e362['as'],'attributes':_0x19e362[_0x9228('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9228('0x22')](function(_0x3e998c){logger[_0x9228('0x15')](_0x9228('0x18'),_0x4d6fc8);logger['debug'](_0x9228('0x18'),_0x4d6fc8,JSON[_0x9228('0x11')](_0x3e998c));_0x2016b7(_0x3e998c);})['catch'](function(_0x630336){logger[_0x9228('0x12')](_0x9228('0x18'),_0x630336[_0x9228('0x14')],_0x4d6fc8);_0x438045(_0x5c9e4f[_0x9228('0x12')](0x1f4,_0x630336[_0x9228('0x14')]));});});};exports[_0x9228('0x23')]=function(_0x28bc87){var _0xe64e19=this;return new Promise(function(_0x388758,_0x375a04){return db[_0x9228('0x19')][_0x9228('0x24')]({'raw':_0x28bc87[_0x9228('0x1b')]?_0x28bc87['options'][_0x9228('0x25')]===undefined?!![]:![]:!![],'where':_0x28bc87[_0x9228('0x1b')]?_0x28bc87[_0x9228('0x1b')][_0x9228('0x1c')]||null:null,'attributes':_0x28bc87['options']?_0x28bc87[_0x9228('0x1b')][_0x9228('0x20')]||null:null,'include':_0x28bc87[_0x9228('0x1b')]?_0x28bc87[_0x9228('0x1b')][_0x9228('0x1e')]?_['map'](_0x28bc87[_0x9228('0x1b')][_0x9228('0x1e')],function(_0x8e7b38){return{'model':db[_0x8e7b38[_0x9228('0x1f')]],'as':_0x8e7b38['as'],'attributes':_0x8e7b38[_0x9228('0x20')],'include':_0x8e7b38[_0x9228('0x1e')]?_[_0x9228('0x21')](_0x8e7b38[_0x9228('0x1e')],function(_0x50c45c){return{'model':db[_0x50c45c[_0x9228('0x1f')]],'as':_0x50c45c['as'],'attributes':_0x50c45c[_0x9228('0x20')],'include':_0x50c45c['include']?_[_0x9228('0x21')](_0x50c45c[_0x9228('0x1e')],function(_0xd82fb2){return{'model':db[_0xd82fb2[_0x9228('0x1f')]],'as':_0xd82fb2['as'],'attributes':_0xd82fb2[_0x9228('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12f149){logger[_0x9228('0x15')](_0x9228('0x23'),_0x28bc87);logger[_0x9228('0x26')]('ShowDeskAccount',_0x28bc87,JSON[_0x9228('0x11')](_0x12f149));_0x388758(_0x12f149);})[_0x9228('0x17')](function(_0x309569){logger[_0x9228('0x12')](_0x9228('0x23'),_0x309569[_0x9228('0x14')],_0x28bc87);_0x375a04(_0xe64e19[_0x9228('0x12')](0x1f4,_0x309569[_0x9228('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 6514d56..a04a40d 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 _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x459b5e,_0x1aea05){var _0x4b994c=function(_0x4be9eb){while(--_0x4be9eb){_0x459b5e['push'](_0x459b5e['shift']());}};_0x4b994c(++_0x1aea05);}(_0xedd9,0xfc));var _0x9edd=function(_0x46e23f,_0xda33d6){_0x46e23f=_0x46e23f-0x0;var _0x34e1ab=_0xedd9[_0x46e23f];return _0x34e1ab;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file +var _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x5e257b,_0x523b5d){var _0x52fb44=function(_0x3b2a64){while(--_0x3b2a64){_0x5e257b['push'](_0x5e257b['shift']());}};_0x52fb44(++_0x523b5d);}(_0x9c44,0x178));var _0x49c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c44[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 5e1a109..02475fb 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 _0x99b1=['sequelize','exports','STRING'];(function(_0x53a8ab,_0x4714f8){var _0x41ea53=function(_0x3f0719){while(--_0x3f0719){_0x53a8ab['push'](_0x53a8ab['shift']());}};_0x41ea53(++_0x4714f8);}(_0x99b1,0x8d));var _0x199b=function(_0x555203,_0x2f701f){_0x555203=_0x555203-0x0;var _0x3dfb4c=_0x99b1[_0x555203];return _0x3dfb4c;};'use strict';var Sequelize=require(_0x199b('0x0'));module[_0x199b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x199b('0x2')]}}; \ No newline at end of file +var _0x3ee7=['STRING','sequelize'];(function(_0x417f5e,_0x451ee2){var _0x5e017c=function(_0x1facf2){while(--_0x1facf2){_0x417f5e['push'](_0x417f5e['shift']());}};_0x5e017c(++_0x451ee2);}(_0x3ee7,0x10b));var _0x73ee=function(_0x4c8812,_0xa9d102){_0x4c8812=_0x4c8812-0x0;var _0x42d129=_0x3ee7[_0x4c8812];return _0x42d129;};'use strict';var Sequelize=require(_0x73ee('0x0'));module['exports']={'name':{'type':Sequelize[_0x73ee('0x1')]},'description':{'type':Sequelize[_0x73ee('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 3ef25f6..014be01 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 _0xbeda=['filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','options','includeAll','include','DeskConfiguration','findAll','show','find','catch','create','body','params','findOne','DeskField','filter','getFields','nolimit','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','send','map','rawAttributes','fieldName','type','key','model','name','query','keys'];(function(_0xcbe787,_0x401e4c){var _0x4c78fa=function(_0x392922){while(--_0x392922){_0xcbe787['push'](_0xcbe787['shift']());}};_0x4c78fa(++_0x401e4c);}(_0xbeda,0x71));var _0xabed=function(_0x39e164,_0x2cb93b){_0x39e164=_0x39e164-0x0;var _0x13fa6b=_0xbeda[_0x39e164];return _0x13fa6b;};'use strict';var emlformat=require(_0xabed('0x0'));var rimraf=require(_0xabed('0x1'));var zipdir=require(_0xabed('0x2'));var jsonpatch=require(_0xabed('0x3'));var rp=require(_0xabed('0x4'));var moment=require(_0xabed('0x5'));var BPromise=require(_0xabed('0x6'));var Mustache=require(_0xabed('0x7'));var util=require(_0xabed('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xabed('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xabed('0xa'));var _=require(_0xabed('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xabed('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xabed('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xabed('0xe'));var as=require(_0xabed('0xf'));var hardwareService=require(_0xabed('0x10'));var logger=require(_0xabed('0x11'))('api');var utils=require(_0xabed('0x12'));var config=require(_0xabed('0x13'));var licenseUtil=require(_0xabed('0x14'));var db=require(_0xabed('0x15'))['db'];function respondWithStatusCode(_0x1f562f,_0x3957d5){_0x3957d5=_0x3957d5||0xcc;return function(_0x35f16c){if(_0x35f16c){return _0x1f562f[_0xabed('0x16')](_0x3957d5);}return _0x1f562f[_0xabed('0x17')](_0x3957d5)[_0xabed('0x18')]();};}function respondWithResult(_0x15ada2,_0x4b703d){_0x4b703d=_0x4b703d||0xc8;return function(_0x34cbe3){if(_0x34cbe3){return _0x15ada2[_0xabed('0x17')](_0x4b703d)[_0xabed('0x19')](_0x34cbe3);}};}function respondWithFilteredResult(_0x1de87e,_0x3c2835){return function(_0x420b58){if(_0x420b58){var _0xb96ea4=typeof _0x3c2835['offset']===_0xabed('0x1a')&&typeof _0x3c2835[_0xabed('0x1b')]===_0xabed('0x1a');var _0x1983be=_0x420b58[_0xabed('0x1c')];var _0x57115c=_0xb96ea4?0x0:_0x3c2835[_0xabed('0x1d')];var _0x840377=_0xb96ea4?_0x420b58['count']:_0x3c2835[_0xabed('0x1d')]+_0x3c2835[_0xabed('0x1b')];var _0xbc4bf4;if(_0x840377>=_0x1983be){_0x840377=_0x1983be;_0xbc4bf4=0xc8;}else{_0xbc4bf4=0xce;}_0x1de87e[_0xabed('0x17')](_0xbc4bf4);return _0x1de87e[_0xabed('0x1e')]('Content-Range',_0x57115c+'-'+_0x840377+'/'+_0x1983be)['json'](_0x420b58);}return null;};}function patchUpdates(_0x5ee1f5){return function(_0x5ba942){try{jsonpatch[_0xabed('0x1f')](_0x5ba942,_0x5ee1f5,!![]);}catch(_0x462c5e){return BPromise[_0xabed('0x20')](_0x462c5e);}return _0x5ba942[_0xabed('0x21')]();};}function saveUpdates(_0x4117e1,_0xb9bb1e){return function(_0x3c42b8){if(_0x3c42b8){return _0x3c42b8[_0xabed('0x22')](_0x4117e1)[_0xabed('0x23')](function(_0xe8c4bd){return _0xe8c4bd;});}return null;};}function removeEntity(_0x164337,_0x2e4878){return function(_0x4f217b){if(_0x4f217b){return _0x4f217b[_0xabed('0x24')]()['then'](function(){_0x164337['status'](0xcc)[_0xabed('0x18')]();});}};}function handleEntityNotFound(_0x4181de,_0x1265d3){return function(_0xb0a9f1){if(!_0xb0a9f1){_0x4181de['sendStatus'](0x194);}return _0xb0a9f1;};}function handleError(_0x36e0e1,_0x599f27){_0x599f27=_0x599f27||0x1f4;return function(_0x2db161){logger[_0xabed('0x25')](_0x2db161[_0xabed('0x26')]);if(_0x2db161['name']){delete _0x2db161['name'];}_0x36e0e1[_0xabed('0x17')](_0x599f27)[_0xabed('0x27')](_0x2db161);};}exports['index']=function(_0x4091e1,_0x758f4a){var _0x209b84={},_0xa0ba06={},_0x3049d5={'count':0x0,'rows':[]};var _0x2d4d8b=_[_0xabed('0x28')](db['DeskConfiguration'][_0xabed('0x29')],function(_0x1a09b5){return{'name':_0x1a09b5[_0xabed('0x2a')],'type':_0x1a09b5[_0xabed('0x2b')][_0xabed('0x2c')]};});_0xa0ba06[_0xabed('0x2d')]=_['map'](_0x2d4d8b,_0xabed('0x2e'));_0xa0ba06[_0xabed('0x2f')]=_[_0xabed('0x30')](_0x4091e1[_0xabed('0x2f')]);_0xa0ba06[_0xabed('0x31')]=_[_0xabed('0x32')](_0xa0ba06[_0xabed('0x2d')],_0xa0ba06[_0xabed('0x2f')]);_0x209b84['attributes']=_['intersection'](_0xa0ba06[_0xabed('0x2d')],qs[_0xabed('0x33')](_0x4091e1['query'][_0xabed('0x33')]));_0x209b84['attributes']=_0x209b84[_0xabed('0x34')][_0xabed('0x35')]?_0x209b84[_0xabed('0x34')]:_0xa0ba06[_0xabed('0x2d')];if(!_0x4091e1[_0xabed('0x2f')][_0xabed('0x36')]('nolimit')){_0x209b84[_0xabed('0x1b')]=qs[_0xabed('0x1b')](_0x4091e1[_0xabed('0x2f')][_0xabed('0x1b')]);_0x209b84[_0xabed('0x1d')]=qs['offset'](_0x4091e1[_0xabed('0x2f')][_0xabed('0x1d')]);}_0x209b84[_0xabed('0x37')]=qs['sort'](_0x4091e1[_0xabed('0x2f')][_0xabed('0x38')]);_0x209b84['where']=qs[_0xabed('0x31')](_[_0xabed('0x39')](_0x4091e1[_0xabed('0x2f')],_0xa0ba06[_0xabed('0x31')]),_0x2d4d8b);if(_0x4091e1[_0xabed('0x2f')]['filter']){_0x209b84[_0xabed('0x3a')]=_['merge'](_0x209b84[_0xabed('0x3a')],{'$or':_[_0xabed('0x28')](_0x2d4d8b,function(_0x43622b){if(_0x43622b['type']!=='VIRTUAL'){var _0x32ea89={};_0x32ea89[_0x43622b[_0xabed('0x2e')]]={'$like':'%'+_0x4091e1[_0xabed('0x2f')]['filter']+'%'};return _0x32ea89;}})});}_0x209b84=_[_0xabed('0x3b')]({},_0x209b84,_0x4091e1[_0xabed('0x3c')]);var _0x44569c={'where':_0x209b84[_0xabed('0x3a')]};return db['DeskConfiguration'][_0xabed('0x1c')](_0x44569c)[_0xabed('0x23')](function(_0x1089f9){_0x3049d5['count']=_0x1089f9;if(_0x4091e1[_0xabed('0x2f')][_0xabed('0x3d')]){_0x209b84[_0xabed('0x3e')]=[{'all':!![]}];}return db[_0xabed('0x3f')][_0xabed('0x40')](_0x209b84);})[_0xabed('0x23')](function(_0x1e7fc3){_0x3049d5['rows']=_0x1e7fc3;return _0x3049d5;})['then'](respondWithFilteredResult(_0x758f4a,_0x209b84))['catch'](handleError(_0x758f4a,null));};exports[_0xabed('0x41')]=function(_0x5da697,_0x2c6cba){var _0x4d3b6e={'raw':![],'where':{'id':_0x5da697['params']['id']}},_0x49d7e3={};_0x49d7e3['model']=_[_0xabed('0x30')](db['DeskConfiguration'][_0xabed('0x29')]);_0x49d7e3[_0xabed('0x2f')]=_[_0xabed('0x30')](_0x5da697['query']);_0x49d7e3[_0xabed('0x31')]=_[_0xabed('0x32')](_0x49d7e3[_0xabed('0x2d')],_0x49d7e3[_0xabed('0x2f')]);_0x4d3b6e[_0xabed('0x34')]=_[_0xabed('0x32')](_0x49d7e3[_0xabed('0x2d')],qs[_0xabed('0x33')](_0x5da697['query'][_0xabed('0x33')]));_0x4d3b6e['attributes']=_0x4d3b6e['attributes'][_0xabed('0x35')]?_0x4d3b6e[_0xabed('0x34')]:_0x49d7e3[_0xabed('0x2d')];if(_0x5da697[_0xabed('0x2f')][_0xabed('0x3d')]){_0x4d3b6e[_0xabed('0x3e')]=[{'all':!![]}];}_0x4d3b6e=_[_0xabed('0x3b')]({},_0x4d3b6e,_0x5da697[_0xabed('0x3c')]);return db['DeskConfiguration'][_0xabed('0x42')](_0x4d3b6e)['then'](handleEntityNotFound(_0x2c6cba,null))['then'](respondWithResult(_0x2c6cba,null))[_0xabed('0x43')](handleError(_0x2c6cba,null));};exports['create']=function(_0x4bceaa,_0x32ab26){return db[_0xabed('0x3f')][_0xabed('0x44')](_0x4bceaa[_0xabed('0x45')],{})[_0xabed('0x23')](respondWithResult(_0x32ab26,0xc9))[_0xabed('0x43')](handleError(_0x32ab26,null));};exports['update']=function(_0x5f3e06,_0x2cb754){if(_0x5f3e06[_0xabed('0x45')]['id']){delete _0x5f3e06[_0xabed('0x45')]['id'];}return db[_0xabed('0x3f')][_0xabed('0x42')]({'where':{'id':_0x5f3e06[_0xabed('0x46')]['id']}})['then'](handleEntityNotFound(_0x2cb754,null))[_0xabed('0x23')](saveUpdates(_0x5f3e06[_0xabed('0x45')],null))[_0xabed('0x23')](respondWithResult(_0x2cb754,null))['catch'](handleError(_0x2cb754,null));};exports[_0xabed('0x24')]=function(_0xce6bb2,_0x7dcdaf){return db[_0xabed('0x3f')][_0xabed('0x42')]({'where':{'id':_0xce6bb2[_0xabed('0x46')]['id']}})['then'](handleEntityNotFound(_0x7dcdaf,null))[_0xabed('0x23')](removeEntity(_0x7dcdaf,null))['catch'](handleError(_0x7dcdaf,null));};exports['getFields']=function(_0x2614fa,_0x3ef9b4,_0x432cb5){var _0x3325ca={};var _0x1dc330={};var _0x46bdd5;var _0x180489;return db['DeskConfiguration'][_0xabed('0x47')]({'where':{'id':_0x2614fa[_0xabed('0x46')]['id']}})['then'](handleEntityNotFound(_0x3ef9b4,null))[_0xabed('0x23')](function(_0x364223){if(_0x364223){_0x46bdd5=_0x364223;_0x1dc330[_0xabed('0x2d')]=_[_0xabed('0x30')](db[_0xabed('0x48')][_0xabed('0x29')]);_0x1dc330[_0xabed('0x2f')]=_[_0xabed('0x30')](_0x2614fa[_0xabed('0x2f')]);_0x1dc330[_0xabed('0x31')]=_['intersection'](_0x1dc330[_0xabed('0x2d')],_0x1dc330['query']);_0x3325ca[_0xabed('0x34')]=_[_0xabed('0x32')](_0x1dc330[_0xabed('0x2d')],qs[_0xabed('0x33')](_0x2614fa[_0xabed('0x2f')][_0xabed('0x33')]));_0x3325ca[_0xabed('0x34')]=_0x3325ca[_0xabed('0x34')][_0xabed('0x35')]?_0x3325ca[_0xabed('0x34')]:_0x1dc330[_0xabed('0x2d')];_0x3325ca[_0xabed('0x37')]=qs[_0xabed('0x38')](_0x2614fa['query']['sort']);_0x3325ca[_0xabed('0x3a')]=qs['filters'](_[_0xabed('0x39')](_0x2614fa[_0xabed('0x2f')],_0x1dc330[_0xabed('0x31')]));if(_0x2614fa[_0xabed('0x2f')][_0xabed('0x49')]){_0x3325ca['where']=_[_0xabed('0x3b')](_0x3325ca[_0xabed('0x3a')],{'$or':_['map'](_0x3325ca['attributes'],function(_0x265c60){var _0x10fd05={};_0x10fd05[_0x265c60]={'$like':'%'+_0x2614fa[_0xabed('0x2f')][_0xabed('0x49')]+'%'};return _0x10fd05;})});}_0x3325ca=_['merge']({},_0x3325ca,_0x2614fa[_0xabed('0x3c')]);return _0x46bdd5[_0xabed('0x4a')](_0x3325ca);}})['then'](function(_0x788888){if(_0x788888){_0x180489=_0x788888['length'];if(!_0x2614fa['query'][_0xabed('0x36')](_0xabed('0x4b'))){_0x3325ca[_0xabed('0x1b')]=qs[_0xabed('0x1b')](_0x2614fa[_0xabed('0x2f')][_0xabed('0x1b')]);_0x3325ca[_0xabed('0x1d')]=qs[_0xabed('0x1d')](_0x2614fa[_0xabed('0x2f')][_0xabed('0x1d')]);}return _0x46bdd5[_0xabed('0x4a')](_0x3325ca);}})[_0xabed('0x23')](function(_0x530653){if(_0x530653){return _0x530653?{'count':_0x180489,'rows':_0x530653}:null;}})[_0xabed('0x23')](respondWithResult(_0x3ef9b4,null))[_0xabed('0x43')](handleError(_0x3ef9b4,null));};exports[_0xabed('0x4c')]=function(_0xc5c1bd,_0x1f9db3,_0x12dd54){var _0x4605c2={};var _0x184952={};var _0x6417fa;var _0x1c6c87;return db[_0xabed('0x3f')]['findOne']({'where':{'id':_0xc5c1bd[_0xabed('0x46')]['id']}})[_0xabed('0x23')](handleEntityNotFound(_0x1f9db3,null))['then'](function(_0xaee97a){if(_0xaee97a){_0x6417fa=_0xaee97a;_0x184952['model']=_[_0xabed('0x30')](db['DeskField'][_0xabed('0x29')]);_0x184952[_0xabed('0x2f')]=_['keys'](_0xc5c1bd[_0xabed('0x2f')]);_0x184952[_0xabed('0x31')]=_[_0xabed('0x32')](_0x184952[_0xabed('0x2d')],_0x184952[_0xabed('0x2f')]);_0x4605c2[_0xabed('0x34')]=_[_0xabed('0x32')](_0x184952['model'],qs[_0xabed('0x33')](_0xc5c1bd['query'][_0xabed('0x33')]));_0x4605c2[_0xabed('0x34')]=_0x4605c2['attributes'][_0xabed('0x35')]?_0x4605c2[_0xabed('0x34')]:_0x184952['model'];_0x4605c2['order']=qs[_0xabed('0x38')](_0xc5c1bd[_0xabed('0x2f')][_0xabed('0x38')]);_0x4605c2['where']=qs[_0xabed('0x31')](_['pick'](_0xc5c1bd[_0xabed('0x2f')],_0x184952['filters']));if(_0xc5c1bd[_0xabed('0x2f')][_0xabed('0x49')]){_0x4605c2[_0xabed('0x3a')]=_[_0xabed('0x3b')](_0x4605c2['where'],{'$or':_['map'](_0x4605c2[_0xabed('0x34')],function(_0x9f0922){var _0x1d17ae={};_0x1d17ae[_0x9f0922]={'$like':'%'+_0xc5c1bd[_0xabed('0x2f')]['filter']+'%'};return _0x1d17ae;})});}_0x4605c2=_[_0xabed('0x3b')]({},_0x4605c2,_0xc5c1bd[_0xabed('0x3c')]);return _0x6417fa[_0xabed('0x4c')](_0x4605c2);}})[_0xabed('0x23')](function(_0x3b9b5a){if(_0x3b9b5a){_0x1c6c87=_0x3b9b5a[_0xabed('0x35')];if(!_0xc5c1bd[_0xabed('0x2f')][_0xabed('0x36')]('nolimit')){_0x4605c2[_0xabed('0x1b')]=qs[_0xabed('0x1b')](_0xc5c1bd[_0xabed('0x2f')][_0xabed('0x1b')]);_0x4605c2[_0xabed('0x1d')]=qs['offset'](_0xc5c1bd[_0xabed('0x2f')][_0xabed('0x1d')]);}return _0x6417fa['getSubjects'](_0x4605c2);}})['then'](function(_0x36bea1){if(_0x36bea1){return _0x36bea1?{'count':_0x1c6c87,'rows':_0x36bea1}:null;}})['then'](respondWithResult(_0x1f9db3,null))[_0xabed('0x43')](handleError(_0x1f9db3,null));};exports[_0xabed('0x4d')]=function(_0x56ab8e,_0x548d0f,_0x25fedf){var _0xe9e3be={};var _0x1e57d7={};var _0x270e21;var _0x2410c1;return db[_0xabed('0x3f')][_0xabed('0x47')]({'where':{'id':_0x56ab8e[_0xabed('0x46')]['id']}})[_0xabed('0x23')](handleEntityNotFound(_0x548d0f,null))[_0xabed('0x23')](function(_0x2a0252){if(_0x2a0252){_0x270e21=_0x2a0252;_0x1e57d7[_0xabed('0x2d')]=_[_0xabed('0x30')](db[_0xabed('0x48')][_0xabed('0x29')]);_0x1e57d7[_0xabed('0x2f')]=_[_0xabed('0x30')](_0x56ab8e[_0xabed('0x2f')]);_0x1e57d7[_0xabed('0x31')]=_[_0xabed('0x32')](_0x1e57d7[_0xabed('0x2d')],_0x1e57d7[_0xabed('0x2f')]);_0xe9e3be['attributes']=_[_0xabed('0x32')](_0x1e57d7[_0xabed('0x2d')],qs['fields'](_0x56ab8e[_0xabed('0x2f')]['fields']));_0xe9e3be[_0xabed('0x34')]=_0xe9e3be[_0xabed('0x34')][_0xabed('0x35')]?_0xe9e3be[_0xabed('0x34')]:_0x1e57d7[_0xabed('0x2d')];_0xe9e3be[_0xabed('0x37')]=qs[_0xabed('0x38')](_0x56ab8e[_0xabed('0x2f')][_0xabed('0x38')]);_0xe9e3be[_0xabed('0x3a')]=qs[_0xabed('0x31')](_[_0xabed('0x39')](_0x56ab8e['query'],_0x1e57d7[_0xabed('0x31')]));if(_0x56ab8e[_0xabed('0x2f')]['filter']){_0xe9e3be[_0xabed('0x3a')]=_['merge'](_0xe9e3be[_0xabed('0x3a')],{'$or':_[_0xabed('0x28')](_0xe9e3be[_0xabed('0x34')],function(_0x3dce85){var _0x188749={};_0x188749[_0x3dce85]={'$like':'%'+_0x56ab8e[_0xabed('0x2f')][_0xabed('0x49')]+'%'};return _0x188749;})});}_0xe9e3be=_['merge']({},_0xe9e3be,_0x56ab8e[_0xabed('0x3c')]);return _0x270e21[_0xabed('0x4d')](_0xe9e3be);}})['then'](function(_0x37d7a7){if(_0x37d7a7){_0x2410c1=_0x37d7a7[_0xabed('0x35')];if(!_0x56ab8e[_0xabed('0x2f')][_0xabed('0x36')](_0xabed('0x4b'))){_0xe9e3be[_0xabed('0x1b')]=qs[_0xabed('0x1b')](_0x56ab8e['query'][_0xabed('0x1b')]);_0xe9e3be['offset']=qs[_0xabed('0x1d')](_0x56ab8e['query']['offset']);}return _0x270e21[_0xabed('0x4d')](_0xe9e3be);}})[_0xabed('0x23')](function(_0x3de554){if(_0x3de554){return _0x3de554?{'count':_0x2410c1,'rows':_0x3de554}:null;}})['then'](respondWithResult(_0x548d0f,null))[_0xabed('0x43')](handleError(_0x548d0f,null));};exports[_0xabed('0x4e')]=function(_0x3aaeda,_0x128303,_0x595347){var _0x3b49c6={};var _0x1ccca1={};var _0x37f932;var _0x590264;return db[_0xabed('0x3f')][_0xabed('0x47')]({'where':{'id':_0x3aaeda[_0xabed('0x46')]['id']}})[_0xabed('0x23')](handleEntityNotFound(_0x128303,null))[_0xabed('0x23')](function(_0x9c4902){if(_0x9c4902){_0x37f932=_0x9c4902;_0x1ccca1['model']=_[_0xabed('0x30')](db['Tag'][_0xabed('0x29')]);_0x1ccca1[_0xabed('0x2f')]=_[_0xabed('0x30')](_0x3aaeda[_0xabed('0x2f')]);_0x1ccca1['filters']=_[_0xabed('0x32')](_0x1ccca1[_0xabed('0x2d')],_0x1ccca1[_0xabed('0x2f')]);_0x3b49c6[_0xabed('0x34')]=_['intersection'](_0x1ccca1[_0xabed('0x2d')],qs[_0xabed('0x33')](_0x3aaeda[_0xabed('0x2f')][_0xabed('0x33')]));_0x3b49c6[_0xabed('0x34')]=_0x3b49c6[_0xabed('0x34')][_0xabed('0x35')]?_0x3b49c6['attributes']:_0x1ccca1[_0xabed('0x2d')];_0x3b49c6['order']=qs['sort'](_0x3aaeda[_0xabed('0x2f')][_0xabed('0x38')]);_0x3b49c6[_0xabed('0x3a')]=qs['filters'](_[_0xabed('0x39')](_0x3aaeda[_0xabed('0x2f')],_0x1ccca1[_0xabed('0x31')]));if(_0x3aaeda[_0xabed('0x2f')][_0xabed('0x49')]){_0x3b49c6[_0xabed('0x3a')]=_[_0xabed('0x3b')](_0x3b49c6[_0xabed('0x3a')],{'$or':_[_0xabed('0x28')](_0x3b49c6[_0xabed('0x34')],function(_0x9b077b){var _0x3d187b={};_0x3d187b[_0x9b077b]={'$like':'%'+_0x3aaeda[_0xabed('0x2f')][_0xabed('0x49')]+'%'};return _0x3d187b;})});}_0x3b49c6=_[_0xabed('0x3b')]({},_0x3b49c6,_0x3aaeda['options']);return _0x37f932['getTags'](_0x3b49c6);}})['then'](function(_0x283678){if(_0x283678){_0x590264=_0x283678[_0xabed('0x35')];if(!_0x3aaeda['query'][_0xabed('0x36')](_0xabed('0x4b'))){_0x3b49c6[_0xabed('0x1b')]=qs[_0xabed('0x1b')](_0x3aaeda[_0xabed('0x2f')][_0xabed('0x1b')]);_0x3b49c6[_0xabed('0x1d')]=qs[_0xabed('0x1d')](_0x3aaeda[_0xabed('0x2f')][_0xabed('0x1d')]);}return _0x37f932[_0xabed('0x4e')](_0x3b49c6);}})[_0xabed('0x23')](function(_0xb36c21){if(_0xb36c21){return _0xb36c21?{'count':_0x590264,'rows':_0xb36c21}:null;}})[_0xabed('0x23')](respondWithResult(_0x128303,null))[_0xabed('0x43')](handleError(_0x128303,null));};exports[_0xabed('0x4f')]=function(_0x38a4bf,_0x119d2f,_0xa73af2){if(_0x38a4bf[_0xabed('0x45')]['id']){delete _0x38a4bf[_0xabed('0x45')]['id'];}return db['DeskConfiguration'][_0xabed('0x47')]({'where':{'id':_0x38a4bf['params']['id']}})['then'](handleEntityNotFound(_0x119d2f,null))[_0xabed('0x23')](function(_0x425b37){if(_0x425b37){return _0x425b37[_0xabed('0x4f')](_0x38a4bf[_0xabed('0x45')][_0xabed('0x50')]||[]);}return null;})[_0xabed('0x23')](respondWithResult(_0x119d2f,null))['catch'](handleError(_0x119d2f,null));}; \ No newline at end of file +var _0x3f66=['limit','set','Content-Range','save','update','then','destroy','error','stack','name','index','map','DeskConfiguration','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','rawAttributes','find','catch','create','body','getFields','findOne','DeskField','order','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3f66,0x12a));var _0x63f6=function(_0x1be707,_0x2e2fd5){_0x1be707=_0x1be707-0x0;var _0x351463=_0x3f66[_0x1be707];return _0x351463;};'use strict';var emlformat=require(_0x63f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x63f6('0x1'));var jsonpatch=require(_0x63f6('0x2'));var rp=require(_0x63f6('0x3'));var moment=require(_0x63f6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x63f6('0x5'));var path=require('path');var sox=require(_0x63f6('0x6'));var csv=require(_0x63f6('0x7'));var ejs=require(_0x63f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x63f6('0x9'));var squel=require(_0x63f6('0xa'));var crypto=require('crypto');var jsforce=require(_0x63f6('0xb'));var deskjs=require(_0x63f6('0xc'));var toCsv=require(_0x63f6('0x7'));var querystring=require('querystring');var Papa=require(_0x63f6('0xd'));var Redis=require('ioredis');var authService=require(_0x63f6('0xe'));var qs=require(_0x63f6('0xf'));var as=require(_0x63f6('0x10'));var hardwareService=require(_0x63f6('0x11'));var logger=require(_0x63f6('0x12'))(_0x63f6('0x13'));var utils=require(_0x63f6('0x14'));var config=require(_0x63f6('0x15'));var licenseUtil=require(_0x63f6('0x16'));var db=require(_0x63f6('0x17'))['db'];function respondWithStatusCode(_0x1bb08c,_0x52c328){_0x52c328=_0x52c328||0xcc;return function(_0xce65e0){if(_0xce65e0){return _0x1bb08c[_0x63f6('0x18')](_0x52c328);}return _0x1bb08c[_0x63f6('0x19')](_0x52c328)[_0x63f6('0x1a')]();};}function respondWithResult(_0x499515,_0x3b8af7){_0x3b8af7=_0x3b8af7||0xc8;return function(_0x267ded){if(_0x267ded){return _0x499515['status'](_0x3b8af7)['json'](_0x267ded);}};}function respondWithFilteredResult(_0x53a62c,_0x336a9c){return function(_0x14fa2d){if(_0x14fa2d){var _0x5299b4=typeof _0x336a9c[_0x63f6('0x1b')]===_0x63f6('0x1c')&&typeof _0x336a9c['limit']==='undefined';var _0x31ef2b=_0x14fa2d[_0x63f6('0x1d')];var _0x2ec351=_0x5299b4?0x0:_0x336a9c[_0x63f6('0x1b')];var _0x4e3a8f=_0x5299b4?_0x14fa2d[_0x63f6('0x1d')]:_0x336a9c[_0x63f6('0x1b')]+_0x336a9c[_0x63f6('0x1e')];var _0x7bd961;if(_0x4e3a8f>=_0x31ef2b){_0x4e3a8f=_0x31ef2b;_0x7bd961=0xc8;}else{_0x7bd961=0xce;}_0x53a62c[_0x63f6('0x19')](_0x7bd961);return _0x53a62c[_0x63f6('0x1f')](_0x63f6('0x20'),_0x2ec351+'-'+_0x4e3a8f+'/'+_0x31ef2b)['json'](_0x14fa2d);}return null;};}function patchUpdates(_0x246329){return function(_0x30542b){try{jsonpatch['apply'](_0x30542b,_0x246329,!![]);}catch(_0x6c3966){return BPromise['reject'](_0x6c3966);}return _0x30542b[_0x63f6('0x21')]();};}function saveUpdates(_0x110dea,_0x325c4b){return function(_0x5f4285){if(_0x5f4285){return _0x5f4285[_0x63f6('0x22')](_0x110dea)[_0x63f6('0x23')](function(_0x4f63eb){return _0x4f63eb;});}return null;};}function removeEntity(_0x109d73,_0xb35abf){return function(_0x4f0e5b){if(_0x4f0e5b){return _0x4f0e5b[_0x63f6('0x24')]()['then'](function(){_0x109d73['status'](0xcc)[_0x63f6('0x1a')]();});}};}function handleEntityNotFound(_0x37d40b,_0x1a980e){return function(_0x27ddaf){if(!_0x27ddaf){_0x37d40b[_0x63f6('0x18')](0x194);}return _0x27ddaf;};}function handleError(_0x2565dc,_0x152fca){_0x152fca=_0x152fca||0x1f4;return function(_0x4f2f3f){logger[_0x63f6('0x25')](_0x4f2f3f[_0x63f6('0x26')]);if(_0x4f2f3f[_0x63f6('0x27')]){delete _0x4f2f3f[_0x63f6('0x27')];}_0x2565dc[_0x63f6('0x19')](_0x152fca)['send'](_0x4f2f3f);};}exports[_0x63f6('0x28')]=function(_0x31fe27,_0x3fca64){var _0xe712b8={},_0x9af07a={},_0x131102={'count':0x0,'rows':[]};var _0x1360bb=_[_0x63f6('0x29')](db[_0x63f6('0x2a')]['rawAttributes'],function(_0x395da1){return{'name':_0x395da1[_0x63f6('0x2b')],'type':_0x395da1[_0x63f6('0x2c')]['key']};});_0x9af07a[_0x63f6('0x2d')]=_['map'](_0x1360bb,_0x63f6('0x27'));_0x9af07a[_0x63f6('0x2e')]=_['keys'](_0x31fe27[_0x63f6('0x2e')]);_0x9af07a[_0x63f6('0x2f')]=_[_0x63f6('0x30')](_0x9af07a['model'],_0x9af07a['query']);_0xe712b8['attributes']=_[_0x63f6('0x30')](_0x9af07a[_0x63f6('0x2d')],qs[_0x63f6('0x31')](_0x31fe27[_0x63f6('0x2e')][_0x63f6('0x31')]));_0xe712b8[_0x63f6('0x32')]=_0xe712b8['attributes'][_0x63f6('0x33')]?_0xe712b8[_0x63f6('0x32')]:_0x9af07a[_0x63f6('0x2d')];if(!_0x31fe27['query'][_0x63f6('0x34')](_0x63f6('0x35'))){_0xe712b8[_0x63f6('0x1e')]=qs[_0x63f6('0x1e')](_0x31fe27[_0x63f6('0x2e')][_0x63f6('0x1e')]);_0xe712b8[_0x63f6('0x1b')]=qs[_0x63f6('0x1b')](_0x31fe27['query'][_0x63f6('0x1b')]);}_0xe712b8['order']=qs[_0x63f6('0x36')](_0x31fe27[_0x63f6('0x2e')]['sort']);_0xe712b8[_0x63f6('0x37')]=qs[_0x63f6('0x2f')](_[_0x63f6('0x38')](_0x31fe27[_0x63f6('0x2e')],_0x9af07a[_0x63f6('0x2f')]),_0x1360bb);if(_0x31fe27[_0x63f6('0x2e')][_0x63f6('0x39')]){_0xe712b8['where']=_[_0x63f6('0x3a')](_0xe712b8[_0x63f6('0x37')],{'$or':_[_0x63f6('0x29')](_0x1360bb,function(_0x50c126){if(_0x50c126[_0x63f6('0x2c')]!==_0x63f6('0x3b')){var _0x4cfaa1={};_0x4cfaa1[_0x50c126[_0x63f6('0x27')]]={'$like':'%'+_0x31fe27[_0x63f6('0x2e')]['filter']+'%'};return _0x4cfaa1;}})});}_0xe712b8=_['merge']({},_0xe712b8,_0x31fe27[_0x63f6('0x3c')]);var _0x1a7b03={'where':_0xe712b8['where']};return db[_0x63f6('0x2a')][_0x63f6('0x1d')](_0x1a7b03)[_0x63f6('0x23')](function(_0x591071){_0x131102[_0x63f6('0x1d')]=_0x591071;if(_0x31fe27[_0x63f6('0x2e')][_0x63f6('0x3d')]){_0xe712b8[_0x63f6('0x3e')]=[{'all':!![]}];}return db[_0x63f6('0x2a')][_0x63f6('0x3f')](_0xe712b8);})[_0x63f6('0x23')](function(_0x93ec9a){_0x131102['rows']=_0x93ec9a;return _0x131102;})[_0x63f6('0x23')](respondWithFilteredResult(_0x3fca64,_0xe712b8))['catch'](handleError(_0x3fca64,null));};exports[_0x63f6('0x40')]=function(_0x8e53e6,_0xc0d3bd){var _0x3464ad={'raw':![],'where':{'id':_0x8e53e6[_0x63f6('0x41')]['id']}},_0x452720={};_0x452720['model']=_[_0x63f6('0x42')](db[_0x63f6('0x2a')][_0x63f6('0x43')]);_0x452720[_0x63f6('0x2e')]=_[_0x63f6('0x42')](_0x8e53e6[_0x63f6('0x2e')]);_0x452720[_0x63f6('0x2f')]=_['intersection'](_0x452720[_0x63f6('0x2d')],_0x452720[_0x63f6('0x2e')]);_0x3464ad[_0x63f6('0x32')]=_[_0x63f6('0x30')](_0x452720[_0x63f6('0x2d')],qs['fields'](_0x8e53e6[_0x63f6('0x2e')][_0x63f6('0x31')]));_0x3464ad['attributes']=_0x3464ad['attributes'][_0x63f6('0x33')]?_0x3464ad[_0x63f6('0x32')]:_0x452720[_0x63f6('0x2d')];if(_0x8e53e6[_0x63f6('0x2e')][_0x63f6('0x3d')]){_0x3464ad['include']=[{'all':!![]}];}_0x3464ad=_[_0x63f6('0x3a')]({},_0x3464ad,_0x8e53e6[_0x63f6('0x3c')]);return db[_0x63f6('0x2a')][_0x63f6('0x44')](_0x3464ad)[_0x63f6('0x23')](handleEntityNotFound(_0xc0d3bd,null))['then'](respondWithResult(_0xc0d3bd,null))[_0x63f6('0x45')](handleError(_0xc0d3bd,null));};exports[_0x63f6('0x46')]=function(_0x4a7fdb,_0xe06bb1){return db[_0x63f6('0x2a')]['create'](_0x4a7fdb[_0x63f6('0x47')],{})['then'](respondWithResult(_0xe06bb1,0xc9))[_0x63f6('0x45')](handleError(_0xe06bb1,null));};exports[_0x63f6('0x22')]=function(_0x1239ab,_0x1b51ad){if(_0x1239ab[_0x63f6('0x47')]['id']){delete _0x1239ab[_0x63f6('0x47')]['id'];}return db[_0x63f6('0x2a')]['find']({'where':{'id':_0x1239ab['params']['id']}})[_0x63f6('0x23')](handleEntityNotFound(_0x1b51ad,null))[_0x63f6('0x23')](saveUpdates(_0x1239ab['body'],null))[_0x63f6('0x23')](respondWithResult(_0x1b51ad,null))['catch'](handleError(_0x1b51ad,null));};exports['destroy']=function(_0x2e5e7a,_0x11467c){return db[_0x63f6('0x2a')][_0x63f6('0x44')]({'where':{'id':_0x2e5e7a[_0x63f6('0x41')]['id']}})[_0x63f6('0x23')](handleEntityNotFound(_0x11467c,null))[_0x63f6('0x23')](removeEntity(_0x11467c,null))['catch'](handleError(_0x11467c,null));};exports[_0x63f6('0x48')]=function(_0x59fefc,_0x15623a,_0xe981e2){var _0x249082={};var _0x93c243={};var _0x156818;var _0x14091b;return db['DeskConfiguration'][_0x63f6('0x49')]({'where':{'id':_0x59fefc[_0x63f6('0x41')]['id']}})['then'](handleEntityNotFound(_0x15623a,null))['then'](function(_0x120139){if(_0x120139){_0x156818=_0x120139;_0x93c243[_0x63f6('0x2d')]=_['keys'](db[_0x63f6('0x4a')][_0x63f6('0x43')]);_0x93c243[_0x63f6('0x2e')]=_[_0x63f6('0x42')](_0x59fefc[_0x63f6('0x2e')]);_0x93c243[_0x63f6('0x2f')]=_[_0x63f6('0x30')](_0x93c243[_0x63f6('0x2d')],_0x93c243[_0x63f6('0x2e')]);_0x249082[_0x63f6('0x32')]=_[_0x63f6('0x30')](_0x93c243['model'],qs['fields'](_0x59fefc[_0x63f6('0x2e')]['fields']));_0x249082[_0x63f6('0x32')]=_0x249082[_0x63f6('0x32')][_0x63f6('0x33')]?_0x249082[_0x63f6('0x32')]:_0x93c243['model'];_0x249082[_0x63f6('0x4b')]=qs[_0x63f6('0x36')](_0x59fefc[_0x63f6('0x2e')][_0x63f6('0x36')]);_0x249082[_0x63f6('0x37')]=qs[_0x63f6('0x2f')](_[_0x63f6('0x38')](_0x59fefc[_0x63f6('0x2e')],_0x93c243[_0x63f6('0x2f')]));if(_0x59fefc['query'][_0x63f6('0x39')]){_0x249082['where']=_[_0x63f6('0x3a')](_0x249082[_0x63f6('0x37')],{'$or':_[_0x63f6('0x29')](_0x249082[_0x63f6('0x32')],function(_0x3b2f38){var _0x2d29ab={};_0x2d29ab[_0x3b2f38]={'$like':'%'+_0x59fefc[_0x63f6('0x2e')]['filter']+'%'};return _0x2d29ab;})});}_0x249082=_['merge']({},_0x249082,_0x59fefc['options']);return _0x156818['getFields'](_0x249082);}})[_0x63f6('0x23')](function(_0x183cb3){if(_0x183cb3){_0x14091b=_0x183cb3[_0x63f6('0x33')];if(!_0x59fefc['query'][_0x63f6('0x34')](_0x63f6('0x35'))){_0x249082['limit']=qs['limit'](_0x59fefc[_0x63f6('0x2e')]['limit']);_0x249082['offset']=qs['offset'](_0x59fefc[_0x63f6('0x2e')][_0x63f6('0x1b')]);}return _0x156818[_0x63f6('0x48')](_0x249082);}})[_0x63f6('0x23')](function(_0x186e43){if(_0x186e43){return _0x186e43?{'count':_0x14091b,'rows':_0x186e43}:null;}})['then'](respondWithResult(_0x15623a,null))[_0x63f6('0x45')](handleError(_0x15623a,null));};exports[_0x63f6('0x4c')]=function(_0x320549,_0x1af4bb,_0x1811db){var _0x3f3ce4={};var _0x160ef3={};var _0x465ad0;var _0x4739fc;return db[_0x63f6('0x2a')]['findOne']({'where':{'id':_0x320549[_0x63f6('0x41')]['id']}})[_0x63f6('0x23')](handleEntityNotFound(_0x1af4bb,null))[_0x63f6('0x23')](function(_0x4313e5){if(_0x4313e5){_0x465ad0=_0x4313e5;_0x160ef3['model']=_[_0x63f6('0x42')](db[_0x63f6('0x4a')][_0x63f6('0x43')]);_0x160ef3[_0x63f6('0x2e')]=_[_0x63f6('0x42')](_0x320549['query']);_0x160ef3[_0x63f6('0x2f')]=_[_0x63f6('0x30')](_0x160ef3['model'],_0x160ef3['query']);_0x3f3ce4[_0x63f6('0x32')]=_['intersection'](_0x160ef3[_0x63f6('0x2d')],qs[_0x63f6('0x31')](_0x320549[_0x63f6('0x2e')]['fields']));_0x3f3ce4['attributes']=_0x3f3ce4['attributes'][_0x63f6('0x33')]?_0x3f3ce4[_0x63f6('0x32')]:_0x160ef3[_0x63f6('0x2d')];_0x3f3ce4['order']=qs[_0x63f6('0x36')](_0x320549[_0x63f6('0x2e')]['sort']);_0x3f3ce4['where']=qs['filters'](_['pick'](_0x320549[_0x63f6('0x2e')],_0x160ef3[_0x63f6('0x2f')]));if(_0x320549[_0x63f6('0x2e')]['filter']){_0x3f3ce4[_0x63f6('0x37')]=_[_0x63f6('0x3a')](_0x3f3ce4[_0x63f6('0x37')],{'$or':_[_0x63f6('0x29')](_0x3f3ce4[_0x63f6('0x32')],function(_0x190008){var _0x51be6c={};_0x51be6c[_0x190008]={'$like':'%'+_0x320549['query'][_0x63f6('0x39')]+'%'};return _0x51be6c;})});}_0x3f3ce4=_[_0x63f6('0x3a')]({},_0x3f3ce4,_0x320549[_0x63f6('0x3c')]);return _0x465ad0[_0x63f6('0x4c')](_0x3f3ce4);}})[_0x63f6('0x23')](function(_0x13e8d5){if(_0x13e8d5){_0x4739fc=_0x13e8d5[_0x63f6('0x33')];if(!_0x320549[_0x63f6('0x2e')][_0x63f6('0x34')](_0x63f6('0x35'))){_0x3f3ce4[_0x63f6('0x1e')]=qs[_0x63f6('0x1e')](_0x320549[_0x63f6('0x2e')][_0x63f6('0x1e')]);_0x3f3ce4[_0x63f6('0x1b')]=qs[_0x63f6('0x1b')](_0x320549[_0x63f6('0x2e')][_0x63f6('0x1b')]);}return _0x465ad0[_0x63f6('0x4c')](_0x3f3ce4);}})['then'](function(_0x4e18ce){if(_0x4e18ce){return _0x4e18ce?{'count':_0x4739fc,'rows':_0x4e18ce}:null;}})[_0x63f6('0x23')](respondWithResult(_0x1af4bb,null))[_0x63f6('0x45')](handleError(_0x1af4bb,null));};exports[_0x63f6('0x4d')]=function(_0xc3b376,_0xffd6f3,_0x5cb2f2){var _0x3468ad={};var _0x4152a8={};var _0x30d606;var _0x93293f;return db[_0x63f6('0x2a')]['findOne']({'where':{'id':_0xc3b376[_0x63f6('0x41')]['id']}})['then'](handleEntityNotFound(_0xffd6f3,null))[_0x63f6('0x23')](function(_0x5e09d5){if(_0x5e09d5){_0x30d606=_0x5e09d5;_0x4152a8[_0x63f6('0x2d')]=_[_0x63f6('0x42')](db[_0x63f6('0x4a')][_0x63f6('0x43')]);_0x4152a8[_0x63f6('0x2e')]=_[_0x63f6('0x42')](_0xc3b376[_0x63f6('0x2e')]);_0x4152a8[_0x63f6('0x2f')]=_[_0x63f6('0x30')](_0x4152a8[_0x63f6('0x2d')],_0x4152a8[_0x63f6('0x2e')]);_0x3468ad[_0x63f6('0x32')]=_['intersection'](_0x4152a8['model'],qs[_0x63f6('0x31')](_0xc3b376['query'][_0x63f6('0x31')]));_0x3468ad[_0x63f6('0x32')]=_0x3468ad['attributes']['length']?_0x3468ad[_0x63f6('0x32')]:_0x4152a8[_0x63f6('0x2d')];_0x3468ad[_0x63f6('0x4b')]=qs['sort'](_0xc3b376[_0x63f6('0x2e')][_0x63f6('0x36')]);_0x3468ad['where']=qs['filters'](_[_0x63f6('0x38')](_0xc3b376[_0x63f6('0x2e')],_0x4152a8[_0x63f6('0x2f')]));if(_0xc3b376[_0x63f6('0x2e')][_0x63f6('0x39')]){_0x3468ad[_0x63f6('0x37')]=_[_0x63f6('0x3a')](_0x3468ad[_0x63f6('0x37')],{'$or':_[_0x63f6('0x29')](_0x3468ad['attributes'],function(_0x1bf0f5){var _0x250615={};_0x250615[_0x1bf0f5]={'$like':'%'+_0xc3b376['query'][_0x63f6('0x39')]+'%'};return _0x250615;})});}_0x3468ad=_[_0x63f6('0x3a')]({},_0x3468ad,_0xc3b376['options']);return _0x30d606['getDescriptions'](_0x3468ad);}})[_0x63f6('0x23')](function(_0x15ffc8){if(_0x15ffc8){_0x93293f=_0x15ffc8[_0x63f6('0x33')];if(!_0xc3b376['query'][_0x63f6('0x34')](_0x63f6('0x35'))){_0x3468ad[_0x63f6('0x1e')]=qs[_0x63f6('0x1e')](_0xc3b376[_0x63f6('0x2e')]['limit']);_0x3468ad[_0x63f6('0x1b')]=qs[_0x63f6('0x1b')](_0xc3b376[_0x63f6('0x2e')][_0x63f6('0x1b')]);}return _0x30d606[_0x63f6('0x4d')](_0x3468ad);}})[_0x63f6('0x23')](function(_0x951732){if(_0x951732){return _0x951732?{'count':_0x93293f,'rows':_0x951732}:null;}})[_0x63f6('0x23')](respondWithResult(_0xffd6f3,null))[_0x63f6('0x45')](handleError(_0xffd6f3,null));};exports['getTags']=function(_0x22ce21,_0x1598fc,_0x3bc624){var _0x35f076={};var _0x48611f={};var _0x1ebefa;var _0x660e07;return db[_0x63f6('0x2a')][_0x63f6('0x49')]({'where':{'id':_0x22ce21['params']['id']}})[_0x63f6('0x23')](handleEntityNotFound(_0x1598fc,null))['then'](function(_0x3a48b6){if(_0x3a48b6){_0x1ebefa=_0x3a48b6;_0x48611f[_0x63f6('0x2d')]=_[_0x63f6('0x42')](db[_0x63f6('0x4e')][_0x63f6('0x43')]);_0x48611f[_0x63f6('0x2e')]=_[_0x63f6('0x42')](_0x22ce21[_0x63f6('0x2e')]);_0x48611f['filters']=_[_0x63f6('0x30')](_0x48611f[_0x63f6('0x2d')],_0x48611f[_0x63f6('0x2e')]);_0x35f076['attributes']=_[_0x63f6('0x30')](_0x48611f[_0x63f6('0x2d')],qs[_0x63f6('0x31')](_0x22ce21[_0x63f6('0x2e')]['fields']));_0x35f076[_0x63f6('0x32')]=_0x35f076[_0x63f6('0x32')][_0x63f6('0x33')]?_0x35f076[_0x63f6('0x32')]:_0x48611f[_0x63f6('0x2d')];_0x35f076['order']=qs[_0x63f6('0x36')](_0x22ce21[_0x63f6('0x2e')][_0x63f6('0x36')]);_0x35f076[_0x63f6('0x37')]=qs[_0x63f6('0x2f')](_['pick'](_0x22ce21[_0x63f6('0x2e')],_0x48611f[_0x63f6('0x2f')]));if(_0x22ce21['query'][_0x63f6('0x39')]){_0x35f076[_0x63f6('0x37')]=_[_0x63f6('0x3a')](_0x35f076[_0x63f6('0x37')],{'$or':_[_0x63f6('0x29')](_0x35f076[_0x63f6('0x32')],function(_0x478051){var _0x24fdc2={};_0x24fdc2[_0x478051]={'$like':'%'+_0x22ce21[_0x63f6('0x2e')][_0x63f6('0x39')]+'%'};return _0x24fdc2;})});}_0x35f076=_['merge']({},_0x35f076,_0x22ce21['options']);return _0x1ebefa[_0x63f6('0x4f')](_0x35f076);}})[_0x63f6('0x23')](function(_0x48d199){if(_0x48d199){_0x660e07=_0x48d199['length'];if(!_0x22ce21[_0x63f6('0x2e')][_0x63f6('0x34')]('nolimit')){_0x35f076[_0x63f6('0x1e')]=qs['limit'](_0x22ce21[_0x63f6('0x2e')][_0x63f6('0x1e')]);_0x35f076[_0x63f6('0x1b')]=qs[_0x63f6('0x1b')](_0x22ce21[_0x63f6('0x2e')][_0x63f6('0x1b')]);}return _0x1ebefa[_0x63f6('0x4f')](_0x35f076);}})[_0x63f6('0x23')](function(_0x39bc80){if(_0x39bc80){return _0x39bc80?{'count':_0x660e07,'rows':_0x39bc80}:null;}})['then'](respondWithResult(_0x1598fc,null))[_0x63f6('0x45')](handleError(_0x1598fc,null));};exports[_0x63f6('0x50')]=function(_0x7164af,_0x242c6e,_0x21c23b){if(_0x7164af[_0x63f6('0x47')]['id']){delete _0x7164af[_0x63f6('0x47')]['id'];}return db[_0x63f6('0x2a')][_0x63f6('0x49')]({'where':{'id':_0x7164af[_0x63f6('0x41')]['id']}})[_0x63f6('0x23')](handleEntityNotFound(_0x242c6e,null))[_0x63f6('0x23')](function(_0x284e71){if(_0x284e71){return _0x284e71['setTags'](_0x7164af[_0x63f6('0x47')][_0x63f6('0x51')]||[]);}return null;})[_0x63f6('0x23')](respondWithResult(_0x242c6e,null))[_0x63f6('0x45')](handleError(_0x242c6e,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index cf7b8b4..c6d2476 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 _0xf6d5=['util','bluebird','path','rimraf','exports','define','lodash'];(function(_0x25c65b,_0x28bd3e){var _0x17c873=function(_0x5edd6e){while(--_0x5edd6e){_0x25c65b['push'](_0x25c65b['shift']());}};_0x17c873(++_0x28bd3e);}(_0xf6d5,0x15d));var _0x5f6d=function(_0xe6365b,_0x4fc855){_0xe6365b=_0xe6365b-0x0;var _0x5e6fa9=_0xf6d5[_0xe6365b];return _0x5e6fa9;};'use strict';var _=require(_0x5f6d('0x0'));var util=require(_0x5f6d('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5f6d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f6d('0x3'));var rimraf=require(_0x5f6d('0x4'));var config=require('../../config/environment');var attributes=require('./intDeskConfiguration.attributes');module[_0x5f6d('0x5')]=function(_0x526836,_0x43f7b2){return _0x526836[_0x5f6d('0x6')]('DeskConfiguration',attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x448a=['bluebird','path','../../config/environment','exports','DeskConfiguration','util','../../config/logger','api'];(function(_0x3ff1a1,_0x5f37d5){var _0x50200a=function(_0x1b1717){while(--_0x1b1717){_0x3ff1a1['push'](_0x3ff1a1['shift']());}};_0x50200a(++_0x5f37d5);}(_0x448a,0x65));var _0xa448=function(_0x49eed8,_0x9aa73c){_0x49eed8=_0x49eed8-0x0;var _0x1b2667=_0x448a[_0x49eed8];return _0x1b2667;};'use strict';var _=require('lodash');var util=require(_0xa448('0x0'));var logger=require(_0xa448('0x1'))(_0xa448('0x2'));var moment=require('moment');var BPromise=require(_0xa448('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa448('0x4'));var rimraf=require('rimraf');var config=require(_0xa448('0x5'));var attributes=require('./intDeskConfiguration.attributes');module[_0xa448('0x6')]=function(_0x5de0cf,_0x3181df){return _0x5de0cf['define'](_0xa448('0x7'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 8c2b6d9..6bfe986 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 _0xbeb6=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','catch'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0xbeb6,0x19e));var _0x6beb=function(_0x1afd17,_0x53f5c0){_0x1afd17=_0x1afd17-0x0;var _0x5ea4cf=_0xbeb6[_0x1afd17];return _0x5ea4cf;};'use strict';var _=require('lodash');var util=require(_0x6beb('0x0'));var moment=require(_0x6beb('0x1'));var BPromise=require(_0x6beb('0x2'));var rs=require(_0x6beb('0x3'));var fs=require('fs');var Redis=require(_0x6beb('0x4'));var db=require(_0x6beb('0x5'))['db'];var utils=require(_0x6beb('0x6'));var logger=require(_0x6beb('0x7'))(_0x6beb('0x8'));var config=require(_0x6beb('0x9'));var jayson=require(_0x6beb('0xa'));var client=jayson[_0x6beb('0xb')][_0x6beb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x229128,_0x5eb9b5,_0x3d5380){return new BPromise(function(_0x186a19,_0x189a4a){return client['request'](_0x229128,_0x3d5380)[_0x6beb('0xd')](function(_0x43e11e){logger[_0x6beb('0xe')]('DeskConfiguration,\x20%s,\x20%s',_0x5eb9b5,_0x6beb('0xf'));logger[_0x6beb('0x10')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5eb9b5,_0x6beb('0xf'),JSON['stringify'](_0x43e11e));if(_0x43e11e[_0x6beb('0x11')]){if(_0x43e11e[_0x6beb('0x11')][_0x6beb('0x12')]===0x1f4){logger[_0x6beb('0x11')](_0x6beb('0x13'),_0x5eb9b5,_0x43e11e[_0x6beb('0x11')][_0x6beb('0x14')]);return _0x189a4a(_0x43e11e[_0x6beb('0x11')]['message']);}logger['error'](_0x6beb('0x13'),_0x5eb9b5,_0x43e11e[_0x6beb('0x11')][_0x6beb('0x14')]);return _0x186a19(_0x43e11e[_0x6beb('0x11')][_0x6beb('0x14')]);}else{logger[_0x6beb('0xe')](_0x6beb('0x13'),_0x5eb9b5,_0x6beb('0xf'));_0x186a19(_0x43e11e[_0x6beb('0x15')][_0x6beb('0x14')]);}})[_0x6beb('0x16')](function(_0x3fbf1c){logger[_0x6beb('0x11')](_0x6beb('0x13'),_0x5eb9b5,_0x3fbf1c);_0x189a4a(_0x3fbf1c);});});} \ No newline at end of file +var _0x117c=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','catch','bluebird'];(function(_0x1cd674,_0x8d3638){var _0x27928f=function(_0x5e3c70){while(--_0x5e3c70){_0x1cd674['push'](_0x1cd674['shift']());}};_0x27928f(++_0x8d3638);}(_0x117c,0x71));var _0xc117=function(_0xf39e84,_0x825c93){_0xf39e84=_0xf39e84-0x0;var _0x58e41f=_0x117c[_0xf39e84];return _0x58e41f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc117('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc117('0x1'))['db'];var utils=require(_0xc117('0x2'));var logger=require(_0xc117('0x3'))(_0xc117('0x4'));var config=require(_0xc117('0x5'));var jayson=require(_0xc117('0x6'));var client=jayson['client'][_0xc117('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x389734,_0x48efbb,_0x181a70){return new BPromise(function(_0x56c9bd,_0x451447){return client[_0xc117('0x8')](_0x389734,_0x181a70)[_0xc117('0x9')](function(_0x39e33f){logger[_0xc117('0xa')]('DeskConfiguration,\x20%s,\x20%s',_0x48efbb,_0xc117('0xb'));logger['debug'](_0xc117('0xc'),_0x48efbb,'request\x20sent',JSON[_0xc117('0xd')](_0x39e33f));if(_0x39e33f[_0xc117('0xe')]){if(_0x39e33f['error'][_0xc117('0xf')]===0x1f4){logger['error'](_0xc117('0x10'),_0x48efbb,_0x39e33f[_0xc117('0xe')][_0xc117('0x11')]);return _0x451447(_0x39e33f[_0xc117('0xe')]['message']);}logger[_0xc117('0xe')](_0xc117('0x10'),_0x48efbb,_0x39e33f[_0xc117('0xe')][_0xc117('0x11')]);return _0x56c9bd(_0x39e33f[_0xc117('0xe')][_0xc117('0x11')]);}else{logger[_0xc117('0xa')](_0xc117('0x10'),_0x48efbb,_0xc117('0xb'));_0x56c9bd(_0x39e33f['result']['message']);}})[_0xc117('0x12')](function(_0x241ee7){logger[_0xc117('0xe')](_0xc117('0x10'),_0x48efbb,_0x241ee7);_0x451447(_0x241ee7);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 4c09285..31697e1 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 _0x5f7b=['show','create','put','/:id','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated'];(function(_0x500582,_0x5eb3a7){var _0x138bf5=function(_0x3dbfda){while(--_0x3dbfda){_0x500582['push'](_0x500582['shift']());}};_0x138bf5(++_0x5eb3a7);}(_0x5f7b,0x14a));var _0xb5f7=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x5f7b[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0xb5f7('0x0'));var util=require(_0xb5f7('0x1'));var path=require('path');var timeout=require(_0xb5f7('0x2'));var express=require(_0xb5f7('0x3'));var router=express[_0xb5f7('0x4')]();var fs_extra=require(_0xb5f7('0x5'));var auth=require(_0xb5f7('0x6'));var interaction=require(_0xb5f7('0x7'));var config=require(_0xb5f7('0x8'));var controller=require('./intDeskField.controller');router[_0xb5f7('0x9')]('/',auth['isAuthenticated'](),controller[_0xb5f7('0xa')]);router[_0xb5f7('0x9')]('/:id',auth[_0xb5f7('0xb')](),controller[_0xb5f7('0xc')]);router['post']('/',auth[_0xb5f7('0xb')](),controller[_0xb5f7('0xd')]);router[_0xb5f7('0xe')](_0xb5f7('0xf'),auth[_0xb5f7('0xb')](),controller[_0xb5f7('0x10')]);router[_0xb5f7('0x11')]('/:id',auth[_0xb5f7('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbced=['create','put','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskField.controller','isAuthenticated','index','/:id','post'];(function(_0x5d7c7d,_0xb243cc){var _0x30ae4f=function(_0x1fc2bc){while(--_0x1fc2bc){_0x5d7c7d['push'](_0x5d7c7d['shift']());}};_0x30ae4f(++_0xb243cc);}(_0xbced,0x1d6));var _0xdbce=function(_0x4e64c7,_0x58e180){_0x4e64c7=_0x4e64c7-0x0;var _0x117dae=_0xbced[_0x4e64c7];return _0x117dae;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xdbce('0x0'));var express=require(_0xdbce('0x1'));var router=express[_0xdbce('0x2')]();var fs_extra=require(_0xdbce('0x3'));var auth=require(_0xdbce('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdbce('0x5'));router['get']('/',auth[_0xdbce('0x6')](),controller[_0xdbce('0x7')]);router['get'](_0xdbce('0x8'),auth[_0xdbce('0x6')](),controller['show']);router[_0xdbce('0x9')]('/',auth[_0xdbce('0x6')](),controller[_0xdbce('0xa')]);router[_0xdbce('0xb')](_0xdbce('0x8'),auth[_0xdbce('0x6')](),controller[_0xdbce('0xc')]);router[_0xdbce('0xd')](_0xdbce('0x8'),auth[_0xdbce('0x6')](),controller[_0xdbce('0xe')]);module[_0xdbce('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index e14ed7f..aa33aec 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 _0x4864=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x155382,_0x42defb){var _0x33aac2=function(_0x23a349){while(--_0x23a349){_0x155382['push'](_0x155382['shift']());}};_0x33aac2(++_0x42defb);}(_0x4864,0x1a9));var _0x4486=function(_0x2d69a4,_0x32935e){_0x2d69a4=_0x2d69a4-0x0;var _0xe0705b=_0x4864[_0x2d69a4];return _0xe0705b;};'use strict';var Sequelize=require(_0x4486('0x0'));module[_0x4486('0x1')]={'type':{'type':Sequelize[_0x4486('0x2')](_0x4486('0x3'),_0x4486('0x4'),_0x4486('0x5'),'keyValue',_0x4486('0x6')),'defaultValue':_0x4486('0x3')},'content':{'type':Sequelize[_0x4486('0x7')]},'key':{'type':Sequelize[_0x4486('0x7')]},'keyType':{'type':Sequelize[_0x4486('0x2')](_0x4486('0x3'),'variable',_0x4486('0x5'))},'keyContent':{'type':Sequelize[_0x4486('0x7')]},'idField':{'type':Sequelize[_0x4486('0x7')]},'nameField':{'type':Sequelize[_0x4486('0x7')]},'customField':{'type':Sequelize[_0x4486('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x510f=['picklist','STRING','string','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue'];(function(_0x3c0318,_0x267fde){var _0x146788=function(_0x5c4fd8){while(--_0x5c4fd8){_0x3c0318['push'](_0x3c0318['shift']());}};_0x146788(++_0x267fde);}(_0x510f,0xcc));var _0xf510=function(_0x57beaf,_0x165fb5){_0x57beaf=_0x57beaf-0x0;var _0x1f23c6=_0x510f[_0x57beaf];return _0x1f23c6;};'use strict';var Sequelize=require(_0xf510('0x0'));module[_0xf510('0x1')]={'type':{'type':Sequelize[_0xf510('0x2')]('string',_0xf510('0x3'),_0xf510('0x4'),_0xf510('0x5'),_0xf510('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf510('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xf510('0x8'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf510('0x7')]},'nameField':{'type':Sequelize[_0xf510('0x7')]},'customField':{'type':Sequelize[_0xf510('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf510('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 7b16d8f..3a21ed2 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 _0x88b0=['fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','include','rows','catch','show','DeskField','find','create','body','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x88b0,0x1cb));var _0x088b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x88b0[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x088b('0x0'));var rimraf=require(_0x088b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x088b('0x2'));var moment=require(_0x088b('0x3'));var BPromise=require(_0x088b('0x4'));var Mustache=require(_0x088b('0x5'));var util=require('util');var path=require(_0x088b('0x6'));var sox=require(_0x088b('0x7'));var csv=require(_0x088b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x088b('0x9'));var squel=require(_0x088b('0xa'));var crypto=require(_0x088b('0xb'));var jsforce=require(_0x088b('0xc'));var deskjs=require(_0x088b('0xd'));var toCsv=require(_0x088b('0x8'));var querystring=require(_0x088b('0xe'));var Papa=require('papaparse');var Redis=require(_0x088b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x088b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x088b('0x11'));var logger=require(_0x088b('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x088b('0x13'));var licenseUtil=require(_0x088b('0x14'));var db=require(_0x088b('0x15'))['db'];function respondWithStatusCode(_0x4c8a3b,_0x458b1c){_0x458b1c=_0x458b1c||0xcc;return function(_0x19f6c2){if(_0x19f6c2){return _0x4c8a3b[_0x088b('0x16')](_0x458b1c);}return _0x4c8a3b['status'](_0x458b1c)[_0x088b('0x17')]();};}function respondWithResult(_0x2a1e5c,_0x1b0771){_0x1b0771=_0x1b0771||0xc8;return function(_0xf6bd53){if(_0xf6bd53){return _0x2a1e5c[_0x088b('0x18')](_0x1b0771)[_0x088b('0x19')](_0xf6bd53);}};}function respondWithFilteredResult(_0x462392,_0x500ed5){return function(_0x393335){if(_0x393335){var _0x1c1096=typeof _0x500ed5[_0x088b('0x1a')]===_0x088b('0x1b')&&typeof _0x500ed5[_0x088b('0x1c')]===_0x088b('0x1b');var _0x54a27e=_0x393335[_0x088b('0x1d')];var _0x3ce059=_0x1c1096?0x0:_0x500ed5[_0x088b('0x1a')];var _0x31d121=_0x1c1096?_0x393335[_0x088b('0x1d')]:_0x500ed5['offset']+_0x500ed5['limit'];var _0x35e006;if(_0x31d121>=_0x54a27e){_0x31d121=_0x54a27e;_0x35e006=0xc8;}else{_0x35e006=0xce;}_0x462392[_0x088b('0x18')](_0x35e006);return _0x462392[_0x088b('0x1e')](_0x088b('0x1f'),_0x3ce059+'-'+_0x31d121+'/'+_0x54a27e)[_0x088b('0x19')](_0x393335);}return null;};}function patchUpdates(_0x6ecfbe){return function(_0x565220){try{jsonpatch[_0x088b('0x20')](_0x565220,_0x6ecfbe,!![]);}catch(_0x293604){return BPromise[_0x088b('0x21')](_0x293604);}return _0x565220['save']();};}function saveUpdates(_0x52f955,_0x464949){return function(_0x1db300){if(_0x1db300){return _0x1db300[_0x088b('0x22')](_0x52f955)['then'](function(_0x187350){return _0x187350;});}return null;};}function removeEntity(_0xcfc1c6,_0x5a9cbf){return function(_0x4b4d3f){if(_0x4b4d3f){return _0x4b4d3f['destroy']()[_0x088b('0x23')](function(){_0xcfc1c6['status'](0xcc)[_0x088b('0x17')]();});}};}function handleEntityNotFound(_0x4178d0,_0x8f18b7){return function(_0x2c551f){if(!_0x2c551f){_0x4178d0[_0x088b('0x16')](0x194);}return _0x2c551f;};}function handleError(_0x16495e,_0x525bf0){_0x525bf0=_0x525bf0||0x1f4;return function(_0x339eb9){logger[_0x088b('0x24')](_0x339eb9[_0x088b('0x25')]);if(_0x339eb9['name']){delete _0x339eb9[_0x088b('0x26')];}_0x16495e[_0x088b('0x18')](_0x525bf0)[_0x088b('0x27')](_0x339eb9);};}exports[_0x088b('0x28')]=function(_0x5e1449,_0x53b932){var _0x2e513={},_0x44e8a6={},_0x3921c8={'count':0x0,'rows':[]};var _0x193a00=_[_0x088b('0x29')](db['DeskField'][_0x088b('0x2a')],function(_0xb97ad6){return{'name':_0xb97ad6[_0x088b('0x2b')],'type':_0xb97ad6[_0x088b('0x2c')][_0x088b('0x2d')]};});_0x44e8a6['model']=_[_0x088b('0x29')](_0x193a00,_0x088b('0x26'));_0x44e8a6[_0x088b('0x2e')]=_[_0x088b('0x2f')](_0x5e1449[_0x088b('0x2e')]);_0x44e8a6[_0x088b('0x30')]=_[_0x088b('0x31')](_0x44e8a6[_0x088b('0x32')],_0x44e8a6[_0x088b('0x2e')]);_0x2e513[_0x088b('0x33')]=_[_0x088b('0x31')](_0x44e8a6['model'],qs[_0x088b('0x34')](_0x5e1449[_0x088b('0x2e')][_0x088b('0x34')]));_0x2e513[_0x088b('0x33')]=_0x2e513['attributes'][_0x088b('0x35')]?_0x2e513['attributes']:_0x44e8a6[_0x088b('0x32')];if(!_0x5e1449['query'][_0x088b('0x36')](_0x088b('0x37'))){_0x2e513[_0x088b('0x1c')]=qs[_0x088b('0x1c')](_0x5e1449[_0x088b('0x2e')][_0x088b('0x1c')]);_0x2e513[_0x088b('0x1a')]=qs['offset'](_0x5e1449[_0x088b('0x2e')][_0x088b('0x1a')]);}_0x2e513[_0x088b('0x38')]=qs['sort'](_0x5e1449[_0x088b('0x2e')][_0x088b('0x39')]);_0x2e513['where']=qs[_0x088b('0x30')](_[_0x088b('0x3a')](_0x5e1449[_0x088b('0x2e')],_0x44e8a6[_0x088b('0x30')]),_0x193a00);if(_0x5e1449['query'][_0x088b('0x3b')]){_0x2e513['where']=_[_0x088b('0x3c')](_0x2e513[_0x088b('0x3d')],{'$or':_[_0x088b('0x29')](_0x193a00,function(_0x4d9caf){if(_0x4d9caf[_0x088b('0x2c')]!=='VIRTUAL'){var _0x1cc801={};_0x1cc801[_0x4d9caf[_0x088b('0x26')]]={'$like':'%'+_0x5e1449[_0x088b('0x2e')][_0x088b('0x3b')]+'%'};return _0x1cc801;}})});}_0x2e513=_[_0x088b('0x3c')]({},_0x2e513,_0x5e1449[_0x088b('0x3e')]);var _0x258ee4={'where':_0x2e513[_0x088b('0x3d')]};return db['DeskField'][_0x088b('0x1d')](_0x258ee4)[_0x088b('0x23')](function(_0xce5ffc){_0x3921c8['count']=_0xce5ffc;if(_0x5e1449[_0x088b('0x2e')][_0x088b('0x3f')]){_0x2e513[_0x088b('0x40')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x2e513);})['then'](function(_0x530133){_0x3921c8[_0x088b('0x41')]=_0x530133;return _0x3921c8;})[_0x088b('0x23')](respondWithFilteredResult(_0x53b932,_0x2e513))[_0x088b('0x42')](handleError(_0x53b932,null));};exports[_0x088b('0x43')]=function(_0xe27d96,_0x15a35a){var _0x4bc14d={'raw':!![],'where':{'id':_0xe27d96['params']['id']}},_0x3b894d={};_0x3b894d['model']=_['keys'](db['DeskField'][_0x088b('0x2a')]);_0x3b894d[_0x088b('0x2e')]=_[_0x088b('0x2f')](_0xe27d96[_0x088b('0x2e')]);_0x3b894d[_0x088b('0x30')]=_[_0x088b('0x31')](_0x3b894d[_0x088b('0x32')],_0x3b894d[_0x088b('0x2e')]);_0x4bc14d[_0x088b('0x33')]=_[_0x088b('0x31')](_0x3b894d[_0x088b('0x32')],qs['fields'](_0xe27d96[_0x088b('0x2e')][_0x088b('0x34')]));_0x4bc14d[_0x088b('0x33')]=_0x4bc14d[_0x088b('0x33')]['length']?_0x4bc14d[_0x088b('0x33')]:_0x3b894d['model'];if(_0xe27d96[_0x088b('0x2e')][_0x088b('0x3f')]){_0x4bc14d[_0x088b('0x40')]=[{'all':!![]}];}_0x4bc14d=_['merge']({},_0x4bc14d,_0xe27d96[_0x088b('0x3e')]);return db[_0x088b('0x44')][_0x088b('0x45')](_0x4bc14d)[_0x088b('0x23')](handleEntityNotFound(_0x15a35a,null))[_0x088b('0x23')](respondWithResult(_0x15a35a,null))[_0x088b('0x42')](handleError(_0x15a35a,null));};exports[_0x088b('0x46')]=function(_0x117c4b,_0x173888){return db['DeskField'][_0x088b('0x46')](_0x117c4b[_0x088b('0x47')],{})[_0x088b('0x23')](respondWithResult(_0x173888,0xc9))[_0x088b('0x42')](handleError(_0x173888,null));};exports[_0x088b('0x22')]=function(_0x301212,_0x32d95a){if(_0x301212[_0x088b('0x47')]['id']){delete _0x301212['body']['id'];}return db[_0x088b('0x44')][_0x088b('0x45')]({'where':{'id':_0x301212[_0x088b('0x48')]['id']}})[_0x088b('0x23')](handleEntityNotFound(_0x32d95a,null))['then'](saveUpdates(_0x301212[_0x088b('0x47')],null))[_0x088b('0x23')](respondWithResult(_0x32d95a,null))[_0x088b('0x42')](handleError(_0x32d95a,null));};exports['destroy']=function(_0x40e19e,_0x59ae27){return db['DeskField'][_0x088b('0x45')]({'where':{'id':_0x40e19e[_0x088b('0x48')]['id']}})[_0x088b('0x23')](handleEntityNotFound(_0x59ae27,null))[_0x088b('0x23')](removeEntity(_0x59ae27,null))[_0x088b('0x42')](handleError(_0x59ae27,null));}; \ No newline at end of file +var _0x4279=['moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','options','DeskField','includeAll','include','findAll','rows','show','params','catch','body','find','rimraf','zip-dir','request-promise'];(function(_0x4723ff,_0x16ad59){var _0xd42df6=function(_0x53580a){while(--_0x53580a){_0x4723ff['push'](_0x4723ff['shift']());}};_0xd42df6(++_0x16ad59);}(_0x4279,0x8d));var _0x9427=function(_0x53ac49,_0x5d0037){_0x53ac49=_0x53ac49-0x0;var _0x5f0719=_0x4279[_0x53ac49];return _0x5f0719;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9427('0x0'));var zipdir=require(_0x9427('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9427('0x2'));var moment=require(_0x9427('0x3'));var BPromise=require(_0x9427('0x4'));var Mustache=require(_0x9427('0x5'));var util=require('util');var path=require(_0x9427('0x6'));var sox=require('sox');var csv=require(_0x9427('0x7'));var ejs=require(_0x9427('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9427('0x9'));var squel=require(_0x9427('0xa'));var crypto=require(_0x9427('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9427('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9427('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9427('0xe'));var qs=require(_0x9427('0xf'));var as=require(_0x9427('0x10'));var hardwareService=require(_0x9427('0x11'));var logger=require(_0x9427('0x12'))(_0x9427('0x13'));var utils=require(_0x9427('0x14'));var config=require(_0x9427('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9427('0x16'))['db'];function respondWithStatusCode(_0x1ceb46,_0x44bd4e){_0x44bd4e=_0x44bd4e||0xcc;return function(_0x17eb26){if(_0x17eb26){return _0x1ceb46[_0x9427('0x17')](_0x44bd4e);}return _0x1ceb46[_0x9427('0x18')](_0x44bd4e)[_0x9427('0x19')]();};}function respondWithResult(_0x1f6b92,_0x250144){_0x250144=_0x250144||0xc8;return function(_0x3a2956){if(_0x3a2956){return _0x1f6b92[_0x9427('0x18')](_0x250144)[_0x9427('0x1a')](_0x3a2956);}};}function respondWithFilteredResult(_0x418e37,_0x5cbf67){return function(_0x3a6f84){if(_0x3a6f84){var _0x1a41eb=typeof _0x5cbf67[_0x9427('0x1b')]==='undefined'&&typeof _0x5cbf67['limit']===_0x9427('0x1c');var _0x567da4=_0x3a6f84[_0x9427('0x1d')];var _0x20de12=_0x1a41eb?0x0:_0x5cbf67['offset'];var _0x5177e2=_0x1a41eb?_0x3a6f84[_0x9427('0x1d')]:_0x5cbf67[_0x9427('0x1b')]+_0x5cbf67[_0x9427('0x1e')];var _0x11fcd4;if(_0x5177e2>=_0x567da4){_0x5177e2=_0x567da4;_0x11fcd4=0xc8;}else{_0x11fcd4=0xce;}_0x418e37[_0x9427('0x18')](_0x11fcd4);return _0x418e37[_0x9427('0x1f')](_0x9427('0x20'),_0x20de12+'-'+_0x5177e2+'/'+_0x567da4)[_0x9427('0x1a')](_0x3a6f84);}return null;};}function patchUpdates(_0xa9da31){return function(_0x97800f){try{jsonpatch[_0x9427('0x21')](_0x97800f,_0xa9da31,!![]);}catch(_0x374291){return BPromise[_0x9427('0x22')](_0x374291);}return _0x97800f[_0x9427('0x23')]();};}function saveUpdates(_0xac18ea,_0x3e8743){return function(_0x4c6c09){if(_0x4c6c09){return _0x4c6c09['update'](_0xac18ea)[_0x9427('0x24')](function(_0x3cde1e){return _0x3cde1e;});}return null;};}function removeEntity(_0x1db2cf,_0x40d8cb){return function(_0x437dda){if(_0x437dda){return _0x437dda[_0x9427('0x25')]()[_0x9427('0x24')](function(){_0x1db2cf[_0x9427('0x18')](0xcc)[_0x9427('0x19')]();});}};}function handleEntityNotFound(_0x1ecd67,_0xb43f57){return function(_0x32a68a){if(!_0x32a68a){_0x1ecd67['sendStatus'](0x194);}return _0x32a68a;};}function handleError(_0x2a9a0c,_0x5d1829){_0x5d1829=_0x5d1829||0x1f4;return function(_0x2ed9b5){logger[_0x9427('0x26')](_0x2ed9b5['stack']);if(_0x2ed9b5[_0x9427('0x27')]){delete _0x2ed9b5[_0x9427('0x27')];}_0x2a9a0c[_0x9427('0x18')](_0x5d1829)[_0x9427('0x28')](_0x2ed9b5);};}exports[_0x9427('0x29')]=function(_0x58c7a2,_0x8e8955){var _0x2a0263={},_0x5947d0={},_0x51a356={'count':0x0,'rows':[]};var _0x2362f0=_[_0x9427('0x2a')](db['DeskField'][_0x9427('0x2b')],function(_0x127572){return{'name':_0x127572[_0x9427('0x2c')],'type':_0x127572[_0x9427('0x2d')][_0x9427('0x2e')]};});_0x5947d0['model']=_['map'](_0x2362f0,_0x9427('0x27'));_0x5947d0[_0x9427('0x2f')]=_[_0x9427('0x30')](_0x58c7a2['query']);_0x5947d0[_0x9427('0x31')]=_[_0x9427('0x32')](_0x5947d0[_0x9427('0x33')],_0x5947d0['query']);_0x2a0263['attributes']=_[_0x9427('0x32')](_0x5947d0['model'],qs[_0x9427('0x34')](_0x58c7a2[_0x9427('0x2f')][_0x9427('0x34')]));_0x2a0263['attributes']=_0x2a0263[_0x9427('0x35')][_0x9427('0x36')]?_0x2a0263[_0x9427('0x35')]:_0x5947d0[_0x9427('0x33')];if(!_0x58c7a2[_0x9427('0x2f')][_0x9427('0x37')]('nolimit')){_0x2a0263['limit']=qs[_0x9427('0x1e')](_0x58c7a2[_0x9427('0x2f')][_0x9427('0x1e')]);_0x2a0263[_0x9427('0x1b')]=qs[_0x9427('0x1b')](_0x58c7a2['query'][_0x9427('0x1b')]);}_0x2a0263[_0x9427('0x38')]=qs[_0x9427('0x39')](_0x58c7a2[_0x9427('0x2f')][_0x9427('0x39')]);_0x2a0263[_0x9427('0x3a')]=qs[_0x9427('0x31')](_['pick'](_0x58c7a2[_0x9427('0x2f')],_0x5947d0['filters']),_0x2362f0);if(_0x58c7a2['query'][_0x9427('0x3b')]){_0x2a0263[_0x9427('0x3a')]=_[_0x9427('0x3c')](_0x2a0263[_0x9427('0x3a')],{'$or':_[_0x9427('0x2a')](_0x2362f0,function(_0x34915f){if(_0x34915f['type']!=='VIRTUAL'){var _0x689284={};_0x689284[_0x34915f['name']]={'$like':'%'+_0x58c7a2[_0x9427('0x2f')][_0x9427('0x3b')]+'%'};return _0x689284;}})});}_0x2a0263=_['merge']({},_0x2a0263,_0x58c7a2[_0x9427('0x3d')]);var _0xff3674={'where':_0x2a0263['where']};return db[_0x9427('0x3e')][_0x9427('0x1d')](_0xff3674)['then'](function(_0x18b5c4){_0x51a356['count']=_0x18b5c4;if(_0x58c7a2[_0x9427('0x2f')][_0x9427('0x3f')]){_0x2a0263[_0x9427('0x40')]=[{'all':!![]}];}return db[_0x9427('0x3e')][_0x9427('0x41')](_0x2a0263);})[_0x9427('0x24')](function(_0x14e137){_0x51a356[_0x9427('0x42')]=_0x14e137;return _0x51a356;})[_0x9427('0x24')](respondWithFilteredResult(_0x8e8955,_0x2a0263))['catch'](handleError(_0x8e8955,null));};exports[_0x9427('0x43')]=function(_0x234092,_0x4a5c19){var _0x4988f8={'raw':!![],'where':{'id':_0x234092[_0x9427('0x44')]['id']}},_0x17eb62={};_0x17eb62[_0x9427('0x33')]=_[_0x9427('0x30')](db[_0x9427('0x3e')]['rawAttributes']);_0x17eb62[_0x9427('0x2f')]=_[_0x9427('0x30')](_0x234092[_0x9427('0x2f')]);_0x17eb62[_0x9427('0x31')]=_['intersection'](_0x17eb62['model'],_0x17eb62[_0x9427('0x2f')]);_0x4988f8[_0x9427('0x35')]=_[_0x9427('0x32')](_0x17eb62[_0x9427('0x33')],qs[_0x9427('0x34')](_0x234092['query'][_0x9427('0x34')]));_0x4988f8[_0x9427('0x35')]=_0x4988f8['attributes'][_0x9427('0x36')]?_0x4988f8['attributes']:_0x17eb62['model'];if(_0x234092['query']['includeAll']){_0x4988f8['include']=[{'all':!![]}];}_0x4988f8=_['merge']({},_0x4988f8,_0x234092[_0x9427('0x3d')]);return db['DeskField']['find'](_0x4988f8)['then'](handleEntityNotFound(_0x4a5c19,null))[_0x9427('0x24')](respondWithResult(_0x4a5c19,null))[_0x9427('0x45')](handleError(_0x4a5c19,null));};exports['create']=function(_0x590673,_0x1d3818){return db[_0x9427('0x3e')]['create'](_0x590673['body'],{})[_0x9427('0x24')](respondWithResult(_0x1d3818,0xc9))[_0x9427('0x45')](handleError(_0x1d3818,null));};exports['update']=function(_0x44a0a2,_0x442755){if(_0x44a0a2[_0x9427('0x46')]['id']){delete _0x44a0a2['body']['id'];}return db[_0x9427('0x3e')]['find']({'where':{'id':_0x44a0a2[_0x9427('0x44')]['id']}})[_0x9427('0x24')](handleEntityNotFound(_0x442755,null))[_0x9427('0x24')](saveUpdates(_0x44a0a2[_0x9427('0x46')],null))['then'](respondWithResult(_0x442755,null))[_0x9427('0x45')](handleError(_0x442755,null));};exports[_0x9427('0x25')]=function(_0xe2cac7,_0x664bdc){return db[_0x9427('0x3e')][_0x9427('0x47')]({'where':{'id':_0xe2cac7['params']['id']}})[_0x9427('0x24')](handleEntityNotFound(_0x664bdc,null))[_0x9427('0x24')](removeEntity(_0x664bdc,null))[_0x9427('0x45')](handleError(_0x664bdc,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 9a934df..d460a07 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 _0x1745=['desk_unique_index','FieldId','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields'];(function(_0x3fdeb2,_0x13bdc4){var _0x4da4d0=function(_0x468ef0){while(--_0x468ef0){_0x3fdeb2['push'](_0x3fdeb2['shift']());}};_0x4da4d0(++_0x13bdc4);}(_0x1745,0x14c));var _0x5174=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1745[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5174('0x0'));var util=require('util');var logger=require(_0x5174('0x1'))(_0x5174('0x2'));var moment=require(_0x5174('0x3'));var BPromise=require(_0x5174('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5174('0x5'));var rimraf=require(_0x5174('0x6'));var config=require(_0x5174('0x7'));var attributes=require(_0x5174('0x8'));module[_0x5174('0x9')]=function(_0x158141,_0x5003d6){return _0x158141[_0x5174('0xa')](_0x5174('0xb'),attributes,{'tableName':_0x5174('0xc'),'paranoid':![],'indexes':[{'name':_0x5174('0xd'),'fields':['idField',_0x5174('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe43a=['idField','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','DeskField','int_desk_fields','desk_unique_index'];(function(_0x4b3ad1,_0x499cec){var _0x318947=function(_0x2b3c9d){while(--_0x2b3c9d){_0x4b3ad1['push'](_0x4b3ad1['shift']());}};_0x318947(++_0x499cec);}(_0xe43a,0x1d5));var _0xae43=function(_0x14db33,_0x25d919){_0x14db33=_0x14db33-0x0;var _0x41bff6=_0xe43a[_0x14db33];return _0x41bff6;};'use strict';var _=require(_0xae43('0x0'));var util=require('util');var logger=require(_0xae43('0x1'))(_0xae43('0x2'));var moment=require(_0xae43('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xae43('0x4'));var rimraf=require(_0xae43('0x5'));var config=require(_0xae43('0x6'));var attributes=require('./intDeskField.attributes');module[_0xae43('0x7')]=function(_0x381630,_0x176567){return _0x381630[_0xae43('0x8')](_0xae43('0x9'),attributes,{'tableName':_0xae43('0xa'),'paranoid':![],'indexes':[{'name':_0xae43('0xb'),'fields':[_0xae43('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 302433c..620ca54 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 _0x78b0=['info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0xc629a9,_0x328b50){var _0x427c8d=function(_0x3a41bf){while(--_0x3a41bf){_0xc629a9['push'](_0xc629a9['shift']());}};_0x427c8d(++_0x328b50);}(_0x78b0,0x1e5));var _0x078b=function(_0x11aa0a,_0xa3c02a){_0x11aa0a=_0x11aa0a-0x0;var _0x442149=_0x78b0[_0x11aa0a];return _0x442149;};'use strict';var _=require(_0x078b('0x0'));var util=require(_0x078b('0x1'));var moment=require(_0x078b('0x2'));var BPromise=require(_0x078b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x078b('0x4'));var db=require(_0x078b('0x5'))['db'];var utils=require(_0x078b('0x6'));var logger=require(_0x078b('0x7'))(_0x078b('0x8'));var config=require(_0x078b('0x9'));var jayson=require(_0x078b('0xa'));var client=jayson[_0x078b('0xb')][_0x078b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b1531,_0x40d9c9,_0x3db2e8){return new BPromise(function(_0x3c9057,_0x39c595){return client[_0x078b('0xd')](_0x1b1531,_0x3db2e8)[_0x078b('0xe')](function(_0x215683){logger[_0x078b('0xf')](_0x078b('0x10'),_0x40d9c9,_0x078b('0x11'));logger[_0x078b('0x12')](_0x078b('0x13'),_0x40d9c9,_0x078b('0x11'),JSON[_0x078b('0x14')](_0x215683));if(_0x215683[_0x078b('0x15')]){if(_0x215683[_0x078b('0x15')][_0x078b('0x16')]===0x1f4){logger['error'](_0x078b('0x10'),_0x40d9c9,_0x215683['error']['message']);return _0x39c595(_0x215683['error'][_0x078b('0x17')]);}logger[_0x078b('0x15')](_0x078b('0x10'),_0x40d9c9,_0x215683[_0x078b('0x15')][_0x078b('0x17')]);return _0x3c9057(_0x215683[_0x078b('0x15')][_0x078b('0x17')]);}else{logger[_0x078b('0xf')](_0x078b('0x10'),_0x40d9c9,_0x078b('0x11'));_0x3c9057(_0x215683['result'][_0x078b('0x17')]);}})[_0x078b('0x18')](function(_0x344b90){logger[_0x078b('0x15')](_0x078b('0x10'),_0x40d9c9,_0x344b90);_0x39c595(_0x344b90);});});} \ No newline at end of file +var _0xff9a=['debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xff9a,0x101));var _0xaff9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xff9a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xaff9('0x0'));var util=require(_0xaff9('0x1'));var moment=require(_0xaff9('0x2'));var BPromise=require('bluebird');var rs=require(_0xaff9('0x3'));var fs=require('fs');var Redis=require(_0xaff9('0x4'));var db=require(_0xaff9('0x5'))['db'];var utils=require(_0xaff9('0x6'));var logger=require(_0xaff9('0x7'))(_0xaff9('0x8'));var config=require(_0xaff9('0x9'));var jayson=require(_0xaff9('0xa'));var client=jayson[_0xaff9('0xb')][_0xaff9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3841e6,_0x32f260,_0x455f3c){return new BPromise(function(_0x396e5b,_0xe154af){return client[_0xaff9('0xd')](_0x3841e6,_0x455f3c)[_0xaff9('0xe')](function(_0x4ec146){logger[_0xaff9('0xf')](_0xaff9('0x10'),_0x32f260,_0xaff9('0x11'));logger[_0xaff9('0x12')](_0xaff9('0x13'),_0x32f260,'request\x20sent',JSON[_0xaff9('0x14')](_0x4ec146));if(_0x4ec146[_0xaff9('0x15')]){if(_0x4ec146[_0xaff9('0x15')]['code']===0x1f4){logger[_0xaff9('0x15')](_0xaff9('0x10'),_0x32f260,_0x4ec146['error'][_0xaff9('0x16')]);return _0xe154af(_0x4ec146[_0xaff9('0x15')][_0xaff9('0x16')]);}logger[_0xaff9('0x15')](_0xaff9('0x10'),_0x32f260,_0x4ec146[_0xaff9('0x15')][_0xaff9('0x16')]);return _0x396e5b(_0x4ec146['error']['message']);}else{logger[_0xaff9('0xf')](_0xaff9('0x10'),_0x32f260,_0xaff9('0x11'));_0x396e5b(_0x4ec146[_0xaff9('0x17')][_0xaff9('0x16')]);}})[_0xaff9('0x18')](function(_0x440097){logger[_0xaff9('0x15')]('DeskField,\x20%s,\x20%s',_0x32f260,_0x440097);_0xe154af(_0x440097);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 30b197e..87c0dc6 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 _0x3c35=['show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x29b2c2,_0x4c8680){var _0x6bc5f5=function(_0x5a9f56){while(--_0x5a9f56){_0x29b2c2['push'](_0x29b2c2['shift']());}};_0x6bc5f5(++_0x4c8680);}(_0x3c35,0x71));var _0x53c3=function(_0x49fdbb,_0x55f5db){_0x49fdbb=_0x49fdbb-0x0;var _0x585d7e=_0x3c35[_0x49fdbb];return _0x585d7e;};'use strict';var multer=require(_0x53c3('0x0'));var util=require(_0x53c3('0x1'));var path=require(_0x53c3('0x2'));var timeout=require('connect-timeout');var express=require(_0x53c3('0x3'));var router=express[_0x53c3('0x4')]();var fs_extra=require(_0x53c3('0x5'));var auth=require(_0x53c3('0x6'));var interaction=require(_0x53c3('0x7'));var config=require(_0x53c3('0x8'));var controller=require('./intDynamics365Account.controller');router[_0x53c3('0x9')]('/',auth[_0x53c3('0xa')](),controller[_0x53c3('0xb')]);router['get']('/:id',auth[_0x53c3('0xa')](),controller[_0x53c3('0xc')]);router[_0x53c3('0x9')](_0x53c3('0xd'),auth[_0x53c3('0xa')](),controller[_0x53c3('0xe')]);router['get'](_0x53c3('0xf'),auth[_0x53c3('0xa')](),controller[_0x53c3('0x10')]);router[_0x53c3('0x11')]('/',auth[_0x53c3('0xa')](),controller[_0x53c3('0x12')]);router[_0x53c3('0x11')](_0x53c3('0xd'),auth['isAuthenticated'](),controller[_0x53c3('0x13')]);router[_0x53c3('0x14')](_0x53c3('0x15'),auth[_0x53c3('0xa')](),controller['update']);router[_0x53c3('0x16')]('/:id',auth[_0x53c3('0xa')](),controller[_0x53c3('0x17')]);module[_0x53c3('0x18')]=router; \ No newline at end of file +var _0xa4dd=['util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./intDynamics365Account.controller','isAuthenticated','index','/:id','get','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','delete','exports','multer'];(function(_0x43bc7e,_0x120993){var _0x27ed73=function(_0x461295){while(--_0x461295){_0x43bc7e['push'](_0x43bc7e['shift']());}};_0x27ed73(++_0x120993);}(_0xa4dd,0x1b7));var _0xda4d=function(_0x190ff6,_0x515cfd){_0x190ff6=_0x190ff6-0x0;var _0x5356d2=_0xa4dd[_0x190ff6];return _0x5356d2;};'use strict';var multer=require(_0xda4d('0x0'));var util=require(_0xda4d('0x1'));var path=require(_0xda4d('0x2'));var timeout=require(_0xda4d('0x3'));var express=require(_0xda4d('0x4'));var router=express['Router']();var fs_extra=require(_0xda4d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xda4d('0x6'));var config=require('../../config/environment');var controller=require(_0xda4d('0x7'));router['get']('/',auth[_0xda4d('0x8')](),controller[_0xda4d('0x9')]);router['get'](_0xda4d('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xda4d('0xb')](_0xda4d('0xc'),auth[_0xda4d('0x8')](),controller[_0xda4d('0xd')]);router[_0xda4d('0xb')](_0xda4d('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0xda4d('0xf')]('/',auth[_0xda4d('0x8')](),controller[_0xda4d('0x10')]);router[_0xda4d('0xf')]('/:id/configurations',auth[_0xda4d('0x8')](),controller[_0xda4d('0x11')]);router['put'](_0xda4d('0xa'),auth[_0xda4d('0x8')](),controller['update']);router[_0xda4d('0x12')](_0xda4d('0xa'),auth[_0xda4d('0x8')](),controller['destroy']);module[_0xda4d('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index aa828fc..96ecbcb 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 _0x4873=['exports','STRING','BOOLEAN','sequelize'];(function(_0x4c9218,_0xc12c02){var _0x3e303c=function(_0x2a0e83){while(--_0x2a0e83){_0x4c9218['push'](_0x4c9218['shift']());}};_0x3e303c(++_0xc12c02);}(_0x4873,0x1df));var _0x3487=function(_0x4f8200,_0x32b30c){_0x4f8200=_0x4f8200-0x0;var _0x4fce53=_0x4873[_0x4f8200];return _0x4fce53;};'use strict';var Sequelize=require(_0x3487('0x0'));module[_0x3487('0x1')]={'name':{'type':Sequelize[_0x3487('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x3487('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x3487('0x2')]},'clientSecret':{'type':Sequelize[_0x3487('0x2')]},'serverUrl':{'type':Sequelize[_0x3487('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3487('0x2')]},'modernAuthentication':{'type':Sequelize[_0x3487('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x24ce=['BOOLEAN','exports','STRING'];(function(_0x22bdc2,_0x2c9a4f){var _0x59e877=function(_0x1fb4bf){while(--_0x1fb4bf){_0x22bdc2['push'](_0x22bdc2['shift']());}};_0x59e877(++_0x2c9a4f);}(_0x24ce,0x1de));var _0xe24c=function(_0x4ec052,_0x21df8b){_0x4ec052=_0x4ec052-0x0;var _0x51b8e=_0x24ce[_0x4ec052];return _0x51b8e;};'use strict';var Sequelize=require('sequelize');module[_0xe24c('0x0')]={'name':{'type':Sequelize[_0xe24c('0x1')]},'username':{'type':Sequelize[_0xe24c('0x1')]},'password':{'type':Sequelize[_0xe24c('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xe24c('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe24c('0x1')]},'modernAuthentication':{'type':Sequelize[_0xe24c('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 ca20d73..0c73f77 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 _0x1312=['then','destroy','end','sendStatus','error','name','index','map','Dynamics365Account','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','find','create','body','getConfigurations','findOne','Dynamics365Configuration','AccountId','Subjects','getSubjects','type','getDescriptions','channel','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','description','ownerid','caseorigincode','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','username','GET','4.0','value','Bearer\x20','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','isNil','BooleanAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','all','test','statusCode','stack','send','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','UserLocalizedLabel','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set'];(function(_0x41b62a,_0x13d23e){var _0x429f38=function(_0x1d9198){while(--_0x1d9198){_0x41b62a['push'](_0x41b62a['shift']());}};_0x429f38(++_0x13d23e);}(_0x1312,0x167));var _0x2131=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0x1312[_0x46ae5a];return _0x434986;};'use strict';var rp=require(_0x2131('0x0'));var util=require(_0x2131('0x1'));var _=require(_0x2131('0x2'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x2131('0x3'));var db=require(_0x2131('0x4'))['db'];var integrations=require(_0x2131('0x5'));function respondWithResult(_0x4e5fa2,_0x1c52a4){_0x1c52a4=_0x1c52a4||0xc8;return function(_0xede53e){if(_0xede53e){return _0x4e5fa2[_0x2131('0x6')](_0x1c52a4)[_0x2131('0x7')](_0xede53e);}};}function respondWithFilteredResult(_0x49bce4,_0x1dafbe){return function(_0x6e6078){if(_0x6e6078){var _0x31b027=typeof _0x1dafbe[_0x2131('0x8')]===_0x2131('0x9')&&typeof _0x1dafbe[_0x2131('0xa')]===_0x2131('0x9');var _0x2db241=_0x6e6078[_0x2131('0xb')];var _0x29c518=_0x31b027?0x0:_0x1dafbe['offset'];var _0x428187=_0x31b027?_0x6e6078[_0x2131('0xb')]:_0x1dafbe['offset']+_0x1dafbe[_0x2131('0xa')];var _0x837159;if(_0x428187>=_0x2db241){_0x428187=_0x2db241;_0x837159=0xc8;}else{_0x837159=0xce;}_0x49bce4['status'](_0x837159);return _0x49bce4[_0x2131('0xc')]('Content-Range',_0x29c518+'-'+_0x428187+'/'+_0x2db241)[_0x2131('0x7')](_0x6e6078);}return null;};}function saveUpdates(_0x52dde5){return function(_0x5192df){if(_0x5192df){return _0x5192df['update'](_0x52dde5)[_0x2131('0xd')](function(_0x18f0f1){return _0x18f0f1;});}return null;};}function removeEntity(_0x4d08a0){return function(_0x6c8ec9){if(_0x6c8ec9){return _0x6c8ec9[_0x2131('0xe')]()[_0x2131('0xd')](function(){_0x4d08a0[_0x2131('0x6')](0xcc)[_0x2131('0xf')]();});}};}function handleEntityNotFound(_0x38dabd){return function(_0x584262){if(!_0x584262){_0x38dabd[_0x2131('0x10')](0x194);}return _0x584262;};}function handleError(_0x45c021,_0x17cf02){_0x17cf02=_0x17cf02||0x1f4;return function(_0x4f88b9){logger[_0x2131('0x11')](_0x4f88b9['stack']);if(_0x4f88b9[_0x2131('0x12')]){delete _0x4f88b9[_0x2131('0x12')];}_0x45c021[_0x2131('0x6')](_0x17cf02)['send'](_0x4f88b9);};}exports[_0x2131('0x13')]=function(_0x37de87,_0x395bf1){var _0x35d800={},_0x5e4f59={},_0x353a50={'count':0x0,'rows':[]};var _0x8d3de4=_[_0x2131('0x14')](db[_0x2131('0x15')][_0x2131('0x16')],function(_0x3ea32a){return{'name':_0x3ea32a[_0x2131('0x17')],'type':_0x3ea32a['type'][_0x2131('0x18')]};});_0x5e4f59['model']=_['map'](_0x8d3de4,_0x2131('0x12'));_0x5e4f59[_0x2131('0x19')]=_['keys'](_0x37de87[_0x2131('0x19')]);_0x5e4f59[_0x2131('0x1a')]=_[_0x2131('0x1b')](_0x5e4f59[_0x2131('0x1c')],_0x5e4f59[_0x2131('0x19')]);_0x35d800[_0x2131('0x1d')]=_['intersection'](_0x5e4f59[_0x2131('0x1c')],qs[_0x2131('0x1e')](_0x37de87['query']['fields']));_0x35d800['attributes']=_0x35d800[_0x2131('0x1d')][_0x2131('0x1f')]?_0x35d800['attributes']:_0x5e4f59[_0x2131('0x1c')];if(!_0x37de87[_0x2131('0x19')][_0x2131('0x20')](_0x2131('0x21'))){_0x35d800[_0x2131('0xa')]=qs[_0x2131('0xa')](_0x37de87['query'][_0x2131('0xa')]);_0x35d800[_0x2131('0x8')]=qs[_0x2131('0x8')](_0x37de87['query']['offset']);}_0x35d800[_0x2131('0x22')]=qs[_0x2131('0x23')](_0x37de87[_0x2131('0x19')][_0x2131('0x23')]);_0x35d800[_0x2131('0x24')]=qs[_0x2131('0x1a')](_[_0x2131('0x25')](_0x37de87['query'],_0x5e4f59[_0x2131('0x1a')]),_0x8d3de4);if(_0x37de87[_0x2131('0x19')][_0x2131('0x26')]){_0x35d800[_0x2131('0x24')]=_[_0x2131('0x27')](_0x35d800[_0x2131('0x24')],{'$or':_[_0x2131('0x14')](_0x8d3de4,function(_0x537d2f){if(_0x537d2f['type']!==_0x2131('0x28')){var _0x3c64ed={};_0x3c64ed[_0x537d2f[_0x2131('0x12')]]={'$like':'%'+_0x37de87['query'][_0x2131('0x26')]+'%'};return _0x3c64ed;}})});}_0x35d800=_[_0x2131('0x27')]({},_0x35d800,_0x37de87[_0x2131('0x29')]);var _0x250470={'where':_0x35d800[_0x2131('0x24')]};return db[_0x2131('0x15')][_0x2131('0xb')](_0x250470)[_0x2131('0xd')](function(_0x3ff493){_0x353a50[_0x2131('0xb')]=_0x3ff493;if(_0x37de87['query'][_0x2131('0x2a')]){_0x35d800['include']=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x35d800);})['then'](function(_0x404644){_0x353a50[_0x2131('0x2b')]=_0x404644;return _0x353a50;})['then'](respondWithFilteredResult(_0x395bf1,_0x35d800))[_0x2131('0x2c')](handleError(_0x395bf1,null));};exports[_0x2131('0x2d')]=function(_0x1d8afe,_0x31e8f5){var _0x4dd427={'raw':![],'where':{'id':_0x1d8afe[_0x2131('0x2e')]['id']}},_0x55aa24={};_0x55aa24[_0x2131('0x1c')]=_[_0x2131('0x2f')](db[_0x2131('0x15')][_0x2131('0x16')]);_0x55aa24['query']=_['keys'](_0x1d8afe[_0x2131('0x19')]);_0x55aa24['filters']=_[_0x2131('0x1b')](_0x55aa24[_0x2131('0x1c')],_0x55aa24[_0x2131('0x19')]);_0x4dd427[_0x2131('0x1d')]=_[_0x2131('0x1b')](_0x55aa24[_0x2131('0x1c')],qs[_0x2131('0x1e')](_0x1d8afe[_0x2131('0x19')][_0x2131('0x1e')]));_0x4dd427[_0x2131('0x1d')]=_0x4dd427[_0x2131('0x1d')][_0x2131('0x1f')]?_0x4dd427['attributes']:_0x55aa24['model'];if(_0x1d8afe[_0x2131('0x19')]['includeAll']){_0x4dd427['include']=[{'all':!![]}];}_0x4dd427=_['merge']({},_0x4dd427,_0x1d8afe['options']);return db['Dynamics365Account'][_0x2131('0x30')](_0x4dd427)[_0x2131('0xd')](handleEntityNotFound(_0x31e8f5,null))[_0x2131('0xd')](respondWithResult(_0x31e8f5,null))['catch'](handleError(_0x31e8f5,null));};exports['create']=function(_0x46e7b0,_0x49b919){return db[_0x2131('0x15')][_0x2131('0x31')](_0x46e7b0['body'],{})[_0x2131('0xd')](respondWithResult(_0x49b919,0xc9))['catch'](handleError(_0x49b919,null));};exports['update']=function(_0x80b9fc,_0x34bdbf){if(_0x80b9fc[_0x2131('0x32')]['id']){delete _0x80b9fc[_0x2131('0x32')]['id'];}return db[_0x2131('0x15')]['find']({'where':{'id':_0x80b9fc['params']['id']}})['then'](handleEntityNotFound(_0x34bdbf,null))[_0x2131('0xd')](saveUpdates(_0x80b9fc[_0x2131('0x32')],null))[_0x2131('0xd')](respondWithResult(_0x34bdbf,null))[_0x2131('0x2c')](handleError(_0x34bdbf,null));};exports[_0x2131('0xe')]=function(_0x1774c0,_0x523dc2){return db[_0x2131('0x15')][_0x2131('0x30')]({'where':{'id':_0x1774c0[_0x2131('0x2e')]['id']}})[_0x2131('0xd')](handleEntityNotFound(_0x523dc2,null))[_0x2131('0xd')](removeEntity(_0x523dc2,null))[_0x2131('0x2c')](handleError(_0x523dc2,null));};exports[_0x2131('0x33')]=function(_0x5532a4,_0x1c6fd7){var _0x4d8996={};var _0x4e9c33={};var _0x381a8c;var _0x5d0bbd;return db[_0x2131('0x15')][_0x2131('0x34')]({'where':{'id':_0x5532a4['params']['id']}})[_0x2131('0xd')](handleEntityNotFound(_0x1c6fd7,null))[_0x2131('0xd')](function(_0x3db468){if(_0x3db468){_0x381a8c=_0x3db468;_0x4e9c33[_0x2131('0x1c')]=_[_0x2131('0x2f')](db[_0x2131('0x35')][_0x2131('0x16')]);_0x4e9c33[_0x2131('0x19')]=_[_0x2131('0x2f')](_0x5532a4['query']);_0x4e9c33['filters']=_[_0x2131('0x1b')](_0x4e9c33[_0x2131('0x1c')],_0x4e9c33[_0x2131('0x19')]);_0x4d8996[_0x2131('0x1d')]=_[_0x2131('0x1b')](_0x4e9c33[_0x2131('0x1c')],qs[_0x2131('0x1e')](_0x5532a4[_0x2131('0x19')][_0x2131('0x1e')]));_0x4d8996['attributes']=_0x4d8996['attributes'][_0x2131('0x1f')]?_0x4d8996['attributes']:_0x4e9c33[_0x2131('0x1c')];_0x4d8996[_0x2131('0x22')]=qs[_0x2131('0x23')](_0x5532a4[_0x2131('0x19')][_0x2131('0x23')]);_0x4d8996[_0x2131('0x24')]=qs['filters'](_[_0x2131('0x25')](_0x5532a4[_0x2131('0x19')],_0x4e9c33[_0x2131('0x1a')]));if(_0x5532a4[_0x2131('0x19')][_0x2131('0x26')]){_0x4d8996[_0x2131('0x24')]=_[_0x2131('0x27')](_0x4d8996[_0x2131('0x24')],{'$or':_[_0x2131('0x14')](_0x4d8996['attributes'],function(_0x43d0ca){var _0xefd5a7={};_0xefd5a7[_0x43d0ca]={'$like':'%'+_0x5532a4['query']['filter']+'%'};return _0xefd5a7;})});}_0x4d8996=_[_0x2131('0x27')]({},_0x4d8996,_0x5532a4[_0x2131('0x29')]);return _0x381a8c[_0x2131('0x33')](_0x4d8996);}})[_0x2131('0xd')](function(_0xd000c4){if(_0xd000c4){_0x5d0bbd=_0xd000c4['length'];if(!_0x5532a4[_0x2131('0x19')][_0x2131('0x20')](_0x2131('0x21'))){_0x4d8996[_0x2131('0xa')]=qs['limit'](_0x5532a4[_0x2131('0x19')][_0x2131('0xa')]);_0x4d8996[_0x2131('0x8')]=qs['offset'](_0x5532a4['query'][_0x2131('0x8')]);}return _0x381a8c[_0x2131('0x33')](_0x4d8996);}})[_0x2131('0xd')](function(_0x7344ad){if(_0x7344ad){return _0x7344ad?{'count':_0x5d0bbd,'rows':_0x7344ad}:null;}})['then'](respondWithResult(_0x1c6fd7,null))[_0x2131('0x2c')](handleError(_0x1c6fd7,null));};exports['addConfiguration']=function(_0x1ab32e,_0x450ffe){if(_0x1ab32e[_0x2131('0x32')]['id']){delete _0x1ab32e[_0x2131('0x32')]['id'];}return db['Dynamics365Account'][_0x2131('0x34')]({'where':{'id':_0x1ab32e[_0x2131('0x2e')]['id']}})[_0x2131('0xd')](handleEntityNotFound(_0x450ffe,null))[_0x2131('0xd')](function(_0x201e88){if(_0x201e88){_0x1ab32e[_0x2131('0x32')][_0x2131('0x36')]=_0x201e88['id'];_0x1ab32e[_0x2131('0x32')][_0x2131('0x37')]=integrations[_0x2131('0x38')](_0x1ab32e[_0x2131('0x32')]['channel'],_0x1ab32e['body'][_0x2131('0x39')]);_0x1ab32e[_0x2131('0x32')]['Descriptions']=integrations[_0x2131('0x3a')](_0x1ab32e[_0x2131('0x32')][_0x2131('0x3b')],_0x1ab32e['body'][_0x2131('0x39')]);return db[_0x2131('0x35')][_0x2131('0x31')](_0x1ab32e['body'],{'include':[{'model':db[_0x2131('0x3c')],'as':_0x2131('0x37')},{'model':db['Dynamics365Field'],'as':_0x2131('0x3d')}]});}return null;})[_0x2131('0xd')](respondWithResult(_0x450ffe,null))[_0x2131('0x2c')](handleError(_0x450ffe,null));};function sanitizeRemoteUri(_0x4c24a3){var _0x12f13c=_0x4c24a3[_0x2131('0x3e')](-0x1);if(_0x12f13c==='/')return _0x4c24a3[_0x2131('0x3f')](0x0,_0x4c24a3[_0x2131('0x40')](_0x12f13c));return _0x4c24a3;}function getWebApiUrl(_0x31d614){return util['format'](_0x2131('0x41'),_0x31d614);}exports[_0x2131('0x42')]=function(_0x3ae0dc,_0x2d37f1){var _0x577439=_0x3ae0dc['query'][_0x2131('0x43')];var _0x37e7c6=_0x577439===_0x2131('0x44')?_0x2131('0x45'):_0x2131('0x46');var _0x19561f='';var _0x17f382='';var _0x2f027f='';var _0xd4540e='';var _0x11b815='';var _0x144f70='';var _0x28fe0c='';var _0x31fca4='';var _0x15d2fa=['title',_0x2131('0x47'),'customerid',_0x2131('0x48'),_0x2131('0x49'),'subject',_0x2131('0x4a'),_0x2131('0x4b'),'directioncode',_0x2131('0x4c')];var _0x2848b9=[_0x2131('0x4d'),_0x2131('0x4e'),_0x2131('0x4f'),_0x2131('0x50'),_0x2131('0x51'),'contactidyominame','contractdetailidname',_0x2131('0x52'),_0x2131('0x53'),_0x2131('0x54'),'createdbyname',_0x2131('0x55'),_0x2131('0x56'),'createdonbehalfbyname',_0x2131('0x57'),'customeridname',_0x2131('0x58'),_0x2131('0x59'),_0x2131('0x5a'),'entitlementidname','entityimage_timestamp',_0x2131('0x5b'),'escalatedon',_0x2131('0x5c'),_0x2131('0x5d'),_0x2131('0x5e'),_0x2131('0x5f'),_0x2131('0x60'),_0x2131('0x61'),_0x2131('0x62'),_0x2131('0x63'),'modifiedbyexternalpartyname',_0x2131('0x64'),_0x2131('0x65'),_0x2131('0x66'),_0x2131('0x67'),'modifiedonbehalfbyname',_0x2131('0x68'),_0x2131('0x69'),'msdyn_iotalertname','numberofchildincidents',_0x2131('0x6a'),_0x2131('0x6b'),_0x2131('0x6c'),_0x2131('0x6d'),_0x2131('0x6e'),_0x2131('0x6f'),_0x2131('0x70'),'primarycontactidyominame',_0x2131('0x71'),_0x2131('0x72'),_0x2131('0x73'),_0x2131('0x74'),_0x2131('0x75'),'responseby',_0x2131('0x76'),_0x2131('0x77'),_0x2131('0x78'),_0x2131('0x79'),_0x2131('0x7a'),_0x2131('0x7b'),_0x2131('0x7c'),_0x2131('0x7d'),_0x2131('0x7e'),_0x2131('0x7f'),_0x2131('0x80'),_0x2131('0x81'),_0x2131('0x82'),_0x2131('0x83'),'versionnumber'];var _0x201e96=_0x15d2fa[_0x2131('0x84')](_0x2848b9);return db[_0x2131('0x15')][_0x2131('0x34')]({'where':{'id':_0x3ae0dc['params']['id']},'attributes':['id','username',_0x2131('0x85'),_0x2131('0x86'),_0x2131('0x87'),_0x2131('0x88'),_0x2131('0x89'),_0x2131('0x8a')],'include':[{'model':db[_0x2131('0x8b')],'as':'CloudProvider','attributes':['id',_0x2131('0x8c'),_0x2131('0x8d')]}]})[_0x2131('0xd')](handleEntityNotFound(_0x2d37f1,null))[_0x2131('0xd')](function(_0x536e82){if(_0x536e82){if(_0x536e82[_0x2131('0x8a')]){_0x536e82[_0x2131('0x8e')]=_0x536e82[_0x2131('0x8b')][_0x2131('0x8c')];_0x31fca4=sanitizeRemoteUri(_0x536e82[_0x2131('0x8b')][_0x2131('0x8d')]);_0x28fe0c=getWebApiUrl(_0x31fca4);return _0x536e82;}_0x31fca4=sanitizeRemoteUri(_0x536e82['remoteUri']);_0x28fe0c=getWebApiUrl(_0x31fca4);var _0x5be236={'method':_0x2131('0x8f'),'uri':_0x2131('0x90')+_0x536e82[_0x2131('0x87')]+'/oauth2/token','form':{'client_id':_0x536e82['clientId'],'resource':_0x31fca4,'username':_0x536e82[_0x2131('0x91')],'password':_0x536e82[_0x2131('0x85')],'grant_type':_0x2131('0x85'),'client_secret':_0x536e82['clientSecret']},'json':!![]};return rp(_0x5be236);}})[_0x2131('0xd')](function(_0x375ad2){_0x144f70=_0x375ad2[_0x2131('0x8e')];var _0x5e134d={'method':_0x2131('0x92'),'uri':encodeURI(_0x28fe0c+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x37e7c6+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x144f70,'If-None-Match':null,'OData-Version':_0x2131('0x93')},'json':!![]};return rp(_0x5e134d);})[_0x2131('0xd')](function(_0xb681c3){var _0x357ac9=_0xb681c3[_0x2131('0x94')][0x0];var _0x25b007=_0x357ac9['MetadataId'];var _0x544c76={'method':_0x2131('0x92'),'uri':_0x28fe0c+'EntityDefinitions('+_0x25b007+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x2131('0x95')+_0x144f70,'If-None-Match':null,'OData-Version':_0x2131('0x93')},'json':!![]};return rp(_0x544c76);})[_0x2131('0xd')](function(_0x3251cf){_0x19561f=_0x3251cf;_0x17f382=_0x19561f[_0x2131('0x96')];_0x17f382=_[_0x2131('0x97')](_0x17f382,function(_0x43a211){return!_0x201e96[_0x2131('0x98')](_0x43a211[_0x2131('0x99')]);});var _0x493ec6=[];var _0x313e57=[];_0x17f382[_0x2131('0x9a')](function(_0x33d5b5){if(_0x33d5b5[_0x2131('0x9b')]){var _0x273ff5=_0x33d5b5[_0x2131('0x9b')][_0x2131('0x3f')](_0x33d5b5[_0x2131('0x9b')][_0x2131('0x40')]('.')+0x1);if(_0x273ff5===_0x2131('0x9c')){_0x493ec6[_0x2131('0x9d')](getSelectList(_0x28fe0c,_0x577439,_0x313e57,_0x19561f[_0x2131('0x9e')],_0x33d5b5[_0x2131('0x9e')],_0x144f70));}}});return Promise['all'](_0x493ec6);})[_0x2131('0xd')](function(_0x11bfd1){_0x2f027f=_0x11bfd1[0x0];var _0x39126a=[];var _0x4dad00=[];_0x17f382[_0x2131('0x9a')](function(_0xbc6e64){if(!_[_0x2131('0x9f')](_0xbc6e64[_0x2131('0x9b')])){var _0x4350ee=_0xbc6e64[_0x2131('0x9b')][_0x2131('0x3f')](_0xbc6e64[_0x2131('0x9b')][_0x2131('0x40')]('.')+0x1);if(_0x4350ee===_0x2131('0xa0')){_0x39126a['push'](getBooleanList(_0x28fe0c,_0x577439,_0x4dad00,_0x19561f['MetadataId'],_0xbc6e64[_0x2131('0x9e')],_0x144f70));}}});return Promise['all'](_0x39126a);})[_0x2131('0xd')](function(_0x25a4dc){_0xd4540e=_0x25a4dc[0x0];var _0x2282c7=[];var _0x4ea9af=[];_0x17f382[_0x2131('0x9a')](function(_0x58c23e){if(_0x58c23e[_0x2131('0x9b')]){var _0x544a71=_0x58c23e['@odata.type'][_0x2131('0x3f')](_0x58c23e[_0x2131('0x9b')][_0x2131('0x40')]('.')+0x1);if(_0x544a71==='StringAttributeMetadata'||_0x544a71===_0x2131('0xa1')||_0x544a71==='BigIntAttributeMetadata'||_0x544a71===_0x2131('0xa2')||_0x544a71===_0x2131('0xa3')||_0x544a71===_0x2131('0xa4')||_0x544a71==='StatusAttributeMetadata'||_0x544a71===_0x2131('0xa5')||_0x544a71===_0x2131('0xa6')||_0x544a71==='DecimalAttributeMetadata'){_0x2282c7[_0x2131('0x9d')](getInputList(_0x28fe0c,_0x577439,_0x544a71,_0x4ea9af,_0x19561f[_0x2131('0x9e')],_0x58c23e[_0x2131('0x9e')],_0x144f70));}}});return Promise[_0x2131('0xa7')](_0x2282c7);})['then'](function(_0x41c111){_0x11b815=_0x41c111[0x0];var _0x4026ca=_0x2f027f[_0x2131('0x84')](_0xd4540e)[_0x2131('0x84')](_0x11b815);var _0x3cc411={'count':_0x4026ca[_0x2131('0x1f')],'rows':_0x4026ca};return _0x3cc411;})['then'](respondWithResult(_0x2d37f1,null))[_0x2131('0x2c')](function(_0x2eaeec){var _0x2dd603=_0x3ae0dc[_0x2131('0x19')][_0x2131('0xa8')]?0x1f4:_0x2eaeec[_0x2131('0xa9')]||0x1f4;logger['error'](_0x2eaeec[_0x2131('0xaa')]);delete _0x2eaeec[_0x2131('0x12')];if(_0x2dd603===0x191){_0x2dd603=0x190;}_0x2d37f1[_0x2131('0x6')](_0x2dd603)[_0x2131('0xab')](_0x3ae0dc[_0x2131('0x19')][_0x2131('0xa8')]?{'message':'Wrong\x20credentials','statusCode':_0x2eaeec[_0x2131('0xa9')]}:_0x2eaeec);});};function getSelectList(_0xc7f82f,_0x5f1e2d,_0x2cf109,_0x25b495,_0xfd5a36,_0x415ccc){var _0x572585={'method':'GET','uri':_0xc7f82f+_0x2131('0xac')+_0x25b495+_0x2131('0xad')+_0xfd5a36+_0x2131('0xae')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x2131('0x95')+_0x415ccc,'If-None-Match':null,'OData-Version':_0x2131('0x93')},'json':!![]};return rp(_0x572585)['then'](function(_0x1a6eef){var _0x5aba62=[];var _0xfcd99d=_0x1a6eef[_0x2131('0xaf')][_0x2131('0xb0')];_0xfcd99d['forEach'](function(_0x56d5c1){_0x5aba62[_0x2131('0x9d')]({'name':_0x56d5c1[_0x2131('0xb1')]['UserLocalizedLabel'][_0x2131('0xb1')],'value':String(_0x56d5c1[_0x2131('0xb2')])});});var _0x3cb01b={'id':_0x5f1e2d+'_'+_0x1a6eef[_0x2131('0x99')],'name':_0x1a6eef[_0x2131('0xb3')]['UserLocalizedLabel'][_0x2131('0xb1')],'custom':![],'options':_0x5aba62};_0x2cf109[_0x2131('0x9d')](_0x3cb01b);return _0x2cf109;});}function getBooleanList(_0x43ccff,_0x55bfe1,_0x1450ec,_0x24dca2,_0x451bf,_0x2942fa){var _0x79d51f={'method':'GET','uri':_0x43ccff+_0x2131('0xac')+_0x24dca2+')/Attributes('+_0x451bf+_0x2131('0xb4'),'headers':{'Authorization':_0x2131('0x95')+_0x2942fa,'If-None-Match':null,'OData-Version':_0x2131('0x93')},'json':!![]};return rp(_0x79d51f)[_0x2131('0xd')](function(_0x2741d3){var _0x55e3d2=[];_0x55e3d2[_0x2131('0x9d')]({'name':_0x2741d3[_0x2131('0xaf')]['TrueOption'][_0x2131('0xb1')][_0x2131('0xb5')][_0x2131('0xb1')],'value':_0x2131('0xb6')},{'name':_0x2741d3[_0x2131('0xaf')]['FalseOption'][_0x2131('0xb1')]['UserLocalizedLabel']['Label'],'value':_0x2131('0xb7')});var _0x32303c={'id':_0x55bfe1+'_'+_0x2741d3[_0x2131('0x99')],'name':_0x2741d3['DisplayName'][_0x2131('0xb5')][_0x2131('0xb1')],'custom':![],'options':_0x55e3d2};_0x1450ec[_0x2131('0x9d')](_0x32303c);return _0x1450ec;});}function getInputList(_0x19dcc0,_0x8edd4b,_0x2aaf9b,_0x57e4e8,_0x47da3d,_0x58329e,_0x24d006){var _0x5711f4={'method':_0x2131('0x92'),'uri':_0x19dcc0+_0x2131('0xac')+_0x47da3d+_0x2131('0xad')+_0x58329e+_0x2131('0xb8')+_0x2aaf9b+_0x2131('0xb9'),'headers':{'Authorization':_0x2131('0x95')+_0x24d006,'If-None-Match':null,'OData-Version':_0x2131('0x93')},'json':!![]};return rp(_0x5711f4)[_0x2131('0xd')](function(_0x397188){var _0x25cd91={'id':_0x8edd4b+'_'+_0x397188[_0x2131('0x99')],'name':_0x397188[_0x2131('0xb3')][_0x2131('0xb5')]?_0x397188[_0x2131('0xb3')][_0x2131('0xb5')][_0x2131('0xb1')]:_0x397188['LogicalName'],'custom':![],'options':[]};_0x57e4e8[_0x2131('0x9d')](_0x25cd91);return _0x57e4e8;});} \ No newline at end of file +var _0xe3f5=['createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridtype','primarycontactidyominame','productidname','resolveby','resolvebykpiidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','socialprofileidname','statecode','statuscode','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','remoteUri','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','clientId','password','clientSecret','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','all','isNil','BooleanAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','push','test','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','UserLocalizedLabel','Label','Value','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','request-promise','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status','offset','undefined','limit','set','Content-Range','json','then','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','count','includeAll','rows','show','params','include','merge','find','catch','create','body','update','getConfigurations','findOne','Dynamics365Configuration','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','format','getFields','ticketType','PhoneCall','description','caseorigincode','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xe3f5,0x118));var _0x5e3f=function(_0x342686,_0x5614ea){_0x342686=_0x342686-0x0;var _0x144f4c=_0xe3f5[_0x342686];return _0x144f4c;};'use strict';var rp=require(_0x5e3f('0x0'));var util=require('util');var _=require(_0x5e3f('0x1'));var qs=require(_0x5e3f('0x2'));var logger=require(_0x5e3f('0x3'))(_0x5e3f('0x4'));var db=require(_0x5e3f('0x5'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x7410c6,_0x5e4fd5){_0x5e4fd5=_0x5e4fd5||0xc8;return function(_0x2243e2){if(_0x2243e2){return _0x7410c6[_0x5e3f('0x6')](_0x5e4fd5)['json'](_0x2243e2);}};}function respondWithFilteredResult(_0x45913c,_0x55d06f){return function(_0x259d81){if(_0x259d81){var _0x16b6bb=typeof _0x55d06f[_0x5e3f('0x7')]===_0x5e3f('0x8')&&typeof _0x55d06f['limit']===_0x5e3f('0x8');var _0x1b4bfe=_0x259d81['count'];var _0x3143c3=_0x16b6bb?0x0:_0x55d06f['offset'];var _0x67945a=_0x16b6bb?_0x259d81['count']:_0x55d06f['offset']+_0x55d06f[_0x5e3f('0x9')];var _0x323e0f;if(_0x67945a>=_0x1b4bfe){_0x67945a=_0x1b4bfe;_0x323e0f=0xc8;}else{_0x323e0f=0xce;}_0x45913c[_0x5e3f('0x6')](_0x323e0f);return _0x45913c[_0x5e3f('0xa')](_0x5e3f('0xb'),_0x3143c3+'-'+_0x67945a+'/'+_0x1b4bfe)[_0x5e3f('0xc')](_0x259d81);}return null;};}function saveUpdates(_0x3774c8){return function(_0x34bf26){if(_0x34bf26){return _0x34bf26['update'](_0x3774c8)[_0x5e3f('0xd')](function(_0x153aee){return _0x153aee;});}return null;};}function removeEntity(_0x3bce1f){return function(_0x3c7427){if(_0x3c7427){return _0x3c7427[_0x5e3f('0xe')]()[_0x5e3f('0xd')](function(){_0x3bce1f[_0x5e3f('0x6')](0xcc)[_0x5e3f('0xf')]();});}};}function handleEntityNotFound(_0x506780){return function(_0x3e15e2){if(!_0x3e15e2){_0x506780[_0x5e3f('0x10')](0x194);}return _0x3e15e2;};}function handleError(_0x174af6,_0x47f657){_0x47f657=_0x47f657||0x1f4;return function(_0x14f830){logger[_0x5e3f('0x11')](_0x14f830[_0x5e3f('0x12')]);if(_0x14f830[_0x5e3f('0x13')]){delete _0x14f830['name'];}_0x174af6[_0x5e3f('0x6')](_0x47f657)[_0x5e3f('0x14')](_0x14f830);};}exports[_0x5e3f('0x15')]=function(_0x4a4421,_0x335b36){var _0x5a5466={},_0x5b4169={},_0x25a8cc={'count':0x0,'rows':[]};var _0x2b6d7c=_[_0x5e3f('0x16')](db[_0x5e3f('0x17')][_0x5e3f('0x18')],function(_0x1f870e){return{'name':_0x1f870e[_0x5e3f('0x19')],'type':_0x1f870e[_0x5e3f('0x1a')]['key']};});_0x5b4169[_0x5e3f('0x1b')]=_[_0x5e3f('0x16')](_0x2b6d7c,_0x5e3f('0x13'));_0x5b4169['query']=_[_0x5e3f('0x1c')](_0x4a4421['query']);_0x5b4169[_0x5e3f('0x1d')]=_[_0x5e3f('0x1e')](_0x5b4169[_0x5e3f('0x1b')],_0x5b4169[_0x5e3f('0x1f')]);_0x5a5466[_0x5e3f('0x20')]=_[_0x5e3f('0x1e')](_0x5b4169[_0x5e3f('0x1b')],qs[_0x5e3f('0x21')](_0x4a4421['query'][_0x5e3f('0x21')]));_0x5a5466['attributes']=_0x5a5466[_0x5e3f('0x20')][_0x5e3f('0x22')]?_0x5a5466[_0x5e3f('0x20')]:_0x5b4169[_0x5e3f('0x1b')];if(!_0x4a4421[_0x5e3f('0x1f')][_0x5e3f('0x23')](_0x5e3f('0x24'))){_0x5a5466['limit']=qs[_0x5e3f('0x9')](_0x4a4421[_0x5e3f('0x1f')][_0x5e3f('0x9')]);_0x5a5466[_0x5e3f('0x7')]=qs['offset'](_0x4a4421[_0x5e3f('0x1f')][_0x5e3f('0x7')]);}_0x5a5466[_0x5e3f('0x25')]=qs[_0x5e3f('0x26')](_0x4a4421[_0x5e3f('0x1f')][_0x5e3f('0x26')]);_0x5a5466[_0x5e3f('0x27')]=qs[_0x5e3f('0x1d')](_[_0x5e3f('0x28')](_0x4a4421[_0x5e3f('0x1f')],_0x5b4169[_0x5e3f('0x1d')]),_0x2b6d7c);if(_0x4a4421[_0x5e3f('0x1f')]['filter']){_0x5a5466['where']=_['merge'](_0x5a5466[_0x5e3f('0x27')],{'$or':_['map'](_0x2b6d7c,function(_0x485837){if(_0x485837[_0x5e3f('0x1a')]!==_0x5e3f('0x29')){var _0x1ad016={};_0x1ad016[_0x485837[_0x5e3f('0x13')]]={'$like':'%'+_0x4a4421[_0x5e3f('0x1f')][_0x5e3f('0x2a')]+'%'};return _0x1ad016;}})});}_0x5a5466=_['merge']({},_0x5a5466,_0x4a4421[_0x5e3f('0x2b')]);var _0x1be86c={'where':_0x5a5466['where']};return db['Dynamics365Account']['count'](_0x1be86c)['then'](function(_0x165ca1){_0x25a8cc[_0x5e3f('0x2c')]=_0x165ca1;if(_0x4a4421[_0x5e3f('0x1f')][_0x5e3f('0x2d')]){_0x5a5466['include']=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x5a5466);})[_0x5e3f('0xd')](function(_0x2f91f7){_0x25a8cc[_0x5e3f('0x2e')]=_0x2f91f7;return _0x25a8cc;})[_0x5e3f('0xd')](respondWithFilteredResult(_0x335b36,_0x5a5466))['catch'](handleError(_0x335b36,null));};exports[_0x5e3f('0x2f')]=function(_0x2f0b8c,_0x5a6c6b){var _0x3b3e0={'raw':![],'where':{'id':_0x2f0b8c[_0x5e3f('0x30')]['id']}},_0x223bf4={};_0x223bf4[_0x5e3f('0x1b')]=_[_0x5e3f('0x1c')](db[_0x5e3f('0x17')]['rawAttributes']);_0x223bf4['query']=_[_0x5e3f('0x1c')](_0x2f0b8c[_0x5e3f('0x1f')]);_0x223bf4[_0x5e3f('0x1d')]=_[_0x5e3f('0x1e')](_0x223bf4[_0x5e3f('0x1b')],_0x223bf4[_0x5e3f('0x1f')]);_0x3b3e0['attributes']=_[_0x5e3f('0x1e')](_0x223bf4[_0x5e3f('0x1b')],qs['fields'](_0x2f0b8c[_0x5e3f('0x1f')][_0x5e3f('0x21')]));_0x3b3e0['attributes']=_0x3b3e0[_0x5e3f('0x20')]['length']?_0x3b3e0[_0x5e3f('0x20')]:_0x223bf4[_0x5e3f('0x1b')];if(_0x2f0b8c[_0x5e3f('0x1f')][_0x5e3f('0x2d')]){_0x3b3e0[_0x5e3f('0x31')]=[{'all':!![]}];}_0x3b3e0=_[_0x5e3f('0x32')]({},_0x3b3e0,_0x2f0b8c[_0x5e3f('0x2b')]);return db['Dynamics365Account'][_0x5e3f('0x33')](_0x3b3e0)[_0x5e3f('0xd')](handleEntityNotFound(_0x5a6c6b,null))['then'](respondWithResult(_0x5a6c6b,null))[_0x5e3f('0x34')](handleError(_0x5a6c6b,null));};exports[_0x5e3f('0x35')]=function(_0xa82e7d,_0x3cd1a1){return db[_0x5e3f('0x17')][_0x5e3f('0x35')](_0xa82e7d[_0x5e3f('0x36')],{})[_0x5e3f('0xd')](respondWithResult(_0x3cd1a1,0xc9))[_0x5e3f('0x34')](handleError(_0x3cd1a1,null));};exports[_0x5e3f('0x37')]=function(_0x4cf9dc,_0x340bf5){if(_0x4cf9dc[_0x5e3f('0x36')]['id']){delete _0x4cf9dc[_0x5e3f('0x36')]['id'];}return db['Dynamics365Account'][_0x5e3f('0x33')]({'where':{'id':_0x4cf9dc[_0x5e3f('0x30')]['id']}})[_0x5e3f('0xd')](handleEntityNotFound(_0x340bf5,null))['then'](saveUpdates(_0x4cf9dc[_0x5e3f('0x36')],null))['then'](respondWithResult(_0x340bf5,null))['catch'](handleError(_0x340bf5,null));};exports[_0x5e3f('0xe')]=function(_0x260401,_0x4583a2){return db[_0x5e3f('0x17')]['find']({'where':{'id':_0x260401[_0x5e3f('0x30')]['id']}})[_0x5e3f('0xd')](handleEntityNotFound(_0x4583a2,null))[_0x5e3f('0xd')](removeEntity(_0x4583a2,null))[_0x5e3f('0x34')](handleError(_0x4583a2,null));};exports[_0x5e3f('0x38')]=function(_0x1839c5,_0x281847){var _0x1b68f5={};var _0x31a99a={};var _0x557e51;var _0x14da33;return db[_0x5e3f('0x17')][_0x5e3f('0x39')]({'where':{'id':_0x1839c5[_0x5e3f('0x30')]['id']}})[_0x5e3f('0xd')](handleEntityNotFound(_0x281847,null))[_0x5e3f('0xd')](function(_0x518429){if(_0x518429){_0x557e51=_0x518429;_0x31a99a['model']=_[_0x5e3f('0x1c')](db[_0x5e3f('0x3a')][_0x5e3f('0x18')]);_0x31a99a['query']=_['keys'](_0x1839c5[_0x5e3f('0x1f')]);_0x31a99a[_0x5e3f('0x1d')]=_['intersection'](_0x31a99a[_0x5e3f('0x1b')],_0x31a99a['query']);_0x1b68f5['attributes']=_[_0x5e3f('0x1e')](_0x31a99a[_0x5e3f('0x1b')],qs[_0x5e3f('0x21')](_0x1839c5[_0x5e3f('0x1f')][_0x5e3f('0x21')]));_0x1b68f5[_0x5e3f('0x20')]=_0x1b68f5[_0x5e3f('0x20')][_0x5e3f('0x22')]?_0x1b68f5['attributes']:_0x31a99a[_0x5e3f('0x1b')];_0x1b68f5[_0x5e3f('0x25')]=qs[_0x5e3f('0x26')](_0x1839c5[_0x5e3f('0x1f')][_0x5e3f('0x26')]);_0x1b68f5[_0x5e3f('0x27')]=qs[_0x5e3f('0x1d')](_[_0x5e3f('0x28')](_0x1839c5[_0x5e3f('0x1f')],_0x31a99a[_0x5e3f('0x1d')]));if(_0x1839c5['query'][_0x5e3f('0x2a')]){_0x1b68f5[_0x5e3f('0x27')]=_[_0x5e3f('0x32')](_0x1b68f5[_0x5e3f('0x27')],{'$or':_['map'](_0x1b68f5[_0x5e3f('0x20')],function(_0x2aa848){var _0x2cadfe={};_0x2cadfe[_0x2aa848]={'$like':'%'+_0x1839c5[_0x5e3f('0x1f')][_0x5e3f('0x2a')]+'%'};return _0x2cadfe;})});}_0x1b68f5=_[_0x5e3f('0x32')]({},_0x1b68f5,_0x1839c5['options']);return _0x557e51['getConfigurations'](_0x1b68f5);}})['then'](function(_0x26e4df){if(_0x26e4df){_0x14da33=_0x26e4df[_0x5e3f('0x22')];if(!_0x1839c5[_0x5e3f('0x1f')][_0x5e3f('0x23')](_0x5e3f('0x24'))){_0x1b68f5[_0x5e3f('0x9')]=qs[_0x5e3f('0x9')](_0x1839c5[_0x5e3f('0x1f')][_0x5e3f('0x9')]);_0x1b68f5[_0x5e3f('0x7')]=qs[_0x5e3f('0x7')](_0x1839c5[_0x5e3f('0x1f')]['offset']);}return _0x557e51['getConfigurations'](_0x1b68f5);}})[_0x5e3f('0xd')](function(_0x49aa77){if(_0x49aa77){return _0x49aa77?{'count':_0x14da33,'rows':_0x49aa77}:null;}})['then'](respondWithResult(_0x281847,null))[_0x5e3f('0x34')](handleError(_0x281847,null));};exports['addConfiguration']=function(_0x321a9e,_0x7208e8){if(_0x321a9e[_0x5e3f('0x36')]['id']){delete _0x321a9e[_0x5e3f('0x36')]['id'];}return db[_0x5e3f('0x17')][_0x5e3f('0x39')]({'where':{'id':_0x321a9e[_0x5e3f('0x30')]['id']}})[_0x5e3f('0xd')](handleEntityNotFound(_0x7208e8,null))[_0x5e3f('0xd')](function(_0x185268){if(_0x185268){_0x321a9e['body']['AccountId']=_0x185268['id'];_0x321a9e[_0x5e3f('0x36')][_0x5e3f('0x3b')]=integrations[_0x5e3f('0x3c')](_0x321a9e[_0x5e3f('0x36')][_0x5e3f('0x3d')],_0x321a9e[_0x5e3f('0x36')][_0x5e3f('0x1a')]);_0x321a9e['body']['Descriptions']=integrations[_0x5e3f('0x3e')](_0x321a9e[_0x5e3f('0x36')]['channel'],_0x321a9e[_0x5e3f('0x36')][_0x5e3f('0x1a')]);return db[_0x5e3f('0x3a')][_0x5e3f('0x35')](_0x321a9e[_0x5e3f('0x36')],{'include':[{'model':db[_0x5e3f('0x3f')],'as':_0x5e3f('0x3b')},{'model':db['Dynamics365Field'],'as':_0x5e3f('0x40')}]});}return null;})['then'](respondWithResult(_0x7208e8,null))['catch'](handleError(_0x7208e8,null));};function sanitizeRemoteUri(_0x5a0ec5){var _0x22dc84=_0x5a0ec5[_0x5e3f('0x41')](-0x1);if(_0x22dc84==='/')return _0x5a0ec5[_0x5e3f('0x42')](0x0,_0x5a0ec5[_0x5e3f('0x43')](_0x22dc84));return _0x5a0ec5;}function getWebApiUrl(_0x42fc95){return util[_0x5e3f('0x44')]('%s/api/data/v9.0/',_0x42fc95);}exports[_0x5e3f('0x45')]=function(_0x2e493d,_0x599430){var _0x171c92=_0x2e493d[_0x5e3f('0x1f')][_0x5e3f('0x46')];var _0x4fcda0=_0x171c92==='incident'?'Incident':_0x5e3f('0x47');var _0x56c8c7='';var _0x307059='';var _0x913be7='';var _0x589d7b='';var _0x40d649='';var _0x4c4b7e='';var _0x198ddc='';var _0x2cae12='';var _0x1341a3=['title',_0x5e3f('0x48'),'customerid','ownerid',_0x5e3f('0x49'),'subject','phonenumber',_0x5e3f('0x4a'),_0x5e3f('0x4b'),_0x5e3f('0x4c')];var _0x3bfe76=[_0x5e3f('0x4d'),_0x5e3f('0x4e'),_0x5e3f('0x4f'),_0x5e3f('0x50'),'contactidname',_0x5e3f('0x51'),_0x5e3f('0x52'),'contractidname',_0x5e3f('0x53'),_0x5e3f('0x54'),_0x5e3f('0x55'),'createdbyyominame',_0x5e3f('0x56'),_0x5e3f('0x57'),_0x5e3f('0x58'),_0x5e3f('0x59'),_0x5e3f('0x5a'),_0x5e3f('0x5b'),_0x5e3f('0x5c'),_0x5e3f('0x5d'),_0x5e3f('0x5e'),'entityimage_url',_0x5e3f('0x5f'),_0x5e3f('0x60'),'firstresponsebykpiidname',_0x5e3f('0x61'),_0x5e3f('0x62'),_0x5e3f('0x63'),_0x5e3f('0x64'),'lastonholdtime',_0x5e3f('0x65'),_0x5e3f('0x66'),_0x5e3f('0x67'),_0x5e3f('0x68'),_0x5e3f('0x69'),_0x5e3f('0x6a'),_0x5e3f('0x6b'),'modifiedonbehalfbyyominame',_0x5e3f('0x6c'),_0x5e3f('0x6d'),'numberofchildincidents',_0x5e3f('0x6e'),_0x5e3f('0x6f'),'owneridname',_0x5e3f('0x70'),'owneridyominame','parentcaseidname','primarycontactidname',_0x5e3f('0x71'),'prioritycodename',_0x5e3f('0x72'),'productserialnumber',_0x5e3f('0x73'),_0x5e3f('0x74'),'responseby','responsiblecontactidname',_0x5e3f('0x75'),_0x5e3f('0x76'),_0x5e3f('0x77'),'slaname',_0x5e3f('0x78'),_0x5e3f('0x79'),_0x5e3f('0x7a'),'subjectidname','ticketnumber',_0x5e3f('0x7b'),_0x5e3f('0x7c'),'traversedpath',_0x5e3f('0x7d'),_0x5e3f('0x7e')];var _0x272b44=_0x1341a3[_0x5e3f('0x7f')](_0x3bfe76);return db[_0x5e3f('0x17')][_0x5e3f('0x39')]({'where':{'id':_0x2e493d[_0x5e3f('0x30')]['id']},'attributes':['id','username','password',_0x5e3f('0x80'),'tenantId','clientId','clientSecret',_0x5e3f('0x81')],'include':[{'model':db[_0x5e3f('0x82')],'as':_0x5e3f('0x82'),'attributes':['id',_0x5e3f('0x83'),_0x5e3f('0x84')]}]})[_0x5e3f('0xd')](handleEntityNotFound(_0x599430,null))[_0x5e3f('0xd')](function(_0x33d2c7){if(_0x33d2c7){if(_0x33d2c7[_0x5e3f('0x81')]){_0x33d2c7[_0x5e3f('0x85')]=_0x33d2c7[_0x5e3f('0x82')][_0x5e3f('0x83')];_0x2cae12=sanitizeRemoteUri(_0x33d2c7[_0x5e3f('0x82')][_0x5e3f('0x84')]);_0x198ddc=getWebApiUrl(_0x2cae12);return _0x33d2c7;}_0x2cae12=sanitizeRemoteUri(_0x33d2c7['remoteUri']);_0x198ddc=getWebApiUrl(_0x2cae12);var _0x1b5e39={'method':_0x5e3f('0x86'),'uri':_0x5e3f('0x87')+_0x33d2c7[_0x5e3f('0x88')]+_0x5e3f('0x89'),'form':{'client_id':_0x33d2c7[_0x5e3f('0x8a')],'resource':_0x2cae12,'username':_0x33d2c7['username'],'password':_0x33d2c7[_0x5e3f('0x8b')],'grant_type':'password','client_secret':_0x33d2c7[_0x5e3f('0x8c')]},'json':!![]};return rp(_0x1b5e39);}})[_0x5e3f('0xd')](function(_0x2420ea){_0x4c4b7e=_0x2420ea[_0x5e3f('0x85')];var _0x772c73={'method':'GET','uri':encodeURI(_0x198ddc+_0x5e3f('0x8d')+_0x4fcda0+'\x27'),'headers':{'Authorization':_0x5e3f('0x8e')+_0x4c4b7e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x772c73);})[_0x5e3f('0xd')](function(_0x509f60){var _0x403458=_0x509f60[_0x5e3f('0x8f')][0x0];var _0x2168dc=_0x403458[_0x5e3f('0x90')];var _0x394271={'method':_0x5e3f('0x91'),'uri':_0x198ddc+_0x5e3f('0x92')+_0x2168dc+_0x5e3f('0x93'),'headers':{'Authorization':_0x5e3f('0x8e')+_0x4c4b7e,'If-None-Match':null,'OData-Version':_0x5e3f('0x94')},'json':!![]};return rp(_0x394271);})['then'](function(_0x4e3059){_0x56c8c7=_0x4e3059;_0x307059=_0x56c8c7['Attributes'];_0x307059=_[_0x5e3f('0x95')](_0x307059,function(_0x5c1344){return!_0x272b44[_0x5e3f('0x96')](_0x5c1344['LogicalName']);});var _0x2d4de8=[];var _0x1c16ba=[];_0x307059[_0x5e3f('0x97')](function(_0x46a4f7){if(_0x46a4f7[_0x5e3f('0x98')]){var _0x59afe1=_0x46a4f7['@odata.type'][_0x5e3f('0x42')](_0x46a4f7['@odata.type'][_0x5e3f('0x43')]('.')+0x1);if(_0x59afe1===_0x5e3f('0x99')){_0x2d4de8['push'](getSelectList(_0x198ddc,_0x171c92,_0x1c16ba,_0x56c8c7['MetadataId'],_0x46a4f7[_0x5e3f('0x90')],_0x4c4b7e));}}});return Promise[_0x5e3f('0x9a')](_0x2d4de8);})[_0x5e3f('0xd')](function(_0x23b1f3){_0x913be7=_0x23b1f3[0x0];var _0x43d8dc=[];var _0x1416e4=[];_0x307059['forEach'](function(_0x3e5f1d){if(!_[_0x5e3f('0x9b')](_0x3e5f1d[_0x5e3f('0x98')])){var _0x1741d6=_0x3e5f1d['@odata.type'][_0x5e3f('0x42')](_0x3e5f1d[_0x5e3f('0x98')][_0x5e3f('0x43')]('.')+0x1);if(_0x1741d6===_0x5e3f('0x9c')){_0x43d8dc['push'](getBooleanList(_0x198ddc,_0x171c92,_0x1416e4,_0x56c8c7[_0x5e3f('0x90')],_0x3e5f1d[_0x5e3f('0x90')],_0x4c4b7e));}}});return Promise[_0x5e3f('0x9a')](_0x43d8dc);})[_0x5e3f('0xd')](function(_0x5a3716){_0x589d7b=_0x5a3716[0x0];var _0x46e6fa=[];var _0x18cb9e=[];_0x307059['forEach'](function(_0x253ebe){if(_0x253ebe[_0x5e3f('0x98')]){var _0x504047=_0x253ebe[_0x5e3f('0x98')][_0x5e3f('0x42')](_0x253ebe['@odata.type'][_0x5e3f('0x43')]('.')+0x1);if(_0x504047==='StringAttributeMetadata'||_0x504047===_0x5e3f('0x9d')||_0x504047==='BigIntAttributeMetadata'||_0x504047===_0x5e3f('0x9e')||_0x504047===_0x5e3f('0x9f')||_0x504047===_0x5e3f('0xa0')||_0x504047===_0x5e3f('0xa1')||_0x504047===_0x5e3f('0xa2')||_0x504047===_0x5e3f('0xa3')||_0x504047===_0x5e3f('0xa4')){_0x46e6fa[_0x5e3f('0xa5')](getInputList(_0x198ddc,_0x171c92,_0x504047,_0x18cb9e,_0x56c8c7[_0x5e3f('0x90')],_0x253ebe['MetadataId'],_0x4c4b7e));}}});return Promise['all'](_0x46e6fa);})[_0x5e3f('0xd')](function(_0x2eccc1){_0x40d649=_0x2eccc1[0x0];var _0x537729=_0x913be7[_0x5e3f('0x7f')](_0x589d7b)[_0x5e3f('0x7f')](_0x40d649);var _0x1d4f2c={'count':_0x537729['length'],'rows':_0x537729};return _0x1d4f2c;})[_0x5e3f('0xd')](respondWithResult(_0x599430,null))[_0x5e3f('0x34')](function(_0x5630b0){var _0x41a156=_0x2e493d[_0x5e3f('0x1f')][_0x5e3f('0xa6')]?0x1f4:_0x5630b0['statusCode']||0x1f4;logger['error'](_0x5630b0['stack']);delete _0x5630b0[_0x5e3f('0x13')];if(_0x41a156===0x191){_0x41a156=0x190;}_0x599430[_0x5e3f('0x6')](_0x41a156)[_0x5e3f('0x14')](_0x2e493d[_0x5e3f('0x1f')]['test']?{'message':_0x5e3f('0xa7'),'statusCode':_0x5630b0[_0x5e3f('0xa8')]}:_0x5630b0);});};function getSelectList(_0x241d27,_0x19c6d7,_0x2268d0,_0x3d5a5b,_0x461c8d,_0x35f8ad){var _0x3f3cc7={'method':_0x5e3f('0x91'),'uri':_0x241d27+_0x5e3f('0x92')+_0x3d5a5b+_0x5e3f('0xa9')+_0x461c8d+_0x5e3f('0xaa')+_0x5e3f('0xab'),'headers':{'Authorization':_0x5e3f('0x8e')+_0x35f8ad,'If-None-Match':null,'OData-Version':_0x5e3f('0x94')},'json':!![]};return rp(_0x3f3cc7)[_0x5e3f('0xd')](function(_0x3dc492){var _0x451214=[];var _0x2d1216=_0x3dc492[_0x5e3f('0xac')]['Options'];_0x2d1216['forEach'](function(_0x326cf8){_0x451214['push']({'name':_0x326cf8['Label'][_0x5e3f('0xad')][_0x5e3f('0xae')],'value':String(_0x326cf8[_0x5e3f('0xaf')])});});var _0x78f792={'id':_0x19c6d7+'_'+_0x3dc492[_0x5e3f('0xb0')],'name':_0x3dc492[_0x5e3f('0xb1')][_0x5e3f('0xad')][_0x5e3f('0xae')],'custom':![],'options':_0x451214};_0x2268d0[_0x5e3f('0xa5')](_0x78f792);return _0x2268d0;});}function getBooleanList(_0x51b32d,_0x1782aa,_0x59ac9c,_0x3326fb,_0x3a7867,_0x55c11b){var _0xc66fe5={'method':_0x5e3f('0x91'),'uri':_0x51b32d+_0x5e3f('0x92')+_0x3326fb+_0x5e3f('0xa9')+_0x3a7867+_0x5e3f('0xb2'),'headers':{'Authorization':_0x5e3f('0x8e')+_0x55c11b,'If-None-Match':null,'OData-Version':_0x5e3f('0x94')},'json':!![]};return rp(_0xc66fe5)[_0x5e3f('0xd')](function(_0x3ffd5c){var _0x37e526=[];_0x37e526[_0x5e3f('0xa5')]({'name':_0x3ffd5c[_0x5e3f('0xac')][_0x5e3f('0xb3')][_0x5e3f('0xae')]['UserLocalizedLabel'][_0x5e3f('0xae')],'value':_0x5e3f('0xb4')},{'name':_0x3ffd5c[_0x5e3f('0xac')][_0x5e3f('0xb5')][_0x5e3f('0xae')][_0x5e3f('0xad')]['Label'],'value':_0x5e3f('0xb6')});var _0x54ad09={'id':_0x1782aa+'_'+_0x3ffd5c[_0x5e3f('0xb0')],'name':_0x3ffd5c[_0x5e3f('0xb1')][_0x5e3f('0xad')]['Label'],'custom':![],'options':_0x37e526};_0x59ac9c[_0x5e3f('0xa5')](_0x54ad09);return _0x59ac9c;});}function getInputList(_0x1346a2,_0x25d1b0,_0x1af0e0,_0x5a0bda,_0x30d193,_0x1a0738,_0x4c0f11){var _0x46bde1={'method':_0x5e3f('0x91'),'uri':_0x1346a2+'EntityDefinitions('+_0x30d193+_0x5e3f('0xa9')+_0x1a0738+_0x5e3f('0xb7')+_0x1af0e0+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x5e3f('0x8e')+_0x4c0f11,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x46bde1)[_0x5e3f('0xd')](function(_0x192edd){var _0x33e150={'id':_0x25d1b0+'_'+_0x192edd[_0x5e3f('0xb0')],'name':_0x192edd[_0x5e3f('0xb1')][_0x5e3f('0xad')]?_0x192edd[_0x5e3f('0xb1')]['UserLocalizedLabel']['Label']:_0x192edd[_0x5e3f('0xb0')],'custom':![],'options':[]};_0x5a0bda[_0x5e3f('0xa5')](_0x33e150);return _0x5a0bda;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 96d0cca..b51d81a 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x54f65b,_0x257f61){var _0x5c4f71=function(_0x50e8ab){while(--_0x50e8ab){_0x54f65b['push'](_0x54f65b['shift']());}};_0x5c4f71(++_0x257f61);}(_0xe706,0xa3));var _0x6e70=function(_0x22c684,_0x753309){_0x22c684=_0x22c684-0x0;var _0x39fcbb=_0xe706[_0x22c684];return _0x39fcbb;};'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'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x1ef735,_0xc49a85){var _0x16f63f=function(_0x116406){while(--_0x116406){_0x1ef735['push'](_0x1ef735['shift']());}};_0x16f63f(++_0xc49a85);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','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 fe9b725..21c561e 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 _0xc0c1=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','map','include','model','then','ShowDynamics365Account','find','lodash','moment','bluebird'];(function(_0x2edb86,_0x1ea403){var _0xf95ab4=function(_0x24ed83){while(--_0x24ed83){_0x2edb86['push'](_0x2edb86['shift']());}};_0xf95ab4(++_0x1ea403);}(_0xc0c1,0x1ad));var _0x1c0c=function(_0x4d55b4,_0x2a28a8){_0x4d55b4=_0x4d55b4-0x0;var _0x3aa7e6=_0xc0c1[_0x4d55b4];return _0x3aa7e6;};'use strict';var _=require(_0x1c0c('0x0'));var util=require('util');var moment=require(_0x1c0c('0x1'));var BPromise=require(_0x1c0c('0x2'));var rs=require(_0x1c0c('0x3'));var fs=require('fs');var Redis=require(_0x1c0c('0x4'));var db=require(_0x1c0c('0x5'))['db'];var utils=require(_0x1c0c('0x6'));var logger=require(_0x1c0c('0x7'))(_0x1c0c('0x8'));var config=require(_0x1c0c('0x9'));var jayson=require(_0x1c0c('0xa'));var client=jayson['client'][_0x1c0c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f44e2,_0x3b0596,_0x68570d){return new BPromise(function(_0x402e66,_0x2737f2){return client['request'](_0x1f44e2,_0x68570d)['then'](function(_0x1299a9){logger[_0x1c0c('0xc')](_0x1c0c('0xd'),_0x3b0596,_0x1c0c('0xe'));logger[_0x1c0c('0xf')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x3b0596,'request\x20sent',JSON[_0x1c0c('0x10')](_0x1299a9));if(_0x1299a9[_0x1c0c('0x11')]){if(_0x1299a9[_0x1c0c('0x11')][_0x1c0c('0x12')]===0x1f4){logger['error'](_0x1c0c('0xd'),_0x3b0596,_0x1299a9[_0x1c0c('0x11')]['message']);return _0x2737f2(_0x1299a9[_0x1c0c('0x11')][_0x1c0c('0x13')]);}logger[_0x1c0c('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x3b0596,_0x1299a9['error']['message']);return _0x402e66(_0x1299a9[_0x1c0c('0x11')][_0x1c0c('0x13')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x3b0596,_0x1c0c('0xe'));_0x402e66(_0x1299a9[_0x1c0c('0x14')][_0x1c0c('0x13')]);}})[_0x1c0c('0x15')](function(_0x466e7f){logger[_0x1c0c('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x3b0596,_0x466e7f);_0x2737f2(_0x466e7f);});});}exports[_0x1c0c('0x16')]=function(_0x253987){var _0x15fd51=this;return new Promise(function(_0x26c95a,_0x5307d1){return db[_0x1c0c('0x17')][_0x1c0c('0x18')]({'raw':_0x253987[_0x1c0c('0x19')]?_0x253987['options'][_0x1c0c('0x1a')]===undefined?!![]:![]:!![],'where':_0x253987[_0x1c0c('0x19')]?_0x253987[_0x1c0c('0x19')][_0x1c0c('0x1b')]||null:null,'attributes':_0x253987[_0x1c0c('0x19')]?_0x253987[_0x1c0c('0x19')][_0x1c0c('0x1c')]||null:null,'limit':_0x253987[_0x1c0c('0x19')]?_0x253987['options'][_0x1c0c('0x1d')]||null:null,'include':_0x253987['options']?_0x253987['options']['include']?_[_0x1c0c('0x1e')](_0x253987['options'][_0x1c0c('0x1f')],function(_0x12bf5f){return{'model':db[_0x12bf5f[_0x1c0c('0x20')]],'as':_0x12bf5f['as'],'attributes':_0x12bf5f[_0x1c0c('0x1c')],'include':_0x12bf5f['include']?_[_0x1c0c('0x1e')](_0x12bf5f['include'],function(_0x2aa407){return{'model':db[_0x2aa407[_0x1c0c('0x20')]],'as':_0x2aa407['as'],'attributes':_0x2aa407[_0x1c0c('0x1c')],'include':_0x2aa407[_0x1c0c('0x1f')]?_['map'](_0x2aa407[_0x1c0c('0x1f')],function(_0x250410){return{'model':db[_0x250410[_0x1c0c('0x20')]],'as':_0x250410['as'],'attributes':_0x250410[_0x1c0c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1c0c('0x21')](function(_0x48eff7){logger[_0x1c0c('0xc')](_0x1c0c('0x16'),_0x253987);logger['debug'](_0x1c0c('0x16'),_0x253987,JSON[_0x1c0c('0x10')](_0x48eff7));_0x26c95a(_0x48eff7);})[_0x1c0c('0x15')](function(_0x538e3c){logger['error'](_0x1c0c('0x16'),_0x538e3c['message'],_0x253987);_0x5307d1(_0x15fd51[_0x1c0c('0x11')](0x1f4,_0x538e3c[_0x1c0c('0x13')]));});});};exports[_0x1c0c('0x22')]=function(_0x6ac963){var _0x302671=this;return new Promise(function(_0x1caf03,_0x87970b){return db[_0x1c0c('0x17')][_0x1c0c('0x23')]({'raw':_0x6ac963[_0x1c0c('0x19')]?_0x6ac963[_0x1c0c('0x19')][_0x1c0c('0x1a')]===undefined?!![]:![]:!![],'where':_0x6ac963[_0x1c0c('0x19')]?_0x6ac963[_0x1c0c('0x19')][_0x1c0c('0x1b')]||null:null,'attributes':_0x6ac963[_0x1c0c('0x19')]?_0x6ac963['options']['attributes']||null:null,'include':_0x6ac963[_0x1c0c('0x19')]?_0x6ac963[_0x1c0c('0x19')]['include']?_[_0x1c0c('0x1e')](_0x6ac963[_0x1c0c('0x19')][_0x1c0c('0x1f')],function(_0x6d8a52){return{'model':db[_0x6d8a52['model']],'as':_0x6d8a52['as'],'attributes':_0x6d8a52[_0x1c0c('0x1c')],'include':_0x6d8a52['include']?_[_0x1c0c('0x1e')](_0x6d8a52[_0x1c0c('0x1f')],function(_0x42148b){return{'model':db[_0x42148b['model']],'as':_0x42148b['as'],'attributes':_0x42148b[_0x1c0c('0x1c')],'include':_0x42148b['include']?_['map'](_0x42148b[_0x1c0c('0x1f')],function(_0x7cac46){return{'model':db[_0x7cac46[_0x1c0c('0x20')]],'as':_0x7cac46['as'],'attributes':_0x7cac46[_0x1c0c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1c0c('0x21')](function(_0x2a18d3){logger['info'](_0x1c0c('0x22'),_0x6ac963);logger['debug'](_0x1c0c('0x22'),_0x6ac963,JSON[_0x1c0c('0x10')](_0x2a18d3));_0x1caf03(_0x2a18d3);})[_0x1c0c('0x15')](function(_0x18c157){logger[_0x1c0c('0x11')](_0x1c0c('0x22'),_0x18c157[_0x1c0c('0x13')],_0x6ac963);_0x87970b(_0x302671[_0x1c0c('0x11')](0x1f4,_0x18c157[_0x1c0c('0x13')]));});});}; \ No newline at end of file +var _0xc8aa=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Dynamics365Account','findAll','options','where','attributes','limit','model','include','map','then','GetDynamics365Account','catch','ShowDynamics365Account','find'];(function(_0x3e753a,_0x45e9cc){var _0x2a8a3a=function(_0x4cc62e){while(--_0x4cc62e){_0x3e753a['push'](_0x3e753a['shift']());}};_0x2a8a3a(++_0x45e9cc);}(_0xc8aa,0x154));var _0xac8a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xc8aa[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xac8a('0x0'));var util=require('util');var moment=require(_0xac8a('0x1'));var BPromise=require(_0xac8a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac8a('0x3'));var db=require(_0xac8a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xac8a('0x5'))(_0xac8a('0x6'));var config=require(_0xac8a('0x7'));var jayson=require(_0xac8a('0x8'));var client=jayson[_0xac8a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48ace9,_0x3b0f41,_0x5c19ee){return new BPromise(function(_0x475633,_0x1169a1){return client[_0xac8a('0xa')](_0x48ace9,_0x5c19ee)['then'](function(_0x3436d8){logger[_0xac8a('0xb')](_0xac8a('0xc'),_0x3b0f41,_0xac8a('0xd'));logger[_0xac8a('0xe')](_0xac8a('0xf'),_0x3b0f41,'request\x20sent',JSON[_0xac8a('0x10')](_0x3436d8));if(_0x3436d8[_0xac8a('0x11')]){if(_0x3436d8[_0xac8a('0x11')]['code']===0x1f4){logger[_0xac8a('0x11')](_0xac8a('0xc'),_0x3b0f41,_0x3436d8[_0xac8a('0x11')][_0xac8a('0x12')]);return _0x1169a1(_0x3436d8[_0xac8a('0x11')][_0xac8a('0x12')]);}logger[_0xac8a('0x11')](_0xac8a('0xc'),_0x3b0f41,_0x3436d8[_0xac8a('0x11')]['message']);return _0x475633(_0x3436d8['error'][_0xac8a('0x12')]);}else{logger[_0xac8a('0xb')](_0xac8a('0xc'),_0x3b0f41,_0xac8a('0xd'));_0x475633(_0x3436d8[_0xac8a('0x13')][_0xac8a('0x12')]);}})['catch'](function(_0x344bb0){logger[_0xac8a('0x11')](_0xac8a('0xc'),_0x3b0f41,_0x344bb0);_0x1169a1(_0x344bb0);});});}exports['GetDynamics365Account']=function(_0x16083c){var _0x42fd53=this;return new Promise(function(_0x131f17,_0x587baa){return db[_0xac8a('0x14')][_0xac8a('0x15')]({'raw':_0x16083c['options']?_0x16083c['options']['raw']===undefined?!![]:![]:!![],'where':_0x16083c[_0xac8a('0x16')]?_0x16083c[_0xac8a('0x16')][_0xac8a('0x17')]||null:null,'attributes':_0x16083c[_0xac8a('0x16')]?_0x16083c['options'][_0xac8a('0x18')]||null:null,'limit':_0x16083c[_0xac8a('0x16')]?_0x16083c['options'][_0xac8a('0x19')]||null:null,'include':_0x16083c[_0xac8a('0x16')]?_0x16083c['options']['include']?_['map'](_0x16083c['options']['include'],function(_0x327a76){return{'model':db[_0x327a76[_0xac8a('0x1a')]],'as':_0x327a76['as'],'attributes':_0x327a76[_0xac8a('0x18')],'include':_0x327a76[_0xac8a('0x1b')]?_['map'](_0x327a76[_0xac8a('0x1b')],function(_0x14db1f){return{'model':db[_0x14db1f[_0xac8a('0x1a')]],'as':_0x14db1f['as'],'attributes':_0x14db1f[_0xac8a('0x18')],'include':_0x14db1f[_0xac8a('0x1b')]?_[_0xac8a('0x1c')](_0x14db1f[_0xac8a('0x1b')],function(_0x99fb0c){return{'model':db[_0x99fb0c[_0xac8a('0x1a')]],'as':_0x99fb0c['as'],'attributes':_0x99fb0c[_0xac8a('0x18')]};}):[]};}):[]};}):[]:[]})[_0xac8a('0x1d')](function(_0x3bb5c9){logger[_0xac8a('0xb')](_0xac8a('0x1e'),_0x16083c);logger['debug'](_0xac8a('0x1e'),_0x16083c,JSON['stringify'](_0x3bb5c9));_0x131f17(_0x3bb5c9);})[_0xac8a('0x1f')](function(_0xadd58){logger[_0xac8a('0x11')]('GetDynamics365Account',_0xadd58[_0xac8a('0x12')],_0x16083c);_0x587baa(_0x42fd53[_0xac8a('0x11')](0x1f4,_0xadd58[_0xac8a('0x12')]));});});};exports[_0xac8a('0x20')]=function(_0x27111b){var _0x3a59c6=this;return new Promise(function(_0x1a5a59,_0xafebd5){return db[_0xac8a('0x14')][_0xac8a('0x21')]({'raw':_0x27111b[_0xac8a('0x16')]?_0x27111b[_0xac8a('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x27111b[_0xac8a('0x16')]?_0x27111b[_0xac8a('0x16')]['where']||null:null,'attributes':_0x27111b[_0xac8a('0x16')]?_0x27111b[_0xac8a('0x16')][_0xac8a('0x18')]||null:null,'include':_0x27111b['options']?_0x27111b['options']['include']?_[_0xac8a('0x1c')](_0x27111b[_0xac8a('0x16')]['include'],function(_0x16387e){return{'model':db[_0x16387e['model']],'as':_0x16387e['as'],'attributes':_0x16387e[_0xac8a('0x18')],'include':_0x16387e[_0xac8a('0x1b')]?_['map'](_0x16387e[_0xac8a('0x1b')],function(_0x224ece){return{'model':db[_0x224ece['model']],'as':_0x224ece['as'],'attributes':_0x224ece[_0xac8a('0x18')],'include':_0x224ece[_0xac8a('0x1b')]?_[_0xac8a('0x1c')](_0x224ece[_0xac8a('0x1b')],function(_0x4d8c97){return{'model':db[_0x4d8c97[_0xac8a('0x1a')]],'as':_0x4d8c97['as'],'attributes':_0x4d8c97[_0xac8a('0x18')]};}):[]};}):[]};}):[]:[]})[_0xac8a('0x1d')](function(_0x3e2e3b){logger['info']('ShowDynamics365Account',_0x27111b);logger[_0xac8a('0xe')](_0xac8a('0x20'),_0x27111b,JSON[_0xac8a('0x10')](_0x3e2e3b));_0x1a5a59(_0x3e2e3b);})[_0xac8a('0x1f')](function(_0x2308e9){logger[_0xac8a('0x11')]('ShowDynamics365Account',_0x2308e9[_0xac8a('0x12')],_0x27111b);_0xafebd5(_0x3a59c6['error'](0x1f4,_0x2308e9['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index b6e3c9c..2180ddb 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 _0x237d=['put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','show','/:id/fields','get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x37a301,_0x236191){var _0x51f40b=function(_0xd16bba){while(--_0xd16bba){_0x37a301['push'](_0x37a301['shift']());}};_0x51f40b(++_0x236191);}(_0x237d,0x1d9));var _0xd237=function(_0x54727a,_0x37d477){_0x54727a=_0x54727a-0x0;var _0x414e28=_0x237d[_0x54727a];return _0x414e28;};'use strict';var multer=require(_0xd237('0x0'));var util=require(_0xd237('0x1'));var path=require(_0xd237('0x2'));var timeout=require(_0xd237('0x3'));var express=require('express');var router=express[_0xd237('0x4')]();var fs_extra=require(_0xd237('0x5'));var auth=require(_0xd237('0x6'));var interaction=require(_0xd237('0x7'));var config=require(_0xd237('0x8'));var controller=require(_0xd237('0x9'));router['get']('/',auth[_0xd237('0xa')](),controller[_0xd237('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd237('0xc')]);router['get'](_0xd237('0xd'),auth[_0xd237('0xa')](),controller['getFields']);router[_0xd237('0xe')](_0xd237('0xf'),auth[_0xd237('0xa')](),controller[_0xd237('0x10')]);router[_0xd237('0xe')](_0xd237('0x11'),auth[_0xd237('0xa')](),controller[_0xd237('0x12')]);router[_0xd237('0x13')]('/',auth['isAuthenticated'](),controller[_0xd237('0x14')]);router[_0xd237('0x15')](_0xd237('0x16'),auth[_0xd237('0xa')](),controller['update']);router[_0xd237('0x17')](_0xd237('0x16'),auth[_0xd237('0xa')](),controller[_0xd237('0x18')]);module[_0xd237('0x19')]=router; \ No newline at end of file +var _0xa9e2=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./intDynamics365Configuration.controller','get','isAuthenticated','index','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','put','/:id'];(function(_0x45772a,_0x1c4bfa){var _0x2cb69e=function(_0x285bb0){while(--_0x285bb0){_0x45772a['push'](_0x45772a['shift']());}};_0x2cb69e(++_0x1c4bfa);}(_0xa9e2,0xc0));var _0x2a9e=function(_0x3145d7,_0x250c96){_0x3145d7=_0x3145d7-0x0;var _0x1783b4=_0xa9e2[_0x3145d7];return _0x1783b4;};'use strict';var multer=require(_0x2a9e('0x0'));var util=require(_0x2a9e('0x1'));var path=require(_0x2a9e('0x2'));var timeout=require(_0x2a9e('0x3'));var express=require('express');var router=express[_0x2a9e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2a9e('0x5'));var config=require('../../config/environment');var controller=require(_0x2a9e('0x6'));router[_0x2a9e('0x7')]('/',auth[_0x2a9e('0x8')](),controller[_0x2a9e('0x9')]);router[_0x2a9e('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2a9e('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2a9e('0xa')]);router[_0x2a9e('0x7')](_0x2a9e('0xb'),auth[_0x2a9e('0x8')](),controller['getSubjects']);router[_0x2a9e('0x7')](_0x2a9e('0xc'),auth[_0x2a9e('0x8')](),controller[_0x2a9e('0xd')]);router[_0x2a9e('0xe')]('/',auth[_0x2a9e('0x8')](),controller['create']);router[_0x2a9e('0xf')](_0x2a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x2a9e('0x8')](),controller[_0x2a9e('0x11')]);module[_0x2a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 648237e..3176257 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 _0xe5d1=['BOOLEAN','sequelize','exports','STRING','ENUM','incident','contact','nothing'];(function(_0x5de709,_0x642842){var _0x59fe80=function(_0x9bb4c1){while(--_0x9bb4c1){_0x5de709['push'](_0x5de709['shift']());}};_0x59fe80(++_0x642842);}(_0xe5d1,0x139));var _0x1e5d=function(_0x1c06f4,_0x2feba6){_0x1c06f4=_0x1c06f4-0x0;var _0x1a727e=_0xe5d1[_0x1c06f4];return _0x1a727e;};'use strict';var Sequelize=require(_0x1e5d('0x0'));module[_0x1e5d('0x1')]={'name':{'type':Sequelize[_0x1e5d('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x1e5d('0x3')](_0x1e5d('0x4'),'phonecall'),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x1e5d('0x3')](_0x1e5d('0x5'),_0x1e5d('0x6')),'defaultValue':_0x1e5d('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x1e5d('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0xed85=['STRING','incident','phonecall','ENUM','contact','BOOLEAN','sequelize','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xed85,0x136));var _0x5ed8=function(_0x4653f7,_0x3d3ae3){_0x4653f7=_0x4653f7-0x0;var _0x5454da=_0xed85[_0x4653f7];return _0x5454da;};'use strict';var Sequelize=require(_0x5ed8('0x0'));module[_0x5ed8('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5ed8('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x5ed8('0x3'),_0x5ed8('0x4')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x5ed8('0x5')](_0x5ed8('0x6'),'nothing'),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x5ed8('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x5ed8('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index bd02ff0..a9bad3b 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 _0x9555=['catch','show','rawAttributes','includeAll','include','create','body','params','find','findOne','Dynamics365Field','sort','getFields','getSubjects','hasOwnProperty','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','apply','save','update','then','destroy','sendStatus','name','index','map','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','where','pick','filter','merge','VIRTUAL','options','Dynamics365Configuration','findAll'];(function(_0x2b8d9e,_0x38f52a){var _0x380e14=function(_0xfc9680){while(--_0xfc9680){_0x2b8d9e['push'](_0x2b8d9e['shift']());}};_0x380e14(++_0x38f52a);}(_0x9555,0xac));var _0x5955=function(_0x157d55,_0x563ab0){_0x157d55=_0x157d55-0x0;var _0x47ce34=_0x9555[_0x157d55];return _0x47ce34;};'use strict';var emlformat=require(_0x5955('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5955('0x1'));var jsonpatch=require(_0x5955('0x2'));var rp=require(_0x5955('0x3'));var moment=require(_0x5955('0x4'));var BPromise=require(_0x5955('0x5'));var Mustache=require('mustache');var util=require(_0x5955('0x6'));var path=require(_0x5955('0x7'));var sox=require('sox');var csv=require(_0x5955('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5955('0x9'));var squel=require(_0x5955('0xa'));var crypto=require('crypto');var jsforce=require(_0x5955('0xb'));var deskjs=require(_0x5955('0xc'));var toCsv=require(_0x5955('0x8'));var querystring=require(_0x5955('0xd'));var Papa=require(_0x5955('0xe'));var Redis=require(_0x5955('0xf'));var authService=require(_0x5955('0x10'));var qs=require(_0x5955('0x11'));var as=require(_0x5955('0x12'));var hardwareService=require(_0x5955('0x13'));var logger=require(_0x5955('0x14'))(_0x5955('0x15'));var utils=require(_0x5955('0x16'));var config=require(_0x5955('0x17'));var licenseUtil=require(_0x5955('0x18'));var db=require(_0x5955('0x19'))['db'];function respondWithStatusCode(_0x58dde9,_0x25403e){_0x25403e=_0x25403e||0xcc;return function(_0x5ced01){if(_0x5ced01){return _0x58dde9['sendStatus'](_0x25403e);}return _0x58dde9[_0x5955('0x1a')](_0x25403e)[_0x5955('0x1b')]();};}function respondWithResult(_0x141e80,_0x70bf77){_0x70bf77=_0x70bf77||0xc8;return function(_0x92becc){if(_0x92becc){return _0x141e80['status'](_0x70bf77)[_0x5955('0x1c')](_0x92becc);}};}function respondWithFilteredResult(_0x3fd2a6,_0x3c2fc8){return function(_0x1c1d52){if(_0x1c1d52){var _0x27ecc1=typeof _0x3c2fc8[_0x5955('0x1d')]==='undefined'&&typeof _0x3c2fc8['limit']===_0x5955('0x1e');var _0x2a0eaa=_0x1c1d52['count'];var _0x3d7672=_0x27ecc1?0x0:_0x3c2fc8[_0x5955('0x1d')];var _0x1e4550=_0x27ecc1?_0x1c1d52[_0x5955('0x1f')]:_0x3c2fc8['offset']+_0x3c2fc8['limit'];var _0x5786ad;if(_0x1e4550>=_0x2a0eaa){_0x1e4550=_0x2a0eaa;_0x5786ad=0xc8;}else{_0x5786ad=0xce;}_0x3fd2a6[_0x5955('0x1a')](_0x5786ad);return _0x3fd2a6['set']('Content-Range',_0x3d7672+'-'+_0x1e4550+'/'+_0x2a0eaa)[_0x5955('0x1c')](_0x1c1d52);}return null;};}function patchUpdates(_0x172fcb){return function(_0x3f4616){try{jsonpatch[_0x5955('0x20')](_0x3f4616,_0x172fcb,!![]);}catch(_0x2ceb90){return BPromise['reject'](_0x2ceb90);}return _0x3f4616[_0x5955('0x21')]();};}function saveUpdates(_0x65c78,_0x27b7ea){return function(_0x53611d){if(_0x53611d){return _0x53611d[_0x5955('0x22')](_0x65c78)[_0x5955('0x23')](function(_0x1e02a5){return _0x1e02a5;});}return null;};}function removeEntity(_0x38a2b9,_0x361e8f){return function(_0x12aa35){if(_0x12aa35){return _0x12aa35[_0x5955('0x24')]()[_0x5955('0x23')](function(){_0x38a2b9[_0x5955('0x1a')](0xcc)[_0x5955('0x1b')]();});}};}function handleEntityNotFound(_0x1dc677,_0x18b292){return function(_0x260a5e){if(!_0x260a5e){_0x1dc677[_0x5955('0x25')](0x194);}return _0x260a5e;};}function handleError(_0x54ad13,_0x4f898){_0x4f898=_0x4f898||0x1f4;return function(_0xb1b550){logger['error'](_0xb1b550['stack']);if(_0xb1b550[_0x5955('0x26')]){delete _0xb1b550[_0x5955('0x26')];}_0x54ad13[_0x5955('0x1a')](_0x4f898)['send'](_0xb1b550);};}exports[_0x5955('0x27')]=function(_0x59bbd4,_0x12183f){var _0xc65331={},_0x17542e={},_0x388bf9={'count':0x0,'rows':[]};var _0x1d1bc2=_[_0x5955('0x28')](db['Dynamics365Configuration']['rawAttributes'],function(_0x2ce194){return{'name':_0x2ce194['fieldName'],'type':_0x2ce194[_0x5955('0x29')][_0x5955('0x2a')]};});_0x17542e[_0x5955('0x2b')]=_[_0x5955('0x28')](_0x1d1bc2,_0x5955('0x26'));_0x17542e[_0x5955('0x2c')]=_[_0x5955('0x2d')](_0x59bbd4['query']);_0x17542e[_0x5955('0x2e')]=_[_0x5955('0x2f')](_0x17542e[_0x5955('0x2b')],_0x17542e[_0x5955('0x2c')]);_0xc65331['attributes']=_['intersection'](_0x17542e[_0x5955('0x2b')],qs['fields'](_0x59bbd4[_0x5955('0x2c')][_0x5955('0x30')]));_0xc65331['attributes']=_0xc65331[_0x5955('0x31')][_0x5955('0x32')]?_0xc65331[_0x5955('0x31')]:_0x17542e['model'];if(!_0x59bbd4[_0x5955('0x2c')]['hasOwnProperty'](_0x5955('0x33'))){_0xc65331[_0x5955('0x34')]=qs[_0x5955('0x34')](_0x59bbd4[_0x5955('0x2c')][_0x5955('0x34')]);_0xc65331[_0x5955('0x1d')]=qs['offset'](_0x59bbd4['query'][_0x5955('0x1d')]);}_0xc65331[_0x5955('0x35')]=qs['sort'](_0x59bbd4[_0x5955('0x2c')]['sort']);_0xc65331[_0x5955('0x36')]=qs[_0x5955('0x2e')](_[_0x5955('0x37')](_0x59bbd4['query'],_0x17542e[_0x5955('0x2e')]),_0x1d1bc2);if(_0x59bbd4['query'][_0x5955('0x38')]){_0xc65331[_0x5955('0x36')]=_[_0x5955('0x39')](_0xc65331['where'],{'$or':_['map'](_0x1d1bc2,function(_0x5b0618){if(_0x5b0618[_0x5955('0x29')]!==_0x5955('0x3a')){var _0x505cfb={};_0x505cfb[_0x5b0618['name']]={'$like':'%'+_0x59bbd4[_0x5955('0x2c')]['filter']+'%'};return _0x505cfb;}})});}_0xc65331=_[_0x5955('0x39')]({},_0xc65331,_0x59bbd4[_0x5955('0x3b')]);var _0x6190bf={'where':_0xc65331[_0x5955('0x36')]};return db[_0x5955('0x3c')]['count'](_0x6190bf)[_0x5955('0x23')](function(_0x37d46e){_0x388bf9[_0x5955('0x1f')]=_0x37d46e;if(_0x59bbd4['query']['includeAll']){_0xc65331['include']=[{'all':!![]}];}return db[_0x5955('0x3c')][_0x5955('0x3d')](_0xc65331);})[_0x5955('0x23')](function(_0x3a5fd1){_0x388bf9['rows']=_0x3a5fd1;return _0x388bf9;})['then'](respondWithFilteredResult(_0x12183f,_0xc65331))[_0x5955('0x3e')](handleError(_0x12183f,null));};exports[_0x5955('0x3f')]=function(_0x69405f,_0x2647ce){var _0x2f54b6={'raw':![],'where':{'id':_0x69405f['params']['id']}},_0x21026e={};_0x21026e[_0x5955('0x2b')]=_[_0x5955('0x2d')](db['Dynamics365Configuration'][_0x5955('0x40')]);_0x21026e['query']=_[_0x5955('0x2d')](_0x69405f['query']);_0x21026e[_0x5955('0x2e')]=_['intersection'](_0x21026e['model'],_0x21026e[_0x5955('0x2c')]);_0x2f54b6[_0x5955('0x31')]=_['intersection'](_0x21026e[_0x5955('0x2b')],qs[_0x5955('0x30')](_0x69405f[_0x5955('0x2c')]['fields']));_0x2f54b6['attributes']=_0x2f54b6['attributes'][_0x5955('0x32')]?_0x2f54b6[_0x5955('0x31')]:_0x21026e['model'];if(_0x69405f['query'][_0x5955('0x41')]){_0x2f54b6[_0x5955('0x42')]=[{'all':!![]}];}_0x2f54b6=_['merge']({},_0x2f54b6,_0x69405f['options']);return db['Dynamics365Configuration']['find'](_0x2f54b6)[_0x5955('0x23')](handleEntityNotFound(_0x2647ce,null))[_0x5955('0x23')](respondWithResult(_0x2647ce,null))[_0x5955('0x3e')](handleError(_0x2647ce,null));};exports[_0x5955('0x43')]=function(_0x50fbed,_0x4fd341){return db[_0x5955('0x3c')]['create'](_0x50fbed[_0x5955('0x44')],{})[_0x5955('0x23')](respondWithResult(_0x4fd341,0xc9))['catch'](handleError(_0x4fd341,null));};exports[_0x5955('0x22')]=function(_0x42db7c,_0x25699a){if(_0x42db7c[_0x5955('0x44')]['id']){delete _0x42db7c[_0x5955('0x44')]['id'];}return db[_0x5955('0x3c')]['find']({'where':{'id':_0x42db7c[_0x5955('0x45')]['id']}})[_0x5955('0x23')](handleEntityNotFound(_0x25699a,null))['then'](saveUpdates(_0x42db7c['body'],null))[_0x5955('0x23')](respondWithResult(_0x25699a,null))[_0x5955('0x3e')](handleError(_0x25699a,null));};exports[_0x5955('0x24')]=function(_0x3a46e0,_0xcc6dbf){return db[_0x5955('0x3c')][_0x5955('0x46')]({'where':{'id':_0x3a46e0['params']['id']}})[_0x5955('0x23')](handleEntityNotFound(_0xcc6dbf,null))[_0x5955('0x23')](removeEntity(_0xcc6dbf,null))[_0x5955('0x3e')](handleError(_0xcc6dbf,null));};exports['getFields']=function(_0x43feb1,_0x5e128e,_0x4d817e){var _0x2ef87c={};var _0x3cb00c={};var _0x2a8065;var _0x44ca8a;return db[_0x5955('0x3c')][_0x5955('0x47')]({'where':{'id':_0x43feb1['params']['id']}})[_0x5955('0x23')](handleEntityNotFound(_0x5e128e,null))[_0x5955('0x23')](function(_0x371c37){if(_0x371c37){_0x2a8065=_0x371c37;_0x3cb00c[_0x5955('0x2b')]=_[_0x5955('0x2d')](db[_0x5955('0x48')][_0x5955('0x40')]);_0x3cb00c[_0x5955('0x2c')]=_['keys'](_0x43feb1[_0x5955('0x2c')]);_0x3cb00c[_0x5955('0x2e')]=_['intersection'](_0x3cb00c[_0x5955('0x2b')],_0x3cb00c['query']);_0x2ef87c[_0x5955('0x31')]=_[_0x5955('0x2f')](_0x3cb00c[_0x5955('0x2b')],qs[_0x5955('0x30')](_0x43feb1['query']['fields']));_0x2ef87c[_0x5955('0x31')]=_0x2ef87c[_0x5955('0x31')][_0x5955('0x32')]?_0x2ef87c['attributes']:_0x3cb00c['model'];_0x2ef87c[_0x5955('0x35')]=qs['sort'](_0x43feb1[_0x5955('0x2c')][_0x5955('0x49')]);_0x2ef87c[_0x5955('0x36')]=qs[_0x5955('0x2e')](_[_0x5955('0x37')](_0x43feb1[_0x5955('0x2c')],_0x3cb00c[_0x5955('0x2e')]));if(_0x43feb1[_0x5955('0x2c')][_0x5955('0x38')]){_0x2ef87c[_0x5955('0x36')]=_['merge'](_0x2ef87c['where'],{'$or':_[_0x5955('0x28')](_0x2ef87c['attributes'],function(_0x832757){var _0x5841e5={};_0x5841e5[_0x832757]={'$like':'%'+_0x43feb1[_0x5955('0x2c')][_0x5955('0x38')]+'%'};return _0x5841e5;})});}_0x2ef87c=_[_0x5955('0x39')]({},_0x2ef87c,_0x43feb1['options']);return _0x2a8065[_0x5955('0x4a')](_0x2ef87c);}})[_0x5955('0x23')](function(_0x302415){if(_0x302415){_0x44ca8a=_0x302415[_0x5955('0x32')];if(!_0x43feb1['query']['hasOwnProperty'](_0x5955('0x33'))){_0x2ef87c['limit']=qs[_0x5955('0x34')](_0x43feb1[_0x5955('0x2c')][_0x5955('0x34')]);_0x2ef87c[_0x5955('0x1d')]=qs['offset'](_0x43feb1[_0x5955('0x2c')][_0x5955('0x1d')]);}return _0x2a8065[_0x5955('0x4a')](_0x2ef87c);}})['then'](function(_0x58669c){if(_0x58669c){return _0x58669c?{'count':_0x44ca8a,'rows':_0x58669c}:null;}})[_0x5955('0x23')](respondWithResult(_0x5e128e,null))['catch'](handleError(_0x5e128e,null));};exports[_0x5955('0x4b')]=function(_0x486e16,_0x45b272,_0x30ea1e){var _0x3dba10={};var _0x309aed={};var _0x56bb31;var _0x11f476;return db[_0x5955('0x3c')][_0x5955('0x47')]({'where':{'id':_0x486e16['params']['id']}})[_0x5955('0x23')](handleEntityNotFound(_0x45b272,null))[_0x5955('0x23')](function(_0x2ded70){if(_0x2ded70){_0x56bb31=_0x2ded70;_0x309aed['model']=_['keys'](db[_0x5955('0x48')][_0x5955('0x40')]);_0x309aed[_0x5955('0x2c')]=_['keys'](_0x486e16[_0x5955('0x2c')]);_0x309aed[_0x5955('0x2e')]=_[_0x5955('0x2f')](_0x309aed[_0x5955('0x2b')],_0x309aed[_0x5955('0x2c')]);_0x3dba10[_0x5955('0x31')]=_[_0x5955('0x2f')](_0x309aed['model'],qs[_0x5955('0x30')](_0x486e16[_0x5955('0x2c')][_0x5955('0x30')]));_0x3dba10['attributes']=_0x3dba10['attributes'][_0x5955('0x32')]?_0x3dba10[_0x5955('0x31')]:_0x309aed[_0x5955('0x2b')];_0x3dba10['order']=qs[_0x5955('0x49')](_0x486e16[_0x5955('0x2c')]['sort']);_0x3dba10['where']=qs[_0x5955('0x2e')](_[_0x5955('0x37')](_0x486e16[_0x5955('0x2c')],_0x309aed[_0x5955('0x2e')]));if(_0x486e16[_0x5955('0x2c')][_0x5955('0x38')]){_0x3dba10['where']=_[_0x5955('0x39')](_0x3dba10['where'],{'$or':_[_0x5955('0x28')](_0x3dba10[_0x5955('0x31')],function(_0x558d0b){var _0x20b7e8={};_0x20b7e8[_0x558d0b]={'$like':'%'+_0x486e16['query']['filter']+'%'};return _0x20b7e8;})});}_0x3dba10=_['merge']({},_0x3dba10,_0x486e16[_0x5955('0x3b')]);return _0x56bb31[_0x5955('0x4b')](_0x3dba10);}})[_0x5955('0x23')](function(_0xf950){if(_0xf950){_0x11f476=_0xf950[_0x5955('0x32')];if(!_0x486e16['query'][_0x5955('0x4c')](_0x5955('0x33'))){_0x3dba10['limit']=qs['limit'](_0x486e16['query'][_0x5955('0x34')]);_0x3dba10[_0x5955('0x1d')]=qs[_0x5955('0x1d')](_0x486e16['query'][_0x5955('0x1d')]);}return _0x56bb31['getSubjects'](_0x3dba10);}})['then'](function(_0x215dd4){if(_0x215dd4){return _0x215dd4?{'count':_0x11f476,'rows':_0x215dd4}:null;}})['then'](respondWithResult(_0x45b272,null))[_0x5955('0x3e')](handleError(_0x45b272,null));};exports[_0x5955('0x4d')]=function(_0x561164,_0x4d91fd,_0x39f634){var _0x5da6ba={};var _0x55269b={};var _0x51b93b;var _0x2b3221;return db[_0x5955('0x3c')][_0x5955('0x47')]({'where':{'id':_0x561164[_0x5955('0x45')]['id']}})[_0x5955('0x23')](handleEntityNotFound(_0x4d91fd,null))[_0x5955('0x23')](function(_0x5c2f6f){if(_0x5c2f6f){_0x51b93b=_0x5c2f6f;_0x55269b[_0x5955('0x2b')]=_[_0x5955('0x2d')](db[_0x5955('0x48')][_0x5955('0x40')]);_0x55269b['query']=_[_0x5955('0x2d')](_0x561164[_0x5955('0x2c')]);_0x55269b[_0x5955('0x2e')]=_[_0x5955('0x2f')](_0x55269b[_0x5955('0x2b')],_0x55269b[_0x5955('0x2c')]);_0x5da6ba['attributes']=_[_0x5955('0x2f')](_0x55269b[_0x5955('0x2b')],qs[_0x5955('0x30')](_0x561164[_0x5955('0x2c')][_0x5955('0x30')]));_0x5da6ba[_0x5955('0x31')]=_0x5da6ba[_0x5955('0x31')][_0x5955('0x32')]?_0x5da6ba['attributes']:_0x55269b[_0x5955('0x2b')];_0x5da6ba[_0x5955('0x35')]=qs[_0x5955('0x49')](_0x561164[_0x5955('0x2c')][_0x5955('0x49')]);_0x5da6ba['where']=qs[_0x5955('0x2e')](_[_0x5955('0x37')](_0x561164[_0x5955('0x2c')],_0x55269b[_0x5955('0x2e')]));if(_0x561164[_0x5955('0x2c')][_0x5955('0x38')]){_0x5da6ba['where']=_[_0x5955('0x39')](_0x5da6ba['where'],{'$or':_[_0x5955('0x28')](_0x5da6ba['attributes'],function(_0x4ffb16){var _0x500d05={};_0x500d05[_0x4ffb16]={'$like':'%'+_0x561164[_0x5955('0x2c')][_0x5955('0x38')]+'%'};return _0x500d05;})});}_0x5da6ba=_['merge']({},_0x5da6ba,_0x561164[_0x5955('0x3b')]);return _0x51b93b[_0x5955('0x4d')](_0x5da6ba);}})[_0x5955('0x23')](function(_0x2b2cac){if(_0x2b2cac){_0x2b3221=_0x2b2cac[_0x5955('0x32')];if(!_0x561164[_0x5955('0x2c')][_0x5955('0x4c')](_0x5955('0x33'))){_0x5da6ba['limit']=qs[_0x5955('0x34')](_0x561164['query'][_0x5955('0x34')]);_0x5da6ba[_0x5955('0x1d')]=qs[_0x5955('0x1d')](_0x561164[_0x5955('0x2c')][_0x5955('0x1d')]);}return _0x51b93b['getDescriptions'](_0x5da6ba);}})[_0x5955('0x23')](function(_0xa9f5c1){if(_0xa9f5c1){return _0xa9f5c1?{'count':_0x2b3221,'rows':_0xa9f5c1}:null;}})[_0x5955('0x23')](respondWithResult(_0x4d91fd,null))[_0x5955('0x3e')](handleError(_0x4d91fd,null));}; \ No newline at end of file +var _0xc6c2=['limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Dynamics365Configuration','include','findAll','rows','show','params','rawAttributes','fields','length','includeAll','find','create','body','catch','getFields','findOne','Dynamics365Field','nolimit','getSubjects','getDescriptions','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3d1ae3,_0x43c01b){var _0x227d59=function(_0x28e966){while(--_0x28e966){_0x3d1ae3['push'](_0x3d1ae3['shift']());}};_0x227d59(++_0x43c01b);}(_0xc6c2,0xcf));var _0x2c6c=function(_0x424357,_0x9ebe3e){_0x424357=_0x424357-0x0;var _0x29c68e=_0xc6c2[_0x424357];return _0x29c68e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2c6c('0x0'));var rp=require(_0x2c6c('0x1'));var moment=require(_0x2c6c('0x2'));var BPromise=require(_0x2c6c('0x3'));var Mustache=require('mustache');var util=require(_0x2c6c('0x4'));var path=require(_0x2c6c('0x5'));var sox=require('sox');var csv=require(_0x2c6c('0x6'));var ejs=require(_0x2c6c('0x7'));var fs=require('fs');var fs_extra=require(_0x2c6c('0x8'));var _=require(_0x2c6c('0x9'));var squel=require(_0x2c6c('0xa'));var crypto=require(_0x2c6c('0xb'));var jsforce=require(_0x2c6c('0xc'));var deskjs=require(_0x2c6c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2c6c('0xe'));var Papa=require('papaparse');var Redis=require(_0x2c6c('0xf'));var authService=require(_0x2c6c('0x10'));var qs=require(_0x2c6c('0x11'));var as=require(_0x2c6c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2c6c('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2c6c('0x14'))['db'];function respondWithStatusCode(_0x303e0b,_0x1bda4c){_0x1bda4c=_0x1bda4c||0xcc;return function(_0x1f7c3c){if(_0x1f7c3c){return _0x303e0b[_0x2c6c('0x15')](_0x1bda4c);}return _0x303e0b[_0x2c6c('0x16')](_0x1bda4c)[_0x2c6c('0x17')]();};}function respondWithResult(_0x2303e2,_0x4731ee){_0x4731ee=_0x4731ee||0xc8;return function(_0x270782){if(_0x270782){return _0x2303e2[_0x2c6c('0x16')](_0x4731ee)[_0x2c6c('0x18')](_0x270782);}};}function respondWithFilteredResult(_0xc009f5,_0x3ca731){return function(_0x3d61f1){if(_0x3d61f1){var _0x435f90=typeof _0x3ca731[_0x2c6c('0x19')]===_0x2c6c('0x1a')&&typeof _0x3ca731[_0x2c6c('0x1b')]===_0x2c6c('0x1a');var _0x22225a=_0x3d61f1[_0x2c6c('0x1c')];var _0x12ed6c=_0x435f90?0x0:_0x3ca731[_0x2c6c('0x19')];var _0x25c602=_0x435f90?_0x3d61f1['count']:_0x3ca731[_0x2c6c('0x19')]+_0x3ca731[_0x2c6c('0x1b')];var _0x4ea03b;if(_0x25c602>=_0x22225a){_0x25c602=_0x22225a;_0x4ea03b=0xc8;}else{_0x4ea03b=0xce;}_0xc009f5[_0x2c6c('0x16')](_0x4ea03b);return _0xc009f5[_0x2c6c('0x1d')](_0x2c6c('0x1e'),_0x12ed6c+'-'+_0x25c602+'/'+_0x22225a)[_0x2c6c('0x18')](_0x3d61f1);}return null;};}function patchUpdates(_0x3e7d83){return function(_0x2c595d){try{jsonpatch['apply'](_0x2c595d,_0x3e7d83,!![]);}catch(_0xf52b29){return BPromise[_0x2c6c('0x1f')](_0xf52b29);}return _0x2c595d[_0x2c6c('0x20')]();};}function saveUpdates(_0x37c6eb,_0x336e6a){return function(_0x152e5c){if(_0x152e5c){return _0x152e5c['update'](_0x37c6eb)[_0x2c6c('0x21')](function(_0x1f78f7){return _0x1f78f7;});}return null;};}function removeEntity(_0x3d7023,_0x22dc40){return function(_0x27f582){if(_0x27f582){return _0x27f582[_0x2c6c('0x22')]()[_0x2c6c('0x21')](function(){_0x3d7023['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x323b68,_0x3def33){return function(_0x41cd49){if(!_0x41cd49){_0x323b68[_0x2c6c('0x15')](0x194);}return _0x41cd49;};}function handleError(_0x36cf58,_0x29e3dd){_0x29e3dd=_0x29e3dd||0x1f4;return function(_0x55dc1b){logger[_0x2c6c('0x23')](_0x55dc1b[_0x2c6c('0x24')]);if(_0x55dc1b[_0x2c6c('0x25')]){delete _0x55dc1b[_0x2c6c('0x25')];}_0x36cf58[_0x2c6c('0x16')](_0x29e3dd)[_0x2c6c('0x26')](_0x55dc1b);};}exports[_0x2c6c('0x27')]=function(_0x5c15d3,_0x20de81){var _0x5b512a={},_0x4f9510={},_0x15a7f6={'count':0x0,'rows':[]};var _0x2b7012=_[_0x2c6c('0x28')](db['Dynamics365Configuration']['rawAttributes'],function(_0x25438b){return{'name':_0x25438b[_0x2c6c('0x29')],'type':_0x25438b[_0x2c6c('0x2a')]['key']};});_0x4f9510[_0x2c6c('0x2b')]=_[_0x2c6c('0x28')](_0x2b7012,_0x2c6c('0x25'));_0x4f9510[_0x2c6c('0x2c')]=_[_0x2c6c('0x2d')](_0x5c15d3[_0x2c6c('0x2c')]);_0x4f9510[_0x2c6c('0x2e')]=_[_0x2c6c('0x2f')](_0x4f9510['model'],_0x4f9510[_0x2c6c('0x2c')]);_0x5b512a[_0x2c6c('0x30')]=_[_0x2c6c('0x2f')](_0x4f9510[_0x2c6c('0x2b')],qs['fields'](_0x5c15d3[_0x2c6c('0x2c')]['fields']));_0x5b512a[_0x2c6c('0x30')]=_0x5b512a[_0x2c6c('0x30')]['length']?_0x5b512a[_0x2c6c('0x30')]:_0x4f9510[_0x2c6c('0x2b')];if(!_0x5c15d3[_0x2c6c('0x2c')][_0x2c6c('0x31')]('nolimit')){_0x5b512a[_0x2c6c('0x1b')]=qs['limit'](_0x5c15d3[_0x2c6c('0x2c')]['limit']);_0x5b512a[_0x2c6c('0x19')]=qs[_0x2c6c('0x19')](_0x5c15d3[_0x2c6c('0x2c')]['offset']);}_0x5b512a[_0x2c6c('0x32')]=qs['sort'](_0x5c15d3[_0x2c6c('0x2c')][_0x2c6c('0x33')]);_0x5b512a[_0x2c6c('0x34')]=qs['filters'](_[_0x2c6c('0x35')](_0x5c15d3['query'],_0x4f9510[_0x2c6c('0x2e')]),_0x2b7012);if(_0x5c15d3[_0x2c6c('0x2c')][_0x2c6c('0x36')]){_0x5b512a[_0x2c6c('0x34')]=_[_0x2c6c('0x37')](_0x5b512a[_0x2c6c('0x34')],{'$or':_[_0x2c6c('0x28')](_0x2b7012,function(_0x584e02){if(_0x584e02[_0x2c6c('0x2a')]!==_0x2c6c('0x38')){var _0x3c0460={};_0x3c0460[_0x584e02[_0x2c6c('0x25')]]={'$like':'%'+_0x5c15d3[_0x2c6c('0x2c')][_0x2c6c('0x36')]+'%'};return _0x3c0460;}})});}_0x5b512a=_[_0x2c6c('0x37')]({},_0x5b512a,_0x5c15d3[_0x2c6c('0x39')]);var _0x3a40a9={'where':_0x5b512a[_0x2c6c('0x34')]};return db[_0x2c6c('0x3a')][_0x2c6c('0x1c')](_0x3a40a9)[_0x2c6c('0x21')](function(_0x47634c){_0x15a7f6[_0x2c6c('0x1c')]=_0x47634c;if(_0x5c15d3[_0x2c6c('0x2c')]['includeAll']){_0x5b512a[_0x2c6c('0x3b')]=[{'all':!![]}];}return db[_0x2c6c('0x3a')][_0x2c6c('0x3c')](_0x5b512a);})[_0x2c6c('0x21')](function(_0x31b2a4){_0x15a7f6[_0x2c6c('0x3d')]=_0x31b2a4;return _0x15a7f6;})[_0x2c6c('0x21')](respondWithFilteredResult(_0x20de81,_0x5b512a))['catch'](handleError(_0x20de81,null));};exports[_0x2c6c('0x3e')]=function(_0xb64abb,_0x5a7214){var _0x4f7dbd={'raw':![],'where':{'id':_0xb64abb[_0x2c6c('0x3f')]['id']}},_0x33097c={};_0x33097c[_0x2c6c('0x2b')]=_[_0x2c6c('0x2d')](db[_0x2c6c('0x3a')][_0x2c6c('0x40')]);_0x33097c[_0x2c6c('0x2c')]=_['keys'](_0xb64abb[_0x2c6c('0x2c')]);_0x33097c['filters']=_[_0x2c6c('0x2f')](_0x33097c['model'],_0x33097c['query']);_0x4f7dbd[_0x2c6c('0x30')]=_[_0x2c6c('0x2f')](_0x33097c[_0x2c6c('0x2b')],qs[_0x2c6c('0x41')](_0xb64abb[_0x2c6c('0x2c')][_0x2c6c('0x41')]));_0x4f7dbd[_0x2c6c('0x30')]=_0x4f7dbd['attributes'][_0x2c6c('0x42')]?_0x4f7dbd[_0x2c6c('0x30')]:_0x33097c[_0x2c6c('0x2b')];if(_0xb64abb[_0x2c6c('0x2c')][_0x2c6c('0x43')]){_0x4f7dbd[_0x2c6c('0x3b')]=[{'all':!![]}];}_0x4f7dbd=_[_0x2c6c('0x37')]({},_0x4f7dbd,_0xb64abb[_0x2c6c('0x39')]);return db[_0x2c6c('0x3a')][_0x2c6c('0x44')](_0x4f7dbd)[_0x2c6c('0x21')](handleEntityNotFound(_0x5a7214,null))[_0x2c6c('0x21')](respondWithResult(_0x5a7214,null))['catch'](handleError(_0x5a7214,null));};exports['create']=function(_0x199c03,_0x58c8a3){return db['Dynamics365Configuration'][_0x2c6c('0x45')](_0x199c03[_0x2c6c('0x46')],{})[_0x2c6c('0x21')](respondWithResult(_0x58c8a3,0xc9))[_0x2c6c('0x47')](handleError(_0x58c8a3,null));};exports['update']=function(_0x475e51,_0x1e9efa){if(_0x475e51[_0x2c6c('0x46')]['id']){delete _0x475e51[_0x2c6c('0x46')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x475e51['params']['id']}})[_0x2c6c('0x21')](handleEntityNotFound(_0x1e9efa,null))[_0x2c6c('0x21')](saveUpdates(_0x475e51['body'],null))[_0x2c6c('0x21')](respondWithResult(_0x1e9efa,null))['catch'](handleError(_0x1e9efa,null));};exports[_0x2c6c('0x22')]=function(_0x340141,_0x3ae14a){return db[_0x2c6c('0x3a')][_0x2c6c('0x44')]({'where':{'id':_0x340141['params']['id']}})['then'](handleEntityNotFound(_0x3ae14a,null))[_0x2c6c('0x21')](removeEntity(_0x3ae14a,null))[_0x2c6c('0x47')](handleError(_0x3ae14a,null));};exports[_0x2c6c('0x48')]=function(_0x37933d,_0x576418,_0x31bd9f){var _0x2084c0={};var _0x3ae22e={};var _0x273366;var _0x5725ee;return db[_0x2c6c('0x3a')][_0x2c6c('0x49')]({'where':{'id':_0x37933d['params']['id']}})[_0x2c6c('0x21')](handleEntityNotFound(_0x576418,null))[_0x2c6c('0x21')](function(_0x339bf0){if(_0x339bf0){_0x273366=_0x339bf0;_0x3ae22e[_0x2c6c('0x2b')]=_[_0x2c6c('0x2d')](db[_0x2c6c('0x4a')][_0x2c6c('0x40')]);_0x3ae22e[_0x2c6c('0x2c')]=_['keys'](_0x37933d[_0x2c6c('0x2c')]);_0x3ae22e['filters']=_[_0x2c6c('0x2f')](_0x3ae22e[_0x2c6c('0x2b')],_0x3ae22e[_0x2c6c('0x2c')]);_0x2084c0[_0x2c6c('0x30')]=_['intersection'](_0x3ae22e[_0x2c6c('0x2b')],qs[_0x2c6c('0x41')](_0x37933d[_0x2c6c('0x2c')]['fields']));_0x2084c0[_0x2c6c('0x30')]=_0x2084c0[_0x2c6c('0x30')][_0x2c6c('0x42')]?_0x2084c0[_0x2c6c('0x30')]:_0x3ae22e[_0x2c6c('0x2b')];_0x2084c0['order']=qs[_0x2c6c('0x33')](_0x37933d[_0x2c6c('0x2c')][_0x2c6c('0x33')]);_0x2084c0['where']=qs[_0x2c6c('0x2e')](_[_0x2c6c('0x35')](_0x37933d['query'],_0x3ae22e[_0x2c6c('0x2e')]));if(_0x37933d[_0x2c6c('0x2c')][_0x2c6c('0x36')]){_0x2084c0[_0x2c6c('0x34')]=_[_0x2c6c('0x37')](_0x2084c0[_0x2c6c('0x34')],{'$or':_[_0x2c6c('0x28')](_0x2084c0[_0x2c6c('0x30')],function(_0x20444e){var _0x4f240d={};_0x4f240d[_0x20444e]={'$like':'%'+_0x37933d['query']['filter']+'%'};return _0x4f240d;})});}_0x2084c0=_[_0x2c6c('0x37')]({},_0x2084c0,_0x37933d[_0x2c6c('0x39')]);return _0x273366[_0x2c6c('0x48')](_0x2084c0);}})[_0x2c6c('0x21')](function(_0x3d9111){if(_0x3d9111){_0x5725ee=_0x3d9111[_0x2c6c('0x42')];if(!_0x37933d['query'][_0x2c6c('0x31')](_0x2c6c('0x4b'))){_0x2084c0[_0x2c6c('0x1b')]=qs[_0x2c6c('0x1b')](_0x37933d[_0x2c6c('0x2c')][_0x2c6c('0x1b')]);_0x2084c0[_0x2c6c('0x19')]=qs[_0x2c6c('0x19')](_0x37933d[_0x2c6c('0x2c')]['offset']);}return _0x273366[_0x2c6c('0x48')](_0x2084c0);}})[_0x2c6c('0x21')](function(_0x1c3a43){if(_0x1c3a43){return _0x1c3a43?{'count':_0x5725ee,'rows':_0x1c3a43}:null;}})['then'](respondWithResult(_0x576418,null))[_0x2c6c('0x47')](handleError(_0x576418,null));};exports['getSubjects']=function(_0x4159e4,_0x1d3d48,_0x265bb8){var _0x289b2f={};var _0x165b74={};var _0x4b2846;var _0x4401bf;return db[_0x2c6c('0x3a')][_0x2c6c('0x49')]({'where':{'id':_0x4159e4['params']['id']}})[_0x2c6c('0x21')](handleEntityNotFound(_0x1d3d48,null))[_0x2c6c('0x21')](function(_0x1266b4){if(_0x1266b4){_0x4b2846=_0x1266b4;_0x165b74['model']=_[_0x2c6c('0x2d')](db[_0x2c6c('0x4a')][_0x2c6c('0x40')]);_0x165b74[_0x2c6c('0x2c')]=_[_0x2c6c('0x2d')](_0x4159e4[_0x2c6c('0x2c')]);_0x165b74[_0x2c6c('0x2e')]=_['intersection'](_0x165b74[_0x2c6c('0x2b')],_0x165b74['query']);_0x289b2f[_0x2c6c('0x30')]=_[_0x2c6c('0x2f')](_0x165b74['model'],qs[_0x2c6c('0x41')](_0x4159e4['query'][_0x2c6c('0x41')]));_0x289b2f[_0x2c6c('0x30')]=_0x289b2f['attributes'][_0x2c6c('0x42')]?_0x289b2f['attributes']:_0x165b74['model'];_0x289b2f[_0x2c6c('0x32')]=qs[_0x2c6c('0x33')](_0x4159e4['query']['sort']);_0x289b2f[_0x2c6c('0x34')]=qs['filters'](_['pick'](_0x4159e4[_0x2c6c('0x2c')],_0x165b74['filters']));if(_0x4159e4[_0x2c6c('0x2c')][_0x2c6c('0x36')]){_0x289b2f[_0x2c6c('0x34')]=_[_0x2c6c('0x37')](_0x289b2f[_0x2c6c('0x34')],{'$or':_[_0x2c6c('0x28')](_0x289b2f[_0x2c6c('0x30')],function(_0x157935){var _0x4f2e8e={};_0x4f2e8e[_0x157935]={'$like':'%'+_0x4159e4[_0x2c6c('0x2c')][_0x2c6c('0x36')]+'%'};return _0x4f2e8e;})});}_0x289b2f=_[_0x2c6c('0x37')]({},_0x289b2f,_0x4159e4['options']);return _0x4b2846[_0x2c6c('0x4c')](_0x289b2f);}})[_0x2c6c('0x21')](function(_0xb691e0){if(_0xb691e0){_0x4401bf=_0xb691e0[_0x2c6c('0x42')];if(!_0x4159e4[_0x2c6c('0x2c')][_0x2c6c('0x31')](_0x2c6c('0x4b'))){_0x289b2f['limit']=qs[_0x2c6c('0x1b')](_0x4159e4[_0x2c6c('0x2c')]['limit']);_0x289b2f[_0x2c6c('0x19')]=qs[_0x2c6c('0x19')](_0x4159e4[_0x2c6c('0x2c')][_0x2c6c('0x19')]);}return _0x4b2846[_0x2c6c('0x4c')](_0x289b2f);}})[_0x2c6c('0x21')](function(_0x3d8cec){if(_0x3d8cec){return _0x3d8cec?{'count':_0x4401bf,'rows':_0x3d8cec}:null;}})['then'](respondWithResult(_0x1d3d48,null))[_0x2c6c('0x47')](handleError(_0x1d3d48,null));};exports[_0x2c6c('0x4d')]=function(_0x10889d,_0x44bbdb,_0x372918){var _0x277d99={};var _0x574884={};var _0xe0bb60;var _0x3e1587;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x10889d[_0x2c6c('0x3f')]['id']}})[_0x2c6c('0x21')](handleEntityNotFound(_0x44bbdb,null))[_0x2c6c('0x21')](function(_0x8dcd34){if(_0x8dcd34){_0xe0bb60=_0x8dcd34;_0x574884[_0x2c6c('0x2b')]=_[_0x2c6c('0x2d')](db['Dynamics365Field'][_0x2c6c('0x40')]);_0x574884['query']=_[_0x2c6c('0x2d')](_0x10889d[_0x2c6c('0x2c')]);_0x574884[_0x2c6c('0x2e')]=_[_0x2c6c('0x2f')](_0x574884[_0x2c6c('0x2b')],_0x574884[_0x2c6c('0x2c')]);_0x277d99[_0x2c6c('0x30')]=_['intersection'](_0x574884[_0x2c6c('0x2b')],qs[_0x2c6c('0x41')](_0x10889d[_0x2c6c('0x2c')][_0x2c6c('0x41')]));_0x277d99['attributes']=_0x277d99['attributes'][_0x2c6c('0x42')]?_0x277d99[_0x2c6c('0x30')]:_0x574884[_0x2c6c('0x2b')];_0x277d99['order']=qs['sort'](_0x10889d[_0x2c6c('0x2c')][_0x2c6c('0x33')]);_0x277d99['where']=qs[_0x2c6c('0x2e')](_[_0x2c6c('0x35')](_0x10889d['query'],_0x574884[_0x2c6c('0x2e')]));if(_0x10889d[_0x2c6c('0x2c')][_0x2c6c('0x36')]){_0x277d99[_0x2c6c('0x34')]=_['merge'](_0x277d99[_0x2c6c('0x34')],{'$or':_[_0x2c6c('0x28')](_0x277d99[_0x2c6c('0x30')],function(_0x4b2d37){var _0x4c76fd={};_0x4c76fd[_0x4b2d37]={'$like':'%'+_0x10889d[_0x2c6c('0x2c')][_0x2c6c('0x36')]+'%'};return _0x4c76fd;})});}_0x277d99=_[_0x2c6c('0x37')]({},_0x277d99,_0x10889d['options']);return _0xe0bb60[_0x2c6c('0x4d')](_0x277d99);}})['then'](function(_0x177a29){if(_0x177a29){_0x3e1587=_0x177a29[_0x2c6c('0x42')];if(!_0x10889d[_0x2c6c('0x2c')][_0x2c6c('0x31')](_0x2c6c('0x4b'))){_0x277d99[_0x2c6c('0x1b')]=qs[_0x2c6c('0x1b')](_0x10889d[_0x2c6c('0x2c')][_0x2c6c('0x1b')]);_0x277d99[_0x2c6c('0x19')]=qs[_0x2c6c('0x19')](_0x10889d[_0x2c6c('0x2c')][_0x2c6c('0x19')]);}return _0xe0bb60['getDescriptions'](_0x277d99);}})[_0x2c6c('0x21')](function(_0xa637e4){if(_0xa637e4){return _0xa637e4?{'count':_0x3e1587,'rows':_0xa637e4}:null;}})['then'](respondWithResult(_0x44bbdb,null))[_0x2c6c('0x47')](handleError(_0x44bbdb,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 9818736..acc9da0 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 _0x70e0=['int_dynamics365_configurations','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes'];(function(_0x31d040,_0x46742e){var _0xf4812a=function(_0x3e1d93){while(--_0x3e1d93){_0x31d040['push'](_0x31d040['shift']());}};_0xf4812a(++_0x46742e);}(_0x70e0,0x17b));var _0x070e=function(_0x1b1677,_0x36841a){_0x1b1677=_0x1b1677-0x0;var _0x1eca50=_0x70e0[_0x1b1677];return _0x1eca50;};'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']('Dynamics365Configuration',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd6d6=['path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x315ea3,_0x259e5d){var _0x478239=function(_0x50c4f7){while(--_0x50c4f7){_0x315ea3['push'](_0x315ea3['shift']());}};_0x478239(++_0x259e5d);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x25187c,_0x77d4dd){_0x25187c=_0x25187c-0x0;var _0x4d3522=_0xd6d6[_0x25187c];return _0x4d3522;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var logger=require(_0x6d6d('0x2'))(_0x6d6d('0x3'));var moment=require('moment');var BPromise=require(_0x6d6d('0x4'));var rp=require(_0x6d6d('0x5'));var fs=require('fs');var path=require(_0x6d6d('0x6'));var rimraf=require(_0x6d6d('0x7'));var config=require(_0x6d6d('0x8'));var attributes=require(_0x6d6d('0x9'));module[_0x6d6d('0xa')]=function(_0x5702dc,_0x210ff7){return _0x5702dc[_0x6d6d('0xb')](_0x6d6d('0xc'),attributes,{'tableName':_0x6d6d('0xd'),'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 72df844..2013d7e 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 _0x1047=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x39585d,_0x408aa7){var _0x100ead=function(_0x531f76){while(--_0x531f76){_0x39585d['push'](_0x39585d['shift']());}};_0x100ead(++_0x408aa7);}(_0x1047,0x1b2));var _0x7104=function(_0x9f4a76,_0x4aacd8){_0x9f4a76=_0x9f4a76-0x0;var _0x1e1e03=_0x1047[_0x9f4a76];return _0x1e1e03;};'use strict';var _=require(_0x7104('0x0'));var util=require(_0x7104('0x1'));var moment=require(_0x7104('0x2'));var BPromise=require('bluebird');var rs=require(_0x7104('0x3'));var fs=require('fs');var Redis=require(_0x7104('0x4'));var db=require(_0x7104('0x5'))['db'];var utils=require(_0x7104('0x6'));var logger=require('../../config/logger')(_0x7104('0x7'));var config=require(_0x7104('0x8'));var jayson=require(_0x7104('0x9'));var client=jayson[_0x7104('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x133ca0,_0x210e49,_0x51d264){return new BPromise(function(_0x4a0385,_0x255814){return client['request'](_0x133ca0,_0x51d264)[_0x7104('0xb')](function(_0x25328b){logger[_0x7104('0xc')](_0x7104('0xd'),_0x210e49,_0x7104('0xe'));logger[_0x7104('0xf')](_0x7104('0x10'),_0x210e49,_0x7104('0xe'),JSON[_0x7104('0x11')](_0x25328b));if(_0x25328b[_0x7104('0x12')]){if(_0x25328b['error'][_0x7104('0x13')]===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x210e49,_0x25328b[_0x7104('0x12')][_0x7104('0x14')]);return _0x255814(_0x25328b['error'][_0x7104('0x14')]);}logger[_0x7104('0x12')](_0x7104('0xd'),_0x210e49,_0x25328b[_0x7104('0x12')][_0x7104('0x14')]);return _0x4a0385(_0x25328b[_0x7104('0x12')][_0x7104('0x14')]);}else{logger[_0x7104('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x210e49,_0x7104('0xe'));_0x4a0385(_0x25328b[_0x7104('0x15')][_0x7104('0x14')]);}})[_0x7104('0x16')](function(_0x18ea51){logger[_0x7104('0x12')](_0x7104('0xd'),_0x210e49,_0x18ea51);_0x255814(_0x18ea51);});});} \ No newline at end of file +var _0x5337=['Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x5337,0x134));var _0x7533=function(_0x32f91b,_0x460016){_0x32f91b=_0x32f91b-0x0;var _0x3ee8f3=_0x5337[_0x32f91b];return _0x3ee8f3;};'use strict';var _=require(_0x7533('0x0'));var util=require(_0x7533('0x1'));var moment=require('moment');var BPromise=require(_0x7533('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7533('0x3'));var db=require(_0x7533('0x4'))['db'];var utils=require(_0x7533('0x5'));var logger=require(_0x7533('0x6'))(_0x7533('0x7'));var config=require(_0x7533('0x8'));var jayson=require(_0x7533('0x9'));var client=jayson['client'][_0x7533('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5aaaa6,_0x10a3ce,_0x4fc0dc){return new BPromise(function(_0x38137b,_0x5ea293){return client['request'](_0x5aaaa6,_0x4fc0dc)['then'](function(_0x135c33){logger[_0x7533('0xb')](_0x7533('0xc'),_0x10a3ce,_0x7533('0xd'));logger[_0x7533('0xe')](_0x7533('0xf'),_0x10a3ce,_0x7533('0xd'),JSON[_0x7533('0x10')](_0x135c33));if(_0x135c33[_0x7533('0x11')]){if(_0x135c33[_0x7533('0x11')]['code']===0x1f4){logger[_0x7533('0x11')](_0x7533('0xc'),_0x10a3ce,_0x135c33[_0x7533('0x11')][_0x7533('0x12')]);return _0x5ea293(_0x135c33[_0x7533('0x11')]['message']);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x10a3ce,_0x135c33['error'][_0x7533('0x12')]);return _0x38137b(_0x135c33[_0x7533('0x11')]['message']);}else{logger[_0x7533('0xb')](_0x7533('0xc'),_0x10a3ce,_0x7533('0xd'));_0x38137b(_0x135c33['result'][_0x7533('0x12')]);}})['catch'](function(_0x5473c8){logger[_0x7533('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x10a3ce,_0x5473c8);_0x5ea293(_0x5473c8);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 272bcf5..ac184a4 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 _0x284e=['put','update','delete','destroy','exports','multer','util','Router','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','index','/:id','isAuthenticated','show','create'];(function(_0x290f25,_0x2b0140){var _0x555fa1=function(_0x357511){while(--_0x357511){_0x290f25['push'](_0x290f25['shift']());}};_0x555fa1(++_0x2b0140);}(_0x284e,0x137));var _0xe284=function(_0x5d7ab3,_0x5d8ce4){_0x5d7ab3=_0x5d7ab3-0x0;var _0x24a509=_0x284e[_0x5d7ab3];return _0x24a509;};'use strict';var multer=require(_0xe284('0x0'));var util=require(_0xe284('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe284('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe284('0x3'));var config=require(_0xe284('0x4'));var controller=require(_0xe284('0x5'));router[_0xe284('0x6')]('/',auth['isAuthenticated'](),controller[_0xe284('0x7')]);router['get'](_0xe284('0x8'),auth[_0xe284('0x9')](),controller[_0xe284('0xa')]);router['post']('/',auth[_0xe284('0x9')](),controller[_0xe284('0xb')]);router[_0xe284('0xc')](_0xe284('0x8'),auth['isAuthenticated'](),controller[_0xe284('0xd')]);router[_0xe284('0xe')](_0xe284('0x8'),auth[_0xe284('0x9')](),controller[_0xe284('0xf')]);module[_0xe284('0x10')]=router; \ No newline at end of file +var _0x6671=['../../components/auth/service','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x28f346,_0x7654bc){var _0x1e8465=function(_0x16eae1){while(--_0x16eae1){_0x28f346['push'](_0x28f346['shift']());}};_0x1e8465(++_0x7654bc);}(_0x6671,0x14f));var _0x1667=function(_0x2e1f14,_0x4bca84){_0x2e1f14=_0x2e1f14-0x0;var _0x5ef864=_0x6671[_0x2e1f14];return _0x5ef864;};'use strict';var multer=require(_0x1667('0x0'));var util=require(_0x1667('0x1'));var path=require(_0x1667('0x2'));var timeout=require(_0x1667('0x3'));var express=require(_0x1667('0x4'));var router=express[_0x1667('0x5')]();var fs_extra=require(_0x1667('0x6'));var auth=require(_0x1667('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router[_0x1667('0x8')]('/',auth[_0x1667('0x9')](),controller[_0x1667('0xa')]);router[_0x1667('0x8')](_0x1667('0xb'),auth[_0x1667('0x9')](),controller[_0x1667('0xc')]);router[_0x1667('0xd')]('/',auth[_0x1667('0x9')](),controller[_0x1667('0xe')]);router[_0x1667('0xf')](_0x1667('0xb'),auth[_0x1667('0x9')](),controller[_0x1667('0x10')]);router['delete'](_0x1667('0xb'),auth[_0x1667('0x9')](),controller[_0x1667('0x11')]);module[_0x1667('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 6b1f263..11cc75c 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 _0xb76e=['customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x1e31bd,_0x4d592e){var _0x2cc7b1=function(_0x2fb41c){while(--_0x2fb41c){_0x1e31bd['push'](_0x1e31bd['shift']());}};_0x2cc7b1(++_0x4d592e);}(_0xb76e,0x1b4));var _0xeb76=function(_0x4e38cb,_0x5e71f4){_0x4e38cb=_0x4e38cb-0x0;var _0x274a9c=_0xb76e[_0x4e38cb];return _0x274a9c;};'use strict';var Sequelize=require(_0xeb76('0x0'));module[_0xeb76('0x1')]={'type':{'type':Sequelize[_0xeb76('0x2')](_0xeb76('0x3'),_0xeb76('0x4'),_0xeb76('0x5'),_0xeb76('0x6'),_0xeb76('0x7')),'defaultValue':_0xeb76('0x3')},'content':{'type':Sequelize[_0xeb76('0x8')]},'key':{'type':Sequelize[_0xeb76('0x8')]},'keyType':{'type':Sequelize[_0xeb76('0x2')](_0xeb76('0x3'),_0xeb76('0x4'),_0xeb76('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbaab=['BOOLEAN','sequelize','string','variable','keyValue','picklist','ENUM','STRING'];(function(_0x5af85e,_0x5f55c2){var _0x10d7e0=function(_0x14e800){while(--_0x14e800){_0x5af85e['push'](_0x5af85e['shift']());}};_0x10d7e0(++_0x5f55c2);}(_0xbaab,0xe1));var _0xbbaa=function(_0x2bd39f,_0x39b4d3){_0x2bd39f=_0x2bd39f-0x0;var _0x25df15=_0xbaab[_0x2bd39f];return _0x25df15;};'use strict';var Sequelize=require(_0xbbaa('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xbbaa('0x1'),_0xbbaa('0x2'),'customVariable',_0xbbaa('0x3'),_0xbbaa('0x4')),'defaultValue':_0xbbaa('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xbbaa('0x5')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0xbbaa('0x6')]},'idField':{'type':Sequelize[_0xbbaa('0x6')]},'nameField':{'type':Sequelize[_0xbbaa('0x6')]},'customField':{'type':Sequelize[_0xbbaa('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 73efa58..fd09f49 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 _0x7674=['show','fields','options','create','catch','body','find','params','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','Dynamics365Field','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows'];(function(_0x2fb68a,_0x2598dc){var _0x2cac25=function(_0x154f87){while(--_0x154f87){_0x2fb68a['push'](_0x2fb68a['shift']());}};_0x2cac25(++_0x2598dc);}(_0x7674,0x94));var _0x4767=function(_0x1b64dd,_0x2cf769){_0x1b64dd=_0x1b64dd-0x0;var _0xeb464c=_0x7674[_0x1b64dd];return _0xeb464c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4767('0x0'));var rp=require(_0x4767('0x1'));var moment=require(_0x4767('0x2'));var BPromise=require(_0x4767('0x3'));var Mustache=require('mustache');var util=require(_0x4767('0x4'));var path=require('path');var sox=require(_0x4767('0x5'));var csv=require(_0x4767('0x6'));var ejs=require(_0x4767('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4767('0x8'));var squel=require('squel');var crypto=require(_0x4767('0x9'));var jsforce=require(_0x4767('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4767('0x6'));var querystring=require(_0x4767('0xb'));var Papa=require(_0x4767('0xc'));var Redis=require(_0x4767('0xd'));var authService=require(_0x4767('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x4767('0xf'));var hardwareService=require(_0x4767('0x10'));var logger=require(_0x4767('0x11'))('api');var utils=require(_0x4767('0x12'));var config=require(_0x4767('0x13'));var licenseUtil=require(_0x4767('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e1afa,_0x551e48){_0x551e48=_0x551e48||0xcc;return function(_0x5be35c){if(_0x5be35c){return _0x4e1afa[_0x4767('0x15')](_0x551e48);}return _0x4e1afa[_0x4767('0x16')](_0x551e48)['end']();};}function respondWithResult(_0x49205a,_0x43d2e9){_0x43d2e9=_0x43d2e9||0xc8;return function(_0x232693){if(_0x232693){return _0x49205a[_0x4767('0x16')](_0x43d2e9)[_0x4767('0x17')](_0x232693);}};}function respondWithFilteredResult(_0x2285e9,_0xf0b7e4){return function(_0x5ba1cc){if(_0x5ba1cc){var _0x165755=typeof _0xf0b7e4['offset']===_0x4767('0x18')&&typeof _0xf0b7e4[_0x4767('0x19')]===_0x4767('0x18');var _0x5123ce=_0x5ba1cc[_0x4767('0x1a')];var _0x317f81=_0x165755?0x0:_0xf0b7e4[_0x4767('0x1b')];var _0x1aba25=_0x165755?_0x5ba1cc[_0x4767('0x1a')]:_0xf0b7e4[_0x4767('0x1b')]+_0xf0b7e4[_0x4767('0x19')];var _0x43b995;if(_0x1aba25>=_0x5123ce){_0x1aba25=_0x5123ce;_0x43b995=0xc8;}else{_0x43b995=0xce;}_0x2285e9['status'](_0x43b995);return _0x2285e9[_0x4767('0x1c')](_0x4767('0x1d'),_0x317f81+'-'+_0x1aba25+'/'+_0x5123ce)[_0x4767('0x17')](_0x5ba1cc);}return null;};}function patchUpdates(_0x5923fb){return function(_0x43be41){try{jsonpatch[_0x4767('0x1e')](_0x43be41,_0x5923fb,!![]);}catch(_0x192fd9){return BPromise[_0x4767('0x1f')](_0x192fd9);}return _0x43be41[_0x4767('0x20')]();};}function saveUpdates(_0x954f96,_0x2d11a2){return function(_0x1d9ee7){if(_0x1d9ee7){return _0x1d9ee7[_0x4767('0x21')](_0x954f96)[_0x4767('0x22')](function(_0x25e182){return _0x25e182;});}return null;};}function removeEntity(_0x37fea5,_0x1a128a){return function(_0x48378e){if(_0x48378e){return _0x48378e[_0x4767('0x23')]()[_0x4767('0x22')](function(){_0x37fea5[_0x4767('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51b674,_0x510de6){return function(_0x24686b){if(!_0x24686b){_0x51b674[_0x4767('0x15')](0x194);}return _0x24686b;};}function handleError(_0x13cc27,_0x5a28f1){_0x5a28f1=_0x5a28f1||0x1f4;return function(_0x3cc083){logger['error'](_0x3cc083[_0x4767('0x24')]);if(_0x3cc083[_0x4767('0x25')]){delete _0x3cc083[_0x4767('0x25')];}_0x13cc27[_0x4767('0x16')](_0x5a28f1)[_0x4767('0x26')](_0x3cc083);};}exports[_0x4767('0x27')]=function(_0x4d95d2,_0x5dd7e6){var _0x3c51d3={},_0x116b94={},_0xd35d83={'count':0x0,'rows':[]};var _0x4b4df8=_[_0x4767('0x28')](db[_0x4767('0x29')][_0x4767('0x2a')],function(_0x16a637){return{'name':_0x16a637['fieldName'],'type':_0x16a637[_0x4767('0x2b')]['key']};});_0x116b94[_0x4767('0x2c')]=_[_0x4767('0x28')](_0x4b4df8,_0x4767('0x25'));_0x116b94[_0x4767('0x2d')]=_[_0x4767('0x2e')](_0x4d95d2[_0x4767('0x2d')]);_0x116b94[_0x4767('0x2f')]=_[_0x4767('0x30')](_0x116b94[_0x4767('0x2c')],_0x116b94[_0x4767('0x2d')]);_0x3c51d3[_0x4767('0x31')]=_['intersection'](_0x116b94['model'],qs['fields'](_0x4d95d2[_0x4767('0x2d')]['fields']));_0x3c51d3[_0x4767('0x31')]=_0x3c51d3[_0x4767('0x31')][_0x4767('0x32')]?_0x3c51d3[_0x4767('0x31')]:_0x116b94['model'];if(!_0x4d95d2['query']['hasOwnProperty'](_0x4767('0x33'))){_0x3c51d3[_0x4767('0x19')]=qs[_0x4767('0x19')](_0x4d95d2[_0x4767('0x2d')]['limit']);_0x3c51d3[_0x4767('0x1b')]=qs[_0x4767('0x1b')](_0x4d95d2['query'][_0x4767('0x1b')]);}_0x3c51d3[_0x4767('0x34')]=qs[_0x4767('0x35')](_0x4d95d2[_0x4767('0x2d')][_0x4767('0x35')]);_0x3c51d3[_0x4767('0x36')]=qs['filters'](_['pick'](_0x4d95d2[_0x4767('0x2d')],_0x116b94['filters']),_0x4b4df8);if(_0x4d95d2[_0x4767('0x2d')]['filter']){_0x3c51d3[_0x4767('0x36')]=_[_0x4767('0x37')](_0x3c51d3['where'],{'$or':_[_0x4767('0x28')](_0x4b4df8,function(_0xbb38dd){if(_0xbb38dd[_0x4767('0x2b')]!==_0x4767('0x38')){var _0x309505={};_0x309505[_0xbb38dd[_0x4767('0x25')]]={'$like':'%'+_0x4d95d2['query'][_0x4767('0x39')]+'%'};return _0x309505;}})});}_0x3c51d3=_[_0x4767('0x37')]({},_0x3c51d3,_0x4d95d2['options']);var _0x3f1828={'where':_0x3c51d3[_0x4767('0x36')]};return db['Dynamics365Field'][_0x4767('0x1a')](_0x3f1828)['then'](function(_0x351b68){_0xd35d83[_0x4767('0x1a')]=_0x351b68;if(_0x4d95d2['query'][_0x4767('0x3a')]){_0x3c51d3[_0x4767('0x3b')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x4767('0x3c')](_0x3c51d3);})[_0x4767('0x22')](function(_0x32c910){_0xd35d83[_0x4767('0x3d')]=_0x32c910;return _0xd35d83;})[_0x4767('0x22')](respondWithFilteredResult(_0x5dd7e6,_0x3c51d3))['catch'](handleError(_0x5dd7e6,null));};exports[_0x4767('0x3e')]=function(_0x515390,_0x3a31a9){var _0x49db5f={'raw':!![],'where':{'id':_0x515390['params']['id']}},_0x44bff0={};_0x44bff0[_0x4767('0x2c')]=_[_0x4767('0x2e')](db[_0x4767('0x29')][_0x4767('0x2a')]);_0x44bff0[_0x4767('0x2d')]=_[_0x4767('0x2e')](_0x515390['query']);_0x44bff0['filters']=_['intersection'](_0x44bff0[_0x4767('0x2c')],_0x44bff0[_0x4767('0x2d')]);_0x49db5f['attributes']=_['intersection'](_0x44bff0['model'],qs[_0x4767('0x3f')](_0x515390[_0x4767('0x2d')][_0x4767('0x3f')]));_0x49db5f[_0x4767('0x31')]=_0x49db5f[_0x4767('0x31')][_0x4767('0x32')]?_0x49db5f[_0x4767('0x31')]:_0x44bff0[_0x4767('0x2c')];if(_0x515390[_0x4767('0x2d')][_0x4767('0x3a')]){_0x49db5f[_0x4767('0x3b')]=[{'all':!![]}];}_0x49db5f=_['merge']({},_0x49db5f,_0x515390[_0x4767('0x40')]);return db[_0x4767('0x29')]['find'](_0x49db5f)[_0x4767('0x22')](handleEntityNotFound(_0x3a31a9,null))[_0x4767('0x22')](respondWithResult(_0x3a31a9,null))['catch'](handleError(_0x3a31a9,null));};exports[_0x4767('0x41')]=function(_0xea4321,_0x2c1f1d){return db['Dynamics365Field'][_0x4767('0x41')](_0xea4321['body'],{})[_0x4767('0x22')](respondWithResult(_0x2c1f1d,0xc9))[_0x4767('0x42')](handleError(_0x2c1f1d,null));};exports[_0x4767('0x21')]=function(_0x25a30c,_0x1b6b62){if(_0x25a30c['body']['id']){delete _0x25a30c[_0x4767('0x43')]['id'];}return db['Dynamics365Field'][_0x4767('0x44')]({'where':{'id':_0x25a30c[_0x4767('0x45')]['id']}})['then'](handleEntityNotFound(_0x1b6b62,null))[_0x4767('0x22')](saveUpdates(_0x25a30c['body'],null))[_0x4767('0x22')](respondWithResult(_0x1b6b62,null))[_0x4767('0x42')](handleError(_0x1b6b62,null));};exports[_0x4767('0x23')]=function(_0x3dab01,_0x521088){return db['Dynamics365Field'][_0x4767('0x44')]({'where':{'id':_0x3dab01[_0x4767('0x45')]['id']}})[_0x4767('0x22')](handleEntityNotFound(_0x521088,null))['then'](removeEntity(_0x521088,null))[_0x4767('0x42')](handleError(_0x521088,null));}; \ No newline at end of file +var _0xb155=['show','params','include','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','end','error','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','findAll','catch'];(function(_0x151d64,_0x360f73){var _0x409cfd=function(_0x152309){while(--_0x152309){_0x151d64['push'](_0x151d64['shift']());}};_0x409cfd(++_0x360f73);}(_0xb155,0x1c8));var _0x5b15=function(_0xdeac17,_0x19ad66){_0xdeac17=_0xdeac17-0x0;var _0x33aabd=_0xb155[_0xdeac17];return _0x33aabd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b15('0x0'));var zipdir=require(_0x5b15('0x1'));var jsonpatch=require(_0x5b15('0x2'));var rp=require(_0x5b15('0x3'));var moment=require(_0x5b15('0x4'));var BPromise=require(_0x5b15('0x5'));var Mustache=require(_0x5b15('0x6'));var util=require('util');var path=require(_0x5b15('0x7'));var sox=require(_0x5b15('0x8'));var csv=require(_0x5b15('0x9'));var ejs=require(_0x5b15('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5b15('0xb'));var crypto=require(_0x5b15('0xc'));var jsforce=require(_0x5b15('0xd'));var deskjs=require(_0x5b15('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5b15('0xf'));var Redis=require(_0x5b15('0x10'));var authService=require(_0x5b15('0x11'));var qs=require(_0x5b15('0x12'));var as=require(_0x5b15('0x13'));var hardwareService=require(_0x5b15('0x14'));var logger=require(_0x5b15('0x15'))(_0x5b15('0x16'));var utils=require(_0x5b15('0x17'));var config=require(_0x5b15('0x18'));var licenseUtil=require(_0x5b15('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bef49,_0x33dba4){_0x33dba4=_0x33dba4||0xcc;return function(_0x315ccb){if(_0x315ccb){return _0x2bef49[_0x5b15('0x1a')](_0x33dba4);}return _0x2bef49['status'](_0x33dba4)['end']();};}function respondWithResult(_0x2b3ef5,_0x442a80){_0x442a80=_0x442a80||0xc8;return function(_0x5308d2){if(_0x5308d2){return _0x2b3ef5[_0x5b15('0x1b')](_0x442a80)['json'](_0x5308d2);}};}function respondWithFilteredResult(_0x439774,_0x3b3d3b){return function(_0x2ec246){if(_0x2ec246){var _0x2d63a0=typeof _0x3b3d3b[_0x5b15('0x1c')]===_0x5b15('0x1d')&&typeof _0x3b3d3b[_0x5b15('0x1e')]===_0x5b15('0x1d');var _0x379d9a=_0x2ec246[_0x5b15('0x1f')];var _0x4d9d8a=_0x2d63a0?0x0:_0x3b3d3b[_0x5b15('0x1c')];var _0x4e6172=_0x2d63a0?_0x2ec246[_0x5b15('0x1f')]:_0x3b3d3b['offset']+_0x3b3d3b[_0x5b15('0x1e')];var _0x4afd11;if(_0x4e6172>=_0x379d9a){_0x4e6172=_0x379d9a;_0x4afd11=0xc8;}else{_0x4afd11=0xce;}_0x439774[_0x5b15('0x1b')](_0x4afd11);return _0x439774[_0x5b15('0x20')](_0x5b15('0x21'),_0x4d9d8a+'-'+_0x4e6172+'/'+_0x379d9a)[_0x5b15('0x22')](_0x2ec246);}return null;};}function patchUpdates(_0x394e09){return function(_0x5268c0){try{jsonpatch[_0x5b15('0x23')](_0x5268c0,_0x394e09,!![]);}catch(_0x2d1686){return BPromise['reject'](_0x2d1686);}return _0x5268c0[_0x5b15('0x24')]();};}function saveUpdates(_0x585478,_0x4d8e82){return function(_0x33da4a){if(_0x33da4a){return _0x33da4a[_0x5b15('0x25')](_0x585478)[_0x5b15('0x26')](function(_0x3c7d0d){return _0x3c7d0d;});}return null;};}function removeEntity(_0x2f9d4c,_0x2cad22){return function(_0x59b09d){if(_0x59b09d){return _0x59b09d[_0x5b15('0x27')]()[_0x5b15('0x26')](function(){_0x2f9d4c[_0x5b15('0x1b')](0xcc)[_0x5b15('0x28')]();});}};}function handleEntityNotFound(_0x215b81,_0x183512){return function(_0x52b9b1){if(!_0x52b9b1){_0x215b81[_0x5b15('0x1a')](0x194);}return _0x52b9b1;};}function handleError(_0xe2cb3a,_0xb6b83a){_0xb6b83a=_0xb6b83a||0x1f4;return function(_0x45694b){logger[_0x5b15('0x29')](_0x45694b['stack']);if(_0x45694b[_0x5b15('0x2a')]){delete _0x45694b[_0x5b15('0x2a')];}_0xe2cb3a[_0x5b15('0x1b')](_0xb6b83a)[_0x5b15('0x2b')](_0x45694b);};}exports[_0x5b15('0x2c')]=function(_0x1474a0,_0x379f76){var _0x2fc372={},_0x1958f7={},_0x4abe65={'count':0x0,'rows':[]};var _0x53f559=_[_0x5b15('0x2d')](db[_0x5b15('0x2e')][_0x5b15('0x2f')],function(_0x32d09e){return{'name':_0x32d09e[_0x5b15('0x30')],'type':_0x32d09e[_0x5b15('0x31')][_0x5b15('0x32')]};});_0x1958f7[_0x5b15('0x33')]=_[_0x5b15('0x2d')](_0x53f559,'name');_0x1958f7[_0x5b15('0x34')]=_[_0x5b15('0x35')](_0x1474a0[_0x5b15('0x34')]);_0x1958f7['filters']=_[_0x5b15('0x36')](_0x1958f7[_0x5b15('0x33')],_0x1958f7[_0x5b15('0x34')]);_0x2fc372[_0x5b15('0x37')]=_[_0x5b15('0x36')](_0x1958f7[_0x5b15('0x33')],qs[_0x5b15('0x38')](_0x1474a0['query']['fields']));_0x2fc372['attributes']=_0x2fc372[_0x5b15('0x37')][_0x5b15('0x39')]?_0x2fc372[_0x5b15('0x37')]:_0x1958f7[_0x5b15('0x33')];if(!_0x1474a0[_0x5b15('0x34')][_0x5b15('0x3a')](_0x5b15('0x3b'))){_0x2fc372[_0x5b15('0x1e')]=qs['limit'](_0x1474a0[_0x5b15('0x34')][_0x5b15('0x1e')]);_0x2fc372['offset']=qs[_0x5b15('0x1c')](_0x1474a0[_0x5b15('0x34')]['offset']);}_0x2fc372[_0x5b15('0x3c')]=qs[_0x5b15('0x3d')](_0x1474a0['query'][_0x5b15('0x3d')]);_0x2fc372[_0x5b15('0x3e')]=qs[_0x5b15('0x3f')](_['pick'](_0x1474a0[_0x5b15('0x34')],_0x1958f7['filters']),_0x53f559);if(_0x1474a0['query'][_0x5b15('0x40')]){_0x2fc372[_0x5b15('0x3e')]=_['merge'](_0x2fc372[_0x5b15('0x3e')],{'$or':_[_0x5b15('0x2d')](_0x53f559,function(_0x40034e){if(_0x40034e['type']!=='VIRTUAL'){var _0x58876b={};_0x58876b[_0x40034e[_0x5b15('0x2a')]]={'$like':'%'+_0x1474a0[_0x5b15('0x34')][_0x5b15('0x40')]+'%'};return _0x58876b;}})});}_0x2fc372=_[_0x5b15('0x41')]({},_0x2fc372,_0x1474a0['options']);var _0x2182d9={'where':_0x2fc372[_0x5b15('0x3e')]};return db[_0x5b15('0x2e')][_0x5b15('0x1f')](_0x2182d9)['then'](function(_0x175601){_0x4abe65[_0x5b15('0x1f')]=_0x175601;if(_0x1474a0[_0x5b15('0x34')][_0x5b15('0x42')]){_0x2fc372['include']=[{'all':!![]}];}return db[_0x5b15('0x2e')][_0x5b15('0x43')](_0x2fc372);})[_0x5b15('0x26')](function(_0x236028){_0x4abe65['rows']=_0x236028;return _0x4abe65;})[_0x5b15('0x26')](respondWithFilteredResult(_0x379f76,_0x2fc372))[_0x5b15('0x44')](handleError(_0x379f76,null));};exports[_0x5b15('0x45')]=function(_0x4bed68,_0xb1d2a0){var _0x4e63c6={'raw':!![],'where':{'id':_0x4bed68[_0x5b15('0x46')]['id']}},_0x29d5da={};_0x29d5da['model']=_[_0x5b15('0x35')](db[_0x5b15('0x2e')][_0x5b15('0x2f')]);_0x29d5da['query']=_[_0x5b15('0x35')](_0x4bed68[_0x5b15('0x34')]);_0x29d5da['filters']=_[_0x5b15('0x36')](_0x29d5da[_0x5b15('0x33')],_0x29d5da[_0x5b15('0x34')]);_0x4e63c6[_0x5b15('0x37')]=_[_0x5b15('0x36')](_0x29d5da[_0x5b15('0x33')],qs['fields'](_0x4bed68['query'][_0x5b15('0x38')]));_0x4e63c6['attributes']=_0x4e63c6[_0x5b15('0x37')][_0x5b15('0x39')]?_0x4e63c6[_0x5b15('0x37')]:_0x29d5da[_0x5b15('0x33')];if(_0x4bed68[_0x5b15('0x34')][_0x5b15('0x42')]){_0x4e63c6[_0x5b15('0x47')]=[{'all':!![]}];}_0x4e63c6=_['merge']({},_0x4e63c6,_0x4bed68['options']);return db[_0x5b15('0x2e')][_0x5b15('0x48')](_0x4e63c6)[_0x5b15('0x26')](handleEntityNotFound(_0xb1d2a0,null))[_0x5b15('0x26')](respondWithResult(_0xb1d2a0,null))['catch'](handleError(_0xb1d2a0,null));};exports['create']=function(_0x6c62aa,_0x300e96){return db[_0x5b15('0x2e')][_0x5b15('0x49')](_0x6c62aa[_0x5b15('0x4a')],{})[_0x5b15('0x26')](respondWithResult(_0x300e96,0xc9))[_0x5b15('0x44')](handleError(_0x300e96,null));};exports[_0x5b15('0x25')]=function(_0x2a1e43,_0x447f71){if(_0x2a1e43[_0x5b15('0x4a')]['id']){delete _0x2a1e43[_0x5b15('0x4a')]['id'];}return db['Dynamics365Field'][_0x5b15('0x48')]({'where':{'id':_0x2a1e43['params']['id']}})[_0x5b15('0x26')](handleEntityNotFound(_0x447f71,null))[_0x5b15('0x26')](saveUpdates(_0x2a1e43[_0x5b15('0x4a')],null))[_0x5b15('0x26')](respondWithResult(_0x447f71,null))['catch'](handleError(_0x447f71,null));};exports[_0x5b15('0x27')]=function(_0x25e294,_0x34813a){return db[_0x5b15('0x2e')]['find']({'where':{'id':_0x25e294[_0x5b15('0x46')]['id']}})[_0x5b15('0x26')](handleEntityNotFound(_0x34813a,null))['then'](removeEntity(_0x34813a,null))['catch'](handleError(_0x34813a,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index c6d1323..74b8bab 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 _0x0867=['request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','dynamics365_unique_index','idField','lodash','util','../../config/logger','moment'];(function(_0x5c2cd1,_0x53b74d){var _0x500d9d=function(_0x8ba57a){while(--_0x8ba57a){_0x5c2cd1['push'](_0x5c2cd1['shift']());}};_0x500d9d(++_0x53b74d);}(_0x0867,0x192));var _0x7086=function(_0x2078b8,_0x2d35a3){_0x2078b8=_0x2078b8-0x0;var _0x3deae3=_0x0867[_0x2078b8];return _0x3deae3;};'use strict';var _=require(_0x7086('0x0'));var util=require(_0x7086('0x1'));var logger=require(_0x7086('0x2'))('api');var moment=require(_0x7086('0x3'));var BPromise=require('bluebird');var rp=require(_0x7086('0x4'));var fs=require('fs');var path=require(_0x7086('0x5'));var rimraf=require(_0x7086('0x6'));var config=require(_0x7086('0x7'));var attributes=require(_0x7086('0x8'));module[_0x7086('0x9')]=function(_0x54e2b8,_0x983bee){return _0x54e2b8[_0x7086('0xa')](_0x7086('0xb'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x7086('0xc'),'fields':[_0x7086('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8e6f=['path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e6f,0x149));var _0xf8e6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8e6f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf8e6('0x0'));var util=require(_0xf8e6('0x1'));var logger=require(_0xf8e6('0x2'))(_0xf8e6('0x3'));var moment=require(_0xf8e6('0x4'));var BPromise=require(_0xf8e6('0x5'));var rp=require(_0xf8e6('0x6'));var fs=require('fs');var path=require(_0xf8e6('0x7'));var rimraf=require(_0xf8e6('0x8'));var config=require(_0xf8e6('0x9'));var attributes=require(_0xf8e6('0xa'));module[_0xf8e6('0xb')]=function(_0x2c8c66,_0xc0b984){return _0x2c8c66['define'](_0xf8e6('0xc'),attributes,{'tableName':_0xf8e6('0xd'),'paranoid':![],'indexes':[{'name':_0xf8e6('0xe'),'fields':[_0xf8e6('0xf'),'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 f26f58c..3987941 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 _0x8421=['info','Dynamics365Field,\x20%s,\x20%s','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x9a16e8,_0x123ac5){var _0x837cb8=function(_0x4800f5){while(--_0x4800f5){_0x9a16e8['push'](_0x9a16e8['shift']());}};_0x837cb8(++_0x123ac5);}(_0x8421,0x198));var _0x1842=function(_0x1cf7d1,_0x395d36){_0x1cf7d1=_0x1cf7d1-0x0;var _0x28f291=_0x8421[_0x1cf7d1];return _0x28f291;};'use strict';var _=require(_0x1842('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1842('0x1'));var rs=require(_0x1842('0x2'));var fs=require('fs');var Redis=require(_0x1842('0x3'));var db=require(_0x1842('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1842('0x5'))(_0x1842('0x6'));var config=require(_0x1842('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1842('0x8')][_0x1842('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7ad366,_0x3869e9,_0x3511f7){return new BPromise(function(_0x2d38b9,_0x7f3c21){return client[_0x1842('0xa')](_0x7ad366,_0x3511f7)[_0x1842('0xb')](function(_0x2295d4){logger[_0x1842('0xc')](_0x1842('0xd'),_0x3869e9,'request\x20sent');logger['debug'](_0x1842('0xe'),_0x3869e9,_0x1842('0xf'),JSON[_0x1842('0x10')](_0x2295d4));if(_0x2295d4[_0x1842('0x11')]){if(_0x2295d4['error'][_0x1842('0x12')]===0x1f4){logger['error'](_0x1842('0xd'),_0x3869e9,_0x2295d4['error'][_0x1842('0x13')]);return _0x7f3c21(_0x2295d4[_0x1842('0x11')][_0x1842('0x13')]);}logger[_0x1842('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x3869e9,_0x2295d4[_0x1842('0x11')][_0x1842('0x13')]);return _0x2d38b9(_0x2295d4[_0x1842('0x11')][_0x1842('0x13')]);}else{logger[_0x1842('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x3869e9,_0x1842('0xf'));_0x2d38b9(_0x2295d4['result']['message']);}})[_0x1842('0x14')](function(_0x4e7a7a){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x3869e9,_0x4e7a7a);_0x7f3c21(_0x4e7a7a);});});} \ No newline at end of file +var _0xa03b=['../../config/environment','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xa03b,0x1ae));var _0xba03=function(_0x5b077b,_0x50b707){_0x5b077b=_0x5b077b-0x0;var _0x16faf7=_0xa03b[_0x5b077b];return _0x16faf7;};'use strict';var _=require('lodash');var util=require(_0xba03('0x0'));var moment=require(_0xba03('0x1'));var BPromise=require(_0xba03('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba03('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xba03('0x4'));var logger=require(_0xba03('0x5'))(_0xba03('0x6'));var config=require(_0xba03('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba03('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa6c949,_0x5d7326,_0x12a4a0){return new BPromise(function(_0x11809a,_0x3f1bc9){return client[_0xba03('0x9')](_0xa6c949,_0x12a4a0)[_0xba03('0xa')](function(_0x2d7549){logger[_0xba03('0xb')](_0xba03('0xc'),_0x5d7326,'request\x20sent');logger['debug'](_0xba03('0xd'),_0x5d7326,'request\x20sent',JSON[_0xba03('0xe')](_0x2d7549));if(_0x2d7549[_0xba03('0xf')]){if(_0x2d7549['error']['code']===0x1f4){logger[_0xba03('0xf')](_0xba03('0xc'),_0x5d7326,_0x2d7549[_0xba03('0xf')]['message']);return _0x3f1bc9(_0x2d7549[_0xba03('0xf')]['message']);}logger[_0xba03('0xf')](_0xba03('0xc'),_0x5d7326,_0x2d7549[_0xba03('0xf')][_0xba03('0x10')]);return _0x11809a(_0x2d7549[_0xba03('0xf')][_0xba03('0x10')]);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x5d7326,_0xba03('0x11'));_0x11809a(_0x2d7549[_0xba03('0x12')][_0xba03('0x10')]);}})['catch'](function(_0xf56005){logger['error'](_0xba03('0xc'),_0x5d7326,_0xf56005);_0x3f1bc9(_0xf56005);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 12c0269..3d7ccfc 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 _0xaaf5=['put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x514c58,_0x1e9a1d){var _0x406483=function(_0x24be87){while(--_0x24be87){_0x514c58['push'](_0x514c58['shift']());}};_0x406483(++_0x1e9a1d);}(_0xaaf5,0xb3));var _0x5aaf=function(_0x3866d4,_0x540d26){_0x3866d4=_0x3866d4-0x0;var _0x4ba638=_0xaaf5[_0x3866d4];return _0x4ba638;};'use strict';var multer=require(_0x5aaf('0x0'));var util=require(_0x5aaf('0x1'));var path=require(_0x5aaf('0x2'));var timeout=require(_0x5aaf('0x3'));var express=require('express');var router=express[_0x5aaf('0x4')]();var fs_extra=require(_0x5aaf('0x5'));var auth=require(_0x5aaf('0x6'));var interaction=require(_0x5aaf('0x7'));var config=require(_0x5aaf('0x8'));var controller=require(_0x5aaf('0x9'));router[_0x5aaf('0xa')]('/',auth[_0x5aaf('0xb')](),controller[_0x5aaf('0xc')]);router['get'](_0x5aaf('0xd'),auth[_0x5aaf('0xb')](),controller['show']);router[_0x5aaf('0xa')](_0x5aaf('0xe'),auth['isAuthenticated'](),controller[_0x5aaf('0xf')]);router[_0x5aaf('0xa')](_0x5aaf('0x10'),auth[_0x5aaf('0xb')](),controller[_0x5aaf('0x11')]);router[_0x5aaf('0x12')]('/',auth['isAuthenticated'](),controller[_0x5aaf('0x13')]);router[_0x5aaf('0x12')](_0x5aaf('0xe'),auth[_0x5aaf('0xb')](),controller[_0x5aaf('0x14')]);router[_0x5aaf('0x15')](_0x5aaf('0xd'),auth[_0x5aaf('0xb')](),controller[_0x5aaf('0x16')]);router[_0x5aaf('0x17')](_0x5aaf('0xd'),auth[_0x5aaf('0xb')](),controller[_0x5aaf('0x18')]);module['exports']=router; \ No newline at end of file +var _0xeb3e=['get','isAuthenticated','index','show','/:id/configurations','getConfigurations','getFields','post','create','update','delete','/:id','exports','util','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x15bfaa,_0x4a4269){var _0x47b8e6=function(_0xc1248b){while(--_0xc1248b){_0x15bfaa['push'](_0x15bfaa['shift']());}};_0x47b8e6(++_0x4a4269);}(_0xeb3e,0x13f));var _0xeeb3=function(_0x5b6ace,_0x3a9cf7){_0x5b6ace=_0x5b6ace-0x0;var _0x2e9ba5=_0xeb3e[_0x5b6ace];return _0x2e9ba5;};'use strict';var multer=require('multer');var util=require(_0xeeb3('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xeeb3('0x1')]();var fs_extra=require(_0xeeb3('0x2'));var auth=require(_0xeeb3('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xeeb3('0x4'));var controller=require('./intFreshdeskAccount.controller');router[_0xeeb3('0x5')]('/',auth[_0xeeb3('0x6')](),controller[_0xeeb3('0x7')]);router[_0xeeb3('0x5')]('/:id',auth['isAuthenticated'](),controller[_0xeeb3('0x8')]);router['get'](_0xeeb3('0x9'),auth[_0xeeb3('0x6')](),controller[_0xeeb3('0xa')]);router['get']('/:id/fields',auth[_0xeeb3('0x6')](),controller[_0xeeb3('0xb')]);router[_0xeeb3('0xc')]('/',auth['isAuthenticated'](),controller[_0xeeb3('0xd')]);router[_0xeeb3('0xc')](_0xeeb3('0x9'),auth[_0xeeb3('0x6')](),controller['addConfiguration']);router['put']('/:id',auth[_0xeeb3('0x6')](),controller[_0xeeb3('0xe')]);router[_0xeeb3('0xf')](_0xeeb3('0x10'),auth[_0xeeb3('0x6')](),controller['destroy']);module[_0xeeb3('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index b678c22..6824159 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 _0x1eba=['exports','STRING','remoteUri','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x52e363,_0x48062a){_0x52e363=_0x52e363-0x0;var _0x3fc2b5=_0x1eba[_0x52e363];return _0x3fc2b5;};'use strict';var Sequelize=require(_0xa1eb('0x0'));module[_0xa1eb('0x1')]={'name':{'type':Sequelize[_0xa1eb('0x2')]},'description':{'type':Sequelize[_0xa1eb('0x2')]},'username':{'type':Sequelize[_0xa1eb('0x2')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xa1eb('0x2')],'unique':_0xa1eb('0x3')},'serverUrl':{'type':Sequelize[_0xa1eb('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x93e9=['sequelize','exports','STRING','username'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x93e9,0xcc));var _0x993e=function(_0xac18d3,_0x3b9c72){_0xac18d3=_0xac18d3-0x0;var _0x231952=_0x93e9[_0xac18d3];return _0x231952;};'use strict';var Sequelize=require(_0x993e('0x0'));module[_0x993e('0x1')]={'name':{'type':Sequelize[_0x993e('0x2')]},'description':{'type':Sequelize[_0x993e('0x2')]},'username':{'type':Sequelize[_0x993e('0x2')],'unique':_0x993e('0x3')},'apiKey':{'type':Sequelize[_0x993e('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x993e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 858f36d..ccf142e 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 _0x847d=['error','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','show','params','keys','fields','include','find','create','body','catch','getConfigurations','findOne','AccountId','Subjects','Descriptions','getDescriptions','channel','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','apiKey','format','%s/%s','Basic\x20%s','base64','requester','subject','agent','description','priority','group','source','ticket_type','remove','includes','default','custom_text','custom_dropdown','choices','capitalize','test','statusCode'];(function(_0x6bf335,_0x31b0c2){var _0x44bd73=function(_0x2c4b1b){while(--_0x2c4b1b){_0x6bf335['push'](_0x6bf335['shift']());}};_0x44bd73(++_0x31b0c2);}(_0x847d,0x14a));var _0xd847=function(_0x155c64,_0x26ff95){_0x155c64=_0x155c64-0x0;var _0x1f154a=_0x847d[_0x155c64];return _0x1f154a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd847('0x0'));var zipdir=require(_0xd847('0x1'));var jsonpatch=require(_0xd847('0x2'));var rp=require('request-promise');var moment=require(_0xd847('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd847('0x4'));var util=require(_0xd847('0x5'));var path=require('path');var sox=require(_0xd847('0x6'));var csv=require(_0xd847('0x7'));var ejs=require(_0xd847('0x8'));var fs=require('fs');var fs_extra=require(_0xd847('0x9'));var _=require('lodash');var squel=require(_0xd847('0xa'));var crypto=require(_0xd847('0xb'));var jsforce=require(_0xd847('0xc'));var deskjs=require(_0xd847('0xd'));var toCsv=require(_0xd847('0x7'));var querystring=require(_0xd847('0xe'));var Papa=require(_0xd847('0xf'));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(_0xd847('0x10'));var logger=require(_0xd847('0x11'))(_0xd847('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd847('0x13'));var db=require(_0xd847('0x14'))['db'];var integrations=require(_0xd847('0x15'));function respondWithStatusCode(_0x2ea8e7,_0x1e4e26){_0x1e4e26=_0x1e4e26||0xcc;return function(_0x1fc1ba){if(_0x1fc1ba){return _0x2ea8e7[_0xd847('0x16')](_0x1e4e26);}return _0x2ea8e7[_0xd847('0x17')](_0x1e4e26)[_0xd847('0x18')]();};}function respondWithResult(_0x2faa39,_0x3c4805){_0x3c4805=_0x3c4805||0xc8;return function(_0x54d827){if(_0x54d827){return _0x2faa39[_0xd847('0x17')](_0x3c4805)[_0xd847('0x19')](_0x54d827);}};}function respondWithFilteredResult(_0xd69fc9,_0x404bdb){return function(_0x16c79a){if(_0x16c79a){var _0x586c6e=typeof _0x404bdb[_0xd847('0x1a')]===_0xd847('0x1b')&&typeof _0x404bdb[_0xd847('0x1c')]===_0xd847('0x1b');var _0x570288=_0x16c79a[_0xd847('0x1d')];var _0x5eb665=_0x586c6e?0x0:_0x404bdb[_0xd847('0x1a')];var _0x44a57b=_0x586c6e?_0x16c79a[_0xd847('0x1d')]:_0x404bdb[_0xd847('0x1a')]+_0x404bdb[_0xd847('0x1c')];var _0x5a58f3;if(_0x44a57b>=_0x570288){_0x44a57b=_0x570288;_0x5a58f3=0xc8;}else{_0x5a58f3=0xce;}_0xd69fc9[_0xd847('0x17')](_0x5a58f3);return _0xd69fc9['set']('Content-Range',_0x5eb665+'-'+_0x44a57b+'/'+_0x570288)[_0xd847('0x19')](_0x16c79a);}return null;};}function patchUpdates(_0x2c1091){return function(_0x8d4d6f){try{jsonpatch[_0xd847('0x1e')](_0x8d4d6f,_0x2c1091,!![]);}catch(_0x43edca){return BPromise[_0xd847('0x1f')](_0x43edca);}return _0x8d4d6f[_0xd847('0x20')]();};}function saveUpdates(_0x39c465,_0x1eaf08){return function(_0x27c9f2){if(_0x27c9f2){return _0x27c9f2[_0xd847('0x21')](_0x39c465)[_0xd847('0x22')](function(_0x4a1691){return _0x4a1691;});}return null;};}function removeEntity(_0x560563,_0x26a787){return function(_0x1312ce){if(_0x1312ce){return _0x1312ce[_0xd847('0x23')]()['then'](function(){_0x560563[_0xd847('0x17')](0xcc)[_0xd847('0x18')]();});}};}function handleEntityNotFound(_0x74bf0e,_0x64b701){return function(_0x19c024){if(!_0x19c024){_0x74bf0e[_0xd847('0x16')](0x194);}return _0x19c024;};}function handleError(_0x24793c,_0x460eba){_0x460eba=_0x460eba||0x1f4;return function(_0x1b80a2){logger['error'](_0x1b80a2[_0xd847('0x24')]);if(_0x1b80a2[_0xd847('0x25')]){delete _0x1b80a2[_0xd847('0x25')];}_0x24793c[_0xd847('0x17')](_0x460eba)[_0xd847('0x26')](_0x1b80a2);};}exports[_0xd847('0x27')]=function(_0x5c0099,_0x1e6119){var _0x5375fe={},_0x488e54={},_0x58889c={'count':0x0,'rows':[]};var _0x184513=_[_0xd847('0x28')](db[_0xd847('0x29')][_0xd847('0x2a')],function(_0x38c015){return{'name':_0x38c015[_0xd847('0x2b')],'type':_0x38c015[_0xd847('0x2c')][_0xd847('0x2d')]};});_0x488e54[_0xd847('0x2e')]=_[_0xd847('0x28')](_0x184513,_0xd847('0x25'));_0x488e54[_0xd847('0x2f')]=_['keys'](_0x5c0099['query']);_0x488e54[_0xd847('0x30')]=_[_0xd847('0x31')](_0x488e54[_0xd847('0x2e')],_0x488e54[_0xd847('0x2f')]);_0x5375fe[_0xd847('0x32')]=_['intersection'](_0x488e54[_0xd847('0x2e')],qs['fields'](_0x5c0099[_0xd847('0x2f')]['fields']));_0x5375fe[_0xd847('0x32')]=_0x5375fe['attributes'][_0xd847('0x33')]?_0x5375fe[_0xd847('0x32')]:_0x488e54['model'];if(!_0x5c0099['query'][_0xd847('0x34')](_0xd847('0x35'))){_0x5375fe[_0xd847('0x1c')]=qs[_0xd847('0x1c')](_0x5c0099[_0xd847('0x2f')][_0xd847('0x1c')]);_0x5375fe['offset']=qs['offset'](_0x5c0099[_0xd847('0x2f')][_0xd847('0x1a')]);}_0x5375fe[_0xd847('0x36')]=qs['sort'](_0x5c0099[_0xd847('0x2f')][_0xd847('0x37')]);_0x5375fe['where']=qs['filters'](_[_0xd847('0x38')](_0x5c0099['query'],_0x488e54[_0xd847('0x30')]),_0x184513);if(_0x5c0099[_0xd847('0x2f')][_0xd847('0x39')]){_0x5375fe['where']=_['merge'](_0x5375fe[_0xd847('0x3a')],{'$or':_['map'](_0x184513,function(_0x5d19dc){if(_0x5d19dc[_0xd847('0x2c')]!=='VIRTUAL'){var _0x5d33c9={};_0x5d33c9[_0x5d19dc['name']]={'$like':'%'+_0x5c0099[_0xd847('0x2f')][_0xd847('0x39')]+'%'};return _0x5d33c9;}})});}_0x5375fe=_[_0xd847('0x3b')]({},_0x5375fe,_0x5c0099[_0xd847('0x3c')]);var _0x2e9931={'where':_0x5375fe[_0xd847('0x3a')]};return db['FreshdeskAccount'][_0xd847('0x1d')](_0x2e9931)['then'](function(_0x20dc27){_0x58889c['count']=_0x20dc27;if(_0x5c0099[_0xd847('0x2f')][_0xd847('0x3d')]){_0x5375fe['include']=[{'all':!![]}];}return db[_0xd847('0x29')][_0xd847('0x3e')](_0x5375fe);})[_0xd847('0x22')](function(_0x20eae0){_0x58889c[_0xd847('0x3f')]=_0x20eae0;return _0x58889c;})[_0xd847('0x22')](respondWithFilteredResult(_0x1e6119,_0x5375fe))['catch'](handleError(_0x1e6119,null));};exports[_0xd847('0x40')]=function(_0x340b96,_0x1b962c){var _0x4ec489={'raw':![],'where':{'id':_0x340b96[_0xd847('0x41')]['id']}},_0x39386f={};_0x39386f['model']=_[_0xd847('0x42')](db['FreshdeskAccount'][_0xd847('0x2a')]);_0x39386f[_0xd847('0x2f')]=_[_0xd847('0x42')](_0x340b96[_0xd847('0x2f')]);_0x39386f['filters']=_[_0xd847('0x31')](_0x39386f[_0xd847('0x2e')],_0x39386f[_0xd847('0x2f')]);_0x4ec489['attributes']=_[_0xd847('0x31')](_0x39386f[_0xd847('0x2e')],qs[_0xd847('0x43')](_0x340b96['query'][_0xd847('0x43')]));_0x4ec489[_0xd847('0x32')]=_0x4ec489[_0xd847('0x32')][_0xd847('0x33')]?_0x4ec489['attributes']:_0x39386f['model'];if(_0x340b96['query'][_0xd847('0x3d')]){_0x4ec489[_0xd847('0x44')]=[{'all':!![]}];}_0x4ec489=_[_0xd847('0x3b')]({},_0x4ec489,_0x340b96[_0xd847('0x3c')]);return db['FreshdeskAccount'][_0xd847('0x45')](_0x4ec489)['then'](handleEntityNotFound(_0x1b962c,null))[_0xd847('0x22')](respondWithResult(_0x1b962c,null))['catch'](handleError(_0x1b962c,null));};exports[_0xd847('0x46')]=function(_0x5c890d,_0x2d0979){return db['FreshdeskAccount'][_0xd847('0x46')](_0x5c890d[_0xd847('0x47')],{})[_0xd847('0x22')](respondWithResult(_0x2d0979,0xc9))['catch'](handleError(_0x2d0979,null));};exports[_0xd847('0x21')]=function(_0x465158,_0x154bfd){if(_0x465158[_0xd847('0x47')]['id']){delete _0x465158['body']['id'];}return db['FreshdeskAccount']['find']({'where':{'id':_0x465158[_0xd847('0x41')]['id']}})[_0xd847('0x22')](handleEntityNotFound(_0x154bfd,null))[_0xd847('0x22')](saveUpdates(_0x465158[_0xd847('0x47')],null))[_0xd847('0x22')](respondWithResult(_0x154bfd,null))[_0xd847('0x48')](handleError(_0x154bfd,null));};exports[_0xd847('0x23')]=function(_0x35d0a6,_0x2934ce){return db['FreshdeskAccount'][_0xd847('0x45')]({'where':{'id':_0x35d0a6[_0xd847('0x41')]['id']}})[_0xd847('0x22')](handleEntityNotFound(_0x2934ce,null))[_0xd847('0x22')](removeEntity(_0x2934ce,null))['catch'](handleError(_0x2934ce,null));};exports[_0xd847('0x49')]=function(_0x2b3f6d,_0x461c69,_0x15a6cf){var _0x3e8b6f={};var _0x38be22={};var _0xa3f6c2;var _0x209e13;return db[_0xd847('0x29')][_0xd847('0x4a')]({'where':{'id':_0x2b3f6d[_0xd847('0x41')]['id']}})[_0xd847('0x22')](handleEntityNotFound(_0x461c69,null))[_0xd847('0x22')](function(_0x6fe8cd){if(_0x6fe8cd){_0xa3f6c2=_0x6fe8cd;_0x38be22[_0xd847('0x2e')]=_[_0xd847('0x42')](db['FreshdeskConfiguration'][_0xd847('0x2a')]);_0x38be22[_0xd847('0x2f')]=_[_0xd847('0x42')](_0x2b3f6d['query']);_0x38be22[_0xd847('0x30')]=_[_0xd847('0x31')](_0x38be22[_0xd847('0x2e')],_0x38be22[_0xd847('0x2f')]);_0x3e8b6f[_0xd847('0x32')]=_[_0xd847('0x31')](_0x38be22[_0xd847('0x2e')],qs['fields'](_0x2b3f6d[_0xd847('0x2f')]['fields']));_0x3e8b6f[_0xd847('0x32')]=_0x3e8b6f[_0xd847('0x32')][_0xd847('0x33')]?_0x3e8b6f[_0xd847('0x32')]:_0x38be22['model'];_0x3e8b6f[_0xd847('0x36')]=qs[_0xd847('0x37')](_0x2b3f6d[_0xd847('0x2f')][_0xd847('0x37')]);_0x3e8b6f[_0xd847('0x3a')]=qs[_0xd847('0x30')](_[_0xd847('0x38')](_0x2b3f6d[_0xd847('0x2f')],_0x38be22[_0xd847('0x30')]));if(_0x2b3f6d[_0xd847('0x2f')]['filter']){_0x3e8b6f['where']=_[_0xd847('0x3b')](_0x3e8b6f[_0xd847('0x3a')],{'$or':_[_0xd847('0x28')](_0x3e8b6f[_0xd847('0x32')],function(_0x3cbea0){var _0x1444e7={};_0x1444e7[_0x3cbea0]={'$like':'%'+_0x2b3f6d[_0xd847('0x2f')][_0xd847('0x39')]+'%'};return _0x1444e7;})});}_0x3e8b6f=_[_0xd847('0x3b')]({},_0x3e8b6f,_0x2b3f6d[_0xd847('0x3c')]);return _0xa3f6c2[_0xd847('0x49')](_0x3e8b6f);}})['then'](function(_0x2587d7){if(_0x2587d7){_0x209e13=_0x2587d7['length'];if(!_0x2b3f6d['query'][_0xd847('0x34')]('nolimit')){_0x3e8b6f[_0xd847('0x1c')]=qs[_0xd847('0x1c')](_0x2b3f6d[_0xd847('0x2f')][_0xd847('0x1c')]);_0x3e8b6f[_0xd847('0x1a')]=qs[_0xd847('0x1a')](_0x2b3f6d[_0xd847('0x2f')][_0xd847('0x1a')]);}return _0xa3f6c2['getConfigurations'](_0x3e8b6f);}})[_0xd847('0x22')](function(_0x2ba97a){if(_0x2ba97a){return _0x2ba97a?{'count':_0x209e13,'rows':_0x2ba97a}:null;}})[_0xd847('0x22')](respondWithResult(_0x461c69,null))[_0xd847('0x48')](handleError(_0x461c69,null));};exports['addConfiguration']=function(_0x3a6451,_0x58bf8e,_0x565534){if(_0x3a6451[_0xd847('0x47')]['id']){delete _0x3a6451['body']['id'];}return db[_0xd847('0x29')][_0xd847('0x4a')]({'where':{'id':_0x3a6451[_0xd847('0x41')]['id']}})[_0xd847('0x22')](handleEntityNotFound(_0x58bf8e,null))[_0xd847('0x22')](function(_0xf7db54){if(_0xf7db54){_0x3a6451[_0xd847('0x47')][_0xd847('0x4b')]=_0xf7db54['id'];_0x3a6451[_0xd847('0x47')][_0xd847('0x4c')]=integrations['getSubjects'](_0x3a6451[_0xd847('0x47')]['channel'],_0x3a6451[_0xd847('0x47')][_0xd847('0x2c')]);_0x3a6451['body'][_0xd847('0x4d')]=integrations[_0xd847('0x4e')](_0x3a6451[_0xd847('0x47')][_0xd847('0x4f')],_0x3a6451['body'][_0xd847('0x2c')]);return db[_0xd847('0x50')][_0xd847('0x46')](_0x3a6451[_0xd847('0x47')],{'include':[{'model':db[_0xd847('0x51')],'as':_0xd847('0x4c')},{'model':db[_0xd847('0x51')],'as':_0xd847('0x4d')}]});}return null;})[_0xd847('0x22')](respondWithResult(_0x58bf8e,null))['catch'](handleError(_0x58bf8e,null));};exports[_0xd847('0x52')]=function(_0x5f318b,_0x2fdfb4,_0x9eca4d){var _0x814699='';return db['FreshdeskAccount'][_0xd847('0x4a')]({'where':{'id':_0x5f318b[_0xd847('0x41')]['id']},'attributes':['id',_0xd847('0x53'),_0xd847('0x54')]})[_0xd847('0x22')](handleEntityNotFound(_0x2fdfb4,null))[_0xd847('0x22')](function(_0x300468){if(_0x300468){_0x814699=_0x300468['remoteUri'];var _0x53b9ea=_0x814699['slice'](-0x1);if(_0x53b9ea==='/'){_0x814699=_0x814699['substring'](0x0,_0x814699['lastIndexOf'](_0x53b9ea));}return rp({'method':'GET','uri':util[_0xd847('0x55')](_0xd847('0x56'),_0x814699,'api/v2/ticket_fields'),'headers':{'Authorization':util['format'](_0xd847('0x57'),new Buffer(util[_0xd847('0x55')]('%s:X',_0x300468[_0xd847('0x54')]))['toString'](_0xd847('0x58')))},'json':!![]});}})[_0xd847('0x22')](function(_0x2978fd){if(_0x2978fd){var _0x5e46b8=[_0xd847('0x59'),_0xd847('0x5a'),_0xd847('0x5b'),_0xd847('0x5c'),'status',_0xd847('0x5d'),_0xd847('0x5e'),_0xd847('0x5f'),_0xd847('0x60'),_0xd847('0x5e'),'company'];_[_0xd847('0x61')](_0x2978fd,function(_0x4e6c84){return _0x5e46b8[_0xd847('0x62')](_0x4e6c84[_0xd847('0x25')])||!_0x4e6c84[_0xd847('0x63')]&&_0x4e6c84[_0xd847('0x2c')]!==_0xd847('0x64')&&_0x4e6c84['type']!==_0xd847('0x65');});return{'count':_0x2978fd[_0xd847('0x33')],'rows':_[_0xd847('0x28')](_0x2978fd,function(_0x41c6a2){return{'id':_0x41c6a2['name'],'name':_0x41c6a2['label'],'custom':!_0x41c6a2[_0xd847('0x63')],'options':_0x41c6a2[_0xd847('0x66')]?_[_0xd847('0x28')](_0x41c6a2[_0xd847('0x66')],function(_0x155b2c){return{'name':_[_0xd847('0x67')](_0x155b2c),'value':_0x155b2c};}):[]};})};}})[_0xd847('0x22')](respondWithResult(_0x2fdfb4,null))[_0xd847('0x48')](function(_0x1095a0){var _0x9142f6=_0x5f318b[_0xd847('0x2f')][_0xd847('0x68')]?0x1f4:_0x1095a0[_0xd847('0x69')]||0x1f4;logger[_0xd847('0x6a')]('getFields,\x20%s,\x20%s,\x20%s',_0xd847('0x52'),_0x9142f6,JSON[_0xd847('0x6b')](_0x1095a0));delete _0x1095a0[_0xd847('0x25')];if(_0x9142f6===0x191){_0x9142f6=0x190;}_0x2fdfb4[_0xd847('0x17')](_0x9142f6)[_0xd847('0x26')](_0x5f318b[_0xd847('0x2f')][_0xd847('0x68')]?{'message':_0xd847('0x6c'),'statusCode':_0x1095a0[_0xd847('0x69')]}:_0x1095a0);});}; \ No newline at end of file +var _0x5b02=['util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','stack','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','then','include','findAll','catch','show','params','includeAll','find','body','getConfigurations','findOne','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','FreshdeskField','getFields','apiKey','remoteUri','slice','substring','GET','format','%s/%s','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','priority','group','source','ticket_type','company','remove','includes','custom_text','custom_dropdown','label','default','choices','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','send','eml-format','rimraf','zip-dir','fast-json-patch','bluebird'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5b02,0xe9));var _0x25b0=function(_0x5f3364,_0x835ba7){_0x5f3364=_0x5f3364-0x0;var _0x11c932=_0x5b02[_0x5f3364];return _0x11c932;};'use strict';var emlformat=require(_0x25b0('0x0'));var rimraf=require(_0x25b0('0x1'));var zipdir=require(_0x25b0('0x2'));var jsonpatch=require(_0x25b0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x25b0('0x4'));var Mustache=require('mustache');var util=require(_0x25b0('0x5'));var path=require(_0x25b0('0x6'));var sox=require(_0x25b0('0x7'));var csv=require(_0x25b0('0x8'));var ejs=require(_0x25b0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x25b0('0xa'));var squel=require(_0x25b0('0xb'));var crypto=require('crypto');var jsforce=require(_0x25b0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x25b0('0xd'));var Papa=require(_0x25b0('0xe'));var Redis=require(_0x25b0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x25b0('0x10'));var as=require(_0x25b0('0x11'));var hardwareService=require(_0x25b0('0x12'));var logger=require(_0x25b0('0x13'))(_0x25b0('0x14'));var utils=require(_0x25b0('0x15'));var config=require(_0x25b0('0x16'));var licenseUtil=require(_0x25b0('0x17'));var db=require(_0x25b0('0x18'))['db'];var integrations=require(_0x25b0('0x19'));function respondWithStatusCode(_0x184452,_0x26a34f){_0x26a34f=_0x26a34f||0xcc;return function(_0x2048dc){if(_0x2048dc){return _0x184452[_0x25b0('0x1a')](_0x26a34f);}return _0x184452[_0x25b0('0x1b')](_0x26a34f)[_0x25b0('0x1c')]();};}function respondWithResult(_0x293203,_0x211658){_0x211658=_0x211658||0xc8;return function(_0x418954){if(_0x418954){return _0x293203[_0x25b0('0x1b')](_0x211658)[_0x25b0('0x1d')](_0x418954);}};}function respondWithFilteredResult(_0x5ac18d,_0x51542b){return function(_0xfe1ea6){if(_0xfe1ea6){var _0x4b2357=typeof _0x51542b[_0x25b0('0x1e')]===_0x25b0('0x1f')&&typeof _0x51542b[_0x25b0('0x20')]===_0x25b0('0x1f');var _0x5e3a3a=_0xfe1ea6[_0x25b0('0x21')];var _0x213a77=_0x4b2357?0x0:_0x51542b[_0x25b0('0x1e')];var _0x385334=_0x4b2357?_0xfe1ea6[_0x25b0('0x21')]:_0x51542b[_0x25b0('0x1e')]+_0x51542b['limit'];var _0x348d36;if(_0x385334>=_0x5e3a3a){_0x385334=_0x5e3a3a;_0x348d36=0xc8;}else{_0x348d36=0xce;}_0x5ac18d[_0x25b0('0x1b')](_0x348d36);return _0x5ac18d[_0x25b0('0x22')](_0x25b0('0x23'),_0x213a77+'-'+_0x385334+'/'+_0x5e3a3a)[_0x25b0('0x1d')](_0xfe1ea6);}return null;};}function patchUpdates(_0xea4162){return function(_0x232be7){try{jsonpatch[_0x25b0('0x24')](_0x232be7,_0xea4162,!![]);}catch(_0x7bdaf9){return BPromise[_0x25b0('0x25')](_0x7bdaf9);}return _0x232be7[_0x25b0('0x26')]();};}function saveUpdates(_0x3ce1da,_0x5cb746){return function(_0x9f432e){if(_0x9f432e){return _0x9f432e[_0x25b0('0x27')](_0x3ce1da)['then'](function(_0x2d7c17){return _0x2d7c17;});}return null;};}function removeEntity(_0x2023d8,_0x3546f0){return function(_0x498fef){if(_0x498fef){return _0x498fef['destroy']()['then'](function(){_0x2023d8[_0x25b0('0x1b')](0xcc)[_0x25b0('0x1c')]();});}};}function handleEntityNotFound(_0x99bd3a,_0x24f847){return function(_0xdbb459){if(!_0xdbb459){_0x99bd3a[_0x25b0('0x1a')](0x194);}return _0xdbb459;};}function handleError(_0x40268a,_0x75ce7a){_0x75ce7a=_0x75ce7a||0x1f4;return function(_0x22e024){logger['error'](_0x22e024[_0x25b0('0x28')]);if(_0x22e024[_0x25b0('0x29')]){delete _0x22e024['name'];}_0x40268a['status'](_0x75ce7a)['send'](_0x22e024);};}exports[_0x25b0('0x2a')]=function(_0x3f0a54,_0x251fad){var _0x105129={},_0x214377={},_0x3285ae={'count':0x0,'rows':[]};var _0x12676b=_[_0x25b0('0x2b')](db[_0x25b0('0x2c')][_0x25b0('0x2d')],function(_0x1e217c){return{'name':_0x1e217c[_0x25b0('0x2e')],'type':_0x1e217c[_0x25b0('0x2f')]['key']};});_0x214377['model']=_[_0x25b0('0x2b')](_0x12676b,'name');_0x214377['query']=_[_0x25b0('0x30')](_0x3f0a54[_0x25b0('0x31')]);_0x214377[_0x25b0('0x32')]=_[_0x25b0('0x33')](_0x214377[_0x25b0('0x34')],_0x214377['query']);_0x105129[_0x25b0('0x35')]=_[_0x25b0('0x33')](_0x214377['model'],qs[_0x25b0('0x36')](_0x3f0a54[_0x25b0('0x31')]['fields']));_0x105129[_0x25b0('0x35')]=_0x105129['attributes'][_0x25b0('0x37')]?_0x105129[_0x25b0('0x35')]:_0x214377[_0x25b0('0x34')];if(!_0x3f0a54[_0x25b0('0x31')][_0x25b0('0x38')](_0x25b0('0x39'))){_0x105129[_0x25b0('0x20')]=qs[_0x25b0('0x20')](_0x3f0a54[_0x25b0('0x31')]['limit']);_0x105129[_0x25b0('0x1e')]=qs[_0x25b0('0x1e')](_0x3f0a54[_0x25b0('0x31')][_0x25b0('0x1e')]);}_0x105129[_0x25b0('0x3a')]=qs[_0x25b0('0x3b')](_0x3f0a54[_0x25b0('0x31')][_0x25b0('0x3b')]);_0x105129[_0x25b0('0x3c')]=qs[_0x25b0('0x32')](_['pick'](_0x3f0a54[_0x25b0('0x31')],_0x214377[_0x25b0('0x32')]),_0x12676b);if(_0x3f0a54[_0x25b0('0x31')]['filter']){_0x105129[_0x25b0('0x3c')]=_[_0x25b0('0x3d')](_0x105129[_0x25b0('0x3c')],{'$or':_[_0x25b0('0x2b')](_0x12676b,function(_0x17f67c){if(_0x17f67c[_0x25b0('0x2f')]!==_0x25b0('0x3e')){var _0x391493={};_0x391493[_0x17f67c['name']]={'$like':'%'+_0x3f0a54['query'][_0x25b0('0x3f')]+'%'};return _0x391493;}})});}_0x105129=_[_0x25b0('0x3d')]({},_0x105129,_0x3f0a54[_0x25b0('0x40')]);var _0x52c0af={'where':_0x105129[_0x25b0('0x3c')]};return db['FreshdeskAccount'][_0x25b0('0x21')](_0x52c0af)[_0x25b0('0x41')](function(_0xbd0db5){_0x3285ae[_0x25b0('0x21')]=_0xbd0db5;if(_0x3f0a54[_0x25b0('0x31')]['includeAll']){_0x105129[_0x25b0('0x42')]=[{'all':!![]}];}return db[_0x25b0('0x2c')][_0x25b0('0x43')](_0x105129);})[_0x25b0('0x41')](function(_0x428799){_0x3285ae['rows']=_0x428799;return _0x3285ae;})[_0x25b0('0x41')](respondWithFilteredResult(_0x251fad,_0x105129))[_0x25b0('0x44')](handleError(_0x251fad,null));};exports[_0x25b0('0x45')]=function(_0x44c400,_0x35fc00){var _0x1adf8d={'raw':![],'where':{'id':_0x44c400[_0x25b0('0x46')]['id']}},_0x51deba={};_0x51deba[_0x25b0('0x34')]=_[_0x25b0('0x30')](db[_0x25b0('0x2c')]['rawAttributes']);_0x51deba[_0x25b0('0x31')]=_['keys'](_0x44c400[_0x25b0('0x31')]);_0x51deba[_0x25b0('0x32')]=_[_0x25b0('0x33')](_0x51deba[_0x25b0('0x34')],_0x51deba['query']);_0x1adf8d[_0x25b0('0x35')]=_[_0x25b0('0x33')](_0x51deba[_0x25b0('0x34')],qs['fields'](_0x44c400[_0x25b0('0x31')][_0x25b0('0x36')]));_0x1adf8d[_0x25b0('0x35')]=_0x1adf8d[_0x25b0('0x35')][_0x25b0('0x37')]?_0x1adf8d[_0x25b0('0x35')]:_0x51deba[_0x25b0('0x34')];if(_0x44c400['query'][_0x25b0('0x47')]){_0x1adf8d[_0x25b0('0x42')]=[{'all':!![]}];}_0x1adf8d=_[_0x25b0('0x3d')]({},_0x1adf8d,_0x44c400['options']);return db[_0x25b0('0x2c')][_0x25b0('0x48')](_0x1adf8d)[_0x25b0('0x41')](handleEntityNotFound(_0x35fc00,null))[_0x25b0('0x41')](respondWithResult(_0x35fc00,null))[_0x25b0('0x44')](handleError(_0x35fc00,null));};exports['create']=function(_0x1e8a8d,_0x1cf933){return db[_0x25b0('0x2c')]['create'](_0x1e8a8d[_0x25b0('0x49')],{})[_0x25b0('0x41')](respondWithResult(_0x1cf933,0xc9))[_0x25b0('0x44')](handleError(_0x1cf933,null));};exports[_0x25b0('0x27')]=function(_0x29165e,_0x3d4531){if(_0x29165e['body']['id']){delete _0x29165e['body']['id'];}return db['FreshdeskAccount'][_0x25b0('0x48')]({'where':{'id':_0x29165e['params']['id']}})['then'](handleEntityNotFound(_0x3d4531,null))[_0x25b0('0x41')](saveUpdates(_0x29165e['body'],null))[_0x25b0('0x41')](respondWithResult(_0x3d4531,null))['catch'](handleError(_0x3d4531,null));};exports['destroy']=function(_0x394e52,_0x14a8a7){return db[_0x25b0('0x2c')][_0x25b0('0x48')]({'where':{'id':_0x394e52[_0x25b0('0x46')]['id']}})[_0x25b0('0x41')](handleEntityNotFound(_0x14a8a7,null))[_0x25b0('0x41')](removeEntity(_0x14a8a7,null))[_0x25b0('0x44')](handleError(_0x14a8a7,null));};exports[_0x25b0('0x4a')]=function(_0x20d56f,_0x48fb71,_0x4d3e9e){var _0x582f36={};var _0xf1e6bf={};var _0xa45e87;var _0x2a28fb;return db[_0x25b0('0x2c')][_0x25b0('0x4b')]({'where':{'id':_0x20d56f[_0x25b0('0x46')]['id']}})[_0x25b0('0x41')](handleEntityNotFound(_0x48fb71,null))['then'](function(_0x64ffa3){if(_0x64ffa3){_0xa45e87=_0x64ffa3;_0xf1e6bf['model']=_[_0x25b0('0x30')](db['FreshdeskConfiguration']['rawAttributes']);_0xf1e6bf[_0x25b0('0x31')]=_['keys'](_0x20d56f['query']);_0xf1e6bf[_0x25b0('0x32')]=_[_0x25b0('0x33')](_0xf1e6bf[_0x25b0('0x34')],_0xf1e6bf[_0x25b0('0x31')]);_0x582f36[_0x25b0('0x35')]=_[_0x25b0('0x33')](_0xf1e6bf[_0x25b0('0x34')],qs[_0x25b0('0x36')](_0x20d56f[_0x25b0('0x31')][_0x25b0('0x36')]));_0x582f36['attributes']=_0x582f36['attributes'][_0x25b0('0x37')]?_0x582f36[_0x25b0('0x35')]:_0xf1e6bf['model'];_0x582f36[_0x25b0('0x3a')]=qs[_0x25b0('0x3b')](_0x20d56f[_0x25b0('0x31')][_0x25b0('0x3b')]);_0x582f36[_0x25b0('0x3c')]=qs['filters'](_[_0x25b0('0x4c')](_0x20d56f[_0x25b0('0x31')],_0xf1e6bf[_0x25b0('0x32')]));if(_0x20d56f['query'][_0x25b0('0x3f')]){_0x582f36[_0x25b0('0x3c')]=_[_0x25b0('0x3d')](_0x582f36[_0x25b0('0x3c')],{'$or':_[_0x25b0('0x2b')](_0x582f36[_0x25b0('0x35')],function(_0x6f17a4){var _0x2ccf0c={};_0x2ccf0c[_0x6f17a4]={'$like':'%'+_0x20d56f[_0x25b0('0x31')][_0x25b0('0x3f')]+'%'};return _0x2ccf0c;})});}_0x582f36=_[_0x25b0('0x3d')]({},_0x582f36,_0x20d56f[_0x25b0('0x40')]);return _0xa45e87[_0x25b0('0x4a')](_0x582f36);}})[_0x25b0('0x41')](function(_0x561634){if(_0x561634){_0x2a28fb=_0x561634[_0x25b0('0x37')];if(!_0x20d56f[_0x25b0('0x31')]['hasOwnProperty'](_0x25b0('0x39'))){_0x582f36['limit']=qs[_0x25b0('0x20')](_0x20d56f[_0x25b0('0x31')]['limit']);_0x582f36[_0x25b0('0x1e')]=qs[_0x25b0('0x1e')](_0x20d56f[_0x25b0('0x31')]['offset']);}return _0xa45e87[_0x25b0('0x4a')](_0x582f36);}})['then'](function(_0x1be54a){if(_0x1be54a){return _0x1be54a?{'count':_0x2a28fb,'rows':_0x1be54a}:null;}})[_0x25b0('0x41')](respondWithResult(_0x48fb71,null))['catch'](handleError(_0x48fb71,null));};exports[_0x25b0('0x4d')]=function(_0x4457d1,_0x4efa96,_0x26e4fd){if(_0x4457d1['body']['id']){delete _0x4457d1['body']['id'];}return db['FreshdeskAccount'][_0x25b0('0x4b')]({'where':{'id':_0x4457d1[_0x25b0('0x46')]['id']}})[_0x25b0('0x41')](handleEntityNotFound(_0x4efa96,null))['then'](function(_0x45f175){if(_0x45f175){_0x4457d1[_0x25b0('0x49')][_0x25b0('0x4e')]=_0x45f175['id'];_0x4457d1[_0x25b0('0x49')][_0x25b0('0x4f')]=integrations[_0x25b0('0x50')](_0x4457d1[_0x25b0('0x49')][_0x25b0('0x51')],_0x4457d1[_0x25b0('0x49')][_0x25b0('0x2f')]);_0x4457d1[_0x25b0('0x49')][_0x25b0('0x52')]=integrations[_0x25b0('0x53')](_0x4457d1[_0x25b0('0x49')][_0x25b0('0x51')],_0x4457d1[_0x25b0('0x49')][_0x25b0('0x2f')]);return db['FreshdeskConfiguration'][_0x25b0('0x54')](_0x4457d1['body'],{'include':[{'model':db[_0x25b0('0x55')],'as':_0x25b0('0x4f')},{'model':db[_0x25b0('0x55')],'as':_0x25b0('0x52')}]});}return null;})['then'](respondWithResult(_0x4efa96,null))[_0x25b0('0x44')](handleError(_0x4efa96,null));};exports[_0x25b0('0x56')]=function(_0x3e326c,_0x2217e7,_0x46a1d1){var _0x19e49c='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x3e326c[_0x25b0('0x46')]['id']},'attributes':['id','remoteUri',_0x25b0('0x57')]})[_0x25b0('0x41')](handleEntityNotFound(_0x2217e7,null))[_0x25b0('0x41')](function(_0x5279ab){if(_0x5279ab){_0x19e49c=_0x5279ab[_0x25b0('0x58')];var _0x1259ad=_0x19e49c[_0x25b0('0x59')](-0x1);if(_0x1259ad==='/'){_0x19e49c=_0x19e49c[_0x25b0('0x5a')](0x0,_0x19e49c['lastIndexOf'](_0x1259ad));}return rp({'method':_0x25b0('0x5b'),'uri':util[_0x25b0('0x5c')](_0x25b0('0x5d'),_0x19e49c,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x25b0('0x5c')](_0x25b0('0x5e'),new Buffer(util[_0x25b0('0x5c')](_0x25b0('0x5f'),_0x5279ab[_0x25b0('0x57')]))[_0x25b0('0x60')](_0x25b0('0x61')))},'json':!![]});}})[_0x25b0('0x41')](function(_0x55a48d){if(_0x55a48d){var _0x1f5757=[_0x25b0('0x62'),_0x25b0('0x63'),_0x25b0('0x64'),'description','status',_0x25b0('0x65'),_0x25b0('0x66'),_0x25b0('0x67'),_0x25b0('0x68'),'group',_0x25b0('0x69')];_[_0x25b0('0x6a')](_0x55a48d,function(_0x4876a4){return _0x1f5757[_0x25b0('0x6b')](_0x4876a4[_0x25b0('0x29')])||!_0x4876a4['default']&&_0x4876a4['type']!==_0x25b0('0x6c')&&_0x4876a4[_0x25b0('0x2f')]!==_0x25b0('0x6d');});return{'count':_0x55a48d[_0x25b0('0x37')],'rows':_[_0x25b0('0x2b')](_0x55a48d,function(_0x171d80){return{'id':_0x171d80[_0x25b0('0x29')],'name':_0x171d80[_0x25b0('0x6e')],'custom':!_0x171d80[_0x25b0('0x6f')],'options':_0x171d80[_0x25b0('0x70')]?_[_0x25b0('0x2b')](_0x171d80[_0x25b0('0x70')],function(_0x217f16){return{'name':_['capitalize'](_0x217f16),'value':_0x217f16};}):[]};})};}})[_0x25b0('0x41')](respondWithResult(_0x2217e7,null))['catch'](function(_0x472ae1){var _0x46a839=_0x3e326c['query'][_0x25b0('0x71')]?0x1f4:_0x472ae1[_0x25b0('0x72')]||0x1f4;logger[_0x25b0('0x73')](_0x25b0('0x74'),_0x25b0('0x56'),_0x46a839,JSON[_0x25b0('0x75')](_0x472ae1));delete _0x472ae1[_0x25b0('0x29')];if(_0x46a839===0x191){_0x46a839=0x190;}_0x2217e7[_0x25b0('0x1b')](_0x46a839)[_0x25b0('0x76')](_0x3e326c[_0x25b0('0x31')][_0x25b0('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x472ae1['statusCode']}:_0x472ae1);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 899cc67..8fb356e 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 _0x8374=['bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','api','moment'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x8374,0x11a));var _0x4837=function(_0x496f1d,_0x5873e7){_0x496f1d=_0x496f1d-0x0;var _0x571900=_0x8374[_0x496f1d];return _0x571900;};'use strict';var _=require(_0x4837('0x0'));var util=require(_0x4837('0x1'));var logger=require('../../config/logger')(_0x4837('0x2'));var moment=require(_0x4837('0x3'));var BPromise=require(_0x4837('0x4'));var rp=require(_0x4837('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4837('0x6'));var config=require(_0x4837('0x7'));var attributes=require(_0x4837('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x4837('0x9')]=function(_0x517248,_0x161b5d){return _0x517248[_0x4837('0xa')](_0x4837('0xb'),attributes,{'tableName':_0x4837('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb72=['./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x288371,_0x35f999){var _0x5a1ad1=function(_0xc35a07){while(--_0xc35a07){_0x288371['push'](_0x288371['shift']());}};_0x5a1ad1(++_0x35f999);}(_0xdb72,0xd7));var _0x2db7=function(_0x13342f,_0x3d6303){_0x13342f=_0x13342f-0x0;var _0x2fc1fc=_0xdb72[_0x13342f];return _0x2fc1fc;};'use strict';var _=require(_0x2db7('0x0'));var util=require(_0x2db7('0x1'));var logger=require(_0x2db7('0x2'))(_0x2db7('0x3'));var moment=require(_0x2db7('0x4'));var BPromise=require(_0x2db7('0x5'));var rp=require(_0x2db7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2db7('0x7'));var config=require(_0x2db7('0x8'));var attributes=require(_0x2db7('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x2db7('0xa')]=function(_0x300b21,_0x981b7b){return _0x300b21[_0x2db7('0xb')](_0x2db7('0xc'),attributes,{'tableName':_0x2db7('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 88ac43d..1452983 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 _0xef6c=['debug','find','ShowFreshdeskAccount','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','info','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','then'];(function(_0x59b2a1,_0x1f631f){var _0x4908d1=function(_0x14c9b8){while(--_0x14c9b8){_0x59b2a1['push'](_0x59b2a1['shift']());}};_0x4908d1(++_0x1f631f);}(_0xef6c,0xd5));var _0xcef6=function(_0x2892da,_0x191a40){_0x2892da=_0x2892da-0x0;var _0x28cff2=_0xef6c[_0x2892da];return _0x28cff2;};'use strict';var _=require('lodash');var util=require(_0xcef6('0x0'));var moment=require(_0xcef6('0x1'));var BPromise=require('bluebird');var rs=require(_0xcef6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcef6('0x3'))['db'];var utils=require(_0xcef6('0x4'));var logger=require(_0xcef6('0x5'))(_0xcef6('0x6'));var config=require(_0xcef6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcef6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58711a,_0x2a230b,_0xb2693a){return new BPromise(function(_0x4da733,_0x2c0dae){return client[_0xcef6('0x9')](_0x58711a,_0xb2693a)['then'](function(_0x283658){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x2a230b,_0xcef6('0xa'));logger['debug'](_0xcef6('0xb'),_0x2a230b,'request\x20sent',JSON[_0xcef6('0xc')](_0x283658));if(_0x283658[_0xcef6('0xd')]){if(_0x283658[_0xcef6('0xd')][_0xcef6('0xe')]===0x1f4){logger[_0xcef6('0xd')](_0xcef6('0xf'),_0x2a230b,_0x283658[_0xcef6('0xd')][_0xcef6('0x10')]);return _0x2c0dae(_0x283658[_0xcef6('0xd')][_0xcef6('0x10')]);}logger[_0xcef6('0xd')](_0xcef6('0xf'),_0x2a230b,_0x283658[_0xcef6('0xd')][_0xcef6('0x10')]);return _0x4da733(_0x283658[_0xcef6('0xd')][_0xcef6('0x10')]);}else{logger[_0xcef6('0x11')](_0xcef6('0xf'),_0x2a230b,_0xcef6('0xa'));_0x4da733(_0x283658[_0xcef6('0x12')]['message']);}})[_0xcef6('0x13')](function(_0x4d7a85){logger[_0xcef6('0xd')](_0xcef6('0xf'),_0x2a230b,_0x4d7a85);_0x2c0dae(_0x4d7a85);});});}exports[_0xcef6('0x14')]=function(_0x414c70){var _0x55d7e0=this;return new Promise(function(_0x21c0d7,_0x1f7211){return db[_0xcef6('0x15')][_0xcef6('0x16')]({'raw':_0x414c70[_0xcef6('0x17')]?_0x414c70[_0xcef6('0x17')][_0xcef6('0x18')]===undefined?!![]:![]:!![],'where':_0x414c70['options']?_0x414c70['options'][_0xcef6('0x19')]||null:null,'attributes':_0x414c70[_0xcef6('0x17')]?_0x414c70[_0xcef6('0x17')][_0xcef6('0x1a')]||null:null,'limit':_0x414c70['options']?_0x414c70['options'][_0xcef6('0x1b')]||null:null,'include':_0x414c70['options']?_0x414c70[_0xcef6('0x17')][_0xcef6('0x1c')]?_[_0xcef6('0x1d')](_0x414c70[_0xcef6('0x17')][_0xcef6('0x1c')],function(_0x8acbad){return{'model':db[_0x8acbad[_0xcef6('0x1e')]],'as':_0x8acbad['as'],'attributes':_0x8acbad[_0xcef6('0x1a')],'include':_0x8acbad['include']?_[_0xcef6('0x1d')](_0x8acbad['include'],function(_0x3f3ad4){return{'model':db[_0x3f3ad4[_0xcef6('0x1e')]],'as':_0x3f3ad4['as'],'attributes':_0x3f3ad4[_0xcef6('0x1a')],'include':_0x3f3ad4['include']?_[_0xcef6('0x1d')](_0x3f3ad4[_0xcef6('0x1c')],function(_0x2dff0d){return{'model':db[_0x2dff0d['model']],'as':_0x2dff0d['as'],'attributes':_0x2dff0d[_0xcef6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xcef6('0x1f')](function(_0x3dd8d4){logger[_0xcef6('0x11')]('GetFreshdeskAccount',_0x414c70);logger[_0xcef6('0x20')](_0xcef6('0x14'),_0x414c70,JSON[_0xcef6('0xc')](_0x3dd8d4));_0x21c0d7(_0x3dd8d4);})[_0xcef6('0x13')](function(_0xac3bdf){logger[_0xcef6('0xd')](_0xcef6('0x14'),_0xac3bdf['message'],_0x414c70);_0x1f7211(_0x55d7e0[_0xcef6('0xd')](0x1f4,_0xac3bdf['message']));});});};exports['ShowFreshdeskAccount']=function(_0xa8b921){var _0x4d3462=this;return new Promise(function(_0x122c25,_0x27526d){return db[_0xcef6('0x15')][_0xcef6('0x21')]({'raw':_0xa8b921[_0xcef6('0x17')]?_0xa8b921[_0xcef6('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xa8b921['options']?_0xa8b921[_0xcef6('0x17')]['where']||null:null,'attributes':_0xa8b921[_0xcef6('0x17')]?_0xa8b921[_0xcef6('0x17')][_0xcef6('0x1a')]||null:null,'include':_0xa8b921[_0xcef6('0x17')]?_0xa8b921['options'][_0xcef6('0x1c')]?_[_0xcef6('0x1d')](_0xa8b921[_0xcef6('0x17')][_0xcef6('0x1c')],function(_0x3c0481){return{'model':db[_0x3c0481['model']],'as':_0x3c0481['as'],'attributes':_0x3c0481[_0xcef6('0x1a')],'include':_0x3c0481[_0xcef6('0x1c')]?_[_0xcef6('0x1d')](_0x3c0481[_0xcef6('0x1c')],function(_0x39fe6b){return{'model':db[_0x39fe6b[_0xcef6('0x1e')]],'as':_0x39fe6b['as'],'attributes':_0x39fe6b[_0xcef6('0x1a')],'include':_0x39fe6b[_0xcef6('0x1c')]?_[_0xcef6('0x1d')](_0x39fe6b[_0xcef6('0x1c')],function(_0x1c3907){return{'model':db[_0x1c3907[_0xcef6('0x1e')]],'as':_0x1c3907['as'],'attributes':_0x1c3907[_0xcef6('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5cb594){logger[_0xcef6('0x11')](_0xcef6('0x22'),_0xa8b921);logger[_0xcef6('0x20')](_0xcef6('0x22'),_0xa8b921,JSON[_0xcef6('0xc')](_0x5cb594));_0x122c25(_0x5cb594);})[_0xcef6('0x13')](function(_0x11bc1a){logger[_0xcef6('0xd')]('ShowFreshdeskAccount',_0x11bc1a[_0xcef6('0x10')],_0xa8b921);_0x27526d(_0x4d3462[_0xcef6('0xd')](0x1f4,_0x11bc1a['message']));});});}; \ No newline at end of file +var _0xdbf7=['find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','limit','map','include','attributes','model','ShowFreshdeskAccount'];(function(_0x3c457f,_0x307fb5){var _0x54ec35=function(_0x55105b){while(--_0x55105b){_0x3c457f['push'](_0x3c457f['shift']());}};_0x54ec35(++_0x307fb5);}(_0xdbf7,0x8d));var _0x7dbf=function(_0xfc2190,_0x303514){_0xfc2190=_0xfc2190-0x0;var _0x2fc49e=_0xdbf7[_0xfc2190];return _0x2fc49e;};'use strict';var _=require(_0x7dbf('0x0'));var util=require(_0x7dbf('0x1'));var moment=require(_0x7dbf('0x2'));var BPromise=require(_0x7dbf('0x3'));var rs=require(_0x7dbf('0x4'));var fs=require('fs');var Redis=require(_0x7dbf('0x5'));var db=require(_0x7dbf('0x6'))['db'];var utils=require(_0x7dbf('0x7'));var logger=require('../../config/logger')(_0x7dbf('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7dbf('0x9')][_0x7dbf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x601b60,_0x3df94e,_0x29f02b){return new BPromise(function(_0x3e7a9c,_0x3f4efe){return client[_0x7dbf('0xb')](_0x601b60,_0x29f02b)[_0x7dbf('0xc')](function(_0x1851fc){logger[_0x7dbf('0xd')](_0x7dbf('0xe'),_0x3df94e,_0x7dbf('0xf'));logger[_0x7dbf('0x10')](_0x7dbf('0x11'),_0x3df94e,'request\x20sent',JSON[_0x7dbf('0x12')](_0x1851fc));if(_0x1851fc[_0x7dbf('0x13')]){if(_0x1851fc[_0x7dbf('0x13')][_0x7dbf('0x14')]===0x1f4){logger[_0x7dbf('0x13')](_0x7dbf('0xe'),_0x3df94e,_0x1851fc['error'][_0x7dbf('0x15')]);return _0x3f4efe(_0x1851fc['error']['message']);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x3df94e,_0x1851fc[_0x7dbf('0x13')][_0x7dbf('0x15')]);return _0x3e7a9c(_0x1851fc[_0x7dbf('0x13')]['message']);}else{logger[_0x7dbf('0xd')](_0x7dbf('0xe'),_0x3df94e,_0x7dbf('0xf'));_0x3e7a9c(_0x1851fc['result'][_0x7dbf('0x15')]);}})[_0x7dbf('0x16')](function(_0x11ee4d){logger[_0x7dbf('0x13')](_0x7dbf('0xe'),_0x3df94e,_0x11ee4d);_0x3f4efe(_0x11ee4d);});});}exports[_0x7dbf('0x17')]=function(_0xc47749){var _0x47e7b4=this;return new Promise(function(_0x3abe64,_0x49b09f){return db[_0x7dbf('0x18')]['findAll']({'raw':_0xc47749[_0x7dbf('0x19')]?_0xc47749[_0x7dbf('0x19')][_0x7dbf('0x1a')]===undefined?!![]:![]:!![],'where':_0xc47749[_0x7dbf('0x19')]?_0xc47749['options'][_0x7dbf('0x1b')]||null:null,'attributes':_0xc47749[_0x7dbf('0x19')]?_0xc47749[_0x7dbf('0x19')]['attributes']||null:null,'limit':_0xc47749[_0x7dbf('0x19')]?_0xc47749[_0x7dbf('0x19')][_0x7dbf('0x1c')]||null:null,'include':_0xc47749[_0x7dbf('0x19')]?_0xc47749[_0x7dbf('0x19')]['include']?_[_0x7dbf('0x1d')](_0xc47749[_0x7dbf('0x19')][_0x7dbf('0x1e')],function(_0x502014){return{'model':db[_0x502014['model']],'as':_0x502014['as'],'attributes':_0x502014[_0x7dbf('0x1f')],'include':_0x502014[_0x7dbf('0x1e')]?_[_0x7dbf('0x1d')](_0x502014[_0x7dbf('0x1e')],function(_0x205a70){return{'model':db[_0x205a70[_0x7dbf('0x20')]],'as':_0x205a70['as'],'attributes':_0x205a70[_0x7dbf('0x1f')],'include':_0x205a70['include']?_['map'](_0x205a70[_0x7dbf('0x1e')],function(_0x2403d7){return{'model':db[_0x2403d7['model']],'as':_0x2403d7['as'],'attributes':_0x2403d7[_0x7dbf('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7dbf('0xc')](function(_0x292a2c){logger[_0x7dbf('0xd')]('GetFreshdeskAccount',_0xc47749);logger[_0x7dbf('0x10')]('GetFreshdeskAccount',_0xc47749,JSON[_0x7dbf('0x12')](_0x292a2c));_0x3abe64(_0x292a2c);})['catch'](function(_0x3c0515){logger[_0x7dbf('0x13')](_0x7dbf('0x17'),_0x3c0515[_0x7dbf('0x15')],_0xc47749);_0x49b09f(_0x47e7b4[_0x7dbf('0x13')](0x1f4,_0x3c0515[_0x7dbf('0x15')]));});});};exports[_0x7dbf('0x21')]=function(_0x2783aa){var _0x478395=this;return new Promise(function(_0x44a3ea,_0x156bc2){return db[_0x7dbf('0x18')][_0x7dbf('0x22')]({'raw':_0x2783aa[_0x7dbf('0x19')]?_0x2783aa[_0x7dbf('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2783aa[_0x7dbf('0x19')]?_0x2783aa[_0x7dbf('0x19')][_0x7dbf('0x1b')]||null:null,'attributes':_0x2783aa[_0x7dbf('0x19')]?_0x2783aa[_0x7dbf('0x19')]['attributes']||null:null,'include':_0x2783aa[_0x7dbf('0x19')]?_0x2783aa[_0x7dbf('0x19')][_0x7dbf('0x1e')]?_[_0x7dbf('0x1d')](_0x2783aa[_0x7dbf('0x19')]['include'],function(_0x62097e){return{'model':db[_0x62097e[_0x7dbf('0x20')]],'as':_0x62097e['as'],'attributes':_0x62097e['attributes'],'include':_0x62097e[_0x7dbf('0x1e')]?_['map'](_0x62097e[_0x7dbf('0x1e')],function(_0x441a86){return{'model':db[_0x441a86[_0x7dbf('0x20')]],'as':_0x441a86['as'],'attributes':_0x441a86['attributes'],'include':_0x441a86[_0x7dbf('0x1e')]?_[_0x7dbf('0x1d')](_0x441a86['include'],function(_0x431466){return{'model':db[_0x431466[_0x7dbf('0x20')]],'as':_0x431466['as'],'attributes':_0x431466['attributes']};}):[]};}):[]};}):[]:[]})[_0x7dbf('0xc')](function(_0x4fda6f){logger[_0x7dbf('0xd')]('ShowFreshdeskAccount',_0x2783aa);logger[_0x7dbf('0x10')](_0x7dbf('0x21'),_0x2783aa,JSON[_0x7dbf('0x12')](_0x4fda6f));_0x44a3ea(_0x4fda6f);})[_0x7dbf('0x16')](function(_0x28dc1c){logger[_0x7dbf('0x13')]('ShowFreshdeskAccount',_0x28dc1c['message'],_0x2783aa);_0x156bc2(_0x478395[_0x7dbf('0x13')](0x1f4,_0x28dc1c[_0x7dbf('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 61e5508..23052ed 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 _0x9616=['update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','isAuthenticated','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','put','/:id'];(function(_0xe6a570,_0x5ec686){var _0x21e6f7=function(_0x3fe0ba){while(--_0x3fe0ba){_0xe6a570['push'](_0xe6a570['shift']());}};_0x21e6f7(++_0x5ec686);}(_0x9616,0x80));var _0x6961=function(_0x3abe6a,_0xdd7b1a){_0x3abe6a=_0x3abe6a-0x0;var _0x2fc39e=_0x9616[_0x3abe6a];return _0x2fc39e;};'use strict';var multer=require('multer');var util=require(_0x6961('0x0'));var path=require(_0x6961('0x1'));var timeout=require(_0x6961('0x2'));var express=require(_0x6961('0x3'));var router=express[_0x6961('0x4')]();var fs_extra=require(_0x6961('0x5'));var auth=require(_0x6961('0x6'));var interaction=require(_0x6961('0x7'));var config=require(_0x6961('0x8'));var controller=require(_0x6961('0x9'));router[_0x6961('0xa')]('/',auth['isAuthenticated'](),controller[_0x6961('0xb')]);router[_0x6961('0xa')]('/:id',auth[_0x6961('0xc')](),controller[_0x6961('0xd')]);router[_0x6961('0xa')](_0x6961('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x6961('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x6961('0xf')]);router[_0x6961('0xa')](_0x6961('0x10'),auth[_0x6961('0xc')](),controller[_0x6961('0x11')]);router[_0x6961('0xa')](_0x6961('0x12'),auth[_0x6961('0xc')](),controller['getTags']);router['post']('/',auth[_0x6961('0xc')](),controller[_0x6961('0x13')]);router['post'](_0x6961('0x12'),auth['isAuthenticated'](),controller['setTags']);router[_0x6961('0x14')](_0x6961('0x15'),auth[_0x6961('0xc')](),controller[_0x6961('0x16')]);router['delete'](_0x6961('0x15'),auth[_0x6961('0xc')](),controller[_0x6961('0x17')]);module[_0x6961('0x18')]=router; \ No newline at end of file +var _0x850e=['getTags','post','create','/:id/tags','setTags','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x10366e,_0x2ca3d8){var _0x41a3a9=function(_0x36b189){while(--_0x36b189){_0x10366e['push'](_0x10366e['shift']());}};_0x41a3a9(++_0x2ca3d8);}(_0x850e,0x14e));var _0xe850=function(_0xa67928,_0x563a31){_0xa67928=_0xa67928-0x0;var _0x56a48d=_0x850e[_0xa67928];return _0x56a48d;};'use strict';var multer=require(_0xe850('0x0'));var util=require(_0xe850('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe850('0x2'));var router=express[_0xe850('0x3')]();var fs_extra=require(_0xe850('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe850('0x5'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router[_0xe850('0x6')]('/',auth[_0xe850('0x7')](),controller[_0xe850('0x8')]);router[_0xe850('0x6')](_0xe850('0x9'),auth[_0xe850('0x7')](),controller[_0xe850('0xa')]);router[_0xe850('0x6')](_0xe850('0xb'),auth[_0xe850('0x7')](),controller[_0xe850('0xc')]);router[_0xe850('0x6')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xe850('0xd')]);router[_0xe850('0x6')](_0xe850('0xe'),auth[_0xe850('0x7')](),controller[_0xe850('0xf')]);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0xe850('0x10')]);router[_0xe850('0x11')]('/',auth[_0xe850('0x7')](),controller[_0xe850('0x12')]);router[_0xe850('0x11')](_0xe850('0x13'),auth[_0xe850('0x7')](),controller[_0xe850('0x14')]);router['put']('/:id',auth[_0xe850('0x7')](),controller[_0xe850('0x15')]);router[_0xe850('0x16')](_0xe850('0x9'),auth[_0xe850('0x7')](),controller[_0xe850('0x17')]);module[_0xe850('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 0fdfe44..d1d565e 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 _0x8e1a=['sequelize','exports','STRING'];(function(_0xb69b29,_0x41051a){var _0x1abb1=function(_0x39778e){while(--_0x39778e){_0xb69b29['push'](_0xb69b29['shift']());}};_0x1abb1(++_0x41051a);}(_0x8e1a,0xc6));var _0xa8e1=function(_0x17676d,_0x455155){_0x17676d=_0x17676d-0x0;var _0x29bd4a=_0x8e1a[_0x17676d];return _0x29bd4a;};'use strict';var Sequelize=require(_0xa8e1('0x0'));module[_0xa8e1('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa8e1('0x2')]}}; \ No newline at end of file +var _0xe237=['sequelize','STRING'];(function(_0x2dc040,_0x35ad1f){var _0x19db82=function(_0x1a0a67){while(--_0x1a0a67){_0x2dc040['push'](_0x2dc040['shift']());}};_0x19db82(++_0x35ad1f);}(_0xe237,0x164));var _0x7e23=function(_0x5661d8,_0x385cd9){_0x5661d8=_0x5661d8-0x0;var _0x5e938f=_0xe237[_0x5661d8];return _0x5e938f;};'use strict';var Sequelize=require(_0x7e23('0x0'));module['exports']={'name':{'type':Sequelize[_0x7e23('0x1')]},'description':{'type':Sequelize[_0x7e23('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 31a8f4b..48a3800 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 _0x6938=['offset','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','FreshdeskConfiguration','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','then','includeAll','include','findAll','catch','show','params','find','create','body','findOne','getFields','nolimit','getSubjects','FreshdeskField','order','getDescriptions','getTags','setTags','ids','eml-format','moment','bluebird','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x6938,0xd5));var _0x8693=function(_0x9cd01b,_0x568ca3){_0x9cd01b=_0x9cd01b-0x0;var _0x51cd28=_0x6938[_0x9cd01b];return _0x51cd28;};'use strict';var emlformat=require(_0x8693('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8693('0x1'));var BPromise=require(_0x8693('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8693('0x3'));var sox=require('sox');var csv=require(_0x8693('0x4'));var ejs=require(_0x8693('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8693('0x6'));var crypto=require(_0x8693('0x7'));var jsforce=require(_0x8693('0x8'));var deskjs=require(_0x8693('0x9'));var toCsv=require(_0x8693('0x4'));var querystring=require(_0x8693('0xa'));var Papa=require(_0x8693('0xb'));var Redis=require('ioredis');var authService=require(_0x8693('0xc'));var qs=require(_0x8693('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8693('0xe'))(_0x8693('0xf'));var utils=require(_0x8693('0x10'));var config=require(_0x8693('0x11'));var licenseUtil=require(_0x8693('0x12'));var db=require(_0x8693('0x13'))['db'];function respondWithStatusCode(_0x24cf32,_0x50441d){_0x50441d=_0x50441d||0xcc;return function(_0x189ccc){if(_0x189ccc){return _0x24cf32[_0x8693('0x14')](_0x50441d);}return _0x24cf32[_0x8693('0x15')](_0x50441d)[_0x8693('0x16')]();};}function respondWithResult(_0x221c4f,_0x1f4765){_0x1f4765=_0x1f4765||0xc8;return function(_0x337f28){if(_0x337f28){return _0x221c4f[_0x8693('0x15')](_0x1f4765)[_0x8693('0x17')](_0x337f28);}};}function respondWithFilteredResult(_0x51a7ba,_0x21214a){return function(_0x1473c7){if(_0x1473c7){var _0x1a483e=typeof _0x21214a['offset']===_0x8693('0x18')&&typeof _0x21214a[_0x8693('0x19')]==='undefined';var _0x3ba8ff=_0x1473c7[_0x8693('0x1a')];var _0x15b1cf=_0x1a483e?0x0:_0x21214a[_0x8693('0x1b')];var _0x25db4f=_0x1a483e?_0x1473c7[_0x8693('0x1a')]:_0x21214a['offset']+_0x21214a[_0x8693('0x19')];var _0xfabec5;if(_0x25db4f>=_0x3ba8ff){_0x25db4f=_0x3ba8ff;_0xfabec5=0xc8;}else{_0xfabec5=0xce;}_0x51a7ba[_0x8693('0x15')](_0xfabec5);return _0x51a7ba[_0x8693('0x1c')](_0x8693('0x1d'),_0x15b1cf+'-'+_0x25db4f+'/'+_0x3ba8ff)[_0x8693('0x17')](_0x1473c7);}return null;};}function patchUpdates(_0x3fee48){return function(_0x19756f){try{jsonpatch[_0x8693('0x1e')](_0x19756f,_0x3fee48,!![]);}catch(_0x38c98e){return BPromise[_0x8693('0x1f')](_0x38c98e);}return _0x19756f[_0x8693('0x20')]();};}function saveUpdates(_0xdcc6b1,_0x21a914){return function(_0x34d383){if(_0x34d383){return _0x34d383[_0x8693('0x21')](_0xdcc6b1)['then'](function(_0x211851){return _0x211851;});}return null;};}function removeEntity(_0x45b4d3,_0x20278f){return function(_0x4fbc66){if(_0x4fbc66){return _0x4fbc66[_0x8693('0x22')]()['then'](function(){_0x45b4d3['status'](0xcc)[_0x8693('0x16')]();});}};}function handleEntityNotFound(_0x90bded,_0x17580e){return function(_0x773bb1){if(!_0x773bb1){_0x90bded[_0x8693('0x14')](0x194);}return _0x773bb1;};}function handleError(_0x474ae2,_0x5f0ab4){_0x5f0ab4=_0x5f0ab4||0x1f4;return function(_0x489eab){logger[_0x8693('0x23')](_0x489eab[_0x8693('0x24')]);if(_0x489eab[_0x8693('0x25')]){delete _0x489eab[_0x8693('0x25')];}_0x474ae2[_0x8693('0x15')](_0x5f0ab4)[_0x8693('0x26')](_0x489eab);};}exports[_0x8693('0x27')]=function(_0x4c0b45,_0x523716){var _0x50a8ef={},_0x525be8={},_0x4ccd8a={'count':0x0,'rows':[]};var _0x1d7b5f=_['map'](db[_0x8693('0x28')][_0x8693('0x29')],function(_0x3e5114){return{'name':_0x3e5114['fieldName'],'type':_0x3e5114[_0x8693('0x2a')][_0x8693('0x2b')]};});_0x525be8[_0x8693('0x2c')]=_[_0x8693('0x2d')](_0x1d7b5f,_0x8693('0x25'));_0x525be8[_0x8693('0x2e')]=_[_0x8693('0x2f')](_0x4c0b45[_0x8693('0x2e')]);_0x525be8[_0x8693('0x30')]=_[_0x8693('0x31')](_0x525be8[_0x8693('0x2c')],_0x525be8[_0x8693('0x2e')]);_0x50a8ef[_0x8693('0x32')]=_['intersection'](_0x525be8[_0x8693('0x2c')],qs['fields'](_0x4c0b45[_0x8693('0x2e')][_0x8693('0x33')]));_0x50a8ef[_0x8693('0x32')]=_0x50a8ef['attributes'][_0x8693('0x34')]?_0x50a8ef[_0x8693('0x32')]:_0x525be8[_0x8693('0x2c')];if(!_0x4c0b45[_0x8693('0x2e')][_0x8693('0x35')]('nolimit')){_0x50a8ef['limit']=qs[_0x8693('0x19')](_0x4c0b45['query'][_0x8693('0x19')]);_0x50a8ef['offset']=qs[_0x8693('0x1b')](_0x4c0b45['query'][_0x8693('0x1b')]);}_0x50a8ef['order']=qs['sort'](_0x4c0b45[_0x8693('0x2e')][_0x8693('0x36')]);_0x50a8ef[_0x8693('0x37')]=qs[_0x8693('0x30')](_[_0x8693('0x38')](_0x4c0b45[_0x8693('0x2e')],_0x525be8[_0x8693('0x30')]),_0x1d7b5f);if(_0x4c0b45[_0x8693('0x2e')][_0x8693('0x39')]){_0x50a8ef[_0x8693('0x37')]=_[_0x8693('0x3a')](_0x50a8ef[_0x8693('0x37')],{'$or':_[_0x8693('0x2d')](_0x1d7b5f,function(_0x3ff435){if(_0x3ff435[_0x8693('0x2a')]!=='VIRTUAL'){var _0x125c3a={};_0x125c3a[_0x3ff435[_0x8693('0x25')]]={'$like':'%'+_0x4c0b45[_0x8693('0x2e')]['filter']+'%'};return _0x125c3a;}})});}_0x50a8ef=_[_0x8693('0x3a')]({},_0x50a8ef,_0x4c0b45[_0x8693('0x3b')]);var _0x369f71={'where':_0x50a8ef[_0x8693('0x37')]};return db['FreshdeskConfiguration'][_0x8693('0x1a')](_0x369f71)[_0x8693('0x3c')](function(_0x21a1b7){_0x4ccd8a[_0x8693('0x1a')]=_0x21a1b7;if(_0x4c0b45[_0x8693('0x2e')][_0x8693('0x3d')]){_0x50a8ef[_0x8693('0x3e')]=[{'all':!![]}];}return db[_0x8693('0x28')][_0x8693('0x3f')](_0x50a8ef);})['then'](function(_0x35513f){_0x4ccd8a['rows']=_0x35513f;return _0x4ccd8a;})[_0x8693('0x3c')](respondWithFilteredResult(_0x523716,_0x50a8ef))[_0x8693('0x40')](handleError(_0x523716,null));};exports[_0x8693('0x41')]=function(_0x4cc16e,_0xb266c9){var _0x76ef08={'raw':![],'where':{'id':_0x4cc16e[_0x8693('0x42')]['id']}},_0x200a39={};_0x200a39['model']=_[_0x8693('0x2f')](db[_0x8693('0x28')][_0x8693('0x29')]);_0x200a39[_0x8693('0x2e')]=_['keys'](_0x4cc16e[_0x8693('0x2e')]);_0x200a39[_0x8693('0x30')]=_[_0x8693('0x31')](_0x200a39['model'],_0x200a39[_0x8693('0x2e')]);_0x76ef08['attributes']=_[_0x8693('0x31')](_0x200a39[_0x8693('0x2c')],qs[_0x8693('0x33')](_0x4cc16e[_0x8693('0x2e')][_0x8693('0x33')]));_0x76ef08[_0x8693('0x32')]=_0x76ef08[_0x8693('0x32')][_0x8693('0x34')]?_0x76ef08[_0x8693('0x32')]:_0x200a39[_0x8693('0x2c')];if(_0x4cc16e[_0x8693('0x2e')][_0x8693('0x3d')]){_0x76ef08[_0x8693('0x3e')]=[{'all':!![]}];}_0x76ef08=_['merge']({},_0x76ef08,_0x4cc16e[_0x8693('0x3b')]);return db[_0x8693('0x28')][_0x8693('0x43')](_0x76ef08)[_0x8693('0x3c')](handleEntityNotFound(_0xb266c9,null))[_0x8693('0x3c')](respondWithResult(_0xb266c9,null))['catch'](handleError(_0xb266c9,null));};exports[_0x8693('0x44')]=function(_0x1e4658,_0x29d070){return db['FreshdeskConfiguration']['create'](_0x1e4658[_0x8693('0x45')],{})[_0x8693('0x3c')](respondWithResult(_0x29d070,0xc9))[_0x8693('0x40')](handleError(_0x29d070,null));};exports[_0x8693('0x21')]=function(_0x27537a,_0x1da2b1){if(_0x27537a[_0x8693('0x45')]['id']){delete _0x27537a[_0x8693('0x45')]['id'];}return db[_0x8693('0x28')][_0x8693('0x43')]({'where':{'id':_0x27537a[_0x8693('0x42')]['id']}})['then'](handleEntityNotFound(_0x1da2b1,null))[_0x8693('0x3c')](saveUpdates(_0x27537a[_0x8693('0x45')],null))['then'](respondWithResult(_0x1da2b1,null))[_0x8693('0x40')](handleError(_0x1da2b1,null));};exports[_0x8693('0x22')]=function(_0x5ac072,_0x16774d){return db[_0x8693('0x28')]['find']({'where':{'id':_0x5ac072[_0x8693('0x42')]['id']}})['then'](handleEntityNotFound(_0x16774d,null))[_0x8693('0x3c')](removeEntity(_0x16774d,null))[_0x8693('0x40')](handleError(_0x16774d,null));};exports['getFields']=function(_0x4d4319,_0x40d224,_0x2f0b91){var _0x899c4e={};var _0x366541={};var _0x1d8d0b;var _0x208307;return db[_0x8693('0x28')][_0x8693('0x46')]({'where':{'id':_0x4d4319[_0x8693('0x42')]['id']}})[_0x8693('0x3c')](handleEntityNotFound(_0x40d224,null))['then'](function(_0x1fbe68){if(_0x1fbe68){_0x1d8d0b=_0x1fbe68;_0x366541[_0x8693('0x2c')]=_[_0x8693('0x2f')](db['FreshdeskField'][_0x8693('0x29')]);_0x366541[_0x8693('0x2e')]=_[_0x8693('0x2f')](_0x4d4319[_0x8693('0x2e')]);_0x366541['filters']=_['intersection'](_0x366541[_0x8693('0x2c')],_0x366541['query']);_0x899c4e[_0x8693('0x32')]=_[_0x8693('0x31')](_0x366541[_0x8693('0x2c')],qs[_0x8693('0x33')](_0x4d4319[_0x8693('0x2e')][_0x8693('0x33')]));_0x899c4e['attributes']=_0x899c4e[_0x8693('0x32')][_0x8693('0x34')]?_0x899c4e[_0x8693('0x32')]:_0x366541[_0x8693('0x2c')];_0x899c4e['order']=qs[_0x8693('0x36')](_0x4d4319['query']['sort']);_0x899c4e['where']=qs[_0x8693('0x30')](_[_0x8693('0x38')](_0x4d4319[_0x8693('0x2e')],_0x366541[_0x8693('0x30')]));if(_0x4d4319[_0x8693('0x2e')][_0x8693('0x39')]){_0x899c4e['where']=_[_0x8693('0x3a')](_0x899c4e[_0x8693('0x37')],{'$or':_[_0x8693('0x2d')](_0x899c4e[_0x8693('0x32')],function(_0x45aa05){var _0x3f9f6e={};_0x3f9f6e[_0x45aa05]={'$like':'%'+_0x4d4319[_0x8693('0x2e')]['filter']+'%'};return _0x3f9f6e;})});}_0x899c4e=_[_0x8693('0x3a')]({},_0x899c4e,_0x4d4319[_0x8693('0x3b')]);return _0x1d8d0b[_0x8693('0x47')](_0x899c4e);}})['then'](function(_0x11a05e){if(_0x11a05e){_0x208307=_0x11a05e[_0x8693('0x34')];if(!_0x4d4319[_0x8693('0x2e')]['hasOwnProperty'](_0x8693('0x48'))){_0x899c4e['limit']=qs['limit'](_0x4d4319[_0x8693('0x2e')]['limit']);_0x899c4e['offset']=qs[_0x8693('0x1b')](_0x4d4319[_0x8693('0x2e')][_0x8693('0x1b')]);}return _0x1d8d0b[_0x8693('0x47')](_0x899c4e);}})['then'](function(_0x1d9df5){if(_0x1d9df5){return _0x1d9df5?{'count':_0x208307,'rows':_0x1d9df5}:null;}})[_0x8693('0x3c')](respondWithResult(_0x40d224,null))[_0x8693('0x40')](handleError(_0x40d224,null));};exports[_0x8693('0x49')]=function(_0x33f4dd,_0x2ccf7f,_0x16b056){var _0x521243={};var _0x145c28={};var _0xb3fe6c;var _0x2773c6;return db[_0x8693('0x28')][_0x8693('0x46')]({'where':{'id':_0x33f4dd[_0x8693('0x42')]['id']}})['then'](handleEntityNotFound(_0x2ccf7f,null))[_0x8693('0x3c')](function(_0x4bf9b4){if(_0x4bf9b4){_0xb3fe6c=_0x4bf9b4;_0x145c28['model']=_[_0x8693('0x2f')](db[_0x8693('0x4a')][_0x8693('0x29')]);_0x145c28[_0x8693('0x2e')]=_[_0x8693('0x2f')](_0x33f4dd[_0x8693('0x2e')]);_0x145c28[_0x8693('0x30')]=_[_0x8693('0x31')](_0x145c28[_0x8693('0x2c')],_0x145c28['query']);_0x521243[_0x8693('0x32')]=_[_0x8693('0x31')](_0x145c28['model'],qs[_0x8693('0x33')](_0x33f4dd[_0x8693('0x2e')][_0x8693('0x33')]));_0x521243[_0x8693('0x32')]=_0x521243[_0x8693('0x32')][_0x8693('0x34')]?_0x521243[_0x8693('0x32')]:_0x145c28[_0x8693('0x2c')];_0x521243[_0x8693('0x4b')]=qs['sort'](_0x33f4dd[_0x8693('0x2e')][_0x8693('0x36')]);_0x521243[_0x8693('0x37')]=qs[_0x8693('0x30')](_[_0x8693('0x38')](_0x33f4dd['query'],_0x145c28[_0x8693('0x30')]));if(_0x33f4dd[_0x8693('0x2e')][_0x8693('0x39')]){_0x521243[_0x8693('0x37')]=_['merge'](_0x521243[_0x8693('0x37')],{'$or':_['map'](_0x521243['attributes'],function(_0x49646b){var _0x58748c={};_0x58748c[_0x49646b]={'$like':'%'+_0x33f4dd['query'][_0x8693('0x39')]+'%'};return _0x58748c;})});}_0x521243=_['merge']({},_0x521243,_0x33f4dd[_0x8693('0x3b')]);return _0xb3fe6c['getSubjects'](_0x521243);}})[_0x8693('0x3c')](function(_0x53d000){if(_0x53d000){_0x2773c6=_0x53d000[_0x8693('0x34')];if(!_0x33f4dd[_0x8693('0x2e')][_0x8693('0x35')](_0x8693('0x48'))){_0x521243[_0x8693('0x19')]=qs[_0x8693('0x19')](_0x33f4dd['query'][_0x8693('0x19')]);_0x521243[_0x8693('0x1b')]=qs['offset'](_0x33f4dd[_0x8693('0x2e')][_0x8693('0x1b')]);}return _0xb3fe6c['getSubjects'](_0x521243);}})['then'](function(_0x5d98d4){if(_0x5d98d4){return _0x5d98d4?{'count':_0x2773c6,'rows':_0x5d98d4}:null;}})[_0x8693('0x3c')](respondWithResult(_0x2ccf7f,null))[_0x8693('0x40')](handleError(_0x2ccf7f,null));};exports[_0x8693('0x4c')]=function(_0x125233,_0x50137b,_0x20c797){var _0x2e17c6={};var _0xb68ba5={};var _0x858aac;var _0x38929a;return db[_0x8693('0x28')][_0x8693('0x46')]({'where':{'id':_0x125233['params']['id']}})['then'](handleEntityNotFound(_0x50137b,null))[_0x8693('0x3c')](function(_0x2f1a97){if(_0x2f1a97){_0x858aac=_0x2f1a97;_0xb68ba5[_0x8693('0x2c')]=_[_0x8693('0x2f')](db[_0x8693('0x4a')]['rawAttributes']);_0xb68ba5[_0x8693('0x2e')]=_[_0x8693('0x2f')](_0x125233[_0x8693('0x2e')]);_0xb68ba5[_0x8693('0x30')]=_[_0x8693('0x31')](_0xb68ba5['model'],_0xb68ba5[_0x8693('0x2e')]);_0x2e17c6[_0x8693('0x32')]=_[_0x8693('0x31')](_0xb68ba5[_0x8693('0x2c')],qs['fields'](_0x125233[_0x8693('0x2e')]['fields']));_0x2e17c6[_0x8693('0x32')]=_0x2e17c6[_0x8693('0x32')][_0x8693('0x34')]?_0x2e17c6[_0x8693('0x32')]:_0xb68ba5[_0x8693('0x2c')];_0x2e17c6[_0x8693('0x4b')]=qs[_0x8693('0x36')](_0x125233['query'][_0x8693('0x36')]);_0x2e17c6[_0x8693('0x37')]=qs[_0x8693('0x30')](_[_0x8693('0x38')](_0x125233[_0x8693('0x2e')],_0xb68ba5[_0x8693('0x30')]));if(_0x125233['query'][_0x8693('0x39')]){_0x2e17c6[_0x8693('0x37')]=_['merge'](_0x2e17c6[_0x8693('0x37')],{'$or':_[_0x8693('0x2d')](_0x2e17c6[_0x8693('0x32')],function(_0x501654){var _0x1aef1b={};_0x1aef1b[_0x501654]={'$like':'%'+_0x125233['query'][_0x8693('0x39')]+'%'};return _0x1aef1b;})});}_0x2e17c6=_[_0x8693('0x3a')]({},_0x2e17c6,_0x125233[_0x8693('0x3b')]);return _0x858aac[_0x8693('0x4c')](_0x2e17c6);}})[_0x8693('0x3c')](function(_0x3bfd58){if(_0x3bfd58){_0x38929a=_0x3bfd58[_0x8693('0x34')];if(!_0x125233[_0x8693('0x2e')][_0x8693('0x35')](_0x8693('0x48'))){_0x2e17c6[_0x8693('0x19')]=qs[_0x8693('0x19')](_0x125233[_0x8693('0x2e')][_0x8693('0x19')]);_0x2e17c6[_0x8693('0x1b')]=qs[_0x8693('0x1b')](_0x125233[_0x8693('0x2e')]['offset']);}return _0x858aac[_0x8693('0x4c')](_0x2e17c6);}})['then'](function(_0x1f2d54){if(_0x1f2d54){return _0x1f2d54?{'count':_0x38929a,'rows':_0x1f2d54}:null;}})[_0x8693('0x3c')](respondWithResult(_0x50137b,null))['catch'](handleError(_0x50137b,null));};exports[_0x8693('0x4d')]=function(_0x5ded83,_0x41b71a,_0x9d0d68){var _0x34857b={};var _0x51f819={};var _0x5e4638;var _0x59c0a7;return db['FreshdeskConfiguration'][_0x8693('0x46')]({'where':{'id':_0x5ded83[_0x8693('0x42')]['id']}})[_0x8693('0x3c')](handleEntityNotFound(_0x41b71a,null))['then'](function(_0x11d8ee){if(_0x11d8ee){_0x5e4638=_0x11d8ee;_0x51f819[_0x8693('0x2c')]=_['keys'](db['Tag']['rawAttributes']);_0x51f819['query']=_[_0x8693('0x2f')](_0x5ded83[_0x8693('0x2e')]);_0x51f819[_0x8693('0x30')]=_[_0x8693('0x31')](_0x51f819['model'],_0x51f819[_0x8693('0x2e')]);_0x34857b[_0x8693('0x32')]=_[_0x8693('0x31')](_0x51f819[_0x8693('0x2c')],qs['fields'](_0x5ded83[_0x8693('0x2e')][_0x8693('0x33')]));_0x34857b[_0x8693('0x32')]=_0x34857b[_0x8693('0x32')][_0x8693('0x34')]?_0x34857b[_0x8693('0x32')]:_0x51f819['model'];_0x34857b['order']=qs[_0x8693('0x36')](_0x5ded83[_0x8693('0x2e')][_0x8693('0x36')]);_0x34857b['where']=qs['filters'](_[_0x8693('0x38')](_0x5ded83['query'],_0x51f819[_0x8693('0x30')]));if(_0x5ded83[_0x8693('0x2e')][_0x8693('0x39')]){_0x34857b['where']=_[_0x8693('0x3a')](_0x34857b[_0x8693('0x37')],{'$or':_['map'](_0x34857b[_0x8693('0x32')],function(_0x230b34){var _0x54b2ad={};_0x54b2ad[_0x230b34]={'$like':'%'+_0x5ded83[_0x8693('0x2e')][_0x8693('0x39')]+'%'};return _0x54b2ad;})});}_0x34857b=_[_0x8693('0x3a')]({},_0x34857b,_0x5ded83['options']);return _0x5e4638[_0x8693('0x4d')](_0x34857b);}})['then'](function(_0x1ef202){if(_0x1ef202){_0x59c0a7=_0x1ef202['length'];if(!_0x5ded83[_0x8693('0x2e')][_0x8693('0x35')](_0x8693('0x48'))){_0x34857b['limit']=qs[_0x8693('0x19')](_0x5ded83['query'][_0x8693('0x19')]);_0x34857b[_0x8693('0x1b')]=qs[_0x8693('0x1b')](_0x5ded83[_0x8693('0x2e')][_0x8693('0x1b')]);}return _0x5e4638[_0x8693('0x4d')](_0x34857b);}})['then'](function(_0x34044c){if(_0x34044c){return _0x34044c?{'count':_0x59c0a7,'rows':_0x34044c}:null;}})['then'](respondWithResult(_0x41b71a,null))['catch'](handleError(_0x41b71a,null));};exports[_0x8693('0x4e')]=function(_0xea0593,_0x48a41b,_0x13ca18){if(_0xea0593[_0x8693('0x45')]['id']){delete _0xea0593[_0x8693('0x45')]['id'];}return db[_0x8693('0x28')][_0x8693('0x46')]({'where':{'id':_0xea0593[_0x8693('0x42')]['id']}})['then'](handleEntityNotFound(_0x48a41b,null))[_0x8693('0x3c')](function(_0x61d932){if(_0x61d932){return _0x61d932[_0x8693('0x4e')](_0xea0593[_0x8693('0x45')][_0x8693('0x4f')]||[]);}return null;})[_0x8693('0x3c')](respondWithResult(_0x48a41b,null))[_0x8693('0x40')](handleError(_0x48a41b,null));}; \ No newline at end of file +var _0xe5d1=['zip-dir','request-promise','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','getFields','findOne','FreshdeskField','length','getSubjects','getDescriptions','Tag','setTags','ids','rimraf'];(function(_0x4c3e29,_0x2afb51){var _0xf4f34c=function(_0x3da8d9){while(--_0x3da8d9){_0x4c3e29['push'](_0x4c3e29['shift']());}};_0xf4f34c(++_0x2afb51);}(_0xe5d1,0xa7));var _0x1e5d=function(_0x2c93e2,_0x4fb5e2){_0x2c93e2=_0x2c93e2-0x0;var _0x57264e=_0xe5d1[_0x2c93e2];return _0x57264e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1e5d('0x0'));var zipdir=require(_0x1e5d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1e5d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1e5d('0x3'));var util=require(_0x1e5d('0x4'));var path=require('path');var sox=require(_0x1e5d('0x5'));var csv=require('to-csv');var ejs=require(_0x1e5d('0x6'));var fs=require('fs');var fs_extra=require(_0x1e5d('0x7'));var _=require(_0x1e5d('0x8'));var squel=require(_0x1e5d('0x9'));var crypto=require(_0x1e5d('0xa'));var jsforce=require(_0x1e5d('0xb'));var deskjs=require(_0x1e5d('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1e5d('0xd'));var Papa=require(_0x1e5d('0xe'));var Redis=require(_0x1e5d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1e5d('0x10'));var as=require(_0x1e5d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e5d('0x12'))(_0x1e5d('0x13'));var utils=require('../../config/utils');var config=require(_0x1e5d('0x14'));var licenseUtil=require(_0x1e5d('0x15'));var db=require(_0x1e5d('0x16'))['db'];function respondWithStatusCode(_0x266618,_0x2727dc){_0x2727dc=_0x2727dc||0xcc;return function(_0x4233c2){if(_0x4233c2){return _0x266618[_0x1e5d('0x17')](_0x2727dc);}return _0x266618[_0x1e5d('0x18')](_0x2727dc)[_0x1e5d('0x19')]();};}function respondWithResult(_0x18da15,_0x48535b){_0x48535b=_0x48535b||0xc8;return function(_0x1d784a){if(_0x1d784a){return _0x18da15[_0x1e5d('0x18')](_0x48535b)[_0x1e5d('0x1a')](_0x1d784a);}};}function respondWithFilteredResult(_0x32d417,_0x6c7600){return function(_0x172375){if(_0x172375){var _0x42c0d0=typeof _0x6c7600[_0x1e5d('0x1b')]===_0x1e5d('0x1c')&&typeof _0x6c7600[_0x1e5d('0x1d')]===_0x1e5d('0x1c');var _0x349311=_0x172375[_0x1e5d('0x1e')];var _0x69f37c=_0x42c0d0?0x0:_0x6c7600[_0x1e5d('0x1b')];var _0x98e778=_0x42c0d0?_0x172375[_0x1e5d('0x1e')]:_0x6c7600['offset']+_0x6c7600[_0x1e5d('0x1d')];var _0x295127;if(_0x98e778>=_0x349311){_0x98e778=_0x349311;_0x295127=0xc8;}else{_0x295127=0xce;}_0x32d417[_0x1e5d('0x18')](_0x295127);return _0x32d417['set'](_0x1e5d('0x1f'),_0x69f37c+'-'+_0x98e778+'/'+_0x349311)[_0x1e5d('0x1a')](_0x172375);}return null;};}function patchUpdates(_0x1fe383){return function(_0x17eb6d){try{jsonpatch[_0x1e5d('0x20')](_0x17eb6d,_0x1fe383,!![]);}catch(_0x1468bb){return BPromise['reject'](_0x1468bb);}return _0x17eb6d[_0x1e5d('0x21')]();};}function saveUpdates(_0x3331f5,_0x5cbef1){return function(_0x53b709){if(_0x53b709){return _0x53b709[_0x1e5d('0x22')](_0x3331f5)['then'](function(_0x522096){return _0x522096;});}return null;};}function removeEntity(_0x500ec9,_0x3d481f){return function(_0x8bf72a){if(_0x8bf72a){return _0x8bf72a[_0x1e5d('0x23')]()[_0x1e5d('0x24')](function(){_0x500ec9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x34e29d,_0x3d3ce1){return function(_0x305176){if(!_0x305176){_0x34e29d[_0x1e5d('0x17')](0x194);}return _0x305176;};}function handleError(_0x5274cb,_0x5ca408){_0x5ca408=_0x5ca408||0x1f4;return function(_0x439c22){logger[_0x1e5d('0x25')](_0x439c22[_0x1e5d('0x26')]);if(_0x439c22[_0x1e5d('0x27')]){delete _0x439c22['name'];}_0x5274cb[_0x1e5d('0x18')](_0x5ca408)[_0x1e5d('0x28')](_0x439c22);};}exports[_0x1e5d('0x29')]=function(_0x33a126,_0x511429){var _0x4d41d5={},_0x122de0={},_0xde3e6f={'count':0x0,'rows':[]};var _0x27d9c4=_['map'](db[_0x1e5d('0x2a')][_0x1e5d('0x2b')],function(_0x41d181){return{'name':_0x41d181[_0x1e5d('0x2c')],'type':_0x41d181[_0x1e5d('0x2d')][_0x1e5d('0x2e')]};});_0x122de0[_0x1e5d('0x2f')]=_['map'](_0x27d9c4,_0x1e5d('0x27'));_0x122de0[_0x1e5d('0x30')]=_[_0x1e5d('0x31')](_0x33a126['query']);_0x122de0['filters']=_[_0x1e5d('0x32')](_0x122de0[_0x1e5d('0x2f')],_0x122de0[_0x1e5d('0x30')]);_0x4d41d5[_0x1e5d('0x33')]=_[_0x1e5d('0x32')](_0x122de0[_0x1e5d('0x2f')],qs[_0x1e5d('0x34')](_0x33a126[_0x1e5d('0x30')][_0x1e5d('0x34')]));_0x4d41d5['attributes']=_0x4d41d5[_0x1e5d('0x33')]['length']?_0x4d41d5['attributes']:_0x122de0[_0x1e5d('0x2f')];if(!_0x33a126[_0x1e5d('0x30')][_0x1e5d('0x35')](_0x1e5d('0x36'))){_0x4d41d5[_0x1e5d('0x1d')]=qs['limit'](_0x33a126[_0x1e5d('0x30')][_0x1e5d('0x1d')]);_0x4d41d5[_0x1e5d('0x1b')]=qs['offset'](_0x33a126[_0x1e5d('0x30')][_0x1e5d('0x1b')]);}_0x4d41d5[_0x1e5d('0x37')]=qs[_0x1e5d('0x38')](_0x33a126[_0x1e5d('0x30')]['sort']);_0x4d41d5[_0x1e5d('0x39')]=qs[_0x1e5d('0x3a')](_[_0x1e5d('0x3b')](_0x33a126['query'],_0x122de0[_0x1e5d('0x3a')]),_0x27d9c4);if(_0x33a126['query']['filter']){_0x4d41d5['where']=_[_0x1e5d('0x3c')](_0x4d41d5[_0x1e5d('0x39')],{'$or':_[_0x1e5d('0x3d')](_0x27d9c4,function(_0x28fb59){if(_0x28fb59[_0x1e5d('0x2d')]!==_0x1e5d('0x3e')){var _0x87e66c={};_0x87e66c[_0x28fb59[_0x1e5d('0x27')]]={'$like':'%'+_0x33a126[_0x1e5d('0x30')][_0x1e5d('0x3f')]+'%'};return _0x87e66c;}})});}_0x4d41d5=_[_0x1e5d('0x3c')]({},_0x4d41d5,_0x33a126[_0x1e5d('0x40')]);var _0x5d686c={'where':_0x4d41d5[_0x1e5d('0x39')]};return db[_0x1e5d('0x2a')][_0x1e5d('0x1e')](_0x5d686c)[_0x1e5d('0x24')](function(_0xfbb42d){_0xde3e6f[_0x1e5d('0x1e')]=_0xfbb42d;if(_0x33a126['query'][_0x1e5d('0x41')]){_0x4d41d5['include']=[{'all':!![]}];}return db[_0x1e5d('0x2a')][_0x1e5d('0x42')](_0x4d41d5);})[_0x1e5d('0x24')](function(_0x329463){_0xde3e6f[_0x1e5d('0x43')]=_0x329463;return _0xde3e6f;})[_0x1e5d('0x24')](respondWithFilteredResult(_0x511429,_0x4d41d5))[_0x1e5d('0x44')](handleError(_0x511429,null));};exports[_0x1e5d('0x45')]=function(_0x4f0ffe,_0x31cfa6){var _0xaf76d8={'raw':![],'where':{'id':_0x4f0ffe[_0x1e5d('0x46')]['id']}},_0x2d840a={};_0x2d840a[_0x1e5d('0x2f')]=_[_0x1e5d('0x31')](db[_0x1e5d('0x2a')]['rawAttributes']);_0x2d840a[_0x1e5d('0x30')]=_['keys'](_0x4f0ffe['query']);_0x2d840a[_0x1e5d('0x3a')]=_[_0x1e5d('0x32')](_0x2d840a[_0x1e5d('0x2f')],_0x2d840a[_0x1e5d('0x30')]);_0xaf76d8[_0x1e5d('0x33')]=_[_0x1e5d('0x32')](_0x2d840a[_0x1e5d('0x2f')],qs['fields'](_0x4f0ffe[_0x1e5d('0x30')]['fields']));_0xaf76d8[_0x1e5d('0x33')]=_0xaf76d8['attributes']['length']?_0xaf76d8[_0x1e5d('0x33')]:_0x2d840a['model'];if(_0x4f0ffe[_0x1e5d('0x30')]['includeAll']){_0xaf76d8[_0x1e5d('0x47')]=[{'all':!![]}];}_0xaf76d8=_[_0x1e5d('0x3c')]({},_0xaf76d8,_0x4f0ffe[_0x1e5d('0x40')]);return db['FreshdeskConfiguration']['find'](_0xaf76d8)[_0x1e5d('0x24')](handleEntityNotFound(_0x31cfa6,null))[_0x1e5d('0x24')](respondWithResult(_0x31cfa6,null))['catch'](handleError(_0x31cfa6,null));};exports[_0x1e5d('0x48')]=function(_0x8d07b0,_0x3a498d){return db['FreshdeskConfiguration'][_0x1e5d('0x48')](_0x8d07b0['body'],{})[_0x1e5d('0x24')](respondWithResult(_0x3a498d,0xc9))['catch'](handleError(_0x3a498d,null));};exports['update']=function(_0xde1e37,_0x292872){if(_0xde1e37[_0x1e5d('0x49')]['id']){delete _0xde1e37[_0x1e5d('0x49')]['id'];}return db['FreshdeskConfiguration'][_0x1e5d('0x4a')]({'where':{'id':_0xde1e37[_0x1e5d('0x46')]['id']}})[_0x1e5d('0x24')](handleEntityNotFound(_0x292872,null))[_0x1e5d('0x24')](saveUpdates(_0xde1e37[_0x1e5d('0x49')],null))[_0x1e5d('0x24')](respondWithResult(_0x292872,null))[_0x1e5d('0x44')](handleError(_0x292872,null));};exports[_0x1e5d('0x23')]=function(_0x40ecd9,_0x136a9e){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x40ecd9[_0x1e5d('0x46')]['id']}})['then'](handleEntityNotFound(_0x136a9e,null))[_0x1e5d('0x24')](removeEntity(_0x136a9e,null))[_0x1e5d('0x44')](handleError(_0x136a9e,null));};exports[_0x1e5d('0x4b')]=function(_0x4ac174,_0x347f81,_0x5b6749){var _0x5494ab={};var _0x1acb7c={};var _0x12e103;var _0x201806;return db[_0x1e5d('0x2a')][_0x1e5d('0x4c')]({'where':{'id':_0x4ac174[_0x1e5d('0x46')]['id']}})[_0x1e5d('0x24')](handleEntityNotFound(_0x347f81,null))[_0x1e5d('0x24')](function(_0x4596d2){if(_0x4596d2){_0x12e103=_0x4596d2;_0x1acb7c[_0x1e5d('0x2f')]=_[_0x1e5d('0x31')](db[_0x1e5d('0x4d')][_0x1e5d('0x2b')]);_0x1acb7c[_0x1e5d('0x30')]=_['keys'](_0x4ac174[_0x1e5d('0x30')]);_0x1acb7c['filters']=_[_0x1e5d('0x32')](_0x1acb7c[_0x1e5d('0x2f')],_0x1acb7c['query']);_0x5494ab[_0x1e5d('0x33')]=_[_0x1e5d('0x32')](_0x1acb7c['model'],qs[_0x1e5d('0x34')](_0x4ac174[_0x1e5d('0x30')]['fields']));_0x5494ab[_0x1e5d('0x33')]=_0x5494ab[_0x1e5d('0x33')][_0x1e5d('0x4e')]?_0x5494ab[_0x1e5d('0x33')]:_0x1acb7c[_0x1e5d('0x2f')];_0x5494ab[_0x1e5d('0x37')]=qs[_0x1e5d('0x38')](_0x4ac174[_0x1e5d('0x30')][_0x1e5d('0x38')]);_0x5494ab[_0x1e5d('0x39')]=qs[_0x1e5d('0x3a')](_[_0x1e5d('0x3b')](_0x4ac174['query'],_0x1acb7c[_0x1e5d('0x3a')]));if(_0x4ac174[_0x1e5d('0x30')]['filter']){_0x5494ab['where']=_[_0x1e5d('0x3c')](_0x5494ab[_0x1e5d('0x39')],{'$or':_[_0x1e5d('0x3d')](_0x5494ab[_0x1e5d('0x33')],function(_0x46843e){var _0x397d0e={};_0x397d0e[_0x46843e]={'$like':'%'+_0x4ac174[_0x1e5d('0x30')][_0x1e5d('0x3f')]+'%'};return _0x397d0e;})});}_0x5494ab=_[_0x1e5d('0x3c')]({},_0x5494ab,_0x4ac174[_0x1e5d('0x40')]);return _0x12e103['getFields'](_0x5494ab);}})['then'](function(_0x59f6d7){if(_0x59f6d7){_0x201806=_0x59f6d7[_0x1e5d('0x4e')];if(!_0x4ac174[_0x1e5d('0x30')][_0x1e5d('0x35')]('nolimit')){_0x5494ab[_0x1e5d('0x1d')]=qs[_0x1e5d('0x1d')](_0x4ac174[_0x1e5d('0x30')][_0x1e5d('0x1d')]);_0x5494ab[_0x1e5d('0x1b')]=qs[_0x1e5d('0x1b')](_0x4ac174[_0x1e5d('0x30')][_0x1e5d('0x1b')]);}return _0x12e103[_0x1e5d('0x4b')](_0x5494ab);}})['then'](function(_0x274a51){if(_0x274a51){return _0x274a51?{'count':_0x201806,'rows':_0x274a51}:null;}})[_0x1e5d('0x24')](respondWithResult(_0x347f81,null))[_0x1e5d('0x44')](handleError(_0x347f81,null));};exports['getSubjects']=function(_0x1909ea,_0x3c947b,_0x257386){var _0x2fdad2={};var _0x5532e3={};var _0x40f5f5;var _0x557e73;return db[_0x1e5d('0x2a')][_0x1e5d('0x4c')]({'where':{'id':_0x1909ea[_0x1e5d('0x46')]['id']}})[_0x1e5d('0x24')](handleEntityNotFound(_0x3c947b,null))[_0x1e5d('0x24')](function(_0x2adc4d){if(_0x2adc4d){_0x40f5f5=_0x2adc4d;_0x5532e3[_0x1e5d('0x2f')]=_['keys'](db[_0x1e5d('0x4d')]['rawAttributes']);_0x5532e3['query']=_[_0x1e5d('0x31')](_0x1909ea[_0x1e5d('0x30')]);_0x5532e3[_0x1e5d('0x3a')]=_[_0x1e5d('0x32')](_0x5532e3['model'],_0x5532e3[_0x1e5d('0x30')]);_0x2fdad2['attributes']=_['intersection'](_0x5532e3[_0x1e5d('0x2f')],qs[_0x1e5d('0x34')](_0x1909ea[_0x1e5d('0x30')][_0x1e5d('0x34')]));_0x2fdad2[_0x1e5d('0x33')]=_0x2fdad2['attributes'][_0x1e5d('0x4e')]?_0x2fdad2['attributes']:_0x5532e3[_0x1e5d('0x2f')];_0x2fdad2[_0x1e5d('0x37')]=qs[_0x1e5d('0x38')](_0x1909ea[_0x1e5d('0x30')]['sort']);_0x2fdad2[_0x1e5d('0x39')]=qs[_0x1e5d('0x3a')](_[_0x1e5d('0x3b')](_0x1909ea['query'],_0x5532e3['filters']));if(_0x1909ea[_0x1e5d('0x30')]['filter']){_0x2fdad2['where']=_['merge'](_0x2fdad2[_0x1e5d('0x39')],{'$or':_[_0x1e5d('0x3d')](_0x2fdad2[_0x1e5d('0x33')],function(_0x4af341){var _0x1e0f6b={};_0x1e0f6b[_0x4af341]={'$like':'%'+_0x1909ea['query']['filter']+'%'};return _0x1e0f6b;})});}_0x2fdad2=_[_0x1e5d('0x3c')]({},_0x2fdad2,_0x1909ea[_0x1e5d('0x40')]);return _0x40f5f5[_0x1e5d('0x4f')](_0x2fdad2);}})[_0x1e5d('0x24')](function(_0x33b014){if(_0x33b014){_0x557e73=_0x33b014[_0x1e5d('0x4e')];if(!_0x1909ea[_0x1e5d('0x30')]['hasOwnProperty'](_0x1e5d('0x36'))){_0x2fdad2['limit']=qs[_0x1e5d('0x1d')](_0x1909ea[_0x1e5d('0x30')][_0x1e5d('0x1d')]);_0x2fdad2[_0x1e5d('0x1b')]=qs[_0x1e5d('0x1b')](_0x1909ea[_0x1e5d('0x30')][_0x1e5d('0x1b')]);}return _0x40f5f5[_0x1e5d('0x4f')](_0x2fdad2);}})[_0x1e5d('0x24')](function(_0x185ea6){if(_0x185ea6){return _0x185ea6?{'count':_0x557e73,'rows':_0x185ea6}:null;}})[_0x1e5d('0x24')](respondWithResult(_0x3c947b,null))[_0x1e5d('0x44')](handleError(_0x3c947b,null));};exports[_0x1e5d('0x50')]=function(_0x25747e,_0x2bf1bd,_0x1c3025){var _0x2ece56={};var _0x392e11={};var _0x359a87;var _0x335436;return db[_0x1e5d('0x2a')][_0x1e5d('0x4c')]({'where':{'id':_0x25747e[_0x1e5d('0x46')]['id']}})[_0x1e5d('0x24')](handleEntityNotFound(_0x2bf1bd,null))[_0x1e5d('0x24')](function(_0x10df77){if(_0x10df77){_0x359a87=_0x10df77;_0x392e11[_0x1e5d('0x2f')]=_[_0x1e5d('0x31')](db[_0x1e5d('0x4d')][_0x1e5d('0x2b')]);_0x392e11[_0x1e5d('0x30')]=_[_0x1e5d('0x31')](_0x25747e[_0x1e5d('0x30')]);_0x392e11[_0x1e5d('0x3a')]=_[_0x1e5d('0x32')](_0x392e11['model'],_0x392e11[_0x1e5d('0x30')]);_0x2ece56['attributes']=_[_0x1e5d('0x32')](_0x392e11['model'],qs[_0x1e5d('0x34')](_0x25747e[_0x1e5d('0x30')][_0x1e5d('0x34')]));_0x2ece56['attributes']=_0x2ece56[_0x1e5d('0x33')][_0x1e5d('0x4e')]?_0x2ece56[_0x1e5d('0x33')]:_0x392e11[_0x1e5d('0x2f')];_0x2ece56['order']=qs[_0x1e5d('0x38')](_0x25747e['query']['sort']);_0x2ece56['where']=qs['filters'](_[_0x1e5d('0x3b')](_0x25747e[_0x1e5d('0x30')],_0x392e11[_0x1e5d('0x3a')]));if(_0x25747e[_0x1e5d('0x30')]['filter']){_0x2ece56[_0x1e5d('0x39')]=_['merge'](_0x2ece56[_0x1e5d('0x39')],{'$or':_[_0x1e5d('0x3d')](_0x2ece56[_0x1e5d('0x33')],function(_0x1d8e57){var _0x3335ec={};_0x3335ec[_0x1d8e57]={'$like':'%'+_0x25747e['query']['filter']+'%'};return _0x3335ec;})});}_0x2ece56=_['merge']({},_0x2ece56,_0x25747e[_0x1e5d('0x40')]);return _0x359a87[_0x1e5d('0x50')](_0x2ece56);}})['then'](function(_0x36b46a){if(_0x36b46a){_0x335436=_0x36b46a['length'];if(!_0x25747e[_0x1e5d('0x30')][_0x1e5d('0x35')](_0x1e5d('0x36'))){_0x2ece56[_0x1e5d('0x1d')]=qs[_0x1e5d('0x1d')](_0x25747e[_0x1e5d('0x30')]['limit']);_0x2ece56[_0x1e5d('0x1b')]=qs[_0x1e5d('0x1b')](_0x25747e['query'][_0x1e5d('0x1b')]);}return _0x359a87['getDescriptions'](_0x2ece56);}})['then'](function(_0x241401){if(_0x241401){return _0x241401?{'count':_0x335436,'rows':_0x241401}:null;}})['then'](respondWithResult(_0x2bf1bd,null))[_0x1e5d('0x44')](handleError(_0x2bf1bd,null));};exports['getTags']=function(_0xa9feeb,_0x71f648,_0x217af4){var _0x25e4c4={};var _0x36a153={};var _0xd9cfa0;var _0x434456;return db[_0x1e5d('0x2a')]['findOne']({'where':{'id':_0xa9feeb[_0x1e5d('0x46')]['id']}})[_0x1e5d('0x24')](handleEntityNotFound(_0x71f648,null))[_0x1e5d('0x24')](function(_0x1c36dc){if(_0x1c36dc){_0xd9cfa0=_0x1c36dc;_0x36a153[_0x1e5d('0x2f')]=_[_0x1e5d('0x31')](db[_0x1e5d('0x51')][_0x1e5d('0x2b')]);_0x36a153[_0x1e5d('0x30')]=_[_0x1e5d('0x31')](_0xa9feeb[_0x1e5d('0x30')]);_0x36a153['filters']=_['intersection'](_0x36a153[_0x1e5d('0x2f')],_0x36a153[_0x1e5d('0x30')]);_0x25e4c4[_0x1e5d('0x33')]=_[_0x1e5d('0x32')](_0x36a153[_0x1e5d('0x2f')],qs[_0x1e5d('0x34')](_0xa9feeb[_0x1e5d('0x30')][_0x1e5d('0x34')]));_0x25e4c4[_0x1e5d('0x33')]=_0x25e4c4[_0x1e5d('0x33')]['length']?_0x25e4c4[_0x1e5d('0x33')]:_0x36a153['model'];_0x25e4c4[_0x1e5d('0x37')]=qs[_0x1e5d('0x38')](_0xa9feeb[_0x1e5d('0x30')][_0x1e5d('0x38')]);_0x25e4c4[_0x1e5d('0x39')]=qs['filters'](_[_0x1e5d('0x3b')](_0xa9feeb[_0x1e5d('0x30')],_0x36a153[_0x1e5d('0x3a')]));if(_0xa9feeb[_0x1e5d('0x30')]['filter']){_0x25e4c4[_0x1e5d('0x39')]=_[_0x1e5d('0x3c')](_0x25e4c4[_0x1e5d('0x39')],{'$or':_[_0x1e5d('0x3d')](_0x25e4c4[_0x1e5d('0x33')],function(_0x5e7828){var _0x32bfa4={};_0x32bfa4[_0x5e7828]={'$like':'%'+_0xa9feeb[_0x1e5d('0x30')][_0x1e5d('0x3f')]+'%'};return _0x32bfa4;})});}_0x25e4c4=_[_0x1e5d('0x3c')]({},_0x25e4c4,_0xa9feeb[_0x1e5d('0x40')]);return _0xd9cfa0['getTags'](_0x25e4c4);}})[_0x1e5d('0x24')](function(_0x1b9d57){if(_0x1b9d57){_0x434456=_0x1b9d57[_0x1e5d('0x4e')];if(!_0xa9feeb[_0x1e5d('0x30')][_0x1e5d('0x35')]('nolimit')){_0x25e4c4[_0x1e5d('0x1d')]=qs[_0x1e5d('0x1d')](_0xa9feeb['query']['limit']);_0x25e4c4[_0x1e5d('0x1b')]=qs[_0x1e5d('0x1b')](_0xa9feeb[_0x1e5d('0x30')][_0x1e5d('0x1b')]);}return _0xd9cfa0['getTags'](_0x25e4c4);}})['then'](function(_0x534f4f){if(_0x534f4f){return _0x534f4f?{'count':_0x434456,'rows':_0x534f4f}:null;}})['then'](respondWithResult(_0x71f648,null))[_0x1e5d('0x44')](handleError(_0x71f648,null));};exports[_0x1e5d('0x52')]=function(_0x21ab3a,_0x2740e7,_0x331f1b){if(_0x21ab3a[_0x1e5d('0x49')]['id']){delete _0x21ab3a['body']['id'];}return db[_0x1e5d('0x2a')]['findOne']({'where':{'id':_0x21ab3a[_0x1e5d('0x46')]['id']}})[_0x1e5d('0x24')](handleEntityNotFound(_0x2740e7,null))[_0x1e5d('0x24')](function(_0x51ee7b){if(_0x51ee7b){return _0x51ee7b[_0x1e5d('0x52')](_0x21ab3a[_0x1e5d('0x49')][_0x1e5d('0x53')]||[]);}return null;})['then'](respondWithResult(_0x2740e7,null))[_0x1e5d('0x44')](handleError(_0x2740e7,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index bf9f359..f8a7d3f 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 _0xf050=['api','bluebird','request-promise','rimraf','./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations','lodash','util','../../config/logger'];(function(_0x5611e3,_0x3a0188){var _0x4462ef=function(_0x5e3a46){while(--_0x5e3a46){_0x5611e3['push'](_0x5611e3['shift']());}};_0x4462ef(++_0x3a0188);}(_0xf050,0x1e1));var _0x0f05=function(_0x1daaa9,_0x220393){_0x1daaa9=_0x1daaa9-0x0;var _0x1dd221=_0xf050[_0x1daaa9];return _0x1dd221;};'use strict';var _=require(_0x0f05('0x0'));var util=require(_0x0f05('0x1'));var logger=require(_0x0f05('0x2'))(_0x0f05('0x3'));var moment=require('moment');var BPromise=require(_0x0f05('0x4'));var rp=require(_0x0f05('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0f05('0x6'));var config=require('../../config/environment');var attributes=require(_0x0f05('0x7'));module[_0x0f05('0x8')]=function(_0x5a40b6,_0x28d39d){return _0x5a40b6[_0x0f05('0x9')]('FreshdeskConfiguration',attributes,{'tableName':_0x0f05('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5df6=['path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x54dee7,_0x10ec9b){var _0x29e578=function(_0x3f600e){while(--_0x3f600e){_0x54dee7['push'](_0x54dee7['shift']());}};_0x29e578(++_0x10ec9b);}(_0x5df6,0x6f));var _0x65df=function(_0x2193b0,_0x330bbc){_0x2193b0=_0x2193b0-0x0;var _0x5d3431=_0x5df6[_0x2193b0];return _0x5d3431;};'use strict';var _=require(_0x65df('0x0'));var util=require(_0x65df('0x1'));var logger=require(_0x65df('0x2'))(_0x65df('0x3'));var moment=require('moment');var BPromise=require(_0x65df('0x4'));var rp=require(_0x65df('0x5'));var fs=require('fs');var path=require(_0x65df('0x6'));var rimraf=require(_0x65df('0x7'));var config=require(_0x65df('0x8'));var attributes=require(_0x65df('0x9'));module['exports']=function(_0x3f8136,_0x250c0a){return _0x3f8136[_0x65df('0xa')](_0x65df('0xb'),attributes,{'tableName':_0x65df('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 6f7fadd..4e9043f 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 _0x0b73=['then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','rpc','http','request'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x0b73,0xca));var _0x30b7=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x0b73[_0x24f31b];return _0x488401;};'use strict';var _=require(_0x30b7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x30b7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x30b7('0x2'))['db'];var utils=require(_0x30b7('0x3'));var logger=require('../../config/logger')(_0x30b7('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x30b7('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x1b1ff7,_0x4c0080,_0x3a6ba3){return new BPromise(function(_0x25edf3,_0x13adf4){return client[_0x30b7('0x6')](_0x1b1ff7,_0x3a6ba3)[_0x30b7('0x7')](function(_0x1132bf){logger['info'](_0x30b7('0x8'),_0x4c0080,_0x30b7('0x9'));logger[_0x30b7('0xa')](_0x30b7('0xb'),_0x4c0080,_0x30b7('0x9'),JSON[_0x30b7('0xc')](_0x1132bf));if(_0x1132bf['error']){if(_0x1132bf[_0x30b7('0xd')][_0x30b7('0xe')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x4c0080,_0x1132bf[_0x30b7('0xd')][_0x30b7('0xf')]);return _0x13adf4(_0x1132bf['error']['message']);}logger['error'](_0x30b7('0x8'),_0x4c0080,_0x1132bf[_0x30b7('0xd')]['message']);return _0x25edf3(_0x1132bf[_0x30b7('0xd')]['message']);}else{logger[_0x30b7('0x10')](_0x30b7('0x8'),_0x4c0080,'request\x20sent');_0x25edf3(_0x1132bf[_0x30b7('0x11')]['message']);}})[_0x30b7('0x12')](function(_0x111c4b){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x4c0080,_0x111c4b);_0x13adf4(_0x111c4b);});});} \ No newline at end of file +var _0xefec=['then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x5aac59,_0x47ee1e){var _0x40a314=function(_0x4e7bfc){while(--_0x4e7bfc){_0x5aac59['push'](_0x5aac59['shift']());}};_0x40a314(++_0x47ee1e);}(_0xefec,0xa2));var _0xcefe=function(_0x40ae52,_0x55586a){_0x40ae52=_0x40ae52-0x0;var _0x295dd3=_0xefec[_0x40ae52];return _0x295dd3;};'use strict';var _=require(_0xcefe('0x0'));var util=require(_0xcefe('0x1'));var moment=require(_0xcefe('0x2'));var BPromise=require(_0xcefe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcefe('0x4'));var db=require(_0xcefe('0x5'))['db'];var utils=require(_0xcefe('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xcefe('0x7'));var jayson=require(_0xcefe('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dff57,_0x29f97c,_0x3b988e){return new BPromise(function(_0x1d50f7,_0x15d99d){return client['request'](_0x3dff57,_0x3b988e)[_0xcefe('0x9')](function(_0x3710fb){logger['info'](_0xcefe('0xa'),_0x29f97c,_0xcefe('0xb'));logger[_0xcefe('0xc')](_0xcefe('0xd'),_0x29f97c,'request\x20sent',JSON[_0xcefe('0xe')](_0x3710fb));if(_0x3710fb[_0xcefe('0xf')]){if(_0x3710fb[_0xcefe('0xf')][_0xcefe('0x10')]===0x1f4){logger['error'](_0xcefe('0xa'),_0x29f97c,_0x3710fb[_0xcefe('0xf')]['message']);return _0x15d99d(_0x3710fb[_0xcefe('0xf')][_0xcefe('0x11')]);}logger[_0xcefe('0xf')](_0xcefe('0xa'),_0x29f97c,_0x3710fb[_0xcefe('0xf')]['message']);return _0x1d50f7(_0x3710fb['error'][_0xcefe('0x11')]);}else{logger['info'](_0xcefe('0xa'),_0x29f97c,_0xcefe('0xb'));_0x1d50f7(_0x3710fb['result'][_0xcefe('0x11')]);}})[_0xcefe('0x12')](function(_0x36a1cf){logger[_0xcefe('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x29f97c,_0x36a1cf);_0x15d99d(_0x36a1cf);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 4ef0d03..edb3495 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 _0xe75c=['../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','get','/:id','show','post','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x3f58ae,_0x5ae432){var _0x21d424=function(_0x155564){while(--_0x155564){_0x3f58ae['push'](_0x3f58ae['shift']());}};_0x21d424(++_0x5ae432);}(_0xe75c,0xd3));var _0xce75=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe75c[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xce75('0x0'));var util=require(_0xce75('0x1'));var path=require(_0xce75('0x2'));var timeout=require(_0xce75('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xce75('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xce75('0x5'));var config=require(_0xce75('0x6'));var controller=require(_0xce75('0x7'));router['get']('/',auth[_0xce75('0x8')](),controller[_0xce75('0x9')]);router[_0xce75('0xa')](_0xce75('0xb'),auth[_0xce75('0x8')](),controller[_0xce75('0xc')]);router[_0xce75('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xce75('0xe')]('/:id',auth[_0xce75('0x8')](),controller[_0xce75('0xf')]);router[_0xce75('0x10')]('/:id',auth[_0xce75('0x8')](),controller['destroy']);module[_0xce75('0x11')]=router; \ No newline at end of file +var _0xf490=['../../components/interaction/service','./intFreshdeskField.controller','isAuthenticated','index','get','/:id','show','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x529cf8,_0x4f395c){var _0x5a8c35=function(_0x10e460){while(--_0x10e460){_0x529cf8['push'](_0x529cf8['shift']());}};_0x5a8c35(++_0x4f395c);}(_0xf490,0x107));var _0x0f49=function(_0x4cc03b,_0x299f1c){_0x4cc03b=_0x4cc03b-0x0;var _0xf0358c=_0xf490[_0x4cc03b];return _0xf0358c;};'use strict';var multer=require(_0x0f49('0x0'));var util=require(_0x0f49('0x1'));var path=require(_0x0f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x0f49('0x3'));var router=express[_0x0f49('0x4')]();var fs_extra=require(_0x0f49('0x5'));var auth=require(_0x0f49('0x6'));var interaction=require(_0x0f49('0x7'));var config=require('../../config/environment');var controller=require(_0x0f49('0x8'));router['get']('/',auth[_0x0f49('0x9')](),controller[_0x0f49('0xa')]);router[_0x0f49('0xb')](_0x0f49('0xc'),auth[_0x0f49('0x9')](),controller[_0x0f49('0xd')]);router['post']('/',auth[_0x0f49('0x9')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0f49('0xe')]);router[_0x0f49('0xf')]('/:id',auth[_0x0f49('0x9')](),controller[_0x0f49('0x10')]);module[_0x0f49('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 77d2046..8613be7 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 _0x306d=['exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize'];(function(_0x22ec80,_0x304732){var _0x3018b4=function(_0x236c95){while(--_0x236c95){_0x22ec80['push'](_0x22ec80['shift']());}};_0x3018b4(++_0x304732);}(_0x306d,0xf9));var _0xd306=function(_0x417ca3,_0x1cce78){_0x417ca3=_0x417ca3-0x0;var _0x3a6fb4=_0x306d[_0x417ca3];return _0x3a6fb4;};'use strict';var Sequelize=require(_0xd306('0x0'));module[_0xd306('0x1')]={'type':{'type':Sequelize[_0xd306('0x2')]('string',_0xd306('0x3'),_0xd306('0x4'),_0xd306('0x5'),_0xd306('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd306('0x2')](_0xd306('0x7'),'variable',_0xd306('0x4'))},'keyContent':{'type':Sequelize[_0xd306('0x8')]},'idField':{'type':Sequelize[_0xd306('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd306('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd306('0x8')]}}; \ No newline at end of file +var _0x72fb=['BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue','picklist','string','STRING','variable'];(function(_0x526786,_0x105cbf){var _0x3a512d=function(_0x4efa05){while(--_0x4efa05){_0x526786['push'](_0x526786['shift']());}};_0x3a512d(++_0x105cbf);}(_0x72fb,0x1d7));var _0xb72f=function(_0x35e06d,_0xad434c){_0x35e06d=_0x35e06d-0x0;var _0x1b7a39=_0x72fb[_0x35e06d];return _0x1b7a39;};'use strict';var Sequelize=require(_0xb72f('0x0'));module[_0xb72f('0x1')]={'type':{'type':Sequelize[_0xb72f('0x2')]('string','variable',_0xb72f('0x3'),_0xb72f('0x4'),_0xb72f('0x5')),'defaultValue':_0xb72f('0x6')},'content':{'type':Sequelize[_0xb72f('0x7')]},'key':{'type':Sequelize[_0xb72f('0x7')]},'keyType':{'type':Sequelize[_0xb72f('0x2')](_0xb72f('0x6'),_0xb72f('0x8'),_0xb72f('0x3'))},'keyContent':{'type':Sequelize[_0xb72f('0x7')]},'idField':{'type':Sequelize[_0xb72f('0x7')]},'nameField':{'type':Sequelize[_0xb72f('0x7')]},'customField':{'type':Sequelize[_0xb72f('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index dbc0474..f9f62f0 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 _0xd64b=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','apply','reject','update','then','destroy','name','send','map','FreshdeskField','rawAttributes','type','key','model','query','filters','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','keys','intersection','length','include','options','find','create','body','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x4b5cc3,_0x36d22b){var _0x37e9a1=function(_0xeda1de){while(--_0xeda1de){_0x4b5cc3['push'](_0x4b5cc3['shift']());}};_0x37e9a1(++_0x36d22b);}(_0xd64b,0xc1));var _0xbd64=function(_0x469c7c,_0x4a54c6){_0x469c7c=_0x469c7c-0x0;var _0x4b8ffa=_0xd64b[_0x469c7c];return _0x4b8ffa;};'use strict';var emlformat=require(_0xbd64('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd64('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd64('0x2'));var moment=require(_0xbd64('0x3'));var BPromise=require(_0xbd64('0x4'));var Mustache=require(_0xbd64('0x5'));var util=require(_0xbd64('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd64('0x7'));var _=require(_0xbd64('0x8'));var squel=require(_0xbd64('0x9'));var crypto=require(_0xbd64('0xa'));var jsforce=require(_0xbd64('0xb'));var deskjs=require(_0xbd64('0xc'));var toCsv=require(_0xbd64('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbd64('0xe'));var authService=require(_0xbd64('0xf'));var qs=require(_0xbd64('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd64('0x11'));var logger=require(_0xbd64('0x12'))(_0xbd64('0x13'));var utils=require(_0xbd64('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbd64('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x136f60,_0x2729d8){_0x2729d8=_0x2729d8||0xcc;return function(_0x3a941c){if(_0x3a941c){return _0x136f60[_0xbd64('0x16')](_0x2729d8);}return _0x136f60[_0xbd64('0x17')](_0x2729d8)[_0xbd64('0x18')]();};}function respondWithResult(_0x2e23f2,_0x269e2f){_0x269e2f=_0x269e2f||0xc8;return function(_0x2b5808){if(_0x2b5808){return _0x2e23f2['status'](_0x269e2f)[_0xbd64('0x19')](_0x2b5808);}};}function respondWithFilteredResult(_0x13e7a4,_0x3ff550){return function(_0x32fd34){if(_0x32fd34){var _0x29fc16=typeof _0x3ff550['offset']===_0xbd64('0x1a')&&typeof _0x3ff550['limit']===_0xbd64('0x1a');var _0x1432a6=_0x32fd34[_0xbd64('0x1b')];var _0x1d7a14=_0x29fc16?0x0:_0x3ff550[_0xbd64('0x1c')];var _0x2f4554=_0x29fc16?_0x32fd34[_0xbd64('0x1b')]:_0x3ff550[_0xbd64('0x1c')]+_0x3ff550['limit'];var _0x305545;if(_0x2f4554>=_0x1432a6){_0x2f4554=_0x1432a6;_0x305545=0xc8;}else{_0x305545=0xce;}_0x13e7a4[_0xbd64('0x17')](_0x305545);return _0x13e7a4['set']('Content-Range',_0x1d7a14+'-'+_0x2f4554+'/'+_0x1432a6)[_0xbd64('0x19')](_0x32fd34);}return null;};}function patchUpdates(_0x42b328){return function(_0x196d21){try{jsonpatch[_0xbd64('0x1d')](_0x196d21,_0x42b328,!![]);}catch(_0x2c5551){return BPromise[_0xbd64('0x1e')](_0x2c5551);}return _0x196d21['save']();};}function saveUpdates(_0x4d4a16,_0x6038f){return function(_0x41f2f){if(_0x41f2f){return _0x41f2f[_0xbd64('0x1f')](_0x4d4a16)[_0xbd64('0x20')](function(_0x55e74c){return _0x55e74c;});}return null;};}function removeEntity(_0x51d118,_0x28497c){return function(_0x4afaff){if(_0x4afaff){return _0x4afaff[_0xbd64('0x21')]()['then'](function(){_0x51d118[_0xbd64('0x17')](0xcc)[_0xbd64('0x18')]();});}};}function handleEntityNotFound(_0x3d12a0,_0x2d0993){return function(_0x5ae417){if(!_0x5ae417){_0x3d12a0[_0xbd64('0x16')](0x194);}return _0x5ae417;};}function handleError(_0x3bbfbe,_0x13f527){_0x13f527=_0x13f527||0x1f4;return function(_0x2a44d0){logger['error'](_0x2a44d0['stack']);if(_0x2a44d0[_0xbd64('0x22')]){delete _0x2a44d0['name'];}_0x3bbfbe['status'](_0x13f527)[_0xbd64('0x23')](_0x2a44d0);};}exports['index']=function(_0x3cf5b7,_0x5300e8){var _0x28199c={},_0x5d8c35={},_0x1db9f3={'count':0x0,'rows':[]};var _0x3c0eaf=_[_0xbd64('0x24')](db[_0xbd64('0x25')][_0xbd64('0x26')],function(_0x207ffc){return{'name':_0x207ffc['fieldName'],'type':_0x207ffc[_0xbd64('0x27')][_0xbd64('0x28')]};});_0x5d8c35[_0xbd64('0x29')]=_[_0xbd64('0x24')](_0x3c0eaf,_0xbd64('0x22'));_0x5d8c35[_0xbd64('0x2a')]=_['keys'](_0x3cf5b7['query']);_0x5d8c35[_0xbd64('0x2b')]=_['intersection'](_0x5d8c35[_0xbd64('0x29')],_0x5d8c35[_0xbd64('0x2a')]);_0x28199c['attributes']=_['intersection'](_0x5d8c35[_0xbd64('0x29')],qs['fields'](_0x3cf5b7['query'][_0xbd64('0x2c')]));_0x28199c[_0xbd64('0x2d')]=_0x28199c[_0xbd64('0x2d')]['length']?_0x28199c[_0xbd64('0x2d')]:_0x5d8c35['model'];if(!_0x3cf5b7[_0xbd64('0x2a')][_0xbd64('0x2e')](_0xbd64('0x2f'))){_0x28199c[_0xbd64('0x30')]=qs[_0xbd64('0x30')](_0x3cf5b7[_0xbd64('0x2a')]['limit']);_0x28199c['offset']=qs[_0xbd64('0x1c')](_0x3cf5b7[_0xbd64('0x2a')][_0xbd64('0x1c')]);}_0x28199c[_0xbd64('0x31')]=qs[_0xbd64('0x32')](_0x3cf5b7[_0xbd64('0x2a')]['sort']);_0x28199c['where']=qs[_0xbd64('0x2b')](_[_0xbd64('0x33')](_0x3cf5b7[_0xbd64('0x2a')],_0x5d8c35['filters']),_0x3c0eaf);if(_0x3cf5b7['query'][_0xbd64('0x34')]){_0x28199c['where']=_[_0xbd64('0x35')](_0x28199c['where'],{'$or':_[_0xbd64('0x24')](_0x3c0eaf,function(_0x2dc00b){if(_0x2dc00b['type']!==_0xbd64('0x36')){var _0x51ae42={};_0x51ae42[_0x2dc00b['name']]={'$like':'%'+_0x3cf5b7[_0xbd64('0x2a')][_0xbd64('0x34')]+'%'};return _0x51ae42;}})});}_0x28199c=_[_0xbd64('0x35')]({},_0x28199c,_0x3cf5b7['options']);var _0x540e2a={'where':_0x28199c['where']};return db[_0xbd64('0x25')][_0xbd64('0x1b')](_0x540e2a)['then'](function(_0x393f57){_0x1db9f3[_0xbd64('0x1b')]=_0x393f57;if(_0x3cf5b7[_0xbd64('0x2a')][_0xbd64('0x37')]){_0x28199c['include']=[{'all':!![]}];}return db['FreshdeskField'][_0xbd64('0x38')](_0x28199c);})['then'](function(_0x595a91){_0x1db9f3[_0xbd64('0x39')]=_0x595a91;return _0x1db9f3;})[_0xbd64('0x20')](respondWithFilteredResult(_0x5300e8,_0x28199c))[_0xbd64('0x3a')](handleError(_0x5300e8,null));};exports[_0xbd64('0x3b')]=function(_0x693464,_0x3155b3){var _0x247775={'raw':!![],'where':{'id':_0x693464['params']['id']}},_0x762380={};_0x762380[_0xbd64('0x29')]=_[_0xbd64('0x3c')](db['FreshdeskField'][_0xbd64('0x26')]);_0x762380[_0xbd64('0x2a')]=_[_0xbd64('0x3c')](_0x693464[_0xbd64('0x2a')]);_0x762380[_0xbd64('0x2b')]=_[_0xbd64('0x3d')](_0x762380[_0xbd64('0x29')],_0x762380['query']);_0x247775[_0xbd64('0x2d')]=_['intersection'](_0x762380[_0xbd64('0x29')],qs['fields'](_0x693464[_0xbd64('0x2a')][_0xbd64('0x2c')]));_0x247775[_0xbd64('0x2d')]=_0x247775['attributes'][_0xbd64('0x3e')]?_0x247775['attributes']:_0x762380['model'];if(_0x693464['query'][_0xbd64('0x37')]){_0x247775[_0xbd64('0x3f')]=[{'all':!![]}];}_0x247775=_[_0xbd64('0x35')]({},_0x247775,_0x693464[_0xbd64('0x40')]);return db[_0xbd64('0x25')][_0xbd64('0x41')](_0x247775)[_0xbd64('0x20')](handleEntityNotFound(_0x3155b3,null))['then'](respondWithResult(_0x3155b3,null))[_0xbd64('0x3a')](handleError(_0x3155b3,null));};exports[_0xbd64('0x42')]=function(_0x379491,_0x4e5efe){return db[_0xbd64('0x25')][_0xbd64('0x42')](_0x379491[_0xbd64('0x43')],{})[_0xbd64('0x20')](respondWithResult(_0x4e5efe,0xc9))[_0xbd64('0x3a')](handleError(_0x4e5efe,null));};exports['update']=function(_0x283699,_0x1a9ec8){if(_0x283699[_0xbd64('0x43')]['id']){delete _0x283699[_0xbd64('0x43')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x283699[_0xbd64('0x44')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x1a9ec8,null))[_0xbd64('0x20')](saveUpdates(_0x283699[_0xbd64('0x43')],null))[_0xbd64('0x20')](respondWithResult(_0x1a9ec8,null))[_0xbd64('0x3a')](handleError(_0x1a9ec8,null));};exports[_0xbd64('0x21')]=function(_0x3807a7,_0x460158){return db[_0xbd64('0x25')][_0xbd64('0x41')]({'where':{'id':_0x3807a7[_0xbd64('0x44')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x460158,null))[_0xbd64('0x20')](removeEntity(_0x460158,null))[_0xbd64('0x3a')](handleError(_0x460158,null));}; \ No newline at end of file +var _0x9bde=['catch','show','params','includeAll','include','create','body','update','find','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','name','send','index','map','FreshdeskField','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','rows'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x9bde,0xe1));var _0xe9bd=function(_0x2d43f0,_0x32df39){_0x2d43f0=_0x2d43f0-0x0;var _0x566580=_0x9bde[_0x2d43f0];return _0x566580;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];function respondWithStatusCode(_0x5e022a,_0x2c1d98){_0x2c1d98=_0x2c1d98||0xcc;return function(_0x4ac319){if(_0x4ac319){return _0x5e022a[_0xe9bd('0x19')](_0x2c1d98);}return _0x5e022a[_0xe9bd('0x1a')](_0x2c1d98)[_0xe9bd('0x1b')]();};}function respondWithResult(_0x51109f,_0x47ba5e){_0x47ba5e=_0x47ba5e||0xc8;return function(_0x46a95e){if(_0x46a95e){return _0x51109f[_0xe9bd('0x1a')](_0x47ba5e)[_0xe9bd('0x1c')](_0x46a95e);}};}function respondWithFilteredResult(_0x46a59b,_0x3360bd){return function(_0x389e7b){if(_0x389e7b){var _0x45a9f2=typeof _0x3360bd['offset']===_0xe9bd('0x1d')&&typeof _0x3360bd[_0xe9bd('0x1e')]===_0xe9bd('0x1d');var _0x494b27=_0x389e7b[_0xe9bd('0x1f')];var _0x3bae08=_0x45a9f2?0x0:_0x3360bd[_0xe9bd('0x20')];var _0x330733=_0x45a9f2?_0x389e7b['count']:_0x3360bd[_0xe9bd('0x20')]+_0x3360bd['limit'];var _0xc6b661;if(_0x330733>=_0x494b27){_0x330733=_0x494b27;_0xc6b661=0xc8;}else{_0xc6b661=0xce;}_0x46a59b['status'](_0xc6b661);return _0x46a59b[_0xe9bd('0x21')](_0xe9bd('0x22'),_0x3bae08+'-'+_0x330733+'/'+_0x494b27)[_0xe9bd('0x1c')](_0x389e7b);}return null;};}function patchUpdates(_0x3dda13){return function(_0x1acb82){try{jsonpatch[_0xe9bd('0x23')](_0x1acb82,_0x3dda13,!![]);}catch(_0x6593ce){return BPromise['reject'](_0x6593ce);}return _0x1acb82[_0xe9bd('0x24')]();};}function saveUpdates(_0x28cd17,_0x4ecaf5){return function(_0x37aec1){if(_0x37aec1){return _0x37aec1['update'](_0x28cd17)[_0xe9bd('0x25')](function(_0x1b9cc9){return _0x1b9cc9;});}return null;};}function removeEntity(_0x36f8c0,_0xf02209){return function(_0x5bc4bf){if(_0x5bc4bf){return _0x5bc4bf[_0xe9bd('0x26')]()[_0xe9bd('0x25')](function(){_0x36f8c0[_0xe9bd('0x1a')](0xcc)[_0xe9bd('0x1b')]();});}};}function handleEntityNotFound(_0x2641be,_0xb52d45){return function(_0x399f3c){if(!_0x399f3c){_0x2641be[_0xe9bd('0x19')](0x194);}return _0x399f3c;};}function handleError(_0x1ae889,_0x5987af){_0x5987af=_0x5987af||0x1f4;return function(_0x3c211a){logger[_0xe9bd('0x27')](_0x3c211a['stack']);if(_0x3c211a[_0xe9bd('0x28')]){delete _0x3c211a[_0xe9bd('0x28')];}_0x1ae889[_0xe9bd('0x1a')](_0x5987af)[_0xe9bd('0x29')](_0x3c211a);};}exports[_0xe9bd('0x2a')]=function(_0x183601,_0x519f48){var _0x5b7f1d={},_0x1de54c={},_0x56e409={'count':0x0,'rows':[]};var _0xa45eb0=_[_0xe9bd('0x2b')](db[_0xe9bd('0x2c')][_0xe9bd('0x2d')],function(_0x4057df){return{'name':_0x4057df['fieldName'],'type':_0x4057df['type'][_0xe9bd('0x2e')]};});_0x1de54c[_0xe9bd('0x2f')]=_[_0xe9bd('0x2b')](_0xa45eb0,_0xe9bd('0x28'));_0x1de54c[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x183601[_0xe9bd('0x30')]);_0x1de54c[_0xe9bd('0x32')]=_[_0xe9bd('0x33')](_0x1de54c['model'],_0x1de54c[_0xe9bd('0x30')]);_0x5b7f1d[_0xe9bd('0x34')]=_[_0xe9bd('0x33')](_0x1de54c['model'],qs['fields'](_0x183601[_0xe9bd('0x30')][_0xe9bd('0x35')]));_0x5b7f1d[_0xe9bd('0x34')]=_0x5b7f1d[_0xe9bd('0x34')][_0xe9bd('0x36')]?_0x5b7f1d[_0xe9bd('0x34')]:_0x1de54c[_0xe9bd('0x2f')];if(!_0x183601[_0xe9bd('0x30')][_0xe9bd('0x37')](_0xe9bd('0x38'))){_0x5b7f1d[_0xe9bd('0x1e')]=qs[_0xe9bd('0x1e')](_0x183601[_0xe9bd('0x30')][_0xe9bd('0x1e')]);_0x5b7f1d[_0xe9bd('0x20')]=qs[_0xe9bd('0x20')](_0x183601[_0xe9bd('0x30')][_0xe9bd('0x20')]);}_0x5b7f1d['order']=qs[_0xe9bd('0x39')](_0x183601[_0xe9bd('0x30')]['sort']);_0x5b7f1d[_0xe9bd('0x3a')]=qs[_0xe9bd('0x32')](_['pick'](_0x183601['query'],_0x1de54c[_0xe9bd('0x32')]),_0xa45eb0);if(_0x183601[_0xe9bd('0x30')]['filter']){_0x5b7f1d[_0xe9bd('0x3a')]=_[_0xe9bd('0x3b')](_0x5b7f1d[_0xe9bd('0x3a')],{'$or':_['map'](_0xa45eb0,function(_0x19740b){if(_0x19740b['type']!==_0xe9bd('0x3c')){var _0x42238a={};_0x42238a[_0x19740b[_0xe9bd('0x28')]]={'$like':'%'+_0x183601[_0xe9bd('0x30')]['filter']+'%'};return _0x42238a;}})});}_0x5b7f1d=_[_0xe9bd('0x3b')]({},_0x5b7f1d,_0x183601[_0xe9bd('0x3d')]);var _0x327e1a={'where':_0x5b7f1d[_0xe9bd('0x3a')]};return db[_0xe9bd('0x2c')][_0xe9bd('0x1f')](_0x327e1a)[_0xe9bd('0x25')](function(_0xacfd19){_0x56e409[_0xe9bd('0x1f')]=_0xacfd19;if(_0x183601[_0xe9bd('0x30')]['includeAll']){_0x5b7f1d['include']=[{'all':!![]}];}return db[_0xe9bd('0x2c')]['findAll'](_0x5b7f1d);})[_0xe9bd('0x25')](function(_0x340819){_0x56e409[_0xe9bd('0x3e')]=_0x340819;return _0x56e409;})['then'](respondWithFilteredResult(_0x519f48,_0x5b7f1d))[_0xe9bd('0x3f')](handleError(_0x519f48,null));};exports[_0xe9bd('0x40')]=function(_0x1a2d94,_0x5a4460){var _0x2ef01b={'raw':!![],'where':{'id':_0x1a2d94[_0xe9bd('0x41')]['id']}},_0x3a5703={};_0x3a5703[_0xe9bd('0x2f')]=_[_0xe9bd('0x31')](db[_0xe9bd('0x2c')][_0xe9bd('0x2d')]);_0x3a5703[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x1a2d94[_0xe9bd('0x30')]);_0x3a5703[_0xe9bd('0x32')]=_[_0xe9bd('0x33')](_0x3a5703[_0xe9bd('0x2f')],_0x3a5703[_0xe9bd('0x30')]);_0x2ef01b[_0xe9bd('0x34')]=_['intersection'](_0x3a5703['model'],qs[_0xe9bd('0x35')](_0x1a2d94[_0xe9bd('0x30')][_0xe9bd('0x35')]));_0x2ef01b['attributes']=_0x2ef01b['attributes'][_0xe9bd('0x36')]?_0x2ef01b[_0xe9bd('0x34')]:_0x3a5703[_0xe9bd('0x2f')];if(_0x1a2d94[_0xe9bd('0x30')][_0xe9bd('0x42')]){_0x2ef01b[_0xe9bd('0x43')]=[{'all':!![]}];}_0x2ef01b=_[_0xe9bd('0x3b')]({},_0x2ef01b,_0x1a2d94['options']);return db[_0xe9bd('0x2c')]['find'](_0x2ef01b)[_0xe9bd('0x25')](handleEntityNotFound(_0x5a4460,null))[_0xe9bd('0x25')](respondWithResult(_0x5a4460,null))[_0xe9bd('0x3f')](handleError(_0x5a4460,null));};exports[_0xe9bd('0x44')]=function(_0x74ea23,_0x4b7b67){return db[_0xe9bd('0x2c')][_0xe9bd('0x44')](_0x74ea23[_0xe9bd('0x45')],{})['then'](respondWithResult(_0x4b7b67,0xc9))[_0xe9bd('0x3f')](handleError(_0x4b7b67,null));};exports[_0xe9bd('0x46')]=function(_0x34f787,_0x5a466b){if(_0x34f787[_0xe9bd('0x45')]['id']){delete _0x34f787[_0xe9bd('0x45')]['id'];}return db[_0xe9bd('0x2c')][_0xe9bd('0x47')]({'where':{'id':_0x34f787[_0xe9bd('0x41')]['id']}})['then'](handleEntityNotFound(_0x5a466b,null))[_0xe9bd('0x25')](saveUpdates(_0x34f787['body'],null))[_0xe9bd('0x25')](respondWithResult(_0x5a466b,null))[_0xe9bd('0x3f')](handleError(_0x5a466b,null));};exports[_0xe9bd('0x26')]=function(_0x14b06b,_0x194b7d){return db['FreshdeskField'][_0xe9bd('0x47')]({'where':{'id':_0x14b06b['params']['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x194b7d,null))[_0xe9bd('0x25')](removeEntity(_0x194b7d,null))['catch'](handleError(_0x194b7d,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index a45a249..f1d3719 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 _0x1829=['./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x42c118,_0x197006){var _0x112ebd=function(_0x337411){while(--_0x337411){_0x42c118['push'](_0x42c118['shift']());}};_0x112ebd(++_0x197006);}(_0x1829,0x13c));var _0x9182=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x1829[_0x307d86];return _0x361745;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x9182('0x0'));var moment=require(_0x9182('0x1'));var BPromise=require(_0x9182('0x2'));var rp=require(_0x9182('0x3'));var fs=require('fs');var path=require(_0x9182('0x4'));var rimraf=require(_0x9182('0x5'));var config=require('../../config/environment');var attributes=require(_0x9182('0x6'));module[_0x9182('0x7')]=function(_0x4a99e4,_0x5b4aac){return _0x4a99e4[_0x9182('0x8')](_0x9182('0x9'),attributes,{'tableName':_0x9182('0xa'),'paranoid':![],'indexes':[{'name':_0x9182('0xb'),'fields':[_0x9182('0xc'),_0x9182('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xed1c=['request-promise','path','exports','FreshdeskField','int_freshdesk_fields','idField','FieldId','lodash','util','api','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xed1c,0x7f));var _0xced1=function(_0x30bf81,_0x4c00c5){_0x30bf81=_0x30bf81-0x0;var _0x148a30=_0xed1c[_0x30bf81];return _0x148a30;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var logger=require('../../config/logger')(_0xced1('0x2'));var moment=require(_0xced1('0x3'));var BPromise=require(_0xced1('0x4'));var rp=require(_0xced1('0x5'));var fs=require('fs');var path=require(_0xced1('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshdeskField.attributes');module[_0xced1('0x7')]=function(_0x4846c3,_0x39baa1){return _0x4846c3['define'](_0xced1('0x8'),attributes,{'tableName':_0xced1('0x9'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xced1('0xa'),_0xced1('0xb')],'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 52c6c3e..15cd6c9 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 _0xbfe7=['debug','request\x20sent','error','code','message','FreshdeskField,\x20%s,\x20%s','result','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xbfe7,0xee));var _0x7bfe=function(_0x426590,_0x48f92a){_0x426590=_0x426590-0x0;var _0x7152e=_0xbfe7[_0x426590];return _0x7152e;};'use strict';var _=require(_0x7bfe('0x0'));var util=require(_0x7bfe('0x1'));var moment=require('moment');var BPromise=require(_0x7bfe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7bfe('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7bfe('0x4'));var logger=require(_0x7bfe('0x5'))(_0x7bfe('0x6'));var config=require(_0x7bfe('0x7'));var jayson=require(_0x7bfe('0x8'));var client=jayson[_0x7bfe('0x9')][_0x7bfe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x597315,_0xbdbe6a,_0xe34d35){return new BPromise(function(_0xfeebe7,_0x28add5){return client[_0x7bfe('0xb')](_0x597315,_0xe34d35)[_0x7bfe('0xc')](function(_0x3afeaf){logger[_0x7bfe('0xd')]('FreshdeskField,\x20%s,\x20%s',_0xbdbe6a,'request\x20sent');logger[_0x7bfe('0xe')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0xbdbe6a,_0x7bfe('0xf'),JSON['stringify'](_0x3afeaf));if(_0x3afeaf['error']){if(_0x3afeaf[_0x7bfe('0x10')][_0x7bfe('0x11')]===0x1f4){logger[_0x7bfe('0x10')]('FreshdeskField,\x20%s,\x20%s',_0xbdbe6a,_0x3afeaf[_0x7bfe('0x10')]['message']);return _0x28add5(_0x3afeaf[_0x7bfe('0x10')][_0x7bfe('0x12')]);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0xbdbe6a,_0x3afeaf[_0x7bfe('0x10')][_0x7bfe('0x12')]);return _0xfeebe7(_0x3afeaf[_0x7bfe('0x10')][_0x7bfe('0x12')]);}else{logger[_0x7bfe('0xd')](_0x7bfe('0x13'),_0xbdbe6a,'request\x20sent');_0xfeebe7(_0x3afeaf[_0x7bfe('0x14')][_0x7bfe('0x12')]);}})['catch'](function(_0x37a337){logger[_0x7bfe('0x10')](_0x7bfe('0x13'),_0xbdbe6a,_0x37a337);_0x28add5(_0x37a337);});});} \ No newline at end of file +var _0x883b=['../../config/environment','client','then','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4c882f,_0x804b1d){var _0x52addd=function(_0x1e1b39){while(--_0x1e1b39){_0x4c882f['push'](_0x4c882f['shift']());}};_0x52addd(++_0x804b1d);}(_0x883b,0x6a));var _0xb883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb883('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb883('0x1'));var rs=require(_0xb883('0x2'));var fs=require('fs');var Redis=require(_0xb883('0x3'));var db=require(_0xb883('0x4'))['db'];var utils=require(_0xb883('0x5'));var logger=require(_0xb883('0x6'))(_0xb883('0x7'));var config=require(_0xb883('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb883('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a8204,_0x22a89e,_0x59ea9a){return new BPromise(function(_0x5d275d,_0x599477){return client['request'](_0x3a8204,_0x59ea9a)[_0xb883('0xa')](function(_0x275cb3){logger[_0xb883('0xb')](_0xb883('0xc'),_0x22a89e,'request\x20sent');logger[_0xb883('0xd')](_0xb883('0xe'),_0x22a89e,_0xb883('0xf'),JSON['stringify'](_0x275cb3));if(_0x275cb3[_0xb883('0x10')]){if(_0x275cb3[_0xb883('0x10')][_0xb883('0x11')]===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x22a89e,_0x275cb3[_0xb883('0x10')]['message']);return _0x599477(_0x275cb3[_0xb883('0x10')]['message']);}logger[_0xb883('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x22a89e,_0x275cb3[_0xb883('0x10')]['message']);return _0x5d275d(_0x275cb3[_0xb883('0x10')][_0xb883('0x12')]);}else{logger[_0xb883('0xb')](_0xb883('0xc'),_0x22a89e,_0xb883('0xf'));_0x5d275d(_0x275cb3['result']['message']);}})['catch'](function(_0x23a395){logger['error'](_0xb883('0xc'),_0x22a89e,_0x23a395);_0x599477(_0x23a395);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index f51c7eb..e4f9841 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 _0xa5fa=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','create','addConfiguration','put','update','destroy','exports','util','path'];(function(_0x5a43d1,_0x5d39c0){var _0xcde128=function(_0x1865c6){while(--_0x1865c6){_0x5a43d1['push'](_0x5a43d1['shift']());}};_0xcde128(++_0x5d39c0);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x3906d2,_0x4b3aab){_0x3906d2=_0x3906d2-0x0;var _0x5d74c8=_0xa5fa[_0x3906d2];return _0x5d74c8;};'use strict';var multer=require('multer');var util=require(_0xaa5f('0x0'));var path=require(_0xaa5f('0x1'));var timeout=require(_0xaa5f('0x2'));var express=require(_0xaa5f('0x3'));var router=express['Router']();var fs_extra=require(_0xaa5f('0x4'));var auth=require(_0xaa5f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaa5f('0x6'));var controller=require(_0xaa5f('0x7'));router[_0xaa5f('0x8')]('/',auth[_0xaa5f('0x9')](),controller[_0xaa5f('0xa')]);router[_0xaa5f('0x8')](_0xaa5f('0xb'),auth[_0xaa5f('0x9')](),controller[_0xaa5f('0xc')]);router[_0xaa5f('0x8')](_0xaa5f('0xd'),auth['isAuthenticated'](),controller[_0xaa5f('0xe')]);router[_0xaa5f('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0xaa5f('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaa5f('0x10')]);router['post'](_0xaa5f('0xd'),auth[_0xaa5f('0x9')](),controller[_0xaa5f('0x11')]);router[_0xaa5f('0x12')](_0xaa5f('0xb'),auth['isAuthenticated'](),controller[_0xaa5f('0x13')]);router['delete'](_0xaa5f('0xb'),auth[_0xaa5f('0x9')](),controller[_0xaa5f('0x14')]);module[_0xaa5f('0x15')]=router; \ No newline at end of file +var _0xde2c=['getFields','post','/:id/configurations','addConfiguration','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields'];(function(_0x360a75,_0x1b5342){var _0x5da663=function(_0x21200e){while(--_0x21200e){_0x360a75['push'](_0x360a75['shift']());}};_0x5da663(++_0x1b5342);}(_0xde2c,0x7f));var _0xcde2=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0xde2c[_0x2283dc];return _0x16db90;};'use strict';var multer=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var path=require(_0xcde2('0x2'));var timeout=require(_0xcde2('0x3'));var express=require(_0xcde2('0x4'));var router=express[_0xcde2('0x5')]();var fs_extra=require(_0xcde2('0x6'));var auth=require(_0xcde2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xcde2('0x8'));var controller=require(_0xcde2('0x9'));router[_0xcde2('0xa')]('/',auth[_0xcde2('0xb')](),controller[_0xcde2('0xc')]);router['get'](_0xcde2('0xd'),auth[_0xcde2('0xb')](),controller[_0xcde2('0xe')]);router['get']('/:id/configurations',auth[_0xcde2('0xb')](),controller[_0xcde2('0xf')]);router['get'](_0xcde2('0x10'),auth[_0xcde2('0xb')](),controller[_0xcde2('0x11')]);router[_0xcde2('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcde2('0x12')](_0xcde2('0x13'),auth[_0xcde2('0xb')](),controller[_0xcde2('0x14')]);router[_0xcde2('0x15')](_0xcde2('0xd'),auth['isAuthenticated'](),controller[_0xcde2('0x16')]);router['delete'](_0xcde2('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xcde2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 6a560f6..b2c0c70 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 _0xb78e=['username','remoteUri','sequelize','exports','STRING'];(function(_0xcd0918,_0x56bdf9){var _0x250704=function(_0x56788e){while(--_0x56788e){_0xcd0918['push'](_0xcd0918['shift']());}};_0x250704(++_0x56bdf9);}(_0xb78e,0x1c9));var _0xeb78=function(_0xa21476,_0x272241){_0xa21476=_0xa21476-0x0;var _0x26310d=_0xb78e[_0xa21476];return _0x26310d;};'use strict';var Sequelize=require(_0xeb78('0x0'));module[_0xeb78('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xeb78('0x2')]},'username':{'type':Sequelize[_0xeb78('0x2')],'unique':_0xeb78('0x3')},'apiKey':{'type':Sequelize[_0xeb78('0x2')]},'remoteUri':{'type':Sequelize[_0xeb78('0x2')],'unique':_0xeb78('0x4')},'serverUrl':{'type':Sequelize[_0xeb78('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x583c=['exports','STRING','username','sequelize'];(function(_0x164ca4,_0x916bae){var _0xebc2b8=function(_0x2ee97c){while(--_0x2ee97c){_0x164ca4['push'](_0x164ca4['shift']());}};_0xebc2b8(++_0x916bae);}(_0x583c,0x12b));var _0xc583=function(_0x26b622,_0x237e9e){_0x26b622=_0x26b622-0x0;var _0x58a028=_0x583c[_0x26b622];return _0x58a028;};'use strict';var Sequelize=require(_0xc583('0x0'));module[_0xc583('0x1')]={'name':{'type':Sequelize[_0xc583('0x2')]},'description':{'type':Sequelize[_0xc583('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xc583('0x3')},'apiKey':{'type':Sequelize[_0xc583('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xc583('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 05d6f94..b9682d6 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 _0xa607=['lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','FreshsalesAccount','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','find','catch','create','body','FreshsalesConfiguration','order','getConfigurations','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','getFields','username','remoteUri','substring'];(function(_0x2a6750,_0x15d791){var _0x33cb9a=function(_0x44426c){while(--_0x44426c){_0x2a6750['push'](_0x2a6750['shift']());}};_0x33cb9a(++_0x15d791);}(_0xa607,0x14a));var _0x7a60=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0xa607[_0x4e6ae6];return _0x23c108;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7a60('0x0'));var zipdir=require(_0x7a60('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7a60('0x2'));var BPromise=require(_0x7a60('0x3'));var Mustache=require(_0x7a60('0x4'));var util=require('util');var path=require(_0x7a60('0x5'));var sox=require(_0x7a60('0x6'));var csv=require(_0x7a60('0x7'));var ejs=require(_0x7a60('0x8'));var fs=require('fs');var fs_extra=require(_0x7a60('0x9'));var _=require(_0x7a60('0xa'));var squel=require('squel');var crypto=require(_0x7a60('0xb'));var jsforce=require(_0x7a60('0xc'));var deskjs=require(_0x7a60('0xd'));var toCsv=require(_0x7a60('0x7'));var querystring=require(_0x7a60('0xe'));var Papa=require(_0x7a60('0xf'));var Redis=require(_0x7a60('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7a60('0x11'));var as=require(_0x7a60('0x12'));var hardwareService=require(_0x7a60('0x13'));var logger=require(_0x7a60('0x14'))('api');var utils=require(_0x7a60('0x15'));var config=require(_0x7a60('0x16'));var licenseUtil=require(_0x7a60('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x7a60('0x18'));function respondWithStatusCode(_0x3f840b,_0x2ed501){_0x2ed501=_0x2ed501||0xcc;return function(_0xeb4c2){if(_0xeb4c2){return _0x3f840b[_0x7a60('0x19')](_0x2ed501);}return _0x3f840b[_0x7a60('0x1a')](_0x2ed501)[_0x7a60('0x1b')]();};}function respondWithResult(_0x48b0bf,_0x4fd639){_0x4fd639=_0x4fd639||0xc8;return function(_0x3513fa){if(_0x3513fa){return _0x48b0bf[_0x7a60('0x1a')](_0x4fd639)[_0x7a60('0x1c')](_0x3513fa);}};}function respondWithFilteredResult(_0x194b5f,_0x5a4739){return function(_0xa52f83){if(_0xa52f83){var _0x5e987a=typeof _0x5a4739[_0x7a60('0x1d')]===_0x7a60('0x1e')&&typeof _0x5a4739[_0x7a60('0x1f')]==='undefined';var _0x5973d8=_0xa52f83[_0x7a60('0x20')];var _0x18d4d3=_0x5e987a?0x0:_0x5a4739[_0x7a60('0x1d')];var _0x53dc4b=_0x5e987a?_0xa52f83[_0x7a60('0x20')]:_0x5a4739['offset']+_0x5a4739[_0x7a60('0x1f')];var _0x455d07;if(_0x53dc4b>=_0x5973d8){_0x53dc4b=_0x5973d8;_0x455d07=0xc8;}else{_0x455d07=0xce;}_0x194b5f['status'](_0x455d07);return _0x194b5f[_0x7a60('0x21')](_0x7a60('0x22'),_0x18d4d3+'-'+_0x53dc4b+'/'+_0x5973d8)[_0x7a60('0x1c')](_0xa52f83);}return null;};}function patchUpdates(_0x1ed0d7){return function(_0x2bef2a){try{jsonpatch[_0x7a60('0x23')](_0x2bef2a,_0x1ed0d7,!![]);}catch(_0x5d5160){return BPromise[_0x7a60('0x24')](_0x5d5160);}return _0x2bef2a['save']();};}function saveUpdates(_0x414e4f,_0xe68623){return function(_0x43afa4){if(_0x43afa4){return _0x43afa4[_0x7a60('0x25')](_0x414e4f)[_0x7a60('0x26')](function(_0x1f7188){return _0x1f7188;});}return null;};}function removeEntity(_0x18275c,_0x2ebfeb){return function(_0x167467){if(_0x167467){return _0x167467[_0x7a60('0x27')]()[_0x7a60('0x26')](function(){_0x18275c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c2683,_0x230f97){return function(_0x2609c6){if(!_0x2609c6){_0x4c2683[_0x7a60('0x19')](0x194);}return _0x2609c6;};}function handleError(_0x57c49c,_0x11db22){_0x11db22=_0x11db22||0x1f4;return function(_0x5ab505){logger[_0x7a60('0x28')](_0x5ab505[_0x7a60('0x29')]);if(_0x5ab505[_0x7a60('0x2a')]){delete _0x5ab505[_0x7a60('0x2a')];}_0x57c49c[_0x7a60('0x1a')](_0x11db22)[_0x7a60('0x2b')](_0x5ab505);};}exports[_0x7a60('0x2c')]=function(_0x17297b,_0x1bbe2a){var _0x54c8de={},_0x44f552={},_0x3957a4={'count':0x0,'rows':[]};var _0x5defa0=_['map'](db[_0x7a60('0x2d')][_0x7a60('0x2e')],function(_0x56a367){return{'name':_0x56a367['fieldName'],'type':_0x56a367['type'][_0x7a60('0x2f')]};});_0x44f552[_0x7a60('0x30')]=_[_0x7a60('0x31')](_0x5defa0,'name');_0x44f552[_0x7a60('0x32')]=_[_0x7a60('0x33')](_0x17297b[_0x7a60('0x32')]);_0x44f552[_0x7a60('0x34')]=_[_0x7a60('0x35')](_0x44f552[_0x7a60('0x30')],_0x44f552[_0x7a60('0x32')]);_0x54c8de[_0x7a60('0x36')]=_['intersection'](_0x44f552['model'],qs[_0x7a60('0x37')](_0x17297b[_0x7a60('0x32')][_0x7a60('0x37')]));_0x54c8de['attributes']=_0x54c8de[_0x7a60('0x36')][_0x7a60('0x38')]?_0x54c8de[_0x7a60('0x36')]:_0x44f552[_0x7a60('0x30')];if(!_0x17297b[_0x7a60('0x32')][_0x7a60('0x39')](_0x7a60('0x3a'))){_0x54c8de[_0x7a60('0x1f')]=qs[_0x7a60('0x1f')](_0x17297b['query']['limit']);_0x54c8de[_0x7a60('0x1d')]=qs['offset'](_0x17297b[_0x7a60('0x32')][_0x7a60('0x1d')]);}_0x54c8de['order']=qs[_0x7a60('0x3b')](_0x17297b[_0x7a60('0x32')][_0x7a60('0x3b')]);_0x54c8de[_0x7a60('0x3c')]=qs[_0x7a60('0x34')](_[_0x7a60('0x3d')](_0x17297b[_0x7a60('0x32')],_0x44f552[_0x7a60('0x34')]),_0x5defa0);if(_0x17297b[_0x7a60('0x32')][_0x7a60('0x3e')]){_0x54c8de[_0x7a60('0x3c')]=_[_0x7a60('0x3f')](_0x54c8de['where'],{'$or':_[_0x7a60('0x31')](_0x5defa0,function(_0xa5de2f){if(_0xa5de2f[_0x7a60('0x40')]!==_0x7a60('0x41')){var _0x6ff1a7={};_0x6ff1a7[_0xa5de2f[_0x7a60('0x2a')]]={'$like':'%'+_0x17297b[_0x7a60('0x32')][_0x7a60('0x3e')]+'%'};return _0x6ff1a7;}})});}_0x54c8de=_[_0x7a60('0x3f')]({},_0x54c8de,_0x17297b[_0x7a60('0x42')]);var _0x291d8c={'where':_0x54c8de['where']};return db['FreshsalesAccount'][_0x7a60('0x20')](_0x291d8c)[_0x7a60('0x26')](function(_0x3d4759){_0x3957a4['count']=_0x3d4759;if(_0x17297b[_0x7a60('0x32')][_0x7a60('0x43')]){_0x54c8de['include']=[{'all':!![]}];}return db[_0x7a60('0x2d')][_0x7a60('0x44')](_0x54c8de);})[_0x7a60('0x26')](function(_0x2eabb1){_0x3957a4[_0x7a60('0x45')]=_0x2eabb1;return _0x3957a4;})[_0x7a60('0x26')](respondWithFilteredResult(_0x1bbe2a,_0x54c8de))['catch'](handleError(_0x1bbe2a,null));};exports[_0x7a60('0x46')]=function(_0x3bfc18,_0x10de51){var _0xecf508={'raw':![],'where':{'id':_0x3bfc18[_0x7a60('0x47')]['id']}},_0x5c2900={};_0x5c2900[_0x7a60('0x30')]=_[_0x7a60('0x33')](db['FreshsalesAccount'][_0x7a60('0x2e')]);_0x5c2900['query']=_[_0x7a60('0x33')](_0x3bfc18[_0x7a60('0x32')]);_0x5c2900[_0x7a60('0x34')]=_['intersection'](_0x5c2900[_0x7a60('0x30')],_0x5c2900[_0x7a60('0x32')]);_0xecf508['attributes']=_[_0x7a60('0x35')](_0x5c2900[_0x7a60('0x30')],qs['fields'](_0x3bfc18[_0x7a60('0x32')][_0x7a60('0x37')]));_0xecf508[_0x7a60('0x36')]=_0xecf508['attributes']['length']?_0xecf508[_0x7a60('0x36')]:_0x5c2900['model'];if(_0x3bfc18[_0x7a60('0x32')]['includeAll']){_0xecf508['include']=[{'all':!![]}];}_0xecf508=_['merge']({},_0xecf508,_0x3bfc18[_0x7a60('0x42')]);return db[_0x7a60('0x2d')][_0x7a60('0x48')](_0xecf508)[_0x7a60('0x26')](handleEntityNotFound(_0x10de51,null))['then'](respondWithResult(_0x10de51,null))[_0x7a60('0x49')](handleError(_0x10de51,null));};exports[_0x7a60('0x4a')]=function(_0x270328,_0x3649ea){return db[_0x7a60('0x2d')]['create'](_0x270328[_0x7a60('0x4b')],{})['then'](respondWithResult(_0x3649ea,0xc9))['catch'](handleError(_0x3649ea,null));};exports['update']=function(_0x1a1947,_0x2f5875){if(_0x1a1947[_0x7a60('0x4b')]['id']){delete _0x1a1947[_0x7a60('0x4b')]['id'];}return db[_0x7a60('0x2d')][_0x7a60('0x48')]({'where':{'id':_0x1a1947[_0x7a60('0x47')]['id']}})[_0x7a60('0x26')](handleEntityNotFound(_0x2f5875,null))[_0x7a60('0x26')](saveUpdates(_0x1a1947[_0x7a60('0x4b')],null))[_0x7a60('0x26')](respondWithResult(_0x2f5875,null))[_0x7a60('0x49')](handleError(_0x2f5875,null));};exports[_0x7a60('0x27')]=function(_0x19023a,_0x37e863){return db[_0x7a60('0x2d')]['find']({'where':{'id':_0x19023a[_0x7a60('0x47')]['id']}})['then'](handleEntityNotFound(_0x37e863,null))['then'](removeEntity(_0x37e863,null))[_0x7a60('0x49')](handleError(_0x37e863,null));};exports['getConfigurations']=function(_0x503be5,_0x52b1f3,_0x23b4e6){var _0x1230e9={};var _0x1f550d={};var _0x14b085;var _0x314fc1;return db[_0x7a60('0x2d')]['findOne']({'where':{'id':_0x503be5[_0x7a60('0x47')]['id']}})[_0x7a60('0x26')](handleEntityNotFound(_0x52b1f3,null))['then'](function(_0x48ee81){if(_0x48ee81){_0x14b085=_0x48ee81;_0x1f550d['model']=_[_0x7a60('0x33')](db[_0x7a60('0x4c')][_0x7a60('0x2e')]);_0x1f550d[_0x7a60('0x32')]=_[_0x7a60('0x33')](_0x503be5['query']);_0x1f550d[_0x7a60('0x34')]=_[_0x7a60('0x35')](_0x1f550d['model'],_0x1f550d[_0x7a60('0x32')]);_0x1230e9[_0x7a60('0x36')]=_[_0x7a60('0x35')](_0x1f550d[_0x7a60('0x30')],qs[_0x7a60('0x37')](_0x503be5['query'][_0x7a60('0x37')]));_0x1230e9['attributes']=_0x1230e9[_0x7a60('0x36')][_0x7a60('0x38')]?_0x1230e9[_0x7a60('0x36')]:_0x1f550d[_0x7a60('0x30')];_0x1230e9[_0x7a60('0x4d')]=qs[_0x7a60('0x3b')](_0x503be5[_0x7a60('0x32')][_0x7a60('0x3b')]);_0x1230e9[_0x7a60('0x3c')]=qs[_0x7a60('0x34')](_[_0x7a60('0x3d')](_0x503be5[_0x7a60('0x32')],_0x1f550d[_0x7a60('0x34')]));if(_0x503be5[_0x7a60('0x32')]['filter']){_0x1230e9[_0x7a60('0x3c')]=_[_0x7a60('0x3f')](_0x1230e9[_0x7a60('0x3c')],{'$or':_[_0x7a60('0x31')](_0x1230e9[_0x7a60('0x36')],function(_0x35e282){var _0x5af32f={};_0x5af32f[_0x35e282]={'$like':'%'+_0x503be5[_0x7a60('0x32')][_0x7a60('0x3e')]+'%'};return _0x5af32f;})});}_0x1230e9=_['merge']({},_0x1230e9,_0x503be5[_0x7a60('0x42')]);return _0x14b085[_0x7a60('0x4e')](_0x1230e9);}})['then'](function(_0x2fa0fd){if(_0x2fa0fd){_0x314fc1=_0x2fa0fd['length'];if(!_0x503be5[_0x7a60('0x32')][_0x7a60('0x39')](_0x7a60('0x3a'))){_0x1230e9[_0x7a60('0x1f')]=qs['limit'](_0x503be5[_0x7a60('0x32')]['limit']);_0x1230e9['offset']=qs[_0x7a60('0x1d')](_0x503be5['query']['offset']);}return _0x14b085[_0x7a60('0x4e')](_0x1230e9);}})[_0x7a60('0x26')](function(_0x480a6d){if(_0x480a6d){return _0x480a6d?{'count':_0x314fc1,'rows':_0x480a6d}:null;}})[_0x7a60('0x26')](respondWithResult(_0x52b1f3,null))[_0x7a60('0x49')](handleError(_0x52b1f3,null));};exports['addConfiguration']=function(_0x375607,_0x3d21c4,_0x1de317){if(_0x375607[_0x7a60('0x4b')]['id']){delete _0x375607['body']['id'];}return db[_0x7a60('0x2d')][_0x7a60('0x4f')]({'where':{'id':_0x375607[_0x7a60('0x47')]['id']}})[_0x7a60('0x26')](handleEntityNotFound(_0x3d21c4,null))[_0x7a60('0x26')](function(_0x15ceaa){if(_0x15ceaa){_0x375607[_0x7a60('0x4b')][_0x7a60('0x50')]=_0x15ceaa['id'];_0x375607[_0x7a60('0x4b')]['Subjects']=integrations[_0x7a60('0x51')](_0x375607['body'][_0x7a60('0x52')],_0x375607[_0x7a60('0x4b')][_0x7a60('0x40')]);_0x375607[_0x7a60('0x4b')][_0x7a60('0x53')]=integrations[_0x7a60('0x54')](_0x375607[_0x7a60('0x4b')][_0x7a60('0x52')],_0x375607[_0x7a60('0x4b')][_0x7a60('0x40')]);return db[_0x7a60('0x4c')]['create'](_0x375607['body'],{'include':[{'model':db['FreshsalesField'],'as':_0x7a60('0x55')},{'model':db['FreshsalesField'],'as':_0x7a60('0x53')}]});}return null;})[_0x7a60('0x26')](respondWithResult(_0x3d21c4,null))[_0x7a60('0x49')](handleError(_0x3d21c4,null));};exports[_0x7a60('0x56')]=function(_0x243dfd,_0x39a540,_0x44c318){var _0x577424='';var _0x18a4e6='';return db['FreshsalesAccount'][_0x7a60('0x4f')]({'where':{'id':_0x243dfd[_0x7a60('0x47')]['id']},'attributes':['id',_0x7a60('0x57'),'remoteUri','apiKey']})['then'](handleEntityNotFound(_0x39a540,null))[_0x7a60('0x26')](function(_0x194efd){if(_0x194efd){_0x18a4e6=_0x194efd['username'];_0x577424=_0x194efd[_0x7a60('0x58')];var _0x1cea87=_0x194efd['remoteUri']['slice'](-0x1);if(_0x1cea87==='/'){_0x577424=_0x577424[_0x7a60('0x59')](0x0,_0x577424[_0x7a60('0x5a')](_0x1cea87));}return rp({'method':_0x7a60('0x5b'),'uri':util[_0x7a60('0x5c')](_0x7a60('0x5d'),_0x577424,_0x7a60('0x5e')),'headers':{'Authorization':_0x7a60('0x5f')+_0x194efd[_0x7a60('0x60')]},'json':!![]});}})[_0x7a60('0x26')](function(_0x12babd){if(_0x12babd){var _0x20f358=_0x12babd[_0x7a60('0x61')];var _0x4f5583=![];var _0x1d12b8=null;for(_0x1d12b8=0x0;_0x1d12b8<_0x20f358[_0x7a60('0x38')];_0x1d12b8++){if(_0x20f358[_0x1d12b8][_0x7a60('0x62')]===_0x18a4e6){_0x4f5583=!![];}}if(_0x4f5583){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x7a60('0x63')});}}})[_0x7a60('0x26')](respondWithResult(_0x39a540,null))[_0x7a60('0x49')](function(_0x4e5f77){var _0x252399=_0x243dfd['query'][_0x7a60('0x64')]?0x1f4:_0x4e5f77['statusCode']||0x1f4;logger[_0x7a60('0x28')](_0x7a60('0x65'),_0x7a60('0x56'),_0x252399,JSON[_0x7a60('0x66')](_0x4e5f77));delete _0x4e5f77['name'];if(_0x252399===0x191){_0x252399=0x190;}_0x39a540[_0x7a60('0x1a')](_0x252399)[_0x7a60('0x2b')](_0x243dfd[_0x7a60('0x32')][_0x7a60('0x64')]?{'message':_0x7a60('0x67'),'statusCode':_0x4e5f77[_0x7a60('0x68')]}:_0x4e5f77);});}; \ No newline at end of file +var _0x2a73=['zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','map','FreshsalesAccount','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','find','create','body','destroy','getConfigurations','findOne','FreshsalesConfiguration','options','addConfiguration','AccountId','getSubjects','getDescriptions','FreshsalesField','Subjects','Descriptions','getFields','username','remoteUri','apiKey','slice','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf'];(function(_0x49392e,_0x441b28){var _0xe978bb=function(_0x4404d1){while(--_0x4404d1){_0x49392e['push'](_0x49392e['shift']());}};_0xe978bb(++_0x441b28);}(_0x2a73,0x68));var _0x32a7=function(_0x1b14cf,_0x2abf37){_0x1b14cf=_0x1b14cf-0x0;var _0x562a94=_0x2a73[_0x1b14cf];return _0x562a94;};'use strict';var emlformat=require(_0x32a7('0x0'));var rimraf=require(_0x32a7('0x1'));var zipdir=require(_0x32a7('0x2'));var jsonpatch=require(_0x32a7('0x3'));var rp=require(_0x32a7('0x4'));var moment=require(_0x32a7('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x32a7('0x6'));var path=require(_0x32a7('0x7'));var sox=require('sox');var csv=require(_0x32a7('0x8'));var ejs=require(_0x32a7('0x9'));var fs=require('fs');var fs_extra=require(_0x32a7('0xa'));var _=require(_0x32a7('0xb'));var squel=require(_0x32a7('0xc'));var crypto=require(_0x32a7('0xd'));var jsforce=require(_0x32a7('0xe'));var deskjs=require(_0x32a7('0xf'));var toCsv=require(_0x32a7('0x8'));var querystring=require(_0x32a7('0x10'));var Papa=require(_0x32a7('0x11'));var Redis=require(_0x32a7('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x32a7('0x13'));var hardwareService=require(_0x32a7('0x14'));var logger=require(_0x32a7('0x15'))(_0x32a7('0x16'));var utils=require(_0x32a7('0x17'));var config=require(_0x32a7('0x18'));var licenseUtil=require(_0x32a7('0x19'));var db=require(_0x32a7('0x1a'))['db'];var integrations=require(_0x32a7('0x1b'));function respondWithStatusCode(_0x3a9ecd,_0x2d9b4b){_0x2d9b4b=_0x2d9b4b||0xcc;return function(_0x20f5d4){if(_0x20f5d4){return _0x3a9ecd['sendStatus'](_0x2d9b4b);}return _0x3a9ecd[_0x32a7('0x1c')](_0x2d9b4b)[_0x32a7('0x1d')]();};}function respondWithResult(_0xbb2b2b,_0x34a249){_0x34a249=_0x34a249||0xc8;return function(_0x528da8){if(_0x528da8){return _0xbb2b2b[_0x32a7('0x1c')](_0x34a249)['json'](_0x528da8);}};}function respondWithFilteredResult(_0x41b549,_0x24c862){return function(_0x57209f){if(_0x57209f){var _0x3866cf=typeof _0x24c862[_0x32a7('0x1e')]==='undefined'&&typeof _0x24c862[_0x32a7('0x1f')]==='undefined';var _0x1fb213=_0x57209f[_0x32a7('0x20')];var _0x503659=_0x3866cf?0x0:_0x24c862['offset'];var _0x20e2fa=_0x3866cf?_0x57209f[_0x32a7('0x20')]:_0x24c862[_0x32a7('0x1e')]+_0x24c862['limit'];var _0x1be23d;if(_0x20e2fa>=_0x1fb213){_0x20e2fa=_0x1fb213;_0x1be23d=0xc8;}else{_0x1be23d=0xce;}_0x41b549[_0x32a7('0x1c')](_0x1be23d);return _0x41b549[_0x32a7('0x21')](_0x32a7('0x22'),_0x503659+'-'+_0x20e2fa+'/'+_0x1fb213)[_0x32a7('0x23')](_0x57209f);}return null;};}function patchUpdates(_0x5f40fa){return function(_0x506b68){try{jsonpatch[_0x32a7('0x24')](_0x506b68,_0x5f40fa,!![]);}catch(_0x3fc66a){return BPromise[_0x32a7('0x25')](_0x3fc66a);}return _0x506b68[_0x32a7('0x26')]();};}function saveUpdates(_0x3b795f,_0x46cd93){return function(_0x11bae6){if(_0x11bae6){return _0x11bae6[_0x32a7('0x27')](_0x3b795f)[_0x32a7('0x28')](function(_0x5b8c7d){return _0x5b8c7d;});}return null;};}function removeEntity(_0x879a67,_0x2cc6e4){return function(_0x5d552a){if(_0x5d552a){return _0x5d552a['destroy']()[_0x32a7('0x28')](function(){_0x879a67[_0x32a7('0x1c')](0xcc)[_0x32a7('0x1d')]();});}};}function handleEntityNotFound(_0x37cae4,_0x26308b){return function(_0x34d986){if(!_0x34d986){_0x37cae4['sendStatus'](0x194);}return _0x34d986;};}function handleError(_0x48cb42,_0x400ec0){_0x400ec0=_0x400ec0||0x1f4;return function(_0x43b092){logger[_0x32a7('0x29')](_0x43b092[_0x32a7('0x2a')]);if(_0x43b092[_0x32a7('0x2b')]){delete _0x43b092['name'];}_0x48cb42[_0x32a7('0x1c')](_0x400ec0)['send'](_0x43b092);};}exports[_0x32a7('0x2c')]=function(_0x26b16c,_0x5a8dd2){var _0x44810f={},_0x4ae02a={},_0x50d813={'count':0x0,'rows':[]};var _0x4333ca=_[_0x32a7('0x2d')](db[_0x32a7('0x2e')][_0x32a7('0x2f')],function(_0x1ddb6f){return{'name':_0x1ddb6f[_0x32a7('0x30')],'type':_0x1ddb6f[_0x32a7('0x31')]['key']};});_0x4ae02a[_0x32a7('0x32')]=_['map'](_0x4333ca,_0x32a7('0x2b'));_0x4ae02a['query']=_[_0x32a7('0x33')](_0x26b16c[_0x32a7('0x34')]);_0x4ae02a[_0x32a7('0x35')]=_[_0x32a7('0x36')](_0x4ae02a[_0x32a7('0x32')],_0x4ae02a[_0x32a7('0x34')]);_0x44810f[_0x32a7('0x37')]=_[_0x32a7('0x36')](_0x4ae02a[_0x32a7('0x32')],qs['fields'](_0x26b16c[_0x32a7('0x34')][_0x32a7('0x38')]));_0x44810f[_0x32a7('0x37')]=_0x44810f[_0x32a7('0x37')][_0x32a7('0x39')]?_0x44810f[_0x32a7('0x37')]:_0x4ae02a['model'];if(!_0x26b16c['query'][_0x32a7('0x3a')](_0x32a7('0x3b'))){_0x44810f[_0x32a7('0x1f')]=qs['limit'](_0x26b16c[_0x32a7('0x34')][_0x32a7('0x1f')]);_0x44810f[_0x32a7('0x1e')]=qs[_0x32a7('0x1e')](_0x26b16c[_0x32a7('0x34')][_0x32a7('0x1e')]);}_0x44810f[_0x32a7('0x3c')]=qs[_0x32a7('0x3d')](_0x26b16c['query'][_0x32a7('0x3d')]);_0x44810f[_0x32a7('0x3e')]=qs[_0x32a7('0x35')](_[_0x32a7('0x3f')](_0x26b16c[_0x32a7('0x34')],_0x4ae02a[_0x32a7('0x35')]),_0x4333ca);if(_0x26b16c[_0x32a7('0x34')][_0x32a7('0x40')]){_0x44810f[_0x32a7('0x3e')]=_[_0x32a7('0x41')](_0x44810f[_0x32a7('0x3e')],{'$or':_[_0x32a7('0x2d')](_0x4333ca,function(_0x21053d){if(_0x21053d['type']!==_0x32a7('0x42')){var _0x3ec5e9={};_0x3ec5e9[_0x21053d['name']]={'$like':'%'+_0x26b16c[_0x32a7('0x34')][_0x32a7('0x40')]+'%'};return _0x3ec5e9;}})});}_0x44810f=_[_0x32a7('0x41')]({},_0x44810f,_0x26b16c['options']);var _0xd9a958={'where':_0x44810f[_0x32a7('0x3e')]};return db['FreshsalesAccount']['count'](_0xd9a958)['then'](function(_0x51678e){_0x50d813[_0x32a7('0x20')]=_0x51678e;if(_0x26b16c[_0x32a7('0x34')][_0x32a7('0x43')]){_0x44810f[_0x32a7('0x44')]=[{'all':!![]}];}return db[_0x32a7('0x2e')][_0x32a7('0x45')](_0x44810f);})[_0x32a7('0x28')](function(_0x43c466){_0x50d813['rows']=_0x43c466;return _0x50d813;})[_0x32a7('0x28')](respondWithFilteredResult(_0x5a8dd2,_0x44810f))[_0x32a7('0x46')](handleError(_0x5a8dd2,null));};exports[_0x32a7('0x47')]=function(_0x661c9b,_0x5df50d){var _0x423bfb={'raw':![],'where':{'id':_0x661c9b[_0x32a7('0x48')]['id']}},_0x66eeab={};_0x66eeab[_0x32a7('0x32')]=_['keys'](db[_0x32a7('0x2e')]['rawAttributes']);_0x66eeab[_0x32a7('0x34')]=_[_0x32a7('0x33')](_0x661c9b[_0x32a7('0x34')]);_0x66eeab[_0x32a7('0x35')]=_[_0x32a7('0x36')](_0x66eeab['model'],_0x66eeab[_0x32a7('0x34')]);_0x423bfb[_0x32a7('0x37')]=_[_0x32a7('0x36')](_0x66eeab[_0x32a7('0x32')],qs[_0x32a7('0x38')](_0x661c9b[_0x32a7('0x34')][_0x32a7('0x38')]));_0x423bfb['attributes']=_0x423bfb[_0x32a7('0x37')]['length']?_0x423bfb[_0x32a7('0x37')]:_0x66eeab['model'];if(_0x661c9b[_0x32a7('0x34')][_0x32a7('0x43')]){_0x423bfb[_0x32a7('0x44')]=[{'all':!![]}];}_0x423bfb=_[_0x32a7('0x41')]({},_0x423bfb,_0x661c9b['options']);return db[_0x32a7('0x2e')][_0x32a7('0x49')](_0x423bfb)[_0x32a7('0x28')](handleEntityNotFound(_0x5df50d,null))[_0x32a7('0x28')](respondWithResult(_0x5df50d,null))[_0x32a7('0x46')](handleError(_0x5df50d,null));};exports[_0x32a7('0x4a')]=function(_0x42b24d,_0x1a54ab){return db['FreshsalesAccount'][_0x32a7('0x4a')](_0x42b24d['body'],{})['then'](respondWithResult(_0x1a54ab,0xc9))[_0x32a7('0x46')](handleError(_0x1a54ab,null));};exports[_0x32a7('0x27')]=function(_0x20b545,_0xa97b){if(_0x20b545[_0x32a7('0x4b')]['id']){delete _0x20b545[_0x32a7('0x4b')]['id'];}return db[_0x32a7('0x2e')][_0x32a7('0x49')]({'where':{'id':_0x20b545[_0x32a7('0x48')]['id']}})[_0x32a7('0x28')](handleEntityNotFound(_0xa97b,null))['then'](saveUpdates(_0x20b545['body'],null))['then'](respondWithResult(_0xa97b,null))[_0x32a7('0x46')](handleError(_0xa97b,null));};exports[_0x32a7('0x4c')]=function(_0x22ebfb,_0xad8fea){return db[_0x32a7('0x2e')][_0x32a7('0x49')]({'where':{'id':_0x22ebfb['params']['id']}})[_0x32a7('0x28')](handleEntityNotFound(_0xad8fea,null))[_0x32a7('0x28')](removeEntity(_0xad8fea,null))['catch'](handleError(_0xad8fea,null));};exports[_0x32a7('0x4d')]=function(_0x3dfd65,_0x3ec362,_0x4202b1){var _0x5f2ee1={};var _0x1fd0ad={};var _0x3e3c20;var _0x18a2d7;return db[_0x32a7('0x2e')][_0x32a7('0x4e')]({'where':{'id':_0x3dfd65[_0x32a7('0x48')]['id']}})[_0x32a7('0x28')](handleEntityNotFound(_0x3ec362,null))['then'](function(_0x30ef09){if(_0x30ef09){_0x3e3c20=_0x30ef09;_0x1fd0ad[_0x32a7('0x32')]=_[_0x32a7('0x33')](db[_0x32a7('0x4f')]['rawAttributes']);_0x1fd0ad[_0x32a7('0x34')]=_[_0x32a7('0x33')](_0x3dfd65[_0x32a7('0x34')]);_0x1fd0ad[_0x32a7('0x35')]=_[_0x32a7('0x36')](_0x1fd0ad[_0x32a7('0x32')],_0x1fd0ad[_0x32a7('0x34')]);_0x5f2ee1[_0x32a7('0x37')]=_[_0x32a7('0x36')](_0x1fd0ad[_0x32a7('0x32')],qs[_0x32a7('0x38')](_0x3dfd65[_0x32a7('0x34')][_0x32a7('0x38')]));_0x5f2ee1[_0x32a7('0x37')]=_0x5f2ee1['attributes'][_0x32a7('0x39')]?_0x5f2ee1[_0x32a7('0x37')]:_0x1fd0ad['model'];_0x5f2ee1['order']=qs[_0x32a7('0x3d')](_0x3dfd65[_0x32a7('0x34')][_0x32a7('0x3d')]);_0x5f2ee1[_0x32a7('0x3e')]=qs[_0x32a7('0x35')](_[_0x32a7('0x3f')](_0x3dfd65[_0x32a7('0x34')],_0x1fd0ad['filters']));if(_0x3dfd65[_0x32a7('0x34')][_0x32a7('0x40')]){_0x5f2ee1[_0x32a7('0x3e')]=_[_0x32a7('0x41')](_0x5f2ee1[_0x32a7('0x3e')],{'$or':_[_0x32a7('0x2d')](_0x5f2ee1[_0x32a7('0x37')],function(_0x359511){var _0x120406={};_0x120406[_0x359511]={'$like':'%'+_0x3dfd65['query'][_0x32a7('0x40')]+'%'};return _0x120406;})});}_0x5f2ee1=_[_0x32a7('0x41')]({},_0x5f2ee1,_0x3dfd65[_0x32a7('0x50')]);return _0x3e3c20[_0x32a7('0x4d')](_0x5f2ee1);}})[_0x32a7('0x28')](function(_0x8975f4){if(_0x8975f4){_0x18a2d7=_0x8975f4[_0x32a7('0x39')];if(!_0x3dfd65[_0x32a7('0x34')][_0x32a7('0x3a')](_0x32a7('0x3b'))){_0x5f2ee1[_0x32a7('0x1f')]=qs[_0x32a7('0x1f')](_0x3dfd65[_0x32a7('0x34')][_0x32a7('0x1f')]);_0x5f2ee1[_0x32a7('0x1e')]=qs['offset'](_0x3dfd65[_0x32a7('0x34')][_0x32a7('0x1e')]);}return _0x3e3c20['getConfigurations'](_0x5f2ee1);}})[_0x32a7('0x28')](function(_0x2ea5b6){if(_0x2ea5b6){return _0x2ea5b6?{'count':_0x18a2d7,'rows':_0x2ea5b6}:null;}})[_0x32a7('0x28')](respondWithResult(_0x3ec362,null))['catch'](handleError(_0x3ec362,null));};exports[_0x32a7('0x51')]=function(_0x29457e,_0x404016,_0x16d290){if(_0x29457e['body']['id']){delete _0x29457e[_0x32a7('0x4b')]['id'];}return db['FreshsalesAccount'][_0x32a7('0x4e')]({'where':{'id':_0x29457e[_0x32a7('0x48')]['id']}})[_0x32a7('0x28')](handleEntityNotFound(_0x404016,null))[_0x32a7('0x28')](function(_0x43b6d5){if(_0x43b6d5){_0x29457e[_0x32a7('0x4b')][_0x32a7('0x52')]=_0x43b6d5['id'];_0x29457e[_0x32a7('0x4b')]['Subjects']=integrations[_0x32a7('0x53')](_0x29457e[_0x32a7('0x4b')]['channel'],_0x29457e[_0x32a7('0x4b')][_0x32a7('0x31')]);_0x29457e[_0x32a7('0x4b')]['Descriptions']=integrations[_0x32a7('0x54')](_0x29457e[_0x32a7('0x4b')]['channel'],_0x29457e['body']['type']);return db[_0x32a7('0x4f')][_0x32a7('0x4a')](_0x29457e[_0x32a7('0x4b')],{'include':[{'model':db[_0x32a7('0x55')],'as':_0x32a7('0x56')},{'model':db[_0x32a7('0x55')],'as':_0x32a7('0x57')}]});}return null;})[_0x32a7('0x28')](respondWithResult(_0x404016,null))[_0x32a7('0x46')](handleError(_0x404016,null));};exports[_0x32a7('0x58')]=function(_0x596c96,_0xe20a0b,_0x43b6f0){var _0x37bc1a='';var _0x310103='';return db[_0x32a7('0x2e')][_0x32a7('0x4e')]({'where':{'id':_0x596c96[_0x32a7('0x48')]['id']},'attributes':['id',_0x32a7('0x59'),_0x32a7('0x5a'),_0x32a7('0x5b')]})[_0x32a7('0x28')](handleEntityNotFound(_0xe20a0b,null))['then'](function(_0x576c19){if(_0x576c19){_0x310103=_0x576c19[_0x32a7('0x59')];_0x37bc1a=_0x576c19[_0x32a7('0x5a')];var _0x199936=_0x576c19[_0x32a7('0x5a')][_0x32a7('0x5c')](-0x1);if(_0x199936==='/'){_0x37bc1a=_0x37bc1a['substring'](0x0,_0x37bc1a[_0x32a7('0x5d')](_0x199936));}return rp({'method':'GET','uri':util[_0x32a7('0x5e')](_0x32a7('0x5f'),_0x37bc1a,_0x32a7('0x60')),'headers':{'Authorization':_0x32a7('0x61')+_0x576c19[_0x32a7('0x5b')]},'json':!![]});}})[_0x32a7('0x28')](function(_0x45cf12){if(_0x45cf12){var _0x154e8e=_0x45cf12[_0x32a7('0x62')];var _0x30b00d=![];var _0x234d92=null;for(_0x234d92=0x0;_0x234d92<_0x154e8e[_0x32a7('0x39')];_0x234d92++){if(_0x154e8e[_0x234d92]['email']===_0x310103){_0x30b00d=!![];}}if(_0x30b00d){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x32a7('0x63')});}}})['then'](respondWithResult(_0xe20a0b,null))[_0x32a7('0x46')](function(_0x411685){var _0x3f2dd9=_0x596c96[_0x32a7('0x34')][_0x32a7('0x64')]?0x1f4:_0x411685[_0x32a7('0x65')]||0x1f4;logger[_0x32a7('0x29')](_0x32a7('0x66'),_0x32a7('0x58'),_0x3f2dd9,JSON[_0x32a7('0x67')](_0x411685));delete _0x411685[_0x32a7('0x2b')];if(_0x3f2dd9===0x191){_0x3f2dd9=0x190;}_0xe20a0b[_0x32a7('0x1c')](_0x3f2dd9)[_0x32a7('0x68')](_0x596c96[_0x32a7('0x34')][_0x32a7('0x64')]?{'message':_0x32a7('0x69'),'statusCode':_0x411685['statusCode']}:_0x411685);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index a3b0540..482f400 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 _0xfcf0=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xfcf0,0x138));var _0x0fcf=function(_0x448f8,_0x2aa1d7){_0x448f8=_0x448f8-0x0;var _0xa73126=_0xfcf0[_0x448f8];return _0xa73126;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));var integrations=require(_0x0fcf('0x9'));module[_0x0fcf('0xa')]=function(_0x1a7b03,_0x61bbb9){return _0x1a7b03[_0x0fcf('0xb')]('FreshsalesAccount',attributes,{'tableName':_0x0fcf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71ab=['path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','util','api','bluebird','request-promise'];(function(_0x32d47a,_0x4ddf9f){var _0x47a09d=function(_0x5e4e4b){while(--_0x5e4e4b){_0x32d47a['push'](_0x32d47a['shift']());}};_0x47a09d(++_0x4ddf9f);}(_0x71ab,0x64));var _0xb71a=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x71ab[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));var integrations=require(_0xb71a('0x8'));module[_0xb71a('0x9')]=function(_0x22c072,_0x35a84e){return _0x22c072[_0xb71a('0xa')](_0xb71a('0xb'),attributes,{'tableName':_0xb71a('0xc'),'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 f2ee7c1..46e187a 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 _0xf61e=['include','map','then','ShowFreshsalesAccount','FreshsalesAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','model'];(function(_0x5dc472,_0x2924a6){var _0x11c1fb=function(_0x2c0bd0){while(--_0x2c0bd0){_0x5dc472['push'](_0x5dc472['shift']());}};_0x11c1fb(++_0x2924a6);}(_0xf61e,0x191));var _0xef61=function(_0x723253,_0x28d503){_0x723253=_0x723253-0x0;var _0x18e249=_0xf61e[_0x723253];return _0x18e249;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require(_0xef61('0x3'));var rs=require(_0xef61('0x4'));var fs=require('fs');var Redis=require(_0xef61('0x5'));var db=require(_0xef61('0x6'))['db'];var utils=require(_0xef61('0x7'));var logger=require(_0xef61('0x8'))(_0xef61('0x9'));var config=require(_0xef61('0xa'));var jayson=require(_0xef61('0xb'));var client=jayson['client'][_0xef61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e2f79,_0x4f0cc5,_0x2242a7){return new BPromise(function(_0x277fa1,_0x106e7f){return client['request'](_0x3e2f79,_0x2242a7)['then'](function(_0x188894){logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));logger[_0xef61('0x10')](_0xef61('0x11'),_0x4f0cc5,_0xef61('0xf'),JSON[_0xef61('0x12')](_0x188894));if(_0x188894[_0xef61('0x13')]){if(_0x188894[_0xef61('0x13')][_0xef61('0x14')]===0x1f4){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')]['message']);return _0x106e7f(_0x188894[_0xef61('0x13')]['message']);}logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')][_0xef61('0x15')]);return _0x277fa1(_0x188894['error'][_0xef61('0x15')]);}else{logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));_0x277fa1(_0x188894['result'][_0xef61('0x15')]);}})[_0xef61('0x16')](function(_0x4f7a62){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x4f7a62);_0x106e7f(_0x4f7a62);});});}exports[_0xef61('0x17')]=function(_0x22dc1b){var _0xfc36d6=this;return new Promise(function(_0x28315a,_0xdd5e38){return db['FreshsalesAccount'][_0xef61('0x18')]({'raw':_0x22dc1b[_0xef61('0x19')]?_0x22dc1b['options'][_0xef61('0x1a')]===undefined?!![]:![]:!![],'where':_0x22dc1b[_0xef61('0x19')]?_0x22dc1b[_0xef61('0x19')][_0xef61('0x1b')]||null:null,'attributes':_0x22dc1b[_0xef61('0x19')]?_0x22dc1b[_0xef61('0x19')][_0xef61('0x1c')]||null:null,'limit':_0x22dc1b['options']?_0x22dc1b['options'][_0xef61('0x1d')]||null:null,'include':_0x22dc1b['options']?_0x22dc1b[_0xef61('0x19')]['include']?_['map'](_0x22dc1b[_0xef61('0x19')]['include'],function(_0x53181b){return{'model':db[_0x53181b[_0xef61('0x1e')]],'as':_0x53181b['as'],'attributes':_0x53181b[_0xef61('0x1c')],'include':_0x53181b[_0xef61('0x1f')]?_[_0xef61('0x20')](_0x53181b['include'],function(_0x16b144){return{'model':db[_0x16b144['model']],'as':_0x16b144['as'],'attributes':_0x16b144[_0xef61('0x1c')],'include':_0x16b144[_0xef61('0x1f')]?_[_0xef61('0x20')](_0x16b144[_0xef61('0x1f')],function(_0x2155f1){return{'model':db[_0x2155f1[_0xef61('0x1e')]],'as':_0x2155f1['as'],'attributes':_0x2155f1[_0xef61('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xef61('0x21')](function(_0x297df7){logger[_0xef61('0xd')](_0xef61('0x17'),_0x22dc1b);logger[_0xef61('0x10')](_0xef61('0x17'),_0x22dc1b,JSON[_0xef61('0x12')](_0x297df7));_0x28315a(_0x297df7);})[_0xef61('0x16')](function(_0x85978){logger[_0xef61('0x13')](_0xef61('0x17'),_0x85978[_0xef61('0x15')],_0x22dc1b);_0xdd5e38(_0xfc36d6[_0xef61('0x13')](0x1f4,_0x85978[_0xef61('0x15')]));});});};exports[_0xef61('0x22')]=function(_0x4f35ad){var _0x51d5d1=this;return new Promise(function(_0x38b522,_0x36713e){return db[_0xef61('0x23')]['find']({'raw':_0x4f35ad[_0xef61('0x19')]?_0x4f35ad[_0xef61('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4f35ad[_0xef61('0x19')]?_0x4f35ad['options']['where']||null:null,'attributes':_0x4f35ad[_0xef61('0x19')]?_0x4f35ad['options'][_0xef61('0x1c')]||null:null,'include':_0x4f35ad['options']?_0x4f35ad[_0xef61('0x19')][_0xef61('0x1f')]?_[_0xef61('0x20')](_0x4f35ad[_0xef61('0x19')][_0xef61('0x1f')],function(_0x1bdcb9){return{'model':db[_0x1bdcb9[_0xef61('0x1e')]],'as':_0x1bdcb9['as'],'attributes':_0x1bdcb9[_0xef61('0x1c')],'include':_0x1bdcb9[_0xef61('0x1f')]?_[_0xef61('0x20')](_0x1bdcb9['include'],function(_0x569db6){return{'model':db[_0x569db6[_0xef61('0x1e')]],'as':_0x569db6['as'],'attributes':_0x569db6[_0xef61('0x1c')],'include':_0x569db6[_0xef61('0x1f')]?_[_0xef61('0x20')](_0x569db6['include'],function(_0x1c38dc){return{'model':db[_0x1c38dc[_0xef61('0x1e')]],'as':_0x1c38dc['as'],'attributes':_0x1c38dc[_0xef61('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59b97b){logger['info'](_0xef61('0x22'),_0x4f35ad);logger['debug']('ShowFreshsalesAccount',_0x4f35ad,JSON['stringify'](_0x59b97b));_0x38b522(_0x59b97b);})[_0xef61('0x16')](function(_0x294063){logger[_0xef61('0x13')]('ShowFreshsalesAccount',_0x294063['message'],_0x4f35ad);_0x36713e(_0x51d5d1['error'](0x1f4,_0x294063[_0xef61('0x15')]));});});}; \ No newline at end of file +var _0x4bd3=['where','attributes','limit','include','model','map','stringify','find','ShowFreshsalesAccount','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw'];(function(_0x43dc7e,_0x49a390){var _0x21e12d=function(_0x15cc1a){while(--_0x15cc1a){_0x43dc7e['push'](_0x43dc7e['shift']());}};_0x21e12d(++_0x49a390);}(_0x4bd3,0x174));var _0x34bd=function(_0x142e33,_0x377cf9){_0x142e33=_0x142e33-0x0;var _0x29b9b3=_0x4bd3[_0x142e33];return _0x29b9b3;};'use strict';var _=require(_0x34bd('0x0'));var util=require('util');var moment=require(_0x34bd('0x1'));var BPromise=require(_0x34bd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x34bd('0x3'));var logger=require(_0x34bd('0x4'))(_0x34bd('0x5'));var config=require('../../config/environment');var jayson=require(_0x34bd('0x6'));var client=jayson[_0x34bd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e8744,_0x213716,_0x51a4d7){return new BPromise(function(_0xd600e1,_0x76de8d){return client[_0x34bd('0x8')](_0x3e8744,_0x51a4d7)[_0x34bd('0x9')](function(_0x1ac77f){logger[_0x34bd('0xa')]('FreshsalesAccount,\x20%s,\x20%s',_0x213716,_0x34bd('0xb'));logger[_0x34bd('0xc')](_0x34bd('0xd'),_0x213716,_0x34bd('0xb'),JSON['stringify'](_0x1ac77f));if(_0x1ac77f['error']){if(_0x1ac77f[_0x34bd('0xe')]['code']===0x1f4){logger['error'](_0x34bd('0xf'),_0x213716,_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);return _0x76de8d(_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);}logger[_0x34bd('0xe')](_0x34bd('0xf'),_0x213716,_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);return _0xd600e1(_0x1ac77f['error'][_0x34bd('0x10')]);}else{logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x213716,_0x34bd('0xb'));_0xd600e1(_0x1ac77f[_0x34bd('0x11')][_0x34bd('0x10')]);}})[_0x34bd('0x12')](function(_0x34b91b){logger[_0x34bd('0xe')](_0x34bd('0xf'),_0x213716,_0x34b91b);_0x76de8d(_0x34b91b);});});}exports[_0x34bd('0x13')]=function(_0x3b4bf8){var _0x72b197=this;return new Promise(function(_0x4b5ebb,_0x48d2ba){return db[_0x34bd('0x14')][_0x34bd('0x15')]({'raw':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8[_0x34bd('0x16')][_0x34bd('0x17')]===undefined?!![]:![]:!![],'where':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8[_0x34bd('0x16')][_0x34bd('0x18')]||null:null,'attributes':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8['options'][_0x34bd('0x19')]||null:null,'limit':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8[_0x34bd('0x16')][_0x34bd('0x1a')]||null:null,'include':_0x3b4bf8[_0x34bd('0x16')]?_0x3b4bf8['options']['include']?_['map'](_0x3b4bf8['options'][_0x34bd('0x1b')],function(_0x503a60){return{'model':db[_0x503a60[_0x34bd('0x1c')]],'as':_0x503a60['as'],'attributes':_0x503a60[_0x34bd('0x19')],'include':_0x503a60[_0x34bd('0x1b')]?_['map'](_0x503a60[_0x34bd('0x1b')],function(_0x14479a){return{'model':db[_0x14479a[_0x34bd('0x1c')]],'as':_0x14479a['as'],'attributes':_0x14479a[_0x34bd('0x19')],'include':_0x14479a['include']?_[_0x34bd('0x1d')](_0x14479a[_0x34bd('0x1b')],function(_0x264c94){return{'model':db[_0x264c94[_0x34bd('0x1c')]],'as':_0x264c94['as'],'attributes':_0x264c94['attributes']};}):[]};}):[]};}):[]:[]})[_0x34bd('0x9')](function(_0x3fe8b0){logger['info'](_0x34bd('0x13'),_0x3b4bf8);logger[_0x34bd('0xc')](_0x34bd('0x13'),_0x3b4bf8,JSON[_0x34bd('0x1e')](_0x3fe8b0));_0x4b5ebb(_0x3fe8b0);})[_0x34bd('0x12')](function(_0x4500c8){logger[_0x34bd('0xe')]('GetFreshsalesAccount',_0x4500c8[_0x34bd('0x10')],_0x3b4bf8);_0x48d2ba(_0x72b197[_0x34bd('0xe')](0x1f4,_0x4500c8['message']));});});};exports['ShowFreshsalesAccount']=function(_0x38bdba){var _0xca9897=this;return new Promise(function(_0xd176f7,_0x536b2c){return db['FreshsalesAccount'][_0x34bd('0x1f')]({'raw':_0x38bdba[_0x34bd('0x16')]?_0x38bdba[_0x34bd('0x16')][_0x34bd('0x17')]===undefined?!![]:![]:!![],'where':_0x38bdba['options']?_0x38bdba[_0x34bd('0x16')][_0x34bd('0x18')]||null:null,'attributes':_0x38bdba[_0x34bd('0x16')]?_0x38bdba[_0x34bd('0x16')][_0x34bd('0x19')]||null:null,'include':_0x38bdba[_0x34bd('0x16')]?_0x38bdba['options'][_0x34bd('0x1b')]?_['map'](_0x38bdba[_0x34bd('0x16')][_0x34bd('0x1b')],function(_0xf12ee6){return{'model':db[_0xf12ee6['model']],'as':_0xf12ee6['as'],'attributes':_0xf12ee6[_0x34bd('0x19')],'include':_0xf12ee6[_0x34bd('0x1b')]?_['map'](_0xf12ee6[_0x34bd('0x1b')],function(_0x21c7d6){return{'model':db[_0x21c7d6[_0x34bd('0x1c')]],'as':_0x21c7d6['as'],'attributes':_0x21c7d6['attributes'],'include':_0x21c7d6[_0x34bd('0x1b')]?_[_0x34bd('0x1d')](_0x21c7d6['include'],function(_0x117188){return{'model':db[_0x117188[_0x34bd('0x1c')]],'as':_0x117188['as'],'attributes':_0x117188[_0x34bd('0x19')]};}):[]};}):[]};}):[]:[]})[_0x34bd('0x9')](function(_0x320643){logger[_0x34bd('0xa')]('ShowFreshsalesAccount',_0x38bdba);logger['debug']('ShowFreshsalesAccount',_0x38bdba,JSON[_0x34bd('0x1e')](_0x320643));_0xd176f7(_0x320643);})[_0x34bd('0x12')](function(_0x5e30c5){logger['error'](_0x34bd('0x20'),_0x5e30c5['message'],_0x38bdba);_0x536b2c(_0xca9897['error'](0x1f4,_0x5e30c5[_0x34bd('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 32e98fb..72ea191 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 _0xcad1=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x5bb547,_0x2b7d34){var _0x3bfb1e=function(_0x59bc56){while(--_0x59bc56){_0x5bb547['push'](_0x5bb547['shift']());}};_0x3bfb1e(++_0x2b7d34);}(_0xcad1,0x19b));var _0x1cad=function(_0x409af7,_0x239fe4){_0x409af7=_0x409af7-0x0;var _0x1aeeb0=_0xcad1[_0x409af7];return _0x1aeeb0;};'use strict';var multer=require(_0x1cad('0x0'));var util=require(_0x1cad('0x1'));var path=require(_0x1cad('0x2'));var timeout=require(_0x1cad('0x3'));var express=require(_0x1cad('0x4'));var router=express[_0x1cad('0x5')]();var fs_extra=require(_0x1cad('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1cad('0x7'));var config=require(_0x1cad('0x8'));var controller=require(_0x1cad('0x9'));router[_0x1cad('0xa')]('/',auth[_0x1cad('0xb')](),controller[_0x1cad('0xc')]);router[_0x1cad('0xa')](_0x1cad('0xd'),auth[_0x1cad('0xb')](),controller[_0x1cad('0xe')]);router['get'](_0x1cad('0xf'),auth['isAuthenticated'](),controller[_0x1cad('0x10')]);router[_0x1cad('0xa')](_0x1cad('0x11'),auth[_0x1cad('0xb')](),controller[_0x1cad('0x12')]);router[_0x1cad('0xa')](_0x1cad('0x13'),auth[_0x1cad('0xb')](),controller[_0x1cad('0x14')]);router[_0x1cad('0x15')]('/',auth[_0x1cad('0xb')](),controller[_0x1cad('0x16')]);router[_0x1cad('0x17')](_0x1cad('0xd'),auth[_0x1cad('0xb')](),controller['update']);router[_0x1cad('0x18')](_0x1cad('0xd'),auth[_0x1cad('0xb')](),controller[_0x1cad('0x19')]);module['exports']=router; \ No newline at end of file +var _0x84ee=['../../components/interaction/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x525513,_0x44220c){var _0x17f77f=function(_0x28473e){while(--_0x28473e){_0x525513['push'](_0x525513['shift']());}};_0x17f77f(++_0x44220c);}(_0x84ee,0xf2));var _0xe84e=function(_0x1bc635,_0x4a1b08){_0x1bc635=_0x1bc635-0x0;var _0x1179e0=_0x84ee[_0x1bc635];return _0x1179e0;};'use strict';var multer=require(_0xe84e('0x0'));var util=require(_0xe84e('0x1'));var path=require(_0xe84e('0x2'));var timeout=require(_0xe84e('0x3'));var express=require(_0xe84e('0x4'));var router=express[_0xe84e('0x5')]();var fs_extra=require(_0xe84e('0x6'));var auth=require(_0xe84e('0x7'));var interaction=require(_0xe84e('0x8'));var config=require('../../config/environment');var controller=require(_0xe84e('0x9'));router[_0xe84e('0xa')]('/',auth[_0xe84e('0xb')](),controller[_0xe84e('0xc')]);router[_0xe84e('0xa')](_0xe84e('0xd'),auth[_0xe84e('0xb')](),controller['show']);router[_0xe84e('0xa')]('/:id/subjects',auth[_0xe84e('0xb')](),controller[_0xe84e('0xe')]);router['get'](_0xe84e('0xf'),auth[_0xe84e('0xb')](),controller[_0xe84e('0x10')]);router[_0xe84e('0xa')](_0xe84e('0x11'),auth[_0xe84e('0xb')](),controller[_0xe84e('0x12')]);router[_0xe84e('0x13')]('/',auth[_0xe84e('0xb')](),controller[_0xe84e('0x14')]);router[_0xe84e('0x15')](_0xe84e('0xd'),auth[_0xe84e('0xb')](),controller[_0xe84e('0x16')]);router[_0xe84e('0x17')]('/:id',auth[_0xe84e('0xb')](),controller[_0xe84e('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 6986a91..f5bfb9e 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 _0x8b63=['sequelize','exports','STRING'];(function(_0x548eb0,_0x22cc8d){var _0x21c68a=function(_0x28fd3c){while(--_0x28fd3c){_0x548eb0['push'](_0x548eb0['shift']());}};_0x21c68a(++_0x22cc8d);}(_0x8b63,0xa5));var _0x38b6=function(_0x16c514,_0x3c9e69){_0x16c514=_0x16c514-0x0;var _0x4b449f=_0x8b63[_0x16c514];return _0x4b449f;};'use strict';var Sequelize=require(_0x38b6('0x0'));module[_0x38b6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x38b6('0x2')]}}; \ No newline at end of file +var _0x3bde=['sequelize','exports','STRING'];(function(_0x14b996,_0x21f888){var _0x4258e9=function(_0x48780b){while(--_0x48780b){_0x14b996['push'](_0x14b996['shift']());}};_0x4258e9(++_0x21f888);}(_0x3bde,0x14a));var _0xe3bd=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x3bde[_0x119d5a];return _0x15bff4;};'use strict';var Sequelize=require(_0xe3bd('0x0'));module[_0xe3bd('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe3bd('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 13d6e22..3f625b3 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 _0x8fde=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','FreshsalesConfiguration','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','show','keys','length','find','catch','create','body','params','findOne','FreshsalesField','rawAttributes','getSubjects','nolimit','getDescriptions','getFields','rimraf','zip-dir','request-promise','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/utils','../../config/environment','../../config/license/util'];(function(_0x30ebff,_0x434cc4){var _0x421101=function(_0x3f3361){while(--_0x3f3361){_0x30ebff['push'](_0x30ebff['shift']());}};_0x421101(++_0x434cc4);}(_0x8fde,0x17d));var _0xe8fd=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x8fde[_0x1969a7];return _0x3d665f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe8fd('0x0'));var zipdir=require(_0xe8fd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe8fd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe8fd('0x3'));var util=require(_0xe8fd('0x4'));var path=require(_0xe8fd('0x5'));var sox=require(_0xe8fd('0x6'));var csv=require(_0xe8fd('0x7'));var ejs=require(_0xe8fd('0x8'));var fs=require('fs');var fs_extra=require(_0xe8fd('0x9'));var _=require(_0xe8fd('0xa'));var squel=require('squel');var crypto=require(_0xe8fd('0xb'));var jsforce=require(_0xe8fd('0xc'));var deskjs=require(_0xe8fd('0xd'));var toCsv=require(_0xe8fd('0x7'));var querystring=require('querystring');var Papa=require(_0xe8fd('0xe'));var Redis=require(_0xe8fd('0xf'));var authService=require(_0xe8fd('0x10'));var qs=require(_0xe8fd('0x11'));var as=require(_0xe8fd('0x12'));var hardwareService=require(_0xe8fd('0x13'));var logger=require(_0xe8fd('0x14'))('api');var utils=require(_0xe8fd('0x15'));var config=require(_0xe8fd('0x16'));var licenseUtil=require(_0xe8fd('0x17'));var db=require(_0xe8fd('0x18'))['db'];function respondWithStatusCode(_0x448e46,_0x9a40a3){_0x9a40a3=_0x9a40a3||0xcc;return function(_0x575c5c){if(_0x575c5c){return _0x448e46[_0xe8fd('0x19')](_0x9a40a3);}return _0x448e46[_0xe8fd('0x1a')](_0x9a40a3)[_0xe8fd('0x1b')]();};}function respondWithResult(_0x3d958c,_0x8dadca){_0x8dadca=_0x8dadca||0xc8;return function(_0x18ef36){if(_0x18ef36){return _0x3d958c[_0xe8fd('0x1a')](_0x8dadca)[_0xe8fd('0x1c')](_0x18ef36);}};}function respondWithFilteredResult(_0x58e990,_0x834637){return function(_0x997a86){if(_0x997a86){var _0x2bfede=typeof _0x834637[_0xe8fd('0x1d')]===_0xe8fd('0x1e')&&typeof _0x834637[_0xe8fd('0x1f')]===_0xe8fd('0x1e');var _0x3ce029=_0x997a86['count'];var _0x127b1a=_0x2bfede?0x0:_0x834637[_0xe8fd('0x1d')];var _0x3706e6=_0x2bfede?_0x997a86['count']:_0x834637[_0xe8fd('0x1d')]+_0x834637['limit'];var _0x19349b;if(_0x3706e6>=_0x3ce029){_0x3706e6=_0x3ce029;_0x19349b=0xc8;}else{_0x19349b=0xce;}_0x58e990[_0xe8fd('0x1a')](_0x19349b);return _0x58e990[_0xe8fd('0x20')](_0xe8fd('0x21'),_0x127b1a+'-'+_0x3706e6+'/'+_0x3ce029)[_0xe8fd('0x1c')](_0x997a86);}return null;};}function patchUpdates(_0x3389fe){return function(_0x21eabf){try{jsonpatch[_0xe8fd('0x22')](_0x21eabf,_0x3389fe,!![]);}catch(_0x1982a0){return BPromise['reject'](_0x1982a0);}return _0x21eabf[_0xe8fd('0x23')]();};}function saveUpdates(_0x300918,_0x3b497d){return function(_0x31b1d2){if(_0x31b1d2){return _0x31b1d2[_0xe8fd('0x24')](_0x300918)[_0xe8fd('0x25')](function(_0x446525){return _0x446525;});}return null;};}function removeEntity(_0x405b10,_0x3e298a){return function(_0x1d42ed){if(_0x1d42ed){return _0x1d42ed[_0xe8fd('0x26')]()[_0xe8fd('0x25')](function(){_0x405b10[_0xe8fd('0x1a')](0xcc)[_0xe8fd('0x1b')]();});}};}function handleEntityNotFound(_0x31d914,_0x1121b2){return function(_0x595a8b){if(!_0x595a8b){_0x31d914[_0xe8fd('0x19')](0x194);}return _0x595a8b;};}function handleError(_0x33b0d0,_0x1c76b){_0x1c76b=_0x1c76b||0x1f4;return function(_0x101a35){logger[_0xe8fd('0x27')](_0x101a35['stack']);if(_0x101a35['name']){delete _0x101a35[_0xe8fd('0x28')];}_0x33b0d0[_0xe8fd('0x1a')](_0x1c76b)[_0xe8fd('0x29')](_0x101a35);};}exports[_0xe8fd('0x2a')]=function(_0x3f00fd,_0xe59422){var _0x182a6b={},_0x19603b={},_0x16d54c={'count':0x0,'rows':[]};var _0xf34752=_['map'](db[_0xe8fd('0x2b')]['rawAttributes'],function(_0x2eadad){return{'name':_0x2eadad[_0xe8fd('0x2c')],'type':_0x2eadad[_0xe8fd('0x2d')][_0xe8fd('0x2e')]};});_0x19603b[_0xe8fd('0x2f')]=_[_0xe8fd('0x30')](_0xf34752,'name');_0x19603b[_0xe8fd('0x31')]=_['keys'](_0x3f00fd[_0xe8fd('0x31')]);_0x19603b[_0xe8fd('0x32')]=_[_0xe8fd('0x33')](_0x19603b[_0xe8fd('0x2f')],_0x19603b[_0xe8fd('0x31')]);_0x182a6b[_0xe8fd('0x34')]=_[_0xe8fd('0x33')](_0x19603b[_0xe8fd('0x2f')],qs[_0xe8fd('0x35')](_0x3f00fd[_0xe8fd('0x31')][_0xe8fd('0x35')]));_0x182a6b[_0xe8fd('0x34')]=_0x182a6b[_0xe8fd('0x34')]['length']?_0x182a6b[_0xe8fd('0x34')]:_0x19603b[_0xe8fd('0x2f')];if(!_0x3f00fd['query'][_0xe8fd('0x36')]('nolimit')){_0x182a6b[_0xe8fd('0x1f')]=qs['limit'](_0x3f00fd[_0xe8fd('0x31')][_0xe8fd('0x1f')]);_0x182a6b['offset']=qs['offset'](_0x3f00fd['query']['offset']);}_0x182a6b[_0xe8fd('0x37')]=qs[_0xe8fd('0x38')](_0x3f00fd['query'][_0xe8fd('0x38')]);_0x182a6b[_0xe8fd('0x39')]=qs[_0xe8fd('0x32')](_[_0xe8fd('0x3a')](_0x3f00fd[_0xe8fd('0x31')],_0x19603b[_0xe8fd('0x32')]),_0xf34752);if(_0x3f00fd[_0xe8fd('0x31')][_0xe8fd('0x3b')]){_0x182a6b[_0xe8fd('0x39')]=_[_0xe8fd('0x3c')](_0x182a6b['where'],{'$or':_[_0xe8fd('0x30')](_0xf34752,function(_0x35d45a){if(_0x35d45a[_0xe8fd('0x2d')]!==_0xe8fd('0x3d')){var _0x46f7a5={};_0x46f7a5[_0x35d45a[_0xe8fd('0x28')]]={'$like':'%'+_0x3f00fd[_0xe8fd('0x31')]['filter']+'%'};return _0x46f7a5;}})});}_0x182a6b=_[_0xe8fd('0x3c')]({},_0x182a6b,_0x3f00fd[_0xe8fd('0x3e')]);var _0x1df6fe={'where':_0x182a6b[_0xe8fd('0x39')]};return db['FreshsalesConfiguration'][_0xe8fd('0x3f')](_0x1df6fe)[_0xe8fd('0x25')](function(_0x584ff8){_0x16d54c[_0xe8fd('0x3f')]=_0x584ff8;if(_0x3f00fd[_0xe8fd('0x31')][_0xe8fd('0x40')]){_0x182a6b[_0xe8fd('0x41')]=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x182a6b);})['then'](function(_0x36897c){_0x16d54c['rows']=_0x36897c;return _0x16d54c;})[_0xe8fd('0x25')](respondWithFilteredResult(_0xe59422,_0x182a6b))['catch'](handleError(_0xe59422,null));};exports[_0xe8fd('0x42')]=function(_0x4fbf6e,_0xa68b1c){var _0x5544b9={'raw':![],'where':{'id':_0x4fbf6e['params']['id']}},_0x1ff5dc={};_0x1ff5dc[_0xe8fd('0x2f')]=_[_0xe8fd('0x43')](db[_0xe8fd('0x2b')]['rawAttributes']);_0x1ff5dc['query']=_[_0xe8fd('0x43')](_0x4fbf6e[_0xe8fd('0x31')]);_0x1ff5dc[_0xe8fd('0x32')]=_[_0xe8fd('0x33')](_0x1ff5dc[_0xe8fd('0x2f')],_0x1ff5dc[_0xe8fd('0x31')]);_0x5544b9['attributes']=_[_0xe8fd('0x33')](_0x1ff5dc[_0xe8fd('0x2f')],qs[_0xe8fd('0x35')](_0x4fbf6e['query'][_0xe8fd('0x35')]));_0x5544b9[_0xe8fd('0x34')]=_0x5544b9[_0xe8fd('0x34')][_0xe8fd('0x44')]?_0x5544b9['attributes']:_0x1ff5dc[_0xe8fd('0x2f')];if(_0x4fbf6e[_0xe8fd('0x31')]['includeAll']){_0x5544b9[_0xe8fd('0x41')]=[{'all':!![]}];}_0x5544b9=_[_0xe8fd('0x3c')]({},_0x5544b9,_0x4fbf6e[_0xe8fd('0x3e')]);return db[_0xe8fd('0x2b')][_0xe8fd('0x45')](_0x5544b9)[_0xe8fd('0x25')](handleEntityNotFound(_0xa68b1c,null))[_0xe8fd('0x25')](respondWithResult(_0xa68b1c,null))[_0xe8fd('0x46')](handleError(_0xa68b1c,null));};exports['create']=function(_0xf339c6,_0x31e81f){return db[_0xe8fd('0x2b')][_0xe8fd('0x47')](_0xf339c6[_0xe8fd('0x48')],{})[_0xe8fd('0x25')](respondWithResult(_0x31e81f,0xc9))[_0xe8fd('0x46')](handleError(_0x31e81f,null));};exports['update']=function(_0x24f84a,_0x2d66ca){if(_0x24f84a[_0xe8fd('0x48')]['id']){delete _0x24f84a['body']['id'];}return db[_0xe8fd('0x2b')][_0xe8fd('0x45')]({'where':{'id':_0x24f84a[_0xe8fd('0x49')]['id']}})['then'](handleEntityNotFound(_0x2d66ca,null))[_0xe8fd('0x25')](saveUpdates(_0x24f84a['body'],null))[_0xe8fd('0x25')](respondWithResult(_0x2d66ca,null))[_0xe8fd('0x46')](handleError(_0x2d66ca,null));};exports[_0xe8fd('0x26')]=function(_0x32da58,_0xf51f7d){return db[_0xe8fd('0x2b')]['find']({'where':{'id':_0x32da58['params']['id']}})[_0xe8fd('0x25')](handleEntityNotFound(_0xf51f7d,null))[_0xe8fd('0x25')](removeEntity(_0xf51f7d,null))[_0xe8fd('0x46')](handleError(_0xf51f7d,null));};exports['getSubjects']=function(_0x4cba84,_0x20ce11,_0x13cbaf){var _0x18333c={};var _0x5904f2={};var _0x4d51b7;var _0x481e62;return db['FreshsalesConfiguration'][_0xe8fd('0x4a')]({'where':{'id':_0x4cba84[_0xe8fd('0x49')]['id']}})[_0xe8fd('0x25')](handleEntityNotFound(_0x20ce11,null))[_0xe8fd('0x25')](function(_0x2fd063){if(_0x2fd063){_0x4d51b7=_0x2fd063;_0x5904f2[_0xe8fd('0x2f')]=_[_0xe8fd('0x43')](db[_0xe8fd('0x4b')][_0xe8fd('0x4c')]);_0x5904f2['query']=_[_0xe8fd('0x43')](_0x4cba84['query']);_0x5904f2[_0xe8fd('0x32')]=_[_0xe8fd('0x33')](_0x5904f2['model'],_0x5904f2[_0xe8fd('0x31')]);_0x18333c['attributes']=_[_0xe8fd('0x33')](_0x5904f2['model'],qs[_0xe8fd('0x35')](_0x4cba84[_0xe8fd('0x31')]['fields']));_0x18333c[_0xe8fd('0x34')]=_0x18333c[_0xe8fd('0x34')][_0xe8fd('0x44')]?_0x18333c[_0xe8fd('0x34')]:_0x5904f2['model'];_0x18333c[_0xe8fd('0x37')]=qs[_0xe8fd('0x38')](_0x4cba84[_0xe8fd('0x31')]['sort']);_0x18333c['where']=qs[_0xe8fd('0x32')](_['pick'](_0x4cba84[_0xe8fd('0x31')],_0x5904f2[_0xe8fd('0x32')]));if(_0x4cba84[_0xe8fd('0x31')][_0xe8fd('0x3b')]){_0x18333c[_0xe8fd('0x39')]=_[_0xe8fd('0x3c')](_0x18333c[_0xe8fd('0x39')],{'$or':_[_0xe8fd('0x30')](_0x18333c[_0xe8fd('0x34')],function(_0x216835){var _0x1de89c={};_0x1de89c[_0x216835]={'$like':'%'+_0x4cba84[_0xe8fd('0x31')]['filter']+'%'};return _0x1de89c;})});}_0x18333c=_[_0xe8fd('0x3c')]({},_0x18333c,_0x4cba84[_0xe8fd('0x3e')]);return _0x4d51b7[_0xe8fd('0x4d')](_0x18333c);}})[_0xe8fd('0x25')](function(_0x1e171f){if(_0x1e171f){_0x481e62=_0x1e171f[_0xe8fd('0x44')];if(!_0x4cba84[_0xe8fd('0x31')][_0xe8fd('0x36')](_0xe8fd('0x4e'))){_0x18333c[_0xe8fd('0x1f')]=qs[_0xe8fd('0x1f')](_0x4cba84['query']['limit']);_0x18333c[_0xe8fd('0x1d')]=qs[_0xe8fd('0x1d')](_0x4cba84['query'][_0xe8fd('0x1d')]);}return _0x4d51b7['getSubjects'](_0x18333c);}})[_0xe8fd('0x25')](function(_0x4523cf){if(_0x4523cf){return _0x4523cf?{'count':_0x481e62,'rows':_0x4523cf}:null;}})[_0xe8fd('0x25')](respondWithResult(_0x20ce11,null))[_0xe8fd('0x46')](handleError(_0x20ce11,null));};exports[_0xe8fd('0x4f')]=function(_0x35bcec,_0x5c2cfd,_0x5a597c){var _0x42a72c={};var _0x9bafe3={};var _0x505fc7;var _0xcbf594;return db['FreshsalesConfiguration'][_0xe8fd('0x4a')]({'where':{'id':_0x35bcec['params']['id']}})['then'](handleEntityNotFound(_0x5c2cfd,null))[_0xe8fd('0x25')](function(_0x27dd15){if(_0x27dd15){_0x505fc7=_0x27dd15;_0x9bafe3[_0xe8fd('0x2f')]=_[_0xe8fd('0x43')](db[_0xe8fd('0x4b')][_0xe8fd('0x4c')]);_0x9bafe3[_0xe8fd('0x31')]=_[_0xe8fd('0x43')](_0x35bcec[_0xe8fd('0x31')]);_0x9bafe3[_0xe8fd('0x32')]=_['intersection'](_0x9bafe3[_0xe8fd('0x2f')],_0x9bafe3[_0xe8fd('0x31')]);_0x42a72c[_0xe8fd('0x34')]=_[_0xe8fd('0x33')](_0x9bafe3[_0xe8fd('0x2f')],qs[_0xe8fd('0x35')](_0x35bcec[_0xe8fd('0x31')][_0xe8fd('0x35')]));_0x42a72c[_0xe8fd('0x34')]=_0x42a72c['attributes']['length']?_0x42a72c['attributes']:_0x9bafe3['model'];_0x42a72c['order']=qs[_0xe8fd('0x38')](_0x35bcec[_0xe8fd('0x31')][_0xe8fd('0x38')]);_0x42a72c[_0xe8fd('0x39')]=qs[_0xe8fd('0x32')](_['pick'](_0x35bcec[_0xe8fd('0x31')],_0x9bafe3[_0xe8fd('0x32')]));if(_0x35bcec[_0xe8fd('0x31')][_0xe8fd('0x3b')]){_0x42a72c[_0xe8fd('0x39')]=_[_0xe8fd('0x3c')](_0x42a72c[_0xe8fd('0x39')],{'$or':_['map'](_0x42a72c[_0xe8fd('0x34')],function(_0x2b8139){var _0x129067={};_0x129067[_0x2b8139]={'$like':'%'+_0x35bcec[_0xe8fd('0x31')][_0xe8fd('0x3b')]+'%'};return _0x129067;})});}_0x42a72c=_[_0xe8fd('0x3c')]({},_0x42a72c,_0x35bcec[_0xe8fd('0x3e')]);return _0x505fc7[_0xe8fd('0x4f')](_0x42a72c);}})[_0xe8fd('0x25')](function(_0xd64c29){if(_0xd64c29){_0xcbf594=_0xd64c29[_0xe8fd('0x44')];if(!_0x35bcec[_0xe8fd('0x31')][_0xe8fd('0x36')]('nolimit')){_0x42a72c['limit']=qs[_0xe8fd('0x1f')](_0x35bcec[_0xe8fd('0x31')][_0xe8fd('0x1f')]);_0x42a72c[_0xe8fd('0x1d')]=qs[_0xe8fd('0x1d')](_0x35bcec[_0xe8fd('0x31')][_0xe8fd('0x1d')]);}return _0x505fc7['getDescriptions'](_0x42a72c);}})[_0xe8fd('0x25')](function(_0x53d50a){if(_0x53d50a){return _0x53d50a?{'count':_0xcbf594,'rows':_0x53d50a}:null;}})['then'](respondWithResult(_0x5c2cfd,null))[_0xe8fd('0x46')](handleError(_0x5c2cfd,null));};exports[_0xe8fd('0x50')]=function(_0x107808,_0x360974,_0x4d2fd4){var _0x327104={};var _0x136375={};var _0x5c7ba5;var _0x3ae006;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x107808[_0xe8fd('0x49')]['id']}})[_0xe8fd('0x25')](handleEntityNotFound(_0x360974,null))[_0xe8fd('0x25')](function(_0x46f70f){if(_0x46f70f){_0x5c7ba5=_0x46f70f;_0x136375[_0xe8fd('0x2f')]=_[_0xe8fd('0x43')](db[_0xe8fd('0x4b')][_0xe8fd('0x4c')]);_0x136375[_0xe8fd('0x31')]=_[_0xe8fd('0x43')](_0x107808[_0xe8fd('0x31')]);_0x136375[_0xe8fd('0x32')]=_[_0xe8fd('0x33')](_0x136375[_0xe8fd('0x2f')],_0x136375[_0xe8fd('0x31')]);_0x327104[_0xe8fd('0x34')]=_['intersection'](_0x136375[_0xe8fd('0x2f')],qs['fields'](_0x107808[_0xe8fd('0x31')][_0xe8fd('0x35')]));_0x327104[_0xe8fd('0x34')]=_0x327104[_0xe8fd('0x34')]['length']?_0x327104['attributes']:_0x136375[_0xe8fd('0x2f')];_0x327104[_0xe8fd('0x37')]=qs[_0xe8fd('0x38')](_0x107808[_0xe8fd('0x31')]['sort']);_0x327104['where']=qs[_0xe8fd('0x32')](_[_0xe8fd('0x3a')](_0x107808[_0xe8fd('0x31')],_0x136375[_0xe8fd('0x32')]));if(_0x107808[_0xe8fd('0x31')]['filter']){_0x327104[_0xe8fd('0x39')]=_[_0xe8fd('0x3c')](_0x327104[_0xe8fd('0x39')],{'$or':_[_0xe8fd('0x30')](_0x327104[_0xe8fd('0x34')],function(_0x16aa4e){var _0x196059={};_0x196059[_0x16aa4e]={'$like':'%'+_0x107808[_0xe8fd('0x31')]['filter']+'%'};return _0x196059;})});}_0x327104=_[_0xe8fd('0x3c')]({},_0x327104,_0x107808[_0xe8fd('0x3e')]);return _0x5c7ba5[_0xe8fd('0x50')](_0x327104);}})[_0xe8fd('0x25')](function(_0x440571){if(_0x440571){_0x3ae006=_0x440571[_0xe8fd('0x44')];if(!_0x107808[_0xe8fd('0x31')][_0xe8fd('0x36')](_0xe8fd('0x4e'))){_0x327104[_0xe8fd('0x1f')]=qs[_0xe8fd('0x1f')](_0x107808[_0xe8fd('0x31')][_0xe8fd('0x1f')]);_0x327104['offset']=qs[_0xe8fd('0x1d')](_0x107808[_0xe8fd('0x31')][_0xe8fd('0x1d')]);}return _0x5c7ba5[_0xe8fd('0x50')](_0x327104);}})[_0xe8fd('0x25')](function(_0x1d8d6b){if(_0x1d8d6b){return _0x1d8d6b?{'count':_0x3ae006,'rows':_0x1d8d6b}:null;}})[_0xe8fd('0x25')](respondWithResult(_0x360974,null))['catch'](handleError(_0x360974,null));}; \ No newline at end of file +var _0x95a8=['params','includeAll','include','find','create','body','catch','getSubjects','findOne','rawAttributes','hasOwnProperty','getDescriptions','pick','getFields','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','name','send','map','FreshsalesConfiguration','fieldName','type','key','model','keys','filters','query','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','options','show'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x95a8,0x1dc));var _0x895a=function(_0x50748b,_0x599d6d){_0x50748b=_0x50748b-0x0;var _0x5688d7=_0x95a8[_0x50748b];return _0x5688d7;};'use strict';var emlformat=require(_0x895a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x895a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x895a('0x2'));var moment=require('moment');var BPromise=require(_0x895a('0x3'));var Mustache=require(_0x895a('0x4'));var util=require(_0x895a('0x5'));var path=require(_0x895a('0x6'));var sox=require(_0x895a('0x7'));var csv=require(_0x895a('0x8'));var ejs=require(_0x895a('0x9'));var fs=require('fs');var fs_extra=require(_0x895a('0xa'));var _=require('lodash');var squel=require(_0x895a('0xb'));var crypto=require(_0x895a('0xc'));var jsforce=require(_0x895a('0xd'));var deskjs=require(_0x895a('0xe'));var toCsv=require(_0x895a('0x8'));var querystring=require(_0x895a('0xf'));var Papa=require(_0x895a('0x10'));var Redis=require(_0x895a('0x11'));var authService=require(_0x895a('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x895a('0x13'));var logger=require(_0x895a('0x14'))('api');var utils=require(_0x895a('0x15'));var config=require(_0x895a('0x16'));var licenseUtil=require(_0x895a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4612c9,_0x4d1d28){_0x4d1d28=_0x4d1d28||0xcc;return function(_0x5b6cd2){if(_0x5b6cd2){return _0x4612c9[_0x895a('0x18')](_0x4d1d28);}return _0x4612c9['status'](_0x4d1d28)['end']();};}function respondWithResult(_0x4d7251,_0x1d8ab5){_0x1d8ab5=_0x1d8ab5||0xc8;return function(_0x53dab3){if(_0x53dab3){return _0x4d7251[_0x895a('0x19')](_0x1d8ab5)[_0x895a('0x1a')](_0x53dab3);}};}function respondWithFilteredResult(_0x57b8f4,_0x3d0cfc){return function(_0x55d43e){if(_0x55d43e){var _0x3bfc71=typeof _0x3d0cfc[_0x895a('0x1b')]===_0x895a('0x1c')&&typeof _0x3d0cfc[_0x895a('0x1d')]==='undefined';var _0x2161d8=_0x55d43e['count'];var _0x455108=_0x3bfc71?0x0:_0x3d0cfc[_0x895a('0x1b')];var _0x111755=_0x3bfc71?_0x55d43e[_0x895a('0x1e')]:_0x3d0cfc[_0x895a('0x1b')]+_0x3d0cfc[_0x895a('0x1d')];var _0x4df3b4;if(_0x111755>=_0x2161d8){_0x111755=_0x2161d8;_0x4df3b4=0xc8;}else{_0x4df3b4=0xce;}_0x57b8f4['status'](_0x4df3b4);return _0x57b8f4[_0x895a('0x1f')](_0x895a('0x20'),_0x455108+'-'+_0x111755+'/'+_0x2161d8)[_0x895a('0x1a')](_0x55d43e);}return null;};}function patchUpdates(_0x13ce10){return function(_0xcee282){try{jsonpatch[_0x895a('0x21')](_0xcee282,_0x13ce10,!![]);}catch(_0x2f62c5){return BPromise['reject'](_0x2f62c5);}return _0xcee282[_0x895a('0x22')]();};}function saveUpdates(_0x5d1d04,_0x27bf48){return function(_0x342d07){if(_0x342d07){return _0x342d07[_0x895a('0x23')](_0x5d1d04)[_0x895a('0x24')](function(_0x111153){return _0x111153;});}return null;};}function removeEntity(_0x111523,_0x56d84a){return function(_0x1d6709){if(_0x1d6709){return _0x1d6709[_0x895a('0x25')]()[_0x895a('0x24')](function(){_0x111523[_0x895a('0x19')](0xcc)[_0x895a('0x26')]();});}};}function handleEntityNotFound(_0x23bb05,_0x540c1f){return function(_0x2667fa){if(!_0x2667fa){_0x23bb05[_0x895a('0x18')](0x194);}return _0x2667fa;};}function handleError(_0x5d25a8,_0x4f0506){_0x4f0506=_0x4f0506||0x1f4;return function(_0x55f270){logger[_0x895a('0x27')](_0x55f270['stack']);if(_0x55f270[_0x895a('0x28')]){delete _0x55f270['name'];}_0x5d25a8[_0x895a('0x19')](_0x4f0506)[_0x895a('0x29')](_0x55f270);};}exports['index']=function(_0x49d585,_0x19529f){var _0x46267f={},_0x3c8dbf={},_0x2133f4={'count':0x0,'rows':[]};var _0xb51bb1=_[_0x895a('0x2a')](db[_0x895a('0x2b')]['rawAttributes'],function(_0x5b41aa){return{'name':_0x5b41aa[_0x895a('0x2c')],'type':_0x5b41aa[_0x895a('0x2d')][_0x895a('0x2e')]};});_0x3c8dbf[_0x895a('0x2f')]=_[_0x895a('0x2a')](_0xb51bb1,_0x895a('0x28'));_0x3c8dbf['query']=_[_0x895a('0x30')](_0x49d585['query']);_0x3c8dbf[_0x895a('0x31')]=_['intersection'](_0x3c8dbf[_0x895a('0x2f')],_0x3c8dbf[_0x895a('0x32')]);_0x46267f['attributes']=_[_0x895a('0x33')](_0x3c8dbf[_0x895a('0x2f')],qs[_0x895a('0x34')](_0x49d585[_0x895a('0x32')][_0x895a('0x34')]));_0x46267f[_0x895a('0x35')]=_0x46267f[_0x895a('0x35')][_0x895a('0x36')]?_0x46267f[_0x895a('0x35')]:_0x3c8dbf[_0x895a('0x2f')];if(!_0x49d585[_0x895a('0x32')]['hasOwnProperty'](_0x895a('0x37'))){_0x46267f[_0x895a('0x1d')]=qs[_0x895a('0x1d')](_0x49d585['query'][_0x895a('0x1d')]);_0x46267f[_0x895a('0x1b')]=qs[_0x895a('0x1b')](_0x49d585[_0x895a('0x32')]['offset']);}_0x46267f[_0x895a('0x38')]=qs['sort'](_0x49d585['query'][_0x895a('0x39')]);_0x46267f[_0x895a('0x3a')]=qs[_0x895a('0x31')](_['pick'](_0x49d585[_0x895a('0x32')],_0x3c8dbf[_0x895a('0x31')]),_0xb51bb1);if(_0x49d585[_0x895a('0x32')][_0x895a('0x3b')]){_0x46267f[_0x895a('0x3a')]=_[_0x895a('0x3c')](_0x46267f[_0x895a('0x3a')],{'$or':_[_0x895a('0x2a')](_0xb51bb1,function(_0x5c481a){if(_0x5c481a[_0x895a('0x2d')]!=='VIRTUAL'){var _0x241d31={};_0x241d31[_0x5c481a[_0x895a('0x28')]]={'$like':'%'+_0x49d585[_0x895a('0x32')][_0x895a('0x3b')]+'%'};return _0x241d31;}})});}_0x46267f=_[_0x895a('0x3c')]({},_0x46267f,_0x49d585[_0x895a('0x3d')]);var _0x3e0ebd={'where':_0x46267f['where']};return db[_0x895a('0x2b')]['count'](_0x3e0ebd)['then'](function(_0x167fac){_0x2133f4[_0x895a('0x1e')]=_0x167fac;if(_0x49d585[_0x895a('0x32')]['includeAll']){_0x46267f['include']=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x46267f);})[_0x895a('0x24')](function(_0x200f2e){_0x2133f4['rows']=_0x200f2e;return _0x2133f4;})[_0x895a('0x24')](respondWithFilteredResult(_0x19529f,_0x46267f))['catch'](handleError(_0x19529f,null));};exports[_0x895a('0x3e')]=function(_0x3de1cd,_0x56e5ab){var _0x13b91a={'raw':![],'where':{'id':_0x3de1cd[_0x895a('0x3f')]['id']}},_0x4fd007={};_0x4fd007[_0x895a('0x2f')]=_[_0x895a('0x30')](db[_0x895a('0x2b')]['rawAttributes']);_0x4fd007[_0x895a('0x32')]=_[_0x895a('0x30')](_0x3de1cd[_0x895a('0x32')]);_0x4fd007[_0x895a('0x31')]=_[_0x895a('0x33')](_0x4fd007[_0x895a('0x2f')],_0x4fd007[_0x895a('0x32')]);_0x13b91a[_0x895a('0x35')]=_['intersection'](_0x4fd007[_0x895a('0x2f')],qs[_0x895a('0x34')](_0x3de1cd[_0x895a('0x32')][_0x895a('0x34')]));_0x13b91a[_0x895a('0x35')]=_0x13b91a[_0x895a('0x35')][_0x895a('0x36')]?_0x13b91a[_0x895a('0x35')]:_0x4fd007[_0x895a('0x2f')];if(_0x3de1cd[_0x895a('0x32')][_0x895a('0x40')]){_0x13b91a[_0x895a('0x41')]=[{'all':!![]}];}_0x13b91a=_[_0x895a('0x3c')]({},_0x13b91a,_0x3de1cd['options']);return db[_0x895a('0x2b')][_0x895a('0x42')](_0x13b91a)[_0x895a('0x24')](handleEntityNotFound(_0x56e5ab,null))['then'](respondWithResult(_0x56e5ab,null))['catch'](handleError(_0x56e5ab,null));};exports[_0x895a('0x43')]=function(_0x44fa9e,_0x3c74a5){return db[_0x895a('0x2b')]['create'](_0x44fa9e[_0x895a('0x44')],{})[_0x895a('0x24')](respondWithResult(_0x3c74a5,0xc9))[_0x895a('0x45')](handleError(_0x3c74a5,null));};exports['update']=function(_0x242605,_0x13e61e){if(_0x242605[_0x895a('0x44')]['id']){delete _0x242605[_0x895a('0x44')]['id'];}return db[_0x895a('0x2b')]['find']({'where':{'id':_0x242605['params']['id']}})[_0x895a('0x24')](handleEntityNotFound(_0x13e61e,null))[_0x895a('0x24')](saveUpdates(_0x242605[_0x895a('0x44')],null))[_0x895a('0x24')](respondWithResult(_0x13e61e,null))['catch'](handleError(_0x13e61e,null));};exports[_0x895a('0x25')]=function(_0x461fc5,_0xb0c00a){return db['FreshsalesConfiguration'][_0x895a('0x42')]({'where':{'id':_0x461fc5[_0x895a('0x3f')]['id']}})['then'](handleEntityNotFound(_0xb0c00a,null))[_0x895a('0x24')](removeEntity(_0xb0c00a,null))[_0x895a('0x45')](handleError(_0xb0c00a,null));};exports[_0x895a('0x46')]=function(_0x28a75e,_0x293f1f,_0x3ab431){var _0x5bda7d={};var _0x26f985={};var _0x5bea05;var _0x4eabca;return db[_0x895a('0x2b')][_0x895a('0x47')]({'where':{'id':_0x28a75e[_0x895a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x293f1f,null))['then'](function(_0x550d36){if(_0x550d36){_0x5bea05=_0x550d36;_0x26f985[_0x895a('0x2f')]=_[_0x895a('0x30')](db['FreshsalesField'][_0x895a('0x48')]);_0x26f985[_0x895a('0x32')]=_[_0x895a('0x30')](_0x28a75e['query']);_0x26f985[_0x895a('0x31')]=_[_0x895a('0x33')](_0x26f985['model'],_0x26f985[_0x895a('0x32')]);_0x5bda7d[_0x895a('0x35')]=_[_0x895a('0x33')](_0x26f985[_0x895a('0x2f')],qs[_0x895a('0x34')](_0x28a75e[_0x895a('0x32')][_0x895a('0x34')]));_0x5bda7d['attributes']=_0x5bda7d[_0x895a('0x35')][_0x895a('0x36')]?_0x5bda7d[_0x895a('0x35')]:_0x26f985[_0x895a('0x2f')];_0x5bda7d[_0x895a('0x38')]=qs['sort'](_0x28a75e[_0x895a('0x32')][_0x895a('0x39')]);_0x5bda7d['where']=qs[_0x895a('0x31')](_['pick'](_0x28a75e[_0x895a('0x32')],_0x26f985[_0x895a('0x31')]));if(_0x28a75e[_0x895a('0x32')][_0x895a('0x3b')]){_0x5bda7d['where']=_[_0x895a('0x3c')](_0x5bda7d[_0x895a('0x3a')],{'$or':_[_0x895a('0x2a')](_0x5bda7d[_0x895a('0x35')],function(_0x3fd2e7){var _0x31ef06={};_0x31ef06[_0x3fd2e7]={'$like':'%'+_0x28a75e['query'][_0x895a('0x3b')]+'%'};return _0x31ef06;})});}_0x5bda7d=_[_0x895a('0x3c')]({},_0x5bda7d,_0x28a75e['options']);return _0x5bea05[_0x895a('0x46')](_0x5bda7d);}})[_0x895a('0x24')](function(_0x5c3a9b){if(_0x5c3a9b){_0x4eabca=_0x5c3a9b[_0x895a('0x36')];if(!_0x28a75e[_0x895a('0x32')][_0x895a('0x49')]('nolimit')){_0x5bda7d[_0x895a('0x1d')]=qs[_0x895a('0x1d')](_0x28a75e[_0x895a('0x32')][_0x895a('0x1d')]);_0x5bda7d['offset']=qs['offset'](_0x28a75e[_0x895a('0x32')]['offset']);}return _0x5bea05[_0x895a('0x46')](_0x5bda7d);}})[_0x895a('0x24')](function(_0x333f36){if(_0x333f36){return _0x333f36?{'count':_0x4eabca,'rows':_0x333f36}:null;}})['then'](respondWithResult(_0x293f1f,null))[_0x895a('0x45')](handleError(_0x293f1f,null));};exports[_0x895a('0x4a')]=function(_0x401753,_0x3aeeff,_0x4bf621){var _0x1d995e={};var _0x1c1cab={};var _0x34ea61;var _0x2f686d;return db[_0x895a('0x2b')][_0x895a('0x47')]({'where':{'id':_0x401753[_0x895a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3aeeff,null))[_0x895a('0x24')](function(_0x4ccde6){if(_0x4ccde6){_0x34ea61=_0x4ccde6;_0x1c1cab[_0x895a('0x2f')]=_[_0x895a('0x30')](db['FreshsalesField']['rawAttributes']);_0x1c1cab[_0x895a('0x32')]=_[_0x895a('0x30')](_0x401753[_0x895a('0x32')]);_0x1c1cab[_0x895a('0x31')]=_['intersection'](_0x1c1cab['model'],_0x1c1cab[_0x895a('0x32')]);_0x1d995e[_0x895a('0x35')]=_[_0x895a('0x33')](_0x1c1cab['model'],qs[_0x895a('0x34')](_0x401753[_0x895a('0x32')]['fields']));_0x1d995e['attributes']=_0x1d995e[_0x895a('0x35')][_0x895a('0x36')]?_0x1d995e['attributes']:_0x1c1cab[_0x895a('0x2f')];_0x1d995e[_0x895a('0x38')]=qs['sort'](_0x401753['query'][_0x895a('0x39')]);_0x1d995e[_0x895a('0x3a')]=qs[_0x895a('0x31')](_[_0x895a('0x4b')](_0x401753[_0x895a('0x32')],_0x1c1cab[_0x895a('0x31')]));if(_0x401753[_0x895a('0x32')]['filter']){_0x1d995e[_0x895a('0x3a')]=_['merge'](_0x1d995e[_0x895a('0x3a')],{'$or':_['map'](_0x1d995e[_0x895a('0x35')],function(_0x20a4e9){var _0x419d1b={};_0x419d1b[_0x20a4e9]={'$like':'%'+_0x401753[_0x895a('0x32')][_0x895a('0x3b')]+'%'};return _0x419d1b;})});}_0x1d995e=_[_0x895a('0x3c')]({},_0x1d995e,_0x401753[_0x895a('0x3d')]);return _0x34ea61[_0x895a('0x4a')](_0x1d995e);}})[_0x895a('0x24')](function(_0x580e4a){if(_0x580e4a){_0x2f686d=_0x580e4a[_0x895a('0x36')];if(!_0x401753[_0x895a('0x32')][_0x895a('0x49')]('nolimit')){_0x1d995e[_0x895a('0x1d')]=qs[_0x895a('0x1d')](_0x401753['query']['limit']);_0x1d995e[_0x895a('0x1b')]=qs[_0x895a('0x1b')](_0x401753['query'][_0x895a('0x1b')]);}return _0x34ea61[_0x895a('0x4a')](_0x1d995e);}})[_0x895a('0x24')](function(_0x38fb17){if(_0x38fb17){return _0x38fb17?{'count':_0x2f686d,'rows':_0x38fb17}:null;}})[_0x895a('0x24')](respondWithResult(_0x3aeeff,null))[_0x895a('0x45')](handleError(_0x3aeeff,null));};exports[_0x895a('0x4c')]=function(_0x8abd36,_0x317405,_0x14d100){var _0x2f7750={};var _0x292357={};var _0x296a35;var _0x173a1c;return db[_0x895a('0x2b')][_0x895a('0x47')]({'where':{'id':_0x8abd36[_0x895a('0x3f')]['id']}})[_0x895a('0x24')](handleEntityNotFound(_0x317405,null))[_0x895a('0x24')](function(_0x419a4c){if(_0x419a4c){_0x296a35=_0x419a4c;_0x292357[_0x895a('0x2f')]=_[_0x895a('0x30')](db['FreshsalesField'][_0x895a('0x48')]);_0x292357[_0x895a('0x32')]=_[_0x895a('0x30')](_0x8abd36['query']);_0x292357[_0x895a('0x31')]=_[_0x895a('0x33')](_0x292357['model'],_0x292357[_0x895a('0x32')]);_0x2f7750['attributes']=_[_0x895a('0x33')](_0x292357[_0x895a('0x2f')],qs[_0x895a('0x34')](_0x8abd36[_0x895a('0x32')][_0x895a('0x34')]));_0x2f7750[_0x895a('0x35')]=_0x2f7750[_0x895a('0x35')][_0x895a('0x36')]?_0x2f7750[_0x895a('0x35')]:_0x292357[_0x895a('0x2f')];_0x2f7750[_0x895a('0x38')]=qs[_0x895a('0x39')](_0x8abd36[_0x895a('0x32')]['sort']);_0x2f7750['where']=qs[_0x895a('0x31')](_[_0x895a('0x4b')](_0x8abd36['query'],_0x292357[_0x895a('0x31')]));if(_0x8abd36['query'][_0x895a('0x3b')]){_0x2f7750[_0x895a('0x3a')]=_[_0x895a('0x3c')](_0x2f7750[_0x895a('0x3a')],{'$or':_[_0x895a('0x2a')](_0x2f7750[_0x895a('0x35')],function(_0x1ce3af){var _0x4cddb0={};_0x4cddb0[_0x1ce3af]={'$like':'%'+_0x8abd36[_0x895a('0x32')]['filter']+'%'};return _0x4cddb0;})});}_0x2f7750=_[_0x895a('0x3c')]({},_0x2f7750,_0x8abd36[_0x895a('0x3d')]);return _0x296a35[_0x895a('0x4c')](_0x2f7750);}})[_0x895a('0x24')](function(_0x2f64c8){if(_0x2f64c8){_0x173a1c=_0x2f64c8['length'];if(!_0x8abd36[_0x895a('0x32')][_0x895a('0x49')](_0x895a('0x37'))){_0x2f7750[_0x895a('0x1d')]=qs[_0x895a('0x1d')](_0x8abd36[_0x895a('0x32')][_0x895a('0x1d')]);_0x2f7750[_0x895a('0x1b')]=qs[_0x895a('0x1b')](_0x8abd36['query'][_0x895a('0x1b')]);}return _0x296a35[_0x895a('0x4c')](_0x2f7750);}})[_0x895a('0x24')](function(_0x409939){if(_0x409939){return _0x409939?{'count':_0x173a1c,'rows':_0x409939}:null;}})[_0x895a('0x24')](respondWithResult(_0x317405,null))[_0x895a('0x45')](handleError(_0x317405,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 9a9e06f..a82eb18 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 _0xfe76=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','int_freshsales_configurations'];(function(_0x42ded1,_0xa8e7ff){var _0x44d966=function(_0x537645){while(--_0x537645){_0x42ded1['push'](_0x42ded1['shift']());}};_0x44d966(++_0xa8e7ff);}(_0xfe76,0xd1));var _0x6fe7=function(_0x1b5a5a,_0x1c3b75){_0x1b5a5a=_0x1b5a5a-0x0;var _0x42b32d=_0xfe76[_0x1b5a5a];return _0x42b32d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6fe7('0x0'))(_0x6fe7('0x1'));var moment=require(_0x6fe7('0x2'));var BPromise=require('bluebird');var rp=require(_0x6fe7('0x3'));var fs=require('fs');var path=require(_0x6fe7('0x4'));var rimraf=require(_0x6fe7('0x5'));var config=require(_0x6fe7('0x6'));var attributes=require(_0x6fe7('0x7'));module[_0x6fe7('0x8')]=function(_0x43d106,_0x117fd5){return _0x43d106['define'](_0x6fe7('0x9'),attributes,{'tableName':_0x6fe7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b6b=['bluebird','request-promise','rimraf','../../config/environment','exports','define','int_freshsales_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0b6b,0x1b7));var _0xb0b6=function(_0x189305,_0x46c43f){_0x189305=_0x189305-0x0;var _0xea3406=_0x0b6b[_0x189305];return _0xea3406;};'use strict';var _=require(_0xb0b6('0x0'));var util=require(_0xb0b6('0x1'));var logger=require(_0xb0b6('0x2'))(_0xb0b6('0x3'));var moment=require(_0xb0b6('0x4'));var BPromise=require(_0xb0b6('0x5'));var rp=require(_0xb0b6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb0b6('0x7'));var config=require(_0xb0b6('0x8'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xb0b6('0x9')]=function(_0x17443e,_0x47a972){return _0x17443e[_0xb0b6('0xa')]('FreshsalesConfiguration',attributes,{'tableName':_0xb0b6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 9684a16..af59014 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 _0xecfd=['bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','util','moment'];(function(_0x11be6e,_0x170a9f){var _0x3297d4=function(_0x354d1d){while(--_0x354d1d){_0x11be6e['push'](_0x11be6e['shift']());}};_0x3297d4(++_0x170a9f);}(_0xecfd,0x142));var _0xdecf=function(_0xc0f10a,_0x3a2702){_0xc0f10a=_0xc0f10a-0x0;var _0x2c8ab6=_0xecfd[_0xc0f10a];return _0x2c8ab6;};'use strict';var _=require('lodash');var util=require(_0xdecf('0x0'));var moment=require(_0xdecf('0x1'));var BPromise=require(_0xdecf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdecf('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xdecf('0x4'))(_0xdecf('0x5'));var config=require(_0xdecf('0x6'));var jayson=require(_0xdecf('0x7'));var client=jayson[_0xdecf('0x8')][_0xdecf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3056fa,_0x322f23,_0x557066){return new BPromise(function(_0x2dbc32,_0x23ccd1){return client['request'](_0x3056fa,_0x557066)[_0xdecf('0xa')](function(_0x331257){logger[_0xdecf('0xb')](_0xdecf('0xc'),_0x322f23,_0xdecf('0xd'));logger['debug'](_0xdecf('0xe'),_0x322f23,_0xdecf('0xd'),JSON['stringify'](_0x331257));if(_0x331257[_0xdecf('0xf')]){if(_0x331257[_0xdecf('0xf')][_0xdecf('0x10')]===0x1f4){logger[_0xdecf('0xf')](_0xdecf('0xc'),_0x322f23,_0x331257[_0xdecf('0xf')][_0xdecf('0x11')]);return _0x23ccd1(_0x331257['error']['message']);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x322f23,_0x331257[_0xdecf('0xf')][_0xdecf('0x11')]);return _0x2dbc32(_0x331257[_0xdecf('0xf')][_0xdecf('0x11')]);}else{logger[_0xdecf('0xb')](_0xdecf('0xc'),_0x322f23,_0xdecf('0xd'));_0x2dbc32(_0x331257['result']['message']);}})['catch'](function(_0x5de74f){logger[_0xdecf('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x322f23,_0x5de74f);_0x23ccd1(_0x5de74f);});});} \ No newline at end of file +var _0xfefc=['info','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then'];(function(_0x2db63a,_0x52ee8e){var _0x556b91=function(_0x4ad3aa){while(--_0x4ad3aa){_0x2db63a['push'](_0x2db63a['shift']());}};_0x556b91(++_0x52ee8e);}(_0xfefc,0x185));var _0xcfef=function(_0x163796,_0x157405){_0x163796=_0x163796-0x0;var _0xe0b76c=_0xfefc[_0x163796];return _0xe0b76c;};'use strict';var _=require(_0xcfef('0x0'));var util=require(_0xcfef('0x1'));var moment=require(_0xcfef('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcfef('0x3'));var db=require(_0xcfef('0x4'))['db'];var utils=require(_0xcfef('0x5'));var logger=require(_0xcfef('0x6'))('rpc');var config=require(_0xcfef('0x7'));var jayson=require(_0xcfef('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3afd7c,_0x1d0aaa,_0x3a18a9){return new BPromise(function(_0x31280a,_0x56ddd5){return client[_0xcfef('0x9')](_0x3afd7c,_0x3a18a9)[_0xcfef('0xa')](function(_0x378049){logger[_0xcfef('0xb')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1d0aaa,'request\x20sent');logger['debug'](_0xcfef('0xc'),_0x1d0aaa,_0xcfef('0xd'),JSON['stringify'](_0x378049));if(_0x378049['error']){if(_0x378049[_0xcfef('0xe')][_0xcfef('0xf')]===0x1f4){logger[_0xcfef('0xe')](_0xcfef('0x10'),_0x1d0aaa,_0x378049[_0xcfef('0xe')][_0xcfef('0x11')]);return _0x56ddd5(_0x378049[_0xcfef('0xe')]['message']);}logger[_0xcfef('0xe')](_0xcfef('0x10'),_0x1d0aaa,_0x378049[_0xcfef('0xe')][_0xcfef('0x11')]);return _0x31280a(_0x378049['error'][_0xcfef('0x11')]);}else{logger[_0xcfef('0xb')](_0xcfef('0x10'),_0x1d0aaa,_0xcfef('0xd'));_0x31280a(_0x378049[_0xcfef('0x12')][_0xcfef('0x11')]);}})[_0xcfef('0x13')](function(_0x413e10){logger[_0xcfef('0xe')](_0xcfef('0x10'),_0x1d0aaa,_0x413e10);_0x56ddd5(_0x413e10);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 2b46e8e..ba6cbab 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 _0x58a7=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete'];(function(_0x518a2e,_0x2c6716){var _0x450303=function(_0x28c855){while(--_0x28c855){_0x518a2e['push'](_0x518a2e['shift']());}};_0x450303(++_0x2c6716);}(_0x58a7,0xf7));var _0x758a=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x58a7[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x758a('0x0'));var util=require(_0x758a('0x1'));var path=require(_0x758a('0x2'));var timeout=require(_0x758a('0x3'));var express=require(_0x758a('0x4'));var router=express[_0x758a('0x5')]();var fs_extra=require(_0x758a('0x6'));var auth=require(_0x758a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x758a('0x8'));var controller=require(_0x758a('0x9'));router[_0x758a('0xa')]('/',auth[_0x758a('0xb')](),controller['index']);router['get'](_0x758a('0xc'),auth['isAuthenticated'](),controller[_0x758a('0xd')]);router[_0x758a('0xe')]('/',auth[_0x758a('0xb')](),controller[_0x758a('0xf')]);router[_0x758a('0x10')](_0x758a('0xc'),auth[_0x758a('0xb')](),controller[_0x758a('0x11')]);router[_0x758a('0x12')](_0x758a('0xc'),auth[_0x758a('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x833b=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','util'];(function(_0x5aaf02,_0x7793a0){var _0x155025=function(_0x5f51c8){while(--_0x5f51c8){_0x5aaf02['push'](_0x5aaf02['shift']());}};_0x155025(++_0x7793a0);}(_0x833b,0x131));var _0xb833=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x833b[_0x17406a];return _0x1501ff;};'use strict';var multer=require('multer');var util=require(_0xb833('0x0'));var path=require('path');var timeout=require(_0xb833('0x1'));var express=require('express');var router=express[_0xb833('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xb833('0x3'));var interaction=require(_0xb833('0x4'));var config=require(_0xb833('0x5'));var controller=require(_0xb833('0x6'));router[_0xb833('0x7')]('/',auth[_0xb833('0x8')](),controller[_0xb833('0x9')]);router['get'](_0xb833('0xa'),auth[_0xb833('0x8')](),controller[_0xb833('0xb')]);router[_0xb833('0xc')]('/',auth[_0xb833('0x8')](),controller[_0xb833('0xd')]);router[_0xb833('0xe')]('/:id',auth[_0xb833('0x8')](),controller['update']);router[_0xb833('0xf')](_0xb833('0xa'),auth[_0xb833('0x8')](),controller[_0xb833('0x10')]);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 49dbc9a..bd8ed24 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 _0xc0b4=['ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN','exports'];(function(_0x393a18,_0x537ebf){var _0x446786=function(_0x4c43df){while(--_0x4c43df){_0x393a18['push'](_0x393a18['shift']());}};_0x446786(++_0x537ebf);}(_0xc0b4,0x1d7));var _0x4c0b=function(_0x5274c6,_0x14eb65){_0x5274c6=_0x5274c6-0x0;var _0x36dd32=_0xc0b4[_0x5274c6];return _0x36dd32;};'use strict';var Sequelize=require('sequelize');module[_0x4c0b('0x0')]={'type':{'type':Sequelize[_0x4c0b('0x1')](_0x4c0b('0x2'),_0x4c0b('0x3'),_0x4c0b('0x4'),'keyValue',_0x4c0b('0x5')),'defaultValue':_0x4c0b('0x2')},'content':{'type':Sequelize[_0x4c0b('0x6')]},'key':{'type':Sequelize[_0x4c0b('0x6')]},'keyType':{'type':Sequelize[_0x4c0b('0x1')]('string',_0x4c0b('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x4c0b('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4c0b('0x6')]},'customField':{'type':Sequelize[_0x4c0b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4c0b('0x6')]}}; \ No newline at end of file +var _0x3a68=['string','STRING','variable','BOOLEAN','exports','ENUM','customVariable','keyValue','picklist'];(function(_0x1e5189,_0x3b9660){var _0x468f18=function(_0x5ea5b2){while(--_0x5ea5b2){_0x1e5189['push'](_0x1e5189['shift']());}};_0x468f18(++_0x3b9660);}(_0x3a68,0x1c6));var _0x83a6=function(_0x3b92d6,_0x14af6b){_0x3b92d6=_0x3b92d6-0x0;var _0x138d74=_0x3a68[_0x3b92d6];return _0x138d74;};'use strict';var Sequelize=require('sequelize');module[_0x83a6('0x0')]={'type':{'type':Sequelize[_0x83a6('0x1')]('string','variable',_0x83a6('0x2'),_0x83a6('0x3'),_0x83a6('0x4')),'defaultValue':_0x83a6('0x5')},'content':{'type':Sequelize[_0x83a6('0x6')]},'key':{'type':Sequelize[_0x83a6('0x6')]},'keyType':{'type':Sequelize[_0x83a6('0x1')](_0x83a6('0x5'),_0x83a6('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x83a6('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x83a6('0x6')]},'customField':{'type':Sequelize[_0x83a6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x83a6('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index b87e09c..887c24b 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 _0x4281=['find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','create','body'];(function(_0x59befa,_0x4af99b){var _0x1dd63d=function(_0x4c1df4){while(--_0x4c1df4){_0x59befa['push'](_0x59befa['shift']());}};_0x1dd63d(++_0x4af99b);}(_0x4281,0x18c));var _0x1428=function(_0x55a89e,_0x1a05ab){_0x55a89e=_0x55a89e-0x0;var _0x3aa2bd=_0x4281[_0x55a89e];return _0x3aa2bd;};'use strict';var emlformat=require(_0x1428('0x0'));var rimraf=require(_0x1428('0x1'));var zipdir=require(_0x1428('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1428('0x3'));var moment=require(_0x1428('0x4'));var BPromise=require(_0x1428('0x5'));var Mustache=require(_0x1428('0x6'));var util=require(_0x1428('0x7'));var path=require(_0x1428('0x8'));var sox=require(_0x1428('0x9'));var csv=require(_0x1428('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1428('0xb'));var _=require(_0x1428('0xc'));var squel=require(_0x1428('0xd'));var crypto=require(_0x1428('0xe'));var jsforce=require(_0x1428('0xf'));var deskjs=require(_0x1428('0x10'));var toCsv=require(_0x1428('0xa'));var querystring=require('querystring');var Papa=require(_0x1428('0x11'));var Redis=require('ioredis');var authService=require(_0x1428('0x12'));var qs=require(_0x1428('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1428('0x14'));var logger=require(_0x1428('0x15'))(_0x1428('0x16'));var utils=require(_0x1428('0x17'));var config=require(_0x1428('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1428('0x19'))['db'];function respondWithStatusCode(_0x4b6070,_0x1b27cb){_0x1b27cb=_0x1b27cb||0xcc;return function(_0x58c429){if(_0x58c429){return _0x4b6070[_0x1428('0x1a')](_0x1b27cb);}return _0x4b6070[_0x1428('0x1b')](_0x1b27cb)[_0x1428('0x1c')]();};}function respondWithResult(_0x18b9f1,_0x14436d){_0x14436d=_0x14436d||0xc8;return function(_0x218baf){if(_0x218baf){return _0x18b9f1['status'](_0x14436d)[_0x1428('0x1d')](_0x218baf);}};}function respondWithFilteredResult(_0x5b4a31,_0x4c57b0){return function(_0x3a6559){if(_0x3a6559){var _0x185577=typeof _0x4c57b0[_0x1428('0x1e')]===_0x1428('0x1f')&&typeof _0x4c57b0[_0x1428('0x20')]===_0x1428('0x1f');var _0x52ced8=_0x3a6559['count'];var _0x435944=_0x185577?0x0:_0x4c57b0['offset'];var _0x1a4b1f=_0x185577?_0x3a6559['count']:_0x4c57b0[_0x1428('0x1e')]+_0x4c57b0['limit'];var _0x3b4723;if(_0x1a4b1f>=_0x52ced8){_0x1a4b1f=_0x52ced8;_0x3b4723=0xc8;}else{_0x3b4723=0xce;}_0x5b4a31[_0x1428('0x1b')](_0x3b4723);return _0x5b4a31['set'](_0x1428('0x21'),_0x435944+'-'+_0x1a4b1f+'/'+_0x52ced8)[_0x1428('0x1d')](_0x3a6559);}return null;};}function patchUpdates(_0x190945){return function(_0x943b70){try{jsonpatch[_0x1428('0x22')](_0x943b70,_0x190945,!![]);}catch(_0x414ab0){return BPromise[_0x1428('0x23')](_0x414ab0);}return _0x943b70[_0x1428('0x24')]();};}function saveUpdates(_0x30f9e0,_0x202351){return function(_0x16c8cf){if(_0x16c8cf){return _0x16c8cf[_0x1428('0x25')](_0x30f9e0)['then'](function(_0x377277){return _0x377277;});}return null;};}function removeEntity(_0x3f7b7b,_0x57d8e0){return function(_0xfce630){if(_0xfce630){return _0xfce630[_0x1428('0x26')]()[_0x1428('0x27')](function(){_0x3f7b7b[_0x1428('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x478e7d,_0x522f3e){return function(_0x1025f7){if(!_0x1025f7){_0x478e7d['sendStatus'](0x194);}return _0x1025f7;};}function handleError(_0x400604,_0x3f0be9){_0x3f0be9=_0x3f0be9||0x1f4;return function(_0x3a2046){logger[_0x1428('0x28')](_0x3a2046[_0x1428('0x29')]);if(_0x3a2046[_0x1428('0x2a')]){delete _0x3a2046['name'];}_0x400604[_0x1428('0x1b')](_0x3f0be9)[_0x1428('0x2b')](_0x3a2046);};}exports[_0x1428('0x2c')]=function(_0xbd4f1b,_0x3a4dd3){var _0x373d11={},_0x421eb5={},_0x54c99c={'count':0x0,'rows':[]};var _0x5c64a8=_[_0x1428('0x2d')](db[_0x1428('0x2e')][_0x1428('0x2f')],function(_0x15ae23){return{'name':_0x15ae23[_0x1428('0x30')],'type':_0x15ae23[_0x1428('0x31')][_0x1428('0x32')]};});_0x421eb5[_0x1428('0x33')]=_[_0x1428('0x2d')](_0x5c64a8,_0x1428('0x2a'));_0x421eb5[_0x1428('0x34')]=_[_0x1428('0x35')](_0xbd4f1b[_0x1428('0x34')]);_0x421eb5[_0x1428('0x36')]=_[_0x1428('0x37')](_0x421eb5[_0x1428('0x33')],_0x421eb5[_0x1428('0x34')]);_0x373d11[_0x1428('0x38')]=_['intersection'](_0x421eb5[_0x1428('0x33')],qs[_0x1428('0x39')](_0xbd4f1b[_0x1428('0x34')]['fields']));_0x373d11['attributes']=_0x373d11[_0x1428('0x38')][_0x1428('0x3a')]?_0x373d11[_0x1428('0x38')]:_0x421eb5[_0x1428('0x33')];if(!_0xbd4f1b[_0x1428('0x34')][_0x1428('0x3b')](_0x1428('0x3c'))){_0x373d11[_0x1428('0x20')]=qs[_0x1428('0x20')](_0xbd4f1b[_0x1428('0x34')][_0x1428('0x20')]);_0x373d11['offset']=qs[_0x1428('0x1e')](_0xbd4f1b[_0x1428('0x34')][_0x1428('0x1e')]);}_0x373d11[_0x1428('0x3d')]=qs[_0x1428('0x3e')](_0xbd4f1b[_0x1428('0x34')][_0x1428('0x3e')]);_0x373d11[_0x1428('0x3f')]=qs['filters'](_[_0x1428('0x40')](_0xbd4f1b[_0x1428('0x34')],_0x421eb5[_0x1428('0x36')]),_0x5c64a8);if(_0xbd4f1b[_0x1428('0x34')]['filter']){_0x373d11[_0x1428('0x3f')]=_['merge'](_0x373d11[_0x1428('0x3f')],{'$or':_[_0x1428('0x2d')](_0x5c64a8,function(_0x5a7392){if(_0x5a7392[_0x1428('0x31')]!==_0x1428('0x41')){var _0x22cbed={};_0x22cbed[_0x5a7392[_0x1428('0x2a')]]={'$like':'%'+_0xbd4f1b[_0x1428('0x34')][_0x1428('0x42')]+'%'};return _0x22cbed;}})});}_0x373d11=_['merge']({},_0x373d11,_0xbd4f1b[_0x1428('0x43')]);var _0x275f63={'where':_0x373d11[_0x1428('0x3f')]};return db['FreshsalesField']['count'](_0x275f63)[_0x1428('0x27')](function(_0x51e117){_0x54c99c['count']=_0x51e117;if(_0xbd4f1b[_0x1428('0x34')][_0x1428('0x44')]){_0x373d11[_0x1428('0x45')]=[{'all':!![]}];}return db['FreshsalesField'][_0x1428('0x46')](_0x373d11);})['then'](function(_0x25d131){_0x54c99c[_0x1428('0x47')]=_0x25d131;return _0x54c99c;})[_0x1428('0x27')](respondWithFilteredResult(_0x3a4dd3,_0x373d11))[_0x1428('0x48')](handleError(_0x3a4dd3,null));};exports[_0x1428('0x49')]=function(_0xeec05,_0x3d406c){var _0x36c9ee={'raw':!![],'where':{'id':_0xeec05[_0x1428('0x4a')]['id']}},_0x516427={};_0x516427[_0x1428('0x33')]=_[_0x1428('0x35')](db[_0x1428('0x2e')]['rawAttributes']);_0x516427[_0x1428('0x34')]=_[_0x1428('0x35')](_0xeec05[_0x1428('0x34')]);_0x516427[_0x1428('0x36')]=_[_0x1428('0x37')](_0x516427[_0x1428('0x33')],_0x516427['query']);_0x36c9ee[_0x1428('0x38')]=_[_0x1428('0x37')](_0x516427['model'],qs[_0x1428('0x39')](_0xeec05['query'][_0x1428('0x39')]));_0x36c9ee['attributes']=_0x36c9ee[_0x1428('0x38')][_0x1428('0x3a')]?_0x36c9ee[_0x1428('0x38')]:_0x516427[_0x1428('0x33')];if(_0xeec05[_0x1428('0x34')][_0x1428('0x44')]){_0x36c9ee[_0x1428('0x45')]=[{'all':!![]}];}_0x36c9ee=_[_0x1428('0x4b')]({},_0x36c9ee,_0xeec05[_0x1428('0x43')]);return db[_0x1428('0x2e')]['find'](_0x36c9ee)[_0x1428('0x27')](handleEntityNotFound(_0x3d406c,null))[_0x1428('0x27')](respondWithResult(_0x3d406c,null))['catch'](handleError(_0x3d406c,null));};exports[_0x1428('0x4c')]=function(_0x1e270e,_0x167f3d){return db[_0x1428('0x2e')][_0x1428('0x4c')](_0x1e270e['body'],{})['then'](respondWithResult(_0x167f3d,0xc9))[_0x1428('0x48')](handleError(_0x167f3d,null));};exports[_0x1428('0x25')]=function(_0x3d60ab,_0x3fc568){if(_0x3d60ab[_0x1428('0x4d')]['id']){delete _0x3d60ab[_0x1428('0x4d')]['id'];}return db[_0x1428('0x2e')][_0x1428('0x4e')]({'where':{'id':_0x3d60ab[_0x1428('0x4a')]['id']}})[_0x1428('0x27')](handleEntityNotFound(_0x3fc568,null))[_0x1428('0x27')](saveUpdates(_0x3d60ab[_0x1428('0x4d')],null))[_0x1428('0x27')](respondWithResult(_0x3fc568,null))['catch'](handleError(_0x3fc568,null));};exports[_0x1428('0x26')]=function(_0x211650,_0x1aaa86){return db[_0x1428('0x2e')][_0x1428('0x4e')]({'where':{'id':_0x211650[_0x1428('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1aaa86,null))['then'](removeEntity(_0x1aaa86,null))[_0x1428('0x48')](handleError(_0x1aaa86,null));}; \ No newline at end of file +var _0xed08=['find','params','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','error','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','then','includeAll','findAll','rows','length','include','catch','create','body'];(function(_0x532e19,_0x74ad39){var _0x189286=function(_0x33dd07){while(--_0x33dd07){_0x532e19['push'](_0x532e19['shift']());}};_0x189286(++_0x74ad39);}(_0xed08,0x165));var _0x8ed0=function(_0x3bea5a,_0x4cda93){_0x3bea5a=_0x3bea5a-0x0;var _0x4a9cb3=_0xed08[_0x3bea5a];return _0x4a9cb3;};'use strict';var emlformat=require(_0x8ed0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8ed0('0x1'));var rp=require(_0x8ed0('0x2'));var moment=require(_0x8ed0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8ed0('0x4'));var util=require(_0x8ed0('0x5'));var path=require(_0x8ed0('0x6'));var sox=require('sox');var csv=require(_0x8ed0('0x7'));var ejs=require(_0x8ed0('0x8'));var fs=require('fs');var fs_extra=require(_0x8ed0('0x9'));var _=require(_0x8ed0('0xa'));var squel=require(_0x8ed0('0xb'));var crypto=require(_0x8ed0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8ed0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8ed0('0xe'));var Papa=require(_0x8ed0('0xf'));var Redis=require(_0x8ed0('0x10'));var authService=require(_0x8ed0('0x11'));var qs=require(_0x8ed0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8ed0('0x13'));var logger=require(_0x8ed0('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8ed0('0x15'))['db'];function respondWithStatusCode(_0x337780,_0x2f5226){_0x2f5226=_0x2f5226||0xcc;return function(_0x5a5a80){if(_0x5a5a80){return _0x337780[_0x8ed0('0x16')](_0x2f5226);}return _0x337780[_0x8ed0('0x17')](_0x2f5226)['end']();};}function respondWithResult(_0x559b0e,_0x49ba5c){_0x49ba5c=_0x49ba5c||0xc8;return function(_0x478f7e){if(_0x478f7e){return _0x559b0e['status'](_0x49ba5c)[_0x8ed0('0x18')](_0x478f7e);}};}function respondWithFilteredResult(_0x5851f5,_0x234546){return function(_0x5c3420){if(_0x5c3420){var _0x17546c=typeof _0x234546[_0x8ed0('0x19')]===_0x8ed0('0x1a')&&typeof _0x234546[_0x8ed0('0x1b')]===_0x8ed0('0x1a');var _0x308880=_0x5c3420[_0x8ed0('0x1c')];var _0x7140e7=_0x17546c?0x0:_0x234546[_0x8ed0('0x19')];var _0x2cc809=_0x17546c?_0x5c3420['count']:_0x234546['offset']+_0x234546[_0x8ed0('0x1b')];var _0x3bd25b;if(_0x2cc809>=_0x308880){_0x2cc809=_0x308880;_0x3bd25b=0xc8;}else{_0x3bd25b=0xce;}_0x5851f5['status'](_0x3bd25b);return _0x5851f5[_0x8ed0('0x1d')](_0x8ed0('0x1e'),_0x7140e7+'-'+_0x2cc809+'/'+_0x308880)['json'](_0x5c3420);}return null;};}function patchUpdates(_0x15d70c){return function(_0x299679){try{jsonpatch[_0x8ed0('0x1f')](_0x299679,_0x15d70c,!![]);}catch(_0x3726dd){return BPromise[_0x8ed0('0x20')](_0x3726dd);}return _0x299679['save']();};}function saveUpdates(_0x448ea9,_0x3b5393){return function(_0x2cfa52){if(_0x2cfa52){return _0x2cfa52[_0x8ed0('0x21')](_0x448ea9)['then'](function(_0x595e76){return _0x595e76;});}return null;};}function removeEntity(_0x4d9780,_0x1c7f7e){return function(_0xfac628){if(_0xfac628){return _0xfac628[_0x8ed0('0x22')]()['then'](function(){_0x4d9780['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x336f49,_0x15a6fb){return function(_0x25842c){if(!_0x25842c){_0x336f49['sendStatus'](0x194);}return _0x25842c;};}function handleError(_0x34003f,_0x23eb59){_0x23eb59=_0x23eb59||0x1f4;return function(_0x32be63){logger[_0x8ed0('0x23')](_0x32be63['stack']);if(_0x32be63['name']){delete _0x32be63['name'];}_0x34003f['status'](_0x23eb59)[_0x8ed0('0x24')](_0x32be63);};}exports[_0x8ed0('0x25')]=function(_0x26c3d7,_0x50d503){var _0x42755b={},_0x17f3e8={},_0x27b922={'count':0x0,'rows':[]};var _0x787bb6=_[_0x8ed0('0x26')](db[_0x8ed0('0x27')][_0x8ed0('0x28')],function(_0x4d50be){return{'name':_0x4d50be[_0x8ed0('0x29')],'type':_0x4d50be[_0x8ed0('0x2a')][_0x8ed0('0x2b')]};});_0x17f3e8[_0x8ed0('0x2c')]=_[_0x8ed0('0x26')](_0x787bb6,'name');_0x17f3e8[_0x8ed0('0x2d')]=_[_0x8ed0('0x2e')](_0x26c3d7[_0x8ed0('0x2d')]);_0x17f3e8[_0x8ed0('0x2f')]=_[_0x8ed0('0x30')](_0x17f3e8[_0x8ed0('0x2c')],_0x17f3e8[_0x8ed0('0x2d')]);_0x42755b[_0x8ed0('0x31')]=_['intersection'](_0x17f3e8[_0x8ed0('0x2c')],qs[_0x8ed0('0x32')](_0x26c3d7['query']['fields']));_0x42755b[_0x8ed0('0x31')]=_0x42755b[_0x8ed0('0x31')]['length']?_0x42755b[_0x8ed0('0x31')]:_0x17f3e8[_0x8ed0('0x2c')];if(!_0x26c3d7['query'][_0x8ed0('0x33')](_0x8ed0('0x34'))){_0x42755b[_0x8ed0('0x1b')]=qs['limit'](_0x26c3d7[_0x8ed0('0x2d')]['limit']);_0x42755b[_0x8ed0('0x19')]=qs['offset'](_0x26c3d7[_0x8ed0('0x2d')]['offset']);}_0x42755b[_0x8ed0('0x35')]=qs[_0x8ed0('0x36')](_0x26c3d7['query']['sort']);_0x42755b[_0x8ed0('0x37')]=qs[_0x8ed0('0x2f')](_[_0x8ed0('0x38')](_0x26c3d7[_0x8ed0('0x2d')],_0x17f3e8[_0x8ed0('0x2f')]),_0x787bb6);if(_0x26c3d7[_0x8ed0('0x2d')][_0x8ed0('0x39')]){_0x42755b[_0x8ed0('0x37')]=_[_0x8ed0('0x3a')](_0x42755b['where'],{'$or':_[_0x8ed0('0x26')](_0x787bb6,function(_0x3cc34b){if(_0x3cc34b['type']!=='VIRTUAL'){var _0x4e417e={};_0x4e417e[_0x3cc34b['name']]={'$like':'%'+_0x26c3d7[_0x8ed0('0x2d')][_0x8ed0('0x39')]+'%'};return _0x4e417e;}})});}_0x42755b=_['merge']({},_0x42755b,_0x26c3d7[_0x8ed0('0x3b')]);var _0x1ea5ac={'where':_0x42755b[_0x8ed0('0x37')]};return db[_0x8ed0('0x27')]['count'](_0x1ea5ac)[_0x8ed0('0x3c')](function(_0x4949fe){_0x27b922[_0x8ed0('0x1c')]=_0x4949fe;if(_0x26c3d7[_0x8ed0('0x2d')][_0x8ed0('0x3d')]){_0x42755b['include']=[{'all':!![]}];}return db['FreshsalesField'][_0x8ed0('0x3e')](_0x42755b);})[_0x8ed0('0x3c')](function(_0x3ce62b){_0x27b922[_0x8ed0('0x3f')]=_0x3ce62b;return _0x27b922;})[_0x8ed0('0x3c')](respondWithFilteredResult(_0x50d503,_0x42755b))['catch'](handleError(_0x50d503,null));};exports['show']=function(_0x7181a,_0x51320d){var _0x19c623={'raw':!![],'where':{'id':_0x7181a['params']['id']}},_0x3e9145={};_0x3e9145[_0x8ed0('0x2c')]=_[_0x8ed0('0x2e')](db[_0x8ed0('0x27')][_0x8ed0('0x28')]);_0x3e9145['query']=_[_0x8ed0('0x2e')](_0x7181a['query']);_0x3e9145['filters']=_[_0x8ed0('0x30')](_0x3e9145[_0x8ed0('0x2c')],_0x3e9145[_0x8ed0('0x2d')]);_0x19c623[_0x8ed0('0x31')]=_[_0x8ed0('0x30')](_0x3e9145['model'],qs[_0x8ed0('0x32')](_0x7181a[_0x8ed0('0x2d')][_0x8ed0('0x32')]));_0x19c623['attributes']=_0x19c623[_0x8ed0('0x31')][_0x8ed0('0x40')]?_0x19c623['attributes']:_0x3e9145[_0x8ed0('0x2c')];if(_0x7181a[_0x8ed0('0x2d')][_0x8ed0('0x3d')]){_0x19c623[_0x8ed0('0x41')]=[{'all':!![]}];}_0x19c623=_[_0x8ed0('0x3a')]({},_0x19c623,_0x7181a['options']);return db[_0x8ed0('0x27')]['find'](_0x19c623)[_0x8ed0('0x3c')](handleEntityNotFound(_0x51320d,null))[_0x8ed0('0x3c')](respondWithResult(_0x51320d,null))[_0x8ed0('0x42')](handleError(_0x51320d,null));};exports[_0x8ed0('0x43')]=function(_0x2c52b2,_0x5a71fc){return db[_0x8ed0('0x27')][_0x8ed0('0x43')](_0x2c52b2['body'],{})[_0x8ed0('0x3c')](respondWithResult(_0x5a71fc,0xc9))['catch'](handleError(_0x5a71fc,null));};exports['update']=function(_0x3df601,_0x151c63){if(_0x3df601[_0x8ed0('0x44')]['id']){delete _0x3df601['body']['id'];}return db[_0x8ed0('0x27')][_0x8ed0('0x45')]({'where':{'id':_0x3df601[_0x8ed0('0x46')]['id']}})[_0x8ed0('0x3c')](handleEntityNotFound(_0x151c63,null))['then'](saveUpdates(_0x3df601['body'],null))[_0x8ed0('0x3c')](respondWithResult(_0x151c63,null))[_0x8ed0('0x42')](handleError(_0x151c63,null));};exports[_0x8ed0('0x22')]=function(_0x178457,_0x14b8d5){return db['FreshsalesField']['find']({'where':{'id':_0x178457[_0x8ed0('0x46')]['id']}})[_0x8ed0('0x3c')](handleEntityNotFound(_0x14b8d5,null))[_0x8ed0('0x3c')](removeEntity(_0x14b8d5,null))[_0x8ed0('0x42')](handleError(_0x14b8d5,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 3d57af8..32ad5d5 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 _0xaec5=['../../config/environment','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xaec5,0x92));var _0x5aec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaec5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5aec('0x0'));var util=require(_0x5aec('0x1'));var logger=require(_0x5aec('0x2'))(_0x5aec('0x3'));var moment=require(_0x5aec('0x4'));var BPromise=require(_0x5aec('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5aec('0x6'));var rimraf=require(_0x5aec('0x7'));var config=require(_0x5aec('0x8'));var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x539cdf,_0x52d725){return _0x539cdf[_0x5aec('0x9')](_0x5aec('0xa'),attributes,{'tableName':_0x5aec('0xb'),'paranoid':![],'indexes':[{'name':_0x5aec('0xc'),'fields':['idField',_0x5aec('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3e22=['util','api','moment','bluebird','request-promise','../../config/environment','./intFreshsalesField.attributes','define','FreshsalesField','int_freshsales_fields','idField','FieldId'];(function(_0x33220c,_0x2d3eda){var _0x55c595=function(_0x1b5abd){while(--_0x1b5abd){_0x33220c['push'](_0x33220c['shift']());}};_0x55c595(++_0x2d3eda);}(_0x3e22,0xa8));var _0x23e2=function(_0x4f84e4,_0x2dc37c){_0x4f84e4=_0x4f84e4-0x0;var _0x1a372a=_0x3e22[_0x4f84e4];return _0x1a372a;};'use strict';var _=require('lodash');var util=require(_0x23e2('0x0'));var logger=require('../../config/logger')(_0x23e2('0x1'));var moment=require(_0x23e2('0x2'));var BPromise=require(_0x23e2('0x3'));var rp=require(_0x23e2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x23e2('0x5'));var attributes=require(_0x23e2('0x6'));module['exports']=function(_0x287f8f,_0x433a85){return _0x287f8f[_0x23e2('0x7')](_0x23e2('0x8'),attributes,{'tableName':_0x23e2('0x9'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x23e2('0xa'),_0x23e2('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 5f127cc..fb30c5f 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 _0xd8fb=['info','FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x4e0417,_0x574fd4){var _0x5d6909=function(_0x54e5d3){while(--_0x54e5d3){_0x4e0417['push'](_0x4e0417['shift']());}};_0x5d6909(++_0x574fd4);}(_0xd8fb,0x99));var _0xbd8f=function(_0x2950b5,_0x347130){_0x2950b5=_0x2950b5-0x0;var _0x5370c3=_0xd8fb[_0x2950b5];return _0x5370c3;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var moment=require(_0xbd8f('0x2'));var BPromise=require(_0xbd8f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbd8f('0x4'));var logger=require(_0xbd8f('0x5'))('rpc');var config=require(_0xbd8f('0x6'));var jayson=require(_0xbd8f('0x7'));var client=jayson['client'][_0xbd8f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e97cf,_0xf503c4,_0x578499){return new BPromise(function(_0x197827,_0x403edc){return client['request'](_0x4e97cf,_0x578499)['then'](function(_0x3caa93){logger[_0xbd8f('0x9')](_0xbd8f('0xa'),_0xf503c4,'request\x20sent');logger[_0xbd8f('0xb')](_0xbd8f('0xc'),_0xf503c4,'request\x20sent',JSON['stringify'](_0x3caa93));if(_0x3caa93[_0xbd8f('0xd')]){if(_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xe')]===0x1f4){logger['error'](_0xbd8f('0xa'),_0xf503c4,_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xf')]);return _0x403edc(_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xf')]);}logger[_0xbd8f('0xd')](_0xbd8f('0xa'),_0xf503c4,_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xf')]);return _0x197827(_0x3caa93['error'][_0xbd8f('0xf')]);}else{logger[_0xbd8f('0x9')](_0xbd8f('0xa'),_0xf503c4,_0xbd8f('0x10'));_0x197827(_0x3caa93['result'][_0xbd8f('0xf')]);}})[_0xbd8f('0x11')](function(_0x5ebf8b){logger[_0xbd8f('0xd')](_0xbd8f('0xa'),_0xf503c4,_0x5ebf8b);_0x403edc(_0x5ebf8b);});});} \ No newline at end of file +var _0xdbf5=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesField,\x20%s,\x20%s','debug','stringify','code','error','message','request\x20sent','result','catch'];(function(_0x9684f8,_0x59467a){var _0x3fc06f=function(_0x33175d){while(--_0x33175d){_0x9684f8['push'](_0x9684f8['shift']());}};_0x3fc06f(++_0x59467a);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x5e3217,_0x1991db){_0x5e3217=_0x5e3217-0x0;var _0x1b413c=_0xdbf5[_0x5e3217];return _0x1b413c;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5dbf('0x1'));var fs=require('fs');var Redis=require(_0x5dbf('0x2'));var db=require(_0x5dbf('0x3'))['db'];var utils=require(_0x5dbf('0x4'));var logger=require(_0x5dbf('0x5'))(_0x5dbf('0x6'));var config=require(_0x5dbf('0x7'));var jayson=require(_0x5dbf('0x8'));var client=jayson[_0x5dbf('0x9')][_0x5dbf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x209b7d,_0x88128e,_0x93e657){return new BPromise(function(_0x52b039,_0x134810){return client['request'](_0x209b7d,_0x93e657)[_0x5dbf('0xb')](function(_0x3bec50){logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,'request\x20sent');logger[_0x5dbf('0xe')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x88128e,'request\x20sent',JSON[_0x5dbf('0xf')](_0x3bec50));if(_0x3bec50['error']){if(_0x3bec50['error'][_0x5dbf('0x10')]===0x1f4){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x134810(_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);}logger['error']('FreshsalesField,\x20%s,\x20%s',_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x52b039(_0x3bec50['error'][_0x5dbf('0x12')]);}else{logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,_0x5dbf('0x13'));_0x52b039(_0x3bec50[_0x5dbf('0x14')][_0x5dbf('0x12')]);}})[_0x5dbf('0x15')](function(_0x50ef1d){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x50ef1d);_0x134810(_0x50ef1d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 63e30d3..c0afae0 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(_0x411aa1,_0x32e73f){var _0x83256c=function(_0x25ce30){while(--_0x25ce30){_0x411aa1['push'](_0x411aa1['shift']());}};_0x83256c(++_0x32e73f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_0x5fd016,_0x2d9cf4){var _0x92e1be=function(_0x35df9f){while(--_0x35df9f){_0x5fd016['push'](_0x5fd016['shift']());}};_0x92e1be(++_0x2d9cf4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 2772da9..597c379 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 _0x68b3=['STRING','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x4fd994,_0x199a8a){var _0x5034ec=function(_0x43e6e0){while(--_0x43e6e0){_0x4fd994['push'](_0x4fd994['shift']());}};_0x5034ec(++_0x199a8a);}(_0x68b3,0x1d8));var _0x368b=function(_0x3cf5bd,_0x56a5fa){_0x3cf5bd=_0x3cf5bd-0x0;var _0x4318fb=_0x68b3[_0x3cf5bd];return _0x4318fb;};'use strict';var Sequelize=require(_0x368b('0x0'));module[_0x368b('0x1')]={'name':{'type':Sequelize[_0x368b('0x2')]},'description':{'type':Sequelize[_0x368b('0x2')]},'username':{'type':Sequelize[_0x368b('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x368b('0x2')]},'password':{'type':Sequelize[_0x368b('0x2')]},'clientId':{'type':Sequelize[_0x368b('0x2')]},'clientSecret':{'type':Sequelize[_0x368b('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x368b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x368b('0x3')](_0x368b('0x4'),_0x368b('0x5')),'defaultValue':_0x368b('0x4')}}; \ No newline at end of file +var _0x2ace=['username','ENUM','integrationTab','newTab','exports','STRING'];(function(_0x4bcf1a,_0xdb12cd){var _0x208dec=function(_0x117f40){while(--_0x117f40){_0x4bcf1a['push'](_0x4bcf1a['shift']());}};_0x208dec(++_0xdb12cd);}(_0x2ace,0x17e));var _0xe2ac=function(_0x3d13bb,_0x262a54){_0x3d13bb=_0x3d13bb-0x0;var _0x4b5a1b=_0x2ace[_0x3d13bb];return _0x4b5a1b;};'use strict';var Sequelize=require('sequelize');module[_0xe2ac('0x0')]={'name':{'type':Sequelize[_0xe2ac('0x1')]},'description':{'type':Sequelize[_0xe2ac('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xe2ac('0x2')},'remoteUri':{'type':Sequelize[_0xe2ac('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xe2ac('0x1')]},'clientSecret':{'type':Sequelize[_0xe2ac('0x1')]},'securityToken':{'type':Sequelize[_0xe2ac('0x1')]},'serverUrl':{'type':Sequelize[_0xe2ac('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe2ac('0x3')](_0xe2ac('0x4'),_0xe2ac('0x5')),'defaultValue':_0xe2ac('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 05ca0e1..ff4fe3f 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 _0x9dcf=['custom','picklistValues','value','boolean','True','true','False','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','statusCode','eml-format','rimraf','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../components/integrations/configuration','sendStatus','status','offset','limit','json','apply','reject','update','then','destroy','end','error','name','SalesforceAccount','rawAttributes','fieldName','type','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','count','includeAll','include','findAll','catch','params','options','create','body','find','getConfigurations','SalesforceConfiguration','pick','filter','addConfiguration','findOne','AccountId','Subjects','channel','SalesforceField','Descriptions','getFields','remoteUri','clientId','securityToken','slice','substring','Connection','login','username','password','concat','isNil','ticketType','describe','OwnerId','Subject','Description','string','int','picklist','email','textarea','phone','remove','includes','label'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x9dcf,0x1d4));var _0xf9dc=function(_0x4a259f,_0x138850){_0x4a259f=_0x4a259f-0x0;var _0x4626f4=_0x9dcf[_0x4a259f];return _0x4626f4;};'use strict';var emlformat=require(_0xf9dc('0x0'));var rimraf=require(_0xf9dc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf9dc('0x2'));var Mustache=require(_0xf9dc('0x3'));var util=require(_0xf9dc('0x4'));var path=require('path');var sox=require(_0xf9dc('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf9dc('0x6'));var _=require(_0xf9dc('0x7'));var squel=require(_0xf9dc('0x8'));var crypto=require(_0xf9dc('0x9'));var jsforce=require(_0xf9dc('0xa'));var deskjs=require(_0xf9dc('0xb'));var toCsv=require(_0xf9dc('0xc'));var querystring=require(_0xf9dc('0xd'));var Papa=require(_0xf9dc('0xe'));var Redis=require(_0xf9dc('0xf'));var authService=require(_0xf9dc('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf9dc('0x11'));var hardwareService=require(_0xf9dc('0x12'));var logger=require(_0xf9dc('0x13'))(_0xf9dc('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf9dc('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xf9dc('0x16'));function respondWithStatusCode(_0x197e2c,_0x4ed857){_0x4ed857=_0x4ed857||0xcc;return function(_0x2b8ecb){if(_0x2b8ecb){return _0x197e2c[_0xf9dc('0x17')](_0x4ed857);}return _0x197e2c[_0xf9dc('0x18')](_0x4ed857)['end']();};}function respondWithResult(_0x208811,_0x5ac9b4){_0x5ac9b4=_0x5ac9b4||0xc8;return function(_0x4498f4){if(_0x4498f4){return _0x208811['status'](_0x5ac9b4)['json'](_0x4498f4);}};}function respondWithFilteredResult(_0x21c81b,_0x3381ae){return function(_0x4e1365){if(_0x4e1365){var _0x77ebd=typeof _0x3381ae[_0xf9dc('0x19')]==='undefined'&&typeof _0x3381ae['limit']==='undefined';var _0x338edc=_0x4e1365['count'];var _0xfd8edd=_0x77ebd?0x0:_0x3381ae[_0xf9dc('0x19')];var _0x3401a0=_0x77ebd?_0x4e1365['count']:_0x3381ae[_0xf9dc('0x19')]+_0x3381ae[_0xf9dc('0x1a')];var _0x54c2f9;if(_0x3401a0>=_0x338edc){_0x3401a0=_0x338edc;_0x54c2f9=0xc8;}else{_0x54c2f9=0xce;}_0x21c81b['status'](_0x54c2f9);return _0x21c81b['set']('Content-Range',_0xfd8edd+'-'+_0x3401a0+'/'+_0x338edc)[_0xf9dc('0x1b')](_0x4e1365);}return null;};}function patchUpdates(_0x2fa182){return function(_0x1f541){try{jsonpatch[_0xf9dc('0x1c')](_0x1f541,_0x2fa182,!![]);}catch(_0x52cf21){return BPromise[_0xf9dc('0x1d')](_0x52cf21);}return _0x1f541['save']();};}function saveUpdates(_0x3675fd,_0x11c1e0){return function(_0x455d0f){if(_0x455d0f){return _0x455d0f[_0xf9dc('0x1e')](_0x3675fd)[_0xf9dc('0x1f')](function(_0x1857df){return _0x1857df;});}return null;};}function removeEntity(_0x1487c0,_0x2ba972){return function(_0x5dcf4b){if(_0x5dcf4b){return _0x5dcf4b[_0xf9dc('0x20')]()['then'](function(){_0x1487c0[_0xf9dc('0x18')](0xcc)[_0xf9dc('0x21')]();});}};}function handleEntityNotFound(_0x55b88a,_0x40c0f1){return function(_0x190ceb){if(!_0x190ceb){_0x55b88a['sendStatus'](0x194);}return _0x190ceb;};}function handleError(_0x575edc,_0x3139c8){_0x3139c8=_0x3139c8||0x1f4;return function(_0x5251c0){logger[_0xf9dc('0x22')](_0x5251c0['stack']);if(_0x5251c0[_0xf9dc('0x23')]){delete _0x5251c0[_0xf9dc('0x23')];}_0x575edc[_0xf9dc('0x18')](_0x3139c8)['send'](_0x5251c0);};}exports['index']=function(_0x24e04c,_0x54fb2d){var _0x24f913={},_0x4aa752={},_0x41e661={'count':0x0,'rows':[]};var _0xce7d15=_['map'](db[_0xf9dc('0x24')][_0xf9dc('0x25')],function(_0x349a73){return{'name':_0x349a73[_0xf9dc('0x26')],'type':_0x349a73[_0xf9dc('0x27')]['key']};});_0x4aa752['model']=_[_0xf9dc('0x28')](_0xce7d15,'name');_0x4aa752[_0xf9dc('0x29')]=_[_0xf9dc('0x2a')](_0x24e04c[_0xf9dc('0x29')]);_0x4aa752['filters']=_[_0xf9dc('0x2b')](_0x4aa752[_0xf9dc('0x2c')],_0x4aa752[_0xf9dc('0x29')]);_0x24f913[_0xf9dc('0x2d')]=_[_0xf9dc('0x2b')](_0x4aa752[_0xf9dc('0x2c')],qs['fields'](_0x24e04c[_0xf9dc('0x29')][_0xf9dc('0x2e')]));_0x24f913[_0xf9dc('0x2d')]=_0x24f913['attributes'][_0xf9dc('0x2f')]?_0x24f913['attributes']:_0x4aa752[_0xf9dc('0x2c')];if(!_0x24e04c[_0xf9dc('0x29')][_0xf9dc('0x30')](_0xf9dc('0x31'))){_0x24f913[_0xf9dc('0x1a')]=qs[_0xf9dc('0x1a')](_0x24e04c[_0xf9dc('0x29')]['limit']);_0x24f913[_0xf9dc('0x19')]=qs['offset'](_0x24e04c[_0xf9dc('0x29')]['offset']);}_0x24f913[_0xf9dc('0x32')]=qs[_0xf9dc('0x33')](_0x24e04c[_0xf9dc('0x29')][_0xf9dc('0x33')]);_0x24f913[_0xf9dc('0x34')]=qs[_0xf9dc('0x35')](_['pick'](_0x24e04c[_0xf9dc('0x29')],_0x4aa752[_0xf9dc('0x35')]),_0xce7d15);if(_0x24e04c[_0xf9dc('0x29')]['filter']){_0x24f913['where']=_[_0xf9dc('0x36')](_0x24f913[_0xf9dc('0x34')],{'$or':_[_0xf9dc('0x28')](_0xce7d15,function(_0x3520b5){if(_0x3520b5['type']!=='VIRTUAL'){var _0x17ae9d={};_0x17ae9d[_0x3520b5['name']]={'$like':'%'+_0x24e04c[_0xf9dc('0x29')]['filter']+'%'};return _0x17ae9d;}})});}_0x24f913=_[_0xf9dc('0x36')]({},_0x24f913,_0x24e04c['options']);var _0x3c11a0={'where':_0x24f913['where']};return db[_0xf9dc('0x24')]['count'](_0x3c11a0)[_0xf9dc('0x1f')](function(_0x483e8a){_0x41e661[_0xf9dc('0x37')]=_0x483e8a;if(_0x24e04c[_0xf9dc('0x29')][_0xf9dc('0x38')]){_0x24f913[_0xf9dc('0x39')]=[{'all':!![]}];}return db[_0xf9dc('0x24')][_0xf9dc('0x3a')](_0x24f913);})[_0xf9dc('0x1f')](function(_0x5f5a91){_0x41e661['rows']=_0x5f5a91;return _0x41e661;})[_0xf9dc('0x1f')](respondWithFilteredResult(_0x54fb2d,_0x24f913))[_0xf9dc('0x3b')](handleError(_0x54fb2d,null));};exports['show']=function(_0x3a38b1,_0x599b94){var _0x20800e={'raw':![],'where':{'id':_0x3a38b1[_0xf9dc('0x3c')]['id']}},_0x152a65={};_0x152a65[_0xf9dc('0x2c')]=_['keys'](db[_0xf9dc('0x24')][_0xf9dc('0x25')]);_0x152a65['query']=_['keys'](_0x3a38b1[_0xf9dc('0x29')]);_0x152a65[_0xf9dc('0x35')]=_['intersection'](_0x152a65[_0xf9dc('0x2c')],_0x152a65[_0xf9dc('0x29')]);_0x20800e[_0xf9dc('0x2d')]=_['intersection'](_0x152a65[_0xf9dc('0x2c')],qs[_0xf9dc('0x2e')](_0x3a38b1['query'][_0xf9dc('0x2e')]));_0x20800e[_0xf9dc('0x2d')]=_0x20800e[_0xf9dc('0x2d')][_0xf9dc('0x2f')]?_0x20800e[_0xf9dc('0x2d')]:_0x152a65['model'];if(_0x3a38b1[_0xf9dc('0x29')][_0xf9dc('0x38')]){_0x20800e[_0xf9dc('0x39')]=[{'all':!![]}];}_0x20800e=_[_0xf9dc('0x36')]({},_0x20800e,_0x3a38b1[_0xf9dc('0x3d')]);return db[_0xf9dc('0x24')]['find'](_0x20800e)[_0xf9dc('0x1f')](handleEntityNotFound(_0x599b94,null))[_0xf9dc('0x1f')](respondWithResult(_0x599b94,null))[_0xf9dc('0x3b')](handleError(_0x599b94,null));};exports[_0xf9dc('0x3e')]=function(_0x5994c4,_0x41f15a){return db[_0xf9dc('0x24')]['create'](_0x5994c4[_0xf9dc('0x3f')],{})[_0xf9dc('0x1f')](respondWithResult(_0x41f15a,0xc9))[_0xf9dc('0x3b')](handleError(_0x41f15a,null));};exports[_0xf9dc('0x1e')]=function(_0x36e20e,_0x16184d){if(_0x36e20e['body']['id']){delete _0x36e20e['body']['id'];}return db[_0xf9dc('0x24')][_0xf9dc('0x40')]({'where':{'id':_0x36e20e[_0xf9dc('0x3c')]['id']}})[_0xf9dc('0x1f')](handleEntityNotFound(_0x16184d,null))[_0xf9dc('0x1f')](saveUpdates(_0x36e20e[_0xf9dc('0x3f')],null))[_0xf9dc('0x1f')](respondWithResult(_0x16184d,null))[_0xf9dc('0x3b')](handleError(_0x16184d,null));};exports[_0xf9dc('0x20')]=function(_0x192c5a,_0x5346b9){return db['SalesforceAccount']['find']({'where':{'id':_0x192c5a[_0xf9dc('0x3c')]['id']}})[_0xf9dc('0x1f')](handleEntityNotFound(_0x5346b9,null))[_0xf9dc('0x1f')](removeEntity(_0x5346b9,null))['catch'](handleError(_0x5346b9,null));};exports[_0xf9dc('0x41')]=function(_0x3438ef,_0x424723,_0x58d56a){var _0x448023={};var _0x49e011={};var _0x45d66c;var _0xccdf59;return db[_0xf9dc('0x24')]['findOne']({'where':{'id':_0x3438ef[_0xf9dc('0x3c')]['id']}})[_0xf9dc('0x1f')](handleEntityNotFound(_0x424723,null))['then'](function(_0x4add26){if(_0x4add26){_0x45d66c=_0x4add26;_0x49e011['model']=_[_0xf9dc('0x2a')](db[_0xf9dc('0x42')][_0xf9dc('0x25')]);_0x49e011['query']=_['keys'](_0x3438ef[_0xf9dc('0x29')]);_0x49e011[_0xf9dc('0x35')]=_[_0xf9dc('0x2b')](_0x49e011[_0xf9dc('0x2c')],_0x49e011['query']);_0x448023[_0xf9dc('0x2d')]=_['intersection'](_0x49e011[_0xf9dc('0x2c')],qs[_0xf9dc('0x2e')](_0x3438ef['query'][_0xf9dc('0x2e')]));_0x448023[_0xf9dc('0x2d')]=_0x448023['attributes']['length']?_0x448023[_0xf9dc('0x2d')]:_0x49e011[_0xf9dc('0x2c')];_0x448023[_0xf9dc('0x32')]=qs[_0xf9dc('0x33')](_0x3438ef[_0xf9dc('0x29')]['sort']);_0x448023[_0xf9dc('0x34')]=qs[_0xf9dc('0x35')](_[_0xf9dc('0x43')](_0x3438ef['query'],_0x49e011[_0xf9dc('0x35')]));if(_0x3438ef[_0xf9dc('0x29')][_0xf9dc('0x44')]){_0x448023['where']=_[_0xf9dc('0x36')](_0x448023[_0xf9dc('0x34')],{'$or':_['map'](_0x448023[_0xf9dc('0x2d')],function(_0xd6d551){var _0x2ac2e8={};_0x2ac2e8[_0xd6d551]={'$like':'%'+_0x3438ef[_0xf9dc('0x29')][_0xf9dc('0x44')]+'%'};return _0x2ac2e8;})});}_0x448023=_['merge']({},_0x448023,_0x3438ef['options']);return _0x45d66c[_0xf9dc('0x41')](_0x448023);}})[_0xf9dc('0x1f')](function(_0x5ee179){if(_0x5ee179){_0xccdf59=_0x5ee179['length'];if(!_0x3438ef[_0xf9dc('0x29')][_0xf9dc('0x30')](_0xf9dc('0x31'))){_0x448023[_0xf9dc('0x1a')]=qs['limit'](_0x3438ef[_0xf9dc('0x29')][_0xf9dc('0x1a')]);_0x448023[_0xf9dc('0x19')]=qs[_0xf9dc('0x19')](_0x3438ef[_0xf9dc('0x29')]['offset']);}return _0x45d66c[_0xf9dc('0x41')](_0x448023);}})[_0xf9dc('0x1f')](function(_0x10b991){if(_0x10b991){return _0x10b991?{'count':_0xccdf59,'rows':_0x10b991}:null;}})[_0xf9dc('0x1f')](respondWithResult(_0x424723,null))[_0xf9dc('0x3b')](handleError(_0x424723,null));};exports[_0xf9dc('0x45')]=function(_0x483684,_0x44a183,_0xb5d7d5){if(_0x483684[_0xf9dc('0x3f')]['id']){delete _0x483684[_0xf9dc('0x3f')]['id'];}return db['SalesforceAccount'][_0xf9dc('0x46')]({'where':{'id':_0x483684[_0xf9dc('0x3c')]['id']}})['then'](handleEntityNotFound(_0x44a183,null))['then'](function(_0x4c58da){if(_0x4c58da){_0x483684['body'][_0xf9dc('0x47')]=_0x4c58da['id'];_0x483684[_0xf9dc('0x3f')][_0xf9dc('0x48')]=integrations['getSubjects'](_0x483684['body']['channel'],_0x483684[_0xf9dc('0x3f')][_0xf9dc('0x27')]);_0x483684[_0xf9dc('0x3f')]['Descriptions']=integrations['getDescriptions'](_0x483684[_0xf9dc('0x3f')][_0xf9dc('0x49')],_0x483684[_0xf9dc('0x3f')][_0xf9dc('0x27')]);return db[_0xf9dc('0x42')][_0xf9dc('0x3e')](_0x483684[_0xf9dc('0x3f')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0xf9dc('0x4a')],'as':_0xf9dc('0x4b')}]});}return null;})['then'](respondWithResult(_0x44a183,null))[_0xf9dc('0x3b')](handleError(_0x44a183,null));};exports[_0xf9dc('0x4c')]=function(_0x538026,_0x3089ca,_0x4fec07){var _0x52e43b;var _0x5bc0a2='';var _0x5b42de='Task';return db['SalesforceAccount'][_0xf9dc('0x46')]({'where':{'id':_0x538026['params']['id']},'attributes':['id',_0xf9dc('0x4d'),_0xf9dc('0x4e'),'clientSecret','username','password',_0xf9dc('0x4f')]})[_0xf9dc('0x1f')](handleEntityNotFound(_0x3089ca,null))['then'](function(_0x449b5c){if(_0x449b5c){_0x5bc0a2=_0x449b5c['remoteUri'];var _0xbbbd46=_0x5bc0a2[_0xf9dc('0x50')](-0x1);if(_0xbbbd46==='/'){_0x5bc0a2=_0x5bc0a2[_0xf9dc('0x51')](0x0,_0x5bc0a2['lastIndexOf'](_0xbbbd46));}_0x52e43b=new jsforce[(_0xf9dc('0x52'))]({'oauth2':{'loginUrl':_0x5bc0a2,'clientId':_0x449b5c[_0xf9dc('0x4e')],'clientSecret':_0x449b5c['clientSecret']}});return _0x52e43b[_0xf9dc('0x53')](_0x449b5c[_0xf9dc('0x54')],_0x449b5c[_0xf9dc('0x55')][_0xf9dc('0x56')](_0x449b5c['securityToken']));}})[_0xf9dc('0x1f')](function(_0x55c4d5){if(_0x55c4d5){if(!_[_0xf9dc('0x57')](_0x538026[_0xf9dc('0x29')]['ticketType'])){_0x5b42de=_0x538026[_0xf9dc('0x29')][_0xf9dc('0x58')];}return _0x52e43b['sobject'](_0x5b42de)[_0xf9dc('0x59')]();}})[_0xf9dc('0x1f')](function(_0x1878a1){var _0x52955e=[_0xf9dc('0x5a'),'ActivityDate','IsReminderSet','IsRecurrence',_0xf9dc('0x5b'),_0xf9dc('0x5c')];var _0x3be2f2=[_0xf9dc('0x5d'),_0xf9dc('0x5e'),_0xf9dc('0x5f'),'boolean',_0xf9dc('0x60'),_0xf9dc('0x61'),_0xf9dc('0x62')];if(_0x1878a1){_[_0xf9dc('0x63')](_0x1878a1[_0xf9dc('0x2e')],function(_0x583ccd){return _0x52955e[_0xf9dc('0x64')](_0x583ccd[_0xf9dc('0x23')])||!_0x3be2f2[_0xf9dc('0x64')](_0x583ccd[_0xf9dc('0x27')]);});return{'count':_0x1878a1[_0xf9dc('0x2e')][_0xf9dc('0x2f')],'rows':_[_0xf9dc('0x28')](_0x1878a1['fields'],function(_0x2b8709){return{'id':_0x2b8709[_0xf9dc('0x23')],'name':_0x2b8709[_0xf9dc('0x65')],'custom':_0x2b8709[_0xf9dc('0x66')],'options':_0x2b8709[_0xf9dc('0x67')]['length']>0x0?_['map'](_0x2b8709['picklistValues'],function(_0x55fec7){return{'name':_0x55fec7['label'],'value':_0x55fec7[_0xf9dc('0x68')]};}):_0x2b8709[_0xf9dc('0x27')]==_0xf9dc('0x69')?[{'name':_0xf9dc('0x6a'),'value':_0xf9dc('0x6b')},{'name':_0xf9dc('0x6c'),'value':'false'}]:[]};})};}})[_0xf9dc('0x1f')](respondWithResult(_0x3089ca,null))[_0xf9dc('0x3b')](function(_0x3a9e6e){var _0x42a937=_0x538026[_0xf9dc('0x29')][_0xf9dc('0x6d')]?0x1f4:_0x3a9e6e['statusCode']||0x1f4;logger[_0xf9dc('0x22')](_0xf9dc('0x6e'),_0xf9dc('0x4c'),_0x42a937,JSON[_0xf9dc('0x6f')](_0x3a9e6e));delete _0x3a9e6e[_0xf9dc('0x23')];if(_0x42a937===0x191){_0x42a937=0x190;}_0x3089ca[_0xf9dc('0x18')](_0x42a937)[_0xf9dc('0x70')](_0x538026[_0xf9dc('0x29')][_0xf9dc('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x3a9e6e[_0xf9dc('0x71')]}:_0x3a9e6e);});}; \ No newline at end of file +var _0xc00c=['lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','textarea','phone','custom','picklistValues','label','value','True','true','False','false','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','destroy','then','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','includeAll','include','SalesforceAccount','rows','catch','show','params','length','options','find','create','update','body','getConfigurations','findOne','sort','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','password','securityToken','slice'];(function(_0x43ef21,_0x58be50){var _0x22e2d3=function(_0x196809){while(--_0x196809){_0x43ef21['push'](_0x43ef21['shift']());}};_0x22e2d3(++_0x58be50);}(_0xc00c,0xa0));var _0xcc00=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0xc00c[_0x55abd9];return _0x3e5669;};'use strict';var emlformat=require(_0xcc00('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc00('0x1'));var jsonpatch=require(_0xcc00('0x2'));var rp=require(_0xcc00('0x3'));var moment=require(_0xcc00('0x4'));var BPromise=require(_0xcc00('0x5'));var Mustache=require('mustache');var util=require(_0xcc00('0x6'));var path=require('path');var sox=require(_0xcc00('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc00('0x8'));var _=require(_0xcc00('0x9'));var squel=require(_0xcc00('0xa'));var crypto=require(_0xcc00('0xb'));var jsforce=require(_0xcc00('0xc'));var deskjs=require(_0xcc00('0xd'));var toCsv=require(_0xcc00('0xe'));var querystring=require(_0xcc00('0xf'));var Papa=require(_0xcc00('0x10'));var Redis=require(_0xcc00('0x11'));var authService=require(_0xcc00('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcc00('0x13'));var logger=require(_0xcc00('0x14'))(_0xcc00('0x15'));var utils=require(_0xcc00('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xcc00('0x17'));var db=require(_0xcc00('0x18'))['db'];var integrations=require(_0xcc00('0x19'));function respondWithStatusCode(_0x35a815,_0x4b65fe){_0x4b65fe=_0x4b65fe||0xcc;return function(_0x61d3e3){if(_0x61d3e3){return _0x35a815[_0xcc00('0x1a')](_0x4b65fe);}return _0x35a815['status'](_0x4b65fe)['end']();};}function respondWithResult(_0x3ab3df,_0x3a8eb8){_0x3a8eb8=_0x3a8eb8||0xc8;return function(_0x3b7938){if(_0x3b7938){return _0x3ab3df[_0xcc00('0x1b')](_0x3a8eb8)[_0xcc00('0x1c')](_0x3b7938);}};}function respondWithFilteredResult(_0x2e7546,_0x82497b){return function(_0x20a434){if(_0x20a434){var _0x20a632=typeof _0x82497b[_0xcc00('0x1d')]===_0xcc00('0x1e')&&typeof _0x82497b[_0xcc00('0x1f')]===_0xcc00('0x1e');var _0x2dab6b=_0x20a434[_0xcc00('0x20')];var _0x57b21a=_0x20a632?0x0:_0x82497b['offset'];var _0x177e90=_0x20a632?_0x20a434['count']:_0x82497b[_0xcc00('0x1d')]+_0x82497b[_0xcc00('0x1f')];var _0x425bea;if(_0x177e90>=_0x2dab6b){_0x177e90=_0x2dab6b;_0x425bea=0xc8;}else{_0x425bea=0xce;}_0x2e7546[_0xcc00('0x1b')](_0x425bea);return _0x2e7546[_0xcc00('0x21')]('Content-Range',_0x57b21a+'-'+_0x177e90+'/'+_0x2dab6b)['json'](_0x20a434);}return null;};}function patchUpdates(_0x22e4f0){return function(_0x3cd153){try{jsonpatch[_0xcc00('0x22')](_0x3cd153,_0x22e4f0,!![]);}catch(_0x2d4587){return BPromise[_0xcc00('0x23')](_0x2d4587);}return _0x3cd153['save']();};}function saveUpdates(_0x26f5d9,_0x90a08b){return function(_0x17b550){if(_0x17b550){return _0x17b550['update'](_0x26f5d9)['then'](function(_0x532df1){return _0x532df1;});}return null;};}function removeEntity(_0x20079e,_0x453151){return function(_0x2e7515){if(_0x2e7515){return _0x2e7515[_0xcc00('0x24')]()[_0xcc00('0x25')](function(){_0x20079e[_0xcc00('0x1b')](0xcc)[_0xcc00('0x26')]();});}};}function handleEntityNotFound(_0x412439,_0x2efb04){return function(_0x1a630a){if(!_0x1a630a){_0x412439[_0xcc00('0x1a')](0x194);}return _0x1a630a;};}function handleError(_0x274d40,_0x15bea5){_0x15bea5=_0x15bea5||0x1f4;return function(_0x1d30a5){logger['error'](_0x1d30a5[_0xcc00('0x27')]);if(_0x1d30a5[_0xcc00('0x28')]){delete _0x1d30a5[_0xcc00('0x28')];}_0x274d40[_0xcc00('0x1b')](_0x15bea5)[_0xcc00('0x29')](_0x1d30a5);};}exports[_0xcc00('0x2a')]=function(_0x1795f8,_0x355232){var _0x24cab3={},_0x151812={},_0x10ff31={'count':0x0,'rows':[]};var _0x52a90d=_[_0xcc00('0x2b')](db['SalesforceAccount'][_0xcc00('0x2c')],function(_0x4e88db){return{'name':_0x4e88db[_0xcc00('0x2d')],'type':_0x4e88db[_0xcc00('0x2e')][_0xcc00('0x2f')]};});_0x151812['model']=_[_0xcc00('0x2b')](_0x52a90d,_0xcc00('0x28'));_0x151812['query']=_[_0xcc00('0x30')](_0x1795f8[_0xcc00('0x31')]);_0x151812[_0xcc00('0x32')]=_[_0xcc00('0x33')](_0x151812[_0xcc00('0x34')],_0x151812[_0xcc00('0x31')]);_0x24cab3[_0xcc00('0x35')]=_[_0xcc00('0x33')](_0x151812[_0xcc00('0x34')],qs['fields'](_0x1795f8[_0xcc00('0x31')][_0xcc00('0x36')]));_0x24cab3['attributes']=_0x24cab3['attributes']['length']?_0x24cab3[_0xcc00('0x35')]:_0x151812[_0xcc00('0x34')];if(!_0x1795f8[_0xcc00('0x31')][_0xcc00('0x37')](_0xcc00('0x38'))){_0x24cab3['limit']=qs[_0xcc00('0x1f')](_0x1795f8[_0xcc00('0x31')]['limit']);_0x24cab3[_0xcc00('0x1d')]=qs[_0xcc00('0x1d')](_0x1795f8[_0xcc00('0x31')][_0xcc00('0x1d')]);}_0x24cab3[_0xcc00('0x39')]=qs['sort'](_0x1795f8[_0xcc00('0x31')]['sort']);_0x24cab3[_0xcc00('0x3a')]=qs[_0xcc00('0x32')](_[_0xcc00('0x3b')](_0x1795f8[_0xcc00('0x31')],_0x151812[_0xcc00('0x32')]),_0x52a90d);if(_0x1795f8[_0xcc00('0x31')]['filter']){_0x24cab3['where']=_['merge'](_0x24cab3[_0xcc00('0x3a')],{'$or':_[_0xcc00('0x2b')](_0x52a90d,function(_0x45a889){if(_0x45a889[_0xcc00('0x2e')]!=='VIRTUAL'){var _0x384aa7={};_0x384aa7[_0x45a889[_0xcc00('0x28')]]={'$like':'%'+_0x1795f8[_0xcc00('0x31')][_0xcc00('0x3c')]+'%'};return _0x384aa7;}})});}_0x24cab3=_[_0xcc00('0x3d')]({},_0x24cab3,_0x1795f8['options']);var _0xc7a9ed={'where':_0x24cab3[_0xcc00('0x3a')]};return db['SalesforceAccount']['count'](_0xc7a9ed)[_0xcc00('0x25')](function(_0x2019d4){_0x10ff31[_0xcc00('0x20')]=_0x2019d4;if(_0x1795f8[_0xcc00('0x31')][_0xcc00('0x3e')]){_0x24cab3[_0xcc00('0x3f')]=[{'all':!![]}];}return db[_0xcc00('0x40')]['findAll'](_0x24cab3);})[_0xcc00('0x25')](function(_0x5a970e){_0x10ff31[_0xcc00('0x41')]=_0x5a970e;return _0x10ff31;})[_0xcc00('0x25')](respondWithFilteredResult(_0x355232,_0x24cab3))[_0xcc00('0x42')](handleError(_0x355232,null));};exports[_0xcc00('0x43')]=function(_0x2ba52f,_0x49a47c){var _0x260aaa={'raw':![],'where':{'id':_0x2ba52f[_0xcc00('0x44')]['id']}},_0xaae8ba={};_0xaae8ba[_0xcc00('0x34')]=_[_0xcc00('0x30')](db[_0xcc00('0x40')][_0xcc00('0x2c')]);_0xaae8ba[_0xcc00('0x31')]=_[_0xcc00('0x30')](_0x2ba52f[_0xcc00('0x31')]);_0xaae8ba['filters']=_['intersection'](_0xaae8ba[_0xcc00('0x34')],_0xaae8ba[_0xcc00('0x31')]);_0x260aaa[_0xcc00('0x35')]=_['intersection'](_0xaae8ba[_0xcc00('0x34')],qs[_0xcc00('0x36')](_0x2ba52f[_0xcc00('0x31')]['fields']));_0x260aaa[_0xcc00('0x35')]=_0x260aaa[_0xcc00('0x35')][_0xcc00('0x45')]?_0x260aaa['attributes']:_0xaae8ba['model'];if(_0x2ba52f[_0xcc00('0x31')][_0xcc00('0x3e')]){_0x260aaa['include']=[{'all':!![]}];}_0x260aaa=_[_0xcc00('0x3d')]({},_0x260aaa,_0x2ba52f[_0xcc00('0x46')]);return db[_0xcc00('0x40')][_0xcc00('0x47')](_0x260aaa)[_0xcc00('0x25')](handleEntityNotFound(_0x49a47c,null))['then'](respondWithResult(_0x49a47c,null))[_0xcc00('0x42')](handleError(_0x49a47c,null));};exports['create']=function(_0x31251c,_0x24d1b9){return db[_0xcc00('0x40')][_0xcc00('0x48')](_0x31251c['body'],{})['then'](respondWithResult(_0x24d1b9,0xc9))[_0xcc00('0x42')](handleError(_0x24d1b9,null));};exports[_0xcc00('0x49')]=function(_0x562689,_0x4db0c2){if(_0x562689[_0xcc00('0x4a')]['id']){delete _0x562689['body']['id'];}return db['SalesforceAccount']['find']({'where':{'id':_0x562689[_0xcc00('0x44')]['id']}})[_0xcc00('0x25')](handleEntityNotFound(_0x4db0c2,null))[_0xcc00('0x25')](saveUpdates(_0x562689['body'],null))[_0xcc00('0x25')](respondWithResult(_0x4db0c2,null))['catch'](handleError(_0x4db0c2,null));};exports[_0xcc00('0x24')]=function(_0x1bc6f8,_0x394bdd){return db['SalesforceAccount'][_0xcc00('0x47')]({'where':{'id':_0x1bc6f8[_0xcc00('0x44')]['id']}})[_0xcc00('0x25')](handleEntityNotFound(_0x394bdd,null))[_0xcc00('0x25')](removeEntity(_0x394bdd,null))[_0xcc00('0x42')](handleError(_0x394bdd,null));};exports[_0xcc00('0x4b')]=function(_0x1ccfab,_0x2c3541,_0x15e4fc){var _0x2b09e1={};var _0x5ed511={};var _0x64c25a;var _0x30881b;return db[_0xcc00('0x40')][_0xcc00('0x4c')]({'where':{'id':_0x1ccfab[_0xcc00('0x44')]['id']}})[_0xcc00('0x25')](handleEntityNotFound(_0x2c3541,null))[_0xcc00('0x25')](function(_0x2b3830){if(_0x2b3830){_0x64c25a=_0x2b3830;_0x5ed511[_0xcc00('0x34')]=_['keys'](db['SalesforceConfiguration'][_0xcc00('0x2c')]);_0x5ed511[_0xcc00('0x31')]=_['keys'](_0x1ccfab['query']);_0x5ed511[_0xcc00('0x32')]=_['intersection'](_0x5ed511[_0xcc00('0x34')],_0x5ed511[_0xcc00('0x31')]);_0x2b09e1['attributes']=_[_0xcc00('0x33')](_0x5ed511[_0xcc00('0x34')],qs['fields'](_0x1ccfab[_0xcc00('0x31')][_0xcc00('0x36')]));_0x2b09e1[_0xcc00('0x35')]=_0x2b09e1[_0xcc00('0x35')][_0xcc00('0x45')]?_0x2b09e1[_0xcc00('0x35')]:_0x5ed511['model'];_0x2b09e1[_0xcc00('0x39')]=qs[_0xcc00('0x4d')](_0x1ccfab[_0xcc00('0x31')][_0xcc00('0x4d')]);_0x2b09e1[_0xcc00('0x3a')]=qs['filters'](_[_0xcc00('0x3b')](_0x1ccfab[_0xcc00('0x31')],_0x5ed511[_0xcc00('0x32')]));if(_0x1ccfab[_0xcc00('0x31')]['filter']){_0x2b09e1[_0xcc00('0x3a')]=_[_0xcc00('0x3d')](_0x2b09e1[_0xcc00('0x3a')],{'$or':_[_0xcc00('0x2b')](_0x2b09e1[_0xcc00('0x35')],function(_0x426ea5){var _0xd068d2={};_0xd068d2[_0x426ea5]={'$like':'%'+_0x1ccfab[_0xcc00('0x31')][_0xcc00('0x3c')]+'%'};return _0xd068d2;})});}_0x2b09e1=_[_0xcc00('0x3d')]({},_0x2b09e1,_0x1ccfab[_0xcc00('0x46')]);return _0x64c25a['getConfigurations'](_0x2b09e1);}})['then'](function(_0x4c5dad){if(_0x4c5dad){_0x30881b=_0x4c5dad[_0xcc00('0x45')];if(!_0x1ccfab[_0xcc00('0x31')][_0xcc00('0x37')]('nolimit')){_0x2b09e1[_0xcc00('0x1f')]=qs[_0xcc00('0x1f')](_0x1ccfab[_0xcc00('0x31')]['limit']);_0x2b09e1[_0xcc00('0x1d')]=qs[_0xcc00('0x1d')](_0x1ccfab['query'][_0xcc00('0x1d')]);}return _0x64c25a['getConfigurations'](_0x2b09e1);}})[_0xcc00('0x25')](function(_0x140bdd){if(_0x140bdd){return _0x140bdd?{'count':_0x30881b,'rows':_0x140bdd}:null;}})[_0xcc00('0x25')](respondWithResult(_0x2c3541,null))[_0xcc00('0x42')](handleError(_0x2c3541,null));};exports[_0xcc00('0x4e')]=function(_0x34c90f,_0x373537,_0x5dd95b){if(_0x34c90f[_0xcc00('0x4a')]['id']){delete _0x34c90f['body']['id'];}return db[_0xcc00('0x40')][_0xcc00('0x4c')]({'where':{'id':_0x34c90f[_0xcc00('0x44')]['id']}})[_0xcc00('0x25')](handleEntityNotFound(_0x373537,null))[_0xcc00('0x25')](function(_0x50f0a6){if(_0x50f0a6){_0x34c90f[_0xcc00('0x4a')]['AccountId']=_0x50f0a6['id'];_0x34c90f[_0xcc00('0x4a')][_0xcc00('0x4f')]=integrations[_0xcc00('0x50')](_0x34c90f[_0xcc00('0x4a')][_0xcc00('0x51')],_0x34c90f[_0xcc00('0x4a')][_0xcc00('0x2e')]);_0x34c90f[_0xcc00('0x4a')][_0xcc00('0x52')]=integrations[_0xcc00('0x53')](_0x34c90f['body'][_0xcc00('0x51')],_0x34c90f[_0xcc00('0x4a')][_0xcc00('0x2e')]);return db[_0xcc00('0x54')]['create'](_0x34c90f[_0xcc00('0x4a')],{'include':[{'model':db[_0xcc00('0x55')],'as':_0xcc00('0x4f')},{'model':db[_0xcc00('0x55')],'as':'Descriptions'}]});}return null;})[_0xcc00('0x25')](respondWithResult(_0x373537,null))[_0xcc00('0x42')](handleError(_0x373537,null));};exports[_0xcc00('0x56')]=function(_0x4dcd50,_0x3afa13,_0x37f162){var _0x4bf521;var _0x108950='';var _0x1ceb3e=_0xcc00('0x57');return db['SalesforceAccount'][_0xcc00('0x4c')]({'where':{'id':_0x4dcd50[_0xcc00('0x44')]['id']},'attributes':['id',_0xcc00('0x58'),_0xcc00('0x59'),_0xcc00('0x5a'),'username',_0xcc00('0x5b'),_0xcc00('0x5c')]})[_0xcc00('0x25')](handleEntityNotFound(_0x3afa13,null))['then'](function(_0x2bb9bb){if(_0x2bb9bb){_0x108950=_0x2bb9bb[_0xcc00('0x58')];var _0xfcb0cf=_0x108950[_0xcc00('0x5d')](-0x1);if(_0xfcb0cf==='/'){_0x108950=_0x108950['substring'](0x0,_0x108950[_0xcc00('0x5e')](_0xfcb0cf));}_0x4bf521=new jsforce[(_0xcc00('0x5f'))]({'oauth2':{'loginUrl':_0x108950,'clientId':_0x2bb9bb[_0xcc00('0x59')],'clientSecret':_0x2bb9bb['clientSecret']}});return _0x4bf521[_0xcc00('0x60')](_0x2bb9bb['username'],_0x2bb9bb[_0xcc00('0x5b')][_0xcc00('0x61')](_0x2bb9bb['securityToken']));}})[_0xcc00('0x25')](function(_0x2fb945){if(_0x2fb945){if(!_[_0xcc00('0x62')](_0x4dcd50[_0xcc00('0x31')]['ticketType'])){_0x1ceb3e=_0x4dcd50[_0xcc00('0x31')][_0xcc00('0x63')];}return _0x4bf521[_0xcc00('0x64')](_0x1ceb3e)['describe']();}})[_0xcc00('0x25')](function(_0xa1318d){var _0x1a0320=[_0xcc00('0x65'),_0xcc00('0x66'),_0xcc00('0x67'),_0xcc00('0x68'),_0xcc00('0x69'),_0xcc00('0x6a')];var _0x390fbf=[_0xcc00('0x6b'),_0xcc00('0x6c'),_0xcc00('0x6d'),_0xcc00('0x6e'),_0xcc00('0x6f'),_0xcc00('0x70'),_0xcc00('0x71')];if(_0xa1318d){_['remove'](_0xa1318d[_0xcc00('0x36')],function(_0x4ec058){return _0x1a0320['includes'](_0x4ec058[_0xcc00('0x28')])||!_0x390fbf['includes'](_0x4ec058[_0xcc00('0x2e')]);});return{'count':_0xa1318d[_0xcc00('0x36')][_0xcc00('0x45')],'rows':_['map'](_0xa1318d[_0xcc00('0x36')],function(_0x5a15c0){return{'id':_0x5a15c0[_0xcc00('0x28')],'name':_0x5a15c0['label'],'custom':_0x5a15c0[_0xcc00('0x72')],'options':_0x5a15c0['picklistValues'][_0xcc00('0x45')]>0x0?_['map'](_0x5a15c0[_0xcc00('0x73')],function(_0x4440c5){return{'name':_0x4440c5[_0xcc00('0x74')],'value':_0x4440c5[_0xcc00('0x75')]};}):_0x5a15c0[_0xcc00('0x2e')]==_0xcc00('0x6e')?[{'name':_0xcc00('0x76'),'value':_0xcc00('0x77')},{'name':_0xcc00('0x78'),'value':_0xcc00('0x79')}]:[]};})};}})['then'](respondWithResult(_0x3afa13,null))[_0xcc00('0x42')](function(_0x2e01fe){var _0x5b7a78=_0x4dcd50[_0xcc00('0x31')][_0xcc00('0x7a')]?0x1f4:_0x2e01fe[_0xcc00('0x7b')]||0x1f4;logger[_0xcc00('0x7c')](_0xcc00('0x7d'),_0xcc00('0x56'),_0x5b7a78,JSON[_0xcc00('0x7e')](_0x2e01fe));delete _0x2e01fe[_0xcc00('0x28')];if(_0x5b7a78===0x191){_0x5b7a78=0x190;}_0x3afa13[_0xcc00('0x1b')](_0x5b7a78)[_0xcc00('0x29')](_0x4dcd50[_0xcc00('0x31')][_0xcc00('0x7a')]?{'message':'Wrong\x20credentials','statusCode':_0x2e01fe[_0xcc00('0x7b')]}:_0x2e01fe);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 8607316..31a75cb 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 _0xce27=['SalesforceAccount','int_salesforce_accounts','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce27,0x1af));var _0x7ce2=function(_0x5bf61d,_0x24c4bb){_0x5bf61d=_0x5bf61d-0x0;var _0x54f4e3=_0xce27[_0x5bf61d];return _0x54f4e3;};'use strict';var _=require('lodash');var util=require(_0x7ce2('0x0'));var logger=require(_0x7ce2('0x1'))('api');var moment=require(_0x7ce2('0x2'));var BPromise=require(_0x7ce2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7ce2('0x4'));var rimraf=require(_0x7ce2('0x5'));var config=require(_0x7ce2('0x6'));var attributes=require(_0x7ce2('0x7'));var integrations=require(_0x7ce2('0x8'));module[_0x7ce2('0x9')]=function(_0x4f4f7f,_0x420d10){return _0x4f4f7f[_0x7ce2('0xa')](_0x7ce2('0xb'),attributes,{'tableName':_0x7ce2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x50a0=['define','SalesforceAccount','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x4826a0,_0x4ba0f6){var _0x3558e9=function(_0x3764cd){while(--_0x3764cd){_0x4826a0['push'](_0x4826a0['shift']());}};_0x3558e9(++_0x4ba0f6);}(_0x50a0,0x80));var _0x050a=function(_0x50a711,_0x1b373a){_0x50a711=_0x50a711-0x0;var _0x1139a1=_0x50a0[_0x50a711];return _0x1139a1;};'use strict';var _=require(_0x050a('0x0'));var util=require(_0x050a('0x1'));var logger=require(_0x050a('0x2'))('api');var moment=require(_0x050a('0x3'));var BPromise=require(_0x050a('0x4'));var rp=require(_0x050a('0x5'));var fs=require('fs');var path=require(_0x050a('0x6'));var rimraf=require(_0x050a('0x7'));var config=require(_0x050a('0x8'));var attributes=require(_0x050a('0x9'));var integrations=require(_0x050a('0xa'));module[_0x050a('0xb')]=function(_0x33fa5e,_0x3bc19f){return _0x33fa5e[_0x050a('0xc')](_0x050a('0xd'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 087ae75..fb5c080 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 _0x0528=['model','then','info','debug','ShowSalesforceAccount','find','attributes','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','SalesforceAccount,\x20%s,\x20%s','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetSalesforceAccount','findAll','options','raw','where','limit','include','map'];(function(_0x26d241,_0x298590){var _0x5ba828=function(_0x124c3e){while(--_0x124c3e){_0x26d241['push'](_0x26d241['shift']());}};_0x5ba828(++_0x298590);}(_0x0528,0x172));var _0x8052=function(_0x27ae0e,_0x38d538){_0x27ae0e=_0x27ae0e-0x0;var _0xd4a521=_0x0528[_0x27ae0e];return _0xd4a521;};'use strict';var _=require('lodash');var util=require(_0x8052('0x0'));var moment=require(_0x8052('0x1'));var BPromise=require(_0x8052('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8052('0x3'))['db'];var utils=require(_0x8052('0x4'));var logger=require('../../config/logger')(_0x8052('0x5'));var config=require(_0x8052('0x6'));var jayson=require(_0x8052('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x31f171,_0x50d645,_0x17c0c5){return new BPromise(function(_0x528d04,_0x3dd78e){return client[_0x8052('0x8')](_0x31f171,_0x17c0c5)['then'](function(_0x5efc6b){logger['info'](_0x8052('0x9'),_0x50d645,'request\x20sent');logger['debug'](_0x8052('0xa'),_0x50d645,_0x8052('0xb'),JSON[_0x8052('0xc')](_0x5efc6b));if(_0x5efc6b['error']){if(_0x5efc6b[_0x8052('0xd')][_0x8052('0xe')]===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x50d645,_0x5efc6b['error'][_0x8052('0xf')]);return _0x3dd78e(_0x5efc6b[_0x8052('0xd')][_0x8052('0xf')]);}logger[_0x8052('0xd')](_0x8052('0x9'),_0x50d645,_0x5efc6b['error']['message']);return _0x528d04(_0x5efc6b[_0x8052('0xd')][_0x8052('0xf')]);}else{logger['info'](_0x8052('0x9'),_0x50d645,_0x8052('0xb'));_0x528d04(_0x5efc6b[_0x8052('0x10')]['message']);}})[_0x8052('0x11')](function(_0xb52aaa){logger[_0x8052('0xd')](_0x8052('0x9'),_0x50d645,_0xb52aaa);_0x3dd78e(_0xb52aaa);});});}exports[_0x8052('0x12')]=function(_0x1aae9b){var _0x3a66d6=this;return new Promise(function(_0x1b5cb7,_0x51a0ce){return db['SalesforceAccount'][_0x8052('0x13')]({'raw':_0x1aae9b['options']?_0x1aae9b[_0x8052('0x14')][_0x8052('0x15')]===undefined?!![]:![]:!![],'where':_0x1aae9b[_0x8052('0x14')]?_0x1aae9b[_0x8052('0x14')][_0x8052('0x16')]||null:null,'attributes':_0x1aae9b[_0x8052('0x14')]?_0x1aae9b[_0x8052('0x14')]['attributes']||null:null,'limit':_0x1aae9b[_0x8052('0x14')]?_0x1aae9b['options'][_0x8052('0x17')]||null:null,'include':_0x1aae9b[_0x8052('0x14')]?_0x1aae9b['options'][_0x8052('0x18')]?_[_0x8052('0x19')](_0x1aae9b[_0x8052('0x14')]['include'],function(_0xb2c6f0){return{'model':db[_0xb2c6f0['model']],'as':_0xb2c6f0['as'],'attributes':_0xb2c6f0['attributes'],'include':_0xb2c6f0['include']?_[_0x8052('0x19')](_0xb2c6f0[_0x8052('0x18')],function(_0x586a24){return{'model':db[_0x586a24[_0x8052('0x1a')]],'as':_0x586a24['as'],'attributes':_0x586a24['attributes'],'include':_0x586a24[_0x8052('0x18')]?_[_0x8052('0x19')](_0x586a24[_0x8052('0x18')],function(_0xecf0ac){return{'model':db[_0xecf0ac[_0x8052('0x1a')]],'as':_0xecf0ac['as'],'attributes':_0xecf0ac['attributes']};}):[]};}):[]};}):[]:[]})[_0x8052('0x1b')](function(_0x8fd427){logger[_0x8052('0x1c')]('GetSalesforceAccount',_0x1aae9b);logger[_0x8052('0x1d')](_0x8052('0x12'),_0x1aae9b,JSON[_0x8052('0xc')](_0x8fd427));_0x1b5cb7(_0x8fd427);})[_0x8052('0x11')](function(_0x462979){logger['error'](_0x8052('0x12'),_0x462979[_0x8052('0xf')],_0x1aae9b);_0x51a0ce(_0x3a66d6[_0x8052('0xd')](0x1f4,_0x462979[_0x8052('0xf')]));});});};exports[_0x8052('0x1e')]=function(_0x2aa717){var _0x47a198=this;return new Promise(function(_0x5dcd65,_0x5b944c){return db['SalesforceAccount'][_0x8052('0x1f')]({'raw':_0x2aa717[_0x8052('0x14')]?_0x2aa717[_0x8052('0x14')][_0x8052('0x15')]===undefined?!![]:![]:!![],'where':_0x2aa717['options']?_0x2aa717['options'][_0x8052('0x16')]||null:null,'attributes':_0x2aa717[_0x8052('0x14')]?_0x2aa717[_0x8052('0x14')][_0x8052('0x20')]||null:null,'include':_0x2aa717['options']?_0x2aa717[_0x8052('0x14')][_0x8052('0x18')]?_['map'](_0x2aa717[_0x8052('0x14')]['include'],function(_0x4a884f){return{'model':db[_0x4a884f[_0x8052('0x1a')]],'as':_0x4a884f['as'],'attributes':_0x4a884f[_0x8052('0x20')],'include':_0x4a884f[_0x8052('0x18')]?_[_0x8052('0x19')](_0x4a884f[_0x8052('0x18')],function(_0x2ce384){return{'model':db[_0x2ce384[_0x8052('0x1a')]],'as':_0x2ce384['as'],'attributes':_0x2ce384[_0x8052('0x20')],'include':_0x2ce384['include']?_[_0x8052('0x19')](_0x2ce384[_0x8052('0x18')],function(_0x43e598){return{'model':db[_0x43e598[_0x8052('0x1a')]],'as':_0x43e598['as'],'attributes':_0x43e598[_0x8052('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c03a9){logger[_0x8052('0x1c')](_0x8052('0x1e'),_0x2aa717);logger[_0x8052('0x1d')](_0x8052('0x1e'),_0x2aa717,JSON[_0x8052('0xc')](_0x1c03a9));_0x5dcd65(_0x1c03a9);})[_0x8052('0x11')](function(_0x56281b){logger['error']('ShowSalesforceAccount',_0x56281b[_0x8052('0xf')],_0x2aa717);_0x5b944c(_0x47a198['error'](0x1f4,_0x56281b[_0x8052('0xf')]));});});}; \ No newline at end of file +var _0x1543=['catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','map','include','model','ShowSalesforceAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','debug','request\x20sent','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','info','result'];(function(_0x399057,_0x3eb1ac){var _0x503d15=function(_0x1eb1f9){while(--_0x1eb1f9){_0x399057['push'](_0x399057['shift']());}};_0x503d15(++_0x3eb1ac);}(_0x1543,0x109));var _0x3154=function(_0x5a378d,_0x5b2ea1){_0x5a378d=_0x5a378d-0x0;var _0x1e6c32=_0x1543[_0x5a378d];return _0x1e6c32;};'use strict';var _=require(_0x3154('0x0'));var util=require(_0x3154('0x1'));var moment=require('moment');var BPromise=require(_0x3154('0x2'));var rs=require(_0x3154('0x3'));var fs=require('fs');var Redis=require(_0x3154('0x4'));var db=require(_0x3154('0x5'))['db'];var utils=require(_0x3154('0x6'));var logger=require(_0x3154('0x7'))(_0x3154('0x8'));var config=require(_0x3154('0x9'));var jayson=require(_0x3154('0xa'));var client=jayson['client'][_0x3154('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x217cac,_0x14d74b,_0x5ba44c){return new BPromise(function(_0x1ef5fa,_0x52c3fb){return client[_0x3154('0xc')](_0x217cac,_0x5ba44c)[_0x3154('0xd')](function(_0x95c22d){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x14d74b,'request\x20sent');logger[_0x3154('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x14d74b,_0x3154('0xf'),JSON[_0x3154('0x10')](_0x95c22d));if(_0x95c22d[_0x3154('0x11')]){if(_0x95c22d['error'][_0x3154('0x12')]===0x1f4){logger[_0x3154('0x11')](_0x3154('0x13'),_0x14d74b,_0x95c22d[_0x3154('0x11')][_0x3154('0x14')]);return _0x52c3fb(_0x95c22d['error'][_0x3154('0x14')]);}logger[_0x3154('0x11')](_0x3154('0x13'),_0x14d74b,_0x95c22d[_0x3154('0x11')][_0x3154('0x14')]);return _0x1ef5fa(_0x95c22d['error'][_0x3154('0x14')]);}else{logger[_0x3154('0x15')](_0x3154('0x13'),_0x14d74b,'request\x20sent');_0x1ef5fa(_0x95c22d[_0x3154('0x16')][_0x3154('0x14')]);}})[_0x3154('0x17')](function(_0x3d2953){logger[_0x3154('0x11')](_0x3154('0x13'),_0x14d74b,_0x3d2953);_0x52c3fb(_0x3d2953);});});}exports[_0x3154('0x18')]=function(_0x553b5d){var _0x1b0c47=this;return new Promise(function(_0x5485f9,_0x451ec8){return db[_0x3154('0x19')][_0x3154('0x1a')]({'raw':_0x553b5d['options']?_0x553b5d[_0x3154('0x1b')][_0x3154('0x1c')]===undefined?!![]:![]:!![],'where':_0x553b5d[_0x3154('0x1b')]?_0x553b5d[_0x3154('0x1b')][_0x3154('0x1d')]||null:null,'attributes':_0x553b5d[_0x3154('0x1b')]?_0x553b5d[_0x3154('0x1b')][_0x3154('0x1e')]||null:null,'limit':_0x553b5d[_0x3154('0x1b')]?_0x553b5d[_0x3154('0x1b')][_0x3154('0x1f')]||null:null,'include':_0x553b5d[_0x3154('0x1b')]?_0x553b5d[_0x3154('0x1b')]['include']?_[_0x3154('0x20')](_0x553b5d[_0x3154('0x1b')][_0x3154('0x21')],function(_0x366681){return{'model':db[_0x366681[_0x3154('0x22')]],'as':_0x366681['as'],'attributes':_0x366681['attributes'],'include':_0x366681[_0x3154('0x21')]?_[_0x3154('0x20')](_0x366681['include'],function(_0x1b0697){return{'model':db[_0x1b0697[_0x3154('0x22')]],'as':_0x1b0697['as'],'attributes':_0x1b0697[_0x3154('0x1e')],'include':_0x1b0697[_0x3154('0x21')]?_[_0x3154('0x20')](_0x1b0697[_0x3154('0x21')],function(_0x20a3d6){return{'model':db[_0x20a3d6[_0x3154('0x22')]],'as':_0x20a3d6['as'],'attributes':_0x20a3d6[_0x3154('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3154('0xd')](function(_0x5cbad7){logger['info'](_0x3154('0x18'),_0x553b5d);logger[_0x3154('0xe')](_0x3154('0x18'),_0x553b5d,JSON[_0x3154('0x10')](_0x5cbad7));_0x5485f9(_0x5cbad7);})['catch'](function(_0x36a805){logger[_0x3154('0x11')](_0x3154('0x18'),_0x36a805[_0x3154('0x14')],_0x553b5d);_0x451ec8(_0x1b0c47[_0x3154('0x11')](0x1f4,_0x36a805[_0x3154('0x14')]));});});};exports[_0x3154('0x23')]=function(_0x42c184){var _0x34cd91=this;return new Promise(function(_0x4bbbd4,_0x215b17){return db[_0x3154('0x19')]['find']({'raw':_0x42c184['options']?_0x42c184[_0x3154('0x1b')][_0x3154('0x1c')]===undefined?!![]:![]:!![],'where':_0x42c184[_0x3154('0x1b')]?_0x42c184['options'][_0x3154('0x1d')]||null:null,'attributes':_0x42c184[_0x3154('0x1b')]?_0x42c184['options'][_0x3154('0x1e')]||null:null,'include':_0x42c184[_0x3154('0x1b')]?_0x42c184[_0x3154('0x1b')][_0x3154('0x21')]?_['map'](_0x42c184[_0x3154('0x1b')][_0x3154('0x21')],function(_0x48f4ca){return{'model':db[_0x48f4ca[_0x3154('0x22')]],'as':_0x48f4ca['as'],'attributes':_0x48f4ca[_0x3154('0x1e')],'include':_0x48f4ca[_0x3154('0x21')]?_[_0x3154('0x20')](_0x48f4ca['include'],function(_0x213dff){return{'model':db[_0x213dff['model']],'as':_0x213dff['as'],'attributes':_0x213dff[_0x3154('0x1e')],'include':_0x213dff[_0x3154('0x21')]?_[_0x3154('0x20')](_0x213dff[_0x3154('0x21')],function(_0x51a8b0){return{'model':db[_0x51a8b0[_0x3154('0x22')]],'as':_0x51a8b0['as'],'attributes':_0x51a8b0[_0x3154('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3154('0xd')](function(_0x268e58){logger[_0x3154('0x15')]('ShowSalesforceAccount',_0x42c184);logger[_0x3154('0xe')](_0x3154('0x23'),_0x42c184,JSON[_0x3154('0x10')](_0x268e58));_0x4bbbd4(_0x268e58);})[_0x3154('0x17')](function(_0x3ad99a){logger['error'](_0x3154('0x23'),_0x3ad99a[_0x3154('0x14')],_0x42c184);_0x215b17(_0x34cd91[_0x3154('0x11')](0x1f4,_0x3ad99a['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 540eb8c..19796b9 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 _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(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xdb28,0x106));var _0x8db2=function(_0x4f7777,_0x412e84){_0x4f7777=_0x4f7777-0x0;var _0x270587=_0xdb28[_0x4f7777];return _0x270587;};'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 +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(_0x302dbb,_0x8e0d2){var _0x342718=function(_0x33774a){while(--_0x33774a){_0x302dbb['push'](_0x302dbb['shift']());}};_0x342718(++_0x8e0d2);}(_0x7a54,0x106));var _0x47a5=function(_0x178c0b,_0x177dbd){_0x178c0b=_0x178c0b-0x0;var _0x57db0b=_0x7a54[_0x178c0b];return _0x57db0b;};'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 diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index f88e4cd..b6c173d 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 _0x492c=['contact_lead','contact','lead','account_contact_lead','account','nothing','sequelize','STRING','ENUM','Task','Case'];(function(_0x4b4079,_0x48d78e){var _0x2f774d=function(_0x423bd4){while(--_0x423bd4){_0x4b4079['push'](_0x4b4079['shift']());}};_0x2f774d(++_0x48d78e);}(_0x492c,0x145));var _0xc492=function(_0x24edb0,_0xaa60a3){_0x24edb0=_0x24edb0-0x0;var _0x1626b2=_0x492c[_0x24edb0];return _0x1626b2;};'use strict';var Sequelize=require(_0xc492('0x0'));module['exports']={'name':{'type':Sequelize[_0xc492('0x1')]},'description':{'type':Sequelize[_0xc492('0x1')]},'ticketType':{'type':Sequelize[_0xc492('0x2')](_0xc492('0x3'),_0xc492('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xc492('0x2')](_0xc492('0x5'),_0xc492('0x6'),_0xc492('0x7'),_0xc492('0x8'),_0xc492('0x9')),'defaultValue':_0xc492('0x5')},'moduleCreate':{'type':Sequelize[_0xc492('0x2')](_0xc492('0xa'),_0xc492('0x6'),_0xc492('0x7'),'account'),'defaultValue':_0xc492('0x7')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0xc492('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xc492('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xc492('0x1')]}}; \ No newline at end of file +var _0x6780=['STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','account','nothing','sequelize','exports'];(function(_0x440917,_0x20ea7b){var _0x5e906b=function(_0x27cba5){while(--_0x27cba5){_0x440917['push'](_0x440917['shift']());}};_0x5e906b(++_0x20ea7b);}(_0x6780,0x9a));var _0x0678=function(_0x3378e3,_0x2b218b){_0x3378e3=_0x3378e3-0x0;var _0x55c58b=_0x6780[_0x3378e3];return _0x55c58b;};'use strict';var Sequelize=require(_0x0678('0x0'));module[_0x0678('0x1')]={'name':{'type':Sequelize[_0x0678('0x2')]},'description':{'type':Sequelize[_0x0678('0x2')]},'ticketType':{'type':Sequelize[_0x0678('0x3')](_0x0678('0x4'),_0x0678('0x5')),'defaultValue':_0x0678('0x4')},'moduleSearch':{'type':Sequelize[_0x0678('0x3')](_0x0678('0x6'),_0x0678('0x7'),_0x0678('0x8'),_0x0678('0x9'),_0x0678('0xa')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x0678('0x3')](_0x0678('0xb'),'contact',_0x0678('0x8'),_0x0678('0xa')),'defaultValue':_0x0678('0x8')},'leadId':{'type':Sequelize[_0x0678('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x0678('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x0678('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 0f93dc0..7ffe809 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 _0x69b4=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','SalesforceConfiguration','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','length','create','body','find','params','SalesforceField','merge','getFields','getSubjects','findOne','order','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x69b4,0x133));var _0x469b=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x69b4[_0x465028];return _0xb783d4;};'use strict';var emlformat=require(_0x469b('0x0'));var rimraf=require(_0x469b('0x1'));var zipdir=require(_0x469b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x469b('0x3'));var moment=require(_0x469b('0x4'));var BPromise=require(_0x469b('0x5'));var Mustache=require(_0x469b('0x6'));var util=require(_0x469b('0x7'));var path=require(_0x469b('0x8'));var sox=require(_0x469b('0x9'));var csv=require(_0x469b('0xa'));var ejs=require(_0x469b('0xb'));var fs=require('fs');var fs_extra=require(_0x469b('0xc'));var _=require(_0x469b('0xd'));var squel=require('squel');var crypto=require(_0x469b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x469b('0xf'));var toCsv=require(_0x469b('0xa'));var querystring=require(_0x469b('0x10'));var Papa=require(_0x469b('0x11'));var Redis=require('ioredis');var authService=require(_0x469b('0x12'));var qs=require(_0x469b('0x13'));var as=require(_0x469b('0x14'));var hardwareService=require(_0x469b('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x469b('0x16'));var licenseUtil=require(_0x469b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16b8af,_0x272d0e){_0x272d0e=_0x272d0e||0xcc;return function(_0xe35beb){if(_0xe35beb){return _0x16b8af[_0x469b('0x18')](_0x272d0e);}return _0x16b8af[_0x469b('0x19')](_0x272d0e)['end']();};}function respondWithResult(_0x5b164a,_0x3d392e){_0x3d392e=_0x3d392e||0xc8;return function(_0x28745e){if(_0x28745e){return _0x5b164a['status'](_0x3d392e)[_0x469b('0x1a')](_0x28745e);}};}function respondWithFilteredResult(_0x14a16a,_0x4cbc4a){return function(_0x5c359a){if(_0x5c359a){var _0x5f0b5f=typeof _0x4cbc4a['offset']===_0x469b('0x1b')&&typeof _0x4cbc4a[_0x469b('0x1c')]===_0x469b('0x1b');var _0x303238=_0x5c359a[_0x469b('0x1d')];var _0x1b4a87=_0x5f0b5f?0x0:_0x4cbc4a['offset'];var _0x45d8e2=_0x5f0b5f?_0x5c359a[_0x469b('0x1d')]:_0x4cbc4a[_0x469b('0x1e')]+_0x4cbc4a[_0x469b('0x1c')];var _0xd9b6d4;if(_0x45d8e2>=_0x303238){_0x45d8e2=_0x303238;_0xd9b6d4=0xc8;}else{_0xd9b6d4=0xce;}_0x14a16a['status'](_0xd9b6d4);return _0x14a16a[_0x469b('0x1f')](_0x469b('0x20'),_0x1b4a87+'-'+_0x45d8e2+'/'+_0x303238)[_0x469b('0x1a')](_0x5c359a);}return null;};}function patchUpdates(_0x2c3c4b){return function(_0x53aad8){try{jsonpatch[_0x469b('0x21')](_0x53aad8,_0x2c3c4b,!![]);}catch(_0x3f1ac9){return BPromise[_0x469b('0x22')](_0x3f1ac9);}return _0x53aad8[_0x469b('0x23')]();};}function saveUpdates(_0x28ba38,_0x4f4ad3){return function(_0x226a3a){if(_0x226a3a){return _0x226a3a[_0x469b('0x24')](_0x28ba38)[_0x469b('0x25')](function(_0x28e517){return _0x28e517;});}return null;};}function removeEntity(_0x268866,_0x488058){return function(_0x4866e4){if(_0x4866e4){return _0x4866e4[_0x469b('0x26')]()[_0x469b('0x25')](function(){_0x268866[_0x469b('0x19')](0xcc)[_0x469b('0x27')]();});}};}function handleEntityNotFound(_0x1f44a1,_0x406f3f){return function(_0x327a35){if(!_0x327a35){_0x1f44a1[_0x469b('0x18')](0x194);}return _0x327a35;};}function handleError(_0x4cf86a,_0x1aef4d){_0x1aef4d=_0x1aef4d||0x1f4;return function(_0x220b69){logger[_0x469b('0x28')](_0x220b69[_0x469b('0x29')]);if(_0x220b69[_0x469b('0x2a')]){delete _0x220b69[_0x469b('0x2a')];}_0x4cf86a[_0x469b('0x19')](_0x1aef4d)['send'](_0x220b69);};}exports[_0x469b('0x2b')]=function(_0x370947,_0x2aa10f){var _0x39ae53={},_0x2569f8={},_0xcbd503={'count':0x0,'rows':[]};var _0x210c0f=_[_0x469b('0x2c')](db[_0x469b('0x2d')]['rawAttributes'],function(_0x27e239){return{'name':_0x27e239['fieldName'],'type':_0x27e239[_0x469b('0x2e')][_0x469b('0x2f')]};});_0x2569f8[_0x469b('0x30')]=_['map'](_0x210c0f,'name');_0x2569f8[_0x469b('0x31')]=_[_0x469b('0x32')](_0x370947[_0x469b('0x31')]);_0x2569f8[_0x469b('0x33')]=_[_0x469b('0x34')](_0x2569f8[_0x469b('0x30')],_0x2569f8[_0x469b('0x31')]);_0x39ae53[_0x469b('0x35')]=_[_0x469b('0x34')](_0x2569f8[_0x469b('0x30')],qs[_0x469b('0x36')](_0x370947[_0x469b('0x31')]['fields']));_0x39ae53['attributes']=_0x39ae53[_0x469b('0x35')]['length']?_0x39ae53['attributes']:_0x2569f8[_0x469b('0x30')];if(!_0x370947[_0x469b('0x31')][_0x469b('0x37')](_0x469b('0x38'))){_0x39ae53[_0x469b('0x1c')]=qs[_0x469b('0x1c')](_0x370947[_0x469b('0x31')][_0x469b('0x1c')]);_0x39ae53['offset']=qs[_0x469b('0x1e')](_0x370947[_0x469b('0x31')][_0x469b('0x1e')]);}_0x39ae53['order']=qs[_0x469b('0x39')](_0x370947[_0x469b('0x31')][_0x469b('0x39')]);_0x39ae53['where']=qs[_0x469b('0x33')](_[_0x469b('0x3a')](_0x370947[_0x469b('0x31')],_0x2569f8[_0x469b('0x33')]),_0x210c0f);if(_0x370947[_0x469b('0x31')][_0x469b('0x3b')]){_0x39ae53[_0x469b('0x3c')]=_['merge'](_0x39ae53[_0x469b('0x3c')],{'$or':_[_0x469b('0x2c')](_0x210c0f,function(_0x431bca){if(_0x431bca[_0x469b('0x2e')]!==_0x469b('0x3d')){var _0x8db319={};_0x8db319[_0x431bca[_0x469b('0x2a')]]={'$like':'%'+_0x370947[_0x469b('0x31')][_0x469b('0x3b')]+'%'};return _0x8db319;}})});}_0x39ae53=_['merge']({},_0x39ae53,_0x370947[_0x469b('0x3e')]);var _0x188c34={'where':_0x39ae53[_0x469b('0x3c')]};return db[_0x469b('0x2d')]['count'](_0x188c34)[_0x469b('0x25')](function(_0xb7b8e1){_0xcbd503['count']=_0xb7b8e1;if(_0x370947[_0x469b('0x31')][_0x469b('0x3f')]){_0x39ae53[_0x469b('0x40')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x469b('0x41')](_0x39ae53);})['then'](function(_0x3c3303){_0xcbd503['rows']=_0x3c3303;return _0xcbd503;})[_0x469b('0x25')](respondWithFilteredResult(_0x2aa10f,_0x39ae53))[_0x469b('0x42')](handleError(_0x2aa10f,null));};exports[_0x469b('0x43')]=function(_0x53bc9d,_0x75614b){var _0x2b68e5={'raw':![],'where':{'id':_0x53bc9d['params']['id']}},_0x41a411={};_0x41a411[_0x469b('0x30')]=_[_0x469b('0x32')](db[_0x469b('0x2d')][_0x469b('0x44')]);_0x41a411[_0x469b('0x31')]=_[_0x469b('0x32')](_0x53bc9d['query']);_0x41a411['filters']=_[_0x469b('0x34')](_0x41a411[_0x469b('0x30')],_0x41a411[_0x469b('0x31')]);_0x2b68e5[_0x469b('0x35')]=_[_0x469b('0x34')](_0x41a411[_0x469b('0x30')],qs[_0x469b('0x36')](_0x53bc9d['query'][_0x469b('0x36')]));_0x2b68e5[_0x469b('0x35')]=_0x2b68e5[_0x469b('0x35')][_0x469b('0x45')]?_0x2b68e5['attributes']:_0x41a411[_0x469b('0x30')];if(_0x53bc9d['query'][_0x469b('0x3f')]){_0x2b68e5[_0x469b('0x40')]=[{'all':!![]}];}_0x2b68e5=_['merge']({},_0x2b68e5,_0x53bc9d[_0x469b('0x3e')]);return db['SalesforceConfiguration']['find'](_0x2b68e5)[_0x469b('0x25')](handleEntityNotFound(_0x75614b,null))['then'](respondWithResult(_0x75614b,null))[_0x469b('0x42')](handleError(_0x75614b,null));};exports[_0x469b('0x46')]=function(_0x44592c,_0x6fd299){return db[_0x469b('0x2d')][_0x469b('0x46')](_0x44592c[_0x469b('0x47')],{})[_0x469b('0x25')](respondWithResult(_0x6fd299,0xc9))[_0x469b('0x42')](handleError(_0x6fd299,null));};exports[_0x469b('0x24')]=function(_0x15412d,_0x5570e3){if(_0x15412d[_0x469b('0x47')]['id']){delete _0x15412d[_0x469b('0x47')]['id'];}return db[_0x469b('0x2d')][_0x469b('0x48')]({'where':{'id':_0x15412d['params']['id']}})[_0x469b('0x25')](handleEntityNotFound(_0x5570e3,null))['then'](saveUpdates(_0x15412d[_0x469b('0x47')],null))[_0x469b('0x25')](respondWithResult(_0x5570e3,null))[_0x469b('0x42')](handleError(_0x5570e3,null));};exports[_0x469b('0x26')]=function(_0x5f0851,_0x2654ef){return db[_0x469b('0x2d')]['find']({'where':{'id':_0x5f0851[_0x469b('0x49')]['id']}})[_0x469b('0x25')](handleEntityNotFound(_0x2654ef,null))[_0x469b('0x25')](removeEntity(_0x2654ef,null))[_0x469b('0x42')](handleError(_0x2654ef,null));};exports['getFields']=function(_0x2e4dd2,_0x234278,_0x3f4c86){var _0x314d8c={};var _0xd8f76b={};var _0x1ee543;var _0x2099af;return db[_0x469b('0x2d')]['findOne']({'where':{'id':_0x2e4dd2[_0x469b('0x49')]['id']}})['then'](handleEntityNotFound(_0x234278,null))[_0x469b('0x25')](function(_0x1d28b9){if(_0x1d28b9){_0x1ee543=_0x1d28b9;_0xd8f76b['model']=_[_0x469b('0x32')](db[_0x469b('0x4a')][_0x469b('0x44')]);_0xd8f76b[_0x469b('0x31')]=_[_0x469b('0x32')](_0x2e4dd2[_0x469b('0x31')]);_0xd8f76b[_0x469b('0x33')]=_[_0x469b('0x34')](_0xd8f76b[_0x469b('0x30')],_0xd8f76b['query']);_0x314d8c['attributes']=_[_0x469b('0x34')](_0xd8f76b[_0x469b('0x30')],qs[_0x469b('0x36')](_0x2e4dd2[_0x469b('0x31')][_0x469b('0x36')]));_0x314d8c[_0x469b('0x35')]=_0x314d8c[_0x469b('0x35')][_0x469b('0x45')]?_0x314d8c[_0x469b('0x35')]:_0xd8f76b['model'];_0x314d8c['order']=qs['sort'](_0x2e4dd2['query']['sort']);_0x314d8c[_0x469b('0x3c')]=qs[_0x469b('0x33')](_[_0x469b('0x3a')](_0x2e4dd2[_0x469b('0x31')],_0xd8f76b[_0x469b('0x33')]));if(_0x2e4dd2['query'][_0x469b('0x3b')]){_0x314d8c['where']=_['merge'](_0x314d8c[_0x469b('0x3c')],{'$or':_[_0x469b('0x2c')](_0x314d8c['attributes'],function(_0x56e0c6){var _0x49d58b={};_0x49d58b[_0x56e0c6]={'$like':'%'+_0x2e4dd2[_0x469b('0x31')][_0x469b('0x3b')]+'%'};return _0x49d58b;})});}_0x314d8c=_[_0x469b('0x4b')]({},_0x314d8c,_0x2e4dd2[_0x469b('0x3e')]);return _0x1ee543[_0x469b('0x4c')](_0x314d8c);}})['then'](function(_0x465860){if(_0x465860){_0x2099af=_0x465860[_0x469b('0x45')];if(!_0x2e4dd2[_0x469b('0x31')][_0x469b('0x37')]('nolimit')){_0x314d8c[_0x469b('0x1c')]=qs['limit'](_0x2e4dd2[_0x469b('0x31')][_0x469b('0x1c')]);_0x314d8c['offset']=qs[_0x469b('0x1e')](_0x2e4dd2[_0x469b('0x31')][_0x469b('0x1e')]);}return _0x1ee543[_0x469b('0x4c')](_0x314d8c);}})[_0x469b('0x25')](function(_0x59f4eb){if(_0x59f4eb){return _0x59f4eb?{'count':_0x2099af,'rows':_0x59f4eb}:null;}})['then'](respondWithResult(_0x234278,null))['catch'](handleError(_0x234278,null));};exports[_0x469b('0x4d')]=function(_0x21205e,_0x3ea1fa,_0x2c3868){var _0x2b4ab7={};var _0x46b173={};var _0x576cfd;var _0x5ce183;return db[_0x469b('0x2d')][_0x469b('0x4e')]({'where':{'id':_0x21205e[_0x469b('0x49')]['id']}})[_0x469b('0x25')](handleEntityNotFound(_0x3ea1fa,null))['then'](function(_0x3d0e8f){if(_0x3d0e8f){_0x576cfd=_0x3d0e8f;_0x46b173[_0x469b('0x30')]=_[_0x469b('0x32')](db[_0x469b('0x4a')][_0x469b('0x44')]);_0x46b173[_0x469b('0x31')]=_[_0x469b('0x32')](_0x21205e['query']);_0x46b173[_0x469b('0x33')]=_[_0x469b('0x34')](_0x46b173[_0x469b('0x30')],_0x46b173['query']);_0x2b4ab7[_0x469b('0x35')]=_[_0x469b('0x34')](_0x46b173[_0x469b('0x30')],qs[_0x469b('0x36')](_0x21205e[_0x469b('0x31')][_0x469b('0x36')]));_0x2b4ab7['attributes']=_0x2b4ab7[_0x469b('0x35')][_0x469b('0x45')]?_0x2b4ab7[_0x469b('0x35')]:_0x46b173[_0x469b('0x30')];_0x2b4ab7[_0x469b('0x4f')]=qs[_0x469b('0x39')](_0x21205e[_0x469b('0x31')]['sort']);_0x2b4ab7[_0x469b('0x3c')]=qs['filters'](_[_0x469b('0x3a')](_0x21205e[_0x469b('0x31')],_0x46b173[_0x469b('0x33')]));if(_0x21205e[_0x469b('0x31')]['filter']){_0x2b4ab7['where']=_['merge'](_0x2b4ab7[_0x469b('0x3c')],{'$or':_[_0x469b('0x2c')](_0x2b4ab7[_0x469b('0x35')],function(_0x1c56cf){var _0x40dca3={};_0x40dca3[_0x1c56cf]={'$like':'%'+_0x21205e['query'][_0x469b('0x3b')]+'%'};return _0x40dca3;})});}_0x2b4ab7=_['merge']({},_0x2b4ab7,_0x21205e[_0x469b('0x3e')]);return _0x576cfd[_0x469b('0x4d')](_0x2b4ab7);}})[_0x469b('0x25')](function(_0x23a183){if(_0x23a183){_0x5ce183=_0x23a183[_0x469b('0x45')];if(!_0x21205e['query'][_0x469b('0x37')](_0x469b('0x38'))){_0x2b4ab7[_0x469b('0x1c')]=qs['limit'](_0x21205e[_0x469b('0x31')][_0x469b('0x1c')]);_0x2b4ab7[_0x469b('0x1e')]=qs[_0x469b('0x1e')](_0x21205e[_0x469b('0x31')][_0x469b('0x1e')]);}return _0x576cfd[_0x469b('0x4d')](_0x2b4ab7);}})['then'](function(_0x298a3a){if(_0x298a3a){return _0x298a3a?{'count':_0x5ce183,'rows':_0x298a3a}:null;}})[_0x469b('0x25')](respondWithResult(_0x3ea1fa,null))[_0x469b('0x42')](handleError(_0x3ea1fa,null));};exports[_0x469b('0x50')]=function(_0x394fd8,_0x45b89a,_0x23b299){var _0xdc3c31={};var _0x5a014d={};var _0x9da724;var _0x4f9747;return db[_0x469b('0x2d')][_0x469b('0x4e')]({'where':{'id':_0x394fd8[_0x469b('0x49')]['id']}})['then'](handleEntityNotFound(_0x45b89a,null))[_0x469b('0x25')](function(_0xf666e1){if(_0xf666e1){_0x9da724=_0xf666e1;_0x5a014d['model']=_['keys'](db[_0x469b('0x4a')][_0x469b('0x44')]);_0x5a014d[_0x469b('0x31')]=_[_0x469b('0x32')](_0x394fd8[_0x469b('0x31')]);_0x5a014d['filters']=_[_0x469b('0x34')](_0x5a014d[_0x469b('0x30')],_0x5a014d['query']);_0xdc3c31[_0x469b('0x35')]=_['intersection'](_0x5a014d[_0x469b('0x30')],qs[_0x469b('0x36')](_0x394fd8[_0x469b('0x31')][_0x469b('0x36')]));_0xdc3c31[_0x469b('0x35')]=_0xdc3c31[_0x469b('0x35')][_0x469b('0x45')]?_0xdc3c31[_0x469b('0x35')]:_0x5a014d['model'];_0xdc3c31['order']=qs[_0x469b('0x39')](_0x394fd8['query'][_0x469b('0x39')]);_0xdc3c31[_0x469b('0x3c')]=qs[_0x469b('0x33')](_[_0x469b('0x3a')](_0x394fd8[_0x469b('0x31')],_0x5a014d[_0x469b('0x33')]));if(_0x394fd8[_0x469b('0x31')][_0x469b('0x3b')]){_0xdc3c31[_0x469b('0x3c')]=_['merge'](_0xdc3c31[_0x469b('0x3c')],{'$or':_['map'](_0xdc3c31[_0x469b('0x35')],function(_0x461b40){var _0x2b989e={};_0x2b989e[_0x461b40]={'$like':'%'+_0x394fd8[_0x469b('0x31')][_0x469b('0x3b')]+'%'};return _0x2b989e;})});}_0xdc3c31=_[_0x469b('0x4b')]({},_0xdc3c31,_0x394fd8[_0x469b('0x3e')]);return _0x9da724[_0x469b('0x50')](_0xdc3c31);}})[_0x469b('0x25')](function(_0xb9dcae){if(_0xb9dcae){_0x4f9747=_0xb9dcae[_0x469b('0x45')];if(!_0x394fd8[_0x469b('0x31')][_0x469b('0x37')](_0x469b('0x38'))){_0xdc3c31['limit']=qs[_0x469b('0x1c')](_0x394fd8[_0x469b('0x31')][_0x469b('0x1c')]);_0xdc3c31[_0x469b('0x1e')]=qs[_0x469b('0x1e')](_0x394fd8['query'][_0x469b('0x1e')]);}return _0x9da724[_0x469b('0x50')](_0xdc3c31);}})[_0x469b('0x25')](function(_0x32bcca){if(_0x32bcca){return _0x32bcca?{'count':_0x4f9747,'rows':_0x32bcca}:null;}})[_0x469b('0x25')](respondWithResult(_0x45b89a,null))[_0x469b('0x42')](handleError(_0x45b89a,null));}; \ No newline at end of file +var _0x8bcc=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','SalesforceConfiguration','findAll','rows','catch','show','rawAttributes','include','find','create','body','params','getFields','findOne','order','getSubjects','SalesforceField','getDescriptions'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x8bcc,0xaa));var _0xc8bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bcc[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc8bc('0x0'));var rimraf=require(_0xc8bc('0x1'));var zipdir=require(_0xc8bc('0x2'));var jsonpatch=require(_0xc8bc('0x3'));var rp=require(_0xc8bc('0x4'));var moment=require(_0xc8bc('0x5'));var BPromise=require(_0xc8bc('0x6'));var Mustache=require(_0xc8bc('0x7'));var util=require(_0xc8bc('0x8'));var path=require(_0xc8bc('0x9'));var sox=require(_0xc8bc('0xa'));var csv=require('to-csv');var ejs=require(_0xc8bc('0xb'));var fs=require('fs');var fs_extra=require(_0xc8bc('0xc'));var _=require(_0xc8bc('0xd'));var squel=require(_0xc8bc('0xe'));var crypto=require(_0xc8bc('0xf'));var jsforce=require(_0xc8bc('0x10'));var deskjs=require(_0xc8bc('0x11'));var toCsv=require(_0xc8bc('0x12'));var querystring=require('querystring');var Papa=require(_0xc8bc('0x13'));var Redis=require(_0xc8bc('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xc8bc('0x15'));var as=require(_0xc8bc('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc8bc('0x17'))(_0xc8bc('0x18'));var utils=require(_0xc8bc('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xc8bc('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20ba92,_0x3e30bc){_0x3e30bc=_0x3e30bc||0xcc;return function(_0x48ada3){if(_0x48ada3){return _0x20ba92['sendStatus'](_0x3e30bc);}return _0x20ba92[_0xc8bc('0x1b')](_0x3e30bc)['end']();};}function respondWithResult(_0x4d7ece,_0x334382){_0x334382=_0x334382||0xc8;return function(_0x545cbf){if(_0x545cbf){return _0x4d7ece['status'](_0x334382)[_0xc8bc('0x1c')](_0x545cbf);}};}function respondWithFilteredResult(_0x6781d8,_0x56ac85){return function(_0x2d9b6b){if(_0x2d9b6b){var _0x901bb7=typeof _0x56ac85['offset']===_0xc8bc('0x1d')&&typeof _0x56ac85[_0xc8bc('0x1e')]===_0xc8bc('0x1d');var _0x306e70=_0x2d9b6b[_0xc8bc('0x1f')];var _0x158ff8=_0x901bb7?0x0:_0x56ac85[_0xc8bc('0x20')];var _0x3bafe6=_0x901bb7?_0x2d9b6b[_0xc8bc('0x1f')]:_0x56ac85[_0xc8bc('0x20')]+_0x56ac85[_0xc8bc('0x1e')];var _0x42ad44;if(_0x3bafe6>=_0x306e70){_0x3bafe6=_0x306e70;_0x42ad44=0xc8;}else{_0x42ad44=0xce;}_0x6781d8[_0xc8bc('0x1b')](_0x42ad44);return _0x6781d8[_0xc8bc('0x21')](_0xc8bc('0x22'),_0x158ff8+'-'+_0x3bafe6+'/'+_0x306e70)[_0xc8bc('0x1c')](_0x2d9b6b);}return null;};}function patchUpdates(_0x223bff){return function(_0x3aa466){try{jsonpatch[_0xc8bc('0x23')](_0x3aa466,_0x223bff,!![]);}catch(_0x4c99f8){return BPromise[_0xc8bc('0x24')](_0x4c99f8);}return _0x3aa466[_0xc8bc('0x25')]();};}function saveUpdates(_0x2d635f,_0x5f4cda){return function(_0x4be65f){if(_0x4be65f){return _0x4be65f[_0xc8bc('0x26')](_0x2d635f)[_0xc8bc('0x27')](function(_0x5f0e2d){return _0x5f0e2d;});}return null;};}function removeEntity(_0x4ce7d,_0x12ffcd){return function(_0x2851bb){if(_0x2851bb){return _0x2851bb[_0xc8bc('0x28')]()[_0xc8bc('0x27')](function(){_0x4ce7d[_0xc8bc('0x1b')](0xcc)[_0xc8bc('0x29')]();});}};}function handleEntityNotFound(_0x3a560a,_0x48b29d){return function(_0x57169f){if(!_0x57169f){_0x3a560a[_0xc8bc('0x2a')](0x194);}return _0x57169f;};}function handleError(_0x462f2b,_0x3c2513){_0x3c2513=_0x3c2513||0x1f4;return function(_0x2bc04f){logger[_0xc8bc('0x2b')](_0x2bc04f[_0xc8bc('0x2c')]);if(_0x2bc04f['name']){delete _0x2bc04f[_0xc8bc('0x2d')];}_0x462f2b[_0xc8bc('0x1b')](_0x3c2513)['send'](_0x2bc04f);};}exports['index']=function(_0x3a42fd,_0x15150a){var _0x3a72a0={},_0x31cd28={},_0x319cc4={'count':0x0,'rows':[]};var _0x512047=_['map'](db['SalesforceConfiguration']['rawAttributes'],function(_0x2b955b){return{'name':_0x2b955b[_0xc8bc('0x2e')],'type':_0x2b955b[_0xc8bc('0x2f')][_0xc8bc('0x30')]};});_0x31cd28[_0xc8bc('0x31')]=_[_0xc8bc('0x32')](_0x512047,_0xc8bc('0x2d'));_0x31cd28[_0xc8bc('0x33')]=_[_0xc8bc('0x34')](_0x3a42fd[_0xc8bc('0x33')]);_0x31cd28[_0xc8bc('0x35')]=_[_0xc8bc('0x36')](_0x31cd28[_0xc8bc('0x31')],_0x31cd28['query']);_0x3a72a0[_0xc8bc('0x37')]=_['intersection'](_0x31cd28[_0xc8bc('0x31')],qs[_0xc8bc('0x38')](_0x3a42fd[_0xc8bc('0x33')]['fields']));_0x3a72a0[_0xc8bc('0x37')]=_0x3a72a0[_0xc8bc('0x37')][_0xc8bc('0x39')]?_0x3a72a0[_0xc8bc('0x37')]:_0x31cd28[_0xc8bc('0x31')];if(!_0x3a42fd[_0xc8bc('0x33')][_0xc8bc('0x3a')](_0xc8bc('0x3b'))){_0x3a72a0[_0xc8bc('0x1e')]=qs[_0xc8bc('0x1e')](_0x3a42fd['query'][_0xc8bc('0x1e')]);_0x3a72a0[_0xc8bc('0x20')]=qs[_0xc8bc('0x20')](_0x3a42fd[_0xc8bc('0x33')][_0xc8bc('0x20')]);}_0x3a72a0['order']=qs['sort'](_0x3a42fd[_0xc8bc('0x33')][_0xc8bc('0x3c')]);_0x3a72a0['where']=qs[_0xc8bc('0x35')](_[_0xc8bc('0x3d')](_0x3a42fd['query'],_0x31cd28[_0xc8bc('0x35')]),_0x512047);if(_0x3a42fd['query'][_0xc8bc('0x3e')]){_0x3a72a0[_0xc8bc('0x3f')]=_['merge'](_0x3a72a0[_0xc8bc('0x3f')],{'$or':_[_0xc8bc('0x32')](_0x512047,function(_0x19f3b3){if(_0x19f3b3[_0xc8bc('0x2f')]!==_0xc8bc('0x40')){var _0x500dfc={};_0x500dfc[_0x19f3b3[_0xc8bc('0x2d')]]={'$like':'%'+_0x3a42fd[_0xc8bc('0x33')][_0xc8bc('0x3e')]+'%'};return _0x500dfc;}})});}_0x3a72a0=_[_0xc8bc('0x41')]({},_0x3a72a0,_0x3a42fd[_0xc8bc('0x42')]);var _0x23f62f={'where':_0x3a72a0[_0xc8bc('0x3f')]};return db['SalesforceConfiguration'][_0xc8bc('0x1f')](_0x23f62f)['then'](function(_0x4430bd){_0x319cc4[_0xc8bc('0x1f')]=_0x4430bd;if(_0x3a42fd[_0xc8bc('0x33')][_0xc8bc('0x43')]){_0x3a72a0['include']=[{'all':!![]}];}return db[_0xc8bc('0x44')][_0xc8bc('0x45')](_0x3a72a0);})[_0xc8bc('0x27')](function(_0x21fdca){_0x319cc4[_0xc8bc('0x46')]=_0x21fdca;return _0x319cc4;})[_0xc8bc('0x27')](respondWithFilteredResult(_0x15150a,_0x3a72a0))[_0xc8bc('0x47')](handleError(_0x15150a,null));};exports[_0xc8bc('0x48')]=function(_0x27bf69,_0x4084bd){var _0x297116={'raw':![],'where':{'id':_0x27bf69['params']['id']}},_0x6e6640={};_0x6e6640[_0xc8bc('0x31')]=_[_0xc8bc('0x34')](db[_0xc8bc('0x44')][_0xc8bc('0x49')]);_0x6e6640[_0xc8bc('0x33')]=_[_0xc8bc('0x34')](_0x27bf69['query']);_0x6e6640[_0xc8bc('0x35')]=_[_0xc8bc('0x36')](_0x6e6640[_0xc8bc('0x31')],_0x6e6640[_0xc8bc('0x33')]);_0x297116[_0xc8bc('0x37')]=_[_0xc8bc('0x36')](_0x6e6640['model'],qs['fields'](_0x27bf69[_0xc8bc('0x33')][_0xc8bc('0x38')]));_0x297116[_0xc8bc('0x37')]=_0x297116[_0xc8bc('0x37')][_0xc8bc('0x39')]?_0x297116['attributes']:_0x6e6640[_0xc8bc('0x31')];if(_0x27bf69['query'][_0xc8bc('0x43')]){_0x297116[_0xc8bc('0x4a')]=[{'all':!![]}];}_0x297116=_[_0xc8bc('0x41')]({},_0x297116,_0x27bf69[_0xc8bc('0x42')]);return db[_0xc8bc('0x44')][_0xc8bc('0x4b')](_0x297116)['then'](handleEntityNotFound(_0x4084bd,null))['then'](respondWithResult(_0x4084bd,null))[_0xc8bc('0x47')](handleError(_0x4084bd,null));};exports[_0xc8bc('0x4c')]=function(_0x3ef1ff,_0x5024ad){return db[_0xc8bc('0x44')]['create'](_0x3ef1ff[_0xc8bc('0x4d')],{})['then'](respondWithResult(_0x5024ad,0xc9))['catch'](handleError(_0x5024ad,null));};exports[_0xc8bc('0x26')]=function(_0x5ea2f0,_0x5b3beb){if(_0x5ea2f0[_0xc8bc('0x4d')]['id']){delete _0x5ea2f0[_0xc8bc('0x4d')]['id'];}return db[_0xc8bc('0x44')][_0xc8bc('0x4b')]({'where':{'id':_0x5ea2f0[_0xc8bc('0x4e')]['id']}})[_0xc8bc('0x27')](handleEntityNotFound(_0x5b3beb,null))[_0xc8bc('0x27')](saveUpdates(_0x5ea2f0[_0xc8bc('0x4d')],null))[_0xc8bc('0x27')](respondWithResult(_0x5b3beb,null))[_0xc8bc('0x47')](handleError(_0x5b3beb,null));};exports[_0xc8bc('0x28')]=function(_0x2582c3,_0x36ca42){return db['SalesforceConfiguration'][_0xc8bc('0x4b')]({'where':{'id':_0x2582c3[_0xc8bc('0x4e')]['id']}})[_0xc8bc('0x27')](handleEntityNotFound(_0x36ca42,null))['then'](removeEntity(_0x36ca42,null))[_0xc8bc('0x47')](handleError(_0x36ca42,null));};exports[_0xc8bc('0x4f')]=function(_0x4e9da0,_0x1d9014,_0x40426c){var _0x475034={};var _0x50d5ea={};var _0x480378;var _0x1ff47d;return db[_0xc8bc('0x44')][_0xc8bc('0x50')]({'where':{'id':_0x4e9da0[_0xc8bc('0x4e')]['id']}})[_0xc8bc('0x27')](handleEntityNotFound(_0x1d9014,null))[_0xc8bc('0x27')](function(_0x33b12e){if(_0x33b12e){_0x480378=_0x33b12e;_0x50d5ea[_0xc8bc('0x31')]=_[_0xc8bc('0x34')](db['SalesforceField']['rawAttributes']);_0x50d5ea['query']=_[_0xc8bc('0x34')](_0x4e9da0[_0xc8bc('0x33')]);_0x50d5ea['filters']=_[_0xc8bc('0x36')](_0x50d5ea[_0xc8bc('0x31')],_0x50d5ea['query']);_0x475034[_0xc8bc('0x37')]=_[_0xc8bc('0x36')](_0x50d5ea[_0xc8bc('0x31')],qs['fields'](_0x4e9da0[_0xc8bc('0x33')][_0xc8bc('0x38')]));_0x475034[_0xc8bc('0x37')]=_0x475034[_0xc8bc('0x37')]['length']?_0x475034[_0xc8bc('0x37')]:_0x50d5ea[_0xc8bc('0x31')];_0x475034[_0xc8bc('0x51')]=qs[_0xc8bc('0x3c')](_0x4e9da0['query'][_0xc8bc('0x3c')]);_0x475034[_0xc8bc('0x3f')]=qs[_0xc8bc('0x35')](_[_0xc8bc('0x3d')](_0x4e9da0[_0xc8bc('0x33')],_0x50d5ea[_0xc8bc('0x35')]));if(_0x4e9da0[_0xc8bc('0x33')][_0xc8bc('0x3e')]){_0x475034[_0xc8bc('0x3f')]=_[_0xc8bc('0x41')](_0x475034[_0xc8bc('0x3f')],{'$or':_[_0xc8bc('0x32')](_0x475034[_0xc8bc('0x37')],function(_0x36442f){var _0x289ec7={};_0x289ec7[_0x36442f]={'$like':'%'+_0x4e9da0[_0xc8bc('0x33')][_0xc8bc('0x3e')]+'%'};return _0x289ec7;})});}_0x475034=_[_0xc8bc('0x41')]({},_0x475034,_0x4e9da0[_0xc8bc('0x42')]);return _0x480378['getFields'](_0x475034);}})['then'](function(_0x2e6165){if(_0x2e6165){_0x1ff47d=_0x2e6165['length'];if(!_0x4e9da0[_0xc8bc('0x33')]['hasOwnProperty'](_0xc8bc('0x3b'))){_0x475034[_0xc8bc('0x1e')]=qs[_0xc8bc('0x1e')](_0x4e9da0[_0xc8bc('0x33')]['limit']);_0x475034[_0xc8bc('0x20')]=qs['offset'](_0x4e9da0[_0xc8bc('0x33')][_0xc8bc('0x20')]);}return _0x480378[_0xc8bc('0x4f')](_0x475034);}})[_0xc8bc('0x27')](function(_0x148b77){if(_0x148b77){return _0x148b77?{'count':_0x1ff47d,'rows':_0x148b77}:null;}})[_0xc8bc('0x27')](respondWithResult(_0x1d9014,null))[_0xc8bc('0x47')](handleError(_0x1d9014,null));};exports[_0xc8bc('0x52')]=function(_0x490431,_0xfeff7c,_0x3efdf4){var _0x4baafa={};var _0x2b85d9={};var _0x392f1a;var _0x1bfbd2;return db['SalesforceConfiguration'][_0xc8bc('0x50')]({'where':{'id':_0x490431[_0xc8bc('0x4e')]['id']}})[_0xc8bc('0x27')](handleEntityNotFound(_0xfeff7c,null))[_0xc8bc('0x27')](function(_0x30c23b){if(_0x30c23b){_0x392f1a=_0x30c23b;_0x2b85d9[_0xc8bc('0x31')]=_[_0xc8bc('0x34')](db[_0xc8bc('0x53')][_0xc8bc('0x49')]);_0x2b85d9[_0xc8bc('0x33')]=_[_0xc8bc('0x34')](_0x490431[_0xc8bc('0x33')]);_0x2b85d9[_0xc8bc('0x35')]=_[_0xc8bc('0x36')](_0x2b85d9[_0xc8bc('0x31')],_0x2b85d9[_0xc8bc('0x33')]);_0x4baafa[_0xc8bc('0x37')]=_[_0xc8bc('0x36')](_0x2b85d9[_0xc8bc('0x31')],qs[_0xc8bc('0x38')](_0x490431[_0xc8bc('0x33')]['fields']));_0x4baafa[_0xc8bc('0x37')]=_0x4baafa['attributes'][_0xc8bc('0x39')]?_0x4baafa[_0xc8bc('0x37')]:_0x2b85d9[_0xc8bc('0x31')];_0x4baafa[_0xc8bc('0x51')]=qs[_0xc8bc('0x3c')](_0x490431['query'][_0xc8bc('0x3c')]);_0x4baafa['where']=qs[_0xc8bc('0x35')](_[_0xc8bc('0x3d')](_0x490431[_0xc8bc('0x33')],_0x2b85d9['filters']));if(_0x490431[_0xc8bc('0x33')][_0xc8bc('0x3e')]){_0x4baafa[_0xc8bc('0x3f')]=_[_0xc8bc('0x41')](_0x4baafa[_0xc8bc('0x3f')],{'$or':_[_0xc8bc('0x32')](_0x4baafa[_0xc8bc('0x37')],function(_0x568fbc){var _0x203e57={};_0x203e57[_0x568fbc]={'$like':'%'+_0x490431[_0xc8bc('0x33')][_0xc8bc('0x3e')]+'%'};return _0x203e57;})});}_0x4baafa=_[_0xc8bc('0x41')]({},_0x4baafa,_0x490431['options']);return _0x392f1a['getSubjects'](_0x4baafa);}})['then'](function(_0x258516){if(_0x258516){_0x1bfbd2=_0x258516[_0xc8bc('0x39')];if(!_0x490431[_0xc8bc('0x33')][_0xc8bc('0x3a')]('nolimit')){_0x4baafa[_0xc8bc('0x1e')]=qs[_0xc8bc('0x1e')](_0x490431[_0xc8bc('0x33')][_0xc8bc('0x1e')]);_0x4baafa[_0xc8bc('0x20')]=qs['offset'](_0x490431[_0xc8bc('0x33')][_0xc8bc('0x20')]);}return _0x392f1a[_0xc8bc('0x52')](_0x4baafa);}})[_0xc8bc('0x27')](function(_0xea1519){if(_0xea1519){return _0xea1519?{'count':_0x1bfbd2,'rows':_0xea1519}:null;}})[_0xc8bc('0x27')](respondWithResult(_0xfeff7c,null))[_0xc8bc('0x47')](handleError(_0xfeff7c,null));};exports[_0xc8bc('0x54')]=function(_0x5b3eac,_0x42803b,_0x2c6f04){var _0x55a941={};var _0x310d1b={};var _0x5ad7b2;var _0x56c2f8;return db[_0xc8bc('0x44')][_0xc8bc('0x50')]({'where':{'id':_0x5b3eac['params']['id']}})[_0xc8bc('0x27')](handleEntityNotFound(_0x42803b,null))['then'](function(_0x552818){if(_0x552818){_0x5ad7b2=_0x552818;_0x310d1b[_0xc8bc('0x31')]=_[_0xc8bc('0x34')](db[_0xc8bc('0x53')][_0xc8bc('0x49')]);_0x310d1b[_0xc8bc('0x33')]=_['keys'](_0x5b3eac['query']);_0x310d1b[_0xc8bc('0x35')]=_[_0xc8bc('0x36')](_0x310d1b[_0xc8bc('0x31')],_0x310d1b[_0xc8bc('0x33')]);_0x55a941[_0xc8bc('0x37')]=_[_0xc8bc('0x36')](_0x310d1b[_0xc8bc('0x31')],qs[_0xc8bc('0x38')](_0x5b3eac[_0xc8bc('0x33')][_0xc8bc('0x38')]));_0x55a941[_0xc8bc('0x37')]=_0x55a941[_0xc8bc('0x37')][_0xc8bc('0x39')]?_0x55a941['attributes']:_0x310d1b['model'];_0x55a941['order']=qs[_0xc8bc('0x3c')](_0x5b3eac[_0xc8bc('0x33')][_0xc8bc('0x3c')]);_0x55a941['where']=qs['filters'](_[_0xc8bc('0x3d')](_0x5b3eac[_0xc8bc('0x33')],_0x310d1b[_0xc8bc('0x35')]));if(_0x5b3eac[_0xc8bc('0x33')][_0xc8bc('0x3e')]){_0x55a941[_0xc8bc('0x3f')]=_[_0xc8bc('0x41')](_0x55a941[_0xc8bc('0x3f')],{'$or':_[_0xc8bc('0x32')](_0x55a941['attributes'],function(_0x5495ba){var _0x433afe={};_0x433afe[_0x5495ba]={'$like':'%'+_0x5b3eac['query'][_0xc8bc('0x3e')]+'%'};return _0x433afe;})});}_0x55a941=_['merge']({},_0x55a941,_0x5b3eac[_0xc8bc('0x42')]);return _0x5ad7b2[_0xc8bc('0x54')](_0x55a941);}})[_0xc8bc('0x27')](function(_0x4fcbf6){if(_0x4fcbf6){_0x56c2f8=_0x4fcbf6[_0xc8bc('0x39')];if(!_0x5b3eac[_0xc8bc('0x33')][_0xc8bc('0x3a')](_0xc8bc('0x3b'))){_0x55a941['limit']=qs[_0xc8bc('0x1e')](_0x5b3eac['query'][_0xc8bc('0x1e')]);_0x55a941[_0xc8bc('0x20')]=qs[_0xc8bc('0x20')](_0x5b3eac[_0xc8bc('0x33')]['offset']);}return _0x5ad7b2[_0xc8bc('0x54')](_0x55a941);}})[_0xc8bc('0x27')](function(_0x4165b5){if(_0x4165b5){return _0x4165b5?{'count':_0x56c2f8,'rows':_0x4165b5}:null;}})['then'](respondWithResult(_0x42803b,null))[_0xc8bc('0x47')](handleError(_0x42803b,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 6e304ce..ce202cc 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 _0x9676=['request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations','lodash','../../config/logger','api','bluebird'];(function(_0x49c057,_0xc808ed){var _0xd8f0e6=function(_0x5b9042){while(--_0x5b9042){_0x49c057['push'](_0x49c057['shift']());}};_0xd8f0e6(++_0xc808ed);}(_0x9676,0x8c));var _0x6967=function(_0x2c55e8,_0x42b59a){_0x2c55e8=_0x2c55e8-0x0;var _0x2b10e2=_0x9676[_0x2c55e8];return _0x2b10e2;};'use strict';var _=require(_0x6967('0x0'));var util=require('util');var logger=require(_0x6967('0x1'))(_0x6967('0x2'));var moment=require('moment');var BPromise=require(_0x6967('0x3'));var rp=require(_0x6967('0x4'));var fs=require('fs');var path=require(_0x6967('0x5'));var rimraf=require(_0x6967('0x6'));var config=require(_0x6967('0x7'));var attributes=require(_0x6967('0x8'));module['exports']=function(_0x431193,_0xf8302b){return _0x431193[_0x6967('0x9')](_0x6967('0xa'),attributes,{'tableName':_0x6967('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe0a5=['int_salesforce_configurations','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration'];(function(_0x23c8c9,_0x31fd3d){var _0x4b9287=function(_0x3576a4){while(--_0x3576a4){_0x23c8c9['push'](_0x23c8c9['shift']());}};_0x4b9287(++_0x31fd3d);}(_0xe0a5,0x6d));var _0x5e0a=function(_0x3b660f,_0x45c3db){_0x3b660f=_0x3b660f-0x0;var _0x187a29=_0xe0a5[_0x3b660f];return _0x187a29;};'use strict';var _=require(_0x5e0a('0x0'));var util=require(_0x5e0a('0x1'));var logger=require(_0x5e0a('0x2'))(_0x5e0a('0x3'));var moment=require('moment');var BPromise=require(_0x5e0a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5e0a('0x5'));var config=require(_0x5e0a('0x6'));var attributes=require(_0x5e0a('0x7'));module[_0x5e0a('0x8')]=function(_0x4258ed,_0x265216){return _0x4258ed[_0x5e0a('0x9')](_0x5e0a('0xa'),attributes,{'tableName':_0x5e0a('0xb'),'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 76af95f..3c14c14 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 _0xa0d8=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash'];(function(_0x50e82c,_0x51d605){var _0x44199b=function(_0x2cd718){while(--_0x2cd718){_0x50e82c['push'](_0x50e82c['shift']());}};_0x44199b(++_0x51d605);}(_0xa0d8,0x1cb));var _0x8a0d=function(_0x130f17,_0x33bb61){_0x130f17=_0x130f17-0x0;var _0x562af5=_0xa0d8[_0x130f17];return _0x562af5;};'use strict';var _=require(_0x8a0d('0x0'));var util=require(_0x8a0d('0x1'));var moment=require(_0x8a0d('0x2'));var BPromise=require('bluebird');var rs=require(_0x8a0d('0x3'));var fs=require('fs');var Redis=require(_0x8a0d('0x4'));var db=require(_0x8a0d('0x5'))['db'];var utils=require(_0x8a0d('0x6'));var logger=require(_0x8a0d('0x7'))(_0x8a0d('0x8'));var config=require(_0x8a0d('0x9'));var jayson=require(_0x8a0d('0xa'));var client=jayson[_0x8a0d('0xb')][_0x8a0d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x20eed1,_0x5c6875,_0x53aedc){return new BPromise(function(_0x196469,_0x5efca6){return client[_0x8a0d('0xd')](_0x20eed1,_0x53aedc)[_0x8a0d('0xe')](function(_0x17e6dd){logger[_0x8a0d('0xf')](_0x8a0d('0x10'),_0x5c6875,'request\x20sent');logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x5c6875,'request\x20sent',JSON[_0x8a0d('0x11')](_0x17e6dd));if(_0x17e6dd[_0x8a0d('0x12')]){if(_0x17e6dd[_0x8a0d('0x12')]['code']===0x1f4){logger['error'](_0x8a0d('0x10'),_0x5c6875,_0x17e6dd[_0x8a0d('0x12')][_0x8a0d('0x13')]);return _0x5efca6(_0x17e6dd[_0x8a0d('0x12')][_0x8a0d('0x13')]);}logger[_0x8a0d('0x12')](_0x8a0d('0x10'),_0x5c6875,_0x17e6dd['error'][_0x8a0d('0x13')]);return _0x196469(_0x17e6dd[_0x8a0d('0x12')][_0x8a0d('0x13')]);}else{logger[_0x8a0d('0xf')](_0x8a0d('0x10'),_0x5c6875,_0x8a0d('0x14'));_0x196469(_0x17e6dd[_0x8a0d('0x15')][_0x8a0d('0x13')]);}})[_0x8a0d('0x16')](function(_0x2dffc3){logger[_0x8a0d('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5c6875,_0x2dffc3);_0x5efca6(_0x2dffc3);});});} \ No newline at end of file +var _0xf89b=['debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0xdb596e,_0x5d6d42){var _0x4b6c87=function(_0x589f00){while(--_0x589f00){_0xdb596e['push'](_0xdb596e['shift']());}};_0x4b6c87(++_0x5d6d42);}(_0xf89b,0x1e8));var _0xbf89=function(_0x2551d9,_0x2aff63){_0x2551d9=_0x2551d9-0x0;var _0x20216a=_0xf89b[_0x2551d9];return _0x20216a;};'use strict';var _=require(_0xbf89('0x0'));var util=require(_0xbf89('0x1'));var moment=require(_0xbf89('0x2'));var BPromise=require('bluebird');var rs=require(_0xbf89('0x3'));var fs=require('fs');var Redis=require(_0xbf89('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf89('0x5'));var logger=require(_0xbf89('0x6'))(_0xbf89('0x7'));var config=require(_0xbf89('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbf89('0x9')][_0xbf89('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1372fd,_0x307aaf,_0xcef05a){return new BPromise(function(_0x53056a,_0x1efe5d){return client[_0xbf89('0xb')](_0x1372fd,_0xcef05a)[_0xbf89('0xc')](function(_0x20311e){logger[_0xbf89('0xd')](_0xbf89('0xe'),_0x307aaf,_0xbf89('0xf'));logger[_0xbf89('0x10')](_0xbf89('0x11'),_0x307aaf,_0xbf89('0xf'),JSON['stringify'](_0x20311e));if(_0x20311e[_0xbf89('0x12')]){if(_0x20311e['error'][_0xbf89('0x13')]===0x1f4){logger['error'](_0xbf89('0xe'),_0x307aaf,_0x20311e[_0xbf89('0x12')]['message']);return _0x1efe5d(_0x20311e[_0xbf89('0x12')][_0xbf89('0x14')]);}logger[_0xbf89('0x12')](_0xbf89('0xe'),_0x307aaf,_0x20311e[_0xbf89('0x12')]['message']);return _0x53056a(_0x20311e['error'][_0xbf89('0x14')]);}else{logger[_0xbf89('0xd')](_0xbf89('0xe'),_0x307aaf,_0xbf89('0xf'));_0x53056a(_0x20311e['result'][_0xbf89('0x14')]);}})['catch'](function(_0x2aba3b){logger[_0xbf89('0x12')](_0xbf89('0xe'),_0x307aaf,_0x2aba3b);_0x1efe5d(_0x2aba3b);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index e9b34ee..434cf91 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 _0x7559=['/:id','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','show','create','put'];(function(_0xb12dc,_0x2464d6){var _0x17dbd0=function(_0x246978){while(--_0x246978){_0xb12dc['push'](_0xb12dc['shift']());}};_0x17dbd0(++_0x2464d6);}(_0x7559,0x142));var _0x9755=function(_0x1c678d,_0x437907){_0x1c678d=_0x1c678d-0x0;var _0x5a963c=_0x7559[_0x1c678d];return _0x5a963c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9755('0x0'));var express=require(_0x9755('0x1'));var router=express[_0x9755('0x2')]();var fs_extra=require(_0x9755('0x3'));var auth=require(_0x9755('0x4'));var interaction=require(_0x9755('0x5'));var config=require(_0x9755('0x6'));var controller=require(_0x9755('0x7'));router[_0x9755('0x8')]('/',auth[_0x9755('0x9')](),controller[_0x9755('0xa')]);router[_0x9755('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x9755('0xb')]);router['post']('/',auth[_0x9755('0x9')](),controller[_0x9755('0xc')]);router[_0x9755('0xd')](_0x9755('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x9755('0xe'),auth[_0x9755('0x9')](),controller[_0x9755('0xf')]);module['exports']=router; \ No newline at end of file +var _0x4c89=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','util','path'];(function(_0x1b497c,_0x541139){var _0x4d1f5d=function(_0x4445f1){while(--_0x4445f1){_0x1b497c['push'](_0x1b497c['shift']());}};_0x4d1f5d(++_0x541139);}(_0x4c89,0x10c));var _0x94c8=function(_0x12e569,_0x6fa2ed){_0x12e569=_0x12e569-0x0;var _0x327210=_0x4c89[_0x12e569];return _0x327210;};'use strict';var multer=require('multer');var util=require(_0x94c8('0x0'));var path=require(_0x94c8('0x1'));var timeout=require('connect-timeout');var express=require(_0x94c8('0x2'));var router=express['Router']();var fs_extra=require(_0x94c8('0x3'));var auth=require(_0x94c8('0x4'));var interaction=require(_0x94c8('0x5'));var config=require(_0x94c8('0x6'));var controller=require(_0x94c8('0x7'));router[_0x94c8('0x8')]('/',auth[_0x94c8('0x9')](),controller['index']);router[_0x94c8('0x8')](_0x94c8('0xa'),auth[_0x94c8('0x9')](),controller[_0x94c8('0xb')]);router[_0x94c8('0xc')]('/',auth[_0x94c8('0x9')](),controller[_0x94c8('0xd')]);router[_0x94c8('0xe')](_0x94c8('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x94c8('0xf')](_0x94c8('0xa'),auth['isAuthenticated'](),controller[_0x94c8('0x10')]);module[_0x94c8('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 219ea70..7d7e390 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 _0xb7b1=['exports','ENUM','variable','picklist','string','STRING','customVariable','sequelize'];(function(_0x32516c,_0x33c3c7){var _0x3fbe28=function(_0x4ca069){while(--_0x4ca069){_0x32516c['push'](_0x32516c['shift']());}};_0x3fbe28(++_0x33c3c7);}(_0xb7b1,0xdf));var _0x1b7b=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xb7b1[_0x2112d4];return _0x434972;};'use strict';var Sequelize=require(_0x1b7b('0x0'));module[_0x1b7b('0x1')]={'type':{'type':Sequelize[_0x1b7b('0x2')]('string',_0x1b7b('0x3'),'customVariable','keyValue',_0x1b7b('0x4')),'defaultValue':_0x1b7b('0x5')},'content':{'type':Sequelize[_0x1b7b('0x6')]},'key':{'type':Sequelize[_0x1b7b('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x1b7b('0x3'),_0x1b7b('0x7'))},'keyContent':{'type':Sequelize[_0x1b7b('0x6')]},'idField':{'type':Sequelize[_0x1b7b('0x6')]},'variableName':{'type':Sequelize[_0x1b7b('0x6')]}}; \ No newline at end of file +var _0xa10b=['variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string'];(function(_0x553d22,_0x16d53c){var _0x1b4df3=function(_0x3f003b){while(--_0x3f003b){_0x553d22['push'](_0x553d22['shift']());}};_0x1b4df3(++_0x16d53c);}(_0xa10b,0xf8));var _0xba10=function(_0x1d39a1,_0x25694c){_0x1d39a1=_0x1d39a1-0x0;var _0x491a69=_0xa10b[_0x1d39a1];return _0x491a69;};'use strict';var Sequelize=require(_0xba10('0x0'));module[_0xba10('0x1')]={'type':{'type':Sequelize[_0xba10('0x2')](_0xba10('0x3'),_0xba10('0x4'),_0xba10('0x5'),_0xba10('0x6'),_0xba10('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xba10('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xba10('0x2')](_0xba10('0x3'),_0xba10('0x4'),_0xba10('0x5'))},'keyContent':{'type':Sequelize[_0xba10('0x8')]},'idField':{'type':Sequelize[_0xba10('0x8')]},'variableName':{'type':Sequelize[_0xba10('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index ebdfb7d..9b0cbe3 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 _0xfff7=['sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','map','SalesforceField','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','update','destroy','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x363842,_0x369636){var _0x257bc2=function(_0x2516cf){while(--_0x2516cf){_0x363842['push'](_0x363842['shift']());}};_0x257bc2(++_0x369636);}(_0xfff7,0x81));var _0x7fff=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xfff7[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7fff('0x0'));var zipdir=require(_0x7fff('0x1'));var jsonpatch=require(_0x7fff('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7fff('0x3'));var Mustache=require(_0x7fff('0x4'));var util=require(_0x7fff('0x5'));var path=require(_0x7fff('0x6'));var sox=require(_0x7fff('0x7'));var csv=require(_0x7fff('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7fff('0x9'));var squel=require(_0x7fff('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7fff('0xb'));var toCsv=require(_0x7fff('0x8'));var querystring=require(_0x7fff('0xc'));var Papa=require(_0x7fff('0xd'));var Redis=require(_0x7fff('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7fff('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7fff('0x10'));var logger=require(_0x7fff('0x11'))(_0x7fff('0x12'));var utils=require(_0x7fff('0x13'));var config=require(_0x7fff('0x14'));var licenseUtil=require(_0x7fff('0x15'));var db=require(_0x7fff('0x16'))['db'];function respondWithStatusCode(_0x78411e,_0x34f15f){_0x34f15f=_0x34f15f||0xcc;return function(_0x12bcd8){if(_0x12bcd8){return _0x78411e[_0x7fff('0x17')](_0x34f15f);}return _0x78411e[_0x7fff('0x18')](_0x34f15f)['end']();};}function respondWithResult(_0x136a9e,_0x4e85b7){_0x4e85b7=_0x4e85b7||0xc8;return function(_0x1e7df6){if(_0x1e7df6){return _0x136a9e[_0x7fff('0x18')](_0x4e85b7)[_0x7fff('0x19')](_0x1e7df6);}};}function respondWithFilteredResult(_0x188c6d,_0x1b551a){return function(_0x53d7e7){if(_0x53d7e7){var _0xa9804c=typeof _0x1b551a[_0x7fff('0x1a')]===_0x7fff('0x1b')&&typeof _0x1b551a[_0x7fff('0x1c')]==='undefined';var _0x3a0f79=_0x53d7e7['count'];var _0x2cff47=_0xa9804c?0x0:_0x1b551a['offset'];var _0x4e7a22=_0xa9804c?_0x53d7e7['count']:_0x1b551a[_0x7fff('0x1a')]+_0x1b551a['limit'];var _0x430434;if(_0x4e7a22>=_0x3a0f79){_0x4e7a22=_0x3a0f79;_0x430434=0xc8;}else{_0x430434=0xce;}_0x188c6d['status'](_0x430434);return _0x188c6d[_0x7fff('0x1d')](_0x7fff('0x1e'),_0x2cff47+'-'+_0x4e7a22+'/'+_0x3a0f79)[_0x7fff('0x19')](_0x53d7e7);}return null;};}function patchUpdates(_0x36e27e){return function(_0x31e937){try{jsonpatch[_0x7fff('0x1f')](_0x31e937,_0x36e27e,!![]);}catch(_0x398bd0){return BPromise[_0x7fff('0x20')](_0x398bd0);}return _0x31e937[_0x7fff('0x21')]();};}function saveUpdates(_0x413e9c,_0x2059ef){return function(_0x4fbf61){if(_0x4fbf61){return _0x4fbf61['update'](_0x413e9c)[_0x7fff('0x22')](function(_0x4624b6){return _0x4624b6;});}return null;};}function removeEntity(_0x44d3ea,_0x5dcf38){return function(_0x3b4f19){if(_0x3b4f19){return _0x3b4f19['destroy']()[_0x7fff('0x22')](function(){_0x44d3ea[_0x7fff('0x18')](0xcc)[_0x7fff('0x23')]();});}};}function handleEntityNotFound(_0xcabb76,_0x53c275){return function(_0x598354){if(!_0x598354){_0xcabb76[_0x7fff('0x17')](0x194);}return _0x598354;};}function handleError(_0x477775,_0x4beffb){_0x4beffb=_0x4beffb||0x1f4;return function(_0x33e1ad){logger[_0x7fff('0x24')](_0x33e1ad[_0x7fff('0x25')]);if(_0x33e1ad[_0x7fff('0x26')]){delete _0x33e1ad[_0x7fff('0x26')];}_0x477775['status'](_0x4beffb)[_0x7fff('0x27')](_0x33e1ad);};}exports[_0x7fff('0x28')]=function(_0x3a3d24,_0x31e087){var _0x4b4fb1={},_0x326dc7={},_0x4b2b8a={'count':0x0,'rows':[]};var _0x880475=_[_0x7fff('0x29')](db[_0x7fff('0x2a')]['rawAttributes'],function(_0x1a8d97){return{'name':_0x1a8d97['fieldName'],'type':_0x1a8d97['type'][_0x7fff('0x2b')]};});_0x326dc7[_0x7fff('0x2c')]=_[_0x7fff('0x29')](_0x880475,_0x7fff('0x26'));_0x326dc7[_0x7fff('0x2d')]=_[_0x7fff('0x2e')](_0x3a3d24[_0x7fff('0x2d')]);_0x326dc7[_0x7fff('0x2f')]=_[_0x7fff('0x30')](_0x326dc7[_0x7fff('0x2c')],_0x326dc7[_0x7fff('0x2d')]);_0x4b4fb1[_0x7fff('0x31')]=_['intersection'](_0x326dc7['model'],qs['fields'](_0x3a3d24[_0x7fff('0x2d')][_0x7fff('0x32')]));_0x4b4fb1[_0x7fff('0x31')]=_0x4b4fb1['attributes'][_0x7fff('0x33')]?_0x4b4fb1[_0x7fff('0x31')]:_0x326dc7[_0x7fff('0x2c')];if(!_0x3a3d24[_0x7fff('0x2d')][_0x7fff('0x34')](_0x7fff('0x35'))){_0x4b4fb1[_0x7fff('0x1c')]=qs['limit'](_0x3a3d24[_0x7fff('0x2d')][_0x7fff('0x1c')]);_0x4b4fb1[_0x7fff('0x1a')]=qs['offset'](_0x3a3d24[_0x7fff('0x2d')]['offset']);}_0x4b4fb1['order']=qs[_0x7fff('0x36')](_0x3a3d24[_0x7fff('0x2d')][_0x7fff('0x36')]);_0x4b4fb1[_0x7fff('0x37')]=qs[_0x7fff('0x2f')](_[_0x7fff('0x38')](_0x3a3d24['query'],_0x326dc7['filters']),_0x880475);if(_0x3a3d24[_0x7fff('0x2d')][_0x7fff('0x39')]){_0x4b4fb1['where']=_[_0x7fff('0x3a')](_0x4b4fb1['where'],{'$or':_['map'](_0x880475,function(_0x15ee9b){if(_0x15ee9b[_0x7fff('0x3b')]!==_0x7fff('0x3c')){var _0x5295a3={};_0x5295a3[_0x15ee9b[_0x7fff('0x26')]]={'$like':'%'+_0x3a3d24[_0x7fff('0x2d')]['filter']+'%'};return _0x5295a3;}})});}_0x4b4fb1=_[_0x7fff('0x3a')]({},_0x4b4fb1,_0x3a3d24[_0x7fff('0x3d')]);var _0x28a47d={'where':_0x4b4fb1[_0x7fff('0x37')]};return db['SalesforceField']['count'](_0x28a47d)['then'](function(_0x2a886d){_0x4b2b8a[_0x7fff('0x3e')]=_0x2a886d;if(_0x3a3d24['query'][_0x7fff('0x3f')]){_0x4b4fb1['include']=[{'all':!![]}];}return db[_0x7fff('0x2a')][_0x7fff('0x40')](_0x4b4fb1);})['then'](function(_0x30aa86){_0x4b2b8a[_0x7fff('0x41')]=_0x30aa86;return _0x4b2b8a;})[_0x7fff('0x22')](respondWithFilteredResult(_0x31e087,_0x4b4fb1))[_0x7fff('0x42')](handleError(_0x31e087,null));};exports[_0x7fff('0x43')]=function(_0x2b60ca,_0xd50cc5){var _0x1d9e43={'raw':!![],'where':{'id':_0x2b60ca[_0x7fff('0x44')]['id']}},_0x26adfe={};_0x26adfe[_0x7fff('0x2c')]=_['keys'](db[_0x7fff('0x2a')][_0x7fff('0x45')]);_0x26adfe[_0x7fff('0x2d')]=_['keys'](_0x2b60ca['query']);_0x26adfe[_0x7fff('0x2f')]=_['intersection'](_0x26adfe[_0x7fff('0x2c')],_0x26adfe[_0x7fff('0x2d')]);_0x1d9e43[_0x7fff('0x31')]=_[_0x7fff('0x30')](_0x26adfe[_0x7fff('0x2c')],qs[_0x7fff('0x32')](_0x2b60ca[_0x7fff('0x2d')][_0x7fff('0x32')]));_0x1d9e43[_0x7fff('0x31')]=_0x1d9e43[_0x7fff('0x31')][_0x7fff('0x33')]?_0x1d9e43[_0x7fff('0x31')]:_0x26adfe['model'];if(_0x2b60ca[_0x7fff('0x2d')][_0x7fff('0x3f')]){_0x1d9e43[_0x7fff('0x46')]=[{'all':!![]}];}_0x1d9e43=_[_0x7fff('0x3a')]({},_0x1d9e43,_0x2b60ca[_0x7fff('0x3d')]);return db[_0x7fff('0x2a')][_0x7fff('0x47')](_0x1d9e43)['then'](handleEntityNotFound(_0xd50cc5,null))[_0x7fff('0x22')](respondWithResult(_0xd50cc5,null))[_0x7fff('0x42')](handleError(_0xd50cc5,null));};exports[_0x7fff('0x48')]=function(_0x45bcc4,_0x5235df){return db[_0x7fff('0x2a')]['create'](_0x45bcc4[_0x7fff('0x49')],{})[_0x7fff('0x22')](respondWithResult(_0x5235df,0xc9))['catch'](handleError(_0x5235df,null));};exports[_0x7fff('0x4a')]=function(_0x570e92,_0x5c8c33){if(_0x570e92[_0x7fff('0x49')]['id']){delete _0x570e92[_0x7fff('0x49')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x570e92[_0x7fff('0x44')]['id']}})[_0x7fff('0x22')](handleEntityNotFound(_0x5c8c33,null))[_0x7fff('0x22')](saveUpdates(_0x570e92[_0x7fff('0x49')],null))['then'](respondWithResult(_0x5c8c33,null))[_0x7fff('0x42')](handleError(_0x5c8c33,null));};exports[_0x7fff('0x4b')]=function(_0xf5503a,_0x26c86b){return db[_0x7fff('0x2a')][_0x7fff('0x47')]({'where':{'id':_0xf5503a[_0x7fff('0x44')]['id']}})[_0x7fff('0x22')](handleEntityNotFound(_0x26c86b,null))[_0x7fff('0x22')](removeEntity(_0x26c86b,null))[_0x7fff('0x42')](handleError(_0x26c86b,null));}; \ No newline at end of file +var _0x6a78=['api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceField','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','merge','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x1d5ba8,_0x412a52){var _0x1022a2=function(_0x187f11){while(--_0x187f11){_0x1d5ba8['push'](_0x1d5ba8['shift']());}};_0x1022a2(++_0x412a52);}(_0x6a78,0x1c4));var _0x86a7=function(_0xde5b84,_0x10505a){_0xde5b84=_0xde5b84-0x0;var _0x45cc53=_0x6a78[_0xde5b84];return _0x45cc53;};'use strict';var emlformat=require(_0x86a7('0x0'));var rimraf=require(_0x86a7('0x1'));var zipdir=require(_0x86a7('0x2'));var jsonpatch=require(_0x86a7('0x3'));var rp=require(_0x86a7('0x4'));var moment=require(_0x86a7('0x5'));var BPromise=require(_0x86a7('0x6'));var Mustache=require(_0x86a7('0x7'));var util=require(_0x86a7('0x8'));var path=require(_0x86a7('0x9'));var sox=require('sox');var csv=require(_0x86a7('0xa'));var ejs=require(_0x86a7('0xb'));var fs=require('fs');var fs_extra=require(_0x86a7('0xc'));var _=require(_0x86a7('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x86a7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x86a7('0xa'));var querystring=require('querystring');var Papa=require(_0x86a7('0xf'));var Redis=require(_0x86a7('0x10'));var authService=require(_0x86a7('0x11'));var qs=require(_0x86a7('0x12'));var as=require(_0x86a7('0x13'));var hardwareService=require(_0x86a7('0x14'));var logger=require(_0x86a7('0x15'))(_0x86a7('0x16'));var utils=require(_0x86a7('0x17'));var config=require(_0x86a7('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14a6aa,_0x3ca04d){_0x3ca04d=_0x3ca04d||0xcc;return function(_0x2f56cc){if(_0x2f56cc){return _0x14a6aa[_0x86a7('0x19')](_0x3ca04d);}return _0x14a6aa[_0x86a7('0x1a')](_0x3ca04d)[_0x86a7('0x1b')]();};}function respondWithResult(_0x3c83bb,_0x130f0c){_0x130f0c=_0x130f0c||0xc8;return function(_0x4b1334){if(_0x4b1334){return _0x3c83bb[_0x86a7('0x1a')](_0x130f0c)[_0x86a7('0x1c')](_0x4b1334);}};}function respondWithFilteredResult(_0x8c56ef,_0x5a6a69){return function(_0x3a77ec){if(_0x3a77ec){var _0x6b129=typeof _0x5a6a69['offset']===_0x86a7('0x1d')&&typeof _0x5a6a69[_0x86a7('0x1e')]==='undefined';var _0x29ec02=_0x3a77ec[_0x86a7('0x1f')];var _0x5c2837=_0x6b129?0x0:_0x5a6a69[_0x86a7('0x20')];var _0x2aae27=_0x6b129?_0x3a77ec[_0x86a7('0x1f')]:_0x5a6a69[_0x86a7('0x20')]+_0x5a6a69[_0x86a7('0x1e')];var _0x43641f;if(_0x2aae27>=_0x29ec02){_0x2aae27=_0x29ec02;_0x43641f=0xc8;}else{_0x43641f=0xce;}_0x8c56ef[_0x86a7('0x1a')](_0x43641f);return _0x8c56ef[_0x86a7('0x21')](_0x86a7('0x22'),_0x5c2837+'-'+_0x2aae27+'/'+_0x29ec02)['json'](_0x3a77ec);}return null;};}function patchUpdates(_0x53c5ae){return function(_0x43345b){try{jsonpatch[_0x86a7('0x23')](_0x43345b,_0x53c5ae,!![]);}catch(_0xe8dc94){return BPromise[_0x86a7('0x24')](_0xe8dc94);}return _0x43345b[_0x86a7('0x25')]();};}function saveUpdates(_0x3b3f92,_0x30e344){return function(_0x1baf10){if(_0x1baf10){return _0x1baf10[_0x86a7('0x26')](_0x3b3f92)[_0x86a7('0x27')](function(_0x3a091d){return _0x3a091d;});}return null;};}function removeEntity(_0xa1d483,_0x23b1db){return function(_0x563bff){if(_0x563bff){return _0x563bff[_0x86a7('0x28')]()[_0x86a7('0x27')](function(){_0xa1d483[_0x86a7('0x1a')](0xcc)[_0x86a7('0x1b')]();});}};}function handleEntityNotFound(_0x432c47,_0x540964){return function(_0xab0613){if(!_0xab0613){_0x432c47[_0x86a7('0x19')](0x194);}return _0xab0613;};}function handleError(_0x2a3fb8,_0xaede3){_0xaede3=_0xaede3||0x1f4;return function(_0x18deef){logger[_0x86a7('0x29')](_0x18deef[_0x86a7('0x2a')]);if(_0x18deef['name']){delete _0x18deef[_0x86a7('0x2b')];}_0x2a3fb8['status'](_0xaede3)[_0x86a7('0x2c')](_0x18deef);};}exports[_0x86a7('0x2d')]=function(_0x7cf9bb,_0x40f4aa){var _0x129067={},_0xd5439={},_0x2144e5={'count':0x0,'rows':[]};var _0x1650ae=_[_0x86a7('0x2e')](db[_0x86a7('0x2f')]['rawAttributes'],function(_0x153038){return{'name':_0x153038[_0x86a7('0x30')],'type':_0x153038['type'][_0x86a7('0x31')]};});_0xd5439[_0x86a7('0x32')]=_[_0x86a7('0x2e')](_0x1650ae,_0x86a7('0x2b'));_0xd5439[_0x86a7('0x33')]=_[_0x86a7('0x34')](_0x7cf9bb[_0x86a7('0x33')]);_0xd5439['filters']=_[_0x86a7('0x35')](_0xd5439[_0x86a7('0x32')],_0xd5439[_0x86a7('0x33')]);_0x129067[_0x86a7('0x36')]=_[_0x86a7('0x35')](_0xd5439['model'],qs[_0x86a7('0x37')](_0x7cf9bb['query'][_0x86a7('0x37')]));_0x129067['attributes']=_0x129067['attributes'][_0x86a7('0x38')]?_0x129067[_0x86a7('0x36')]:_0xd5439[_0x86a7('0x32')];if(!_0x7cf9bb[_0x86a7('0x33')][_0x86a7('0x39')](_0x86a7('0x3a'))){_0x129067[_0x86a7('0x1e')]=qs['limit'](_0x7cf9bb[_0x86a7('0x33')][_0x86a7('0x1e')]);_0x129067[_0x86a7('0x20')]=qs[_0x86a7('0x20')](_0x7cf9bb[_0x86a7('0x33')][_0x86a7('0x20')]);}_0x129067[_0x86a7('0x3b')]=qs[_0x86a7('0x3c')](_0x7cf9bb[_0x86a7('0x33')][_0x86a7('0x3c')]);_0x129067['where']=qs[_0x86a7('0x3d')](_[_0x86a7('0x3e')](_0x7cf9bb['query'],_0xd5439[_0x86a7('0x3d')]),_0x1650ae);if(_0x7cf9bb[_0x86a7('0x33')]['filter']){_0x129067[_0x86a7('0x3f')]=_['merge'](_0x129067[_0x86a7('0x3f')],{'$or':_[_0x86a7('0x2e')](_0x1650ae,function(_0x4bd88d){if(_0x4bd88d['type']!==_0x86a7('0x40')){var _0x23b0c2={};_0x23b0c2[_0x4bd88d[_0x86a7('0x2b')]]={'$like':'%'+_0x7cf9bb[_0x86a7('0x33')][_0x86a7('0x41')]+'%'};return _0x23b0c2;}})});}_0x129067=_['merge']({},_0x129067,_0x7cf9bb[_0x86a7('0x42')]);var _0x4873f8={'where':_0x129067[_0x86a7('0x3f')]};return db[_0x86a7('0x2f')][_0x86a7('0x1f')](_0x4873f8)[_0x86a7('0x27')](function(_0x4a6e86){_0x2144e5[_0x86a7('0x1f')]=_0x4a6e86;if(_0x7cf9bb[_0x86a7('0x33')]['includeAll']){_0x129067[_0x86a7('0x43')]=[{'all':!![]}];}return db['SalesforceField'][_0x86a7('0x44')](_0x129067);})['then'](function(_0x37ad04){_0x2144e5[_0x86a7('0x45')]=_0x37ad04;return _0x2144e5;})[_0x86a7('0x27')](respondWithFilteredResult(_0x40f4aa,_0x129067))[_0x86a7('0x46')](handleError(_0x40f4aa,null));};exports[_0x86a7('0x47')]=function(_0x37fda7,_0x25eb51){var _0x154974={'raw':!![],'where':{'id':_0x37fda7[_0x86a7('0x48')]['id']}},_0x232504={};_0x232504[_0x86a7('0x32')]=_[_0x86a7('0x34')](db[_0x86a7('0x2f')][_0x86a7('0x49')]);_0x232504[_0x86a7('0x33')]=_['keys'](_0x37fda7[_0x86a7('0x33')]);_0x232504[_0x86a7('0x3d')]=_[_0x86a7('0x35')](_0x232504['model'],_0x232504[_0x86a7('0x33')]);_0x154974[_0x86a7('0x36')]=_['intersection'](_0x232504[_0x86a7('0x32')],qs[_0x86a7('0x37')](_0x37fda7[_0x86a7('0x33')][_0x86a7('0x37')]));_0x154974['attributes']=_0x154974[_0x86a7('0x36')][_0x86a7('0x38')]?_0x154974[_0x86a7('0x36')]:_0x232504[_0x86a7('0x32')];if(_0x37fda7[_0x86a7('0x33')][_0x86a7('0x4a')]){_0x154974[_0x86a7('0x43')]=[{'all':!![]}];}_0x154974=_[_0x86a7('0x4b')]({},_0x154974,_0x37fda7['options']);return db[_0x86a7('0x2f')]['find'](_0x154974)[_0x86a7('0x27')](handleEntityNotFound(_0x25eb51,null))[_0x86a7('0x27')](respondWithResult(_0x25eb51,null))[_0x86a7('0x46')](handleError(_0x25eb51,null));};exports[_0x86a7('0x4c')]=function(_0x3f99ff,_0x32fe87){return db['SalesforceField'][_0x86a7('0x4c')](_0x3f99ff[_0x86a7('0x4d')],{})[_0x86a7('0x27')](respondWithResult(_0x32fe87,0xc9))[_0x86a7('0x46')](handleError(_0x32fe87,null));};exports[_0x86a7('0x26')]=function(_0x299d47,_0x1b498c){if(_0x299d47[_0x86a7('0x4d')]['id']){delete _0x299d47[_0x86a7('0x4d')]['id'];}return db[_0x86a7('0x2f')][_0x86a7('0x4e')]({'where':{'id':_0x299d47[_0x86a7('0x48')]['id']}})[_0x86a7('0x27')](handleEntityNotFound(_0x1b498c,null))[_0x86a7('0x27')](saveUpdates(_0x299d47[_0x86a7('0x4d')],null))['then'](respondWithResult(_0x1b498c,null))[_0x86a7('0x46')](handleError(_0x1b498c,null));};exports[_0x86a7('0x28')]=function(_0x5f00e7,_0x5e2e4f){return db[_0x86a7('0x2f')][_0x86a7('0x4e')]({'where':{'id':_0x5f00e7[_0x86a7('0x48')]['id']}})[_0x86a7('0x27')](handleEntityNotFound(_0x5e2e4f,null))[_0x86a7('0x27')](removeEntity(_0x5e2e4f,null))[_0x86a7('0x46')](handleError(_0x5e2e4f,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index ea02db8..2154459 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 _0xab7a=['lodash','util','../../config/logger','api','request-promise','path','./intSalesforceField.attributes','exports','define','int_salesforce_fields','salesforce_unique_index','idField','FieldId'];(function(_0x258b93,_0x188ccc){var _0x35484b=function(_0x2563ea){while(--_0x2563ea){_0x258b93['push'](_0x258b93['shift']());}};_0x35484b(++_0x188ccc);}(_0xab7a,0x1ad));var _0xaab7=function(_0x238e59,_0x3d5bd8){_0x238e59=_0x238e59-0x0;var _0x2cdb69=_0xab7a[_0x238e59];return _0x2cdb69;};'use strict';var _=require(_0xaab7('0x0'));var util=require(_0xaab7('0x1'));var logger=require(_0xaab7('0x2'))(_0xaab7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaab7('0x4'));var fs=require('fs');var path=require(_0xaab7('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xaab7('0x6'));module[_0xaab7('0x7')]=function(_0x399c4e,_0x21d195){return _0x399c4e[_0xaab7('0x8')]('SalesforceField',attributes,{'tableName':_0xaab7('0x9'),'paranoid':![],'indexes':[{'name':_0xaab7('0xa'),'fields':[_0xaab7('0xb'),_0xaab7('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcbb3=['request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','lodash','util','../../config/logger','api','moment'];(function(_0x574ce3,_0x59eef4){var _0x3447a0=function(_0x27f8cb){while(--_0x27f8cb){_0x574ce3['push'](_0x574ce3['shift']());}};_0x3447a0(++_0x59eef4);}(_0xcbb3,0xb1));var _0x3cbb=function(_0x4282ae,_0x417623){_0x4282ae=_0x4282ae-0x0;var _0x2ab8f6=_0xcbb3[_0x4282ae];return _0x2ab8f6;};'use strict';var _=require(_0x3cbb('0x0'));var util=require(_0x3cbb('0x1'));var logger=require(_0x3cbb('0x2'))(_0x3cbb('0x3'));var moment=require(_0x3cbb('0x4'));var BPromise=require('bluebird');var rp=require(_0x3cbb('0x5'));var fs=require('fs');var path=require(_0x3cbb('0x6'));var rimraf=require(_0x3cbb('0x7'));var config=require(_0x3cbb('0x8'));var attributes=require(_0x3cbb('0x9'));module[_0x3cbb('0xa')]=function(_0x51b3df,_0x4d2772){return _0x51b3df[_0x3cbb('0xb')](_0x3cbb('0xc'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 9b81a41..2ad2be9 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 _0x7db0=['code','message','result','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xa71c89,_0x19bfe6){var _0x42084b=function(_0x1281c2){while(--_0x1281c2){_0xa71c89['push'](_0xa71c89['shift']());}};_0x42084b(++_0x19bfe6);}(_0x7db0,0x1a5));var _0x07db=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0x7db0[_0x4bd06e];return _0x85ebb;};'use strict';var _=require(_0x07db('0x0'));var util=require(_0x07db('0x1'));var moment=require(_0x07db('0x2'));var BPromise=require(_0x07db('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x07db('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x07db('0x5'))(_0x07db('0x6'));var config=require('../../config/environment');var jayson=require(_0x07db('0x7'));var client=jayson[_0x07db('0x8')][_0x07db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c2492,_0x297c53,_0x5f4ab2){return new BPromise(function(_0x37d4df,_0x54c14f){return client[_0x07db('0xa')](_0x4c2492,_0x5f4ab2)[_0x07db('0xb')](function(_0x2e200d){logger[_0x07db('0xc')](_0x07db('0xd'),_0x297c53,'request\x20sent');logger[_0x07db('0xe')](_0x07db('0xf'),_0x297c53,_0x07db('0x10'),JSON[_0x07db('0x11')](_0x2e200d));if(_0x2e200d[_0x07db('0x12')]){if(_0x2e200d[_0x07db('0x12')][_0x07db('0x13')]===0x1f4){logger[_0x07db('0x12')]('SalesforceField,\x20%s,\x20%s',_0x297c53,_0x2e200d[_0x07db('0x12')][_0x07db('0x14')]);return _0x54c14f(_0x2e200d[_0x07db('0x12')][_0x07db('0x14')]);}logger[_0x07db('0x12')](_0x07db('0xd'),_0x297c53,_0x2e200d[_0x07db('0x12')][_0x07db('0x14')]);return _0x37d4df(_0x2e200d[_0x07db('0x12')][_0x07db('0x14')]);}else{logger[_0x07db('0xc')](_0x07db('0xd'),_0x297c53,_0x07db('0x10'));_0x37d4df(_0x2e200d[_0x07db('0x15')]['message']);}})['catch'](function(_0x33b395){logger['error'](_0x07db('0xd'),_0x297c53,_0x33b395);_0x54c14f(_0x33b395);});});} \ No newline at end of file +var _0xf966=['jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment'];(function(_0x1daa41,_0x5b237e){var _0x11b50c=function(_0x4db01){while(--_0x4db01){_0x1daa41['push'](_0x1daa41['shift']());}};_0x11b50c(++_0x5b237e);}(_0xf966,0x185));var _0x6f96=function(_0x38c747,_0x4d29e0){_0x38c747=_0x38c747-0x0;var _0x1ec59e=_0xf966[_0x38c747];return _0x1ec59e;};'use strict';var _=require(_0x6f96('0x0'));var util=require('util');var moment=require(_0x6f96('0x1'));var BPromise=require(_0x6f96('0x2'));var rs=require(_0x6f96('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f96('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6f96('0x5'));var config=require(_0x6f96('0x6'));var jayson=require(_0x6f96('0x7'));var client=jayson[_0x6f96('0x8')][_0x6f96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5893b9,_0xeb7a29,_0x48a2e2){return new BPromise(function(_0x466963,_0x4bd501){return client[_0x6f96('0xa')](_0x5893b9,_0x48a2e2)[_0x6f96('0xb')](function(_0x3374e1){logger[_0x6f96('0xc')](_0x6f96('0xd'),_0xeb7a29,_0x6f96('0xe'));logger[_0x6f96('0xf')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0xeb7a29,_0x6f96('0xe'),JSON[_0x6f96('0x10')](_0x3374e1));if(_0x3374e1[_0x6f96('0x11')]){if(_0x3374e1[_0x6f96('0x11')][_0x6f96('0x12')]===0x1f4){logger[_0x6f96('0x11')](_0x6f96('0xd'),_0xeb7a29,_0x3374e1[_0x6f96('0x11')]['message']);return _0x4bd501(_0x3374e1[_0x6f96('0x11')]['message']);}logger['error']('SalesforceField,\x20%s,\x20%s',_0xeb7a29,_0x3374e1[_0x6f96('0x11')][_0x6f96('0x13')]);return _0x466963(_0x3374e1[_0x6f96('0x11')][_0x6f96('0x13')]);}else{logger['info'](_0x6f96('0xd'),_0xeb7a29,_0x6f96('0xe'));_0x466963(_0x3374e1[_0x6f96('0x14')][_0x6f96('0x13')]);}})[_0x6f96('0x15')](function(_0x1825a3){logger[_0x6f96('0x11')](_0x6f96('0xd'),_0xeb7a29,_0x1825a3);_0x4bd501(_0x1825a3);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 85f60c6..b1de9fc 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 _0xb406=['create','post','addConfiguration','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x4177ca,_0x16c0da){var _0x44e664=function(_0x1ef382){while(--_0x1ef382){_0x4177ca['push'](_0x4177ca['shift']());}};_0x44e664(++_0x16c0da);}(_0xb406,0x10c));var _0x6b40=function(_0xff7686,_0x5f51d8){_0xff7686=_0xff7686-0x0;var _0x2c9cab=_0xb406[_0xff7686];return _0x2c9cab;};'use strict';var multer=require(_0x6b40('0x0'));var util=require(_0x6b40('0x1'));var path=require(_0x6b40('0x2'));var timeout=require(_0x6b40('0x3'));var express=require(_0x6b40('0x4'));var router=express[_0x6b40('0x5')]();var fs_extra=require(_0x6b40('0x6'));var auth=require(_0x6b40('0x7'));var interaction=require(_0x6b40('0x8'));var config=require(_0x6b40('0x9'));var controller=require('./intServicenowAccount.controller');router[_0x6b40('0xa')]('/',auth[_0x6b40('0xb')](),controller[_0x6b40('0xc')]);router[_0x6b40('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x6b40('0xd')]);router[_0x6b40('0xa')](_0x6b40('0xe'),auth['isAuthenticated'](),controller[_0x6b40('0xf')]);router[_0x6b40('0xa')](_0x6b40('0x10'),auth[_0x6b40('0xb')](),controller[_0x6b40('0x11')]);router['post']('/',auth[_0x6b40('0xb')](),controller[_0x6b40('0x12')]);router[_0x6b40('0x13')](_0x6b40('0xe'),auth['isAuthenticated'](),controller[_0x6b40('0x14')]);router[_0x6b40('0x15')](_0x6b40('0x16'),auth[_0x6b40('0xb')](),controller[_0x6b40('0x17')]);router[_0x6b40('0x18')](_0x6b40('0x16'),auth['isAuthenticated'](),controller[_0x6b40('0x19')]);module['exports']=router; \ No newline at end of file +var _0x3e1d=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x9f4e39,_0x570664){var _0x59ab98=function(_0x4ae806){while(--_0x4ae806){_0x9f4e39['push'](_0x9f4e39['shift']());}};_0x59ab98(++_0x570664);}(_0x3e1d,0xad));var _0xd3e1=function(_0x28a245,_0x1d817a){_0x28a245=_0x28a245-0x0;var _0x1bfce6=_0x3e1d[_0x28a245];return _0x1bfce6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd3e1('0x0'));var timeout=require(_0xd3e1('0x1'));var express=require('express');var router=express[_0xd3e1('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd3e1('0x3'));var interaction=require(_0xd3e1('0x4'));var config=require(_0xd3e1('0x5'));var controller=require('./intServicenowAccount.controller');router[_0xd3e1('0x6')]('/',auth[_0xd3e1('0x7')](),controller[_0xd3e1('0x8')]);router[_0xd3e1('0x6')](_0xd3e1('0x9'),auth[_0xd3e1('0x7')](),controller[_0xd3e1('0xa')]);router[_0xd3e1('0x6')](_0xd3e1('0xb'),auth[_0xd3e1('0x7')](),controller[_0xd3e1('0xc')]);router[_0xd3e1('0x6')](_0xd3e1('0xd'),auth[_0xd3e1('0x7')](),controller['getFields']);router['post']('/',auth[_0xd3e1('0x7')](),controller[_0xd3e1('0xe')]);router[_0xd3e1('0xf')](_0xd3e1('0xb'),auth[_0xd3e1('0x7')](),controller[_0xd3e1('0x10')]);router['put']('/:id',auth[_0xd3e1('0x7')](),controller['update']);router[_0xd3e1('0x11')](_0xd3e1('0x9'),auth[_0xd3e1('0x7')](),controller[_0xd3e1('0x12')]);module[_0xd3e1('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 25df5bf..f68c93c 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 _0x6b47=['remoteUri','sequelize','exports','STRING','username'];(function(_0x1405f5,_0x54d9ec){var _0x5a9e8b=function(_0x583fca){while(--_0x583fca){_0x1405f5['push'](_0x1405f5['shift']());}};_0x5a9e8b(++_0x54d9ec);}(_0x6b47,0x14b));var _0x76b4=function(_0xd60cb,_0x25496e){_0xd60cb=_0xd60cb-0x0;var _0x47eecd=_0x6b47[_0xd60cb];return _0x47eecd;};'use strict';var Sequelize=require(_0x76b4('0x0'));module[_0x76b4('0x1')]={'name':{'type':Sequelize[_0x76b4('0x2')]},'description':{'type':Sequelize[_0x76b4('0x2')]},'username':{'type':Sequelize[_0x76b4('0x2')],'unique':_0x76b4('0x3')},'password':{'type':Sequelize[_0x76b4('0x2')]},'email':{'type':Sequelize[_0x76b4('0x2')]},'remoteUri':{'type':Sequelize[_0x76b4('0x2')],'unique':_0x76b4('0x4')},'serverUrl':{'type':Sequelize[_0x76b4('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x98b7=['remoteUri','sequelize','STRING'];(function(_0x54d5ba,_0x1f1ba9){var _0x6a592e=function(_0x394f8d){while(--_0x394f8d){_0x54d5ba['push'](_0x54d5ba['shift']());}};_0x6a592e(++_0x1f1ba9);}(_0x98b7,0x1f0));var _0x798b=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x98b7[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x798b('0x0'));module['exports']={'name':{'type':Sequelize[_0x798b('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x798b('0x1')],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x798b('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x798b('0x2')},'serverUrl':{'type':Sequelize[_0x798b('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 98b8a72..c965510 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 _0x1f6a=['sla_due','due_date','sys_mod_count','sys_tags','correlation_id','location','username','email','remoteUri','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','forEach','internalType','label','push','all','TCL:\x20_object','includes','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','create','body','find','params','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','getSubjects','Descriptions','ServicenowField','Subjects','hold_reason','knowledge','subcategory','close_code','incident_state','severity','category','parent','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','state','calendar_stc','closed_at','delivery_plan','impact','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','caller_id','work_notes','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','notify','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','comments'];(function(_0x13524d,_0x505b49){var _0x9918b4=function(_0xef1f0a){while(--_0xef1f0a){_0x13524d['push'](_0x13524d['shift']());}};_0x9918b4(++_0x505b49);}(_0x1f6a,0xe5));var _0xa1f6=function(_0x9e48c3,_0x226549){_0x9e48c3=_0x9e48c3-0x0;var _0x7fa7b2=_0x1f6a[_0x9e48c3];return _0x7fa7b2;};'use strict';var emlformat=require(_0xa1f6('0x0'));var rimraf=require(_0xa1f6('0x1'));var zipdir=require(_0xa1f6('0x2'));var jsonpatch=require(_0xa1f6('0x3'));var rp=require(_0xa1f6('0x4'));var moment=require(_0xa1f6('0x5'));var BPromise=require(_0xa1f6('0x6'));var Mustache=require(_0xa1f6('0x7'));var util=require(_0xa1f6('0x8'));var path=require('path');var sox=require(_0xa1f6('0x9'));var csv=require(_0xa1f6('0xa'));var ejs=require(_0xa1f6('0xb'));var fs=require('fs');var fs_extra=require(_0xa1f6('0xc'));var _=require(_0xa1f6('0xd'));var squel=require(_0xa1f6('0xe'));var crypto=require(_0xa1f6('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xa1f6('0x10'));var toCsv=require(_0xa1f6('0xa'));var querystring=require(_0xa1f6('0x11'));var Papa=require(_0xa1f6('0x12'));var Redis=require('ioredis');var authService=require(_0xa1f6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa1f6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa1f6('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa1f6('0x16'));var db=require(_0xa1f6('0x17'))['db'];var integrations=require(_0xa1f6('0x18'));function respondWithStatusCode(_0x104b6c,_0x3d0ca6){_0x3d0ca6=_0x3d0ca6||0xcc;return function(_0x3a9453){if(_0x3a9453){return _0x104b6c[_0xa1f6('0x19')](_0x3d0ca6);}return _0x104b6c['status'](_0x3d0ca6)[_0xa1f6('0x1a')]();};}function respondWithResult(_0x13e473,_0x11b5cb){_0x11b5cb=_0x11b5cb||0xc8;return function(_0x37e2d9){if(_0x37e2d9){return _0x13e473[_0xa1f6('0x1b')](_0x11b5cb)[_0xa1f6('0x1c')](_0x37e2d9);}};}function respondWithFilteredResult(_0x25974a,_0x465b7e){return function(_0x4a2295){if(_0x4a2295){var _0x4b6966=typeof _0x465b7e[_0xa1f6('0x1d')]===_0xa1f6('0x1e')&&typeof _0x465b7e[_0xa1f6('0x1f')]==='undefined';var _0xb15a0a=_0x4a2295[_0xa1f6('0x20')];var _0xdee54f=_0x4b6966?0x0:_0x465b7e[_0xa1f6('0x1d')];var _0x364018=_0x4b6966?_0x4a2295[_0xa1f6('0x20')]:_0x465b7e[_0xa1f6('0x1d')]+_0x465b7e['limit'];var _0x3985d7;if(_0x364018>=_0xb15a0a){_0x364018=_0xb15a0a;_0x3985d7=0xc8;}else{_0x3985d7=0xce;}_0x25974a['status'](_0x3985d7);return _0x25974a[_0xa1f6('0x21')](_0xa1f6('0x22'),_0xdee54f+'-'+_0x364018+'/'+_0xb15a0a)['json'](_0x4a2295);}return null;};}function patchUpdates(_0x12839a){return function(_0x44238c){try{jsonpatch[_0xa1f6('0x23')](_0x44238c,_0x12839a,!![]);}catch(_0x3c0189){return BPromise[_0xa1f6('0x24')](_0x3c0189);}return _0x44238c[_0xa1f6('0x25')]();};}function saveUpdates(_0x43f4c4,_0x3caf59){return function(_0x3b3820){if(_0x3b3820){return _0x3b3820[_0xa1f6('0x26')](_0x43f4c4)[_0xa1f6('0x27')](function(_0x4dddfd){return _0x4dddfd;});}return null;};}function removeEntity(_0x3450b6,_0x123bee){return function(_0x30a030){if(_0x30a030){return _0x30a030[_0xa1f6('0x28')]()[_0xa1f6('0x27')](function(){_0x3450b6[_0xa1f6('0x1b')](0xcc)[_0xa1f6('0x1a')]();});}};}function handleEntityNotFound(_0x2c8390,_0x522c5e){return function(_0x3decf8){if(!_0x3decf8){_0x2c8390[_0xa1f6('0x19')](0x194);}return _0x3decf8;};}function handleError(_0x1fb3a8,_0x2d3707){_0x2d3707=_0x2d3707||0x1f4;return function(_0xc3146f){logger[_0xa1f6('0x29')](_0xc3146f[_0xa1f6('0x2a')]);if(_0xc3146f[_0xa1f6('0x2b')]){delete _0xc3146f['name'];}_0x1fb3a8[_0xa1f6('0x1b')](_0x2d3707)[_0xa1f6('0x2c')](_0xc3146f);};}exports[_0xa1f6('0x2d')]=function(_0x3b2196,_0x1811ad){var _0x685a6c={},_0x3d996b={},_0x5befa5={'count':0x0,'rows':[]};var _0x44ecd1=_[_0xa1f6('0x2e')](db[_0xa1f6('0x2f')][_0xa1f6('0x30')],function(_0x306bf4){return{'name':_0x306bf4[_0xa1f6('0x31')],'type':_0x306bf4[_0xa1f6('0x32')][_0xa1f6('0x33')]};});_0x3d996b[_0xa1f6('0x34')]=_[_0xa1f6('0x2e')](_0x44ecd1,_0xa1f6('0x2b'));_0x3d996b[_0xa1f6('0x35')]=_[_0xa1f6('0x36')](_0x3b2196[_0xa1f6('0x35')]);_0x3d996b[_0xa1f6('0x37')]=_[_0xa1f6('0x38')](_0x3d996b[_0xa1f6('0x34')],_0x3d996b[_0xa1f6('0x35')]);_0x685a6c[_0xa1f6('0x39')]=_[_0xa1f6('0x38')](_0x3d996b[_0xa1f6('0x34')],qs[_0xa1f6('0x3a')](_0x3b2196['query'][_0xa1f6('0x3a')]));_0x685a6c[_0xa1f6('0x39')]=_0x685a6c['attributes'][_0xa1f6('0x3b')]?_0x685a6c[_0xa1f6('0x39')]:_0x3d996b[_0xa1f6('0x34')];if(!_0x3b2196[_0xa1f6('0x35')][_0xa1f6('0x3c')](_0xa1f6('0x3d'))){_0x685a6c[_0xa1f6('0x1f')]=qs[_0xa1f6('0x1f')](_0x3b2196['query']['limit']);_0x685a6c[_0xa1f6('0x1d')]=qs['offset'](_0x3b2196['query'][_0xa1f6('0x1d')]);}_0x685a6c[_0xa1f6('0x3e')]=qs[_0xa1f6('0x3f')](_0x3b2196[_0xa1f6('0x35')][_0xa1f6('0x3f')]);_0x685a6c[_0xa1f6('0x40')]=qs[_0xa1f6('0x37')](_[_0xa1f6('0x41')](_0x3b2196[_0xa1f6('0x35')],_0x3d996b['filters']),_0x44ecd1);if(_0x3b2196[_0xa1f6('0x35')][_0xa1f6('0x42')]){_0x685a6c[_0xa1f6('0x40')]=_[_0xa1f6('0x43')](_0x685a6c[_0xa1f6('0x40')],{'$or':_[_0xa1f6('0x2e')](_0x44ecd1,function(_0x353e47){if(_0x353e47[_0xa1f6('0x32')]!==_0xa1f6('0x44')){var _0x41d949={};_0x41d949[_0x353e47[_0xa1f6('0x2b')]]={'$like':'%'+_0x3b2196[_0xa1f6('0x35')][_0xa1f6('0x42')]+'%'};return _0x41d949;}})});}_0x685a6c=_[_0xa1f6('0x43')]({},_0x685a6c,_0x3b2196[_0xa1f6('0x45')]);var _0x53135c={'where':_0x685a6c[_0xa1f6('0x40')]};return db['ServicenowAccount']['count'](_0x53135c)['then'](function(_0x16b0aa){_0x5befa5['count']=_0x16b0aa;if(_0x3b2196[_0xa1f6('0x35')][_0xa1f6('0x46')]){_0x685a6c[_0xa1f6('0x47')]=[{'all':!![]}];}return db[_0xa1f6('0x2f')][_0xa1f6('0x48')](_0x685a6c);})[_0xa1f6('0x27')](function(_0x4d755e){_0x5befa5[_0xa1f6('0x49')]=_0x4d755e;return _0x5befa5;})['then'](respondWithFilteredResult(_0x1811ad,_0x685a6c))[_0xa1f6('0x4a')](handleError(_0x1811ad,null));};exports['show']=function(_0xde8115,_0x229fad){var _0x5d6337={'raw':![],'where':{'id':_0xde8115['params']['id']}},_0x2d3de8={};_0x2d3de8[_0xa1f6('0x34')]=_[_0xa1f6('0x36')](db[_0xa1f6('0x2f')]['rawAttributes']);_0x2d3de8[_0xa1f6('0x35')]=_[_0xa1f6('0x36')](_0xde8115[_0xa1f6('0x35')]);_0x2d3de8[_0xa1f6('0x37')]=_[_0xa1f6('0x38')](_0x2d3de8[_0xa1f6('0x34')],_0x2d3de8[_0xa1f6('0x35')]);_0x5d6337[_0xa1f6('0x39')]=_[_0xa1f6('0x38')](_0x2d3de8['model'],qs[_0xa1f6('0x3a')](_0xde8115[_0xa1f6('0x35')][_0xa1f6('0x3a')]));_0x5d6337[_0xa1f6('0x39')]=_0x5d6337[_0xa1f6('0x39')][_0xa1f6('0x3b')]?_0x5d6337[_0xa1f6('0x39')]:_0x2d3de8[_0xa1f6('0x34')];if(_0xde8115[_0xa1f6('0x35')]['includeAll']){_0x5d6337[_0xa1f6('0x47')]=[{'all':!![]}];}_0x5d6337=_['merge']({},_0x5d6337,_0xde8115['options']);return db[_0xa1f6('0x2f')]['find'](_0x5d6337)[_0xa1f6('0x27')](handleEntityNotFound(_0x229fad,null))[_0xa1f6('0x27')](respondWithResult(_0x229fad,null))['catch'](handleError(_0x229fad,null));};exports[_0xa1f6('0x4b')]=function(_0x2c9952,_0xd3573b){return db[_0xa1f6('0x2f')][_0xa1f6('0x4b')](_0x2c9952[_0xa1f6('0x4c')],{})[_0xa1f6('0x27')](respondWithResult(_0xd3573b,0xc9))[_0xa1f6('0x4a')](handleError(_0xd3573b,null));};exports['update']=function(_0x1b81e6,_0x5cbd6e){if(_0x1b81e6[_0xa1f6('0x4c')]['id']){delete _0x1b81e6[_0xa1f6('0x4c')]['id'];}return db['ServicenowAccount'][_0xa1f6('0x4d')]({'where':{'id':_0x1b81e6[_0xa1f6('0x4e')]['id']}})[_0xa1f6('0x27')](handleEntityNotFound(_0x5cbd6e,null))[_0xa1f6('0x27')](saveUpdates(_0x1b81e6[_0xa1f6('0x4c')],null))[_0xa1f6('0x27')](respondWithResult(_0x5cbd6e,null))[_0xa1f6('0x4a')](handleError(_0x5cbd6e,null));};exports[_0xa1f6('0x28')]=function(_0x3f6c9e,_0x5aeb5a){return db['ServicenowAccount']['find']({'where':{'id':_0x3f6c9e['params']['id']}})['then'](handleEntityNotFound(_0x5aeb5a,null))[_0xa1f6('0x27')](removeEntity(_0x5aeb5a,null))[_0xa1f6('0x4a')](handleError(_0x5aeb5a,null));};exports[_0xa1f6('0x4f')]=function(_0x2424de,_0x23fdea,_0x45dfd6){var _0x4037c5={};var _0x42cc57={};var _0x202760;var _0x320f3c;return db[_0xa1f6('0x2f')][_0xa1f6('0x50')]({'where':{'id':_0x2424de['params']['id']}})[_0xa1f6('0x27')](handleEntityNotFound(_0x23fdea,null))[_0xa1f6('0x27')](function(_0x4e91ab){if(_0x4e91ab){_0x202760=_0x4e91ab;_0x42cc57[_0xa1f6('0x34')]=_[_0xa1f6('0x36')](db[_0xa1f6('0x51')]['rawAttributes']);_0x42cc57['query']=_[_0xa1f6('0x36')](_0x2424de[_0xa1f6('0x35')]);_0x42cc57[_0xa1f6('0x37')]=_[_0xa1f6('0x38')](_0x42cc57[_0xa1f6('0x34')],_0x42cc57[_0xa1f6('0x35')]);_0x4037c5[_0xa1f6('0x39')]=_['intersection'](_0x42cc57[_0xa1f6('0x34')],qs[_0xa1f6('0x3a')](_0x2424de['query'][_0xa1f6('0x3a')]));_0x4037c5['attributes']=_0x4037c5['attributes'][_0xa1f6('0x3b')]?_0x4037c5[_0xa1f6('0x39')]:_0x42cc57[_0xa1f6('0x34')];_0x4037c5[_0xa1f6('0x3e')]=qs[_0xa1f6('0x3f')](_0x2424de[_0xa1f6('0x35')][_0xa1f6('0x3f')]);_0x4037c5['where']=qs[_0xa1f6('0x37')](_[_0xa1f6('0x41')](_0x2424de[_0xa1f6('0x35')],_0x42cc57['filters']));if(_0x2424de['query'][_0xa1f6('0x42')]){_0x4037c5[_0xa1f6('0x40')]=_[_0xa1f6('0x43')](_0x4037c5[_0xa1f6('0x40')],{'$or':_['map'](_0x4037c5[_0xa1f6('0x39')],function(_0x435497){var _0x300955={};_0x300955[_0x435497]={'$like':'%'+_0x2424de[_0xa1f6('0x35')][_0xa1f6('0x42')]+'%'};return _0x300955;})});}_0x4037c5=_[_0xa1f6('0x43')]({},_0x4037c5,_0x2424de['options']);return _0x202760[_0xa1f6('0x4f')](_0x4037c5);}})[_0xa1f6('0x27')](function(_0xa337){if(_0xa337){_0x320f3c=_0xa337['length'];if(!_0x2424de[_0xa1f6('0x35')][_0xa1f6('0x3c')](_0xa1f6('0x3d'))){_0x4037c5[_0xa1f6('0x1f')]=qs['limit'](_0x2424de['query'][_0xa1f6('0x1f')]);_0x4037c5['offset']=qs[_0xa1f6('0x1d')](_0x2424de[_0xa1f6('0x35')][_0xa1f6('0x1d')]);}return _0x202760[_0xa1f6('0x4f')](_0x4037c5);}})['then'](function(_0x2fdb8d){if(_0x2fdb8d){return _0x2fdb8d?{'count':_0x320f3c,'rows':_0x2fdb8d}:null;}})[_0xa1f6('0x27')](respondWithResult(_0x23fdea,null))[_0xa1f6('0x4a')](handleError(_0x23fdea,null));};exports[_0xa1f6('0x52')]=function(_0x2a0282,_0x2b6791,_0xe5422a){if(_0x2a0282[_0xa1f6('0x4c')]['id']){delete _0x2a0282[_0xa1f6('0x4c')]['id'];}return db[_0xa1f6('0x2f')][_0xa1f6('0x50')]({'where':{'id':_0x2a0282['params']['id']}})[_0xa1f6('0x27')](handleEntityNotFound(_0x2b6791,null))[_0xa1f6('0x27')](function(_0x1d0c00){if(_0x1d0c00){_0x2a0282[_0xa1f6('0x4c')][_0xa1f6('0x53')]=_0x1d0c00['id'];_0x2a0282[_0xa1f6('0x4c')]['Subjects']=integrations[_0xa1f6('0x54')](_0x2a0282[_0xa1f6('0x4c')]['channel'],_0x2a0282[_0xa1f6('0x4c')][_0xa1f6('0x32')]);_0x2a0282[_0xa1f6('0x4c')][_0xa1f6('0x55')]=integrations['getDescriptions'](_0x2a0282['body']['channel'],_0x2a0282[_0xa1f6('0x4c')][_0xa1f6('0x32')]);return db['ServicenowConfiguration'][_0xa1f6('0x4b')](_0x2a0282[_0xa1f6('0x4c')],{'include':[{'model':db[_0xa1f6('0x56')],'as':_0xa1f6('0x57')},{'model':db[_0xa1f6('0x56')],'as':_0xa1f6('0x55')}]});}return null;})['then'](respondWithResult(_0x2b6791,null))[_0xa1f6('0x4a')](handleError(_0x2b6791,null));};exports['getFields']=function(_0x443969,_0x147137,_0x4c2098){var _0x208981=['made_sla',_0xa1f6('0x58'),_0xa1f6('0x59'),_0xa1f6('0x5a'),_0xa1f6('0x5b'),'notify',_0xa1f6('0x5c'),_0xa1f6('0x5d'),_0xa1f6('0x5e')];var _0x2853b1=[_0xa1f6('0x5f'),'made_sla','caused_by',_0xa1f6('0x60'),_0xa1f6('0x61'),_0xa1f6('0x62'),_0xa1f6('0x63'),'hold_reason',_0xa1f6('0x64'),_0xa1f6('0x65'),_0xa1f6('0x66'),_0xa1f6('0x67'),_0xa1f6('0x68'),'user_input',_0xa1f6('0x69'),_0xa1f6('0x6a'),_0xa1f6('0x6b'),'sys_created_by','knowledge',_0xa1f6('0x3e'),_0xa1f6('0x6c'),_0xa1f6('0x6d'),'cmdb_ci',_0xa1f6('0x6e'),_0xa1f6('0x6f'),'active',_0xa1f6('0x70'),'business_service',_0xa1f6('0x71'),_0xa1f6('0x72'),_0xa1f6('0x73'),_0xa1f6('0x74'),_0xa1f6('0x75'),_0xa1f6('0x76'),_0xa1f6('0x77'),_0xa1f6('0x78'),_0xa1f6('0x79'),_0xa1f6('0x7a'),'resolved_at',_0xa1f6('0x7b'),'approval_set',_0xa1f6('0x5a'),_0xa1f6('0x7c'),'short_description','close_code',_0xa1f6('0x7d'),_0xa1f6('0x7e'),_0xa1f6('0x7f'),_0xa1f6('0x80'),_0xa1f6('0x81'),_0xa1f6('0x82'),'description',_0xa1f6('0x83'),_0xa1f6('0x84'),_0xa1f6('0x85'),_0xa1f6('0x86'),_0xa1f6('0x87'),_0xa1f6('0x88'),_0xa1f6('0x89'),_0xa1f6('0x8a'),_0xa1f6('0x8b'),_0xa1f6('0x8c'),'incident_state',_0xa1f6('0x8d'),_0xa1f6('0x8e'),_0xa1f6('0x8f'),_0xa1f6('0x90'),_0xa1f6('0x91'),'assigned_to',_0xa1f6('0x5d'),_0xa1f6('0x92'),_0xa1f6('0x93'),'approval','comments_and_work_notes',_0xa1f6('0x94'),_0xa1f6('0x95'),'reopen_count',_0xa1f6('0x96'),'escalation','upon_approval',_0xa1f6('0x97'),_0xa1f6('0x98'),_0xa1f6('0x5e')];var _0xa5ecdc='';var _0x32906f='';var _0x23e6de=[];var _0x4fc7b3='';var _0x607cb2='';var _0x28bc60=[];var _0x47a60b='';var _0x1651b0='';var _0x200910={};var _0x385fb1='';return db[_0xa1f6('0x2f')]['findOne']({'where':{'id':_0x443969['params']['id']},'attributes':['id',_0xa1f6('0x99'),'password',_0xa1f6('0x9a'),_0xa1f6('0x9b'),'serverUrl']})[_0xa1f6('0x27')](handleEntityNotFound(_0x147137,null))[_0xa1f6('0x27')](function(_0x3711bc){if(_0x3711bc){_0x385fb1=_0x3711bc[_0xa1f6('0x9b')];var _0x47cc61=_0x385fb1['slice'](-0x1);if(_0x47cc61==='/'){_0x385fb1=_0x385fb1[_0xa1f6('0x9c')](0x0,_0x385fb1[_0xa1f6('0x9d')](_0x47cc61));}_0x1651b0=util[_0xa1f6('0x9e')](_0xa1f6('0x9f'),_0x385fb1);_0x47a60b=util[_0xa1f6('0x9e')](_0xa1f6('0xa0'),_0x385fb1);_0x200910={'user':_0x3711bc[_0xa1f6('0x99')],'pass':_0x3711bc[_0xa1f6('0xa1')]};var _0x45e31e={'method':_0xa1f6('0xa2'),'uri':_0x1651b0+_0xa1f6('0xa3'),'auth':_0x200910,'json':!![]};return rp(_0x45e31e);}})[_0xa1f6('0x27')](function(_0x47f322){if(_0x47f322[_0xa1f6('0xa4')][_0xa1f6('0x3b')]>0x0){_0xa5ecdc=_0x47f322[_0xa1f6('0xa4')];}console[_0xa1f6('0xa5')](_0xa1f6('0xa6'),_0xa5ecdc);_0x28bc60=[];_0x32906f=Object['assign']([],_0xa5ecdc);_[_0xa1f6('0xa7')](_0x32906f,function(_0x4f3c7a){return!_0x208981['includes'](_0x4f3c7a[_0xa1f6('0x2b')]);});_0x32906f[_0xa1f6('0xa8')](function(_0x2598fd){var _0x348e88=createFieldObject(_0x47a60b,_0x200910,_0x2598fd[_0xa1f6('0xa9')],_0x2598fd[_0xa1f6('0x2b')],_0x2598fd[_0xa1f6('0xaa')],![]);_0x28bc60[_0xa1f6('0xab')](_0x348e88);});return Promise[_0xa1f6('0xac')](_0x28bc60);})[_0xa1f6('0x27')](function(_0x3b9af9){_0x23e6de=_0x3b9af9;_0x4fc7b3=Object['assign']([],_0xa5ecdc);console['log'](_0xa1f6('0xad'),_0xa5ecdc);_['remove'](_0x4fc7b3,function(_0x43bfbe){return _0x2853b1[_0xa1f6('0xae')](_0x43bfbe[_0xa1f6('0x2b')]);});console[_0xa1f6('0xa5')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x4fc7b3);_0x28bc60=[];_0x4fc7b3[_0xa1f6('0xa8')](function(_0xe7e831){var _0x1239b0=createFieldObject(_0x47a60b,_0x200910,_0xe7e831[_0xa1f6('0xa9')],_0xe7e831['name'],_0xe7e831['label'],!![]);_0x28bc60['push'](_0x1239b0);});return Promise[_0xa1f6('0xac')](_0x28bc60);})['then'](function(_0x1f8782){_0x607cb2=_0x1f8782;var _0x4b1eb2=_0x23e6de[_0xa1f6('0xaf')](_0x607cb2);return{'count':_0x4b1eb2[_0xa1f6('0x3b')],'rows':_0x4b1eb2};})['then'](respondWithResult(_0x147137,null))[_0xa1f6('0x4a')](function(_0x9b0008){console[_0xa1f6('0xa5')](_0xa1f6('0xb0')+_0x9b0008);var _0x5fbda9=_0x443969[_0xa1f6('0x35')][_0xa1f6('0xb1')]?0x1f4:_0x9b0008[_0xa1f6('0xb2')]||0x1f4;logger[_0xa1f6('0x29')](_0x9b0008[_0xa1f6('0x2a')]);delete _0x9b0008['name'];if(_0x5fbda9===0x191){_0x5fbda9=0x190;}_0x147137[_0xa1f6('0x1b')](_0x5fbda9)['send'](_0x443969[_0xa1f6('0x35')][_0xa1f6('0xb1')]?{'message':_0xa1f6('0xb3'),'statusCode':_0x9b0008[_0xa1f6('0xb2')]}:_0x9b0008);});};function createFieldObject(_0x42d97d,_0x3900a9,_0x4da3c1,_0x1bcfe7,_0x140c8f,_0x19234d){return new Promise(function(_0x326774,_0x5aa641){var _0x273b32={'id':_0x1bcfe7,'name':_0x140c8f,'custom':_0x19234d};if(_0x4da3c1===_0xa1f6('0xb4')){_0x273b32[_0xa1f6('0x45')]=[{'name':_0xa1f6('0xb5'),'value':_0xa1f6('0xb6')},{'name':_0xa1f6('0xb7'),'value':_0xa1f6('0xb8')}];_0x326774(_0x273b32);}else{var _0x1d371f={'method':_0xa1f6('0xa2'),'uri':_0x42d97d+_0xa1f6('0xb9')+_0x1bcfe7,'auth':_0x3900a9,'json':!![]};return rp(_0x1d371f)[_0xa1f6('0x27')](function(_0x2f0124){var _0x17ebc0=[];if(_0x2f0124[_0xa1f6('0xa4')]['length']>0x0){_0x2f0124[_0xa1f6('0xa4')][_0xa1f6('0xa8')](function(_0x2b7f07){if(_0x2b7f07[_0xa1f6('0xba')]===_0xa1f6('0xb8')){var _0x2497c0={'name':_0x2b7f07['label'],'value':_0x2b7f07[_0xa1f6('0xbb')]};_0x17ebc0[_0xa1f6('0xab')](_0x2497c0);}});}_0x273b32['options']=_0x17ebc0;if(_0x273b32[_0xa1f6('0x45')]['length']>0x0){_0x326774(_0x273b32);}else{if(_0x19234d==![]){_0x326774();}else{_0x326774(_0x273b32);}}});}});} \ No newline at end of file +var _0x8e2b=['../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','index','ServicenowAccount','rawAttributes','fieldName','type','map','name','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','length','options','find','create','body','params','keys','ServicenowConfiguration','pick','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','incident_state','severity','parent','caused_by','watch_list','upon_reject','sys_updated_on','approval_history','number','sys_updated_by','opened_by','sys_domain','state','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','caller_id','approval_set','correlation_display','assignment_group','business_stc','additional_assignee_list','description','notify','sys_class_name','closed_by','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','sla_due','comments_and_work_notes','due_date','sys_mod_count','escalation','upon_approval','correlation_id','location','findOne','username','password','remoteUri','serverUrl','substring','format','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','forEach','internalType','label','push','all','assign','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','stack','send','statusCode','boolean','True','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x2f16e5,_0x2e75e0){var _0x5d082a=function(_0x13873b){while(--_0x13873b){_0x2f16e5['push'](_0x2f16e5['shift']());}};_0x5d082a(++_0x2e75e0);}(_0x8e2b,0x15a));var _0xb8e2=function(_0x34edc9,_0x4afd1c){_0x34edc9=_0x34edc9-0x0;var _0x15a1c5=_0x8e2b[_0x34edc9];return _0x15a1c5;};'use strict';var emlformat=require(_0xb8e2('0x0'));var rimraf=require(_0xb8e2('0x1'));var zipdir=require(_0xb8e2('0x2'));var jsonpatch=require(_0xb8e2('0x3'));var rp=require(_0xb8e2('0x4'));var moment=require(_0xb8e2('0x5'));var BPromise=require(_0xb8e2('0x6'));var Mustache=require(_0xb8e2('0x7'));var util=require(_0xb8e2('0x8'));var path=require('path');var sox=require(_0xb8e2('0x9'));var csv=require('to-csv');var ejs=require(_0xb8e2('0xa'));var fs=require('fs');var fs_extra=require(_0xb8e2('0xb'));var _=require(_0xb8e2('0xc'));var squel=require(_0xb8e2('0xd'));var crypto=require(_0xb8e2('0xe'));var jsforce=require(_0xb8e2('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb8e2('0x10'));var querystring=require(_0xb8e2('0x11'));var Papa=require(_0xb8e2('0x12'));var Redis=require(_0xb8e2('0x13'));var authService=require(_0xb8e2('0x14'));var qs=require(_0xb8e2('0x15'));var as=require(_0xb8e2('0x16'));var hardwareService=require(_0xb8e2('0x17'));var logger=require('../../config/logger')(_0xb8e2('0x18'));var utils=require(_0xb8e2('0x19'));var config=require(_0xb8e2('0x1a'));var licenseUtil=require(_0xb8e2('0x1b'));var db=require('../../mysqldb')['db'];var integrations=require(_0xb8e2('0x1c'));function respondWithStatusCode(_0x4f3865,_0x44ca90){_0x44ca90=_0x44ca90||0xcc;return function(_0xff49a6){if(_0xff49a6){return _0x4f3865['sendStatus'](_0x44ca90);}return _0x4f3865[_0xb8e2('0x1d')](_0x44ca90)[_0xb8e2('0x1e')]();};}function respondWithResult(_0x5a7e8d,_0x15f66){_0x15f66=_0x15f66||0xc8;return function(_0x940c72){if(_0x940c72){return _0x5a7e8d['status'](_0x15f66)[_0xb8e2('0x1f')](_0x940c72);}};}function respondWithFilteredResult(_0x532af9,_0x22f8e8){return function(_0x5b5fb7){if(_0x5b5fb7){var _0x30d15c=typeof _0x22f8e8[_0xb8e2('0x20')]===_0xb8e2('0x21')&&typeof _0x22f8e8[_0xb8e2('0x22')]===_0xb8e2('0x21');var _0x38f4ee=_0x5b5fb7[_0xb8e2('0x23')];var _0x510243=_0x30d15c?0x0:_0x22f8e8['offset'];var _0x23a0b0=_0x30d15c?_0x5b5fb7[_0xb8e2('0x23')]:_0x22f8e8[_0xb8e2('0x20')]+_0x22f8e8['limit'];var _0x30c946;if(_0x23a0b0>=_0x38f4ee){_0x23a0b0=_0x38f4ee;_0x30c946=0xc8;}else{_0x30c946=0xce;}_0x532af9['status'](_0x30c946);return _0x532af9[_0xb8e2('0x24')](_0xb8e2('0x25'),_0x510243+'-'+_0x23a0b0+'/'+_0x38f4ee)[_0xb8e2('0x1f')](_0x5b5fb7);}return null;};}function patchUpdates(_0x1930ef){return function(_0x5f5198){try{jsonpatch['apply'](_0x5f5198,_0x1930ef,!![]);}catch(_0x257647){return BPromise[_0xb8e2('0x26')](_0x257647);}return _0x5f5198[_0xb8e2('0x27')]();};}function saveUpdates(_0x5d3865,_0x7c26b7){return function(_0x2c97fa){if(_0x2c97fa){return _0x2c97fa['update'](_0x5d3865)[_0xb8e2('0x28')](function(_0x518189){return _0x518189;});}return null;};}function removeEntity(_0x23a96e,_0x3722e9){return function(_0x25dcbf){if(_0x25dcbf){return _0x25dcbf[_0xb8e2('0x29')]()['then'](function(){_0x23a96e[_0xb8e2('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ac205,_0x33215c){return function(_0x87546d){if(!_0x87546d){_0x5ac205[_0xb8e2('0x2a')](0x194);}return _0x87546d;};}function handleError(_0x55b792,_0x480105){_0x480105=_0x480105||0x1f4;return function(_0x57db06){logger[_0xb8e2('0x2b')](_0x57db06['stack']);if(_0x57db06['name']){delete _0x57db06['name'];}_0x55b792['status'](_0x480105)['send'](_0x57db06);};}exports[_0xb8e2('0x2c')]=function(_0x4861fc,_0x281504){var _0x5d472d={},_0x510865={},_0x1c22b7={'count':0x0,'rows':[]};var _0x4c35ed=_['map'](db[_0xb8e2('0x2d')][_0xb8e2('0x2e')],function(_0x24041f){return{'name':_0x24041f[_0xb8e2('0x2f')],'type':_0x24041f[_0xb8e2('0x30')]['key']};});_0x510865['model']=_[_0xb8e2('0x31')](_0x4c35ed,_0xb8e2('0x32'));_0x510865['query']=_['keys'](_0x4861fc['query']);_0x510865[_0xb8e2('0x33')]=_[_0xb8e2('0x34')](_0x510865[_0xb8e2('0x35')],_0x510865[_0xb8e2('0x36')]);_0x5d472d[_0xb8e2('0x37')]=_['intersection'](_0x510865['model'],qs[_0xb8e2('0x38')](_0x4861fc[_0xb8e2('0x36')][_0xb8e2('0x38')]));_0x5d472d['attributes']=_0x5d472d[_0xb8e2('0x37')]['length']?_0x5d472d['attributes']:_0x510865[_0xb8e2('0x35')];if(!_0x4861fc[_0xb8e2('0x36')][_0xb8e2('0x39')](_0xb8e2('0x3a'))){_0x5d472d['limit']=qs['limit'](_0x4861fc[_0xb8e2('0x36')]['limit']);_0x5d472d[_0xb8e2('0x20')]=qs[_0xb8e2('0x20')](_0x4861fc[_0xb8e2('0x36')][_0xb8e2('0x20')]);}_0x5d472d[_0xb8e2('0x3b')]=qs[_0xb8e2('0x3c')](_0x4861fc[_0xb8e2('0x36')][_0xb8e2('0x3c')]);_0x5d472d[_0xb8e2('0x3d')]=qs[_0xb8e2('0x33')](_['pick'](_0x4861fc[_0xb8e2('0x36')],_0x510865['filters']),_0x4c35ed);if(_0x4861fc['query'][_0xb8e2('0x3e')]){_0x5d472d[_0xb8e2('0x3d')]=_['merge'](_0x5d472d[_0xb8e2('0x3d')],{'$or':_[_0xb8e2('0x31')](_0x4c35ed,function(_0x3173a8){if(_0x3173a8[_0xb8e2('0x30')]!==_0xb8e2('0x3f')){var _0x43bbe4={};_0x43bbe4[_0x3173a8[_0xb8e2('0x32')]]={'$like':'%'+_0x4861fc[_0xb8e2('0x36')]['filter']+'%'};return _0x43bbe4;}})});}_0x5d472d=_[_0xb8e2('0x40')]({},_0x5d472d,_0x4861fc['options']);var _0x5913b0={'where':_0x5d472d[_0xb8e2('0x3d')]};return db[_0xb8e2('0x2d')]['count'](_0x5913b0)['then'](function(_0x2377fc){_0x1c22b7[_0xb8e2('0x23')]=_0x2377fc;if(_0x4861fc[_0xb8e2('0x36')][_0xb8e2('0x41')]){_0x5d472d[_0xb8e2('0x42')]=[{'all':!![]}];}return db[_0xb8e2('0x2d')][_0xb8e2('0x43')](_0x5d472d);})[_0xb8e2('0x28')](function(_0x2c6c69){_0x1c22b7[_0xb8e2('0x44')]=_0x2c6c69;return _0x1c22b7;})['then'](respondWithFilteredResult(_0x281504,_0x5d472d))[_0xb8e2('0x45')](handleError(_0x281504,null));};exports[_0xb8e2('0x46')]=function(_0x5280fd,_0xdd7211){var _0x3e515f={'raw':![],'where':{'id':_0x5280fd['params']['id']}},_0x26de8a={};_0x26de8a[_0xb8e2('0x35')]=_['keys'](db[_0xb8e2('0x2d')][_0xb8e2('0x2e')]);_0x26de8a['query']=_['keys'](_0x5280fd[_0xb8e2('0x36')]);_0x26de8a[_0xb8e2('0x33')]=_[_0xb8e2('0x34')](_0x26de8a[_0xb8e2('0x35')],_0x26de8a[_0xb8e2('0x36')]);_0x3e515f[_0xb8e2('0x37')]=_[_0xb8e2('0x34')](_0x26de8a[_0xb8e2('0x35')],qs['fields'](_0x5280fd[_0xb8e2('0x36')]['fields']));_0x3e515f[_0xb8e2('0x37')]=_0x3e515f[_0xb8e2('0x37')][_0xb8e2('0x47')]?_0x3e515f[_0xb8e2('0x37')]:_0x26de8a['model'];if(_0x5280fd[_0xb8e2('0x36')][_0xb8e2('0x41')]){_0x3e515f[_0xb8e2('0x42')]=[{'all':!![]}];}_0x3e515f=_['merge']({},_0x3e515f,_0x5280fd[_0xb8e2('0x48')]);return db['ServicenowAccount'][_0xb8e2('0x49')](_0x3e515f)[_0xb8e2('0x28')](handleEntityNotFound(_0xdd7211,null))[_0xb8e2('0x28')](respondWithResult(_0xdd7211,null))['catch'](handleError(_0xdd7211,null));};exports[_0xb8e2('0x4a')]=function(_0x4e412c,_0x276204){return db['ServicenowAccount'][_0xb8e2('0x4a')](_0x4e412c[_0xb8e2('0x4b')],{})[_0xb8e2('0x28')](respondWithResult(_0x276204,0xc9))['catch'](handleError(_0x276204,null));};exports['update']=function(_0x3f9a0c,_0x36daec){if(_0x3f9a0c[_0xb8e2('0x4b')]['id']){delete _0x3f9a0c['body']['id'];}return db[_0xb8e2('0x2d')][_0xb8e2('0x49')]({'where':{'id':_0x3f9a0c[_0xb8e2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x36daec,null))[_0xb8e2('0x28')](saveUpdates(_0x3f9a0c[_0xb8e2('0x4b')],null))[_0xb8e2('0x28')](respondWithResult(_0x36daec,null))['catch'](handleError(_0x36daec,null));};exports[_0xb8e2('0x29')]=function(_0xbea266,_0x527b2f){return db[_0xb8e2('0x2d')][_0xb8e2('0x49')]({'where':{'id':_0xbea266['params']['id']}})['then'](handleEntityNotFound(_0x527b2f,null))[_0xb8e2('0x28')](removeEntity(_0x527b2f,null))[_0xb8e2('0x45')](handleError(_0x527b2f,null));};exports['getConfigurations']=function(_0x1ecf9d,_0x45cadb,_0x559897){var _0x5bf030={};var _0x1df849={};var _0x1a2c11;var _0xfe067b;return db[_0xb8e2('0x2d')]['findOne']({'where':{'id':_0x1ecf9d[_0xb8e2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x45cadb,null))[_0xb8e2('0x28')](function(_0x207289){if(_0x207289){_0x1a2c11=_0x207289;_0x1df849[_0xb8e2('0x35')]=_[_0xb8e2('0x4d')](db[_0xb8e2('0x4e')][_0xb8e2('0x2e')]);_0x1df849[_0xb8e2('0x36')]=_[_0xb8e2('0x4d')](_0x1ecf9d[_0xb8e2('0x36')]);_0x1df849['filters']=_[_0xb8e2('0x34')](_0x1df849['model'],_0x1df849[_0xb8e2('0x36')]);_0x5bf030['attributes']=_['intersection'](_0x1df849[_0xb8e2('0x35')],qs[_0xb8e2('0x38')](_0x1ecf9d['query'][_0xb8e2('0x38')]));_0x5bf030[_0xb8e2('0x37')]=_0x5bf030[_0xb8e2('0x37')][_0xb8e2('0x47')]?_0x5bf030[_0xb8e2('0x37')]:_0x1df849[_0xb8e2('0x35')];_0x5bf030[_0xb8e2('0x3b')]=qs['sort'](_0x1ecf9d[_0xb8e2('0x36')]['sort']);_0x5bf030[_0xb8e2('0x3d')]=qs[_0xb8e2('0x33')](_[_0xb8e2('0x4f')](_0x1ecf9d[_0xb8e2('0x36')],_0x1df849[_0xb8e2('0x33')]));if(_0x1ecf9d['query'][_0xb8e2('0x3e')]){_0x5bf030[_0xb8e2('0x3d')]=_[_0xb8e2('0x40')](_0x5bf030[_0xb8e2('0x3d')],{'$or':_[_0xb8e2('0x31')](_0x5bf030[_0xb8e2('0x37')],function(_0x3e6c95){var _0x1f7f31={};_0x1f7f31[_0x3e6c95]={'$like':'%'+_0x1ecf9d[_0xb8e2('0x36')][_0xb8e2('0x3e')]+'%'};return _0x1f7f31;})});}_0x5bf030=_[_0xb8e2('0x40')]({},_0x5bf030,_0x1ecf9d[_0xb8e2('0x48')]);return _0x1a2c11[_0xb8e2('0x50')](_0x5bf030);}})['then'](function(_0x4a29c6){if(_0x4a29c6){_0xfe067b=_0x4a29c6[_0xb8e2('0x47')];if(!_0x1ecf9d[_0xb8e2('0x36')][_0xb8e2('0x39')]('nolimit')){_0x5bf030['limit']=qs[_0xb8e2('0x22')](_0x1ecf9d[_0xb8e2('0x36')]['limit']);_0x5bf030['offset']=qs[_0xb8e2('0x20')](_0x1ecf9d[_0xb8e2('0x36')][_0xb8e2('0x20')]);}return _0x1a2c11[_0xb8e2('0x50')](_0x5bf030);}})[_0xb8e2('0x28')](function(_0x48f85f){if(_0x48f85f){return _0x48f85f?{'count':_0xfe067b,'rows':_0x48f85f}:null;}})[_0xb8e2('0x28')](respondWithResult(_0x45cadb,null))['catch'](handleError(_0x45cadb,null));};exports[_0xb8e2('0x51')]=function(_0x3996ae,_0xba05c0,_0x4745a5){if(_0x3996ae['body']['id']){delete _0x3996ae[_0xb8e2('0x4b')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x3996ae['params']['id']}})[_0xb8e2('0x28')](handleEntityNotFound(_0xba05c0,null))[_0xb8e2('0x28')](function(_0x52e166){if(_0x52e166){_0x3996ae[_0xb8e2('0x4b')][_0xb8e2('0x52')]=_0x52e166['id'];_0x3996ae[_0xb8e2('0x4b')][_0xb8e2('0x53')]=integrations[_0xb8e2('0x54')](_0x3996ae[_0xb8e2('0x4b')][_0xb8e2('0x55')],_0x3996ae[_0xb8e2('0x4b')][_0xb8e2('0x30')]);_0x3996ae['body'][_0xb8e2('0x56')]=integrations[_0xb8e2('0x57')](_0x3996ae[_0xb8e2('0x4b')][_0xb8e2('0x55')],_0x3996ae[_0xb8e2('0x4b')][_0xb8e2('0x30')]);return db['ServicenowConfiguration'][_0xb8e2('0x4a')](_0x3996ae['body'],{'include':[{'model':db['ServicenowField'],'as':_0xb8e2('0x53')},{'model':db['ServicenowField'],'as':_0xb8e2('0x56')}]});}return null;})['then'](respondWithResult(_0xba05c0,null))[_0xb8e2('0x45')](handleError(_0xba05c0,null));};exports[_0xb8e2('0x58')]=function(_0x4660eb,_0x440a03,_0x1061e7){var _0x2c5cc0=[_0xb8e2('0x59'),_0xb8e2('0x5a'),_0xb8e2('0x5b'),_0xb8e2('0x5c'),_0xb8e2('0x5d'),'notify',_0xb8e2('0x5e'),_0xb8e2('0x5f'),'category'];var _0x5ead0f=[_0xb8e2('0x60'),_0xb8e2('0x59'),_0xb8e2('0x61'),_0xb8e2('0x62'),_0xb8e2('0x63'),_0xb8e2('0x64'),'child_incidents',_0xb8e2('0x5a'),_0xb8e2('0x65'),_0xb8e2('0x66'),'resolved_by',_0xb8e2('0x67'),_0xb8e2('0x68'),'user_input','sys_created_on',_0xb8e2('0x69'),_0xb8e2('0x6a'),_0xb8e2('0x6b'),'knowledge','order',_0xb8e2('0x6c'),_0xb8e2('0x6d'),'cmdb_ci',_0xb8e2('0x6e'),_0xb8e2('0x6f'),_0xb8e2('0x70'),_0xb8e2('0x71'),_0xb8e2('0x72'),'priority',_0xb8e2('0x73'),_0xb8e2('0x74'),_0xb8e2('0x75'),_0xb8e2('0x76'),'opened_at',_0xb8e2('0x77'),_0xb8e2('0x78'),_0xb8e2('0x79'),_0xb8e2('0x7a'),'resolved_at',_0xb8e2('0x7b'),_0xb8e2('0x7c'),_0xb8e2('0x5c'),'work_notes','short_description',_0xb8e2('0x5d'),_0xb8e2('0x7d'),'delivery_task','work_start',_0xb8e2('0x7e'),_0xb8e2('0x7f'),_0xb8e2('0x80'),_0xb8e2('0x81'),'calendar_duration',_0xb8e2('0x82'),_0xb8e2('0x83'),'close_notes',_0xb8e2('0x84'),'follow_up',_0xb8e2('0x85'),_0xb8e2('0x86'),_0xb8e2('0x87'),_0xb8e2('0x88'),_0xb8e2('0x5e'),_0xb8e2('0x89'),_0xb8e2('0x8a'),_0xb8e2('0x8b'),_0xb8e2('0x8c'),_0xb8e2('0x8d'),_0xb8e2('0x8e'),_0xb8e2('0x5f'),'comments',_0xb8e2('0x8f'),'approval',_0xb8e2('0x90'),_0xb8e2('0x91'),_0xb8e2('0x92'),'reopen_count','sys_tags',_0xb8e2('0x93'),_0xb8e2('0x94'),_0xb8e2('0x95'),_0xb8e2('0x96'),'category'];var _0x21c19b='';var _0x11dd0d='';var _0x29fa36=[];var _0x4fccda='';var _0x5bfd50='';var _0x54fad5=[];var _0x141873='';var _0x359f9f='';var _0x4089ea={};var _0x4d5d5='';return db[_0xb8e2('0x2d')][_0xb8e2('0x97')]({'where':{'id':_0x4660eb[_0xb8e2('0x4c')]['id']},'attributes':['id',_0xb8e2('0x98'),_0xb8e2('0x99'),'email',_0xb8e2('0x9a'),_0xb8e2('0x9b')]})[_0xb8e2('0x28')](handleEntityNotFound(_0x440a03,null))[_0xb8e2('0x28')](function(_0x16addb){if(_0x16addb){_0x4d5d5=_0x16addb[_0xb8e2('0x9a')];var _0x4196f2=_0x4d5d5['slice'](-0x1);if(_0x4196f2==='/'){_0x4d5d5=_0x4d5d5[_0xb8e2('0x9c')](0x0,_0x4d5d5['lastIndexOf'](_0x4196f2));}_0x359f9f=util[_0xb8e2('0x9d')]('%s/api/now/doc/table/schema/',_0x4d5d5);_0x141873=util[_0xb8e2('0x9d')]('%s/api/now/table/',_0x4d5d5);_0x4089ea={'user':_0x16addb[_0xb8e2('0x98')],'pass':_0x16addb[_0xb8e2('0x99')]};var _0x57d88b={'method':_0xb8e2('0x9e'),'uri':_0x359f9f+_0xb8e2('0x9f'),'auth':_0x4089ea,'json':!![]};return rp(_0x57d88b);}})[_0xb8e2('0x28')](function(_0x2c1aef){if(_0x2c1aef[_0xb8e2('0xa0')][_0xb8e2('0x47')]>0x0){_0x21c19b=_0x2c1aef['result'];}console[_0xb8e2('0xa1')](_0xb8e2('0xa2'),_0x21c19b);_0x54fad5=[];_0x11dd0d=Object['assign']([],_0x21c19b);_[_0xb8e2('0xa3')](_0x11dd0d,function(_0x10c9f1){return!_0x2c5cc0['includes'](_0x10c9f1[_0xb8e2('0x32')]);});_0x11dd0d[_0xb8e2('0xa4')](function(_0x5662de){var _0x38eeda=createFieldObject(_0x141873,_0x4089ea,_0x5662de[_0xb8e2('0xa5')],_0x5662de['name'],_0x5662de[_0xb8e2('0xa6')],![]);_0x54fad5[_0xb8e2('0xa7')](_0x38eeda);});return Promise[_0xb8e2('0xa8')](_0x54fad5);})[_0xb8e2('0x28')](function(_0x3bdb92){_0x29fa36=_0x3bdb92;_0x4fccda=Object[_0xb8e2('0xa9')]([],_0x21c19b);console[_0xb8e2('0xa1')](_0xb8e2('0xaa'),_0x21c19b);_[_0xb8e2('0xa3')](_0x4fccda,function(_0x16cc50){return _0x5ead0f[_0xb8e2('0xab')](_0x16cc50[_0xb8e2('0x32')]);});console[_0xb8e2('0xa1')](_0xb8e2('0xac'),_0x4fccda);_0x54fad5=[];_0x4fccda['forEach'](function(_0x26abda){var _0x568247=createFieldObject(_0x141873,_0x4089ea,_0x26abda[_0xb8e2('0xa5')],_0x26abda[_0xb8e2('0x32')],_0x26abda['label'],!![]);_0x54fad5['push'](_0x568247);});return Promise[_0xb8e2('0xa8')](_0x54fad5);})[_0xb8e2('0x28')](function(_0x17fa66){_0x5bfd50=_0x17fa66;var _0x1e43e7=_0x29fa36[_0xb8e2('0xad')](_0x5bfd50);return{'count':_0x1e43e7['length'],'rows':_0x1e43e7};})[_0xb8e2('0x28')](respondWithResult(_0x440a03,null))[_0xb8e2('0x45')](function(_0x1bdf0e){console[_0xb8e2('0xa1')](_0xb8e2('0xae')+_0x1bdf0e);var _0x1f2383=_0x4660eb[_0xb8e2('0x36')][_0xb8e2('0xaf')]?0x1f4:_0x1bdf0e['statusCode']||0x1f4;logger[_0xb8e2('0x2b')](_0x1bdf0e[_0xb8e2('0xb0')]);delete _0x1bdf0e[_0xb8e2('0x32')];if(_0x1f2383===0x191){_0x1f2383=0x190;}_0x440a03['status'](_0x1f2383)[_0xb8e2('0xb1')](_0x4660eb[_0xb8e2('0x36')][_0xb8e2('0xaf')]?{'message':'Wrong\x20credentials','statusCode':_0x1bdf0e[_0xb8e2('0xb2')]}:_0x1bdf0e);});};function createFieldObject(_0x129c13,_0x8f18b0,_0xe3974e,_0x5ea6a8,_0x5aaee1,_0x58f4c7){return new Promise(function(_0x1352a6,_0xe17e9e){var _0x3839b8={'id':_0x5ea6a8,'name':_0x5aaee1,'custom':_0x58f4c7};if(_0xe3974e===_0xb8e2('0xb3')){_0x3839b8[_0xb8e2('0x48')]=[{'name':_0xb8e2('0xb4'),'value':_0xb8e2('0xb5')},{'name':_0xb8e2('0xb6'),'value':'false'}];_0x1352a6(_0x3839b8);}else{var _0x3f2b36={'method':'GET','uri':_0x129c13+_0xb8e2('0xb7')+_0x5ea6a8,'auth':_0x8f18b0,'json':!![]};return rp(_0x3f2b36)['then'](function(_0x39b769){var _0x4f3a9b=[];if(_0x39b769['result'][_0xb8e2('0x47')]>0x0){_0x39b769[_0xb8e2('0xa0')][_0xb8e2('0xa4')](function(_0x588d1e){if(_0x588d1e[_0xb8e2('0xb8')]==='false'){var _0x140e58={'name':_0x588d1e[_0xb8e2('0xa6')],'value':_0x588d1e[_0xb8e2('0xb9')]};_0x4f3a9b[_0xb8e2('0xa7')](_0x140e58);}});}_0x3839b8[_0xb8e2('0x48')]=_0x4f3a9b;if(_0x3839b8[_0xb8e2('0x48')][_0xb8e2('0x47')]>0x0){_0x1352a6(_0x3839b8);}else{if(_0x58f4c7==![]){_0x1352a6();}else{_0x1352a6(_0x3839b8);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 86ab34e..6ffe801 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 _0xda19=['request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','util','../../config/logger','moment'];(function(_0x5219b,_0xcd63d8){var _0x342916=function(_0x6c2971){while(--_0x6c2971){_0x5219b['push'](_0x5219b['shift']());}};_0x342916(++_0xcd63d8);}(_0xda19,0xd5));var _0x9da1=function(_0x13d607,_0x12896d){_0x13d607=_0x13d607-0x0;var _0x2e81df=_0xda19[_0x13d607];return _0x2e81df;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));var integrations=require(_0x9da1('0x7'));module[_0x9da1('0x8')]=function(_0x2dcbc6,_0x23e4f7){return _0x2dcbc6[_0x9da1('0x9')](_0x9da1('0xa'),attributes,{'tableName':_0x9da1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util'];(function(_0x82f9e0,_0x5dd717){var _0x54828d=function(_0x174730){while(--_0x174730){_0x82f9e0['push'](_0x82f9e0['shift']());}};_0x54828d(++_0x5dd717);}(_0x814b,0x1a2));var _0xb814=function(_0x4ac48d,_0x171a68){_0x4ac48d=_0x4ac48d-0x0;var _0x7537af=_0x814b[_0x4ac48d];return _0x7537af;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));var integrations=require(_0xb814('0xa'));module[_0xb814('0xb')]=function(_0x53e507,_0x3b0829){return _0x53e507[_0xb814('0xc')]('ServicenowAccount',attributes,{'tableName':_0xb814('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 2bfea2f..0a2bca8 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 _0xfc5e=['model','map','then','ShowServicenowAccount','find','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetServicenowAccount','findAll','options','where','attributes','limit','include'];(function(_0x5ed5e4,_0x15d7fc){var _0xcc956a=function(_0x53130a){while(--_0x53130a){_0x5ed5e4['push'](_0x5ed5e4['shift']());}};_0xcc956a(++_0x15d7fc);}(_0xfc5e,0x186));var _0xefc5=function(_0x28e2f8,_0xac22cd){_0x28e2f8=_0x28e2f8-0x0;var _0xbd7542=_0xfc5e[_0x28e2f8];return _0xbd7542;};'use strict';var _=require(_0xefc5('0x0'));var util=require('util');var moment=require(_0xefc5('0x1'));var BPromise=require(_0xefc5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xefc5('0x3'));var db=require(_0xefc5('0x4'))['db'];var utils=require(_0xefc5('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xefc5('0x6'));var jayson=require(_0xefc5('0x7'));var client=jayson[_0xefc5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bc9ca,_0x53d65f,_0x48c4cc){return new BPromise(function(_0x38f11e,_0x181d38){return client[_0xefc5('0x9')](_0x1bc9ca,_0x48c4cc)['then'](function(_0x2d5092){logger[_0xefc5('0xa')](_0xefc5('0xb'),_0x53d65f,_0xefc5('0xc'));logger[_0xefc5('0xd')](_0xefc5('0xe'),_0x53d65f,_0xefc5('0xc'),JSON[_0xefc5('0xf')](_0x2d5092));if(_0x2d5092[_0xefc5('0x10')]){if(_0x2d5092[_0xefc5('0x10')]['code']===0x1f4){logger['error'](_0xefc5('0xb'),_0x53d65f,_0x2d5092[_0xefc5('0x10')][_0xefc5('0x11')]);return _0x181d38(_0x2d5092[_0xefc5('0x10')][_0xefc5('0x11')]);}logger[_0xefc5('0x10')](_0xefc5('0xb'),_0x53d65f,_0x2d5092[_0xefc5('0x10')][_0xefc5('0x11')]);return _0x38f11e(_0x2d5092[_0xefc5('0x10')][_0xefc5('0x11')]);}else{logger[_0xefc5('0xa')](_0xefc5('0xb'),_0x53d65f,_0xefc5('0xc'));_0x38f11e(_0x2d5092['result'][_0xefc5('0x11')]);}})[_0xefc5('0x12')](function(_0x3657e9){logger[_0xefc5('0x10')](_0xefc5('0xb'),_0x53d65f,_0x3657e9);_0x181d38(_0x3657e9);});});}exports[_0xefc5('0x13')]=function(_0x2e58f0){var _0x3d1c6e=this;return new Promise(function(_0x3b46f8,_0x247a2e){return db['ServicenowAccount'][_0xefc5('0x14')]({'raw':_0x2e58f0[_0xefc5('0x15')]?_0x2e58f0[_0xefc5('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2e58f0[_0xefc5('0x15')]?_0x2e58f0[_0xefc5('0x15')][_0xefc5('0x16')]||null:null,'attributes':_0x2e58f0[_0xefc5('0x15')]?_0x2e58f0[_0xefc5('0x15')][_0xefc5('0x17')]||null:null,'limit':_0x2e58f0['options']?_0x2e58f0[_0xefc5('0x15')][_0xefc5('0x18')]||null:null,'include':_0x2e58f0[_0xefc5('0x15')]?_0x2e58f0[_0xefc5('0x15')][_0xefc5('0x19')]?_['map'](_0x2e58f0[_0xefc5('0x15')][_0xefc5('0x19')],function(_0x3e7dd4){return{'model':db[_0x3e7dd4[_0xefc5('0x1a')]],'as':_0x3e7dd4['as'],'attributes':_0x3e7dd4[_0xefc5('0x17')],'include':_0x3e7dd4[_0xefc5('0x19')]?_[_0xefc5('0x1b')](_0x3e7dd4[_0xefc5('0x19')],function(_0x5bfc4f){return{'model':db[_0x5bfc4f['model']],'as':_0x5bfc4f['as'],'attributes':_0x5bfc4f['attributes'],'include':_0x5bfc4f[_0xefc5('0x19')]?_[_0xefc5('0x1b')](_0x5bfc4f['include'],function(_0x59893b){return{'model':db[_0x59893b['model']],'as':_0x59893b['as'],'attributes':_0x59893b['attributes']};}):[]};}):[]};}):[]:[]})[_0xefc5('0x1c')](function(_0x24e872){logger[_0xefc5('0xa')](_0xefc5('0x13'),_0x2e58f0);logger[_0xefc5('0xd')]('GetServicenowAccount',_0x2e58f0,JSON[_0xefc5('0xf')](_0x24e872));_0x3b46f8(_0x24e872);})['catch'](function(_0x51e8d2){logger[_0xefc5('0x10')]('GetServicenowAccount',_0x51e8d2[_0xefc5('0x11')],_0x2e58f0);_0x247a2e(_0x3d1c6e[_0xefc5('0x10')](0x1f4,_0x51e8d2['message']));});});};exports[_0xefc5('0x1d')]=function(_0x423c97){var _0x3956d2=this;return new Promise(function(_0x45b44f,_0x42e3ab){return db['ServicenowAccount'][_0xefc5('0x1e')]({'raw':_0x423c97[_0xefc5('0x15')]?_0x423c97[_0xefc5('0x15')][_0xefc5('0x1f')]===undefined?!![]:![]:!![],'where':_0x423c97[_0xefc5('0x15')]?_0x423c97['options'][_0xefc5('0x16')]||null:null,'attributes':_0x423c97['options']?_0x423c97[_0xefc5('0x15')]['attributes']||null:null,'include':_0x423c97[_0xefc5('0x15')]?_0x423c97[_0xefc5('0x15')][_0xefc5('0x19')]?_[_0xefc5('0x1b')](_0x423c97[_0xefc5('0x15')][_0xefc5('0x19')],function(_0x58388c){return{'model':db[_0x58388c[_0xefc5('0x1a')]],'as':_0x58388c['as'],'attributes':_0x58388c[_0xefc5('0x17')],'include':_0x58388c['include']?_['map'](_0x58388c[_0xefc5('0x19')],function(_0x133bcb){return{'model':db[_0x133bcb['model']],'as':_0x133bcb['as'],'attributes':_0x133bcb['attributes'],'include':_0x133bcb[_0xefc5('0x19')]?_[_0xefc5('0x1b')](_0x133bcb['include'],function(_0x4844ae){return{'model':db[_0x4844ae[_0xefc5('0x1a')]],'as':_0x4844ae['as'],'attributes':_0x4844ae[_0xefc5('0x17')]};}):[]};}):[]};}):[]:[]})[_0xefc5('0x1c')](function(_0x37bcee){logger[_0xefc5('0xa')](_0xefc5('0x1d'),_0x423c97);logger[_0xefc5('0xd')](_0xefc5('0x1d'),_0x423c97,JSON[_0xefc5('0xf')](_0x37bcee));_0x45b44f(_0x37bcee);})['catch'](function(_0x34bd91){logger[_0xefc5('0x10')]('ShowServicenowAccount',_0x34bd91['message'],_0x423c97);_0x42e3ab(_0x3956d2[_0xefc5('0x10')](0x1f4,_0x34bd91[_0xefc5('0x11')]));});});}; \ No newline at end of file +var _0x689a=['request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','map','include','model','debug','stringify','ShowServicenowAccount','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x2dbcef,_0x1cfecb){var _0x5a90ea=function(_0x189054){while(--_0x189054){_0x2dbcef['push'](_0x2dbcef['shift']());}};_0x5a90ea(++_0x1cfecb);}(_0x689a,0x16d));var _0xa689=function(_0x37bd0f,_0x9e2264){_0x37bd0f=_0x37bd0f-0x0;var _0x462f29=_0x689a[_0x37bd0f];return _0x462f29;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa689('0x0'));var BPromise=require(_0xa689('0x1'));var rs=require(_0xa689('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa689('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa689('0x4'))(_0xa689('0x5'));var config=require(_0xa689('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa689('0x7')][_0xa689('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a669d,_0x30e1f8,_0x4c2b0b){return new BPromise(function(_0x4cfda1,_0x216223){return client[_0xa689('0x9')](_0x4a669d,_0x4c2b0b)[_0xa689('0xa')](function(_0x35932e){logger['info'](_0xa689('0xb'),_0x30e1f8,_0xa689('0xc'));logger['debug'](_0xa689('0xd'),_0x30e1f8,'request\x20sent',JSON['stringify'](_0x35932e));if(_0x35932e[_0xa689('0xe')]){if(_0x35932e[_0xa689('0xe')][_0xa689('0xf')]===0x1f4){logger[_0xa689('0xe')](_0xa689('0xb'),_0x30e1f8,_0x35932e[_0xa689('0xe')]['message']);return _0x216223(_0x35932e['error']['message']);}logger[_0xa689('0xe')](_0xa689('0xb'),_0x30e1f8,_0x35932e['error'][_0xa689('0x10')]);return _0x4cfda1(_0x35932e[_0xa689('0xe')]['message']);}else{logger[_0xa689('0x11')](_0xa689('0xb'),_0x30e1f8,_0xa689('0xc'));_0x4cfda1(_0x35932e[_0xa689('0x12')][_0xa689('0x10')]);}})[_0xa689('0x13')](function(_0x38be05){logger[_0xa689('0xe')](_0xa689('0xb'),_0x30e1f8,_0x38be05);_0x216223(_0x38be05);});});}exports[_0xa689('0x14')]=function(_0x195ed7){var _0xe1b2c=this;return new Promise(function(_0x50e52b,_0x7ee2e6){return db[_0xa689('0x15')][_0xa689('0x16')]({'raw':_0x195ed7[_0xa689('0x17')]?_0x195ed7['options'][_0xa689('0x18')]===undefined?!![]:![]:!![],'where':_0x195ed7[_0xa689('0x17')]?_0x195ed7[_0xa689('0x17')][_0xa689('0x19')]||null:null,'attributes':_0x195ed7[_0xa689('0x17')]?_0x195ed7['options'][_0xa689('0x1a')]||null:null,'limit':_0x195ed7[_0xa689('0x17')]?_0x195ed7['options'][_0xa689('0x1b')]||null:null,'include':_0x195ed7[_0xa689('0x17')]?_0x195ed7[_0xa689('0x17')]['include']?_[_0xa689('0x1c')](_0x195ed7['options'][_0xa689('0x1d')],function(_0x759e35){return{'model':db[_0x759e35[_0xa689('0x1e')]],'as':_0x759e35['as'],'attributes':_0x759e35[_0xa689('0x1a')],'include':_0x759e35[_0xa689('0x1d')]?_['map'](_0x759e35[_0xa689('0x1d')],function(_0x498a43){return{'model':db[_0x498a43[_0xa689('0x1e')]],'as':_0x498a43['as'],'attributes':_0x498a43[_0xa689('0x1a')],'include':_0x498a43[_0xa689('0x1d')]?_[_0xa689('0x1c')](_0x498a43[_0xa689('0x1d')],function(_0x5d6bd7){return{'model':db[_0x5d6bd7['model']],'as':_0x5d6bd7['as'],'attributes':_0x5d6bd7[_0xa689('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa689('0xa')](function(_0x3f8d67){logger[_0xa689('0x11')](_0xa689('0x14'),_0x195ed7);logger[_0xa689('0x1f')](_0xa689('0x14'),_0x195ed7,JSON[_0xa689('0x20')](_0x3f8d67));_0x50e52b(_0x3f8d67);})[_0xa689('0x13')](function(_0x2fa591){logger[_0xa689('0xe')](_0xa689('0x14'),_0x2fa591[_0xa689('0x10')],_0x195ed7);_0x7ee2e6(_0xe1b2c[_0xa689('0xe')](0x1f4,_0x2fa591[_0xa689('0x10')]));});});};exports[_0xa689('0x21')]=function(_0x3fea34){var _0x2748b0=this;return new Promise(function(_0x4f8203,_0x1901d2){return db[_0xa689('0x15')]['find']({'raw':_0x3fea34[_0xa689('0x17')]?_0x3fea34['options']['raw']===undefined?!![]:![]:!![],'where':_0x3fea34[_0xa689('0x17')]?_0x3fea34[_0xa689('0x17')][_0xa689('0x19')]||null:null,'attributes':_0x3fea34[_0xa689('0x17')]?_0x3fea34[_0xa689('0x17')][_0xa689('0x1a')]||null:null,'include':_0x3fea34[_0xa689('0x17')]?_0x3fea34['options'][_0xa689('0x1d')]?_[_0xa689('0x1c')](_0x3fea34[_0xa689('0x17')]['include'],function(_0x339120){return{'model':db[_0x339120[_0xa689('0x1e')]],'as':_0x339120['as'],'attributes':_0x339120['attributes'],'include':_0x339120[_0xa689('0x1d')]?_[_0xa689('0x1c')](_0x339120[_0xa689('0x1d')],function(_0x16a4a4){return{'model':db[_0x16a4a4[_0xa689('0x1e')]],'as':_0x16a4a4['as'],'attributes':_0x16a4a4[_0xa689('0x1a')],'include':_0x16a4a4[_0xa689('0x1d')]?_['map'](_0x16a4a4[_0xa689('0x1d')],function(_0x44a3f8){return{'model':db[_0x44a3f8['model']],'as':_0x44a3f8['as'],'attributes':_0x44a3f8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fd145){logger[_0xa689('0x11')]('ShowServicenowAccount',_0x3fea34);logger[_0xa689('0x1f')](_0xa689('0x21'),_0x3fea34,JSON[_0xa689('0x20')](_0x2fd145));_0x4f8203(_0x2fd145);})['catch'](function(_0x4d78c4){logger['error']('ShowServicenowAccount',_0x4d78c4[_0xa689('0x10')],_0x3fea34);_0x1901d2(_0x2748b0['error'](0x1f4,_0x4d78c4['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 3371e0e..140ffdf 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 _0x13db=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x339c17,_0x25ff64){var _0x34b172=function(_0x111508){while(--_0x111508){_0x339c17['push'](_0x339c17['shift']());}};_0x34b172(++_0x25ff64);}(_0x13db,0x13e));var _0xb13d=function(_0x3e8144,_0x162f61){_0x3e8144=_0x3e8144-0x0;var _0x1154f7=_0x13db[_0x3e8144];return _0x1154f7;};'use strict';var multer=require(_0xb13d('0x0'));var util=require('util');var path=require(_0xb13d('0x1'));var timeout=require(_0xb13d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb13d('0x3'));var auth=require(_0xb13d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb13d('0x5'));var controller=require(_0xb13d('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb13d('0x7')](_0xb13d('0x8'),auth[_0xb13d('0x9')](),controller[_0xb13d('0xa')]);router[_0xb13d('0x7')](_0xb13d('0xb'),auth[_0xb13d('0x9')](),controller[_0xb13d('0xc')]);router[_0xb13d('0x7')](_0xb13d('0xd'),auth[_0xb13d('0x9')](),controller[_0xb13d('0xe')]);router['get'](_0xb13d('0xf'),auth[_0xb13d('0x9')](),controller[_0xb13d('0x10')]);router[_0xb13d('0x11')]('/',auth['isAuthenticated'](),controller[_0xb13d('0x12')]);router[_0xb13d('0x13')](_0xb13d('0x8'),auth[_0xb13d('0x9')](),controller[_0xb13d('0x14')]);router[_0xb13d('0x15')](_0xb13d('0x8'),auth[_0xb13d('0x9')](),controller[_0xb13d('0x16')]);module[_0xb13d('0x17')]=router; \ No newline at end of file +var _0x6b69=['Router','fs-extra','../../components/auth/service','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','update','destroy','exports','multer','util','path'];(function(_0x28afd4,_0x10ff46){var _0xce4a78=function(_0x2c0a2e){while(--_0x2c0a2e){_0x28afd4['push'](_0x28afd4['shift']());}};_0xce4a78(++_0x10ff46);}(_0x6b69,0x1e0));var _0x96b6=function(_0x1ff44d,_0x5ca0cc){_0x1ff44d=_0x1ff44d-0x0;var _0x24e958=_0x6b69[_0x1ff44d];return _0x24e958;};'use strict';var multer=require(_0x96b6('0x0'));var util=require(_0x96b6('0x1'));var path=require(_0x96b6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x96b6('0x3')]();var fs_extra=require(_0x96b6('0x4'));var auth=require(_0x96b6('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x96b6('0x6'));router[_0x96b6('0x7')]('/',auth[_0x96b6('0x8')](),controller['index']);router[_0x96b6('0x7')](_0x96b6('0x9'),auth[_0x96b6('0x8')](),controller[_0x96b6('0xa')]);router[_0x96b6('0x7')](_0x96b6('0xb'),auth[_0x96b6('0x8')](),controller[_0x96b6('0xc')]);router[_0x96b6('0x7')](_0x96b6('0xd'),auth['isAuthenticated'](),controller[_0x96b6('0xe')]);router['get'](_0x96b6('0xf'),auth[_0x96b6('0x8')](),controller[_0x96b6('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x96b6('0x11')](_0x96b6('0x9'),auth[_0x96b6('0x8')](),controller[_0x96b6('0x12')]);router['delete']('/:id',auth[_0x96b6('0x8')](),controller[_0x96b6('0x13')]);module[_0x96b6('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 2a9ea71..951a0e9 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 _0x2f23=['STRING','sequelize','exports'];(function(_0x180e99,_0xbbf32b){var _0x1045f5=function(_0x1af5af){while(--_0x1af5af){_0x180e99['push'](_0x180e99['shift']());}};_0x1045f5(++_0xbbf32b);}(_0x2f23,0x199));var _0x32f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f23[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x32f2('0x0'));module[_0x32f2('0x1')]={'name':{'type':Sequelize[_0x32f2('0x2')]},'description':{'type':Sequelize[_0x32f2('0x2')]}}; \ No newline at end of file +var _0xf040=['sequelize','exports','STRING'];(function(_0x4b6ece,_0x3234be){var _0x55c744=function(_0x13f068){while(--_0x13f068){_0x4b6ece['push'](_0x4b6ece['shift']());}};_0x55c744(++_0x3234be);}(_0xf040,0x1e6));var _0x0f04=function(_0x44c0c2,_0x29d866){_0x44c0c2=_0x44c0c2-0x0;var _0x5b2eb8=_0xf040[_0x44c0c2];return _0x5b2eb8;};'use strict';var Sequelize=require(_0x0f04('0x0'));module[_0x0f04('0x1')]={'name':{'type':Sequelize[_0x0f04('0x2')]},'description':{'type':Sequelize[_0x0f04('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 6598016..9e11406 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 _0xa7fa=['ServicenowConfiguration','findAll','catch','create','body','find','params','getFields','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','reject','update','then','destroy','error','index','map','rawAttributes','fieldName','type','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','include'];(function(_0x2a9197,_0x5225eb){var _0x588c8a=function(_0x4698ee){while(--_0x4698ee){_0x2a9197['push'](_0x2a9197['shift']());}};_0x588c8a(++_0x5225eb);}(_0xa7fa,0x18d));var _0xaa7f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa7fa[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xaa7f('0x0'));var rimraf=require(_0xaa7f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa7f('0x2'));var rp=require(_0xaa7f('0x3'));var moment=require(_0xaa7f('0x4'));var BPromise=require(_0xaa7f('0x5'));var Mustache=require(_0xaa7f('0x6'));var util=require(_0xaa7f('0x7'));var path=require('path');var sox=require(_0xaa7f('0x8'));var csv=require(_0xaa7f('0x9'));var ejs=require(_0xaa7f('0xa'));var fs=require('fs');var fs_extra=require(_0xaa7f('0xb'));var _=require('lodash');var squel=require(_0xaa7f('0xc'));var crypto=require(_0xaa7f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaa7f('0xe'));var toCsv=require(_0xaa7f('0x9'));var querystring=require(_0xaa7f('0xf'));var Papa=require(_0xaa7f('0x10'));var Redis=require('ioredis');var authService=require(_0xaa7f('0x11'));var qs=require(_0xaa7f('0x12'));var as=require(_0xaa7f('0x13'));var hardwareService=require(_0xaa7f('0x14'));var logger=require(_0xaa7f('0x15'))(_0xaa7f('0x16'));var utils=require(_0xaa7f('0x17'));var config=require(_0xaa7f('0x18'));var licenseUtil=require(_0xaa7f('0x19'));var db=require(_0xaa7f('0x1a'))['db'];function respondWithStatusCode(_0x599844,_0x50f8a5){_0x50f8a5=_0x50f8a5||0xcc;return function(_0x5390f5){if(_0x5390f5){return _0x599844[_0xaa7f('0x1b')](_0x50f8a5);}return _0x599844['status'](_0x50f8a5)[_0xaa7f('0x1c')]();};}function respondWithResult(_0x26a2b0,_0x33cd08){_0x33cd08=_0x33cd08||0xc8;return function(_0x354cf1){if(_0x354cf1){return _0x26a2b0[_0xaa7f('0x1d')](_0x33cd08)[_0xaa7f('0x1e')](_0x354cf1);}};}function respondWithFilteredResult(_0x3e22c8,_0x4a4a96){return function(_0x1e43bb){if(_0x1e43bb){var _0x275505=typeof _0x4a4a96[_0xaa7f('0x1f')]==='undefined'&&typeof _0x4a4a96[_0xaa7f('0x20')]==='undefined';var _0x384029=_0x1e43bb['count'];var _0x10aeed=_0x275505?0x0:_0x4a4a96[_0xaa7f('0x1f')];var _0x25e0e9=_0x275505?_0x1e43bb[_0xaa7f('0x21')]:_0x4a4a96[_0xaa7f('0x1f')]+_0x4a4a96[_0xaa7f('0x20')];var _0x355d96;if(_0x25e0e9>=_0x384029){_0x25e0e9=_0x384029;_0x355d96=0xc8;}else{_0x355d96=0xce;}_0x3e22c8[_0xaa7f('0x1d')](_0x355d96);return _0x3e22c8['set']('Content-Range',_0x10aeed+'-'+_0x25e0e9+'/'+_0x384029)[_0xaa7f('0x1e')](_0x1e43bb);}return null;};}function patchUpdates(_0xf8e960){return function(_0x3700c3){try{jsonpatch['apply'](_0x3700c3,_0xf8e960,!![]);}catch(_0x53b5d9){return BPromise[_0xaa7f('0x22')](_0x53b5d9);}return _0x3700c3['save']();};}function saveUpdates(_0x473b3e,_0xb3c06b){return function(_0x917d20){if(_0x917d20){return _0x917d20[_0xaa7f('0x23')](_0x473b3e)[_0xaa7f('0x24')](function(_0x5bb841){return _0x5bb841;});}return null;};}function removeEntity(_0xd57656,_0x3f90d9){return function(_0x4bb673){if(_0x4bb673){return _0x4bb673[_0xaa7f('0x25')]()[_0xaa7f('0x24')](function(){_0xd57656['status'](0xcc)[_0xaa7f('0x1c')]();});}};}function handleEntityNotFound(_0x5a7b5a,_0x2f3e64){return function(_0x13b680){if(!_0x13b680){_0x5a7b5a[_0xaa7f('0x1b')](0x194);}return _0x13b680;};}function handleError(_0x499922,_0x3531bd){_0x3531bd=_0x3531bd||0x1f4;return function(_0x3bb1bf){logger[_0xaa7f('0x26')](_0x3bb1bf['stack']);if(_0x3bb1bf['name']){delete _0x3bb1bf['name'];}_0x499922[_0xaa7f('0x1d')](_0x3531bd)['send'](_0x3bb1bf);};}exports[_0xaa7f('0x27')]=function(_0x35ee5b,_0x4bdabf){var _0x6827b8={},_0x15ded2={},_0x23ab30={'count':0x0,'rows':[]};var _0x419b0c=_[_0xaa7f('0x28')](db['ServicenowConfiguration'][_0xaa7f('0x29')],function(_0x37d785){return{'name':_0x37d785[_0xaa7f('0x2a')],'type':_0x37d785[_0xaa7f('0x2b')]['key']};});_0x15ded2[_0xaa7f('0x2c')]=_['map'](_0x419b0c,_0xaa7f('0x2d'));_0x15ded2['query']=_[_0xaa7f('0x2e')](_0x35ee5b[_0xaa7f('0x2f')]);_0x15ded2[_0xaa7f('0x30')]=_[_0xaa7f('0x31')](_0x15ded2[_0xaa7f('0x2c')],_0x15ded2[_0xaa7f('0x2f')]);_0x6827b8[_0xaa7f('0x32')]=_[_0xaa7f('0x31')](_0x15ded2[_0xaa7f('0x2c')],qs[_0xaa7f('0x33')](_0x35ee5b[_0xaa7f('0x2f')][_0xaa7f('0x33')]));_0x6827b8[_0xaa7f('0x32')]=_0x6827b8['attributes'][_0xaa7f('0x34')]?_0x6827b8[_0xaa7f('0x32')]:_0x15ded2[_0xaa7f('0x2c')];if(!_0x35ee5b[_0xaa7f('0x2f')][_0xaa7f('0x35')](_0xaa7f('0x36'))){_0x6827b8['limit']=qs[_0xaa7f('0x20')](_0x35ee5b[_0xaa7f('0x2f')][_0xaa7f('0x20')]);_0x6827b8['offset']=qs['offset'](_0x35ee5b['query'][_0xaa7f('0x1f')]);}_0x6827b8[_0xaa7f('0x37')]=qs[_0xaa7f('0x38')](_0x35ee5b[_0xaa7f('0x2f')][_0xaa7f('0x38')]);_0x6827b8['where']=qs[_0xaa7f('0x30')](_[_0xaa7f('0x39')](_0x35ee5b['query'],_0x15ded2[_0xaa7f('0x30')]),_0x419b0c);if(_0x35ee5b['query'][_0xaa7f('0x3a')]){_0x6827b8['where']=_[_0xaa7f('0x3b')](_0x6827b8['where'],{'$or':_[_0xaa7f('0x28')](_0x419b0c,function(_0x27d936){if(_0x27d936[_0xaa7f('0x2b')]!==_0xaa7f('0x3c')){var _0x2c11ae={};_0x2c11ae[_0x27d936[_0xaa7f('0x2d')]]={'$like':'%'+_0x35ee5b[_0xaa7f('0x2f')][_0xaa7f('0x3a')]+'%'};return _0x2c11ae;}})});}_0x6827b8=_[_0xaa7f('0x3b')]({},_0x6827b8,_0x35ee5b[_0xaa7f('0x3d')]);var _0xcc9922={'where':_0x6827b8[_0xaa7f('0x3e')]};return db['ServicenowConfiguration']['count'](_0xcc9922)[_0xaa7f('0x24')](function(_0xb358c3){_0x23ab30[_0xaa7f('0x21')]=_0xb358c3;if(_0x35ee5b[_0xaa7f('0x2f')][_0xaa7f('0x3f')]){_0x6827b8[_0xaa7f('0x40')]=[{'all':!![]}];}return db[_0xaa7f('0x41')][_0xaa7f('0x42')](_0x6827b8);})[_0xaa7f('0x24')](function(_0xe1167f){_0x23ab30['rows']=_0xe1167f;return _0x23ab30;})[_0xaa7f('0x24')](respondWithFilteredResult(_0x4bdabf,_0x6827b8))['catch'](handleError(_0x4bdabf,null));};exports['show']=function(_0x10bd25,_0x4efe30){var _0x1e53ac={'raw':![],'where':{'id':_0x10bd25['params']['id']}},_0x4761d8={};_0x4761d8[_0xaa7f('0x2c')]=_['keys'](db[_0xaa7f('0x41')][_0xaa7f('0x29')]);_0x4761d8[_0xaa7f('0x2f')]=_[_0xaa7f('0x2e')](_0x10bd25[_0xaa7f('0x2f')]);_0x4761d8[_0xaa7f('0x30')]=_['intersection'](_0x4761d8['model'],_0x4761d8['query']);_0x1e53ac[_0xaa7f('0x32')]=_[_0xaa7f('0x31')](_0x4761d8['model'],qs[_0xaa7f('0x33')](_0x10bd25[_0xaa7f('0x2f')][_0xaa7f('0x33')]));_0x1e53ac[_0xaa7f('0x32')]=_0x1e53ac[_0xaa7f('0x32')][_0xaa7f('0x34')]?_0x1e53ac['attributes']:_0x4761d8[_0xaa7f('0x2c')];if(_0x10bd25[_0xaa7f('0x2f')][_0xaa7f('0x3f')]){_0x1e53ac['include']=[{'all':!![]}];}_0x1e53ac=_[_0xaa7f('0x3b')]({},_0x1e53ac,_0x10bd25['options']);return db[_0xaa7f('0x41')]['find'](_0x1e53ac)[_0xaa7f('0x24')](handleEntityNotFound(_0x4efe30,null))[_0xaa7f('0x24')](respondWithResult(_0x4efe30,null))[_0xaa7f('0x43')](handleError(_0x4efe30,null));};exports[_0xaa7f('0x44')]=function(_0x276de4,_0x2449a9){return db[_0xaa7f('0x41')][_0xaa7f('0x44')](_0x276de4[_0xaa7f('0x45')],{})[_0xaa7f('0x24')](respondWithResult(_0x2449a9,0xc9))[_0xaa7f('0x43')](handleError(_0x2449a9,null));};exports[_0xaa7f('0x23')]=function(_0x30107e,_0x1375fa){if(_0x30107e[_0xaa7f('0x45')]['id']){delete _0x30107e[_0xaa7f('0x45')]['id'];}return db[_0xaa7f('0x41')][_0xaa7f('0x46')]({'where':{'id':_0x30107e[_0xaa7f('0x47')]['id']}})[_0xaa7f('0x24')](handleEntityNotFound(_0x1375fa,null))[_0xaa7f('0x24')](saveUpdates(_0x30107e[_0xaa7f('0x45')],null))[_0xaa7f('0x24')](respondWithResult(_0x1375fa,null))['catch'](handleError(_0x1375fa,null));};exports[_0xaa7f('0x25')]=function(_0x1e6003,_0x40aa66){return db['ServicenowConfiguration'][_0xaa7f('0x46')]({'where':{'id':_0x1e6003['params']['id']}})[_0xaa7f('0x24')](handleEntityNotFound(_0x40aa66,null))[_0xaa7f('0x24')](removeEntity(_0x40aa66,null))[_0xaa7f('0x43')](handleError(_0x40aa66,null));};exports[_0xaa7f('0x48')]=function(_0x5bb5b5,_0xfa4d33,_0x3e31ac){var _0x37a87a={};var _0x23a2cd={};var _0x349e0d;var _0x3a3ca4;return db[_0xaa7f('0x41')][_0xaa7f('0x49')]({'where':{'id':_0x5bb5b5[_0xaa7f('0x47')]['id']}})['then'](handleEntityNotFound(_0xfa4d33,null))[_0xaa7f('0x24')](function(_0x41d662){if(_0x41d662){_0x349e0d=_0x41d662;_0x23a2cd[_0xaa7f('0x2c')]=_[_0xaa7f('0x2e')](db[_0xaa7f('0x4a')][_0xaa7f('0x29')]);_0x23a2cd['query']=_[_0xaa7f('0x2e')](_0x5bb5b5[_0xaa7f('0x2f')]);_0x23a2cd[_0xaa7f('0x30')]=_[_0xaa7f('0x31')](_0x23a2cd[_0xaa7f('0x2c')],_0x23a2cd[_0xaa7f('0x2f')]);_0x37a87a[_0xaa7f('0x32')]=_[_0xaa7f('0x31')](_0x23a2cd['model'],qs[_0xaa7f('0x33')](_0x5bb5b5[_0xaa7f('0x2f')]['fields']));_0x37a87a[_0xaa7f('0x32')]=_0x37a87a[_0xaa7f('0x32')][_0xaa7f('0x34')]?_0x37a87a['attributes']:_0x23a2cd[_0xaa7f('0x2c')];_0x37a87a[_0xaa7f('0x37')]=qs[_0xaa7f('0x38')](_0x5bb5b5[_0xaa7f('0x2f')][_0xaa7f('0x38')]);_0x37a87a['where']=qs['filters'](_[_0xaa7f('0x39')](_0x5bb5b5[_0xaa7f('0x2f')],_0x23a2cd[_0xaa7f('0x30')]));if(_0x5bb5b5[_0xaa7f('0x2f')][_0xaa7f('0x3a')]){_0x37a87a[_0xaa7f('0x3e')]=_[_0xaa7f('0x3b')](_0x37a87a['where'],{'$or':_[_0xaa7f('0x28')](_0x37a87a[_0xaa7f('0x32')],function(_0x3eb1e1){var _0x337687={};_0x337687[_0x3eb1e1]={'$like':'%'+_0x5bb5b5['query'][_0xaa7f('0x3a')]+'%'};return _0x337687;})});}_0x37a87a=_[_0xaa7f('0x3b')]({},_0x37a87a,_0x5bb5b5[_0xaa7f('0x3d')]);return _0x349e0d['getFields'](_0x37a87a);}})[_0xaa7f('0x24')](function(_0x2840a8){if(_0x2840a8){_0x3a3ca4=_0x2840a8[_0xaa7f('0x34')];if(!_0x5bb5b5[_0xaa7f('0x2f')][_0xaa7f('0x35')]('nolimit')){_0x37a87a[_0xaa7f('0x20')]=qs[_0xaa7f('0x20')](_0x5bb5b5[_0xaa7f('0x2f')][_0xaa7f('0x20')]);_0x37a87a[_0xaa7f('0x1f')]=qs[_0xaa7f('0x1f')](_0x5bb5b5['query'][_0xaa7f('0x1f')]);}return _0x349e0d['getFields'](_0x37a87a);}})[_0xaa7f('0x24')](function(_0x12494b){if(_0x12494b){return _0x12494b?{'count':_0x3a3ca4,'rows':_0x12494b}:null;}})[_0xaa7f('0x24')](respondWithResult(_0xfa4d33,null))[_0xaa7f('0x43')](handleError(_0xfa4d33,null));};exports[_0xaa7f('0x4b')]=function(_0x55e40d,_0xab0bce,_0x204595){var _0x1a7457={};var _0x3db6c4={};var _0x780f53;var _0x19b022;return db[_0xaa7f('0x41')]['findOne']({'where':{'id':_0x55e40d[_0xaa7f('0x47')]['id']}})[_0xaa7f('0x24')](handleEntityNotFound(_0xab0bce,null))[_0xaa7f('0x24')](function(_0xffaa5d){if(_0xffaa5d){_0x780f53=_0xffaa5d;_0x3db6c4[_0xaa7f('0x2c')]=_['keys'](db[_0xaa7f('0x4a')][_0xaa7f('0x29')]);_0x3db6c4[_0xaa7f('0x2f')]=_[_0xaa7f('0x2e')](_0x55e40d[_0xaa7f('0x2f')]);_0x3db6c4[_0xaa7f('0x30')]=_[_0xaa7f('0x31')](_0x3db6c4[_0xaa7f('0x2c')],_0x3db6c4[_0xaa7f('0x2f')]);_0x1a7457[_0xaa7f('0x32')]=_[_0xaa7f('0x31')](_0x3db6c4[_0xaa7f('0x2c')],qs[_0xaa7f('0x33')](_0x55e40d[_0xaa7f('0x2f')][_0xaa7f('0x33')]));_0x1a7457[_0xaa7f('0x32')]=_0x1a7457[_0xaa7f('0x32')]['length']?_0x1a7457[_0xaa7f('0x32')]:_0x3db6c4[_0xaa7f('0x2c')];_0x1a7457[_0xaa7f('0x37')]=qs[_0xaa7f('0x38')](_0x55e40d[_0xaa7f('0x2f')][_0xaa7f('0x38')]);_0x1a7457[_0xaa7f('0x3e')]=qs[_0xaa7f('0x30')](_[_0xaa7f('0x39')](_0x55e40d['query'],_0x3db6c4['filters']));if(_0x55e40d['query']['filter']){_0x1a7457[_0xaa7f('0x3e')]=_[_0xaa7f('0x3b')](_0x1a7457[_0xaa7f('0x3e')],{'$or':_[_0xaa7f('0x28')](_0x1a7457['attributes'],function(_0x43c35d){var _0x17abeb={};_0x17abeb[_0x43c35d]={'$like':'%'+_0x55e40d[_0xaa7f('0x2f')]['filter']+'%'};return _0x17abeb;})});}_0x1a7457=_[_0xaa7f('0x3b')]({},_0x1a7457,_0x55e40d[_0xaa7f('0x3d')]);return _0x780f53[_0xaa7f('0x4b')](_0x1a7457);}})['then'](function(_0x3e6f60){if(_0x3e6f60){_0x19b022=_0x3e6f60[_0xaa7f('0x34')];if(!_0x55e40d[_0xaa7f('0x2f')][_0xaa7f('0x35')]('nolimit')){_0x1a7457[_0xaa7f('0x20')]=qs[_0xaa7f('0x20')](_0x55e40d['query'][_0xaa7f('0x20')]);_0x1a7457[_0xaa7f('0x1f')]=qs[_0xaa7f('0x1f')](_0x55e40d['query']['offset']);}return _0x780f53[_0xaa7f('0x4b')](_0x1a7457);}})[_0xaa7f('0x24')](function(_0x2df436){if(_0x2df436){return _0x2df436?{'count':_0x19b022,'rows':_0x2df436}:null;}})[_0xaa7f('0x24')](respondWithResult(_0xab0bce,null))['catch'](handleError(_0xab0bce,null));};exports[_0xaa7f('0x4c')]=function(_0x773862,_0x427fc2,_0x95d93){var _0x27bb28={};var _0x328627={};var _0x45b154;var _0xec54ac;return db[_0xaa7f('0x41')][_0xaa7f('0x49')]({'where':{'id':_0x773862[_0xaa7f('0x47')]['id']}})[_0xaa7f('0x24')](handleEntityNotFound(_0x427fc2,null))[_0xaa7f('0x24')](function(_0x1ba2a9){if(_0x1ba2a9){_0x45b154=_0x1ba2a9;_0x328627['model']=_['keys'](db['ServicenowField'][_0xaa7f('0x29')]);_0x328627[_0xaa7f('0x2f')]=_[_0xaa7f('0x2e')](_0x773862[_0xaa7f('0x2f')]);_0x328627[_0xaa7f('0x30')]=_['intersection'](_0x328627[_0xaa7f('0x2c')],_0x328627[_0xaa7f('0x2f')]);_0x27bb28[_0xaa7f('0x32')]=_[_0xaa7f('0x31')](_0x328627[_0xaa7f('0x2c')],qs[_0xaa7f('0x33')](_0x773862['query'][_0xaa7f('0x33')]));_0x27bb28[_0xaa7f('0x32')]=_0x27bb28[_0xaa7f('0x32')][_0xaa7f('0x34')]?_0x27bb28[_0xaa7f('0x32')]:_0x328627[_0xaa7f('0x2c')];_0x27bb28[_0xaa7f('0x37')]=qs['sort'](_0x773862[_0xaa7f('0x2f')][_0xaa7f('0x38')]);_0x27bb28['where']=qs[_0xaa7f('0x30')](_[_0xaa7f('0x39')](_0x773862[_0xaa7f('0x2f')],_0x328627['filters']));if(_0x773862[_0xaa7f('0x2f')]['filter']){_0x27bb28[_0xaa7f('0x3e')]=_[_0xaa7f('0x3b')](_0x27bb28[_0xaa7f('0x3e')],{'$or':_[_0xaa7f('0x28')](_0x27bb28[_0xaa7f('0x32')],function(_0x312e23){var _0x454c4e={};_0x454c4e[_0x312e23]={'$like':'%'+_0x773862['query'][_0xaa7f('0x3a')]+'%'};return _0x454c4e;})});}_0x27bb28=_['merge']({},_0x27bb28,_0x773862[_0xaa7f('0x3d')]);return _0x45b154['getDescriptions'](_0x27bb28);}})[_0xaa7f('0x24')](function(_0x521bd2){if(_0x521bd2){_0xec54ac=_0x521bd2['length'];if(!_0x773862['query'][_0xaa7f('0x35')](_0xaa7f('0x36'))){_0x27bb28['limit']=qs[_0xaa7f('0x20')](_0x773862[_0xaa7f('0x2f')][_0xaa7f('0x20')]);_0x27bb28[_0xaa7f('0x1f')]=qs[_0xaa7f('0x1f')](_0x773862[_0xaa7f('0x2f')][_0xaa7f('0x1f')]);}return _0x45b154[_0xaa7f('0x4c')](_0x27bb28);}})[_0xaa7f('0x24')](function(_0x238c05){if(_0x238c05){return _0x238c05?{'count':_0xec54ac,'rows':_0x238c05}:null;}})[_0xaa7f('0x24')](respondWithResult(_0x427fc2,null))[_0xaa7f('0x43')](handleError(_0x427fc2,null));}; \ No newline at end of file +var _0xb861=['destroy','stack','name','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','catch','show','intersection','fields','create','body','params','getFields','ServicenowField','getSubjects','findOne','pick','nolimit','getDescriptions','eml-format','zip-dir','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','update'];(function(_0x27d96,_0x5e4e9f){var _0x123742=function(_0x382582){while(--_0x382582){_0x27d96['push'](_0x27d96['shift']());}};_0x123742(++_0x5e4e9f);}(_0xb861,0xc7));var _0x1b86=function(_0x145e9e,_0x2e6dd4){_0x145e9e=_0x145e9e-0x0;var _0x2264c2=_0xb861[_0x145e9e];return _0x2264c2;};'use strict';var emlformat=require(_0x1b86('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b86('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b86('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1b86('0x3'));var util=require('util');var path=require(_0x1b86('0x4'));var sox=require(_0x1b86('0x5'));var csv=require('to-csv');var ejs=require(_0x1b86('0x6'));var fs=require('fs');var fs_extra=require(_0x1b86('0x7'));var _=require(_0x1b86('0x8'));var squel=require(_0x1b86('0x9'));var crypto=require(_0x1b86('0xa'));var jsforce=require(_0x1b86('0xb'));var deskjs=require(_0x1b86('0xc'));var toCsv=require(_0x1b86('0xd'));var querystring=require('querystring');var Papa=require(_0x1b86('0xe'));var Redis=require(_0x1b86('0xf'));var authService=require(_0x1b86('0x10'));var qs=require(_0x1b86('0x11'));var as=require(_0x1b86('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1b86('0x13'));var utils=require(_0x1b86('0x14'));var config=require(_0x1b86('0x15'));var licenseUtil=require(_0x1b86('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4039a4,_0x1dcb72){_0x1dcb72=_0x1dcb72||0xcc;return function(_0x344377){if(_0x344377){return _0x4039a4[_0x1b86('0x17')](_0x1dcb72);}return _0x4039a4['status'](_0x1dcb72)[_0x1b86('0x18')]();};}function respondWithResult(_0xce622b,_0x4e88b5){_0x4e88b5=_0x4e88b5||0xc8;return function(_0xc8437){if(_0xc8437){return _0xce622b['status'](_0x4e88b5)[_0x1b86('0x19')](_0xc8437);}};}function respondWithFilteredResult(_0x2c773a,_0x3766a2){return function(_0x341497){if(_0x341497){var _0x49e128=typeof _0x3766a2[_0x1b86('0x1a')]===_0x1b86('0x1b')&&typeof _0x3766a2[_0x1b86('0x1c')]===_0x1b86('0x1b');var _0x79154=_0x341497[_0x1b86('0x1d')];var _0x3d3f1b=_0x49e128?0x0:_0x3766a2[_0x1b86('0x1a')];var _0x31c6d7=_0x49e128?_0x341497[_0x1b86('0x1d')]:_0x3766a2[_0x1b86('0x1a')]+_0x3766a2['limit'];var _0x4a8750;if(_0x31c6d7>=_0x79154){_0x31c6d7=_0x79154;_0x4a8750=0xc8;}else{_0x4a8750=0xce;}_0x2c773a[_0x1b86('0x1e')](_0x4a8750);return _0x2c773a['set'](_0x1b86('0x1f'),_0x3d3f1b+'-'+_0x31c6d7+'/'+_0x79154)['json'](_0x341497);}return null;};}function patchUpdates(_0x242269){return function(_0x2e628b){try{jsonpatch[_0x1b86('0x20')](_0x2e628b,_0x242269,!![]);}catch(_0x324003){return BPromise[_0x1b86('0x21')](_0x324003);}return _0x2e628b['save']();};}function saveUpdates(_0x3bfa91,_0x3cad30){return function(_0x53fb66){if(_0x53fb66){return _0x53fb66[_0x1b86('0x22')](_0x3bfa91)['then'](function(_0xf51208){return _0xf51208;});}return null;};}function removeEntity(_0x1e0dbf,_0x23a30e){return function(_0xd0a830){if(_0xd0a830){return _0xd0a830[_0x1b86('0x23')]()['then'](function(){_0x1e0dbf[_0x1b86('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6023e3,_0x3051cb){return function(_0x5e765b){if(!_0x5e765b){_0x6023e3[_0x1b86('0x17')](0x194);}return _0x5e765b;};}function handleError(_0x56ed9c,_0x475e05){_0x475e05=_0x475e05||0x1f4;return function(_0x25ee84){logger['error'](_0x25ee84[_0x1b86('0x24')]);if(_0x25ee84[_0x1b86('0x25')]){delete _0x25ee84[_0x1b86('0x25')];}_0x56ed9c[_0x1b86('0x1e')](_0x475e05)['send'](_0x25ee84);};}exports[_0x1b86('0x26')]=function(_0x228931,_0x439e60){var _0x508239={},_0xf047a4={},_0x41a223={'count':0x0,'rows':[]};var _0x28d497=_[_0x1b86('0x27')](db[_0x1b86('0x28')][_0x1b86('0x29')],function(_0x2a3e2e){return{'name':_0x2a3e2e[_0x1b86('0x2a')],'type':_0x2a3e2e[_0x1b86('0x2b')][_0x1b86('0x2c')]};});_0xf047a4[_0x1b86('0x2d')]=_[_0x1b86('0x27')](_0x28d497,_0x1b86('0x25'));_0xf047a4['query']=_[_0x1b86('0x2e')](_0x228931[_0x1b86('0x2f')]);_0xf047a4[_0x1b86('0x30')]=_['intersection'](_0xf047a4[_0x1b86('0x2d')],_0xf047a4['query']);_0x508239[_0x1b86('0x31')]=_['intersection'](_0xf047a4['model'],qs['fields'](_0x228931['query']['fields']));_0x508239[_0x1b86('0x31')]=_0x508239['attributes'][_0x1b86('0x32')]?_0x508239[_0x1b86('0x31')]:_0xf047a4[_0x1b86('0x2d')];if(!_0x228931[_0x1b86('0x2f')][_0x1b86('0x33')]('nolimit')){_0x508239[_0x1b86('0x1c')]=qs['limit'](_0x228931[_0x1b86('0x2f')][_0x1b86('0x1c')]);_0x508239[_0x1b86('0x1a')]=qs['offset'](_0x228931['query'][_0x1b86('0x1a')]);}_0x508239[_0x1b86('0x34')]=qs[_0x1b86('0x35')](_0x228931[_0x1b86('0x2f')][_0x1b86('0x35')]);_0x508239[_0x1b86('0x36')]=qs['filters'](_['pick'](_0x228931[_0x1b86('0x2f')],_0xf047a4['filters']),_0x28d497);if(_0x228931[_0x1b86('0x2f')]['filter']){_0x508239[_0x1b86('0x36')]=_[_0x1b86('0x37')](_0x508239[_0x1b86('0x36')],{'$or':_[_0x1b86('0x27')](_0x28d497,function(_0x5361bc){if(_0x5361bc['type']!==_0x1b86('0x38')){var _0x78c4eb={};_0x78c4eb[_0x5361bc[_0x1b86('0x25')]]={'$like':'%'+_0x228931[_0x1b86('0x2f')][_0x1b86('0x39')]+'%'};return _0x78c4eb;}})});}_0x508239=_['merge']({},_0x508239,_0x228931[_0x1b86('0x3a')]);var _0x526f31={'where':_0x508239[_0x1b86('0x36')]};return db['ServicenowConfiguration'][_0x1b86('0x1d')](_0x526f31)[_0x1b86('0x3b')](function(_0x1b78ce){_0x41a223['count']=_0x1b78ce;if(_0x228931[_0x1b86('0x2f')][_0x1b86('0x3c')]){_0x508239[_0x1b86('0x3d')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x1b86('0x3e')](_0x508239);})[_0x1b86('0x3b')](function(_0x151d9d){_0x41a223[_0x1b86('0x3f')]=_0x151d9d;return _0x41a223;})[_0x1b86('0x3b')](respondWithFilteredResult(_0x439e60,_0x508239))[_0x1b86('0x40')](handleError(_0x439e60,null));};exports[_0x1b86('0x41')]=function(_0x49828a,_0x31de27){var _0x575679={'raw':![],'where':{'id':_0x49828a['params']['id']}},_0x597587={};_0x597587['model']=_[_0x1b86('0x2e')](db[_0x1b86('0x28')]['rawAttributes']);_0x597587['query']=_[_0x1b86('0x2e')](_0x49828a[_0x1b86('0x2f')]);_0x597587['filters']=_[_0x1b86('0x42')](_0x597587[_0x1b86('0x2d')],_0x597587[_0x1b86('0x2f')]);_0x575679[_0x1b86('0x31')]=_[_0x1b86('0x42')](_0x597587[_0x1b86('0x2d')],qs[_0x1b86('0x43')](_0x49828a['query'][_0x1b86('0x43')]));_0x575679['attributes']=_0x575679['attributes'][_0x1b86('0x32')]?_0x575679[_0x1b86('0x31')]:_0x597587[_0x1b86('0x2d')];if(_0x49828a[_0x1b86('0x2f')][_0x1b86('0x3c')]){_0x575679[_0x1b86('0x3d')]=[{'all':!![]}];}_0x575679=_[_0x1b86('0x37')]({},_0x575679,_0x49828a[_0x1b86('0x3a')]);return db['ServicenowConfiguration']['find'](_0x575679)['then'](handleEntityNotFound(_0x31de27,null))[_0x1b86('0x3b')](respondWithResult(_0x31de27,null))[_0x1b86('0x40')](handleError(_0x31de27,null));};exports[_0x1b86('0x44')]=function(_0x4e183a,_0x275bd5){return db[_0x1b86('0x28')][_0x1b86('0x44')](_0x4e183a['body'],{})['then'](respondWithResult(_0x275bd5,0xc9))[_0x1b86('0x40')](handleError(_0x275bd5,null));};exports[_0x1b86('0x22')]=function(_0x384db5,_0xe6124a){if(_0x384db5[_0x1b86('0x45')]['id']){delete _0x384db5[_0x1b86('0x45')]['id'];}return db[_0x1b86('0x28')]['find']({'where':{'id':_0x384db5[_0x1b86('0x46')]['id']}})[_0x1b86('0x3b')](handleEntityNotFound(_0xe6124a,null))[_0x1b86('0x3b')](saveUpdates(_0x384db5[_0x1b86('0x45')],null))[_0x1b86('0x3b')](respondWithResult(_0xe6124a,null))[_0x1b86('0x40')](handleError(_0xe6124a,null));};exports[_0x1b86('0x23')]=function(_0x4a9dd8,_0x18f14d){return db[_0x1b86('0x28')]['find']({'where':{'id':_0x4a9dd8[_0x1b86('0x46')]['id']}})['then'](handleEntityNotFound(_0x18f14d,null))[_0x1b86('0x3b')](removeEntity(_0x18f14d,null))[_0x1b86('0x40')](handleError(_0x18f14d,null));};exports[_0x1b86('0x47')]=function(_0xc2a0b9,_0xecb8d5,_0x217903){var _0xca502a={};var _0x4e5282={};var _0x554244;var _0x274a4d;return db[_0x1b86('0x28')]['findOne']({'where':{'id':_0xc2a0b9['params']['id']}})[_0x1b86('0x3b')](handleEntityNotFound(_0xecb8d5,null))[_0x1b86('0x3b')](function(_0x3a365e){if(_0x3a365e){_0x554244=_0x3a365e;_0x4e5282[_0x1b86('0x2d')]=_[_0x1b86('0x2e')](db[_0x1b86('0x48')][_0x1b86('0x29')]);_0x4e5282[_0x1b86('0x2f')]=_[_0x1b86('0x2e')](_0xc2a0b9['query']);_0x4e5282['filters']=_[_0x1b86('0x42')](_0x4e5282[_0x1b86('0x2d')],_0x4e5282[_0x1b86('0x2f')]);_0xca502a[_0x1b86('0x31')]=_[_0x1b86('0x42')](_0x4e5282[_0x1b86('0x2d')],qs[_0x1b86('0x43')](_0xc2a0b9[_0x1b86('0x2f')]['fields']));_0xca502a[_0x1b86('0x31')]=_0xca502a[_0x1b86('0x31')][_0x1b86('0x32')]?_0xca502a[_0x1b86('0x31')]:_0x4e5282[_0x1b86('0x2d')];_0xca502a[_0x1b86('0x34')]=qs[_0x1b86('0x35')](_0xc2a0b9['query'][_0x1b86('0x35')]);_0xca502a[_0x1b86('0x36')]=qs[_0x1b86('0x30')](_['pick'](_0xc2a0b9[_0x1b86('0x2f')],_0x4e5282['filters']));if(_0xc2a0b9[_0x1b86('0x2f')][_0x1b86('0x39')]){_0xca502a[_0x1b86('0x36')]=_[_0x1b86('0x37')](_0xca502a[_0x1b86('0x36')],{'$or':_[_0x1b86('0x27')](_0xca502a[_0x1b86('0x31')],function(_0x4983bc){var _0x560871={};_0x560871[_0x4983bc]={'$like':'%'+_0xc2a0b9[_0x1b86('0x2f')][_0x1b86('0x39')]+'%'};return _0x560871;})});}_0xca502a=_[_0x1b86('0x37')]({},_0xca502a,_0xc2a0b9['options']);return _0x554244['getFields'](_0xca502a);}})[_0x1b86('0x3b')](function(_0x274944){if(_0x274944){_0x274a4d=_0x274944[_0x1b86('0x32')];if(!_0xc2a0b9['query']['hasOwnProperty']('nolimit')){_0xca502a[_0x1b86('0x1c')]=qs[_0x1b86('0x1c')](_0xc2a0b9['query']['limit']);_0xca502a['offset']=qs[_0x1b86('0x1a')](_0xc2a0b9[_0x1b86('0x2f')][_0x1b86('0x1a')]);}return _0x554244[_0x1b86('0x47')](_0xca502a);}})[_0x1b86('0x3b')](function(_0x29bcd8){if(_0x29bcd8){return _0x29bcd8?{'count':_0x274a4d,'rows':_0x29bcd8}:null;}})['then'](respondWithResult(_0xecb8d5,null))['catch'](handleError(_0xecb8d5,null));};exports[_0x1b86('0x49')]=function(_0x36abf3,_0x444b68,_0x5474c5){var _0xea4989={};var _0x33a575={};var _0x13d1bc;var _0x593c42;return db[_0x1b86('0x28')][_0x1b86('0x4a')]({'where':{'id':_0x36abf3[_0x1b86('0x46')]['id']}})[_0x1b86('0x3b')](handleEntityNotFound(_0x444b68,null))[_0x1b86('0x3b')](function(_0x260e3d){if(_0x260e3d){_0x13d1bc=_0x260e3d;_0x33a575[_0x1b86('0x2d')]=_[_0x1b86('0x2e')](db[_0x1b86('0x48')][_0x1b86('0x29')]);_0x33a575['query']=_[_0x1b86('0x2e')](_0x36abf3[_0x1b86('0x2f')]);_0x33a575[_0x1b86('0x30')]=_['intersection'](_0x33a575[_0x1b86('0x2d')],_0x33a575['query']);_0xea4989['attributes']=_[_0x1b86('0x42')](_0x33a575[_0x1b86('0x2d')],qs['fields'](_0x36abf3[_0x1b86('0x2f')][_0x1b86('0x43')]));_0xea4989[_0x1b86('0x31')]=_0xea4989[_0x1b86('0x31')][_0x1b86('0x32')]?_0xea4989[_0x1b86('0x31')]:_0x33a575[_0x1b86('0x2d')];_0xea4989[_0x1b86('0x34')]=qs[_0x1b86('0x35')](_0x36abf3[_0x1b86('0x2f')][_0x1b86('0x35')]);_0xea4989['where']=qs[_0x1b86('0x30')](_[_0x1b86('0x4b')](_0x36abf3[_0x1b86('0x2f')],_0x33a575[_0x1b86('0x30')]));if(_0x36abf3['query']['filter']){_0xea4989['where']=_[_0x1b86('0x37')](_0xea4989[_0x1b86('0x36')],{'$or':_[_0x1b86('0x27')](_0xea4989['attributes'],function(_0x298168){var _0x61b942={};_0x61b942[_0x298168]={'$like':'%'+_0x36abf3[_0x1b86('0x2f')][_0x1b86('0x39')]+'%'};return _0x61b942;})});}_0xea4989=_[_0x1b86('0x37')]({},_0xea4989,_0x36abf3[_0x1b86('0x3a')]);return _0x13d1bc['getSubjects'](_0xea4989);}})[_0x1b86('0x3b')](function(_0x4f0f54){if(_0x4f0f54){_0x593c42=_0x4f0f54[_0x1b86('0x32')];if(!_0x36abf3['query']['hasOwnProperty'](_0x1b86('0x4c'))){_0xea4989['limit']=qs['limit'](_0x36abf3[_0x1b86('0x2f')][_0x1b86('0x1c')]);_0xea4989[_0x1b86('0x1a')]=qs[_0x1b86('0x1a')](_0x36abf3['query'][_0x1b86('0x1a')]);}return _0x13d1bc[_0x1b86('0x49')](_0xea4989);}})['then'](function(_0x556c50){if(_0x556c50){return _0x556c50?{'count':_0x593c42,'rows':_0x556c50}:null;}})['then'](respondWithResult(_0x444b68,null))[_0x1b86('0x40')](handleError(_0x444b68,null));};exports[_0x1b86('0x4d')]=function(_0x411577,_0x379b95,_0x2678e6){var _0x101597={};var _0x5ec82e={};var _0x446d6c;var _0x61e504;return db['ServicenowConfiguration'][_0x1b86('0x4a')]({'where':{'id':_0x411577[_0x1b86('0x46')]['id']}})['then'](handleEntityNotFound(_0x379b95,null))[_0x1b86('0x3b')](function(_0x5010f7){if(_0x5010f7){_0x446d6c=_0x5010f7;_0x5ec82e[_0x1b86('0x2d')]=_[_0x1b86('0x2e')](db['ServicenowField'][_0x1b86('0x29')]);_0x5ec82e[_0x1b86('0x2f')]=_[_0x1b86('0x2e')](_0x411577['query']);_0x5ec82e[_0x1b86('0x30')]=_[_0x1b86('0x42')](_0x5ec82e[_0x1b86('0x2d')],_0x5ec82e['query']);_0x101597[_0x1b86('0x31')]=_[_0x1b86('0x42')](_0x5ec82e[_0x1b86('0x2d')],qs[_0x1b86('0x43')](_0x411577[_0x1b86('0x2f')][_0x1b86('0x43')]));_0x101597[_0x1b86('0x31')]=_0x101597[_0x1b86('0x31')][_0x1b86('0x32')]?_0x101597['attributes']:_0x5ec82e[_0x1b86('0x2d')];_0x101597[_0x1b86('0x34')]=qs['sort'](_0x411577[_0x1b86('0x2f')][_0x1b86('0x35')]);_0x101597[_0x1b86('0x36')]=qs[_0x1b86('0x30')](_[_0x1b86('0x4b')](_0x411577[_0x1b86('0x2f')],_0x5ec82e['filters']));if(_0x411577['query']['filter']){_0x101597['where']=_[_0x1b86('0x37')](_0x101597[_0x1b86('0x36')],{'$or':_[_0x1b86('0x27')](_0x101597[_0x1b86('0x31')],function(_0x14e847){var _0x57524b={};_0x57524b[_0x14e847]={'$like':'%'+_0x411577[_0x1b86('0x2f')][_0x1b86('0x39')]+'%'};return _0x57524b;})});}_0x101597=_[_0x1b86('0x37')]({},_0x101597,_0x411577['options']);return _0x446d6c[_0x1b86('0x4d')](_0x101597);}})['then'](function(_0xb5bb5b){if(_0xb5bb5b){_0x61e504=_0xb5bb5b[_0x1b86('0x32')];if(!_0x411577[_0x1b86('0x2f')]['hasOwnProperty'](_0x1b86('0x4c'))){_0x101597[_0x1b86('0x1c')]=qs[_0x1b86('0x1c')](_0x411577[_0x1b86('0x2f')][_0x1b86('0x1c')]);_0x101597[_0x1b86('0x1a')]=qs[_0x1b86('0x1a')](_0x411577[_0x1b86('0x2f')][_0x1b86('0x1a')]);}return _0x446d6c['getDescriptions'](_0x101597);}})[_0x1b86('0x3b')](function(_0x38f626){if(_0x38f626){return _0x38f626?{'count':_0x61e504,'rows':_0x38f626}:null;}})[_0x1b86('0x3b')](respondWithResult(_0x379b95,null))[_0x1b86('0x40')](handleError(_0x379b95,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index e5f0a5a..09e696a 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 _0xb982=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','../../config/logger'];(function(_0x14c33c,_0x32aaee){var _0x5c8597=function(_0x37b672){while(--_0x37b672){_0x14c33c['push'](_0x14c33c['shift']());}};_0x5c8597(++_0x32aaee);}(_0xb982,0x15e));var _0x2b98=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb982[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2b98('0x0'))(_0x2b98('0x1'));var moment=require(_0x2b98('0x2'));var BPromise=require(_0x2b98('0x3'));var rp=require(_0x2b98('0x4'));var fs=require('fs');var path=require(_0x2b98('0x5'));var rimraf=require(_0x2b98('0x6'));var config=require(_0x2b98('0x7'));var attributes=require(_0x2b98('0x8'));module[_0x2b98('0x9')]=function(_0x55f7b8,_0xe2657d){return _0x55f7b8[_0x2b98('0xa')](_0x2b98('0xb'),attributes,{'tableName':_0x2b98('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x94d2=['exports','int_servicenow_configurations','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intServicenowConfiguration.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x94d2,0x1cd));var _0x294d=function(_0x53b133,_0x176261){_0x53b133=_0x53b133-0x0;var _0x5647e0=_0x94d2[_0x53b133];return _0x5647e0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x294d('0x0'))(_0x294d('0x1'));var moment=require(_0x294d('0x2'));var BPromise=require(_0x294d('0x3'));var rp=require(_0x294d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x294d('0x5'));var attributes=require(_0x294d('0x6'));module[_0x294d('0x7')]=function(_0x234700,_0x279b9b){return _0x234700['define']('ServicenowConfiguration',attributes,{'tableName':_0x294d('0x8'),'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 3790530..a1b9b18 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 _0xfa74=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0xfa74,0x1b0));var _0x4fa7=function(_0x3f6614,_0xefe981){_0x3f6614=_0x3f6614-0x0;var _0x7dc330=_0xfa74[_0x3f6614];return _0x7dc330;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4fa7('0x0'));var BPromise=require('bluebird');var rs=require(_0x4fa7('0x1'));var fs=require('fs');var Redis=require(_0x4fa7('0x2'));var db=require(_0x4fa7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4fa7('0x4'))(_0x4fa7('0x5'));var config=require(_0x4fa7('0x6'));var jayson=require(_0x4fa7('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x53d1d5,_0x5b615a,_0x2a7de8){return new BPromise(function(_0x51cfe6,_0x1eca0a){return client['request'](_0x53d1d5,_0x2a7de8)[_0x4fa7('0x8')](function(_0x4356e6){logger[_0x4fa7('0x9')](_0x4fa7('0xa'),_0x5b615a,_0x4fa7('0xb'));logger['debug'](_0x4fa7('0xc'),_0x5b615a,_0x4fa7('0xb'),JSON[_0x4fa7('0xd')](_0x4356e6));if(_0x4356e6[_0x4fa7('0xe')]){if(_0x4356e6[_0x4fa7('0xe')][_0x4fa7('0xf')]===0x1f4){logger[_0x4fa7('0xe')](_0x4fa7('0xa'),_0x5b615a,_0x4356e6['error']['message']);return _0x1eca0a(_0x4356e6[_0x4fa7('0xe')][_0x4fa7('0x10')]);}logger[_0x4fa7('0xe')](_0x4fa7('0xa'),_0x5b615a,_0x4356e6[_0x4fa7('0xe')][_0x4fa7('0x10')]);return _0x51cfe6(_0x4356e6[_0x4fa7('0xe')][_0x4fa7('0x10')]);}else{logger[_0x4fa7('0x9')](_0x4fa7('0xa'),_0x5b615a,'request\x20sent');_0x51cfe6(_0x4356e6['result']['message']);}})[_0x4fa7('0x11')](function(_0x2ff368){logger[_0x4fa7('0xe')](_0x4fa7('0xa'),_0x5b615a,_0x2ff368);_0x1eca0a(_0x2ff368);});});} \ No newline at end of file +var _0x6b1b=['info','request\x20sent','stringify','error','ServicenowConfiguration,\x20%s,\x20%s','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x28a196,_0x349ebf){var _0x4ccb77=function(_0x3b1f38){while(--_0x3b1f38){_0x28a196['push'](_0x28a196['shift']());}};_0x4ccb77(++_0x349ebf);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x6b1b[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0xb6b1('0x0'));var moment=require(_0xb6b1('0x1'));var BPromise=require(_0xb6b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6b1('0x3'));var db=require(_0xb6b1('0x4'))['db'];var utils=require(_0xb6b1('0x5'));var logger=require(_0xb6b1('0x6'))(_0xb6b1('0x7'));var config=require(_0xb6b1('0x8'));var jayson=require(_0xb6b1('0x9'));var client=jayson[_0xb6b1('0xa')][_0xb6b1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13334e,_0x1a4cd0,_0x5b440a){return new BPromise(function(_0x2734cc,_0x52aa76){return client['request'](_0x13334e,_0x5b440a)[_0xb6b1('0xc')](function(_0x58027c){logger[_0xb6b1('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1a4cd0,'request\x20sent');logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x1a4cd0,_0xb6b1('0xe'),JSON[_0xb6b1('0xf')](_0x58027c));if(_0x58027c['error']){if(_0x58027c[_0xb6b1('0x10')]['code']===0x1f4){logger['error'](_0xb6b1('0x11'),_0x1a4cd0,_0x58027c[_0xb6b1('0x10')][_0xb6b1('0x12')]);return _0x52aa76(_0x58027c[_0xb6b1('0x10')][_0xb6b1('0x12')]);}logger[_0xb6b1('0x10')](_0xb6b1('0x11'),_0x1a4cd0,_0x58027c[_0xb6b1('0x10')][_0xb6b1('0x12')]);return _0x2734cc(_0x58027c[_0xb6b1('0x10')][_0xb6b1('0x12')]);}else{logger[_0xb6b1('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1a4cd0,'request\x20sent');_0x2734cc(_0x58027c['result']['message']);}})[_0xb6b1('0x13')](function(_0x12c595){logger[_0xb6b1('0x10')](_0xb6b1('0x11'),_0x1a4cd0,_0x12c595);_0x52aa76(_0x12c595);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index f189b7a..700c6a2 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 _0x0205=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','index','get','/:id','isAuthenticated','post','create','put','delete','destroy','exports','multer'];(function(_0x1de01d,_0xeb122c){var _0x2865ef=function(_0x2e1e6b){while(--_0x2e1e6b){_0x1de01d['push'](_0x1de01d['shift']());}};_0x2865ef(++_0xeb122c);}(_0x0205,0xbc));var _0x5020=function(_0x1b87fe,_0x1d5107){_0x1b87fe=_0x1b87fe-0x0;var _0x7df32e=_0x0205[_0x1b87fe];return _0x7df32e;};'use strict';var multer=require(_0x5020('0x0'));var util=require(_0x5020('0x1'));var path=require(_0x5020('0x2'));var timeout=require(_0x5020('0x3'));var express=require(_0x5020('0x4'));var router=express[_0x5020('0x5')]();var fs_extra=require(_0x5020('0x6'));var auth=require(_0x5020('0x7'));var interaction=require(_0x5020('0x8'));var config=require(_0x5020('0x9'));var controller=require(_0x5020('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x5020('0xb')]);router[_0x5020('0xc')](_0x5020('0xd'),auth[_0x5020('0xe')](),controller['show']);router[_0x5020('0xf')]('/',auth['isAuthenticated'](),controller[_0x5020('0x10')]);router[_0x5020('0x11')](_0x5020('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x5020('0x12')](_0x5020('0xd'),auth[_0x5020('0xe')](),controller[_0x5020('0x13')]);module[_0x5020('0x14')]=router; \ No newline at end of file +var _0x7ec2=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x47c1fa,_0x39d4fd){var _0x5955fe=function(_0x35ea89){while(--_0x35ea89){_0x47c1fa['push'](_0x47c1fa['shift']());}};_0x5955fe(++_0x39d4fd);}(_0x7ec2,0x15f));var _0x27ec=function(_0x4282aa,_0x33f9a7){_0x4282aa=_0x4282aa-0x0;var _0x5b19df=_0x7ec2[_0x4282aa];return _0x5b19df;};'use strict';var multer=require(_0x27ec('0x0'));var util=require(_0x27ec('0x1'));var path=require(_0x27ec('0x2'));var timeout=require(_0x27ec('0x3'));var express=require(_0x27ec('0x4'));var router=express[_0x27ec('0x5')]();var fs_extra=require(_0x27ec('0x6'));var auth=require(_0x27ec('0x7'));var interaction=require(_0x27ec('0x8'));var config=require(_0x27ec('0x9'));var controller=require(_0x27ec('0xa'));router[_0x27ec('0xb')]('/',auth[_0x27ec('0xc')](),controller[_0x27ec('0xd')]);router[_0x27ec('0xb')](_0x27ec('0xe'),auth[_0x27ec('0xc')](),controller[_0x27ec('0xf')]);router[_0x27ec('0x10')]('/',auth[_0x27ec('0xc')](),controller[_0x27ec('0x11')]);router[_0x27ec('0x12')](_0x27ec('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x27ec('0xe'),auth['isAuthenticated'](),controller[_0x27ec('0x13')]);module[_0x27ec('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 6221919..4be1c35 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 _0x9592=['exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x34c3ac,_0x40a7f4){var _0x6661a1=function(_0x14f2ec){while(--_0x14f2ec){_0x34c3ac['push'](_0x34c3ac['shift']());}};_0x6661a1(++_0x40a7f4);}(_0x9592,0x103));var _0x2959=function(_0x5ed325,_0x44e648){_0x5ed325=_0x5ed325-0x0;var _0x157b29=_0x9592[_0x5ed325];return _0x157b29;};'use strict';var Sequelize=require(_0x2959('0x0'));module[_0x2959('0x1')]={'type':{'type':Sequelize[_0x2959('0x2')](_0x2959('0x3'),_0x2959('0x4'),'customVariable',_0x2959('0x5'),_0x2959('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2959('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x2959('0x3'),'variable',_0x2959('0x8'))},'keyContent':{'type':Sequelize[_0x2959('0x7')]},'idField':{'type':Sequelize[_0x2959('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2959('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2959('0x7')]}}; \ No newline at end of file +var _0x5821=['ENUM','BOOLEAN','sequelize','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x284bc3,_0x22dffe){var _0x41ac81=function(_0x47031f){while(--_0x47031f){_0x284bc3['push'](_0x284bc3['shift']());}};_0x41ac81(++_0x22dffe);}(_0x5821,0x107));var _0x1582=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5821[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x1582('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x1582('0x1'),_0x1582('0x2'),_0x1582('0x3'),_0x1582('0x4'),_0x1582('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x1582('0x6')]},'key':{'type':Sequelize[_0x1582('0x6')]},'keyType':{'type':Sequelize[_0x1582('0x7')](_0x1582('0x1'),_0x1582('0x2'),_0x1582('0x3'))},'keyContent':{'type':Sequelize[_0x1582('0x6')]},'idField':{'type':Sequelize[_0x1582('0x6')]},'nameField':{'type':Sequelize[_0x1582('0x6')]},'customField':{'type':Sequelize[_0x1582('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1582('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index b77f3e2..acc00a0 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 _0x2a31=['set','Content-Range','apply','reject','save','update','destroy','then','error','send','index','rawAttributes','fieldName','type','key','model','map','name','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ServicenowField','findAll','rows','catch','show','params','keys','includeAll','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count'];(function(_0x160408,_0x38600c){var _0x557c8c=function(_0x5d0ffc){while(--_0x5d0ffc){_0x160408['push'](_0x160408['shift']());}};_0x557c8c(++_0x38600c);}(_0x2a31,0x78));var _0x12a3=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2a31[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x12a3('0x0'));var rimraf=require(_0x12a3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x12a3('0x2'));var rp=require(_0x12a3('0x3'));var moment=require(_0x12a3('0x4'));var BPromise=require(_0x12a3('0x5'));var Mustache=require('mustache');var util=require(_0x12a3('0x6'));var path=require(_0x12a3('0x7'));var sox=require(_0x12a3('0x8'));var csv=require(_0x12a3('0x9'));var ejs=require(_0x12a3('0xa'));var fs=require('fs');var fs_extra=require(_0x12a3('0xb'));var _=require('lodash');var squel=require(_0x12a3('0xc'));var crypto=require(_0x12a3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x12a3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x12a3('0xf'));var Papa=require(_0x12a3('0x10'));var Redis=require(_0x12a3('0x11'));var authService=require(_0x12a3('0x12'));var qs=require(_0x12a3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x12a3('0x14'));var utils=require(_0x12a3('0x15'));var config=require(_0x12a3('0x16'));var licenseUtil=require(_0x12a3('0x17'));var db=require(_0x12a3('0x18'))['db'];function respondWithStatusCode(_0xa0c657,_0xc86437){_0xc86437=_0xc86437||0xcc;return function(_0x376707){if(_0x376707){return _0xa0c657['sendStatus'](_0xc86437);}return _0xa0c657[_0x12a3('0x19')](_0xc86437)[_0x12a3('0x1a')]();};}function respondWithResult(_0x71677b,_0x563b03){_0x563b03=_0x563b03||0xc8;return function(_0x439cbb){if(_0x439cbb){return _0x71677b[_0x12a3('0x19')](_0x563b03)[_0x12a3('0x1b')](_0x439cbb);}};}function respondWithFilteredResult(_0x585c75,_0x3c5557){return function(_0x174c65){if(_0x174c65){var _0x2f82c9=typeof _0x3c5557[_0x12a3('0x1c')]===_0x12a3('0x1d')&&typeof _0x3c5557[_0x12a3('0x1e')]===_0x12a3('0x1d');var _0x2cd5fa=_0x174c65[_0x12a3('0x1f')];var _0x3716e0=_0x2f82c9?0x0:_0x3c5557[_0x12a3('0x1c')];var _0x490b0b=_0x2f82c9?_0x174c65[_0x12a3('0x1f')]:_0x3c5557[_0x12a3('0x1c')]+_0x3c5557[_0x12a3('0x1e')];var _0xce0e71;if(_0x490b0b>=_0x2cd5fa){_0x490b0b=_0x2cd5fa;_0xce0e71=0xc8;}else{_0xce0e71=0xce;}_0x585c75[_0x12a3('0x19')](_0xce0e71);return _0x585c75[_0x12a3('0x20')](_0x12a3('0x21'),_0x3716e0+'-'+_0x490b0b+'/'+_0x2cd5fa)[_0x12a3('0x1b')](_0x174c65);}return null;};}function patchUpdates(_0x6e826d){return function(_0x5be300){try{jsonpatch[_0x12a3('0x22')](_0x5be300,_0x6e826d,!![]);}catch(_0x204d4b){return BPromise[_0x12a3('0x23')](_0x204d4b);}return _0x5be300[_0x12a3('0x24')]();};}function saveUpdates(_0x3c3725,_0x3bb999){return function(_0x4d057f){if(_0x4d057f){return _0x4d057f[_0x12a3('0x25')](_0x3c3725)['then'](function(_0x5f3d9d){return _0x5f3d9d;});}return null;};}function removeEntity(_0x51b59d,_0xaa53bd){return function(_0x481b46){if(_0x481b46){return _0x481b46[_0x12a3('0x26')]()[_0x12a3('0x27')](function(){_0x51b59d['status'](0xcc)[_0x12a3('0x1a')]();});}};}function handleEntityNotFound(_0x4a7a5f,_0x1d734d){return function(_0x203cd5){if(!_0x203cd5){_0x4a7a5f['sendStatus'](0x194);}return _0x203cd5;};}function handleError(_0x1f68b1,_0x50a6a8){_0x50a6a8=_0x50a6a8||0x1f4;return function(_0x3ca132){logger[_0x12a3('0x28')](_0x3ca132['stack']);if(_0x3ca132['name']){delete _0x3ca132['name'];}_0x1f68b1[_0x12a3('0x19')](_0x50a6a8)[_0x12a3('0x29')](_0x3ca132);};}exports[_0x12a3('0x2a')]=function(_0x246902,_0x2a6e29){var _0x1b27d0={},_0x18413a={},_0xf339d4={'count':0x0,'rows':[]};var _0x82891d=_['map'](db['ServicenowField'][_0x12a3('0x2b')],function(_0xde2b50){return{'name':_0xde2b50[_0x12a3('0x2c')],'type':_0xde2b50[_0x12a3('0x2d')][_0x12a3('0x2e')]};});_0x18413a[_0x12a3('0x2f')]=_[_0x12a3('0x30')](_0x82891d,_0x12a3('0x31'));_0x18413a['query']=_['keys'](_0x246902[_0x12a3('0x32')]);_0x18413a['filters']=_['intersection'](_0x18413a['model'],_0x18413a[_0x12a3('0x32')]);_0x1b27d0[_0x12a3('0x33')]=_[_0x12a3('0x34')](_0x18413a['model'],qs['fields'](_0x246902[_0x12a3('0x32')][_0x12a3('0x35')]));_0x1b27d0[_0x12a3('0x33')]=_0x1b27d0[_0x12a3('0x33')][_0x12a3('0x36')]?_0x1b27d0[_0x12a3('0x33')]:_0x18413a[_0x12a3('0x2f')];if(!_0x246902[_0x12a3('0x32')]['hasOwnProperty'](_0x12a3('0x37'))){_0x1b27d0[_0x12a3('0x1e')]=qs[_0x12a3('0x1e')](_0x246902['query'][_0x12a3('0x1e')]);_0x1b27d0[_0x12a3('0x1c')]=qs['offset'](_0x246902[_0x12a3('0x32')][_0x12a3('0x1c')]);}_0x1b27d0[_0x12a3('0x38')]=qs[_0x12a3('0x39')](_0x246902[_0x12a3('0x32')]['sort']);_0x1b27d0[_0x12a3('0x3a')]=qs[_0x12a3('0x3b')](_[_0x12a3('0x3c')](_0x246902[_0x12a3('0x32')],_0x18413a[_0x12a3('0x3b')]),_0x82891d);if(_0x246902[_0x12a3('0x32')][_0x12a3('0x3d')]){_0x1b27d0[_0x12a3('0x3a')]=_[_0x12a3('0x3e')](_0x1b27d0[_0x12a3('0x3a')],{'$or':_['map'](_0x82891d,function(_0x30df99){if(_0x30df99[_0x12a3('0x2d')]!==_0x12a3('0x3f')){var _0x498cba={};_0x498cba[_0x30df99[_0x12a3('0x31')]]={'$like':'%'+_0x246902[_0x12a3('0x32')][_0x12a3('0x3d')]+'%'};return _0x498cba;}})});}_0x1b27d0=_[_0x12a3('0x3e')]({},_0x1b27d0,_0x246902[_0x12a3('0x40')]);var _0x1cb6ca={'where':_0x1b27d0[_0x12a3('0x3a')]};return db[_0x12a3('0x41')][_0x12a3('0x1f')](_0x1cb6ca)[_0x12a3('0x27')](function(_0x2de3f3){_0xf339d4[_0x12a3('0x1f')]=_0x2de3f3;if(_0x246902[_0x12a3('0x32')]['includeAll']){_0x1b27d0['include']=[{'all':!![]}];}return db['ServicenowField'][_0x12a3('0x42')](_0x1b27d0);})[_0x12a3('0x27')](function(_0x5f4828){_0xf339d4[_0x12a3('0x43')]=_0x5f4828;return _0xf339d4;})[_0x12a3('0x27')](respondWithFilteredResult(_0x2a6e29,_0x1b27d0))[_0x12a3('0x44')](handleError(_0x2a6e29,null));};exports[_0x12a3('0x45')]=function(_0x1df440,_0x3b6496){var _0x2ee821={'raw':!![],'where':{'id':_0x1df440[_0x12a3('0x46')]['id']}},_0x32dff2={};_0x32dff2[_0x12a3('0x2f')]=_[_0x12a3('0x47')](db[_0x12a3('0x41')]['rawAttributes']);_0x32dff2[_0x12a3('0x32')]=_[_0x12a3('0x47')](_0x1df440[_0x12a3('0x32')]);_0x32dff2['filters']=_[_0x12a3('0x34')](_0x32dff2[_0x12a3('0x2f')],_0x32dff2[_0x12a3('0x32')]);_0x2ee821[_0x12a3('0x33')]=_[_0x12a3('0x34')](_0x32dff2[_0x12a3('0x2f')],qs[_0x12a3('0x35')](_0x1df440['query'][_0x12a3('0x35')]));_0x2ee821[_0x12a3('0x33')]=_0x2ee821[_0x12a3('0x33')][_0x12a3('0x36')]?_0x2ee821[_0x12a3('0x33')]:_0x32dff2[_0x12a3('0x2f')];if(_0x1df440[_0x12a3('0x32')][_0x12a3('0x48')]){_0x2ee821['include']=[{'all':!![]}];}_0x2ee821=_[_0x12a3('0x3e')]({},_0x2ee821,_0x1df440[_0x12a3('0x40')]);return db[_0x12a3('0x41')][_0x12a3('0x49')](_0x2ee821)[_0x12a3('0x27')](handleEntityNotFound(_0x3b6496,null))[_0x12a3('0x27')](respondWithResult(_0x3b6496,null))['catch'](handleError(_0x3b6496,null));};exports[_0x12a3('0x4a')]=function(_0x3221e0,_0x312cfe){return db[_0x12a3('0x41')][_0x12a3('0x4a')](_0x3221e0[_0x12a3('0x4b')],{})[_0x12a3('0x27')](respondWithResult(_0x312cfe,0xc9))[_0x12a3('0x44')](handleError(_0x312cfe,null));};exports[_0x12a3('0x25')]=function(_0x17a170,_0x254b7d){if(_0x17a170[_0x12a3('0x4b')]['id']){delete _0x17a170[_0x12a3('0x4b')]['id'];}return db[_0x12a3('0x41')]['find']({'where':{'id':_0x17a170['params']['id']}})[_0x12a3('0x27')](handleEntityNotFound(_0x254b7d,null))[_0x12a3('0x27')](saveUpdates(_0x17a170[_0x12a3('0x4b')],null))[_0x12a3('0x27')](respondWithResult(_0x254b7d,null))[_0x12a3('0x44')](handleError(_0x254b7d,null));};exports[_0x12a3('0x26')]=function(_0x51d589,_0x3eb4c5){return db[_0x12a3('0x41')][_0x12a3('0x49')]({'where':{'id':_0x51d589[_0x12a3('0x46')]['id']}})['then'](handleEntityNotFound(_0x3eb4c5,null))[_0x12a3('0x27')](removeEntity(_0x3eb4c5,null))[_0x12a3('0x44')](handleError(_0x3eb4c5,null));}; \ No newline at end of file +var _0xa4ae=['status','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','ServicenowField','length','include','create','update','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x1251f9,_0x11ae52){var _0x2530a6=function(_0x8c6703){while(--_0x8c6703){_0x1251f9['push'](_0x1251f9['shift']());}};_0x2530a6(++_0x11ae52);}(_0xa4ae,0x109));var _0xea4a=function(_0x43a5c7,_0x2286bf){_0x43a5c7=_0x43a5c7-0x0;var _0x3b12a2=_0xa4ae[_0x43a5c7];return _0x3b12a2;};'use strict';var emlformat=require(_0xea4a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea4a('0x1'));var jsonpatch=require(_0xea4a('0x2'));var rp=require(_0xea4a('0x3'));var moment=require(_0xea4a('0x4'));var BPromise=require(_0xea4a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xea4a('0x6'));var csv=require('to-csv');var ejs=require(_0xea4a('0x7'));var fs=require('fs');var fs_extra=require(_0xea4a('0x8'));var _=require(_0xea4a('0x9'));var squel=require(_0xea4a('0xa'));var crypto=require(_0xea4a('0xb'));var jsforce=require(_0xea4a('0xc'));var deskjs=require(_0xea4a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xea4a('0xe'));var Papa=require(_0xea4a('0xf'));var Redis=require(_0xea4a('0x10'));var authService=require(_0xea4a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xea4a('0x12'));var hardwareService=require(_0xea4a('0x13'));var logger=require('../../config/logger')(_0xea4a('0x14'));var utils=require(_0xea4a('0x15'));var config=require(_0xea4a('0x16'));var licenseUtil=require(_0xea4a('0x17'));var db=require(_0xea4a('0x18'))['db'];function respondWithStatusCode(_0x3ce72b,_0x5b3584){_0x5b3584=_0x5b3584||0xcc;return function(_0x55d833){if(_0x55d833){return _0x3ce72b[_0xea4a('0x19')](_0x5b3584);}return _0x3ce72b['status'](_0x5b3584)[_0xea4a('0x1a')]();};}function respondWithResult(_0x6d88e,_0x5c4dd3){_0x5c4dd3=_0x5c4dd3||0xc8;return function(_0x355f8c){if(_0x355f8c){return _0x6d88e[_0xea4a('0x1b')](_0x5c4dd3)['json'](_0x355f8c);}};}function respondWithFilteredResult(_0x2ed580,_0x370595){return function(_0x409a84){if(_0x409a84){var _0x27762a=typeof _0x370595[_0xea4a('0x1c')]===_0xea4a('0x1d')&&typeof _0x370595[_0xea4a('0x1e')]===_0xea4a('0x1d');var _0x5ca7c7=_0x409a84[_0xea4a('0x1f')];var _0x9b436d=_0x27762a?0x0:_0x370595['offset'];var _0x38ba08=_0x27762a?_0x409a84[_0xea4a('0x1f')]:_0x370595[_0xea4a('0x1c')]+_0x370595[_0xea4a('0x1e')];var _0x2ab8c3;if(_0x38ba08>=_0x5ca7c7){_0x38ba08=_0x5ca7c7;_0x2ab8c3=0xc8;}else{_0x2ab8c3=0xce;}_0x2ed580[_0xea4a('0x1b')](_0x2ab8c3);return _0x2ed580[_0xea4a('0x20')](_0xea4a('0x21'),_0x9b436d+'-'+_0x38ba08+'/'+_0x5ca7c7)['json'](_0x409a84);}return null;};}function patchUpdates(_0x4a29d1){return function(_0x48f475){try{jsonpatch[_0xea4a('0x22')](_0x48f475,_0x4a29d1,!![]);}catch(_0x174457){return BPromise[_0xea4a('0x23')](_0x174457);}return _0x48f475['save']();};}function saveUpdates(_0x49e8da,_0x4b8b01){return function(_0xe40abb){if(_0xe40abb){return _0xe40abb['update'](_0x49e8da)[_0xea4a('0x24')](function(_0x123f9e){return _0x123f9e;});}return null;};}function removeEntity(_0x3694b1,_0x2fb1c8){return function(_0x1ebe86){if(_0x1ebe86){return _0x1ebe86[_0xea4a('0x25')]()[_0xea4a('0x24')](function(){_0x3694b1[_0xea4a('0x1b')](0xcc)[_0xea4a('0x1a')]();});}};}function handleEntityNotFound(_0x2b8f1a,_0x36b9f5){return function(_0x4bb1b7){if(!_0x4bb1b7){_0x2b8f1a['sendStatus'](0x194);}return _0x4bb1b7;};}function handleError(_0x55db39,_0x5148a1){_0x5148a1=_0x5148a1||0x1f4;return function(_0x418785){logger[_0xea4a('0x26')](_0x418785[_0xea4a('0x27')]);if(_0x418785[_0xea4a('0x28')]){delete _0x418785[_0xea4a('0x28')];}_0x55db39[_0xea4a('0x1b')](_0x5148a1)['send'](_0x418785);};}exports[_0xea4a('0x29')]=function(_0x5af048,_0x2251f2){var _0x43be02={},_0x1ed3a8={},_0x1dafa9={'count':0x0,'rows':[]};var _0x23f258=_[_0xea4a('0x2a')](db['ServicenowField'][_0xea4a('0x2b')],function(_0x2fc9f4){return{'name':_0x2fc9f4['fieldName'],'type':_0x2fc9f4[_0xea4a('0x2c')][_0xea4a('0x2d')]};});_0x1ed3a8[_0xea4a('0x2e')]=_[_0xea4a('0x2a')](_0x23f258,_0xea4a('0x28'));_0x1ed3a8[_0xea4a('0x2f')]=_[_0xea4a('0x30')](_0x5af048[_0xea4a('0x2f')]);_0x1ed3a8[_0xea4a('0x31')]=_[_0xea4a('0x32')](_0x1ed3a8[_0xea4a('0x2e')],_0x1ed3a8[_0xea4a('0x2f')]);_0x43be02[_0xea4a('0x33')]=_[_0xea4a('0x32')](_0x1ed3a8[_0xea4a('0x2e')],qs[_0xea4a('0x34')](_0x5af048[_0xea4a('0x2f')][_0xea4a('0x34')]));_0x43be02['attributes']=_0x43be02[_0xea4a('0x33')]['length']?_0x43be02[_0xea4a('0x33')]:_0x1ed3a8['model'];if(!_0x5af048['query']['hasOwnProperty'](_0xea4a('0x35'))){_0x43be02[_0xea4a('0x1e')]=qs[_0xea4a('0x1e')](_0x5af048[_0xea4a('0x2f')]['limit']);_0x43be02[_0xea4a('0x1c')]=qs[_0xea4a('0x1c')](_0x5af048['query'][_0xea4a('0x1c')]);}_0x43be02['order']=qs[_0xea4a('0x36')](_0x5af048[_0xea4a('0x2f')][_0xea4a('0x36')]);_0x43be02['where']=qs[_0xea4a('0x31')](_[_0xea4a('0x37')](_0x5af048['query'],_0x1ed3a8[_0xea4a('0x31')]),_0x23f258);if(_0x5af048[_0xea4a('0x2f')][_0xea4a('0x38')]){_0x43be02['where']=_['merge'](_0x43be02[_0xea4a('0x39')],{'$or':_[_0xea4a('0x2a')](_0x23f258,function(_0x1e7369){if(_0x1e7369['type']!==_0xea4a('0x3a')){var _0x330feb={};_0x330feb[_0x1e7369[_0xea4a('0x28')]]={'$like':'%'+_0x5af048[_0xea4a('0x2f')]['filter']+'%'};return _0x330feb;}})});}_0x43be02=_[_0xea4a('0x3b')]({},_0x43be02,_0x5af048[_0xea4a('0x3c')]);var _0x106de3={'where':_0x43be02[_0xea4a('0x39')]};return db['ServicenowField'][_0xea4a('0x1f')](_0x106de3)['then'](function(_0x327445){_0x1dafa9['count']=_0x327445;if(_0x5af048[_0xea4a('0x2f')][_0xea4a('0x3d')]){_0x43be02['include']=[{'all':!![]}];}return db['ServicenowField'][_0xea4a('0x3e')](_0x43be02);})[_0xea4a('0x24')](function(_0x42229e){_0x1dafa9[_0xea4a('0x3f')]=_0x42229e;return _0x1dafa9;})[_0xea4a('0x24')](respondWithFilteredResult(_0x2251f2,_0x43be02))[_0xea4a('0x40')](handleError(_0x2251f2,null));};exports['show']=function(_0x54e66e,_0xa6d108){var _0x124bf4={'raw':!![],'where':{'id':_0x54e66e[_0xea4a('0x41')]['id']}},_0x11a7a4={};_0x11a7a4[_0xea4a('0x2e')]=_[_0xea4a('0x30')](db[_0xea4a('0x42')][_0xea4a('0x2b')]);_0x11a7a4[_0xea4a('0x2f')]=_[_0xea4a('0x30')](_0x54e66e[_0xea4a('0x2f')]);_0x11a7a4[_0xea4a('0x31')]=_[_0xea4a('0x32')](_0x11a7a4[_0xea4a('0x2e')],_0x11a7a4['query']);_0x124bf4[_0xea4a('0x33')]=_[_0xea4a('0x32')](_0x11a7a4['model'],qs[_0xea4a('0x34')](_0x54e66e['query'][_0xea4a('0x34')]));_0x124bf4['attributes']=_0x124bf4[_0xea4a('0x33')][_0xea4a('0x43')]?_0x124bf4[_0xea4a('0x33')]:_0x11a7a4[_0xea4a('0x2e')];if(_0x54e66e[_0xea4a('0x2f')][_0xea4a('0x3d')]){_0x124bf4[_0xea4a('0x44')]=[{'all':!![]}];}_0x124bf4=_[_0xea4a('0x3b')]({},_0x124bf4,_0x54e66e[_0xea4a('0x3c')]);return db[_0xea4a('0x42')]['find'](_0x124bf4)['then'](handleEntityNotFound(_0xa6d108,null))[_0xea4a('0x24')](respondWithResult(_0xa6d108,null))[_0xea4a('0x40')](handleError(_0xa6d108,null));};exports[_0xea4a('0x45')]=function(_0xe1b202,_0x257ae7){return db[_0xea4a('0x42')]['create'](_0xe1b202['body'],{})['then'](respondWithResult(_0x257ae7,0xc9))[_0xea4a('0x40')](handleError(_0x257ae7,null));};exports[_0xea4a('0x46')]=function(_0x5b425e,_0x5240be){if(_0x5b425e[_0xea4a('0x47')]['id']){delete _0x5b425e[_0xea4a('0x47')]['id'];}return db[_0xea4a('0x42')][_0xea4a('0x48')]({'where':{'id':_0x5b425e['params']['id']}})[_0xea4a('0x24')](handleEntityNotFound(_0x5240be,null))[_0xea4a('0x24')](saveUpdates(_0x5b425e[_0xea4a('0x47')],null))[_0xea4a('0x24')](respondWithResult(_0x5240be,null))[_0xea4a('0x40')](handleError(_0x5240be,null));};exports[_0xea4a('0x25')]=function(_0x346490,_0x1e1ad1){return db['ServicenowField'][_0xea4a('0x48')]({'where':{'id':_0x346490[_0xea4a('0x41')]['id']}})[_0xea4a('0x24')](handleEntityNotFound(_0x1e1ad1,null))[_0xea4a('0x24')](removeEntity(_0x1e1ad1,null))['catch'](handleError(_0x1e1ad1,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index f59dafc..5e352e8 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 _0x5d7f=['request-promise','rimraf','../../config/environment','./intServicenowField.attributes','define','ServicenowField','int_servicenow_fields','idField','lodash','util','api','moment'];(function(_0xff1dd3,_0x40abd2){var _0x57e542=function(_0x302c6b){while(--_0x302c6b){_0xff1dd3['push'](_0xff1dd3['shift']());}};_0x57e542(++_0x40abd2);}(_0x5d7f,0xa4));var _0xf5d7=function(_0x546213,_0x4a6734){_0x546213=_0x546213-0x0;var _0xb6b4c2=_0x5d7f[_0x546213];return _0xb6b4c2;};'use strict';var _=require(_0xf5d7('0x0'));var util=require(_0xf5d7('0x1'));var logger=require('../../config/logger')(_0xf5d7('0x2'));var moment=require(_0xf5d7('0x3'));var BPromise=require('bluebird');var rp=require(_0xf5d7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf5d7('0x5'));var config=require(_0xf5d7('0x6'));var attributes=require(_0xf5d7('0x7'));module['exports']=function(_0x3328fa,_0x1bae91){return _0x3328fa[_0xf5d7('0x8')](_0xf5d7('0x9'),attributes,{'tableName':_0xf5d7('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xf5d7('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc9bb=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','lodash','util'];(function(_0x5917af,_0x5b14b){var _0x263b6d=function(_0x516968){while(--_0x516968){_0x5917af['push'](_0x5917af['shift']());}};_0x263b6d(++_0x5b14b);}(_0xc9bb,0x8e));var _0xbc9b=function(_0x9dd431,_0x389313){_0x9dd431=_0x9dd431-0x0;var _0x1aa903=_0xc9bb[_0x9dd431];return _0x1aa903;};'use strict';var _=require(_0xbc9b('0x0'));var util=require(_0xbc9b('0x1'));var logger=require('../../config/logger')(_0xbc9b('0x2'));var moment=require(_0xbc9b('0x3'));var BPromise=require(_0xbc9b('0x4'));var rp=require(_0xbc9b('0x5'));var fs=require('fs');var path=require(_0xbc9b('0x6'));var rimraf=require(_0xbc9b('0x7'));var config=require(_0xbc9b('0x8'));var attributes=require(_0xbc9b('0x9'));module[_0xbc9b('0xa')]=function(_0x327961,_0x518be7){return _0x327961[_0xbc9b('0xb')](_0xbc9b('0xc'),attributes,{'tableName':_0xbc9b('0xd'),'paranoid':![],'indexes':[{'name':_0xbc9b('0xe'),'fields':[_0xbc9b('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index ae9b346..732151f 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 _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x12c55d,_0x178a39){var _0x342c55=function(_0x42d933){while(--_0x42d933){_0x12c55d['push'](_0x12c55d['shift']());}};_0x342c55(++_0x178a39);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4ba671,_0x491e35){_0x4ba671=_0x4ba671-0x0;var _0x2fe80e=_0xb43b[_0x4ba671];return _0x2fe80e;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file +var _0x9ffd=['ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x159152,_0x174251){var _0x50a4aa=function(_0x1a46f7){while(--_0x1a46f7){_0x159152['push'](_0x159152['shift']());}};_0x50a4aa(++_0x174251);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x2ab470,_0x51fc07){_0x2ab470=_0x2ab470-0x0;var _0x1d73db=_0x9ffd[_0x2ab470];return _0x1d73db;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 52526f5..bf28890 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(_0x35d363,_0x2fe166){var _0x4f2383=function(_0x259b7f){while(--_0x259b7f){_0x35d363['push'](_0x35d363['shift']());}};_0x4f2383(++_0x2fe166);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1234b,_0x2045f6){var _0x5e1ba9=function(_0x585f91){while(--_0x585f91){_0x1234b['push'](_0x1234b['shift']());}};_0x5e1ba9(++_0x2045f6);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 1867bb8..334f049 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(_0x4ad97f,_0x94b24c){var _0x4d96cc=function(_0x4ff494){while(--_0x4ff494){_0x4ad97f['push'](_0x4ad97f['shift']());}};_0x4d96cc(++_0x94b24c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x3096fc,_0x15c6d6){var _0x281ab2=function(_0x5614bf){while(--_0x5614bf){_0x3096fc['push'](_0x3096fc['shift']());}};_0x281ab2(++_0x15c6d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index dca3d14..6e8900d 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 _0x771b=['remove','label','endsWith','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','SugarcrmAccount','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','show','params','rawAttributes','length','find','catch','create','body','getConfigurations','SugarcrmConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_type','direction','username','password','remoteUri','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','Calls','values','module_fields'];(function(_0x42fa37,_0x4b6c07){var _0x507efd=function(_0x1db083){while(--_0x1db083){_0x42fa37['push'](_0x42fa37['shift']());}};_0x507efd(++_0x4b6c07);}(_0x771b,0xfb));var _0xb771=function(_0x1c94b4,_0x1832d7){_0x1c94b4=_0x1c94b4-0x0;var _0x419503=_0x771b[_0x1c94b4];return _0x419503;};'use strict';var emlformat=require(_0xb771('0x0'));var rimraf=require(_0xb771('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb771('0x2'));var rp=require(_0xb771('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb771('0x4'));var util=require(_0xb771('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb771('0x6'));var fs=require('fs');var fs_extra=require(_0xb771('0x7'));var _=require(_0xb771('0x8'));var squel=require('squel');var crypto=require(_0xb771('0x9'));var jsforce=require(_0xb771('0xa'));var deskjs=require(_0xb771('0xb'));var toCsv=require(_0xb771('0xc'));var querystring=require(_0xb771('0xd'));var Papa=require(_0xb771('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb771('0xf'));var as=require(_0xb771('0x10'));var hardwareService=require(_0xb771('0x11'));var logger=require('../../config/logger')(_0xb771('0x12'));var utils=require('../../config/utils');var config=require(_0xb771('0x13'));var licenseUtil=require(_0xb771('0x14'));var db=require(_0xb771('0x15'))['db'];var integrations=require(_0xb771('0x16'));function respondWithStatusCode(_0x4db222,_0x409953){_0x409953=_0x409953||0xcc;return function(_0x85f112){if(_0x85f112){return _0x4db222[_0xb771('0x17')](_0x409953);}return _0x4db222[_0xb771('0x18')](_0x409953)[_0xb771('0x19')]();};}function respondWithResult(_0xf5b45b,_0x46cf6b){_0x46cf6b=_0x46cf6b||0xc8;return function(_0x528dc8){if(_0x528dc8){return _0xf5b45b[_0xb771('0x18')](_0x46cf6b)[_0xb771('0x1a')](_0x528dc8);}};}function respondWithFilteredResult(_0xe61228,_0x486e1d){return function(_0x706445){if(_0x706445){var _0x3fdfd6=typeof _0x486e1d['offset']===_0xb771('0x1b')&&typeof _0x486e1d[_0xb771('0x1c')]==='undefined';var _0x3e3179=_0x706445[_0xb771('0x1d')];var _0x806e20=_0x3fdfd6?0x0:_0x486e1d[_0xb771('0x1e')];var _0xbfad21=_0x3fdfd6?_0x706445[_0xb771('0x1d')]:_0x486e1d[_0xb771('0x1e')]+_0x486e1d[_0xb771('0x1c')];var _0x5c5eeb;if(_0xbfad21>=_0x3e3179){_0xbfad21=_0x3e3179;_0x5c5eeb=0xc8;}else{_0x5c5eeb=0xce;}_0xe61228[_0xb771('0x18')](_0x5c5eeb);return _0xe61228[_0xb771('0x1f')](_0xb771('0x20'),_0x806e20+'-'+_0xbfad21+'/'+_0x3e3179)[_0xb771('0x1a')](_0x706445);}return null;};}function patchUpdates(_0x54e984){return function(_0x10b71c){try{jsonpatch[_0xb771('0x21')](_0x10b71c,_0x54e984,!![]);}catch(_0x198047){return BPromise[_0xb771('0x22')](_0x198047);}return _0x10b71c[_0xb771('0x23')]();};}function saveUpdates(_0x1d123f,_0x4dd48b){return function(_0x3378ef){if(_0x3378ef){return _0x3378ef[_0xb771('0x24')](_0x1d123f)['then'](function(_0x2b95b1){return _0x2b95b1;});}return null;};}function removeEntity(_0x39d69e,_0x1fd6cc){return function(_0x10b43e){if(_0x10b43e){return _0x10b43e[_0xb771('0x25')]()['then'](function(){_0x39d69e[_0xb771('0x18')](0xcc)[_0xb771('0x19')]();});}};}function handleEntityNotFound(_0x4e9bc3,_0x283faa){return function(_0xdb51bc){if(!_0xdb51bc){_0x4e9bc3['sendStatus'](0x194);}return _0xdb51bc;};}function handleError(_0x3ba00f,_0x5b12ff){_0x5b12ff=_0x5b12ff||0x1f4;return function(_0x1126a9){logger[_0xb771('0x26')](_0x1126a9[_0xb771('0x27')]);if(_0x1126a9[_0xb771('0x28')]){delete _0x1126a9[_0xb771('0x28')];}_0x3ba00f['status'](_0x5b12ff)[_0xb771('0x29')](_0x1126a9);};}exports[_0xb771('0x2a')]=function(_0x14835f,_0x4f070f){var _0x33abb3={},_0x3cc2ee={},_0x17002b={'count':0x0,'rows':[]};var _0x4897b5=_[_0xb771('0x2b')](db[_0xb771('0x2c')]['rawAttributes'],function(_0x2a5889){return{'name':_0x2a5889[_0xb771('0x2d')],'type':_0x2a5889[_0xb771('0x2e')][_0xb771('0x2f')]};});_0x3cc2ee[_0xb771('0x30')]=_[_0xb771('0x2b')](_0x4897b5,_0xb771('0x28'));_0x3cc2ee[_0xb771('0x31')]=_[_0xb771('0x32')](_0x14835f[_0xb771('0x31')]);_0x3cc2ee[_0xb771('0x33')]=_['intersection'](_0x3cc2ee[_0xb771('0x30')],_0x3cc2ee[_0xb771('0x31')]);_0x33abb3['attributes']=_[_0xb771('0x34')](_0x3cc2ee[_0xb771('0x30')],qs['fields'](_0x14835f[_0xb771('0x31')][_0xb771('0x35')]));_0x33abb3[_0xb771('0x36')]=_0x33abb3[_0xb771('0x36')]['length']?_0x33abb3['attributes']:_0x3cc2ee[_0xb771('0x30')];if(!_0x14835f[_0xb771('0x31')][_0xb771('0x37')](_0xb771('0x38'))){_0x33abb3[_0xb771('0x1c')]=qs['limit'](_0x14835f[_0xb771('0x31')]['limit']);_0x33abb3[_0xb771('0x1e')]=qs[_0xb771('0x1e')](_0x14835f[_0xb771('0x31')][_0xb771('0x1e')]);}_0x33abb3[_0xb771('0x39')]=qs['sort'](_0x14835f[_0xb771('0x31')][_0xb771('0x3a')]);_0x33abb3['where']=qs[_0xb771('0x33')](_[_0xb771('0x3b')](_0x14835f[_0xb771('0x31')],_0x3cc2ee[_0xb771('0x33')]),_0x4897b5);if(_0x14835f[_0xb771('0x31')][_0xb771('0x3c')]){_0x33abb3[_0xb771('0x3d')]=_[_0xb771('0x3e')](_0x33abb3[_0xb771('0x3d')],{'$or':_['map'](_0x4897b5,function(_0x2897ed){if(_0x2897ed['type']!==_0xb771('0x3f')){var _0x1ff1b8={};_0x1ff1b8[_0x2897ed['name']]={'$like':'%'+_0x14835f[_0xb771('0x31')]['filter']+'%'};return _0x1ff1b8;}})});}_0x33abb3=_[_0xb771('0x3e')]({},_0x33abb3,_0x14835f[_0xb771('0x40')]);var _0xb40663={'where':_0x33abb3[_0xb771('0x3d')]};return db[_0xb771('0x2c')]['count'](_0xb40663)[_0xb771('0x41')](function(_0x1224b3){_0x17002b[_0xb771('0x1d')]=_0x1224b3;if(_0x14835f[_0xb771('0x31')][_0xb771('0x42')]){_0x33abb3[_0xb771('0x43')]=[{'all':!![]}];}return db[_0xb771('0x2c')][_0xb771('0x44')](_0x33abb3);})[_0xb771('0x41')](function(_0x162d03){_0x17002b['rows']=_0x162d03;return _0x17002b;})[_0xb771('0x41')](respondWithFilteredResult(_0x4f070f,_0x33abb3))['catch'](handleError(_0x4f070f,null));};exports[_0xb771('0x45')]=function(_0x43017a,_0x205eee){var _0x163294={'raw':![],'where':{'id':_0x43017a[_0xb771('0x46')]['id']}},_0x3a9036={};_0x3a9036[_0xb771('0x30')]=_[_0xb771('0x32')](db[_0xb771('0x2c')][_0xb771('0x47')]);_0x3a9036[_0xb771('0x31')]=_[_0xb771('0x32')](_0x43017a[_0xb771('0x31')]);_0x3a9036[_0xb771('0x33')]=_[_0xb771('0x34')](_0x3a9036[_0xb771('0x30')],_0x3a9036[_0xb771('0x31')]);_0x163294[_0xb771('0x36')]=_[_0xb771('0x34')](_0x3a9036[_0xb771('0x30')],qs[_0xb771('0x35')](_0x43017a[_0xb771('0x31')][_0xb771('0x35')]));_0x163294[_0xb771('0x36')]=_0x163294[_0xb771('0x36')][_0xb771('0x48')]?_0x163294['attributes']:_0x3a9036[_0xb771('0x30')];if(_0x43017a[_0xb771('0x31')][_0xb771('0x42')]){_0x163294[_0xb771('0x43')]=[{'all':!![]}];}_0x163294=_[_0xb771('0x3e')]({},_0x163294,_0x43017a[_0xb771('0x40')]);return db[_0xb771('0x2c')][_0xb771('0x49')](_0x163294)[_0xb771('0x41')](handleEntityNotFound(_0x205eee,null))[_0xb771('0x41')](respondWithResult(_0x205eee,null))[_0xb771('0x4a')](handleError(_0x205eee,null));};exports[_0xb771('0x4b')]=function(_0x393342,_0x1bc52e){return db[_0xb771('0x2c')][_0xb771('0x4b')](_0x393342[_0xb771('0x4c')],{})[_0xb771('0x41')](respondWithResult(_0x1bc52e,0xc9))[_0xb771('0x4a')](handleError(_0x1bc52e,null));};exports['update']=function(_0x374a8f,_0x13a39a){if(_0x374a8f['body']['id']){delete _0x374a8f[_0xb771('0x4c')]['id'];}return db[_0xb771('0x2c')][_0xb771('0x49')]({'where':{'id':_0x374a8f[_0xb771('0x46')]['id']}})[_0xb771('0x41')](handleEntityNotFound(_0x13a39a,null))[_0xb771('0x41')](saveUpdates(_0x374a8f[_0xb771('0x4c')],null))[_0xb771('0x41')](respondWithResult(_0x13a39a,null))[_0xb771('0x4a')](handleError(_0x13a39a,null));};exports[_0xb771('0x25')]=function(_0x276040,_0x177f6){return db[_0xb771('0x2c')][_0xb771('0x49')]({'where':{'id':_0x276040[_0xb771('0x46')]['id']}})[_0xb771('0x41')](handleEntityNotFound(_0x177f6,null))[_0xb771('0x41')](removeEntity(_0x177f6,null))[_0xb771('0x4a')](handleError(_0x177f6,null));};exports[_0xb771('0x4d')]=function(_0x466535,_0xdadcaf,_0x417aa){var _0x3eaca5={};var _0x23ad83={};var _0x5e1fdf;var _0x2d6b7d;return db[_0xb771('0x2c')]['findOne']({'where':{'id':_0x466535[_0xb771('0x46')]['id']}})['then'](handleEntityNotFound(_0xdadcaf,null))[_0xb771('0x41')](function(_0x237f84){if(_0x237f84){_0x5e1fdf=_0x237f84;_0x23ad83[_0xb771('0x30')]=_[_0xb771('0x32')](db[_0xb771('0x4e')]['rawAttributes']);_0x23ad83[_0xb771('0x31')]=_[_0xb771('0x32')](_0x466535['query']);_0x23ad83[_0xb771('0x33')]=_['intersection'](_0x23ad83[_0xb771('0x30')],_0x23ad83['query']);_0x3eaca5['attributes']=_['intersection'](_0x23ad83[_0xb771('0x30')],qs[_0xb771('0x35')](_0x466535[_0xb771('0x31')][_0xb771('0x35')]));_0x3eaca5['attributes']=_0x3eaca5[_0xb771('0x36')][_0xb771('0x48')]?_0x3eaca5[_0xb771('0x36')]:_0x23ad83[_0xb771('0x30')];_0x3eaca5[_0xb771('0x39')]=qs[_0xb771('0x3a')](_0x466535[_0xb771('0x31')][_0xb771('0x3a')]);_0x3eaca5[_0xb771('0x3d')]=qs['filters'](_[_0xb771('0x3b')](_0x466535['query'],_0x23ad83[_0xb771('0x33')]));if(_0x466535[_0xb771('0x31')][_0xb771('0x3c')]){_0x3eaca5['where']=_[_0xb771('0x3e')](_0x3eaca5[_0xb771('0x3d')],{'$or':_[_0xb771('0x2b')](_0x3eaca5[_0xb771('0x36')],function(_0x12068c){var _0x26dd12={};_0x26dd12[_0x12068c]={'$like':'%'+_0x466535[_0xb771('0x31')]['filter']+'%'};return _0x26dd12;})});}_0x3eaca5=_['merge']({},_0x3eaca5,_0x466535[_0xb771('0x40')]);return _0x5e1fdf['getConfigurations'](_0x3eaca5);}})['then'](function(_0x2ef81d){if(_0x2ef81d){_0x2d6b7d=_0x2ef81d['length'];if(!_0x466535['query'][_0xb771('0x37')](_0xb771('0x38'))){_0x3eaca5['limit']=qs[_0xb771('0x1c')](_0x466535['query'][_0xb771('0x1c')]);_0x3eaca5['offset']=qs['offset'](_0x466535[_0xb771('0x31')]['offset']);}return _0x5e1fdf[_0xb771('0x4d')](_0x3eaca5);}})[_0xb771('0x41')](function(_0x237d26){if(_0x237d26){return _0x237d26?{'count':_0x2d6b7d,'rows':_0x237d26}:null;}})['then'](respondWithResult(_0xdadcaf,null))[_0xb771('0x4a')](handleError(_0xdadcaf,null));};exports[_0xb771('0x4f')]=function(_0xbcaff,_0x28cd14,_0x333b3d){if(_0xbcaff[_0xb771('0x4c')]['id']){delete _0xbcaff['body']['id'];}return db[_0xb771('0x2c')][_0xb771('0x50')]({'where':{'id':_0xbcaff[_0xb771('0x46')]['id']}})[_0xb771('0x41')](handleEntityNotFound(_0x28cd14,null))['then'](function(_0x3a0ec2){if(_0x3a0ec2){_0xbcaff[_0xb771('0x4c')][_0xb771('0x51')]=_0x3a0ec2['id'];_0xbcaff[_0xb771('0x4c')][_0xb771('0x52')]=integrations[_0xb771('0x53')](_0xbcaff[_0xb771('0x4c')][_0xb771('0x54')],_0xbcaff[_0xb771('0x4c')][_0xb771('0x2e')]);_0xbcaff[_0xb771('0x4c')]['Descriptions']=integrations[_0xb771('0x55')](_0xbcaff[_0xb771('0x4c')][_0xb771('0x54')],_0xbcaff[_0xb771('0x4c')][_0xb771('0x2e')]);return db[_0xb771('0x4e')][_0xb771('0x4b')](_0xbcaff[_0xb771('0x4c')],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db[_0xb771('0x56')],'as':_0xb771('0x57')}]});}return null;})[_0xb771('0x41')](respondWithResult(_0x28cd14,null))[_0xb771('0x4a')](handleError(_0x28cd14,null));};exports[_0xb771('0x58')]=function(_0x3c0cb6,_0x4e8bec,_0xc12a77){var _0x24bc04='';var _0x396fd8=['id',_0xb771('0x28'),_0xb771('0x59'),_0xb771('0x5a'),'description',_0xb771('0x5b'),_0xb771('0x5c'),_0xb771('0x5d'),_0xb771('0x5e'),_0xb771('0x5f'),'parent_name',_0xb771('0x60')];return db[_0xb771('0x2c')][_0xb771('0x50')]({'where':{'id':_0x3c0cb6[_0xb771('0x46')]['id']},'attributes':['id',_0xb771('0x61'),_0xb771('0x62'),_0xb771('0x63')]})[_0xb771('0x41')](handleEntityNotFound(_0x4e8bec,null))[_0xb771('0x41')](function(_0x438709){if(_0x438709){_0x24bc04=_0x438709[_0xb771('0x63')];var _0x294f6d=_0x24bc04['slice'](-0x1);if(_0x294f6d==='/'){_0x24bc04=_0x24bc04[_0xb771('0x64')](0x0,_0x24bc04[_0xb771('0x65')](_0x294f6d));}return rp({'method':_0xb771('0x66'),'uri':util[_0xb771('0x67')](_0xb771('0x68'),_0x24bc04,_0xb771('0x69')),'json':!![],'form':{'method':'login','input_type':_0xb771('0x6a'),'response_type':_0xb771('0x6a'),'rest_data':JSON[_0xb771('0x6b')]({'user_auth':{'user_name':_0x438709[_0xb771('0x61')],'password':_0x438709[_0xb771('0x62')],'encryption':_0xb771('0x6c')},'application':_0xb771('0x6d')})}});}})[_0xb771('0x41')](function(_0x47133d){if(_0x47133d&&_0x47133d[_0xb771('0x28')]!==_0xb771('0x6e')&&_0x47133d['name']!==_0xb771('0x6f')){return rp({'method':_0xb771('0x66'),'uri':util[_0xb771('0x67')](_0xb771('0x68'),_0x24bc04,_0xb771('0x69')),'json':!![],'form':{'method':'get_module_fields','input_type':_0xb771('0x6a'),'response_type':'JSON','rest_data':JSON[_0xb771('0x6b')]({'session':_0x47133d['id'],'module_name':_0xb771('0x70')})}})[_0xb771('0x41')](function(_0x52ee6a){if(_0x52ee6a){var _0x4b64fd=_[_0xb771('0x71')](_0x52ee6a[_0xb771('0x72')]);_[_0xb771('0x73')](_0x4b64fd,function(_0x863be0){return _0x396fd8['includes'](_0x863be0['name']);});return{'count':_0x4b64fd['length'],'rows':_[_0xb771('0x2b')](_0x4b64fd,function(_0x1c8caa){return{'id':_0x1c8caa[_0xb771('0x28')],'name':_0x1c8caa[_0xb771('0x74')],'custom':_[_0xb771('0x75')](_0x1c8caa[_0xb771('0x28')],'_c')?!![]:![],'options':_0x1c8caa[_0xb771('0x40')]?_[_0xb771('0x2b')](_['values'](_0x1c8caa[_0xb771('0x40')]),function(_0x4460f7){return{'name':_0x4460f7['value'],'value':_0x4460f7[_0xb771('0x28')]};}):[]};})};}})[_0xb771('0x41')](respondWithResult(_0x4e8bec,null))['catch'](function(_0xa50a05){var _0x35f854=_0x3c0cb6[_0xb771('0x31')][_0xb771('0x76')]?0x1f4:_0xa50a05['statusCode']||0x1f4;logger[_0xb771('0x26')](_0xb771('0x77'),_0xb771('0x58'),_0x35f854,JSON[_0xb771('0x6b')](_0xa50a05));delete _0xa50a05[_0xb771('0x28')];if(_0x35f854===0x191){_0x35f854=0x190;}_0x4e8bec[_0xb771('0x18')](_0x35f854)[_0xb771('0x29')](_0x3c0cb6['query'][_0xb771('0x76')]?{'message':_0xb771('0x78'),'statusCode':_0xa50a05[_0xb771('0x79')]}:_0xa50a05);});}else{var _0xaf8705=0x1f4;_0x4e8bec[_0xb771('0x18')](_0xaf8705)[_0xb771('0x29')]({'message':_0xb771('0x78'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x5f7f=['desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','offset','undefined','limit','count','status','set','Content-Range','json','apply','save','then','destroy','end','sendStatus','error','stack','name','send','index','map','SugarcrmAccount','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','merge','options','findAll','rows','catch','show','includeAll','include','find','create','body','update','params','getConfigurations','SugarcrmConfiguration','rawAttributes','pick','findOne','Subjects','channel','Descriptions','SugarcrmField','getFields','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','/service/v4_1/rest.php','Calls','values','module_fields','remove','includes','label','endsWith','test','getFields,\x20%s,\x20%s,\x20%s','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','squel','crypto'];(function(_0x469481,_0x2377dd){var _0x54002b=function(_0x24b7f3){while(--_0x24b7f3){_0x469481['push'](_0x469481['shift']());}};_0x54002b(++_0x2377dd);}(_0x5f7f,0x1d3));var _0xf5f7=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f7f[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0xf5f7('0x0'));var rimraf=require(_0xf5f7('0x1'));var zipdir=require(_0xf5f7('0x2'));var jsonpatch=require(_0xf5f7('0x3'));var rp=require(_0xf5f7('0x4'));var moment=require(_0xf5f7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf5f7('0x6'));var util=require(_0xf5f7('0x7'));var path=require(_0xf5f7('0x8'));var sox=require('sox');var csv=require(_0xf5f7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf5f7('0xa'));var _=require('lodash');var squel=require(_0xf5f7('0xb'));var crypto=require(_0xf5f7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf5f7('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf5f7('0xe'));var Papa=require(_0xf5f7('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf5f7('0x10'));var as=require(_0xf5f7('0x11'));var hardwareService=require(_0xf5f7('0x12'));var logger=require(_0xf5f7('0x13'))('api');var utils=require(_0xf5f7('0x14'));var config=require(_0xf5f7('0x15'));var licenseUtil=require(_0xf5f7('0x16'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2d96e2,_0x2e1c2a){_0x2e1c2a=_0x2e1c2a||0xcc;return function(_0xa94ad8){if(_0xa94ad8){return _0x2d96e2['sendStatus'](_0x2e1c2a);}return _0x2d96e2['status'](_0x2e1c2a)['end']();};}function respondWithResult(_0x414183,_0x57aca5){_0x57aca5=_0x57aca5||0xc8;return function(_0x2993a7){if(_0x2993a7){return _0x414183['status'](_0x57aca5)['json'](_0x2993a7);}};}function respondWithFilteredResult(_0x32b0ed,_0x194256){return function(_0x1f7997){if(_0x1f7997){var _0x2fb3ab=typeof _0x194256[_0xf5f7('0x17')]===_0xf5f7('0x18')&&typeof _0x194256[_0xf5f7('0x19')]==='undefined';var _0x48bb4f=_0x1f7997['count'];var _0x424b30=_0x2fb3ab?0x0:_0x194256['offset'];var _0x4e607d=_0x2fb3ab?_0x1f7997[_0xf5f7('0x1a')]:_0x194256[_0xf5f7('0x17')]+_0x194256[_0xf5f7('0x19')];var _0x4bf451;if(_0x4e607d>=_0x48bb4f){_0x4e607d=_0x48bb4f;_0x4bf451=0xc8;}else{_0x4bf451=0xce;}_0x32b0ed[_0xf5f7('0x1b')](_0x4bf451);return _0x32b0ed[_0xf5f7('0x1c')](_0xf5f7('0x1d'),_0x424b30+'-'+_0x4e607d+'/'+_0x48bb4f)[_0xf5f7('0x1e')](_0x1f7997);}return null;};}function patchUpdates(_0x239d81){return function(_0x1177f8){try{jsonpatch[_0xf5f7('0x1f')](_0x1177f8,_0x239d81,!![]);}catch(_0x4f8b91){return BPromise['reject'](_0x4f8b91);}return _0x1177f8[_0xf5f7('0x20')]();};}function saveUpdates(_0x3f7e2c,_0x277e4f){return function(_0x419389){if(_0x419389){return _0x419389['update'](_0x3f7e2c)[_0xf5f7('0x21')](function(_0x39c3f0){return _0x39c3f0;});}return null;};}function removeEntity(_0x328f22,_0x18dee2){return function(_0x38dbf8){if(_0x38dbf8){return _0x38dbf8[_0xf5f7('0x22')]()[_0xf5f7('0x21')](function(){_0x328f22[_0xf5f7('0x1b')](0xcc)[_0xf5f7('0x23')]();});}};}function handleEntityNotFound(_0x5d26ab,_0x23e5dd){return function(_0x298a6e){if(!_0x298a6e){_0x5d26ab[_0xf5f7('0x24')](0x194);}return _0x298a6e;};}function handleError(_0x16bfc3,_0x585cee){_0x585cee=_0x585cee||0x1f4;return function(_0x9817ea){logger[_0xf5f7('0x25')](_0x9817ea[_0xf5f7('0x26')]);if(_0x9817ea['name']){delete _0x9817ea[_0xf5f7('0x27')];}_0x16bfc3[_0xf5f7('0x1b')](_0x585cee)[_0xf5f7('0x28')](_0x9817ea);};}exports[_0xf5f7('0x29')]=function(_0x24a63d,_0x552898){var _0x46aef6={},_0x2640d2={},_0x1cf13c={'count':0x0,'rows':[]};var _0xce673b=_[_0xf5f7('0x2a')](db[_0xf5f7('0x2b')]['rawAttributes'],function(_0x3a1ae2){return{'name':_0x3a1ae2['fieldName'],'type':_0x3a1ae2['type']['key']};});_0x2640d2[_0xf5f7('0x2c')]=_['map'](_0xce673b,'name');_0x2640d2['query']=_[_0xf5f7('0x2d')](_0x24a63d[_0xf5f7('0x2e')]);_0x2640d2['filters']=_[_0xf5f7('0x2f')](_0x2640d2[_0xf5f7('0x2c')],_0x2640d2[_0xf5f7('0x2e')]);_0x46aef6[_0xf5f7('0x30')]=_[_0xf5f7('0x2f')](_0x2640d2[_0xf5f7('0x2c')],qs[_0xf5f7('0x31')](_0x24a63d[_0xf5f7('0x2e')][_0xf5f7('0x31')]));_0x46aef6[_0xf5f7('0x30')]=_0x46aef6[_0xf5f7('0x30')][_0xf5f7('0x32')]?_0x46aef6['attributes']:_0x2640d2[_0xf5f7('0x2c')];if(!_0x24a63d[_0xf5f7('0x2e')][_0xf5f7('0x33')](_0xf5f7('0x34'))){_0x46aef6['limit']=qs[_0xf5f7('0x19')](_0x24a63d[_0xf5f7('0x2e')][_0xf5f7('0x19')]);_0x46aef6[_0xf5f7('0x17')]=qs[_0xf5f7('0x17')](_0x24a63d[_0xf5f7('0x2e')]['offset']);}_0x46aef6[_0xf5f7('0x35')]=qs[_0xf5f7('0x36')](_0x24a63d[_0xf5f7('0x2e')][_0xf5f7('0x36')]);_0x46aef6[_0xf5f7('0x37')]=qs['filters'](_['pick'](_0x24a63d[_0xf5f7('0x2e')],_0x2640d2[_0xf5f7('0x38')]),_0xce673b);if(_0x24a63d[_0xf5f7('0x2e')][_0xf5f7('0x39')]){_0x46aef6[_0xf5f7('0x37')]=_['merge'](_0x46aef6[_0xf5f7('0x37')],{'$or':_[_0xf5f7('0x2a')](_0xce673b,function(_0x20252f){if(_0x20252f[_0xf5f7('0x3a')]!==_0xf5f7('0x3b')){var _0xd1ff1b={};_0xd1ff1b[_0x20252f[_0xf5f7('0x27')]]={'$like':'%'+_0x24a63d[_0xf5f7('0x2e')][_0xf5f7('0x39')]+'%'};return _0xd1ff1b;}})});}_0x46aef6=_[_0xf5f7('0x3c')]({},_0x46aef6,_0x24a63d[_0xf5f7('0x3d')]);var _0x5ba9ef={'where':_0x46aef6[_0xf5f7('0x37')]};return db[_0xf5f7('0x2b')][_0xf5f7('0x1a')](_0x5ba9ef)['then'](function(_0x4b20d2){_0x1cf13c[_0xf5f7('0x1a')]=_0x4b20d2;if(_0x24a63d[_0xf5f7('0x2e')]['includeAll']){_0x46aef6['include']=[{'all':!![]}];}return db[_0xf5f7('0x2b')][_0xf5f7('0x3e')](_0x46aef6);})['then'](function(_0x3839f2){_0x1cf13c[_0xf5f7('0x3f')]=_0x3839f2;return _0x1cf13c;})[_0xf5f7('0x21')](respondWithFilteredResult(_0x552898,_0x46aef6))[_0xf5f7('0x40')](handleError(_0x552898,null));};exports[_0xf5f7('0x41')]=function(_0x144196,_0x4fa760){var _0x12c47c={'raw':![],'where':{'id':_0x144196['params']['id']}},_0x1bcf69={};_0x1bcf69[_0xf5f7('0x2c')]=_[_0xf5f7('0x2d')](db[_0xf5f7('0x2b')]['rawAttributes']);_0x1bcf69[_0xf5f7('0x2e')]=_['keys'](_0x144196[_0xf5f7('0x2e')]);_0x1bcf69[_0xf5f7('0x38')]=_[_0xf5f7('0x2f')](_0x1bcf69[_0xf5f7('0x2c')],_0x1bcf69['query']);_0x12c47c['attributes']=_[_0xf5f7('0x2f')](_0x1bcf69[_0xf5f7('0x2c')],qs[_0xf5f7('0x31')](_0x144196[_0xf5f7('0x2e')]['fields']));_0x12c47c[_0xf5f7('0x30')]=_0x12c47c[_0xf5f7('0x30')][_0xf5f7('0x32')]?_0x12c47c['attributes']:_0x1bcf69[_0xf5f7('0x2c')];if(_0x144196[_0xf5f7('0x2e')][_0xf5f7('0x42')]){_0x12c47c[_0xf5f7('0x43')]=[{'all':!![]}];}_0x12c47c=_[_0xf5f7('0x3c')]({},_0x12c47c,_0x144196[_0xf5f7('0x3d')]);return db[_0xf5f7('0x2b')][_0xf5f7('0x44')](_0x12c47c)[_0xf5f7('0x21')](handleEntityNotFound(_0x4fa760,null))['then'](respondWithResult(_0x4fa760,null))[_0xf5f7('0x40')](handleError(_0x4fa760,null));};exports[_0xf5f7('0x45')]=function(_0x11d4f9,_0x828ff7){return db[_0xf5f7('0x2b')][_0xf5f7('0x45')](_0x11d4f9[_0xf5f7('0x46')],{})['then'](respondWithResult(_0x828ff7,0xc9))[_0xf5f7('0x40')](handleError(_0x828ff7,null));};exports[_0xf5f7('0x47')]=function(_0x481764,_0x1ba2e9){if(_0x481764['body']['id']){delete _0x481764[_0xf5f7('0x46')]['id'];}return db[_0xf5f7('0x2b')][_0xf5f7('0x44')]({'where':{'id':_0x481764['params']['id']}})[_0xf5f7('0x21')](handleEntityNotFound(_0x1ba2e9,null))['then'](saveUpdates(_0x481764[_0xf5f7('0x46')],null))[_0xf5f7('0x21')](respondWithResult(_0x1ba2e9,null))[_0xf5f7('0x40')](handleError(_0x1ba2e9,null));};exports[_0xf5f7('0x22')]=function(_0x149057,_0x47ed0c){return db[_0xf5f7('0x2b')][_0xf5f7('0x44')]({'where':{'id':_0x149057[_0xf5f7('0x48')]['id']}})[_0xf5f7('0x21')](handleEntityNotFound(_0x47ed0c,null))['then'](removeEntity(_0x47ed0c,null))['catch'](handleError(_0x47ed0c,null));};exports[_0xf5f7('0x49')]=function(_0x1a4865,_0x433822,_0xbbd9d1){var _0x26951f={};var _0x37b70b={};var _0x3f546a;var _0x12a0ed;return db['SugarcrmAccount']['findOne']({'where':{'id':_0x1a4865[_0xf5f7('0x48')]['id']}})[_0xf5f7('0x21')](handleEntityNotFound(_0x433822,null))[_0xf5f7('0x21')](function(_0xff0d82){if(_0xff0d82){_0x3f546a=_0xff0d82;_0x37b70b[_0xf5f7('0x2c')]=_['keys'](db[_0xf5f7('0x4a')][_0xf5f7('0x4b')]);_0x37b70b[_0xf5f7('0x2e')]=_[_0xf5f7('0x2d')](_0x1a4865['query']);_0x37b70b[_0xf5f7('0x38')]=_[_0xf5f7('0x2f')](_0x37b70b[_0xf5f7('0x2c')],_0x37b70b['query']);_0x26951f['attributes']=_['intersection'](_0x37b70b[_0xf5f7('0x2c')],qs[_0xf5f7('0x31')](_0x1a4865[_0xf5f7('0x2e')][_0xf5f7('0x31')]));_0x26951f['attributes']=_0x26951f[_0xf5f7('0x30')][_0xf5f7('0x32')]?_0x26951f[_0xf5f7('0x30')]:_0x37b70b[_0xf5f7('0x2c')];_0x26951f[_0xf5f7('0x35')]=qs['sort'](_0x1a4865['query']['sort']);_0x26951f[_0xf5f7('0x37')]=qs['filters'](_[_0xf5f7('0x4c')](_0x1a4865[_0xf5f7('0x2e')],_0x37b70b[_0xf5f7('0x38')]));if(_0x1a4865[_0xf5f7('0x2e')]['filter']){_0x26951f[_0xf5f7('0x37')]=_[_0xf5f7('0x3c')](_0x26951f['where'],{'$or':_[_0xf5f7('0x2a')](_0x26951f[_0xf5f7('0x30')],function(_0x22061b){var _0x12595f={};_0x12595f[_0x22061b]={'$like':'%'+_0x1a4865[_0xf5f7('0x2e')][_0xf5f7('0x39')]+'%'};return _0x12595f;})});}_0x26951f=_[_0xf5f7('0x3c')]({},_0x26951f,_0x1a4865[_0xf5f7('0x3d')]);return _0x3f546a[_0xf5f7('0x49')](_0x26951f);}})[_0xf5f7('0x21')](function(_0x1602e0){if(_0x1602e0){_0x12a0ed=_0x1602e0[_0xf5f7('0x32')];if(!_0x1a4865[_0xf5f7('0x2e')][_0xf5f7('0x33')](_0xf5f7('0x34'))){_0x26951f[_0xf5f7('0x19')]=qs[_0xf5f7('0x19')](_0x1a4865[_0xf5f7('0x2e')][_0xf5f7('0x19')]);_0x26951f[_0xf5f7('0x17')]=qs[_0xf5f7('0x17')](_0x1a4865[_0xf5f7('0x2e')][_0xf5f7('0x17')]);}return _0x3f546a[_0xf5f7('0x49')](_0x26951f);}})[_0xf5f7('0x21')](function(_0x4e5bb5){if(_0x4e5bb5){return _0x4e5bb5?{'count':_0x12a0ed,'rows':_0x4e5bb5}:null;}})[_0xf5f7('0x21')](respondWithResult(_0x433822,null))[_0xf5f7('0x40')](handleError(_0x433822,null));};exports['addConfiguration']=function(_0x4592e3,_0x10f2e1,_0x19d344){if(_0x4592e3[_0xf5f7('0x46')]['id']){delete _0x4592e3[_0xf5f7('0x46')]['id'];}return db[_0xf5f7('0x2b')][_0xf5f7('0x4d')]({'where':{'id':_0x4592e3['params']['id']}})[_0xf5f7('0x21')](handleEntityNotFound(_0x10f2e1,null))[_0xf5f7('0x21')](function(_0x376f98){if(_0x376f98){_0x4592e3[_0xf5f7('0x46')]['AccountId']=_0x376f98['id'];_0x4592e3[_0xf5f7('0x46')][_0xf5f7('0x4e')]=integrations['getSubjects'](_0x4592e3['body'][_0xf5f7('0x4f')],_0x4592e3['body'][_0xf5f7('0x3a')]);_0x4592e3['body'][_0xf5f7('0x50')]=integrations['getDescriptions'](_0x4592e3[_0xf5f7('0x46')]['channel'],_0x4592e3[_0xf5f7('0x46')][_0xf5f7('0x3a')]);return db[_0xf5f7('0x4a')][_0xf5f7('0x45')](_0x4592e3[_0xf5f7('0x46')],{'include':[{'model':db[_0xf5f7('0x51')],'as':'Subjects'},{'model':db[_0xf5f7('0x51')],'as':_0xf5f7('0x50')}]});}return null;})[_0xf5f7('0x21')](respondWithResult(_0x10f2e1,null))['catch'](handleError(_0x10f2e1,null));};exports[_0xf5f7('0x52')]=function(_0x2be7d4,_0x3e9930,_0x42bfc8){var _0x18b2c4='';var _0xd3ad5f=['id',_0xf5f7('0x27'),'assigned_user_id',_0xf5f7('0x53'),_0xf5f7('0x54'),_0xf5f7('0x55'),_0xf5f7('0x56'),_0xf5f7('0x57'),_0xf5f7('0x58'),_0xf5f7('0x59'),_0xf5f7('0x5a'),_0xf5f7('0x5b')];return db[_0xf5f7('0x2b')][_0xf5f7('0x4d')]({'where':{'id':_0x2be7d4[_0xf5f7('0x48')]['id']},'attributes':['id',_0xf5f7('0x5c'),_0xf5f7('0x5d'),_0xf5f7('0x5e')]})[_0xf5f7('0x21')](handleEntityNotFound(_0x3e9930,null))['then'](function(_0x1004d8){if(_0x1004d8){_0x18b2c4=_0x1004d8[_0xf5f7('0x5e')];var _0x502d90=_0x18b2c4[_0xf5f7('0x5f')](-0x1);if(_0x502d90==='/'){_0x18b2c4=_0x18b2c4[_0xf5f7('0x60')](0x0,_0x18b2c4[_0xf5f7('0x61')](_0x502d90));}return rp({'method':_0xf5f7('0x62'),'uri':util[_0xf5f7('0x63')](_0xf5f7('0x64'),_0x18b2c4,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xf5f7('0x65'),'input_type':_0xf5f7('0x66'),'response_type':_0xf5f7('0x66'),'rest_data':JSON[_0xf5f7('0x67')]({'user_auth':{'user_name':_0x1004d8[_0xf5f7('0x5c')],'password':_0x1004d8[_0xf5f7('0x5d')],'encryption':_0xf5f7('0x68')},'application':_0xf5f7('0x69')})}});}})[_0xf5f7('0x21')](function(_0x23c268){if(_0x23c268&&_0x23c268[_0xf5f7('0x27')]!==_0xf5f7('0x6a')&&_0x23c268[_0xf5f7('0x27')]!==_0xf5f7('0x6b')){return rp({'method':_0xf5f7('0x62'),'uri':util[_0xf5f7('0x63')]('%s%s',_0x18b2c4,_0xf5f7('0x6c')),'json':!![],'form':{'method':'get_module_fields','input_type':_0xf5f7('0x66'),'response_type':_0xf5f7('0x66'),'rest_data':JSON[_0xf5f7('0x67')]({'session':_0x23c268['id'],'module_name':_0xf5f7('0x6d')})}})[_0xf5f7('0x21')](function(_0x28cd40){if(_0x28cd40){var _0x455ee4=_[_0xf5f7('0x6e')](_0x28cd40[_0xf5f7('0x6f')]);_[_0xf5f7('0x70')](_0x455ee4,function(_0x5a8fe7){return _0xd3ad5f[_0xf5f7('0x71')](_0x5a8fe7[_0xf5f7('0x27')]);});return{'count':_0x455ee4[_0xf5f7('0x32')],'rows':_[_0xf5f7('0x2a')](_0x455ee4,function(_0x215ad4){return{'id':_0x215ad4[_0xf5f7('0x27')],'name':_0x215ad4[_0xf5f7('0x72')],'custom':_[_0xf5f7('0x73')](_0x215ad4[_0xf5f7('0x27')],'_c')?!![]:![],'options':_0x215ad4[_0xf5f7('0x3d')]?_['map'](_[_0xf5f7('0x6e')](_0x215ad4[_0xf5f7('0x3d')]),function(_0x21e9d9){return{'name':_0x21e9d9['value'],'value':_0x21e9d9[_0xf5f7('0x27')]};}):[]};})};}})[_0xf5f7('0x21')](respondWithResult(_0x3e9930,null))[_0xf5f7('0x40')](function(_0x19c91a){var _0x3f2a1b=_0x2be7d4[_0xf5f7('0x2e')][_0xf5f7('0x74')]?0x1f4:_0x19c91a['statusCode']||0x1f4;logger['error'](_0xf5f7('0x75'),_0xf5f7('0x52'),_0x3f2a1b,JSON[_0xf5f7('0x67')](_0x19c91a));delete _0x19c91a['name'];if(_0x3f2a1b===0x191){_0x3f2a1b=0x190;}_0x3e9930[_0xf5f7('0x1b')](_0x3f2a1b)[_0xf5f7('0x28')](_0x2be7d4['query'][_0xf5f7('0x74')]?{'message':'Wrong\x20credentials','statusCode':_0x19c91a[_0xf5f7('0x76')]}:_0x19c91a);});}else{var _0x36f172=0x1f4;_0x3e9930['status'](_0x36f172)[_0xf5f7('0x28')]({'message':_0xf5f7('0x77'),'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 b4c448d..cd0ff79 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 _0x5e9a=['path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5c956b,_0xa87d11){var _0xaff46a=function(_0x463d89){while(--_0x463d89){_0x5c956b['push'](_0x5c956b['shift']());}};_0xaff46a(++_0xa87d11);}(_0x5e9a,0x72));var _0xa5e9=function(_0x937143,_0x5b64dc){_0x937143=_0x937143-0x0;var _0x5bfeb6=_0x5e9a[_0x937143];return _0x5bfeb6;};'use strict';var _=require('lodash');var util=require(_0xa5e9('0x0'));var logger=require(_0xa5e9('0x1'))(_0xa5e9('0x2'));var moment=require(_0xa5e9('0x3'));var BPromise=require(_0xa5e9('0x4'));var rp=require(_0xa5e9('0x5'));var fs=require('fs');var path=require(_0xa5e9('0x6'));var rimraf=require(_0xa5e9('0x7'));var config=require(_0xa5e9('0x8'));var attributes=require(_0xa5e9('0x9'));var integrations=require(_0xa5e9('0xa'));module[_0xa5e9('0xb')]=function(_0x29ae50,_0x5cbc82){return _0x29ae50[_0xa5e9('0xc')](_0xa5e9('0xd'),attributes,{'tableName':_0xa5e9('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x76d5=['exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','api','moment','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0x76d5,0x19b));var _0x576d=function(_0x4c9749,_0x5bc482){_0x4c9749=_0x4c9749-0x0;var _0xbb8999=_0x76d5[_0x4c9749];return _0xbb8999;};'use strict';var _=require(_0x576d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x576d('0x1'));var moment=require(_0x576d('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x576d('0x3'));var rimraf=require(_0x576d('0x4'));var config=require(_0x576d('0x5'));var attributes=require(_0x576d('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x576d('0x7')]=function(_0x1d7f08,_0x468d8e){return _0x1d7f08[_0x576d('0x8')](_0x576d('0x9'),attributes,{'tableName':_0x576d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index da7019c..1404eac 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 _0xdfbb=['SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','map','include','model','attributes','then','ShowSugarcrmAccount','find','where','lodash','moment','randomstring','ioredis','rpc','http','request','info','SugarcrmAccount,\x20%s,\x20%s','debug'];(function(_0x496125,_0x38e301){var _0x4335a6=function(_0x42be1d){while(--_0x42be1d){_0x496125['push'](_0x496125['shift']());}};_0x4335a6(++_0x38e301);}(_0xdfbb,0x15e));var _0xbdfb=function(_0x57b6a8,_0x322419){_0x57b6a8=_0x57b6a8-0x0;var _0x6b3b83=_0xdfbb[_0x57b6a8];return _0x6b3b83;};'use strict';var _=require(_0xbdfb('0x0'));var util=require('util');var moment=require(_0xbdfb('0x1'));var BPromise=require('bluebird');var rs=require(_0xbdfb('0x2'));var fs=require('fs');var Redis=require(_0xbdfb('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbdfb('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbdfb('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x45ca20,_0x2168e6,_0x309d95){return new BPromise(function(_0x349f1f,_0x24e327){return client[_0xbdfb('0x6')](_0x45ca20,_0x309d95)['then'](function(_0x21aa44){logger[_0xbdfb('0x7')](_0xbdfb('0x8'),_0x2168e6,'request\x20sent');logger[_0xbdfb('0x9')](_0xbdfb('0xa'),_0x2168e6,'request\x20sent',JSON[_0xbdfb('0xb')](_0x21aa44));if(_0x21aa44[_0xbdfb('0xc')]){if(_0x21aa44[_0xbdfb('0xc')][_0xbdfb('0xd')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x2168e6,_0x21aa44[_0xbdfb('0xc')][_0xbdfb('0xe')]);return _0x24e327(_0x21aa44['error'][_0xbdfb('0xe')]);}logger[_0xbdfb('0xc')](_0xbdfb('0x8'),_0x2168e6,_0x21aa44[_0xbdfb('0xc')][_0xbdfb('0xe')]);return _0x349f1f(_0x21aa44[_0xbdfb('0xc')][_0xbdfb('0xe')]);}else{logger[_0xbdfb('0x7')](_0xbdfb('0x8'),_0x2168e6,_0xbdfb('0xf'));_0x349f1f(_0x21aa44['result'][_0xbdfb('0xe')]);}})[_0xbdfb('0x10')](function(_0x292e20){logger[_0xbdfb('0xc')](_0xbdfb('0x8'),_0x2168e6,_0x292e20);_0x24e327(_0x292e20);});});}exports[_0xbdfb('0x11')]=function(_0x58379f){var _0x36a5f2=this;return new Promise(function(_0x16bd65,_0x4b2f23){return db[_0xbdfb('0x12')][_0xbdfb('0x13')]({'raw':_0x58379f[_0xbdfb('0x14')]?_0x58379f['options'][_0xbdfb('0x15')]===undefined?!![]:![]:!![],'where':_0x58379f['options']?_0x58379f['options']['where']||null:null,'attributes':_0x58379f[_0xbdfb('0x14')]?_0x58379f[_0xbdfb('0x14')]['attributes']||null:null,'limit':_0x58379f[_0xbdfb('0x14')]?_0x58379f['options']['limit']||null:null,'include':_0x58379f['options']?_0x58379f['options']['include']?_[_0xbdfb('0x16')](_0x58379f[_0xbdfb('0x14')][_0xbdfb('0x17')],function(_0x309b02){return{'model':db[_0x309b02[_0xbdfb('0x18')]],'as':_0x309b02['as'],'attributes':_0x309b02['attributes'],'include':_0x309b02[_0xbdfb('0x17')]?_['map'](_0x309b02[_0xbdfb('0x17')],function(_0xb07226){return{'model':db[_0xb07226[_0xbdfb('0x18')]],'as':_0xb07226['as'],'attributes':_0xb07226[_0xbdfb('0x19')],'include':_0xb07226[_0xbdfb('0x17')]?_['map'](_0xb07226[_0xbdfb('0x17')],function(_0x404ac9){return{'model':db[_0x404ac9[_0xbdfb('0x18')]],'as':_0x404ac9['as'],'attributes':_0x404ac9[_0xbdfb('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbdfb('0x1a')](function(_0x1abd4a){logger[_0xbdfb('0x7')]('GetSugarcrmAccount',_0x58379f);logger['debug'](_0xbdfb('0x11'),_0x58379f,JSON['stringify'](_0x1abd4a));_0x16bd65(_0x1abd4a);})['catch'](function(_0x53db49){logger[_0xbdfb('0xc')]('GetSugarcrmAccount',_0x53db49['message'],_0x58379f);_0x4b2f23(_0x36a5f2[_0xbdfb('0xc')](0x1f4,_0x53db49[_0xbdfb('0xe')]));});});};exports[_0xbdfb('0x1b')]=function(_0x3230db){var _0x5761d3=this;return new Promise(function(_0x58a22d,_0xb3e22b){return db[_0xbdfb('0x12')][_0xbdfb('0x1c')]({'raw':_0x3230db[_0xbdfb('0x14')]?_0x3230db[_0xbdfb('0x14')][_0xbdfb('0x15')]===undefined?!![]:![]:!![],'where':_0x3230db[_0xbdfb('0x14')]?_0x3230db['options'][_0xbdfb('0x1d')]||null:null,'attributes':_0x3230db[_0xbdfb('0x14')]?_0x3230db['options'][_0xbdfb('0x19')]||null:null,'include':_0x3230db[_0xbdfb('0x14')]?_0x3230db[_0xbdfb('0x14')][_0xbdfb('0x17')]?_['map'](_0x3230db['options'][_0xbdfb('0x17')],function(_0x518e40){return{'model':db[_0x518e40[_0xbdfb('0x18')]],'as':_0x518e40['as'],'attributes':_0x518e40['attributes'],'include':_0x518e40[_0xbdfb('0x17')]?_[_0xbdfb('0x16')](_0x518e40[_0xbdfb('0x17')],function(_0x18246f){return{'model':db[_0x18246f[_0xbdfb('0x18')]],'as':_0x18246f['as'],'attributes':_0x18246f[_0xbdfb('0x19')],'include':_0x18246f[_0xbdfb('0x17')]?_[_0xbdfb('0x16')](_0x18246f['include'],function(_0x2235e3){return{'model':db[_0x2235e3[_0xbdfb('0x18')]],'as':_0x2235e3['as'],'attributes':_0x2235e3[_0xbdfb('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbdfb('0x1a')](function(_0x5dce70){logger['info']('ShowSugarcrmAccount',_0x3230db);logger['debug'](_0xbdfb('0x1b'),_0x3230db,JSON[_0xbdfb('0xb')](_0x5dce70));_0x58a22d(_0x5dce70);})[_0xbdfb('0x10')](function(_0xc479ba){logger[_0xbdfb('0xc')](_0xbdfb('0x1b'),_0xc479ba[_0xbdfb('0xe')],_0x3230db);_0xb3e22b(_0x5761d3['error'](0x1f4,_0xc479ba[_0xbdfb('0xe')]));});});}; \ No newline at end of file +var _0xf950=['info','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowSugarcrmAccount','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','client','http','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xf950,0x1f0));var _0x0f95=function(_0x497fe6,_0x327a82){_0x497fe6=_0x497fe6-0x0;var _0x1c7bdb=_0xf950[_0x497fe6];return _0x1c7bdb;};'use strict';var _=require(_0x0f95('0x0'));var util=require(_0x0f95('0x1'));var moment=require('moment');var BPromise=require(_0x0f95('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f95('0x3'));var db=require(_0x0f95('0x4'))['db'];var utils=require(_0x0f95('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0f95('0x6')][_0x0f95('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x203846,_0x435ca2,_0x57d5dc){return new BPromise(function(_0x58c74c,_0xb997cf){return client['request'](_0x203846,_0x57d5dc)[_0x0f95('0x8')](function(_0x13ee9c){logger['info'](_0x0f95('0x9'),_0x435ca2,_0x0f95('0xa'));logger[_0x0f95('0xb')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x435ca2,_0x0f95('0xa'),JSON[_0x0f95('0xc')](_0x13ee9c));if(_0x13ee9c[_0x0f95('0xd')]){if(_0x13ee9c[_0x0f95('0xd')][_0x0f95('0xe')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x435ca2,_0x13ee9c[_0x0f95('0xd')]['message']);return _0xb997cf(_0x13ee9c[_0x0f95('0xd')][_0x0f95('0xf')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x435ca2,_0x13ee9c[_0x0f95('0xd')][_0x0f95('0xf')]);return _0x58c74c(_0x13ee9c[_0x0f95('0xd')][_0x0f95('0xf')]);}else{logger[_0x0f95('0x10')](_0x0f95('0x9'),_0x435ca2,_0x0f95('0xa'));_0x58c74c(_0x13ee9c[_0x0f95('0x11')][_0x0f95('0xf')]);}})[_0x0f95('0x12')](function(_0x40287a){logger[_0x0f95('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x435ca2,_0x40287a);_0xb997cf(_0x40287a);});});}exports[_0x0f95('0x13')]=function(_0x218ff4){var _0x3629a6=this;return new Promise(function(_0x4afde6,_0x527d23){return db[_0x0f95('0x14')][_0x0f95('0x15')]({'raw':_0x218ff4['options']?_0x218ff4[_0x0f95('0x16')][_0x0f95('0x17')]===undefined?!![]:![]:!![],'where':_0x218ff4['options']?_0x218ff4[_0x0f95('0x16')][_0x0f95('0x18')]||null:null,'attributes':_0x218ff4[_0x0f95('0x16')]?_0x218ff4[_0x0f95('0x16')][_0x0f95('0x19')]||null:null,'limit':_0x218ff4['options']?_0x218ff4[_0x0f95('0x16')][_0x0f95('0x1a')]||null:null,'include':_0x218ff4[_0x0f95('0x16')]?_0x218ff4[_0x0f95('0x16')][_0x0f95('0x1b')]?_[_0x0f95('0x1c')](_0x218ff4['options'][_0x0f95('0x1b')],function(_0x366202){return{'model':db[_0x366202[_0x0f95('0x1d')]],'as':_0x366202['as'],'attributes':_0x366202[_0x0f95('0x19')],'include':_0x366202['include']?_[_0x0f95('0x1c')](_0x366202['include'],function(_0x515aa8){return{'model':db[_0x515aa8[_0x0f95('0x1d')]],'as':_0x515aa8['as'],'attributes':_0x515aa8[_0x0f95('0x19')],'include':_0x515aa8[_0x0f95('0x1b')]?_[_0x0f95('0x1c')](_0x515aa8[_0x0f95('0x1b')],function(_0x3d522a){return{'model':db[_0x3d522a['model']],'as':_0x3d522a['as'],'attributes':_0x3d522a[_0x0f95('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0f95('0x8')](function(_0x27db74){logger[_0x0f95('0x10')]('GetSugarcrmAccount',_0x218ff4);logger[_0x0f95('0xb')](_0x0f95('0x13'),_0x218ff4,JSON['stringify'](_0x27db74));_0x4afde6(_0x27db74);})[_0x0f95('0x12')](function(_0x455de9){logger['error'](_0x0f95('0x13'),_0x455de9['message'],_0x218ff4);_0x527d23(_0x3629a6[_0x0f95('0xd')](0x1f4,_0x455de9['message']));});});};exports[_0x0f95('0x1e')]=function(_0x3d2f04){var _0x34da41=this;return new Promise(function(_0x351b77,_0x301f4d){return db['SugarcrmAccount'][_0x0f95('0x1f')]({'raw':_0x3d2f04['options']?_0x3d2f04[_0x0f95('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3d2f04[_0x0f95('0x16')]?_0x3d2f04[_0x0f95('0x16')]['where']||null:null,'attributes':_0x3d2f04[_0x0f95('0x16')]?_0x3d2f04['options'][_0x0f95('0x19')]||null:null,'include':_0x3d2f04[_0x0f95('0x16')]?_0x3d2f04['options'][_0x0f95('0x1b')]?_[_0x0f95('0x1c')](_0x3d2f04[_0x0f95('0x16')][_0x0f95('0x1b')],function(_0x514f57){return{'model':db[_0x514f57[_0x0f95('0x1d')]],'as':_0x514f57['as'],'attributes':_0x514f57[_0x0f95('0x19')],'include':_0x514f57['include']?_['map'](_0x514f57[_0x0f95('0x1b')],function(_0x5d1b73){return{'model':db[_0x5d1b73[_0x0f95('0x1d')]],'as':_0x5d1b73['as'],'attributes':_0x5d1b73[_0x0f95('0x19')],'include':_0x5d1b73[_0x0f95('0x1b')]?_[_0x0f95('0x1c')](_0x5d1b73[_0x0f95('0x1b')],function(_0x597524){return{'model':db[_0x597524[_0x0f95('0x1d')]],'as':_0x597524['as'],'attributes':_0x597524['attributes']};}):[]};}):[]};}):[]:[]})[_0x0f95('0x8')](function(_0x525cf7){logger['info'](_0x0f95('0x1e'),_0x3d2f04);logger[_0x0f95('0xb')]('ShowSugarcrmAccount',_0x3d2f04,JSON['stringify'](_0x525cf7));_0x351b77(_0x525cf7);})['catch'](function(_0xe5180d){logger[_0x0f95('0xd')](_0x0f95('0x1e'),_0xe5180d[_0x0f95('0xf')],_0x3d2f04);_0x301f4d(_0x34da41[_0x0f95('0xd')](0x1f4,_0xe5180d[_0x0f95('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 6d45284..7e545d4 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 _0xe761=['destroy','exports','multer','path','connect-timeout','Router','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','delete'];(function(_0x29c1d9,_0x2d2360){var _0x177cf7=function(_0x553682){while(--_0x553682){_0x29c1d9['push'](_0x29c1d9['shift']());}};_0x177cf7(++_0x2d2360);}(_0xe761,0x162));var _0x1e76=function(_0x256684,_0x529c1e){_0x256684=_0x256684-0x0;var _0x37a0c9=_0xe761[_0x256684];return _0x37a0c9;};'use strict';var multer=require(_0x1e76('0x0'));var util=require('util');var path=require(_0x1e76('0x1'));var timeout=require(_0x1e76('0x2'));var express=require('express');var router=express[_0x1e76('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1e76('0x4'));var config=require('../../config/environment');var controller=require(_0x1e76('0x5'));router[_0x1e76('0x6')]('/',auth[_0x1e76('0x7')](),controller['index']);router[_0x1e76('0x6')](_0x1e76('0x8'),auth[_0x1e76('0x7')](),controller[_0x1e76('0x9')]);router['get'](_0x1e76('0xa'),auth[_0x1e76('0x7')](),controller[_0x1e76('0xb')]);router[_0x1e76('0x6')](_0x1e76('0xc'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x1e76('0x6')](_0x1e76('0xd'),auth['isAuthenticated'](),controller[_0x1e76('0xe')]);router[_0x1e76('0xf')]('/',auth['isAuthenticated'](),controller[_0x1e76('0x10')]);router[_0x1e76('0x11')](_0x1e76('0x8'),auth[_0x1e76('0x7')](),controller[_0x1e76('0x12')]);router[_0x1e76('0x13')](_0x1e76('0x8'),auth[_0x1e76('0x7')](),controller[_0x1e76('0x14')]);module[_0x1e76('0x15')]=router; \ No newline at end of file +var _0x175e=['create','put','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x2399b1,_0x4daff9){var _0x5f1404=function(_0x54f088){while(--_0x54f088){_0x2399b1['push'](_0x2399b1['shift']());}};_0x5f1404(++_0x4daff9);}(_0x175e,0x1b4));var _0xe175=function(_0x306860,_0x504443){_0x306860=_0x306860-0x0;var _0xa0d46f=_0x175e[_0x306860];return _0xa0d46f;};'use strict';var multer=require('multer');var util=require(_0xe175('0x0'));var path=require(_0xe175('0x1'));var timeout=require(_0xe175('0x2'));var express=require(_0xe175('0x3'));var router=express[_0xe175('0x4')]();var fs_extra=require(_0xe175('0x5'));var auth=require(_0xe175('0x6'));var interaction=require(_0xe175('0x7'));var config=require(_0xe175('0x8'));var controller=require('./intSugarcrmConfiguration.controller');router[_0xe175('0x9')]('/',auth[_0xe175('0xa')](),controller[_0xe175('0xb')]);router[_0xe175('0x9')](_0xe175('0xc'),auth[_0xe175('0xa')](),controller[_0xe175('0xd')]);router['get'](_0xe175('0xe'),auth[_0xe175('0xa')](),controller['getFields']);router[_0xe175('0x9')](_0xe175('0xf'),auth[_0xe175('0xa')](),controller[_0xe175('0x10')]);router['get'](_0xe175('0x11'),auth['isAuthenticated'](),controller[_0xe175('0x12')]);router[_0xe175('0x13')]('/',auth[_0xe175('0xa')](),controller[_0xe175('0x14')]);router[_0xe175('0x15')](_0xe175('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe175('0xc'),auth[_0xe175('0xa')](),controller[_0xe175('0x16')]);module[_0xe175('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 44d5e61..bf55507 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 _0xaee4=['sequelize','STRING'];(function(_0x67cca1,_0x25e38){var _0x43e25e=function(_0x1362dd){while(--_0x1362dd){_0x67cca1['push'](_0x67cca1['shift']());}};_0x43e25e(++_0x25e38);}(_0xaee4,0x124));var _0x4aee=function(_0x5b1d42,_0x41c592){_0x5b1d42=_0x5b1d42-0x0;var _0x4ca9fd=_0xaee4[_0x5b1d42];return _0x4ca9fd;};'use strict';var Sequelize=require(_0x4aee('0x0'));module['exports']={'name':{'type':Sequelize[_0x4aee('0x1')]},'description':{'type':Sequelize[_0x4aee('0x1')]}}; \ No newline at end of file +var _0xff2f=['sequelize','exports','STRING'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xff2f,0x1b3));var _0xfff2=function(_0x59d692,_0x637365){_0x59d692=_0x59d692-0x0;var _0x13316a=_0xff2f[_0x59d692];return _0x13316a;};'use strict';var Sequelize=require(_0xfff2('0x0'));module[_0xfff2('0x1')]={'name':{'type':Sequelize[_0xfff2('0x2')]},'description':{'type':Sequelize[_0xfff2('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 34cd65a..efc0c60 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 _0x929b=['map','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','rawAttributes','find','create','body','getFields','findOne','hasOwnProperty','getSubjects','SugarcrmField','getDescriptions','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','name','send','index','SugarcrmConfiguration','type','key','model'];(function(_0x5ca947,_0x47b6ca){var _0x34ce03=function(_0x1b5049){while(--_0x1b5049){_0x5ca947['push'](_0x5ca947['shift']());}};_0x34ce03(++_0x47b6ca);}(_0x929b,0x70));var _0xb929=function(_0x239632,_0x472e6a){_0x239632=_0x239632-0x0;var _0x2fad25=_0x929b[_0x239632];return _0x2fad25;};'use strict';var emlformat=require(_0xb929('0x0'));var rimraf=require(_0xb929('0x1'));var zipdir=require(_0xb929('0x2'));var jsonpatch=require(_0xb929('0x3'));var rp=require(_0xb929('0x4'));var moment=require('moment');var BPromise=require(_0xb929('0x5'));var Mustache=require(_0xb929('0x6'));var util=require(_0xb929('0x7'));var path=require(_0xb929('0x8'));var sox=require(_0xb929('0x9'));var csv=require(_0xb929('0xa'));var ejs=require(_0xb929('0xb'));var fs=require('fs');var fs_extra=require(_0xb929('0xc'));var _=require('lodash');var squel=require(_0xb929('0xd'));var crypto=require(_0xb929('0xe'));var jsforce=require(_0xb929('0xf'));var deskjs=require(_0xb929('0x10'));var toCsv=require(_0xb929('0xa'));var querystring=require(_0xb929('0x11'));var Papa=require(_0xb929('0x12'));var Redis=require(_0xb929('0x13'));var authService=require(_0xb929('0x14'));var qs=require(_0xb929('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb929('0x16'));var config=require(_0xb929('0x17'));var licenseUtil=require(_0xb929('0x18'));var db=require(_0xb929('0x19'))['db'];function respondWithStatusCode(_0x54674d,_0x4aeed3){_0x4aeed3=_0x4aeed3||0xcc;return function(_0x5f0c9b){if(_0x5f0c9b){return _0x54674d[_0xb929('0x1a')](_0x4aeed3);}return _0x54674d[_0xb929('0x1b')](_0x4aeed3)[_0xb929('0x1c')]();};}function respondWithResult(_0x2b52b6,_0x4df402){_0x4df402=_0x4df402||0xc8;return function(_0x15ca8e){if(_0x15ca8e){return _0x2b52b6[_0xb929('0x1b')](_0x4df402)[_0xb929('0x1d')](_0x15ca8e);}};}function respondWithFilteredResult(_0x1b0840,_0x29cb02){return function(_0x1c728a){if(_0x1c728a){var _0x44f715=typeof _0x29cb02['offset']===_0xb929('0x1e')&&typeof _0x29cb02[_0xb929('0x1f')]===_0xb929('0x1e');var _0x48e62b=_0x1c728a[_0xb929('0x20')];var _0x5b679a=_0x44f715?0x0:_0x29cb02[_0xb929('0x21')];var _0x29486e=_0x44f715?_0x1c728a[_0xb929('0x20')]:_0x29cb02[_0xb929('0x21')]+_0x29cb02[_0xb929('0x1f')];var _0x2e8198;if(_0x29486e>=_0x48e62b){_0x29486e=_0x48e62b;_0x2e8198=0xc8;}else{_0x2e8198=0xce;}_0x1b0840[_0xb929('0x1b')](_0x2e8198);return _0x1b0840[_0xb929('0x22')](_0xb929('0x23'),_0x5b679a+'-'+_0x29486e+'/'+_0x48e62b)[_0xb929('0x1d')](_0x1c728a);}return null;};}function patchUpdates(_0x31e8a5){return function(_0x4aa58d){try{jsonpatch[_0xb929('0x24')](_0x4aa58d,_0x31e8a5,!![]);}catch(_0x418aaf){return BPromise[_0xb929('0x25')](_0x418aaf);}return _0x4aa58d[_0xb929('0x26')]();};}function saveUpdates(_0xd58985,_0x3cb399){return function(_0x12e2bb){if(_0x12e2bb){return _0x12e2bb['update'](_0xd58985)['then'](function(_0x51ead1){return _0x51ead1;});}return null;};}function removeEntity(_0x3d3442,_0x108540){return function(_0x3c8cd6){if(_0x3c8cd6){return _0x3c8cd6[_0xb929('0x27')]()[_0xb929('0x28')](function(){_0x3d3442[_0xb929('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e2b54,_0x45513b){return function(_0x2d92a6){if(!_0x2d92a6){_0x2e2b54['sendStatus'](0x194);}return _0x2d92a6;};}function handleError(_0x576943,_0x20c302){_0x20c302=_0x20c302||0x1f4;return function(_0x3ff3f2){logger['error'](_0x3ff3f2['stack']);if(_0x3ff3f2['name']){delete _0x3ff3f2[_0xb929('0x29')];}_0x576943['status'](_0x20c302)[_0xb929('0x2a')](_0x3ff3f2);};}exports[_0xb929('0x2b')]=function(_0x589ef5,_0xd2cbd4){var _0x2990cf={},_0x2479a8={},_0x466a5b={'count':0x0,'rows':[]};var _0x50583f=_['map'](db[_0xb929('0x2c')]['rawAttributes'],function(_0x5cebc6){return{'name':_0x5cebc6['fieldName'],'type':_0x5cebc6[_0xb929('0x2d')][_0xb929('0x2e')]};});_0x2479a8[_0xb929('0x2f')]=_[_0xb929('0x30')](_0x50583f,_0xb929('0x29'));_0x2479a8[_0xb929('0x31')]=_[_0xb929('0x32')](_0x589ef5[_0xb929('0x31')]);_0x2479a8[_0xb929('0x33')]=_['intersection'](_0x2479a8['model'],_0x2479a8[_0xb929('0x31')]);_0x2990cf[_0xb929('0x34')]=_[_0xb929('0x35')](_0x2479a8['model'],qs[_0xb929('0x36')](_0x589ef5[_0xb929('0x31')][_0xb929('0x36')]));_0x2990cf[_0xb929('0x34')]=_0x2990cf[_0xb929('0x34')][_0xb929('0x37')]?_0x2990cf[_0xb929('0x34')]:_0x2479a8[_0xb929('0x2f')];if(!_0x589ef5[_0xb929('0x31')]['hasOwnProperty']('nolimit')){_0x2990cf[_0xb929('0x1f')]=qs[_0xb929('0x1f')](_0x589ef5[_0xb929('0x31')][_0xb929('0x1f')]);_0x2990cf['offset']=qs[_0xb929('0x21')](_0x589ef5[_0xb929('0x31')][_0xb929('0x21')]);}_0x2990cf[_0xb929('0x38')]=qs[_0xb929('0x39')](_0x589ef5[_0xb929('0x31')][_0xb929('0x39')]);_0x2990cf[_0xb929('0x3a')]=qs[_0xb929('0x33')](_[_0xb929('0x3b')](_0x589ef5[_0xb929('0x31')],_0x2479a8[_0xb929('0x33')]),_0x50583f);if(_0x589ef5[_0xb929('0x31')][_0xb929('0x3c')]){_0x2990cf[_0xb929('0x3a')]=_[_0xb929('0x3d')](_0x2990cf[_0xb929('0x3a')],{'$or':_['map'](_0x50583f,function(_0x173755){if(_0x173755[_0xb929('0x2d')]!==_0xb929('0x3e')){var _0x37e35d={};_0x37e35d[_0x173755[_0xb929('0x29')]]={'$like':'%'+_0x589ef5[_0xb929('0x31')][_0xb929('0x3c')]+'%'};return _0x37e35d;}})});}_0x2990cf=_[_0xb929('0x3d')]({},_0x2990cf,_0x589ef5[_0xb929('0x3f')]);var _0x254b44={'where':_0x2990cf[_0xb929('0x3a')]};return db[_0xb929('0x2c')][_0xb929('0x20')](_0x254b44)[_0xb929('0x28')](function(_0x57f9db){_0x466a5b[_0xb929('0x20')]=_0x57f9db;if(_0x589ef5[_0xb929('0x31')][_0xb929('0x40')]){_0x2990cf[_0xb929('0x41')]=[{'all':!![]}];}return db[_0xb929('0x2c')]['findAll'](_0x2990cf);})[_0xb929('0x28')](function(_0x315b5c){_0x466a5b['rows']=_0x315b5c;return _0x466a5b;})[_0xb929('0x28')](respondWithFilteredResult(_0xd2cbd4,_0x2990cf))[_0xb929('0x42')](handleError(_0xd2cbd4,null));};exports[_0xb929('0x43')]=function(_0x2a4aba,_0xbfb579){var _0x4d1e3b={'raw':![],'where':{'id':_0x2a4aba[_0xb929('0x44')]['id']}},_0x54506a={};_0x54506a['model']=_[_0xb929('0x32')](db[_0xb929('0x2c')][_0xb929('0x45')]);_0x54506a[_0xb929('0x31')]=_[_0xb929('0x32')](_0x2a4aba[_0xb929('0x31')]);_0x54506a['filters']=_[_0xb929('0x35')](_0x54506a[_0xb929('0x2f')],_0x54506a[_0xb929('0x31')]);_0x4d1e3b[_0xb929('0x34')]=_['intersection'](_0x54506a[_0xb929('0x2f')],qs[_0xb929('0x36')](_0x2a4aba[_0xb929('0x31')][_0xb929('0x36')]));_0x4d1e3b['attributes']=_0x4d1e3b[_0xb929('0x34')][_0xb929('0x37')]?_0x4d1e3b['attributes']:_0x54506a[_0xb929('0x2f')];if(_0x2a4aba[_0xb929('0x31')][_0xb929('0x40')]){_0x4d1e3b[_0xb929('0x41')]=[{'all':!![]}];}_0x4d1e3b=_['merge']({},_0x4d1e3b,_0x2a4aba[_0xb929('0x3f')]);return db[_0xb929('0x2c')][_0xb929('0x46')](_0x4d1e3b)['then'](handleEntityNotFound(_0xbfb579,null))[_0xb929('0x28')](respondWithResult(_0xbfb579,null))[_0xb929('0x42')](handleError(_0xbfb579,null));};exports['create']=function(_0x21f2a1,_0x30b481){return db['SugarcrmConfiguration'][_0xb929('0x47')](_0x21f2a1[_0xb929('0x48')],{})[_0xb929('0x28')](respondWithResult(_0x30b481,0xc9))[_0xb929('0x42')](handleError(_0x30b481,null));};exports['update']=function(_0x311c6f,_0x256797){if(_0x311c6f[_0xb929('0x48')]['id']){delete _0x311c6f['body']['id'];}return db[_0xb929('0x2c')]['find']({'where':{'id':_0x311c6f[_0xb929('0x44')]['id']}})[_0xb929('0x28')](handleEntityNotFound(_0x256797,null))[_0xb929('0x28')](saveUpdates(_0x311c6f[_0xb929('0x48')],null))[_0xb929('0x28')](respondWithResult(_0x256797,null))[_0xb929('0x42')](handleError(_0x256797,null));};exports[_0xb929('0x27')]=function(_0x39486f,_0x1ac2be){return db['SugarcrmConfiguration'][_0xb929('0x46')]({'where':{'id':_0x39486f[_0xb929('0x44')]['id']}})[_0xb929('0x28')](handleEntityNotFound(_0x1ac2be,null))[_0xb929('0x28')](removeEntity(_0x1ac2be,null))[_0xb929('0x42')](handleError(_0x1ac2be,null));};exports[_0xb929('0x49')]=function(_0x5ef1f7,_0x27486a,_0x51852b){var _0x38d752={};var _0x196aae={};var _0x248555;var _0xd6e1de;return db['SugarcrmConfiguration'][_0xb929('0x4a')]({'where':{'id':_0x5ef1f7[_0xb929('0x44')]['id']}})[_0xb929('0x28')](handleEntityNotFound(_0x27486a,null))[_0xb929('0x28')](function(_0x448664){if(_0x448664){_0x248555=_0x448664;_0x196aae[_0xb929('0x2f')]=_[_0xb929('0x32')](db['SugarcrmField'][_0xb929('0x45')]);_0x196aae[_0xb929('0x31')]=_[_0xb929('0x32')](_0x5ef1f7[_0xb929('0x31')]);_0x196aae[_0xb929('0x33')]=_[_0xb929('0x35')](_0x196aae[_0xb929('0x2f')],_0x196aae[_0xb929('0x31')]);_0x38d752['attributes']=_[_0xb929('0x35')](_0x196aae['model'],qs[_0xb929('0x36')](_0x5ef1f7[_0xb929('0x31')][_0xb929('0x36')]));_0x38d752[_0xb929('0x34')]=_0x38d752['attributes'][_0xb929('0x37')]?_0x38d752[_0xb929('0x34')]:_0x196aae[_0xb929('0x2f')];_0x38d752[_0xb929('0x38')]=qs[_0xb929('0x39')](_0x5ef1f7[_0xb929('0x31')]['sort']);_0x38d752[_0xb929('0x3a')]=qs['filters'](_[_0xb929('0x3b')](_0x5ef1f7[_0xb929('0x31')],_0x196aae['filters']));if(_0x5ef1f7['query'][_0xb929('0x3c')]){_0x38d752['where']=_[_0xb929('0x3d')](_0x38d752[_0xb929('0x3a')],{'$or':_[_0xb929('0x30')](_0x38d752[_0xb929('0x34')],function(_0x411590){var _0x5a5222={};_0x5a5222[_0x411590]={'$like':'%'+_0x5ef1f7['query']['filter']+'%'};return _0x5a5222;})});}_0x38d752=_[_0xb929('0x3d')]({},_0x38d752,_0x5ef1f7['options']);return _0x248555[_0xb929('0x49')](_0x38d752);}})[_0xb929('0x28')](function(_0x305f59){if(_0x305f59){_0xd6e1de=_0x305f59[_0xb929('0x37')];if(!_0x5ef1f7['query'][_0xb929('0x4b')]('nolimit')){_0x38d752[_0xb929('0x1f')]=qs[_0xb929('0x1f')](_0x5ef1f7['query']['limit']);_0x38d752[_0xb929('0x21')]=qs[_0xb929('0x21')](_0x5ef1f7['query']['offset']);}return _0x248555[_0xb929('0x49')](_0x38d752);}})['then'](function(_0x452caf){if(_0x452caf){return _0x452caf?{'count':_0xd6e1de,'rows':_0x452caf}:null;}})[_0xb929('0x28')](respondWithResult(_0x27486a,null))[_0xb929('0x42')](handleError(_0x27486a,null));};exports[_0xb929('0x4c')]=function(_0x566d30,_0xf65cf2,_0x50974c){var _0x3dffba={};var _0x1f4221={};var _0xdadf2d;var _0x1e6522;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x566d30[_0xb929('0x44')]['id']}})[_0xb929('0x28')](handleEntityNotFound(_0xf65cf2,null))['then'](function(_0x440c8a){if(_0x440c8a){_0xdadf2d=_0x440c8a;_0x1f4221[_0xb929('0x2f')]=_[_0xb929('0x32')](db[_0xb929('0x4d')][_0xb929('0x45')]);_0x1f4221[_0xb929('0x31')]=_[_0xb929('0x32')](_0x566d30[_0xb929('0x31')]);_0x1f4221['filters']=_[_0xb929('0x35')](_0x1f4221[_0xb929('0x2f')],_0x1f4221[_0xb929('0x31')]);_0x3dffba['attributes']=_['intersection'](_0x1f4221[_0xb929('0x2f')],qs[_0xb929('0x36')](_0x566d30[_0xb929('0x31')][_0xb929('0x36')]));_0x3dffba[_0xb929('0x34')]=_0x3dffba[_0xb929('0x34')][_0xb929('0x37')]?_0x3dffba[_0xb929('0x34')]:_0x1f4221[_0xb929('0x2f')];_0x3dffba[_0xb929('0x38')]=qs[_0xb929('0x39')](_0x566d30[_0xb929('0x31')][_0xb929('0x39')]);_0x3dffba[_0xb929('0x3a')]=qs[_0xb929('0x33')](_[_0xb929('0x3b')](_0x566d30[_0xb929('0x31')],_0x1f4221[_0xb929('0x33')]));if(_0x566d30[_0xb929('0x31')][_0xb929('0x3c')]){_0x3dffba[_0xb929('0x3a')]=_['merge'](_0x3dffba[_0xb929('0x3a')],{'$or':_[_0xb929('0x30')](_0x3dffba['attributes'],function(_0x2a92b9){var _0x4e9ad8={};_0x4e9ad8[_0x2a92b9]={'$like':'%'+_0x566d30[_0xb929('0x31')][_0xb929('0x3c')]+'%'};return _0x4e9ad8;})});}_0x3dffba=_[_0xb929('0x3d')]({},_0x3dffba,_0x566d30[_0xb929('0x3f')]);return _0xdadf2d[_0xb929('0x4c')](_0x3dffba);}})[_0xb929('0x28')](function(_0x248785){if(_0x248785){_0x1e6522=_0x248785[_0xb929('0x37')];if(!_0x566d30[_0xb929('0x31')][_0xb929('0x4b')]('nolimit')){_0x3dffba[_0xb929('0x1f')]=qs[_0xb929('0x1f')](_0x566d30[_0xb929('0x31')]['limit']);_0x3dffba['offset']=qs[_0xb929('0x21')](_0x566d30[_0xb929('0x31')][_0xb929('0x21')]);}return _0xdadf2d[_0xb929('0x4c')](_0x3dffba);}})['then'](function(_0x3ac203){if(_0x3ac203){return _0x3ac203?{'count':_0x1e6522,'rows':_0x3ac203}:null;}})[_0xb929('0x28')](respondWithResult(_0xf65cf2,null))[_0xb929('0x42')](handleError(_0xf65cf2,null));};exports[_0xb929('0x4e')]=function(_0x4cbade,_0x58c52b,_0x16f1de){var _0x31b9f8={};var _0x5f2b13={};var _0x16156e;var _0x7ad6bf;return db[_0xb929('0x2c')][_0xb929('0x4a')]({'where':{'id':_0x4cbade[_0xb929('0x44')]['id']}})[_0xb929('0x28')](handleEntityNotFound(_0x58c52b,null))['then'](function(_0x559bc5){if(_0x559bc5){_0x16156e=_0x559bc5;_0x5f2b13[_0xb929('0x2f')]=_[_0xb929('0x32')](db['SugarcrmField'][_0xb929('0x45')]);_0x5f2b13[_0xb929('0x31')]=_[_0xb929('0x32')](_0x4cbade['query']);_0x5f2b13[_0xb929('0x33')]=_[_0xb929('0x35')](_0x5f2b13[_0xb929('0x2f')],_0x5f2b13['query']);_0x31b9f8[_0xb929('0x34')]=_[_0xb929('0x35')](_0x5f2b13['model'],qs[_0xb929('0x36')](_0x4cbade[_0xb929('0x31')][_0xb929('0x36')]));_0x31b9f8[_0xb929('0x34')]=_0x31b9f8[_0xb929('0x34')]['length']?_0x31b9f8[_0xb929('0x34')]:_0x5f2b13['model'];_0x31b9f8['order']=qs[_0xb929('0x39')](_0x4cbade['query'][_0xb929('0x39')]);_0x31b9f8['where']=qs[_0xb929('0x33')](_['pick'](_0x4cbade['query'],_0x5f2b13[_0xb929('0x33')]));if(_0x4cbade[_0xb929('0x31')]['filter']){_0x31b9f8[_0xb929('0x3a')]=_[_0xb929('0x3d')](_0x31b9f8[_0xb929('0x3a')],{'$or':_[_0xb929('0x30')](_0x31b9f8['attributes'],function(_0x9bc9c6){var _0x115f57={};_0x115f57[_0x9bc9c6]={'$like':'%'+_0x4cbade[_0xb929('0x31')][_0xb929('0x3c')]+'%'};return _0x115f57;})});}_0x31b9f8=_[_0xb929('0x3d')]({},_0x31b9f8,_0x4cbade['options']);return _0x16156e['getDescriptions'](_0x31b9f8);}})[_0xb929('0x28')](function(_0x24989b){if(_0x24989b){_0x7ad6bf=_0x24989b[_0xb929('0x37')];if(!_0x4cbade[_0xb929('0x31')][_0xb929('0x4b')](_0xb929('0x4f'))){_0x31b9f8[_0xb929('0x1f')]=qs['limit'](_0x4cbade['query'][_0xb929('0x1f')]);_0x31b9f8[_0xb929('0x21')]=qs[_0xb929('0x21')](_0x4cbade[_0xb929('0x31')][_0xb929('0x21')]);}return _0x16156e[_0xb929('0x4e')](_0x31b9f8);}})[_0xb929('0x28')](function(_0x12b27c){if(_0x12b27c){return _0x12b27c?{'count':_0x7ad6bf,'rows':_0x12b27c}:null;}})[_0xb929('0x28')](respondWithResult(_0x58c52b,null))[_0xb929('0x42')](handleError(_0x58c52b,null));}; \ No newline at end of file +var _0x7065=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','save','then','error','name','send','index','SugarcrmConfiguration','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','catch','update','body','getFields','findOne','getSubjects','SugarcrmField','nolimit','getDescriptions','zip-dir','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x54dc05,_0x2b6f1f){var _0xc92f99=function(_0x11d4b0){while(--_0x11d4b0){_0x54dc05['push'](_0x54dc05['shift']());}};_0xc92f99(++_0x2b6f1f);}(_0x7065,0x1c7));var _0x5706=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7065[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5706('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5706('0x1'));var BPromise=require(_0x5706('0x2'));var Mustache=require(_0x5706('0x3'));var util=require(_0x5706('0x4'));var path=require('path');var sox=require(_0x5706('0x5'));var csv=require('to-csv');var ejs=require(_0x5706('0x6'));var fs=require('fs');var fs_extra=require(_0x5706('0x7'));var _=require(_0x5706('0x8'));var squel=require(_0x5706('0x9'));var crypto=require(_0x5706('0xa'));var jsforce=require(_0x5706('0xb'));var deskjs=require(_0x5706('0xc'));var toCsv=require(_0x5706('0xd'));var querystring=require(_0x5706('0xe'));var Papa=require('papaparse');var Redis=require(_0x5706('0xf'));var authService=require(_0x5706('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5706('0x11'));var hardwareService=require(_0x5706('0x12'));var logger=require(_0x5706('0x13'))(_0x5706('0x14'));var utils=require(_0x5706('0x15'));var config=require(_0x5706('0x16'));var licenseUtil=require(_0x5706('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12e1e8,_0x1f6077){_0x1f6077=_0x1f6077||0xcc;return function(_0x1e8bd9){if(_0x1e8bd9){return _0x12e1e8[_0x5706('0x18')](_0x1f6077);}return _0x12e1e8[_0x5706('0x19')](_0x1f6077)[_0x5706('0x1a')]();};}function respondWithResult(_0x13e6ac,_0x96ef3c){_0x96ef3c=_0x96ef3c||0xc8;return function(_0x561abf){if(_0x561abf){return _0x13e6ac['status'](_0x96ef3c)['json'](_0x561abf);}};}function respondWithFilteredResult(_0x339429,_0x3070b8){return function(_0x27f939){if(_0x27f939){var _0x480e2f=typeof _0x3070b8[_0x5706('0x1b')]===_0x5706('0x1c')&&typeof _0x3070b8['limit']===_0x5706('0x1c');var _0x5765c3=_0x27f939[_0x5706('0x1d')];var _0x367f66=_0x480e2f?0x0:_0x3070b8[_0x5706('0x1b')];var _0x48b04f=_0x480e2f?_0x27f939[_0x5706('0x1d')]:_0x3070b8[_0x5706('0x1b')]+_0x3070b8['limit'];var _0x2370d6;if(_0x48b04f>=_0x5765c3){_0x48b04f=_0x5765c3;_0x2370d6=0xc8;}else{_0x2370d6=0xce;}_0x339429[_0x5706('0x19')](_0x2370d6);return _0x339429['set'](_0x5706('0x1e'),_0x367f66+'-'+_0x48b04f+'/'+_0x5765c3)[_0x5706('0x1f')](_0x27f939);}return null;};}function patchUpdates(_0x3e91dd){return function(_0x2f6142){try{jsonpatch[_0x5706('0x20')](_0x2f6142,_0x3e91dd,!![]);}catch(_0x55899f){return BPromise['reject'](_0x55899f);}return _0x2f6142[_0x5706('0x21')]();};}function saveUpdates(_0x413e80,_0x3d662e){return function(_0x5df464){if(_0x5df464){return _0x5df464['update'](_0x413e80)[_0x5706('0x22')](function(_0x5d3fae){return _0x5d3fae;});}return null;};}function removeEntity(_0x2f91cf,_0x374462){return function(_0x1546cf){if(_0x1546cf){return _0x1546cf['destroy']()['then'](function(){_0x2f91cf[_0x5706('0x19')](0xcc)[_0x5706('0x1a')]();});}};}function handleEntityNotFound(_0x46af48,_0x25a9b8){return function(_0x21fc9f){if(!_0x21fc9f){_0x46af48[_0x5706('0x18')](0x194);}return _0x21fc9f;};}function handleError(_0x29d875,_0x574149){_0x574149=_0x574149||0x1f4;return function(_0x33a774){logger[_0x5706('0x23')](_0x33a774['stack']);if(_0x33a774[_0x5706('0x24')]){delete _0x33a774[_0x5706('0x24')];}_0x29d875['status'](_0x574149)[_0x5706('0x25')](_0x33a774);};}exports[_0x5706('0x26')]=function(_0x17a630,_0x926238){var _0x1806df={},_0x4feb80={},_0x541e24={'count':0x0,'rows':[]};var _0x12ffb6=_['map'](db[_0x5706('0x27')]['rawAttributes'],function(_0x4ac8df){return{'name':_0x4ac8df[_0x5706('0x28')],'type':_0x4ac8df[_0x5706('0x29')]['key']};});_0x4feb80[_0x5706('0x2a')]=_[_0x5706('0x2b')](_0x12ffb6,_0x5706('0x24'));_0x4feb80[_0x5706('0x2c')]=_[_0x5706('0x2d')](_0x17a630[_0x5706('0x2c')]);_0x4feb80[_0x5706('0x2e')]=_[_0x5706('0x2f')](_0x4feb80[_0x5706('0x2a')],_0x4feb80[_0x5706('0x2c')]);_0x1806df[_0x5706('0x30')]=_[_0x5706('0x2f')](_0x4feb80[_0x5706('0x2a')],qs['fields'](_0x17a630['query'][_0x5706('0x31')]));_0x1806df[_0x5706('0x30')]=_0x1806df[_0x5706('0x30')][_0x5706('0x32')]?_0x1806df[_0x5706('0x30')]:_0x4feb80[_0x5706('0x2a')];if(!_0x17a630['query'][_0x5706('0x33')]('nolimit')){_0x1806df['limit']=qs[_0x5706('0x34')](_0x17a630[_0x5706('0x2c')]['limit']);_0x1806df[_0x5706('0x1b')]=qs[_0x5706('0x1b')](_0x17a630['query'][_0x5706('0x1b')]);}_0x1806df[_0x5706('0x35')]=qs[_0x5706('0x36')](_0x17a630[_0x5706('0x2c')]['sort']);_0x1806df[_0x5706('0x37')]=qs['filters'](_[_0x5706('0x38')](_0x17a630[_0x5706('0x2c')],_0x4feb80[_0x5706('0x2e')]),_0x12ffb6);if(_0x17a630[_0x5706('0x2c')][_0x5706('0x39')]){_0x1806df[_0x5706('0x37')]=_[_0x5706('0x3a')](_0x1806df['where'],{'$or':_[_0x5706('0x2b')](_0x12ffb6,function(_0x2796ef){if(_0x2796ef[_0x5706('0x29')]!==_0x5706('0x3b')){var _0x152d6b={};_0x152d6b[_0x2796ef[_0x5706('0x24')]]={'$like':'%'+_0x17a630[_0x5706('0x2c')]['filter']+'%'};return _0x152d6b;}})});}_0x1806df=_['merge']({},_0x1806df,_0x17a630[_0x5706('0x3c')]);var _0x4873c9={'where':_0x1806df['where']};return db[_0x5706('0x27')][_0x5706('0x1d')](_0x4873c9)[_0x5706('0x22')](function(_0x52d6f8){_0x541e24[_0x5706('0x1d')]=_0x52d6f8;if(_0x17a630['query'][_0x5706('0x3d')]){_0x1806df[_0x5706('0x3e')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x5706('0x3f')](_0x1806df);})[_0x5706('0x22')](function(_0x5894f0){_0x541e24[_0x5706('0x40')]=_0x5894f0;return _0x541e24;})['then'](respondWithFilteredResult(_0x926238,_0x1806df))['catch'](handleError(_0x926238,null));};exports[_0x5706('0x41')]=function(_0x570771,_0x17a88a){var _0x23a184={'raw':![],'where':{'id':_0x570771[_0x5706('0x42')]['id']}},_0x43b268={};_0x43b268[_0x5706('0x2a')]=_[_0x5706('0x2d')](db[_0x5706('0x27')][_0x5706('0x43')]);_0x43b268['query']=_['keys'](_0x570771[_0x5706('0x2c')]);_0x43b268[_0x5706('0x2e')]=_[_0x5706('0x2f')](_0x43b268['model'],_0x43b268[_0x5706('0x2c')]);_0x23a184[_0x5706('0x30')]=_[_0x5706('0x2f')](_0x43b268[_0x5706('0x2a')],qs[_0x5706('0x31')](_0x570771[_0x5706('0x2c')][_0x5706('0x31')]));_0x23a184['attributes']=_0x23a184[_0x5706('0x30')]['length']?_0x23a184[_0x5706('0x30')]:_0x43b268[_0x5706('0x2a')];if(_0x570771[_0x5706('0x2c')][_0x5706('0x3d')]){_0x23a184[_0x5706('0x3e')]=[{'all':!![]}];}_0x23a184=_['merge']({},_0x23a184,_0x570771[_0x5706('0x3c')]);return db[_0x5706('0x27')][_0x5706('0x44')](_0x23a184)['then'](handleEntityNotFound(_0x17a88a,null))[_0x5706('0x22')](respondWithResult(_0x17a88a,null))['catch'](handleError(_0x17a88a,null));};exports[_0x5706('0x45')]=function(_0x168d32,_0xa07369){return db['SugarcrmConfiguration']['create'](_0x168d32['body'],{})['then'](respondWithResult(_0xa07369,0xc9))[_0x5706('0x46')](handleError(_0xa07369,null));};exports[_0x5706('0x47')]=function(_0x49e7c8,_0x297ef6){if(_0x49e7c8[_0x5706('0x48')]['id']){delete _0x49e7c8[_0x5706('0x48')]['id'];}return db[_0x5706('0x27')][_0x5706('0x44')]({'where':{'id':_0x49e7c8[_0x5706('0x42')]['id']}})[_0x5706('0x22')](handleEntityNotFound(_0x297ef6,null))[_0x5706('0x22')](saveUpdates(_0x49e7c8[_0x5706('0x48')],null))[_0x5706('0x22')](respondWithResult(_0x297ef6,null))[_0x5706('0x46')](handleError(_0x297ef6,null));};exports['destroy']=function(_0x11a8ab,_0x28669c){return db[_0x5706('0x27')][_0x5706('0x44')]({'where':{'id':_0x11a8ab[_0x5706('0x42')]['id']}})[_0x5706('0x22')](handleEntityNotFound(_0x28669c,null))[_0x5706('0x22')](removeEntity(_0x28669c,null))[_0x5706('0x46')](handleError(_0x28669c,null));};exports[_0x5706('0x49')]=function(_0x2112b5,_0x5e2c1b,_0x1b8458){var _0x43e280={};var _0x1d3310={};var _0x5756c6;var _0x27dc86;return db[_0x5706('0x27')][_0x5706('0x4a')]({'where':{'id':_0x2112b5[_0x5706('0x42')]['id']}})[_0x5706('0x22')](handleEntityNotFound(_0x5e2c1b,null))[_0x5706('0x22')](function(_0x587d05){if(_0x587d05){_0x5756c6=_0x587d05;_0x1d3310['model']=_[_0x5706('0x2d')](db['SugarcrmField'][_0x5706('0x43')]);_0x1d3310[_0x5706('0x2c')]=_[_0x5706('0x2d')](_0x2112b5[_0x5706('0x2c')]);_0x1d3310[_0x5706('0x2e')]=_[_0x5706('0x2f')](_0x1d3310[_0x5706('0x2a')],_0x1d3310[_0x5706('0x2c')]);_0x43e280['attributes']=_[_0x5706('0x2f')](_0x1d3310['model'],qs[_0x5706('0x31')](_0x2112b5[_0x5706('0x2c')][_0x5706('0x31')]));_0x43e280['attributes']=_0x43e280[_0x5706('0x30')]['length']?_0x43e280[_0x5706('0x30')]:_0x1d3310[_0x5706('0x2a')];_0x43e280[_0x5706('0x35')]=qs['sort'](_0x2112b5[_0x5706('0x2c')][_0x5706('0x36')]);_0x43e280[_0x5706('0x37')]=qs[_0x5706('0x2e')](_[_0x5706('0x38')](_0x2112b5['query'],_0x1d3310['filters']));if(_0x2112b5[_0x5706('0x2c')][_0x5706('0x39')]){_0x43e280[_0x5706('0x37')]=_[_0x5706('0x3a')](_0x43e280['where'],{'$or':_['map'](_0x43e280[_0x5706('0x30')],function(_0x570628){var _0x379ed0={};_0x379ed0[_0x570628]={'$like':'%'+_0x2112b5[_0x5706('0x2c')][_0x5706('0x39')]+'%'};return _0x379ed0;})});}_0x43e280=_[_0x5706('0x3a')]({},_0x43e280,_0x2112b5[_0x5706('0x3c')]);return _0x5756c6[_0x5706('0x49')](_0x43e280);}})[_0x5706('0x22')](function(_0x3c0686){if(_0x3c0686){_0x27dc86=_0x3c0686[_0x5706('0x32')];if(!_0x2112b5['query'][_0x5706('0x33')]('nolimit')){_0x43e280[_0x5706('0x34')]=qs[_0x5706('0x34')](_0x2112b5[_0x5706('0x2c')]['limit']);_0x43e280[_0x5706('0x1b')]=qs[_0x5706('0x1b')](_0x2112b5[_0x5706('0x2c')][_0x5706('0x1b')]);}return _0x5756c6[_0x5706('0x49')](_0x43e280);}})[_0x5706('0x22')](function(_0x40a0e9){if(_0x40a0e9){return _0x40a0e9?{'count':_0x27dc86,'rows':_0x40a0e9}:null;}})[_0x5706('0x22')](respondWithResult(_0x5e2c1b,null))[_0x5706('0x46')](handleError(_0x5e2c1b,null));};exports[_0x5706('0x4b')]=function(_0x578853,_0x317b83,_0x49f6f9){var _0x41a95c={};var _0x27a8b3={};var _0x1431d4;var _0x7233d0;return db['SugarcrmConfiguration'][_0x5706('0x4a')]({'where':{'id':_0x578853[_0x5706('0x42')]['id']}})[_0x5706('0x22')](handleEntityNotFound(_0x317b83,null))[_0x5706('0x22')](function(_0x41f1d2){if(_0x41f1d2){_0x1431d4=_0x41f1d2;_0x27a8b3[_0x5706('0x2a')]=_[_0x5706('0x2d')](db[_0x5706('0x4c')][_0x5706('0x43')]);_0x27a8b3['query']=_[_0x5706('0x2d')](_0x578853[_0x5706('0x2c')]);_0x27a8b3[_0x5706('0x2e')]=_[_0x5706('0x2f')](_0x27a8b3[_0x5706('0x2a')],_0x27a8b3['query']);_0x41a95c[_0x5706('0x30')]=_[_0x5706('0x2f')](_0x27a8b3[_0x5706('0x2a')],qs['fields'](_0x578853['query']['fields']));_0x41a95c[_0x5706('0x30')]=_0x41a95c['attributes'][_0x5706('0x32')]?_0x41a95c[_0x5706('0x30')]:_0x27a8b3[_0x5706('0x2a')];_0x41a95c[_0x5706('0x35')]=qs[_0x5706('0x36')](_0x578853[_0x5706('0x2c')][_0x5706('0x36')]);_0x41a95c[_0x5706('0x37')]=qs[_0x5706('0x2e')](_[_0x5706('0x38')](_0x578853['query'],_0x27a8b3[_0x5706('0x2e')]));if(_0x578853[_0x5706('0x2c')][_0x5706('0x39')]){_0x41a95c[_0x5706('0x37')]=_[_0x5706('0x3a')](_0x41a95c[_0x5706('0x37')],{'$or':_[_0x5706('0x2b')](_0x41a95c[_0x5706('0x30')],function(_0x2db26a){var _0x141b9e={};_0x141b9e[_0x2db26a]={'$like':'%'+_0x578853[_0x5706('0x2c')][_0x5706('0x39')]+'%'};return _0x141b9e;})});}_0x41a95c=_['merge']({},_0x41a95c,_0x578853[_0x5706('0x3c')]);return _0x1431d4[_0x5706('0x4b')](_0x41a95c);}})['then'](function(_0x2df93b){if(_0x2df93b){_0x7233d0=_0x2df93b[_0x5706('0x32')];if(!_0x578853[_0x5706('0x2c')][_0x5706('0x33')](_0x5706('0x4d'))){_0x41a95c[_0x5706('0x34')]=qs['limit'](_0x578853[_0x5706('0x2c')][_0x5706('0x34')]);_0x41a95c[_0x5706('0x1b')]=qs[_0x5706('0x1b')](_0x578853[_0x5706('0x2c')][_0x5706('0x1b')]);}return _0x1431d4['getSubjects'](_0x41a95c);}})[_0x5706('0x22')](function(_0xb02d1b){if(_0xb02d1b){return _0xb02d1b?{'count':_0x7233d0,'rows':_0xb02d1b}:null;}})[_0x5706('0x22')](respondWithResult(_0x317b83,null))['catch'](handleError(_0x317b83,null));};exports[_0x5706('0x4e')]=function(_0x3904a5,_0x324abe,_0x28eb29){var _0x57a399={};var _0x57e379={};var _0x23668e;var _0x9cf666;return db[_0x5706('0x27')]['findOne']({'where':{'id':_0x3904a5['params']['id']}})[_0x5706('0x22')](handleEntityNotFound(_0x324abe,null))[_0x5706('0x22')](function(_0x1c55ad){if(_0x1c55ad){_0x23668e=_0x1c55ad;_0x57e379[_0x5706('0x2a')]=_[_0x5706('0x2d')](db[_0x5706('0x4c')][_0x5706('0x43')]);_0x57e379['query']=_[_0x5706('0x2d')](_0x3904a5['query']);_0x57e379[_0x5706('0x2e')]=_[_0x5706('0x2f')](_0x57e379[_0x5706('0x2a')],_0x57e379[_0x5706('0x2c')]);_0x57a399[_0x5706('0x30')]=_[_0x5706('0x2f')](_0x57e379[_0x5706('0x2a')],qs[_0x5706('0x31')](_0x3904a5[_0x5706('0x2c')]['fields']));_0x57a399[_0x5706('0x30')]=_0x57a399[_0x5706('0x30')][_0x5706('0x32')]?_0x57a399['attributes']:_0x57e379[_0x5706('0x2a')];_0x57a399[_0x5706('0x35')]=qs[_0x5706('0x36')](_0x3904a5['query'][_0x5706('0x36')]);_0x57a399[_0x5706('0x37')]=qs[_0x5706('0x2e')](_['pick'](_0x3904a5[_0x5706('0x2c')],_0x57e379[_0x5706('0x2e')]));if(_0x3904a5[_0x5706('0x2c')][_0x5706('0x39')]){_0x57a399[_0x5706('0x37')]=_[_0x5706('0x3a')](_0x57a399['where'],{'$or':_['map'](_0x57a399[_0x5706('0x30')],function(_0x2400b0){var _0xc9abba={};_0xc9abba[_0x2400b0]={'$like':'%'+_0x3904a5[_0x5706('0x2c')]['filter']+'%'};return _0xc9abba;})});}_0x57a399=_[_0x5706('0x3a')]({},_0x57a399,_0x3904a5[_0x5706('0x3c')]);return _0x23668e[_0x5706('0x4e')](_0x57a399);}})[_0x5706('0x22')](function(_0x1c799f){if(_0x1c799f){_0x9cf666=_0x1c799f[_0x5706('0x32')];if(!_0x3904a5[_0x5706('0x2c')][_0x5706('0x33')]('nolimit')){_0x57a399[_0x5706('0x34')]=qs[_0x5706('0x34')](_0x3904a5[_0x5706('0x2c')][_0x5706('0x34')]);_0x57a399[_0x5706('0x1b')]=qs[_0x5706('0x1b')](_0x3904a5[_0x5706('0x2c')][_0x5706('0x1b')]);}return _0x23668e[_0x5706('0x4e')](_0x57a399);}})[_0x5706('0x22')](function(_0x514873){if(_0x514873){return _0x514873?{'count':_0x9cf666,'rows':_0x514873}:null;}})[_0x5706('0x22')](respondWithResult(_0x324abe,null))[_0x5706('0x46')](handleError(_0x324abe,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 5e18020..15281d7 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 _0x3029=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','lodash','util'];(function(_0x56ec8e,_0x3fa52f){var _0x444e09=function(_0x28d8f9){while(--_0x28d8f9){_0x56ec8e['push'](_0x56ec8e['shift']());}};_0x444e09(++_0x3fa52f);}(_0x3029,0x9a));var _0x9302=function(_0x23e207,_0x34850b){_0x23e207=_0x23e207-0x0;var _0x2e25fa=_0x3029[_0x23e207];return _0x2e25fa;};'use strict';var _=require(_0x9302('0x0'));var util=require(_0x9302('0x1'));var logger=require(_0x9302('0x2'))(_0x9302('0x3'));var moment=require(_0x9302('0x4'));var BPromise=require(_0x9302('0x5'));var rp=require(_0x9302('0x6'));var fs=require('fs');var path=require(_0x9302('0x7'));var rimraf=require(_0x9302('0x8'));var config=require('../../config/environment');var attributes=require(_0x9302('0x9'));module[_0x9302('0xa')]=function(_0x33cab3,_0x1d63bf){return _0x33cab3['define'](_0x9302('0xb'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca55=['request-promise','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','bluebird'];(function(_0x52be8b,_0x53d732){var _0x3a2544=function(_0x26d9c5){while(--_0x26d9c5){_0x52be8b['push'](_0x52be8b['shift']());}};_0x3a2544(++_0x53d732);}(_0xca55,0x10a));var _0x5ca5=function(_0x25cf2a,_0x196f17){_0x25cf2a=_0x25cf2a-0x0;var _0x37fdf5=_0xca55[_0x25cf2a];return _0x37fdf5;};'use strict';var _=require(_0x5ca5('0x0'));var util=require(_0x5ca5('0x1'));var logger=require(_0x5ca5('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5ca5('0x3'));var rp=require(_0x5ca5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5ca5('0x5'));var config=require(_0x5ca5('0x6'));var attributes=require(_0x5ca5('0x7'));module['exports']=function(_0x469c26,_0x4b9f7a){return _0x469c26['define'](_0x5ca5('0x8'),attributes,{'tableName':_0x5ca5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 4cb13b6..bacfcb4 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 _0xbd52=['code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5d4221,_0x425843){var _0x508146=function(_0x51f5c2){while(--_0x51f5c2){_0x5d4221['push'](_0x5d4221['shift']());}};_0x508146(++_0x425843);}(_0xbd52,0x18a));var _0x2bd5=function(_0x6c419a,_0x39db56){_0x6c419a=_0x6c419a-0x0;var _0x587580=_0xbd52[_0x6c419a];return _0x587580;};'use strict';var _=require(_0x2bd5('0x0'));var util=require(_0x2bd5('0x1'));var moment=require(_0x2bd5('0x2'));var BPromise=require(_0x2bd5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2bd5('0x4'))['db'];var utils=require(_0x2bd5('0x5'));var logger=require(_0x2bd5('0x6'))(_0x2bd5('0x7'));var config=require('../../config/environment');var jayson=require(_0x2bd5('0x8'));var client=jayson[_0x2bd5('0x9')][_0x2bd5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58c162,_0x32aea3,_0xc33591){return new BPromise(function(_0x43e34c,_0x35b7ff){return client[_0x2bd5('0xb')](_0x58c162,_0xc33591)[_0x2bd5('0xc')](function(_0x1f27eb){logger[_0x2bd5('0xd')](_0x2bd5('0xe'),_0x32aea3,_0x2bd5('0xf'));logger[_0x2bd5('0x10')](_0x2bd5('0x11'),_0x32aea3,_0x2bd5('0xf'),JSON[_0x2bd5('0x12')](_0x1f27eb));if(_0x1f27eb[_0x2bd5('0x13')]){if(_0x1f27eb[_0x2bd5('0x13')][_0x2bd5('0x14')]===0x1f4){logger['error'](_0x2bd5('0xe'),_0x32aea3,_0x1f27eb[_0x2bd5('0x13')][_0x2bd5('0x15')]);return _0x35b7ff(_0x1f27eb[_0x2bd5('0x13')]['message']);}logger['error'](_0x2bd5('0xe'),_0x32aea3,_0x1f27eb[_0x2bd5('0x13')]['message']);return _0x43e34c(_0x1f27eb[_0x2bd5('0x13')]['message']);}else{logger['info'](_0x2bd5('0xe'),_0x32aea3,_0x2bd5('0xf'));_0x43e34c(_0x1f27eb['result'][_0x2bd5('0x15')]);}})[_0x2bd5('0x16')](function(_0x5f3fb0){logger['error'](_0x2bd5('0xe'),_0x32aea3,_0x5f3fb0);_0x35b7ff(_0x5f3fb0);});});} \ No newline at end of file +var _0x40e3=['then','info','request\x20sent','debug','stringify','error','code','message','SugarcrmConfiguration,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x412e27,_0x20a978){var _0x53da42=function(_0x43cae5){while(--_0x43cae5){_0x412e27['push'](_0x412e27['shift']());}};_0x53da42(++_0x20a978);}(_0x40e3,0x1b4));var _0x340e=function(_0x3c2407,_0x3c9a47){_0x3c2407=_0x3c2407-0x0;var _0x5d2eac=_0x40e3[_0x3c2407];return _0x5d2eac;};'use strict';var _=require(_0x340e('0x0'));var util=require('util');var moment=require(_0x340e('0x1'));var BPromise=require(_0x340e('0x2'));var rs=require(_0x340e('0x3'));var fs=require('fs');var Redis=require(_0x340e('0x4'));var db=require(_0x340e('0x5'))['db'];var utils=require(_0x340e('0x6'));var logger=require(_0x340e('0x7'))(_0x340e('0x8'));var config=require(_0x340e('0x9'));var jayson=require(_0x340e('0xa'));var client=jayson[_0x340e('0xb')][_0x340e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1456bf,_0x4c66ae,_0x4a8f86){return new BPromise(function(_0x24e0d3,_0x1664df){return client[_0x340e('0xd')](_0x1456bf,_0x4a8f86)[_0x340e('0xe')](function(_0x3f7ebc){logger[_0x340e('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4c66ae,_0x340e('0x10'));logger[_0x340e('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x4c66ae,'request\x20sent',JSON[_0x340e('0x12')](_0x3f7ebc));if(_0x3f7ebc[_0x340e('0x13')]){if(_0x3f7ebc[_0x340e('0x13')][_0x340e('0x14')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x4c66ae,_0x3f7ebc[_0x340e('0x13')][_0x340e('0x15')]);return _0x1664df(_0x3f7ebc[_0x340e('0x13')][_0x340e('0x15')]);}logger[_0x340e('0x13')](_0x340e('0x16'),_0x4c66ae,_0x3f7ebc[_0x340e('0x13')][_0x340e('0x15')]);return _0x24e0d3(_0x3f7ebc[_0x340e('0x13')]['message']);}else{logger[_0x340e('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4c66ae,'request\x20sent');_0x24e0d3(_0x3f7ebc[_0x340e('0x17')][_0x340e('0x15')]);}})[_0x340e('0x18')](function(_0x2f4509){logger[_0x340e('0x13')](_0x340e('0x16'),_0x4c66ae,_0x2f4509);_0x1664df(_0x2f4509);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index c7d452b..67a8e7b 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 _0xc985=['/:id','show','create','put','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','get'];(function(_0x616141,_0x2a76d9){var _0x5ac45f=function(_0xed5c2b){while(--_0xed5c2b){_0x616141['push'](_0x616141['shift']());}};_0x5ac45f(++_0x2a76d9);}(_0xc985,0x19f));var _0x5c98=function(_0x1d1dc6,_0x642c41){_0x1d1dc6=_0x1d1dc6-0x0;var _0x4e1076=_0xc985[_0x1d1dc6];return _0x4e1076;};'use strict';var multer=require(_0x5c98('0x0'));var util=require('util');var path=require(_0x5c98('0x1'));var timeout=require('connect-timeout');var express=require(_0x5c98('0x2'));var router=express[_0x5c98('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5c98('0x4'));var interaction=require(_0x5c98('0x5'));var config=require(_0x5c98('0x6'));var controller=require(_0x5c98('0x7'));router['get']('/',auth[_0x5c98('0x8')](),controller['index']);router[_0x5c98('0x9')](_0x5c98('0xa'),auth['isAuthenticated'](),controller[_0x5c98('0xb')]);router['post']('/',auth[_0x5c98('0x8')](),controller[_0x5c98('0xc')]);router[_0x5c98('0xd')](_0x5c98('0xa'),auth[_0x5c98('0x8')](),controller['update']);router[_0x5c98('0xe')]('/:id',auth[_0x5c98('0x8')](),controller[_0x5c98('0xf')]);module[_0x5c98('0x10')]=router; \ No newline at end of file +var _0x6b64=['put','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x3610e6,_0x4da4fe){var _0xd42f01=function(_0x36e7e2){while(--_0x36e7e2){_0x3610e6['push'](_0x3610e6['shift']());}};_0xd42f01(++_0x4da4fe);}(_0x6b64,0x83));var _0x46b6=function(_0xd336fa,_0x39d1b2){_0xd336fa=_0xd336fa-0x0;var _0x3370b1=_0x6b64[_0xd336fa];return _0x3370b1;};'use strict';var multer=require('multer');var util=require(_0x46b6('0x0'));var path=require('path');var timeout=require(_0x46b6('0x1'));var express=require(_0x46b6('0x2'));var router=express['Router']();var fs_extra=require(_0x46b6('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x46b6('0x4'));var config=require(_0x46b6('0x5'));var controller=require(_0x46b6('0x6'));router[_0x46b6('0x7')]('/',auth['isAuthenticated'](),controller[_0x46b6('0x8')]);router[_0x46b6('0x7')](_0x46b6('0x9'),auth[_0x46b6('0xa')](),controller[_0x46b6('0xb')]);router[_0x46b6('0xc')]('/',auth[_0x46b6('0xa')](),controller['create']);router[_0x46b6('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x46b6('0xe')]);router[_0x46b6('0xf')](_0x46b6('0x9'),auth['isAuthenticated'](),controller[_0x46b6('0x10')]);module[_0x46b6('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index efe9892..ac2e130 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 _0x9f8e=['STRING','customVariable','sequelize','exports','ENUM','string','keyValue','picklist'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x9f8e,0xda));var _0xe9f8=function(_0x30f7c9,_0x5401af){_0x30f7c9=_0x30f7c9-0x0;var _0x5af6de=_0x9f8e[_0x30f7c9];return _0x5af6de;};'use strict';var Sequelize=require(_0xe9f8('0x0'));module[_0xe9f8('0x1')]={'type':{'type':Sequelize[_0xe9f8('0x2')](_0xe9f8('0x3'),'variable','customVariable',_0xe9f8('0x4'),_0xe9f8('0x5')),'defaultValue':_0xe9f8('0x3')},'content':{'type':Sequelize[_0xe9f8('0x6')]},'key':{'type':Sequelize[_0xe9f8('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xe9f8('0x3'),'variable',_0xe9f8('0x7'))},'keyContent':{'type':Sequelize[_0xe9f8('0x6')]},'idField':{'type':Sequelize[_0xe9f8('0x6')]},'nameField':{'type':Sequelize[_0xe9f8('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe9f8('0x6')]}}; \ No newline at end of file +var _0xcbaa=['sequelize','exports','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x41abb4,_0x5861ee){var _0x51e2c2=function(_0x3d35ae){while(--_0x3d35ae){_0x41abb4['push'](_0x41abb4['shift']());}};_0x51e2c2(++_0x5861ee);}(_0xcbaa,0xfc));var _0xacba=function(_0x284807,_0x4be925){_0x284807=_0x284807-0x0;var _0x50c774=_0xcbaa[_0x284807];return _0x50c774;};'use strict';var Sequelize=require(_0xacba('0x0'));module[_0xacba('0x1')]={'type':{'type':Sequelize['ENUM'](_0xacba('0x2'),_0xacba('0x3'),_0xacba('0x4'),_0xacba('0x5'),_0xacba('0x6')),'defaultValue':_0xacba('0x2')},'content':{'type':Sequelize[_0xacba('0x7')]},'key':{'type':Sequelize[_0xacba('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xacba('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xacba('0x7')]},'idField':{'type':Sequelize[_0xacba('0x7')]},'nameField':{'type':Sequelize[_0xacba('0x7')]},'customField':{'type':Sequelize[_0xacba('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xacba('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 46dcc8d..4da5550 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 _0x144c=['merge','VIRTUAL','filter','options','includeAll','include','rows','show','find','catch','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x1be006,_0x4fb593){var _0xcdac9a=function(_0xdf7820){while(--_0xdf7820){_0x1be006['push'](_0x1be006['shift']());}};_0xcdac9a(++_0x4fb593);}(_0x144c,0x1c4));var _0xc144=function(_0x50450d,_0x314c15){_0x50450d=_0x50450d-0x0;var _0x1c391b=_0x144c[_0x50450d];return _0x1c391b;};'use strict';var emlformat=require(_0xc144('0x0'));var rimraf=require(_0xc144('0x1'));var zipdir=require(_0xc144('0x2'));var jsonpatch=require(_0xc144('0x3'));var rp=require(_0xc144('0x4'));var moment=require(_0xc144('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc144('0x6'));var util=require(_0xc144('0x7'));var path=require(_0xc144('0x8'));var sox=require(_0xc144('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc144('0xa'));var _=require(_0xc144('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc144('0xc'));var querystring=require('querystring');var Papa=require(_0xc144('0xd'));var Redis=require('ioredis');var authService=require(_0xc144('0xe'));var qs=require(_0xc144('0xf'));var as=require(_0xc144('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc144('0x11'));var utils=require(_0xc144('0x12'));var config=require(_0xc144('0x13'));var licenseUtil=require(_0xc144('0x14'));var db=require(_0xc144('0x15'))['db'];function respondWithStatusCode(_0x3e5fc5,_0x1898e1){_0x1898e1=_0x1898e1||0xcc;return function(_0x586815){if(_0x586815){return _0x3e5fc5[_0xc144('0x16')](_0x1898e1);}return _0x3e5fc5['status'](_0x1898e1)[_0xc144('0x17')]();};}function respondWithResult(_0x41d343,_0x29a6a3){_0x29a6a3=_0x29a6a3||0xc8;return function(_0xff3171){if(_0xff3171){return _0x41d343[_0xc144('0x18')](_0x29a6a3)[_0xc144('0x19')](_0xff3171);}};}function respondWithFilteredResult(_0x5c9bf0,_0x2b9ec1){return function(_0x310f0d){if(_0x310f0d){var _0x17ff84=typeof _0x2b9ec1[_0xc144('0x1a')]===_0xc144('0x1b')&&typeof _0x2b9ec1[_0xc144('0x1c')]===_0xc144('0x1b');var _0x2c13bc=_0x310f0d[_0xc144('0x1d')];var _0xc9f509=_0x17ff84?0x0:_0x2b9ec1[_0xc144('0x1a')];var _0xa07950=_0x17ff84?_0x310f0d[_0xc144('0x1d')]:_0x2b9ec1[_0xc144('0x1a')]+_0x2b9ec1[_0xc144('0x1c')];var _0x2ffe76;if(_0xa07950>=_0x2c13bc){_0xa07950=_0x2c13bc;_0x2ffe76=0xc8;}else{_0x2ffe76=0xce;}_0x5c9bf0[_0xc144('0x18')](_0x2ffe76);return _0x5c9bf0[_0xc144('0x1e')](_0xc144('0x1f'),_0xc9f509+'-'+_0xa07950+'/'+_0x2c13bc)['json'](_0x310f0d);}return null;};}function patchUpdates(_0x46a6b9){return function(_0x549198){try{jsonpatch['apply'](_0x549198,_0x46a6b9,!![]);}catch(_0x8f8d58){return BPromise[_0xc144('0x20')](_0x8f8d58);}return _0x549198[_0xc144('0x21')]();};}function saveUpdates(_0x170318,_0x5e50ae){return function(_0x18cdd0){if(_0x18cdd0){return _0x18cdd0[_0xc144('0x22')](_0x170318)[_0xc144('0x23')](function(_0x7f1d89){return _0x7f1d89;});}return null;};}function removeEntity(_0x59643b,_0x31e208){return function(_0xf4a13e){if(_0xf4a13e){return _0xf4a13e['destroy']()[_0xc144('0x23')](function(){_0x59643b[_0xc144('0x18')](0xcc)[_0xc144('0x17')]();});}};}function handleEntityNotFound(_0x226e4a,_0x202534){return function(_0x49d581){if(!_0x49d581){_0x226e4a['sendStatus'](0x194);}return _0x49d581;};}function handleError(_0x27bc6f,_0x167984){_0x167984=_0x167984||0x1f4;return function(_0x46b3c7){logger[_0xc144('0x24')](_0x46b3c7[_0xc144('0x25')]);if(_0x46b3c7[_0xc144('0x26')]){delete _0x46b3c7[_0xc144('0x26')];}_0x27bc6f['status'](_0x167984)['send'](_0x46b3c7);};}exports[_0xc144('0x27')]=function(_0xcb7916,_0x2d6e3e){var _0xf9f0c2={},_0x1ee1bc={},_0x5bb4a0={'count':0x0,'rows':[]};var _0x252f97=_[_0xc144('0x28')](db[_0xc144('0x29')][_0xc144('0x2a')],function(_0x355aba){return{'name':_0x355aba[_0xc144('0x2b')],'type':_0x355aba[_0xc144('0x2c')][_0xc144('0x2d')]};});_0x1ee1bc[_0xc144('0x2e')]=_[_0xc144('0x28')](_0x252f97,'name');_0x1ee1bc[_0xc144('0x2f')]=_[_0xc144('0x30')](_0xcb7916[_0xc144('0x2f')]);_0x1ee1bc[_0xc144('0x31')]=_[_0xc144('0x32')](_0x1ee1bc['model'],_0x1ee1bc['query']);_0xf9f0c2[_0xc144('0x33')]=_[_0xc144('0x32')](_0x1ee1bc[_0xc144('0x2e')],qs[_0xc144('0x34')](_0xcb7916[_0xc144('0x2f')][_0xc144('0x34')]));_0xf9f0c2['attributes']=_0xf9f0c2[_0xc144('0x33')][_0xc144('0x35')]?_0xf9f0c2[_0xc144('0x33')]:_0x1ee1bc[_0xc144('0x2e')];if(!_0xcb7916[_0xc144('0x2f')][_0xc144('0x36')](_0xc144('0x37'))){_0xf9f0c2[_0xc144('0x1c')]=qs[_0xc144('0x1c')](_0xcb7916[_0xc144('0x2f')][_0xc144('0x1c')]);_0xf9f0c2[_0xc144('0x1a')]=qs[_0xc144('0x1a')](_0xcb7916[_0xc144('0x2f')]['offset']);}_0xf9f0c2['order']=qs['sort'](_0xcb7916[_0xc144('0x2f')][_0xc144('0x38')]);_0xf9f0c2[_0xc144('0x39')]=qs[_0xc144('0x31')](_[_0xc144('0x3a')](_0xcb7916[_0xc144('0x2f')],_0x1ee1bc['filters']),_0x252f97);if(_0xcb7916[_0xc144('0x2f')]['filter']){_0xf9f0c2[_0xc144('0x39')]=_[_0xc144('0x3b')](_0xf9f0c2[_0xc144('0x39')],{'$or':_[_0xc144('0x28')](_0x252f97,function(_0x335a15){if(_0x335a15['type']!==_0xc144('0x3c')){var _0x3fe221={};_0x3fe221[_0x335a15[_0xc144('0x26')]]={'$like':'%'+_0xcb7916[_0xc144('0x2f')][_0xc144('0x3d')]+'%'};return _0x3fe221;}})});}_0xf9f0c2=_['merge']({},_0xf9f0c2,_0xcb7916[_0xc144('0x3e')]);var _0x33eb47={'where':_0xf9f0c2[_0xc144('0x39')]};return db[_0xc144('0x29')][_0xc144('0x1d')](_0x33eb47)['then'](function(_0x2bbaec){_0x5bb4a0[_0xc144('0x1d')]=_0x2bbaec;if(_0xcb7916[_0xc144('0x2f')][_0xc144('0x3f')]){_0xf9f0c2[_0xc144('0x40')]=[{'all':!![]}];}return db[_0xc144('0x29')]['findAll'](_0xf9f0c2);})[_0xc144('0x23')](function(_0x3754a4){_0x5bb4a0[_0xc144('0x41')]=_0x3754a4;return _0x5bb4a0;})[_0xc144('0x23')](respondWithFilteredResult(_0x2d6e3e,_0xf9f0c2))['catch'](handleError(_0x2d6e3e,null));};exports[_0xc144('0x42')]=function(_0x40b8c9,_0x57ecdf){var _0x9c266d={'raw':!![],'where':{'id':_0x40b8c9['params']['id']}},_0x197311={};_0x197311['model']=_[_0xc144('0x30')](db[_0xc144('0x29')][_0xc144('0x2a')]);_0x197311[_0xc144('0x2f')]=_[_0xc144('0x30')](_0x40b8c9[_0xc144('0x2f')]);_0x197311[_0xc144('0x31')]=_[_0xc144('0x32')](_0x197311[_0xc144('0x2e')],_0x197311['query']);_0x9c266d['attributes']=_[_0xc144('0x32')](_0x197311[_0xc144('0x2e')],qs['fields'](_0x40b8c9[_0xc144('0x2f')][_0xc144('0x34')]));_0x9c266d[_0xc144('0x33')]=_0x9c266d[_0xc144('0x33')][_0xc144('0x35')]?_0x9c266d['attributes']:_0x197311['model'];if(_0x40b8c9['query'][_0xc144('0x3f')]){_0x9c266d[_0xc144('0x40')]=[{'all':!![]}];}_0x9c266d=_[_0xc144('0x3b')]({},_0x9c266d,_0x40b8c9['options']);return db[_0xc144('0x29')][_0xc144('0x43')](_0x9c266d)['then'](handleEntityNotFound(_0x57ecdf,null))[_0xc144('0x23')](respondWithResult(_0x57ecdf,null))[_0xc144('0x44')](handleError(_0x57ecdf,null));};exports[_0xc144('0x45')]=function(_0x1e8d7a,_0x529c81){return db['SugarcrmField'][_0xc144('0x45')](_0x1e8d7a['body'],{})[_0xc144('0x23')](respondWithResult(_0x529c81,0xc9))[_0xc144('0x44')](handleError(_0x529c81,null));};exports['update']=function(_0x21bf01,_0x495c1b){if(_0x21bf01['body']['id']){delete _0x21bf01[_0xc144('0x46')]['id'];}return db[_0xc144('0x29')][_0xc144('0x43')]({'where':{'id':_0x21bf01[_0xc144('0x47')]['id']}})[_0xc144('0x23')](handleEntityNotFound(_0x495c1b,null))['then'](saveUpdates(_0x21bf01[_0xc144('0x46')],null))[_0xc144('0x23')](respondWithResult(_0x495c1b,null))[_0xc144('0x44')](handleError(_0x495c1b,null));};exports[_0xc144('0x48')]=function(_0x525835,_0x13729c){return db[_0xc144('0x29')][_0xc144('0x43')]({'where':{'id':_0x525835['params']['id']}})[_0xc144('0x23')](handleEntityNotFound(_0x13729c,null))[_0xc144('0x23')](removeEntity(_0x13729c,null))[_0xc144('0x44')](handleError(_0x13729c,null));}; \ No newline at end of file +var _0x08f1=['filters','filter','merge','VIRTUAL','options','include','SugarcrmField','findAll','rows','show','keys','includeAll','find','catch','create','body','params','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','then','destroy','name','send','index','map','rawAttributes','type','query','model','attributes','intersection','fields','length','order','sort','where'];(function(_0x35082f,_0x57ea69){var _0x1ae051=function(_0x2c9737){while(--_0x2c9737){_0x35082f['push'](_0x35082f['shift']());}};_0x1ae051(++_0x57ea69);}(_0x08f1,0x1a3));var _0x108f=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x08f1[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x108f('0x0'));var zipdir=require(_0x108f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x108f('0x2'));var moment=require(_0x108f('0x3'));var BPromise=require(_0x108f('0x4'));var Mustache=require(_0x108f('0x5'));var util=require('util');var path=require(_0x108f('0x6'));var sox=require('sox');var csv=require(_0x108f('0x7'));var ejs=require(_0x108f('0x8'));var fs=require('fs');var fs_extra=require(_0x108f('0x9'));var _=require(_0x108f('0xa'));var squel=require('squel');var crypto=require(_0x108f('0xb'));var jsforce=require(_0x108f('0xc'));var deskjs=require(_0x108f('0xd'));var toCsv=require(_0x108f('0x7'));var querystring=require(_0x108f('0xe'));var Papa=require(_0x108f('0xf'));var Redis=require(_0x108f('0x10'));var authService=require(_0x108f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x108f('0x12'));var hardwareService=require(_0x108f('0x13'));var logger=require(_0x108f('0x14'))(_0x108f('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x108f('0x16'))['db'];function respondWithStatusCode(_0x5d51dc,_0x358297){_0x358297=_0x358297||0xcc;return function(_0x431269){if(_0x431269){return _0x5d51dc['sendStatus'](_0x358297);}return _0x5d51dc[_0x108f('0x17')](_0x358297)[_0x108f('0x18')]();};}function respondWithResult(_0x290fa4,_0x2a44f8){_0x2a44f8=_0x2a44f8||0xc8;return function(_0x17b4c5){if(_0x17b4c5){return _0x290fa4[_0x108f('0x17')](_0x2a44f8)[_0x108f('0x19')](_0x17b4c5);}};}function respondWithFilteredResult(_0x2dbdff,_0x169dd3){return function(_0x1a06d4){if(_0x1a06d4){var _0x5b7699=typeof _0x169dd3[_0x108f('0x1a')]==='undefined'&&typeof _0x169dd3[_0x108f('0x1b')]===_0x108f('0x1c');var _0x2d8bca=_0x1a06d4[_0x108f('0x1d')];var _0xe88c35=_0x5b7699?0x0:_0x169dd3[_0x108f('0x1a')];var _0xa53896=_0x5b7699?_0x1a06d4['count']:_0x169dd3[_0x108f('0x1a')]+_0x169dd3[_0x108f('0x1b')];var _0x59a39f;if(_0xa53896>=_0x2d8bca){_0xa53896=_0x2d8bca;_0x59a39f=0xc8;}else{_0x59a39f=0xce;}_0x2dbdff[_0x108f('0x17')](_0x59a39f);return _0x2dbdff['set'](_0x108f('0x1e'),_0xe88c35+'-'+_0xa53896+'/'+_0x2d8bca)['json'](_0x1a06d4);}return null;};}function patchUpdates(_0x3cf8d4){return function(_0x38cd4c){try{jsonpatch[_0x108f('0x1f')](_0x38cd4c,_0x3cf8d4,!![]);}catch(_0x396da3){return BPromise[_0x108f('0x20')](_0x396da3);}return _0x38cd4c['save']();};}function saveUpdates(_0x2a83c6,_0x2ace46){return function(_0x1213ea){if(_0x1213ea){return _0x1213ea['update'](_0x2a83c6)[_0x108f('0x21')](function(_0x4f7a07){return _0x4f7a07;});}return null;};}function removeEntity(_0xa305c0,_0x23760c){return function(_0xce9a1d){if(_0xce9a1d){return _0xce9a1d[_0x108f('0x22')]()[_0x108f('0x21')](function(){_0xa305c0[_0x108f('0x17')](0xcc)[_0x108f('0x18')]();});}};}function handleEntityNotFound(_0x5d8c8a,_0x1b8bb2){return function(_0x39e589){if(!_0x39e589){_0x5d8c8a['sendStatus'](0x194);}return _0x39e589;};}function handleError(_0x54bff2,_0x13a620){_0x13a620=_0x13a620||0x1f4;return function(_0x28b5d4){logger['error'](_0x28b5d4['stack']);if(_0x28b5d4[_0x108f('0x23')]){delete _0x28b5d4[_0x108f('0x23')];}_0x54bff2[_0x108f('0x17')](_0x13a620)[_0x108f('0x24')](_0x28b5d4);};}exports[_0x108f('0x25')]=function(_0x2a2384,_0x3cbf1d){var _0x1c7077={},_0x189dcc={},_0x5cea56={'count':0x0,'rows':[]};var _0x3d2ced=_[_0x108f('0x26')](db['SugarcrmField'][_0x108f('0x27')],function(_0x5ad7c6){return{'name':_0x5ad7c6['fieldName'],'type':_0x5ad7c6[_0x108f('0x28')]['key']};});_0x189dcc['model']=_[_0x108f('0x26')](_0x3d2ced,_0x108f('0x23'));_0x189dcc[_0x108f('0x29')]=_['keys'](_0x2a2384['query']);_0x189dcc['filters']=_['intersection'](_0x189dcc[_0x108f('0x2a')],_0x189dcc[_0x108f('0x29')]);_0x1c7077[_0x108f('0x2b')]=_[_0x108f('0x2c')](_0x189dcc['model'],qs[_0x108f('0x2d')](_0x2a2384['query']['fields']));_0x1c7077[_0x108f('0x2b')]=_0x1c7077[_0x108f('0x2b')][_0x108f('0x2e')]?_0x1c7077[_0x108f('0x2b')]:_0x189dcc[_0x108f('0x2a')];if(!_0x2a2384[_0x108f('0x29')]['hasOwnProperty']('nolimit')){_0x1c7077[_0x108f('0x1b')]=qs['limit'](_0x2a2384[_0x108f('0x29')][_0x108f('0x1b')]);_0x1c7077[_0x108f('0x1a')]=qs[_0x108f('0x1a')](_0x2a2384[_0x108f('0x29')][_0x108f('0x1a')]);}_0x1c7077[_0x108f('0x2f')]=qs[_0x108f('0x30')](_0x2a2384['query'][_0x108f('0x30')]);_0x1c7077[_0x108f('0x31')]=qs['filters'](_['pick'](_0x2a2384['query'],_0x189dcc[_0x108f('0x32')]),_0x3d2ced);if(_0x2a2384['query'][_0x108f('0x33')]){_0x1c7077[_0x108f('0x31')]=_[_0x108f('0x34')](_0x1c7077[_0x108f('0x31')],{'$or':_[_0x108f('0x26')](_0x3d2ced,function(_0x4e975d){if(_0x4e975d[_0x108f('0x28')]!==_0x108f('0x35')){var _0x3fd6d4={};_0x3fd6d4[_0x4e975d[_0x108f('0x23')]]={'$like':'%'+_0x2a2384[_0x108f('0x29')][_0x108f('0x33')]+'%'};return _0x3fd6d4;}})});}_0x1c7077=_[_0x108f('0x34')]({},_0x1c7077,_0x2a2384[_0x108f('0x36')]);var _0x2e340c={'where':_0x1c7077[_0x108f('0x31')]};return db['SugarcrmField'][_0x108f('0x1d')](_0x2e340c)[_0x108f('0x21')](function(_0x3bdada){_0x5cea56['count']=_0x3bdada;if(_0x2a2384[_0x108f('0x29')]['includeAll']){_0x1c7077[_0x108f('0x37')]=[{'all':!![]}];}return db[_0x108f('0x38')][_0x108f('0x39')](_0x1c7077);})[_0x108f('0x21')](function(_0x54e0f7){_0x5cea56[_0x108f('0x3a')]=_0x54e0f7;return _0x5cea56;})[_0x108f('0x21')](respondWithFilteredResult(_0x3cbf1d,_0x1c7077))['catch'](handleError(_0x3cbf1d,null));};exports[_0x108f('0x3b')]=function(_0x52d108,_0x553328){var _0x179b3e={'raw':!![],'where':{'id':_0x52d108['params']['id']}},_0x5dea67={};_0x5dea67[_0x108f('0x2a')]=_[_0x108f('0x3c')](db[_0x108f('0x38')][_0x108f('0x27')]);_0x5dea67[_0x108f('0x29')]=_[_0x108f('0x3c')](_0x52d108[_0x108f('0x29')]);_0x5dea67[_0x108f('0x32')]=_[_0x108f('0x2c')](_0x5dea67['model'],_0x5dea67[_0x108f('0x29')]);_0x179b3e[_0x108f('0x2b')]=_[_0x108f('0x2c')](_0x5dea67[_0x108f('0x2a')],qs[_0x108f('0x2d')](_0x52d108[_0x108f('0x29')][_0x108f('0x2d')]));_0x179b3e[_0x108f('0x2b')]=_0x179b3e[_0x108f('0x2b')][_0x108f('0x2e')]?_0x179b3e['attributes']:_0x5dea67[_0x108f('0x2a')];if(_0x52d108[_0x108f('0x29')][_0x108f('0x3d')]){_0x179b3e[_0x108f('0x37')]=[{'all':!![]}];}_0x179b3e=_[_0x108f('0x34')]({},_0x179b3e,_0x52d108[_0x108f('0x36')]);return db[_0x108f('0x38')][_0x108f('0x3e')](_0x179b3e)[_0x108f('0x21')](handleEntityNotFound(_0x553328,null))[_0x108f('0x21')](respondWithResult(_0x553328,null))[_0x108f('0x3f')](handleError(_0x553328,null));};exports[_0x108f('0x40')]=function(_0x1c919e,_0x589df4){return db[_0x108f('0x38')][_0x108f('0x40')](_0x1c919e[_0x108f('0x41')],{})['then'](respondWithResult(_0x589df4,0xc9))[_0x108f('0x3f')](handleError(_0x589df4,null));};exports['update']=function(_0x4eec33,_0x1867f8){if(_0x4eec33[_0x108f('0x41')]['id']){delete _0x4eec33[_0x108f('0x41')]['id'];}return db[_0x108f('0x38')]['find']({'where':{'id':_0x4eec33[_0x108f('0x42')]['id']}})['then'](handleEntityNotFound(_0x1867f8,null))['then'](saveUpdates(_0x4eec33[_0x108f('0x41')],null))[_0x108f('0x21')](respondWithResult(_0x1867f8,null))[_0x108f('0x3f')](handleError(_0x1867f8,null));};exports[_0x108f('0x22')]=function(_0x2c8081,_0x27da92){return db[_0x108f('0x38')]['find']({'where':{'id':_0x2c8081[_0x108f('0x42')]['id']}})[_0x108f('0x21')](handleEntityNotFound(_0x27da92,null))[_0x108f('0x21')](removeEntity(_0x27da92,null))[_0x108f('0x3f')](handleError(_0x27da92,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 249e71d..b14d112 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 _0xecf3=['path','rimraf','../../config/environment','./intSugarcrmField.attributes','int_sugarcrm_fields','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x15491f,_0x2638e3){var _0x40ede5=function(_0x56ef22){while(--_0x56ef22){_0x15491f['push'](_0x15491f['shift']());}};_0x40ede5(++_0x2638e3);}(_0xecf3,0x89));var _0x3ecf=function(_0x11ed36,_0x2a0788){_0x11ed36=_0x11ed36-0x0;var _0x1d8cbf=_0xecf3[_0x11ed36];return _0x1d8cbf;};'use strict';var _=require('lodash');var util=require(_0x3ecf('0x0'));var logger=require(_0x3ecf('0x1'))(_0x3ecf('0x2'));var moment=require(_0x3ecf('0x3'));var BPromise=require(_0x3ecf('0x4'));var rp=require(_0x3ecf('0x5'));var fs=require('fs');var path=require(_0x3ecf('0x6'));var rimraf=require(_0x3ecf('0x7'));var config=require(_0x3ecf('0x8'));var attributes=require(_0x3ecf('0x9'));module['exports']=function(_0x5f2c0f,_0x53e233){return _0x5f2c0f['define']('SugarcrmField',attributes,{'tableName':_0x3ecf('0xa'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x3ecf('0xb'),_0x3ecf('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcc0c=['api','bluebird','request-promise','rimraf','./intSugarcrmField.attributes','exports','SugarcrmField','sugarcrm_unique_index','FieldId','lodash','util','../../config/logger'];(function(_0x19c522,_0x2ca7a5){var _0x501c23=function(_0x3e7597){while(--_0x3e7597){_0x19c522['push'](_0x19c522['shift']());}};_0x501c23(++_0x2ca7a5);}(_0xcc0c,0x1b9));var _0xccc0=function(_0x128607,_0x242e5f){_0x128607=_0x128607-0x0;var _0x4ba37b=_0xcc0c[_0x128607];return _0x4ba37b;};'use strict';var _=require(_0xccc0('0x0'));var util=require(_0xccc0('0x1'));var logger=require(_0xccc0('0x2'))(_0xccc0('0x3'));var moment=require('moment');var BPromise=require(_0xccc0('0x4'));var rp=require(_0xccc0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xccc0('0x6'));var config=require('../../config/environment');var attributes=require(_0xccc0('0x7'));module[_0xccc0('0x8')]=function(_0x1e6e53,_0x2e4e54){return _0x1e6e53['define'](_0xccc0('0x9'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xccc0('0xa'),'fields':['idField',_0xccc0('0xb')],'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 23fe9d8..7992956 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 _0x0f8a=['client','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2701e5,_0x11d805){var _0x245e92=function(_0x1bac8f){while(--_0x1bac8f){_0x2701e5['push'](_0x2701e5['shift']());}};_0x245e92(++_0x11d805);}(_0x0f8a,0x10b));var _0xa0f8=function(_0x430ef6,_0x173056){_0x430ef6=_0x430ef6-0x0;var _0x4832f0=_0x0f8a[_0x430ef6];return _0x4832f0;};'use strict';var _=require(_0xa0f8('0x0'));var util=require(_0xa0f8('0x1'));var moment=require('moment');var BPromise=require(_0xa0f8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa0f8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa0f8('0x4'));var logger=require(_0xa0f8('0x5'))(_0xa0f8('0x6'));var config=require(_0xa0f8('0x7'));var jayson=require(_0xa0f8('0x8'));var client=jayson[_0xa0f8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d6aab,_0x211c77,_0x5294d5){return new BPromise(function(_0xa7a293,_0x22769d){return client[_0xa0f8('0xa')](_0x4d6aab,_0x5294d5)[_0xa0f8('0xb')](function(_0x5d90e0){logger[_0xa0f8('0xc')](_0xa0f8('0xd'),_0x211c77,_0xa0f8('0xe'));logger[_0xa0f8('0xf')](_0xa0f8('0x10'),_0x211c77,_0xa0f8('0xe'),JSON[_0xa0f8('0x11')](_0x5d90e0));if(_0x5d90e0[_0xa0f8('0x12')]){if(_0x5d90e0['error'][_0xa0f8('0x13')]===0x1f4){logger[_0xa0f8('0x12')](_0xa0f8('0xd'),_0x211c77,_0x5d90e0[_0xa0f8('0x12')]['message']);return _0x22769d(_0x5d90e0['error'][_0xa0f8('0x14')]);}logger[_0xa0f8('0x12')](_0xa0f8('0xd'),_0x211c77,_0x5d90e0[_0xa0f8('0x12')][_0xa0f8('0x14')]);return _0xa7a293(_0x5d90e0[_0xa0f8('0x12')][_0xa0f8('0x14')]);}else{logger[_0xa0f8('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x211c77,_0xa0f8('0xe'));_0xa7a293(_0x5d90e0[_0xa0f8('0x15')][_0xa0f8('0x14')]);}})[_0xa0f8('0x16')](function(_0x30edc4){logger['error'](_0xa0f8('0xd'),_0x211c77,_0x30edc4);_0x22769d(_0x30edc4);});});} \ No newline at end of file +var _0xd71e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x196c91,_0x109805){var _0x11e311=function(_0x1d8524){while(--_0x1d8524){_0x196c91['push'](_0x196c91['shift']());}};_0x11e311(++_0x109805);}(_0xd71e,0xbb));var _0xed71=function(_0x1a7550,_0x1edace){_0x1a7550=_0x1a7550-0x0;var _0x426e22=_0xd71e[_0x1a7550];return _0x426e22;};'use strict';var _=require(_0xed71('0x0'));var util=require('util');var moment=require(_0xed71('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed71('0x2'));var db=require(_0xed71('0x3'))['db'];var utils=require(_0xed71('0x4'));var logger=require(_0xed71('0x5'))('rpc');var config=require(_0xed71('0x6'));var jayson=require(_0xed71('0x7'));var client=jayson[_0xed71('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x571a89,_0x7f47f3,_0x8f3f45){return new BPromise(function(_0x452dd9,_0x11043c){return client['request'](_0x571a89,_0x8f3f45)[_0xed71('0x9')](function(_0x32e360){logger[_0xed71('0xa')](_0xed71('0xb'),_0x7f47f3,_0xed71('0xc'));logger[_0xed71('0xd')](_0xed71('0xe'),_0x7f47f3,'request\x20sent',JSON[_0xed71('0xf')](_0x32e360));if(_0x32e360[_0xed71('0x10')]){if(_0x32e360[_0xed71('0x10')][_0xed71('0x11')]===0x1f4){logger[_0xed71('0x10')](_0xed71('0xb'),_0x7f47f3,_0x32e360[_0xed71('0x10')][_0xed71('0x12')]);return _0x11043c(_0x32e360[_0xed71('0x10')][_0xed71('0x12')]);}logger['error']('SugarcrmField,\x20%s,\x20%s',_0x7f47f3,_0x32e360[_0xed71('0x10')]['message']);return _0x452dd9(_0x32e360[_0xed71('0x10')][_0xed71('0x12')]);}else{logger[_0xed71('0xa')](_0xed71('0xb'),_0x7f47f3,_0xed71('0xc'));_0x452dd9(_0x32e360[_0xed71('0x13')][_0xed71('0x12')]);}})[_0xed71('0x14')](function(_0x19302c){logger[_0xed71('0x10')](_0xed71('0xb'),_0x7f47f3,_0x19302c);_0x11043c(_0x19302c);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 2aa846b..027b722 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 _0xf0db=['index','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','/:id','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x3a1e4f,_0x2cc9a7){var _0x48c018=function(_0x2b7bb6){while(--_0x2b7bb6){_0x3a1e4f['push'](_0x3a1e4f['shift']());}};_0x48c018(++_0x2cc9a7);}(_0xf0db,0x12b));var _0xbf0d=function(_0x28aeb2,_0x319b38){_0x28aeb2=_0x28aeb2-0x0;var _0x1d33e1=_0xf0db[_0x28aeb2];return _0x1d33e1;};'use strict';var multer=require(_0xbf0d('0x0'));var util=require(_0xbf0d('0x1'));var path=require('path');var timeout=require(_0xbf0d('0x2'));var express=require(_0xbf0d('0x3'));var router=express[_0xbf0d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbf0d('0x5'));var interaction=require(_0xbf0d('0x6'));var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router[_0xbf0d('0x7')]('/',auth[_0xbf0d('0x8')](),controller[_0xbf0d('0x9')]);router[_0xbf0d('0x7')]('/:id',auth[_0xbf0d('0x8')](),controller[_0xbf0d('0xa')]);router[_0xbf0d('0x7')](_0xbf0d('0xb'),auth[_0xbf0d('0x8')](),controller[_0xbf0d('0xc')]);router[_0xbf0d('0x7')](_0xbf0d('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0xbf0d('0xe')]('/',auth[_0xbf0d('0x8')](),controller[_0xbf0d('0xf')]);router[_0xbf0d('0xe')](_0xbf0d('0xb'),auth[_0xbf0d('0x8')](),controller[_0xbf0d('0x10')]);router[_0xbf0d('0x11')]('/:id',auth[_0xbf0d('0x8')](),controller[_0xbf0d('0x12')]);router['delete'](_0xbf0d('0x13'),auth[_0xbf0d('0x8')](),controller[_0xbf0d('0x14')]);module[_0xbf0d('0x15')]=router; \ No newline at end of file +var _0x542b=['put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','isAuthenticated','index','get','show','getConfigurations','/:id/fields','create','addConfiguration'];(function(_0x4706a6,_0x5a1c63){var _0x1bb705=function(_0x484ebb){while(--_0x484ebb){_0x4706a6['push'](_0x4706a6['shift']());}};_0x1bb705(++_0x5a1c63);}(_0x542b,0xec));var _0xb542=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0x542b[_0xbb14db];return _0x36bed7;};'use strict';var multer=require(_0xb542('0x0'));var util=require(_0xb542('0x1'));var path=require('path');var timeout=require(_0xb542('0x2'));var express=require(_0xb542('0x3'));var router=express[_0xb542('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb542('0x5'));var interaction=require(_0xb542('0x6'));var config=require('../../config/environment');var controller=require(_0xb542('0x7'));router['get']('/',auth[_0xb542('0x8')](),controller[_0xb542('0x9')]);router[_0xb542('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xb542('0xb')]);router[_0xb542('0xa')]('/:id/configurations',auth[_0xb542('0x8')](),controller[_0xb542('0xc')]);router[_0xb542('0xa')](_0xb542('0xd'),auth[_0xb542('0x8')](),controller['getFields']);router['post']('/',auth[_0xb542('0x8')](),controller[_0xb542('0xe')]);router['post']('/:id/configurations',auth[_0xb542('0x8')](),controller[_0xb542('0xf')]);router[_0xb542('0x10')](_0xb542('0x11'),auth[_0xb542('0x8')](),controller['update']);router[_0xb542('0x12')]('/:id',auth[_0xb542('0x8')](),controller[_0xb542('0x13')]);module[_0xb542('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 28e3125..04cfbab 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 _0xa9a1=['STRING','HelpDesk','sequelize'];(function(_0x186502,_0xe7c7a4){var _0x2bb373=function(_0x3b24b2){while(--_0x3b24b2){_0x186502['push'](_0x186502['shift']());}};_0x2bb373(++_0xe7c7a4);}(_0xa9a1,0x74));var _0x1a9a=function(_0x2cce86,_0x11842f){_0x2cce86=_0x2cce86-0x0;var _0x371254=_0xa9a1[_0x2cce86];return _0x371254;};'use strict';var Sequelize=require(_0x1a9a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x1a9a('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x1a9a('0x1')],'allowNull':![],'defaultValue':_0x1a9a('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x1a9a('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x1a9a('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x01af=['STRING','sequelize','exports'];(function(_0x349c0a,_0x35383b){var _0x5b29e1=function(_0x383741){while(--_0x383741){_0x349c0a['push'](_0x349c0a['shift']());}};_0x5b29e1(++_0x35383b);}(_0x01af,0xc1));var _0xf01a=function(_0x2b4e2a,_0x30ebce){_0x2b4e2a=_0x2b4e2a-0x0;var _0x418dad=_0x01af[_0x2b4e2a];return _0x418dad;};'use strict';var Sequelize=require(_0xf01a('0x0'));module[_0xf01a('0x1')]={'name':{'type':Sequelize[_0xf01a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf01a('0x2')]},'username':{'type':Sequelize[_0xf01a('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xf01a('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xf01a('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0xf01a('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index f155d84..444c12f 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 _0x2272=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','update','then','error','stack','name','index','map','VtigerAccount','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','create','body','find','params','destroy','getConfigurations','hasOwnProperty','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','channel','VtigerConfiguration','VtigerField','md5','username','description','remoteUri','serverUrl','moduleName','slice','substring','lastIndexOf','format','GET','getchallenge','success','login','result','token','sessionName','autogenerated','reference','owner','remove','includes','editable','label','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x328ac9,_0x2f7225){var _0x2b3a0a=function(_0x759e26){while(--_0x759e26){_0x328ac9['push'](_0x328ac9['shift']());}};_0x2b3a0a(++_0x2f7225);}(_0x2272,0x1cd));var _0x2227=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2272[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2227('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2227('0x1'));var rp=require(_0x2227('0x2'));var moment=require(_0x2227('0x3'));var BPromise=require(_0x2227('0x4'));var Mustache=require(_0x2227('0x5'));var util=require('util');var path=require(_0x2227('0x6'));var sox=require(_0x2227('0x7'));var csv=require(_0x2227('0x8'));var ejs=require(_0x2227('0x9'));var fs=require('fs');var fs_extra=require(_0x2227('0xa'));var _=require('lodash');var squel=require(_0x2227('0xb'));var crypto=require(_0x2227('0xc'));var jsforce=require(_0x2227('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2227('0x8'));var querystring=require('querystring');var Papa=require(_0x2227('0xe'));var Redis=require(_0x2227('0xf'));var authService=require(_0x2227('0x10'));var qs=require(_0x2227('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2227('0x12'));var logger=require(_0x2227('0x13'))(_0x2227('0x14'));var utils=require(_0x2227('0x15'));var config=require(_0x2227('0x16'));var licenseUtil=require(_0x2227('0x17'));var db=require(_0x2227('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x56f493,_0x1128ac){_0x1128ac=_0x1128ac||0xcc;return function(_0x357848){if(_0x357848){return _0x56f493[_0x2227('0x19')](_0x1128ac);}return _0x56f493[_0x2227('0x1a')](_0x1128ac)[_0x2227('0x1b')]();};}function respondWithResult(_0x37046e,_0x3115c0){_0x3115c0=_0x3115c0||0xc8;return function(_0x5072c2){if(_0x5072c2){return _0x37046e['status'](_0x3115c0)['json'](_0x5072c2);}};}function respondWithFilteredResult(_0x509da8,_0x250a7e){return function(_0x4eb3a1){if(_0x4eb3a1){var _0x327291=typeof _0x250a7e['offset']===_0x2227('0x1c')&&typeof _0x250a7e[_0x2227('0x1d')]===_0x2227('0x1c');var _0x4e6f7e=_0x4eb3a1[_0x2227('0x1e')];var _0x15fcb0=_0x327291?0x0:_0x250a7e[_0x2227('0x1f')];var _0x21d2b7=_0x327291?_0x4eb3a1[_0x2227('0x1e')]:_0x250a7e['offset']+_0x250a7e[_0x2227('0x1d')];var _0x175517;if(_0x21d2b7>=_0x4e6f7e){_0x21d2b7=_0x4e6f7e;_0x175517=0xc8;}else{_0x175517=0xce;}_0x509da8[_0x2227('0x1a')](_0x175517);return _0x509da8[_0x2227('0x20')](_0x2227('0x21'),_0x15fcb0+'-'+_0x21d2b7+'/'+_0x4e6f7e)[_0x2227('0x22')](_0x4eb3a1);}return null;};}function patchUpdates(_0x27f403){return function(_0xeff6ce){try{jsonpatch['apply'](_0xeff6ce,_0x27f403,!![]);}catch(_0x5a7d01){return BPromise[_0x2227('0x23')](_0x5a7d01);}return _0xeff6ce['save']();};}function saveUpdates(_0x34773d,_0x4c82e6){return function(_0x36cb12){if(_0x36cb12){return _0x36cb12[_0x2227('0x24')](_0x34773d)['then'](function(_0x1713a7){return _0x1713a7;});}return null;};}function removeEntity(_0x158501,_0x48a1d9){return function(_0x2d8fd1){if(_0x2d8fd1){return _0x2d8fd1['destroy']()[_0x2227('0x25')](function(){_0x158501['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ac3d0,_0x249903){return function(_0x244ff2){if(!_0x244ff2){_0x3ac3d0[_0x2227('0x19')](0x194);}return _0x244ff2;};}function handleError(_0xd66cd9,_0x282d85){_0x282d85=_0x282d85||0x1f4;return function(_0x4a90ad){logger[_0x2227('0x26')](_0x4a90ad[_0x2227('0x27')]);if(_0x4a90ad['name']){delete _0x4a90ad[_0x2227('0x28')];}_0xd66cd9[_0x2227('0x1a')](_0x282d85)['send'](_0x4a90ad);};}exports[_0x2227('0x29')]=function(_0x3a722f,_0x11bab0){var _0x291efd={},_0x2e354a={},_0x345ac1={'count':0x0,'rows':[]};var _0x28d4a4=_[_0x2227('0x2a')](db[_0x2227('0x2b')][_0x2227('0x2c')],function(_0x1811ff){return{'name':_0x1811ff['fieldName'],'type':_0x1811ff['type'][_0x2227('0x2d')]};});_0x2e354a[_0x2227('0x2e')]=_[_0x2227('0x2a')](_0x28d4a4,_0x2227('0x28'));_0x2e354a[_0x2227('0x2f')]=_[_0x2227('0x30')](_0x3a722f[_0x2227('0x2f')]);_0x2e354a[_0x2227('0x31')]=_[_0x2227('0x32')](_0x2e354a[_0x2227('0x2e')],_0x2e354a[_0x2227('0x2f')]);_0x291efd['attributes']=_[_0x2227('0x32')](_0x2e354a[_0x2227('0x2e')],qs[_0x2227('0x33')](_0x3a722f['query'][_0x2227('0x33')]));_0x291efd[_0x2227('0x34')]=_0x291efd[_0x2227('0x34')][_0x2227('0x35')]?_0x291efd[_0x2227('0x34')]:_0x2e354a['model'];if(!_0x3a722f[_0x2227('0x2f')]['hasOwnProperty']('nolimit')){_0x291efd[_0x2227('0x1d')]=qs['limit'](_0x3a722f[_0x2227('0x2f')][_0x2227('0x1d')]);_0x291efd[_0x2227('0x1f')]=qs[_0x2227('0x1f')](_0x3a722f[_0x2227('0x2f')][_0x2227('0x1f')]);}_0x291efd[_0x2227('0x36')]=qs[_0x2227('0x37')](_0x3a722f['query']['sort']);_0x291efd[_0x2227('0x38')]=qs[_0x2227('0x31')](_['pick'](_0x3a722f[_0x2227('0x2f')],_0x2e354a[_0x2227('0x31')]),_0x28d4a4);if(_0x3a722f['query'][_0x2227('0x39')]){_0x291efd[_0x2227('0x38')]=_[_0x2227('0x3a')](_0x291efd['where'],{'$or':_['map'](_0x28d4a4,function(_0x420073){if(_0x420073[_0x2227('0x3b')]!==_0x2227('0x3c')){var _0x1e1759={};_0x1e1759[_0x420073[_0x2227('0x28')]]={'$like':'%'+_0x3a722f['query']['filter']+'%'};return _0x1e1759;}})});}_0x291efd=_[_0x2227('0x3a')]({},_0x291efd,_0x3a722f[_0x2227('0x3d')]);var _0x5a5d33={'where':_0x291efd['where']};return db[_0x2227('0x2b')][_0x2227('0x1e')](_0x5a5d33)[_0x2227('0x25')](function(_0x5f57e8){_0x345ac1[_0x2227('0x1e')]=_0x5f57e8;if(_0x3a722f['query'][_0x2227('0x3e')]){_0x291efd[_0x2227('0x3f')]=[{'all':!![]}];}return db[_0x2227('0x2b')]['findAll'](_0x291efd);})['then'](function(_0x360002){_0x345ac1['rows']=_0x360002;return _0x345ac1;})[_0x2227('0x25')](respondWithFilteredResult(_0x11bab0,_0x291efd))[_0x2227('0x40')](handleError(_0x11bab0,null));};exports[_0x2227('0x41')]=function(_0x4c26b1,_0x5dc8f0){var _0x5db12b={'raw':![],'where':{'id':_0x4c26b1['params']['id']}},_0x5e5b47={};_0x5e5b47[_0x2227('0x2e')]=_[_0x2227('0x30')](db[_0x2227('0x2b')][_0x2227('0x2c')]);_0x5e5b47[_0x2227('0x2f')]=_[_0x2227('0x30')](_0x4c26b1[_0x2227('0x2f')]);_0x5e5b47[_0x2227('0x31')]=_[_0x2227('0x32')](_0x5e5b47['model'],_0x5e5b47['query']);_0x5db12b[_0x2227('0x34')]=_[_0x2227('0x32')](_0x5e5b47[_0x2227('0x2e')],qs[_0x2227('0x33')](_0x4c26b1[_0x2227('0x2f')]['fields']));_0x5db12b[_0x2227('0x34')]=_0x5db12b[_0x2227('0x34')][_0x2227('0x35')]?_0x5db12b['attributes']:_0x5e5b47[_0x2227('0x2e')];if(_0x4c26b1[_0x2227('0x2f')][_0x2227('0x3e')]){_0x5db12b[_0x2227('0x3f')]=[{'all':!![]}];}_0x5db12b=_[_0x2227('0x3a')]({},_0x5db12b,_0x4c26b1['options']);return db['VtigerAccount']['find'](_0x5db12b)[_0x2227('0x25')](handleEntityNotFound(_0x5dc8f0,null))[_0x2227('0x25')](respondWithResult(_0x5dc8f0,null))['catch'](handleError(_0x5dc8f0,null));};exports[_0x2227('0x42')]=function(_0x2b5475,_0x3525a0){return db[_0x2227('0x2b')][_0x2227('0x42')](_0x2b5475['body'],{})['then'](respondWithResult(_0x3525a0,0xc9))[_0x2227('0x40')](handleError(_0x3525a0,null));};exports[_0x2227('0x24')]=function(_0x4f8c4a,_0x5eaae2){if(_0x4f8c4a[_0x2227('0x43')]['id']){delete _0x4f8c4a['body']['id'];}return db['VtigerAccount'][_0x2227('0x44')]({'where':{'id':_0x4f8c4a[_0x2227('0x45')]['id']}})['then'](handleEntityNotFound(_0x5eaae2,null))['then'](saveUpdates(_0x4f8c4a[_0x2227('0x43')],null))[_0x2227('0x25')](respondWithResult(_0x5eaae2,null))[_0x2227('0x40')](handleError(_0x5eaae2,null));};exports[_0x2227('0x46')]=function(_0x5689b0,_0x1065b3){return db[_0x2227('0x2b')]['find']({'where':{'id':_0x5689b0[_0x2227('0x45')]['id']}})[_0x2227('0x25')](handleEntityNotFound(_0x1065b3,null))[_0x2227('0x25')](removeEntity(_0x1065b3,null))[_0x2227('0x40')](handleError(_0x1065b3,null));};exports[_0x2227('0x47')]=function(_0x2afed4,_0x4d47c9,_0x58194c){var _0x4e9daa={};var _0x3822ee={};var _0x57e7c8;var _0x3634e9;return db[_0x2227('0x2b')]['findOne']({'where':{'id':_0x2afed4['params']['id']}})[_0x2227('0x25')](handleEntityNotFound(_0x4d47c9,null))[_0x2227('0x25')](function(_0x28c2b6){if(_0x28c2b6){_0x57e7c8=_0x28c2b6;_0x3822ee[_0x2227('0x2e')]=_['keys'](db['VtigerConfiguration'][_0x2227('0x2c')]);_0x3822ee[_0x2227('0x2f')]=_[_0x2227('0x30')](_0x2afed4[_0x2227('0x2f')]);_0x3822ee[_0x2227('0x31')]=_[_0x2227('0x32')](_0x3822ee[_0x2227('0x2e')],_0x3822ee[_0x2227('0x2f')]);_0x4e9daa[_0x2227('0x34')]=_[_0x2227('0x32')](_0x3822ee[_0x2227('0x2e')],qs['fields'](_0x2afed4[_0x2227('0x2f')][_0x2227('0x33')]));_0x4e9daa['attributes']=_0x4e9daa[_0x2227('0x34')]['length']?_0x4e9daa[_0x2227('0x34')]:_0x3822ee[_0x2227('0x2e')];_0x4e9daa[_0x2227('0x36')]=qs[_0x2227('0x37')](_0x2afed4[_0x2227('0x2f')][_0x2227('0x37')]);_0x4e9daa['where']=qs[_0x2227('0x31')](_['pick'](_0x2afed4[_0x2227('0x2f')],_0x3822ee[_0x2227('0x31')]));if(_0x2afed4[_0x2227('0x2f')][_0x2227('0x39')]){_0x4e9daa[_0x2227('0x38')]=_[_0x2227('0x3a')](_0x4e9daa[_0x2227('0x38')],{'$or':_[_0x2227('0x2a')](_0x4e9daa['attributes'],function(_0x282318){var _0x44a7ce={};_0x44a7ce[_0x282318]={'$like':'%'+_0x2afed4['query']['filter']+'%'};return _0x44a7ce;})});}_0x4e9daa=_[_0x2227('0x3a')]({},_0x4e9daa,_0x2afed4[_0x2227('0x3d')]);return _0x57e7c8[_0x2227('0x47')](_0x4e9daa);}})[_0x2227('0x25')](function(_0x418c04){if(_0x418c04){_0x3634e9=_0x418c04[_0x2227('0x35')];if(!_0x2afed4[_0x2227('0x2f')][_0x2227('0x48')](_0x2227('0x49'))){_0x4e9daa['limit']=qs[_0x2227('0x1d')](_0x2afed4[_0x2227('0x2f')][_0x2227('0x1d')]);_0x4e9daa[_0x2227('0x1f')]=qs['offset'](_0x2afed4[_0x2227('0x2f')][_0x2227('0x1f')]);}return _0x57e7c8[_0x2227('0x47')](_0x4e9daa);}})[_0x2227('0x25')](function(_0x943dd4){if(_0x943dd4){return _0x943dd4?{'count':_0x3634e9,'rows':_0x943dd4}:null;}})[_0x2227('0x25')](respondWithResult(_0x4d47c9,null))['catch'](handleError(_0x4d47c9,null));};exports[_0x2227('0x4a')]=function(_0x26eb60,_0x26a942,_0x4c8dc3){if(_0x26eb60[_0x2227('0x43')]['id']){delete _0x26eb60[_0x2227('0x43')]['id'];}return db[_0x2227('0x2b')][_0x2227('0x4b')]({'where':{'id':_0x26eb60[_0x2227('0x45')]['id']}})['then'](handleEntityNotFound(_0x26a942,null))[_0x2227('0x25')](function(_0xc7a1f7){if(_0xc7a1f7){_0x26eb60[_0x2227('0x43')][_0x2227('0x4c')]=_0xc7a1f7['id'];_0x26eb60[_0x2227('0x43')][_0x2227('0x4d')]=integrations[_0x2227('0x4e')](_0x26eb60['body']['channel'],_0x26eb60[_0x2227('0x43')][_0x2227('0x3b')]);_0x26eb60['body'][_0x2227('0x4f')]=integrations['getDescriptions'](_0x26eb60['body'][_0x2227('0x50')],_0x26eb60['body'][_0x2227('0x3b')]);return db[_0x2227('0x51')][_0x2227('0x42')](_0x26eb60[_0x2227('0x43')],{'include':[{'model':db[_0x2227('0x52')],'as':_0x2227('0x4d')},{'model':db[_0x2227('0x52')],'as':_0x2227('0x4f')}]});}return null;})['then'](respondWithResult(_0x26a942,null))[_0x2227('0x40')](handleError(_0x26a942,null));};var md5=require(_0x2227('0x53'));exports['getFields']=function(_0x4e131f,_0x3c10fb,_0x4c3ae5){var _0x53f089=null;var _0x3b80e8=null;var _0x25fe41=null;var _0x5a13b5=null;var _0x226009='';return db[_0x2227('0x2b')][_0x2227('0x4b')]({'where':{'id':_0x4e131f[_0x2227('0x45')]['id']},'attributes':['id',_0x2227('0x28'),_0x2227('0x54'),_0x2227('0x55'),'moduleName',_0x2227('0x56'),_0x2227('0x57'),'accessKey']})[_0x2227('0x25')](handleEntityNotFound(_0x3c10fb,null))[_0x2227('0x25')](function(_0x37fec7){if(_0x37fec7){_0x53f089=_0x37fec7[_0x2227('0x54')];_0x3b80e8=_0x37fec7['accessKey'];_0x25fe41=_0x37fec7[_0x2227('0x58')];_0x226009=_0x37fec7[_0x2227('0x56')];var _0x46c981=_0x226009[_0x2227('0x59')](-0x1);if(_0x46c981==='/'){_0x226009=_0x226009[_0x2227('0x5a')](0x0,_0x226009[_0x2227('0x5b')](_0x46c981));}_0x5a13b5=util[_0x2227('0x5c')]('%s/webservice.php',_0x226009);var _0x5428cf={'method':_0x2227('0x5d'),'uri':_0x5a13b5,'qs':{'operation':_0x2227('0x5e'),'username':_0x37fec7[_0x2227('0x54')]},'json':!![]};return rp(_0x5428cf);}})['then'](function(_0x140f13){if(_0x140f13[_0x2227('0x5f')]){var _0x1a47ca={'method':'POST','uri':_0x5a13b5,'form':{'operation':_0x2227('0x60'),'username':_0x53f089,'accessKey':md5(_0x140f13[_0x2227('0x61')][_0x2227('0x62')]+_0x3b80e8)},'json':!![]};return rp(_0x1a47ca);}})['then'](function(_0x48d853){if(_0x48d853['success']){var _0x2abd18={'method':_0x2227('0x5d'),'uri':_0x5a13b5,'qs':{'operation':'describe','username':_0x53f089,'sessionName':_0x48d853[_0x2227('0x61')][_0x2227('0x63')],'elementType':_0x25fe41},'json':!![]};return rp(_0x2abd18);}})[_0x2227('0x25')](function(_0xa04d47){if(_0xa04d47[_0x2227('0x5f')]){var _0x38ade0=[_0x2227('0x64'),_0x2227('0x65'),_0x2227('0x66')];_[_0x2227('0x67')](_0xa04d47[_0x2227('0x61')][_0x2227('0x33')],function(_0x10d28b){return _0x38ade0[_0x2227('0x68')](_0x10d28b[_0x2227('0x3b')][_0x2227('0x28')]);});_[_0x2227('0x67')](_0xa04d47[_0x2227('0x61')]['fields'],function(_0x5e096d){return _0x5e096d[_0x2227('0x69')]==='false';});return{'count':_0xa04d47[_0x2227('0x61')][_0x2227('0x33')]['length'],'rows':_[_0x2227('0x2a')](_0xa04d47[_0x2227('0x61')][_0x2227('0x33')],function(_0x5bd6fe){return{'id':_0x5bd6fe['name'],'name':_0x5bd6fe[_0x2227('0x6a')],'custom':_['startsWith'](_0x5bd6fe[_0x2227('0x28')],_0x2227('0x6b'))?!![]:![],'options':_0x5bd6fe['type'][_0x2227('0x28')]===_0x2227('0x6c')&&_0x5bd6fe[_0x2227('0x3b')][_0x2227('0x6d')][_0x2227('0x35')]>0x0?_[_0x2227('0x2a')](_0x5bd6fe[_0x2227('0x3b')][_0x2227('0x6d')],function(_0x3b93b2){return{'name':_0x3b93b2[_0x2227('0x6a')],'value':_0x3b93b2[_0x2227('0x6e')]};}):[]};})};}})[_0x2227('0x25')](respondWithResult(_0x3c10fb,null))[_0x2227('0x40')](function(_0x30abdd){console[_0x2227('0x6f')](_0x2227('0x70')+_0x30abdd);var _0x5ec907=_0x4e131f[_0x2227('0x2f')][_0x2227('0x71')]?0x1f4:_0x30abdd[_0x2227('0x72')]||0x1f4;logger[_0x2227('0x26')](_0x2227('0x73'),_0x2227('0x74'),_0x5ec907,JSON[_0x2227('0x75')](_0x30abdd));delete _0x30abdd['name'];if(_0x5ec907===0x191){_0x5ec907=0x190;}_0x3c10fb[_0x2227('0x1a')](_0x5ec907)[_0x2227('0x76')](_0x4e131f[_0x2227('0x2f')]['test']?{'message':_0x2227('0x77'),'statusCode':_0x30abdd[_0x2227('0x72')]}:_0x30abdd);});}; \ No newline at end of file +var _0x0ea5=['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','status','json','limit','undefined','count','offset','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','VtigerAccount','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','findOne','pick','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','Subjects','md5','username','description','moduleName','serverUrl','remoteUri','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','POST','login','result','token','success','describe','autogenerated','reference','owner','remove','includes','editable','false','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0ea5,0x1f4));var _0x50ea=function(_0x10edbd,_0x30764a){_0x10edbd=_0x10edbd-0x0;var _0x99e50f=_0x0ea5[_0x10edbd];return _0x99e50f;};'use strict';var emlformat=require(_0x50ea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x50ea('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x50ea('0x2'));var moment=require(_0x50ea('0x3'));var BPromise=require(_0x50ea('0x4'));var Mustache=require(_0x50ea('0x5'));var util=require(_0x50ea('0x6'));var path=require(_0x50ea('0x7'));var sox=require(_0x50ea('0x8'));var csv=require('to-csv');var ejs=require(_0x50ea('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50ea('0xa'));var squel=require(_0x50ea('0xb'));var crypto=require(_0x50ea('0xc'));var jsforce=require(_0x50ea('0xd'));var deskjs=require(_0x50ea('0xe'));var toCsv=require('to-csv');var querystring=require(_0x50ea('0xf'));var Papa=require(_0x50ea('0x10'));var Redis=require(_0x50ea('0x11'));var authService=require(_0x50ea('0x12'));var qs=require(_0x50ea('0x13'));var as=require(_0x50ea('0x14'));var hardwareService=require(_0x50ea('0x15'));var logger=require(_0x50ea('0x16'))('api');var utils=require(_0x50ea('0x17'));var config=require(_0x50ea('0x18'));var licenseUtil=require(_0x50ea('0x19'));var db=require(_0x50ea('0x1a'))['db'];var integrations=require(_0x50ea('0x1b'));function respondWithStatusCode(_0xb2fab1,_0x300125){_0x300125=_0x300125||0xcc;return function(_0x382a33){if(_0x382a33){return _0xb2fab1[_0x50ea('0x1c')](_0x300125);}return _0xb2fab1[_0x50ea('0x1d')](_0x300125)['end']();};}function respondWithResult(_0x3f52fd,_0xc32c55){_0xc32c55=_0xc32c55||0xc8;return function(_0x42553c){if(_0x42553c){return _0x3f52fd[_0x50ea('0x1d')](_0xc32c55)[_0x50ea('0x1e')](_0x42553c);}};}function respondWithFilteredResult(_0x5c3d30,_0x143755){return function(_0x53f485){if(_0x53f485){var _0x194965=typeof _0x143755['offset']==='undefined'&&typeof _0x143755[_0x50ea('0x1f')]===_0x50ea('0x20');var _0x2a959e=_0x53f485[_0x50ea('0x21')];var _0x200352=_0x194965?0x0:_0x143755[_0x50ea('0x22')];var _0x3b58d5=_0x194965?_0x53f485[_0x50ea('0x21')]:_0x143755[_0x50ea('0x22')]+_0x143755[_0x50ea('0x1f')];var _0x3710c0;if(_0x3b58d5>=_0x2a959e){_0x3b58d5=_0x2a959e;_0x3710c0=0xc8;}else{_0x3710c0=0xce;}_0x5c3d30[_0x50ea('0x1d')](_0x3710c0);return _0x5c3d30[_0x50ea('0x23')]('Content-Range',_0x200352+'-'+_0x3b58d5+'/'+_0x2a959e)[_0x50ea('0x1e')](_0x53f485);}return null;};}function patchUpdates(_0x4b20c8){return function(_0x125177){try{jsonpatch[_0x50ea('0x24')](_0x125177,_0x4b20c8,!![]);}catch(_0x44ab0d){return BPromise[_0x50ea('0x25')](_0x44ab0d);}return _0x125177['save']();};}function saveUpdates(_0x4d0f0a,_0x3efa2c){return function(_0x458ef2){if(_0x458ef2){return _0x458ef2[_0x50ea('0x26')](_0x4d0f0a)[_0x50ea('0x27')](function(_0x2c0444){return _0x2c0444;});}return null;};}function removeEntity(_0x59b306,_0x2e6226){return function(_0x34f64b){if(_0x34f64b){return _0x34f64b[_0x50ea('0x28')]()['then'](function(){_0x59b306[_0x50ea('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc6d593,_0x5772a9){return function(_0x5218a7){if(!_0x5218a7){_0xc6d593[_0x50ea('0x1c')](0x194);}return _0x5218a7;};}function handleError(_0x14a80f,_0x102838){_0x102838=_0x102838||0x1f4;return function(_0x4d39e3){logger[_0x50ea('0x29')](_0x4d39e3[_0x50ea('0x2a')]);if(_0x4d39e3[_0x50ea('0x2b')]){delete _0x4d39e3[_0x50ea('0x2b')];}_0x14a80f['status'](_0x102838)[_0x50ea('0x2c')](_0x4d39e3);};}exports[_0x50ea('0x2d')]=function(_0x4daf45,_0x20ca0a){var _0x392c84={},_0x44e9e9={},_0x463f23={'count':0x0,'rows':[]};var _0x63b623=_[_0x50ea('0x2e')](db['VtigerAccount']['rawAttributes'],function(_0x30e6c4){return{'name':_0x30e6c4[_0x50ea('0x2f')],'type':_0x30e6c4[_0x50ea('0x30')][_0x50ea('0x31')]};});_0x44e9e9[_0x50ea('0x32')]=_['map'](_0x63b623,'name');_0x44e9e9[_0x50ea('0x33')]=_[_0x50ea('0x34')](_0x4daf45[_0x50ea('0x33')]);_0x44e9e9[_0x50ea('0x35')]=_[_0x50ea('0x36')](_0x44e9e9[_0x50ea('0x32')],_0x44e9e9[_0x50ea('0x33')]);_0x392c84[_0x50ea('0x37')]=_[_0x50ea('0x36')](_0x44e9e9[_0x50ea('0x32')],qs[_0x50ea('0x38')](_0x4daf45[_0x50ea('0x33')][_0x50ea('0x38')]));_0x392c84[_0x50ea('0x37')]=_0x392c84[_0x50ea('0x37')][_0x50ea('0x39')]?_0x392c84[_0x50ea('0x37')]:_0x44e9e9[_0x50ea('0x32')];if(!_0x4daf45[_0x50ea('0x33')][_0x50ea('0x3a')](_0x50ea('0x3b'))){_0x392c84['limit']=qs[_0x50ea('0x1f')](_0x4daf45[_0x50ea('0x33')][_0x50ea('0x1f')]);_0x392c84[_0x50ea('0x22')]=qs[_0x50ea('0x22')](_0x4daf45[_0x50ea('0x33')][_0x50ea('0x22')]);}_0x392c84[_0x50ea('0x3c')]=qs[_0x50ea('0x3d')](_0x4daf45[_0x50ea('0x33')][_0x50ea('0x3d')]);_0x392c84[_0x50ea('0x3e')]=qs[_0x50ea('0x35')](_['pick'](_0x4daf45[_0x50ea('0x33')],_0x44e9e9['filters']),_0x63b623);if(_0x4daf45[_0x50ea('0x33')][_0x50ea('0x3f')]){_0x392c84[_0x50ea('0x3e')]=_[_0x50ea('0x40')](_0x392c84[_0x50ea('0x3e')],{'$or':_[_0x50ea('0x2e')](_0x63b623,function(_0x52ff4e){if(_0x52ff4e[_0x50ea('0x30')]!==_0x50ea('0x41')){var _0x436256={};_0x436256[_0x52ff4e[_0x50ea('0x2b')]]={'$like':'%'+_0x4daf45[_0x50ea('0x33')]['filter']+'%'};return _0x436256;}})});}_0x392c84=_[_0x50ea('0x40')]({},_0x392c84,_0x4daf45[_0x50ea('0x42')]);var _0x5f3bd5={'where':_0x392c84[_0x50ea('0x3e')]};return db[_0x50ea('0x43')][_0x50ea('0x21')](_0x5f3bd5)[_0x50ea('0x27')](function(_0x1b64ea){_0x463f23[_0x50ea('0x21')]=_0x1b64ea;if(_0x4daf45[_0x50ea('0x33')][_0x50ea('0x44')]){_0x392c84[_0x50ea('0x45')]=[{'all':!![]}];}return db[_0x50ea('0x43')][_0x50ea('0x46')](_0x392c84);})['then'](function(_0x2140fe){_0x463f23[_0x50ea('0x47')]=_0x2140fe;return _0x463f23;})['then'](respondWithFilteredResult(_0x20ca0a,_0x392c84))[_0x50ea('0x48')](handleError(_0x20ca0a,null));};exports[_0x50ea('0x49')]=function(_0x5c40e0,_0x21797d){var _0x5484c8={'raw':![],'where':{'id':_0x5c40e0[_0x50ea('0x4a')]['id']}},_0x1384bd={};_0x1384bd[_0x50ea('0x32')]=_[_0x50ea('0x34')](db[_0x50ea('0x43')][_0x50ea('0x4b')]);_0x1384bd[_0x50ea('0x33')]=_[_0x50ea('0x34')](_0x5c40e0['query']);_0x1384bd[_0x50ea('0x35')]=_[_0x50ea('0x36')](_0x1384bd[_0x50ea('0x32')],_0x1384bd[_0x50ea('0x33')]);_0x5484c8[_0x50ea('0x37')]=_[_0x50ea('0x36')](_0x1384bd[_0x50ea('0x32')],qs[_0x50ea('0x38')](_0x5c40e0[_0x50ea('0x33')][_0x50ea('0x38')]));_0x5484c8[_0x50ea('0x37')]=_0x5484c8['attributes'][_0x50ea('0x39')]?_0x5484c8[_0x50ea('0x37')]:_0x1384bd[_0x50ea('0x32')];if(_0x5c40e0[_0x50ea('0x33')]['includeAll']){_0x5484c8[_0x50ea('0x45')]=[{'all':!![]}];}_0x5484c8=_[_0x50ea('0x40')]({},_0x5484c8,_0x5c40e0[_0x50ea('0x42')]);return db[_0x50ea('0x43')][_0x50ea('0x4c')](_0x5484c8)[_0x50ea('0x27')](handleEntityNotFound(_0x21797d,null))[_0x50ea('0x27')](respondWithResult(_0x21797d,null))[_0x50ea('0x48')](handleError(_0x21797d,null));};exports[_0x50ea('0x4d')]=function(_0xdaf31a,_0x5472be){return db[_0x50ea('0x43')]['create'](_0xdaf31a['body'],{})[_0x50ea('0x27')](respondWithResult(_0x5472be,0xc9))[_0x50ea('0x48')](handleError(_0x5472be,null));};exports['update']=function(_0x356404,_0x2cb375){if(_0x356404[_0x50ea('0x4e')]['id']){delete _0x356404[_0x50ea('0x4e')]['id'];}return db['VtigerAccount'][_0x50ea('0x4c')]({'where':{'id':_0x356404['params']['id']}})[_0x50ea('0x27')](handleEntityNotFound(_0x2cb375,null))[_0x50ea('0x27')](saveUpdates(_0x356404[_0x50ea('0x4e')],null))[_0x50ea('0x27')](respondWithResult(_0x2cb375,null))[_0x50ea('0x48')](handleError(_0x2cb375,null));};exports[_0x50ea('0x28')]=function(_0x17b053,_0x5c8198){return db[_0x50ea('0x43')]['find']({'where':{'id':_0x17b053[_0x50ea('0x4a')]['id']}})[_0x50ea('0x27')](handleEntityNotFound(_0x5c8198,null))[_0x50ea('0x27')](removeEntity(_0x5c8198,null))[_0x50ea('0x48')](handleError(_0x5c8198,null));};exports['getConfigurations']=function(_0x1e25f7,_0x2c08e0,_0x5aefa9){var _0x5607fd={};var _0x2cf73e={};var _0x70f10d;var _0x2c85ab;return db[_0x50ea('0x43')][_0x50ea('0x4f')]({'where':{'id':_0x1e25f7['params']['id']}})['then'](handleEntityNotFound(_0x2c08e0,null))[_0x50ea('0x27')](function(_0xc4257d){if(_0xc4257d){_0x70f10d=_0xc4257d;_0x2cf73e['model']=_['keys'](db['VtigerConfiguration'][_0x50ea('0x4b')]);_0x2cf73e[_0x50ea('0x33')]=_[_0x50ea('0x34')](_0x1e25f7[_0x50ea('0x33')]);_0x2cf73e[_0x50ea('0x35')]=_[_0x50ea('0x36')](_0x2cf73e[_0x50ea('0x32')],_0x2cf73e[_0x50ea('0x33')]);_0x5607fd[_0x50ea('0x37')]=_[_0x50ea('0x36')](_0x2cf73e[_0x50ea('0x32')],qs['fields'](_0x1e25f7['query'][_0x50ea('0x38')]));_0x5607fd['attributes']=_0x5607fd['attributes'][_0x50ea('0x39')]?_0x5607fd[_0x50ea('0x37')]:_0x2cf73e[_0x50ea('0x32')];_0x5607fd[_0x50ea('0x3c')]=qs[_0x50ea('0x3d')](_0x1e25f7['query'][_0x50ea('0x3d')]);_0x5607fd['where']=qs[_0x50ea('0x35')](_[_0x50ea('0x50')](_0x1e25f7[_0x50ea('0x33')],_0x2cf73e[_0x50ea('0x35')]));if(_0x1e25f7[_0x50ea('0x33')][_0x50ea('0x3f')]){_0x5607fd[_0x50ea('0x3e')]=_[_0x50ea('0x40')](_0x5607fd[_0x50ea('0x3e')],{'$or':_['map'](_0x5607fd[_0x50ea('0x37')],function(_0x2b0c33){var _0x2c766f={};_0x2c766f[_0x2b0c33]={'$like':'%'+_0x1e25f7['query'][_0x50ea('0x3f')]+'%'};return _0x2c766f;})});}_0x5607fd=_[_0x50ea('0x40')]({},_0x5607fd,_0x1e25f7[_0x50ea('0x42')]);return _0x70f10d['getConfigurations'](_0x5607fd);}})[_0x50ea('0x27')](function(_0x3c8985){if(_0x3c8985){_0x2c85ab=_0x3c8985['length'];if(!_0x1e25f7[_0x50ea('0x33')][_0x50ea('0x3a')](_0x50ea('0x3b'))){_0x5607fd['limit']=qs[_0x50ea('0x1f')](_0x1e25f7['query'][_0x50ea('0x1f')]);_0x5607fd[_0x50ea('0x22')]=qs[_0x50ea('0x22')](_0x1e25f7['query'][_0x50ea('0x22')]);}return _0x70f10d[_0x50ea('0x51')](_0x5607fd);}})['then'](function(_0x4a35ec){if(_0x4a35ec){return _0x4a35ec?{'count':_0x2c85ab,'rows':_0x4a35ec}:null;}})[_0x50ea('0x27')](respondWithResult(_0x2c08e0,null))[_0x50ea('0x48')](handleError(_0x2c08e0,null));};exports[_0x50ea('0x52')]=function(_0xdffedd,_0x86f4d5,_0x402dc4){if(_0xdffedd[_0x50ea('0x4e')]['id']){delete _0xdffedd['body']['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0xdffedd[_0x50ea('0x4a')]['id']}})[_0x50ea('0x27')](handleEntityNotFound(_0x86f4d5,null))['then'](function(_0x8f18d5){if(_0x8f18d5){_0xdffedd[_0x50ea('0x4e')][_0x50ea('0x53')]=_0x8f18d5['id'];_0xdffedd['body']['Subjects']=integrations[_0x50ea('0x54')](_0xdffedd[_0x50ea('0x4e')][_0x50ea('0x55')],_0xdffedd[_0x50ea('0x4e')][_0x50ea('0x30')]);_0xdffedd[_0x50ea('0x4e')][_0x50ea('0x56')]=integrations[_0x50ea('0x57')](_0xdffedd[_0x50ea('0x4e')][_0x50ea('0x55')],_0xdffedd[_0x50ea('0x4e')][_0x50ea('0x30')]);return db[_0x50ea('0x58')][_0x50ea('0x4d')](_0xdffedd[_0x50ea('0x4e')],{'include':[{'model':db[_0x50ea('0x59')],'as':_0x50ea('0x5a')},{'model':db[_0x50ea('0x59')],'as':_0x50ea('0x56')}]});}return null;})[_0x50ea('0x27')](respondWithResult(_0x86f4d5,null))[_0x50ea('0x48')](handleError(_0x86f4d5,null));};var md5=require(_0x50ea('0x5b'));exports['getFields']=function(_0x56bad6,_0x45f317,_0x11d2ee){var _0x142ed8=null;var _0x1b58eb=null;var _0xb21809=null;var _0x536c02=null;var _0x507a0d='';return db[_0x50ea('0x43')][_0x50ea('0x4f')]({'where':{'id':_0x56bad6[_0x50ea('0x4a')]['id']},'attributes':['id','name',_0x50ea('0x5c'),_0x50ea('0x5d'),_0x50ea('0x5e'),'remoteUri',_0x50ea('0x5f'),'accessKey']})[_0x50ea('0x27')](handleEntityNotFound(_0x45f317,null))[_0x50ea('0x27')](function(_0x455bf2){if(_0x455bf2){_0x142ed8=_0x455bf2['username'];_0x1b58eb=_0x455bf2['accessKey'];_0xb21809=_0x455bf2[_0x50ea('0x5e')];_0x507a0d=_0x455bf2[_0x50ea('0x60')];var _0x1d6e2d=_0x507a0d['slice'](-0x1);if(_0x1d6e2d==='/'){_0x507a0d=_0x507a0d[_0x50ea('0x61')](0x0,_0x507a0d[_0x50ea('0x62')](_0x1d6e2d));}_0x536c02=util[_0x50ea('0x63')](_0x50ea('0x64'),_0x507a0d);var _0x2f69c8={'method':_0x50ea('0x65'),'uri':_0x536c02,'qs':{'operation':_0x50ea('0x66'),'username':_0x455bf2[_0x50ea('0x5c')]},'json':!![]};return rp(_0x2f69c8);}})['then'](function(_0x43710b){if(_0x43710b['success']){var _0x2aad6b={'method':_0x50ea('0x67'),'uri':_0x536c02,'form':{'operation':_0x50ea('0x68'),'username':_0x142ed8,'accessKey':md5(_0x43710b[_0x50ea('0x69')][_0x50ea('0x6a')]+_0x1b58eb)},'json':!![]};return rp(_0x2aad6b);}})[_0x50ea('0x27')](function(_0x437062){if(_0x437062[_0x50ea('0x6b')]){var _0x3b80f2={'method':'GET','uri':_0x536c02,'qs':{'operation':_0x50ea('0x6c'),'username':_0x142ed8,'sessionName':_0x437062[_0x50ea('0x69')]['sessionName'],'elementType':_0xb21809},'json':!![]};return rp(_0x3b80f2);}})[_0x50ea('0x27')](function(_0x3d373b){if(_0x3d373b[_0x50ea('0x6b')]){var _0x68df93=[_0x50ea('0x6d'),_0x50ea('0x6e'),_0x50ea('0x6f')];_[_0x50ea('0x70')](_0x3d373b['result']['fields'],function(_0x24ecde){return _0x68df93[_0x50ea('0x71')](_0x24ecde['type'][_0x50ea('0x2b')]);});_[_0x50ea('0x70')](_0x3d373b[_0x50ea('0x69')][_0x50ea('0x38')],function(_0x310bae){return _0x310bae[_0x50ea('0x72')]===_0x50ea('0x73');});return{'count':_0x3d373b[_0x50ea('0x69')][_0x50ea('0x38')]['length'],'rows':_[_0x50ea('0x2e')](_0x3d373b[_0x50ea('0x69')][_0x50ea('0x38')],function(_0xd02d79){return{'id':_0xd02d79['name'],'name':_0xd02d79['label'],'custom':_[_0x50ea('0x74')](_0xd02d79[_0x50ea('0x2b')],_0x50ea('0x75'))?!![]:![],'options':_0xd02d79[_0x50ea('0x30')][_0x50ea('0x2b')]===_0x50ea('0x76')&&_0xd02d79[_0x50ea('0x30')][_0x50ea('0x77')]['length']>0x0?_[_0x50ea('0x2e')](_0xd02d79['type'][_0x50ea('0x77')],function(_0x17a012){return{'name':_0x17a012['label'],'value':_0x17a012[_0x50ea('0x78')]};}):[]};})};}})[_0x50ea('0x27')](respondWithResult(_0x45f317,null))[_0x50ea('0x48')](function(_0x464f78){console[_0x50ea('0x79')](_0x50ea('0x7a')+_0x464f78);var _0x39c982=_0x56bad6[_0x50ea('0x33')][_0x50ea('0x7b')]?0x1f4:_0x464f78[_0x50ea('0x7c')]||0x1f4;logger[_0x50ea('0x29')](_0x50ea('0x7d'),_0x50ea('0x7e'),_0x39c982,JSON[_0x50ea('0x7f')](_0x464f78));delete _0x464f78[_0x50ea('0x2b')];if(_0x39c982===0x191){_0x39c982=0x190;}_0x45f317[_0x50ea('0x1d')](_0x39c982)[_0x50ea('0x2c')](_0x56bad6[_0x50ea('0x33')]['test']?{'message':_0x50ea('0x80'),'statusCode':_0x464f78['statusCode']}:_0x464f78);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index b794fb3..29d7a15 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 _0xd5b9=['bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger','api','moment'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xd5b9,0x18f));var _0x9d5b=function(_0x2213e7,_0x24df2a){_0x2213e7=_0x2213e7-0x0;var _0x462f5c=_0xd5b9[_0x2213e7];return _0x462f5c;};'use strict';var _=require(_0x9d5b('0x0'));var util=require('util');var logger=require(_0x9d5b('0x1'))(_0x9d5b('0x2'));var moment=require(_0x9d5b('0x3'));var BPromise=require(_0x9d5b('0x4'));var rp=require(_0x9d5b('0x5'));var fs=require('fs');var path=require(_0x9d5b('0x6'));var rimraf=require(_0x9d5b('0x7'));var config=require(_0x9d5b('0x8'));var attributes=require(_0x9d5b('0x9'));var integrations=require(_0x9d5b('0xa'));module['exports']=function(_0x10a4e7,_0x361db3){return _0x10a4e7['define'](_0x9d5b('0xb'),attributes,{'tableName':_0x9d5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0caf=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','lodash'];(function(_0x2d41a6,_0xe78891){var _0x1cbec9=function(_0x50a6cb){while(--_0x50a6cb){_0x2d41a6['push'](_0x2d41a6['shift']());}};_0x1cbec9(++_0xe78891);}(_0x0caf,0x113));var _0xf0ca=function(_0x3c53a7,_0x5c4ec1){_0x3c53a7=_0x3c53a7-0x0;var _0x2fc01c=_0x0caf[_0x3c53a7];return _0x2fc01c;};'use strict';var _=require(_0xf0ca('0x0'));var util=require(_0xf0ca('0x1'));var logger=require('../../config/logger')(_0xf0ca('0x2'));var moment=require(_0xf0ca('0x3'));var BPromise=require(_0xf0ca('0x4'));var rp=require(_0xf0ca('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf0ca('0x6'));var config=require(_0xf0ca('0x7'));var attributes=require(_0xf0ca('0x8'));var integrations=require(_0xf0ca('0x9'));module['exports']=function(_0x401303,_0x3161b2){return _0x401303[_0xf0ca('0xa')](_0xf0ca('0xb'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 401a581..20b1484 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 _0x373d=['VtigerAccount','ShowVtigerAccount','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','info','request\x20sent','debug','stringify','error','code','message','VtigerAccount,\x20%s,\x20%s','result','catch','options','raw','where','attributes','limit','include','map','model','then','GetVtigerAccount'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x373d,0x1e2));var _0xd373=function(_0x2a4fe2,_0x3ec53a){_0x2a4fe2=_0x2a4fe2-0x0;var _0x225c4a=_0x373d[_0x2a4fe2];return _0x225c4a;};'use strict';var _=require(_0xd373('0x0'));var util=require('util');var moment=require(_0xd373('0x1'));var BPromise=require(_0xd373('0x2'));var rs=require(_0xd373('0x3'));var fs=require('fs');var Redis=require(_0xd373('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd373('0x5'));var logger=require(_0xd373('0x6'))(_0xd373('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd373('0x8')][_0xd373('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x446be6,_0x4008c5,_0x48d977){return new BPromise(function(_0xe79819,_0x51c074){return client['request'](_0x446be6,_0x48d977)['then'](function(_0x14472a){logger[_0xd373('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x4008c5,_0xd373('0xb'));logger[_0xd373('0xc')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x4008c5,'request\x20sent',JSON[_0xd373('0xd')](_0x14472a));if(_0x14472a[_0xd373('0xe')]){if(_0x14472a[_0xd373('0xe')][_0xd373('0xf')]===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x4008c5,_0x14472a['error'][_0xd373('0x10')]);return _0x51c074(_0x14472a[_0xd373('0xe')]['message']);}logger[_0xd373('0xe')](_0xd373('0x11'),_0x4008c5,_0x14472a[_0xd373('0xe')][_0xd373('0x10')]);return _0xe79819(_0x14472a[_0xd373('0xe')][_0xd373('0x10')]);}else{logger[_0xd373('0xa')](_0xd373('0x11'),_0x4008c5,_0xd373('0xb'));_0xe79819(_0x14472a[_0xd373('0x12')][_0xd373('0x10')]);}})[_0xd373('0x13')](function(_0x1921dd){logger['error'](_0xd373('0x11'),_0x4008c5,_0x1921dd);_0x51c074(_0x1921dd);});});}exports['GetVtigerAccount']=function(_0x460259){var _0x36d47a=this;return new Promise(function(_0x55c5c7,_0x1bbdbd){return db['VtigerAccount']['findAll']({'raw':_0x460259[_0xd373('0x14')]?_0x460259[_0xd373('0x14')][_0xd373('0x15')]===undefined?!![]:![]:!![],'where':_0x460259[_0xd373('0x14')]?_0x460259[_0xd373('0x14')][_0xd373('0x16')]||null:null,'attributes':_0x460259['options']?_0x460259[_0xd373('0x14')][_0xd373('0x17')]||null:null,'limit':_0x460259[_0xd373('0x14')]?_0x460259[_0xd373('0x14')][_0xd373('0x18')]||null:null,'include':_0x460259[_0xd373('0x14')]?_0x460259['options'][_0xd373('0x19')]?_[_0xd373('0x1a')](_0x460259[_0xd373('0x14')][_0xd373('0x19')],function(_0x217ee7){return{'model':db[_0x217ee7[_0xd373('0x1b')]],'as':_0x217ee7['as'],'attributes':_0x217ee7[_0xd373('0x17')],'include':_0x217ee7[_0xd373('0x19')]?_[_0xd373('0x1a')](_0x217ee7[_0xd373('0x19')],function(_0x437110){return{'model':db[_0x437110[_0xd373('0x1b')]],'as':_0x437110['as'],'attributes':_0x437110[_0xd373('0x17')],'include':_0x437110[_0xd373('0x19')]?_[_0xd373('0x1a')](_0x437110[_0xd373('0x19')],function(_0x50b987){return{'model':db[_0x50b987[_0xd373('0x1b')]],'as':_0x50b987['as'],'attributes':_0x50b987[_0xd373('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd373('0x1c')](function(_0x45ee58){logger[_0xd373('0xa')](_0xd373('0x1d'),_0x460259);logger[_0xd373('0xc')](_0xd373('0x1d'),_0x460259,JSON[_0xd373('0xd')](_0x45ee58));_0x55c5c7(_0x45ee58);})[_0xd373('0x13')](function(_0xbc420b){logger[_0xd373('0xe')](_0xd373('0x1d'),_0xbc420b['message'],_0x460259);_0x1bbdbd(_0x36d47a[_0xd373('0xe')](0x1f4,_0xbc420b['message']));});});};exports['ShowVtigerAccount']=function(_0xedc8f3){var _0x15da6c=this;return new Promise(function(_0x25e016,_0x23024c){return db[_0xd373('0x1e')]['find']({'raw':_0xedc8f3[_0xd373('0x14')]?_0xedc8f3[_0xd373('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0xedc8f3[_0xd373('0x14')]?_0xedc8f3[_0xd373('0x14')][_0xd373('0x16')]||null:null,'attributes':_0xedc8f3[_0xd373('0x14')]?_0xedc8f3[_0xd373('0x14')][_0xd373('0x17')]||null:null,'include':_0xedc8f3[_0xd373('0x14')]?_0xedc8f3[_0xd373('0x14')][_0xd373('0x19')]?_['map'](_0xedc8f3[_0xd373('0x14')][_0xd373('0x19')],function(_0x420c73){return{'model':db[_0x420c73[_0xd373('0x1b')]],'as':_0x420c73['as'],'attributes':_0x420c73[_0xd373('0x17')],'include':_0x420c73[_0xd373('0x19')]?_[_0xd373('0x1a')](_0x420c73[_0xd373('0x19')],function(_0xaa62aa){return{'model':db[_0xaa62aa[_0xd373('0x1b')]],'as':_0xaa62aa['as'],'attributes':_0xaa62aa[_0xd373('0x17')],'include':_0xaa62aa[_0xd373('0x19')]?_[_0xd373('0x1a')](_0xaa62aa[_0xd373('0x19')],function(_0x22429c){return{'model':db[_0x22429c['model']],'as':_0x22429c['as'],'attributes':_0x22429c[_0xd373('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd373('0x1c')](function(_0x186e39){logger[_0xd373('0xa')]('ShowVtigerAccount',_0xedc8f3);logger[_0xd373('0xc')](_0xd373('0x1f'),_0xedc8f3,JSON[_0xd373('0xd')](_0x186e39));_0x25e016(_0x186e39);})[_0xd373('0x13')](function(_0x38d8ec){logger[_0xd373('0xe')]('ShowVtigerAccount',_0x38d8ec['message'],_0xedc8f3);_0x23024c(_0x15da6c[_0xd373('0xe')](0x1f4,_0x38d8ec['message']));});});}; \ No newline at end of file +var _0x2547=['../../config/logger','../../config/environment','jayson/promise','client','http','request','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowVtigerAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3c49eb,_0x2a8653){var _0x58eea0=function(_0x32af7b){while(--_0x32af7b){_0x3c49eb['push'](_0x3c49eb['shift']());}};_0x58eea0(++_0x2a8653);}(_0x2547,0x1cd));var _0x7254=function(_0x926320,_0x1ac9ea){_0x926320=_0x926320-0x0;var _0x477023=_0x2547[_0x926320];return _0x477023;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var moment=require(_0x7254('0x1'));var BPromise=require(_0x7254('0x2'));var rs=require(_0x7254('0x3'));var fs=require('fs');var Redis=require(_0x7254('0x4'));var db=require(_0x7254('0x5'))['db'];var utils=require(_0x7254('0x6'));var logger=require(_0x7254('0x7'))('rpc');var config=require(_0x7254('0x8'));var jayson=require(_0x7254('0x9'));var client=jayson[_0x7254('0xa')][_0x7254('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b845f,_0x253b1e,_0x6e3d84){return new BPromise(function(_0x395913,_0x5da1ec){return client[_0x7254('0xc')](_0x4b845f,_0x6e3d84)['then'](function(_0x50925f){logger['info'](_0x7254('0xd'),_0x253b1e,_0x7254('0xe'));logger[_0x7254('0xf')](_0x7254('0x10'),_0x253b1e,_0x7254('0xe'),JSON[_0x7254('0x11')](_0x50925f));if(_0x50925f['error']){if(_0x50925f[_0x7254('0x12')]['code']===0x1f4){logger[_0x7254('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x253b1e,_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);return _0x5da1ec(_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);}logger[_0x7254('0x12')](_0x7254('0xd'),_0x253b1e,_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);return _0x395913(_0x50925f[_0x7254('0x12')][_0x7254('0x13')]);}else{logger[_0x7254('0x14')](_0x7254('0xd'),_0x253b1e,_0x7254('0xe'));_0x395913(_0x50925f['result'][_0x7254('0x13')]);}})[_0x7254('0x15')](function(_0xf47255){logger[_0x7254('0x12')](_0x7254('0xd'),_0x253b1e,_0xf47255);_0x5da1ec(_0xf47255);});});}exports[_0x7254('0x16')]=function(_0x2737e0){var _0x5dd23b=this;return new Promise(function(_0x1f48f6,_0x2283b7){return db[_0x7254('0x17')][_0x7254('0x18')]({'raw':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1a')]===undefined?!![]:![]:!![],'where':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1b')]||null:null,'attributes':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1c')]||null:null,'limit':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1d')]||null:null,'include':_0x2737e0[_0x7254('0x19')]?_0x2737e0[_0x7254('0x19')][_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x2737e0[_0x7254('0x19')]['include'],function(_0x493bfd){return{'model':db[_0x493bfd[_0x7254('0x20')]],'as':_0x493bfd['as'],'attributes':_0x493bfd[_0x7254('0x1c')],'include':_0x493bfd[_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x493bfd[_0x7254('0x1e')],function(_0x36b5d5){return{'model':db[_0x36b5d5[_0x7254('0x20')]],'as':_0x36b5d5['as'],'attributes':_0x36b5d5['attributes'],'include':_0x36b5d5[_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x36b5d5[_0x7254('0x1e')],function(_0x494cdb){return{'model':db[_0x494cdb[_0x7254('0x20')]],'as':_0x494cdb['as'],'attributes':_0x494cdb['attributes']};}):[]};}):[]};}):[]:[]})[_0x7254('0x21')](function(_0x134a9e){logger['info'](_0x7254('0x16'),_0x2737e0);logger[_0x7254('0xf')]('GetVtigerAccount',_0x2737e0,JSON[_0x7254('0x11')](_0x134a9e));_0x1f48f6(_0x134a9e);})[_0x7254('0x15')](function(_0x37cb5c){logger[_0x7254('0x12')](_0x7254('0x16'),_0x37cb5c[_0x7254('0x13')],_0x2737e0);_0x2283b7(_0x5dd23b['error'](0x1f4,_0x37cb5c[_0x7254('0x13')]));});});};exports[_0x7254('0x22')]=function(_0x5569be){var _0x2f75ea=this;return new Promise(function(_0x1279cd,_0x2be5fc){return db['VtigerAccount'][_0x7254('0x23')]({'raw':_0x5569be[_0x7254('0x19')]?_0x5569be[_0x7254('0x19')][_0x7254('0x1a')]===undefined?!![]:![]:!![],'where':_0x5569be[_0x7254('0x19')]?_0x5569be[_0x7254('0x19')][_0x7254('0x1b')]||null:null,'attributes':_0x5569be['options']?_0x5569be[_0x7254('0x19')]['attributes']||null:null,'include':_0x5569be['options']?_0x5569be[_0x7254('0x19')][_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x5569be[_0x7254('0x19')][_0x7254('0x1e')],function(_0x430420){return{'model':db[_0x430420[_0x7254('0x20')]],'as':_0x430420['as'],'attributes':_0x430420[_0x7254('0x1c')],'include':_0x430420[_0x7254('0x1e')]?_[_0x7254('0x1f')](_0x430420[_0x7254('0x1e')],function(_0x3b0abd){return{'model':db[_0x3b0abd[_0x7254('0x20')]],'as':_0x3b0abd['as'],'attributes':_0x3b0abd[_0x7254('0x1c')],'include':_0x3b0abd['include']?_[_0x7254('0x1f')](_0x3b0abd[_0x7254('0x1e')],function(_0x2ea976){return{'model':db[_0x2ea976[_0x7254('0x20')]],'as':_0x2ea976['as'],'attributes':_0x2ea976[_0x7254('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x140bb2){logger['info'](_0x7254('0x22'),_0x5569be);logger[_0x7254('0xf')](_0x7254('0x22'),_0x5569be,JSON[_0x7254('0x11')](_0x140bb2));_0x1279cd(_0x140bb2);})[_0x7254('0x15')](function(_0x4e6213){logger[_0x7254('0x12')]('ShowVtigerAccount',_0x4e6213[_0x7254('0x13')],_0x5569be);_0x2be5fc(_0x2f75ea[_0x7254('0x12')](0x1f4,_0x4e6213['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 25ca9c4..6e51fc6 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 _0x587a=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x587a,0x1c6));var _0xa587=function(_0x309879,_0x29f94a){_0x309879=_0x309879-0x0;var _0x480e63=_0x587a[_0x309879];return _0x480e63;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa587('0x0'));var timeout=require(_0xa587('0x1'));var express=require('express');var router=express[_0xa587('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa587('0x3'));var interaction=require(_0xa587('0x4'));var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0xa587('0x5')]('/',auth[_0xa587('0x6')](),controller[_0xa587('0x7')]);router[_0xa587('0x5')]('/:id',auth[_0xa587('0x6')](),controller[_0xa587('0x8')]);router[_0xa587('0x5')](_0xa587('0x9'),auth[_0xa587('0x6')](),controller[_0xa587('0xa')]);router[_0xa587('0x5')](_0xa587('0xb'),auth[_0xa587('0x6')](),controller[_0xa587('0xc')]);router[_0xa587('0x5')](_0xa587('0xd'),auth['isAuthenticated'](),controller[_0xa587('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa587('0xf')]);router[_0xa587('0x10')](_0xa587('0x11'),auth[_0xa587('0x6')](),controller[_0xa587('0x12')]);router[_0xa587('0x13')](_0xa587('0x11'),auth['isAuthenticated'](),controller[_0xa587('0x14')]);module[_0xa587('0x15')]=router; \ No newline at end of file +var _0x63ad=['getFields','/:id/descriptions','getDescriptions','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','/:id/fields','isAuthenticated'];(function(_0x70d977,_0x41bc6e){var _0x45a9bf=function(_0x3c9d7a){while(--_0x3c9d7a){_0x70d977['push'](_0x70d977['shift']());}};_0x45a9bf(++_0x41bc6e);}(_0x63ad,0x1ed));var _0xd63a=function(_0xb53cf3,_0x506b5c){_0xb53cf3=_0xb53cf3-0x0;var _0x4e23f9=_0x63ad[_0xb53cf3];return _0x4e23f9;};'use strict';var multer=require(_0xd63a('0x0'));var util=require(_0xd63a('0x1'));var path=require(_0xd63a('0x2'));var timeout=require(_0xd63a('0x3'));var express=require(_0xd63a('0x4'));var router=express[_0xd63a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd63a('0x6'));var interaction=require(_0xd63a('0x7'));var config=require(_0xd63a('0x8'));var controller=require(_0xd63a('0x9'));router[_0xd63a('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xd63a('0xa')](_0xd63a('0xb'),auth[_0xd63a('0xc')](),controller[_0xd63a('0xd')]);router[_0xd63a('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xd63a('0xa')](_0xd63a('0xe'),auth[_0xd63a('0xc')](),controller[_0xd63a('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd63a('0x10')](_0xd63a('0x11'),auth[_0xd63a('0xc')](),controller[_0xd63a('0x12')]);router[_0xd63a('0x13')](_0xd63a('0x11'),auth[_0xd63a('0xc')](),controller[_0xd63a('0x14')]);module[_0xd63a('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 24a07d0..92759d1 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 _0x230d=['exports','STRING','sequelize'];(function(_0x5f09c4,_0x126d3b){var _0x3e1b43=function(_0xa0cc14){while(--_0xa0cc14){_0x5f09c4['push'](_0x5f09c4['shift']());}};_0x3e1b43(++_0x126d3b);}(_0x230d,0x89));var _0xd230=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x230d[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xd230('0x0'));module[_0xd230('0x1')]={'name':{'type':Sequelize[_0xd230('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcac9=['exports','STRING'];(function(_0x17a99d,_0x1f8349){var _0x4132e7=function(_0x280d8c){while(--_0x280d8c){_0x17a99d['push'](_0x17a99d['shift']());}};_0x4132e7(++_0x1f8349);}(_0xcac9,0xa8));var _0x9cac=function(_0x459a0a,_0x25c46f){_0x459a0a=_0x459a0a-0x0;var _0x4ab46c=_0xcac9[_0x459a0a];return _0x4ab46c;};'use strict';var Sequelize=require('sequelize');module[_0x9cac('0x0')]={'name':{'type':Sequelize[_0x9cac('0x1')]},'description':{'type':Sequelize[_0x9cac('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 0f34baa..382bec8 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 _0xd8ea=['apply','reject','update','then','destroy','error','name','send','map','VtigerConfiguration','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','VtigerField','order','sort','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x27934a,_0x198480){var _0x80e180=function(_0x665947){while(--_0x665947){_0x27934a['push'](_0x27934a['shift']());}};_0x80e180(++_0x198480);}(_0xd8ea,0x1bd));var _0xad8e=function(_0x204536,_0x1541d1){_0x204536=_0x204536-0x0;var _0x3f724e=_0xd8ea[_0x204536];return _0x3f724e;};'use strict';var emlformat=require(_0xad8e('0x0'));var rimraf=require(_0xad8e('0x1'));var zipdir=require(_0xad8e('0x2'));var jsonpatch=require(_0xad8e('0x3'));var rp=require(_0xad8e('0x4'));var moment=require(_0xad8e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xad8e('0x6'));var util=require(_0xad8e('0x7'));var path=require(_0xad8e('0x8'));var sox=require('sox');var csv=require(_0xad8e('0x9'));var ejs=require(_0xad8e('0xa'));var fs=require('fs');var fs_extra=require(_0xad8e('0xb'));var _=require(_0xad8e('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xad8e('0xd'));var deskjs=require(_0xad8e('0xe'));var toCsv=require(_0xad8e('0x9'));var querystring=require(_0xad8e('0xf'));var Papa=require(_0xad8e('0x10'));var Redis=require(_0xad8e('0x11'));var authService=require(_0xad8e('0x12'));var qs=require(_0xad8e('0x13'));var as=require(_0xad8e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad8e('0x15'))('api');var utils=require(_0xad8e('0x16'));var config=require(_0xad8e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xad8e('0x18'))['db'];function respondWithStatusCode(_0x3b8b66,_0x433d50){_0x433d50=_0x433d50||0xcc;return function(_0x59edca){if(_0x59edca){return _0x3b8b66[_0xad8e('0x19')](_0x433d50);}return _0x3b8b66[_0xad8e('0x1a')](_0x433d50)[_0xad8e('0x1b')]();};}function respondWithResult(_0x42bc1c,_0x2aea10){_0x2aea10=_0x2aea10||0xc8;return function(_0x13dd98){if(_0x13dd98){return _0x42bc1c[_0xad8e('0x1a')](_0x2aea10)[_0xad8e('0x1c')](_0x13dd98);}};}function respondWithFilteredResult(_0x3e718d,_0x59308d){return function(_0x157434){if(_0x157434){var _0x4fd9dd=typeof _0x59308d[_0xad8e('0x1d')]===_0xad8e('0x1e')&&typeof _0x59308d[_0xad8e('0x1f')]===_0xad8e('0x1e');var _0x49864d=_0x157434['count'];var _0x4e7e83=_0x4fd9dd?0x0:_0x59308d[_0xad8e('0x1d')];var _0x549aa3=_0x4fd9dd?_0x157434[_0xad8e('0x20')]:_0x59308d[_0xad8e('0x1d')]+_0x59308d['limit'];var _0x22d12b;if(_0x549aa3>=_0x49864d){_0x549aa3=_0x49864d;_0x22d12b=0xc8;}else{_0x22d12b=0xce;}_0x3e718d[_0xad8e('0x1a')](_0x22d12b);return _0x3e718d[_0xad8e('0x21')](_0xad8e('0x22'),_0x4e7e83+'-'+_0x549aa3+'/'+_0x49864d)[_0xad8e('0x1c')](_0x157434);}return null;};}function patchUpdates(_0x4b3a6a){return function(_0x2486c3){try{jsonpatch[_0xad8e('0x23')](_0x2486c3,_0x4b3a6a,!![]);}catch(_0x2589e7){return BPromise[_0xad8e('0x24')](_0x2589e7);}return _0x2486c3['save']();};}function saveUpdates(_0x28e198,_0x34a269){return function(_0x1184ab){if(_0x1184ab){return _0x1184ab[_0xad8e('0x25')](_0x28e198)[_0xad8e('0x26')](function(_0x36e06b){return _0x36e06b;});}return null;};}function removeEntity(_0x291a5b,_0x3052bf){return function(_0x39372e){if(_0x39372e){return _0x39372e[_0xad8e('0x27')]()[_0xad8e('0x26')](function(){_0x291a5b['status'](0xcc)[_0xad8e('0x1b')]();});}};}function handleEntityNotFound(_0x17c8ea,_0x59cd30){return function(_0x26beec){if(!_0x26beec){_0x17c8ea[_0xad8e('0x19')](0x194);}return _0x26beec;};}function handleError(_0x297ac7,_0x570d46){_0x570d46=_0x570d46||0x1f4;return function(_0x5a2004){logger[_0xad8e('0x28')](_0x5a2004['stack']);if(_0x5a2004[_0xad8e('0x29')]){delete _0x5a2004[_0xad8e('0x29')];}_0x297ac7[_0xad8e('0x1a')](_0x570d46)[_0xad8e('0x2a')](_0x5a2004);};}exports['index']=function(_0x3615b7,_0x571b96){var _0x2814ce={},_0xf7c664={},_0x313b6f={'count':0x0,'rows':[]};var _0x21a0d1=_[_0xad8e('0x2b')](db[_0xad8e('0x2c')][_0xad8e('0x2d')],function(_0x5810ec){return{'name':_0x5810ec['fieldName'],'type':_0x5810ec[_0xad8e('0x2e')][_0xad8e('0x2f')]};});_0xf7c664['model']=_[_0xad8e('0x2b')](_0x21a0d1,_0xad8e('0x29'));_0xf7c664[_0xad8e('0x30')]=_[_0xad8e('0x31')](_0x3615b7[_0xad8e('0x30')]);_0xf7c664[_0xad8e('0x32')]=_[_0xad8e('0x33')](_0xf7c664['model'],_0xf7c664['query']);_0x2814ce['attributes']=_[_0xad8e('0x33')](_0xf7c664[_0xad8e('0x34')],qs[_0xad8e('0x35')](_0x3615b7[_0xad8e('0x30')]['fields']));_0x2814ce[_0xad8e('0x36')]=_0x2814ce[_0xad8e('0x36')][_0xad8e('0x37')]?_0x2814ce[_0xad8e('0x36')]:_0xf7c664['model'];if(!_0x3615b7[_0xad8e('0x30')][_0xad8e('0x38')](_0xad8e('0x39'))){_0x2814ce['limit']=qs['limit'](_0x3615b7[_0xad8e('0x30')][_0xad8e('0x1f')]);_0x2814ce['offset']=qs[_0xad8e('0x1d')](_0x3615b7[_0xad8e('0x30')]['offset']);}_0x2814ce['order']=qs['sort'](_0x3615b7[_0xad8e('0x30')]['sort']);_0x2814ce[_0xad8e('0x3a')]=qs[_0xad8e('0x32')](_[_0xad8e('0x3b')](_0x3615b7['query'],_0xf7c664[_0xad8e('0x32')]),_0x21a0d1);if(_0x3615b7[_0xad8e('0x30')][_0xad8e('0x3c')]){_0x2814ce[_0xad8e('0x3a')]=_[_0xad8e('0x3d')](_0x2814ce[_0xad8e('0x3a')],{'$or':_['map'](_0x21a0d1,function(_0x23968a){if(_0x23968a[_0xad8e('0x2e')]!=='VIRTUAL'){var _0xa52e85={};_0xa52e85[_0x23968a['name']]={'$like':'%'+_0x3615b7[_0xad8e('0x30')][_0xad8e('0x3c')]+'%'};return _0xa52e85;}})});}_0x2814ce=_['merge']({},_0x2814ce,_0x3615b7[_0xad8e('0x3e')]);var _0x54733f={'where':_0x2814ce['where']};return db[_0xad8e('0x2c')][_0xad8e('0x20')](_0x54733f)[_0xad8e('0x26')](function(_0xd370da){_0x313b6f[_0xad8e('0x20')]=_0xd370da;if(_0x3615b7[_0xad8e('0x30')][_0xad8e('0x3f')]){_0x2814ce[_0xad8e('0x40')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xad8e('0x41')](_0x2814ce);})[_0xad8e('0x26')](function(_0x158633){_0x313b6f[_0xad8e('0x42')]=_0x158633;return _0x313b6f;})[_0xad8e('0x26')](respondWithFilteredResult(_0x571b96,_0x2814ce))[_0xad8e('0x43')](handleError(_0x571b96,null));};exports[_0xad8e('0x44')]=function(_0x27f540,_0x7272c6){var _0x27fe7c={'raw':![],'where':{'id':_0x27f540[_0xad8e('0x45')]['id']}},_0x335fe9={};_0x335fe9['model']=_['keys'](db['VtigerConfiguration'][_0xad8e('0x2d')]);_0x335fe9['query']=_[_0xad8e('0x31')](_0x27f540[_0xad8e('0x30')]);_0x335fe9['filters']=_['intersection'](_0x335fe9[_0xad8e('0x34')],_0x335fe9[_0xad8e('0x30')]);_0x27fe7c[_0xad8e('0x36')]=_['intersection'](_0x335fe9[_0xad8e('0x34')],qs[_0xad8e('0x35')](_0x27f540[_0xad8e('0x30')][_0xad8e('0x35')]));_0x27fe7c[_0xad8e('0x36')]=_0x27fe7c[_0xad8e('0x36')][_0xad8e('0x37')]?_0x27fe7c['attributes']:_0x335fe9[_0xad8e('0x34')];if(_0x27f540[_0xad8e('0x30')][_0xad8e('0x3f')]){_0x27fe7c[_0xad8e('0x40')]=[{'all':!![]}];}_0x27fe7c=_['merge']({},_0x27fe7c,_0x27f540[_0xad8e('0x3e')]);return db[_0xad8e('0x2c')][_0xad8e('0x46')](_0x27fe7c)[_0xad8e('0x26')](handleEntityNotFound(_0x7272c6,null))[_0xad8e('0x26')](respondWithResult(_0x7272c6,null))[_0xad8e('0x43')](handleError(_0x7272c6,null));};exports[_0xad8e('0x47')]=function(_0x1c9c4d,_0x3c54c3){return db['VtigerConfiguration'][_0xad8e('0x47')](_0x1c9c4d[_0xad8e('0x48')],{})[_0xad8e('0x26')](respondWithResult(_0x3c54c3,0xc9))['catch'](handleError(_0x3c54c3,null));};exports[_0xad8e('0x25')]=function(_0x584a31,_0x305c47){if(_0x584a31['body']['id']){delete _0x584a31[_0xad8e('0x48')]['id'];}return db[_0xad8e('0x2c')][_0xad8e('0x46')]({'where':{'id':_0x584a31[_0xad8e('0x45')]['id']}})[_0xad8e('0x26')](handleEntityNotFound(_0x305c47,null))[_0xad8e('0x26')](saveUpdates(_0x584a31[_0xad8e('0x48')],null))[_0xad8e('0x26')](respondWithResult(_0x305c47,null))['catch'](handleError(_0x305c47,null));};exports['destroy']=function(_0x55812c,_0x1810d1){return db[_0xad8e('0x2c')][_0xad8e('0x46')]({'where':{'id':_0x55812c[_0xad8e('0x45')]['id']}})['then'](handleEntityNotFound(_0x1810d1,null))['then'](removeEntity(_0x1810d1,null))[_0xad8e('0x43')](handleError(_0x1810d1,null));};exports['getFields']=function(_0x3e42c4,_0x36e883,_0x778f34){var _0x3c59ea={};var _0x992e49={};var _0x31896c;var _0x4dd081;return db['VtigerConfiguration'][_0xad8e('0x49')]({'where':{'id':_0x3e42c4[_0xad8e('0x45')]['id']}})[_0xad8e('0x26')](handleEntityNotFound(_0x36e883,null))[_0xad8e('0x26')](function(_0x21a936){if(_0x21a936){_0x31896c=_0x21a936;_0x992e49[_0xad8e('0x34')]=_[_0xad8e('0x31')](db[_0xad8e('0x4a')][_0xad8e('0x2d')]);_0x992e49[_0xad8e('0x30')]=_[_0xad8e('0x31')](_0x3e42c4[_0xad8e('0x30')]);_0x992e49[_0xad8e('0x32')]=_[_0xad8e('0x33')](_0x992e49['model'],_0x992e49[_0xad8e('0x30')]);_0x3c59ea[_0xad8e('0x36')]=_[_0xad8e('0x33')](_0x992e49[_0xad8e('0x34')],qs[_0xad8e('0x35')](_0x3e42c4[_0xad8e('0x30')][_0xad8e('0x35')]));_0x3c59ea['attributes']=_0x3c59ea['attributes']['length']?_0x3c59ea[_0xad8e('0x36')]:_0x992e49[_0xad8e('0x34')];_0x3c59ea[_0xad8e('0x4b')]=qs[_0xad8e('0x4c')](_0x3e42c4[_0xad8e('0x30')]['sort']);_0x3c59ea[_0xad8e('0x3a')]=qs[_0xad8e('0x32')](_[_0xad8e('0x3b')](_0x3e42c4[_0xad8e('0x30')],_0x992e49[_0xad8e('0x32')]));if(_0x3e42c4['query'][_0xad8e('0x3c')]){_0x3c59ea['where']=_[_0xad8e('0x3d')](_0x3c59ea[_0xad8e('0x3a')],{'$or':_['map'](_0x3c59ea['attributes'],function(_0x31eb67){var _0x3b3132={};_0x3b3132[_0x31eb67]={'$like':'%'+_0x3e42c4[_0xad8e('0x30')]['filter']+'%'};return _0x3b3132;})});}_0x3c59ea=_[_0xad8e('0x3d')]({},_0x3c59ea,_0x3e42c4['options']);return _0x31896c[_0xad8e('0x4d')](_0x3c59ea);}})[_0xad8e('0x26')](function(_0x57294d){if(_0x57294d){_0x4dd081=_0x57294d['length'];if(!_0x3e42c4[_0xad8e('0x30')][_0xad8e('0x38')](_0xad8e('0x39'))){_0x3c59ea[_0xad8e('0x1f')]=qs[_0xad8e('0x1f')](_0x3e42c4[_0xad8e('0x30')][_0xad8e('0x1f')]);_0x3c59ea[_0xad8e('0x1d')]=qs['offset'](_0x3e42c4[_0xad8e('0x30')]['offset']);}return _0x31896c['getFields'](_0x3c59ea);}})[_0xad8e('0x26')](function(_0x52e4ac){if(_0x52e4ac){return _0x52e4ac?{'count':_0x4dd081,'rows':_0x52e4ac}:null;}})[_0xad8e('0x26')](respondWithResult(_0x36e883,null))[_0xad8e('0x43')](handleError(_0x36e883,null));};exports[_0xad8e('0x4e')]=function(_0x31f88a,_0x24b566,_0x5afab0){var _0x330223={};var _0x41e4d7={};var _0x2c4f15;var _0x34fd45;return db[_0xad8e('0x2c')][_0xad8e('0x49')]({'where':{'id':_0x31f88a['params']['id']}})[_0xad8e('0x26')](handleEntityNotFound(_0x24b566,null))[_0xad8e('0x26')](function(_0x3ddca1){if(_0x3ddca1){_0x2c4f15=_0x3ddca1;_0x41e4d7[_0xad8e('0x34')]=_[_0xad8e('0x31')](db[_0xad8e('0x4a')][_0xad8e('0x2d')]);_0x41e4d7[_0xad8e('0x30')]=_[_0xad8e('0x31')](_0x31f88a[_0xad8e('0x30')]);_0x41e4d7[_0xad8e('0x32')]=_['intersection'](_0x41e4d7[_0xad8e('0x34')],_0x41e4d7[_0xad8e('0x30')]);_0x330223[_0xad8e('0x36')]=_[_0xad8e('0x33')](_0x41e4d7[_0xad8e('0x34')],qs[_0xad8e('0x35')](_0x31f88a[_0xad8e('0x30')][_0xad8e('0x35')]));_0x330223[_0xad8e('0x36')]=_0x330223[_0xad8e('0x36')][_0xad8e('0x37')]?_0x330223[_0xad8e('0x36')]:_0x41e4d7['model'];_0x330223[_0xad8e('0x4b')]=qs[_0xad8e('0x4c')](_0x31f88a['query']['sort']);_0x330223[_0xad8e('0x3a')]=qs[_0xad8e('0x32')](_[_0xad8e('0x3b')](_0x31f88a[_0xad8e('0x30')],_0x41e4d7[_0xad8e('0x32')]));if(_0x31f88a[_0xad8e('0x30')][_0xad8e('0x3c')]){_0x330223[_0xad8e('0x3a')]=_['merge'](_0x330223[_0xad8e('0x3a')],{'$or':_['map'](_0x330223[_0xad8e('0x36')],function(_0x4a0f74){var _0x398b8d={};_0x398b8d[_0x4a0f74]={'$like':'%'+_0x31f88a['query'][_0xad8e('0x3c')]+'%'};return _0x398b8d;})});}_0x330223=_[_0xad8e('0x3d')]({},_0x330223,_0x31f88a['options']);return _0x2c4f15[_0xad8e('0x4e')](_0x330223);}})[_0xad8e('0x26')](function(_0x8f1875){if(_0x8f1875){_0x34fd45=_0x8f1875[_0xad8e('0x37')];if(!_0x31f88a[_0xad8e('0x30')][_0xad8e('0x38')]('nolimit')){_0x330223[_0xad8e('0x1f')]=qs[_0xad8e('0x1f')](_0x31f88a[_0xad8e('0x30')]['limit']);_0x330223[_0xad8e('0x1d')]=qs[_0xad8e('0x1d')](_0x31f88a['query'][_0xad8e('0x1d')]);}return _0x2c4f15['getSubjects'](_0x330223);}})[_0xad8e('0x26')](function(_0x1aeff2){if(_0x1aeff2){return _0x1aeff2?{'count':_0x34fd45,'rows':_0x1aeff2}:null;}})[_0xad8e('0x26')](respondWithResult(_0x24b566,null))[_0xad8e('0x43')](handleError(_0x24b566,null));};exports[_0xad8e('0x4f')]=function(_0x3a7b1d,_0x1932c2,_0x16c413){var _0x69c48b={};var _0x494429={};var _0x3bd26b;var _0x249a0a;return db[_0xad8e('0x2c')][_0xad8e('0x49')]({'where':{'id':_0x3a7b1d[_0xad8e('0x45')]['id']}})[_0xad8e('0x26')](handleEntityNotFound(_0x1932c2,null))[_0xad8e('0x26')](function(_0x4275f5){if(_0x4275f5){_0x3bd26b=_0x4275f5;_0x494429[_0xad8e('0x34')]=_[_0xad8e('0x31')](db[_0xad8e('0x4a')][_0xad8e('0x2d')]);_0x494429[_0xad8e('0x30')]=_['keys'](_0x3a7b1d['query']);_0x494429['filters']=_[_0xad8e('0x33')](_0x494429[_0xad8e('0x34')],_0x494429[_0xad8e('0x30')]);_0x69c48b['attributes']=_[_0xad8e('0x33')](_0x494429[_0xad8e('0x34')],qs[_0xad8e('0x35')](_0x3a7b1d['query']['fields']));_0x69c48b[_0xad8e('0x36')]=_0x69c48b[_0xad8e('0x36')][_0xad8e('0x37')]?_0x69c48b[_0xad8e('0x36')]:_0x494429[_0xad8e('0x34')];_0x69c48b[_0xad8e('0x4b')]=qs[_0xad8e('0x4c')](_0x3a7b1d[_0xad8e('0x30')][_0xad8e('0x4c')]);_0x69c48b['where']=qs[_0xad8e('0x32')](_[_0xad8e('0x3b')](_0x3a7b1d[_0xad8e('0x30')],_0x494429[_0xad8e('0x32')]));if(_0x3a7b1d[_0xad8e('0x30')]['filter']){_0x69c48b[_0xad8e('0x3a')]=_['merge'](_0x69c48b[_0xad8e('0x3a')],{'$or':_[_0xad8e('0x2b')](_0x69c48b[_0xad8e('0x36')],function(_0x1bcec4){var _0x29591d={};_0x29591d[_0x1bcec4]={'$like':'%'+_0x3a7b1d[_0xad8e('0x30')][_0xad8e('0x3c')]+'%'};return _0x29591d;})});}_0x69c48b=_[_0xad8e('0x3d')]({},_0x69c48b,_0x3a7b1d[_0xad8e('0x3e')]);return _0x3bd26b[_0xad8e('0x4f')](_0x69c48b);}})[_0xad8e('0x26')](function(_0x418e7b){if(_0x418e7b){_0x249a0a=_0x418e7b['length'];if(!_0x3a7b1d[_0xad8e('0x30')]['hasOwnProperty'](_0xad8e('0x39'))){_0x69c48b['limit']=qs[_0xad8e('0x1f')](_0x3a7b1d[_0xad8e('0x30')]['limit']);_0x69c48b[_0xad8e('0x1d')]=qs[_0xad8e('0x1d')](_0x3a7b1d[_0xad8e('0x30')][_0xad8e('0x1d')]);}return _0x3bd26b[_0xad8e('0x4f')](_0x69c48b);}})[_0xad8e('0x26')](function(_0x1d437d){if(_0x1d437d){return _0x1d437d?{'count':_0x249a0a,'rows':_0x1d437d}:null;}})[_0xad8e('0x26')](respondWithResult(_0x1932c2,null))[_0xad8e('0x43')](handleError(_0x1932c2,null));}; \ No newline at end of file +var _0x1596=['then','destroy','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','include','findAll','catch','show','params','includeAll','options','find','create','body','VtigerField','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','reject','save','update'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x1596,0x16f));var _0x6159=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1596[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x6159('0x0'));var rimraf=require(_0x6159('0x1'));var zipdir=require(_0x6159('0x2'));var jsonpatch=require(_0x6159('0x3'));var rp=require('request-promise');var moment=require(_0x6159('0x4'));var BPromise=require(_0x6159('0x5'));var Mustache=require(_0x6159('0x6'));var util=require('util');var path=require(_0x6159('0x7'));var sox=require(_0x6159('0x8'));var csv=require(_0x6159('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6159('0xa'));var _=require(_0x6159('0xb'));var squel=require(_0x6159('0xc'));var crypto=require(_0x6159('0xd'));var jsforce=require(_0x6159('0xe'));var deskjs=require(_0x6159('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6159('0x10'));var Papa=require('papaparse');var Redis=require(_0x6159('0x11'));var authService=require(_0x6159('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6159('0x13'));var hardwareService=require(_0x6159('0x14'));var logger=require(_0x6159('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x6159('0x16'));var licenseUtil=require(_0x6159('0x17'));var db=require(_0x6159('0x18'))['db'];function respondWithStatusCode(_0x366dda,_0x2864b5){_0x2864b5=_0x2864b5||0xcc;return function(_0x2d2f8b){if(_0x2d2f8b){return _0x366dda[_0x6159('0x19')](_0x2864b5);}return _0x366dda[_0x6159('0x1a')](_0x2864b5)[_0x6159('0x1b')]();};}function respondWithResult(_0x17cb83,_0x2e0cd9){_0x2e0cd9=_0x2e0cd9||0xc8;return function(_0x1c50e5){if(_0x1c50e5){return _0x17cb83[_0x6159('0x1a')](_0x2e0cd9)[_0x6159('0x1c')](_0x1c50e5);}};}function respondWithFilteredResult(_0x3572c0,_0xe3f67d){return function(_0x210fe8){if(_0x210fe8){var _0x35b27c=typeof _0xe3f67d['offset']==='undefined'&&typeof _0xe3f67d[_0x6159('0x1d')]===_0x6159('0x1e');var _0x143c7f=_0x210fe8['count'];var _0x368d1f=_0x35b27c?0x0:_0xe3f67d[_0x6159('0x1f')];var _0x141199=_0x35b27c?_0x210fe8[_0x6159('0x20')]:_0xe3f67d['offset']+_0xe3f67d[_0x6159('0x1d')];var _0x47deee;if(_0x141199>=_0x143c7f){_0x141199=_0x143c7f;_0x47deee=0xc8;}else{_0x47deee=0xce;}_0x3572c0[_0x6159('0x1a')](_0x47deee);return _0x3572c0[_0x6159('0x21')](_0x6159('0x22'),_0x368d1f+'-'+_0x141199+'/'+_0x143c7f)['json'](_0x210fe8);}return null;};}function patchUpdates(_0x54f210){return function(_0x2ece57){try{jsonpatch['apply'](_0x2ece57,_0x54f210,!![]);}catch(_0x31dd68){return BPromise[_0x6159('0x23')](_0x31dd68);}return _0x2ece57[_0x6159('0x24')]();};}function saveUpdates(_0x1f1ec5,_0x4a0863){return function(_0x1fe11d){if(_0x1fe11d){return _0x1fe11d[_0x6159('0x25')](_0x1f1ec5)[_0x6159('0x26')](function(_0x130d73){return _0x130d73;});}return null;};}function removeEntity(_0xba9d9,_0x29024f){return function(_0x5685a7){if(_0x5685a7){return _0x5685a7[_0x6159('0x27')]()['then'](function(){_0xba9d9[_0x6159('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bf0c1,_0x9d9968){return function(_0x526a03){if(!_0x526a03){_0x4bf0c1[_0x6159('0x19')](0x194);}return _0x526a03;};}function handleError(_0x502903,_0x1e739e){_0x1e739e=_0x1e739e||0x1f4;return function(_0x178004){logger[_0x6159('0x28')](_0x178004[_0x6159('0x29')]);if(_0x178004['name']){delete _0x178004[_0x6159('0x2a')];}_0x502903[_0x6159('0x1a')](_0x1e739e)[_0x6159('0x2b')](_0x178004);};}exports[_0x6159('0x2c')]=function(_0x4fa594,_0x35ec60){var _0x53f158={},_0x318e41={},_0x4f88bd={'count':0x0,'rows':[]};var _0x169b5f=_[_0x6159('0x2d')](db[_0x6159('0x2e')][_0x6159('0x2f')],function(_0x426411){return{'name':_0x426411[_0x6159('0x30')],'type':_0x426411[_0x6159('0x31')][_0x6159('0x32')]};});_0x318e41['model']=_[_0x6159('0x2d')](_0x169b5f,_0x6159('0x2a'));_0x318e41[_0x6159('0x33')]=_[_0x6159('0x34')](_0x4fa594['query']);_0x318e41['filters']=_[_0x6159('0x35')](_0x318e41[_0x6159('0x36')],_0x318e41[_0x6159('0x33')]);_0x53f158[_0x6159('0x37')]=_['intersection'](_0x318e41[_0x6159('0x36')],qs[_0x6159('0x38')](_0x4fa594[_0x6159('0x33')][_0x6159('0x38')]));_0x53f158['attributes']=_0x53f158[_0x6159('0x37')][_0x6159('0x39')]?_0x53f158[_0x6159('0x37')]:_0x318e41[_0x6159('0x36')];if(!_0x4fa594[_0x6159('0x33')][_0x6159('0x3a')](_0x6159('0x3b'))){_0x53f158[_0x6159('0x1d')]=qs[_0x6159('0x1d')](_0x4fa594[_0x6159('0x33')][_0x6159('0x1d')]);_0x53f158[_0x6159('0x1f')]=qs[_0x6159('0x1f')](_0x4fa594[_0x6159('0x33')][_0x6159('0x1f')]);}_0x53f158[_0x6159('0x3c')]=qs['sort'](_0x4fa594[_0x6159('0x33')][_0x6159('0x3d')]);_0x53f158[_0x6159('0x3e')]=qs[_0x6159('0x3f')](_[_0x6159('0x40')](_0x4fa594[_0x6159('0x33')],_0x318e41[_0x6159('0x3f')]),_0x169b5f);if(_0x4fa594[_0x6159('0x33')][_0x6159('0x41')]){_0x53f158[_0x6159('0x3e')]=_['merge'](_0x53f158[_0x6159('0x3e')],{'$or':_['map'](_0x169b5f,function(_0x5756fa){if(_0x5756fa[_0x6159('0x31')]!=='VIRTUAL'){var _0x440dee={};_0x440dee[_0x5756fa[_0x6159('0x2a')]]={'$like':'%'+_0x4fa594['query'][_0x6159('0x41')]+'%'};return _0x440dee;}})});}_0x53f158=_[_0x6159('0x42')]({},_0x53f158,_0x4fa594['options']);var _0xfcba7d={'where':_0x53f158[_0x6159('0x3e')]};return db[_0x6159('0x2e')][_0x6159('0x20')](_0xfcba7d)['then'](function(_0x8b8334){_0x4f88bd[_0x6159('0x20')]=_0x8b8334;if(_0x4fa594[_0x6159('0x33')]['includeAll']){_0x53f158[_0x6159('0x43')]=[{'all':!![]}];}return db[_0x6159('0x2e')][_0x6159('0x44')](_0x53f158);})[_0x6159('0x26')](function(_0x4f26d3){_0x4f88bd['rows']=_0x4f26d3;return _0x4f88bd;})[_0x6159('0x26')](respondWithFilteredResult(_0x35ec60,_0x53f158))[_0x6159('0x45')](handleError(_0x35ec60,null));};exports[_0x6159('0x46')]=function(_0x3c1265,_0x389af4){var _0x5cfb8b={'raw':![],'where':{'id':_0x3c1265[_0x6159('0x47')]['id']}},_0x6bfa40={};_0x6bfa40[_0x6159('0x36')]=_[_0x6159('0x34')](db['VtigerConfiguration'][_0x6159('0x2f')]);_0x6bfa40[_0x6159('0x33')]=_['keys'](_0x3c1265[_0x6159('0x33')]);_0x6bfa40[_0x6159('0x3f')]=_[_0x6159('0x35')](_0x6bfa40[_0x6159('0x36')],_0x6bfa40[_0x6159('0x33')]);_0x5cfb8b[_0x6159('0x37')]=_[_0x6159('0x35')](_0x6bfa40[_0x6159('0x36')],qs[_0x6159('0x38')](_0x3c1265[_0x6159('0x33')]['fields']));_0x5cfb8b['attributes']=_0x5cfb8b[_0x6159('0x37')][_0x6159('0x39')]?_0x5cfb8b[_0x6159('0x37')]:_0x6bfa40[_0x6159('0x36')];if(_0x3c1265['query'][_0x6159('0x48')]){_0x5cfb8b[_0x6159('0x43')]=[{'all':!![]}];}_0x5cfb8b=_[_0x6159('0x42')]({},_0x5cfb8b,_0x3c1265[_0x6159('0x49')]);return db[_0x6159('0x2e')][_0x6159('0x4a')](_0x5cfb8b)[_0x6159('0x26')](handleEntityNotFound(_0x389af4,null))[_0x6159('0x26')](respondWithResult(_0x389af4,null))[_0x6159('0x45')](handleError(_0x389af4,null));};exports[_0x6159('0x4b')]=function(_0x1ee2ea,_0x1beded){return db[_0x6159('0x2e')][_0x6159('0x4b')](_0x1ee2ea['body'],{})[_0x6159('0x26')](respondWithResult(_0x1beded,0xc9))['catch'](handleError(_0x1beded,null));};exports[_0x6159('0x25')]=function(_0x4d581f,_0x45e002){if(_0x4d581f['body']['id']){delete _0x4d581f['body']['id'];}return db[_0x6159('0x2e')]['find']({'where':{'id':_0x4d581f[_0x6159('0x47')]['id']}})[_0x6159('0x26')](handleEntityNotFound(_0x45e002,null))[_0x6159('0x26')](saveUpdates(_0x4d581f[_0x6159('0x4c')],null))[_0x6159('0x26')](respondWithResult(_0x45e002,null))[_0x6159('0x45')](handleError(_0x45e002,null));};exports[_0x6159('0x27')]=function(_0x534864,_0x381447){return db[_0x6159('0x2e')]['find']({'where':{'id':_0x534864[_0x6159('0x47')]['id']}})[_0x6159('0x26')](handleEntityNotFound(_0x381447,null))['then'](removeEntity(_0x381447,null))['catch'](handleError(_0x381447,null));};exports['getFields']=function(_0x12455a,_0x21e0b1,_0x2b4d38){var _0x12ecad={};var _0x4044ac={};var _0x1a56b6;var _0x56381d;return db[_0x6159('0x2e')]['findOne']({'where':{'id':_0x12455a[_0x6159('0x47')]['id']}})[_0x6159('0x26')](handleEntityNotFound(_0x21e0b1,null))[_0x6159('0x26')](function(_0x2d012c){if(_0x2d012c){_0x1a56b6=_0x2d012c;_0x4044ac[_0x6159('0x36')]=_[_0x6159('0x34')](db[_0x6159('0x4d')][_0x6159('0x2f')]);_0x4044ac[_0x6159('0x33')]=_[_0x6159('0x34')](_0x12455a[_0x6159('0x33')]);_0x4044ac[_0x6159('0x3f')]=_[_0x6159('0x35')](_0x4044ac[_0x6159('0x36')],_0x4044ac[_0x6159('0x33')]);_0x12ecad[_0x6159('0x37')]=_[_0x6159('0x35')](_0x4044ac[_0x6159('0x36')],qs[_0x6159('0x38')](_0x12455a[_0x6159('0x33')][_0x6159('0x38')]));_0x12ecad[_0x6159('0x37')]=_0x12ecad[_0x6159('0x37')]['length']?_0x12ecad[_0x6159('0x37')]:_0x4044ac['model'];_0x12ecad[_0x6159('0x3c')]=qs['sort'](_0x12455a[_0x6159('0x33')]['sort']);_0x12ecad[_0x6159('0x3e')]=qs[_0x6159('0x3f')](_['pick'](_0x12455a['query'],_0x4044ac[_0x6159('0x3f')]));if(_0x12455a[_0x6159('0x33')][_0x6159('0x41')]){_0x12ecad[_0x6159('0x3e')]=_[_0x6159('0x42')](_0x12ecad[_0x6159('0x3e')],{'$or':_[_0x6159('0x2d')](_0x12ecad['attributes'],function(_0x10d12d){var _0x4fc377={};_0x4fc377[_0x10d12d]={'$like':'%'+_0x12455a[_0x6159('0x33')][_0x6159('0x41')]+'%'};return _0x4fc377;})});}_0x12ecad=_['merge']({},_0x12ecad,_0x12455a['options']);return _0x1a56b6['getFields'](_0x12ecad);}})[_0x6159('0x26')](function(_0x25561a){if(_0x25561a){_0x56381d=_0x25561a[_0x6159('0x39')];if(!_0x12455a['query'][_0x6159('0x3a')]('nolimit')){_0x12ecad['limit']=qs[_0x6159('0x1d')](_0x12455a['query'][_0x6159('0x1d')]);_0x12ecad[_0x6159('0x1f')]=qs['offset'](_0x12455a[_0x6159('0x33')][_0x6159('0x1f')]);}return _0x1a56b6['getFields'](_0x12ecad);}})[_0x6159('0x26')](function(_0x4cd8ee){if(_0x4cd8ee){return _0x4cd8ee?{'count':_0x56381d,'rows':_0x4cd8ee}:null;}})[_0x6159('0x26')](respondWithResult(_0x21e0b1,null))[_0x6159('0x45')](handleError(_0x21e0b1,null));};exports[_0x6159('0x4e')]=function(_0xce2404,_0x5b8a8c,_0x576dcd){var _0x59a2d5={};var _0x36a3c0={};var _0x35857b;var _0x5471fc;return db[_0x6159('0x2e')][_0x6159('0x4f')]({'where':{'id':_0xce2404[_0x6159('0x47')]['id']}})[_0x6159('0x26')](handleEntityNotFound(_0x5b8a8c,null))[_0x6159('0x26')](function(_0x1803c){if(_0x1803c){_0x35857b=_0x1803c;_0x36a3c0['model']=_['keys'](db[_0x6159('0x4d')][_0x6159('0x2f')]);_0x36a3c0[_0x6159('0x33')]=_[_0x6159('0x34')](_0xce2404[_0x6159('0x33')]);_0x36a3c0[_0x6159('0x3f')]=_[_0x6159('0x35')](_0x36a3c0['model'],_0x36a3c0[_0x6159('0x33')]);_0x59a2d5[_0x6159('0x37')]=_[_0x6159('0x35')](_0x36a3c0[_0x6159('0x36')],qs['fields'](_0xce2404[_0x6159('0x33')][_0x6159('0x38')]));_0x59a2d5[_0x6159('0x37')]=_0x59a2d5[_0x6159('0x37')][_0x6159('0x39')]?_0x59a2d5[_0x6159('0x37')]:_0x36a3c0[_0x6159('0x36')];_0x59a2d5['order']=qs['sort'](_0xce2404[_0x6159('0x33')]['sort']);_0x59a2d5['where']=qs[_0x6159('0x3f')](_[_0x6159('0x40')](_0xce2404[_0x6159('0x33')],_0x36a3c0[_0x6159('0x3f')]));if(_0xce2404[_0x6159('0x33')][_0x6159('0x41')]){_0x59a2d5[_0x6159('0x3e')]=_['merge'](_0x59a2d5[_0x6159('0x3e')],{'$or':_[_0x6159('0x2d')](_0x59a2d5[_0x6159('0x37')],function(_0x3da6c6){var _0x19e747={};_0x19e747[_0x3da6c6]={'$like':'%'+_0xce2404['query']['filter']+'%'};return _0x19e747;})});}_0x59a2d5=_[_0x6159('0x42')]({},_0x59a2d5,_0xce2404[_0x6159('0x49')]);return _0x35857b['getSubjects'](_0x59a2d5);}})[_0x6159('0x26')](function(_0x8a5228){if(_0x8a5228){_0x5471fc=_0x8a5228['length'];if(!_0xce2404[_0x6159('0x33')]['hasOwnProperty'](_0x6159('0x3b'))){_0x59a2d5['limit']=qs[_0x6159('0x1d')](_0xce2404['query'][_0x6159('0x1d')]);_0x59a2d5[_0x6159('0x1f')]=qs['offset'](_0xce2404[_0x6159('0x33')]['offset']);}return _0x35857b[_0x6159('0x4e')](_0x59a2d5);}})['then'](function(_0x210c00){if(_0x210c00){return _0x210c00?{'count':_0x5471fc,'rows':_0x210c00}:null;}})[_0x6159('0x26')](respondWithResult(_0x5b8a8c,null))[_0x6159('0x45')](handleError(_0x5b8a8c,null));};exports[_0x6159('0x50')]=function(_0x57f5dd,_0x57b2d6,_0x3bff9c){var _0x2100c8={};var _0x429f7b={};var _0x5573a1;var _0x43f361;return db[_0x6159('0x2e')][_0x6159('0x4f')]({'where':{'id':_0x57f5dd['params']['id']}})[_0x6159('0x26')](handleEntityNotFound(_0x57b2d6,null))['then'](function(_0x21ed85){if(_0x21ed85){_0x5573a1=_0x21ed85;_0x429f7b['model']=_[_0x6159('0x34')](db[_0x6159('0x4d')][_0x6159('0x2f')]);_0x429f7b['query']=_[_0x6159('0x34')](_0x57f5dd[_0x6159('0x33')]);_0x429f7b[_0x6159('0x3f')]=_[_0x6159('0x35')](_0x429f7b[_0x6159('0x36')],_0x429f7b['query']);_0x2100c8['attributes']=_[_0x6159('0x35')](_0x429f7b[_0x6159('0x36')],qs[_0x6159('0x38')](_0x57f5dd[_0x6159('0x33')]['fields']));_0x2100c8[_0x6159('0x37')]=_0x2100c8[_0x6159('0x37')][_0x6159('0x39')]?_0x2100c8['attributes']:_0x429f7b['model'];_0x2100c8[_0x6159('0x3c')]=qs[_0x6159('0x3d')](_0x57f5dd['query']['sort']);_0x2100c8['where']=qs[_0x6159('0x3f')](_['pick'](_0x57f5dd['query'],_0x429f7b[_0x6159('0x3f')]));if(_0x57f5dd[_0x6159('0x33')][_0x6159('0x41')]){_0x2100c8[_0x6159('0x3e')]=_[_0x6159('0x42')](_0x2100c8[_0x6159('0x3e')],{'$or':_[_0x6159('0x2d')](_0x2100c8['attributes'],function(_0x4a6d2d){var _0x5536d5={};_0x5536d5[_0x4a6d2d]={'$like':'%'+_0x57f5dd[_0x6159('0x33')]['filter']+'%'};return _0x5536d5;})});}_0x2100c8=_[_0x6159('0x42')]({},_0x2100c8,_0x57f5dd['options']);return _0x5573a1[_0x6159('0x50')](_0x2100c8);}})[_0x6159('0x26')](function(_0x5d1cbe){if(_0x5d1cbe){_0x43f361=_0x5d1cbe[_0x6159('0x39')];if(!_0x57f5dd['query'][_0x6159('0x3a')](_0x6159('0x3b'))){_0x2100c8['limit']=qs[_0x6159('0x1d')](_0x57f5dd[_0x6159('0x33')][_0x6159('0x1d')]);_0x2100c8['offset']=qs['offset'](_0x57f5dd['query'][_0x6159('0x1f')]);}return _0x5573a1['getDescriptions'](_0x2100c8);}})['then'](function(_0x53ec6a){if(_0x53ec6a){return _0x53ec6a?{'count':_0x43f361,'rows':_0x53ec6a}:null;}})[_0x6159('0x26')](respondWithResult(_0x57b2d6,null))[_0x6159('0x45')](handleError(_0x57b2d6,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index cc9ca68..01c098a 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 _0x6621=['exports','define','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger','request-promise','rimraf','./intVtigerConfiguration.attributes'];(function(_0x3bd0fc,_0x4c7edb){var _0x5bc792=function(_0xf2fc3b){while(--_0xf2fc3b){_0x3bd0fc['push'](_0x3bd0fc['shift']());}};_0x5bc792(++_0x4c7edb);}(_0x6621,0x136));var _0x1662=function(_0x286d0f,_0x597012){_0x286d0f=_0x286d0f-0x0;var _0x6c91d4=_0x6621[_0x286d0f];return _0x6c91d4;};'use strict';var _=require('lodash');var util=require(_0x1662('0x0'));var logger=require(_0x1662('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1662('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1662('0x3'));var config=require('../../config/environment');var attributes=require(_0x1662('0x4'));module[_0x1662('0x5')]=function(_0x555c67,_0x4833d6){return _0x555c67[_0x1662('0x6')](_0x1662('0x7'),attributes,{'tableName':_0x1662('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5af4=['../../config/logger','api','moment','bluebird','request-promise','path','./intVtigerConfiguration.attributes','define','int_vtiger_configurations','lodash'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0x5af4,0x17b));var _0x45af=function(_0x1403e0,_0x2c70a3){_0x1403e0=_0x1403e0-0x0;var _0x41a31f=_0x5af4[_0x1403e0];return _0x41a31f;};'use strict';var _=require(_0x45af('0x0'));var util=require('util');var logger=require(_0x45af('0x1'))(_0x45af('0x2'));var moment=require(_0x45af('0x3'));var BPromise=require(_0x45af('0x4'));var rp=require(_0x45af('0x5'));var fs=require('fs');var path=require(_0x45af('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x45af('0x7'));module['exports']=function(_0x3481ae,_0x25ad36){return _0x3481ae[_0x45af('0x8')]('VtigerConfiguration',attributes,{'tableName':_0x45af('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 018a5d3..1d089b5 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 _0xbffa=['code','VtigerConfiguration,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x51d44e,_0x51f16a){var _0x1a1da5=function(_0x31fb6f){while(--_0x31fb6f){_0x51d44e['push'](_0x51d44e['shift']());}};_0x1a1da5(++_0x51f16a);}(_0xbffa,0xea));var _0xabff=function(_0x3f45ca,_0x50ecc3){_0x3f45ca=_0x3f45ca-0x0;var _0x148ed0=_0xbffa[_0x3f45ca];return _0x148ed0;};'use strict';var _=require(_0xabff('0x0'));var util=require('util');var moment=require(_0xabff('0x1'));var BPromise=require(_0xabff('0x2'));var rs=require(_0xabff('0x3'));var fs=require('fs');var Redis=require(_0xabff('0x4'));var db=require(_0xabff('0x5'))['db'];var utils=require(_0xabff('0x6'));var logger=require(_0xabff('0x7'))(_0xabff('0x8'));var config=require('../../config/environment');var jayson=require(_0xabff('0x9'));var client=jayson[_0xabff('0xa')][_0xabff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2fba01,_0x406cca,_0x32b85b){return new BPromise(function(_0xed20d7,_0x426c02){return client[_0xabff('0xc')](_0x2fba01,_0x32b85b)['then'](function(_0x2cd8f5){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x406cca,'request\x20sent');logger[_0xabff('0xd')](_0xabff('0xe'),_0x406cca,_0xabff('0xf'),JSON[_0xabff('0x10')](_0x2cd8f5));if(_0x2cd8f5[_0xabff('0x11')]){if(_0x2cd8f5[_0xabff('0x11')][_0xabff('0x12')]===0x1f4){logger[_0xabff('0x11')](_0xabff('0x13'),_0x406cca,_0x2cd8f5['error'][_0xabff('0x14')]);return _0x426c02(_0x2cd8f5[_0xabff('0x11')][_0xabff('0x14')]);}logger[_0xabff('0x11')](_0xabff('0x13'),_0x406cca,_0x2cd8f5[_0xabff('0x11')][_0xabff('0x14')]);return _0xed20d7(_0x2cd8f5[_0xabff('0x11')][_0xabff('0x14')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x406cca,_0xabff('0xf'));_0xed20d7(_0x2cd8f5['result'][_0xabff('0x14')]);}})['catch'](function(_0x280259){logger[_0xabff('0x11')](_0xabff('0x13'),_0x406cca,_0x280259);_0x426c02(_0x280259);});});} \ No newline at end of file +var _0x0138=['message','info','catch','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0138,0x1cf));var _0x8013=function(_0x124042,_0x54227d){_0x124042=_0x124042-0x0;var _0x26e3bd=_0x0138[_0x124042];return _0x26e3bd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8013('0x0'));var BPromise=require(_0x8013('0x1'));var rs=require(_0x8013('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8013('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8013('0x4'));var config=require(_0x8013('0x5'));var jayson=require(_0x8013('0x6'));var client=jayson[_0x8013('0x7')][_0x8013('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b0f01,_0x549269,_0x21f6be){return new BPromise(function(_0x5e84e9,_0x52d561){return client[_0x8013('0x9')](_0x1b0f01,_0x21f6be)[_0x8013('0xa')](function(_0x2f0ea7){logger['info'](_0x8013('0xb'),_0x549269,_0x8013('0xc'));logger['debug'](_0x8013('0xd'),_0x549269,_0x8013('0xc'),JSON[_0x8013('0xe')](_0x2f0ea7));if(_0x2f0ea7['error']){if(_0x2f0ea7[_0x8013('0xf')][_0x8013('0x10')]===0x1f4){logger[_0x8013('0xf')](_0x8013('0xb'),_0x549269,_0x2f0ea7['error'][_0x8013('0x11')]);return _0x52d561(_0x2f0ea7['error'][_0x8013('0x11')]);}logger[_0x8013('0xf')](_0x8013('0xb'),_0x549269,_0x2f0ea7[_0x8013('0xf')]['message']);return _0x5e84e9(_0x2f0ea7[_0x8013('0xf')]['message']);}else{logger[_0x8013('0x12')](_0x8013('0xb'),_0x549269,'request\x20sent');_0x5e84e9(_0x2f0ea7['result'][_0x8013('0x11')]);}})[_0x8013('0x13')](function(_0xe45672){logger[_0x8013('0xf')](_0x8013('0xb'),_0x549269,_0xe45672);_0x52d561(_0xe45672);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 7ec75bf..b722a8f 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 _0xc254=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','util','path','express'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xc254,0xba));var _0x4c25=function(_0xb7db07,_0x1ce877){_0xb7db07=_0xb7db07-0x0;var _0x24a8b3=_0xc254[_0xb7db07];return _0x24a8b3;};'use strict';var multer=require(_0x4c25('0x0'));var util=require(_0x4c25('0x1'));var path=require(_0x4c25('0x2'));var timeout=require('connect-timeout');var express=require(_0x4c25('0x3'));var router=express[_0x4c25('0x4')]();var fs_extra=require(_0x4c25('0x5'));var auth=require(_0x4c25('0x6'));var interaction=require(_0x4c25('0x7'));var config=require('../../config/environment');var controller=require('./intVtigerField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4c25('0x8')]);router[_0x4c25('0x9')](_0x4c25('0xa'),auth[_0x4c25('0xb')](),controller[_0x4c25('0xc')]);router[_0x4c25('0xd')]('/',auth['isAuthenticated'](),controller[_0x4c25('0xe')]);router[_0x4c25('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x4c25('0x10')]);router[_0x4c25('0x11')](_0x4c25('0xa'),auth[_0x4c25('0xb')](),controller[_0x4c25('0x12')]);module['exports']=router; \ No newline at end of file +var _0x2aab=['fs-extra','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','exports','util','path','connect-timeout','express','Router'];(function(_0x4bfe08,_0x48ae7b){var _0x1f9125=function(_0x11450e){while(--_0x11450e){_0x4bfe08['push'](_0x4bfe08['shift']());}};_0x1f9125(++_0x48ae7b);}(_0x2aab,0x118));var _0xb2aa=function(_0xd278a3,_0x22bd2f){_0xd278a3=_0xd278a3-0x0;var _0x2a4332=_0x2aab[_0xd278a3];return _0x2a4332;};'use strict';var multer=require('multer');var util=require(_0xb2aa('0x0'));var path=require(_0xb2aa('0x1'));var timeout=require(_0xb2aa('0x2'));var express=require(_0xb2aa('0x3'));var router=express[_0xb2aa('0x4')]();var fs_extra=require(_0xb2aa('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb2aa('0x6'));var config=require(_0xb2aa('0x7'));var controller=require(_0xb2aa('0x8'));router[_0xb2aa('0x9')]('/',auth[_0xb2aa('0xa')](),controller[_0xb2aa('0xb')]);router['get'](_0xb2aa('0xc'),auth['isAuthenticated'](),controller[_0xb2aa('0xd')]);router[_0xb2aa('0xe')]('/',auth['isAuthenticated'](),controller[_0xb2aa('0xf')]);router[_0xb2aa('0x10')]('/:id',auth[_0xb2aa('0xa')](),controller['update']);router[_0xb2aa('0x11')](_0xb2aa('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xb2aa('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index fbfc5cf..59108ca 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 _0xc651=['ENUM','variable','customVariable','string','STRING','BOOLEAN','sequelize','exports'];(function(_0x5833bc,_0xea3805){var _0x5ea05c=function(_0x5bf1cc){while(--_0x5bf1cc){_0x5833bc['push'](_0x5833bc['shift']());}};_0x5ea05c(++_0xea3805);}(_0xc651,0x76));var _0x1c65=function(_0x336e78,_0x542248){_0x336e78=_0x336e78-0x0;var _0x4b85c3=_0xc651[_0x336e78];return _0x4b85c3;};'use strict';var Sequelize=require(_0x1c65('0x0'));module[_0x1c65('0x1')]={'type':{'type':Sequelize[_0x1c65('0x2')]('string',_0x1c65('0x3'),_0x1c65('0x4'),'keyValue','picklist'),'defaultValue':_0x1c65('0x5')},'content':{'type':Sequelize[_0x1c65('0x6')]},'key':{'type':Sequelize[_0x1c65('0x6')]},'keyType':{'type':Sequelize[_0x1c65('0x2')](_0x1c65('0x5'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x1c65('0x6')]},'idField':{'type':Sequelize[_0x1c65('0x6')]},'nameField':{'type':Sequelize[_0x1c65('0x6')]},'customField':{'type':Sequelize[_0x1c65('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1c65('0x6')]}}; \ No newline at end of file +var _0x2191=['BOOLEAN','sequelize','ENUM','string','customVariable','picklist','STRING'];(function(_0x7446dd,_0x4f9f79){var _0x3cf9b6=function(_0x7d02ef){while(--_0x7d02ef){_0x7446dd['push'](_0x7446dd['shift']());}};_0x3cf9b6(++_0x4f9f79);}(_0x2191,0x1d6));var _0x1219=function(_0x7e9ff7,_0x1ab0af){_0x7e9ff7=_0x7e9ff7-0x0;var _0x29c7c2=_0x2191[_0x7e9ff7];return _0x29c7c2;};'use strict';var Sequelize=require(_0x1219('0x0'));module['exports']={'type':{'type':Sequelize[_0x1219('0x1')](_0x1219('0x2'),'variable',_0x1219('0x3'),'keyValue',_0x1219('0x4')),'defaultValue':_0x1219('0x2')},'content':{'type':Sequelize[_0x1219('0x5')]},'key':{'type':Sequelize[_0x1219('0x5')]},'keyType':{'type':Sequelize[_0x1219('0x1')](_0x1219('0x2'),'variable',_0x1219('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1219('0x5')]},'customField':{'type':Sequelize[_0x1219('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1219('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 30b2780..526b745 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 _0xa47b=['stack','name','send','index','map','VtigerField','rawAttributes','type','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','to-csv','fs-extra','lodash','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','destroy','then','error'];(function(_0x169f2e,_0xeb0736){var _0x3daf2c=function(_0x3410e0){while(--_0x3410e0){_0x169f2e['push'](_0x169f2e['shift']());}};_0x3daf2c(++_0xeb0736);}(_0xa47b,0x1b3));var _0xba47=function(_0x5cf758,_0xf6dd5){_0x5cf758=_0x5cf758-0x0;var _0x3b4a59=_0xa47b[_0x5cf758];return _0x3b4a59;};'use strict';var emlformat=require(_0xba47('0x0'));var rimraf=require(_0xba47('0x1'));var zipdir=require(_0xba47('0x2'));var jsonpatch=require(_0xba47('0x3'));var rp=require('request-promise');var moment=require(_0xba47('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xba47('0x5'));var path=require(_0xba47('0x6'));var sox=require('sox');var csv=require(_0xba47('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba47('0x8'));var _=require(_0xba47('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xba47('0xa'));var toCsv=require(_0xba47('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xba47('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xba47('0xc'));var as=require(_0xba47('0xd'));var hardwareService=require(_0xba47('0xe'));var logger=require(_0xba47('0xf'))(_0xba47('0x10'));var utils=require(_0xba47('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xba47('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dedb0,_0x2e38ae){_0x2e38ae=_0x2e38ae||0xcc;return function(_0x33ad1b){if(_0x33ad1b){return _0x4dedb0[_0xba47('0x13')](_0x2e38ae);}return _0x4dedb0[_0xba47('0x14')](_0x2e38ae)[_0xba47('0x15')]();};}function respondWithResult(_0x5acc06,_0x1bb8e9){_0x1bb8e9=_0x1bb8e9||0xc8;return function(_0x3b3905){if(_0x3b3905){return _0x5acc06[_0xba47('0x14')](_0x1bb8e9)[_0xba47('0x16')](_0x3b3905);}};}function respondWithFilteredResult(_0x309c40,_0x30bc63){return function(_0x5ceb8a){if(_0x5ceb8a){var _0x1e8983=typeof _0x30bc63[_0xba47('0x17')]==='undefined'&&typeof _0x30bc63[_0xba47('0x18')]===_0xba47('0x19');var _0x5ac7e0=_0x5ceb8a[_0xba47('0x1a')];var _0x2281ac=_0x1e8983?0x0:_0x30bc63[_0xba47('0x17')];var _0xaa721d=_0x1e8983?_0x5ceb8a[_0xba47('0x1a')]:_0x30bc63[_0xba47('0x17')]+_0x30bc63[_0xba47('0x18')];var _0x4997df;if(_0xaa721d>=_0x5ac7e0){_0xaa721d=_0x5ac7e0;_0x4997df=0xc8;}else{_0x4997df=0xce;}_0x309c40[_0xba47('0x14')](_0x4997df);return _0x309c40[_0xba47('0x1b')](_0xba47('0x1c'),_0x2281ac+'-'+_0xaa721d+'/'+_0x5ac7e0)[_0xba47('0x16')](_0x5ceb8a);}return null;};}function patchUpdates(_0x1ce35b){return function(_0x438060){try{jsonpatch[_0xba47('0x1d')](_0x438060,_0x1ce35b,!![]);}catch(_0x2f1f6d){return BPromise['reject'](_0x2f1f6d);}return _0x438060[_0xba47('0x1e')]();};}function saveUpdates(_0x3b9609,_0x45fd28){return function(_0x19864c){if(_0x19864c){return _0x19864c['update'](_0x3b9609)['then'](function(_0x37bb4b){return _0x37bb4b;});}return null;};}function removeEntity(_0x3af0b2,_0x5ee8ad){return function(_0x1d871d){if(_0x1d871d){return _0x1d871d[_0xba47('0x1f')]()[_0xba47('0x20')](function(){_0x3af0b2[_0xba47('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x78496d,_0x2aabe0){return function(_0xd03d24){if(!_0xd03d24){_0x78496d['sendStatus'](0x194);}return _0xd03d24;};}function handleError(_0x554bda,_0x3a1119){_0x3a1119=_0x3a1119||0x1f4;return function(_0x3507e7){logger[_0xba47('0x21')](_0x3507e7[_0xba47('0x22')]);if(_0x3507e7[_0xba47('0x23')]){delete _0x3507e7[_0xba47('0x23')];}_0x554bda[_0xba47('0x14')](_0x3a1119)[_0xba47('0x24')](_0x3507e7);};}exports[_0xba47('0x25')]=function(_0x2eb474,_0x3d40e8){var _0xa0f47={},_0x3118d9={},_0x209821={'count':0x0,'rows':[]};var _0x4cf35e=_[_0xba47('0x26')](db[_0xba47('0x27')][_0xba47('0x28')],function(_0x244438){return{'name':_0x244438['fieldName'],'type':_0x244438[_0xba47('0x29')]['key']};});_0x3118d9['model']=_[_0xba47('0x26')](_0x4cf35e,_0xba47('0x23'));_0x3118d9[_0xba47('0x2a')]=_[_0xba47('0x2b')](_0x2eb474[_0xba47('0x2a')]);_0x3118d9['filters']=_[_0xba47('0x2c')](_0x3118d9[_0xba47('0x2d')],_0x3118d9[_0xba47('0x2a')]);_0xa0f47[_0xba47('0x2e')]=_[_0xba47('0x2c')](_0x3118d9[_0xba47('0x2d')],qs['fields'](_0x2eb474[_0xba47('0x2a')][_0xba47('0x2f')]));_0xa0f47[_0xba47('0x2e')]=_0xa0f47[_0xba47('0x2e')][_0xba47('0x30')]?_0xa0f47['attributes']:_0x3118d9[_0xba47('0x2d')];if(!_0x2eb474[_0xba47('0x2a')]['hasOwnProperty'](_0xba47('0x31'))){_0xa0f47[_0xba47('0x18')]=qs[_0xba47('0x18')](_0x2eb474[_0xba47('0x2a')][_0xba47('0x18')]);_0xa0f47[_0xba47('0x17')]=qs['offset'](_0x2eb474[_0xba47('0x2a')][_0xba47('0x17')]);}_0xa0f47[_0xba47('0x32')]=qs[_0xba47('0x33')](_0x2eb474[_0xba47('0x2a')]['sort']);_0xa0f47[_0xba47('0x34')]=qs[_0xba47('0x35')](_[_0xba47('0x36')](_0x2eb474[_0xba47('0x2a')],_0x3118d9[_0xba47('0x35')]),_0x4cf35e);if(_0x2eb474['query'][_0xba47('0x37')]){_0xa0f47[_0xba47('0x34')]=_[_0xba47('0x38')](_0xa0f47[_0xba47('0x34')],{'$or':_['map'](_0x4cf35e,function(_0x4160f2){if(_0x4160f2[_0xba47('0x29')]!==_0xba47('0x39')){var _0x13c553={};_0x13c553[_0x4160f2['name']]={'$like':'%'+_0x2eb474[_0xba47('0x2a')][_0xba47('0x37')]+'%'};return _0x13c553;}})});}_0xa0f47=_[_0xba47('0x38')]({},_0xa0f47,_0x2eb474[_0xba47('0x3a')]);var _0x46525e={'where':_0xa0f47[_0xba47('0x34')]};return db[_0xba47('0x27')]['count'](_0x46525e)['then'](function(_0x47bc27){_0x209821['count']=_0x47bc27;if(_0x2eb474[_0xba47('0x2a')][_0xba47('0x3b')]){_0xa0f47[_0xba47('0x3c')]=[{'all':!![]}];}return db['VtigerField'][_0xba47('0x3d')](_0xa0f47);})['then'](function(_0x21d444){_0x209821['rows']=_0x21d444;return _0x209821;})['then'](respondWithFilteredResult(_0x3d40e8,_0xa0f47))[_0xba47('0x3e')](handleError(_0x3d40e8,null));};exports['show']=function(_0x6a9aed,_0x4c5e6d){var _0x2aac27={'raw':!![],'where':{'id':_0x6a9aed['params']['id']}},_0x15d56b={};_0x15d56b[_0xba47('0x2d')]=_[_0xba47('0x2b')](db[_0xba47('0x27')][_0xba47('0x28')]);_0x15d56b[_0xba47('0x2a')]=_[_0xba47('0x2b')](_0x6a9aed[_0xba47('0x2a')]);_0x15d56b[_0xba47('0x35')]=_[_0xba47('0x2c')](_0x15d56b['model'],_0x15d56b[_0xba47('0x2a')]);_0x2aac27[_0xba47('0x2e')]=_[_0xba47('0x2c')](_0x15d56b[_0xba47('0x2d')],qs['fields'](_0x6a9aed[_0xba47('0x2a')][_0xba47('0x2f')]));_0x2aac27[_0xba47('0x2e')]=_0x2aac27[_0xba47('0x2e')][_0xba47('0x30')]?_0x2aac27[_0xba47('0x2e')]:_0x15d56b[_0xba47('0x2d')];if(_0x6a9aed[_0xba47('0x2a')][_0xba47('0x3b')]){_0x2aac27[_0xba47('0x3c')]=[{'all':!![]}];}_0x2aac27=_['merge']({},_0x2aac27,_0x6a9aed['options']);return db[_0xba47('0x27')][_0xba47('0x3f')](_0x2aac27)[_0xba47('0x20')](handleEntityNotFound(_0x4c5e6d,null))[_0xba47('0x20')](respondWithResult(_0x4c5e6d,null))[_0xba47('0x3e')](handleError(_0x4c5e6d,null));};exports[_0xba47('0x40')]=function(_0x2eab8a,_0x1c6b25){return db[_0xba47('0x27')][_0xba47('0x40')](_0x2eab8a[_0xba47('0x41')],{})[_0xba47('0x20')](respondWithResult(_0x1c6b25,0xc9))[_0xba47('0x3e')](handleError(_0x1c6b25,null));};exports['update']=function(_0x1738bb,_0xb51948){if(_0x1738bb['body']['id']){delete _0x1738bb[_0xba47('0x41')]['id'];}return db[_0xba47('0x27')][_0xba47('0x3f')]({'where':{'id':_0x1738bb['params']['id']}})[_0xba47('0x20')](handleEntityNotFound(_0xb51948,null))[_0xba47('0x20')](saveUpdates(_0x1738bb['body'],null))[_0xba47('0x20')](respondWithResult(_0xb51948,null))['catch'](handleError(_0xb51948,null));};exports[_0xba47('0x1f')]=function(_0x5d07d5,_0x402edd){return db[_0xba47('0x27')]['find']({'where':{'id':_0x5d07d5[_0xba47('0x42')]['id']}})[_0xba47('0x20')](handleEntityNotFound(_0x402edd,null))[_0xba47('0x20')](removeEntity(_0x402edd,null))['catch'](handleError(_0x402edd,null));}; \ No newline at end of file +var _0x9bf4=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','map','VtigerField','fieldName','type','query','keys','intersection','model','attributes','fields','length','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x1e8367,_0x4c2b73){var _0x186fe6=function(_0x2a0ef9){while(--_0x2a0ef9){_0x1e8367['push'](_0x1e8367['shift']());}};_0x186fe6(++_0x4c2b73);}(_0x9bf4,0x120));var _0x49bf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9bf4[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x49bf('0x0'));var rimraf=require(_0x49bf('0x1'));var zipdir=require(_0x49bf('0x2'));var jsonpatch=require(_0x49bf('0x3'));var rp=require(_0x49bf('0x4'));var moment=require(_0x49bf('0x5'));var BPromise=require(_0x49bf('0x6'));var Mustache=require('mustache');var util=require(_0x49bf('0x7'));var path=require(_0x49bf('0x8'));var sox=require(_0x49bf('0x9'));var csv=require(_0x49bf('0xa'));var ejs=require(_0x49bf('0xb'));var fs=require('fs');var fs_extra=require(_0x49bf('0xc'));var _=require(_0x49bf('0xd'));var squel=require(_0x49bf('0xe'));var crypto=require(_0x49bf('0xf'));var jsforce=require(_0x49bf('0x10'));var deskjs=require(_0x49bf('0x11'));var toCsv=require('to-csv');var querystring=require(_0x49bf('0x12'));var Papa=require(_0x49bf('0x13'));var Redis=require('ioredis');var authService=require(_0x49bf('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x49bf('0x15'));var hardwareService=require(_0x49bf('0x16'));var logger=require(_0x49bf('0x17'))(_0x49bf('0x18'));var utils=require(_0x49bf('0x19'));var config=require(_0x49bf('0x1a'));var licenseUtil=require(_0x49bf('0x1b'));var db=require(_0x49bf('0x1c'))['db'];function respondWithStatusCode(_0x35221c,_0x3a4e6b){_0x3a4e6b=_0x3a4e6b||0xcc;return function(_0x233619){if(_0x233619){return _0x35221c[_0x49bf('0x1d')](_0x3a4e6b);}return _0x35221c[_0x49bf('0x1e')](_0x3a4e6b)['end']();};}function respondWithResult(_0x6a416f,_0x262246){_0x262246=_0x262246||0xc8;return function(_0x17648e){if(_0x17648e){return _0x6a416f[_0x49bf('0x1e')](_0x262246)[_0x49bf('0x1f')](_0x17648e);}};}function respondWithFilteredResult(_0x470330,_0x1f59da){return function(_0x191d8a){if(_0x191d8a){var _0x5edc49=typeof _0x1f59da[_0x49bf('0x20')]===_0x49bf('0x21')&&typeof _0x1f59da[_0x49bf('0x22')]===_0x49bf('0x21');var _0xb93f17=_0x191d8a[_0x49bf('0x23')];var _0x47fce0=_0x5edc49?0x0:_0x1f59da[_0x49bf('0x20')];var _0x5deca6=_0x5edc49?_0x191d8a[_0x49bf('0x23')]:_0x1f59da[_0x49bf('0x20')]+_0x1f59da['limit'];var _0x4e2824;if(_0x5deca6>=_0xb93f17){_0x5deca6=_0xb93f17;_0x4e2824=0xc8;}else{_0x4e2824=0xce;}_0x470330[_0x49bf('0x1e')](_0x4e2824);return _0x470330[_0x49bf('0x24')](_0x49bf('0x25'),_0x47fce0+'-'+_0x5deca6+'/'+_0xb93f17)['json'](_0x191d8a);}return null;};}function patchUpdates(_0x1975da){return function(_0x5ec749){try{jsonpatch[_0x49bf('0x26')](_0x5ec749,_0x1975da,!![]);}catch(_0x5a8c43){return BPromise[_0x49bf('0x27')](_0x5a8c43);}return _0x5ec749['save']();};}function saveUpdates(_0x20ac6c,_0x5a4348){return function(_0x3bf3f5){if(_0x3bf3f5){return _0x3bf3f5[_0x49bf('0x28')](_0x20ac6c)[_0x49bf('0x29')](function(_0x87a155){return _0x87a155;});}return null;};}function removeEntity(_0x97b624,_0x5d1394){return function(_0x1b45dd){if(_0x1b45dd){return _0x1b45dd[_0x49bf('0x2a')]()[_0x49bf('0x29')](function(){_0x97b624[_0x49bf('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ce608,_0xbd6dd8){return function(_0x5dd936){if(!_0x5dd936){_0x2ce608[_0x49bf('0x1d')](0x194);}return _0x5dd936;};}function handleError(_0x4e9822,_0x57f754){_0x57f754=_0x57f754||0x1f4;return function(_0xb195fe){logger[_0x49bf('0x2b')](_0xb195fe[_0x49bf('0x2c')]);if(_0xb195fe[_0x49bf('0x2d')]){delete _0xb195fe[_0x49bf('0x2d')];}_0x4e9822['status'](_0x57f754)['send'](_0xb195fe);};}exports['index']=function(_0xeefb34,_0x50eb75){var _0x2b1ca2={},_0x313516={},_0x378574={'count':0x0,'rows':[]};var _0x5d4abe=_[_0x49bf('0x2e')](db[_0x49bf('0x2f')]['rawAttributes'],function(_0x5de8fa){return{'name':_0x5de8fa[_0x49bf('0x30')],'type':_0x5de8fa[_0x49bf('0x31')]['key']};});_0x313516['model']=_[_0x49bf('0x2e')](_0x5d4abe,'name');_0x313516[_0x49bf('0x32')]=_[_0x49bf('0x33')](_0xeefb34[_0x49bf('0x32')]);_0x313516['filters']=_[_0x49bf('0x34')](_0x313516[_0x49bf('0x35')],_0x313516[_0x49bf('0x32')]);_0x2b1ca2[_0x49bf('0x36')]=_[_0x49bf('0x34')](_0x313516[_0x49bf('0x35')],qs[_0x49bf('0x37')](_0xeefb34[_0x49bf('0x32')][_0x49bf('0x37')]));_0x2b1ca2[_0x49bf('0x36')]=_0x2b1ca2[_0x49bf('0x36')][_0x49bf('0x38')]?_0x2b1ca2[_0x49bf('0x36')]:_0x313516['model'];if(!_0xeefb34['query']['hasOwnProperty']('nolimit')){_0x2b1ca2[_0x49bf('0x22')]=qs['limit'](_0xeefb34[_0x49bf('0x32')][_0x49bf('0x22')]);_0x2b1ca2[_0x49bf('0x20')]=qs['offset'](_0xeefb34['query']['offset']);}_0x2b1ca2[_0x49bf('0x39')]=qs[_0x49bf('0x3a')](_0xeefb34['query'][_0x49bf('0x3a')]);_0x2b1ca2[_0x49bf('0x3b')]=qs[_0x49bf('0x3c')](_[_0x49bf('0x3d')](_0xeefb34['query'],_0x313516[_0x49bf('0x3c')]),_0x5d4abe);if(_0xeefb34[_0x49bf('0x32')][_0x49bf('0x3e')]){_0x2b1ca2[_0x49bf('0x3b')]=_[_0x49bf('0x3f')](_0x2b1ca2['where'],{'$or':_[_0x49bf('0x2e')](_0x5d4abe,function(_0x554c71){if(_0x554c71['type']!=='VIRTUAL'){var _0xcca027={};_0xcca027[_0x554c71[_0x49bf('0x2d')]]={'$like':'%'+_0xeefb34[_0x49bf('0x32')]['filter']+'%'};return _0xcca027;}})});}_0x2b1ca2=_['merge']({},_0x2b1ca2,_0xeefb34[_0x49bf('0x40')]);var _0x5104a2={'where':_0x2b1ca2['where']};return db['VtigerField']['count'](_0x5104a2)['then'](function(_0x4603ab){_0x378574[_0x49bf('0x23')]=_0x4603ab;if(_0xeefb34['query'][_0x49bf('0x41')]){_0x2b1ca2[_0x49bf('0x42')]=[{'all':!![]}];}return db[_0x49bf('0x2f')][_0x49bf('0x43')](_0x2b1ca2);})[_0x49bf('0x29')](function(_0xd8890f){_0x378574[_0x49bf('0x44')]=_0xd8890f;return _0x378574;})[_0x49bf('0x29')](respondWithFilteredResult(_0x50eb75,_0x2b1ca2))[_0x49bf('0x45')](handleError(_0x50eb75,null));};exports[_0x49bf('0x46')]=function(_0x5ba44d,_0x109ae0){var _0x1217d3={'raw':!![],'where':{'id':_0x5ba44d[_0x49bf('0x47')]['id']}},_0x40834a={};_0x40834a['model']=_[_0x49bf('0x33')](db[_0x49bf('0x2f')][_0x49bf('0x48')]);_0x40834a[_0x49bf('0x32')]=_[_0x49bf('0x33')](_0x5ba44d[_0x49bf('0x32')]);_0x40834a['filters']=_['intersection'](_0x40834a[_0x49bf('0x35')],_0x40834a[_0x49bf('0x32')]);_0x1217d3[_0x49bf('0x36')]=_[_0x49bf('0x34')](_0x40834a[_0x49bf('0x35')],qs[_0x49bf('0x37')](_0x5ba44d[_0x49bf('0x32')][_0x49bf('0x37')]));_0x1217d3[_0x49bf('0x36')]=_0x1217d3[_0x49bf('0x36')][_0x49bf('0x38')]?_0x1217d3[_0x49bf('0x36')]:_0x40834a[_0x49bf('0x35')];if(_0x5ba44d['query'][_0x49bf('0x41')]){_0x1217d3[_0x49bf('0x42')]=[{'all':!![]}];}_0x1217d3=_[_0x49bf('0x3f')]({},_0x1217d3,_0x5ba44d[_0x49bf('0x40')]);return db[_0x49bf('0x2f')]['find'](_0x1217d3)[_0x49bf('0x29')](handleEntityNotFound(_0x109ae0,null))['then'](respondWithResult(_0x109ae0,null))[_0x49bf('0x45')](handleError(_0x109ae0,null));};exports[_0x49bf('0x49')]=function(_0x5d5095,_0x5744de){return db[_0x49bf('0x2f')]['create'](_0x5d5095[_0x49bf('0x4a')],{})['then'](respondWithResult(_0x5744de,0xc9))[_0x49bf('0x45')](handleError(_0x5744de,null));};exports['update']=function(_0x3194d4,_0x2ce431){if(_0x3194d4[_0x49bf('0x4a')]['id']){delete _0x3194d4['body']['id'];}return db[_0x49bf('0x2f')][_0x49bf('0x4b')]({'where':{'id':_0x3194d4['params']['id']}})[_0x49bf('0x29')](handleEntityNotFound(_0x2ce431,null))[_0x49bf('0x29')](saveUpdates(_0x3194d4[_0x49bf('0x4a')],null))['then'](respondWithResult(_0x2ce431,null))[_0x49bf('0x45')](handleError(_0x2ce431,null));};exports[_0x49bf('0x2a')]=function(_0x3b4044,_0x44becc){return db[_0x49bf('0x2f')][_0x49bf('0x4b')]({'where':{'id':_0x3b4044[_0x49bf('0x47')]['id']}})['then'](handleEntityNotFound(_0x44becc,null))[_0x49bf('0x29')](removeEntity(_0x44becc,null))[_0x49bf('0x45')](handleError(_0x44becc,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 65391b2..d6bbbd6 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 _0xe170=['../../config/environment','exports','define','VtigerField','int_vtiger_fields','FieldId','lodash','api','request-promise','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe170,0x1d2));var _0x0e17=function(_0xe6e3e2,_0x2b01da){_0xe6e3e2=_0xe6e3e2-0x0;var _0x126571=_0xe170[_0xe6e3e2];return _0x126571;};'use strict';var _=require(_0x0e17('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0e17('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0e17('0x2'));var fs=require('fs');var path=require(_0x0e17('0x3'));var rimraf=require('rimraf');var config=require(_0x0e17('0x4'));var attributes=require('./intVtigerField.attributes');module[_0x0e17('0x5')]=function(_0xdbfd,_0xff4ca7){return _0xdbfd[_0x0e17('0x6')](_0x0e17('0x7'),attributes,{'tableName':_0x0e17('0x8'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField',_0x0e17('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc1cb=['exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x40cea0,_0x500d4e){var _0x322a8b=function(_0x30e2d3){while(--_0x30e2d3){_0x40cea0['push'](_0x40cea0['shift']());}};_0x322a8b(++_0x500d4e);}(_0xc1cb,0xac));var _0xbc1c=function(_0x526093,_0x2f534e){_0x526093=_0x526093-0x0;var _0x1c0e99=_0xc1cb[_0x526093];return _0x1c0e99;};'use strict';var _=require(_0xbc1c('0x0'));var util=require(_0xbc1c('0x1'));var logger=require('../../config/logger')(_0xbc1c('0x2'));var moment=require(_0xbc1c('0x3'));var BPromise=require(_0xbc1c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc1c('0x5'));var rimraf=require(_0xbc1c('0x6'));var config=require(_0xbc1c('0x7'));var attributes=require('./intVtigerField.attributes');module[_0xbc1c('0x8')]=function(_0x297a03,_0x67ae9b){return _0x297a03[_0xbc1c('0x9')](_0xbc1c('0xa'),attributes,{'tableName':_0xbc1c('0xb'),'paranoid':![],'indexes':[{'name':_0xbc1c('0xc'),'fields':[_0xbc1c('0xd'),_0xbc1c('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index ab66fd8..3fdf38c 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 _0xadf7=['catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x406696,_0x39f9b1){var _0x10e35c=function(_0x108de3){while(--_0x108de3){_0x406696['push'](_0x406696['shift']());}};_0x10e35c(++_0x39f9b1);}(_0xadf7,0xb5));var _0x7adf=function(_0x1cadad,_0x25aba8){_0x1cadad=_0x1cadad-0x0;var _0x2ebed7=_0xadf7[_0x1cadad];return _0x2ebed7;};'use strict';var _=require(_0x7adf('0x0'));var util=require('util');var moment=require(_0x7adf('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7adf('0x2'));var db=require(_0x7adf('0x3'))['db'];var utils=require(_0x7adf('0x4'));var logger=require(_0x7adf('0x5'))(_0x7adf('0x6'));var config=require(_0x7adf('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7adf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x570722,_0x1c3d08,_0xa6c76f){return new BPromise(function(_0x18ef38,_0x239caa){return client[_0x7adf('0x9')](_0x570722,_0xa6c76f)[_0x7adf('0xa')](function(_0x56ebff){logger[_0x7adf('0xb')](_0x7adf('0xc'),_0x1c3d08,_0x7adf('0xd'));logger['debug'](_0x7adf('0xe'),_0x1c3d08,_0x7adf('0xd'),JSON['stringify'](_0x56ebff));if(_0x56ebff[_0x7adf('0xf')]){if(_0x56ebff[_0x7adf('0xf')]['code']===0x1f4){logger[_0x7adf('0xf')](_0x7adf('0xc'),_0x1c3d08,_0x56ebff[_0x7adf('0xf')][_0x7adf('0x10')]);return _0x239caa(_0x56ebff['error'][_0x7adf('0x10')]);}logger[_0x7adf('0xf')](_0x7adf('0xc'),_0x1c3d08,_0x56ebff['error'][_0x7adf('0x10')]);return _0x18ef38(_0x56ebff[_0x7adf('0xf')][_0x7adf('0x10')]);}else{logger[_0x7adf('0xb')](_0x7adf('0xc'),_0x1c3d08,_0x7adf('0xd'));_0x18ef38(_0x56ebff['result'][_0x7adf('0x10')]);}})[_0x7adf('0x11')](function(_0x56acb2){logger['error'](_0x7adf('0xc'),_0x1c3d08,_0x56acb2);_0x239caa(_0x56acb2);});});} \ No newline at end of file +var _0x923d=['catch','util','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x19ddfd,_0x2bd2d9){var _0x523a04=function(_0x11dee9){while(--_0x11dee9){_0x19ddfd['push'](_0x19ddfd['shift']());}};_0x523a04(++_0x2bd2d9);}(_0x923d,0x11e));var _0xd923=function(_0x1ece20,_0x17576b){_0x1ece20=_0x1ece20-0x0;var _0x27eacf=_0x923d[_0x1ece20];return _0x27eacf;};'use strict';var _=require('lodash');var util=require(_0xd923('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd923('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xd923('0x2'));var logger=require(_0xd923('0x3'))('rpc');var config=require(_0xd923('0x4'));var jayson=require(_0xd923('0x5'));var client=jayson[_0xd923('0x6')][_0xd923('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4e3e70,_0x2bb0de,_0x354e79){return new BPromise(function(_0x59215c,_0x1abc46){return client[_0xd923('0x8')](_0x4e3e70,_0x354e79)['then'](function(_0x296f34){logger[_0xd923('0x9')](_0xd923('0xa'),_0x2bb0de,_0xd923('0xb'));logger[_0xd923('0xc')](_0xd923('0xd'),_0x2bb0de,_0xd923('0xb'),JSON[_0xd923('0xe')](_0x296f34));if(_0x296f34[_0xd923('0xf')]){if(_0x296f34[_0xd923('0xf')]['code']===0x1f4){logger[_0xd923('0xf')]('VtigerField,\x20%s,\x20%s',_0x2bb0de,_0x296f34[_0xd923('0xf')][_0xd923('0x10')]);return _0x1abc46(_0x296f34[_0xd923('0xf')][_0xd923('0x10')]);}logger[_0xd923('0xf')]('VtigerField,\x20%s,\x20%s',_0x2bb0de,_0x296f34[_0xd923('0xf')][_0xd923('0x10')]);return _0x59215c(_0x296f34['error'][_0xd923('0x10')]);}else{logger[_0xd923('0x9')](_0xd923('0xa'),_0x2bb0de,'request\x20sent');_0x59215c(_0x296f34[_0xd923('0x11')]['message']);}})[_0xd923('0x12')](function(_0x16b5b9){logger[_0xd923('0xf')](_0xd923('0xa'),_0x2bb0de,_0x16b5b9);_0x1abc46(_0x16b5b9);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 9a9a1e4..07fa8b7 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 _0xbd0a=['addConfiguration','put','/:id','update','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','show','/:id/fields','getFields','post','/:id/configurations'];(function(_0x176865,_0x465e53){var _0x2bc1e1=function(_0x185001){while(--_0x185001){_0x176865['push'](_0x176865['shift']());}};_0x2bc1e1(++_0x465e53);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x1429e2,_0x542781){_0x1429e2=_0x1429e2-0x0;var _0x5312da=_0xbd0a[_0x1429e2];return _0x5312da;};'use strict';var multer=require(_0xabd0('0x0'));var util=require('util');var path=require(_0xabd0('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xabd0('0x2'));var auth=require(_0xabd0('0x3'));var interaction=require(_0xabd0('0x4'));var config=require(_0xabd0('0x5'));var controller=require(_0xabd0('0x6'));router[_0xabd0('0x7')]('/',auth[_0xabd0('0x8')](),controller[_0xabd0('0x9')]);router[_0xabd0('0x7')]('/:id',auth[_0xabd0('0x8')](),controller[_0xabd0('0xa')]);router[_0xabd0('0x7')]('/:id/configurations',auth[_0xabd0('0x8')](),controller['getConfigurations']);router[_0xabd0('0x7')](_0xabd0('0xb'),auth[_0xabd0('0x8')](),controller[_0xabd0('0xc')]);router['post']('/',auth[_0xabd0('0x8')](),controller['create']);router[_0xabd0('0xd')](_0xabd0('0xe'),auth[_0xabd0('0x8')](),controller[_0xabd0('0xf')]);router[_0xabd0('0x10')](_0xabd0('0x11'),auth['isAuthenticated'](),controller[_0xabd0('0x12')]);router['delete'](_0xabd0('0x11'),auth[_0xabd0('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbcf3=['post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields'];(function(_0x858618,_0x1ad2ea){var _0x2b22a0=function(_0x324cb4){while(--_0x324cb4){_0x858618['push'](_0x858618['shift']());}};_0x2b22a0(++_0x1ad2ea);}(_0xbcf3,0x17e));var _0x3bcf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbcf3[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x3bcf('0x0'));var util=require(_0x3bcf('0x1'));var path=require(_0x3bcf('0x2'));var timeout=require(_0x3bcf('0x3'));var express=require(_0x3bcf('0x4'));var router=express[_0x3bcf('0x5')]();var fs_extra=require(_0x3bcf('0x6'));var auth=require(_0x3bcf('0x7'));var interaction=require(_0x3bcf('0x8'));var config=require(_0x3bcf('0x9'));var controller=require('./intZendeskAccount.controller');router[_0x3bcf('0xa')]('/',auth[_0x3bcf('0xb')](),controller[_0x3bcf('0xc')]);router[_0x3bcf('0xa')](_0x3bcf('0xd'),auth[_0x3bcf('0xb')](),controller[_0x3bcf('0xe')]);router[_0x3bcf('0xa')](_0x3bcf('0xf'),auth[_0x3bcf('0xb')](),controller[_0x3bcf('0x10')]);router[_0x3bcf('0xa')]('/:id/fields',auth[_0x3bcf('0xb')](),controller[_0x3bcf('0x11')]);router[_0x3bcf('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x3bcf('0xf'),auth['isAuthenticated'](),controller[_0x3bcf('0x13')]);router[_0x3bcf('0x14')](_0x3bcf('0xd'),auth[_0x3bcf('0xb')](),controller[_0x3bcf('0x15')]);router[_0x3bcf('0x16')](_0x3bcf('0xd'),auth[_0x3bcf('0xb')](),controller[_0x3bcf('0x17')]);module[_0x3bcf('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 d5802f8..a5b738a 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 _0x1893=['newTab','STRING','username','ENUM','password','token','integrationTab'];(function(_0x494682,_0x123904){var _0x72941b=function(_0xc50709){while(--_0xc50709){_0x494682['push'](_0x494682['shift']());}};_0x72941b(++_0x123904);}(_0x1893,0xa2));var _0x3189=function(_0x3a6194,_0x4574e2){_0x3a6194=_0x3a6194-0x0;var _0x298116=_0x1893[_0x3a6194];return _0x298116;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3189('0x0')]},'description':{'type':Sequelize[_0x3189('0x0')]},'username':{'type':Sequelize[_0x3189('0x0')],'unique':_0x3189('0x1')},'password':{'type':Sequelize[_0x3189('0x0')]},'token':{'type':Sequelize[_0x3189('0x0')]},'remoteUri':{'type':Sequelize[_0x3189('0x0')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x3189('0x2')](_0x3189('0x3'),_0x3189('0x4')),'defaultValue':_0x3189('0x3')},'serverUrl':{'type':Sequelize[_0x3189('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x3189('0x2')](_0x3189('0x5'),_0x3189('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xce22=['sequelize','exports','STRING','remoteUri','ENUM','password','token','integrationTab','newTab'];(function(_0x488ea0,_0x1e78fa){var _0x4a225e=function(_0x39c8c6){while(--_0x39c8c6){_0x488ea0['push'](_0x488ea0['shift']());}};_0x4a225e(++_0x1e78fa);}(_0xce22,0xea));var _0x2ce2=function(_0x4e8286,_0x4eaeb4){_0x4e8286=_0x4e8286-0x0;var _0x44a440=_0xce22[_0x4e8286];return _0x44a440;};'use strict';var Sequelize=require(_0x2ce2('0x0'));module[_0x2ce2('0x1')]={'name':{'type':Sequelize[_0x2ce2('0x2')]},'description':{'type':Sequelize[_0x2ce2('0x2')]},'username':{'type':Sequelize[_0x2ce2('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x2ce2('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2ce2('0x2')],'unique':_0x2ce2('0x3')},'authType':{'type':Sequelize[_0x2ce2('0x4')](_0x2ce2('0x5'),_0x2ce2('0x6')),'defaultValue':_0x2ce2('0x5')},'serverUrl':{'type':Sequelize[_0x2ce2('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x2ce2('0x7'),_0x2ce2('0x8')),'defaultValue':_0x2ce2('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index bde5cf2..010ff59 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 _0x7072=['model','query','keys','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskAccount','count','includeAll','findAll','catch','show','fields','length','include','find','create','body','params','getConfigurations','findOne','ZendeskConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','password','token','authType','remoteUri','slice','substring','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','username','toString','base64','%s/token:%s','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type'];(function(_0x15f685,_0x39436d){var _0x171efd=function(_0x424b88){while(--_0x424b88){_0x15f685['push'](_0x15f685['shift']());}};_0x171efd(++_0x39436d);}(_0x7072,0x138));var _0x2707=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x7072[_0x68c979];return _0x4f0001;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2707('0x0'));var zipdir=require(_0x2707('0x1'));var jsonpatch=require(_0x2707('0x2'));var rp=require(_0x2707('0x3'));var moment=require(_0x2707('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2707('0x5'));var path=require('path');var sox=require(_0x2707('0x6'));var csv=require(_0x2707('0x7'));var ejs=require(_0x2707('0x8'));var fs=require('fs');var fs_extra=require(_0x2707('0x9'));var _=require(_0x2707('0xa'));var squel=require(_0x2707('0xb'));var crypto=require(_0x2707('0xc'));var jsforce=require(_0x2707('0xd'));var deskjs=require(_0x2707('0xe'));var toCsv=require(_0x2707('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2707('0xf'));var authService=require(_0x2707('0x10'));var qs=require(_0x2707('0x11'));var as=require(_0x2707('0x12'));var hardwareService=require(_0x2707('0x13'));var logger=require(_0x2707('0x14'))(_0x2707('0x15'));var utils=require(_0x2707('0x16'));var config=require(_0x2707('0x17'));var licenseUtil=require(_0x2707('0x18'));var db=require(_0x2707('0x19'))['db'];var integrations=require(_0x2707('0x1a'));function respondWithStatusCode(_0x40d370,_0x5bf16e){_0x5bf16e=_0x5bf16e||0xcc;return function(_0x44c1d7){if(_0x44c1d7){return _0x40d370['sendStatus'](_0x5bf16e);}return _0x40d370[_0x2707('0x1b')](_0x5bf16e)[_0x2707('0x1c')]();};}function respondWithResult(_0xfe975c,_0x3a67f2){_0x3a67f2=_0x3a67f2||0xc8;return function(_0x13d9ac){if(_0x13d9ac){return _0xfe975c['status'](_0x3a67f2)[_0x2707('0x1d')](_0x13d9ac);}};}function respondWithFilteredResult(_0x1a687a,_0x2f6381){return function(_0x5d523f){if(_0x5d523f){var _0x1153d7=typeof _0x2f6381[_0x2707('0x1e')]===_0x2707('0x1f')&&typeof _0x2f6381[_0x2707('0x20')]===_0x2707('0x1f');var _0x27a3ea=_0x5d523f['count'];var _0x119ac4=_0x1153d7?0x0:_0x2f6381[_0x2707('0x1e')];var _0x4009f3=_0x1153d7?_0x5d523f['count']:_0x2f6381['offset']+_0x2f6381['limit'];var _0x1da4a6;if(_0x4009f3>=_0x27a3ea){_0x4009f3=_0x27a3ea;_0x1da4a6=0xc8;}else{_0x1da4a6=0xce;}_0x1a687a[_0x2707('0x1b')](_0x1da4a6);return _0x1a687a[_0x2707('0x21')](_0x2707('0x22'),_0x119ac4+'-'+_0x4009f3+'/'+_0x27a3ea)[_0x2707('0x1d')](_0x5d523f);}return null;};}function patchUpdates(_0x3c2935){return function(_0xab87f1){try{jsonpatch[_0x2707('0x23')](_0xab87f1,_0x3c2935,!![]);}catch(_0x1e50ea){return BPromise[_0x2707('0x24')](_0x1e50ea);}return _0xab87f1[_0x2707('0x25')]();};}function saveUpdates(_0x119df4,_0x454fde){return function(_0x1c0ffe){if(_0x1c0ffe){return _0x1c0ffe['update'](_0x119df4)[_0x2707('0x26')](function(_0x3b030a){return _0x3b030a;});}return null;};}function removeEntity(_0x46259e,_0x369e3a){return function(_0x378ca4){if(_0x378ca4){return _0x378ca4[_0x2707('0x27')]()['then'](function(){_0x46259e[_0x2707('0x1b')](0xcc)[_0x2707('0x1c')]();});}};}function handleEntityNotFound(_0x171add,_0x2ad386){return function(_0x5b763f){if(!_0x5b763f){_0x171add['sendStatus'](0x194);}return _0x5b763f;};}function handleError(_0x2dce16,_0x4ca05d){_0x4ca05d=_0x4ca05d||0x1f4;return function(_0x29dad2){logger[_0x2707('0x28')](_0x29dad2[_0x2707('0x29')]);if(_0x29dad2['name']){delete _0x29dad2[_0x2707('0x2a')];}_0x2dce16[_0x2707('0x1b')](_0x4ca05d)[_0x2707('0x2b')](_0x29dad2);};}exports['index']=function(_0x31e990,_0x42adf8){var _0x4a99ce={},_0xd63d3f={},_0x497c92={'count':0x0,'rows':[]};var _0x5aaffb=_[_0x2707('0x2c')](db['ZendeskAccount'][_0x2707('0x2d')],function(_0x3f153d){return{'name':_0x3f153d[_0x2707('0x2e')],'type':_0x3f153d[_0x2707('0x2f')]['key']};});_0xd63d3f[_0x2707('0x30')]=_[_0x2707('0x2c')](_0x5aaffb,_0x2707('0x2a'));_0xd63d3f[_0x2707('0x31')]=_[_0x2707('0x32')](_0x31e990[_0x2707('0x31')]);_0xd63d3f[_0x2707('0x33')]=_[_0x2707('0x34')](_0xd63d3f[_0x2707('0x30')],_0xd63d3f['query']);_0x4a99ce[_0x2707('0x35')]=_[_0x2707('0x34')](_0xd63d3f['model'],qs['fields'](_0x31e990['query']['fields']));_0x4a99ce['attributes']=_0x4a99ce[_0x2707('0x35')]['length']?_0x4a99ce['attributes']:_0xd63d3f[_0x2707('0x30')];if(!_0x31e990[_0x2707('0x31')]['hasOwnProperty'](_0x2707('0x36'))){_0x4a99ce[_0x2707('0x20')]=qs['limit'](_0x31e990['query'][_0x2707('0x20')]);_0x4a99ce[_0x2707('0x1e')]=qs['offset'](_0x31e990['query'][_0x2707('0x1e')]);}_0x4a99ce[_0x2707('0x37')]=qs['sort'](_0x31e990[_0x2707('0x31')][_0x2707('0x38')]);_0x4a99ce[_0x2707('0x39')]=qs[_0x2707('0x33')](_[_0x2707('0x3a')](_0x31e990[_0x2707('0x31')],_0xd63d3f['filters']),_0x5aaffb);if(_0x31e990[_0x2707('0x31')][_0x2707('0x3b')]){_0x4a99ce[_0x2707('0x39')]=_[_0x2707('0x3c')](_0x4a99ce[_0x2707('0x39')],{'$or':_[_0x2707('0x2c')](_0x5aaffb,function(_0x2700bf){if(_0x2700bf['type']!==_0x2707('0x3d')){var _0x2473e3={};_0x2473e3[_0x2700bf[_0x2707('0x2a')]]={'$like':'%'+_0x31e990[_0x2707('0x31')][_0x2707('0x3b')]+'%'};return _0x2473e3;}})});}_0x4a99ce=_[_0x2707('0x3c')]({},_0x4a99ce,_0x31e990[_0x2707('0x3e')]);var _0x39d9f6={'where':_0x4a99ce[_0x2707('0x39')]};return db[_0x2707('0x3f')][_0x2707('0x40')](_0x39d9f6)[_0x2707('0x26')](function(_0x2a221c){_0x497c92[_0x2707('0x40')]=_0x2a221c;if(_0x31e990[_0x2707('0x31')][_0x2707('0x41')]){_0x4a99ce['include']=[{'all':!![]}];}return db[_0x2707('0x3f')][_0x2707('0x42')](_0x4a99ce);})['then'](function(_0x358aa8){_0x497c92['rows']=_0x358aa8;return _0x497c92;})[_0x2707('0x26')](respondWithFilteredResult(_0x42adf8,_0x4a99ce))[_0x2707('0x43')](handleError(_0x42adf8,null));};exports[_0x2707('0x44')]=function(_0x1d69d3,_0x13e1c0){var _0xdeec24={'raw':![],'where':{'id':_0x1d69d3['params']['id']}},_0x26b464={};_0x26b464[_0x2707('0x30')]=_[_0x2707('0x32')](db['ZendeskAccount'][_0x2707('0x2d')]);_0x26b464[_0x2707('0x31')]=_[_0x2707('0x32')](_0x1d69d3['query']);_0x26b464['filters']=_[_0x2707('0x34')](_0x26b464[_0x2707('0x30')],_0x26b464['query']);_0xdeec24[_0x2707('0x35')]=_['intersection'](_0x26b464[_0x2707('0x30')],qs[_0x2707('0x45')](_0x1d69d3[_0x2707('0x31')][_0x2707('0x45')]));_0xdeec24['attributes']=_0xdeec24[_0x2707('0x35')][_0x2707('0x46')]?_0xdeec24[_0x2707('0x35')]:_0x26b464[_0x2707('0x30')];if(_0x1d69d3[_0x2707('0x31')][_0x2707('0x41')]){_0xdeec24[_0x2707('0x47')]=[{'all':!![]}];}_0xdeec24=_['merge']({},_0xdeec24,_0x1d69d3[_0x2707('0x3e')]);return db[_0x2707('0x3f')][_0x2707('0x48')](_0xdeec24)[_0x2707('0x26')](handleEntityNotFound(_0x13e1c0,null))[_0x2707('0x26')](respondWithResult(_0x13e1c0,null))['catch'](handleError(_0x13e1c0,null));};exports[_0x2707('0x49')]=function(_0x4a6eea,_0xf96f41){return db[_0x2707('0x3f')]['create'](_0x4a6eea[_0x2707('0x4a')],{})[_0x2707('0x26')](respondWithResult(_0xf96f41,0xc9))[_0x2707('0x43')](handleError(_0xf96f41,null));};exports['update']=function(_0x1a8034,_0x59c60f){if(_0x1a8034[_0x2707('0x4a')]['id']){delete _0x1a8034[_0x2707('0x4a')]['id'];}return db['ZendeskAccount'][_0x2707('0x48')]({'where':{'id':_0x1a8034[_0x2707('0x4b')]['id']}})[_0x2707('0x26')](handleEntityNotFound(_0x59c60f,null))['then'](saveUpdates(_0x1a8034['body'],null))[_0x2707('0x26')](respondWithResult(_0x59c60f,null))[_0x2707('0x43')](handleError(_0x59c60f,null));};exports[_0x2707('0x27')]=function(_0x2515dc,_0x463bf){return db['ZendeskAccount']['find']({'where':{'id':_0x2515dc['params']['id']}})[_0x2707('0x26')](handleEntityNotFound(_0x463bf,null))[_0x2707('0x26')](removeEntity(_0x463bf,null))[_0x2707('0x43')](handleError(_0x463bf,null));};exports[_0x2707('0x4c')]=function(_0x1ffcce,_0x5b622c,_0xa2c4c0){var _0x2df682={};var _0x5c99fd={};var _0x482ed1;var _0x3b41b2;return db[_0x2707('0x3f')][_0x2707('0x4d')]({'where':{'id':_0x1ffcce['params']['id']}})[_0x2707('0x26')](handleEntityNotFound(_0x5b622c,null))[_0x2707('0x26')](function(_0x2a2a71){if(_0x2a2a71){_0x482ed1=_0x2a2a71;_0x5c99fd[_0x2707('0x30')]=_['keys'](db[_0x2707('0x4e')][_0x2707('0x2d')]);_0x5c99fd[_0x2707('0x31')]=_[_0x2707('0x32')](_0x1ffcce[_0x2707('0x31')]);_0x5c99fd[_0x2707('0x33')]=_[_0x2707('0x34')](_0x5c99fd[_0x2707('0x30')],_0x5c99fd[_0x2707('0x31')]);_0x2df682[_0x2707('0x35')]=_['intersection'](_0x5c99fd[_0x2707('0x30')],qs['fields'](_0x1ffcce['query'][_0x2707('0x45')]));_0x2df682['attributes']=_0x2df682['attributes'][_0x2707('0x46')]?_0x2df682[_0x2707('0x35')]:_0x5c99fd[_0x2707('0x30')];_0x2df682[_0x2707('0x37')]=qs[_0x2707('0x38')](_0x1ffcce[_0x2707('0x31')][_0x2707('0x38')]);_0x2df682[_0x2707('0x39')]=qs[_0x2707('0x33')](_[_0x2707('0x3a')](_0x1ffcce[_0x2707('0x31')],_0x5c99fd['filters']));if(_0x1ffcce['query']['filter']){_0x2df682[_0x2707('0x39')]=_[_0x2707('0x3c')](_0x2df682[_0x2707('0x39')],{'$or':_['map'](_0x2df682['attributes'],function(_0x33ce37){var _0x39c9b4={};_0x39c9b4[_0x33ce37]={'$like':'%'+_0x1ffcce[_0x2707('0x31')][_0x2707('0x3b')]+'%'};return _0x39c9b4;})});}_0x2df682=_[_0x2707('0x3c')]({},_0x2df682,_0x1ffcce['options']);return _0x482ed1['getConfigurations'](_0x2df682);}})[_0x2707('0x26')](function(_0x6a3e8d){if(_0x6a3e8d){_0x3b41b2=_0x6a3e8d[_0x2707('0x46')];if(!_0x1ffcce[_0x2707('0x31')][_0x2707('0x4f')](_0x2707('0x36'))){_0x2df682[_0x2707('0x20')]=qs[_0x2707('0x20')](_0x1ffcce[_0x2707('0x31')]['limit']);_0x2df682[_0x2707('0x1e')]=qs[_0x2707('0x1e')](_0x1ffcce[_0x2707('0x31')][_0x2707('0x1e')]);}return _0x482ed1[_0x2707('0x4c')](_0x2df682);}})[_0x2707('0x26')](function(_0x519042){if(_0x519042){return _0x519042?{'count':_0x3b41b2,'rows':_0x519042}:null;}})['then'](respondWithResult(_0x5b622c,null))[_0x2707('0x43')](handleError(_0x5b622c,null));};exports[_0x2707('0x50')]=function(_0x4eb8eb,_0x58fefc,_0x4f14e0){if(_0x4eb8eb['body']['id']){delete _0x4eb8eb[_0x2707('0x4a')]['id'];}return db[_0x2707('0x3f')]['findOne']({'where':{'id':_0x4eb8eb[_0x2707('0x4b')]['id']}})[_0x2707('0x26')](handleEntityNotFound(_0x58fefc,null))[_0x2707('0x26')](function(_0x5bad5a){if(_0x5bad5a){_0x4eb8eb['body'][_0x2707('0x51')]=_0x5bad5a['id'];_0x4eb8eb[_0x2707('0x4a')][_0x2707('0x52')]=integrations[_0x2707('0x53')](_0x4eb8eb[_0x2707('0x4a')][_0x2707('0x54')],_0x4eb8eb[_0x2707('0x4a')]['type']);_0x4eb8eb[_0x2707('0x4a')][_0x2707('0x55')]=integrations[_0x2707('0x56')](_0x4eb8eb[_0x2707('0x4a')][_0x2707('0x54')],_0x4eb8eb[_0x2707('0x4a')]['type']);return db[_0x2707('0x4e')][_0x2707('0x49')](_0x4eb8eb[_0x2707('0x4a')],{'include':[{'model':db[_0x2707('0x57')],'as':_0x2707('0x52')},{'model':db[_0x2707('0x57')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x58fefc,null))[_0x2707('0x43')](handleError(_0x58fefc,null));};exports[_0x2707('0x58')]=function(_0x354322,_0x42da4e,_0x3ae5c6){var _0x2af149='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x354322[_0x2707('0x4b')]['id']},'attributes':['id','username',_0x2707('0x59'),_0x2707('0x5a'),_0x2707('0x5b'),_0x2707('0x5c')]})[_0x2707('0x26')](handleEntityNotFound(_0x42da4e,null))[_0x2707('0x26')](function(_0x5bb260){if(_0x5bb260){_0x2af149=_0x5bb260[_0x2707('0x5c')];var _0x4787d7=_0x2af149[_0x2707('0x5d')](-0x1);if(_0x4787d7==='/'){_0x2af149=_0x2af149[_0x2707('0x5e')](0x0,_0x2af149['lastIndexOf'](_0x4787d7));}var _0x155c4f={'method':_0x2707('0x5f'),'uri':util[_0x2707('0x60')](_0x2707('0x61'),_0x2af149,_0x2707('0x62')),'json':!![]};switch(_0x5bb260['authType']){case _0x2707('0x59'):_0x155c4f[_0x2707('0x63')]={'Authorization':util[_0x2707('0x60')](_0x2707('0x64'),new Buffer(util[_0x2707('0x60')](_0x2707('0x65'),_0x5bb260[_0x2707('0x66')],_0x5bb260[_0x2707('0x59')]))[_0x2707('0x67')](_0x2707('0x68')))};break;case _0x2707('0x5a'):_0x155c4f[_0x2707('0x63')]={'Authorization':util[_0x2707('0x60')](_0x2707('0x64'),new Buffer(util[_0x2707('0x60')](_0x2707('0x69'),_0x5bb260[_0x2707('0x66')],_0x5bb260[_0x2707('0x5a')]))['toString'](_0x2707('0x68')))};break;default:throw new db['Sequelize']['ValidationError'](_0x2707('0x6a'));}return rp(_0x155c4f);}})[_0x2707('0x26')](function(_0x35a62c){if(_0x35a62c){var _0x11ac13=[_0x2707('0x6b'),_0x2707('0x6c'),'group',_0x2707('0x6d')];_[_0x2707('0x6e')](_0x35a62c[_0x2707('0x62')],function(_0x54009a){return _0x11ac13[_0x2707('0x6f')](_0x54009a[_0x2707('0x2f')]);});return{'count':_0x35a62c[_0x2707('0x62')][_0x2707('0x46')],'rows':_['map'](_0x35a62c[_0x2707('0x62')],function(_0x5c68d6){return{'id':_0x5c68d6['id'],'name':_0x5c68d6[_0x2707('0x70')]>0x7?_0x5c68d6[_0x2707('0x71')]:_0x5c68d6[_0x2707('0x2f')],'custom':_0x5c68d6[_0x2707('0x70')]>0x7?!![]:![],'options':_0x5c68d6[_0x2707('0x72')]?_0x5c68d6[_0x2707('0x72')]:_0x5c68d6[_0x2707('0x73')]?_0x5c68d6[_0x2707('0x73')]:[]};})};}})[_0x2707('0x26')](respondWithResult(_0x42da4e,null))['catch'](function(_0x4530bc){var _0x5a1a24=_0x354322[_0x2707('0x31')][_0x2707('0x74')]?0x1f4:_0x4530bc[_0x2707('0x75')]||0x1f4;logger[_0x2707('0x28')](_0x2707('0x76'),_0x2707('0x58'),_0x5a1a24,JSON['stringify'](_0x4530bc));delete _0x4530bc['name'];if(_0x5a1a24===0x191){_0x5a1a24=0x190;}_0x42da4e[_0x2707('0x1b')](_0x5a1a24)['send'](_0x354322[_0x2707('0x31')][_0x2707('0x74')]?{'message':_0x2707('0x77'),'statusCode':_0x4530bc[_0x2707('0x75')]}:_0x4530bc);});}; \ No newline at end of file +var _0x69d3=['../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskAccount','includeAll','include','findAll','rows','show','keys','find','catch','create','update','body','params','getConfigurations','findOne','ZendeskConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','token','remoteUri','slice','lastIndexOf','format','ticket_fields','authType','password','Basic\x20%s','%s:%s','base64','headers','%s/token:%s','toString','Unknown\x20authentication\x20type','subject','description','assignee','remove','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service'];(function(_0x1d41a2,_0x33011b){var _0x241d1c=function(_0x1c8b0a){while(--_0x1c8b0a){_0x1d41a2['push'](_0x1d41a2['shift']());}};_0x241d1c(++_0x33011b);}(_0x69d3,0xda));var _0x369d=function(_0x23d5d6,_0x44824b){_0x23d5d6=_0x23d5d6-0x0;var _0x53aef8=_0x69d3[_0x23d5d6];return _0x53aef8;};'use strict';var emlformat=require(_0x369d('0x0'));var rimraf=require(_0x369d('0x1'));var zipdir=require(_0x369d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x369d('0x3'));var moment=require(_0x369d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x369d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x369d('0x6'));var ejs=require(_0x369d('0x7'));var fs=require('fs');var fs_extra=require(_0x369d('0x8'));var _=require(_0x369d('0x9'));var squel=require(_0x369d('0xa'));var crypto=require(_0x369d('0xb'));var jsforce=require(_0x369d('0xc'));var deskjs=require(_0x369d('0xd'));var toCsv=require(_0x369d('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x369d('0xe'));var authService=require(_0x369d('0xf'));var qs=require(_0x369d('0x10'));var as=require(_0x369d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x369d('0x12'));var utils=require(_0x369d('0x13'));var config=require(_0x369d('0x14'));var licenseUtil=require(_0x369d('0x15'));var db=require(_0x369d('0x16'))['db'];var integrations=require(_0x369d('0x17'));function respondWithStatusCode(_0x52c126,_0x15b417){_0x15b417=_0x15b417||0xcc;return function(_0x9d016){if(_0x9d016){return _0x52c126[_0x369d('0x18')](_0x15b417);}return _0x52c126[_0x369d('0x19')](_0x15b417)[_0x369d('0x1a')]();};}function respondWithResult(_0x539536,_0x5cd4c3){_0x5cd4c3=_0x5cd4c3||0xc8;return function(_0x5485a1){if(_0x5485a1){return _0x539536[_0x369d('0x19')](_0x5cd4c3)[_0x369d('0x1b')](_0x5485a1);}};}function respondWithFilteredResult(_0x389c43,_0x5b4f55){return function(_0x2c1a4a){if(_0x2c1a4a){var _0x29c1fe=typeof _0x5b4f55[_0x369d('0x1c')]==='undefined'&&typeof _0x5b4f55[_0x369d('0x1d')]===_0x369d('0x1e');var _0x4ea6c2=_0x2c1a4a['count'];var _0x597b67=_0x29c1fe?0x0:_0x5b4f55[_0x369d('0x1c')];var _0x4494b3=_0x29c1fe?_0x2c1a4a[_0x369d('0x1f')]:_0x5b4f55['offset']+_0x5b4f55[_0x369d('0x1d')];var _0x24dfff;if(_0x4494b3>=_0x4ea6c2){_0x4494b3=_0x4ea6c2;_0x24dfff=0xc8;}else{_0x24dfff=0xce;}_0x389c43[_0x369d('0x19')](_0x24dfff);return _0x389c43[_0x369d('0x20')](_0x369d('0x21'),_0x597b67+'-'+_0x4494b3+'/'+_0x4ea6c2)['json'](_0x2c1a4a);}return null;};}function patchUpdates(_0x5c9fdd){return function(_0x448e6e){try{jsonpatch[_0x369d('0x22')](_0x448e6e,_0x5c9fdd,!![]);}catch(_0x11ac1d){return BPromise[_0x369d('0x23')](_0x11ac1d);}return _0x448e6e[_0x369d('0x24')]();};}function saveUpdates(_0x15fbef,_0x1b262a){return function(_0x54a42e){if(_0x54a42e){return _0x54a42e['update'](_0x15fbef)[_0x369d('0x25')](function(_0xed16e){return _0xed16e;});}return null;};}function removeEntity(_0xf7bc3a,_0xcae58){return function(_0x30e7c5){if(_0x30e7c5){return _0x30e7c5[_0x369d('0x26')]()[_0x369d('0x25')](function(){_0xf7bc3a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16145e,_0x46de2b){return function(_0x15cd81){if(!_0x15cd81){_0x16145e[_0x369d('0x18')](0x194);}return _0x15cd81;};}function handleError(_0x8aa521,_0x41e0cf){_0x41e0cf=_0x41e0cf||0x1f4;return function(_0x8090b0){logger['error'](_0x8090b0[_0x369d('0x27')]);if(_0x8090b0[_0x369d('0x28')]){delete _0x8090b0[_0x369d('0x28')];}_0x8aa521[_0x369d('0x19')](_0x41e0cf)[_0x369d('0x29')](_0x8090b0);};}exports[_0x369d('0x2a')]=function(_0x3d1ce0,_0x4d42ea){var _0x157291={},_0x56efb1={},_0x57b94c={'count':0x0,'rows':[]};var _0x38feda=_[_0x369d('0x2b')](db['ZendeskAccount'][_0x369d('0x2c')],function(_0x5a14ce){return{'name':_0x5a14ce[_0x369d('0x2d')],'type':_0x5a14ce[_0x369d('0x2e')][_0x369d('0x2f')]};});_0x56efb1[_0x369d('0x30')]=_[_0x369d('0x2b')](_0x38feda,_0x369d('0x28'));_0x56efb1[_0x369d('0x31')]=_['keys'](_0x3d1ce0[_0x369d('0x31')]);_0x56efb1[_0x369d('0x32')]=_[_0x369d('0x33')](_0x56efb1[_0x369d('0x30')],_0x56efb1[_0x369d('0x31')]);_0x157291[_0x369d('0x34')]=_[_0x369d('0x33')](_0x56efb1[_0x369d('0x30')],qs['fields'](_0x3d1ce0[_0x369d('0x31')][_0x369d('0x35')]));_0x157291[_0x369d('0x34')]=_0x157291[_0x369d('0x34')][_0x369d('0x36')]?_0x157291['attributes']:_0x56efb1[_0x369d('0x30')];if(!_0x3d1ce0[_0x369d('0x31')][_0x369d('0x37')](_0x369d('0x38'))){_0x157291[_0x369d('0x1d')]=qs[_0x369d('0x1d')](_0x3d1ce0['query'][_0x369d('0x1d')]);_0x157291[_0x369d('0x1c')]=qs[_0x369d('0x1c')](_0x3d1ce0[_0x369d('0x31')][_0x369d('0x1c')]);}_0x157291[_0x369d('0x39')]=qs[_0x369d('0x3a')](_0x3d1ce0[_0x369d('0x31')][_0x369d('0x3a')]);_0x157291[_0x369d('0x3b')]=qs[_0x369d('0x32')](_[_0x369d('0x3c')](_0x3d1ce0[_0x369d('0x31')],_0x56efb1[_0x369d('0x32')]),_0x38feda);if(_0x3d1ce0[_0x369d('0x31')][_0x369d('0x3d')]){_0x157291[_0x369d('0x3b')]=_[_0x369d('0x3e')](_0x157291[_0x369d('0x3b')],{'$or':_[_0x369d('0x2b')](_0x38feda,function(_0x10c5b6){if(_0x10c5b6[_0x369d('0x2e')]!==_0x369d('0x3f')){var _0xd58366={};_0xd58366[_0x10c5b6['name']]={'$like':'%'+_0x3d1ce0['query'][_0x369d('0x3d')]+'%'};return _0xd58366;}})});}_0x157291=_[_0x369d('0x3e')]({},_0x157291,_0x3d1ce0[_0x369d('0x40')]);var _0x401bc7={'where':_0x157291[_0x369d('0x3b')]};return db[_0x369d('0x41')][_0x369d('0x1f')](_0x401bc7)[_0x369d('0x25')](function(_0x46c940){_0x57b94c['count']=_0x46c940;if(_0x3d1ce0[_0x369d('0x31')][_0x369d('0x42')]){_0x157291[_0x369d('0x43')]=[{'all':!![]}];}return db[_0x369d('0x41')][_0x369d('0x44')](_0x157291);})[_0x369d('0x25')](function(_0x28803c){_0x57b94c[_0x369d('0x45')]=_0x28803c;return _0x57b94c;})['then'](respondWithFilteredResult(_0x4d42ea,_0x157291))['catch'](handleError(_0x4d42ea,null));};exports[_0x369d('0x46')]=function(_0x3222ce,_0x30909a){var _0x4dad71={'raw':![],'where':{'id':_0x3222ce['params']['id']}},_0x4d07ac={};_0x4d07ac[_0x369d('0x30')]=_[_0x369d('0x47')](db['ZendeskAccount'][_0x369d('0x2c')]);_0x4d07ac[_0x369d('0x31')]=_[_0x369d('0x47')](_0x3222ce[_0x369d('0x31')]);_0x4d07ac['filters']=_[_0x369d('0x33')](_0x4d07ac['model'],_0x4d07ac[_0x369d('0x31')]);_0x4dad71['attributes']=_[_0x369d('0x33')](_0x4d07ac[_0x369d('0x30')],qs[_0x369d('0x35')](_0x3222ce['query']['fields']));_0x4dad71[_0x369d('0x34')]=_0x4dad71[_0x369d('0x34')][_0x369d('0x36')]?_0x4dad71['attributes']:_0x4d07ac[_0x369d('0x30')];if(_0x3222ce[_0x369d('0x31')][_0x369d('0x42')]){_0x4dad71[_0x369d('0x43')]=[{'all':!![]}];}_0x4dad71=_[_0x369d('0x3e')]({},_0x4dad71,_0x3222ce[_0x369d('0x40')]);return db[_0x369d('0x41')][_0x369d('0x48')](_0x4dad71)[_0x369d('0x25')](handleEntityNotFound(_0x30909a,null))['then'](respondWithResult(_0x30909a,null))[_0x369d('0x49')](handleError(_0x30909a,null));};exports[_0x369d('0x4a')]=function(_0xcc1465,_0x257c3d){return db[_0x369d('0x41')][_0x369d('0x4a')](_0xcc1465['body'],{})[_0x369d('0x25')](respondWithResult(_0x257c3d,0xc9))[_0x369d('0x49')](handleError(_0x257c3d,null));};exports[_0x369d('0x4b')]=function(_0x44a357,_0x1b04d9){if(_0x44a357[_0x369d('0x4c')]['id']){delete _0x44a357[_0x369d('0x4c')]['id'];}return db[_0x369d('0x41')][_0x369d('0x48')]({'where':{'id':_0x44a357[_0x369d('0x4d')]['id']}})[_0x369d('0x25')](handleEntityNotFound(_0x1b04d9,null))[_0x369d('0x25')](saveUpdates(_0x44a357['body'],null))[_0x369d('0x25')](respondWithResult(_0x1b04d9,null))[_0x369d('0x49')](handleError(_0x1b04d9,null));};exports[_0x369d('0x26')]=function(_0x85edd6,_0x648a0d){return db['ZendeskAccount'][_0x369d('0x48')]({'where':{'id':_0x85edd6['params']['id']}})[_0x369d('0x25')](handleEntityNotFound(_0x648a0d,null))[_0x369d('0x25')](removeEntity(_0x648a0d,null))[_0x369d('0x49')](handleError(_0x648a0d,null));};exports[_0x369d('0x4e')]=function(_0x46c62c,_0x1bd31c,_0x22e2d4){var _0x418cab={};var _0x1cdeca={};var _0x9f1544;var _0x4d582a;return db['ZendeskAccount'][_0x369d('0x4f')]({'where':{'id':_0x46c62c[_0x369d('0x4d')]['id']}})[_0x369d('0x25')](handleEntityNotFound(_0x1bd31c,null))[_0x369d('0x25')](function(_0x347df4){if(_0x347df4){_0x9f1544=_0x347df4;_0x1cdeca['model']=_['keys'](db[_0x369d('0x50')][_0x369d('0x2c')]);_0x1cdeca['query']=_[_0x369d('0x47')](_0x46c62c['query']);_0x1cdeca[_0x369d('0x32')]=_[_0x369d('0x33')](_0x1cdeca[_0x369d('0x30')],_0x1cdeca['query']);_0x418cab[_0x369d('0x34')]=_[_0x369d('0x33')](_0x1cdeca[_0x369d('0x30')],qs[_0x369d('0x35')](_0x46c62c['query']['fields']));_0x418cab[_0x369d('0x34')]=_0x418cab[_0x369d('0x34')][_0x369d('0x36')]?_0x418cab['attributes']:_0x1cdeca[_0x369d('0x30')];_0x418cab[_0x369d('0x39')]=qs[_0x369d('0x3a')](_0x46c62c['query']['sort']);_0x418cab[_0x369d('0x3b')]=qs[_0x369d('0x32')](_[_0x369d('0x3c')](_0x46c62c[_0x369d('0x31')],_0x1cdeca['filters']));if(_0x46c62c[_0x369d('0x31')][_0x369d('0x3d')]){_0x418cab[_0x369d('0x3b')]=_[_0x369d('0x3e')](_0x418cab[_0x369d('0x3b')],{'$or':_['map'](_0x418cab[_0x369d('0x34')],function(_0x304a9e){var _0x28b752={};_0x28b752[_0x304a9e]={'$like':'%'+_0x46c62c['query'][_0x369d('0x3d')]+'%'};return _0x28b752;})});}_0x418cab=_['merge']({},_0x418cab,_0x46c62c[_0x369d('0x40')]);return _0x9f1544['getConfigurations'](_0x418cab);}})['then'](function(_0x5f440e){if(_0x5f440e){_0x4d582a=_0x5f440e['length'];if(!_0x46c62c[_0x369d('0x31')]['hasOwnProperty'](_0x369d('0x38'))){_0x418cab['limit']=qs[_0x369d('0x1d')](_0x46c62c[_0x369d('0x31')][_0x369d('0x1d')]);_0x418cab['offset']=qs[_0x369d('0x1c')](_0x46c62c[_0x369d('0x31')][_0x369d('0x1c')]);}return _0x9f1544[_0x369d('0x4e')](_0x418cab);}})[_0x369d('0x25')](function(_0xe63e0f){if(_0xe63e0f){return _0xe63e0f?{'count':_0x4d582a,'rows':_0xe63e0f}:null;}})['then'](respondWithResult(_0x1bd31c,null))[_0x369d('0x49')](handleError(_0x1bd31c,null));};exports['addConfiguration']=function(_0x5706be,_0x56c98e,_0x36e990){if(_0x5706be[_0x369d('0x4c')]['id']){delete _0x5706be[_0x369d('0x4c')]['id'];}return db[_0x369d('0x41')][_0x369d('0x4f')]({'where':{'id':_0x5706be[_0x369d('0x4d')]['id']}})[_0x369d('0x25')](handleEntityNotFound(_0x56c98e,null))[_0x369d('0x25')](function(_0x1c9683){if(_0x1c9683){_0x5706be[_0x369d('0x4c')][_0x369d('0x51')]=_0x1c9683['id'];_0x5706be[_0x369d('0x4c')][_0x369d('0x52')]=integrations[_0x369d('0x53')](_0x5706be[_0x369d('0x4c')][_0x369d('0x54')],_0x5706be['body'][_0x369d('0x2e')]);_0x5706be['body'][_0x369d('0x55')]=integrations[_0x369d('0x56')](_0x5706be[_0x369d('0x4c')][_0x369d('0x54')],_0x5706be[_0x369d('0x4c')]['type']);return db[_0x369d('0x50')]['create'](_0x5706be['body'],{'include':[{'model':db[_0x369d('0x57')],'as':_0x369d('0x52')},{'model':db[_0x369d('0x57')],'as':_0x369d('0x55')}]});}return null;})[_0x369d('0x25')](respondWithResult(_0x56c98e,null))[_0x369d('0x49')](handleError(_0x56c98e,null));};exports[_0x369d('0x58')]=function(_0x11ac7d,_0x55a811,_0x461782){var _0x24e70d='';return db['ZendeskAccount'][_0x369d('0x4f')]({'where':{'id':_0x11ac7d[_0x369d('0x4d')]['id']},'attributes':['id',_0x369d('0x59'),'password',_0x369d('0x5a'),'authType',_0x369d('0x5b')]})[_0x369d('0x25')](handleEntityNotFound(_0x55a811,null))[_0x369d('0x25')](function(_0x369199){if(_0x369199){_0x24e70d=_0x369199[_0x369d('0x5b')];var _0x1a9a01=_0x24e70d[_0x369d('0x5c')](-0x1);if(_0x1a9a01==='/'){_0x24e70d=_0x24e70d['substring'](0x0,_0x24e70d[_0x369d('0x5d')](_0x1a9a01));}var _0x7e8d08={'method':'GET','uri':util[_0x369d('0x5e')]('%s/%s',_0x24e70d,_0x369d('0x5f')),'json':!![]};switch(_0x369199[_0x369d('0x60')]){case _0x369d('0x61'):_0x7e8d08['headers']={'Authorization':util[_0x369d('0x5e')](_0x369d('0x62'),new Buffer(util['format'](_0x369d('0x63'),_0x369199[_0x369d('0x59')],_0x369199[_0x369d('0x61')]))['toString'](_0x369d('0x64')))};break;case _0x369d('0x5a'):_0x7e8d08[_0x369d('0x65')]={'Authorization':util[_0x369d('0x5e')](_0x369d('0x62'),new Buffer(util['format'](_0x369d('0x66'),_0x369199[_0x369d('0x59')],_0x369199[_0x369d('0x5a')]))[_0x369d('0x67')](_0x369d('0x64')))};break;default:throw new db['Sequelize']['ValidationError'](_0x369d('0x68'));}return rp(_0x7e8d08);}})[_0x369d('0x25')](function(_0x2307fc){if(_0x2307fc){var _0x11b348=[_0x369d('0x69'),_0x369d('0x6a'),'group',_0x369d('0x6b')];_[_0x369d('0x6c')](_0x2307fc['ticket_fields'],function(_0x6c8235){return _0x11b348['includes'](_0x6c8235[_0x369d('0x2e')]);});return{'count':_0x2307fc['ticket_fields'][_0x369d('0x36')],'rows':_[_0x369d('0x2b')](_0x2307fc['ticket_fields'],function(_0x4148a9){return{'id':_0x4148a9['id'],'name':_0x4148a9['position']>0x7?_0x4148a9[_0x369d('0x6d')]:_0x4148a9['type'],'custom':_0x4148a9['position']>0x7?!![]:![],'options':_0x4148a9[_0x369d('0x6e')]?_0x4148a9[_0x369d('0x6e')]:_0x4148a9[_0x369d('0x6f')]?_0x4148a9[_0x369d('0x6f')]:[]};})};}})[_0x369d('0x25')](respondWithResult(_0x55a811,null))['catch'](function(_0x28ec32){var _0xaff7cc=_0x11ac7d[_0x369d('0x31')][_0x369d('0x70')]?0x1f4:_0x28ec32[_0x369d('0x71')]||0x1f4;logger[_0x369d('0x72')](_0x369d('0x73'),_0x369d('0x58'),_0xaff7cc,JSON[_0x369d('0x74')](_0x28ec32));delete _0x28ec32['name'];if(_0xaff7cc===0x191){_0xaff7cc=0x190;}_0x55a811[_0x369d('0x19')](_0xaff7cc)[_0x369d('0x29')](_0x11ac7d[_0x369d('0x31')][_0x369d('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x28ec32[_0x369d('0x71')]}:_0x28ec32);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 55c1ac1..42c0c33 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 _0x5808=['exports','ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','api','moment','bluebird','path','./intZendeskAccount.attributes','../../components/integrations/configuration'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5808,0x137));var _0x8580=function(_0x237da8,_0x37b77a){_0x237da8=_0x237da8-0x0;var _0x558825=_0x5808[_0x237da8];return _0x558825;};'use strict';var _=require(_0x8580('0x0'));var util=require('util');var logger=require(_0x8580('0x1'))(_0x8580('0x2'));var moment=require(_0x8580('0x3'));var BPromise=require(_0x8580('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8580('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8580('0x6'));var integrations=require(_0x8580('0x7'));module[_0x8580('0x8')]=function(_0x5eaa66,_0x211855){return _0x5eaa66['define'](_0x8580('0x9'),attributes,{'tableName':_0x8580('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed2a=['../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes'];(function(_0x36f931,_0x5f2a5f){var _0x3073fe=function(_0x143dd7){while(--_0x143dd7){_0x36f931['push'](_0x36f931['shift']());}};_0x3073fe(++_0x5f2a5f);}(_0xed2a,0xe9));var _0xaed2=function(_0x342070,_0x5e04ed){_0x342070=_0x342070-0x0;var _0x1f6b1f=_0xed2a[_0x342070];return _0x1f6b1f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xaed2('0x0'));var moment=require('moment');var BPromise=require(_0xaed2('0x1'));var rp=require(_0xaed2('0x2'));var fs=require('fs');var path=require(_0xaed2('0x3'));var rimraf=require(_0xaed2('0x4'));var config=require(_0xaed2('0x5'));var attributes=require(_0xaed2('0x6'));var integrations=require(_0xaed2('0x7'));module[_0xaed2('0x8')]=function(_0x1c1831,_0x4174ca){return _0x1c1831[_0xaed2('0x9')](_0xaed2('0xa'),attributes,{'tableName':_0xaed2('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 b5effa5..bb53350 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 _0xe730=['find','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowZendeskAccount'];(function(_0x15c0f8,_0x4df077){var _0x203883=function(_0x1cc68b){while(--_0x1cc68b){_0x15c0f8['push'](_0x15c0f8['shift']());}};_0x203883(++_0x4df077);}(_0xe730,0xb5));var _0x0e73=function(_0x2faf21,_0x319288){_0x2faf21=_0x2faf21-0x0;var _0x1ff184=_0xe730[_0x2faf21];return _0x1ff184;};'use strict';var _=require(_0x0e73('0x0'));var util=require(_0x0e73('0x1'));var moment=require(_0x0e73('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e73('0x3'))['db'];var utils=require(_0x0e73('0x4'));var logger=require(_0x0e73('0x5'))(_0x0e73('0x6'));var config=require(_0x0e73('0x7'));var jayson=require(_0x0e73('0x8'));var client=jayson[_0x0e73('0x9')][_0x0e73('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb96e20,_0x429025,_0x470e15){return new BPromise(function(_0x538ccf,_0x4633e6){return client['request'](_0xb96e20,_0x470e15)['then'](function(_0x5786b9){logger[_0x0e73('0xb')](_0x0e73('0xc'),_0x429025,_0x0e73('0xd'));logger[_0x0e73('0xe')](_0x0e73('0xf'),_0x429025,_0x0e73('0xd'),JSON[_0x0e73('0x10')](_0x5786b9));if(_0x5786b9[_0x0e73('0x11')]){if(_0x5786b9['error'][_0x0e73('0x12')]===0x1f4){logger[_0x0e73('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x429025,_0x5786b9[_0x0e73('0x11')][_0x0e73('0x13')]);return _0x4633e6(_0x5786b9[_0x0e73('0x11')][_0x0e73('0x13')]);}logger[_0x0e73('0x11')](_0x0e73('0xc'),_0x429025,_0x5786b9[_0x0e73('0x11')]['message']);return _0x538ccf(_0x5786b9[_0x0e73('0x11')][_0x0e73('0x13')]);}else{logger['info'](_0x0e73('0xc'),_0x429025,_0x0e73('0xd'));_0x538ccf(_0x5786b9[_0x0e73('0x14')][_0x0e73('0x13')]);}})[_0x0e73('0x15')](function(_0x30db69){logger['error'](_0x0e73('0xc'),_0x429025,_0x30db69);_0x4633e6(_0x30db69);});});}exports[_0x0e73('0x16')]=function(_0x84a399){var _0x56b403=this;return new Promise(function(_0x424867,_0x2b5f09){return db[_0x0e73('0x17')][_0x0e73('0x18')]({'raw':_0x84a399[_0x0e73('0x19')]?_0x84a399[_0x0e73('0x19')][_0x0e73('0x1a')]===undefined?!![]:![]:!![],'where':_0x84a399[_0x0e73('0x19')]?_0x84a399[_0x0e73('0x19')][_0x0e73('0x1b')]||null:null,'attributes':_0x84a399[_0x0e73('0x19')]?_0x84a399[_0x0e73('0x19')][_0x0e73('0x1c')]||null:null,'limit':_0x84a399['options']?_0x84a399[_0x0e73('0x19')][_0x0e73('0x1d')]||null:null,'include':_0x84a399[_0x0e73('0x19')]?_0x84a399[_0x0e73('0x19')][_0x0e73('0x1e')]?_[_0x0e73('0x1f')](_0x84a399[_0x0e73('0x19')]['include'],function(_0x57ee1e){return{'model':db[_0x57ee1e[_0x0e73('0x20')]],'as':_0x57ee1e['as'],'attributes':_0x57ee1e['attributes'],'include':_0x57ee1e['include']?_[_0x0e73('0x1f')](_0x57ee1e[_0x0e73('0x1e')],function(_0x2d6316){return{'model':db[_0x2d6316[_0x0e73('0x20')]],'as':_0x2d6316['as'],'attributes':_0x2d6316[_0x0e73('0x1c')],'include':_0x2d6316[_0x0e73('0x1e')]?_[_0x0e73('0x1f')](_0x2d6316['include'],function(_0x319b89){return{'model':db[_0x319b89[_0x0e73('0x20')]],'as':_0x319b89['as'],'attributes':_0x319b89[_0x0e73('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0e73('0x21')](function(_0x12683a){logger['info'](_0x0e73('0x16'),_0x84a399);logger['debug'](_0x0e73('0x16'),_0x84a399,JSON['stringify'](_0x12683a));_0x424867(_0x12683a);})['catch'](function(_0x1057a6){logger[_0x0e73('0x11')](_0x0e73('0x16'),_0x1057a6[_0x0e73('0x13')],_0x84a399);_0x2b5f09(_0x56b403[_0x0e73('0x11')](0x1f4,_0x1057a6[_0x0e73('0x13')]));});});};exports[_0x0e73('0x22')]=function(_0x53620e){var _0xb147c7=this;return new Promise(function(_0xf72e9b,_0x12445e){return db[_0x0e73('0x17')][_0x0e73('0x23')]({'raw':_0x53620e[_0x0e73('0x19')]?_0x53620e['options']['raw']===undefined?!![]:![]:!![],'where':_0x53620e[_0x0e73('0x19')]?_0x53620e['options'][_0x0e73('0x1b')]||null:null,'attributes':_0x53620e['options']?_0x53620e['options'][_0x0e73('0x1c')]||null:null,'include':_0x53620e[_0x0e73('0x19')]?_0x53620e[_0x0e73('0x19')][_0x0e73('0x1e')]?_[_0x0e73('0x1f')](_0x53620e[_0x0e73('0x19')][_0x0e73('0x1e')],function(_0x24f253){return{'model':db[_0x24f253[_0x0e73('0x20')]],'as':_0x24f253['as'],'attributes':_0x24f253[_0x0e73('0x1c')],'include':_0x24f253[_0x0e73('0x1e')]?_[_0x0e73('0x1f')](_0x24f253[_0x0e73('0x1e')],function(_0xbe407b){return{'model':db[_0xbe407b[_0x0e73('0x20')]],'as':_0xbe407b['as'],'attributes':_0xbe407b[_0x0e73('0x1c')],'include':_0xbe407b[_0x0e73('0x1e')]?_[_0x0e73('0x1f')](_0xbe407b['include'],function(_0x4ea316){return{'model':db[_0x4ea316[_0x0e73('0x20')]],'as':_0x4ea316['as'],'attributes':_0x4ea316[_0x0e73('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0e73('0x21')](function(_0x1a0009){logger['info'](_0x0e73('0x22'),_0x53620e);logger['debug'](_0x0e73('0x22'),_0x53620e,JSON[_0x0e73('0x10')](_0x1a0009));_0xf72e9b(_0x1a0009);})['catch'](function(_0x11fbfe){logger[_0x0e73('0x11')](_0x0e73('0x22'),_0x11fbfe[_0x0e73('0x13')],_0x53620e);_0x12445e(_0xb147c7[_0x0e73('0x11')](0x1f4,_0x11fbfe['message']));});});}; \ No newline at end of file +var _0x9cb3=['result','GetZendeskAccount','options','raw','include','map','model','attributes','ZendeskAccount','find','where','ShowZendeskAccount','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent'];(function(_0x2fe432,_0x40ee63){var _0x231627=function(_0x123b40){while(--_0x123b40){_0x2fe432['push'](_0x2fe432['shift']());}};_0x231627(++_0x40ee63);}(_0x9cb3,0x13f));var _0x39cb=function(_0x402565,_0x431efa){_0x402565=_0x402565-0x0;var _0x2ed987=_0x9cb3[_0x402565];return _0x2ed987;};'use strict';var _=require('lodash');var util=require(_0x39cb('0x0'));var moment=require(_0x39cb('0x1'));var BPromise=require(_0x39cb('0x2'));var rs=require(_0x39cb('0x3'));var fs=require('fs');var Redis=require(_0x39cb('0x4'));var db=require(_0x39cb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x39cb('0x6'));var config=require(_0x39cb('0x7'));var jayson=require(_0x39cb('0x8'));var client=jayson[_0x39cb('0x9')][_0x39cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29285c,_0x25ed5c,_0x448d3b){return new BPromise(function(_0x41953,_0x195e81){return client[_0x39cb('0xb')](_0x29285c,_0x448d3b)[_0x39cb('0xc')](function(_0x274c06){logger[_0x39cb('0xd')](_0x39cb('0xe'),_0x25ed5c,'request\x20sent');logger[_0x39cb('0xf')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x25ed5c,'request\x20sent',JSON[_0x39cb('0x10')](_0x274c06));if(_0x274c06[_0x39cb('0x11')]){if(_0x274c06[_0x39cb('0x11')][_0x39cb('0x12')]===0x1f4){logger['error'](_0x39cb('0xe'),_0x25ed5c,_0x274c06[_0x39cb('0x11')]['message']);return _0x195e81(_0x274c06['error'][_0x39cb('0x13')]);}logger[_0x39cb('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x25ed5c,_0x274c06[_0x39cb('0x11')]['message']);return _0x41953(_0x274c06['error']['message']);}else{logger['info'](_0x39cb('0xe'),_0x25ed5c,_0x39cb('0x14'));_0x41953(_0x274c06[_0x39cb('0x15')][_0x39cb('0x13')]);}})['catch'](function(_0x23c0f2){logger[_0x39cb('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x25ed5c,_0x23c0f2);_0x195e81(_0x23c0f2);});});}exports[_0x39cb('0x16')]=function(_0x5aaf16){var _0x35e650=this;return new Promise(function(_0x39cf46,_0x48aaa2){return db['ZendeskAccount']['findAll']({'raw':_0x5aaf16[_0x39cb('0x17')]?_0x5aaf16['options'][_0x39cb('0x18')]===undefined?!![]:![]:!![],'where':_0x5aaf16[_0x39cb('0x17')]?_0x5aaf16['options']['where']||null:null,'attributes':_0x5aaf16[_0x39cb('0x17')]?_0x5aaf16[_0x39cb('0x17')]['attributes']||null:null,'limit':_0x5aaf16[_0x39cb('0x17')]?_0x5aaf16[_0x39cb('0x17')]['limit']||null:null,'include':_0x5aaf16[_0x39cb('0x17')]?_0x5aaf16[_0x39cb('0x17')][_0x39cb('0x19')]?_[_0x39cb('0x1a')](_0x5aaf16[_0x39cb('0x17')][_0x39cb('0x19')],function(_0x50233c){return{'model':db[_0x50233c[_0x39cb('0x1b')]],'as':_0x50233c['as'],'attributes':_0x50233c[_0x39cb('0x1c')],'include':_0x50233c[_0x39cb('0x19')]?_['map'](_0x50233c['include'],function(_0x30aae6){return{'model':db[_0x30aae6[_0x39cb('0x1b')]],'as':_0x30aae6['as'],'attributes':_0x30aae6['attributes'],'include':_0x30aae6[_0x39cb('0x19')]?_[_0x39cb('0x1a')](_0x30aae6[_0x39cb('0x19')],function(_0x56ffeb){return{'model':db[_0x56ffeb['model']],'as':_0x56ffeb['as'],'attributes':_0x56ffeb[_0x39cb('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x142542){logger['info'](_0x39cb('0x16'),_0x5aaf16);logger[_0x39cb('0xf')](_0x39cb('0x16'),_0x5aaf16,JSON[_0x39cb('0x10')](_0x142542));_0x39cf46(_0x142542);})['catch'](function(_0xea89b9){logger['error']('GetZendeskAccount',_0xea89b9[_0x39cb('0x13')],_0x5aaf16);_0x48aaa2(_0x35e650['error'](0x1f4,_0xea89b9[_0x39cb('0x13')]));});});};exports['ShowZendeskAccount']=function(_0x2157c4){var _0x4aa421=this;return new Promise(function(_0x19fe35,_0x313078){return db[_0x39cb('0x1d')][_0x39cb('0x1e')]({'raw':_0x2157c4[_0x39cb('0x17')]?_0x2157c4[_0x39cb('0x17')][_0x39cb('0x18')]===undefined?!![]:![]:!![],'where':_0x2157c4[_0x39cb('0x17')]?_0x2157c4[_0x39cb('0x17')][_0x39cb('0x1f')]||null:null,'attributes':_0x2157c4[_0x39cb('0x17')]?_0x2157c4[_0x39cb('0x17')]['attributes']||null:null,'include':_0x2157c4[_0x39cb('0x17')]?_0x2157c4['options']['include']?_[_0x39cb('0x1a')](_0x2157c4[_0x39cb('0x17')][_0x39cb('0x19')],function(_0x128757){return{'model':db[_0x128757['model']],'as':_0x128757['as'],'attributes':_0x128757[_0x39cb('0x1c')],'include':_0x128757[_0x39cb('0x19')]?_[_0x39cb('0x1a')](_0x128757[_0x39cb('0x19')],function(_0x549e6f){return{'model':db[_0x549e6f['model']],'as':_0x549e6f['as'],'attributes':_0x549e6f[_0x39cb('0x1c')],'include':_0x549e6f[_0x39cb('0x19')]?_[_0x39cb('0x1a')](_0x549e6f['include'],function(_0x1af734){return{'model':db[_0x1af734['model']],'as':_0x1af734['as'],'attributes':_0x1af734[_0x39cb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x39cb('0xc')](function(_0x1bec2a){logger[_0x39cb('0xd')](_0x39cb('0x20'),_0x2157c4);logger['debug']('ShowZendeskAccount',_0x2157c4,JSON[_0x39cb('0x10')](_0x1bec2a));_0x19fe35(_0x1bec2a);})[_0x39cb('0x21')](function(_0x2348b0){logger[_0x39cb('0x11')]('ShowZendeskAccount',_0x2348b0['message'],_0x2157c4);_0x313078(_0x4aa421[_0x39cb('0x11')](0x1f4,_0x2348b0[_0x39cb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index e0477d0..6fee046 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 _0x36ee=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','update','delete','destroy','exports','path','express'];(function(_0x349367,_0x1cede2){var _0x14179b=function(_0x38a191){while(--_0x38a191){_0x349367['push'](_0x349367['shift']());}};_0x14179b(++_0x1cede2);}(_0x36ee,0xe8));var _0xe36e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x36ee[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var fs_extra=require(_0xe36e('0x3'));var auth=require(_0xe36e('0x4'));var interaction=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var controller=require(_0xe36e('0x7'));router[_0xe36e('0x8')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0x8')](_0xe36e('0xb'),auth['isAuthenticated'](),controller[_0xe36e('0xc')]);router['get'](_0xe36e('0xd'),auth[_0xe36e('0x9')](),controller[_0xe36e('0xe')]);router['get'](_0xe36e('0xf'),auth['isAuthenticated'](),controller[_0xe36e('0x10')]);router[_0xe36e('0x8')](_0xe36e('0x11'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x12')]);router[_0xe36e('0x8')](_0xe36e('0x13'),auth[_0xe36e('0x9')](),controller['getTags']);router[_0xe36e('0x14')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0x15')]);router[_0xe36e('0x14')]('/:id/tags',auth[_0xe36e('0x9')](),controller['setTags']);router['put'](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x16')]);router[_0xe36e('0x17')](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x18')]);module[_0xe36e('0x19')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','post','create','setTags','put','/:id','delete','destroy','exports','multer','util'];(function(_0x42ca15,_0x193ccb){var _0x1c6ded=function(_0x40989a){while(--_0x40989a){_0x42ca15['push'](_0x42ca15['shift']());}};_0x1c6ded(++_0x193ccb);}(_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('./intZendeskConfiguration.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x9')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x9')]('/:id/descriptions',auth[_0x0d8b('0x7')](),controller['getDescriptions']);router[_0x0d8b('0x9')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0x11')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller['update']);router[_0x0d8b('0x16')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x17')]);module[_0x0d8b('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index dce1c75..2154d99 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 _0x1287=['STRING','sequelize'];(function(_0x6d2237,_0x59a621){var _0x336726=function(_0x21141f){while(--_0x21141f){_0x6d2237['push'](_0x6d2237['shift']());}};_0x336726(++_0x59a621);}(_0x1287,0x1a1));var _0x7128=function(_0x11f210,_0x294592){_0x11f210=_0x11f210-0x0;var _0x4d726f=_0x1287[_0x11f210];return _0x4d726f;};'use strict';var Sequelize=require(_0x7128('0x0'));module['exports']={'name':{'type':Sequelize[_0x7128('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2973=['STRING','exports'];(function(_0x528a18,_0x5eb85e){var _0x5543a5=function(_0x45e64a){while(--_0x45e64a){_0x528a18['push'](_0x528a18['shift']());}};_0x5543a5(++_0x5eb85e);}(_0x2973,0x191));var _0x3297=function(_0x57d3d9,_0x2d605b){_0x57d3d9=_0x57d3d9-0x0;var _0x46730c=_0x2973[_0x57d3d9];return _0x46730c;};'use strict';var Sequelize=require('sequelize');module[_0x3297('0x0')]={'name':{'type':Sequelize[_0x3297('0x1')]},'description':{'type':Sequelize[_0x3297('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 49dc8b5..f31966e 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 _0xdf3c=['getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','reject','update','then','error','stack','name','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','destroy','getFields','findOne','ZendeskField','getSubjects','getDescriptions'];(function(_0x399333,_0xbcfa38){var _0x8733a=function(_0x509d14){while(--_0x509d14){_0x399333['push'](_0x399333['shift']());}};_0x8733a(++_0xbcfa38);}(_0xdf3c,0x14f));var _0xcdf3=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xdf3c[_0x1b2ff7];return _0x31656a;};'use strict';var emlformat=require(_0xcdf3('0x0'));var rimraf=require(_0xcdf3('0x1'));var zipdir=require(_0xcdf3('0x2'));var jsonpatch=require(_0xcdf3('0x3'));var rp=require(_0xcdf3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcdf3('0x5'));var util=require(_0xcdf3('0x6'));var path=require(_0xcdf3('0x7'));var sox=require(_0xcdf3('0x8'));var csv=require(_0xcdf3('0x9'));var ejs=require(_0xcdf3('0xa'));var fs=require('fs');var fs_extra=require(_0xcdf3('0xb'));var _=require(_0xcdf3('0xc'));var squel=require(_0xcdf3('0xd'));var crypto=require(_0xcdf3('0xe'));var jsforce=require(_0xcdf3('0xf'));var deskjs=require(_0xcdf3('0x10'));var toCsv=require(_0xcdf3('0x9'));var querystring=require(_0xcdf3('0x11'));var Papa=require(_0xcdf3('0x12'));var Redis=require(_0xcdf3('0x13'));var authService=require(_0xcdf3('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcdf3('0x15'));var hardwareService=require(_0xcdf3('0x16'));var logger=require(_0xcdf3('0x17'))(_0xcdf3('0x18'));var utils=require('../../config/utils');var config=require(_0xcdf3('0x19'));var licenseUtil=require(_0xcdf3('0x1a'));var db=require(_0xcdf3('0x1b'))['db'];function respondWithStatusCode(_0x2362e3,_0xe67c25){_0xe67c25=_0xe67c25||0xcc;return function(_0x19f1ae){if(_0x19f1ae){return _0x2362e3['sendStatus'](_0xe67c25);}return _0x2362e3[_0xcdf3('0x1c')](_0xe67c25)[_0xcdf3('0x1d')]();};}function respondWithResult(_0xea3a51,_0x4eaa54){_0x4eaa54=_0x4eaa54||0xc8;return function(_0x26a1fc){if(_0x26a1fc){return _0xea3a51['status'](_0x4eaa54)['json'](_0x26a1fc);}};}function respondWithFilteredResult(_0x2e1270,_0x300715){return function(_0x49dd25){if(_0x49dd25){var _0x468be6=typeof _0x300715[_0xcdf3('0x1e')]===_0xcdf3('0x1f')&&typeof _0x300715[_0xcdf3('0x20')]===_0xcdf3('0x1f');var _0x3e275e=_0x49dd25['count'];var _0xd00b47=_0x468be6?0x0:_0x300715[_0xcdf3('0x1e')];var _0x531747=_0x468be6?_0x49dd25[_0xcdf3('0x21')]:_0x300715[_0xcdf3('0x1e')]+_0x300715[_0xcdf3('0x20')];var _0x5ef81d;if(_0x531747>=_0x3e275e){_0x531747=_0x3e275e;_0x5ef81d=0xc8;}else{_0x5ef81d=0xce;}_0x2e1270['status'](_0x5ef81d);return _0x2e1270[_0xcdf3('0x22')]('Content-Range',_0xd00b47+'-'+_0x531747+'/'+_0x3e275e)['json'](_0x49dd25);}return null;};}function patchUpdates(_0x42184a){return function(_0x54611a){try{jsonpatch['apply'](_0x54611a,_0x42184a,!![]);}catch(_0x2bbec5){return BPromise[_0xcdf3('0x23')](_0x2bbec5);}return _0x54611a['save']();};}function saveUpdates(_0x3c3acc,_0x540a48){return function(_0x119401){if(_0x119401){return _0x119401[_0xcdf3('0x24')](_0x3c3acc)['then'](function(_0x42ad20){return _0x42ad20;});}return null;};}function removeEntity(_0x11f505,_0xf27e9d){return function(_0x19f157){if(_0x19f157){return _0x19f157['destroy']()[_0xcdf3('0x25')](function(){_0x11f505['status'](0xcc)[_0xcdf3('0x1d')]();});}};}function handleEntityNotFound(_0x66bc3d,_0x5ef8f4){return function(_0x297d8e){if(!_0x297d8e){_0x66bc3d['sendStatus'](0x194);}return _0x297d8e;};}function handleError(_0x723db6,_0x52ad6b){_0x52ad6b=_0x52ad6b||0x1f4;return function(_0xe62d16){logger[_0xcdf3('0x26')](_0xe62d16[_0xcdf3('0x27')]);if(_0xe62d16[_0xcdf3('0x28')]){delete _0xe62d16[_0xcdf3('0x28')];}_0x723db6[_0xcdf3('0x1c')](_0x52ad6b)['send'](_0xe62d16);};}exports['index']=function(_0x16ea2f,_0xc922e9){var _0x346066={},_0x557f97={},_0x7cb4ca={'count':0x0,'rows':[]};var _0x6b87d0=_[_0xcdf3('0x29')](db[_0xcdf3('0x2a')][_0xcdf3('0x2b')],function(_0x2f31cb){return{'name':_0x2f31cb[_0xcdf3('0x2c')],'type':_0x2f31cb[_0xcdf3('0x2d')][_0xcdf3('0x2e')]};});_0x557f97[_0xcdf3('0x2f')]=_[_0xcdf3('0x29')](_0x6b87d0,_0xcdf3('0x28'));_0x557f97[_0xcdf3('0x30')]=_['keys'](_0x16ea2f[_0xcdf3('0x30')]);_0x557f97['filters']=_[_0xcdf3('0x31')](_0x557f97[_0xcdf3('0x2f')],_0x557f97[_0xcdf3('0x30')]);_0x346066['attributes']=_[_0xcdf3('0x31')](_0x557f97[_0xcdf3('0x2f')],qs['fields'](_0x16ea2f[_0xcdf3('0x30')][_0xcdf3('0x32')]));_0x346066[_0xcdf3('0x33')]=_0x346066[_0xcdf3('0x33')][_0xcdf3('0x34')]?_0x346066[_0xcdf3('0x33')]:_0x557f97[_0xcdf3('0x2f')];if(!_0x16ea2f[_0xcdf3('0x30')][_0xcdf3('0x35')](_0xcdf3('0x36'))){_0x346066['limit']=qs[_0xcdf3('0x20')](_0x16ea2f[_0xcdf3('0x30')][_0xcdf3('0x20')]);_0x346066['offset']=qs['offset'](_0x16ea2f[_0xcdf3('0x30')]['offset']);}_0x346066[_0xcdf3('0x37')]=qs[_0xcdf3('0x38')](_0x16ea2f[_0xcdf3('0x30')][_0xcdf3('0x38')]);_0x346066[_0xcdf3('0x39')]=qs[_0xcdf3('0x3a')](_[_0xcdf3('0x3b')](_0x16ea2f[_0xcdf3('0x30')],_0x557f97[_0xcdf3('0x3a')]),_0x6b87d0);if(_0x16ea2f['query'][_0xcdf3('0x3c')]){_0x346066['where']=_[_0xcdf3('0x3d')](_0x346066[_0xcdf3('0x39')],{'$or':_[_0xcdf3('0x29')](_0x6b87d0,function(_0x4cccfb){if(_0x4cccfb[_0xcdf3('0x2d')]!=='VIRTUAL'){var _0xb21741={};_0xb21741[_0x4cccfb[_0xcdf3('0x28')]]={'$like':'%'+_0x16ea2f['query'][_0xcdf3('0x3c')]+'%'};return _0xb21741;}})});}_0x346066=_[_0xcdf3('0x3d')]({},_0x346066,_0x16ea2f[_0xcdf3('0x3e')]);var _0x547ec5={'where':_0x346066[_0xcdf3('0x39')]};return db['ZendeskConfiguration']['count'](_0x547ec5)[_0xcdf3('0x25')](function(_0x2fab0f){_0x7cb4ca[_0xcdf3('0x21')]=_0x2fab0f;if(_0x16ea2f[_0xcdf3('0x30')][_0xcdf3('0x3f')]){_0x346066[_0xcdf3('0x40')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xcdf3('0x41')](_0x346066);})[_0xcdf3('0x25')](function(_0x287da9){_0x7cb4ca[_0xcdf3('0x42')]=_0x287da9;return _0x7cb4ca;})[_0xcdf3('0x25')](respondWithFilteredResult(_0xc922e9,_0x346066))[_0xcdf3('0x43')](handleError(_0xc922e9,null));};exports[_0xcdf3('0x44')]=function(_0x1d6842,_0x1b63e7){var _0x38425b={'raw':![],'where':{'id':_0x1d6842[_0xcdf3('0x45')]['id']}},_0x4bfdf1={};_0x4bfdf1[_0xcdf3('0x2f')]=_[_0xcdf3('0x46')](db[_0xcdf3('0x2a')][_0xcdf3('0x2b')]);_0x4bfdf1[_0xcdf3('0x30')]=_[_0xcdf3('0x46')](_0x1d6842[_0xcdf3('0x30')]);_0x4bfdf1[_0xcdf3('0x3a')]=_[_0xcdf3('0x31')](_0x4bfdf1[_0xcdf3('0x2f')],_0x4bfdf1[_0xcdf3('0x30')]);_0x38425b[_0xcdf3('0x33')]=_[_0xcdf3('0x31')](_0x4bfdf1[_0xcdf3('0x2f')],qs['fields'](_0x1d6842[_0xcdf3('0x30')][_0xcdf3('0x32')]));_0x38425b[_0xcdf3('0x33')]=_0x38425b['attributes']['length']?_0x38425b['attributes']:_0x4bfdf1[_0xcdf3('0x2f')];if(_0x1d6842[_0xcdf3('0x30')][_0xcdf3('0x3f')]){_0x38425b['include']=[{'all':!![]}];}_0x38425b=_[_0xcdf3('0x3d')]({},_0x38425b,_0x1d6842['options']);return db[_0xcdf3('0x2a')]['find'](_0x38425b)[_0xcdf3('0x25')](handleEntityNotFound(_0x1b63e7,null))[_0xcdf3('0x25')](respondWithResult(_0x1b63e7,null))[_0xcdf3('0x43')](handleError(_0x1b63e7,null));};exports[_0xcdf3('0x47')]=function(_0x4bf490,_0x5c602e){return db[_0xcdf3('0x2a')]['create'](_0x4bf490[_0xcdf3('0x48')],{})[_0xcdf3('0x25')](respondWithResult(_0x5c602e,0xc9))['catch'](handleError(_0x5c602e,null));};exports[_0xcdf3('0x24')]=function(_0x1060d9,_0xb31b5f){if(_0x1060d9['body']['id']){delete _0x1060d9[_0xcdf3('0x48')]['id'];}return db[_0xcdf3('0x2a')][_0xcdf3('0x49')]({'where':{'id':_0x1060d9['params']['id']}})['then'](handleEntityNotFound(_0xb31b5f,null))[_0xcdf3('0x25')](saveUpdates(_0x1060d9['body'],null))[_0xcdf3('0x25')](respondWithResult(_0xb31b5f,null))[_0xcdf3('0x43')](handleError(_0xb31b5f,null));};exports[_0xcdf3('0x4a')]=function(_0x53049e,_0x1b9297){return db[_0xcdf3('0x2a')]['find']({'where':{'id':_0x53049e['params']['id']}})[_0xcdf3('0x25')](handleEntityNotFound(_0x1b9297,null))[_0xcdf3('0x25')](removeEntity(_0x1b9297,null))[_0xcdf3('0x43')](handleError(_0x1b9297,null));};exports[_0xcdf3('0x4b')]=function(_0x5d381b,_0xaa9e81,_0x1eb7f2){var _0x1e04e9={};var _0xe4b914={};var _0x1caf9b;var _0x56895b;return db[_0xcdf3('0x2a')][_0xcdf3('0x4c')]({'where':{'id':_0x5d381b['params']['id']}})['then'](handleEntityNotFound(_0xaa9e81,null))[_0xcdf3('0x25')](function(_0x466de5){if(_0x466de5){_0x1caf9b=_0x466de5;_0xe4b914['model']=_[_0xcdf3('0x46')](db[_0xcdf3('0x4d')][_0xcdf3('0x2b')]);_0xe4b914['query']=_['keys'](_0x5d381b['query']);_0xe4b914[_0xcdf3('0x3a')]=_[_0xcdf3('0x31')](_0xe4b914[_0xcdf3('0x2f')],_0xe4b914[_0xcdf3('0x30')]);_0x1e04e9[_0xcdf3('0x33')]=_[_0xcdf3('0x31')](_0xe4b914[_0xcdf3('0x2f')],qs[_0xcdf3('0x32')](_0x5d381b[_0xcdf3('0x30')][_0xcdf3('0x32')]));_0x1e04e9[_0xcdf3('0x33')]=_0x1e04e9[_0xcdf3('0x33')][_0xcdf3('0x34')]?_0x1e04e9['attributes']:_0xe4b914[_0xcdf3('0x2f')];_0x1e04e9[_0xcdf3('0x37')]=qs[_0xcdf3('0x38')](_0x5d381b[_0xcdf3('0x30')]['sort']);_0x1e04e9['where']=qs[_0xcdf3('0x3a')](_[_0xcdf3('0x3b')](_0x5d381b['query'],_0xe4b914['filters']));if(_0x5d381b['query'][_0xcdf3('0x3c')]){_0x1e04e9[_0xcdf3('0x39')]=_[_0xcdf3('0x3d')](_0x1e04e9[_0xcdf3('0x39')],{'$or':_[_0xcdf3('0x29')](_0x1e04e9[_0xcdf3('0x33')],function(_0x22cf9b){var _0x297e4f={};_0x297e4f[_0x22cf9b]={'$like':'%'+_0x5d381b[_0xcdf3('0x30')][_0xcdf3('0x3c')]+'%'};return _0x297e4f;})});}_0x1e04e9=_[_0xcdf3('0x3d')]({},_0x1e04e9,_0x5d381b[_0xcdf3('0x3e')]);return _0x1caf9b[_0xcdf3('0x4b')](_0x1e04e9);}})[_0xcdf3('0x25')](function(_0x5ce569){if(_0x5ce569){_0x56895b=_0x5ce569[_0xcdf3('0x34')];if(!_0x5d381b['query'][_0xcdf3('0x35')](_0xcdf3('0x36'))){_0x1e04e9[_0xcdf3('0x20')]=qs[_0xcdf3('0x20')](_0x5d381b[_0xcdf3('0x30')][_0xcdf3('0x20')]);_0x1e04e9[_0xcdf3('0x1e')]=qs[_0xcdf3('0x1e')](_0x5d381b[_0xcdf3('0x30')][_0xcdf3('0x1e')]);}return _0x1caf9b['getFields'](_0x1e04e9);}})['then'](function(_0x502511){if(_0x502511){return _0x502511?{'count':_0x56895b,'rows':_0x502511}:null;}})['then'](respondWithResult(_0xaa9e81,null))[_0xcdf3('0x43')](handleError(_0xaa9e81,null));};exports[_0xcdf3('0x4e')]=function(_0x29cf7b,_0x34f05d,_0x48f7f5){var _0x1b49d9={};var _0x59da8c={};var _0x4b16f4;var _0x147108;return db[_0xcdf3('0x2a')]['findOne']({'where':{'id':_0x29cf7b[_0xcdf3('0x45')]['id']}})[_0xcdf3('0x25')](handleEntityNotFound(_0x34f05d,null))[_0xcdf3('0x25')](function(_0x4af401){if(_0x4af401){_0x4b16f4=_0x4af401;_0x59da8c[_0xcdf3('0x2f')]=_['keys'](db[_0xcdf3('0x4d')]['rawAttributes']);_0x59da8c[_0xcdf3('0x30')]=_[_0xcdf3('0x46')](_0x29cf7b[_0xcdf3('0x30')]);_0x59da8c['filters']=_['intersection'](_0x59da8c['model'],_0x59da8c['query']);_0x1b49d9[_0xcdf3('0x33')]=_[_0xcdf3('0x31')](_0x59da8c[_0xcdf3('0x2f')],qs['fields'](_0x29cf7b[_0xcdf3('0x30')][_0xcdf3('0x32')]));_0x1b49d9[_0xcdf3('0x33')]=_0x1b49d9[_0xcdf3('0x33')][_0xcdf3('0x34')]?_0x1b49d9[_0xcdf3('0x33')]:_0x59da8c[_0xcdf3('0x2f')];_0x1b49d9['order']=qs[_0xcdf3('0x38')](_0x29cf7b[_0xcdf3('0x30')][_0xcdf3('0x38')]);_0x1b49d9[_0xcdf3('0x39')]=qs['filters'](_[_0xcdf3('0x3b')](_0x29cf7b[_0xcdf3('0x30')],_0x59da8c[_0xcdf3('0x3a')]));if(_0x29cf7b[_0xcdf3('0x30')]['filter']){_0x1b49d9[_0xcdf3('0x39')]=_[_0xcdf3('0x3d')](_0x1b49d9[_0xcdf3('0x39')],{'$or':_['map'](_0x1b49d9[_0xcdf3('0x33')],function(_0x3ae091){var _0x319a9d={};_0x319a9d[_0x3ae091]={'$like':'%'+_0x29cf7b[_0xcdf3('0x30')][_0xcdf3('0x3c')]+'%'};return _0x319a9d;})});}_0x1b49d9=_[_0xcdf3('0x3d')]({},_0x1b49d9,_0x29cf7b['options']);return _0x4b16f4[_0xcdf3('0x4e')](_0x1b49d9);}})[_0xcdf3('0x25')](function(_0x490738){if(_0x490738){_0x147108=_0x490738[_0xcdf3('0x34')];if(!_0x29cf7b[_0xcdf3('0x30')][_0xcdf3('0x35')](_0xcdf3('0x36'))){_0x1b49d9[_0xcdf3('0x20')]=qs[_0xcdf3('0x20')](_0x29cf7b['query'][_0xcdf3('0x20')]);_0x1b49d9[_0xcdf3('0x1e')]=qs[_0xcdf3('0x1e')](_0x29cf7b['query'][_0xcdf3('0x1e')]);}return _0x4b16f4['getSubjects'](_0x1b49d9);}})[_0xcdf3('0x25')](function(_0x21ccb3){if(_0x21ccb3){return _0x21ccb3?{'count':_0x147108,'rows':_0x21ccb3}:null;}})[_0xcdf3('0x25')](respondWithResult(_0x34f05d,null))['catch'](handleError(_0x34f05d,null));};exports['getDescriptions']=function(_0x1703e0,_0x1778f9,_0x4982c5){var _0x55a47c={};var _0x1d5d66={};var _0x425e6a;var _0x568cf3;return db[_0xcdf3('0x2a')][_0xcdf3('0x4c')]({'where':{'id':_0x1703e0['params']['id']}})[_0xcdf3('0x25')](handleEntityNotFound(_0x1778f9,null))[_0xcdf3('0x25')](function(_0x28655b){if(_0x28655b){_0x425e6a=_0x28655b;_0x1d5d66[_0xcdf3('0x2f')]=_[_0xcdf3('0x46')](db[_0xcdf3('0x4d')][_0xcdf3('0x2b')]);_0x1d5d66[_0xcdf3('0x30')]=_[_0xcdf3('0x46')](_0x1703e0[_0xcdf3('0x30')]);_0x1d5d66['filters']=_[_0xcdf3('0x31')](_0x1d5d66[_0xcdf3('0x2f')],_0x1d5d66[_0xcdf3('0x30')]);_0x55a47c[_0xcdf3('0x33')]=_['intersection'](_0x1d5d66['model'],qs[_0xcdf3('0x32')](_0x1703e0[_0xcdf3('0x30')][_0xcdf3('0x32')]));_0x55a47c[_0xcdf3('0x33')]=_0x55a47c[_0xcdf3('0x33')][_0xcdf3('0x34')]?_0x55a47c[_0xcdf3('0x33')]:_0x1d5d66[_0xcdf3('0x2f')];_0x55a47c[_0xcdf3('0x37')]=qs['sort'](_0x1703e0['query']['sort']);_0x55a47c[_0xcdf3('0x39')]=qs[_0xcdf3('0x3a')](_['pick'](_0x1703e0['query'],_0x1d5d66[_0xcdf3('0x3a')]));if(_0x1703e0[_0xcdf3('0x30')][_0xcdf3('0x3c')]){_0x55a47c[_0xcdf3('0x39')]=_['merge'](_0x55a47c[_0xcdf3('0x39')],{'$or':_[_0xcdf3('0x29')](_0x55a47c[_0xcdf3('0x33')],function(_0x2f4f1c){var _0x351603={};_0x351603[_0x2f4f1c]={'$like':'%'+_0x1703e0['query'][_0xcdf3('0x3c')]+'%'};return _0x351603;})});}_0x55a47c=_[_0xcdf3('0x3d')]({},_0x55a47c,_0x1703e0['options']);return _0x425e6a[_0xcdf3('0x4f')](_0x55a47c);}})[_0xcdf3('0x25')](function(_0x3a0790){if(_0x3a0790){_0x568cf3=_0x3a0790[_0xcdf3('0x34')];if(!_0x1703e0[_0xcdf3('0x30')]['hasOwnProperty']('nolimit')){_0x55a47c[_0xcdf3('0x20')]=qs['limit'](_0x1703e0[_0xcdf3('0x30')]['limit']);_0x55a47c[_0xcdf3('0x1e')]=qs[_0xcdf3('0x1e')](_0x1703e0[_0xcdf3('0x30')][_0xcdf3('0x1e')]);}return _0x425e6a[_0xcdf3('0x4f')](_0x55a47c);}})['then'](function(_0x2db4ad){if(_0x2db4ad){return _0x2db4ad?{'count':_0x568cf3,'rows':_0x2db4ad}:null;}})['then'](respondWithResult(_0x1778f9,null))[_0xcdf3('0x43')](handleError(_0x1778f9,null));};exports[_0xcdf3('0x50')]=function(_0x3fab67,_0x45954b,_0x21e1a0){var _0x5d500f={};var _0x52dfa6={};var _0x4b8d29;var _0x1c6817;return db['ZendeskConfiguration'][_0xcdf3('0x4c')]({'where':{'id':_0x3fab67[_0xcdf3('0x45')]['id']}})['then'](handleEntityNotFound(_0x45954b,null))[_0xcdf3('0x25')](function(_0x75782e){if(_0x75782e){_0x4b8d29=_0x75782e;_0x52dfa6[_0xcdf3('0x2f')]=_[_0xcdf3('0x46')](db[_0xcdf3('0x51')][_0xcdf3('0x2b')]);_0x52dfa6[_0xcdf3('0x30')]=_[_0xcdf3('0x46')](_0x3fab67[_0xcdf3('0x30')]);_0x52dfa6['filters']=_[_0xcdf3('0x31')](_0x52dfa6['model'],_0x52dfa6[_0xcdf3('0x30')]);_0x5d500f['attributes']=_[_0xcdf3('0x31')](_0x52dfa6[_0xcdf3('0x2f')],qs['fields'](_0x3fab67[_0xcdf3('0x30')][_0xcdf3('0x32')]));_0x5d500f[_0xcdf3('0x33')]=_0x5d500f['attributes'][_0xcdf3('0x34')]?_0x5d500f[_0xcdf3('0x33')]:_0x52dfa6[_0xcdf3('0x2f')];_0x5d500f[_0xcdf3('0x37')]=qs[_0xcdf3('0x38')](_0x3fab67[_0xcdf3('0x30')][_0xcdf3('0x38')]);_0x5d500f[_0xcdf3('0x39')]=qs[_0xcdf3('0x3a')](_[_0xcdf3('0x3b')](_0x3fab67['query'],_0x52dfa6['filters']));if(_0x3fab67[_0xcdf3('0x30')][_0xcdf3('0x3c')]){_0x5d500f[_0xcdf3('0x39')]=_[_0xcdf3('0x3d')](_0x5d500f[_0xcdf3('0x39')],{'$or':_[_0xcdf3('0x29')](_0x5d500f[_0xcdf3('0x33')],function(_0xcf2e45){var _0x111fe8={};_0x111fe8[_0xcf2e45]={'$like':'%'+_0x3fab67['query'][_0xcdf3('0x3c')]+'%'};return _0x111fe8;})});}_0x5d500f=_['merge']({},_0x5d500f,_0x3fab67[_0xcdf3('0x3e')]);return _0x4b8d29['getTags'](_0x5d500f);}})['then'](function(_0x2a26a0){if(_0x2a26a0){_0x1c6817=_0x2a26a0[_0xcdf3('0x34')];if(!_0x3fab67['query'][_0xcdf3('0x35')](_0xcdf3('0x36'))){_0x5d500f['limit']=qs[_0xcdf3('0x20')](_0x3fab67[_0xcdf3('0x30')][_0xcdf3('0x20')]);_0x5d500f[_0xcdf3('0x1e')]=qs[_0xcdf3('0x1e')](_0x3fab67[_0xcdf3('0x30')][_0xcdf3('0x1e')]);}return _0x4b8d29[_0xcdf3('0x50')](_0x5d500f);}})['then'](function(_0x881851){if(_0x881851){return _0x881851?{'count':_0x1c6817,'rows':_0x881851}:null;}})['then'](respondWithResult(_0x45954b,null))[_0xcdf3('0x43')](handleError(_0x45954b,null));};exports[_0xcdf3('0x52')]=function(_0x54d79c,_0x349f02,_0x3290e0){if(_0x54d79c['body']['id']){delete _0x54d79c[_0xcdf3('0x48')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x54d79c[_0xcdf3('0x45')]['id']}})[_0xcdf3('0x25')](handleEntityNotFound(_0x349f02,null))['then'](function(_0x468e7d){if(_0x468e7d){return _0x468e7d[_0xcdf3('0x52')](_0x54d79c[_0xcdf3('0x48')]['ids']||[]);}return null;})[_0xcdf3('0x25')](respondWithResult(_0x349f02,null))[_0xcdf3('0x43')](handleError(_0x349f02,null));}; \ No newline at end of file +var _0x3a9d=['util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','ZendeskConfiguration','include','findAll','rows','catch','includeAll','find','create','body','params','getFields','findOne','getSubjects','ZendeskField','getDescriptions','getTags','Tag','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x5e4b85,_0x6cf965){var _0x5cd3cb=function(_0x589c9e){while(--_0x589c9e){_0x5e4b85['push'](_0x5e4b85['shift']());}};_0x5cd3cb(++_0x6cf965);}(_0x3a9d,0x199));var _0xd3a9=function(_0x111d6a,_0x77eee1){_0x111d6a=_0x111d6a-0x0;var _0x146b6f=_0x3a9d[_0x111d6a];return _0x146b6f;};'use strict';var emlformat=require(_0xd3a9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd3a9('0x1'));var jsonpatch=require(_0xd3a9('0x2'));var rp=require(_0xd3a9('0x3'));var moment=require(_0xd3a9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd3a9('0x5'));var util=require(_0xd3a9('0x6'));var path=require(_0xd3a9('0x7'));var sox=require('sox');var csv=require(_0xd3a9('0x8'));var ejs=require(_0xd3a9('0x9'));var fs=require('fs');var fs_extra=require(_0xd3a9('0xa'));var _=require(_0xd3a9('0xb'));var squel=require(_0xd3a9('0xc'));var crypto=require('crypto');var jsforce=require(_0xd3a9('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd3a9('0xe'));var Papa=require(_0xd3a9('0xf'));var Redis=require(_0xd3a9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd3a9('0x11'));var as=require(_0xd3a9('0x12'));var hardwareService=require(_0xd3a9('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xd3a9('0x14'));var config=require(_0xd3a9('0x15'));var licenseUtil=require(_0xd3a9('0x16'));var db=require(_0xd3a9('0x17'))['db'];function respondWithStatusCode(_0x42b29c,_0x8db17c){_0x8db17c=_0x8db17c||0xcc;return function(_0x3c7bc2){if(_0x3c7bc2){return _0x42b29c['sendStatus'](_0x8db17c);}return _0x42b29c[_0xd3a9('0x18')](_0x8db17c)[_0xd3a9('0x19')]();};}function respondWithResult(_0x2ba346,_0x2d15a8){_0x2d15a8=_0x2d15a8||0xc8;return function(_0x3726a8){if(_0x3726a8){return _0x2ba346[_0xd3a9('0x18')](_0x2d15a8)[_0xd3a9('0x1a')](_0x3726a8);}};}function respondWithFilteredResult(_0x207a09,_0x1a5097){return function(_0x113041){if(_0x113041){var _0x123263=typeof _0x1a5097[_0xd3a9('0x1b')]===_0xd3a9('0x1c')&&typeof _0x1a5097[_0xd3a9('0x1d')]===_0xd3a9('0x1c');var _0x1e440d=_0x113041[_0xd3a9('0x1e')];var _0x8c9c1=_0x123263?0x0:_0x1a5097['offset'];var _0x1f2674=_0x123263?_0x113041[_0xd3a9('0x1e')]:_0x1a5097[_0xd3a9('0x1b')]+_0x1a5097[_0xd3a9('0x1d')];var _0x563ed9;if(_0x1f2674>=_0x1e440d){_0x1f2674=_0x1e440d;_0x563ed9=0xc8;}else{_0x563ed9=0xce;}_0x207a09[_0xd3a9('0x18')](_0x563ed9);return _0x207a09['set']('Content-Range',_0x8c9c1+'-'+_0x1f2674+'/'+_0x1e440d)[_0xd3a9('0x1a')](_0x113041);}return null;};}function patchUpdates(_0x247215){return function(_0x45fac9){try{jsonpatch[_0xd3a9('0x1f')](_0x45fac9,_0x247215,!![]);}catch(_0x1c60b7){return BPromise[_0xd3a9('0x20')](_0x1c60b7);}return _0x45fac9[_0xd3a9('0x21')]();};}function saveUpdates(_0x590ac4,_0x2b9bc2){return function(_0x45d175){if(_0x45d175){return _0x45d175[_0xd3a9('0x22')](_0x590ac4)[_0xd3a9('0x23')](function(_0x16aa29){return _0x16aa29;});}return null;};}function removeEntity(_0x157942,_0x529242){return function(_0x9e2a69){if(_0x9e2a69){return _0x9e2a69[_0xd3a9('0x24')]()[_0xd3a9('0x23')](function(){_0x157942[_0xd3a9('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6cf8a7,_0x26a66b){return function(_0x3d5724){if(!_0x3d5724){_0x6cf8a7[_0xd3a9('0x25')](0x194);}return _0x3d5724;};}function handleError(_0x444b5c,_0x14cb81){_0x14cb81=_0x14cb81||0x1f4;return function(_0x59963b){logger[_0xd3a9('0x26')](_0x59963b[_0xd3a9('0x27')]);if(_0x59963b[_0xd3a9('0x28')]){delete _0x59963b['name'];}_0x444b5c[_0xd3a9('0x18')](_0x14cb81)['send'](_0x59963b);};}exports[_0xd3a9('0x29')]=function(_0x3c6d50,_0x459169){var _0x21497f={},_0x33d34b={},_0xd383dc={'count':0x0,'rows':[]};var _0x3165aa=_[_0xd3a9('0x2a')](db['ZendeskConfiguration'][_0xd3a9('0x2b')],function(_0x356e8c){return{'name':_0x356e8c[_0xd3a9('0x2c')],'type':_0x356e8c[_0xd3a9('0x2d')][_0xd3a9('0x2e')]};});_0x33d34b[_0xd3a9('0x2f')]=_['map'](_0x3165aa,'name');_0x33d34b[_0xd3a9('0x30')]=_[_0xd3a9('0x31')](_0x3c6d50[_0xd3a9('0x30')]);_0x33d34b['filters']=_[_0xd3a9('0x32')](_0x33d34b[_0xd3a9('0x2f')],_0x33d34b['query']);_0x21497f[_0xd3a9('0x33')]=_[_0xd3a9('0x32')](_0x33d34b[_0xd3a9('0x2f')],qs[_0xd3a9('0x34')](_0x3c6d50[_0xd3a9('0x30')]['fields']));_0x21497f[_0xd3a9('0x33')]=_0x21497f[_0xd3a9('0x33')][_0xd3a9('0x35')]?_0x21497f[_0xd3a9('0x33')]:_0x33d34b[_0xd3a9('0x2f')];if(!_0x3c6d50['query'][_0xd3a9('0x36')](_0xd3a9('0x37'))){_0x21497f[_0xd3a9('0x1d')]=qs[_0xd3a9('0x1d')](_0x3c6d50['query'][_0xd3a9('0x1d')]);_0x21497f[_0xd3a9('0x1b')]=qs[_0xd3a9('0x1b')](_0x3c6d50[_0xd3a9('0x30')][_0xd3a9('0x1b')]);}_0x21497f[_0xd3a9('0x38')]=qs['sort'](_0x3c6d50['query'][_0xd3a9('0x39')]);_0x21497f[_0xd3a9('0x3a')]=qs['filters'](_[_0xd3a9('0x3b')](_0x3c6d50['query'],_0x33d34b[_0xd3a9('0x3c')]),_0x3165aa);if(_0x3c6d50[_0xd3a9('0x30')][_0xd3a9('0x3d')]){_0x21497f[_0xd3a9('0x3a')]=_['merge'](_0x21497f[_0xd3a9('0x3a')],{'$or':_[_0xd3a9('0x2a')](_0x3165aa,function(_0x50cd33){if(_0x50cd33[_0xd3a9('0x2d')]!==_0xd3a9('0x3e')){var _0x450850={};_0x450850[_0x50cd33[_0xd3a9('0x28')]]={'$like':'%'+_0x3c6d50[_0xd3a9('0x30')][_0xd3a9('0x3d')]+'%'};return _0x450850;}})});}_0x21497f=_[_0xd3a9('0x3f')]({},_0x21497f,_0x3c6d50[_0xd3a9('0x40')]);var _0x4a7e55={'where':_0x21497f['where']};return db[_0xd3a9('0x41')][_0xd3a9('0x1e')](_0x4a7e55)[_0xd3a9('0x23')](function(_0x1cf802){_0xd383dc[_0xd3a9('0x1e')]=_0x1cf802;if(_0x3c6d50['query']['includeAll']){_0x21497f[_0xd3a9('0x42')]=[{'all':!![]}];}return db[_0xd3a9('0x41')][_0xd3a9('0x43')](_0x21497f);})[_0xd3a9('0x23')](function(_0x1071c3){_0xd383dc[_0xd3a9('0x44')]=_0x1071c3;return _0xd383dc;})['then'](respondWithFilteredResult(_0x459169,_0x21497f))[_0xd3a9('0x45')](handleError(_0x459169,null));};exports['show']=function(_0x2b3faf,_0x44847b){var _0x3768ec={'raw':![],'where':{'id':_0x2b3faf['params']['id']}},_0x52de91={};_0x52de91['model']=_[_0xd3a9('0x31')](db[_0xd3a9('0x41')][_0xd3a9('0x2b')]);_0x52de91[_0xd3a9('0x30')]=_[_0xd3a9('0x31')](_0x2b3faf[_0xd3a9('0x30')]);_0x52de91['filters']=_[_0xd3a9('0x32')](_0x52de91[_0xd3a9('0x2f')],_0x52de91['query']);_0x3768ec[_0xd3a9('0x33')]=_['intersection'](_0x52de91[_0xd3a9('0x2f')],qs['fields'](_0x2b3faf[_0xd3a9('0x30')]['fields']));_0x3768ec[_0xd3a9('0x33')]=_0x3768ec[_0xd3a9('0x33')]['length']?_0x3768ec[_0xd3a9('0x33')]:_0x52de91['model'];if(_0x2b3faf[_0xd3a9('0x30')][_0xd3a9('0x46')]){_0x3768ec[_0xd3a9('0x42')]=[{'all':!![]}];}_0x3768ec=_[_0xd3a9('0x3f')]({},_0x3768ec,_0x2b3faf[_0xd3a9('0x40')]);return db[_0xd3a9('0x41')][_0xd3a9('0x47')](_0x3768ec)['then'](handleEntityNotFound(_0x44847b,null))[_0xd3a9('0x23')](respondWithResult(_0x44847b,null))[_0xd3a9('0x45')](handleError(_0x44847b,null));};exports[_0xd3a9('0x48')]=function(_0x58e763,_0x19c4a9){return db['ZendeskConfiguration']['create'](_0x58e763[_0xd3a9('0x49')],{})[_0xd3a9('0x23')](respondWithResult(_0x19c4a9,0xc9))['catch'](handleError(_0x19c4a9,null));};exports['update']=function(_0x30855a,_0x2960b4){if(_0x30855a[_0xd3a9('0x49')]['id']){delete _0x30855a['body']['id'];}return db[_0xd3a9('0x41')][_0xd3a9('0x47')]({'where':{'id':_0x30855a[_0xd3a9('0x4a')]['id']}})[_0xd3a9('0x23')](handleEntityNotFound(_0x2960b4,null))[_0xd3a9('0x23')](saveUpdates(_0x30855a['body'],null))[_0xd3a9('0x23')](respondWithResult(_0x2960b4,null))[_0xd3a9('0x45')](handleError(_0x2960b4,null));};exports[_0xd3a9('0x24')]=function(_0x4cd90d,_0x3b2760){return db[_0xd3a9('0x41')][_0xd3a9('0x47')]({'where':{'id':_0x4cd90d[_0xd3a9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3b2760,null))[_0xd3a9('0x23')](removeEntity(_0x3b2760,null))[_0xd3a9('0x45')](handleError(_0x3b2760,null));};exports[_0xd3a9('0x4b')]=function(_0x562148,_0xaf64cf,_0x52efa4){var _0x105e5f={};var _0x51c37f={};var _0x5127f8;var _0x75a9e5;return db['ZendeskConfiguration'][_0xd3a9('0x4c')]({'where':{'id':_0x562148['params']['id']}})[_0xd3a9('0x23')](handleEntityNotFound(_0xaf64cf,null))[_0xd3a9('0x23')](function(_0x482ef8){if(_0x482ef8){_0x5127f8=_0x482ef8;_0x51c37f['model']=_[_0xd3a9('0x31')](db['ZendeskField']['rawAttributes']);_0x51c37f[_0xd3a9('0x30')]=_['keys'](_0x562148[_0xd3a9('0x30')]);_0x51c37f[_0xd3a9('0x3c')]=_[_0xd3a9('0x32')](_0x51c37f[_0xd3a9('0x2f')],_0x51c37f[_0xd3a9('0x30')]);_0x105e5f[_0xd3a9('0x33')]=_['intersection'](_0x51c37f['model'],qs['fields'](_0x562148[_0xd3a9('0x30')][_0xd3a9('0x34')]));_0x105e5f[_0xd3a9('0x33')]=_0x105e5f[_0xd3a9('0x33')]['length']?_0x105e5f[_0xd3a9('0x33')]:_0x51c37f[_0xd3a9('0x2f')];_0x105e5f['order']=qs[_0xd3a9('0x39')](_0x562148[_0xd3a9('0x30')][_0xd3a9('0x39')]);_0x105e5f[_0xd3a9('0x3a')]=qs[_0xd3a9('0x3c')](_[_0xd3a9('0x3b')](_0x562148['query'],_0x51c37f['filters']));if(_0x562148[_0xd3a9('0x30')][_0xd3a9('0x3d')]){_0x105e5f[_0xd3a9('0x3a')]=_[_0xd3a9('0x3f')](_0x105e5f[_0xd3a9('0x3a')],{'$or':_[_0xd3a9('0x2a')](_0x105e5f[_0xd3a9('0x33')],function(_0xecf191){var _0x210537={};_0x210537[_0xecf191]={'$like':'%'+_0x562148[_0xd3a9('0x30')][_0xd3a9('0x3d')]+'%'};return _0x210537;})});}_0x105e5f=_[_0xd3a9('0x3f')]({},_0x105e5f,_0x562148[_0xd3a9('0x40')]);return _0x5127f8[_0xd3a9('0x4b')](_0x105e5f);}})[_0xd3a9('0x23')](function(_0x17c9ca){if(_0x17c9ca){_0x75a9e5=_0x17c9ca['length'];if(!_0x562148[_0xd3a9('0x30')][_0xd3a9('0x36')](_0xd3a9('0x37'))){_0x105e5f[_0xd3a9('0x1d')]=qs[_0xd3a9('0x1d')](_0x562148[_0xd3a9('0x30')][_0xd3a9('0x1d')]);_0x105e5f[_0xd3a9('0x1b')]=qs[_0xd3a9('0x1b')](_0x562148['query'][_0xd3a9('0x1b')]);}return _0x5127f8[_0xd3a9('0x4b')](_0x105e5f);}})[_0xd3a9('0x23')](function(_0xd188e1){if(_0xd188e1){return _0xd188e1?{'count':_0x75a9e5,'rows':_0xd188e1}:null;}})[_0xd3a9('0x23')](respondWithResult(_0xaf64cf,null))[_0xd3a9('0x45')](handleError(_0xaf64cf,null));};exports[_0xd3a9('0x4d')]=function(_0x16f915,_0x15bbaa,_0x2bb38d){var _0x577e2b={};var _0x5f3f2d={};var _0x4087f2;var _0x3b72be;return db[_0xd3a9('0x41')]['findOne']({'where':{'id':_0x16f915[_0xd3a9('0x4a')]['id']}})[_0xd3a9('0x23')](handleEntityNotFound(_0x15bbaa,null))[_0xd3a9('0x23')](function(_0x2638c0){if(_0x2638c0){_0x4087f2=_0x2638c0;_0x5f3f2d[_0xd3a9('0x2f')]=_[_0xd3a9('0x31')](db[_0xd3a9('0x4e')][_0xd3a9('0x2b')]);_0x5f3f2d[_0xd3a9('0x30')]=_['keys'](_0x16f915[_0xd3a9('0x30')]);_0x5f3f2d['filters']=_[_0xd3a9('0x32')](_0x5f3f2d[_0xd3a9('0x2f')],_0x5f3f2d['query']);_0x577e2b[_0xd3a9('0x33')]=_['intersection'](_0x5f3f2d[_0xd3a9('0x2f')],qs['fields'](_0x16f915['query'][_0xd3a9('0x34')]));_0x577e2b[_0xd3a9('0x33')]=_0x577e2b['attributes']['length']?_0x577e2b['attributes']:_0x5f3f2d[_0xd3a9('0x2f')];_0x577e2b[_0xd3a9('0x38')]=qs['sort'](_0x16f915['query']['sort']);_0x577e2b[_0xd3a9('0x3a')]=qs[_0xd3a9('0x3c')](_[_0xd3a9('0x3b')](_0x16f915[_0xd3a9('0x30')],_0x5f3f2d[_0xd3a9('0x3c')]));if(_0x16f915[_0xd3a9('0x30')]['filter']){_0x577e2b[_0xd3a9('0x3a')]=_[_0xd3a9('0x3f')](_0x577e2b[_0xd3a9('0x3a')],{'$or':_['map'](_0x577e2b['attributes'],function(_0x47370e){var _0x131071={};_0x131071[_0x47370e]={'$like':'%'+_0x16f915['query'][_0xd3a9('0x3d')]+'%'};return _0x131071;})});}_0x577e2b=_['merge']({},_0x577e2b,_0x16f915[_0xd3a9('0x40')]);return _0x4087f2[_0xd3a9('0x4d')](_0x577e2b);}})[_0xd3a9('0x23')](function(_0x42a8d5){if(_0x42a8d5){_0x3b72be=_0x42a8d5[_0xd3a9('0x35')];if(!_0x16f915[_0xd3a9('0x30')][_0xd3a9('0x36')](_0xd3a9('0x37'))){_0x577e2b['limit']=qs[_0xd3a9('0x1d')](_0x16f915['query'][_0xd3a9('0x1d')]);_0x577e2b['offset']=qs['offset'](_0x16f915[_0xd3a9('0x30')][_0xd3a9('0x1b')]);}return _0x4087f2[_0xd3a9('0x4d')](_0x577e2b);}})[_0xd3a9('0x23')](function(_0x2ebcbd){if(_0x2ebcbd){return _0x2ebcbd?{'count':_0x3b72be,'rows':_0x2ebcbd}:null;}})[_0xd3a9('0x23')](respondWithResult(_0x15bbaa,null))[_0xd3a9('0x45')](handleError(_0x15bbaa,null));};exports[_0xd3a9('0x4f')]=function(_0x270c09,_0xd1c3cb,_0x47993b){var _0x46de3a={};var _0xbe4ae7={};var _0x21ad50;var _0x4fba73;return db[_0xd3a9('0x41')][_0xd3a9('0x4c')]({'where':{'id':_0x270c09[_0xd3a9('0x4a')]['id']}})[_0xd3a9('0x23')](handleEntityNotFound(_0xd1c3cb,null))[_0xd3a9('0x23')](function(_0x450146){if(_0x450146){_0x21ad50=_0x450146;_0xbe4ae7['model']=_['keys'](db[_0xd3a9('0x4e')][_0xd3a9('0x2b')]);_0xbe4ae7[_0xd3a9('0x30')]=_[_0xd3a9('0x31')](_0x270c09[_0xd3a9('0x30')]);_0xbe4ae7['filters']=_[_0xd3a9('0x32')](_0xbe4ae7[_0xd3a9('0x2f')],_0xbe4ae7['query']);_0x46de3a[_0xd3a9('0x33')]=_[_0xd3a9('0x32')](_0xbe4ae7[_0xd3a9('0x2f')],qs[_0xd3a9('0x34')](_0x270c09[_0xd3a9('0x30')][_0xd3a9('0x34')]));_0x46de3a[_0xd3a9('0x33')]=_0x46de3a[_0xd3a9('0x33')][_0xd3a9('0x35')]?_0x46de3a[_0xd3a9('0x33')]:_0xbe4ae7['model'];_0x46de3a[_0xd3a9('0x38')]=qs['sort'](_0x270c09[_0xd3a9('0x30')][_0xd3a9('0x39')]);_0x46de3a[_0xd3a9('0x3a')]=qs['filters'](_[_0xd3a9('0x3b')](_0x270c09[_0xd3a9('0x30')],_0xbe4ae7[_0xd3a9('0x3c')]));if(_0x270c09[_0xd3a9('0x30')][_0xd3a9('0x3d')]){_0x46de3a[_0xd3a9('0x3a')]=_['merge'](_0x46de3a[_0xd3a9('0x3a')],{'$or':_[_0xd3a9('0x2a')](_0x46de3a[_0xd3a9('0x33')],function(_0x3ec44e){var _0x5edafe={};_0x5edafe[_0x3ec44e]={'$like':'%'+_0x270c09[_0xd3a9('0x30')]['filter']+'%'};return _0x5edafe;})});}_0x46de3a=_[_0xd3a9('0x3f')]({},_0x46de3a,_0x270c09[_0xd3a9('0x40')]);return _0x21ad50[_0xd3a9('0x4f')](_0x46de3a);}})[_0xd3a9('0x23')](function(_0x4ec1ec){if(_0x4ec1ec){_0x4fba73=_0x4ec1ec[_0xd3a9('0x35')];if(!_0x270c09[_0xd3a9('0x30')][_0xd3a9('0x36')](_0xd3a9('0x37'))){_0x46de3a[_0xd3a9('0x1d')]=qs[_0xd3a9('0x1d')](_0x270c09[_0xd3a9('0x30')]['limit']);_0x46de3a['offset']=qs[_0xd3a9('0x1b')](_0x270c09[_0xd3a9('0x30')]['offset']);}return _0x21ad50[_0xd3a9('0x4f')](_0x46de3a);}})['then'](function(_0x1b6690){if(_0x1b6690){return _0x1b6690?{'count':_0x4fba73,'rows':_0x1b6690}:null;}})['then'](respondWithResult(_0xd1c3cb,null))['catch'](handleError(_0xd1c3cb,null));};exports[_0xd3a9('0x50')]=function(_0x12d76f,_0x29efd8,_0x36a347){var _0x17f617={};var _0x4904d5={};var _0x2e466e;var _0x5c3868;return db['ZendeskConfiguration'][_0xd3a9('0x4c')]({'where':{'id':_0x12d76f['params']['id']}})[_0xd3a9('0x23')](handleEntityNotFound(_0x29efd8,null))[_0xd3a9('0x23')](function(_0x3e61ca){if(_0x3e61ca){_0x2e466e=_0x3e61ca;_0x4904d5[_0xd3a9('0x2f')]=_[_0xd3a9('0x31')](db[_0xd3a9('0x51')][_0xd3a9('0x2b')]);_0x4904d5[_0xd3a9('0x30')]=_[_0xd3a9('0x31')](_0x12d76f['query']);_0x4904d5[_0xd3a9('0x3c')]=_[_0xd3a9('0x32')](_0x4904d5[_0xd3a9('0x2f')],_0x4904d5[_0xd3a9('0x30')]);_0x17f617[_0xd3a9('0x33')]=_[_0xd3a9('0x32')](_0x4904d5[_0xd3a9('0x2f')],qs[_0xd3a9('0x34')](_0x12d76f[_0xd3a9('0x30')][_0xd3a9('0x34')]));_0x17f617[_0xd3a9('0x33')]=_0x17f617[_0xd3a9('0x33')]['length']?_0x17f617['attributes']:_0x4904d5['model'];_0x17f617[_0xd3a9('0x38')]=qs['sort'](_0x12d76f[_0xd3a9('0x30')][_0xd3a9('0x39')]);_0x17f617['where']=qs[_0xd3a9('0x3c')](_[_0xd3a9('0x3b')](_0x12d76f['query'],_0x4904d5['filters']));if(_0x12d76f[_0xd3a9('0x30')]['filter']){_0x17f617[_0xd3a9('0x3a')]=_[_0xd3a9('0x3f')](_0x17f617['where'],{'$or':_['map'](_0x17f617['attributes'],function(_0x65578e){var _0x507e47={};_0x507e47[_0x65578e]={'$like':'%'+_0x12d76f[_0xd3a9('0x30')][_0xd3a9('0x3d')]+'%'};return _0x507e47;})});}_0x17f617=_['merge']({},_0x17f617,_0x12d76f['options']);return _0x2e466e['getTags'](_0x17f617);}})[_0xd3a9('0x23')](function(_0x5811d4){if(_0x5811d4){_0x5c3868=_0x5811d4[_0xd3a9('0x35')];if(!_0x12d76f[_0xd3a9('0x30')]['hasOwnProperty'](_0xd3a9('0x37'))){_0x17f617[_0xd3a9('0x1d')]=qs[_0xd3a9('0x1d')](_0x12d76f[_0xd3a9('0x30')]['limit']);_0x17f617['offset']=qs[_0xd3a9('0x1b')](_0x12d76f[_0xd3a9('0x30')][_0xd3a9('0x1b')]);}return _0x2e466e['getTags'](_0x17f617);}})[_0xd3a9('0x23')](function(_0x5e94da){if(_0x5e94da){return _0x5e94da?{'count':_0x5c3868,'rows':_0x5e94da}:null;}})[_0xd3a9('0x23')](respondWithResult(_0x29efd8,null))[_0xd3a9('0x45')](handleError(_0x29efd8,null));};exports['setTags']=function(_0x519a68,_0x3381f4,_0x4d8dd3){if(_0x519a68['body']['id']){delete _0x519a68[_0xd3a9('0x49')]['id'];}return db[_0xd3a9('0x41')]['findOne']({'where':{'id':_0x519a68[_0xd3a9('0x4a')]['id']}})[_0xd3a9('0x23')](handleEntityNotFound(_0x3381f4,null))[_0xd3a9('0x23')](function(_0x49d233){if(_0x49d233){return _0x49d233['setTags'](_0x519a68[_0xd3a9('0x49')][_0xd3a9('0x52')]||[]);}return null;})[_0xd3a9('0x23')](respondWithResult(_0x3381f4,null))['catch'](handleError(_0x3381f4,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 3eb3fec..409d016 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 _0x5f66=['request-promise','path','../../config/environment','exports','ZendeskConfiguration','int_zendesk_configurations','util','api','moment','bluebird'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x5f66,0x1a0));var _0x65f6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x5f66[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var logger=require('../../config/logger')(_0x65f6('0x1'));var moment=require(_0x65f6('0x2'));var BPromise=require(_0x65f6('0x3'));var rp=require(_0x65f6('0x4'));var fs=require('fs');var path=require(_0x65f6('0x5'));var rimraf=require('rimraf');var config=require(_0x65f6('0x6'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x65f6('0x7')]=function(_0x22b017,_0x4ec221){return _0x22b017['define'](_0x65f6('0x8'),attributes,{'tableName':_0x65f6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x93e9=['moment','bluebird','request-promise','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api'];(function(_0x3bf00b,_0x12d037){var _0x42f473=function(_0x19baa8){while(--_0x19baa8){_0x3bf00b['push'](_0x3bf00b['shift']());}};_0x42f473(++_0x12d037);}(_0x93e9,0xcc));var _0x993e=function(_0x580c96,_0x2d89ee){_0x580c96=_0x580c96-0x0;var _0x532ae6=_0x93e9[_0x580c96];return _0x532ae6;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var logger=require(_0x993e('0x2'))(_0x993e('0x3'));var moment=require(_0x993e('0x4'));var BPromise=require(_0x993e('0x5'));var rp=require(_0x993e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x993e('0x7'));var attributes=require(_0x993e('0x8'));module[_0x993e('0x9')]=function(_0x45f52e,_0x1da414){return _0x45f52e[_0x993e('0xa')](_0x993e('0xb'),attributes,{'tableName':_0x993e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 53da611..ef0498e 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 _0x9070=['../../config/utils','jayson/promise','client','http','request','then','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x5cf7a0,_0x161233){var _0x5d2152=function(_0x5a6b92){while(--_0x5a6b92){_0x5cf7a0['push'](_0x5cf7a0['shift']());}};_0x5d2152(++_0x161233);}(_0x9070,0x8e));var _0x0907=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x9070[_0x3fba9f];return _0x192cf1;};'use strict';var _=require('lodash');var util=require(_0x0907('0x0'));var moment=require(_0x0907('0x1'));var BPromise=require(_0x0907('0x2'));var rs=require(_0x0907('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0907('0x4'))['db'];var utils=require(_0x0907('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0907('0x6'));var client=jayson[_0x0907('0x7')][_0x0907('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5aec4d,_0x3a41e0,_0xcb352){return new BPromise(function(_0x1dea83,_0x1e6270){return client[_0x0907('0x9')](_0x5aec4d,_0xcb352)[_0x0907('0xa')](function(_0x5249da){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x3a41e0,'request\x20sent');logger[_0x0907('0xb')](_0x0907('0xc'),_0x3a41e0,_0x0907('0xd'),JSON['stringify'](_0x5249da));if(_0x5249da['error']){if(_0x5249da[_0x0907('0xe')][_0x0907('0xf')]===0x1f4){logger['error'](_0x0907('0x10'),_0x3a41e0,_0x5249da['error'][_0x0907('0x11')]);return _0x1e6270(_0x5249da[_0x0907('0xe')][_0x0907('0x11')]);}logger['error'](_0x0907('0x10'),_0x3a41e0,_0x5249da[_0x0907('0xe')][_0x0907('0x11')]);return _0x1dea83(_0x5249da[_0x0907('0xe')]['message']);}else{logger[_0x0907('0x12')](_0x0907('0x10'),_0x3a41e0,_0x0907('0xd'));_0x1dea83(_0x5249da[_0x0907('0x13')]['message']);}})[_0x0907('0x14')](function(_0x56ee5f){logger[_0x0907('0xe')](_0x0907('0x10'),_0x3a41e0,_0x56ee5f);_0x1e6270(_0x56ee5f);});});} \ No newline at end of file +var _0xdd05=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','client','http','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x14816b,_0x454721){var _0x43516a=function(_0x21091e){while(--_0x21091e){_0x14816b['push'](_0x14816b['shift']());}};_0x43516a(++_0x454721);}(_0xdd05,0x192));var _0x5dd0=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xdd05[_0x424a9a];return _0xa7831c;};'use strict';var _=require(_0x5dd0('0x0'));var util=require(_0x5dd0('0x1'));var moment=require(_0x5dd0('0x2'));var BPromise=require(_0x5dd0('0x3'));var rs=require(_0x5dd0('0x4'));var fs=require('fs');var Redis=require(_0x5dd0('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5dd0('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5dd0('0x7')][_0x5dd0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45fbf7,_0x46796d,_0x10dc26){return new BPromise(function(_0x46b8ab,_0xde5129){return client['request'](_0x45fbf7,_0x10dc26)[_0x5dd0('0x9')](function(_0x101de4){logger[_0x5dd0('0xa')](_0x5dd0('0xb'),_0x46796d,'request\x20sent');logger[_0x5dd0('0xc')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x46796d,_0x5dd0('0xd'),JSON[_0x5dd0('0xe')](_0x101de4));if(_0x101de4[_0x5dd0('0xf')]){if(_0x101de4[_0x5dd0('0xf')][_0x5dd0('0x10')]===0x1f4){logger[_0x5dd0('0xf')](_0x5dd0('0xb'),_0x46796d,_0x101de4[_0x5dd0('0xf')][_0x5dd0('0x11')]);return _0xde5129(_0x101de4[_0x5dd0('0xf')][_0x5dd0('0x11')]);}logger[_0x5dd0('0xf')](_0x5dd0('0xb'),_0x46796d,_0x101de4[_0x5dd0('0xf')]['message']);return _0x46b8ab(_0x101de4[_0x5dd0('0xf')][_0x5dd0('0x11')]);}else{logger[_0x5dd0('0xa')](_0x5dd0('0xb'),_0x46796d,_0x5dd0('0xd'));_0x46b8ab(_0x101de4[_0x5dd0('0x12')]['message']);}})[_0x5dd0('0x13')](function(_0x37fc22){logger['error'](_0x5dd0('0xb'),_0x46796d,_0x37fc22);_0xde5129(_0x37fc22);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index a3de93c..5b69506 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 _0xf18c=['/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','show','post','create','put'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xf18c,0x136));var _0xcf18=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xf18c[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require(_0xcf18('0x0'));var util=require(_0xcf18('0x1'));var path=require(_0xcf18('0x2'));var timeout=require(_0xcf18('0x3'));var express=require(_0xcf18('0x4'));var router=express[_0xcf18('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcf18('0x6'));var controller=require('./intZendeskField.controller');router[_0xcf18('0x7')]('/',auth[_0xcf18('0x8')](),controller[_0xcf18('0x9')]);router[_0xcf18('0x7')]('/:id',auth[_0xcf18('0x8')](),controller[_0xcf18('0xa')]);router[_0xcf18('0xb')]('/',auth[_0xcf18('0x8')](),controller[_0xcf18('0xc')]);router[_0xcf18('0xd')](_0xcf18('0xe'),auth[_0xcf18('0x8')](),controller['update']);router[_0xcf18('0xf')](_0xcf18('0xe'),auth[_0xcf18('0x8')](),controller[_0xcf18('0x10')]);module[_0xcf18('0x11')]=router; \ No newline at end of file +var _0x17cb=['delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','create','put'];(function(_0xe17399,_0x42b7b4){var _0x208a1d=function(_0xb97c08){while(--_0xb97c08){_0xe17399['push'](_0xe17399['shift']());}};_0x208a1d(++_0x42b7b4);}(_0x17cb,0xd2));var _0xb17c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x17cb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xb17c('0x0'));var path=require(_0xb17c('0x1'));var timeout=require(_0xb17c('0x2'));var express=require(_0xb17c('0x3'));var router=express[_0xb17c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb17c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb17c('0x6'));var controller=require(_0xb17c('0x7'));router[_0xb17c('0x8')]('/',auth[_0xb17c('0x9')](),controller[_0xb17c('0xa')]);router[_0xb17c('0x8')](_0xb17c('0xb'),auth[_0xb17c('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xb17c('0xc')]);router[_0xb17c('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb17c('0xe')](_0xb17c('0xb'),auth[_0xb17c('0x9')](),controller['destroy']);module[_0xb17c('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index fdb30a8..599b582 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 _0x52ea=['customVariable','STRING','BOOLEAN','sequelize','ENUM','string','variable'];(function(_0x44f5da,_0xfa0c16){var _0x3df906=function(_0xd1a42b){while(--_0xd1a42b){_0x44f5da['push'](_0x44f5da['shift']());}};_0x3df906(++_0xfa0c16);}(_0x52ea,0x14c));var _0xa52e=function(_0x49944a,_0x1a3723){_0x49944a=_0x49944a-0x0;var _0x2567fc=_0x52ea[_0x49944a];return _0x2567fc;};'use strict';var Sequelize=require(_0xa52e('0x0'));module['exports']={'type':{'type':Sequelize[_0xa52e('0x1')](_0xa52e('0x2'),_0xa52e('0x3'),_0xa52e('0x4'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xa52e('0x5')]},'key':{'type':Sequelize[_0xa52e('0x5')]},'keyType':{'type':Sequelize[_0xa52e('0x1')](_0xa52e('0x2'),_0xa52e('0x3'),_0xa52e('0x4'))},'keyContent':{'type':Sequelize[_0xa52e('0x5')]},'idField':{'type':Sequelize[_0xa52e('0x5')]},'nameField':{'type':Sequelize[_0xa52e('0x5')]},'customField':{'type':Sequelize[_0xa52e('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa52e('0x5')]}}; \ No newline at end of file +var _0x9c74=['ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x32a94c,_0x29f028){var _0x1841ae=function(_0x3813fa){while(--_0x3813fa){_0x32a94c['push'](_0x32a94c['shift']());}};_0x1841ae(++_0x29f028);}(_0x9c74,0x127));var _0x49c7=function(_0x442dcb,_0x179c35){_0x442dcb=_0x442dcb-0x0;var _0x593554=_0x9c74[_0x442dcb];return _0x593554;};'use strict';var Sequelize=require(_0x49c7('0x0'));module[_0x49c7('0x1')]={'type':{'type':Sequelize[_0x49c7('0x2')](_0x49c7('0x3'),_0x49c7('0x4'),_0x49c7('0x5'),'keyValue',_0x49c7('0x6')),'defaultValue':_0x49c7('0x3')},'content':{'type':Sequelize[_0x49c7('0x7')]},'key':{'type':Sequelize[_0x49c7('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x49c7('0x3'),_0x49c7('0x4'),_0x49c7('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x49c7('0x7')]},'customField':{'type':Sequelize[_0x49c7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x49c7('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index a51e38d..4bab8b4 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 _0x2365=['status','end','limit','undefined','offset','count','set','Content-Range','reject','save','then','error','stack','name','send','index','ZendeskField','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','filter','where','map','merge','options','includeAll','include','rows','catch','show','params','keys','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','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','../../mysqldb','sendStatus'];(function(_0x3137ba,_0x52b605){var _0x3fe3e4=function(_0x233f1b){while(--_0x233f1b){_0x3137ba['push'](_0x3137ba['shift']());}};_0x3fe3e4(++_0x52b605);}(_0x2365,0x111));var _0x5236=function(_0x38a2aa,_0x529fc7){_0x38a2aa=_0x38a2aa-0x0;var _0x3e0e20=_0x2365[_0x38a2aa];return _0x3e0e20;};'use strict';var emlformat=require(_0x5236('0x0'));var rimraf=require(_0x5236('0x1'));var zipdir=require(_0x5236('0x2'));var jsonpatch=require(_0x5236('0x3'));var rp=require(_0x5236('0x4'));var moment=require(_0x5236('0x5'));var BPromise=require(_0x5236('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5236('0x7'));var sox=require('sox');var csv=require(_0x5236('0x8'));var ejs=require(_0x5236('0x9'));var fs=require('fs');var fs_extra=require(_0x5236('0xa'));var _=require(_0x5236('0xb'));var squel=require(_0x5236('0xc'));var crypto=require('crypto');var jsforce=require(_0x5236('0xd'));var deskjs=require(_0x5236('0xe'));var toCsv=require(_0x5236('0x8'));var querystring=require(_0x5236('0xf'));var Papa=require(_0x5236('0x10'));var Redis=require(_0x5236('0x11'));var authService=require(_0x5236('0x12'));var qs=require(_0x5236('0x13'));var as=require(_0x5236('0x14'));var hardwareService=require(_0x5236('0x15'));var logger=require(_0x5236('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x5236('0x17'));var licenseUtil=require(_0x5236('0x18'));var db=require(_0x5236('0x19'))['db'];function respondWithStatusCode(_0x568b73,_0x1ccdb4){_0x1ccdb4=_0x1ccdb4||0xcc;return function(_0x51c1a0){if(_0x51c1a0){return _0x568b73[_0x5236('0x1a')](_0x1ccdb4);}return _0x568b73[_0x5236('0x1b')](_0x1ccdb4)[_0x5236('0x1c')]();};}function respondWithResult(_0x3deb96,_0x43c59d){_0x43c59d=_0x43c59d||0xc8;return function(_0x54d534){if(_0x54d534){return _0x3deb96[_0x5236('0x1b')](_0x43c59d)['json'](_0x54d534);}};}function respondWithFilteredResult(_0x2f9eaa,_0x5e1640){return function(_0x3b7cf3){if(_0x3b7cf3){var _0x1e1ef4=typeof _0x5e1640['offset']==='undefined'&&typeof _0x5e1640[_0x5236('0x1d')]===_0x5236('0x1e');var _0x4d5767=_0x3b7cf3['count'];var _0x1e0078=_0x1e1ef4?0x0:_0x5e1640[_0x5236('0x1f')];var _0x40475c=_0x1e1ef4?_0x3b7cf3[_0x5236('0x20')]:_0x5e1640[_0x5236('0x1f')]+_0x5e1640[_0x5236('0x1d')];var _0x395836;if(_0x40475c>=_0x4d5767){_0x40475c=_0x4d5767;_0x395836=0xc8;}else{_0x395836=0xce;}_0x2f9eaa[_0x5236('0x1b')](_0x395836);return _0x2f9eaa[_0x5236('0x21')](_0x5236('0x22'),_0x1e0078+'-'+_0x40475c+'/'+_0x4d5767)['json'](_0x3b7cf3);}return null;};}function patchUpdates(_0x9c6ca8){return function(_0x16b590){try{jsonpatch['apply'](_0x16b590,_0x9c6ca8,!![]);}catch(_0x431b86){return BPromise[_0x5236('0x23')](_0x431b86);}return _0x16b590[_0x5236('0x24')]();};}function saveUpdates(_0x21741d,_0x240a82){return function(_0x2f360b){if(_0x2f360b){return _0x2f360b['update'](_0x21741d)['then'](function(_0x3668a7){return _0x3668a7;});}return null;};}function removeEntity(_0x21c9c6,_0x3fc70a){return function(_0xc5f8c7){if(_0xc5f8c7){return _0xc5f8c7['destroy']()[_0x5236('0x25')](function(){_0x21c9c6[_0x5236('0x1b')](0xcc)[_0x5236('0x1c')]();});}};}function handleEntityNotFound(_0x12236d,_0x202e64){return function(_0x230ca1){if(!_0x230ca1){_0x12236d['sendStatus'](0x194);}return _0x230ca1;};}function handleError(_0x4337dd,_0x24de20){_0x24de20=_0x24de20||0x1f4;return function(_0x2ebf62){logger[_0x5236('0x26')](_0x2ebf62[_0x5236('0x27')]);if(_0x2ebf62[_0x5236('0x28')]){delete _0x2ebf62[_0x5236('0x28')];}_0x4337dd[_0x5236('0x1b')](_0x24de20)[_0x5236('0x29')](_0x2ebf62);};}exports[_0x5236('0x2a')]=function(_0x4c66e9,_0x569bda){var _0x52b963={},_0x5e02d9={},_0x2a7667={'count':0x0,'rows':[]};var _0x299e18=_['map'](db[_0x5236('0x2b')][_0x5236('0x2c')],function(_0x388351){return{'name':_0x388351[_0x5236('0x2d')],'type':_0x388351[_0x5236('0x2e')][_0x5236('0x2f')]};});_0x5e02d9[_0x5236('0x30')]=_['map'](_0x299e18,_0x5236('0x28'));_0x5e02d9[_0x5236('0x31')]=_['keys'](_0x4c66e9['query']);_0x5e02d9['filters']=_['intersection'](_0x5e02d9[_0x5236('0x30')],_0x5e02d9['query']);_0x52b963[_0x5236('0x32')]=_[_0x5236('0x33')](_0x5e02d9[_0x5236('0x30')],qs[_0x5236('0x34')](_0x4c66e9[_0x5236('0x31')]['fields']));_0x52b963[_0x5236('0x32')]=_0x52b963[_0x5236('0x32')][_0x5236('0x35')]?_0x52b963[_0x5236('0x32')]:_0x5e02d9[_0x5236('0x30')];if(!_0x4c66e9[_0x5236('0x31')]['hasOwnProperty'](_0x5236('0x36'))){_0x52b963[_0x5236('0x1d')]=qs[_0x5236('0x1d')](_0x4c66e9[_0x5236('0x31')][_0x5236('0x1d')]);_0x52b963[_0x5236('0x1f')]=qs[_0x5236('0x1f')](_0x4c66e9[_0x5236('0x31')][_0x5236('0x1f')]);}_0x52b963[_0x5236('0x37')]=qs[_0x5236('0x38')](_0x4c66e9[_0x5236('0x31')][_0x5236('0x38')]);_0x52b963['where']=qs[_0x5236('0x39')](_[_0x5236('0x3a')](_0x4c66e9['query'],_0x5e02d9[_0x5236('0x39')]),_0x299e18);if(_0x4c66e9[_0x5236('0x31')][_0x5236('0x3b')]){_0x52b963[_0x5236('0x3c')]=_['merge'](_0x52b963[_0x5236('0x3c')],{'$or':_[_0x5236('0x3d')](_0x299e18,function(_0x26cb23){if(_0x26cb23[_0x5236('0x2e')]!=='VIRTUAL'){var _0x5e7c1e={};_0x5e7c1e[_0x26cb23[_0x5236('0x28')]]={'$like':'%'+_0x4c66e9[_0x5236('0x31')][_0x5236('0x3b')]+'%'};return _0x5e7c1e;}})});}_0x52b963=_[_0x5236('0x3e')]({},_0x52b963,_0x4c66e9[_0x5236('0x3f')]);var _0x3b4fba={'where':_0x52b963['where']};return db[_0x5236('0x2b')][_0x5236('0x20')](_0x3b4fba)['then'](function(_0xbe7211){_0x2a7667[_0x5236('0x20')]=_0xbe7211;if(_0x4c66e9[_0x5236('0x31')][_0x5236('0x40')]){_0x52b963[_0x5236('0x41')]=[{'all':!![]}];}return db[_0x5236('0x2b')]['findAll'](_0x52b963);})[_0x5236('0x25')](function(_0x257741){_0x2a7667[_0x5236('0x42')]=_0x257741;return _0x2a7667;})['then'](respondWithFilteredResult(_0x569bda,_0x52b963))[_0x5236('0x43')](handleError(_0x569bda,null));};exports[_0x5236('0x44')]=function(_0xbf0b60,_0x4b9ec9){var _0x206159={'raw':!![],'where':{'id':_0xbf0b60[_0x5236('0x45')]['id']}},_0x155f6b={};_0x155f6b[_0x5236('0x30')]=_[_0x5236('0x46')](db['ZendeskField']['rawAttributes']);_0x155f6b[_0x5236('0x31')]=_[_0x5236('0x46')](_0xbf0b60[_0x5236('0x31')]);_0x155f6b['filters']=_['intersection'](_0x155f6b[_0x5236('0x30')],_0x155f6b[_0x5236('0x31')]);_0x206159['attributes']=_[_0x5236('0x33')](_0x155f6b['model'],qs[_0x5236('0x34')](_0xbf0b60[_0x5236('0x31')][_0x5236('0x34')]));_0x206159[_0x5236('0x32')]=_0x206159[_0x5236('0x32')][_0x5236('0x35')]?_0x206159['attributes']:_0x155f6b[_0x5236('0x30')];if(_0xbf0b60[_0x5236('0x31')][_0x5236('0x40')]){_0x206159[_0x5236('0x41')]=[{'all':!![]}];}_0x206159=_[_0x5236('0x3e')]({},_0x206159,_0xbf0b60[_0x5236('0x3f')]);return db[_0x5236('0x2b')][_0x5236('0x47')](_0x206159)[_0x5236('0x25')](handleEntityNotFound(_0x4b9ec9,null))[_0x5236('0x25')](respondWithResult(_0x4b9ec9,null))[_0x5236('0x43')](handleError(_0x4b9ec9,null));};exports[_0x5236('0x48')]=function(_0x297997,_0x185d31){return db[_0x5236('0x2b')]['create'](_0x297997[_0x5236('0x49')],{})['then'](respondWithResult(_0x185d31,0xc9))[_0x5236('0x43')](handleError(_0x185d31,null));};exports['update']=function(_0x7ba57,_0x5b1f61){if(_0x7ba57['body']['id']){delete _0x7ba57[_0x5236('0x49')]['id'];}return db[_0x5236('0x2b')][_0x5236('0x47')]({'where':{'id':_0x7ba57[_0x5236('0x45')]['id']}})[_0x5236('0x25')](handleEntityNotFound(_0x5b1f61,null))[_0x5236('0x25')](saveUpdates(_0x7ba57['body'],null))['then'](respondWithResult(_0x5b1f61,null))[_0x5236('0x43')](handleError(_0x5b1f61,null));};exports[_0x5236('0x4a')]=function(_0x373584,_0x430992){return db[_0x5236('0x2b')][_0x5236('0x47')]({'where':{'id':_0x373584['params']['id']}})[_0x5236('0x25')](handleEntityNotFound(_0x430992,null))[_0x5236('0x25')](removeEntity(_0x430992,null))['catch'](handleError(_0x430992,null));}; \ No newline at end of file +var _0x4899=['query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','merge','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','ZendeskField','rawAttributes','type','key','model','map'];(function(_0x317744,_0x5ae1c3){var _0x2b8fcc=function(_0xbdd448){while(--_0xbdd448){_0x317744['push'](_0x317744['shift']());}};_0x2b8fcc(++_0x5ae1c3);}(_0x4899,0x142));var _0x9489=function(_0x1387c4,_0x4d9cb5){_0x1387c4=_0x1387c4-0x0;var _0x783cbb=_0x4899[_0x1387c4];return _0x783cbb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9489('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9489('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9489('0x2'));var Mustache=require(_0x9489('0x3'));var util=require(_0x9489('0x4'));var path=require(_0x9489('0x5'));var sox=require(_0x9489('0x6'));var csv=require('to-csv');var ejs=require(_0x9489('0x7'));var fs=require('fs');var fs_extra=require(_0x9489('0x8'));var _=require(_0x9489('0x9'));var squel=require(_0x9489('0xa'));var crypto=require(_0x9489('0xb'));var jsforce=require(_0x9489('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9489('0xd'));var Papa=require(_0x9489('0xe'));var Redis=require(_0x9489('0xf'));var authService=require(_0x9489('0x10'));var qs=require(_0x9489('0x11'));var as=require(_0x9489('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9489('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x9489('0x14'));var licenseUtil=require(_0x9489('0x15'));var db=require(_0x9489('0x16'))['db'];function respondWithStatusCode(_0x37f02e,_0x2a28a2){_0x2a28a2=_0x2a28a2||0xcc;return function(_0x42a236){if(_0x42a236){return _0x37f02e[_0x9489('0x17')](_0x2a28a2);}return _0x37f02e[_0x9489('0x18')](_0x2a28a2)[_0x9489('0x19')]();};}function respondWithResult(_0x2b4e63,_0x46e3ec){_0x46e3ec=_0x46e3ec||0xc8;return function(_0x35d043){if(_0x35d043){return _0x2b4e63[_0x9489('0x18')](_0x46e3ec)[_0x9489('0x1a')](_0x35d043);}};}function respondWithFilteredResult(_0x2c88be,_0x52e975){return function(_0x38921c){if(_0x38921c){var _0x192f58=typeof _0x52e975['offset']===_0x9489('0x1b')&&typeof _0x52e975[_0x9489('0x1c')]===_0x9489('0x1b');var _0x57b55d=_0x38921c[_0x9489('0x1d')];var _0xef4bf8=_0x192f58?0x0:_0x52e975[_0x9489('0x1e')];var _0x1eb693=_0x192f58?_0x38921c[_0x9489('0x1d')]:_0x52e975[_0x9489('0x1e')]+_0x52e975[_0x9489('0x1c')];var _0x33906b;if(_0x1eb693>=_0x57b55d){_0x1eb693=_0x57b55d;_0x33906b=0xc8;}else{_0x33906b=0xce;}_0x2c88be[_0x9489('0x18')](_0x33906b);return _0x2c88be['set'](_0x9489('0x1f'),_0xef4bf8+'-'+_0x1eb693+'/'+_0x57b55d)[_0x9489('0x1a')](_0x38921c);}return null;};}function patchUpdates(_0x4644a8){return function(_0x36e536){try{jsonpatch[_0x9489('0x20')](_0x36e536,_0x4644a8,!![]);}catch(_0x49c18e){return BPromise[_0x9489('0x21')](_0x49c18e);}return _0x36e536['save']();};}function saveUpdates(_0x280ec8,_0x554bea){return function(_0x569fbc){if(_0x569fbc){return _0x569fbc[_0x9489('0x22')](_0x280ec8)[_0x9489('0x23')](function(_0x1b9e86){return _0x1b9e86;});}return null;};}function removeEntity(_0x14c3ae,_0x45fb3c){return function(_0x5c4363){if(_0x5c4363){return _0x5c4363[_0x9489('0x24')]()['then'](function(){_0x14c3ae[_0x9489('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e5983,_0x1ac1fb){return function(_0x1ac5f8){if(!_0x1ac5f8){_0x4e5983['sendStatus'](0x194);}return _0x1ac5f8;};}function handleError(_0x28237e,_0xecebed){_0xecebed=_0xecebed||0x1f4;return function(_0x32e33e){logger[_0x9489('0x25')](_0x32e33e[_0x9489('0x26')]);if(_0x32e33e[_0x9489('0x27')]){delete _0x32e33e[_0x9489('0x27')];}_0x28237e[_0x9489('0x18')](_0xecebed)[_0x9489('0x28')](_0x32e33e);};}exports[_0x9489('0x29')]=function(_0x191dee,_0x1ecf15){var _0x3c7f5a={},_0x20e01b={},_0x2d6931={'count':0x0,'rows':[]};var _0x106b5f=_['map'](db[_0x9489('0x2a')][_0x9489('0x2b')],function(_0x5c10ea){return{'name':_0x5c10ea['fieldName'],'type':_0x5c10ea[_0x9489('0x2c')][_0x9489('0x2d')]};});_0x20e01b[_0x9489('0x2e')]=_[_0x9489('0x2f')](_0x106b5f,'name');_0x20e01b[_0x9489('0x30')]=_[_0x9489('0x31')](_0x191dee[_0x9489('0x30')]);_0x20e01b['filters']=_[_0x9489('0x32')](_0x20e01b[_0x9489('0x2e')],_0x20e01b[_0x9489('0x30')]);_0x3c7f5a[_0x9489('0x33')]=_['intersection'](_0x20e01b[_0x9489('0x2e')],qs[_0x9489('0x34')](_0x191dee[_0x9489('0x30')][_0x9489('0x34')]));_0x3c7f5a[_0x9489('0x33')]=_0x3c7f5a['attributes'][_0x9489('0x35')]?_0x3c7f5a[_0x9489('0x33')]:_0x20e01b[_0x9489('0x2e')];if(!_0x191dee[_0x9489('0x30')][_0x9489('0x36')](_0x9489('0x37'))){_0x3c7f5a['limit']=qs[_0x9489('0x1c')](_0x191dee['query'][_0x9489('0x1c')]);_0x3c7f5a['offset']=qs[_0x9489('0x1e')](_0x191dee[_0x9489('0x30')][_0x9489('0x1e')]);}_0x3c7f5a[_0x9489('0x38')]=qs['sort'](_0x191dee['query'][_0x9489('0x39')]);_0x3c7f5a['where']=qs['filters'](_[_0x9489('0x3a')](_0x191dee[_0x9489('0x30')],_0x20e01b[_0x9489('0x3b')]),_0x106b5f);if(_0x191dee[_0x9489('0x30')][_0x9489('0x3c')]){_0x3c7f5a['where']=_[_0x9489('0x3d')](_0x3c7f5a[_0x9489('0x3e')],{'$or':_[_0x9489('0x2f')](_0x106b5f,function(_0x5239c3){if(_0x5239c3[_0x9489('0x2c')]!==_0x9489('0x3f')){var _0x4a469c={};_0x4a469c[_0x5239c3[_0x9489('0x27')]]={'$like':'%'+_0x191dee[_0x9489('0x30')]['filter']+'%'};return _0x4a469c;}})});}_0x3c7f5a=_[_0x9489('0x3d')]({},_0x3c7f5a,_0x191dee[_0x9489('0x40')]);var _0xac2d11={'where':_0x3c7f5a[_0x9489('0x3e')]};return db[_0x9489('0x2a')][_0x9489('0x1d')](_0xac2d11)['then'](function(_0x46d3ba){_0x2d6931[_0x9489('0x1d')]=_0x46d3ba;if(_0x191dee[_0x9489('0x30')][_0x9489('0x41')]){_0x3c7f5a[_0x9489('0x42')]=[{'all':!![]}];}return db[_0x9489('0x2a')]['findAll'](_0x3c7f5a);})[_0x9489('0x23')](function(_0x2384e1){_0x2d6931[_0x9489('0x43')]=_0x2384e1;return _0x2d6931;})[_0x9489('0x23')](respondWithFilteredResult(_0x1ecf15,_0x3c7f5a))[_0x9489('0x44')](handleError(_0x1ecf15,null));};exports[_0x9489('0x45')]=function(_0x4bb36d,_0xa519f4){var _0xf2b578={'raw':!![],'where':{'id':_0x4bb36d[_0x9489('0x46')]['id']}},_0x37ed01={};_0x37ed01['model']=_[_0x9489('0x31')](db['ZendeskField'][_0x9489('0x2b')]);_0x37ed01[_0x9489('0x30')]=_['keys'](_0x4bb36d[_0x9489('0x30')]);_0x37ed01['filters']=_['intersection'](_0x37ed01[_0x9489('0x2e')],_0x37ed01[_0x9489('0x30')]);_0xf2b578[_0x9489('0x33')]=_[_0x9489('0x32')](_0x37ed01['model'],qs[_0x9489('0x34')](_0x4bb36d['query'][_0x9489('0x34')]));_0xf2b578[_0x9489('0x33')]=_0xf2b578[_0x9489('0x33')]['length']?_0xf2b578[_0x9489('0x33')]:_0x37ed01[_0x9489('0x2e')];if(_0x4bb36d[_0x9489('0x30')][_0x9489('0x41')]){_0xf2b578[_0x9489('0x42')]=[{'all':!![]}];}_0xf2b578=_[_0x9489('0x3d')]({},_0xf2b578,_0x4bb36d[_0x9489('0x40')]);return db[_0x9489('0x2a')][_0x9489('0x47')](_0xf2b578)[_0x9489('0x23')](handleEntityNotFound(_0xa519f4,null))[_0x9489('0x23')](respondWithResult(_0xa519f4,null))['catch'](handleError(_0xa519f4,null));};exports[_0x9489('0x48')]=function(_0x1637c4,_0x46f588){return db[_0x9489('0x2a')]['create'](_0x1637c4[_0x9489('0x49')],{})[_0x9489('0x23')](respondWithResult(_0x46f588,0xc9))[_0x9489('0x44')](handleError(_0x46f588,null));};exports['update']=function(_0x303e37,_0x19349a){if(_0x303e37[_0x9489('0x49')]['id']){delete _0x303e37[_0x9489('0x49')]['id'];}return db[_0x9489('0x2a')][_0x9489('0x47')]({'where':{'id':_0x303e37[_0x9489('0x46')]['id']}})[_0x9489('0x23')](handleEntityNotFound(_0x19349a,null))[_0x9489('0x23')](saveUpdates(_0x303e37[_0x9489('0x49')],null))['then'](respondWithResult(_0x19349a,null))[_0x9489('0x44')](handleError(_0x19349a,null));};exports[_0x9489('0x24')]=function(_0xa139c,_0x2670f1){return db[_0x9489('0x2a')][_0x9489('0x47')]({'where':{'id':_0xa139c[_0x9489('0x46')]['id']}})[_0x9489('0x23')](handleEntityNotFound(_0x2670f1,null))['then'](removeEntity(_0x2670f1,null))[_0x9489('0x44')](handleError(_0x2670f1,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 1737aea..4165fea 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 _0xb25d=['request-promise','rimraf','../../config/environment','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','../../config/logger','api','moment'];(function(_0x5466f3,_0x4a1f02){var _0x3a78fa=function(_0x238760){while(--_0x238760){_0x5466f3['push'](_0x5466f3['shift']());}};_0x3a78fa(++_0x4a1f02);}(_0xb25d,0x100));var _0xdb25=function(_0x30515c,_0x1164cc){_0x30515c=_0x30515c-0x0;var _0x39aab3=_0xb25d[_0x30515c];return _0x39aab3;};'use strict';var _=require(_0xdb25('0x0'));var util=require('util');var logger=require(_0xdb25('0x1'))(_0xdb25('0x2'));var moment=require(_0xdb25('0x3'));var BPromise=require('bluebird');var rp=require(_0xdb25('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdb25('0x5'));var config=require(_0xdb25('0x6'));var attributes=require('./intZendeskField.attributes');module['exports']=function(_0x14d2e7,_0x4b2db0){return _0x14d2e7[_0xdb25('0x7')](_0xdb25('0x8'),attributes,{'tableName':_0xdb25('0x9'),'paranoid':![],'indexes':[{'name':_0xdb25('0xa'),'fields':[_0xdb25('0xb'),_0xdb25('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4647=['int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField'];(function(_0x5025ba,_0x2ee68a){var _0x3e837a=function(_0xc21e86){while(--_0xc21e86){_0x5025ba['push'](_0x5025ba['shift']());}};_0x3e837a(++_0x2ee68a);}(_0x4647,0xd4));var _0x7464=function(_0x3e2ece,_0x130114){_0x3e2ece=_0x3e2ece-0x0;var _0x15d8c8=_0x4647[_0x3e2ece];return _0x15d8c8;};'use strict';var _=require(_0x7464('0x0'));var util=require('util');var logger=require(_0x7464('0x1'))(_0x7464('0x2'));var moment=require(_0x7464('0x3'));var BPromise=require(_0x7464('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7464('0x5'));var rimraf=require(_0x7464('0x6'));var config=require(_0x7464('0x7'));var attributes=require(_0x7464('0x8'));module[_0x7464('0x9')]=function(_0x4088bb,_0x4683c7){return _0x4088bb[_0x7464('0xa')](_0x7464('0xb'),attributes,{'tableName':_0x7464('0xc'),'paranoid':![],'indexes':[{'name':_0x7464('0xd'),'fields':[_0x7464('0xe'),_0x7464('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index bc4f345..fc22f54 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 _0xb1f7=['../../config/utils','../../config/logger','jayson/promise','http','request','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb1f7,0xe9));var _0x7b1f=function(_0x51e928,_0x5b207b){_0x51e928=_0x51e928-0x0;var _0x59615d=_0xb1f7[_0x51e928];return _0x59615d;};'use strict';var _=require(_0x7b1f('0x0'));var util=require(_0x7b1f('0x1'));var moment=require(_0x7b1f('0x2'));var BPromise=require(_0x7b1f('0x3'));var rs=require(_0x7b1f('0x4'));var fs=require('fs');var Redis=require(_0x7b1f('0x5'));var db=require(_0x7b1f('0x6'))['db'];var utils=require(_0x7b1f('0x7'));var logger=require(_0x7b1f('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7b1f('0x9'));var client=jayson['client'][_0x7b1f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5546b1,_0x4c0ced,_0x442b77){return new BPromise(function(_0x5eed47,_0x272a0d){return client[_0x7b1f('0xb')](_0x5546b1,_0x442b77)['then'](function(_0x5c6f96){logger['info'](_0x7b1f('0xc'),_0x4c0ced,_0x7b1f('0xd'));logger[_0x7b1f('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x4c0ced,_0x7b1f('0xd'),JSON['stringify'](_0x5c6f96));if(_0x5c6f96[_0x7b1f('0xf')]){if(_0x5c6f96['error'][_0x7b1f('0x10')]===0x1f4){logger[_0x7b1f('0xf')]('ZendeskField,\x20%s,\x20%s',_0x4c0ced,_0x5c6f96[_0x7b1f('0xf')][_0x7b1f('0x11')]);return _0x272a0d(_0x5c6f96[_0x7b1f('0xf')][_0x7b1f('0x11')]);}logger[_0x7b1f('0xf')](_0x7b1f('0xc'),_0x4c0ced,_0x5c6f96[_0x7b1f('0xf')][_0x7b1f('0x11')]);return _0x5eed47(_0x5c6f96['error'][_0x7b1f('0x11')]);}else{logger[_0x7b1f('0x12')](_0x7b1f('0xc'),_0x4c0ced,_0x7b1f('0xd'));_0x5eed47(_0x5c6f96['result'][_0x7b1f('0x11')]);}})[_0x7b1f('0x13')](function(_0x2de08f){logger[_0x7b1f('0xf')](_0x7b1f('0xc'),_0x4c0ced,_0x2de08f);_0x272a0d(_0x2de08f);});});} \ No newline at end of file +var _0x4afe=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ZendeskField,\x20%s,\x20%s','catch','lodash','util'];(function(_0x4e516d,_0x482c2f){var _0x4adae3=function(_0x28afb9){while(--_0x28afb9){_0x4e516d['push'](_0x4e516d['shift']());}};_0x4adae3(++_0x482c2f);}(_0x4afe,0x67));var _0xe4af=function(_0x35f6d8,_0x28581){_0x35f6d8=_0x35f6d8-0x0;var _0x3f3a77=_0x4afe[_0x35f6d8];return _0x3f3a77;};'use strict';var _=require(_0xe4af('0x0'));var util=require(_0xe4af('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe4af('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4af('0x3'))['db'];var utils=require(_0xe4af('0x4'));var logger=require('../../config/logger')(_0xe4af('0x5'));var config=require(_0xe4af('0x6'));var jayson=require(_0xe4af('0x7'));var client=jayson[_0xe4af('0x8')][_0xe4af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e0ccc,_0x551439,_0x354a5d){return new BPromise(function(_0x1f50a1,_0x4ca0c5){return client[_0xe4af('0xa')](_0x5e0ccc,_0x354a5d)[_0xe4af('0xb')](function(_0x1b4fca){logger[_0xe4af('0xc')]('ZendeskField,\x20%s,\x20%s',_0x551439,'request\x20sent');logger['debug'](_0xe4af('0xd'),_0x551439,_0xe4af('0xe'),JSON[_0xe4af('0xf')](_0x1b4fca));if(_0x1b4fca[_0xe4af('0x10')]){if(_0x1b4fca[_0xe4af('0x10')][_0xe4af('0x11')]===0x1f4){logger[_0xe4af('0x10')]('ZendeskField,\x20%s,\x20%s',_0x551439,_0x1b4fca['error'][_0xe4af('0x12')]);return _0x4ca0c5(_0x1b4fca[_0xe4af('0x10')][_0xe4af('0x12')]);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x551439,_0x1b4fca[_0xe4af('0x10')][_0xe4af('0x12')]);return _0x1f50a1(_0x1b4fca[_0xe4af('0x10')][_0xe4af('0x12')]);}else{logger[_0xe4af('0xc')](_0xe4af('0x13'),_0x551439,_0xe4af('0xe'));_0x1f50a1(_0x1b4fca['result'][_0xe4af('0x12')]);}})[_0xe4af('0x14')](function(_0x8d8c1c){logger[_0xe4af('0x10')](_0xe4af('0x13'),_0x551439,_0x8d8c1c);_0x4ca0c5(_0x8d8c1c);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 54045c2..b727896 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 _0x945e=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x945e,0x1ea));var _0xe945=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x945e[_0x5317b5];return _0x3b7ce2;};'use strict';var multer=require(_0xe945('0x0'));var util=require(_0xe945('0x1'));var path=require(_0xe945('0x2'));var timeout=require(_0xe945('0x3'));var express=require('express');var router=express[_0xe945('0x4')]();var fs_extra=require(_0xe945('0x5'));var auth=require(_0xe945('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe945('0x7'));var controller=require(_0xe945('0x8'));router[_0xe945('0x9')]('/',auth[_0xe945('0xa')](),controller[_0xe945('0xb')]);router['get'](_0xe945('0xc'),auth['isAuthenticated'](),controller[_0xe945('0xd')]);router[_0xe945('0x9')](_0xe945('0xe'),auth[_0xe945('0xa')](),controller[_0xe945('0xf')]);router['get'](_0xe945('0x10'),auth[_0xe945('0xa')](),controller[_0xe945('0x11')]);router[_0xe945('0x12')]('/',auth[_0xe945('0xa')](),controller[_0xe945('0x13')]);router[_0xe945('0x12')](_0xe945('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xe945('0x14')](_0xe945('0xc'),auth[_0xe945('0xa')](),controller['update']);router[_0xe945('0x15')](_0xe945('0xc'),auth['isAuthenticated'](),controller[_0xe945('0x16')]);module[_0xe945('0x17')]=router; \ No newline at end of file +var _0xfa8b=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','create','/:id/configurations','addConfiguration','put'];(function(_0x1e06ca,_0xd291f){var _0x34f498=function(_0x46a5c9){while(--_0x46a5c9){_0x1e06ca['push'](_0x1e06ca['shift']());}};_0x34f498(++_0xd291f);}(_0xfa8b,0xd3));var _0xbfa8=function(_0x4bae9c,_0x48594f){_0x4bae9c=_0x4bae9c-0x0;var _0x5c2f2e=_0xfa8b[_0x4bae9c];return _0x5c2f2e;};'use strict';var multer=require(_0xbfa8('0x0'));var util=require(_0xbfa8('0x1'));var path=require(_0xbfa8('0x2'));var timeout=require(_0xbfa8('0x3'));var express=require(_0xbfa8('0x4'));var router=express[_0xbfa8('0x5')]();var fs_extra=require(_0xbfa8('0x6'));var auth=require(_0xbfa8('0x7'));var interaction=require(_0xbfa8('0x8'));var config=require('../../config/environment');var controller=require(_0xbfa8('0x9'));router[_0xbfa8('0xa')]('/',auth[_0xbfa8('0xb')](),controller['index']);router[_0xbfa8('0xa')](_0xbfa8('0xc'),auth[_0xbfa8('0xb')](),controller[_0xbfa8('0xd')]);router[_0xbfa8('0xa')]('/:id/configurations',auth[_0xbfa8('0xb')](),controller[_0xbfa8('0xe')]);router[_0xbfa8('0xa')]('/:id/fields',auth[_0xbfa8('0xb')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0xbfa8('0xf')]);router['post'](_0xbfa8('0x10'),auth[_0xbfa8('0xb')](),controller[_0xbfa8('0x11')]);router[_0xbfa8('0x12')](_0xbfa8('0xc'),auth[_0xbfa8('0xb')](),controller[_0xbfa8('0x13')]);router[_0xbfa8('0x14')](_0xbfa8('0xc'),auth[_0xbfa8('0xb')](),controller[_0xbfa8('0x15')]);module[_0xbfa8('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 97830dc..f106027 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 _0x9f62=['exports','STRING'];(function(_0x1a8f7e,_0x3fc126){var _0x5248f7=function(_0x15ce34){while(--_0x15ce34){_0x1a8f7e['push'](_0x1a8f7e['shift']());}};_0x5248f7(++_0x3fc126);}(_0x9f62,0x154));var _0x29f6=function(_0x57a944,_0x3c73ed){_0x57a944=_0x57a944-0x0;var _0x5a3aa3=_0x9f62[_0x57a944];return _0x5a3aa3;};'use strict';var Sequelize=require('sequelize');module[_0x29f6('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x29f6('0x1')]},'host':{'type':Sequelize[_0x29f6('0x1')]},'zone':{'type':Sequelize[_0x29f6('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x29f6('0x1')]},'refreshToken':{'type':Sequelize[_0x29f6('0x1')]}}; \ No newline at end of file +var _0x34e8=['sequelize','exports','STRING'];(function(_0x9dca4c,_0xc09e49){var _0x4c8506=function(_0x8305bf){while(--_0x8305bf){_0x9dca4c['push'](_0x9dca4c['shift']());}};_0x4c8506(++_0xc09e49);}(_0x34e8,0x12c));var _0x834e=function(_0x3aff3f,_0x27af06){_0x3aff3f=_0x3aff3f-0x0;var _0x171738=_0x34e8[_0x3aff3f];return _0x171738;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')]},'description':{'type':Sequelize[_0x834e('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x834e('0x2')]},'clientId':{'type':Sequelize[_0x834e('0x2')]},'clientSecret':{'type':Sequelize[_0x834e('0x2')]},'serverUrl':{'type':Sequelize[_0x834e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x834e('0x2')]},'refreshToken':{'type':Sequelize[_0x834e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 4daa01e..25361b1 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 _0xf91a=['sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','ZohoAccount','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','keys','find','create','body','params','findOne','ZohoConfiguration','getConfigurations','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','getFields','host','serverUrl','code','slice','substring','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Subject','Description','WhoId','Call_Result','Call_Start_Time','remove','includes','api_name','system_mandatory','display_label','custom_field','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration'];(function(_0x2390ba,_0x2f84e6){var _0x294d55=function(_0x40ca42){while(--_0x40ca42){_0x2390ba['push'](_0x2390ba['shift']());}};_0x294d55(++_0x2f84e6);}(_0xf91a,0x68));var _0xaf91=function(_0xf5bbd3,_0xd5584d){_0xf5bbd3=_0xf5bbd3-0x0;var _0x171afa=_0xf91a[_0xf5bbd3];return _0x171afa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaf91('0x0'));var zipdir=require(_0xaf91('0x1'));var jsonpatch=require(_0xaf91('0x2'));var rp=require(_0xaf91('0x3'));var moment=require(_0xaf91('0x4'));var BPromise=require(_0xaf91('0x5'));var Mustache=require('mustache');var util=require(_0xaf91('0x6'));var path=require(_0xaf91('0x7'));var sox=require(_0xaf91('0x8'));var csv=require(_0xaf91('0x9'));var ejs=require(_0xaf91('0xa'));var fs=require('fs');var fs_extra=require(_0xaf91('0xb'));var _=require(_0xaf91('0xc'));var squel=require('squel');var crypto=require(_0xaf91('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaf91('0xe'));var toCsv=require(_0xaf91('0x9'));var querystring=require(_0xaf91('0xf'));var Papa=require('papaparse');var Redis=require(_0xaf91('0x10'));var authService=require(_0xaf91('0x11'));var qs=require(_0xaf91('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaf91('0x13'));var logger=require(_0xaf91('0x14'))(_0xaf91('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaf91('0x16'))['db'];var integrations=require(_0xaf91('0x17'));function respondWithStatusCode(_0x674fca,_0x10f37f){_0x10f37f=_0x10f37f||0xcc;return function(_0x1d8d35){if(_0x1d8d35){return _0x674fca[_0xaf91('0x18')](_0x10f37f);}return _0x674fca[_0xaf91('0x19')](_0x10f37f)[_0xaf91('0x1a')]();};}function respondWithResult(_0xaa9d78,_0x105e75){_0x105e75=_0x105e75||0xc8;return function(_0x3682cc){if(_0x3682cc){return _0xaa9d78[_0xaf91('0x19')](_0x105e75)[_0xaf91('0x1b')](_0x3682cc);}};}function respondWithFilteredResult(_0x14ab35,_0x29ff86){return function(_0x56a9a3){if(_0x56a9a3){var _0x45c183=typeof _0x29ff86['offset']===_0xaf91('0x1c')&&typeof _0x29ff86[_0xaf91('0x1d')]==='undefined';var _0xd57f3a=_0x56a9a3[_0xaf91('0x1e')];var _0x149567=_0x45c183?0x0:_0x29ff86[_0xaf91('0x1f')];var _0x10bb7d=_0x45c183?_0x56a9a3[_0xaf91('0x1e')]:_0x29ff86[_0xaf91('0x1f')]+_0x29ff86[_0xaf91('0x1d')];var _0x51d5a0;if(_0x10bb7d>=_0xd57f3a){_0x10bb7d=_0xd57f3a;_0x51d5a0=0xc8;}else{_0x51d5a0=0xce;}_0x14ab35[_0xaf91('0x19')](_0x51d5a0);return _0x14ab35[_0xaf91('0x20')](_0xaf91('0x21'),_0x149567+'-'+_0x10bb7d+'/'+_0xd57f3a)['json'](_0x56a9a3);}return null;};}function patchUpdates(_0x5169c4){return function(_0x17205c){try{jsonpatch[_0xaf91('0x22')](_0x17205c,_0x5169c4,!![]);}catch(_0x13cc54){return BPromise[_0xaf91('0x23')](_0x13cc54);}return _0x17205c[_0xaf91('0x24')]();};}function saveUpdates(_0x526351,_0x39f18c){return function(_0x33e597){if(_0x33e597){return _0x33e597[_0xaf91('0x25')](_0x526351)['then'](function(_0x38e1ec){return _0x38e1ec;});}return null;};}function removeEntity(_0x1c42d8,_0x334542){return function(_0x2d6945){if(_0x2d6945){return _0x2d6945[_0xaf91('0x26')]()[_0xaf91('0x27')](function(){_0x1c42d8[_0xaf91('0x19')](0xcc)[_0xaf91('0x1a')]();});}};}function handleEntityNotFound(_0x46c8fa,_0x30e9bc){return function(_0x2165c9){if(!_0x2165c9){_0x46c8fa['sendStatus'](0x194);}return _0x2165c9;};}function handleError(_0x44d7da,_0x38f8b6){_0x38f8b6=_0x38f8b6||0x1f4;return function(_0x2e5d2a){logger[_0xaf91('0x28')](_0x2e5d2a[_0xaf91('0x29')]);if(_0x2e5d2a[_0xaf91('0x2a')]){delete _0x2e5d2a[_0xaf91('0x2a')];}_0x44d7da[_0xaf91('0x19')](_0x38f8b6)[_0xaf91('0x2b')](_0x2e5d2a);};}exports['index']=function(_0x110288,_0x195337){var _0x48605d={},_0x41250a={},_0x39df6e={'count':0x0,'rows':[]};var _0x1f6bcd=_[_0xaf91('0x2c')](db[_0xaf91('0x2d')][_0xaf91('0x2e')],function(_0x34bd64){return{'name':_0x34bd64[_0xaf91('0x2f')],'type':_0x34bd64[_0xaf91('0x30')][_0xaf91('0x31')]};});_0x41250a['model']=_[_0xaf91('0x2c')](_0x1f6bcd,'name');_0x41250a['query']=_['keys'](_0x110288[_0xaf91('0x32')]);_0x41250a[_0xaf91('0x33')]=_[_0xaf91('0x34')](_0x41250a['model'],_0x41250a[_0xaf91('0x32')]);_0x48605d[_0xaf91('0x35')]=_[_0xaf91('0x34')](_0x41250a['model'],qs[_0xaf91('0x36')](_0x110288[_0xaf91('0x32')]['fields']));_0x48605d['attributes']=_0x48605d[_0xaf91('0x35')][_0xaf91('0x37')]?_0x48605d[_0xaf91('0x35')]:_0x41250a[_0xaf91('0x38')];if(!_0x110288[_0xaf91('0x32')][_0xaf91('0x39')](_0xaf91('0x3a'))){_0x48605d[_0xaf91('0x1d')]=qs[_0xaf91('0x1d')](_0x110288['query'][_0xaf91('0x1d')]);_0x48605d['offset']=qs[_0xaf91('0x1f')](_0x110288['query'][_0xaf91('0x1f')]);}_0x48605d[_0xaf91('0x3b')]=qs[_0xaf91('0x3c')](_0x110288[_0xaf91('0x32')][_0xaf91('0x3c')]);_0x48605d[_0xaf91('0x3d')]=qs[_0xaf91('0x33')](_[_0xaf91('0x3e')](_0x110288[_0xaf91('0x32')],_0x41250a[_0xaf91('0x33')]),_0x1f6bcd);if(_0x110288[_0xaf91('0x32')][_0xaf91('0x3f')]){_0x48605d['where']=_['merge'](_0x48605d[_0xaf91('0x3d')],{'$or':_['map'](_0x1f6bcd,function(_0x576661){if(_0x576661[_0xaf91('0x30')]!==_0xaf91('0x40')){var _0x2645b5={};_0x2645b5[_0x576661[_0xaf91('0x2a')]]={'$like':'%'+_0x110288[_0xaf91('0x32')][_0xaf91('0x3f')]+'%'};return _0x2645b5;}})});}_0x48605d=_[_0xaf91('0x41')]({},_0x48605d,_0x110288[_0xaf91('0x42')]);var _0x42217e={'where':_0x48605d[_0xaf91('0x3d')]};return db[_0xaf91('0x2d')]['count'](_0x42217e)[_0xaf91('0x27')](function(_0x182859){_0x39df6e[_0xaf91('0x1e')]=_0x182859;if(_0x110288[_0xaf91('0x32')][_0xaf91('0x43')]){_0x48605d[_0xaf91('0x44')]=[{'all':!![]}];}return db[_0xaf91('0x2d')][_0xaf91('0x45')](_0x48605d);})['then'](function(_0x40c202){_0x39df6e[_0xaf91('0x46')]=_0x40c202;return _0x39df6e;})[_0xaf91('0x27')](respondWithFilteredResult(_0x195337,_0x48605d))[_0xaf91('0x47')](handleError(_0x195337,null));};exports['show']=function(_0x1188c9,_0x40595f){var _0x339232={'raw':![],'where':{'id':_0x1188c9['params']['id']}},_0x10f9ea={};_0x10f9ea['model']=_['keys'](db['ZohoAccount']['rawAttributes']);_0x10f9ea[_0xaf91('0x32')]=_[_0xaf91('0x48')](_0x1188c9[_0xaf91('0x32')]);_0x10f9ea[_0xaf91('0x33')]=_[_0xaf91('0x34')](_0x10f9ea[_0xaf91('0x38')],_0x10f9ea[_0xaf91('0x32')]);_0x339232[_0xaf91('0x35')]=_['intersection'](_0x10f9ea['model'],qs[_0xaf91('0x36')](_0x1188c9['query'][_0xaf91('0x36')]));_0x339232[_0xaf91('0x35')]=_0x339232[_0xaf91('0x35')][_0xaf91('0x37')]?_0x339232[_0xaf91('0x35')]:_0x10f9ea[_0xaf91('0x38')];if(_0x1188c9[_0xaf91('0x32')][_0xaf91('0x43')]){_0x339232[_0xaf91('0x44')]=[{'all':!![]}];}_0x339232=_[_0xaf91('0x41')]({},_0x339232,_0x1188c9[_0xaf91('0x42')]);return db[_0xaf91('0x2d')][_0xaf91('0x49')](_0x339232)[_0xaf91('0x27')](handleEntityNotFound(_0x40595f,null))['then'](respondWithResult(_0x40595f,null))[_0xaf91('0x47')](handleError(_0x40595f,null));};exports[_0xaf91('0x4a')]=function(_0x1c8547,_0x1ddda0){return db[_0xaf91('0x2d')][_0xaf91('0x4a')](_0x1c8547['body'],{})[_0xaf91('0x27')](respondWithResult(_0x1ddda0,0xc9))[_0xaf91('0x47')](handleError(_0x1ddda0,null));};exports[_0xaf91('0x25')]=function(_0xd9458,_0x23ed49){if(_0xd9458['body']['id']){delete _0xd9458['body']['id'];}return db['ZohoAccount'][_0xaf91('0x49')]({'where':{'id':_0xd9458['params']['id']}})[_0xaf91('0x27')](handleEntityNotFound(_0x23ed49,null))[_0xaf91('0x27')](saveUpdates(_0xd9458[_0xaf91('0x4b')],null))[_0xaf91('0x27')](respondWithResult(_0x23ed49,null))[_0xaf91('0x47')](handleError(_0x23ed49,null));};exports[_0xaf91('0x26')]=function(_0x331124,_0x1d1e2e){return db[_0xaf91('0x2d')][_0xaf91('0x49')]({'where':{'id':_0x331124[_0xaf91('0x4c')]['id']}})[_0xaf91('0x27')](handleEntityNotFound(_0x1d1e2e,null))['then'](removeEntity(_0x1d1e2e,null))[_0xaf91('0x47')](handleError(_0x1d1e2e,null));};exports['getConfigurations']=function(_0x16172a,_0x3b7426,_0x2b2160){var _0x45af9e={};var _0x4e209c={};var _0x380ed3;var _0x3ccbe4;return db[_0xaf91('0x2d')][_0xaf91('0x4d')]({'where':{'id':_0x16172a['params']['id']}})[_0xaf91('0x27')](handleEntityNotFound(_0x3b7426,null))[_0xaf91('0x27')](function(_0x3b993a){if(_0x3b993a){_0x380ed3=_0x3b993a;_0x4e209c['model']=_[_0xaf91('0x48')](db[_0xaf91('0x4e')]['rawAttributes']);_0x4e209c[_0xaf91('0x32')]=_[_0xaf91('0x48')](_0x16172a[_0xaf91('0x32')]);_0x4e209c[_0xaf91('0x33')]=_[_0xaf91('0x34')](_0x4e209c[_0xaf91('0x38')],_0x4e209c[_0xaf91('0x32')]);_0x45af9e[_0xaf91('0x35')]=_[_0xaf91('0x34')](_0x4e209c[_0xaf91('0x38')],qs['fields'](_0x16172a[_0xaf91('0x32')][_0xaf91('0x36')]));_0x45af9e[_0xaf91('0x35')]=_0x45af9e['attributes'][_0xaf91('0x37')]?_0x45af9e['attributes']:_0x4e209c[_0xaf91('0x38')];_0x45af9e['order']=qs[_0xaf91('0x3c')](_0x16172a['query'][_0xaf91('0x3c')]);_0x45af9e[_0xaf91('0x3d')]=qs['filters'](_['pick'](_0x16172a['query'],_0x4e209c[_0xaf91('0x33')]));if(_0x16172a[_0xaf91('0x32')][_0xaf91('0x3f')]){_0x45af9e[_0xaf91('0x3d')]=_['merge'](_0x45af9e[_0xaf91('0x3d')],{'$or':_[_0xaf91('0x2c')](_0x45af9e[_0xaf91('0x35')],function(_0x560263){var _0x16f474={};_0x16f474[_0x560263]={'$like':'%'+_0x16172a[_0xaf91('0x32')][_0xaf91('0x3f')]+'%'};return _0x16f474;})});}_0x45af9e=_[_0xaf91('0x41')]({},_0x45af9e,_0x16172a[_0xaf91('0x42')]);return _0x380ed3[_0xaf91('0x4f')](_0x45af9e);}})['then'](function(_0x40414c){if(_0x40414c){_0x3ccbe4=_0x40414c[_0xaf91('0x37')];if(!_0x16172a[_0xaf91('0x32')][_0xaf91('0x39')](_0xaf91('0x3a'))){_0x45af9e['limit']=qs[_0xaf91('0x1d')](_0x16172a['query'][_0xaf91('0x1d')]);_0x45af9e[_0xaf91('0x1f')]=qs[_0xaf91('0x1f')](_0x16172a['query'][_0xaf91('0x1f')]);}return _0x380ed3[_0xaf91('0x4f')](_0x45af9e);}})[_0xaf91('0x27')](function(_0x573028){if(_0x573028){return _0x573028?{'count':_0x3ccbe4,'rows':_0x573028}:null;}})[_0xaf91('0x27')](respondWithResult(_0x3b7426,null))[_0xaf91('0x47')](handleError(_0x3b7426,null));};exports['addConfiguration']=function(_0x44806a,_0x403860,_0x17a852){if(_0x44806a[_0xaf91('0x4b')]['id']){delete _0x44806a[_0xaf91('0x4b')]['id'];}return db[_0xaf91('0x2d')][_0xaf91('0x4d')]({'where':{'id':_0x44806a[_0xaf91('0x4c')]['id']}})[_0xaf91('0x27')](handleEntityNotFound(_0x403860,null))[_0xaf91('0x27')](function(_0x10801e){if(_0x10801e){_0x44806a[_0xaf91('0x4b')][_0xaf91('0x50')]=_0x10801e['id'];_0x44806a[_0xaf91('0x4b')]['Subjects']=integrations[_0xaf91('0x51')](_0x44806a[_0xaf91('0x4b')][_0xaf91('0x52')],_0x44806a['body'][_0xaf91('0x30')]);_0x44806a[_0xaf91('0x4b')][_0xaf91('0x53')]=integrations[_0xaf91('0x54')](_0x44806a[_0xaf91('0x4b')][_0xaf91('0x52')],_0x44806a[_0xaf91('0x4b')][_0xaf91('0x30')]);return db['ZohoConfiguration'][_0xaf91('0x4a')](_0x44806a['body'],{'include':[{'model':db[_0xaf91('0x55')],'as':'Subjects'},{'model':db[_0xaf91('0x55')],'as':'Descriptions'}]});}return null;})[_0xaf91('0x27')](respondWithResult(_0x403860,null))['catch'](handleError(_0x403860,null));};function getAccessToken(_0x44696d){return new Promise(function(_0x58465c,_0x1056f3){var _0x330d08;switch(_0x44696d[_0xaf91('0x56')]){case'US':_0x330d08=_0xaf91('0x57');break;case'AU':_0x330d08=_0xaf91('0x58');break;case'EU':_0x330d08=_0xaf91('0x59');break;case'IN':_0x330d08=_0xaf91('0x5a');break;case'CN':_0x330d08=_0xaf91('0x5b');break;default:_0x330d08=_0xaf91('0x59');break;}var _0x421aee={'method':_0xaf91('0x5c'),'uri':_0x330d08+'/oauth/v2/token','qs':{'refresh_token':_0x44696d[_0xaf91('0x5d')],'client_id':_0x44696d[_0xaf91('0x5e')],'client_secret':_0x44696d[_0xaf91('0x5f')],'grant_type':_0xaf91('0x60')},'json':!![]};return rp(_0x421aee)[_0xaf91('0x27')](function(_0x25e669){if(_0x25e669[_0xaf91('0x61')]){_0x58465c(_0x25e669['access_token']);}else{_0x1056f3('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xaf91('0x47')](function(_0x4434ec){_0x1056f3(_0x4434ec);});});}exports[_0xaf91('0x62')]=function(_0x1477d0,_0xacdccf,_0x36f6eb){var _0x1d5fee,_0x5ded1e,_0x19f408,_0x4ec9f1,_0x491561;return db[_0xaf91('0x2d')][_0xaf91('0x4d')]({'where':{'id':_0x1477d0[_0xaf91('0x4c')]['id']},'attributes':['id',_0xaf91('0x63'),'zone','clientId',_0xaf91('0x5f'),_0xaf91('0x64'),_0xaf91('0x65'),_0xaf91('0x5d')]})[_0xaf91('0x27')](handleEntityNotFound(_0xacdccf,null))['then'](function(_0x540410){_0x491561=_0x540410;_0x1d5fee=_0x491561[_0xaf91('0x63')];_0x5ded1e=_0x1d5fee==='zoho.eu'?'eu':'com';_0x19f408=_0x491561['serverUrl'];var _0x5ca65c=_0x19f408[_0xaf91('0x66')](-0x1);if(_0x5ca65c==='/'||_0x5ca65c==='\x5c'||_0x5ca65c===':'){_0x19f408=_0x19f408[_0xaf91('0x67')](0x0,_0x19f408[_0xaf91('0x68')](_0x5ca65c));}if(!_0x491561[_0xaf91('0x5d')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x491561);})[_0xaf91('0x27')](function(_0x5d8480){if(_0x5d8480){return rp({'method':_0xaf91('0x69'),'uri':util[_0xaf91('0x6a')](_0xaf91('0x6b'),_0x5ded1e),'qs':{'module':'Calls'},'headers':{'Authorization':_0xaf91('0x6c')+_0x5d8480},'json':!![]});}})[_0xaf91('0x27')](function(_0x512159){if(_0x512159){if(_0x512159[_0xaf91('0x6d')]&&_0x512159[_0xaf91('0x6d')][_0xaf91('0x28')]){throw new Error(_0x512159[_0xaf91('0x6d')][_0xaf91('0x28')][_0xaf91('0x6e')]);}var _0x3b0361=[];var _0x43f8b6=[];var _0x144323=['Owner',_0xaf91('0x6f'),_0xaf91('0x70'),_0xaf91('0x71'),'Call_Duration',_0xaf91('0x72'),_0xaf91('0x73'),'Call_Type'];_0x43f8b6=_[_0xaf91('0x74')](_0x512159[_0xaf91('0x36')],function(_0x579db0){return _0x144323[_0xaf91('0x75')](_0x579db0[_0xaf91('0x76')]);});for(var _0xc4a3de=0x0;_0xc4a3de<_0x43f8b6[_0xaf91('0x37')];_0xc4a3de++){if(_0x43f8b6[_0xc4a3de][_0xaf91('0x77')]===![]){_0x3b0361['push']({'id':_0x43f8b6[_0xc4a3de]['id'],'name':_0x43f8b6[_0xc4a3de][_0xaf91('0x78')],'custom':_0x43f8b6[_0xc4a3de][_0xaf91('0x79')],'options':_0x43f8b6[_0xc4a3de]['data_type']===_0xaf91('0x7a')&&_0x43f8b6[_0xc4a3de][_0xaf91('0x7b')][_0xaf91('0x37')]>-0x1?_['map'](_0x43f8b6[_0xc4a3de][_0xaf91('0x7b')],function(_0x2edf50){return{'name':_0x2edf50,'value':_0x2edf50};}):[]});}}return{'count':_0x3b0361[_0xaf91('0x37')],'rows':_0x3b0361};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0xacdccf,null))[_0xaf91('0x47')](function(_0x2a2b69){var _0xd9769=_0x1477d0[_0xaf91('0x32')]['test']?0x1f4:_0x2a2b69[_0xaf91('0x7c')]||0x1f4;logger[_0xaf91('0x28')](_0xaf91('0x7d'),'getFields',_0xd9769,JSON[_0xaf91('0x7e')](_0x2a2b69));delete _0x2a2b69[_0xaf91('0x2a')];if(_0xd9769===0x191){_0xd9769=0x190;}_0xacdccf[_0xaf91('0x19')](_0xd9769)[_0xaf91('0x2b')](_0x1477d0[_0xaf91('0x32')]['test']?{'message':_0xaf91('0x7f'),'statusCode':_0x2a2b69[_0xaf91('0x7c')]}:_0x2a2b69);});}; \ No newline at end of file +var _0x2a75=['includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','undefined','limit','count','offset','status','set','Content-Range','json','apply','reject','update','then','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','ZohoAccount','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','findOne','ZohoConfiguration','pick','getConfigurations','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','code','refreshToken','zoho.eu','com','slice','substring','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_Type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a75,0x91));var _0x52a7=function(_0x28dfea,_0x35cdf7){_0x28dfea=_0x28dfea-0x0;var _0x444c20=_0x2a75[_0x28dfea];return _0x444c20;};'use strict';var emlformat=require(_0x52a7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x52a7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x52a7('0x2'));var moment=require(_0x52a7('0x3'));var BPromise=require(_0x52a7('0x4'));var Mustache=require(_0x52a7('0x5'));var util=require(_0x52a7('0x6'));var path=require(_0x52a7('0x7'));var sox=require(_0x52a7('0x8'));var csv=require(_0x52a7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x52a7('0xa'));var squel=require('squel');var crypto=require(_0x52a7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x52a7('0xc'));var toCsv=require(_0x52a7('0x9'));var querystring=require('querystring');var Papa=require(_0x52a7('0xd'));var Redis=require(_0x52a7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x52a7('0xf'));var as=require(_0x52a7('0x10'));var hardwareService=require(_0x52a7('0x11'));var logger=require('../../config/logger')(_0x52a7('0x12'));var utils=require('../../config/utils');var config=require(_0x52a7('0x13'));var licenseUtil=require(_0x52a7('0x14'));var db=require(_0x52a7('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xe8028b,_0x4dd943){_0x4dd943=_0x4dd943||0xcc;return function(_0x331509){if(_0x331509){return _0xe8028b['sendStatus'](_0x4dd943);}return _0xe8028b['status'](_0x4dd943)['end']();};}function respondWithResult(_0x4b77d6,_0x4847b2){_0x4847b2=_0x4847b2||0xc8;return function(_0x1b3172){if(_0x1b3172){return _0x4b77d6['status'](_0x4847b2)['json'](_0x1b3172);}};}function respondWithFilteredResult(_0x4063ac,_0x2e4e44){return function(_0x6c3623){if(_0x6c3623){var _0x9ddb3e=typeof _0x2e4e44['offset']===_0x52a7('0x16')&&typeof _0x2e4e44[_0x52a7('0x17')]==='undefined';var _0x11adad=_0x6c3623[_0x52a7('0x18')];var _0x5b9be2=_0x9ddb3e?0x0:_0x2e4e44[_0x52a7('0x19')];var _0x55f770=_0x9ddb3e?_0x6c3623[_0x52a7('0x18')]:_0x2e4e44['offset']+_0x2e4e44[_0x52a7('0x17')];var _0x3a8077;if(_0x55f770>=_0x11adad){_0x55f770=_0x11adad;_0x3a8077=0xc8;}else{_0x3a8077=0xce;}_0x4063ac[_0x52a7('0x1a')](_0x3a8077);return _0x4063ac[_0x52a7('0x1b')](_0x52a7('0x1c'),_0x5b9be2+'-'+_0x55f770+'/'+_0x11adad)[_0x52a7('0x1d')](_0x6c3623);}return null;};}function patchUpdates(_0x4fb958){return function(_0x2a3a14){try{jsonpatch[_0x52a7('0x1e')](_0x2a3a14,_0x4fb958,!![]);}catch(_0x218d4d){return BPromise[_0x52a7('0x1f')](_0x218d4d);}return _0x2a3a14['save']();};}function saveUpdates(_0x349142,_0x1f835b){return function(_0x59b3e8){if(_0x59b3e8){return _0x59b3e8[_0x52a7('0x20')](_0x349142)[_0x52a7('0x21')](function(_0x2e8bd0){return _0x2e8bd0;});}return null;};}function removeEntity(_0x202f8b,_0x413aa5){return function(_0x5786ef){if(_0x5786ef){return _0x5786ef['destroy']()[_0x52a7('0x21')](function(){_0x202f8b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x111ce3,_0x16a4ad){return function(_0x3269b5){if(!_0x3269b5){_0x111ce3[_0x52a7('0x22')](0x194);}return _0x3269b5;};}function handleError(_0x15f14a,_0x407d8a){_0x407d8a=_0x407d8a||0x1f4;return function(_0x54cc06){logger[_0x52a7('0x23')](_0x54cc06[_0x52a7('0x24')]);if(_0x54cc06[_0x52a7('0x25')]){delete _0x54cc06[_0x52a7('0x25')];}_0x15f14a[_0x52a7('0x1a')](_0x407d8a)[_0x52a7('0x26')](_0x54cc06);};}exports[_0x52a7('0x27')]=function(_0x21d8c4,_0x3efb39){var _0x22a7af={},_0x111545={},_0x228389={'count':0x0,'rows':[]};var _0x516e8a=_['map'](db['ZohoAccount'][_0x52a7('0x28')],function(_0x3c431c){return{'name':_0x3c431c[_0x52a7('0x29')],'type':_0x3c431c[_0x52a7('0x2a')][_0x52a7('0x2b')]};});_0x111545['model']=_[_0x52a7('0x2c')](_0x516e8a,'name');_0x111545[_0x52a7('0x2d')]=_[_0x52a7('0x2e')](_0x21d8c4[_0x52a7('0x2d')]);_0x111545[_0x52a7('0x2f')]=_[_0x52a7('0x30')](_0x111545[_0x52a7('0x31')],_0x111545[_0x52a7('0x2d')]);_0x22a7af[_0x52a7('0x32')]=_[_0x52a7('0x30')](_0x111545[_0x52a7('0x31')],qs[_0x52a7('0x33')](_0x21d8c4[_0x52a7('0x2d')][_0x52a7('0x33')]));_0x22a7af[_0x52a7('0x32')]=_0x22a7af['attributes']['length']?_0x22a7af['attributes']:_0x111545[_0x52a7('0x31')];if(!_0x21d8c4['query'][_0x52a7('0x34')]('nolimit')){_0x22a7af[_0x52a7('0x17')]=qs[_0x52a7('0x17')](_0x21d8c4[_0x52a7('0x2d')]['limit']);_0x22a7af['offset']=qs[_0x52a7('0x19')](_0x21d8c4[_0x52a7('0x2d')]['offset']);}_0x22a7af[_0x52a7('0x35')]=qs['sort'](_0x21d8c4['query'][_0x52a7('0x36')]);_0x22a7af[_0x52a7('0x37')]=qs[_0x52a7('0x2f')](_['pick'](_0x21d8c4[_0x52a7('0x2d')],_0x111545[_0x52a7('0x2f')]),_0x516e8a);if(_0x21d8c4[_0x52a7('0x2d')][_0x52a7('0x38')]){_0x22a7af[_0x52a7('0x37')]=_[_0x52a7('0x39')](_0x22a7af['where'],{'$or':_[_0x52a7('0x2c')](_0x516e8a,function(_0x496fcd){if(_0x496fcd[_0x52a7('0x2a')]!==_0x52a7('0x3a')){var _0x4f8de7={};_0x4f8de7[_0x496fcd[_0x52a7('0x25')]]={'$like':'%'+_0x21d8c4[_0x52a7('0x2d')][_0x52a7('0x38')]+'%'};return _0x4f8de7;}})});}_0x22a7af=_[_0x52a7('0x39')]({},_0x22a7af,_0x21d8c4['options']);var _0x5db879={'where':_0x22a7af[_0x52a7('0x37')]};return db[_0x52a7('0x3b')][_0x52a7('0x18')](_0x5db879)[_0x52a7('0x21')](function(_0x4fa3b6){_0x228389[_0x52a7('0x18')]=_0x4fa3b6;if(_0x21d8c4[_0x52a7('0x2d')][_0x52a7('0x3c')]){_0x22a7af[_0x52a7('0x3d')]=[{'all':!![]}];}return db[_0x52a7('0x3b')][_0x52a7('0x3e')](_0x22a7af);})[_0x52a7('0x21')](function(_0x3e8b0c){_0x228389[_0x52a7('0x3f')]=_0x3e8b0c;return _0x228389;})[_0x52a7('0x21')](respondWithFilteredResult(_0x3efb39,_0x22a7af))[_0x52a7('0x40')](handleError(_0x3efb39,null));};exports[_0x52a7('0x41')]=function(_0x3a260a,_0x1f8e8b){var _0x59f1f9={'raw':![],'where':{'id':_0x3a260a[_0x52a7('0x42')]['id']}},_0x3c4774={};_0x3c4774[_0x52a7('0x31')]=_[_0x52a7('0x2e')](db[_0x52a7('0x3b')][_0x52a7('0x28')]);_0x3c4774[_0x52a7('0x2d')]=_['keys'](_0x3a260a[_0x52a7('0x2d')]);_0x3c4774[_0x52a7('0x2f')]=_[_0x52a7('0x30')](_0x3c4774[_0x52a7('0x31')],_0x3c4774[_0x52a7('0x2d')]);_0x59f1f9[_0x52a7('0x32')]=_['intersection'](_0x3c4774[_0x52a7('0x31')],qs['fields'](_0x3a260a['query']['fields']));_0x59f1f9['attributes']=_0x59f1f9[_0x52a7('0x32')][_0x52a7('0x43')]?_0x59f1f9[_0x52a7('0x32')]:_0x3c4774[_0x52a7('0x31')];if(_0x3a260a[_0x52a7('0x2d')]['includeAll']){_0x59f1f9[_0x52a7('0x3d')]=[{'all':!![]}];}_0x59f1f9=_['merge']({},_0x59f1f9,_0x3a260a[_0x52a7('0x44')]);return db[_0x52a7('0x3b')][_0x52a7('0x45')](_0x59f1f9)[_0x52a7('0x21')](handleEntityNotFound(_0x1f8e8b,null))[_0x52a7('0x21')](respondWithResult(_0x1f8e8b,null))[_0x52a7('0x40')](handleError(_0x1f8e8b,null));};exports['create']=function(_0x3a3a8d,_0x349640){return db[_0x52a7('0x3b')][_0x52a7('0x46')](_0x3a3a8d[_0x52a7('0x47')],{})[_0x52a7('0x21')](respondWithResult(_0x349640,0xc9))['catch'](handleError(_0x349640,null));};exports['update']=function(_0x313bdc,_0x4c0262){if(_0x313bdc[_0x52a7('0x47')]['id']){delete _0x313bdc[_0x52a7('0x47')]['id'];}return db[_0x52a7('0x3b')][_0x52a7('0x45')]({'where':{'id':_0x313bdc[_0x52a7('0x42')]['id']}})[_0x52a7('0x21')](handleEntityNotFound(_0x4c0262,null))[_0x52a7('0x21')](saveUpdates(_0x313bdc[_0x52a7('0x47')],null))['then'](respondWithResult(_0x4c0262,null))[_0x52a7('0x40')](handleError(_0x4c0262,null));};exports['destroy']=function(_0x22fd34,_0x4067bd){return db[_0x52a7('0x3b')]['find']({'where':{'id':_0x22fd34[_0x52a7('0x42')]['id']}})[_0x52a7('0x21')](handleEntityNotFound(_0x4067bd,null))[_0x52a7('0x21')](removeEntity(_0x4067bd,null))[_0x52a7('0x40')](handleError(_0x4067bd,null));};exports['getConfigurations']=function(_0x1cdd4a,_0x41086f,_0x3472b0){var _0x27d151={};var _0x30c71b={};var _0x4322c7;var _0x2bd516;return db['ZohoAccount'][_0x52a7('0x48')]({'where':{'id':_0x1cdd4a[_0x52a7('0x42')]['id']}})[_0x52a7('0x21')](handleEntityNotFound(_0x41086f,null))[_0x52a7('0x21')](function(_0x28a262){if(_0x28a262){_0x4322c7=_0x28a262;_0x30c71b[_0x52a7('0x31')]=_[_0x52a7('0x2e')](db[_0x52a7('0x49')]['rawAttributes']);_0x30c71b[_0x52a7('0x2d')]=_[_0x52a7('0x2e')](_0x1cdd4a[_0x52a7('0x2d')]);_0x30c71b['filters']=_[_0x52a7('0x30')](_0x30c71b[_0x52a7('0x31')],_0x30c71b[_0x52a7('0x2d')]);_0x27d151['attributes']=_['intersection'](_0x30c71b[_0x52a7('0x31')],qs[_0x52a7('0x33')](_0x1cdd4a[_0x52a7('0x2d')][_0x52a7('0x33')]));_0x27d151['attributes']=_0x27d151['attributes'][_0x52a7('0x43')]?_0x27d151[_0x52a7('0x32')]:_0x30c71b[_0x52a7('0x31')];_0x27d151['order']=qs[_0x52a7('0x36')](_0x1cdd4a[_0x52a7('0x2d')][_0x52a7('0x36')]);_0x27d151['where']=qs[_0x52a7('0x2f')](_[_0x52a7('0x4a')](_0x1cdd4a['query'],_0x30c71b[_0x52a7('0x2f')]));if(_0x1cdd4a[_0x52a7('0x2d')][_0x52a7('0x38')]){_0x27d151['where']=_[_0x52a7('0x39')](_0x27d151['where'],{'$or':_[_0x52a7('0x2c')](_0x27d151[_0x52a7('0x32')],function(_0x46f8b5){var _0x2cf7bc={};_0x2cf7bc[_0x46f8b5]={'$like':'%'+_0x1cdd4a[_0x52a7('0x2d')][_0x52a7('0x38')]+'%'};return _0x2cf7bc;})});}_0x27d151=_['merge']({},_0x27d151,_0x1cdd4a[_0x52a7('0x44')]);return _0x4322c7[_0x52a7('0x4b')](_0x27d151);}})[_0x52a7('0x21')](function(_0xcd2759){if(_0xcd2759){_0x2bd516=_0xcd2759['length'];if(!_0x1cdd4a['query'][_0x52a7('0x34')]('nolimit')){_0x27d151['limit']=qs[_0x52a7('0x17')](_0x1cdd4a['query'][_0x52a7('0x17')]);_0x27d151[_0x52a7('0x19')]=qs[_0x52a7('0x19')](_0x1cdd4a[_0x52a7('0x2d')][_0x52a7('0x19')]);}return _0x4322c7['getConfigurations'](_0x27d151);}})[_0x52a7('0x21')](function(_0xcbc816){if(_0xcbc816){return _0xcbc816?{'count':_0x2bd516,'rows':_0xcbc816}:null;}})[_0x52a7('0x21')](respondWithResult(_0x41086f,null))[_0x52a7('0x40')](handleError(_0x41086f,null));};exports[_0x52a7('0x4c')]=function(_0x2ea570,_0x20948b,_0x3fd3ed){if(_0x2ea570[_0x52a7('0x47')]['id']){delete _0x2ea570['body']['id'];}return db[_0x52a7('0x3b')]['findOne']({'where':{'id':_0x2ea570[_0x52a7('0x42')]['id']}})[_0x52a7('0x21')](handleEntityNotFound(_0x20948b,null))[_0x52a7('0x21')](function(_0x4aeeb6){if(_0x4aeeb6){_0x2ea570['body'][_0x52a7('0x4d')]=_0x4aeeb6['id'];_0x2ea570[_0x52a7('0x47')][_0x52a7('0x4e')]=integrations['getSubjects'](_0x2ea570[_0x52a7('0x47')]['channel'],_0x2ea570['body']['type']);_0x2ea570[_0x52a7('0x47')][_0x52a7('0x4f')]=integrations[_0x52a7('0x50')](_0x2ea570['body'][_0x52a7('0x51')],_0x2ea570['body'][_0x52a7('0x2a')]);return db[_0x52a7('0x49')][_0x52a7('0x46')](_0x2ea570[_0x52a7('0x47')],{'include':[{'model':db[_0x52a7('0x52')],'as':_0x52a7('0x4e')},{'model':db[_0x52a7('0x52')],'as':_0x52a7('0x4f')}]});}return null;})[_0x52a7('0x21')](respondWithResult(_0x20948b,null))[_0x52a7('0x40')](handleError(_0x20948b,null));};function getAccessToken(_0xf72072){return new Promise(function(_0x3bdfe7,_0x11f37b){var _0x5b8485;switch(_0xf72072[_0x52a7('0x53')]){case'US':_0x5b8485=_0x52a7('0x54');break;case'AU':_0x5b8485=_0x52a7('0x55');break;case'EU':_0x5b8485=_0x52a7('0x56');break;case'IN':_0x5b8485=_0x52a7('0x57');break;case'CN':_0x5b8485=_0x52a7('0x58');break;default:_0x5b8485=_0x52a7('0x56');break;}var _0x1e1e00={'method':_0x52a7('0x59'),'uri':_0x5b8485+_0x52a7('0x5a'),'qs':{'refresh_token':_0xf72072['refreshToken'],'client_id':_0xf72072[_0x52a7('0x5b')],'client_secret':_0xf72072[_0x52a7('0x5c')],'grant_type':_0x52a7('0x5d')},'json':!![]};return rp(_0x1e1e00)[_0x52a7('0x21')](function(_0x3f1dc9){if(_0x3f1dc9[_0x52a7('0x5e')]){_0x3bdfe7(_0x3f1dc9[_0x52a7('0x5e')]);}else{_0x11f37b(_0x52a7('0x5f'));}})['catch'](function(_0x1a5a13){_0x11f37b(_0x1a5a13);});});}exports['getFields']=function(_0x393a67,_0xa21cd4,_0x45322e){var _0x3f4d74,_0x284936,_0x319f2b,_0x81ecd2,_0x2f4d6d;return db[_0x52a7('0x3b')][_0x52a7('0x48')]({'where':{'id':_0x393a67[_0x52a7('0x42')]['id']},'attributes':['id',_0x52a7('0x60'),_0x52a7('0x53'),_0x52a7('0x5b'),'clientSecret',_0x52a7('0x61'),_0x52a7('0x62'),_0x52a7('0x63')]})[_0x52a7('0x21')](handleEntityNotFound(_0xa21cd4,null))[_0x52a7('0x21')](function(_0x93a48b){_0x2f4d6d=_0x93a48b;_0x3f4d74=_0x2f4d6d[_0x52a7('0x60')];_0x284936=_0x3f4d74===_0x52a7('0x64')?'eu':_0x52a7('0x65');_0x319f2b=_0x2f4d6d[_0x52a7('0x61')];var _0x458329=_0x319f2b[_0x52a7('0x66')](-0x1);if(_0x458329==='/'||_0x458329==='\x5c'||_0x458329===':'){_0x319f2b=_0x319f2b[_0x52a7('0x67')](0x0,_0x319f2b['lastIndexOf'](_0x458329));}if(!_0x2f4d6d['refreshToken']){throw new Error(_0x52a7('0x68'));}return getAccessToken(_0x2f4d6d);})[_0x52a7('0x21')](function(_0xabcc28){if(_0xabcc28){return rp({'method':_0x52a7('0x69'),'uri':util[_0x52a7('0x6a')](_0x52a7('0x6b'),_0x284936),'qs':{'module':'Calls'},'headers':{'Authorization':_0x52a7('0x6c')+_0xabcc28},'json':!![]});}})[_0x52a7('0x21')](function(_0x4ebbea){if(_0x4ebbea){if(_0x4ebbea[_0x52a7('0x6d')]&&_0x4ebbea[_0x52a7('0x6d')][_0x52a7('0x23')]){throw new Error(_0x4ebbea[_0x52a7('0x6d')][_0x52a7('0x23')][_0x52a7('0x6e')]);}var _0x28b085=[];var _0x1e026b=[];var _0x1158de=[_0x52a7('0x6f'),_0x52a7('0x70'),_0x52a7('0x71'),_0x52a7('0x72'),_0x52a7('0x73'),'Call_Result','Call_Start_Time',_0x52a7('0x74')];_0x1e026b=_['remove'](_0x4ebbea['fields'],function(_0x2d0cb7){return _0x1158de[_0x52a7('0x75')](_0x2d0cb7[_0x52a7('0x76')]);});for(var _0x5f3d12=0x0;_0x5f3d12<_0x1e026b['length'];_0x5f3d12++){if(_0x1e026b[_0x5f3d12][_0x52a7('0x77')]===![]){_0x28b085[_0x52a7('0x78')]({'id':_0x1e026b[_0x5f3d12]['id'],'name':_0x1e026b[_0x5f3d12][_0x52a7('0x79')],'custom':_0x1e026b[_0x5f3d12][_0x52a7('0x7a')],'options':_0x1e026b[_0x5f3d12][_0x52a7('0x7b')]===_0x52a7('0x7c')&&_0x1e026b[_0x5f3d12][_0x52a7('0x7d')]['length']>-0x1?_[_0x52a7('0x2c')](_0x1e026b[_0x5f3d12][_0x52a7('0x7d')],function(_0x3b1edd){return{'name':_0x3b1edd,'value':_0x3b1edd};}):[]});}}return{'count':_0x28b085[_0x52a7('0x43')],'rows':_0x28b085};}else{return{'count':0x0,'rows':[]};}})[_0x52a7('0x21')](respondWithResult(_0xa21cd4,null))[_0x52a7('0x40')](function(_0x29949e){var _0x3992d9=_0x393a67['query'][_0x52a7('0x7e')]?0x1f4:_0x29949e[_0x52a7('0x7f')]||0x1f4;logger[_0x52a7('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0x52a7('0x80'),_0x3992d9,JSON[_0x52a7('0x81')](_0x29949e));delete _0x29949e[_0x52a7('0x25')];if(_0x3992d9===0x191){_0x3992d9=0x190;}_0xa21cd4[_0x52a7('0x1a')](_0x3992d9)[_0x52a7('0x26')](_0x393a67[_0x52a7('0x2d')][_0x52a7('0x7e')]?{'message':_0x52a7('0x82'),'statusCode':_0x29949e[_0x52a7('0x7f')]}:_0x29949e);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 8d9763a..0db5314 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 _0xded6=['/oauth/v2/token','clientId','code','application/x-www-form-urlencoded','then','parse','refreshToken','refresh_token','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','error','serverUrl','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','clientSecret','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu'];(function(_0x21e0e6,_0x5dfe8a){var _0x580daf=function(_0x36a21b){while(--_0x36a21b){_0x21e0e6['push'](_0x21e0e6['shift']());}};_0x580daf(++_0x5dfe8a);}(_0xded6,0x1aa));var _0x6ded=function(_0x3875f4,_0x3b22f5){_0x3875f4=_0x3875f4-0x0;var _0x198dd9=_0xded6[_0x3875f4];return _0x198dd9;};'use strict';var _=require(_0x6ded('0x0'));var util=require(_0x6ded('0x1'));var logger=require(_0x6ded('0x2'))(_0x6ded('0x3'));var moment=require('moment');var BPromise=require(_0x6ded('0x4'));var rp=require(_0x6ded('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6ded('0x6'));var config=require(_0x6ded('0x7'));var attributes=require(_0x6ded('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x6ded('0x9')]=function(_0x35538d,_0x188a1e){return _0x35538d[_0x6ded('0xa')](_0x6ded('0xb'),attributes,{'tableName':_0x6ded('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2e3eb0,_0x1c1600,_0xc8be31){if(_0x2e3eb0[_0x6ded('0xd')](_0x6ded('0xe'))||_0x2e3eb0[_0x6ded('0xd')]('serverUrl')||_0x2e3eb0[_0x6ded('0xd')]('clientId')||_0x2e3eb0[_0x6ded('0xd')](_0x6ded('0xf'))||_0x2e3eb0[_0x6ded('0xd')]('code')||_0x2e3eb0[_0x6ded('0xd')](_0x6ded('0x10'))){var _0x5b7e66,_0x11bf69;_0x5b7e66=_0x2e3eb0['serverUrl'];var _0x47c965=_0x5b7e66[_0x6ded('0x11')](-0x1);if(_0x47c965==='/'||_0x47c965==='\x5c'||_0x47c965===':'){_0x5b7e66=_0x5b7e66[_0x6ded('0x12')](0x0,_0x5b7e66[_0x6ded('0x13')](_0x47c965));}switch(_0x2e3eb0[_0x6ded('0xe')]){case'US':_0x11bf69=_0x6ded('0x14');break;case'AU':_0x11bf69=_0x6ded('0x15');break;case'IN':_0x11bf69=_0x6ded('0x16');break;case'CN':_0x11bf69=_0x6ded('0x17');break;default:_0x11bf69=_0x6ded('0x18');break;}var _0x263906={'method':'POST','uri':_0x11bf69+_0x6ded('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x2e3eb0[_0x6ded('0x1a')],'client_secret':_0x2e3eb0[_0x6ded('0xf')],'redirect_uri':_0x2e3eb0['serverUrl'],'code':_0x2e3eb0[_0x6ded('0x1b')]},'headers':{'Content-Type':_0x6ded('0x1c')}};return rp(_0x263906)[_0x6ded('0x1d')](function(_0x44cfdc){var _0x509a1e=JSON[_0x6ded('0x1e')](_0x44cfdc);if(_0x509a1e['refresh_token']){_0x2e3eb0[_0x6ded('0x1f')]=_0x509a1e[_0x6ded('0x20')];logger['info'](util[_0x6ded('0x21')](_0x6ded('0x22'),_0x2e3eb0[_0x6ded('0x23')],_0x2e3eb0['id']));}else{logger['error'](util[_0x6ded('0x21')](_0x6ded('0x24'),_0x2e3eb0[_0x6ded('0x23')],_0x2e3eb0['id']),util[_0x6ded('0x25')](_0x509a1e,{'showHidden':![],'depth':null}));}return _0xc8be31(null,_0x1c1600);})[_0x6ded('0x26')](function(_0x720fba){logger[_0x6ded('0x27')](util[_0x6ded('0x21')](_0x6ded('0x24'),_0x2e3eb0[_0x6ded('0x23')],_0x2e3eb0['id']),util[_0x6ded('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0xc8be31(_0x720fba);});}else{return _0xc8be31(null,_0x1c1600);}},'beforeUpdate':function(_0x4573e2,_0x30a81a,_0x242f74){if(_0x4573e2[_0x6ded('0xd')](_0x6ded('0xe'))||_0x4573e2[_0x6ded('0xd')](_0x6ded('0x28'))||_0x4573e2[_0x6ded('0xd')](_0x6ded('0x1a'))||_0x4573e2['changed'](_0x6ded('0xf'))||_0x4573e2['changed'](_0x6ded('0x1b'))||_0x4573e2[_0x6ded('0xd')](_0x6ded('0x10'))){var _0x17fb25,_0x3fcc5d;_0x17fb25=_0x4573e2['serverUrl'];var _0xd5f273=_0x17fb25[_0x6ded('0x11')](-0x1);if(_0xd5f273==='/'||_0xd5f273==='\x5c'||_0xd5f273===':'){_0x17fb25=_0x17fb25[_0x6ded('0x12')](0x0,_0x17fb25[_0x6ded('0x13')](_0xd5f273));}switch(_0x4573e2[_0x6ded('0xe')]){case'US':_0x3fcc5d=_0x6ded('0x14');break;case'AU':_0x3fcc5d=_0x6ded('0x15');break;case'IN':_0x3fcc5d=_0x6ded('0x16');break;case'CN':_0x3fcc5d=_0x6ded('0x17');break;default:_0x3fcc5d=_0x6ded('0x18');break;}var _0x548749={'method':'POST','uri':_0x3fcc5d+_0x6ded('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x4573e2['clientId'],'client_secret':_0x4573e2['clientSecret'],'redirect_uri':_0x4573e2['serverUrl'],'code':_0x4573e2[_0x6ded('0x1b')]},'headers':{'Content-Type':_0x6ded('0x1c')}};return rp(_0x548749)['then'](function(_0x3fc54b){var _0x58ac5e=JSON[_0x6ded('0x1e')](_0x3fc54b);if(_0x58ac5e[_0x6ded('0x20')]){_0x4573e2[_0x6ded('0x1f')]=_0x58ac5e[_0x6ded('0x20')];logger['info'](util[_0x6ded('0x21')](_0x6ded('0x22'),_0x4573e2[_0x6ded('0x23')],_0x4573e2['id']));}else{logger[_0x6ded('0x27')](util[_0x6ded('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4573e2[_0x6ded('0x23')],_0x4573e2['id']),util['inspect'](_0x58ac5e,{'showHidden':![],'depth':null}));}return _0x242f74(null,_0x30a81a);})[_0x6ded('0x26')](function(_0x57278c){logger[_0x6ded('0x27')](util[_0x6ded('0x21')](_0x6ded('0x24'),_0x4573e2['name'],_0x4573e2['id']),util[_0x6ded('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x242f74(_0x57278c);});}else{return _0x242f74(null,_0x30a81a);}}}});}; \ No newline at end of file +var _0x1297=['rimraf','../../config/environment','./intZohoAccount.attributes','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','slice','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','parse','refresh_token','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','lastIndexOf','https://accounts.zoho.com','then','refreshToken','format','error','lodash','util','../../config/logger','moment','path'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x1297,0xeb));var _0x7129=function(_0x818799,_0x4e1c9e){_0x818799=_0x818799-0x0;var _0x69f4c2=_0x1297[_0x818799];return _0x69f4c2;};'use strict';var _=require(_0x7129('0x0'));var util=require(_0x7129('0x1'));var logger=require(_0x7129('0x2'))('api');var moment=require(_0x7129('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7129('0x4'));var rimraf=require(_0x7129('0x5'));var config=require(_0x7129('0x6'));var attributes=require(_0x7129('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x6325a0,_0x10af6f){return _0x6325a0[_0x7129('0x8')](_0x7129('0x9'),attributes,{'tableName':_0x7129('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xe3c37,_0x5eddf5,_0xe499b4){if(_0xe3c37[_0x7129('0xb')](_0x7129('0xc'))||_0xe3c37[_0x7129('0xb')](_0x7129('0xd'))||_0xe3c37['changed'](_0x7129('0xe'))||_0xe3c37[_0x7129('0xb')](_0x7129('0xf'))||_0xe3c37['changed'](_0x7129('0x10'))||_0xe3c37[_0x7129('0xb')]('host')){var _0x447540,_0x1e6c5d;_0x447540=_0xe3c37['serverUrl'];var _0x462d0c=_0x447540[_0x7129('0x11')](-0x1);if(_0x462d0c==='/'||_0x462d0c==='\x5c'||_0x462d0c===':'){_0x447540=_0x447540['substring'](0x0,_0x447540['lastIndexOf'](_0x462d0c));}switch(_0xe3c37[_0x7129('0xc')]){case'US':_0x1e6c5d='https://accounts.zoho.com';break;case'AU':_0x1e6c5d=_0x7129('0x12');break;case'IN':_0x1e6c5d=_0x7129('0x13');break;case'CN':_0x1e6c5d=_0x7129('0x14');break;default:_0x1e6c5d=_0x7129('0x15');break;}var _0x3f2809={'method':_0x7129('0x16'),'uri':_0x1e6c5d+_0x7129('0x17'),'form':{'grant_type':_0x7129('0x18'),'client_id':_0xe3c37[_0x7129('0xe')],'client_secret':_0xe3c37[_0x7129('0xf')],'redirect_uri':_0xe3c37['serverUrl'],'code':_0xe3c37[_0x7129('0x10')]},'headers':{'Content-Type':_0x7129('0x19')}};return rp(_0x3f2809)['then'](function(_0x138720){var _0x212f67=JSON[_0x7129('0x1a')](_0x138720);if(_0x212f67[_0x7129('0x1b')]){_0xe3c37['refreshToken']=_0x212f67['refresh_token'];logger[_0x7129('0x1c')](util['format'](_0x7129('0x1d'),_0xe3c37[_0x7129('0x1e')],_0xe3c37['id']));}else{logger['error'](util['format'](_0x7129('0x1f'),_0xe3c37[_0x7129('0x1e')],_0xe3c37['id']),util[_0x7129('0x20')](_0x212f67,{'showHidden':![],'depth':null}));}return _0xe499b4(null,_0x5eddf5);})[_0x7129('0x21')](function(_0x5d2f47){logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xe3c37[_0x7129('0x1e')],_0xe3c37['id']),util[_0x7129('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0xe499b4(_0x5d2f47);});}else{return _0xe499b4(null,_0x5eddf5);}},'beforeUpdate':function(_0x1403e2,_0x32e1a8,_0x51f9a4){if(_0x1403e2['changed'](_0x7129('0xc'))||_0x1403e2['changed']('serverUrl')||_0x1403e2[_0x7129('0xb')](_0x7129('0xe'))||_0x1403e2[_0x7129('0xb')]('clientSecret')||_0x1403e2[_0x7129('0xb')](_0x7129('0x10'))||_0x1403e2[_0x7129('0xb')]('host')){var _0x4280ed,_0x47b0c4;_0x4280ed=_0x1403e2[_0x7129('0xd')];var _0x334eab=_0x4280ed['slice'](-0x1);if(_0x334eab==='/'||_0x334eab==='\x5c'||_0x334eab===':'){_0x4280ed=_0x4280ed['substring'](0x0,_0x4280ed[_0x7129('0x22')](_0x334eab));}switch(_0x1403e2[_0x7129('0xc')]){case'US':_0x47b0c4=_0x7129('0x23');break;case'AU':_0x47b0c4=_0x7129('0x12');break;case'IN':_0x47b0c4=_0x7129('0x13');break;case'CN':_0x47b0c4=_0x7129('0x14');break;default:_0x47b0c4=_0x7129('0x15');break;}var _0x2d7e65={'method':'POST','uri':_0x47b0c4+'/oauth/v2/token','form':{'grant_type':_0x7129('0x18'),'client_id':_0x1403e2[_0x7129('0xe')],'client_secret':_0x1403e2[_0x7129('0xf')],'redirect_uri':_0x1403e2[_0x7129('0xd')],'code':_0x1403e2['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x2d7e65)[_0x7129('0x24')](function(_0x23fa7c){var _0x5b18f6=JSON[_0x7129('0x1a')](_0x23fa7c);if(_0x5b18f6[_0x7129('0x1b')]){_0x1403e2[_0x7129('0x25')]=_0x5b18f6[_0x7129('0x1b')];logger[_0x7129('0x1c')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1403e2[_0x7129('0x1e')],_0x1403e2['id']));}else{logger['error'](util[_0x7129('0x26')](_0x7129('0x1f'),_0x1403e2[_0x7129('0x1e')],_0x1403e2['id']),util[_0x7129('0x20')](_0x5b18f6,{'showHidden':![],'depth':null}));}return _0x51f9a4(null,_0x32e1a8);})[_0x7129('0x21')](function(_0x53e09d){logger[_0x7129('0x27')](util[_0x7129('0x26')](_0x7129('0x1f'),_0x1403e2[_0x7129('0x1e')],_0x1403e2['id']),util[_0x7129('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x51f9a4(_0x53e09d);});}else{return _0x51f9a4(null,_0x32e1a8);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index f3430c7..e637576 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 _0x6d4b=['findAll','raw','options','where','attributes','map','model','include','stringify','ShowZohoAccount','find','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','GetZohoAccount','ZohoAccount'];(function(_0x455ac0,_0x1d5f16){var _0xfb9257=function(_0x126d21){while(--_0x126d21){_0x455ac0['push'](_0x455ac0['shift']());}};_0xfb9257(++_0x1d5f16);}(_0x6d4b,0xbf));var _0xb6d4=function(_0x55c681,_0x3b70f1){_0x55c681=_0x55c681-0x0;var _0x44147d=_0x6d4b[_0x55c681];return _0x44147d;};'use strict';var _=require(_0xb6d4('0x0'));var util=require(_0xb6d4('0x1'));var moment=require(_0xb6d4('0x2'));var BPromise=require('bluebird');var rs=require(_0xb6d4('0x3'));var fs=require('fs');var Redis=require(_0xb6d4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb6d4('0x5'))(_0xb6d4('0x6'));var config=require(_0xb6d4('0x7'));var jayson=require(_0xb6d4('0x8'));var client=jayson[_0xb6d4('0x9')][_0xb6d4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11498a,_0x78c489,_0x5f11b9){return new BPromise(function(_0x36d85f,_0xe82b85){return client[_0xb6d4('0xb')](_0x11498a,_0x5f11b9)[_0xb6d4('0xc')](function(_0x2effac){logger[_0xb6d4('0xd')](_0xb6d4('0xe'),_0x78c489,_0xb6d4('0xf'));logger[_0xb6d4('0x10')](_0xb6d4('0x11'),_0x78c489,'request\x20sent',JSON['stringify'](_0x2effac));if(_0x2effac['error']){if(_0x2effac['error'][_0xb6d4('0x12')]===0x1f4){logger['error'](_0xb6d4('0xe'),_0x78c489,_0x2effac[_0xb6d4('0x13')][_0xb6d4('0x14')]);return _0xe82b85(_0x2effac[_0xb6d4('0x13')]['message']);}logger[_0xb6d4('0x13')](_0xb6d4('0xe'),_0x78c489,_0x2effac['error'][_0xb6d4('0x14')]);return _0x36d85f(_0x2effac['error'][_0xb6d4('0x14')]);}else{logger[_0xb6d4('0xd')](_0xb6d4('0xe'),_0x78c489,_0xb6d4('0xf'));_0x36d85f(_0x2effac[_0xb6d4('0x15')][_0xb6d4('0x14')]);}})[_0xb6d4('0x16')](function(_0x5e3b0f){logger[_0xb6d4('0x13')](_0xb6d4('0xe'),_0x78c489,_0x5e3b0f);_0xe82b85(_0x5e3b0f);});});}exports[_0xb6d4('0x17')]=function(_0x431af2){var _0x43ba1f=this;return new Promise(function(_0x438053,_0x28bce9){return db[_0xb6d4('0x18')][_0xb6d4('0x19')]({'raw':_0x431af2['options']?_0x431af2['options'][_0xb6d4('0x1a')]===undefined?!![]:![]:!![],'where':_0x431af2[_0xb6d4('0x1b')]?_0x431af2[_0xb6d4('0x1b')][_0xb6d4('0x1c')]||null:null,'attributes':_0x431af2[_0xb6d4('0x1b')]?_0x431af2['options'][_0xb6d4('0x1d')]||null:null,'limit':_0x431af2[_0xb6d4('0x1b')]?_0x431af2[_0xb6d4('0x1b')]['limit']||null:null,'include':_0x431af2[_0xb6d4('0x1b')]?_0x431af2['options']['include']?_[_0xb6d4('0x1e')](_0x431af2[_0xb6d4('0x1b')]['include'],function(_0x56baa4){return{'model':db[_0x56baa4[_0xb6d4('0x1f')]],'as':_0x56baa4['as'],'attributes':_0x56baa4[_0xb6d4('0x1d')],'include':_0x56baa4[_0xb6d4('0x20')]?_[_0xb6d4('0x1e')](_0x56baa4[_0xb6d4('0x20')],function(_0x223ca0){return{'model':db[_0x223ca0[_0xb6d4('0x1f')]],'as':_0x223ca0['as'],'attributes':_0x223ca0[_0xb6d4('0x1d')],'include':_0x223ca0[_0xb6d4('0x20')]?_[_0xb6d4('0x1e')](_0x223ca0[_0xb6d4('0x20')],function(_0x18db34){return{'model':db[_0x18db34['model']],'as':_0x18db34['as'],'attributes':_0x18db34[_0xb6d4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb6d4('0xc')](function(_0x54ddeb){logger[_0xb6d4('0xd')]('GetZohoAccount',_0x431af2);logger[_0xb6d4('0x10')](_0xb6d4('0x17'),_0x431af2,JSON[_0xb6d4('0x21')](_0x54ddeb));_0x438053(_0x54ddeb);})[_0xb6d4('0x16')](function(_0x1a311d){logger[_0xb6d4('0x13')](_0xb6d4('0x17'),_0x1a311d[_0xb6d4('0x14')],_0x431af2);_0x28bce9(_0x43ba1f['error'](0x1f4,_0x1a311d[_0xb6d4('0x14')]));});});};exports[_0xb6d4('0x22')]=function(_0x112d10){var _0x54e090=this;return new Promise(function(_0x417d70,_0x5bacec){return db['ZohoAccount'][_0xb6d4('0x23')]({'raw':_0x112d10[_0xb6d4('0x1b')]?_0x112d10[_0xb6d4('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x112d10['options']?_0x112d10['options'][_0xb6d4('0x1c')]||null:null,'attributes':_0x112d10[_0xb6d4('0x1b')]?_0x112d10[_0xb6d4('0x1b')][_0xb6d4('0x1d')]||null:null,'include':_0x112d10[_0xb6d4('0x1b')]?_0x112d10[_0xb6d4('0x1b')]['include']?_['map'](_0x112d10[_0xb6d4('0x1b')]['include'],function(_0x53fb87){return{'model':db[_0x53fb87['model']],'as':_0x53fb87['as'],'attributes':_0x53fb87['attributes'],'include':_0x53fb87[_0xb6d4('0x20')]?_[_0xb6d4('0x1e')](_0x53fb87['include'],function(_0x7c98be){return{'model':db[_0x7c98be['model']],'as':_0x7c98be['as'],'attributes':_0x7c98be[_0xb6d4('0x1d')],'include':_0x7c98be[_0xb6d4('0x20')]?_[_0xb6d4('0x1e')](_0x7c98be[_0xb6d4('0x20')],function(_0x274ebd){return{'model':db[_0x274ebd[_0xb6d4('0x1f')]],'as':_0x274ebd['as'],'attributes':_0x274ebd[_0xb6d4('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x410602){logger[_0xb6d4('0xd')](_0xb6d4('0x22'),_0x112d10);logger['debug']('ShowZohoAccount',_0x112d10,JSON[_0xb6d4('0x21')](_0x410602));_0x417d70(_0x410602);})[_0xb6d4('0x16')](function(_0x12a3dc){logger[_0xb6d4('0x13')](_0xb6d4('0x22'),_0x12a3dc['message'],_0x112d10);_0x5bacec(_0x54e090[_0xb6d4('0x13')](0x1f4,_0x12a3dc['message']));});});}; \ No newline at end of file +var _0x6144=['limit','include','map','model','attributes','then','ShowZohoAccount','find','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetZohoAccount','ZohoAccount','findAll','options','where'];(function(_0x1a2b1f,_0x412f6c){var _0x3a6bed=function(_0x3f8d85){while(--_0x3f8d85){_0x1a2b1f['push'](_0x1a2b1f['shift']());}};_0x3a6bed(++_0x412f6c);}(_0x6144,0x99));var _0x4614=function(_0x5dd4bd,_0x42501c){_0x5dd4bd=_0x5dd4bd-0x0;var _0x29548f=_0x6144[_0x5dd4bd];return _0x29548f;};'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});function respondWithRpcPromise(_0x3d6142,_0x4a1030,_0x45e5f2){return new BPromise(function(_0x3eb8ea,_0x4035f3){return client[_0x4614('0xc')](_0x3d6142,_0x45e5f2)['then'](function(_0x3c3afa){logger[_0x4614('0xd')](_0x4614('0xe'),_0x4a1030,_0x4614('0xf'));logger[_0x4614('0x10')](_0x4614('0x11'),_0x4a1030,_0x4614('0xf'),JSON['stringify'](_0x3c3afa));if(_0x3c3afa[_0x4614('0x12')]){if(_0x3c3afa[_0x4614('0x12')][_0x4614('0x13')]===0x1f4){logger[_0x4614('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x4a1030,_0x3c3afa['error'][_0x4614('0x14')]);return _0x4035f3(_0x3c3afa[_0x4614('0x12')][_0x4614('0x14')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x4a1030,_0x3c3afa['error'][_0x4614('0x14')]);return _0x3eb8ea(_0x3c3afa[_0x4614('0x12')]['message']);}else{logger[_0x4614('0xd')](_0x4614('0xe'),_0x4a1030,_0x4614('0xf'));_0x3eb8ea(_0x3c3afa['result'][_0x4614('0x14')]);}})[_0x4614('0x15')](function(_0x1f30b0){logger[_0x4614('0x12')](_0x4614('0xe'),_0x4a1030,_0x1f30b0);_0x4035f3(_0x1f30b0);});});}exports[_0x4614('0x16')]=function(_0x5d10fc){var _0x29f526=this;return new Promise(function(_0x195eac,_0x53a14c){return db[_0x4614('0x17')][_0x4614('0x18')]({'raw':_0x5d10fc[_0x4614('0x19')]?_0x5d10fc['options']['raw']===undefined?!![]:![]:!![],'where':_0x5d10fc[_0x4614('0x19')]?_0x5d10fc[_0x4614('0x19')][_0x4614('0x1a')]||null:null,'attributes':_0x5d10fc['options']?_0x5d10fc[_0x4614('0x19')]['attributes']||null:null,'limit':_0x5d10fc['options']?_0x5d10fc[_0x4614('0x19')][_0x4614('0x1b')]||null:null,'include':_0x5d10fc[_0x4614('0x19')]?_0x5d10fc['options'][_0x4614('0x1c')]?_[_0x4614('0x1d')](_0x5d10fc[_0x4614('0x19')]['include'],function(_0x341fa5){return{'model':db[_0x341fa5[_0x4614('0x1e')]],'as':_0x341fa5['as'],'attributes':_0x341fa5['attributes'],'include':_0x341fa5[_0x4614('0x1c')]?_[_0x4614('0x1d')](_0x341fa5[_0x4614('0x1c')],function(_0x51edf0){return{'model':db[_0x51edf0[_0x4614('0x1e')]],'as':_0x51edf0['as'],'attributes':_0x51edf0['attributes'],'include':_0x51edf0[_0x4614('0x1c')]?_[_0x4614('0x1d')](_0x51edf0[_0x4614('0x1c')],function(_0x5ecfa6){return{'model':db[_0x5ecfa6['model']],'as':_0x5ecfa6['as'],'attributes':_0x5ecfa6[_0x4614('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4614('0x20')](function(_0x48bf58){logger['info'](_0x4614('0x16'),_0x5d10fc);logger[_0x4614('0x10')](_0x4614('0x16'),_0x5d10fc,JSON['stringify'](_0x48bf58));_0x195eac(_0x48bf58);})[_0x4614('0x15')](function(_0xc57a63){logger[_0x4614('0x12')](_0x4614('0x16'),_0xc57a63[_0x4614('0x14')],_0x5d10fc);_0x53a14c(_0x29f526[_0x4614('0x12')](0x1f4,_0xc57a63[_0x4614('0x14')]));});});};exports[_0x4614('0x21')]=function(_0x1bbe82){var _0x1a0f26=this;return new Promise(function(_0x2ebe8d,_0x521651){return db[_0x4614('0x17')][_0x4614('0x22')]({'raw':_0x1bbe82[_0x4614('0x19')]?_0x1bbe82[_0x4614('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1bbe82[_0x4614('0x19')]?_0x1bbe82['options'][_0x4614('0x1a')]||null:null,'attributes':_0x1bbe82[_0x4614('0x19')]?_0x1bbe82[_0x4614('0x19')][_0x4614('0x1f')]||null:null,'include':_0x1bbe82['options']?_0x1bbe82[_0x4614('0x19')][_0x4614('0x1c')]?_[_0x4614('0x1d')](_0x1bbe82['options']['include'],function(_0x2ac72b){return{'model':db[_0x2ac72b[_0x4614('0x1e')]],'as':_0x2ac72b['as'],'attributes':_0x2ac72b['attributes'],'include':_0x2ac72b[_0x4614('0x1c')]?_['map'](_0x2ac72b[_0x4614('0x1c')],function(_0x6c0ba2){return{'model':db[_0x6c0ba2[_0x4614('0x1e')]],'as':_0x6c0ba2['as'],'attributes':_0x6c0ba2[_0x4614('0x1f')],'include':_0x6c0ba2[_0x4614('0x1c')]?_['map'](_0x6c0ba2['include'],function(_0x2bfe09){return{'model':db[_0x2bfe09['model']],'as':_0x2bfe09['as'],'attributes':_0x2bfe09['attributes']};}):[]};}):[]};}):[]:[]})[_0x4614('0x20')](function(_0x10f8b8){logger['info'](_0x4614('0x21'),_0x1bbe82);logger[_0x4614('0x10')](_0x4614('0x21'),_0x1bbe82,JSON[_0x4614('0x23')](_0x10f8b8));_0x2ebe8d(_0x10f8b8);})[_0x4614('0x15')](function(_0x11668d){logger[_0x4614('0x12')](_0x4614('0x21'),_0x11668d[_0x4614('0x14')],_0x1bbe82);_0x521651(_0x1a0f26[_0x4614('0x12')](0x1f4,_0x11668d[_0x4614('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 8ee5877..85eda9c 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 _0x2d31=['getSubjects','post','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','get','/:id'];(function(_0x50168c,_0x499019){var _0x2ab190=function(_0x4c23d9){while(--_0x4c23d9){_0x50168c['push'](_0x50168c['shift']());}};_0x2ab190(++_0x499019);}(_0x2d31,0xbb));var _0x12d3=function(_0x29ae80,_0x3579f1){_0x29ae80=_0x29ae80-0x0;var _0x5d6d71=_0x2d31[_0x29ae80];return _0x5d6d71;};'use strict';var multer=require(_0x12d3('0x0'));var util=require(_0x12d3('0x1'));var path=require(_0x12d3('0x2'));var timeout=require('connect-timeout');var express=require(_0x12d3('0x3'));var router=express[_0x12d3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x12d3('0x5'));var interaction=require(_0x12d3('0x6'));var config=require(_0x12d3('0x7'));var controller=require(_0x12d3('0x8'));router['get']('/',auth[_0x12d3('0x9')](),controller[_0x12d3('0xa')]);router[_0x12d3('0xb')](_0x12d3('0xc'),auth[_0x12d3('0x9')](),controller['show']);router['get']('/:id/fields',auth[_0x12d3('0x9')](),controller['getFields']);router[_0x12d3('0xb')]('/:id/subjects',auth[_0x12d3('0x9')](),controller[_0x12d3('0xd')]);router[_0x12d3('0xb')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0x12d3('0xe')]('/',auth[_0x12d3('0x9')](),controller['create']);router[_0x12d3('0xf')](_0x12d3('0xc'),auth[_0x12d3('0x9')](),controller[_0x12d3('0x10')]);router[_0x12d3('0x11')](_0x12d3('0xc'),auth[_0x12d3('0x9')](),controller[_0x12d3('0x12')]);module[_0x12d3('0x13')]=router; \ No newline at end of file +var _0x9979=['destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete'];(function(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0x9979,0x122));var _0x9997=function(_0x4766cf,_0x110454){_0x4766cf=_0x4766cf-0x0;var _0x1b0f93=_0x9979[_0x4766cf];return _0x1b0f93;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9997('0x0'));var express=require(_0x9997('0x1'));var router=express[_0x9997('0x2')]();var fs_extra=require(_0x9997('0x3'));var auth=require(_0x9997('0x4'));var interaction=require(_0x9997('0x5'));var config=require(_0x9997('0x6'));var controller=require(_0x9997('0x7'));router['get']('/',auth[_0x9997('0x8')](),controller[_0x9997('0x9')]);router[_0x9997('0xa')](_0x9997('0xb'),auth[_0x9997('0x8')](),controller[_0x9997('0xc')]);router['get'](_0x9997('0xd'),auth['isAuthenticated'](),controller['getFields']);router['get'](_0x9997('0xe'),auth[_0x9997('0x8')](),controller[_0x9997('0xf')]);router['get']('/:id/descriptions',auth[_0x9997('0x8')](),controller[_0x9997('0x10')]);router[_0x9997('0x11')]('/',auth[_0x9997('0x8')](),controller[_0x9997('0x12')]);router[_0x9997('0x13')](_0x9997('0xb'),auth[_0x9997('0x8')](),controller[_0x9997('0x14')]);router[_0x9997('0x15')](_0x9997('0xb'),auth['isAuthenticated'](),controller[_0x9997('0x16')]);module[_0x9997('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 1bf421b..18540be 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 _0x64b3=['lead','contact','contact_lead','sequelize','ENUM'];(function(_0x297dcf,_0x448cf5){var _0xe1699b=function(_0x8b1e0f){while(--_0x8b1e0f){_0x297dcf['push'](_0x297dcf['shift']());}};_0xe1699b(++_0x448cf5);}(_0x64b3,0x1de));var _0x364b=function(_0x30ca9d,_0x20e6f2){_0x30ca9d=_0x30ca9d-0x0;var _0x5713cb=_0x64b3[_0x30ca9d];return _0x5713cb;};'use strict';var Sequelize=require(_0x364b('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x364b('0x1')](_0x364b('0x2'),_0x364b('0x3'),'nothing'),'defaultValue':_0x364b('0x2')},'moduleSearch':{'type':Sequelize[_0x364b('0x1')](_0x364b('0x4'),_0x364b('0x3'),_0x364b('0x2')),'defaultValue':_0x364b('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa296=['exports','STRING','ENUM','contact','nothing','contact_lead','sequelize'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xa296,0x1d4));var _0x6a29=function(_0x53e19d,_0x604957){_0x53e19d=_0x53e19d-0x0;var _0x5ba332=_0xa296[_0x53e19d];return _0x5ba332;};'use strict';var Sequelize=require(_0x6a29('0x0'));module[_0x6a29('0x1')]={'name':{'type':Sequelize[_0x6a29('0x2')]},'moduleCreate':{'type':Sequelize[_0x6a29('0x3')]('lead',_0x6a29('0x4'),_0x6a29('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x6a29('0x3')]('contact_lead',_0x6a29('0x4'),'lead'),'defaultValue':_0x6a29('0x6')},'description':{'type':Sequelize[_0x6a29('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 16bed55..b5a0dcf 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 _0x5129=['length','find','create','body','params','getFields','findOne','order','pick','ZohoField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0x5129,0x1ec));var _0x9512=function(_0x32f379,_0x466247){_0x32f379=_0x32f379-0x0;var _0x40ed1a=_0x5129[_0x32f379];return _0x40ed1a;};'use strict';var emlformat=require(_0x9512('0x0'));var rimraf=require(_0x9512('0x1'));var zipdir=require(_0x9512('0x2'));var jsonpatch=require(_0x9512('0x3'));var rp=require(_0x9512('0x4'));var moment=require('moment');var BPromise=require(_0x9512('0x5'));var Mustache=require('mustache');var util=require(_0x9512('0x6'));var path=require(_0x9512('0x7'));var sox=require(_0x9512('0x8'));var csv=require(_0x9512('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9512('0xa'));var squel=require(_0x9512('0xb'));var crypto=require(_0x9512('0xc'));var jsforce=require(_0x9512('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9512('0x9'));var querystring=require(_0x9512('0xe'));var Papa=require(_0x9512('0xf'));var Redis=require(_0x9512('0x10'));var authService=require(_0x9512('0x11'));var qs=require(_0x9512('0x12'));var as=require(_0x9512('0x13'));var hardwareService=require(_0x9512('0x14'));var logger=require(_0x9512('0x15'))('api');var utils=require(_0x9512('0x16'));var config=require(_0x9512('0x17'));var licenseUtil=require(_0x9512('0x18'));var db=require(_0x9512('0x19'))['db'];function respondWithStatusCode(_0x244719,_0x1d8dcb){_0x1d8dcb=_0x1d8dcb||0xcc;return function(_0x50b85e){if(_0x50b85e){return _0x244719[_0x9512('0x1a')](_0x1d8dcb);}return _0x244719[_0x9512('0x1b')](_0x1d8dcb)[_0x9512('0x1c')]();};}function respondWithResult(_0xa4700a,_0x4ea7f1){_0x4ea7f1=_0x4ea7f1||0xc8;return function(_0x4a236c){if(_0x4a236c){return _0xa4700a[_0x9512('0x1b')](_0x4ea7f1)['json'](_0x4a236c);}};}function respondWithFilteredResult(_0x484750,_0xc0ea81){return function(_0x3d75c6){if(_0x3d75c6){var _0x335aba=typeof _0xc0ea81[_0x9512('0x1d')]==='undefined'&&typeof _0xc0ea81[_0x9512('0x1e')]==='undefined';var _0x329b31=_0x3d75c6['count'];var _0xf848a0=_0x335aba?0x0:_0xc0ea81['offset'];var _0x34b7e0=_0x335aba?_0x3d75c6['count']:_0xc0ea81['offset']+_0xc0ea81[_0x9512('0x1e')];var _0x2f6acb;if(_0x34b7e0>=_0x329b31){_0x34b7e0=_0x329b31;_0x2f6acb=0xc8;}else{_0x2f6acb=0xce;}_0x484750[_0x9512('0x1b')](_0x2f6acb);return _0x484750['set']('Content-Range',_0xf848a0+'-'+_0x34b7e0+'/'+_0x329b31)[_0x9512('0x1f')](_0x3d75c6);}return null;};}function patchUpdates(_0x47ad63){return function(_0x3eb8d7){try{jsonpatch[_0x9512('0x20')](_0x3eb8d7,_0x47ad63,!![]);}catch(_0x4b365a){return BPromise[_0x9512('0x21')](_0x4b365a);}return _0x3eb8d7[_0x9512('0x22')]();};}function saveUpdates(_0x3b7a4d,_0x2ffa){return function(_0x15876c){if(_0x15876c){return _0x15876c['update'](_0x3b7a4d)[_0x9512('0x23')](function(_0x37a678){return _0x37a678;});}return null;};}function removeEntity(_0xb2f215,_0x5c820f){return function(_0x2bf649){if(_0x2bf649){return _0x2bf649[_0x9512('0x24')]()[_0x9512('0x23')](function(){_0xb2f215[_0x9512('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ad46,_0x5a7a93){return function(_0x210b5c){if(!_0x210b5c){_0x16ad46['sendStatus'](0x194);}return _0x210b5c;};}function handleError(_0x3f0207,_0x3e2061){_0x3e2061=_0x3e2061||0x1f4;return function(_0x29afd5){logger[_0x9512('0x25')](_0x29afd5[_0x9512('0x26')]);if(_0x29afd5[_0x9512('0x27')]){delete _0x29afd5['name'];}_0x3f0207['status'](_0x3e2061)[_0x9512('0x28')](_0x29afd5);};}exports[_0x9512('0x29')]=function(_0x4a587d,_0x2ce4af){var _0x1d6f1b={},_0x241035={},_0x59e78f={'count':0x0,'rows':[]};var _0x316cf7=_[_0x9512('0x2a')](db[_0x9512('0x2b')][_0x9512('0x2c')],function(_0x2ed1ce){return{'name':_0x2ed1ce['fieldName'],'type':_0x2ed1ce[_0x9512('0x2d')][_0x9512('0x2e')]};});_0x241035['model']=_[_0x9512('0x2a')](_0x316cf7,_0x9512('0x27'));_0x241035['query']=_[_0x9512('0x2f')](_0x4a587d[_0x9512('0x30')]);_0x241035[_0x9512('0x31')]=_[_0x9512('0x32')](_0x241035[_0x9512('0x33')],_0x241035['query']);_0x1d6f1b[_0x9512('0x34')]=_[_0x9512('0x32')](_0x241035[_0x9512('0x33')],qs[_0x9512('0x35')](_0x4a587d['query'][_0x9512('0x35')]));_0x1d6f1b[_0x9512('0x34')]=_0x1d6f1b[_0x9512('0x34')]['length']?_0x1d6f1b[_0x9512('0x34')]:_0x241035['model'];if(!_0x4a587d[_0x9512('0x30')][_0x9512('0x36')](_0x9512('0x37'))){_0x1d6f1b[_0x9512('0x1e')]=qs[_0x9512('0x1e')](_0x4a587d['query'][_0x9512('0x1e')]);_0x1d6f1b[_0x9512('0x1d')]=qs['offset'](_0x4a587d[_0x9512('0x30')]['offset']);}_0x1d6f1b['order']=qs['sort'](_0x4a587d[_0x9512('0x30')][_0x9512('0x38')]);_0x1d6f1b[_0x9512('0x39')]=qs[_0x9512('0x31')](_['pick'](_0x4a587d[_0x9512('0x30')],_0x241035[_0x9512('0x31')]),_0x316cf7);if(_0x4a587d[_0x9512('0x30')][_0x9512('0x3a')]){_0x1d6f1b[_0x9512('0x39')]=_[_0x9512('0x3b')](_0x1d6f1b[_0x9512('0x39')],{'$or':_[_0x9512('0x2a')](_0x316cf7,function(_0x18241c){if(_0x18241c['type']!==_0x9512('0x3c')){var _0x572805={};_0x572805[_0x18241c[_0x9512('0x27')]]={'$like':'%'+_0x4a587d[_0x9512('0x30')][_0x9512('0x3a')]+'%'};return _0x572805;}})});}_0x1d6f1b=_[_0x9512('0x3b')]({},_0x1d6f1b,_0x4a587d[_0x9512('0x3d')]);var _0x984ac9={'where':_0x1d6f1b[_0x9512('0x39')]};return db[_0x9512('0x2b')]['count'](_0x984ac9)[_0x9512('0x23')](function(_0x1e57b8){_0x59e78f[_0x9512('0x3e')]=_0x1e57b8;if(_0x4a587d['query'][_0x9512('0x3f')]){_0x1d6f1b[_0x9512('0x40')]=[{'all':!![]}];}return db[_0x9512('0x2b')]['findAll'](_0x1d6f1b);})[_0x9512('0x23')](function(_0x5d35b3){_0x59e78f[_0x9512('0x41')]=_0x5d35b3;return _0x59e78f;})['then'](respondWithFilteredResult(_0x2ce4af,_0x1d6f1b))[_0x9512('0x42')](handleError(_0x2ce4af,null));};exports[_0x9512('0x43')]=function(_0x1792d8,_0x4a4edc){var _0x35036d={'raw':![],'where':{'id':_0x1792d8['params']['id']}},_0x2f5f1f={};_0x2f5f1f[_0x9512('0x33')]=_[_0x9512('0x2f')](db[_0x9512('0x2b')][_0x9512('0x2c')]);_0x2f5f1f[_0x9512('0x30')]=_[_0x9512('0x2f')](_0x1792d8[_0x9512('0x30')]);_0x2f5f1f[_0x9512('0x31')]=_[_0x9512('0x32')](_0x2f5f1f[_0x9512('0x33')],_0x2f5f1f[_0x9512('0x30')]);_0x35036d[_0x9512('0x34')]=_['intersection'](_0x2f5f1f[_0x9512('0x33')],qs['fields'](_0x1792d8[_0x9512('0x30')][_0x9512('0x35')]));_0x35036d[_0x9512('0x34')]=_0x35036d[_0x9512('0x34')][_0x9512('0x44')]?_0x35036d[_0x9512('0x34')]:_0x2f5f1f[_0x9512('0x33')];if(_0x1792d8[_0x9512('0x30')][_0x9512('0x3f')]){_0x35036d[_0x9512('0x40')]=[{'all':!![]}];}_0x35036d=_['merge']({},_0x35036d,_0x1792d8[_0x9512('0x3d')]);return db['ZohoConfiguration'][_0x9512('0x45')](_0x35036d)[_0x9512('0x23')](handleEntityNotFound(_0x4a4edc,null))[_0x9512('0x23')](respondWithResult(_0x4a4edc,null))[_0x9512('0x42')](handleError(_0x4a4edc,null));};exports['create']=function(_0x5707a2,_0x22dd36){return db[_0x9512('0x2b')][_0x9512('0x46')](_0x5707a2[_0x9512('0x47')],{})[_0x9512('0x23')](respondWithResult(_0x22dd36,0xc9))[_0x9512('0x42')](handleError(_0x22dd36,null));};exports['update']=function(_0x5e729e,_0x3199eb){if(_0x5e729e[_0x9512('0x47')]['id']){delete _0x5e729e[_0x9512('0x47')]['id'];}return db['ZohoConfiguration'][_0x9512('0x45')]({'where':{'id':_0x5e729e[_0x9512('0x48')]['id']}})[_0x9512('0x23')](handleEntityNotFound(_0x3199eb,null))[_0x9512('0x23')](saveUpdates(_0x5e729e[_0x9512('0x47')],null))[_0x9512('0x23')](respondWithResult(_0x3199eb,null))['catch'](handleError(_0x3199eb,null));};exports[_0x9512('0x24')]=function(_0x4480a5,_0x3969dc){return db[_0x9512('0x2b')][_0x9512('0x45')]({'where':{'id':_0x4480a5[_0x9512('0x48')]['id']}})[_0x9512('0x23')](handleEntityNotFound(_0x3969dc,null))['then'](removeEntity(_0x3969dc,null))['catch'](handleError(_0x3969dc,null));};exports[_0x9512('0x49')]=function(_0x3b3a85,_0x5d5622,_0x4b9eed){var _0x5f4b30={};var _0x5b351c={};var _0x9ea312;var _0x4243a4;return db[_0x9512('0x2b')][_0x9512('0x4a')]({'where':{'id':_0x3b3a85[_0x9512('0x48')]['id']}})['then'](handleEntityNotFound(_0x5d5622,null))[_0x9512('0x23')](function(_0x43b369){if(_0x43b369){_0x9ea312=_0x43b369;_0x5b351c[_0x9512('0x33')]=_['keys'](db['ZohoField']['rawAttributes']);_0x5b351c[_0x9512('0x30')]=_['keys'](_0x3b3a85[_0x9512('0x30')]);_0x5b351c[_0x9512('0x31')]=_[_0x9512('0x32')](_0x5b351c[_0x9512('0x33')],_0x5b351c[_0x9512('0x30')]);_0x5f4b30['attributes']=_[_0x9512('0x32')](_0x5b351c['model'],qs[_0x9512('0x35')](_0x3b3a85[_0x9512('0x30')]['fields']));_0x5f4b30[_0x9512('0x34')]=_0x5f4b30[_0x9512('0x34')][_0x9512('0x44')]?_0x5f4b30[_0x9512('0x34')]:_0x5b351c[_0x9512('0x33')];_0x5f4b30[_0x9512('0x4b')]=qs[_0x9512('0x38')](_0x3b3a85[_0x9512('0x30')]['sort']);_0x5f4b30['where']=qs[_0x9512('0x31')](_[_0x9512('0x4c')](_0x3b3a85[_0x9512('0x30')],_0x5b351c[_0x9512('0x31')]));if(_0x3b3a85[_0x9512('0x30')][_0x9512('0x3a')]){_0x5f4b30[_0x9512('0x39')]=_[_0x9512('0x3b')](_0x5f4b30[_0x9512('0x39')],{'$or':_[_0x9512('0x2a')](_0x5f4b30[_0x9512('0x34')],function(_0x3782a9){var _0x52fdeb={};_0x52fdeb[_0x3782a9]={'$like':'%'+_0x3b3a85['query'][_0x9512('0x3a')]+'%'};return _0x52fdeb;})});}_0x5f4b30=_[_0x9512('0x3b')]({},_0x5f4b30,_0x3b3a85[_0x9512('0x3d')]);return _0x9ea312[_0x9512('0x49')](_0x5f4b30);}})[_0x9512('0x23')](function(_0x1d5912){if(_0x1d5912){_0x4243a4=_0x1d5912['length'];if(!_0x3b3a85[_0x9512('0x30')][_0x9512('0x36')](_0x9512('0x37'))){_0x5f4b30['limit']=qs['limit'](_0x3b3a85[_0x9512('0x30')][_0x9512('0x1e')]);_0x5f4b30[_0x9512('0x1d')]=qs[_0x9512('0x1d')](_0x3b3a85[_0x9512('0x30')][_0x9512('0x1d')]);}return _0x9ea312[_0x9512('0x49')](_0x5f4b30);}})[_0x9512('0x23')](function(_0x2c19ad){if(_0x2c19ad){return _0x2c19ad?{'count':_0x4243a4,'rows':_0x2c19ad}:null;}})[_0x9512('0x23')](respondWithResult(_0x5d5622,null))[_0x9512('0x42')](handleError(_0x5d5622,null));};exports['getSubjects']=function(_0x3e8ef0,_0x592913,_0x3f4fea){var _0x1b8ad4={};var _0x52c2b={};var _0x29b64a;var _0x34fcf0;return db[_0x9512('0x2b')]['findOne']({'where':{'id':_0x3e8ef0['params']['id']}})[_0x9512('0x23')](handleEntityNotFound(_0x592913,null))[_0x9512('0x23')](function(_0x134d93){if(_0x134d93){_0x29b64a=_0x134d93;_0x52c2b[_0x9512('0x33')]=_['keys'](db[_0x9512('0x4d')][_0x9512('0x2c')]);_0x52c2b[_0x9512('0x30')]=_['keys'](_0x3e8ef0['query']);_0x52c2b[_0x9512('0x31')]=_[_0x9512('0x32')](_0x52c2b[_0x9512('0x33')],_0x52c2b[_0x9512('0x30')]);_0x1b8ad4[_0x9512('0x34')]=_[_0x9512('0x32')](_0x52c2b[_0x9512('0x33')],qs[_0x9512('0x35')](_0x3e8ef0[_0x9512('0x30')][_0x9512('0x35')]));_0x1b8ad4[_0x9512('0x34')]=_0x1b8ad4['attributes'][_0x9512('0x44')]?_0x1b8ad4[_0x9512('0x34')]:_0x52c2b['model'];_0x1b8ad4[_0x9512('0x4b')]=qs[_0x9512('0x38')](_0x3e8ef0[_0x9512('0x30')][_0x9512('0x38')]);_0x1b8ad4[_0x9512('0x39')]=qs['filters'](_[_0x9512('0x4c')](_0x3e8ef0[_0x9512('0x30')],_0x52c2b[_0x9512('0x31')]));if(_0x3e8ef0[_0x9512('0x30')][_0x9512('0x3a')]){_0x1b8ad4[_0x9512('0x39')]=_[_0x9512('0x3b')](_0x1b8ad4[_0x9512('0x39')],{'$or':_[_0x9512('0x2a')](_0x1b8ad4[_0x9512('0x34')],function(_0x5749d9){var _0x56cf68={};_0x56cf68[_0x5749d9]={'$like':'%'+_0x3e8ef0[_0x9512('0x30')]['filter']+'%'};return _0x56cf68;})});}_0x1b8ad4=_['merge']({},_0x1b8ad4,_0x3e8ef0['options']);return _0x29b64a['getSubjects'](_0x1b8ad4);}})[_0x9512('0x23')](function(_0x3f318b){if(_0x3f318b){_0x34fcf0=_0x3f318b[_0x9512('0x44')];if(!_0x3e8ef0['query'][_0x9512('0x36')](_0x9512('0x37'))){_0x1b8ad4[_0x9512('0x1e')]=qs[_0x9512('0x1e')](_0x3e8ef0[_0x9512('0x30')][_0x9512('0x1e')]);_0x1b8ad4[_0x9512('0x1d')]=qs['offset'](_0x3e8ef0[_0x9512('0x30')]['offset']);}return _0x29b64a[_0x9512('0x4e')](_0x1b8ad4);}})[_0x9512('0x23')](function(_0x28b306){if(_0x28b306){return _0x28b306?{'count':_0x34fcf0,'rows':_0x28b306}:null;}})[_0x9512('0x23')](respondWithResult(_0x592913,null))[_0x9512('0x42')](handleError(_0x592913,null));};exports['getDescriptions']=function(_0x1a3acb,_0x124a7a,_0x52f470){var _0x34c208={};var _0x1f8ba3={};var _0x4b25ac;var _0x361cf6;return db[_0x9512('0x2b')][_0x9512('0x4a')]({'where':{'id':_0x1a3acb[_0x9512('0x48')]['id']}})[_0x9512('0x23')](handleEntityNotFound(_0x124a7a,null))['then'](function(_0x2f98e0){if(_0x2f98e0){_0x4b25ac=_0x2f98e0;_0x1f8ba3['model']=_[_0x9512('0x2f')](db[_0x9512('0x4d')][_0x9512('0x2c')]);_0x1f8ba3['query']=_[_0x9512('0x2f')](_0x1a3acb[_0x9512('0x30')]);_0x1f8ba3['filters']=_['intersection'](_0x1f8ba3[_0x9512('0x33')],_0x1f8ba3[_0x9512('0x30')]);_0x34c208[_0x9512('0x34')]=_[_0x9512('0x32')](_0x1f8ba3[_0x9512('0x33')],qs[_0x9512('0x35')](_0x1a3acb['query'][_0x9512('0x35')]));_0x34c208[_0x9512('0x34')]=_0x34c208['attributes'][_0x9512('0x44')]?_0x34c208['attributes']:_0x1f8ba3['model'];_0x34c208['order']=qs['sort'](_0x1a3acb[_0x9512('0x30')][_0x9512('0x38')]);_0x34c208[_0x9512('0x39')]=qs[_0x9512('0x31')](_[_0x9512('0x4c')](_0x1a3acb['query'],_0x1f8ba3[_0x9512('0x31')]));if(_0x1a3acb[_0x9512('0x30')][_0x9512('0x3a')]){_0x34c208[_0x9512('0x39')]=_['merge'](_0x34c208['where'],{'$or':_[_0x9512('0x2a')](_0x34c208[_0x9512('0x34')],function(_0x1f9c01){var _0x13f6ab={};_0x13f6ab[_0x1f9c01]={'$like':'%'+_0x1a3acb[_0x9512('0x30')]['filter']+'%'};return _0x13f6ab;})});}_0x34c208=_['merge']({},_0x34c208,_0x1a3acb[_0x9512('0x3d')]);return _0x4b25ac[_0x9512('0x4f')](_0x34c208);}})[_0x9512('0x23')](function(_0x15f95e){if(_0x15f95e){_0x361cf6=_0x15f95e[_0x9512('0x44')];if(!_0x1a3acb['query']['hasOwnProperty'](_0x9512('0x37'))){_0x34c208[_0x9512('0x1e')]=qs[_0x9512('0x1e')](_0x1a3acb['query'][_0x9512('0x1e')]);_0x34c208['offset']=qs[_0x9512('0x1d')](_0x1a3acb[_0x9512('0x30')][_0x9512('0x1d')]);}return _0x4b25ac[_0x9512('0x4f')](_0x34c208);}})[_0x9512('0x23')](function(_0xafc6c9){if(_0xafc6c9){return _0xafc6c9?{'count':_0x361cf6,'rows':_0xafc6c9}:null;}})[_0x9512('0x23')](respondWithResult(_0x124a7a,null))[_0x9512('0x42')](handleError(_0x124a7a,null));}; \ No newline at end of file +var _0xfc88=['apply','reject','update','then','destroy','end','error','name','send','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','ZohoConfiguration','catch','show','params','include','options','find','create','body','getFields','findOne','keys','ZohoField','length','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','offset','limit','Content-Range'];(function(_0x3255ab,_0x663999){var _0x18b7d7=function(_0x44b616){while(--_0x44b616){_0x3255ab['push'](_0x3255ab['shift']());}};_0x18b7d7(++_0x663999);}(_0xfc88,0x115));var _0x8fc8=function(_0x3707b2,_0x238fa9){_0x3707b2=_0x3707b2-0x0;var _0x5ed5d6=_0xfc88[_0x3707b2];return _0x5ed5d6;};'use strict';var emlformat=require(_0x8fc8('0x0'));var rimraf=require(_0x8fc8('0x1'));var zipdir=require(_0x8fc8('0x2'));var jsonpatch=require(_0x8fc8('0x3'));var rp=require(_0x8fc8('0x4'));var moment=require(_0x8fc8('0x5'));var BPromise=require(_0x8fc8('0x6'));var Mustache=require(_0x8fc8('0x7'));var util=require('util');var path=require(_0x8fc8('0x8'));var sox=require(_0x8fc8('0x9'));var csv=require(_0x8fc8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8fc8('0xb'));var _=require('lodash');var squel=require(_0x8fc8('0xc'));var crypto=require('crypto');var jsforce=require(_0x8fc8('0xd'));var deskjs=require(_0x8fc8('0xe'));var toCsv=require(_0x8fc8('0xa'));var querystring=require('querystring');var Papa=require(_0x8fc8('0xf'));var Redis=require('ioredis');var authService=require(_0x8fc8('0x10'));var qs=require(_0x8fc8('0x11'));var as=require(_0x8fc8('0x12'));var hardwareService=require(_0x8fc8('0x13'));var logger=require(_0x8fc8('0x14'))('api');var utils=require(_0x8fc8('0x15'));var config=require(_0x8fc8('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8fc8('0x17'))['db'];function respondWithStatusCode(_0x409873,_0x5b29f8){_0x5b29f8=_0x5b29f8||0xcc;return function(_0x740486){if(_0x740486){return _0x409873[_0x8fc8('0x18')](_0x5b29f8);}return _0x409873[_0x8fc8('0x19')](_0x5b29f8)['end']();};}function respondWithResult(_0x195ad1,_0x37618d){_0x37618d=_0x37618d||0xc8;return function(_0x4be489){if(_0x4be489){return _0x195ad1[_0x8fc8('0x19')](_0x37618d)[_0x8fc8('0x1a')](_0x4be489);}};}function respondWithFilteredResult(_0x28ecaa,_0x45fbc9){return function(_0x3868d5){if(_0x3868d5){var _0x3c6007=typeof _0x45fbc9['offset']===_0x8fc8('0x1b')&&typeof _0x45fbc9['limit']===_0x8fc8('0x1b');var _0x48947f=_0x3868d5['count'];var _0x5b51ea=_0x3c6007?0x0:_0x45fbc9[_0x8fc8('0x1c')];var _0x274276=_0x3c6007?_0x3868d5['count']:_0x45fbc9['offset']+_0x45fbc9[_0x8fc8('0x1d')];var _0x3fc374;if(_0x274276>=_0x48947f){_0x274276=_0x48947f;_0x3fc374=0xc8;}else{_0x3fc374=0xce;}_0x28ecaa[_0x8fc8('0x19')](_0x3fc374);return _0x28ecaa['set'](_0x8fc8('0x1e'),_0x5b51ea+'-'+_0x274276+'/'+_0x48947f)[_0x8fc8('0x1a')](_0x3868d5);}return null;};}function patchUpdates(_0x15c87a){return function(_0x4e9309){try{jsonpatch[_0x8fc8('0x1f')](_0x4e9309,_0x15c87a,!![]);}catch(_0x2b8cea){return BPromise[_0x8fc8('0x20')](_0x2b8cea);}return _0x4e9309['save']();};}function saveUpdates(_0x41bba0,_0x116bb6){return function(_0x5efe37){if(_0x5efe37){return _0x5efe37[_0x8fc8('0x21')](_0x41bba0)[_0x8fc8('0x22')](function(_0x32b0d1){return _0x32b0d1;});}return null;};}function removeEntity(_0x16984e,_0x32f897){return function(_0x6baa64){if(_0x6baa64){return _0x6baa64[_0x8fc8('0x23')]()[_0x8fc8('0x22')](function(){_0x16984e[_0x8fc8('0x19')](0xcc)[_0x8fc8('0x24')]();});}};}function handleEntityNotFound(_0x150690,_0x3b236e){return function(_0x3cd8cc){if(!_0x3cd8cc){_0x150690[_0x8fc8('0x18')](0x194);}return _0x3cd8cc;};}function handleError(_0x35278f,_0x285dd4){_0x285dd4=_0x285dd4||0x1f4;return function(_0x5d9991){logger[_0x8fc8('0x25')](_0x5d9991['stack']);if(_0x5d9991[_0x8fc8('0x26')]){delete _0x5d9991[_0x8fc8('0x26')];}_0x35278f[_0x8fc8('0x19')](_0x285dd4)[_0x8fc8('0x27')](_0x5d9991);};}exports['index']=function(_0x3469ef,_0x3a4b89){var _0x2cd727={},_0x5ea6bf={},_0x2f0703={'count':0x0,'rows':[]};var _0x45e035=_[_0x8fc8('0x28')](db['ZohoConfiguration'][_0x8fc8('0x29')],function(_0x378310){return{'name':_0x378310[_0x8fc8('0x2a')],'type':_0x378310[_0x8fc8('0x2b')][_0x8fc8('0x2c')]};});_0x5ea6bf['model']=_[_0x8fc8('0x28')](_0x45e035,_0x8fc8('0x26'));_0x5ea6bf[_0x8fc8('0x2d')]=_['keys'](_0x3469ef[_0x8fc8('0x2d')]);_0x5ea6bf[_0x8fc8('0x2e')]=_[_0x8fc8('0x2f')](_0x5ea6bf[_0x8fc8('0x30')],_0x5ea6bf[_0x8fc8('0x2d')]);_0x2cd727['attributes']=_[_0x8fc8('0x2f')](_0x5ea6bf['model'],qs[_0x8fc8('0x31')](_0x3469ef['query'][_0x8fc8('0x31')]));_0x2cd727[_0x8fc8('0x32')]=_0x2cd727[_0x8fc8('0x32')]['length']?_0x2cd727[_0x8fc8('0x32')]:_0x5ea6bf[_0x8fc8('0x30')];if(!_0x3469ef['query']['hasOwnProperty'](_0x8fc8('0x33'))){_0x2cd727[_0x8fc8('0x1d')]=qs[_0x8fc8('0x1d')](_0x3469ef[_0x8fc8('0x2d')][_0x8fc8('0x1d')]);_0x2cd727[_0x8fc8('0x1c')]=qs[_0x8fc8('0x1c')](_0x3469ef[_0x8fc8('0x2d')][_0x8fc8('0x1c')]);}_0x2cd727[_0x8fc8('0x34')]=qs[_0x8fc8('0x35')](_0x3469ef[_0x8fc8('0x2d')][_0x8fc8('0x35')]);_0x2cd727[_0x8fc8('0x36')]=qs['filters'](_[_0x8fc8('0x37')](_0x3469ef[_0x8fc8('0x2d')],_0x5ea6bf[_0x8fc8('0x2e')]),_0x45e035);if(_0x3469ef['query'][_0x8fc8('0x38')]){_0x2cd727[_0x8fc8('0x36')]=_[_0x8fc8('0x39')](_0x2cd727['where'],{'$or':_['map'](_0x45e035,function(_0x2d8d1a){if(_0x2d8d1a[_0x8fc8('0x2b')]!==_0x8fc8('0x3a')){var _0x46152f={};_0x46152f[_0x2d8d1a['name']]={'$like':'%'+_0x3469ef[_0x8fc8('0x2d')][_0x8fc8('0x38')]+'%'};return _0x46152f;}})});}_0x2cd727=_[_0x8fc8('0x39')]({},_0x2cd727,_0x3469ef['options']);var _0xcc8ef8={'where':_0x2cd727[_0x8fc8('0x36')]};return db['ZohoConfiguration']['count'](_0xcc8ef8)['then'](function(_0x10e485){_0x2f0703[_0x8fc8('0x3b')]=_0x10e485;if(_0x3469ef[_0x8fc8('0x2d')]['includeAll']){_0x2cd727['include']=[{'all':!![]}];}return db[_0x8fc8('0x3c')]['findAll'](_0x2cd727);})[_0x8fc8('0x22')](function(_0x77e85b){_0x2f0703['rows']=_0x77e85b;return _0x2f0703;})[_0x8fc8('0x22')](respondWithFilteredResult(_0x3a4b89,_0x2cd727))[_0x8fc8('0x3d')](handleError(_0x3a4b89,null));};exports[_0x8fc8('0x3e')]=function(_0x4e302f,_0x1d14e2){var _0x526f2b={'raw':![],'where':{'id':_0x4e302f[_0x8fc8('0x3f')]['id']}},_0x3dd2cf={};_0x3dd2cf[_0x8fc8('0x30')]=_['keys'](db[_0x8fc8('0x3c')][_0x8fc8('0x29')]);_0x3dd2cf[_0x8fc8('0x2d')]=_['keys'](_0x4e302f[_0x8fc8('0x2d')]);_0x3dd2cf['filters']=_[_0x8fc8('0x2f')](_0x3dd2cf[_0x8fc8('0x30')],_0x3dd2cf[_0x8fc8('0x2d')]);_0x526f2b[_0x8fc8('0x32')]=_[_0x8fc8('0x2f')](_0x3dd2cf['model'],qs[_0x8fc8('0x31')](_0x4e302f[_0x8fc8('0x2d')][_0x8fc8('0x31')]));_0x526f2b['attributes']=_0x526f2b['attributes']['length']?_0x526f2b[_0x8fc8('0x32')]:_0x3dd2cf[_0x8fc8('0x30')];if(_0x4e302f['query']['includeAll']){_0x526f2b[_0x8fc8('0x40')]=[{'all':!![]}];}_0x526f2b=_['merge']({},_0x526f2b,_0x4e302f[_0x8fc8('0x41')]);return db[_0x8fc8('0x3c')][_0x8fc8('0x42')](_0x526f2b)['then'](handleEntityNotFound(_0x1d14e2,null))[_0x8fc8('0x22')](respondWithResult(_0x1d14e2,null))['catch'](handleError(_0x1d14e2,null));};exports[_0x8fc8('0x43')]=function(_0x5eb64b,_0x7b5644){return db[_0x8fc8('0x3c')][_0x8fc8('0x43')](_0x5eb64b[_0x8fc8('0x44')],{})[_0x8fc8('0x22')](respondWithResult(_0x7b5644,0xc9))[_0x8fc8('0x3d')](handleError(_0x7b5644,null));};exports[_0x8fc8('0x21')]=function(_0x4325d4,_0x404259){if(_0x4325d4[_0x8fc8('0x44')]['id']){delete _0x4325d4[_0x8fc8('0x44')]['id'];}return db['ZohoConfiguration'][_0x8fc8('0x42')]({'where':{'id':_0x4325d4[_0x8fc8('0x3f')]['id']}})[_0x8fc8('0x22')](handleEntityNotFound(_0x404259,null))[_0x8fc8('0x22')](saveUpdates(_0x4325d4['body'],null))[_0x8fc8('0x22')](respondWithResult(_0x404259,null))[_0x8fc8('0x3d')](handleError(_0x404259,null));};exports[_0x8fc8('0x23')]=function(_0x146076,_0x5390b8){return db['ZohoConfiguration']['find']({'where':{'id':_0x146076[_0x8fc8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5390b8,null))[_0x8fc8('0x22')](removeEntity(_0x5390b8,null))[_0x8fc8('0x3d')](handleError(_0x5390b8,null));};exports[_0x8fc8('0x45')]=function(_0x5c1bec,_0x5ad070,_0x3b9dfe){var _0x332eeb={};var _0x5d1262={};var _0x1f80fd;var _0x577a27;return db['ZohoConfiguration'][_0x8fc8('0x46')]({'where':{'id':_0x5c1bec[_0x8fc8('0x3f')]['id']}})[_0x8fc8('0x22')](handleEntityNotFound(_0x5ad070,null))['then'](function(_0x55f397){if(_0x55f397){_0x1f80fd=_0x55f397;_0x5d1262[_0x8fc8('0x30')]=_[_0x8fc8('0x47')](db[_0x8fc8('0x48')][_0x8fc8('0x29')]);_0x5d1262[_0x8fc8('0x2d')]=_[_0x8fc8('0x47')](_0x5c1bec[_0x8fc8('0x2d')]);_0x5d1262['filters']=_['intersection'](_0x5d1262['model'],_0x5d1262['query']);_0x332eeb[_0x8fc8('0x32')]=_[_0x8fc8('0x2f')](_0x5d1262['model'],qs[_0x8fc8('0x31')](_0x5c1bec[_0x8fc8('0x2d')][_0x8fc8('0x31')]));_0x332eeb[_0x8fc8('0x32')]=_0x332eeb[_0x8fc8('0x32')][_0x8fc8('0x49')]?_0x332eeb[_0x8fc8('0x32')]:_0x5d1262[_0x8fc8('0x30')];_0x332eeb['order']=qs[_0x8fc8('0x35')](_0x5c1bec[_0x8fc8('0x2d')][_0x8fc8('0x35')]);_0x332eeb[_0x8fc8('0x36')]=qs[_0x8fc8('0x2e')](_[_0x8fc8('0x37')](_0x5c1bec['query'],_0x5d1262[_0x8fc8('0x2e')]));if(_0x5c1bec[_0x8fc8('0x2d')][_0x8fc8('0x38')]){_0x332eeb['where']=_['merge'](_0x332eeb[_0x8fc8('0x36')],{'$or':_['map'](_0x332eeb[_0x8fc8('0x32')],function(_0xd5aec2){var _0x4b42b8={};_0x4b42b8[_0xd5aec2]={'$like':'%'+_0x5c1bec['query'][_0x8fc8('0x38')]+'%'};return _0x4b42b8;})});}_0x332eeb=_[_0x8fc8('0x39')]({},_0x332eeb,_0x5c1bec[_0x8fc8('0x41')]);return _0x1f80fd[_0x8fc8('0x45')](_0x332eeb);}})[_0x8fc8('0x22')](function(_0x295b95){if(_0x295b95){_0x577a27=_0x295b95[_0x8fc8('0x49')];if(!_0x5c1bec[_0x8fc8('0x2d')][_0x8fc8('0x4a')]('nolimit')){_0x332eeb['limit']=qs[_0x8fc8('0x1d')](_0x5c1bec[_0x8fc8('0x2d')]['limit']);_0x332eeb[_0x8fc8('0x1c')]=qs[_0x8fc8('0x1c')](_0x5c1bec[_0x8fc8('0x2d')][_0x8fc8('0x1c')]);}return _0x1f80fd[_0x8fc8('0x45')](_0x332eeb);}})[_0x8fc8('0x22')](function(_0xc6ef1e){if(_0xc6ef1e){return _0xc6ef1e?{'count':_0x577a27,'rows':_0xc6ef1e}:null;}})['then'](respondWithResult(_0x5ad070,null))[_0x8fc8('0x3d')](handleError(_0x5ad070,null));};exports[_0x8fc8('0x4b')]=function(_0x32eaa8,_0x385d04,_0x5bd28d){var _0x3a2c4c={};var _0x3efc81={};var _0x401279;var _0x29e39c;return db[_0x8fc8('0x3c')][_0x8fc8('0x46')]({'where':{'id':_0x32eaa8[_0x8fc8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x385d04,null))[_0x8fc8('0x22')](function(_0x302abe){if(_0x302abe){_0x401279=_0x302abe;_0x3efc81[_0x8fc8('0x30')]=_[_0x8fc8('0x47')](db['ZohoField']['rawAttributes']);_0x3efc81[_0x8fc8('0x2d')]=_[_0x8fc8('0x47')](_0x32eaa8[_0x8fc8('0x2d')]);_0x3efc81['filters']=_['intersection'](_0x3efc81[_0x8fc8('0x30')],_0x3efc81[_0x8fc8('0x2d')]);_0x3a2c4c['attributes']=_['intersection'](_0x3efc81[_0x8fc8('0x30')],qs[_0x8fc8('0x31')](_0x32eaa8['query'][_0x8fc8('0x31')]));_0x3a2c4c[_0x8fc8('0x32')]=_0x3a2c4c[_0x8fc8('0x32')][_0x8fc8('0x49')]?_0x3a2c4c[_0x8fc8('0x32')]:_0x3efc81[_0x8fc8('0x30')];_0x3a2c4c[_0x8fc8('0x34')]=qs['sort'](_0x32eaa8['query'][_0x8fc8('0x35')]);_0x3a2c4c[_0x8fc8('0x36')]=qs[_0x8fc8('0x2e')](_[_0x8fc8('0x37')](_0x32eaa8[_0x8fc8('0x2d')],_0x3efc81['filters']));if(_0x32eaa8[_0x8fc8('0x2d')][_0x8fc8('0x38')]){_0x3a2c4c['where']=_[_0x8fc8('0x39')](_0x3a2c4c['where'],{'$or':_[_0x8fc8('0x28')](_0x3a2c4c[_0x8fc8('0x32')],function(_0x46b68a){var _0x564515={};_0x564515[_0x46b68a]={'$like':'%'+_0x32eaa8[_0x8fc8('0x2d')][_0x8fc8('0x38')]+'%'};return _0x564515;})});}_0x3a2c4c=_['merge']({},_0x3a2c4c,_0x32eaa8[_0x8fc8('0x41')]);return _0x401279[_0x8fc8('0x4b')](_0x3a2c4c);}})[_0x8fc8('0x22')](function(_0x132087){if(_0x132087){_0x29e39c=_0x132087[_0x8fc8('0x49')];if(!_0x32eaa8[_0x8fc8('0x2d')][_0x8fc8('0x4a')](_0x8fc8('0x33'))){_0x3a2c4c[_0x8fc8('0x1d')]=qs['limit'](_0x32eaa8[_0x8fc8('0x2d')]['limit']);_0x3a2c4c[_0x8fc8('0x1c')]=qs[_0x8fc8('0x1c')](_0x32eaa8[_0x8fc8('0x2d')][_0x8fc8('0x1c')]);}return _0x401279[_0x8fc8('0x4b')](_0x3a2c4c);}})[_0x8fc8('0x22')](function(_0x5e7d9e){if(_0x5e7d9e){return _0x5e7d9e?{'count':_0x29e39c,'rows':_0x5e7d9e}:null;}})[_0x8fc8('0x22')](respondWithResult(_0x385d04,null))[_0x8fc8('0x3d')](handleError(_0x385d04,null));};exports['getDescriptions']=function(_0x5a177a,_0x4621ac,_0x58b3f7){var _0x44e732={};var _0x2e2148={};var _0x9523b5;var _0x100b6c;return db[_0x8fc8('0x3c')]['findOne']({'where':{'id':_0x5a177a[_0x8fc8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4621ac,null))[_0x8fc8('0x22')](function(_0x12d0ed){if(_0x12d0ed){_0x9523b5=_0x12d0ed;_0x2e2148[_0x8fc8('0x30')]=_[_0x8fc8('0x47')](db[_0x8fc8('0x48')][_0x8fc8('0x29')]);_0x2e2148[_0x8fc8('0x2d')]=_[_0x8fc8('0x47')](_0x5a177a[_0x8fc8('0x2d')]);_0x2e2148['filters']=_[_0x8fc8('0x2f')](_0x2e2148[_0x8fc8('0x30')],_0x2e2148[_0x8fc8('0x2d')]);_0x44e732[_0x8fc8('0x32')]=_[_0x8fc8('0x2f')](_0x2e2148[_0x8fc8('0x30')],qs[_0x8fc8('0x31')](_0x5a177a[_0x8fc8('0x2d')][_0x8fc8('0x31')]));_0x44e732['attributes']=_0x44e732['attributes'][_0x8fc8('0x49')]?_0x44e732[_0x8fc8('0x32')]:_0x2e2148[_0x8fc8('0x30')];_0x44e732[_0x8fc8('0x34')]=qs[_0x8fc8('0x35')](_0x5a177a[_0x8fc8('0x2d')][_0x8fc8('0x35')]);_0x44e732['where']=qs[_0x8fc8('0x2e')](_[_0x8fc8('0x37')](_0x5a177a[_0x8fc8('0x2d')],_0x2e2148['filters']));if(_0x5a177a[_0x8fc8('0x2d')][_0x8fc8('0x38')]){_0x44e732[_0x8fc8('0x36')]=_[_0x8fc8('0x39')](_0x44e732[_0x8fc8('0x36')],{'$or':_['map'](_0x44e732[_0x8fc8('0x32')],function(_0xaddc5a){var _0x137771={};_0x137771[_0xaddc5a]={'$like':'%'+_0x5a177a['query'][_0x8fc8('0x38')]+'%'};return _0x137771;})});}_0x44e732=_[_0x8fc8('0x39')]({},_0x44e732,_0x5a177a['options']);return _0x9523b5[_0x8fc8('0x4c')](_0x44e732);}})['then'](function(_0x2a683b){if(_0x2a683b){_0x100b6c=_0x2a683b[_0x8fc8('0x49')];if(!_0x5a177a[_0x8fc8('0x2d')][_0x8fc8('0x4a')](_0x8fc8('0x33'))){_0x44e732[_0x8fc8('0x1d')]=qs['limit'](_0x5a177a['query'][_0x8fc8('0x1d')]);_0x44e732[_0x8fc8('0x1c')]=qs[_0x8fc8('0x1c')](_0x5a177a[_0x8fc8('0x2d')][_0x8fc8('0x1c')]);}return _0x9523b5[_0x8fc8('0x4c')](_0x44e732);}})[_0x8fc8('0x22')](function(_0x58f27c){if(_0x58f27c){return _0x58f27c?{'count':_0x100b6c,'rows':_0x58f27c}:null;}})[_0x8fc8('0x22')](respondWithResult(_0x4621ac,null))['catch'](handleError(_0x4621ac,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index c2bd739..8a76b6f 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 _0xc90e=['moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoConfiguration.attributes','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','api'];(function(_0xf130d,_0x3bc2c9){var _0x58c72c=function(_0x3cfa9){while(--_0x3cfa9){_0xf130d['push'](_0xf130d['shift']());}};_0x58c72c(++_0x3bc2c9);}(_0xc90e,0xce));var _0xec90=function(_0x1d5961,_0x1befec){_0x1d5961=_0x1d5961-0x0;var _0x5cd6b6=_0xc90e[_0x1d5961];return _0x5cd6b6;};'use strict';var _=require(_0xec90('0x0'));var util=require('util');var logger=require(_0xec90('0x1'))(_0xec90('0x2'));var moment=require(_0xec90('0x3'));var BPromise=require(_0xec90('0x4'));var rp=require(_0xec90('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xec90('0x6'));var config=require(_0xec90('0x7'));var attributes=require(_0xec90('0x8'));module['exports']=function(_0x1fe13a,_0x561900){return _0x1fe13a['define'](_0xec90('0x9'),attributes,{'tableName':_0xec90('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc910=['path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','../../config/logger','moment','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc910,0x104));var _0x0c91=function(_0x15f4b7,_0x385011){_0x15f4b7=_0x15f4b7-0x0;var _0x131e2d=_0xc910[_0x15f4b7];return _0x131e2d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0c91('0x0'))('api');var moment=require(_0x0c91('0x1'));var BPromise=require(_0x0c91('0x2'));var rp=require(_0x0c91('0x3'));var fs=require('fs');var path=require(_0x0c91('0x4'));var rimraf=require(_0x0c91('0x5'));var config=require(_0x0c91('0x6'));var attributes=require(_0x0c91('0x7'));module[_0x0c91('0x8')]=function(_0x42d4cf,_0xe48a50){return _0x42d4cf[_0x0c91('0x9')](_0x0c91('0xa'),attributes,{'tableName':_0x0c91('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index fc5597d..8a7bdb4 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 _0xeade=['info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x195c21,_0x332612){var _0x3576a8=function(_0xa4bde2){while(--_0xa4bde2){_0x195c21['push'](_0x195c21['shift']());}};_0x3576a8(++_0x332612);}(_0xeade,0x18a));var _0xeead=function(_0xb953a0,_0x8fccb8){_0xb953a0=_0xb953a0-0x0;var _0x285d4f=_0xeade[_0xb953a0];return _0x285d4f;};'use strict';var _=require(_0xeead('0x0'));var util=require(_0xeead('0x1'));var moment=require(_0xeead('0x2'));var BPromise=require('bluebird');var rs=require(_0xeead('0x3'));var fs=require('fs');var Redis=require(_0xeead('0x4'));var db=require(_0xeead('0x5'))['db'];var utils=require(_0xeead('0x6'));var logger=require(_0xeead('0x7'))(_0xeead('0x8'));var config=require('../../config/environment');var jayson=require(_0xeead('0x9'));var client=jayson[_0xeead('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10337b,_0x64165e,_0x181407){return new BPromise(function(_0x577b7d,_0xf9a64a){return client[_0xeead('0xb')](_0x10337b,_0x181407)[_0xeead('0xc')](function(_0x35f9f9){logger['info'](_0xeead('0xd'),_0x64165e,_0xeead('0xe'));logger[_0xeead('0xf')](_0xeead('0x10'),_0x64165e,_0xeead('0xe'),JSON[_0xeead('0x11')](_0x35f9f9));if(_0x35f9f9[_0xeead('0x12')]){if(_0x35f9f9['error']['code']===0x1f4){logger[_0xeead('0x12')](_0xeead('0xd'),_0x64165e,_0x35f9f9['error'][_0xeead('0x13')]);return _0xf9a64a(_0x35f9f9[_0xeead('0x12')]['message']);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x64165e,_0x35f9f9['error']['message']);return _0x577b7d(_0x35f9f9[_0xeead('0x12')]['message']);}else{logger[_0xeead('0x14')](_0xeead('0xd'),_0x64165e,_0xeead('0xe'));_0x577b7d(_0x35f9f9[_0xeead('0x15')]['message']);}})[_0xeead('0x16')](function(_0x101b98){logger['error'](_0xeead('0xd'),_0x64165e,_0x101b98);_0xf9a64a(_0x101b98);});});} \ No newline at end of file +var _0x9dda=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x9dda,0x6d));var _0xa9dd=function(_0x34a500,_0x23d8df){_0x34a500=_0x34a500-0x0;var _0x5f3f27=_0x9dda[_0x34a500];return _0x5f3f27;};'use strict';var _=require(_0xa9dd('0x0'));var util=require(_0xa9dd('0x1'));var moment=require(_0xa9dd('0x2'));var BPromise=require('bluebird');var rs=require(_0xa9dd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9dd('0x4'))['db'];var utils=require(_0xa9dd('0x5'));var logger=require(_0xa9dd('0x6'))('rpc');var config=require(_0xa9dd('0x7'));var jayson=require(_0xa9dd('0x8'));var client=jayson['client'][_0xa9dd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbeb10a,_0xb473c8,_0x48d4c1){return new BPromise(function(_0x5952a4,_0x5e7d17){return client[_0xa9dd('0xa')](_0xbeb10a,_0x48d4c1)[_0xa9dd('0xb')](function(_0x201bea){logger[_0xa9dd('0xc')](_0xa9dd('0xd'),_0xb473c8,_0xa9dd('0xe'));logger[_0xa9dd('0xf')](_0xa9dd('0x10'),_0xb473c8,_0xa9dd('0xe'),JSON[_0xa9dd('0x11')](_0x201bea));if(_0x201bea['error']){if(_0x201bea[_0xa9dd('0x12')][_0xa9dd('0x13')]===0x1f4){logger[_0xa9dd('0x12')](_0xa9dd('0xd'),_0xb473c8,_0x201bea[_0xa9dd('0x12')][_0xa9dd('0x14')]);return _0x5e7d17(_0x201bea[_0xa9dd('0x12')][_0xa9dd('0x14')]);}logger[_0xa9dd('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0xb473c8,_0x201bea[_0xa9dd('0x12')][_0xa9dd('0x14')]);return _0x5952a4(_0x201bea[_0xa9dd('0x12')][_0xa9dd('0x14')]);}else{logger[_0xa9dd('0xc')](_0xa9dd('0xd'),_0xb473c8,_0xa9dd('0xe'));_0x5952a4(_0x201bea[_0xa9dd('0x15')][_0xa9dd('0x14')]);}})['catch'](function(_0x191a02){logger[_0xa9dd('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0xb473c8,_0x191a02);_0x5e7d17(_0x191a02);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index b2ad889..24cdee4 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 _0xa50a=['isAuthenticated','index','/:id','post','create','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5f3823,_0x2b53ef){var _0x1b983b=function(_0x44c7b2){while(--_0x44c7b2){_0x5f3823['push'](_0x5f3823['shift']());}};_0x1b983b(++_0x2b53ef);}(_0xa50a,0x134));var _0xaa50=function(_0x243c5c,_0x3dd30c){_0x243c5c=_0x243c5c-0x0;var _0x486e0f=_0xa50a[_0x243c5c];return _0x486e0f;};'use strict';var multer=require(_0xaa50('0x0'));var util=require(_0xaa50('0x1'));var path=require(_0xaa50('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaa50('0x3')]();var fs_extra=require(_0xaa50('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xaa50('0x5'));var config=require(_0xaa50('0x6'));var controller=require('./intZohoField.controller');router['get']('/',auth[_0xaa50('0x7')](),controller[_0xaa50('0x8')]);router['get'](_0xaa50('0x9'),auth[_0xaa50('0x7')](),controller['show']);router[_0xaa50('0xa')]('/',auth[_0xaa50('0x7')](),controller[_0xaa50('0xb')]);router['put'](_0xaa50('0x9'),auth[_0xaa50('0x7')](),controller['update']);router[_0xaa50('0xc')](_0xaa50('0x9'),auth[_0xaa50('0x7')](),controller[_0xaa50('0xd')]);module[_0xaa50('0xe')]=router; \ No newline at end of file +var _0x2d0c=['fs-extra','../../config/environment','./intZohoField.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x32abd7,_0x2a2a77){var _0x12878c=function(_0x3a12c7){while(--_0x3a12c7){_0x32abd7['push'](_0x32abd7['shift']());}};_0x12878c(++_0x2a2a77);}(_0x2d0c,0xc1));var _0xc2d0=function(_0x38f5f8,_0xefe164){_0x38f5f8=_0x38f5f8-0x0;var _0x34e820=_0x2d0c[_0x38f5f8];return _0x34e820;};'use strict';var multer=require(_0xc2d0('0x0'));var util=require(_0xc2d0('0x1'));var path=require('path');var timeout=require(_0xc2d0('0x2'));var express=require(_0xc2d0('0x3'));var router=express[_0xc2d0('0x4')]();var fs_extra=require(_0xc2d0('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc2d0('0x6'));var controller=require(_0xc2d0('0x7'));router[_0xc2d0('0x8')]('/',auth[_0xc2d0('0x9')](),controller['index']);router['get'](_0xc2d0('0xa'),auth[_0xc2d0('0x9')](),controller[_0xc2d0('0xb')]);router[_0xc2d0('0xc')]('/',auth[_0xc2d0('0x9')](),controller[_0xc2d0('0xd')]);router['put'](_0xc2d0('0xa'),auth['isAuthenticated'](),controller[_0xc2d0('0xe')]);router[_0xc2d0('0xf')](_0xc2d0('0xa'),auth[_0xc2d0('0x9')](),controller[_0xc2d0('0x10')]);module[_0xc2d0('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index b2ad656..81ae3ad 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 _0x7119=['string','STRING','ENUM','customVariable','BOOLEAN','sequelize','variable','picklist'];(function(_0x64408,_0x27f75b){var _0x2216dd=function(_0x2eafee){while(--_0x2eafee){_0x64408['push'](_0x64408['shift']());}};_0x2216dd(++_0x27f75b);}(_0x7119,0x6d));var _0x9711=function(_0x3815c2,_0x1f54e3){_0x3815c2=_0x3815c2-0x0;var _0x271f88=_0x7119[_0x3815c2];return _0x271f88;};'use strict';var Sequelize=require(_0x9711('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x9711('0x1'),'customVariable','keyValue',_0x9711('0x2')),'defaultValue':_0x9711('0x3')},'content':{'type':Sequelize[_0x9711('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9711('0x5')](_0x9711('0x3'),'variable',_0x9711('0x6'))},'keyContent':{'type':Sequelize[_0x9711('0x4')]},'idField':{'type':Sequelize[_0x9711('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9711('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9711('0x4')]}}; \ No newline at end of file +var _0x8a63=['string','variable','customVariable','picklist','STRING','sequelize','exports','ENUM'];(function(_0x2adfb1,_0x406e6e){var _0xa52d45=function(_0x2de16c){while(--_0x2de16c){_0x2adfb1['push'](_0x2adfb1['shift']());}};_0xa52d45(++_0x406e6e);}(_0x8a63,0x155));var _0x38a6=function(_0x59145c,_0x94d69a){_0x59145c=_0x59145c-0x0;var _0x4651d0=_0x8a63[_0x59145c];return _0x4651d0;};'use strict';var Sequelize=require(_0x38a6('0x0'));module[_0x38a6('0x1')]={'type':{'type':Sequelize[_0x38a6('0x2')](_0x38a6('0x3'),_0x38a6('0x4'),_0x38a6('0x5'),'keyValue',_0x38a6('0x6')),'defaultValue':_0x38a6('0x3')},'content':{'type':Sequelize[_0x38a6('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x38a6('0x2')](_0x38a6('0x3'),_0x38a6('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x38a6('0x7')]},'idField':{'type':Sequelize[_0x38a6('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x38a6('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index e414d24..dbc7cbf 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 _0x8ab2=['rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','destroy','stack','name','send','map','ZohoField','rawAttributes','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find'];(function(_0x5467f1,_0x4ca013){var _0x1c1041=function(_0x2d1764){while(--_0x2d1764){_0x5467f1['push'](_0x5467f1['shift']());}};_0x1c1041(++_0x4ca013);}(_0x8ab2,0x1b0));var _0x28ab=function(_0x20f2b7,_0x107c44){_0x20f2b7=_0x20f2b7-0x0;var _0x4cd117=_0x8ab2[_0x20f2b7];return _0x4cd117;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x28ab('0x0'));var zipdir=require(_0x28ab('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x28ab('0x2'));var BPromise=require(_0x28ab('0x3'));var Mustache=require(_0x28ab('0x4'));var util=require(_0x28ab('0x5'));var path=require(_0x28ab('0x6'));var sox=require(_0x28ab('0x7'));var csv=require('to-csv');var ejs=require(_0x28ab('0x8'));var fs=require('fs');var fs_extra=require(_0x28ab('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x28ab('0xa'));var jsforce=require(_0x28ab('0xb'));var deskjs=require(_0x28ab('0xc'));var toCsv=require('to-csv');var querystring=require(_0x28ab('0xd'));var Papa=require('papaparse');var Redis=require(_0x28ab('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x28ab('0xf'));var as=require(_0x28ab('0x10'));var hardwareService=require(_0x28ab('0x11'));var logger=require(_0x28ab('0x12'))('api');var utils=require(_0x28ab('0x13'));var config=require(_0x28ab('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x28ab('0x15'))['db'];function respondWithStatusCode(_0x3d7c3f,_0x5506ff){_0x5506ff=_0x5506ff||0xcc;return function(_0x31b320){if(_0x31b320){return _0x3d7c3f[_0x28ab('0x16')](_0x5506ff);}return _0x3d7c3f['status'](_0x5506ff)[_0x28ab('0x17')]();};}function respondWithResult(_0x562b9d,_0x39b229){_0x39b229=_0x39b229||0xc8;return function(_0x4ae3bb){if(_0x4ae3bb){return _0x562b9d[_0x28ab('0x18')](_0x39b229)['json'](_0x4ae3bb);}};}function respondWithFilteredResult(_0x4c4e9c,_0x220901){return function(_0x35ad4b){if(_0x35ad4b){var _0x9caacf=typeof _0x220901[_0x28ab('0x19')]===_0x28ab('0x1a')&&typeof _0x220901[_0x28ab('0x1b')]===_0x28ab('0x1a');var _0x34d413=_0x35ad4b[_0x28ab('0x1c')];var _0x8a3c75=_0x9caacf?0x0:_0x220901[_0x28ab('0x19')];var _0x52d6ea=_0x9caacf?_0x35ad4b[_0x28ab('0x1c')]:_0x220901['offset']+_0x220901[_0x28ab('0x1b')];var _0x53400b;if(_0x52d6ea>=_0x34d413){_0x52d6ea=_0x34d413;_0x53400b=0xc8;}else{_0x53400b=0xce;}_0x4c4e9c['status'](_0x53400b);return _0x4c4e9c[_0x28ab('0x1d')]('Content-Range',_0x8a3c75+'-'+_0x52d6ea+'/'+_0x34d413)[_0x28ab('0x1e')](_0x35ad4b);}return null;};}function patchUpdates(_0x2ace07){return function(_0x3d2aef){try{jsonpatch[_0x28ab('0x1f')](_0x3d2aef,_0x2ace07,!![]);}catch(_0x30d0f7){return BPromise[_0x28ab('0x20')](_0x30d0f7);}return _0x3d2aef[_0x28ab('0x21')]();};}function saveUpdates(_0x543cd5,_0xe5264c){return function(_0x361b81){if(_0x361b81){return _0x361b81['update'](_0x543cd5)['then'](function(_0x4c3a9a){return _0x4c3a9a;});}return null;};}function removeEntity(_0x48a497,_0x4379ed){return function(_0x4a44e4){if(_0x4a44e4){return _0x4a44e4[_0x28ab('0x22')]()['then'](function(){_0x48a497[_0x28ab('0x18')](0xcc)[_0x28ab('0x17')]();});}};}function handleEntityNotFound(_0x1ab2cd,_0x33205){return function(_0x403d48){if(!_0x403d48){_0x1ab2cd[_0x28ab('0x16')](0x194);}return _0x403d48;};}function handleError(_0xb480c3,_0x2e6579){_0x2e6579=_0x2e6579||0x1f4;return function(_0x485b35){logger['error'](_0x485b35[_0x28ab('0x23')]);if(_0x485b35[_0x28ab('0x24')]){delete _0x485b35[_0x28ab('0x24')];}_0xb480c3[_0x28ab('0x18')](_0x2e6579)[_0x28ab('0x25')](_0x485b35);};}exports['index']=function(_0x11f304,_0x1b3948){var _0x5a6d10={},_0x3c8da0={},_0x442366={'count':0x0,'rows':[]};var _0x4d2a87=_[_0x28ab('0x26')](db[_0x28ab('0x27')][_0x28ab('0x28')],function(_0x5d9857){return{'name':_0x5d9857[_0x28ab('0x29')],'type':_0x5d9857['type']['key']};});_0x3c8da0[_0x28ab('0x2a')]=_['map'](_0x4d2a87,_0x28ab('0x24'));_0x3c8da0[_0x28ab('0x2b')]=_['keys'](_0x11f304[_0x28ab('0x2b')]);_0x3c8da0[_0x28ab('0x2c')]=_['intersection'](_0x3c8da0[_0x28ab('0x2a')],_0x3c8da0['query']);_0x5a6d10[_0x28ab('0x2d')]=_[_0x28ab('0x2e')](_0x3c8da0[_0x28ab('0x2a')],qs[_0x28ab('0x2f')](_0x11f304['query'][_0x28ab('0x2f')]));_0x5a6d10['attributes']=_0x5a6d10['attributes'][_0x28ab('0x30')]?_0x5a6d10[_0x28ab('0x2d')]:_0x3c8da0['model'];if(!_0x11f304[_0x28ab('0x2b')][_0x28ab('0x31')](_0x28ab('0x32'))){_0x5a6d10[_0x28ab('0x1b')]=qs[_0x28ab('0x1b')](_0x11f304[_0x28ab('0x2b')][_0x28ab('0x1b')]);_0x5a6d10[_0x28ab('0x19')]=qs['offset'](_0x11f304[_0x28ab('0x2b')][_0x28ab('0x19')]);}_0x5a6d10[_0x28ab('0x33')]=qs[_0x28ab('0x34')](_0x11f304['query'][_0x28ab('0x34')]);_0x5a6d10[_0x28ab('0x35')]=qs[_0x28ab('0x2c')](_[_0x28ab('0x36')](_0x11f304['query'],_0x3c8da0[_0x28ab('0x2c')]),_0x4d2a87);if(_0x11f304['query'][_0x28ab('0x37')]){_0x5a6d10[_0x28ab('0x35')]=_[_0x28ab('0x38')](_0x5a6d10[_0x28ab('0x35')],{'$or':_[_0x28ab('0x26')](_0x4d2a87,function(_0xe6c4b1){if(_0xe6c4b1[_0x28ab('0x39')]!==_0x28ab('0x3a')){var _0x5346fc={};_0x5346fc[_0xe6c4b1[_0x28ab('0x24')]]={'$like':'%'+_0x11f304['query']['filter']+'%'};return _0x5346fc;}})});}_0x5a6d10=_[_0x28ab('0x38')]({},_0x5a6d10,_0x11f304[_0x28ab('0x3b')]);var _0xbd5520={'where':_0x5a6d10['where']};return db['ZohoField'][_0x28ab('0x1c')](_0xbd5520)[_0x28ab('0x3c')](function(_0x32f414){_0x442366[_0x28ab('0x1c')]=_0x32f414;if(_0x11f304[_0x28ab('0x2b')][_0x28ab('0x3d')]){_0x5a6d10[_0x28ab('0x3e')]=[{'all':!![]}];}return db['ZohoField'][_0x28ab('0x3f')](_0x5a6d10);})[_0x28ab('0x3c')](function(_0x3cb218){_0x442366[_0x28ab('0x40')]=_0x3cb218;return _0x442366;})[_0x28ab('0x3c')](respondWithFilteredResult(_0x1b3948,_0x5a6d10))[_0x28ab('0x41')](handleError(_0x1b3948,null));};exports[_0x28ab('0x42')]=function(_0x29bc8c,_0x5405b5){var _0x2b0d9b={'raw':!![],'where':{'id':_0x29bc8c[_0x28ab('0x43')]['id']}},_0x534ff2={};_0x534ff2[_0x28ab('0x2a')]=_[_0x28ab('0x44')](db[_0x28ab('0x27')]['rawAttributes']);_0x534ff2['query']=_[_0x28ab('0x44')](_0x29bc8c[_0x28ab('0x2b')]);_0x534ff2[_0x28ab('0x2c')]=_[_0x28ab('0x2e')](_0x534ff2['model'],_0x534ff2[_0x28ab('0x2b')]);_0x2b0d9b[_0x28ab('0x2d')]=_[_0x28ab('0x2e')](_0x534ff2[_0x28ab('0x2a')],qs[_0x28ab('0x2f')](_0x29bc8c[_0x28ab('0x2b')][_0x28ab('0x2f')]));_0x2b0d9b[_0x28ab('0x2d')]=_0x2b0d9b['attributes'][_0x28ab('0x30')]?_0x2b0d9b[_0x28ab('0x2d')]:_0x534ff2[_0x28ab('0x2a')];if(_0x29bc8c['query'][_0x28ab('0x3d')]){_0x2b0d9b[_0x28ab('0x3e')]=[{'all':!![]}];}_0x2b0d9b=_[_0x28ab('0x38')]({},_0x2b0d9b,_0x29bc8c[_0x28ab('0x3b')]);return db['ZohoField']['find'](_0x2b0d9b)[_0x28ab('0x3c')](handleEntityNotFound(_0x5405b5,null))[_0x28ab('0x3c')](respondWithResult(_0x5405b5,null))[_0x28ab('0x41')](handleError(_0x5405b5,null));};exports[_0x28ab('0x45')]=function(_0x18031b,_0x51e3c3){return db['ZohoField'][_0x28ab('0x45')](_0x18031b[_0x28ab('0x46')],{})[_0x28ab('0x3c')](respondWithResult(_0x51e3c3,0xc9))[_0x28ab('0x41')](handleError(_0x51e3c3,null));};exports['update']=function(_0x2039d6,_0x3a8214){if(_0x2039d6[_0x28ab('0x46')]['id']){delete _0x2039d6[_0x28ab('0x46')]['id'];}return db[_0x28ab('0x27')][_0x28ab('0x47')]({'where':{'id':_0x2039d6[_0x28ab('0x43')]['id']}})[_0x28ab('0x3c')](handleEntityNotFound(_0x3a8214,null))['then'](saveUpdates(_0x2039d6[_0x28ab('0x46')],null))['then'](respondWithResult(_0x3a8214,null))[_0x28ab('0x41')](handleError(_0x3a8214,null));};exports['destroy']=function(_0x2ace3c,_0x657cd4){return db[_0x28ab('0x27')][_0x28ab('0x47')]({'where':{'id':_0x2ace3c[_0x28ab('0x43')]['id']}})[_0x28ab('0x3c')](handleEntityNotFound(_0x657cd4,null))['then'](removeEntity(_0x657cd4,null))[_0x28ab('0x41')](handleError(_0x657cd4,null));}; \ No newline at end of file +var _0xb716=['set','apply','reject','save','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZohoField','includeAll','include','findAll','rows','catch','show','params','fields','find','body','update','eml-format','rimraf','request-promise','bluebird','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x1e8401,_0x18738d){var _0x25ce7e=function(_0x568a2a){while(--_0x568a2a){_0x1e8401['push'](_0x1e8401['shift']());}};_0x25ce7e(++_0x18738d);}(_0xb716,0x14b));var _0x6b71=function(_0x3ab52f,_0x195d89){_0x3ab52f=_0x3ab52f-0x0;var _0x5ee3ca=_0xb716[_0x3ab52f];return _0x5ee3ca;};'use strict';var emlformat=require(_0x6b71('0x0'));var rimraf=require(_0x6b71('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b71('0x2'));var moment=require('moment');var BPromise=require(_0x6b71('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6b71('0x4'));var sox=require('sox');var csv=require(_0x6b71('0x5'));var ejs=require(_0x6b71('0x6'));var fs=require('fs');var fs_extra=require(_0x6b71('0x7'));var _=require('lodash');var squel=require(_0x6b71('0x8'));var crypto=require(_0x6b71('0x9'));var jsforce=require(_0x6b71('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6b71('0x5'));var querystring=require('querystring');var Papa=require(_0x6b71('0xb'));var Redis=require('ioredis');var authService=require(_0x6b71('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x6b71('0xd'));var hardwareService=require(_0x6b71('0xe'));var logger=require(_0x6b71('0xf'))(_0x6b71('0x10'));var utils=require(_0x6b71('0x11'));var config=require(_0x6b71('0x12'));var licenseUtil=require(_0x6b71('0x13'));var db=require(_0x6b71('0x14'))['db'];function respondWithStatusCode(_0x2e5868,_0x4718a5){_0x4718a5=_0x4718a5||0xcc;return function(_0x584169){if(_0x584169){return _0x2e5868[_0x6b71('0x15')](_0x4718a5);}return _0x2e5868[_0x6b71('0x16')](_0x4718a5)[_0x6b71('0x17')]();};}function respondWithResult(_0x40d19f,_0x114ac5){_0x114ac5=_0x114ac5||0xc8;return function(_0x235812){if(_0x235812){return _0x40d19f['status'](_0x114ac5)[_0x6b71('0x18')](_0x235812);}};}function respondWithFilteredResult(_0x461ed9,_0x30667f){return function(_0x843cb7){if(_0x843cb7){var _0x3e09c8=typeof _0x30667f[_0x6b71('0x19')]===_0x6b71('0x1a')&&typeof _0x30667f[_0x6b71('0x1b')]===_0x6b71('0x1a');var _0x5815db=_0x843cb7[_0x6b71('0x1c')];var _0x5cb7ee=_0x3e09c8?0x0:_0x30667f['offset'];var _0x435174=_0x3e09c8?_0x843cb7['count']:_0x30667f[_0x6b71('0x19')]+_0x30667f[_0x6b71('0x1b')];var _0x5c5782;if(_0x435174>=_0x5815db){_0x435174=_0x5815db;_0x5c5782=0xc8;}else{_0x5c5782=0xce;}_0x461ed9[_0x6b71('0x16')](_0x5c5782);return _0x461ed9[_0x6b71('0x1d')]('Content-Range',_0x5cb7ee+'-'+_0x435174+'/'+_0x5815db)[_0x6b71('0x18')](_0x843cb7);}return null;};}function patchUpdates(_0x578b53){return function(_0x3a8631){try{jsonpatch[_0x6b71('0x1e')](_0x3a8631,_0x578b53,!![]);}catch(_0x13f405){return BPromise[_0x6b71('0x1f')](_0x13f405);}return _0x3a8631[_0x6b71('0x20')]();};}function saveUpdates(_0x40313f,_0x1cf74b){return function(_0x48e1c8){if(_0x48e1c8){return _0x48e1c8['update'](_0x40313f)[_0x6b71('0x21')](function(_0x4fd6c2){return _0x4fd6c2;});}return null;};}function removeEntity(_0x50563f,_0x2182d3){return function(_0x4d25b7){if(_0x4d25b7){return _0x4d25b7[_0x6b71('0x22')]()['then'](function(){_0x50563f[_0x6b71('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x222ddd,_0xe02d84){return function(_0x144081){if(!_0x144081){_0x222ddd['sendStatus'](0x194);}return _0x144081;};}function handleError(_0x28bb71,_0x41efed){_0x41efed=_0x41efed||0x1f4;return function(_0x55aa18){logger[_0x6b71('0x23')](_0x55aa18['stack']);if(_0x55aa18['name']){delete _0x55aa18[_0x6b71('0x24')];}_0x28bb71[_0x6b71('0x16')](_0x41efed)[_0x6b71('0x25')](_0x55aa18);};}exports[_0x6b71('0x26')]=function(_0x410468,_0x3b7708){var _0x4e70a9={},_0x58790e={},_0x29761a={'count':0x0,'rows':[]};var _0x4e5eb6=_[_0x6b71('0x27')](db['ZohoField'][_0x6b71('0x28')],function(_0x2395a4){return{'name':_0x2395a4[_0x6b71('0x29')],'type':_0x2395a4[_0x6b71('0x2a')][_0x6b71('0x2b')]};});_0x58790e[_0x6b71('0x2c')]=_[_0x6b71('0x27')](_0x4e5eb6,_0x6b71('0x24'));_0x58790e[_0x6b71('0x2d')]=_[_0x6b71('0x2e')](_0x410468[_0x6b71('0x2d')]);_0x58790e[_0x6b71('0x2f')]=_[_0x6b71('0x30')](_0x58790e[_0x6b71('0x2c')],_0x58790e['query']);_0x4e70a9[_0x6b71('0x31')]=_['intersection'](_0x58790e[_0x6b71('0x2c')],qs['fields'](_0x410468[_0x6b71('0x2d')]['fields']));_0x4e70a9[_0x6b71('0x31')]=_0x4e70a9[_0x6b71('0x31')][_0x6b71('0x32')]?_0x4e70a9[_0x6b71('0x31')]:_0x58790e[_0x6b71('0x2c')];if(!_0x410468[_0x6b71('0x2d')]['hasOwnProperty'](_0x6b71('0x33'))){_0x4e70a9['limit']=qs[_0x6b71('0x1b')](_0x410468[_0x6b71('0x2d')]['limit']);_0x4e70a9[_0x6b71('0x19')]=qs['offset'](_0x410468[_0x6b71('0x2d')]['offset']);}_0x4e70a9[_0x6b71('0x34')]=qs[_0x6b71('0x35')](_0x410468[_0x6b71('0x2d')][_0x6b71('0x35')]);_0x4e70a9[_0x6b71('0x36')]=qs[_0x6b71('0x2f')](_[_0x6b71('0x37')](_0x410468['query'],_0x58790e[_0x6b71('0x2f')]),_0x4e5eb6);if(_0x410468[_0x6b71('0x2d')][_0x6b71('0x38')]){_0x4e70a9['where']=_[_0x6b71('0x39')](_0x4e70a9[_0x6b71('0x36')],{'$or':_[_0x6b71('0x27')](_0x4e5eb6,function(_0x284fd6){if(_0x284fd6['type']!==_0x6b71('0x3a')){var _0x155b39={};_0x155b39[_0x284fd6[_0x6b71('0x24')]]={'$like':'%'+_0x410468[_0x6b71('0x2d')][_0x6b71('0x38')]+'%'};return _0x155b39;}})});}_0x4e70a9=_[_0x6b71('0x39')]({},_0x4e70a9,_0x410468[_0x6b71('0x3b')]);var _0x22b4a3={'where':_0x4e70a9['where']};return db[_0x6b71('0x3c')][_0x6b71('0x1c')](_0x22b4a3)['then'](function(_0xc36f02){_0x29761a[_0x6b71('0x1c')]=_0xc36f02;if(_0x410468[_0x6b71('0x2d')][_0x6b71('0x3d')]){_0x4e70a9[_0x6b71('0x3e')]=[{'all':!![]}];}return db['ZohoField'][_0x6b71('0x3f')](_0x4e70a9);})[_0x6b71('0x21')](function(_0x7a8053){_0x29761a[_0x6b71('0x40')]=_0x7a8053;return _0x29761a;})['then'](respondWithFilteredResult(_0x3b7708,_0x4e70a9))[_0x6b71('0x41')](handleError(_0x3b7708,null));};exports[_0x6b71('0x42')]=function(_0x3faec5,_0x20adc6){var _0x51326d={'raw':!![],'where':{'id':_0x3faec5[_0x6b71('0x43')]['id']}},_0x5baa0b={};_0x5baa0b['model']=_[_0x6b71('0x2e')](db[_0x6b71('0x3c')]['rawAttributes']);_0x5baa0b['query']=_[_0x6b71('0x2e')](_0x3faec5[_0x6b71('0x2d')]);_0x5baa0b[_0x6b71('0x2f')]=_[_0x6b71('0x30')](_0x5baa0b[_0x6b71('0x2c')],_0x5baa0b[_0x6b71('0x2d')]);_0x51326d['attributes']=_[_0x6b71('0x30')](_0x5baa0b[_0x6b71('0x2c')],qs[_0x6b71('0x44')](_0x3faec5['query'][_0x6b71('0x44')]));_0x51326d[_0x6b71('0x31')]=_0x51326d[_0x6b71('0x31')][_0x6b71('0x32')]?_0x51326d[_0x6b71('0x31')]:_0x5baa0b[_0x6b71('0x2c')];if(_0x3faec5[_0x6b71('0x2d')][_0x6b71('0x3d')]){_0x51326d['include']=[{'all':!![]}];}_0x51326d=_[_0x6b71('0x39')]({},_0x51326d,_0x3faec5[_0x6b71('0x3b')]);return db[_0x6b71('0x3c')][_0x6b71('0x45')](_0x51326d)[_0x6b71('0x21')](handleEntityNotFound(_0x20adc6,null))['then'](respondWithResult(_0x20adc6,null))[_0x6b71('0x41')](handleError(_0x20adc6,null));};exports['create']=function(_0x4642f5,_0x4a23e3){return db[_0x6b71('0x3c')]['create'](_0x4642f5[_0x6b71('0x46')],{})[_0x6b71('0x21')](respondWithResult(_0x4a23e3,0xc9))[_0x6b71('0x41')](handleError(_0x4a23e3,null));};exports[_0x6b71('0x47')]=function(_0x35e436,_0x54dbf7){if(_0x35e436[_0x6b71('0x46')]['id']){delete _0x35e436[_0x6b71('0x46')]['id'];}return db[_0x6b71('0x3c')]['find']({'where':{'id':_0x35e436[_0x6b71('0x43')]['id']}})[_0x6b71('0x21')](handleEntityNotFound(_0x54dbf7,null))[_0x6b71('0x21')](saveUpdates(_0x35e436[_0x6b71('0x46')],null))[_0x6b71('0x21')](respondWithResult(_0x54dbf7,null))[_0x6b71('0x41')](handleError(_0x54dbf7,null));};exports[_0x6b71('0x22')]=function(_0x1d8bb7,_0x4f8c13){return db[_0x6b71('0x3c')]['find']({'where':{'id':_0x1d8bb7[_0x6b71('0x43')]['id']}})[_0x6b71('0x21')](handleEntityNotFound(_0x4f8c13,null))['then'](removeEntity(_0x4f8c13,null))[_0x6b71('0x41')](handleError(_0x4f8c13,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index d5c6521..7738b95 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 _0xb016=['rimraf','../../config/environment','exports','int_zoho_fields','zoho_unique_index','lodash','util','moment','request-promise','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb016,0x159));var _0x6b01=function(_0x37270f,_0x4f4fe9){_0x37270f=_0x37270f-0x0;var _0x4989da=_0xb016[_0x37270f];return _0x4989da;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6b01('0x2'));var BPromise=require('bluebird');var rp=require(_0x6b01('0x3'));var fs=require('fs');var path=require(_0x6b01('0x4'));var rimraf=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var attributes=require('./intZohoField.attributes');module[_0x6b01('0x7')]=function(_0x65407a,_0x192b2d){return _0x65407a['define']('ZohoField',attributes,{'tableName':_0x6b01('0x8'),'paranoid':![],'indexes':[{'name':_0x6b01('0x9'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6d11=['exports','define','ZohoField','int_zoho_fields','lodash','util','../../config/logger','moment','request-promise','path','./intZohoField.attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6d11,0xbf));var _0x16d1=function(_0x18e6bf,_0xbbf810){_0x18e6bf=_0x18e6bf-0x0;var _0x3bb89a=_0x6d11[_0x18e6bf];return _0x3bb89a;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var logger=require(_0x16d1('0x2'))('api');var moment=require(_0x16d1('0x3'));var BPromise=require('bluebird');var rp=require(_0x16d1('0x4'));var fs=require('fs');var path=require(_0x16d1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x16d1('0x6'));module[_0x16d1('0x7')]=function(_0x3eb9e2,_0x38626d){return _0x3eb9e2[_0x16d1('0x8')](_0x16d1('0x9'),attributes,{'tableName':_0x16d1('0xa'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index abc4eb7..0f6f7a8 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 _0x797f=['then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x29041b,_0x34b735){var _0x34d1a1=function(_0x29243f){while(--_0x29243f){_0x29041b['push'](_0x29041b['shift']());}};_0x34d1a1(++_0x34b735);}(_0x797f,0x129));var _0xf797=function(_0x5c71fb,_0x3b7971){_0x5c71fb=_0x5c71fb-0x0;var _0xd2786e=_0x797f[_0x5c71fb];return _0xd2786e;};'use strict';var _=require(_0xf797('0x0'));var util=require('util');var moment=require(_0xf797('0x1'));var BPromise=require('bluebird');var rs=require(_0xf797('0x2'));var fs=require('fs');var Redis=require(_0xf797('0x3'));var db=require(_0xf797('0x4'))['db'];var utils=require(_0xf797('0x5'));var logger=require(_0xf797('0x6'))(_0xf797('0x7'));var config=require(_0xf797('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf797('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19492a,_0x190991,_0x564a45){return new BPromise(function(_0x65fc2f,_0x27866c){return client[_0xf797('0xa')](_0x19492a,_0x564a45)[_0xf797('0xb')](function(_0xf210bf){logger[_0xf797('0xc')]('ZohoField,\x20%s,\x20%s',_0x190991,_0xf797('0xd'));logger[_0xf797('0xe')](_0xf797('0xf'),_0x190991,_0xf797('0xd'),JSON[_0xf797('0x10')](_0xf210bf));if(_0xf210bf[_0xf797('0x11')]){if(_0xf210bf[_0xf797('0x11')][_0xf797('0x12')]===0x1f4){logger[_0xf797('0x11')](_0xf797('0x13'),_0x190991,_0xf210bf['error'][_0xf797('0x14')]);return _0x27866c(_0xf210bf[_0xf797('0x11')][_0xf797('0x14')]);}logger[_0xf797('0x11')](_0xf797('0x13'),_0x190991,_0xf210bf[_0xf797('0x11')][_0xf797('0x14')]);return _0x65fc2f(_0xf210bf[_0xf797('0x11')][_0xf797('0x14')]);}else{logger[_0xf797('0xc')]('ZohoField,\x20%s,\x20%s',_0x190991,_0xf797('0xd'));_0x65fc2f(_0xf210bf[_0xf797('0x15')][_0xf797('0x14')]);}})['catch'](function(_0x5af456){logger['error'](_0xf797('0x13'),_0x190991,_0x5af456);_0x27866c(_0x5af456);});});} \ No newline at end of file +var _0x59bc=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','message','ZohoField,\x20%s,\x20%s','info'];(function(_0x2e5daf,_0x41df75){var _0x28be81=function(_0x34fa30){while(--_0x34fa30){_0x2e5daf['push'](_0x2e5daf['shift']());}};_0x28be81(++_0x41df75);}(_0x59bc,0x8c));var _0xc59b=function(_0x9de2c0,_0x1b3b0b){_0x9de2c0=_0x9de2c0-0x0;var _0x168de1=_0x59bc[_0x9de2c0];return _0x168de1;};'use strict';var _=require(_0xc59b('0x0'));var util=require(_0xc59b('0x1'));var moment=require('moment');var BPromise=require(_0xc59b('0x2'));var rs=require(_0xc59b('0x3'));var fs=require('fs');var Redis=require(_0xc59b('0x4'));var db=require(_0xc59b('0x5'))['db'];var utils=require(_0xc59b('0x6'));var logger=require('../../config/logger')(_0xc59b('0x7'));var config=require('../../config/environment');var jayson=require(_0xc59b('0x8'));var client=jayson[_0xc59b('0x9')][_0xc59b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cbebb,_0x51be51,_0x3c66d3){return new BPromise(function(_0x300e1f,_0x3d77e6){return client[_0xc59b('0xb')](_0x5cbebb,_0x3c66d3)[_0xc59b('0xc')](function(_0x833cc){logger['info']('ZohoField,\x20%s,\x20%s',_0x51be51,_0xc59b('0xd'));logger[_0xc59b('0xe')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x51be51,_0xc59b('0xd'),JSON[_0xc59b('0xf')](_0x833cc));if(_0x833cc['error']){if(_0x833cc[_0xc59b('0x10')][_0xc59b('0x11')]===0x1f4){logger[_0xc59b('0x10')]('ZohoField,\x20%s,\x20%s',_0x51be51,_0x833cc['error']['message']);return _0x3d77e6(_0x833cc['error'][_0xc59b('0x12')]);}logger[_0xc59b('0x10')](_0xc59b('0x13'),_0x51be51,_0x833cc[_0xc59b('0x10')][_0xc59b('0x12')]);return _0x300e1f(_0x833cc[_0xc59b('0x10')]['message']);}else{logger[_0xc59b('0x14')](_0xc59b('0x13'),_0x51be51,_0xc59b('0xd'));_0x300e1f(_0x833cc[_0xc59b('0x15')][_0xc59b('0x12')]);}})[_0xc59b('0x16')](function(_0x408937){logger[_0xc59b('0x10')](_0xc59b('0x13'),_0x51be51,_0x408937);_0x3d77e6(_0x408937);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index be858c8..4b5201a 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(_0x50d249,_0x564d13){var _0x267287=function(_0x3ee809){while(--_0x3ee809){_0x50d249['push'](_0x50d249['shift']());}};_0x267287(++_0x564d13);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x28e58a,_0x491504){var _0x36c438=function(_0x1cf223){while(--_0x1cf223){_0x28e58a['push'](_0x28e58a['shift']());}};_0x36c438(++_0x491504);}(_0xe706,0xa3));var _0x6e70=function(_0x40dcd1,_0x5cd1da){_0x40dcd1=_0x40dcd1-0x0;var _0x5c056b=_0xe706[_0x40dcd1];return _0x5c056b;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 5c59514..cbec35d 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 _0xfd2d=['app.js','BOOLEAN','state','exports','STRING','unique_name_and_version'];(function(_0x271b31,_0x326f43){var _0xcd2a29=function(_0x57e320){while(--_0x57e320){_0x271b31['push'](_0x271b31['shift']());}};_0xcd2a29(++_0x326f43);}(_0xfd2d,0x17d));var _0xdfd2=function(_0x358630,_0x9beee3){_0x358630=_0x358630-0x0;var _0x21a36d=_0xfd2d[_0x358630];return _0x21a36d;};'use strict';var Sequelize=require('sequelize');module[_0xdfd2('0x0')]={'name':{'type':Sequelize[_0xdfd2('0x1')],'allowNull':![],'unique':_0xdfd2('0x2')},'version':{'type':Sequelize[_0xdfd2('0x1')],'allowNull':![],'unique':_0xdfd2('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xdfd2('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xdfd2('0x1')]},'type':{'type':Sequelize[_0xdfd2('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xdfd2('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0xdfd2('0x1')]},'logo':{'type':Sequelize[_0xdfd2('0x1')]},'state':{'type':Sequelize[_0xdfd2('0x1')],'unique':_0xdfd2('0x5')},'description':{'type':Sequelize[_0xdfd2('0x1')]},'title':{'type':Sequelize[_0xdfd2('0x1')]},'remoteUri':{'type':Sequelize[_0xdfd2('0x1')]},'link':{'type':Sequelize[_0xdfd2('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x4a55=['unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize','STRING'];(function(_0x3f9a2b,_0x4afa12){var _0x5c9193=function(_0x2d46aa){while(--_0x2d46aa){_0x3f9a2b['push'](_0x3f9a2b['shift']());}};_0x5c9193(++_0x4afa12);}(_0x4a55,0x124));var _0x54a5=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x4a55[_0x1a36a5];return _0x746243;};'use strict';var Sequelize=require(_0x54a5('0x0'));module['exports']={'name':{'type':Sequelize[_0x54a5('0x1')],'allowNull':![],'unique':_0x54a5('0x2')},'version':{'type':Sequelize[_0x54a5('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x54a5('0x1')],'defaultValue':_0x54a5('0x3')},'filename':{'type':Sequelize[_0x54a5('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x54a5('0x4')]},'active':{'type':Sequelize[_0x54a5('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':_0x54a5('0x6')},'description':{'type':Sequelize[_0x54a5('0x1')]},'title':{'type':Sequelize[_0x54a5('0x1')]},'remoteUri':{'type':Sequelize[_0x54a5('0x1')]},'link':{'type':Sequelize[_0x54a5('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 c4e475d..35b33c6 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 _0x2a07=['name','send','index','map','Integration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','show','params','fields','includeAll','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x2a07,0x74));var _0x72a0=function(_0xac3328,_0x23745a){_0xac3328=_0xac3328-0x0;var _0x33aec4=_0x2a07[_0xac3328];return _0x33aec4;};'use strict';var emlformat=require(_0x72a0('0x0'));var rimraf=require(_0x72a0('0x1'));var zipdir=require(_0x72a0('0x2'));var jsonpatch=require(_0x72a0('0x3'));var rp=require(_0x72a0('0x4'));var moment=require('moment');var BPromise=require(_0x72a0('0x5'));var Mustache=require(_0x72a0('0x6'));var util=require(_0x72a0('0x7'));var path=require(_0x72a0('0x8'));var sox=require(_0x72a0('0x9'));var csv=require(_0x72a0('0xa'));var ejs=require(_0x72a0('0xb'));var fs=require('fs');var fs_extra=require(_0x72a0('0xc'));var _=require(_0x72a0('0xd'));var squel=require(_0x72a0('0xe'));var crypto=require(_0x72a0('0xf'));var jsforce=require(_0x72a0('0x10'));var deskjs=require(_0x72a0('0x11'));var toCsv=require(_0x72a0('0xa'));var querystring=require(_0x72a0('0x12'));var Papa=require(_0x72a0('0x13'));var Redis=require('ioredis');var authService=require(_0x72a0('0x14'));var qs=require(_0x72a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72a0('0x16'));var logger=require(_0x72a0('0x17'))(_0x72a0('0x18'));var utils=require(_0x72a0('0x19'));var config=require(_0x72a0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a0('0x1b'))['db'];function respondWithStatusCode(_0x335b9f,_0x123ca4){_0x123ca4=_0x123ca4||0xcc;return function(_0xf91a82){if(_0xf91a82){return _0x335b9f[_0x72a0('0x1c')](_0x123ca4);}return _0x335b9f[_0x72a0('0x1d')](_0x123ca4)[_0x72a0('0x1e')]();};}function respondWithResult(_0x5e0b5f,_0x4930c5){_0x4930c5=_0x4930c5||0xc8;return function(_0xe103dc){if(_0xe103dc){return _0x5e0b5f[_0x72a0('0x1d')](_0x4930c5)[_0x72a0('0x1f')](_0xe103dc);}};}function respondWithFilteredResult(_0x1d1133,_0x23b001){return function(_0x3f3d62){if(_0x3f3d62){var _0x4ab55e=typeof _0x23b001[_0x72a0('0x20')]===_0x72a0('0x21')&&typeof _0x23b001[_0x72a0('0x22')]===_0x72a0('0x21');var _0x2d1e95=_0x3f3d62['count'];var _0x100d8f=_0x4ab55e?0x0:_0x23b001[_0x72a0('0x20')];var _0x131b73=_0x4ab55e?_0x3f3d62['count']:_0x23b001[_0x72a0('0x20')]+_0x23b001[_0x72a0('0x22')];var _0x30899b;if(_0x131b73>=_0x2d1e95){_0x131b73=_0x2d1e95;_0x30899b=0xc8;}else{_0x30899b=0xce;}_0x1d1133[_0x72a0('0x1d')](_0x30899b);return _0x1d1133['set'](_0x72a0('0x23'),_0x100d8f+'-'+_0x131b73+'/'+_0x2d1e95)['json'](_0x3f3d62);}return null;};}function patchUpdates(_0x3d0607){return function(_0x315413){try{jsonpatch[_0x72a0('0x24')](_0x315413,_0x3d0607,!![]);}catch(_0x5c7479){return BPromise[_0x72a0('0x25')](_0x5c7479);}return _0x315413[_0x72a0('0x26')]();};}function saveUpdates(_0x1d22d8,_0x3d1965){return function(_0x5d6145){if(_0x5d6145){return _0x5d6145[_0x72a0('0x27')](_0x1d22d8)[_0x72a0('0x28')](function(_0x1ddd54){return _0x1ddd54;});}return null;};}function removeEntity(_0x23b918,_0x3022b0){return function(_0x174b1b){if(_0x174b1b){return _0x174b1b['destroy']()['then'](function(){_0x23b918[_0x72a0('0x1d')](0xcc)[_0x72a0('0x1e')]();});}};}function handleEntityNotFound(_0x123df4,_0x1504ed){return function(_0xf5cb49){if(!_0xf5cb49){_0x123df4[_0x72a0('0x1c')](0x194);}return _0xf5cb49;};}function handleError(_0xa5bda0,_0x15922a){_0x15922a=_0x15922a||0x1f4;return function(_0xee99e2){logger[_0x72a0('0x29')](_0xee99e2['stack']);if(_0xee99e2[_0x72a0('0x2a')]){delete _0xee99e2[_0x72a0('0x2a')];}_0xa5bda0[_0x72a0('0x1d')](_0x15922a)[_0x72a0('0x2b')](_0xee99e2);};}exports[_0x72a0('0x2c')]=function(_0x177a3a,_0x432179){var _0x12eda2={},_0x23c96a={},_0x916733={'count':0x0,'rows':[]};var _0x4ba037=_[_0x72a0('0x2d')](db[_0x72a0('0x2e')][_0x72a0('0x2f')],function(_0xfbe9b3){return{'name':_0xfbe9b3[_0x72a0('0x30')],'type':_0xfbe9b3[_0x72a0('0x31')][_0x72a0('0x32')]};});_0x23c96a['model']=_[_0x72a0('0x2d')](_0x4ba037,_0x72a0('0x2a'));_0x23c96a[_0x72a0('0x33')]=_[_0x72a0('0x34')](_0x177a3a[_0x72a0('0x33')]);_0x23c96a[_0x72a0('0x35')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],_0x23c96a['query']);_0x12eda2[_0x72a0('0x38')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],qs['fields'](_0x177a3a[_0x72a0('0x33')]['fields']));_0x12eda2[_0x72a0('0x38')]=_0x12eda2[_0x72a0('0x38')][_0x72a0('0x39')]?_0x12eda2[_0x72a0('0x38')]:_0x23c96a[_0x72a0('0x37')];if(!_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3a')](_0x72a0('0x3b'))){_0x12eda2[_0x72a0('0x22')]=qs[_0x72a0('0x22')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x22')]);_0x12eda2['offset']=qs[_0x72a0('0x20')](_0x177a3a['query'][_0x72a0('0x20')]);}_0x12eda2[_0x72a0('0x3c')]=qs[_0x72a0('0x3d')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3d')]);_0x12eda2[_0x72a0('0x3e')]=qs[_0x72a0('0x35')](_[_0x72a0('0x3f')](_0x177a3a[_0x72a0('0x33')],_0x23c96a['filters']),_0x4ba037);if(_0x177a3a['query'][_0x72a0('0x40')]){_0x12eda2[_0x72a0('0x3e')]=_[_0x72a0('0x41')](_0x12eda2[_0x72a0('0x3e')],{'$or':_[_0x72a0('0x2d')](_0x4ba037,function(_0x512a06){if(_0x512a06[_0x72a0('0x31')]!==_0x72a0('0x42')){var _0x582c90={};_0x582c90[_0x512a06[_0x72a0('0x2a')]]={'$like':'%'+_0x177a3a['query']['filter']+'%'};return _0x582c90;}})});}_0x12eda2=_['merge']({},_0x12eda2,_0x177a3a[_0x72a0('0x43')]);var _0x49633b={'where':_0x12eda2[_0x72a0('0x3e')]};return db[_0x72a0('0x2e')][_0x72a0('0x44')](_0x49633b)[_0x72a0('0x28')](function(_0x4bf56e){_0x916733['count']=_0x4bf56e;if(_0x177a3a['query']['includeAll']){_0x12eda2[_0x72a0('0x45')]=[{'all':!![]}];}return db[_0x72a0('0x2e')]['findAll'](_0x12eda2);})[_0x72a0('0x28')](function(_0x35d790){_0x916733['rows']=_0x35d790;return _0x916733;})[_0x72a0('0x28')](respondWithFilteredResult(_0x432179,_0x12eda2))[_0x72a0('0x46')](handleError(_0x432179,null));};exports[_0x72a0('0x47')]=function(_0xe4abe1,_0x340153){var _0x341451={'raw':![],'where':{'id':_0xe4abe1[_0x72a0('0x48')]['id']}},_0x50eb7f={};_0x50eb7f['model']=_[_0x72a0('0x34')](db['Integration'][_0x72a0('0x2f')]);_0x50eb7f[_0x72a0('0x33')]=_['keys'](_0xe4abe1[_0x72a0('0x33')]);_0x50eb7f['filters']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],_0x50eb7f[_0x72a0('0x33')]);_0x341451['attributes']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],qs[_0x72a0('0x49')](_0xe4abe1['query']['fields']));_0x341451[_0x72a0('0x38')]=_0x341451['attributes'][_0x72a0('0x39')]?_0x341451[_0x72a0('0x38')]:_0x50eb7f[_0x72a0('0x37')];if(_0xe4abe1[_0x72a0('0x33')][_0x72a0('0x4a')]){_0x341451[_0x72a0('0x45')]=[{'all':!![]}];}_0x341451=_[_0x72a0('0x41')]({},_0x341451,_0xe4abe1[_0x72a0('0x43')]);return db[_0x72a0('0x2e')]['find'](_0x341451)[_0x72a0('0x28')](handleEntityNotFound(_0x340153,null))[_0x72a0('0x28')](respondWithResult(_0x340153,null))[_0x72a0('0x46')](handleError(_0x340153,null));};exports[_0x72a0('0x4b')]=function(_0x3a669d,_0x304400){return db[_0x72a0('0x2e')]['create'](_0x3a669d['body'],{})[_0x72a0('0x28')](respondWithResult(_0x304400,0xc9))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0x3cab6a,_0x35a6ad){if(_0x3cab6a[_0x72a0('0x4c')]['id']){delete _0x3cab6a[_0x72a0('0x4c')]['id'];}return db[_0x72a0('0x2e')][_0x72a0('0x4d')]({'where':{'id':_0x3cab6a[_0x72a0('0x48')]['id']}})['then'](handleEntityNotFound(_0x35a6ad,null))[_0x72a0('0x28')](saveUpdates(_0x3cab6a[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x35a6ad,null))[_0x72a0('0x46')](handleError(_0x35a6ad,null));};exports[_0x72a0('0x4e')]=function(_0x5c1570,_0x143410){return db['Integration']['find']({'where':{'id':_0x5c1570[_0x72a0('0x48')]['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x143410,null))[_0x72a0('0x28')](removeEntity(_0x143410,null))[_0x72a0('0x46')](handleError(_0x143410,null));}; \ No newline at end of file +var _0xc1c6=['type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','Integration','rawAttributes'];(function(_0x5c3a22,_0xf9eb07){var _0x2e8fb8=function(_0x4593a1){while(--_0x4593a1){_0x5c3a22['push'](_0x5c3a22['shift']());}};_0x2e8fb8(++_0xf9eb07);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x1945d3,_0x18336b){_0x1945d3=_0x1945d3-0x0;var _0x4b97ec=_0xc1c6[_0x1945d3];return _0x4b97ec;};'use strict';var emlformat=require(_0x6c1c('0x0'));var rimraf=require(_0x6c1c('0x1'));var zipdir=require(_0x6c1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c1c('0x3'));var moment=require('moment');var BPromise=require(_0x6c1c('0x4'));var Mustache=require(_0x6c1c('0x5'));var util=require(_0x6c1c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6c1c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c1c('0x8'));var _=require('lodash');var squel=require(_0x6c1c('0x9'));var crypto=require(_0x6c1c('0xa'));var jsforce=require(_0x6c1c('0xb'));var deskjs=require(_0x6c1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xd'));var Papa=require(_0x6c1c('0xe'));var Redis=require('ioredis');var authService=require(_0x6c1c('0xf'));var qs=require(_0x6c1c('0x10'));var as=require(_0x6c1c('0x11'));var hardwareService=require(_0x6c1c('0x12'));var logger=require('../../config/logger')(_0x6c1c('0x13'));var utils=require(_0x6c1c('0x14'));var config=require(_0x6c1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c1c('0x16'))['db'];function respondWithStatusCode(_0x12a9e6,_0x2067bd){_0x2067bd=_0x2067bd||0xcc;return function(_0x49304f){if(_0x49304f){return _0x12a9e6[_0x6c1c('0x17')](_0x2067bd);}return _0x12a9e6['status'](_0x2067bd)[_0x6c1c('0x18')]();};}function respondWithResult(_0x15a1fc,_0x2d279e){_0x2d279e=_0x2d279e||0xc8;return function(_0x154107){if(_0x154107){return _0x15a1fc[_0x6c1c('0x19')](_0x2d279e)[_0x6c1c('0x1a')](_0x154107);}};}function respondWithFilteredResult(_0x297c33,_0x41aa74){return function(_0x448f35){if(_0x448f35){var _0x5f3758=typeof _0x41aa74[_0x6c1c('0x1b')]===_0x6c1c('0x1c')&&typeof _0x41aa74['limit']===_0x6c1c('0x1c');var _0x237cac=_0x448f35['count'];var _0x137770=_0x5f3758?0x0:_0x41aa74['offset'];var _0x338dc2=_0x5f3758?_0x448f35[_0x6c1c('0x1d')]:_0x41aa74['offset']+_0x41aa74[_0x6c1c('0x1e')];var _0x59ab38;if(_0x338dc2>=_0x237cac){_0x338dc2=_0x237cac;_0x59ab38=0xc8;}else{_0x59ab38=0xce;}_0x297c33[_0x6c1c('0x19')](_0x59ab38);return _0x297c33[_0x6c1c('0x1f')](_0x6c1c('0x20'),_0x137770+'-'+_0x338dc2+'/'+_0x237cac)[_0x6c1c('0x1a')](_0x448f35);}return null;};}function patchUpdates(_0x1acf7f){return function(_0x1efb19){try{jsonpatch[_0x6c1c('0x21')](_0x1efb19,_0x1acf7f,!![]);}catch(_0x2ed830){return BPromise[_0x6c1c('0x22')](_0x2ed830);}return _0x1efb19[_0x6c1c('0x23')]();};}function saveUpdates(_0x3d2bf3,_0x450b1f){return function(_0x2382c0){if(_0x2382c0){return _0x2382c0[_0x6c1c('0x24')](_0x3d2bf3)[_0x6c1c('0x25')](function(_0x19c269){return _0x19c269;});}return null;};}function removeEntity(_0x2319d3,_0x12c638){return function(_0x3a3f13){if(_0x3a3f13){return _0x3a3f13[_0x6c1c('0x26')]()[_0x6c1c('0x25')](function(){_0x2319d3[_0x6c1c('0x19')](0xcc)[_0x6c1c('0x18')]();});}};}function handleEntityNotFound(_0x7ff10d,_0x18452d){return function(_0x80bc05){if(!_0x80bc05){_0x7ff10d[_0x6c1c('0x17')](0x194);}return _0x80bc05;};}function handleError(_0x1b9d7d,_0x2feaf4){_0x2feaf4=_0x2feaf4||0x1f4;return function(_0x5f4568){logger[_0x6c1c('0x27')](_0x5f4568['stack']);if(_0x5f4568[_0x6c1c('0x28')]){delete _0x5f4568['name'];}_0x1b9d7d[_0x6c1c('0x19')](_0x2feaf4)['send'](_0x5f4568);};}exports[_0x6c1c('0x29')]=function(_0xf557ba,_0x504348){var _0x3b1a4f={},_0x24da4c={},_0x4e13e3={'count':0x0,'rows':[]};var _0x3b319a=_[_0x6c1c('0x2a')](db[_0x6c1c('0x2b')][_0x6c1c('0x2c')],function(_0x4fc279){return{'name':_0x4fc279['fieldName'],'type':_0x4fc279[_0x6c1c('0x2d')][_0x6c1c('0x2e')]};});_0x24da4c[_0x6c1c('0x2f')]=_[_0x6c1c('0x2a')](_0x3b319a,_0x6c1c('0x28'));_0x24da4c[_0x6c1c('0x30')]=_['keys'](_0xf557ba[_0x6c1c('0x30')]);_0x24da4c[_0x6c1c('0x31')]=_['intersection'](_0x24da4c[_0x6c1c('0x2f')],_0x24da4c[_0x6c1c('0x30')]);_0x3b1a4f[_0x6c1c('0x32')]=_[_0x6c1c('0x33')](_0x24da4c['model'],qs[_0x6c1c('0x34')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x3b1a4f['attributes']=_0x3b1a4f[_0x6c1c('0x32')]['length']?_0x3b1a4f[_0x6c1c('0x32')]:_0x24da4c['model'];if(!_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x35')](_0x6c1c('0x36'))){_0x3b1a4f['limit']=qs['limit'](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x1e')]);_0x3b1a4f[_0x6c1c('0x1b')]=qs['offset'](_0xf557ba[_0x6c1c('0x30')]['offset']);}_0x3b1a4f['order']=qs[_0x6c1c('0x37')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x37')]);_0x3b1a4f[_0x6c1c('0x38')]=qs['filters'](_[_0x6c1c('0x39')](_0xf557ba[_0x6c1c('0x30')],_0x24da4c[_0x6c1c('0x31')]),_0x3b319a);if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]){_0x3b1a4f[_0x6c1c('0x38')]=_[_0x6c1c('0x3b')](_0x3b1a4f[_0x6c1c('0x38')],{'$or':_[_0x6c1c('0x2a')](_0x3b319a,function(_0x232508){if(_0x232508['type']!==_0x6c1c('0x3c')){var _0x464549={};_0x464549[_0x232508[_0x6c1c('0x28')]]={'$like':'%'+_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]+'%'};return _0x464549;}})});}_0x3b1a4f=_['merge']({},_0x3b1a4f,_0xf557ba['options']);var _0x549db1={'where':_0x3b1a4f[_0x6c1c('0x38')]};return db['Integration']['count'](_0x549db1)[_0x6c1c('0x25')](function(_0x37244e){_0x4e13e3['count']=_0x37244e;if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x3b1a4f[_0x6c1c('0x3e')]=[{'all':!![]}];}return db['Integration'][_0x6c1c('0x3f')](_0x3b1a4f);})[_0x6c1c('0x25')](function(_0x502e75){_0x4e13e3[_0x6c1c('0x40')]=_0x502e75;return _0x4e13e3;})['then'](respondWithFilteredResult(_0x504348,_0x3b1a4f))[_0x6c1c('0x41')](handleError(_0x504348,null));};exports[_0x6c1c('0x42')]=function(_0x16a389,_0x174f2c){var _0x10764a={'raw':![],'where':{'id':_0x16a389[_0x6c1c('0x43')]['id']}},_0x595ba2={};_0x595ba2[_0x6c1c('0x2f')]=_[_0x6c1c('0x44')](db['Integration'][_0x6c1c('0x2c')]);_0x595ba2[_0x6c1c('0x30')]=_[_0x6c1c('0x44')](_0x16a389[_0x6c1c('0x30')]);_0x595ba2[_0x6c1c('0x31')]=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],_0x595ba2['query']);_0x10764a['attributes']=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],qs[_0x6c1c('0x34')](_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x10764a[_0x6c1c('0x32')]=_0x10764a[_0x6c1c('0x32')][_0x6c1c('0x45')]?_0x10764a[_0x6c1c('0x32')]:_0x595ba2['model'];if(_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x10764a['include']=[{'all':!![]}];}_0x10764a=_[_0x6c1c('0x3b')]({},_0x10764a,_0x16a389['options']);return db[_0x6c1c('0x2b')][_0x6c1c('0x46')](_0x10764a)[_0x6c1c('0x25')](handleEntityNotFound(_0x174f2c,null))[_0x6c1c('0x25')](respondWithResult(_0x174f2c,null))[_0x6c1c('0x41')](handleError(_0x174f2c,null));};exports['create']=function(_0x1fe6e8,_0x58d075){return db[_0x6c1c('0x2b')][_0x6c1c('0x47')](_0x1fe6e8[_0x6c1c('0x48')],{})[_0x6c1c('0x25')](respondWithResult(_0x58d075,0xc9))[_0x6c1c('0x41')](handleError(_0x58d075,null));};exports[_0x6c1c('0x24')]=function(_0x52c14d,_0xa9889a){if(_0x52c14d[_0x6c1c('0x48')]['id']){delete _0x52c14d['body']['id'];}return db[_0x6c1c('0x2b')][_0x6c1c('0x46')]({'where':{'id':_0x52c14d[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0xa9889a,null))['then'](saveUpdates(_0x52c14d[_0x6c1c('0x48')],null))[_0x6c1c('0x25')](respondWithResult(_0xa9889a,null))[_0x6c1c('0x41')](handleError(_0xa9889a,null));};exports['destroy']=function(_0x5b8d69,_0x56b367){return db['Integration']['find']({'where':{'id':_0x5b8d69[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0x56b367,null))['then'](removeEntity(_0x56b367,null))[_0x6c1c('0x41')](handleError(_0x56b367,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 4e105fc..e34b6ef 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 _0x941b=['exports','define','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes'];(function(_0xe1cff5,_0x56bcf2){var _0x2d5101=function(_0x3c633b){while(--_0x3c633b){_0xe1cff5['push'](_0xe1cff5['shift']());}};_0x2d5101(++_0x56bcf2);}(_0x941b,0xa7));var _0xb941=function(_0x50c8c5,_0x4ccc34){_0x50c8c5=_0x50c8c5-0x0;var _0x2eb662=_0x941b[_0x50c8c5];return _0x2eb662;};'use strict';var _=require('lodash');var util=require(_0xb941('0x0'));var logger=require(_0xb941('0x1'))(_0xb941('0x2'));var moment=require('moment');var BPromise=require(_0xb941('0x3'));var rp=require(_0xb941('0x4'));var fs=require('fs');var path=require(_0xb941('0x5'));var rimraf=require(_0xb941('0x6'));var config=require(_0xb941('0x7'));var attributes=require(_0xb941('0x8'));module[_0xb941('0x9')]=function(_0x1de016,_0x4cc202){return _0x1de016[_0xb941('0xa')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc912=['define','Integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x2c73fa,_0x41b660){var _0x201374=function(_0xb0a36c){while(--_0xb0a36c){_0x2c73fa['push'](_0x2c73fa['shift']());}};_0x201374(++_0x41b660);}(_0xc912,0xce));var _0x2c91=function(_0x512c1e,_0x273792){_0x512c1e=_0x512c1e-0x0;var _0x303d05=_0xc912[_0x512c1e];return _0x303d05;};'use strict';var _=require(_0x2c91('0x0'));var util=require(_0x2c91('0x1'));var logger=require(_0x2c91('0x2'))(_0x2c91('0x3'));var moment=require(_0x2c91('0x4'));var BPromise=require(_0x2c91('0x5'));var rp=require(_0x2c91('0x6'));var fs=require('fs');var path=require(_0x2c91('0x7'));var rimraf=require(_0x2c91('0x8'));var config=require('../../config/environment');var attributes=require('./integration.attributes');module[_0x2c91('0x9')]=function(_0x1e1b74,_0x441dcf){return _0x1e1b74[_0x2c91('0xa')](_0x2c91('0xb'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 9a6fa8c..89088a4 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 _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','Integration,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x60286b,_0x3247c1){var _0x5dff69=function(_0x4ecfcf){while(--_0x4ecfcf){_0x60286b['push'](_0x60286b['shift']());}};_0x5dff69(++_0x3247c1);}(_0x4137,0xf8));var _0x7413=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x4137[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('Integration,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});} \ No newline at end of file +var _0x7880=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2933ec,_0x176f03){var _0x3fa3a2=function(_0x3609a2){while(--_0x3609a2){_0x2933ec['push'](_0x2933ec['shift']());}};_0x3fa3a2(++_0x176f03);}(_0x7880,0x1f4));var _0x0788=function(_0x56f604,_0x31e0fc){_0x56f604=_0x56f604-0x0;var _0x5c3f23=_0x7880[_0x56f604];return _0x5c3f23;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0788('0x6'))(_0x0788('0x7'));var config=require(_0x0788('0x8'));var jayson=require(_0x0788('0x9'));var client=jayson[_0x0788('0xa')][_0x0788('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f9cb8,_0x44bbb5,_0x3c29f3){return new BPromise(function(_0x422f8b,_0x55e48a){return client[_0x0788('0xc')](_0x3f9cb8,_0x3c29f3)['then'](function(_0xabaf81){logger['info'](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x44bbb5,_0x0788('0xe'),JSON['stringify'](_0xabaf81));if(_0xabaf81[_0x0788('0x11')]){if(_0xabaf81[_0x0788('0x11')][_0x0788('0x12')]===0x1f4){logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')][_0x0788('0x13')]);return _0x55e48a(_0xabaf81['error'][_0x0788('0x13')]);}logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')]['message']);return _0x422f8b(_0xabaf81[_0x0788('0x11')]['message']);}else{logger[_0x0788('0x14')](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));_0x422f8b(_0xabaf81[_0x0788('0x15')][_0x0788('0x13')]);}})[_0x0788('0x16')](function(_0x5e1a29){logger['error'](_0x0788('0xd'),_0x44bbb5,_0x5e1a29);_0x55e48a(_0x5e1a29);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index fbe228f..ea7a7b0 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 _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','post','put','update','delete','/:id'];(function(_0x27b4d4,_0x282752){var _0x49d955=function(_0x268508){while(--_0x268508){_0x27b4d4['push'](_0x27b4d4['shift']());}};_0x49d955(++_0x282752);}(_0x7a54,0x106));var _0x47a5=function(_0x2d8eef,_0x50f144){_0x2d8eef=_0x2d8eef-0x0;var _0x3a37af=_0x7a54[_0x2d8eef];return _0x3a37af;};'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['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0x11'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router; \ No newline at end of file +var _0x2542=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x475153,_0x168313){var _0x5cedf8=function(_0x595baa){while(--_0x595baa){_0x475153['push'](_0x475153['shift']());}};_0x5cedf8(++_0x168313);}(_0x2542,0x169));var _0x2254=function(_0x3ff59f,_0x546438){_0x3ff59f=_0x3ff59f-0x0;var _0x40256d=_0x2542[_0x3ff59f];return _0x40256d;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2254('0x5'));var interaction=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var controller=require(_0x2254('0x8'));router[_0x2254('0x9')]('/',auth['isAuthenticated'](),controller[_0x2254('0xa')]);router[_0x2254('0x9')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0xd')]);router[_0x2254('0x9')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0xf')]);router[_0x2254('0x10')]('/',auth[_0x2254('0xc')](),controller['create']);router[_0x2254('0x11')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0x12')]);router['delete']('/:id',auth[_0x2254('0xc')](),controller[_0x2254('0x13')]);module[_0x2254('0x14')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 69d7b56..427f655 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 _0x63d7=['STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','FAILED','sequelize','exports'];(function(_0xd71863,_0x1cde03){var _0x1b48f1=function(_0x36d542){while(--_0x36d542){_0xd71863['push'](_0xd71863['shift']());}};_0x1b48f1(++_0x1cde03);}(_0x63d7,0x76));var _0x763d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x63d7[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x763d('0x0'));module[_0x763d('0x1')]={'integration':{'type':Sequelize[_0x763d('0x2')]},'eventChannel':{'type':Sequelize[_0x763d('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x763d('0x2')]},'integrationId':{'type':Sequelize[_0x763d('0x3')]},'contacts':{'type':Sequelize[_0x763d('0x2')]},'uniqueid':{'type':Sequelize[_0x763d('0x2')]},'calleridnum':{'type':Sequelize[_0x763d('0x2')]},'calleridname':{'type':Sequelize[_0x763d('0x2')]},'queue':{'type':Sequelize[_0x763d('0x2')]},'interface':{'type':Sequelize[_0x763d('0x2')]},'membername':{'type':Sequelize[_0x763d('0x2')]},'agentcalledAt':{'type':Sequelize[_0x763d('0x4')]},'agentconnectAt':{'type':Sequelize[_0x763d('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x763d('0x4')]},'talktime':{'type':Sequelize[_0x763d('0x3')]},'agentacw':{'type':Sequelize[_0x763d('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x763d('0x3')]},'reason':{'type':Sequelize[_0x763d('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x763d('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x763d('0x4')]},'agentdump':{'type':Sequelize[_0x763d('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x763d('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x763d('0x2')]},'connectedlinenum':{'type':Sequelize[_0x763d('0x2')]},'connectedlinename':{'type':Sequelize[_0x763d('0x2')]},'language':{'type':Sequelize[_0x763d('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x763d('0x2')]},'exten':{'type':Sequelize[_0x763d('0x2')]},'priority':{'type':Sequelize[_0x763d('0x2')]},'destchannel':{'type':Sequelize[_0x763d('0x2')]},'destchannelstate':{'type':Sequelize[_0x763d('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x763d('0x2')]},'destcalleridnum':{'type':Sequelize[_0x763d('0x2')]},'destcalleridname':{'type':Sequelize[_0x763d('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x763d('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x763d('0x2')]},'destlanguage':{'type':Sequelize[_0x763d('0x2')]},'destaccountcode':{'type':Sequelize[_0x763d('0x2')]},'destcontext':{'type':Sequelize[_0x763d('0x2')]},'destexten':{'type':Sequelize[_0x763d('0x2')]},'destpriority':{'type':Sequelize[_0x763d('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x763d('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x763d('0x2')]},'from':{'type':Sequelize[_0x763d('0x2')]},'to':{'type':Sequelize[_0x763d('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x763d('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x763d('0x6')]},'status':{'type':Sequelize[_0x763d('0x7')](_0x763d('0x8'),'SENDING','RECEIVED',_0x763d('0x9'))},'url':{'type':Sequelize[_0x763d('0x2')]},'app':{'type':Sequelize[_0x763d('0x2')]},'appdata':{'type':Sequelize[_0x763d('0x2')]},'projectId':{'type':Sequelize[_0x763d('0x3')]}}; \ No newline at end of file +var _0x71d9=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENDING','RECEIVED','FAILED'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x71d9,0x13f));var _0x971d=function(_0x314723,_0x121c53){_0x314723=_0x314723-0x0;var _0x340cc1=_0x71d9[_0x314723];return _0x340cc1;};'use strict';var Sequelize=require(_0x971d('0x0'));module[_0x971d('0x1')]={'integration':{'type':Sequelize[_0x971d('0x2')]},'eventChannel':{'type':Sequelize[_0x971d('0x2')]},'exitStatus':{'type':Sequelize[_0x971d('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x971d('0x3')]},'contacts':{'type':Sequelize[_0x971d('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x971d('0x2')]},'queue':{'type':Sequelize[_0x971d('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x971d('0x4')]},'agentconnectAt':{'type':Sequelize[_0x971d('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x971d('0x4')]},'talktime':{'type':Sequelize[_0x971d('0x3')]},'agentacw':{'type':Sequelize[_0x971d('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x971d('0x3')]},'reason':{'type':Sequelize[_0x971d('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x971d('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x971d('0x4')]},'agentdump':{'type':Sequelize[_0x971d('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x971d('0x4')]},'lastevent':{'type':Sequelize[_0x971d('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x971d('0x3')]},'channelstatedesc':{'type':Sequelize[_0x971d('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x971d('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x971d('0x2')]},'context':{'type':Sequelize[_0x971d('0x2')]},'exten':{'type':Sequelize[_0x971d('0x2')]},'priority':{'type':Sequelize[_0x971d('0x2')]},'destchannel':{'type':Sequelize[_0x971d('0x2')]},'destchannelstate':{'type':Sequelize[_0x971d('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x971d('0x2')]},'destcalleridnum':{'type':Sequelize[_0x971d('0x2')]},'destcalleridname':{'type':Sequelize[_0x971d('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x971d('0x2')]},'destlanguage':{'type':Sequelize[_0x971d('0x2')]},'destaccountcode':{'type':Sequelize[_0x971d('0x2')]},'destcontext':{'type':Sequelize[_0x971d('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x971d('0x2')]},'destuniqueid':{'type':Sequelize[_0x971d('0x2')]},'messageId':{'type':Sequelize[_0x971d('0x2')]},'inReplyTo':{'type':Sequelize[_0x971d('0x2')]},'subject':{'type':Sequelize[_0x971d('0x2')]},'from':{'type':Sequelize[_0x971d('0x2')]},'to':{'type':Sequelize[_0x971d('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x971d('0x6')]},'html':{'type':Sequelize[_0x971d('0x6')]},'text':{'type':Sequelize[_0x971d('0x6')]},'status':{'type':Sequelize[_0x971d('0x7')]('SENT',_0x971d('0x8'),_0x971d('0x9'),_0x971d('0xa'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x971d('0x2')]},'appdata':{'type':Sequelize[_0x971d('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 23ba5b9..8105923 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 _0x2c16=['apply','save','update','then','destroy','end','error','stack','name','index','map','IntegrationReport','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','filter','where','merge','type','VIRTUAL','count','include','findAll','rows','show','rawAttributes','options','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel','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','sendStatus','status','json','offset','undefined'];(function(_0x33da5a,_0x57b6f2){var _0x4bea1a=function(_0x5c8271){while(--_0x5c8271){_0x33da5a['push'](_0x33da5a['shift']());}};_0x4bea1a(++_0x57b6f2);}(_0x2c16,0x76));var _0x62c1=function(_0x619f35,_0x5012a7){_0x619f35=_0x619f35-0x0;var _0x275286=_0x2c16[_0x619f35];return _0x275286;};'use strict';var emlformat=require(_0x62c1('0x0'));var rimraf=require(_0x62c1('0x1'));var zipdir=require(_0x62c1('0x2'));var jsonpatch=require(_0x62c1('0x3'));var rp=require(_0x62c1('0x4'));var moment=require(_0x62c1('0x5'));var BPromise=require(_0x62c1('0x6'));var Mustache=require(_0x62c1('0x7'));var util=require(_0x62c1('0x8'));var path=require(_0x62c1('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x62c1('0xa'));var _=require('lodash');var squel=require(_0x62c1('0xb'));var crypto=require(_0x62c1('0xc'));var jsforce=require(_0x62c1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x62c1('0xe'));var querystring=require(_0x62c1('0xf'));var Papa=require(_0x62c1('0x10'));var Redis=require(_0x62c1('0x11'));var authService=require(_0x62c1('0x12'));var qs=require(_0x62c1('0x13'));var as=require(_0x62c1('0x14'));var hardwareService=require(_0x62c1('0x15'));var logger=require(_0x62c1('0x16'))(_0x62c1('0x17'));var utils=require(_0x62c1('0x18'));var config=require(_0x62c1('0x19'));var licenseUtil=require(_0x62c1('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40db09,_0xa25315){_0xa25315=_0xa25315||0xcc;return function(_0x1906c5){if(_0x1906c5){return _0x40db09[_0x62c1('0x1b')](_0xa25315);}return _0x40db09[_0x62c1('0x1c')](_0xa25315)['end']();};}function respondWithResult(_0x46d216,_0xc4d541){_0xc4d541=_0xc4d541||0xc8;return function(_0x353754){if(_0x353754){return _0x46d216[_0x62c1('0x1c')](_0xc4d541)[_0x62c1('0x1d')](_0x353754);}};}function respondWithFilteredResult(_0x3523a2,_0x20a423){return function(_0x3520e7){if(_0x3520e7){var _0x42a647=typeof _0x20a423[_0x62c1('0x1e')]===_0x62c1('0x1f')&&typeof _0x20a423['limit']===_0x62c1('0x1f');var _0x51c845=_0x3520e7['count'];var _0x5e43ed=_0x42a647?0x0:_0x20a423[_0x62c1('0x1e')];var _0x58e99f=_0x42a647?_0x3520e7['count']:_0x20a423[_0x62c1('0x1e')]+_0x20a423['limit'];var _0x311ab9;if(_0x58e99f>=_0x51c845){_0x58e99f=_0x51c845;_0x311ab9=0xc8;}else{_0x311ab9=0xce;}_0x3523a2['status'](_0x311ab9);return _0x3523a2['set']('Content-Range',_0x5e43ed+'-'+_0x58e99f+'/'+_0x51c845)['json'](_0x3520e7);}return null;};}function patchUpdates(_0x118122){return function(_0x1ca9eb){try{jsonpatch[_0x62c1('0x20')](_0x1ca9eb,_0x118122,!![]);}catch(_0x3e6ea2){return BPromise['reject'](_0x3e6ea2);}return _0x1ca9eb[_0x62c1('0x21')]();};}function saveUpdates(_0x2b4df9,_0x404fc2){return function(_0x24f5b4){if(_0x24f5b4){return _0x24f5b4[_0x62c1('0x22')](_0x2b4df9)[_0x62c1('0x23')](function(_0x1d558b){return _0x1d558b;});}return null;};}function removeEntity(_0xe09b09,_0x47628a){return function(_0x342103){if(_0x342103){return _0x342103[_0x62c1('0x24')]()[_0x62c1('0x23')](function(){_0xe09b09['status'](0xcc)[_0x62c1('0x25')]();});}};}function handleEntityNotFound(_0x252e14,_0x3017f1){return function(_0x49e3b0){if(!_0x49e3b0){_0x252e14[_0x62c1('0x1b')](0x194);}return _0x49e3b0;};}function handleError(_0xfb10e8,_0x268ec4){_0x268ec4=_0x268ec4||0x1f4;return function(_0x76d907){logger[_0x62c1('0x26')](_0x76d907[_0x62c1('0x27')]);if(_0x76d907['name']){delete _0x76d907[_0x62c1('0x28')];}_0xfb10e8[_0x62c1('0x1c')](_0x268ec4)['send'](_0x76d907);};}exports[_0x62c1('0x29')]=function(_0x53c2cf,_0x12b6b0){var _0x211cfa={},_0x394fd5={},_0x347f34={'count':0x0,'rows':[]};var _0x689533=_[_0x62c1('0x2a')](db[_0x62c1('0x2b')]['rawAttributes'],function(_0x2ab2e2){return{'name':_0x2ab2e2['fieldName'],'type':_0x2ab2e2['type'][_0x62c1('0x2c')]};});_0x394fd5[_0x62c1('0x2d')]=_['map'](_0x689533,_0x62c1('0x28'));_0x394fd5[_0x62c1('0x2e')]=_[_0x62c1('0x2f')](_0x53c2cf['query']);_0x394fd5[_0x62c1('0x30')]=_[_0x62c1('0x31')](_0x394fd5['model'],_0x394fd5[_0x62c1('0x2e')]);_0x211cfa['attributes']=_['intersection'](_0x394fd5[_0x62c1('0x2d')],qs[_0x62c1('0x32')](_0x53c2cf[_0x62c1('0x2e')][_0x62c1('0x32')]));_0x211cfa[_0x62c1('0x33')]=_0x211cfa[_0x62c1('0x33')][_0x62c1('0x34')]?_0x211cfa[_0x62c1('0x33')]:_0x394fd5[_0x62c1('0x2d')];if(!_0x53c2cf[_0x62c1('0x2e')][_0x62c1('0x35')](_0x62c1('0x36'))){_0x211cfa[_0x62c1('0x37')]=qs['limit'](_0x53c2cf[_0x62c1('0x2e')][_0x62c1('0x37')]);_0x211cfa[_0x62c1('0x1e')]=qs[_0x62c1('0x1e')](_0x53c2cf[_0x62c1('0x2e')][_0x62c1('0x1e')]);}_0x211cfa['order']=qs[_0x62c1('0x38')](_0x53c2cf[_0x62c1('0x2e')][_0x62c1('0x38')]);_0x211cfa['where']=qs[_0x62c1('0x30')](_['pick'](_0x53c2cf[_0x62c1('0x2e')],_0x394fd5[_0x62c1('0x30')]),_0x689533);if(_0x53c2cf[_0x62c1('0x2e')][_0x62c1('0x39')]){_0x211cfa[_0x62c1('0x3a')]=_[_0x62c1('0x3b')](_0x211cfa[_0x62c1('0x3a')],{'$or':_['map'](_0x689533,function(_0x96c329){if(_0x96c329[_0x62c1('0x3c')]!==_0x62c1('0x3d')){var _0x43fede={};_0x43fede[_0x96c329['name']]={'$like':'%'+_0x53c2cf[_0x62c1('0x2e')][_0x62c1('0x39')]+'%'};return _0x43fede;}})});}_0x211cfa=_[_0x62c1('0x3b')]({},_0x211cfa,_0x53c2cf['options']);var _0x163d98={'where':_0x211cfa[_0x62c1('0x3a')]};return db[_0x62c1('0x2b')][_0x62c1('0x3e')](_0x163d98)[_0x62c1('0x23')](function(_0x37fe5f){_0x347f34['count']=_0x37fe5f;if(_0x53c2cf[_0x62c1('0x2e')]['includeAll']){_0x211cfa[_0x62c1('0x3f')]=[{'all':!![]}];}return db['IntegrationReport'][_0x62c1('0x40')](_0x211cfa);})[_0x62c1('0x23')](function(_0x2a74d0){_0x347f34[_0x62c1('0x41')]=_0x2a74d0;return _0x347f34;})[_0x62c1('0x23')](respondWithFilteredResult(_0x12b6b0,_0x211cfa))['catch'](handleError(_0x12b6b0,null));};exports[_0x62c1('0x42')]=function(_0x1a6a77,_0x4f5132){var _0x3d1681={'raw':![],'where':{'id':_0x1a6a77['params']['id']}},_0x1d22f2={};_0x1d22f2[_0x62c1('0x2d')]=_[_0x62c1('0x2f')](db[_0x62c1('0x2b')][_0x62c1('0x43')]);_0x1d22f2[_0x62c1('0x2e')]=_[_0x62c1('0x2f')](_0x1a6a77[_0x62c1('0x2e')]);_0x1d22f2[_0x62c1('0x30')]=_['intersection'](_0x1d22f2['model'],_0x1d22f2['query']);_0x3d1681[_0x62c1('0x33')]=_[_0x62c1('0x31')](_0x1d22f2['model'],qs[_0x62c1('0x32')](_0x1a6a77[_0x62c1('0x2e')][_0x62c1('0x32')]));_0x3d1681[_0x62c1('0x33')]=_0x3d1681['attributes'][_0x62c1('0x34')]?_0x3d1681[_0x62c1('0x33')]:_0x1d22f2[_0x62c1('0x2d')];if(_0x1a6a77['query']['includeAll']){_0x3d1681[_0x62c1('0x3f')]=[{'all':!![]}];}_0x3d1681=_[_0x62c1('0x3b')]({},_0x3d1681,_0x1a6a77[_0x62c1('0x44')]);return db[_0x62c1('0x2b')]['find'](_0x3d1681)['then'](handleEntityNotFound(_0x4f5132,null))[_0x62c1('0x23')](respondWithResult(_0x4f5132,null))[_0x62c1('0x45')](handleError(_0x4f5132,null));};exports[_0x62c1('0x46')]=function(_0x20e96a,_0x42651e){return db[_0x62c1('0x2b')][_0x62c1('0x46')](_0x20e96a[_0x62c1('0x47')],{})['then'](respondWithResult(_0x42651e,0xc9))[_0x62c1('0x45')](handleError(_0x42651e,null));};exports[_0x62c1('0x22')]=function(_0xccf174,_0x31ec5e){if(_0xccf174[_0x62c1('0x47')]['id']){delete _0xccf174[_0x62c1('0x47')]['id'];}return db[_0x62c1('0x2b')][_0x62c1('0x48')]({'where':{'id':_0xccf174[_0x62c1('0x49')]['id']}})[_0x62c1('0x23')](handleEntityNotFound(_0x31ec5e,null))[_0x62c1('0x23')](saveUpdates(_0xccf174[_0x62c1('0x47')],null))[_0x62c1('0x23')](respondWithResult(_0x31ec5e,null))[_0x62c1('0x45')](handleError(_0x31ec5e,null));};exports[_0x62c1('0x24')]=function(_0x28ddf2,_0x569cba){return db[_0x62c1('0x2b')][_0x62c1('0x48')]({'where':{'id':_0x28ddf2['params']['id']}})[_0x62c1('0x23')](handleEntityNotFound(_0x569cba,null))[_0x62c1('0x23')](removeEntity(_0x569cba,null))[_0x62c1('0x45')](handleError(_0x569cba,null));};exports[_0x62c1('0x4a')]=function(_0x5b8d82,_0x5ebc56){return db['IntegrationReport']['describe']()['then'](respondWithResult(_0x5ebc56,null))[_0x62c1('0x45')](handleError(_0x5ebc56,null));}; \ No newline at end of file +var _0xd9fb=['mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','name','send','index','IntegrationReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','find','create','body','destroy','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird'];(function(_0x1e5098,_0x26e3f4){var _0x551a09=function(_0x1cef04){while(--_0x1cef04){_0x1e5098['push'](_0x1e5098['shift']());}};_0x551a09(++_0x26e3f4);}(_0xd9fb,0xe8));var _0xbd9f=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xd9fb[_0x1f9f37];return _0x21c080;};'use strict';var emlformat=require(_0xbd9f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbd9f('0x1'));var rp=require(_0xbd9f('0x2'));var moment=require(_0xbd9f('0x3'));var BPromise=require(_0xbd9f('0x4'));var Mustache=require(_0xbd9f('0x5'));var util=require(_0xbd9f('0x6'));var path=require(_0xbd9f('0x7'));var sox=require('sox');var csv=require(_0xbd9f('0x8'));var ejs=require(_0xbd9f('0x9'));var fs=require('fs');var fs_extra=require(_0xbd9f('0xa'));var _=require('lodash');var squel=require(_0xbd9f('0xb'));var crypto=require(_0xbd9f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbd9f('0xd'));var toCsv=require(_0xbd9f('0x8'));var querystring=require(_0xbd9f('0xe'));var Papa=require(_0xbd9f('0xf'));var Redis=require('ioredis');var authService=require(_0xbd9f('0x10'));var qs=require(_0xbd9f('0x11'));var as=require(_0xbd9f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd9f('0x13'))(_0xbd9f('0x14'));var utils=require(_0xbd9f('0x15'));var config=require(_0xbd9f('0x16'));var licenseUtil=require(_0xbd9f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x384613,_0x177a57){_0x177a57=_0x177a57||0xcc;return function(_0x28b30e){if(_0x28b30e){return _0x384613[_0xbd9f('0x18')](_0x177a57);}return _0x384613[_0xbd9f('0x19')](_0x177a57)['end']();};}function respondWithResult(_0x30b34f,_0x3cb2f5){_0x3cb2f5=_0x3cb2f5||0xc8;return function(_0x1504fe){if(_0x1504fe){return _0x30b34f[_0xbd9f('0x19')](_0x3cb2f5)[_0xbd9f('0x1a')](_0x1504fe);}};}function respondWithFilteredResult(_0x2ab7da,_0x5a4ee7){return function(_0x5e217f){if(_0x5e217f){var _0x3e14b=typeof _0x5a4ee7[_0xbd9f('0x1b')]===_0xbd9f('0x1c')&&typeof _0x5a4ee7[_0xbd9f('0x1d')]==='undefined';var _0x5bdd6c=_0x5e217f['count'];var _0xd1470a=_0x3e14b?0x0:_0x5a4ee7[_0xbd9f('0x1b')];var _0x5534a0=_0x3e14b?_0x5e217f[_0xbd9f('0x1e')]:_0x5a4ee7[_0xbd9f('0x1b')]+_0x5a4ee7[_0xbd9f('0x1d')];var _0x1dfcd6;if(_0x5534a0>=_0x5bdd6c){_0x5534a0=_0x5bdd6c;_0x1dfcd6=0xc8;}else{_0x1dfcd6=0xce;}_0x2ab7da[_0xbd9f('0x19')](_0x1dfcd6);return _0x2ab7da[_0xbd9f('0x1f')](_0xbd9f('0x20'),_0xd1470a+'-'+_0x5534a0+'/'+_0x5bdd6c)['json'](_0x5e217f);}return null;};}function patchUpdates(_0x26ca50){return function(_0x4f1907){try{jsonpatch[_0xbd9f('0x21')](_0x4f1907,_0x26ca50,!![]);}catch(_0x3d062a){return BPromise[_0xbd9f('0x22')](_0x3d062a);}return _0x4f1907[_0xbd9f('0x23')]();};}function saveUpdates(_0x3fa1ad,_0xb52434){return function(_0x1babcd){if(_0x1babcd){return _0x1babcd[_0xbd9f('0x24')](_0x3fa1ad)[_0xbd9f('0x25')](function(_0x311b2d){return _0x311b2d;});}return null;};}function removeEntity(_0x4c96a5,_0x5cd018){return function(_0xe54b5a){if(_0xe54b5a){return _0xe54b5a['destroy']()[_0xbd9f('0x25')](function(){_0x4c96a5[_0xbd9f('0x19')](0xcc)[_0xbd9f('0x26')]();});}};}function handleEntityNotFound(_0x2a81a6,_0x10cfa2){return function(_0x17c0ae){if(!_0x17c0ae){_0x2a81a6[_0xbd9f('0x18')](0x194);}return _0x17c0ae;};}function handleError(_0x324089,_0x52ca20){_0x52ca20=_0x52ca20||0x1f4;return function(_0x25a988){logger[_0xbd9f('0x27')](_0x25a988['stack']);if(_0x25a988[_0xbd9f('0x28')]){delete _0x25a988[_0xbd9f('0x28')];}_0x324089['status'](_0x52ca20)[_0xbd9f('0x29')](_0x25a988);};}exports[_0xbd9f('0x2a')]=function(_0x16ce5a,_0x133ed3){var _0x433a67={},_0x9ad699={},_0xd6e178={'count':0x0,'rows':[]};var _0x510e8a=_['map'](db[_0xbd9f('0x2b')]['rawAttributes'],function(_0x1b6077){return{'name':_0x1b6077[_0xbd9f('0x2c')],'type':_0x1b6077[_0xbd9f('0x2d')][_0xbd9f('0x2e')]};});_0x9ad699[_0xbd9f('0x2f')]=_['map'](_0x510e8a,_0xbd9f('0x28'));_0x9ad699[_0xbd9f('0x30')]=_['keys'](_0x16ce5a[_0xbd9f('0x30')]);_0x9ad699[_0xbd9f('0x31')]=_[_0xbd9f('0x32')](_0x9ad699[_0xbd9f('0x2f')],_0x9ad699['query']);_0x433a67['attributes']=_['intersection'](_0x9ad699['model'],qs[_0xbd9f('0x33')](_0x16ce5a['query'][_0xbd9f('0x33')]));_0x433a67[_0xbd9f('0x34')]=_0x433a67[_0xbd9f('0x34')][_0xbd9f('0x35')]?_0x433a67[_0xbd9f('0x34')]:_0x9ad699['model'];if(!_0x16ce5a[_0xbd9f('0x30')][_0xbd9f('0x36')](_0xbd9f('0x37'))){_0x433a67['limit']=qs[_0xbd9f('0x1d')](_0x16ce5a[_0xbd9f('0x30')]['limit']);_0x433a67[_0xbd9f('0x1b')]=qs[_0xbd9f('0x1b')](_0x16ce5a[_0xbd9f('0x30')]['offset']);}_0x433a67[_0xbd9f('0x38')]=qs['sort'](_0x16ce5a[_0xbd9f('0x30')][_0xbd9f('0x39')]);_0x433a67['where']=qs[_0xbd9f('0x31')](_[_0xbd9f('0x3a')](_0x16ce5a[_0xbd9f('0x30')],_0x9ad699[_0xbd9f('0x31')]),_0x510e8a);if(_0x16ce5a[_0xbd9f('0x30')][_0xbd9f('0x3b')]){_0x433a67[_0xbd9f('0x3c')]=_[_0xbd9f('0x3d')](_0x433a67['where'],{'$or':_[_0xbd9f('0x3e')](_0x510e8a,function(_0x41f499){if(_0x41f499[_0xbd9f('0x2d')]!==_0xbd9f('0x3f')){var _0x3aa93a={};_0x3aa93a[_0x41f499['name']]={'$like':'%'+_0x16ce5a[_0xbd9f('0x30')][_0xbd9f('0x3b')]+'%'};return _0x3aa93a;}})});}_0x433a67=_[_0xbd9f('0x3d')]({},_0x433a67,_0x16ce5a[_0xbd9f('0x40')]);var _0x2c03bc={'where':_0x433a67[_0xbd9f('0x3c')]};return db[_0xbd9f('0x2b')][_0xbd9f('0x1e')](_0x2c03bc)[_0xbd9f('0x25')](function(_0x18c822){_0xd6e178[_0xbd9f('0x1e')]=_0x18c822;if(_0x16ce5a['query'][_0xbd9f('0x41')]){_0x433a67[_0xbd9f('0x42')]=[{'all':!![]}];}return db['IntegrationReport'][_0xbd9f('0x43')](_0x433a67);})[_0xbd9f('0x25')](function(_0x590cf6){_0xd6e178[_0xbd9f('0x44')]=_0x590cf6;return _0xd6e178;})[_0xbd9f('0x25')](respondWithFilteredResult(_0x133ed3,_0x433a67))[_0xbd9f('0x45')](handleError(_0x133ed3,null));};exports[_0xbd9f('0x46')]=function(_0x3dfc8c,_0x5e4475){var _0xda6942={'raw':![],'where':{'id':_0x3dfc8c['params']['id']}},_0x68d586={};_0x68d586[_0xbd9f('0x2f')]=_['keys'](db[_0xbd9f('0x2b')][_0xbd9f('0x47')]);_0x68d586[_0xbd9f('0x30')]=_[_0xbd9f('0x48')](_0x3dfc8c[_0xbd9f('0x30')]);_0x68d586[_0xbd9f('0x31')]=_[_0xbd9f('0x32')](_0x68d586[_0xbd9f('0x2f')],_0x68d586['query']);_0xda6942['attributes']=_[_0xbd9f('0x32')](_0x68d586[_0xbd9f('0x2f')],qs[_0xbd9f('0x33')](_0x3dfc8c['query'][_0xbd9f('0x33')]));_0xda6942[_0xbd9f('0x34')]=_0xda6942['attributes'][_0xbd9f('0x35')]?_0xda6942['attributes']:_0x68d586[_0xbd9f('0x2f')];if(_0x3dfc8c['query'][_0xbd9f('0x41')]){_0xda6942[_0xbd9f('0x42')]=[{'all':!![]}];}_0xda6942=_[_0xbd9f('0x3d')]({},_0xda6942,_0x3dfc8c[_0xbd9f('0x40')]);return db['IntegrationReport'][_0xbd9f('0x49')](_0xda6942)[_0xbd9f('0x25')](handleEntityNotFound(_0x5e4475,null))[_0xbd9f('0x25')](respondWithResult(_0x5e4475,null))['catch'](handleError(_0x5e4475,null));};exports[_0xbd9f('0x4a')]=function(_0x35ba4e,_0x16cfcc){return db[_0xbd9f('0x2b')][_0xbd9f('0x4a')](_0x35ba4e[_0xbd9f('0x4b')],{})[_0xbd9f('0x25')](respondWithResult(_0x16cfcc,0xc9))[_0xbd9f('0x45')](handleError(_0x16cfcc,null));};exports[_0xbd9f('0x24')]=function(_0x2768f0,_0x246bb6){if(_0x2768f0['body']['id']){delete _0x2768f0['body']['id'];}return db[_0xbd9f('0x2b')][_0xbd9f('0x49')]({'where':{'id':_0x2768f0['params']['id']}})['then'](handleEntityNotFound(_0x246bb6,null))[_0xbd9f('0x25')](saveUpdates(_0x2768f0[_0xbd9f('0x4b')],null))['then'](respondWithResult(_0x246bb6,null))[_0xbd9f('0x45')](handleError(_0x246bb6,null));};exports[_0xbd9f('0x4c')]=function(_0x4ff60d,_0x281a83){return db[_0xbd9f('0x2b')]['find']({'where':{'id':_0x4ff60d[_0xbd9f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x281a83,null))[_0xbd9f('0x25')](removeEntity(_0x281a83,null))[_0xbd9f('0x45')](handleError(_0x281a83,null));};exports[_0xbd9f('0x4e')]=function(_0x140af6,_0x12c39b){return db['IntegrationReport'][_0xbd9f('0x4e')]()['then'](respondWithResult(_0x12c39b,null))['catch'](handleError(_0x12c39b,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 81372d0..73ad8b2 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 _0x0da7=['request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x552527,_0xe8793c){var _0x3932e9=function(_0x2592ff){while(--_0x2592ff){_0x552527['push'](_0x552527['shift']());}};_0x3932e9(++_0xe8793c);}(_0x0da7,0x1e9));var _0x70da=function(_0x2fea3f,_0x143c24){_0x2fea3f=_0x2fea3f-0x0;var _0xe7b365=_0x0da7[_0x2fea3f];return _0xe7b365;};'use strict';var _=require(_0x70da('0x0'));var util=require(_0x70da('0x1'));var logger=require(_0x70da('0x2'))(_0x70da('0x3'));var moment=require(_0x70da('0x4'));var BPromise=require(_0x70da('0x5'));var rp=require(_0x70da('0x6'));var fs=require('fs');var path=require(_0x70da('0x7'));var rimraf=require(_0x70da('0x8'));var config=require(_0x70da('0x9'));var attributes=require(_0x70da('0xa'));module[_0x70da('0xb')]=function(_0xce1c9b,_0x53aa0f){return _0xce1c9b[_0x70da('0xc')](_0x70da('0xd'),attributes,{'tableName':_0x70da('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x36a3=['IntegrationReport','report_integration','util','api','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x52217d,_0x30baef){var _0x8deff8=function(_0x30684b){while(--_0x30684b){_0x52217d['push'](_0x52217d['shift']());}};_0x8deff8(++_0x30baef);}(_0x36a3,0x106));var _0x336a=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x36a3[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require('lodash');var util=require(_0x336a('0x0'));var logger=require('../../config/logger')(_0x336a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x336a('0x2'));var fs=require('fs');var path=require(_0x336a('0x3'));var rimraf=require(_0x336a('0x4'));var config=require(_0x336a('0x5'));var attributes=require('./integrationReport.attributes');module[_0x336a('0x6')]=function(_0x5dbaa5,_0x1da051){return _0x5dbaa5[_0x336a('0x7')](_0x336a('0x8'),attributes,{'tableName':_0x336a('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 e9577c5..b9c1c79 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 _0xba34=['../../config/environment','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x9de83b,_0x9be4d3){var _0xa6f092=function(_0x3f5fda){while(--_0x3f5fda){_0x9de83b['push'](_0x9de83b['shift']());}};_0xa6f092(++_0x9be4d3);}(_0xba34,0x119));var _0x4ba3=function(_0x3177a8,_0x2f6691){_0x3177a8=_0x3177a8-0x0;var _0x2bb8be=_0xba34[_0x3177a8];return _0x2bb8be;};'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 _0x326f=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1939f8,_0x5793d8){var _0x187d48=function(_0x38ae9){while(--_0x38ae9){_0x1939f8['push'](_0x1939f8['shift']());}};_0x187d48(++_0x5793d8);}(_0x326f,0xd1));var _0xf326=function(_0x14b105,_0x24a5e1){_0x14b105=_0x14b105-0x0;var _0x18c81e=_0x326f[_0x14b105];return _0x18c81e;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index ac46031..d2bb1bb 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 _0x2bd8=['addIntervals','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','/:id','show','/:id/sub_intervals','post','/:id/sub_intervals/create_many'];(function(_0x2bb787,_0x41bf02){var _0x425b33=function(_0x49ea25){while(--_0x49ea25){_0x2bb787['push'](_0x2bb787['shift']());}};_0x425b33(++_0x41bf02);}(_0x2bd8,0x130));var _0x82bd=function(_0x4f5050,_0xe907cc){_0x4f5050=_0x4f5050-0x0;var _0x30f789=_0x2bd8[_0x4f5050];return _0x30f789;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var fs_extra=require(_0x82bd('0x5'));var auth=require(_0x82bd('0x6'));var interaction=require(_0x82bd('0x7'));var config=require('../../config/environment');var controller=require(_0x82bd('0x8'));router[_0x82bd('0x9')]('/',auth[_0x82bd('0xa')](),controller['index']);router[_0x82bd('0x9')](_0x82bd('0xb'),auth[_0x82bd('0xa')](),controller[_0x82bd('0xc')]);router['get'](_0x82bd('0xd'),auth['isAuthenticated'](),controller['getIntervals']);router['post']('/',auth[_0x82bd('0xa')](),controller['create']);router['post'](_0x82bd('0xd'),auth['isAuthenticated'](),controller['addInterval']);router[_0x82bd('0xe')](_0x82bd('0xf'),auth['isAuthenticated'](),controller[_0x82bd('0x10')]);router['put'](_0x82bd('0xb'),auth['isAuthenticated'](),controller[_0x82bd('0x11')]);router[_0x82bd('0x12')](_0x82bd('0xb'),auth[_0x82bd('0xa')](),controller['destroy']);module[_0x82bd('0x13')]=router; \ No newline at end of file +var _0xa751=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getIntervals','post','create','/:id/sub_intervals','addInterval','addIntervals','put','exports','multer','util','path','connect-timeout','Router'];(function(_0x4c14b0,_0x232350){var _0x12b649=function(_0x35b48c){while(--_0x35b48c){_0x4c14b0['push'](_0x4c14b0['shift']());}};_0x12b649(++_0x232350);}(_0xa751,0x175));var _0x1a75=function(_0x27c30f,_0x470639){_0x27c30f=_0x27c30f-0x0;var _0x106ab2=_0xa751[_0x27c30f];return _0x106ab2;};'use strict';var multer=require(_0x1a75('0x0'));var util=require(_0x1a75('0x1'));var path=require(_0x1a75('0x2'));var timeout=require(_0x1a75('0x3'));var express=require('express');var router=express[_0x1a75('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1a75('0x5'));var interaction=require(_0x1a75('0x6'));var config=require(_0x1a75('0x7'));var controller=require('./interval.controller');router[_0x1a75('0x8')]('/',auth[_0x1a75('0x9')](),controller[_0x1a75('0xa')]);router[_0x1a75('0x8')](_0x1a75('0xb'),auth[_0x1a75('0x9')](),controller[_0x1a75('0xc')]);router['get']('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0x1a75('0xd')]);router[_0x1a75('0xe')]('/',auth[_0x1a75('0x9')](),controller[_0x1a75('0xf')]);router[_0x1a75('0xe')](_0x1a75('0x10'),auth[_0x1a75('0x9')](),controller[_0x1a75('0x11')]);router['post']('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0x1a75('0x12')]);router[_0x1a75('0x13')](_0x1a75('0xb'),auth[_0x1a75('0x9')](),controller['update']);router['delete'](_0x1a75('0xb'),auth[_0x1a75('0x9')](),controller['destroy']);module[_0x1a75('0x14')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 10908ee..a4cbc4c 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 _0x42a8=['STRING','sequelize','exports'];(function(_0x1f318d,_0x597fff){var _0x58a8f1=function(_0x262878){while(--_0x262878){_0x1f318d['push'](_0x1f318d['shift']());}};_0x58a8f1(++_0x597fff);}(_0x42a8,0x1d8));var _0x842a=function(_0x411bd1,_0x416106){_0x411bd1=_0x411bd1-0x0;var _0x320464=_0x42a8[_0x411bd1];return _0x320464;};'use strict';var Sequelize=require(_0x842a('0x0'));module[_0x842a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x842a('0x2')]},'interval':{'type':Sequelize[_0x842a('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x7bc7=['sequelize','exports','STRING'];(function(_0x17168f,_0x4257d1){var _0x29d923=function(_0x1288c7){while(--_0x1288c7){_0x17168f['push'](_0x17168f['shift']());}};_0x29d923(++_0x4257d1);}(_0x7bc7,0xfc));var _0x77bc=function(_0x5572ed,_0x39cdda){_0x5572ed=_0x5572ed-0x0;var _0x232527=_0x7bc7[_0x5572ed];return _0x232527;};'use strict';var Sequelize=require(_0x77bc('0x0'));module[_0x77bc('0x1')]={'name':{'type':Sequelize[_0x77bc('0x2')]},'description':{'type':Sequelize[_0x77bc('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 8dfdd01..f5d80ec 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 _0x03ee=['set','Content-Range','reject','save','update','then','destroy','Intervals','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','sort','where','pick','merge','filter','Interval','rows','show','params','keys','includeAll','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','getIntervals','order','findOne','sequelize','transaction','IntervalId','bulkCreate','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x3bac2b,_0x137306){var _0xbadf45=function(_0xddb85a){while(--_0xddb85a){_0x3bac2b['push'](_0x3bac2b['shift']());}};_0xbadf45(++_0x137306);}(_0x03ee,0xf4));var _0xe03e=function(_0xc20f22,_0x49698f){_0xc20f22=_0xc20f22-0x0;var _0x1535d5=_0x03ee[_0xc20f22];return _0x1535d5;};'use strict';var emlformat=require(_0xe03e('0x0'));var rimraf=require(_0xe03e('0x1'));var zipdir=require(_0xe03e('0x2'));var jsonpatch=require(_0xe03e('0x3'));var rp=require(_0xe03e('0x4'));var moment=require(_0xe03e('0x5'));var BPromise=require(_0xe03e('0x6'));var Mustache=require('mustache');var util=require(_0xe03e('0x7'));var path=require(_0xe03e('0x8'));var sox=require(_0xe03e('0x9'));var csv=require('to-csv');var ejs=require(_0xe03e('0xa'));var fs=require('fs');var fs_extra=require(_0xe03e('0xb'));var _=require('lodash');var squel=require(_0xe03e('0xc'));var crypto=require(_0xe03e('0xd'));var jsforce=require(_0xe03e('0xe'));var deskjs=require(_0xe03e('0xf'));var toCsv=require(_0xe03e('0x10'));var querystring=require(_0xe03e('0x11'));var Papa=require(_0xe03e('0x12'));var Redis=require('ioredis');var authService=require(_0xe03e('0x13'));var qs=require(_0xe03e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe03e('0x15'));var logger=require(_0xe03e('0x16'))('api');var utils=require(_0xe03e('0x17'));var config=require(_0xe03e('0x18'));var licenseUtil=require(_0xe03e('0x19'));var db=require(_0xe03e('0x1a'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x2f558c,_0x35d364){_0x35d364=_0x35d364||0xcc;return function(_0x298fe7){if(_0x298fe7){return _0x2f558c[_0xe03e('0x1b')](_0x35d364);}return _0x2f558c[_0xe03e('0x1c')](_0x35d364)[_0xe03e('0x1d')]();};}function respondWithResult(_0x5cf27a,_0x5cca05){_0x5cca05=_0x5cca05||0xc8;return function(_0x379ff2){if(_0x379ff2){return _0x5cf27a[_0xe03e('0x1c')](_0x5cca05)[_0xe03e('0x1e')](_0x379ff2);}};}function respondWithFilteredResult(_0x293515,_0x54bca4){return function(_0x4dd3e8){if(_0x4dd3e8){var _0x93eedc=typeof _0x54bca4[_0xe03e('0x1f')]===_0xe03e('0x20')&&typeof _0x54bca4[_0xe03e('0x21')]===_0xe03e('0x20');var _0x2278e2=_0x4dd3e8[_0xe03e('0x22')];var _0x428441=_0x93eedc?0x0:_0x54bca4[_0xe03e('0x1f')];var _0x125e2a=_0x93eedc?_0x4dd3e8[_0xe03e('0x22')]:_0x54bca4[_0xe03e('0x1f')]+_0x54bca4[_0xe03e('0x21')];var _0x185ae4;if(_0x125e2a>=_0x2278e2){_0x125e2a=_0x2278e2;_0x185ae4=0xc8;}else{_0x185ae4=0xce;}_0x293515[_0xe03e('0x1c')](_0x185ae4);return _0x293515[_0xe03e('0x23')](_0xe03e('0x24'),_0x428441+'-'+_0x125e2a+'/'+_0x2278e2)[_0xe03e('0x1e')](_0x4dd3e8);}return null;};}function patchUpdates(_0x4dfd07){return function(_0x174369){try{jsonpatch['apply'](_0x174369,_0x4dfd07,!![]);}catch(_0x760821){return BPromise[_0xe03e('0x25')](_0x760821);}return _0x174369[_0xe03e('0x26')]();};}function saveUpdates(_0x450cb2,_0x596819){return function(_0x3dc5b0){if(_0x3dc5b0){return _0x3dc5b0[_0xe03e('0x27')](_0x450cb2)[_0xe03e('0x28')](function(_0xfa2071){return _0xfa2071;});}return null;};}function removeEntity(_0x346f78,_0x1f363e){return function(_0x510601){if(_0x510601){return _0x510601[_0xe03e('0x29')]()[_0xe03e('0x28')](function(){var _0x4a8ac2=_0x510601['get']({'plain':!![]});var _0x28a397=_0xe03e('0x2a');return db[_0xe03e('0x2b')][_0xe03e('0x29')]({'where':{'type':_0x28a397,'resourceId':_0x4a8ac2['id']}})[_0xe03e('0x28')](function(){return _0x510601;});})[_0xe03e('0x28')](function(){_0x346f78[_0xe03e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29d062,_0x1de166){return function(_0x1f4c4c){if(!_0x1f4c4c){_0x29d062[_0xe03e('0x1b')](0x194);}return _0x1f4c4c;};}function handleError(_0x1afd42,_0x5d187c){_0x5d187c=_0x5d187c||0x1f4;return function(_0x17d24b){logger[_0xe03e('0x2c')](_0x17d24b[_0xe03e('0x2d')]);if(_0x17d24b[_0xe03e('0x2e')]){delete _0x17d24b['name'];}_0x1afd42['status'](_0x5d187c)[_0xe03e('0x2f')](_0x17d24b);};}exports[_0xe03e('0x30')]=function(_0x3dd507,_0x6b5892){var _0x2bfa46={},_0x130a5c={},_0x1ca3d0={'count':0x0,'rows':[]};var _0x1af061=_[_0xe03e('0x31')](db['Interval'][_0xe03e('0x32')],function(_0xe87639){return{'name':_0xe87639[_0xe03e('0x33')],'type':_0xe87639[_0xe03e('0x34')][_0xe03e('0x35')]};});_0x130a5c[_0xe03e('0x36')]=_[_0xe03e('0x31')](_0x1af061,_0xe03e('0x2e'));_0x130a5c[_0xe03e('0x37')]=_['keys'](_0x3dd507[_0xe03e('0x37')]);_0x130a5c[_0xe03e('0x38')]=_[_0xe03e('0x39')](_0x130a5c[_0xe03e('0x36')],_0x130a5c['query']);_0x2bfa46[_0xe03e('0x3a')]=_[_0xe03e('0x39')](_0x130a5c[_0xe03e('0x36')],qs[_0xe03e('0x3b')](_0x3dd507[_0xe03e('0x37')][_0xe03e('0x3b')]));_0x2bfa46[_0xe03e('0x3a')]=_0x2bfa46[_0xe03e('0x3a')][_0xe03e('0x3c')]?_0x2bfa46[_0xe03e('0x3a')]:_0x130a5c['model'];if(!_0x3dd507[_0xe03e('0x37')]['hasOwnProperty']('nolimit')){_0x2bfa46[_0xe03e('0x21')]=qs[_0xe03e('0x21')](_0x3dd507[_0xe03e('0x37')][_0xe03e('0x21')]);_0x2bfa46[_0xe03e('0x1f')]=qs[_0xe03e('0x1f')](_0x3dd507[_0xe03e('0x37')][_0xe03e('0x1f')]);}_0x2bfa46['order']=qs[_0xe03e('0x3d')](_0x3dd507[_0xe03e('0x37')]['sort']);_0x2bfa46[_0xe03e('0x3e')]=qs[_0xe03e('0x38')](_[_0xe03e('0x3f')](_0x3dd507['query'],_0x130a5c[_0xe03e('0x38')]),_0x1af061);if(_0x3dd507['query']['filter']){_0x2bfa46[_0xe03e('0x3e')]=_[_0xe03e('0x40')](_0x2bfa46['where'],{'$or':_['map'](_0x1af061,function(_0x1eb076){if(_0x1eb076['type']!=='VIRTUAL'){var _0x1ae7ec={};_0x1ae7ec[_0x1eb076[_0xe03e('0x2e')]]={'$like':'%'+_0x3dd507[_0xe03e('0x37')][_0xe03e('0x41')]+'%'};return _0x1ae7ec;}})});}_0x2bfa46=_[_0xe03e('0x40')]({},_0x2bfa46,_0x3dd507['options']);var _0x2df4c6={'where':_0x2bfa46[_0xe03e('0x3e')]};return db[_0xe03e('0x42')][_0xe03e('0x22')](_0x2df4c6)[_0xe03e('0x28')](function(_0x48dc03){_0x1ca3d0[_0xe03e('0x22')]=_0x48dc03;if(_0x3dd507['query']['includeAll']){_0x2bfa46['include']=[{'all':!![]}];}return db[_0xe03e('0x42')]['findAll'](_0x2bfa46);})[_0xe03e('0x28')](function(_0x10dab0){_0x1ca3d0[_0xe03e('0x43')]=_0x10dab0;return _0x1ca3d0;})[_0xe03e('0x28')](respondWithFilteredResult(_0x6b5892,_0x2bfa46))['catch'](handleError(_0x6b5892,null));};exports[_0xe03e('0x44')]=function(_0x990ad3,_0x45bddd){var _0x14c2ef={'raw':!![],'where':{'id':_0x990ad3[_0xe03e('0x45')]['id']}},_0x3b726f={};_0x3b726f[_0xe03e('0x36')]=_[_0xe03e('0x46')](db['Interval'][_0xe03e('0x32')]);_0x3b726f[_0xe03e('0x37')]=_[_0xe03e('0x46')](_0x990ad3[_0xe03e('0x37')]);_0x3b726f[_0xe03e('0x38')]=_[_0xe03e('0x39')](_0x3b726f[_0xe03e('0x36')],_0x3b726f['query']);_0x14c2ef['attributes']=_[_0xe03e('0x39')](_0x3b726f[_0xe03e('0x36')],qs[_0xe03e('0x3b')](_0x990ad3[_0xe03e('0x37')]['fields']));_0x14c2ef[_0xe03e('0x3a')]=_0x14c2ef[_0xe03e('0x3a')][_0xe03e('0x3c')]?_0x14c2ef['attributes']:_0x3b726f['model'];if(_0x990ad3[_0xe03e('0x37')][_0xe03e('0x47')]){_0x14c2ef[_0xe03e('0x48')]=[{'all':!![]}];}_0x14c2ef=_[_0xe03e('0x40')]({},_0x14c2ef,_0x990ad3[_0xe03e('0x49')]);return db[_0xe03e('0x42')][_0xe03e('0x4a')](_0x14c2ef)[_0xe03e('0x28')](handleEntityNotFound(_0x45bddd,null))[_0xe03e('0x28')](respondWithResult(_0x45bddd,null))['catch'](handleError(_0x45bddd,null));};exports[_0xe03e('0x4b')]=function(_0x52b5de,_0x3d262c){return db[_0xe03e('0x42')][_0xe03e('0x4b')](_0x52b5de[_0xe03e('0x4c')],{})[_0xe03e('0x28')](function(_0x23edcd){var _0x2f6a4d=_0x52b5de[_0xe03e('0x4d')][_0xe03e('0x4e')]({'plain':!![]});if(!_0x2f6a4d)throw new Error(_0xe03e('0x4f'));if(_0x2f6a4d['role']==='user'){var _0x2ffe5d=_0x23edcd[_0xe03e('0x4e')]({'plain':!![]});var _0x5a5c8c=_0xe03e('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x5a5c8c,'userProfileId':_0x2f6a4d[_0xe03e('0x50')]},'raw':!![]})[_0xe03e('0x28')](function(_0x342861){if(_0x342861&&_0x342861[_0xe03e('0x51')]===0x0){return db[_0xe03e('0x2b')][_0xe03e('0x4b')]({'name':_0x2ffe5d[_0xe03e('0x2e')],'resourceId':_0x2ffe5d['id'],'type':_0x342861[_0xe03e('0x2e')],'sectionId':_0x342861['id']},{})[_0xe03e('0x28')](function(){return _0x23edcd;});}else{return _0x23edcd;}})[_0xe03e('0x52')](function(_0x2e18d0){logger[_0xe03e('0x2c')](_0xe03e('0x53'),_0x2e18d0);throw _0x2e18d0;});}return _0x23edcd;})[_0xe03e('0x28')](respondWithResult(_0x3d262c,0xc9))[_0xe03e('0x52')](handleError(_0x3d262c,null));};exports[_0xe03e('0x27')]=function(_0x315a29,_0x53a6ca){if(_0x315a29[_0xe03e('0x4c')]['id']){delete _0x315a29['body']['id'];}return db[_0xe03e('0x42')]['find']({'where':{'id':_0x315a29[_0xe03e('0x45')]['id']}})[_0xe03e('0x28')](handleEntityNotFound(_0x53a6ca,null))[_0xe03e('0x28')](saveUpdates(_0x315a29[_0xe03e('0x4c')],null))[_0xe03e('0x28')](respondWithResult(_0x53a6ca,null))['catch'](handleError(_0x53a6ca,null));};exports['destroy']=function(_0x4c3411,_0x1289a5){return db[_0xe03e('0x42')][_0xe03e('0x4a')]({'where':{'id':_0x4c3411['params']['id']}})[_0xe03e('0x28')](handleEntityNotFound(_0x1289a5,null))[_0xe03e('0x28')](removeEntity(_0x1289a5,null))['catch'](handleError(_0x1289a5,null));};exports[_0xe03e('0x54')]=function(_0x214219,_0x4085c3,_0x4fa3e2){if(_0x214219[_0xe03e('0x4c')]['id']){delete _0x214219[_0xe03e('0x4c')]['id'];}return db[_0xe03e('0x42')]['find']({'where':{'id':_0x214219[_0xe03e('0x45')]['id']}})[_0xe03e('0x28')](handleEntityNotFound(_0x4085c3,null))[_0xe03e('0x28')](function(_0x418c3a){if(_0x418c3a){_0x214219[_0xe03e('0x4c')]['IntervalId']=_0x418c3a['id'];return db[_0xe03e('0x42')][_0xe03e('0x4b')](_0x214219[_0xe03e('0x4c')]);}})[_0xe03e('0x28')](respondWithResult(_0x4085c3,null))[_0xe03e('0x52')](handleError(_0x4085c3,null));};exports[_0xe03e('0x55')]=function(_0x31c093,_0x3cd85c,_0x324103){var _0x11c9f1={};var _0x375de1={};var _0x2113ae;var _0x4f814f;return db[_0xe03e('0x42')]['findOne']({'where':{'id':_0x31c093[_0xe03e('0x45')]['id']}})['then'](handleEntityNotFound(_0x3cd85c,null))[_0xe03e('0x28')](function(_0x214ec7){if(_0x214ec7){_0x2113ae=_0x214ec7;_0x375de1['model']=_[_0xe03e('0x46')](db[_0xe03e('0x42')]['rawAttributes']);_0x375de1[_0xe03e('0x37')]=_[_0xe03e('0x46')](_0x31c093['query']);_0x375de1[_0xe03e('0x38')]=_[_0xe03e('0x39')](_0x375de1[_0xe03e('0x36')],_0x375de1['query']);_0x11c9f1[_0xe03e('0x3a')]=_[_0xe03e('0x39')](_0x375de1[_0xe03e('0x36')],qs[_0xe03e('0x3b')](_0x31c093[_0xe03e('0x37')][_0xe03e('0x3b')]));_0x11c9f1[_0xe03e('0x3a')]=_0x11c9f1[_0xe03e('0x3a')][_0xe03e('0x3c')]?_0x11c9f1['attributes']:_0x375de1[_0xe03e('0x36')];_0x11c9f1[_0xe03e('0x56')]=qs['sort'](_0x31c093[_0xe03e('0x37')][_0xe03e('0x3d')]);_0x11c9f1['where']=qs[_0xe03e('0x38')](_[_0xe03e('0x3f')](_0x31c093['query'],_0x375de1['filters']));if(_0x31c093[_0xe03e('0x37')][_0xe03e('0x41')]){_0x11c9f1['where']=_[_0xe03e('0x40')](_0x11c9f1[_0xe03e('0x3e')],{'$or':_[_0xe03e('0x31')](_0x11c9f1['attributes'],function(_0x38f37e){var _0x5a4f5b={};_0x5a4f5b[_0x38f37e]={'$like':'%'+_0x31c093[_0xe03e('0x37')][_0xe03e('0x41')]+'%'};return _0x5a4f5b;})});}_0x11c9f1=_[_0xe03e('0x40')]({},_0x11c9f1,_0x31c093[_0xe03e('0x49')]);return _0x2113ae[_0xe03e('0x55')](_0x11c9f1);}})['then'](function(_0x3af3bf){if(_0x3af3bf){_0x4f814f=_0x3af3bf[_0xe03e('0x3c')];if(!_0x31c093['query']['hasOwnProperty']('nolimit')){_0x11c9f1[_0xe03e('0x21')]=qs[_0xe03e('0x21')](_0x31c093[_0xe03e('0x37')][_0xe03e('0x21')]);_0x11c9f1['offset']=qs[_0xe03e('0x1f')](_0x31c093[_0xe03e('0x37')][_0xe03e('0x1f')]);}return _0x2113ae[_0xe03e('0x55')](_0x11c9f1);}})['then'](function(_0x5942f0){if(_0x5942f0){return _0x5942f0?{'count':_0x4f814f,'rows':_0x5942f0}:null;}})[_0xe03e('0x28')](respondWithResult(_0x3cd85c,null))[_0xe03e('0x52')](handleError(_0x3cd85c,null));};exports['addIntervals']=function(_0x4be886,_0x51c54e,_0xefa089){return db[_0xe03e('0x42')][_0xe03e('0x57')]({'where':{'id':_0x4be886[_0xe03e('0x45')]['id']}})['then'](handleEntityNotFound(_0x51c54e,null))[_0xe03e('0x28')](function(_0x2ec5fe){if(_0x2ec5fe){return db[_0xe03e('0x58')][_0xe03e('0x59')](function(_0x387225){return db[_0xe03e('0x42')][_0xe03e('0x29')]({'where':{'IntervalId':_0x4be886[_0xe03e('0x45')]['id']},'transaction':_0x387225})[_0xe03e('0x28')](function(_0x386cd0){var _0x2eafe7=_[_0xe03e('0x31')](_0x4be886[_0xe03e('0x4c')],function(_0x28842d){delete _0x28842d['id'];_0x28842d[_0xe03e('0x5a')]=_0x4be886['params']['id'];return _0x28842d;});return db['Interval'][_0xe03e('0x5b')](_0x2eafe7,{'transaction':_0x387225});});})[_0xe03e('0x28')](function(){return db[_0xe03e('0x42')][_0xe03e('0x5c')]({'where':{'IntervalId':_0x4be886['params']['id']}});});}})[_0xe03e('0x28')](respondWithResult(_0x51c54e,null))[_0xe03e('0x52')](handleError(_0x51c54e,null));}; \ No newline at end of file +var _0x3f69=['set','Content-Range','apply','save','destroy','Intervals','then','stack','name','send','index','Interval','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','options','includeAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileResource','error','update','addInterval','IntervalId','getIntervals','findOne','rawAttributes','pick','addIntervals','sequelize','transaction','bulkCreate','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','count'];(function(_0x229eb5,_0x462412){var _0x2a093d=function(_0x5c2d9c){while(--_0x5c2d9c){_0x229eb5['push'](_0x229eb5['shift']());}};_0x2a093d(++_0x462412);}(_0x3f69,0xf5));var _0x93f6=function(_0x5ba6cb,_0x5b0843){_0x5ba6cb=_0x5ba6cb-0x0;var _0x4179c9=_0x3f69[_0x5ba6cb];return _0x4179c9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x93f6('0x0'));var zipdir=require(_0x93f6('0x1'));var jsonpatch=require(_0x93f6('0x2'));var rp=require(_0x93f6('0x3'));var moment=require(_0x93f6('0x4'));var BPromise=require(_0x93f6('0x5'));var Mustache=require(_0x93f6('0x6'));var util=require(_0x93f6('0x7'));var path=require(_0x93f6('0x8'));var sox=require(_0x93f6('0x9'));var csv=require(_0x93f6('0xa'));var ejs=require(_0x93f6('0xb'));var fs=require('fs');var fs_extra=require(_0x93f6('0xc'));var _=require(_0x93f6('0xd'));var squel=require(_0x93f6('0xe'));var crypto=require(_0x93f6('0xf'));var jsforce=require(_0x93f6('0x10'));var deskjs=require(_0x93f6('0x11'));var toCsv=require(_0x93f6('0xa'));var querystring=require(_0x93f6('0x12'));var Papa=require(_0x93f6('0x13'));var Redis=require(_0x93f6('0x14'));var authService=require(_0x93f6('0x15'));var qs=require(_0x93f6('0x16'));var as=require(_0x93f6('0x17'));var hardwareService=require(_0x93f6('0x18'));var logger=require(_0x93f6('0x19'))(_0x93f6('0x1a'));var utils=require(_0x93f6('0x1b'));var config=require(_0x93f6('0x1c'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var extensions=require(_0x93f6('0x1d'));function respondWithStatusCode(_0x57b168,_0x512deb){_0x512deb=_0x512deb||0xcc;return function(_0x3cfd04){if(_0x3cfd04){return _0x57b168[_0x93f6('0x1e')](_0x512deb);}return _0x57b168[_0x93f6('0x1f')](_0x512deb)[_0x93f6('0x20')]();};}function respondWithResult(_0x4c88c3,_0x37ddae){_0x37ddae=_0x37ddae||0xc8;return function(_0x456d3e){if(_0x456d3e){return _0x4c88c3[_0x93f6('0x1f')](_0x37ddae)[_0x93f6('0x21')](_0x456d3e);}};}function respondWithFilteredResult(_0x3cb8f7,_0x5b8a10){return function(_0x3e7d0e){if(_0x3e7d0e){var _0x4e31c6=typeof _0x5b8a10[_0x93f6('0x22')]===_0x93f6('0x23')&&typeof _0x5b8a10['limit']===_0x93f6('0x23');var _0x1efc01=_0x3e7d0e[_0x93f6('0x24')];var _0x5bfcc7=_0x4e31c6?0x0:_0x5b8a10[_0x93f6('0x22')];var _0x3acf2e=_0x4e31c6?_0x3e7d0e[_0x93f6('0x24')]:_0x5b8a10['offset']+_0x5b8a10['limit'];var _0x2a6577;if(_0x3acf2e>=_0x1efc01){_0x3acf2e=_0x1efc01;_0x2a6577=0xc8;}else{_0x2a6577=0xce;}_0x3cb8f7[_0x93f6('0x1f')](_0x2a6577);return _0x3cb8f7[_0x93f6('0x25')](_0x93f6('0x26'),_0x5bfcc7+'-'+_0x3acf2e+'/'+_0x1efc01)['json'](_0x3e7d0e);}return null;};}function patchUpdates(_0x4d0aa4){return function(_0x19fe55){try{jsonpatch[_0x93f6('0x27')](_0x19fe55,_0x4d0aa4,!![]);}catch(_0x31b077){return BPromise['reject'](_0x31b077);}return _0x19fe55[_0x93f6('0x28')]();};}function saveUpdates(_0x4152e2,_0x5e3c55){return function(_0xcb04e0){if(_0xcb04e0){return _0xcb04e0['update'](_0x4152e2)['then'](function(_0x4e6394){return _0x4e6394;});}return null;};}function removeEntity(_0x5a5266,_0xb71f3f){return function(_0x4d8a62){if(_0x4d8a62){return _0x4d8a62[_0x93f6('0x29')]()['then'](function(){var _0x29422c=_0x4d8a62['get']({'plain':!![]});var _0x16b436=_0x93f6('0x2a');return db['UserProfileResource'][_0x93f6('0x29')]({'where':{'type':_0x16b436,'resourceId':_0x29422c['id']}})['then'](function(){return _0x4d8a62;});})[_0x93f6('0x2b')](function(){_0x5a5266[_0x93f6('0x1f')](0xcc)[_0x93f6('0x20')]();});}};}function handleEntityNotFound(_0x566789,_0x105fe0){return function(_0x2bc9e7){if(!_0x2bc9e7){_0x566789[_0x93f6('0x1e')](0x194);}return _0x2bc9e7;};}function handleError(_0x3d637a,_0x10e38d){_0x10e38d=_0x10e38d||0x1f4;return function(_0x4f62c0){logger['error'](_0x4f62c0[_0x93f6('0x2c')]);if(_0x4f62c0[_0x93f6('0x2d')]){delete _0x4f62c0['name'];}_0x3d637a[_0x93f6('0x1f')](_0x10e38d)[_0x93f6('0x2e')](_0x4f62c0);};}exports[_0x93f6('0x2f')]=function(_0x541b98,_0x43ac42){var _0x5e8e14={},_0x4e5a6f={},_0x483f3f={'count':0x0,'rows':[]};var _0x2efd5b=_['map'](db[_0x93f6('0x30')]['rawAttributes'],function(_0x1cf073){return{'name':_0x1cf073[_0x93f6('0x31')],'type':_0x1cf073[_0x93f6('0x32')]['key']};});_0x4e5a6f['model']=_['map'](_0x2efd5b,_0x93f6('0x2d'));_0x4e5a6f['query']=_[_0x93f6('0x33')](_0x541b98[_0x93f6('0x34')]);_0x4e5a6f[_0x93f6('0x35')]=_[_0x93f6('0x36')](_0x4e5a6f[_0x93f6('0x37')],_0x4e5a6f['query']);_0x5e8e14[_0x93f6('0x38')]=_[_0x93f6('0x36')](_0x4e5a6f[_0x93f6('0x37')],qs[_0x93f6('0x39')](_0x541b98[_0x93f6('0x34')]['fields']));_0x5e8e14['attributes']=_0x5e8e14[_0x93f6('0x38')][_0x93f6('0x3a')]?_0x5e8e14[_0x93f6('0x38')]:_0x4e5a6f[_0x93f6('0x37')];if(!_0x541b98[_0x93f6('0x34')][_0x93f6('0x3b')](_0x93f6('0x3c'))){_0x5e8e14[_0x93f6('0x3d')]=qs['limit'](_0x541b98[_0x93f6('0x34')][_0x93f6('0x3d')]);_0x5e8e14[_0x93f6('0x22')]=qs[_0x93f6('0x22')](_0x541b98['query']['offset']);}_0x5e8e14[_0x93f6('0x3e')]=qs['sort'](_0x541b98[_0x93f6('0x34')][_0x93f6('0x3f')]);_0x5e8e14[_0x93f6('0x40')]=qs[_0x93f6('0x35')](_['pick'](_0x541b98[_0x93f6('0x34')],_0x4e5a6f[_0x93f6('0x35')]),_0x2efd5b);if(_0x541b98[_0x93f6('0x34')][_0x93f6('0x41')]){_0x5e8e14[_0x93f6('0x40')]=_[_0x93f6('0x42')](_0x5e8e14[_0x93f6('0x40')],{'$or':_[_0x93f6('0x43')](_0x2efd5b,function(_0x414cff){if(_0x414cff[_0x93f6('0x32')]!=='VIRTUAL'){var _0x43d53b={};_0x43d53b[_0x414cff[_0x93f6('0x2d')]]={'$like':'%'+_0x541b98[_0x93f6('0x34')][_0x93f6('0x41')]+'%'};return _0x43d53b;}})});}_0x5e8e14=_[_0x93f6('0x42')]({},_0x5e8e14,_0x541b98[_0x93f6('0x44')]);var _0x251212={'where':_0x5e8e14[_0x93f6('0x40')]};return db['Interval']['count'](_0x251212)['then'](function(_0x5c9526){_0x483f3f[_0x93f6('0x24')]=_0x5c9526;if(_0x541b98[_0x93f6('0x34')][_0x93f6('0x45')]){_0x5e8e14['include']=[{'all':!![]}];}return db['Interval']['findAll'](_0x5e8e14);})[_0x93f6('0x2b')](function(_0x1077c0){_0x483f3f[_0x93f6('0x46')]=_0x1077c0;return _0x483f3f;})[_0x93f6('0x2b')](respondWithFilteredResult(_0x43ac42,_0x5e8e14))[_0x93f6('0x47')](handleError(_0x43ac42,null));};exports[_0x93f6('0x48')]=function(_0x2b1322,_0x4e479f){var _0x324108={'raw':!![],'where':{'id':_0x2b1322[_0x93f6('0x49')]['id']}},_0x3eccdd={};_0x3eccdd[_0x93f6('0x37')]=_[_0x93f6('0x33')](db[_0x93f6('0x30')]['rawAttributes']);_0x3eccdd[_0x93f6('0x34')]=_['keys'](_0x2b1322[_0x93f6('0x34')]);_0x3eccdd['filters']=_[_0x93f6('0x36')](_0x3eccdd[_0x93f6('0x37')],_0x3eccdd[_0x93f6('0x34')]);_0x324108['attributes']=_['intersection'](_0x3eccdd[_0x93f6('0x37')],qs[_0x93f6('0x39')](_0x2b1322[_0x93f6('0x34')][_0x93f6('0x39')]));_0x324108[_0x93f6('0x38')]=_0x324108[_0x93f6('0x38')][_0x93f6('0x3a')]?_0x324108['attributes']:_0x3eccdd[_0x93f6('0x37')];if(_0x2b1322[_0x93f6('0x34')]['includeAll']){_0x324108[_0x93f6('0x4a')]=[{'all':!![]}];}_0x324108=_[_0x93f6('0x42')]({},_0x324108,_0x2b1322[_0x93f6('0x44')]);return db['Interval'][_0x93f6('0x4b')](_0x324108)[_0x93f6('0x2b')](handleEntityNotFound(_0x4e479f,null))[_0x93f6('0x2b')](respondWithResult(_0x4e479f,null))[_0x93f6('0x47')](handleError(_0x4e479f,null));};exports[_0x93f6('0x4c')]=function(_0x3479be,_0x1ea61a){return db['Interval']['create'](_0x3479be[_0x93f6('0x4d')],{})['then'](function(_0x3863ba){var _0x38e8e6=_0x3479be[_0x93f6('0x4e')]['get']({'plain':!![]});if(!_0x38e8e6)throw new Error(_0x93f6('0x4f'));if(_0x38e8e6[_0x93f6('0x50')]===_0x93f6('0x4e')){var _0x41c73a=_0x3863ba['get']({'plain':!![]});var _0x252389='Intervals';return db['UserProfileSection'][_0x93f6('0x4b')]({'where':{'name':_0x252389,'userProfileId':_0x38e8e6['userProfileId']},'raw':!![]})[_0x93f6('0x2b')](function(_0x2318a3){if(_0x2318a3&&_0x2318a3['autoAssociation']===0x0){return db[_0x93f6('0x51')]['create']({'name':_0x41c73a[_0x93f6('0x2d')],'resourceId':_0x41c73a['id'],'type':_0x2318a3[_0x93f6('0x2d')],'sectionId':_0x2318a3['id']},{})[_0x93f6('0x2b')](function(){return _0x3863ba;});}else{return _0x3863ba;}})[_0x93f6('0x47')](function(_0x5c11a0){logger[_0x93f6('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c11a0);throw _0x5c11a0;});}return _0x3863ba;})[_0x93f6('0x2b')](respondWithResult(_0x1ea61a,0xc9))[_0x93f6('0x47')](handleError(_0x1ea61a,null));};exports[_0x93f6('0x53')]=function(_0x5adc6e,_0xd7e727){if(_0x5adc6e['body']['id']){delete _0x5adc6e[_0x93f6('0x4d')]['id'];}return db[_0x93f6('0x30')][_0x93f6('0x4b')]({'where':{'id':_0x5adc6e[_0x93f6('0x49')]['id']}})[_0x93f6('0x2b')](handleEntityNotFound(_0xd7e727,null))['then'](saveUpdates(_0x5adc6e[_0x93f6('0x4d')],null))[_0x93f6('0x2b')](respondWithResult(_0xd7e727,null))[_0x93f6('0x47')](handleError(_0xd7e727,null));};exports[_0x93f6('0x29')]=function(_0x4300af,_0x2df28d){return db[_0x93f6('0x30')][_0x93f6('0x4b')]({'where':{'id':_0x4300af[_0x93f6('0x49')]['id']}})['then'](handleEntityNotFound(_0x2df28d,null))[_0x93f6('0x2b')](removeEntity(_0x2df28d,null))[_0x93f6('0x47')](handleError(_0x2df28d,null));};exports[_0x93f6('0x54')]=function(_0x369752,_0x3c9399,_0x4c0c16){if(_0x369752[_0x93f6('0x4d')]['id']){delete _0x369752[_0x93f6('0x4d')]['id'];}return db['Interval'][_0x93f6('0x4b')]({'where':{'id':_0x369752['params']['id']}})[_0x93f6('0x2b')](handleEntityNotFound(_0x3c9399,null))[_0x93f6('0x2b')](function(_0xfb4f35){if(_0xfb4f35){_0x369752[_0x93f6('0x4d')][_0x93f6('0x55')]=_0xfb4f35['id'];return db['Interval'][_0x93f6('0x4c')](_0x369752[_0x93f6('0x4d')]);}})['then'](respondWithResult(_0x3c9399,null))[_0x93f6('0x47')](handleError(_0x3c9399,null));};exports[_0x93f6('0x56')]=function(_0x2fb402,_0x3759f9,_0x363241){var _0x512e17={};var _0x30a54a={};var _0x5b956d;var _0xb345b0;return db[_0x93f6('0x30')][_0x93f6('0x57')]({'where':{'id':_0x2fb402[_0x93f6('0x49')]['id']}})[_0x93f6('0x2b')](handleEntityNotFound(_0x3759f9,null))[_0x93f6('0x2b')](function(_0x285b05){if(_0x285b05){_0x5b956d=_0x285b05;_0x30a54a['model']=_[_0x93f6('0x33')](db[_0x93f6('0x30')][_0x93f6('0x58')]);_0x30a54a[_0x93f6('0x34')]=_[_0x93f6('0x33')](_0x2fb402[_0x93f6('0x34')]);_0x30a54a[_0x93f6('0x35')]=_['intersection'](_0x30a54a['model'],_0x30a54a['query']);_0x512e17['attributes']=_[_0x93f6('0x36')](_0x30a54a[_0x93f6('0x37')],qs[_0x93f6('0x39')](_0x2fb402[_0x93f6('0x34')][_0x93f6('0x39')]));_0x512e17[_0x93f6('0x38')]=_0x512e17[_0x93f6('0x38')]['length']?_0x512e17[_0x93f6('0x38')]:_0x30a54a['model'];_0x512e17[_0x93f6('0x3e')]=qs['sort'](_0x2fb402['query']['sort']);_0x512e17[_0x93f6('0x40')]=qs['filters'](_[_0x93f6('0x59')](_0x2fb402['query'],_0x30a54a[_0x93f6('0x35')]));if(_0x2fb402['query'][_0x93f6('0x41')]){_0x512e17[_0x93f6('0x40')]=_[_0x93f6('0x42')](_0x512e17['where'],{'$or':_[_0x93f6('0x43')](_0x512e17[_0x93f6('0x38')],function(_0x335d8b){var _0x499359={};_0x499359[_0x335d8b]={'$like':'%'+_0x2fb402[_0x93f6('0x34')][_0x93f6('0x41')]+'%'};return _0x499359;})});}_0x512e17=_[_0x93f6('0x42')]({},_0x512e17,_0x2fb402['options']);return _0x5b956d[_0x93f6('0x56')](_0x512e17);}})[_0x93f6('0x2b')](function(_0x283ad9){if(_0x283ad9){_0xb345b0=_0x283ad9[_0x93f6('0x3a')];if(!_0x2fb402[_0x93f6('0x34')][_0x93f6('0x3b')](_0x93f6('0x3c'))){_0x512e17[_0x93f6('0x3d')]=qs[_0x93f6('0x3d')](_0x2fb402[_0x93f6('0x34')][_0x93f6('0x3d')]);_0x512e17[_0x93f6('0x22')]=qs[_0x93f6('0x22')](_0x2fb402[_0x93f6('0x34')][_0x93f6('0x22')]);}return _0x5b956d['getIntervals'](_0x512e17);}})[_0x93f6('0x2b')](function(_0x124bfe){if(_0x124bfe){return _0x124bfe?{'count':_0xb345b0,'rows':_0x124bfe}:null;}})[_0x93f6('0x2b')](respondWithResult(_0x3759f9,null))[_0x93f6('0x47')](handleError(_0x3759f9,null));};exports[_0x93f6('0x5a')]=function(_0x271ebb,_0x44b5b9,_0x86208){return db[_0x93f6('0x30')][_0x93f6('0x57')]({'where':{'id':_0x271ebb[_0x93f6('0x49')]['id']}})[_0x93f6('0x2b')](handleEntityNotFound(_0x44b5b9,null))[_0x93f6('0x2b')](function(_0x5648e1){if(_0x5648e1){return db[_0x93f6('0x5b')][_0x93f6('0x5c')](function(_0xb06e7){return db[_0x93f6('0x30')][_0x93f6('0x29')]({'where':{'IntervalId':_0x271ebb[_0x93f6('0x49')]['id']},'transaction':_0xb06e7})[_0x93f6('0x2b')](function(_0x3f52a6){var _0x70b871=_['map'](_0x271ebb['body'],function(_0x25158c){delete _0x25158c['id'];_0x25158c['IntervalId']=_0x271ebb[_0x93f6('0x49')]['id'];return _0x25158c;});return db[_0x93f6('0x30')][_0x93f6('0x5d')](_0x70b871,{'transaction':_0xb06e7});});})[_0x93f6('0x2b')](function(){return db[_0x93f6('0x30')]['findAll']({'where':{'IntervalId':_0x271ebb[_0x93f6('0x49')]['id']}});});}})[_0x93f6('0x2b')](respondWithResult(_0x44b5b9,null))[_0x93f6('0x47')](handleError(_0x44b5b9,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index be72e5c..82a67dd 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 _0x8c3c=['getIntervals','then','all','map','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','exports','define','Interval','tools_intervals','rewrite','interval','string'];(function(_0x3ffc2a,_0x21aa42){var _0x32aa9b=function(_0x25603e){while(--_0x25603e){_0x3ffc2a['push'](_0x3ffc2a['shift']());}};_0x32aa9b(++_0x21aa42);}(_0x8c3c,0x1b6));var _0xc8c3=function(_0x2cd466,_0x39f5cd){_0x2cd466=_0x2cd466-0x0;var _0x52f758=_0x8c3c[_0x2cd466];return _0x52f758;};'use strict';var attributes=require(_0xc8c3('0x0'));var extensions=require(_0xc8c3('0x1'));var iftime=require(_0xc8c3('0x2'))['iftime'];module[_0xc8c3('0x3')]=function(_0x12591a){return _0x12591a[_0xc8c3('0x4')](_0xc8c3('0x5'),attributes,{'tableName':_0xc8c3('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x534d18){extensions[_0xc8c3('0x7')](_0x12591a,_0x534d18);},'afterBulkCreate':function(_0x3702a3,_0x3ea781,_0x3966ac){_0x3966ac();extensions['rewrite'](_0x12591a,_0x3702a3[0x0]);},'afterUpdate':function(_0x1b3291){extensions[_0xc8c3('0x7')](_0x12591a,_0x1b3291);},'afterDestroy':function(_0x54cbb4){extensions['rewrite'](_0x12591a,_0x54cbb4);}},'instanceMethods':{'ifTime':function(_0x1172be=undefined,_0x2af791=new Date()){if(typeof this[_0xc8c3('0x8')]===_0xc8c3('0x9')){return iftime(this[_0xc8c3('0x8')],_0x1172be,_0x2af791);}else{return this[_0xc8c3('0xa')]()[_0xc8c3('0xb')](function(_0x2f9ac8){return Promise[_0xc8c3('0xc')](_0x2f9ac8[_0xc8c3('0xd')](function(_0xec65f4){return _0xec65f4['ifTime'](_0x1172be,_0x2af791);}));})[_0xc8c3('0xb')](function(_0x200711){return _0x200711['reduce'](function(_0x1c2aa1,_0x3c6d0e){return _0x1c2aa1||_0x3c6d0e;},![]);});}}}});}; \ No newline at end of file +var _0x2645=['interval','getIntervals','then','ifTime','../../utils/iftime','iftime','exports','tools_intervals','rewrite'];(function(_0x485aa6,_0x82cc72){var _0x36bade=function(_0x4d346c){while(--_0x4d346c){_0x485aa6['push'](_0x485aa6['shift']());}};_0x36bade(++_0x82cc72);}(_0x2645,0x9d));var _0x5264=function(_0x347583,_0x138a1e){_0x347583=_0x347583-0x0;var _0x2e9668=_0x2645[_0x347583];return _0x2e9668;};'use strict';var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');var iftime=require(_0x5264('0x0'))[_0x5264('0x1')];module[_0x5264('0x2')]=function(_0x2f4c5b){return _0x2f4c5b['define']('Interval',attributes,{'tableName':_0x5264('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4395f0){extensions[_0x5264('0x4')](_0x2f4c5b,_0x4395f0);},'afterBulkCreate':function(_0x42e815,_0x945ce0,_0x2e7027){_0x2e7027();extensions[_0x5264('0x4')](_0x2f4c5b,_0x42e815[0x0]);},'afterUpdate':function(_0x57a582){extensions[_0x5264('0x4')](_0x2f4c5b,_0x57a582);},'afterDestroy':function(_0x27dfb7){extensions['rewrite'](_0x2f4c5b,_0x27dfb7);}},'instanceMethods':{'ifTime':function(_0x5d363e=undefined,_0x7715f4=new Date()){if(typeof this[_0x5264('0x5')]==='string'){return iftime(this[_0x5264('0x5')],_0x5d363e,_0x7715f4);}else{return this[_0x5264('0x6')]()[_0x5264('0x7')](function(_0x401ede){return Promise['all'](_0x401ede['map'](function(_0x2851a3){return _0x2851a3[_0x5264('0x8')](_0x5d363e,_0x7715f4);}));})[_0x5264('0x7')](function(_0xd32d9a){return _0xd32d9a['reduce'](function(_0x26f54c,_0x38b08f){return _0x26f54c||_0x38b08f;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 709c8d6..6bc5b7d 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 _0x9afd=['where','attributes','limit','include','model','map','then','info','stringify','catch','message','error','ShowInterval','find','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','isArray','intervals','string','timezone','IntervalIftime:\x20interval\x20strings\x20=\x20%s','debug','Iftime','silly','resolve','lodash','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger','GetInterval','Interval','findAll','options','raw'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x9afd,0x16f));var _0xd9af=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0x9afd[_0x270adf];return _0x29eda9;};'use strict';var _=require(_0xd9af('0x0'));var util=require(_0xd9af('0x1'));var db=require(_0xd9af('0x2'))['db'];var iftime=require(_0xd9af('0x3'))[_0xd9af('0x4')];var logger=require(_0xd9af('0x5'))('rpc');exports[_0xd9af('0x6')]=function(_0x5493f1){var _0x19faa1=this;return new Promise(function(_0x5a2f25,_0x4d5445){return db[_0xd9af('0x7')][_0xd9af('0x8')]({'raw':_0x5493f1[_0xd9af('0x9')]?_0x5493f1[_0xd9af('0x9')][_0xd9af('0xa')]===undefined?!![]:![]:!![],'where':_0x5493f1[_0xd9af('0x9')]?_0x5493f1['options'][_0xd9af('0xb')]||null:null,'attributes':_0x5493f1[_0xd9af('0x9')]?_0x5493f1[_0xd9af('0x9')][_0xd9af('0xc')]||null:null,'limit':_0x5493f1['options']?_0x5493f1[_0xd9af('0x9')][_0xd9af('0xd')]||null:null,'include':_0x5493f1['options']?_0x5493f1[_0xd9af('0x9')][_0xd9af('0xe')]?_['map'](_0x5493f1[_0xd9af('0x9')]['include'],function(_0x1ddc58){return{'model':db[_0x1ddc58[_0xd9af('0xf')]],'as':_0x1ddc58['as'],'attributes':_0x1ddc58['attributes'],'include':_0x1ddc58['include']?_[_0xd9af('0x10')](_0x1ddc58[_0xd9af('0xe')],function(_0x1dae37){return{'model':db[_0x1dae37['model']],'as':_0x1dae37['as'],'attributes':_0x1dae37[_0xd9af('0xc')],'include':_0x1dae37[_0xd9af('0xe')]?_[_0xd9af('0x10')](_0x1dae37[_0xd9af('0xe')],function(_0x24799b){return{'model':db[_0x24799b['model']],'as':_0x24799b['as'],'attributes':_0x24799b[_0xd9af('0xc')]};}):[]};}):[]};}):[]:[]})[_0xd9af('0x11')](function(_0x122249){logger[_0xd9af('0x12')](_0xd9af('0x6'),_0x5493f1);logger['debug'](_0xd9af('0x6'),_0x5493f1,JSON[_0xd9af('0x13')](_0x122249));_0x5a2f25(_0x122249);})[_0xd9af('0x14')](function(_0x57d210){logger['error']('GetInterval',_0x57d210[_0xd9af('0x15')],_0x5493f1);_0x4d5445(_0x19faa1[_0xd9af('0x16')](0x1f4,_0x57d210[_0xd9af('0x15')]));});});};exports[_0xd9af('0x17')]=function(_0x1c3199){var _0x178f24=this;return new Promise(function(_0x5113b0,_0xa17197){return db[_0xd9af('0x7')][_0xd9af('0x18')]({'raw':_0x1c3199['options']?_0x1c3199[_0xd9af('0x9')][_0xd9af('0xa')]===undefined?!![]:![]:!![],'where':_0x1c3199['options']?_0x1c3199[_0xd9af('0x9')][_0xd9af('0xb')]||null:null,'attributes':_0x1c3199[_0xd9af('0x9')]?_0x1c3199['options'][_0xd9af('0xc')]||null:null,'include':_0x1c3199['options']?_0x1c3199[_0xd9af('0x9')][_0xd9af('0xe')]?_['map'](_0x1c3199['options'][_0xd9af('0xe')],function(_0x15d875){return{'model':db[_0x15d875[_0xd9af('0xf')]],'as':_0x15d875['as'],'attributes':_0x15d875[_0xd9af('0xc')],'include':_0x15d875[_0xd9af('0xe')]?_['map'](_0x15d875[_0xd9af('0xe')],function(_0x10cb99){return{'model':db[_0x10cb99[_0xd9af('0xf')]],'as':_0x10cb99['as'],'attributes':_0x10cb99['attributes'],'include':_0x10cb99['include']?_[_0xd9af('0x10')](_0x10cb99[_0xd9af('0xe')],function(_0x6d3117){return{'model':db[_0x6d3117[_0xd9af('0xf')]],'as':_0x6d3117['as'],'attributes':_0x6d3117[_0xd9af('0xc')]};}):[]};}):[]};}):[]:[]})[_0xd9af('0x11')](function(_0x4e9022){logger[_0xd9af('0x12')](_0xd9af('0x17'),_0x1c3199);logger['debug'](_0xd9af('0x17'),_0x1c3199,JSON['stringify'](_0x4e9022));_0x5113b0(_0x4e9022);})['catch'](function(_0x4461b2){logger['error'](_0xd9af('0x17'),_0x4461b2['message'],_0x1c3199);_0xa17197(_0x178f24[_0xd9af('0x16')](0x1f4,_0x4461b2[_0xd9af('0x15')]));});});};function checkArrayOfIntervals(_0x247b1d,_0x4c7fc4){var _0x4d368f=[];return db[_0xd9af('0x7')]['findAll']({'where':{'id':_0x247b1d}})[_0xd9af('0x11')](function(_0x3abbee){_0x4d368f=_0x3abbee;return Promise['all'](_0x4d368f[_0xd9af('0x10')](function(_0x47966a){return _0x47966a[_0xd9af('0x19')](_0x4c7fc4);}));})[_0xd9af('0x11')](function(_0x3cd964){var _0x4f52fd=_0x3cd964[_0xd9af('0x1a')](function(_0xa190ac,_0x34b44d){return _0xa190ac||_0x34b44d;},![]);logger[_0xd9af('0x12')](util[_0xd9af('0x1b')](_0xd9af('0x1c'),_0x4d368f[_0xd9af('0x10')](function(_0x1b8526){return _0x1b8526['name'];})['join'](',\x20'),_0x4d368f[_0xd9af('0x10')](function(_0x4a6b00){return _0x4a6b00['id'];})[_0xd9af('0x1d')](',\x20')));return _0x4f52fd;});}function checkSingleInterval(_0x4d8c2d,_0x499270){return db[_0xd9af('0x7')][_0xd9af('0x1e')](_0x4d8c2d)[_0xd9af('0x11')](function(_0x5a359a){if(_0x5a359a){logger[_0xd9af('0x12')](util[_0xd9af('0x1b')](_0xd9af('0x1f'),_0x5a359a['name'],_0x5a359a['id']));return _0x5a359a[_0xd9af('0x19')](_0x499270);}});}exports[_0xd9af('0x20')]=function(_0x3c7c2e){var _0x2e9a69=_0x3c7c2e['intervalIds'];var _0x5cea41=Array[_0xd9af('0x21')](_0x3c7c2e[_0xd9af('0x22')])?_0x3c7c2e[_0xd9af('0x22')]:typeof _0x3c7c2e[_0xd9af('0x22')]===_0xd9af('0x23')?[_0x3c7c2e[_0xd9af('0x22')]]:[];var _0x5095aa=_0x3c7c2e[_0xd9af('0x24')]||undefined;var _0x387afb=![];if(_0x5cea41['length']){logger['info'](util[_0xd9af('0x1b')](_0xd9af('0x25'),_0x5cea41[_0xd9af('0x1d')](';\x20')));}if(_0x5095aa){logger['info'](util['format']('IntervalIftime:\x20timezone\x20=\x20%s',_0x5095aa));}logger[_0xd9af('0x26')](_0xd9af('0x27'),_0x387afb);logger[_0xd9af('0x28')](_0xd9af('0x20'),_0x3c7c2e);return Promise[_0xd9af('0x29')]()[_0xd9af('0x11')](function(){if(Array[_0xd9af('0x21')](_0x2e9a69)){return checkArrayOfIntervals(_0x2e9a69,_0x5095aa);}else if(_0x2e9a69){return checkSingleInterval(_0x2e9a69,_0x5095aa);}})[_0xd9af('0x11')](function(_0x4c67ae){var _0x12ab72=_0x5cea41['reduce'](function(_0xa37f8b,_0x11f6aa){return _0xa37f8b||iftime(_0x11f6aa,_0x5095aa);},![]);_0x387afb=_0x4c67ae||_0x12ab72;return _0x387afb;})[_0xd9af('0x14')](function(_0x28fbd6){logger['error'](_0xd9af('0x20'),_0x3c7c2e,_0x28fbd6);throw this['error'](0x1f4,_0x28fbd6['message']);});}; \ No newline at end of file +var _0x6bac=['reduce','util','../../utils/iftime','iftime','../../config/logger','GetInterval','Interval','options','raw','where','attributes','limit','include','map','model','then','info','debug','stringify','catch','error','message','find','ShowInterval','findAll','ifTime','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','join','findById','format','name','IntervalIftime','intervalIds','isArray','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','Iftime','silly','resolve'];(function(_0x21660c,_0x1e5526){var _0x4959f0=function(_0x3db959){while(--_0x3db959){_0x21660c['push'](_0x21660c['shift']());}};_0x4959f0(++_0x1e5526);}(_0x6bac,0x7f));var _0xc6ba=function(_0x364a3a,_0x5b4fe4){_0x364a3a=_0x364a3a-0x0;var _0x17fef8=_0x6bac[_0x364a3a];return _0x17fef8;};'use strict';var _=require('lodash');var util=require(_0xc6ba('0x0'));var db=require('../../mysqldb')['db'];var iftime=require(_0xc6ba('0x1'))[_0xc6ba('0x2')];var logger=require(_0xc6ba('0x3'))('rpc');exports[_0xc6ba('0x4')]=function(_0xc985f9){var _0x5d0c7e=this;return new Promise(function(_0x3a78af,_0x260ede){return db[_0xc6ba('0x5')]['findAll']({'raw':_0xc985f9[_0xc6ba('0x6')]?_0xc985f9[_0xc6ba('0x6')][_0xc6ba('0x7')]===undefined?!![]:![]:!![],'where':_0xc985f9[_0xc6ba('0x6')]?_0xc985f9[_0xc6ba('0x6')][_0xc6ba('0x8')]||null:null,'attributes':_0xc985f9[_0xc6ba('0x6')]?_0xc985f9[_0xc6ba('0x6')][_0xc6ba('0x9')]||null:null,'limit':_0xc985f9['options']?_0xc985f9[_0xc6ba('0x6')][_0xc6ba('0xa')]||null:null,'include':_0xc985f9['options']?_0xc985f9[_0xc6ba('0x6')][_0xc6ba('0xb')]?_[_0xc6ba('0xc')](_0xc985f9['options'][_0xc6ba('0xb')],function(_0x387eec){return{'model':db[_0x387eec['model']],'as':_0x387eec['as'],'attributes':_0x387eec[_0xc6ba('0x9')],'include':_0x387eec[_0xc6ba('0xb')]?_['map'](_0x387eec[_0xc6ba('0xb')],function(_0x3190bc){return{'model':db[_0x3190bc[_0xc6ba('0xd')]],'as':_0x3190bc['as'],'attributes':_0x3190bc[_0xc6ba('0x9')],'include':_0x3190bc[_0xc6ba('0xb')]?_[_0xc6ba('0xc')](_0x3190bc[_0xc6ba('0xb')],function(_0x4f23a7){return{'model':db[_0x4f23a7[_0xc6ba('0xd')]],'as':_0x4f23a7['as'],'attributes':_0x4f23a7['attributes']};}):[]};}):[]};}):[]:[]})[_0xc6ba('0xe')](function(_0x12f9df){logger[_0xc6ba('0xf')](_0xc6ba('0x4'),_0xc985f9);logger[_0xc6ba('0x10')](_0xc6ba('0x4'),_0xc985f9,JSON[_0xc6ba('0x11')](_0x12f9df));_0x3a78af(_0x12f9df);})[_0xc6ba('0x12')](function(_0x5b3590){logger[_0xc6ba('0x13')](_0xc6ba('0x4'),_0x5b3590['message'],_0xc985f9);_0x260ede(_0x5d0c7e[_0xc6ba('0x13')](0x1f4,_0x5b3590[_0xc6ba('0x14')]));});});};exports['ShowInterval']=function(_0x34c8b3){var _0x49148b=this;return new Promise(function(_0x1a98d5,_0x352641){return db['Interval'][_0xc6ba('0x15')]({'raw':_0x34c8b3[_0xc6ba('0x6')]?_0x34c8b3[_0xc6ba('0x6')][_0xc6ba('0x7')]===undefined?!![]:![]:!![],'where':_0x34c8b3['options']?_0x34c8b3[_0xc6ba('0x6')][_0xc6ba('0x8')]||null:null,'attributes':_0x34c8b3[_0xc6ba('0x6')]?_0x34c8b3[_0xc6ba('0x6')][_0xc6ba('0x9')]||null:null,'include':_0x34c8b3[_0xc6ba('0x6')]?_0x34c8b3[_0xc6ba('0x6')][_0xc6ba('0xb')]?_[_0xc6ba('0xc')](_0x34c8b3['options'][_0xc6ba('0xb')],function(_0x5ef128){return{'model':db[_0x5ef128['model']],'as':_0x5ef128['as'],'attributes':_0x5ef128['attributes'],'include':_0x5ef128['include']?_[_0xc6ba('0xc')](_0x5ef128['include'],function(_0x5ab2f6){return{'model':db[_0x5ab2f6[_0xc6ba('0xd')]],'as':_0x5ab2f6['as'],'attributes':_0x5ab2f6['attributes'],'include':_0x5ab2f6['include']?_[_0xc6ba('0xc')](_0x5ab2f6[_0xc6ba('0xb')],function(_0xd1e7fa){return{'model':db[_0xd1e7fa[_0xc6ba('0xd')]],'as':_0xd1e7fa['as'],'attributes':_0xd1e7fa[_0xc6ba('0x9')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4aa58e){logger['info'](_0xc6ba('0x16'),_0x34c8b3);logger[_0xc6ba('0x10')](_0xc6ba('0x16'),_0x34c8b3,JSON['stringify'](_0x4aa58e));_0x1a98d5(_0x4aa58e);})[_0xc6ba('0x12')](function(_0x43ded8){logger['error'](_0xc6ba('0x16'),_0x43ded8[_0xc6ba('0x14')],_0x34c8b3);_0x352641(_0x49148b[_0xc6ba('0x13')](0x1f4,_0x43ded8[_0xc6ba('0x14')]));});});};function checkArrayOfIntervals(_0x18c56b,_0x495886){var _0x5f3184=[];return db['Interval'][_0xc6ba('0x17')]({'where':{'id':_0x18c56b}})[_0xc6ba('0xe')](function(_0x4e0557){_0x5f3184=_0x4e0557;return Promise['all'](_0x5f3184[_0xc6ba('0xc')](function(_0x484a8a){return _0x484a8a[_0xc6ba('0x18')](_0x495886);}));})[_0xc6ba('0xe')](function(_0x1cd885){var _0xec6eef=_0x1cd885['reduce'](function(_0x4e135a,_0x460b80){return _0x4e135a||_0x460b80;},![]);logger[_0xc6ba('0xf')](util['format'](_0xc6ba('0x19'),_0x5f3184[_0xc6ba('0xc')](function(_0x519a6a){return _0x519a6a['name'];})['join'](',\x20'),_0x5f3184[_0xc6ba('0xc')](function(_0x2e8ec1){return _0x2e8ec1['id'];})[_0xc6ba('0x1a')](',\x20')));return _0xec6eef;});}function checkSingleInterval(_0x308b8e,_0x273ea6){return db[_0xc6ba('0x5')][_0xc6ba('0x1b')](_0x308b8e)['then'](function(_0xe43962){if(_0xe43962){logger[_0xc6ba('0xf')](util[_0xc6ba('0x1c')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0xe43962[_0xc6ba('0x1d')],_0xe43962['id']));return _0xe43962[_0xc6ba('0x18')](_0x273ea6);}});}exports[_0xc6ba('0x1e')]=function(_0x112a22){var _0x1df5b7=_0x112a22[_0xc6ba('0x1f')];var _0xc5bdaf=Array[_0xc6ba('0x20')](_0x112a22['intervals'])?_0x112a22['intervals']:typeof _0x112a22[_0xc6ba('0x21')]===_0xc6ba('0x22')?[_0x112a22[_0xc6ba('0x21')]]:[];var _0x53b471=_0x112a22[_0xc6ba('0x23')]||undefined;var _0x3f5b5e=![];if(_0xc5bdaf[_0xc6ba('0x24')]){logger[_0xc6ba('0xf')](util['format'](_0xc6ba('0x25'),_0xc5bdaf[_0xc6ba('0x1a')](';\x20')));}if(_0x53b471){logger[_0xc6ba('0xf')](util[_0xc6ba('0x1c')]('IntervalIftime:\x20timezone\x20=\x20%s',_0x53b471));}logger[_0xc6ba('0x10')](_0xc6ba('0x26'),_0x3f5b5e);logger[_0xc6ba('0x27')](_0xc6ba('0x1e'),_0x112a22);return Promise[_0xc6ba('0x28')]()['then'](function(){if(Array[_0xc6ba('0x20')](_0x1df5b7)){return checkArrayOfIntervals(_0x1df5b7,_0x53b471);}else if(_0x1df5b7){return checkSingleInterval(_0x1df5b7,_0x53b471);}})['then'](function(_0x1f51ea){var _0x3712c0=_0xc5bdaf[_0xc6ba('0x29')](function(_0x20a74e,_0x421407){return _0x20a74e||iftime(_0x421407,_0x53b471);},![]);_0x3f5b5e=_0x1f51ea||_0x3712c0;return _0x3f5b5e;})[_0xc6ba('0x12')](function(_0x402a87){logger['error']('IntervalIftime',_0x112a22,_0x402a87);throw this[_0xc6ba('0x13')](0x1f4,_0x402a87[_0xc6ba('0x14')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index b0b6599..429d021 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 _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x59172e,_0x382e07){var _0x4c4e5d=function(_0x50ce00){while(--_0x50ce00){_0x59172e['push'](_0x59172e['shift']());}};_0x4c4e5d(++_0x382e07);}(_0x2ef3,0xba));var _0x32ef=function(_0x2b6e91,_0x41a178){_0x2b6e91=_0x2b6e91-0x0;var _0x5779f4=_0x2ef3[_0x2b6e91];return _0x5779f4;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file +var _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5302fb,_0x1a2db3){_0x5302fb=_0x5302fb-0x0;var _0x43e6a4=_0x0b0e[_0x5302fb];return _0x43e6a4;};'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 diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 5528c37..30c9e62 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 _0x40e2=['name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','toString','base64','request','setEncoding','utf8','data','statusCode','parse','error','status','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','send','x-forwarded-for','connection','remoteAddress','socket','https','api','support','MOTGUI','Report','description','stringify','issuetype','Bug','fields','customfield_11500','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503'];(function(_0x375492,_0x4ed149){var _0x18ba5b=function(_0x154a12){while(--_0x154a12){_0x375492['push'](_0x375492['shift']());}};_0x18ba5b(++_0x4ed149);}(_0x40e2,0xc7));var _0x240e=function(_0x380202,_0x4b0cf6){_0x380202=_0x380202-0x0;var _0x57d37d=_0x40e2[_0x380202];return _0x57d37d;};'use strict';var BPromise=require('bluebird');var https=require(_0x240e('0x0'));var logger=require('../../config/logger')(_0x240e('0x1'));var USERNAME=_0x240e('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x233607,_0x42bb62){var _0x47ee76={'fields':{'project':{'key':_0x233607['key']||_0x240e('0x3')},'summary':(_0x233607['summary']||_0x240e('0x4'))+'\x20from\x20'+_0x233607['ip'],'description':_0x233607[_0x240e('0x5')]||JSON[_0x240e('0x6')](_0x233607),'issuetype':{'name':_0x233607[_0x240e('0x7')]||_0x240e('0x8')}}};_0x47ee76[_0x240e('0x9')][_0x240e('0xa')]=_0x233607['email'];_0x47ee76[_0x240e('0x9')][_0x240e('0xb')]=_0x233607[_0x240e('0xc')];_0x47ee76[_0x240e('0x9')][_0x240e('0xd')]=_0x233607[_0x240e('0xe')];_0x47ee76[_0x240e('0x9')][_0x240e('0xf')]=_0x233607[_0x240e('0x10')];_0x47ee76[_0x240e('0x9')]['customfield_11504']=_0x233607[_0x240e('0x11')];_0x47ee76[_0x240e('0x9')][_0x240e('0x12')]=_0x233607['ip'];var _0x20c49a={'host':_0x240e('0x13'),'port':0x1bb,'path':_0x240e('0x14'),'method':_0x240e('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x240e('0x16'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x240e('0x17')](_0x240e('0x18'))}};var _0x221c8c=JSON[_0x240e('0x6')](_0x47ee76);var _0x1b7c80=https[_0x240e('0x19')](_0x20c49a,function(_0x42200b){_0x42200b[_0x240e('0x1a')](_0x240e('0x1b'));var _0x53cc7b='';_0x42200b['on'](_0x240e('0x1c'),function(_0x3f71e8){_0x53cc7b+=_0x3f71e8;});_0x42200b['on']('end',function(){if(_0x42bb62){return _0x42bb62['status'](_0x42200b[_0x240e('0x1d')])['json'](JSON[_0x240e('0x1e')](_0x53cc7b));}});});_0x1b7c80['on'](_0x240e('0x1f'),function(_0x9a8c06){if(_0x42bb62){return _0x42bb62[_0x240e('0x20')](0x1f4)[_0x240e('0x21')]({'errors':[{'message':_0x240e('0x22'),'type':_0x240e('0x23')}]});}});_0x1b7c80[_0x240e('0x24')](_0x221c8c);_0x1b7c80[_0x240e('0x25')]();}exports['openIssue']=openIssue;exports[_0x240e('0x26')]=function(_0x30176e,_0x477f52){_0x30176e['body']['ip']=_0x30176e['headers'][_0x240e('0x27')]||_0x30176e[_0x240e('0x28')][_0x240e('0x29')]||_0x30176e[_0x240e('0x2a')][_0x240e('0x29')]||_0x30176e[_0x240e('0x28')]['socket'][_0x240e('0x29')];return openIssue(_0x30176e['body'],_0x477f52);}; \ No newline at end of file +var _0xa893=['remoteAddress','bluebird','../../config/logger','support','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','description','issuetype','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','base64','stringify','request','setEncoding','data','end','status','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','body','headers','connection','socket'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa893,0xdd));var _0x3a89=function(_0x3d5963,_0x5a3ebf){_0x3d5963=_0x3d5963-0x0;var _0x22726b=_0xa893[_0x3d5963];return _0x22726b;};'use strict';var BPromise=require(_0x3a89('0x0'));var https=require('https');var logger=require(_0x3a89('0x1'))('api');var USERNAME=_0x3a89('0x2');var PASSWORD=_0x3a89('0x3');function openIssue(_0x5275dc,_0x5002bd){var _0x58f8d8={'fields':{'project':{'key':_0x5275dc[_0x3a89('0x4')]||_0x3a89('0x5')},'summary':(_0x5275dc['summary']||_0x3a89('0x6'))+_0x3a89('0x7')+_0x5275dc['ip'],'description':_0x5275dc[_0x3a89('0x8')]||JSON['stringify'](_0x5275dc),'issuetype':{'name':_0x5275dc[_0x3a89('0x9')]||'Bug'}}};_0x58f8d8[_0x3a89('0xa')][_0x3a89('0xb')]=_0x5275dc[_0x3a89('0xc')];_0x58f8d8[_0x3a89('0xa')][_0x3a89('0xd')]=_0x5275dc[_0x3a89('0xe')];_0x58f8d8[_0x3a89('0xa')][_0x3a89('0xf')]=_0x5275dc[_0x3a89('0x10')];_0x58f8d8[_0x3a89('0xa')][_0x3a89('0x11')]=_0x5275dc[_0x3a89('0x12')];_0x58f8d8[_0x3a89('0xa')][_0x3a89('0x13')]=_0x5275dc[_0x3a89('0x14')];_0x58f8d8[_0x3a89('0xa')][_0x3a89('0x15')]=_0x5275dc['ip'];var _0x19bbf8={'host':_0x3a89('0x16'),'port':0x1bb,'path':_0x3a89('0x17'),'method':_0x3a89('0x18'),'timeout':0x4e20,'headers':{'Content-Type':_0x3a89('0x19'),'Authorization':_0x3a89('0x1a')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x3a89('0x1b'))}};var _0x524878=JSON[_0x3a89('0x1c')](_0x58f8d8);var _0x4f7019=https[_0x3a89('0x1d')](_0x19bbf8,function(_0x32a677){_0x32a677[_0x3a89('0x1e')]('utf8');var _0x30e7a4='';_0x32a677['on'](_0x3a89('0x1f'),function(_0x1df99e){_0x30e7a4+=_0x1df99e;});_0x32a677['on'](_0x3a89('0x20'),function(){if(_0x5002bd){return _0x5002bd[_0x3a89('0x21')](_0x32a677['statusCode'])['json'](JSON[_0x3a89('0x22')](_0x30e7a4));}});});_0x4f7019['on'](_0x3a89('0x23'),function(_0x3d5ad4){if(_0x5002bd){return _0x5002bd[_0x3a89('0x21')](0x1f4)['json']({'errors':[{'message':_0x3a89('0x24'),'type':_0x3a89('0x25')}]});}});_0x4f7019[_0x3a89('0x26')](_0x524878);_0x4f7019[_0x3a89('0x20')]();}exports['openIssue']=openIssue;exports['send']=function(_0x218b8e,_0x1cae93){_0x218b8e[_0x3a89('0x27')]['ip']=_0x218b8e[_0x3a89('0x28')]['x-forwarded-for']||_0x218b8e[_0x3a89('0x29')]['remoteAddress']||_0x218b8e[_0x3a89('0x2a')][_0x3a89('0x2b')]||_0x218b8e[_0x3a89('0x29')]['socket']['remoteAddress'];return openIssue(_0x218b8e[_0x3a89('0x27')],_0x1cae93);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 5a9758d..2d8a30b 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 _0xa8a8=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x461a5b,_0xe01763){var _0x39c376=function(_0x4229f1){while(--_0x4229f1){_0x461a5b['push'](_0x461a5b['shift']());}};_0x39c376(++_0xe01763);}(_0xa8a8,0xec));var _0x8a8a=function(_0x254404,_0x4c3db4){_0x254404=_0x254404-0x0;var _0x33d2bf=_0xa8a8[_0x254404];return _0x33d2bf;};'use strict';var multer=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var path=require(_0x8a8a('0x2'));var timeout=require(_0x8a8a('0x3'));var express=require('express');var router=express[_0x8a8a('0x4')]();var fs_extra=require(_0x8a8a('0x5'));var auth=require(_0x8a8a('0x6'));var interaction=require(_0x8a8a('0x7'));var config=require(_0x8a8a('0x8'));var controller=require(_0x8a8a('0x9'));router[_0x8a8a('0xa')]('/',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0xc')]);router[_0x8a8a('0xa')](_0x8a8a('0xd'),auth[_0x8a8a('0xb')](),controller[_0x8a8a('0xe')]);router[_0x8a8a('0xa')](_0x8a8a('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x8a8a('0x10')]('/',auth['isAuthenticated'](),controller[_0x8a8a('0x11')]);router[_0x8a8a('0x12')]('/:id',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0x13')]);router[_0x8a8a('0x14')]('/:id',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0x15')]);module[_0x8a8a('0x16')]=router; \ No newline at end of file +var _0xbdb7=['fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','index','get','describe','show','post','isAuthenticated','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4a152a,_0x300e21){var _0x3aaf5a=function(_0x27238b){while(--_0x27238b){_0x4a152a['push'](_0x4a152a['shift']());}};_0x3aaf5a(++_0x300e21);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x5208fa,_0x2e0115){_0x5208fa=_0x5208fa-0x0;var _0x340255=_0xbdb7[_0x5208fa];return _0x340255;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var fs_extra=require(_0x7bdb('0x6'));var auth=require(_0x7bdb('0x7'));var interaction=require(_0x7bdb('0x8'));var config=require('../../config/environment');var controller=require(_0x7bdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xd')]);router[_0x7bdb('0xe')]('/',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x10')]);router[_0x7bdb('0x11')](_0x7bdb('0x12'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0x14')]);module[_0x7bdb('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 9734fec..9612dc7 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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7a54,0x106));var _0x47a5=function(_0x5a27a0,_0x58b6c5){_0x5a27a0=_0x5a27a0-0x0;var _0x2e642f=_0x7a54[_0x5a27a0];return _0x2e642f;};'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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7a54,0x106));var _0x47a5=function(_0x452fb0,_0x426c0e){_0x452fb0=_0x452fb0-0x0;var _0x361f0d=_0x7a54[_0x452fb0];return _0x361f0d;};'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 5514c10..fdca220 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 _0xf52f=['offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','nolimit','order','pick','filter','where','merge','VIRTUAL','options','JscriptyAnswerReport','includeAll','include','findAll','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0xf52f,0x113));var _0xff52=function(_0x2a31b9,_0x4a634d){_0x2a31b9=_0x2a31b9-0x0;var _0x5cda05=_0xf52f[_0x2a31b9];return _0x5cda05;};'use strict';var emlformat=require(_0xff52('0x0'));var rimraf=require(_0xff52('0x1'));var zipdir=require(_0xff52('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xff52('0x3'));var moment=require(_0xff52('0x4'));var BPromise=require(_0xff52('0x5'));var Mustache=require('mustache');var util=require(_0xff52('0x6'));var path=require(_0xff52('0x7'));var sox=require('sox');var csv=require(_0xff52('0x8'));var ejs=require(_0xff52('0x9'));var fs=require('fs');var fs_extra=require(_0xff52('0xa'));var _=require(_0xff52('0xb'));var squel=require(_0xff52('0xc'));var crypto=require(_0xff52('0xd'));var jsforce=require(_0xff52('0xe'));var deskjs=require(_0xff52('0xf'));var toCsv=require(_0xff52('0x8'));var querystring=require(_0xff52('0x10'));var Papa=require(_0xff52('0x11'));var Redis=require(_0xff52('0x12'));var authService=require(_0xff52('0x13'));var qs=require(_0xff52('0x14'));var as=require(_0xff52('0x15'));var hardwareService=require(_0xff52('0x16'));var logger=require(_0xff52('0x17'))(_0xff52('0x18'));var utils=require(_0xff52('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xff52('0x1a'))['db'];function respondWithStatusCode(_0x53f40b,_0x2cd3ca){_0x2cd3ca=_0x2cd3ca||0xcc;return function(_0x1c0f10){if(_0x1c0f10){return _0x53f40b[_0xff52('0x1b')](_0x2cd3ca);}return _0x53f40b[_0xff52('0x1c')](_0x2cd3ca)['end']();};}function respondWithResult(_0x54eccf,_0x5bc4dd){_0x5bc4dd=_0x5bc4dd||0xc8;return function(_0x32f7e5){if(_0x32f7e5){return _0x54eccf['status'](_0x5bc4dd)['json'](_0x32f7e5);}};}function respondWithFilteredResult(_0x219294,_0x1e1818){return function(_0x3fc985){if(_0x3fc985){var _0x440701=typeof _0x1e1818[_0xff52('0x1d')]==='undefined'&&typeof _0x1e1818[_0xff52('0x1e')]==='undefined';var _0xc8d493=_0x3fc985['count'];var _0x568cad=_0x440701?0x0:_0x1e1818[_0xff52('0x1d')];var _0x28601f=_0x440701?_0x3fc985[_0xff52('0x1f')]:_0x1e1818['offset']+_0x1e1818['limit'];var _0x163326;if(_0x28601f>=_0xc8d493){_0x28601f=_0xc8d493;_0x163326=0xc8;}else{_0x163326=0xce;}_0x219294[_0xff52('0x1c')](_0x163326);return _0x219294[_0xff52('0x20')](_0xff52('0x21'),_0x568cad+'-'+_0x28601f+'/'+_0xc8d493)['json'](_0x3fc985);}return null;};}function patchUpdates(_0x147db2){return function(_0x45fe57){try{jsonpatch[_0xff52('0x22')](_0x45fe57,_0x147db2,!![]);}catch(_0x434a9f){return BPromise[_0xff52('0x23')](_0x434a9f);}return _0x45fe57[_0xff52('0x24')]();};}function saveUpdates(_0x78d437,_0x176c10){return function(_0x5eb3f9){if(_0x5eb3f9){return _0x5eb3f9[_0xff52('0x25')](_0x78d437)[_0xff52('0x26')](function(_0x517eb4){return _0x517eb4;});}return null;};}function removeEntity(_0x313ee0,_0x3cf849){return function(_0x4b8157){if(_0x4b8157){return _0x4b8157[_0xff52('0x27')]()['then'](function(){_0x313ee0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x363857,_0x234516){return function(_0x16b121){if(!_0x16b121){_0x363857[_0xff52('0x1b')](0x194);}return _0x16b121;};}function handleError(_0x18a08e,_0x1fe1cc){_0x1fe1cc=_0x1fe1cc||0x1f4;return function(_0x25225b){logger[_0xff52('0x28')](_0x25225b[_0xff52('0x29')]);if(_0x25225b[_0xff52('0x2a')]){delete _0x25225b['name'];}_0x18a08e[_0xff52('0x1c')](_0x1fe1cc)[_0xff52('0x2b')](_0x25225b);};}exports['index']=function(_0x2822c0,_0x32df90){var _0x208753={},_0x1cb50f={},_0x30fd72={'count':0x0,'rows':[]};var _0x51d708=_[_0xff52('0x2c')](db['JscriptyAnswerReport'][_0xff52('0x2d')],function(_0x35aaf7){return{'name':_0x35aaf7[_0xff52('0x2e')],'type':_0x35aaf7[_0xff52('0x2f')][_0xff52('0x30')]};});_0x1cb50f['model']=_['map'](_0x51d708,_0xff52('0x2a'));_0x1cb50f[_0xff52('0x31')]=_[_0xff52('0x32')](_0x2822c0['query']);_0x1cb50f[_0xff52('0x33')]=_['intersection'](_0x1cb50f[_0xff52('0x34')],_0x1cb50f[_0xff52('0x31')]);_0x208753['attributes']=_[_0xff52('0x35')](_0x1cb50f[_0xff52('0x34')],qs[_0xff52('0x36')](_0x2822c0[_0xff52('0x31')][_0xff52('0x36')]));_0x208753[_0xff52('0x37')]=_0x208753[_0xff52('0x37')][_0xff52('0x38')]?_0x208753[_0xff52('0x37')]:_0x1cb50f[_0xff52('0x34')];if(!_0x2822c0[_0xff52('0x31')]['hasOwnProperty'](_0xff52('0x39'))){_0x208753[_0xff52('0x1e')]=qs['limit'](_0x2822c0[_0xff52('0x31')][_0xff52('0x1e')]);_0x208753[_0xff52('0x1d')]=qs[_0xff52('0x1d')](_0x2822c0[_0xff52('0x31')][_0xff52('0x1d')]);}_0x208753[_0xff52('0x3a')]=qs['sort'](_0x2822c0[_0xff52('0x31')]['sort']);_0x208753['where']=qs[_0xff52('0x33')](_[_0xff52('0x3b')](_0x2822c0['query'],_0x1cb50f[_0xff52('0x33')]),_0x51d708);if(_0x2822c0[_0xff52('0x31')][_0xff52('0x3c')]){_0x208753[_0xff52('0x3d')]=_[_0xff52('0x3e')](_0x208753[_0xff52('0x3d')],{'$or':_[_0xff52('0x2c')](_0x51d708,function(_0xcb2a24){if(_0xcb2a24[_0xff52('0x2f')]!==_0xff52('0x3f')){var _0x5c48fa={};_0x5c48fa[_0xcb2a24[_0xff52('0x2a')]]={'$like':'%'+_0x2822c0[_0xff52('0x31')][_0xff52('0x3c')]+'%'};return _0x5c48fa;}})});}_0x208753=_[_0xff52('0x3e')]({},_0x208753,_0x2822c0[_0xff52('0x40')]);var _0x388613={'where':_0x208753[_0xff52('0x3d')]};return db[_0xff52('0x41')]['count'](_0x388613)[_0xff52('0x26')](function(_0x5937da){_0x30fd72[_0xff52('0x1f')]=_0x5937da;if(_0x2822c0['query'][_0xff52('0x42')]){_0x208753[_0xff52('0x43')]=[{'all':!![]}];}return db[_0xff52('0x41')][_0xff52('0x44')](_0x208753);})[_0xff52('0x26')](function(_0x1d3fc8){_0x30fd72['rows']=_0x1d3fc8;return _0x30fd72;})[_0xff52('0x26')](respondWithFilteredResult(_0x32df90,_0x208753))[_0xff52('0x45')](handleError(_0x32df90,null));};exports[_0xff52('0x46')]=function(_0x194e32,_0x16c2e4){var _0x56f535={'raw':!![],'where':{'id':_0x194e32['params']['id']}},_0x236d4f={};_0x236d4f[_0xff52('0x34')]=_[_0xff52('0x32')](db[_0xff52('0x41')][_0xff52('0x2d')]);_0x236d4f['query']=_[_0xff52('0x32')](_0x194e32[_0xff52('0x31')]);_0x236d4f[_0xff52('0x33')]=_[_0xff52('0x35')](_0x236d4f[_0xff52('0x34')],_0x236d4f[_0xff52('0x31')]);_0x56f535[_0xff52('0x37')]=_[_0xff52('0x35')](_0x236d4f[_0xff52('0x34')],qs[_0xff52('0x36')](_0x194e32[_0xff52('0x31')]['fields']));_0x56f535[_0xff52('0x37')]=_0x56f535[_0xff52('0x37')][_0xff52('0x38')]?_0x56f535['attributes']:_0x236d4f[_0xff52('0x34')];if(_0x194e32[_0xff52('0x31')][_0xff52('0x42')]){_0x56f535[_0xff52('0x43')]=[{'all':!![]}];}_0x56f535=_[_0xff52('0x3e')]({},_0x56f535,_0x194e32['options']);return db['JscriptyAnswerReport'][_0xff52('0x47')](_0x56f535)[_0xff52('0x26')](handleEntityNotFound(_0x16c2e4,null))[_0xff52('0x26')](respondWithResult(_0x16c2e4,null))['catch'](handleError(_0x16c2e4,null));};exports[_0xff52('0x48')]=function(_0x3dfb1a,_0x397a60){return db[_0xff52('0x41')][_0xff52('0x48')](_0x3dfb1a[_0xff52('0x49')],{})['then'](respondWithResult(_0x397a60,0xc9))[_0xff52('0x45')](handleError(_0x397a60,null));};exports[_0xff52('0x25')]=function(_0x314ed0,_0x2874f1){if(_0x314ed0['body']['id']){delete _0x314ed0[_0xff52('0x49')]['id'];}return db[_0xff52('0x41')][_0xff52('0x47')]({'where':{'id':_0x314ed0[_0xff52('0x4a')]['id']}})[_0xff52('0x26')](handleEntityNotFound(_0x2874f1,null))[_0xff52('0x26')](saveUpdates(_0x314ed0[_0xff52('0x49')],null))[_0xff52('0x26')](respondWithResult(_0x2874f1,null))[_0xff52('0x45')](handleError(_0x2874f1,null));};exports[_0xff52('0x27')]=function(_0x208b92,_0x12b43d){return db['JscriptyAnswerReport'][_0xff52('0x47')]({'where':{'id':_0x208b92[_0xff52('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12b43d,null))[_0xff52('0x26')](removeEntity(_0x12b43d,null))[_0xff52('0x45')](handleError(_0x12b43d,null));};exports[_0xff52('0x4b')]=function(_0x11001a,_0x45c3fb){return db[_0xff52('0x41')][_0xff52('0x4b')]()['then'](respondWithResult(_0x45c3fb,null))[_0xff52('0x45')](handleError(_0x45c3fb,null));}; \ No newline at end of file +var _0x815b=['length','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','JscriptyAnswerReport','findAll','rows','show','rawAttributes','intersection','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','fieldName','key','model','map','keys','query','attributes','fields'];(function(_0x56357c,_0x3aa63a){var _0x423f55=function(_0x460877){while(--_0x460877){_0x56357c['push'](_0x56357c['shift']());}};_0x423f55(++_0x3aa63a);}(_0x815b,0xb4));var _0xb815=function(_0x86f275,_0x5ec44){_0x86f275=_0x86f275-0x0;var _0x2527ab=_0x815b[_0x86f275];return _0x2527ab;};'use strict';var emlformat=require(_0xb815('0x0'));var rimraf=require(_0xb815('0x1'));var zipdir=require(_0xb815('0x2'));var jsonpatch=require(_0xb815('0x3'));var rp=require(_0xb815('0x4'));var moment=require('moment');var BPromise=require(_0xb815('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb815('0x6'));var sox=require(_0xb815('0x7'));var csv=require(_0xb815('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb815('0x9'));var _=require(_0xb815('0xa'));var squel=require('squel');var crypto=require(_0xb815('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb815('0x8'));var querystring=require(_0xb815('0xc'));var Papa=require(_0xb815('0xd'));var Redis=require(_0xb815('0xe'));var authService=require(_0xb815('0xf'));var qs=require(_0xb815('0x10'));var as=require(_0xb815('0x11'));var hardwareService=require(_0xb815('0x12'));var logger=require('../../config/logger')(_0xb815('0x13'));var utils=require(_0xb815('0x14'));var config=require(_0xb815('0x15'));var licenseUtil=require(_0xb815('0x16'));var db=require(_0xb815('0x17'))['db'];function respondWithStatusCode(_0x3ce2fb,_0x3e5c50){_0x3e5c50=_0x3e5c50||0xcc;return function(_0x5af22a){if(_0x5af22a){return _0x3ce2fb['sendStatus'](_0x3e5c50);}return _0x3ce2fb[_0xb815('0x18')](_0x3e5c50)[_0xb815('0x19')]();};}function respondWithResult(_0x13a09e,_0xff2720){_0xff2720=_0xff2720||0xc8;return function(_0x32b50a){if(_0x32b50a){return _0x13a09e[_0xb815('0x18')](_0xff2720)[_0xb815('0x1a')](_0x32b50a);}};}function respondWithFilteredResult(_0x4636c7,_0x966544){return function(_0xf456ca){if(_0xf456ca){var _0x3fd87d=typeof _0x966544[_0xb815('0x1b')]===_0xb815('0x1c')&&typeof _0x966544['limit']==='undefined';var _0x41445e=_0xf456ca[_0xb815('0x1d')];var _0x3f56ab=_0x3fd87d?0x0:_0x966544[_0xb815('0x1b')];var _0x324452=_0x3fd87d?_0xf456ca[_0xb815('0x1d')]:_0x966544[_0xb815('0x1b')]+_0x966544[_0xb815('0x1e')];var _0x839f08;if(_0x324452>=_0x41445e){_0x324452=_0x41445e;_0x839f08=0xc8;}else{_0x839f08=0xce;}_0x4636c7['status'](_0x839f08);return _0x4636c7['set'](_0xb815('0x1f'),_0x3f56ab+'-'+_0x324452+'/'+_0x41445e)['json'](_0xf456ca);}return null;};}function patchUpdates(_0x261b8d){return function(_0x1ebe78){try{jsonpatch[_0xb815('0x20')](_0x1ebe78,_0x261b8d,!![]);}catch(_0x3d7291){return BPromise['reject'](_0x3d7291);}return _0x1ebe78[_0xb815('0x21')]();};}function saveUpdates(_0x3c787e,_0x590eff){return function(_0x3f0f44){if(_0x3f0f44){return _0x3f0f44[_0xb815('0x22')](_0x3c787e)[_0xb815('0x23')](function(_0x37cf47){return _0x37cf47;});}return null;};}function removeEntity(_0x2ecffe,_0x19877b){return function(_0x100113){if(_0x100113){return _0x100113[_0xb815('0x24')]()[_0xb815('0x23')](function(){_0x2ecffe[_0xb815('0x18')](0xcc)[_0xb815('0x19')]();});}};}function handleEntityNotFound(_0x1a460c,_0x55b714){return function(_0x1a07cc){if(!_0x1a07cc){_0x1a460c[_0xb815('0x25')](0x194);}return _0x1a07cc;};}function handleError(_0x350448,_0x33211e){_0x33211e=_0x33211e||0x1f4;return function(_0x5f2eaf){logger[_0xb815('0x26')](_0x5f2eaf[_0xb815('0x27')]);if(_0x5f2eaf[_0xb815('0x28')]){delete _0x5f2eaf['name'];}_0x350448[_0xb815('0x18')](_0x33211e)[_0xb815('0x29')](_0x5f2eaf);};}exports[_0xb815('0x2a')]=function(_0x26bef8,_0x2e9199){var _0x3b0152={},_0x7e8a20={},_0xd22488={'count':0x0,'rows':[]};var _0x46c545=_['map'](db['JscriptyAnswerReport']['rawAttributes'],function(_0x45b5e5){return{'name':_0x45b5e5[_0xb815('0x2b')],'type':_0x45b5e5['type'][_0xb815('0x2c')]};});_0x7e8a20[_0xb815('0x2d')]=_[_0xb815('0x2e')](_0x46c545,_0xb815('0x28'));_0x7e8a20['query']=_[_0xb815('0x2f')](_0x26bef8[_0xb815('0x30')]);_0x7e8a20['filters']=_['intersection'](_0x7e8a20[_0xb815('0x2d')],_0x7e8a20['query']);_0x3b0152[_0xb815('0x31')]=_['intersection'](_0x7e8a20[_0xb815('0x2d')],qs['fields'](_0x26bef8[_0xb815('0x30')][_0xb815('0x32')]));_0x3b0152[_0xb815('0x31')]=_0x3b0152['attributes'][_0xb815('0x33')]?_0x3b0152[_0xb815('0x31')]:_0x7e8a20['model'];if(!_0x26bef8[_0xb815('0x30')][_0xb815('0x34')](_0xb815('0x35'))){_0x3b0152[_0xb815('0x1e')]=qs[_0xb815('0x1e')](_0x26bef8[_0xb815('0x30')]['limit']);_0x3b0152[_0xb815('0x1b')]=qs[_0xb815('0x1b')](_0x26bef8[_0xb815('0x30')][_0xb815('0x1b')]);}_0x3b0152[_0xb815('0x36')]=qs['sort'](_0x26bef8['query']['sort']);_0x3b0152[_0xb815('0x37')]=qs['filters'](_[_0xb815('0x38')](_0x26bef8[_0xb815('0x30')],_0x7e8a20[_0xb815('0x39')]),_0x46c545);if(_0x26bef8[_0xb815('0x30')][_0xb815('0x3a')]){_0x3b0152[_0xb815('0x37')]=_[_0xb815('0x3b')](_0x3b0152[_0xb815('0x37')],{'$or':_[_0xb815('0x2e')](_0x46c545,function(_0x26cfe3){if(_0x26cfe3[_0xb815('0x3c')]!==_0xb815('0x3d')){var _0x1dcdb3={};_0x1dcdb3[_0x26cfe3[_0xb815('0x28')]]={'$like':'%'+_0x26bef8[_0xb815('0x30')][_0xb815('0x3a')]+'%'};return _0x1dcdb3;}})});}_0x3b0152=_[_0xb815('0x3b')]({},_0x3b0152,_0x26bef8[_0xb815('0x3e')]);var _0x554495={'where':_0x3b0152['where']};return db['JscriptyAnswerReport'][_0xb815('0x1d')](_0x554495)[_0xb815('0x23')](function(_0x563ea2){_0xd22488[_0xb815('0x1d')]=_0x563ea2;if(_0x26bef8[_0xb815('0x30')][_0xb815('0x3f')]){_0x3b0152[_0xb815('0x40')]=[{'all':!![]}];}return db[_0xb815('0x41')][_0xb815('0x42')](_0x3b0152);})['then'](function(_0x572803){_0xd22488[_0xb815('0x43')]=_0x572803;return _0xd22488;})['then'](respondWithFilteredResult(_0x2e9199,_0x3b0152))['catch'](handleError(_0x2e9199,null));};exports[_0xb815('0x44')]=function(_0xdd9e31,_0x2ff7a7){var _0x388754={'raw':!![],'where':{'id':_0xdd9e31['params']['id']}},_0x4c8655={};_0x4c8655[_0xb815('0x2d')]=_[_0xb815('0x2f')](db[_0xb815('0x41')][_0xb815('0x45')]);_0x4c8655[_0xb815('0x30')]=_[_0xb815('0x2f')](_0xdd9e31[_0xb815('0x30')]);_0x4c8655[_0xb815('0x39')]=_[_0xb815('0x46')](_0x4c8655['model'],_0x4c8655[_0xb815('0x30')]);_0x388754['attributes']=_[_0xb815('0x46')](_0x4c8655['model'],qs[_0xb815('0x32')](_0xdd9e31[_0xb815('0x30')][_0xb815('0x32')]));_0x388754['attributes']=_0x388754['attributes'][_0xb815('0x33')]?_0x388754[_0xb815('0x31')]:_0x4c8655[_0xb815('0x2d')];if(_0xdd9e31['query'][_0xb815('0x3f')]){_0x388754[_0xb815('0x40')]=[{'all':!![]}];}_0x388754=_[_0xb815('0x3b')]({},_0x388754,_0xdd9e31[_0xb815('0x3e')]);return db[_0xb815('0x41')][_0xb815('0x47')](_0x388754)[_0xb815('0x23')](handleEntityNotFound(_0x2ff7a7,null))[_0xb815('0x23')](respondWithResult(_0x2ff7a7,null))['catch'](handleError(_0x2ff7a7,null));};exports['create']=function(_0x17c39c,_0x3a46f3){return db[_0xb815('0x41')][_0xb815('0x48')](_0x17c39c['body'],{})['then'](respondWithResult(_0x3a46f3,0xc9))[_0xb815('0x49')](handleError(_0x3a46f3,null));};exports[_0xb815('0x22')]=function(_0x549106,_0xfb3946){if(_0x549106['body']['id']){delete _0x549106[_0xb815('0x4a')]['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x549106[_0xb815('0x4b')]['id']}})['then'](handleEntityNotFound(_0xfb3946,null))[_0xb815('0x23')](saveUpdates(_0x549106[_0xb815('0x4a')],null))[_0xb815('0x23')](respondWithResult(_0xfb3946,null))['catch'](handleError(_0xfb3946,null));};exports[_0xb815('0x24')]=function(_0xe75271,_0x1ce83d){return db[_0xb815('0x41')][_0xb815('0x47')]({'where':{'id':_0xe75271[_0xb815('0x4b')]['id']}})[_0xb815('0x23')](handleEntityNotFound(_0x1ce83d,null))['then'](removeEntity(_0x1ce83d,null))[_0xb815('0x49')](handleError(_0x1ce83d,null));};exports[_0xb815('0x4c')]=function(_0x2ef92a,_0x4d74fc){return db['JscriptyAnswerReport'][_0xb815('0x4c')]()[_0xb815('0x23')](respondWithResult(_0x4d74fc,null))[_0xb815('0x49')](handleError(_0x4d74fc,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 2a2e004..b9e88a6 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 _0xdbda=['../../config/environment','exports','define','JscriptyAnswerReport','report_jscripty_answers','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x46d111,_0x108322){var _0x3a525b=function(_0x255817){while(--_0x255817){_0x46d111['push'](_0x46d111['shift']());}};_0x3a525b(++_0x108322);}(_0xdbda,0x1e9));var _0xadbd=function(_0x32d1ba,_0x3d97fa){_0x32d1ba=_0x32d1ba-0x0;var _0x202df4=_0xdbda[_0x32d1ba];return _0x202df4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xadbd('0x0'));var moment=require(_0xadbd('0x1'));var BPromise=require(_0xadbd('0x2'));var rp=require(_0xadbd('0x3'));var fs=require('fs');var path=require(_0xadbd('0x4'));var rimraf=require(_0xadbd('0x5'));var config=require(_0xadbd('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xadbd('0x7')]=function(_0x2b83f5,_0x53cd08){return _0x2b83f5[_0xadbd('0x8')](_0xadbd('0x9'),attributes,{'tableName':_0xadbd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb5c4=['exports','define','lodash','util','api','request-promise','path','rimraf','../../config/environment'];(function(_0x4a278a,_0x50106e){var _0x2e8e42=function(_0x38a7a3){while(--_0x38a7a3){_0x4a278a['push'](_0x4a278a['shift']());}};_0x2e8e42(++_0x50106e);}(_0xb5c4,0x6e));var _0x4b5c=function(_0x1f45e5,_0x568b84){_0x1f45e5=_0x1f45e5-0x0;var _0xcb83ff=_0xb5c4[_0x1f45e5];return _0xcb83ff;};'use strict';var _=require(_0x4b5c('0x0'));var util=require(_0x4b5c('0x1'));var logger=require('../../config/logger')(_0x4b5c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4b5c('0x3'));var fs=require('fs');var path=require(_0x4b5c('0x4'));var rimraf=require(_0x4b5c('0x5'));var config=require(_0x4b5c('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x4b5c('0x7')]=function(_0x376657,_0x40202d){return _0x376657[_0x4b5c('0x8')]('JscriptyAnswerReport',attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index fba0af6..7662905 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 _0xef32=['JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3b7cc9,_0x3a1b26){var _0x5c6917=function(_0x1d376d){while(--_0x1d376d){_0x3b7cc9['push'](_0x3b7cc9['shift']());}};_0x5c6917(++_0x3a1b26);}(_0xef32,0x133));var _0x2ef3=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0xef32[_0x4dcc2d];return _0x1bbd79;};'use strict';var _=require(_0x2ef3('0x0'));var util=require(_0x2ef3('0x1'));var moment=require('moment');var BPromise=require(_0x2ef3('0x2'));var rs=require(_0x2ef3('0x3'));var fs=require('fs');var Redis=require(_0x2ef3('0x4'));var db=require(_0x2ef3('0x5'))['db'];var utils=require(_0x2ef3('0x6'));var logger=require(_0x2ef3('0x7'))(_0x2ef3('0x8'));var config=require(_0x2ef3('0x9'));var jayson=require(_0x2ef3('0xa'));var client=jayson['client'][_0x2ef3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x142f33,_0x1a8e28,_0x3ec190){return new BPromise(function(_0xda32bc,_0x15ee46){return client[_0x2ef3('0xc')](_0x142f33,_0x3ec190)[_0x2ef3('0xd')](function(_0x59c83e){logger[_0x2ef3('0xe')](_0x2ef3('0xf'),_0x1a8e28,_0x2ef3('0x10'));logger[_0x2ef3('0x11')](_0x2ef3('0x12'),_0x1a8e28,_0x2ef3('0x10'),JSON[_0x2ef3('0x13')](_0x59c83e));if(_0x59c83e['error']){if(_0x59c83e[_0x2ef3('0x14')][_0x2ef3('0x15')]===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x1a8e28,_0x59c83e[_0x2ef3('0x14')][_0x2ef3('0x16')]);return _0x15ee46(_0x59c83e[_0x2ef3('0x14')][_0x2ef3('0x16')]);}logger[_0x2ef3('0x14')](_0x2ef3('0xf'),_0x1a8e28,_0x59c83e[_0x2ef3('0x14')][_0x2ef3('0x16')]);return _0xda32bc(_0x59c83e[_0x2ef3('0x14')][_0x2ef3('0x16')]);}else{logger[_0x2ef3('0xe')](_0x2ef3('0xf'),_0x1a8e28,_0x2ef3('0x10'));_0xda32bc(_0x59c83e[_0x2ef3('0x17')][_0x2ef3('0x16')]);}})[_0x2ef3('0x18')](function(_0x3e6638){logger[_0x2ef3('0x14')](_0x2ef3('0xf'),_0x1a8e28,_0x3e6638);_0x15ee46(_0x3e6638);});});} \ No newline at end of file +var _0xd2a3=['then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x417211,_0x473c09){var _0x2c04a5=function(_0x4a3bb8){while(--_0x4a3bb8){_0x417211['push'](_0x417211['shift']());}};_0x2c04a5(++_0x473c09);}(_0xd2a3,0x184));var _0x3d2a=function(_0x399116,_0x31c89a){_0x399116=_0x399116-0x0;var _0x45731a=_0xd2a3[_0x399116];return _0x45731a;};'use strict';var _=require(_0x3d2a('0x0'));var util=require(_0x3d2a('0x1'));var moment=require('moment');var BPromise=require(_0x3d2a('0x2'));var rs=require(_0x3d2a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3d2a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3d2a('0x5'))(_0x3d2a('0x6'));var config=require(_0x3d2a('0x7'));var jayson=require(_0x3d2a('0x8'));var client=jayson['client'][_0x3d2a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d958c,_0x47221c,_0x2c4dc5){return new BPromise(function(_0x15883f,_0x4bc1ca){return client[_0x3d2a('0xa')](_0x5d958c,_0x2c4dc5)[_0x3d2a('0xb')](function(_0x5161e9){logger[_0x3d2a('0xc')](_0x3d2a('0xd'),_0x47221c,'request\x20sent');logger[_0x3d2a('0xe')](_0x3d2a('0xf'),_0x47221c,'request\x20sent',JSON['stringify'](_0x5161e9));if(_0x5161e9['error']){if(_0x5161e9[_0x3d2a('0x10')][_0x3d2a('0x11')]===0x1f4){logger[_0x3d2a('0x10')](_0x3d2a('0xd'),_0x47221c,_0x5161e9['error'][_0x3d2a('0x12')]);return _0x4bc1ca(_0x5161e9[_0x3d2a('0x10')][_0x3d2a('0x12')]);}logger[_0x3d2a('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x47221c,_0x5161e9['error'][_0x3d2a('0x12')]);return _0x15883f(_0x5161e9[_0x3d2a('0x10')]['message']);}else{logger['info'](_0x3d2a('0xd'),_0x47221c,_0x3d2a('0x13'));_0x15883f(_0x5161e9[_0x3d2a('0x14')][_0x3d2a('0x12')]);}})['catch'](function(_0x2a7b7a){logger['error'](_0x3d2a('0xd'),_0x47221c,_0x2a7b7a);_0x4bc1ca(_0x2a7b7a);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 930f0bf..9241a3c 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 _0xbe26=['./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','getSummary','post','create','/:id/clone','clone','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4c245d,_0x377ea5){var _0x33b513=function(_0x49ea5f){while(--_0x49ea5f){_0x4c245d['push'](_0x4c245d['shift']());}};_0x33b513(++_0x377ea5);}(_0xbe26,0x15e));var _0x6be2=function(_0x3f8cd0,_0x4fe128){_0x3f8cd0=_0x3f8cd0-0x0;var _0x3092a2=_0xbe26[_0x3f8cd0];return _0x3092a2;};'use strict';var multer=require(_0x6be2('0x0'));var util=require(_0x6be2('0x1'));var path=require(_0x6be2('0x2'));var timeout=require(_0x6be2('0x3'));var express=require(_0x6be2('0x4'));var router=express[_0x6be2('0x5')]();var fs_extra=require(_0x6be2('0x6'));var auth=require(_0x6be2('0x7'));var interaction=require(_0x6be2('0x8'));var config=require(_0x6be2('0x9'));var controller=require(_0x6be2('0xa'));router[_0x6be2('0xb')]('/',auth[_0x6be2('0xc')](),controller[_0x6be2('0xd')]);router[_0x6be2('0xb')](_0x6be2('0xe'),auth[_0x6be2('0xc')](),controller[_0x6be2('0xf')]);router['get'](_0x6be2('0x10'),auth[_0x6be2('0xc')](),controller[_0x6be2('0x11')]);router[_0x6be2('0xb')](_0x6be2('0x12'),auth['isAuthenticated'](),controller[_0x6be2('0x13')]);router[_0x6be2('0xb')](_0x6be2('0x14'),auth[_0x6be2('0xc')](),timeout('30s'),controller[_0x6be2('0x15')]);router[_0x6be2('0x16')]('/',auth[_0x6be2('0xc')](),controller[_0x6be2('0x17')]);router[_0x6be2('0x16')](_0x6be2('0x18'),auth[_0x6be2('0xc')](),controller[_0x6be2('0x19')]);router[_0x6be2('0x1a')](_0x6be2('0xe'),auth[_0x6be2('0xc')](),controller[_0x6be2('0x1b')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6be2('0x1c')]);module[_0x6be2('0x1d')]=router; \ No newline at end of file +var _0x07a4=['/:id','show','/:id/sessions','getAnswers','/:id/summary','getSummary','post','create','/:id/clone','clone','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x48a57b,_0x1ea57c){var _0x31f116=function(_0x1dd179){while(--_0x1dd179){_0x48a57b['push'](_0x48a57b['shift']());}};_0x31f116(++_0x1ea57c);}(_0x07a4,0x1bf));var _0x407a=function(_0x338d16,_0x5d3b29){_0x338d16=_0x338d16-0x0;var _0x37a0b7=_0x07a4[_0x338d16];return _0x37a0b7;};'use strict';var multer=require(_0x407a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x407a('0x1'));var express=require(_0x407a('0x2'));var router=express[_0x407a('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x407a('0x4'));var config=require(_0x407a('0x5'));var controller=require('./jscriptyProject.controller');router[_0x407a('0x6')]('/',auth[_0x407a('0x7')](),controller[_0x407a('0x8')]);router[_0x407a('0x6')](_0x407a('0x9'),auth['isAuthenticated'](),controller[_0x407a('0xa')]);router[_0x407a('0x6')](_0x407a('0xb'),auth[_0x407a('0x7')](),controller['getSessions']);router[_0x407a('0x6')]('/:id/answers',auth[_0x407a('0x7')](),controller[_0x407a('0xc')]);router[_0x407a('0x6')](_0x407a('0xd'),auth[_0x407a('0x7')](),timeout('30s'),controller[_0x407a('0xe')]);router[_0x407a('0xf')]('/',auth[_0x407a('0x7')](),controller[_0x407a('0x10')]);router['post'](_0x407a('0x11'),auth[_0x407a('0x7')](),controller[_0x407a('0x12')]);router[_0x407a('0x13')]('/:id',auth[_0x407a('0x7')](),controller[_0x407a('0x14')]);router[_0x407a('0x15')](_0x407a('0x9'),auth[_0x407a('0x7')](),controller[_0x407a('0x16')]);module[_0x407a('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 0bcfba5..1c3fc92 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 _0x11df=['STRING','TEXT','isObjectLike','setDataValue','formData','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','name'];(function(_0x2d9097,_0x435309){var _0x304af8=function(_0x4dc8a5){while(--_0x4dc8a5){_0x2d9097['push'](_0x2d9097['shift']());}};_0x304af8(++_0x435309);}(_0x11df,0x1bb));var _0xf11d=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x11df[_0x3ff085];return _0x2b68c3;};'use strict';var Sequelize=require(_0xf11d('0x0'));var _=require(_0xf11d('0x1'));var util=require(_0xf11d('0x2'));module[_0xf11d('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0xf11d('0x4')},'description':{'type':Sequelize[_0xf11d('0x5')]},'formData':{'type':Sequelize[_0xf11d('0x6')]('long'),'set':function(_0x277e91){if(_[_0xf11d('0x7')](_0x277e91)){this[_0xf11d('0x8')](_0xf11d('0x9'),JSON['stringify'](_0x277e91));}else if(_[_0xf11d('0xa')](_0x277e91)){this['setDataValue'](_0xf11d('0x9'),_0x277e91);}else{this['setDataValue']('formData',util[_0xf11d('0xb')](_0xf11d('0xc'),this[_0xf11d('0xd')](_0xf11d('0x4'))||'',this[_0xf11d('0xd')](_0xf11d('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xf11d('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xf11d('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0xcc27=['description','BOOLEAN','lodash','util','exports','name','STRING','TEXT','long','isObjectLike','isString','setDataValue','formData','getDataValue'];(function(_0x44f906,_0x4c4a31){var _0x2a6cc6=function(_0x5037d4){while(--_0x5037d4){_0x44f906['push'](_0x44f906['shift']());}};_0x2a6cc6(++_0x4c4a31);}(_0xcc27,0x64));var _0x7cc2=function(_0xe1066,_0x263690){_0xe1066=_0xe1066-0x0;var _0x5a731f=_0xcc27[_0xe1066];return _0x5a731f;};'use strict';var Sequelize=require('sequelize');var _=require(_0x7cc2('0x0'));var util=require(_0x7cc2('0x1'));module[_0x7cc2('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x7cc2('0x3')},'description':{'type':Sequelize[_0x7cc2('0x4')]},'formData':{'type':Sequelize[_0x7cc2('0x5')](_0x7cc2('0x6')),'set':function(_0x594490){if(_[_0x7cc2('0x7')](_0x594490)){this['setDataValue']('formData',JSON['stringify'](_0x594490));}else if(_[_0x7cc2('0x8')](_0x594490)){this[_0x7cc2('0x9')](_0x7cc2('0xa'),_0x594490);}else{this['setDataValue'](_0x7cc2('0xa'),util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x7cc2('0xb')](_0x7cc2('0x3'))||'',this[_0x7cc2('0xb')](_0x7cc2('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x7cc2('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x7cc2('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 22c877e..2092553 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 _0xd4dc=['-createdAt','questionId','question','SessionId','answer','push','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','sendStatus','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','get','Projects','end','error','stack','name','send','index','JscriptyProject','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','include','updatedAt','omit','createdAt','findOne','nolimit','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd4dc,0xff));var _0xcd4d=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0xd4dc[_0x1cb18a];return _0x22442e;};'use strict';var emlformat=require(_0xcd4d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd4d('0x1'));var jsonpatch=require(_0xcd4d('0x2'));var rp=require(_0xcd4d('0x3'));var moment=require(_0xcd4d('0x4'));var BPromise=require(_0xcd4d('0x5'));var Mustache=require(_0xcd4d('0x6'));var util=require(_0xcd4d('0x7'));var path=require('path');var sox=require(_0xcd4d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcd4d('0x9'));var _=require('lodash');var squel=require(_0xcd4d('0xa'));var crypto=require(_0xcd4d('0xb'));var jsforce=require(_0xcd4d('0xc'));var deskjs=require(_0xcd4d('0xd'));var toCsv=require(_0xcd4d('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcd4d('0xf'));var authService=require(_0xcd4d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xcd4d('0x11'));var hardwareService=require(_0xcd4d('0x12'));var logger=require(_0xcd4d('0x13'))('api');var utils=require(_0xcd4d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xcd4d('0x15'));var db=require(_0xcd4d('0x16'))['db'];function respondWithStatusCode(_0x3d3019,_0x1604e3){_0x1604e3=_0x1604e3||0xcc;return function(_0x10fb9e){if(_0x10fb9e){return _0x3d3019['sendStatus'](_0x1604e3);}return _0x3d3019['status'](_0x1604e3)['end']();};}function respondWithResult(_0x316215,_0x44d095){_0x44d095=_0x44d095||0xc8;return function(_0x36afd0){if(_0x36afd0){return _0x316215[_0xcd4d('0x17')](_0x44d095)[_0xcd4d('0x18')](_0x36afd0);}};}function respondWithFilteredResult(_0x464e7,_0xc4cf9b){return function(_0x3cf713){if(_0x3cf713){var _0x27bf0c=typeof _0xc4cf9b[_0xcd4d('0x19')]==='undefined'&&typeof _0xc4cf9b[_0xcd4d('0x1a')]===_0xcd4d('0x1b');var _0x1e7b6c=_0x3cf713[_0xcd4d('0x1c')];var _0x470e42=_0x27bf0c?0x0:_0xc4cf9b[_0xcd4d('0x19')];var _0x32ac99=_0x27bf0c?_0x3cf713[_0xcd4d('0x1c')]:_0xc4cf9b[_0xcd4d('0x19')]+_0xc4cf9b[_0xcd4d('0x1a')];var _0x263172;if(_0x32ac99>=_0x1e7b6c){_0x32ac99=_0x1e7b6c;_0x263172=0xc8;}else{_0x263172=0xce;}_0x464e7[_0xcd4d('0x17')](_0x263172);return _0x464e7[_0xcd4d('0x1d')]('Content-Range',_0x470e42+'-'+_0x32ac99+'/'+_0x1e7b6c)[_0xcd4d('0x18')](_0x3cf713);}return null;};}function patchUpdates(_0x1d7cdf){return function(_0x15935b){try{jsonpatch[_0xcd4d('0x1e')](_0x15935b,_0x1d7cdf,!![]);}catch(_0x2a4ee3){return BPromise[_0xcd4d('0x1f')](_0x2a4ee3);}return _0x15935b[_0xcd4d('0x20')]();};}function saveUpdates(_0x108919,_0x42f0f9){return function(_0x1f3e88){if(_0x1f3e88){return _0x1f3e88[_0xcd4d('0x21')](_0x108919)['then'](function(_0x22b562){return _0x22b562;});}return null;};}function removeEntity(_0x4fa4ad,_0x1f7026){return function(_0x770ec6){if(_0x770ec6){return _0x770ec6['destroy']()[_0xcd4d('0x22')](function(){var _0x5e911a=_0x770ec6[_0xcd4d('0x23')]({'plain':!![]});var _0xdc7660=_0xcd4d('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0xdc7660,'resourceId':_0x5e911a['id']}})['then'](function(){return _0x770ec6;});})[_0xcd4d('0x22')](function(){_0x4fa4ad[_0xcd4d('0x17')](0xcc)[_0xcd4d('0x25')]();});}};}function handleEntityNotFound(_0xf9e37e,_0x35d7e5){return function(_0x4d5c84){if(!_0x4d5c84){_0xf9e37e['sendStatus'](0x194);}return _0x4d5c84;};}function handleError(_0x28da5c,_0x6a999c){_0x6a999c=_0x6a999c||0x1f4;return function(_0x4adcb5){logger[_0xcd4d('0x26')](_0x4adcb5[_0xcd4d('0x27')]);if(_0x4adcb5[_0xcd4d('0x28')]){delete _0x4adcb5[_0xcd4d('0x28')];}_0x28da5c[_0xcd4d('0x17')](_0x6a999c)[_0xcd4d('0x29')](_0x4adcb5);};}exports[_0xcd4d('0x2a')]=function(_0x529d48,_0x319689){var _0x10bdfa={},_0x4a2cf4={},_0xe150ec={'count':0x0,'rows':[]};var _0x490012=_['map'](db[_0xcd4d('0x2b')]['rawAttributes'],function(_0x2f1f64){return{'name':_0x2f1f64[_0xcd4d('0x2c')],'type':_0x2f1f64[_0xcd4d('0x2d')][_0xcd4d('0x2e')]};});_0x4a2cf4[_0xcd4d('0x2f')]=_[_0xcd4d('0x30')](_0x490012,_0xcd4d('0x28'));_0x4a2cf4[_0xcd4d('0x31')]=_[_0xcd4d('0x32')](_0x529d48[_0xcd4d('0x31')]);_0x4a2cf4[_0xcd4d('0x33')]=_[_0xcd4d('0x34')](_0x4a2cf4[_0xcd4d('0x2f')],_0x4a2cf4[_0xcd4d('0x31')]);_0x10bdfa[_0xcd4d('0x35')]=_[_0xcd4d('0x34')](_0x4a2cf4[_0xcd4d('0x2f')],qs[_0xcd4d('0x36')](_0x529d48['query'][_0xcd4d('0x36')]));_0x10bdfa['attributes']=_0x10bdfa[_0xcd4d('0x35')][_0xcd4d('0x37')]?_0x10bdfa[_0xcd4d('0x35')]:_0x4a2cf4['model'];if(!_0x529d48['query'][_0xcd4d('0x38')]('nolimit')){_0x10bdfa[_0xcd4d('0x1a')]=qs[_0xcd4d('0x1a')](_0x529d48[_0xcd4d('0x31')][_0xcd4d('0x1a')]);_0x10bdfa[_0xcd4d('0x19')]=qs[_0xcd4d('0x19')](_0x529d48['query'][_0xcd4d('0x19')]);}_0x10bdfa[_0xcd4d('0x39')]=qs[_0xcd4d('0x3a')](_0x529d48['query'][_0xcd4d('0x3a')]);_0x10bdfa[_0xcd4d('0x3b')]=qs[_0xcd4d('0x33')](_[_0xcd4d('0x3c')](_0x529d48['query'],_0x4a2cf4[_0xcd4d('0x33')]),_0x490012);if(_0x529d48[_0xcd4d('0x31')]['filter']){_0x10bdfa[_0xcd4d('0x3b')]=_[_0xcd4d('0x3d')](_0x10bdfa['where'],{'$or':_['map'](_0x490012,function(_0x4353dd){if(_0x4353dd[_0xcd4d('0x2d')]!==_0xcd4d('0x3e')){var _0x3349d6={};_0x3349d6[_0x4353dd[_0xcd4d('0x28')]]={'$like':'%'+_0x529d48[_0xcd4d('0x31')][_0xcd4d('0x3f')]+'%'};return _0x3349d6;}})});}_0x10bdfa=_[_0xcd4d('0x3d')]({},_0x10bdfa,_0x529d48['options']);var _0x4cf9d2={'where':_0x10bdfa[_0xcd4d('0x3b')]};return db['JscriptyProject'][_0xcd4d('0x1c')](_0x4cf9d2)[_0xcd4d('0x22')](function(_0x234a59){_0xe150ec[_0xcd4d('0x1c')]=_0x234a59;if(_0x529d48[_0xcd4d('0x31')][_0xcd4d('0x40')]){_0x10bdfa['include']=[{'all':!![]}];}return db[_0xcd4d('0x2b')][_0xcd4d('0x41')](_0x10bdfa);})[_0xcd4d('0x22')](function(_0x43faea){_0xe150ec[_0xcd4d('0x42')]=_0x43faea;return _0xe150ec;})[_0xcd4d('0x22')](respondWithFilteredResult(_0x319689,_0x10bdfa))[_0xcd4d('0x43')](handleError(_0x319689,null));};exports[_0xcd4d('0x44')]=function(_0x568bf3,_0x51cf1d){var _0x2e1f9a={'raw':![],'where':{'id':_0x568bf3['params']['id']}},_0x25ee24={};_0x25ee24[_0xcd4d('0x2f')]=_[_0xcd4d('0x32')](db[_0xcd4d('0x2b')][_0xcd4d('0x45')]);_0x25ee24['query']=_[_0xcd4d('0x32')](_0x568bf3[_0xcd4d('0x31')]);_0x25ee24[_0xcd4d('0x33')]=_['intersection'](_0x25ee24[_0xcd4d('0x2f')],_0x25ee24['query']);_0x2e1f9a['attributes']=_[_0xcd4d('0x34')](_0x25ee24[_0xcd4d('0x2f')],qs[_0xcd4d('0x36')](_0x568bf3[_0xcd4d('0x31')][_0xcd4d('0x36')]));_0x2e1f9a['attributes']=_0x2e1f9a[_0xcd4d('0x35')][_0xcd4d('0x37')]?_0x2e1f9a[_0xcd4d('0x35')]:_0x25ee24['model'];if(_0x568bf3['query']['includeAll']){_0x2e1f9a['include']=[{'all':!![]}];}_0x2e1f9a=_[_0xcd4d('0x3d')]({},_0x2e1f9a,_0x568bf3[_0xcd4d('0x46')]);return db[_0xcd4d('0x2b')][_0xcd4d('0x47')](_0x2e1f9a)[_0xcd4d('0x22')](handleEntityNotFound(_0x51cf1d,null))[_0xcd4d('0x22')](respondWithResult(_0x51cf1d,null))[_0xcd4d('0x43')](handleError(_0x51cf1d,null));};exports[_0xcd4d('0x48')]=function(_0x4a2575,_0x54f14f){return db[_0xcd4d('0x2b')][_0xcd4d('0x48')](_0x4a2575[_0xcd4d('0x49')],{})[_0xcd4d('0x22')](function(_0x2fcf40){var _0x51c6d4=_0x4a2575[_0xcd4d('0x4a')][_0xcd4d('0x23')]({'plain':!![]});if(!_0x51c6d4)throw new Error(_0xcd4d('0x4b'));if(_0x51c6d4['role']===_0xcd4d('0x4a')){var _0x2bcaef=_0x2fcf40[_0xcd4d('0x23')]({'plain':!![]});var _0x10c9a4=_0xcd4d('0x24');return db[_0xcd4d('0x4c')][_0xcd4d('0x47')]({'where':{'name':_0x10c9a4,'userProfileId':_0x51c6d4[_0xcd4d('0x4d')]},'raw':!![]})[_0xcd4d('0x22')](function(_0x1844cb){if(_0x1844cb&&_0x1844cb[_0xcd4d('0x4e')]===0x0){return db[_0xcd4d('0x4f')][_0xcd4d('0x48')]({'name':_0x2bcaef['name'],'resourceId':_0x2bcaef['id'],'type':_0x1844cb[_0xcd4d('0x28')],'sectionId':_0x1844cb['id']},{})['then'](function(){return _0x2fcf40;});}else{return _0x2fcf40;}})['catch'](function(_0x43a24f){logger[_0xcd4d('0x26')](_0xcd4d('0x50'),_0x43a24f);throw _0x43a24f;});}return _0x2fcf40;})[_0xcd4d('0x22')](respondWithResult(_0x54f14f,0xc9))[_0xcd4d('0x43')](handleError(_0x54f14f,null));};exports[_0xcd4d('0x51')]=function(_0x50bcfe,_0x333e8c){var _0x48a17a={'where':{'id':_0x50bcfe[_0xcd4d('0x52')]['id']}},_0x1546e0={};_0x1546e0[_0xcd4d('0x2f')]=_['keys'](db[_0xcd4d('0x2b')][_0xcd4d('0x45')]);_0x48a17a[_0xcd4d('0x35')]=_['intersection'](_0x1546e0['model'],qs[_0xcd4d('0x36')](_0x50bcfe[_0xcd4d('0x31')]['fields']));_0x48a17a[_0xcd4d('0x35')]=_0x48a17a[_0xcd4d('0x35')][_0xcd4d('0x37')]?_0x48a17a[_0xcd4d('0x35')]:_0x1546e0[_0xcd4d('0x2f')];if(_0x50bcfe[_0xcd4d('0x31')][_0xcd4d('0x40')]){_0x48a17a[_0xcd4d('0x53')]=[{'all':!![]}];}_0x48a17a=_[_0xcd4d('0x3d')]({},_0x48a17a,_0x50bcfe['options']);return db[_0xcd4d('0x2b')][_0xcd4d('0x47')](_0x48a17a)[_0xcd4d('0x22')](handleEntityNotFound(_0x333e8c,null))[_0xcd4d('0x22')](function(_0x1857f2){if(_0x1857f2){var _0x425d66=_0x1857f2['get']({'plain':!![]});_0x425d66=qs['omit'](_0x425d66,['id','createdAt',_0xcd4d('0x54')]);_0x50bcfe[_0xcd4d('0x49')]=_[_0xcd4d('0x55')](_0x50bcfe[_0xcd4d('0x49')],['id',_0xcd4d('0x56'),_0xcd4d('0x54')]);return db[_0xcd4d('0x2b')][_0xcd4d('0x48')](_[_0xcd4d('0x3d')](_0x425d66,_0x50bcfe[_0xcd4d('0x49')]),{'include':_0x50bcfe['query'][_0xcd4d('0x40')]?[{'all':!![]}]:undefined})[_0xcd4d('0x22')](function(_0x145af1){var _0x8b8ab8=_0x50bcfe['user']['get']({'plain':!![]});if(!_0x8b8ab8)throw new Error(_0xcd4d('0x4b'));if(_0x8b8ab8['role']==='user'){var _0x14ccb7=_0x145af1[_0xcd4d('0x23')]({'plain':!![]});var _0x3074d7='Projects';return db[_0xcd4d('0x4c')][_0xcd4d('0x47')]({'where':{'name':_0x3074d7,'userProfileId':_0x8b8ab8[_0xcd4d('0x4d')]},'raw':!![]})[_0xcd4d('0x22')](function(_0x3ae722){if(_0x3ae722&&_0x3ae722['autoAssociation']===0x0){return db['UserProfileResource'][_0xcd4d('0x48')]({'name':_0x14ccb7[_0xcd4d('0x28')],'resourceId':_0x14ccb7['id'],'type':_0x3ae722['name'],'sectionId':_0x3ae722['id']},{})[_0xcd4d('0x22')](function(){return _0x145af1;});}else{return _0x145af1;}})['catch'](function(_0x1c4e46){logger['error'](_0xcd4d('0x50'),_0x1c4e46);throw _0x1c4e46;});}return _0x145af1;});}})[_0xcd4d('0x22')](respondWithResult(_0x333e8c,0xc9))[_0xcd4d('0x43')](handleError(_0x333e8c,null));};exports['update']=function(_0xfff2fb,_0x2adf9c){if(_0xfff2fb['body']['id']){delete _0xfff2fb[_0xcd4d('0x49')]['id'];}return db[_0xcd4d('0x2b')][_0xcd4d('0x47')]({'where':{'id':_0xfff2fb['params']['id']}})[_0xcd4d('0x22')](handleEntityNotFound(_0x2adf9c,null))[_0xcd4d('0x22')](saveUpdates(_0xfff2fb[_0xcd4d('0x49')],null))[_0xcd4d('0x22')](respondWithResult(_0x2adf9c,null))['catch'](handleError(_0x2adf9c,null));};exports['destroy']=function(_0x452e82,_0x289838){return db['JscriptyProject']['find']({'where':{'id':_0x452e82[_0xcd4d('0x52')]['id']}})['then'](handleEntityNotFound(_0x289838,null))[_0xcd4d('0x22')](removeEntity(_0x289838,null))[_0xcd4d('0x43')](handleError(_0x289838,null));};exports['getSessions']=function(_0x409a3a,_0x1cb0a9,_0x56a0f1){var _0x25cd0c={'raw':!![],'where':{}};var _0x1a2169={};var _0x4aab35={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xcd4d('0x57')]({'where':{'id':_0x409a3a[_0xcd4d('0x52')]['id']}})['then'](handleEntityNotFound(_0x1cb0a9,null))['then'](function(_0x502783){if(_0x502783){_0x1a2169['model']=_['keys'](db['JscriptySessionReport']['rawAttributes']);_0x1a2169[_0xcd4d('0x31')]=_[_0xcd4d('0x32')](_0x409a3a['query']);_0x1a2169['filters']=_[_0xcd4d('0x34')](_0x1a2169[_0xcd4d('0x2f')],_0x1a2169[_0xcd4d('0x31')]);_0x25cd0c['attributes']=_[_0xcd4d('0x34')](_0x1a2169['model'],qs[_0xcd4d('0x36')](_0x409a3a['query'][_0xcd4d('0x36')]));_0x25cd0c[_0xcd4d('0x35')]=_0x25cd0c[_0xcd4d('0x35')][_0xcd4d('0x37')]?_0x25cd0c[_0xcd4d('0x35')]:_0x1a2169[_0xcd4d('0x2f')];if(!_0x409a3a[_0xcd4d('0x31')]['hasOwnProperty'](_0xcd4d('0x58'))){_0x25cd0c[_0xcd4d('0x1a')]=qs[_0xcd4d('0x1a')](_0x409a3a['query'][_0xcd4d('0x1a')]);_0x25cd0c[_0xcd4d('0x19')]=qs[_0xcd4d('0x19')](_0x409a3a[_0xcd4d('0x31')]['offset']);}_0x25cd0c[_0xcd4d('0x39')]=qs[_0xcd4d('0x3a')](_0x409a3a[_0xcd4d('0x31')]['sort']);_0x25cd0c[_0xcd4d('0x3b')]=qs[_0xcd4d('0x33')](_[_0xcd4d('0x3c')](_0x409a3a['query'],_0x1a2169[_0xcd4d('0x33')]));_0x25cd0c['where'][_0xcd4d('0x59')]=_0x502783['id'];if(_0x409a3a[_0xcd4d('0x31')]['filter']){_0x25cd0c[_0xcd4d('0x3b')]=_['merge'](_0x25cd0c[_0xcd4d('0x3b')],{'$or':_['map'](_0x25cd0c[_0xcd4d('0x35')],function(_0x2ae842){var _0x13e81e={};_0x13e81e[_0x2ae842]={'$like':'%'+_0x409a3a[_0xcd4d('0x31')]['filter']+'%'};return _0x13e81e;})});}_0x25cd0c=_[_0xcd4d('0x3d')]({},_0x25cd0c,_0x409a3a[_0xcd4d('0x46')]);return db[_0xcd4d('0x5a')][_0xcd4d('0x1c')]({'where':_0x25cd0c[_0xcd4d('0x3b')]})[_0xcd4d('0x22')](function(_0x10e73a){_0x4aab35[_0xcd4d('0x1c')]=_0x10e73a;if(_0x409a3a[_0xcd4d('0x31')]['includeAll']){_0x25cd0c[_0xcd4d('0x53')]=[{'all':!![]}];}return db[_0xcd4d('0x5a')][_0xcd4d('0x41')](_0x25cd0c);})[_0xcd4d('0x22')](function(_0x1d9e82){_0x4aab35[_0xcd4d('0x42')]=_0x1d9e82;return _0x4aab35;});}})['then'](respondWithFilteredResult(_0x1cb0a9,_0x25cd0c))[_0xcd4d('0x43')](handleError(_0x1cb0a9,null));};exports[_0xcd4d('0x5b')]=function(_0x4574b5,_0x5b18a2,_0x106eb5){var _0x57f68f={'raw':!![],'where':{}};var _0x4005a9={};var _0x4df240={'count':0x0,'rows':[]};return db[_0xcd4d('0x2b')][_0xcd4d('0x57')]({'where':{'id':_0x4574b5[_0xcd4d('0x52')]['id']}})[_0xcd4d('0x22')](handleEntityNotFound(_0x5b18a2,null))[_0xcd4d('0x22')](function(_0x1d43dd){if(_0x1d43dd){_0x4005a9[_0xcd4d('0x2f')]=_[_0xcd4d('0x32')](db[_0xcd4d('0x5c')][_0xcd4d('0x45')]);_0x4005a9[_0xcd4d('0x31')]=_[_0xcd4d('0x32')](_0x4574b5[_0xcd4d('0x31')]);_0x4005a9[_0xcd4d('0x33')]=_[_0xcd4d('0x34')](_0x4005a9[_0xcd4d('0x2f')],_0x4005a9[_0xcd4d('0x31')]);_0x57f68f[_0xcd4d('0x35')]=_['intersection'](_0x4005a9[_0xcd4d('0x2f')],qs[_0xcd4d('0x36')](_0x4574b5[_0xcd4d('0x31')][_0xcd4d('0x36')]));_0x57f68f[_0xcd4d('0x35')]=_0x57f68f[_0xcd4d('0x35')]['length']?_0x57f68f[_0xcd4d('0x35')]:_0x4005a9[_0xcd4d('0x2f')];if(!_0x4574b5[_0xcd4d('0x31')]['hasOwnProperty'](_0xcd4d('0x58'))){_0x57f68f[_0xcd4d('0x1a')]=qs[_0xcd4d('0x1a')](_0x4574b5['query'][_0xcd4d('0x1a')]);_0x57f68f[_0xcd4d('0x19')]=qs[_0xcd4d('0x19')](_0x4574b5[_0xcd4d('0x31')][_0xcd4d('0x19')]);}_0x57f68f[_0xcd4d('0x39')]=qs[_0xcd4d('0x3a')](_0x4574b5[_0xcd4d('0x31')][_0xcd4d('0x3a')]);_0x57f68f[_0xcd4d('0x3b')]=qs['filters'](_[_0xcd4d('0x3c')](_0x4574b5[_0xcd4d('0x31')],_0x4005a9['filters']));_0x57f68f[_0xcd4d('0x3b')][_0xcd4d('0x59')]=_0x1d43dd['id'];if(_0x4574b5['query'][_0xcd4d('0x3f')]){_0x57f68f['where']=_['merge'](_0x57f68f['where'],{'$or':_['map'](_0x57f68f[_0xcd4d('0x35')],function(_0x422f89){var _0x27ee54={};_0x27ee54[_0x422f89]={'$like':'%'+_0x4574b5[_0xcd4d('0x31')][_0xcd4d('0x3f')]+'%'};return _0x27ee54;})});}_0x57f68f=_['merge']({},_0x57f68f,_0x4574b5[_0xcd4d('0x46')]);return db['JscriptyAnswerReport'][_0xcd4d('0x1c')]({'where':_0x57f68f[_0xcd4d('0x3b')]})['then'](function(_0x2bc608){_0x4df240[_0xcd4d('0x1c')]=_0x2bc608;if(_0x4574b5['query']['includeAll']){_0x57f68f['include']=[{'all':!![]}];}return db[_0xcd4d('0x5c')][_0xcd4d('0x41')](_0x57f68f);})['then'](function(_0x37fc26){_0x4df240[_0xcd4d('0x42')]=_0x37fc26;return _0x4df240;});}})[_0xcd4d('0x22')](respondWithFilteredResult(_0x5b18a2,_0x57f68f))[_0xcd4d('0x43')](handleError(_0x5b18a2,null));};function char(_0x53b710){return _0xcd4d('0x5d')===typeof _0x53b710?String[_0xcd4d('0x5e')][_0xcd4d('0x1e')](null,arguments):_0x53b710;}function needsEncapsulation(_0x2206ad){return!!_0x2206ad&&(_0x2206ad[_0xcd4d('0x5f')]()[_0xcd4d('0x60')](char(0xd))>=0x0||_0x2206ad['toString']()[_0xcd4d('0x60')](char(0xa))>=0x0||_0x2206ad[_0xcd4d('0x5f')]()['indexOf'](char(0x2c))>=0x0||_0x2206ad[_0xcd4d('0x5f')]()[_0xcd4d('0x60')](char(0x22))>=0x0);}function encapsulate(_0x6ef375){var _0x59b25f=char(0x22),_0x27307d='\x5c'+char(0x22),_0x575384=_0x6ef375[_0xcd4d('0x5f')]()[_0xcd4d('0x61')](new RegExp(_0x59b25f,'g'),_0x27307d);return _0x59b25f+_0x575384+_0x59b25f;}exports[_0xcd4d('0x62')]=function(_0x594668,_0x57db73,_0x1d3184){var _0x72d76e,_0xec8342;var _0x4f5422={'where':{'ProjectId':_0x594668[_0xcd4d('0x52')]['id']}};if(_0x594668[_0xcd4d('0x31')][_0xcd4d('0x63')]){_0x4f5422[_0xcd4d('0x3b')][_0xcd4d('0x64')]=JSON[_0xcd4d('0x65')](_0x594668[_0xcd4d('0x31')]['startTime']);}return db[_0xcd4d('0x5a')][_0xcd4d('0x41')](_0x4f5422)['then'](handleEntityNotFound(_0x57db73,null))[_0xcd4d('0x22')](function(_0x19b769){if(_0x19b769){_0x72d76e=_0x19b769;return db['JscriptyQuestionReport'][_0xcd4d('0x41')]({'where':{'SessionId':{'$in':_[_0xcd4d('0x30')](_0x72d76e,'id')},'ProjectId':_0x594668['params']['id']},'order':_0xcd4d('0x66')});}})[_0xcd4d('0x22')](handleEntityNotFound(_0x57db73,null))[_0xcd4d('0x22')](function(_0x5ca0c3){if(_0x5ca0c3){_0xec8342=_0x5ca0c3;var _0x31e635={};for(var _0x44558a=0x0,_0x2da965=_0xec8342[_0xcd4d('0x37')];_0x44558a<_0x2da965;_0x44558a++){if(!_0x31e635[_0xcd4d('0x38')](_0xec8342[_0x44558a]['questionId'])){_0x31e635[_0xec8342[_0x44558a][_0xcd4d('0x67')]]=needsEncapsulation(_0xec8342[_0x44558a]['question'])?encapsulate(_0xec8342[_0x44558a][_0xcd4d('0x68')]):_0xec8342[_0x44558a][_0xcd4d('0x68')];}}var _0x16a12e=[],_0x15fac0={};for(var _0x455560=0x0,_0x4f843a=_0x72d76e['length'];_0x455560<_0x4f843a;_0x455560++){_0x15fac0={'ProjectId':_0x594668['params']['id'],'SessionId':_0x72d76e[_0x455560]['id'],'StartTime':moment(_0x72d76e[_0x455560][_0xcd4d('0x64')])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x452871=0x0,_0x5f2ee6=_0xec8342[_0xcd4d('0x37')];_0x452871<_0x5f2ee6;_0x452871++){if(_0xec8342[_0x452871][_0xcd4d('0x69')]==_0x72d76e[_0x455560]['id']&&_0x31e635[_0xcd4d('0x38')](_0xec8342[_0x452871][_0xcd4d('0x67')])){_0x15fac0[_0x31e635[_0xec8342[_0x452871][_0xcd4d('0x67')]]]=_0xec8342[_0x452871][_0xcd4d('0x6a')];}}for(var _0x181940 in _0x31e635){if(!_0x15fac0[_0xcd4d('0x38')](_0x31e635[_0x181940])){_0x15fac0[_0x31e635[_0x181940]]=null;}}_0x16a12e[_0xcd4d('0x6b')](_0x15fac0);}return _0x16a12e;}})[_0xcd4d('0x22')](function(_0x417e7d){if(!_['isEmpty'](_0x417e7d)){var _0x32227e=toCsv(_0x417e7d);var _0x5bc82c=Date[_0xcd4d('0x6c')]();fs[_0xcd4d('0x6d')](util[_0xcd4d('0x6e')](_0xcd4d('0x6f'),_0x594668[_0xcd4d('0x52')]['id'],_0x5bc82c),_0x32227e);_0x57db73['setHeader'](_0xcd4d('0x70'),'attachment;\x20filename='+util[_0xcd4d('0x6e')](_0xcd4d('0x71'),_0x594668['params']['id'],_0x5bc82c));_0x57db73[_0xcd4d('0x72')](_0xcd4d('0x73'),_0xcd4d('0x74'));return _0x57db73[_0xcd4d('0x75')](util[_0xcd4d('0x6e')](_0xcd4d('0x6f'),_0x594668[_0xcd4d('0x52')]['id'],_0x5bc82c));}else{return _0x57db73[_0xcd4d('0x76')](0xcc);}})[_0xcd4d('0x43')](handleError(_0x57db73,null));}; \ No newline at end of file +var _0xaa2d=['show','keys','attributes','intersection','merge','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','params','omit','createdAt','updatedAt','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','JscriptySessionReport','order','ProjectId','findAll','getAnswers','JscriptyAnswerReport','hasOwnProperty','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','-createdAt','questionId','question','format','SessionId','answer','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','rimraf','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Projects','UserProfileResource','stack','name','index','JscriptyProject','rawAttributes','fieldName','type','model','map','query','filters','fields','length','nolimit','sort','pick','filter','where','VIRTUAL','options','includeAll','include','rows'];(function(_0x37d4ac,_0x4e47d6){var _0x5e727a=function(_0x5adbff){while(--_0x5adbff){_0x37d4ac['push'](_0x37d4ac['shift']());}};_0x5e727a(++_0x4e47d6);}(_0xaa2d,0x11c));var _0xdaa2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa2d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdaa2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdaa2('0x1'));var BPromise=require(_0xdaa2('0x2'));var Mustache=require(_0xdaa2('0x3'));var util=require('util');var path=require(_0xdaa2('0x4'));var sox=require(_0xdaa2('0x5'));var csv=require(_0xdaa2('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdaa2('0x7'));var squel=require('squel');var crypto=require(_0xdaa2('0x8'));var jsforce=require(_0xdaa2('0x9'));var deskjs=require(_0xdaa2('0xa'));var toCsv=require('to-csv');var querystring=require(_0xdaa2('0xb'));var Papa=require(_0xdaa2('0xc'));var Redis=require(_0xdaa2('0xd'));var authService=require(_0xdaa2('0xe'));var qs=require(_0xdaa2('0xf'));var as=require(_0xdaa2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdaa2('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdaa2('0x12'))['db'];function respondWithStatusCode(_0x3c91fa,_0x5c2797){_0x5c2797=_0x5c2797||0xcc;return function(_0x3e6a73){if(_0x3e6a73){return _0x3c91fa[_0xdaa2('0x13')](_0x5c2797);}return _0x3c91fa[_0xdaa2('0x14')](_0x5c2797)[_0xdaa2('0x15')]();};}function respondWithResult(_0x32172b,_0x878f25){_0x878f25=_0x878f25||0xc8;return function(_0x29bc7b){if(_0x29bc7b){return _0x32172b[_0xdaa2('0x14')](_0x878f25)[_0xdaa2('0x16')](_0x29bc7b);}};}function respondWithFilteredResult(_0x2585db,_0x185857){return function(_0x262ce4){if(_0x262ce4){var _0x1970fe=typeof _0x185857[_0xdaa2('0x17')]===_0xdaa2('0x18')&&typeof _0x185857[_0xdaa2('0x19')]==='undefined';var _0x199f80=_0x262ce4['count'];var _0x303391=_0x1970fe?0x0:_0x185857['offset'];var _0x3b56c8=_0x1970fe?_0x262ce4[_0xdaa2('0x1a')]:_0x185857[_0xdaa2('0x17')]+_0x185857['limit'];var _0x22a76b;if(_0x3b56c8>=_0x199f80){_0x3b56c8=_0x199f80;_0x22a76b=0xc8;}else{_0x22a76b=0xce;}_0x2585db[_0xdaa2('0x14')](_0x22a76b);return _0x2585db[_0xdaa2('0x1b')](_0xdaa2('0x1c'),_0x303391+'-'+_0x3b56c8+'/'+_0x199f80)[_0xdaa2('0x16')](_0x262ce4);}return null;};}function patchUpdates(_0x391808){return function(_0x2d9a81){try{jsonpatch[_0xdaa2('0x1d')](_0x2d9a81,_0x391808,!![]);}catch(_0x4ba73d){return BPromise[_0xdaa2('0x1e')](_0x4ba73d);}return _0x2d9a81[_0xdaa2('0x1f')]();};}function saveUpdates(_0x3e93e1,_0x3d36bb){return function(_0x5893f7){if(_0x5893f7){return _0x5893f7[_0xdaa2('0x20')](_0x3e93e1)['then'](function(_0x40ae26){return _0x40ae26;});}return null;};}function removeEntity(_0x43e2ec,_0x470242){return function(_0x1c1a6a){if(_0x1c1a6a){return _0x1c1a6a[_0xdaa2('0x21')]()[_0xdaa2('0x22')](function(){var _0x36d005=_0x1c1a6a[_0xdaa2('0x23')]({'plain':!![]});var _0x5e9646=_0xdaa2('0x24');return db[_0xdaa2('0x25')]['destroy']({'where':{'type':_0x5e9646,'resourceId':_0x36d005['id']}})[_0xdaa2('0x22')](function(){return _0x1c1a6a;});})[_0xdaa2('0x22')](function(){_0x43e2ec[_0xdaa2('0x14')](0xcc)[_0xdaa2('0x15')]();});}};}function handleEntityNotFound(_0x492797,_0x12cb4f){return function(_0xfc982d){if(!_0xfc982d){_0x492797[_0xdaa2('0x13')](0x194);}return _0xfc982d;};}function handleError(_0x54f91d,_0x489961){_0x489961=_0x489961||0x1f4;return function(_0x5e7380){logger['error'](_0x5e7380[_0xdaa2('0x26')]);if(_0x5e7380[_0xdaa2('0x27')]){delete _0x5e7380[_0xdaa2('0x27')];}_0x54f91d[_0xdaa2('0x14')](_0x489961)['send'](_0x5e7380);};}exports[_0xdaa2('0x28')]=function(_0x56fd7c,_0x550c28){var _0x356832={},_0x225b1a={},_0x27f456={'count':0x0,'rows':[]};var _0x1d3c16=_['map'](db[_0xdaa2('0x29')][_0xdaa2('0x2a')],function(_0x586742){return{'name':_0x586742[_0xdaa2('0x2b')],'type':_0x586742[_0xdaa2('0x2c')]['key']};});_0x225b1a[_0xdaa2('0x2d')]=_[_0xdaa2('0x2e')](_0x1d3c16,_0xdaa2('0x27'));_0x225b1a[_0xdaa2('0x2f')]=_['keys'](_0x56fd7c[_0xdaa2('0x2f')]);_0x225b1a[_0xdaa2('0x30')]=_['intersection'](_0x225b1a[_0xdaa2('0x2d')],_0x225b1a[_0xdaa2('0x2f')]);_0x356832['attributes']=_['intersection'](_0x225b1a['model'],qs[_0xdaa2('0x31')](_0x56fd7c[_0xdaa2('0x2f')][_0xdaa2('0x31')]));_0x356832['attributes']=_0x356832['attributes'][_0xdaa2('0x32')]?_0x356832['attributes']:_0x225b1a[_0xdaa2('0x2d')];if(!_0x56fd7c[_0xdaa2('0x2f')]['hasOwnProperty'](_0xdaa2('0x33'))){_0x356832[_0xdaa2('0x19')]=qs[_0xdaa2('0x19')](_0x56fd7c[_0xdaa2('0x2f')][_0xdaa2('0x19')]);_0x356832[_0xdaa2('0x17')]=qs[_0xdaa2('0x17')](_0x56fd7c[_0xdaa2('0x2f')][_0xdaa2('0x17')]);}_0x356832['order']=qs[_0xdaa2('0x34')](_0x56fd7c[_0xdaa2('0x2f')]['sort']);_0x356832['where']=qs[_0xdaa2('0x30')](_[_0xdaa2('0x35')](_0x56fd7c[_0xdaa2('0x2f')],_0x225b1a[_0xdaa2('0x30')]),_0x1d3c16);if(_0x56fd7c[_0xdaa2('0x2f')][_0xdaa2('0x36')]){_0x356832[_0xdaa2('0x37')]=_['merge'](_0x356832[_0xdaa2('0x37')],{'$or':_[_0xdaa2('0x2e')](_0x1d3c16,function(_0x37371e){if(_0x37371e[_0xdaa2('0x2c')]!==_0xdaa2('0x38')){var _0xa016cc={};_0xa016cc[_0x37371e['name']]={'$like':'%'+_0x56fd7c[_0xdaa2('0x2f')][_0xdaa2('0x36')]+'%'};return _0xa016cc;}})});}_0x356832=_['merge']({},_0x356832,_0x56fd7c[_0xdaa2('0x39')]);var _0x205c1c={'where':_0x356832[_0xdaa2('0x37')]};return db[_0xdaa2('0x29')][_0xdaa2('0x1a')](_0x205c1c)[_0xdaa2('0x22')](function(_0x484f87){_0x27f456[_0xdaa2('0x1a')]=_0x484f87;if(_0x56fd7c['query'][_0xdaa2('0x3a')]){_0x356832[_0xdaa2('0x3b')]=[{'all':!![]}];}return db[_0xdaa2('0x29')]['findAll'](_0x356832);})[_0xdaa2('0x22')](function(_0x31f362){_0x27f456[_0xdaa2('0x3c')]=_0x31f362;return _0x27f456;})['then'](respondWithFilteredResult(_0x550c28,_0x356832))['catch'](handleError(_0x550c28,null));};exports[_0xdaa2('0x3d')]=function(_0x2039a8,_0x359b8e){var _0x3aa19e={'raw':![],'where':{'id':_0x2039a8['params']['id']}},_0x1a26ed={};_0x1a26ed[_0xdaa2('0x2d')]=_['keys'](db[_0xdaa2('0x29')][_0xdaa2('0x2a')]);_0x1a26ed[_0xdaa2('0x2f')]=_[_0xdaa2('0x3e')](_0x2039a8[_0xdaa2('0x2f')]);_0x1a26ed[_0xdaa2('0x30')]=_['intersection'](_0x1a26ed['model'],_0x1a26ed[_0xdaa2('0x2f')]);_0x3aa19e[_0xdaa2('0x3f')]=_[_0xdaa2('0x40')](_0x1a26ed['model'],qs[_0xdaa2('0x31')](_0x2039a8['query'][_0xdaa2('0x31')]));_0x3aa19e[_0xdaa2('0x3f')]=_0x3aa19e[_0xdaa2('0x3f')]['length']?_0x3aa19e[_0xdaa2('0x3f')]:_0x1a26ed[_0xdaa2('0x2d')];if(_0x2039a8[_0xdaa2('0x2f')]['includeAll']){_0x3aa19e[_0xdaa2('0x3b')]=[{'all':!![]}];}_0x3aa19e=_[_0xdaa2('0x41')]({},_0x3aa19e,_0x2039a8[_0xdaa2('0x39')]);return db['JscriptyProject'][_0xdaa2('0x42')](_0x3aa19e)[_0xdaa2('0x22')](handleEntityNotFound(_0x359b8e,null))[_0xdaa2('0x22')](respondWithResult(_0x359b8e,null))[_0xdaa2('0x43')](handleError(_0x359b8e,null));};exports['create']=function(_0x254a7b,_0x1966ad){return db[_0xdaa2('0x29')][_0xdaa2('0x44')](_0x254a7b[_0xdaa2('0x45')],{})['then'](function(_0x15f2d8){var _0x1ec228=_0x254a7b['user'][_0xdaa2('0x23')]({'plain':!![]});if(!_0x1ec228)throw new Error(_0xdaa2('0x46'));if(_0x1ec228[_0xdaa2('0x47')]==='user'){var _0x78bb5b=_0x15f2d8[_0xdaa2('0x23')]({'plain':!![]});var _0x5f20ab=_0xdaa2('0x24');return db[_0xdaa2('0x48')][_0xdaa2('0x42')]({'where':{'name':_0x5f20ab,'userProfileId':_0x1ec228[_0xdaa2('0x49')]},'raw':!![]})[_0xdaa2('0x22')](function(_0x28bc5d){if(_0x28bc5d&&_0x28bc5d[_0xdaa2('0x4a')]===0x0){return db[_0xdaa2('0x25')][_0xdaa2('0x44')]({'name':_0x78bb5b[_0xdaa2('0x27')],'resourceId':_0x78bb5b['id'],'type':_0x28bc5d[_0xdaa2('0x27')],'sectionId':_0x28bc5d['id']},{})['then'](function(){return _0x15f2d8;});}else{return _0x15f2d8;}})[_0xdaa2('0x43')](function(_0x26f69b){logger[_0xdaa2('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x26f69b);throw _0x26f69b;});}return _0x15f2d8;})['then'](respondWithResult(_0x1966ad,0xc9))[_0xdaa2('0x43')](handleError(_0x1966ad,null));};exports['clone']=function(_0x5a9291,_0x52e3d0){var _0x25c095={'where':{'id':_0x5a9291[_0xdaa2('0x4c')]['id']}},_0x239fb1={};_0x239fb1[_0xdaa2('0x2d')]=_['keys'](db['JscriptyProject'][_0xdaa2('0x2a')]);_0x25c095['attributes']=_[_0xdaa2('0x40')](_0x239fb1[_0xdaa2('0x2d')],qs[_0xdaa2('0x31')](_0x5a9291[_0xdaa2('0x2f')][_0xdaa2('0x31')]));_0x25c095['attributes']=_0x25c095[_0xdaa2('0x3f')][_0xdaa2('0x32')]?_0x25c095[_0xdaa2('0x3f')]:_0x239fb1[_0xdaa2('0x2d')];if(_0x5a9291[_0xdaa2('0x2f')][_0xdaa2('0x3a')]){_0x25c095[_0xdaa2('0x3b')]=[{'all':!![]}];}_0x25c095=_[_0xdaa2('0x41')]({},_0x25c095,_0x5a9291[_0xdaa2('0x39')]);return db[_0xdaa2('0x29')][_0xdaa2('0x42')](_0x25c095)[_0xdaa2('0x22')](handleEntityNotFound(_0x52e3d0,null))[_0xdaa2('0x22')](function(_0x409d39){if(_0x409d39){var _0x39fad3=_0x409d39[_0xdaa2('0x23')]({'plain':!![]});_0x39fad3=qs[_0xdaa2('0x4d')](_0x39fad3,['id',_0xdaa2('0x4e'),_0xdaa2('0x4f')]);_0x5a9291[_0xdaa2('0x45')]=_[_0xdaa2('0x4d')](_0x5a9291[_0xdaa2('0x45')],['id',_0xdaa2('0x4e'),_0xdaa2('0x4f')]);return db['JscriptyProject'][_0xdaa2('0x44')](_[_0xdaa2('0x41')](_0x39fad3,_0x5a9291[_0xdaa2('0x45')]),{'include':_0x5a9291[_0xdaa2('0x2f')][_0xdaa2('0x3a')]?[{'all':!![]}]:undefined})[_0xdaa2('0x22')](function(_0x35dd76){var _0x5652d6=_0x5a9291[_0xdaa2('0x50')][_0xdaa2('0x23')]({'plain':!![]});if(!_0x5652d6)throw new Error(_0xdaa2('0x46'));if(_0x5652d6[_0xdaa2('0x47')]===_0xdaa2('0x50')){var _0x5d43ef=_0x35dd76[_0xdaa2('0x23')]({'plain':!![]});var _0x1f8a3a=_0xdaa2('0x24');return db[_0xdaa2('0x48')][_0xdaa2('0x42')]({'where':{'name':_0x1f8a3a,'userProfileId':_0x5652d6[_0xdaa2('0x49')]},'raw':!![]})[_0xdaa2('0x22')](function(_0x493337){if(_0x493337&&_0x493337[_0xdaa2('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x5d43ef[_0xdaa2('0x27')],'resourceId':_0x5d43ef['id'],'type':_0x493337[_0xdaa2('0x27')],'sectionId':_0x493337['id']},{})[_0xdaa2('0x22')](function(){return _0x35dd76;});}else{return _0x35dd76;}})[_0xdaa2('0x43')](function(_0x4531a7){logger['error'](_0xdaa2('0x51'),_0x4531a7);throw _0x4531a7;});}return _0x35dd76;});}})[_0xdaa2('0x22')](respondWithResult(_0x52e3d0,0xc9))[_0xdaa2('0x43')](handleError(_0x52e3d0,null));};exports[_0xdaa2('0x20')]=function(_0x4ec8ce,_0x57604e){if(_0x4ec8ce['body']['id']){delete _0x4ec8ce[_0xdaa2('0x45')]['id'];}return db[_0xdaa2('0x29')][_0xdaa2('0x42')]({'where':{'id':_0x4ec8ce[_0xdaa2('0x4c')]['id']}})[_0xdaa2('0x22')](handleEntityNotFound(_0x57604e,null))[_0xdaa2('0x22')](saveUpdates(_0x4ec8ce['body'],null))[_0xdaa2('0x22')](respondWithResult(_0x57604e,null))['catch'](handleError(_0x57604e,null));};exports['destroy']=function(_0x30b289,_0x3f33ff){return db[_0xdaa2('0x29')][_0xdaa2('0x42')]({'where':{'id':_0x30b289[_0xdaa2('0x4c')]['id']}})[_0xdaa2('0x22')](handleEntityNotFound(_0x3f33ff,null))[_0xdaa2('0x22')](removeEntity(_0x3f33ff,null))[_0xdaa2('0x43')](handleError(_0x3f33ff,null));};exports[_0xdaa2('0x52')]=function(_0xdef8f6,_0x271a36,_0x568ed6){var _0x224f1c={'raw':!![],'where':{}};var _0x59bb12={};var _0xfa2648={'count':0x0,'rows':[]};return db[_0xdaa2('0x29')][_0xdaa2('0x53')]({'where':{'id':_0xdef8f6['params']['id']}})[_0xdaa2('0x22')](handleEntityNotFound(_0x271a36,null))[_0xdaa2('0x22')](function(_0x568254){if(_0x568254){_0x59bb12[_0xdaa2('0x2d')]=_[_0xdaa2('0x3e')](db[_0xdaa2('0x54')][_0xdaa2('0x2a')]);_0x59bb12[_0xdaa2('0x2f')]=_[_0xdaa2('0x3e')](_0xdef8f6['query']);_0x59bb12[_0xdaa2('0x30')]=_['intersection'](_0x59bb12[_0xdaa2('0x2d')],_0x59bb12['query']);_0x224f1c['attributes']=_['intersection'](_0x59bb12['model'],qs[_0xdaa2('0x31')](_0xdef8f6[_0xdaa2('0x2f')]['fields']));_0x224f1c['attributes']=_0x224f1c[_0xdaa2('0x3f')][_0xdaa2('0x32')]?_0x224f1c[_0xdaa2('0x3f')]:_0x59bb12['model'];if(!_0xdef8f6[_0xdaa2('0x2f')]['hasOwnProperty']('nolimit')){_0x224f1c['limit']=qs['limit'](_0xdef8f6[_0xdaa2('0x2f')]['limit']);_0x224f1c[_0xdaa2('0x17')]=qs[_0xdaa2('0x17')](_0xdef8f6[_0xdaa2('0x2f')][_0xdaa2('0x17')]);}_0x224f1c[_0xdaa2('0x55')]=qs[_0xdaa2('0x34')](_0xdef8f6['query'][_0xdaa2('0x34')]);_0x224f1c['where']=qs[_0xdaa2('0x30')](_[_0xdaa2('0x35')](_0xdef8f6[_0xdaa2('0x2f')],_0x59bb12[_0xdaa2('0x30')]));_0x224f1c[_0xdaa2('0x37')][_0xdaa2('0x56')]=_0x568254['id'];if(_0xdef8f6['query'][_0xdaa2('0x36')]){_0x224f1c[_0xdaa2('0x37')]=_[_0xdaa2('0x41')](_0x224f1c[_0xdaa2('0x37')],{'$or':_[_0xdaa2('0x2e')](_0x224f1c[_0xdaa2('0x3f')],function(_0x361f0a){var _0x57a869={};_0x57a869[_0x361f0a]={'$like':'%'+_0xdef8f6[_0xdaa2('0x2f')]['filter']+'%'};return _0x57a869;})});}_0x224f1c=_[_0xdaa2('0x41')]({},_0x224f1c,_0xdef8f6[_0xdaa2('0x39')]);return db[_0xdaa2('0x54')]['count']({'where':_0x224f1c[_0xdaa2('0x37')]})[_0xdaa2('0x22')](function(_0x2f4192){_0xfa2648[_0xdaa2('0x1a')]=_0x2f4192;if(_0xdef8f6['query'][_0xdaa2('0x3a')]){_0x224f1c[_0xdaa2('0x3b')]=[{'all':!![]}];}return db[_0xdaa2('0x54')][_0xdaa2('0x57')](_0x224f1c);})['then'](function(_0x1d9ebb){_0xfa2648['rows']=_0x1d9ebb;return _0xfa2648;});}})[_0xdaa2('0x22')](respondWithFilteredResult(_0x271a36,_0x224f1c))['catch'](handleError(_0x271a36,null));};exports[_0xdaa2('0x58')]=function(_0x8ac361,_0x269358,_0x119f4a){var _0x3da14c={'raw':!![],'where':{}};var _0x281946={};var _0xa4a444={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xdaa2('0x53')]({'where':{'id':_0x8ac361[_0xdaa2('0x4c')]['id']}})[_0xdaa2('0x22')](handleEntityNotFound(_0x269358,null))['then'](function(_0x29775b){if(_0x29775b){_0x281946[_0xdaa2('0x2d')]=_['keys'](db[_0xdaa2('0x59')]['rawAttributes']);_0x281946[_0xdaa2('0x2f')]=_['keys'](_0x8ac361[_0xdaa2('0x2f')]);_0x281946[_0xdaa2('0x30')]=_[_0xdaa2('0x40')](_0x281946[_0xdaa2('0x2d')],_0x281946[_0xdaa2('0x2f')]);_0x3da14c['attributes']=_['intersection'](_0x281946[_0xdaa2('0x2d')],qs[_0xdaa2('0x31')](_0x8ac361[_0xdaa2('0x2f')][_0xdaa2('0x31')]));_0x3da14c[_0xdaa2('0x3f')]=_0x3da14c[_0xdaa2('0x3f')]['length']?_0x3da14c[_0xdaa2('0x3f')]:_0x281946['model'];if(!_0x8ac361[_0xdaa2('0x2f')][_0xdaa2('0x5a')](_0xdaa2('0x33'))){_0x3da14c[_0xdaa2('0x19')]=qs[_0xdaa2('0x19')](_0x8ac361[_0xdaa2('0x2f')][_0xdaa2('0x19')]);_0x3da14c[_0xdaa2('0x17')]=qs[_0xdaa2('0x17')](_0x8ac361['query'][_0xdaa2('0x17')]);}_0x3da14c[_0xdaa2('0x55')]=qs['sort'](_0x8ac361[_0xdaa2('0x2f')][_0xdaa2('0x34')]);_0x3da14c[_0xdaa2('0x37')]=qs[_0xdaa2('0x30')](_['pick'](_0x8ac361['query'],_0x281946[_0xdaa2('0x30')]));_0x3da14c[_0xdaa2('0x37')][_0xdaa2('0x56')]=_0x29775b['id'];if(_0x8ac361[_0xdaa2('0x2f')][_0xdaa2('0x36')]){_0x3da14c['where']=_[_0xdaa2('0x41')](_0x3da14c['where'],{'$or':_[_0xdaa2('0x2e')](_0x3da14c[_0xdaa2('0x3f')],function(_0x2c009c){var _0x551922={};_0x551922[_0x2c009c]={'$like':'%'+_0x8ac361['query'][_0xdaa2('0x36')]+'%'};return _0x551922;})});}_0x3da14c=_[_0xdaa2('0x41')]({},_0x3da14c,_0x8ac361['options']);return db[_0xdaa2('0x59')]['count']({'where':_0x3da14c['where']})[_0xdaa2('0x22')](function(_0x366858){_0xa4a444['count']=_0x366858;if(_0x8ac361[_0xdaa2('0x2f')][_0xdaa2('0x3a')]){_0x3da14c[_0xdaa2('0x3b')]=[{'all':!![]}];}return db[_0xdaa2('0x59')]['findAll'](_0x3da14c);})[_0xdaa2('0x22')](function(_0x338d10){_0xa4a444['rows']=_0x338d10;return _0xa4a444;});}})['then'](respondWithFilteredResult(_0x269358,_0x3da14c))[_0xdaa2('0x43')](handleError(_0x269358,null));};function char(_0x563919){return _0xdaa2('0x5b')===typeof _0x563919?String[_0xdaa2('0x5c')][_0xdaa2('0x1d')](null,arguments):_0x563919;}function needsEncapsulation(_0x48c92e){return!!_0x48c92e&&(_0x48c92e[_0xdaa2('0x5d')]()[_0xdaa2('0x5e')](char(0xd))>=0x0||_0x48c92e['toString']()[_0xdaa2('0x5e')](char(0xa))>=0x0||_0x48c92e[_0xdaa2('0x5d')]()[_0xdaa2('0x5e')](char(0x2c))>=0x0||_0x48c92e['toString']()[_0xdaa2('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x16e8c5){var _0x2ba7d5=char(0x22),_0x4f42ba='\x5c'+char(0x22),_0x4a30c3=_0x16e8c5['toString']()[_0xdaa2('0x5f')](new RegExp(_0x2ba7d5,'g'),_0x4f42ba);return _0x2ba7d5+_0x4a30c3+_0x2ba7d5;}exports[_0xdaa2('0x60')]=function(_0x56c6fe,_0x361d40,_0x44a81a){var _0x996ca0,_0x3eaee1;var _0x28c921={'where':{'ProjectId':_0x56c6fe[_0xdaa2('0x4c')]['id']}};if(_0x56c6fe['query'][_0xdaa2('0x61')]){_0x28c921[_0xdaa2('0x37')][_0xdaa2('0x62')]=JSON[_0xdaa2('0x63')](_0x56c6fe[_0xdaa2('0x2f')][_0xdaa2('0x61')]);}return db[_0xdaa2('0x54')][_0xdaa2('0x57')](_0x28c921)[_0xdaa2('0x22')](handleEntityNotFound(_0x361d40,null))[_0xdaa2('0x22')](function(_0x515a04){if(_0x515a04){_0x996ca0=_0x515a04;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_['map'](_0x996ca0,'id')},'ProjectId':_0x56c6fe[_0xdaa2('0x4c')]['id']},'order':_0xdaa2('0x64')});}})[_0xdaa2('0x22')](handleEntityNotFound(_0x361d40,null))['then'](function(_0x199cc9){if(_0x199cc9){_0x3eaee1=_0x199cc9;var _0x246602={};for(var _0x407553=0x0,_0x343fb8=_0x3eaee1[_0xdaa2('0x32')];_0x407553<_0x343fb8;_0x407553++){if(!_0x246602[_0xdaa2('0x5a')](_0x3eaee1[_0x407553][_0xdaa2('0x65')])){_0x246602[_0x3eaee1[_0x407553][_0xdaa2('0x65')]]=needsEncapsulation(_0x3eaee1[_0x407553][_0xdaa2('0x66')])?encapsulate(_0x3eaee1[_0x407553][_0xdaa2('0x66')]):_0x3eaee1[_0x407553][_0xdaa2('0x66')];}}var _0x2fe3c8=[],_0x374d70={};for(var _0x4ada13=0x0,_0x2c5d6a=_0x996ca0[_0xdaa2('0x32')];_0x4ada13<_0x2c5d6a;_0x4ada13++){_0x374d70={'ProjectId':_0x56c6fe[_0xdaa2('0x4c')]['id'],'SessionId':_0x996ca0[_0x4ada13]['id'],'StartTime':moment(_0x996ca0[_0x4ada13][_0xdaa2('0x62')])[_0xdaa2('0x67')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x57b3ec=0x0,_0x132820=_0x3eaee1[_0xdaa2('0x32')];_0x57b3ec<_0x132820;_0x57b3ec++){if(_0x3eaee1[_0x57b3ec][_0xdaa2('0x68')]==_0x996ca0[_0x4ada13]['id']&&_0x246602[_0xdaa2('0x5a')](_0x3eaee1[_0x57b3ec]['questionId'])){_0x374d70[_0x246602[_0x3eaee1[_0x57b3ec][_0xdaa2('0x65')]]]=_0x3eaee1[_0x57b3ec][_0xdaa2('0x69')];}}for(var _0x2530cb in _0x246602){if(!_0x374d70[_0xdaa2('0x5a')](_0x246602[_0x2530cb])){_0x374d70[_0x246602[_0x2530cb]]=null;}}_0x2fe3c8[_0xdaa2('0x6a')](_0x374d70);}return _0x2fe3c8;}})['then'](function(_0x371e47){if(!_['isEmpty'](_0x371e47)){var _0x37577f=toCsv(_0x371e47);var _0x3ff486=Date[_0xdaa2('0x6b')]();fs[_0xdaa2('0x6c')](util[_0xdaa2('0x67')](_0xdaa2('0x6d'),_0x56c6fe[_0xdaa2('0x4c')]['id'],_0x3ff486),_0x37577f);_0x361d40['setHeader']('Content-disposition','attachment;\x20filename='+util[_0xdaa2('0x67')](_0xdaa2('0x6e'),_0x56c6fe[_0xdaa2('0x4c')]['id'],_0x3ff486));_0x361d40[_0xdaa2('0x6f')](_0xdaa2('0x70'),_0xdaa2('0x71'));return _0x361d40[_0xdaa2('0x72')](util[_0xdaa2('0x67')](_0xdaa2('0x6d'),_0x56c6fe[_0xdaa2('0x4c')]['id'],_0x3ff486));}else{return _0x361d40[_0xdaa2('0x13')](0xcc);}})['catch'](handleError(_0x361d40,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 70cbea6..e1b1337 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 _0x425d=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./jscriptyProject.attributes','exports','define','JscriptyProject'];(function(_0x5e922c,_0x11e77b){var _0x1fee3e=function(_0x20c5e9){while(--_0x20c5e9){_0x5e922c['push'](_0x5e922c['shift']());}};_0x1fee3e(++_0x11e77b);}(_0x425d,0x1e0));var _0xd425=function(_0x4fc938,_0xd13e77){_0x4fc938=_0x4fc938-0x0;var _0xa01304=_0x425d[_0x4fc938];return _0xa01304;};'use strict';var _=require(_0xd425('0x0'));var util=require('util');var logger=require(_0xd425('0x1'))(_0xd425('0x2'));var moment=require(_0xd425('0x3'));var BPromise=require(_0xd425('0x4'));var rp=require(_0xd425('0x5'));var fs=require('fs');var path=require(_0xd425('0x6'));var rimraf=require(_0xd425('0x7'));var config=require('../../config/environment');var attributes=require(_0xd425('0x8'));module[_0xd425('0x9')]=function(_0xc4e080,_0x36866e){return _0xc4e080[_0xd425('0xa')](_0xd425('0xb'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ba0=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x8ba0,0x1c7));var _0x08ba=function(_0x210065,_0xcfa31b){_0x210065=_0x210065-0x0;var _0x40867f=_0x8ba0[_0x210065];return _0x40867f;};'use strict';var _=require(_0x08ba('0x0'));var util=require(_0x08ba('0x1'));var logger=require(_0x08ba('0x2'))(_0x08ba('0x3'));var moment=require(_0x08ba('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x08ba('0x5'));var rimraf=require(_0x08ba('0x6'));var config=require(_0x08ba('0x7'));var attributes=require(_0x08ba('0x8'));module[_0x08ba('0x9')]=function(_0x161a9d,_0x5f29fa){return _0x161a9d[_0x08ba('0xa')](_0x08ba('0xb'),attributes,{'tableName':_0x08ba('0xc'),'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 8f3a89e..5830a0f 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdb7=['request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','JscriptyProject,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x165718,_0x49ae0b){_0x165718=_0x165718-0x0;var _0x2e57b2=_0xbdb7[_0x165718];return _0x2e57b2;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file +var _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(_0x18cf86,_0xfb299){var _0x1af149=function(_0x2cb007){while(--_0x2cb007){_0x18cf86['push'](_0x18cf86['shift']());}};_0x1af149(++_0xfb299);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 8acc38b..0fed8ea 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 _0x1253=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','describe','get','show','post','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4f40da,_0x305976){var _0x43eab8=function(_0x6ab90d){while(--_0x6ab90d){_0x4f40da['push'](_0x4f40da['shift']());}};_0x43eab8(++_0x305976);}(_0x1253,0x18b));var _0x3125=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x1253[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x3125('0x0'));var util=require(_0x3125('0x1'));var path=require(_0x3125('0x2'));var timeout=require(_0x3125('0x3'));var express=require(_0x3125('0x4'));var router=express[_0x3125('0x5')]();var fs_extra=require(_0x3125('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3125('0x7'));var config=require(_0x3125('0x8'));var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth[_0x3125('0x9')](),controller['index']);router['get']('/describe',auth[_0x3125('0x9')](),controller[_0x3125('0xa')]);router[_0x3125('0xb')]('/:id',auth[_0x3125('0x9')](),controller[_0x3125('0xc')]);router[_0x3125('0xd')]('/',auth[_0x3125('0x9')](),controller['create']);router[_0x3125('0xe')](_0x3125('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x3125('0x10')](_0x3125('0xf'),auth[_0x3125('0x9')](),controller[_0x3125('0x11')]);module[_0x3125('0x12')]=router; \ No newline at end of file +var _0xb20b=['/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x10783c,_0x20e9e9){var _0x4747df=function(_0x54798a){while(--_0x54798a){_0x10783c['push'](_0x10783c['shift']());}};_0x4747df(++_0x20e9e9);}(_0xb20b,0x105));var _0xbb20=function(_0x4d9bfe,_0x4c30cf){_0x4d9bfe=_0x4d9bfe-0x0;var _0xbbae7b=_0xb20b[_0x4d9bfe];return _0xbbae7b;};'use strict';var multer=require(_0xbb20('0x0'));var util=require(_0xbb20('0x1'));var path=require(_0xbb20('0x2'));var timeout=require(_0xbb20('0x3'));var express=require(_0xbb20('0x4'));var router=express[_0xbb20('0x5')]();var fs_extra=require(_0xbb20('0x6'));var auth=require(_0xbb20('0x7'));var interaction=require(_0xbb20('0x8'));var config=require('../../config/environment');var controller=require(_0xbb20('0x9'));router[_0xbb20('0xa')]('/',auth[_0xbb20('0xb')](),controller[_0xbb20('0xc')]);router[_0xbb20('0xa')](_0xbb20('0xd'),auth[_0xbb20('0xb')](),controller[_0xbb20('0xe')]);router[_0xbb20('0xa')](_0xbb20('0xf'),auth['isAuthenticated'](),controller[_0xbb20('0x10')]);router[_0xbb20('0x11')]('/',auth[_0xbb20('0xb')](),controller[_0xbb20('0x12')]);router[_0xbb20('0x13')](_0xbb20('0xf'),auth[_0xbb20('0xb')](),controller['update']);router[_0xbb20('0x14')]('/:id',auth[_0xbb20('0xb')](),controller[_0xbb20('0x15')]);module[_0xbb20('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 4327ac9..8df9f7f 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(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x7a54,0x106));var _0x47a5=function(_0x2e2d2c,_0x34c9bb){_0x2e2d2c=_0x2e2d2c-0x0;var _0x54d952=_0x7a54[_0x2e2d2c];return _0x54d952;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x7a54,0x106));var _0x47a5=function(_0x1274e8,_0x1a2d1e){_0x1274e8=_0x1274e8-0x0;var _0x287918=_0x7a54[_0x1274e8];return _0x287918;};'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 d60104f..75dd53d 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 _0x75ff=['VIRTUAL','options','include','rows','catch','show','params','includeAll','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','then','destroy','error','stack','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge'];(function(_0x38fbc2,_0x641aa1){var _0x43c7d4=function(_0x45d3b9){while(--_0x45d3b9){_0x38fbc2['push'](_0x38fbc2['shift']());}};_0x43c7d4(++_0x641aa1);}(_0x75ff,0x131));var _0xf75f=function(_0x43d604,_0x38a6d3){_0x43d604=_0x43d604-0x0;var _0x2f0f74=_0x75ff[_0x43d604];return _0x2f0f74;};'use strict';var emlformat=require(_0xf75f('0x0'));var rimraf=require(_0xf75f('0x1'));var zipdir=require(_0xf75f('0x2'));var jsonpatch=require(_0xf75f('0x3'));var rp=require(_0xf75f('0x4'));var moment=require('moment');var BPromise=require(_0xf75f('0x5'));var Mustache=require(_0xf75f('0x6'));var util=require(_0xf75f('0x7'));var path=require('path');var sox=require(_0xf75f('0x8'));var csv=require(_0xf75f('0x9'));var ejs=require(_0xf75f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf75f('0xb'));var crypto=require('crypto');var jsforce=require(_0xf75f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf75f('0x9'));var querystring=require(_0xf75f('0xd'));var Papa=require(_0xf75f('0xe'));var Redis=require(_0xf75f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf75f('0x10'));var as=require(_0xf75f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf75f('0x12'));var utils=require(_0xf75f('0x13'));var config=require(_0xf75f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf75f('0x15'))['db'];function respondWithStatusCode(_0x173e95,_0x347426){_0x347426=_0x347426||0xcc;return function(_0x1c1a68){if(_0x1c1a68){return _0x173e95['sendStatus'](_0x347426);}return _0x173e95[_0xf75f('0x16')](_0x347426)[_0xf75f('0x17')]();};}function respondWithResult(_0x4890c9,_0x5b85d0){_0x5b85d0=_0x5b85d0||0xc8;return function(_0x5010fd){if(_0x5010fd){return _0x4890c9[_0xf75f('0x16')](_0x5b85d0)[_0xf75f('0x18')](_0x5010fd);}};}function respondWithFilteredResult(_0x3ceca3,_0x9d2141){return function(_0x44ea2b){if(_0x44ea2b){var _0x3cde60=typeof _0x9d2141['offset']==='undefined'&&typeof _0x9d2141[_0xf75f('0x19')]===_0xf75f('0x1a');var _0x3de07f=_0x44ea2b[_0xf75f('0x1b')];var _0xee7ae9=_0x3cde60?0x0:_0x9d2141[_0xf75f('0x1c')];var _0xe9a0b1=_0x3cde60?_0x44ea2b[_0xf75f('0x1b')]:_0x9d2141[_0xf75f('0x1c')]+_0x9d2141[_0xf75f('0x19')];var _0x4730cd;if(_0xe9a0b1>=_0x3de07f){_0xe9a0b1=_0x3de07f;_0x4730cd=0xc8;}else{_0x4730cd=0xce;}_0x3ceca3[_0xf75f('0x16')](_0x4730cd);return _0x3ceca3[_0xf75f('0x1d')]('Content-Range',_0xee7ae9+'-'+_0xe9a0b1+'/'+_0x3de07f)[_0xf75f('0x18')](_0x44ea2b);}return null;};}function patchUpdates(_0x2e8c2e){return function(_0x30d441){try{jsonpatch[_0xf75f('0x1e')](_0x30d441,_0x2e8c2e,!![]);}catch(_0x2f414e){return BPromise[_0xf75f('0x1f')](_0x2f414e);}return _0x30d441[_0xf75f('0x20')]();};}function saveUpdates(_0x53c13f,_0x406d84){return function(_0x55334e){if(_0x55334e){return _0x55334e['update'](_0x53c13f)[_0xf75f('0x21')](function(_0x19ce75){return _0x19ce75;});}return null;};}function removeEntity(_0x4cdd2a,_0x32734e){return function(_0x5425cf){if(_0x5425cf){return _0x5425cf[_0xf75f('0x22')]()['then'](function(){_0x4cdd2a[_0xf75f('0x16')](0xcc)[_0xf75f('0x17')]();});}};}function handleEntityNotFound(_0x64ce8c,_0x2dfeab){return function(_0xeebf18){if(!_0xeebf18){_0x64ce8c['sendStatus'](0x194);}return _0xeebf18;};}function handleError(_0x513bef,_0x320ddf){_0x320ddf=_0x320ddf||0x1f4;return function(_0x1209d5){logger[_0xf75f('0x23')](_0x1209d5[_0xf75f('0x24')]);if(_0x1209d5[_0xf75f('0x25')]){delete _0x1209d5[_0xf75f('0x25')];}_0x513bef['status'](_0x320ddf)['send'](_0x1209d5);};}exports[_0xf75f('0x26')]=function(_0xd314b1,_0x20ad0d){var _0x45bb9f={},_0x16d8e8={},_0x17d9e6={'count':0x0,'rows':[]};var _0x1ee394=_[_0xf75f('0x27')](db[_0xf75f('0x28')][_0xf75f('0x29')],function(_0x351eed){return{'name':_0x351eed[_0xf75f('0x2a')],'type':_0x351eed[_0xf75f('0x2b')][_0xf75f('0x2c')]};});_0x16d8e8['model']=_[_0xf75f('0x27')](_0x1ee394,'name');_0x16d8e8[_0xf75f('0x2d')]=_[_0xf75f('0x2e')](_0xd314b1[_0xf75f('0x2d')]);_0x16d8e8[_0xf75f('0x2f')]=_[_0xf75f('0x30')](_0x16d8e8[_0xf75f('0x31')],_0x16d8e8[_0xf75f('0x2d')]);_0x45bb9f[_0xf75f('0x32')]=_[_0xf75f('0x30')](_0x16d8e8[_0xf75f('0x31')],qs[_0xf75f('0x33')](_0xd314b1['query']['fields']));_0x45bb9f[_0xf75f('0x32')]=_0x45bb9f['attributes'][_0xf75f('0x34')]?_0x45bb9f[_0xf75f('0x32')]:_0x16d8e8[_0xf75f('0x31')];if(!_0xd314b1[_0xf75f('0x2d')]['hasOwnProperty'](_0xf75f('0x35'))){_0x45bb9f['limit']=qs[_0xf75f('0x19')](_0xd314b1[_0xf75f('0x2d')]['limit']);_0x45bb9f[_0xf75f('0x1c')]=qs[_0xf75f('0x1c')](_0xd314b1['query']['offset']);}_0x45bb9f[_0xf75f('0x36')]=qs[_0xf75f('0x37')](_0xd314b1[_0xf75f('0x2d')]['sort']);_0x45bb9f[_0xf75f('0x38')]=qs[_0xf75f('0x2f')](_[_0xf75f('0x39')](_0xd314b1[_0xf75f('0x2d')],_0x16d8e8['filters']),_0x1ee394);if(_0xd314b1[_0xf75f('0x2d')][_0xf75f('0x3a')]){_0x45bb9f[_0xf75f('0x38')]=_[_0xf75f('0x3b')](_0x45bb9f[_0xf75f('0x38')],{'$or':_['map'](_0x1ee394,function(_0x53d10e){if(_0x53d10e[_0xf75f('0x2b')]!==_0xf75f('0x3c')){var _0x2f0fd3={};_0x2f0fd3[_0x53d10e[_0xf75f('0x25')]]={'$like':'%'+_0xd314b1[_0xf75f('0x2d')]['filter']+'%'};return _0x2f0fd3;}})});}_0x45bb9f=_[_0xf75f('0x3b')]({},_0x45bb9f,_0xd314b1[_0xf75f('0x3d')]);var _0x240ee2={'where':_0x45bb9f[_0xf75f('0x38')]};return db[_0xf75f('0x28')][_0xf75f('0x1b')](_0x240ee2)[_0xf75f('0x21')](function(_0x48371c){_0x17d9e6[_0xf75f('0x1b')]=_0x48371c;if(_0xd314b1['query']['includeAll']){_0x45bb9f[_0xf75f('0x3e')]=[{'all':!![]}];}return db[_0xf75f('0x28')]['findAll'](_0x45bb9f);})[_0xf75f('0x21')](function(_0x15bb69){_0x17d9e6[_0xf75f('0x3f')]=_0x15bb69;return _0x17d9e6;})[_0xf75f('0x21')](respondWithFilteredResult(_0x20ad0d,_0x45bb9f))[_0xf75f('0x40')](handleError(_0x20ad0d,null));};exports[_0xf75f('0x41')]=function(_0x2425cf,_0x270634){var _0x5a5e8d={'raw':!![],'where':{'id':_0x2425cf[_0xf75f('0x42')]['id']}},_0xcd93dd={};_0xcd93dd['model']=_[_0xf75f('0x2e')](db['JscriptyQuestionReport']['rawAttributes']);_0xcd93dd[_0xf75f('0x2d')]=_['keys'](_0x2425cf[_0xf75f('0x2d')]);_0xcd93dd['filters']=_[_0xf75f('0x30')](_0xcd93dd['model'],_0xcd93dd[_0xf75f('0x2d')]);_0x5a5e8d[_0xf75f('0x32')]=_[_0xf75f('0x30')](_0xcd93dd[_0xf75f('0x31')],qs[_0xf75f('0x33')](_0x2425cf['query'][_0xf75f('0x33')]));_0x5a5e8d[_0xf75f('0x32')]=_0x5a5e8d['attributes']['length']?_0x5a5e8d[_0xf75f('0x32')]:_0xcd93dd[_0xf75f('0x31')];if(_0x2425cf['query'][_0xf75f('0x43')]){_0x5a5e8d[_0xf75f('0x3e')]=[{'all':!![]}];}_0x5a5e8d=_[_0xf75f('0x3b')]({},_0x5a5e8d,_0x2425cf[_0xf75f('0x3d')]);return db[_0xf75f('0x28')][_0xf75f('0x44')](_0x5a5e8d)[_0xf75f('0x21')](handleEntityNotFound(_0x270634,null))['then'](respondWithResult(_0x270634,null))[_0xf75f('0x40')](handleError(_0x270634,null));};exports[_0xf75f('0x45')]=function(_0x17961c,_0x23b474){return db[_0xf75f('0x28')][_0xf75f('0x45')](_0x17961c[_0xf75f('0x46')],{})[_0xf75f('0x21')](respondWithResult(_0x23b474,0xc9))['catch'](handleError(_0x23b474,null));};exports[_0xf75f('0x47')]=function(_0x1b838d,_0x1587ea){if(_0x1b838d[_0xf75f('0x46')]['id']){delete _0x1b838d[_0xf75f('0x46')]['id'];}return db[_0xf75f('0x28')][_0xf75f('0x44')]({'where':{'id':_0x1b838d['params']['id']}})['then'](handleEntityNotFound(_0x1587ea,null))['then'](saveUpdates(_0x1b838d['body'],null))['then'](respondWithResult(_0x1587ea,null))[_0xf75f('0x40')](handleError(_0x1587ea,null));};exports[_0xf75f('0x22')]=function(_0x200335,_0x3c9878){return db[_0xf75f('0x28')][_0xf75f('0x44')]({'where':{'id':_0x200335['params']['id']}})[_0xf75f('0x21')](handleEntityNotFound(_0x3c9878,null))[_0xf75f('0x21')](removeEntity(_0x3c9878,null))[_0xf75f('0x40')](handleError(_0x3c9878,null));};exports[_0xf75f('0x48')]=function(_0x296b56,_0x3881cf){return db[_0xf75f('0x28')]['describe']()[_0xf75f('0x21')](respondWithResult(_0x3881cf,null))[_0xf75f('0x40')](handleError(_0x3881cf,null));}; \ No newline at end of file +var _0xf9a8=['zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','map','JscriptyQuestionReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','catch','create','body','find','params','describe','eml-format','rimraf'];(function(_0x5a343c,_0x24e10f){var _0x24f656=function(_0x224205){while(--_0x224205){_0x5a343c['push'](_0x5a343c['shift']());}};_0x24f656(++_0x24e10f);}(_0xf9a8,0xdf));var _0x8f9a=function(_0x2417a4,_0x226e88){_0x2417a4=_0x2417a4-0x0;var _0x16d6be=_0xf9a8[_0x2417a4];return _0x16d6be;};'use strict';var emlformat=require(_0x8f9a('0x0'));var rimraf=require(_0x8f9a('0x1'));var zipdir=require(_0x8f9a('0x2'));var jsonpatch=require(_0x8f9a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8f9a('0x4'));var Mustache=require('mustache');var util=require(_0x8f9a('0x5'));var path=require(_0x8f9a('0x6'));var sox=require(_0x8f9a('0x7'));var csv=require('to-csv');var ejs=require(_0x8f9a('0x8'));var fs=require('fs');var fs_extra=require(_0x8f9a('0x9'));var _=require(_0x8f9a('0xa'));var squel=require(_0x8f9a('0xb'));var crypto=require(_0x8f9a('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8f9a('0xd'));var querystring=require(_0x8f9a('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8f9a('0xf'));var qs=require(_0x8f9a('0x10'));var as=require(_0x8f9a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f9a('0x12'))(_0x8f9a('0x13'));var utils=require(_0x8f9a('0x14'));var config=require(_0x8f9a('0x15'));var licenseUtil=require(_0x8f9a('0x16'));var db=require(_0x8f9a('0x17'))['db'];function respondWithStatusCode(_0x29cdf5,_0x33ee71){_0x33ee71=_0x33ee71||0xcc;return function(_0x249a38){if(_0x249a38){return _0x29cdf5['sendStatus'](_0x33ee71);}return _0x29cdf5[_0x8f9a('0x18')](_0x33ee71)[_0x8f9a('0x19')]();};}function respondWithResult(_0x588a3f,_0x4c1087){_0x4c1087=_0x4c1087||0xc8;return function(_0xb78a99){if(_0xb78a99){return _0x588a3f['status'](_0x4c1087)[_0x8f9a('0x1a')](_0xb78a99);}};}function respondWithFilteredResult(_0x587c23,_0x2ab875){return function(_0x1c539c){if(_0x1c539c){var _0x4a380f=typeof _0x2ab875['offset']==='undefined'&&typeof _0x2ab875[_0x8f9a('0x1b')]==='undefined';var _0x2e0f37=_0x1c539c['count'];var _0x5f364f=_0x4a380f?0x0:_0x2ab875['offset'];var _0x2eec68=_0x4a380f?_0x1c539c[_0x8f9a('0x1c')]:_0x2ab875[_0x8f9a('0x1d')]+_0x2ab875['limit'];var _0x58477f;if(_0x2eec68>=_0x2e0f37){_0x2eec68=_0x2e0f37;_0x58477f=0xc8;}else{_0x58477f=0xce;}_0x587c23[_0x8f9a('0x18')](_0x58477f);return _0x587c23['set'](_0x8f9a('0x1e'),_0x5f364f+'-'+_0x2eec68+'/'+_0x2e0f37)['json'](_0x1c539c);}return null;};}function patchUpdates(_0x49564d){return function(_0x4ebf4e){try{jsonpatch[_0x8f9a('0x1f')](_0x4ebf4e,_0x49564d,!![]);}catch(_0x55c86d){return BPromise[_0x8f9a('0x20')](_0x55c86d);}return _0x4ebf4e[_0x8f9a('0x21')]();};}function saveUpdates(_0x27415c,_0x5934a5){return function(_0x8c90c8){if(_0x8c90c8){return _0x8c90c8[_0x8f9a('0x22')](_0x27415c)['then'](function(_0x8df1e4){return _0x8df1e4;});}return null;};}function removeEntity(_0x2285d9,_0x4d4a93){return function(_0x31e85b){if(_0x31e85b){return _0x31e85b[_0x8f9a('0x23')]()[_0x8f9a('0x24')](function(){_0x2285d9[_0x8f9a('0x18')](0xcc)[_0x8f9a('0x19')]();});}};}function handleEntityNotFound(_0x1efa5e,_0x12c0ab){return function(_0x4be2fa){if(!_0x4be2fa){_0x1efa5e[_0x8f9a('0x25')](0x194);}return _0x4be2fa;};}function handleError(_0x3841c5,_0x3335c3){_0x3335c3=_0x3335c3||0x1f4;return function(_0x58e0f8){logger[_0x8f9a('0x26')](_0x58e0f8[_0x8f9a('0x27')]);if(_0x58e0f8[_0x8f9a('0x28')]){delete _0x58e0f8[_0x8f9a('0x28')];}_0x3841c5['status'](_0x3335c3)[_0x8f9a('0x29')](_0x58e0f8);};}exports['index']=function(_0x104aec,_0x2a4d05){var _0x4cd43d={},_0x32313f={},_0x3edf44={'count':0x0,'rows':[]};var _0x58db45=_[_0x8f9a('0x2a')](db[_0x8f9a('0x2b')][_0x8f9a('0x2c')],function(_0x2a09d7){return{'name':_0x2a09d7[_0x8f9a('0x2d')],'type':_0x2a09d7['type'][_0x8f9a('0x2e')]};});_0x32313f[_0x8f9a('0x2f')]=_['map'](_0x58db45,_0x8f9a('0x28'));_0x32313f[_0x8f9a('0x30')]=_[_0x8f9a('0x31')](_0x104aec[_0x8f9a('0x30')]);_0x32313f[_0x8f9a('0x32')]=_[_0x8f9a('0x33')](_0x32313f[_0x8f9a('0x2f')],_0x32313f[_0x8f9a('0x30')]);_0x4cd43d[_0x8f9a('0x34')]=_[_0x8f9a('0x33')](_0x32313f[_0x8f9a('0x2f')],qs['fields'](_0x104aec[_0x8f9a('0x30')][_0x8f9a('0x35')]));_0x4cd43d['attributes']=_0x4cd43d['attributes'][_0x8f9a('0x36')]?_0x4cd43d[_0x8f9a('0x34')]:_0x32313f[_0x8f9a('0x2f')];if(!_0x104aec[_0x8f9a('0x30')][_0x8f9a('0x37')](_0x8f9a('0x38'))){_0x4cd43d['limit']=qs[_0x8f9a('0x1b')](_0x104aec[_0x8f9a('0x30')]['limit']);_0x4cd43d[_0x8f9a('0x1d')]=qs[_0x8f9a('0x1d')](_0x104aec[_0x8f9a('0x30')][_0x8f9a('0x1d')]);}_0x4cd43d[_0x8f9a('0x39')]=qs[_0x8f9a('0x3a')](_0x104aec[_0x8f9a('0x30')][_0x8f9a('0x3a')]);_0x4cd43d[_0x8f9a('0x3b')]=qs['filters'](_[_0x8f9a('0x3c')](_0x104aec[_0x8f9a('0x30')],_0x32313f['filters']),_0x58db45);if(_0x104aec[_0x8f9a('0x30')][_0x8f9a('0x3d')]){_0x4cd43d[_0x8f9a('0x3b')]=_[_0x8f9a('0x3e')](_0x4cd43d[_0x8f9a('0x3b')],{'$or':_[_0x8f9a('0x2a')](_0x58db45,function(_0x420641){if(_0x420641['type']!==_0x8f9a('0x3f')){var _0x3f3115={};_0x3f3115[_0x420641['name']]={'$like':'%'+_0x104aec['query'][_0x8f9a('0x3d')]+'%'};return _0x3f3115;}})});}_0x4cd43d=_[_0x8f9a('0x3e')]({},_0x4cd43d,_0x104aec[_0x8f9a('0x40')]);var _0x4c5907={'where':_0x4cd43d[_0x8f9a('0x3b')]};return db['JscriptyQuestionReport'][_0x8f9a('0x1c')](_0x4c5907)[_0x8f9a('0x24')](function(_0x2cd02e){_0x3edf44[_0x8f9a('0x1c')]=_0x2cd02e;if(_0x104aec['query'][_0x8f9a('0x41')]){_0x4cd43d[_0x8f9a('0x42')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x8f9a('0x43')](_0x4cd43d);})[_0x8f9a('0x24')](function(_0x41b44f){_0x3edf44['rows']=_0x41b44f;return _0x3edf44;})[_0x8f9a('0x24')](respondWithFilteredResult(_0x2a4d05,_0x4cd43d))['catch'](handleError(_0x2a4d05,null));};exports[_0x8f9a('0x44')]=function(_0x1f8bd0,_0x24e653){var _0x23a6f3={'raw':!![],'where':{'id':_0x1f8bd0['params']['id']}},_0x4307d2={};_0x4307d2[_0x8f9a('0x2f')]=_[_0x8f9a('0x31')](db[_0x8f9a('0x2b')]['rawAttributes']);_0x4307d2[_0x8f9a('0x30')]=_[_0x8f9a('0x31')](_0x1f8bd0[_0x8f9a('0x30')]);_0x4307d2['filters']=_[_0x8f9a('0x33')](_0x4307d2[_0x8f9a('0x2f')],_0x4307d2[_0x8f9a('0x30')]);_0x23a6f3['attributes']=_['intersection'](_0x4307d2[_0x8f9a('0x2f')],qs['fields'](_0x1f8bd0[_0x8f9a('0x30')]['fields']));_0x23a6f3[_0x8f9a('0x34')]=_0x23a6f3[_0x8f9a('0x34')]['length']?_0x23a6f3['attributes']:_0x4307d2['model'];if(_0x1f8bd0[_0x8f9a('0x30')][_0x8f9a('0x41')]){_0x23a6f3[_0x8f9a('0x42')]=[{'all':!![]}];}_0x23a6f3=_['merge']({},_0x23a6f3,_0x1f8bd0[_0x8f9a('0x40')]);return db[_0x8f9a('0x2b')]['find'](_0x23a6f3)['then'](handleEntityNotFound(_0x24e653,null))[_0x8f9a('0x24')](respondWithResult(_0x24e653,null))[_0x8f9a('0x45')](handleError(_0x24e653,null));};exports[_0x8f9a('0x46')]=function(_0x1971e1,_0x2d038a){return db[_0x8f9a('0x2b')][_0x8f9a('0x46')](_0x1971e1['body'],{})[_0x8f9a('0x24')](respondWithResult(_0x2d038a,0xc9))[_0x8f9a('0x45')](handleError(_0x2d038a,null));};exports[_0x8f9a('0x22')]=function(_0x150ae1,_0x3f8b0d){if(_0x150ae1[_0x8f9a('0x47')]['id']){delete _0x150ae1['body']['id'];}return db[_0x8f9a('0x2b')][_0x8f9a('0x48')]({'where':{'id':_0x150ae1[_0x8f9a('0x49')]['id']}})['then'](handleEntityNotFound(_0x3f8b0d,null))[_0x8f9a('0x24')](saveUpdates(_0x150ae1[_0x8f9a('0x47')],null))[_0x8f9a('0x24')](respondWithResult(_0x3f8b0d,null))['catch'](handleError(_0x3f8b0d,null));};exports[_0x8f9a('0x23')]=function(_0x2bacb7,_0x473a52){return db['JscriptyQuestionReport'][_0x8f9a('0x48')]({'where':{'id':_0x2bacb7[_0x8f9a('0x49')]['id']}})['then'](handleEntityNotFound(_0x473a52,null))[_0x8f9a('0x24')](removeEntity(_0x473a52,null))[_0x8f9a('0x45')](handleError(_0x473a52,null));};exports[_0x8f9a('0x4a')]=function(_0x459693,_0x2b07ae){return db[_0x8f9a('0x2b')][_0x8f9a('0x4a')]()[_0x8f9a('0x24')](respondWithResult(_0x2b07ae,null))[_0x8f9a('0x45')](handleError(_0x2b07ae,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 0907b03..ae3a913 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 _0x09ee=['util','api','moment','request-promise','path','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash'];(function(_0x3e610e,_0x2d695a){var _0x3d1cdd=function(_0xcf40f9){while(--_0xcf40f9){_0x3e610e['push'](_0x3e610e['shift']());}};_0x3d1cdd(++_0x2d695a);}(_0x09ee,0x83));var _0xe09e=function(_0x33ccaf,_0x192235){_0x33ccaf=_0x33ccaf-0x0;var _0x30abf6=_0x09ee[_0x33ccaf];return _0x30abf6;};'use strict';var _=require(_0xe09e('0x0'));var util=require(_0xe09e('0x1'));var logger=require('../../config/logger')(_0xe09e('0x2'));var moment=require(_0xe09e('0x3'));var BPromise=require('bluebird');var rp=require(_0xe09e('0x4'));var fs=require('fs');var path=require(_0xe09e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe09e('0x6'));module[_0xe09e('0x7')]=function(_0x510f43,_0x3dd9e9){return _0x510f43[_0xe09e('0x8')](_0xe09e('0x9'),attributes,{'tableName':_0xe09e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x89b6=['path','rimraf','../../config/environment','exports','JscriptyQuestionReport','../../config/logger','api','moment','request-promise'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x89b6,0x152));var _0x689b=function(_0x1b6c0c,_0x51ef20){_0x1b6c0c=_0x1b6c0c-0x0;var _0x178991=_0x89b6[_0x1b6c0c];return _0x178991;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x689b('0x0'))(_0x689b('0x1'));var moment=require(_0x689b('0x2'));var BPromise=require('bluebird');var rp=require(_0x689b('0x3'));var fs=require('fs');var path=require(_0x689b('0x4'));var rimraf=require(_0x689b('0x5'));var config=require(_0x689b('0x6'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x689b('0x7')]=function(_0x1d48cb,_0xd7ecc8){return _0x1d48cb['define'](_0x689b('0x8'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 53c2abc..9ed5b97 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 _0x92b3=['../../config/environment','jayson/promise','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x92b3,0x19c));var _0x392b=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x92b3[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x392b('0x0'));var util=require(_0x392b('0x1'));var moment=require('moment');var BPromise=require(_0x392b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x392b('0x3'))['db'];var utils=require(_0x392b('0x4'));var logger=require(_0x392b('0x5'))('rpc');var config=require(_0x392b('0x6'));var jayson=require(_0x392b('0x7'));var client=jayson[_0x392b('0x8')][_0x392b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a9027,_0x2adec3,_0x4a746b){return new BPromise(function(_0x50ea9c,_0x3bddf2){return client[_0x392b('0xa')](_0x2a9027,_0x4a746b)['then'](function(_0x39779f){logger[_0x392b('0xb')](_0x392b('0xc'),_0x2adec3,_0x392b('0xd'));logger[_0x392b('0xe')](_0x392b('0xf'),_0x2adec3,_0x392b('0xd'),JSON[_0x392b('0x10')](_0x39779f));if(_0x39779f['error']){if(_0x39779f[_0x392b('0x11')][_0x392b('0x12')]===0x1f4){logger['error'](_0x392b('0xc'),_0x2adec3,_0x39779f[_0x392b('0x11')][_0x392b('0x13')]);return _0x3bddf2(_0x39779f['error']['message']);}logger[_0x392b('0x11')](_0x392b('0xc'),_0x2adec3,_0x39779f[_0x392b('0x11')][_0x392b('0x13')]);return _0x50ea9c(_0x39779f[_0x392b('0x11')][_0x392b('0x13')]);}else{logger['info'](_0x392b('0xc'),_0x2adec3,_0x392b('0xd'));_0x50ea9c(_0x39779f[_0x392b('0x14')]['message']);}})[_0x392b('0x15')](function(_0x26d4f4){logger[_0x392b('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2adec3,_0x26d4f4);_0x3bddf2(_0x26d4f4);});});} \ No newline at end of file +var _0xe7a5=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment'];(function(_0x12d951,_0x249808){var _0x44de17=function(_0x182fd9){while(--_0x182fd9){_0x12d951['push'](_0x12d951['shift']());}};_0x44de17(++_0x249808);}(_0xe7a5,0x139));var _0x5e7a=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0xe7a5[_0x3e7e96];return _0x13f6f0;};'use strict';var _=require('lodash');var util=require(_0x5e7a('0x0'));var moment=require(_0x5e7a('0x1'));var BPromise=require(_0x5e7a('0x2'));var rs=require(_0x5e7a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5e7a('0x4'))['db'];var utils=require(_0x5e7a('0x5'));var logger=require(_0x5e7a('0x6'))('rpc');var config=require(_0x5e7a('0x7'));var jayson=require(_0x5e7a('0x8'));var client=jayson[_0x5e7a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47ddf8,_0x5049c8,_0x40e5a7){return new BPromise(function(_0x248c71,_0x5099f3){return client['request'](_0x47ddf8,_0x40e5a7)[_0x5e7a('0xa')](function(_0x5dfae4){logger[_0x5e7a('0xb')](_0x5e7a('0xc'),_0x5049c8,'request\x20sent');logger[_0x5e7a('0xd')](_0x5e7a('0xe'),_0x5049c8,_0x5e7a('0xf'),JSON[_0x5e7a('0x10')](_0x5dfae4));if(_0x5dfae4[_0x5e7a('0x11')]){if(_0x5dfae4[_0x5e7a('0x11')][_0x5e7a('0x12')]===0x1f4){logger['error'](_0x5e7a('0xc'),_0x5049c8,_0x5dfae4[_0x5e7a('0x11')][_0x5e7a('0x13')]);return _0x5099f3(_0x5dfae4[_0x5e7a('0x11')][_0x5e7a('0x13')]);}logger[_0x5e7a('0x11')](_0x5e7a('0xc'),_0x5049c8,_0x5dfae4[_0x5e7a('0x11')][_0x5e7a('0x13')]);return _0x248c71(_0x5dfae4[_0x5e7a('0x11')][_0x5e7a('0x13')]);}else{logger[_0x5e7a('0xb')](_0x5e7a('0xc'),_0x5049c8,_0x5e7a('0xf'));_0x248c71(_0x5dfae4[_0x5e7a('0x14')][_0x5e7a('0x13')]);}})['catch'](function(_0x296726){logger[_0x5e7a('0x11')](_0x5e7a('0xc'),_0x5049c8,_0x296726);_0x5099f3(_0x296726);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index f3fb743..7366e60 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 _0x1a11=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x10a54a,_0x193260){var _0x150405=function(_0x371e6f){while(--_0x371e6f){_0x10a54a['push'](_0x10a54a['shift']());}};_0x150405(++_0x193260);}(_0x1a11,0x1df));var _0x11a1=function(_0x1f009d,_0x1ee794){_0x1f009d=_0x1f009d-0x0;var _0x206df8=_0x1a11[_0x1f009d];return _0x206df8;};'use strict';var multer=require(_0x11a1('0x0'));var util=require(_0x11a1('0x1'));var path=require(_0x11a1('0x2'));var timeout=require(_0x11a1('0x3'));var express=require('express');var router=express[_0x11a1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x11a1('0x5'));var interaction=require(_0x11a1('0x6'));var config=require(_0x11a1('0x7'));var controller=require(_0x11a1('0x8'));router[_0x11a1('0x9')]('/',auth[_0x11a1('0xa')](),controller['index']);router[_0x11a1('0x9')](_0x11a1('0xb'),auth[_0x11a1('0xa')](),controller[_0x11a1('0xc')]);router['get'](_0x11a1('0xd'),auth[_0x11a1('0xa')](),controller[_0x11a1('0xe')]);router[_0x11a1('0x9')]('/:id/questions',auth[_0x11a1('0xa')](),controller['getQuestions']);router['post']('/',auth['isAuthenticated'](),controller[_0x11a1('0xf')]);router[_0x11a1('0x10')]('/:id',auth[_0x11a1('0xa')](),controller[_0x11a1('0x11')]);router[_0x11a1('0x12')](_0x11a1('0xd'),auth[_0x11a1('0xa')](),controller[_0x11a1('0x13')]);module[_0x11a1('0x14')]=router; \ No newline at end of file +var _0x52c3=['../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','get','/describe','show','/:id/questions','getQuestions','post','create','put','/:id','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x52c3,0xbf));var _0x352c=function(_0x50f0a9,_0x2b0c57){_0x50f0a9=_0x50f0a9-0x0;var _0x5a33d9=_0x52c3[_0x50f0a9];return _0x5a33d9;};'use strict';var multer=require(_0x352c('0x0'));var util=require(_0x352c('0x1'));var path=require(_0x352c('0x2'));var timeout=require('connect-timeout');var express=require(_0x352c('0x3'));var router=express[_0x352c('0x4')]();var fs_extra=require(_0x352c('0x5'));var auth=require(_0x352c('0x6'));var interaction=require(_0x352c('0x7'));var config=require(_0x352c('0x8'));var controller=require(_0x352c('0x9'));router['get']('/',auth[_0x352c('0xa')](),controller[_0x352c('0xb')]);router[_0x352c('0xc')](_0x352c('0xd'),auth[_0x352c('0xa')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x352c('0xe')]);router[_0x352c('0xc')](_0x352c('0xf'),auth['isAuthenticated'](),controller[_0x352c('0x10')]);router[_0x352c('0x11')]('/',auth[_0x352c('0xa')](),controller[_0x352c('0x12')]);router[_0x352c('0x13')](_0x352c('0x14'),auth[_0x352c('0xa')](),controller['update']);router[_0x352c('0x15')](_0x352c('0x14'),auth[_0x352c('0xa')](),controller['destroy']);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 9eccdd8..ebf63ce 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 _0xcc47=['moment','sequelize','exports','DATE','setDataValue','starttime','format','STRING','BOOLEAN'];(function(_0x45a244,_0x12f982){var _0x57edbc=function(_0x2182b2){while(--_0x2182b2){_0x45a244['push'](_0x45a244['shift']());}};_0x57edbc(++_0x12f982);}(_0xcc47,0xfc));var _0x7cc4=function(_0x4a7b06,_0x139719){_0x4a7b06=_0x4a7b06-0x0;var _0x58f790=_0xcc47[_0x4a7b06];return _0x58f790;};'use strict';var moment=require(_0x7cc4('0x0'));var Sequelize=require(_0x7cc4('0x1'));module[_0x7cc4('0x2')]={'starttime':{'type':Sequelize[_0x7cc4('0x3')],'set':function(_0x2a4164){this[_0x7cc4('0x4')](_0x7cc4('0x5'),_0x2a4164);this[_0x7cc4('0x4')]('endtime',moment()[_0x7cc4('0x6')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x7cc4('0x3')]},'membername':{'type':Sequelize[_0x7cc4('0x7')]},'projectname':{'type':Sequelize[_0x7cc4('0x7')]},'queue':{'type':Sequelize[_0x7cc4('0x7')]},'uniqueid':{'type':Sequelize[_0x7cc4('0x7')]},'calleridname':{'type':Sequelize[_0x7cc4('0x7')]},'calleridnum':{'type':Sequelize[_0x7cc4('0x7')]},'completed':{'type':Sequelize[_0x7cc4('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0xdadf=['BOOLEAN','moment','sequelize','exports','DATE','starttime','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x2e13b5,_0x4fe598){var _0x107502=function(_0x221356){while(--_0x221356){_0x2e13b5['push'](_0x2e13b5['shift']());}};_0x107502(++_0x4fe598);}(_0xdadf,0xc7));var _0xfdad=function(_0x59d2dd,_0x1de825){_0x59d2dd=_0x59d2dd-0x0;var _0x3992c2=_0xdadf[_0x59d2dd];return _0x3992c2;};'use strict';var moment=require(_0xfdad('0x0'));var Sequelize=require(_0xfdad('0x1'));module[_0xfdad('0x2')]={'starttime':{'type':Sequelize[_0xfdad('0x3')],'set':function(_0x546a87){this['setDataValue'](_0xfdad('0x4'),_0x546a87);this[_0xfdad('0x5')](_0xfdad('0x6'),moment()[_0xfdad('0x7')](_0xfdad('0x8')));}},'endtime':{'type':Sequelize[_0xfdad('0x3')]},'membername':{'type':Sequelize[_0xfdad('0x9')]},'projectname':{'type':Sequelize[_0xfdad('0x9')]},'queue':{'type':Sequelize[_0xfdad('0x9')]},'uniqueid':{'type':Sequelize[_0xfdad('0x9')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xfdad('0xa')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 79b2531..a6cb59e 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 _0xed35=['stack','name','send','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','include','findAll','catch','show','params','length','includeAll','merge','find','create','body','destroy','describe','findOne','fields','SessionId','JscriptyQuestionReport','rows','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','end'];(function(_0x2775c7,_0x11c47a){var _0x28346d=function(_0x53d920){while(--_0x53d920){_0x2775c7['push'](_0x2775c7['shift']());}};_0x28346d(++_0x11c47a);}(_0xed35,0x11d));var _0x5ed3=function(_0x201f15,_0x3de89f){_0x201f15=_0x201f15-0x0;var _0x24fd72=_0xed35[_0x201f15];return _0x24fd72;};'use strict';var emlformat=require(_0x5ed3('0x0'));var rimraf=require(_0x5ed3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5ed3('0x2'));var rp=require(_0x5ed3('0x3'));var moment=require(_0x5ed3('0x4'));var BPromise=require(_0x5ed3('0x5'));var Mustache=require(_0x5ed3('0x6'));var util=require(_0x5ed3('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5ed3('0x8'));var ejs=require(_0x5ed3('0x9'));var fs=require('fs');var fs_extra=require(_0x5ed3('0xa'));var _=require(_0x5ed3('0xb'));var squel=require(_0x5ed3('0xc'));var crypto=require(_0x5ed3('0xd'));var jsforce=require(_0x5ed3('0xe'));var deskjs=require(_0x5ed3('0xf'));var toCsv=require(_0x5ed3('0x8'));var querystring=require(_0x5ed3('0x10'));var Papa=require(_0x5ed3('0x11'));var Redis=require(_0x5ed3('0x12'));var authService=require(_0x5ed3('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5ed3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5ed3('0x15'));var utils=require(_0x5ed3('0x16'));var config=require(_0x5ed3('0x17'));var licenseUtil=require(_0x5ed3('0x18'));var db=require(_0x5ed3('0x19'))['db'];function respondWithStatusCode(_0x42c2a9,_0x199ed5){_0x199ed5=_0x199ed5||0xcc;return function(_0x511076){if(_0x511076){return _0x42c2a9['sendStatus'](_0x199ed5);}return _0x42c2a9[_0x5ed3('0x1a')](_0x199ed5)['end']();};}function respondWithResult(_0x165a23,_0x5c24e8){_0x5c24e8=_0x5c24e8||0xc8;return function(_0x19ffa3){if(_0x19ffa3){return _0x165a23['status'](_0x5c24e8)[_0x5ed3('0x1b')](_0x19ffa3);}};}function respondWithFilteredResult(_0x4d855a,_0x160f7c){return function(_0x2d881e){if(_0x2d881e){var _0x2a9387=typeof _0x160f7c[_0x5ed3('0x1c')]===_0x5ed3('0x1d')&&typeof _0x160f7c[_0x5ed3('0x1e')]===_0x5ed3('0x1d');var _0x4ba046=_0x2d881e[_0x5ed3('0x1f')];var _0x35a68e=_0x2a9387?0x0:_0x160f7c[_0x5ed3('0x1c')];var _0x586d77=_0x2a9387?_0x2d881e['count']:_0x160f7c[_0x5ed3('0x1c')]+_0x160f7c[_0x5ed3('0x1e')];var _0x4be835;if(_0x586d77>=_0x4ba046){_0x586d77=_0x4ba046;_0x4be835=0xc8;}else{_0x4be835=0xce;}_0x4d855a[_0x5ed3('0x1a')](_0x4be835);return _0x4d855a[_0x5ed3('0x20')](_0x5ed3('0x21'),_0x35a68e+'-'+_0x586d77+'/'+_0x4ba046)[_0x5ed3('0x1b')](_0x2d881e);}return null;};}function patchUpdates(_0x4b707e){return function(_0x33dff4){try{jsonpatch[_0x5ed3('0x22')](_0x33dff4,_0x4b707e,!![]);}catch(_0x22c5ba){return BPromise['reject'](_0x22c5ba);}return _0x33dff4[_0x5ed3('0x23')]();};}function saveUpdates(_0x61139,_0xd5eecc){return function(_0x4873da){if(_0x4873da){return _0x4873da[_0x5ed3('0x24')](_0x61139)['then'](function(_0x27e4d5){return _0x27e4d5;});}return null;};}function removeEntity(_0x3f7e8f,_0x11b9e4){return function(_0x5e90b2){if(_0x5e90b2){return _0x5e90b2['destroy']()[_0x5ed3('0x25')](function(){_0x3f7e8f[_0x5ed3('0x1a')](0xcc)[_0x5ed3('0x26')]();});}};}function handleEntityNotFound(_0x21c568,_0xd40a93){return function(_0x2b32f0){if(!_0x2b32f0){_0x21c568['sendStatus'](0x194);}return _0x2b32f0;};}function handleError(_0xfd2a7e,_0x4bbf64){_0x4bbf64=_0x4bbf64||0x1f4;return function(_0x5a89fd){logger['error'](_0x5a89fd[_0x5ed3('0x27')]);if(_0x5a89fd[_0x5ed3('0x28')]){delete _0x5a89fd[_0x5ed3('0x28')];}_0xfd2a7e[_0x5ed3('0x1a')](_0x4bbf64)[_0x5ed3('0x29')](_0x5a89fd);};}exports['index']=function(_0x27af60,_0x295047){var _0x3b14c6={},_0xf984ba={},_0x3f04f4={'count':0x0,'rows':[]};var _0x522b65=_[_0x5ed3('0x2a')](db[_0x5ed3('0x2b')][_0x5ed3('0x2c')],function(_0x5439b9){return{'name':_0x5439b9[_0x5ed3('0x2d')],'type':_0x5439b9[_0x5ed3('0x2e')][_0x5ed3('0x2f')]};});_0xf984ba[_0x5ed3('0x30')]=_[_0x5ed3('0x2a')](_0x522b65,'name');_0xf984ba[_0x5ed3('0x31')]=_[_0x5ed3('0x32')](_0x27af60[_0x5ed3('0x31')]);_0xf984ba[_0x5ed3('0x33')]=_[_0x5ed3('0x34')](_0xf984ba['model'],_0xf984ba[_0x5ed3('0x31')]);_0x3b14c6['attributes']=_['intersection'](_0xf984ba['model'],qs['fields'](_0x27af60['query']['fields']));_0x3b14c6[_0x5ed3('0x35')]=_0x3b14c6[_0x5ed3('0x35')]['length']?_0x3b14c6[_0x5ed3('0x35')]:_0xf984ba[_0x5ed3('0x30')];if(!_0x27af60[_0x5ed3('0x31')][_0x5ed3('0x36')](_0x5ed3('0x37'))){_0x3b14c6[_0x5ed3('0x1e')]=qs[_0x5ed3('0x1e')](_0x27af60[_0x5ed3('0x31')][_0x5ed3('0x1e')]);_0x3b14c6['offset']=qs[_0x5ed3('0x1c')](_0x27af60[_0x5ed3('0x31')]['offset']);}_0x3b14c6[_0x5ed3('0x38')]=qs[_0x5ed3('0x39')](_0x27af60[_0x5ed3('0x31')][_0x5ed3('0x39')]);_0x3b14c6[_0x5ed3('0x3a')]=qs[_0x5ed3('0x33')](_[_0x5ed3('0x3b')](_0x27af60[_0x5ed3('0x31')],_0xf984ba['filters']),_0x522b65);if(_0x27af60[_0x5ed3('0x31')]['filter']){_0x3b14c6[_0x5ed3('0x3a')]=_['merge'](_0x3b14c6[_0x5ed3('0x3a')],{'$or':_[_0x5ed3('0x2a')](_0x522b65,function(_0x5c342b){if(_0x5c342b[_0x5ed3('0x2e')]!==_0x5ed3('0x3c')){var _0x3c8d8e={};_0x3c8d8e[_0x5c342b[_0x5ed3('0x28')]]={'$like':'%'+_0x27af60[_0x5ed3('0x31')][_0x5ed3('0x3d')]+'%'};return _0x3c8d8e;}})});}_0x3b14c6=_['merge']({},_0x3b14c6,_0x27af60[_0x5ed3('0x3e')]);var _0x18ac6c={'where':_0x3b14c6[_0x5ed3('0x3a')]};return db[_0x5ed3('0x2b')][_0x5ed3('0x1f')](_0x18ac6c)[_0x5ed3('0x25')](function(_0x42010a){_0x3f04f4[_0x5ed3('0x1f')]=_0x42010a;if(_0x27af60[_0x5ed3('0x31')]['includeAll']){_0x3b14c6[_0x5ed3('0x3f')]=[{'all':!![]}];}return db[_0x5ed3('0x2b')][_0x5ed3('0x40')](_0x3b14c6);})['then'](function(_0x5ed8d7){_0x3f04f4['rows']=_0x5ed8d7;return _0x3f04f4;})[_0x5ed3('0x25')](respondWithFilteredResult(_0x295047,_0x3b14c6))[_0x5ed3('0x41')](handleError(_0x295047,null));};exports[_0x5ed3('0x42')]=function(_0x58651b,_0x49519e){var _0x32d629={'raw':!![],'where':{'id':_0x58651b[_0x5ed3('0x43')]['id']}},_0x1cb7c2={};_0x1cb7c2['model']=_[_0x5ed3('0x32')](db[_0x5ed3('0x2b')]['rawAttributes']);_0x1cb7c2[_0x5ed3('0x31')]=_[_0x5ed3('0x32')](_0x58651b[_0x5ed3('0x31')]);_0x1cb7c2['filters']=_[_0x5ed3('0x34')](_0x1cb7c2[_0x5ed3('0x30')],_0x1cb7c2[_0x5ed3('0x31')]);_0x32d629[_0x5ed3('0x35')]=_[_0x5ed3('0x34')](_0x1cb7c2[_0x5ed3('0x30')],qs['fields'](_0x58651b[_0x5ed3('0x31')]['fields']));_0x32d629[_0x5ed3('0x35')]=_0x32d629[_0x5ed3('0x35')][_0x5ed3('0x44')]?_0x32d629[_0x5ed3('0x35')]:_0x1cb7c2[_0x5ed3('0x30')];if(_0x58651b['query'][_0x5ed3('0x45')]){_0x32d629[_0x5ed3('0x3f')]=[{'all':!![]}];}_0x32d629=_[_0x5ed3('0x46')]({},_0x32d629,_0x58651b['options']);return db[_0x5ed3('0x2b')][_0x5ed3('0x47')](_0x32d629)[_0x5ed3('0x25')](handleEntityNotFound(_0x49519e,null))['then'](respondWithResult(_0x49519e,null))['catch'](handleError(_0x49519e,null));};exports[_0x5ed3('0x48')]=function(_0x14d415,_0x57d98c){return db['JscriptySessionReport'][_0x5ed3('0x48')](_0x14d415[_0x5ed3('0x49')],{})['then'](respondWithResult(_0x57d98c,0xc9))[_0x5ed3('0x41')](handleError(_0x57d98c,null));};exports[_0x5ed3('0x24')]=function(_0x63d46f,_0x36902d){if(_0x63d46f[_0x5ed3('0x49')]['id']){delete _0x63d46f[_0x5ed3('0x49')]['id'];}return db['JscriptySessionReport'][_0x5ed3('0x47')]({'where':{'id':_0x63d46f[_0x5ed3('0x43')]['id']}})[_0x5ed3('0x25')](handleEntityNotFound(_0x36902d,null))[_0x5ed3('0x25')](saveUpdates(_0x63d46f['body'],null))[_0x5ed3('0x25')](respondWithResult(_0x36902d,null))[_0x5ed3('0x41')](handleError(_0x36902d,null));};exports[_0x5ed3('0x4a')]=function(_0x18dd97,_0xd9f4fa){return db[_0x5ed3('0x2b')]['find']({'where':{'id':_0x18dd97[_0x5ed3('0x43')]['id']}})['then'](handleEntityNotFound(_0xd9f4fa,null))['then'](removeEntity(_0xd9f4fa,null))[_0x5ed3('0x41')](handleError(_0xd9f4fa,null));};exports['describe']=function(_0x50ca42,_0x187d81){return db[_0x5ed3('0x2b')][_0x5ed3('0x4b')]()['then'](respondWithResult(_0x187d81,null))[_0x5ed3('0x41')](handleError(_0x187d81,null));};exports['getQuestions']=function(_0x53c605,_0xb10e6b,_0xe16bff){var _0x33834b={'raw':!![],'where':{}};var _0x43d53c={};var _0x449456={'count':0x0,'rows':[]};return db[_0x5ed3('0x2b')][_0x5ed3('0x4c')]({'where':{'id':_0x53c605[_0x5ed3('0x43')]['id']}})['then'](handleEntityNotFound(_0xb10e6b,null))[_0x5ed3('0x25')](function(_0x176d58){if(_0x176d58){_0x43d53c['model']=_[_0x5ed3('0x32')](db['JscriptyQuestionReport'][_0x5ed3('0x2c')]);_0x43d53c[_0x5ed3('0x31')]=_[_0x5ed3('0x32')](_0x53c605[_0x5ed3('0x31')]);_0x43d53c[_0x5ed3('0x33')]=_[_0x5ed3('0x34')](_0x43d53c[_0x5ed3('0x30')],_0x43d53c[_0x5ed3('0x31')]);_0x33834b['attributes']=_[_0x5ed3('0x34')](_0x43d53c['model'],qs[_0x5ed3('0x4d')](_0x53c605[_0x5ed3('0x31')]['fields']));_0x33834b[_0x5ed3('0x35')]=_0x33834b['attributes'][_0x5ed3('0x44')]?_0x33834b[_0x5ed3('0x35')]:_0x43d53c[_0x5ed3('0x30')];if(!_0x53c605['query'][_0x5ed3('0x36')](_0x5ed3('0x37'))){_0x33834b[_0x5ed3('0x1e')]=qs[_0x5ed3('0x1e')](_0x53c605[_0x5ed3('0x31')][_0x5ed3('0x1e')]);_0x33834b[_0x5ed3('0x1c')]=qs[_0x5ed3('0x1c')](_0x53c605[_0x5ed3('0x31')]['offset']);}_0x33834b[_0x5ed3('0x38')]=qs['sort'](_0x53c605['query'][_0x5ed3('0x39')]);_0x33834b[_0x5ed3('0x3a')]=qs['filters'](_[_0x5ed3('0x3b')](_0x53c605[_0x5ed3('0x31')],_0x43d53c[_0x5ed3('0x33')]));_0x33834b[_0x5ed3('0x3a')][_0x5ed3('0x4e')]=_0x176d58['id'];if(_0x53c605[_0x5ed3('0x31')][_0x5ed3('0x3d')]){_0x33834b[_0x5ed3('0x3a')]=_[_0x5ed3('0x46')](_0x33834b[_0x5ed3('0x3a')],{'$or':_[_0x5ed3('0x2a')](_0x33834b['attributes'],function(_0x1f1cb5){var _0x38b09c={};_0x38b09c[_0x1f1cb5]={'$like':'%'+_0x53c605[_0x5ed3('0x31')][_0x5ed3('0x3d')]+'%'};return _0x38b09c;})});}_0x33834b=_[_0x5ed3('0x46')]({},_0x33834b,_0x53c605[_0x5ed3('0x3e')]);return db[_0x5ed3('0x4f')][_0x5ed3('0x1f')]({'where':_0x33834b[_0x5ed3('0x3a')]})[_0x5ed3('0x25')](function(_0x35a332){_0x449456['count']=_0x35a332;if(_0x53c605[_0x5ed3('0x31')][_0x5ed3('0x45')]){_0x33834b[_0x5ed3('0x3f')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x5ed3('0x40')](_0x33834b);})['then'](function(_0x36e74e){_0x449456[_0x5ed3('0x50')]=_0x36e74e;return _0x449456;});}})['then'](respondWithFilteredResult(_0xb10e6b,_0x33834b))['catch'](handleError(_0xb10e6b,null));}; \ No newline at end of file +var _0x8b07=['where','pick','filter','merge','options','include','rows','catch','show','params','includeAll','create','body','update','find','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','then','error','stack','name','send','index','JscriptySessionReport','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x2d486b,_0x5f213c){var _0x4291d1=function(_0x2cebcb){while(--_0x2cebcb){_0x2d486b['push'](_0x2d486b['shift']());}};_0x4291d1(++_0x5f213c);}(_0x8b07,0x106));var _0x78b0=function(_0x4f8a06,_0x83dc2d){_0x4f8a06=_0x4f8a06-0x0;var _0x1e6a4b=_0x8b07[_0x4f8a06];return _0x1e6a4b;};'use strict';var emlformat=require(_0x78b0('0x0'));var rimraf=require(_0x78b0('0x1'));var zipdir=require(_0x78b0('0x2'));var jsonpatch=require(_0x78b0('0x3'));var rp=require(_0x78b0('0x4'));var moment=require(_0x78b0('0x5'));var BPromise=require(_0x78b0('0x6'));var Mustache=require(_0x78b0('0x7'));var util=require(_0x78b0('0x8'));var path=require(_0x78b0('0x9'));var sox=require(_0x78b0('0xa'));var csv=require(_0x78b0('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x78b0('0xc'));var _=require('lodash');var squel=require(_0x78b0('0xd'));var crypto=require(_0x78b0('0xe'));var jsforce=require(_0x78b0('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x78b0('0xb'));var querystring=require('querystring');var Papa=require(_0x78b0('0x10'));var Redis=require(_0x78b0('0x11'));var authService=require(_0x78b0('0x12'));var qs=require(_0x78b0('0x13'));var as=require(_0x78b0('0x14'));var hardwareService=require(_0x78b0('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x78b0('0x16'));var config=require(_0x78b0('0x17'));var licenseUtil=require(_0x78b0('0x18'));var db=require(_0x78b0('0x19'))['db'];function respondWithStatusCode(_0x542711,_0x21910f){_0x21910f=_0x21910f||0xcc;return function(_0x554cb6){if(_0x554cb6){return _0x542711['sendStatus'](_0x21910f);}return _0x542711[_0x78b0('0x1a')](_0x21910f)[_0x78b0('0x1b')]();};}function respondWithResult(_0x2ceae8,_0x22fbd7){_0x22fbd7=_0x22fbd7||0xc8;return function(_0x11686d){if(_0x11686d){return _0x2ceae8[_0x78b0('0x1a')](_0x22fbd7)[_0x78b0('0x1c')](_0x11686d);}};}function respondWithFilteredResult(_0xbd52e5,_0x9b34c8){return function(_0x2ee36c){if(_0x2ee36c){var _0x24d2d0=typeof _0x9b34c8[_0x78b0('0x1d')]===_0x78b0('0x1e')&&typeof _0x9b34c8[_0x78b0('0x1f')]===_0x78b0('0x1e');var _0x5cf6a8=_0x2ee36c[_0x78b0('0x20')];var _0x4bcb50=_0x24d2d0?0x0:_0x9b34c8['offset'];var _0x5b026d=_0x24d2d0?_0x2ee36c[_0x78b0('0x20')]:_0x9b34c8[_0x78b0('0x1d')]+_0x9b34c8[_0x78b0('0x1f')];var _0x4b555f;if(_0x5b026d>=_0x5cf6a8){_0x5b026d=_0x5cf6a8;_0x4b555f=0xc8;}else{_0x4b555f=0xce;}_0xbd52e5['status'](_0x4b555f);return _0xbd52e5[_0x78b0('0x21')]('Content-Range',_0x4bcb50+'-'+_0x5b026d+'/'+_0x5cf6a8)['json'](_0x2ee36c);}return null;};}function patchUpdates(_0xe6e453){return function(_0x3540eb){try{jsonpatch['apply'](_0x3540eb,_0xe6e453,!![]);}catch(_0x1e33cf){return BPromise[_0x78b0('0x22')](_0x1e33cf);}return _0x3540eb['save']();};}function saveUpdates(_0xbeaf64,_0x35c9de){return function(_0x3f0946){if(_0x3f0946){return _0x3f0946['update'](_0xbeaf64)[_0x78b0('0x23')](function(_0x3dd056){return _0x3dd056;});}return null;};}function removeEntity(_0x21fe63,_0xeaaee6){return function(_0x149aa6){if(_0x149aa6){return _0x149aa6['destroy']()[_0x78b0('0x23')](function(){_0x21fe63[_0x78b0('0x1a')](0xcc)[_0x78b0('0x1b')]();});}};}function handleEntityNotFound(_0x1b8985,_0x42b8e5){return function(_0x5ad61e){if(!_0x5ad61e){_0x1b8985['sendStatus'](0x194);}return _0x5ad61e;};}function handleError(_0x4307e0,_0xdc9d10){_0xdc9d10=_0xdc9d10||0x1f4;return function(_0x4929cb){logger[_0x78b0('0x24')](_0x4929cb[_0x78b0('0x25')]);if(_0x4929cb['name']){delete _0x4929cb[_0x78b0('0x26')];}_0x4307e0[_0x78b0('0x1a')](_0xdc9d10)[_0x78b0('0x27')](_0x4929cb);};}exports[_0x78b0('0x28')]=function(_0x1717bf,_0x39e2a3){var _0x16d3d9={},_0x3a32ad={},_0x106c5e={'count':0x0,'rows':[]};var _0x17392a=_['map'](db[_0x78b0('0x29')][_0x78b0('0x2a')],function(_0x4c362d){return{'name':_0x4c362d['fieldName'],'type':_0x4c362d[_0x78b0('0x2b')][_0x78b0('0x2c')]};});_0x3a32ad['model']=_[_0x78b0('0x2d')](_0x17392a,'name');_0x3a32ad[_0x78b0('0x2e')]=_[_0x78b0('0x2f')](_0x1717bf[_0x78b0('0x2e')]);_0x3a32ad[_0x78b0('0x30')]=_[_0x78b0('0x31')](_0x3a32ad[_0x78b0('0x32')],_0x3a32ad[_0x78b0('0x2e')]);_0x16d3d9[_0x78b0('0x33')]=_[_0x78b0('0x31')](_0x3a32ad['model'],qs[_0x78b0('0x34')](_0x1717bf[_0x78b0('0x2e')][_0x78b0('0x34')]));_0x16d3d9[_0x78b0('0x33')]=_0x16d3d9[_0x78b0('0x33')][_0x78b0('0x35')]?_0x16d3d9['attributes']:_0x3a32ad[_0x78b0('0x32')];if(!_0x1717bf[_0x78b0('0x2e')][_0x78b0('0x36')](_0x78b0('0x37'))){_0x16d3d9[_0x78b0('0x1f')]=qs[_0x78b0('0x1f')](_0x1717bf[_0x78b0('0x2e')][_0x78b0('0x1f')]);_0x16d3d9['offset']=qs[_0x78b0('0x1d')](_0x1717bf['query'][_0x78b0('0x1d')]);}_0x16d3d9[_0x78b0('0x38')]=qs[_0x78b0('0x39')](_0x1717bf['query'][_0x78b0('0x39')]);_0x16d3d9[_0x78b0('0x3a')]=qs[_0x78b0('0x30')](_[_0x78b0('0x3b')](_0x1717bf[_0x78b0('0x2e')],_0x3a32ad['filters']),_0x17392a);if(_0x1717bf[_0x78b0('0x2e')][_0x78b0('0x3c')]){_0x16d3d9[_0x78b0('0x3a')]=_[_0x78b0('0x3d')](_0x16d3d9[_0x78b0('0x3a')],{'$or':_[_0x78b0('0x2d')](_0x17392a,function(_0x762096){if(_0x762096['type']!=='VIRTUAL'){var _0x1adc79={};_0x1adc79[_0x762096[_0x78b0('0x26')]]={'$like':'%'+_0x1717bf[_0x78b0('0x2e')][_0x78b0('0x3c')]+'%'};return _0x1adc79;}})});}_0x16d3d9=_[_0x78b0('0x3d')]({},_0x16d3d9,_0x1717bf[_0x78b0('0x3e')]);var _0x515951={'where':_0x16d3d9[_0x78b0('0x3a')]};return db[_0x78b0('0x29')]['count'](_0x515951)[_0x78b0('0x23')](function(_0x404cdc){_0x106c5e['count']=_0x404cdc;if(_0x1717bf[_0x78b0('0x2e')]['includeAll']){_0x16d3d9[_0x78b0('0x3f')]=[{'all':!![]}];}return db[_0x78b0('0x29')]['findAll'](_0x16d3d9);})[_0x78b0('0x23')](function(_0x3b8bb5){_0x106c5e[_0x78b0('0x40')]=_0x3b8bb5;return _0x106c5e;})[_0x78b0('0x23')](respondWithFilteredResult(_0x39e2a3,_0x16d3d9))[_0x78b0('0x41')](handleError(_0x39e2a3,null));};exports[_0x78b0('0x42')]=function(_0x2580fa,_0x494d52){var _0x50205d={'raw':!![],'where':{'id':_0x2580fa[_0x78b0('0x43')]['id']}},_0x5ac8e4={};_0x5ac8e4[_0x78b0('0x32')]=_['keys'](db[_0x78b0('0x29')]['rawAttributes']);_0x5ac8e4[_0x78b0('0x2e')]=_[_0x78b0('0x2f')](_0x2580fa[_0x78b0('0x2e')]);_0x5ac8e4[_0x78b0('0x30')]=_[_0x78b0('0x31')](_0x5ac8e4[_0x78b0('0x32')],_0x5ac8e4[_0x78b0('0x2e')]);_0x50205d['attributes']=_[_0x78b0('0x31')](_0x5ac8e4[_0x78b0('0x32')],qs[_0x78b0('0x34')](_0x2580fa[_0x78b0('0x2e')][_0x78b0('0x34')]));_0x50205d['attributes']=_0x50205d['attributes'][_0x78b0('0x35')]?_0x50205d[_0x78b0('0x33')]:_0x5ac8e4[_0x78b0('0x32')];if(_0x2580fa[_0x78b0('0x2e')][_0x78b0('0x44')]){_0x50205d['include']=[{'all':!![]}];}_0x50205d=_['merge']({},_0x50205d,_0x2580fa[_0x78b0('0x3e')]);return db['JscriptySessionReport']['find'](_0x50205d)[_0x78b0('0x23')](handleEntityNotFound(_0x494d52,null))[_0x78b0('0x23')](respondWithResult(_0x494d52,null))[_0x78b0('0x41')](handleError(_0x494d52,null));};exports[_0x78b0('0x45')]=function(_0x37e3a7,_0x3f1dea){return db[_0x78b0('0x29')][_0x78b0('0x45')](_0x37e3a7[_0x78b0('0x46')],{})[_0x78b0('0x23')](respondWithResult(_0x3f1dea,0xc9))[_0x78b0('0x41')](handleError(_0x3f1dea,null));};exports[_0x78b0('0x47')]=function(_0x51d052,_0x5185c0){if(_0x51d052[_0x78b0('0x46')]['id']){delete _0x51d052[_0x78b0('0x46')]['id'];}return db[_0x78b0('0x29')][_0x78b0('0x48')]({'where':{'id':_0x51d052['params']['id']}})[_0x78b0('0x23')](handleEntityNotFound(_0x5185c0,null))['then'](saveUpdates(_0x51d052[_0x78b0('0x46')],null))[_0x78b0('0x23')](respondWithResult(_0x5185c0,null))[_0x78b0('0x41')](handleError(_0x5185c0,null));};exports[_0x78b0('0x49')]=function(_0x275dcf,_0xc5d981){return db['JscriptySessionReport'][_0x78b0('0x48')]({'where':{'id':_0x275dcf['params']['id']}})['then'](handleEntityNotFound(_0xc5d981,null))[_0x78b0('0x23')](removeEntity(_0xc5d981,null))[_0x78b0('0x41')](handleError(_0xc5d981,null));};exports[_0x78b0('0x4a')]=function(_0x22dd29,_0x552efb){return db[_0x78b0('0x29')]['describe']()[_0x78b0('0x23')](respondWithResult(_0x552efb,null))[_0x78b0('0x41')](handleError(_0x552efb,null));};exports[_0x78b0('0x4b')]=function(_0x2b2275,_0x3717bf,_0x494c7d){var _0x3302d5={'raw':!![],'where':{}};var _0x4063d0={};var _0x4af026={'count':0x0,'rows':[]};return db[_0x78b0('0x29')][_0x78b0('0x4c')]({'where':{'id':_0x2b2275[_0x78b0('0x43')]['id']}})[_0x78b0('0x23')](handleEntityNotFound(_0x3717bf,null))[_0x78b0('0x23')](function(_0x522588){if(_0x522588){_0x4063d0[_0x78b0('0x32')]=_['keys'](db[_0x78b0('0x4d')]['rawAttributes']);_0x4063d0['query']=_[_0x78b0('0x2f')](_0x2b2275[_0x78b0('0x2e')]);_0x4063d0[_0x78b0('0x30')]=_['intersection'](_0x4063d0['model'],_0x4063d0[_0x78b0('0x2e')]);_0x3302d5[_0x78b0('0x33')]=_['intersection'](_0x4063d0['model'],qs[_0x78b0('0x34')](_0x2b2275[_0x78b0('0x2e')][_0x78b0('0x34')]));_0x3302d5[_0x78b0('0x33')]=_0x3302d5[_0x78b0('0x33')][_0x78b0('0x35')]?_0x3302d5[_0x78b0('0x33')]:_0x4063d0[_0x78b0('0x32')];if(!_0x2b2275[_0x78b0('0x2e')]['hasOwnProperty'](_0x78b0('0x37'))){_0x3302d5[_0x78b0('0x1f')]=qs[_0x78b0('0x1f')](_0x2b2275[_0x78b0('0x2e')]['limit']);_0x3302d5['offset']=qs['offset'](_0x2b2275[_0x78b0('0x2e')][_0x78b0('0x1d')]);}_0x3302d5['order']=qs[_0x78b0('0x39')](_0x2b2275[_0x78b0('0x2e')][_0x78b0('0x39')]);_0x3302d5[_0x78b0('0x3a')]=qs[_0x78b0('0x30')](_['pick'](_0x2b2275[_0x78b0('0x2e')],_0x4063d0[_0x78b0('0x30')]));_0x3302d5[_0x78b0('0x3a')][_0x78b0('0x4e')]=_0x522588['id'];if(_0x2b2275[_0x78b0('0x2e')]['filter']){_0x3302d5[_0x78b0('0x3a')]=_['merge'](_0x3302d5[_0x78b0('0x3a')],{'$or':_['map'](_0x3302d5[_0x78b0('0x33')],function(_0x3bb197){var _0x14d1f6={};_0x14d1f6[_0x3bb197]={'$like':'%'+_0x2b2275[_0x78b0('0x2e')]['filter']+'%'};return _0x14d1f6;})});}_0x3302d5=_[_0x78b0('0x3d')]({},_0x3302d5,_0x2b2275['options']);return db[_0x78b0('0x4d')]['count']({'where':_0x3302d5[_0x78b0('0x3a')]})[_0x78b0('0x23')](function(_0x544170){_0x4af026['count']=_0x544170;if(_0x2b2275[_0x78b0('0x2e')][_0x78b0('0x44')]){_0x3302d5[_0x78b0('0x3f')]=[{'all':!![]}];}return db[_0x78b0('0x4d')][_0x78b0('0x4f')](_0x3302d5);})[_0x78b0('0x23')](function(_0x530464){_0x4af026[_0x78b0('0x40')]=_0x530464;return _0x4af026;});}})[_0x78b0('0x23')](respondWithFilteredResult(_0x3717bf,_0x3302d5))[_0x78b0('0x41')](handleError(_0x3717bf,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index a597ce0..0d5e312 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 _0x5d17=['lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0x239ed1,_0x4bb53b){var _0x415469=function(_0x404440){while(--_0x404440){_0x239ed1['push'](_0x239ed1['shift']());}};_0x415469(++_0x4bb53b);}(_0x5d17,0x114));var _0x75d1=function(_0x49157b,_0x5d8601){_0x49157b=_0x49157b-0x0;var _0x3ea5d4=_0x5d17[_0x49157b];return _0x3ea5d4;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x75d1('0x2'));var BPromise=require(_0x75d1('0x3'));var rp=require(_0x75d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var attributes=require(_0x75d1('0x7'));module[_0x75d1('0x8')]=function(_0x56ac0a,_0x458681){return _0x56ac0a[_0x75d1('0x9')](_0x75d1('0xa'),attributes,{'tableName':_0x75d1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafb9=['request-promise','path','rimraf','exports','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x340741,_0x20d974){var _0x45902e=function(_0x13be6f){while(--_0x13be6f){_0x340741['push'](_0x340741['shift']());}};_0x45902e(++_0x20d974);}(_0xafb9,0x68));var _0x9afb=function(_0x18d997,_0x2d08ed){_0x18d997=_0x18d997-0x0;var _0x43ac1c=_0xafb9[_0x18d997];return _0x43ac1c;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var logger=require(_0x9afb('0x2'))(_0x9afb('0x3'));var moment=require(_0x9afb('0x4'));var BPromise=require(_0x9afb('0x5'));var rp=require(_0x9afb('0x6'));var fs=require('fs');var path=require(_0x9afb('0x7'));var rimraf=require(_0x9afb('0x8'));var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0x9afb('0x9')]=function(_0x56a139,_0x1ccf93){return _0x56a139['define']('JscriptySessionReport',attributes,{'tableName':_0x9afb('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 912514a..7ac5016 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x20dce3,_0x5d9987){var _0x1362d8=function(_0x22050a){while(--_0x22050a){_0x20dce3['push'](_0x20dce3['shift']());}};_0x1362d8(++_0x5d9987);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'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')]('JscriptySessionReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _0x187d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x29a8d8,_0x5961a8){var _0x387e9d=function(_0xc339c2){while(--_0xc339c2){_0x29a8d8['push'](_0x29a8d8['shift']());}};_0x387e9d(++_0x5961a8);}(_0x187d,0x93));var _0xd187=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x187d[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var moment=require(_0xd187('0x1'));var BPromise=require(_0xd187('0x2'));var rs=require(_0xd187('0x3'));var fs=require('fs');var Redis=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var utils=require(_0xd187('0x6'));var logger=require('../../config/logger')(_0xd187('0x7'));var config=require(_0xd187('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd187('0x9')][_0xd187('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x444a60,_0x1d3fe4,_0x28ce2f){return new BPromise(function(_0x2d6992,_0x358c45){return client[_0xd187('0xb')](_0x444a60,_0x28ce2f)['then'](function(_0x342539){logger[_0xd187('0xc')](_0xd187('0xd'),_0x1d3fe4,_0xd187('0xe'));logger[_0xd187('0xf')](_0xd187('0x10'),_0x1d3fe4,'request\x20sent',JSON[_0xd187('0x11')](_0x342539));if(_0x342539[_0xd187('0x12')]){if(_0x342539[_0xd187('0x12')]['code']===0x1f4){logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539[_0xd187('0x12')]['message']);return _0x358c45(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539['error'][_0xd187('0x13')]);return _0x2d6992(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}else{logger[_0xd187('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x1d3fe4,_0xd187('0xe'));_0x2d6992(_0x342539['result']['message']);}})[_0xd187('0x14')](function(_0x5a4986){logger['error'](_0xd187('0xd'),_0x1d3fe4,_0x5a4986);_0x358c45(_0x5a4986);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index aee9959..3fdd6e7 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 _0x2918=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','isAuthenticated','downloadLogFile','exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x2918,0x170));var _0x8291=function(_0x429bc7,_0x4e44a0){_0x429bc7=_0x429bc7-0x0;var _0x17a9f1=_0x2918[_0x429bc7];return _0x17a9f1;};'use strict';var multer=require(_0x8291('0x0'));var util=require(_0x8291('0x1'));var path=require(_0x8291('0x2'));var timeout=require('connect-timeout');var express=require(_0x8291('0x3'));var router=express[_0x8291('0x4')]();var fs_extra=require(_0x8291('0x5'));var auth=require(_0x8291('0x6'));var interaction=require(_0x8291('0x7'));var config=require(_0x8291('0x8'));var controller=require(_0x8291('0x9'));router[_0x8291('0xa')]('/',controller[_0x8291('0xb')]);router['put'](_0x8291('0xc'),auth['isAuthenticated'](),controller['update']);router['get']('/download_log_file',auth[_0x8291('0xd')](),controller[_0x8291('0xe')]);module[_0x8291('0xf')]=router; \ No newline at end of file +var _0xd3a1=['../../config/environment','./license.controller','get','put','/:id','isAuthenticated','update','downloadLogFile','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x989dd,_0x5ccf13){var _0x2b9ad1=function(_0x343e9f){while(--_0x343e9f){_0x989dd['push'](_0x989dd['shift']());}};_0x2b9ad1(++_0x5ccf13);}(_0xd3a1,0xe5));var _0x1d3a=function(_0x54c15d,_0x52ffeb){_0x54c15d=_0x54c15d-0x0;var _0x2f769b=_0xd3a1[_0x54c15d];return _0x2f769b;};'use strict';var multer=require(_0x1d3a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1d3a('0x1'));var router=express['Router']();var fs_extra=require(_0x1d3a('0x2'));var auth=require(_0x1d3a('0x3'));var interaction=require(_0x1d3a('0x4'));var config=require(_0x1d3a('0x5'));var controller=require(_0x1d3a('0x6'));router[_0x1d3a('0x7')]('/',controller['index']);router[_0x1d3a('0x8')](_0x1d3a('0x9'),auth[_0x1d3a('0xa')](),controller[_0x1d3a('0xb')]);router[_0x1d3a('0x7')]('/download_log_file',auth[_0x1d3a('0xa')](),controller[_0x1d3a('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 984b4b0..cb620fd 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 _0x2b3d=['exports','TEXT','STRING'];(function(_0x5d13d8,_0xeea617){var _0x28ebdc=function(_0x2d3c03){while(--_0x2d3c03){_0x5d13d8['push'](_0x5d13d8['shift']());}};_0x28ebdc(++_0xeea617);}(_0x2b3d,0xfc));var _0xd2b3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x2b3d[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require('sequelize');module[_0xd2b3('0x0')]={'license':{'type':Sequelize[_0xd2b3('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xd2b3('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xdc4d=['TEXT','STRING','INTEGER','exports'];(function(_0x374870,_0x82a474){var _0x4de8f4=function(_0xc42b7){while(--_0xc42b7){_0x374870['push'](_0x374870['shift']());}};_0x4de8f4(++_0x82a474);}(_0xdc4d,0x1bb));var _0xddc4=function(_0x373196,_0x4dba14){_0x373196=_0x373196-0x0;var _0x3bac92=_0xdc4d[_0x373196];return _0x3bac92;};'use strict';var Sequelize=require('sequelize');module[_0xddc4('0x0')]={'license':{'type':Sequelize[_0xddc4('0x1')]},'data1':{'type':Sequelize[_0xddc4('0x2')]},'data2':{'type':Sequelize[_0xddc4('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xddc4('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 2acbb01..ea1bd4c 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 _0x51ad=['stack','name','../../config/license/util','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','body','find','params','get','checkLicense','demo','downloadLogFile','join','/var','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','rimraf','fast-json-patch','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then'];(function(_0x1f2319,_0x4f816a){var _0x2c47f0=function(_0x5ce015){while(--_0x5ce015){_0x1f2319['push'](_0x1f2319['shift']());}};_0x2c47f0(++_0x4f816a);}(_0x51ad,0x18a));var _0xd51a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x51ad[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd51a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd51a('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd51a('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd51a('0x3'));var sox=require(_0xd51a('0x4'));var csv=require(_0xd51a('0x5'));var ejs=require(_0xd51a('0x6'));var fs=require('fs');var fs_extra=require(_0xd51a('0x7'));var _=require(_0xd51a('0x8'));var squel=require(_0xd51a('0x9'));var crypto=require('crypto');var jsforce=require(_0xd51a('0xa'));var deskjs=require(_0xd51a('0xb'));var toCsv=require(_0xd51a('0x5'));var querystring=require(_0xd51a('0xc'));var Papa=require(_0xd51a('0xd'));var Redis=require(_0xd51a('0xe'));var authService=require(_0xd51a('0xf'));var qs=require(_0xd51a('0x10'));var as=require(_0xd51a('0x11'));var hardwareService=require(_0xd51a('0x12'));var logger=require(_0xd51a('0x13'))(_0xd51a('0x14'));var utils=require(_0xd51a('0x15'));var config=require(_0xd51a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd51a('0x17'))['db'];function respondWithStatusCode(_0x495e8d,_0x1232b4){_0x1232b4=_0x1232b4||0xcc;return function(_0x41d60b){if(_0x41d60b){return _0x495e8d[_0xd51a('0x18')](_0x1232b4);}return _0x495e8d[_0xd51a('0x19')](_0x1232b4)[_0xd51a('0x1a')]();};}function respondWithResult(_0x4c21c2,_0x4e7e56){_0x4e7e56=_0x4e7e56||0xc8;return function(_0xf223c2){if(_0xf223c2){return _0x4c21c2[_0xd51a('0x19')](_0x4e7e56)[_0xd51a('0x1b')](_0xf223c2);}};}function respondWithFilteredResult(_0x54cd50,_0x178411){return function(_0x12101b){if(_0x12101b){var _0x2aedb4=typeof _0x178411[_0xd51a('0x1c')]==='undefined'&&typeof _0x178411[_0xd51a('0x1d')]===_0xd51a('0x1e');var _0x5756c6=_0x12101b[_0xd51a('0x1f')];var _0x153e27=_0x2aedb4?0x0:_0x178411[_0xd51a('0x1c')];var _0x42d189=_0x2aedb4?_0x12101b[_0xd51a('0x1f')]:_0x178411[_0xd51a('0x1c')]+_0x178411['limit'];var _0x46bc89;if(_0x42d189>=_0x5756c6){_0x42d189=_0x5756c6;_0x46bc89=0xc8;}else{_0x46bc89=0xce;}_0x54cd50['status'](_0x46bc89);return _0x54cd50[_0xd51a('0x20')]('Content-Range',_0x153e27+'-'+_0x42d189+'/'+_0x5756c6)[_0xd51a('0x1b')](_0x12101b);}return null;};}function patchUpdates(_0xc48fdf){return function(_0x5db6ae){try{jsonpatch[_0xd51a('0x21')](_0x5db6ae,_0xc48fdf,!![]);}catch(_0x44ae1b){return BPromise[_0xd51a('0x22')](_0x44ae1b);}return _0x5db6ae[_0xd51a('0x23')]();};}function saveUpdates(_0x5353c7,_0x5b96ff){return function(_0xda56c0){if(_0xda56c0){return _0xda56c0[_0xd51a('0x24')](_0x5353c7)[_0xd51a('0x25')](function(_0x2e9424){return _0x2e9424;});}return null;};}function removeEntity(_0x12e2e1,_0x47d347){return function(_0x3877ac){if(_0x3877ac){return _0x3877ac['destroy']()[_0xd51a('0x25')](function(){_0x12e2e1['status'](0xcc)[_0xd51a('0x1a')]();});}};}function handleEntityNotFound(_0x29822f,_0x7cdccd){return function(_0x10fca3){if(!_0x10fca3){_0x29822f['sendStatus'](0x194);}return _0x10fca3;};}function handleError(_0x75c557,_0x2e3385){_0x2e3385=_0x2e3385||0x1f4;return function(_0x2aaee4){logger['error'](_0x2aaee4[_0xd51a('0x26')]);if(_0x2aaee4[_0xd51a('0x27')]){delete _0x2aaee4['name'];}_0x75c557[_0xd51a('0x19')](_0x2e3385)['send'](_0x2aaee4);};}var utilLicense=require(_0xd51a('0x28'));exports[_0xd51a('0x29')]=function(_0x56bac4,_0x146eb0){var _0x45a00b={'raw':!![],'where':{'id':0x1}},_0x56b4d3={};_0x56b4d3[_0xd51a('0x2a')]=_[_0xd51a('0x2b')](db[_0xd51a('0x2c')][_0xd51a('0x2d')]);_0x56b4d3[_0xd51a('0x2e')]=_['keys'](_0x56bac4[_0xd51a('0x2e')]);_0x56b4d3[_0xd51a('0x2f')]=_[_0xd51a('0x30')](_0x56b4d3[_0xd51a('0x2a')],_0x56b4d3[_0xd51a('0x2e')]);_0x45a00b[_0xd51a('0x31')]=_[_0xd51a('0x30')](_0x56b4d3[_0xd51a('0x2a')],qs[_0xd51a('0x32')](_0x56bac4[_0xd51a('0x2e')][_0xd51a('0x32')]));_0x45a00b[_0xd51a('0x31')]=_0x45a00b[_0xd51a('0x31')][_0xd51a('0x33')]?_0x45a00b[_0xd51a('0x31')]:_0x56b4d3[_0xd51a('0x2a')];_0x45a00b=_[_0xd51a('0x34')]({},_0x45a00b,_0x56bac4[_0xd51a('0x35')]);return utilLicense[_0xd51a('0x36')](_0x45a00b)[_0xd51a('0x25')](respondWithResult(_0x146eb0,null))[_0xd51a('0x37')](handleError(_0x146eb0,null));};exports[_0xd51a('0x24')]=function(_0x2d4a57,_0x497a84){if(_0x2d4a57[_0xd51a('0x38')]['id']){delete _0x2d4a57[_0xd51a('0x38')]['id'];}return db[_0xd51a('0x2c')][_0xd51a('0x39')]({'where':{'id':_0x2d4a57[_0xd51a('0x3a')]['id']}})[_0xd51a('0x25')](handleEntityNotFound(_0x497a84,null))[_0xd51a('0x25')](function(_0x5d90c0){var _0x5dab9c=_0x5d90c0[_0xd51a('0x3b')]({'plain':!![]});return utilLicense[_0xd51a('0x3c')](_0x5dab9c,_0x2d4a57['body']['key']);})[_0xd51a('0x25')](function(_0x2378d9){if(!_0x2378d9[_0xd51a('0x3d')]){return saveUpdates(_0x2d4a57[_0xd51a('0x38')],null);}return _0x2378d9;})['then'](respondWithResult(_0x497a84,null))[_0xd51a('0x37')](handleError(_0x497a84,null));};exports[_0xd51a('0x3e')]=function(_0x5182cf,_0x7be5c6){var _0x1a2e7d='license-info.log';var _0x3a858f=path[_0xd51a('0x3f')](_0xd51a('0x40'),'log',_0xd51a('0x41'),_0x1a2e7d);_0x7be5c6[_0xd51a('0x42')](_0xd51a('0x43'),_0xd51a('0x44')+_0x1a2e7d);_0x7be5c6[_0xd51a('0x20')](_0xd51a('0x45'),_0xd51a('0x46'));_0x7be5c6[_0xd51a('0x47')](_0x3a858f);}; \ No newline at end of file +var _0x9955=['reject','save','update','then','error','name','send','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','getLicense','body','find','params','get','key','demo','catch','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','text/plain','download','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','apply'];(function(_0x8aa45a,_0x1f2084){var _0x4fba94=function(_0x29861c){while(--_0x29861c){_0x8aa45a['push'](_0x8aa45a['shift']());}};_0x4fba94(++_0x1f2084);}(_0x9955,0xb3));var _0x5995=function(_0x518c07,_0xca9514){_0x518c07=_0x518c07-0x0;var _0xd232a6=_0x9955[_0x518c07];return _0xd232a6;};'use strict';var emlformat=require(_0x5995('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5995('0x1'));var jsonpatch=require(_0x5995('0x2'));var rp=require(_0x5995('0x3'));var moment=require(_0x5995('0x4'));var BPromise=require(_0x5995('0x5'));var Mustache=require(_0x5995('0x6'));var util=require(_0x5995('0x7'));var path=require(_0x5995('0x8'));var sox=require(_0x5995('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5995('0xa'));var _=require(_0x5995('0xb'));var squel=require(_0x5995('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5995('0xd'));var toCsv=require(_0x5995('0xe'));var querystring=require(_0x5995('0xf'));var Papa=require(_0x5995('0x10'));var Redis=require('ioredis');var authService=require(_0x5995('0x11'));var qs=require(_0x5995('0x12'));var as=require(_0x5995('0x13'));var hardwareService=require(_0x5995('0x14'));var logger=require('../../config/logger')(_0x5995('0x15'));var utils=require(_0x5995('0x16'));var config=require(_0x5995('0x17'));var licenseUtil=require(_0x5995('0x18'));var db=require(_0x5995('0x19'))['db'];function respondWithStatusCode(_0x2fc968,_0x5be7c7){_0x5be7c7=_0x5be7c7||0xcc;return function(_0x229c25){if(_0x229c25){return _0x2fc968[_0x5995('0x1a')](_0x5be7c7);}return _0x2fc968[_0x5995('0x1b')](_0x5be7c7)[_0x5995('0x1c')]();};}function respondWithResult(_0x533c24,_0x1af6cf){_0x1af6cf=_0x1af6cf||0xc8;return function(_0x1ce6c9){if(_0x1ce6c9){return _0x533c24[_0x5995('0x1b')](_0x1af6cf)[_0x5995('0x1d')](_0x1ce6c9);}};}function respondWithFilteredResult(_0x482fe7,_0x4ea965){return function(_0x5be87d){if(_0x5be87d){var _0x4befe9=typeof _0x4ea965[_0x5995('0x1e')]==='undefined'&&typeof _0x4ea965['limit']===_0x5995('0x1f');var _0x5dd93a=_0x5be87d[_0x5995('0x20')];var _0x36aab3=_0x4befe9?0x0:_0x4ea965[_0x5995('0x1e')];var _0x53c0e0=_0x4befe9?_0x5be87d[_0x5995('0x20')]:_0x4ea965[_0x5995('0x1e')]+_0x4ea965['limit'];var _0x4b0382;if(_0x53c0e0>=_0x5dd93a){_0x53c0e0=_0x5dd93a;_0x4b0382=0xc8;}else{_0x4b0382=0xce;}_0x482fe7[_0x5995('0x1b')](_0x4b0382);return _0x482fe7['set']('Content-Range',_0x36aab3+'-'+_0x53c0e0+'/'+_0x5dd93a)[_0x5995('0x1d')](_0x5be87d);}return null;};}function patchUpdates(_0x840e39){return function(_0x4f4abc){try{jsonpatch[_0x5995('0x21')](_0x4f4abc,_0x840e39,!![]);}catch(_0x35ca4b){return BPromise[_0x5995('0x22')](_0x35ca4b);}return _0x4f4abc[_0x5995('0x23')]();};}function saveUpdates(_0x1b7048,_0x1335ee){return function(_0x4edc7d){if(_0x4edc7d){return _0x4edc7d[_0x5995('0x24')](_0x1b7048)[_0x5995('0x25')](function(_0x3f5dc8){return _0x3f5dc8;});}return null;};}function removeEntity(_0xcc7cd7,_0x448c0d){return function(_0x3c8a6f){if(_0x3c8a6f){return _0x3c8a6f['destroy']()[_0x5995('0x25')](function(){_0xcc7cd7['status'](0xcc)[_0x5995('0x1c')]();});}};}function handleEntityNotFound(_0x249175,_0x3763b1){return function(_0x509831){if(!_0x509831){_0x249175[_0x5995('0x1a')](0x194);}return _0x509831;};}function handleError(_0x270dd4,_0x491bda){_0x491bda=_0x491bda||0x1f4;return function(_0x204dff){logger[_0x5995('0x26')](_0x204dff['stack']);if(_0x204dff[_0x5995('0x27')]){delete _0x204dff[_0x5995('0x27')];}_0x270dd4[_0x5995('0x1b')](_0x491bda)[_0x5995('0x28')](_0x204dff);};}var utilLicense=require(_0x5995('0x18'));exports['index']=function(_0x10c19b,_0x6a9630){var _0x2f9c14={'raw':!![],'where':{'id':0x1}},_0x14523d={};_0x14523d[_0x5995('0x29')]=_[_0x5995('0x2a')](db[_0x5995('0x2b')][_0x5995('0x2c')]);_0x14523d[_0x5995('0x2d')]=_[_0x5995('0x2a')](_0x10c19b[_0x5995('0x2d')]);_0x14523d[_0x5995('0x2e')]=_[_0x5995('0x2f')](_0x14523d[_0x5995('0x29')],_0x14523d[_0x5995('0x2d')]);_0x2f9c14[_0x5995('0x30')]=_['intersection'](_0x14523d[_0x5995('0x29')],qs[_0x5995('0x31')](_0x10c19b[_0x5995('0x2d')][_0x5995('0x31')]));_0x2f9c14[_0x5995('0x30')]=_0x2f9c14['attributes'][_0x5995('0x32')]?_0x2f9c14[_0x5995('0x30')]:_0x14523d[_0x5995('0x29')];_0x2f9c14=_[_0x5995('0x33')]({},_0x2f9c14,_0x10c19b[_0x5995('0x34')]);return utilLicense[_0x5995('0x35')](_0x2f9c14)['then'](respondWithResult(_0x6a9630,null))['catch'](handleError(_0x6a9630,null));};exports[_0x5995('0x24')]=function(_0x291fc9,_0x53b70a){if(_0x291fc9[_0x5995('0x36')]['id']){delete _0x291fc9[_0x5995('0x36')]['id'];}return db[_0x5995('0x2b')][_0x5995('0x37')]({'where':{'id':_0x291fc9[_0x5995('0x38')]['id']}})[_0x5995('0x25')](handleEntityNotFound(_0x53b70a,null))[_0x5995('0x25')](function(_0x2f8584){var _0x3e80fe=_0x2f8584[_0x5995('0x39')]({'plain':!![]});return utilLicense['checkLicense'](_0x3e80fe,_0x291fc9[_0x5995('0x36')][_0x5995('0x3a')]);})[_0x5995('0x25')](function(_0x48f1cb){if(!_0x48f1cb[_0x5995('0x3b')]){return saveUpdates(_0x291fc9[_0x5995('0x36')],null);}return _0x48f1cb;})[_0x5995('0x25')](respondWithResult(_0x53b70a,null))[_0x5995('0x3c')](handleError(_0x53b70a,null));};exports['downloadLogFile']=function(_0x4665a0,_0x418d2e){var _0x1837cb=_0x5995('0x3d');var _0x28b287=path[_0x5995('0x3e')](_0x5995('0x3f'),_0x5995('0x40'),_0x5995('0x41'),_0x1837cb);_0x418d2e[_0x5995('0x42')](_0x5995('0x43'),_0x5995('0x44')+_0x1837cb);_0x418d2e['set']('Content-Type',_0x5995('0x45'));_0x418d2e[_0x5995('0x46')](_0x28b287);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index f477e85..7131495 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 _0x65b1=['define','License','license','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x65b1,0xe3));var _0x165b=function(_0x12edf9,_0x52945a){_0x12edf9=_0x12edf9-0x0;var _0x3cc0fa=_0x65b1[_0x12edf9];return _0x3cc0fa;};'use strict';var _=require('lodash');var util=require(_0x165b('0x0'));var logger=require(_0x165b('0x1'))(_0x165b('0x2'));var moment=require(_0x165b('0x3'));var BPromise=require(_0x165b('0x4'));var rp=require(_0x165b('0x5'));var fs=require('fs');var path=require(_0x165b('0x6'));var rimraf=require(_0x165b('0x7'));var config=require(_0x165b('0x8'));var attributes=require(_0x165b('0x9'));module[_0x165b('0xa')]=function(_0x18c312,_0x37ff18){return _0x18c312[_0x165b('0xb')](_0x165b('0xc'),attributes,{'tableName':_0x165b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9612=['bluebird','request-promise','../../config/environment','exports','define','License','license','lodash','util','../../config/logger','api','moment'];(function(_0x245a7d,_0x253c2f){var _0x24789d=function(_0x189e60){while(--_0x189e60){_0x245a7d['push'](_0x245a7d['shift']());}};_0x24789d(++_0x253c2f);}(_0x9612,0x67));var _0x2961=function(_0x457a98,_0x19003c){_0x457a98=_0x457a98-0x0;var _0x2a7a45=_0x9612[_0x457a98];return _0x2a7a45;};'use strict';var _=require(_0x2961('0x0'));var util=require(_0x2961('0x1'));var logger=require(_0x2961('0x2'))(_0x2961('0x3'));var moment=require(_0x2961('0x4'));var BPromise=require(_0x2961('0x5'));var rp=require(_0x2961('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2961('0x7'));var attributes=require('./license.attributes');module[_0x2961('0x8')]=function(_0x22cda7,_0x4c9e2b){return _0x22cda7[_0x2961('0x9')](_0x2961('0xa'),attributes,{'tableName':_0x2961('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 50fbec2..6b6fc6c 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 _0x1957=['License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','then'];(function(_0x437f18,_0x50c657){var _0x3e1ce=function(_0x166718){while(--_0x166718){_0x437f18['push'](_0x437f18['shift']());}};_0x3e1ce(++_0x50c657);}(_0x1957,0x87));var _0x7195=function(_0x17c483,_0xc69535){_0x17c483=_0x17c483-0x0;var _0x112bdb=_0x1957[_0x17c483];return _0x112bdb;};'use strict';var _=require(_0x7195('0x0'));var util=require(_0x7195('0x1'));var moment=require(_0x7195('0x2'));var BPromise=require(_0x7195('0x3'));var rs=require(_0x7195('0x4'));var fs=require('fs');var Redis=require(_0x7195('0x5'));var db=require(_0x7195('0x6'))['db'];var utils=require(_0x7195('0x7'));var logger=require(_0x7195('0x8'))(_0x7195('0x9'));var config=require('../../config/environment');var jayson=require(_0x7195('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x35bc4e,_0x2136b6,_0x1fa381){return new BPromise(function(_0x473e5b,_0x33efb7){return client['request'](_0x35bc4e,_0x1fa381)[_0x7195('0xb')](function(_0x3fe580){logger['info'](_0x7195('0xc'),_0x2136b6,_0x7195('0xd'));logger[_0x7195('0xe')](_0x7195('0xf'),_0x2136b6,_0x7195('0xd'),JSON[_0x7195('0x10')](_0x3fe580));if(_0x3fe580['error']){if(_0x3fe580[_0x7195('0x11')]['code']===0x1f4){logger[_0x7195('0x11')](_0x7195('0xc'),_0x2136b6,_0x3fe580['error'][_0x7195('0x12')]);return _0x33efb7(_0x3fe580[_0x7195('0x11')][_0x7195('0x12')]);}logger['error'](_0x7195('0xc'),_0x2136b6,_0x3fe580[_0x7195('0x11')]['message']);return _0x473e5b(_0x3fe580[_0x7195('0x11')][_0x7195('0x12')]);}else{logger[_0x7195('0x13')]('License,\x20%s,\x20%s',_0x2136b6,_0x7195('0xd'));_0x473e5b(_0x3fe580[_0x7195('0x14')][_0x7195('0x12')]);}})['catch'](function(_0x230a3e){logger[_0x7195('0x11')]('License,\x20%s,\x20%s',_0x2136b6,_0x230a3e);_0x33efb7(_0x230a3e);});});} \ No newline at end of file +var _0xcf40=['result','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xcf40,0x17d));var _0x0cf4=function(_0x4b5b94,_0x3a5ad5){_0x4b5b94=_0x4b5b94-0x0;var _0x50a599=_0xcf40[_0x4b5b94];return _0x50a599;};'use strict';var _=require('lodash');var util=require(_0x0cf4('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0cf4('0x1'));var fs=require('fs');var Redis=require(_0x0cf4('0x2'));var db=require(_0x0cf4('0x3'))['db'];var utils=require(_0x0cf4('0x4'));var logger=require(_0x0cf4('0x5'))('rpc');var config=require(_0x0cf4('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0cf4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xa61d48,_0x52762e,_0x528f21){return new BPromise(function(_0xf81095,_0x1c7974){return client[_0x0cf4('0x8')](_0xa61d48,_0x528f21)[_0x0cf4('0x9')](function(_0x3c05b2){logger['info'](_0x0cf4('0xa'),_0x52762e,_0x0cf4('0xb'));logger[_0x0cf4('0xc')](_0x0cf4('0xd'),_0x52762e,_0x0cf4('0xb'),JSON[_0x0cf4('0xe')](_0x3c05b2));if(_0x3c05b2[_0x0cf4('0xf')]){if(_0x3c05b2[_0x0cf4('0xf')][_0x0cf4('0x10')]===0x1f4){logger[_0x0cf4('0xf')](_0x0cf4('0xa'),_0x52762e,_0x3c05b2[_0x0cf4('0xf')][_0x0cf4('0x11')]);return _0x1c7974(_0x3c05b2[_0x0cf4('0xf')][_0x0cf4('0x11')]);}logger[_0x0cf4('0xf')]('License,\x20%s,\x20%s',_0x52762e,_0x3c05b2[_0x0cf4('0xf')][_0x0cf4('0x11')]);return _0xf81095(_0x3c05b2['error'][_0x0cf4('0x11')]);}else{logger[_0x0cf4('0x12')]('License,\x20%s,\x20%s',_0x52762e,_0x0cf4('0xb'));_0xf81095(_0x3c05b2[_0x0cf4('0x13')][_0x0cf4('0x11')]);}})['catch'](function(_0x76c888){logger[_0x0cf4('0xf')](_0x0cf4('0xa'),_0x52762e,_0x76c888);_0x1c7974(_0x76c888);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index b0e7141..5a0679e 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 _0x95e7=['/describe','isAuthenticated','describe','/:id','/:id/dispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','/:id/canned_answers','create','addImap','addSmtp','addInteraction','/:id/applications','addApplications','send','addAgents','put','update','removeDispositions','delete','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get'];(function(_0xf03bd9,_0x240cc6){var _0x2900cc=function(_0x6ee635){while(--_0x6ee635){_0xf03bd9['push'](_0xf03bd9['shift']());}};_0x2900cc(++_0x240cc6);}(_0x95e7,0x15e));var _0x795e=function(_0x317e0b,_0x528b59){_0x317e0b=_0x317e0b-0x0;var _0x45e537=_0x95e7[_0x317e0b];return _0x45e537;};'use strict';var multer=require(_0x795e('0x0'));var util=require(_0x795e('0x1'));var path=require('path');var timeout=require(_0x795e('0x2'));var express=require(_0x795e('0x3'));var router=express[_0x795e('0x4')]();var fs_extra=require(_0x795e('0x5'));var auth=require(_0x795e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x795e('0x7'));var controller=require(_0x795e('0x8'));router[_0x795e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x795e('0x9')](_0x795e('0xa'),auth[_0x795e('0xb')](),controller[_0x795e('0xc')]);router['get'](_0x795e('0xd'),auth[_0x795e('0xb')](),controller['show']);router[_0x795e('0x9')](_0x795e('0xe'),auth[_0x795e('0xb')](),controller['getDispositions']);router[_0x795e('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x795e('0xf')]);router[_0x795e('0x9')](_0x795e('0x10'),auth[_0x795e('0xb')](),controller[_0x795e('0x11')]);router['get'](_0x795e('0x12'),auth[_0x795e('0xb')](),controller[_0x795e('0x13')]);router[_0x795e('0x9')](_0x795e('0x14'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x795e('0x9')]('/:id/applications',auth[_0x795e('0xb')](),controller['getApplications']);router[_0x795e('0x9')]('/:id/messages',auth[_0x795e('0xb')](),controller[_0x795e('0x15')]);router[_0x795e('0x9')](_0x795e('0x16'),auth[_0x795e('0xb')](),controller[_0x795e('0x17')]);router['get'](_0x795e('0x18'),auth[_0x795e('0xb')](),controller[_0x795e('0x19')]);router[_0x795e('0x1a')](_0x795e('0xe'),auth[_0x795e('0xb')](),controller['addDisposition']);router['post'](_0x795e('0x1b'),auth[_0x795e('0xb')](),controller['addAnswer']);router['post']('/',auth[_0x795e('0xb')](),controller[_0x795e('0x1c')]);router[_0x795e('0x1a')](_0x795e('0x10'),auth['isAuthenticated'](),controller[_0x795e('0x1d')]);router[_0x795e('0x1a')](_0x795e('0x12'),auth['isAuthenticated'](),controller[_0x795e('0x1e')]);router[_0x795e('0x1a')](_0x795e('0x14'),auth[_0x795e('0xb')](),controller[_0x795e('0x1f')]);router[_0x795e('0x1a')](_0x795e('0x20'),auth[_0x795e('0xb')](),controller[_0x795e('0x21')]);router[_0x795e('0x1a')]('/:id/send',auth[_0x795e('0xb')](),controller[_0x795e('0x22')]);router['post'](_0x795e('0x18'),auth[_0x795e('0xb')](),controller[_0x795e('0x23')]);router[_0x795e('0x24')](_0x795e('0xd'),auth[_0x795e('0xb')](),controller[_0x795e('0x25')]);router['delete'](_0x795e('0xe'),auth[_0x795e('0xb')](),controller[_0x795e('0x26')]);router['delete']('/:id/canned_answers',auth[_0x795e('0xb')](),controller['removeAnswers']);router[_0x795e('0x27')]('/:id/in_servers',auth[_0x795e('0xb')](),controller[_0x795e('0x28')]);router[_0x795e('0x27')](_0x795e('0x12'),auth[_0x795e('0xb')](),controller[_0x795e('0x29')]);router['delete'](_0x795e('0xd'),auth['isAuthenticated'](),controller[_0x795e('0x2a')]);router[_0x795e('0x27')](_0x795e('0x18'),auth['isAuthenticated'](),controller[_0x795e('0x2b')]);module[_0x795e('0x2c')]=router; \ No newline at end of file +var _0x6c9a=['/:id/in_servers','addImap','/:id/out_servers','addInteraction','/:id/send','send','addAgents','update','delete','removeDispositions','removeImap','removeSmtp','destroy','exports','multer','path','connect-timeout','express','Router','./mailAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getImap','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','/:id/dispositions','addDisposition','addAnswer','post'];(function(_0x302d60,_0x30b060){var _0xc0b6df=function(_0x2407e8){while(--_0x2407e8){_0x302d60['push'](_0x302d60['shift']());}};_0xc0b6df(++_0x30b060);}(_0x6c9a,0x17f));var _0xa6c9=function(_0xef36e7,_0x4b51d5){_0xef36e7=_0xef36e7-0x0;var _0x10d3a2=_0x6c9a[_0xef36e7];return _0x10d3a2;};'use strict';var multer=require(_0xa6c9('0x0'));var util=require('util');var path=require(_0xa6c9('0x1'));var timeout=require(_0xa6c9('0x2'));var express=require(_0xa6c9('0x3'));var router=express[_0xa6c9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa6c9('0x5'));router['get']('/',auth[_0xa6c9('0x6')](),controller['index']);router[_0xa6c9('0x7')](_0xa6c9('0x8'),auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x9')]);router[_0xa6c9('0x7')](_0xa6c9('0xa'),auth[_0xa6c9('0x6')](),controller[_0xa6c9('0xb')]);router['get']('/:id/dispositions',auth[_0xa6c9('0x6')](),controller[_0xa6c9('0xc')]);router[_0xa6c9('0x7')](_0xa6c9('0xd'),auth[_0xa6c9('0x6')](),controller['getAnswers']);router[_0xa6c9('0x7')]('/:id/in_servers',auth[_0xa6c9('0x6')](),controller[_0xa6c9('0xe')]);router[_0xa6c9('0x7')]('/:id/out_servers',auth[_0xa6c9('0x6')](),controller['getSmtp']);router['get'](_0xa6c9('0xf'),auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x10')]);router['get'](_0xa6c9('0x11'),auth[_0xa6c9('0x6')](),controller['getApplications']);router[_0xa6c9('0x7')](_0xa6c9('0x12'),auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x13')]);router['get'](_0xa6c9('0x14'),auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x15')]);router[_0xa6c9('0x7')](_0xa6c9('0x16'),auth[_0xa6c9('0x6')](),controller['getAgents']);router['post'](_0xa6c9('0x17'),auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x18')]);router['post'](_0xa6c9('0xd'),auth['isAuthenticated'](),controller[_0xa6c9('0x19')]);router[_0xa6c9('0x1a')]('/',auth[_0xa6c9('0x6')](),controller['create']);router[_0xa6c9('0x1a')](_0xa6c9('0x1b'),auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x1c')]);router[_0xa6c9('0x1a')](_0xa6c9('0x1d'),auth['isAuthenticated'](),controller['addSmtp']);router[_0xa6c9('0x1a')](_0xa6c9('0xf'),auth['isAuthenticated'](),controller[_0xa6c9('0x1e')]);router[_0xa6c9('0x1a')](_0xa6c9('0x11'),auth['isAuthenticated'](),controller['addApplications']);router[_0xa6c9('0x1a')](_0xa6c9('0x1f'),auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x20')]);router[_0xa6c9('0x1a')](_0xa6c9('0x16'),auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x21')]);router['put']('/:id',auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x22')]);router[_0xa6c9('0x23')](_0xa6c9('0x17'),auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x24')]);router[_0xa6c9('0x23')]('/:id/canned_answers',auth[_0xa6c9('0x6')](),controller['removeAnswers']);router['delete'](_0xa6c9('0x1b'),auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x25')]);router[_0xa6c9('0x23')]('/:id/out_servers',auth[_0xa6c9('0x6')](),controller[_0xa6c9('0x26')]);router[_0xa6c9('0x23')](_0xa6c9('0xa'),auth['isAuthenticated'](),controller[_0xa6c9('0x27')]);router['delete'](_0xa6c9('0x16'),auth[_0xa6c9('0x6')](),controller['removeAgents']);module[_0xa6c9('0x28')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 2f63318..140bd9a 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 _0x22ac=['Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','TEXT','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','ENUM','gmail','hotmail','yahoo','outlook365','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x22ac,0x114));var _0xc22a=function(_0x45321d,_0x58eb4f){_0x45321d=_0x45321d-0x0;var _0x1a999a=_0x22ac[_0x45321d];return _0x1a999a;};'use strict';var Sequelize=require(_0xc22a('0x0'));module[_0xc22a('0x1')]={'description':{'type':Sequelize[_0xc22a('0x2')]},'name':{'type':Sequelize[_0xc22a('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xc22a('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xc22a('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xc22a('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xc22a('0x2')],'allowNull':![],'defaultValue':_0xc22a('0x4')},'fontSize':{'type':Sequelize[_0xc22a('0x5')](0x2)[_0xc22a('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xc22a('0x7')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0xc22a('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc22a('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc22a('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc22a('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc22a('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc22a('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xc22a('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xc22a('0x3')],'defaultValue':![],'comment':_0xc22a('0x9'),'set':function(_0x46989e){if(!_0x46989e)this['setDataValue'](_0xc22a('0xa'),null);this[_0xc22a('0xb')]('mandatoryDisposition',_0x46989e);}},'provider':{'type':Sequelize[_0xc22a('0xc')](_0xc22a('0xd'),_0xc22a('0xe'),_0xc22a('0xf'),_0xc22a('0x10')),'defaultValue':null,'get':function(){if(!this[_0xc22a('0x11')](_0xc22a('0x12')))return _0xc22a('0x13');return this[_0xc22a('0x11')](_0xc22a('0x12'));},'set':function(_0x51fe79){if(_0x51fe79===_0xc22a('0x13'))_0x51fe79=null;return this[_0xc22a('0xb')](_0xc22a('0x12'),_0x51fe79);}}}; \ No newline at end of file +var _0xa264=['mandatoryDisposition','ENUM','gmail','hotmail','yahoo','getDataValue','custom','provider','STRING','TEXT','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','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'];(function(_0x2e5b51,_0x47523d){var _0x423bd0=function(_0x545607){while(--_0x545607){_0x2e5b51['push'](_0x2e5b51['shift']());}};_0x423bd0(++_0x47523d);}(_0xa264,0x1d3));var _0x4a26=function(_0x4450b1,_0x214ace){_0x4450b1=_0x4450b1-0x0;var _0x399b0b=_0xa264[_0x4450b1];return _0x399b0b;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x4a26('0x0')]},'name':{'type':Sequelize[_0x4a26('0x0')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x4a26('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x4a26('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0x4a26('0x1')]},'markAsUnread':{'type':Sequelize[_0x4a26('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4a26('0x3')},'fontSize':{'type':Sequelize[_0x4a26('0x4')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x4a26('0x1')],'defaultValue':function(){return _0x4a26('0x5');}},'notificationSound':{'type':Sequelize[_0x4a26('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4a26('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4a26('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4a26('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4a26('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4a26('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x4a26('0x6')},'mandatoryDisposition':{'type':Sequelize[_0x4a26('0x2')],'defaultValue':![],'comment':_0x4a26('0x7'),'set':function(_0x30dfe7){if(!_0x30dfe7)this[_0x4a26('0x8')]('mandatoryDispositionPauseId',null);this[_0x4a26('0x8')](_0x4a26('0x9'),_0x30dfe7);}},'provider':{'type':Sequelize[_0x4a26('0xa')](_0x4a26('0xb'),_0x4a26('0xc'),_0x4a26('0xd'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x4a26('0xe')]('provider'))return _0x4a26('0xf');return this[_0x4a26('0xe')](_0x4a26('0x10'));},'set':function(_0x35c0e0){if(_0x35c0e0===_0x4a26('0xf'))_0x35c0e0=null;return this['setDataValue'](_0x4a26('0x10'),_0x35c0e0);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 2daa398..97c3a36 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 _0x0cd9=['Messages','verifySmtp','CloudProvider','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','juice','ioredis','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','destroy','MailAccounts','UserProfileResource','end','stack','name','send','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Smtp','index','Imap','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','MailServerOut','rawAttributes','find','update','body','provider','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','params','Disposition','getDispositions','findAll','removeDispositions','MailAccountId','create','CannedAnswer','removeAnswers','ids','email','ListId','isNil','active','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','findOne','MailServerIn','removeImap','setImap','getSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','CmContact','User','internal','Tag','Tags','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','MailMessage','split','format','true','CmList','List','Contacts','DESC','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','messageId','subject','attach','out','Interaction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0cd9,0x191));var _0x90cd=function(_0x501a25,_0x258a62){_0x501a25=_0x501a25-0x0;var _0x10da8e=_0x0cd9[_0x501a25];return _0x10da8e;};'use strict';var moment=require(_0x90cd('0x0'));var BPromise=require(_0x90cd('0x1'));var util=require(_0x90cd('0x2'));var path=require(_0x90cd('0x3'));var _=require(_0x90cd('0x4'));var juice=require(_0x90cd('0x5'));var Redis=require(_0x90cd('0x6'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x90cd('0x7'));var config=require(_0x90cd('0x8'));var db=require(_0x90cd('0x9'))['db'];config[_0x90cd('0xa')]=_[_0x90cd('0xb')](config['redis'],{'host':_0x90cd('0xc'),'port':0x18eb});var socket=require(_0x90cd('0xd'))(new Redis(config[_0x90cd('0xa')]));require('./mailAccount.socket')[_0x90cd('0xe')](socket);var jayson=require(_0x90cd('0xf'));var client=jayson['client'][_0x90cd('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x2627cd,_0x2c1341,_0x463234,_0x375205){return new BPromise(function(_0x4c0e0a,_0x1585cb){var _0x19142b=_0x375205||client;return _0x19142b['request'](_0x2627cd,_0x463234)[_0x90cd('0x11')](function(_0x26e7e1){logger[_0x90cd('0x12')](_0x90cd('0x13'),_0x2c1341,_0x90cd('0x14'));logger[_0x90cd('0x15')](_0x90cd('0x16'),_0x2c1341,_0x90cd('0x14'),JSON[_0x90cd('0x17')](_0x26e7e1));if(_0x26e7e1[_0x90cd('0x18')]){if(_0x26e7e1[_0x90cd('0x18')][_0x90cd('0x19')]===0x1f4){logger[_0x90cd('0x18')]('MailAccount,\x20%s,\x20%s',_0x2c1341,_0x26e7e1[_0x90cd('0x18')][_0x90cd('0x1a')]);return _0x1585cb(_0x26e7e1[_0x90cd('0x18')][_0x90cd('0x1a')]);}logger[_0x90cd('0x18')](_0x90cd('0x13'),_0x2c1341,_0x26e7e1[_0x90cd('0x18')]['message']);return _0x4c0e0a(_0x26e7e1[_0x90cd('0x18')][_0x90cd('0x1a')]);}else{logger[_0x90cd('0x12')]('MailAccount,\x20%s,\x20%s',_0x2c1341,'request\x20sent');_0x4c0e0a(_0x26e7e1['result'][_0x90cd('0x1a')]);}})[_0x90cd('0x1b')](function(_0x246e53){logger[_0x90cd('0x18')]('MailAccount,\x20%s,\x20%s',_0x2c1341,_0x246e53);_0x1585cb(_0x246e53);});});}function respondWithStatusCode(_0x2c3e65,_0x1b1c1f){_0x1b1c1f=_0x1b1c1f||0xcc;return function(_0x2b570){if(_0x2b570){return _0x2c3e65[_0x90cd('0x1c')](_0x1b1c1f);}return _0x2c3e65[_0x90cd('0x1d')](_0x1b1c1f)['end']();};}function respondWithResult(_0x314e56,_0x10f106){_0x10f106=_0x10f106||0xc8;return function(_0x380b0d){if(_0x380b0d){return _0x314e56[_0x90cd('0x1d')](_0x10f106)[_0x90cd('0x1e')](_0x380b0d);}};}function respondWithFilteredResult(_0x3cd56c,_0x2acdb7){return function(_0x478396){if(_0x478396){var _0x25de73=typeof _0x2acdb7['offset']==='undefined'&&typeof _0x2acdb7['limit']===_0x90cd('0x1f');var _0x4d1cda=_0x478396['count'];var _0x470253=_0x25de73?0x0:_0x2acdb7[_0x90cd('0x20')];var _0x2b78d7=_0x25de73?_0x478396[_0x90cd('0x21')]:_0x2acdb7[_0x90cd('0x20')]+_0x2acdb7[_0x90cd('0x22')];var _0x8c6396;if(_0x2b78d7>=_0x4d1cda){_0x2b78d7=_0x4d1cda;_0x8c6396=0xc8;}else{_0x8c6396=0xce;}_0x3cd56c[_0x90cd('0x1d')](_0x8c6396);return _0x3cd56c[_0x90cd('0x23')](_0x90cd('0x24'),_0x470253+'-'+_0x2b78d7+'/'+_0x4d1cda)[_0x90cd('0x1e')](_0x478396);}return null;};}function saveUpdates(_0x1304b5){return function(_0x254fdc){if(_0x254fdc){return _0x254fdc['update'](_0x1304b5)[_0x90cd('0x11')](function(_0x46b486){return _0x46b486;});}return null;};}function removeEntity(_0x983c61){return function(_0x16d0a9){if(_0x16d0a9){return _0x16d0a9[_0x90cd('0x25')]()[_0x90cd('0x11')](function(){var _0x44d0d7=_0x16d0a9['get']({'plain':!![]});var _0x3ba537=_0x90cd('0x26');return db[_0x90cd('0x27')][_0x90cd('0x25')]({'where':{'type':_0x3ba537,'resourceId':_0x44d0d7['id']}})[_0x90cd('0x11')](function(){return _0x16d0a9;});})[_0x90cd('0x11')](function(){_0x983c61[_0x90cd('0x1d')](0xcc)[_0x90cd('0x28')]();});}};}function handleEntityNotFound(_0x2c9191){return function(_0x3a3eeb){if(!_0x3a3eeb){_0x2c9191[_0x90cd('0x1c')](0x194);}return _0x3a3eeb;};}function handleError(_0x1aa7c2,_0x20ec0c){_0x20ec0c=_0x20ec0c||0x1f4;return function(_0x4b66cf){logger[_0x90cd('0x18')](_0x4b66cf[_0x90cd('0x29')]);if(_0x4b66cf[_0x90cd('0x2a')]){delete _0x4b66cf['name'];}_0x1aa7c2[_0x90cd('0x1d')](_0x20ec0c)[_0x90cd('0x2b')](_0x4b66cf);};}function getImapHost(_0xcc6faf){switch(_0xcc6faf){case _0x90cd('0x2c'):return'imap.gmail.com';case _0x90cd('0x2d'):return _0x90cd('0x2e');case _0x90cd('0x2f'):return _0x90cd('0x30');case _0x90cd('0x31'):return _0x90cd('0x32');}throw new Error(_0x90cd('0x33'),_0xcc6faf);}function getSmtpHost(_0x578967){switch(_0x578967){case _0x90cd('0x2c'):return _0x90cd('0x34');case _0x90cd('0x2d'):return'smtp.mail.yahoo.com';case _0x90cd('0x2f'):return _0x90cd('0x35');case _0x90cd('0x31'):return _0x90cd('0x36');}throw new Error(_0x90cd('0x33'),_0x578967);}function getAuthenticationOptions(_0x3f45ec,_0x4f92ac){var _0x4daf28={};var _0x198da1={};if(_0x3f45ec){_0x4daf28[_0x90cd('0x37')]=_0x198da1[_0x90cd('0x37')]=_0x4f92ac[_0x90cd('0x38')];_0x4daf28[_0x90cd('0x39')]=_0x198da1[_0x90cd('0x3a')]=_0x4f92ac[_0x90cd('0x39')];if(_0x4f92ac[_0x90cd('0x3b')]){_0x4daf28[_0x90cd('0x3b')]=_0x198da1['modernAuthentication']=!![];_0x4daf28[_0x90cd('0x3c')]=_0x198da1[_0x90cd('0x3c')]=_0x4f92ac[_0x90cd('0x3c')];_0x4daf28[_0x90cd('0x39')]=_0x198da1[_0x90cd('0x3a')]=null;}else{_0x4daf28[_0x90cd('0x3c')]=_0x198da1['CloudProviderId']=null;}_0x4daf28[_0x90cd('0x3d')]=getImapHost(_0x3f45ec);_0x4daf28[_0x90cd('0x3e')]=0x3e1;_0x198da1['host']=getSmtpHost(_0x3f45ec);_0x198da1[_0x90cd('0x3e')]=0x24b;_0x198da1[_0x90cd('0x3f')]=![];_0x4daf28[_0x90cd('0x40')]=_0x198da1['service']=null;}else{if(_0x4f92ac[_0x90cd('0x41')]){_0x4daf28['user']=_0x198da1[_0x90cd('0x37')]=_0x4f92ac[_0x90cd('0x38')];_0x4daf28['password']=_0x198da1[_0x90cd('0x3a')]=_0x4f92ac[_0x90cd('0x39')];}else{_0x4daf28[_0x90cd('0x41')]=_0x198da1[_0x90cd('0x41')]=![];_0x4daf28[_0x90cd('0x37')]=_0x198da1['user']=null;_0x4daf28[_0x90cd('0x39')]=_0x198da1[_0x90cd('0x3a')]=null;}_0x4daf28[_0x90cd('0x3d')]=_0x4f92ac['Imap'][_0x90cd('0x3d')];_0x4daf28[_0x90cd('0x3e')]=_0x4f92ac['Imap']['port'];_0x198da1[_0x90cd('0x3d')]=_0x4f92ac[_0x90cd('0x42')][_0x90cd('0x3d')];_0x198da1['port']=_0x4f92ac['Smtp']['port'];}return{'Imap':_0x4daf28,'Smtp':_0x198da1};}exports[_0x90cd('0x43')]=function(_0x1ad5a9,_0x782d65){var _0x3d5731={'include':[{'model':db['MailServerIn'],'as':_0x90cd('0x44')},{'model':db['MailServerOut'],'as':_0x90cd('0x42')},{'model':db[_0x90cd('0x45')],'as':_0x90cd('0x46')}]},_0x14ec24={},_0xd525dc={'count':0x0,'rows':[]};var _0x585fa5=_[_0x90cd('0x47')](db[_0x90cd('0x48')]['rawAttributes'],function(_0x513e50){return{'name':_0x513e50[_0x90cd('0x49')],'type':_0x513e50[_0x90cd('0x4a')][_0x90cd('0x4b')]};});_0x14ec24[_0x90cd('0x4c')]=_[_0x90cd('0x47')](_0x585fa5,_0x90cd('0x2a'));_0x14ec24[_0x90cd('0x4d')]=_[_0x90cd('0x4e')](_0x1ad5a9['query']);_0x14ec24['filters']=_['intersection'](_0x14ec24['model'],_0x14ec24['query']);_0x3d5731[_0x90cd('0x4f')]=_[_0x90cd('0x50')](_0x14ec24[_0x90cd('0x4c')],qs[_0x90cd('0x51')](_0x1ad5a9[_0x90cd('0x4d')]['fields']));_0x3d5731[_0x90cd('0x4f')]=_0x3d5731[_0x90cd('0x4f')][_0x90cd('0x52')]?_0x3d5731[_0x90cd('0x4f')]:_0x14ec24[_0x90cd('0x4c')];if(!_0x1ad5a9[_0x90cd('0x4d')][_0x90cd('0x53')](_0x90cd('0x54'))){_0x3d5731['limit']=qs[_0x90cd('0x22')](_0x1ad5a9[_0x90cd('0x4d')][_0x90cd('0x22')]);_0x3d5731['offset']=qs['offset'](_0x1ad5a9['query'][_0x90cd('0x20')]);}_0x3d5731[_0x90cd('0x55')]=qs[_0x90cd('0x56')](_0x1ad5a9['query'][_0x90cd('0x56')]);_0x3d5731[_0x90cd('0x57')]=qs[_0x90cd('0x58')](_[_0x90cd('0x59')](_0x1ad5a9[_0x90cd('0x4d')],_0x14ec24['filters']),_0x585fa5);if(_0x1ad5a9['query'][_0x90cd('0x5a')]){_0x3d5731[_0x90cd('0x57')]=_[_0x90cd('0x5b')](_0x3d5731[_0x90cd('0x57')],{'$or':_[_0x90cd('0x47')](_0x585fa5,function(_0x13996f){if(_0x13996f[_0x90cd('0x4a')]!==_0x90cd('0x5c')){var _0x3b5f24={};_0x3b5f24[_0x13996f[_0x90cd('0x2a')]]={'$like':'%'+_0x1ad5a9[_0x90cd('0x4d')]['filter']+'%'};return _0x3b5f24;}})});}_0x3d5731=_[_0x90cd('0x5b')]({},_0x3d5731,_0x1ad5a9[_0x90cd('0x5d')]);var _0x4a32e8={'where':_0x3d5731[_0x90cd('0x57')]};return db[_0x90cd('0x48')]['count'](_0x4a32e8)[_0x90cd('0x11')](function(_0x11d8b4){_0xd525dc[_0x90cd('0x21')]=_0x11d8b4;if(_0x1ad5a9['query'][_0x90cd('0x5e')]){_0x3d5731[_0x90cd('0x5f')]=[{'all':!![]}];}return db[_0x90cd('0x48')]['findAll'](_0x3d5731);})['then'](function(_0x105e3a){_0xd525dc[_0x90cd('0x60')]=_0x105e3a;return _0xd525dc;})[_0x90cd('0x11')](respondWithFilteredResult(_0x782d65,_0x3d5731))['catch'](handleError(_0x782d65,null));};exports['show']=function(_0x1b16c7,_0x1e55c1){var _0x37e569={'raw':![],'where':{'id':_0x1b16c7['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x90cd('0x44')},{'model':db[_0x90cd('0x61')],'as':'Smtp'},{'model':db['Pause'],'as':_0x90cd('0x46')}]},_0x212c8a={};_0x212c8a[_0x90cd('0x4c')]=_[_0x90cd('0x4e')](db[_0x90cd('0x48')][_0x90cd('0x62')]);_0x212c8a[_0x90cd('0x4d')]=_[_0x90cd('0x4e')](_0x1b16c7[_0x90cd('0x4d')]);_0x212c8a[_0x90cd('0x58')]=_[_0x90cd('0x50')](_0x212c8a['model'],_0x212c8a[_0x90cd('0x4d')]);_0x37e569[_0x90cd('0x4f')]=_[_0x90cd('0x50')](_0x212c8a[_0x90cd('0x4c')],qs[_0x90cd('0x51')](_0x1b16c7['query'][_0x90cd('0x51')]));_0x37e569[_0x90cd('0x4f')]=_0x37e569[_0x90cd('0x4f')][_0x90cd('0x52')]?_0x37e569[_0x90cd('0x4f')]:_0x212c8a[_0x90cd('0x4c')];if(_0x1b16c7[_0x90cd('0x4d')][_0x90cd('0x5e')]){_0x37e569['include']=[{'all':!![]}];}_0x37e569=_[_0x90cd('0x5b')]({},_0x37e569,_0x1b16c7[_0x90cd('0x5d')]);return db[_0x90cd('0x48')][_0x90cd('0x63')](_0x37e569)[_0x90cd('0x11')](handleEntityNotFound(_0x1e55c1,null))['then'](respondWithResult(_0x1e55c1,null))[_0x90cd('0x1b')](handleError(_0x1e55c1,null));};exports[_0x90cd('0x64')]=function(_0x4198e1,_0x157ca6){if(_0x4198e1['body']['id']){delete _0x4198e1['body']['id'];}var _0x5168b2=_0x4198e1[_0x90cd('0x65')][_0x90cd('0x66')]===_0x90cd('0x67')?null:_0x4198e1[_0x90cd('0x65')][_0x90cd('0x66')];var _0x5a26d9=_0x4198e1[_0x90cd('0x65')][_0x90cd('0x44')]||{};var _0x5aa59b=_0x4198e1[_0x90cd('0x65')][_0x90cd('0x42')]||{};if(_0x5168b2){_0x5a26d9[_0x90cd('0x3d')]=getImapHost(_0x5168b2);_0x5a26d9['port']=0x3e1;_0x5aa59b[_0x90cd('0x3d')]=getSmtpHost(_0x5168b2);_0x5aa59b[_0x90cd('0x3e')]=0x24b;_0x5aa59b[_0x90cd('0x3f')]=![];}if(_0x5aa59b[_0x90cd('0x3b')]){_0x5aa59b[_0x90cd('0x3f')]=![];}else{_0x5aa59b[_0x90cd('0x3c')]=null;}if(!_0x5a26d9[_0x90cd('0x3b')])_0x5a26d9[_0x90cd('0x3c')]=null;_0x4198e1[_0x90cd('0x65')][_0x90cd('0x44')]=_0x5a26d9;_0x4198e1[_0x90cd('0x65')][_0x90cd('0x42')]=_0x5aa59b;return db['MailAccount'][_0x90cd('0x63')]({'where':{'id':_0x4198e1['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x90cd('0x44')},{'model':db[_0x90cd('0x61')],'as':_0x90cd('0x42')},{'model':db[_0x90cd('0x45')],'as':_0x90cd('0x46')}]})[_0x90cd('0x11')](handleEntityNotFound(_0x157ca6,null))[_0x90cd('0x11')](function(_0x538422){if(!_0x538422)throw new Error(_0x90cd('0x68'));if(_0x538422[_0x90cd('0x40')])delete _0x4198e1[_0x90cd('0x65')][_0x90cd('0x44')];return _0x538422;})[_0x90cd('0x11')](saveUpdates(_0x4198e1[_0x90cd('0x65')],null))['then'](function(_0x1ae3db){if(!_0x4198e1['body'][_0x90cd('0x44')])return _0x1ae3db;return db['MailServerIn']['update'](_0x4198e1['body']['Imap'],{'where':{'MailAccountId':_0x1ae3db['id']}})[_0x90cd('0x11')](function(){return _0x1ae3db;});})[_0x90cd('0x11')](function(_0x5bb978){if(!_0x4198e1['body'][_0x90cd('0x42')])return _0x5bb978;return db[_0x90cd('0x61')][_0x90cd('0x64')](_0x4198e1['body'][_0x90cd('0x42')],{'where':{'MailAccountId':_0x5bb978['id']}})[_0x90cd('0x11')](function(){return _0x5bb978;});})['then'](respondWithResult(_0x157ca6,null))[_0x90cd('0x1b')](handleError(_0x157ca6,null));};exports[_0x90cd('0x69')]=function(_0x49f49b,_0x29f53f){return db[_0x90cd('0x48')]['describe']()[_0x90cd('0x11')](respondWithResult(_0x29f53f,null))[_0x90cd('0x1b')](handleError(_0x29f53f,null));};exports[_0x90cd('0x6a')]=function(_0x5d24d1,_0x8ab4c9){if(_0x5d24d1['body']['id']){delete _0x5d24d1['body']['id'];}return db['MailAccount'][_0x90cd('0x63')]({'where':{'id':_0x5d24d1[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x8ab4c9,null))['then'](function(_0x3e47db){if(_0x3e47db){_0x5d24d1[_0x90cd('0x65')]['MailAccountId']=_0x3e47db['id'];return db[_0x90cd('0x6c')]['create'](_0x5d24d1['body']);}})['then'](respondWithResult(_0x8ab4c9,null))[_0x90cd('0x1b')](handleError(_0x8ab4c9,null));};exports[_0x90cd('0x6d')]=function(_0x2582af,_0x16a397){var _0x1f50f5={'raw':![],'where':{}};var _0x1232b0={};var _0x42feaa={'count':0x0,'rows':[]};return db[_0x90cd('0x48')]['findOne']({'where':{'id':_0x2582af['params']['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x16a397,null))[_0x90cd('0x11')](function(_0x27bd77){if(_0x27bd77){_0x1232b0[_0x90cd('0x4c')]=_[_0x90cd('0x4e')](db[_0x90cd('0x6c')][_0x90cd('0x62')]);_0x1232b0[_0x90cd('0x4d')]=_[_0x90cd('0x4e')](_0x2582af[_0x90cd('0x4d')]);_0x1232b0['filters']=_['intersection'](_0x1232b0[_0x90cd('0x4c')],_0x1232b0[_0x90cd('0x4d')]);_0x1f50f5[_0x90cd('0x4f')]=_[_0x90cd('0x50')](_0x1232b0[_0x90cd('0x4c')],qs['fields'](_0x2582af[_0x90cd('0x4d')]['fields']));_0x1f50f5[_0x90cd('0x4f')]=_0x1f50f5[_0x90cd('0x4f')]['length']?_0x1f50f5[_0x90cd('0x4f')]:_0x1232b0[_0x90cd('0x4c')];if(!_0x2582af['query'][_0x90cd('0x53')]('nolimit')){_0x1f50f5['limit']=qs['limit'](_0x2582af[_0x90cd('0x4d')][_0x90cd('0x22')]);_0x1f50f5[_0x90cd('0x20')]=qs[_0x90cd('0x20')](_0x2582af[_0x90cd('0x4d')][_0x90cd('0x20')]);}_0x1f50f5[_0x90cd('0x55')]=qs[_0x90cd('0x56')](_0x2582af['query'][_0x90cd('0x56')]);_0x1f50f5[_0x90cd('0x57')]=qs[_0x90cd('0x58')](_[_0x90cd('0x59')](_0x2582af[_0x90cd('0x4d')],_0x1232b0[_0x90cd('0x58')]));_0x1f50f5[_0x90cd('0x57')]['MailAccountId']=_0x27bd77['id'];if(_0x2582af[_0x90cd('0x4d')]['filter']){_0x1f50f5[_0x90cd('0x57')]=_[_0x90cd('0x5b')](_0x1f50f5[_0x90cd('0x57')],{'$or':_[_0x90cd('0x47')](_0x1f50f5[_0x90cd('0x4f')],function(_0x9c06e7){var _0x374603={};_0x374603[_0x9c06e7]={'$like':'%'+_0x2582af[_0x90cd('0x4d')]['filter']+'%'};return _0x374603;})});}_0x1f50f5=_[_0x90cd('0x5b')]({},_0x1f50f5,_0x2582af[_0x90cd('0x5d')]);return db['Disposition'][_0x90cd('0x21')]({'where':_0x1f50f5[_0x90cd('0x57')]})[_0x90cd('0x11')](function(_0x1ec4e1){_0x42feaa[_0x90cd('0x21')]=_0x1ec4e1;if(_0x2582af[_0x90cd('0x4d')][_0x90cd('0x5e')]){_0x1f50f5['include']=[{'all':!![]}];}return db[_0x90cd('0x6c')][_0x90cd('0x6e')](_0x1f50f5);})[_0x90cd('0x11')](function(_0x5d1259){_0x42feaa[_0x90cd('0x60')]=_0x5d1259;return _0x42feaa;});}})[_0x90cd('0x11')](respondWithFilteredResult(_0x16a397,_0x1f50f5))[_0x90cd('0x1b')](handleError(_0x16a397,null));};exports[_0x90cd('0x6f')]=function(_0x1e037f,_0x379b5b){return db[_0x90cd('0x48')][_0x90cd('0x63')]({'where':{'id':_0x1e037f[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x379b5b,null))[_0x90cd('0x11')](function(_0x583dc7){if(_0x583dc7){return _0x583dc7['removeDispositions'](_0x1e037f[_0x90cd('0x4d')]['ids']);}})[_0x90cd('0x11')](respondWithStatusCode(_0x379b5b,null))[_0x90cd('0x1b')](handleError(_0x379b5b,null));};exports['addAnswer']=function(_0x276782,_0x364c5e){if(_0x276782[_0x90cd('0x65')]['id']){delete _0x276782[_0x90cd('0x65')]['id'];}return db[_0x90cd('0x48')][_0x90cd('0x63')]({'where':{'id':_0x276782[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x364c5e,null))[_0x90cd('0x11')](function(_0x5771d7){if(_0x5771d7){_0x276782[_0x90cd('0x65')][_0x90cd('0x70')]=_0x5771d7['id'];return db['CannedAnswer'][_0x90cd('0x71')](_0x276782[_0x90cd('0x65')]);}})[_0x90cd('0x11')](respondWithResult(_0x364c5e,null))[_0x90cd('0x1b')](handleError(_0x364c5e,null));};exports['getAnswers']=function(_0x41e688,_0x3a2937){var _0x3500e5={'raw':![],'where':{}};var _0x5df454={};var _0x1814cb={'count':0x0,'rows':[]};return db[_0x90cd('0x48')]['findOne']({'where':{'id':_0x41e688[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x3a2937,null))[_0x90cd('0x11')](function(_0x525828){if(_0x525828){_0x5df454[_0x90cd('0x4c')]=_[_0x90cd('0x4e')](db[_0x90cd('0x72')][_0x90cd('0x62')]);_0x5df454[_0x90cd('0x4d')]=_[_0x90cd('0x4e')](_0x41e688[_0x90cd('0x4d')]);_0x5df454['filters']=_[_0x90cd('0x50')](_0x5df454[_0x90cd('0x4c')],_0x5df454[_0x90cd('0x4d')]);_0x3500e5[_0x90cd('0x4f')]=_['intersection'](_0x5df454[_0x90cd('0x4c')],qs[_0x90cd('0x51')](_0x41e688[_0x90cd('0x4d')]['fields']));_0x3500e5[_0x90cd('0x4f')]=_0x3500e5['attributes'][_0x90cd('0x52')]?_0x3500e5[_0x90cd('0x4f')]:_0x5df454[_0x90cd('0x4c')];if(!_0x41e688[_0x90cd('0x4d')]['hasOwnProperty'](_0x90cd('0x54'))){_0x3500e5[_0x90cd('0x22')]=qs[_0x90cd('0x22')](_0x41e688[_0x90cd('0x4d')]['limit']);_0x3500e5[_0x90cd('0x20')]=qs[_0x90cd('0x20')](_0x41e688['query'][_0x90cd('0x20')]);}_0x3500e5[_0x90cd('0x55')]=qs[_0x90cd('0x56')](_0x41e688['query'][_0x90cd('0x56')]);_0x3500e5[_0x90cd('0x57')]=qs[_0x90cd('0x58')](_[_0x90cd('0x59')](_0x41e688[_0x90cd('0x4d')],_0x5df454[_0x90cd('0x58')]));_0x3500e5[_0x90cd('0x57')][_0x90cd('0x70')]=_0x525828['id'];if(_0x41e688[_0x90cd('0x4d')]['filter']){_0x3500e5[_0x90cd('0x57')]=_[_0x90cd('0x5b')](_0x3500e5[_0x90cd('0x57')],{'$or':_[_0x90cd('0x47')](_0x3500e5['attributes'],function(_0x118fb7){var _0x22eb52={};_0x22eb52[_0x118fb7]={'$like':'%'+_0x41e688[_0x90cd('0x4d')][_0x90cd('0x5a')]+'%'};return _0x22eb52;})});}_0x3500e5=_[_0x90cd('0x5b')]({},_0x3500e5,_0x41e688[_0x90cd('0x5d')]);return db['CannedAnswer'][_0x90cd('0x21')]({'where':_0x3500e5[_0x90cd('0x57')]})[_0x90cd('0x11')](function(_0x4040cd){_0x1814cb[_0x90cd('0x21')]=_0x4040cd;if(_0x41e688[_0x90cd('0x4d')][_0x90cd('0x5e')]){_0x3500e5[_0x90cd('0x5f')]=[{'all':!![]}];}return db[_0x90cd('0x72')]['findAll'](_0x3500e5);})[_0x90cd('0x11')](function(_0x5ad542){_0x1814cb[_0x90cd('0x60')]=_0x5ad542;return _0x1814cb;});}})[_0x90cd('0x11')](respondWithFilteredResult(_0x3a2937,_0x3500e5))['catch'](handleError(_0x3a2937,null));};exports[_0x90cd('0x73')]=function(_0x2af410,_0x22efc3){return db[_0x90cd('0x48')]['find']({'where':{'id':_0x2af410[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x22efc3,null))[_0x90cd('0x11')](function(_0x556a7a){if(_0x556a7a){return _0x556a7a[_0x90cd('0x73')](_0x2af410[_0x90cd('0x4d')][_0x90cd('0x74')]);}})[_0x90cd('0x11')](respondWithStatusCode(_0x22efc3,null))[_0x90cd('0x1b')](handleError(_0x22efc3,null));};exports[_0x90cd('0x71')]=function(_0x15934d,_0x309bd5){var _0x41439f={'name':_0x15934d[_0x90cd('0x65')]['name'],'key':_0x15934d[_0x90cd('0x65')][_0x90cd('0x4b')],'provider':_0x15934d[_0x90cd('0x65')][_0x90cd('0x66')]===_0x90cd('0x67')?null:_0x15934d[_0x90cd('0x65')][_0x90cd('0x66')],'email':_0x15934d['body'][_0x90cd('0x75')],'ListId':_0x15934d['body'][_0x90cd('0x76')],'active':!_[_0x90cd('0x77')](_0x15934d[_0x90cd('0x65')]['active'])?_0x15934d[_0x90cd('0x65')][_0x90cd('0x78')]:!![],'description':_0x15934d[_0x90cd('0x65')]['description']||null};var _0xb91f8c=getAuthenticationOptions(_0x41439f['provider'],_0x15934d[_0x90cd('0x65')]);_0x41439f['Imap']=_0xb91f8c[_0x90cd('0x44')];_0x41439f[_0x90cd('0x42')]=_0xb91f8c[_0x90cd('0x42')];return db[_0x90cd('0x48')][_0x90cd('0x71')](_0x41439f,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['MailServerIn'],'as':_0x90cd('0x44')}]})[_0x90cd('0x11')](function(_0x4b6fd2){var _0x435f28=_0x15934d[_0x90cd('0x37')][_0x90cd('0x79')]({'plain':!![]});if(!_0x435f28)throw new Error(_0x90cd('0x7a'));if(_0x435f28[_0x90cd('0x7b')]===_0x90cd('0x37')){var _0x4d4711=_0x4b6fd2['get']({'plain':!![]});return db[_0x90cd('0x7c')][_0x90cd('0x63')]({'where':{'name':_0x90cd('0x26'),'userProfileId':_0x435f28[_0x90cd('0x7d')]},'raw':!![]})['then'](function(_0x40984d){if(_0x40984d&&_0x40984d[_0x90cd('0x7e')]===0x0){return db[_0x90cd('0x27')][_0x90cd('0x71')]({'name':_0x4d4711[_0x90cd('0x2a')],'resourceId':_0x4d4711['id'],'type':_0x40984d[_0x90cd('0x2a')],'sectionId':_0x40984d['id']},{})[_0x90cd('0x11')](function(){return _0x4b6fd2;});}else{return _0x4b6fd2;}})[_0x90cd('0x1b')](function(_0x4a99c8){logger['error'](_0x90cd('0x7f'),_0x4a99c8);throw _0x4a99c8;});}return _0x4b6fd2;})['then'](respondWithResult(_0x309bd5,0xc9))[_0x90cd('0x1b')](handleError(_0x309bd5,null));};exports[_0x90cd('0x80')]=function(_0x1f5ccf,_0x515b08){return db[_0x90cd('0x48')][_0x90cd('0x81')]({'where':{'id':_0x1f5ccf[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x515b08,null))[_0x90cd('0x11')](function(_0xdc0759){if(_0xdc0759){return _0xdc0759['getImap']();}return null;})['then'](respondWithResult(_0x515b08,null))[_0x90cd('0x1b')](handleError(_0x515b08,null));};exports['addImap']=function(_0x65bf5a,_0x3c39e7){if(_0x65bf5a[_0x90cd('0x65')]['id']){delete _0x65bf5a[_0x90cd('0x65')]['id'];}return db['MailAccount'][_0x90cd('0x63')]({'where':{'id':_0x65bf5a[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x3c39e7,null))[_0x90cd('0x11')](function(_0x332585){if(_0x332585){_0x65bf5a[_0x90cd('0x65')]['MailAccountId']=_0x332585['id'];return db[_0x90cd('0x82')][_0x90cd('0x71')](_0x65bf5a[_0x90cd('0x65')]);}})[_0x90cd('0x11')](respondWithResult(_0x3c39e7,null))[_0x90cd('0x1b')](handleError(_0x3c39e7,null));};exports[_0x90cd('0x83')]=function(_0x4d33a2,_0x569595){return db[_0x90cd('0x48')]['findOne']({'where':{'id':_0x4d33a2[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x569595,null))[_0x90cd('0x11')](function(_0x291fae){if(_0x291fae){return _0x291fae[_0x90cd('0x84')](null);}return null;})[_0x90cd('0x11')](respondWithStatusCode(_0x569595,null))[_0x90cd('0x1b')](handleError(_0x569595,null));};exports[_0x90cd('0x85')]=function(_0x51ccde,_0x2d843f){return db[_0x90cd('0x48')][_0x90cd('0x81')]({'where':{'id':_0x51ccde[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x2d843f,null))[_0x90cd('0x11')](function(_0x14d7ab){if(_0x14d7ab){return _0x14d7ab[_0x90cd('0x85')]();}return null;})[_0x90cd('0x11')](respondWithResult(_0x2d843f,null))['catch'](handleError(_0x2d843f,null));};exports['addSmtp']=function(_0x12955e,_0x491c72){if(_0x12955e[_0x90cd('0x65')]['id']){delete _0x12955e[_0x90cd('0x65')]['id'];}return db['MailAccount'][_0x90cd('0x63')]({'where':{'id':_0x12955e[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x491c72,null))[_0x90cd('0x11')](function(_0x46de48){if(_0x46de48){_0x12955e['body'][_0x90cd('0x70')]=_0x46de48['id'];return db[_0x90cd('0x61')][_0x90cd('0x71')](_0x12955e[_0x90cd('0x65')]);}})[_0x90cd('0x11')](respondWithResult(_0x491c72,null))[_0x90cd('0x1b')](handleError(_0x491c72,null));};exports[_0x90cd('0x86')]=function(_0x4c244e,_0x31ecab){return db[_0x90cd('0x48')][_0x90cd('0x81')]({'where':{'id':_0x4c244e[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x31ecab,null))['then'](function(_0x48dd16){if(_0x48dd16){return _0x48dd16[_0x90cd('0x87')](null);}return null;})[_0x90cd('0x11')](respondWithStatusCode(_0x31ecab,null))[_0x90cd('0x1b')](handleError(_0x31ecab,null));};exports['addInteraction']=function(_0xe181e8,_0x52f342){return db[_0x90cd('0x88')][_0x90cd('0x63')]({'where':{'id':_0xe181e8[_0x90cd('0x6b')]['id']}})['then'](handleEntityNotFound(_0x52f342,null))[_0x90cd('0x11')](function(_0xc3ba7){if(_0xc3ba7){return _0xc3ba7[_0x90cd('0x89')](_0xe181e8[_0x90cd('0x65')]['ids'],_[_0x90cd('0x8a')](_0xe181e8[_0x90cd('0x65')],[_0x90cd('0x74'),'id'])||{});}})[_0x90cd('0x11')](respondWithResult(_0x52f342,null))['catch'](handleError(_0x52f342,null));};exports['getInteractions']=function(_0x48a650,_0x572815){var _0x224445={'raw':![],'where':{}};var _0x2eecd2={};var _0x5963d8={'count':0x0,'rows':[]};return db[_0x90cd('0x48')][_0x90cd('0x81')]({'where':{'id':_0x48a650[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x572815,null))[_0x90cd('0x11')](function(_0x3a0bb8){if(_0x3a0bb8){_0x2eecd2['model']=_[_0x90cd('0x4e')](db[_0x90cd('0x88')][_0x90cd('0x62')]);_0x2eecd2['query']=_[_0x90cd('0x4e')](_0x48a650[_0x90cd('0x4d')]);_0x2eecd2[_0x90cd('0x58')]=_[_0x90cd('0x50')](_0x2eecd2[_0x90cd('0x4c')],_0x2eecd2[_0x90cd('0x4d')]);_0x224445[_0x90cd('0x4f')]=_[_0x90cd('0x50')](_0x2eecd2['model'],qs[_0x90cd('0x51')](_0x48a650[_0x90cd('0x4d')][_0x90cd('0x51')]));_0x224445[_0x90cd('0x4f')]=_0x224445[_0x90cd('0x4f')]['length']?_0x224445[_0x90cd('0x4f')]:_0x2eecd2[_0x90cd('0x4c')];if(!_0x48a650[_0x90cd('0x4d')]['hasOwnProperty'](_0x90cd('0x54'))){_0x224445[_0x90cd('0x22')]=qs[_0x90cd('0x22')](_0x48a650[_0x90cd('0x4d')][_0x90cd('0x22')]);_0x224445[_0x90cd('0x20')]=qs['offset'](_0x48a650['query'][_0x90cd('0x20')]);}_0x224445[_0x90cd('0x55')]=qs[_0x90cd('0x56')](_0x48a650[_0x90cd('0x4d')][_0x90cd('0x56')]);_0x224445[_0x90cd('0x57')]=qs[_0x90cd('0x58')](_['pick'](_0x48a650[_0x90cd('0x4d')],_0x2eecd2[_0x90cd('0x58')]));_0x224445[_0x90cd('0x57')][_0x90cd('0x70')]=_0x3a0bb8['id'];if(_0x48a650[_0x90cd('0x4d')][_0x90cd('0x5a')]){_0x224445[_0x90cd('0x57')]=_[_0x90cd('0x5b')](_0x224445[_0x90cd('0x57')],{'$or':_[_0x90cd('0x47')](_0x224445[_0x90cd('0x4f')],function(_0x39f1d9){var _0x426c50={};_0x426c50[_0x39f1d9]={'$like':'%'+_0x48a650[_0x90cd('0x4d')]['filter']+'%'};return _0x426c50;})});}_0x224445=_[_0x90cd('0x5b')]({},_0x224445,_0x48a650[_0x90cd('0x5d')]);return db[_0x90cd('0x88')][_0x90cd('0x21')]({'where':_0x224445[_0x90cd('0x57')]})['then'](function(_0x4fec93){_0x5963d8[_0x90cd('0x21')]=_0x4fec93;if(_0x48a650['query']['includeAll']){_0x224445[_0x90cd('0x5f')]=[{'model':db[_0x90cd('0x8b')],'as':'Contact','required':![]},{'model':db[_0x90cd('0x8c')],'as':'Owner','attributes':[_0x90cd('0x2a'),'fullname',_0x90cd('0x8d')],'required':![]},{'model':db[_0x90cd('0x8e')],'as':_0x90cd('0x8f'),'attributes':['id',_0x90cd('0x2a'),'color'],'where':_0x48a650[_0x90cd('0x4d')]['tag']?{'id':_0x48a650[_0x90cd('0x4d')][_0x90cd('0x90')]}:undefined,'required':_0x48a650['query']['tag']?!![]:![]}];}return db['MailInteraction'][_0x90cd('0x6e')](_0x224445);})['then'](function(_0xe19683){_0x5963d8['rows']=_0xe19683;return _0x5963d8;});}})[_0x90cd('0x11')](respondWithFilteredResult(_0x572815,_0x224445))[_0x90cd('0x1b')](handleError(_0x572815,null));};exports[_0x90cd('0x91')]=function addApplications(_0x4f6e15,_0x2d0dca){var _0x24fbd1=_0x4f6e15[_0x90cd('0x6b')]['id'];var _0x13ddab=_0x4f6e15[_0x90cd('0x65')];var _0x521b29=0xc8;var _0x50f127=null;return db[_0x90cd('0x92')]['transaction']({'isolationLevel':db[_0x90cd('0x92')][_0x90cd('0x93')][_0x90cd('0x94')][_0x90cd('0x95')]},function(_0x362e78){return db[_0x90cd('0x48')]['findOne']({'where':{'id':_0x24fbd1},'transaction':_0x362e78})[_0x90cd('0x11')](function(_0x14bff2){if(_0x14bff2){return db[_0x90cd('0x96')]['destroy']({'where':{'MailAccountId':_0x24fbd1},'transaction':_0x362e78})[_0x90cd('0x11')](function(){var _0x329128=_['map'](_0x13ddab,function(_0x25f400){_0x25f400[_0x90cd('0x70')]=_0x24fbd1;return _0x25f400;});return db[_0x90cd('0x96')][_0x90cd('0x97')](_0x329128,{'transaction':_0x362e78});});}else{_0x521b29=0x194;_0x50f127=[];}});})[_0x90cd('0x11')](function(){if(_0x521b29!==0x194){return db[_0x90cd('0x96')][_0x90cd('0x98')]({'where':{'MailAccountId':_0x24fbd1},'order':_0x90cd('0x99')})[_0x90cd('0x11')](function(_0x22b277){_0x50f127=_0x22b277;});}})[_0x90cd('0x1b')](function(_0x420116){_0x521b29=0x1f4;logger['error'](_0x420116[_0x90cd('0x29')]);if(_0x420116[_0x90cd('0x2a')]){delete _0x420116[_0x90cd('0x2a')];}_0x50f127=_0x420116;})['finally'](function(){if(_0x50f127===null){_0x2d0dca[_0x90cd('0x1c')](_0x521b29);}else{if(_0x521b29===0x1f4){_0x2d0dca['status'](_0x521b29)[_0x90cd('0x2b')](_0x50f127);}else{_0x2d0dca[_0x90cd('0x1d')](_0x521b29)[_0x90cd('0x1e')](_0x50f127);}}});};exports['getApplications']=function(_0x3b9064,_0x463621){var _0x3b225d={};var _0x17caf2={};var _0x136e31;var _0x1e8bcf;return db[_0x90cd('0x48')]['findOne']({'where':{'id':_0x3b9064[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x463621,null))[_0x90cd('0x11')](function(_0x4cb9db){if(_0x4cb9db){_0x136e31=_0x4cb9db;_0x17caf2[_0x90cd('0x4c')]=_[_0x90cd('0x4e')](db[_0x90cd('0x96')][_0x90cd('0x62')]);_0x17caf2[_0x90cd('0x4d')]=_['keys'](_0x3b9064[_0x90cd('0x4d')]);_0x17caf2[_0x90cd('0x58')]=_['intersection'](_0x17caf2[_0x90cd('0x4c')],_0x17caf2[_0x90cd('0x4d')]);_0x3b225d[_0x90cd('0x4f')]=_[_0x90cd('0x50')](_0x17caf2['model'],qs[_0x90cd('0x51')](_0x3b9064[_0x90cd('0x4d')][_0x90cd('0x51')]));_0x3b225d['attributes']=_0x3b225d[_0x90cd('0x4f')]['length']?_0x3b225d[_0x90cd('0x4f')]:_0x17caf2[_0x90cd('0x4c')];_0x3b225d[_0x90cd('0x55')]=qs[_0x90cd('0x56')](_0x3b9064['query']['sort']);_0x3b225d[_0x90cd('0x57')]=qs[_0x90cd('0x58')](_['pick'](_0x3b9064[_0x90cd('0x4d')],_0x17caf2['filters']));if(_0x3b9064[_0x90cd('0x4d')][_0x90cd('0x5a')]){_0x3b225d[_0x90cd('0x57')]=_['merge'](_0x3b225d[_0x90cd('0x57')],{'$or':_['map'](_0x3b225d[_0x90cd('0x4f')],function(_0x210841){var _0x379cb5={};_0x379cb5[_0x210841]={'$like':'%'+_0x3b9064[_0x90cd('0x4d')][_0x90cd('0x5a')]+'%'};return _0x379cb5;})});}_0x3b225d=_[_0x90cd('0x5b')]({},_0x3b225d,_0x3b9064[_0x90cd('0x5d')]);return _0x136e31[_0x90cd('0x9a')](_0x3b225d);}})[_0x90cd('0x11')](function(_0xdca3f8){if(_0xdca3f8){_0x1e8bcf=_0xdca3f8['length'];if(!_0x3b9064[_0x90cd('0x4d')][_0x90cd('0x53')]('nolimit')){_0x3b225d[_0x90cd('0x22')]=qs['limit'](_0x3b9064[_0x90cd('0x4d')][_0x90cd('0x22')]);_0x3b225d[_0x90cd('0x20')]=qs['offset'](_0x3b9064['query'][_0x90cd('0x20')]);}return _0x136e31[_0x90cd('0x9a')](_0x3b225d);}})['then'](function(_0x4c15a2){if(_0x4c15a2){return _0x4c15a2?{'count':_0x1e8bcf,'rows':_0x4c15a2}:null;}})[_0x90cd('0x11')](respondWithResult(_0x463621,null))[_0x90cd('0x1b')](handleError(_0x463621,null));};exports['getMessages']=function(_0x334799,_0xa99f7f){var _0x414a20={'raw':!![],'where':{}};var _0x4279b1={};var _0x4f0f34={'count':0x0,'rows':[]};return db[_0x90cd('0x48')][_0x90cd('0x81')]({'where':{'id':_0x334799['params']['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0xa99f7f,null))[_0x90cd('0x11')](function(_0x5a9172){if(_0x5a9172){_0x4279b1[_0x90cd('0x4c')]=_[_0x90cd('0x4e')](db[_0x90cd('0x9b')]['rawAttributes']);_0x4279b1[_0x90cd('0x4d')]=_[_0x90cd('0x4e')](_0x334799[_0x90cd('0x4d')]);_0x4279b1[_0x90cd('0x58')]=_[_0x90cd('0x50')](_0x4279b1[_0x90cd('0x4c')],_0x4279b1['query']);_0x414a20[_0x90cd('0x4f')]=_[_0x90cd('0x50')](_0x4279b1['model'],qs['fields'](_0x334799[_0x90cd('0x4d')][_0x90cd('0x51')]));_0x414a20[_0x90cd('0x4f')]=_0x414a20[_0x90cd('0x4f')][_0x90cd('0x52')]?_0x414a20[_0x90cd('0x4f')]:_0x4279b1['model'];if(!_0x334799[_0x90cd('0x4d')][_0x90cd('0x53')](_0x90cd('0x54'))){_0x414a20[_0x90cd('0x22')]=qs['limit'](_0x334799['query'][_0x90cd('0x22')]);_0x414a20['offset']=qs[_0x90cd('0x20')](_0x334799[_0x90cd('0x4d')][_0x90cd('0x20')]);}_0x414a20[_0x90cd('0x55')]=qs['sort'](_0x334799['query'][_0x90cd('0x56')]);_0x414a20[_0x90cd('0x57')]=qs[_0x90cd('0x58')](_[_0x90cd('0x59')](_0x334799[_0x90cd('0x4d')],_0x4279b1['filters']));_0x414a20[_0x90cd('0x57')][_0x90cd('0x70')]=_0x5a9172['id'];if(_0x334799[_0x90cd('0x4d')][_0x90cd('0x5a')]){_0x414a20[_0x90cd('0x57')]=_[_0x90cd('0x5b')](_0x414a20[_0x90cd('0x57')],{'$or':_[_0x90cd('0x47')](_0x414a20[_0x90cd('0x4f')],function(_0x1b139d){var _0x3bc5cb={};_0x3bc5cb[_0x1b139d]={'$like':'%'+_0x334799['query'][_0x90cd('0x5a')]+'%'};return _0x3bc5cb;})});}if(_0x334799[_0x90cd('0x4d')]['$gte']){var _0x44c947=_0x334799[_0x90cd('0x4d')]['$gte'][_0x90cd('0x9c')](',');var _0x5c9eb2={};_0x5c9eb2[_0x44c947[0x0]]={'$gte':moment(_0x44c947[0x1])[_0x90cd('0x9d')]('YYYY-MM-DD\x20HH:mm:ss')};_0x414a20[_0x90cd('0x57')]=_[_0x90cd('0x5b')](_0x414a20[_0x90cd('0x57')],_0x5c9eb2);}_0x414a20=_[_0x90cd('0x5b')]({},_0x414a20,_0x334799[_0x90cd('0x5d')]);return db[_0x90cd('0x9b')][_0x90cd('0x21')]({'where':_0x414a20[_0x90cd('0x57')]})[_0x90cd('0x11')](function(_0x1fc437){_0x4f0f34[_0x90cd('0x21')]=_0x1fc437;if(_0x334799[_0x90cd('0x4d')][_0x90cd('0x5e')]){_0x414a20[_0x90cd('0x5f')]=[{'all':!![]}];}return db['MailMessage'][_0x90cd('0x6e')](_0x414a20);})[_0x90cd('0x11')](function(_0x38e2c4){if(_0x334799[_0x90cd('0x4d')]['inlineCss']===_0x90cd('0x9e')){for(var _0x540685=0x0;_0x540685<_0x38e2c4['length'];_0x540685++){_0x38e2c4[_0x540685][_0x90cd('0x65')]=juice(_0x38e2c4[_0x540685][_0x90cd('0x65')]);}}_0x4f0f34[_0x90cd('0x60')]=_0x38e2c4;return _0x4f0f34;});}})['then'](respondWithFilteredResult(_0xa99f7f,_0x414a20))[_0x90cd('0x1b')](handleError(_0xa99f7f,null));};exports[_0x90cd('0x2b')]=function(_0x5e6627,_0x36ea9f){var _0x1f8337,_0x31237f={},_0x3e2688;if(_0x5e6627[_0x90cd('0x65')]['to']){_0x3e2688=_0x5e6627[_0x90cd('0x65')]['to'][_0x90cd('0x9c')](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x5e6627['params']['id']},'include':[{'model':db[_0x90cd('0x9f')],'as':_0x90cd('0xa0'),'include':[{'model':db[_0x90cd('0x8b')],'as':_0x90cd('0xa1'),'where':{'email':_0x3e2688},'limit':0x1,'order':[['updatedAt',_0x90cd('0xa2')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x90cd('0x11')](handleEntityNotFound(_0x36ea9f,null))[_0x90cd('0x11')](function(_0x3902e6){if(!_0x3902e6)return;_0x1f8337=_0x3902e6;if(!_0x3902e6['Smtp'])throw new Error(_0x90cd('0xa3'));if(_[_0x90cd('0x77')](_0x5e6627[_0x90cd('0x65')][_0x90cd('0xa4')])){_0x5e6627[_0x90cd('0x65')]['from']=util[_0x90cd('0x9d')](_0x90cd('0xa5'),_0x3902e6[_0x90cd('0x2a')],_0x3902e6[_0x90cd('0x75')]||_0x3902e6[_0x90cd('0x42')]['user']);}if(_0x5e6627[_0x90cd('0x65')]['attachments']&&_0x5e6627[_0x90cd('0x65')]['attachments'][_0x90cd('0x52')]){for(var _0x514613=0x0;_0x514613<_0x5e6627[_0x90cd('0x65')][_0x90cd('0xa6')][_0x90cd('0x52')];_0x514613+=0x1){_0x5e6627[_0x90cd('0x65')][_0x90cd('0xa6')][_0x514613]={'filename':_0x5e6627[_0x90cd('0x65')]['attachments'][_0x514613]['name'],'path':path['join'](config[_0x90cd('0xa7')],_0x90cd('0xa8'),_0x5e6627['body']['attachments'][_0x514613][_0x90cd('0xa9')])};}}var _0xd6d1f5=_0x3902e6[_0x90cd('0xaa')]();return respondWithRpcPromise(_0x90cd('0xab'),_0x90cd('0xac'),{'account':_0xd6d1f5,'message':_0x5e6627[_0x90cd('0x65')]});})[_0x90cd('0x11')](function(_0x26616b){if(!_0x26616b)return;_0x31237f=_0x26616b;if(!_0x1f8337['List'])throw new Error('List\x20not\x20found');if(_0x1f8337[_0x90cd('0xa0')][_0x90cd('0xa1')][_0x90cd('0x52')])return _0x1f8337['List'][_0x90cd('0xa1')][0x0];return db[_0x90cd('0x8b')]['create'](_[_0x90cd('0xb')](_0x5e6627[_0x90cd('0x65')],{'firstName':_0x5e6627['body']['to'],'email':_0x5e6627[_0x90cd('0x65')]['to'],'phone':_0x5e6627[_0x90cd('0x65')]['to'],'ListId':_0x1f8337[_0x90cd('0x76')]}));})[_0x90cd('0x11')](function(_0x2245c7){if(!_0x2245c7)return;var _0x247c64={'UserId':_0x5e6627[_0x90cd('0x37')]['id'],'ContactId':_0x2245c7['id'],'MailAccountId':_0x1f8337['id'],'inReplyTo':_0x31237f[_0x90cd('0xad')],'to':_0x5e6627[_0x90cd('0x65')][_0x90cd('0xa4')],'cc':_0x5e6627[_0x90cd('0x65')]['cc'],'subject':_0x5e6627['body'][_0x90cd('0xae')],'attach':_0x5e6627[_0x90cd('0x65')][_0x90cd('0xaf')],'firstMsgDirection':_0x90cd('0xb0'),'lastMsgAt':moment()[_0x90cd('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x90cd('0xb0'),'Messages':[_['merge'](_0x5e6627[_0x90cd('0x65')],{'messageId':_0x31237f[_0x90cd('0xad')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x1f8337['id'],'UserId':_0x5e6627[_0x90cd('0x37')]['id'],'ContactId':_0x2245c7['id']})]};if(_0x5e6627[_0x90cd('0x65')][_0x90cd('0xb1')]){_0x247c64=_[_0x90cd('0x5b')](_0x247c64,_0x5e6627['body'][_0x90cd('0xb1')]);}return db[_0x90cd('0x88')][_0x90cd('0x71')](_0x247c64,{'include':[{'model':db[_0x90cd('0x9b')],'as':_0x90cd('0xb2')}]});})[_0x90cd('0x11')](respondWithResult(_0x36ea9f,null))[_0x90cd('0x1b')](handleError(_0x36ea9f,null));};exports[_0x90cd('0xb3')]=function(_0x35d697,_0x375f67){return db[_0x90cd('0x48')]['find']({'where':{'id':_0x35d697[_0x90cd('0x6b')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x90cd('0x42'),'raw':!![],'include':[{'model':db[_0x90cd('0xb4')],'as':_0x90cd('0xb4'),'raw':!![]}]}]})[_0x90cd('0x11')](handleEntityNotFound(_0x375f67,null))['then'](function(_0x6dec9b){if(!_0x6dec9b[_0x90cd('0x42')])return;var _0x574855=_0x6dec9b[_0x90cd('0xaa')]();return respondWithRpcPromise(_0x90cd('0xb5'),'verifySmtp',{'account':_0x574855});})[_0x90cd('0x11')](respondWithResult(_0x375f67,null))[_0x90cd('0x1b')](handleError(_0x375f67,null));};exports[_0x90cd('0x25')]=function(_0x123be4,_0x2011c1){return db[_0x90cd('0x48')][_0x90cd('0x63')]({'where':{'id':_0x123be4[_0x90cd('0x6b')]['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x2011c1,null))['then'](function(_0x1e99ca){if(_0x1e99ca&&_0x1e99ca['service']){throw new db[(_0x90cd('0xb6'))][(_0x90cd('0xb7'))](_0x90cd('0xb8'));}return _0x1e99ca;})[_0x90cd('0x11')](removeEntity(_0x2011c1,null))[_0x90cd('0x1b')](handleError(_0x2011c1,null));};exports[_0x90cd('0xb9')]=function(_0xd8e390,_0x58d856){return db[_0x90cd('0x48')][_0x90cd('0x63')]({'where':{'id':_0xd8e390[_0x90cd('0x6b')]['id']}})['then'](handleEntityNotFound(_0x58d856,null))[_0x90cd('0x11')](function(_0x226380){if(_0x226380){return _0x226380[_0x90cd('0xb9')](_0xd8e390['body'][_0x90cd('0x74')],_[_0x90cd('0x8a')](_0xd8e390[_0x90cd('0x65')],[_0x90cd('0x74'),'id'])||{})[_0x90cd('0xba')](function(_0x486c85){for(var _0x49d88a=0x0;_0x49d88a<_0xd8e390['body'][_0x90cd('0x74')][_0x90cd('0x52')];_0x49d88a+=0x1){socket[_0x90cd('0xbb')](_0x90cd('0xbc'),{'UserId':Number(_0xd8e390[_0x90cd('0x65')][_0x90cd('0x74')][_0x49d88a]),'MailAccountId':Number(_0xd8e390['params']['id'])});}return _0x486c85;});}})[_0x90cd('0x11')](respondWithResult(_0x58d856,null))[_0x90cd('0x1b')](handleError(_0x58d856,null));};exports[_0x90cd('0xbd')]=function(_0x16527b,_0x1edcf6){return db[_0x90cd('0x48')][_0x90cd('0x63')]({'where':{'id':_0x16527b['params']['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x1edcf6,null))[_0x90cd('0x11')](function(_0x255b0d){if(_0x255b0d){return _0x255b0d['removeAgents'](_0x16527b['query']['ids'])[_0x90cd('0x11')](function(){if(_[_0x90cd('0xbe')](_0x16527b[_0x90cd('0x4d')][_0x90cd('0x74')])){for(var _0x29409b=0x0;_0x29409b<_0x16527b[_0x90cd('0x4d')][_0x90cd('0x74')][_0x90cd('0x52')];_0x29409b+=0x1){socket[_0x90cd('0xbb')]('userMailAccount:remove',{'UserId':Number(_0x16527b[_0x90cd('0x4d')][_0x90cd('0x74')][_0x29409b]),'MailAccountId':Number(_0x16527b['params']['id'])});}}else{socket['emit'](_0x90cd('0xbf'),{'UserId':Number(_0x16527b[_0x90cd('0x4d')][_0x90cd('0x74')]),'MailAccountId':Number(_0x16527b[_0x90cd('0x6b')]['id'])});}});}})[_0x90cd('0x11')](respondWithStatusCode(_0x1edcf6,null))[_0x90cd('0x1b')](handleError(_0x1edcf6,null));};exports[_0x90cd('0xc0')]=function(_0x4223c7,_0x2536c3){var _0x4163c2={};var _0x240da2={};var _0x32b715;var _0x107fad;return db[_0x90cd('0x48')]['findOne']({'where':{'id':_0x4223c7['params']['id']}})[_0x90cd('0x11')](handleEntityNotFound(_0x2536c3,null))[_0x90cd('0x11')](function(_0x8e410a){if(_0x8e410a){_0x32b715=_0x8e410a;_0x240da2[_0x90cd('0x4c')]=_['keys'](db[_0x90cd('0x8c')]['rawAttributes']);_0x240da2[_0x90cd('0x4d')]=_['keys'](_0x4223c7['query']);_0x240da2[_0x90cd('0x58')]=_[_0x90cd('0x50')](_0x240da2['model'],_0x240da2[_0x90cd('0x4d')]);_0x4163c2[_0x90cd('0x4f')]=_[_0x90cd('0x50')](_0x240da2[_0x90cd('0x4c')],qs['fields'](_0x4223c7[_0x90cd('0x4d')][_0x90cd('0x51')]));_0x4163c2[_0x90cd('0x4f')]=_0x4163c2[_0x90cd('0x4f')][_0x90cd('0x52')]?_0x4163c2['attributes']:_0x240da2['model'];_0x4163c2['order']=qs[_0x90cd('0x56')](_0x4223c7[_0x90cd('0x4d')][_0x90cd('0x56')]);_0x4163c2['where']=qs['filters'](_[_0x90cd('0x59')](_0x4223c7[_0x90cd('0x4d')],_0x240da2['filters']));if(_0x4223c7[_0x90cd('0x4d')][_0x90cd('0x5a')]){_0x4163c2[_0x90cd('0x57')]=_['merge'](_0x4163c2[_0x90cd('0x57')],{'$or':_[_0x90cd('0x47')](_0x4163c2['attributes'],function(_0x1fd83a){var _0x1823b9={};_0x1823b9[_0x1fd83a]={'$like':'%'+_0x4223c7[_0x90cd('0x4d')][_0x90cd('0x5a')]+'%'};return _0x1823b9;})});}_0x4163c2=_[_0x90cd('0x5b')]({},_0x4163c2,_0x4223c7['options']);return _0x32b715[_0x90cd('0xc0')](_0x4163c2);}})['then'](function(_0x1d059f){if(_0x1d059f){_0x107fad=_0x1d059f[_0x90cd('0x52')];if(!_0x4223c7[_0x90cd('0x4d')][_0x90cd('0x53')]('nolimit')){_0x4163c2['limit']=qs['limit'](_0x4223c7['query'][_0x90cd('0x22')]);_0x4163c2[_0x90cd('0x20')]=qs[_0x90cd('0x20')](_0x4223c7['query'][_0x90cd('0x20')]);}return _0x32b715[_0x90cd('0xc0')](_0x4163c2);}})['then'](function(_0x2c02e4){if(_0x2c02e4){return _0x2c02e4?{'count':_0x107fad,'rows':_0x2c02e4}:null;}})['then'](respondWithResult(_0x2536c3,null))['catch'](handleError(_0x2536c3,null));}; \ No newline at end of file +var _0x0511=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','User','internal','Tag','color','tag','findAll','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','destroy','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','true','CmList','List','Contacts','DESC','Smtp\x20configuration\x20not\x20found','from','format','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','sendMail','List\x20not\x20found','ListId','messageId','subject','attach','out','Interaction','Messages','CloudProvider','getSmtpOptions','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','util','path','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','./mailAccount.socket','register','jayson/promise','client','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','MailAccounts','UserProfileResource','stack','name','send','gmail','yahoo','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','password','pass','modernAuthentication','CloudProviderId','port','host','service','authentication','username','Imap','Smtp','MailServerIn','MailServerOut','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','Pause','body','custom','find','update','describe','MailAccountId','Disposition','create','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','provider','email','isNil','active','description'];(function(_0x108ef6,_0x510b4c){var _0x3e04d0=function(_0x4f112b){while(--_0x4f112b){_0x108ef6['push'](_0x108ef6['shift']());}};_0x3e04d0(++_0x510b4c);}(_0x0511,0x1bd));var _0x1051=function(_0x4e3ffc,_0x570704){_0x4e3ffc=_0x4e3ffc-0x0;var _0x543119=_0x0511[_0x4e3ffc];return _0x543119;};'use strict';var moment=require(_0x1051('0x0'));var BPromise=require('bluebird');var util=require(_0x1051('0x1'));var path=require(_0x1051('0x2'));var _=require(_0x1051('0x3'));var juice=require('juice');var Redis=require(_0x1051('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x1051('0x5'))(_0x1051('0x6'));var config=require(_0x1051('0x7'));var db=require(_0x1051('0x8'))['db'];config['redis']=_[_0x1051('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1051('0xa')]));require(_0x1051('0xb'))[_0x1051('0xc')](socket);var jayson=require(_0x1051('0xd'));var client=jayson[_0x1051('0xe')]['http']({'port':0x232b});function respondWithRpcPromise(_0x2ab7d3,_0x467d9c,_0x383d9e,_0x40e368){return new BPromise(function(_0x250eee,_0x48744b){var _0x1a5d10=_0x40e368||client;return _0x1a5d10[_0x1051('0xf')](_0x2ab7d3,_0x383d9e)[_0x1051('0x10')](function(_0x4b2058){logger[_0x1051('0x11')](_0x1051('0x12'),_0x467d9c,'request\x20sent');logger[_0x1051('0x13')](_0x1051('0x14'),_0x467d9c,_0x1051('0x15'),JSON[_0x1051('0x16')](_0x4b2058));if(_0x4b2058[_0x1051('0x17')]){if(_0x4b2058[_0x1051('0x17')]['code']===0x1f4){logger[_0x1051('0x17')]('MailAccount,\x20%s,\x20%s',_0x467d9c,_0x4b2058[_0x1051('0x17')][_0x1051('0x18')]);return _0x48744b(_0x4b2058[_0x1051('0x17')][_0x1051('0x18')]);}logger[_0x1051('0x17')](_0x1051('0x12'),_0x467d9c,_0x4b2058[_0x1051('0x17')]['message']);return _0x250eee(_0x4b2058['error'][_0x1051('0x18')]);}else{logger[_0x1051('0x11')](_0x1051('0x12'),_0x467d9c,_0x1051('0x15'));_0x250eee(_0x4b2058[_0x1051('0x19')]['message']);}})[_0x1051('0x1a')](function(_0x473c18){logger[_0x1051('0x17')](_0x1051('0x12'),_0x467d9c,_0x473c18);_0x48744b(_0x473c18);});});}function respondWithStatusCode(_0xcd2dba,_0x3b2e42){_0x3b2e42=_0x3b2e42||0xcc;return function(_0x1256a0){if(_0x1256a0){return _0xcd2dba[_0x1051('0x1b')](_0x3b2e42);}return _0xcd2dba[_0x1051('0x1c')](_0x3b2e42)[_0x1051('0x1d')]();};}function respondWithResult(_0x144733,_0xdbb929){_0xdbb929=_0xdbb929||0xc8;return function(_0x1eef09){if(_0x1eef09){return _0x144733[_0x1051('0x1c')](_0xdbb929)['json'](_0x1eef09);}};}function respondWithFilteredResult(_0x76bcb3,_0x24e93c){return function(_0xf91436){if(_0xf91436){var _0x31e27c=typeof _0x24e93c[_0x1051('0x1e')]===_0x1051('0x1f')&&typeof _0x24e93c['limit']===_0x1051('0x1f');var _0x521e2a=_0xf91436[_0x1051('0x20')];var _0x17386a=_0x31e27c?0x0:_0x24e93c[_0x1051('0x1e')];var _0x305463=_0x31e27c?_0xf91436[_0x1051('0x20')]:_0x24e93c[_0x1051('0x1e')]+_0x24e93c[_0x1051('0x21')];var _0x4acef4;if(_0x305463>=_0x521e2a){_0x305463=_0x521e2a;_0x4acef4=0xc8;}else{_0x4acef4=0xce;}_0x76bcb3['status'](_0x4acef4);return _0x76bcb3[_0x1051('0x22')](_0x1051('0x23'),_0x17386a+'-'+_0x305463+'/'+_0x521e2a)[_0x1051('0x24')](_0xf91436);}return null;};}function saveUpdates(_0x22ff1e){return function(_0x5d601d){if(_0x5d601d){return _0x5d601d['update'](_0x22ff1e)[_0x1051('0x10')](function(_0x3eaf42){return _0x3eaf42;});}return null;};}function removeEntity(_0x53caff){return function(_0x340edf){if(_0x340edf){return _0x340edf['destroy']()[_0x1051('0x10')](function(){var _0x1f1daa=_0x340edf['get']({'plain':!![]});var _0x324c03=_0x1051('0x25');return db[_0x1051('0x26')]['destroy']({'where':{'type':_0x324c03,'resourceId':_0x1f1daa['id']}})[_0x1051('0x10')](function(){return _0x340edf;});})[_0x1051('0x10')](function(){_0x53caff[_0x1051('0x1c')](0xcc)[_0x1051('0x1d')]();});}};}function handleEntityNotFound(_0x5fe3a0){return function(_0x5e17bb){if(!_0x5e17bb){_0x5fe3a0['sendStatus'](0x194);}return _0x5e17bb;};}function handleError(_0x547d40,_0x524b55){_0x524b55=_0x524b55||0x1f4;return function(_0x3e5213){logger[_0x1051('0x17')](_0x3e5213[_0x1051('0x27')]);if(_0x3e5213['name']){delete _0x3e5213[_0x1051('0x28')];}_0x547d40['status'](_0x524b55)[_0x1051('0x29')](_0x3e5213);};}function getImapHost(_0x22f372){switch(_0x22f372){case _0x1051('0x2a'):return'imap.gmail.com';case _0x1051('0x2b'):return _0x1051('0x2c');case _0x1051('0x2d'):return'imap-mail.outlook.com';case _0x1051('0x2e'):return _0x1051('0x2f');}throw new Error(_0x1051('0x30'),_0x22f372);}function getSmtpHost(_0x3346cc){switch(_0x3346cc){case _0x1051('0x2a'):return'smtp.gmail.com';case _0x1051('0x2b'):return _0x1051('0x31');case _0x1051('0x2d'):return _0x1051('0x32');case'outlook365':return _0x1051('0x33');}throw new Error(_0x1051('0x30'),_0x3346cc);}function getAuthenticationOptions(_0x25ec12,_0x2f9b27){var _0x1ec1f0={};var _0x21f06f={};if(_0x25ec12){_0x1ec1f0['user']=_0x21f06f[_0x1051('0x34')]=_0x2f9b27['username'];_0x1ec1f0[_0x1051('0x35')]=_0x21f06f[_0x1051('0x36')]=_0x2f9b27[_0x1051('0x35')];if(_0x2f9b27[_0x1051('0x37')]){_0x1ec1f0[_0x1051('0x37')]=_0x21f06f[_0x1051('0x37')]=!![];_0x1ec1f0[_0x1051('0x38')]=_0x21f06f[_0x1051('0x38')]=_0x2f9b27[_0x1051('0x38')];_0x1ec1f0[_0x1051('0x35')]=_0x21f06f['pass']=null;}else{_0x1ec1f0[_0x1051('0x38')]=_0x21f06f[_0x1051('0x38')]=null;}_0x1ec1f0['host']=getImapHost(_0x25ec12);_0x1ec1f0[_0x1051('0x39')]=0x3e1;_0x21f06f[_0x1051('0x3a')]=getSmtpHost(_0x25ec12);_0x21f06f[_0x1051('0x39')]=0x24b;_0x21f06f['secure']=![];_0x1ec1f0[_0x1051('0x3b')]=_0x21f06f[_0x1051('0x3b')]=null;}else{if(_0x2f9b27[_0x1051('0x3c')]){_0x1ec1f0[_0x1051('0x34')]=_0x21f06f[_0x1051('0x34')]=_0x2f9b27[_0x1051('0x3d')];_0x1ec1f0[_0x1051('0x35')]=_0x21f06f[_0x1051('0x36')]=_0x2f9b27[_0x1051('0x35')];}else{_0x1ec1f0['authentication']=_0x21f06f[_0x1051('0x3c')]=![];_0x1ec1f0[_0x1051('0x34')]=_0x21f06f[_0x1051('0x34')]=null;_0x1ec1f0['password']=_0x21f06f[_0x1051('0x36')]=null;}_0x1ec1f0['host']=_0x2f9b27[_0x1051('0x3e')][_0x1051('0x3a')];_0x1ec1f0['port']=_0x2f9b27[_0x1051('0x3e')][_0x1051('0x39')];_0x21f06f[_0x1051('0x3a')]=_0x2f9b27['Smtp'][_0x1051('0x3a')];_0x21f06f[_0x1051('0x39')]=_0x2f9b27[_0x1051('0x3f')][_0x1051('0x39')];}return{'Imap':_0x1ec1f0,'Smtp':_0x21f06f};}exports['index']=function(_0x5423f1,_0x16c731){var _0x31f3cb={'include':[{'model':db[_0x1051('0x40')],'as':_0x1051('0x3e')},{'model':db[_0x1051('0x41')],'as':_0x1051('0x3f')},{'model':db['Pause'],'as':_0x1051('0x42')}]},_0x254b4a={},_0x3f3c87={'count':0x0,'rows':[]};var _0x57fd36=_[_0x1051('0x43')](db[_0x1051('0x44')][_0x1051('0x45')],function(_0x5b8631){return{'name':_0x5b8631['fieldName'],'type':_0x5b8631[_0x1051('0x46')][_0x1051('0x47')]};});_0x254b4a[_0x1051('0x48')]=_['map'](_0x57fd36,_0x1051('0x28'));_0x254b4a['query']=_[_0x1051('0x49')](_0x5423f1[_0x1051('0x4a')]);_0x254b4a[_0x1051('0x4b')]=_[_0x1051('0x4c')](_0x254b4a[_0x1051('0x48')],_0x254b4a[_0x1051('0x4a')]);_0x31f3cb[_0x1051('0x4d')]=_[_0x1051('0x4c')](_0x254b4a[_0x1051('0x48')],qs[_0x1051('0x4e')](_0x5423f1[_0x1051('0x4a')]['fields']));_0x31f3cb['attributes']=_0x31f3cb['attributes'][_0x1051('0x4f')]?_0x31f3cb[_0x1051('0x4d')]:_0x254b4a[_0x1051('0x48')];if(!_0x5423f1[_0x1051('0x4a')][_0x1051('0x50')](_0x1051('0x51'))){_0x31f3cb[_0x1051('0x21')]=qs[_0x1051('0x21')](_0x5423f1[_0x1051('0x4a')][_0x1051('0x21')]);_0x31f3cb['offset']=qs[_0x1051('0x1e')](_0x5423f1[_0x1051('0x4a')][_0x1051('0x1e')]);}_0x31f3cb[_0x1051('0x52')]=qs['sort'](_0x5423f1[_0x1051('0x4a')][_0x1051('0x53')]);_0x31f3cb[_0x1051('0x54')]=qs[_0x1051('0x4b')](_[_0x1051('0x55')](_0x5423f1[_0x1051('0x4a')],_0x254b4a[_0x1051('0x4b')]),_0x57fd36);if(_0x5423f1['query'][_0x1051('0x56')]){_0x31f3cb['where']=_[_0x1051('0x57')](_0x31f3cb[_0x1051('0x54')],{'$or':_[_0x1051('0x43')](_0x57fd36,function(_0x3352ee){if(_0x3352ee[_0x1051('0x46')]!==_0x1051('0x58')){var _0x412c7d={};_0x412c7d[_0x3352ee[_0x1051('0x28')]]={'$like':'%'+_0x5423f1[_0x1051('0x4a')]['filter']+'%'};return _0x412c7d;}})});}_0x31f3cb=_['merge']({},_0x31f3cb,_0x5423f1[_0x1051('0x59')]);var _0x995125={'where':_0x31f3cb[_0x1051('0x54')]};return db[_0x1051('0x44')][_0x1051('0x20')](_0x995125)[_0x1051('0x10')](function(_0x478c18){_0x3f3c87[_0x1051('0x20')]=_0x478c18;if(_0x5423f1['query'][_0x1051('0x5a')]){_0x31f3cb[_0x1051('0x5b')]=[{'all':!![]}];}return db[_0x1051('0x44')]['findAll'](_0x31f3cb);})[_0x1051('0x10')](function(_0x4551b9){_0x3f3c87[_0x1051('0x5c')]=_0x4551b9;return _0x3f3c87;})[_0x1051('0x10')](respondWithFilteredResult(_0x16c731,_0x31f3cb))['catch'](handleError(_0x16c731,null));};exports[_0x1051('0x5d')]=function(_0xcda895,_0x2b1cb3){var _0x43c252={'raw':![],'where':{'id':_0xcda895[_0x1051('0x5e')]['id']},'include':[{'model':db[_0x1051('0x40')],'as':'Imap'},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x1051('0x5f')],'as':_0x1051('0x42')}]},_0x5913d8={};_0x5913d8[_0x1051('0x48')]=_[_0x1051('0x49')](db[_0x1051('0x44')][_0x1051('0x45')]);_0x5913d8[_0x1051('0x4a')]=_[_0x1051('0x49')](_0xcda895[_0x1051('0x4a')]);_0x5913d8[_0x1051('0x4b')]=_[_0x1051('0x4c')](_0x5913d8[_0x1051('0x48')],_0x5913d8['query']);_0x43c252[_0x1051('0x4d')]=_[_0x1051('0x4c')](_0x5913d8[_0x1051('0x48')],qs[_0x1051('0x4e')](_0xcda895[_0x1051('0x4a')][_0x1051('0x4e')]));_0x43c252[_0x1051('0x4d')]=_0x43c252[_0x1051('0x4d')][_0x1051('0x4f')]?_0x43c252['attributes']:_0x5913d8[_0x1051('0x48')];if(_0xcda895[_0x1051('0x4a')][_0x1051('0x5a')]){_0x43c252[_0x1051('0x5b')]=[{'all':!![]}];}_0x43c252=_[_0x1051('0x57')]({},_0x43c252,_0xcda895['options']);return db[_0x1051('0x44')]['find'](_0x43c252)[_0x1051('0x10')](handleEntityNotFound(_0x2b1cb3,null))[_0x1051('0x10')](respondWithResult(_0x2b1cb3,null))[_0x1051('0x1a')](handleError(_0x2b1cb3,null));};exports['update']=function(_0x2f8043,_0x3786bb){if(_0x2f8043[_0x1051('0x60')]['id']){delete _0x2f8043[_0x1051('0x60')]['id'];}var _0x1b76ce=_0x2f8043[_0x1051('0x60')]['provider']===_0x1051('0x61')?null:_0x2f8043[_0x1051('0x60')]['provider'];var _0x508dca=_0x2f8043[_0x1051('0x60')][_0x1051('0x3e')]||{};var _0x468c5a=_0x2f8043[_0x1051('0x60')][_0x1051('0x3f')]||{};if(_0x1b76ce){_0x508dca[_0x1051('0x3a')]=getImapHost(_0x1b76ce);_0x508dca[_0x1051('0x39')]=0x3e1;_0x468c5a[_0x1051('0x3a')]=getSmtpHost(_0x1b76ce);_0x468c5a[_0x1051('0x39')]=0x24b;_0x468c5a['secure']=![];}if(_0x468c5a['modernAuthentication']){_0x468c5a['secure']=![];}else{_0x468c5a[_0x1051('0x38')]=null;}if(!_0x508dca[_0x1051('0x37')])_0x508dca['CloudProviderId']=null;_0x2f8043['body'][_0x1051('0x3e')]=_0x508dca;_0x2f8043[_0x1051('0x60')][_0x1051('0x3f')]=_0x468c5a;return db[_0x1051('0x44')][_0x1051('0x62')]({'where':{'id':_0x2f8043[_0x1051('0x5e')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x1051('0x3e')},{'model':db[_0x1051('0x41')],'as':_0x1051('0x3f')},{'model':db[_0x1051('0x5f')],'as':_0x1051('0x42')}]})['then'](handleEntityNotFound(_0x3786bb,null))['then'](function(_0x3eb8e2){if(!_0x3eb8e2)throw new Error('Mail\x20Account\x20not\x20found');if(_0x3eb8e2[_0x1051('0x3b')])delete _0x2f8043[_0x1051('0x60')][_0x1051('0x3e')];return _0x3eb8e2;})[_0x1051('0x10')](saveUpdates(_0x2f8043['body'],null))[_0x1051('0x10')](function(_0x31d14e){if(!_0x2f8043[_0x1051('0x60')]['Imap'])return _0x31d14e;return db['MailServerIn'][_0x1051('0x63')](_0x2f8043[_0x1051('0x60')][_0x1051('0x3e')],{'where':{'MailAccountId':_0x31d14e['id']}})[_0x1051('0x10')](function(){return _0x31d14e;});})[_0x1051('0x10')](function(_0x43ed5f){if(!_0x2f8043[_0x1051('0x60')]['Smtp'])return _0x43ed5f;return db[_0x1051('0x41')][_0x1051('0x63')](_0x2f8043[_0x1051('0x60')][_0x1051('0x3f')],{'where':{'MailAccountId':_0x43ed5f['id']}})[_0x1051('0x10')](function(){return _0x43ed5f;});})[_0x1051('0x10')](respondWithResult(_0x3786bb,null))[_0x1051('0x1a')](handleError(_0x3786bb,null));};exports[_0x1051('0x64')]=function(_0x463c24,_0x7db7ee){return db[_0x1051('0x44')][_0x1051('0x64')]()[_0x1051('0x10')](respondWithResult(_0x7db7ee,null))[_0x1051('0x1a')](handleError(_0x7db7ee,null));};exports['addDisposition']=function(_0x4acaad,_0x56191e){if(_0x4acaad[_0x1051('0x60')]['id']){delete _0x4acaad[_0x1051('0x60')]['id'];}return db[_0x1051('0x44')]['find']({'where':{'id':_0x4acaad[_0x1051('0x5e')]['id']}})['then'](handleEntityNotFound(_0x56191e,null))[_0x1051('0x10')](function(_0x505500){if(_0x505500){_0x4acaad[_0x1051('0x60')][_0x1051('0x65')]=_0x505500['id'];return db[_0x1051('0x66')][_0x1051('0x67')](_0x4acaad['body']);}})[_0x1051('0x10')](respondWithResult(_0x56191e,null))[_0x1051('0x1a')](handleError(_0x56191e,null));};exports[_0x1051('0x68')]=function(_0x501472,_0x551027){var _0x359be0={'raw':![],'where':{}};var _0x5b5744={};var _0x123421={'count':0x0,'rows':[]};return db[_0x1051('0x44')][_0x1051('0x69')]({'where':{'id':_0x501472[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x551027,null))[_0x1051('0x10')](function(_0x2089f3){if(_0x2089f3){_0x5b5744[_0x1051('0x48')]=_[_0x1051('0x49')](db[_0x1051('0x66')][_0x1051('0x45')]);_0x5b5744[_0x1051('0x4a')]=_[_0x1051('0x49')](_0x501472[_0x1051('0x4a')]);_0x5b5744[_0x1051('0x4b')]=_[_0x1051('0x4c')](_0x5b5744[_0x1051('0x48')],_0x5b5744[_0x1051('0x4a')]);_0x359be0[_0x1051('0x4d')]=_[_0x1051('0x4c')](_0x5b5744[_0x1051('0x48')],qs['fields'](_0x501472[_0x1051('0x4a')][_0x1051('0x4e')]));_0x359be0[_0x1051('0x4d')]=_0x359be0['attributes']['length']?_0x359be0[_0x1051('0x4d')]:_0x5b5744[_0x1051('0x48')];if(!_0x501472[_0x1051('0x4a')]['hasOwnProperty'](_0x1051('0x51'))){_0x359be0[_0x1051('0x21')]=qs[_0x1051('0x21')](_0x501472[_0x1051('0x4a')][_0x1051('0x21')]);_0x359be0['offset']=qs[_0x1051('0x1e')](_0x501472[_0x1051('0x4a')][_0x1051('0x1e')]);}_0x359be0[_0x1051('0x52')]=qs[_0x1051('0x53')](_0x501472[_0x1051('0x4a')][_0x1051('0x53')]);_0x359be0[_0x1051('0x54')]=qs[_0x1051('0x4b')](_['pick'](_0x501472['query'],_0x5b5744[_0x1051('0x4b')]));_0x359be0[_0x1051('0x54')]['MailAccountId']=_0x2089f3['id'];if(_0x501472[_0x1051('0x4a')][_0x1051('0x56')]){_0x359be0[_0x1051('0x54')]=_[_0x1051('0x57')](_0x359be0[_0x1051('0x54')],{'$or':_['map'](_0x359be0[_0x1051('0x4d')],function(_0x368794){var _0x401d68={};_0x401d68[_0x368794]={'$like':'%'+_0x501472['query']['filter']+'%'};return _0x401d68;})});}_0x359be0=_[_0x1051('0x57')]({},_0x359be0,_0x501472[_0x1051('0x59')]);return db[_0x1051('0x66')]['count']({'where':_0x359be0[_0x1051('0x54')]})['then'](function(_0x451dbd){_0x123421[_0x1051('0x20')]=_0x451dbd;if(_0x501472['query'][_0x1051('0x5a')]){_0x359be0['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x359be0);})[_0x1051('0x10')](function(_0x3ebe2c){_0x123421[_0x1051('0x5c')]=_0x3ebe2c;return _0x123421;});}})['then'](respondWithFilteredResult(_0x551027,_0x359be0))[_0x1051('0x1a')](handleError(_0x551027,null));};exports[_0x1051('0x6a')]=function(_0x407096,_0x4f3fad){return db[_0x1051('0x44')]['find']({'where':{'id':_0x407096[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x4f3fad,null))[_0x1051('0x10')](function(_0x569d16){if(_0x569d16){return _0x569d16[_0x1051('0x6a')](_0x407096['query'][_0x1051('0x6b')]);}})[_0x1051('0x10')](respondWithStatusCode(_0x4f3fad,null))[_0x1051('0x1a')](handleError(_0x4f3fad,null));};exports[_0x1051('0x6c')]=function(_0x477fbb,_0x55944d){if(_0x477fbb[_0x1051('0x60')]['id']){delete _0x477fbb['body']['id'];}return db[_0x1051('0x44')][_0x1051('0x62')]({'where':{'id':_0x477fbb[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x55944d,null))[_0x1051('0x10')](function(_0x592383){if(_0x592383){_0x477fbb['body'][_0x1051('0x65')]=_0x592383['id'];return db['CannedAnswer'][_0x1051('0x67')](_0x477fbb[_0x1051('0x60')]);}})[_0x1051('0x10')](respondWithResult(_0x55944d,null))[_0x1051('0x1a')](handleError(_0x55944d,null));};exports['getAnswers']=function(_0x119732,_0xce554e){var _0x63f1f5={'raw':![],'where':{}};var _0x720dc1={};var _0x521126={'count':0x0,'rows':[]};return db[_0x1051('0x44')]['findOne']({'where':{'id':_0x119732[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0xce554e,null))[_0x1051('0x10')](function(_0x3539d4){if(_0x3539d4){_0x720dc1[_0x1051('0x48')]=_[_0x1051('0x49')](db[_0x1051('0x6d')][_0x1051('0x45')]);_0x720dc1['query']=_[_0x1051('0x49')](_0x119732['query']);_0x720dc1[_0x1051('0x4b')]=_[_0x1051('0x4c')](_0x720dc1[_0x1051('0x48')],_0x720dc1[_0x1051('0x4a')]);_0x63f1f5[_0x1051('0x4d')]=_['intersection'](_0x720dc1[_0x1051('0x48')],qs[_0x1051('0x4e')](_0x119732[_0x1051('0x4a')][_0x1051('0x4e')]));_0x63f1f5['attributes']=_0x63f1f5[_0x1051('0x4d')][_0x1051('0x4f')]?_0x63f1f5[_0x1051('0x4d')]:_0x720dc1[_0x1051('0x48')];if(!_0x119732[_0x1051('0x4a')][_0x1051('0x50')]('nolimit')){_0x63f1f5[_0x1051('0x21')]=qs[_0x1051('0x21')](_0x119732[_0x1051('0x4a')][_0x1051('0x21')]);_0x63f1f5[_0x1051('0x1e')]=qs[_0x1051('0x1e')](_0x119732[_0x1051('0x4a')][_0x1051('0x1e')]);}_0x63f1f5[_0x1051('0x52')]=qs[_0x1051('0x53')](_0x119732[_0x1051('0x4a')][_0x1051('0x53')]);_0x63f1f5[_0x1051('0x54')]=qs['filters'](_[_0x1051('0x55')](_0x119732[_0x1051('0x4a')],_0x720dc1[_0x1051('0x4b')]));_0x63f1f5[_0x1051('0x54')][_0x1051('0x65')]=_0x3539d4['id'];if(_0x119732[_0x1051('0x4a')]['filter']){_0x63f1f5[_0x1051('0x54')]=_[_0x1051('0x57')](_0x63f1f5[_0x1051('0x54')],{'$or':_[_0x1051('0x43')](_0x63f1f5[_0x1051('0x4d')],function(_0x4bea2a){var _0x226250={};_0x226250[_0x4bea2a]={'$like':'%'+_0x119732[_0x1051('0x4a')][_0x1051('0x56')]+'%'};return _0x226250;})});}_0x63f1f5=_['merge']({},_0x63f1f5,_0x119732[_0x1051('0x59')]);return db[_0x1051('0x6d')][_0x1051('0x20')]({'where':_0x63f1f5[_0x1051('0x54')]})[_0x1051('0x10')](function(_0xf13e38){_0x521126['count']=_0xf13e38;if(_0x119732['query'][_0x1051('0x5a')]){_0x63f1f5[_0x1051('0x5b')]=[{'all':!![]}];}return db[_0x1051('0x6d')]['findAll'](_0x63f1f5);})[_0x1051('0x10')](function(_0x294aa4){_0x521126[_0x1051('0x5c')]=_0x294aa4;return _0x521126;});}})['then'](respondWithFilteredResult(_0xce554e,_0x63f1f5))['catch'](handleError(_0xce554e,null));};exports[_0x1051('0x6e')]=function(_0x4e0b73,_0x494485){return db[_0x1051('0x44')][_0x1051('0x62')]({'where':{'id':_0x4e0b73['params']['id']}})['then'](handleEntityNotFound(_0x494485,null))[_0x1051('0x10')](function(_0x4666bb){if(_0x4666bb){return _0x4666bb[_0x1051('0x6e')](_0x4e0b73[_0x1051('0x4a')][_0x1051('0x6b')]);}})['then'](respondWithStatusCode(_0x494485,null))['catch'](handleError(_0x494485,null));};exports[_0x1051('0x67')]=function(_0x584bfa,_0x5ea471){var _0x38d4f8={'name':_0x584bfa[_0x1051('0x60')]['name'],'key':_0x584bfa[_0x1051('0x60')][_0x1051('0x47')],'provider':_0x584bfa['body'][_0x1051('0x6f')]==='custom'?null:_0x584bfa[_0x1051('0x60')]['provider'],'email':_0x584bfa[_0x1051('0x60')][_0x1051('0x70')],'ListId':_0x584bfa['body']['ListId'],'active':!_[_0x1051('0x71')](_0x584bfa[_0x1051('0x60')][_0x1051('0x72')])?_0x584bfa[_0x1051('0x60')][_0x1051('0x72')]:!![],'description':_0x584bfa[_0x1051('0x60')][_0x1051('0x73')]||null};var _0x24d984=getAuthenticationOptions(_0x38d4f8[_0x1051('0x6f')],_0x584bfa[_0x1051('0x60')]);_0x38d4f8[_0x1051('0x3e')]=_0x24d984['Imap'];_0x38d4f8[_0x1051('0x3f')]=_0x24d984[_0x1051('0x3f')];return db[_0x1051('0x44')][_0x1051('0x67')](_0x38d4f8,{'include':[{'model':db[_0x1051('0x41')],'as':_0x1051('0x3f')},{'model':db[_0x1051('0x40')],'as':'Imap'}]})[_0x1051('0x10')](function(_0x39df30){var _0x4c47dd=_0x584bfa['user'][_0x1051('0x74')]({'plain':!![]});if(!_0x4c47dd)throw new Error(_0x1051('0x75'));if(_0x4c47dd[_0x1051('0x76')]===_0x1051('0x34')){var _0x11fd19=_0x39df30[_0x1051('0x74')]({'plain':!![]});return db['UserProfileSection'][_0x1051('0x62')]({'where':{'name':_0x1051('0x25'),'userProfileId':_0x4c47dd['userProfileId']},'raw':!![]})[_0x1051('0x10')](function(_0x356146){if(_0x356146&&_0x356146['autoAssociation']===0x0){return db[_0x1051('0x26')][_0x1051('0x67')]({'name':_0x11fd19[_0x1051('0x28')],'resourceId':_0x11fd19['id'],'type':_0x356146[_0x1051('0x28')],'sectionId':_0x356146['id']},{})[_0x1051('0x10')](function(){return _0x39df30;});}else{return _0x39df30;}})['catch'](function(_0x38f2d4){logger[_0x1051('0x17')](_0x1051('0x77'),_0x38f2d4);throw _0x38f2d4;});}return _0x39df30;})['then'](respondWithResult(_0x5ea471,0xc9))[_0x1051('0x1a')](handleError(_0x5ea471,null));};exports[_0x1051('0x78')]=function(_0x24dd4f,_0x5514dd){return db[_0x1051('0x44')][_0x1051('0x69')]({'where':{'id':_0x24dd4f[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x5514dd,null))[_0x1051('0x10')](function(_0x4c935c){if(_0x4c935c){return _0x4c935c[_0x1051('0x78')]();}return null;})[_0x1051('0x10')](respondWithResult(_0x5514dd,null))['catch'](handleError(_0x5514dd,null));};exports[_0x1051('0x79')]=function(_0x36142a,_0x3559e9){if(_0x36142a[_0x1051('0x60')]['id']){delete _0x36142a[_0x1051('0x60')]['id'];}return db[_0x1051('0x44')][_0x1051('0x62')]({'where':{'id':_0x36142a['params']['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x3559e9,null))[_0x1051('0x10')](function(_0x4f646a){if(_0x4f646a){_0x36142a[_0x1051('0x60')][_0x1051('0x65')]=_0x4f646a['id'];return db['MailServerIn'][_0x1051('0x67')](_0x36142a[_0x1051('0x60')]);}})[_0x1051('0x10')](respondWithResult(_0x3559e9,null))[_0x1051('0x1a')](handleError(_0x3559e9,null));};exports['removeImap']=function(_0x39a73f,_0x498a){return db['MailAccount']['findOne']({'where':{'id':_0x39a73f[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x498a,null))[_0x1051('0x10')](function(_0x5d0ff7){if(_0x5d0ff7){return _0x5d0ff7[_0x1051('0x7a')](null);}return null;})[_0x1051('0x10')](respondWithStatusCode(_0x498a,null))[_0x1051('0x1a')](handleError(_0x498a,null));};exports[_0x1051('0x7b')]=function(_0x29c43e,_0x1f661f){return db[_0x1051('0x44')][_0x1051('0x69')]({'where':{'id':_0x29c43e[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x1f661f,null))[_0x1051('0x10')](function(_0x542512){if(_0x542512){return _0x542512['getSmtp']();}return null;})[_0x1051('0x10')](respondWithResult(_0x1f661f,null))[_0x1051('0x1a')](handleError(_0x1f661f,null));};exports['addSmtp']=function(_0x10c960,_0xe801d3){if(_0x10c960[_0x1051('0x60')]['id']){delete _0x10c960[_0x1051('0x60')]['id'];}return db[_0x1051('0x44')][_0x1051('0x62')]({'where':{'id':_0x10c960[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0xe801d3,null))[_0x1051('0x10')](function(_0x281e2a){if(_0x281e2a){_0x10c960[_0x1051('0x60')][_0x1051('0x65')]=_0x281e2a['id'];return db['MailServerOut'][_0x1051('0x67')](_0x10c960['body']);}})[_0x1051('0x10')](respondWithResult(_0xe801d3,null))[_0x1051('0x1a')](handleError(_0xe801d3,null));};exports['removeSmtp']=function(_0x1e8e92,_0x22107d){return db[_0x1051('0x44')][_0x1051('0x69')]({'where':{'id':_0x1e8e92[_0x1051('0x5e')]['id']}})['then'](handleEntityNotFound(_0x22107d,null))[_0x1051('0x10')](function(_0x4441d2){if(_0x4441d2){return _0x4441d2[_0x1051('0x7c')](null);}return null;})[_0x1051('0x10')](respondWithStatusCode(_0x22107d,null))['catch'](handleError(_0x22107d,null));};exports['addInteraction']=function(_0x339940,_0x484e89){return db[_0x1051('0x7d')]['find']({'where':{'id':_0x339940[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x484e89,null))[_0x1051('0x10')](function(_0x1ed52f){if(_0x1ed52f){return _0x1ed52f[_0x1051('0x7e')](_0x339940['body'][_0x1051('0x6b')],_[_0x1051('0x7f')](_0x339940['body'],[_0x1051('0x6b'),'id'])||{});}})[_0x1051('0x10')](respondWithResult(_0x484e89,null))[_0x1051('0x1a')](handleError(_0x484e89,null));};exports[_0x1051('0x80')]=function(_0x1f0102,_0x2f2d80){var _0x512a8c={'raw':![],'where':{}};var _0x36fe0b={};var _0x273195={'count':0x0,'rows':[]};return db['MailAccount'][_0x1051('0x69')]({'where':{'id':_0x1f0102[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x2f2d80,null))[_0x1051('0x10')](function(_0x5598f6){if(_0x5598f6){_0x36fe0b[_0x1051('0x48')]=_[_0x1051('0x49')](db[_0x1051('0x7d')][_0x1051('0x45')]);_0x36fe0b[_0x1051('0x4a')]=_[_0x1051('0x49')](_0x1f0102[_0x1051('0x4a')]);_0x36fe0b[_0x1051('0x4b')]=_[_0x1051('0x4c')](_0x36fe0b[_0x1051('0x48')],_0x36fe0b[_0x1051('0x4a')]);_0x512a8c['attributes']=_[_0x1051('0x4c')](_0x36fe0b[_0x1051('0x48')],qs[_0x1051('0x4e')](_0x1f0102[_0x1051('0x4a')][_0x1051('0x4e')]));_0x512a8c[_0x1051('0x4d')]=_0x512a8c[_0x1051('0x4d')][_0x1051('0x4f')]?_0x512a8c[_0x1051('0x4d')]:_0x36fe0b['model'];if(!_0x1f0102[_0x1051('0x4a')][_0x1051('0x50')](_0x1051('0x51'))){_0x512a8c[_0x1051('0x21')]=qs['limit'](_0x1f0102['query']['limit']);_0x512a8c[_0x1051('0x1e')]=qs[_0x1051('0x1e')](_0x1f0102[_0x1051('0x4a')][_0x1051('0x1e')]);}_0x512a8c['order']=qs['sort'](_0x1f0102[_0x1051('0x4a')][_0x1051('0x53')]);_0x512a8c[_0x1051('0x54')]=qs[_0x1051('0x4b')](_[_0x1051('0x55')](_0x1f0102[_0x1051('0x4a')],_0x36fe0b['filters']));_0x512a8c['where'][_0x1051('0x65')]=_0x5598f6['id'];if(_0x1f0102[_0x1051('0x4a')][_0x1051('0x56')]){_0x512a8c[_0x1051('0x54')]=_[_0x1051('0x57')](_0x512a8c['where'],{'$or':_[_0x1051('0x43')](_0x512a8c[_0x1051('0x4d')],function(_0x483f25){var _0xc5f801={};_0xc5f801[_0x483f25]={'$like':'%'+_0x1f0102['query'][_0x1051('0x56')]+'%'};return _0xc5f801;})});}_0x512a8c=_['merge']({},_0x512a8c,_0x1f0102[_0x1051('0x59')]);return db[_0x1051('0x7d')][_0x1051('0x20')]({'where':_0x512a8c[_0x1051('0x54')]})[_0x1051('0x10')](function(_0x4fd46c){_0x273195[_0x1051('0x20')]=_0x4fd46c;if(_0x1f0102[_0x1051('0x4a')][_0x1051('0x5a')]){_0x512a8c[_0x1051('0x5b')]=[{'model':db[_0x1051('0x81')],'as':'Contact','required':![]},{'model':db[_0x1051('0x82')],'as':'Owner','attributes':[_0x1051('0x28'),'fullname',_0x1051('0x83')],'required':![]},{'model':db[_0x1051('0x84')],'as':'Tags','attributes':['id',_0x1051('0x28'),_0x1051('0x85')],'where':_0x1f0102[_0x1051('0x4a')][_0x1051('0x86')]?{'id':_0x1f0102[_0x1051('0x4a')][_0x1051('0x86')]}:undefined,'required':_0x1f0102[_0x1051('0x4a')][_0x1051('0x86')]?!![]:![]}];}return db[_0x1051('0x7d')][_0x1051('0x87')](_0x512a8c);})[_0x1051('0x10')](function(_0x1d415e){_0x273195[_0x1051('0x5c')]=_0x1d415e;return _0x273195;});}})[_0x1051('0x10')](respondWithFilteredResult(_0x2f2d80,_0x512a8c))[_0x1051('0x1a')](handleError(_0x2f2d80,null));};exports[_0x1051('0x88')]=function addApplications(_0x1ae1e1,_0x5e3663){var _0x50fc30=_0x1ae1e1[_0x1051('0x5e')]['id'];var _0x3053c1=_0x1ae1e1[_0x1051('0x60')];var _0x8dc6c1=0xc8;var _0x38ff9c=null;return db[_0x1051('0x89')][_0x1051('0x8a')]({'isolationLevel':db[_0x1051('0x89')][_0x1051('0x8b')][_0x1051('0x8c')][_0x1051('0x8d')]},function(_0x53ed17){return db[_0x1051('0x44')][_0x1051('0x69')]({'where':{'id':_0x50fc30},'transaction':_0x53ed17})[_0x1051('0x10')](function(_0x41fca3){if(_0x41fca3){return db[_0x1051('0x8e')][_0x1051('0x8f')]({'where':{'MailAccountId':_0x50fc30},'transaction':_0x53ed17})[_0x1051('0x10')](function(){var _0x44abd7=_[_0x1051('0x43')](_0x3053c1,function(_0x4f7bae){_0x4f7bae['MailAccountId']=_0x50fc30;return _0x4f7bae;});return db[_0x1051('0x8e')]['bulkCreate'](_0x44abd7,{'transaction':_0x53ed17});});}else{_0x8dc6c1=0x194;_0x38ff9c=[];}});})['then'](function(){if(_0x8dc6c1!==0x194){return db['MailApplication'][_0x1051('0x90')]({'where':{'MailAccountId':_0x50fc30},'order':_0x1051('0x91')})[_0x1051('0x10')](function(_0x1de4dd){_0x38ff9c=_0x1de4dd;});}})[_0x1051('0x1a')](function(_0x46bd28){_0x8dc6c1=0x1f4;logger[_0x1051('0x17')](_0x46bd28[_0x1051('0x27')]);if(_0x46bd28['name']){delete _0x46bd28[_0x1051('0x28')];}_0x38ff9c=_0x46bd28;})[_0x1051('0x92')](function(){if(_0x38ff9c===null){_0x5e3663['sendStatus'](_0x8dc6c1);}else{if(_0x8dc6c1===0x1f4){_0x5e3663[_0x1051('0x1c')](_0x8dc6c1)[_0x1051('0x29')](_0x38ff9c);}else{_0x5e3663[_0x1051('0x1c')](_0x8dc6c1)[_0x1051('0x24')](_0x38ff9c);}}});};exports[_0x1051('0x93')]=function(_0x2559d6,_0x1db0ac){var _0x4ebe5b={};var _0x11b1fc={};var _0x1a41f8;var _0xf706b3;return db[_0x1051('0x44')][_0x1051('0x69')]({'where':{'id':_0x2559d6['params']['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x1db0ac,null))[_0x1051('0x10')](function(_0x1e2650){if(_0x1e2650){_0x1a41f8=_0x1e2650;_0x11b1fc['model']=_[_0x1051('0x49')](db[_0x1051('0x8e')]['rawAttributes']);_0x11b1fc['query']=_[_0x1051('0x49')](_0x2559d6['query']);_0x11b1fc[_0x1051('0x4b')]=_['intersection'](_0x11b1fc[_0x1051('0x48')],_0x11b1fc['query']);_0x4ebe5b[_0x1051('0x4d')]=_[_0x1051('0x4c')](_0x11b1fc['model'],qs[_0x1051('0x4e')](_0x2559d6[_0x1051('0x4a')][_0x1051('0x4e')]));_0x4ebe5b[_0x1051('0x4d')]=_0x4ebe5b[_0x1051('0x4d')][_0x1051('0x4f')]?_0x4ebe5b['attributes']:_0x11b1fc[_0x1051('0x48')];_0x4ebe5b[_0x1051('0x52')]=qs[_0x1051('0x53')](_0x2559d6['query'][_0x1051('0x53')]);_0x4ebe5b[_0x1051('0x54')]=qs['filters'](_[_0x1051('0x55')](_0x2559d6[_0x1051('0x4a')],_0x11b1fc[_0x1051('0x4b')]));if(_0x2559d6[_0x1051('0x4a')][_0x1051('0x56')]){_0x4ebe5b[_0x1051('0x54')]=_['merge'](_0x4ebe5b[_0x1051('0x54')],{'$or':_[_0x1051('0x43')](_0x4ebe5b[_0x1051('0x4d')],function(_0x366473){var _0x1d6658={};_0x1d6658[_0x366473]={'$like':'%'+_0x2559d6[_0x1051('0x4a')][_0x1051('0x56')]+'%'};return _0x1d6658;})});}_0x4ebe5b=_[_0x1051('0x57')]({},_0x4ebe5b,_0x2559d6[_0x1051('0x59')]);return _0x1a41f8[_0x1051('0x93')](_0x4ebe5b);}})[_0x1051('0x10')](function(_0x4d5edc){if(_0x4d5edc){_0xf706b3=_0x4d5edc[_0x1051('0x4f')];if(!_0x2559d6[_0x1051('0x4a')][_0x1051('0x50')](_0x1051('0x51'))){_0x4ebe5b[_0x1051('0x21')]=qs[_0x1051('0x21')](_0x2559d6[_0x1051('0x4a')]['limit']);_0x4ebe5b['offset']=qs[_0x1051('0x1e')](_0x2559d6[_0x1051('0x4a')]['offset']);}return _0x1a41f8['getApplications'](_0x4ebe5b);}})[_0x1051('0x10')](function(_0x3a0aa1){if(_0x3a0aa1){return _0x3a0aa1?{'count':_0xf706b3,'rows':_0x3a0aa1}:null;}})['then'](respondWithResult(_0x1db0ac,null))[_0x1051('0x1a')](handleError(_0x1db0ac,null));};exports[_0x1051('0x94')]=function(_0x38bd49,_0x269d2b){var _0x232529={'raw':!![],'where':{}};var _0x2714f6={};var _0x1a6c27={'count':0x0,'rows':[]};return db[_0x1051('0x44')][_0x1051('0x69')]({'where':{'id':_0x38bd49['params']['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x269d2b,null))['then'](function(_0x1908d2){if(_0x1908d2){_0x2714f6[_0x1051('0x48')]=_[_0x1051('0x49')](db[_0x1051('0x95')]['rawAttributes']);_0x2714f6[_0x1051('0x4a')]=_[_0x1051('0x49')](_0x38bd49['query']);_0x2714f6[_0x1051('0x4b')]=_[_0x1051('0x4c')](_0x2714f6[_0x1051('0x48')],_0x2714f6[_0x1051('0x4a')]);_0x232529[_0x1051('0x4d')]=_[_0x1051('0x4c')](_0x2714f6['model'],qs[_0x1051('0x4e')](_0x38bd49[_0x1051('0x4a')]['fields']));_0x232529[_0x1051('0x4d')]=_0x232529['attributes']['length']?_0x232529[_0x1051('0x4d')]:_0x2714f6[_0x1051('0x48')];if(!_0x38bd49['query'][_0x1051('0x50')](_0x1051('0x51'))){_0x232529[_0x1051('0x21')]=qs[_0x1051('0x21')](_0x38bd49[_0x1051('0x4a')]['limit']);_0x232529[_0x1051('0x1e')]=qs['offset'](_0x38bd49[_0x1051('0x4a')]['offset']);}_0x232529[_0x1051('0x52')]=qs[_0x1051('0x53')](_0x38bd49[_0x1051('0x4a')][_0x1051('0x53')]);_0x232529[_0x1051('0x54')]=qs[_0x1051('0x4b')](_[_0x1051('0x55')](_0x38bd49[_0x1051('0x4a')],_0x2714f6[_0x1051('0x4b')]));_0x232529[_0x1051('0x54')][_0x1051('0x65')]=_0x1908d2['id'];if(_0x38bd49[_0x1051('0x4a')][_0x1051('0x56')]){_0x232529[_0x1051('0x54')]=_[_0x1051('0x57')](_0x232529[_0x1051('0x54')],{'$or':_[_0x1051('0x43')](_0x232529['attributes'],function(_0x174808){var _0x504d8b={};_0x504d8b[_0x174808]={'$like':'%'+_0x38bd49[_0x1051('0x4a')][_0x1051('0x56')]+'%'};return _0x504d8b;})});}if(_0x38bd49[_0x1051('0x4a')][_0x1051('0x96')]){var _0x361b8b=_0x38bd49[_0x1051('0x4a')][_0x1051('0x96')][_0x1051('0x97')](',');var _0x33ea60={};_0x33ea60[_0x361b8b[0x0]]={'$gte':moment(_0x361b8b[0x1])['format'](_0x1051('0x98'))};_0x232529[_0x1051('0x54')]=_[_0x1051('0x57')](_0x232529['where'],_0x33ea60);}_0x232529=_['merge']({},_0x232529,_0x38bd49[_0x1051('0x59')]);return db['MailMessage'][_0x1051('0x20')]({'where':_0x232529['where']})['then'](function(_0x588643){_0x1a6c27['count']=_0x588643;if(_0x38bd49['query'][_0x1051('0x5a')]){_0x232529[_0x1051('0x5b')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x232529);})[_0x1051('0x10')](function(_0xdda736){if(_0x38bd49[_0x1051('0x4a')]['inlineCss']===_0x1051('0x99')){for(var _0x5db9b9=0x0;_0x5db9b9<_0xdda736[_0x1051('0x4f')];_0x5db9b9++){_0xdda736[_0x5db9b9][_0x1051('0x60')]=juice(_0xdda736[_0x5db9b9]['body']);}}_0x1a6c27[_0x1051('0x5c')]=_0xdda736;return _0x1a6c27;});}})[_0x1051('0x10')](respondWithFilteredResult(_0x269d2b,_0x232529))[_0x1051('0x1a')](handleError(_0x269d2b,null));};exports[_0x1051('0x29')]=function(_0x19547b,_0x354957){var _0x4a1983,_0x100f73={},_0x93e7d6;if(_0x19547b[_0x1051('0x60')]['to']){_0x93e7d6=_0x19547b[_0x1051('0x60')]['to']['split'](',')[0x0];}return db[_0x1051('0x44')][_0x1051('0x62')]({'where':{'id':_0x19547b[_0x1051('0x5e')]['id']},'include':[{'model':db[_0x1051('0x9a')],'as':_0x1051('0x9b'),'include':[{'model':db['CmContact'],'as':_0x1051('0x9c'),'where':{'email':_0x93e7d6},'limit':0x1,'order':[['updatedAt',_0x1051('0x9d')]]}]},{'model':db[_0x1051('0x41')],'as':_0x1051('0x3f'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x1051('0x10')](handleEntityNotFound(_0x354957,null))['then'](function(_0x1254fd){if(!_0x1254fd)return;_0x4a1983=_0x1254fd;if(!_0x1254fd['Smtp'])throw new Error(_0x1051('0x9e'));if(_['isNil'](_0x19547b['body'][_0x1051('0x9f')])){_0x19547b['body'][_0x1051('0x9f')]=util[_0x1051('0xa0')](_0x1051('0xa1'),_0x1254fd[_0x1051('0x28')],_0x1254fd[_0x1051('0x70')]||_0x1254fd[_0x1051('0x3f')][_0x1051('0x34')]);}if(_0x19547b['body'][_0x1051('0xa2')]&&_0x19547b[_0x1051('0x60')]['attachments'][_0x1051('0x4f')]){for(var _0x288722=0x0;_0x288722<_0x19547b[_0x1051('0x60')][_0x1051('0xa2')][_0x1051('0x4f')];_0x288722+=0x1){_0x19547b[_0x1051('0x60')][_0x1051('0xa2')][_0x288722]={'filename':_0x19547b[_0x1051('0x60')][_0x1051('0xa2')][_0x288722]['name'],'path':path[_0x1051('0xa3')](config[_0x1051('0xa4')],_0x1051('0xa5'),_0x19547b[_0x1051('0x60')][_0x1051('0xa2')][_0x288722][_0x1051('0xa6')])};}}var _0x4fa89f=_0x1254fd['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x1051('0xa7'),{'account':_0x4fa89f,'message':_0x19547b[_0x1051('0x60')]});})[_0x1051('0x10')](function(_0x33945e){if(!_0x33945e)return;_0x100f73=_0x33945e;if(!_0x4a1983[_0x1051('0x9b')])throw new Error(_0x1051('0xa8'));if(_0x4a1983[_0x1051('0x9b')][_0x1051('0x9c')][_0x1051('0x4f')])return _0x4a1983['List']['Contacts'][0x0];return db[_0x1051('0x81')]['create'](_['defaults'](_0x19547b[_0x1051('0x60')],{'firstName':_0x19547b[_0x1051('0x60')]['to'],'email':_0x19547b[_0x1051('0x60')]['to'],'phone':_0x19547b[_0x1051('0x60')]['to'],'ListId':_0x4a1983[_0x1051('0xa9')]}));})['then'](function(_0x2e311d){if(!_0x2e311d)return;var _0x4c3a2a={'UserId':_0x19547b[_0x1051('0x34')]['id'],'ContactId':_0x2e311d['id'],'MailAccountId':_0x4a1983['id'],'inReplyTo':_0x100f73[_0x1051('0xaa')],'to':_0x19547b[_0x1051('0x60')][_0x1051('0x9f')],'cc':_0x19547b[_0x1051('0x60')]['cc'],'subject':_0x19547b[_0x1051('0x60')][_0x1051('0xab')],'attach':_0x19547b[_0x1051('0x60')][_0x1051('0xac')],'firstMsgDirection':_0x1051('0xad'),'lastMsgAt':moment()[_0x1051('0xa0')](_0x1051('0x98')),'lastMsgDirection':'out','Messages':[_['merge'](_0x19547b[_0x1051('0x60')],{'messageId':_0x100f73[_0x1051('0xaa')],'sentAt':moment()['format'](_0x1051('0x98')),'read':!![],'MailAccountId':_0x4a1983['id'],'UserId':_0x19547b[_0x1051('0x34')]['id'],'ContactId':_0x2e311d['id']})]};if(_0x19547b[_0x1051('0x60')][_0x1051('0xae')]){_0x4c3a2a=_[_0x1051('0x57')](_0x4c3a2a,_0x19547b[_0x1051('0x60')][_0x1051('0xae')]);}return db['MailInteraction'][_0x1051('0x67')](_0x4c3a2a,{'include':[{'model':db['MailMessage'],'as':_0x1051('0xaf')}]});})[_0x1051('0x10')](respondWithResult(_0x354957,null))[_0x1051('0x1a')](handleError(_0x354957,null));};exports['verifySmtp']=function(_0x597187,_0xf71d56){return db['MailAccount'][_0x1051('0x62')]({'where':{'id':_0x597187[_0x1051('0x5e')]['id']},'include':[{'model':db[_0x1051('0x41')],'as':_0x1051('0x3f'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x1051('0xb0'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0xf71d56,null))['then'](function(_0x56203b){if(!_0x56203b[_0x1051('0x3f')])return;var _0x48248b=_0x56203b[_0x1051('0xb1')]();return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x48248b});})[_0x1051('0x10')](respondWithResult(_0xf71d56,null))['catch'](handleError(_0xf71d56,null));};exports['destroy']=function(_0x606ab7,_0x236d68){return db[_0x1051('0x44')][_0x1051('0x62')]({'where':{'id':_0x606ab7[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x236d68,null))[_0x1051('0x10')](function(_0x441296){if(_0x441296&&_0x441296[_0x1051('0x3b')]){throw new db['Sequelize'][(_0x1051('0xb2'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x441296;})[_0x1051('0x10')](removeEntity(_0x236d68,null))[_0x1051('0x1a')](handleError(_0x236d68,null));};exports[_0x1051('0xb3')]=function(_0x5adf9c,_0x43a252){return db[_0x1051('0x44')]['find']({'where':{'id':_0x5adf9c['params']['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x43a252,null))['then'](function(_0x1ba58a){if(_0x1ba58a){return _0x1ba58a[_0x1051('0xb3')](_0x5adf9c[_0x1051('0x60')][_0x1051('0x6b')],_[_0x1051('0x7f')](_0x5adf9c[_0x1051('0x60')],['ids','id'])||{})[_0x1051('0xb4')](function(_0x5a733f){for(var _0x1edb55=0x0;_0x1edb55<_0x5adf9c[_0x1051('0x60')][_0x1051('0x6b')][_0x1051('0x4f')];_0x1edb55+=0x1){socket[_0x1051('0xb5')](_0x1051('0xb6'),{'UserId':Number(_0x5adf9c[_0x1051('0x60')]['ids'][_0x1edb55]),'MailAccountId':Number(_0x5adf9c[_0x1051('0x5e')]['id'])});}return _0x5a733f;});}})[_0x1051('0x10')](respondWithResult(_0x43a252,null))['catch'](handleError(_0x43a252,null));};exports[_0x1051('0xb7')]=function(_0x517be5,_0x53a801){return db['MailAccount']['find']({'where':{'id':_0x517be5[_0x1051('0x5e')]['id']}})[_0x1051('0x10')](handleEntityNotFound(_0x53a801,null))[_0x1051('0x10')](function(_0x4f8785){if(_0x4f8785){return _0x4f8785['removeAgents'](_0x517be5[_0x1051('0x4a')][_0x1051('0x6b')])['then'](function(){if(_[_0x1051('0xb8')](_0x517be5[_0x1051('0x4a')][_0x1051('0x6b')])){for(var _0x171306=0x0;_0x171306<_0x517be5['query'][_0x1051('0x6b')]['length'];_0x171306+=0x1){socket['emit']('userMailAccount:remove',{'UserId':Number(_0x517be5[_0x1051('0x4a')]['ids'][_0x171306]),'MailAccountId':Number(_0x517be5[_0x1051('0x5e')]['id'])});}}else{socket['emit'](_0x1051('0xb9'),{'UserId':Number(_0x517be5['query']['ids']),'MailAccountId':Number(_0x517be5['params']['id'])});}});}})[_0x1051('0x10')](respondWithStatusCode(_0x53a801,null))[_0x1051('0x1a')](handleError(_0x53a801,null));};exports[_0x1051('0xba')]=function(_0xec5813,_0x258d7f){var _0x1157d7={};var _0x2dcd0d={};var _0x2ecb97;var _0x504bc0;return db['MailAccount'][_0x1051('0x69')]({'where':{'id':_0xec5813['params']['id']}})['then'](handleEntityNotFound(_0x258d7f,null))[_0x1051('0x10')](function(_0x3d2ce1){if(_0x3d2ce1){_0x2ecb97=_0x3d2ce1;_0x2dcd0d[_0x1051('0x48')]=_['keys'](db[_0x1051('0x82')][_0x1051('0x45')]);_0x2dcd0d['query']=_[_0x1051('0x49')](_0xec5813[_0x1051('0x4a')]);_0x2dcd0d[_0x1051('0x4b')]=_[_0x1051('0x4c')](_0x2dcd0d['model'],_0x2dcd0d['query']);_0x1157d7[_0x1051('0x4d')]=_[_0x1051('0x4c')](_0x2dcd0d[_0x1051('0x48')],qs[_0x1051('0x4e')](_0xec5813[_0x1051('0x4a')]['fields']));_0x1157d7[_0x1051('0x4d')]=_0x1157d7[_0x1051('0x4d')][_0x1051('0x4f')]?_0x1157d7[_0x1051('0x4d')]:_0x2dcd0d[_0x1051('0x48')];_0x1157d7[_0x1051('0x52')]=qs['sort'](_0xec5813['query']['sort']);_0x1157d7[_0x1051('0x54')]=qs[_0x1051('0x4b')](_[_0x1051('0x55')](_0xec5813[_0x1051('0x4a')],_0x2dcd0d['filters']));if(_0xec5813['query'][_0x1051('0x56')]){_0x1157d7['where']=_['merge'](_0x1157d7[_0x1051('0x54')],{'$or':_[_0x1051('0x43')](_0x1157d7['attributes'],function(_0x33f403){var _0x3b767a={};_0x3b767a[_0x33f403]={'$like':'%'+_0xec5813[_0x1051('0x4a')][_0x1051('0x56')]+'%'};return _0x3b767a;})});}_0x1157d7=_['merge']({},_0x1157d7,_0xec5813[_0x1051('0x59')]);return _0x2ecb97[_0x1051('0xba')](_0x1157d7);}})[_0x1051('0x10')](function(_0x37cc71){if(_0x37cc71){_0x504bc0=_0x37cc71[_0x1051('0x4f')];if(!_0xec5813[_0x1051('0x4a')][_0x1051('0x50')](_0x1051('0x51'))){_0x1157d7['limit']=qs[_0x1051('0x21')](_0xec5813[_0x1051('0x4a')][_0x1051('0x21')]);_0x1157d7[_0x1051('0x1e')]=qs[_0x1051('0x1e')](_0xec5813[_0x1051('0x4a')][_0x1051('0x1e')]);}return _0x2ecb97['getAgents'](_0x1157d7);}})[_0x1051('0x10')](function(_0x4ce257){if(_0x4ce257){return _0x4ce257?{'count':_0x504bc0,'rows':_0x4ce257}:null;}})[_0x1051('0x10')](respondWithResult(_0x258d7f,null))[_0x1051('0x1a')](handleError(_0x258d7f,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 3174f66..d8e6679 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 _0xe953=['exports','events','../../mysqldb','MailAccount','save','update','remove','hasOwnProperty'];(function(_0x4b570f,_0x1b2f2e){var _0x3f7990=function(_0x1c6c30){while(--_0x1c6c30){_0x4b570f['push'](_0x4b570f['shift']());}};_0x3f7990(++_0x1b2f2e);}(_0xe953,0xf9));var _0x3e95=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xe953[_0x16b9ed];return _0x66b1f8;};'use strict';var EventEmitter=require(_0x3e95('0x0'));var MailAccount=require(_0x3e95('0x1'))['db'][_0x3e95('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3e95('0x3'),'afterUpdate':_0x3e95('0x4'),'afterDestroy':_0x3e95('0x5')};function emitEvent(_0x30e34e){return function(_0x1f3cc7,_0x2a8222,_0x40b48b){MailAccountEvents['emit'](_0x30e34e+':'+_0x1f3cc7['id'],_0x1f3cc7);MailAccountEvents['emit'](_0x30e34e,_0x1f3cc7);_0x40b48b(null);};}for(var e in events){if(events[_0x3e95('0x6')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x3e95('0x7')]=MailAccountEvents; \ No newline at end of file +var _0xe861=['../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x30e228,_0x1dd9ba){var _0x27d19a=function(_0x31a41b){while(--_0x31a41b){_0x30e228['push'](_0x30e228['shift']());}};_0x27d19a(++_0x1dd9ba);}(_0xe861,0xb3));var _0x1e86=function(_0x116565,_0x5714af){_0x116565=_0x116565-0x0;var _0x583469=_0xe861[_0x116565];return _0x583469;};'use strict';var EventEmitter=require(_0x1e86('0x0'));var MailAccount=require(_0x1e86('0x1'))['db'][_0x1e86('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x1e86('0x3')](0x0);var events={'afterCreate':_0x1e86('0x4'),'afterUpdate':_0x1e86('0x5'),'afterDestroy':_0x1e86('0x6')};function emitEvent(_0x534eb7){return function(_0x3f9a95,_0x1f3588,_0x2609f4){MailAccountEvents[_0x1e86('0x7')](_0x534eb7+':'+_0x3f9a95['id'],_0x3f9a95);MailAccountEvents['emit'](_0x534eb7,_0x3f9a95);_0x2609f4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x1e86('0x8')](e,emitEvent(event));}}module[_0x1e86('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 1a33149..8670ceb 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 _0xef15=['pass','./mailAccount.attributes','exports','MailAccount','mail_accounts','custom','provider','host','port','Smtp','secure','authentication','modernAuthentication','auth','OAuth2','CloudProvider','data5'];(function(_0x3ba2a3,_0x34d0ba){var _0x2d0e38=function(_0x12ee87){while(--_0x12ee87){_0x3ba2a3['push'](_0x3ba2a3['shift']());}};_0x2d0e38(++_0x34d0ba);}(_0xef15,0x144));var _0x5ef1=function(_0x337a10,_0x5191c7){_0x337a10=_0x337a10-0x0;var _0x575f98=_0xef15[_0x337a10];return _0x575f98;};'use strict';var attributes=require(_0x5ef1('0x0'));module[_0x5ef1('0x1')]=function(_0x2a0d78){return _0x2a0d78['define'](_0x5ef1('0x2'),attributes,{'tableName':_0x5ef1('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x2a672d=this;var _0x1f9942={'id':_0x2a672d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2a672d['provider']!==_0x5ef1('0x4')){_0x1f9942['service']=_0x2a672d[_0x5ef1('0x5')];}else{_0x1f9942['host']=_0x2a672d['Smtp'][_0x5ef1('0x6')];_0x1f9942[_0x5ef1('0x7')]=_0x2a672d[_0x5ef1('0x8')][_0x5ef1('0x7')];_0x1f9942['secure']=_0x2a672d[_0x5ef1('0x8')][_0x5ef1('0x9')];}if(_0x2a672d[_0x5ef1('0x8')][_0x5ef1('0xa')]){if(_0x2a672d[_0x5ef1('0x8')][_0x5ef1('0xb')]){if(!_0x2a672d[_0x5ef1('0x8')]['CloudProvider'])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x1f9942[_0x5ef1('0xc')]={'type':_0x5ef1('0xd'),'user':_0x2a672d['Smtp']['user'],'accessToken':_0x2a672d[_0x5ef1('0x8')][_0x5ef1('0xe')][_0x5ef1('0xf')]};}else{_0x1f9942[_0x5ef1('0xc')]={'user':_0x2a672d[_0x5ef1('0x8')]['user'],'pass':_0x2a672d['Smtp'][_0x5ef1('0x10')]};}}return _0x1f9942;}}});}; \ No newline at end of file +var _0x2792=['./mailAccount.attributes','define','MailAccount','mail_accounts','provider','custom','service','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user','data5','pass'];(function(_0x1e6234,_0x912787){var _0x54090d=function(_0x578d17){while(--_0x578d17){_0x1e6234['push'](_0x1e6234['shift']());}};_0x54090d(++_0x912787);}(_0x2792,0x169));var _0x2279=function(_0x403fc7,_0x32931a){_0x403fc7=_0x403fc7-0x0;var _0x5d0827=_0x2792[_0x403fc7];return _0x5d0827;};'use strict';var attributes=require(_0x2279('0x0'));module['exports']=function(_0x2e9a9b){return _0x2e9a9b[_0x2279('0x1')](_0x2279('0x2'),attributes,{'tableName':_0x2279('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x260805=this;var _0x295f6a={'id':_0x260805['id'],'tls':{'rejectUnauthorized':![]}};if(_0x260805[_0x2279('0x4')]!==_0x2279('0x5')){_0x295f6a[_0x2279('0x6')]=_0x260805[_0x2279('0x4')];}else{_0x295f6a[_0x2279('0x7')]=_0x260805[_0x2279('0x8')]['host'];_0x295f6a[_0x2279('0x9')]=_0x260805[_0x2279('0x8')][_0x2279('0x9')];_0x295f6a[_0x2279('0xa')]=_0x260805['Smtp'][_0x2279('0xa')];}if(_0x260805['Smtp'][_0x2279('0xb')]){if(_0x260805[_0x2279('0x8')][_0x2279('0xc')]){if(!_0x260805[_0x2279('0x8')][_0x2279('0xd')])throw new Error(_0x2279('0xe'));_0x295f6a['auth']={'type':_0x2279('0xf'),'user':_0x260805[_0x2279('0x8')][_0x2279('0x10')],'accessToken':_0x260805[_0x2279('0x8')][_0x2279('0xd')][_0x2279('0x11')]};}else{_0x295f6a['auth']={'user':_0x260805[_0x2279('0x8')][_0x2279('0x10')],'pass':_0x260805[_0x2279('0x8')][_0x2279('0x12')]};}}return _0x295f6a;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 0fac679..cacc0a7 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 _0xe2fe=['list','List','priority','asc','autoclose','push','length','close','Contacts','defaults','ListId','CmContact','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','Contact\x20not\x20found','spread','interaction','MailMessage','originCc','Attachments','UserId','User','name','unshift','agent','*,*,*,*','Start','startRouting','lodash','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','register','info','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','GetMailAccount','MailAccount','findAll','options','where','attributes','limit','include','map','model','then','debug','catch','ShowMailAccount','raw','smtp','smtpOptions','getSmtpOptions','body','mail','keys','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Smtp','CloudProvider','get','omit','Applications','applications'];(function(_0x5c8160,_0x5eaa44){var _0x540036=function(_0x4ee4d3){while(--_0x4ee4d3){_0x5c8160['push'](_0x5c8160['shift']());}};_0x540036(++_0x5eaa44);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xee2f('0x1'));var Redis=require('ioredis');var db=require(_0xee2f('0x2'))['db'];var logger=require(_0xee2f('0x3'))(_0xee2f('0x4'));var config=require(_0xee2f('0x5'));var jayson=require(_0xee2f('0x6'));var client=jayson['client'][_0xee2f('0x7')]({'port':0x232c});config[_0xee2f('0x8')]=_['defaults'](config[_0xee2f('0x8')],{'host':_0xee2f('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xee2f('0x8')]));require('./mailAccount.socket')[_0xee2f('0xa')](socket);function respondWithRpcPromise(_0x36920f,_0x53f7dd,_0x3a49bb){return new BPromise(function(_0x43f451,_0x4bf3c3){return client['request'](_0x36920f,_0x3a49bb)['then'](function(_0x56bbea){logger[_0xee2f('0xb')]('MailAccount,\x20%s,\x20%s',_0x53f7dd,'request\x20sent');logger['debug'](_0xee2f('0xc'),_0x53f7dd,_0xee2f('0xd'),JSON[_0xee2f('0xe')](_0x56bbea));if(_0x56bbea[_0xee2f('0xf')]){if(_0x56bbea[_0xee2f('0xf')][_0xee2f('0x10')]===0x1f4){logger['error'](_0xee2f('0x11'),_0x53f7dd,_0x56bbea['error'][_0xee2f('0x12')]);return _0x4bf3c3(_0x56bbea[_0xee2f('0xf')]['message']);}logger[_0xee2f('0xf')](_0xee2f('0x11'),_0x53f7dd,_0x56bbea[_0xee2f('0xf')][_0xee2f('0x12')]);return _0x43f451(_0x56bbea[_0xee2f('0xf')]['message']);}else{logger[_0xee2f('0xb')]('MailAccount,\x20%s,\x20%s',_0x53f7dd,_0xee2f('0xd'));_0x43f451(_0x56bbea[_0xee2f('0x13')]['message']);}})['catch'](function(_0x40b5bc){logger['error'](_0xee2f('0x11'),_0x53f7dd,_0x40b5bc);_0x4bf3c3(_0x40b5bc);});});}exports[_0xee2f('0x14')]=function(_0x28549d){var _0x5b83b5=this;return new Promise(function(_0x35e1a4,_0x1e70aa){return db[_0xee2f('0x15')][_0xee2f('0x16')]({'raw':_0x28549d[_0xee2f('0x17')]?_0x28549d['options']['raw']===undefined?!![]:![]:!![],'where':_0x28549d[_0xee2f('0x17')]?_0x28549d[_0xee2f('0x17')][_0xee2f('0x18')]||null:null,'attributes':_0x28549d[_0xee2f('0x17')]?_0x28549d[_0xee2f('0x17')][_0xee2f('0x19')]||null:null,'limit':_0x28549d[_0xee2f('0x17')]?_0x28549d['options'][_0xee2f('0x1a')]||null:null,'include':_0x28549d[_0xee2f('0x17')]?_0x28549d[_0xee2f('0x17')][_0xee2f('0x1b')]?_[_0xee2f('0x1c')](_0x28549d[_0xee2f('0x17')][_0xee2f('0x1b')],function(_0x13013f){return{'model':db[_0x13013f[_0xee2f('0x1d')]],'as':_0x13013f['as'],'attributes':_0x13013f[_0xee2f('0x19')],'include':_0x13013f[_0xee2f('0x1b')]?_[_0xee2f('0x1c')](_0x13013f[_0xee2f('0x1b')],function(_0x45c4a0){return{'model':db[_0x45c4a0['model']],'as':_0x45c4a0['as'],'attributes':_0x45c4a0['attributes'],'include':_0x45c4a0['include']?_[_0xee2f('0x1c')](_0x45c4a0[_0xee2f('0x1b')],function(_0x2cb0cb){return{'model':db[_0x2cb0cb[_0xee2f('0x1d')]],'as':_0x2cb0cb['as'],'attributes':_0x2cb0cb[_0xee2f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xee2f('0x1e')](function(_0x4d8398){logger[_0xee2f('0xb')]('GetMailAccount',_0x28549d);logger[_0xee2f('0x1f')](_0xee2f('0x14'),_0x28549d,JSON[_0xee2f('0xe')](_0x4d8398));_0x35e1a4(_0x4d8398);})[_0xee2f('0x20')](function(_0x3ddbe3){logger['error'](_0xee2f('0x14'),_0x3ddbe3[_0xee2f('0x12')],_0x28549d);_0x1e70aa(_0x5b83b5['error'](0x1f4,_0x3ddbe3['message']));});});};exports[_0xee2f('0x21')]=function(_0x574899){var _0x33c426=this;return new Promise(function(_0xc447e,_0x53d9b7){return db[_0xee2f('0x15')]['find']({'raw':_0x574899['options']?_0x574899['options'][_0xee2f('0x22')]===undefined?!![]:![]:!![],'where':_0x574899[_0xee2f('0x17')]?_0x574899['options'][_0xee2f('0x18')]||null:null,'attributes':_0x574899[_0xee2f('0x17')]?_0x574899[_0xee2f('0x17')][_0xee2f('0x19')]||null:null,'include':_0x574899[_0xee2f('0x17')]?_0x574899['options'][_0xee2f('0x1b')]?_['map'](_0x574899[_0xee2f('0x17')][_0xee2f('0x1b')],function(_0x3dcb9e){return{'model':db[_0x3dcb9e['model']],'as':_0x3dcb9e['as'],'attributes':_0x3dcb9e[_0xee2f('0x19')],'include':_0x3dcb9e['include']?_[_0xee2f('0x1c')](_0x3dcb9e['include'],function(_0x3e6dcc){return{'model':db[_0x3e6dcc[_0xee2f('0x1d')]],'as':_0x3e6dcc['as'],'attributes':_0x3e6dcc[_0xee2f('0x19')],'include':_0x3e6dcc[_0xee2f('0x1b')]?_[_0xee2f('0x1c')](_0x3e6dcc[_0xee2f('0x1b')],function(_0x24380b){return{'model':db[_0x24380b[_0xee2f('0x1d')]],'as':_0x24380b['as'],'attributes':_0x24380b[_0xee2f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xee2f('0x1e')](function(_0x433547){if(_0x574899['options'][_0xee2f('0x23')]===!![])_0x433547['setDataValue'](_0xee2f('0x24'),_0x433547[_0xee2f('0x25')]());logger[_0xee2f('0xb')](_0xee2f('0x21'),_0x574899);logger[_0xee2f('0x1f')](_0xee2f('0x21'),_0x574899,JSON[_0xee2f('0xe')](_0x433547));_0xc447e(_0x433547);})[_0xee2f('0x20')](function(_0x50ddd2){logger['error']('ShowMailAccount',_0x50ddd2[_0xee2f('0x12')],_0x574899);_0x53d9b7(_0x33c426['error'](0x1f4,_0x50ddd2[_0xee2f('0x12')]));});});};exports['NotifyMailAccount']=function(_0x558aa3){var _0x5027a6=this;return new Promise(function(_0x58e361,_0x430ac1){var _0x692686={'body':_0x558aa3[_0xee2f('0x26')],'channel':_0xee2f('0x27')};var _0x4823a7=_['difference'](_[_0xee2f('0x28')](db['CmContact']['rawAttributes']),[_0xee2f('0x29'),_0xee2f('0x2a'),_0xee2f('0x2b'),'ListId']);var _0x3bc173=![];if(_0x558aa3[_0xee2f('0x26')]['id']){delete _0x558aa3[_0xee2f('0x26')]['id'];}if(_['isNil'](_0x558aa3['body'][_0xee2f('0x2c')])){return _0x430ac1(_0x5027a6[_0xee2f('0xf')](0x1f4,_0xee2f('0x2d')));}if(_[_0xee2f('0x2e')](_0x558aa3['body'][_0xee2f('0x26')])||_0x558aa3[_0xee2f('0x26')][_0xee2f('0x26')]===''){return _0x430ac1(_0x5027a6[_0xee2f('0xf')](0x1f4,_0xee2f('0x2f')));}if(_[_0xee2f('0x2e')](_0x558aa3[_0xee2f('0x26')][_0xee2f('0x30')])){return _0x430ac1(_0x5027a6[_0xee2f('0xf')](0x1f4,_0xee2f('0x31')+_0x4823a7));}if(!_['includes'](_0x4823a7,_0x558aa3['body']['mapKey'])){return _0x430ac1(_0x5027a6['error'](0x1f4,_0xee2f('0x32')+_0x4823a7));}var _0x3e0d7b={};_0x3e0d7b[_0x558aa3[_0xee2f('0x26')][_0xee2f('0x30')]]=_0x558aa3[_0xee2f('0x26')]['from'];return db[_0xee2f('0x15')][_0xee2f('0x33')]({'where':{'id':_0x558aa3[_0xee2f('0x34')]['id']},'include':[{'model':db[_0xee2f('0x35')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x3e0d7b,'limit':0x1,'order':[[_0xee2f('0x2a'),'DESC']]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db['MailServerOut'],'as':_0xee2f('0x36'),'include':[{'model':db[_0xee2f('0x37')],'as':_0xee2f('0x37')}]}]})['then'](function(_0x22506e){if(_0x22506e&&_0x22506e['List']){var _0x3d95b8=_0x22506e[_0xee2f('0x38')]({'plain':!![]});_0x692686[_0xee2f('0x34')]=_[_0xee2f('0x39')](_0x3d95b8,[_0xee2f('0x3a'),'List']);_0x692686['account'][_0xee2f('0x24')]=_0x22506e['getSmtpOptions']();_0x692686[_0xee2f('0x3b')]=_0x3d95b8[_0xee2f('0x3a')];_0x692686[_0xee2f('0x3c')]=_0x3d95b8[_0xee2f('0x3d')];_0x692686['applications']=_['orderBy'](_0x692686[_0xee2f('0x3b')],[_0xee2f('0x3e')],[_0xee2f('0x3f')]);if(_0x692686[_0xee2f('0x34')]&&_0x692686[_0xee2f('0x34')][_0xee2f('0x40')]){_0x692686[_0xee2f('0x3b')][_0xee2f('0x41')]({'id':0x0,'priority':_0x692686[_0xee2f('0x3b')][_0xee2f('0x42')]+0x1,'app':_0xee2f('0x43'),'appdata':_0xee2f('0x40'),'interval':'*,*,*,*'});}if(_0x692686[_0xee2f('0x34')][_0xee2f('0x3a')]){delete _0x692686[_0xee2f('0x34')][_0xee2f('0x3a')];}if(_0x692686['account'][_0xee2f('0x3d')]){delete _0x692686[_0xee2f('0x34')][_0xee2f('0x3d')];}if(_0x3d95b8[_0xee2f('0x3d')][_0xee2f('0x44')]['length']){return _0x3d95b8[_0xee2f('0x3d')]['Contacts'][0x0];}var _0x4db455=_[_0xee2f('0x45')](_0x558aa3[_0xee2f('0x26')],{'firstName':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x2c')],'ListId':_0x3d95b8[_0xee2f('0x46')]});_0x4db455[_0x558aa3[_0xee2f('0x26')][_0xee2f('0x30')]]=_0x558aa3['body'][_0xee2f('0x2c')];return db[_0xee2f('0x47')][_0xee2f('0x48')](_0x4db455);}else{throw new Error(_0xee2f('0x49'));}})[_0xee2f('0x1e')](function(_0x3e1184){_0x692686[_0xee2f('0x4a')]=_0x3e1184;if(_0x3e1184){if(!_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['messageId']){_0x558aa3[_0xee2f('0x26')]['message'][_0xee2f('0x4b')]=rs[_0xee2f('0x4c')]()+'\x20'+_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x2c')];}var _0x5ee444={'ContactId':_0x3e1184['id'],'MailAccountId':_0x558aa3[_0xee2f('0x34')]['id'],'inReplyTo':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4b')],'to':_0x558aa3['body']['message']['from'],'cc':_0x558aa3['body']['message']['cc'],'subject':_0x558aa3[_0xee2f('0x26')]['message'][_0xee2f('0x4d')],'attach':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4e')],'lastMsgAt':moment()[_0xee2f('0x4f')](_0xee2f('0x50')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x558aa3[_0xee2f('0x34')]['id']},'include':[{'model':db['MailMessage'],'as':_0xee2f('0x51'),'attributes':['messageId'],'where':{'messageId':_0x558aa3[_0xee2f('0x26')]['message'][_0xee2f('0x52')]}}]})[_0xee2f('0x1e')](function(_0x2f419c){if(_0x2f419c){return[_0x2f419c,![]];}return db['MailInteraction'][_0xee2f('0x48')](_0x5ee444)[_0xee2f('0x1e')](function(_0x3bdfc5){return[_0x3bdfc5,!![]];});});}else{throw new Error(_0xee2f('0x53'));}})[_0xee2f('0x54')](function(_0x486146,_0xf0c721){if(_0x486146){_0x3bc173=_0xf0c721;if(!_0xf0c721){return _0x486146['update']({'inReplyTo':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4b')],'to':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x2c')],'cc':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['cc'],'subject':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4d')],'attach':_0x486146['attach']?_0x486146[_0xee2f('0x4e')]:_0x558aa3[_0xee2f('0x26')]['message'][_0xee2f('0x4e')],'substatus':null,'substatusAt':moment()['format'](_0xee2f('0x50')),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x486146;}}})[_0xee2f('0x1e')](function(_0x46ecac){_0x692686[_0xee2f('0x55')]=_0x46ecac[_0xee2f('0x38')]({'plain':!![]});_0x692686[_0xee2f('0x55')]['created']=_0x3bc173;return db[_0xee2f('0x56')][_0xee2f('0x48')]({'body':_0x558aa3[_0xee2f('0x26')]['body'],'MailAccountId':_0x558aa3[_0xee2f('0x34')]['id'],'MailInteractionId':_0x46ecac['id'],'direction':'in','ContactId':_0x692686[_0xee2f('0x4a')]['id'],'messageId':_0x558aa3['body'][_0xee2f('0x12')][_0xee2f('0x4b')],'from':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x2c')],'to':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['to'],'cc':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['cc'],'subject':_0x558aa3['body']['message']['subject'],'attach':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4e')],'Attachments':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['attachments'],'originTo':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['originTo'],'originCc':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x57')],'bcc':_0x558aa3['body'][_0xee2f('0x12')]['bcc'],'ChatWebsiteId':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['ChatWebsiteId']||null,'originChannel':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['originChannel']||'Email','ChatOfflineMessageId':_0x558aa3['body'][_0xee2f('0x12')]['ChatOfflineMessageId']||null},{'include':[{'model':db['Attachment'],'as':_0xee2f('0x58')}]});})[_0xee2f('0x1e')](function(_0x50a972){_0x692686[_0xee2f('0x12')]=_0x50a972;if(_0x692686['interaction'][_0xee2f('0x59')]){return db[_0xee2f('0x5a')][_0xee2f('0x33')]({'attributes':['id',_0xee2f('0x5b')],'where':{'id':_0x692686[_0xee2f('0x55')][_0xee2f('0x59')]}})[_0xee2f('0x1e')](function(_0x58da0d){if(_0x58da0d){_0x692686[_0xee2f('0x3b')][_0xee2f('0x5c')]({'id':0x0,'priority':0x0,'app':_0xee2f('0x5d'),'appdata':_0x58da0d[_0xee2f('0x5b')]+','+(_0x692686[_0xee2f('0x34')]['waitForTheAssignedAgent']||0xa),'interval':_0xee2f('0x5e')});}return respondWithRpcPromise(_0xee2f('0x5f'),_0xee2f('0x60'),_0x692686);});}return respondWithRpcPromise(_0xee2f('0x5f'),_0xee2f('0x60'),_0x692686);})[_0xee2f('0x1e')](function(_0x4c3b2f){_0x58e361(_0x4c3b2f);})['catch'](function(_0x4051a7){_0x430ac1(_0x5027a6[_0xee2f('0xf')](0x1f4,_0x4051a7[_0xee2f('0x12')]));});});}; \ No newline at end of file +var _0xe2fe=['list','List','priority','asc','autoclose','push','length','close','Contacts','defaults','ListId','CmContact','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','Contact\x20not\x20found','spread','interaction','MailMessage','originCc','Attachments','UserId','User','name','unshift','agent','*,*,*,*','Start','startRouting','lodash','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','register','info','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','GetMailAccount','MailAccount','findAll','options','where','attributes','limit','include','map','model','then','debug','catch','ShowMailAccount','raw','smtp','smtpOptions','getSmtpOptions','body','mail','keys','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Smtp','CloudProvider','get','omit','Applications','applications'];(function(_0x403ccf,_0x51f168){var _0x1651f6=function(_0x14225c){while(--_0x14225c){_0x403ccf['push'](_0x403ccf['shift']());}};_0x1651f6(++_0x51f168);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xee2f('0x1'));var Redis=require('ioredis');var db=require(_0xee2f('0x2'))['db'];var logger=require(_0xee2f('0x3'))(_0xee2f('0x4'));var config=require(_0xee2f('0x5'));var jayson=require(_0xee2f('0x6'));var client=jayson['client'][_0xee2f('0x7')]({'port':0x232c});config[_0xee2f('0x8')]=_['defaults'](config[_0xee2f('0x8')],{'host':_0xee2f('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xee2f('0x8')]));require('./mailAccount.socket')[_0xee2f('0xa')](socket);function respondWithRpcPromise(_0x36920f,_0x53f7dd,_0x3a49bb){return new BPromise(function(_0x43f451,_0x4bf3c3){return client['request'](_0x36920f,_0x3a49bb)['then'](function(_0x56bbea){logger[_0xee2f('0xb')]('MailAccount,\x20%s,\x20%s',_0x53f7dd,'request\x20sent');logger['debug'](_0xee2f('0xc'),_0x53f7dd,_0xee2f('0xd'),JSON[_0xee2f('0xe')](_0x56bbea));if(_0x56bbea[_0xee2f('0xf')]){if(_0x56bbea[_0xee2f('0xf')][_0xee2f('0x10')]===0x1f4){logger['error'](_0xee2f('0x11'),_0x53f7dd,_0x56bbea['error'][_0xee2f('0x12')]);return _0x4bf3c3(_0x56bbea[_0xee2f('0xf')]['message']);}logger[_0xee2f('0xf')](_0xee2f('0x11'),_0x53f7dd,_0x56bbea[_0xee2f('0xf')][_0xee2f('0x12')]);return _0x43f451(_0x56bbea[_0xee2f('0xf')]['message']);}else{logger[_0xee2f('0xb')]('MailAccount,\x20%s,\x20%s',_0x53f7dd,_0xee2f('0xd'));_0x43f451(_0x56bbea[_0xee2f('0x13')]['message']);}})['catch'](function(_0x40b5bc){logger['error'](_0xee2f('0x11'),_0x53f7dd,_0x40b5bc);_0x4bf3c3(_0x40b5bc);});});}exports[_0xee2f('0x14')]=function(_0x28549d){var _0x5b83b5=this;return new Promise(function(_0x35e1a4,_0x1e70aa){return db[_0xee2f('0x15')][_0xee2f('0x16')]({'raw':_0x28549d[_0xee2f('0x17')]?_0x28549d['options']['raw']===undefined?!![]:![]:!![],'where':_0x28549d[_0xee2f('0x17')]?_0x28549d[_0xee2f('0x17')][_0xee2f('0x18')]||null:null,'attributes':_0x28549d[_0xee2f('0x17')]?_0x28549d[_0xee2f('0x17')][_0xee2f('0x19')]||null:null,'limit':_0x28549d[_0xee2f('0x17')]?_0x28549d['options'][_0xee2f('0x1a')]||null:null,'include':_0x28549d[_0xee2f('0x17')]?_0x28549d[_0xee2f('0x17')][_0xee2f('0x1b')]?_[_0xee2f('0x1c')](_0x28549d[_0xee2f('0x17')][_0xee2f('0x1b')],function(_0x13013f){return{'model':db[_0x13013f[_0xee2f('0x1d')]],'as':_0x13013f['as'],'attributes':_0x13013f[_0xee2f('0x19')],'include':_0x13013f[_0xee2f('0x1b')]?_[_0xee2f('0x1c')](_0x13013f[_0xee2f('0x1b')],function(_0x45c4a0){return{'model':db[_0x45c4a0['model']],'as':_0x45c4a0['as'],'attributes':_0x45c4a0['attributes'],'include':_0x45c4a0['include']?_[_0xee2f('0x1c')](_0x45c4a0[_0xee2f('0x1b')],function(_0x2cb0cb){return{'model':db[_0x2cb0cb[_0xee2f('0x1d')]],'as':_0x2cb0cb['as'],'attributes':_0x2cb0cb[_0xee2f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xee2f('0x1e')](function(_0x4d8398){logger[_0xee2f('0xb')]('GetMailAccount',_0x28549d);logger[_0xee2f('0x1f')](_0xee2f('0x14'),_0x28549d,JSON[_0xee2f('0xe')](_0x4d8398));_0x35e1a4(_0x4d8398);})[_0xee2f('0x20')](function(_0x3ddbe3){logger['error'](_0xee2f('0x14'),_0x3ddbe3[_0xee2f('0x12')],_0x28549d);_0x1e70aa(_0x5b83b5['error'](0x1f4,_0x3ddbe3['message']));});});};exports[_0xee2f('0x21')]=function(_0x574899){var _0x33c426=this;return new Promise(function(_0xc447e,_0x53d9b7){return db[_0xee2f('0x15')]['find']({'raw':_0x574899['options']?_0x574899['options'][_0xee2f('0x22')]===undefined?!![]:![]:!![],'where':_0x574899[_0xee2f('0x17')]?_0x574899['options'][_0xee2f('0x18')]||null:null,'attributes':_0x574899[_0xee2f('0x17')]?_0x574899[_0xee2f('0x17')][_0xee2f('0x19')]||null:null,'include':_0x574899[_0xee2f('0x17')]?_0x574899['options'][_0xee2f('0x1b')]?_['map'](_0x574899[_0xee2f('0x17')][_0xee2f('0x1b')],function(_0x3dcb9e){return{'model':db[_0x3dcb9e['model']],'as':_0x3dcb9e['as'],'attributes':_0x3dcb9e[_0xee2f('0x19')],'include':_0x3dcb9e['include']?_[_0xee2f('0x1c')](_0x3dcb9e['include'],function(_0x3e6dcc){return{'model':db[_0x3e6dcc[_0xee2f('0x1d')]],'as':_0x3e6dcc['as'],'attributes':_0x3e6dcc[_0xee2f('0x19')],'include':_0x3e6dcc[_0xee2f('0x1b')]?_[_0xee2f('0x1c')](_0x3e6dcc[_0xee2f('0x1b')],function(_0x24380b){return{'model':db[_0x24380b[_0xee2f('0x1d')]],'as':_0x24380b['as'],'attributes':_0x24380b[_0xee2f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xee2f('0x1e')](function(_0x433547){if(_0x574899['options'][_0xee2f('0x23')]===!![])_0x433547['setDataValue'](_0xee2f('0x24'),_0x433547[_0xee2f('0x25')]());logger[_0xee2f('0xb')](_0xee2f('0x21'),_0x574899);logger[_0xee2f('0x1f')](_0xee2f('0x21'),_0x574899,JSON[_0xee2f('0xe')](_0x433547));_0xc447e(_0x433547);})[_0xee2f('0x20')](function(_0x50ddd2){logger['error']('ShowMailAccount',_0x50ddd2[_0xee2f('0x12')],_0x574899);_0x53d9b7(_0x33c426['error'](0x1f4,_0x50ddd2[_0xee2f('0x12')]));});});};exports['NotifyMailAccount']=function(_0x558aa3){var _0x5027a6=this;return new Promise(function(_0x58e361,_0x430ac1){var _0x692686={'body':_0x558aa3[_0xee2f('0x26')],'channel':_0xee2f('0x27')};var _0x4823a7=_['difference'](_[_0xee2f('0x28')](db['CmContact']['rawAttributes']),[_0xee2f('0x29'),_0xee2f('0x2a'),_0xee2f('0x2b'),'ListId']);var _0x3bc173=![];if(_0x558aa3[_0xee2f('0x26')]['id']){delete _0x558aa3[_0xee2f('0x26')]['id'];}if(_['isNil'](_0x558aa3['body'][_0xee2f('0x2c')])){return _0x430ac1(_0x5027a6[_0xee2f('0xf')](0x1f4,_0xee2f('0x2d')));}if(_[_0xee2f('0x2e')](_0x558aa3['body'][_0xee2f('0x26')])||_0x558aa3[_0xee2f('0x26')][_0xee2f('0x26')]===''){return _0x430ac1(_0x5027a6[_0xee2f('0xf')](0x1f4,_0xee2f('0x2f')));}if(_[_0xee2f('0x2e')](_0x558aa3[_0xee2f('0x26')][_0xee2f('0x30')])){return _0x430ac1(_0x5027a6[_0xee2f('0xf')](0x1f4,_0xee2f('0x31')+_0x4823a7));}if(!_['includes'](_0x4823a7,_0x558aa3['body']['mapKey'])){return _0x430ac1(_0x5027a6['error'](0x1f4,_0xee2f('0x32')+_0x4823a7));}var _0x3e0d7b={};_0x3e0d7b[_0x558aa3[_0xee2f('0x26')][_0xee2f('0x30')]]=_0x558aa3[_0xee2f('0x26')]['from'];return db[_0xee2f('0x15')][_0xee2f('0x33')]({'where':{'id':_0x558aa3[_0xee2f('0x34')]['id']},'include':[{'model':db[_0xee2f('0x35')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x3e0d7b,'limit':0x1,'order':[[_0xee2f('0x2a'),'DESC']]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db['MailServerOut'],'as':_0xee2f('0x36'),'include':[{'model':db[_0xee2f('0x37')],'as':_0xee2f('0x37')}]}]})['then'](function(_0x22506e){if(_0x22506e&&_0x22506e['List']){var _0x3d95b8=_0x22506e[_0xee2f('0x38')]({'plain':!![]});_0x692686[_0xee2f('0x34')]=_[_0xee2f('0x39')](_0x3d95b8,[_0xee2f('0x3a'),'List']);_0x692686['account'][_0xee2f('0x24')]=_0x22506e['getSmtpOptions']();_0x692686[_0xee2f('0x3b')]=_0x3d95b8[_0xee2f('0x3a')];_0x692686[_0xee2f('0x3c')]=_0x3d95b8[_0xee2f('0x3d')];_0x692686['applications']=_['orderBy'](_0x692686[_0xee2f('0x3b')],[_0xee2f('0x3e')],[_0xee2f('0x3f')]);if(_0x692686[_0xee2f('0x34')]&&_0x692686[_0xee2f('0x34')][_0xee2f('0x40')]){_0x692686[_0xee2f('0x3b')][_0xee2f('0x41')]({'id':0x0,'priority':_0x692686[_0xee2f('0x3b')][_0xee2f('0x42')]+0x1,'app':_0xee2f('0x43'),'appdata':_0xee2f('0x40'),'interval':'*,*,*,*'});}if(_0x692686[_0xee2f('0x34')][_0xee2f('0x3a')]){delete _0x692686[_0xee2f('0x34')][_0xee2f('0x3a')];}if(_0x692686['account'][_0xee2f('0x3d')]){delete _0x692686[_0xee2f('0x34')][_0xee2f('0x3d')];}if(_0x3d95b8[_0xee2f('0x3d')][_0xee2f('0x44')]['length']){return _0x3d95b8[_0xee2f('0x3d')]['Contacts'][0x0];}var _0x4db455=_[_0xee2f('0x45')](_0x558aa3[_0xee2f('0x26')],{'firstName':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x2c')],'ListId':_0x3d95b8[_0xee2f('0x46')]});_0x4db455[_0x558aa3[_0xee2f('0x26')][_0xee2f('0x30')]]=_0x558aa3['body'][_0xee2f('0x2c')];return db[_0xee2f('0x47')][_0xee2f('0x48')](_0x4db455);}else{throw new Error(_0xee2f('0x49'));}})[_0xee2f('0x1e')](function(_0x3e1184){_0x692686[_0xee2f('0x4a')]=_0x3e1184;if(_0x3e1184){if(!_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['messageId']){_0x558aa3[_0xee2f('0x26')]['message'][_0xee2f('0x4b')]=rs[_0xee2f('0x4c')]()+'\x20'+_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x2c')];}var _0x5ee444={'ContactId':_0x3e1184['id'],'MailAccountId':_0x558aa3[_0xee2f('0x34')]['id'],'inReplyTo':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4b')],'to':_0x558aa3['body']['message']['from'],'cc':_0x558aa3['body']['message']['cc'],'subject':_0x558aa3[_0xee2f('0x26')]['message'][_0xee2f('0x4d')],'attach':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4e')],'lastMsgAt':moment()[_0xee2f('0x4f')](_0xee2f('0x50')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x558aa3[_0xee2f('0x34')]['id']},'include':[{'model':db['MailMessage'],'as':_0xee2f('0x51'),'attributes':['messageId'],'where':{'messageId':_0x558aa3[_0xee2f('0x26')]['message'][_0xee2f('0x52')]}}]})[_0xee2f('0x1e')](function(_0x2f419c){if(_0x2f419c){return[_0x2f419c,![]];}return db['MailInteraction'][_0xee2f('0x48')](_0x5ee444)[_0xee2f('0x1e')](function(_0x3bdfc5){return[_0x3bdfc5,!![]];});});}else{throw new Error(_0xee2f('0x53'));}})[_0xee2f('0x54')](function(_0x486146,_0xf0c721){if(_0x486146){_0x3bc173=_0xf0c721;if(!_0xf0c721){return _0x486146['update']({'inReplyTo':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4b')],'to':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x2c')],'cc':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['cc'],'subject':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4d')],'attach':_0x486146['attach']?_0x486146[_0xee2f('0x4e')]:_0x558aa3[_0xee2f('0x26')]['message'][_0xee2f('0x4e')],'substatus':null,'substatusAt':moment()['format'](_0xee2f('0x50')),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x486146;}}})[_0xee2f('0x1e')](function(_0x46ecac){_0x692686[_0xee2f('0x55')]=_0x46ecac[_0xee2f('0x38')]({'plain':!![]});_0x692686[_0xee2f('0x55')]['created']=_0x3bc173;return db[_0xee2f('0x56')][_0xee2f('0x48')]({'body':_0x558aa3[_0xee2f('0x26')]['body'],'MailAccountId':_0x558aa3[_0xee2f('0x34')]['id'],'MailInteractionId':_0x46ecac['id'],'direction':'in','ContactId':_0x692686[_0xee2f('0x4a')]['id'],'messageId':_0x558aa3['body'][_0xee2f('0x12')][_0xee2f('0x4b')],'from':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x2c')],'to':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['to'],'cc':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['cc'],'subject':_0x558aa3['body']['message']['subject'],'attach':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x4e')],'Attachments':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['attachments'],'originTo':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['originTo'],'originCc':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')][_0xee2f('0x57')],'bcc':_0x558aa3['body'][_0xee2f('0x12')]['bcc'],'ChatWebsiteId':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['ChatWebsiteId']||null,'originChannel':_0x558aa3[_0xee2f('0x26')][_0xee2f('0x12')]['originChannel']||'Email','ChatOfflineMessageId':_0x558aa3['body'][_0xee2f('0x12')]['ChatOfflineMessageId']||null},{'include':[{'model':db['Attachment'],'as':_0xee2f('0x58')}]});})[_0xee2f('0x1e')](function(_0x50a972){_0x692686[_0xee2f('0x12')]=_0x50a972;if(_0x692686['interaction'][_0xee2f('0x59')]){return db[_0xee2f('0x5a')][_0xee2f('0x33')]({'attributes':['id',_0xee2f('0x5b')],'where':{'id':_0x692686[_0xee2f('0x55')][_0xee2f('0x59')]}})[_0xee2f('0x1e')](function(_0x58da0d){if(_0x58da0d){_0x692686[_0xee2f('0x3b')][_0xee2f('0x5c')]({'id':0x0,'priority':0x0,'app':_0xee2f('0x5d'),'appdata':_0x58da0d[_0xee2f('0x5b')]+','+(_0x692686[_0xee2f('0x34')]['waitForTheAssignedAgent']||0xa),'interval':_0xee2f('0x5e')});}return respondWithRpcPromise(_0xee2f('0x5f'),_0xee2f('0x60'),_0x692686);});}return respondWithRpcPromise(_0xee2f('0x5f'),_0xee2f('0x60'),_0x692686);})[_0xee2f('0x1e')](function(_0x4c3b2f){_0x58e361(_0x4c3b2f);})['catch'](function(_0x4051a7){_0x430ac1(_0x5027a6[_0xee2f('0xf')](0x1f4,_0x4051a7[_0xee2f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 548ab5f..2fc0a3e 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 _0x245b=['./mailAccount.events','save','update','emit','removeListener','length','mailAccount:'];(function(_0xe2c665,_0x5467a0){var _0x5bcbb7=function(_0x4002dc){while(--_0x4002dc){_0xe2c665['push'](_0xe2c665['shift']());}};_0x5bcbb7(++_0x5467a0);}(_0x245b,0xa8));var _0xb245=function(_0x5dc878,_0xa0e60c){_0x5dc878=_0x5dc878-0x0;var _0x1e7819=_0x245b[_0x5dc878];return _0x1e7819;};'use strict';var MailAccountEvents=require(_0xb245('0x0'));var events=[_0xb245('0x1'),'remove',_0xb245('0x2')];function createListener(_0xf472b3,_0x3baf8c){return function(_0x15aabc){_0x3baf8c[_0xb245('0x3')](_0xf472b3,_0x15aabc);};}function removeListener(_0x5b2e43,_0x3cf8a5){return function(){MailAccountEvents[_0xb245('0x4')](_0x5b2e43,_0x3cf8a5);};}exports['register']=function(_0x3ab098){for(var _0x3817ec=0x0,_0x1a84f1=events[_0xb245('0x5')];_0x3817ec<_0x1a84f1;_0x3817ec++){var _0x4b3e17=events[_0x3817ec];var _0x13c5b2=createListener(_0xb245('0x6')+_0x4b3e17,_0x3ab098);MailAccountEvents['on'](_0x4b3e17,_0x13c5b2);}}; \ No newline at end of file +var _0x4cf5=['length','./mailAccount.events','save','remove','update','emit','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4cf5,0x12e));var _0x54cf=function(_0x50f284,_0x39fe33){_0x50f284=_0x50f284-0x0;var _0x2d718e=_0x4cf5[_0x50f284];return _0x2d718e;};'use strict';var MailAccountEvents=require(_0x54cf('0x0'));var events=[_0x54cf('0x1'),_0x54cf('0x2'),_0x54cf('0x3')];function createListener(_0x3fafa7,_0x49d774){return function(_0x486c85){_0x49d774[_0x54cf('0x4')](_0x3fafa7,_0x486c85);};}function removeListener(_0x3c89db,_0x3b4c12){return function(){MailAccountEvents['removeListener'](_0x3c89db,_0x3b4c12);};}exports[_0x54cf('0x5')]=function(_0x4c7639){for(var _0x98c00b=0x0,_0x4308fb=events[_0x54cf('0x6')];_0x98c00b<_0x4308fb;_0x98c00b++){var _0x3342d9=events[_0x98c00b];var _0x446671=createListener('mailAccount:'+_0x3342d9,_0x4c7639);MailAccountEvents['on'](_0x3342d9,_0x446671);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 879a54e..8020d49 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 _0x4664=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','isAuthenticated','show','put','/:id','delete','destroy','exports','multer'];(function(_0x1f2a62,_0x5080e7){var _0x2f898a=function(_0x5ada4e){while(--_0x5ada4e){_0x1f2a62['push'](_0x1f2a62['shift']());}};_0x2f898a(++_0x5080e7);}(_0x4664,0x11f));var _0x4466=function(_0x4480b9,_0x5c2949){_0x4480b9=_0x4480b9-0x0;var _0x3f0f02=_0x4664[_0x4480b9];return _0x3f0f02;};'use strict';var multer=require(_0x4466('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4466('0x1'));var express=require(_0x4466('0x2'));var router=express[_0x4466('0x3')]();var fs_extra=require(_0x4466('0x4'));var auth=require(_0x4466('0x5'));var interaction=require(_0x4466('0x6'));var config=require('../../config/environment');var controller=require(_0x4466('0x7'));router[_0x4466('0x8')]('/:id',auth[_0x4466('0x9')](),controller[_0x4466('0xa')]);router[_0x4466('0xb')](_0x4466('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x4466('0xd')](_0x4466('0xc'),auth['isAuthenticated'](),controller[_0x4466('0xe')]);module[_0x4466('0xf')]=router; \ No newline at end of file +var _0x26a4=['destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update'];(function(_0x3ad1aa,_0x1e5418){var _0x535c08=function(_0x2db35b){while(--_0x2db35b){_0x3ad1aa['push'](_0x3ad1aa['shift']());}};_0x535c08(++_0x1e5418);}(_0x26a4,0x189));var _0x426a=function(_0x5a6b33,_0xfd9c0c){_0x5a6b33=_0x5a6b33-0x0;var _0x55f37c=_0x26a4[_0x5a6b33];return _0x55f37c;};'use strict';var multer=require(_0x426a('0x0'));var util=require(_0x426a('0x1'));var path=require(_0x426a('0x2'));var timeout=require(_0x426a('0x3'));var express=require(_0x426a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x426a('0x5'));var interaction=require(_0x426a('0x6'));var config=require(_0x426a('0x7'));var controller=require(_0x426a('0x8'));router[_0x426a('0x9')](_0x426a('0xa'),auth[_0x426a('0xb')](),controller[_0x426a('0xc')]);router[_0x426a('0xd')](_0x426a('0xa'),auth['isAuthenticated'](),controller[_0x426a('0xe')]);router['delete'](_0x426a('0xa'),auth[_0x426a('0xb')](),controller[_0x426a('0xf')]);module[_0x426a('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 9cea04f..f430292 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 _0x7144=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x301dff,_0x8c0214){var _0x101ef0=function(_0x18274f){while(--_0x18274f){_0x301dff['push'](_0x301dff['shift']());}};_0x101ef0(++_0x8c0214);}(_0x7144,0x7b));var _0x4714=function(_0x2771d2,_0x6f6fb5){_0x2771d2=_0x2771d2-0x0;var _0x34639e=_0x7144[_0x2771d2];return _0x34639e;};'use strict';var Sequelize=require(_0x4714('0x0'));module[_0x4714('0x1')]={'priority':{'type':Sequelize[_0x4714('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4714('0x3')],'allowNull':![],'defaultValue':_0x4714('0x4')},'appdata':{'type':Sequelize[_0x4714('0x5')]()},'description':{'type':Sequelize[_0x4714('0x3')]},'interval':{'type':Sequelize[_0x4714('0x3')],'defaultValue':_0x4714('0x6')}}; \ No newline at end of file +var _0x1147=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x1e11c2,_0x1bcbca){var _0x4faa44=function(_0x4c3bf3){while(--_0x4c3bf3){_0x1e11c2['push'](_0x1e11c2['shift']());}};_0x4faa44(++_0x1bcbca);}(_0x1147,0xf5));var _0x7114=function(_0x356db9,_0x7b6cb1){_0x356db9=_0x356db9-0x0;var _0x117930=_0x1147[_0x356db9];return _0x117930;};'use strict';var Sequelize=require(_0x7114('0x0'));module['exports']={'priority':{'type':Sequelize[_0x7114('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7114('0x2')],'allowNull':![],'defaultValue':_0x7114('0x3')},'appdata':{'type':Sequelize[_0x7114('0x4')]()},'description':{'type':Sequelize[_0x7114('0x2')]},'interval':{'type':Sequelize[_0x7114('0x2')],'defaultValue':_0x7114('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index d0eb677..be6f06e 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 _0x9bde=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','name','send','show','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','params','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x4be3f3,_0x20efd7){var _0x5278b3=function(_0x147367){while(--_0x147367){_0x4be3f3['push'](_0x4be3f3['shift']());}};_0x5278b3(++_0x20efd7);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4dfec5,_0x161bc3){_0x4dfec5=_0x4dfec5-0x0;var _0x596386=_0x9bde[_0x4dfec5];return _0x596386;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];function respondWithStatusCode(_0x5e022a,_0x2c1d98){_0x2c1d98=_0x2c1d98||0xcc;return function(_0x4ac319){if(_0x4ac319){return _0x5e022a[_0xe9bd('0x19')](_0x2c1d98);}return _0x5e022a[_0xe9bd('0x1a')](_0x2c1d98)[_0xe9bd('0x1b')]();};}function respondWithResult(_0x51109f,_0x47ba5e){_0x47ba5e=_0x47ba5e||0xc8;return function(_0x46a95e){if(_0x46a95e){return _0x51109f[_0xe9bd('0x1a')](_0x47ba5e)[_0xe9bd('0x1c')](_0x46a95e);}};}function respondWithFilteredResult(_0x46a59b,_0x3360bd){return function(_0x389e7b){if(_0x389e7b){var _0x45a9f2=typeof _0x3360bd['offset']===_0xe9bd('0x1d')&&typeof _0x3360bd[_0xe9bd('0x1e')]===_0xe9bd('0x1d');var _0x494b27=_0x389e7b[_0xe9bd('0x1f')];var _0x3bae08=_0x45a9f2?0x0:_0x3360bd[_0xe9bd('0x20')];var _0x330733=_0x45a9f2?_0x389e7b['count']:_0x3360bd[_0xe9bd('0x20')]+_0x3360bd['limit'];var _0xc6b661;if(_0x330733>=_0x494b27){_0x330733=_0x494b27;_0xc6b661=0xc8;}else{_0xc6b661=0xce;}_0x46a59b['status'](_0xc6b661);return _0x46a59b[_0xe9bd('0x21')](_0xe9bd('0x22'),_0x3bae08+'-'+_0x330733+'/'+_0x494b27)[_0xe9bd('0x1c')](_0x389e7b);}return null;};}function patchUpdates(_0x3dda13){return function(_0x1acb82){try{jsonpatch[_0xe9bd('0x23')](_0x1acb82,_0x3dda13,!![]);}catch(_0x6593ce){return BPromise['reject'](_0x6593ce);}return _0x1acb82[_0xe9bd('0x24')]();};}function saveUpdates(_0x28cd17,_0x4ecaf5){return function(_0x37aec1){if(_0x37aec1){return _0x37aec1['update'](_0x28cd17)[_0xe9bd('0x25')](function(_0x1b9cc9){return _0x1b9cc9;});}return null;};}function removeEntity(_0x36f8c0,_0xf02209){return function(_0x5bc4bf){if(_0x5bc4bf){return _0x5bc4bf[_0xe9bd('0x26')]()[_0xe9bd('0x25')](function(){_0x36f8c0[_0xe9bd('0x1a')](0xcc)[_0xe9bd('0x1b')]();});}};}function handleEntityNotFound(_0x2641be,_0xb52d45){return function(_0x399f3c){if(!_0x399f3c){_0x2641be[_0xe9bd('0x19')](0x194);}return _0x399f3c;};}function handleError(_0x1ae889,_0x5987af){_0x5987af=_0x5987af||0x1f4;return function(_0x3c211a){logger[_0xe9bd('0x27')](_0x3c211a['stack']);if(_0x3c211a[_0xe9bd('0x28')]){delete _0x3c211a[_0xe9bd('0x28')];}_0x1ae889[_0xe9bd('0x1a')](_0x5987af)[_0xe9bd('0x29')](_0x3c211a);};}exports[_0xe9bd('0x2a')]=function(_0x183601,_0x519f48){var _0x5b7f1d={'raw':!![],'where':{'id':_0x183601['params']['id']}},_0x1de54c={};_0x1de54c[_0xe9bd('0x2b')]=_[_0xe9bd('0x2c')](db[_0xe9bd('0x2d')][_0xe9bd('0x2e')]);_0x1de54c[_0xe9bd('0x2f')]=_['keys'](_0x183601['query']);_0x1de54c[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],_0x1de54c[_0xe9bd('0x2f')]);_0x5b7f1d[_0xe9bd('0x32')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],qs[_0xe9bd('0x33')](_0x183601[_0xe9bd('0x2f')]['fields']));_0x5b7f1d[_0xe9bd('0x32')]=_0x5b7f1d[_0xe9bd('0x32')][_0xe9bd('0x34')]?_0x5b7f1d['attributes']:_0x1de54c['model'];if(_0x183601[_0xe9bd('0x2f')][_0xe9bd('0x35')]){_0x5b7f1d[_0xe9bd('0x36')]=[{'all':!![]}];}_0x5b7f1d=_[_0xe9bd('0x37')]({},_0x5b7f1d,_0x183601[_0xe9bd('0x38')]);return db[_0xe9bd('0x2d')][_0xe9bd('0x39')](_0x5b7f1d)[_0xe9bd('0x25')](handleEntityNotFound(_0x519f48,null))[_0xe9bd('0x25')](respondWithResult(_0x519f48,null))[_0xe9bd('0x3a')](handleError(_0x519f48,null));};exports[_0xe9bd('0x3b')]=function(_0x549dd1,_0x2ad46e){if(_0x549dd1[_0xe9bd('0x3c')]['id']){delete _0x549dd1[_0xe9bd('0x3c')]['id'];}return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x549dd1[_0xe9bd('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2ad46e,null))[_0xe9bd('0x25')](saveUpdates(_0x549dd1[_0xe9bd('0x3c')],null))['then'](respondWithResult(_0x2ad46e,null))[_0xe9bd('0x3a')](handleError(_0x2ad46e,null));};exports[_0xe9bd('0x26')]=function(_0x4c7d47,_0x4b1da0){return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x4c7d47['params']['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x4b1da0,null))[_0xe9bd('0x25')](removeEntity(_0x4b1da0,null))[_0xe9bd('0x3a')](handleError(_0x4b1da0,null));}; \ No newline at end of file +var _0xf4eb=['limit','count','Content-Range','json','apply','reject','save','then','destroy','error','name','send','params','keys','MailApplication','rawAttributes','query','filters','intersection','model','fields','attributes','includeAll','include','options','find','catch','body','eml-format','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined'];(function(_0x188e57,_0x2b82e0){var _0x50a74f=function(_0x7732d9){while(--_0x7732d9){_0x188e57['push'](_0x188e57['shift']());}};_0x50a74f(++_0x2b82e0);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3f37d2,_0x470187){_0x3f37d2=_0x3f37d2-0x0;var _0x56c563=_0xf4eb[_0x3f37d2];return _0x56c563;};'use strict';var emlformat=require(_0xbf4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf4e('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf4e('0x2'));var path=require(_0xbf4e('0x3'));var sox=require(_0xbf4e('0x4'));var csv=require(_0xbf4e('0x5'));var ejs=require(_0xbf4e('0x6'));var fs=require('fs');var fs_extra=require(_0xbf4e('0x7'));var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x5'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var licenseUtil=require(_0xbf4e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17fd01,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x56d185){if(_0x56d185){return _0x17fd01[_0xbf4e('0x13')](_0x5a3035);}return _0x17fd01[_0xbf4e('0x14')](_0x5a3035)[_0xbf4e('0x15')]();};}function respondWithResult(_0x302841,_0x3b74bd){_0x3b74bd=_0x3b74bd||0xc8;return function(_0x61bd54){if(_0x61bd54){return _0x302841['status'](_0x3b74bd)['json'](_0x61bd54);}};}function respondWithFilteredResult(_0x180432,_0x1735ae){return function(_0x28fc6b){if(_0x28fc6b){var _0x542909=typeof _0x1735ae[_0xbf4e('0x16')]===_0xbf4e('0x17')&&typeof _0x1735ae[_0xbf4e('0x18')]===_0xbf4e('0x17');var _0x5a631e=_0x28fc6b[_0xbf4e('0x19')];var _0x577c27=_0x542909?0x0:_0x1735ae['offset'];var _0x566ec3=_0x542909?_0x28fc6b['count']:_0x1735ae[_0xbf4e('0x16')]+_0x1735ae[_0xbf4e('0x18')];var _0x1fc800;if(_0x566ec3>=_0x5a631e){_0x566ec3=_0x5a631e;_0x1fc800=0xc8;}else{_0x1fc800=0xce;}_0x180432['status'](_0x1fc800);return _0x180432['set'](_0xbf4e('0x1a'),_0x577c27+'-'+_0x566ec3+'/'+_0x5a631e)[_0xbf4e('0x1b')](_0x28fc6b);}return null;};}function patchUpdates(_0x3be138){return function(_0x3a875b){try{jsonpatch[_0xbf4e('0x1c')](_0x3a875b,_0x3be138,!![]);}catch(_0x1e2a68){return BPromise[_0xbf4e('0x1d')](_0x1e2a68);}return _0x3a875b[_0xbf4e('0x1e')]();};}function saveUpdates(_0xd09e12,_0x376832){return function(_0x30539b){if(_0x30539b){return _0x30539b['update'](_0xd09e12)[_0xbf4e('0x1f')](function(_0x2e7673){return _0x2e7673;});}return null;};}function removeEntity(_0x51648c,_0x31e3f5){return function(_0x30994d){if(_0x30994d){return _0x30994d[_0xbf4e('0x20')]()[_0xbf4e('0x1f')](function(){_0x51648c[_0xbf4e('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x90635e,_0x36688a){return function(_0x3d6863){if(!_0x3d6863){_0x90635e['sendStatus'](0x194);}return _0x3d6863;};}function handleError(_0x2fb490,_0x5e08b1){_0x5e08b1=_0x5e08b1||0x1f4;return function(_0x5bcf71){logger[_0xbf4e('0x21')](_0x5bcf71['stack']);if(_0x5bcf71[_0xbf4e('0x22')]){delete _0x5bcf71[_0xbf4e('0x22')];}_0x2fb490[_0xbf4e('0x14')](_0x5e08b1)[_0xbf4e('0x23')](_0x5bcf71);};}exports['show']=function(_0x2d4686,_0x8e0ab5){var _0x43879d={'raw':!![],'where':{'id':_0x2d4686[_0xbf4e('0x24')]['id']}},_0x4cd4a1={};_0x4cd4a1['model']=_[_0xbf4e('0x25')](db[_0xbf4e('0x26')][_0xbf4e('0x27')]);_0x4cd4a1['query']=_[_0xbf4e('0x25')](_0x2d4686[_0xbf4e('0x28')]);_0x4cd4a1[_0xbf4e('0x29')]=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],_0x4cd4a1[_0xbf4e('0x28')]);_0x43879d['attributes']=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],qs['fields'](_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2c')]));_0x43879d['attributes']=_0x43879d[_0xbf4e('0x2d')]['length']?_0x43879d[_0xbf4e('0x2d')]:_0x4cd4a1['model'];if(_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2e')]){_0x43879d[_0xbf4e('0x2f')]=[{'all':!![]}];}_0x43879d=_['merge']({},_0x43879d,_0x2d4686[_0xbf4e('0x30')]);return db[_0xbf4e('0x26')][_0xbf4e('0x31')](_0x43879d)[_0xbf4e('0x1f')](handleEntityNotFound(_0x8e0ab5,null))[_0xbf4e('0x1f')](respondWithResult(_0x8e0ab5,null))[_0xbf4e('0x32')](handleError(_0x8e0ab5,null));};exports['update']=function(_0x99b320,_0x3dbb2b){if(_0x99b320[_0xbf4e('0x33')]['id']){delete _0x99b320[_0xbf4e('0x33')]['id'];}return db[_0xbf4e('0x26')]['find']({'where':{'id':_0x99b320['params']['id']}})['then'](handleEntityNotFound(_0x3dbb2b,null))['then'](saveUpdates(_0x99b320[_0xbf4e('0x33')],null))[_0xbf4e('0x1f')](respondWithResult(_0x3dbb2b,null))[_0xbf4e('0x32')](handleError(_0x3dbb2b,null));};exports[_0xbf4e('0x20')]=function(_0x22ddde,_0x257b74){return db[_0xbf4e('0x26')][_0xbf4e('0x31')]({'where':{'id':_0x22ddde[_0xbf4e('0x24')]['id']}})['then'](handleEntityNotFound(_0x257b74,null))['then'](removeEntity(_0x257b74,null))[_0xbf4e('0x32')](handleError(_0x257b74,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index b81aa15..2fa2c20 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 _0xe66d=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./mailApplication.attributes','exports','define','mail_applications','utf8mb4'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xe66d,0x7f));var _0xde66=function(_0x2136a6,_0x35af63){_0x2136a6=_0x2136a6-0x0;var _0x55b948=_0xe66d[_0x2136a6];return _0x55b948;};'use strict';var _=require(_0xde66('0x0'));var util=require(_0xde66('0x1'));var logger=require(_0xde66('0x2'))(_0xde66('0x3'));var moment=require(_0xde66('0x4'));var BPromise=require(_0xde66('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xde66('0x6'));var config=require(_0xde66('0x7'));var attributes=require(_0xde66('0x8'));module[_0xde66('0x9')]=function(_0x4481f5,_0x4137fb){return _0x4481f5[_0xde66('0xa')]('MailApplication',attributes,{'tableName':_0xde66('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xde66('0xc'),'collate':_0xde66('0xd')});}; \ No newline at end of file +var _0x342e=['./mailApplication.attributes','exports','MailApplication','utf8mb4','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x2ef16c,_0xd211ba){var _0x128a71=function(_0x4c12f4){while(--_0x4c12f4){_0x2ef16c['push'](_0x2ef16c['shift']());}};_0x128a71(++_0xd211ba);}(_0x342e,0xae));var _0xe342=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0x342e[_0x245afe];return _0x4eefde;};'use strict';var _=require('lodash');var util=require(_0xe342('0x0'));var logger=require(_0xe342('0x1'))(_0xe342('0x2'));var moment=require(_0xe342('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe342('0x4'));var config=require(_0xe342('0x5'));var attributes=require(_0xe342('0x6'));module[_0xe342('0x7')]=function(_0x12ad72,_0x9cfc64){return _0x12ad72['define'](_0xe342('0x8'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe342('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index e63edb2..6aa42bc 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 _0x2dbe=['MailApplication','update','options','raw','where','attributes','stringify','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','MailApplication,\x20%s,\x20%s','message','request\x20sent','result','catch','UpdateMailApplication'];(function(_0x285824,_0x3da647){var _0x311d7e=function(_0x2f3de0){while(--_0x2f3de0){_0x285824['push'](_0x285824['shift']());}};_0x311d7e(++_0x3da647);}(_0x2dbe,0x9d));var _0xe2db=function(_0x1bcc80,_0x8c103f){_0x1bcc80=_0x1bcc80-0x0;var _0x1540e2=_0x2dbe[_0x1bcc80];return _0x1540e2;};'use strict';var _=require(_0xe2db('0x0'));var util=require(_0xe2db('0x1'));var moment=require('moment');var BPromise=require(_0xe2db('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe2db('0x3'))['db'];var utils=require(_0xe2db('0x4'));var logger=require(_0xe2db('0x5'))(_0xe2db('0x6'));var config=require(_0xe2db('0x7'));var jayson=require(_0xe2db('0x8'));var client=jayson['client'][_0xe2db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20acc3,_0x2641ad,_0x57d954){return new BPromise(function(_0x4d1413,_0x2e17d2){return client[_0xe2db('0xa')](_0x20acc3,_0x57d954)[_0xe2db('0xb')](function(_0x58eae3){logger[_0xe2db('0xc')]('MailApplication,\x20%s,\x20%s',_0x2641ad,'request\x20sent');logger[_0xe2db('0xd')](_0xe2db('0xe'),_0x2641ad,'request\x20sent',JSON['stringify'](_0x58eae3));if(_0x58eae3[_0xe2db('0xf')]){if(_0x58eae3[_0xe2db('0xf')][_0xe2db('0x10')]===0x1f4){logger['error'](_0xe2db('0x11'),_0x2641ad,_0x58eae3[_0xe2db('0xf')]['message']);return _0x2e17d2(_0x58eae3['error'][_0xe2db('0x12')]);}logger[_0xe2db('0xf')](_0xe2db('0x11'),_0x2641ad,_0x58eae3[_0xe2db('0xf')][_0xe2db('0x12')]);return _0x4d1413(_0x58eae3[_0xe2db('0xf')][_0xe2db('0x12')]);}else{logger[_0xe2db('0xc')](_0xe2db('0x11'),_0x2641ad,_0xe2db('0x13'));_0x4d1413(_0x58eae3[_0xe2db('0x14')][_0xe2db('0x12')]);}})[_0xe2db('0x15')](function(_0x3deb6c){logger[_0xe2db('0xf')](_0xe2db('0x11'),_0x2641ad,_0x3deb6c);_0x2e17d2(_0x3deb6c);});});}exports[_0xe2db('0x16')]=function(_0x32e338){var _0x36d4aa=this;return new Promise(function(_0x176d1,_0x2bdcec){return db[_0xe2db('0x17')][_0xe2db('0x18')](_0x32e338['body'],{'raw':_0x32e338[_0xe2db('0x19')]?_0x32e338['options'][_0xe2db('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32e338[_0xe2db('0x19')]?_0x32e338[_0xe2db('0x19')][_0xe2db('0x1b')]||null:null,'attributes':_0x32e338[_0xe2db('0x19')]?_0x32e338[_0xe2db('0x19')][_0xe2db('0x1c')]||null:null,'limit':_0x32e338[_0xe2db('0x19')]?_0x32e338['options']['limit']||null:null})['then'](function(_0x3839d5){logger[_0xe2db('0xc')]('UpdateMailApplication',_0x32e338);logger['debug'](_0xe2db('0x16'),_0x32e338,JSON[_0xe2db('0x1d')](_0x3839d5));_0x176d1(_0x3839d5);})['catch'](function(_0x58387e){logger[_0xe2db('0xf')](_0xe2db('0x16'),_0x58387e[_0xe2db('0x12')],_0x32e338);_0x2bdcec(_0x36d4aa[_0xe2db('0xf')](0x1f4,_0x58387e[_0xe2db('0x12')]));});});}; \ No newline at end of file +var _0x8f92=['http','info','MailApplication,\x20%s,\x20%s','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','MailApplication','body','options','raw','where','attributes','limit','then','UpdateMailApplication','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x3cff07,_0x30f413){var _0x468e93=function(_0xbf15e5){while(--_0xbf15e5){_0x3cff07['push'](_0x3cff07['shift']());}};_0x468e93(++_0x30f413);}(_0x8f92,0x15d));var _0x28f9=function(_0x1a74c0,_0x3147d2){_0x1a74c0=_0x1a74c0-0x0;var _0x5ebc15=_0x8f92[_0x1a74c0];return _0x5ebc15;};'use strict';var _=require(_0x28f9('0x0'));var util=require(_0x28f9('0x1'));var moment=require(_0x28f9('0x2'));var BPromise=require(_0x28f9('0x3'));var rs=require(_0x28f9('0x4'));var fs=require('fs');var Redis=require(_0x28f9('0x5'));var db=require(_0x28f9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x28f9('0x7'))(_0x28f9('0x8'));var config=require(_0x28f9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x28f9('0xa')][_0x28f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1488a1,_0x84ac35,_0x40ac1f){return new BPromise(function(_0xcf0f57,_0x1f5b5e){return client['request'](_0x1488a1,_0x40ac1f)['then'](function(_0x4cb4f2){logger[_0x28f9('0xc')](_0x28f9('0xd'),_0x84ac35,'request\x20sent');logger['debug'](_0x28f9('0xe'),_0x84ac35,_0x28f9('0xf'),JSON[_0x28f9('0x10')](_0x4cb4f2));if(_0x4cb4f2[_0x28f9('0x11')]){if(_0x4cb4f2[_0x28f9('0x11')][_0x28f9('0x12')]===0x1f4){logger[_0x28f9('0x11')](_0x28f9('0xd'),_0x84ac35,_0x4cb4f2['error'][_0x28f9('0x13')]);return _0x1f5b5e(_0x4cb4f2[_0x28f9('0x11')][_0x28f9('0x13')]);}logger[_0x28f9('0x11')](_0x28f9('0xd'),_0x84ac35,_0x4cb4f2['error']['message']);return _0xcf0f57(_0x4cb4f2[_0x28f9('0x11')][_0x28f9('0x13')]);}else{logger[_0x28f9('0xc')](_0x28f9('0xd'),_0x84ac35,'request\x20sent');_0xcf0f57(_0x4cb4f2[_0x28f9('0x14')]['message']);}})['catch'](function(_0x19f806){logger[_0x28f9('0x11')]('MailApplication,\x20%s,\x20%s',_0x84ac35,_0x19f806);_0x1f5b5e(_0x19f806);});});}exports['UpdateMailApplication']=function(_0x235b02){var _0x39a093=this;return new Promise(function(_0x4ab86f,_0xcf16cf){return db[_0x28f9('0x15')]['update'](_0x235b02[_0x28f9('0x16')],{'raw':_0x235b02[_0x28f9('0x17')]?_0x235b02[_0x28f9('0x17')][_0x28f9('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x235b02[_0x28f9('0x17')]?_0x235b02[_0x28f9('0x17')][_0x28f9('0x19')]||null:null,'attributes':_0x235b02[_0x28f9('0x17')]?_0x235b02['options'][_0x28f9('0x1a')]||null:null,'limit':_0x235b02['options']?_0x235b02[_0x28f9('0x17')][_0x28f9('0x1b')]||null:null})[_0x28f9('0x1c')](function(_0x1a1c5a){logger['info'](_0x28f9('0x1d'),_0x235b02);logger['debug'](_0x28f9('0x1d'),_0x235b02,JSON[_0x28f9('0x10')](_0x1a1c5a));_0x4ab86f(_0x1a1c5a);})['catch'](function(_0x363a8f){logger['error'](_0x28f9('0x1d'),_0x363a8f[_0x28f9('0x13')],_0x235b02);_0xcf16cf(_0x39a093[_0x28f9('0x11')](0x1f4,_0x363a8f[_0x28f9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 6531d6c..e287bae 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 _0x4c1e=['getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x4c1e,0xcd));var _0xe4c1=function(_0x43aacd,_0x1d807c){_0x43aacd=_0x43aacd-0x0;var _0x2e5ad9=_0x4c1e[_0x43aacd];return _0x2e5ad9;};'use strict';var express=require(_0xe4c1('0x0'));var router=express[_0xe4c1('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xe4c1('0x2'));var controller=require(_0xe4c1('0x3'));router[_0xe4c1('0x4')]('/',auth[_0xe4c1('0x5')](),controller[_0xe4c1('0x6')]);router[_0xe4c1('0x4')](_0xe4c1('0x7'),auth[_0xe4c1('0x5')](),controller[_0xe4c1('0x8')]);router[_0xe4c1('0x4')](_0xe4c1('0x9'),auth[_0xe4c1('0x5')](),controller[_0xe4c1('0xa')]);router[_0xe4c1('0x4')](_0xe4c1('0xb'),auth[_0xe4c1('0x5')](),controller[_0xe4c1('0xc')]);router[_0xe4c1('0x4')](_0xe4c1('0xd'),auth[_0xe4c1('0x5')](),controller[_0xe4c1('0xe')]);router[_0xe4c1('0xf')]('/',auth[_0xe4c1('0x5')](),controller[_0xe4c1('0x10')]);router[_0xe4c1('0xf')](_0xe4c1('0xb'),auth[_0xe4c1('0x5')](),controller[_0xe4c1('0x11')]);router[_0xe4c1('0xf')](_0xe4c1('0x12'),auth[_0xe4c1('0x5')](),interaction[_0xe4c1('0x13')](_0xe4c1('0x14'),_0xe4c1('0x15')),controller[_0xe4c1('0x16')]);router[_0xe4c1('0x17')](_0xe4c1('0x9'),auth[_0xe4c1('0x5')](),interaction[_0xe4c1('0x13')](_0xe4c1('0x14'),_0xe4c1('0x18')),controller[_0xe4c1('0x19')]);router[_0xe4c1('0x1a')](_0xe4c1('0x9'),auth[_0xe4c1('0x5')](),interaction[_0xe4c1('0x13')](_0xe4c1('0x14'),_0xe4c1('0x1b')),controller[_0xe4c1('0x1c')]);router[_0xe4c1('0x1a')](_0xe4c1('0x12'),auth[_0xe4c1('0x5')](),controller[_0xe4c1('0x1d')]);module[_0xe4c1('0x1e')]=router; \ No newline at end of file +var _0x4223=['removeTags','exports','express','../../components/auth/service','get','isAuthenticated','index','describe','show','/:id/messages','getMessages','/:id/download','download','post','/:id/tags','tracked','mail','addTags','put','/:id','mailinteraction:update','update','mailinteraction:destroy','delete'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x4223,0x152));var _0x3422=function(_0x3f7c1a,_0x505f3e){_0x3f7c1a=_0x3f7c1a-0x0;var _0x2a6066=_0x4223[_0x3f7c1a];return _0x2a6066;};'use strict';var express=require(_0x3422('0x0'));var router=express['Router']();var auth=require(_0x3422('0x1'));var interaction=require('../../components/interaction/service');var controller=require('./mailInteraction.controller');router[_0x3422('0x2')]('/',auth[_0x3422('0x3')](),controller[_0x3422('0x4')]);router[_0x3422('0x2')]('/describe',auth[_0x3422('0x3')](),controller[_0x3422('0x5')]);router[_0x3422('0x2')]('/:id',auth[_0x3422('0x3')](),controller[_0x3422('0x6')]);router[_0x3422('0x2')](_0x3422('0x7'),auth[_0x3422('0x3')](),controller[_0x3422('0x8')]);router[_0x3422('0x2')](_0x3422('0x9'),auth[_0x3422('0x3')](),controller[_0x3422('0xa')]);router[_0x3422('0xb')]('/',auth[_0x3422('0x3')](),controller['create']);router['post'](_0x3422('0x7'),auth['isAuthenticated'](),controller['addMessage']);router[_0x3422('0xb')](_0x3422('0xc'),auth[_0x3422('0x3')](),interaction[_0x3422('0xd')](_0x3422('0xe'),'mailinteraction:addtags'),controller[_0x3422('0xf')]);router[_0x3422('0x10')](_0x3422('0x11'),auth[_0x3422('0x3')](),interaction['tracked'](_0x3422('0xe'),_0x3422('0x12')),controller[_0x3422('0x13')]);router['delete'](_0x3422('0x11'),auth[_0x3422('0x3')](),interaction[_0x3422('0xd')](_0x3422('0xe'),_0x3422('0x14')),controller['destroy']);router[_0x3422('0x15')](_0x3422('0xc'),auth['isAuthenticated'](),controller[_0x3422('0x16')]);module[_0x3422('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index d09d00a..4382178 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 _0x23f5=['DATE','STRING','long','TEXT','BOOLEAN','ENUM','out','sequelize','iconv','exports'];(function(_0x258b0c,_0x57a359){var _0x53b0db=function(_0x4b7802){while(--_0x4b7802){_0x258b0c['push'](_0x258b0c['shift']());}};_0x53b0db(++_0x57a359);}(_0x23f5,0x93));var _0x523f=function(_0x2341c6,_0x3af092){_0x2341c6=_0x2341c6-0x0;var _0x54c34d=_0x23f5[_0x2341c6];return _0x54c34d;};'use strict';var Sequelize=require(_0x523f('0x0'));var iconv=require(_0x523f('0x1'));module[_0x523f('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x523f('0x3')]},'disposition':{'type':Sequelize[_0x523f('0x4')]},'secondDisposition':{'type':Sequelize[_0x523f('0x4')]},'thirdDisposition':{'type':Sequelize[_0x523f('0x4')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x523f('0x4')](0x1fe)},'to':{'type':Sequelize[_0x523f('0x4')]},'cc':{'type':Sequelize['TEXT'](_0x523f('0x5'))},'subject':{'type':Sequelize[_0x523f('0x6')]()},'attach':{'type':Sequelize[_0x523f('0x7')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x523f('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x523f('0x8')]('in',_0x523f('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xbde1=['iconv','exports','BOOLEAN','DATE','STRING','TEXT','long','out','ENUM','sequelize'];(function(_0x418ad2,_0x2eb809){var _0x53e614=function(_0x32fc8e){while(--_0x32fc8e){_0x418ad2['push'](_0x418ad2['shift']());}};_0x53e614(++_0x2eb809);}(_0xbde1,0x1c1));var _0x1bde=function(_0x1193ea,_0xc04ef0){_0x1193ea=_0x1193ea-0x0;var _0x5e4000=_0xbde1[_0x1193ea];return _0x5e4000;};'use strict';var Sequelize=require(_0x1bde('0x0'));var iconv=require(_0x1bde('0x1'));module[_0x1bde('0x2')]={'closed':{'type':Sequelize[_0x1bde('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1bde('0x4')]},'disposition':{'type':Sequelize[_0x1bde('0x5')]},'secondDisposition':{'type':Sequelize[_0x1bde('0x5')]},'thirdDisposition':{'type':Sequelize[_0x1bde('0x5')]},'note':{'type':Sequelize[_0x1bde('0x5')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x1bde('0x6')](_0x1bde('0x7'))},'subject':{'type':Sequelize[_0x1bde('0x6')]()},'attach':{'type':Sequelize[_0x1bde('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x1bde('0x4')]},'substatus':{'type':Sequelize[_0x1bde('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x1bde('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x1bde('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1bde('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x1bde('0x9')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1bde('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 618215a..769f0b8 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 _0x5d72=['find','catch','create','body','describe','addMessage','MailMessage','ids','omit','getMessages','findOne','length','hasOwnProperty','nolimit','order','sort','where','pick','MailInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','addTags','setTags','spread','color','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','root','server','tmp','files','attachments','push','Attachment','Attachments','Messages','from','bcc','subject','createdAt','each','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc','basename','existsSync','build','writeFileSync','message%d.eml','unlinkSync','rimraf','moment','bluebird','util','path','juice','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','defaults','redis','socket.io-emitter','./mailInteraction.socket','register','status','end','offset','undefined','count','limit','set','Content-Range','json','update','then','destroy','sendStatus','stack','name','index','MailInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','query','user','params','model','keys','filters','intersection','fields','attributes','includeAll','include','merge','options'];(function(_0x4aabdc,_0x32ef8e){var _0x2bd30c=function(_0xe69df3){while(--_0xe69df3){_0x4aabdc['push'](_0x4aabdc['shift']());}};_0x2bd30c(++_0x32ef8e);}(_0x5d72,0xad));var _0x25d7=function(_0x5f3905,_0x43a651){_0x5f3905=_0x5f3905-0x0;var _0x2923b1=_0x5d72[_0x5f3905];return _0x2923b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x25d7('0x0'));var zipdir=require('zip-dir');var moment=require(_0x25d7('0x1'));var BPromise=require(_0x25d7('0x2'));var util=require(_0x25d7('0x3'));var path=require(_0x25d7('0x4'));var fs=require('fs');var _=require('lodash');var juice=require(_0x25d7('0x5'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0x25d7('0x6'));var logger=require(_0x25d7('0x7'))(_0x25d7('0x8'));var config=require(_0x25d7('0x9'));var db=require(_0x25d7('0xa'))['db'];var htmlEntities=require(_0x25d7('0xb'));config['redis']=_[_0x25d7('0xc')](config[_0x25d7('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x25d7('0xe'))(new Redis(config[_0x25d7('0xd')]));require(_0x25d7('0xf'))[_0x25d7('0x10')](socket);function respondWithStatusCode(_0x326bb1,_0x3a38c4){_0x3a38c4=_0x3a38c4||0xcc;return function(_0x19ae41){if(_0x19ae41){return _0x326bb1['sendStatus'](_0x3a38c4);}return _0x326bb1[_0x25d7('0x11')](_0x3a38c4)[_0x25d7('0x12')]();};}function respondWithResult(_0x5def58,_0x415d0b){_0x415d0b=_0x415d0b||0xc8;return function(_0x1cb1de){if(_0x1cb1de){return _0x5def58[_0x25d7('0x11')](_0x415d0b)['json'](_0x1cb1de);}};}function respondWithFilteredResult(_0x20a44c,_0x1bcce7){return function(_0x416f5c){if(_0x416f5c){var _0x1b7ad0=typeof _0x1bcce7[_0x25d7('0x13')]==='undefined'&&typeof _0x1bcce7['limit']===_0x25d7('0x14');var _0x3241f0=_0x416f5c[_0x25d7('0x15')];var _0x40cf74=_0x1b7ad0?0x0:_0x1bcce7[_0x25d7('0x13')];var _0x56dbe7=_0x1b7ad0?_0x416f5c['count']:_0x1bcce7[_0x25d7('0x13')]+_0x1bcce7[_0x25d7('0x16')];var _0x13f222;if(_0x56dbe7>=_0x3241f0){_0x56dbe7=_0x3241f0;_0x13f222=0xc8;}else{_0x13f222=0xce;}_0x20a44c[_0x25d7('0x11')](_0x13f222);return _0x20a44c[_0x25d7('0x17')](_0x25d7('0x18'),_0x40cf74+'-'+_0x56dbe7+'/'+_0x3241f0)[_0x25d7('0x19')](_0x416f5c);}return null;};}function saveUpdates(_0x229680){return function(_0x357fda){if(_0x357fda){return _0x357fda[_0x25d7('0x1a')](_0x229680)[_0x25d7('0x1b')](function(_0x18c1a6){return _0x18c1a6;});}return null;};}function removeEntity(_0x49a120){return function(_0x18452a){if(_0x18452a){return _0x18452a[_0x25d7('0x1c')]()['then'](function(){_0x49a120[_0x25d7('0x11')](0xcc)[_0x25d7('0x12')]();});}};}function handleEntityNotFound(_0x2237da){return function(_0x59aef4){if(!_0x59aef4){_0x2237da[_0x25d7('0x1d')](0x194);}return _0x59aef4;};}function handleError(_0x23bdaf,_0x49691f){_0x49691f=_0x49691f||0x1f4;return function(_0x5330b5){logger['error'](_0x5330b5[_0x25d7('0x1e')]);if(_0x5330b5['name']){delete _0x5330b5[_0x25d7('0x1f')];}_0x23bdaf[_0x25d7('0x11')](_0x49691f)['send'](_0x5330b5);};}exports[_0x25d7('0x20')]=function(_0x56e9a0,_0x58ae6d){var _0xae6fd6={};var _0x289a1b=_['map'](db[_0x25d7('0x21')][_0x25d7('0x22')],function(_0x58619a){return{'name':_0x58619a[_0x25d7('0x23')],'type':_0x58619a[_0x25d7('0x24')][_0x25d7('0x25')]};});_0xae6fd6=qs[_0x25d7('0x26')](_0x289a1b,_0x56e9a0);return interaction[_0x25d7('0x27')]('mail',_0x56e9a0[_0x25d7('0x28')],_0x56e9a0[_0x25d7('0x29')],_0xae6fd6,_0x289a1b)[_0x25d7('0x1b')](respondWithFilteredResult(_0x58ae6d,_0xae6fd6))['catch'](handleError(_0x58ae6d,null));};exports['show']=function(_0x34d638,_0x5c21f4){var _0x52a936={'raw':![],'where':{'id':_0x34d638[_0x25d7('0x2a')]['id']}},_0x2a1868={};_0x2a1868[_0x25d7('0x2b')]=_['keys'](db[_0x25d7('0x21')]['rawAttributes']);_0x2a1868['query']=_[_0x25d7('0x2c')](_0x34d638['query']);_0x2a1868[_0x25d7('0x2d')]=_[_0x25d7('0x2e')](_0x2a1868[_0x25d7('0x2b')],_0x2a1868[_0x25d7('0x28')]);_0x52a936['attributes']=_[_0x25d7('0x2e')](_0x2a1868[_0x25d7('0x2b')],qs[_0x25d7('0x2f')](_0x34d638[_0x25d7('0x28')][_0x25d7('0x2f')]));_0x52a936[_0x25d7('0x30')]=_0x52a936['attributes']['length']?_0x52a936['attributes']:_0x2a1868['model'];if(_0x34d638[_0x25d7('0x28')][_0x25d7('0x31')]){_0x52a936[_0x25d7('0x32')]=[{'all':!![]}];}_0x52a936=_[_0x25d7('0x33')]({},_0x52a936,_0x34d638[_0x25d7('0x34')]);return db['MailInteraction'][_0x25d7('0x35')](_0x52a936)[_0x25d7('0x1b')](handleEntityNotFound(_0x5c21f4,null))[_0x25d7('0x1b')](respondWithResult(_0x5c21f4,null))[_0x25d7('0x36')](handleError(_0x5c21f4,null));};exports[_0x25d7('0x37')]=function(_0x54697a,_0x4fc119){return db[_0x25d7('0x21')][_0x25d7('0x37')](_0x54697a['body'],{})[_0x25d7('0x1b')](respondWithResult(_0x4fc119,0xc9))[_0x25d7('0x36')](handleError(_0x4fc119,null));};exports['update']=function(_0x5f6915,_0x1f3181){if(_0x5f6915[_0x25d7('0x38')]['id']){delete _0x5f6915[_0x25d7('0x38')]['id'];}return db[_0x25d7('0x21')][_0x25d7('0x35')]({'where':{'id':_0x5f6915[_0x25d7('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1f3181,null))[_0x25d7('0x1b')](saveUpdates(_0x5f6915[_0x25d7('0x38')],null))[_0x25d7('0x1b')](respondWithResult(_0x1f3181,null))[_0x25d7('0x36')](handleError(_0x1f3181,null));};exports[_0x25d7('0x1c')]=function(_0x1a52b8,_0x4945a2){return db[_0x25d7('0x21')]['find']({'where':{'id':_0x1a52b8[_0x25d7('0x2a')]['id']}})[_0x25d7('0x1b')](handleEntityNotFound(_0x4945a2,null))[_0x25d7('0x1b')](removeEntity(_0x4945a2,null))[_0x25d7('0x36')](handleError(_0x4945a2,null));};exports[_0x25d7('0x39')]=function(_0x5cd622,_0x35ddad){return db['MailInteraction']['describe']()[_0x25d7('0x1b')](respondWithResult(_0x35ddad,null))[_0x25d7('0x36')](handleError(_0x35ddad,null));};exports[_0x25d7('0x3a')]=function(_0x37d998,_0x2e73ea){return db[_0x25d7('0x3b')][_0x25d7('0x35')]({'where':{'id':_0x37d998[_0x25d7('0x2a')]['id']}})[_0x25d7('0x1b')](handleEntityNotFound(_0x2e73ea,null))['then'](function(_0x49246a){if(_0x49246a){return _0x49246a['addMessage'](_0x37d998[_0x25d7('0x38')][_0x25d7('0x3c')],_[_0x25d7('0x3d')](_0x37d998[_0x25d7('0x38')],[_0x25d7('0x3c'),'id'])||{});}})[_0x25d7('0x1b')](respondWithResult(_0x2e73ea,null))[_0x25d7('0x36')](handleError(_0x2e73ea,null));};exports[_0x25d7('0x3e')]=function(_0x2f30e1,_0x3909a8){var _0x384336={'raw':![],'where':{}};var _0x297c48={};var _0x5c0bcd={'count':0x0,'rows':[]};return db[_0x25d7('0x21')][_0x25d7('0x3f')]({'where':{'id':_0x2f30e1['params']['id']}})[_0x25d7('0x1b')](handleEntityNotFound(_0x3909a8,null))[_0x25d7('0x1b')](function(_0x20ed99){if(_0x20ed99){_0x297c48['model']=_[_0x25d7('0x2c')](db[_0x25d7('0x3b')][_0x25d7('0x22')]);_0x297c48['query']=_[_0x25d7('0x2c')](_0x2f30e1[_0x25d7('0x28')]);_0x297c48[_0x25d7('0x2d')]=_[_0x25d7('0x2e')](_0x297c48['model'],_0x297c48[_0x25d7('0x28')]);_0x384336[_0x25d7('0x30')]=_[_0x25d7('0x2e')](_0x297c48[_0x25d7('0x2b')],qs[_0x25d7('0x2f')](_0x2f30e1[_0x25d7('0x28')][_0x25d7('0x2f')]));_0x384336['attributes']=_0x384336['attributes'][_0x25d7('0x40')]?_0x384336[_0x25d7('0x30')]:_0x297c48[_0x25d7('0x2b')];if(!_0x2f30e1[_0x25d7('0x28')][_0x25d7('0x41')](_0x25d7('0x42'))){_0x384336[_0x25d7('0x16')]=qs[_0x25d7('0x16')](_0x2f30e1[_0x25d7('0x28')]['limit']);_0x384336[_0x25d7('0x13')]=qs[_0x25d7('0x13')](_0x2f30e1[_0x25d7('0x28')]['offset']);}_0x384336[_0x25d7('0x43')]=qs[_0x25d7('0x44')](_0x2f30e1[_0x25d7('0x28')]['sort']);_0x384336[_0x25d7('0x45')]=qs[_0x25d7('0x2d')](_[_0x25d7('0x46')](_0x2f30e1[_0x25d7('0x28')],_0x297c48['filters']));_0x384336[_0x25d7('0x45')][_0x25d7('0x47')]=_0x20ed99['id'];if(_0x2f30e1[_0x25d7('0x28')][_0x25d7('0x48')]){_0x384336['where']=_['merge'](_0x384336[_0x25d7('0x45')],{'$or':_['map'](_0x384336['attributes'],function(_0x56058a){var _0x2ba8af={};_0x2ba8af[_0x56058a]={'$like':'%'+_0x2f30e1['query'][_0x25d7('0x48')]+'%'};return _0x2ba8af;})});}if(_0x2f30e1[_0x25d7('0x28')]['$gte']){var _0x5f0ec9=_0x2f30e1[_0x25d7('0x28')][_0x25d7('0x49')]['split'](',');var _0x3ecd0c={};_0x3ecd0c[_0x5f0ec9[0x0]]={'$gte':moment(_0x5f0ec9[0x1])[_0x25d7('0x4a')](_0x25d7('0x4b'))};_0x384336['where']=_['merge'](_0x384336['where'],_0x3ecd0c);}_0x384336=_[_0x25d7('0x33')]({},_0x384336,_0x2f30e1[_0x25d7('0x34')]);return db[_0x25d7('0x3b')][_0x25d7('0x15')]({'where':_0x384336[_0x25d7('0x45')]})[_0x25d7('0x1b')](function(_0x44eb0c){_0x5c0bcd[_0x25d7('0x15')]=_0x44eb0c;if(_0x2f30e1[_0x25d7('0x28')]['includeAll']){_0x384336[_0x25d7('0x32')]=[{'all':!![]}];}return db[_0x25d7('0x3b')][_0x25d7('0x27')](_0x384336);})[_0x25d7('0x1b')](function(_0xab8bb6){if(_0x2f30e1[_0x25d7('0x28')][_0x25d7('0x4c')]===_0x25d7('0x4d')){for(var _0x41ec8e=0x0;_0x41ec8e<_0xab8bb6['length'];_0x41ec8e++){_0xab8bb6[_0x41ec8e][_0x25d7('0x38')]=juice(_0xab8bb6[_0x41ec8e][_0x25d7('0x38')]);}}_0x5c0bcd['rows']=_0xab8bb6;return _0x5c0bcd;});}})[_0x25d7('0x1b')](respondWithFilteredResult(_0x3909a8,_0x384336))[_0x25d7('0x36')](handleError(_0x3909a8,null));};exports[_0x25d7('0x4e')]=function(_0xac8df7,_0x4f050e){return db['MailInteraction'][_0x25d7('0x35')]({'where':{'id':_0xac8df7[_0x25d7('0x2a')]['id']}})[_0x25d7('0x1b')](handleEntityNotFound(_0x4f050e,null))[_0x25d7('0x1b')](function(_0x33306d){if(_0x33306d){return _0x33306d[_0x25d7('0x4f')](_0xac8df7[_0x25d7('0x38')][_0x25d7('0x3c')],_['omit'](_0xac8df7[_0x25d7('0x38')],[_0x25d7('0x3c'),'id'])||{})[_0x25d7('0x50')](function(){return db['Tag'][_0x25d7('0x27')]({'attributes':['id','name',_0x25d7('0x51')],'where':{'id':_0xac8df7['body']['ids']}});})['then'](function(_0x38e028){socket[_0x25d7('0x52')](_0x25d7('0x53'),{'id':Number(_0xac8df7[_0x25d7('0x2a')]['id']),'tags':_0x38e028||[]});return{'id':Number(_0xac8df7[_0x25d7('0x2a')]['id']),'tags':_0x38e028||[]};});}})['then'](respondWithResult(_0x4f050e,null))[_0x25d7('0x36')](handleError(_0x4f050e,null));};exports[_0x25d7('0x54')]=function(_0x342fe6,_0x57cf14){return db['MailInteraction']['find']({'where':{'id':_0x342fe6['params']['id']}})['then'](handleEntityNotFound(_0x57cf14,null))[_0x25d7('0x1b')](function(_0x1b565e){if(_0x1b565e){return _0x1b565e[_0x25d7('0x54')](_0x342fe6['query'][_0x25d7('0x3c')]);}})[_0x25d7('0x1b')](respondWithStatusCode(_0x57cf14,null))[_0x25d7('0x36')](handleError(_0x57cf14,null));};exports[_0x25d7('0x55')]=function(_0x5525d5,_0x317913){var _0x2938d8=moment()[_0x25d7('0x56')]()[_0x25d7('0x57')]();var _0x412b98=path[_0x25d7('0x58')](config[_0x25d7('0x59')],_0x25d7('0x5a'),'files',_0x25d7('0x5b'));var _0x41dd32=path[_0x25d7('0x58')](config['root'],_0x25d7('0x5a'),_0x25d7('0x5c'),'attachments');var _0x12f875=path[_0x25d7('0x58')](_0x412b98,_0x2938d8);var _0x4dee86=util[_0x25d7('0x4a')]('transcript-%d-%s.zip',_0x5525d5[_0x25d7('0x2a')]['id'],_0x2938d8);var _0x3641f9=path[_0x25d7('0x58')](_0x412b98,_0x4dee86);var _0xc80842=[];if(_0x5525d5[_0x25d7('0x28')][_0x25d7('0x5d')]){_0xc80842[_0x25d7('0x5e')]({'model':db[_0x25d7('0x5f')],'as':_0x25d7('0x60'),'raw':!![]});}var _0xf5afca=[{'model':db[_0x25d7('0x3b')],'as':_0x25d7('0x61'),'attributes':['id','body',_0x25d7('0x62'),'to','cc',_0x25d7('0x63'),_0x25d7('0x64'),_0x25d7('0x65')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0xc80842}];return db[_0x25d7('0x21')][_0x25d7('0x35')]({'where':{'id':_0x5525d5[_0x25d7('0x2a')]['id']},'include':_0xf5afca})[_0x25d7('0x1b')](handleEntityNotFound(_0x317913,null))[_0x25d7('0x1b')](function(_0x325ff7){if(_0x325ff7&&_0x325ff7[_0x25d7('0x61')]){var _0x1f697c=_0x325ff7['get']({'plain':!![]});fs['mkdirSync'](_0x12f875);return BPromise[_0x25d7('0x66')](_0x1f697c[_0x25d7('0x61')],function(_0x294b4e,_0x3d37b2){var _0x2e71d2={'from':_0x294b4e['from'],'to':_0x294b4e['to']||_0x25d7('0x67'),'subject':_0x294b4e[_0x25d7('0x64')],'html':htmlEntities[_0x25d7('0x68')](_0x294b4e[_0x25d7('0x38')]),'headers':{'Date':moment(_0x294b4e[_0x25d7('0x65')])[_0x25d7('0x4a')](_0x25d7('0x69'))},'attachments':[]};if(_0x294b4e['cc']){_0x2e71d2['headers']['Cc']=_0x294b4e['cc'];}if(_0x294b4e[_0x25d7('0x63')]){_0x2e71d2['headers'][_0x25d7('0x6a')]=_0x294b4e[_0x25d7('0x63')];}return new BPromise(function(_0x42a898,_0x3393aa){if(_0x294b4e[_0x25d7('0x60')]){for(var _0x17abd1=0x0;_0x17abd1<_0x294b4e[_0x25d7('0x60')][_0x25d7('0x40')];_0x17abd1++){var _0x45a292=_0x294b4e['Attachments'][_0x17abd1];var _0x4ab1c4=path[_0x25d7('0x58')](_0x41dd32,_0x45a292[_0x25d7('0x6b')]);if(fs[_0x25d7('0x6c')](_0x4ab1c4)){_0x2e71d2[_0x25d7('0x5d')][_0x25d7('0x5e')]({'name':_0x45a292['name'],'contentType':_0x45a292[_0x25d7('0x24')],'data':fs['readFileSync'](_0x4ab1c4)});}}}emlformat[_0x25d7('0x6d')](_0x2e71d2,function(_0x12e4c3,_0x167d8b){if(_0x12e4c3)return _0x3393aa(_0x12e4c3);fs[_0x25d7('0x6e')](path[_0x25d7('0x58')](_0x12f875,util[_0x25d7('0x4a')](_0x25d7('0x6f'),_0x3d37b2)),_0x167d8b);return _0x42a898(_0x167d8b);});});})[_0x25d7('0x1b')](function(){return new BPromise(function(_0x53c878,_0x329b6b){zipdir(_0x12f875,{'saveTo':_0x3641f9},function(_0x432056,_0xdc83b0){if(_0x432056)return _0x329b6b(_0x432056);return _0x53c878(_0xdc83b0);});})[_0x25d7('0x1b')](function(){return new BPromise(function(_0xd2d6df,_0x14017a){rimraf(_0x12f875,function(_0xe3edde){if(_0xe3edde)_0x14017a(_0xe3edde);return _0xd2d6df();});});})[_0x25d7('0x1b')](function(){return _0x317913[_0x25d7('0x55')](_0x3641f9,_0x4dee86,function(_0x4c8077){if(!_0x4c8077)fs[_0x25d7('0x70')](_0x3641f9);});});});}else{return _0x317913['sendStatus'](0xc8);}})[_0x25d7('0x36')](handleError(_0x317913,null));}; \ No newline at end of file +var _0x1098=['nolimit','order','sort','where','pick','MailInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','rows','addTags','setTags','color','emit','removeTags','download','unix','toString','root','server','tmp','join','files','transcript-%d-%s.zip','attachments','push','Messages','bcc','createdAt','from','missing.recipient@your.company.com','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','readFileSync','build','writeFileSync','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','lodash','juice','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','json','offset','count','limit','Content-Range','then','destroy','end','error','stack','name','send','map','MailInteraction','rawAttributes','fieldName','type','key','getOptions','mail','query','user','catch','show','params','keys','intersection','attributes','model','fields','length','includeAll','include','merge','options','find','create','body','describe','MailMessage','addMessage','ids','omit','getMessages','filters','hasOwnProperty'];(function(_0x36f3f3,_0x555fd4){var _0x115842=function(_0x14e220){while(--_0x14e220){_0x36f3f3['push'](_0x36f3f3['shift']());}};_0x115842(++_0x555fd4);}(_0x1098,0x10b));var _0x8109=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1098[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8109('0x0'));var rimraf=require(_0x8109('0x1'));var zipdir=require(_0x8109('0x2'));var moment=require(_0x8109('0x3'));var BPromise=require(_0x8109('0x4'));var util=require(_0x8109('0x5'));var path=require('path');var fs=require('fs');var _=require(_0x8109('0x6'));var juice=require(_0x8109('0x7'));var Redis=require(_0x8109('0x8'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var logger=require(_0x8109('0x9'))('api');var config=require(_0x8109('0xa'));var db=require(_0x8109('0xb'))['db'];var htmlEntities=require('html-entities');config[_0x8109('0xc')]=_[_0x8109('0xd')](config['redis'],{'host':_0x8109('0xe'),'port':0x18eb});var socket=require(_0x8109('0xf'))(new Redis(config[_0x8109('0xc')]));require(_0x8109('0x10'))[_0x8109('0x11')](socket);function respondWithStatusCode(_0x26ec91,_0x4a59b7){_0x4a59b7=_0x4a59b7||0xcc;return function(_0xbaaa7e){if(_0xbaaa7e){return _0x26ec91[_0x8109('0x12')](_0x4a59b7);}return _0x26ec91[_0x8109('0x13')](_0x4a59b7)['end']();};}function respondWithResult(_0x58600c,_0x4be75d){_0x4be75d=_0x4be75d||0xc8;return function(_0x305c75){if(_0x305c75){return _0x58600c['status'](_0x4be75d)[_0x8109('0x14')](_0x305c75);}};}function respondWithFilteredResult(_0x17cc75,_0x24d64c){return function(_0x29d3c4){if(_0x29d3c4){var _0x3a1f3c=typeof _0x24d64c[_0x8109('0x15')]==='undefined'&&typeof _0x24d64c['limit']==='undefined';var _0x31f6ad=_0x29d3c4[_0x8109('0x16')];var _0x26fbc3=_0x3a1f3c?0x0:_0x24d64c[_0x8109('0x15')];var _0x538f7e=_0x3a1f3c?_0x29d3c4[_0x8109('0x16')]:_0x24d64c[_0x8109('0x15')]+_0x24d64c[_0x8109('0x17')];var _0x36be85;if(_0x538f7e>=_0x31f6ad){_0x538f7e=_0x31f6ad;_0x36be85=0xc8;}else{_0x36be85=0xce;}_0x17cc75['status'](_0x36be85);return _0x17cc75['set'](_0x8109('0x18'),_0x26fbc3+'-'+_0x538f7e+'/'+_0x31f6ad)[_0x8109('0x14')](_0x29d3c4);}return null;};}function saveUpdates(_0x29b088){return function(_0x5d28a3){if(_0x5d28a3){return _0x5d28a3['update'](_0x29b088)[_0x8109('0x19')](function(_0x35c06a){return _0x35c06a;});}return null;};}function removeEntity(_0x383060){return function(_0x34bec5){if(_0x34bec5){return _0x34bec5[_0x8109('0x1a')]()['then'](function(){_0x383060[_0x8109('0x13')](0xcc)[_0x8109('0x1b')]();});}};}function handleEntityNotFound(_0x4ae963){return function(_0x3be128){if(!_0x3be128){_0x4ae963[_0x8109('0x12')](0x194);}return _0x3be128;};}function handleError(_0x2abf4d,_0x282be9){_0x282be9=_0x282be9||0x1f4;return function(_0x40c986){logger[_0x8109('0x1c')](_0x40c986[_0x8109('0x1d')]);if(_0x40c986[_0x8109('0x1e')]){delete _0x40c986[_0x8109('0x1e')];}_0x2abf4d[_0x8109('0x13')](_0x282be9)[_0x8109('0x1f')](_0x40c986);};}exports['index']=function(_0x55329b,_0x10f059){var _0x203346={};var _0x93e01d=_[_0x8109('0x20')](db[_0x8109('0x21')][_0x8109('0x22')],function(_0x20329e){return{'name':_0x20329e[_0x8109('0x23')],'type':_0x20329e[_0x8109('0x24')][_0x8109('0x25')]};});_0x203346=qs[_0x8109('0x26')](_0x93e01d,_0x55329b);return interaction['findAll'](_0x8109('0x27'),_0x55329b[_0x8109('0x28')],_0x55329b[_0x8109('0x29')],_0x203346,_0x93e01d)[_0x8109('0x19')](respondWithFilteredResult(_0x10f059,_0x203346))[_0x8109('0x2a')](handleError(_0x10f059,null));};exports[_0x8109('0x2b')]=function(_0x264bcf,_0x436c10){var _0x1462a3={'raw':![],'where':{'id':_0x264bcf[_0x8109('0x2c')]['id']}},_0x25084e={};_0x25084e['model']=_[_0x8109('0x2d')](db[_0x8109('0x21')][_0x8109('0x22')]);_0x25084e['query']=_[_0x8109('0x2d')](_0x264bcf[_0x8109('0x28')]);_0x25084e['filters']=_[_0x8109('0x2e')](_0x25084e['model'],_0x25084e[_0x8109('0x28')]);_0x1462a3[_0x8109('0x2f')]=_[_0x8109('0x2e')](_0x25084e[_0x8109('0x30')],qs[_0x8109('0x31')](_0x264bcf[_0x8109('0x28')][_0x8109('0x31')]));_0x1462a3['attributes']=_0x1462a3[_0x8109('0x2f')][_0x8109('0x32')]?_0x1462a3[_0x8109('0x2f')]:_0x25084e[_0x8109('0x30')];if(_0x264bcf[_0x8109('0x28')][_0x8109('0x33')]){_0x1462a3[_0x8109('0x34')]=[{'all':!![]}];}_0x1462a3=_[_0x8109('0x35')]({},_0x1462a3,_0x264bcf[_0x8109('0x36')]);return db[_0x8109('0x21')][_0x8109('0x37')](_0x1462a3)[_0x8109('0x19')](handleEntityNotFound(_0x436c10,null))[_0x8109('0x19')](respondWithResult(_0x436c10,null))['catch'](handleError(_0x436c10,null));};exports[_0x8109('0x38')]=function(_0x42731f,_0x1f2875){return db[_0x8109('0x21')][_0x8109('0x38')](_0x42731f['body'],{})[_0x8109('0x19')](respondWithResult(_0x1f2875,0xc9))['catch'](handleError(_0x1f2875,null));};exports['update']=function(_0x556d88,_0x404e67){if(_0x556d88[_0x8109('0x39')]['id']){delete _0x556d88[_0x8109('0x39')]['id'];}return db[_0x8109('0x21')][_0x8109('0x37')]({'where':{'id':_0x556d88[_0x8109('0x2c')]['id']}})[_0x8109('0x19')](handleEntityNotFound(_0x404e67,null))[_0x8109('0x19')](saveUpdates(_0x556d88[_0x8109('0x39')],null))[_0x8109('0x19')](respondWithResult(_0x404e67,null))['catch'](handleError(_0x404e67,null));};exports[_0x8109('0x1a')]=function(_0x469d64,_0xc804cd){return db['MailInteraction'][_0x8109('0x37')]({'where':{'id':_0x469d64[_0x8109('0x2c')]['id']}})[_0x8109('0x19')](handleEntityNotFound(_0xc804cd,null))[_0x8109('0x19')](removeEntity(_0xc804cd,null))[_0x8109('0x2a')](handleError(_0xc804cd,null));};exports[_0x8109('0x3a')]=function(_0x12f77f,_0xdfb9b3){return db['MailInteraction'][_0x8109('0x3a')]()[_0x8109('0x19')](respondWithResult(_0xdfb9b3,null))['catch'](handleError(_0xdfb9b3,null));};exports['addMessage']=function(_0x263073,_0x1eaa62){return db[_0x8109('0x3b')][_0x8109('0x37')]({'where':{'id':_0x263073[_0x8109('0x2c')]['id']}})[_0x8109('0x19')](handleEntityNotFound(_0x1eaa62,null))[_0x8109('0x19')](function(_0x5b7f0f){if(_0x5b7f0f){return _0x5b7f0f[_0x8109('0x3c')](_0x263073[_0x8109('0x39')][_0x8109('0x3d')],_[_0x8109('0x3e')](_0x263073['body'],[_0x8109('0x3d'),'id'])||{});}})[_0x8109('0x19')](respondWithResult(_0x1eaa62,null))[_0x8109('0x2a')](handleError(_0x1eaa62,null));};exports[_0x8109('0x3f')]=function(_0x4d72e5,_0x36b096){var _0x5d5da2={'raw':![],'where':{}};var _0x4e82ad={};var _0x31ef30={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x4d72e5['params']['id']}})[_0x8109('0x19')](handleEntityNotFound(_0x36b096,null))[_0x8109('0x19')](function(_0x18710a){if(_0x18710a){_0x4e82ad['model']=_[_0x8109('0x2d')](db[_0x8109('0x3b')]['rawAttributes']);_0x4e82ad[_0x8109('0x28')]=_[_0x8109('0x2d')](_0x4d72e5[_0x8109('0x28')]);_0x4e82ad[_0x8109('0x40')]=_[_0x8109('0x2e')](_0x4e82ad['model'],_0x4e82ad[_0x8109('0x28')]);_0x5d5da2[_0x8109('0x2f')]=_[_0x8109('0x2e')](_0x4e82ad['model'],qs[_0x8109('0x31')](_0x4d72e5[_0x8109('0x28')][_0x8109('0x31')]));_0x5d5da2[_0x8109('0x2f')]=_0x5d5da2[_0x8109('0x2f')][_0x8109('0x32')]?_0x5d5da2[_0x8109('0x2f')]:_0x4e82ad[_0x8109('0x30')];if(!_0x4d72e5[_0x8109('0x28')][_0x8109('0x41')](_0x8109('0x42'))){_0x5d5da2['limit']=qs[_0x8109('0x17')](_0x4d72e5[_0x8109('0x28')][_0x8109('0x17')]);_0x5d5da2[_0x8109('0x15')]=qs[_0x8109('0x15')](_0x4d72e5[_0x8109('0x28')][_0x8109('0x15')]);}_0x5d5da2[_0x8109('0x43')]=qs[_0x8109('0x44')](_0x4d72e5[_0x8109('0x28')][_0x8109('0x44')]);_0x5d5da2[_0x8109('0x45')]=qs[_0x8109('0x40')](_[_0x8109('0x46')](_0x4d72e5[_0x8109('0x28')],_0x4e82ad[_0x8109('0x40')]));_0x5d5da2[_0x8109('0x45')][_0x8109('0x47')]=_0x18710a['id'];if(_0x4d72e5[_0x8109('0x28')][_0x8109('0x48')]){_0x5d5da2[_0x8109('0x45')]=_[_0x8109('0x35')](_0x5d5da2['where'],{'$or':_['map'](_0x5d5da2[_0x8109('0x2f')],function(_0x411455){var _0x366bb4={};_0x366bb4[_0x411455]={'$like':'%'+_0x4d72e5[_0x8109('0x28')][_0x8109('0x48')]+'%'};return _0x366bb4;})});}if(_0x4d72e5['query'][_0x8109('0x49')]){var _0x3b3398=_0x4d72e5[_0x8109('0x28')]['$gte']['split'](',');var _0x5a3c88={};_0x5a3c88[_0x3b3398[0x0]]={'$gte':moment(_0x3b3398[0x1])[_0x8109('0x4a')](_0x8109('0x4b'))};_0x5d5da2[_0x8109('0x45')]=_['merge'](_0x5d5da2[_0x8109('0x45')],_0x5a3c88);}_0x5d5da2=_['merge']({},_0x5d5da2,_0x4d72e5[_0x8109('0x36')]);return db[_0x8109('0x3b')][_0x8109('0x16')]({'where':_0x5d5da2['where']})['then'](function(_0x5a84ee){_0x31ef30[_0x8109('0x16')]=_0x5a84ee;if(_0x4d72e5[_0x8109('0x28')][_0x8109('0x33')]){_0x5d5da2[_0x8109('0x34')]=[{'all':!![]}];}return db['MailMessage'][_0x8109('0x4c')](_0x5d5da2);})[_0x8109('0x19')](function(_0x1d51f0){if(_0x4d72e5[_0x8109('0x28')][_0x8109('0x4d')]===_0x8109('0x4e')){for(var _0x37a2e7=0x0;_0x37a2e7<_0x1d51f0[_0x8109('0x32')];_0x37a2e7++){_0x1d51f0[_0x37a2e7][_0x8109('0x39')]=juice(_0x1d51f0[_0x37a2e7]['body']);}}_0x31ef30[_0x8109('0x4f')]=_0x1d51f0;return _0x31ef30;});}})[_0x8109('0x19')](respondWithFilteredResult(_0x36b096,_0x5d5da2))[_0x8109('0x2a')](handleError(_0x36b096,null));};exports[_0x8109('0x50')]=function(_0x52eba1,_0x21d8a0){return db[_0x8109('0x21')][_0x8109('0x37')]({'where':{'id':_0x52eba1[_0x8109('0x2c')]['id']}})[_0x8109('0x19')](handleEntityNotFound(_0x21d8a0,null))['then'](function(_0x2d7a57){if(_0x2d7a57){return _0x2d7a57[_0x8109('0x51')](_0x52eba1[_0x8109('0x39')][_0x8109('0x3d')],_[_0x8109('0x3e')](_0x52eba1[_0x8109('0x39')],['ids','id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x8109('0x1e'),_0x8109('0x52')],'where':{'id':_0x52eba1[_0x8109('0x39')][_0x8109('0x3d')]}});})['then'](function(_0x37ba68){socket[_0x8109('0x53')]('mailInteractionTags:save',{'id':Number(_0x52eba1[_0x8109('0x2c')]['id']),'tags':_0x37ba68||[]});return{'id':Number(_0x52eba1[_0x8109('0x2c')]['id']),'tags':_0x37ba68||[]};});}})[_0x8109('0x19')](respondWithResult(_0x21d8a0,null))[_0x8109('0x2a')](handleError(_0x21d8a0,null));};exports[_0x8109('0x54')]=function(_0x4ece83,_0x24b47d){return db[_0x8109('0x21')]['find']({'where':{'id':_0x4ece83[_0x8109('0x2c')]['id']}})['then'](handleEntityNotFound(_0x24b47d,null))[_0x8109('0x19')](function(_0x4199eb){if(_0x4199eb){return _0x4199eb[_0x8109('0x54')](_0x4ece83[_0x8109('0x28')][_0x8109('0x3d')]);}})[_0x8109('0x19')](respondWithStatusCode(_0x24b47d,null))[_0x8109('0x2a')](handleError(_0x24b47d,null));};exports[_0x8109('0x55')]=function(_0x422f4d,_0x16e3b9){var _0x1737bc=moment()[_0x8109('0x56')]()[_0x8109('0x57')]();var _0x4e700b=path['join'](config[_0x8109('0x58')],_0x8109('0x59'),'files',_0x8109('0x5a'));var _0x2df27c=path[_0x8109('0x5b')](config['root'],_0x8109('0x59'),_0x8109('0x5c'),'attachments');var _0x2614b5=path['join'](_0x4e700b,_0x1737bc);var _0x1694f9=util[_0x8109('0x4a')](_0x8109('0x5d'),_0x422f4d[_0x8109('0x2c')]['id'],_0x1737bc);var _0x139813=path[_0x8109('0x5b')](_0x4e700b,_0x1694f9);var _0x1e9bab=[];if(_0x422f4d['query'][_0x8109('0x5e')]){_0x1e9bab[_0x8109('0x5f')]({'model':db['Attachment'],'as':'Attachments','raw':!![]});}var _0x2a0d18=[{'model':db[_0x8109('0x3b')],'as':_0x8109('0x60'),'attributes':['id',_0x8109('0x39'),'from','to','cc',_0x8109('0x61'),'subject',_0x8109('0x62')],'where':{'secret':![]},'order':qs[_0x8109('0x44')]('id'),'include':_0x1e9bab}];return db['MailInteraction']['find']({'where':{'id':_0x422f4d[_0x8109('0x2c')]['id']},'include':_0x2a0d18})[_0x8109('0x19')](handleEntityNotFound(_0x16e3b9,null))[_0x8109('0x19')](function(_0x19deeb){if(_0x19deeb&&_0x19deeb[_0x8109('0x60')]){var _0x46a940=_0x19deeb['get']({'plain':!![]});fs['mkdirSync'](_0x2614b5);return BPromise['each'](_0x46a940['Messages'],function(_0x1addbe,_0x403a7d){var _0x2ac638={'from':_0x1addbe[_0x8109('0x63')],'to':_0x1addbe['to']||_0x8109('0x64'),'subject':_0x1addbe[_0x8109('0x65')],'html':htmlEntities['decode'](_0x1addbe[_0x8109('0x39')]),'headers':{'Date':moment(_0x1addbe[_0x8109('0x62')])['format'](_0x8109('0x66'))},'attachments':[]};if(_0x1addbe['cc']){_0x2ac638[_0x8109('0x67')]['Cc']=_0x1addbe['cc'];}if(_0x1addbe[_0x8109('0x61')]){_0x2ac638[_0x8109('0x67')][_0x8109('0x68')]=_0x1addbe[_0x8109('0x61')];}return new BPromise(function(_0x2f3427,_0x4284a9){if(_0x1addbe[_0x8109('0x69')]){for(var _0x4dc5e6=0x0;_0x4dc5e6<_0x1addbe[_0x8109('0x69')]['length'];_0x4dc5e6++){var _0x3e043=_0x1addbe['Attachments'][_0x4dc5e6];var _0x248d3f=path['join'](_0x2df27c,_0x3e043['basename']);if(fs[_0x8109('0x6a')](_0x248d3f)){_0x2ac638['attachments']['push']({'name':_0x3e043[_0x8109('0x1e')],'contentType':_0x3e043[_0x8109('0x24')],'data':fs[_0x8109('0x6b')](_0x248d3f)});}}}emlformat[_0x8109('0x6c')](_0x2ac638,function(_0x207c67,_0x5199d1){if(_0x207c67)return _0x4284a9(_0x207c67);fs[_0x8109('0x6d')](path['join'](_0x2614b5,util[_0x8109('0x4a')]('message%d.eml',_0x403a7d)),_0x5199d1);return _0x2f3427(_0x5199d1);});});})[_0x8109('0x19')](function(){return new BPromise(function(_0x19e12d,_0x4e5cc5){zipdir(_0x2614b5,{'saveTo':_0x139813},function(_0x58d938,_0x544e45){if(_0x58d938)return _0x4e5cc5(_0x58d938);return _0x19e12d(_0x544e45);});})['then'](function(){return new BPromise(function(_0x2c2b89,_0x346f6c){rimraf(_0x2614b5,function(_0x806d7c){if(_0x806d7c)_0x346f6c(_0x806d7c);return _0x2c2b89();});});})[_0x8109('0x19')](function(){return _0x16e3b9[_0x8109('0x55')](_0x139813,_0x1694f9,function(_0x122a30){if(!_0x122a30)fs[_0x8109('0x6e')](_0x139813);});});});}else{return _0x16e3b9[_0x8109('0x12')](0xc8);}})[_0x8109('0x2a')](handleError(_0x16e3b9,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 04fd35c..b205732 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 _0xe19d=['findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','update','remove','map'];(function(_0x46d274,_0x543bde){var _0x48c259=function(_0x58e9aa){while(--_0x58e9aa){_0x46d274['push'](_0x46d274['shift']());}};_0x48c259(++_0x543bde);}(_0xe19d,0x1a9));var _0xde19=function(_0x1f504c,_0x319b4f){_0x1f504c=_0x1f504c-0x0;var _0x50d2e6=_0xe19d[_0x1f504c];return _0x50d2e6;};'use strict';var EventEmitter=require(_0xde19('0x0'));var MailInteraction=require(_0xde19('0x1'))['db']['MailInteraction'];var MailMessage=require(_0xde19('0x1'))['db'][_0xde19('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xde19('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xde19('0x4'),'afterDestroy':_0xde19('0x5')};function emitEvent(_0x1afde9){return function(_0x46d7f4,_0x16bc99,_0x250257){_0x46d7f4['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x3b7d63){_0x46d7f4['setDataValue']('Users',_0x3b7d63[_0xde19('0x6')](function(_0x334718){return{'id':_0x334718['id']};}));return MailMessage[_0xde19('0x7')]({'where':{'MailInteractionId':_0x46d7f4['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x59a301){_0x46d7f4[_0xde19('0x8')](_0xde19('0x9'),_0x59a301[_0xde19('0xa')]);MailInteractionEvents[_0xde19('0xb')](_0x1afde9+':'+_0x46d7f4['id'],_0x46d7f4);MailInteractionEvents[_0xde19('0xb')](_0x1afde9,_0x46d7f4);_0x250257(null);})[_0xde19('0xc')](_0x250257(null));};}for(var e in events){if(events[_0xde19('0xd')](e)){var event=events[e];MailInteraction[_0xde19('0xe')](e,emitEvent(event));}}module[_0xde19('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0xee0e=['emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','update','remove','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x4347ec,_0x41c4b8){var _0x4c8314=function(_0x583acd){while(--_0x583acd){_0x4347ec['push'](_0x4347ec['shift']());}};_0x4c8314(++_0x41c4b8);}(_0xee0e,0x71));var _0xeee0=function(_0x31991b,_0xaf75d2){_0x31991b=_0x31991b-0x0;var _0x307304=_0xee0e[_0x31991b];return _0x307304;};'use strict';var EventEmitter=require(_0xeee0('0x0'));var MailInteraction=require(_0xeee0('0x1'))['db'][_0xeee0('0x2')];var MailMessage=require(_0xeee0('0x1'))['db'][_0xeee0('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xeee0('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xeee0('0x5'),'afterDestroy':_0xeee0('0x6')};function emitEvent(_0x195dba){return function(_0x43efd9,_0x1ddffe,_0x58ccbb){_0x43efd9['getUsers']({'attributes':['id'],'raw':!![]})[_0xeee0('0x7')](function(_0x16dde9){_0x43efd9[_0xeee0('0x8')](_0xeee0('0x9'),_0x16dde9[_0xeee0('0xa')](function(_0x33f7ec){return{'id':_0x33f7ec['id']};}));return MailMessage[_0xeee0('0xb')]({'where':{'MailInteractionId':_0x43efd9['id'],'direction':'in','read':![]},'raw':!![]});})[_0xeee0('0x7')](function(_0x54d430){_0x43efd9[_0xeee0('0x8')](_0xeee0('0xc'),_0x54d430['length']);MailInteractionEvents['emit'](_0x195dba+':'+_0x43efd9['id'],_0x43efd9);MailInteractionEvents[_0xeee0('0xd')](_0x195dba,_0x43efd9);_0x58ccbb(null);})[_0xeee0('0xe')](_0x58ccbb(null));};}for(var e in events){if(events[_0xeee0('0xf')](e)){var event=events[e];MailInteraction[_0xeee0('0x10')](e,emitEvent(event));}}module[_0xeee0('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 098a7d3..ebf325d 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 _0xa23e=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','models','get','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1d4bdb,_0x58f77b){var _0x288bea=function(_0x4a1630){while(--_0x4a1630){_0x1d4bdb['push'](_0x1d4bdb['shift']());}};_0x288bea(++_0x58f77b);}(_0xa23e,0xe9));var _0xea23=function(_0x57178d,_0x26571a){_0x57178d=_0x57178d-0x0;var _0x50ca72=_0xa23e[_0x57178d];return _0x50ca72;};'use strict';var _=require(_0xea23('0x0'));var util=require('util');var logger=require(_0xea23('0x1'))(_0xea23('0x2'));var moment=require(_0xea23('0x3'));var BPromise=require(_0xea23('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea23('0x5'));var rimraf=require(_0xea23('0x6'));var config=require(_0xea23('0x7'));var attributes=require(_0xea23('0x8'));module[_0xea23('0x9')]=function(_0x26b985,_0x4923bf){return _0x26b985[_0xea23('0xa')](_0xea23('0xb'),attributes,{'tableName':_0xea23('0xc'),'paranoid':![],'indexes':[{'name':_0xea23('0xd'),'fields':['subject','to'],'type':_0xea23('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5ded9b,_0x1a8892,_0x135df2){if(_0x5ded9b[_0xea23('0xf')]){_0x5ded9b[_0xea23('0x10')]=moment()[_0xea23('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5ded9b[_0xea23('0x12')]){_0x5ded9b[_0xea23('0x13')]=moment()[_0xea23('0x11')](_0xea23('0x14'));}_0x135df2(null,_0x1a8892);},'beforeUpdate':function(_0x3b24b4,_0x279e84,_0x55238d){if(_0x3b24b4[_0xea23('0x15')](_0xea23('0xf'))){_0x3b24b4[_0xea23('0x10')]=_0x3b24b4[_0xea23('0xf')]?moment()[_0xea23('0x11')](_0xea23('0x14')):null;}if(_0x3b24b4[_0xea23('0x15')](_0xea23('0x12'))){_0x3b24b4[_0xea23('0x13')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3b24b4[_0xea23('0xf')]=null;_0x3b24b4[_0xea23('0x10')]=null;}_0x55238d(null,_0x3b24b4);},'afterUpdate':function(_0x3691d8,_0x1850b6,_0x55722e){var _0x4685f8=_0x26b985[_0xea23('0x16')];var _0x1635cb=_0x3691d8[_0xea23('0x17')]({'plain':!![]});if(_0x1635cb[_0xea23('0x12')]){return _0x4685f8['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x1635cb['id']}})['then'](function(){_0x55722e();})['catch'](function(_0x18bc50){_0x55722e(_0x18bc50);});}else{_0x55722e();}}},'charset':_0xea23('0x18'),'collate':_0xea23('0x19')});}; \ No newline at end of file +var _0xda61=['changed','substatusAt','closedAt','models','get','MailMessage','update','then','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','../../config/environment','./mailInteraction.attributes','define','MailInteraction','mail_interactions','subject','FULLTEXT','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closed'];(function(_0xc5a279,_0x155360){var _0xc755d3=function(_0x15051c){while(--_0x15051c){_0xc5a279['push'](_0xc5a279['shift']());}};_0xc755d3(++_0x155360);}(_0xda61,0x1de));var _0x1da6=function(_0x3e4811,_0x509c4e){_0x3e4811=_0x3e4811-0x0;var _0x37abad=_0xda61[_0x3e4811];return _0x37abad;};'use strict';var _=require(_0x1da6('0x0'));var util=require(_0x1da6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1da6('0x2'));var BPromise=require(_0x1da6('0x3'));var rp=require(_0x1da6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1da6('0x5'));var attributes=require(_0x1da6('0x6'));module['exports']=function(_0x729e37,_0x1b1220){return _0x729e37[_0x1da6('0x7')](_0x1da6('0x8'),attributes,{'tableName':_0x1da6('0x9'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x1da6('0xa'),'to'],'type':_0x1da6('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x28ce98,_0x14c4c3,_0x35845e){if(_0x28ce98[_0x1da6('0xc')]){_0x28ce98['substatusAt']=moment()[_0x1da6('0xd')](_0x1da6('0xe'));}if(_0x28ce98[_0x1da6('0xf')]){_0x28ce98['closedAt']=moment()[_0x1da6('0xd')](_0x1da6('0xe'));}_0x35845e(null,_0x14c4c3);},'beforeUpdate':function(_0x2c6303,_0x1c72b7,_0x38a628){if(_0x2c6303[_0x1da6('0x10')](_0x1da6('0xc'))){_0x2c6303[_0x1da6('0x11')]=_0x2c6303[_0x1da6('0xc')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x2c6303[_0x1da6('0x10')](_0x1da6('0xf'))){_0x2c6303[_0x1da6('0x12')]=moment()[_0x1da6('0xd')](_0x1da6('0xe'));_0x2c6303[_0x1da6('0xc')]=null;_0x2c6303[_0x1da6('0x11')]=null;}_0x38a628(null,_0x2c6303);},'afterUpdate':function(_0x44448b,_0x4974fa,_0x52de81){var _0x90e589=_0x729e37[_0x1da6('0x13')];var _0x102642=_0x44448b[_0x1da6('0x14')]({'plain':!![]});if(_0x102642[_0x1da6('0xf')]){return _0x90e589[_0x1da6('0x15')][_0x1da6('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x102642['id']}})[_0x1da6('0x17')](function(){_0x52de81();})['catch'](function(_0x46e7a8){_0x52de81(_0x46e7a8);});}else{_0x52de81();}}},'charset':_0x1da6('0x18'),'collate':_0x1da6('0x19')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 12a01fb..7aed15c 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 _0x10dc=['then','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','AddTagsToMailInteraction','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request'];(function(_0x3f4cd0,_0x303070){var _0x3f9f01=function(_0x6ced93){while(--_0x6ced93){_0x3f4cd0['push'](_0x3f4cd0['shift']());}};_0x3f9f01(++_0x303070);}(_0x10dc,0x90));var _0xc10d=function(_0x4ffa11,_0x120051){_0x4ffa11=_0x4ffa11-0x0;var _0x1f669d=_0x10dc[_0x4ffa11];return _0x1f669d;};'use strict';var _=require(_0xc10d('0x0'));var util=require(_0xc10d('0x1'));var moment=require(_0xc10d('0x2'));var BPromise=require(_0xc10d('0x3'));var rs=require(_0xc10d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc10d('0x5'))(_0xc10d('0x6'));var config=require(_0xc10d('0x7'));var jayson=require(_0xc10d('0x8'));var client=jayson['client'][_0xc10d('0x9')]({'port':0x232a});config[_0xc10d('0xa')]=_[_0xc10d('0xb')](config[_0xc10d('0xa')],{'host':_0xc10d('0xc'),'port':0x18eb});var socket=require(_0xc10d('0xd'))(new Redis(config[_0xc10d('0xa')]));require(_0xc10d('0xe'))['register'](socket);function respondWithRpcPromise(_0x4a81cb,_0x2285bf,_0x4e2b3a){return new BPromise(function(_0x1eec40,_0x553c61){return client[_0xc10d('0xf')](_0x4a81cb,_0x4e2b3a)[_0xc10d('0x10')](function(_0x368e03){logger['info'](_0xc10d('0x11'),_0x2285bf,'request\x20sent');logger[_0xc10d('0x12')](_0xc10d('0x13'),_0x2285bf,'request\x20sent',JSON[_0xc10d('0x14')](_0x368e03));if(_0x368e03[_0xc10d('0x15')]){if(_0x368e03[_0xc10d('0x15')][_0xc10d('0x16')]===0x1f4){logger['error'](_0xc10d('0x11'),_0x2285bf,_0x368e03['error'][_0xc10d('0x17')]);return _0x553c61(_0x368e03['error'][_0xc10d('0x17')]);}logger[_0xc10d('0x15')](_0xc10d('0x11'),_0x2285bf,_0x368e03['error']['message']);return _0x1eec40(_0x368e03['error'][_0xc10d('0x17')]);}else{logger[_0xc10d('0x18')]('MailInteraction,\x20%s,\x20%s',_0x2285bf,_0xc10d('0x19'));_0x1eec40(_0x368e03['result'][_0xc10d('0x17')]);}})[_0xc10d('0x1a')](function(_0x4841c9){logger[_0xc10d('0x15')](_0xc10d('0x11'),_0x2285bf,_0x4841c9);_0x553c61(_0x4841c9);});});}exports[_0xc10d('0x1b')]=function(_0x59ca31){var _0xc294e6=this;return new Promise(function(_0x1ae146,_0x3cbbfb){return db[_0xc10d('0x1c')][_0xc10d('0x1d')](_0x59ca31[_0xc10d('0x1e')],{'raw':_0x59ca31[_0xc10d('0x1f')]?_0x59ca31[_0xc10d('0x1f')][_0xc10d('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59ca31[_0xc10d('0x1f')]?_0x59ca31[_0xc10d('0x1f')][_0xc10d('0x21')]||null:null,'attributes':_0x59ca31['options']?_0x59ca31[_0xc10d('0x1f')][_0xc10d('0x22')]||null:null,'limit':_0x59ca31[_0xc10d('0x1f')]?_0x59ca31[_0xc10d('0x1f')]['limit']||null:null})[_0xc10d('0x10')](function(_0x2ed33f){logger[_0xc10d('0x18')](_0xc10d('0x1b'),_0x59ca31);logger['debug'](_0xc10d('0x1b'),_0x59ca31,JSON['stringify'](_0x2ed33f));_0x1ae146(_0x2ed33f);})[_0xc10d('0x1a')](function(_0x27ce4c){logger[_0xc10d('0x15')](_0xc10d('0x1b'),_0x27ce4c[_0xc10d('0x17')],_0x59ca31);_0x3cbbfb(_0xc294e6[_0xc10d('0x15')](0x1f4,_0x27ce4c[_0xc10d('0x17')]));});});};exports[_0xc10d('0x23')]=function(_0x3042d9){return new Promise(function(_0x4901bc,_0x2fdd8f){return db['MailInteraction']['find']({'where':_0x3042d9[_0xc10d('0x1f')]?_0x3042d9[_0xc10d('0x1f')][_0xc10d('0x21')]||null:null})[_0xc10d('0x10')](function(_0x29a395){if(_0x29a395){return _0x29a395['addTags'](_0x3042d9[_0xc10d('0x1e')][_0xc10d('0x24')],_[_0xc10d('0x25')](_0x3042d9['body'],['ids','id'])||{});}})[_0xc10d('0x26')](function(_0x350061){logger[_0xc10d('0x18')]('AddTags',_0x3042d9);logger[_0xc10d('0x12')](_0xc10d('0x27'),_0x3042d9,JSON['stringify'](_0x350061));_0x4901bc(_0x350061);})[_0xc10d('0x1a')](function(_0x70390b){logger[_0xc10d('0x15')](_0xc10d('0x27'),_0x70390b[_0xc10d('0x17')],_0x3042d9);_0x2fdd8f(_this[_0xc10d('0x15')](0x1f4,_0x70390b[_0xc10d('0x17')]));});});}; \ No newline at end of file +var _0x5a43=['ioredis','../../mysqldb','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','MailInteraction','update','options','raw','where','attributes','UpdateMailInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring'];(function(_0x123f0b,_0x30123a){var _0x441a2a=function(_0xf33b67){while(--_0xf33b67){_0x123f0b['push'](_0x123f0b['shift']());}};_0x441a2a(++_0x30123a);}(_0x5a43,0xf1));var _0x35a4=function(_0x565bf0,_0x4a59b5){_0x565bf0=_0x565bf0-0x0;var _0x21ee7f=_0x5a43[_0x565bf0];return _0x21ee7f;};'use strict';var _=require(_0x35a4('0x0'));var util=require(_0x35a4('0x1'));var moment=require(_0x35a4('0x2'));var BPromise=require(_0x35a4('0x3'));var rs=require(_0x35a4('0x4'));var fs=require('fs');var Redis=require(_0x35a4('0x5'));var db=require(_0x35a4('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x35a4('0x7'));var client=jayson[_0x35a4('0x8')][_0x35a4('0x9')]({'port':0x232a});config[_0x35a4('0xa')]=_[_0x35a4('0xb')](config[_0x35a4('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x35a4('0xc'))(new Redis(config[_0x35a4('0xa')]));require(_0x35a4('0xd'))[_0x35a4('0xe')](socket);function respondWithRpcPromise(_0x43df6d,_0x351402,_0x4acf73){return new BPromise(function(_0x501e7e,_0x55910f){return client[_0x35a4('0xf')](_0x43df6d,_0x4acf73)['then'](function(_0x3d777f){logger[_0x35a4('0x10')](_0x35a4('0x11'),_0x351402,'request\x20sent');logger[_0x35a4('0x12')](_0x35a4('0x13'),_0x351402,_0x35a4('0x14'),JSON[_0x35a4('0x15')](_0x3d777f));if(_0x3d777f['error']){if(_0x3d777f[_0x35a4('0x16')][_0x35a4('0x17')]===0x1f4){logger['error'](_0x35a4('0x11'),_0x351402,_0x3d777f['error'][_0x35a4('0x18')]);return _0x55910f(_0x3d777f[_0x35a4('0x16')][_0x35a4('0x18')]);}logger[_0x35a4('0x16')](_0x35a4('0x11'),_0x351402,_0x3d777f[_0x35a4('0x16')][_0x35a4('0x18')]);return _0x501e7e(_0x3d777f[_0x35a4('0x16')][_0x35a4('0x18')]);}else{logger['info'](_0x35a4('0x11'),_0x351402,_0x35a4('0x14'));_0x501e7e(_0x3d777f[_0x35a4('0x19')][_0x35a4('0x18')]);}})[_0x35a4('0x1a')](function(_0x1197b0){logger[_0x35a4('0x16')](_0x35a4('0x11'),_0x351402,_0x1197b0);_0x55910f(_0x1197b0);});});}exports['UpdateMailInteraction']=function(_0x15113f){var _0x5f2b95=this;return new Promise(function(_0x4dcdb2,_0x3e48b3){return db[_0x35a4('0x1b')][_0x35a4('0x1c')](_0x15113f['body'],{'raw':_0x15113f[_0x35a4('0x1d')]?_0x15113f[_0x35a4('0x1d')][_0x35a4('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15113f['options']?_0x15113f[_0x35a4('0x1d')][_0x35a4('0x1f')]||null:null,'attributes':_0x15113f['options']?_0x15113f[_0x35a4('0x1d')][_0x35a4('0x20')]||null:null,'limit':_0x15113f[_0x35a4('0x1d')]?_0x15113f[_0x35a4('0x1d')]['limit']||null:null})['then'](function(_0x7a193c){logger['info'](_0x35a4('0x21'),_0x15113f);logger[_0x35a4('0x12')](_0x35a4('0x21'),_0x15113f,JSON[_0x35a4('0x15')](_0x7a193c));_0x4dcdb2(_0x7a193c);})[_0x35a4('0x1a')](function(_0x2f8e6c){logger['error']('UpdateMailInteraction',_0x2f8e6c['message'],_0x15113f);_0x3e48b3(_0x5f2b95[_0x35a4('0x16')](0x1f4,_0x2f8e6c[_0x35a4('0x18')]));});});};exports['AddTagsToMailInteraction']=function(_0x490002){return new Promise(function(_0x7d2c5,_0x410aa9){return db[_0x35a4('0x1b')][_0x35a4('0x22')]({'where':_0x490002['options']?_0x490002['options']['where']||null:null})['then'](function(_0x12863a){if(_0x12863a){return _0x12863a[_0x35a4('0x23')](_0x490002[_0x35a4('0x24')][_0x35a4('0x25')],_[_0x35a4('0x26')](_0x490002[_0x35a4('0x24')],[_0x35a4('0x25'),'id'])||{});}})[_0x35a4('0x27')](function(_0x2a8e5e){logger[_0x35a4('0x10')](_0x35a4('0x28'),_0x490002);logger[_0x35a4('0x12')](_0x35a4('0x28'),_0x490002,JSON[_0x35a4('0x15')](_0x2a8e5e));_0x7d2c5(_0x2a8e5e);})[_0x35a4('0x1a')](function(_0x2cb4bf){logger['error'](_0x35a4('0x28'),_0x2cb4bf[_0x35a4('0x18')],_0x490002);_0x410aa9(_this[_0x35a4('0x16')](0x1f4,_0x2cb4bf['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 99ee112..93ed81b 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 _0x6cbd=['removeListener','register','length','mailInteraction:','./mailInteraction.events','remove','emit'];(function(_0x25c2e4,_0x255de3){var _0x449066=function(_0x339e9f){while(--_0x339e9f){_0x25c2e4['push'](_0x25c2e4['shift']());}};_0x449066(++_0x255de3);}(_0x6cbd,0xe4));var _0xd6cb=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x6cbd[_0x6cf19c];return _0xce14f3;};'use strict';var MailInteractionEvents=require(_0xd6cb('0x0'));var events=['save',_0xd6cb('0x1'),'update'];function createListener(_0x1e4284,_0x381b75){return function(_0x59af1b){_0x381b75[_0xd6cb('0x2')](_0x1e4284,_0x59af1b);};}function removeListener(_0xc4a663,_0x487bb2){return function(){MailInteractionEvents[_0xd6cb('0x3')](_0xc4a663,_0x487bb2);};}exports[_0xd6cb('0x4')]=function(_0x275fc5){for(var _0x538fae=0x0,_0xb8176a=events[_0xd6cb('0x5')];_0x538fae<_0xb8176a;_0x538fae++){var _0x409290=events[_0x538fae];var _0x4b1c04=createListener(_0xd6cb('0x6')+_0x409290,_0x275fc5);MailInteractionEvents['on'](_0x409290,_0x4b1c04);}}; \ No newline at end of file +var _0xaf9a=['register','length','mailInteraction:','./mailInteraction.events','save','remove','update','emit','removeListener'];(function(_0x430277,_0x249d02){var _0x8ea915=function(_0x3e792b){while(--_0x3e792b){_0x430277['push'](_0x430277['shift']());}};_0x8ea915(++_0x249d02);}(_0xaf9a,0x1a1));var _0xaaf9=function(_0x1c3f09,_0x1b7b17){_0x1c3f09=_0x1c3f09-0x0;var _0xa6efb8=_0xaf9a[_0x1c3f09];return _0xa6efb8;};'use strict';var MailInteractionEvents=require(_0xaaf9('0x0'));var events=[_0xaaf9('0x1'),_0xaaf9('0x2'),_0xaaf9('0x3')];function createListener(_0x440976,_0x5b26e9){return function(_0x3db4b5){_0x5b26e9[_0xaaf9('0x4')](_0x440976,_0x3db4b5);};}function removeListener(_0x5cb87f,_0x5e0214){return function(){MailInteractionEvents[_0xaaf9('0x5')](_0x5cb87f,_0x5e0214);};}exports[_0xaaf9('0x6')]=function(_0x56d4c0){for(var _0xe96fef=0x0,_0x5b57d3=events[_0xaaf9('0x7')];_0xe96fef<_0x5b57d3;_0xe96fef++){var _0x1ab199=events[_0xe96fef];var _0x32865a=createListener(_0xaaf9('0x8')+_0x1ab199,_0x56d4c0);MailInteractionEvents['on'](_0x1ab199,_0x32865a);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 562056e..f0a10d3 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 _0x0f73=['/:id','download','post','tracked','mailmessage:create','create','update','/:id/accept','put','/:id/reject','reject','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe'];(function(_0x16e345,_0x2ffa7d){var _0x28c20c=function(_0x8d0d03){while(--_0x8d0d03){_0x16e345['push'](_0x16e345['shift']());}};_0x28c20c(++_0x2ffa7d);}(_0x0f73,0x146));var _0x30f7=function(_0x14b815,_0x1f6c28){_0x14b815=_0x14b815-0x0;var _0xd34230=_0x0f73[_0x14b815];return _0xd34230;};'use strict';var multer=require(_0x30f7('0x0'));var util=require(_0x30f7('0x1'));var path=require(_0x30f7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x30f7('0x3')]();var fs_extra=require(_0x30f7('0x4'));var auth=require(_0x30f7('0x5'));var interaction=require(_0x30f7('0x6'));var config=require(_0x30f7('0x7'));var controller=require('./mailMessage.controller');router[_0x30f7('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x30f7('0x8')](_0x30f7('0x9'),auth[_0x30f7('0xa')](),controller[_0x30f7('0xb')]);router['get'](_0x30f7('0xc'),auth[_0x30f7('0xa')](),controller['show']);router[_0x30f7('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x30f7('0xd')]);router[_0x30f7('0xe')]('/',auth[_0x30f7('0xa')](),interaction[_0x30f7('0xf')]('mail',_0x30f7('0x10')),controller[_0x30f7('0x11')]);router['put'](_0x30f7('0xc'),auth[_0x30f7('0xa')](),controller[_0x30f7('0x12')]);router['put'](_0x30f7('0x13'),auth[_0x30f7('0xa')](),controller['accept']);router[_0x30f7('0x14')](_0x30f7('0x15'),auth[_0x30f7('0xa')](),controller[_0x30f7('0x16')]);router[_0x30f7('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x30f7('0x18')]);module[_0x30f7('0x19')]=router; \ No newline at end of file +var _0x0545=['/:id/accept','accept','/:id/reject','reject','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','mailmessage:create','put','update'];(function(_0x2ec6e3,_0x2a1c97){var _0x1108bd=function(_0x42a454){while(--_0x42a454){_0x2ec6e3['push'](_0x2ec6e3['shift']());}};_0x1108bd(++_0x2a1c97);}(_0x0545,0x17e));var _0x5054=function(_0x74781d,_0x2b44f9){_0x74781d=_0x74781d-0x0;var _0x392d4f=_0x0545[_0x74781d];return _0x392d4f;};'use strict';var multer=require(_0x5054('0x0'));var util=require(_0x5054('0x1'));var path=require(_0x5054('0x2'));var timeout=require(_0x5054('0x3'));var express=require(_0x5054('0x4'));var router=express[_0x5054('0x5')]();var fs_extra=require(_0x5054('0x6'));var auth=require(_0x5054('0x7'));var interaction=require(_0x5054('0x8'));var config=require(_0x5054('0x9'));var controller=require(_0x5054('0xa'));router[_0x5054('0xb')]('/',auth[_0x5054('0xc')](),controller[_0x5054('0xd')]);router[_0x5054('0xb')](_0x5054('0xe'),auth[_0x5054('0xc')](),controller[_0x5054('0xf')]);router[_0x5054('0xb')](_0x5054('0x10'),auth['isAuthenticated'](),controller[_0x5054('0x11')]);router[_0x5054('0xb')](_0x5054('0x12'),auth[_0x5054('0xc')](),controller[_0x5054('0x13')]);router[_0x5054('0x14')]('/',auth[_0x5054('0xc')](),interaction['tracked']('mail',_0x5054('0x15')),controller['create']);router[_0x5054('0x16')](_0x5054('0x10'),auth[_0x5054('0xc')](),controller[_0x5054('0x17')]);router[_0x5054('0x16')](_0x5054('0x18'),auth[_0x5054('0xc')](),controller[_0x5054('0x19')]);router[_0x5054('0x16')](_0x5054('0x1a'),auth[_0x5054('0xc')](),controller[_0x5054('0x1b')]);router['delete'](_0x5054('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x5054('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 1c90ecb..823bb75 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 _0x8af5=['Chat','sequelize','lodash','TEXT','medium','BOOLEAN','ENUM','out','STRING','long','INTEGER','DATE','Email'];(function(_0xb68104,_0x348e3f){var _0x1386f6=function(_0x1f260d){while(--_0x1f260d){_0xb68104['push'](_0xb68104['shift']());}};_0x1386f6(++_0x348e3f);}(_0x8af5,0xaa));var _0x58af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8af5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x58af('0x0'));var _=require(_0x58af('0x1'));module['exports']={'body':{'type':Sequelize[_0x58af('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x58af('0x2')](_0x58af('0x3'))},'read':{'type':Sequelize[_0x58af('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x58af('0x5')]('in',_0x58af('0x6')),'defaultValue':_0x58af('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x58af('0x7')]},'to':{'type':Sequelize[_0x58af('0x2')]('long')},'cc':{'type':Sequelize['TEXT'](_0x58af('0x8'))},'bcc':{'type':Sequelize['TEXT'](_0x58af('0x8'))},'subject':{'type':Sequelize[_0x58af('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x58af('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x58af('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x58af('0xa')]},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize[_0x58af('0x2')](_0x58af('0x8'))},'originChannel':{'type':Sequelize[_0x58af('0x5')](_0x58af('0xb'),_0x58af('0xc')),'defaultValue':_0x58af('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x4086=['TEXT','long','ENUM','out','STRING','DATE','INTEGER','BOOLEAN','Email','lodash','exports'];(function(_0x22a4ce,_0x174559){var _0x1c173a=function(_0x389ac8){while(--_0x389ac8){_0x22a4ce['push'](_0x22a4ce['shift']());}};_0x1c173a(++_0x174559);}(_0x4086,0x1e2));var _0x6408=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4086[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');var _=require(_0x6408('0x0'));module[_0x6408('0x1')]={'body':{'type':Sequelize[_0x6408('0x2')](_0x6408('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x6408('0x2')]('medium')},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x6408('0x4')]('in',_0x6408('0x5')),'defaultValue':_0x6408('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x6408('0x6')](0x1fe)},'from':{'type':Sequelize[_0x6408('0x6')]},'to':{'type':Sequelize[_0x6408('0x2')](_0x6408('0x3'))},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize[_0x6408('0x2')](_0x6408('0x3'))},'subject':{'type':Sequelize[_0x6408('0x2')]},'sentAt':{'type':Sequelize[_0x6408('0x7')]},'attach':{'type':Sequelize[_0x6408('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x6408('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x6408('0x7')]},'originTo':{'type':Sequelize[_0x6408('0x2')](_0x6408('0x3'))},'originCc':{'type':Sequelize[_0x6408('0x2')](_0x6408('0x3'))},'originChannel':{'type':Sequelize[_0x6408('0x4')](_0x6408('0xa'),'Chat'),'defaultValue':_0x6408('0xa'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 1a86636..bb46fdf 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 _0xf5aa=['headers','existsSync','push','readFileSync','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','status','offset','undefined','limit','count','set','Content-Range','update','destroy','name','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','catch','body','find','describe','direction','out','secret','split','MailAccount','MailAccountId','DESC','MailServerOut','Smtp','CloudProvider','attachments','join','root','server/files/attachments','basename','List','Contacts','CmContact','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','agent','UserId','get','MailInteraction','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','accept','EventManager','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','internal','motionChannel','event','reject','fromString','rejectmessage','download','unix','toString','server','tmp','files','from','bcc','subject','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ'];(function(_0x4983f4,_0x107731){var _0xbac14f=function(_0x5b178e){while(--_0x5b178e){_0x4983f4['push'](_0x4983f4['shift']());}};_0xbac14f(++_0x107731);}(_0xf5aa,0x1e2));var _0xaf5a=function(_0x4ad6eb,_0x1521ea){_0x4ad6eb=_0x4ad6eb-0x0;var _0x5d2d95=_0xf5aa[_0x4ad6eb];return _0x5d2d95;};'use strict';var emlformat=require(_0xaf5a('0x0'));var moment=require(_0xaf5a('0x1'));var BPromise=require(_0xaf5a('0x2'));var util=require(_0xaf5a('0x3'));var path=require(_0xaf5a('0x4'));var fs=require('fs');var _=require(_0xaf5a('0x5'));var Redis=require(_0xaf5a('0x6'));var htmlToText=require(_0xaf5a('0x7'));var qs=require(_0xaf5a('0x8'));var logger=require(_0xaf5a('0x9'))('api');var interaction_log=require('../../config/logger')(_0xaf5a('0xa'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xaf5a('0xb')]=_[_0xaf5a('0xc')](config[_0xaf5a('0xb')],{'host':_0xaf5a('0xd'),'port':0x18eb});var socket=require(_0xaf5a('0xe'))(new Redis(config[_0xaf5a('0xb')]));var htmlEntities=require(_0xaf5a('0xf'));require(_0xaf5a('0x10'))[_0xaf5a('0x11')](socket);var jayson=require(_0xaf5a('0x12'));var client=jayson[_0xaf5a('0x13')][_0xaf5a('0x14')]({'port':0x232c});var client9003=jayson[_0xaf5a('0x13')][_0xaf5a('0x14')]({'port':0x232b});var client9002=jayson[_0xaf5a('0x13')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40edc4,_0x1a9c55,_0x5c179a,_0x1242f5){return new BPromise(function(_0x1a844a,_0x2f1814){var _0x162ca0=_0x1242f5||client;return _0x162ca0['request'](_0x40edc4,_0x5c179a)[_0xaf5a('0x15')](function(_0x53cc81){logger[_0xaf5a('0x16')](_0xaf5a('0x17'),_0x1a9c55,'request\x20sent');logger[_0xaf5a('0x18')](_0xaf5a('0x19'),_0x1a9c55,_0xaf5a('0x1a'),JSON[_0xaf5a('0x1b')](_0x53cc81));if(_0x53cc81[_0xaf5a('0x1c')]){if(_0x53cc81[_0xaf5a('0x1c')]['code']===0x1f4){logger['error'](_0xaf5a('0x17'),_0x1a9c55,_0x53cc81[_0xaf5a('0x1c')][_0xaf5a('0x1d')]);return _0x2f1814(_0x53cc81['error'][_0xaf5a('0x1d')]);}logger[_0xaf5a('0x1c')]('MailMessage,\x20%s,\x20%s',_0x1a9c55,_0x53cc81[_0xaf5a('0x1c')][_0xaf5a('0x1d')]);return _0x1a844a(_0x53cc81[_0xaf5a('0x1c')][_0xaf5a('0x1d')]);}else{logger[_0xaf5a('0x16')](_0xaf5a('0x17'),_0x1a9c55,_0xaf5a('0x1a'));_0x1a844a(_0x53cc81[_0xaf5a('0x1e')][_0xaf5a('0x1d')]);}})['catch'](function(_0x2cb7aa){logger[_0xaf5a('0x1c')](_0xaf5a('0x17'),_0x1a9c55,_0x2cb7aa);_0x2f1814(_0x2cb7aa);});});}function respondWithResult(_0x26ebb8,_0x2e3dc1){_0x2e3dc1=_0x2e3dc1||0xc8;return function(_0x3bd204){if(_0x3bd204){return _0x26ebb8[_0xaf5a('0x1f')](_0x2e3dc1)['json'](_0x3bd204);}};}function respondWithFilteredResult(_0x4e7d90,_0x1037a3){return function(_0x9b5b34){if(_0x9b5b34){var _0x30ee90=typeof _0x1037a3[_0xaf5a('0x20')]===_0xaf5a('0x21')&&typeof _0x1037a3[_0xaf5a('0x22')]==='undefined';var _0x351ca6=_0x9b5b34[_0xaf5a('0x23')];var _0x3cb479=_0x30ee90?0x0:_0x1037a3['offset'];var _0x126527=_0x30ee90?_0x9b5b34[_0xaf5a('0x23')]:_0x1037a3['offset']+_0x1037a3[_0xaf5a('0x22')];var _0x59ff57;if(_0x126527>=_0x351ca6){_0x126527=_0x351ca6;_0x59ff57=0xc8;}else{_0x59ff57=0xce;}_0x4e7d90[_0xaf5a('0x1f')](_0x59ff57);return _0x4e7d90[_0xaf5a('0x24')](_0xaf5a('0x25'),_0x3cb479+'-'+_0x126527+'/'+_0x351ca6)['json'](_0x9b5b34);}return null;};}function saveUpdates(_0x15b016){return function(_0x4aaf1d){if(_0x4aaf1d){return _0x4aaf1d[_0xaf5a('0x26')](_0x15b016)[_0xaf5a('0x15')](function(_0x1d6329){return _0x1d6329;});}return null;};}function removeEntity(_0x1e5595){return function(_0x30ab00){if(_0x30ab00){return _0x30ab00[_0xaf5a('0x27')]()[_0xaf5a('0x15')](function(){_0x1e5595[_0xaf5a('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56848e){return function(_0x17fea0){if(!_0x17fea0){_0x56848e['sendStatus'](0x194);}return _0x17fea0;};}function handleError(_0x564ea5,_0x1fa874){_0x1fa874=_0x1fa874||0x1f4;return function(_0x5b4dd7){logger[_0xaf5a('0x1c')](_0x5b4dd7['stack']);if(_0x5b4dd7[_0xaf5a('0x28')]){delete _0x5b4dd7[_0xaf5a('0x28')];}_0x564ea5[_0xaf5a('0x1f')](_0x1fa874)['send'](_0x5b4dd7);};}exports[_0xaf5a('0x29')]=function(_0x56e50c,_0x30f338){var _0x1e5d2e={},_0x37ccf4={},_0x55b150={'count':0x0,'rows':[]};var _0x511b2b=_[_0xaf5a('0x2a')](db[_0xaf5a('0x2b')][_0xaf5a('0x2c')],function(_0x91a0b5){return{'name':_0x91a0b5[_0xaf5a('0x2d')],'type':_0x91a0b5[_0xaf5a('0x2e')][_0xaf5a('0x2f')]};});_0x37ccf4[_0xaf5a('0x30')]=_['map'](_0x511b2b,'name');_0x37ccf4[_0xaf5a('0x31')]=_[_0xaf5a('0x32')](_0x56e50c[_0xaf5a('0x31')]);_0x37ccf4[_0xaf5a('0x33')]=_[_0xaf5a('0x34')](_0x37ccf4[_0xaf5a('0x30')],_0x37ccf4[_0xaf5a('0x31')]);_0x1e5d2e['attributes']=_['intersection'](_0x37ccf4['model'],qs['fields'](_0x56e50c[_0xaf5a('0x31')][_0xaf5a('0x35')]));_0x1e5d2e[_0xaf5a('0x36')]=_0x1e5d2e[_0xaf5a('0x36')][_0xaf5a('0x37')]?_0x1e5d2e[_0xaf5a('0x36')]:_0x37ccf4[_0xaf5a('0x30')];if(!_0x56e50c[_0xaf5a('0x31')][_0xaf5a('0x38')](_0xaf5a('0x39'))){_0x1e5d2e['limit']=qs[_0xaf5a('0x22')](_0x56e50c[_0xaf5a('0x31')][_0xaf5a('0x22')]);_0x1e5d2e[_0xaf5a('0x20')]=qs['offset'](_0x56e50c['query'][_0xaf5a('0x20')]);}_0x1e5d2e[_0xaf5a('0x3a')]=qs[_0xaf5a('0x3b')](_0x56e50c[_0xaf5a('0x31')][_0xaf5a('0x3b')]);_0x1e5d2e['where']=qs[_0xaf5a('0x33')](_['pick'](_0x56e50c[_0xaf5a('0x31')],_0x37ccf4[_0xaf5a('0x33')]),_0x511b2b);if(_0x56e50c['query']['filter']){_0x1e5d2e['where']=_[_0xaf5a('0x3c')](_0x1e5d2e[_0xaf5a('0x3d')],{'$or':_['map'](_0x511b2b,function(_0x260ad1){if(_0x260ad1[_0xaf5a('0x2e')]!==_0xaf5a('0x3e')){var _0xdef17={};_0xdef17[_0x260ad1[_0xaf5a('0x28')]]={'$like':'%'+_0x56e50c[_0xaf5a('0x31')][_0xaf5a('0x3f')]+'%'};return _0xdef17;}})});}_0x1e5d2e=_[_0xaf5a('0x3c')]({},_0x1e5d2e,_0x56e50c[_0xaf5a('0x40')]);var _0x5b0b26={'where':_0x1e5d2e[_0xaf5a('0x3d')]};return db[_0xaf5a('0x2b')][_0xaf5a('0x23')](_0x5b0b26)[_0xaf5a('0x15')](function(_0x60e7ab){_0x55b150['count']=_0x60e7ab;if(_0x56e50c[_0xaf5a('0x31')][_0xaf5a('0x41')]){_0x1e5d2e[_0xaf5a('0x42')]=[{'all':!![]}];}return db[_0xaf5a('0x2b')][_0xaf5a('0x43')](_0x1e5d2e);})[_0xaf5a('0x15')](function(_0x2903f4){_0x55b150[_0xaf5a('0x44')]=_0x2903f4;return _0x55b150;})[_0xaf5a('0x15')](respondWithFilteredResult(_0x30f338,_0x1e5d2e))['catch'](handleError(_0x30f338,null));};exports[_0xaf5a('0x45')]=function(_0xc0524d,_0x4a0770){var _0x470fa3={'raw':!![],'where':{'id':_0xc0524d[_0xaf5a('0x46')]['id']}},_0x1025cb={};_0x1025cb['model']=_[_0xaf5a('0x32')](db['MailMessage'][_0xaf5a('0x2c')]);_0x1025cb[_0xaf5a('0x31')]=_[_0xaf5a('0x32')](_0xc0524d[_0xaf5a('0x31')]);_0x1025cb[_0xaf5a('0x33')]=_[_0xaf5a('0x34')](_0x1025cb[_0xaf5a('0x30')],_0x1025cb[_0xaf5a('0x31')]);_0x470fa3['attributes']=_[_0xaf5a('0x34')](_0x1025cb[_0xaf5a('0x30')],qs[_0xaf5a('0x35')](_0xc0524d[_0xaf5a('0x31')][_0xaf5a('0x35')]));_0x470fa3['attributes']=_0x470fa3['attributes'][_0xaf5a('0x37')]?_0x470fa3['attributes']:_0x1025cb[_0xaf5a('0x30')];if(_0xc0524d[_0xaf5a('0x31')][_0xaf5a('0x41')]){_0x470fa3[_0xaf5a('0x42')]=[{'all':!![]}];}_0x470fa3=_[_0xaf5a('0x3c')]({},_0x470fa3,_0xc0524d[_0xaf5a('0x40')]);return db['MailMessage']['find'](_0x470fa3)[_0xaf5a('0x15')](handleEntityNotFound(_0x4a0770,null))[_0xaf5a('0x15')](respondWithResult(_0x4a0770,null))[_0xaf5a('0x47')](handleError(_0x4a0770,null));};exports[_0xaf5a('0x26')]=function(_0x3a707a,_0x3334aa){if(_0x3a707a['body']['id']){delete _0x3a707a[_0xaf5a('0x48')]['id'];}return db[_0xaf5a('0x2b')][_0xaf5a('0x49')]({'where':{'id':_0x3a707a['params']['id']}})[_0xaf5a('0x15')](handleEntityNotFound(_0x3334aa,null))[_0xaf5a('0x15')](saveUpdates(_0x3a707a['body'],null))[_0xaf5a('0x15')](respondWithResult(_0x3334aa,null))[_0xaf5a('0x47')](handleError(_0x3334aa,null));};exports[_0xaf5a('0x27')]=function(_0x4cc439,_0x5126fa){return db[_0xaf5a('0x2b')][_0xaf5a('0x49')]({'where':{'id':_0x4cc439[_0xaf5a('0x46')]['id']}})[_0xaf5a('0x15')](handleEntityNotFound(_0x5126fa,null))[_0xaf5a('0x15')](removeEntity(_0x5126fa,null))[_0xaf5a('0x47')](handleError(_0x5126fa,null));};exports[_0xaf5a('0x4a')]=function(_0x232c96,_0x49f43e){return db[_0xaf5a('0x2b')][_0xaf5a('0x4a')]()[_0xaf5a('0x15')](respondWithResult(_0x49f43e,null))[_0xaf5a('0x47')](handleError(_0x49f43e,null));};exports['create']=function(_0x263da6,_0x494938){return db[_0xaf5a('0x2b')]['create'](_0x263da6[_0xaf5a('0x48')])[_0xaf5a('0x15')](function(_0x2ba89d){if(_0x2ba89d){if(_0x2ba89d[_0xaf5a('0x4b')]===_0xaf5a('0x4c')&&!_0x2ba89d[_0xaf5a('0x4d')]){var _0x39805e,_0x2931d5,_0x2765cf;if(_0x263da6[_0xaf5a('0x48')]['to']){_0x2931d5=_0x263da6[_0xaf5a('0x48')]['to'][_0xaf5a('0x4e')](',')[0x0];}return db[_0xaf5a('0x4f')]['findOne']({'where':{'id':_0x2ba89d[_0xaf5a('0x50')]},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x2931d5},'limit':0x1,'order':[['updatedAt',_0xaf5a('0x51')]]}]},{'model':db[_0xaf5a('0x52')],'as':_0xaf5a('0x53'),'raw':!![],'include':[{'model':db[_0xaf5a('0x54')],'as':'CloudProvider','raw':!![]}]}]})[_0xaf5a('0x15')](function(_0x14152d){_0x39805e=_0x14152d;if(!_0x39805e||!_0x39805e[_0xaf5a('0x53')])return;var _0x34463b=_0x39805e['getSmtpOptions']();if(_0x263da6[_0xaf5a('0x48')]['attachments']&&_0x263da6[_0xaf5a('0x48')][_0xaf5a('0x55')][_0xaf5a('0x37')]){for(var _0xbe741b=0x0;_0xbe741b<_0x263da6[_0xaf5a('0x48')][_0xaf5a('0x55')][_0xaf5a('0x37')];_0xbe741b+=0x1){_0x263da6[_0xaf5a('0x48')][_0xaf5a('0x55')][_0xbe741b]={'filename':_0x263da6[_0xaf5a('0x48')]['attachments'][_0xbe741b][_0xaf5a('0x28')],'path':path[_0xaf5a('0x56')](config[_0xaf5a('0x57')],_0xaf5a('0x58'),_0x263da6[_0xaf5a('0x48')][_0xaf5a('0x55')][_0xbe741b][_0xaf5a('0x59')])};}}_0x2765cf={'account':_0x34463b,'message':_0x263da6[_0xaf5a('0x48')]};return;})[_0xaf5a('0x15')](function(){if(_0x39805e[_0xaf5a('0x5a')]){if(_0x39805e[_0xaf5a('0x5a')][_0xaf5a('0x5b')][_0xaf5a('0x37')]){return _0x39805e[_0xaf5a('0x5a')]['Contacts'][0x0];}else{return db[_0xaf5a('0x5c')]['create'](_['defaults'](_0x263da6['body'],{'firstName':_0x263da6['body']['to'],'email':_0x263da6[_0xaf5a('0x48')]['to'],'phone':_0x263da6[_0xaf5a('0x48')]['to'],'ListId':_0x39805e[_0xaf5a('0x5d')]}));}}else{throw new Error(_0xaf5a('0x5e'));}})['then'](function(){if(_0x2765cf){return respondWithRpcPromise(_0xaf5a('0x5f'),_0xaf5a('0x60'),_0x2765cf,client9003)[_0xaf5a('0x15')](function(_0x4a8ce8){return _0x2ba89d[_0xaf5a('0x26')]({'read':!![],'messageId':_0x4a8ce8[_0xaf5a('0x61')],'sentAt':moment()[_0xaf5a('0x62')](_0xaf5a('0x63'))});})[_0xaf5a('0x47')](function(_0x2d680f){logger[_0xaf5a('0x1c')]('%s',JSON[_0xaf5a('0x1b')](_0x2d680f));return _0x2ba89d;});}return _0x2ba89d;});}return _0x2ba89d;}})[_0xaf5a('0x15')](respondWithResult(_0x494938,0xc9))['catch'](handleError(_0x494938,null));};exports['accept']=function(_0x15dc7f,_0x30e8f8){var _0x29b090={'agent':{},'channel':_0xaf5a('0x64')};if(_0x15dc7f['body']['id']){delete _0x15dc7f[_0xaf5a('0x48')]['id'];}_0x15dc7f[_0xaf5a('0x48')][_0xaf5a('0x65')]=!![];_0x15dc7f[_0xaf5a('0x48')][_0xaf5a('0x66')]=moment()[_0xaf5a('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x15dc7f[_0xaf5a('0x48')]['UserId']=_0x15dc7f[_0xaf5a('0x48')]['UserId']||_0x15dc7f['user']['id'];_0x29b090[_0xaf5a('0x67')]['id']=_0x15dc7f[_0xaf5a('0x48')][_0xaf5a('0x68')];return db[_0xaf5a('0x2b')][_0xaf5a('0x49')]({'where':{'id':_0x15dc7f[_0xaf5a('0x46')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x30e8f8,null))[_0xaf5a('0x15')](saveUpdates(_0x15dc7f[_0xaf5a('0x48')],null))[_0xaf5a('0x15')](function(_0x1072fe){if(_0x1072fe){_0x29b090['message']=_0x1072fe[_0xaf5a('0x69')]({'plain':!![]});return db[_0xaf5a('0x6a')][_0xaf5a('0x49')]({'where':{'id':_0x1072fe['MailInteractionId']}});}return null;})[_0xaf5a('0x15')](handleEntityNotFound(_0x30e8f8,null))['then'](function(_0x323cc5){if(_0x323cc5){return _0x323cc5[_0xaf5a('0x26')]({'UserId':_0x15dc7f[_0xaf5a('0x48')][_0xaf5a('0x68')],'read1stAt':_[_0xaf5a('0x6b')](_0x323cc5[_0xaf5a('0x6c')])?moment()[_0xaf5a('0x62')](_0xaf5a('0x63')):undefined});}return null;})['then'](function(_0x3da831){if(_0x3da831){_0x29b090[_0xaf5a('0x6d')]=_0x3da831[_0xaf5a('0x69')]({'plain':!![]});interaction_log[_0xaf5a('0x16')](_0xaf5a('0x6e'),_0x15dc7f[_0xaf5a('0x6f')]['id'],_0x15dc7f['user'][_0xaf5a('0x28')],_0x15dc7f[_0xaf5a('0x6f')][_0xaf5a('0x70')],_0x29b090['interaction']['id'],_0x15dc7f[_0xaf5a('0x48')]?JSON[_0xaf5a('0x1b')](_0x15dc7f['body']):_0xaf5a('0x71'));return respondWithRpcPromise(_0xaf5a('0x72'),_0xaf5a('0x73'),_0x29b090);}return null;})[_0xaf5a('0x15')](function(_0x2473f6){var _0x20ff1a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2473f6[_0xaf5a('0x1d')][_0xaf5a('0x74')];return db[_0xaf5a('0x75')][_0xaf5a('0x31')](_0x20ff1a,{'type':db[_0xaf5a('0x76')]['QueryTypes'][_0xaf5a('0x77')],'raw':!![]})[_0xaf5a('0x15')](function(_0x3db285){return _0x3db285;});})[_0xaf5a('0x15')](function(_0x3df903){if(_0x3df903){_0x29b090[_0xaf5a('0x1d')][_0xaf5a('0x78')]=_0x3df903[0x0];if(!_0x15dc7f[_0xaf5a('0x48')][_0xaf5a('0x68')])return;return db[_0xaf5a('0x79')][_0xaf5a('0x49')]({'where':{'id':_0x15dc7f[_0xaf5a('0x48')][_0xaf5a('0x68')],'role':_0xaf5a('0x67')},'attributes':['id',_0xaf5a('0x28'),_0xaf5a('0x7a'),_0xaf5a('0x7b'),'internal'],'raw':!![]});}return null;})[_0xaf5a('0x15')](function(_0x187d65){if(!_0x187d65)return null;_0x29b090['message'][_0xaf5a('0x67')]=_0x187d65;return _0x29b090;})[_0xaf5a('0x15')](function(_0x1b310a){if(_0x1b310a){if(_0x15dc7f['body'][_0xaf5a('0x7c')]){_0x29b090[_0xaf5a('0x1d')][_0xaf5a('0x7d')]=util['format'](_0xaf5a('0x7e'),_0x15dc7f[_0xaf5a('0x6f')][_0xaf5a('0x28')]);_0x29b090[_0xaf5a('0x1d')][_0xaf5a('0x7f')]=_0x29b090['channel'];_0x29b090['message']['motionChannel']=_0x29b090[_0xaf5a('0x7f')];_0x29b090[_0xaf5a('0x1d')]['event']=_0xaf5a('0x80');_0x29b090[_0xaf5a('0x1d')][_0xaf5a('0x48')]=htmlToText['fromString'](_0x29b090[_0xaf5a('0x1d')][_0xaf5a('0x48')]);return respondWithRpcPromise(_0xaf5a('0x81'),_0xaf5a('0x81'),{'event':'acceptmessage','message':_0x29b090['message']},client9002)[_0xaf5a('0x15')](function(){return _0x29b090;});}return _0x29b090;}return null;})['then'](respondWithResult(_0x30e8f8,null))['catch'](handleError(_0x30e8f8,null));};exports['reject']=function(_0x2a7f5e,_0x4784fc){var _0x1da549={'agent':{},'channel':'mail'};if(_0x2a7f5e[_0xaf5a('0x48')]['id']){delete _0x2a7f5e[_0xaf5a('0x48')]['id'];}_0x2a7f5e[_0xaf5a('0x48')][_0xaf5a('0x68')]=_0x2a7f5e[_0xaf5a('0x48')][_0xaf5a('0x68')]||_0x2a7f5e[_0xaf5a('0x6f')]['id'];_0x1da549[_0xaf5a('0x67')]['id']=_0x2a7f5e[_0xaf5a('0x48')]['UserId'];return db[_0xaf5a('0x2b')][_0xaf5a('0x49')]({'where':{'id':_0x2a7f5e[_0xaf5a('0x46')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4784fc,null))[_0xaf5a('0x15')](function(_0x13efd9){if(_0x13efd9){_0x1da549['message']=_0x13efd9['get']({'plain':!![]});return db[_0xaf5a('0x6a')][_0xaf5a('0x49')]({'where':{'id':_0x13efd9[_0xaf5a('0x82')]}});}return null;})[_0xaf5a('0x15')](handleEntityNotFound(_0x4784fc,null))['then'](function(_0x525fae){if(_0x525fae){_0x1da549[_0xaf5a('0x6d')]=_0x525fae[_0xaf5a('0x69')]({'plain':!![]});interaction_log[_0xaf5a('0x16')](_0xaf5a('0x83'),_0x2a7f5e[_0xaf5a('0x6f')]['id'],_0x2a7f5e[_0xaf5a('0x6f')][_0xaf5a('0x28')],_0x2a7f5e[_0xaf5a('0x6f')][_0xaf5a('0x70')],_0x1da549[_0xaf5a('0x6d')]['id'],_0x2a7f5e[_0xaf5a('0x48')]?JSON[_0xaf5a('0x1b')](_0x2a7f5e['body']):_0xaf5a('0x71'));return respondWithRpcPromise(_0xaf5a('0x84'),_0xaf5a('0x85'),_0x1da549);}return null;})['then'](function(_0x2e2cfd){var _0x51f64d=_0xaf5a('0x86')+_0x2e2cfd[_0xaf5a('0x1d')][_0xaf5a('0x74')];return db[_0xaf5a('0x75')][_0xaf5a('0x31')](_0x51f64d,{'type':db[_0xaf5a('0x76')][_0xaf5a('0x87')][_0xaf5a('0x77')],'raw':!![]})[_0xaf5a('0x15')](function(_0x2b3480){return _0x2b3480;});})[_0xaf5a('0x15')](function(_0x1da4d){if(_0x1da4d){_0x1da549['message'][_0xaf5a('0x78')]=_0x1da4d[0x0];if(!_0x2a7f5e['body'][_0xaf5a('0x68')])return;return db[_0xaf5a('0x79')][_0xaf5a('0x49')]({'where':{'id':_0x2a7f5e[_0xaf5a('0x48')]['UserId'],'role':_0xaf5a('0x67')},'attributes':['id',_0xaf5a('0x28'),_0xaf5a('0x7a'),'email',_0xaf5a('0x88')],'raw':!![]});}return null;})[_0xaf5a('0x15')](function(_0x38d629){if(!_0x38d629)return null;_0x1da549[_0xaf5a('0x1d')][_0xaf5a('0x67')]=_0x38d629;return _0x1da549;})[_0xaf5a('0x15')](function(_0x508300){if(_0x508300){_0x508300[_0xaf5a('0x1d')][_0xaf5a('0x7d')]=util[_0xaf5a('0x62')](_0xaf5a('0x7e'),_0x2a7f5e[_0xaf5a('0x6f')]['name']);_0x508300[_0xaf5a('0x1d')][_0xaf5a('0x7f')]=_0x1da549[_0xaf5a('0x7f')];_0x508300[_0xaf5a('0x1d')][_0xaf5a('0x89')]=_0x1da549[_0xaf5a('0x7f')];_0x508300[_0xaf5a('0x1d')][_0xaf5a('0x8a')]=_0xaf5a('0x8b');_0x508300[_0xaf5a('0x1d')][_0xaf5a('0x48')]=htmlToText[_0xaf5a('0x8c')](_0x1da549['message'][_0xaf5a('0x48')]);respondWithRpcPromise(_0xaf5a('0x81'),'EventManager',{'event':_0xaf5a('0x8d'),'message':_0x508300[_0xaf5a('0x1d')]},client9002);return _0x1da549;}return null;})['then'](respondWithResult(_0x4784fc,null))[_0xaf5a('0x47')](handleError(_0x4784fc,null));};exports[_0xaf5a('0x8e')]=function(_0x34e962,_0xf2bed0){var _0x4182b7=moment()[_0xaf5a('0x8f')]()[_0xaf5a('0x90')]();var _0x48d2e5=path[_0xaf5a('0x56')](config[_0xaf5a('0x57')],_0xaf5a('0x91'),'files',_0xaf5a('0x92'));var _0x549f40=path['join'](config['root'],_0xaf5a('0x91'),_0xaf5a('0x93'),_0xaf5a('0x55'));var _0x28fd18=util[_0xaf5a('0x62')]('message-%s.eml',_0x4182b7);return db[_0xaf5a('0x2b')]['find']({'where':{'id':_0x34e962[_0xaf5a('0x46')]['id']},'attributes':['id',_0xaf5a('0x48'),_0xaf5a('0x94'),'to','cc',_0xaf5a('0x95'),_0xaf5a('0x96'),'createdAt'],'include':_0x34e962[_0xaf5a('0x31')][_0xaf5a('0x55')]?[{'model':db[_0xaf5a('0x97')],'as':_0xaf5a('0x98')}]:undefined})[_0xaf5a('0x15')](handleEntityNotFound(_0xf2bed0,null))[_0xaf5a('0x15')](function(_0x201d81){if(_0x201d81){var _0x487829=_0x201d81;var _0x1712f7={'from':_0x487829[_0xaf5a('0x94')],'to':_0x487829['to'],'subject':_0x487829[_0xaf5a('0x96')],'html':htmlEntities['decode'](_0x487829[_0xaf5a('0x48')]),'headers':{'Date':moment(_0x487829['createdAt'])[_0xaf5a('0x62')](_0xaf5a('0x99'))},'attachments':[]};if(_0x201d81['cc']){_0x1712f7[_0xaf5a('0x9a')]['Cc']=_0x201d81['cc'];}if(_0x201d81[_0xaf5a('0x95')]){_0x1712f7[_0xaf5a('0x9a')]['Bcc']=_0x201d81['bcc'];}return new BPromise(function(_0x2e5d58,_0x49250a){if(_0x201d81[_0xaf5a('0x98')]){for(var _0x3d5947=0x0;_0x3d5947<_0x201d81['Attachments'][_0xaf5a('0x37')];_0x3d5947++){var _0x8c406c=_0x201d81[_0xaf5a('0x98')][_0x3d5947];var _0x401ba8=path['join'](_0x549f40,_0x8c406c[_0xaf5a('0x59')]);if(fs[_0xaf5a('0x9b')](_0x401ba8)){_0x1712f7[_0xaf5a('0x55')][_0xaf5a('0x9c')]({'name':_0x8c406c[_0xaf5a('0x28')],'contentType':_0x8c406c[_0xaf5a('0x2e')],'data':fs[_0xaf5a('0x9d')](_0x401ba8)});}}}emlformat['build'](_0x1712f7,function(_0xf70d8c,_0x49b25e){if(_0xf70d8c)return _0x49250a(_0xf70d8c);fs['writeFileSync'](path['join'](_0x48d2e5,_0x28fd18),_0x49b25e);return _0x2e5d58(_0x49b25e);});});}})[_0xaf5a('0x15')](function(_0x4d5e7d){if(_0x4d5e7d){return _0xf2bed0[_0xaf5a('0x8e')](path[_0xaf5a('0x56')](_0x48d2e5,_0x28fd18),_0x28fd18,function(_0x1f5be5){if(!_0x1f5be5)fs[_0xaf5a('0x9e')](path[_0xaf5a('0x56')](_0x48d2e5,_0x28fd18));});}})[_0xaf5a('0x47')](handleError(_0xf2bed0,null));}; \ No newline at end of file +var _0xd16d=['SendMail','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','stringify','mail','read','UserId','get','MailInteraction','MailInteractionId','isNil','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','agent','email','SIP/%s','channel','event','fromString','EventManager','acceptmessage','role','RejectMessage','Sequelize','fullname','interface','motionChannel','reject','rejectmessage','download','unix','server','files','tmp','message-%s.eml','from','subject','createdAt','Attachment','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','Attachments','existsSync','push','readFileSync','build','unlinkSync','eml-format','moment','util','path','lodash','ioredis','html-to-text','../../config/logger','api','mail-interactions','../../mysqldb','redis','defaults','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','then','end','sendStatus','name','index','MailMessage','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','merge','body','find','destroy','describe','create','direction','split','MailAccount','CmList','List','CmContact','Contacts','updatedAt','MailServerOut','Smtp','CloudProvider','attachments','join','root','server/files/attachments','basename','ListId','List\x20not\x20found'];(function(_0x4fcfbe,_0x107dc6){var _0x50b203=function(_0x3a9083){while(--_0x3a9083){_0x4fcfbe['push'](_0x4fcfbe['shift']());}};_0x50b203(++_0x107dc6);}(_0xd16d,0xdb));var _0xdd16=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd16d[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xdd16('0x0'));var moment=require(_0xdd16('0x1'));var BPromise=require('bluebird');var util=require(_0xdd16('0x2'));var path=require(_0xdd16('0x3'));var fs=require('fs');var _=require(_0xdd16('0x4'));var Redis=require(_0xdd16('0x5'));var htmlToText=require(_0xdd16('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0xdd16('0x7'))(_0xdd16('0x8'));var interaction_log=require(_0xdd16('0x7'))(_0xdd16('0x9'));var config=require('../../config/environment');var db=require(_0xdd16('0xa'))['db'];config[_0xdd16('0xb')]=_[_0xdd16('0xc')](config[_0xdd16('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xdd16('0xd'))(new Redis(config[_0xdd16('0xb')]));var htmlEntities=require('html-entities');require(_0xdd16('0xe'))[_0xdd16('0xf')](socket);var jayson=require(_0xdd16('0x10'));var client=jayson[_0xdd16('0x11')][_0xdd16('0x12')]({'port':0x232c});var client9003=jayson[_0xdd16('0x11')]['http']({'port':0x232b});var client9002=jayson[_0xdd16('0x11')][_0xdd16('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x513b80,_0x55794f,_0x1b866a,_0x4129c0){return new BPromise(function(_0x26f087,_0x32128e){var _0x31fcf5=_0x4129c0||client;return _0x31fcf5[_0xdd16('0x13')](_0x513b80,_0x1b866a)['then'](function(_0x1d6b61){logger[_0xdd16('0x14')](_0xdd16('0x15'),_0x55794f,_0xdd16('0x16'));logger[_0xdd16('0x17')](_0xdd16('0x18'),_0x55794f,_0xdd16('0x16'),JSON['stringify'](_0x1d6b61));if(_0x1d6b61[_0xdd16('0x19')]){if(_0x1d6b61[_0xdd16('0x19')]['code']===0x1f4){logger[_0xdd16('0x19')](_0xdd16('0x15'),_0x55794f,_0x1d6b61[_0xdd16('0x19')]['message']);return _0x32128e(_0x1d6b61[_0xdd16('0x19')][_0xdd16('0x1a')]);}logger[_0xdd16('0x19')](_0xdd16('0x15'),_0x55794f,_0x1d6b61[_0xdd16('0x19')][_0xdd16('0x1a')]);return _0x26f087(_0x1d6b61[_0xdd16('0x19')][_0xdd16('0x1a')]);}else{logger[_0xdd16('0x14')](_0xdd16('0x15'),_0x55794f,_0xdd16('0x16'));_0x26f087(_0x1d6b61[_0xdd16('0x1b')][_0xdd16('0x1a')]);}})[_0xdd16('0x1c')](function(_0x541a7b){logger[_0xdd16('0x19')]('MailMessage,\x20%s,\x20%s',_0x55794f,_0x541a7b);_0x32128e(_0x541a7b);});});}function respondWithResult(_0x2193da,_0x2e5473){_0x2e5473=_0x2e5473||0xc8;return function(_0xe86ba2){if(_0xe86ba2){return _0x2193da[_0xdd16('0x1d')](_0x2e5473)[_0xdd16('0x1e')](_0xe86ba2);}};}function respondWithFilteredResult(_0x15d2ba,_0x22e644){return function(_0x4b547a){if(_0x4b547a){var _0x563ef0=typeof _0x22e644[_0xdd16('0x1f')]===_0xdd16('0x20')&&typeof _0x22e644[_0xdd16('0x21')]===_0xdd16('0x20');var _0x28c416=_0x4b547a[_0xdd16('0x22')];var _0x4103bd=_0x563ef0?0x0:_0x22e644['offset'];var _0x2b5d59=_0x563ef0?_0x4b547a[_0xdd16('0x22')]:_0x22e644[_0xdd16('0x1f')]+_0x22e644[_0xdd16('0x21')];var _0x2638cd;if(_0x2b5d59>=_0x28c416){_0x2b5d59=_0x28c416;_0x2638cd=0xc8;}else{_0x2638cd=0xce;}_0x15d2ba[_0xdd16('0x1d')](_0x2638cd);return _0x15d2ba[_0xdd16('0x23')](_0xdd16('0x24'),_0x4103bd+'-'+_0x2b5d59+'/'+_0x28c416)['json'](_0x4b547a);}return null;};}function saveUpdates(_0xfbab32){return function(_0x336d0b){if(_0x336d0b){return _0x336d0b[_0xdd16('0x25')](_0xfbab32)[_0xdd16('0x26')](function(_0x3ebb9d){return _0x3ebb9d;});}return null;};}function removeEntity(_0x3bcfd2){return function(_0x5d6fe8){if(_0x5d6fe8){return _0x5d6fe8['destroy']()['then'](function(){_0x3bcfd2[_0xdd16('0x1d')](0xcc)[_0xdd16('0x27')]();});}};}function handleEntityNotFound(_0x1fbedd){return function(_0x4bc2f2){if(!_0x4bc2f2){_0x1fbedd[_0xdd16('0x28')](0x194);}return _0x4bc2f2;};}function handleError(_0x55d230,_0x3038c4){_0x3038c4=_0x3038c4||0x1f4;return function(_0x298f8b){logger[_0xdd16('0x19')](_0x298f8b['stack']);if(_0x298f8b[_0xdd16('0x29')]){delete _0x298f8b[_0xdd16('0x29')];}_0x55d230['status'](_0x3038c4)['send'](_0x298f8b);};}exports[_0xdd16('0x2a')]=function(_0x410f2a,_0x1a7111){var _0x350ade={},_0x3c0f60={},_0x5a1111={'count':0x0,'rows':[]};var _0x3f98ad=_['map'](db[_0xdd16('0x2b')][_0xdd16('0x2c')],function(_0x1b780f){return{'name':_0x1b780f[_0xdd16('0x2d')],'type':_0x1b780f[_0xdd16('0x2e')]['key']};});_0x3c0f60[_0xdd16('0x2f')]=_[_0xdd16('0x30')](_0x3f98ad,_0xdd16('0x29'));_0x3c0f60[_0xdd16('0x31')]=_['keys'](_0x410f2a['query']);_0x3c0f60['filters']=_[_0xdd16('0x32')](_0x3c0f60[_0xdd16('0x2f')],_0x3c0f60[_0xdd16('0x31')]);_0x350ade[_0xdd16('0x33')]=_[_0xdd16('0x32')](_0x3c0f60[_0xdd16('0x2f')],qs[_0xdd16('0x34')](_0x410f2a[_0xdd16('0x31')][_0xdd16('0x34')]));_0x350ade[_0xdd16('0x33')]=_0x350ade[_0xdd16('0x33')][_0xdd16('0x35')]?_0x350ade[_0xdd16('0x33')]:_0x3c0f60[_0xdd16('0x2f')];if(!_0x410f2a[_0xdd16('0x31')][_0xdd16('0x36')](_0xdd16('0x37'))){_0x350ade[_0xdd16('0x21')]=qs[_0xdd16('0x21')](_0x410f2a[_0xdd16('0x31')][_0xdd16('0x21')]);_0x350ade['offset']=qs['offset'](_0x410f2a[_0xdd16('0x31')][_0xdd16('0x1f')]);}_0x350ade[_0xdd16('0x38')]=qs['sort'](_0x410f2a[_0xdd16('0x31')][_0xdd16('0x39')]);_0x350ade[_0xdd16('0x3a')]=qs[_0xdd16('0x3b')](_[_0xdd16('0x3c')](_0x410f2a[_0xdd16('0x31')],_0x3c0f60[_0xdd16('0x3b')]),_0x3f98ad);if(_0x410f2a[_0xdd16('0x31')]['filter']){_0x350ade['where']=_['merge'](_0x350ade[_0xdd16('0x3a')],{'$or':_['map'](_0x3f98ad,function(_0x1015b2){if(_0x1015b2['type']!==_0xdd16('0x3d')){var _0x191304={};_0x191304[_0x1015b2['name']]={'$like':'%'+_0x410f2a['query'][_0xdd16('0x3e')]+'%'};return _0x191304;}})});}_0x350ade=_['merge']({},_0x350ade,_0x410f2a[_0xdd16('0x3f')]);var _0xfebe8c={'where':_0x350ade[_0xdd16('0x3a')]};return db[_0xdd16('0x2b')][_0xdd16('0x22')](_0xfebe8c)[_0xdd16('0x26')](function(_0x1fc0da){_0x5a1111['count']=_0x1fc0da;if(_0x410f2a[_0xdd16('0x31')][_0xdd16('0x40')]){_0x350ade[_0xdd16('0x41')]=[{'all':!![]}];}return db[_0xdd16('0x2b')][_0xdd16('0x42')](_0x350ade);})[_0xdd16('0x26')](function(_0x1139aa){_0x5a1111[_0xdd16('0x43')]=_0x1139aa;return _0x5a1111;})['then'](respondWithFilteredResult(_0x1a7111,_0x350ade))[_0xdd16('0x1c')](handleError(_0x1a7111,null));};exports[_0xdd16('0x44')]=function(_0x2c396f,_0x20d794){var _0x5a9aca={'raw':!![],'where':{'id':_0x2c396f[_0xdd16('0x45')]['id']}},_0x100dfc={};_0x100dfc['model']=_[_0xdd16('0x46')](db['MailMessage'][_0xdd16('0x2c')]);_0x100dfc[_0xdd16('0x31')]=_[_0xdd16('0x46')](_0x2c396f[_0xdd16('0x31')]);_0x100dfc[_0xdd16('0x3b')]=_['intersection'](_0x100dfc[_0xdd16('0x2f')],_0x100dfc['query']);_0x5a9aca[_0xdd16('0x33')]=_[_0xdd16('0x32')](_0x100dfc[_0xdd16('0x2f')],qs[_0xdd16('0x34')](_0x2c396f['query'][_0xdd16('0x34')]));_0x5a9aca['attributes']=_0x5a9aca['attributes'][_0xdd16('0x35')]?_0x5a9aca[_0xdd16('0x33')]:_0x100dfc[_0xdd16('0x2f')];if(_0x2c396f[_0xdd16('0x31')][_0xdd16('0x40')]){_0x5a9aca[_0xdd16('0x41')]=[{'all':!![]}];}_0x5a9aca=_[_0xdd16('0x47')]({},_0x5a9aca,_0x2c396f[_0xdd16('0x3f')]);return db[_0xdd16('0x2b')]['find'](_0x5a9aca)['then'](handleEntityNotFound(_0x20d794,null))['then'](respondWithResult(_0x20d794,null))['catch'](handleError(_0x20d794,null));};exports[_0xdd16('0x25')]=function(_0x1e03c2,_0x159f60){if(_0x1e03c2[_0xdd16('0x48')]['id']){delete _0x1e03c2['body']['id'];}return db[_0xdd16('0x2b')][_0xdd16('0x49')]({'where':{'id':_0x1e03c2[_0xdd16('0x45')]['id']}})[_0xdd16('0x26')](handleEntityNotFound(_0x159f60,null))[_0xdd16('0x26')](saveUpdates(_0x1e03c2['body'],null))[_0xdd16('0x26')](respondWithResult(_0x159f60,null))['catch'](handleError(_0x159f60,null));};exports[_0xdd16('0x4a')]=function(_0x41efce,_0x1f38ab){return db['MailMessage'][_0xdd16('0x49')]({'where':{'id':_0x41efce[_0xdd16('0x45')]['id']}})[_0xdd16('0x26')](handleEntityNotFound(_0x1f38ab,null))[_0xdd16('0x26')](removeEntity(_0x1f38ab,null))[_0xdd16('0x1c')](handleError(_0x1f38ab,null));};exports[_0xdd16('0x4b')]=function(_0x4d4914,_0x4d7b4e){return db['MailMessage'][_0xdd16('0x4b')]()[_0xdd16('0x26')](respondWithResult(_0x4d7b4e,null))[_0xdd16('0x1c')](handleError(_0x4d7b4e,null));};exports['create']=function(_0x53453e,_0x11ed05){return db[_0xdd16('0x2b')][_0xdd16('0x4c')](_0x53453e['body'])[_0xdd16('0x26')](function(_0x4359f8){if(_0x4359f8){if(_0x4359f8[_0xdd16('0x4d')]==='out'&&!_0x4359f8['secret']){var _0x30585d,_0x590194,_0x540f86;if(_0x53453e['body']['to']){_0x590194=_0x53453e[_0xdd16('0x48')]['to'][_0xdd16('0x4e')](',')[0x0];}return db[_0xdd16('0x4f')]['findOne']({'where':{'id':_0x4359f8['MailAccountId']},'include':[{'model':db[_0xdd16('0x50')],'as':_0xdd16('0x51'),'include':[{'model':db[_0xdd16('0x52')],'as':_0xdd16('0x53'),'where':{'email':_0x590194},'limit':0x1,'order':[[_0xdd16('0x54'),'DESC']]}]},{'model':db[_0xdd16('0x55')],'as':_0xdd16('0x56'),'raw':!![],'include':[{'model':db[_0xdd16('0x57')],'as':_0xdd16('0x57'),'raw':!![]}]}]})[_0xdd16('0x26')](function(_0x4d77e8){_0x30585d=_0x4d77e8;if(!_0x30585d||!_0x30585d['Smtp'])return;var _0x284b2f=_0x30585d['getSmtpOptions']();if(_0x53453e[_0xdd16('0x48')]['attachments']&&_0x53453e[_0xdd16('0x48')]['attachments'][_0xdd16('0x35')]){for(var _0x38e9eb=0x0;_0x38e9eb<_0x53453e[_0xdd16('0x48')][_0xdd16('0x58')][_0xdd16('0x35')];_0x38e9eb+=0x1){_0x53453e[_0xdd16('0x48')][_0xdd16('0x58')][_0x38e9eb]={'filename':_0x53453e[_0xdd16('0x48')][_0xdd16('0x58')][_0x38e9eb][_0xdd16('0x29')],'path':path[_0xdd16('0x59')](config[_0xdd16('0x5a')],_0xdd16('0x5b'),_0x53453e[_0xdd16('0x48')]['attachments'][_0x38e9eb][_0xdd16('0x5c')])};}}_0x540f86={'account':_0x284b2f,'message':_0x53453e['body']};return;})[_0xdd16('0x26')](function(){if(_0x30585d['List']){if(_0x30585d[_0xdd16('0x51')]['Contacts']['length']){return _0x30585d[_0xdd16('0x51')][_0xdd16('0x53')][0x0];}else{return db[_0xdd16('0x52')][_0xdd16('0x4c')](_[_0xdd16('0xc')](_0x53453e[_0xdd16('0x48')],{'firstName':_0x53453e[_0xdd16('0x48')]['to'],'email':_0x53453e['body']['to'],'phone':_0x53453e[_0xdd16('0x48')]['to'],'ListId':_0x30585d[_0xdd16('0x5d')]}));}}else{throw new Error(_0xdd16('0x5e'));}})[_0xdd16('0x26')](function(){if(_0x540f86){return respondWithRpcPromise(_0xdd16('0x5f'),_0xdd16('0x60'),_0x540f86,client9003)['then'](function(_0x3f2de6){return _0x4359f8[_0xdd16('0x25')]({'read':!![],'messageId':_0x3f2de6['messageId'],'sentAt':moment()[_0xdd16('0x61')](_0xdd16('0x62'))});})[_0xdd16('0x1c')](function(_0x393d55){logger[_0xdd16('0x19')]('%s',JSON[_0xdd16('0x63')](_0x393d55));return _0x4359f8;});}return _0x4359f8;});}return _0x4359f8;}})[_0xdd16('0x26')](respondWithResult(_0x11ed05,0xc9))[_0xdd16('0x1c')](handleError(_0x11ed05,null));};exports['accept']=function(_0x15126e,_0x498a10){var _0x4938c5={'agent':{},'channel':_0xdd16('0x64')};if(_0x15126e[_0xdd16('0x48')]['id']){delete _0x15126e['body']['id'];}_0x15126e['body'][_0xdd16('0x65')]=!![];_0x15126e['body']['readAt']=moment()[_0xdd16('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x15126e['body'][_0xdd16('0x66')]=_0x15126e[_0xdd16('0x48')]['UserId']||_0x15126e['user']['id'];_0x4938c5['agent']['id']=_0x15126e[_0xdd16('0x48')][_0xdd16('0x66')];return db['MailMessage'][_0xdd16('0x49')]({'where':{'id':_0x15126e['params']['id'],'UserId':null}})[_0xdd16('0x26')](handleEntityNotFound(_0x498a10,null))['then'](saveUpdates(_0x15126e[_0xdd16('0x48')],null))['then'](function(_0xd24135){if(_0xd24135){_0x4938c5[_0xdd16('0x1a')]=_0xd24135[_0xdd16('0x67')]({'plain':!![]});return db[_0xdd16('0x68')][_0xdd16('0x49')]({'where':{'id':_0xd24135[_0xdd16('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x498a10,null))[_0xdd16('0x26')](function(_0x458bec){if(_0x458bec){return _0x458bec[_0xdd16('0x25')]({'UserId':_0x15126e[_0xdd16('0x48')][_0xdd16('0x66')],'read1stAt':_[_0xdd16('0x6a')](_0x458bec['read1stAt'])?moment()[_0xdd16('0x61')](_0xdd16('0x62')):undefined});}return null;})[_0xdd16('0x26')](function(_0x32cf2b){if(_0x32cf2b){_0x4938c5[_0xdd16('0x6b')]=_0x32cf2b[_0xdd16('0x67')]({'plain':!![]});interaction_log['info'](_0xdd16('0x6c'),_0x15126e[_0xdd16('0x6d')]['id'],_0x15126e['user'][_0xdd16('0x29')],_0x15126e[_0xdd16('0x6d')]['role'],_0x4938c5[_0xdd16('0x6b')]['id'],_0x15126e[_0xdd16('0x48')]?JSON[_0xdd16('0x63')](_0x15126e['body']):_0xdd16('0x6e'));return respondWithRpcPromise(_0xdd16('0x6f'),_0xdd16('0x70'),_0x4938c5);}return null;})[_0xdd16('0x26')](function(_0x114364){var _0x1e8af9=_0xdd16('0x71')+_0x114364[_0xdd16('0x1a')][_0xdd16('0x72')];return db[_0xdd16('0x73')][_0xdd16('0x31')](_0x1e8af9,{'type':db['Sequelize'][_0xdd16('0x74')][_0xdd16('0x75')],'raw':!![]})[_0xdd16('0x26')](function(_0x56a469){return _0x56a469;});})[_0xdd16('0x26')](function(_0x400f09){if(_0x400f09){_0x4938c5[_0xdd16('0x1a')][_0xdd16('0x76')]=_0x400f09[0x0];if(!_0x15126e[_0xdd16('0x48')][_0xdd16('0x66')])return;return db[_0xdd16('0x77')][_0xdd16('0x49')]({'where':{'id':_0x15126e[_0xdd16('0x48')][_0xdd16('0x66')],'role':_0xdd16('0x78')},'attributes':['id',_0xdd16('0x29'),'fullname',_0xdd16('0x79'),'internal'],'raw':!![]});}return null;})[_0xdd16('0x26')](function(_0x3520f2){if(!_0x3520f2)return null;_0x4938c5[_0xdd16('0x1a')][_0xdd16('0x78')]=_0x3520f2;return _0x4938c5;})[_0xdd16('0x26')](function(_0x20a704){if(_0x20a704){if(_0x15126e[_0xdd16('0x48')]['manual']){_0x4938c5[_0xdd16('0x1a')]['interface']=util[_0xdd16('0x61')](_0xdd16('0x7a'),_0x15126e[_0xdd16('0x6d')][_0xdd16('0x29')]);_0x4938c5[_0xdd16('0x1a')][_0xdd16('0x7b')]=_0x4938c5[_0xdd16('0x7b')];_0x4938c5['message']['motionChannel']=_0x4938c5['channel'];_0x4938c5[_0xdd16('0x1a')][_0xdd16('0x7c')]='accept';_0x4938c5[_0xdd16('0x1a')][_0xdd16('0x48')]=htmlToText[_0xdd16('0x7d')](_0x4938c5[_0xdd16('0x1a')][_0xdd16('0x48')]);return respondWithRpcPromise(_0xdd16('0x7e'),'EventManager',{'event':_0xdd16('0x7f'),'message':_0x4938c5['message']},client9002)[_0xdd16('0x26')](function(){return _0x4938c5;});}return _0x4938c5;}return null;})[_0xdd16('0x26')](respondWithResult(_0x498a10,null))[_0xdd16('0x1c')](handleError(_0x498a10,null));};exports['reject']=function(_0x2cfc74,_0x3771af){var _0x49fbc3={'agent':{},'channel':_0xdd16('0x64')};if(_0x2cfc74[_0xdd16('0x48')]['id']){delete _0x2cfc74[_0xdd16('0x48')]['id'];}_0x2cfc74[_0xdd16('0x48')][_0xdd16('0x66')]=_0x2cfc74[_0xdd16('0x48')]['UserId']||_0x2cfc74[_0xdd16('0x6d')]['id'];_0x49fbc3['agent']['id']=_0x2cfc74[_0xdd16('0x48')][_0xdd16('0x66')];return db[_0xdd16('0x2b')][_0xdd16('0x49')]({'where':{'id':_0x2cfc74[_0xdd16('0x45')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3771af,null))[_0xdd16('0x26')](function(_0x425092){if(_0x425092){_0x49fbc3['message']=_0x425092[_0xdd16('0x67')]({'plain':!![]});return db[_0xdd16('0x68')][_0xdd16('0x49')]({'where':{'id':_0x425092[_0xdd16('0x69')]}});}return null;})[_0xdd16('0x26')](handleEntityNotFound(_0x3771af,null))[_0xdd16('0x26')](function(_0x36e76b){if(_0x36e76b){_0x49fbc3[_0xdd16('0x6b')]=_0x36e76b[_0xdd16('0x67')]({'plain':!![]});interaction_log[_0xdd16('0x14')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2cfc74[_0xdd16('0x6d')]['id'],_0x2cfc74[_0xdd16('0x6d')][_0xdd16('0x29')],_0x2cfc74[_0xdd16('0x6d')][_0xdd16('0x80')],_0x49fbc3['interaction']['id'],_0x2cfc74[_0xdd16('0x48')]?JSON[_0xdd16('0x63')](_0x2cfc74[_0xdd16('0x48')]):_0xdd16('0x6e'));return respondWithRpcPromise(_0xdd16('0x81'),'rejectMessage',_0x49fbc3);}return null;})[_0xdd16('0x26')](function(_0x3ecd35){var _0x4b2954=_0xdd16('0x71')+_0x3ecd35[_0xdd16('0x1a')][_0xdd16('0x72')];return db[_0xdd16('0x73')][_0xdd16('0x31')](_0x4b2954,{'type':db[_0xdd16('0x82')]['QueryTypes'][_0xdd16('0x75')],'raw':!![]})[_0xdd16('0x26')](function(_0x1f2f2b){return _0x1f2f2b;});})[_0xdd16('0x26')](function(_0x553004){if(_0x553004){_0x49fbc3[_0xdd16('0x1a')][_0xdd16('0x76')]=_0x553004[0x0];if(!_0x2cfc74[_0xdd16('0x48')][_0xdd16('0x66')])return;return db[_0xdd16('0x77')][_0xdd16('0x49')]({'where':{'id':_0x2cfc74['body']['UserId'],'role':_0xdd16('0x78')},'attributes':['id',_0xdd16('0x29'),_0xdd16('0x83'),_0xdd16('0x79'),'internal'],'raw':!![]});}return null;})[_0xdd16('0x26')](function(_0x3eeb2e){if(!_0x3eeb2e)return null;_0x49fbc3[_0xdd16('0x1a')][_0xdd16('0x78')]=_0x3eeb2e;return _0x49fbc3;})[_0xdd16('0x26')](function(_0x4cb160){if(_0x4cb160){_0x4cb160[_0xdd16('0x1a')][_0xdd16('0x84')]=util['format'](_0xdd16('0x7a'),_0x2cfc74[_0xdd16('0x6d')][_0xdd16('0x29')]);_0x4cb160[_0xdd16('0x1a')][_0xdd16('0x7b')]=_0x49fbc3[_0xdd16('0x7b')];_0x4cb160['message'][_0xdd16('0x85')]=_0x49fbc3[_0xdd16('0x7b')];_0x4cb160['message']['event']=_0xdd16('0x86');_0x4cb160[_0xdd16('0x1a')][_0xdd16('0x48')]=htmlToText[_0xdd16('0x7d')](_0x49fbc3[_0xdd16('0x1a')][_0xdd16('0x48')]);respondWithRpcPromise('EventManager','EventManager',{'event':_0xdd16('0x87'),'message':_0x4cb160[_0xdd16('0x1a')]},client9002);return _0x49fbc3;}return null;})[_0xdd16('0x26')](respondWithResult(_0x3771af,null))[_0xdd16('0x1c')](handleError(_0x3771af,null));};exports[_0xdd16('0x88')]=function(_0x14ae40,_0x3e4424){var _0x2e6cf1=moment()[_0xdd16('0x89')]()['toString']();var _0x337e31=path[_0xdd16('0x59')](config[_0xdd16('0x5a')],_0xdd16('0x8a'),_0xdd16('0x8b'),_0xdd16('0x8c'));var _0x5f4517=path[_0xdd16('0x59')](config['root'],_0xdd16('0x8a'),'files','attachments');var _0x275c8a=util[_0xdd16('0x61')](_0xdd16('0x8d'),_0x2e6cf1);return db[_0xdd16('0x2b')][_0xdd16('0x49')]({'where':{'id':_0x14ae40['params']['id']},'attributes':['id',_0xdd16('0x48'),_0xdd16('0x8e'),'to','cc','bcc',_0xdd16('0x8f'),_0xdd16('0x90')],'include':_0x14ae40['query'][_0xdd16('0x58')]?[{'model':db[_0xdd16('0x91')],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x3e4424,null))['then'](function(_0x691d01){if(_0x691d01){var _0x457e48=_0x691d01;var _0x41b3bf={'from':_0x457e48[_0xdd16('0x8e')],'to':_0x457e48['to'],'subject':_0x457e48[_0xdd16('0x8f')],'html':htmlEntities[_0xdd16('0x92')](_0x457e48[_0xdd16('0x48')]),'headers':{'Date':moment(_0x457e48[_0xdd16('0x90')])[_0xdd16('0x61')](_0xdd16('0x93'))},'attachments':[]};if(_0x691d01['cc']){_0x41b3bf[_0xdd16('0x94')]['Cc']=_0x691d01['cc'];}if(_0x691d01[_0xdd16('0x95')]){_0x41b3bf['headers'][_0xdd16('0x96')]=_0x691d01['bcc'];}return new BPromise(function(_0x4f4a31,_0x2eb356){if(_0x691d01['Attachments']){for(var _0x3123c0=0x0;_0x3123c0<_0x691d01[_0xdd16('0x97')][_0xdd16('0x35')];_0x3123c0++){var _0x5eae58=_0x691d01[_0xdd16('0x97')][_0x3123c0];var _0x13e869=path['join'](_0x5f4517,_0x5eae58[_0xdd16('0x5c')]);if(fs[_0xdd16('0x98')](_0x13e869)){_0x41b3bf[_0xdd16('0x58')][_0xdd16('0x99')]({'name':_0x5eae58[_0xdd16('0x29')],'contentType':_0x5eae58[_0xdd16('0x2e')],'data':fs[_0xdd16('0x9a')](_0x13e869)});}}}emlformat[_0xdd16('0x9b')](_0x41b3bf,function(_0x83238f,_0x5713c5){if(_0x83238f)return _0x2eb356(_0x83238f);fs['writeFileSync'](path['join'](_0x337e31,_0x275c8a),_0x5713c5);return _0x4f4a31(_0x5713c5);});});}})[_0xdd16('0x26')](function(_0x19a1e9){if(_0x19a1e9){return _0x3e4424[_0xdd16('0x88')](path['join'](_0x337e31,_0x275c8a),_0x275c8a,function(_0x3ebf78){if(!_0x3ebf78)fs[_0xdd16('0x9c')](path[_0xdd16('0x59')](_0x337e31,_0x275c8a));});}})['catch'](handleError(_0x3e4424,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 5295283..5c954f7 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 _0x9a9a=['emit','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x3d2438,_0x2e7922){var _0xd18de5=function(_0xe8a130){while(--_0xe8a130){_0x3d2438['push'](_0x3d2438['shift']());}};_0xd18de5(++_0x2e7922);}(_0x9a9a,0x1f3));var _0xa9a9=function(_0x37ebb9,_0x1eee5d){_0x37ebb9=_0x37ebb9-0x0;var _0x34f586=_0x9a9a[_0x37ebb9];return _0x34f586;};'use strict';var EventEmitter=require(_0xa9a9('0x0'));var MailMessage=require(_0xa9a9('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xa9a9('0x2')](0x0);var events={'afterCreate':_0xa9a9('0x3'),'afterUpdate':_0xa9a9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5caeea){return function(_0x57d3d2,_0x232829,_0x13c511){MailMessageEvents['emit'](_0x5caeea+':'+_0x57d3d2['id'],_0x57d3d2);MailMessageEvents[_0xa9a9('0x5')](_0x5caeea,_0x57d3d2);_0x13c511(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xa9a9('0x6')](e,emitEvent(event));}}module[_0xa9a9('0x7')]=MailMessageEvents; \ No newline at end of file +var _0xf5bc=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners','save','update','remove'];(function(_0x10596a,_0x45c477){var _0x3d85bf=function(_0x6b9c9d){while(--_0x6b9c9d){_0x10596a['push'](_0x10596a['shift']());}};_0x3d85bf(++_0x45c477);}(_0xf5bc,0x13a));var _0xcf5b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf5bc[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xcf5b('0x0'))['db'][_0xcf5b('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xcf5b('0x2')](0x0);var events={'afterCreate':_0xcf5b('0x3'),'afterUpdate':_0xcf5b('0x4'),'afterDestroy':_0xcf5b('0x5')};function emitEvent(_0x2503d6){return function(_0x3a53a4,_0x3455c6,_0x1cabbe){MailMessageEvents[_0xcf5b('0x6')](_0x2503d6+':'+_0x3a53a4['id'],_0x3a53a4);MailMessageEvents[_0xcf5b('0x6')](_0x2503d6,_0x3a53a4);_0x1cabbe(null);};}for(var e in events){if(events[_0xcf5b('0x7')](e)){var event=events[e];MailMessage[_0xcf5b('0x8')](e,emitEvent(event));}}module[_0xcf5b('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 5e925c1..5ab6fd9 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 _0x8231=['toLowerCase','out','secret','isNil','UserId','findOne','MailInteractionId','then','update','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','define','MailMessage','messageId','plainBody','FULLTEXT','body','fromString','models','get','direction'];(function(_0x5036ee,_0x5906be){var _0x57018c=function(_0xb303b5){while(--_0xb303b5){_0x5036ee['push'](_0x5036ee['shift']());}};_0x57018c(++_0x5906be);}(_0x8231,0x87));var _0x1823=function(_0xb53fa5,_0x315816){_0xb53fa5=_0xb53fa5-0x0;var _0x3a927a=_0x8231[_0xb53fa5];return _0x3a927a;};'use strict';var _=require(_0x1823('0x0'));var util=require(_0x1823('0x1'));var logger=require(_0x1823('0x2'))('api');var moment=require(_0x1823('0x3'));var BPromise=require('bluebird');var rp=require(_0x1823('0x4'));var htmlToText=require(_0x1823('0x5'));var fs=require('fs');var path=require(_0x1823('0x6'));var rimraf=require(_0x1823('0x7'));var config=require(_0x1823('0x8'));var attributes=require(_0x1823('0x9'));module['exports']=function(_0x17627f,_0x10b329){return _0x17627f[_0x1823('0xa')](_0x1823('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x1823('0xc'),'fields':[_0x1823('0xc')]},{'name':'fti_mail_messages','fields':[_0x1823('0xd'),'subject'],'type':_0x1823('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1113e4,_0x32911f,_0x3d6bc4){if(_0x1113e4[_0x1823('0xf')]){_0x1113e4[_0x1823('0xd')]=htmlToText[_0x1823('0x10')](_0x1113e4[_0x1823('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3d6bc4(null,_0x32911f);},'afterCreate':function(_0x32969,_0x34e969,_0x4ef9e5){var _0x237781=_0x17627f[_0x1823('0x11')];var _0x2bab48=_0x32969[_0x1823('0x12')]({'plain':!![]});if(_0x2bab48[_0x1823('0x13')]['toLowerCase']()==='in'||_0x2bab48['direction'][_0x1823('0x14')]()===_0x1823('0x15')&&!_0x2bab48[_0x1823('0x16')]&&!_[_0x1823('0x17')](_0x2bab48[_0x1823('0x18')])){_0x237781['MailInteraction'][_0x1823('0x19')]({'where':{'id':_0x2bab48[_0x1823('0x1a')]}})[_0x1823('0x1b')](function(_0x42d114){if(_0x42d114){_0x42d114[_0x1823('0x1c')]({'lastMsgAt':_0x2bab48['createdAt'],'lastMsgDirection':_0x2bab48[_0x1823('0x13')][_0x1823('0x14')]()});}})['catch'](function(_0xed5ebd){console['error'](_0xed5ebd);});}_0x4ef9e5();}},'charset':_0x1823('0x1d'),'collate':_0x1823('0x1e')});}; \ No newline at end of file +var _0x04fc=['html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','plainBody','subject','FULLTEXT','body','fromString','models','get','toLowerCase','direction','out','secret','UserId','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash','util','api','moment','bluebird','request-promise'];(function(_0x238078,_0x3a6c92){var _0x549178=function(_0x58f173){while(--_0x58f173){_0x238078['push'](_0x238078['shift']());}};_0x549178(++_0x3a6c92);}(_0x04fc,0xae));var _0xc04f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x04fc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc04f('0x0'));var util=require(_0xc04f('0x1'));var logger=require('../../config/logger')(_0xc04f('0x2'));var moment=require(_0xc04f('0x3'));var BPromise=require(_0xc04f('0x4'));var rp=require(_0xc04f('0x5'));var htmlToText=require(_0xc04f('0x6'));var fs=require('fs');var path=require(_0xc04f('0x7'));var rimraf=require(_0xc04f('0x8'));var config=require(_0xc04f('0x9'));var attributes=require(_0xc04f('0xa'));module[_0xc04f('0xb')]=function(_0x2435f0,_0x1bc27e){return _0x2435f0[_0xc04f('0xc')](_0xc04f('0xd'),attributes,{'tableName':_0xc04f('0xe'),'paranoid':![],'indexes':[{'name':_0xc04f('0xf'),'fields':[_0xc04f('0xf')]},{'name':'fti_mail_messages','fields':[_0xc04f('0x10'),_0xc04f('0x11')],'type':_0xc04f('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1d2d4c,_0x26fad0,_0x410eff){if(_0x1d2d4c[_0xc04f('0x13')]){_0x1d2d4c['plainBody']=htmlToText[_0xc04f('0x14')](_0x1d2d4c[_0xc04f('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x410eff(null,_0x26fad0);},'afterCreate':function(_0x8e3b47,_0x2c0b5b,_0xb6d5f0){var _0x3176d9=_0x2435f0[_0xc04f('0x15')];var _0x48b413=_0x8e3b47[_0xc04f('0x16')]({'plain':!![]});if(_0x48b413['direction'][_0xc04f('0x17')]()==='in'||_0x48b413[_0xc04f('0x18')][_0xc04f('0x17')]()===_0xc04f('0x19')&&!_0x48b413[_0xc04f('0x1a')]&&!_['isNil'](_0x48b413[_0xc04f('0x1b')])){_0x3176d9['MailInteraction'][_0xc04f('0x1c')]({'where':{'id':_0x48b413[_0xc04f('0x1d')]}})[_0xc04f('0x1e')](function(_0x41dfe5){if(_0x41dfe5){_0x41dfe5[_0xc04f('0x1f')]({'lastMsgAt':_0x48b413[_0xc04f('0x20')],'lastMsgDirection':_0x48b413['direction']['toLowerCase']()});}})[_0xc04f('0x21')](function(_0x5cd3c4){console[_0xc04f('0x22')](_0x5cd3c4);});}_0xb6d5f0();}},'charset':_0xc04f('0x23'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 0f19aca..238a04f 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 _0x4991=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','then','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','MailMessage,\x20%s,\x20%s','info','result','MailMessage','create','body','options','raw','CreateMailMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2353e9,_0x582ad5){var _0x5c0bfe=function(_0x5ca5a5){while(--_0x5ca5a5){_0x2353e9['push'](_0x2353e9['shift']());}};_0x5c0bfe(++_0x582ad5);}(_0x4991,0xf7));var _0x1499=function(_0x1260d7,_0x3b037c){_0x1260d7=_0x1260d7-0x0;var _0x55cbfa=_0x4991[_0x1260d7];return _0x55cbfa;};'use strict';var _=require(_0x1499('0x0'));var util=require('util');var moment=require(_0x1499('0x1'));var BPromise=require('bluebird');var rs=require(_0x1499('0x2'));var fs=require('fs');var Redis=require(_0x1499('0x3'));var db=require(_0x1499('0x4'))['db'];var utils=require(_0x1499('0x5'));var logger=require(_0x1499('0x6'))(_0x1499('0x7'));var config=require(_0x1499('0x8'));var jayson=require(_0x1499('0x9'));var client=jayson['client'][_0x1499('0xa')]({'port':0x232a});config[_0x1499('0xb')]=_[_0x1499('0xc')](config[_0x1499('0xb')],{'host':_0x1499('0xd'),'port':0x18eb});var socket=require(_0x1499('0xe'))(new Redis(config[_0x1499('0xb')]));require(_0x1499('0xf'))['register'](socket);function respondWithRpcPromise(_0x16e8ad,_0x36a053,_0x575251){return new BPromise(function(_0x2a4816,_0x352180){return client['request'](_0x16e8ad,_0x575251)[_0x1499('0x10')](function(_0x2867b1){logger['info']('MailMessage,\x20%s,\x20%s',_0x36a053,'request\x20sent');logger[_0x1499('0x11')](_0x1499('0x12'),_0x36a053,_0x1499('0x13'),JSON[_0x1499('0x14')](_0x2867b1));if(_0x2867b1[_0x1499('0x15')]){if(_0x2867b1['error']['code']===0x1f4){logger[_0x1499('0x15')]('MailMessage,\x20%s,\x20%s',_0x36a053,_0x2867b1[_0x1499('0x15')][_0x1499('0x16')]);return _0x352180(_0x2867b1[_0x1499('0x15')][_0x1499('0x16')]);}logger['error'](_0x1499('0x17'),_0x36a053,_0x2867b1[_0x1499('0x15')]['message']);return _0x2a4816(_0x2867b1[_0x1499('0x15')][_0x1499('0x16')]);}else{logger[_0x1499('0x18')](_0x1499('0x17'),_0x36a053,_0x1499('0x13'));_0x2a4816(_0x2867b1[_0x1499('0x19')]['message']);}})['catch'](function(_0x5bcb5f){logger[_0x1499('0x15')](_0x1499('0x17'),_0x36a053,_0x5bcb5f);_0x352180(_0x5bcb5f);});});}exports['CreateMailMessage']=function(_0x351da9){var _0x3c13a1=this;return new Promise(function(_0x28dff3,_0x18e4a6){return db[_0x1499('0x1a')][_0x1499('0x1b')](_0x351da9[_0x1499('0x1c')],{'raw':_0x351da9[_0x1499('0x1d')]?_0x351da9[_0x1499('0x1d')][_0x1499('0x1e')]===undefined?!![]:![]:!![]})[_0x1499('0x10')](function(_0x836081){logger[_0x1499('0x18')](_0x1499('0x1f'),_0x351da9);logger[_0x1499('0x11')](_0x1499('0x1f'),_0x351da9,JSON[_0x1499('0x14')](_0x836081));_0x28dff3(_0x836081);})['catch'](function(_0x258e9c){logger[_0x1499('0x15')](_0x1499('0x1f'),_0x258e9c[_0x1499('0x16')],_0x351da9);_0x18e4a6(_0x3c13a1[_0x1499('0x15')](0x1f4,_0x258e9c[_0x1499('0x16')]));});});}; \ No newline at end of file +var _0x2272=['MailMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','CreateMailMessage'];(function(_0x27e367,_0x3fde2f){var _0x58cf10=function(_0x164ae0){while(--_0x164ae0){_0x27e367['push'](_0x27e367['shift']());}};_0x58cf10(++_0x3fde2f);}(_0x2272,0xd8));var _0x2227=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2272[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));var BPromise=require(_0x2227('0x3'));var rs=require(_0x2227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2227('0x5'))['db'];var utils=require(_0x2227('0x6'));var logger=require(_0x2227('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2227('0x8'));var client=jayson[_0x2227('0x9')][_0x2227('0xa')]({'port':0x232a});config[_0x2227('0xb')]=_[_0x2227('0xc')](config[_0x2227('0xb')],{'host':_0x2227('0xd'),'port':0x18eb});var socket=require(_0x2227('0xe'))(new Redis(config[_0x2227('0xb')]));require(_0x2227('0xf'))['register'](socket);function respondWithRpcPromise(_0x799370,_0x5c1cba,_0x2f66ca){return new BPromise(function(_0x2d1c39,_0x164735){return client[_0x2227('0x10')](_0x799370,_0x2f66ca)[_0x2227('0x11')](function(_0x51ed54){logger[_0x2227('0x12')](_0x2227('0x13'),_0x5c1cba,_0x2227('0x14'));logger[_0x2227('0x15')](_0x2227('0x16'),_0x5c1cba,_0x2227('0x14'),JSON['stringify'](_0x51ed54));if(_0x51ed54['error']){if(_0x51ed54['error'][_0x2227('0x17')]===0x1f4){logger['error'](_0x2227('0x13'),_0x5c1cba,_0x51ed54[_0x2227('0x18')]['message']);return _0x164735(_0x51ed54[_0x2227('0x18')][_0x2227('0x19')]);}logger[_0x2227('0x18')](_0x2227('0x13'),_0x5c1cba,_0x51ed54[_0x2227('0x18')][_0x2227('0x19')]);return _0x2d1c39(_0x51ed54['error'][_0x2227('0x19')]);}else{logger[_0x2227('0x12')](_0x2227('0x13'),_0x5c1cba,'request\x20sent');_0x2d1c39(_0x51ed54[_0x2227('0x1a')][_0x2227('0x19')]);}})[_0x2227('0x1b')](function(_0x2482ba){logger[_0x2227('0x18')](_0x2227('0x13'),_0x5c1cba,_0x2482ba);_0x164735(_0x2482ba);});});}exports[_0x2227('0x1c')]=function(_0x4e0bba){var _0x386e6a=this;return new Promise(function(_0x59f988,_0x2b26b7){return db[_0x2227('0x1d')][_0x2227('0x1e')](_0x4e0bba[_0x2227('0x1f')],{'raw':_0x4e0bba[_0x2227('0x20')]?_0x4e0bba[_0x2227('0x20')][_0x2227('0x21')]===undefined?!![]:![]:!![]})[_0x2227('0x11')](function(_0x3299fd){logger[_0x2227('0x12')](_0x2227('0x1c'),_0x4e0bba);logger['debug'](_0x2227('0x1c'),_0x4e0bba,JSON[_0x2227('0x22')](_0x3299fd));_0x59f988(_0x3299fd);})['catch'](function(_0x2cef4b){logger[_0x2227('0x18')]('CreateMailMessage',_0x2cef4b['message'],_0x4e0bba);_0x2b26b7(_0x386e6a[_0x2227('0x18')](0x1f4,_0x2cef4b[_0x2227('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index e941138..f6634be 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 _0x09a4=['register','length','mailMessage:','./mailMessage.events','update','removeListener'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x09a4,0x147));var _0x409a=function(_0x5e4944,_0x2becb9){_0x5e4944=_0x5e4944-0x0;var _0x548943=_0x09a4[_0x5e4944];return _0x548943;};'use strict';var MailMessageEvents=require(_0x409a('0x0'));var events=['save','remove',_0x409a('0x1')];function createListener(_0xf3ff46,_0x2135ab){return function(_0x1e87b0){_0x2135ab['emit'](_0xf3ff46,_0x1e87b0);};}function removeListener(_0x2db9e0,_0x630525){return function(){MailMessageEvents[_0x409a('0x2')](_0x2db9e0,_0x630525);};}exports[_0x409a('0x3')]=function(_0x168549){for(var _0x1485d9=0x0,_0x18e817=events[_0x409a('0x4')];_0x1485d9<_0x18e817;_0x1485d9++){var _0x148e53=events[_0x1485d9];var _0x21ac13=createListener(_0x409a('0x5')+_0x148e53,_0x168549);MailMessageEvents['on'](_0x148e53,_0x21ac13);}}; \ No newline at end of file +var _0x0751=['update','emit','removeListener','register','./mailMessage.events','save','remove'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x0751,0xd6));var _0x1075=function(_0x2fc83e,_0x7eddee){_0x2fc83e=_0x2fc83e-0x0;var _0x2f6e38=_0x0751[_0x2fc83e];return _0x2f6e38;};'use strict';var MailMessageEvents=require(_0x1075('0x0'));var events=[_0x1075('0x1'),_0x1075('0x2'),_0x1075('0x3')];function createListener(_0x5ba0ae,_0x42781e){return function(_0xd4a405){_0x42781e[_0x1075('0x4')](_0x5ba0ae,_0xd4a405);};}function removeListener(_0x63e36b,_0x5d57f3){return function(){MailMessageEvents[_0x1075('0x5')](_0x63e36b,_0x5d57f3);};}exports[_0x1075('0x6')]=function(_0x326346){for(var _0x57e76a=0x0,_0x2c5597=events['length'];_0x57e76a<_0x2c5597;_0x57e76a++){var _0x1a0733=events[_0x57e76a];var _0xd4f952=createListener('mailMessage:'+_0x1a0733,_0x326346);MailMessageEvents['on'](_0x1a0733,_0xd4f952);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 6352ede..8582b2c 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 _0x4dab=['util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','index','/describe','isAuthenticated','describe','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','put','delete','/:id','removeTeams','removeAgents','exports','multer'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4dab,0x1bf));var _0xb4da=function(_0x1c9dd8,_0x371aa4){_0x1c9dd8=_0x1c9dd8-0x0;var _0x5e8635=_0x4dab[_0x1c9dd8];return _0x5e8635;};'use strict';var multer=require(_0xb4da('0x0'));var util=require(_0xb4da('0x1'));var path=require(_0xb4da('0x2'));var timeout=require('connect-timeout');var express=require(_0xb4da('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb4da('0x4'));var interaction=require(_0xb4da('0x5'));var config=require(_0xb4da('0x6'));var controller=require(_0xb4da('0x7'));router[_0xb4da('0x8')]('/',auth['isAuthenticated'](),controller[_0xb4da('0x9')]);router[_0xb4da('0x8')](_0xb4da('0xa'),auth[_0xb4da('0xb')](),controller[_0xb4da('0xc')]);router[_0xb4da('0x8')]('/:id',auth[_0xb4da('0xb')](),controller['show']);router[_0xb4da('0x8')](_0xb4da('0xd'),auth[_0xb4da('0xb')](),controller[_0xb4da('0xe')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0xb4da('0xf')]);router[_0xb4da('0x8')](_0xb4da('0x10'),auth[_0xb4da('0xb')](),controller[_0xb4da('0x11')]);router[_0xb4da('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xb4da('0x13'),auth['isAuthenticated'](),controller[_0xb4da('0x14')]);router[_0xb4da('0x12')](_0xb4da('0x10'),auth[_0xb4da('0xb')](),controller[_0xb4da('0x15')]);router[_0xb4da('0x16')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb4da('0x17')](_0xb4da('0x18'),auth[_0xb4da('0xb')](),controller['destroy']);router[_0xb4da('0x17')](_0xb4da('0x13'),auth[_0xb4da('0xb')](),controller[_0xb4da('0x19')]);router[_0xb4da('0x17')](_0xb4da('0x10'),auth[_0xb4da('0xb')](),controller[_0xb4da('0x1a')]);module[_0xb4da('0x1b')]=router; \ No newline at end of file +var _0x092d=['/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x092d,0x7f));var _0xd092=function(_0x5de390,_0x3b9908){_0x5de390=_0x5de390-0x0;var _0x12bf75=_0x092d[_0x5de390];return _0x12bf75;};'use strict';var multer=require('multer');var util=require(_0xd092('0x0'));var path=require('path');var timeout=require(_0xd092('0x1'));var express=require(_0xd092('0x2'));var router=express[_0xd092('0x3')]();var fs_extra=require(_0xd092('0x4'));var auth=require(_0xd092('0x5'));var interaction=require(_0xd092('0x6'));var config=require(_0xd092('0x7'));var controller=require('./mailQueue.controller');router[_0xd092('0x8')]('/',auth[_0xd092('0x9')](),controller[_0xd092('0xa')]);router[_0xd092('0x8')](_0xd092('0xb'),auth[_0xd092('0x9')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd092('0xc')]);router[_0xd092('0x8')](_0xd092('0xd'),auth[_0xd092('0x9')](),controller['getMembers']);router[_0xd092('0x8')](_0xd092('0xe'),auth[_0xd092('0x9')](),controller[_0xd092('0xf')]);router[_0xd092('0x8')](_0xd092('0x10'),auth[_0xd092('0x9')](),controller[_0xd092('0x11')]);router[_0xd092('0x12')]('/',auth['isAuthenticated'](),controller[_0xd092('0x13')]);router['post'](_0xd092('0xe'),auth['isAuthenticated'](),controller[_0xd092('0x14')]);router[_0xd092('0x12')](_0xd092('0x10'),auth[_0xd092('0x9')](),controller[_0xd092('0x15')]);router[_0xd092('0x16')](_0xd092('0x17'),auth[_0xd092('0x9')](),controller[_0xd092('0x18')]);router[_0xd092('0x19')]('/:id',auth[_0xd092('0x9')](),controller[_0xd092('0x1a')]);router[_0xd092('0x19')](_0xd092('0xe'),auth[_0xd092('0x9')](),controller['removeTeams']);router[_0xd092('0x19')](_0xd092('0x10'),auth[_0xd092('0x9')](),controller['removeAgents']);module[_0xd092('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 90593dc..4fcc1e0 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 _0x3198=['name','STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x3b085,_0x250543){var _0x476a57=function(_0x480941){while(--_0x480941){_0x3b085['push'](_0x3b085['shift']());}};_0x476a57(++_0x250543);}(_0x3198,0x196));var _0x8319=function(_0x2ab35b,_0x5072ae){_0x2ab35b=_0x2ab35b-0x0;var _0x51cdbb=_0x3198[_0x2ab35b];return _0x51cdbb;};'use strict';var Sequelize=require(_0x8319('0x0'));module[_0x8319('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8319('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8319('0x3')]},'timeout':{'type':Sequelize[_0x8319('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8319('0x5'),_0x8319('0x6'),_0x8319('0x7'))}}; \ No newline at end of file +var _0x0676=['sequelize','exports','STRING','ENUM','rrmemory','beepall','roundrobin'];(function(_0x13f6fe,_0x4864c0){var _0x49aafb=function(_0x61e319){while(--_0x61e319){_0x13f6fe['push'](_0x13f6fe['shift']());}};_0x49aafb(++_0x4864c0);}(_0x0676,0x150));var _0x6067=function(_0x43cddf,_0x2d5bfb){_0x43cddf=_0x43cddf-0x0;var _0x1b2562=_0x0676[_0x43cddf];return _0x1b2562;};'use strict';var Sequelize=require(_0x6067('0x0'));module[_0x6067('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6067('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6067('0x3')](_0x6067('0x4'),_0x6067('0x5'),_0x6067('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 3c913ac..27c0050 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 _0x8029=['socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','then','destroy','get','UserProfileResource','error','stack','name','index','map','MailQueue','fieldName','key','keys','model','attributes','intersection','query','length','sort','where','filters','pick','filter','merge','type','options','includeAll','include','show','rawAttributes','fields','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','find','userProfileId','update','params','describe','getMembers','findOne','nolimit','order','MailQueueId','UserMailQueue','User','findAndCountAll','agent','updatedAt','createdAt','format','%s/%s','SIP','mailPause','Team','ids','findAll','Agents','voicePause','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','addAgents','spread','isArray','userMailQueue:remove','getAgents','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost'];(function(_0x8b96a,_0x5758b2){var _0x29ddd1=function(_0x1afa06){while(--_0x1afa06){_0x8b96a['push'](_0x8b96a['shift']());}};_0x29ddd1(++_0x5758b2);}(_0x8029,0xf8));var _0x9802=function(_0x1b7b09,_0x353b15){_0x1b7b09=_0x1b7b09-0x0;var _0x34825b=_0x8029[_0x1b7b09];return _0x34825b;};'use strict';var emlformat=require(_0x9802('0x0'));var rimraf=require(_0x9802('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9802('0x2'));var rp=require(_0x9802('0x3'));var moment=require(_0x9802('0x4'));var BPromise=require(_0x9802('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9802('0x6'));var sox=require(_0x9802('0x7'));var csv=require(_0x9802('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9802('0x9'));var crypto=require(_0x9802('0xa'));var jsforce=require(_0x9802('0xb'));var deskjs=require(_0x9802('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9802('0xd'));var Papa=require(_0x9802('0xe'));var Redis=require('ioredis');var authService=require(_0x9802('0xf'));var qs=require(_0x9802('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9802('0x11'));var utils=require(_0x9802('0x12'));var config=require(_0x9802('0x13'));var licenseUtil=require(_0x9802('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x9802('0x15')](config[_0x9802('0x16')],{'host':_0x9802('0x17'),'port':0x18eb});var socket=require(_0x9802('0x18'))(new Redis(config[_0x9802('0x16')]));require(_0x9802('0x19'))[_0x9802('0x1a')](socket);function respondWithStatusCode(_0x302581,_0x26c3c3){_0x26c3c3=_0x26c3c3||0xcc;return function(_0x1d39ac){if(_0x1d39ac){return _0x302581[_0x9802('0x1b')](_0x26c3c3);}return _0x302581[_0x9802('0x1c')](_0x26c3c3)[_0x9802('0x1d')]();};}function respondWithResult(_0x4b6af1,_0x4a83ef){_0x4a83ef=_0x4a83ef||0xc8;return function(_0x364770){if(_0x364770){return _0x4b6af1[_0x9802('0x1c')](_0x4a83ef)[_0x9802('0x1e')](_0x364770);}};}function respondWithFilteredResult(_0x56c87a,_0x3a606d){return function(_0x1fd296){if(_0x1fd296){var _0x1b43f2=typeof _0x3a606d[_0x9802('0x1f')]===_0x9802('0x20')&&typeof _0x3a606d['limit']==='undefined';var _0x2496d6=_0x1fd296[_0x9802('0x21')];var _0x340c0e=_0x1b43f2?0x0:_0x3a606d[_0x9802('0x1f')];var _0x445a89=_0x1b43f2?_0x1fd296['count']:_0x3a606d[_0x9802('0x1f')]+_0x3a606d[_0x9802('0x22')];var _0x90e530;if(_0x445a89>=_0x2496d6){_0x445a89=_0x2496d6;_0x90e530=0xc8;}else{_0x90e530=0xce;}_0x56c87a[_0x9802('0x1c')](_0x90e530);return _0x56c87a[_0x9802('0x23')](_0x9802('0x24'),_0x340c0e+'-'+_0x445a89+'/'+_0x2496d6)[_0x9802('0x1e')](_0x1fd296);}return null;};}function patchUpdates(_0x63dc29){return function(_0x2bfd16){try{jsonpatch[_0x9802('0x25')](_0x2bfd16,_0x63dc29,!![]);}catch(_0x4275b4){return BPromise['reject'](_0x4275b4);}return _0x2bfd16['save']();};}function saveUpdates(_0x1163d6,_0x5a695d){return function(_0x43d624){if(_0x43d624){return _0x43d624['update'](_0x1163d6)[_0x9802('0x26')](function(_0x5e3f5a){return _0x5e3f5a;});}return null;};}function removeEntity(_0x2db763,_0x360413){return function(_0x52bb8){if(_0x52bb8){return _0x52bb8[_0x9802('0x27')]()[_0x9802('0x26')](function(){var _0x5a09c3=_0x52bb8[_0x9802('0x28')]({'plain':!![]});var _0x1e12c0='MailQueues';return db[_0x9802('0x29')]['destroy']({'where':{'type':_0x1e12c0,'resourceId':_0x5a09c3['id']}})['then'](function(){return _0x52bb8;});})['then'](function(){_0x2db763[_0x9802('0x1c')](0xcc)[_0x9802('0x1d')]();});}};}function handleEntityNotFound(_0x2e1c51,_0x47d424){return function(_0x575d01){if(!_0x575d01){_0x2e1c51[_0x9802('0x1b')](0x194);}return _0x575d01;};}function handleError(_0x58e8b4,_0x494ced){_0x494ced=_0x494ced||0x1f4;return function(_0x55a383){logger[_0x9802('0x2a')](_0x55a383[_0x9802('0x2b')]);if(_0x55a383[_0x9802('0x2c')]){delete _0x55a383[_0x9802('0x2c')];}_0x58e8b4[_0x9802('0x1c')](_0x494ced)['send'](_0x55a383);};}exports[_0x9802('0x2d')]=function(_0x1282b1,_0x6fb290){var _0x19e6ba={},_0x200cf2={},_0x23fb6e={'count':0x0,'rows':[]};var _0x60f593=_[_0x9802('0x2e')](db[_0x9802('0x2f')]['rawAttributes'],function(_0x56fd31){return{'name':_0x56fd31[_0x9802('0x30')],'type':_0x56fd31['type'][_0x9802('0x31')]};});_0x200cf2['model']=_[_0x9802('0x2e')](_0x60f593,_0x9802('0x2c'));_0x200cf2['query']=_[_0x9802('0x32')](_0x1282b1['query']);_0x200cf2['filters']=_['intersection'](_0x200cf2[_0x9802('0x33')],_0x200cf2['query']);_0x19e6ba[_0x9802('0x34')]=_[_0x9802('0x35')](_0x200cf2[_0x9802('0x33')],qs['fields'](_0x1282b1[_0x9802('0x36')]['fields']));_0x19e6ba[_0x9802('0x34')]=_0x19e6ba[_0x9802('0x34')][_0x9802('0x37')]?_0x19e6ba[_0x9802('0x34')]:_0x200cf2[_0x9802('0x33')];if(!_0x1282b1['query']['hasOwnProperty']('nolimit')){_0x19e6ba[_0x9802('0x22')]=qs[_0x9802('0x22')](_0x1282b1['query'][_0x9802('0x22')]);_0x19e6ba[_0x9802('0x1f')]=qs[_0x9802('0x1f')](_0x1282b1[_0x9802('0x36')]['offset']);}_0x19e6ba['order']=qs[_0x9802('0x38')](_0x1282b1['query'][_0x9802('0x38')]);_0x19e6ba[_0x9802('0x39')]=qs[_0x9802('0x3a')](_[_0x9802('0x3b')](_0x1282b1[_0x9802('0x36')],_0x200cf2[_0x9802('0x3a')]),_0x60f593);if(_0x1282b1[_0x9802('0x36')][_0x9802('0x3c')]){_0x19e6ba[_0x9802('0x39')]=_[_0x9802('0x3d')](_0x19e6ba[_0x9802('0x39')],{'$or':_['map'](_0x60f593,function(_0x23e0a1){if(_0x23e0a1[_0x9802('0x3e')]!=='VIRTUAL'){var _0x570024={};_0x570024[_0x23e0a1['name']]={'$like':'%'+_0x1282b1['query'][_0x9802('0x3c')]+'%'};return _0x570024;}})});}_0x19e6ba=_[_0x9802('0x3d')]({},_0x19e6ba,_0x1282b1[_0x9802('0x3f')]);var _0x4b73c3={'where':_0x19e6ba[_0x9802('0x39')]};return db['MailQueue']['count'](_0x4b73c3)[_0x9802('0x26')](function(_0x2b1e87){_0x23fb6e[_0x9802('0x21')]=_0x2b1e87;if(_0x1282b1['query'][_0x9802('0x40')]){_0x19e6ba[_0x9802('0x41')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0x19e6ba);})[_0x9802('0x26')](function(_0x350380){_0x23fb6e['rows']=_0x350380;return _0x23fb6e;})[_0x9802('0x26')](respondWithFilteredResult(_0x6fb290,_0x19e6ba))['catch'](handleError(_0x6fb290,null));};exports[_0x9802('0x42')]=function(_0x2601e5,_0x11893a){var _0x3ee9b9={'raw':!![],'where':{'id':_0x2601e5['params']['id']}},_0x4d12b5={};_0x4d12b5[_0x9802('0x33')]=_[_0x9802('0x32')](db[_0x9802('0x2f')][_0x9802('0x43')]);_0x4d12b5[_0x9802('0x36')]=_[_0x9802('0x32')](_0x2601e5[_0x9802('0x36')]);_0x4d12b5[_0x9802('0x3a')]=_[_0x9802('0x35')](_0x4d12b5[_0x9802('0x33')],_0x4d12b5[_0x9802('0x36')]);_0x3ee9b9[_0x9802('0x34')]=_[_0x9802('0x35')](_0x4d12b5[_0x9802('0x33')],qs[_0x9802('0x44')](_0x2601e5[_0x9802('0x36')][_0x9802('0x44')]));_0x3ee9b9['attributes']=_0x3ee9b9['attributes']['length']?_0x3ee9b9[_0x9802('0x34')]:_0x4d12b5[_0x9802('0x33')];if(_0x2601e5[_0x9802('0x36')][_0x9802('0x40')]){_0x3ee9b9[_0x9802('0x41')]=[{'all':!![]}];}_0x3ee9b9=_[_0x9802('0x3d')]({},_0x3ee9b9,_0x2601e5[_0x9802('0x3f')]);return db[_0x9802('0x2f')]['find'](_0x3ee9b9)['then'](handleEntityNotFound(_0x11893a,null))['then'](respondWithResult(_0x11893a,null))[_0x9802('0x45')](handleError(_0x11893a,null));};exports[_0x9802('0x46')]=function(_0x374101,_0x149e93){return db[_0x9802('0x2f')][_0x9802('0x46')](_0x374101[_0x9802('0x47')],{})[_0x9802('0x26')](function(_0x4a4fb5){var _0x53fb9c=_0x374101[_0x9802('0x48')][_0x9802('0x28')]({'plain':!![]});if(!_0x53fb9c)throw new Error(_0x9802('0x49'));if(_0x53fb9c[_0x9802('0x4a')]===_0x9802('0x48')){var _0x13f20a=_0x4a4fb5[_0x9802('0x28')]({'plain':!![]});var _0x598fb3=_0x9802('0x4b');return db['UserProfileSection'][_0x9802('0x4c')]({'where':{'name':_0x598fb3,'userProfileId':_0x53fb9c[_0x9802('0x4d')]},'raw':!![]})['then'](function(_0x178fdc){if(_0x178fdc&&_0x178fdc['autoAssociation']===0x0){return db[_0x9802('0x29')][_0x9802('0x46')]({'name':_0x13f20a[_0x9802('0x2c')],'resourceId':_0x13f20a['id'],'type':_0x178fdc[_0x9802('0x2c')],'sectionId':_0x178fdc['id']},{})[_0x9802('0x26')](function(){return _0x4a4fb5;});}else{return _0x4a4fb5;}})[_0x9802('0x45')](function(_0x181aa9){logger[_0x9802('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x181aa9);throw _0x181aa9;});}return _0x4a4fb5;})['then'](respondWithResult(_0x149e93,0xc9))[_0x9802('0x45')](handleError(_0x149e93,null));};exports[_0x9802('0x4e')]=function(_0x29c076,_0x1a04dc){if(_0x29c076[_0x9802('0x47')]['id']){delete _0x29c076['body']['id'];}return db[_0x9802('0x2f')][_0x9802('0x4c')]({'where':{'id':_0x29c076[_0x9802('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1a04dc,null))[_0x9802('0x26')](saveUpdates(_0x29c076[_0x9802('0x47')],null))[_0x9802('0x26')](respondWithResult(_0x1a04dc,null))['catch'](handleError(_0x1a04dc,null));};exports[_0x9802('0x27')]=function(_0x4edafb,_0x46c113){return db[_0x9802('0x2f')][_0x9802('0x4c')]({'where':{'id':_0x4edafb[_0x9802('0x4f')]['id']}})['then'](handleEntityNotFound(_0x46c113,null))[_0x9802('0x26')](removeEntity(_0x46c113,null))[_0x9802('0x45')](handleError(_0x46c113,null));};exports[_0x9802('0x50')]=function(_0x4900af,_0x3e7a05){return db[_0x9802('0x2f')][_0x9802('0x50')]()['then'](respondWithResult(_0x3e7a05,null))[_0x9802('0x45')](handleError(_0x3e7a05,null));};exports[_0x9802('0x51')]=function(_0x33b351,_0x55fc68,_0x2d2d67){var _0x2818b7={'raw':!![],'where':{}},_0x419d9c={},_0x232d14;return db['MailQueue'][_0x9802('0x52')]({'where':{'id':_0x33b351['params']['id']}})[_0x9802('0x26')](handleEntityNotFound(_0x55fc68,null))[_0x9802('0x26')](function(_0x46f803){if(_0x46f803){_0x232d14=_0x46f803[_0x9802('0x28')]({'plain':!![]});_0x419d9c[_0x9802('0x33')]=_[_0x9802('0x32')](db['UserMailQueue'][_0x9802('0x43')]);_0x419d9c[_0x9802('0x36')]=_[_0x9802('0x32')](_0x33b351[_0x9802('0x36')]);_0x419d9c['filters']=_[_0x9802('0x35')](_0x419d9c[_0x9802('0x33')],_0x419d9c['query']);_0x2818b7[_0x9802('0x34')]=_['intersection'](_0x419d9c[_0x9802('0x33')],qs['fields'](_0x33b351[_0x9802('0x36')]['fields']));_0x2818b7[_0x9802('0x34')]=_0x2818b7[_0x9802('0x34')][_0x9802('0x37')]?_0x2818b7['attributes']:_0x419d9c[_0x9802('0x33')];if(!_0x33b351[_0x9802('0x36')]['hasOwnProperty'](_0x9802('0x53'))){_0x2818b7[_0x9802('0x22')]=qs[_0x9802('0x22')](_0x33b351[_0x9802('0x36')]['limit']);_0x2818b7[_0x9802('0x1f')]=qs['offset'](_0x33b351[_0x9802('0x36')][_0x9802('0x1f')]);}_0x2818b7[_0x9802('0x54')]=qs['sort'](_0x33b351[_0x9802('0x36')][_0x9802('0x38')]);_0x2818b7[_0x9802('0x39')]=qs[_0x9802('0x3a')](_[_0x9802('0x3b')](_0x33b351[_0x9802('0x36')],_0x419d9c[_0x9802('0x3a')]));_0x2818b7['where'][_0x9802('0x55')]=_0x46f803['id'];if(_0x33b351[_0x9802('0x36')][_0x9802('0x3c')]){_0x2818b7[_0x9802('0x39')]=_[_0x9802('0x3d')](_0x2818b7[_0x9802('0x39')],{'$or':_[_0x9802('0x2e')](_0x2818b7[_0x9802('0x34')],function(_0x3c37e7){var _0x448b74={};_0x448b74[_0x3c37e7]={'$like':'%'+_0x33b351[_0x9802('0x36')][_0x9802('0x3c')]+'%'};return _0x448b74;})});}_0x2818b7=_[_0x9802('0x3d')]({},_0x2818b7,_0x33b351[_0x9802('0x3f')]);return db[_0x9802('0x56')]['findAll'](_0x2818b7);}})['then'](function(_0x36c413){if(_0x36c413){return db[_0x9802('0x57')][_0x9802('0x58')]({'where':{'id':_[_0x9802('0x2e')](_0x36c413,'UserId'),'role':_0x9802('0x59')},'attributes':['id',_0x9802('0x2c'),'mailPause',_0x9802('0x5a'),_0x9802('0x5b')]});}})['then'](function(_0x3c2dea){if(_0x3c2dea){return{'count':_0x3c2dea[_0x9802('0x21')],'rows':_['map'](_0x3c2dea['rows'],function(_0x70feef){return{'membername':_0x70feef['name'],'UserId':_0x70feef['id'],'queue_name':_0x232d14[_0x9802('0x2c')],'MailQueueId':_0x232d14['id'],'interface':util[_0x9802('0x5c')](_0x9802('0x5d'),_0x9802('0x5e'),_0x70feef['name']),'penalty':0x0,'paused':_0x70feef[_0x9802('0x5f')],'createdAt':_0x70feef[_0x9802('0x5b')],'updatedAt':_0x70feef[_0x9802('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9802('0x26')](respondWithFilteredResult(_0x55fc68,_0x2818b7))[_0x9802('0x45')](handleError(_0x55fc68,null));};exports['getTeams']=function(_0x380604,_0x1168d3,_0x45dcd7){var _0xa537de={};var _0x5e3831={};var _0xac7a7e;var _0x9c7c6c;return db[_0x9802('0x2f')][_0x9802('0x52')]({'where':{'id':_0x380604[_0x9802('0x4f')]['id']}})[_0x9802('0x26')](handleEntityNotFound(_0x1168d3,null))['then'](function(_0x2bbad9){if(_0x2bbad9){_0xac7a7e=_0x2bbad9;_0x5e3831[_0x9802('0x33')]=_[_0x9802('0x32')](db[_0x9802('0x60')][_0x9802('0x43')]);_0x5e3831[_0x9802('0x36')]=_[_0x9802('0x32')](_0x380604[_0x9802('0x36')]);_0x5e3831['filters']=_['intersection'](_0x5e3831[_0x9802('0x33')],_0x5e3831[_0x9802('0x36')]);_0xa537de[_0x9802('0x34')]=_[_0x9802('0x35')](_0x5e3831[_0x9802('0x33')],qs[_0x9802('0x44')](_0x380604[_0x9802('0x36')][_0x9802('0x44')]));_0xa537de[_0x9802('0x34')]=_0xa537de[_0x9802('0x34')][_0x9802('0x37')]?_0xa537de[_0x9802('0x34')]:_0x5e3831['model'];_0xa537de[_0x9802('0x54')]=qs[_0x9802('0x38')](_0x380604[_0x9802('0x36')]['sort']);_0xa537de[_0x9802('0x39')]=qs[_0x9802('0x3a')](_[_0x9802('0x3b')](_0x380604[_0x9802('0x36')],_0x5e3831[_0x9802('0x3a')]));if(_0x380604[_0x9802('0x36')][_0x9802('0x3c')]){_0xa537de[_0x9802('0x39')]=_[_0x9802('0x3d')](_0xa537de['where'],{'$or':_[_0x9802('0x2e')](_0xa537de[_0x9802('0x34')],function(_0x58a75a){var _0x26ed67={};_0x26ed67[_0x58a75a]={'$like':'%'+_0x380604['query'][_0x9802('0x3c')]+'%'};return _0x26ed67;})});}_0xa537de=_['merge']({},_0xa537de,_0x380604[_0x9802('0x3f')]);return _0xac7a7e['getTeams'](_0xa537de);}})[_0x9802('0x26')](function(_0x589fcd){if(_0x589fcd){_0x9c7c6c=_0x589fcd[_0x9802('0x37')];if(!_0x380604['query']['hasOwnProperty'](_0x9802('0x53'))){_0xa537de[_0x9802('0x22')]=qs[_0x9802('0x22')](_0x380604['query']['limit']);_0xa537de[_0x9802('0x1f')]=qs[_0x9802('0x1f')](_0x380604[_0x9802('0x36')]['offset']);}return _0xac7a7e['getTeams'](_0xa537de);}})[_0x9802('0x26')](function(_0x5729c2){if(_0x5729c2){return _0x5729c2?{'count':_0x9c7c6c,'rows':_0x5729c2}:null;}})['then'](respondWithResult(_0x1168d3,null))[_0x9802('0x45')](handleError(_0x1168d3,null));};exports['addTeams']=function(_0x39fd11,_0x5afd97,_0x606765){var _0x3edade=_0x39fd11[_0x9802('0x47')][_0x9802('0x61')];return db['Team'][_0x9802('0x62')]({'where':{'id':_0x3edade},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9802('0x63'),'attributes':['id',_0x9802('0x2c'),'online',_0x9802('0x64'),'interface'],'raw':!![]}]})[_0x9802('0x26')](function(_0x2ee62c){if(_0x2ee62c){var _0x5475d0=_[_0x9802('0x65')](_0x2ee62c,function(_0x283e6b){var _0x4a0c6e=_0x283e6b[_0x9802('0x28')]({'plain':!![]});return _0x4a0c6e[_0x9802('0x63')];});return db[_0x9802('0x2f')][_0x9802('0x4c')]({'where':{'id':_0x39fd11[_0x9802('0x4f')]['id']}})[_0x9802('0x26')](function(_0x2f376a){return db[_0x9802('0x66')][_0x9802('0x67')](function(_0x57b76b){return _0x2f376a[_0x9802('0x68')](_0x3edade,{'transaction':_0x57b76b})[_0x9802('0x26')](function(){return BPromise[_0x9802('0x69')](_0x5475d0,function(_0x13c3c9){return db[_0x9802('0x56')][_0x9802('0x6a')]({'where':{'UserId':_0x13c3c9['id'],'MailQueueId':_0x39fd11[_0x9802('0x4f')]['id']},'transaction':_0x57b76b});});})['then'](function(){_0x5475d0[_0x9802('0x6b')](function(_0xe87e12){socket[_0x9802('0x6c')](_0x9802('0x6d'),{'UserId':_0xe87e12['id'],'MailQueueId':_0x2f376a['id']});});});});});}})[_0x9802('0x26')](respondWithStatusCode(_0x5afd97,null))[_0x9802('0x45')](handleError(_0x5afd97,null));};exports[_0x9802('0x6e')]=function(_0x4bf37c,_0x314f71,_0x587cd5){return db['Team'][_0x9802('0x62')]({'where':{'id':_0x4bf37c[_0x9802('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x9802('0x57')],'as':_0x9802('0x63'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x314f71,null))[_0x9802('0x26')](function(_0x22f546){var _0x33f168=_['map'](_0x22f546,'id');var _0x19b17f=[];var _0x4e0b15=[];var _0x3f9eef=squel[_0x9802('0x6f')]();_0x3f9eef[_0x9802('0x70')](_0x9802('0x71'))['from'](_0x9802('0x72'),'tq')[_0x9802('0x73')]('user_has_teams','ut',_0x9802('0x74'))[_0x9802('0x39')](_0x9802('0x75'),_0x4bf37c[_0x9802('0x4f')]['id']);for(var _0x155a90=0x0;_0x155a90<_0x22f546['length'];_0x155a90+=0x1){let _0x5dfe32=_0x22f546[_0x155a90];for(var _0x160de2=0x0;_0x160de2<_0x5dfe32[_0x9802('0x63')][_0x9802('0x37')];_0x160de2+=0x1){let _0x380a80=_0x5dfe32[_0x9802('0x63')][_0x160de2];var _0x18657d=_0x3f9eef['clone']();_0x18657d['where'](_0x9802('0x76'),_0x380a80['id']);_0x4e0b15[_0x9802('0x77')](db['sequelize'][_0x9802('0x36')](_0x18657d['toString'](),{'type':db[_0x9802('0x66')][_0x9802('0x78')][_0x9802('0x79')]})[_0x9802('0x26')](function(_0x3a7966){if(_0x3a7966[_0x9802('0x37')]===0x1){return _0x380a80['id'];}else{var _0x5b5710=_[_0x9802('0x7a')](_['map'](_0x3a7966,_0x9802('0x7b')),function(_0x3edd17){return _['includes'](_0x33f168,_0x3edd17);});if(_0x5b5710){return _0x380a80['id'];}}}));}}return BPromise[_0x9802('0x7c')](_0x4e0b15)[_0x9802('0x26')](function(_0x2f1224){_0x19b17f=_(_0x19b17f)[_0x9802('0x7d')](_0x2f1224)[_0x9802('0x7e')]()[_0x9802('0x7f')]();return db['MailQueue'][_0x9802('0x4c')]({'where':{'id':_0x4bf37c['params']['id']}})['then'](function(_0x5dfad7){return db[_0x9802('0x66')]['transaction'](function(_0x2a991f){return _0x5dfad7[_0x9802('0x6e')](_0x4bf37c['query']['ids'],{'transaction':_0x2a991f})[_0x9802('0x26')](function(){if(!_[_0x9802('0x80')](_0x19b17f)){return _0x5dfad7[_0x9802('0x81')](_0x19b17f,{'transaction':_0x2a991f});}})[_0x9802('0x26')](function(){_0x19b17f[_0x9802('0x6b')](function(_0x1af7ac){socket[_0x9802('0x6c')]('userMailQueue:remove',{'UserId':_0x1af7ac,'MailQueueId':_0x5dfad7['id']});});});});});});})[_0x9802('0x26')](respondWithStatusCode(_0x314f71,null))['catch'](handleError(_0x314f71,null));};exports[_0x9802('0x82')]=function(_0x9d3382,_0xcf64a8,_0x2c109a){return db['MailQueue']['find']({'where':{'id':_0x9d3382[_0x9802('0x4f')]['id']}})['then'](handleEntityNotFound(_0xcf64a8,null))[_0x9802('0x26')](function(_0x54c98c){if(_0x54c98c){return _0x54c98c['addAgents'](_0x9d3382[_0x9802('0x47')][_0x9802('0x61')],_['omit'](_0x9d3382[_0x9802('0x47')],[_0x9802('0x61'),'id'])||{})[_0x9802('0x83')](function(_0x5bc037){for(var _0x1e57df=0x0;_0x1e57df<_0x9d3382[_0x9802('0x47')][_0x9802('0x61')][_0x9802('0x37')];_0x1e57df+=0x1){socket[_0x9802('0x6c')](_0x9802('0x6d'),{'UserId':Number(_0x9d3382[_0x9802('0x47')][_0x9802('0x61')][_0x1e57df]),'MailQueueId':Number(_0x9d3382[_0x9802('0x4f')]['id'])});}return _0x5bc037;});}})[_0x9802('0x26')](respondWithResult(_0xcf64a8,null))[_0x9802('0x45')](handleError(_0xcf64a8,null));};exports[_0x9802('0x81')]=function(_0x5ef1dc,_0x217875,_0x363fb2){return db[_0x9802('0x2f')][_0x9802('0x4c')]({'where':{'id':_0x5ef1dc[_0x9802('0x4f')]['id']}})[_0x9802('0x26')](handleEntityNotFound(_0x217875,null))['then'](function(_0x5ea5b1){if(_0x5ea5b1){return _0x5ea5b1[_0x9802('0x81')](_0x5ef1dc['query']['ids'])[_0x9802('0x26')](function(){if(_[_0x9802('0x84')](_0x5ef1dc[_0x9802('0x36')][_0x9802('0x61')])){for(var _0x13e256=0x0;_0x13e256<_0x5ef1dc['query'][_0x9802('0x61')][_0x9802('0x37')];_0x13e256+=0x1){socket[_0x9802('0x6c')]('userMailQueue:remove',{'UserId':Number(_0x5ef1dc[_0x9802('0x36')][_0x9802('0x61')][_0x13e256]),'MailQueueId':Number(_0x5ef1dc[_0x9802('0x4f')]['id'])});}}else{socket['emit'](_0x9802('0x85'),{'UserId':Number(_0x5ef1dc[_0x9802('0x36')][_0x9802('0x61')]),'MailQueueId':Number(_0x5ef1dc['params']['id'])});}});}})[_0x9802('0x26')](respondWithStatusCode(_0x217875,null))[_0x9802('0x45')](handleError(_0x217875,null));};exports['getAgents']=function(_0x3d1df3,_0x143ce7,_0x2e4167){var _0x55ac2b={};var _0x3dd4bd={};var _0x12a8f2;var _0x1fcc2f;return db[_0x9802('0x2f')][_0x9802('0x52')]({'where':{'id':_0x3d1df3[_0x9802('0x4f')]['id']}})[_0x9802('0x26')](handleEntityNotFound(_0x143ce7,null))['then'](function(_0x4fb948){if(_0x4fb948){_0x12a8f2=_0x4fb948;_0x3dd4bd['model']=_[_0x9802('0x32')](db[_0x9802('0x57')][_0x9802('0x43')]);_0x3dd4bd[_0x9802('0x36')]=_[_0x9802('0x32')](_0x3d1df3[_0x9802('0x36')]);_0x3dd4bd['filters']=_[_0x9802('0x35')](_0x3dd4bd['model'],_0x3dd4bd[_0x9802('0x36')]);_0x55ac2b['attributes']=_[_0x9802('0x35')](_0x3dd4bd[_0x9802('0x33')],qs['fields'](_0x3d1df3['query'][_0x9802('0x44')]));_0x55ac2b[_0x9802('0x34')]=_0x55ac2b['attributes'][_0x9802('0x37')]?_0x55ac2b[_0x9802('0x34')]:_0x3dd4bd[_0x9802('0x33')];_0x55ac2b['order']=qs['sort'](_0x3d1df3[_0x9802('0x36')][_0x9802('0x38')]);_0x55ac2b[_0x9802('0x39')]=qs[_0x9802('0x3a')](_[_0x9802('0x3b')](_0x3d1df3[_0x9802('0x36')],_0x3dd4bd[_0x9802('0x3a')]));if(_0x3d1df3['query'][_0x9802('0x3c')]){_0x55ac2b[_0x9802('0x39')]=_[_0x9802('0x3d')](_0x55ac2b['where'],{'$or':_['map'](_0x55ac2b[_0x9802('0x34')],function(_0x2e870d){var _0x32a5de={};_0x32a5de[_0x2e870d]={'$like':'%'+_0x3d1df3[_0x9802('0x36')][_0x9802('0x3c')]+'%'};return _0x32a5de;})});}_0x55ac2b=_[_0x9802('0x3d')]({},_0x55ac2b,_0x3d1df3[_0x9802('0x3f')]);return _0x12a8f2[_0x9802('0x86')](_0x55ac2b);}})[_0x9802('0x26')](function(_0x4b9179){if(_0x4b9179){_0x1fcc2f=_0x4b9179['length'];if(!_0x3d1df3[_0x9802('0x36')][_0x9802('0x87')](_0x9802('0x53'))){_0x55ac2b[_0x9802('0x22')]=qs[_0x9802('0x22')](_0x3d1df3[_0x9802('0x36')][_0x9802('0x22')]);_0x55ac2b[_0x9802('0x1f')]=qs[_0x9802('0x1f')](_0x3d1df3[_0x9802('0x36')][_0x9802('0x1f')]);}return _0x12a8f2['getAgents'](_0x55ac2b);}})[_0x9802('0x26')](function(_0x379a0a){if(_0x379a0a){return _0x379a0a?{'count':_0x1fcc2f,'rows':_0x379a0a}:null;}})['then'](respondWithResult(_0x143ce7,null))[_0x9802('0x45')](handleError(_0x143ce7,null));}; \ No newline at end of file +var _0x26ab=['mustache','util','path','sox','to-csv','fs-extra','lodash','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','redis','./mailQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','MailQueues','UserProfileResource','destroy','error','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','name','options','includeAll','include','findAll','rows','catch','show','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','findOne','UserMailQueue','findAndCountAll','UserId','agent','updatedAt','format','SIP','mailPause','createdAt','getTeams','Team','addTeams','User','Agents','online','voicePause','flatMap','sequelize','transaction','each','forEach','userMailQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','emit','getAgents','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x2b18d8,_0x21778e){var _0x2bcce2=function(_0xc14e4b){while(--_0xc14e4b){_0x2b18d8['push'](_0x2b18d8['shift']());}};_0x2bcce2(++_0x21778e);}(_0x26ab,0x117));var _0xb26a=function(_0x4a06c4,_0x1fb8fa){_0x4a06c4=_0x4a06c4-0x0;var _0x4ced39=_0x26ab[_0x4a06c4];return _0x4ced39;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb26a('0x0'));var zipdir=require(_0xb26a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb26a('0x2'));var moment=require(_0xb26a('0x3'));var BPromise=require(_0xb26a('0x4'));var Mustache=require(_0xb26a('0x5'));var util=require(_0xb26a('0x6'));var path=require(_0xb26a('0x7'));var sox=require(_0xb26a('0x8'));var csv=require(_0xb26a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb26a('0xa'));var _=require(_0xb26a('0xb'));var squel=require('squel');var crypto=require(_0xb26a('0xc'));var jsforce=require(_0xb26a('0xd'));var deskjs=require(_0xb26a('0xe'));var toCsv=require(_0xb26a('0x9'));var querystring=require(_0xb26a('0xf'));var Papa=require(_0xb26a('0x10'));var Redis=require(_0xb26a('0x11'));var authService=require(_0xb26a('0x12'));var qs=require(_0xb26a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb26a('0x14'));var logger=require(_0xb26a('0x15'))(_0xb26a('0x16'));var utils=require('../../config/utils');var config=require(_0xb26a('0x17'));var licenseUtil=require(_0xb26a('0x18'));var db=require(_0xb26a('0x19'))['db'];config['redis']=_['defaults'](config[_0xb26a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb26a('0x1b'))[_0xb26a('0x1c')](socket);function respondWithStatusCode(_0x5799d4,_0x5c7db2){_0x5c7db2=_0x5c7db2||0xcc;return function(_0x33edf6){if(_0x33edf6){return _0x5799d4[_0xb26a('0x1d')](_0x5c7db2);}return _0x5799d4[_0xb26a('0x1e')](_0x5c7db2)[_0xb26a('0x1f')]();};}function respondWithResult(_0x53e9fd,_0x4acc51){_0x4acc51=_0x4acc51||0xc8;return function(_0x3d7edd){if(_0x3d7edd){return _0x53e9fd['status'](_0x4acc51)['json'](_0x3d7edd);}};}function respondWithFilteredResult(_0x491f13,_0x1c6eeb){return function(_0x182de2){if(_0x182de2){var _0x133731=typeof _0x1c6eeb[_0xb26a('0x20')]===_0xb26a('0x21')&&typeof _0x1c6eeb[_0xb26a('0x22')]===_0xb26a('0x21');var _0x5b530f=_0x182de2[_0xb26a('0x23')];var _0x2c2d9e=_0x133731?0x0:_0x1c6eeb[_0xb26a('0x20')];var _0x5eb8bd=_0x133731?_0x182de2[_0xb26a('0x23')]:_0x1c6eeb[_0xb26a('0x20')]+_0x1c6eeb[_0xb26a('0x22')];var _0x6f0455;if(_0x5eb8bd>=_0x5b530f){_0x5eb8bd=_0x5b530f;_0x6f0455=0xc8;}else{_0x6f0455=0xce;}_0x491f13[_0xb26a('0x1e')](_0x6f0455);return _0x491f13['set'](_0xb26a('0x24'),_0x2c2d9e+'-'+_0x5eb8bd+'/'+_0x5b530f)[_0xb26a('0x25')](_0x182de2);}return null;};}function patchUpdates(_0xfc1b6f){return function(_0x30434a){try{jsonpatch[_0xb26a('0x26')](_0x30434a,_0xfc1b6f,!![]);}catch(_0x10493e){return BPromise[_0xb26a('0x27')](_0x10493e);}return _0x30434a[_0xb26a('0x28')]();};}function saveUpdates(_0x240aae,_0x1e116){return function(_0x735046){if(_0x735046){return _0x735046[_0xb26a('0x29')](_0x240aae)[_0xb26a('0x2a')](function(_0xcde346){return _0xcde346;});}return null;};}function removeEntity(_0xa9b8e1,_0x424fd0){return function(_0x161f32){if(_0x161f32){return _0x161f32['destroy']()[_0xb26a('0x2a')](function(){var _0x3ee3d3=_0x161f32['get']({'plain':!![]});var _0x5a13f8=_0xb26a('0x2b');return db[_0xb26a('0x2c')][_0xb26a('0x2d')]({'where':{'type':_0x5a13f8,'resourceId':_0x3ee3d3['id']}})[_0xb26a('0x2a')](function(){return _0x161f32;});})[_0xb26a('0x2a')](function(){_0xa9b8e1[_0xb26a('0x1e')](0xcc)[_0xb26a('0x1f')]();});}};}function handleEntityNotFound(_0x291b2f,_0x2ec380){return function(_0x2b265e){if(!_0x2b265e){_0x291b2f[_0xb26a('0x1d')](0x194);}return _0x2b265e;};}function handleError(_0x35e2dc,_0x26040b){_0x26040b=_0x26040b||0x1f4;return function(_0xb08903){logger[_0xb26a('0x2e')](_0xb08903['stack']);if(_0xb08903['name']){delete _0xb08903['name'];}_0x35e2dc['status'](_0x26040b)[_0xb26a('0x2f')](_0xb08903);};}exports[_0xb26a('0x30')]=function(_0x2a8363,_0x2e636a){var _0x1172be={},_0x166105={},_0x44fe3b={'count':0x0,'rows':[]};var _0x43bd70=_[_0xb26a('0x31')](db[_0xb26a('0x32')][_0xb26a('0x33')],function(_0x1c980a){return{'name':_0x1c980a[_0xb26a('0x34')],'type':_0x1c980a[_0xb26a('0x35')][_0xb26a('0x36')]};});_0x166105[_0xb26a('0x37')]=_['map'](_0x43bd70,'name');_0x166105[_0xb26a('0x38')]=_[_0xb26a('0x39')](_0x2a8363[_0xb26a('0x38')]);_0x166105[_0xb26a('0x3a')]=_[_0xb26a('0x3b')](_0x166105['model'],_0x166105[_0xb26a('0x38')]);_0x1172be[_0xb26a('0x3c')]=_['intersection'](_0x166105[_0xb26a('0x37')],qs[_0xb26a('0x3d')](_0x2a8363[_0xb26a('0x38')][_0xb26a('0x3d')]));_0x1172be[_0xb26a('0x3c')]=_0x1172be['attributes'][_0xb26a('0x3e')]?_0x1172be[_0xb26a('0x3c')]:_0x166105[_0xb26a('0x37')];if(!_0x2a8363[_0xb26a('0x38')][_0xb26a('0x3f')](_0xb26a('0x40'))){_0x1172be[_0xb26a('0x22')]=qs[_0xb26a('0x22')](_0x2a8363[_0xb26a('0x38')][_0xb26a('0x22')]);_0x1172be[_0xb26a('0x20')]=qs[_0xb26a('0x20')](_0x2a8363['query'][_0xb26a('0x20')]);}_0x1172be[_0xb26a('0x41')]=qs[_0xb26a('0x42')](_0x2a8363['query']['sort']);_0x1172be[_0xb26a('0x43')]=qs[_0xb26a('0x3a')](_[_0xb26a('0x44')](_0x2a8363[_0xb26a('0x38')],_0x166105[_0xb26a('0x3a')]),_0x43bd70);if(_0x2a8363['query'][_0xb26a('0x45')]){_0x1172be[_0xb26a('0x43')]=_[_0xb26a('0x46')](_0x1172be[_0xb26a('0x43')],{'$or':_[_0xb26a('0x31')](_0x43bd70,function(_0x1c4e99){if(_0x1c4e99[_0xb26a('0x35')]!=='VIRTUAL'){var _0x112a1f={};_0x112a1f[_0x1c4e99[_0xb26a('0x47')]]={'$like':'%'+_0x2a8363[_0xb26a('0x38')][_0xb26a('0x45')]+'%'};return _0x112a1f;}})});}_0x1172be=_['merge']({},_0x1172be,_0x2a8363[_0xb26a('0x48')]);var _0xa023fe={'where':_0x1172be[_0xb26a('0x43')]};return db[_0xb26a('0x32')]['count'](_0xa023fe)[_0xb26a('0x2a')](function(_0x264658){_0x44fe3b[_0xb26a('0x23')]=_0x264658;if(_0x2a8363[_0xb26a('0x38')][_0xb26a('0x49')]){_0x1172be[_0xb26a('0x4a')]=[{'all':!![]}];}return db[_0xb26a('0x32')][_0xb26a('0x4b')](_0x1172be);})['then'](function(_0x1be235){_0x44fe3b[_0xb26a('0x4c')]=_0x1be235;return _0x44fe3b;})[_0xb26a('0x2a')](respondWithFilteredResult(_0x2e636a,_0x1172be))[_0xb26a('0x4d')](handleError(_0x2e636a,null));};exports[_0xb26a('0x4e')]=function(_0xc6f13f,_0xb143bd){var _0xe35bbb={'raw':!![],'where':{'id':_0xc6f13f['params']['id']}},_0x19157f={};_0x19157f['model']=_['keys'](db[_0xb26a('0x32')][_0xb26a('0x33')]);_0x19157f['query']=_[_0xb26a('0x39')](_0xc6f13f[_0xb26a('0x38')]);_0x19157f[_0xb26a('0x3a')]=_['intersection'](_0x19157f['model'],_0x19157f[_0xb26a('0x38')]);_0xe35bbb[_0xb26a('0x3c')]=_['intersection'](_0x19157f['model'],qs[_0xb26a('0x3d')](_0xc6f13f['query'][_0xb26a('0x3d')]));_0xe35bbb[_0xb26a('0x3c')]=_0xe35bbb[_0xb26a('0x3c')]['length']?_0xe35bbb[_0xb26a('0x3c')]:_0x19157f[_0xb26a('0x37')];if(_0xc6f13f[_0xb26a('0x38')][_0xb26a('0x49')]){_0xe35bbb['include']=[{'all':!![]}];}_0xe35bbb=_[_0xb26a('0x46')]({},_0xe35bbb,_0xc6f13f[_0xb26a('0x48')]);return db[_0xb26a('0x32')][_0xb26a('0x4f')](_0xe35bbb)['then'](handleEntityNotFound(_0xb143bd,null))['then'](respondWithResult(_0xb143bd,null))['catch'](handleError(_0xb143bd,null));};exports[_0xb26a('0x50')]=function(_0x2ff8fd,_0xc716a7){return db[_0xb26a('0x32')][_0xb26a('0x50')](_0x2ff8fd['body'],{})['then'](function(_0x277690){var _0x373a51=_0x2ff8fd[_0xb26a('0x51')][_0xb26a('0x52')]({'plain':!![]});if(!_0x373a51)throw new Error(_0xb26a('0x53'));if(_0x373a51[_0xb26a('0x54')]===_0xb26a('0x51')){var _0x41fc41=_0x277690[_0xb26a('0x52')]({'plain':!![]});var _0x5e197f=_0xb26a('0x2b');return db[_0xb26a('0x55')][_0xb26a('0x4f')]({'where':{'name':_0x5e197f,'userProfileId':_0x373a51['userProfileId']},'raw':!![]})[_0xb26a('0x2a')](function(_0x40ada1){if(_0x40ada1&&_0x40ada1['autoAssociation']===0x0){return db[_0xb26a('0x2c')][_0xb26a('0x50')]({'name':_0x41fc41[_0xb26a('0x47')],'resourceId':_0x41fc41['id'],'type':_0x40ada1[_0xb26a('0x47')],'sectionId':_0x40ada1['id']},{})['then'](function(){return _0x277690;});}else{return _0x277690;}})[_0xb26a('0x4d')](function(_0x35349a){logger[_0xb26a('0x2e')](_0xb26a('0x56'),_0x35349a);throw _0x35349a;});}return _0x277690;})['then'](respondWithResult(_0xc716a7,0xc9))['catch'](handleError(_0xc716a7,null));};exports[_0xb26a('0x29')]=function(_0x338df9,_0x3234cc){if(_0x338df9[_0xb26a('0x57')]['id']){delete _0x338df9[_0xb26a('0x57')]['id'];}return db['MailQueue'][_0xb26a('0x4f')]({'where':{'id':_0x338df9[_0xb26a('0x58')]['id']}})['then'](handleEntityNotFound(_0x3234cc,null))[_0xb26a('0x2a')](saveUpdates(_0x338df9[_0xb26a('0x57')],null))[_0xb26a('0x2a')](respondWithResult(_0x3234cc,null))[_0xb26a('0x4d')](handleError(_0x3234cc,null));};exports[_0xb26a('0x2d')]=function(_0x13c0a5,_0x3af632){return db['MailQueue'][_0xb26a('0x4f')]({'where':{'id':_0x13c0a5[_0xb26a('0x58')]['id']}})[_0xb26a('0x2a')](handleEntityNotFound(_0x3af632,null))[_0xb26a('0x2a')](removeEntity(_0x3af632,null))[_0xb26a('0x4d')](handleError(_0x3af632,null));};exports[_0xb26a('0x59')]=function(_0x9fe7e7,_0xeb861a){return db[_0xb26a('0x32')][_0xb26a('0x59')]()[_0xb26a('0x2a')](respondWithResult(_0xeb861a,null))['catch'](handleError(_0xeb861a,null));};exports['getMembers']=function(_0x369271,_0x2c1988,_0x54a40a){var _0x501099={'raw':!![],'where':{}},_0x331ad8={},_0x567038;return db[_0xb26a('0x32')][_0xb26a('0x5a')]({'where':{'id':_0x369271[_0xb26a('0x58')]['id']}})[_0xb26a('0x2a')](handleEntityNotFound(_0x2c1988,null))[_0xb26a('0x2a')](function(_0x103e93){if(_0x103e93){_0x567038=_0x103e93['get']({'plain':!![]});_0x331ad8[_0xb26a('0x37')]=_[_0xb26a('0x39')](db[_0xb26a('0x5b')]['rawAttributes']);_0x331ad8[_0xb26a('0x38')]=_[_0xb26a('0x39')](_0x369271['query']);_0x331ad8[_0xb26a('0x3a')]=_[_0xb26a('0x3b')](_0x331ad8['model'],_0x331ad8[_0xb26a('0x38')]);_0x501099[_0xb26a('0x3c')]=_[_0xb26a('0x3b')](_0x331ad8[_0xb26a('0x37')],qs[_0xb26a('0x3d')](_0x369271[_0xb26a('0x38')][_0xb26a('0x3d')]));_0x501099[_0xb26a('0x3c')]=_0x501099[_0xb26a('0x3c')][_0xb26a('0x3e')]?_0x501099[_0xb26a('0x3c')]:_0x331ad8[_0xb26a('0x37')];if(!_0x369271['query'][_0xb26a('0x3f')]('nolimit')){_0x501099[_0xb26a('0x22')]=qs[_0xb26a('0x22')](_0x369271[_0xb26a('0x38')][_0xb26a('0x22')]);_0x501099[_0xb26a('0x20')]=qs['offset'](_0x369271[_0xb26a('0x38')][_0xb26a('0x20')]);}_0x501099['order']=qs[_0xb26a('0x42')](_0x369271[_0xb26a('0x38')][_0xb26a('0x42')]);_0x501099[_0xb26a('0x43')]=qs[_0xb26a('0x3a')](_[_0xb26a('0x44')](_0x369271[_0xb26a('0x38')],_0x331ad8[_0xb26a('0x3a')]));_0x501099[_0xb26a('0x43')]['MailQueueId']=_0x103e93['id'];if(_0x369271['query']['filter']){_0x501099[_0xb26a('0x43')]=_['merge'](_0x501099[_0xb26a('0x43')],{'$or':_[_0xb26a('0x31')](_0x501099['attributes'],function(_0x172b4a){var _0x37851c={};_0x37851c[_0x172b4a]={'$like':'%'+_0x369271[_0xb26a('0x38')]['filter']+'%'};return _0x37851c;})});}_0x501099=_[_0xb26a('0x46')]({},_0x501099,_0x369271[_0xb26a('0x48')]);return db['UserMailQueue'][_0xb26a('0x4b')](_0x501099);}})[_0xb26a('0x2a')](function(_0x5a25e6){if(_0x5a25e6){return db['User'][_0xb26a('0x5c')]({'where':{'id':_[_0xb26a('0x31')](_0x5a25e6,_0xb26a('0x5d')),'role':_0xb26a('0x5e')},'attributes':['id',_0xb26a('0x47'),'mailPause',_0xb26a('0x5f'),'createdAt']});}})[_0xb26a('0x2a')](function(_0x4c26f2){if(_0x4c26f2){return{'count':_0x4c26f2[_0xb26a('0x23')],'rows':_[_0xb26a('0x31')](_0x4c26f2[_0xb26a('0x4c')],function(_0x3995ba){return{'membername':_0x3995ba['name'],'UserId':_0x3995ba['id'],'queue_name':_0x567038[_0xb26a('0x47')],'MailQueueId':_0x567038['id'],'interface':util[_0xb26a('0x60')]('%s/%s',_0xb26a('0x61'),_0x3995ba[_0xb26a('0x47')]),'penalty':0x0,'paused':_0x3995ba[_0xb26a('0x62')],'createdAt':_0x3995ba[_0xb26a('0x63')],'updatedAt':_0x3995ba[_0xb26a('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb26a('0x2a')](respondWithFilteredResult(_0x2c1988,_0x501099))['catch'](handleError(_0x2c1988,null));};exports[_0xb26a('0x64')]=function(_0x3dda48,_0x50cfd0,_0x6723a2){var _0x67678c={};var _0x3eae8e={};var _0x26796f;var _0xac117f;return db[_0xb26a('0x32')][_0xb26a('0x5a')]({'where':{'id':_0x3dda48[_0xb26a('0x58')]['id']}})['then'](handleEntityNotFound(_0x50cfd0,null))[_0xb26a('0x2a')](function(_0x2fbf8b){if(_0x2fbf8b){_0x26796f=_0x2fbf8b;_0x3eae8e[_0xb26a('0x37')]=_['keys'](db[_0xb26a('0x65')][_0xb26a('0x33')]);_0x3eae8e[_0xb26a('0x38')]=_[_0xb26a('0x39')](_0x3dda48[_0xb26a('0x38')]);_0x3eae8e[_0xb26a('0x3a')]=_[_0xb26a('0x3b')](_0x3eae8e[_0xb26a('0x37')],_0x3eae8e[_0xb26a('0x38')]);_0x67678c[_0xb26a('0x3c')]=_[_0xb26a('0x3b')](_0x3eae8e[_0xb26a('0x37')],qs['fields'](_0x3dda48[_0xb26a('0x38')][_0xb26a('0x3d')]));_0x67678c['attributes']=_0x67678c[_0xb26a('0x3c')]['length']?_0x67678c[_0xb26a('0x3c')]:_0x3eae8e[_0xb26a('0x37')];_0x67678c[_0xb26a('0x41')]=qs[_0xb26a('0x42')](_0x3dda48[_0xb26a('0x38')][_0xb26a('0x42')]);_0x67678c[_0xb26a('0x43')]=qs[_0xb26a('0x3a')](_['pick'](_0x3dda48[_0xb26a('0x38')],_0x3eae8e[_0xb26a('0x3a')]));if(_0x3dda48[_0xb26a('0x38')][_0xb26a('0x45')]){_0x67678c[_0xb26a('0x43')]=_[_0xb26a('0x46')](_0x67678c[_0xb26a('0x43')],{'$or':_[_0xb26a('0x31')](_0x67678c[_0xb26a('0x3c')],function(_0x133505){var _0x24ab70={};_0x24ab70[_0x133505]={'$like':'%'+_0x3dda48[_0xb26a('0x38')][_0xb26a('0x45')]+'%'};return _0x24ab70;})});}_0x67678c=_[_0xb26a('0x46')]({},_0x67678c,_0x3dda48[_0xb26a('0x48')]);return _0x26796f['getTeams'](_0x67678c);}})[_0xb26a('0x2a')](function(_0x165972){if(_0x165972){_0xac117f=_0x165972['length'];if(!_0x3dda48[_0xb26a('0x38')][_0xb26a('0x3f')](_0xb26a('0x40'))){_0x67678c[_0xb26a('0x22')]=qs[_0xb26a('0x22')](_0x3dda48['query'][_0xb26a('0x22')]);_0x67678c['offset']=qs['offset'](_0x3dda48[_0xb26a('0x38')][_0xb26a('0x20')]);}return _0x26796f[_0xb26a('0x64')](_0x67678c);}})[_0xb26a('0x2a')](function(_0x4bef74){if(_0x4bef74){return _0x4bef74?{'count':_0xac117f,'rows':_0x4bef74}:null;}})[_0xb26a('0x2a')](respondWithResult(_0x50cfd0,null))[_0xb26a('0x4d')](handleError(_0x50cfd0,null));};exports[_0xb26a('0x66')]=function(_0xc4cf2c,_0xf332ab,_0x346c63){var _0x39a6af=_0xc4cf2c['body']['ids'];return db['Team'][_0xb26a('0x4b')]({'where':{'id':_0x39a6af},'attributes':['id'],'include':[{'model':db[_0xb26a('0x67')],'as':_0xb26a('0x68'),'attributes':['id',_0xb26a('0x47'),_0xb26a('0x69'),_0xb26a('0x6a'),'interface'],'raw':!![]}]})[_0xb26a('0x2a')](function(_0x34b73a){if(_0x34b73a){var _0x2eb67e=_[_0xb26a('0x6b')](_0x34b73a,function(_0x422c00){var _0xfeeb21=_0x422c00[_0xb26a('0x52')]({'plain':!![]});return _0xfeeb21[_0xb26a('0x68')];});return db[_0xb26a('0x32')]['find']({'where':{'id':_0xc4cf2c[_0xb26a('0x58')]['id']}})['then'](function(_0x2c0dc7){return db[_0xb26a('0x6c')][_0xb26a('0x6d')](function(_0x257cc2){return _0x2c0dc7[_0xb26a('0x66')](_0x39a6af,{'transaction':_0x257cc2})['then'](function(){return BPromise[_0xb26a('0x6e')](_0x2eb67e,function(_0x582286){return db[_0xb26a('0x5b')]['findOrCreate']({'where':{'UserId':_0x582286['id'],'MailQueueId':_0xc4cf2c[_0xb26a('0x58')]['id']},'transaction':_0x257cc2});});})['then'](function(){_0x2eb67e[_0xb26a('0x6f')](function(_0x545f3c){socket['emit'](_0xb26a('0x70'),{'UserId':_0x545f3c['id'],'MailQueueId':_0x2c0dc7['id']});});});});});}})[_0xb26a('0x2a')](respondWithStatusCode(_0xf332ab,null))[_0xb26a('0x4d')](handleError(_0xf332ab,null));};exports[_0xb26a('0x71')]=function(_0x15e922,_0x3c079a,_0x16e0d0){return db[_0xb26a('0x65')][_0xb26a('0x4b')]({'where':{'id':_0x15e922[_0xb26a('0x38')][_0xb26a('0x72')]},'attributes':['id'],'include':[{'model':db[_0xb26a('0x67')],'as':_0xb26a('0x68'),'attributes':['id'],'raw':!![]}]})[_0xb26a('0x2a')](handleEntityNotFound(_0x3c079a,null))['then'](function(_0x4a4b51){var _0x10a814=_[_0xb26a('0x31')](_0x4a4b51,'id');var _0x14d228=[];var _0x3d64a6=[];var _0x2d1138=squel[_0xb26a('0x73')]();_0x2d1138[_0xb26a('0x74')](_0xb26a('0x75'))[_0xb26a('0x76')](_0xb26a('0x77'),'tq')[_0xb26a('0x78')](_0xb26a('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xb26a('0x7a'),_0x15e922[_0xb26a('0x58')]['id']);for(var _0x2f2911=0x0;_0x2f2911<_0x4a4b51[_0xb26a('0x3e')];_0x2f2911+=0x1){let _0x2c114d=_0x4a4b51[_0x2f2911];for(var _0x41d1ea=0x0;_0x41d1ea<_0x2c114d[_0xb26a('0x68')]['length'];_0x41d1ea+=0x1){let _0x2d732a=_0x2c114d[_0xb26a('0x68')][_0x41d1ea];var _0x4a764f=_0x2d1138[_0xb26a('0x7b')]();_0x4a764f['where'](_0xb26a('0x7c'),_0x2d732a['id']);_0x3d64a6[_0xb26a('0x7d')](db[_0xb26a('0x6c')]['query'](_0x4a764f[_0xb26a('0x7e')](),{'type':db[_0xb26a('0x6c')][_0xb26a('0x7f')][_0xb26a('0x80')]})[_0xb26a('0x2a')](function(_0x170172){if(_0x170172[_0xb26a('0x3e')]===0x1){return _0x2d732a['id'];}else{var _0x49af45=_[_0xb26a('0x81')](_[_0xb26a('0x31')](_0x170172,_0xb26a('0x82')),function(_0x413d9e){return _['includes'](_0x10a814,_0x413d9e);});if(_0x49af45){return _0x2d732a['id'];}}}));}}return BPromise[_0xb26a('0x83')](_0x3d64a6)[_0xb26a('0x2a')](function(_0x48af68){_0x14d228=_(_0x14d228)[_0xb26a('0x84')](_0x48af68)['compact']()['value']();return db['MailQueue'][_0xb26a('0x4f')]({'where':{'id':_0x15e922[_0xb26a('0x58')]['id']}})[_0xb26a('0x2a')](function(_0xd3800b){return db[_0xb26a('0x6c')][_0xb26a('0x6d')](function(_0x4e8e44){return _0xd3800b[_0xb26a('0x71')](_0x15e922[_0xb26a('0x38')]['ids'],{'transaction':_0x4e8e44})['then'](function(){if(!_[_0xb26a('0x85')](_0x14d228)){return _0xd3800b[_0xb26a('0x86')](_0x14d228,{'transaction':_0x4e8e44});}})[_0xb26a('0x2a')](function(){_0x14d228[_0xb26a('0x6f')](function(_0x19a5fd){socket['emit'](_0xb26a('0x87'),{'UserId':_0x19a5fd,'MailQueueId':_0xd3800b['id']});});});});});});})[_0xb26a('0x2a')](respondWithStatusCode(_0x3c079a,null))[_0xb26a('0x4d')](handleError(_0x3c079a,null));};exports[_0xb26a('0x88')]=function(_0x3aec87,_0x36daf4,_0x4e852a){return db[_0xb26a('0x32')][_0xb26a('0x4f')]({'where':{'id':_0x3aec87[_0xb26a('0x58')]['id']}})[_0xb26a('0x2a')](handleEntityNotFound(_0x36daf4,null))[_0xb26a('0x2a')](function(_0x31dd18){if(_0x31dd18){return _0x31dd18[_0xb26a('0x88')](_0x3aec87['body']['ids'],_[_0xb26a('0x89')](_0x3aec87[_0xb26a('0x57')],[_0xb26a('0x72'),'id'])||{})[_0xb26a('0x8a')](function(_0x5f3868){for(var _0x17e0a0=0x0;_0x17e0a0<_0x3aec87[_0xb26a('0x57')]['ids'][_0xb26a('0x3e')];_0x17e0a0+=0x1){socket['emit'](_0xb26a('0x70'),{'UserId':Number(_0x3aec87[_0xb26a('0x57')][_0xb26a('0x72')][_0x17e0a0]),'MailQueueId':Number(_0x3aec87[_0xb26a('0x58')]['id'])});}return _0x5f3868;});}})[_0xb26a('0x2a')](respondWithResult(_0x36daf4,null))['catch'](handleError(_0x36daf4,null));};exports[_0xb26a('0x86')]=function(_0x45fd1b,_0x3b90a8,_0x5bad13){return db['MailQueue']['find']({'where':{'id':_0x45fd1b[_0xb26a('0x58')]['id']}})[_0xb26a('0x2a')](handleEntityNotFound(_0x3b90a8,null))[_0xb26a('0x2a')](function(_0x38c8c4){if(_0x38c8c4){return _0x38c8c4['removeAgents'](_0x45fd1b['query'][_0xb26a('0x72')])[_0xb26a('0x2a')](function(){if(_[_0xb26a('0x8b')](_0x45fd1b[_0xb26a('0x38')][_0xb26a('0x72')])){for(var _0x54c42c=0x0;_0x54c42c<_0x45fd1b[_0xb26a('0x38')][_0xb26a('0x72')][_0xb26a('0x3e')];_0x54c42c+=0x1){socket[_0xb26a('0x8c')](_0xb26a('0x87'),{'UserId':Number(_0x45fd1b[_0xb26a('0x38')][_0xb26a('0x72')][_0x54c42c]),'MailQueueId':Number(_0x45fd1b[_0xb26a('0x58')]['id'])});}}else{socket['emit'](_0xb26a('0x87'),{'UserId':Number(_0x45fd1b[_0xb26a('0x38')][_0xb26a('0x72')]),'MailQueueId':Number(_0x45fd1b[_0xb26a('0x58')]['id'])});}});}})[_0xb26a('0x2a')](respondWithStatusCode(_0x3b90a8,null))[_0xb26a('0x4d')](handleError(_0x3b90a8,null));};exports['getAgents']=function(_0x5dd897,_0x2a4889,_0x59d3fc){var _0x1fba4c={};var _0x1a35a7={};var _0xa9f266;var _0x2bcde3;return db[_0xb26a('0x32')][_0xb26a('0x5a')]({'where':{'id':_0x5dd897['params']['id']}})[_0xb26a('0x2a')](handleEntityNotFound(_0x2a4889,null))[_0xb26a('0x2a')](function(_0x44507a){if(_0x44507a){_0xa9f266=_0x44507a;_0x1a35a7['model']=_[_0xb26a('0x39')](db[_0xb26a('0x67')][_0xb26a('0x33')]);_0x1a35a7[_0xb26a('0x38')]=_['keys'](_0x5dd897[_0xb26a('0x38')]);_0x1a35a7[_0xb26a('0x3a')]=_[_0xb26a('0x3b')](_0x1a35a7[_0xb26a('0x37')],_0x1a35a7[_0xb26a('0x38')]);_0x1fba4c['attributes']=_[_0xb26a('0x3b')](_0x1a35a7[_0xb26a('0x37')],qs[_0xb26a('0x3d')](_0x5dd897[_0xb26a('0x38')][_0xb26a('0x3d')]));_0x1fba4c[_0xb26a('0x3c')]=_0x1fba4c[_0xb26a('0x3c')]['length']?_0x1fba4c[_0xb26a('0x3c')]:_0x1a35a7[_0xb26a('0x37')];_0x1fba4c[_0xb26a('0x41')]=qs[_0xb26a('0x42')](_0x5dd897[_0xb26a('0x38')][_0xb26a('0x42')]);_0x1fba4c[_0xb26a('0x43')]=qs['filters'](_['pick'](_0x5dd897[_0xb26a('0x38')],_0x1a35a7[_0xb26a('0x3a')]));if(_0x5dd897['query'][_0xb26a('0x45')]){_0x1fba4c[_0xb26a('0x43')]=_[_0xb26a('0x46')](_0x1fba4c[_0xb26a('0x43')],{'$or':_[_0xb26a('0x31')](_0x1fba4c[_0xb26a('0x3c')],function(_0x2cda82){var _0x5a1254={};_0x5a1254[_0x2cda82]={'$like':'%'+_0x5dd897[_0xb26a('0x38')]['filter']+'%'};return _0x5a1254;})});}_0x1fba4c=_[_0xb26a('0x46')]({},_0x1fba4c,_0x5dd897[_0xb26a('0x48')]);return _0xa9f266[_0xb26a('0x8d')](_0x1fba4c);}})[_0xb26a('0x2a')](function(_0x23bfbf){if(_0x23bfbf){_0x2bcde3=_0x23bfbf[_0xb26a('0x3e')];if(!_0x5dd897['query']['hasOwnProperty'](_0xb26a('0x40'))){_0x1fba4c[_0xb26a('0x22')]=qs[_0xb26a('0x22')](_0x5dd897[_0xb26a('0x38')][_0xb26a('0x22')]);_0x1fba4c[_0xb26a('0x20')]=qs['offset'](_0x5dd897['query']['offset']);}return _0xa9f266[_0xb26a('0x8d')](_0x1fba4c);}})[_0xb26a('0x2a')](function(_0x2cf70c){if(_0x2cf70c){return _0x2cf70c?{'count':_0x2bcde3,'rows':_0x2cf70c}:null;}})['then'](respondWithResult(_0x2a4889,null))[_0xb26a('0x4d')](handleError(_0x2a4889,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 7d3fb7e..6de50c8 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 _0xa455=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update'];(function(_0xfd2e3d,_0x248ccc){var _0x51a8cc=function(_0x5bab46){while(--_0x5bab46){_0xfd2e3d['push'](_0xfd2e3d['shift']());}};_0x51a8cc(++_0x248ccc);}(_0xa455,0x165));var _0x5a45=function(_0x592635,_0x8ebd07){_0x592635=_0x592635-0x0;var _0x1c0897=_0xa455[_0x592635];return _0x1c0897;};'use strict';var EventEmitter=require(_0x5a45('0x0'));var MailQueue=require(_0x5a45('0x1'))['db'][_0x5a45('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x5a45('0x3')](0x0);var events={'afterCreate':_0x5a45('0x4'),'afterUpdate':_0x5a45('0x5'),'afterDestroy':_0x5a45('0x6')};function emitEvent(_0x55b8ff){return function(_0x1a3696,_0x4ea922,_0x1eb4f2){MailQueueEvents[_0x5a45('0x7')](_0x55b8ff+':'+_0x1a3696['id'],_0x1a3696);MailQueueEvents['emit'](_0x55b8ff,_0x1a3696);_0x1eb4f2(null);};}for(var e in events){if(events[_0x5a45('0x8')](e)){var event=events[e];MailQueue[_0x5a45('0x9')](e,emitEvent(event));}}module[_0x5a45('0xa')]=MailQueueEvents; \ No newline at end of file +var _0x4304=['../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x31b7ff,_0x4d3503){var _0x33ba84=function(_0x1e90b7){while(--_0x1e90b7){_0x31b7ff['push'](_0x31b7ff['shift']());}};_0x33ba84(++_0x4d3503);}(_0x4304,0x190));var _0x4430=function(_0x551ff4,_0x165eeb){_0x551ff4=_0x551ff4-0x0;var _0x26221f=_0x4304[_0x551ff4];return _0x26221f;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x4430('0x0'))['db'][_0x4430('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x4430('0x2')](0x0);var events={'afterCreate':_0x4430('0x3'),'afterUpdate':_0x4430('0x4'),'afterDestroy':_0x4430('0x5')};function emitEvent(_0x2be81b){return function(_0x4269dd,_0x368cc0,_0x1cfcac){MailQueueEvents[_0x4430('0x6')](_0x2be81b+':'+_0x4269dd['id'],_0x4269dd);MailQueueEvents['emit'](_0x2be81b,_0x4269dd);_0x1cfcac(null);};}for(var e in events){if(events[_0x4430('0x7')](e)){var event=events[e];MailQueue[_0x4430('0x8')](e,emitEvent(event));}}module[_0x4430('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 3e295f9..9f82ef9 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 _0xfe60=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','define','MailQueue','mail_queues','lodash'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xfe60,0x81));var _0x0fe6=function(_0x34a241,_0xa8568d){_0x34a241=_0x34a241-0x0;var _0x55659b=_0xfe60[_0x34a241];return _0x55659b;};'use strict';var _=require(_0x0fe6('0x0'));var util=require(_0x0fe6('0x1'));var logger=require('../../config/logger')(_0x0fe6('0x2'));var moment=require(_0x0fe6('0x3'));var BPromise=require(_0x0fe6('0x4'));var rp=require(_0x0fe6('0x5'));var fs=require('fs');var path=require(_0x0fe6('0x6'));var rimraf=require(_0x0fe6('0x7'));var config=require(_0x0fe6('0x8'));var attributes=require(_0x0fe6('0x9'));module['exports']=function(_0x2fc476,_0x38be4a){return _0x2fc476[_0x0fe6('0xa')](_0x0fe6('0xb'),attributes,{'tableName':_0x0fe6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe503=['mail_queues','../../config/logger','api','bluebird','rimraf','exports','MailQueue'];(function(_0x760fc6,_0x4c9843){var _0x41e10c=function(_0x3b2796){while(--_0x3b2796){_0x760fc6['push'](_0x760fc6['shift']());}};_0x41e10c(++_0x4c9843);}(_0xe503,0xbe));var _0x3e50=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xe503[_0x4b2863];return _0x567d67;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3e50('0x0'))(_0x3e50('0x1'));var moment=require('moment');var BPromise=require(_0x3e50('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3e50('0x3'));var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module[_0x3e50('0x4')]=function(_0x5600cb,_0x475ab8){return _0x5600cb['define'](_0x3e50('0x5'),attributes,{'tableName':_0x3e50('0x6'),'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 2f2ec4b..c911b92 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 _0xdf68=['localhost','register','request','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','findAll','options','attributes','include','map','model','GetMailQueue','catch','MailQueue','raw','where','then','ShowMailQueue','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x2eba33,_0x367714){var _0x494896=function(_0x40cd75){while(--_0x40cd75){_0x2eba33['push'](_0x2eba33['shift']());}};_0x494896(++_0x367714);}(_0xdf68,0x15c));var _0x8df6=function(_0x318410,_0x451962){_0x318410=_0x318410-0x0;var _0x2898a3=_0xdf68[_0x318410];return _0x2898a3;};'use strict';var _=require('lodash');var util=require(_0x8df6('0x0'));var moment=require(_0x8df6('0x1'));var BPromise=require(_0x8df6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8df6('0x3'));var db=require(_0x8df6('0x4'))['db'];var utils=require(_0x8df6('0x5'));var logger=require('../../config/logger')(_0x8df6('0x6'));var config=require(_0x8df6('0x7'));var jayson=require(_0x8df6('0x8'));var client=jayson[_0x8df6('0x9')]['http']({'port':0x232a});config[_0x8df6('0xa')]=_[_0x8df6('0xb')](config[_0x8df6('0xa')],{'host':_0x8df6('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8df6('0xa')]));require('./mailQueue.socket')[_0x8df6('0xd')](socket);function respondWithRpcPromise(_0x3c29b7,_0x25c5e7,_0x38df0c){return new BPromise(function(_0x96301d,_0x1b1c28){return client[_0x8df6('0xe')](_0x3c29b7,_0x38df0c)['then'](function(_0x50fe3){logger[_0x8df6('0xf')](_0x8df6('0x10'),_0x25c5e7,_0x8df6('0x11'));logger[_0x8df6('0x12')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x25c5e7,'request\x20sent',JSON[_0x8df6('0x13')](_0x50fe3));if(_0x50fe3['error']){if(_0x50fe3[_0x8df6('0x14')][_0x8df6('0x15')]===0x1f4){logger['error'](_0x8df6('0x10'),_0x25c5e7,_0x50fe3[_0x8df6('0x14')]['message']);return _0x1b1c28(_0x50fe3[_0x8df6('0x14')][_0x8df6('0x16')]);}logger['error'](_0x8df6('0x10'),_0x25c5e7,_0x50fe3['error']['message']);return _0x96301d(_0x50fe3[_0x8df6('0x14')]['message']);}else{logger['info'](_0x8df6('0x10'),_0x25c5e7,_0x8df6('0x11'));_0x96301d(_0x50fe3['result']['message']);}})['catch'](function(_0x354abd){logger['error'](_0x8df6('0x10'),_0x25c5e7,_0x354abd);_0x1b1c28(_0x354abd);});});}exports['GetMailQueue']=function(_0x3ff5bc){var _0x4e4668=this;return new Promise(function(_0x2d0b91,_0x1ccf03){return db['MailQueue'][_0x8df6('0x17')]({'raw':_0x3ff5bc[_0x8df6('0x18')]?_0x3ff5bc[_0x8df6('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3ff5bc['options']?_0x3ff5bc[_0x8df6('0x18')]['where']||null:null,'attributes':_0x3ff5bc[_0x8df6('0x18')]?_0x3ff5bc[_0x8df6('0x18')][_0x8df6('0x19')]||null:null,'limit':_0x3ff5bc[_0x8df6('0x18')]?_0x3ff5bc['options']['limit']||null:null,'include':_0x3ff5bc['options']?_0x3ff5bc['options'][_0x8df6('0x1a')]?_[_0x8df6('0x1b')](_0x3ff5bc[_0x8df6('0x18')][_0x8df6('0x1a')],function(_0x2927a5){return{'model':db[_0x2927a5[_0x8df6('0x1c')]],'as':_0x2927a5['as'],'attributes':_0x2927a5['attributes'],'include':_0x2927a5[_0x8df6('0x1a')]?_[_0x8df6('0x1b')](_0x2927a5[_0x8df6('0x1a')],function(_0x5d6d77){return{'model':db[_0x5d6d77[_0x8df6('0x1c')]],'as':_0x5d6d77['as'],'attributes':_0x5d6d77[_0x8df6('0x19')],'include':_0x5d6d77[_0x8df6('0x1a')]?_['map'](_0x5d6d77[_0x8df6('0x1a')],function(_0x2d859c){return{'model':db[_0x2d859c[_0x8df6('0x1c')]],'as':_0x2d859c['as'],'attributes':_0x2d859c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x597488){logger[_0x8df6('0xf')](_0x8df6('0x1d'),_0x3ff5bc);logger[_0x8df6('0x12')]('GetMailQueue',_0x3ff5bc,JSON[_0x8df6('0x13')](_0x597488));_0x2d0b91(_0x597488);})[_0x8df6('0x1e')](function(_0x3b9066){logger['error'](_0x8df6('0x1d'),_0x3b9066[_0x8df6('0x16')],_0x3ff5bc);_0x1ccf03(_0x4e4668[_0x8df6('0x14')](0x1f4,_0x3b9066[_0x8df6('0x16')]));});});};exports['ShowMailQueue']=function(_0x3f5050){var _0x26b851=this;return new Promise(function(_0x3716eb,_0x542b2c){return db[_0x8df6('0x1f')]['find']({'raw':_0x3f5050[_0x8df6('0x18')]?_0x3f5050[_0x8df6('0x18')][_0x8df6('0x20')]===undefined?!![]:![]:!![],'where':_0x3f5050['options']?_0x3f5050[_0x8df6('0x18')][_0x8df6('0x21')]||null:null,'attributes':_0x3f5050[_0x8df6('0x18')]?_0x3f5050['options'][_0x8df6('0x19')]||null:null,'include':_0x3f5050[_0x8df6('0x18')]?_0x3f5050[_0x8df6('0x18')][_0x8df6('0x1a')]?_['map'](_0x3f5050[_0x8df6('0x18')][_0x8df6('0x1a')],function(_0x53ac5c){return{'model':db[_0x53ac5c['model']],'as':_0x53ac5c['as'],'attributes':_0x53ac5c['attributes'],'include':_0x53ac5c[_0x8df6('0x1a')]?_[_0x8df6('0x1b')](_0x53ac5c[_0x8df6('0x1a')],function(_0x2ea4cd){return{'model':db[_0x2ea4cd[_0x8df6('0x1c')]],'as':_0x2ea4cd['as'],'attributes':_0x2ea4cd[_0x8df6('0x19')],'include':_0x2ea4cd[_0x8df6('0x1a')]?_['map'](_0x2ea4cd[_0x8df6('0x1a')],function(_0x1e196a){return{'model':db[_0x1e196a[_0x8df6('0x1c')]],'as':_0x1e196a['as'],'attributes':_0x1e196a[_0x8df6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8df6('0x22')](function(_0x3ff07e){logger[_0x8df6('0xf')](_0x8df6('0x23'),_0x3f5050);logger[_0x8df6('0x12')](_0x8df6('0x23'),_0x3f5050,JSON[_0x8df6('0x13')](_0x3ff07e));_0x3716eb(_0x3ff07e);})['catch'](function(_0x42fa66){logger['error'](_0x8df6('0x23'),_0x42fa66['message'],_0x3f5050);_0x542b2c(_0x26b851[_0x8df6('0x14')](0x1f4,_0x42fa66[_0x8df6('0x16')]));});});}; \ No newline at end of file +var _0x81a4=['MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetMailQueue','MailQueue','options','raw','attributes','limit','map','include','model','stringify','ShowMailQueue','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info'];(function(_0x345ed1,_0x37c0b){var _0x5d5f7a=function(_0x57e0cb){while(--_0x57e0cb){_0x345ed1['push'](_0x345ed1['shift']());}};_0x5d5f7a(++_0x37c0b);}(_0x81a4,0x125));var _0x481a=function(_0x2797c6,_0x37421b){_0x2797c6=_0x2797c6-0x0;var _0x54809f=_0x81a4[_0x2797c6];return _0x54809f;};'use strict';var _=require('lodash');var util=require(_0x481a('0x0'));var moment=require(_0x481a('0x1'));var BPromise=require(_0x481a('0x2'));var rs=require(_0x481a('0x3'));var fs=require('fs');var Redis=require(_0x481a('0x4'));var db=require(_0x481a('0x5'))['db'];var utils=require(_0x481a('0x6'));var logger=require(_0x481a('0x7'))(_0x481a('0x8'));var config=require(_0x481a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x481a('0xa')][_0x481a('0xb')]({'port':0x232a});config['redis']=_[_0x481a('0xc')](config[_0x481a('0xd')],{'host':_0x481a('0xe'),'port':0x18eb});var socket=require(_0x481a('0xf'))(new Redis(config['redis']));require('./mailQueue.socket')[_0x481a('0x10')](socket);function respondWithRpcPromise(_0x12506c,_0x5bf7d6,_0x4ece3f){return new BPromise(function(_0x468e63,_0x3f367e){return client['request'](_0x12506c,_0x4ece3f)[_0x481a('0x11')](function(_0x96066){logger[_0x481a('0x12')](_0x481a('0x13'),_0x5bf7d6,'request\x20sent');logger[_0x481a('0x14')](_0x481a('0x15'),_0x5bf7d6,_0x481a('0x16'),JSON['stringify'](_0x96066));if(_0x96066[_0x481a('0x17')]){if(_0x96066[_0x481a('0x17')][_0x481a('0x18')]===0x1f4){logger[_0x481a('0x17')]('MailQueue,\x20%s,\x20%s',_0x5bf7d6,_0x96066[_0x481a('0x17')][_0x481a('0x19')]);return _0x3f367e(_0x96066[_0x481a('0x17')][_0x481a('0x19')]);}logger[_0x481a('0x17')]('MailQueue,\x20%s,\x20%s',_0x5bf7d6,_0x96066[_0x481a('0x17')][_0x481a('0x19')]);return _0x468e63(_0x96066['error'][_0x481a('0x19')]);}else{logger['info'](_0x481a('0x13'),_0x5bf7d6,_0x481a('0x16'));_0x468e63(_0x96066['result'][_0x481a('0x19')]);}})[_0x481a('0x1a')](function(_0x21e435){logger[_0x481a('0x17')](_0x481a('0x13'),_0x5bf7d6,_0x21e435);_0x3f367e(_0x21e435);});});}exports[_0x481a('0x1b')]=function(_0x3b9362){var _0x587e8a=this;return new Promise(function(_0x2d6123,_0x4391e0){return db[_0x481a('0x1c')]['findAll']({'raw':_0x3b9362[_0x481a('0x1d')]?_0x3b9362[_0x481a('0x1d')][_0x481a('0x1e')]===undefined?!![]:![]:!![],'where':_0x3b9362['options']?_0x3b9362[_0x481a('0x1d')]['where']||null:null,'attributes':_0x3b9362[_0x481a('0x1d')]?_0x3b9362['options'][_0x481a('0x1f')]||null:null,'limit':_0x3b9362[_0x481a('0x1d')]?_0x3b9362[_0x481a('0x1d')][_0x481a('0x20')]||null:null,'include':_0x3b9362[_0x481a('0x1d')]?_0x3b9362[_0x481a('0x1d')]['include']?_[_0x481a('0x21')](_0x3b9362['options'][_0x481a('0x22')],function(_0x1bd826){return{'model':db[_0x1bd826[_0x481a('0x23')]],'as':_0x1bd826['as'],'attributes':_0x1bd826[_0x481a('0x1f')],'include':_0x1bd826[_0x481a('0x22')]?_[_0x481a('0x21')](_0x1bd826[_0x481a('0x22')],function(_0x111234){return{'model':db[_0x111234[_0x481a('0x23')]],'as':_0x111234['as'],'attributes':_0x111234['attributes'],'include':_0x111234[_0x481a('0x22')]?_[_0x481a('0x21')](_0x111234['include'],function(_0x4bc5cd){return{'model':db[_0x4bc5cd[_0x481a('0x23')]],'as':_0x4bc5cd['as'],'attributes':_0x4bc5cd[_0x481a('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x159246){logger[_0x481a('0x12')]('GetMailQueue',_0x3b9362);logger[_0x481a('0x14')]('GetMailQueue',_0x3b9362,JSON[_0x481a('0x24')](_0x159246));_0x2d6123(_0x159246);})[_0x481a('0x1a')](function(_0x509a06){logger['error']('GetMailQueue',_0x509a06[_0x481a('0x19')],_0x3b9362);_0x4391e0(_0x587e8a[_0x481a('0x17')](0x1f4,_0x509a06[_0x481a('0x19')]));});});};exports[_0x481a('0x25')]=function(_0x9ab0b2){var _0x439677=this;return new Promise(function(_0xa6937,_0x2a290e){return db[_0x481a('0x1c')]['find']({'raw':_0x9ab0b2['options']?_0x9ab0b2['options'][_0x481a('0x1e')]===undefined?!![]:![]:!![],'where':_0x9ab0b2['options']?_0x9ab0b2[_0x481a('0x1d')][_0x481a('0x26')]||null:null,'attributes':_0x9ab0b2['options']?_0x9ab0b2[_0x481a('0x1d')]['attributes']||null:null,'include':_0x9ab0b2[_0x481a('0x1d')]?_0x9ab0b2['options'][_0x481a('0x22')]?_[_0x481a('0x21')](_0x9ab0b2[_0x481a('0x1d')][_0x481a('0x22')],function(_0x325f9b){return{'model':db[_0x325f9b[_0x481a('0x23')]],'as':_0x325f9b['as'],'attributes':_0x325f9b[_0x481a('0x1f')],'include':_0x325f9b[_0x481a('0x22')]?_[_0x481a('0x21')](_0x325f9b['include'],function(_0x1e6edc){return{'model':db[_0x1e6edc[_0x481a('0x23')]],'as':_0x1e6edc['as'],'attributes':_0x1e6edc[_0x481a('0x1f')],'include':_0x1e6edc[_0x481a('0x22')]?_[_0x481a('0x21')](_0x1e6edc['include'],function(_0x308765){return{'model':db[_0x308765[_0x481a('0x23')]],'as':_0x308765['as'],'attributes':_0x308765['attributes']};}):[]};}):[]};}):[]:[]})[_0x481a('0x11')](function(_0x1d4f65){logger[_0x481a('0x12')](_0x481a('0x25'),_0x9ab0b2);logger[_0x481a('0x14')](_0x481a('0x25'),_0x9ab0b2,JSON['stringify'](_0x1d4f65));_0xa6937(_0x1d4f65);})[_0x481a('0x1a')](function(_0x44802d){logger[_0x481a('0x17')](_0x481a('0x25'),_0x44802d['message'],_0x9ab0b2);_0x2a290e(_0x439677[_0x481a('0x17')](0x1f4,_0x44802d[_0x481a('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 3293634..4feb15c 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 _0x0ddf=['mailQueue:','save','remove','update','removeListener','length'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0ddf,0x187));var _0xf0dd=function(_0x3b3305,_0x55a034){_0x3b3305=_0x3b3305-0x0;var _0x648558=_0x0ddf[_0x3b3305];return _0x648558;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xf0dd('0x0'),_0xf0dd('0x1'),_0xf0dd('0x2')];function createListener(_0x3c56a2,_0x5d46d5){return function(_0x4e0262){_0x5d46d5['emit'](_0x3c56a2,_0x4e0262);};}function removeListener(_0x26caad,_0x2d23e6){return function(){MailQueueEvents[_0xf0dd('0x3')](_0x26caad,_0x2d23e6);};}exports['register']=function(_0x5c05ec){for(var _0x4c3db2=0x0,_0x34bace=events[_0xf0dd('0x4')];_0x4c3db2<_0x34bace;_0x4c3db2++){var _0x528b65=events[_0x4c3db2];var _0x219185=createListener(_0xf0dd('0x5')+_0x528b65,_0x5c05ec);MailQueueEvents['on'](_0x528b65,_0x219185);}}; \ No newline at end of file +var _0xbf06=['mailQueue:','save','remove','update','emit','removeListener','register','length'];(function(_0x2a54a9,_0x4ba8f0){var _0x4ce558=function(_0x2708fd){while(--_0x2708fd){_0x2a54a9['push'](_0x2a54a9['shift']());}};_0x4ce558(++_0x4ba8f0);}(_0xbf06,0x101));var _0x6bf0=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xbf06[_0x9cd4c3];return _0x4c9025;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x6bf0('0x0'),_0x6bf0('0x1'),_0x6bf0('0x2')];function createListener(_0x1a969b,_0x208ee9){return function(_0x23f48c){_0x208ee9[_0x6bf0('0x3')](_0x1a969b,_0x23f48c);};}function removeListener(_0x58b98a,_0x58a2c6){return function(){MailQueueEvents[_0x6bf0('0x4')](_0x58b98a,_0x58a2c6);};}exports[_0x6bf0('0x5')]=function(_0x219a41){for(var _0x255ed6=0x0,_0x4fc26f=events[_0x6bf0('0x6')];_0x255ed6<_0x4fc26f;_0x255ed6++){var _0x29f59d=events[_0x255ed6];var _0x1db2a7=createListener(_0x6bf0('0x7')+_0x29f59d,_0x219a41);MailQueueEvents['on'](_0x29f59d,_0x1db2a7);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 7287c28..e659698 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 _0xf501=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','post','create','put'];(function(_0x5a50c0,_0x166b48){var _0x4b3305=function(_0x587531){while(--_0x587531){_0x5a50c0['push'](_0x5a50c0['shift']());}};_0x4b3305(++_0x166b48);}(_0xf501,0xb8));var _0x1f50=function(_0x6e1347,_0x1eba9d){_0x6e1347=_0x6e1347-0x0;var _0x23b869=_0xf501[_0x6e1347];return _0x23b869;};'use strict';var multer=require(_0x1f50('0x0'));var util=require(_0x1f50('0x1'));var path=require('path');var timeout=require(_0x1f50('0x2'));var express=require(_0x1f50('0x3'));var router=express[_0x1f50('0x4')]();var fs_extra=require(_0x1f50('0x5'));var auth=require(_0x1f50('0x6'));var interaction=require(_0x1f50('0x7'));var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router['get']('/',auth[_0x1f50('0x8')](),controller[_0x1f50('0x9')]);router[_0x1f50('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x1f50('0xb'),auth['isAuthenticated'](),controller[_0x1f50('0xc')]);router[_0x1f50('0xd')]('/',auth[_0x1f50('0x8')](),controller[_0x1f50('0xe')]);router[_0x1f50('0xf')](_0x1f50('0xb'),auth['isAuthenticated'](),controller[_0x1f50('0x10')]);router[_0x1f50('0x11')](_0x1f50('0xb'),auth[_0x1f50('0x8')](),controller[_0x1f50('0x12')]);module[_0x1f50('0x13')]=router; \ No newline at end of file +var _0x68f6=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','index','/describe','isAuthenticated','/:id','show','put','update','delete','destroy'];(function(_0x55c6de,_0x972148){var _0x4fa991=function(_0x15cad8){while(--_0x15cad8){_0x55c6de['push'](_0x55c6de['shift']());}};_0x4fa991(++_0x972148);}(_0x68f6,0x86));var _0x668f=function(_0x4e8245,_0xb91617){_0x4e8245=_0x4e8245-0x0;var _0x2da502=_0x68f6[_0x4e8245];return _0x2da502;};'use strict';var multer=require(_0x668f('0x0'));var util=require(_0x668f('0x1'));var path=require(_0x668f('0x2'));var timeout=require(_0x668f('0x3'));var express=require('express');var router=express[_0x668f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x668f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x668f('0x6'));var controller=require(_0x668f('0x7'));router[_0x668f('0x8')]('/',auth['isAuthenticated'](),controller[_0x668f('0x9')]);router[_0x668f('0x8')](_0x668f('0xa'),auth[_0x668f('0xb')](),controller['describe']);router['get'](_0x668f('0xc'),auth[_0x668f('0xb')](),controller[_0x668f('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x668f('0xe')]('/:id',auth[_0x668f('0xb')](),controller[_0x668f('0xf')]);router[_0x668f('0x10')](_0x668f('0xc'),auth[_0x668f('0xb')](),controller[_0x668f('0x11')]);module[_0x668f('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 79f73b5..8caf4ba 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 _0x6d67=['DATE','moment','sequelize','exports','STRING'];(function(_0xc56a80,_0x19f95e){var _0x51fe9d=function(_0x376499){while(--_0x376499){_0xc56a80['push'](_0xc56a80['shift']());}};_0x51fe9d(++_0x19f95e);}(_0x6d67,0xb5));var _0x76d6=function(_0x313f8d,_0x33a76c){_0x313f8d=_0x313f8d-0x0;var _0xad6140=_0x6d67[_0x313f8d];return _0xad6140;};'use strict';var moment=require(_0x76d6('0x0'));var Sequelize=require(_0x76d6('0x1'));module[_0x76d6('0x2')]={'uniqueid':{'type':Sequelize[_0x76d6('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x76d6('0x4')]},'leaveAt':{'type':Sequelize[_0x76d6('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x76d6('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7c1c=['exports','STRING','DATE','moment'];(function(_0x17dd2e,_0x2d8c48){var _0x126a5e=function(_0x32da8e){while(--_0x32da8e){_0x17dd2e['push'](_0x17dd2e['shift']());}};_0x126a5e(++_0x2d8c48);}(_0x7c1c,0x1d3));var _0xc7c1=function(_0x26447e,_0x2e9c94){_0x26447e=_0x26447e-0x0;var _0x38cc1a=_0x7c1c[_0x26447e];return _0x38cc1a;};'use strict';var moment=require(_0xc7c1('0x0'));var Sequelize=require('sequelize');module[_0xc7c1('0x1')]={'uniqueid':{'type':Sequelize[_0xc7c1('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xc7c1('0x2')]},'joinAt':{'type':Sequelize[_0xc7c1('0x3')]},'leaveAt':{'type':Sequelize[_0xc7c1('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xc7c1('0x3')]},'reason':{'type':Sequelize[_0xc7c1('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index c6a0413..af54737 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 _0xf61e=['where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','find','create','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','destroy','then','status','error','stack','name','send','index','map','MailQueueReport','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order'];(function(_0x5e8de7,_0x39e393){var _0x29590e=function(_0x1d3165){while(--_0x1d3165){_0x5e8de7['push'](_0x5e8de7['shift']());}};_0x29590e(++_0x39e393);}(_0xf61e,0x191));var _0xef61=function(_0x181712,_0x383f13){_0x181712=_0x181712-0x0;var _0x3c9578=_0xf61e[_0x181712];return _0x3c9578;};'use strict';var emlformat=require(_0xef61('0x0'));var rimraf=require(_0xef61('0x1'));var zipdir=require(_0xef61('0x2'));var jsonpatch=require(_0xef61('0x3'));var rp=require(_0xef61('0x4'));var moment=require(_0xef61('0x5'));var BPromise=require(_0xef61('0x6'));var Mustache=require(_0xef61('0x7'));var util=require(_0xef61('0x8'));var path=require(_0xef61('0x9'));var sox=require(_0xef61('0xa'));var csv=require(_0xef61('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef61('0xc'));var _=require(_0xef61('0xd'));var squel=require('squel');var crypto=require(_0xef61('0xe'));var jsforce=require(_0xef61('0xf'));var deskjs=require(_0xef61('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef61('0x11'));var Redis=require(_0xef61('0x12'));var authService=require(_0xef61('0x13'));var qs=require(_0xef61('0x14'));var as=require(_0xef61('0x15'));var hardwareService=require(_0xef61('0x16'));var logger=require(_0xef61('0x17'))(_0xef61('0x18'));var utils=require(_0xef61('0x19'));var config=require(_0xef61('0x1a'));var licenseUtil=require(_0xef61('0x1b'));var db=require(_0xef61('0x1c'))['db'];function respondWithStatusCode(_0x114e1f,_0x318f1c){_0x318f1c=_0x318f1c||0xcc;return function(_0x5de159){if(_0x5de159){return _0x114e1f[_0xef61('0x1d')](_0x318f1c);}return _0x114e1f['status'](_0x318f1c)[_0xef61('0x1e')]();};}function respondWithResult(_0x1db2a9,_0x370ee0){_0x370ee0=_0x370ee0||0xc8;return function(_0x76ef9b){if(_0x76ef9b){return _0x1db2a9['status'](_0x370ee0)[_0xef61('0x1f')](_0x76ef9b);}};}function respondWithFilteredResult(_0x435beb,_0x1224c2){return function(_0x78ff22){if(_0x78ff22){var _0x588a61=typeof _0x1224c2[_0xef61('0x20')]===_0xef61('0x21')&&typeof _0x1224c2['limit']===_0xef61('0x21');var _0x408541=_0x78ff22[_0xef61('0x22')];var _0x22dc1b=_0x588a61?0x0:_0x1224c2[_0xef61('0x20')];var _0x28315a=_0x588a61?_0x78ff22[_0xef61('0x22')]:_0x1224c2['offset']+_0x1224c2[_0xef61('0x23')];var _0x2c8dad;if(_0x28315a>=_0x408541){_0x28315a=_0x408541;_0x2c8dad=0xc8;}else{_0x2c8dad=0xce;}_0x435beb['status'](_0x2c8dad);return _0x435beb[_0xef61('0x24')](_0xef61('0x25'),_0x22dc1b+'-'+_0x28315a+'/'+_0x408541)[_0xef61('0x1f')](_0x78ff22);}return null;};}function patchUpdates(_0x26cf42){return function(_0xb0d7a4){try{jsonpatch[_0xef61('0x26')](_0xb0d7a4,_0x26cf42,!![]);}catch(_0x92ea33){return BPromise['reject'](_0x92ea33);}return _0xb0d7a4['save']();};}function saveUpdates(_0x3d31c1,_0x58bd7d){return function(_0x389d6d){if(_0x389d6d){return _0x389d6d['update'](_0x3d31c1)['then'](function(_0x2f0569){return _0x2f0569;});}return null;};}function removeEntity(_0x5ce99d,_0x53181b){return function(_0xfbee94){if(_0xfbee94){return _0xfbee94[_0xef61('0x27')]()[_0xef61('0x28')](function(){_0x5ce99d[_0xef61('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16b144,_0x4e738f){return function(_0x2a6832){if(!_0x2a6832){_0x16b144[_0xef61('0x1d')](0x194);}return _0x2a6832;};}function handleError(_0x2419a9,_0xf4c7c9){_0xf4c7c9=_0xf4c7c9||0x1f4;return function(_0x2155f1){logger[_0xef61('0x2a')](_0x2155f1[_0xef61('0x2b')]);if(_0x2155f1[_0xef61('0x2c')]){delete _0x2155f1[_0xef61('0x2c')];}_0x2419a9[_0xef61('0x29')](_0xf4c7c9)[_0xef61('0x2d')](_0x2155f1);};}exports[_0xef61('0x2e')]=function(_0xeb9a62,_0x63edd4){var _0x1f3572={},_0x85978={},_0x39c15e={'count':0x0,'rows':[]};var _0x393ea9=_[_0xef61('0x2f')](db[_0xef61('0x30')][_0xef61('0x31')],function(_0x53fa3b){return{'name':_0x53fa3b['fieldName'],'type':_0x53fa3b['type'][_0xef61('0x32')]};});_0x85978[_0xef61('0x33')]=_[_0xef61('0x2f')](_0x393ea9,'name');_0x85978[_0xef61('0x34')]=_[_0xef61('0x35')](_0xeb9a62['query']);_0x85978[_0xef61('0x36')]=_['intersection'](_0x85978['model'],_0x85978[_0xef61('0x34')]);_0x1f3572['attributes']=_[_0xef61('0x37')](_0x85978['model'],qs[_0xef61('0x38')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x38')]));_0x1f3572[_0xef61('0x39')]=_0x1f3572[_0xef61('0x39')][_0xef61('0x3a')]?_0x1f3572[_0xef61('0x39')]:_0x85978[_0xef61('0x33')];if(!_0xeb9a62[_0xef61('0x34')][_0xef61('0x3b')]('nolimit')){_0x1f3572[_0xef61('0x23')]=qs[_0xef61('0x23')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x23')]);_0x1f3572[_0xef61('0x20')]=qs['offset'](_0xeb9a62[_0xef61('0x34')][_0xef61('0x20')]);}_0x1f3572[_0xef61('0x3c')]=qs['sort'](_0xeb9a62['query']['sort']);_0x1f3572[_0xef61('0x3d')]=qs['filters'](_['pick'](_0xeb9a62['query'],_0x85978[_0xef61('0x36')]),_0x393ea9);if(_0xeb9a62[_0xef61('0x34')][_0xef61('0x3e')]){_0x1f3572['where']=_['merge'](_0x1f3572['where'],{'$or':_[_0xef61('0x2f')](_0x393ea9,function(_0x32ad44){if(_0x32ad44['type']!==_0xef61('0x3f')){var _0x12f442={};_0x12f442[_0x32ad44[_0xef61('0x2c')]]={'$like':'%'+_0xeb9a62[_0xef61('0x34')]['filter']+'%'};return _0x12f442;}})});}_0x1f3572=_[_0xef61('0x40')]({},_0x1f3572,_0xeb9a62[_0xef61('0x41')]);var _0x3103d4={'where':_0x1f3572[_0xef61('0x3d')]};return db['MailQueueReport']['count'](_0x3103d4)[_0xef61('0x28')](function(_0x462972){_0x39c15e[_0xef61('0x22')]=_0x462972;if(_0xeb9a62['query'][_0xef61('0x42')]){_0x1f3572[_0xef61('0x43')]=[{'all':!![]}];}return db[_0xef61('0x30')][_0xef61('0x44')](_0x1f3572);})['then'](function(_0x545597){_0x39c15e['rows']=_0x545597;return _0x39c15e;})[_0xef61('0x28')](respondWithFilteredResult(_0x63edd4,_0x1f3572))[_0xef61('0x45')](handleError(_0x63edd4,null));};exports[_0xef61('0x46')]=function(_0xe40d,_0x3f81a1){var _0x272143={'raw':!![],'where':{'id':_0xe40d['params']['id']}},_0xc9b467={};_0xc9b467[_0xef61('0x33')]=_[_0xef61('0x35')](db[_0xef61('0x30')][_0xef61('0x31')]);_0xc9b467['query']=_[_0xef61('0x35')](_0xe40d[_0xef61('0x34')]);_0xc9b467[_0xef61('0x36')]=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],_0xc9b467[_0xef61('0x34')]);_0x272143['attributes']=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],qs[_0xef61('0x38')](_0xe40d['query'][_0xef61('0x38')]));_0x272143[_0xef61('0x39')]=_0x272143[_0xef61('0x39')][_0xef61('0x3a')]?_0x272143[_0xef61('0x39')]:_0xc9b467[_0xef61('0x33')];if(_0xe40d['query'][_0xef61('0x42')]){_0x272143[_0xef61('0x43')]=[{'all':!![]}];}_0x272143=_['merge']({},_0x272143,_0xe40d[_0xef61('0x41')]);return db[_0xef61('0x30')][_0xef61('0x47')](_0x272143)[_0xef61('0x28')](handleEntityNotFound(_0x3f81a1,null))['then'](respondWithResult(_0x3f81a1,null))[_0xef61('0x45')](handleError(_0x3f81a1,null));};exports[_0xef61('0x48')]=function(_0x5e614b,_0x47b09d){return db[_0xef61('0x30')][_0xef61('0x48')](_0x5e614b['body'],{})[_0xef61('0x28')](respondWithResult(_0x47b09d,0xc9))[_0xef61('0x45')](handleError(_0x47b09d,null));};exports[_0xef61('0x49')]=function(_0x2904e0,_0x13bb20){if(_0x2904e0[_0xef61('0x4a')]['id']){delete _0x2904e0[_0xef61('0x4a')]['id'];}return db['MailQueueReport'][_0xef61('0x47')]({'where':{'id':_0x2904e0['params']['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x13bb20,null))[_0xef61('0x28')](saveUpdates(_0x2904e0[_0xef61('0x4a')],null))[_0xef61('0x28')](respondWithResult(_0x13bb20,null))[_0xef61('0x45')](handleError(_0x13bb20,null));};exports[_0xef61('0x27')]=function(_0x3e23eb,_0x1565c7){return db[_0xef61('0x30')]['find']({'where':{'id':_0x3e23eb[_0xef61('0x4b')]['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x1565c7,null))['then'](removeEntity(_0x1565c7,null))['catch'](handleError(_0x1565c7,null));};exports[_0xef61('0x4c')]=function(_0x1ce127,_0x504389){return db[_0xef61('0x30')]['describe']()[_0xef61('0x28')](respondWithResult(_0x504389,null))[_0xef61('0x45')](handleError(_0x504389,null));}; \ No newline at end of file +var _0xa30a=['destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','apply','save','update','then','error','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','include','findAll','rows','catch','includeAll','find','body'];(function(_0x43c04b,_0x505017){var _0x428588=function(_0x1ec084){while(--_0x1ec084){_0x43c04b['push'](_0x43c04b['shift']());}};_0x428588(++_0x505017);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xaa30('0x0'));var rimraf=require(_0xaa30('0x1'));var zipdir=require(_0xaa30('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa30('0x3'));var moment=require(_0xaa30('0x4'));var BPromise=require(_0xaa30('0x5'));var Mustache=require(_0xaa30('0x6'));var util=require(_0xaa30('0x7'));var path=require(_0xaa30('0x8'));var sox=require(_0xaa30('0x9'));var csv=require('to-csv');var ejs=require(_0xaa30('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa30('0xb'));var squel=require(_0xaa30('0xc'));var crypto=require(_0xaa30('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaa30('0xe'));var toCsv=require(_0xaa30('0xf'));var querystring=require(_0xaa30('0x10'));var Papa=require(_0xaa30('0x11'));var Redis=require(_0xaa30('0x12'));var authService=require(_0xaa30('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa30('0x14'));var logger=require('../../config/logger')(_0xaa30('0x15'));var utils=require(_0xaa30('0x16'));var config=require(_0xaa30('0x17'));var licenseUtil=require(_0xaa30('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xec992f,_0x3de2d1){_0x3de2d1=_0x3de2d1||0xcc;return function(_0xcd1d3b){if(_0xcd1d3b){return _0xec992f['sendStatus'](_0x3de2d1);}return _0xec992f[_0xaa30('0x19')](_0x3de2d1)[_0xaa30('0x1a')]();};}function respondWithResult(_0x25c02e,_0x14de74){_0x14de74=_0x14de74||0xc8;return function(_0x41f1d9){if(_0x41f1d9){return _0x25c02e[_0xaa30('0x19')](_0x14de74)[_0xaa30('0x1b')](_0x41f1d9);}};}function respondWithFilteredResult(_0x3b8095,_0x2e37af){return function(_0xfae724){if(_0xfae724){var _0x519518=typeof _0x2e37af[_0xaa30('0x1c')]==='undefined'&&typeof _0x2e37af['limit']===_0xaa30('0x1d');var _0x153939=_0xfae724[_0xaa30('0x1e')];var _0x540e36=_0x519518?0x0:_0x2e37af['offset'];var _0x53f9fd=_0x519518?_0xfae724[_0xaa30('0x1e')]:_0x2e37af['offset']+_0x2e37af[_0xaa30('0x1f')];var _0x332a0a;if(_0x53f9fd>=_0x153939){_0x53f9fd=_0x153939;_0x332a0a=0xc8;}else{_0x332a0a=0xce;}_0x3b8095['status'](_0x332a0a);return _0x3b8095['set']('Content-Range',_0x540e36+'-'+_0x53f9fd+'/'+_0x153939)[_0xaa30('0x1b')](_0xfae724);}return null;};}function patchUpdates(_0x3e4f1d){return function(_0x61b85){try{jsonpatch[_0xaa30('0x20')](_0x61b85,_0x3e4f1d,!![]);}catch(_0x43a526){return BPromise['reject'](_0x43a526);}return _0x61b85[_0xaa30('0x21')]();};}function saveUpdates(_0x24bb25,_0x2e16e7){return function(_0x2d9e35){if(_0x2d9e35){return _0x2d9e35[_0xaa30('0x22')](_0x24bb25)['then'](function(_0x325b42){return _0x325b42;});}return null;};}function removeEntity(_0x13128a,_0x2fecdd){return function(_0x326f84){if(_0x326f84){return _0x326f84['destroy']()[_0xaa30('0x23')](function(){_0x13128a[_0xaa30('0x19')](0xcc)[_0xaa30('0x1a')]();});}};}function handleEntityNotFound(_0x12da2f,_0x97b038){return function(_0x2a59ce){if(!_0x2a59ce){_0x12da2f['sendStatus'](0x194);}return _0x2a59ce;};}function handleError(_0x467850,_0x465701){_0x465701=_0x465701||0x1f4;return function(_0x5d4da8){logger[_0xaa30('0x24')](_0x5d4da8['stack']);if(_0x5d4da8[_0xaa30('0x25')]){delete _0x5d4da8[_0xaa30('0x25')];}_0x467850[_0xaa30('0x19')](_0x465701)[_0xaa30('0x26')](_0x5d4da8);};}exports[_0xaa30('0x27')]=function(_0xc10b8f,_0x6ff09a){var _0x39f708={},_0x1f288c={},_0x43fb30={'count':0x0,'rows':[]};var _0x44aa9b=_[_0xaa30('0x28')](db[_0xaa30('0x29')][_0xaa30('0x2a')],function(_0x40e4ee){return{'name':_0x40e4ee[_0xaa30('0x2b')],'type':_0x40e4ee[_0xaa30('0x2c')][_0xaa30('0x2d')]};});_0x1f288c['model']=_[_0xaa30('0x28')](_0x44aa9b,_0xaa30('0x25'));_0x1f288c[_0xaa30('0x2e')]=_[_0xaa30('0x2f')](_0xc10b8f[_0xaa30('0x2e')]);_0x1f288c[_0xaa30('0x30')]=_['intersection'](_0x1f288c['model'],_0x1f288c['query']);_0x39f708[_0xaa30('0x31')]=_[_0xaa30('0x32')](_0x1f288c[_0xaa30('0x33')],qs[_0xaa30('0x34')](_0xc10b8f[_0xaa30('0x2e')]['fields']));_0x39f708['attributes']=_0x39f708[_0xaa30('0x31')][_0xaa30('0x35')]?_0x39f708['attributes']:_0x1f288c[_0xaa30('0x33')];if(!_0xc10b8f['query'][_0xaa30('0x36')]('nolimit')){_0x39f708[_0xaa30('0x1f')]=qs[_0xaa30('0x1f')](_0xc10b8f['query'][_0xaa30('0x1f')]);_0x39f708[_0xaa30('0x1c')]=qs[_0xaa30('0x1c')](_0xc10b8f[_0xaa30('0x2e')][_0xaa30('0x1c')]);}_0x39f708[_0xaa30('0x37')]=qs['sort'](_0xc10b8f[_0xaa30('0x2e')][_0xaa30('0x38')]);_0x39f708['where']=qs[_0xaa30('0x30')](_[_0xaa30('0x39')](_0xc10b8f[_0xaa30('0x2e')],_0x1f288c['filters']),_0x44aa9b);if(_0xc10b8f['query'][_0xaa30('0x3a')]){_0x39f708[_0xaa30('0x3b')]=_[_0xaa30('0x3c')](_0x39f708[_0xaa30('0x3b')],{'$or':_[_0xaa30('0x28')](_0x44aa9b,function(_0x291854){if(_0x291854['type']!=='VIRTUAL'){var _0x120c43={};_0x120c43[_0x291854[_0xaa30('0x25')]]={'$like':'%'+_0xc10b8f[_0xaa30('0x2e')]['filter']+'%'};return _0x120c43;}})});}_0x39f708=_[_0xaa30('0x3c')]({},_0x39f708,_0xc10b8f[_0xaa30('0x3d')]);var _0x8fb95e={'where':_0x39f708[_0xaa30('0x3b')]};return db['MailQueueReport'][_0xaa30('0x1e')](_0x8fb95e)[_0xaa30('0x23')](function(_0x2c5ddb){_0x43fb30[_0xaa30('0x1e')]=_0x2c5ddb;if(_0xc10b8f[_0xaa30('0x2e')]['includeAll']){_0x39f708[_0xaa30('0x3e')]=[{'all':!![]}];}return db[_0xaa30('0x29')][_0xaa30('0x3f')](_0x39f708);})[_0xaa30('0x23')](function(_0x13f08f){_0x43fb30[_0xaa30('0x40')]=_0x13f08f;return _0x43fb30;})[_0xaa30('0x23')](respondWithFilteredResult(_0x6ff09a,_0x39f708))[_0xaa30('0x41')](handleError(_0x6ff09a,null));};exports['show']=function(_0x59ef25,_0x18771d){var _0x4a170a={'raw':!![],'where':{'id':_0x59ef25['params']['id']}},_0x5208f8={};_0x5208f8[_0xaa30('0x33')]=_['keys'](db[_0xaa30('0x29')]['rawAttributes']);_0x5208f8[_0xaa30('0x2e')]=_[_0xaa30('0x2f')](_0x59ef25[_0xaa30('0x2e')]);_0x5208f8[_0xaa30('0x30')]=_[_0xaa30('0x32')](_0x5208f8[_0xaa30('0x33')],_0x5208f8[_0xaa30('0x2e')]);_0x4a170a[_0xaa30('0x31')]=_[_0xaa30('0x32')](_0x5208f8[_0xaa30('0x33')],qs[_0xaa30('0x34')](_0x59ef25['query'][_0xaa30('0x34')]));_0x4a170a[_0xaa30('0x31')]=_0x4a170a[_0xaa30('0x31')][_0xaa30('0x35')]?_0x4a170a[_0xaa30('0x31')]:_0x5208f8['model'];if(_0x59ef25['query'][_0xaa30('0x42')]){_0x4a170a['include']=[{'all':!![]}];}_0x4a170a=_[_0xaa30('0x3c')]({},_0x4a170a,_0x59ef25[_0xaa30('0x3d')]);return db[_0xaa30('0x29')][_0xaa30('0x43')](_0x4a170a)[_0xaa30('0x23')](handleEntityNotFound(_0x18771d,null))[_0xaa30('0x23')](respondWithResult(_0x18771d,null))[_0xaa30('0x41')](handleError(_0x18771d,null));};exports['create']=function(_0x3cf0bb,_0x6c9da6){return db[_0xaa30('0x29')]['create'](_0x3cf0bb[_0xaa30('0x44')],{})[_0xaa30('0x23')](respondWithResult(_0x6c9da6,0xc9))['catch'](handleError(_0x6c9da6,null));};exports[_0xaa30('0x22')]=function(_0x4a8fcc,_0x25d227){if(_0x4a8fcc['body']['id']){delete _0x4a8fcc['body']['id'];}return db[_0xaa30('0x29')]['find']({'where':{'id':_0x4a8fcc['params']['id']}})[_0xaa30('0x23')](handleEntityNotFound(_0x25d227,null))[_0xaa30('0x23')](saveUpdates(_0x4a8fcc[_0xaa30('0x44')],null))[_0xaa30('0x23')](respondWithResult(_0x25d227,null))[_0xaa30('0x41')](handleError(_0x25d227,null));};exports[_0xaa30('0x45')]=function(_0x5616cd,_0x17d75d){return db[_0xaa30('0x29')][_0xaa30('0x43')]({'where':{'id':_0x5616cd['params']['id']}})['then'](handleEntityNotFound(_0x17d75d,null))['then'](removeEntity(_0x17d75d,null))['catch'](handleError(_0x17d75d,null));};exports[_0xaa30('0x46')]=function(_0x1ba164,_0xdc32bc){return db[_0xaa30('0x29')][_0xaa30('0x46')]()[_0xaa30('0x23')](respondWithResult(_0xdc32bc,null))['catch'](handleError(_0xdc32bc,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index e8b591c..b794213 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 _0x674b=['rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x674b,0xd7));var _0xb674=function(_0x45e505,_0x1bf5b3){_0x45e505=_0x45e505-0x0;var _0x52001f=_0x674b[_0x45e505];return _0x52001f;};'use strict';var _=require(_0xb674('0x0'));var util=require(_0xb674('0x1'));var logger=require(_0xb674('0x2'))('api');var moment=require(_0xb674('0x3'));var BPromise=require(_0xb674('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb674('0x5'));var rimraf=require(_0xb674('0x6'));var config=require(_0xb674('0x7'));var attributes=require(_0xb674('0x8'));module[_0xb674('0x9')]=function(_0x4961b3,_0x181bfc){return _0x4961b3['define'](_0xb674('0xa'),attributes,{'tableName':_0xb674('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb674('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x394d=['report_mail_queue','uniqueid','lodash','moment','bluebird','path','../../config/environment','define'];(function(_0x5ef161,_0x27d16c){var _0x1c6e9e=function(_0x8fc2a6){while(--_0x8fc2a6){_0x5ef161['push'](_0x5ef161['shift']());}};_0x1c6e9e(++_0x27d16c);}(_0x394d,0x12a));var _0xd394=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x394d[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0xd394('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd394('0x1'));var BPromise=require(_0xd394('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd394('0x3'));var rimraf=require('rimraf');var config=require(_0xd394('0x4'));var attributes=require('./mailQueueReport.attributes');module['exports']=function(_0x24558b,_0x59a7fd){return _0x24558b[_0xd394('0x5')]('MailQueueReport',attributes,{'tableName':_0xd394('0x6'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd394('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index b646c54..99d171e 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 _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x261b84,_0x5bda10){var _0x1fcf21=function(_0x1dcc8e){while(--_0x1dcc8e){_0x261b84['push'](_0x261b84['shift']());}};_0x1fcf21(++_0x5bda10);}(_0xdb28,0x106));var _0x8db2=function(_0xa1f626,_0x23d3ba){_0xa1f626=_0xa1f626-0x0;var _0x16a9e7=_0xdb28[_0xa1f626];return _0x16a9e7;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file +var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x575321,_0x54f6b0){var _0x419a7a=function(_0x32f99b){while(--_0x32f99b){_0x575321['push'](_0x575321['shift']());}};_0x419a7a(++_0x54f6b0);}(_0x7a54,0x106));var _0x47a5=function(_0x1028b4,_0xb8da2e){_0x1028b4=_0x1028b4-0x0;var _0x21b84c=_0x7a54[_0x1028b4];return _0x21b84c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateMailQueueReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateMailQueueReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index c04ed4e..5243ee0 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x135448,_0x4ca19f){var _0x28389e=function(_0x5a2113){while(--_0x5a2113){_0x135448['push'](_0x135448['shift']());}};_0x28389e(++_0x4ca19f);}(_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 +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x421c79,_0x199886){var _0x2c87cf=function(_0x249c12){while(--_0x249c12){_0x421c79['push'](_0x421c79['shift']());}};_0x2c87cf(++_0x199886);}(_0x70e0,0x17b));var _0x070e=function(_0xa110c4,_0x24d9e7){_0xa110c4=_0xa110c4-0x0;var _0x407941=_0x70e0[_0xa110c4];return _0x407941;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 9e0d8a7..3b6ca0c 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 _0x1e72=['BOOLEAN','sequelize','STRING','INTEGER'];(function(_0x386187,_0x1ad2ac){var _0x4abeaa=function(_0x251f63){while(--_0x251f63){_0x386187['push'](_0x386187['shift']());}};_0x4abeaa(++_0x1ad2ac);}(_0x1e72,0x1a1));var _0x21e7=function(_0x130cbc,_0x2641a5){_0x130cbc=_0x130cbc-0x0;var _0x3431e4=_0x1e72[_0x130cbc];return _0x3431e4;};'use strict';var Sequelize=require(_0x21e7('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x21e7('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x21e7('0x1')]},'password':{'type':Sequelize[_0x21e7('0x1')]},'port':{'type':Sequelize[_0x21e7('0x2')]},'tls':{'type':Sequelize[_0x21e7('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x21e7('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x21e7('0x2')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x21e7('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x8069=['BOOLEAN','INTEGER','INBOX','STRING'];(function(_0xa06b3f,_0x2cee0b){var _0x1c007e=function(_0x322345){while(--_0x322345){_0xa06b3f['push'](_0xa06b3f['shift']());}};_0x1c007e(++_0x2cee0b);}(_0x8069,0x67));var _0x9806=function(_0x3bcaac,_0x2f1612){_0x3bcaac=_0x3bcaac-0x0;var _0x2cdf61=_0x8069[_0x3bcaac];return _0x2cdf61;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x9806('0x0')]},'host':{'type':Sequelize[_0x9806('0x0')]},'authentication':{'type':Sequelize[_0x9806('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0x9806('0x0')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x9806('0x2')]},'tls':{'type':Sequelize[_0x9806('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x9806('0x0')],'defaultValue':_0x9806('0x3')},'connTimeout':{'type':Sequelize[_0x9806('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x9806('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0x9806('0x0')]},'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 8e7a379..e2e1743 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 _0x9c79=['../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in','util','api','bluebird','request-promise','path','rimraf'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x9c79,0x1c8));var _0x99c7=function(_0x315d54,_0x333bec){_0x315d54=_0x315d54-0x0;var _0x21c13e=_0x9c79[_0x315d54];return _0x21c13e;};'use strict';var _=require('lodash');var util=require(_0x99c7('0x0'));var logger=require('../../config/logger')(_0x99c7('0x1'));var moment=require('moment');var BPromise=require(_0x99c7('0x2'));var rp=require(_0x99c7('0x3'));var fs=require('fs');var path=require(_0x99c7('0x4'));var rimraf=require(_0x99c7('0x5'));var config=require(_0x99c7('0x6'));var attributes=require(_0x99c7('0x7'));module[_0x99c7('0x8')]=function(_0x247b34,_0x56cd6d){return _0x247b34['define'](_0x99c7('0x9'),attributes,{'tableName':_0x99c7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e3c=['./mailServerIn.attributes','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x3e3c,0x1f0));var _0xc3e3=function(_0x25381c,_0x5a70bc){_0x25381c=_0x25381c-0x0;var _0x2aa5ad=_0x3e3c[_0x25381c];return _0x2aa5ad;};'use strict';var _=require(_0xc3e3('0x0'));var util=require(_0xc3e3('0x1'));var logger=require(_0xc3e3('0x2'))(_0xc3e3('0x3'));var moment=require(_0xc3e3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3e3('0x5'));var rimraf=require(_0xc3e3('0x6'));var config=require(_0xc3e3('0x7'));var attributes=require(_0xc3e3('0x8'));module['exports']=function(_0x43b489,_0x132768){return _0x43b489[_0xc3e3('0x9')](_0xc3e3('0xa'),attributes,{'tableName':_0xc3e3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 38d2c90..38b6474 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 _0xfa12=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','catch','GetMailServerIn','options','raw','attributes','limit','include','map','model','then'];(function(_0x165718,_0x49ae0b){var _0x2e57b2=function(_0x544f09){while(--_0x544f09){_0x165718['push'](_0x165718['shift']());}};_0x2e57b2(++_0x49ae0b);}(_0xfa12,0x1b2));var _0x2fa1=function(_0x28df6b,_0x2940bc){_0x28df6b=_0x28df6b-0x0;var _0xa57399=_0xfa12[_0x28df6b];return _0xa57399;};'use strict';var _=require(_0x2fa1('0x0'));var util=require(_0x2fa1('0x1'));var moment=require('moment');var BPromise=require(_0x2fa1('0x2'));var rs=require(_0x2fa1('0x3'));var fs=require('fs');var Redis=require(_0x2fa1('0x4'));var db=require(_0x2fa1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2fa1('0x6'))(_0x2fa1('0x7'));var config=require(_0x2fa1('0x8'));var jayson=require(_0x2fa1('0x9'));var client=jayson['client'][_0x2fa1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25b233,_0x58a81e,_0x3449c3){return new BPromise(function(_0x30a897,_0x2a9dc4){return client[_0x2fa1('0xb')](_0x25b233,_0x3449c3)['then'](function(_0x3ac971){logger[_0x2fa1('0xc')]('MailServerIn,\x20%s,\x20%s',_0x58a81e,_0x2fa1('0xd'));logger[_0x2fa1('0xe')](_0x2fa1('0xf'),_0x58a81e,_0x2fa1('0xd'),JSON[_0x2fa1('0x10')](_0x3ac971));if(_0x3ac971[_0x2fa1('0x11')]){if(_0x3ac971[_0x2fa1('0x11')][_0x2fa1('0x12')]===0x1f4){logger['error'](_0x2fa1('0x13'),_0x58a81e,_0x3ac971[_0x2fa1('0x11')][_0x2fa1('0x14')]);return _0x2a9dc4(_0x3ac971[_0x2fa1('0x11')][_0x2fa1('0x14')]);}logger[_0x2fa1('0x11')]('MailServerIn,\x20%s,\x20%s',_0x58a81e,_0x3ac971[_0x2fa1('0x11')][_0x2fa1('0x14')]);return _0x30a897(_0x3ac971[_0x2fa1('0x11')][_0x2fa1('0x14')]);}else{logger['info'](_0x2fa1('0x13'),_0x58a81e,_0x2fa1('0xd'));_0x30a897(_0x3ac971['result'][_0x2fa1('0x14')]);}})[_0x2fa1('0x15')](function(_0x453d24){logger[_0x2fa1('0x11')](_0x2fa1('0x13'),_0x58a81e,_0x453d24);_0x2a9dc4(_0x453d24);});});}exports[_0x2fa1('0x16')]=function(_0x21004a){var _0x3722db=this;return new Promise(function(_0x4d16ac,_0x31b4ab){return db['MailServerIn']['findAll']({'raw':_0x21004a[_0x2fa1('0x17')]?_0x21004a[_0x2fa1('0x17')][_0x2fa1('0x18')]===undefined?!![]:![]:!![],'where':_0x21004a[_0x2fa1('0x17')]?_0x21004a[_0x2fa1('0x17')]['where']||null:null,'attributes':_0x21004a[_0x2fa1('0x17')]?_0x21004a['options'][_0x2fa1('0x19')]||null:null,'limit':_0x21004a[_0x2fa1('0x17')]?_0x21004a[_0x2fa1('0x17')][_0x2fa1('0x1a')]||null:null,'include':_0x21004a[_0x2fa1('0x17')]?_0x21004a[_0x2fa1('0x17')][_0x2fa1('0x1b')]?_[_0x2fa1('0x1c')](_0x21004a[_0x2fa1('0x17')][_0x2fa1('0x1b')],function(_0x5021fb){return{'model':db[_0x5021fb[_0x2fa1('0x1d')]],'as':_0x5021fb['as'],'attributes':_0x5021fb['attributes'],'include':_0x5021fb['include']?_['map'](_0x5021fb[_0x2fa1('0x1b')],function(_0x5c89fc){return{'model':db[_0x5c89fc['model']],'as':_0x5c89fc['as'],'attributes':_0x5c89fc[_0x2fa1('0x19')],'include':_0x5c89fc[_0x2fa1('0x1b')]?_[_0x2fa1('0x1c')](_0x5c89fc[_0x2fa1('0x1b')],function(_0x42cc71){return{'model':db[_0x42cc71[_0x2fa1('0x1d')]],'as':_0x42cc71['as'],'attributes':_0x42cc71[_0x2fa1('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2fa1('0x1e')](function(_0x255974){logger[_0x2fa1('0xc')](_0x2fa1('0x16'),_0x21004a);logger[_0x2fa1('0xe')](_0x2fa1('0x16'),_0x21004a,JSON[_0x2fa1('0x10')](_0x255974));_0x4d16ac(_0x255974);})[_0x2fa1('0x15')](function(_0xdb4308){logger[_0x2fa1('0x11')](_0x2fa1('0x16'),_0xdb4308['message'],_0x21004a);_0x31b4ab(_0x3722db[_0x2fa1('0x11')](0x1f4,_0xdb4308[_0x2fa1('0x14')]));});});}; \ No newline at end of file +var _0xfbb4=['limit','include','map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes'];(function(_0x47978a,_0x24c2c0){var _0x26ccf2=function(_0x26de97){while(--_0x26de97){_0x47978a['push'](_0x47978a['shift']());}};_0x26ccf2(++_0x24c2c0);}(_0xfbb4,0x186));var _0x4fbb=function(_0x566a82,_0x235929){_0x566a82=_0x566a82-0x0;var _0xe94f5c=_0xfbb4[_0x566a82];return _0xe94f5c;};'use strict';var _=require(_0x4fbb('0x0'));var util=require(_0x4fbb('0x1'));var moment=require(_0x4fbb('0x2'));var BPromise=require(_0x4fbb('0x3'));var rs=require(_0x4fbb('0x4'));var fs=require('fs');var Redis=require(_0x4fbb('0x5'));var db=require(_0x4fbb('0x6'))['db'];var utils=require(_0x4fbb('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x4fbb('0x8'));var jayson=require(_0x4fbb('0x9'));var client=jayson[_0x4fbb('0xa')][_0x4fbb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f0b6b,_0x53a552,_0x4d1f58){return new BPromise(function(_0x4e57d7,_0xa17d45){return client[_0x4fbb('0xc')](_0x5f0b6b,_0x4d1f58)['then'](function(_0xc9ddea){logger[_0x4fbb('0xd')]('MailServerIn,\x20%s,\x20%s',_0x53a552,_0x4fbb('0xe'));logger[_0x4fbb('0xf')](_0x4fbb('0x10'),_0x53a552,_0x4fbb('0xe'),JSON[_0x4fbb('0x11')](_0xc9ddea));if(_0xc9ddea['error']){if(_0xc9ddea[_0x4fbb('0x12')][_0x4fbb('0x13')]===0x1f4){logger[_0x4fbb('0x12')](_0x4fbb('0x14'),_0x53a552,_0xc9ddea[_0x4fbb('0x12')]['message']);return _0xa17d45(_0xc9ddea['error'][_0x4fbb('0x15')]);}logger[_0x4fbb('0x12')](_0x4fbb('0x14'),_0x53a552,_0xc9ddea[_0x4fbb('0x12')]['message']);return _0x4e57d7(_0xc9ddea[_0x4fbb('0x12')]['message']);}else{logger['info'](_0x4fbb('0x14'),_0x53a552,_0x4fbb('0xe'));_0x4e57d7(_0xc9ddea['result'][_0x4fbb('0x15')]);}})[_0x4fbb('0x16')](function(_0x5ca84d){logger['error'](_0x4fbb('0x14'),_0x53a552,_0x5ca84d);_0xa17d45(_0x5ca84d);});});}exports[_0x4fbb('0x17')]=function(_0x288852){var _0x332737=this;return new Promise(function(_0x15633c,_0x6647c3){return db[_0x4fbb('0x18')][_0x4fbb('0x19')]({'raw':_0x288852[_0x4fbb('0x1a')]?_0x288852[_0x4fbb('0x1a')][_0x4fbb('0x1b')]===undefined?!![]:![]:!![],'where':_0x288852[_0x4fbb('0x1a')]?_0x288852[_0x4fbb('0x1a')][_0x4fbb('0x1c')]||null:null,'attributes':_0x288852[_0x4fbb('0x1a')]?_0x288852[_0x4fbb('0x1a')][_0x4fbb('0x1d')]||null:null,'limit':_0x288852[_0x4fbb('0x1a')]?_0x288852[_0x4fbb('0x1a')][_0x4fbb('0x1e')]||null:null,'include':_0x288852[_0x4fbb('0x1a')]?_0x288852[_0x4fbb('0x1a')][_0x4fbb('0x1f')]?_[_0x4fbb('0x20')](_0x288852['options']['include'],function(_0x39a309){return{'model':db[_0x39a309[_0x4fbb('0x21')]],'as':_0x39a309['as'],'attributes':_0x39a309[_0x4fbb('0x1d')],'include':_0x39a309[_0x4fbb('0x1f')]?_['map'](_0x39a309[_0x4fbb('0x1f')],function(_0x11ddd3){return{'model':db[_0x11ddd3['model']],'as':_0x11ddd3['as'],'attributes':_0x11ddd3['attributes'],'include':_0x11ddd3['include']?_[_0x4fbb('0x20')](_0x11ddd3[_0x4fbb('0x1f')],function(_0x26fc01){return{'model':db[_0x26fc01[_0x4fbb('0x21')]],'as':_0x26fc01['as'],'attributes':_0x26fc01['attributes']};}):[]};}):[]};}):[]:[]})[_0x4fbb('0x22')](function(_0x288cf4){logger[_0x4fbb('0xd')]('GetMailServerIn',_0x288852);logger[_0x4fbb('0xf')](_0x4fbb('0x17'),_0x288852,JSON[_0x4fbb('0x11')](_0x288cf4));_0x15633c(_0x288cf4);})[_0x4fbb('0x16')](function(_0x1f068d){logger[_0x4fbb('0x12')](_0x4fbb('0x17'),_0x1f068d['message'],_0x288852);_0x6647c3(_0x332737[_0x4fbb('0x12')](0x1f4,_0x1f068d['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index cf11555..73023b8 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(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_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('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(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index c362bf9..e039cdf 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 _0x44a3=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x44a3,0x1a9));var _0x344a=function(_0x2bb9b3,_0x1d2c25){_0x2bb9b3=_0x2bb9b3-0x0;var _0x601b6=_0x44a3[_0x2bb9b3];return _0x601b6;};'use strict';var Sequelize=require(_0x344a('0x0'));module[_0x344a('0x1')]={'description':{'type':Sequelize[_0x344a('0x2')]},'host':{'type':Sequelize[_0x344a('0x2')]},'user':{'type':Sequelize[_0x344a('0x2')]},'pass':{'type':Sequelize[_0x344a('0x2')]},'port':{'type':Sequelize[_0x344a('0x3')]},'secure':{'type':Sequelize[_0x344a('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x344a('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x344a('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x351d=['sequelize','STRING','INTEGER','BOOLEAN'];(function(_0x13fd0a,_0x156b12){var _0x263ded=function(_0x4f8dc8){while(--_0x4f8dc8){_0x13fd0a['push'](_0x13fd0a['shift']());}};_0x263ded(++_0x156b12);}(_0x351d,0x90));var _0xd351=function(_0x25399f,_0x51bdce){_0x25399f=_0x25399f-0x0;var _0x71c33=_0x351d[_0x25399f];return _0x71c33;};'use strict';var Sequelize=require(_0xd351('0x0'));module['exports']={'description':{'type':Sequelize[_0xd351('0x1')]},'host':{'type':Sequelize[_0xd351('0x1')]},'user':{'type':Sequelize[_0xd351('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xd351('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xd351('0x1')]},'authentication':{'type':Sequelize[_0xd351('0x3')],'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 afb8c81..54552e4 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 _0x8a06=['json','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','MailServerOut','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','undefined','count','offset','limit','Content-Range'];(function(_0x5353ea,_0x3230b7){var _0x5e1763=function(_0x37cdde){while(--_0x37cdde){_0x5353ea['push'](_0x5353ea['shift']());}};_0x5e1763(++_0x3230b7);}(_0x8a06,0xbf));var _0x68a0=function(_0x737a1f,_0x235fef){_0x737a1f=_0x737a1f-0x0;var _0x16eba1=_0x8a06[_0x737a1f];return _0x16eba1;};'use strict';var emlformat=require(_0x68a0('0x0'));var rimraf=require(_0x68a0('0x1'));var zipdir=require(_0x68a0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x68a0('0x3'));var moment=require(_0x68a0('0x4'));var BPromise=require(_0x68a0('0x5'));var Mustache=require('mustache');var util=require(_0x68a0('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x68a0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x68a0('0x8'));var _=require(_0x68a0('0x9'));var squel=require(_0x68a0('0xa'));var crypto=require(_0x68a0('0xb'));var jsforce=require(_0x68a0('0xc'));var deskjs=require(_0x68a0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x68a0('0xe'));var Papa=require(_0x68a0('0xf'));var Redis=require(_0x68a0('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x68a0('0x11'));var hardwareService=require(_0x68a0('0x12'));var logger=require(_0x68a0('0x13'))(_0x68a0('0x14'));var utils=require(_0x68a0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x68a0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x228def,_0x4f542e){_0x4f542e=_0x4f542e||0xcc;return function(_0x409d3b){if(_0x409d3b){return _0x228def[_0x68a0('0x17')](_0x4f542e);}return _0x228def['status'](_0x4f542e)[_0x68a0('0x18')]();};}function respondWithResult(_0x3bc472,_0x52b06d){_0x52b06d=_0x52b06d||0xc8;return function(_0x521f9f){if(_0x521f9f){return _0x3bc472[_0x68a0('0x19')](_0x52b06d)['json'](_0x521f9f);}};}function respondWithFilteredResult(_0x7422f9,_0x5f5a9b){return function(_0x2daddb){if(_0x2daddb){var _0xd5dbc=typeof _0x5f5a9b['offset']===_0x68a0('0x1a')&&typeof _0x5f5a9b['limit']===_0x68a0('0x1a');var _0x26d0db=_0x2daddb[_0x68a0('0x1b')];var _0x3e418c=_0xd5dbc?0x0:_0x5f5a9b[_0x68a0('0x1c')];var _0x552b7f=_0xd5dbc?_0x2daddb['count']:_0x5f5a9b['offset']+_0x5f5a9b[_0x68a0('0x1d')];var _0x489e9d;if(_0x552b7f>=_0x26d0db){_0x552b7f=_0x26d0db;_0x489e9d=0xc8;}else{_0x489e9d=0xce;}_0x7422f9[_0x68a0('0x19')](_0x489e9d);return _0x7422f9['set'](_0x68a0('0x1e'),_0x3e418c+'-'+_0x552b7f+'/'+_0x26d0db)[_0x68a0('0x1f')](_0x2daddb);}return null;};}function patchUpdates(_0x4ef3c0){return function(_0x5cd57e){try{jsonpatch['apply'](_0x5cd57e,_0x4ef3c0,!![]);}catch(_0x484745){return BPromise[_0x68a0('0x20')](_0x484745);}return _0x5cd57e['save']();};}function saveUpdates(_0xa6026a,_0x5caa9f){return function(_0x505259){if(_0x505259){return _0x505259[_0x68a0('0x21')](_0xa6026a)[_0x68a0('0x22')](function(_0x11ae68){return _0x11ae68;});}return null;};}function removeEntity(_0x1e6fd3,_0x1efa2a){return function(_0x32bb35){if(_0x32bb35){return _0x32bb35[_0x68a0('0x23')]()[_0x68a0('0x22')](function(){_0x1e6fd3[_0x68a0('0x19')](0xcc)[_0x68a0('0x18')]();});}};}function handleEntityNotFound(_0x12d6e1,_0xcfa813){return function(_0x322d51){if(!_0x322d51){_0x12d6e1[_0x68a0('0x17')](0x194);}return _0x322d51;};}function handleError(_0x3f8a0c,_0x49f16b){_0x49f16b=_0x49f16b||0x1f4;return function(_0x3e1025){logger[_0x68a0('0x24')](_0x3e1025[_0x68a0('0x25')]);if(_0x3e1025[_0x68a0('0x26')]){delete _0x3e1025[_0x68a0('0x26')];}_0x3f8a0c[_0x68a0('0x19')](_0x49f16b)[_0x68a0('0x27')](_0x3e1025);};}exports[_0x68a0('0x28')]=function(_0x1e3fe8,_0x5d1195){var _0xeb50cf={},_0x3561e8={},_0x38fbe5={'count':0x0,'rows':[]};var _0xd12a01=_[_0x68a0('0x29')](db['MailServerOut'][_0x68a0('0x2a')],function(_0x49dd2d){return{'name':_0x49dd2d['fieldName'],'type':_0x49dd2d[_0x68a0('0x2b')][_0x68a0('0x2c')]};});_0x3561e8['model']=_[_0x68a0('0x29')](_0xd12a01,'name');_0x3561e8['query']=_[_0x68a0('0x2d')](_0x1e3fe8[_0x68a0('0x2e')]);_0x3561e8['filters']=_[_0x68a0('0x2f')](_0x3561e8[_0x68a0('0x30')],_0x3561e8[_0x68a0('0x2e')]);_0xeb50cf[_0x68a0('0x31')]=_[_0x68a0('0x2f')](_0x3561e8[_0x68a0('0x30')],qs['fields'](_0x1e3fe8[_0x68a0('0x2e')][_0x68a0('0x32')]));_0xeb50cf['attributes']=_0xeb50cf['attributes'][_0x68a0('0x33')]?_0xeb50cf['attributes']:_0x3561e8[_0x68a0('0x30')];if(!_0x1e3fe8[_0x68a0('0x2e')][_0x68a0('0x34')](_0x68a0('0x35'))){_0xeb50cf['limit']=qs['limit'](_0x1e3fe8['query'][_0x68a0('0x1d')]);_0xeb50cf[_0x68a0('0x1c')]=qs[_0x68a0('0x1c')](_0x1e3fe8[_0x68a0('0x2e')][_0x68a0('0x1c')]);}_0xeb50cf[_0x68a0('0x36')]=qs[_0x68a0('0x37')](_0x1e3fe8[_0x68a0('0x2e')]['sort']);_0xeb50cf[_0x68a0('0x38')]=qs[_0x68a0('0x39')](_[_0x68a0('0x3a')](_0x1e3fe8['query'],_0x3561e8[_0x68a0('0x39')]),_0xd12a01);if(_0x1e3fe8['query'][_0x68a0('0x3b')]){_0xeb50cf[_0x68a0('0x38')]=_['merge'](_0xeb50cf[_0x68a0('0x38')],{'$or':_[_0x68a0('0x29')](_0xd12a01,function(_0x3d5d88){if(_0x3d5d88[_0x68a0('0x2b')]!==_0x68a0('0x3c')){var _0x40f627={};_0x40f627[_0x3d5d88[_0x68a0('0x26')]]={'$like':'%'+_0x1e3fe8[_0x68a0('0x2e')]['filter']+'%'};return _0x40f627;}})});}_0xeb50cf=_[_0x68a0('0x3d')]({},_0xeb50cf,_0x1e3fe8[_0x68a0('0x3e')]);var _0x3df543={'where':_0xeb50cf[_0x68a0('0x38')]};return db[_0x68a0('0x3f')][_0x68a0('0x1b')](_0x3df543)['then'](function(_0x1b9c82){_0x38fbe5['count']=_0x1b9c82;if(_0x1e3fe8[_0x68a0('0x2e')]['includeAll']){_0xeb50cf[_0x68a0('0x40')]=[{'all':!![]}];}return db[_0x68a0('0x3f')][_0x68a0('0x41')](_0xeb50cf);})[_0x68a0('0x22')](function(_0x28d97d){_0x38fbe5[_0x68a0('0x42')]=_0x28d97d;return _0x38fbe5;})[_0x68a0('0x22')](respondWithFilteredResult(_0x5d1195,_0xeb50cf))[_0x68a0('0x43')](handleError(_0x5d1195,null));};exports[_0x68a0('0x44')]=function(_0xe8af8d,_0x237d13){var _0x31f6ab={'raw':!![],'where':{'id':_0xe8af8d[_0x68a0('0x45')]['id']}},_0x1033a4={};_0x1033a4[_0x68a0('0x30')]=_['keys'](db['MailServerOut'][_0x68a0('0x2a')]);_0x1033a4[_0x68a0('0x2e')]=_[_0x68a0('0x2d')](_0xe8af8d[_0x68a0('0x2e')]);_0x1033a4[_0x68a0('0x39')]=_['intersection'](_0x1033a4[_0x68a0('0x30')],_0x1033a4[_0x68a0('0x2e')]);_0x31f6ab['attributes']=_[_0x68a0('0x2f')](_0x1033a4[_0x68a0('0x30')],qs[_0x68a0('0x32')](_0xe8af8d[_0x68a0('0x2e')][_0x68a0('0x32')]));_0x31f6ab[_0x68a0('0x31')]=_0x31f6ab[_0x68a0('0x31')][_0x68a0('0x33')]?_0x31f6ab[_0x68a0('0x31')]:_0x1033a4[_0x68a0('0x30')];if(_0xe8af8d[_0x68a0('0x2e')][_0x68a0('0x46')]){_0x31f6ab[_0x68a0('0x40')]=[{'all':!![]}];}_0x31f6ab=_[_0x68a0('0x3d')]({},_0x31f6ab,_0xe8af8d[_0x68a0('0x3e')]);return db['MailServerOut'][_0x68a0('0x47')](_0x31f6ab)['then'](handleEntityNotFound(_0x237d13,null))[_0x68a0('0x22')](respondWithResult(_0x237d13,null))[_0x68a0('0x43')](handleError(_0x237d13,null));};exports[_0x68a0('0x48')]=function(_0x4c9671,_0x25b5eb){return db['MailServerOut'][_0x68a0('0x48')](_0x4c9671[_0x68a0('0x49')],{})['then'](respondWithResult(_0x25b5eb,0xc9))[_0x68a0('0x43')](handleError(_0x25b5eb,null));};exports[_0x68a0('0x21')]=function(_0x4db81d,_0x29b781){if(_0x4db81d[_0x68a0('0x49')]['id']){delete _0x4db81d['body']['id'];}return db[_0x68a0('0x3f')][_0x68a0('0x47')]({'where':{'id':_0x4db81d[_0x68a0('0x45')]['id']}})['then'](handleEntityNotFound(_0x29b781,null))[_0x68a0('0x22')](saveUpdates(_0x4db81d[_0x68a0('0x49')],null))['then'](respondWithResult(_0x29b781,null))['catch'](handleError(_0x29b781,null));};exports[_0x68a0('0x23')]=function(_0x5093e6,_0x5d6129){return db[_0x68a0('0x3f')][_0x68a0('0x47')]({'where':{'id':_0x5093e6[_0x68a0('0x45')]['id']}})['then'](handleEntityNotFound(_0x5d6129,null))[_0x68a0('0x22')](removeEntity(_0x5d6129,null))[_0x68a0('0x43')](handleError(_0x5d6129,null));}; \ No newline at end of file +var _0xf7c4=['include','findAll','rows','show','intersection','find','catch','create','body','destroy','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','MailServerOut','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','options','includeAll'];(function(_0x3ff0f0,_0x5523bf){var _0x5dc82a=function(_0x14d26d){while(--_0x14d26d){_0x3ff0f0['push'](_0x3ff0f0['shift']());}};_0x5dc82a(++_0x5523bf);}(_0xf7c4,0x9a));var _0x4f7c=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xf7c4[_0x33032e];return _0x13316b;};'use strict';var emlformat=require(_0x4f7c('0x0'));var rimraf=require(_0x4f7c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4f7c('0x2'));var moment=require(_0x4f7c('0x3'));var BPromise=require(_0x4f7c('0x4'));var Mustache=require(_0x4f7c('0x5'));var util=require(_0x4f7c('0x6'));var path=require('path');var sox=require(_0x4f7c('0x7'));var csv=require('to-csv');var ejs=require(_0x4f7c('0x8'));var fs=require('fs');var fs_extra=require(_0x4f7c('0x9'));var _=require(_0x4f7c('0xa'));var squel=require(_0x4f7c('0xb'));var crypto=require(_0x4f7c('0xc'));var jsforce=require(_0x4f7c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4f7c('0xe'));var querystring=require(_0x4f7c('0xf'));var Papa=require('papaparse');var Redis=require(_0x4f7c('0x10'));var authService=require(_0x4f7c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4f7c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4f7c('0x13'))(_0x4f7c('0x14'));var utils=require(_0x4f7c('0x15'));var config=require(_0x4f7c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4f7c('0x17'))['db'];function respondWithStatusCode(_0x2f3769,_0xa323a4){_0xa323a4=_0xa323a4||0xcc;return function(_0x488a5e){if(_0x488a5e){return _0x2f3769[_0x4f7c('0x18')](_0xa323a4);}return _0x2f3769[_0x4f7c('0x19')](_0xa323a4)['end']();};}function respondWithResult(_0x2b3a73,_0x5dce2a){_0x5dce2a=_0x5dce2a||0xc8;return function(_0x2482c6){if(_0x2482c6){return _0x2b3a73[_0x4f7c('0x19')](_0x5dce2a)['json'](_0x2482c6);}};}function respondWithFilteredResult(_0x45a443,_0x2b48e7){return function(_0x3e5863){if(_0x3e5863){var _0xd5c4ef=typeof _0x2b48e7[_0x4f7c('0x1a')]===_0x4f7c('0x1b')&&typeof _0x2b48e7[_0x4f7c('0x1c')]===_0x4f7c('0x1b');var _0x2e47c4=_0x3e5863[_0x4f7c('0x1d')];var _0xb1b556=_0xd5c4ef?0x0:_0x2b48e7[_0x4f7c('0x1a')];var _0x26a8a3=_0xd5c4ef?_0x3e5863[_0x4f7c('0x1d')]:_0x2b48e7['offset']+_0x2b48e7['limit'];var _0x2c159e;if(_0x26a8a3>=_0x2e47c4){_0x26a8a3=_0x2e47c4;_0x2c159e=0xc8;}else{_0x2c159e=0xce;}_0x45a443[_0x4f7c('0x19')](_0x2c159e);return _0x45a443['set'](_0x4f7c('0x1e'),_0xb1b556+'-'+_0x26a8a3+'/'+_0x2e47c4)[_0x4f7c('0x1f')](_0x3e5863);}return null;};}function patchUpdates(_0x3b9369){return function(_0x3068bc){try{jsonpatch[_0x4f7c('0x20')](_0x3068bc,_0x3b9369,!![]);}catch(_0x48232e){return BPromise[_0x4f7c('0x21')](_0x48232e);}return _0x3068bc[_0x4f7c('0x22')]();};}function saveUpdates(_0x3e28a7,_0x4b33bf){return function(_0xf1e226){if(_0xf1e226){return _0xf1e226[_0x4f7c('0x23')](_0x3e28a7)[_0x4f7c('0x24')](function(_0x1e82d6){return _0x1e82d6;});}return null;};}function removeEntity(_0x27abbe,_0x3b5da4){return function(_0x577d33){if(_0x577d33){return _0x577d33['destroy']()[_0x4f7c('0x24')](function(){_0x27abbe[_0x4f7c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5671db,_0x549314){return function(_0x17e996){if(!_0x17e996){_0x5671db[_0x4f7c('0x18')](0x194);}return _0x17e996;};}function handleError(_0x47db61,_0x55f59d){_0x55f59d=_0x55f59d||0x1f4;return function(_0x4cf5cf){logger[_0x4f7c('0x25')](_0x4cf5cf[_0x4f7c('0x26')]);if(_0x4cf5cf[_0x4f7c('0x27')]){delete _0x4cf5cf[_0x4f7c('0x27')];}_0x47db61[_0x4f7c('0x19')](_0x55f59d)[_0x4f7c('0x28')](_0x4cf5cf);};}exports[_0x4f7c('0x29')]=function(_0x5b6bb2,_0x149287){var _0x57bea0={},_0x289374={},_0x409857={'count':0x0,'rows':[]};var _0x3503d0=_[_0x4f7c('0x2a')](db[_0x4f7c('0x2b')]['rawAttributes'],function(_0x383304){return{'name':_0x383304[_0x4f7c('0x2c')],'type':_0x383304['type']['key']};});_0x289374[_0x4f7c('0x2d')]=_[_0x4f7c('0x2a')](_0x3503d0,'name');_0x289374[_0x4f7c('0x2e')]=_[_0x4f7c('0x2f')](_0x5b6bb2['query']);_0x289374[_0x4f7c('0x30')]=_['intersection'](_0x289374[_0x4f7c('0x2d')],_0x289374[_0x4f7c('0x2e')]);_0x57bea0[_0x4f7c('0x31')]=_['intersection'](_0x289374['model'],qs['fields'](_0x5b6bb2[_0x4f7c('0x2e')][_0x4f7c('0x32')]));_0x57bea0[_0x4f7c('0x31')]=_0x57bea0[_0x4f7c('0x31')][_0x4f7c('0x33')]?_0x57bea0['attributes']:_0x289374[_0x4f7c('0x2d')];if(!_0x5b6bb2[_0x4f7c('0x2e')][_0x4f7c('0x34')](_0x4f7c('0x35'))){_0x57bea0[_0x4f7c('0x1c')]=qs[_0x4f7c('0x1c')](_0x5b6bb2['query'][_0x4f7c('0x1c')]);_0x57bea0['offset']=qs[_0x4f7c('0x1a')](_0x5b6bb2[_0x4f7c('0x2e')][_0x4f7c('0x1a')]);}_0x57bea0['order']=qs[_0x4f7c('0x36')](_0x5b6bb2[_0x4f7c('0x2e')][_0x4f7c('0x36')]);_0x57bea0[_0x4f7c('0x37')]=qs[_0x4f7c('0x30')](_[_0x4f7c('0x38')](_0x5b6bb2[_0x4f7c('0x2e')],_0x289374[_0x4f7c('0x30')]),_0x3503d0);if(_0x5b6bb2['query']['filter']){_0x57bea0['where']=_[_0x4f7c('0x39')](_0x57bea0['where'],{'$or':_['map'](_0x3503d0,function(_0x2dd8f1){if(_0x2dd8f1[_0x4f7c('0x3a')]!==_0x4f7c('0x3b')){var _0x3d031d={};_0x3d031d[_0x2dd8f1[_0x4f7c('0x27')]]={'$like':'%'+_0x5b6bb2[_0x4f7c('0x2e')]['filter']+'%'};return _0x3d031d;}})});}_0x57bea0=_[_0x4f7c('0x39')]({},_0x57bea0,_0x5b6bb2[_0x4f7c('0x3c')]);var _0x2e9a37={'where':_0x57bea0[_0x4f7c('0x37')]};return db['MailServerOut'][_0x4f7c('0x1d')](_0x2e9a37)['then'](function(_0x426a0f){_0x409857[_0x4f7c('0x1d')]=_0x426a0f;if(_0x5b6bb2[_0x4f7c('0x2e')][_0x4f7c('0x3d')]){_0x57bea0[_0x4f7c('0x3e')]=[{'all':!![]}];}return db[_0x4f7c('0x2b')][_0x4f7c('0x3f')](_0x57bea0);})[_0x4f7c('0x24')](function(_0xc61d07){_0x409857[_0x4f7c('0x40')]=_0xc61d07;return _0x409857;})[_0x4f7c('0x24')](respondWithFilteredResult(_0x149287,_0x57bea0))['catch'](handleError(_0x149287,null));};exports[_0x4f7c('0x41')]=function(_0x11712a,_0x2ccf78){var _0x4ba32e={'raw':!![],'where':{'id':_0x11712a['params']['id']}},_0x199610={};_0x199610[_0x4f7c('0x2d')]=_[_0x4f7c('0x2f')](db[_0x4f7c('0x2b')]['rawAttributes']);_0x199610['query']=_[_0x4f7c('0x2f')](_0x11712a['query']);_0x199610[_0x4f7c('0x30')]=_['intersection'](_0x199610[_0x4f7c('0x2d')],_0x199610[_0x4f7c('0x2e')]);_0x4ba32e[_0x4f7c('0x31')]=_[_0x4f7c('0x42')](_0x199610['model'],qs[_0x4f7c('0x32')](_0x11712a[_0x4f7c('0x2e')]['fields']));_0x4ba32e['attributes']=_0x4ba32e[_0x4f7c('0x31')]['length']?_0x4ba32e[_0x4f7c('0x31')]:_0x199610[_0x4f7c('0x2d')];if(_0x11712a[_0x4f7c('0x2e')][_0x4f7c('0x3d')]){_0x4ba32e[_0x4f7c('0x3e')]=[{'all':!![]}];}_0x4ba32e=_[_0x4f7c('0x39')]({},_0x4ba32e,_0x11712a[_0x4f7c('0x3c')]);return db[_0x4f7c('0x2b')][_0x4f7c('0x43')](_0x4ba32e)[_0x4f7c('0x24')](handleEntityNotFound(_0x2ccf78,null))[_0x4f7c('0x24')](respondWithResult(_0x2ccf78,null))[_0x4f7c('0x44')](handleError(_0x2ccf78,null));};exports[_0x4f7c('0x45')]=function(_0x3af557,_0x1ec4dd){return db['MailServerOut'][_0x4f7c('0x45')](_0x3af557[_0x4f7c('0x46')],{})[_0x4f7c('0x24')](respondWithResult(_0x1ec4dd,0xc9))[_0x4f7c('0x44')](handleError(_0x1ec4dd,null));};exports[_0x4f7c('0x23')]=function(_0x1b363a,_0x8a2408){if(_0x1b363a[_0x4f7c('0x46')]['id']){delete _0x1b363a[_0x4f7c('0x46')]['id'];}return db[_0x4f7c('0x2b')][_0x4f7c('0x43')]({'where':{'id':_0x1b363a['params']['id']}})[_0x4f7c('0x24')](handleEntityNotFound(_0x8a2408,null))[_0x4f7c('0x24')](saveUpdates(_0x1b363a[_0x4f7c('0x46')],null))[_0x4f7c('0x24')](respondWithResult(_0x8a2408,null))['catch'](handleError(_0x8a2408,null));};exports[_0x4f7c('0x47')]=function(_0x2f8beb,_0x54e997){return db[_0x4f7c('0x2b')]['find']({'where':{'id':_0x2f8beb['params']['id']}})[_0x4f7c('0x24')](handleEntityNotFound(_0x54e997,null))[_0x4f7c('0x24')](removeEntity(_0x54e997,null))['catch'](handleError(_0x54e997,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 7411f83..6dce186 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 _0xee0d=['path','rimraf','../../config/environment','exports','MailServerOut','lodash','../../config/logger','api','moment','request-promise'];(function(_0xe45118,_0x5dffbc){var _0x15e15d=function(_0x17eaec){while(--_0x17eaec){_0xe45118['push'](_0xe45118['shift']());}};_0x15e15d(++_0x5dffbc);}(_0xee0d,0x69));var _0xdee0=function(_0x434de0,_0x1b469e){_0x434de0=_0x434de0-0x0;var _0x1b2d80=_0xee0d[_0x434de0];return _0x1b2d80;};'use strict';var _=require(_0xdee0('0x0'));var util=require('util');var logger=require(_0xdee0('0x1'))(_0xdee0('0x2'));var moment=require(_0xdee0('0x3'));var BPromise=require('bluebird');var rp=require(_0xdee0('0x4'));var fs=require('fs');var path=require(_0xdee0('0x5'));var rimraf=require(_0xdee0('0x6'));var config=require(_0xdee0('0x7'));var attributes=require('./mailServerOut.attributes');module[_0xdee0('0x8')]=function(_0x5d0654,_0x1cac89){return _0x5d0654['define'](_0xdee0('0x9'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a09=['bluebird','rimraf','../../config/environment','./mailServerOut.attributes','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','moment'];(function(_0x2ddea8,_0x3d391a){var _0x3df821=function(_0x211b4c){while(--_0x211b4c){_0x2ddea8['push'](_0x2ddea8['shift']());}};_0x3df821(++_0x3d391a);}(_0x1a09,0xc2));var _0x91a0=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x1a09[_0x5416db];return _0x243e35;};'use strict';var _=require(_0x91a0('0x0'));var util=require(_0x91a0('0x1'));var logger=require(_0x91a0('0x2'))('api');var moment=require(_0x91a0('0x3'));var BPromise=require(_0x91a0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x91a0('0x5'));var config=require(_0x91a0('0x6'));var attributes=require(_0x91a0('0x7'));module['exports']=function(_0xf7a290,_0x1a5b62){return _0xf7a290[_0x91a0('0x8')](_0x91a0('0x9'),attributes,{'tableName':_0x91a0('0xa'),'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 f89e451..07f2b16 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x1aee30,_0x5946fb){var _0x1950c2=function(_0x4af002){while(--_0x4af002){_0x1aee30['push'](_0x1aee30['shift']());}};_0x1950c2(++_0x5946fb);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5a6382,_0x43369c){_0x5a6382=_0x5a6382-0x0;var _0x481b82=_0x5f2f[_0x5a6382];return _0x481b82;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x5a9017,_0x4312fc){var _0x596e52=function(_0x35843d){while(--_0x35843d){_0x5a9017['push'](_0x5a9017['shift']());}};_0x596e52(++_0x4312fc);}(_0x2ef3,0xba));var _0x32ef=function(_0x3c692d,_0x3ed028){_0x3c692d=_0x3c692d-0x0;var _0x1b7d09=_0x2ef3[_0x3c692d];return _0x1b7d09;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 4c5c9d5..ab2c815 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 _0x4ec4=['index','get','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated'];(function(_0x45b1ba,_0x5a6a21){var _0x145ddb=function(_0x650d42){while(--_0x650d42){_0x45b1ba['push'](_0x45b1ba['shift']());}};_0x145ddb(++_0x5a6a21);}(_0x4ec4,0x75));var _0x44ec=function(_0x3dcaa3,_0x2c7842){_0x3dcaa3=_0x3dcaa3-0x0;var _0x3cb512=_0x4ec4[_0x3dcaa3];return _0x3cb512;};'use strict';var multer=require('multer');var util=require(_0x44ec('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x44ec('0x1'));var router=express[_0x44ec('0x2')]();var fs_extra=require(_0x44ec('0x3'));var auth=require(_0x44ec('0x4'));var interaction=require(_0x44ec('0x5'));var config=require(_0x44ec('0x6'));var controller=require(_0x44ec('0x7'));router['get']('/',auth[_0x44ec('0x8')](),controller[_0x44ec('0x9')]);router[_0x44ec('0xa')](_0x44ec('0xb'),auth[_0x44ec('0x8')](),controller[_0x44ec('0xc')]);router[_0x44ec('0xa')](_0x44ec('0xd'),auth[_0x44ec('0x8')](),controller['show']);router[_0x44ec('0xe')]('/',auth['isAuthenticated'](),controller[_0x44ec('0xf')]);router[_0x44ec('0x10')](_0x44ec('0xd'),auth[_0x44ec('0x8')](),controller[_0x44ec('0x11')]);router[_0x44ec('0x12')]('/:id',auth[_0x44ec('0x8')](),controller[_0x44ec('0x13')]);module[_0x44ec('0x14')]=router; \ No newline at end of file +var _0x4f3b=['./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','delete','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2f95b5,_0x2f53e0){var _0x3770b9=function(_0x40d0fd){while(--_0x40d0fd){_0x2f95b5['push'](_0x2f95b5['shift']());}};_0x3770b9(++_0x2f53e0);}(_0x4f3b,0xf4));var _0xb4f3=function(_0xc87d08,_0x59c9be){_0xc87d08=_0xc87d08-0x0;var _0x30a714=_0x4f3b[_0xc87d08];return _0x30a714;};'use strict';var multer=require(_0xb4f3('0x0'));var util=require('util');var path=require(_0xb4f3('0x1'));var timeout=require('connect-timeout');var express=require(_0xb4f3('0x2'));var router=express[_0xb4f3('0x3')]();var fs_extra=require(_0xb4f3('0x4'));var auth=require(_0xb4f3('0x5'));var interaction=require(_0xb4f3('0x6'));var config=require(_0xb4f3('0x7'));var controller=require(_0xb4f3('0x8'));router[_0xb4f3('0x9')]('/',auth[_0xb4f3('0xa')](),controller[_0xb4f3('0xb')]);router[_0xb4f3('0x9')](_0xb4f3('0xc'),auth['isAuthenticated'](),controller[_0xb4f3('0xd')]);router[_0xb4f3('0x9')](_0xb4f3('0xe'),auth[_0xb4f3('0xa')](),controller['show']);router['post']('/',auth[_0xb4f3('0xa')](),controller[_0xb4f3('0xf')]);router[_0xb4f3('0x10')](_0xb4f3('0xe'),auth[_0xb4f3('0xa')](),controller['update']);router[_0xb4f3('0x11')]('/:id',auth[_0xb4f3('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index a75863b..e9406c0 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 _0x6eed=['exports','STRING','name','sequelize'];(function(_0x48b5a2,_0x5014c7){var _0xc7f542=function(_0xa288f5){while(--_0xa288f5){_0x48b5a2['push'](_0x48b5a2['shift']());}};_0xc7f542(++_0x5014c7);}(_0x6eed,0xff));var _0xd6ee=function(_0x328db0,_0x19d1fa){_0x328db0=_0x328db0-0x0;var _0x4f6d29=_0x6eed[_0x328db0];return _0x4f6d29;};'use strict';var Sequelize=require(_0xd6ee('0x0'));module[_0xd6ee('0x1')]={'name':{'type':Sequelize[_0xd6ee('0x2')],'unique':_0xd6ee('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd6ee('0x2')]}}; \ No newline at end of file +var _0x44e8=['name','STRING','sequelize'];(function(_0x2950c8,_0x5af4a0){var _0x5d00d3=function(_0xb02324){while(--_0xb02324){_0x2950c8['push'](_0x2950c8['shift']());}};_0x5d00d3(++_0x5af4a0);}(_0x44e8,0xd7));var _0x844e=function(_0x370bca,_0x2ba976){_0x370bca=_0x370bca-0x0;var _0x4daa59=_0x44e8[_0x370bca];return _0x4daa59;};'use strict';var Sequelize=require(_0x844e('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x844e('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x844e('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 94e0234..3454149 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 _0x66c1=['limit','count','offset','set','apply','reject','save','update','then','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','include','findAll','params','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined'];(function(_0x32c287,_0x27c948){var _0x54497d=function(_0x8e162a){while(--_0x8e162a){_0x32c287['push'](_0x32c287['shift']());}};_0x54497d(++_0x27c948);}(_0x66c1,0x1ae));var _0x166c=function(_0x4651b1,_0x5061cf){_0x4651b1=_0x4651b1-0x0;var _0x48bec8=_0x66c1[_0x4651b1];return _0x48bec8;};'use strict';var emlformat=require(_0x166c('0x0'));var rimraf=require(_0x166c('0x1'));var zipdir=require(_0x166c('0x2'));var jsonpatch=require(_0x166c('0x3'));var rp=require(_0x166c('0x4'));var moment=require(_0x166c('0x5'));var BPromise=require(_0x166c('0x6'));var Mustache=require('mustache');var util=require(_0x166c('0x7'));var path=require(_0x166c('0x8'));var sox=require(_0x166c('0x9'));var csv=require('to-csv');var ejs=require(_0x166c('0xa'));var fs=require('fs');var fs_extra=require(_0x166c('0xb'));var _=require(_0x166c('0xc'));var squel=require(_0x166c('0xd'));var crypto=require(_0x166c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x166c('0xf'));var toCsv=require('to-csv');var querystring=require(_0x166c('0x10'));var Papa=require('papaparse');var Redis=require(_0x166c('0x11'));var authService=require(_0x166c('0x12'));var qs=require(_0x166c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x166c('0x14'));var logger=require(_0x166c('0x15'))(_0x166c('0x16'));var utils=require(_0x166c('0x17'));var config=require(_0x166c('0x18'));var licenseUtil=require(_0x166c('0x19'));var db=require(_0x166c('0x1a'))['db'];function respondWithStatusCode(_0x1c1e5f,_0x1759f3){_0x1759f3=_0x1759f3||0xcc;return function(_0x1e1e25){if(_0x1e1e25){return _0x1c1e5f[_0x166c('0x1b')](_0x1759f3);}return _0x1c1e5f[_0x166c('0x1c')](_0x1759f3)[_0x166c('0x1d')]();};}function respondWithResult(_0x172519,_0x5f571a){_0x5f571a=_0x5f571a||0xc8;return function(_0x26d96d){if(_0x26d96d){return _0x172519[_0x166c('0x1c')](_0x5f571a)[_0x166c('0x1e')](_0x26d96d);}};}function respondWithFilteredResult(_0x31adf5,_0x3d14e9){return function(_0x3c6df1){if(_0x3c6df1){var _0x442562=typeof _0x3d14e9['offset']===_0x166c('0x1f')&&typeof _0x3d14e9[_0x166c('0x20')]==='undefined';var _0x1f97c6=_0x3c6df1[_0x166c('0x21')];var _0x3bb67d=_0x442562?0x0:_0x3d14e9[_0x166c('0x22')];var _0x4003f7=_0x442562?_0x3c6df1['count']:_0x3d14e9[_0x166c('0x22')]+_0x3d14e9[_0x166c('0x20')];var _0x144ac7;if(_0x4003f7>=_0x1f97c6){_0x4003f7=_0x1f97c6;_0x144ac7=0xc8;}else{_0x144ac7=0xce;}_0x31adf5[_0x166c('0x1c')](_0x144ac7);return _0x31adf5[_0x166c('0x23')]('Content-Range',_0x3bb67d+'-'+_0x4003f7+'/'+_0x1f97c6)[_0x166c('0x1e')](_0x3c6df1);}return null;};}function patchUpdates(_0x4b7769){return function(_0x4587c1){try{jsonpatch[_0x166c('0x24')](_0x4587c1,_0x4b7769,!![]);}catch(_0x13fbd0){return BPromise[_0x166c('0x25')](_0x13fbd0);}return _0x4587c1[_0x166c('0x26')]();};}function saveUpdates(_0x5be44c,_0x3a1f36){return function(_0x314a37){if(_0x314a37){return _0x314a37[_0x166c('0x27')](_0x5be44c)[_0x166c('0x28')](function(_0x17b560){return _0x17b560;});}return null;};}function removeEntity(_0x25ee5a,_0x4ceec0){return function(_0x3dcdf1){if(_0x3dcdf1){return _0x3dcdf1['destroy']()['then'](function(){_0x25ee5a['status'](0xcc)[_0x166c('0x1d')]();});}};}function handleEntityNotFound(_0x2fda4a,_0x7dc83f){return function(_0x5c724a){if(!_0x5c724a){_0x2fda4a[_0x166c('0x1b')](0x194);}return _0x5c724a;};}function handleError(_0x58727d,_0x50cd05){_0x50cd05=_0x50cd05||0x1f4;return function(_0x4eaadf){logger[_0x166c('0x29')](_0x4eaadf[_0x166c('0x2a')]);if(_0x4eaadf['name']){delete _0x4eaadf[_0x166c('0x2b')];}_0x58727d[_0x166c('0x1c')](_0x50cd05)[_0x166c('0x2c')](_0x4eaadf);};}exports[_0x166c('0x2d')]=function(_0xe36230,_0x417fa4){var _0x50451a={},_0x399092={},_0x2fe7eb={'count':0x0,'rows':[]};var _0x49745d=_[_0x166c('0x2e')](db[_0x166c('0x2f')][_0x166c('0x30')],function(_0x52ba8b){return{'name':_0x52ba8b[_0x166c('0x31')],'type':_0x52ba8b['type'][_0x166c('0x32')]};});_0x399092[_0x166c('0x33')]=_[_0x166c('0x2e')](_0x49745d,_0x166c('0x2b'));_0x399092[_0x166c('0x34')]=_[_0x166c('0x35')](_0xe36230[_0x166c('0x34')]);_0x399092[_0x166c('0x36')]=_[_0x166c('0x37')](_0x399092[_0x166c('0x33')],_0x399092[_0x166c('0x34')]);_0x50451a[_0x166c('0x38')]=_[_0x166c('0x37')](_0x399092[_0x166c('0x33')],qs[_0x166c('0x39')](_0xe36230[_0x166c('0x34')][_0x166c('0x39')]));_0x50451a[_0x166c('0x38')]=_0x50451a[_0x166c('0x38')][_0x166c('0x3a')]?_0x50451a[_0x166c('0x38')]:_0x399092[_0x166c('0x33')];if(!_0xe36230[_0x166c('0x34')]['hasOwnProperty'](_0x166c('0x3b'))){_0x50451a[_0x166c('0x20')]=qs[_0x166c('0x20')](_0xe36230[_0x166c('0x34')]['limit']);_0x50451a[_0x166c('0x22')]=qs[_0x166c('0x22')](_0xe36230['query'][_0x166c('0x22')]);}_0x50451a[_0x166c('0x3c')]=qs[_0x166c('0x3d')](_0xe36230[_0x166c('0x34')][_0x166c('0x3d')]);_0x50451a['where']=qs[_0x166c('0x36')](_[_0x166c('0x3e')](_0xe36230[_0x166c('0x34')],_0x399092['filters']),_0x49745d);if(_0xe36230[_0x166c('0x34')][_0x166c('0x3f')]){_0x50451a['where']=_[_0x166c('0x40')](_0x50451a[_0x166c('0x41')],{'$or':_[_0x166c('0x2e')](_0x49745d,function(_0x1739f8){if(_0x1739f8[_0x166c('0x42')]!==_0x166c('0x43')){var _0x4fc714={};_0x4fc714[_0x1739f8[_0x166c('0x2b')]]={'$like':'%'+_0xe36230[_0x166c('0x34')][_0x166c('0x3f')]+'%'};return _0x4fc714;}})});}_0x50451a=_[_0x166c('0x40')]({},_0x50451a,_0xe36230[_0x166c('0x44')]);var _0x5b5273={'where':_0x50451a[_0x166c('0x41')]};return db[_0x166c('0x2f')]['count'](_0x5b5273)[_0x166c('0x28')](function(_0xa86bc8){_0x2fe7eb[_0x166c('0x21')]=_0xa86bc8;if(_0xe36230[_0x166c('0x34')]['includeAll']){_0x50451a[_0x166c('0x45')]=[{'all':!![]}];}return db[_0x166c('0x2f')][_0x166c('0x46')](_0x50451a);})['then'](function(_0x173649){_0x2fe7eb['rows']=_0x173649;return _0x2fe7eb;})[_0x166c('0x28')](respondWithFilteredResult(_0x417fa4,_0x50451a))['catch'](handleError(_0x417fa4,null));};exports['show']=function(_0x42ebec,_0x177088){var _0x3a2bef={'raw':!![],'where':{'id':_0x42ebec[_0x166c('0x47')]['id']}},_0x3880c0={};_0x3880c0['model']=_['keys'](db[_0x166c('0x2f')]['rawAttributes']);_0x3880c0[_0x166c('0x34')]=_[_0x166c('0x35')](_0x42ebec['query']);_0x3880c0[_0x166c('0x36')]=_[_0x166c('0x37')](_0x3880c0['model'],_0x3880c0[_0x166c('0x34')]);_0x3a2bef[_0x166c('0x38')]=_['intersection'](_0x3880c0[_0x166c('0x33')],qs[_0x166c('0x39')](_0x42ebec[_0x166c('0x34')]['fields']));_0x3a2bef[_0x166c('0x38')]=_0x3a2bef['attributes'][_0x166c('0x3a')]?_0x3a2bef[_0x166c('0x38')]:_0x3880c0[_0x166c('0x33')];if(_0x42ebec[_0x166c('0x34')]['includeAll']){_0x3a2bef[_0x166c('0x45')]=[{'all':!![]}];}_0x3a2bef=_['merge']({},_0x3a2bef,_0x42ebec['options']);return db['MailSubstatus'][_0x166c('0x48')](_0x3a2bef)[_0x166c('0x28')](handleEntityNotFound(_0x177088,null))[_0x166c('0x28')](respondWithResult(_0x177088,null))[_0x166c('0x49')](handleError(_0x177088,null));};exports[_0x166c('0x4a')]=function(_0x170864,_0x27b3f7){return db[_0x166c('0x2f')][_0x166c('0x4a')](_0x170864['body'],{})[_0x166c('0x28')](respondWithResult(_0x27b3f7,0xc9))[_0x166c('0x49')](handleError(_0x27b3f7,null));};exports[_0x166c('0x27')]=function(_0x195182,_0x4c0710){if(_0x195182[_0x166c('0x4b')]['id']){delete _0x195182[_0x166c('0x4b')]['id'];}return db[_0x166c('0x2f')]['find']({'where':{'id':_0x195182[_0x166c('0x47')]['id']}})['then'](handleEntityNotFound(_0x4c0710,null))[_0x166c('0x28')](saveUpdates(_0x195182[_0x166c('0x4b')],null))[_0x166c('0x28')](respondWithResult(_0x4c0710,null))[_0x166c('0x49')](handleError(_0x4c0710,null));};exports[_0x166c('0x4c')]=function(_0x52487e,_0xf61fd2){return db[_0x166c('0x2f')][_0x166c('0x48')]({'where':{'id':_0x52487e['params']['id']}})[_0x166c('0x28')](handleEntityNotFound(_0xf61fd2,null))[_0x166c('0x28')](removeEntity(_0xf61fd2,null))[_0x166c('0x49')](handleError(_0xf61fd2,null));};exports['describe']=function(_0x135fee,_0x2573c8){return db[_0x166c('0x2f')]['describe']()[_0x166c('0x28')](respondWithResult(_0x2573c8,null))[_0x166c('0x49')](handleError(_0x2573c8,null));}; \ No newline at end of file +var _0x9fdd=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','filters','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','findAll','rows','catch','show','keys','intersection','length','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x26e7d2,_0x59072){var _0x87b264=function(_0x257da1){while(--_0x257da1){_0x26e7d2['push'](_0x26e7d2['shift']());}};_0x87b264(++_0x59072);}(_0x9fdd,0x15c));var _0xd9fd=function(_0x3f40e6,_0x4c7df8){_0x3f40e6=_0x3f40e6-0x0;var _0x58df4f=_0x9fdd[_0x3f40e6];return _0x58df4f;};'use strict';var emlformat=require(_0xd9fd('0x0'));var rimraf=require(_0xd9fd('0x1'));var zipdir=require(_0xd9fd('0x2'));var jsonpatch=require(_0xd9fd('0x3'));var rp=require(_0xd9fd('0x4'));var moment=require(_0xd9fd('0x5'));var BPromise=require(_0xd9fd('0x6'));var Mustache=require(_0xd9fd('0x7'));var util=require(_0xd9fd('0x8'));var path=require('path');var sox=require(_0xd9fd('0x9'));var csv=require(_0xd9fd('0xa'));var ejs=require(_0xd9fd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd9fd('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd9fd('0xd'));var toCsv=require(_0xd9fd('0xa'));var querystring=require('querystring');var Papa=require(_0xd9fd('0xe'));var Redis=require('ioredis');var authService=require(_0xd9fd('0xf'));var qs=require(_0xd9fd('0x10'));var as=require(_0xd9fd('0x11'));var hardwareService=require(_0xd9fd('0x12'));var logger=require(_0xd9fd('0x13'))('api');var utils=require(_0xd9fd('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd9fd('0x15'));var db=require(_0xd9fd('0x16'))['db'];function respondWithStatusCode(_0x2dda0a,_0x2b9086){_0x2b9086=_0x2b9086||0xcc;return function(_0xd377d2){if(_0xd377d2){return _0x2dda0a[_0xd9fd('0x17')](_0x2b9086);}return _0x2dda0a[_0xd9fd('0x18')](_0x2b9086)[_0xd9fd('0x19')]();};}function respondWithResult(_0x173d5a,_0x2f7b85){_0x2f7b85=_0x2f7b85||0xc8;return function(_0x42cd15){if(_0x42cd15){return _0x173d5a[_0xd9fd('0x18')](_0x2f7b85)['json'](_0x42cd15);}};}function respondWithFilteredResult(_0x564015,_0x3ce034){return function(_0x180d3c){if(_0x180d3c){var _0x4be8d1=typeof _0x3ce034[_0xd9fd('0x1a')]==='undefined'&&typeof _0x3ce034[_0xd9fd('0x1b')]===_0xd9fd('0x1c');var _0x40d1fe=_0x180d3c['count'];var _0x541ff4=_0x4be8d1?0x0:_0x3ce034[_0xd9fd('0x1a')];var _0x2f4366=_0x4be8d1?_0x180d3c[_0xd9fd('0x1d')]:_0x3ce034[_0xd9fd('0x1a')]+_0x3ce034[_0xd9fd('0x1b')];var _0x454044;if(_0x2f4366>=_0x40d1fe){_0x2f4366=_0x40d1fe;_0x454044=0xc8;}else{_0x454044=0xce;}_0x564015[_0xd9fd('0x18')](_0x454044);return _0x564015[_0xd9fd('0x1e')](_0xd9fd('0x1f'),_0x541ff4+'-'+_0x2f4366+'/'+_0x40d1fe)['json'](_0x180d3c);}return null;};}function patchUpdates(_0x4553d3){return function(_0x3d9ddc){try{jsonpatch[_0xd9fd('0x20')](_0x3d9ddc,_0x4553d3,!![]);}catch(_0x55551f){return BPromise['reject'](_0x55551f);}return _0x3d9ddc[_0xd9fd('0x21')]();};}function saveUpdates(_0x50c9e5,_0x2ea9ef){return function(_0x2ce741){if(_0x2ce741){return _0x2ce741[_0xd9fd('0x22')](_0x50c9e5)[_0xd9fd('0x23')](function(_0xd902f1){return _0xd902f1;});}return null;};}function removeEntity(_0x1ead67,_0x4a6e3b){return function(_0x52744e){if(_0x52744e){return _0x52744e[_0xd9fd('0x24')]()[_0xd9fd('0x23')](function(){_0x1ead67[_0xd9fd('0x18')](0xcc)[_0xd9fd('0x19')]();});}};}function handleEntityNotFound(_0x3b4f06,_0x1c7506){return function(_0x18e012){if(!_0x18e012){_0x3b4f06[_0xd9fd('0x17')](0x194);}return _0x18e012;};}function handleError(_0x24a8b9,_0x173c90){_0x173c90=_0x173c90||0x1f4;return function(_0x47c851){logger[_0xd9fd('0x25')](_0x47c851[_0xd9fd('0x26')]);if(_0x47c851[_0xd9fd('0x27')]){delete _0x47c851[_0xd9fd('0x27')];}_0x24a8b9[_0xd9fd('0x18')](_0x173c90)[_0xd9fd('0x28')](_0x47c851);};}exports[_0xd9fd('0x29')]=function(_0x222ed0,_0x394013){var _0x5dc23c={},_0x55d7f3={},_0x43f400={'count':0x0,'rows':[]};var _0x2dea57=_[_0xd9fd('0x2a')](db[_0xd9fd('0x2b')][_0xd9fd('0x2c')],function(_0x4614ed){return{'name':_0x4614ed[_0xd9fd('0x2d')],'type':_0x4614ed[_0xd9fd('0x2e')][_0xd9fd('0x2f')]};});_0x55d7f3[_0xd9fd('0x30')]=_[_0xd9fd('0x2a')](_0x2dea57,_0xd9fd('0x27'));_0x55d7f3['query']=_['keys'](_0x222ed0[_0xd9fd('0x31')]);_0x55d7f3[_0xd9fd('0x32')]=_['intersection'](_0x55d7f3['model'],_0x55d7f3[_0xd9fd('0x31')]);_0x5dc23c['attributes']=_['intersection'](_0x55d7f3['model'],qs[_0xd9fd('0x33')](_0x222ed0[_0xd9fd('0x31')]['fields']));_0x5dc23c[_0xd9fd('0x34')]=_0x5dc23c['attributes']['length']?_0x5dc23c[_0xd9fd('0x34')]:_0x55d7f3[_0xd9fd('0x30')];if(!_0x222ed0[_0xd9fd('0x31')][_0xd9fd('0x35')](_0xd9fd('0x36'))){_0x5dc23c['limit']=qs[_0xd9fd('0x1b')](_0x222ed0['query'][_0xd9fd('0x1b')]);_0x5dc23c[_0xd9fd('0x1a')]=qs[_0xd9fd('0x1a')](_0x222ed0[_0xd9fd('0x31')][_0xd9fd('0x1a')]);}_0x5dc23c['order']=qs[_0xd9fd('0x37')](_0x222ed0[_0xd9fd('0x31')][_0xd9fd('0x37')]);_0x5dc23c[_0xd9fd('0x38')]=qs['filters'](_['pick'](_0x222ed0['query'],_0x55d7f3[_0xd9fd('0x32')]),_0x2dea57);if(_0x222ed0[_0xd9fd('0x31')][_0xd9fd('0x39')]){_0x5dc23c[_0xd9fd('0x38')]=_[_0xd9fd('0x3a')](_0x5dc23c[_0xd9fd('0x38')],{'$or':_[_0xd9fd('0x2a')](_0x2dea57,function(_0x59aebd){if(_0x59aebd['type']!=='VIRTUAL'){var _0x5549b5={};_0x5549b5[_0x59aebd[_0xd9fd('0x27')]]={'$like':'%'+_0x222ed0['query'][_0xd9fd('0x39')]+'%'};return _0x5549b5;}})});}_0x5dc23c=_[_0xd9fd('0x3a')]({},_0x5dc23c,_0x222ed0[_0xd9fd('0x3b')]);var _0x2e5c09={'where':_0x5dc23c[_0xd9fd('0x38')]};return db[_0xd9fd('0x2b')]['count'](_0x2e5c09)[_0xd9fd('0x23')](function(_0x59802f){_0x43f400[_0xd9fd('0x1d')]=_0x59802f;if(_0x222ed0[_0xd9fd('0x31')][_0xd9fd('0x3c')]){_0x5dc23c['include']=[{'all':!![]}];}return db['MailSubstatus'][_0xd9fd('0x3d')](_0x5dc23c);})[_0xd9fd('0x23')](function(_0x386025){_0x43f400[_0xd9fd('0x3e')]=_0x386025;return _0x43f400;})[_0xd9fd('0x23')](respondWithFilteredResult(_0x394013,_0x5dc23c))[_0xd9fd('0x3f')](handleError(_0x394013,null));};exports[_0xd9fd('0x40')]=function(_0x275afe,_0x59922b){var _0x452e90={'raw':!![],'where':{'id':_0x275afe['params']['id']}},_0x397725={};_0x397725['model']=_[_0xd9fd('0x41')](db['MailSubstatus'][_0xd9fd('0x2c')]);_0x397725[_0xd9fd('0x31')]=_[_0xd9fd('0x41')](_0x275afe[_0xd9fd('0x31')]);_0x397725[_0xd9fd('0x32')]=_[_0xd9fd('0x42')](_0x397725[_0xd9fd('0x30')],_0x397725[_0xd9fd('0x31')]);_0x452e90[_0xd9fd('0x34')]=_[_0xd9fd('0x42')](_0x397725['model'],qs['fields'](_0x275afe['query'][_0xd9fd('0x33')]));_0x452e90[_0xd9fd('0x34')]=_0x452e90[_0xd9fd('0x34')][_0xd9fd('0x43')]?_0x452e90['attributes']:_0x397725[_0xd9fd('0x30')];if(_0x275afe[_0xd9fd('0x31')][_0xd9fd('0x3c')]){_0x452e90['include']=[{'all':!![]}];}_0x452e90=_[_0xd9fd('0x3a')]({},_0x452e90,_0x275afe[_0xd9fd('0x3b')]);return db[_0xd9fd('0x2b')][_0xd9fd('0x44')](_0x452e90)[_0xd9fd('0x23')](handleEntityNotFound(_0x59922b,null))['then'](respondWithResult(_0x59922b,null))['catch'](handleError(_0x59922b,null));};exports['create']=function(_0x976baf,_0x72bece){return db['MailSubstatus'][_0xd9fd('0x45')](_0x976baf[_0xd9fd('0x46')],{})[_0xd9fd('0x23')](respondWithResult(_0x72bece,0xc9))[_0xd9fd('0x3f')](handleError(_0x72bece,null));};exports[_0xd9fd('0x22')]=function(_0x2cf762,_0x342a4a){if(_0x2cf762[_0xd9fd('0x46')]['id']){delete _0x2cf762[_0xd9fd('0x46')]['id'];}return db[_0xd9fd('0x2b')][_0xd9fd('0x44')]({'where':{'id':_0x2cf762[_0xd9fd('0x47')]['id']}})[_0xd9fd('0x23')](handleEntityNotFound(_0x342a4a,null))[_0xd9fd('0x23')](saveUpdates(_0x2cf762[_0xd9fd('0x46')],null))[_0xd9fd('0x23')](respondWithResult(_0x342a4a,null))[_0xd9fd('0x3f')](handleError(_0x342a4a,null));};exports[_0xd9fd('0x24')]=function(_0x2ceec9,_0x1b7a58){return db['MailSubstatus'][_0xd9fd('0x44')]({'where':{'id':_0x2ceec9[_0xd9fd('0x47')]['id']}})[_0xd9fd('0x23')](handleEntityNotFound(_0x1b7a58,null))[_0xd9fd('0x23')](removeEntity(_0x1b7a58,null))[_0xd9fd('0x3f')](handleError(_0x1b7a58,null));};exports[_0xd9fd('0x48')]=function(_0x2cbc8e,_0x3474d4){return db[_0xd9fd('0x2b')][_0xd9fd('0x48')]()[_0xd9fd('0x23')](respondWithResult(_0x3474d4,null))[_0xd9fd('0x3f')](handleError(_0x3474d4,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 0eb7766..7e42f99 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 _0x6215=['events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','exports'];(function(_0x4a70e6,_0x299484){var _0x1e4829=function(_0x3577ee){while(--_0x3577ee){_0x4a70e6['push'](_0x4a70e6['shift']());}};_0x1e4829(++_0x299484);}(_0x6215,0x1f0));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x5621('0x0'));var MailSubstatus=require(_0x5621('0x1'))['db'][_0x5621('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x5621('0x3')](0x0);var events={'afterUpdate':_0x5621('0x4')};function emitEvent(_0x463ce2){return function(_0x4b122c,_0x43ca2a,_0x47a2c2){MailSubstatusEvents[_0x5621('0x5')](_0x463ce2+':'+_0x4b122c['id'],_0x4b122c);MailSubstatusEvents[_0x5621('0x5')](_0x463ce2,_0x4b122c);_0x47a2c2(null);};}for(var e in events){if(events[_0x5621('0x6')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x5621('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0x050c=['exports','events','../../mysqldb','MailSubstatus','update','emit'];(function(_0x44387c,_0xe02260){var _0x51f1a7=function(_0x5439ad){while(--_0x5439ad){_0x44387c['push'](_0x44387c['shift']());}};_0x51f1a7(++_0xe02260);}(_0x050c,0xdf));var _0xc050=function(_0x5d8f4b,_0x31e9a4){_0x5d8f4b=_0x5d8f4b-0x0;var _0x2efb10=_0x050c[_0x5d8f4b];return _0x2efb10;};'use strict';var EventEmitter=require(_0xc050('0x0'));var MailSubstatus=require(_0xc050('0x1'))['db'][_0xc050('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0xc050('0x3')};function emitEvent(_0x37d2ed){return function(_0x1a06db,_0x21b581,_0x58ae2c){MailSubstatusEvents[_0xc050('0x4')](_0x37d2ed+':'+_0x1a06db['id'],_0x1a06db);MailSubstatusEvents['emit'](_0x37d2ed,_0x1a06db);_0x58ae2c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0xc050('0x5')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 40215b0..1e8c31e 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 _0x16ed=['catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','Condition','update','mailSubstatus','_previousDataValues','name'];(function(_0x112533,_0x155f4d){var _0x10b43a=function(_0x348e2a){while(--_0x348e2a){_0x112533['push'](_0x112533['shift']());}};_0x10b43a(++_0x155f4d);}(_0x16ed,0x6f));var _0xd16e=function(_0x4fb570,_0x4236b4){_0x4fb570=_0x4fb570-0x0;var _0x5d9448=_0x16ed[_0x4fb570];return _0x5d9448;};'use strict';var attributes=require(_0xd16e('0x0'));module[_0xd16e('0x1')]=function(_0x41110c){var _0x512f7d=_0x41110c[_0xd16e('0x2')];return _0x41110c[_0xd16e('0x3')](_0xd16e('0x4'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x57dab2,_0x53bf95,_0x4c76fb){return _0x512f7d[_0xd16e('0x5')][_0xd16e('0x6')]({'value':_0x57dab2['name']},{'where':{'field':_0xd16e('0x7'),'value':_0x57dab2[_0xd16e('0x8')][_0xd16e('0x9')]}})['then'](function(){_0x4c76fb();})[_0xd16e('0xa')](function(_0x2e8cfd){_0x4c76fb(_0x2e8cfd);});}}});}; \ No newline at end of file +var _0x1258=['define','MailSubstatus','mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','models'];(function(_0x1cd674,_0x8d3638){var _0x27928f=function(_0x5e3c70){while(--_0x5e3c70){_0x1cd674['push'](_0x1cd674['shift']());}};_0x27928f(++_0x8d3638);}(_0x1258,0x196));var _0x8125=function(_0x1d785f,_0x7fcd6a){_0x1d785f=_0x1d785f-0x0;var _0x749ecf=_0x1258[_0x1d785f];return _0x749ecf;};'use strict';var attributes=require(_0x8125('0x0'));module['exports']=function(_0x3eb91d){var _0x3b4fa6=_0x3eb91d[_0x8125('0x1')];return _0x3eb91d[_0x8125('0x2')](_0x8125('0x3'),attributes,{'tableName':_0x8125('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x307c3b,_0xdaf434,_0x5577e5){return _0x3b4fa6[_0x8125('0x5')][_0x8125('0x6')]({'value':_0x307c3b[_0x8125('0x7')]},{'where':{'field':_0x8125('0x8'),'value':_0x307c3b[_0x8125('0x9')][_0x8125('0x7')]}})[_0x8125('0xa')](function(){_0x5577e5();})[_0x8125('0xb')](function(_0x1ff563){_0x5577e5(_0x1ff563);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 971e295..beb6d6e 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 _0x572f=['jayson/promise','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x3701cb,_0x55557c){var _0x4cf58b=function(_0x27d6ef){while(--_0x27d6ef){_0x3701cb['push'](_0x3701cb['shift']());}};_0x4cf58b(++_0x55557c);}(_0x572f,0x1d9));var _0xf572=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x572f[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0xf572('0x0'));var moment=require(_0xf572('0x1'));var BPromise=require(_0xf572('0x2'));var rs=require(_0xf572('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf572('0x4'))['db'];var utils=require(_0xf572('0x5'));var logger=require('../../config/logger')(_0xf572('0x6'));var config=require('../../config/environment');var jayson=require(_0xf572('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x50a9ce,_0x3429c8,_0x42a538){return new BPromise(function(_0x27ad61,_0x7bccc8){return client['request'](_0x50a9ce,_0x42a538)['then'](function(_0x119d42){logger['info'](_0xf572('0x8'),_0x3429c8,_0xf572('0x9'));logger['debug'](_0xf572('0xa'),_0x3429c8,_0xf572('0x9'),JSON[_0xf572('0xb')](_0x119d42));if(_0x119d42[_0xf572('0xc')]){if(_0x119d42['error'][_0xf572('0xd')]===0x1f4){logger['error'](_0xf572('0x8'),_0x3429c8,_0x119d42[_0xf572('0xc')][_0xf572('0xe')]);return _0x7bccc8(_0x119d42['error']['message']);}logger['error'](_0xf572('0x8'),_0x3429c8,_0x119d42[_0xf572('0xc')][_0xf572('0xe')]);return _0x27ad61(_0x119d42[_0xf572('0xc')][_0xf572('0xe')]);}else{logger[_0xf572('0xf')](_0xf572('0x8'),_0x3429c8,_0xf572('0x9'));_0x27ad61(_0x119d42['result'][_0xf572('0xe')]);}})['catch'](function(_0x5b769c){logger[_0xf572('0xc')](_0xf572('0x8'),_0x3429c8,_0x5b769c);_0x7bccc8(_0x5b769c);});});} \ No newline at end of file +var _0xe9a2=['request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s'];(function(_0x20dda3,_0xfcb775){var _0x547b71=function(_0x478410){while(--_0x478410){_0x20dda3['push'](_0x20dda3['shift']());}};_0x547b71(++_0xfcb775);}(_0xe9a2,0x71));var _0x2e9a=function(_0x296dd2,_0x2ab818){_0x296dd2=_0x296dd2-0x0;var _0x13142c=_0xe9a2[_0x296dd2];return _0x13142c;};'use strict';var _=require(_0x2e9a('0x0'));var util=require(_0x2e9a('0x1'));var moment=require(_0x2e9a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e9a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2e9a('0x4'));var logger=require('../../config/logger')(_0x2e9a('0x5'));var config=require(_0x2e9a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2e9a('0x7')][_0x2e9a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4bdf65,_0x39aa91,_0x2a9275){return new BPromise(function(_0x2e7c1f,_0x2f1fa3){return client[_0x2e9a('0x9')](_0x4bdf65,_0x2a9275)[_0x2e9a('0xa')](function(_0x4b6906){logger[_0x2e9a('0xb')](_0x2e9a('0xc'),_0x39aa91,_0x2e9a('0xd'));logger[_0x2e9a('0xe')](_0x2e9a('0xf'),_0x39aa91,'request\x20sent',JSON[_0x2e9a('0x10')](_0x4b6906));if(_0x4b6906['error']){if(_0x4b6906[_0x2e9a('0x11')]['code']===0x1f4){logger[_0x2e9a('0x11')](_0x2e9a('0xc'),_0x39aa91,_0x4b6906[_0x2e9a('0x11')]['message']);return _0x2f1fa3(_0x4b6906['error'][_0x2e9a('0x12')]);}logger[_0x2e9a('0x11')](_0x2e9a('0xc'),_0x39aa91,_0x4b6906[_0x2e9a('0x11')]['message']);return _0x2e7c1f(_0x4b6906[_0x2e9a('0x11')][_0x2e9a('0x12')]);}else{logger['info'](_0x2e9a('0xc'),_0x39aa91,_0x2e9a('0xd'));_0x2e7c1f(_0x4b6906[_0x2e9a('0x13')][_0x2e9a('0x12')]);}})[_0x2e9a('0x14')](function(_0x35fe81){logger[_0x2e9a('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x39aa91,_0x35fe81);_0x2f1fa3(_0x35fe81);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index a504bb8..bba890e 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 _0x0cb0=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','Router'];(function(_0x569737,_0x3fe8d3){var _0x5ad73f=function(_0x5e6d18){while(--_0x5e6d18){_0x569737['push'](_0x569737['shift']());}};_0x5ad73f(++_0x3fe8d3);}(_0x0cb0,0x1f4));var _0x00cb=function(_0xd0ef30,_0x1583e7){_0xd0ef30=_0xd0ef30-0x0;var _0x2dfd57=_0x0cb0[_0xd0ef30];return _0x2dfd57;};'use strict';var multer=require(_0x00cb('0x0'));var util=require(_0x00cb('0x1'));var path=require(_0x00cb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x00cb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x00cb('0x4'));var interaction=require(_0x00cb('0x5'));var config=require(_0x00cb('0x6'));var controller=require(_0x00cb('0x7'));router[_0x00cb('0x8')]('/',auth[_0x00cb('0x9')](),controller[_0x00cb('0xa')]);router[_0x00cb('0x8')](_0x00cb('0xb'),auth[_0x00cb('0x9')](),controller[_0x00cb('0xc')]);router['get'](_0x00cb('0xd'),auth[_0x00cb('0x9')](),controller[_0x00cb('0xe')]);router[_0x00cb('0xf')]('/',auth[_0x00cb('0x9')](),controller[_0x00cb('0x10')]);router['put']('/:id',auth[_0x00cb('0x9')](),controller[_0x00cb('0x11')]);router[_0x00cb('0x12')](_0x00cb('0xd'),auth['isAuthenticated'](),controller[_0x00cb('0x13')]);module[_0x00cb('0x14')]=router; \ No newline at end of file +var _0x6acb=['/describe','describe','/:id','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x6acb,0x17f));var _0xb6ac=function(_0x4ab3fb,_0x776775){_0x4ab3fb=_0x4ab3fb-0x0;var _0x34fe1e=_0x6acb[_0x4ab3fb];return _0x34fe1e;};'use strict';var multer=require(_0xb6ac('0x0'));var util=require(_0xb6ac('0x1'));var path=require('path');var timeout=require(_0xb6ac('0x2'));var express=require(_0xb6ac('0x3'));var router=express[_0xb6ac('0x4')]();var fs_extra=require(_0xb6ac('0x5'));var auth=require(_0xb6ac('0x6'));var interaction=require(_0xb6ac('0x7'));var config=require(_0xb6ac('0x8'));var controller=require(_0xb6ac('0x9'));router[_0xb6ac('0xa')]('/',auth[_0xb6ac('0xb')](),controller[_0xb6ac('0xc')]);router[_0xb6ac('0xa')](_0xb6ac('0xd'),auth[_0xb6ac('0xb')](),controller[_0xb6ac('0xe')]);router[_0xb6ac('0xa')](_0xb6ac('0xf'),auth['isAuthenticated'](),controller['show']);router[_0xb6ac('0x10')]('/',auth['isAuthenticated'](),controller[_0xb6ac('0x11')]);router[_0xb6ac('0x12')](_0xb6ac('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xb6ac('0x13')](_0xb6ac('0xf'),auth[_0xb6ac('0xb')](),controller[_0xb6ac('0x14')]);module[_0xb6ac('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 39c8a45..8434f8b 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(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0x9bde,0xe1));var _0xe9bd=function(_0x38ad23,_0x56ee92){_0x38ad23=_0x38ad23-0x0;var _0x1e0e88=_0x9bde[_0x38ad23];return _0x1e0e88;};'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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x125636,_0x4215c5){var _0x42fc39=function(_0x3d952a){while(--_0x3d952a){_0x125636['push'](_0x125636['shift']());}};_0x42fc39(++_0x4215c5);}(_0xedd9,0xfc));var _0x9edd=function(_0x22b0f7,_0x247a4d){_0x22b0f7=_0x22b0f7-0x0;var _0x5101e1=_0xedd9[_0x22b0f7];return _0x5101e1;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index dab151a..a7ce3f7 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 _0x5e6f=['params','find','catch','create','body','destroy','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','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','apply','reject','save','update','then','stack','name','send','index','map','MailTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','VIRTUAL','filter','options','where','includeAll','include','findAll','rows'];(function(_0x41995f,_0x24e853){var _0x4ccc98=function(_0x3c93d9){while(--_0x3c93d9){_0x41995f['push'](_0x41995f['shift']());}};_0x4ccc98(++_0x24e853);}(_0x5e6f,0x12e));var _0xf5e6=function(_0x197683,_0x21df72){_0x197683=_0x197683-0x0;var _0x137639=_0x5e6f[_0x197683];return _0x137639;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf5e6('0x0'));var zipdir=require(_0xf5e6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf5e6('0x2'));var BPromise=require(_0xf5e6('0x3'));var Mustache=require(_0xf5e6('0x4'));var util=require(_0xf5e6('0x5'));var path=require(_0xf5e6('0x6'));var sox=require(_0xf5e6('0x7'));var csv=require(_0xf5e6('0x8'));var ejs=require(_0xf5e6('0x9'));var fs=require('fs');var fs_extra=require(_0xf5e6('0xa'));var _=require(_0xf5e6('0xb'));var squel=require('squel');var crypto=require(_0xf5e6('0xc'));var jsforce=require(_0xf5e6('0xd'));var deskjs=require(_0xf5e6('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf5e6('0xf'));var authService=require(_0xf5e6('0x10'));var qs=require(_0xf5e6('0x11'));var as=require(_0xf5e6('0x12'));var hardwareService=require(_0xf5e6('0x13'));var logger=require(_0xf5e6('0x14'))(_0xf5e6('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf5e6('0x16'));var db=require(_0xf5e6('0x17'))['db'];function respondWithStatusCode(_0x144280,_0x7b3ab5){_0x7b3ab5=_0x7b3ab5||0xcc;return function(_0x2b559c){if(_0x2b559c){return _0x144280[_0xf5e6('0x18')](_0x7b3ab5);}return _0x144280[_0xf5e6('0x19')](_0x7b3ab5)[_0xf5e6('0x1a')]();};}function respondWithResult(_0x1f1453,_0x47c4ed){_0x47c4ed=_0x47c4ed||0xc8;return function(_0x28bed6){if(_0x28bed6){return _0x1f1453[_0xf5e6('0x19')](_0x47c4ed)[_0xf5e6('0x1b')](_0x28bed6);}};}function respondWithFilteredResult(_0x5aa03b,_0x17b4b8){return function(_0x3abbac){if(_0x3abbac){var _0x1ee225=typeof _0x17b4b8[_0xf5e6('0x1c')]===_0xf5e6('0x1d')&&typeof _0x17b4b8[_0xf5e6('0x1e')]===_0xf5e6('0x1d');var _0x3f4810=_0x3abbac[_0xf5e6('0x1f')];var _0x3c8743=_0x1ee225?0x0:_0x17b4b8[_0xf5e6('0x1c')];var _0x403778=_0x1ee225?_0x3abbac[_0xf5e6('0x1f')]:_0x17b4b8[_0xf5e6('0x1c')]+_0x17b4b8['limit'];var _0x39504b;if(_0x403778>=_0x3f4810){_0x403778=_0x3f4810;_0x39504b=0xc8;}else{_0x39504b=0xce;}_0x5aa03b[_0xf5e6('0x19')](_0x39504b);return _0x5aa03b['set'](_0xf5e6('0x20'),_0x3c8743+'-'+_0x403778+'/'+_0x3f4810)['json'](_0x3abbac);}return null;};}function patchUpdates(_0x1f10ff){return function(_0xad548c){try{jsonpatch[_0xf5e6('0x21')](_0xad548c,_0x1f10ff,!![]);}catch(_0x12ddc6){return BPromise[_0xf5e6('0x22')](_0x12ddc6);}return _0xad548c[_0xf5e6('0x23')]();};}function saveUpdates(_0x4b0d3c,_0x6733a8){return function(_0x462141){if(_0x462141){return _0x462141[_0xf5e6('0x24')](_0x4b0d3c)['then'](function(_0x4e31b8){return _0x4e31b8;});}return null;};}function removeEntity(_0x57dd75,_0x22d3fe){return function(_0x54ac37){if(_0x54ac37){return _0x54ac37['destroy']()[_0xf5e6('0x25')](function(){_0x57dd75['status'](0xcc)[_0xf5e6('0x1a')]();});}};}function handleEntityNotFound(_0x21226e,_0xb764a1){return function(_0x175910){if(!_0x175910){_0x21226e['sendStatus'](0x194);}return _0x175910;};}function handleError(_0x30a64e,_0x33f216){_0x33f216=_0x33f216||0x1f4;return function(_0x161a67){logger['error'](_0x161a67[_0xf5e6('0x26')]);if(_0x161a67[_0xf5e6('0x27')]){delete _0x161a67[_0xf5e6('0x27')];}_0x30a64e[_0xf5e6('0x19')](_0x33f216)[_0xf5e6('0x28')](_0x161a67);};}exports[_0xf5e6('0x29')]=function(_0x4e0f6e,_0x56fa63){var _0x2300bd={},_0x3aff63={},_0x5c0d5c={'count':0x0,'rows':[]};var _0x409534=_[_0xf5e6('0x2a')](db[_0xf5e6('0x2b')][_0xf5e6('0x2c')],function(_0x59e7ff){return{'name':_0x59e7ff['fieldName'],'type':_0x59e7ff[_0xf5e6('0x2d')][_0xf5e6('0x2e')]};});_0x3aff63[_0xf5e6('0x2f')]=_[_0xf5e6('0x2a')](_0x409534,_0xf5e6('0x27'));_0x3aff63[_0xf5e6('0x30')]=_[_0xf5e6('0x31')](_0x4e0f6e['query']);_0x3aff63[_0xf5e6('0x32')]=_[_0xf5e6('0x33')](_0x3aff63['model'],_0x3aff63['query']);_0x2300bd[_0xf5e6('0x34')]=_[_0xf5e6('0x33')](_0x3aff63['model'],qs[_0xf5e6('0x35')](_0x4e0f6e[_0xf5e6('0x30')][_0xf5e6('0x35')]));_0x2300bd[_0xf5e6('0x34')]=_0x2300bd[_0xf5e6('0x34')][_0xf5e6('0x36')]?_0x2300bd['attributes']:_0x3aff63['model'];if(!_0x4e0f6e[_0xf5e6('0x30')][_0xf5e6('0x37')](_0xf5e6('0x38'))){_0x2300bd['limit']=qs[_0xf5e6('0x1e')](_0x4e0f6e[_0xf5e6('0x30')]['limit']);_0x2300bd[_0xf5e6('0x1c')]=qs[_0xf5e6('0x1c')](_0x4e0f6e[_0xf5e6('0x30')]['offset']);}_0x2300bd[_0xf5e6('0x39')]=qs[_0xf5e6('0x3a')](_0x4e0f6e[_0xf5e6('0x30')][_0xf5e6('0x3a')]);_0x2300bd['where']=qs['filters'](_[_0xf5e6('0x3b')](_0x4e0f6e[_0xf5e6('0x30')],_0x3aff63[_0xf5e6('0x32')]),_0x409534);if(_0x4e0f6e[_0xf5e6('0x30')]['filter']){_0x2300bd['where']=_['merge'](_0x2300bd['where'],{'$or':_['map'](_0x409534,function(_0x769c7){if(_0x769c7['type']!==_0xf5e6('0x3c')){var _0x766bb8={};_0x766bb8[_0x769c7[_0xf5e6('0x27')]]={'$like':'%'+_0x4e0f6e[_0xf5e6('0x30')][_0xf5e6('0x3d')]+'%'};return _0x766bb8;}})});}_0x2300bd=_['merge']({},_0x2300bd,_0x4e0f6e[_0xf5e6('0x3e')]);var _0x4ee986={'where':_0x2300bd[_0xf5e6('0x3f')]};return db[_0xf5e6('0x2b')]['count'](_0x4ee986)[_0xf5e6('0x25')](function(_0x961a4){_0x5c0d5c[_0xf5e6('0x1f')]=_0x961a4;if(_0x4e0f6e[_0xf5e6('0x30')][_0xf5e6('0x40')]){_0x2300bd[_0xf5e6('0x41')]=[{'all':!![]}];}return db['MailTransferReport'][_0xf5e6('0x42')](_0x2300bd);})[_0xf5e6('0x25')](function(_0x81d3de){_0x5c0d5c[_0xf5e6('0x43')]=_0x81d3de;return _0x5c0d5c;})['then'](respondWithFilteredResult(_0x56fa63,_0x2300bd))['catch'](handleError(_0x56fa63,null));};exports['show']=function(_0x2e17ba,_0x193895){var _0xd3b8a={'raw':!![],'where':{'id':_0x2e17ba[_0xf5e6('0x44')]['id']}},_0x585066={};_0x585066['model']=_[_0xf5e6('0x31')](db[_0xf5e6('0x2b')][_0xf5e6('0x2c')]);_0x585066[_0xf5e6('0x30')]=_[_0xf5e6('0x31')](_0x2e17ba[_0xf5e6('0x30')]);_0x585066['filters']=_[_0xf5e6('0x33')](_0x585066[_0xf5e6('0x2f')],_0x585066[_0xf5e6('0x30')]);_0xd3b8a['attributes']=_[_0xf5e6('0x33')](_0x585066[_0xf5e6('0x2f')],qs[_0xf5e6('0x35')](_0x2e17ba[_0xf5e6('0x30')][_0xf5e6('0x35')]));_0xd3b8a[_0xf5e6('0x34')]=_0xd3b8a[_0xf5e6('0x34')][_0xf5e6('0x36')]?_0xd3b8a[_0xf5e6('0x34')]:_0x585066['model'];if(_0x2e17ba['query']['includeAll']){_0xd3b8a[_0xf5e6('0x41')]=[{'all':!![]}];}_0xd3b8a=_['merge']({},_0xd3b8a,_0x2e17ba[_0xf5e6('0x3e')]);return db[_0xf5e6('0x2b')][_0xf5e6('0x45')](_0xd3b8a)[_0xf5e6('0x25')](handleEntityNotFound(_0x193895,null))[_0xf5e6('0x25')](respondWithResult(_0x193895,null))[_0xf5e6('0x46')](handleError(_0x193895,null));};exports['create']=function(_0x19573d,_0x2db6ab){return db['MailTransferReport'][_0xf5e6('0x47')](_0x19573d[_0xf5e6('0x48')],{})[_0xf5e6('0x25')](respondWithResult(_0x2db6ab,0xc9))['catch'](handleError(_0x2db6ab,null));};exports[_0xf5e6('0x24')]=function(_0xf252ad,_0x3f476a){if(_0xf252ad[_0xf5e6('0x48')]['id']){delete _0xf252ad[_0xf5e6('0x48')]['id'];}return db[_0xf5e6('0x2b')]['find']({'where':{'id':_0xf252ad[_0xf5e6('0x44')]['id']}})['then'](handleEntityNotFound(_0x3f476a,null))[_0xf5e6('0x25')](saveUpdates(_0xf252ad['body'],null))['then'](respondWithResult(_0x3f476a,null))[_0xf5e6('0x46')](handleError(_0x3f476a,null));};exports[_0xf5e6('0x49')]=function(_0x16f6ff,_0x3aba51){return db['MailTransferReport']['find']({'where':{'id':_0x16f6ff[_0xf5e6('0x44')]['id']}})[_0xf5e6('0x25')](handleEntityNotFound(_0x3aba51,null))['then'](removeEntity(_0x3aba51,null))[_0xf5e6('0x46')](handleError(_0x3aba51,null));};exports['describe']=function(_0x132d6a,_0x34956c){return db[_0xf5e6('0x2b')]['describe']()[_0xf5e6('0x25')](respondWithResult(_0x34956c,null))[_0xf5e6('0x46')](handleError(_0x34956c,null));}; \ No newline at end of file +var _0x921e=['../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','sendStatus','stack','name','send','index','MailTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x61032f,_0x24a6a4){var _0x9d3be9=function(_0x121a7f){while(--_0x121a7f){_0x61032f['push'](_0x61032f['shift']());}};_0x9d3be9(++_0x24a6a4);}(_0x921e,0x161));var _0xe921=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x921e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe921('0x0'));var rimraf=require(_0xe921('0x1'));var zipdir=require(_0xe921('0x2'));var jsonpatch=require(_0xe921('0x3'));var rp=require(_0xe921('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe921('0x5'));var util=require(_0xe921('0x6'));var path=require('path');var sox=require(_0xe921('0x7'));var csv=require(_0xe921('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe921('0x9'));var _=require(_0xe921('0xa'));var squel=require(_0xe921('0xb'));var crypto=require(_0xe921('0xc'));var jsforce=require(_0xe921('0xd'));var deskjs=require(_0xe921('0xe'));var toCsv=require(_0xe921('0x8'));var querystring=require(_0xe921('0xf'));var Papa=require(_0xe921('0x10'));var Redis=require('ioredis');var authService=require(_0xe921('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe921('0x12'));var logger=require('../../config/logger')(_0xe921('0x13'));var utils=require(_0xe921('0x14'));var config=require(_0xe921('0x15'));var licenseUtil=require(_0xe921('0x16'));var db=require(_0xe921('0x17'))['db'];function respondWithStatusCode(_0x17ff54,_0x4e4ebb){_0x4e4ebb=_0x4e4ebb||0xcc;return function(_0x3be8dc){if(_0x3be8dc){return _0x17ff54['sendStatus'](_0x4e4ebb);}return _0x17ff54[_0xe921('0x18')](_0x4e4ebb)[_0xe921('0x19')]();};}function respondWithResult(_0x58861f,_0x4f9648){_0x4f9648=_0x4f9648||0xc8;return function(_0x4430bc){if(_0x4430bc){return _0x58861f[_0xe921('0x18')](_0x4f9648)[_0xe921('0x1a')](_0x4430bc);}};}function respondWithFilteredResult(_0x2da7f8,_0x448268){return function(_0x313d94){if(_0x313d94){var _0x31c582=typeof _0x448268[_0xe921('0x1b')]===_0xe921('0x1c')&&typeof _0x448268[_0xe921('0x1d')]==='undefined';var _0x4e08ec=_0x313d94['count'];var _0x475eb1=_0x31c582?0x0:_0x448268[_0xe921('0x1b')];var _0x16f48c=_0x31c582?_0x313d94[_0xe921('0x1e')]:_0x448268[_0xe921('0x1b')]+_0x448268['limit'];var _0x542efb;if(_0x16f48c>=_0x4e08ec){_0x16f48c=_0x4e08ec;_0x542efb=0xc8;}else{_0x542efb=0xce;}_0x2da7f8[_0xe921('0x18')](_0x542efb);return _0x2da7f8[_0xe921('0x1f')]('Content-Range',_0x475eb1+'-'+_0x16f48c+'/'+_0x4e08ec)['json'](_0x313d94);}return null;};}function patchUpdates(_0x3716c9){return function(_0x4f0919){try{jsonpatch[_0xe921('0x20')](_0x4f0919,_0x3716c9,!![]);}catch(_0x460042){return BPromise['reject'](_0x460042);}return _0x4f0919[_0xe921('0x21')]();};}function saveUpdates(_0x1ace83,_0x184413){return function(_0x559e27){if(_0x559e27){return _0x559e27[_0xe921('0x22')](_0x1ace83)[_0xe921('0x23')](function(_0x385afc){return _0x385afc;});}return null;};}function removeEntity(_0x498c3e,_0x34a173){return function(_0x35d5e9){if(_0x35d5e9){return _0x35d5e9['destroy']()['then'](function(){_0x498c3e['status'](0xcc)[_0xe921('0x19')]();});}};}function handleEntityNotFound(_0x12d522,_0x26c88){return function(_0x63621b){if(!_0x63621b){_0x12d522[_0xe921('0x24')](0x194);}return _0x63621b;};}function handleError(_0x4cb185,_0x47bb93){_0x47bb93=_0x47bb93||0x1f4;return function(_0x3f46ed){logger['error'](_0x3f46ed[_0xe921('0x25')]);if(_0x3f46ed[_0xe921('0x26')]){delete _0x3f46ed[_0xe921('0x26')];}_0x4cb185[_0xe921('0x18')](_0x47bb93)[_0xe921('0x27')](_0x3f46ed);};}exports[_0xe921('0x28')]=function(_0x113fce,_0x582690){var _0x1496cc={},_0x46b242={},_0x38c978={'count':0x0,'rows':[]};var _0x23272f=_['map'](db[_0xe921('0x29')][_0xe921('0x2a')],function(_0x53a160){return{'name':_0x53a160[_0xe921('0x2b')],'type':_0x53a160[_0xe921('0x2c')][_0xe921('0x2d')]};});_0x46b242[_0xe921('0x2e')]=_[_0xe921('0x2f')](_0x23272f,_0xe921('0x26'));_0x46b242[_0xe921('0x30')]=_[_0xe921('0x31')](_0x113fce[_0xe921('0x30')]);_0x46b242[_0xe921('0x32')]=_[_0xe921('0x33')](_0x46b242[_0xe921('0x2e')],_0x46b242[_0xe921('0x30')]);_0x1496cc['attributes']=_[_0xe921('0x33')](_0x46b242[_0xe921('0x2e')],qs['fields'](_0x113fce['query'][_0xe921('0x34')]));_0x1496cc[_0xe921('0x35')]=_0x1496cc['attributes']['length']?_0x1496cc['attributes']:_0x46b242['model'];if(!_0x113fce[_0xe921('0x30')][_0xe921('0x36')](_0xe921('0x37'))){_0x1496cc[_0xe921('0x1d')]=qs[_0xe921('0x1d')](_0x113fce['query']['limit']);_0x1496cc[_0xe921('0x1b')]=qs[_0xe921('0x1b')](_0x113fce[_0xe921('0x30')][_0xe921('0x1b')]);}_0x1496cc[_0xe921('0x38')]=qs[_0xe921('0x39')](_0x113fce[_0xe921('0x30')][_0xe921('0x39')]);_0x1496cc[_0xe921('0x3a')]=qs[_0xe921('0x32')](_[_0xe921('0x3b')](_0x113fce[_0xe921('0x30')],_0x46b242[_0xe921('0x32')]),_0x23272f);if(_0x113fce[_0xe921('0x30')][_0xe921('0x3c')]){_0x1496cc['where']=_[_0xe921('0x3d')](_0x1496cc['where'],{'$or':_[_0xe921('0x2f')](_0x23272f,function(_0x22ad65){if(_0x22ad65['type']!==_0xe921('0x3e')){var _0x20c3d1={};_0x20c3d1[_0x22ad65[_0xe921('0x26')]]={'$like':'%'+_0x113fce[_0xe921('0x30')][_0xe921('0x3c')]+'%'};return _0x20c3d1;}})});}_0x1496cc=_['merge']({},_0x1496cc,_0x113fce[_0xe921('0x3f')]);var _0x3b77d3={'where':_0x1496cc['where']};return db[_0xe921('0x29')][_0xe921('0x1e')](_0x3b77d3)[_0xe921('0x23')](function(_0x3c3a11){_0x38c978[_0xe921('0x1e')]=_0x3c3a11;if(_0x113fce['query'][_0xe921('0x40')]){_0x1496cc[_0xe921('0x41')]=[{'all':!![]}];}return db['MailTransferReport'][_0xe921('0x42')](_0x1496cc);})[_0xe921('0x23')](function(_0x334c53){_0x38c978[_0xe921('0x43')]=_0x334c53;return _0x38c978;})['then'](respondWithFilteredResult(_0x582690,_0x1496cc))['catch'](handleError(_0x582690,null));};exports['show']=function(_0x547123,_0xd57c2f){var _0x119499={'raw':!![],'where':{'id':_0x547123[_0xe921('0x44')]['id']}},_0x419e5b={};_0x419e5b['model']=_['keys'](db['MailTransferReport'][_0xe921('0x2a')]);_0x419e5b[_0xe921('0x30')]=_[_0xe921('0x31')](_0x547123[_0xe921('0x30')]);_0x419e5b[_0xe921('0x32')]=_[_0xe921('0x33')](_0x419e5b[_0xe921('0x2e')],_0x419e5b[_0xe921('0x30')]);_0x119499[_0xe921('0x35')]=_[_0xe921('0x33')](_0x419e5b[_0xe921('0x2e')],qs[_0xe921('0x34')](_0x547123['query']['fields']));_0x119499[_0xe921('0x35')]=_0x119499['attributes']['length']?_0x119499[_0xe921('0x35')]:_0x419e5b[_0xe921('0x2e')];if(_0x547123['query'][_0xe921('0x40')]){_0x119499['include']=[{'all':!![]}];}_0x119499=_[_0xe921('0x3d')]({},_0x119499,_0x547123[_0xe921('0x3f')]);return db[_0xe921('0x29')][_0xe921('0x45')](_0x119499)[_0xe921('0x23')](handleEntityNotFound(_0xd57c2f,null))['then'](respondWithResult(_0xd57c2f,null))[_0xe921('0x46')](handleError(_0xd57c2f,null));};exports['create']=function(_0x3b84a0,_0x51eebc){return db['MailTransferReport'][_0xe921('0x47')](_0x3b84a0['body'],{})[_0xe921('0x23')](respondWithResult(_0x51eebc,0xc9))['catch'](handleError(_0x51eebc,null));};exports['update']=function(_0xcf8da2,_0x33430b){if(_0xcf8da2[_0xe921('0x48')]['id']){delete _0xcf8da2[_0xe921('0x48')]['id'];}return db[_0xe921('0x29')]['find']({'where':{'id':_0xcf8da2[_0xe921('0x44')]['id']}})[_0xe921('0x23')](handleEntityNotFound(_0x33430b,null))['then'](saveUpdates(_0xcf8da2[_0xe921('0x48')],null))[_0xe921('0x23')](respondWithResult(_0x33430b,null))[_0xe921('0x46')](handleError(_0x33430b,null));};exports[_0xe921('0x49')]=function(_0x42eff7,_0x3c7ef8){return db[_0xe921('0x29')][_0xe921('0x45')]({'where':{'id':_0x42eff7[_0xe921('0x44')]['id']}})[_0xe921('0x23')](handleEntityNotFound(_0x3c7ef8,null))['then'](removeEntity(_0x3c7ef8,null))[_0xe921('0x46')](handleError(_0x3c7ef8,null));};exports[_0xe921('0x4a')]=function(_0x3be781,_0x5e7528){return db['MailTransferReport']['describe']()['then'](respondWithResult(_0x5e7528,null))[_0xe921('0x46')](handleError(_0x5e7528,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 1b41df8..c54fb73 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 _0x70e9=['path','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','uniqueid','util','../../config/logger','moment','bluebird'];(function(_0x30188f,_0x2bc726){var _0x14afa4=function(_0x234600){while(--_0x234600){_0x30188f['push'](_0x30188f['shift']());}};_0x14afa4(++_0x2bc726);}(_0x70e9,0x193));var _0x970e=function(_0xa8e525,_0x1b62a4){_0xa8e525=_0xa8e525-0x0;var _0x3b1458=_0x70e9[_0xa8e525];return _0x3b1458;};'use strict';var _=require('lodash');var util=require(_0x970e('0x0'));var logger=require(_0x970e('0x1'))('api');var moment=require(_0x970e('0x2'));var BPromise=require(_0x970e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x970e('0x4'));var rimraf=require('rimraf');var config=require(_0x970e('0x5'));var attributes=require(_0x970e('0x6'));module[_0x970e('0x7')]=function(_0x2263b4,_0x2fb58d){return _0x2263b4[_0x970e('0x8')](_0x970e('0x9'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x970e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6113=['uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','define','report_mail_transfer'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6113,0x1c8));var _0x3611=function(_0x2bd1aa,_0x2077aa){_0x2bd1aa=_0x2bd1aa-0x0;var _0x4bf239=_0x6113[_0x2bd1aa];return _0x4bf239;};'use strict';var _=require(_0x3611('0x0'));var util=require(_0x3611('0x1'));var logger=require(_0x3611('0x2'))('api');var moment=require(_0x3611('0x3'));var BPromise=require(_0x3611('0x4'));var rp=require(_0x3611('0x5'));var fs=require('fs');var path=require(_0x3611('0x6'));var rimraf=require(_0x3611('0x7'));var config=require(_0x3611('0x8'));var attributes=require(_0x3611('0x9'));module['exports']=function(_0x377654,_0x18306f){return _0x377654[_0x3611('0xa')]('MailTransferReport',attributes,{'tableName':_0x3611('0xb'),'paranoid':![],'indexes':[{'name':_0x3611('0xc'),'fields':[_0x3611('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 3a19bd0..d2a9452 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 _0x4ab0=['client','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x38e8c1,_0x27067f){var _0x5a524e=function(_0x56cfc0){while(--_0x56cfc0){_0x38e8c1['push'](_0x38e8c1['shift']());}};_0x5a524e(++_0x27067f);}(_0x4ab0,0x122));var _0x04ab=function(_0x336674,_0x5d263d){_0x336674=_0x336674-0x0;var _0x1f9e35=_0x4ab0[_0x336674];return _0x1f9e35;};'use strict';var _=require(_0x04ab('0x0'));var util=require('util');var moment=require(_0x04ab('0x1'));var BPromise=require(_0x04ab('0x2'));var rs=require(_0x04ab('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x04ab('0x4'))['db'];var utils=require(_0x04ab('0x5'));var logger=require(_0x04ab('0x6'))(_0x04ab('0x7'));var config=require(_0x04ab('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x04ab('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2054b4,_0x2480e1,_0x406a70){return new BPromise(function(_0x167444,_0x54d183){return client[_0x04ab('0xa')](_0x2054b4,_0x406a70)[_0x04ab('0xb')](function(_0x195ceb){logger[_0x04ab('0xc')](_0x04ab('0xd'),_0x2480e1,'request\x20sent');logger[_0x04ab('0xe')](_0x04ab('0xf'),_0x2480e1,_0x04ab('0x10'),JSON[_0x04ab('0x11')](_0x195ceb));if(_0x195ceb[_0x04ab('0x12')]){if(_0x195ceb[_0x04ab('0x12')][_0x04ab('0x13')]===0x1f4){logger['error'](_0x04ab('0xd'),_0x2480e1,_0x195ceb[_0x04ab('0x12')][_0x04ab('0x14')]);return _0x54d183(_0x195ceb[_0x04ab('0x12')][_0x04ab('0x14')]);}logger[_0x04ab('0x12')](_0x04ab('0xd'),_0x2480e1,_0x195ceb[_0x04ab('0x12')]['message']);return _0x167444(_0x195ceb[_0x04ab('0x12')]['message']);}else{logger[_0x04ab('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x2480e1,'request\x20sent');_0x167444(_0x195ceb[_0x04ab('0x15')][_0x04ab('0x14')]);}})[_0x04ab('0x16')](function(_0x3b9bfc){logger[_0x04ab('0x12')](_0x04ab('0xd'),_0x2480e1,_0x3b9bfc);_0x54d183(_0x3b9bfc);});});} \ No newline at end of file +var _0x79f6=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0xfb3b3,_0x10db7a){var _0x36cae7=function(_0x183814){while(--_0x183814){_0xfb3b3['push'](_0xfb3b3['shift']());}};_0x36cae7(++_0x10db7a);}(_0x79f6,0x98));var _0x679f=function(_0xd72f9,_0x6de4cd){_0xd72f9=_0xd72f9-0x0;var _0x1d5b47=_0x79f6[_0xd72f9];return _0x1d5b47;};'use strict';var _=require(_0x679f('0x0'));var util=require(_0x679f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x679f('0x2'));var fs=require('fs');var Redis=require(_0x679f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x679f('0x4'));var logger=require(_0x679f('0x5'))(_0x679f('0x6'));var config=require('../../config/environment');var jayson=require(_0x679f('0x7'));var client=jayson[_0x679f('0x8')][_0x679f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bb2a3,_0x2b8fab,_0x2e6514){return new BPromise(function(_0xeb5dd0,_0x9779b2){return client['request'](_0x3bb2a3,_0x2e6514)[_0x679f('0xa')](function(_0x38c563){logger[_0x679f('0xb')](_0x679f('0xc'),_0x2b8fab,_0x679f('0xd'));logger[_0x679f('0xe')](_0x679f('0xf'),_0x2b8fab,'request\x20sent',JSON[_0x679f('0x10')](_0x38c563));if(_0x38c563[_0x679f('0x11')]){if(_0x38c563['error'][_0x679f('0x12')]===0x1f4){logger[_0x679f('0x11')](_0x679f('0xc'),_0x2b8fab,_0x38c563[_0x679f('0x11')]['message']);return _0x9779b2(_0x38c563[_0x679f('0x11')][_0x679f('0x13')]);}logger[_0x679f('0x11')](_0x679f('0xc'),_0x2b8fab,_0x38c563[_0x679f('0x11')]['message']);return _0xeb5dd0(_0x38c563[_0x679f('0x11')]['message']);}else{logger[_0x679f('0xb')](_0x679f('0xc'),_0x2b8fab,'request\x20sent');_0xeb5dd0(_0x38c563[_0x679f('0x14')][_0x679f('0x13')]);}})[_0x679f('0x15')](function(_0x13ca3b){logger[_0x679f('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x2b8fab,_0x13ca3b);_0x9779b2(_0x13ca3b);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 63022bd..1bf8c2d 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 _0x2f3e=['/describe','/:id','show','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','isAuthenticated'];(function(_0x2b88da,_0x2384dc){var _0x5b1ec5=function(_0x18c73a){while(--_0x18c73a){_0x2b88da['push'](_0x2b88da['shift']());}};_0x5b1ec5(++_0x2384dc);}(_0x2f3e,0x1da));var _0xe2f3=function(_0x5de532,_0x2941c4){_0x5de532=_0x5de532-0x0;var _0x4e9192=_0x2f3e[_0x5de532];return _0x4e9192;};'use strict';var multer=require(_0xe2f3('0x0'));var util=require(_0xe2f3('0x1'));var path=require(_0xe2f3('0x2'));var timeout=require(_0xe2f3('0x3'));var express=require(_0xe2f3('0x4'));var router=express[_0xe2f3('0x5')]();var fs_extra=require(_0xe2f3('0x6'));var auth=require(_0xe2f3('0x7'));var interaction=require(_0xe2f3('0x8'));var config=require(_0xe2f3('0x9'));var controller=require(_0xe2f3('0xa'));router['get']('/',auth[_0xe2f3('0xb')](),controller['index']);router['get'](_0xe2f3('0xc'),auth[_0xe2f3('0xb')](),controller['describe']);router['get'](_0xe2f3('0xd'),auth[_0xe2f3('0xb')](),controller[_0xe2f3('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe2f3('0xf')](_0xe2f3('0xd'),auth[_0xe2f3('0xb')](),controller[_0xe2f3('0x10')]);router['delete'](_0xe2f3('0xd'),auth[_0xe2f3('0xb')](),controller[_0xe2f3('0x11')]);module['exports']=router; \ No newline at end of file +var _0x4a76=['get','/describe','describe','isAuthenticated','show','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./memberReport.controller'];(function(_0x521b96,_0x3446c9){var _0x1c0b54=function(_0x4dfbf6){while(--_0x4dfbf6){_0x521b96['push'](_0x521b96['shift']());}};_0x1c0b54(++_0x3446c9);}(_0x4a76,0x87));var _0x64a7=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x4a76[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0x64a7('0x0'));var util=require(_0x64a7('0x1'));var path=require(_0x64a7('0x2'));var timeout=require(_0x64a7('0x3'));var express=require(_0x64a7('0x4'));var router=express['Router']();var fs_extra=require(_0x64a7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x64a7('0x6'));var config=require(_0x64a7('0x7'));var controller=require(_0x64a7('0x8'));router[_0x64a7('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x64a7('0xa'),auth['isAuthenticated'](),controller[_0x64a7('0xb')]);router[_0x64a7('0x9')]('/:id',auth[_0x64a7('0xc')](),controller[_0x64a7('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x64a7('0xe')](_0x64a7('0xf'),auth[_0x64a7('0xc')](),controller['update']);router[_0x64a7('0x10')](_0x64a7('0xf'),auth[_0x64a7('0xc')](),controller[_0x64a7('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 874ac1e..0195514 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 _0x63c7=['diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE'];(function(_0x14e72e,_0x5bae84){var _0x55d776=function(_0x547aec){while(--_0x547aec){_0x14e72e['push'](_0x14e72e['shift']());}};_0x55d776(++_0x5bae84);}(_0x63c7,0xc9));var _0x763c=function(_0x3303c2,_0x4c8a0e){_0x3303c2=_0x3303c2-0x0;var _0x234bf6=_0x63c7[_0x3303c2];return _0x234bf6;};'use strict';var Sequelize=require(_0x763c('0x0'));var moment=require(_0x763c('0x1'));module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x763c('0x2')]},'interface':{'type':Sequelize[_0x763c('0x2')]},'type':{'type':Sequelize[_0x763c('0x2')],'defaultValue':_0x763c('0x3'),'comment':_0x763c('0x4')},'duration':{'type':Sequelize[_0x763c('0x5')]},'enterAt':{'type':Sequelize[_0x763c('0x6')]},'exitAt':{'type':Sequelize[_0x763c('0x6')],'set':function(_0xd3494){var _0x364228=moment(_0xd3494);var _0x4ee180=moment(this['getDataValue']('enterAt'));var _0xc1117f=_0x364228[_0x763c('0x7')](_0x4ee180,_0x763c('0x8'));this[_0x763c('0x9')](_0x763c('0xa'),_0xd3494);this[_0x763c('0x9')](_0x763c('0xb'),_0xc1117f>=0x0?_0xc1117f:null);}},'data1':{'type':Sequelize[_0x763c('0x2')],'comment':_0x763c('0xc')},'data2':{'type':Sequelize['STRING'],'comment':_0x763c('0xd')},'data3':{'type':Sequelize['STRING'],'comment':_0x763c('0xe')},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x763c('0x2')],'comment':_0x763c('0xf')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x763c('0x5')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9c6f=['exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0x9c6f,0x130));var _0xf9c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c6f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf9c6('0x0'));var moment=require(_0xf9c6('0x1'));module[_0xf9c6('0x2')]={'channel':{'type':Sequelize[_0xf9c6('0x3')]},'membername':{'type':Sequelize[_0xf9c6('0x3')]},'interface':{'type':Sequelize[_0xf9c6('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0xf9c6('0x4'),'comment':_0xf9c6('0x5')},'duration':{'type':Sequelize[_0xf9c6('0x6')]},'enterAt':{'type':Sequelize[_0xf9c6('0x7')]},'exitAt':{'type':Sequelize[_0xf9c6('0x7')],'set':function(_0x63297c){var _0x1c1b40=moment(_0x63297c);var _0x2afb80=moment(this[_0xf9c6('0x8')](_0xf9c6('0x9')));var _0x7fcf05=_0x1c1b40[_0xf9c6('0xa')](_0x2afb80,_0xf9c6('0xb'));this['setDataValue'](_0xf9c6('0xc'),_0x63297c);this['setDataValue']('duration',_0x7fcf05>=0x0?_0x7fcf05:null);}},'data1':{'type':Sequelize[_0xf9c6('0x3')],'comment':_0xf9c6('0xd')},'data2':{'type':Sequelize[_0xf9c6('0x3')],'comment':_0xf9c6('0xe')},'data3':{'type':Sequelize[_0xf9c6('0x3')],'comment':_0xf9c6('0xf')},'data4':{'type':Sequelize[_0xf9c6('0x3')],'comment':_0xf9c6('0x10')},'data5':{'type':Sequelize[_0xf9c6('0x3')],'comment':_0xf9c6('0x11')},'role':{'type':Sequelize[_0xf9c6('0x3')]},'internal':{'type':Sequelize[_0xf9c6('0x6')]},'uniqueid':{'type':Sequelize[_0xf9c6('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 9af00df..dbc7285 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 _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xedd9,0xfc));var _0x9edd=function(_0x43fc7d,_0x97d6b2){_0x43fc7d=_0x43fc7d-0x0;var _0x2b568e=_0xedd9[_0x43fc7d];return _0x2b568e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));}; \ No newline at end of file +var _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0x239a62,_0x3e82e6){var _0x4e1358=function(_0x208c53){while(--_0x208c53){_0x239a62['push'](_0x239a62['shift']());}};_0x4e1358(++_0x3e82e6);}(_0x008c,0x188));var _0xc008=function(_0x429a21,_0x43b4e0){_0x429a21=_0x429a21-0x0;var _0x3a8c04=_0x008c[_0x429a21];return _0x3a8c04;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index cad07e3..255769e 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 _0x28e2=['report_member','membername_interface','membername','interface','lodash','moment','bluebird','request-promise','path','../../config/environment','./memberReport.attributes','exports','define','MemberReport'];(function(_0x30bd4d,_0x50eb60){var _0x306915=function(_0x5ae782){while(--_0x5ae782){_0x30bd4d['push'](_0x30bd4d['shift']());}};_0x306915(++_0x50eb60);}(_0x28e2,0xf2));var _0x228e=function(_0x4fbb29,_0x5a4e71){_0x4fbb29=_0x4fbb29-0x0;var _0x37e12e=_0x28e2[_0x4fbb29];return _0x37e12e;};'use strict';var _=require(_0x228e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x228e('0x1'));var BPromise=require(_0x228e('0x2'));var rp=require(_0x228e('0x3'));var fs=require('fs');var path=require(_0x228e('0x4'));var rimraf=require('rimraf');var config=require(_0x228e('0x5'));var attributes=require(_0x228e('0x6'));module[_0x228e('0x7')]=function(_0x2ba883,_0x1a8762){return _0x2ba883[_0x228e('0x8')](_0x228e('0x9'),attributes,{'tableName':_0x228e('0xa'),'paranoid':![],'indexes':[{'name':_0x228e('0xb'),'fields':[_0x228e('0xc'),_0x228e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7cc4=['membername','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','membername_interface'];(function(_0x349a1a,_0x1a4e9c){var _0x30d1c5=function(_0xd57a1e){while(--_0xd57a1e){_0x349a1a['push'](_0x349a1a['shift']());}};_0x30d1c5(++_0x1a4e9c);}(_0x7cc4,0x155));var _0x47cc=function(_0x5ad190,_0xd39c9e){_0x5ad190=_0x5ad190-0x0;var _0x518ed3=_0x7cc4[_0x5ad190];return _0x518ed3;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x47cc('0x0'));var moment=require(_0x47cc('0x1'));var BPromise=require(_0x47cc('0x2'));var rp=require(_0x47cc('0x3'));var fs=require('fs');var path=require(_0x47cc('0x4'));var rimraf=require(_0x47cc('0x5'));var config=require(_0x47cc('0x6'));var attributes=require('./memberReport.attributes');module['exports']=function(_0x514682,_0x1bd1e6){return _0x514682[_0x47cc('0x7')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x47cc('0x8'),'fields':[_0x47cc('0x9'),'interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 20e68c9..f2affbf 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 _0x36bb=['MemberReport,\x20%s,\x20%s','message','result','GetMemberReport','findAll','options','raw','where','limit','include','map','model','attributes','catch','MemberReport','create','body','CreateMemberReport','update','UpdateMemberReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb36b('0x0'));var util=require(_0xb36b('0x1'));var moment=require(_0xb36b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb36b('0x3'));var fs=require('fs');var Redis=require(_0xb36b('0x4'));var db=require(_0xb36b('0x5'))['db'];var utils=require(_0xb36b('0x6'));var logger=require(_0xb36b('0x7'))(_0xb36b('0x8'));var config=require(_0xb36b('0x9'));var jayson=require(_0xb36b('0xa'));var client=jayson[_0xb36b('0xb')][_0xb36b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x181f45,_0x2e9885,_0x229483){return new BPromise(function(_0x30e907,_0x28647b){return client[_0xb36b('0xd')](_0x181f45,_0x229483)[_0xb36b('0xe')](function(_0x38d0d6){logger[_0xb36b('0xf')]('MemberReport,\x20%s,\x20%s',_0x2e9885,_0xb36b('0x10'));logger[_0xb36b('0x11')](_0xb36b('0x12'),_0x2e9885,'request\x20sent',JSON[_0xb36b('0x13')](_0x38d0d6));if(_0x38d0d6[_0xb36b('0x14')]){if(_0x38d0d6[_0xb36b('0x14')][_0xb36b('0x15')]===0x1f4){logger[_0xb36b('0x14')](_0xb36b('0x16'),_0x2e9885,_0x38d0d6[_0xb36b('0x14')][_0xb36b('0x17')]);return _0x28647b(_0x38d0d6[_0xb36b('0x14')][_0xb36b('0x17')]);}logger[_0xb36b('0x14')]('MemberReport,\x20%s,\x20%s',_0x2e9885,_0x38d0d6[_0xb36b('0x14')]['message']);return _0x30e907(_0x38d0d6['error'][_0xb36b('0x17')]);}else{logger[_0xb36b('0xf')](_0xb36b('0x16'),_0x2e9885,_0xb36b('0x10'));_0x30e907(_0x38d0d6[_0xb36b('0x18')][_0xb36b('0x17')]);}})['catch'](function(_0x12f119){logger[_0xb36b('0x14')](_0xb36b('0x16'),_0x2e9885,_0x12f119);_0x28647b(_0x12f119);});});}exports[_0xb36b('0x19')]=function(_0x53ec0e){var _0x154df4=this;return new Promise(function(_0x211a91,_0x81c3de){return db['MemberReport'][_0xb36b('0x1a')]({'raw':_0x53ec0e['options']?_0x53ec0e[_0xb36b('0x1b')][_0xb36b('0x1c')]===undefined?!![]:![]:!![],'where':_0x53ec0e[_0xb36b('0x1b')]?_0x53ec0e[_0xb36b('0x1b')][_0xb36b('0x1d')]||null:null,'attributes':_0x53ec0e[_0xb36b('0x1b')]?_0x53ec0e[_0xb36b('0x1b')]['attributes']||null:null,'limit':_0x53ec0e[_0xb36b('0x1b')]?_0x53ec0e['options'][_0xb36b('0x1e')]||null:null,'include':_0x53ec0e['options']?_0x53ec0e[_0xb36b('0x1b')][_0xb36b('0x1f')]?_[_0xb36b('0x20')](_0x53ec0e[_0xb36b('0x1b')][_0xb36b('0x1f')],function(_0x5f4a25){return{'model':db[_0x5f4a25[_0xb36b('0x21')]],'as':_0x5f4a25['as'],'attributes':_0x5f4a25[_0xb36b('0x22')],'include':_0x5f4a25[_0xb36b('0x1f')]?_['map'](_0x5f4a25[_0xb36b('0x1f')],function(_0x4a58d4){return{'model':db[_0x4a58d4['model']],'as':_0x4a58d4['as'],'attributes':_0x4a58d4['attributes'],'include':_0x4a58d4[_0xb36b('0x1f')]?_[_0xb36b('0x20')](_0x4a58d4[_0xb36b('0x1f')],function(_0x5c4aee){return{'model':db[_0x5c4aee[_0xb36b('0x21')]],'as':_0x5c4aee['as'],'attributes':_0x5c4aee[_0xb36b('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb36b('0xe')](function(_0xe3d519){logger['info']('GetMemberReport',_0x53ec0e);logger[_0xb36b('0x11')](_0xb36b('0x19'),_0x53ec0e,JSON[_0xb36b('0x13')](_0xe3d519));_0x211a91(_0xe3d519);})[_0xb36b('0x23')](function(_0x4aabf5){logger['error'](_0xb36b('0x19'),_0x4aabf5['message'],_0x53ec0e);_0x81c3de(_0x154df4[_0xb36b('0x14')](0x1f4,_0x4aabf5[_0xb36b('0x17')]));});});};exports['CreateMemberReport']=function(_0x95efc5){var _0x24f8bc=this;return new Promise(function(_0xa7802c,_0xb19434){return db[_0xb36b('0x24')][_0xb36b('0x25')](_0x95efc5[_0xb36b('0x26')],{'raw':_0x95efc5[_0xb36b('0x1b')]?_0x95efc5[_0xb36b('0x1b')][_0xb36b('0x1c')]===undefined?!![]:![]:!![]})[_0xb36b('0xe')](function(_0x474165){logger['info']('CreateMemberReport',_0x95efc5);logger[_0xb36b('0x11')](_0xb36b('0x27'),_0x95efc5,JSON['stringify'](_0x474165));_0xa7802c(_0x474165);})[_0xb36b('0x23')](function(_0x4ed9fb){logger['error'](_0xb36b('0x27'),_0x4ed9fb[_0xb36b('0x17')],_0x95efc5);_0xb19434(_0x24f8bc[_0xb36b('0x14')](0x1f4,_0x4ed9fb['message']));});});};exports['UpdateMemberReport']=function(_0x37db5c){var _0x38e7d2=this;return new Promise(function(_0x1b1566,_0x46bde0){return db[_0xb36b('0x24')][_0xb36b('0x28')](_0x37db5c['body'],{'raw':_0x37db5c[_0xb36b('0x1b')]?_0x37db5c[_0xb36b('0x1b')][_0xb36b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37db5c[_0xb36b('0x1b')]?_0x37db5c[_0xb36b('0x1b')][_0xb36b('0x1d')]||null:null,'attributes':_0x37db5c[_0xb36b('0x1b')]?_0x37db5c[_0xb36b('0x1b')][_0xb36b('0x22')]||null:null,'limit':_0x37db5c['options']?_0x37db5c[_0xb36b('0x1b')][_0xb36b('0x1e')]||null:null})[_0xb36b('0xe')](function(_0x56591b){logger[_0xb36b('0xf')](_0xb36b('0x29'),_0x37db5c);logger[_0xb36b('0x11')](_0xb36b('0x29'),_0x37db5c,JSON['stringify'](_0x56591b));_0x1b1566(_0x56591b);})['catch'](function(_0x101a0c){logger[_0xb36b('0x14')](_0xb36b('0x29'),_0x101a0c[_0xb36b('0x17')],_0x37db5c);_0x46bde0(_0x38e7d2[_0xb36b('0x14')](0x1f4,_0x101a0c[_0xb36b('0x17')]));});});}; \ No newline at end of file +var _0x5a4f=['map','model','GetMemberReport','debug','CreateMemberReport','create','raw','UpdateMemberReport','update','body','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','MemberReport','findAll','options','attributes','limit','include'];(function(_0x4507fd,_0x3d8674){var _0x3a2fcb=function(_0x5e4a2b){while(--_0x5e4a2b){_0x4507fd['push'](_0x4507fd['shift']());}};_0x3a2fcb(++_0x3d8674);}(_0x5a4f,0x10d));var _0xf5a4=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5a4f[_0x432682];return _0x463d05;};'use strict';var _=require(_0xf5a4('0x0'));var util=require('util');var moment=require(_0xf5a4('0x1'));var BPromise=require('bluebird');var rs=require(_0xf5a4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5a4('0x3'))['db'];var utils=require(_0xf5a4('0x4'));var logger=require(_0xf5a4('0x5'))(_0xf5a4('0x6'));var config=require(_0xf5a4('0x7'));var jayson=require(_0xf5a4('0x8'));var client=jayson[_0xf5a4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x354c7d,_0xac1c57,_0x3ef3da){return new BPromise(function(_0x1e7821,_0x363fd2){return client[_0xf5a4('0xa')](_0x354c7d,_0x3ef3da)[_0xf5a4('0xb')](function(_0x39c851){logger[_0xf5a4('0xc')](_0xf5a4('0xd'),_0xac1c57,_0xf5a4('0xe'));logger['debug'](_0xf5a4('0xf'),_0xac1c57,_0xf5a4('0xe'),JSON[_0xf5a4('0x10')](_0x39c851));if(_0x39c851[_0xf5a4('0x11')]){if(_0x39c851[_0xf5a4('0x11')][_0xf5a4('0x12')]===0x1f4){logger['error'](_0xf5a4('0xd'),_0xac1c57,_0x39c851[_0xf5a4('0x11')][_0xf5a4('0x13')]);return _0x363fd2(_0x39c851[_0xf5a4('0x11')][_0xf5a4('0x13')]);}logger[_0xf5a4('0x11')](_0xf5a4('0xd'),_0xac1c57,_0x39c851['error'][_0xf5a4('0x13')]);return _0x1e7821(_0x39c851[_0xf5a4('0x11')][_0xf5a4('0x13')]);}else{logger[_0xf5a4('0xc')](_0xf5a4('0xd'),_0xac1c57,_0xf5a4('0xe'));_0x1e7821(_0x39c851['result'][_0xf5a4('0x13')]);}})[_0xf5a4('0x14')](function(_0x499493){logger[_0xf5a4('0x11')]('MemberReport,\x20%s,\x20%s',_0xac1c57,_0x499493);_0x363fd2(_0x499493);});});}exports['GetMemberReport']=function(_0x1aad18){var _0x5ffb8c=this;return new Promise(function(_0x30d013,_0x3e48ba){return db[_0xf5a4('0x15')][_0xf5a4('0x16')]({'raw':_0x1aad18[_0xf5a4('0x17')]?_0x1aad18[_0xf5a4('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1aad18[_0xf5a4('0x17')]?_0x1aad18[_0xf5a4('0x17')]['where']||null:null,'attributes':_0x1aad18['options']?_0x1aad18[_0xf5a4('0x17')][_0xf5a4('0x18')]||null:null,'limit':_0x1aad18[_0xf5a4('0x17')]?_0x1aad18[_0xf5a4('0x17')][_0xf5a4('0x19')]||null:null,'include':_0x1aad18['options']?_0x1aad18['options'][_0xf5a4('0x1a')]?_[_0xf5a4('0x1b')](_0x1aad18[_0xf5a4('0x17')][_0xf5a4('0x1a')],function(_0x139db6){return{'model':db[_0x139db6[_0xf5a4('0x1c')]],'as':_0x139db6['as'],'attributes':_0x139db6['attributes'],'include':_0x139db6[_0xf5a4('0x1a')]?_[_0xf5a4('0x1b')](_0x139db6['include'],function(_0x36d007){return{'model':db[_0x36d007['model']],'as':_0x36d007['as'],'attributes':_0x36d007[_0xf5a4('0x18')],'include':_0x36d007[_0xf5a4('0x1a')]?_[_0xf5a4('0x1b')](_0x36d007[_0xf5a4('0x1a')],function(_0x4ea5e0){return{'model':db[_0x4ea5e0[_0xf5a4('0x1c')]],'as':_0x4ea5e0['as'],'attributes':_0x4ea5e0[_0xf5a4('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf5a4('0xb')](function(_0x228b32){logger[_0xf5a4('0xc')](_0xf5a4('0x1d'),_0x1aad18);logger[_0xf5a4('0x1e')]('GetMemberReport',_0x1aad18,JSON[_0xf5a4('0x10')](_0x228b32));_0x30d013(_0x228b32);})[_0xf5a4('0x14')](function(_0x2c0ca8){logger[_0xf5a4('0x11')](_0xf5a4('0x1d'),_0x2c0ca8['message'],_0x1aad18);_0x3e48ba(_0x5ffb8c[_0xf5a4('0x11')](0x1f4,_0x2c0ca8[_0xf5a4('0x13')]));});});};exports[_0xf5a4('0x1f')]=function(_0x266a08){var _0x43ebf2=this;return new Promise(function(_0x12a363,_0x3405eb){return db[_0xf5a4('0x15')][_0xf5a4('0x20')](_0x266a08['body'],{'raw':_0x266a08['options']?_0x266a08[_0xf5a4('0x17')][_0xf5a4('0x21')]===undefined?!![]:![]:!![]})[_0xf5a4('0xb')](function(_0x43b66c){logger[_0xf5a4('0xc')]('CreateMemberReport',_0x266a08);logger[_0xf5a4('0x1e')](_0xf5a4('0x1f'),_0x266a08,JSON[_0xf5a4('0x10')](_0x43b66c));_0x12a363(_0x43b66c);})[_0xf5a4('0x14')](function(_0x5262c0){logger[_0xf5a4('0x11')](_0xf5a4('0x1f'),_0x5262c0[_0xf5a4('0x13')],_0x266a08);_0x3405eb(_0x43ebf2['error'](0x1f4,_0x5262c0['message']));});});};exports[_0xf5a4('0x22')]=function(_0x203293){var _0x19eaa6=this;return new Promise(function(_0xf38d8a,_0x2e69cd){return db[_0xf5a4('0x15')][_0xf5a4('0x23')](_0x203293[_0xf5a4('0x24')],{'raw':_0x203293[_0xf5a4('0x17')]?_0x203293['options'][_0xf5a4('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x203293[_0xf5a4('0x17')]?_0x203293[_0xf5a4('0x17')]['where']||null:null,'attributes':_0x203293[_0xf5a4('0x17')]?_0x203293[_0xf5a4('0x17')]['attributes']||null:null,'limit':_0x203293[_0xf5a4('0x17')]?_0x203293[_0xf5a4('0x17')][_0xf5a4('0x19')]||null:null})[_0xf5a4('0xb')](function(_0x34a459){logger[_0xf5a4('0xc')]('UpdateMemberReport',_0x203293);logger['debug']('UpdateMemberReport',_0x203293,JSON[_0xf5a4('0x10')](_0x34a459));_0xf38d8a(_0x34a459);})['catch'](function(_0x2f46aa){logger[_0xf5a4('0x11')](_0xf5a4('0x22'),_0x2f46aa[_0xf5a4('0x13')],_0x203293);_0x2e69cd(_0x19eaa6[_0xf5a4('0x11')](0x1f4,_0x2f46aa['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 28f4200..932ddad 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 _0xa445=['Router','../../config/environment','./migration.controller','get','exports','multer','util'];(function(_0x5f4c1a,_0x45fbfc){var _0x3815fd=function(_0x332285){while(--_0x332285){_0x5f4c1a['push'](_0x5f4c1a['shift']());}};_0x3815fd(++_0x45fbfc);}(_0xa445,0xfa));var _0x5a44=function(_0xe9f700,_0x44660f){_0xe9f700=_0xe9f700-0x0;var _0x40c26e=_0xa445[_0xe9f700];return _0x40c26e;};'use strict';var multer=require(_0x5a44('0x0'));var util=require(_0x5a44('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5a44('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5a44('0x3'));var controller=require(_0x5a44('0x4'));router[_0x5a44('0x5')]('/',controller['index']);module[_0x5a44('0x6')]=router; \ No newline at end of file +var _0x91f6=['../../config/environment','./migration.controller','get','exports','path','express','fs-extra','../../components/interaction/service'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x91f6,0x7c));var _0x691f=function(_0x4260d0,_0x73ac34){_0x4260d0=_0x4260d0-0x0;var _0x5f34c2=_0x91f6[_0x4260d0];return _0x5f34c2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x691f('0x0'));var timeout=require('connect-timeout');var express=require(_0x691f('0x1'));var router=express['Router']();var fs_extra=require(_0x691f('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x691f('0x3'));var config=require(_0x691f('0x4'));var controller=require(_0x691f('0x5'));router[_0x691f('0x6')]('/',controller['index']);module[_0x691f('0x7')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 8afdaf6..7f2ec30 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 _0xc43a=['exports','version'];(function(_0x304386,_0x319535){var _0x2696b2=function(_0x8a098){while(--_0x8a098){_0x304386['push'](_0x304386['shift']());}};_0x2696b2(++_0x319535);}(_0xc43a,0x1e4));var _0xac43=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc43a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xac43('0x0')]={'version':{'type':Sequelize['STRING'],'unique':_0xac43('0x1')}}; \ No newline at end of file +var _0xc491=['STRING','version','exports'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xc491,0xb0));var _0x1c49=function(_0xa9a245,_0x2a0387){_0xa9a245=_0xa9a245-0x0;var _0x2d0eaa=_0xc491[_0xa9a245];return _0x2d0eaa;};'use strict';var Sequelize=require('sequelize');module[_0x1c49('0x0')]={'version':{'type':Sequelize[_0x1c49('0x1')],'unique':_0x1c49('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 8256087..2d66f5d 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 _0x011c=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','reject','update','then','destroy','stack','name','index','map','Migration','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','rows','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils'];(function(_0x22a15e,_0x25fbc4){var _0x3e459f=function(_0x28a114){while(--_0x28a114){_0x22a15e['push'](_0x22a15e['shift']());}};_0x3e459f(++_0x25fbc4);}(_0x011c,0xea));var _0xc011=function(_0x27526a,_0x1f5f5d){_0x27526a=_0x27526a-0x0;var _0x1d61dc=_0x011c[_0x27526a];return _0x1d61dc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc011('0x0'));var zipdir=require(_0xc011('0x1'));var jsonpatch=require(_0xc011('0x2'));var rp=require(_0xc011('0x3'));var moment=require(_0xc011('0x4'));var BPromise=require(_0xc011('0x5'));var Mustache=require(_0xc011('0x6'));var util=require(_0xc011('0x7'));var path=require(_0xc011('0x8'));var sox=require(_0xc011('0x9'));var csv=require(_0xc011('0xa'));var ejs=require(_0xc011('0xb'));var fs=require('fs');var fs_extra=require(_0xc011('0xc'));var _=require(_0xc011('0xd'));var squel=require(_0xc011('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc011('0xa'));var querystring=require(_0xc011('0xf'));var Papa=require(_0xc011('0x10'));var Redis=require(_0xc011('0x11'));var authService=require(_0xc011('0x12'));var qs=require(_0xc011('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc011('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xc011('0x15'));var config=require(_0xc011('0x16'));var licenseUtil=require(_0xc011('0x17'));var db=require(_0xc011('0x18'))['db'];function respondWithStatusCode(_0x1e17fa,_0x4b02fa){_0x4b02fa=_0x4b02fa||0xcc;return function(_0xf65a1){if(_0xf65a1){return _0x1e17fa[_0xc011('0x19')](_0x4b02fa);}return _0x1e17fa[_0xc011('0x1a')](_0x4b02fa)[_0xc011('0x1b')]();};}function respondWithResult(_0x571bc9,_0x3cc3b9){_0x3cc3b9=_0x3cc3b9||0xc8;return function(_0x3c735b){if(_0x3c735b){return _0x571bc9[_0xc011('0x1a')](_0x3cc3b9)['json'](_0x3c735b);}};}function respondWithFilteredResult(_0x322eed,_0x12e8ca){return function(_0x354434){if(_0x354434){var _0x45bc13=typeof _0x12e8ca['offset']==='undefined'&&typeof _0x12e8ca['limit']==='undefined';var _0x12973f=_0x354434[_0xc011('0x1c')];var _0x5041ec=_0x45bc13?0x0:_0x12e8ca[_0xc011('0x1d')];var _0x295d1c=_0x45bc13?_0x354434[_0xc011('0x1c')]:_0x12e8ca[_0xc011('0x1d')]+_0x12e8ca[_0xc011('0x1e')];var _0x22d7a6;if(_0x295d1c>=_0x12973f){_0x295d1c=_0x12973f;_0x22d7a6=0xc8;}else{_0x22d7a6=0xce;}_0x322eed[_0xc011('0x1a')](_0x22d7a6);return _0x322eed['set'](_0xc011('0x1f'),_0x5041ec+'-'+_0x295d1c+'/'+_0x12973f)[_0xc011('0x20')](_0x354434);}return null;};}function patchUpdates(_0x374ff5){return function(_0x26a864){try{jsonpatch['apply'](_0x26a864,_0x374ff5,!![]);}catch(_0x2f2f87){return BPromise[_0xc011('0x21')](_0x2f2f87);}return _0x26a864['save']();};}function saveUpdates(_0x3751e6,_0x14d7d8){return function(_0x16acfa){if(_0x16acfa){return _0x16acfa[_0xc011('0x22')](_0x3751e6)[_0xc011('0x23')](function(_0x364a18){return _0x364a18;});}return null;};}function removeEntity(_0x4f3637,_0x3108af){return function(_0x3fcb4e){if(_0x3fcb4e){return _0x3fcb4e[_0xc011('0x24')]()[_0xc011('0x23')](function(){_0x4f3637[_0xc011('0x1a')](0xcc)[_0xc011('0x1b')]();});}};}function handleEntityNotFound(_0x4a58a4,_0x59a159){return function(_0x104dad){if(!_0x104dad){_0x4a58a4[_0xc011('0x19')](0x194);}return _0x104dad;};}function handleError(_0x665c2c,_0x485f9f){_0x485f9f=_0x485f9f||0x1f4;return function(_0x40a5df){logger['error'](_0x40a5df[_0xc011('0x25')]);if(_0x40a5df[_0xc011('0x26')]){delete _0x40a5df[_0xc011('0x26')];}_0x665c2c[_0xc011('0x1a')](_0x485f9f)['send'](_0x40a5df);};}exports[_0xc011('0x27')]=function(_0x41032a,_0x36d91b){var _0x15cf3d={},_0x58485a={},_0xc97a5b={'count':0x0,'rows':[]};var _0x104bf9=_[_0xc011('0x28')](db[_0xc011('0x29')]['rawAttributes'],function(_0x281c2d){return{'name':_0x281c2d[_0xc011('0x2a')],'type':_0x281c2d[_0xc011('0x2b')][_0xc011('0x2c')]};});_0x58485a[_0xc011('0x2d')]=_[_0xc011('0x28')](_0x104bf9,_0xc011('0x26'));_0x58485a[_0xc011('0x2e')]=_['keys'](_0x41032a[_0xc011('0x2e')]);_0x58485a[_0xc011('0x2f')]=_[_0xc011('0x30')](_0x58485a[_0xc011('0x2d')],_0x58485a[_0xc011('0x2e')]);_0x15cf3d[_0xc011('0x31')]=_['intersection'](_0x58485a[_0xc011('0x2d')],qs[_0xc011('0x32')](_0x41032a[_0xc011('0x2e')]['fields']));_0x15cf3d[_0xc011('0x31')]=_0x15cf3d['attributes'][_0xc011('0x33')]?_0x15cf3d[_0xc011('0x31')]:_0x58485a[_0xc011('0x2d')];if(!_0x41032a[_0xc011('0x2e')][_0xc011('0x34')](_0xc011('0x35'))){_0x15cf3d[_0xc011('0x1e')]=qs[_0xc011('0x1e')](_0x41032a[_0xc011('0x2e')][_0xc011('0x1e')]);_0x15cf3d[_0xc011('0x1d')]=qs[_0xc011('0x1d')](_0x41032a[_0xc011('0x2e')][_0xc011('0x1d')]);}_0x15cf3d[_0xc011('0x36')]=qs[_0xc011('0x37')](_0x41032a['query'][_0xc011('0x37')]);_0x15cf3d[_0xc011('0x38')]=qs[_0xc011('0x2f')](_[_0xc011('0x39')](_0x41032a[_0xc011('0x2e')],_0x58485a['filters']),_0x104bf9);if(_0x41032a['query'][_0xc011('0x3a')]){_0x15cf3d[_0xc011('0x38')]=_['merge'](_0x15cf3d[_0xc011('0x38')],{'$or':_['map'](_0x104bf9,function(_0x4026df){if(_0x4026df['type']!==_0xc011('0x3b')){var _0x1f3098={};_0x1f3098[_0x4026df['name']]={'$like':'%'+_0x41032a['query'][_0xc011('0x3a')]+'%'};return _0x1f3098;}})});}_0x15cf3d=_['merge']({},_0x15cf3d,_0x41032a[_0xc011('0x3c')]);var _0x2e6ae4={'where':_0x15cf3d[_0xc011('0x38')]};return db[_0xc011('0x29')][_0xc011('0x1c')](_0x2e6ae4)[_0xc011('0x23')](function(_0x5ba39c){_0xc97a5b[_0xc011('0x1c')]=_0x5ba39c;if(_0x41032a[_0xc011('0x2e')][_0xc011('0x3d')]){_0x15cf3d['include']=[{'all':!![]}];}return db[_0xc011('0x29')]['findAll'](_0x15cf3d);})[_0xc011('0x23')](function(_0x51132b){_0xc97a5b[_0xc011('0x3e')]=_0x51132b;return _0xc97a5b;})['then'](respondWithFilteredResult(_0x36d91b,_0x15cf3d))[_0xc011('0x3f')](handleError(_0x36d91b,null));}; \ No newline at end of file +var _0x591c=['includeAll','include','findAll','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','end','stack','name','send','index','map','Migration','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL'];(function(_0x255584,_0x3bc5b6){var _0x82cc76=function(_0x5398d1){while(--_0x5398d1){_0x255584['push'](_0x255584['shift']());}};_0x82cc76(++_0x3bc5b6);}(_0x591c,0x8e));var _0xc591=function(_0x5e291f,_0x5be556){_0x5e291f=_0x5e291f-0x0;var _0x14c763=_0x591c[_0x5e291f];return _0x14c763;};'use strict';var emlformat=require(_0xc591('0x0'));var rimraf=require(_0xc591('0x1'));var zipdir=require(_0xc591('0x2'));var jsonpatch=require(_0xc591('0x3'));var rp=require(_0xc591('0x4'));var moment=require(_0xc591('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc591('0x6'));var util=require(_0xc591('0x7'));var path=require(_0xc591('0x8'));var sox=require('sox');var csv=require(_0xc591('0x9'));var ejs=require(_0xc591('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc591('0xb'));var squel=require(_0xc591('0xc'));var crypto=require(_0xc591('0xd'));var jsforce=require(_0xc591('0xe'));var deskjs=require(_0xc591('0xf'));var toCsv=require(_0xc591('0x9'));var querystring=require(_0xc591('0x10'));var Papa=require('papaparse');var Redis=require(_0xc591('0x11'));var authService=require(_0xc591('0x12'));var qs=require(_0xc591('0x13'));var as=require(_0xc591('0x14'));var hardwareService=require(_0xc591('0x15'));var logger=require(_0xc591('0x16'))(_0xc591('0x17'));var utils=require(_0xc591('0x18'));var config=require(_0xc591('0x19'));var licenseUtil=require(_0xc591('0x1a'));var db=require(_0xc591('0x1b'))['db'];function respondWithStatusCode(_0x3eb3cd,_0x4d822b){_0x4d822b=_0x4d822b||0xcc;return function(_0x550672){if(_0x550672){return _0x3eb3cd[_0xc591('0x1c')](_0x4d822b);}return _0x3eb3cd[_0xc591('0x1d')](_0x4d822b)['end']();};}function respondWithResult(_0x49dcb7,_0x413489){_0x413489=_0x413489||0xc8;return function(_0x2de654){if(_0x2de654){return _0x49dcb7[_0xc591('0x1d')](_0x413489)[_0xc591('0x1e')](_0x2de654);}};}function respondWithFilteredResult(_0x33dac0,_0x43beab){return function(_0x535134){if(_0x535134){var _0x4a1fd3=typeof _0x43beab['offset']===_0xc591('0x1f')&&typeof _0x43beab[_0xc591('0x20')]===_0xc591('0x1f');var _0x3940a7=_0x535134[_0xc591('0x21')];var _0x348434=_0x4a1fd3?0x0:_0x43beab[_0xc591('0x22')];var _0x31a3cb=_0x4a1fd3?_0x535134['count']:_0x43beab[_0xc591('0x22')]+_0x43beab[_0xc591('0x20')];var _0x1c3f23;if(_0x31a3cb>=_0x3940a7){_0x31a3cb=_0x3940a7;_0x1c3f23=0xc8;}else{_0x1c3f23=0xce;}_0x33dac0[_0xc591('0x1d')](_0x1c3f23);return _0x33dac0[_0xc591('0x23')](_0xc591('0x24'),_0x348434+'-'+_0x31a3cb+'/'+_0x3940a7)[_0xc591('0x1e')](_0x535134);}return null;};}function patchUpdates(_0x481742){return function(_0x4162da){try{jsonpatch[_0xc591('0x25')](_0x4162da,_0x481742,!![]);}catch(_0x24ea6b){return BPromise['reject'](_0x24ea6b);}return _0x4162da['save']();};}function saveUpdates(_0x3ccf30,_0x57bf64){return function(_0x50c0fc){if(_0x50c0fc){return _0x50c0fc[_0xc591('0x26')](_0x3ccf30)[_0xc591('0x27')](function(_0x4ec01f){return _0x4ec01f;});}return null;};}function removeEntity(_0x2d71a0,_0x13d86b){return function(_0x397b9f){if(_0x397b9f){return _0x397b9f['destroy']()[_0xc591('0x27')](function(){_0x2d71a0[_0xc591('0x1d')](0xcc)[_0xc591('0x28')]();});}};}function handleEntityNotFound(_0x2f2d65,_0x3c8611){return function(_0x4d8e88){if(!_0x4d8e88){_0x2f2d65[_0xc591('0x1c')](0x194);}return _0x4d8e88;};}function handleError(_0x3a5549,_0x4f7410){_0x4f7410=_0x4f7410||0x1f4;return function(_0xaaf778){logger['error'](_0xaaf778[_0xc591('0x29')]);if(_0xaaf778['name']){delete _0xaaf778[_0xc591('0x2a')];}_0x3a5549[_0xc591('0x1d')](_0x4f7410)[_0xc591('0x2b')](_0xaaf778);};}exports[_0xc591('0x2c')]=function(_0x36075a,_0x1f8650){var _0x4b3ab4={},_0x59c570={},_0x273e72={'count':0x0,'rows':[]};var _0x584c3e=_[_0xc591('0x2d')](db[_0xc591('0x2e')][_0xc591('0x2f')],function(_0x1d92aa){return{'name':_0x1d92aa['fieldName'],'type':_0x1d92aa[_0xc591('0x30')][_0xc591('0x31')]};});_0x59c570[_0xc591('0x32')]=_[_0xc591('0x2d')](_0x584c3e,_0xc591('0x2a'));_0x59c570[_0xc591('0x33')]=_[_0xc591('0x34')](_0x36075a['query']);_0x59c570['filters']=_[_0xc591('0x35')](_0x59c570[_0xc591('0x32')],_0x59c570[_0xc591('0x33')]);_0x4b3ab4['attributes']=_[_0xc591('0x35')](_0x59c570['model'],qs[_0xc591('0x36')](_0x36075a[_0xc591('0x33')][_0xc591('0x36')]));_0x4b3ab4[_0xc591('0x37')]=_0x4b3ab4[_0xc591('0x37')]['length']?_0x4b3ab4[_0xc591('0x37')]:_0x59c570[_0xc591('0x32')];if(!_0x36075a[_0xc591('0x33')][_0xc591('0x38')](_0xc591('0x39'))){_0x4b3ab4[_0xc591('0x20')]=qs[_0xc591('0x20')](_0x36075a[_0xc591('0x33')]['limit']);_0x4b3ab4[_0xc591('0x22')]=qs['offset'](_0x36075a[_0xc591('0x33')][_0xc591('0x22')]);}_0x4b3ab4['order']=qs[_0xc591('0x3a')](_0x36075a[_0xc591('0x33')][_0xc591('0x3a')]);_0x4b3ab4[_0xc591('0x3b')]=qs[_0xc591('0x3c')](_[_0xc591('0x3d')](_0x36075a['query'],_0x59c570[_0xc591('0x3c')]),_0x584c3e);if(_0x36075a[_0xc591('0x33')][_0xc591('0x3e')]){_0x4b3ab4[_0xc591('0x3b')]=_[_0xc591('0x3f')](_0x4b3ab4[_0xc591('0x3b')],{'$or':_['map'](_0x584c3e,function(_0x50ab60){if(_0x50ab60[_0xc591('0x30')]!==_0xc591('0x40')){var _0x170bed={};_0x170bed[_0x50ab60[_0xc591('0x2a')]]={'$like':'%'+_0x36075a[_0xc591('0x33')][_0xc591('0x3e')]+'%'};return _0x170bed;}})});}_0x4b3ab4=_['merge']({},_0x4b3ab4,_0x36075a['options']);var _0x3f8062={'where':_0x4b3ab4[_0xc591('0x3b')]};return db['Migration'][_0xc591('0x21')](_0x3f8062)[_0xc591('0x27')](function(_0x207917){_0x273e72[_0xc591('0x21')]=_0x207917;if(_0x36075a[_0xc591('0x33')][_0xc591('0x41')]){_0x4b3ab4[_0xc591('0x42')]=[{'all':!![]}];}return db[_0xc591('0x2e')][_0xc591('0x43')](_0x4b3ab4);})[_0xc591('0x27')](function(_0x2317e7){_0x273e72['rows']=_0x2317e7;return _0x273e72;})['then'](respondWithFilteredResult(_0x1f8650,_0x4b3ab4))[_0xc591('0x44')](handleError(_0x1f8650,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 88eecd6..36ee312 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 _0x5106=['moment','request-promise','path','rimraf','exports','define','migrations','lodash','../../config/logger'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x5106,0x103));var _0x6510=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x5106[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x6510('0x0'));var util=require('util');var logger=require(_0x6510('0x1'))('api');var moment=require(_0x6510('0x2'));var BPromise=require('bluebird');var rp=require(_0x6510('0x3'));var fs=require('fs');var path=require(_0x6510('0x4'));var rimraf=require(_0x6510('0x5'));var config=require('../../config/environment');var attributes=require('./migration.attributes');module[_0x6510('0x6')]=function(_0x25c0eb,_0x2f193c){return _0x25c0eb[_0x6510('0x7')]('Migration',attributes,{'tableName':_0x6510('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa783=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./migration.attributes','exports','define','Migration','migrations','lodash'];(function(_0x19d9c9,_0x512c5b){var _0x45ae60=function(_0x4350d6){while(--_0x4350d6){_0x19d9c9['push'](_0x19d9c9['shift']());}};_0x45ae60(++_0x512c5b);}(_0xa783,0x81));var _0x3a78=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xa783[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0x3a78('0x0'));var util=require(_0x3a78('0x1'));var logger=require(_0x3a78('0x2'))(_0x3a78('0x3'));var moment=require(_0x3a78('0x4'));var BPromise=require(_0x3a78('0x5'));var rp=require(_0x3a78('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3a78('0x7'));var config=require('../../config/environment');var attributes=require(_0x3a78('0x8'));module[_0x3a78('0x9')]=function(_0x7ac90d,_0xb27cdd){return _0x7ac90d[_0x3a78('0xa')](_0x3a78('0xb'),attributes,{'tableName':_0x3a78('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 767638a..6683843 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 _0xc961=['moment','bluebird','randomstring','ioredis','rpc','jayson/promise','http','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x47b15f,_0x103e93){var _0x55bf25=function(_0x51fe7f){while(--_0x51fe7f){_0x47b15f['push'](_0x47b15f['shift']());}};_0x55bf25(++_0x103e93);}(_0xc961,0x17a));var _0x1c96=function(_0x2831cf,_0x24babf){_0x2831cf=_0x2831cf-0x0;var _0x5ec206=_0xc961[_0x2831cf];return _0x5ec206;};'use strict';var _=require(_0x1c96('0x0'));var util=require(_0x1c96('0x1'));var moment=require(_0x1c96('0x2'));var BPromise=require(_0x1c96('0x3'));var rs=require(_0x1c96('0x4'));var fs=require('fs');var Redis=require(_0x1c96('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1c96('0x6'));var config=require('../../config/environment');var jayson=require(_0x1c96('0x7'));var client=jayson['client'][_0x1c96('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d4b23,_0x1f09ff,_0x307846){return new BPromise(function(_0x2e4fa5,_0x473a4c){return client['request'](_0x2d4b23,_0x307846)[_0x1c96('0x9')](function(_0x362e46){logger[_0x1c96('0xa')](_0x1c96('0xb'),_0x1f09ff,_0x1c96('0xc'));logger[_0x1c96('0xd')](_0x1c96('0xe'),_0x1f09ff,_0x1c96('0xc'),JSON[_0x1c96('0xf')](_0x362e46));if(_0x362e46[_0x1c96('0x10')]){if(_0x362e46[_0x1c96('0x10')][_0x1c96('0x11')]===0x1f4){logger['error'](_0x1c96('0xb'),_0x1f09ff,_0x362e46[_0x1c96('0x10')]['message']);return _0x473a4c(_0x362e46[_0x1c96('0x10')][_0x1c96('0x12')]);}logger[_0x1c96('0x10')](_0x1c96('0xb'),_0x1f09ff,_0x362e46[_0x1c96('0x10')][_0x1c96('0x12')]);return _0x2e4fa5(_0x362e46[_0x1c96('0x10')][_0x1c96('0x12')]);}else{logger[_0x1c96('0xa')](_0x1c96('0xb'),_0x1f09ff,_0x1c96('0xc'));_0x2e4fa5(_0x362e46[_0x1c96('0x13')][_0x1c96('0x12')]);}})['catch'](function(_0x32596e){logger['error'](_0x1c96('0xb'),_0x1f09ff,_0x32596e);_0x473a4c(_0x32596e);});});} \ No newline at end of file +var _0xdbfc=['client','http','then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xcce8ef,_0x3e7a2c){var _0x241f38=function(_0x10464e){while(--_0x10464e){_0xcce8ef['push'](_0xcce8ef['shift']());}};_0x241f38(++_0x3e7a2c);}(_0xdbfc,0x11d));var _0xcdbf=function(_0x3438fb,_0xde4967){_0x3438fb=_0x3438fb-0x0;var _0x2606b1=_0xdbfc[_0x3438fb];return _0x2606b1;};'use strict';var _=require(_0xcdbf('0x0'));var util=require(_0xcdbf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcdbf('0x2'));var fs=require('fs');var Redis=require(_0xcdbf('0x3'));var db=require(_0xcdbf('0x4'))['db'];var utils=require(_0xcdbf('0x5'));var logger=require(_0xcdbf('0x6'))(_0xcdbf('0x7'));var config=require(_0xcdbf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcdbf('0x9')][_0xcdbf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54aeaf,_0x369d61,_0x3c077d){return new BPromise(function(_0x409a4e,_0xf4dfb5){return client['request'](_0x54aeaf,_0x3c077d)[_0xcdbf('0xb')](function(_0x30e0a4){logger[_0xcdbf('0xc')](_0xcdbf('0xd'),_0x369d61,_0xcdbf('0xe'));logger['debug'](_0xcdbf('0xf'),_0x369d61,'request\x20sent',JSON[_0xcdbf('0x10')](_0x30e0a4));if(_0x30e0a4['error']){if(_0x30e0a4[_0xcdbf('0x11')]['code']===0x1f4){logger[_0xcdbf('0x11')](_0xcdbf('0xd'),_0x369d61,_0x30e0a4[_0xcdbf('0x11')]['message']);return _0xf4dfb5(_0x30e0a4[_0xcdbf('0x11')]['message']);}logger[_0xcdbf('0x11')](_0xcdbf('0xd'),_0x369d61,_0x30e0a4[_0xcdbf('0x11')][_0xcdbf('0x12')]);return _0x409a4e(_0x30e0a4[_0xcdbf('0x11')]['message']);}else{logger[_0xcdbf('0xc')](_0xcdbf('0xd'),_0x369d61,_0xcdbf('0xe'));_0x409a4e(_0x30e0a4[_0xcdbf('0x13')][_0xcdbf('0x12')]);}})[_0xcdbf('0x14')](function(_0x19b5bd){logger[_0xcdbf('0x11')](_0xcdbf('0xd'),_0x369d61,_0x19b5bd);_0xf4dfb5(_0x19b5bd);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 8022a33..12f7556 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 _0xf446=['multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./network.controller','get','isAuthenticated','put','/:id','update','delete','destroy'];(function(_0x54ccd7,_0x3bc3ce){var _0x4e667b=function(_0xab8fea){while(--_0xab8fea){_0x54ccd7['push'](_0x54ccd7['shift']());}};_0x4e667b(++_0x3bc3ce);}(_0xf446,0x1c0));var _0x6f44=function(_0x53cb8a,_0x27b5da){_0x53cb8a=_0x53cb8a-0x0;var _0x4f903d=_0xf446[_0x53cb8a];return _0x4f903d;};'use strict';var multer=require(_0x6f44('0x0'));var util=require('util');var path=require(_0x6f44('0x1'));var timeout=require(_0x6f44('0x2'));var express=require('express');var router=express[_0x6f44('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6f44('0x4'));var interaction=require(_0x6f44('0x5'));var config=require('../../config/environment');var controller=require(_0x6f44('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6f44('0x7')]('/:id',auth[_0x6f44('0x8')](),controller['show']);router['post']('/',auth[_0x6f44('0x8')](),controller['create']);router[_0x6f44('0x9')](_0x6f44('0xa'),auth[_0x6f44('0x8')](),controller[_0x6f44('0xb')]);router[_0x6f44('0xc')](_0x6f44('0xa'),auth[_0x6f44('0x8')](),controller[_0x6f44('0xd')]);module['exports']=router; \ No newline at end of file +var _0x06ae=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','update','destroy','util','path'];(function(_0x498ac3,_0x375d18){var _0x55ea69=function(_0x45b946){while(--_0x45b946){_0x498ac3['push'](_0x498ac3['shift']());}};_0x55ea69(++_0x375d18);}(_0x06ae,0x16e));var _0xe06a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x06ae[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xe06a('0x0'));var path=require(_0xe06a('0x1'));var timeout=require(_0xe06a('0x2'));var express=require(_0xe06a('0x3'));var router=express[_0xe06a('0x4')]();var fs_extra=require(_0xe06a('0x5'));var auth=require(_0xe06a('0x6'));var interaction=require(_0xe06a('0x7'));var config=require(_0xe06a('0x8'));var controller=require('./network.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe06a('0x9')]);router[_0xe06a('0xa')](_0xe06a('0xb'),auth[_0xe06a('0xc')](),controller[_0xe06a('0xd')]);router['post']('/',auth[_0xe06a('0xc')](),controller['create']);router['put'](_0xe06a('0xb'),auth['isAuthenticated'](),controller[_0xe06a('0xe')]);router['delete']('/:id',auth[_0xe06a('0xc')](),controller[_0xe06a('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 85ad69e..c7b9e5d 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 _0xcc01=['STRING','sequelize','turn'];(function(_0x344daf,_0x55cf9a){var _0x45fb51=function(_0x4418a3){while(--_0x4418a3){_0x344daf['push'](_0x344daf['shift']());}};_0x45fb51(++_0x55cf9a);}(_0xcc01,0x16c));var _0x1cc0=function(_0x4959f2,_0x3d1162){_0x4959f2=_0x4959f2-0x0;var _0x12acdc=_0xcc01[_0x4959f2];return _0x12acdc;};'use strict';var Sequelize=require(_0x1cc0('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('localnet','externip','stun',_0x1cc0('0x1'))},'value':{'type':Sequelize[_0x1cc0('0x2')]},'username':{'type':Sequelize[_0x1cc0('0x2')]},'password':{'type':Sequelize[_0x1cc0('0x2')]}}; \ No newline at end of file +var _0xf5c0=['exports','ENUM','externip','turn','STRING','sequelize'];(function(_0x4ae404,_0x4ca72d){var _0x45ddcd=function(_0x3f29ab){while(--_0x3f29ab){_0x4ae404['push'](_0x4ae404['shift']());}};_0x45ddcd(++_0x4ca72d);}(_0xf5c0,0x1eb));var _0x0f5c=function(_0x2c1ddd,_0x2a667f){_0x2c1ddd=_0x2c1ddd-0x0;var _0x49fa39=_0xf5c0[_0x2c1ddd];return _0x49fa39;};'use strict';var Sequelize=require(_0x0f5c('0x0'));module[_0x0f5c('0x1')]={'type':{'type':Sequelize[_0x0f5c('0x2')]('localnet',_0x0f5c('0x3'),'stun',_0x0f5c('0x4'))},'value':{'type':Sequelize[_0x0f5c('0x5')]},'username':{'type':Sequelize[_0x0f5c('0x5')]},'password':{'type':Sequelize[_0x0f5c('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 9c1a7dd..62d16bc 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 _0xa247=['rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','show','params','find','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','writeFileSync','util','path','ejs','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','client','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','json','undefined','limit','count','offset','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','map','Network'];(function(_0x5a4ff6,_0x3308ed){var _0x7e93b1=function(_0x1516eb){while(--_0x1516eb){_0x5a4ff6['push'](_0x5a4ff6['shift']());}};_0x7e93b1(++_0x3308ed);}(_0xa247,0x131));var _0x7a24=function(_0x494fe2,_0x2fd577){_0x494fe2=_0x494fe2-0x0;var _0x470dd1=_0xa247[_0x494fe2];return _0x470dd1;};'use strict';var util=require(_0x7a24('0x0'));var path=require(_0x7a24('0x1'));var ejs=require(_0x7a24('0x2'));var fs=require('fs');var _=require(_0x7a24('0x3'));var qs=require(_0x7a24('0x4'));var logger=require(_0x7a24('0x5'))('api');var config=require(_0x7a24('0x6'));var db=require(_0x7a24('0x7'))['db'];var jayson=require(_0x7a24('0x8'));var client=jayson[_0x7a24('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x554c65,_0x571c1a,_0x87d731,_0x111aa9){return new Promise(function(_0x3d561e,_0x4ff219){var _0x24ea40=_0x111aa9||client;return _0x24ea40[_0x7a24('0xa')](_0x554c65,_0x87d731)[_0x7a24('0xb')](function(_0x51898a){logger[_0x7a24('0xc')](_0x7a24('0xd'),_0x571c1a,_0x7a24('0xe'));logger[_0x7a24('0xf')]('Network,\x20%s,\x20%s,\x20%s',_0x571c1a,'request\x20sent',JSON[_0x7a24('0x10')](_0x51898a));if(_0x51898a[_0x7a24('0x11')]){if(_0x51898a['error'][_0x7a24('0x12')]===0x1f4){logger[_0x7a24('0x11')]('Network,\x20%s,\x20%s',_0x571c1a,_0x51898a[_0x7a24('0x11')][_0x7a24('0x13')]);return _0x4ff219(_0x51898a['error']['message']);}logger[_0x7a24('0x11')]('Network,\x20%s,\x20%s',_0x571c1a,_0x51898a[_0x7a24('0x11')][_0x7a24('0x13')]);return _0x3d561e(_0x51898a[_0x7a24('0x11')][_0x7a24('0x13')]);}else{logger[_0x7a24('0xc')](_0x7a24('0xd'),_0x571c1a,'request\x20sent');_0x3d561e(_0x51898a[_0x7a24('0x14')]['message']);}})[_0x7a24('0x15')](function(_0x597b15){logger[_0x7a24('0x11')](_0x7a24('0xd'),_0x571c1a,_0x597b15);_0x4ff219(_0x597b15);});});}function respondWithResult(_0x1348dd,_0x30e50c){_0x30e50c=_0x30e50c||0xc8;return function(_0x2c90a5){if(_0x2c90a5){return _0x1348dd[_0x7a24('0x16')](_0x30e50c)[_0x7a24('0x17')](_0x2c90a5);}};}function respondWithFilteredResult(_0x38c792,_0x123955){return function(_0x419004){if(_0x419004){var _0x288602=typeof _0x123955['offset']===_0x7a24('0x18')&&typeof _0x123955[_0x7a24('0x19')]===_0x7a24('0x18');var _0x15a2e9=_0x419004[_0x7a24('0x1a')];var _0x5be947=_0x288602?0x0:_0x123955[_0x7a24('0x1b')];var _0x56d4a0=_0x288602?_0x419004['count']:_0x123955[_0x7a24('0x1b')]+_0x123955[_0x7a24('0x19')];var _0x16f2ee;if(_0x56d4a0>=_0x15a2e9){_0x56d4a0=_0x15a2e9;_0x16f2ee=0xc8;}else{_0x16f2ee=0xce;}_0x38c792[_0x7a24('0x16')](_0x16f2ee);return _0x38c792['set'](_0x7a24('0x1c'),_0x5be947+'-'+_0x56d4a0+'/'+_0x15a2e9)[_0x7a24('0x17')](_0x419004);}return null;};}function saveUpdates(_0x3a4b99){return function(_0x1bfcef){if(_0x1bfcef){return _0x1bfcef[_0x7a24('0x1d')](_0x3a4b99)['then'](function(_0x263bf9){return _0x263bf9;});}return null;};}function removeEntity(_0x2f5533){return function(_0x3f994f){if(_0x3f994f){return _0x3f994f[_0x7a24('0x1e')]()[_0x7a24('0xb')](function(){_0x2f5533[_0x7a24('0x16')](0xcc)[_0x7a24('0x1f')]();});}};}function handleEntityNotFound(_0xdcbec4){return function(_0x235a67){if(!_0x235a67){_0xdcbec4[_0x7a24('0x20')](0x194);}return _0x235a67;};}function handleError(_0x2b4b77,_0x18d31c){_0x18d31c=_0x18d31c||0x1f4;return function(_0xfaf21e){logger[_0x7a24('0x11')](_0xfaf21e[_0x7a24('0x21')]);if(_0xfaf21e[_0x7a24('0x22')]){delete _0xfaf21e[_0x7a24('0x22')];}_0x2b4b77[_0x7a24('0x16')](_0x18d31c)[_0x7a24('0x23')](_0xfaf21e);};}exports[_0x7a24('0x24')]=function(_0x130b21,_0x5bc551){var _0x449b50={},_0x3bd8f7={},_0x1b1420={'count':0x0,'rows':[]};var _0x41c3d7=_[_0x7a24('0x25')](db[_0x7a24('0x26')][_0x7a24('0x27')],function(_0x48a05f){return{'name':_0x48a05f['fieldName'],'type':_0x48a05f[_0x7a24('0x28')][_0x7a24('0x29')]};});_0x3bd8f7[_0x7a24('0x2a')]=_['map'](_0x41c3d7,'name');_0x3bd8f7[_0x7a24('0x2b')]=_[_0x7a24('0x2c')](_0x130b21[_0x7a24('0x2b')]);_0x3bd8f7['filters']=_[_0x7a24('0x2d')](_0x3bd8f7[_0x7a24('0x2a')],_0x3bd8f7[_0x7a24('0x2b')]);_0x449b50['attributes']=_['intersection'](_0x3bd8f7[_0x7a24('0x2a')],qs[_0x7a24('0x2e')](_0x130b21[_0x7a24('0x2b')][_0x7a24('0x2e')]));_0x449b50[_0x7a24('0x2f')]=_0x449b50[_0x7a24('0x2f')][_0x7a24('0x30')]?_0x449b50['attributes']:_0x3bd8f7[_0x7a24('0x2a')];if(!_0x130b21[_0x7a24('0x2b')][_0x7a24('0x31')](_0x7a24('0x32'))){_0x449b50[_0x7a24('0x19')]=qs[_0x7a24('0x19')](_0x130b21[_0x7a24('0x2b')][_0x7a24('0x19')]);_0x449b50[_0x7a24('0x1b')]=qs['offset'](_0x130b21[_0x7a24('0x2b')]['offset']);}_0x449b50['order']=qs[_0x7a24('0x33')](_0x130b21['query'][_0x7a24('0x33')]);_0x449b50[_0x7a24('0x34')]=qs[_0x7a24('0x35')](_[_0x7a24('0x36')](_0x130b21[_0x7a24('0x2b')],_0x3bd8f7['filters']),_0x41c3d7);if(_0x130b21['query'][_0x7a24('0x37')]){_0x449b50['where']=_[_0x7a24('0x38')](_0x449b50[_0x7a24('0x34')],{'$or':_[_0x7a24('0x25')](_0x41c3d7,function(_0x219aac){if(_0x219aac[_0x7a24('0x28')]!=='VIRTUAL'){var _0x574199={};_0x574199[_0x219aac['name']]={'$like':'%'+_0x130b21[_0x7a24('0x2b')]['filter']+'%'};return _0x574199;}})});}_0x449b50=_['merge']({},_0x449b50,_0x130b21[_0x7a24('0x39')]);var _0x361c92={'where':_0x449b50[_0x7a24('0x34')]};return db[_0x7a24('0x26')][_0x7a24('0x1a')](_0x361c92)[_0x7a24('0xb')](function(_0x22df0b){_0x1b1420[_0x7a24('0x1a')]=_0x22df0b;if(_0x130b21['query'][_0x7a24('0x3a')]){_0x449b50['include']=[{'all':!![]}];}return db[_0x7a24('0x26')][_0x7a24('0x3b')](_0x449b50);})[_0x7a24('0xb')](function(_0x264ce2){_0x1b1420[_0x7a24('0x3c')]=_0x264ce2;return _0x1b1420;})['then'](respondWithFilteredResult(_0x5bc551,_0x449b50))['catch'](handleError(_0x5bc551,null));};exports[_0x7a24('0x3d')]=function(_0x27f0cd,_0x5e6cfe){var _0x89109={'raw':!![],'where':{'id':_0x27f0cd[_0x7a24('0x3e')]['id']}},_0x46019f={};_0x46019f[_0x7a24('0x2a')]=_['keys'](db['Network'][_0x7a24('0x27')]);_0x46019f['query']=_[_0x7a24('0x2c')](_0x27f0cd[_0x7a24('0x2b')]);_0x46019f[_0x7a24('0x35')]=_[_0x7a24('0x2d')](_0x46019f[_0x7a24('0x2a')],_0x46019f[_0x7a24('0x2b')]);_0x89109['attributes']=_[_0x7a24('0x2d')](_0x46019f[_0x7a24('0x2a')],qs['fields'](_0x27f0cd[_0x7a24('0x2b')][_0x7a24('0x2e')]));_0x89109['attributes']=_0x89109[_0x7a24('0x2f')][_0x7a24('0x30')]?_0x89109[_0x7a24('0x2f')]:_0x46019f[_0x7a24('0x2a')];if(_0x27f0cd[_0x7a24('0x2b')][_0x7a24('0x3a')]){_0x89109['include']=[{'all':!![]}];}_0x89109=_['merge']({},_0x89109,_0x27f0cd[_0x7a24('0x39')]);return db[_0x7a24('0x26')][_0x7a24('0x3f')](_0x89109)[_0x7a24('0xb')](handleEntityNotFound(_0x5e6cfe,null))[_0x7a24('0xb')](respondWithResult(_0x5e6cfe,null))[_0x7a24('0x15')](handleError(_0x5e6cfe,null));};exports[_0x7a24('0x40')]=function(_0x36ec6a,_0x60ed2){var _0x162685;return db[_0x7a24('0x26')]['create'](_0x36ec6a[_0x7a24('0x41')],{'raw':!![]})[_0x7a24('0xb')](function(_0x1bf12a){_0x162685=_0x1bf12a;return db[_0x7a24('0x26')][_0x7a24('0x3b')]({'where':{'type':_0x36ec6a[_0x7a24('0x41')][_0x7a24('0x28')]},'raw':!![]});})[_0x7a24('0xb')](function(_0x20ceed){if(_0x162685[_0x7a24('0x28')][_0x7a24('0x42')]()==_0x7a24('0x43')){var _0x1e06d3=fs[_0x7a24('0x44')](path[_0x7a24('0x45')](config[_0x7a24('0x46')],_0x7a24('0x47')),_0x7a24('0x48'));var _0x19b87f=ejs[_0x7a24('0x49')](_0x1e06d3,{'networks':_0x20ceed||[]});fs['writeFileSync'](_0x7a24('0x4a'),_0x19b87f);return respondWithRpcPromise(_0x7a24('0x4b'),_0x7a24('0x40'),{'module':'res_stun_monitor.so'});}else if(_0x162685[_0x7a24('0x28')]['toUpperCase']()==_0x7a24('0x4c')){var _0x42076a=fs[_0x7a24('0x44')](path[_0x7a24('0x45')](config[_0x7a24('0x46')],_0x7a24('0x4d')),'utf8');var _0x429ae5=ejs[_0x7a24('0x49')](_0x42076a,{'networks':_0x20ceed||[]});fs['writeFileSync'](_0x7a24('0x4e'),_0x429ae5);return respondWithRpcPromise(_0x7a24('0x4b'),_0x7a24('0x40'),{'module':_0x7a24('0x4f')});}else{var _0x3a8bf2=fs[_0x7a24('0x44')](path[_0x7a24('0x45')](config[_0x7a24('0x46')],_0x7a24('0x50')),_0x7a24('0x48'));var _0xfdd6c1=ejs[_0x7a24('0x49')](_0x3a8bf2,{'networks':_0x20ceed||[]});fs['writeFileSync'](util[_0x7a24('0x51')](_0x7a24('0x52'),_0x36ec6a[_0x7a24('0x41')][_0x7a24('0x28')][_0x7a24('0x53')]()),_0xfdd6c1);return respondWithRpcPromise(_0x7a24('0x4b'),'create',{'module':_0x7a24('0x54')});}})[_0x7a24('0xb')](function(){return _0x162685;})[_0x7a24('0xb')](respondWithResult(_0x60ed2,0xc9))[_0x7a24('0x15')](handleError(_0x60ed2,null));};exports[_0x7a24('0x1d')]=function(_0x20ce18,_0x13aa3b){var _0x5170cb;return db[_0x7a24('0x26')]['find']({'where':{'id':_0x20ce18[_0x7a24('0x3e')]['id']}})[_0x7a24('0xb')](handleEntityNotFound(_0x13aa3b,null))[_0x7a24('0xb')](saveUpdates(_0x20ce18[_0x7a24('0x41')],null))['then'](function(_0x288cda){if(_0x288cda){_0x5170cb=_0x288cda;return db['Network'][_0x7a24('0x3b')]({'where':{'type':_0x5170cb[_0x7a24('0x28')]},'raw':!![]});}return null;})[_0x7a24('0xb')](function(_0x7f33c3){if(_0x5170cb[_0x7a24('0x28')][_0x7a24('0x42')]()==_0x7a24('0x43')){var _0x4b3a18=fs[_0x7a24('0x44')](path['join'](config[_0x7a24('0x46')],_0x7a24('0x47')),_0x7a24('0x48'));var _0x2190ff=ejs[_0x7a24('0x49')](_0x4b3a18,{'networks':_0x7f33c3||[]});fs[_0x7a24('0x55')](_0x7a24('0x4a'),_0x2190ff);return respondWithRpcPromise(_0x7a24('0x4b'),_0x7a24('0x1d'),{'module':_0x7a24('0x4f')});}else if(_0x5170cb['type'][_0x7a24('0x42')]()==_0x7a24('0x4c')){var _0x2c54c9=fs[_0x7a24('0x44')](path['join'](config[_0x7a24('0x46')],'server/files/templates/turn_multiple.ejs'),_0x7a24('0x48'));var _0xf54515=ejs[_0x7a24('0x49')](_0x2c54c9,{'networks':_0x7f33c3||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0xf54515);return respondWithRpcPromise(_0x7a24('0x4b'),_0x7a24('0x1d'),{'module':'res_stun_monitor.so'});}else{var _0x151ce7=fs[_0x7a24('0x44')](path[_0x7a24('0x45')](config['root'],_0x7a24('0x50')),_0x7a24('0x48'));var _0x4e5593=ejs[_0x7a24('0x49')](_0x151ce7,{'networks':_0x7f33c3||[]});fs[_0x7a24('0x55')](util[_0x7a24('0x51')](_0x7a24('0x52'),_0x20ce18[_0x7a24('0x41')][_0x7a24('0x28')][_0x7a24('0x53')]()),_0x4e5593);return respondWithRpcPromise(_0x7a24('0x4b'),_0x7a24('0x1d'),{'module':_0x7a24('0x54')});}})[_0x7a24('0xb')](function(_0x1dafba){if(_0x1dafba){return _0x5170cb;}return null;})[_0x7a24('0xb')](respondWithResult(_0x13aa3b,null))[_0x7a24('0x15')](handleError(_0x13aa3b,null));};exports[_0x7a24('0x1e')]=function(_0x4e8b1a,_0x59b51b){var _0x2364b6;return db[_0x7a24('0x26')][_0x7a24('0x3f')]({'where':{'id':_0x4e8b1a[_0x7a24('0x3e')]['id']}})['then'](function(_0x2cba36){_0x2364b6=_0x2cba36;return _0x2cba36;})[_0x7a24('0xb')](handleEntityNotFound(_0x59b51b,null))[_0x7a24('0xb')](removeEntity(_0x59b51b,null))[_0x7a24('0xb')](function(){if(_0x2364b6){return db[_0x7a24('0x26')]['findAll']({'where':{'type':_0x2364b6[_0x7a24('0x28')]},'raw':!![]});}})[_0x7a24('0xb')](function(_0xf34c23){if(_0x2364b6['type'][_0x7a24('0x42')]()=='STUN'){var _0x1e71c2=fs['readFileSync'](path[_0x7a24('0x45')](config[_0x7a24('0x46')],_0x7a24('0x47')),_0x7a24('0x48'));var _0x44b6ec=ejs['render'](_0x1e71c2,{'networks':_0xf34c23||[]});fs[_0x7a24('0x55')](_0x7a24('0x4a'),_0x44b6ec);return respondWithRpcPromise(_0x7a24('0x4b'),_0x7a24('0x1e'),{'module':'res_stun_monitor.so'});}else if(_0x2364b6['type'][_0x7a24('0x42')]()==_0x7a24('0x4c')){var _0x42aae2=fs[_0x7a24('0x44')](path['join'](config[_0x7a24('0x46')],_0x7a24('0x4d')),_0x7a24('0x48'));var _0x224c8d=ejs[_0x7a24('0x49')](_0x42aae2,{'networks':_0xf34c23||[]});fs['writeFileSync'](_0x7a24('0x4e'),_0x224c8d);return respondWithRpcPromise('Reload',_0x7a24('0x1e'),{'module':'res_stun_monitor.so'});}else{var _0x3f0bd5=fs[_0x7a24('0x44')](path['join'](config['root'],_0x7a24('0x50')),_0x7a24('0x48'));var _0x33793f=ejs[_0x7a24('0x49')](_0x3f0bd5,{'networks':_0xf34c23||[]});fs[_0x7a24('0x55')](util[_0x7a24('0x51')](_0x7a24('0x52'),_0x2364b6['type'][_0x7a24('0x53')]()),_0x33793f);return respondWithRpcPromise(_0x7a24('0x4b'),_0x7a24('0x1e'),{'module':_0x7a24('0x54')});}})[_0x7a24('0x15')](handleError(_0x59b51b,null));}; \ No newline at end of file +var _0xb172=['rows','show','params','rawAttributes','keys','model','find','create','body','findAll','type','toUpperCase','STUN','join','root','render','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','readFileSync','utf8','writeFileSync','/etc/asterisk/turn_xcally.conf','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','server/files/templates/stun_multiple.ejs','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','destroy','format','util','path','ejs','lodash','../../config/logger','api','../../config/environment','jayson/promise','client','info','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','Network,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','count','set','Content-Range','update','then','end','sendStatus','stack','send','index','Network','fieldName','key','map','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x5ac8e5,_0x1501ea){var _0x30ef90=function(_0x56bc9a){while(--_0x56bc9a){_0x5ac8e5['push'](_0x5ac8e5['shift']());}};_0x30ef90(++_0x1501ea);}(_0xb172,0x17c));var _0x2b17=function(_0x213226,_0x18ecc7){_0x213226=_0x213226-0x0;var _0x3e5646=_0xb172[_0x213226];return _0x3e5646;};'use strict';var util=require(_0x2b17('0x0'));var path=require(_0x2b17('0x1'));var ejs=require(_0x2b17('0x2'));var fs=require('fs');var _=require(_0x2b17('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0x2b17('0x4'))(_0x2b17('0x5'));var config=require(_0x2b17('0x6'));var db=require('../../mysqldb')['db'];var jayson=require(_0x2b17('0x7'));var client=jayson[_0x2b17('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcbe35d,_0x6f76b1,_0x188629,_0x1b4791){return new Promise(function(_0xb42f41,_0x509199){var _0x94cf3b=_0x1b4791||client;return _0x94cf3b['request'](_0xcbe35d,_0x188629)['then'](function(_0x4f5f05){logger[_0x2b17('0x9')]('Network,\x20%s,\x20%s',_0x6f76b1,_0x2b17('0xa'));logger['debug'](_0x2b17('0xb'),_0x6f76b1,'request\x20sent',JSON[_0x2b17('0xc')](_0x4f5f05));if(_0x4f5f05[_0x2b17('0xd')]){if(_0x4f5f05[_0x2b17('0xd')]['code']===0x1f4){logger[_0x2b17('0xd')](_0x2b17('0xe'),_0x6f76b1,_0x4f5f05[_0x2b17('0xd')][_0x2b17('0xf')]);return _0x509199(_0x4f5f05[_0x2b17('0xd')][_0x2b17('0xf')]);}logger[_0x2b17('0xd')](_0x2b17('0xe'),_0x6f76b1,_0x4f5f05[_0x2b17('0xd')][_0x2b17('0xf')]);return _0xb42f41(_0x4f5f05[_0x2b17('0xd')][_0x2b17('0xf')]);}else{logger['info'](_0x2b17('0xe'),_0x6f76b1,_0x2b17('0xa'));_0xb42f41(_0x4f5f05[_0x2b17('0x10')][_0x2b17('0xf')]);}})[_0x2b17('0x11')](function(_0x1d8b53){logger[_0x2b17('0xd')](_0x2b17('0xe'),_0x6f76b1,_0x1d8b53);_0x509199(_0x1d8b53);});});}function respondWithResult(_0x139c18,_0x5c63cd){_0x5c63cd=_0x5c63cd||0xc8;return function(_0x109682){if(_0x109682){return _0x139c18[_0x2b17('0x12')](_0x5c63cd)[_0x2b17('0x13')](_0x109682);}};}function respondWithFilteredResult(_0x5d0a38,_0x3af5cb){return function(_0x585ec7){if(_0x585ec7){var _0x45a4fa=typeof _0x3af5cb[_0x2b17('0x14')]===_0x2b17('0x15')&&typeof _0x3af5cb['limit']==='undefined';var _0x4b6783=_0x585ec7[_0x2b17('0x16')];var _0x5d2af7=_0x45a4fa?0x0:_0x3af5cb[_0x2b17('0x14')];var _0x5776a8=_0x45a4fa?_0x585ec7[_0x2b17('0x16')]:_0x3af5cb['offset']+_0x3af5cb['limit'];var _0x5eb618;if(_0x5776a8>=_0x4b6783){_0x5776a8=_0x4b6783;_0x5eb618=0xc8;}else{_0x5eb618=0xce;}_0x5d0a38[_0x2b17('0x12')](_0x5eb618);return _0x5d0a38[_0x2b17('0x17')](_0x2b17('0x18'),_0x5d2af7+'-'+_0x5776a8+'/'+_0x4b6783)['json'](_0x585ec7);}return null;};}function saveUpdates(_0x4d850c){return function(_0x120a3d){if(_0x120a3d){return _0x120a3d[_0x2b17('0x19')](_0x4d850c)['then'](function(_0x35e7ab){return _0x35e7ab;});}return null;};}function removeEntity(_0x50829d){return function(_0x2cbca2){if(_0x2cbca2){return _0x2cbca2['destroy']()[_0x2b17('0x1a')](function(){_0x50829d['status'](0xcc)[_0x2b17('0x1b')]();});}};}function handleEntityNotFound(_0x312390){return function(_0xafc9d2){if(!_0xafc9d2){_0x312390[_0x2b17('0x1c')](0x194);}return _0xafc9d2;};}function handleError(_0x568546,_0x3a682b){_0x3a682b=_0x3a682b||0x1f4;return function(_0x32746e){logger[_0x2b17('0xd')](_0x32746e[_0x2b17('0x1d')]);if(_0x32746e['name']){delete _0x32746e['name'];}_0x568546[_0x2b17('0x12')](_0x3a682b)[_0x2b17('0x1e')](_0x32746e);};}exports[_0x2b17('0x1f')]=function(_0x244929,_0xb6f54a){var _0xa3f9f5={},_0x41e7d4={},_0x1d6d0e={'count':0x0,'rows':[]};var _0x206a52=_['map'](db[_0x2b17('0x20')]['rawAttributes'],function(_0x54833e){return{'name':_0x54833e[_0x2b17('0x21')],'type':_0x54833e['type'][_0x2b17('0x22')]};});_0x41e7d4['model']=_[_0x2b17('0x23')](_0x206a52,_0x2b17('0x24'));_0x41e7d4[_0x2b17('0x25')]=_['keys'](_0x244929[_0x2b17('0x25')]);_0x41e7d4[_0x2b17('0x26')]=_[_0x2b17('0x27')](_0x41e7d4['model'],_0x41e7d4['query']);_0xa3f9f5[_0x2b17('0x28')]=_[_0x2b17('0x27')](_0x41e7d4['model'],qs[_0x2b17('0x29')](_0x244929['query'][_0x2b17('0x29')]));_0xa3f9f5['attributes']=_0xa3f9f5[_0x2b17('0x28')][_0x2b17('0x2a')]?_0xa3f9f5[_0x2b17('0x28')]:_0x41e7d4['model'];if(!_0x244929[_0x2b17('0x25')][_0x2b17('0x2b')](_0x2b17('0x2c'))){_0xa3f9f5[_0x2b17('0x2d')]=qs['limit'](_0x244929[_0x2b17('0x25')][_0x2b17('0x2d')]);_0xa3f9f5[_0x2b17('0x14')]=qs[_0x2b17('0x14')](_0x244929['query'][_0x2b17('0x14')]);}_0xa3f9f5[_0x2b17('0x2e')]=qs[_0x2b17('0x2f')](_0x244929[_0x2b17('0x25')][_0x2b17('0x2f')]);_0xa3f9f5[_0x2b17('0x30')]=qs[_0x2b17('0x26')](_[_0x2b17('0x31')](_0x244929['query'],_0x41e7d4[_0x2b17('0x26')]),_0x206a52);if(_0x244929[_0x2b17('0x25')][_0x2b17('0x32')]){_0xa3f9f5[_0x2b17('0x30')]=_[_0x2b17('0x33')](_0xa3f9f5['where'],{'$or':_[_0x2b17('0x23')](_0x206a52,function(_0x209d6d){if(_0x209d6d['type']!=='VIRTUAL'){var _0x43d30c={};_0x43d30c[_0x209d6d[_0x2b17('0x24')]]={'$like':'%'+_0x244929[_0x2b17('0x25')]['filter']+'%'};return _0x43d30c;}})});}_0xa3f9f5=_[_0x2b17('0x33')]({},_0xa3f9f5,_0x244929[_0x2b17('0x34')]);var _0x1d9a7d={'where':_0xa3f9f5['where']};return db[_0x2b17('0x20')][_0x2b17('0x16')](_0x1d9a7d)['then'](function(_0x4669ce){_0x1d6d0e['count']=_0x4669ce;if(_0x244929['query'][_0x2b17('0x35')]){_0xa3f9f5[_0x2b17('0x36')]=[{'all':!![]}];}return db['Network']['findAll'](_0xa3f9f5);})[_0x2b17('0x1a')](function(_0x1469e6){_0x1d6d0e[_0x2b17('0x37')]=_0x1469e6;return _0x1d6d0e;})[_0x2b17('0x1a')](respondWithFilteredResult(_0xb6f54a,_0xa3f9f5))[_0x2b17('0x11')](handleError(_0xb6f54a,null));};exports[_0x2b17('0x38')]=function(_0x187407,_0x49d2ee){var _0x4b2081={'raw':!![],'where':{'id':_0x187407[_0x2b17('0x39')]['id']}},_0x4dacc7={};_0x4dacc7['model']=_['keys'](db[_0x2b17('0x20')][_0x2b17('0x3a')]);_0x4dacc7[_0x2b17('0x25')]=_[_0x2b17('0x3b')](_0x187407[_0x2b17('0x25')]);_0x4dacc7[_0x2b17('0x26')]=_[_0x2b17('0x27')](_0x4dacc7[_0x2b17('0x3c')],_0x4dacc7[_0x2b17('0x25')]);_0x4b2081[_0x2b17('0x28')]=_[_0x2b17('0x27')](_0x4dacc7[_0x2b17('0x3c')],qs['fields'](_0x187407[_0x2b17('0x25')][_0x2b17('0x29')]));_0x4b2081[_0x2b17('0x28')]=_0x4b2081['attributes']['length']?_0x4b2081[_0x2b17('0x28')]:_0x4dacc7[_0x2b17('0x3c')];if(_0x187407['query'][_0x2b17('0x35')]){_0x4b2081[_0x2b17('0x36')]=[{'all':!![]}];}_0x4b2081=_['merge']({},_0x4b2081,_0x187407[_0x2b17('0x34')]);return db[_0x2b17('0x20')][_0x2b17('0x3d')](_0x4b2081)['then'](handleEntityNotFound(_0x49d2ee,null))[_0x2b17('0x1a')](respondWithResult(_0x49d2ee,null))[_0x2b17('0x11')](handleError(_0x49d2ee,null));};exports[_0x2b17('0x3e')]=function(_0x28c707,_0xc04b17){var _0x13cd2a;return db[_0x2b17('0x20')][_0x2b17('0x3e')](_0x28c707[_0x2b17('0x3f')],{'raw':!![]})['then'](function(_0x23f364){_0x13cd2a=_0x23f364;return db[_0x2b17('0x20')][_0x2b17('0x40')]({'where':{'type':_0x28c707[_0x2b17('0x3f')][_0x2b17('0x41')]},'raw':!![]});})[_0x2b17('0x1a')](function(_0x3ec5f){if(_0x13cd2a['type'][_0x2b17('0x42')]()==_0x2b17('0x43')){var _0xb53c4a=fs['readFileSync'](path[_0x2b17('0x44')](config[_0x2b17('0x45')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x2d8317=ejs[_0x2b17('0x46')](_0xb53c4a,{'networks':_0x3ec5f||[]});fs['writeFileSync'](_0x2b17('0x47'),_0x2d8317);return respondWithRpcPromise('Reload','create',{'module':_0x2b17('0x48')});}else if(_0x13cd2a[_0x2b17('0x41')]['toUpperCase']()==_0x2b17('0x49')){var _0x530f3a=fs[_0x2b17('0x4a')](path[_0x2b17('0x44')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x2b17('0x4b'));var _0x4617a3=ejs[_0x2b17('0x46')](_0x530f3a,{'networks':_0x3ec5f||[]});fs[_0x2b17('0x4c')](_0x2b17('0x4d'),_0x4617a3);return respondWithRpcPromise('Reload',_0x2b17('0x3e'),{'module':_0x2b17('0x48')});}else{var _0xa752c5=fs['readFileSync'](path[_0x2b17('0x44')](config[_0x2b17('0x45')],'server/files/templates/network.ejs'),'utf8');var _0x5c6407=ejs['render'](_0xa752c5,{'networks':_0x3ec5f||[]});fs[_0x2b17('0x4c')](util['format'](_0x2b17('0x4e'),_0x28c707['body'][_0x2b17('0x41')][_0x2b17('0x4f')]()),_0x5c6407);return respondWithRpcPromise(_0x2b17('0x50'),_0x2b17('0x3e'),{'module':_0x2b17('0x51')});}})[_0x2b17('0x1a')](function(){return _0x13cd2a;})[_0x2b17('0x1a')](respondWithResult(_0xc04b17,0xc9))[_0x2b17('0x11')](handleError(_0xc04b17,null));};exports[_0x2b17('0x19')]=function(_0x5c8853,_0x4e6141){var _0x62480a;return db[_0x2b17('0x20')][_0x2b17('0x3d')]({'where':{'id':_0x5c8853[_0x2b17('0x39')]['id']}})[_0x2b17('0x1a')](handleEntityNotFound(_0x4e6141,null))[_0x2b17('0x1a')](saveUpdates(_0x5c8853[_0x2b17('0x3f')],null))[_0x2b17('0x1a')](function(_0x538ba0){if(_0x538ba0){_0x62480a=_0x538ba0;return db[_0x2b17('0x20')][_0x2b17('0x40')]({'where':{'type':_0x62480a['type']},'raw':!![]});}return null;})[_0x2b17('0x1a')](function(_0x332ff5){if(_0x62480a[_0x2b17('0x41')][_0x2b17('0x42')]()=='STUN'){var _0x1fd73f=fs[_0x2b17('0x4a')](path['join'](config[_0x2b17('0x45')],_0x2b17('0x52')),_0x2b17('0x4b'));var _0x3fbb5a=ejs[_0x2b17('0x46')](_0x1fd73f,{'networks':_0x332ff5||[]});fs[_0x2b17('0x4c')]('/etc/asterisk/stun_xcally.conf',_0x3fbb5a);return respondWithRpcPromise(_0x2b17('0x50'),'update',{'module':_0x2b17('0x48')});}else if(_0x62480a[_0x2b17('0x41')][_0x2b17('0x42')]()==_0x2b17('0x49')){var _0x44cbc2=fs[_0x2b17('0x4a')](path['join'](config[_0x2b17('0x45')],_0x2b17('0x53')),_0x2b17('0x4b'));var _0x217282=ejs[_0x2b17('0x46')](_0x44cbc2,{'networks':_0x332ff5||[]});fs[_0x2b17('0x4c')](_0x2b17('0x4d'),_0x217282);return respondWithRpcPromise('Reload','update',{'module':_0x2b17('0x48')});}else{var _0x904a93=fs[_0x2b17('0x4a')](path[_0x2b17('0x44')](config[_0x2b17('0x45')],_0x2b17('0x54')),_0x2b17('0x4b'));var _0x3a5885=ejs[_0x2b17('0x46')](_0x904a93,{'networks':_0x332ff5||[]});fs[_0x2b17('0x4c')](util['format'](_0x2b17('0x4e'),_0x5c8853['body'][_0x2b17('0x41')][_0x2b17('0x4f')]()),_0x3a5885);return respondWithRpcPromise(_0x2b17('0x50'),_0x2b17('0x19'),{'module':'chan_sip.so'});}})['then'](function(_0x5d7ab5){if(_0x5d7ab5){return _0x62480a;}return null;})[_0x2b17('0x1a')](respondWithResult(_0x4e6141,null))[_0x2b17('0x11')](handleError(_0x4e6141,null));};exports['destroy']=function(_0x45783e,_0x312272){var _0x37626e;return db[_0x2b17('0x20')]['find']({'where':{'id':_0x45783e['params']['id']}})[_0x2b17('0x1a')](function(_0x26c524){_0x37626e=_0x26c524;return _0x26c524;})[_0x2b17('0x1a')](handleEntityNotFound(_0x312272,null))['then'](removeEntity(_0x312272,null))[_0x2b17('0x1a')](function(){if(_0x37626e){return db[_0x2b17('0x20')][_0x2b17('0x40')]({'where':{'type':_0x37626e[_0x2b17('0x41')]},'raw':!![]});}})[_0x2b17('0x1a')](function(_0x27c469){if(_0x37626e[_0x2b17('0x41')][_0x2b17('0x42')]()==_0x2b17('0x43')){var _0x553989=fs[_0x2b17('0x4a')](path[_0x2b17('0x44')](config[_0x2b17('0x45')],'server/files/templates/stun_multiple.ejs'),_0x2b17('0x4b'));var _0x57e1f8=ejs[_0x2b17('0x46')](_0x553989,{'networks':_0x27c469||[]});fs[_0x2b17('0x4c')](_0x2b17('0x47'),_0x57e1f8);return respondWithRpcPromise('Reload','destroy',{'module':_0x2b17('0x48')});}else if(_0x37626e['type'][_0x2b17('0x42')]()=='TURN'){var _0x3fc003=fs[_0x2b17('0x4a')](path[_0x2b17('0x44')](config['root'],_0x2b17('0x53')),_0x2b17('0x4b'));var _0x4477fc=ejs[_0x2b17('0x46')](_0x3fc003,{'networks':_0x27c469||[]});fs[_0x2b17('0x4c')](_0x2b17('0x4d'),_0x4477fc);return respondWithRpcPromise(_0x2b17('0x50'),_0x2b17('0x55'),{'module':_0x2b17('0x48')});}else{var _0x26cf40=fs[_0x2b17('0x4a')](path['join'](config[_0x2b17('0x45')],_0x2b17('0x54')),_0x2b17('0x4b'));var _0x1f9041=ejs[_0x2b17('0x46')](_0x26cf40,{'networks':_0x27c469||[]});fs[_0x2b17('0x4c')](util[_0x2b17('0x56')]('/etc/asterisk/sip_xcally_%s.conf',_0x37626e['type']['toLowerCase']()),_0x1f9041);return respondWithRpcPromise('Reload',_0x2b17('0x55'),{'module':_0x2b17('0x51')});}})[_0x2b17('0x11')](handleError(_0x312272,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 9d78ee0..3ef4baf 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 _0x1d2d=['../../config/logger','api','moment','request-promise','../../config/environment','./network.attributes','exports','define','network','lodash','util'];(function(_0x243b6e,_0x1b2147){var _0x524da9=function(_0x242370){while(--_0x242370){_0x243b6e['push'](_0x243b6e['shift']());}};_0x524da9(++_0x1b2147);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x4f3632,_0x69181a){_0x4f3632=_0x4f3632-0x0;var _0x474a36=_0x1d2d[_0x4f3632];return _0x474a36;};'use strict';var _=require(_0xd1d2('0x0'));var util=require(_0xd1d2('0x1'));var logger=require(_0xd1d2('0x2'))(_0xd1d2('0x3'));var moment=require(_0xd1d2('0x4'));var BPromise=require('bluebird');var rp=require(_0xd1d2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd1d2('0x6'));var attributes=require(_0xd1d2('0x7'));module[_0xd1d2('0x8')]=function(_0x269613,_0x2f930d){return _0x269613[_0xd1d2('0x9')]('Network',attributes,{'tableName':_0xd1d2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0506=['network','lodash','util','../../config/logger','path','../../config/environment','define','Network'];(function(_0x1045b5,_0x3736f4){var _0x1fedfe=function(_0xf2c5fc){while(--_0xf2c5fc){_0x1045b5['push'](_0x1045b5['shift']());}};_0x1fedfe(++_0x3736f4);}(_0x0506,0x1d1));var _0x6050=function(_0x20a93c,_0x3d5b50){_0x20a93c=_0x20a93c-0x0;var _0x1abb6a=_0x0506[_0x20a93c];return _0x1abb6a;};'use strict';var _=require(_0x6050('0x0'));var util=require(_0x6050('0x1'));var logger=require(_0x6050('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6050('0x3'));var rimraf=require('rimraf');var config=require(_0x6050('0x4'));var attributes=require('./network.attributes');module['exports']=function(_0xfd44cc,_0x269be3){return _0xfd44cc[_0x6050('0x5')](_0x6050('0x6'),attributes,{'tableName':_0x6050('0x7'),'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 24d6a24..53ae817 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x294a1d,_0xadb3fd){var _0x725267=function(_0x3630fa){while(--_0x3630fa){_0x294a1d['push'](_0x294a1d['shift']());}};_0x725267(++_0xadb3fd);}(_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']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _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(_0x24fe58,_0x266f79){_0x24fe58=_0x24fe58-0x0;var _0x9c8eb7=_0x7a54[_0x24fe58];return _0x9c8eb7;};'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 ef7c5d6..da976a0 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 _0xa611=['update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelAccount.controller','get','index','describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/canned_answers','getApplications','/:id/interactions','/:id/users','getAgents','create','addDisposition','addAnswer','post','/:id/notify','notify','/:id/applications','addApplications','addAgents','/:id/send','send','/:id'];(function(_0x5e95e8,_0x30a5ac){var _0x1675d9=function(_0x37ede6){while(--_0x37ede6){_0x5e95e8['push'](_0x5e95e8['shift']());}};_0x1675d9(++_0x30a5ac);}(_0xa611,0x1cf));var _0x1a61=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa611[_0x5783f4];return _0x28e380;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1a61('0x0'));var timeout=require(_0x1a61('0x1'));var express=require(_0x1a61('0x2'));var router=express[_0x1a61('0x3')]();var fs_extra=require(_0x1a61('0x4'));var auth=require(_0x1a61('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1a61('0x6'));router[_0x1a61('0x7')]('/',auth['isAuthenticated'](),controller[_0x1a61('0x8')]);router[_0x1a61('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x1a61('0x9')]);router[_0x1a61('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x1a61('0xa')]);router[_0x1a61('0x7')](_0x1a61('0xb'),auth[_0x1a61('0xc')](),controller[_0x1a61('0xd')]);router['get'](_0x1a61('0xe'),auth[_0x1a61('0xc')](),controller['getAnswers']);router[_0x1a61('0x7')]('/:id/applications',auth[_0x1a61('0xc')](),controller[_0x1a61('0xf')]);router['get'](_0x1a61('0x10'),auth[_0x1a61('0xc')](),controller['getInteractions']);router['get'](_0x1a61('0x11'),auth[_0x1a61('0xc')](),controller[_0x1a61('0x12')]);router['post']('/',auth[_0x1a61('0xc')](),controller[_0x1a61('0x13')]);router['post']('/:id/dispositions',auth[_0x1a61('0xc')](),controller[_0x1a61('0x14')]);router['post'](_0x1a61('0xe'),auth[_0x1a61('0xc')](),controller[_0x1a61('0x15')]);router[_0x1a61('0x16')](_0x1a61('0x17'),controller[_0x1a61('0x18')]);router['post'](_0x1a61('0x19'),auth['isAuthenticated'](),controller[_0x1a61('0x1a')]);router['post'](_0x1a61('0x11'),auth['isAuthenticated'](),controller[_0x1a61('0x1b')]);router[_0x1a61('0x16')](_0x1a61('0x1c'),auth[_0x1a61('0xc')](),controller[_0x1a61('0x1d')]);router['put'](_0x1a61('0x1e'),auth[_0x1a61('0xc')](),controller[_0x1a61('0x1f')]);router[_0x1a61('0x20')](_0x1a61('0x1e'),auth[_0x1a61('0xc')](),controller[_0x1a61('0x21')]);router['delete'](_0x1a61('0xb'),auth[_0x1a61('0xc')](),controller[_0x1a61('0x22')]);router[_0x1a61('0x20')](_0x1a61('0xe'),auth[_0x1a61('0xc')](),controller[_0x1a61('0x23')]);router[_0x1a61('0x20')](_0x1a61('0x11'),auth[_0x1a61('0xc')](),controller[_0x1a61('0x24')]);module[_0x1a61('0x25')]=router; \ No newline at end of file +var _0x9870=['getAgents','post','create','addDisposition','addAnswer','/:id/notify','addApplications','addAgents','/:id/send','send','put','update','destroy','removeDispositions','delete','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/users'];(function(_0x23869c,_0x5abf59){var _0x449181=function(_0x2daace){while(--_0x2daace){_0x23869c['push'](_0x23869c['shift']());}};_0x449181(++_0x5abf59);}(_0x9870,0xe4));var _0x0987=function(_0x55b89b,_0x2b35b5){_0x55b89b=_0x55b89b-0x0;var _0x2797c7=_0x9870[_0x55b89b];return _0x2797c7;};'use strict';var multer=require(_0x0987('0x0'));var util=require(_0x0987('0x1'));var path=require(_0x0987('0x2'));var timeout=require(_0x0987('0x3'));var express=require(_0x0987('0x4'));var router=express[_0x0987('0x5')]();var fs_extra=require(_0x0987('0x6'));var auth=require(_0x0987('0x7'));var interaction=require(_0x0987('0x8'));var config=require(_0x0987('0x9'));var controller=require('./openchannelAccount.controller');router[_0x0987('0xa')]('/',auth[_0x0987('0xb')](),controller['index']);router['get'](_0x0987('0xc'),auth[_0x0987('0xb')](),controller[_0x0987('0xd')]);router['get'](_0x0987('0xe'),auth[_0x0987('0xb')](),controller[_0x0987('0xf')]);router['get'](_0x0987('0x10'),auth[_0x0987('0xb')](),controller[_0x0987('0x11')]);router['get'](_0x0987('0x12'),auth[_0x0987('0xb')](),controller[_0x0987('0x13')]);router[_0x0987('0xa')](_0x0987('0x14'),auth['isAuthenticated'](),controller[_0x0987('0x15')]);router['get']('/:id/interactions',auth[_0x0987('0xb')](),controller[_0x0987('0x16')]);router[_0x0987('0xa')](_0x0987('0x17'),auth['isAuthenticated'](),controller[_0x0987('0x18')]);router[_0x0987('0x19')]('/',auth['isAuthenticated'](),controller[_0x0987('0x1a')]);router['post'](_0x0987('0x10'),auth['isAuthenticated'](),controller[_0x0987('0x1b')]);router[_0x0987('0x19')](_0x0987('0x12'),auth[_0x0987('0xb')](),controller[_0x0987('0x1c')]);router[_0x0987('0x19')](_0x0987('0x1d'),controller['notify']);router['post'](_0x0987('0x14'),auth['isAuthenticated'](),controller[_0x0987('0x1e')]);router['post'](_0x0987('0x17'),auth[_0x0987('0xb')](),controller[_0x0987('0x1f')]);router[_0x0987('0x19')](_0x0987('0x20'),auth['isAuthenticated'](),controller[_0x0987('0x21')]);router[_0x0987('0x22')](_0x0987('0xe'),auth['isAuthenticated'](),controller[_0x0987('0x23')]);router['delete'](_0x0987('0xe'),auth[_0x0987('0xb')](),controller[_0x0987('0x24')]);router['delete'](_0x0987('0x10'),auth[_0x0987('0xb')](),controller[_0x0987('0x25')]);router[_0x0987('0x26')](_0x0987('0x12'),auth['isAuthenticated'](),controller[_0x0987('0x27')]);router[_0x0987('0x26')](_0x0987('0x17'),auth['isAuthenticated'](),controller[_0x0987('0x28')]);module[_0x0987('0x29')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index b703591..2081346 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 _0xa24d=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x579f8d,_0x49a61e){var _0x4f2d5b=function(_0x1dad1e){while(--_0x1dad1e){_0x579f8d['push'](_0x579f8d['shift']());}};_0x4f2d5b(++_0x49a61e);}(_0xa24d,0x17a));var _0xda24=function(_0x2d9535,_0x4bc592){_0x2d9535=_0x2d9535-0x0;var _0xb4e710=_0xa24d[_0x2d9535];return _0xb4e710;};'use strict';var Sequelize=require(_0xda24('0x0'));var rs=require('randomstring');module[_0xda24('0x1')]={'name':{'type':Sequelize[_0xda24('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xda24('0x2')]},'token':{'type':Sequelize[_0xda24('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0xda24('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xda24('0x3')],'defaultValue':function(){return _0xda24('0x4');}},'notificationSound':{'type':Sequelize[_0xda24('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xda24('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xda24('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xda24('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xda24('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xda24('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xda24('0x5')],'defaultValue':![],'comment':_0xda24('0x8'),'set':function(_0x5ac132){if(!_0x5ac132)this['setDataValue'](_0xda24('0x9'),null);this[_0xda24('0xa')](_0xda24('0xb'),_0x5ac132);}}}; \ No newline at end of file +var _0xd8ff=['STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name'];(function(_0x2b3cc5,_0x325f34){var _0x378ccb=function(_0x4d7d95){while(--_0x4d7d95){_0x2b3cc5['push'](_0x2b3cc5['shift']());}};_0x378ccb(++_0x325f34);}(_0xd8ff,0x164));var _0xfd8f=function(_0xb2320d,_0xe69d49){_0xb2320d=_0xb2320d-0x0;var _0x9db91a=_0xd8ff[_0xb2320d];return _0x9db91a;};'use strict';var Sequelize=require(_0xfd8f('0x0'));var rs=require(_0xfd8f('0x1'));module[_0xfd8f('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xfd8f('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xfd8f('0x4')]},'token':{'type':Sequelize[_0xfd8f('0x4')],'defaultValue':function(){return rs[_0xfd8f('0x5')]();}},'replyUri':{'type':Sequelize[_0xfd8f('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xfd8f('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xfd8f('0x6')],'defaultValue':function(){return _0xfd8f('0x7');}},'notificationSound':{'type':Sequelize[_0xfd8f('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfd8f('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfd8f('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xfd8f('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfd8f('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfd8f('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xfd8f('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5e5475){if(!_0x5e5475)this[_0xfd8f('0xa')]('mandatoryDispositionPauseId',null);this[_0xfd8f('0xa')](_0xfd8f('0xb'),_0x5e5475);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 089ce6c..f82a8d2 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 _0x86dd=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','findOne','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','DESC','Applications','applications','orderBy','asc','account','Contacts','ListId','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','notify','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','OpenchannelApplication','bulkCreate','findAndCountAll','priority','finally','json','order','getApplications','getInteractions','Contact','User','Owner','fullname','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','info','catch','status','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','send','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','Pause','mandatoryDispositionPause','include','find','create'];(function(_0xd16a56,_0x56d8f3){var _0x561d0d=function(_0x182c59){while(--_0x182c59){_0xd16a56['push'](_0xd16a56['shift']());}};_0x561d0d(++_0x56d8f3);}(_0x86dd,0x1ee));var _0xd86d=function(_0x3a96d4,_0x4ddd62){_0x3a96d4=_0x3a96d4-0x0;var _0x1de10c=_0x86dd[_0x3a96d4];return _0x1de10c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd86d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd86d('0x1'));var rp=require(_0xd86d('0x2'));var moment=require(_0xd86d('0x3'));var BPromise=require(_0xd86d('0x4'));var Mustache=require(_0xd86d('0x5'));var util=require(_0xd86d('0x6'));var path=require(_0xd86d('0x7'));var sox=require(_0xd86d('0x8'));var csv=require(_0xd86d('0x9'));var ejs=require(_0xd86d('0xa'));var fs=require('fs');var fs_extra=require(_0xd86d('0xb'));var _=require(_0xd86d('0xc'));var squel=require('squel');var crypto=require(_0xd86d('0xd'));var jsforce=require(_0xd86d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd86d('0x9'));var querystring=require(_0xd86d('0xf'));var Papa=require(_0xd86d('0x10'));var Redis=require(_0xd86d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd86d('0x12'));var as=require(_0xd86d('0x13'));var hardwareService=require(_0xd86d('0x14'));var logger=require(_0xd86d('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xd86d('0x16'));var licenseUtil=require(_0xd86d('0x17'));var db=require(_0xd86d('0x18'))['db'];config[_0xd86d('0x19')]=_[_0xd86d('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd86d('0x19')]));require(_0xd86d('0x1b'))[_0xd86d('0x1c')](socket);var jayson=require(_0xd86d('0x1d'));var client=jayson[_0xd86d('0x1e')][_0xd86d('0x1f')]({'port':0x232c});var client9002=jayson[_0xd86d('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d2b33,_0x2cc4d9,_0x38dc37,_0x413fb8){return new BPromise(function(_0x34ee10,_0x26f3c4){var _0x1b176e=_0x413fb8||client;return _0x1b176e[_0xd86d('0x20')](_0x1d2b33,_0x38dc37)[_0xd86d('0x21')](function(_0x21efda){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x2cc4d9,_0xd86d('0x22'));logger[_0xd86d('0x23')](_0xd86d('0x24'),_0x2cc4d9,'request\x20sent',JSON[_0xd86d('0x25')](_0x21efda));if(_0x21efda[_0xd86d('0x26')]){if(_0x21efda[_0xd86d('0x26')]['code']===0x1f4){logger[_0xd86d('0x26')](_0xd86d('0x27'),_0x2cc4d9,_0x21efda['error'][_0xd86d('0x28')]);return _0x26f3c4(_0x21efda[_0xd86d('0x26')][_0xd86d('0x28')]);}logger['error'](_0xd86d('0x27'),_0x2cc4d9,_0x21efda[_0xd86d('0x26')][_0xd86d('0x28')]);return _0x34ee10(_0x21efda[_0xd86d('0x26')]['message']);}else{logger[_0xd86d('0x29')](_0xd86d('0x27'),_0x2cc4d9,'request\x20sent');_0x34ee10(_0x21efda['result']['message']);}})[_0xd86d('0x2a')](function(_0x5d0e0c){logger[_0xd86d('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x2cc4d9,_0x5d0e0c);_0x26f3c4(_0x5d0e0c);});});}function respondWithStatusCode(_0x48c7cc,_0x327a2e){_0x327a2e=_0x327a2e||0xcc;return function(_0x3e4e3f){if(_0x3e4e3f){return _0x48c7cc['sendStatus'](_0x327a2e);}return _0x48c7cc[_0xd86d('0x2b')](_0x327a2e)['end']();};}function respondWithResult(_0x38e4b3,_0x4b99f7){_0x4b99f7=_0x4b99f7||0xc8;return function(_0x593007){if(_0x593007){return _0x38e4b3['status'](_0x4b99f7)['json'](_0x593007);}};}function respondWithFilteredResult(_0x345bb7,_0x5daa94){return function(_0x2897b5){if(_0x2897b5){var _0x525a87=typeof _0x5daa94[_0xd86d('0x2c')]===_0xd86d('0x2d')&&typeof _0x5daa94[_0xd86d('0x2e')]===_0xd86d('0x2d');var _0x5e02a9=_0x2897b5[_0xd86d('0x2f')];var _0x260219=_0x525a87?0x0:_0x5daa94[_0xd86d('0x2c')];var _0x2dd920=_0x525a87?_0x2897b5[_0xd86d('0x2f')]:_0x5daa94[_0xd86d('0x2c')]+_0x5daa94['limit'];var _0x222d22;if(_0x2dd920>=_0x5e02a9){_0x2dd920=_0x5e02a9;_0x222d22=0xc8;}else{_0x222d22=0xce;}_0x345bb7[_0xd86d('0x2b')](_0x222d22);return _0x345bb7[_0xd86d('0x30')](_0xd86d('0x31'),_0x260219+'-'+_0x2dd920+'/'+_0x5e02a9)['json'](_0x2897b5);}return null;};}function patchUpdates(_0x4f3bec){return function(_0x2b3653){try{jsonpatch['apply'](_0x2b3653,_0x4f3bec,!![]);}catch(_0x3531b0){return BPromise[_0xd86d('0x32')](_0x3531b0);}return _0x2b3653[_0xd86d('0x33')]();};}function saveUpdates(_0xcfabcf,_0x5145f7){return function(_0x392110){if(_0x392110){return _0x392110[_0xd86d('0x34')](_0xcfabcf)['then'](function(_0x23e985){return _0x23e985;});}return null;};}function removeEntity(_0x2efe2e,_0x3cd8f7){return function(_0x5eb8f3){if(_0x5eb8f3){return _0x5eb8f3[_0xd86d('0x35')]()['then'](function(){var _0x1fbdf6=_0x5eb8f3[_0xd86d('0x36')]({'plain':!![]});var _0x3a1673=_0xd86d('0x37');return db[_0xd86d('0x38')]['destroy']({'where':{'type':_0x3a1673,'resourceId':_0x1fbdf6['id']}})[_0xd86d('0x21')](function(){return _0x5eb8f3;});})['then'](function(){_0x2efe2e[_0xd86d('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20a77f,_0x3c5241){return function(_0x3cda02){if(!_0x3cda02){_0x20a77f[_0xd86d('0x39')](0x194);}return _0x3cda02;};}function handleError(_0x8ff892,_0x54527f){_0x54527f=_0x54527f||0x1f4;return function(_0x112eb3){logger['error'](_0x112eb3[_0xd86d('0x3a')]);if(_0x112eb3['name']){delete _0x112eb3[_0xd86d('0x3b')];}_0x8ff892['status'](_0x54527f)[_0xd86d('0x3c')](_0x112eb3);};}exports['index']=function(_0x49ddbc,_0x3f0c60){var _0x16576c={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1c087b={},_0x289964={'count':0x0,'rows':[]};var _0x35c2b6=_[_0xd86d('0x3d')](db[_0xd86d('0x3e')][_0xd86d('0x3f')],function(_0x47d10e){return{'name':_0x47d10e[_0xd86d('0x40')],'type':_0x47d10e[_0xd86d('0x41')][_0xd86d('0x42')]};});_0x1c087b[_0xd86d('0x43')]=_[_0xd86d('0x3d')](_0x35c2b6,_0xd86d('0x3b'));_0x1c087b[_0xd86d('0x44')]=_[_0xd86d('0x45')](_0x49ddbc['query']);_0x1c087b[_0xd86d('0x46')]=_['intersection'](_0x1c087b[_0xd86d('0x43')],_0x1c087b[_0xd86d('0x44')]);_0x16576c[_0xd86d('0x47')]=_[_0xd86d('0x48')](_0x1c087b['model'],qs[_0xd86d('0x49')](_0x49ddbc[_0xd86d('0x44')][_0xd86d('0x49')]));_0x16576c[_0xd86d('0x47')]=_0x16576c[_0xd86d('0x47')][_0xd86d('0x4a')]?_0x16576c[_0xd86d('0x47')]:_0x1c087b['model'];if(!_0x49ddbc[_0xd86d('0x44')][_0xd86d('0x4b')](_0xd86d('0x4c'))){_0x16576c[_0xd86d('0x2e')]=qs[_0xd86d('0x2e')](_0x49ddbc[_0xd86d('0x44')][_0xd86d('0x2e')]);_0x16576c['offset']=qs[_0xd86d('0x2c')](_0x49ddbc[_0xd86d('0x44')]['offset']);}_0x16576c['order']=qs['sort'](_0x49ddbc[_0xd86d('0x44')][_0xd86d('0x4d')]);_0x16576c['where']=qs[_0xd86d('0x46')](_[_0xd86d('0x4e')](_0x49ddbc[_0xd86d('0x44')],_0x1c087b[_0xd86d('0x46')]),_0x35c2b6);if(_0x49ddbc[_0xd86d('0x44')][_0xd86d('0x4f')]){_0x16576c[_0xd86d('0x50')]=_['merge'](_0x16576c['where'],{'$or':_[_0xd86d('0x3d')](_0x35c2b6,function(_0xdcdbc1){if(_0xdcdbc1['type']!==_0xd86d('0x51')){var _0x7bbb3={};_0x7bbb3[_0xdcdbc1[_0xd86d('0x3b')]]={'$like':'%'+_0x49ddbc[_0xd86d('0x44')]['filter']+'%'};return _0x7bbb3;}})});}_0x16576c=_[_0xd86d('0x52')]({},_0x16576c,_0x49ddbc[_0xd86d('0x53')]);var _0x184e0b={'where':_0x16576c['where']};return db[_0xd86d('0x3e')][_0xd86d('0x2f')](_0x184e0b)[_0xd86d('0x21')](function(_0x503a02){_0x289964[_0xd86d('0x2f')]=_0x503a02;if(_0x49ddbc[_0xd86d('0x44')][_0xd86d('0x54')]){_0x16576c['include']=[{'all':!![]}];}return db[_0xd86d('0x3e')][_0xd86d('0x55')](_0x16576c);})['then'](function(_0x36d17e){_0x289964[_0xd86d('0x56')]=_0x36d17e;return _0x289964;})[_0xd86d('0x21')](respondWithFilteredResult(_0x3f0c60,_0x16576c))[_0xd86d('0x2a')](handleError(_0x3f0c60,null));};exports[_0xd86d('0x57')]=function(_0x4a76d1,_0x53f704){var _0x33963a={'raw':![],'where':{'id':_0x4a76d1[_0xd86d('0x58')]['id']},'include':[{'model':db[_0xd86d('0x59')],'as':_0xd86d('0x5a')}]},_0x2b364b={};_0x2b364b[_0xd86d('0x43')]=_[_0xd86d('0x45')](db['OpenchannelAccount'][_0xd86d('0x3f')]);_0x2b364b[_0xd86d('0x44')]=_[_0xd86d('0x45')](_0x4a76d1['query']);_0x2b364b[_0xd86d('0x46')]=_[_0xd86d('0x48')](_0x2b364b[_0xd86d('0x43')],_0x2b364b[_0xd86d('0x44')]);_0x33963a[_0xd86d('0x47')]=_[_0xd86d('0x48')](_0x2b364b[_0xd86d('0x43')],qs['fields'](_0x4a76d1[_0xd86d('0x44')][_0xd86d('0x49')]));_0x33963a[_0xd86d('0x47')]=_0x33963a[_0xd86d('0x47')]['length']?_0x33963a['attributes']:_0x2b364b[_0xd86d('0x43')];if(_0x4a76d1[_0xd86d('0x44')][_0xd86d('0x54')]){_0x33963a[_0xd86d('0x5b')]=[{'all':!![]}];}_0x33963a=_[_0xd86d('0x52')]({},_0x33963a,_0x4a76d1[_0xd86d('0x53')]);return db[_0xd86d('0x3e')][_0xd86d('0x5c')](_0x33963a)[_0xd86d('0x21')](handleEntityNotFound(_0x53f704,null))[_0xd86d('0x21')](respondWithResult(_0x53f704,null))[_0xd86d('0x2a')](handleError(_0x53f704,null));};exports[_0xd86d('0x5d')]=function(_0x3e279b,_0x2f7151){return db[_0xd86d('0x3e')][_0xd86d('0x5d')](_0x3e279b[_0xd86d('0x5e')],{})['then'](function(_0x14f034){var _0x3f8de2=_0x3e279b[_0xd86d('0x5f')][_0xd86d('0x36')]({'plain':!![]});if(!_0x3f8de2)throw new Error(_0xd86d('0x60'));if(_0x3f8de2[_0xd86d('0x61')]===_0xd86d('0x5f')){var _0x31619f=_0x14f034[_0xd86d('0x36')]({'plain':!![]});var _0x2036eb='OpenchannelAccounts';return db[_0xd86d('0x62')][_0xd86d('0x5c')]({'where':{'name':_0x2036eb,'userProfileId':_0x3f8de2[_0xd86d('0x63')]},'raw':!![]})[_0xd86d('0x21')](function(_0x442067){if(_0x442067&&_0x442067['autoAssociation']===0x0){return db[_0xd86d('0x38')][_0xd86d('0x5d')]({'name':_0x31619f['name'],'resourceId':_0x31619f['id'],'type':_0x442067[_0xd86d('0x3b')],'sectionId':_0x442067['id']},{})['then'](function(){return _0x14f034;});}else{return _0x14f034;}})['catch'](function(_0x535f69){logger[_0xd86d('0x26')](_0xd86d('0x64'),_0x535f69);throw _0x535f69;});}return _0x14f034;})['then'](respondWithResult(_0x2f7151,0xc9))[_0xd86d('0x2a')](handleError(_0x2f7151,null));};exports[_0xd86d('0x34')]=function(_0x18e8f6,_0x22f111){if(_0x18e8f6[_0xd86d('0x5e')]['id']){delete _0x18e8f6['body']['id'];}return db[_0xd86d('0x3e')][_0xd86d('0x5c')]({'where':{'id':_0x18e8f6['params']['id']},'include':[{'model':db[_0xd86d('0x59')],'as':'mandatoryDispositionPause'}]})[_0xd86d('0x21')](handleEntityNotFound(_0x22f111,null))[_0xd86d('0x21')](saveUpdates(_0x18e8f6['body'],null))[_0xd86d('0x21')](respondWithResult(_0x22f111,null))[_0xd86d('0x2a')](handleError(_0x22f111,null));};exports[_0xd86d('0x35')]=function(_0x2a51a7,_0x16192b){return db[_0xd86d('0x3e')][_0xd86d('0x5c')]({'where':{'id':_0x2a51a7[_0xd86d('0x58')]['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x16192b,null))[_0xd86d('0x21')](removeEntity(_0x16192b,null))['catch'](handleError(_0x16192b,null));};exports['describe']=function(_0x2396d4,_0x6a1cd5){return db['OpenchannelAccount'][_0xd86d('0x65')]()['then'](respondWithResult(_0x6a1cd5,null))[_0xd86d('0x2a')](handleError(_0x6a1cd5,null));};exports[_0xd86d('0x66')]=function(_0x48db68,_0x138af7,_0x1c2526){if(_0x48db68['body']['id']){delete _0x48db68[_0xd86d('0x5e')]['id'];}return db[_0xd86d('0x3e')]['find']({'where':{'id':_0x48db68[_0xd86d('0x58')]['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x138af7,null))[_0xd86d('0x21')](function(_0x5ac9d5){if(_0x5ac9d5){_0x48db68[_0xd86d('0x5e')][_0xd86d('0x67')]=_0x5ac9d5['id'];return db[_0xd86d('0x68')][_0xd86d('0x5d')](_0x48db68['body']);}})[_0xd86d('0x21')](respondWithResult(_0x138af7,null))['catch'](handleError(_0x138af7,null));};exports['getDispositions']=function(_0x59ad08,_0x294e7f,_0x355887){var _0x52fd15={'raw':![],'where':{}};var _0x4fc64c={};var _0x47fa7b={'count':0x0,'rows':[]};return db[_0xd86d('0x3e')][_0xd86d('0x69')]({'where':{'id':_0x59ad08[_0xd86d('0x58')]['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x294e7f,null))['then'](function(_0x2a82fe){if(_0x2a82fe){_0x4fc64c[_0xd86d('0x43')]=_[_0xd86d('0x45')](db[_0xd86d('0x68')][_0xd86d('0x3f')]);_0x4fc64c[_0xd86d('0x44')]=_[_0xd86d('0x45')](_0x59ad08[_0xd86d('0x44')]);_0x4fc64c[_0xd86d('0x46')]=_[_0xd86d('0x48')](_0x4fc64c[_0xd86d('0x43')],_0x4fc64c[_0xd86d('0x44')]);_0x52fd15[_0xd86d('0x47')]=_[_0xd86d('0x48')](_0x4fc64c['model'],qs[_0xd86d('0x49')](_0x59ad08['query'][_0xd86d('0x49')]));_0x52fd15['attributes']=_0x52fd15[_0xd86d('0x47')][_0xd86d('0x4a')]?_0x52fd15['attributes']:_0x4fc64c['model'];if(!_0x59ad08[_0xd86d('0x44')][_0xd86d('0x4b')](_0xd86d('0x4c'))){_0x52fd15['limit']=qs['limit'](_0x59ad08[_0xd86d('0x44')]['limit']);_0x52fd15[_0xd86d('0x2c')]=qs[_0xd86d('0x2c')](_0x59ad08[_0xd86d('0x44')][_0xd86d('0x2c')]);}_0x52fd15['order']=qs[_0xd86d('0x4d')](_0x59ad08[_0xd86d('0x44')]['sort']);_0x52fd15[_0xd86d('0x50')]=qs['filters'](_[_0xd86d('0x4e')](_0x59ad08[_0xd86d('0x44')],_0x4fc64c[_0xd86d('0x46')]));_0x52fd15['where']['OpenchannelAccountId']=_0x2a82fe['id'];if(_0x59ad08[_0xd86d('0x44')][_0xd86d('0x4f')]){_0x52fd15[_0xd86d('0x50')]=_[_0xd86d('0x52')](_0x52fd15['where'],{'$or':_[_0xd86d('0x3d')](_0x52fd15[_0xd86d('0x47')],function(_0x484ce2){var _0x1af19b={};_0x1af19b[_0x484ce2]={'$like':'%'+_0x59ad08[_0xd86d('0x44')][_0xd86d('0x4f')]+'%'};return _0x1af19b;})});}_0x52fd15=_[_0xd86d('0x52')]({},_0x52fd15,_0x59ad08[_0xd86d('0x53')]);return db[_0xd86d('0x68')][_0xd86d('0x2f')]({'where':_0x52fd15[_0xd86d('0x50')]})['then'](function(_0x5b323a){_0x47fa7b[_0xd86d('0x2f')]=_0x5b323a;if(_0x59ad08[_0xd86d('0x44')]['includeAll']){_0x52fd15[_0xd86d('0x5b')]=[{'all':!![]}];}return db['Disposition'][_0xd86d('0x55')](_0x52fd15);})[_0xd86d('0x21')](function(_0x9964cb){_0x47fa7b['rows']=_0x9964cb;return _0x47fa7b;});}})[_0xd86d('0x21')](respondWithFilteredResult(_0x294e7f,_0x52fd15))['catch'](handleError(_0x294e7f,null));};exports['removeDispositions']=function(_0x5aa05a,_0x59928a,_0x3f249d){return db[_0xd86d('0x3e')]['find']({'where':{'id':_0x5aa05a[_0xd86d('0x58')]['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x59928a,null))[_0xd86d('0x21')](function(_0x3fdfc5){if(_0x3fdfc5){return _0x3fdfc5['removeDispositions'](_0x5aa05a[_0xd86d('0x44')][_0xd86d('0x6a')]);}})[_0xd86d('0x21')](respondWithStatusCode(_0x59928a,null))[_0xd86d('0x2a')](handleError(_0x59928a,null));};exports[_0xd86d('0x6b')]=function(_0x24d986,_0x1f4286,_0x4171b3){if(_0x24d986[_0xd86d('0x5e')]['id']){delete _0x24d986[_0xd86d('0x5e')]['id'];}return db[_0xd86d('0x3e')][_0xd86d('0x5c')]({'where':{'id':_0x24d986[_0xd86d('0x58')]['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x1f4286,null))[_0xd86d('0x21')](function(_0x5dda48){if(_0x5dda48){_0x24d986['body'][_0xd86d('0x67')]=_0x5dda48['id'];return db['CannedAnswer'][_0xd86d('0x5d')](_0x24d986[_0xd86d('0x5e')]);}})[_0xd86d('0x21')](respondWithResult(_0x1f4286,null))['catch'](handleError(_0x1f4286,null));};exports[_0xd86d('0x6c')]=function(_0x465c22,_0x561ee9,_0x240b6a){var _0x281f25={'raw':![],'where':{}};var _0x576c11={};var _0x250f01={'count':0x0,'rows':[]};return db[_0xd86d('0x3e')]['findOne']({'where':{'id':_0x465c22[_0xd86d('0x58')]['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x561ee9,null))[_0xd86d('0x21')](function(_0x50b107){if(_0x50b107){_0x576c11[_0xd86d('0x43')]=_[_0xd86d('0x45')](db[_0xd86d('0x6d')][_0xd86d('0x3f')]);_0x576c11[_0xd86d('0x44')]=_['keys'](_0x465c22[_0xd86d('0x44')]);_0x576c11['filters']=_[_0xd86d('0x48')](_0x576c11[_0xd86d('0x43')],_0x576c11['query']);_0x281f25['attributes']=_['intersection'](_0x576c11['model'],qs['fields'](_0x465c22[_0xd86d('0x44')][_0xd86d('0x49')]));_0x281f25[_0xd86d('0x47')]=_0x281f25[_0xd86d('0x47')][_0xd86d('0x4a')]?_0x281f25[_0xd86d('0x47')]:_0x576c11[_0xd86d('0x43')];if(!_0x465c22[_0xd86d('0x44')][_0xd86d('0x4b')]('nolimit')){_0x281f25[_0xd86d('0x2e')]=qs[_0xd86d('0x2e')](_0x465c22[_0xd86d('0x44')]['limit']);_0x281f25[_0xd86d('0x2c')]=qs['offset'](_0x465c22['query']['offset']);}_0x281f25['order']=qs[_0xd86d('0x4d')](_0x465c22[_0xd86d('0x44')]['sort']);_0x281f25[_0xd86d('0x50')]=qs[_0xd86d('0x46')](_['pick'](_0x465c22[_0xd86d('0x44')],_0x576c11[_0xd86d('0x46')]));_0x281f25[_0xd86d('0x50')][_0xd86d('0x67')]=_0x50b107['id'];if(_0x465c22[_0xd86d('0x44')]['filter']){_0x281f25[_0xd86d('0x50')]=_[_0xd86d('0x52')](_0x281f25[_0xd86d('0x50')],{'$or':_[_0xd86d('0x3d')](_0x281f25[_0xd86d('0x47')],function(_0x4f9ad1){var _0x42059={};_0x42059[_0x4f9ad1]={'$like':'%'+_0x465c22['query'][_0xd86d('0x4f')]+'%'};return _0x42059;})});}_0x281f25=_[_0xd86d('0x52')]({},_0x281f25,_0x465c22[_0xd86d('0x53')]);return db['CannedAnswer'][_0xd86d('0x2f')]({'where':_0x281f25[_0xd86d('0x50')]})[_0xd86d('0x21')](function(_0xdbeeea){_0x250f01[_0xd86d('0x2f')]=_0xdbeeea;if(_0x465c22['query'][_0xd86d('0x54')]){_0x281f25[_0xd86d('0x5b')]=[{'all':!![]}];}return db[_0xd86d('0x6d')][_0xd86d('0x55')](_0x281f25);})[_0xd86d('0x21')](function(_0x213f4f){_0x250f01[_0xd86d('0x56')]=_0x213f4f;return _0x250f01;});}})[_0xd86d('0x21')](respondWithFilteredResult(_0x561ee9,_0x281f25))[_0xd86d('0x2a')](handleError(_0x561ee9,null));};exports[_0xd86d('0x6e')]=function(_0x429389,_0x414ae3,_0x5a7bb8){return db['OpenchannelAccount'][_0xd86d('0x5c')]({'where':{'id':_0x429389['params']['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x414ae3,null))[_0xd86d('0x21')](function(_0xce97fe){if(_0xce97fe){return _0xce97fe['removeAnswers'](_0x429389[_0xd86d('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x414ae3,null))[_0xd86d('0x2a')](handleError(_0x414ae3,null));};exports['notify']=function(_0x2ae3e8,_0x2cbc13,_0x41d369){var _0x80c8d0={'body':_0x2ae3e8[_0xd86d('0x5e')],'channel':_0xd86d('0x6f')};var _0x348dfe=[];var _0xf33eba=[];var _0x31242b={};var _0x5f0695=![];return db[_0xd86d('0x70')][_0xd86d('0x65')]()['then'](function(_0x486335){if(!_0x486335){throw new db[(_0xd86d('0x71'))][(_0xd86d('0x72'))](_0xd86d('0x73'));}_0x348dfe=_['difference'](_[_0xd86d('0x45')](_0x486335),['createdAt',_0xd86d('0x74')]);_0xf33eba=_[_0xd86d('0x75')](_['keys'](_0x486335),[_0xd86d('0x76'),'updatedAt',_0xd86d('0x77'),'ListId']);if(_0x2ae3e8[_0xd86d('0x5e')]['id']){delete _0x2ae3e8[_0xd86d('0x5e')]['id'];}if(_[_0xd86d('0x78')](_0x2ae3e8[_0xd86d('0x5e')][_0xd86d('0x79')])){throw new db[(_0xd86d('0x71'))][(_0xd86d('0x72'))](_0xd86d('0x7a'));}if(_['isNil'](_0x2ae3e8['body'][_0xd86d('0x5e')])||_0x2ae3e8['body'][_0xd86d('0x5e')]===''){throw new db[(_0xd86d('0x71'))][(_0xd86d('0x72'))](_0xd86d('0x7b'));}if(_[_0xd86d('0x78')](_0x2ae3e8[_0xd86d('0x5e')][_0xd86d('0x7c')])){throw new db[(_0xd86d('0x71'))][(_0xd86d('0x72'))](_0xd86d('0x7d')+_0xf33eba);}if(!_[_0xd86d('0x7e')](_0xf33eba,_0x2ae3e8[_0xd86d('0x5e')][_0xd86d('0x7c')])){throw new db['Sequelize'][(_0xd86d('0x72'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xf33eba);}_0x31242b[_0x2ae3e8['body'][_0xd86d('0x7c')]]=_0x2ae3e8[_0xd86d('0x5e')][_0xd86d('0x79')];})[_0xd86d('0x21')](function(){return db[_0xd86d('0x3e')]['find']({'where':{'id':_0x2ae3e8[_0xd86d('0x58')]['id']},'include':[{'model':db[_0xd86d('0x7f')],'as':_0xd86d('0x80'),'include':[{'model':db[_0xd86d('0x70')],'as':'Contacts','where':_0x31242b,'limit':0x1,'order':[[_0xd86d('0x74'),_0xd86d('0x81')]]}]},{'model':db['OpenchannelApplication'],'as':_0xd86d('0x82')}]});})[_0xd86d('0x21')](handleEntityNotFound(_0x2cbc13,null))[_0xd86d('0x21')](function(_0x227b76){if(_0x227b76&&_0x227b76[_0xd86d('0x80')]){_0x80c8d0['account']=_0x227b76;_0x80c8d0['applications']=_0x227b76['Applications'];_0x80c8d0['list']=_0x227b76[_0xd86d('0x80')];_0x80c8d0[_0xd86d('0x83')]=_[_0xd86d('0x84')](_0x80c8d0[_0xd86d('0x83')],['priority'],[_0xd86d('0x85')]);if(_0x80c8d0[_0xd86d('0x86')][_0xd86d('0x82')]){delete _0x80c8d0['account'][_0xd86d('0x82')];}if(_0x80c8d0['account'][_0xd86d('0x80')]&&_0x80c8d0['account'][_0xd86d('0x80')]['Contacts'][_0xd86d('0x4a')]){return _0x80c8d0['account'][_0xd86d('0x80')][_0xd86d('0x87')][0x0];}var _0x17481e=_[_0xd86d('0x1a')](_0x2ae3e8[_0xd86d('0x5e')],{'firstName':_0x2ae3e8['body'][_0xd86d('0x79')],'ListId':_0x227b76[_0xd86d('0x88')]});_0x17481e[_0x2ae3e8[_0xd86d('0x5e')][_0xd86d('0x7c')]]=_0x2ae3e8['body'][_0xd86d('0x79')];return db['CmContact']['create'](_0x17481e,{'fields':_0x348dfe,'raw':!![]});}})['then'](handleEntityNotFound(_0x2cbc13,null))[_0xd86d('0x21')](function(_0x3098a6){_0x80c8d0[_0xd86d('0x89')]=_0x3098a6;if(_0x3098a6){var _0x5dab92={'ContactId':_0x3098a6['id'],'OpenchannelAccountId':_0x2ae3e8['params']['id'],'from':(_0x3098a6[_0xd86d('0x8a')]||'')+'\x20'+(_0x3098a6[_0xd86d('0x8b')]||'')};var _0x54257f={'OpenchannelAccountId':_0x2ae3e8['params']['id'],'closed':![]};if(_0x2ae3e8[_0xd86d('0x5e')]['threadId']){_0x54257f[_0xd86d('0x8c')]=_0x2ae3e8['body'][_0xd86d('0x8c')];return db[_0xd86d('0x8d')]['find']({'where':_0x54257f})[_0xd86d('0x21')](function(_0x1b0b86){if(_0x1b0b86){return[_0x1b0b86,![]];}_0x5dab92[_0xd86d('0x8c')]=_0x2ae3e8['body'][_0xd86d('0x8c')];_0x5dab92['externalUrl']=_0x2ae3e8[_0xd86d('0x5e')][_0xd86d('0x8e')];return db[_0xd86d('0x8d')][_0xd86d('0x5d')](_0x5dab92)[_0xd86d('0x21')](function(_0x49add5){return[_0x49add5,!![]];});});}else{_0x54257f[_0xd86d('0x8c')]=null;}_0x54257f[_0xd86d('0x8f')]=_0x3098a6['id'];return db[_0xd86d('0x8d')][_0xd86d('0x5c')]({'where':_0x54257f})['then'](function(_0xe0e96c){if(_0xe0e96c){return[_0xe0e96c,![]];}return db[_0xd86d('0x8d')][_0xd86d('0x5d')](_0x5dab92)[_0xd86d('0x21')](function(_0x259e2c){return[_0x259e2c,!![]];});});}})[_0xd86d('0x90')](function(_0x4f651f,_0x424e27){if(_0x4f651f){_0x5f0695=_0x424e27;if(!_0x424e27){var _0x3bbcfd={'from':(_0x80c8d0['contact']['firstName']||'')+'\x20'+(_0x80c8d0['contact']['lastName']||'')};if(_0x2ae3e8['body'][_0xd86d('0x8c')]&&_0x2ae3e8[_0xd86d('0x5e')][_0xd86d('0x91')]&&_0x2ae3e8[_0xd86d('0x5e')][_0xd86d('0x8c')]!=_0x2ae3e8['body'][_0xd86d('0x91')]){_0x3bbcfd['threadId']=_0x2ae3e8[_0xd86d('0x5e')][_0xd86d('0x91')];}return _0x4f651f[_0xd86d('0x34')](_0x3bbcfd);}else{return _0x4f651f;}}})[_0xd86d('0x21')](function(_0x54760a){_0x80c8d0[_0xd86d('0x92')]=_0x54760a['get']({'plain':!![]});_0x80c8d0[_0xd86d('0x92')][_0xd86d('0x93')]=_0x5f0695;if(_0x80c8d0[_0xd86d('0x92')][_0xd86d('0x93')]){if(_0x80c8d0[_0xd86d('0x86')][_0xd86d('0x94')]){_0x80c8d0[_0xd86d('0x83')][_0xd86d('0x95')]({'id':0x0,'priority':_0x80c8d0[_0xd86d('0x83')][_0xd86d('0x4a')]+0x1,'app':_0xd86d('0x96'),'appdata':_0xd86d('0x97'),'interval':_0xd86d('0x98')});}}return db['OpenchannelMessage']['create']({'body':_0x2ae3e8[_0xd86d('0x5e')][_0xd86d('0x5e')],'OpenchannelAccountId':_0x2ae3e8[_0xd86d('0x58')]['id'],'OpenchannelInteractionId':_0x54760a['id'],'direction':'in','ContactId':_0x80c8d0[_0xd86d('0x89')]['id'],'AttachmentId':_0x2ae3e8['body'][_0xd86d('0x99')]});})[_0xd86d('0x21')](function(_0x5352ca){_0x80c8d0[_0xd86d('0x28')]=_0x5352ca;if(_0x80c8d0[_0xd86d('0x92')][_0xd86d('0x9a')]){return db['User'][_0xd86d('0x5c')]({'attributes':['id','name'],'where':{'id':_0x80c8d0[_0xd86d('0x92')][_0xd86d('0x9a')]}})['then'](function(_0x5f51c6){if(_0x5f51c6){_0x80c8d0[_0xd86d('0x83')][_0xd86d('0x9b')]({'id':0x0,'priority':0x0,'app':_0xd86d('0x9c'),'appdata':_0x5f51c6['name']+','+(_0x80c8d0['account'][_0xd86d('0x9d')]||0xa),'interval':'*,*,*,*'});_0x80c8d0[_0xd86d('0x9e')]=![];}return respondWithRpcPromise(_0xd86d('0x9f'),'startRouting',_0x80c8d0);});}return respondWithRpcPromise('Start',_0xd86d('0xa0'),_0x80c8d0);})['then'](function(_0x47b600){respondWithRpcPromise('EventManager','EventManager',{'event':_0xd86d('0xa1'),'message':_0x47b600},client9002);return _0x47b600;})[_0xd86d('0x21')](respondWithResult(_0x2cbc13,null))[_0xd86d('0x2a')](handleError(_0x2cbc13,null));};exports[_0xd86d('0xa2')]=function(_0x5bc9a8,_0x385bdf){var _0x6d3e17=_0x5bc9a8['params']['id'];var _0x1d937c=_0x5bc9a8[_0xd86d('0x5e')];var _0x2ccfea=0xc8;var _0x21179a=null;return db[_0xd86d('0xa3')][_0xd86d('0xa4')]({'isolationLevel':db[_0xd86d('0xa3')][_0xd86d('0xa5')][_0xd86d('0xa6')]['READ_COMMITTED']},function(_0x101d8a){return db[_0xd86d('0x3e')][_0xd86d('0x69')]({'where':{'id':_0x6d3e17},'transaction':_0x101d8a})['then'](function(_0x83b068){if(_0x83b068){return db[_0xd86d('0xa7')][_0xd86d('0x35')]({'where':{'OpenchannelAccountId':_0x6d3e17},'transaction':_0x101d8a})['then'](function(){var _0x510540=_[_0xd86d('0x3d')](_0x1d937c,function(_0x357d76){_0x357d76['OpenchannelAccountId']=_0x6d3e17;return _0x357d76;});return db['OpenchannelApplication'][_0xd86d('0xa8')](_0x510540,{'transaction':_0x101d8a});});}else{_0x2ccfea=0x194;_0x21179a=[];}});})['then'](function(){if(_0x2ccfea!==0x194){return db['OpenchannelApplication'][_0xd86d('0xa9')]({'where':{'OpenchannelAccountId':_0x6d3e17},'order':_0xd86d('0xaa')})[_0xd86d('0x21')](function(_0x5a1d7f){_0x21179a=_0x5a1d7f;});}})[_0xd86d('0x2a')](function(_0xb86344){_0x2ccfea=0x1f4;logger[_0xd86d('0x26')](_0xb86344[_0xd86d('0x3a')]);if(_0xb86344[_0xd86d('0x3b')]){delete _0xb86344[_0xd86d('0x3b')];}_0x21179a=_0xb86344;})[_0xd86d('0xab')](function(){if(_0x21179a===null){_0x385bdf['sendStatus'](_0x2ccfea);}else{if(_0x2ccfea===0x1f4){_0x385bdf[_0xd86d('0x2b')](_0x2ccfea)[_0xd86d('0x3c')](_0x21179a);}else{_0x385bdf[_0xd86d('0x2b')](_0x2ccfea)[_0xd86d('0xac')](_0x21179a);}}});};exports['getApplications']=function(_0xb9ed2d,_0x4817e3,_0x1c9057){var _0x21e139={};var _0x9f8988={};var _0x1f72d6;var _0x3ff6c9;return db[_0xd86d('0x3e')]['findOne']({'where':{'id':_0xb9ed2d[_0xd86d('0x58')]['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x4817e3,null))[_0xd86d('0x21')](function(_0x3027ed){if(_0x3027ed){_0x1f72d6=_0x3027ed;_0x9f8988[_0xd86d('0x43')]=_['keys'](db[_0xd86d('0xa7')][_0xd86d('0x3f')]);_0x9f8988[_0xd86d('0x44')]=_[_0xd86d('0x45')](_0xb9ed2d[_0xd86d('0x44')]);_0x9f8988[_0xd86d('0x46')]=_['intersection'](_0x9f8988['model'],_0x9f8988[_0xd86d('0x44')]);_0x21e139[_0xd86d('0x47')]=_[_0xd86d('0x48')](_0x9f8988[_0xd86d('0x43')],qs[_0xd86d('0x49')](_0xb9ed2d[_0xd86d('0x44')]['fields']));_0x21e139[_0xd86d('0x47')]=_0x21e139[_0xd86d('0x47')]['length']?_0x21e139['attributes']:_0x9f8988[_0xd86d('0x43')];_0x21e139[_0xd86d('0xad')]=qs[_0xd86d('0x4d')](_0xb9ed2d[_0xd86d('0x44')][_0xd86d('0x4d')]);_0x21e139[_0xd86d('0x50')]=qs[_0xd86d('0x46')](_[_0xd86d('0x4e')](_0xb9ed2d[_0xd86d('0x44')],_0x9f8988[_0xd86d('0x46')]));if(_0xb9ed2d[_0xd86d('0x44')]['filter']){_0x21e139['where']=_[_0xd86d('0x52')](_0x21e139['where'],{'$or':_[_0xd86d('0x3d')](_0x21e139['attributes'],function(_0x156be5){var _0xbf1711={};_0xbf1711[_0x156be5]={'$like':'%'+_0xb9ed2d[_0xd86d('0x44')][_0xd86d('0x4f')]+'%'};return _0xbf1711;})});}_0x21e139=_[_0xd86d('0x52')]({},_0x21e139,_0xb9ed2d[_0xd86d('0x53')]);return _0x1f72d6[_0xd86d('0xae')](_0x21e139);}})['then'](function(_0x57ab4c){if(_0x57ab4c){_0x3ff6c9=_0x57ab4c['length'];if(!_0xb9ed2d[_0xd86d('0x44')][_0xd86d('0x4b')]('nolimit')){_0x21e139['limit']=qs[_0xd86d('0x2e')](_0xb9ed2d[_0xd86d('0x44')][_0xd86d('0x2e')]);_0x21e139[_0xd86d('0x2c')]=qs[_0xd86d('0x2c')](_0xb9ed2d[_0xd86d('0x44')][_0xd86d('0x2c')]);}return _0x1f72d6[_0xd86d('0xae')](_0x21e139);}})[_0xd86d('0x21')](function(_0x3f113c){if(_0x3f113c){return _0x3f113c?{'count':_0x3ff6c9,'rows':_0x3f113c}:null;}})[_0xd86d('0x21')](respondWithResult(_0x4817e3,null))[_0xd86d('0x2a')](handleError(_0x4817e3,null));};exports[_0xd86d('0xaf')]=function(_0x53edb3,_0x3af520,_0x33c6ef){var _0x18577a={'raw':![],'where':{}};var _0x35dae3={};var _0x1ad815={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x53edb3[_0xd86d('0x58')]['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x3af520,null))[_0xd86d('0x21')](function(_0x34e815){if(_0x34e815){_0x35dae3[_0xd86d('0x43')]=_[_0xd86d('0x45')](db[_0xd86d('0x8d')][_0xd86d('0x3f')]);_0x35dae3[_0xd86d('0x44')]=_[_0xd86d('0x45')](_0x53edb3[_0xd86d('0x44')]);_0x35dae3[_0xd86d('0x46')]=_['intersection'](_0x35dae3[_0xd86d('0x43')],_0x35dae3[_0xd86d('0x44')]);_0x18577a[_0xd86d('0x47')]=_[_0xd86d('0x48')](_0x35dae3['model'],qs[_0xd86d('0x49')](_0x53edb3[_0xd86d('0x44')][_0xd86d('0x49')]));_0x18577a[_0xd86d('0x47')]=_0x18577a['attributes']['length']?_0x18577a[_0xd86d('0x47')]:_0x35dae3[_0xd86d('0x43')];if(!_0x53edb3[_0xd86d('0x44')][_0xd86d('0x4b')](_0xd86d('0x4c'))){_0x18577a[_0xd86d('0x2e')]=qs[_0xd86d('0x2e')](_0x53edb3[_0xd86d('0x44')][_0xd86d('0x2e')]);_0x18577a['offset']=qs['offset'](_0x53edb3[_0xd86d('0x44')][_0xd86d('0x2c')]);}_0x18577a[_0xd86d('0xad')]=qs[_0xd86d('0x4d')](_0x53edb3[_0xd86d('0x44')][_0xd86d('0x4d')]);_0x18577a['where']=qs[_0xd86d('0x46')](_[_0xd86d('0x4e')](_0x53edb3[_0xd86d('0x44')],_0x35dae3[_0xd86d('0x46')]));_0x18577a['where'][_0xd86d('0x67')]=_0x34e815['id'];if(_0x53edb3['query'][_0xd86d('0x4f')]){_0x18577a[_0xd86d('0x50')]=_[_0xd86d('0x52')](_0x18577a[_0xd86d('0x50')],{'$or':_[_0xd86d('0x3d')](_0x18577a[_0xd86d('0x47')],function(_0x20796a){var _0x24f605={};_0x24f605[_0x20796a]={'$like':'%'+_0x53edb3[_0xd86d('0x44')][_0xd86d('0x4f')]+'%'};return _0x24f605;})});}_0x18577a=_[_0xd86d('0x52')]({},_0x18577a,_0x53edb3[_0xd86d('0x53')]);return db['OpenchannelInteraction'][_0xd86d('0x2f')]({'where':_0x18577a['where']})[_0xd86d('0x21')](function(_0xd1bfbc){_0x1ad815[_0xd86d('0x2f')]=_0xd1bfbc;if(_0x53edb3[_0xd86d('0x44')]['includeAll']){_0x18577a[_0xd86d('0x5b')]=[{'model':db[_0xd86d('0x70')],'as':_0xd86d('0xb0'),'required':![]},{'model':db[_0xd86d('0xb1')],'as':_0xd86d('0xb2'),'attributes':[_0xd86d('0x3b'),_0xd86d('0xb3'),'internal'],'required':![]},{'model':db[_0xd86d('0xb4')],'as':_0xd86d('0xb5'),'attributes':['id',_0xd86d('0x3b'),_0xd86d('0xb6')],'where':_0x53edb3['query'][_0xd86d('0xb7')]?{'id':_0x53edb3['query'][_0xd86d('0xb7')]}:undefined,'required':_0x53edb3[_0xd86d('0x44')][_0xd86d('0xb7')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xd86d('0x55')](_0x18577a);})['then'](function(_0xf01b78){_0x1ad815[_0xd86d('0x56')]=_0xf01b78;return _0x1ad815;});}})[_0xd86d('0x21')](respondWithFilteredResult(_0x3af520,_0x18577a))[_0xd86d('0x2a')](handleError(_0x3af520,null));};exports[_0xd86d('0xb8')]=function(_0x483752,_0x3ae16d,_0x28947d){return db[_0xd86d('0x3e')][_0xd86d('0x5c')]({'where':{'id':_0x483752[_0xd86d('0x58')]['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x3ae16d,null))[_0xd86d('0x21')](function(_0x21d7cb){if(_0x21d7cb){return _0x21d7cb[_0xd86d('0xb8')](_0x483752[_0xd86d('0x5e')][_0xd86d('0x6a')],_[_0xd86d('0xb9')](_0x483752[_0xd86d('0x5e')],[_0xd86d('0x6a'),'id'])||{})['spread'](function(_0x5959e6){for(var _0x3910cc=0x0;_0x3910cc<_0x483752['body'][_0xd86d('0x6a')]['length'];_0x3910cc+=0x1){socket[_0xd86d('0xba')](_0xd86d('0xbb'),{'UserId':Number(_0x483752['body']['ids'][_0x3910cc]),'OpenchannelAccountId':Number(_0x483752[_0xd86d('0x58')]['id'])});}return _0x5959e6;});}})[_0xd86d('0x21')](respondWithResult(_0x3ae16d,null))[_0xd86d('0x2a')](handleError(_0x3ae16d,null));};exports[_0xd86d('0xbc')]=function(_0x2eb53f,_0x11f47d,_0x391087){return db[_0xd86d('0x3e')][_0xd86d('0x5c')]({'where':{'id':_0x2eb53f[_0xd86d('0x58')]['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x11f47d,null))['then'](function(_0x426afb){if(_0x426afb){return _0x426afb[_0xd86d('0xbc')](_0x2eb53f[_0xd86d('0x44')][_0xd86d('0x6a')])[_0xd86d('0x21')](function(){if(_[_0xd86d('0xbd')](_0x2eb53f[_0xd86d('0x44')][_0xd86d('0x6a')])){for(var _0x2b7b55=0x0;_0x2b7b55<_0x2eb53f[_0xd86d('0x44')]['ids'][_0xd86d('0x4a')];_0x2b7b55+=0x1){socket[_0xd86d('0xba')](_0xd86d('0xbe'),{'UserId':Number(_0x2eb53f[_0xd86d('0x44')]['ids'][_0x2b7b55]),'OpenchannelAccountId':Number(_0x2eb53f[_0xd86d('0x58')]['id'])});}}else{socket['emit'](_0xd86d('0xbe'),{'UserId':Number(_0x2eb53f[_0xd86d('0x44')][_0xd86d('0x6a')]),'OpenchannelAccountId':Number(_0x2eb53f[_0xd86d('0x58')]['id'])});}});}})[_0xd86d('0x21')](respondWithStatusCode(_0x11f47d,null))[_0xd86d('0x2a')](handleError(_0x11f47d,null));};exports[_0xd86d('0xbf')]=function(_0x1bd6a7,_0x2e72b4,_0x3615e2){var _0xb9d966={};var _0x3160e6={};var _0x4f372a;var _0xb376da;return db['OpenchannelAccount'][_0xd86d('0x69')]({'where':{'id':_0x1bd6a7[_0xd86d('0x58')]['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x2e72b4,null))[_0xd86d('0x21')](function(_0xd5ec7d){if(_0xd5ec7d){_0x4f372a=_0xd5ec7d;_0x3160e6[_0xd86d('0x43')]=_['keys'](db[_0xd86d('0xb1')][_0xd86d('0x3f')]);_0x3160e6[_0xd86d('0x44')]=_[_0xd86d('0x45')](_0x1bd6a7[_0xd86d('0x44')]);_0x3160e6[_0xd86d('0x46')]=_['intersection'](_0x3160e6[_0xd86d('0x43')],_0x3160e6[_0xd86d('0x44')]);_0xb9d966[_0xd86d('0x47')]=_[_0xd86d('0x48')](_0x3160e6[_0xd86d('0x43')],qs[_0xd86d('0x49')](_0x1bd6a7['query'][_0xd86d('0x49')]));_0xb9d966['attributes']=_0xb9d966['attributes'][_0xd86d('0x4a')]?_0xb9d966['attributes']:_0x3160e6[_0xd86d('0x43')];_0xb9d966[_0xd86d('0xad')]=qs['sort'](_0x1bd6a7[_0xd86d('0x44')][_0xd86d('0x4d')]);_0xb9d966['where']=qs[_0xd86d('0x46')](_[_0xd86d('0x4e')](_0x1bd6a7[_0xd86d('0x44')],_0x3160e6[_0xd86d('0x46')]));if(_0x1bd6a7[_0xd86d('0x44')]['filter']){_0xb9d966[_0xd86d('0x50')]=_[_0xd86d('0x52')](_0xb9d966[_0xd86d('0x50')],{'$or':_['map'](_0xb9d966[_0xd86d('0x47')],function(_0x12bd54){var _0x301ced={};_0x301ced[_0x12bd54]={'$like':'%'+_0x1bd6a7[_0xd86d('0x44')][_0xd86d('0x4f')]+'%'};return _0x301ced;})});}_0xb9d966=_[_0xd86d('0x52')]({},_0xb9d966,_0x1bd6a7[_0xd86d('0x53')]);return _0x4f372a[_0xd86d('0xbf')](_0xb9d966);}})[_0xd86d('0x21')](function(_0x10b107){if(_0x10b107){_0xb376da=_0x10b107[_0xd86d('0x4a')];if(!_0x1bd6a7['query'][_0xd86d('0x4b')](_0xd86d('0x4c'))){_0xb9d966['limit']=qs[_0xd86d('0x2e')](_0x1bd6a7[_0xd86d('0x44')][_0xd86d('0x2e')]);_0xb9d966[_0xd86d('0x2c')]=qs[_0xd86d('0x2c')](_0x1bd6a7[_0xd86d('0x44')]['offset']);}return _0x4f372a[_0xd86d('0xbf')](_0xb9d966);}})[_0xd86d('0x21')](function(_0x555611){if(_0x555611){return _0x555611?{'count':_0xb376da,'rows':_0x555611}:null;}})[_0xd86d('0x21')](respondWithResult(_0x2e72b4,null))[_0xd86d('0x2a')](handleError(_0x2e72b4,null));};exports[_0xd86d('0x3c')]=function(_0x445421,_0x32dd4e,_0x390642){var _0x52c38d,_0x1e11f7,_0x3e3cae;if(_[_0xd86d('0x78')](_0x445421['body'][_0xd86d('0x5e')])||_0x445421[_0xd86d('0x5e')][_0xd86d('0x5e')]===''){throw new db[(_0xd86d('0x71'))][(_0xd86d('0x72'))](_0xd86d('0x7b'));}if(_[_0xd86d('0x78')](_0x445421[_0xd86d('0x5e')]['to'])){}_0x52c38d=_0x445421[_0xd86d('0x5e')]['to'];return db[_0xd86d('0x3e')]['findOne']({'where':{'id':_0x445421['params']['id']}})[_0xd86d('0x21')](handleEntityNotFound(_0x32dd4e,null))['then'](function(_0x9e3415){if(_0x9e3415){return db[_0xd86d('0x3e')][_0xd86d('0x5c')]({'where':{'id':_0x9e3415['id']},'include':[{'model':db[_0xd86d('0x7f')],'as':_0xd86d('0x80'),'include':[{'model':db[_0xd86d('0x70')],'as':_0xd86d('0x87'),'where':{[_0x9e3415[_0xd86d('0x7c')]]:_0x52c38d},'limit':0x1,'order':[[_0xd86d('0x74'),_0xd86d('0x81')]]}]}]})[_0xd86d('0x21')](handleEntityNotFound(_0x32dd4e,null))[_0xd86d('0x21')](function(_0x20af7c){if(_0x20af7c&&_0x20af7c[_0xd86d('0x80')]){_0x1e11f7=_0x20af7c[_0xd86d('0x36')]({'plain':!![]});if(_0x1e11f7[_0xd86d('0x80')]&&_0x1e11f7[_0xd86d('0x80')][_0xd86d('0x87')][_0xd86d('0x4a')]){return _0x1e11f7[_0xd86d('0x80')][_0xd86d('0x87')][0x0];}return db[_0xd86d('0x70')][_0xd86d('0x5d')](_[_0xd86d('0x1a')](_0x445421['body'],{'firstName':_0x52c38d,[_0x20af7c['mapKey']]:_0x52c38d,'phone':_0x52c38d,'ListId':_0x1e11f7[_0xd86d('0x88')]}));}})[_0xd86d('0x21')](handleEntityNotFound(_0x32dd4e,null))['then'](function(_0x126681){if(_0x126681){_0x3e3cae=_0x126681;return db[_0xd86d('0x8d')][_0xd86d('0x5c')]({'where':{'ContactId':_0x3e3cae['id'],'closed':![],'OpenchannelAccountId':_0x1e11f7['id']}})[_0xd86d('0x21')](function(_0x9ce6c9){if(_0x9ce6c9){return[_0x9ce6c9,![]];}return db[_0xd86d('0x8d')][_0xd86d('0x5d')]({'UserId':_0x445421['user']['id'],'ContactId':_0x3e3cae['id'],'OpenchannelAccountId':_0x1e11f7['id'],'lastMsgDirection':'out','firstMsgDirection':_0xd86d('0xc0'),'Messages':[_[_0xd86d('0x52')](_0x445421[_0xd86d('0x5e')],{'read':![],'body':_0x445421['body'][_0xd86d('0x5e')],'OpenchannelAccountId':_0x1e11f7['id'],'UserId':_0x445421[_0xd86d('0x5f')]['id'],'ContactId':_0x3e3cae['id']})]},{'include':[{'model':db[_0xd86d('0xc1')],'as':_0xd86d('0xc2')}]})[_0xd86d('0x21')](function(_0x2fd765){return[_0x2fd765,!![]];});});}})[_0xd86d('0x90')](function(_0x366b8b,_0x24a0c0){if(_0x24a0c0){return _0x366b8b;}return db[_0xd86d('0xc1')][_0xd86d('0x5d')](_[_0xd86d('0x52')](_0x445421[_0xd86d('0x5e')],{'read':![],'body':_0x445421[_0xd86d('0x5e')]['body'],'OpenchannelAccountId':_0x1e11f7['id'],'OpenchannelInteractionId':_0x366b8b['id'],'UserId':_0x445421[_0xd86d('0x5f')]['id'],'ContactId':_0x3e3cae['id']}))['then'](function(_0x3d4261){_0x366b8b[_0xd86d('0xc3')][_0xd86d('0xc2')]=[];_0x366b8b[_0xd86d('0xc3')][_0xd86d('0xc2')][_0xd86d('0x95')](_0x3d4261[_0xd86d('0xc3')]);return _0x366b8b;});});}})[_0xd86d('0x21')](respondWithResult(_0x32dd4e,null))[_0xd86d('0x2a')](handleError(_0x32dd4e,null));}; \ No newline at end of file +var _0xcf62=['order','pick','filter','merge','type','VIRTUAL','options','where','includeAll','include','findAll','rows','params','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','Disposition','findOne','sort','OpenchannelAccountId','removeDispositions','ids','getAnswers','CannedAnswer','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','contact','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','startRouting','Start','EventManager','addApplications','sequelize','transaction','READ_COMMITTED','bulkCreate','findAndCountAll','send','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','defaults','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./openchannelAccount.socket','register','client','http','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','end','name','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x27461d,_0x1320b8){var _0x3efaed=function(_0x241f78){while(--_0x241f78){_0x27461d['push'](_0x27461d['shift']());}};_0x3efaed(++_0x1320b8);}(_0xcf62,0x71));var _0x2cf6=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xcf62[_0x2d2c16];return _0x53f2fb;};'use strict';var emlformat=require(_0x2cf6('0x0'));var rimraf=require(_0x2cf6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2cf6('0x2'));var rp=require(_0x2cf6('0x3'));var moment=require(_0x2cf6('0x4'));var BPromise=require(_0x2cf6('0x5'));var Mustache=require(_0x2cf6('0x6'));var util=require(_0x2cf6('0x7'));var path=require(_0x2cf6('0x8'));var sox=require(_0x2cf6('0x9'));var csv=require('to-csv');var ejs=require(_0x2cf6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2cf6('0xb'));var squel=require(_0x2cf6('0xc'));var crypto=require(_0x2cf6('0xd'));var jsforce=require(_0x2cf6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2cf6('0xf'));var querystring=require(_0x2cf6('0x10'));var Papa=require(_0x2cf6('0x11'));var Redis=require(_0x2cf6('0x12'));var authService=require(_0x2cf6('0x13'));var qs=require(_0x2cf6('0x14'));var as=require(_0x2cf6('0x15'));var hardwareService=require(_0x2cf6('0x16'));var logger=require(_0x2cf6('0x17'))(_0x2cf6('0x18'));var utils=require('../../config/utils');var config=require(_0x2cf6('0x19'));var licenseUtil=require(_0x2cf6('0x1a'));var db=require(_0x2cf6('0x1b'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x2cf6('0x1c'),'port':0x18eb});var socket=require(_0x2cf6('0x1d'))(new Redis(config[_0x2cf6('0x1e')]));require(_0x2cf6('0x1f'))[_0x2cf6('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2cf6('0x21')][_0x2cf6('0x22')]({'port':0x232c});var client9002=jayson[_0x2cf6('0x21')][_0x2cf6('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x43c866,_0x3a1877,_0x2545d0,_0x3c73a4){return new BPromise(function(_0x355edf,_0x204646){var _0x56e651=_0x3c73a4||client;return _0x56e651[_0x2cf6('0x23')](_0x43c866,_0x2545d0)[_0x2cf6('0x24')](function(_0x3e515d){logger['info'](_0x2cf6('0x25'),_0x3a1877,_0x2cf6('0x26'));logger[_0x2cf6('0x27')](_0x2cf6('0x28'),_0x3a1877,_0x2cf6('0x26'),JSON[_0x2cf6('0x29')](_0x3e515d));if(_0x3e515d[_0x2cf6('0x2a')]){if(_0x3e515d[_0x2cf6('0x2a')][_0x2cf6('0x2b')]===0x1f4){logger['error'](_0x2cf6('0x25'),_0x3a1877,_0x3e515d[_0x2cf6('0x2a')][_0x2cf6('0x2c')]);return _0x204646(_0x3e515d[_0x2cf6('0x2a')][_0x2cf6('0x2c')]);}logger[_0x2cf6('0x2a')](_0x2cf6('0x25'),_0x3a1877,_0x3e515d[_0x2cf6('0x2a')]['message']);return _0x355edf(_0x3e515d[_0x2cf6('0x2a')][_0x2cf6('0x2c')]);}else{logger[_0x2cf6('0x2d')](_0x2cf6('0x25'),_0x3a1877,_0x2cf6('0x26'));_0x355edf(_0x3e515d['result'][_0x2cf6('0x2c')]);}})[_0x2cf6('0x2e')](function(_0x396dcb){logger['error'](_0x2cf6('0x25'),_0x3a1877,_0x396dcb);_0x204646(_0x396dcb);});});}function respondWithStatusCode(_0x175b03,_0x36b787){_0x36b787=_0x36b787||0xcc;return function(_0x2af1f7){if(_0x2af1f7){return _0x175b03[_0x2cf6('0x2f')](_0x36b787);}return _0x175b03[_0x2cf6('0x30')](_0x36b787)['end']();};}function respondWithResult(_0x1ddaab,_0x141ed6){_0x141ed6=_0x141ed6||0xc8;return function(_0x2be7b7){if(_0x2be7b7){return _0x1ddaab[_0x2cf6('0x30')](_0x141ed6)[_0x2cf6('0x31')](_0x2be7b7);}};}function respondWithFilteredResult(_0x5e3891,_0x5f12f1){return function(_0x1e5a4e){if(_0x1e5a4e){var _0x1a0786=typeof _0x5f12f1[_0x2cf6('0x32')]===_0x2cf6('0x33')&&typeof _0x5f12f1[_0x2cf6('0x34')]===_0x2cf6('0x33');var _0x5e6012=_0x1e5a4e[_0x2cf6('0x35')];var _0x1d52e2=_0x1a0786?0x0:_0x5f12f1['offset'];var _0x1abcb7=_0x1a0786?_0x1e5a4e[_0x2cf6('0x35')]:_0x5f12f1[_0x2cf6('0x32')]+_0x5f12f1[_0x2cf6('0x34')];var _0x446e0f;if(_0x1abcb7>=_0x5e6012){_0x1abcb7=_0x5e6012;_0x446e0f=0xc8;}else{_0x446e0f=0xce;}_0x5e3891['status'](_0x446e0f);return _0x5e3891[_0x2cf6('0x36')](_0x2cf6('0x37'),_0x1d52e2+'-'+_0x1abcb7+'/'+_0x5e6012)['json'](_0x1e5a4e);}return null;};}function patchUpdates(_0xc59643){return function(_0x52b771){try{jsonpatch[_0x2cf6('0x38')](_0x52b771,_0xc59643,!![]);}catch(_0xa7f4fe){return BPromise[_0x2cf6('0x39')](_0xa7f4fe);}return _0x52b771[_0x2cf6('0x3a')]();};}function saveUpdates(_0x305d4a,_0x5edf16){return function(_0x1031d1){if(_0x1031d1){return _0x1031d1[_0x2cf6('0x3b')](_0x305d4a)[_0x2cf6('0x24')](function(_0x3b558e){return _0x3b558e;});}return null;};}function removeEntity(_0x40561b,_0x17b5ab){return function(_0x13fb96){if(_0x13fb96){return _0x13fb96[_0x2cf6('0x3c')]()[_0x2cf6('0x24')](function(){var _0x44eb6f=_0x13fb96[_0x2cf6('0x3d')]({'plain':!![]});var _0x4bf687=_0x2cf6('0x3e');return db[_0x2cf6('0x3f')][_0x2cf6('0x3c')]({'where':{'type':_0x4bf687,'resourceId':_0x44eb6f['id']}})[_0x2cf6('0x24')](function(){return _0x13fb96;});})[_0x2cf6('0x24')](function(){_0x40561b[_0x2cf6('0x30')](0xcc)[_0x2cf6('0x40')]();});}};}function handleEntityNotFound(_0x4fafaf,_0x3cf3a4){return function(_0x4170ac){if(!_0x4170ac){_0x4fafaf[_0x2cf6('0x2f')](0x194);}return _0x4170ac;};}function handleError(_0x4ec17f,_0x299e45){_0x299e45=_0x299e45||0x1f4;return function(_0x33c5cf){logger[_0x2cf6('0x2a')](_0x33c5cf['stack']);if(_0x33c5cf['name']){delete _0x33c5cf[_0x2cf6('0x41')];}_0x4ec17f[_0x2cf6('0x30')](_0x299e45)['send'](_0x33c5cf);};}exports[_0x2cf6('0x42')]=function(_0x18d6a1,_0x80d43b){var _0x135fbb={'include':[{'model':db[_0x2cf6('0x43')],'as':_0x2cf6('0x44')}]},_0x44ab4f={},_0x554a49={'count':0x0,'rows':[]};var _0xce2325=_[_0x2cf6('0x45')](db[_0x2cf6('0x46')]['rawAttributes'],function(_0x121885){return{'name':_0x121885[_0x2cf6('0x47')],'type':_0x121885['type'][_0x2cf6('0x48')]};});_0x44ab4f[_0x2cf6('0x49')]=_[_0x2cf6('0x45')](_0xce2325,_0x2cf6('0x41'));_0x44ab4f[_0x2cf6('0x4a')]=_[_0x2cf6('0x4b')](_0x18d6a1['query']);_0x44ab4f[_0x2cf6('0x4c')]=_[_0x2cf6('0x4d')](_0x44ab4f[_0x2cf6('0x49')],_0x44ab4f[_0x2cf6('0x4a')]);_0x135fbb['attributes']=_[_0x2cf6('0x4d')](_0x44ab4f[_0x2cf6('0x49')],qs[_0x2cf6('0x4e')](_0x18d6a1[_0x2cf6('0x4a')][_0x2cf6('0x4e')]));_0x135fbb[_0x2cf6('0x4f')]=_0x135fbb['attributes'][_0x2cf6('0x50')]?_0x135fbb[_0x2cf6('0x4f')]:_0x44ab4f[_0x2cf6('0x49')];if(!_0x18d6a1[_0x2cf6('0x4a')][_0x2cf6('0x51')](_0x2cf6('0x52'))){_0x135fbb[_0x2cf6('0x34')]=qs['limit'](_0x18d6a1[_0x2cf6('0x4a')][_0x2cf6('0x34')]);_0x135fbb[_0x2cf6('0x32')]=qs[_0x2cf6('0x32')](_0x18d6a1['query']['offset']);}_0x135fbb[_0x2cf6('0x53')]=qs['sort'](_0x18d6a1['query']['sort']);_0x135fbb['where']=qs[_0x2cf6('0x4c')](_[_0x2cf6('0x54')](_0x18d6a1[_0x2cf6('0x4a')],_0x44ab4f[_0x2cf6('0x4c')]),_0xce2325);if(_0x18d6a1['query'][_0x2cf6('0x55')]){_0x135fbb['where']=_[_0x2cf6('0x56')](_0x135fbb['where'],{'$or':_[_0x2cf6('0x45')](_0xce2325,function(_0x5f556e){if(_0x5f556e[_0x2cf6('0x57')]!==_0x2cf6('0x58')){var _0x2fcaea={};_0x2fcaea[_0x5f556e[_0x2cf6('0x41')]]={'$like':'%'+_0x18d6a1[_0x2cf6('0x4a')][_0x2cf6('0x55')]+'%'};return _0x2fcaea;}})});}_0x135fbb=_[_0x2cf6('0x56')]({},_0x135fbb,_0x18d6a1[_0x2cf6('0x59')]);var _0x323353={'where':_0x135fbb[_0x2cf6('0x5a')]};return db[_0x2cf6('0x46')][_0x2cf6('0x35')](_0x323353)['then'](function(_0x4ed9a9){_0x554a49['count']=_0x4ed9a9;if(_0x18d6a1[_0x2cf6('0x4a')][_0x2cf6('0x5b')]){_0x135fbb[_0x2cf6('0x5c')]=[{'all':!![]}];}return db[_0x2cf6('0x46')][_0x2cf6('0x5d')](_0x135fbb);})[_0x2cf6('0x24')](function(_0x9ecb8a){_0x554a49[_0x2cf6('0x5e')]=_0x9ecb8a;return _0x554a49;})[_0x2cf6('0x24')](respondWithFilteredResult(_0x80d43b,_0x135fbb))[_0x2cf6('0x2e')](handleError(_0x80d43b,null));};exports['show']=function(_0xef7e3e,_0x455b61){var _0x553970={'raw':![],'where':{'id':_0xef7e3e[_0x2cf6('0x5f')]['id']},'include':[{'model':db['Pause'],'as':_0x2cf6('0x44')}]},_0x2f4d90={};_0x2f4d90['model']=_[_0x2cf6('0x4b')](db[_0x2cf6('0x46')][_0x2cf6('0x60')]);_0x2f4d90[_0x2cf6('0x4a')]=_[_0x2cf6('0x4b')](_0xef7e3e[_0x2cf6('0x4a')]);_0x2f4d90['filters']=_[_0x2cf6('0x4d')](_0x2f4d90['model'],_0x2f4d90[_0x2cf6('0x4a')]);_0x553970['attributes']=_[_0x2cf6('0x4d')](_0x2f4d90[_0x2cf6('0x49')],qs['fields'](_0xef7e3e[_0x2cf6('0x4a')][_0x2cf6('0x4e')]));_0x553970[_0x2cf6('0x4f')]=_0x553970[_0x2cf6('0x4f')][_0x2cf6('0x50')]?_0x553970['attributes']:_0x2f4d90[_0x2cf6('0x49')];if(_0xef7e3e[_0x2cf6('0x4a')][_0x2cf6('0x5b')]){_0x553970[_0x2cf6('0x5c')]=[{'all':!![]}];}_0x553970=_[_0x2cf6('0x56')]({},_0x553970,_0xef7e3e[_0x2cf6('0x59')]);return db[_0x2cf6('0x46')]['find'](_0x553970)[_0x2cf6('0x24')](handleEntityNotFound(_0x455b61,null))['then'](respondWithResult(_0x455b61,null))['catch'](handleError(_0x455b61,null));};exports[_0x2cf6('0x61')]=function(_0x2f9d82,_0x14f2a8){return db['OpenchannelAccount'][_0x2cf6('0x61')](_0x2f9d82[_0x2cf6('0x62')],{})['then'](function(_0xc88312){var _0x256672=_0x2f9d82['user'][_0x2cf6('0x3d')]({'plain':!![]});if(!_0x256672)throw new Error(_0x2cf6('0x63'));if(_0x256672['role']===_0x2cf6('0x64')){var _0x25930e=_0xc88312[_0x2cf6('0x3d')]({'plain':!![]});var _0x47e89b='OpenchannelAccounts';return db[_0x2cf6('0x65')]['find']({'where':{'name':_0x47e89b,'userProfileId':_0x256672[_0x2cf6('0x66')]},'raw':!![]})[_0x2cf6('0x24')](function(_0x1acc3c){if(_0x1acc3c&&_0x1acc3c['autoAssociation']===0x0){return db[_0x2cf6('0x3f')][_0x2cf6('0x61')]({'name':_0x25930e['name'],'resourceId':_0x25930e['id'],'type':_0x1acc3c['name'],'sectionId':_0x1acc3c['id']},{})[_0x2cf6('0x24')](function(){return _0xc88312;});}else{return _0xc88312;}})[_0x2cf6('0x2e')](function(_0x1fb056){logger[_0x2cf6('0x2a')](_0x2cf6('0x67'),_0x1fb056);throw _0x1fb056;});}return _0xc88312;})[_0x2cf6('0x24')](respondWithResult(_0x14f2a8,0xc9))[_0x2cf6('0x2e')](handleError(_0x14f2a8,null));};exports['update']=function(_0x5c92de,_0x141909){if(_0x5c92de[_0x2cf6('0x62')]['id']){delete _0x5c92de[_0x2cf6('0x62')]['id'];}return db['OpenchannelAccount'][_0x2cf6('0x68')]({'where':{'id':_0x5c92de[_0x2cf6('0x5f')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x2cf6('0x24')](handleEntityNotFound(_0x141909,null))[_0x2cf6('0x24')](saveUpdates(_0x5c92de[_0x2cf6('0x62')],null))[_0x2cf6('0x24')](respondWithResult(_0x141909,null))[_0x2cf6('0x2e')](handleError(_0x141909,null));};exports[_0x2cf6('0x3c')]=function(_0x1b3f97,_0x2c585a){return db[_0x2cf6('0x46')][_0x2cf6('0x68')]({'where':{'id':_0x1b3f97[_0x2cf6('0x5f')]['id']}})[_0x2cf6('0x24')](handleEntityNotFound(_0x2c585a,null))['then'](removeEntity(_0x2c585a,null))[_0x2cf6('0x2e')](handleError(_0x2c585a,null));};exports[_0x2cf6('0x69')]=function(_0x4a4256,_0x5ee7d5){return db['OpenchannelAccount'][_0x2cf6('0x69')]()[_0x2cf6('0x24')](respondWithResult(_0x5ee7d5,null))['catch'](handleError(_0x5ee7d5,null));};exports[_0x2cf6('0x6a')]=function(_0x5eaca5,_0x2b493b,_0x3f92d3){if(_0x5eaca5[_0x2cf6('0x62')]['id']){delete _0x5eaca5['body']['id'];}return db[_0x2cf6('0x46')][_0x2cf6('0x68')]({'where':{'id':_0x5eaca5[_0x2cf6('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2b493b,null))[_0x2cf6('0x24')](function(_0x2f499a){if(_0x2f499a){_0x5eaca5[_0x2cf6('0x62')]['OpenchannelAccountId']=_0x2f499a['id'];return db[_0x2cf6('0x6b')][_0x2cf6('0x61')](_0x5eaca5['body']);}})[_0x2cf6('0x24')](respondWithResult(_0x2b493b,null))['catch'](handleError(_0x2b493b,null));};exports['getDispositions']=function(_0x3b592d,_0x2e01f9,_0x37d590){var _0x5df4aa={'raw':![],'where':{}};var _0x28e5ba={};var _0x1f15dd={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x2cf6('0x6c')]({'where':{'id':_0x3b592d[_0x2cf6('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2e01f9,null))['then'](function(_0xd93f26){if(_0xd93f26){_0x28e5ba[_0x2cf6('0x49')]=_['keys'](db[_0x2cf6('0x6b')][_0x2cf6('0x60')]);_0x28e5ba['query']=_[_0x2cf6('0x4b')](_0x3b592d[_0x2cf6('0x4a')]);_0x28e5ba[_0x2cf6('0x4c')]=_[_0x2cf6('0x4d')](_0x28e5ba['model'],_0x28e5ba['query']);_0x5df4aa[_0x2cf6('0x4f')]=_[_0x2cf6('0x4d')](_0x28e5ba[_0x2cf6('0x49')],qs[_0x2cf6('0x4e')](_0x3b592d[_0x2cf6('0x4a')][_0x2cf6('0x4e')]));_0x5df4aa[_0x2cf6('0x4f')]=_0x5df4aa[_0x2cf6('0x4f')][_0x2cf6('0x50')]?_0x5df4aa['attributes']:_0x28e5ba[_0x2cf6('0x49')];if(!_0x3b592d[_0x2cf6('0x4a')][_0x2cf6('0x51')]('nolimit')){_0x5df4aa[_0x2cf6('0x34')]=qs['limit'](_0x3b592d[_0x2cf6('0x4a')][_0x2cf6('0x34')]);_0x5df4aa[_0x2cf6('0x32')]=qs[_0x2cf6('0x32')](_0x3b592d[_0x2cf6('0x4a')]['offset']);}_0x5df4aa[_0x2cf6('0x53')]=qs['sort'](_0x3b592d[_0x2cf6('0x4a')][_0x2cf6('0x6d')]);_0x5df4aa[_0x2cf6('0x5a')]=qs[_0x2cf6('0x4c')](_[_0x2cf6('0x54')](_0x3b592d['query'],_0x28e5ba[_0x2cf6('0x4c')]));_0x5df4aa[_0x2cf6('0x5a')][_0x2cf6('0x6e')]=_0xd93f26['id'];if(_0x3b592d[_0x2cf6('0x4a')][_0x2cf6('0x55')]){_0x5df4aa[_0x2cf6('0x5a')]=_[_0x2cf6('0x56')](_0x5df4aa[_0x2cf6('0x5a')],{'$or':_['map'](_0x5df4aa[_0x2cf6('0x4f')],function(_0x4464db){var _0x5cec2d={};_0x5cec2d[_0x4464db]={'$like':'%'+_0x3b592d[_0x2cf6('0x4a')][_0x2cf6('0x55')]+'%'};return _0x5cec2d;})});}_0x5df4aa=_[_0x2cf6('0x56')]({},_0x5df4aa,_0x3b592d[_0x2cf6('0x59')]);return db[_0x2cf6('0x6b')][_0x2cf6('0x35')]({'where':_0x5df4aa['where']})['then'](function(_0x3d2d77){_0x1f15dd[_0x2cf6('0x35')]=_0x3d2d77;if(_0x3b592d['query'][_0x2cf6('0x5b')]){_0x5df4aa[_0x2cf6('0x5c')]=[{'all':!![]}];}return db[_0x2cf6('0x6b')][_0x2cf6('0x5d')](_0x5df4aa);})[_0x2cf6('0x24')](function(_0x17a985){_0x1f15dd[_0x2cf6('0x5e')]=_0x17a985;return _0x1f15dd;});}})[_0x2cf6('0x24')](respondWithFilteredResult(_0x2e01f9,_0x5df4aa))[_0x2cf6('0x2e')](handleError(_0x2e01f9,null));};exports[_0x2cf6('0x6f')]=function(_0x1f4d5b,_0x1e7ec5,_0x54be65){return db[_0x2cf6('0x46')][_0x2cf6('0x68')]({'where':{'id':_0x1f4d5b[_0x2cf6('0x5f')]['id']}})[_0x2cf6('0x24')](handleEntityNotFound(_0x1e7ec5,null))['then'](function(_0x2f2879){if(_0x2f2879){return _0x2f2879[_0x2cf6('0x6f')](_0x1f4d5b[_0x2cf6('0x4a')][_0x2cf6('0x70')]);}})[_0x2cf6('0x24')](respondWithStatusCode(_0x1e7ec5,null))[_0x2cf6('0x2e')](handleError(_0x1e7ec5,null));};exports['addAnswer']=function(_0x15cd67,_0x410d4b,_0x20313d){if(_0x15cd67[_0x2cf6('0x62')]['id']){delete _0x15cd67[_0x2cf6('0x62')]['id'];}return db[_0x2cf6('0x46')][_0x2cf6('0x68')]({'where':{'id':_0x15cd67[_0x2cf6('0x5f')]['id']}})[_0x2cf6('0x24')](handleEntityNotFound(_0x410d4b,null))[_0x2cf6('0x24')](function(_0x21fd81){if(_0x21fd81){_0x15cd67[_0x2cf6('0x62')][_0x2cf6('0x6e')]=_0x21fd81['id'];return db['CannedAnswer'][_0x2cf6('0x61')](_0x15cd67[_0x2cf6('0x62')]);}})[_0x2cf6('0x24')](respondWithResult(_0x410d4b,null))[_0x2cf6('0x2e')](handleError(_0x410d4b,null));};exports[_0x2cf6('0x71')]=function(_0x5adec1,_0x2742e3,_0xf31a8a){var _0x4efbd5={'raw':![],'where':{}};var _0x417737={};var _0x2ffd63={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x2cf6('0x6c')]({'where':{'id':_0x5adec1[_0x2cf6('0x5f')]['id']}})[_0x2cf6('0x24')](handleEntityNotFound(_0x2742e3,null))[_0x2cf6('0x24')](function(_0x39908d){if(_0x39908d){_0x417737['model']=_[_0x2cf6('0x4b')](db[_0x2cf6('0x72')][_0x2cf6('0x60')]);_0x417737[_0x2cf6('0x4a')]=_[_0x2cf6('0x4b')](_0x5adec1[_0x2cf6('0x4a')]);_0x417737[_0x2cf6('0x4c')]=_[_0x2cf6('0x4d')](_0x417737[_0x2cf6('0x49')],_0x417737[_0x2cf6('0x4a')]);_0x4efbd5[_0x2cf6('0x4f')]=_[_0x2cf6('0x4d')](_0x417737[_0x2cf6('0x49')],qs[_0x2cf6('0x4e')](_0x5adec1[_0x2cf6('0x4a')][_0x2cf6('0x4e')]));_0x4efbd5[_0x2cf6('0x4f')]=_0x4efbd5[_0x2cf6('0x4f')][_0x2cf6('0x50')]?_0x4efbd5[_0x2cf6('0x4f')]:_0x417737[_0x2cf6('0x49')];if(!_0x5adec1['query'][_0x2cf6('0x51')]('nolimit')){_0x4efbd5['limit']=qs[_0x2cf6('0x34')](_0x5adec1[_0x2cf6('0x4a')][_0x2cf6('0x34')]);_0x4efbd5[_0x2cf6('0x32')]=qs[_0x2cf6('0x32')](_0x5adec1[_0x2cf6('0x4a')][_0x2cf6('0x32')]);}_0x4efbd5[_0x2cf6('0x53')]=qs[_0x2cf6('0x6d')](_0x5adec1[_0x2cf6('0x4a')]['sort']);_0x4efbd5[_0x2cf6('0x5a')]=qs['filters'](_[_0x2cf6('0x54')](_0x5adec1[_0x2cf6('0x4a')],_0x417737[_0x2cf6('0x4c')]));_0x4efbd5['where'][_0x2cf6('0x6e')]=_0x39908d['id'];if(_0x5adec1[_0x2cf6('0x4a')]['filter']){_0x4efbd5['where']=_['merge'](_0x4efbd5[_0x2cf6('0x5a')],{'$or':_[_0x2cf6('0x45')](_0x4efbd5[_0x2cf6('0x4f')],function(_0x45145d){var _0x28c20e={};_0x28c20e[_0x45145d]={'$like':'%'+_0x5adec1[_0x2cf6('0x4a')][_0x2cf6('0x55')]+'%'};return _0x28c20e;})});}_0x4efbd5=_[_0x2cf6('0x56')]({},_0x4efbd5,_0x5adec1[_0x2cf6('0x59')]);return db[_0x2cf6('0x72')][_0x2cf6('0x35')]({'where':_0x4efbd5[_0x2cf6('0x5a')]})['then'](function(_0x58ccb7){_0x2ffd63[_0x2cf6('0x35')]=_0x58ccb7;if(_0x5adec1[_0x2cf6('0x4a')][_0x2cf6('0x5b')]){_0x4efbd5[_0x2cf6('0x5c')]=[{'all':!![]}];}return db[_0x2cf6('0x72')][_0x2cf6('0x5d')](_0x4efbd5);})[_0x2cf6('0x24')](function(_0x17e401){_0x2ffd63[_0x2cf6('0x5e')]=_0x17e401;return _0x2ffd63;});}})[_0x2cf6('0x24')](respondWithFilteredResult(_0x2742e3,_0x4efbd5))[_0x2cf6('0x2e')](handleError(_0x2742e3,null));};exports['removeAnswers']=function(_0x5d5ec7,_0x48fde8,_0x55e374){return db[_0x2cf6('0x46')][_0x2cf6('0x68')]({'where':{'id':_0x5d5ec7['params']['id']}})[_0x2cf6('0x24')](handleEntityNotFound(_0x48fde8,null))[_0x2cf6('0x24')](function(_0x4f7222){if(_0x4f7222){return _0x4f7222['removeAnswers'](_0x5d5ec7['query'][_0x2cf6('0x70')]);}})[_0x2cf6('0x24')](respondWithStatusCode(_0x48fde8,null))[_0x2cf6('0x2e')](handleError(_0x48fde8,null));};exports[_0x2cf6('0x73')]=function(_0x186f7e,_0x5332d9,_0x270b34){var _0x5a873b={'body':_0x186f7e[_0x2cf6('0x62')],'channel':_0x2cf6('0x74')};var _0x3d50df=[];var _0x595b88=[];var _0x4cafa8={};var _0x18aa46=![];return db[_0x2cf6('0x75')][_0x2cf6('0x69')]()[_0x2cf6('0x24')](function(_0x2b51d8){if(!_0x2b51d8){throw new db[(_0x2cf6('0x76'))][(_0x2cf6('0x77'))](_0x2cf6('0x78'));}_0x3d50df=_[_0x2cf6('0x79')](_[_0x2cf6('0x4b')](_0x2b51d8),[_0x2cf6('0x7a'),_0x2cf6('0x7b')]);_0x595b88=_[_0x2cf6('0x79')](_[_0x2cf6('0x4b')](_0x2b51d8),[_0x2cf6('0x7a'),'updatedAt',_0x2cf6('0x7c'),_0x2cf6('0x7d')]);if(_0x186f7e['body']['id']){delete _0x186f7e[_0x2cf6('0x62')]['id'];}if(_[_0x2cf6('0x7e')](_0x186f7e[_0x2cf6('0x62')]['from'])){throw new db[(_0x2cf6('0x76'))][(_0x2cf6('0x77'))]('from\x20is\x20mandatory');}if(_[_0x2cf6('0x7e')](_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x62')])||_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x62')]===''){throw new db[(_0x2cf6('0x76'))]['ValidationError'](_0x2cf6('0x7f'));}if(_['isNil'](_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x80')])){throw new db[(_0x2cf6('0x76'))][(_0x2cf6('0x77'))](_0x2cf6('0x81')+_0x595b88);}if(!_['includes'](_0x595b88,_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x80')])){throw new db['Sequelize']['ValidationError'](_0x2cf6('0x82')+_0x595b88);}_0x4cafa8[_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x80')]]=_0x186f7e['body'][_0x2cf6('0x83')];})['then'](function(){return db['OpenchannelAccount']['find']({'where':{'id':_0x186f7e[_0x2cf6('0x5f')]['id']},'include':[{'model':db[_0x2cf6('0x84')],'as':_0x2cf6('0x85'),'include':[{'model':db['CmContact'],'as':_0x2cf6('0x86'),'where':_0x4cafa8,'limit':0x1,'order':[[_0x2cf6('0x7b'),_0x2cf6('0x87')]]}]},{'model':db[_0x2cf6('0x88')],'as':_0x2cf6('0x89')}]});})[_0x2cf6('0x24')](handleEntityNotFound(_0x5332d9,null))[_0x2cf6('0x24')](function(_0x4151f4){if(_0x4151f4&&_0x4151f4[_0x2cf6('0x85')]){_0x5a873b[_0x2cf6('0x8a')]=_0x4151f4;_0x5a873b[_0x2cf6('0x8b')]=_0x4151f4['Applications'];_0x5a873b[_0x2cf6('0x8c')]=_0x4151f4['List'];_0x5a873b[_0x2cf6('0x8b')]=_[_0x2cf6('0x8d')](_0x5a873b[_0x2cf6('0x8b')],[_0x2cf6('0x8e')],[_0x2cf6('0x8f')]);if(_0x5a873b[_0x2cf6('0x8a')][_0x2cf6('0x89')]){delete _0x5a873b[_0x2cf6('0x8a')][_0x2cf6('0x89')];}if(_0x5a873b[_0x2cf6('0x8a')][_0x2cf6('0x85')]&&_0x5a873b['account'][_0x2cf6('0x85')]['Contacts'][_0x2cf6('0x50')]){return _0x5a873b[_0x2cf6('0x8a')][_0x2cf6('0x85')][_0x2cf6('0x86')][0x0];}var _0x5cc8b4=_['defaults'](_0x186f7e[_0x2cf6('0x62')],{'firstName':_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x83')],'ListId':_0x4151f4[_0x2cf6('0x7d')]});_0x5cc8b4[_0x186f7e[_0x2cf6('0x62')]['mapKey']]=_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x83')];return db['CmContact']['create'](_0x5cc8b4,{'fields':_0x3d50df,'raw':!![]});}})[_0x2cf6('0x24')](handleEntityNotFound(_0x5332d9,null))['then'](function(_0x34eee7){_0x5a873b[_0x2cf6('0x90')]=_0x34eee7;if(_0x34eee7){var _0x38da41={'ContactId':_0x34eee7['id'],'OpenchannelAccountId':_0x186f7e[_0x2cf6('0x5f')]['id'],'from':(_0x34eee7[_0x2cf6('0x91')]||'')+'\x20'+(_0x34eee7['lastName']||'')};var _0xf96b68={'OpenchannelAccountId':_0x186f7e['params']['id'],'closed':![]};if(_0x186f7e[_0x2cf6('0x62')]['threadId']){_0xf96b68[_0x2cf6('0x92')]=_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x92')];return db[_0x2cf6('0x93')][_0x2cf6('0x68')]({'where':_0xf96b68})['then'](function(_0x2fee06){if(_0x2fee06){return[_0x2fee06,![]];}_0x38da41[_0x2cf6('0x92')]=_0x186f7e['body'][_0x2cf6('0x92')];_0x38da41['externalUrl']=_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x94')];return db[_0x2cf6('0x93')][_0x2cf6('0x61')](_0x38da41)[_0x2cf6('0x24')](function(_0xdc025b){return[_0xdc025b,!![]];});});}else{_0xf96b68['threadId']=null;}_0xf96b68[_0x2cf6('0x95')]=_0x34eee7['id'];return db[_0x2cf6('0x93')][_0x2cf6('0x68')]({'where':_0xf96b68})[_0x2cf6('0x24')](function(_0x5a9bba){if(_0x5a9bba){return[_0x5a9bba,![]];}return db[_0x2cf6('0x93')][_0x2cf6('0x61')](_0x38da41)[_0x2cf6('0x24')](function(_0x1da45f){return[_0x1da45f,!![]];});});}})[_0x2cf6('0x96')](function(_0x19e491,_0x3c9522){if(_0x19e491){_0x18aa46=_0x3c9522;if(!_0x3c9522){var _0x2fe332={'from':(_0x5a873b[_0x2cf6('0x90')][_0x2cf6('0x91')]||'')+'\x20'+(_0x5a873b['contact']['lastName']||'')};if(_0x186f7e['body']['threadId']&&_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x97')]&&_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x92')]!=_0x186f7e['body']['messageId']){_0x2fe332[_0x2cf6('0x92')]=_0x186f7e['body'][_0x2cf6('0x97')];}return _0x19e491[_0x2cf6('0x3b')](_0x2fe332);}else{return _0x19e491;}}})[_0x2cf6('0x24')](function(_0x1958f8){_0x5a873b[_0x2cf6('0x98')]=_0x1958f8[_0x2cf6('0x3d')]({'plain':!![]});_0x5a873b[_0x2cf6('0x98')]['created']=_0x18aa46;if(_0x5a873b['interaction'][_0x2cf6('0x99')]){if(_0x5a873b[_0x2cf6('0x8a')][_0x2cf6('0x9a')]){_0x5a873b[_0x2cf6('0x8b')][_0x2cf6('0x9b')]({'id':0x0,'priority':_0x5a873b[_0x2cf6('0x8b')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}}return db['OpenchannelMessage']['create']({'body':_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x62')],'OpenchannelAccountId':_0x186f7e[_0x2cf6('0x5f')]['id'],'OpenchannelInteractionId':_0x1958f8['id'],'direction':'in','ContactId':_0x5a873b[_0x2cf6('0x90')]['id'],'AttachmentId':_0x186f7e[_0x2cf6('0x62')][_0x2cf6('0x9c')]});})[_0x2cf6('0x24')](function(_0x2aa374){_0x5a873b[_0x2cf6('0x2c')]=_0x2aa374;if(_0x5a873b[_0x2cf6('0x98')][_0x2cf6('0x9d')]){return db[_0x2cf6('0x9e')][_0x2cf6('0x68')]({'attributes':['id',_0x2cf6('0x41')],'where':{'id':_0x5a873b['interaction']['UserId']}})['then'](function(_0x1d6246){if(_0x1d6246){_0x5a873b[_0x2cf6('0x8b')][_0x2cf6('0x9f')]({'id':0x0,'priority':0x0,'app':_0x2cf6('0xa0'),'appdata':_0x1d6246[_0x2cf6('0x41')]+','+(_0x5a873b[_0x2cf6('0x8a')][_0x2cf6('0xa1')]||0xa),'interval':_0x2cf6('0xa2')});_0x5a873b[_0x2cf6('0xa3')]=![];}return respondWithRpcPromise('Start',_0x2cf6('0xa4'),_0x5a873b);});}return respondWithRpcPromise(_0x2cf6('0xa5'),_0x2cf6('0xa4'),_0x5a873b);})[_0x2cf6('0x24')](function(_0x5ad143){respondWithRpcPromise(_0x2cf6('0xa6'),_0x2cf6('0xa6'),{'event':_0x2cf6('0x73'),'message':_0x5ad143},client9002);return _0x5ad143;})[_0x2cf6('0x24')](respondWithResult(_0x5332d9,null))[_0x2cf6('0x2e')](handleError(_0x5332d9,null));};exports[_0x2cf6('0xa7')]=function(_0x3d1218,_0xa43646){var _0x5364da=_0x3d1218[_0x2cf6('0x5f')]['id'];var _0x1bbbe1=_0x3d1218[_0x2cf6('0x62')];var _0x2f9600=0xc8;var _0x1eec49=null;return db[_0x2cf6('0xa8')][_0x2cf6('0xa9')]({'isolationLevel':db[_0x2cf6('0xa8')]['Transaction']['ISOLATION_LEVELS'][_0x2cf6('0xaa')]},function(_0x136a23){return db[_0x2cf6('0x46')]['findOne']({'where':{'id':_0x5364da},'transaction':_0x136a23})[_0x2cf6('0x24')](function(_0x594159){if(_0x594159){return db['OpenchannelApplication'][_0x2cf6('0x3c')]({'where':{'OpenchannelAccountId':_0x5364da},'transaction':_0x136a23})['then'](function(){var _0xcd30c2=_[_0x2cf6('0x45')](_0x1bbbe1,function(_0x338521){_0x338521[_0x2cf6('0x6e')]=_0x5364da;return _0x338521;});return db[_0x2cf6('0x88')][_0x2cf6('0xab')](_0xcd30c2,{'transaction':_0x136a23});});}else{_0x2f9600=0x194;_0x1eec49=[];}});})[_0x2cf6('0x24')](function(){if(_0x2f9600!==0x194){return db[_0x2cf6('0x88')][_0x2cf6('0xac')]({'where':{'OpenchannelAccountId':_0x5364da},'order':_0x2cf6('0x8e')})[_0x2cf6('0x24')](function(_0x2f1865){_0x1eec49=_0x2f1865;});}})['catch'](function(_0x4f53f8){_0x2f9600=0x1f4;logger[_0x2cf6('0x2a')](_0x4f53f8['stack']);if(_0x4f53f8[_0x2cf6('0x41')]){delete _0x4f53f8[_0x2cf6('0x41')];}_0x1eec49=_0x4f53f8;})['finally'](function(){if(_0x1eec49===null){_0xa43646[_0x2cf6('0x2f')](_0x2f9600);}else{if(_0x2f9600===0x1f4){_0xa43646['status'](_0x2f9600)[_0x2cf6('0xad')](_0x1eec49);}else{_0xa43646[_0x2cf6('0x30')](_0x2f9600)[_0x2cf6('0x31')](_0x1eec49);}}});};exports['getApplications']=function(_0x35fbf2,_0x4a0806,_0xad2431){var _0x50eb15={};var _0x56f4be={};var _0xbb7684;var _0x173a4c;return db[_0x2cf6('0x46')][_0x2cf6('0x6c')]({'where':{'id':_0x35fbf2[_0x2cf6('0x5f')]['id']}})[_0x2cf6('0x24')](handleEntityNotFound(_0x4a0806,null))[_0x2cf6('0x24')](function(_0x5e9e77){if(_0x5e9e77){_0xbb7684=_0x5e9e77;_0x56f4be[_0x2cf6('0x49')]=_['keys'](db[_0x2cf6('0x88')][_0x2cf6('0x60')]);_0x56f4be[_0x2cf6('0x4a')]=_[_0x2cf6('0x4b')](_0x35fbf2[_0x2cf6('0x4a')]);_0x56f4be[_0x2cf6('0x4c')]=_[_0x2cf6('0x4d')](_0x56f4be[_0x2cf6('0x49')],_0x56f4be[_0x2cf6('0x4a')]);_0x50eb15[_0x2cf6('0x4f')]=_['intersection'](_0x56f4be['model'],qs[_0x2cf6('0x4e')](_0x35fbf2['query'][_0x2cf6('0x4e')]));_0x50eb15[_0x2cf6('0x4f')]=_0x50eb15[_0x2cf6('0x4f')][_0x2cf6('0x50')]?_0x50eb15[_0x2cf6('0x4f')]:_0x56f4be['model'];_0x50eb15['order']=qs[_0x2cf6('0x6d')](_0x35fbf2[_0x2cf6('0x4a')][_0x2cf6('0x6d')]);_0x50eb15[_0x2cf6('0x5a')]=qs[_0x2cf6('0x4c')](_[_0x2cf6('0x54')](_0x35fbf2[_0x2cf6('0x4a')],_0x56f4be['filters']));if(_0x35fbf2['query']['filter']){_0x50eb15[_0x2cf6('0x5a')]=_['merge'](_0x50eb15[_0x2cf6('0x5a')],{'$or':_['map'](_0x50eb15[_0x2cf6('0x4f')],function(_0x13aef6){var _0x274d3e={};_0x274d3e[_0x13aef6]={'$like':'%'+_0x35fbf2[_0x2cf6('0x4a')][_0x2cf6('0x55')]+'%'};return _0x274d3e;})});}_0x50eb15=_[_0x2cf6('0x56')]({},_0x50eb15,_0x35fbf2[_0x2cf6('0x59')]);return _0xbb7684['getApplications'](_0x50eb15);}})['then'](function(_0x128234){if(_0x128234){_0x173a4c=_0x128234[_0x2cf6('0x50')];if(!_0x35fbf2[_0x2cf6('0x4a')][_0x2cf6('0x51')](_0x2cf6('0x52'))){_0x50eb15[_0x2cf6('0x34')]=qs['limit'](_0x35fbf2[_0x2cf6('0x4a')][_0x2cf6('0x34')]);_0x50eb15[_0x2cf6('0x32')]=qs['offset'](_0x35fbf2['query'][_0x2cf6('0x32')]);}return _0xbb7684[_0x2cf6('0xae')](_0x50eb15);}})['then'](function(_0x196e6a){if(_0x196e6a){return _0x196e6a?{'count':_0x173a4c,'rows':_0x196e6a}:null;}})[_0x2cf6('0x24')](respondWithResult(_0x4a0806,null))[_0x2cf6('0x2e')](handleError(_0x4a0806,null));};exports[_0x2cf6('0xaf')]=function(_0x778f29,_0x48a4c9,_0xdd0bb){var _0x248b56={'raw':![],'where':{}};var _0x1e44e8={};var _0x216cb6={'count':0x0,'rows':[]};return db[_0x2cf6('0x46')][_0x2cf6('0x6c')]({'where':{'id':_0x778f29[_0x2cf6('0x5f')]['id']}})[_0x2cf6('0x24')](handleEntityNotFound(_0x48a4c9,null))[_0x2cf6('0x24')](function(_0x10ecdd){if(_0x10ecdd){_0x1e44e8[_0x2cf6('0x49')]=_[_0x2cf6('0x4b')](db[_0x2cf6('0x93')][_0x2cf6('0x60')]);_0x1e44e8[_0x2cf6('0x4a')]=_[_0x2cf6('0x4b')](_0x778f29[_0x2cf6('0x4a')]);_0x1e44e8[_0x2cf6('0x4c')]=_['intersection'](_0x1e44e8['model'],_0x1e44e8['query']);_0x248b56[_0x2cf6('0x4f')]=_[_0x2cf6('0x4d')](_0x1e44e8['model'],qs[_0x2cf6('0x4e')](_0x778f29[_0x2cf6('0x4a')][_0x2cf6('0x4e')]));_0x248b56[_0x2cf6('0x4f')]=_0x248b56[_0x2cf6('0x4f')][_0x2cf6('0x50')]?_0x248b56['attributes']:_0x1e44e8['model'];if(!_0x778f29[_0x2cf6('0x4a')]['hasOwnProperty']('nolimit')){_0x248b56[_0x2cf6('0x34')]=qs[_0x2cf6('0x34')](_0x778f29[_0x2cf6('0x4a')]['limit']);_0x248b56[_0x2cf6('0x32')]=qs[_0x2cf6('0x32')](_0x778f29[_0x2cf6('0x4a')][_0x2cf6('0x32')]);}_0x248b56[_0x2cf6('0x53')]=qs[_0x2cf6('0x6d')](_0x778f29[_0x2cf6('0x4a')][_0x2cf6('0x6d')]);_0x248b56[_0x2cf6('0x5a')]=qs[_0x2cf6('0x4c')](_[_0x2cf6('0x54')](_0x778f29['query'],_0x1e44e8[_0x2cf6('0x4c')]));_0x248b56[_0x2cf6('0x5a')][_0x2cf6('0x6e')]=_0x10ecdd['id'];if(_0x778f29[_0x2cf6('0x4a')]['filter']){_0x248b56['where']=_[_0x2cf6('0x56')](_0x248b56[_0x2cf6('0x5a')],{'$or':_[_0x2cf6('0x45')](_0x248b56[_0x2cf6('0x4f')],function(_0x3314d2){var _0x3e7076={};_0x3e7076[_0x3314d2]={'$like':'%'+_0x778f29[_0x2cf6('0x4a')][_0x2cf6('0x55')]+'%'};return _0x3e7076;})});}_0x248b56=_['merge']({},_0x248b56,_0x778f29[_0x2cf6('0x59')]);return db[_0x2cf6('0x93')][_0x2cf6('0x35')]({'where':_0x248b56[_0x2cf6('0x5a')]})[_0x2cf6('0x24')](function(_0x30cd3c){_0x216cb6['count']=_0x30cd3c;if(_0x778f29[_0x2cf6('0x4a')][_0x2cf6('0x5b')]){_0x248b56[_0x2cf6('0x5c')]=[{'model':db[_0x2cf6('0x75')],'as':_0x2cf6('0xb0'),'required':![]},{'model':db[_0x2cf6('0x9e')],'as':_0x2cf6('0xb1'),'attributes':[_0x2cf6('0x41'),_0x2cf6('0xb2'),_0x2cf6('0xb3')],'required':![]},{'model':db['Tag'],'as':_0x2cf6('0xb4'),'attributes':['id','name',_0x2cf6('0xb5')],'where':_0x778f29[_0x2cf6('0x4a')][_0x2cf6('0xb6')]?{'id':_0x778f29[_0x2cf6('0x4a')][_0x2cf6('0xb6')]}:undefined,'required':_0x778f29[_0x2cf6('0x4a')][_0x2cf6('0xb6')]?!![]:![]}];}return db[_0x2cf6('0x93')]['findAll'](_0x248b56);})[_0x2cf6('0x24')](function(_0x4b264b){_0x216cb6['rows']=_0x4b264b;return _0x216cb6;});}})[_0x2cf6('0x24')](respondWithFilteredResult(_0x48a4c9,_0x248b56))[_0x2cf6('0x2e')](handleError(_0x48a4c9,null));};exports[_0x2cf6('0xb7')]=function(_0x14a8bf,_0x35f0c8,_0x168d2b){return db[_0x2cf6('0x46')][_0x2cf6('0x68')]({'where':{'id':_0x14a8bf['params']['id']}})[_0x2cf6('0x24')](handleEntityNotFound(_0x35f0c8,null))['then'](function(_0x4ac108){if(_0x4ac108){return _0x4ac108[_0x2cf6('0xb7')](_0x14a8bf[_0x2cf6('0x62')][_0x2cf6('0x70')],_[_0x2cf6('0xb8')](_0x14a8bf[_0x2cf6('0x62')],[_0x2cf6('0x70'),'id'])||{})[_0x2cf6('0x96')](function(_0x2f8009){for(var _0x441b11=0x0;_0x441b11<_0x14a8bf[_0x2cf6('0x62')][_0x2cf6('0x70')][_0x2cf6('0x50')];_0x441b11+=0x1){socket['emit'](_0x2cf6('0xb9'),{'UserId':Number(_0x14a8bf['body'][_0x2cf6('0x70')][_0x441b11]),'OpenchannelAccountId':Number(_0x14a8bf[_0x2cf6('0x5f')]['id'])});}return _0x2f8009;});}})[_0x2cf6('0x24')](respondWithResult(_0x35f0c8,null))[_0x2cf6('0x2e')](handleError(_0x35f0c8,null));};exports[_0x2cf6('0xba')]=function(_0x1d9efa,_0x273b1e,_0x337e00){return db['OpenchannelAccount']['find']({'where':{'id':_0x1d9efa[_0x2cf6('0x5f')]['id']}})[_0x2cf6('0x24')](handleEntityNotFound(_0x273b1e,null))[_0x2cf6('0x24')](function(_0x2ba87f){if(_0x2ba87f){return _0x2ba87f['removeAgents'](_0x1d9efa[_0x2cf6('0x4a')]['ids'])[_0x2cf6('0x24')](function(){if(_[_0x2cf6('0xbb')](_0x1d9efa['query'][_0x2cf6('0x70')])){for(var _0x2c68dd=0x0;_0x2c68dd<_0x1d9efa['query'][_0x2cf6('0x70')]['length'];_0x2c68dd+=0x1){socket[_0x2cf6('0xbc')]('userOpenchannelAccount:remove',{'UserId':Number(_0x1d9efa[_0x2cf6('0x4a')]['ids'][_0x2c68dd]),'OpenchannelAccountId':Number(_0x1d9efa[_0x2cf6('0x5f')]['id'])});}}else{socket[_0x2cf6('0xbc')](_0x2cf6('0xbd'),{'UserId':Number(_0x1d9efa['query'][_0x2cf6('0x70')]),'OpenchannelAccountId':Number(_0x1d9efa[_0x2cf6('0x5f')]['id'])});}});}})[_0x2cf6('0x24')](respondWithStatusCode(_0x273b1e,null))[_0x2cf6('0x2e')](handleError(_0x273b1e,null));};exports['getAgents']=function(_0x308a8e,_0x24b7da,_0x110e57){var _0x2d42e6={};var _0x1a6ffc={};var _0x78f15b;var _0x5c6d2c;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x308a8e[_0x2cf6('0x5f')]['id']}})[_0x2cf6('0x24')](handleEntityNotFound(_0x24b7da,null))[_0x2cf6('0x24')](function(_0x6e3e78){if(_0x6e3e78){_0x78f15b=_0x6e3e78;_0x1a6ffc[_0x2cf6('0x49')]=_['keys'](db[_0x2cf6('0x9e')][_0x2cf6('0x60')]);_0x1a6ffc[_0x2cf6('0x4a')]=_[_0x2cf6('0x4b')](_0x308a8e['query']);_0x1a6ffc[_0x2cf6('0x4c')]=_['intersection'](_0x1a6ffc[_0x2cf6('0x49')],_0x1a6ffc[_0x2cf6('0x4a')]);_0x2d42e6[_0x2cf6('0x4f')]=_[_0x2cf6('0x4d')](_0x1a6ffc['model'],qs['fields'](_0x308a8e[_0x2cf6('0x4a')][_0x2cf6('0x4e')]));_0x2d42e6['attributes']=_0x2d42e6[_0x2cf6('0x4f')][_0x2cf6('0x50')]?_0x2d42e6['attributes']:_0x1a6ffc[_0x2cf6('0x49')];_0x2d42e6[_0x2cf6('0x53')]=qs['sort'](_0x308a8e[_0x2cf6('0x4a')]['sort']);_0x2d42e6[_0x2cf6('0x5a')]=qs[_0x2cf6('0x4c')](_[_0x2cf6('0x54')](_0x308a8e['query'],_0x1a6ffc[_0x2cf6('0x4c')]));if(_0x308a8e[_0x2cf6('0x4a')][_0x2cf6('0x55')]){_0x2d42e6[_0x2cf6('0x5a')]=_[_0x2cf6('0x56')](_0x2d42e6[_0x2cf6('0x5a')],{'$or':_['map'](_0x2d42e6['attributes'],function(_0x3fc413){var _0x1be8c7={};_0x1be8c7[_0x3fc413]={'$like':'%'+_0x308a8e[_0x2cf6('0x4a')][_0x2cf6('0x55')]+'%'};return _0x1be8c7;})});}_0x2d42e6=_['merge']({},_0x2d42e6,_0x308a8e[_0x2cf6('0x59')]);return _0x78f15b[_0x2cf6('0xbe')](_0x2d42e6);}})[_0x2cf6('0x24')](function(_0x183d8b){if(_0x183d8b){_0x5c6d2c=_0x183d8b['length'];if(!_0x308a8e[_0x2cf6('0x4a')][_0x2cf6('0x51')](_0x2cf6('0x52'))){_0x2d42e6[_0x2cf6('0x34')]=qs[_0x2cf6('0x34')](_0x308a8e[_0x2cf6('0x4a')][_0x2cf6('0x34')]);_0x2d42e6['offset']=qs[_0x2cf6('0x32')](_0x308a8e[_0x2cf6('0x4a')][_0x2cf6('0x32')]);}return _0x78f15b[_0x2cf6('0xbe')](_0x2d42e6);}})['then'](function(_0x410aef){if(_0x410aef){return _0x410aef?{'count':_0x5c6d2c,'rows':_0x410aef}:null;}})[_0x2cf6('0x24')](respondWithResult(_0x24b7da,null))[_0x2cf6('0x2e')](handleError(_0x24b7da,null));};exports[_0x2cf6('0xad')]=function(_0x5e30db,_0x527219,_0x1f7c4c){var _0x283483,_0x52236a,_0x44a5a1;if(_[_0x2cf6('0x7e')](_0x5e30db[_0x2cf6('0x62')][_0x2cf6('0x62')])||_0x5e30db[_0x2cf6('0x62')][_0x2cf6('0x62')]===''){throw new db[(_0x2cf6('0x76'))][(_0x2cf6('0x77'))](_0x2cf6('0x7f'));}if(_[_0x2cf6('0x7e')](_0x5e30db['body']['to'])){}_0x283483=_0x5e30db[_0x2cf6('0x62')]['to'];return db[_0x2cf6('0x46')]['findOne']({'where':{'id':_0x5e30db[_0x2cf6('0x5f')]['id']}})['then'](handleEntityNotFound(_0x527219,null))[_0x2cf6('0x24')](function(_0x5123ef){if(_0x5123ef){return db[_0x2cf6('0x46')]['find']({'where':{'id':_0x5123ef['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x2cf6('0x75')],'as':_0x2cf6('0x86'),'where':{[_0x5123ef['mapKey']]:_0x283483},'limit':0x1,'order':[['updatedAt',_0x2cf6('0x87')]]}]}]})[_0x2cf6('0x24')](handleEntityNotFound(_0x527219,null))[_0x2cf6('0x24')](function(_0x50d94e){if(_0x50d94e&&_0x50d94e[_0x2cf6('0x85')]){_0x52236a=_0x50d94e[_0x2cf6('0x3d')]({'plain':!![]});if(_0x52236a[_0x2cf6('0x85')]&&_0x52236a[_0x2cf6('0x85')][_0x2cf6('0x86')][_0x2cf6('0x50')]){return _0x52236a[_0x2cf6('0x85')][_0x2cf6('0x86')][0x0];}return db[_0x2cf6('0x75')][_0x2cf6('0x61')](_[_0x2cf6('0xbf')](_0x5e30db[_0x2cf6('0x62')],{'firstName':_0x283483,[_0x50d94e[_0x2cf6('0x80')]]:_0x283483,'phone':_0x283483,'ListId':_0x52236a[_0x2cf6('0x7d')]}));}})['then'](handleEntityNotFound(_0x527219,null))['then'](function(_0x55878e){if(_0x55878e){_0x44a5a1=_0x55878e;return db[_0x2cf6('0x93')]['find']({'where':{'ContactId':_0x44a5a1['id'],'closed':![],'OpenchannelAccountId':_0x52236a['id']}})[_0x2cf6('0x24')](function(_0x1396da){if(_0x1396da){return[_0x1396da,![]];}return db[_0x2cf6('0x93')]['create']({'UserId':_0x5e30db[_0x2cf6('0x64')]['id'],'ContactId':_0x44a5a1['id'],'OpenchannelAccountId':_0x52236a['id'],'lastMsgDirection':'out','firstMsgDirection':_0x2cf6('0xc0'),'Messages':[_['merge'](_0x5e30db[_0x2cf6('0x62')],{'read':![],'body':_0x5e30db['body'][_0x2cf6('0x62')],'OpenchannelAccountId':_0x52236a['id'],'UserId':_0x5e30db[_0x2cf6('0x64')]['id'],'ContactId':_0x44a5a1['id']})]},{'include':[{'model':db[_0x2cf6('0xc1')],'as':_0x2cf6('0xc2')}]})[_0x2cf6('0x24')](function(_0x97fe60){return[_0x97fe60,!![]];});});}})[_0x2cf6('0x96')](function(_0x3c900b,_0x905f21){if(_0x905f21){return _0x3c900b;}return db['OpenchannelMessage'][_0x2cf6('0x61')](_[_0x2cf6('0x56')](_0x5e30db[_0x2cf6('0x62')],{'read':![],'body':_0x5e30db[_0x2cf6('0x62')][_0x2cf6('0x62')],'OpenchannelAccountId':_0x52236a['id'],'OpenchannelInteractionId':_0x3c900b['id'],'UserId':_0x5e30db[_0x2cf6('0x64')]['id'],'ContactId':_0x44a5a1['id']}))[_0x2cf6('0x24')](function(_0x4e1ce8){_0x3c900b[_0x2cf6('0xc3')][_0x2cf6('0xc2')]=[];_0x3c900b[_0x2cf6('0xc3')][_0x2cf6('0xc2')][_0x2cf6('0x9b')](_0x4e1ce8[_0x2cf6('0xc3')]);return _0x3c900b;});});}})['then'](respondWithResult(_0x527219,null))[_0x2cf6('0x2e')](handleError(_0x527219,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 88a7fa7..76d280a 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(_0x2d696c,_0x11f4d6){var _0x56d8ae=function(_0x12912a){while(--_0x12912a){_0x2d696c['push'](_0x2d696c['shift']());}};_0x56d8ae(++_0x11f4d6);}(_0x1be1,0x192));var _0x11be=function(_0x34572f,_0x5eba20){_0x34572f=_0x34572f-0x0;var _0x459e81=_0x1be1[_0x34572f];return _0x459e81;};'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 _0xee5b=['remove','emit','hasOwnProperty','hook','events','OpenchannelAccount','setMaxListeners','update'];(function(_0x33d625,_0x4ea5b3){var _0x5c64a2=function(_0x58878e){while(--_0x58878e){_0x33d625['push'](_0x33d625['shift']());}};_0x5c64a2(++_0x4ea5b3);}(_0xee5b,0x1f4));var _0xbee5=function(_0xf9ff38,_0x368f9a){_0xf9ff38=_0xf9ff38-0x0;var _0x5efd3e=_0xee5b[_0xf9ff38];return _0x5efd3e;};'use strict';var EventEmitter=require(_0xbee5('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xbee5('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xbee5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbee5('0x3'),'afterDestroy':_0xbee5('0x4')};function emitEvent(_0x2eb857){return function(_0x210159,_0x4bd202,_0x5200b1){OpenchannelAccountEvents[_0xbee5('0x5')](_0x2eb857+':'+_0x210159['id'],_0x210159);OpenchannelAccountEvents[_0xbee5('0x5')](_0x2eb857,_0x210159);_0x5200b1(null);};}for(var e in events){if(events[_0xbee5('0x6')](e)){var event=events[e];OpenchannelAccount[_0xbee5('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index f258483..7b94d2e 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(_0x292a5e,_0x4fbec3){var _0x317d5c=function(_0x1b47a6){while(--_0x1b47a6){_0x292a5e['push'](_0x292a5e['shift']());}};_0x317d5c(++_0x4fbec3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x47b271,_0x1cf1c8){var _0x12f803=function(_0x7b5392){while(--_0x7b5392){_0x47b271['push'](_0x47b271['shift']());}};_0x12f803(++_0x1cf1c8);}(_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 diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index 1f8c39b..cb27bdf 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 _0x7462=['OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x7462,0x165));var _0x2746=function(_0x54ccd7,_0x3bc3ce){_0x54ccd7=_0x54ccd7-0x0;var _0x4e667b=_0x7462[_0x54ccd7];return _0x4e667b;};'use strict';var _=require(_0x2746('0x0'));var util=require(_0x2746('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2746('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2746('0x3'));var logger=require(_0x2746('0x4'))('rpc');var config=require(_0x2746('0x5'));var jayson=require(_0x2746('0x6'));var client=jayson[_0x2746('0x7')][_0x2746('0x8')]({'port':0x232a});config[_0x2746('0x9')]=_[_0x2746('0xa')](config[_0x2746('0x9')],{'host':_0x2746('0xb'),'port':0x18eb});var socket=require(_0x2746('0xc'))(new Redis(config['redis']));require(_0x2746('0xd'))[_0x2746('0xe')](socket);function respondWithRpcPromise(_0x4f9eb7,_0x19bec3,_0x1a6329){return new BPromise(function(_0x2ea416,_0x5aef7e){return client[_0x2746('0xf')](_0x4f9eb7,_0x1a6329)[_0x2746('0x10')](function(_0x1a6d97){logger[_0x2746('0x11')](_0x2746('0x12'),_0x19bec3,_0x2746('0x13'));logger[_0x2746('0x14')](_0x2746('0x15'),_0x19bec3,_0x2746('0x13'),JSON[_0x2746('0x16')](_0x1a6d97));if(_0x1a6d97[_0x2746('0x17')]){if(_0x1a6d97['error']['code']===0x1f4){logger[_0x2746('0x17')](_0x2746('0x12'),_0x19bec3,_0x1a6d97[_0x2746('0x17')][_0x2746('0x18')]);return _0x5aef7e(_0x1a6d97['error'][_0x2746('0x18')]);}logger[_0x2746('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x19bec3,_0x1a6d97['error'][_0x2746('0x18')]);return _0x2ea416(_0x1a6d97[_0x2746('0x17')][_0x2746('0x18')]);}else{logger[_0x2746('0x11')](_0x2746('0x12'),_0x19bec3,_0x2746('0x13'));_0x2ea416(_0x1a6d97[_0x2746('0x19')][_0x2746('0x18')]);}})[_0x2746('0x1a')](function(_0x509879){logger[_0x2746('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x19bec3,_0x509879);_0x5aef7e(_0x509879);});});} \ No newline at end of file +var _0x2547=['../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','request','then','info','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x2547,0x1cd));var _0x7254=function(_0x3a204c,_0x122ef3){_0x3a204c=_0x3a204c-0x0;var _0x2190f3=_0x2547[_0x3a204c];return _0x2190f3;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var moment=require(_0x7254('0x1'));var BPromise=require(_0x7254('0x2'));var rs=require(_0x7254('0x3'));var fs=require('fs');var Redis=require(_0x7254('0x4'));var db=require(_0x7254('0x5'))['db'];var utils=require(_0x7254('0x6'));var logger=require(_0x7254('0x7'))('rpc');var config=require(_0x7254('0x8'));var jayson=require(_0x7254('0x9'));var client=jayson[_0x7254('0xa')][_0x7254('0xb')]({'port':0x232a});config['redis']=_[_0x7254('0xc')](config[_0x7254('0xd')],{'host':_0x7254('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7254('0xd')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x51a750,_0x3036ab,_0x30086e){return new BPromise(function(_0x31d5a5,_0x310c21){return client[_0x7254('0xf')](_0x51a750,_0x30086e)[_0x7254('0x10')](function(_0x4d19e8){logger[_0x7254('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x3036ab,_0x7254('0x12'));logger['debug'](_0x7254('0x13'),_0x3036ab,_0x7254('0x12'),JSON[_0x7254('0x14')](_0x4d19e8));if(_0x4d19e8[_0x7254('0x15')]){if(_0x4d19e8[_0x7254('0x15')][_0x7254('0x16')]===0x1f4){logger[_0x7254('0x15')](_0x7254('0x17'),_0x3036ab,_0x4d19e8[_0x7254('0x15')][_0x7254('0x18')]);return _0x310c21(_0x4d19e8[_0x7254('0x15')][_0x7254('0x18')]);}logger[_0x7254('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x3036ab,_0x4d19e8[_0x7254('0x15')][_0x7254('0x18')]);return _0x31d5a5(_0x4d19e8[_0x7254('0x15')][_0x7254('0x18')]);}else{logger[_0x7254('0x11')](_0x7254('0x17'),_0x3036ab,_0x7254('0x12'));_0x31d5a5(_0x4d19e8['result'][_0x7254('0x18')]);}})[_0x7254('0x19')](function(_0x1fb71c){logger[_0x7254('0x15')](_0x7254('0x17'),_0x3036ab,_0x1fb71c);_0x310c21(_0x1fb71c);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index c7a9e08..2653c44 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 _0xf194=['remove','update','removeListener','register','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x4ab32f,_0x5506bb){var _0xe5d52e=function(_0x525b3c){while(--_0x525b3c){_0x4ab32f['push'](_0x4ab32f['shift']());}};_0xe5d52e(++_0x5506bb);}(_0xf194,0x91));var _0x4f19=function(_0x4bcc21,_0x387cde){_0x4bcc21=_0x4bcc21-0x0;var _0x52d160=_0xf194[_0x4bcc21];return _0x52d160;};'use strict';var OpenchannelAccountEvents=require(_0x4f19('0x0'));var events=[_0x4f19('0x1'),_0x4f19('0x2'),_0x4f19('0x3')];function createListener(_0x52e2fb,_0x13475c){return function(_0x533c58){_0x13475c['emit'](_0x52e2fb,_0x533c58);};}function removeListener(_0x5c0587,_0x2db75c){return function(){OpenchannelAccountEvents[_0x4f19('0x4')](_0x5c0587,_0x2db75c);};}exports[_0x4f19('0x5')]=function(_0x57c148){for(var _0x1fbd23=0x0,_0x45c88a=events['length'];_0x1fbd23<_0x45c88a;_0x1fbd23++){var _0x4b023f=events[_0x1fbd23];var _0x265d15=createListener(_0x4f19('0x6')+_0x4b023f,_0x57c148);OpenchannelAccountEvents['on'](_0x4b023f,_0x265d15);}}; \ No newline at end of file +var _0x7a72=['removeListener','openchannelAccount:','save','remove'];(function(_0x4b7b69,_0x3ab075){var _0x173b4c=function(_0x234d5f){while(--_0x234d5f){_0x4b7b69['push'](_0x4b7b69['shift']());}};_0x173b4c(++_0x3ab075);}(_0x7a72,0x1be));var _0x27a7=function(_0x6d3047,_0x2b5604){_0x6d3047=_0x6d3047-0x0;var _0xe7b4b9=_0x7a72[_0x6d3047];return _0xe7b4b9;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x27a7('0x0'),_0x27a7('0x1'),'update'];function createListener(_0x316bd3,_0x4b4ed5){return function(_0x15d71f){_0x4b4ed5['emit'](_0x316bd3,_0x15d71f);};}function removeListener(_0x30a1a8,_0x502521){return function(){OpenchannelAccountEvents[_0x27a7('0x2')](_0x30a1a8,_0x502521);};}exports['register']=function(_0x320fad){for(var _0x372bb8=0x0,_0x5d7305=events['length'];_0x372bb8<_0x5d7305;_0x372bb8++){var _0x1de957=events[_0x372bb8];var _0x54e6ee=createListener(_0x27a7('0x3')+_0x1de957,_0x320fad);OpenchannelAccountEvents['on'](_0x1de957,_0x54e6ee);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 4442ee2..4ac6ce6 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 _0x482c=['multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','/:id','post','isAuthenticated','create','put','update','destroy'];(function(_0x517961,_0xf0e6e3){var _0x1ce75a=function(_0x5e0909){while(--_0x5e0909){_0x517961['push'](_0x517961['shift']());}};_0x1ce75a(++_0xf0e6e3);}(_0x482c,0xff));var _0xc482=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x482c[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require(_0xc482('0x0'));var util=require(_0xc482('0x1'));var path=require('path');var timeout=require(_0xc482('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc482('0x3'));var interaction=require(_0xc482('0x4'));var config=require(_0xc482('0x5'));var controller=require(_0xc482('0x6'));router[_0xc482('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc482('0x7')](_0xc482('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xc482('0x9')]('/',auth[_0xc482('0xa')](),controller[_0xc482('0xb')]);router[_0xc482('0xc')](_0xc482('0x8'),auth[_0xc482('0xa')](),controller[_0xc482('0xd')]);router['delete'](_0xc482('0x8'),auth[_0xc482('0xa')](),controller[_0xc482('0xe')]);module['exports']=router; \ No newline at end of file +var _0x9e88=['put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','/:id','create'];(function(_0x47fa1b,_0x2894e1){var _0x18a4cc=function(_0x421fbd){while(--_0x421fbd){_0x47fa1b['push'](_0x47fa1b['shift']());}};_0x18a4cc(++_0x2894e1);}(_0x9e88,0x1a2));var _0x89e8=function(_0x120a24,_0x2d8b1d){_0x120a24=_0x120a24-0x0;var _0x336213=_0x9e88[_0x120a24];return _0x336213;};'use strict';var multer=require(_0x89e8('0x0'));var util=require(_0x89e8('0x1'));var path=require(_0x89e8('0x2'));var timeout=require('connect-timeout');var express=require(_0x89e8('0x3'));var router=express[_0x89e8('0x4')]();var fs_extra=require(_0x89e8('0x5'));var auth=require(_0x89e8('0x6'));var interaction=require(_0x89e8('0x7'));var config=require(_0x89e8('0x8'));var controller=require(_0x89e8('0x9'));router[_0x89e8('0xa')]('/',auth[_0x89e8('0xb')](),controller['index']);router['get'](_0x89e8('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x89e8('0xb')](),controller[_0x89e8('0xd')]);router[_0x89e8('0xe')](_0x89e8('0xc'),auth[_0x89e8('0xb')](),controller['update']);router[_0x89e8('0xf')]('/:id',auth[_0x89e8('0xb')](),controller[_0x89e8('0x10')]);module[_0x89e8('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index e6fd921..5c4d966 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 _0x996f=['STRING','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x2ea475,_0x289262){var _0x177fa7=function(_0x47baec){while(--_0x47baec){_0x2ea475['push'](_0x2ea475['shift']());}};_0x177fa7(++_0x289262);}(_0x996f,0x97));var _0xf996=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x996f[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require(_0xf996('0x0'));module[_0xf996('0x1')]={'priority':{'type':Sequelize[_0xf996('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf996('0x3')},'appdata':{'type':Sequelize[_0xf996('0x4')]()},'description':{'type':Sequelize[_0xf996('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x8e5a=['noop','*,*,*,*','INTEGER','STRING'];(function(_0x578818,_0xd3b4ac){var _0x33aad8=function(_0x36946f){while(--_0x36946f){_0x578818['push'](_0x578818['shift']());}};_0x33aad8(++_0xd3b4ac);}(_0x8e5a,0x16a));var _0xa8e5=function(_0x38628f,_0x14e381){_0x38628f=_0x38628f-0x0;var _0x3771ee=_0x8e5a[_0x38628f];return _0x3771ee;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xa8e5('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xa8e5('0x1')],'allowNull':![],'defaultValue':_0xa8e5('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xa8e5('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa8e5('0x3')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index d53c655..8e39fa0 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 _0x10ce=['create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','to-csv','ejs','fs-extra','crypto','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','save','update','destroy','then','error','name','send','index','map','OpenchannelApplication','rawAttributes','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','length','find'];(function(_0x239083,_0x2fbbfe){var _0x4bc232=function(_0x58680c){while(--_0x58680c){_0x239083['push'](_0x239083['shift']());}};_0x4bc232(++_0x2fbbfe);}(_0x10ce,0x1b2));var _0xe10c=function(_0x45278e,_0x1de532){_0x45278e=_0x45278e-0x0;var _0x5e4516=_0x10ce[_0x45278e];return _0x5e4516;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe10c('0x0'));var zipdir=require(_0xe10c('0x1'));var jsonpatch=require(_0xe10c('0x2'));var rp=require(_0xe10c('0x3'));var moment=require(_0xe10c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe10c('0x5'));var sox=require('sox');var csv=require(_0xe10c('0x6'));var ejs=require(_0xe10c('0x7'));var fs=require('fs');var fs_extra=require(_0xe10c('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe10c('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe10c('0xa'));var toCsv=require(_0xe10c('0x6'));var querystring=require(_0xe10c('0xb'));var Papa=require(_0xe10c('0xc'));var Redis=require(_0xe10c('0xd'));var authService=require(_0xe10c('0xe'));var qs=require(_0xe10c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe10c('0x10'));var logger=require(_0xe10c('0x11'))(_0xe10c('0x12'));var utils=require(_0xe10c('0x13'));var config=require(_0xe10c('0x14'));var licenseUtil=require(_0xe10c('0x15'));var db=require(_0xe10c('0x16'))['db'];function respondWithStatusCode(_0x2a0e42,_0x156a4c){_0x156a4c=_0x156a4c||0xcc;return function(_0x4ec581){if(_0x4ec581){return _0x2a0e42[_0xe10c('0x17')](_0x156a4c);}return _0x2a0e42[_0xe10c('0x18')](_0x156a4c)[_0xe10c('0x19')]();};}function respondWithResult(_0x31ac8d,_0x41edcc){_0x41edcc=_0x41edcc||0xc8;return function(_0x13f6fb){if(_0x13f6fb){return _0x31ac8d[_0xe10c('0x18')](_0x41edcc)[_0xe10c('0x1a')](_0x13f6fb);}};}function respondWithFilteredResult(_0x2bb635,_0x3431e4){return function(_0x48bf08){if(_0x48bf08){var _0xa86911=typeof _0x3431e4[_0xe10c('0x1b')]===_0xe10c('0x1c')&&typeof _0x3431e4['limit']==='undefined';var _0x102693=_0x48bf08[_0xe10c('0x1d')];var _0x36ed80=_0xa86911?0x0:_0x3431e4['offset'];var _0x596464=_0xa86911?_0x48bf08[_0xe10c('0x1d')]:_0x3431e4[_0xe10c('0x1b')]+_0x3431e4['limit'];var _0xc16ee5;if(_0x596464>=_0x102693){_0x596464=_0x102693;_0xc16ee5=0xc8;}else{_0xc16ee5=0xce;}_0x2bb635['status'](_0xc16ee5);return _0x2bb635[_0xe10c('0x1e')]('Content-Range',_0x36ed80+'-'+_0x596464+'/'+_0x102693)[_0xe10c('0x1a')](_0x48bf08);}return null;};}function patchUpdates(_0x134f1d){return function(_0x28cada){try{jsonpatch[_0xe10c('0x1f')](_0x28cada,_0x134f1d,!![]);}catch(_0x63b172){return BPromise['reject'](_0x63b172);}return _0x28cada[_0xe10c('0x20')]();};}function saveUpdates(_0x555d39,_0x57b736){return function(_0xae8f3d){if(_0xae8f3d){return _0xae8f3d[_0xe10c('0x21')](_0x555d39)['then'](function(_0x8e96c1){return _0x8e96c1;});}return null;};}function removeEntity(_0x4e7635,_0x382307){return function(_0x2c2c80){if(_0x2c2c80){return _0x2c2c80[_0xe10c('0x22')]()[_0xe10c('0x23')](function(){_0x4e7635[_0xe10c('0x18')](0xcc)[_0xe10c('0x19')]();});}};}function handleEntityNotFound(_0x42dad8,_0x8db362){return function(_0x598a80){if(!_0x598a80){_0x42dad8['sendStatus'](0x194);}return _0x598a80;};}function handleError(_0x30b070,_0x371b74){_0x371b74=_0x371b74||0x1f4;return function(_0xff7e82){logger[_0xe10c('0x24')](_0xff7e82['stack']);if(_0xff7e82['name']){delete _0xff7e82[_0xe10c('0x25')];}_0x30b070[_0xe10c('0x18')](_0x371b74)[_0xe10c('0x26')](_0xff7e82);};}exports[_0xe10c('0x27')]=function(_0x4ccf66,_0x41c4ee){var _0x2cd541={},_0x33d1d0={},_0x3e1946={'count':0x0,'rows':[]};var _0x3c16a7=_[_0xe10c('0x28')](db[_0xe10c('0x29')][_0xe10c('0x2a')],function(_0x2b64f5){return{'name':_0x2b64f5['fieldName'],'type':_0x2b64f5['type'][_0xe10c('0x2b')]};});_0x33d1d0[_0xe10c('0x2c')]=_[_0xe10c('0x28')](_0x3c16a7,_0xe10c('0x25'));_0x33d1d0[_0xe10c('0x2d')]=_['keys'](_0x4ccf66[_0xe10c('0x2d')]);_0x33d1d0[_0xe10c('0x2e')]=_[_0xe10c('0x2f')](_0x33d1d0[_0xe10c('0x2c')],_0x33d1d0[_0xe10c('0x2d')]);_0x2cd541[_0xe10c('0x30')]=_[_0xe10c('0x2f')](_0x33d1d0[_0xe10c('0x2c')],qs[_0xe10c('0x31')](_0x4ccf66[_0xe10c('0x2d')]['fields']));_0x2cd541[_0xe10c('0x30')]=_0x2cd541[_0xe10c('0x30')]['length']?_0x2cd541['attributes']:_0x33d1d0[_0xe10c('0x2c')];if(!_0x4ccf66[_0xe10c('0x2d')][_0xe10c('0x32')](_0xe10c('0x33'))){_0x2cd541[_0xe10c('0x34')]=qs[_0xe10c('0x34')](_0x4ccf66[_0xe10c('0x2d')]['limit']);_0x2cd541[_0xe10c('0x1b')]=qs[_0xe10c('0x1b')](_0x4ccf66[_0xe10c('0x2d')][_0xe10c('0x1b')]);}_0x2cd541[_0xe10c('0x35')]=qs[_0xe10c('0x36')](_0x4ccf66[_0xe10c('0x2d')][_0xe10c('0x36')]);_0x2cd541[_0xe10c('0x37')]=qs[_0xe10c('0x2e')](_['pick'](_0x4ccf66[_0xe10c('0x2d')],_0x33d1d0['filters']),_0x3c16a7);if(_0x4ccf66['query'][_0xe10c('0x38')]){_0x2cd541[_0xe10c('0x37')]=_[_0xe10c('0x39')](_0x2cd541[_0xe10c('0x37')],{'$or':_[_0xe10c('0x28')](_0x3c16a7,function(_0x13e500){if(_0x13e500[_0xe10c('0x3a')]!==_0xe10c('0x3b')){var _0x4672c1={};_0x4672c1[_0x13e500['name']]={'$like':'%'+_0x4ccf66['query'][_0xe10c('0x38')]+'%'};return _0x4672c1;}})});}_0x2cd541=_[_0xe10c('0x39')]({},_0x2cd541,_0x4ccf66[_0xe10c('0x3c')]);var _0x46c14f={'where':_0x2cd541['where']};return db[_0xe10c('0x29')][_0xe10c('0x1d')](_0x46c14f)[_0xe10c('0x23')](function(_0x31f020){_0x3e1946['count']=_0x31f020;if(_0x4ccf66['query'][_0xe10c('0x3d')]){_0x2cd541[_0xe10c('0x3e')]=[{'all':!![]}];}return db[_0xe10c('0x29')][_0xe10c('0x3f')](_0x2cd541);})[_0xe10c('0x23')](function(_0x24f1a6){_0x3e1946['rows']=_0x24f1a6;return _0x3e1946;})[_0xe10c('0x23')](respondWithFilteredResult(_0x41c4ee,_0x2cd541))[_0xe10c('0x40')](handleError(_0x41c4ee,null));};exports[_0xe10c('0x41')]=function(_0x37faa1,_0x36eab3){var _0x27bf5c={'raw':!![],'where':{'id':_0x37faa1[_0xe10c('0x42')]['id']}},_0x155ea4={};_0x155ea4[_0xe10c('0x2c')]=_[_0xe10c('0x43')](db[_0xe10c('0x29')][_0xe10c('0x2a')]);_0x155ea4[_0xe10c('0x2d')]=_[_0xe10c('0x43')](_0x37faa1['query']);_0x155ea4[_0xe10c('0x2e')]=_['intersection'](_0x155ea4['model'],_0x155ea4[_0xe10c('0x2d')]);_0x27bf5c[_0xe10c('0x30')]=_[_0xe10c('0x2f')](_0x155ea4[_0xe10c('0x2c')],qs[_0xe10c('0x31')](_0x37faa1[_0xe10c('0x2d')][_0xe10c('0x31')]));_0x27bf5c['attributes']=_0x27bf5c[_0xe10c('0x30')][_0xe10c('0x44')]?_0x27bf5c[_0xe10c('0x30')]:_0x155ea4[_0xe10c('0x2c')];if(_0x37faa1[_0xe10c('0x2d')]['includeAll']){_0x27bf5c[_0xe10c('0x3e')]=[{'all':!![]}];}_0x27bf5c=_[_0xe10c('0x39')]({},_0x27bf5c,_0x37faa1[_0xe10c('0x3c')]);return db[_0xe10c('0x29')][_0xe10c('0x45')](_0x27bf5c)[_0xe10c('0x23')](handleEntityNotFound(_0x36eab3,null))[_0xe10c('0x23')](respondWithResult(_0x36eab3,null))[_0xe10c('0x40')](handleError(_0x36eab3,null));};exports['create']=function(_0x4d08d8,_0x31aa74){return db[_0xe10c('0x29')][_0xe10c('0x46')](_0x4d08d8['body'],{})['then'](respondWithResult(_0x31aa74,0xc9))[_0xe10c('0x40')](handleError(_0x31aa74,null));};exports['update']=function(_0x4509bb,_0x2b66c7){if(_0x4509bb[_0xe10c('0x47')]['id']){delete _0x4509bb[_0xe10c('0x47')]['id'];}return db['OpenchannelApplication'][_0xe10c('0x45')]({'where':{'id':_0x4509bb['params']['id']}})[_0xe10c('0x23')](handleEntityNotFound(_0x2b66c7,null))[_0xe10c('0x23')](saveUpdates(_0x4509bb[_0xe10c('0x47')],null))[_0xe10c('0x23')](respondWithResult(_0x2b66c7,null))[_0xe10c('0x40')](handleError(_0x2b66c7,null));};exports[_0xe10c('0x22')]=function(_0x14d0d5,_0x56d6c8){return db[_0xe10c('0x29')][_0xe10c('0x45')]({'where':{'id':_0x14d0d5['params']['id']}})[_0xe10c('0x23')](handleEntityNotFound(_0x56d6c8,null))[_0xe10c('0x23')](removeEntity(_0x56d6c8,null))['catch'](handleError(_0x56d6c8,null));}; \ No newline at end of file +var _0xfb16=['pick','filter','where','merge','VIRTUAL','options','includeAll','include','OpenchannelApplication','findAll','catch','show','params','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','apply','reject','then','destroy','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0xa6d278,_0x1ffc26){var _0x242ed8=function(_0x260d54){while(--_0x260d54){_0xa6d278['push'](_0xa6d278['shift']());}};_0x242ed8(++_0x1ffc26);}(_0xfb16,0xef));var _0x6fb1=function(_0x1e92ef,_0x585884){_0x1e92ef=_0x1e92ef-0x0;var _0x295750=_0xfb16[_0x1e92ef];return _0x295750;};'use strict';var emlformat=require(_0x6fb1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6fb1('0x1'));var jsonpatch=require(_0x6fb1('0x2'));var rp=require(_0x6fb1('0x3'));var moment=require(_0x6fb1('0x4'));var BPromise=require(_0x6fb1('0x5'));var Mustache=require(_0x6fb1('0x6'));var util=require(_0x6fb1('0x7'));var path=require(_0x6fb1('0x8'));var sox=require(_0x6fb1('0x9'));var csv=require(_0x6fb1('0xa'));var ejs=require(_0x6fb1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6fb1('0xc'));var squel=require('squel');var crypto=require(_0x6fb1('0xd'));var jsforce=require(_0x6fb1('0xe'));var deskjs=require(_0x6fb1('0xf'));var toCsv=require(_0x6fb1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6fb1('0x10'));var authService=require(_0x6fb1('0x11'));var qs=require(_0x6fb1('0x12'));var as=require(_0x6fb1('0x13'));var hardwareService=require(_0x6fb1('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6fb1('0x15'));var licenseUtil=require(_0x6fb1('0x16'));var db=require(_0x6fb1('0x17'))['db'];function respondWithStatusCode(_0x2ebfae,_0x491242){_0x491242=_0x491242||0xcc;return function(_0x9e0b88){if(_0x9e0b88){return _0x2ebfae[_0x6fb1('0x18')](_0x491242);}return _0x2ebfae[_0x6fb1('0x19')](_0x491242)[_0x6fb1('0x1a')]();};}function respondWithResult(_0x45ce9c,_0x66d35b){_0x66d35b=_0x66d35b||0xc8;return function(_0x5c254e){if(_0x5c254e){return _0x45ce9c['status'](_0x66d35b)[_0x6fb1('0x1b')](_0x5c254e);}};}function respondWithFilteredResult(_0x1c3eb8,_0x2fd2b3){return function(_0x4f3569){if(_0x4f3569){var _0x350013=typeof _0x2fd2b3['offset']===_0x6fb1('0x1c')&&typeof _0x2fd2b3[_0x6fb1('0x1d')]===_0x6fb1('0x1c');var _0x381b49=_0x4f3569['count'];var _0x5bbf7b=_0x350013?0x0:_0x2fd2b3[_0x6fb1('0x1e')];var _0x5d5f5c=_0x350013?_0x4f3569[_0x6fb1('0x1f')]:_0x2fd2b3[_0x6fb1('0x1e')]+_0x2fd2b3[_0x6fb1('0x1d')];var _0x1fa08a;if(_0x5d5f5c>=_0x381b49){_0x5d5f5c=_0x381b49;_0x1fa08a=0xc8;}else{_0x1fa08a=0xce;}_0x1c3eb8[_0x6fb1('0x19')](_0x1fa08a);return _0x1c3eb8['set']('Content-Range',_0x5bbf7b+'-'+_0x5d5f5c+'/'+_0x381b49)[_0x6fb1('0x1b')](_0x4f3569);}return null;};}function patchUpdates(_0x49547d){return function(_0x3f1eb3){try{jsonpatch[_0x6fb1('0x20')](_0x3f1eb3,_0x49547d,!![]);}catch(_0x59f6e1){return BPromise[_0x6fb1('0x21')](_0x59f6e1);}return _0x3f1eb3['save']();};}function saveUpdates(_0x120890,_0x538ceb){return function(_0x2a00e5){if(_0x2a00e5){return _0x2a00e5['update'](_0x120890)[_0x6fb1('0x22')](function(_0x528322){return _0x528322;});}return null;};}function removeEntity(_0x339268,_0x7aaf28){return function(_0x984a37){if(_0x984a37){return _0x984a37[_0x6fb1('0x23')]()[_0x6fb1('0x22')](function(){_0x339268[_0x6fb1('0x19')](0xcc)[_0x6fb1('0x1a')]();});}};}function handleEntityNotFound(_0x5a9203,_0x3bff38){return function(_0x59e29c){if(!_0x59e29c){_0x5a9203['sendStatus'](0x194);}return _0x59e29c;};}function handleError(_0x33ac30,_0x4bd6ae){_0x4bd6ae=_0x4bd6ae||0x1f4;return function(_0x17155b){logger[_0x6fb1('0x24')](_0x17155b[_0x6fb1('0x25')]);if(_0x17155b[_0x6fb1('0x26')]){delete _0x17155b[_0x6fb1('0x26')];}_0x33ac30[_0x6fb1('0x19')](_0x4bd6ae)[_0x6fb1('0x27')](_0x17155b);};}exports[_0x6fb1('0x28')]=function(_0x158b99,_0x13042b){var _0x538a10={},_0x13b4de={},_0xa7e660={'count':0x0,'rows':[]};var _0x2aaf3a=_['map'](db['OpenchannelApplication'][_0x6fb1('0x29')],function(_0x1adb6c){return{'name':_0x1adb6c['fieldName'],'type':_0x1adb6c[_0x6fb1('0x2a')][_0x6fb1('0x2b')]};});_0x13b4de[_0x6fb1('0x2c')]=_[_0x6fb1('0x2d')](_0x2aaf3a,_0x6fb1('0x26'));_0x13b4de[_0x6fb1('0x2e')]=_[_0x6fb1('0x2f')](_0x158b99['query']);_0x13b4de[_0x6fb1('0x30')]=_[_0x6fb1('0x31')](_0x13b4de[_0x6fb1('0x2c')],_0x13b4de[_0x6fb1('0x2e')]);_0x538a10['attributes']=_[_0x6fb1('0x31')](_0x13b4de[_0x6fb1('0x2c')],qs[_0x6fb1('0x32')](_0x158b99[_0x6fb1('0x2e')][_0x6fb1('0x32')]));_0x538a10[_0x6fb1('0x33')]=_0x538a10[_0x6fb1('0x33')][_0x6fb1('0x34')]?_0x538a10['attributes']:_0x13b4de[_0x6fb1('0x2c')];if(!_0x158b99['query'][_0x6fb1('0x35')](_0x6fb1('0x36'))){_0x538a10[_0x6fb1('0x1d')]=qs[_0x6fb1('0x1d')](_0x158b99['query']['limit']);_0x538a10[_0x6fb1('0x1e')]=qs[_0x6fb1('0x1e')](_0x158b99['query']['offset']);}_0x538a10[_0x6fb1('0x37')]=qs[_0x6fb1('0x38')](_0x158b99[_0x6fb1('0x2e')][_0x6fb1('0x38')]);_0x538a10['where']=qs['filters'](_[_0x6fb1('0x39')](_0x158b99[_0x6fb1('0x2e')],_0x13b4de[_0x6fb1('0x30')]),_0x2aaf3a);if(_0x158b99[_0x6fb1('0x2e')][_0x6fb1('0x3a')]){_0x538a10[_0x6fb1('0x3b')]=_[_0x6fb1('0x3c')](_0x538a10[_0x6fb1('0x3b')],{'$or':_[_0x6fb1('0x2d')](_0x2aaf3a,function(_0x5e9371){if(_0x5e9371[_0x6fb1('0x2a')]!==_0x6fb1('0x3d')){var _0x3468a6={};_0x3468a6[_0x5e9371[_0x6fb1('0x26')]]={'$like':'%'+_0x158b99[_0x6fb1('0x2e')][_0x6fb1('0x3a')]+'%'};return _0x3468a6;}})});}_0x538a10=_[_0x6fb1('0x3c')]({},_0x538a10,_0x158b99[_0x6fb1('0x3e')]);var _0x238a2a={'where':_0x538a10[_0x6fb1('0x3b')]};return db['OpenchannelApplication'][_0x6fb1('0x1f')](_0x238a2a)[_0x6fb1('0x22')](function(_0x4d4324){_0xa7e660[_0x6fb1('0x1f')]=_0x4d4324;if(_0x158b99[_0x6fb1('0x2e')][_0x6fb1('0x3f')]){_0x538a10[_0x6fb1('0x40')]=[{'all':!![]}];}return db[_0x6fb1('0x41')][_0x6fb1('0x42')](_0x538a10);})[_0x6fb1('0x22')](function(_0x557c84){_0xa7e660['rows']=_0x557c84;return _0xa7e660;})[_0x6fb1('0x22')](respondWithFilteredResult(_0x13042b,_0x538a10))[_0x6fb1('0x43')](handleError(_0x13042b,null));};exports[_0x6fb1('0x44')]=function(_0x3d43fc,_0x35814b){var _0x69cba7={'raw':!![],'where':{'id':_0x3d43fc[_0x6fb1('0x45')]['id']}},_0x2a43e6={};_0x2a43e6['model']=_[_0x6fb1('0x2f')](db[_0x6fb1('0x41')]['rawAttributes']);_0x2a43e6[_0x6fb1('0x2e')]=_['keys'](_0x3d43fc[_0x6fb1('0x2e')]);_0x2a43e6[_0x6fb1('0x30')]=_[_0x6fb1('0x31')](_0x2a43e6[_0x6fb1('0x2c')],_0x2a43e6[_0x6fb1('0x2e')]);_0x69cba7['attributes']=_[_0x6fb1('0x31')](_0x2a43e6[_0x6fb1('0x2c')],qs[_0x6fb1('0x32')](_0x3d43fc['query'][_0x6fb1('0x32')]));_0x69cba7[_0x6fb1('0x33')]=_0x69cba7['attributes'][_0x6fb1('0x34')]?_0x69cba7[_0x6fb1('0x33')]:_0x2a43e6[_0x6fb1('0x2c')];if(_0x3d43fc[_0x6fb1('0x2e')]['includeAll']){_0x69cba7[_0x6fb1('0x40')]=[{'all':!![]}];}_0x69cba7=_[_0x6fb1('0x3c')]({},_0x69cba7,_0x3d43fc[_0x6fb1('0x3e')]);return db[_0x6fb1('0x41')][_0x6fb1('0x46')](_0x69cba7)[_0x6fb1('0x22')](handleEntityNotFound(_0x35814b,null))[_0x6fb1('0x22')](respondWithResult(_0x35814b,null))[_0x6fb1('0x43')](handleError(_0x35814b,null));};exports[_0x6fb1('0x47')]=function(_0x56cb12,_0x2a8886){return db[_0x6fb1('0x41')][_0x6fb1('0x47')](_0x56cb12[_0x6fb1('0x48')],{})['then'](respondWithResult(_0x2a8886,0xc9))[_0x6fb1('0x43')](handleError(_0x2a8886,null));};exports[_0x6fb1('0x49')]=function(_0x4199bb,_0xe474db){if(_0x4199bb[_0x6fb1('0x48')]['id']){delete _0x4199bb[_0x6fb1('0x48')]['id'];}return db[_0x6fb1('0x41')][_0x6fb1('0x46')]({'where':{'id':_0x4199bb[_0x6fb1('0x45')]['id']}})['then'](handleEntityNotFound(_0xe474db,null))['then'](saveUpdates(_0x4199bb[_0x6fb1('0x48')],null))[_0x6fb1('0x22')](respondWithResult(_0xe474db,null))[_0x6fb1('0x43')](handleError(_0xe474db,null));};exports[_0x6fb1('0x23')]=function(_0x4209d6,_0xf4d864){return db[_0x6fb1('0x41')][_0x6fb1('0x46')]({'where':{'id':_0x4209d6['params']['id']}})[_0x6fb1('0x22')](handleEntityNotFound(_0xf4d864,null))[_0x6fb1('0x22')](removeEntity(_0xf4d864,null))[_0x6fb1('0x43')](handleError(_0xf4d864,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index cff4dc4..0580479 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 _0xad5e=['./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x1f4874,_0x26b226){var _0x2792ee=function(_0x26eb9a){while(--_0x26eb9a){_0x1f4874['push'](_0x1f4874['shift']());}};_0x2792ee(++_0x26b226);}(_0xad5e,0xab));var _0xead5=function(_0x474ac2,_0x5d1535){_0x474ac2=_0x474ac2-0x0;var _0x28001e=_0xad5e[_0x474ac2];return _0x28001e;};'use strict';var _=require(_0xead5('0x0'));var util=require(_0xead5('0x1'));var logger=require(_0xead5('0x2'))(_0xead5('0x3'));var moment=require(_0xead5('0x4'));var BPromise=require(_0xead5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xead5('0x6'));var rimraf=require(_0xead5('0x7'));var config=require(_0xead5('0x8'));var attributes=require(_0xead5('0x9'));module[_0xead5('0xa')]=function(_0x26adc6,_0x6bdabd){return _0x26adc6[_0xead5('0xb')](_0xead5('0xc'),attributes,{'tableName':_0xead5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xead5('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8d01=['exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','moment','bluebird','path','rimraf','../../config/environment','./openchannelApplication.attributes'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x8d01,0x88));var _0x18d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d01[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x18d0('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x18d0('0x1'));var BPromise=require(_0x18d0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x18d0('0x3'));var rimraf=require(_0x18d0('0x4'));var config=require(_0x18d0('0x5'));var attributes=require(_0x18d0('0x6'));module[_0x18d0('0x7')]=function(_0x465461,_0x3956f2){return _0x465461[_0x18d0('0x8')](_0x18d0('0x9'),attributes,{'tableName':_0x18d0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x18d0('0xb'),'collate':_0x18d0('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 820d363..69fbaf9 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 _0x47de=['../../config/environment','jayson/promise','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','then','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x47de,0x14e));var _0xe47d=function(_0x2e0daa,_0x100a14){_0x2e0daa=_0x2e0daa-0x0;var _0x432b60=_0x47de[_0x2e0daa];return _0x432b60;};'use strict';var _=require(_0xe47d('0x0'));var util=require('util');var moment=require(_0xe47d('0x1'));var BPromise=require('bluebird');var rs=require(_0xe47d('0x2'));var fs=require('fs');var Redis=require(_0xe47d('0x3'));var db=require(_0xe47d('0x4'))['db'];var utils=require(_0xe47d('0x5'));var logger=require('../../config/logger')(_0xe47d('0x6'));var config=require(_0xe47d('0x7'));var jayson=require(_0xe47d('0x8'));var client=jayson[_0xe47d('0x9')][_0xe47d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d667e,_0x56af21,_0x4ac04e){return new BPromise(function(_0x43da13,_0x27c5b0){return client[_0xe47d('0xb')](_0x3d667e,_0x4ac04e)['then'](function(_0x3fdc17){logger[_0xe47d('0xc')](_0xe47d('0xd'),_0x56af21,_0xe47d('0xe'));logger[_0xe47d('0xf')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x56af21,_0xe47d('0xe'),JSON[_0xe47d('0x10')](_0x3fdc17));if(_0x3fdc17[_0xe47d('0x11')]){if(_0x3fdc17[_0xe47d('0x11')][_0xe47d('0x12')]===0x1f4){logger[_0xe47d('0x11')](_0xe47d('0xd'),_0x56af21,_0x3fdc17[_0xe47d('0x11')][_0xe47d('0x13')]);return _0x27c5b0(_0x3fdc17[_0xe47d('0x11')][_0xe47d('0x13')]);}logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x56af21,_0x3fdc17[_0xe47d('0x11')][_0xe47d('0x13')]);return _0x43da13(_0x3fdc17['error'][_0xe47d('0x13')]);}else{logger['info'](_0xe47d('0xd'),_0x56af21,'request\x20sent');_0x43da13(_0x3fdc17['result'][_0xe47d('0x13')]);}})['catch'](function(_0x55acfa){logger[_0xe47d('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x56af21,_0x55acfa);_0x27c5b0(_0x55acfa);});});}exports[_0xe47d('0x14')]=function(_0x39b52f){var _0x3d7f98=this;return new Promise(function(_0x4caa42,_0x3466f3){return db[_0xe47d('0x15')][_0xe47d('0x16')](_0x39b52f[_0xe47d('0x17')],{'raw':_0x39b52f[_0xe47d('0x18')]?_0x39b52f[_0xe47d('0x18')][_0xe47d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39b52f[_0xe47d('0x18')]?_0x39b52f['options'][_0xe47d('0x1a')]||null:null,'attributes':_0x39b52f[_0xe47d('0x18')]?_0x39b52f[_0xe47d('0x18')][_0xe47d('0x1b')]||null:null,'limit':_0x39b52f[_0xe47d('0x18')]?_0x39b52f[_0xe47d('0x18')][_0xe47d('0x1c')]||null:null})[_0xe47d('0x1d')](function(_0x3d51ec){logger[_0xe47d('0xc')]('UpdateOpenchannelApplication',_0x39b52f);logger[_0xe47d('0xf')](_0xe47d('0x14'),_0x39b52f,JSON[_0xe47d('0x10')](_0x3d51ec));_0x4caa42(_0x3d51ec);})[_0xe47d('0x1e')](function(_0x26c913){logger[_0xe47d('0x11')](_0xe47d('0x14'),_0x26c913[_0xe47d('0x13')],_0x39b52f);_0x3466f3(_0x3d7f98[_0xe47d('0x11')](0x1f4,_0x26c913[_0xe47d('0x13')]));});});}; \ No newline at end of file +var _0x6e42=['OpenchannelApplication','update','body','options','where','attributes','limit','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication'];(function(_0x3135f9,_0x18e84b){var _0x49b669=function(_0x3e9301){while(--_0x3e9301){_0x3135f9['push'](_0x3135f9['shift']());}};_0x49b669(++_0x18e84b);}(_0x6e42,0x17b));var _0x26e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6e42[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x26e4('0x0'));var util=require('util');var moment=require(_0x26e4('0x1'));var BPromise=require('bluebird');var rs=require(_0x26e4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26e4('0x3'))['db'];var utils=require(_0x26e4('0x4'));var logger=require(_0x26e4('0x5'))(_0x26e4('0x6'));var config=require(_0x26e4('0x7'));var jayson=require(_0x26e4('0x8'));var client=jayson[_0x26e4('0x9')][_0x26e4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x166318,_0x1c9459,_0x5e7d9a){return new BPromise(function(_0x56c039,_0x425dd3){return client['request'](_0x166318,_0x5e7d9a)[_0x26e4('0xb')](function(_0x3d9604){logger[_0x26e4('0xc')](_0x26e4('0xd'),_0x1c9459,_0x26e4('0xe'));logger[_0x26e4('0xf')](_0x26e4('0x10'),_0x1c9459,_0x26e4('0xe'),JSON[_0x26e4('0x11')](_0x3d9604));if(_0x3d9604[_0x26e4('0x12')]){if(_0x3d9604[_0x26e4('0x12')][_0x26e4('0x13')]===0x1f4){logger[_0x26e4('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x1c9459,_0x3d9604[_0x26e4('0x12')][_0x26e4('0x14')]);return _0x425dd3(_0x3d9604[_0x26e4('0x12')][_0x26e4('0x14')]);}logger[_0x26e4('0x12')](_0x26e4('0xd'),_0x1c9459,_0x3d9604[_0x26e4('0x12')][_0x26e4('0x14')]);return _0x56c039(_0x3d9604['error'][_0x26e4('0x14')]);}else{logger[_0x26e4('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x1c9459,_0x26e4('0xe'));_0x56c039(_0x3d9604[_0x26e4('0x15')][_0x26e4('0x14')]);}})[_0x26e4('0x16')](function(_0x2923c5){logger[_0x26e4('0x12')](_0x26e4('0xd'),_0x1c9459,_0x2923c5);_0x425dd3(_0x2923c5);});});}exports[_0x26e4('0x17')]=function(_0x6afb79){var _0x62ea83=this;return new Promise(function(_0x25aa9b,_0x170ef0){return db[_0x26e4('0x18')][_0x26e4('0x19')](_0x6afb79[_0x26e4('0x1a')],{'raw':_0x6afb79[_0x26e4('0x1b')]?_0x6afb79[_0x26e4('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6afb79[_0x26e4('0x1b')]?_0x6afb79[_0x26e4('0x1b')][_0x26e4('0x1c')]||null:null,'attributes':_0x6afb79[_0x26e4('0x1b')]?_0x6afb79[_0x26e4('0x1b')][_0x26e4('0x1d')]||null:null,'limit':_0x6afb79[_0x26e4('0x1b')]?_0x6afb79['options'][_0x26e4('0x1e')]||null:null})[_0x26e4('0xb')](function(_0x5a9999){logger[_0x26e4('0xc')](_0x26e4('0x17'),_0x6afb79);logger[_0x26e4('0xf')](_0x26e4('0x17'),_0x6afb79,JSON[_0x26e4('0x11')](_0x5a9999));_0x25aa9b(_0x5a9999);})['catch'](function(_0x353e69){logger['error']('UpdateOpenchannelApplication',_0x353e69[_0x26e4('0x14')],_0x6afb79);_0x170ef0(_0x62ea83[_0x26e4('0x12')](0x1f4,_0x353e69[_0x26e4('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 460e419..28396de 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 _0x5df1=['create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','/:id','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','/describe','describe','/:id/messages','download','post'];(function(_0x28686a,_0x52a2e5){var _0x3031df=function(_0x26b14d){while(--_0x26b14d){_0x28686a['push'](_0x28686a['shift']());}};_0x3031df(++_0x52a2e5);}(_0x5df1,0x163));var _0x15df=function(_0x13e5f7,_0x3ee2de){_0x13e5f7=_0x13e5f7-0x0;var _0x289485=_0x5df1[_0x13e5f7];return _0x289485;};'use strict';var multer=require(_0x15df('0x0'));var util=require(_0x15df('0x1'));var path=require(_0x15df('0x2'));var timeout=require(_0x15df('0x3'));var express=require(_0x15df('0x4'));var router=express['Router']();var fs_extra=require(_0x15df('0x5'));var auth=require(_0x15df('0x6'));var interaction=require(_0x15df('0x7'));var config=require(_0x15df('0x8'));var controller=require(_0x15df('0x9'));router[_0x15df('0xa')]('/',auth[_0x15df('0xb')](),controller['index']);router[_0x15df('0xa')](_0x15df('0xc'),auth[_0x15df('0xb')](),controller[_0x15df('0xd')]);router[_0x15df('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x15df('0xe'),auth[_0x15df('0xb')](),controller['getMessages']);router[_0x15df('0xa')]('/:id/download',auth[_0x15df('0xb')](),controller[_0x15df('0xf')]);router[_0x15df('0x10')]('/',auth[_0x15df('0xb')](),controller[_0x15df('0x11')]);router[_0x15df('0x10')]('/:id/messages',auth[_0x15df('0xb')](),controller[_0x15df('0x12')]);router['post'](_0x15df('0x13'),auth[_0x15df('0xb')](),interaction[_0x15df('0x14')](_0x15df('0x15'),_0x15df('0x16')),controller[_0x15df('0x17')]);router['put'](_0x15df('0x18'),auth['isAuthenticated'](),interaction['tracked'](_0x15df('0x15'),_0x15df('0x19')),controller['update']);router[_0x15df('0x1a')](_0x15df('0x18'),auth[_0x15df('0xb')](),interaction[_0x15df('0x14')](_0x15df('0x15'),_0x15df('0x1b')),controller[_0x15df('0x1c')]);router[_0x15df('0x1a')](_0x15df('0x13'),auth[_0x15df('0xb')](),controller[_0x15df('0x1d')]);module[_0x15df('0x1e')]=router; \ No newline at end of file +var _0x237e=['download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','util','express','Router','../../components/interaction/service','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','/:id/download'];(function(_0x22bf79,_0x1d6034){var _0x3234e1=function(_0x20e4f3){while(--_0x20e4f3){_0x22bf79['push'](_0x22bf79['shift']());}};_0x3234e1(++_0x1d6034);}(_0x237e,0x66));var _0xe237=function(_0x4bb01b,_0x3cd563){_0x4bb01b=_0x4bb01b-0x0;var _0x5b881d=_0x237e[_0x4bb01b];return _0x5b881d;};'use strict';var multer=require('multer');var util=require(_0xe237('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe237('0x1'));var router=express[_0xe237('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe237('0x3'));var config=require('../../config/environment');var controller=require(_0xe237('0x4'));router[_0xe237('0x5')]('/',auth[_0xe237('0x6')](),controller[_0xe237('0x7')]);router[_0xe237('0x5')](_0xe237('0x8'),auth[_0xe237('0x6')](),controller[_0xe237('0x9')]);router[_0xe237('0x5')](_0xe237('0xa'),auth[_0xe237('0x6')](),controller[_0xe237('0xb')]);router[_0xe237('0x5')]('/:id/messages',auth[_0xe237('0x6')](),controller[_0xe237('0xc')]);router[_0xe237('0x5')](_0xe237('0xd'),auth[_0xe237('0x6')](),controller[_0xe237('0xe')]);router['post']('/',auth[_0xe237('0x6')](),controller['create']);router[_0xe237('0xf')]('/:id/messages',auth['isAuthenticated'](),controller[_0xe237('0x10')]);router[_0xe237('0xf')](_0xe237('0x11'),auth[_0xe237('0x6')](),interaction[_0xe237('0x12')](_0xe237('0x13'),_0xe237('0x14')),controller[_0xe237('0x15')]);router[_0xe237('0x16')](_0xe237('0xa'),auth['isAuthenticated'](),interaction[_0xe237('0x12')](_0xe237('0x13'),_0xe237('0x17')),controller[_0xe237('0x18')]);router[_0xe237('0x19')](_0xe237('0xa'),auth[_0xe237('0x6')](),interaction[_0xe237('0x12')]('openchannel',_0xe237('0x1a')),controller[_0xe237('0x1b')]);router[_0xe237('0x19')]('/:id/tags',auth['isAuthenticated'](),controller[_0xe237('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 1657da3..065f8bb 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 _0x55e0=['BOOLEAN','DATE','STRING','ENUM','sequelize','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x55e0,0xdc));var _0x055e=function(_0x5f5763,_0x207bb8){_0x5f5763=_0x5f5763-0x0;var _0x2086ce=_0x55e0[_0x5f5763];return _0x2086ce;};'use strict';var Sequelize=require(_0x055e('0x0'));module[_0x055e('0x1')]={'closed':{'type':Sequelize[_0x055e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x055e('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x055e('0x4')]},'note':{'type':Sequelize[_0x055e('0x4')]},'read1stAt':{'type':Sequelize[_0x055e('0x3')]},'threadId':{'type':Sequelize[_0x055e('0x4')]},'externalUrl':{'type':Sequelize[_0x055e('0x4')]},'lastMsgAt':{'type':Sequelize[_0x055e('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x055e('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x055e('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x055e('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x4d9e=['sequelize','DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x373f6f,_0x50f55b){var _0x21031a=function(_0x2b09f8){while(--_0x2b09f8){_0x373f6f['push'](_0x373f6f['shift']());}};_0x21031a(++_0x50f55b);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x5613e9,_0x5e9791){_0x5613e9=_0x5613e9-0x0;var _0x544988=_0x4d9e[_0x5613e9];return _0x544988;};'use strict';var Sequelize=require(_0xe4d9('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe4d9('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xe4d9('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xe4d9('0x2')]},'read1stAt':{'type':Sequelize[_0xe4d9('0x1')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xe4d9('0x2')]},'lastMsgAt':{'type':Sequelize[_0xe4d9('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xe4d9('0x3')]('in',_0xe4d9('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xe4d9('0x3')]('in',_0xe4d9('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0xe4d9('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 6eab1fa..f1c2d52 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 _0x1bde=['read','OpenchannelAccount','Account','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','threadId','Public','Private','Attachment','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','lastName','value','renderFile','views','downloadInteraction.ejs','.pdf','Openchannel','createPdfFromHTML','error','unlinkSync','rimraf','moment','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','localhost','./openchannelInteraction.socket','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','openchannel','user','catch','show','query','from','params','model','OpenchannelInteraction','keys','filters','intersection','attributes','fields','includeAll','include','merge','options','find','create','update','body','describe','OpenchannelMessage','addMessage','ids','omit','findOne','length','hasOwnProperty','nolimit','order','pick','filter','where','$gte','rows','addTags','setTags','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','toString','join','root','server','files','attachments','format','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','Messages','createdAt','direction','secret'];(function(_0x23dce5,_0x53c151){var _0x48c5de=function(_0x88d374){while(--_0x88d374){_0x23dce5['push'](_0x23dce5['shift']());}};_0x48c5de(++_0x53c151);}(_0x1bde,0x11d));var _0xe1bd=function(_0x111a45,_0x2b9385){_0x111a45=_0x111a45-0x0;var _0x10e6cd=_0x1bde[_0x111a45];return _0x10e6cd;};'use strict';var rimraf=require(_0xe1bd('0x0'));var zipdir=require('zip-dir');var moment=require(_0xe1bd('0x1'));var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe1bd('0x2'));var Redis=require(_0xe1bd('0x3'));var interaction=require(_0xe1bd('0x4'));var qs=require(_0xe1bd('0x5'));var pdf=require(_0xe1bd('0x6'));var logger=require(_0xe1bd('0x7'))(_0xe1bd('0x8'));var config=require('../../config/environment');var db=require(_0xe1bd('0x9'))['db'];config[_0xe1bd('0xa')]=_['defaults'](config['redis'],{'host':_0xe1bd('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe1bd('0xa')]));require(_0xe1bd('0xc'))['register'](socket);function respondWithStatusCode(_0x19d1f2,_0x395876){_0x395876=_0x395876||0xcc;return function(_0x294b18){if(_0x294b18){return _0x19d1f2[_0xe1bd('0xd')](_0x395876);}return _0x19d1f2['status'](_0x395876)[_0xe1bd('0xe')]();};}function respondWithResult(_0x256c0d,_0x5b5034){_0x5b5034=_0x5b5034||0xc8;return function(_0x15f738){if(_0x15f738){return _0x256c0d[_0xe1bd('0xf')](_0x5b5034)['json'](_0x15f738);}};}function respondWithFilteredResult(_0x40167c,_0x36144c){return function(_0x456750){if(_0x456750){var _0x1eb8c8=typeof _0x36144c[_0xe1bd('0x10')]===_0xe1bd('0x11')&&typeof _0x36144c[_0xe1bd('0x12')]==='undefined';var _0x45ddac=_0x456750['count'];var _0x2b2246=_0x1eb8c8?0x0:_0x36144c[_0xe1bd('0x10')];var _0x157770=_0x1eb8c8?_0x456750[_0xe1bd('0x13')]:_0x36144c['offset']+_0x36144c[_0xe1bd('0x12')];var _0xa03dfc;if(_0x157770>=_0x45ddac){_0x157770=_0x45ddac;_0xa03dfc=0xc8;}else{_0xa03dfc=0xce;}_0x40167c[_0xe1bd('0xf')](_0xa03dfc);return _0x40167c[_0xe1bd('0x14')](_0xe1bd('0x15'),_0x2b2246+'-'+_0x157770+'/'+_0x45ddac)[_0xe1bd('0x16')](_0x456750);}return null;};}function saveUpdates(_0x1a0a4d){return function(_0x17b659){if(_0x17b659){return _0x17b659['update'](_0x1a0a4d)[_0xe1bd('0x17')](function(_0x4f8c38){return _0x4f8c38;});}return null;};}function removeEntity(_0x4171c2){return function(_0x5c4dff){if(_0x5c4dff){return _0x5c4dff[_0xe1bd('0x18')]()[_0xe1bd('0x17')](function(){_0x4171c2[_0xe1bd('0xf')](0xcc)[_0xe1bd('0xe')]();});}};}function handleEntityNotFound(_0x1a9237){return function(_0x26b012){if(!_0x26b012){_0x1a9237[_0xe1bd('0xd')](0x194);}return _0x26b012;};}function handleError(_0x8c65e8,_0x2d6ac0){_0x2d6ac0=_0x2d6ac0||0x1f4;return function(_0xeafc23){logger['error'](_0xeafc23[_0xe1bd('0x19')]);if(_0xeafc23[_0xe1bd('0x1a')]){delete _0xeafc23['name'];}_0x8c65e8[_0xe1bd('0xf')](_0x2d6ac0)[_0xe1bd('0x1b')](_0xeafc23);};}exports[_0xe1bd('0x1c')]=function(_0x96319e,_0x58e935){var _0x561b67={};var _0x2c26e8=_[_0xe1bd('0x1d')](db['OpenchannelInteraction'][_0xe1bd('0x1e')],function(_0x18a522){return{'name':_0x18a522[_0xe1bd('0x1f')],'type':_0x18a522[_0xe1bd('0x20')][_0xe1bd('0x21')]};});_0x561b67=qs[_0xe1bd('0x22')](_0x2c26e8,_0x96319e);return interaction[_0xe1bd('0x23')](_0xe1bd('0x24'),_0x96319e['query'],_0x96319e[_0xe1bd('0x25')],_0x561b67,_0x2c26e8)[_0xe1bd('0x17')](respondWithFilteredResult(_0x58e935,_0x561b67))[_0xe1bd('0x26')](handleError(_0x58e935,null));};exports[_0xe1bd('0x27')]=function(_0x463c34,_0x32ad2c){var _0x42be82={};if(_0x463c34[_0xe1bd('0x28')][_0xe1bd('0x20')]&&_0x463c34['query']['type']===_0xe1bd('0x29')){_0x42be82[_0xe1bd('0x29')]=_0x463c34[_0xe1bd('0x2a')]['id'];}else{_0x42be82['id']=_0x463c34[_0xe1bd('0x2a')]['id'];}var _0x1bf201={'raw':![],'where':_0x42be82},_0x21314f={};_0x21314f[_0xe1bd('0x2b')]=_['keys'](db[_0xe1bd('0x2c')][_0xe1bd('0x1e')]);_0x21314f[_0xe1bd('0x28')]=_[_0xe1bd('0x2d')](_0x463c34['query']);_0x21314f[_0xe1bd('0x2e')]=_[_0xe1bd('0x2f')](_0x21314f[_0xe1bd('0x2b')],_0x21314f['query']);_0x1bf201[_0xe1bd('0x30')]=_[_0xe1bd('0x2f')](_0x21314f[_0xe1bd('0x2b')],qs[_0xe1bd('0x31')](_0x463c34['query'][_0xe1bd('0x31')]));_0x1bf201[_0xe1bd('0x30')]=_0x1bf201[_0xe1bd('0x30')]['length']?_0x1bf201['attributes']:_0x21314f['model'];if(_0x463c34[_0xe1bd('0x28')][_0xe1bd('0x32')]){_0x1bf201[_0xe1bd('0x33')]=[{'all':!![]}];}_0x1bf201=_[_0xe1bd('0x34')]({},_0x1bf201,_0x463c34[_0xe1bd('0x35')]);return db[_0xe1bd('0x2c')][_0xe1bd('0x36')](_0x1bf201)[_0xe1bd('0x17')](handleEntityNotFound(_0x32ad2c,null))['then'](respondWithResult(_0x32ad2c,null))['catch'](handleError(_0x32ad2c,null));};exports[_0xe1bd('0x37')]=function(_0x42a57d,_0x1632de){return db['OpenchannelInteraction'][_0xe1bd('0x37')](_0x42a57d['body'],{})[_0xe1bd('0x17')](respondWithResult(_0x1632de,0xc9))[_0xe1bd('0x26')](handleError(_0x1632de,null));};exports[_0xe1bd('0x38')]=function(_0x208ec2,_0x47ad64){if(_0x208ec2[_0xe1bd('0x39')]['id']){delete _0x208ec2['body']['id'];}return db[_0xe1bd('0x2c')][_0xe1bd('0x36')]({'where':{'id':_0x208ec2['params']['id']}})[_0xe1bd('0x17')](handleEntityNotFound(_0x47ad64,null))[_0xe1bd('0x17')](saveUpdates(_0x208ec2['body'],null))[_0xe1bd('0x17')](respondWithResult(_0x47ad64,null))[_0xe1bd('0x26')](handleError(_0x47ad64,null));};exports['destroy']=function(_0x5db85f,_0x59d573){return db[_0xe1bd('0x2c')]['find']({'where':{'id':_0x5db85f[_0xe1bd('0x2a')]['id']}})[_0xe1bd('0x17')](handleEntityNotFound(_0x59d573,null))[_0xe1bd('0x17')](removeEntity(_0x59d573,null))[_0xe1bd('0x26')](handleError(_0x59d573,null));};exports[_0xe1bd('0x3a')]=function(_0x58fed1,_0x338644){return db[_0xe1bd('0x2c')][_0xe1bd('0x3a')]()['then'](respondWithResult(_0x338644,null))['catch'](handleError(_0x338644,null));};exports['addMessage']=function(_0x1b5aca,_0x2c75be){return db[_0xe1bd('0x3b')][_0xe1bd('0x36')]({'where':{'id':_0x1b5aca[_0xe1bd('0x2a')]['id']}})['then'](handleEntityNotFound(_0x2c75be,null))['then'](function(_0x194cb5){if(_0x194cb5){return _0x194cb5[_0xe1bd('0x3c')](_0x1b5aca[_0xe1bd('0x39')][_0xe1bd('0x3d')],_[_0xe1bd('0x3e')](_0x1b5aca[_0xe1bd('0x39')],[_0xe1bd('0x3d'),'id'])||{});}})[_0xe1bd('0x17')](respondWithResult(_0x2c75be,null))[_0xe1bd('0x26')](handleError(_0x2c75be,null));};exports['getMessages']=function(_0x49c60f,_0x2048c5){var _0x2ce9c4={'raw':![],'where':{}};var _0x5e3152={};var _0xaa455a={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xe1bd('0x3f')]({'where':{'id':_0x49c60f[_0xe1bd('0x2a')]['id']}})[_0xe1bd('0x17')](handleEntityNotFound(_0x2048c5,null))['then'](function(_0x4c68f8){if(_0x4c68f8){_0x5e3152[_0xe1bd('0x2b')]=_[_0xe1bd('0x2d')](db[_0xe1bd('0x3b')]['rawAttributes']);_0x5e3152[_0xe1bd('0x28')]=_['keys'](_0x49c60f['query']);_0x5e3152[_0xe1bd('0x2e')]=_[_0xe1bd('0x2f')](_0x5e3152[_0xe1bd('0x2b')],_0x5e3152[_0xe1bd('0x28')]);_0x2ce9c4['attributes']=_[_0xe1bd('0x2f')](_0x5e3152[_0xe1bd('0x2b')],qs[_0xe1bd('0x31')](_0x49c60f[_0xe1bd('0x28')][_0xe1bd('0x31')]));_0x2ce9c4[_0xe1bd('0x30')]=_0x2ce9c4[_0xe1bd('0x30')][_0xe1bd('0x40')]?_0x2ce9c4[_0xe1bd('0x30')]:_0x5e3152[_0xe1bd('0x2b')];if(!_0x49c60f['query'][_0xe1bd('0x41')](_0xe1bd('0x42'))){_0x2ce9c4[_0xe1bd('0x12')]=qs[_0xe1bd('0x12')](_0x49c60f['query'][_0xe1bd('0x12')]);_0x2ce9c4[_0xe1bd('0x10')]=qs[_0xe1bd('0x10')](_0x49c60f[_0xe1bd('0x28')]['offset']);}_0x2ce9c4[_0xe1bd('0x43')]=qs['sort'](_0x49c60f[_0xe1bd('0x28')]['sort']);_0x2ce9c4['where']=qs[_0xe1bd('0x2e')](_[_0xe1bd('0x44')](_0x49c60f[_0xe1bd('0x28')],_0x5e3152[_0xe1bd('0x2e')]));_0x2ce9c4['where']['OpenchannelInteractionId']=_0x4c68f8['id'];if(_0x49c60f[_0xe1bd('0x28')][_0xe1bd('0x45')]){_0x2ce9c4[_0xe1bd('0x46')]=_[_0xe1bd('0x34')](_0x2ce9c4['where'],{'$or':_['map'](_0x2ce9c4['attributes'],function(_0x53284f){var _0x415e90={};_0x415e90[_0x53284f]={'$like':'%'+_0x49c60f[_0xe1bd('0x28')][_0xe1bd('0x45')]+'%'};return _0x415e90;})});}if(_0x49c60f['query'][_0xe1bd('0x47')]){var _0x1a820e=_0x49c60f[_0xe1bd('0x28')][_0xe1bd('0x47')]['split'](',');var _0x1d51b1={};_0x1d51b1[_0x1a820e[0x0]]={'$gte':moment(_0x1a820e[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2ce9c4[_0xe1bd('0x46')]=_[_0xe1bd('0x34')](_0x2ce9c4['where'],_0x1d51b1);}_0x2ce9c4=_[_0xe1bd('0x34')]({},_0x2ce9c4,_0x49c60f['options']);return db[_0xe1bd('0x3b')][_0xe1bd('0x13')]({'where':_0x2ce9c4[_0xe1bd('0x46')]})[_0xe1bd('0x17')](function(_0x432036){_0xaa455a[_0xe1bd('0x13')]=_0x432036;if(_0x49c60f[_0xe1bd('0x28')]['includeAll']){_0x2ce9c4['include']=[{'all':!![]}];}return db[_0xe1bd('0x3b')][_0xe1bd('0x23')](_0x2ce9c4);})[_0xe1bd('0x17')](function(_0x13204f){_0xaa455a[_0xe1bd('0x48')]=_0x13204f;return _0xaa455a;});}})[_0xe1bd('0x17')](respondWithFilteredResult(_0x2048c5,_0x2ce9c4))[_0xe1bd('0x26')](handleError(_0x2048c5,null));};exports[_0xe1bd('0x49')]=function(_0x4c18d6,_0x4286b5){return db[_0xe1bd('0x2c')][_0xe1bd('0x36')]({'where':{'id':_0x4c18d6['params']['id']}})[_0xe1bd('0x17')](handleEntityNotFound(_0x4286b5,null))[_0xe1bd('0x17')](function(_0x535150){if(_0x535150){return _0x535150[_0xe1bd('0x4a')](_0x4c18d6[_0xe1bd('0x39')][_0xe1bd('0x3d')],_['omit'](_0x4c18d6[_0xe1bd('0x39')],[_0xe1bd('0x3d'),'id'])||{})['spread'](function(){return db[_0xe1bd('0x4b')]['findAll']({'attributes':['id',_0xe1bd('0x1a'),_0xe1bd('0x4c')],'where':{'id':_0x4c18d6[_0xe1bd('0x39')][_0xe1bd('0x3d')]}});})['then'](function(_0x409d20){socket[_0xe1bd('0x4d')](_0xe1bd('0x4e'),{'id':Number(_0x4c18d6[_0xe1bd('0x2a')]['id']),'tags':_0x409d20||[]});return{'id':Number(_0x4c18d6['params']['id']),'tags':_0x409d20||[]};});}})[_0xe1bd('0x17')](respondWithResult(_0x4286b5,null))[_0xe1bd('0x26')](handleError(_0x4286b5,null));};exports['removeTags']=function(_0x1fff13,_0x302360){return db[_0xe1bd('0x2c')][_0xe1bd('0x36')]({'where':{'id':_0x1fff13[_0xe1bd('0x2a')]['id']}})[_0xe1bd('0x17')](handleEntityNotFound(_0x302360,null))[_0xe1bd('0x17')](function(_0x2ec4ac){if(_0x2ec4ac){return _0x2ec4ac[_0xe1bd('0x4f')](_0x1fff13[_0xe1bd('0x28')][_0xe1bd('0x3d')]);}})[_0xe1bd('0x17')](respondWithStatusCode(_0x302360,null))[_0xe1bd('0x26')](handleError(_0x302360,null));};exports[_0xe1bd('0x50')]=function(_0x2ce923,_0x262611){var _0x20b08e=moment()['unix']()[_0xe1bd('0x51')]();var _0x89d976=path[_0xe1bd('0x52')](config[_0xe1bd('0x53')],_0xe1bd('0x54'),'files','tmp');var _0x29e040=path[_0xe1bd('0x52')](config[_0xe1bd('0x53')],_0xe1bd('0x54'),_0xe1bd('0x55'),_0xe1bd('0x56'));var _0x274660=path[_0xe1bd('0x52')](_0x89d976,_0x20b08e);var _0x34124a=util[_0xe1bd('0x57')](_0xe1bd('0x58'),_0x2ce923[_0xe1bd('0x2a')]['id'],_0x20b08e);var _0x214e86=path[_0xe1bd('0x52')](_0x89d976,_0x34124a);var _0x2b8b47=[];_0x2b8b47[_0xe1bd('0x59')]({'model':db['User'],'as':_0xe1bd('0x5a'),'attributes':['id',_0xe1bd('0x5b')],'raw':!![]});_0x2b8b47[_0xe1bd('0x59')]({'model':db[_0xe1bd('0x5c')],'as':_0xe1bd('0x5d'),'attributes':['id',_0xe1bd('0x5e'),'lastName'],'raw':!![]});if(_0x2ce923[_0xe1bd('0x28')][_0xe1bd('0x56')]){_0x2b8b47['push']({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x4b2f00=[{'model':db[_0xe1bd('0x3b')],'as':_0xe1bd('0x5f'),'attributes':['id','body',_0xe1bd('0x60'),_0xe1bd('0x61'),_0xe1bd('0x62'),_0xe1bd('0x63')],'include':_0x2b8b47}];_0x4b2f00['push']({'model':db[_0xe1bd('0x64')],'as':_0xe1bd('0x65'),'attributes':['id',_0xe1bd('0x1a')]});_0x4b2f00[_0xe1bd('0x59')]({'model':db[_0xe1bd('0x5a')],'as':_0xe1bd('0x66'),'attributes':['id','fullname']});return db['OpenchannelInteraction'][_0xe1bd('0x36')]({'where':{'id':_0x2ce923['params']['id']},'include':_0x4b2f00})[_0xe1bd('0x17')](handleEntityNotFound(_0x262611,null))[_0xe1bd('0x17')](function(_0xc5d9d5){if(_0xc5d9d5){var _0x1dfe60=_0xc5d9d5['get']({'plain':!![]});fs['mkdirSync'](_0x274660);var _0x350f62={'channel':'Openchannel','account':_0x1dfe60[_0xe1bd('0x65')][_0xe1bd('0x1a')],'agent':_0x1dfe60[_0xe1bd('0x66')]?_0x1dfe60[_0xe1bd('0x66')]['fullname']:_0xe1bd('0x67'),'createdAt':moment(_0x1dfe60[_0xe1bd('0x60')])['format'](_0xe1bd('0x68'))[_0xe1bd('0x51')](),'closedAt':_0x1dfe60[_0xe1bd('0x69')]?moment(_0x1dfe60['closedAt'])[_0xe1bd('0x57')](_0xe1bd('0x68'))[_0xe1bd('0x51')]():'','disposition':_0x1dfe60[_0xe1bd('0x6a')],'visibility':_0x1dfe60[_0xe1bd('0x6b')]?_0xe1bd('0x6c'):_0xe1bd('0x6d'),'messages':_(_0x1dfe60[_0xe1bd('0x5f')])[_0xe1bd('0x45')]({'secret':![]})[_0xe1bd('0x1d')](function(_0x2d5e3d){if(_0x2d5e3d[_0xe1bd('0x6e')]){var _0x5606b5=path[_0xe1bd('0x52')](_0x29e040,_0x2d5e3d['Attachment'][_0xe1bd('0x6f')]);if(fs[_0xe1bd('0x70')](_0x5606b5)){fs[_0xe1bd('0x71')](_0x5606b5)[_0xe1bd('0x72')](fs[_0xe1bd('0x73')](path[_0xe1bd('0x52')](_0x274660,_0x2d5e3d[_0xe1bd('0x6e')][_0xe1bd('0x6f')])));}}return{'date':moment(_0x2d5e3d[_0xe1bd('0x60')])[_0xe1bd('0x57')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe1bd('0x51')](),'sender':_0x2d5e3d[_0xe1bd('0x61')]===_0xe1bd('0x74')?_0x2d5e3d[_0xe1bd('0x5a')]?_0x2d5e3d['User'][_0xe1bd('0x5b')]:_0xe1bd('0x75'):_0x2d5e3d['Contact'][_0xe1bd('0x5e')]+(_0x2d5e3d['Contact'][_0xe1bd('0x76')]?'\x20'+_0x2d5e3d[_0xe1bd('0x5d')][_0xe1bd('0x76')]:''),'body':_0x2d5e3d['Attachment']?_0x2d5e3d['Attachment']['basename']:_0x2d5e3d[_0xe1bd('0x39')],'direction':_0x2d5e3d[_0xe1bd('0x61')]==='out'?'A':'C','secret':_0x2d5e3d[_0xe1bd('0x62')],'read':_0x2d5e3d[_0xe1bd('0x63')],'attachment':_0x2d5e3d[_0xe1bd('0x6e')]};})[_0xe1bd('0x77')]()};return ejs[_0xe1bd('0x78')](path[_0xe1bd('0x52')](config[_0xe1bd('0x53')],_0xe1bd('0x54'),_0xe1bd('0x79'),_0xe1bd('0x7a')),{'interaction':_0x350f62})[_0xe1bd('0x17')](function(_0x491105){var _0x3d1813=path[_0xe1bd('0x52')](_0x274660,'transcript-'+_0x1dfe60['id']+'-'+_0x20b08e+_0xe1bd('0x7b'));var _0x46b2ed={'path':_0x3d1813,'channel':_0xe1bd('0x7c'),'interactionId':_0x1dfe60['id']};return pdf[_0xe1bd('0x7d')](_0x491105,_0x46b2ed);})[_0xe1bd('0x17')](function(){return new Promise(function(_0x5d3ee2,_0x56f657){zipdir(_0x274660,{'saveTo':_0x214e86},function(_0x5e7319,_0x165915){if(_0x5e7319)return _0x56f657(_0x5e7319);return _0x5d3ee2(_0x165915);});})[_0xe1bd('0x17')](function(){return new Promise(function(_0x22fa67,_0x4b7e0c){rimraf(_0x274660,function(_0x58591f){if(_0x58591f)_0x4b7e0c(_0x58591f);return _0x22fa67();});});})[_0xe1bd('0x17')](function(){return _0x262611[_0xe1bd('0x50')](_0x214e86,_0x34124a,function(_0x1a3e2c){if(_0x1a3e2c){logger[_0xe1bd('0x7e')]('Unable\x20to\x20delete\x20zip\x20file',_0x1a3e2c);}else{fs[_0xe1bd('0x7f')](_0x214e86);}});});});}else{return _0x262611[_0xe1bd('0xd')](0xc8);}})[_0xe1bd('0x26')](handleError(_0x262611,null));}; \ No newline at end of file +var _0x32ff=['set','Content-Range','json','update','then','end','error','stack','name','send','index','map','OpenchannelInteraction','fieldName','key','getOptions','query','catch','show','type','from','params','model','keys','filters','intersection','attributes','fields','length','includeAll','options','find','create','body','destroy','describe','addMessage','OpenchannelMessage','omit','ids','findOne','rawAttributes','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','rows','addTags','Tag','color','emit','openchannelInteractionTags:save','removeTags','unix','toString','root','files','tmp','join','server','attachments','push','fullname','CmContact','Contact','firstName','lastName','Attachment','direction','secret','read','OpenchannelAccount','get','Openchannel','Account','Owner','N.A.','createdAt','closedAt','disposition','threadId','Public','Private','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','out','User','System','value','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','sendStatus','zip-dir','util','ejs','lodash','../../components/export/pdf','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','undefined','limit','count','offset'];(function(_0x4494b7,_0x2e7f83){var _0xac798e=function(_0x3bbaa2){while(--_0x3bbaa2){_0x4494b7['push'](_0x4494b7['shift']());}};_0xac798e(++_0x2e7f83);}(_0x32ff,0xec));var _0xf32f=function(_0xa6be7f,_0x313e0d){_0xa6be7f=_0xa6be7f-0x0;var _0x2bc4c3=_0x32ff[_0xa6be7f];return _0x2bc4c3;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xf32f('0x0'));var moment=require('moment');var util=require(_0xf32f('0x1'));var path=require('path');var ejs=require(_0xf32f('0x2'));var fs=require('fs');var _=require(_0xf32f('0x3'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0xf32f('0x4'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0xf32f('0x5'))['db'];config[_0xf32f('0x6')]=_['defaults'](config[_0xf32f('0x6')],{'host':_0xf32f('0x7'),'port':0x18eb});var socket=require(_0xf32f('0x8'))(new Redis(config[_0xf32f('0x6')]));require(_0xf32f('0x9'))[_0xf32f('0xa')](socket);function respondWithStatusCode(_0x27f7ef,_0x52f1c5){_0x52f1c5=_0x52f1c5||0xcc;return function(_0xd6820b){if(_0xd6820b){return _0x27f7ef['sendStatus'](_0x52f1c5);}return _0x27f7ef['status'](_0x52f1c5)['end']();};}function respondWithResult(_0x3b719e,_0x368fd4){_0x368fd4=_0x368fd4||0xc8;return function(_0x9d9cbb){if(_0x9d9cbb){return _0x3b719e[_0xf32f('0xb')](_0x368fd4)['json'](_0x9d9cbb);}};}function respondWithFilteredResult(_0x49a02d,_0x27e817){return function(_0x18b340){if(_0x18b340){var _0x42b95c=typeof _0x27e817['offset']===_0xf32f('0xc')&&typeof _0x27e817[_0xf32f('0xd')]===_0xf32f('0xc');var _0x183dc2=_0x18b340[_0xf32f('0xe')];var _0xa2d93=_0x42b95c?0x0:_0x27e817[_0xf32f('0xf')];var _0x151e8e=_0x42b95c?_0x18b340[_0xf32f('0xe')]:_0x27e817[_0xf32f('0xf')]+_0x27e817[_0xf32f('0xd')];var _0x2c1516;if(_0x151e8e>=_0x183dc2){_0x151e8e=_0x183dc2;_0x2c1516=0xc8;}else{_0x2c1516=0xce;}_0x49a02d[_0xf32f('0xb')](_0x2c1516);return _0x49a02d[_0xf32f('0x10')](_0xf32f('0x11'),_0xa2d93+'-'+_0x151e8e+'/'+_0x183dc2)[_0xf32f('0x12')](_0x18b340);}return null;};}function saveUpdates(_0x31ef1f){return function(_0x776ebd){if(_0x776ebd){return _0x776ebd[_0xf32f('0x13')](_0x31ef1f)[_0xf32f('0x14')](function(_0x550421){return _0x550421;});}return null;};}function removeEntity(_0x19367b){return function(_0x152bff){if(_0x152bff){return _0x152bff['destroy']()['then'](function(){_0x19367b[_0xf32f('0xb')](0xcc)[_0xf32f('0x15')]();});}};}function handleEntityNotFound(_0x1c92ea){return function(_0x286495){if(!_0x286495){_0x1c92ea['sendStatus'](0x194);}return _0x286495;};}function handleError(_0x351aea,_0x4687f0){_0x4687f0=_0x4687f0||0x1f4;return function(_0x42b560){logger[_0xf32f('0x16')](_0x42b560[_0xf32f('0x17')]);if(_0x42b560[_0xf32f('0x18')]){delete _0x42b560[_0xf32f('0x18')];}_0x351aea['status'](_0x4687f0)[_0xf32f('0x19')](_0x42b560);};}exports[_0xf32f('0x1a')]=function(_0x4c98e7,_0xed2bb9){var _0x3023a2={};var _0x16e081=_[_0xf32f('0x1b')](db[_0xf32f('0x1c')]['rawAttributes'],function(_0x182c30){return{'name':_0x182c30[_0xf32f('0x1d')],'type':_0x182c30['type'][_0xf32f('0x1e')]};});_0x3023a2=qs[_0xf32f('0x1f')](_0x16e081,_0x4c98e7);return interaction['findAll']('openchannel',_0x4c98e7[_0xf32f('0x20')],_0x4c98e7['user'],_0x3023a2,_0x16e081)[_0xf32f('0x14')](respondWithFilteredResult(_0xed2bb9,_0x3023a2))[_0xf32f('0x21')](handleError(_0xed2bb9,null));};exports[_0xf32f('0x22')]=function(_0x4494c8,_0x87f9db){var _0x40b233={};if(_0x4494c8['query']['type']&&_0x4494c8['query'][_0xf32f('0x23')]===_0xf32f('0x24')){_0x40b233[_0xf32f('0x24')]=_0x4494c8[_0xf32f('0x25')]['id'];}else{_0x40b233['id']=_0x4494c8[_0xf32f('0x25')]['id'];}var _0x2b2235={'raw':![],'where':_0x40b233},_0x72039c={};_0x72039c[_0xf32f('0x26')]=_[_0xf32f('0x27')](db['OpenchannelInteraction']['rawAttributes']);_0x72039c[_0xf32f('0x20')]=_[_0xf32f('0x27')](_0x4494c8['query']);_0x72039c[_0xf32f('0x28')]=_[_0xf32f('0x29')](_0x72039c[_0xf32f('0x26')],_0x72039c[_0xf32f('0x20')]);_0x2b2235[_0xf32f('0x2a')]=_[_0xf32f('0x29')](_0x72039c['model'],qs['fields'](_0x4494c8[_0xf32f('0x20')][_0xf32f('0x2b')]));_0x2b2235[_0xf32f('0x2a')]=_0x2b2235[_0xf32f('0x2a')][_0xf32f('0x2c')]?_0x2b2235[_0xf32f('0x2a')]:_0x72039c[_0xf32f('0x26')];if(_0x4494c8[_0xf32f('0x20')][_0xf32f('0x2d')]){_0x2b2235['include']=[{'all':!![]}];}_0x2b2235=_['merge']({},_0x2b2235,_0x4494c8[_0xf32f('0x2e')]);return db[_0xf32f('0x1c')][_0xf32f('0x2f')](_0x2b2235)[_0xf32f('0x14')](handleEntityNotFound(_0x87f9db,null))[_0xf32f('0x14')](respondWithResult(_0x87f9db,null))[_0xf32f('0x21')](handleError(_0x87f9db,null));};exports[_0xf32f('0x30')]=function(_0x53b132,_0x366f50){return db[_0xf32f('0x1c')][_0xf32f('0x30')](_0x53b132[_0xf32f('0x31')],{})[_0xf32f('0x14')](respondWithResult(_0x366f50,0xc9))[_0xf32f('0x21')](handleError(_0x366f50,null));};exports['update']=function(_0x365e8b,_0x5e0176){if(_0x365e8b[_0xf32f('0x31')]['id']){delete _0x365e8b[_0xf32f('0x31')]['id'];}return db[_0xf32f('0x1c')][_0xf32f('0x2f')]({'where':{'id':_0x365e8b[_0xf32f('0x25')]['id']}})[_0xf32f('0x14')](handleEntityNotFound(_0x5e0176,null))[_0xf32f('0x14')](saveUpdates(_0x365e8b[_0xf32f('0x31')],null))['then'](respondWithResult(_0x5e0176,null))[_0xf32f('0x21')](handleError(_0x5e0176,null));};exports[_0xf32f('0x32')]=function(_0x5ed619,_0xc7efa8){return db['OpenchannelInteraction'][_0xf32f('0x2f')]({'where':{'id':_0x5ed619['params']['id']}})[_0xf32f('0x14')](handleEntityNotFound(_0xc7efa8,null))[_0xf32f('0x14')](removeEntity(_0xc7efa8,null))['catch'](handleError(_0xc7efa8,null));};exports[_0xf32f('0x33')]=function(_0x3b56ef,_0x3c5c10){return db['OpenchannelInteraction'][_0xf32f('0x33')]()[_0xf32f('0x14')](respondWithResult(_0x3c5c10,null))['catch'](handleError(_0x3c5c10,null));};exports[_0xf32f('0x34')]=function(_0x5257ee,_0x3951c0){return db[_0xf32f('0x35')][_0xf32f('0x2f')]({'where':{'id':_0x5257ee[_0xf32f('0x25')]['id']}})['then'](handleEntityNotFound(_0x3951c0,null))[_0xf32f('0x14')](function(_0xc1d676){if(_0xc1d676){return _0xc1d676[_0xf32f('0x34')](_0x5257ee[_0xf32f('0x31')]['ids'],_[_0xf32f('0x36')](_0x5257ee[_0xf32f('0x31')],[_0xf32f('0x37'),'id'])||{});}})['then'](respondWithResult(_0x3951c0,null))[_0xf32f('0x21')](handleError(_0x3951c0,null));};exports['getMessages']=function(_0x5a6265,_0x79aaf2){var _0x3d60d5={'raw':![],'where':{}};var _0x1d3460={};var _0x5518c8={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xf32f('0x38')]({'where':{'id':_0x5a6265[_0xf32f('0x25')]['id']}})[_0xf32f('0x14')](handleEntityNotFound(_0x79aaf2,null))[_0xf32f('0x14')](function(_0x345e59){if(_0x345e59){_0x1d3460['model']=_['keys'](db[_0xf32f('0x35')][_0xf32f('0x39')]);_0x1d3460['query']=_[_0xf32f('0x27')](_0x5a6265['query']);_0x1d3460['filters']=_[_0xf32f('0x29')](_0x1d3460[_0xf32f('0x26')],_0x1d3460[_0xf32f('0x20')]);_0x3d60d5[_0xf32f('0x2a')]=_[_0xf32f('0x29')](_0x1d3460['model'],qs['fields'](_0x5a6265[_0xf32f('0x20')]['fields']));_0x3d60d5['attributes']=_0x3d60d5[_0xf32f('0x2a')]['length']?_0x3d60d5[_0xf32f('0x2a')]:_0x1d3460[_0xf32f('0x26')];if(!_0x5a6265[_0xf32f('0x20')][_0xf32f('0x3a')](_0xf32f('0x3b'))){_0x3d60d5[_0xf32f('0xd')]=qs[_0xf32f('0xd')](_0x5a6265[_0xf32f('0x20')]['limit']);_0x3d60d5[_0xf32f('0xf')]=qs[_0xf32f('0xf')](_0x5a6265[_0xf32f('0x20')][_0xf32f('0xf')]);}_0x3d60d5[_0xf32f('0x3c')]=qs[_0xf32f('0x3d')](_0x5a6265['query'][_0xf32f('0x3d')]);_0x3d60d5[_0xf32f('0x3e')]=qs[_0xf32f('0x28')](_[_0xf32f('0x3f')](_0x5a6265[_0xf32f('0x20')],_0x1d3460[_0xf32f('0x28')]));_0x3d60d5['where'][_0xf32f('0x40')]=_0x345e59['id'];if(_0x5a6265[_0xf32f('0x20')][_0xf32f('0x41')]){_0x3d60d5[_0xf32f('0x3e')]=_['merge'](_0x3d60d5[_0xf32f('0x3e')],{'$or':_[_0xf32f('0x1b')](_0x3d60d5[_0xf32f('0x2a')],function(_0x47ce1c){var _0x32cc59={};_0x32cc59[_0x47ce1c]={'$like':'%'+_0x5a6265[_0xf32f('0x20')][_0xf32f('0x41')]+'%'};return _0x32cc59;})});}if(_0x5a6265[_0xf32f('0x20')]['$gte']){var _0x2b5632=_0x5a6265[_0xf32f('0x20')][_0xf32f('0x42')][_0xf32f('0x43')](',');var _0x25a37e={};_0x25a37e[_0x2b5632[0x0]]={'$gte':moment(_0x2b5632[0x1])[_0xf32f('0x44')](_0xf32f('0x45'))};_0x3d60d5[_0xf32f('0x3e')]=_['merge'](_0x3d60d5[_0xf32f('0x3e')],_0x25a37e);}_0x3d60d5=_['merge']({},_0x3d60d5,_0x5a6265[_0xf32f('0x2e')]);return db[_0xf32f('0x35')][_0xf32f('0xe')]({'where':_0x3d60d5[_0xf32f('0x3e')]})[_0xf32f('0x14')](function(_0x52c0f3){_0x5518c8['count']=_0x52c0f3;if(_0x5a6265[_0xf32f('0x20')][_0xf32f('0x2d')]){_0x3d60d5[_0xf32f('0x46')]=[{'all':!![]}];}return db[_0xf32f('0x35')][_0xf32f('0x47')](_0x3d60d5);})[_0xf32f('0x14')](function(_0x50cfa9){_0x5518c8[_0xf32f('0x48')]=_0x50cfa9;return _0x5518c8;});}})[_0xf32f('0x14')](respondWithFilteredResult(_0x79aaf2,_0x3d60d5))[_0xf32f('0x21')](handleError(_0x79aaf2,null));};exports[_0xf32f('0x49')]=function(_0x403967,_0x224d7c){return db['OpenchannelInteraction'][_0xf32f('0x2f')]({'where':{'id':_0x403967[_0xf32f('0x25')]['id']}})[_0xf32f('0x14')](handleEntityNotFound(_0x224d7c,null))[_0xf32f('0x14')](function(_0x33a6b6){if(_0x33a6b6){return _0x33a6b6['setTags'](_0x403967['body']['ids'],_['omit'](_0x403967[_0xf32f('0x31')],[_0xf32f('0x37'),'id'])||{})['spread'](function(){return db[_0xf32f('0x4a')][_0xf32f('0x47')]({'attributes':['id','name',_0xf32f('0x4b')],'where':{'id':_0x403967[_0xf32f('0x31')]['ids']}});})['then'](function(_0x56ce6a){socket[_0xf32f('0x4c')](_0xf32f('0x4d'),{'id':Number(_0x403967[_0xf32f('0x25')]['id']),'tags':_0x56ce6a||[]});return{'id':Number(_0x403967['params']['id']),'tags':_0x56ce6a||[]};});}})['then'](respondWithResult(_0x224d7c,null))[_0xf32f('0x21')](handleError(_0x224d7c,null));};exports['removeTags']=function(_0x3ad996,_0x31195a){return db[_0xf32f('0x1c')][_0xf32f('0x2f')]({'where':{'id':_0x3ad996[_0xf32f('0x25')]['id']}})[_0xf32f('0x14')](handleEntityNotFound(_0x31195a,null))[_0xf32f('0x14')](function(_0x5b6a96){if(_0x5b6a96){return _0x5b6a96[_0xf32f('0x4e')](_0x3ad996[_0xf32f('0x20')][_0xf32f('0x37')]);}})[_0xf32f('0x14')](respondWithStatusCode(_0x31195a,null))[_0xf32f('0x21')](handleError(_0x31195a,null));};exports['download']=function(_0x5d249b,_0x3552f2){var _0x1ba029=moment()[_0xf32f('0x4f')]()[_0xf32f('0x50')]();var _0x47cefa=path['join'](config[_0xf32f('0x51')],'server',_0xf32f('0x52'),_0xf32f('0x53'));var _0x5b2a7d=path[_0xf32f('0x54')](config[_0xf32f('0x51')],_0xf32f('0x55'),_0xf32f('0x52'),_0xf32f('0x56'));var _0x9fd2b6=path['join'](_0x47cefa,_0x1ba029);var _0xc049ea=util[_0xf32f('0x44')]('transcript-%d-%s.zip',_0x5d249b[_0xf32f('0x25')]['id'],_0x1ba029);var _0x3ede56=path['join'](_0x47cefa,_0xc049ea);var _0x21db78=[];_0x21db78[_0xf32f('0x57')]({'model':db['User'],'as':'User','attributes':['id',_0xf32f('0x58')],'raw':!![]});_0x21db78[_0xf32f('0x57')]({'model':db[_0xf32f('0x59')],'as':_0xf32f('0x5a'),'attributes':['id',_0xf32f('0x5b'),_0xf32f('0x5c')],'raw':!![]});if(_0x5d249b[_0xf32f('0x20')][_0xf32f('0x56')]){_0x21db78['push']({'model':db[_0xf32f('0x5d')],'as':_0xf32f('0x5d'),'raw':!![]});}var _0x5f521d=[{'model':db[_0xf32f('0x35')],'as':'Messages','attributes':['id',_0xf32f('0x31'),'createdAt',_0xf32f('0x5e'),_0xf32f('0x5f'),_0xf32f('0x60')],'include':_0x21db78}];_0x5f521d[_0xf32f('0x57')]({'model':db[_0xf32f('0x61')],'as':'Account','attributes':['id',_0xf32f('0x18')]});_0x5f521d['push']({'model':db['User'],'as':'Owner','attributes':['id',_0xf32f('0x58')]});return db[_0xf32f('0x1c')][_0xf32f('0x2f')]({'where':{'id':_0x5d249b[_0xf32f('0x25')]['id']},'include':_0x5f521d})[_0xf32f('0x14')](handleEntityNotFound(_0x3552f2,null))[_0xf32f('0x14')](function(_0x16b6fd){if(_0x16b6fd){var _0x53a716=_0x16b6fd[_0xf32f('0x62')]({'plain':!![]});fs['mkdirSync'](_0x9fd2b6);var _0x1be65d={'channel':_0xf32f('0x63'),'account':_0x53a716[_0xf32f('0x64')][_0xf32f('0x18')],'agent':_0x53a716[_0xf32f('0x65')]?_0x53a716['Owner']['fullname']:_0xf32f('0x66'),'createdAt':moment(_0x53a716[_0xf32f('0x67')])[_0xf32f('0x44')](_0xf32f('0x45'))[_0xf32f('0x50')](),'closedAt':_0x53a716['closed']?moment(_0x53a716[_0xf32f('0x68')])[_0xf32f('0x44')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x53a716[_0xf32f('0x69')],'visibility':_0x53a716[_0xf32f('0x6a')]?_0xf32f('0x6b'):_0xf32f('0x6c'),'messages':_(_0x53a716[_0xf32f('0x6d')])[_0xf32f('0x41')]({'secret':![]})[_0xf32f('0x1b')](function(_0x70cae){if(_0x70cae[_0xf32f('0x5d')]){var _0x569aaa=path['join'](_0x5b2a7d,_0x70cae[_0xf32f('0x5d')][_0xf32f('0x6e')]);if(fs[_0xf32f('0x6f')](_0x569aaa)){fs[_0xf32f('0x70')](_0x569aaa)[_0xf32f('0x71')](fs[_0xf32f('0x72')](path[_0xf32f('0x54')](_0x9fd2b6,_0x70cae[_0xf32f('0x5d')][_0xf32f('0x6e')])));}}return{'date':moment(_0x70cae[_0xf32f('0x67')])[_0xf32f('0x44')](_0xf32f('0x45'))['toString'](),'sender':_0x70cae[_0xf32f('0x5e')]===_0xf32f('0x73')?_0x70cae['User']?_0x70cae[_0xf32f('0x74')][_0xf32f('0x58')]:_0xf32f('0x75'):_0x70cae[_0xf32f('0x5a')][_0xf32f('0x5b')]+(_0x70cae['Contact']['lastName']?'\x20'+_0x70cae[_0xf32f('0x5a')]['lastName']:''),'body':_0x70cae[_0xf32f('0x5d')]?_0x70cae[_0xf32f('0x5d')][_0xf32f('0x6e')]:_0x70cae[_0xf32f('0x31')],'direction':_0x70cae[_0xf32f('0x5e')]===_0xf32f('0x73')?'A':'C','secret':_0x70cae[_0xf32f('0x5f')],'read':_0x70cae[_0xf32f('0x60')],'attachment':_0x70cae[_0xf32f('0x5d')]};})[_0xf32f('0x76')]()};return ejs['renderFile'](path['join'](config[_0xf32f('0x51')],'server',_0xf32f('0x77'),_0xf32f('0x78')),{'interaction':_0x1be65d})['then'](function(_0x19b0c6){var _0x23a46d=path[_0xf32f('0x54')](_0x9fd2b6,_0xf32f('0x79')+_0x53a716['id']+'-'+_0x1ba029+'.pdf');var _0x1ec9e1={'path':_0x23a46d,'channel':'Openchannel','interactionId':_0x53a716['id']};return pdf[_0xf32f('0x7a')](_0x19b0c6,_0x1ec9e1);})[_0xf32f('0x14')](function(){return new Promise(function(_0x20845d,_0x2a846e){zipdir(_0x9fd2b6,{'saveTo':_0x3ede56},function(_0xb8244d,_0x481e49){if(_0xb8244d)return _0x2a846e(_0xb8244d);return _0x20845d(_0x481e49);});})['then'](function(){return new Promise(function(_0xc99fd,_0x2b090e){rimraf(_0x9fd2b6,function(_0x5081d8){if(_0x5081d8)_0x2b090e(_0x5081d8);return _0xc99fd();});});})[_0xf32f('0x14')](function(){return _0x3552f2['download'](_0x3ede56,_0xc049ea,function(_0x21bf51){if(_0x21bf51){logger[_0xf32f('0x16')](_0xf32f('0x7b'),_0x21bf51);}else{fs[_0xf32f('0x7c')](_0x3ede56);}});});});}else{return _0x3552f2[_0xf32f('0x7d')](0xc8);}})['catch'](handleError(_0x3552f2,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 0e19ae8..7508152 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 _0x1374=['OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','catch','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x151b55,_0x3a5852){var _0x1cbc4e=function(_0x141e96){while(--_0x141e96){_0x151b55['push'](_0x151b55['shift']());}};_0x1cbc4e(++_0x3a5852);}(_0x1374,0x10d));var _0x4137=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x1374[_0x49b207];return _0x2dc8fa;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x4137('0x0'))['db'][_0x4137('0x1')];var OpenchannelMessage=require(_0x4137('0x0'))['db'][_0x4137('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x4137('0x3')](0x0);var events={'afterCreate':_0x4137('0x4'),'afterUpdate':_0x4137('0x5'),'afterDestroy':_0x4137('0x6')};function emitEvent(_0x204ff1){return function(_0x2fb80b,_0x163496,_0x497516){_0x2fb80b[_0x4137('0x7')]({'attributes':['id'],'raw':!![]})[_0x4137('0x8')](function(_0x79be5e){_0x2fb80b[_0x4137('0x9')](_0x4137('0xa'),_0x79be5e[_0x4137('0xb')](function(_0x4236e6){return{'id':_0x4236e6['id']};}));return OpenchannelMessage[_0x4137('0xc')]({'where':{'OpenchannelInteractionId':_0x2fb80b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4137('0x8')](function(_0x28fdfe){_0x2fb80b[_0x4137('0x9')](_0x4137('0xd'),_0x28fdfe['length']);OpenchannelInteractionEvents['emit'](_0x204ff1+':'+_0x2fb80b['id'],_0x2fb80b);OpenchannelInteractionEvents['emit'](_0x204ff1,_0x2fb80b);_0x497516(null);})[_0x4137('0xe')](_0x497516(null));};}for(var e in events){if(events[_0x4137('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x4137('0x10')](e,emitEvent(event));}}module[_0x4137('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x2d91=['getUsers','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove'];(function(_0x2ee0fb,_0x561a05){var _0x590998=function(_0x334874){while(--_0x334874){_0x2ee0fb['push'](_0x2ee0fb['shift']());}};_0x590998(++_0x561a05);}(_0x2d91,0x1ba));var _0x12d9=function(_0x37b7b6,_0x165a5c){_0x37b7b6=_0x37b7b6-0x0;var _0x10c4c3=_0x2d91[_0x37b7b6];return _0x10c4c3;};'use strict';var EventEmitter=require(_0x12d9('0x0'));var OpenchannelInteraction=require(_0x12d9('0x1'))['db'][_0x12d9('0x2')];var OpenchannelMessage=require(_0x12d9('0x1'))['db'][_0x12d9('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x12d9('0x4')](0x0);var events={'afterCreate':_0x12d9('0x5'),'afterUpdate':_0x12d9('0x6'),'afterDestroy':_0x12d9('0x7')};function emitEvent(_0x34a00d){return function(_0x3a9c83,_0x545f00,_0x45383c){_0x3a9c83[_0x12d9('0x8')]({'attributes':['id'],'raw':!![]})[_0x12d9('0x9')](function(_0x3009ab){_0x3a9c83[_0x12d9('0xa')]('Users',_0x3009ab['map'](function(_0x4f3763){return{'id':_0x4f3763['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x3a9c83['id'],'direction':'in','read':![]},'raw':!![]});})[_0x12d9('0x9')](function(_0x248f05){_0x3a9c83[_0x12d9('0xa')](_0x12d9('0xb'),_0x248f05[_0x12d9('0xc')]);OpenchannelInteractionEvents[_0x12d9('0xd')](_0x34a00d+':'+_0x3a9c83['id'],_0x3a9c83);OpenchannelInteractionEvents[_0x12d9('0xd')](_0x34a00d,_0x3a9c83);_0x45383c(null);})[_0x12d9('0xe')](_0x45383c(null));};}for(var e in events){if(events[_0x12d9('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x12d9('0x10')](e,emitEvent(event));}}module[_0x12d9('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index f9e7225..a526887 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 _0x8cf7=['utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','OpenchannelInteraction','openchannel_interactions','utf8mb4'];(function(_0xa3b526,_0x549d5e){var _0x211dc8=function(_0x5aeb34){while(--_0x5aeb34){_0xa3b526['push'](_0xa3b526['shift']());}};_0x211dc8(++_0x549d5e);}(_0x8cf7,0x122));var _0x78cf=function(_0xf9e2f1,_0x5e0ab9){_0xf9e2f1=_0xf9e2f1-0x0;var _0x31e6ac=_0x8cf7[_0xf9e2f1];return _0x31e6ac;};'use strict';var _=require(_0x78cf('0x0'));var util=require(_0x78cf('0x1'));var logger=require(_0x78cf('0x2'))(_0x78cf('0x3'));var moment=require(_0x78cf('0x4'));var BPromise=require(_0x78cf('0x5'));var rp=require(_0x78cf('0x6'));var fs=require('fs');var path=require(_0x78cf('0x7'));var rimraf=require(_0x78cf('0x8'));var config=require(_0x78cf('0x9'));var attributes=require(_0x78cf('0xa'));module['exports']=function(_0x5d4117,_0x344f93){return _0x5d4117['define'](_0x78cf('0xb'),attributes,{'tableName':_0x78cf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x78cf('0xd'),'collate':_0x78cf('0xe'),'hooks':{'beforeUpdate':function(_0x27dee8,_0x1f797f,_0x18b5b8){if(_0x27dee8[_0x78cf('0xf')]('closed')){_0x27dee8[_0x78cf('0x10')]=moment()[_0x78cf('0x11')](_0x78cf('0x12'));}_0x18b5b8(null,_0x27dee8);}}});}; \ No newline at end of file +var _0xfaff=['utf8mb4_unicode_ci','closedAt','format','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','utf8mb4'];(function(_0x160d2e,_0x2d3f3a){var _0x4bacb3=function(_0x4fc73c){while(--_0x4fc73c){_0x160d2e['push'](_0x160d2e['shift']());}};_0x4bacb3(++_0x2d3f3a);}(_0xfaff,0x173));var _0xffaf=function(_0x371b47,_0x1e28da){_0x371b47=_0x371b47-0x0;var _0x48fb33=_0xfaff[_0x371b47];return _0x48fb33;};'use strict';var _=require(_0xffaf('0x0'));var util=require(_0xffaf('0x1'));var logger=require(_0xffaf('0x2'))('api');var moment=require(_0xffaf('0x3'));var BPromise=require(_0xffaf('0x4'));var rp=require(_0xffaf('0x5'));var fs=require('fs');var path=require(_0xffaf('0x6'));var rimraf=require('rimraf');var config=require(_0xffaf('0x7'));var attributes=require(_0xffaf('0x8'));module[_0xffaf('0x9')]=function(_0x5662d1,_0x55a923){return _0x5662d1[_0xffaf('0xa')](_0xffaf('0xb'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xffaf('0xc'),'collate':_0xffaf('0xd'),'hooks':{'beforeUpdate':function(_0x2657a1,_0x3cc10d,_0x36d787){if(_0x2657a1['changed']('closed')){_0x2657a1[_0xffaf('0xe')]=moment()[_0xffaf('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x36d787(null,_0x2657a1);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 2d4eff9..1b3c83f 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 _0xf932=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','then','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','limit','info','AddTagsToOpenchannelInteraction','addTags','ids','AddTags'];(function(_0x2e8eeb,_0x1ac4da){var _0x1111a9=function(_0x72c9ec){while(--_0x72c9ec){_0x2e8eeb['push'](_0x2e8eeb['shift']());}};_0x1111a9(++_0x1ac4da);}(_0xf932,0x118));var _0x2f93=function(_0x2743cd,_0x4059c5){_0x2743cd=_0x2743cd-0x0;var _0x5bc1ee=_0xf932[_0x2743cd];return _0x5bc1ee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2f93('0x0'));var BPromise=require(_0x2f93('0x1'));var rs=require(_0x2f93('0x2'));var fs=require('fs');var Redis=require(_0x2f93('0x3'));var db=require(_0x2f93('0x4'))['db'];var utils=require(_0x2f93('0x5'));var logger=require('../../config/logger')(_0x2f93('0x6'));var config=require(_0x2f93('0x7'));var jayson=require(_0x2f93('0x8'));var client=jayson[_0x2f93('0x9')][_0x2f93('0xa')]({'port':0x232a});config[_0x2f93('0xb')]=_['defaults'](config[_0x2f93('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x2f93('0xc'))(new Redis(config[_0x2f93('0xb')]));require('./openchannelInteraction.socket')[_0x2f93('0xd')](socket);function respondWithRpcPromise(_0x52f079,_0x10a8db,_0x4c0be4){return new BPromise(function(_0x19efaf,_0x420dcc){return client['request'](_0x52f079,_0x4c0be4)[_0x2f93('0xe')](function(_0x1d11bb){logger['info'](_0x2f93('0xf'),_0x10a8db,'request\x20sent');logger[_0x2f93('0x10')](_0x2f93('0x11'),_0x10a8db,'request\x20sent',JSON[_0x2f93('0x12')](_0x1d11bb));if(_0x1d11bb[_0x2f93('0x13')]){if(_0x1d11bb[_0x2f93('0x13')]['code']===0x1f4){logger['error'](_0x2f93('0xf'),_0x10a8db,_0x1d11bb[_0x2f93('0x13')]['message']);return _0x420dcc(_0x1d11bb[_0x2f93('0x13')]['message']);}logger['error'](_0x2f93('0xf'),_0x10a8db,_0x1d11bb[_0x2f93('0x13')]['message']);return _0x19efaf(_0x1d11bb[_0x2f93('0x13')][_0x2f93('0x14')]);}else{logger['info'](_0x2f93('0xf'),_0x10a8db,'request\x20sent');_0x19efaf(_0x1d11bb[_0x2f93('0x15')]['message']);}})[_0x2f93('0x16')](function(_0x16ec92){logger['error'](_0x2f93('0xf'),_0x10a8db,_0x16ec92);_0x420dcc(_0x16ec92);});});}exports[_0x2f93('0x17')]=function(_0x469a03){var _0x10b710=this;return new Promise(function(_0x5bf105,_0x2dc2ff){return db[_0x2f93('0x18')][_0x2f93('0x19')](_0x469a03[_0x2f93('0x1a')],{'raw':_0x469a03['options']?_0x469a03[_0x2f93('0x1b')][_0x2f93('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x469a03[_0x2f93('0x1b')]?_0x469a03[_0x2f93('0x1b')]['where']||null:null,'attributes':_0x469a03[_0x2f93('0x1b')]?_0x469a03[_0x2f93('0x1b')]['attributes']||null:null,'limit':_0x469a03[_0x2f93('0x1b')]?_0x469a03[_0x2f93('0x1b')][_0x2f93('0x1d')]||null:null})[_0x2f93('0xe')](function(_0x237c53){logger[_0x2f93('0x1e')]('UpdateOpenchannelInteraction',_0x469a03);logger[_0x2f93('0x10')](_0x2f93('0x17'),_0x469a03,JSON[_0x2f93('0x12')](_0x237c53));_0x5bf105(_0x237c53);})[_0x2f93('0x16')](function(_0x470649){logger[_0x2f93('0x13')]('UpdateOpenchannelInteraction',_0x470649[_0x2f93('0x14')],_0x469a03);_0x2dc2ff(_0x10b710[_0x2f93('0x13')](0x1f4,_0x470649[_0x2f93('0x14')]));});});};exports[_0x2f93('0x1f')]=function(_0x31319e){return new Promise(function(_0x3c2c88,_0x25bbd6){return db['OpenchannelInteraction']['find']({'where':_0x31319e['options']?_0x31319e[_0x2f93('0x1b')]['where']||null:null})[_0x2f93('0xe')](function(_0x1da12b){if(_0x1da12b){return _0x1da12b[_0x2f93('0x20')](_0x31319e[_0x2f93('0x1a')]['ids'],_['omit'](_0x31319e[_0x2f93('0x1a')],[_0x2f93('0x21'),'id'])||{});}})['spread'](function(_0x5aad46){logger[_0x2f93('0x1e')](_0x2f93('0x22'),_0x31319e);logger[_0x2f93('0x10')](_0x2f93('0x22'),_0x31319e,JSON['stringify'](_0x5aad46));_0x3c2c88(_0x5aad46);})[_0x2f93('0x16')](function(_0x56872c){logger['error']('AddTags',_0x56872c[_0x2f93('0x14')],_0x31319e);_0x25bbd6(_this['error'](0x1f4,_0x56872c[_0x2f93('0x14')]));});});}; \ No newline at end of file +var _0x2db0=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','attributes','debug','AddTagsToOpenchannelInteraction','find','where','addTags','ids','omit','spread','AddTags'];(function(_0x3d6095,_0x57e878){var _0x2c25e2=function(_0x3c4255){while(--_0x3c4255){_0x3d6095['push'](_0x3d6095['shift']());}};_0x2c25e2(++_0x57e878);}(_0x2db0,0x126));var _0x02db=function(_0x23b8be,_0x4415fa){_0x23b8be=_0x23b8be-0x0;var _0x33ff77=_0x2db0[_0x23b8be];return _0x33ff77;};'use strict';var _=require('lodash');var util=require(_0x02db('0x0'));var moment=require(_0x02db('0x1'));var BPromise=require(_0x02db('0x2'));var rs=require(_0x02db('0x3'));var fs=require('fs');var Redis=require(_0x02db('0x4'));var db=require(_0x02db('0x5'))['db'];var utils=require(_0x02db('0x6'));var logger=require('../../config/logger')(_0x02db('0x7'));var config=require(_0x02db('0x8'));var jayson=require(_0x02db('0x9'));var client=jayson[_0x02db('0xa')]['http']({'port':0x232a});config[_0x02db('0xb')]=_[_0x02db('0xc')](config[_0x02db('0xb')],{'host':_0x02db('0xd'),'port':0x18eb});var socket=require(_0x02db('0xe'))(new Redis(config['redis']));require(_0x02db('0xf'))[_0x02db('0x10')](socket);function respondWithRpcPromise(_0x46f89d,_0x587380,_0x52c120){return new BPromise(function(_0x5b260c,_0x2585ae){return client[_0x02db('0x11')](_0x46f89d,_0x52c120)['then'](function(_0x1f20a3){logger[_0x02db('0x12')](_0x02db('0x13'),_0x587380,_0x02db('0x14'));logger['debug'](_0x02db('0x15'),_0x587380,_0x02db('0x14'),JSON[_0x02db('0x16')](_0x1f20a3));if(_0x1f20a3[_0x02db('0x17')]){if(_0x1f20a3[_0x02db('0x17')]['code']===0x1f4){logger[_0x02db('0x17')](_0x02db('0x13'),_0x587380,_0x1f20a3[_0x02db('0x17')]['message']);return _0x2585ae(_0x1f20a3[_0x02db('0x17')][_0x02db('0x18')]);}logger[_0x02db('0x17')](_0x02db('0x13'),_0x587380,_0x1f20a3[_0x02db('0x17')][_0x02db('0x18')]);return _0x5b260c(_0x1f20a3[_0x02db('0x17')][_0x02db('0x18')]);}else{logger[_0x02db('0x12')](_0x02db('0x13'),_0x587380,'request\x20sent');_0x5b260c(_0x1f20a3['result']['message']);}})[_0x02db('0x19')](function(_0x32b9d7){logger[_0x02db('0x17')](_0x02db('0x13'),_0x587380,_0x32b9d7);_0x2585ae(_0x32b9d7);});});}exports[_0x02db('0x1a')]=function(_0x29fed5){var _0x3dd145=this;return new Promise(function(_0x5570e0,_0x219280){return db[_0x02db('0x1b')][_0x02db('0x1c')](_0x29fed5[_0x02db('0x1d')],{'raw':_0x29fed5[_0x02db('0x1e')]?_0x29fed5[_0x02db('0x1e')][_0x02db('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29fed5[_0x02db('0x1e')]?_0x29fed5['options']['where']||null:null,'attributes':_0x29fed5[_0x02db('0x1e')]?_0x29fed5[_0x02db('0x1e')][_0x02db('0x20')]||null:null,'limit':_0x29fed5[_0x02db('0x1e')]?_0x29fed5[_0x02db('0x1e')]['limit']||null:null})['then'](function(_0x2d40cb){logger[_0x02db('0x12')](_0x02db('0x1a'),_0x29fed5);logger[_0x02db('0x21')](_0x02db('0x1a'),_0x29fed5,JSON[_0x02db('0x16')](_0x2d40cb));_0x5570e0(_0x2d40cb);})[_0x02db('0x19')](function(_0x157350){logger[_0x02db('0x17')](_0x02db('0x1a'),_0x157350['message'],_0x29fed5);_0x219280(_0x3dd145[_0x02db('0x17')](0x1f4,_0x157350[_0x02db('0x18')]));});});};exports[_0x02db('0x22')]=function(_0x119b1c){return new Promise(function(_0x84a412,_0x70322e){return db[_0x02db('0x1b')][_0x02db('0x23')]({'where':_0x119b1c[_0x02db('0x1e')]?_0x119b1c[_0x02db('0x1e')][_0x02db('0x24')]||null:null})['then'](function(_0x358a4e){if(_0x358a4e){return _0x358a4e[_0x02db('0x25')](_0x119b1c[_0x02db('0x1d')][_0x02db('0x26')],_[_0x02db('0x27')](_0x119b1c[_0x02db('0x1d')],[_0x02db('0x26'),'id'])||{});}})[_0x02db('0x28')](function(_0x5847a0){logger['info']('AddTags',_0x119b1c);logger['debug']('AddTags',_0x119b1c,JSON[_0x02db('0x16')](_0x5847a0));_0x84a412(_0x5847a0);})['catch'](function(_0x58c3b4){logger[_0x02db('0x17')](_0x02db('0x29'),_0x58c3b4[_0x02db('0x18')],_0x119b1c);_0x70322e(_this[_0x02db('0x17')](0x1f4,_0x58c3b4[_0x02db('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 0345bfc..fff69a7 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 _0xf48e=['update','register','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0xa79977,_0x4f7f12){var _0x109f10=function(_0x56780f){while(--_0x56780f){_0xa79977['push'](_0xa79977['shift']());}};_0x109f10(++_0x4f7f12);}(_0xf48e,0xcf));var _0xef48=function(_0x1fc3ea,_0x51c25b){_0x1fc3ea=_0x1fc3ea-0x0;var _0x25f4ee=_0xf48e[_0x1fc3ea];return _0x25f4ee;};'use strict';var OpenchannelInteractionEvents=require(_0xef48('0x0'));var events=[_0xef48('0x1'),_0xef48('0x2'),_0xef48('0x3')];function createListener(_0x30b1b0,_0x47633c){return function(_0x4dcdc3){_0x47633c['emit'](_0x30b1b0,_0x4dcdc3);};}function removeListener(_0x4d860c,_0x4bb6ad){return function(){OpenchannelInteractionEvents['removeListener'](_0x4d860c,_0x4bb6ad);};}exports[_0xef48('0x4')]=function(_0x1fed27){for(var _0x4803c1=0x0,_0x4adefe=events['length'];_0x4803c1<_0x4adefe;_0x4803c1++){var _0xbbb03a=events[_0x4803c1];var _0x8fe68a=createListener(_0xef48('0x5')+_0xbbb03a,_0x1fed27);OpenchannelInteractionEvents['on'](_0xbbb03a,_0x8fe68a);}}; \ No newline at end of file +var _0xf59f=['emit','register','length','openchannelInteraction:','./openchannelInteraction.events','save','update'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0xf59f,0x1c4));var _0xff59=function(_0x50fa13,_0x5b4ac7){_0x50fa13=_0x50fa13-0x0;var _0x145e14=_0xf59f[_0x50fa13];return _0x145e14;};'use strict';var OpenchannelInteractionEvents=require(_0xff59('0x0'));var events=[_0xff59('0x1'),'remove',_0xff59('0x2')];function createListener(_0x2e34e1,_0x16749e){return function(_0x26948d){_0x16749e[_0xff59('0x3')](_0x2e34e1,_0x26948d);};}function removeListener(_0x438598,_0x149fa8){return function(){OpenchannelInteractionEvents['removeListener'](_0x438598,_0x149fa8);};}exports[_0xff59('0x4')]=function(_0x38fcc5){for(var _0x542e73=0x0,_0x19b3df=events[_0xff59('0x5')];_0x542e73<_0x19b3df;_0x542e73++){var _0xd1a8cf=events[_0x542e73];var _0x548ada=createListener(_0xff59('0x6')+_0xd1a8cf,_0x38fcc5);OpenchannelInteractionEvents['on'](_0xd1a8cf,_0x548ada);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index ab3ac9d..81c4d46 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x5e2c8b,_0x56c309){_0x5e2c8b=_0x5e2c8b-0x0;var _0x4e5890=_0x70e0[_0x5e2c8b];return _0x4e5890;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x263aea,_0x5162bc){var _0x3e2cf9=function(_0x51eb1b){while(--_0x51eb1b){_0x263aea['push'](_0x263aea['shift']());}};_0x3e2cf9(++_0x5162bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 83543ac..cc4d01f 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 _0x8383=['sequelize','medium','BOOLEAN','ENUM','out','DATE','STRING','TEXT'];(function(_0x27c62b,_0x52d11f){var _0x47a376=function(_0x1f6dbd){while(--_0x1f6dbd){_0x27c62b['push'](_0x27c62b['shift']());}};_0x47a376(++_0x52d11f);}(_0x8383,0x98));var _0x3838=function(_0x4b2867,_0x923eda){_0x4b2867=_0x4b2867-0x0;var _0x458ff4=_0x8383[_0x4b2867];return _0x458ff4;};'use strict';var Sequelize=require(_0x3838('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x3838('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x3838('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x3838('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3838('0x3')]('in',_0x3838('0x4')),'defaultValue':_0x3838('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3838('0x5')]},'providerName':{'type':Sequelize[_0x3838('0x6')]},'providerResponse':{'type':Sequelize[_0x3838('0x7')]}}; \ No newline at end of file +var _0x1bd1=['BOOLEAN','DATE','STRING','sequelize','exports','TEXT'];(function(_0x15e3be,_0x174987){var _0xf290b8=function(_0x4de871){while(--_0x4de871){_0x15e3be['push'](_0x15e3be['shift']());}};_0xf290b8(++_0x174987);}(_0x1bd1,0x123));var _0x11bd=function(_0x1307e4,_0xc6ad64){_0x1307e4=_0x1307e4-0x0;var _0x39ff19=_0x1bd1[_0x1307e4];return _0x39ff19;};'use strict';var Sequelize=require(_0x11bd('0x0'));module[_0x11bd('0x1')]={'body':{'type':Sequelize[_0x11bd('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x11bd('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x11bd('0x4')]},'providerName':{'type':Sequelize[_0x11bd('0x5')]},'providerResponse':{'type':Sequelize[_0x11bd('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index a8096bf..72e15d4 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 _0xab72=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','http','client','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','status','stack','name','send','index','map','OpenchannelMessage','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','openchannel-interactions','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','EventManager','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','internal','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x22bca4,_0x1b7e34){var _0x1b2c8e=function(_0x2e91f7){while(--_0x2e91f7){_0x22bca4['push'](_0x22bca4['shift']());}};_0x1b2c8e(++_0x1b7e34);}(_0xab72,0x71));var _0x2ab7=function(_0x59f9cd,_0x42b3b9){_0x59f9cd=_0x59f9cd-0x0;var _0x257ca9=_0xab72[_0x59f9cd];return _0x257ca9;};'use strict';var emlformat=require(_0x2ab7('0x0'));var rimraf=require(_0x2ab7('0x1'));var zipdir=require(_0x2ab7('0x2'));var jsonpatch=require(_0x2ab7('0x3'));var rp=require('request-promise');var moment=require(_0x2ab7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2ab7('0x5'));var util=require(_0x2ab7('0x6'));var path=require(_0x2ab7('0x7'));var sox=require(_0x2ab7('0x8'));var csv=require(_0x2ab7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ab7('0xa'));var _=require(_0x2ab7('0xb'));var squel=require(_0x2ab7('0xc'));var crypto=require(_0x2ab7('0xd'));var jsforce=require(_0x2ab7('0xe'));var deskjs=require(_0x2ab7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2ab7('0x10'));var Papa=require(_0x2ab7('0x11'));var Redis=require(_0x2ab7('0x12'));var authService=require(_0x2ab7('0x13'));var qs=require(_0x2ab7('0x14'));var as=require(_0x2ab7('0x15'));var hardwareService=require(_0x2ab7('0x16'));var logger=require(_0x2ab7('0x17'))(_0x2ab7('0x18'));var utils=require(_0x2ab7('0x19'));var config=require(_0x2ab7('0x1a'));var licenseUtil=require(_0x2ab7('0x1b'));var db=require(_0x2ab7('0x1c'))['db'];config[_0x2ab7('0x1d')]=_['defaults'](config[_0x2ab7('0x1d')],{'host':_0x2ab7('0x1e'),'port':0x18eb});var socket=require(_0x2ab7('0x1f'))(new Redis(config[_0x2ab7('0x1d')]));require(_0x2ab7('0x20'))[_0x2ab7('0x21')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x2ab7('0x22')]({'port':0x232c});var client9002=jayson[_0x2ab7('0x23')][_0x2ab7('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x261e3c,_0x266fe0,_0x1211a1,_0x5c4cc3){return new BPromise(function(_0x154310,_0x53dd8e){var _0x34c028=_0x5c4cc3||client;return _0x34c028[_0x2ab7('0x24')](_0x261e3c,_0x1211a1)[_0x2ab7('0x25')](function(_0x155071){logger[_0x2ab7('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x266fe0,_0x2ab7('0x27'));logger[_0x2ab7('0x28')](_0x2ab7('0x29'),_0x266fe0,'request\x20sent',JSON[_0x2ab7('0x2a')](_0x155071));if(_0x155071[_0x2ab7('0x2b')]){if(_0x155071[_0x2ab7('0x2b')][_0x2ab7('0x2c')]===0x1f4){logger[_0x2ab7('0x2b')](_0x2ab7('0x2d'),_0x266fe0,_0x155071[_0x2ab7('0x2b')]['message']);return _0x53dd8e(_0x155071[_0x2ab7('0x2b')][_0x2ab7('0x2e')]);}logger[_0x2ab7('0x2b')](_0x2ab7('0x2d'),_0x266fe0,_0x155071[_0x2ab7('0x2b')][_0x2ab7('0x2e')]);return _0x154310(_0x155071[_0x2ab7('0x2b')][_0x2ab7('0x2e')]);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x266fe0,_0x2ab7('0x27'));_0x154310(_0x155071[_0x2ab7('0x2f')][_0x2ab7('0x2e')]);}})['catch'](function(_0xb7ff97){logger['error'](_0x2ab7('0x2d'),_0x266fe0,_0xb7ff97);_0x53dd8e(_0xb7ff97);});});}function respondWithStatusCode(_0x22166f,_0x2f8a06){_0x2f8a06=_0x2f8a06||0xcc;return function(_0x3e2081){if(_0x3e2081){return _0x22166f['sendStatus'](_0x2f8a06);}return _0x22166f['status'](_0x2f8a06)[_0x2ab7('0x30')]();};}function respondWithResult(_0x5731da,_0x48c773){_0x48c773=_0x48c773||0xc8;return function(_0x26c0df){if(_0x26c0df){return _0x5731da['status'](_0x48c773)[_0x2ab7('0x31')](_0x26c0df);}};}function respondWithFilteredResult(_0x10815d,_0x7c80a3){return function(_0x5e91dc){if(_0x5e91dc){var _0x41b62b=typeof _0x7c80a3[_0x2ab7('0x32')]===_0x2ab7('0x33')&&typeof _0x7c80a3['limit']===_0x2ab7('0x33');var _0x77d3a3=_0x5e91dc[_0x2ab7('0x34')];var _0x3ee998=_0x41b62b?0x0:_0x7c80a3[_0x2ab7('0x32')];var _0x2a5279=_0x41b62b?_0x5e91dc['count']:_0x7c80a3['offset']+_0x7c80a3['limit'];var _0x37fcff;if(_0x2a5279>=_0x77d3a3){_0x2a5279=_0x77d3a3;_0x37fcff=0xc8;}else{_0x37fcff=0xce;}_0x10815d['status'](_0x37fcff);return _0x10815d[_0x2ab7('0x35')](_0x2ab7('0x36'),_0x3ee998+'-'+_0x2a5279+'/'+_0x77d3a3)[_0x2ab7('0x31')](_0x5e91dc);}return null;};}function patchUpdates(_0x387f84){return function(_0x1f7d4c){try{jsonpatch[_0x2ab7('0x37')](_0x1f7d4c,_0x387f84,!![]);}catch(_0x516a90){return BPromise[_0x2ab7('0x38')](_0x516a90);}return _0x1f7d4c[_0x2ab7('0x39')]();};}function saveUpdates(_0x339a8f,_0x15c3ba){return function(_0x4992a8){if(_0x4992a8){return _0x4992a8[_0x2ab7('0x3a')](_0x339a8f)[_0x2ab7('0x25')](function(_0x3188d7){return _0x3188d7;});}return null;};}function removeEntity(_0x4faaa2,_0x2e994e){return function(_0x1cc5ed){if(_0x1cc5ed){return _0x1cc5ed[_0x2ab7('0x3b')]()[_0x2ab7('0x25')](function(){_0x4faaa2[_0x2ab7('0x3c')](0xcc)[_0x2ab7('0x30')]();});}};}function handleEntityNotFound(_0x4773e1,_0x1e92a9){return function(_0x4a518d){if(!_0x4a518d){_0x4773e1['sendStatus'](0x194);}return _0x4a518d;};}function handleError(_0x3b5ab9,_0x50d72){_0x50d72=_0x50d72||0x1f4;return function(_0x4ae236){logger[_0x2ab7('0x2b')](_0x4ae236[_0x2ab7('0x3d')]);if(_0x4ae236[_0x2ab7('0x3e')]){delete _0x4ae236['name'];}_0x3b5ab9[_0x2ab7('0x3c')](_0x50d72)[_0x2ab7('0x3f')](_0x4ae236);};}exports[_0x2ab7('0x40')]=function(_0x146eee,_0x45ffed){var _0x503acb={},_0x2e98d4={},_0x455f44={'count':0x0,'rows':[]};var _0x279516=_[_0x2ab7('0x41')](db[_0x2ab7('0x42')][_0x2ab7('0x43')],function(_0x1f3464){return{'name':_0x1f3464['fieldName'],'type':_0x1f3464[_0x2ab7('0x44')][_0x2ab7('0x45')]};});_0x2e98d4[_0x2ab7('0x46')]=_[_0x2ab7('0x41')](_0x279516,_0x2ab7('0x3e'));_0x2e98d4['query']=_[_0x2ab7('0x47')](_0x146eee[_0x2ab7('0x48')]);_0x2e98d4[_0x2ab7('0x49')]=_['intersection'](_0x2e98d4[_0x2ab7('0x46')],_0x2e98d4[_0x2ab7('0x48')]);_0x503acb['attributes']=_[_0x2ab7('0x4a')](_0x2e98d4[_0x2ab7('0x46')],qs[_0x2ab7('0x4b')](_0x146eee[_0x2ab7('0x48')]['fields']));_0x503acb[_0x2ab7('0x4c')]=_0x503acb[_0x2ab7('0x4c')][_0x2ab7('0x4d')]?_0x503acb[_0x2ab7('0x4c')]:_0x2e98d4[_0x2ab7('0x46')];if(!_0x146eee[_0x2ab7('0x48')][_0x2ab7('0x4e')]('nolimit')){_0x503acb[_0x2ab7('0x4f')]=qs['limit'](_0x146eee['query'][_0x2ab7('0x4f')]);_0x503acb[_0x2ab7('0x32')]=qs[_0x2ab7('0x32')](_0x146eee[_0x2ab7('0x48')][_0x2ab7('0x32')]);}_0x503acb[_0x2ab7('0x50')]=qs[_0x2ab7('0x51')](_0x146eee['query'][_0x2ab7('0x51')]);_0x503acb[_0x2ab7('0x52')]=qs[_0x2ab7('0x49')](_[_0x2ab7('0x53')](_0x146eee[_0x2ab7('0x48')],_0x2e98d4[_0x2ab7('0x49')]),_0x279516);if(_0x146eee[_0x2ab7('0x48')]['filter']){_0x503acb[_0x2ab7('0x52')]=_[_0x2ab7('0x54')](_0x503acb[_0x2ab7('0x52')],{'$or':_[_0x2ab7('0x41')](_0x279516,function(_0x1d19fe){if(_0x1d19fe[_0x2ab7('0x44')]!==_0x2ab7('0x55')){var _0x13a5fd={};_0x13a5fd[_0x1d19fe[_0x2ab7('0x3e')]]={'$like':'%'+_0x146eee['query'][_0x2ab7('0x56')]+'%'};return _0x13a5fd;}})});}_0x503acb=_[_0x2ab7('0x54')]({},_0x503acb,_0x146eee[_0x2ab7('0x57')]);var _0x3af954={'where':_0x503acb[_0x2ab7('0x52')]};return db[_0x2ab7('0x42')][_0x2ab7('0x34')](_0x3af954)[_0x2ab7('0x25')](function(_0x434064){_0x455f44['count']=_0x434064;if(_0x146eee['query'][_0x2ab7('0x58')]){_0x503acb[_0x2ab7('0x59')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x2ab7('0x5a')](_0x503acb);})[_0x2ab7('0x25')](function(_0x1bfd28){_0x455f44[_0x2ab7('0x5b')]=_0x1bfd28;return _0x455f44;})[_0x2ab7('0x25')](respondWithFilteredResult(_0x45ffed,_0x503acb))[_0x2ab7('0x5c')](handleError(_0x45ffed,null));};exports[_0x2ab7('0x5d')]=function(_0x5ef7f5,_0x500c89){var _0x11192c={'raw':!![],'where':{'id':_0x5ef7f5['params']['id']}},_0x51ee0f={};_0x51ee0f[_0x2ab7('0x46')]=_[_0x2ab7('0x47')](db[_0x2ab7('0x42')][_0x2ab7('0x43')]);_0x51ee0f[_0x2ab7('0x48')]=_[_0x2ab7('0x47')](_0x5ef7f5[_0x2ab7('0x48')]);_0x51ee0f['filters']=_[_0x2ab7('0x4a')](_0x51ee0f[_0x2ab7('0x46')],_0x51ee0f[_0x2ab7('0x48')]);_0x11192c[_0x2ab7('0x4c')]=_[_0x2ab7('0x4a')](_0x51ee0f[_0x2ab7('0x46')],qs[_0x2ab7('0x4b')](_0x5ef7f5[_0x2ab7('0x48')][_0x2ab7('0x4b')]));_0x11192c['attributes']=_0x11192c['attributes'][_0x2ab7('0x4d')]?_0x11192c[_0x2ab7('0x4c')]:_0x51ee0f[_0x2ab7('0x46')];if(_0x5ef7f5[_0x2ab7('0x48')][_0x2ab7('0x58')]){_0x11192c[_0x2ab7('0x59')]=[{'all':!![]}];}_0x11192c=_['merge']({},_0x11192c,_0x5ef7f5[_0x2ab7('0x57')]);return db['OpenchannelMessage'][_0x2ab7('0x5e')](_0x11192c)[_0x2ab7('0x25')](handleEntityNotFound(_0x500c89,null))[_0x2ab7('0x25')](respondWithResult(_0x500c89,null))['catch'](handleError(_0x500c89,null));};exports[_0x2ab7('0x5f')]=function(_0x532db8,_0x47ca7d){return db['OpenchannelMessage']['create'](_0x532db8[_0x2ab7('0x60')],{})[_0x2ab7('0x25')](respondWithResult(_0x47ca7d,0xc9))[_0x2ab7('0x5c')](handleError(_0x47ca7d,null));};exports[_0x2ab7('0x3a')]=function(_0x9cbb0d,_0x32521a){if(_0x9cbb0d[_0x2ab7('0x60')]['id']){delete _0x9cbb0d[_0x2ab7('0x60')]['id'];}return db[_0x2ab7('0x42')][_0x2ab7('0x5e')]({'where':{'id':_0x9cbb0d[_0x2ab7('0x61')]['id']}})[_0x2ab7('0x25')](handleEntityNotFound(_0x32521a,null))[_0x2ab7('0x25')](saveUpdates(_0x9cbb0d[_0x2ab7('0x60')],null))[_0x2ab7('0x25')](respondWithResult(_0x32521a,null))[_0x2ab7('0x5c')](handleError(_0x32521a,null));};exports[_0x2ab7('0x3b')]=function(_0x17ccdc,_0x346998){return db[_0x2ab7('0x42')][_0x2ab7('0x5e')]({'where':{'id':_0x17ccdc['params']['id']}})[_0x2ab7('0x25')](handleEntityNotFound(_0x346998,null))[_0x2ab7('0x25')](removeEntity(_0x346998,null))['catch'](handleError(_0x346998,null));};exports[_0x2ab7('0x62')]=function(_0x423c08,_0x4db1c8){return db[_0x2ab7('0x42')][_0x2ab7('0x62')]()['then'](respondWithResult(_0x4db1c8,null))['catch'](handleError(_0x4db1c8,null));};var interaction_log=require(_0x2ab7('0x17'))(_0x2ab7('0x63'));exports['accept']=function(_0x187197,_0x1d5b89,_0x4c978b){var _0x2d02de={'agent':{},'channel':_0x2ab7('0x64')};if(_0x187197[_0x2ab7('0x60')]['id']){delete _0x187197[_0x2ab7('0x60')]['id'];}_0x187197[_0x2ab7('0x60')][_0x2ab7('0x65')]=!![];_0x187197[_0x2ab7('0x60')][_0x2ab7('0x66')]=moment()[_0x2ab7('0x67')](_0x2ab7('0x68'));_0x187197[_0x2ab7('0x60')]['UserId']=_0x187197['body'][_0x2ab7('0x69')]||_0x187197[_0x2ab7('0x6a')]['id'];_0x2d02de[_0x2ab7('0x6b')]['id']=_0x187197[_0x2ab7('0x60')][_0x2ab7('0x69')];return db[_0x2ab7('0x42')]['find']({'where':{'id':_0x187197[_0x2ab7('0x61')]['id'],'UserId':null}})[_0x2ab7('0x25')](handleEntityNotFound(_0x1d5b89,null))['then'](saveUpdates(_0x187197[_0x2ab7('0x60')],null))[_0x2ab7('0x25')](function(_0x340ad8){if(_0x340ad8){_0x2d02de[_0x2ab7('0x2e')]=_0x340ad8['get']({'plain':!![]});return db[_0x2ab7('0x6c')][_0x2ab7('0x5e')]({'where':{'id':_0x340ad8[_0x2ab7('0x6d')]}});}return null;})['then'](handleEntityNotFound(_0x1d5b89,null))['then'](function(_0x312479){if(_0x312479){return _0x312479[_0x2ab7('0x3a')]({'UserId':_0x187197[_0x2ab7('0x60')][_0x2ab7('0x69')],'read1stAt':_[_0x2ab7('0x6e')](_0x312479['read1stAt'])?moment()['format'](_0x2ab7('0x68')):undefined});}return null;})['then'](function(_0x452dcb){if(_0x452dcb){_0x2d02de[_0x2ab7('0x6f')]=_0x452dcb[_0x2ab7('0x70')]({'plain':!![]});interaction_log[_0x2ab7('0x26')](_0x2ab7('0x71'),_0x187197[_0x2ab7('0x6a')]['id'],_0x187197[_0x2ab7('0x6a')]['name'],_0x187197[_0x2ab7('0x6a')][_0x2ab7('0x72')],_0x2d02de['interaction']['id'],_0x187197['body']?JSON[_0x2ab7('0x2a')](_0x187197[_0x2ab7('0x60')]):_0x2ab7('0x73'));return respondWithRpcPromise('AcceptMessage',_0x2ab7('0x74'),_0x2d02de);}return null;})[_0x2ab7('0x25')](function(_0x5970e9){var _0xcf3cc2=_0x2ab7('0x75')+_0x5970e9[_0x2ab7('0x2e')]['ContactId'];return db[_0x2ab7('0x76')][_0x2ab7('0x48')](_0xcf3cc2,{'type':db['Sequelize'][_0x2ab7('0x77')][_0x2ab7('0x78')],'raw':!![]})[_0x2ab7('0x25')](function(_0x3a0853){return _0x3a0853;});})['then'](function(_0x247bb7){if(_0x247bb7){_0x2d02de['message'][_0x2ab7('0x79')]=_0x247bb7[0x0];if(!_0x187197['body']['UserId'])return;return db[_0x2ab7('0x7a')][_0x2ab7('0x5e')]({'where':{'id':_0x187197[_0x2ab7('0x60')]['UserId'],'role':_0x2ab7('0x6b')},'attributes':['id',_0x2ab7('0x3e'),_0x2ab7('0x7b'),_0x2ab7('0x7c'),'internal'],'raw':!![]});}return null;})[_0x2ab7('0x25')](function(_0x1402a1){if(!_0x1402a1)return null;_0x2d02de[_0x2ab7('0x2e')][_0x2ab7('0x6b')]=_0x1402a1;return _0x2d02de;})[_0x2ab7('0x25')](function(_0x3ae9fc){if(_0x3ae9fc){if(_0x187197[_0x2ab7('0x60')][_0x2ab7('0x7d')]){_0x2d02de[_0x2ab7('0x2e')][_0x2ab7('0x7e')]=util[_0x2ab7('0x67')](_0x2ab7('0x7f'),_0x187197[_0x2ab7('0x6a')][_0x2ab7('0x3e')]);_0x2d02de[_0x2ab7('0x2e')]['channel']=_0x2d02de[_0x2ab7('0x80')];_0x2d02de[_0x2ab7('0x2e')][_0x2ab7('0x81')]=_0x2d02de[_0x2ab7('0x80')];_0x2d02de[_0x2ab7('0x2e')]['event']='accept';return respondWithRpcPromise(_0x2ab7('0x82'),_0x2ab7('0x82'),{'event':'acceptmessage','message':_0x2d02de[_0x2ab7('0x2e')]},client9002)[_0x2ab7('0x25')](function(){return _0x2d02de;});}return _0x2d02de;}return null;})[_0x2ab7('0x25')](respondWithResult(_0x1d5b89,null))[_0x2ab7('0x5c')](handleError(_0x1d5b89,null));};var interaction_log=require(_0x2ab7('0x17'))('openchannel-interactions');exports['reject']=function(_0x36b7ba,_0x9af628,_0x27602b){var _0x25da3f={'agent':{},'channel':_0x2ab7('0x64')};if(_0x36b7ba[_0x2ab7('0x60')]['id']){delete _0x36b7ba[_0x2ab7('0x60')]['id'];}_0x36b7ba['body']['UserId']=_0x36b7ba['body'][_0x2ab7('0x69')]||_0x36b7ba[_0x2ab7('0x6a')]['id'];_0x25da3f[_0x2ab7('0x6b')]['id']=_0x36b7ba[_0x2ab7('0x60')][_0x2ab7('0x69')];return db['OpenchannelMessage'][_0x2ab7('0x5e')]({'where':{'id':_0x36b7ba['params']['id'],'UserId':null}})[_0x2ab7('0x25')](handleEntityNotFound(_0x9af628,null))['then'](function(_0x3c431e){if(_0x3c431e){_0x25da3f['message']=_0x3c431e['get']({'plain':!![]});return db[_0x2ab7('0x6c')][_0x2ab7('0x5e')]({'where':{'id':_0x3c431e['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x9af628,null))[_0x2ab7('0x25')](function(_0x3e1f42){if(_0x3e1f42){_0x25da3f[_0x2ab7('0x6f')]=_0x3e1f42[_0x2ab7('0x70')]({'plain':!![]});interaction_log['info'](_0x2ab7('0x83'),_0x36b7ba['user']['id'],_0x36b7ba[_0x2ab7('0x6a')][_0x2ab7('0x3e')],_0x36b7ba[_0x2ab7('0x6a')][_0x2ab7('0x72')],_0x25da3f[_0x2ab7('0x6f')]['id'],_0x36b7ba[_0x2ab7('0x60')]?JSON[_0x2ab7('0x2a')](_0x36b7ba['body']):_0x2ab7('0x73'));return respondWithRpcPromise(_0x2ab7('0x84'),_0x2ab7('0x85'),_0x25da3f);}return null;})[_0x2ab7('0x25')](function(_0x1e2243){var _0x8cdbc=_0x2ab7('0x75')+_0x1e2243[_0x2ab7('0x2e')]['ContactId'];return db['sequelize']['query'](_0x8cdbc,{'type':db[_0x2ab7('0x86')]['QueryTypes'][_0x2ab7('0x78')],'raw':!![]})[_0x2ab7('0x25')](function(_0x3fe8f5){return _0x3fe8f5;});})[_0x2ab7('0x25')](function(_0x47e8c3){if(_0x47e8c3){_0x25da3f[_0x2ab7('0x2e')]['contact']=_0x47e8c3[0x0];if(!_0x36b7ba[_0x2ab7('0x60')][_0x2ab7('0x69')])return;return db[_0x2ab7('0x7a')][_0x2ab7('0x5e')]({'where':{'id':_0x36b7ba[_0x2ab7('0x60')][_0x2ab7('0x69')],'role':'agent'},'attributes':['id',_0x2ab7('0x3e'),_0x2ab7('0x7b'),'email',_0x2ab7('0x87')],'raw':!![]});}return null;})[_0x2ab7('0x25')](function(_0x1d87fa){if(!_0x1d87fa)return null;_0x25da3f['message'][_0x2ab7('0x6b')]=_0x1d87fa;return _0x25da3f;})[_0x2ab7('0x25')](function(_0x52d102){if(_0x52d102){_0x52d102[_0x2ab7('0x2e')][_0x2ab7('0x7e')]=util['format']('SIP/%s',_0x36b7ba[_0x2ab7('0x6a')][_0x2ab7('0x3e')]);_0x52d102[_0x2ab7('0x2e')][_0x2ab7('0x80')]=_0x25da3f['channel'];_0x52d102['message'][_0x2ab7('0x81')]=_0x25da3f[_0x2ab7('0x80')];_0x52d102['message']['event']=_0x2ab7('0x38');respondWithRpcPromise(_0x2ab7('0x82'),_0x2ab7('0x82'),{'event':'rejectmessage','message':_0x52d102[_0x2ab7('0x2e')]},client9002);return _0x25da3f;}return null;})[_0x2ab7('0x25')](respondWithResult(_0x9af628,null))[_0x2ab7('0x5c')](handleError(_0x9af628,null));}; \ No newline at end of file +var _0x148c=['json','apply','reject','save','update','then','destroy','name','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','OpenchannelInteraction','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','agent','manual','channel','motionChannel','event','acceptmessage','../../config/logger','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','email','interface','SIP/%s','EventManager','rejectmessage','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','jayson/promise','http','request','info','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range'];(function(_0xd06eca,_0x509aa8){var _0x31e12f=function(_0x14e070){while(--_0x14e070){_0xd06eca['push'](_0xd06eca['shift']());}};_0x31e12f(++_0x509aa8);}(_0x148c,0xd3));var _0xc148=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x148c[_0x49ca18];return _0x145d54;};'use strict';var emlformat=require(_0xc148('0x0'));var rimraf=require(_0xc148('0x1'));var zipdir=require(_0xc148('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc148('0x3'));var Mustache=require(_0xc148('0x4'));var util=require(_0xc148('0x5'));var path=require(_0xc148('0x6'));var sox=require(_0xc148('0x7'));var csv=require(_0xc148('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc148('0x9'));var _=require(_0xc148('0xa'));var squel=require('squel');var crypto=require(_0xc148('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc148('0xc'));var toCsv=require(_0xc148('0x8'));var querystring=require(_0xc148('0xd'));var Papa=require(_0xc148('0xe'));var Redis=require('ioredis');var authService=require(_0xc148('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc148('0x10'));var hardwareService=require(_0xc148('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xc148('0x12'));var config=require(_0xc148('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xc148('0x14'))['db'];config[_0xc148('0x15')]=_[_0xc148('0x16')](config[_0xc148('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xc148('0x17'))(new Redis(config[_0xc148('0x15')]));require(_0xc148('0x18'))['register'](socket);var jayson=require(_0xc148('0x19'));var client=jayson['client'][_0xc148('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0xc148('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x23e794,_0x2dcc5d,_0x3a1525,_0x1b0d7d){return new BPromise(function(_0x51b2da,_0x20fc38){var _0x26f2c8=_0x1b0d7d||client;return _0x26f2c8[_0xc148('0x1b')](_0x23e794,_0x3a1525)['then'](function(_0x179518){logger[_0xc148('0x1c')]('OpenchannelMessage,\x20%s,\x20%s',_0x2dcc5d,'request\x20sent');logger[_0xc148('0x1d')](_0xc148('0x1e'),_0x2dcc5d,_0xc148('0x1f'),JSON[_0xc148('0x20')](_0x179518));if(_0x179518[_0xc148('0x21')]){if(_0x179518[_0xc148('0x21')][_0xc148('0x22')]===0x1f4){logger[_0xc148('0x21')](_0xc148('0x23'),_0x2dcc5d,_0x179518[_0xc148('0x21')][_0xc148('0x24')]);return _0x20fc38(_0x179518['error']['message']);}logger[_0xc148('0x21')](_0xc148('0x23'),_0x2dcc5d,_0x179518[_0xc148('0x21')]['message']);return _0x51b2da(_0x179518[_0xc148('0x21')]['message']);}else{logger[_0xc148('0x1c')](_0xc148('0x23'),_0x2dcc5d,_0xc148('0x1f'));_0x51b2da(_0x179518[_0xc148('0x25')][_0xc148('0x24')]);}})[_0xc148('0x26')](function(_0x1e1d41){logger[_0xc148('0x21')](_0xc148('0x23'),_0x2dcc5d,_0x1e1d41);_0x20fc38(_0x1e1d41);});});}function respondWithStatusCode(_0x33209c,_0x342943){_0x342943=_0x342943||0xcc;return function(_0x34555d){if(_0x34555d){return _0x33209c['sendStatus'](_0x342943);}return _0x33209c[_0xc148('0x27')](_0x342943)[_0xc148('0x28')]();};}function respondWithResult(_0x397477,_0xb620d5){_0xb620d5=_0xb620d5||0xc8;return function(_0x29e641){if(_0x29e641){return _0x397477[_0xc148('0x27')](_0xb620d5)['json'](_0x29e641);}};}function respondWithFilteredResult(_0x39f08e,_0x2edcdc){return function(_0x28c51){if(_0x28c51){var _0x41a565=typeof _0x2edcdc[_0xc148('0x29')]===_0xc148('0x2a')&&typeof _0x2edcdc[_0xc148('0x2b')]==='undefined';var _0x50d4fe=_0x28c51[_0xc148('0x2c')];var _0x310a6d=_0x41a565?0x0:_0x2edcdc[_0xc148('0x29')];var _0x2753d9=_0x41a565?_0x28c51[_0xc148('0x2c')]:_0x2edcdc[_0xc148('0x29')]+_0x2edcdc[_0xc148('0x2b')];var _0x5dcbef;if(_0x2753d9>=_0x50d4fe){_0x2753d9=_0x50d4fe;_0x5dcbef=0xc8;}else{_0x5dcbef=0xce;}_0x39f08e[_0xc148('0x27')](_0x5dcbef);return _0x39f08e[_0xc148('0x2d')](_0xc148('0x2e'),_0x310a6d+'-'+_0x2753d9+'/'+_0x50d4fe)[_0xc148('0x2f')](_0x28c51);}return null;};}function patchUpdates(_0x1db5ca){return function(_0x26424b){try{jsonpatch[_0xc148('0x30')](_0x26424b,_0x1db5ca,!![]);}catch(_0x42d4b0){return BPromise[_0xc148('0x31')](_0x42d4b0);}return _0x26424b[_0xc148('0x32')]();};}function saveUpdates(_0x209542,_0x5f23eb){return function(_0x471e59){if(_0x471e59){return _0x471e59[_0xc148('0x33')](_0x209542)[_0xc148('0x34')](function(_0x5bee43){return _0x5bee43;});}return null;};}function removeEntity(_0x2eb00b,_0x1b98e8){return function(_0x5cd2c0){if(_0x5cd2c0){return _0x5cd2c0[_0xc148('0x35')]()[_0xc148('0x34')](function(){_0x2eb00b[_0xc148('0x27')](0xcc)[_0xc148('0x28')]();});}};}function handleEntityNotFound(_0x1a7266,_0x3289a4){return function(_0x1688d6){if(!_0x1688d6){_0x1a7266['sendStatus'](0x194);}return _0x1688d6;};}function handleError(_0x71cf2d,_0x25aa90){_0x25aa90=_0x25aa90||0x1f4;return function(_0x2bda5a){logger[_0xc148('0x21')](_0x2bda5a['stack']);if(_0x2bda5a['name']){delete _0x2bda5a[_0xc148('0x36')];}_0x71cf2d[_0xc148('0x27')](_0x25aa90)['send'](_0x2bda5a);};}exports['index']=function(_0x2479f7,_0x4c4afe){var _0x4fde80={},_0x44aa73={},_0x411143={'count':0x0,'rows':[]};var _0x32970b=_['map'](db[_0xc148('0x37')][_0xc148('0x38')],function(_0x49e982){return{'name':_0x49e982[_0xc148('0x39')],'type':_0x49e982[_0xc148('0x3a')][_0xc148('0x3b')]};});_0x44aa73[_0xc148('0x3c')]=_['map'](_0x32970b,'name');_0x44aa73[_0xc148('0x3d')]=_[_0xc148('0x3e')](_0x2479f7['query']);_0x44aa73[_0xc148('0x3f')]=_['intersection'](_0x44aa73[_0xc148('0x3c')],_0x44aa73[_0xc148('0x3d')]);_0x4fde80['attributes']=_[_0xc148('0x40')](_0x44aa73[_0xc148('0x3c')],qs[_0xc148('0x41')](_0x2479f7[_0xc148('0x3d')][_0xc148('0x41')]));_0x4fde80[_0xc148('0x42')]=_0x4fde80[_0xc148('0x42')][_0xc148('0x43')]?_0x4fde80[_0xc148('0x42')]:_0x44aa73[_0xc148('0x3c')];if(!_0x2479f7[_0xc148('0x3d')][_0xc148('0x44')](_0xc148('0x45'))){_0x4fde80['limit']=qs[_0xc148('0x2b')](_0x2479f7[_0xc148('0x3d')][_0xc148('0x2b')]);_0x4fde80['offset']=qs[_0xc148('0x29')](_0x2479f7[_0xc148('0x3d')]['offset']);}_0x4fde80['order']=qs[_0xc148('0x46')](_0x2479f7[_0xc148('0x3d')]['sort']);_0x4fde80[_0xc148('0x47')]=qs['filters'](_[_0xc148('0x48')](_0x2479f7[_0xc148('0x3d')],_0x44aa73[_0xc148('0x3f')]),_0x32970b);if(_0x2479f7[_0xc148('0x3d')]['filter']){_0x4fde80[_0xc148('0x47')]=_[_0xc148('0x49')](_0x4fde80[_0xc148('0x47')],{'$or':_[_0xc148('0x4a')](_0x32970b,function(_0x44a81b){if(_0x44a81b[_0xc148('0x3a')]!==_0xc148('0x4b')){var _0x2573fb={};_0x2573fb[_0x44a81b['name']]={'$like':'%'+_0x2479f7[_0xc148('0x3d')]['filter']+'%'};return _0x2573fb;}})});}_0x4fde80=_[_0xc148('0x49')]({},_0x4fde80,_0x2479f7[_0xc148('0x4c')]);var _0x3408e4={'where':_0x4fde80[_0xc148('0x47')]};return db[_0xc148('0x37')]['count'](_0x3408e4)['then'](function(_0x3c0ed6){_0x411143[_0xc148('0x2c')]=_0x3c0ed6;if(_0x2479f7[_0xc148('0x3d')]['includeAll']){_0x4fde80[_0xc148('0x4d')]=[{'all':!![]}];}return db[_0xc148('0x37')][_0xc148('0x4e')](_0x4fde80);})['then'](function(_0x11f6bc){_0x411143[_0xc148('0x4f')]=_0x11f6bc;return _0x411143;})[_0xc148('0x34')](respondWithFilteredResult(_0x4c4afe,_0x4fde80))['catch'](handleError(_0x4c4afe,null));};exports[_0xc148('0x50')]=function(_0x20eb82,_0x144dbd){var _0x3bd637={'raw':!![],'where':{'id':_0x20eb82[_0xc148('0x51')]['id']}},_0x13efeb={};_0x13efeb[_0xc148('0x3c')]=_[_0xc148('0x3e')](db['OpenchannelMessage'][_0xc148('0x38')]);_0x13efeb['query']=_[_0xc148('0x3e')](_0x20eb82['query']);_0x13efeb[_0xc148('0x3f')]=_[_0xc148('0x40')](_0x13efeb['model'],_0x13efeb[_0xc148('0x3d')]);_0x3bd637[_0xc148('0x42')]=_[_0xc148('0x40')](_0x13efeb[_0xc148('0x3c')],qs[_0xc148('0x41')](_0x20eb82['query'][_0xc148('0x41')]));_0x3bd637[_0xc148('0x42')]=_0x3bd637[_0xc148('0x42')][_0xc148('0x43')]?_0x3bd637[_0xc148('0x42')]:_0x13efeb[_0xc148('0x3c')];if(_0x20eb82['query'][_0xc148('0x52')]){_0x3bd637[_0xc148('0x4d')]=[{'all':!![]}];}_0x3bd637=_[_0xc148('0x49')]({},_0x3bd637,_0x20eb82[_0xc148('0x4c')]);return db[_0xc148('0x37')][_0xc148('0x53')](_0x3bd637)['then'](handleEntityNotFound(_0x144dbd,null))[_0xc148('0x34')](respondWithResult(_0x144dbd,null))[_0xc148('0x26')](handleError(_0x144dbd,null));};exports[_0xc148('0x54')]=function(_0x431a77,_0x48b7fc){return db[_0xc148('0x37')][_0xc148('0x54')](_0x431a77[_0xc148('0x55')],{})[_0xc148('0x34')](respondWithResult(_0x48b7fc,0xc9))['catch'](handleError(_0x48b7fc,null));};exports[_0xc148('0x33')]=function(_0x3f9888,_0x1542c8){if(_0x3f9888[_0xc148('0x55')]['id']){delete _0x3f9888[_0xc148('0x55')]['id'];}return db[_0xc148('0x37')][_0xc148('0x53')]({'where':{'id':_0x3f9888['params']['id']}})['then'](handleEntityNotFound(_0x1542c8,null))[_0xc148('0x34')](saveUpdates(_0x3f9888[_0xc148('0x55')],null))[_0xc148('0x34')](respondWithResult(_0x1542c8,null))[_0xc148('0x26')](handleError(_0x1542c8,null));};exports[_0xc148('0x35')]=function(_0x4a85b7,_0xfad2d8){return db[_0xc148('0x37')][_0xc148('0x53')]({'where':{'id':_0x4a85b7['params']['id']}})['then'](handleEntityNotFound(_0xfad2d8,null))[_0xc148('0x34')](removeEntity(_0xfad2d8,null))[_0xc148('0x26')](handleError(_0xfad2d8,null));};exports[_0xc148('0x56')]=function(_0x40263a,_0x1dd1cd){return db[_0xc148('0x37')]['describe']()[_0xc148('0x34')](respondWithResult(_0x1dd1cd,null))[_0xc148('0x26')](handleError(_0x1dd1cd,null));};var interaction_log=require('../../config/logger')(_0xc148('0x57'));exports[_0xc148('0x58')]=function(_0x4c5a74,_0x221386,_0x5455aa){var _0x30d294={'agent':{},'channel':_0xc148('0x59')};if(_0x4c5a74[_0xc148('0x55')]['id']){delete _0x4c5a74[_0xc148('0x55')]['id'];}_0x4c5a74['body'][_0xc148('0x5a')]=!![];_0x4c5a74[_0xc148('0x55')][_0xc148('0x5b')]=moment()[_0xc148('0x5c')](_0xc148('0x5d'));_0x4c5a74[_0xc148('0x55')][_0xc148('0x5e')]=_0x4c5a74[_0xc148('0x55')]['UserId']||_0x4c5a74['user']['id'];_0x30d294['agent']['id']=_0x4c5a74[_0xc148('0x55')][_0xc148('0x5e')];return db[_0xc148('0x37')][_0xc148('0x53')]({'where':{'id':_0x4c5a74[_0xc148('0x51')]['id'],'UserId':null}})[_0xc148('0x34')](handleEntityNotFound(_0x221386,null))[_0xc148('0x34')](saveUpdates(_0x4c5a74['body'],null))['then'](function(_0x5b2352){if(_0x5b2352){_0x30d294[_0xc148('0x24')]=_0x5b2352[_0xc148('0x5f')]({'plain':!![]});return db[_0xc148('0x60')][_0xc148('0x53')]({'where':{'id':_0x5b2352['OpenchannelInteractionId']}});}return null;})[_0xc148('0x34')](handleEntityNotFound(_0x221386,null))[_0xc148('0x34')](function(_0x434ce3){if(_0x434ce3){return _0x434ce3[_0xc148('0x33')]({'UserId':_0x4c5a74[_0xc148('0x55')][_0xc148('0x5e')],'read1stAt':_[_0xc148('0x61')](_0x434ce3[_0xc148('0x62')])?moment()['format'](_0xc148('0x5d')):undefined});}return null;})[_0xc148('0x34')](function(_0x20a747){if(_0x20a747){_0x30d294[_0xc148('0x63')]=_0x20a747['get']({'plain':!![]});interaction_log[_0xc148('0x1c')](_0xc148('0x64'),_0x4c5a74[_0xc148('0x65')]['id'],_0x4c5a74['user'][_0xc148('0x36')],_0x4c5a74[_0xc148('0x65')][_0xc148('0x66')],_0x30d294['interaction']['id'],_0x4c5a74[_0xc148('0x55')]?JSON[_0xc148('0x20')](_0x4c5a74['body']):_0xc148('0x67'));return respondWithRpcPromise('AcceptMessage',_0xc148('0x68'),_0x30d294);}return null;})['then'](function(_0x14627d){var _0x5ba9f9=_0xc148('0x69')+_0x14627d[_0xc148('0x24')][_0xc148('0x6a')];return db['sequelize'][_0xc148('0x3d')](_0x5ba9f9,{'type':db[_0xc148('0x6b')][_0xc148('0x6c')][_0xc148('0x6d')],'raw':!![]})[_0xc148('0x34')](function(_0x330e61){return _0x330e61;});})[_0xc148('0x34')](function(_0x185cf0){if(_0x185cf0){_0x30d294['message'][_0xc148('0x6e')]=_0x185cf0[0x0];if(!_0x4c5a74[_0xc148('0x55')][_0xc148('0x5e')])return;return db[_0xc148('0x6f')]['find']({'where':{'id':_0x4c5a74[_0xc148('0x55')][_0xc148('0x5e')],'role':'agent'},'attributes':['id',_0xc148('0x36'),_0xc148('0x70'),'email',_0xc148('0x71')],'raw':!![]});}return null;})[_0xc148('0x34')](function(_0x5f5d45){if(!_0x5f5d45)return null;_0x30d294[_0xc148('0x24')][_0xc148('0x72')]=_0x5f5d45;return _0x30d294;})['then'](function(_0x3165ae){if(_0x3165ae){if(_0x4c5a74['body'][_0xc148('0x73')]){_0x30d294[_0xc148('0x24')]['interface']=util[_0xc148('0x5c')]('SIP/%s',_0x4c5a74['user']['name']);_0x30d294[_0xc148('0x24')][_0xc148('0x74')]=_0x30d294[_0xc148('0x74')];_0x30d294['message'][_0xc148('0x75')]=_0x30d294[_0xc148('0x74')];_0x30d294[_0xc148('0x24')][_0xc148('0x76')]=_0xc148('0x58');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xc148('0x77'),'message':_0x30d294[_0xc148('0x24')]},client9002)[_0xc148('0x34')](function(){return _0x30d294;});}return _0x30d294;}return null;})[_0xc148('0x34')](respondWithResult(_0x221386,null))[_0xc148('0x26')](handleError(_0x221386,null));};var interaction_log=require(_0xc148('0x78'))(_0xc148('0x57'));exports[_0xc148('0x31')]=function(_0x4b49a9,_0x459fcb,_0x1bd4e9){var _0x2c9187={'agent':{},'channel':_0xc148('0x59')};if(_0x4b49a9['body']['id']){delete _0x4b49a9[_0xc148('0x55')]['id'];}_0x4b49a9['body'][_0xc148('0x5e')]=_0x4b49a9[_0xc148('0x55')][_0xc148('0x5e')]||_0x4b49a9[_0xc148('0x65')]['id'];_0x2c9187['agent']['id']=_0x4b49a9[_0xc148('0x55')][_0xc148('0x5e')];return db[_0xc148('0x37')][_0xc148('0x53')]({'where':{'id':_0x4b49a9[_0xc148('0x51')]['id'],'UserId':null}})[_0xc148('0x34')](handleEntityNotFound(_0x459fcb,null))[_0xc148('0x34')](function(_0x2527c0){if(_0x2527c0){_0x2c9187[_0xc148('0x24')]=_0x2527c0['get']({'plain':!![]});return db[_0xc148('0x60')][_0xc148('0x53')]({'where':{'id':_0x2527c0[_0xc148('0x79')]}});}return null;})[_0xc148('0x34')](handleEntityNotFound(_0x459fcb,null))['then'](function(_0x54d450){if(_0x54d450){_0x2c9187['interaction']=_0x54d450['get']({'plain':!![]});interaction_log[_0xc148('0x1c')](_0xc148('0x7a'),_0x4b49a9[_0xc148('0x65')]['id'],_0x4b49a9[_0xc148('0x65')]['name'],_0x4b49a9[_0xc148('0x65')][_0xc148('0x66')],_0x2c9187[_0xc148('0x63')]['id'],_0x4b49a9['body']?JSON[_0xc148('0x20')](_0x4b49a9[_0xc148('0x55')]):_0xc148('0x67'));return respondWithRpcPromise('RejectMessage',_0xc148('0x7b'),_0x2c9187);}return null;})[_0xc148('0x34')](function(_0x2f69af){var _0x2553fa=_0xc148('0x69')+_0x2f69af[_0xc148('0x24')][_0xc148('0x6a')];return db['sequelize'][_0xc148('0x3d')](_0x2553fa,{'type':db[_0xc148('0x6b')][_0xc148('0x6c')][_0xc148('0x6d')],'raw':!![]})[_0xc148('0x34')](function(_0x5d852b){return _0x5d852b;});})[_0xc148('0x34')](function(_0x315b7b){if(_0x315b7b){_0x2c9187['message']['contact']=_0x315b7b[0x0];if(!_0x4b49a9[_0xc148('0x55')][_0xc148('0x5e')])return;return db['User'][_0xc148('0x53')]({'where':{'id':_0x4b49a9[_0xc148('0x55')][_0xc148('0x5e')],'role':'agent'},'attributes':['id','name',_0xc148('0x70'),_0xc148('0x7c'),_0xc148('0x71')],'raw':!![]});}return null;})[_0xc148('0x34')](function(_0x455eaa){if(!_0x455eaa)return null;_0x2c9187[_0xc148('0x24')][_0xc148('0x72')]=_0x455eaa;return _0x2c9187;})[_0xc148('0x34')](function(_0x2d52e2){if(_0x2d52e2){_0x2d52e2['message'][_0xc148('0x7d')]=util[_0xc148('0x5c')](_0xc148('0x7e'),_0x4b49a9[_0xc148('0x65')][_0xc148('0x36')]);_0x2d52e2['message'][_0xc148('0x74')]=_0x2c9187['channel'];_0x2d52e2[_0xc148('0x24')][_0xc148('0x75')]=_0x2c9187[_0xc148('0x74')];_0x2d52e2[_0xc148('0x24')][_0xc148('0x76')]=_0xc148('0x31');respondWithRpcPromise(_0xc148('0x7f'),_0xc148('0x7f'),{'event':_0xc148('0x80'),'message':_0x2d52e2['message']},client9002);return _0x2c9187;}return null;})[_0xc148('0x34')](respondWithResult(_0x459fcb,null))['catch'](handleError(_0x459fcb,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 1b972a3..b9a3b0c 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 _0x14a8=['remove','emit','hasOwnProperty','hook','exports','OpenchannelMessage','save','update'];(function(_0x1c07af,_0x422ebd){var _0x5ce7c0=function(_0x547db3){while(--_0x547db3){_0x1c07af['push'](_0x1c07af['shift']());}};_0x5ce7c0(++_0x422ebd);}(_0x14a8,0x11d));var _0x814a=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x14a8[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db'][_0x814a('0x0')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x814a('0x1'),'afterUpdate':_0x814a('0x2'),'afterDestroy':_0x814a('0x3')};function emitEvent(_0x5db7a0){return function(_0x391531,_0x45773f,_0xa4af6a){OpenchannelMessageEvents[_0x814a('0x4')](_0x5db7a0+':'+_0x391531['id'],_0x391531);OpenchannelMessageEvents['emit'](_0x5db7a0,_0x391531);_0xa4af6a(null);};}for(var e in events){if(events[_0x814a('0x5')](e)){var event=events[e];OpenchannelMessage[_0x814a('0x6')](e,emitEvent(event));}}module[_0x814a('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x27cc=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x53317c,_0xe047d5){var _0x39d300=function(_0x81b27e){while(--_0x81b27e){_0x53317c['push'](_0x53317c['shift']());}};_0x39d300(++_0xe047d5);}(_0x27cc,0x77));var _0xc27c=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x27cc[_0x2f5ac5];return _0x37c9a8;};'use strict';var EventEmitter=require(_0xc27c('0x0'));var OpenchannelMessage=require(_0xc27c('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xc27c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc27c('0x3'),'afterDestroy':_0xc27c('0x4')};function emitEvent(_0x373637){return function(_0x323f4f,_0x37674a,_0x40b7f7){OpenchannelMessageEvents[_0xc27c('0x5')](_0x373637+':'+_0x323f4f['id'],_0x323f4f);OpenchannelMessageEvents['emit'](_0x373637,_0x323f4f);_0x40b7f7(null);};}for(var e in events){if(events[_0xc27c('0x6')](e)){var event=events[e];OpenchannelMessage[_0xc27c('0x7')](e,emitEvent(event));}}module[_0xc27c('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 ea26989..45248f1 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 _0x668b=['inspect','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','catch','CmContact','describe','then','OpenchannelAccount','Interactions','Contact','replyUri','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','POST','method','info','threadId','Interaction','error','afterCreate'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0x668b,0x1c5));var _0xb668=function(_0x2ac5f8,_0x4c3a9f){_0x2ac5f8=_0x2ac5f8-0x0;var _0x3b8229=_0x668b[_0x2ac5f8];return _0x3b8229;};'use strict';var _=require(_0xb668('0x0'));var util=require('util');var logger=require(_0xb668('0x1'))(_0xb668('0x2'));var moment=require(_0xb668('0x3'));var BPromise=require(_0xb668('0x4'));var rp=require(_0xb668('0x5'));var fs=require('fs');var path=require(_0xb668('0x6'));var rimraf=require(_0xb668('0x7'));var config=require(_0xb668('0x8'));var attributes=require(_0xb668('0x9'));module['exports']=function(_0x4d5aca,_0x4533ff){return _0x4d5aca[_0xb668('0xa')](_0xb668('0xb'),attributes,{'tableName':_0xb668('0xc'),'paranoid':![],'indexes':[{'name':_0xb668('0xd'),'fields':[_0xb668('0xe')],'type':_0xb668('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2ebd51,_0x279f1f,_0x257764){var _0x1ca690=_0x4d5aca[_0xb668('0x10')];var _0x3c2e62=_0x2ebd51[_0xb668('0x11')]({'plain':!![]});if(_0x3c2e62['direction']['toLowerCase']()==='in'||_0x3c2e62[_0xb668('0x12')]['toLowerCase']()===_0xb668('0x13')&&!_0x3c2e62[_0xb668('0x14')]&&!_[_0xb668('0x15')](_0x3c2e62[_0xb668('0x16')])){_0x1ca690[_0xb668('0x17')][_0xb668('0x18')]({'where':{'id':_0x3c2e62[_0xb668('0x19')]}})['then'](function(_0x3d818e){if(_0x3d818e){_0x3d818e[_0xb668('0x1a')]({'lastMsgAt':_0x3c2e62['createdAt'],'lastMsgDirection':_0x3c2e62['direction']['toLowerCase']()});}})[_0xb668('0x1b')](function(_0x5300c1){console['error'](_0x5300c1);});}if(_0x3c2e62[_0xb668('0x12')]===_0xb668('0x13')&&!_0x3c2e62[_0xb668('0x14')]){var _0x560df7;_0x1ca690[_0xb668('0x1c')][_0xb668('0x1d')]()[_0xb668('0x1e')](function(_0x26af57){return _0x1ca690[_0xb668('0x1f')]['find']({'where':{'id':_0x3c2e62['OpenchannelAccountId']},'include':[{'model':_0x1ca690[_0xb668('0x17')],'as':_0xb668('0x20'),'where':{'id':_0x3c2e62[_0xb668('0x19')]},'limit':0x1,'include':[{'model':_0x1ca690[_0xb668('0x1c')],'as':_0xb668('0x21'),'attributes':_['keys'](_0x26af57)}]}]});})[_0xb668('0x1e')](function(_0x3f9ee6){_0x560df7=_0x3f9ee6['get']({'plain':!![]});if(_0x560df7&&_0x560df7[_0xb668('0x22')]){logger['info'](_0xb668('0x23'),'afterCreate',util[_0xb668('0x24')](_0xb668('0x25'),_0x3c2e62['id'],_0x560df7[_0xb668('0x22')]));if(_0x560df7[_0xb668('0x20')]&&_0x560df7[_0xb668('0x20')][_0xb668('0x26')]){_0x3c2e62['Interaction']=_[_0xb668('0x27')](_0x560df7['Interactions'][0x0],_0xb668('0x21'));_0x3c2e62['Contact']=_0x560df7[_0xb668('0x20')][0x0]['Contact'];}var _0x279f1f={'method':_0xb668('0x28'),'uri':encodeURI(_0x560df7[_0xb668('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x279f1f[_0xb668('0x29')]){case'GET':_0x279f1f['qs']=_0x3c2e62;break;case _0xb668('0x28'):_0x279f1f[_0xb668('0xe')]=_0x3c2e62;break;}return rp(_0x279f1f)['then'](function(_0x3fa860){logger[_0xb668('0x2a')](_0xb668('0x23'),'afterCreate',util[_0xb668('0x24')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x3c2e62['id'],_0x560df7[_0xb668('0x22')]));if(_0x3fa860['body'][_0xb668('0x2b')]&&_0x3fa860[_0xb668('0xe')][_0xb668('0x2b')]!=_0x3c2e62['Interaction'][_0xb668('0x2b')]){return _0x1ca690[_0xb668('0x17')][_0xb668('0x1a')]({'threadId':_0x3fa860[_0xb668('0xe')][_0xb668('0x2b')]},{'where':{'id':_0x3c2e62[_0xb668('0x2c')]['id']}});}else{return;}})[_0xb668('0x1e')](function(){return _0x2ebd51[_0xb668('0x1a')]({'read':!![]});})[_0xb668('0x1b')](function(_0x2f5b20){logger[_0xb668('0x2d')](_0xb668('0x23'),_0xb668('0x2e'),util[_0xb668('0x2f')](_0x2f5b20,{'showHidden':![],'depth':null}));_0x257764();});}else{_0x257764();}})['finally'](function(){_0x257764();});}else{_0x257764();}}},'charset':_0xb668('0x30'),'collate':_0xb668('0x31')});}; \ No newline at end of file +var _0x10c8=['POST','method','GET','info','OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','error','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','direction','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','createdAt','catch','out','secret','describe','then','OpenchannelAccount','find','OpenchannelAccountId','Interactions','CmContact','Contact','keys','replyUri','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interaction'];(function(_0x1bce18,_0x2975c7){var _0x2889a=function(_0x253e65){while(--_0x253e65){_0x1bce18['push'](_0x1bce18['shift']());}};_0x2889a(++_0x2975c7);}(_0x10c8,0xee));var _0x810c=function(_0x24dc71,_0x17b0cd){_0x24dc71=_0x24dc71-0x0;var _0x4ad0bf=_0x10c8[_0x24dc71];return _0x4ad0bf;};'use strict';var _=require(_0x810c('0x0'));var util=require(_0x810c('0x1'));var logger=require(_0x810c('0x2'))(_0x810c('0x3'));var moment=require('moment');var BPromise=require(_0x810c('0x4'));var rp=require(_0x810c('0x5'));var fs=require('fs');var path=require(_0x810c('0x6'));var rimraf=require(_0x810c('0x7'));var config=require('../../config/environment');var attributes=require(_0x810c('0x8'));module[_0x810c('0x9')]=function(_0x3fd5e6,_0x59cd06){return _0x3fd5e6[_0x810c('0xa')](_0x810c('0xb'),attributes,{'tableName':_0x810c('0xc'),'paranoid':![],'indexes':[{'name':_0x810c('0xd'),'fields':[_0x810c('0xe')],'type':_0x810c('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x17d8bd,_0xeb9564,_0x2bb2c3){var _0x1eee85=_0x3fd5e6[_0x810c('0x10')];var _0x5bbed0=_0x17d8bd[_0x810c('0x11')]({'plain':!![]});if(_0x5bbed0['direction'][_0x810c('0x12')]()==='in'||_0x5bbed0[_0x810c('0x13')][_0x810c('0x12')]()==='out'&&!_0x5bbed0['secret']&&!_[_0x810c('0x14')](_0x5bbed0[_0x810c('0x15')])){_0x1eee85[_0x810c('0x16')][_0x810c('0x17')]({'where':{'id':_0x5bbed0[_0x810c('0x18')]}})['then'](function(_0x4826f6){if(_0x4826f6){_0x4826f6['update']({'lastMsgAt':_0x5bbed0[_0x810c('0x19')],'lastMsgDirection':_0x5bbed0[_0x810c('0x13')][_0x810c('0x12')]()});}})[_0x810c('0x1a')](function(_0x469973){console['error'](_0x469973);});}if(_0x5bbed0[_0x810c('0x13')]===_0x810c('0x1b')&&!_0x5bbed0[_0x810c('0x1c')]){var _0x427719;_0x1eee85['CmContact'][_0x810c('0x1d')]()[_0x810c('0x1e')](function(_0x248031){return _0x1eee85[_0x810c('0x1f')][_0x810c('0x20')]({'where':{'id':_0x5bbed0[_0x810c('0x21')]},'include':[{'model':_0x1eee85[_0x810c('0x16')],'as':_0x810c('0x22'),'where':{'id':_0x5bbed0['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x1eee85[_0x810c('0x23')],'as':_0x810c('0x24'),'attributes':_[_0x810c('0x25')](_0x248031)}]}]});})[_0x810c('0x1e')](function(_0x37e363){_0x427719=_0x37e363[_0x810c('0x11')]({'plain':!![]});if(_0x427719&&_0x427719[_0x810c('0x26')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x810c('0x27'),util['format'](_0x810c('0x28'),_0x5bbed0['id'],_0x427719[_0x810c('0x26')]));if(_0x427719[_0x810c('0x22')]&&_0x427719[_0x810c('0x22')]['length']){_0x5bbed0[_0x810c('0x29')]=_['omit'](_0x427719[_0x810c('0x22')][0x0],_0x810c('0x24'));_0x5bbed0[_0x810c('0x24')]=_0x427719[_0x810c('0x22')][0x0][_0x810c('0x24')];}var _0xeb9564={'method':_0x810c('0x2a'),'uri':encodeURI(_0x427719['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0xeb9564[_0x810c('0x2b')]){case _0x810c('0x2c'):_0xeb9564['qs']=_0x5bbed0;break;case _0x810c('0x2a'):_0xeb9564[_0x810c('0xe')]=_0x5bbed0;break;}return rp(_0xeb9564)[_0x810c('0x1e')](function(_0x15b7dd){logger[_0x810c('0x2d')](_0x810c('0x2e'),_0x810c('0x27'),util[_0x810c('0x2f')](_0x810c('0x30'),_0x5bbed0['id'],_0x427719[_0x810c('0x26')]));if(_0x15b7dd['body']['threadId']&&_0x15b7dd['body'][_0x810c('0x31')]!=_0x5bbed0[_0x810c('0x29')][_0x810c('0x31')]){return _0x1eee85[_0x810c('0x16')][_0x810c('0x32')]({'threadId':_0x15b7dd['body'][_0x810c('0x31')]},{'where':{'id':_0x5bbed0[_0x810c('0x29')]['id']}});}else{return;}})[_0x810c('0x1e')](function(){return _0x17d8bd['update']({'read':!![]});})[_0x810c('0x1a')](function(_0x198943){logger[_0x810c('0x33')](_0x810c('0x2e'),'afterCreate',util[_0x810c('0x34')](_0x198943,{'showHidden':![],'depth':null}));_0x2bb2c3();});}else{_0x2bb2c3();}})[_0x810c('0x35')](function(){_0x2bb2c3();});}else{_0x2bb2c3();}}},'charset':_0x810c('0x36'),'collate':_0x810c('0x37')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 0875a1d..0864982 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x1276dd,_0x2674b9){var _0x59c3be=function(_0x5179ab){while(--_0x5179ab){_0x1276dd['push'](_0x1276dd['shift']());}};_0x59c3be(++_0x2674b9);}(_0xadb5,0xad));var _0x5adb=function(_0x4752a6,_0xe92fda){_0x4752a6=_0x4752a6-0x0;var _0x1360e8=_0xadb5[_0x4752a6];return _0x1360e8;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file +var _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(_0x45cd4b,_0x509c61){var _0x213105=function(_0x354a5c){while(--_0x354a5c){_0x45cd4b['push'](_0x45cd4b['shift']());}};_0x213105(++_0x509c61);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2cc569,_0x4e9568){_0x2cc569=_0x2cc569-0x0;var _0x1bfc2e=_0x0b0e[_0x2cc569];return _0x1bfc2e;};'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 diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 1c72f99..6569556 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 _0xe944=['register','length','./openchannelMessage.events','update','removeListener'];(function(_0x5ea0ab,_0x46f8cc){var _0x4d6377=function(_0x11eaa8){while(--_0x11eaa8){_0x5ea0ab['push'](_0x5ea0ab['shift']());}};_0x4d6377(++_0x46f8cc);}(_0xe944,0x174));var _0x4e94=function(_0x47053e,_0x3accde){_0x47053e=_0x47053e-0x0;var _0x5ab62a=_0xe944[_0x47053e];return _0x5ab62a;};'use strict';var OpenchannelMessageEvents=require(_0x4e94('0x0'));var events=['save','remove',_0x4e94('0x1')];function createListener(_0x58186a,_0x5ae206){return function(_0x21ef9a){_0x5ae206['emit'](_0x58186a,_0x21ef9a);};}function removeListener(_0x4edb6f,_0x10029f){return function(){OpenchannelMessageEvents[_0x4e94('0x2')](_0x4edb6f,_0x10029f);};}exports[_0x4e94('0x3')]=function(_0xbb43ae){for(var _0x4d00e5=0x0,_0x44a2cd=events[_0x4e94('0x4')];_0x4d00e5<_0x44a2cd;_0x4d00e5++){var _0x175b42=events[_0x4d00e5];var _0x32bb46=createListener('openchannelMessage:'+_0x175b42,_0xbb43ae);OpenchannelMessageEvents['on'](_0x175b42,_0x32bb46);}}; \ No newline at end of file +var _0x35c8=['remove','update','emit','removeListener','register','openchannelMessage:','./openchannelMessage.events','save'];(function(_0x59e223,_0x410624){var _0x5f645a=function(_0x4834a6){while(--_0x4834a6){_0x59e223['push'](_0x59e223['shift']());}};_0x5f645a(++_0x410624);}(_0x35c8,0xa6));var _0x835c=function(_0x596664,_0x35d524){_0x596664=_0x596664-0x0;var _0x27f81f=_0x35c8[_0x596664];return _0x27f81f;};'use strict';var OpenchannelMessageEvents=require(_0x835c('0x0'));var events=[_0x835c('0x1'),_0x835c('0x2'),_0x835c('0x3')];function createListener(_0x306f59,_0x541bd6){return function(_0x5a9764){_0x541bd6[_0x835c('0x4')](_0x306f59,_0x5a9764);};}function removeListener(_0x1339d3,_0x10c49b){return function(){OpenchannelMessageEvents[_0x835c('0x5')](_0x1339d3,_0x10c49b);};}exports[_0x835c('0x6')]=function(_0x3c3f2f){for(var _0x37b9ce=0x0,_0x371249=events['length'];_0x37b9ce<_0x371249;_0x37b9ce++){var _0x7e199e=events[_0x37b9ce];var _0x217b8c=createListener(_0x835c('0x7')+_0x7e199e,_0x3c3f2f);OpenchannelMessageEvents['on'](_0x7e199e,_0x217b8c);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index a58b7c6..8f24b8d 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 _0x92b2=['addTeams','/:id/users','addAgents','put','/:id','update','delete','/:id/teams','removeTeams','removeAgents','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','getAgents','post'];(function(_0x48e86c,_0x9f034d){var _0x54fa11=function(_0x199705){while(--_0x199705){_0x48e86c['push'](_0x48e86c['shift']());}};_0x54fa11(++_0x9f034d);}(_0x92b2,0x193));var _0x292b=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x92b2[_0x2642cb];return _0xe6e41;};'use strict';var multer=require(_0x292b('0x0'));var util=require(_0x292b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x292b('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x292b('0x3'));var interaction=require(_0x292b('0x4'));var config=require('../../config/environment');var controller=require(_0x292b('0x5'));router[_0x292b('0x6')]('/',auth[_0x292b('0x7')](),controller[_0x292b('0x8')]);router[_0x292b('0x6')](_0x292b('0x9'),auth['isAuthenticated'](),controller[_0x292b('0xa')]);router['get']('/:id',auth[_0x292b('0x7')](),controller[_0x292b('0xb')]);router[_0x292b('0x6')](_0x292b('0xc'),auth[_0x292b('0x7')](),controller[_0x292b('0xd')]);router[_0x292b('0x6')]('/:id/teams',auth[_0x292b('0x7')](),controller[_0x292b('0xe')]);router['get']('/:id/users',auth[_0x292b('0x7')](),controller[_0x292b('0xf')]);router[_0x292b('0x10')]('/',auth[_0x292b('0x7')](),controller['create']);router['post']('/:id/teams',auth[_0x292b('0x7')](),controller[_0x292b('0x11')]);router[_0x292b('0x10')](_0x292b('0x12'),auth[_0x292b('0x7')](),controller[_0x292b('0x13')]);router[_0x292b('0x14')](_0x292b('0x15'),auth[_0x292b('0x7')](),controller[_0x292b('0x16')]);router['delete'](_0x292b('0x15'),auth[_0x292b('0x7')](),controller['destroy']);router[_0x292b('0x17')](_0x292b('0x18'),auth['isAuthenticated'](),controller[_0x292b('0x19')]);router[_0x292b('0x17')]('/:id/users',auth[_0x292b('0x7')](),controller[_0x292b('0x1a')]);module[_0x292b('0x1b')]=router; \ No newline at end of file +var _0x22ab=['../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/describe','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','post','addTeams','put','update','destroy','removeTeams','delete','removeAgents','exports','connect-timeout','express','fs-extra'];(function(_0x35a7ed,_0x5a9b57){var _0x4a8cdc=function(_0x416fda){while(--_0x416fda){_0x35a7ed['push'](_0x35a7ed['shift']());}};_0x4a8cdc(++_0x5a9b57);}(_0x22ab,0x11d));var _0xb22a=function(_0x51b0dc,_0x5307b7){_0x51b0dc=_0x51b0dc-0x0;var _0x13fa89=_0x22ab[_0x51b0dc];return _0x13fa89;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb22a('0x0'));var express=require(_0xb22a('0x1'));var router=express['Router']();var fs_extra=require(_0xb22a('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xb22a('0x3'));var config=require(_0xb22a('0x4'));var controller=require(_0xb22a('0x5'));router[_0xb22a('0x6')]('/',auth[_0xb22a('0x7')](),controller['index']);router[_0xb22a('0x6')](_0xb22a('0x8'),auth[_0xb22a('0x7')](),controller['describe']);router[_0xb22a('0x6')](_0xb22a('0x9'),auth[_0xb22a('0x7')](),controller[_0xb22a('0xa')]);router[_0xb22a('0x6')](_0xb22a('0xb'),auth[_0xb22a('0x7')](),controller['getMembers']);router['get'](_0xb22a('0xc'),auth['isAuthenticated'](),controller['getTeams']);router[_0xb22a('0x6')](_0xb22a('0xd'),auth[_0xb22a('0x7')](),controller[_0xb22a('0xe')]);router[_0xb22a('0xf')]('/',auth[_0xb22a('0x7')](),controller['create']);router[_0xb22a('0xf')](_0xb22a('0xc'),auth[_0xb22a('0x7')](),controller[_0xb22a('0x10')]);router[_0xb22a('0xf')](_0xb22a('0xd'),auth[_0xb22a('0x7')](),controller['addAgents']);router[_0xb22a('0x11')](_0xb22a('0x9'),auth[_0xb22a('0x7')](),controller[_0xb22a('0x12')]);router['delete']('/:id',auth[_0xb22a('0x7')](),controller[_0xb22a('0x13')]);router['delete']('/:id/teams',auth[_0xb22a('0x7')](),controller[_0xb22a('0x14')]);router[_0xb22a('0x15')](_0xb22a('0xd'),auth['isAuthenticated'](),controller[_0xb22a('0x16')]);module[_0xb22a('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 3c3b405..d3a7fa6 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 _0xdbd8=['roundrobin','STRING','INTEGER','ENUM','rrmemory'];(function(_0xd1f854,_0x532346){var _0x548294=function(_0x4be823){while(--_0x4be823){_0xd1f854['push'](_0xd1f854['shift']());}};_0x548294(++_0x532346);}(_0xdbd8,0x1b4));var _0x8dbd=function(_0x359dd5,_0x331560){_0x359dd5=_0x359dd5-0x0;var _0x1a3dd4=_0xdbd8[_0x359dd5];return _0x1a3dd4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8dbd('0x0')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8dbd('0x0')]},'timeout':{'type':Sequelize[_0x8dbd('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8dbd('0x2')](_0x8dbd('0x3'),'beepall',_0x8dbd('0x4'))}}; \ No newline at end of file +var _0x3458=['STRING','INTEGER','rrmemory','beepall','exports'];(function(_0x23d0fb,_0x57d383){var _0x5d22e8=function(_0x1bdb08){while(--_0x1bdb08){_0x23d0fb['push'](_0x23d0fb['shift']());}};_0x5d22e8(++_0x57d383);}(_0x3458,0xe5));var _0x8345=function(_0x3fc23b,_0x4fdda2){_0x3fc23b=_0x3fc23b-0x0;var _0x3ef5ca=_0x3458[_0x3fc23b];return _0x3ef5ca;};'use strict';var Sequelize=require('sequelize');module[_0x8345('0x0')]={'name':{'type':Sequelize[_0x8345('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8345('0x1')]},'timeout':{'type':Sequelize[_0x8345('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8345('0x3'),_0x8345('0x4'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 423b7ce..a0f4a97 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 _0xf5f9=['limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','OpenchannelQueue','count','includeAll','include','findAll','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','OpenchannelQueues','userProfileId','autoAssociation','describe','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','agent','openchannelPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','addTeams','ids','Team','Agents','interface','flatMap','sequelize','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','every','includes','union','transaction','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','json','offset','undefined'];(function(_0x5235c6,_0x351e88){var _0x333a35=function(_0x4e7500){while(--_0x4e7500){_0x5235c6['push'](_0x5235c6['shift']());}};_0x333a35(++_0x351e88);}(_0xf5f9,0x64));var _0x9f5f=function(_0x5e6995,_0x205ad8){_0x5e6995=_0x5e6995-0x0;var _0x3a00be=_0xf5f9[_0x5e6995];return _0x3a00be;};'use strict';var emlformat=require(_0x9f5f('0x0'));var rimraf=require(_0x9f5f('0x1'));var zipdir=require(_0x9f5f('0x2'));var jsonpatch=require(_0x9f5f('0x3'));var rp=require('request-promise');var moment=require(_0x9f5f('0x4'));var BPromise=require(_0x9f5f('0x5'));var Mustache=require(_0x9f5f('0x6'));var util=require('util');var path=require(_0x9f5f('0x7'));var sox=require(_0x9f5f('0x8'));var csv=require('to-csv');var ejs=require(_0x9f5f('0x9'));var fs=require('fs');var fs_extra=require(_0x9f5f('0xa'));var _=require('lodash');var squel=require(_0x9f5f('0xb'));var crypto=require(_0x9f5f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9f5f('0xd'));var toCsv=require(_0x9f5f('0xe'));var querystring=require(_0x9f5f('0xf'));var Papa=require(_0x9f5f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9f5f('0x11'));var as=require(_0x9f5f('0x12'));var hardwareService=require(_0x9f5f('0x13'));var logger=require('../../config/logger')(_0x9f5f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9f5f('0x15'));var db=require(_0x9f5f('0x16'))['db'];config[_0x9f5f('0x17')]=_[_0x9f5f('0x18')](config[_0x9f5f('0x17')],{'host':_0x9f5f('0x19'),'port':0x18eb});var socket=require(_0x9f5f('0x1a'))(new Redis(config[_0x9f5f('0x17')]));require(_0x9f5f('0x1b'))[_0x9f5f('0x1c')](socket);function respondWithStatusCode(_0xe1fb8,_0x43af5f){_0x43af5f=_0x43af5f||0xcc;return function(_0x279218){if(_0x279218){return _0xe1fb8[_0x9f5f('0x1d')](_0x43af5f);}return _0xe1fb8['status'](_0x43af5f)[_0x9f5f('0x1e')]();};}function respondWithResult(_0x5646ad,_0x2bad35){_0x2bad35=_0x2bad35||0xc8;return function(_0x1bb54f){if(_0x1bb54f){return _0x5646ad[_0x9f5f('0x1f')](_0x2bad35)[_0x9f5f('0x20')](_0x1bb54f);}};}function respondWithFilteredResult(_0x5af436,_0xfe3455){return function(_0x14f1cf){if(_0x14f1cf){var _0x54c21e=typeof _0xfe3455[_0x9f5f('0x21')]===_0x9f5f('0x22')&&typeof _0xfe3455[_0x9f5f('0x23')]===_0x9f5f('0x22');var _0x98da6b=_0x14f1cf['count'];var _0x5bc0c5=_0x54c21e?0x0:_0xfe3455[_0x9f5f('0x21')];var _0x142c1e=_0x54c21e?_0x14f1cf['count']:_0xfe3455['offset']+_0xfe3455[_0x9f5f('0x23')];var _0x23d862;if(_0x142c1e>=_0x98da6b){_0x142c1e=_0x98da6b;_0x23d862=0xc8;}else{_0x23d862=0xce;}_0x5af436['status'](_0x23d862);return _0x5af436[_0x9f5f('0x24')](_0x9f5f('0x25'),_0x5bc0c5+'-'+_0x142c1e+'/'+_0x98da6b)[_0x9f5f('0x20')](_0x14f1cf);}return null;};}function patchUpdates(_0x2c2ab5){return function(_0x479767){try{jsonpatch[_0x9f5f('0x26')](_0x479767,_0x2c2ab5,!![]);}catch(_0x30fd4f){return BPromise['reject'](_0x30fd4f);}return _0x479767[_0x9f5f('0x27')]();};}function saveUpdates(_0x265b22,_0x6b328e){return function(_0x3aa9f5){if(_0x3aa9f5){return _0x3aa9f5[_0x9f5f('0x28')](_0x265b22)[_0x9f5f('0x29')](function(_0x1777c3){return _0x1777c3;});}return null;};}function removeEntity(_0x2b283b,_0x4bb2ca){return function(_0x3b27bb){if(_0x3b27bb){return _0x3b27bb[_0x9f5f('0x2a')]()[_0x9f5f('0x29')](function(){var _0x31c636=_0x3b27bb[_0x9f5f('0x2b')]({'plain':!![]});var _0x4c7584='OpenchannelQueues';return db[_0x9f5f('0x2c')][_0x9f5f('0x2a')]({'where':{'type':_0x4c7584,'resourceId':_0x31c636['id']}})[_0x9f5f('0x29')](function(){return _0x3b27bb;});})[_0x9f5f('0x29')](function(){_0x2b283b['status'](0xcc)[_0x9f5f('0x1e')]();});}};}function handleEntityNotFound(_0x1da198,_0x164845){return function(_0x2f1a46){if(!_0x2f1a46){_0x1da198['sendStatus'](0x194);}return _0x2f1a46;};}function handleError(_0x5976cb,_0x519092){_0x519092=_0x519092||0x1f4;return function(_0x4ebee6){logger[_0x9f5f('0x2d')](_0x4ebee6[_0x9f5f('0x2e')]);if(_0x4ebee6[_0x9f5f('0x2f')]){delete _0x4ebee6[_0x9f5f('0x2f')];}_0x5976cb[_0x9f5f('0x1f')](_0x519092)[_0x9f5f('0x30')](_0x4ebee6);};}exports[_0x9f5f('0x31')]=function(_0x4b7169,_0x1c60d3){var _0x505460={},_0x4567a1={},_0x5ed088={'count':0x0,'rows':[]};var _0x10f30e=_[_0x9f5f('0x32')](db['OpenchannelQueue'][_0x9f5f('0x33')],function(_0x50b9bd){return{'name':_0x50b9bd[_0x9f5f('0x34')],'type':_0x50b9bd[_0x9f5f('0x35')]['key']};});_0x4567a1['model']=_['map'](_0x10f30e,_0x9f5f('0x2f'));_0x4567a1[_0x9f5f('0x36')]=_[_0x9f5f('0x37')](_0x4b7169[_0x9f5f('0x36')]);_0x4567a1[_0x9f5f('0x38')]=_[_0x9f5f('0x39')](_0x4567a1[_0x9f5f('0x3a')],_0x4567a1[_0x9f5f('0x36')]);_0x505460[_0x9f5f('0x3b')]=_[_0x9f5f('0x39')](_0x4567a1[_0x9f5f('0x3a')],qs[_0x9f5f('0x3c')](_0x4b7169[_0x9f5f('0x36')][_0x9f5f('0x3c')]));_0x505460[_0x9f5f('0x3b')]=_0x505460['attributes'][_0x9f5f('0x3d')]?_0x505460[_0x9f5f('0x3b')]:_0x4567a1['model'];if(!_0x4b7169['query'][_0x9f5f('0x3e')](_0x9f5f('0x3f'))){_0x505460[_0x9f5f('0x23')]=qs[_0x9f5f('0x23')](_0x4b7169[_0x9f5f('0x36')]['limit']);_0x505460[_0x9f5f('0x21')]=qs['offset'](_0x4b7169[_0x9f5f('0x36')][_0x9f5f('0x21')]);}_0x505460[_0x9f5f('0x40')]=qs[_0x9f5f('0x41')](_0x4b7169[_0x9f5f('0x36')][_0x9f5f('0x41')]);_0x505460['where']=qs['filters'](_[_0x9f5f('0x42')](_0x4b7169['query'],_0x4567a1[_0x9f5f('0x38')]),_0x10f30e);if(_0x4b7169['query'][_0x9f5f('0x43')]){_0x505460[_0x9f5f('0x44')]=_[_0x9f5f('0x45')](_0x505460['where'],{'$or':_['map'](_0x10f30e,function(_0x54d24e){if(_0x54d24e[_0x9f5f('0x35')]!=='VIRTUAL'){var _0x227214={};_0x227214[_0x54d24e[_0x9f5f('0x2f')]]={'$like':'%'+_0x4b7169['query'][_0x9f5f('0x43')]+'%'};return _0x227214;}})});}_0x505460=_[_0x9f5f('0x45')]({},_0x505460,_0x4b7169[_0x9f5f('0x46')]);var _0x8698b9={'where':_0x505460[_0x9f5f('0x44')]};return db[_0x9f5f('0x47')][_0x9f5f('0x48')](_0x8698b9)[_0x9f5f('0x29')](function(_0x56157e){_0x5ed088[_0x9f5f('0x48')]=_0x56157e;if(_0x4b7169['query'][_0x9f5f('0x49')]){_0x505460[_0x9f5f('0x4a')]=[{'all':!![]}];}return db[_0x9f5f('0x47')][_0x9f5f('0x4b')](_0x505460);})[_0x9f5f('0x29')](function(_0x52b84f){_0x5ed088[_0x9f5f('0x4c')]=_0x52b84f;return _0x5ed088;})[_0x9f5f('0x29')](respondWithFilteredResult(_0x1c60d3,_0x505460))[_0x9f5f('0x4d')](handleError(_0x1c60d3,null));};exports['show']=function(_0x1881ac,_0x1a7d6f){var _0x5766bf={'raw':!![],'where':{'id':_0x1881ac[_0x9f5f('0x4e')]['id']}},_0xda46a={};_0xda46a[_0x9f5f('0x3a')]=_[_0x9f5f('0x37')](db[_0x9f5f('0x47')][_0x9f5f('0x33')]);_0xda46a[_0x9f5f('0x36')]=_[_0x9f5f('0x37')](_0x1881ac['query']);_0xda46a[_0x9f5f('0x38')]=_[_0x9f5f('0x39')](_0xda46a[_0x9f5f('0x3a')],_0xda46a[_0x9f5f('0x36')]);_0x5766bf[_0x9f5f('0x3b')]=_[_0x9f5f('0x39')](_0xda46a['model'],qs[_0x9f5f('0x3c')](_0x1881ac['query'][_0x9f5f('0x3c')]));_0x5766bf[_0x9f5f('0x3b')]=_0x5766bf[_0x9f5f('0x3b')][_0x9f5f('0x3d')]?_0x5766bf[_0x9f5f('0x3b')]:_0xda46a[_0x9f5f('0x3a')];if(_0x1881ac[_0x9f5f('0x36')][_0x9f5f('0x49')]){_0x5766bf[_0x9f5f('0x4a')]=[{'all':!![]}];}_0x5766bf=_['merge']({},_0x5766bf,_0x1881ac['options']);return db[_0x9f5f('0x47')][_0x9f5f('0x4f')](_0x5766bf)[_0x9f5f('0x29')](handleEntityNotFound(_0x1a7d6f,null))[_0x9f5f('0x29')](respondWithResult(_0x1a7d6f,null))['catch'](handleError(_0x1a7d6f,null));};exports[_0x9f5f('0x50')]=function(_0x266279,_0xd565ea){return db[_0x9f5f('0x47')][_0x9f5f('0x50')](_0x266279[_0x9f5f('0x51')],{})[_0x9f5f('0x29')](function(_0x1d8b4e){var _0x198606=_0x266279['user'][_0x9f5f('0x2b')]({'plain':!![]});if(!_0x198606)throw new Error(_0x9f5f('0x52'));if(_0x198606[_0x9f5f('0x53')]===_0x9f5f('0x54')){var _0xfe9393=_0x1d8b4e[_0x9f5f('0x2b')]({'plain':!![]});var _0x2eff4e=_0x9f5f('0x55');return db['UserProfileSection'][_0x9f5f('0x4f')]({'where':{'name':_0x2eff4e,'userProfileId':_0x198606[_0x9f5f('0x56')]},'raw':!![]})[_0x9f5f('0x29')](function(_0x2b26ea){if(_0x2b26ea&&_0x2b26ea[_0x9f5f('0x57')]===0x0){return db[_0x9f5f('0x2c')][_0x9f5f('0x50')]({'name':_0xfe9393[_0x9f5f('0x2f')],'resourceId':_0xfe9393['id'],'type':_0x2b26ea[_0x9f5f('0x2f')],'sectionId':_0x2b26ea['id']},{})[_0x9f5f('0x29')](function(){return _0x1d8b4e;});}else{return _0x1d8b4e;}})[_0x9f5f('0x4d')](function(_0x93cefe){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x93cefe);throw _0x93cefe;});}return _0x1d8b4e;})[_0x9f5f('0x29')](respondWithResult(_0xd565ea,0xc9))[_0x9f5f('0x4d')](handleError(_0xd565ea,null));};exports[_0x9f5f('0x28')]=function(_0x226363,_0x569234){if(_0x226363[_0x9f5f('0x51')]['id']){delete _0x226363[_0x9f5f('0x51')]['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x226363[_0x9f5f('0x4e')]['id']}})[_0x9f5f('0x29')](handleEntityNotFound(_0x569234,null))[_0x9f5f('0x29')](saveUpdates(_0x226363['body'],null))[_0x9f5f('0x29')](respondWithResult(_0x569234,null))[_0x9f5f('0x4d')](handleError(_0x569234,null));};exports[_0x9f5f('0x2a')]=function(_0x4bb977,_0x3c6818){return db['OpenchannelQueue']['find']({'where':{'id':_0x4bb977[_0x9f5f('0x4e')]['id']}})[_0x9f5f('0x29')](handleEntityNotFound(_0x3c6818,null))[_0x9f5f('0x29')](removeEntity(_0x3c6818,null))[_0x9f5f('0x4d')](handleError(_0x3c6818,null));};exports[_0x9f5f('0x58')]=function(_0x1688c7,_0x18b907){return db[_0x9f5f('0x47')][_0x9f5f('0x58')]()[_0x9f5f('0x29')](respondWithResult(_0x18b907,null))['catch'](handleError(_0x18b907,null));};exports['getMembers']=function(_0x1dd057,_0x183ee3,_0x3dc95b){var _0x1c6bae={'raw':!![],'where':{}},_0x290ba3={},_0x307f1f;return db[_0x9f5f('0x47')][_0x9f5f('0x59')]({'where':{'id':_0x1dd057[_0x9f5f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x183ee3,null))[_0x9f5f('0x29')](function(_0x202177){if(_0x202177){_0x307f1f=_0x202177[_0x9f5f('0x2b')]({'plain':!![]});_0x290ba3[_0x9f5f('0x3a')]=_[_0x9f5f('0x37')](db[_0x9f5f('0x5a')]['rawAttributes']);_0x290ba3[_0x9f5f('0x36')]=_[_0x9f5f('0x37')](_0x1dd057[_0x9f5f('0x36')]);_0x290ba3[_0x9f5f('0x38')]=_[_0x9f5f('0x39')](_0x290ba3[_0x9f5f('0x3a')],_0x290ba3['query']);_0x1c6bae[_0x9f5f('0x3b')]=_[_0x9f5f('0x39')](_0x290ba3[_0x9f5f('0x3a')],qs[_0x9f5f('0x3c')](_0x1dd057[_0x9f5f('0x36')]['fields']));_0x1c6bae[_0x9f5f('0x3b')]=_0x1c6bae[_0x9f5f('0x3b')][_0x9f5f('0x3d')]?_0x1c6bae[_0x9f5f('0x3b')]:_0x290ba3[_0x9f5f('0x3a')];if(!_0x1dd057['query']['hasOwnProperty'](_0x9f5f('0x3f'))){_0x1c6bae[_0x9f5f('0x23')]=qs['limit'](_0x1dd057['query'][_0x9f5f('0x23')]);_0x1c6bae[_0x9f5f('0x21')]=qs[_0x9f5f('0x21')](_0x1dd057[_0x9f5f('0x36')][_0x9f5f('0x21')]);}_0x1c6bae[_0x9f5f('0x40')]=qs['sort'](_0x1dd057[_0x9f5f('0x36')]['sort']);_0x1c6bae[_0x9f5f('0x44')]=qs['filters'](_['pick'](_0x1dd057[_0x9f5f('0x36')],_0x290ba3[_0x9f5f('0x38')]));_0x1c6bae[_0x9f5f('0x44')][_0x9f5f('0x5b')]=_0x202177['id'];if(_0x1dd057[_0x9f5f('0x36')]['filter']){_0x1c6bae[_0x9f5f('0x44')]=_['merge'](_0x1c6bae[_0x9f5f('0x44')],{'$or':_[_0x9f5f('0x32')](_0x1c6bae[_0x9f5f('0x3b')],function(_0x273a29){var _0x393169={};_0x393169[_0x273a29]={'$like':'%'+_0x1dd057[_0x9f5f('0x36')][_0x9f5f('0x43')]+'%'};return _0x393169;})});}_0x1c6bae=_['merge']({},_0x1c6bae,_0x1dd057[_0x9f5f('0x46')]);return db['UserOpenchannelQueue'][_0x9f5f('0x4b')](_0x1c6bae);}})[_0x9f5f('0x29')](function(_0x2c9962){if(_0x2c9962){return db[_0x9f5f('0x5c')]['findAndCountAll']({'where':{'id':_[_0x9f5f('0x32')](_0x2c9962,'UserId'),'role':_0x9f5f('0x5d')},'attributes':['id','name',_0x9f5f('0x5e'),_0x9f5f('0x5f'),'createdAt']});}})[_0x9f5f('0x29')](function(_0x1d9aea){if(_0x1d9aea){return{'count':_0x1d9aea[_0x9f5f('0x48')],'rows':_[_0x9f5f('0x32')](_0x1d9aea[_0x9f5f('0x4c')],function(_0x4a87c6){return{'membername':_0x4a87c6[_0x9f5f('0x2f')],'UserId':_0x4a87c6['id'],'queue_name':_0x307f1f[_0x9f5f('0x2f')],'OpenchannelQueueId':_0x307f1f['id'],'interface':util[_0x9f5f('0x60')](_0x9f5f('0x61'),_0x9f5f('0x62'),_0x4a87c6[_0x9f5f('0x2f')]),'penalty':0x0,'paused':_0x4a87c6['openchannelPause'],'createdAt':_0x4a87c6[_0x9f5f('0x63')],'updatedAt':_0x4a87c6[_0x9f5f('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9f5f('0x29')](respondWithFilteredResult(_0x183ee3,_0x1c6bae))[_0x9f5f('0x4d')](handleError(_0x183ee3,null));};exports[_0x9f5f('0x64')]=function(_0x10be79,_0x17e145,_0x56fac0){var _0x162fc5={};var _0x4318c9={};var _0x49cdf1;var _0x10b534;return db[_0x9f5f('0x47')][_0x9f5f('0x59')]({'where':{'id':_0x10be79[_0x9f5f('0x4e')]['id']}})[_0x9f5f('0x29')](handleEntityNotFound(_0x17e145,null))[_0x9f5f('0x29')](function(_0x476079){if(_0x476079){_0x49cdf1=_0x476079;_0x4318c9['model']=_[_0x9f5f('0x37')](db['Team']['rawAttributes']);_0x4318c9[_0x9f5f('0x36')]=_[_0x9f5f('0x37')](_0x10be79[_0x9f5f('0x36')]);_0x4318c9[_0x9f5f('0x38')]=_['intersection'](_0x4318c9[_0x9f5f('0x3a')],_0x4318c9['query']);_0x162fc5[_0x9f5f('0x3b')]=_['intersection'](_0x4318c9['model'],qs[_0x9f5f('0x3c')](_0x10be79[_0x9f5f('0x36')]['fields']));_0x162fc5[_0x9f5f('0x3b')]=_0x162fc5['attributes'][_0x9f5f('0x3d')]?_0x162fc5[_0x9f5f('0x3b')]:_0x4318c9['model'];_0x162fc5[_0x9f5f('0x40')]=qs['sort'](_0x10be79[_0x9f5f('0x36')]['sort']);_0x162fc5[_0x9f5f('0x44')]=qs[_0x9f5f('0x38')](_[_0x9f5f('0x42')](_0x10be79['query'],_0x4318c9[_0x9f5f('0x38')]));if(_0x10be79['query']['filter']){_0x162fc5[_0x9f5f('0x44')]=_[_0x9f5f('0x45')](_0x162fc5[_0x9f5f('0x44')],{'$or':_[_0x9f5f('0x32')](_0x162fc5['attributes'],function(_0x1e156c){var _0x13bc84={};_0x13bc84[_0x1e156c]={'$like':'%'+_0x10be79['query'][_0x9f5f('0x43')]+'%'};return _0x13bc84;})});}_0x162fc5=_[_0x9f5f('0x45')]({},_0x162fc5,_0x10be79[_0x9f5f('0x46')]);return _0x49cdf1[_0x9f5f('0x64')](_0x162fc5);}})[_0x9f5f('0x29')](function(_0x3b9902){if(_0x3b9902){_0x10b534=_0x3b9902['length'];if(!_0x10be79[_0x9f5f('0x36')][_0x9f5f('0x3e')](_0x9f5f('0x3f'))){_0x162fc5[_0x9f5f('0x23')]=qs['limit'](_0x10be79[_0x9f5f('0x36')][_0x9f5f('0x23')]);_0x162fc5[_0x9f5f('0x21')]=qs[_0x9f5f('0x21')](_0x10be79[_0x9f5f('0x36')][_0x9f5f('0x21')]);}return _0x49cdf1[_0x9f5f('0x64')](_0x162fc5);}})[_0x9f5f('0x29')](function(_0x359d38){if(_0x359d38){return _0x359d38?{'count':_0x10b534,'rows':_0x359d38}:null;}})['then'](respondWithResult(_0x17e145,null))['catch'](handleError(_0x17e145,null));};exports[_0x9f5f('0x65')]=function(_0x448f29,_0x267b91,_0x31f763){var _0x57e3bd=_0x448f29[_0x9f5f('0x51')][_0x9f5f('0x66')];return db[_0x9f5f('0x67')][_0x9f5f('0x4b')]({'where':{'id':_0x57e3bd},'attributes':['id'],'include':[{'model':db[_0x9f5f('0x5c')],'as':_0x9f5f('0x68'),'attributes':['id',_0x9f5f('0x2f'),'online','voicePause',_0x9f5f('0x69')],'raw':!![]}]})['then'](function(_0x31c6d2){if(_0x31c6d2){var _0x591ee2=_[_0x9f5f('0x6a')](_0x31c6d2,function(_0x559fc0){var _0x36d4c5=_0x559fc0[_0x9f5f('0x2b')]({'plain':!![]});return _0x36d4c5[_0x9f5f('0x68')];});return db[_0x9f5f('0x47')]['find']({'where':{'id':_0x448f29[_0x9f5f('0x4e')]['id']}})[_0x9f5f('0x29')](function(_0x586a95){return db[_0x9f5f('0x6b')]['transaction'](function(_0x1e6b6c){return _0x586a95[_0x9f5f('0x65')](_0x57e3bd,{'transaction':_0x1e6b6c})[_0x9f5f('0x29')](function(){return BPromise['each'](_0x591ee2,function(_0x512d46){return db[_0x9f5f('0x5a')][_0x9f5f('0x6c')]({'where':{'UserId':_0x512d46['id'],'OpenchannelQueueId':_0x448f29[_0x9f5f('0x4e')]['id']},'transaction':_0x1e6b6c});});})[_0x9f5f('0x29')](function(){_0x591ee2[_0x9f5f('0x6d')](function(_0x2de069){socket[_0x9f5f('0x6e')](_0x9f5f('0x6f'),{'UserId':_0x2de069['id'],'OpenchannelQueueId':_0x586a95['id']});});});});});}})[_0x9f5f('0x29')](respondWithStatusCode(_0x267b91,null))['catch'](handleError(_0x267b91,null));};exports[_0x9f5f('0x70')]=function(_0x15ec15,_0x520078,_0x36ac71){return db['Team'][_0x9f5f('0x4b')]({'where':{'id':_0x15ec15['query'][_0x9f5f('0x66')]},'attributes':['id'],'include':[{'model':db[_0x9f5f('0x5c')],'as':_0x9f5f('0x68'),'attributes':['id'],'raw':!![]}]})[_0x9f5f('0x29')](handleEntityNotFound(_0x520078,null))['then'](function(_0x1efc82){var _0x3cc527=_[_0x9f5f('0x32')](_0x1efc82,'id');var _0x3a5429=[];var _0x41b41c=[];var _0x487b5a=squel[_0x9f5f('0x71')]();_0x487b5a[_0x9f5f('0x72')](_0x9f5f('0x73'))[_0x9f5f('0x74')](_0x9f5f('0x75'),'tq')['join'](_0x9f5f('0x76'),'ut',_0x9f5f('0x77'))['where'](_0x9f5f('0x78'),_0x15ec15[_0x9f5f('0x4e')]['id']);for(var _0x3dedcd=0x0;_0x3dedcd<_0x1efc82[_0x9f5f('0x3d')];_0x3dedcd+=0x1){let _0x792d2a=_0x1efc82[_0x3dedcd];for(var _0x1267e0=0x0;_0x1267e0<_0x792d2a['Agents'][_0x9f5f('0x3d')];_0x1267e0+=0x1){let _0x20292e=_0x792d2a[_0x9f5f('0x68')][_0x1267e0];var _0x23dc46=_0x487b5a[_0x9f5f('0x79')]();_0x23dc46['where'](_0x9f5f('0x7a'),_0x20292e['id']);_0x41b41c[_0x9f5f('0x7b')](db[_0x9f5f('0x6b')][_0x9f5f('0x36')](_0x23dc46['toString'](),{'type':db[_0x9f5f('0x6b')]['QueryTypes']['SELECT']})[_0x9f5f('0x29')](function(_0x141832){if(_0x141832['length']===0x1){return _0x20292e['id'];}else{var _0x332eeb=_[_0x9f5f('0x7c')](_['map'](_0x141832,'TeamId'),function(_0xbed746){return _[_0x9f5f('0x7d')](_0x3cc527,_0xbed746);});if(_0x332eeb){return _0x20292e['id'];}}}));}}return BPromise['all'](_0x41b41c)[_0x9f5f('0x29')](function(_0x593d0d){_0x3a5429=_(_0x3a5429)[_0x9f5f('0x7e')](_0x593d0d)['compact']()['value']();return db[_0x9f5f('0x47')][_0x9f5f('0x4f')]({'where':{'id':_0x15ec15[_0x9f5f('0x4e')]['id']}})['then'](function(_0x4e3d22){return db[_0x9f5f('0x6b')][_0x9f5f('0x7f')](function(_0x4d0ad2){return _0x4e3d22['removeTeams'](_0x15ec15['query'][_0x9f5f('0x66')],{'transaction':_0x4d0ad2})[_0x9f5f('0x29')](function(){if(!_[_0x9f5f('0x80')](_0x3a5429)){return _0x4e3d22[_0x9f5f('0x81')](_0x3a5429,{'transaction':_0x4d0ad2});}})[_0x9f5f('0x29')](function(){_0x3a5429[_0x9f5f('0x6d')](function(_0x37b7c9){socket[_0x9f5f('0x6e')](_0x9f5f('0x82'),{'UserId':_0x37b7c9,'OpenchannelQueueId':_0x4e3d22['id']});});});});});});})['then'](respondWithStatusCode(_0x520078,null))['catch'](handleError(_0x520078,null));};exports[_0x9f5f('0x83')]=function(_0x1f6f19,_0x5ac668,_0x1e457d){return db[_0x9f5f('0x47')]['find']({'where':{'id':_0x1f6f19[_0x9f5f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5ac668,null))[_0x9f5f('0x29')](function(_0x41b6b1){if(_0x41b6b1){return _0x41b6b1[_0x9f5f('0x83')](_0x1f6f19[_0x9f5f('0x51')][_0x9f5f('0x66')],_[_0x9f5f('0x84')](_0x1f6f19['body'],[_0x9f5f('0x66'),'id'])||{})['spread'](function(_0xd9cd3b){for(var _0x262587=0x0;_0x262587<_0x1f6f19[_0x9f5f('0x51')]['ids'][_0x9f5f('0x3d')];_0x262587+=0x1){socket['emit'](_0x9f5f('0x6f'),{'UserId':Number(_0x1f6f19[_0x9f5f('0x51')][_0x9f5f('0x66')][_0x262587]),'OpenchannelQueueId':Number(_0x1f6f19['params']['id'])});}return _0xd9cd3b;});}})[_0x9f5f('0x29')](respondWithResult(_0x5ac668,null))[_0x9f5f('0x4d')](handleError(_0x5ac668,null));};exports[_0x9f5f('0x81')]=function(_0x1a41c0,_0x44361d,_0x26ba0b){return db[_0x9f5f('0x47')]['find']({'where':{'id':_0x1a41c0[_0x9f5f('0x4e')]['id']}})[_0x9f5f('0x29')](handleEntityNotFound(_0x44361d,null))[_0x9f5f('0x29')](function(_0x37a20c){if(_0x37a20c){return _0x37a20c[_0x9f5f('0x81')](_0x1a41c0[_0x9f5f('0x36')][_0x9f5f('0x66')])[_0x9f5f('0x29')](function(){if(_[_0x9f5f('0x85')](_0x1a41c0['query'][_0x9f5f('0x66')])){for(var _0x42b958=0x0;_0x42b958<_0x1a41c0[_0x9f5f('0x36')][_0x9f5f('0x66')][_0x9f5f('0x3d')];_0x42b958+=0x1){socket['emit'](_0x9f5f('0x82'),{'UserId':Number(_0x1a41c0[_0x9f5f('0x36')][_0x9f5f('0x66')][_0x42b958]),'OpenchannelQueueId':Number(_0x1a41c0[_0x9f5f('0x4e')]['id'])});}}else{socket[_0x9f5f('0x6e')](_0x9f5f('0x82'),{'UserId':Number(_0x1a41c0[_0x9f5f('0x36')][_0x9f5f('0x66')]),'OpenchannelQueueId':Number(_0x1a41c0[_0x9f5f('0x4e')]['id'])});}});}})[_0x9f5f('0x29')](respondWithStatusCode(_0x44361d,null))[_0x9f5f('0x4d')](handleError(_0x44361d,null));};exports[_0x9f5f('0x86')]=function(_0x4fa080,_0x3251c2,_0x45bbe5){var _0x1839ff={};var _0x29ff7c={};var _0x4d5f0b;var _0x1b23c0;return db['OpenchannelQueue'][_0x9f5f('0x59')]({'where':{'id':_0x4fa080[_0x9f5f('0x4e')]['id']}})[_0x9f5f('0x29')](handleEntityNotFound(_0x3251c2,null))[_0x9f5f('0x29')](function(_0x3eec9a){if(_0x3eec9a){_0x4d5f0b=_0x3eec9a;_0x29ff7c[_0x9f5f('0x3a')]=_[_0x9f5f('0x37')](db[_0x9f5f('0x5c')][_0x9f5f('0x33')]);_0x29ff7c[_0x9f5f('0x36')]=_['keys'](_0x4fa080[_0x9f5f('0x36')]);_0x29ff7c[_0x9f5f('0x38')]=_['intersection'](_0x29ff7c[_0x9f5f('0x3a')],_0x29ff7c['query']);_0x1839ff[_0x9f5f('0x3b')]=_[_0x9f5f('0x39')](_0x29ff7c[_0x9f5f('0x3a')],qs[_0x9f5f('0x3c')](_0x4fa080[_0x9f5f('0x36')]['fields']));_0x1839ff['attributes']=_0x1839ff[_0x9f5f('0x3b')][_0x9f5f('0x3d')]?_0x1839ff[_0x9f5f('0x3b')]:_0x29ff7c[_0x9f5f('0x3a')];_0x1839ff[_0x9f5f('0x40')]=qs[_0x9f5f('0x41')](_0x4fa080[_0x9f5f('0x36')][_0x9f5f('0x41')]);_0x1839ff[_0x9f5f('0x44')]=qs[_0x9f5f('0x38')](_[_0x9f5f('0x42')](_0x4fa080[_0x9f5f('0x36')],_0x29ff7c['filters']));if(_0x4fa080[_0x9f5f('0x36')]['filter']){_0x1839ff[_0x9f5f('0x44')]=_[_0x9f5f('0x45')](_0x1839ff[_0x9f5f('0x44')],{'$or':_['map'](_0x1839ff['attributes'],function(_0x4728ac){var _0x5e583e={};_0x5e583e[_0x4728ac]={'$like':'%'+_0x4fa080[_0x9f5f('0x36')][_0x9f5f('0x43')]+'%'};return _0x5e583e;})});}_0x1839ff=_['merge']({},_0x1839ff,_0x4fa080[_0x9f5f('0x46')]);return _0x4d5f0b[_0x9f5f('0x86')](_0x1839ff);}})[_0x9f5f('0x29')](function(_0x511948){if(_0x511948){_0x1b23c0=_0x511948[_0x9f5f('0x3d')];if(!_0x4fa080[_0x9f5f('0x36')][_0x9f5f('0x3e')](_0x9f5f('0x3f'))){_0x1839ff['limit']=qs[_0x9f5f('0x23')](_0x4fa080[_0x9f5f('0x36')]['limit']);_0x1839ff[_0x9f5f('0x21')]=qs['offset'](_0x4fa080['query'][_0x9f5f('0x21')]);}return _0x4d5f0b[_0x9f5f('0x86')](_0x1839ff);}})[_0x9f5f('0x29')](function(_0xd6d7a7){if(_0xd6d7a7){return _0xd6d7a7?{'count':_0x1b23c0,'rows':_0xd6d7a7}:null;}})['then'](respondWithResult(_0x3251c2,null))[_0x9f5f('0x4d')](handleError(_0x3251c2,null));}; \ No newline at end of file +var _0xd3d8=['register','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','update','destroy','then','UserProfileResource','error','stack','name','send','index','OpenchannelQueue','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','type','VIRTUAL','includeAll','include','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','rawAttributes','nolimit','OpenchannelQueueId','merge','findAll','User','findAndCountAll','UserId','agent','openchannelPause','rows','format','%s/%s','SIP','createdAt','getTeams','Team','pick','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','addAgents','omit','removeAgents','isArray','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost'];(function(_0x37c989,_0x1c95b8){var _0x4b15a6=function(_0x29b545){while(--_0x29b545){_0x37c989['push'](_0x37c989['shift']());}};_0x4b15a6(++_0x1c95b8);}(_0xd3d8,0x104));var _0x8d3d=function(_0x2445c0,_0x28d78e){_0x2445c0=_0x2445c0-0x0;var _0x4e8e3c=_0xd3d8[_0x2445c0];return _0x4e8e3c;};'use strict';var emlformat=require(_0x8d3d('0x0'));var rimraf=require(_0x8d3d('0x1'));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('mustache');var util=require(_0x8d3d('0x2'));var path=require(_0x8d3d('0x3'));var sox=require(_0x8d3d('0x4'));var csv=require(_0x8d3d('0x5'));var ejs=require(_0x8d3d('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8d3d('0x7'));var squel=require(_0x8d3d('0x8'));var crypto=require(_0x8d3d('0x9'));var jsforce=require(_0x8d3d('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8d3d('0xb'));var Papa=require(_0x8d3d('0xc'));var Redis=require(_0x8d3d('0xd'));var authService=require(_0x8d3d('0xe'));var qs=require(_0x8d3d('0xf'));var as=require(_0x8d3d('0x10'));var hardwareService=require(_0x8d3d('0x11'));var logger=require(_0x8d3d('0x12'))(_0x8d3d('0x13'));var utils=require(_0x8d3d('0x14'));var config=require(_0x8d3d('0x15'));var licenseUtil=require(_0x8d3d('0x16'));var db=require('../../mysqldb')['db'];config[_0x8d3d('0x17')]=_[_0x8d3d('0x18')](config[_0x8d3d('0x17')],{'host':_0x8d3d('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8d3d('0x17')]));require('./openchannelQueue.socket')[_0x8d3d('0x1a')](socket);function respondWithStatusCode(_0x378d5e,_0x2d18e0){_0x2d18e0=_0x2d18e0||0xcc;return function(_0x8171f){if(_0x8171f){return _0x378d5e[_0x8d3d('0x1b')](_0x2d18e0);}return _0x378d5e[_0x8d3d('0x1c')](_0x2d18e0)[_0x8d3d('0x1d')]();};}function respondWithResult(_0x465e0a,_0x27fe48){_0x27fe48=_0x27fe48||0xc8;return function(_0x56cdaa){if(_0x56cdaa){return _0x465e0a[_0x8d3d('0x1c')](_0x27fe48)[_0x8d3d('0x1e')](_0x56cdaa);}};}function respondWithFilteredResult(_0x1a8e13,_0x404e0c){return function(_0x2c80c0){if(_0x2c80c0){var _0x4ea198=typeof _0x404e0c[_0x8d3d('0x1f')]==='undefined'&&typeof _0x404e0c[_0x8d3d('0x20')]===_0x8d3d('0x21');var _0x23fb3e=_0x2c80c0[_0x8d3d('0x22')];var _0x25b277=_0x4ea198?0x0:_0x404e0c[_0x8d3d('0x1f')];var _0x54d894=_0x4ea198?_0x2c80c0[_0x8d3d('0x22')]:_0x404e0c[_0x8d3d('0x1f')]+_0x404e0c['limit'];var _0x46e220;if(_0x54d894>=_0x23fb3e){_0x54d894=_0x23fb3e;_0x46e220=0xc8;}else{_0x46e220=0xce;}_0x1a8e13['status'](_0x46e220);return _0x1a8e13[_0x8d3d('0x23')]('Content-Range',_0x25b277+'-'+_0x54d894+'/'+_0x23fb3e)[_0x8d3d('0x1e')](_0x2c80c0);}return null;};}function patchUpdates(_0x4fc704){return function(_0x355711){try{jsonpatch['apply'](_0x355711,_0x4fc704,!![]);}catch(_0x19f3a1){return BPromise[_0x8d3d('0x24')](_0x19f3a1);}return _0x355711[_0x8d3d('0x25')]();};}function saveUpdates(_0x2cb05f,_0x192733){return function(_0x46e66a){if(_0x46e66a){return _0x46e66a[_0x8d3d('0x26')](_0x2cb05f)['then'](function(_0x3e3752){return _0x3e3752;});}return null;};}function removeEntity(_0xccaf8b,_0x182916){return function(_0x3ed4b4){if(_0x3ed4b4){return _0x3ed4b4[_0x8d3d('0x27')]()[_0x8d3d('0x28')](function(){var _0x3239e6=_0x3ed4b4['get']({'plain':!![]});var _0x199ef0='OpenchannelQueues';return db[_0x8d3d('0x29')]['destroy']({'where':{'type':_0x199ef0,'resourceId':_0x3239e6['id']}})[_0x8d3d('0x28')](function(){return _0x3ed4b4;});})[_0x8d3d('0x28')](function(){_0xccaf8b[_0x8d3d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fa7ac,_0x2ce0a6){return function(_0x38e440){if(!_0x38e440){_0x3fa7ac[_0x8d3d('0x1b')](0x194);}return _0x38e440;};}function handleError(_0x250cfa,_0x4f6913){_0x4f6913=_0x4f6913||0x1f4;return function(_0x412e79){logger[_0x8d3d('0x2a')](_0x412e79[_0x8d3d('0x2b')]);if(_0x412e79[_0x8d3d('0x2c')]){delete _0x412e79[_0x8d3d('0x2c')];}_0x250cfa[_0x8d3d('0x1c')](_0x4f6913)[_0x8d3d('0x2d')](_0x412e79);};}exports[_0x8d3d('0x2e')]=function(_0x52288b,_0x5a8c22){var _0x379d7e={},_0xa8796a={},_0x1be178={'count':0x0,'rows':[]};var _0x29d905=_['map'](db[_0x8d3d('0x2f')]['rawAttributes'],function(_0x5b80b7){return{'name':_0x5b80b7['fieldName'],'type':_0x5b80b7['type']['key']};});_0xa8796a[_0x8d3d('0x30')]=_[_0x8d3d('0x31')](_0x29d905,'name');_0xa8796a[_0x8d3d('0x32')]=_[_0x8d3d('0x33')](_0x52288b['query']);_0xa8796a[_0x8d3d('0x34')]=_[_0x8d3d('0x35')](_0xa8796a[_0x8d3d('0x30')],_0xa8796a[_0x8d3d('0x32')]);_0x379d7e['attributes']=_[_0x8d3d('0x35')](_0xa8796a['model'],qs[_0x8d3d('0x36')](_0x52288b[_0x8d3d('0x32')][_0x8d3d('0x36')]));_0x379d7e['attributes']=_0x379d7e[_0x8d3d('0x37')][_0x8d3d('0x38')]?_0x379d7e['attributes']:_0xa8796a[_0x8d3d('0x30')];if(!_0x52288b[_0x8d3d('0x32')][_0x8d3d('0x39')]('nolimit')){_0x379d7e[_0x8d3d('0x20')]=qs[_0x8d3d('0x20')](_0x52288b['query'][_0x8d3d('0x20')]);_0x379d7e[_0x8d3d('0x1f')]=qs[_0x8d3d('0x1f')](_0x52288b['query'][_0x8d3d('0x1f')]);}_0x379d7e[_0x8d3d('0x3a')]=qs[_0x8d3d('0x3b')](_0x52288b[_0x8d3d('0x32')][_0x8d3d('0x3b')]);_0x379d7e[_0x8d3d('0x3c')]=qs[_0x8d3d('0x34')](_['pick'](_0x52288b[_0x8d3d('0x32')],_0xa8796a[_0x8d3d('0x34')]),_0x29d905);if(_0x52288b['query'][_0x8d3d('0x3d')]){_0x379d7e['where']=_['merge'](_0x379d7e['where'],{'$or':_['map'](_0x29d905,function(_0x56fdae){if(_0x56fdae[_0x8d3d('0x3e')]!==_0x8d3d('0x3f')){var _0x18e3dc={};_0x18e3dc[_0x56fdae['name']]={'$like':'%'+_0x52288b[_0x8d3d('0x32')]['filter']+'%'};return _0x18e3dc;}})});}_0x379d7e=_['merge']({},_0x379d7e,_0x52288b['options']);var _0xac8f41={'where':_0x379d7e[_0x8d3d('0x3c')]};return db[_0x8d3d('0x2f')][_0x8d3d('0x22')](_0xac8f41)[_0x8d3d('0x28')](function(_0x3a535e){_0x1be178[_0x8d3d('0x22')]=_0x3a535e;if(_0x52288b[_0x8d3d('0x32')][_0x8d3d('0x40')]){_0x379d7e[_0x8d3d('0x41')]=[{'all':!![]}];}return db['OpenchannelQueue']['findAll'](_0x379d7e);})[_0x8d3d('0x28')](function(_0x5da703){_0x1be178['rows']=_0x5da703;return _0x1be178;})['then'](respondWithFilteredResult(_0x5a8c22,_0x379d7e))['catch'](handleError(_0x5a8c22,null));};exports[_0x8d3d('0x42')]=function(_0x427c42,_0x4d6813){var _0x4b0fa9={'raw':!![],'where':{'id':_0x427c42[_0x8d3d('0x43')]['id']}},_0x3210a2={};_0x3210a2[_0x8d3d('0x30')]=_[_0x8d3d('0x33')](db[_0x8d3d('0x2f')]['rawAttributes']);_0x3210a2[_0x8d3d('0x32')]=_[_0x8d3d('0x33')](_0x427c42[_0x8d3d('0x32')]);_0x3210a2[_0x8d3d('0x34')]=_[_0x8d3d('0x35')](_0x3210a2[_0x8d3d('0x30')],_0x3210a2['query']);_0x4b0fa9[_0x8d3d('0x37')]=_[_0x8d3d('0x35')](_0x3210a2[_0x8d3d('0x30')],qs['fields'](_0x427c42['query'][_0x8d3d('0x36')]));_0x4b0fa9[_0x8d3d('0x37')]=_0x4b0fa9['attributes'][_0x8d3d('0x38')]?_0x4b0fa9['attributes']:_0x3210a2[_0x8d3d('0x30')];if(_0x427c42[_0x8d3d('0x32')]['includeAll']){_0x4b0fa9[_0x8d3d('0x41')]=[{'all':!![]}];}_0x4b0fa9=_['merge']({},_0x4b0fa9,_0x427c42[_0x8d3d('0x44')]);return db[_0x8d3d('0x2f')][_0x8d3d('0x45')](_0x4b0fa9)[_0x8d3d('0x28')](handleEntityNotFound(_0x4d6813,null))[_0x8d3d('0x28')](respondWithResult(_0x4d6813,null))['catch'](handleError(_0x4d6813,null));};exports[_0x8d3d('0x46')]=function(_0x4de290,_0x46923a){return db['OpenchannelQueue'][_0x8d3d('0x46')](_0x4de290['body'],{})[_0x8d3d('0x28')](function(_0x24460d){var _0x39f26b=_0x4de290[_0x8d3d('0x47')]['get']({'plain':!![]});if(!_0x39f26b)throw new Error(_0x8d3d('0x48'));if(_0x39f26b[_0x8d3d('0x49')]===_0x8d3d('0x47')){var _0xb205c=_0x24460d[_0x8d3d('0x4a')]({'plain':!![]});var _0x2e90fb=_0x8d3d('0x4b');return db[_0x8d3d('0x4c')][_0x8d3d('0x45')]({'where':{'name':_0x2e90fb,'userProfileId':_0x39f26b[_0x8d3d('0x4d')]},'raw':!![]})[_0x8d3d('0x28')](function(_0x397661){if(_0x397661&&_0x397661[_0x8d3d('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0xb205c[_0x8d3d('0x2c')],'resourceId':_0xb205c['id'],'type':_0x397661['name'],'sectionId':_0x397661['id']},{})[_0x8d3d('0x28')](function(){return _0x24460d;});}else{return _0x24460d;}})[_0x8d3d('0x4f')](function(_0x4b4845){logger['error'](_0x8d3d('0x50'),_0x4b4845);throw _0x4b4845;});}return _0x24460d;})[_0x8d3d('0x28')](respondWithResult(_0x46923a,0xc9))['catch'](handleError(_0x46923a,null));};exports[_0x8d3d('0x26')]=function(_0x2148c1,_0x313371){if(_0x2148c1[_0x8d3d('0x51')]['id']){delete _0x2148c1[_0x8d3d('0x51')]['id'];}return db[_0x8d3d('0x2f')][_0x8d3d('0x45')]({'where':{'id':_0x2148c1[_0x8d3d('0x43')]['id']}})['then'](handleEntityNotFound(_0x313371,null))[_0x8d3d('0x28')](saveUpdates(_0x2148c1[_0x8d3d('0x51')],null))[_0x8d3d('0x28')](respondWithResult(_0x313371,null))['catch'](handleError(_0x313371,null));};exports[_0x8d3d('0x27')]=function(_0x47ce44,_0xc22ea6){return db[_0x8d3d('0x2f')][_0x8d3d('0x45')]({'where':{'id':_0x47ce44['params']['id']}})[_0x8d3d('0x28')](handleEntityNotFound(_0xc22ea6,null))['then'](removeEntity(_0xc22ea6,null))[_0x8d3d('0x4f')](handleError(_0xc22ea6,null));};exports[_0x8d3d('0x52')]=function(_0x1efa75,_0x3a29c6){return db[_0x8d3d('0x2f')][_0x8d3d('0x52')]()[_0x8d3d('0x28')](respondWithResult(_0x3a29c6,null))[_0x8d3d('0x4f')](handleError(_0x3a29c6,null));};exports[_0x8d3d('0x53')]=function(_0x28aac0,_0x5e1351,_0x38be85){var _0x39643c={'raw':!![],'where':{}},_0x15c63e={},_0x4d9e7b;return db['OpenchannelQueue'][_0x8d3d('0x54')]({'where':{'id':_0x28aac0['params']['id']}})[_0x8d3d('0x28')](handleEntityNotFound(_0x5e1351,null))[_0x8d3d('0x28')](function(_0x3fef2b){if(_0x3fef2b){_0x4d9e7b=_0x3fef2b[_0x8d3d('0x4a')]({'plain':!![]});_0x15c63e[_0x8d3d('0x30')]=_[_0x8d3d('0x33')](db[_0x8d3d('0x55')][_0x8d3d('0x56')]);_0x15c63e[_0x8d3d('0x32')]=_[_0x8d3d('0x33')](_0x28aac0[_0x8d3d('0x32')]);_0x15c63e['filters']=_['intersection'](_0x15c63e['model'],_0x15c63e[_0x8d3d('0x32')]);_0x39643c[_0x8d3d('0x37')]=_[_0x8d3d('0x35')](_0x15c63e[_0x8d3d('0x30')],qs[_0x8d3d('0x36')](_0x28aac0['query']['fields']));_0x39643c['attributes']=_0x39643c[_0x8d3d('0x37')][_0x8d3d('0x38')]?_0x39643c[_0x8d3d('0x37')]:_0x15c63e['model'];if(!_0x28aac0[_0x8d3d('0x32')][_0x8d3d('0x39')](_0x8d3d('0x57'))){_0x39643c[_0x8d3d('0x20')]=qs[_0x8d3d('0x20')](_0x28aac0['query'][_0x8d3d('0x20')]);_0x39643c[_0x8d3d('0x1f')]=qs['offset'](_0x28aac0[_0x8d3d('0x32')][_0x8d3d('0x1f')]);}_0x39643c[_0x8d3d('0x3a')]=qs['sort'](_0x28aac0[_0x8d3d('0x32')][_0x8d3d('0x3b')]);_0x39643c[_0x8d3d('0x3c')]=qs['filters'](_['pick'](_0x28aac0[_0x8d3d('0x32')],_0x15c63e['filters']));_0x39643c['where'][_0x8d3d('0x58')]=_0x3fef2b['id'];if(_0x28aac0[_0x8d3d('0x32')]['filter']){_0x39643c[_0x8d3d('0x3c')]=_[_0x8d3d('0x59')](_0x39643c[_0x8d3d('0x3c')],{'$or':_[_0x8d3d('0x31')](_0x39643c[_0x8d3d('0x37')],function(_0x3d78aa){var _0x2a8b6f={};_0x2a8b6f[_0x3d78aa]={'$like':'%'+_0x28aac0[_0x8d3d('0x32')][_0x8d3d('0x3d')]+'%'};return _0x2a8b6f;})});}_0x39643c=_[_0x8d3d('0x59')]({},_0x39643c,_0x28aac0[_0x8d3d('0x44')]);return db['UserOpenchannelQueue'][_0x8d3d('0x5a')](_0x39643c);}})['then'](function(_0x4b91f7){if(_0x4b91f7){return db[_0x8d3d('0x5b')][_0x8d3d('0x5c')]({'where':{'id':_[_0x8d3d('0x31')](_0x4b91f7,_0x8d3d('0x5d')),'role':_0x8d3d('0x5e')},'attributes':['id',_0x8d3d('0x2c'),_0x8d3d('0x5f'),'updatedAt','createdAt']});}})['then'](function(_0x1a5e1b){if(_0x1a5e1b){return{'count':_0x1a5e1b['count'],'rows':_['map'](_0x1a5e1b[_0x8d3d('0x60')],function(_0x77a2bd){return{'membername':_0x77a2bd[_0x8d3d('0x2c')],'UserId':_0x77a2bd['id'],'queue_name':_0x4d9e7b[_0x8d3d('0x2c')],'OpenchannelQueueId':_0x4d9e7b['id'],'interface':util[_0x8d3d('0x61')](_0x8d3d('0x62'),_0x8d3d('0x63'),_0x77a2bd[_0x8d3d('0x2c')]),'penalty':0x0,'paused':_0x77a2bd[_0x8d3d('0x5f')],'createdAt':_0x77a2bd[_0x8d3d('0x64')],'updatedAt':_0x77a2bd['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8d3d('0x28')](respondWithFilteredResult(_0x5e1351,_0x39643c))[_0x8d3d('0x4f')](handleError(_0x5e1351,null));};exports[_0x8d3d('0x65')]=function(_0x3a712b,_0x32ab5c,_0x38c585){var _0x11a4e7={};var _0x5766fe={};var _0xf4bd65;var _0x23d4c7;return db[_0x8d3d('0x2f')]['findOne']({'where':{'id':_0x3a712b[_0x8d3d('0x43')]['id']}})['then'](handleEntityNotFound(_0x32ab5c,null))[_0x8d3d('0x28')](function(_0x410dd9){if(_0x410dd9){_0xf4bd65=_0x410dd9;_0x5766fe[_0x8d3d('0x30')]=_['keys'](db[_0x8d3d('0x66')][_0x8d3d('0x56')]);_0x5766fe['query']=_[_0x8d3d('0x33')](_0x3a712b['query']);_0x5766fe['filters']=_[_0x8d3d('0x35')](_0x5766fe[_0x8d3d('0x30')],_0x5766fe[_0x8d3d('0x32')]);_0x11a4e7['attributes']=_['intersection'](_0x5766fe[_0x8d3d('0x30')],qs[_0x8d3d('0x36')](_0x3a712b['query']['fields']));_0x11a4e7[_0x8d3d('0x37')]=_0x11a4e7[_0x8d3d('0x37')]['length']?_0x11a4e7[_0x8d3d('0x37')]:_0x5766fe[_0x8d3d('0x30')];_0x11a4e7['order']=qs['sort'](_0x3a712b[_0x8d3d('0x32')][_0x8d3d('0x3b')]);_0x11a4e7[_0x8d3d('0x3c')]=qs['filters'](_[_0x8d3d('0x67')](_0x3a712b[_0x8d3d('0x32')],_0x5766fe[_0x8d3d('0x34')]));if(_0x3a712b['query']['filter']){_0x11a4e7[_0x8d3d('0x3c')]=_[_0x8d3d('0x59')](_0x11a4e7[_0x8d3d('0x3c')],{'$or':_[_0x8d3d('0x31')](_0x11a4e7['attributes'],function(_0x46fe25){var _0x5c8a98={};_0x5c8a98[_0x46fe25]={'$like':'%'+_0x3a712b[_0x8d3d('0x32')][_0x8d3d('0x3d')]+'%'};return _0x5c8a98;})});}_0x11a4e7=_[_0x8d3d('0x59')]({},_0x11a4e7,_0x3a712b[_0x8d3d('0x44')]);return _0xf4bd65[_0x8d3d('0x65')](_0x11a4e7);}})['then'](function(_0x486dfd){if(_0x486dfd){_0x23d4c7=_0x486dfd[_0x8d3d('0x38')];if(!_0x3a712b[_0x8d3d('0x32')][_0x8d3d('0x39')](_0x8d3d('0x57'))){_0x11a4e7[_0x8d3d('0x20')]=qs[_0x8d3d('0x20')](_0x3a712b['query']['limit']);_0x11a4e7['offset']=qs[_0x8d3d('0x1f')](_0x3a712b[_0x8d3d('0x32')]['offset']);}return _0xf4bd65['getTeams'](_0x11a4e7);}})['then'](function(_0xb5ded4){if(_0xb5ded4){return _0xb5ded4?{'count':_0x23d4c7,'rows':_0xb5ded4}:null;}})[_0x8d3d('0x28')](respondWithResult(_0x32ab5c,null))[_0x8d3d('0x4f')](handleError(_0x32ab5c,null));};exports[_0x8d3d('0x68')]=function(_0x1f426c,_0x1e9dba,_0x388582){var _0x781359=_0x1f426c[_0x8d3d('0x51')]['ids'];return db[_0x8d3d('0x66')]['findAll']({'where':{'id':_0x781359},'attributes':['id'],'include':[{'model':db[_0x8d3d('0x5b')],'as':_0x8d3d('0x69'),'attributes':['id','name',_0x8d3d('0x6a'),_0x8d3d('0x6b'),_0x8d3d('0x6c')],'raw':!![]}]})[_0x8d3d('0x28')](function(_0x173038){if(_0x173038){var _0x38c6b3=_[_0x8d3d('0x6d')](_0x173038,function(_0x1fead1){var _0x5a6601=_0x1fead1[_0x8d3d('0x4a')]({'plain':!![]});return _0x5a6601[_0x8d3d('0x69')];});return db[_0x8d3d('0x2f')][_0x8d3d('0x45')]({'where':{'id':_0x1f426c[_0x8d3d('0x43')]['id']}})[_0x8d3d('0x28')](function(_0x107114){return db[_0x8d3d('0x6e')][_0x8d3d('0x6f')](function(_0x35f50b){return _0x107114[_0x8d3d('0x68')](_0x781359,{'transaction':_0x35f50b})[_0x8d3d('0x28')](function(){return BPromise['each'](_0x38c6b3,function(_0x55384c){return db[_0x8d3d('0x55')]['findOrCreate']({'where':{'UserId':_0x55384c['id'],'OpenchannelQueueId':_0x1f426c['params']['id']},'transaction':_0x35f50b});});})[_0x8d3d('0x28')](function(){_0x38c6b3[_0x8d3d('0x70')](function(_0x58ab1e){socket[_0x8d3d('0x71')](_0x8d3d('0x72'),{'UserId':_0x58ab1e['id'],'OpenchannelQueueId':_0x107114['id']});});});});});}})[_0x8d3d('0x28')](respondWithStatusCode(_0x1e9dba,null))[_0x8d3d('0x4f')](handleError(_0x1e9dba,null));};exports[_0x8d3d('0x73')]=function(_0x2aef99,_0xf75a23,_0xea1c1e){return db[_0x8d3d('0x66')][_0x8d3d('0x5a')]({'where':{'id':_0x2aef99[_0x8d3d('0x32')][_0x8d3d('0x74')]},'attributes':['id'],'include':[{'model':db[_0x8d3d('0x5b')],'as':_0x8d3d('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xf75a23,null))[_0x8d3d('0x28')](function(_0x2ca254){var _0x582df6=_[_0x8d3d('0x31')](_0x2ca254,'id');var _0x2e01fd=[];var _0x9d99e2=[];var _0x40f153=squel['select']();_0x40f153[_0x8d3d('0x75')](_0x8d3d('0x76'))[_0x8d3d('0x77')](_0x8d3d('0x78'),'tq')[_0x8d3d('0x79')](_0x8d3d('0x7a'),'ut',_0x8d3d('0x7b'))[_0x8d3d('0x3c')](_0x8d3d('0x7c'),_0x2aef99[_0x8d3d('0x43')]['id']);for(var _0x2d19e9=0x0;_0x2d19e9<_0x2ca254['length'];_0x2d19e9+=0x1){let _0x56f911=_0x2ca254[_0x2d19e9];for(var _0x36b048=0x0;_0x36b048<_0x56f911['Agents'][_0x8d3d('0x38')];_0x36b048+=0x1){let _0x275882=_0x56f911[_0x8d3d('0x69')][_0x36b048];var _0x29c803=_0x40f153[_0x8d3d('0x7d')]();_0x29c803[_0x8d3d('0x3c')](_0x8d3d('0x7e'),_0x275882['id']);_0x9d99e2['push'](db[_0x8d3d('0x6e')][_0x8d3d('0x32')](_0x29c803[_0x8d3d('0x7f')](),{'type':db[_0x8d3d('0x6e')]['QueryTypes'][_0x8d3d('0x80')]})[_0x8d3d('0x28')](function(_0x5c8345){if(_0x5c8345[_0x8d3d('0x38')]===0x1){return _0x275882['id'];}else{var _0x2dfa65=_[_0x8d3d('0x81')](_['map'](_0x5c8345,_0x8d3d('0x82')),function(_0x80f312){return _[_0x8d3d('0x83')](_0x582df6,_0x80f312);});if(_0x2dfa65){return _0x275882['id'];}}}));}}return BPromise[_0x8d3d('0x84')](_0x9d99e2)[_0x8d3d('0x28')](function(_0x15ac8f){_0x2e01fd=_(_0x2e01fd)[_0x8d3d('0x85')](_0x15ac8f)[_0x8d3d('0x86')]()[_0x8d3d('0x87')]();return db['OpenchannelQueue']['find']({'where':{'id':_0x2aef99['params']['id']}})[_0x8d3d('0x28')](function(_0x485d5d){return db[_0x8d3d('0x6e')][_0x8d3d('0x6f')](function(_0x51d46c){return _0x485d5d[_0x8d3d('0x73')](_0x2aef99[_0x8d3d('0x32')][_0x8d3d('0x74')],{'transaction':_0x51d46c})['then'](function(){if(!_[_0x8d3d('0x88')](_0x2e01fd)){return _0x485d5d['removeAgents'](_0x2e01fd,{'transaction':_0x51d46c});}})['then'](function(){_0x2e01fd['forEach'](function(_0x535ce7){socket[_0x8d3d('0x71')]('userOpenchannelQueue:remove',{'UserId':_0x535ce7,'OpenchannelQueueId':_0x485d5d['id']});});});});});});})[_0x8d3d('0x28')](respondWithStatusCode(_0xf75a23,null))[_0x8d3d('0x4f')](handleError(_0xf75a23,null));};exports['addAgents']=function(_0x2f38e7,_0xef499e,_0x496996){return db[_0x8d3d('0x2f')][_0x8d3d('0x45')]({'where':{'id':_0x2f38e7[_0x8d3d('0x43')]['id']}})[_0x8d3d('0x28')](handleEntityNotFound(_0xef499e,null))['then'](function(_0x4b60d5){if(_0x4b60d5){return _0x4b60d5[_0x8d3d('0x89')](_0x2f38e7[_0x8d3d('0x51')][_0x8d3d('0x74')],_[_0x8d3d('0x8a')](_0x2f38e7[_0x8d3d('0x51')],[_0x8d3d('0x74'),'id'])||{})['spread'](function(_0x391416){for(var _0xa3f008=0x0;_0xa3f008<_0x2f38e7[_0x8d3d('0x51')][_0x8d3d('0x74')][_0x8d3d('0x38')];_0xa3f008+=0x1){socket[_0x8d3d('0x71')]('userOpenchannelQueue:save',{'UserId':Number(_0x2f38e7[_0x8d3d('0x51')]['ids'][_0xa3f008]),'OpenchannelQueueId':Number(_0x2f38e7[_0x8d3d('0x43')]['id'])});}return _0x391416;});}})['then'](respondWithResult(_0xef499e,null))[_0x8d3d('0x4f')](handleError(_0xef499e,null));};exports[_0x8d3d('0x8b')]=function(_0x2e264a,_0x4db11f,_0x5ebdf4){return db[_0x8d3d('0x2f')][_0x8d3d('0x45')]({'where':{'id':_0x2e264a['params']['id']}})[_0x8d3d('0x28')](handleEntityNotFound(_0x4db11f,null))[_0x8d3d('0x28')](function(_0x531e69){if(_0x531e69){return _0x531e69[_0x8d3d('0x8b')](_0x2e264a[_0x8d3d('0x32')][_0x8d3d('0x74')])['then'](function(){if(_[_0x8d3d('0x8c')](_0x2e264a[_0x8d3d('0x32')][_0x8d3d('0x74')])){for(var _0x2e4fab=0x0;_0x2e4fab<_0x2e264a['query'][_0x8d3d('0x74')][_0x8d3d('0x38')];_0x2e4fab+=0x1){socket[_0x8d3d('0x71')](_0x8d3d('0x8d'),{'UserId':Number(_0x2e264a[_0x8d3d('0x32')][_0x8d3d('0x74')][_0x2e4fab]),'OpenchannelQueueId':Number(_0x2e264a[_0x8d3d('0x43')]['id'])});}}else{socket[_0x8d3d('0x71')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2e264a[_0x8d3d('0x32')][_0x8d3d('0x74')]),'OpenchannelQueueId':Number(_0x2e264a[_0x8d3d('0x43')]['id'])});}});}})['then'](respondWithStatusCode(_0x4db11f,null))['catch'](handleError(_0x4db11f,null));};exports[_0x8d3d('0x8e')]=function(_0x534868,_0x2f2cf0,_0x58cd18){var _0xed8ccb={};var _0x45cb43={};var _0x4a2a42;var _0xcaf71d;return db[_0x8d3d('0x2f')][_0x8d3d('0x54')]({'where':{'id':_0x534868[_0x8d3d('0x43')]['id']}})[_0x8d3d('0x28')](handleEntityNotFound(_0x2f2cf0,null))['then'](function(_0x5845d8){if(_0x5845d8){_0x4a2a42=_0x5845d8;_0x45cb43[_0x8d3d('0x30')]=_[_0x8d3d('0x33')](db[_0x8d3d('0x5b')][_0x8d3d('0x56')]);_0x45cb43[_0x8d3d('0x32')]=_['keys'](_0x534868[_0x8d3d('0x32')]);_0x45cb43['filters']=_[_0x8d3d('0x35')](_0x45cb43[_0x8d3d('0x30')],_0x45cb43['query']);_0xed8ccb[_0x8d3d('0x37')]=_[_0x8d3d('0x35')](_0x45cb43['model'],qs[_0x8d3d('0x36')](_0x534868[_0x8d3d('0x32')][_0x8d3d('0x36')]));_0xed8ccb[_0x8d3d('0x37')]=_0xed8ccb[_0x8d3d('0x37')][_0x8d3d('0x38')]?_0xed8ccb[_0x8d3d('0x37')]:_0x45cb43[_0x8d3d('0x30')];_0xed8ccb['order']=qs[_0x8d3d('0x3b')](_0x534868['query'][_0x8d3d('0x3b')]);_0xed8ccb[_0x8d3d('0x3c')]=qs[_0x8d3d('0x34')](_[_0x8d3d('0x67')](_0x534868[_0x8d3d('0x32')],_0x45cb43[_0x8d3d('0x34')]));if(_0x534868[_0x8d3d('0x32')]['filter']){_0xed8ccb['where']=_['merge'](_0xed8ccb[_0x8d3d('0x3c')],{'$or':_[_0x8d3d('0x31')](_0xed8ccb[_0x8d3d('0x37')],function(_0x460e64){var _0x46187a={};_0x46187a[_0x460e64]={'$like':'%'+_0x534868[_0x8d3d('0x32')][_0x8d3d('0x3d')]+'%'};return _0x46187a;})});}_0xed8ccb=_['merge']({},_0xed8ccb,_0x534868[_0x8d3d('0x44')]);return _0x4a2a42[_0x8d3d('0x8e')](_0xed8ccb);}})[_0x8d3d('0x28')](function(_0x413bf4){if(_0x413bf4){_0xcaf71d=_0x413bf4[_0x8d3d('0x38')];if(!_0x534868[_0x8d3d('0x32')][_0x8d3d('0x39')](_0x8d3d('0x57'))){_0xed8ccb[_0x8d3d('0x20')]=qs[_0x8d3d('0x20')](_0x534868['query']['limit']);_0xed8ccb['offset']=qs['offset'](_0x534868[_0x8d3d('0x32')][_0x8d3d('0x1f')]);}return _0x4a2a42[_0x8d3d('0x8e')](_0xed8ccb);}})[_0x8d3d('0x28')](function(_0x1cb549){if(_0x1cb549){return _0x1cb549?{'count':_0xcaf71d,'rows':_0x1cb549}:null;}})[_0x8d3d('0x28')](respondWithResult(_0x2f2cf0,null))[_0x8d3d('0x4f')](handleError(_0x2f2cf0,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 215d263..993c6fb 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 _0xd7df=['hasOwnProperty','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit'];(function(_0x54d1c5,_0x1b70e8){var _0x163fe0=function(_0x389f38){while(--_0x389f38){_0x54d1c5['push'](_0x54d1c5['shift']());}};_0x163fe0(++_0x1b70e8);}(_0xd7df,0xe8));var _0xfd7d=function(_0xbe9e6e,_0xa63b3e){_0xbe9e6e=_0xbe9e6e-0x0;var _0x4dd80e=_0xd7df[_0xbe9e6e];return _0x4dd80e;};'use strict';var EventEmitter=require(_0xfd7d('0x0'));var OpenchannelQueue=require(_0xfd7d('0x1'))['db'][_0xfd7d('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xfd7d('0x3')](0x0);var events={'afterCreate':_0xfd7d('0x4'),'afterUpdate':_0xfd7d('0x5'),'afterDestroy':_0xfd7d('0x6')};function emitEvent(_0x505f64){return function(_0x4b39e4,_0x230454,_0x538583){OpenchannelQueueEvents[_0xfd7d('0x7')](_0x505f64+':'+_0x4b39e4['id'],_0x4b39e4);OpenchannelQueueEvents[_0xfd7d('0x7')](_0x505f64,_0x4b39e4);_0x538583(null);};}for(var e in events){if(events[_0xfd7d('0x8')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0xfd7d('0x9')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x15cb=['emit','hasOwnProperty','exports','../../mysqldb','update','remove'];(function(_0x34128e,_0x4124ea){var _0x186f86=function(_0x2846ff){while(--_0x2846ff){_0x34128e['push'](_0x34128e['shift']());}};_0x186f86(++_0x4124ea);}(_0x15cb,0x147));var _0xb15c=function(_0x4bbcd7,_0x400f15){_0x4bbcd7=_0x4bbcd7-0x0;var _0x56e720=_0x15cb[_0x4bbcd7];return _0x56e720;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xb15c('0x0'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb15c('0x1'),'afterDestroy':_0xb15c('0x2')};function emitEvent(_0x286b19){return function(_0x562f78,_0x21c637,_0x7a308b){OpenchannelQueueEvents[_0xb15c('0x3')](_0x286b19+':'+_0x562f78['id'],_0x562f78);OpenchannelQueueEvents[_0xb15c('0x3')](_0x286b19,_0x562f78);_0x7a308b(null);};}for(var e in events){if(events[_0xb15c('0x4')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0xb15c('0x5')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index e2bae32..53f0603 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 _0x75aa=['api','moment','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','util'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x75aa,0xa7));var _0xa75a=function(_0x27c52f,_0x5089ae){_0x27c52f=_0x27c52f-0x0;var _0xf0b1c5=_0x75aa[_0x27c52f];return _0xf0b1c5;};'use strict';var _=require('lodash');var util=require(_0xa75a('0x0'));var logger=require('../../config/logger')(_0xa75a('0x1'));var moment=require(_0xa75a('0x2'));var BPromise=require('bluebird');var rp=require(_0xa75a('0x3'));var fs=require('fs');var path=require(_0xa75a('0x4'));var rimraf=require(_0xa75a('0x5'));var config=require(_0xa75a('0x6'));var attributes=require(_0xa75a('0x7'));module[_0xa75a('0x8')]=function(_0x8ab9c7,_0x235228){return _0x8ab9c7[_0xa75a('0x9')](_0xa75a('0xa'),attributes,{'tableName':_0xa75a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8571=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelQueue','lodash'];(function(_0x206ad4,_0x15e511){var _0x1a4b91=function(_0x31fd78){while(--_0x31fd78){_0x206ad4['push'](_0x206ad4['shift']());}};_0x1a4b91(++_0x15e511);}(_0x8571,0x149));var _0x1857=function(_0x4c8891,_0x51fe93){_0x4c8891=_0x4c8891-0x0;var _0x171fca=_0x8571[_0x4c8891];return _0x171fca;};'use strict';var _=require(_0x1857('0x0'));var util=require(_0x1857('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1857('0x2'));var BPromise=require(_0x1857('0x3'));var rp=require(_0x1857('0x4'));var fs=require('fs');var path=require(_0x1857('0x5'));var rimraf=require(_0x1857('0x6'));var config=require(_0x1857('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0x1857('0x8')]=function(_0x3ee6bf,_0x4c875f){return _0x3ee6bf[_0x1857('0x9')](_0x1857('0xa'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 71cf090..2a1eccb 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 _0xc6f9=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelQueue','findAll','options','raw','attributes','limit','include','map','model','GetOpenchannelQueue','ShowOpenchannelQueue','find','where','lodash'];(function(_0x11092f,_0x22a7c6){var _0x2f68ac=function(_0x573538){while(--_0x573538){_0x11092f['push'](_0x11092f['shift']());}};_0x2f68ac(++_0x22a7c6);}(_0xc6f9,0xdb));var _0x9c6f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc6f9[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x9c6f('0x0'));var util=require(_0x9c6f('0x1'));var moment=require(_0x9c6f('0x2'));var BPromise=require(_0x9c6f('0x3'));var rs=require(_0x9c6f('0x4'));var fs=require('fs');var Redis=require(_0x9c6f('0x5'));var db=require(_0x9c6f('0x6'))['db'];var utils=require(_0x9c6f('0x7'));var logger=require('../../config/logger')(_0x9c6f('0x8'));var config=require(_0x9c6f('0x9'));var jayson=require(_0x9c6f('0xa'));var client=jayson[_0x9c6f('0xb')]['http']({'port':0x232a});config['redis']=_[_0x9c6f('0xc')](config[_0x9c6f('0xd')],{'host':_0x9c6f('0xe'),'port':0x18eb});var socket=require(_0x9c6f('0xf'))(new Redis(config[_0x9c6f('0xd')]));require(_0x9c6f('0x10'))[_0x9c6f('0x11')](socket);function respondWithRpcPromise(_0x2000b5,_0x552a6a,_0x5bfccb){return new BPromise(function(_0x1b7ca1,_0x5e43f2){return client[_0x9c6f('0x12')](_0x2000b5,_0x5bfccb)[_0x9c6f('0x13')](function(_0xb342ff){logger[_0x9c6f('0x14')](_0x9c6f('0x15'),_0x552a6a,_0x9c6f('0x16'));logger[_0x9c6f('0x17')](_0x9c6f('0x18'),_0x552a6a,_0x9c6f('0x16'),JSON[_0x9c6f('0x19')](_0xb342ff));if(_0xb342ff[_0x9c6f('0x1a')]){if(_0xb342ff[_0x9c6f('0x1a')][_0x9c6f('0x1b')]===0x1f4){logger[_0x9c6f('0x1a')](_0x9c6f('0x15'),_0x552a6a,_0xb342ff[_0x9c6f('0x1a')][_0x9c6f('0x1c')]);return _0x5e43f2(_0xb342ff[_0x9c6f('0x1a')]['message']);}logger[_0x9c6f('0x1a')]('OpenchannelQueue,\x20%s,\x20%s',_0x552a6a,_0xb342ff[_0x9c6f('0x1a')][_0x9c6f('0x1c')]);return _0x1b7ca1(_0xb342ff['error']['message']);}else{logger[_0x9c6f('0x14')](_0x9c6f('0x15'),_0x552a6a,'request\x20sent');_0x1b7ca1(_0xb342ff[_0x9c6f('0x1d')][_0x9c6f('0x1c')]);}})[_0x9c6f('0x1e')](function(_0x577e7a){logger['error'](_0x9c6f('0x15'),_0x552a6a,_0x577e7a);_0x5e43f2(_0x577e7a);});});}exports['GetOpenchannelQueue']=function(_0x3977f6){var _0x21ca43=this;return new Promise(function(_0x1faeb9,_0x192b90){return db[_0x9c6f('0x1f')][_0x9c6f('0x20')]({'raw':_0x3977f6['options']?_0x3977f6[_0x9c6f('0x21')][_0x9c6f('0x22')]===undefined?!![]:![]:!![],'where':_0x3977f6['options']?_0x3977f6[_0x9c6f('0x21')]['where']||null:null,'attributes':_0x3977f6[_0x9c6f('0x21')]?_0x3977f6[_0x9c6f('0x21')][_0x9c6f('0x23')]||null:null,'limit':_0x3977f6[_0x9c6f('0x21')]?_0x3977f6[_0x9c6f('0x21')][_0x9c6f('0x24')]||null:null,'include':_0x3977f6[_0x9c6f('0x21')]?_0x3977f6['options'][_0x9c6f('0x25')]?_[_0x9c6f('0x26')](_0x3977f6[_0x9c6f('0x21')][_0x9c6f('0x25')],function(_0x2ffc95){return{'model':db[_0x2ffc95[_0x9c6f('0x27')]],'as':_0x2ffc95['as'],'attributes':_0x2ffc95[_0x9c6f('0x23')],'include':_0x2ffc95[_0x9c6f('0x25')]?_[_0x9c6f('0x26')](_0x2ffc95[_0x9c6f('0x25')],function(_0x4276c){return{'model':db[_0x4276c[_0x9c6f('0x27')]],'as':_0x4276c['as'],'attributes':_0x4276c[_0x9c6f('0x23')],'include':_0x4276c[_0x9c6f('0x25')]?_[_0x9c6f('0x26')](_0x4276c['include'],function(_0x3cdb26){return{'model':db[_0x3cdb26[_0x9c6f('0x27')]],'as':_0x3cdb26['as'],'attributes':_0x3cdb26['attributes']};}):[]};}):[]};}):[]:[]})[_0x9c6f('0x13')](function(_0x5db1f6){logger[_0x9c6f('0x14')](_0x9c6f('0x28'),_0x3977f6);logger['debug'](_0x9c6f('0x28'),_0x3977f6,JSON['stringify'](_0x5db1f6));_0x1faeb9(_0x5db1f6);})[_0x9c6f('0x1e')](function(_0x260cb8){logger[_0x9c6f('0x1a')](_0x9c6f('0x28'),_0x260cb8[_0x9c6f('0x1c')],_0x3977f6);_0x192b90(_0x21ca43[_0x9c6f('0x1a')](0x1f4,_0x260cb8['message']));});});};exports[_0x9c6f('0x29')]=function(_0x59fb12){var _0x1580ca=this;return new Promise(function(_0x457d4c,_0x47f53e){return db[_0x9c6f('0x1f')][_0x9c6f('0x2a')]({'raw':_0x59fb12['options']?_0x59fb12['options'][_0x9c6f('0x22')]===undefined?!![]:![]:!![],'where':_0x59fb12['options']?_0x59fb12[_0x9c6f('0x21')][_0x9c6f('0x2b')]||null:null,'attributes':_0x59fb12[_0x9c6f('0x21')]?_0x59fb12[_0x9c6f('0x21')]['attributes']||null:null,'include':_0x59fb12['options']?_0x59fb12[_0x9c6f('0x21')][_0x9c6f('0x25')]?_[_0x9c6f('0x26')](_0x59fb12[_0x9c6f('0x21')][_0x9c6f('0x25')],function(_0x5c08fe){return{'model':db[_0x5c08fe['model']],'as':_0x5c08fe['as'],'attributes':_0x5c08fe[_0x9c6f('0x23')],'include':_0x5c08fe[_0x9c6f('0x25')]?_[_0x9c6f('0x26')](_0x5c08fe[_0x9c6f('0x25')],function(_0x49d9b2){return{'model':db[_0x49d9b2[_0x9c6f('0x27')]],'as':_0x49d9b2['as'],'attributes':_0x49d9b2[_0x9c6f('0x23')],'include':_0x49d9b2[_0x9c6f('0x25')]?_[_0x9c6f('0x26')](_0x49d9b2[_0x9c6f('0x25')],function(_0xd8ef7e){return{'model':db[_0xd8ef7e['model']],'as':_0xd8ef7e['as'],'attributes':_0xd8ef7e[_0x9c6f('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e82a1){logger[_0x9c6f('0x14')](_0x9c6f('0x29'),_0x59fb12);logger[_0x9c6f('0x17')]('ShowOpenchannelQueue',_0x59fb12,JSON['stringify'](_0x3e82a1));_0x457d4c(_0x3e82a1);})[_0x9c6f('0x1e')](function(_0x5c5a47){logger[_0x9c6f('0x1a')](_0x9c6f('0x29'),_0x5c5a47[_0x9c6f('0x1c')],_0x59fb12);_0x47f53e(_0x1580ca[_0x9c6f('0x1a')](0x1f4,_0x5c5a47['message']));});});}; \ No newline at end of file +var _0x5bcb=['GetOpenchannelQueue','findAll','options','raw','where','limit','include','map','attributes','model','then','debug','catch','ShowOpenchannelQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','request','info','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueue,\x20%s,\x20%s','message'];(function(_0x1809a8,_0x279c18){var _0x5af15e=function(_0x564b3a){while(--_0x564b3a){_0x1809a8['push'](_0x1809a8['shift']());}};_0x5af15e(++_0x279c18);}(_0x5bcb,0x1e2));var _0xb5bc=function(_0x1d650e,_0x48edb5){_0x1d650e=_0x1d650e-0x0;var _0x33ca61=_0x5bcb[_0x1d650e];return _0x33ca61;};'use strict';var _=require('lodash');var util=require(_0xb5bc('0x0'));var moment=require(_0xb5bc('0x1'));var BPromise=require(_0xb5bc('0x2'));var rs=require(_0xb5bc('0x3'));var fs=require('fs');var Redis=require(_0xb5bc('0x4'));var db=require(_0xb5bc('0x5'))['db'];var utils=require(_0xb5bc('0x6'));var logger=require(_0xb5bc('0x7'))(_0xb5bc('0x8'));var config=require(_0xb5bc('0x9'));var jayson=require(_0xb5bc('0xa'));var client=jayson[_0xb5bc('0xb')]['http']({'port':0x232a});config[_0xb5bc('0xc')]=_[_0xb5bc('0xd')](config[_0xb5bc('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xb5bc('0xe'))(new Redis(config[_0xb5bc('0xc')]));require(_0xb5bc('0xf'))[_0xb5bc('0x10')](socket);function respondWithRpcPromise(_0x5f3679,_0xd8a463,_0x32f989){return new BPromise(function(_0x1172b9,_0xb012f1){return client[_0xb5bc('0x11')](_0x5f3679,_0x32f989)['then'](function(_0x31ed7e){logger[_0xb5bc('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0xd8a463,_0xb5bc('0x13'));logger['debug'](_0xb5bc('0x14'),_0xd8a463,_0xb5bc('0x13'),JSON[_0xb5bc('0x15')](_0x31ed7e));if(_0x31ed7e[_0xb5bc('0x16')]){if(_0x31ed7e[_0xb5bc('0x16')]['code']===0x1f4){logger['error'](_0xb5bc('0x17'),_0xd8a463,_0x31ed7e[_0xb5bc('0x16')][_0xb5bc('0x18')]);return _0xb012f1(_0x31ed7e[_0xb5bc('0x16')][_0xb5bc('0x18')]);}logger[_0xb5bc('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0xd8a463,_0x31ed7e[_0xb5bc('0x16')][_0xb5bc('0x18')]);return _0x1172b9(_0x31ed7e['error'][_0xb5bc('0x18')]);}else{logger[_0xb5bc('0x12')](_0xb5bc('0x17'),_0xd8a463,_0xb5bc('0x13'));_0x1172b9(_0x31ed7e['result'][_0xb5bc('0x18')]);}})['catch'](function(_0x496ea5){logger[_0xb5bc('0x16')](_0xb5bc('0x17'),_0xd8a463,_0x496ea5);_0xb012f1(_0x496ea5);});});}exports[_0xb5bc('0x19')]=function(_0x2d3ef5){var _0x2cf7ee=this;return new Promise(function(_0x9d399e,_0x3f09ef){return db['OpenchannelQueue'][_0xb5bc('0x1a')]({'raw':_0x2d3ef5[_0xb5bc('0x1b')]?_0x2d3ef5[_0xb5bc('0x1b')][_0xb5bc('0x1c')]===undefined?!![]:![]:!![],'where':_0x2d3ef5[_0xb5bc('0x1b')]?_0x2d3ef5['options'][_0xb5bc('0x1d')]||null:null,'attributes':_0x2d3ef5[_0xb5bc('0x1b')]?_0x2d3ef5['options']['attributes']||null:null,'limit':_0x2d3ef5['options']?_0x2d3ef5[_0xb5bc('0x1b')][_0xb5bc('0x1e')]||null:null,'include':_0x2d3ef5[_0xb5bc('0x1b')]?_0x2d3ef5['options'][_0xb5bc('0x1f')]?_[_0xb5bc('0x20')](_0x2d3ef5[_0xb5bc('0x1b')][_0xb5bc('0x1f')],function(_0x55eff3){return{'model':db[_0x55eff3['model']],'as':_0x55eff3['as'],'attributes':_0x55eff3[_0xb5bc('0x21')],'include':_0x55eff3[_0xb5bc('0x1f')]?_['map'](_0x55eff3['include'],function(_0x53a01e){return{'model':db[_0x53a01e[_0xb5bc('0x22')]],'as':_0x53a01e['as'],'attributes':_0x53a01e[_0xb5bc('0x21')],'include':_0x53a01e['include']?_[_0xb5bc('0x20')](_0x53a01e[_0xb5bc('0x1f')],function(_0x563de0){return{'model':db[_0x563de0[_0xb5bc('0x22')]],'as':_0x563de0['as'],'attributes':_0x563de0['attributes']};}):[]};}):[]};}):[]:[]})[_0xb5bc('0x23')](function(_0x380085){logger[_0xb5bc('0x12')](_0xb5bc('0x19'),_0x2d3ef5);logger[_0xb5bc('0x24')](_0xb5bc('0x19'),_0x2d3ef5,JSON[_0xb5bc('0x15')](_0x380085));_0x9d399e(_0x380085);})[_0xb5bc('0x25')](function(_0x5c4845){logger['error'](_0xb5bc('0x19'),_0x5c4845['message'],_0x2d3ef5);_0x3f09ef(_0x2cf7ee[_0xb5bc('0x16')](0x1f4,_0x5c4845[_0xb5bc('0x18')]));});});};exports[_0xb5bc('0x26')]=function(_0xc8f6e3){var _0x266448=this;return new Promise(function(_0x54027a,_0x338028){return db['OpenchannelQueue']['find']({'raw':_0xc8f6e3[_0xb5bc('0x1b')]?_0xc8f6e3['options'][_0xb5bc('0x1c')]===undefined?!![]:![]:!![],'where':_0xc8f6e3[_0xb5bc('0x1b')]?_0xc8f6e3[_0xb5bc('0x1b')]['where']||null:null,'attributes':_0xc8f6e3[_0xb5bc('0x1b')]?_0xc8f6e3[_0xb5bc('0x1b')][_0xb5bc('0x21')]||null:null,'include':_0xc8f6e3[_0xb5bc('0x1b')]?_0xc8f6e3[_0xb5bc('0x1b')][_0xb5bc('0x1f')]?_[_0xb5bc('0x20')](_0xc8f6e3[_0xb5bc('0x1b')][_0xb5bc('0x1f')],function(_0x141c2d){return{'model':db[_0x141c2d[_0xb5bc('0x22')]],'as':_0x141c2d['as'],'attributes':_0x141c2d[_0xb5bc('0x21')],'include':_0x141c2d['include']?_[_0xb5bc('0x20')](_0x141c2d[_0xb5bc('0x1f')],function(_0x4e4d10){return{'model':db[_0x4e4d10[_0xb5bc('0x22')]],'as':_0x4e4d10['as'],'attributes':_0x4e4d10['attributes'],'include':_0x4e4d10['include']?_[_0xb5bc('0x20')](_0x4e4d10[_0xb5bc('0x1f')],function(_0x3d64f3){return{'model':db[_0x3d64f3['model']],'as':_0x3d64f3['as'],'attributes':_0x3d64f3['attributes']};}):[]};}):[]};}):[]:[]})[_0xb5bc('0x23')](function(_0x5d4b1d){logger[_0xb5bc('0x12')](_0xb5bc('0x26'),_0xc8f6e3);logger[_0xb5bc('0x24')](_0xb5bc('0x26'),_0xc8f6e3,JSON[_0xb5bc('0x15')](_0x5d4b1d));_0x54027a(_0x5d4b1d);})[_0xb5bc('0x25')](function(_0x571cce){logger[_0xb5bc('0x16')](_0xb5bc('0x26'),_0x571cce[_0xb5bc('0x18')],_0xc8f6e3);_0x338028(_0x266448[_0xb5bc('0x16')](0x1f4,_0x571cce[_0xb5bc('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index dfc12b5..f801690 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 _0x4b69=['openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener'];(function(_0x3e0803,_0x50d954){var _0xdaefbf=function(_0x16398c){while(--_0x16398c){_0x3e0803['push'](_0x3e0803['shift']());}};_0xdaefbf(++_0x50d954);}(_0x4b69,0x8d));var _0x94b6=function(_0x3efe9b,_0x5b41a8){_0x3efe9b=_0x3efe9b-0x0;var _0x132073=_0x4b69[_0x3efe9b];return _0x132073;};'use strict';var OpenchannelQueueEvents=require(_0x94b6('0x0'));var events=[_0x94b6('0x1'),_0x94b6('0x2'),_0x94b6('0x3')];function createListener(_0x2ced62,_0x1123bc){return function(_0x379b48){_0x1123bc[_0x94b6('0x4')](_0x2ced62,_0x379b48);};}function removeListener(_0x5e415c,_0x4d0c19){return function(){OpenchannelQueueEvents[_0x94b6('0x5')](_0x5e415c,_0x4d0c19);};}exports['register']=function(_0x1443fe){for(var _0x2178e9=0x0,_0x25a61b=events['length'];_0x2178e9<_0x25a61b;_0x2178e9++){var _0x4ee6ff=events[_0x2178e9];var _0x4b74c4=createListener(_0x94b6('0x6')+_0x4ee6ff,_0x1443fe);OpenchannelQueueEvents['on'](_0x4ee6ff,_0x4b74c4);}}; \ No newline at end of file +var _0x8b0e=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8b0e,0xe4));var _0xe8b0=function(_0x37ded3,_0x371ebb){_0x37ded3=_0x37ded3-0x0;var _0x51e49e=_0x8b0e[_0x37ded3];return _0x51e49e;};'use strict';var OpenchannelQueueEvents=require(_0xe8b0('0x0'));var events=[_0xe8b0('0x1'),_0xe8b0('0x2'),_0xe8b0('0x3')];function createListener(_0xa2c6ac,_0x3fc385){return function(_0x11103f){_0x3fc385[_0xe8b0('0x4')](_0xa2c6ac,_0x11103f);};}function removeListener(_0x32b943,_0x3740a1){return function(){OpenchannelQueueEvents[_0xe8b0('0x5')](_0x32b943,_0x3740a1);};}exports[_0xe8b0('0x6')]=function(_0x3b7e0e){for(var _0x274135=0x0,_0x18a475=events[_0xe8b0('0x7')];_0x274135<_0x18a475;_0x274135++){var _0x1f1934=events[_0x274135];var _0x4f5130=createListener(_0xe8b0('0x8')+_0x1f1934,_0x3b7e0e);OpenchannelQueueEvents['on'](_0x1f1934,_0x4f5130);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index daea769..03b6455 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 _0x0276=['create','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x378f75,_0x13a8ed){var _0x90addc=function(_0x3f4849){while(--_0x3f4849){_0x378f75['push'](_0x378f75['shift']());}};_0x90addc(++_0x13a8ed);}(_0x0276,0x180));var _0x6027=function(_0x364a36,_0x1e2677){_0x364a36=_0x364a36-0x0;var _0x5cd6fa=_0x0276[_0x364a36];return _0x5cd6fa;};'use strict';var multer=require(_0x6027('0x0'));var util=require('util');var path=require(_0x6027('0x1'));var timeout=require(_0x6027('0x2'));var express=require(_0x6027('0x3'));var router=express[_0x6027('0x4')]();var fs_extra=require(_0x6027('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6027('0x6'));var config=require('../../config/environment');var controller=require(_0x6027('0x7'));router[_0x6027('0x8')]('/',auth[_0x6027('0x9')](),controller[_0x6027('0xa')]);router['get'](_0x6027('0xb'),auth['isAuthenticated'](),controller[_0x6027('0xc')]);router[_0x6027('0x8')](_0x6027('0xd'),auth[_0x6027('0x9')](),controller[_0x6027('0xe')]);router['post']('/',auth[_0x6027('0x9')](),controller[_0x6027('0xf')]);router[_0x6027('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6027('0x11')]);router['delete'](_0x6027('0xd'),auth[_0x6027('0x9')](),controller['destroy']);module[_0x6027('0x12')]=router; \ No newline at end of file +var _0x5377=['create','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','isAuthenticated','index','get','describe','/:id','show','post'];(function(_0x1a1943,_0x4fe116){var _0x29bf7d=function(_0xdf831b){while(--_0xdf831b){_0x1a1943['push'](_0x1a1943['shift']());}};_0x29bf7d(++_0x4fe116);}(_0x5377,0xd5));var _0x7537=function(_0x56382b,_0x446555){_0x56382b=_0x56382b-0x0;var _0x2dded7=_0x5377[_0x56382b];return _0x2dded7;};'use strict';var multer=require(_0x7537('0x0'));var util=require(_0x7537('0x1'));var path=require('path');var timeout=require(_0x7537('0x2'));var express=require('express');var router=express[_0x7537('0x3')]();var fs_extra=require(_0x7537('0x4'));var auth=require(_0x7537('0x5'));var interaction=require(_0x7537('0x6'));var config=require('../../config/environment');var controller=require(_0x7537('0x7'));router['get']('/',auth[_0x7537('0x8')](),controller[_0x7537('0x9')]);router[_0x7537('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x7537('0xb')]);router[_0x7537('0xa')](_0x7537('0xc'),auth[_0x7537('0x8')](),controller[_0x7537('0xd')]);router[_0x7537('0xe')]('/',auth['isAuthenticated'](),controller[_0x7537('0xf')]);router['put'](_0x7537('0xc'),auth[_0x7537('0x8')](),controller[_0x7537('0x10')]);router[_0x7537('0x11')](_0x7537('0xc'),auth[_0x7537('0x8')](),controller['destroy']);module[_0x7537('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 9c7948b..707f4e0 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 _0x1ac2=['exports','STRING','DATE','moment','sequelize'];(function(_0x5d409d,_0x43b3df){var _0x2b00c6=function(_0x446f63){while(--_0x446f63){_0x5d409d['push'](_0x5d409d['shift']());}};_0x2b00c6(++_0x43b3df);}(_0x1ac2,0xfd));var _0x21ac=function(_0x5f3094,_0x33af18){_0x5f3094=_0x5f3094-0x0;var _0x2b452d=_0x1ac2[_0x5f3094];return _0x2b452d;};'use strict';var moment=require(_0x21ac('0x0'));var Sequelize=require(_0x21ac('0x1'));module[_0x21ac('0x2')]={'uniqueid':{'type':Sequelize[_0x21ac('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x21ac('0x3')]},'joinAt':{'type':Sequelize[_0x21ac('0x4')]},'leaveAt':{'type':Sequelize[_0x21ac('0x4')]},'acceptAt':{'type':Sequelize[_0x21ac('0x4')]},'exitAt':{'type':Sequelize[_0x21ac('0x4')]},'reason':{'type':Sequelize[_0x21ac('0x3')]}}; \ No newline at end of file +var _0xdd50=['STRING','DATE','sequelize','exports'];(function(_0x2f8177,_0x1bb2a9){var _0x249cb4=function(_0x22929f){while(--_0x22929f){_0x2f8177['push'](_0x2f8177['shift']());}};_0x249cb4(++_0x1bb2a9);}(_0xdd50,0x172));var _0x0dd5=function(_0x3cec45,_0x37d817){_0x3cec45=_0x3cec45-0x0;var _0x51d691=_0xdd50[_0x3cec45];return _0x51d691;};'use strict';var moment=require('moment');var Sequelize=require(_0x0dd5('0x0'));module[_0x0dd5('0x1')]={'uniqueid':{'type':Sequelize[_0x0dd5('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0dd5('0x2')]},'joinAt':{'type':Sequelize[_0x0dd5('0x3')]},'leaveAt':{'type':Sequelize[_0x0dd5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 9f34f22..09daad1 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 _0x5b8b=['filters','intersection','attributes','fields','length','query','nolimit','order','sort','where','pick','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','name','send','index','OpenchannelQueueReport','fieldName','type','key','model','map','keys'];(function(_0x303852,_0x23fdd2){var _0x36407c=function(_0xaea12f){while(--_0xaea12f){_0x303852['push'](_0x303852['shift']());}};_0x36407c(++_0x23fdd2);}(_0x5b8b,0x103));var _0xb5b8=function(_0x505d61,_0x1c5049){_0x505d61=_0x505d61-0x0;var _0x3077d0=_0x5b8b[_0x505d61];return _0x3077d0;};'use strict';var emlformat=require(_0xb5b8('0x0'));var rimraf=require(_0xb5b8('0x1'));var zipdir=require(_0xb5b8('0x2'));var jsonpatch=require(_0xb5b8('0x3'));var rp=require(_0xb5b8('0x4'));var moment=require(_0xb5b8('0x5'));var BPromise=require(_0xb5b8('0x6'));var Mustache=require('mustache');var util=require(_0xb5b8('0x7'));var path=require(_0xb5b8('0x8'));var sox=require(_0xb5b8('0x9'));var csv=require(_0xb5b8('0xa'));var ejs=require(_0xb5b8('0xb'));var fs=require('fs');var fs_extra=require(_0xb5b8('0xc'));var _=require(_0xb5b8('0xd'));var squel=require(_0xb5b8('0xe'));var crypto=require(_0xb5b8('0xf'));var jsforce=require(_0xb5b8('0x10'));var deskjs=require(_0xb5b8('0x11'));var toCsv=require(_0xb5b8('0xa'));var querystring=require(_0xb5b8('0x12'));var Papa=require(_0xb5b8('0x13'));var Redis=require(_0xb5b8('0x14'));var authService=require(_0xb5b8('0x15'));var qs=require(_0xb5b8('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb5b8('0x17'));var logger=require(_0xb5b8('0x18'))(_0xb5b8('0x19'));var utils=require('../../config/utils');var config=require(_0xb5b8('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27f95c,_0x584b04){_0x584b04=_0x584b04||0xcc;return function(_0x1997b6){if(_0x1997b6){return _0x27f95c[_0xb5b8('0x1b')](_0x584b04);}return _0x27f95c['status'](_0x584b04)['end']();};}function respondWithResult(_0x487494,_0x2394e0){_0x2394e0=_0x2394e0||0xc8;return function(_0x4f9c41){if(_0x4f9c41){return _0x487494[_0xb5b8('0x1c')](_0x2394e0)['json'](_0x4f9c41);}};}function respondWithFilteredResult(_0x3a6f77,_0x105a38){return function(_0x29db89){if(_0x29db89){var _0x2e4a69=typeof _0x105a38[_0xb5b8('0x1d')]===_0xb5b8('0x1e')&&typeof _0x105a38[_0xb5b8('0x1f')]===_0xb5b8('0x1e');var _0x17fde5=_0x29db89[_0xb5b8('0x20')];var _0x53dadc=_0x2e4a69?0x0:_0x105a38[_0xb5b8('0x1d')];var _0x1038ed=_0x2e4a69?_0x29db89['count']:_0x105a38[_0xb5b8('0x1d')]+_0x105a38[_0xb5b8('0x1f')];var _0x480633;if(_0x1038ed>=_0x17fde5){_0x1038ed=_0x17fde5;_0x480633=0xc8;}else{_0x480633=0xce;}_0x3a6f77[_0xb5b8('0x1c')](_0x480633);return _0x3a6f77[_0xb5b8('0x21')](_0xb5b8('0x22'),_0x53dadc+'-'+_0x1038ed+'/'+_0x17fde5)[_0xb5b8('0x23')](_0x29db89);}return null;};}function patchUpdates(_0x8626e7){return function(_0x72c4ff){try{jsonpatch[_0xb5b8('0x24')](_0x72c4ff,_0x8626e7,!![]);}catch(_0x2541d9){return BPromise[_0xb5b8('0x25')](_0x2541d9);}return _0x72c4ff[_0xb5b8('0x26')]();};}function saveUpdates(_0x18a66c,_0x41b120){return function(_0x177433){if(_0x177433){return _0x177433[_0xb5b8('0x27')](_0x18a66c)['then'](function(_0x80b52a){return _0x80b52a;});}return null;};}function removeEntity(_0x40e1d1,_0x312ee5){return function(_0x321ee0){if(_0x321ee0){return _0x321ee0[_0xb5b8('0x28')]()[_0xb5b8('0x29')](function(){_0x40e1d1[_0xb5b8('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bbde0,_0x376f34){return function(_0x2dbfef){if(!_0x2dbfef){_0x2bbde0['sendStatus'](0x194);}return _0x2dbfef;};}function handleError(_0x177797,_0x32a828){_0x32a828=_0x32a828||0x1f4;return function(_0xa11975){logger[_0xb5b8('0x2a')](_0xa11975['stack']);if(_0xa11975[_0xb5b8('0x2b')]){delete _0xa11975[_0xb5b8('0x2b')];}_0x177797[_0xb5b8('0x1c')](_0x32a828)[_0xb5b8('0x2c')](_0xa11975);};}exports[_0xb5b8('0x2d')]=function(_0x3abae9,_0x2dfd17){var _0x440d86={},_0x4d96cf={},_0x2dcc7b={'count':0x0,'rows':[]};var _0x1347d2=_['map'](db[_0xb5b8('0x2e')]['rawAttributes'],function(_0x34f614){return{'name':_0x34f614[_0xb5b8('0x2f')],'type':_0x34f614[_0xb5b8('0x30')][_0xb5b8('0x31')]};});_0x4d96cf[_0xb5b8('0x32')]=_[_0xb5b8('0x33')](_0x1347d2,'name');_0x4d96cf['query']=_[_0xb5b8('0x34')](_0x3abae9['query']);_0x4d96cf[_0xb5b8('0x35')]=_[_0xb5b8('0x36')](_0x4d96cf[_0xb5b8('0x32')],_0x4d96cf['query']);_0x440d86[_0xb5b8('0x37')]=_[_0xb5b8('0x36')](_0x4d96cf[_0xb5b8('0x32')],qs[_0xb5b8('0x38')](_0x3abae9['query'][_0xb5b8('0x38')]));_0x440d86['attributes']=_0x440d86[_0xb5b8('0x37')][_0xb5b8('0x39')]?_0x440d86['attributes']:_0x4d96cf['model'];if(!_0x3abae9[_0xb5b8('0x3a')]['hasOwnProperty'](_0xb5b8('0x3b'))){_0x440d86[_0xb5b8('0x1f')]=qs[_0xb5b8('0x1f')](_0x3abae9[_0xb5b8('0x3a')]['limit']);_0x440d86[_0xb5b8('0x1d')]=qs[_0xb5b8('0x1d')](_0x3abae9[_0xb5b8('0x3a')][_0xb5b8('0x1d')]);}_0x440d86[_0xb5b8('0x3c')]=qs['sort'](_0x3abae9[_0xb5b8('0x3a')][_0xb5b8('0x3d')]);_0x440d86[_0xb5b8('0x3e')]=qs[_0xb5b8('0x35')](_[_0xb5b8('0x3f')](_0x3abae9[_0xb5b8('0x3a')],_0x4d96cf[_0xb5b8('0x35')]),_0x1347d2);if(_0x3abae9[_0xb5b8('0x3a')][_0xb5b8('0x40')]){_0x440d86[_0xb5b8('0x3e')]=_['merge'](_0x440d86[_0xb5b8('0x3e')],{'$or':_[_0xb5b8('0x33')](_0x1347d2,function(_0x1f12b2){if(_0x1f12b2['type']!=='VIRTUAL'){var _0x271f57={};_0x271f57[_0x1f12b2[_0xb5b8('0x2b')]]={'$like':'%'+_0x3abae9[_0xb5b8('0x3a')][_0xb5b8('0x40')]+'%'};return _0x271f57;}})});}_0x440d86=_['merge']({},_0x440d86,_0x3abae9['options']);var _0x41ff77={'where':_0x440d86[_0xb5b8('0x3e')]};return db[_0xb5b8('0x2e')][_0xb5b8('0x20')](_0x41ff77)['then'](function(_0x5acd96){_0x2dcc7b[_0xb5b8('0x20')]=_0x5acd96;if(_0x3abae9[_0xb5b8('0x3a')][_0xb5b8('0x41')]){_0x440d86[_0xb5b8('0x42')]=[{'all':!![]}];}return db[_0xb5b8('0x2e')][_0xb5b8('0x43')](_0x440d86);})['then'](function(_0x5e1532){_0x2dcc7b[_0xb5b8('0x44')]=_0x5e1532;return _0x2dcc7b;})[_0xb5b8('0x29')](respondWithFilteredResult(_0x2dfd17,_0x440d86))[_0xb5b8('0x45')](handleError(_0x2dfd17,null));};exports[_0xb5b8('0x46')]=function(_0x50efb0,_0x2d234b){var _0xc43c27={'raw':!![],'where':{'id':_0x50efb0[_0xb5b8('0x47')]['id']}},_0x3965a5={};_0x3965a5[_0xb5b8('0x32')]=_[_0xb5b8('0x34')](db[_0xb5b8('0x2e')][_0xb5b8('0x48')]);_0x3965a5['query']=_[_0xb5b8('0x34')](_0x50efb0['query']);_0x3965a5[_0xb5b8('0x35')]=_['intersection'](_0x3965a5[_0xb5b8('0x32')],_0x3965a5[_0xb5b8('0x3a')]);_0xc43c27[_0xb5b8('0x37')]=_[_0xb5b8('0x36')](_0x3965a5['model'],qs['fields'](_0x50efb0[_0xb5b8('0x3a')][_0xb5b8('0x38')]));_0xc43c27[_0xb5b8('0x37')]=_0xc43c27[_0xb5b8('0x37')][_0xb5b8('0x39')]?_0xc43c27['attributes']:_0x3965a5[_0xb5b8('0x32')];if(_0x50efb0[_0xb5b8('0x3a')]['includeAll']){_0xc43c27[_0xb5b8('0x42')]=[{'all':!![]}];}_0xc43c27=_['merge']({},_0xc43c27,_0x50efb0[_0xb5b8('0x49')]);return db[_0xb5b8('0x2e')]['find'](_0xc43c27)[_0xb5b8('0x29')](handleEntityNotFound(_0x2d234b,null))[_0xb5b8('0x29')](respondWithResult(_0x2d234b,null))[_0xb5b8('0x45')](handleError(_0x2d234b,null));};exports[_0xb5b8('0x4a')]=function(_0x4ad1f5,_0x2cc56){return db[_0xb5b8('0x2e')][_0xb5b8('0x4a')](_0x4ad1f5[_0xb5b8('0x4b')],{})[_0xb5b8('0x29')](respondWithResult(_0x2cc56,0xc9))[_0xb5b8('0x45')](handleError(_0x2cc56,null));};exports['update']=function(_0x4b8464,_0x40cf92){if(_0x4b8464[_0xb5b8('0x4b')]['id']){delete _0x4b8464[_0xb5b8('0x4b')]['id'];}return db[_0xb5b8('0x2e')][_0xb5b8('0x4c')]({'where':{'id':_0x4b8464[_0xb5b8('0x47')]['id']}})['then'](handleEntityNotFound(_0x40cf92,null))[_0xb5b8('0x29')](saveUpdates(_0x4b8464[_0xb5b8('0x4b')],null))['then'](respondWithResult(_0x40cf92,null))[_0xb5b8('0x45')](handleError(_0x40cf92,null));};exports[_0xb5b8('0x28')]=function(_0xa2a369,_0x314a1f){return db[_0xb5b8('0x2e')]['find']({'where':{'id':_0xa2a369[_0xb5b8('0x47')]['id']}})['then'](handleEntityNotFound(_0x314a1f,null))[_0xb5b8('0x29')](removeEntity(_0x314a1f,null))[_0xb5b8('0x45')](handleError(_0x314a1f,null));};exports[_0xb5b8('0x4d')]=function(_0xb86b50,_0xc2422f){return db['OpenchannelQueueReport']['describe']()[_0xb5b8('0x29')](respondWithResult(_0xc2422f,null))[_0xb5b8('0x45')](handleError(_0xc2422f,null));}; \ No newline at end of file +var _0x1cab=['set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','OpenchannelQueueReport','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','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/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit'];(function(_0xb6e257,_0x445cd7){var _0x33b778=function(_0x28ba38){while(--_0x28ba38){_0xb6e257['push'](_0xb6e257['shift']());}};_0x33b778(++_0x445cd7);}(_0x1cab,0x1ab));var _0xb1ca=function(_0x127f93,_0x1e1587){_0x127f93=_0x127f93-0x0;var _0x168a0a=_0x1cab[_0x127f93];return _0x168a0a;};'use strict';var emlformat=require(_0xb1ca('0x0'));var rimraf=require(_0xb1ca('0x1'));var zipdir=require(_0xb1ca('0x2'));var jsonpatch=require(_0xb1ca('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb1ca('0x4'));var Mustache=require(_0xb1ca('0x5'));var util=require(_0xb1ca('0x6'));var path=require(_0xb1ca('0x7'));var sox=require(_0xb1ca('0x8'));var csv=require('to-csv');var ejs=require(_0xb1ca('0x9'));var fs=require('fs');var fs_extra=require(_0xb1ca('0xa'));var _=require(_0xb1ca('0xb'));var squel=require(_0xb1ca('0xc'));var crypto=require(_0xb1ca('0xd'));var jsforce=require(_0xb1ca('0xe'));var deskjs=require(_0xb1ca('0xf'));var toCsv=require(_0xb1ca('0x10'));var querystring=require(_0xb1ca('0x11'));var Papa=require(_0xb1ca('0x12'));var Redis=require(_0xb1ca('0x13'));var authService=require(_0xb1ca('0x14'));var qs=require(_0xb1ca('0x15'));var as=require(_0xb1ca('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb1ca('0x17'))(_0xb1ca('0x18'));var utils=require(_0xb1ca('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb1ca('0x1a'))['db'];function respondWithStatusCode(_0x5cfa05,_0x3cca53){_0x3cca53=_0x3cca53||0xcc;return function(_0x2be26b){if(_0x2be26b){return _0x5cfa05[_0xb1ca('0x1b')](_0x3cca53);}return _0x5cfa05['status'](_0x3cca53)[_0xb1ca('0x1c')]();};}function respondWithResult(_0x26e902,_0x11f950){_0x11f950=_0x11f950||0xc8;return function(_0xc2793d){if(_0xc2793d){return _0x26e902[_0xb1ca('0x1d')](_0x11f950)[_0xb1ca('0x1e')](_0xc2793d);}};}function respondWithFilteredResult(_0x311849,_0x12e4e9){return function(_0x4a7371){if(_0x4a7371){var _0x3a0b4d=typeof _0x12e4e9[_0xb1ca('0x1f')]===_0xb1ca('0x20')&&typeof _0x12e4e9['limit']==='undefined';var _0x3f5758=_0x4a7371[_0xb1ca('0x21')];var _0x155169=_0x3a0b4d?0x0:_0x12e4e9[_0xb1ca('0x1f')];var _0x442eab=_0x3a0b4d?_0x4a7371[_0xb1ca('0x21')]:_0x12e4e9[_0xb1ca('0x1f')]+_0x12e4e9[_0xb1ca('0x22')];var _0x474194;if(_0x442eab>=_0x3f5758){_0x442eab=_0x3f5758;_0x474194=0xc8;}else{_0x474194=0xce;}_0x311849['status'](_0x474194);return _0x311849[_0xb1ca('0x23')](_0xb1ca('0x24'),_0x155169+'-'+_0x442eab+'/'+_0x3f5758)[_0xb1ca('0x1e')](_0x4a7371);}return null;};}function patchUpdates(_0x12ab19){return function(_0x2b5db4){try{jsonpatch[_0xb1ca('0x25')](_0x2b5db4,_0x12ab19,!![]);}catch(_0x2b7bdd){return BPromise[_0xb1ca('0x26')](_0x2b7bdd);}return _0x2b5db4['save']();};}function saveUpdates(_0x3d230b,_0x34056c){return function(_0x4e3ced){if(_0x4e3ced){return _0x4e3ced[_0xb1ca('0x27')](_0x3d230b)[_0xb1ca('0x28')](function(_0x2d1d92){return _0x2d1d92;});}return null;};}function removeEntity(_0x24801a,_0x50d313){return function(_0x154048){if(_0x154048){return _0x154048[_0xb1ca('0x29')]()[_0xb1ca('0x28')](function(){_0x24801a['status'](0xcc)[_0xb1ca('0x1c')]();});}};}function handleEntityNotFound(_0x535a4b,_0x37711d){return function(_0x296008){if(!_0x296008){_0x535a4b[_0xb1ca('0x1b')](0x194);}return _0x296008;};}function handleError(_0x2319da,_0x563c96){_0x563c96=_0x563c96||0x1f4;return function(_0x5a4046){logger[_0xb1ca('0x2a')](_0x5a4046[_0xb1ca('0x2b')]);if(_0x5a4046[_0xb1ca('0x2c')]){delete _0x5a4046[_0xb1ca('0x2c')];}_0x2319da[_0xb1ca('0x1d')](_0x563c96)[_0xb1ca('0x2d')](_0x5a4046);};}exports[_0xb1ca('0x2e')]=function(_0x53557d,_0x5b93ec){var _0x440732={},_0x21cb72={},_0x49c121={'count':0x0,'rows':[]};var _0x57abaf=_[_0xb1ca('0x2f')](db[_0xb1ca('0x30')]['rawAttributes'],function(_0x40fb7b){return{'name':_0x40fb7b[_0xb1ca('0x31')],'type':_0x40fb7b[_0xb1ca('0x32')][_0xb1ca('0x33')]};});_0x21cb72['model']=_[_0xb1ca('0x2f')](_0x57abaf,_0xb1ca('0x2c'));_0x21cb72['query']=_[_0xb1ca('0x34')](_0x53557d[_0xb1ca('0x35')]);_0x21cb72[_0xb1ca('0x36')]=_[_0xb1ca('0x37')](_0x21cb72['model'],_0x21cb72[_0xb1ca('0x35')]);_0x440732['attributes']=_['intersection'](_0x21cb72[_0xb1ca('0x38')],qs[_0xb1ca('0x39')](_0x53557d[_0xb1ca('0x35')][_0xb1ca('0x39')]));_0x440732[_0xb1ca('0x3a')]=_0x440732['attributes'][_0xb1ca('0x3b')]?_0x440732[_0xb1ca('0x3a')]:_0x21cb72[_0xb1ca('0x38')];if(!_0x53557d[_0xb1ca('0x35')][_0xb1ca('0x3c')]('nolimit')){_0x440732[_0xb1ca('0x22')]=qs['limit'](_0x53557d[_0xb1ca('0x35')][_0xb1ca('0x22')]);_0x440732[_0xb1ca('0x1f')]=qs['offset'](_0x53557d[_0xb1ca('0x35')][_0xb1ca('0x1f')]);}_0x440732[_0xb1ca('0x3d')]=qs[_0xb1ca('0x3e')](_0x53557d[_0xb1ca('0x35')][_0xb1ca('0x3e')]);_0x440732[_0xb1ca('0x3f')]=qs[_0xb1ca('0x36')](_[_0xb1ca('0x40')](_0x53557d[_0xb1ca('0x35')],_0x21cb72['filters']),_0x57abaf);if(_0x53557d['query'][_0xb1ca('0x41')]){_0x440732[_0xb1ca('0x3f')]=_[_0xb1ca('0x42')](_0x440732[_0xb1ca('0x3f')],{'$or':_[_0xb1ca('0x2f')](_0x57abaf,function(_0x208d17){if(_0x208d17[_0xb1ca('0x32')]!=='VIRTUAL'){var _0x50dc74={};_0x50dc74[_0x208d17[_0xb1ca('0x2c')]]={'$like':'%'+_0x53557d[_0xb1ca('0x35')][_0xb1ca('0x41')]+'%'};return _0x50dc74;}})});}_0x440732=_['merge']({},_0x440732,_0x53557d['options']);var _0x341ae2={'where':_0x440732[_0xb1ca('0x3f')]};return db[_0xb1ca('0x30')][_0xb1ca('0x21')](_0x341ae2)['then'](function(_0x358b19){_0x49c121[_0xb1ca('0x21')]=_0x358b19;if(_0x53557d['query'][_0xb1ca('0x43')]){_0x440732[_0xb1ca('0x44')]=[{'all':!![]}];}return db[_0xb1ca('0x30')]['findAll'](_0x440732);})[_0xb1ca('0x28')](function(_0x24db4b){_0x49c121[_0xb1ca('0x45')]=_0x24db4b;return _0x49c121;})['then'](respondWithFilteredResult(_0x5b93ec,_0x440732))[_0xb1ca('0x46')](handleError(_0x5b93ec,null));};exports['show']=function(_0x28f60f,_0x30b054){var _0x15b8f0={'raw':!![],'where':{'id':_0x28f60f[_0xb1ca('0x47')]['id']}},_0x3e2bbb={};_0x3e2bbb[_0xb1ca('0x38')]=_[_0xb1ca('0x34')](db['OpenchannelQueueReport'][_0xb1ca('0x48')]);_0x3e2bbb[_0xb1ca('0x35')]=_[_0xb1ca('0x34')](_0x28f60f['query']);_0x3e2bbb['filters']=_['intersection'](_0x3e2bbb[_0xb1ca('0x38')],_0x3e2bbb[_0xb1ca('0x35')]);_0x15b8f0[_0xb1ca('0x3a')]=_[_0xb1ca('0x37')](_0x3e2bbb[_0xb1ca('0x38')],qs[_0xb1ca('0x39')](_0x28f60f['query'][_0xb1ca('0x39')]));_0x15b8f0['attributes']=_0x15b8f0[_0xb1ca('0x3a')][_0xb1ca('0x3b')]?_0x15b8f0[_0xb1ca('0x3a')]:_0x3e2bbb[_0xb1ca('0x38')];if(_0x28f60f[_0xb1ca('0x35')][_0xb1ca('0x43')]){_0x15b8f0['include']=[{'all':!![]}];}_0x15b8f0=_['merge']({},_0x15b8f0,_0x28f60f['options']);return db[_0xb1ca('0x30')][_0xb1ca('0x49')](_0x15b8f0)[_0xb1ca('0x28')](handleEntityNotFound(_0x30b054,null))[_0xb1ca('0x28')](respondWithResult(_0x30b054,null))['catch'](handleError(_0x30b054,null));};exports['create']=function(_0x5a81e8,_0x3a8d5d){return db[_0xb1ca('0x30')][_0xb1ca('0x4a')](_0x5a81e8['body'],{})['then'](respondWithResult(_0x3a8d5d,0xc9))['catch'](handleError(_0x3a8d5d,null));};exports[_0xb1ca('0x27')]=function(_0x2d43d7,_0x29a04a){if(_0x2d43d7[_0xb1ca('0x4b')]['id']){delete _0x2d43d7['body']['id'];}return db[_0xb1ca('0x30')][_0xb1ca('0x49')]({'where':{'id':_0x2d43d7[_0xb1ca('0x47')]['id']}})[_0xb1ca('0x28')](handleEntityNotFound(_0x29a04a,null))[_0xb1ca('0x28')](saveUpdates(_0x2d43d7[_0xb1ca('0x4b')],null))[_0xb1ca('0x28')](respondWithResult(_0x29a04a,null))['catch'](handleError(_0x29a04a,null));};exports[_0xb1ca('0x29')]=function(_0x4c4adc,_0x513dd3){return db[_0xb1ca('0x30')][_0xb1ca('0x49')]({'where':{'id':_0x4c4adc['params']['id']}})[_0xb1ca('0x28')](handleEntityNotFound(_0x513dd3,null))[_0xb1ca('0x28')](removeEntity(_0x513dd3,null))[_0xb1ca('0x46')](handleError(_0x513dd3,null));};exports[_0xb1ca('0x4c')]=function(_0x3f1c92,_0xbe3f91){return db['OpenchannelQueueReport'][_0xb1ca('0x4c')]()['then'](respondWithResult(_0xbe3f91,null))[_0xb1ca('0x46')](handleError(_0xbe3f91,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 5dd5d21..f7d9ed4 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(_0x326a44,_0x41c393){var _0x218e10=function(_0x4ef0a6){while(--_0x4ef0a6){_0x326a44['push'](_0x326a44['shift']());}};_0x218e10(++_0x41c393);}(_0x5fc3,0xa8));var _0x35fc=function(_0x28f1de,_0x355054){_0x28f1de=_0x28f1de-0x0;var _0x5b5dad=_0x5fc3[_0x28f1de];return _0x5b5dad;};'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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x814b,0x1a2));var _0xb814=function(_0x5cc3d4,_0xbcbf9b){_0x5cc3d4=_0x5cc3d4-0x0;var _0x17ca31=_0x814b[_0x5cc3d4];return _0x17ca31;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 970f429..1339786 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 _0x1bc6=['catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','stringify','UpdateOpenchannelQueueReport','update','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','message','OpenchannelQueueReport,\x20%s,\x20%s','result'];(function(_0xdd05c0,_0x5c311d){var _0x330fbe=function(_0x18d5bc){while(--_0x18d5bc){_0xdd05c0['push'](_0xdd05c0['shift']());}};_0x330fbe(++_0x5c311d);}(_0x1bc6,0x94));var _0x61bc=function(_0x35e154,_0xec6c4){_0x35e154=_0x35e154-0x0;var _0x3a4e5e=_0x1bc6[_0x35e154];return _0x3a4e5e;};'use strict';var _=require(_0x61bc('0x0'));var util=require(_0x61bc('0x1'));var moment=require(_0x61bc('0x2'));var BPromise=require(_0x61bc('0x3'));var rs=require(_0x61bc('0x4'));var fs=require('fs');var Redis=require(_0x61bc('0x5'));var db=require(_0x61bc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x61bc('0x7'))(_0x61bc('0x8'));var config=require(_0x61bc('0x9'));var jayson=require(_0x61bc('0xa'));var client=jayson[_0x61bc('0xb')][_0x61bc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x410656,_0x1b29e3,_0x151ef4){return new BPromise(function(_0x5ebb87,_0x339305){return client['request'](_0x410656,_0x151ef4)[_0x61bc('0xd')](function(_0x502dc0){logger[_0x61bc('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1b29e3,_0x61bc('0xf'));logger[_0x61bc('0x10')](_0x61bc('0x11'),_0x1b29e3,'request\x20sent',JSON['stringify'](_0x502dc0));if(_0x502dc0['error']){if(_0x502dc0['error']['code']===0x1f4){logger[_0x61bc('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1b29e3,_0x502dc0[_0x61bc('0x12')][_0x61bc('0x13')]);return _0x339305(_0x502dc0['error']['message']);}logger['error'](_0x61bc('0x14'),_0x1b29e3,_0x502dc0[_0x61bc('0x12')]['message']);return _0x5ebb87(_0x502dc0[_0x61bc('0x12')][_0x61bc('0x13')]);}else{logger[_0x61bc('0xe')](_0x61bc('0x14'),_0x1b29e3,_0x61bc('0xf'));_0x5ebb87(_0x502dc0[_0x61bc('0x15')]['message']);}})[_0x61bc('0x16')](function(_0x21b974){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x1b29e3,_0x21b974);_0x339305(_0x21b974);});});}exports[_0x61bc('0x17')]=function(_0x2a6f35){var _0x96cd3=this;return new Promise(function(_0x4ca1c3,_0x457702){return db[_0x61bc('0x18')][_0x61bc('0x19')](_0x2a6f35[_0x61bc('0x1a')],{'raw':_0x2a6f35['options']?_0x2a6f35[_0x61bc('0x1b')][_0x61bc('0x1c')]===undefined?!![]:![]:!![]})[_0x61bc('0xd')](function(_0x144b07){logger['info'](_0x61bc('0x17'),_0x2a6f35);logger[_0x61bc('0x10')](_0x61bc('0x17'),_0x2a6f35,JSON[_0x61bc('0x1d')](_0x144b07));_0x4ca1c3(_0x144b07);})[_0x61bc('0x16')](function(_0x141db2){logger[_0x61bc('0x12')]('CreateOpenchannelQueueReport',_0x141db2[_0x61bc('0x13')],_0x2a6f35);_0x457702(_0x96cd3[_0x61bc('0x12')](0x1f4,_0x141db2[_0x61bc('0x13')]));});});};exports[_0x61bc('0x1e')]=function(_0x270f1c){var _0x567632=this;return new Promise(function(_0xc25ed5,_0x40cb55){return db[_0x61bc('0x18')][_0x61bc('0x1f')](_0x270f1c[_0x61bc('0x1a')],{'raw':_0x270f1c['options']?_0x270f1c['options'][_0x61bc('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x270f1c['options']?_0x270f1c[_0x61bc('0x1b')][_0x61bc('0x20')]||null:null,'attributes':_0x270f1c[_0x61bc('0x1b')]?_0x270f1c[_0x61bc('0x1b')]['attributes']||null:null,'limit':_0x270f1c[_0x61bc('0x1b')]?_0x270f1c[_0x61bc('0x1b')][_0x61bc('0x21')]||null:null})[_0x61bc('0xd')](function(_0x364600){logger[_0x61bc('0xe')](_0x61bc('0x1e'),_0x270f1c);logger[_0x61bc('0x10')](_0x61bc('0x1e'),_0x270f1c,JSON[_0x61bc('0x1d')](_0x364600));_0xc25ed5(_0x364600);})['catch'](function(_0x173e7b){logger[_0x61bc('0x12')](_0x61bc('0x1e'),_0x173e7b[_0x61bc('0x13')],_0x270f1c);_0x40cb55(_0x567632[_0x61bc('0x12')](0x1f4,_0x173e7b[_0x61bc('0x13')]));});});}; \ No newline at end of file +var _0x896e=['message','info','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x896e,0x1e9));var _0xe896=function(_0x3cf987,_0x16d86f){_0x3cf987=_0x3cf987-0x0;var _0xffd94=_0x896e[_0x3cf987];return _0xffd94;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});}exports[_0xe896('0x18')]=function(_0x32f86d){var _0x2d4cf0=this;return new Promise(function(_0x5dc89d,_0x782813){return db[_0xe896('0x19')][_0xe896('0x1a')](_0x32f86d[_0xe896('0x1b')],{'raw':_0x32f86d[_0xe896('0x1c')]?_0x32f86d[_0xe896('0x1c')][_0xe896('0x1d')]===undefined?!![]:![]:!![]})[_0xe896('0xe')](function(_0x49547b){logger[_0xe896('0x16')]('CreateOpenchannelQueueReport',_0x32f86d);logger['debug'](_0xe896('0x18'),_0x32f86d,JSON[_0xe896('0x12')](_0x49547b));_0x5dc89d(_0x49547b);})[_0xe896('0x17')](function(_0xeeec7c){logger['error'](_0xe896('0x18'),_0xeeec7c['message'],_0x32f86d);_0x782813(_0x2d4cf0['error'](0x1f4,_0xeeec7c[_0xe896('0x15')]));});});};exports[_0xe896('0x1e')]=function(_0x1e952a){var _0x2e2c10=this;return new Promise(function(_0x20e295,_0x4d9f03){return db[_0xe896('0x19')]['update'](_0x1e952a[_0xe896('0x1b')],{'raw':_0x1e952a[_0xe896('0x1c')]?_0x1e952a[_0xe896('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e952a[_0xe896('0x1c')]?_0x1e952a[_0xe896('0x1c')][_0xe896('0x1f')]||null:null,'attributes':_0x1e952a[_0xe896('0x1c')]?_0x1e952a[_0xe896('0x1c')][_0xe896('0x20')]||null:null,'limit':_0x1e952a['options']?_0x1e952a[_0xe896('0x1c')][_0xe896('0x21')]||null:null})[_0xe896('0xe')](function(_0xbfb15b){logger[_0xe896('0x16')]('UpdateOpenchannelQueueReport',_0x1e952a);logger['debug']('UpdateOpenchannelQueueReport',_0x1e952a,JSON['stringify'](_0xbfb15b));_0x20e295(_0xbfb15b);})['catch'](function(_0x291290){logger[_0xe896('0x13')](_0xe896('0x1e'),_0x291290[_0xe896('0x15')],_0x1e952a);_0x4d9f03(_0x2e2c10[_0xe896('0x13')](0x1f4,_0x291290[_0xe896('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index e1ad594..8280fd1 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 _0xe1b2=['../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x242246,_0x5eb9c9){var _0x132aad=function(_0x3363bc){while(--_0x3363bc){_0x242246['push'](_0x242246['shift']());}};_0x132aad(++_0x5eb9c9);}(_0xe1b2,0xff));var _0x2e1b=function(_0x39428c,_0xa3b261){_0x39428c=_0x39428c-0x0;var _0x3a3c9a=_0xe1b2[_0x39428c];return _0x3a3c9a;};'use strict';var multer=require('multer');var util=require(_0x2e1b('0x0'));var path=require('path');var timeout=require(_0x2e1b('0x1'));var express=require(_0x2e1b('0x2'));var router=express[_0x2e1b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2e1b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2e1b('0x5'));var controller=require(_0x2e1b('0x6'));router[_0x2e1b('0x7')]('/',auth[_0x2e1b('0x8')](),controller[_0x2e1b('0x9')]);router['get'](_0x2e1b('0xa'),auth[_0x2e1b('0x8')](),controller[_0x2e1b('0xb')]);router['get'](_0x2e1b('0xc'),auth[_0x2e1b('0x8')](),controller['show']);router[_0x2e1b('0xd')]('/',auth['isAuthenticated'](),controller[_0x2e1b('0xe')]);router[_0x2e1b('0xf')](_0x2e1b('0xc'),auth[_0x2e1b('0x8')](),controller[_0x2e1b('0x10')]);router[_0x2e1b('0x11')]('/:id',auth[_0x2e1b('0x8')](),controller[_0x2e1b('0x12')]);module[_0x2e1b('0x13')]=router; \ No newline at end of file +var _0x7fa7=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x2ab365,_0xa3812e){var _0x49fef3=function(_0x29b883){while(--_0x29b883){_0x2ab365['push'](_0x2ab365['shift']());}};_0x49fef3(++_0xa3812e);}(_0x7fa7,0x1d5));var _0x77fa=function(_0x1963b4,_0x2edc44){_0x1963b4=_0x1963b4-0x0;var _0x1e1e33=_0x7fa7[_0x1963b4];return _0x1e1e33;};'use strict';var multer=require(_0x77fa('0x0'));var util=require(_0x77fa('0x1'));var path=require(_0x77fa('0x2'));var timeout=require(_0x77fa('0x3'));var express=require(_0x77fa('0x4'));var router=express['Router']();var fs_extra=require(_0x77fa('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x77fa('0x6'));var config=require(_0x77fa('0x7'));var controller=require(_0x77fa('0x8'));router['get']('/',auth[_0x77fa('0x9')](),controller['index']);router[_0x77fa('0xa')](_0x77fa('0xb'),auth[_0x77fa('0x9')](),controller[_0x77fa('0xc')]);router[_0x77fa('0xa')](_0x77fa('0xd'),auth[_0x77fa('0x9')](),controller[_0x77fa('0xe')]);router[_0x77fa('0xf')]('/',auth[_0x77fa('0x9')](),controller[_0x77fa('0x10')]);router[_0x77fa('0x11')](_0x77fa('0xd'),auth['isAuthenticated'](),controller[_0x77fa('0x12')]);router[_0x77fa('0x13')](_0x77fa('0xd'),auth[_0x77fa('0x9')](),controller[_0x77fa('0x14')]);module[_0x77fa('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 3bb540f..9a095fd 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(_0x5139bb,_0x3fb5f4){var _0x306e2a=function(_0x3b6036){while(--_0x3b6036){_0x5139bb['push'](_0x5139bb['shift']());}};_0x306e2a(++_0x3fb5f4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x6e7474,_0x4c6139){var _0x1c25b8=function(_0x2d66c7){while(--_0x2d66c7){_0x6e7474['push'](_0x6e7474['shift']());}};_0x1c25b8(++_0x4c6139);}(_0x00bb,0x1d8));var _0xb00b=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x00bb[_0x29b609];return _0x54c952;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index d38791b..1e86b7e 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 _0xbc8f=['update','then','destroy','error','send','index','map','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','OpenchannelTransferReport','findAll','rows','catch','params','rawAttributes','length','include','find','create','body','describe','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply'];(function(_0x12818d,_0x2791b2){var _0xeb43ae=function(_0x2e1db1){while(--_0x2e1db1){_0x12818d['push'](_0x12818d['shift']());}};_0xeb43ae(++_0x2791b2);}(_0xbc8f,0x146));var _0xfbc8=function(_0x591cfb,_0x859699){_0x591cfb=_0x591cfb-0x0;var _0x33bb55=_0xbc8f[_0x591cfb];return _0x33bb55;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfbc8('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfbc8('0x1'));var Mustache=require('mustache');var util=require(_0xfbc8('0x2'));var path=require(_0xfbc8('0x3'));var sox=require(_0xfbc8('0x4'));var csv=require(_0xfbc8('0x5'));var ejs=require(_0xfbc8('0x6'));var fs=require('fs');var fs_extra=require(_0xfbc8('0x7'));var _=require(_0xfbc8('0x8'));var squel=require(_0xfbc8('0x9'));var crypto=require('crypto');var jsforce=require(_0xfbc8('0xa'));var deskjs=require(_0xfbc8('0xb'));var toCsv=require(_0xfbc8('0x5'));var querystring=require(_0xfbc8('0xc'));var Papa=require(_0xfbc8('0xd'));var Redis=require(_0xfbc8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xfbc8('0xf'));var as=require(_0xfbc8('0x10'));var hardwareService=require(_0xfbc8('0x11'));var logger=require(_0xfbc8('0x12'))(_0xfbc8('0x13'));var utils=require(_0xfbc8('0x14'));var config=require(_0xfbc8('0x15'));var licenseUtil=require(_0xfbc8('0x16'));var db=require(_0xfbc8('0x17'))['db'];function respondWithStatusCode(_0x465dfd,_0x5aaebf){_0x5aaebf=_0x5aaebf||0xcc;return function(_0x5985b8){if(_0x5985b8){return _0x465dfd['sendStatus'](_0x5aaebf);}return _0x465dfd[_0xfbc8('0x18')](_0x5aaebf)[_0xfbc8('0x19')]();};}function respondWithResult(_0x474b2f,_0x4700ec){_0x4700ec=_0x4700ec||0xc8;return function(_0x30dc55){if(_0x30dc55){return _0x474b2f[_0xfbc8('0x18')](_0x4700ec)['json'](_0x30dc55);}};}function respondWithFilteredResult(_0x2ffb14,_0x3b59a6){return function(_0x561377){if(_0x561377){var _0x54a652=typeof _0x3b59a6[_0xfbc8('0x1a')]===_0xfbc8('0x1b')&&typeof _0x3b59a6[_0xfbc8('0x1c')]===_0xfbc8('0x1b');var _0x24992a=_0x561377[_0xfbc8('0x1d')];var _0x53238e=_0x54a652?0x0:_0x3b59a6['offset'];var _0x16779b=_0x54a652?_0x561377[_0xfbc8('0x1d')]:_0x3b59a6['offset']+_0x3b59a6[_0xfbc8('0x1c')];var _0x75330b;if(_0x16779b>=_0x24992a){_0x16779b=_0x24992a;_0x75330b=0xc8;}else{_0x75330b=0xce;}_0x2ffb14['status'](_0x75330b);return _0x2ffb14[_0xfbc8('0x1e')](_0xfbc8('0x1f'),_0x53238e+'-'+_0x16779b+'/'+_0x24992a)[_0xfbc8('0x20')](_0x561377);}return null;};}function patchUpdates(_0x5a2f6d){return function(_0x17d1a0){try{jsonpatch[_0xfbc8('0x21')](_0x17d1a0,_0x5a2f6d,!![]);}catch(_0x249e39){return BPromise['reject'](_0x249e39);}return _0x17d1a0['save']();};}function saveUpdates(_0x1948cf,_0x3df9ee){return function(_0x9137b0){if(_0x9137b0){return _0x9137b0[_0xfbc8('0x22')](_0x1948cf)[_0xfbc8('0x23')](function(_0x4ac588){return _0x4ac588;});}return null;};}function removeEntity(_0x56c16d,_0x27ec54){return function(_0x5a855e){if(_0x5a855e){return _0x5a855e[_0xfbc8('0x24')]()[_0xfbc8('0x23')](function(){_0x56c16d[_0xfbc8('0x18')](0xcc)[_0xfbc8('0x19')]();});}};}function handleEntityNotFound(_0x301819,_0x324e39){return function(_0x12ab46){if(!_0x12ab46){_0x301819['sendStatus'](0x194);}return _0x12ab46;};}function handleError(_0x5087a1,_0x26e93d){_0x26e93d=_0x26e93d||0x1f4;return function(_0x3d7c5f){logger[_0xfbc8('0x25')](_0x3d7c5f['stack']);if(_0x3d7c5f['name']){delete _0x3d7c5f['name'];}_0x5087a1[_0xfbc8('0x18')](_0x26e93d)[_0xfbc8('0x26')](_0x3d7c5f);};}exports[_0xfbc8('0x27')]=function(_0x224a92,_0x5cf056){var _0x7ed6d6={},_0x5601df={},_0x553bfb={'count':0x0,'rows':[]};var _0x18976b=_[_0xfbc8('0x28')](db['OpenchannelTransferReport']['rawAttributes'],function(_0x5343ce){return{'name':_0x5343ce[_0xfbc8('0x29')],'type':_0x5343ce[_0xfbc8('0x2a')][_0xfbc8('0x2b')]};});_0x5601df[_0xfbc8('0x2c')]=_[_0xfbc8('0x28')](_0x18976b,_0xfbc8('0x2d'));_0x5601df['query']=_['keys'](_0x224a92[_0xfbc8('0x2e')]);_0x5601df[_0xfbc8('0x2f')]=_[_0xfbc8('0x30')](_0x5601df[_0xfbc8('0x2c')],_0x5601df['query']);_0x7ed6d6[_0xfbc8('0x31')]=_['intersection'](_0x5601df[_0xfbc8('0x2c')],qs[_0xfbc8('0x32')](_0x224a92[_0xfbc8('0x2e')]['fields']));_0x7ed6d6[_0xfbc8('0x31')]=_0x7ed6d6['attributes']['length']?_0x7ed6d6[_0xfbc8('0x31')]:_0x5601df[_0xfbc8('0x2c')];if(!_0x224a92[_0xfbc8('0x2e')][_0xfbc8('0x33')](_0xfbc8('0x34'))){_0x7ed6d6[_0xfbc8('0x1c')]=qs[_0xfbc8('0x1c')](_0x224a92['query'][_0xfbc8('0x1c')]);_0x7ed6d6['offset']=qs[_0xfbc8('0x1a')](_0x224a92[_0xfbc8('0x2e')]['offset']);}_0x7ed6d6[_0xfbc8('0x35')]=qs[_0xfbc8('0x36')](_0x224a92[_0xfbc8('0x2e')][_0xfbc8('0x36')]);_0x7ed6d6[_0xfbc8('0x37')]=qs[_0xfbc8('0x2f')](_['pick'](_0x224a92[_0xfbc8('0x2e')],_0x5601df[_0xfbc8('0x2f')]),_0x18976b);if(_0x224a92[_0xfbc8('0x2e')][_0xfbc8('0x38')]){_0x7ed6d6[_0xfbc8('0x37')]=_[_0xfbc8('0x39')](_0x7ed6d6[_0xfbc8('0x37')],{'$or':_['map'](_0x18976b,function(_0x1d1730){if(_0x1d1730[_0xfbc8('0x2a')]!==_0xfbc8('0x3a')){var _0x25b8da={};_0x25b8da[_0x1d1730[_0xfbc8('0x2d')]]={'$like':'%'+_0x224a92[_0xfbc8('0x2e')]['filter']+'%'};return _0x25b8da;}})});}_0x7ed6d6=_[_0xfbc8('0x39')]({},_0x7ed6d6,_0x224a92['options']);var _0x22969d={'where':_0x7ed6d6[_0xfbc8('0x37')]};return db['OpenchannelTransferReport'][_0xfbc8('0x1d')](_0x22969d)[_0xfbc8('0x23')](function(_0x2a31d9){_0x553bfb[_0xfbc8('0x1d')]=_0x2a31d9;if(_0x224a92[_0xfbc8('0x2e')][_0xfbc8('0x3b')]){_0x7ed6d6['include']=[{'all':!![]}];}return db[_0xfbc8('0x3c')][_0xfbc8('0x3d')](_0x7ed6d6);})[_0xfbc8('0x23')](function(_0x425312){_0x553bfb[_0xfbc8('0x3e')]=_0x425312;return _0x553bfb;})['then'](respondWithFilteredResult(_0x5cf056,_0x7ed6d6))[_0xfbc8('0x3f')](handleError(_0x5cf056,null));};exports['show']=function(_0x54c1ac,_0x3a4ea8){var _0xb2b674={'raw':!![],'where':{'id':_0x54c1ac[_0xfbc8('0x40')]['id']}},_0x3aadaf={};_0x3aadaf['model']=_['keys'](db[_0xfbc8('0x3c')][_0xfbc8('0x41')]);_0x3aadaf[_0xfbc8('0x2e')]=_['keys'](_0x54c1ac[_0xfbc8('0x2e')]);_0x3aadaf['filters']=_[_0xfbc8('0x30')](_0x3aadaf[_0xfbc8('0x2c')],_0x3aadaf[_0xfbc8('0x2e')]);_0xb2b674[_0xfbc8('0x31')]=_[_0xfbc8('0x30')](_0x3aadaf['model'],qs[_0xfbc8('0x32')](_0x54c1ac[_0xfbc8('0x2e')][_0xfbc8('0x32')]));_0xb2b674[_0xfbc8('0x31')]=_0xb2b674[_0xfbc8('0x31')][_0xfbc8('0x42')]?_0xb2b674['attributes']:_0x3aadaf[_0xfbc8('0x2c')];if(_0x54c1ac[_0xfbc8('0x2e')]['includeAll']){_0xb2b674[_0xfbc8('0x43')]=[{'all':!![]}];}_0xb2b674=_[_0xfbc8('0x39')]({},_0xb2b674,_0x54c1ac['options']);return db[_0xfbc8('0x3c')][_0xfbc8('0x44')](_0xb2b674)[_0xfbc8('0x23')](handleEntityNotFound(_0x3a4ea8,null))[_0xfbc8('0x23')](respondWithResult(_0x3a4ea8,null))[_0xfbc8('0x3f')](handleError(_0x3a4ea8,null));};exports[_0xfbc8('0x45')]=function(_0x3060b0,_0x4122c0){return db['OpenchannelTransferReport']['create'](_0x3060b0[_0xfbc8('0x46')],{})[_0xfbc8('0x23')](respondWithResult(_0x4122c0,0xc9))[_0xfbc8('0x3f')](handleError(_0x4122c0,null));};exports[_0xfbc8('0x22')]=function(_0xa2471a,_0x9835ff){if(_0xa2471a[_0xfbc8('0x46')]['id']){delete _0xa2471a[_0xfbc8('0x46')]['id'];}return db[_0xfbc8('0x3c')]['find']({'where':{'id':_0xa2471a[_0xfbc8('0x40')]['id']}})[_0xfbc8('0x23')](handleEntityNotFound(_0x9835ff,null))[_0xfbc8('0x23')](saveUpdates(_0xa2471a['body'],null))[_0xfbc8('0x23')](respondWithResult(_0x9835ff,null))[_0xfbc8('0x3f')](handleError(_0x9835ff,null));};exports[_0xfbc8('0x24')]=function(_0x13c9f8,_0x8f47a1){return db[_0xfbc8('0x3c')][_0xfbc8('0x44')]({'where':{'id':_0x13c9f8[_0xfbc8('0x40')]['id']}})[_0xfbc8('0x23')](handleEntityNotFound(_0x8f47a1,null))[_0xfbc8('0x23')](removeEntity(_0x8f47a1,null))[_0xfbc8('0x3f')](handleError(_0x8f47a1,null));};exports[_0xfbc8('0x47')]=function(_0x302d54,_0x3546c0){return db[_0xfbc8('0x3c')][_0xfbc8('0x47')]()[_0xfbc8('0x23')](respondWithResult(_0x3546c0,null))[_0xfbc8('0x3f')](handleError(_0x3546c0,null));}; \ No newline at end of file +var _0xd9cc=['stack','name','map','OpenchannelTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','Content-Range','reject','update','then','sendStatus'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd9cc,0xed));var _0xcd9c=function(_0x4d4833,_0x2c4ff0){_0x4d4833=_0x4d4833-0x0;var _0x2105a3=_0xd9cc[_0x4d4833];return _0x2105a3;};'use strict';var emlformat=require(_0xcd9c('0x0'));var rimraf=require(_0xcd9c('0x1'));var zipdir=require(_0xcd9c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcd9c('0x3'));var moment=require(_0xcd9c('0x4'));var BPromise=require(_0xcd9c('0x5'));var Mustache=require(_0xcd9c('0x6'));var util=require(_0xcd9c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xcd9c('0x8'));var ejs=require(_0xcd9c('0x9'));var fs=require('fs');var fs_extra=require(_0xcd9c('0xa'));var _=require(_0xcd9c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcd9c('0x8'));var querystring=require(_0xcd9c('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcd9c('0xd'));var as=require(_0xcd9c('0xe'));var hardwareService=require(_0xcd9c('0xf'));var logger=require(_0xcd9c('0x10'))('api');var utils=require(_0xcd9c('0x11'));var config=require(_0xcd9c('0x12'));var licenseUtil=require(_0xcd9c('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4519bb,_0xad31cd){_0xad31cd=_0xad31cd||0xcc;return function(_0x3a2644){if(_0x3a2644){return _0x4519bb['sendStatus'](_0xad31cd);}return _0x4519bb[_0xcd9c('0x14')](_0xad31cd)[_0xcd9c('0x15')]();};}function respondWithResult(_0x426ee0,_0x41103f){_0x41103f=_0x41103f||0xc8;return function(_0x4f1730){if(_0x4f1730){return _0x426ee0[_0xcd9c('0x14')](_0x41103f)[_0xcd9c('0x16')](_0x4f1730);}};}function respondWithFilteredResult(_0x1e803e,_0x4fcc35){return function(_0x27b97f){if(_0x27b97f){var _0x3bc06d=typeof _0x4fcc35[_0xcd9c('0x17')]==='undefined'&&typeof _0x4fcc35['limit']===_0xcd9c('0x18');var _0x4afc15=_0x27b97f[_0xcd9c('0x19')];var _0x587d38=_0x3bc06d?0x0:_0x4fcc35[_0xcd9c('0x17')];var _0xfecc39=_0x3bc06d?_0x27b97f[_0xcd9c('0x19')]:_0x4fcc35[_0xcd9c('0x17')]+_0x4fcc35['limit'];var _0x4faf19;if(_0xfecc39>=_0x4afc15){_0xfecc39=_0x4afc15;_0x4faf19=0xc8;}else{_0x4faf19=0xce;}_0x1e803e[_0xcd9c('0x14')](_0x4faf19);return _0x1e803e['set'](_0xcd9c('0x1a'),_0x587d38+'-'+_0xfecc39+'/'+_0x4afc15)['json'](_0x27b97f);}return null;};}function patchUpdates(_0x59fd03){return function(_0x1c35ed){try{jsonpatch['apply'](_0x1c35ed,_0x59fd03,!![]);}catch(_0x155acb){return BPromise[_0xcd9c('0x1b')](_0x155acb);}return _0x1c35ed['save']();};}function saveUpdates(_0x381964,_0x2aae71){return function(_0x1f10a6){if(_0x1f10a6){return _0x1f10a6[_0xcd9c('0x1c')](_0x381964)['then'](function(_0x2722fb){return _0x2722fb;});}return null;};}function removeEntity(_0x16764f,_0x13333b){return function(_0x32e374){if(_0x32e374){return _0x32e374['destroy']()[_0xcd9c('0x1d')](function(){_0x16764f[_0xcd9c('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x90946b,_0x1a1174){return function(_0x3e24a6){if(!_0x3e24a6){_0x90946b[_0xcd9c('0x1e')](0x194);}return _0x3e24a6;};}function handleError(_0x3d235a,_0x2ac438){_0x2ac438=_0x2ac438||0x1f4;return function(_0x2ae0f4){logger['error'](_0x2ae0f4[_0xcd9c('0x1f')]);if(_0x2ae0f4['name']){delete _0x2ae0f4[_0xcd9c('0x20')];}_0x3d235a[_0xcd9c('0x14')](_0x2ac438)['send'](_0x2ae0f4);};}exports['index']=function(_0x7373eb,_0x36b4cb){var _0x18b2f5={},_0x22dadc={},_0x134a01={'count':0x0,'rows':[]};var _0x274e0f=_[_0xcd9c('0x21')](db[_0xcd9c('0x22')][_0xcd9c('0x23')],function(_0x3d1997){return{'name':_0x3d1997[_0xcd9c('0x24')],'type':_0x3d1997['type'][_0xcd9c('0x25')]};});_0x22dadc[_0xcd9c('0x26')]=_[_0xcd9c('0x21')](_0x274e0f,_0xcd9c('0x20'));_0x22dadc[_0xcd9c('0x27')]=_[_0xcd9c('0x28')](_0x7373eb[_0xcd9c('0x27')]);_0x22dadc[_0xcd9c('0x29')]=_[_0xcd9c('0x2a')](_0x22dadc[_0xcd9c('0x26')],_0x22dadc[_0xcd9c('0x27')]);_0x18b2f5[_0xcd9c('0x2b')]=_[_0xcd9c('0x2a')](_0x22dadc[_0xcd9c('0x26')],qs[_0xcd9c('0x2c')](_0x7373eb[_0xcd9c('0x27')][_0xcd9c('0x2c')]));_0x18b2f5[_0xcd9c('0x2b')]=_0x18b2f5['attributes']['length']?_0x18b2f5[_0xcd9c('0x2b')]:_0x22dadc[_0xcd9c('0x26')];if(!_0x7373eb['query'][_0xcd9c('0x2d')](_0xcd9c('0x2e'))){_0x18b2f5['limit']=qs[_0xcd9c('0x2f')](_0x7373eb[_0xcd9c('0x27')]['limit']);_0x18b2f5[_0xcd9c('0x17')]=qs[_0xcd9c('0x17')](_0x7373eb[_0xcd9c('0x27')][_0xcd9c('0x17')]);}_0x18b2f5['order']=qs['sort'](_0x7373eb[_0xcd9c('0x27')][_0xcd9c('0x30')]);_0x18b2f5[_0xcd9c('0x31')]=qs[_0xcd9c('0x29')](_[_0xcd9c('0x32')](_0x7373eb[_0xcd9c('0x27')],_0x22dadc[_0xcd9c('0x29')]),_0x274e0f);if(_0x7373eb[_0xcd9c('0x27')][_0xcd9c('0x33')]){_0x18b2f5[_0xcd9c('0x31')]=_[_0xcd9c('0x34')](_0x18b2f5[_0xcd9c('0x31')],{'$or':_[_0xcd9c('0x21')](_0x274e0f,function(_0x34f81a){if(_0x34f81a['type']!==_0xcd9c('0x35')){var _0x1cd63f={};_0x1cd63f[_0x34f81a['name']]={'$like':'%'+_0x7373eb['query'][_0xcd9c('0x33')]+'%'};return _0x1cd63f;}})});}_0x18b2f5=_[_0xcd9c('0x34')]({},_0x18b2f5,_0x7373eb['options']);var _0x7b71af={'where':_0x18b2f5[_0xcd9c('0x31')]};return db['OpenchannelTransferReport']['count'](_0x7b71af)[_0xcd9c('0x1d')](function(_0x32357d){_0x134a01[_0xcd9c('0x19')]=_0x32357d;if(_0x7373eb[_0xcd9c('0x27')][_0xcd9c('0x36')]){_0x18b2f5[_0xcd9c('0x37')]=[{'all':!![]}];}return db[_0xcd9c('0x22')][_0xcd9c('0x38')](_0x18b2f5);})[_0xcd9c('0x1d')](function(_0x12008e){_0x134a01[_0xcd9c('0x39')]=_0x12008e;return _0x134a01;})[_0xcd9c('0x1d')](respondWithFilteredResult(_0x36b4cb,_0x18b2f5))[_0xcd9c('0x3a')](handleError(_0x36b4cb,null));};exports[_0xcd9c('0x3b')]=function(_0x37a014,_0x347cb4){var _0x5989d3={'raw':!![],'where':{'id':_0x37a014[_0xcd9c('0x3c')]['id']}},_0x3c60ac={};_0x3c60ac[_0xcd9c('0x26')]=_[_0xcd9c('0x28')](db[_0xcd9c('0x22')][_0xcd9c('0x23')]);_0x3c60ac[_0xcd9c('0x27')]=_[_0xcd9c('0x28')](_0x37a014[_0xcd9c('0x27')]);_0x3c60ac['filters']=_[_0xcd9c('0x2a')](_0x3c60ac['model'],_0x3c60ac['query']);_0x5989d3['attributes']=_[_0xcd9c('0x2a')](_0x3c60ac[_0xcd9c('0x26')],qs[_0xcd9c('0x2c')](_0x37a014['query'][_0xcd9c('0x2c')]));_0x5989d3[_0xcd9c('0x2b')]=_0x5989d3['attributes'][_0xcd9c('0x3d')]?_0x5989d3[_0xcd9c('0x2b')]:_0x3c60ac['model'];if(_0x37a014[_0xcd9c('0x27')][_0xcd9c('0x36')]){_0x5989d3[_0xcd9c('0x37')]=[{'all':!![]}];}_0x5989d3=_['merge']({},_0x5989d3,_0x37a014[_0xcd9c('0x3e')]);return db['OpenchannelTransferReport'][_0xcd9c('0x3f')](_0x5989d3)[_0xcd9c('0x1d')](handleEntityNotFound(_0x347cb4,null))['then'](respondWithResult(_0x347cb4,null))[_0xcd9c('0x3a')](handleError(_0x347cb4,null));};exports[_0xcd9c('0x40')]=function(_0xd59c92,_0xf36fa2){return db[_0xcd9c('0x22')]['create'](_0xd59c92['body'],{})[_0xcd9c('0x1d')](respondWithResult(_0xf36fa2,0xc9))[_0xcd9c('0x3a')](handleError(_0xf36fa2,null));};exports[_0xcd9c('0x1c')]=function(_0x76223b,_0x503bb9){if(_0x76223b['body']['id']){delete _0x76223b['body']['id'];}return db[_0xcd9c('0x22')][_0xcd9c('0x3f')]({'where':{'id':_0x76223b['params']['id']}})[_0xcd9c('0x1d')](handleEntityNotFound(_0x503bb9,null))[_0xcd9c('0x1d')](saveUpdates(_0x76223b[_0xcd9c('0x41')],null))['then'](respondWithResult(_0x503bb9,null))[_0xcd9c('0x3a')](handleError(_0x503bb9,null));};exports['destroy']=function(_0x3bef62,_0xc4afb7){return db[_0xcd9c('0x22')][_0xcd9c('0x3f')]({'where':{'id':_0x3bef62[_0xcd9c('0x3c')]['id']}})[_0xcd9c('0x1d')](handleEntityNotFound(_0xc4afb7,null))[_0xcd9c('0x1d')](removeEntity(_0xc4afb7,null))[_0xcd9c('0x3a')](handleError(_0xc4afb7,null));};exports[_0xcd9c('0x42')]=function(_0x37a0e0,_0x5362e2){return db[_0xcd9c('0x22')][_0xcd9c('0x42')]()[_0xcd9c('0x1d')](respondWithResult(_0x5362e2,null))['catch'](handleError(_0x5362e2,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index d334aef..520000f 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 _0x7933=['moment','bluebird','path','rimraf','../../config/environment','exports','define','OpenchannelTransferReport','uniqueid','../../config/logger','api'];(function(_0x577210,_0x1a0966){var _0x1991b1=function(_0x4d61ff){while(--_0x4d61ff){_0x577210['push'](_0x577210['shift']());}};_0x1991b1(++_0x1a0966);}(_0x7933,0x169));var _0x3793=function(_0x31c0fb,_0x432e59){_0x31c0fb=_0x31c0fb-0x0;var _0x1404ce=_0x7933[_0x31c0fb];return _0x1404ce;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3793('0x0'))(_0x3793('0x1'));var moment=require(_0x3793('0x2'));var BPromise=require(_0x3793('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3793('0x4'));var rimraf=require(_0x3793('0x5'));var config=require(_0x3793('0x6'));var attributes=require('./openchannelTransferReport.attributes');module[_0x3793('0x7')]=function(_0x12417c,_0x54e2a7){return _0x12417c[_0x3793('0x8')](_0x3793('0x9'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3793('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7bf0=['../../config/logger','api','moment','bluebird','path','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','lodash'];(function(_0x1c011c,_0x384710){var _0x277506=function(_0x92ca26){while(--_0x92ca26){_0x1c011c['push'](_0x1c011c['shift']());}};_0x277506(++_0x384710);}(_0x7bf0,0x13e));var _0x07bf=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x7bf0[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x07bf('0x0'));var util=require('util');var logger=require(_0x07bf('0x1'))(_0x07bf('0x2'));var moment=require(_0x07bf('0x3'));var BPromise=require(_0x07bf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x07bf('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x07bf('0x6'));module[_0x07bf('0x7')]=function(_0x73511d,_0x4c6edf){return _0x73511d[_0x07bf('0x8')](_0x07bf('0x9'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x07bf('0xa'),'fields':[_0x07bf('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 4172fe3..ffb3518 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 _0x0faf=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x58032b,_0x6103fd){var _0x45d639=function(_0x3d4933){while(--_0x3d4933){_0x58032b['push'](_0x58032b['shift']());}};_0x45d639(++_0x6103fd);}(_0x0faf,0x132));var _0xf0fa=function(_0xea343d,_0x311197){_0xea343d=_0xea343d-0x0;var _0x2c6e9c=_0x0faf[_0xea343d];return _0x2c6e9c;};'use strict';var _=require(_0xf0fa('0x0'));var util=require('util');var moment=require(_0xf0fa('0x1'));var BPromise=require(_0xf0fa('0x2'));var rs=require(_0xf0fa('0x3'));var fs=require('fs');var Redis=require(_0xf0fa('0x4'));var db=require(_0xf0fa('0x5'))['db'];var utils=require(_0xf0fa('0x6'));var logger=require(_0xf0fa('0x7'))(_0xf0fa('0x8'));var config=require(_0xf0fa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf0fa('0xa')][_0xf0fa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25b5c4,_0x3a703b,_0x2db1d9){return new BPromise(function(_0x587865,_0x42f7fd){return client[_0xf0fa('0xc')](_0x25b5c4,_0x2db1d9)['then'](function(_0x4df4d1){logger[_0xf0fa('0xd')](_0xf0fa('0xe'),_0x3a703b,_0xf0fa('0xf'));logger[_0xf0fa('0x10')](_0xf0fa('0x11'),_0x3a703b,_0xf0fa('0xf'),JSON[_0xf0fa('0x12')](_0x4df4d1));if(_0x4df4d1[_0xf0fa('0x13')]){if(_0x4df4d1['error'][_0xf0fa('0x14')]===0x1f4){logger['error'](_0xf0fa('0xe'),_0x3a703b,_0x4df4d1['error'][_0xf0fa('0x15')]);return _0x42f7fd(_0x4df4d1[_0xf0fa('0x13')][_0xf0fa('0x15')]);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x3a703b,_0x4df4d1[_0xf0fa('0x13')]['message']);return _0x587865(_0x4df4d1[_0xf0fa('0x13')][_0xf0fa('0x15')]);}else{logger[_0xf0fa('0xd')](_0xf0fa('0xe'),_0x3a703b,_0xf0fa('0xf'));_0x587865(_0x4df4d1[_0xf0fa('0x16')][_0xf0fa('0x15')]);}})[_0xf0fa('0x17')](function(_0x497542){logger[_0xf0fa('0x13')](_0xf0fa('0xe'),_0x3a703b,_0x497542);_0x42f7fd(_0x497542);});});} \ No newline at end of file +var _0x383d=['debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x528402,_0xf0680f){var _0x31f98d=function(_0x58328e){while(--_0x58328e){_0x528402['push'](_0x528402['shift']());}};_0x31f98d(++_0xf0680f);}(_0x383d,0x86));var _0xd383=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x383d[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd383('0x0'));var BPromise=require(_0xd383('0x1'));var rs=require(_0xd383('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd383('0x3'))['db'];var utils=require(_0xd383('0x4'));var logger=require(_0xd383('0x5'))(_0xd383('0x6'));var config=require(_0xd383('0x7'));var jayson=require(_0xd383('0x8'));var client=jayson['client'][_0xd383('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30ba82,_0x9922e9,_0x470d8d){return new BPromise(function(_0xffa778,_0x5d4e0f){return client['request'](_0x30ba82,_0x470d8d)[_0xd383('0xa')](function(_0xb3ff62){logger['info'](_0xd383('0xb'),_0x9922e9,_0xd383('0xc'));logger[_0xd383('0xd')](_0xd383('0xe'),_0x9922e9,_0xd383('0xc'),JSON[_0xd383('0xf')](_0xb3ff62));if(_0xb3ff62['error']){if(_0xb3ff62[_0xd383('0x10')][_0xd383('0x11')]===0x1f4){logger[_0xd383('0x10')](_0xd383('0xb'),_0x9922e9,_0xb3ff62['error'][_0xd383('0x12')]);return _0x5d4e0f(_0xb3ff62[_0xd383('0x10')][_0xd383('0x12')]);}logger[_0xd383('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x9922e9,_0xb3ff62[_0xd383('0x10')]['message']);return _0xffa778(_0xb3ff62[_0xd383('0x10')][_0xd383('0x12')]);}else{logger[_0xd383('0x13')](_0xd383('0xb'),_0x9922e9,_0xd383('0xc'));_0xffa778(_0xb3ff62[_0xd383('0x14')]['message']);}})['catch'](function(_0x3905c1){logger[_0xd383('0x10')](_0xd383('0xb'),_0x9922e9,_0x3905c1);_0x5d4e0f(_0x3905c1);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 456cfd8..e39fbae 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 _0x96c3=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update','delete','exports','multer'];(function(_0x2de34d,_0x11e82f){var _0x3c1d7f=function(_0x1cc77c){while(--_0x1cc77c){_0x2de34d['push'](_0x2de34d['shift']());}};_0x3c1d7f(++_0x11e82f);}(_0x96c3,0xff));var _0x396c=function(_0x1fe321,_0x4ff8bf){_0x1fe321=_0x1fe321-0x0;var _0x285f4c=_0x96c3[_0x1fe321];return _0x285f4c;};'use strict';var multer=require(_0x396c('0x0'));var util=require('util');var path=require(_0x396c('0x1'));var timeout=require('connect-timeout');var express=require(_0x396c('0x2'));var router=express[_0x396c('0x3')]();var fs_extra=require(_0x396c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x396c('0x5'));var config=require(_0x396c('0x6'));var controller=require('./pause.controller');router[_0x396c('0x7')]('/',auth[_0x396c('0x8')](),controller['index']);router['get'](_0x396c('0x9'),auth['isAuthenticated'](),controller[_0x396c('0xa')]);router[_0x396c('0xb')]('/',auth[_0x396c('0x8')](),controller[_0x396c('0xc')]);router['put'](_0x396c('0x9'),auth[_0x396c('0x8')](),controller[_0x396c('0xd')]);router[_0x396c('0xe')]('/:id',auth[_0x396c('0x8')](),controller['destroy']);module[_0x396c('0xf')]=router; \ No newline at end of file +var _0x46c2=['isAuthenticated','index','get','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x365b05,_0x3c3537){var _0x1b9556=function(_0x755936){while(--_0x755936){_0x365b05['push'](_0x365b05['shift']());}};_0x1b9556(++_0x3c3537);}(_0x46c2,0x180));var _0x246c=function(_0x14d6bb,_0x388b8e){_0x14d6bb=_0x14d6bb-0x0;var _0x191d22=_0x46c2[_0x14d6bb];return _0x191d22;};'use strict';var multer=require(_0x246c('0x0'));var util=require(_0x246c('0x1'));var path=require(_0x246c('0x2'));var timeout=require(_0x246c('0x3'));var express=require(_0x246c('0x4'));var router=express[_0x246c('0x5')]();var fs_extra=require(_0x246c('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./pause.controller');router['get']('/',auth[_0x246c('0x7')](),controller[_0x246c('0x8')]);router[_0x246c('0x9')](_0x246c('0xa'),auth['isAuthenticated'](),controller[_0x246c('0xb')]);router[_0x246c('0xc')]('/',auth['isAuthenticated'](),controller[_0x246c('0xd')]);router[_0x246c('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x246c('0xf')]);module[_0x246c('0x10')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index a6d09cd..c1f0e4d 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 _0x8059=['exports','STRING','name'];(function(_0x248e29,_0x477e46){var _0x40acac=function(_0x42fce2){while(--_0x42fce2){_0x248e29['push'](_0x248e29['shift']());}};_0x40acac(++_0x477e46);}(_0x8059,0x15f));var _0x9805=function(_0x4b418f,_0x3b6a96){_0x4b418f=_0x4b418f-0x0;var _0x2ed208=_0x8059[_0x4b418f];return _0x2ed208;};'use strict';var Sequelize=require('sequelize');module[_0x9805('0x0')]={'name':{'type':Sequelize[_0x9805('0x1')],'unique':_0x9805('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x9805('0x1')]}}; \ No newline at end of file +var _0x27d3=['sequelize','exports','STRING','name'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x27d3,0x70));var _0x327d=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x27d3[_0x369151];return _0x4292d5;};'use strict';var Sequelize=require(_0x327d('0x0'));module[_0x327d('0x1')]={'name':{'type':Sequelize[_0x327d('0x2')],'unique':_0x327d('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x327d('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 705aa3c..b5251da 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 _0x2066=['fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','Pause','rows','catch','show','rawAttributes','intersection','includeAll','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Pauses','UserProfileResource','error','send','index','type','key','model','map','name','query','keys','filters','attributes'];(function(_0x4a8f5d,_0x462667){var _0xc0f940=function(_0x1ba2f8){while(--_0x1ba2f8){_0x4a8f5d['push'](_0x4a8f5d['shift']());}};_0xc0f940(++_0x462667);}(_0x2066,0x170));var _0x6206=function(_0x512505,_0x4d33f3){_0x512505=_0x512505-0x0;var _0x3c14e2=_0x2066[_0x512505];return _0x3c14e2;};'use strict';var emlformat=require(_0x6206('0x0'));var rimraf=require(_0x6206('0x1'));var zipdir=require(_0x6206('0x2'));var jsonpatch=require(_0x6206('0x3'));var rp=require(_0x6206('0x4'));var moment=require(_0x6206('0x5'));var BPromise=require(_0x6206('0x6'));var Mustache=require(_0x6206('0x7'));var util=require(_0x6206('0x8'));var path=require(_0x6206('0x9'));var sox=require(_0x6206('0xa'));var csv=require(_0x6206('0xb'));var ejs=require(_0x6206('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6206('0xd'));var squel=require(_0x6206('0xe'));var crypto=require('crypto');var jsforce=require(_0x6206('0xf'));var deskjs=require(_0x6206('0x10'));var toCsv=require(_0x6206('0xb'));var querystring=require(_0x6206('0x11'));var Papa=require(_0x6206('0x12'));var Redis=require(_0x6206('0x13'));var authService=require(_0x6206('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6206('0x15'))(_0x6206('0x16'));var utils=require(_0x6206('0x17'));var config=require(_0x6206('0x18'));var licenseUtil=require(_0x6206('0x19'));var db=require(_0x6206('0x1a'))['db'];function respondWithStatusCode(_0x15989e,_0x1b3423){_0x1b3423=_0x1b3423||0xcc;return function(_0x146b8c){if(_0x146b8c){return _0x15989e[_0x6206('0x1b')](_0x1b3423);}return _0x15989e[_0x6206('0x1c')](_0x1b3423)[_0x6206('0x1d')]();};}function respondWithResult(_0x3fb05a,_0x33fdab){_0x33fdab=_0x33fdab||0xc8;return function(_0x5560a8){if(_0x5560a8){return _0x3fb05a['status'](_0x33fdab)[_0x6206('0x1e')](_0x5560a8);}};}function respondWithFilteredResult(_0x153d6d,_0xe1e0d1){return function(_0x321755){if(_0x321755){var _0x1b2024=typeof _0xe1e0d1[_0x6206('0x1f')]===_0x6206('0x20')&&typeof _0xe1e0d1[_0x6206('0x21')]===_0x6206('0x20');var _0x16b9da=_0x321755[_0x6206('0x22')];var _0x53bd49=_0x1b2024?0x0:_0xe1e0d1['offset'];var _0x296c00=_0x1b2024?_0x321755[_0x6206('0x22')]:_0xe1e0d1[_0x6206('0x1f')]+_0xe1e0d1[_0x6206('0x21')];var _0x393485;if(_0x296c00>=_0x16b9da){_0x296c00=_0x16b9da;_0x393485=0xc8;}else{_0x393485=0xce;}_0x153d6d[_0x6206('0x1c')](_0x393485);return _0x153d6d[_0x6206('0x23')](_0x6206('0x24'),_0x53bd49+'-'+_0x296c00+'/'+_0x16b9da)[_0x6206('0x1e')](_0x321755);}return null;};}function patchUpdates(_0x21cebd){return function(_0x51ed5a){try{jsonpatch[_0x6206('0x25')](_0x51ed5a,_0x21cebd,!![]);}catch(_0x2fcf84){return BPromise[_0x6206('0x26')](_0x2fcf84);}return _0x51ed5a[_0x6206('0x27')]();};}function saveUpdates(_0xe0ec80,_0x5687ee){return function(_0x596338){if(_0x596338){return _0x596338[_0x6206('0x28')](_0xe0ec80)[_0x6206('0x29')](function(_0x43f21c){return _0x43f21c;});}return null;};}function removeEntity(_0x4220fb,_0xbe19e7){return function(_0x523fb1){if(_0x523fb1){return _0x523fb1[_0x6206('0x2a')]()[_0x6206('0x29')](function(){var _0x1173dd=_0x523fb1['get']({'plain':!![]});var _0x1ff94d=_0x6206('0x2b');return db[_0x6206('0x2c')][_0x6206('0x2a')]({'where':{'type':_0x1ff94d,'resourceId':_0x1173dd['id']}})[_0x6206('0x29')](function(){return _0x523fb1;});})['then'](function(){_0x4220fb['status'](0xcc)[_0x6206('0x1d')]();});}};}function handleEntityNotFound(_0x20a941,_0x3319af){return function(_0x3c8beb){if(!_0x3c8beb){_0x20a941[_0x6206('0x1b')](0x194);}return _0x3c8beb;};}function handleError(_0x384935,_0x2728fc){_0x2728fc=_0x2728fc||0x1f4;return function(_0x1e8747){logger[_0x6206('0x2d')](_0x1e8747['stack']);if(_0x1e8747['name']){delete _0x1e8747['name'];}_0x384935['status'](_0x2728fc)[_0x6206('0x2e')](_0x1e8747);};}exports[_0x6206('0x2f')]=function(_0x1daa5d,_0x1df31e){var _0x10e2db={},_0x3cba72={},_0x5cf3ab={'count':0x0,'rows':[]};var _0x24646b=_['map'](db['Pause']['rawAttributes'],function(_0x1f8314){return{'name':_0x1f8314['fieldName'],'type':_0x1f8314[_0x6206('0x30')][_0x6206('0x31')]};});_0x3cba72[_0x6206('0x32')]=_[_0x6206('0x33')](_0x24646b,_0x6206('0x34'));_0x3cba72[_0x6206('0x35')]=_[_0x6206('0x36')](_0x1daa5d[_0x6206('0x35')]);_0x3cba72[_0x6206('0x37')]=_['intersection'](_0x3cba72[_0x6206('0x32')],_0x3cba72[_0x6206('0x35')]);_0x10e2db[_0x6206('0x38')]=_['intersection'](_0x3cba72[_0x6206('0x32')],qs['fields'](_0x1daa5d[_0x6206('0x35')][_0x6206('0x39')]));_0x10e2db[_0x6206('0x38')]=_0x10e2db['attributes'][_0x6206('0x3a')]?_0x10e2db[_0x6206('0x38')]:_0x3cba72[_0x6206('0x32')];if(!_0x1daa5d[_0x6206('0x35')][_0x6206('0x3b')](_0x6206('0x3c'))){_0x10e2db[_0x6206('0x21')]=qs[_0x6206('0x21')](_0x1daa5d['query'][_0x6206('0x21')]);_0x10e2db[_0x6206('0x1f')]=qs[_0x6206('0x1f')](_0x1daa5d[_0x6206('0x35')][_0x6206('0x1f')]);}_0x10e2db[_0x6206('0x3d')]=qs[_0x6206('0x3e')](_0x1daa5d['query'][_0x6206('0x3e')]);_0x10e2db[_0x6206('0x3f')]=qs[_0x6206('0x37')](_['pick'](_0x1daa5d[_0x6206('0x35')],_0x3cba72[_0x6206('0x37')]),_0x24646b);if(_0x1daa5d[_0x6206('0x35')][_0x6206('0x40')]){_0x10e2db['where']=_[_0x6206('0x41')](_0x10e2db['where'],{'$or':_['map'](_0x24646b,function(_0xbc2e9b){if(_0xbc2e9b[_0x6206('0x30')]!=='VIRTUAL'){var _0x5c9797={};_0x5c9797[_0xbc2e9b[_0x6206('0x34')]]={'$like':'%'+_0x1daa5d[_0x6206('0x35')][_0x6206('0x40')]+'%'};return _0x5c9797;}})});}_0x10e2db=_['merge']({},_0x10e2db,_0x1daa5d[_0x6206('0x42')]);var _0x3bff7e={'where':_0x10e2db[_0x6206('0x3f')]};return db[_0x6206('0x43')][_0x6206('0x22')](_0x3bff7e)[_0x6206('0x29')](function(_0x1467e5){_0x5cf3ab['count']=_0x1467e5;if(_0x1daa5d[_0x6206('0x35')]['includeAll']){_0x10e2db['include']=[{'all':!![]}];}return db['Pause']['findAll'](_0x10e2db);})[_0x6206('0x29')](function(_0x55dcbc){_0x5cf3ab[_0x6206('0x44')]=_0x55dcbc;return _0x5cf3ab;})[_0x6206('0x29')](respondWithFilteredResult(_0x1df31e,_0x10e2db))[_0x6206('0x45')](handleError(_0x1df31e,null));};exports[_0x6206('0x46')]=function(_0x2a09f2,_0x392bc2){var _0x5bc42d={'raw':!![],'where':{'id':_0x2a09f2['params']['id']}},_0x47c8d4={};_0x47c8d4[_0x6206('0x32')]=_['keys'](db[_0x6206('0x43')][_0x6206('0x47')]);_0x47c8d4[_0x6206('0x35')]=_[_0x6206('0x36')](_0x2a09f2[_0x6206('0x35')]);_0x47c8d4['filters']=_[_0x6206('0x48')](_0x47c8d4[_0x6206('0x32')],_0x47c8d4[_0x6206('0x35')]);_0x5bc42d[_0x6206('0x38')]=_[_0x6206('0x48')](_0x47c8d4[_0x6206('0x32')],qs[_0x6206('0x39')](_0x2a09f2[_0x6206('0x35')]['fields']));_0x5bc42d[_0x6206('0x38')]=_0x5bc42d['attributes'][_0x6206('0x3a')]?_0x5bc42d[_0x6206('0x38')]:_0x47c8d4['model'];if(_0x2a09f2[_0x6206('0x35')][_0x6206('0x49')]){_0x5bc42d[_0x6206('0x4a')]=[{'all':!![]}];}_0x5bc42d=_[_0x6206('0x41')]({},_0x5bc42d,_0x2a09f2[_0x6206('0x42')]);return db[_0x6206('0x43')]['find'](_0x5bc42d)[_0x6206('0x29')](handleEntityNotFound(_0x392bc2,null))[_0x6206('0x29')](respondWithResult(_0x392bc2,null))[_0x6206('0x45')](handleError(_0x392bc2,null));};exports[_0x6206('0x4b')]=function(_0xd71214,_0x5a54cb){return db[_0x6206('0x43')]['create'](_0xd71214[_0x6206('0x4c')],{})[_0x6206('0x29')](function(_0x6238cb){var _0x5e2ea0=_0xd71214[_0x6206('0x4d')][_0x6206('0x4e')]({'plain':!![]});if(!_0x5e2ea0)throw new Error(_0x6206('0x4f'));if(_0x5e2ea0[_0x6206('0x50')]==='user'){var _0x1c72ae=_0x6238cb['get']({'plain':!![]});var _0x2012e8=_0x6206('0x2b');return db[_0x6206('0x51')][_0x6206('0x52')]({'where':{'name':_0x2012e8,'userProfileId':_0x5e2ea0['userProfileId']},'raw':!![]})[_0x6206('0x29')](function(_0x2d2301){if(_0x2d2301&&_0x2d2301['autoAssociation']===0x0){return db[_0x6206('0x2c')][_0x6206('0x4b')]({'name':_0x1c72ae[_0x6206('0x34')],'resourceId':_0x1c72ae['id'],'type':_0x2d2301[_0x6206('0x34')],'sectionId':_0x2d2301['id']},{})[_0x6206('0x29')](function(){return _0x6238cb;});}else{return _0x6238cb;}})[_0x6206('0x45')](function(_0x232b99){logger[_0x6206('0x2d')](_0x6206('0x53'),_0x232b99);throw _0x232b99;});}return _0x6238cb;})[_0x6206('0x29')](respondWithResult(_0x5a54cb,0xc9))[_0x6206('0x45')](handleError(_0x5a54cb,null));};exports['update']=function(_0x4ec553,_0x37cb1c){if(_0x4ec553[_0x6206('0x4c')]['id']){delete _0x4ec553['body']['id'];}return db[_0x6206('0x43')][_0x6206('0x52')]({'where':{'id':_0x4ec553[_0x6206('0x54')]['id']}})[_0x6206('0x29')](handleEntityNotFound(_0x37cb1c,null))[_0x6206('0x29')](saveUpdates(_0x4ec553['body'],null))[_0x6206('0x29')](respondWithResult(_0x37cb1c,null))[_0x6206('0x45')](handleError(_0x37cb1c,null));};exports[_0x6206('0x2a')]=function(_0x4e5a1f,_0x165176){return db[_0x6206('0x43')][_0x6206('0x52')]({'where':{'id':_0x4e5a1f['params']['id']}})[_0x6206('0x29')](handleEntityNotFound(_0x165176,null))[_0x6206('0x29')](removeEntity(_0x165176,null))[_0x6206('0x45')](handleError(_0x165176,null));}; \ No newline at end of file +var _0x8f0f=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','get','Pauses','UserProfileResource','sendStatus','send','index','map','Pause','rawAttributes','fieldName','type','model','name','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show'];(function(_0x49aa10,_0x3ec2f0){var _0x1c659b=function(_0x52ac2f){while(--_0x52ac2f){_0x49aa10['push'](_0x49aa10['shift']());}};_0x1c659b(++_0x3ec2f0);}(_0x8f0f,0x15c));var _0xf8f0=function(_0x43a450,_0x64bfe1){_0x43a450=_0x43a450-0x0;var _0x2e257a=_0x8f0f[_0x43a450];return _0x2e257a;};'use strict';var emlformat=require(_0xf8f0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf8f0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8f0('0x2'));var moment=require(_0xf8f0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf8f0('0x4'));var util=require(_0xf8f0('0x5'));var path=require(_0xf8f0('0x6'));var sox=require(_0xf8f0('0x7'));var csv=require(_0xf8f0('0x8'));var ejs=require(_0xf8f0('0x9'));var fs=require('fs');var fs_extra=require(_0xf8f0('0xa'));var _=require(_0xf8f0('0xb'));var squel=require(_0xf8f0('0xc'));var crypto=require(_0xf8f0('0xd'));var jsforce=require(_0xf8f0('0xe'));var deskjs=require(_0xf8f0('0xf'));var toCsv=require(_0xf8f0('0x8'));var querystring=require(_0xf8f0('0x10'));var Papa=require(_0xf8f0('0x11'));var Redis=require(_0xf8f0('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf8f0('0x13'));var logger=require(_0xf8f0('0x14'))(_0xf8f0('0x15'));var utils=require(_0xf8f0('0x16'));var config=require(_0xf8f0('0x17'));var licenseUtil=require(_0xf8f0('0x18'));var db=require(_0xf8f0('0x19'))['db'];function respondWithStatusCode(_0x40a8a3,_0x3f7a17){_0x3f7a17=_0x3f7a17||0xcc;return function(_0x2c47b2){if(_0x2c47b2){return _0x40a8a3['sendStatus'](_0x3f7a17);}return _0x40a8a3[_0xf8f0('0x1a')](_0x3f7a17)[_0xf8f0('0x1b')]();};}function respondWithResult(_0x3b44d1,_0x37284f){_0x37284f=_0x37284f||0xc8;return function(_0x110717){if(_0x110717){return _0x3b44d1[_0xf8f0('0x1a')](_0x37284f)[_0xf8f0('0x1c')](_0x110717);}};}function respondWithFilteredResult(_0x41af3a,_0xb44199){return function(_0x4636eb){if(_0x4636eb){var _0x48559b=typeof _0xb44199[_0xf8f0('0x1d')]===_0xf8f0('0x1e')&&typeof _0xb44199[_0xf8f0('0x1f')]==='undefined';var _0x2631c9=_0x4636eb[_0xf8f0('0x20')];var _0x4add1d=_0x48559b?0x0:_0xb44199['offset'];var _0x55e91f=_0x48559b?_0x4636eb[_0xf8f0('0x20')]:_0xb44199[_0xf8f0('0x1d')]+_0xb44199['limit'];var _0x5639c1;if(_0x55e91f>=_0x2631c9){_0x55e91f=_0x2631c9;_0x5639c1=0xc8;}else{_0x5639c1=0xce;}_0x41af3a[_0xf8f0('0x1a')](_0x5639c1);return _0x41af3a[_0xf8f0('0x21')](_0xf8f0('0x22'),_0x4add1d+'-'+_0x55e91f+'/'+_0x2631c9)['json'](_0x4636eb);}return null;};}function patchUpdates(_0x4323cf){return function(_0x1dad48){try{jsonpatch[_0xf8f0('0x23')](_0x1dad48,_0x4323cf,!![]);}catch(_0xa1fe18){return BPromise['reject'](_0xa1fe18);}return _0x1dad48[_0xf8f0('0x24')]();};}function saveUpdates(_0x322426,_0x37abc4){return function(_0x4f658e){if(_0x4f658e){return _0x4f658e['update'](_0x322426)[_0xf8f0('0x25')](function(_0x287c75){return _0x287c75;});}return null;};}function removeEntity(_0x17af9c,_0x5275de){return function(_0x44d2ec){if(_0x44d2ec){return _0x44d2ec[_0xf8f0('0x26')]()[_0xf8f0('0x25')](function(){var _0x1f5e17=_0x44d2ec[_0xf8f0('0x27')]({'plain':!![]});var _0x2b6953=_0xf8f0('0x28');return db[_0xf8f0('0x29')][_0xf8f0('0x26')]({'where':{'type':_0x2b6953,'resourceId':_0x1f5e17['id']}})[_0xf8f0('0x25')](function(){return _0x44d2ec;});})[_0xf8f0('0x25')](function(){_0x17af9c['status'](0xcc)[_0xf8f0('0x1b')]();});}};}function handleEntityNotFound(_0x146e12,_0x2887d5){return function(_0x5cc229){if(!_0x5cc229){_0x146e12[_0xf8f0('0x2a')](0x194);}return _0x5cc229;};}function handleError(_0x5d8392,_0x4cddd8){_0x4cddd8=_0x4cddd8||0x1f4;return function(_0xfe77ec){logger['error'](_0xfe77ec['stack']);if(_0xfe77ec['name']){delete _0xfe77ec['name'];}_0x5d8392[_0xf8f0('0x1a')](_0x4cddd8)[_0xf8f0('0x2b')](_0xfe77ec);};}exports[_0xf8f0('0x2c')]=function(_0x15c06c,_0x85d2f4){var _0x3b4bb6={},_0x21feee={},_0x57c63b={'count':0x0,'rows':[]};var _0x485826=_[_0xf8f0('0x2d')](db[_0xf8f0('0x2e')][_0xf8f0('0x2f')],function(_0x118a03){return{'name':_0x118a03[_0xf8f0('0x30')],'type':_0x118a03[_0xf8f0('0x31')]['key']};});_0x21feee[_0xf8f0('0x32')]=_[_0xf8f0('0x2d')](_0x485826,_0xf8f0('0x33'));_0x21feee[_0xf8f0('0x34')]=_[_0xf8f0('0x35')](_0x15c06c[_0xf8f0('0x34')]);_0x21feee[_0xf8f0('0x36')]=_['intersection'](_0x21feee[_0xf8f0('0x32')],_0x21feee['query']);_0x3b4bb6[_0xf8f0('0x37')]=_[_0xf8f0('0x38')](_0x21feee[_0xf8f0('0x32')],qs[_0xf8f0('0x39')](_0x15c06c[_0xf8f0('0x34')][_0xf8f0('0x39')]));_0x3b4bb6[_0xf8f0('0x37')]=_0x3b4bb6['attributes'][_0xf8f0('0x3a')]?_0x3b4bb6[_0xf8f0('0x37')]:_0x21feee[_0xf8f0('0x32')];if(!_0x15c06c['query']['hasOwnProperty'](_0xf8f0('0x3b'))){_0x3b4bb6[_0xf8f0('0x1f')]=qs[_0xf8f0('0x1f')](_0x15c06c['query'][_0xf8f0('0x1f')]);_0x3b4bb6[_0xf8f0('0x1d')]=qs[_0xf8f0('0x1d')](_0x15c06c[_0xf8f0('0x34')][_0xf8f0('0x1d')]);}_0x3b4bb6[_0xf8f0('0x3c')]=qs['sort'](_0x15c06c[_0xf8f0('0x34')][_0xf8f0('0x3d')]);_0x3b4bb6[_0xf8f0('0x3e')]=qs[_0xf8f0('0x36')](_['pick'](_0x15c06c[_0xf8f0('0x34')],_0x21feee[_0xf8f0('0x36')]),_0x485826);if(_0x15c06c[_0xf8f0('0x34')]['filter']){_0x3b4bb6[_0xf8f0('0x3e')]=_[_0xf8f0('0x3f')](_0x3b4bb6['where'],{'$or':_[_0xf8f0('0x2d')](_0x485826,function(_0x18ed3c){if(_0x18ed3c[_0xf8f0('0x31')]!==_0xf8f0('0x40')){var _0x22f0de={};_0x22f0de[_0x18ed3c[_0xf8f0('0x33')]]={'$like':'%'+_0x15c06c[_0xf8f0('0x34')][_0xf8f0('0x41')]+'%'};return _0x22f0de;}})});}_0x3b4bb6=_[_0xf8f0('0x3f')]({},_0x3b4bb6,_0x15c06c[_0xf8f0('0x42')]);var _0xca6786={'where':_0x3b4bb6[_0xf8f0('0x3e')]};return db['Pause'][_0xf8f0('0x20')](_0xca6786)[_0xf8f0('0x25')](function(_0x2c9f73){_0x57c63b['count']=_0x2c9f73;if(_0x15c06c['query'][_0xf8f0('0x43')]){_0x3b4bb6[_0xf8f0('0x44')]=[{'all':!![]}];}return db[_0xf8f0('0x2e')][_0xf8f0('0x45')](_0x3b4bb6);})['then'](function(_0x492604){_0x57c63b['rows']=_0x492604;return _0x57c63b;})[_0xf8f0('0x25')](respondWithFilteredResult(_0x85d2f4,_0x3b4bb6))[_0xf8f0('0x46')](handleError(_0x85d2f4,null));};exports[_0xf8f0('0x47')]=function(_0x49d11d,_0x514877){var _0x3b6a05={'raw':!![],'where':{'id':_0x49d11d['params']['id']}},_0x1db624={};_0x1db624[_0xf8f0('0x32')]=_['keys'](db['Pause'][_0xf8f0('0x2f')]);_0x1db624[_0xf8f0('0x34')]=_[_0xf8f0('0x35')](_0x49d11d[_0xf8f0('0x34')]);_0x1db624['filters']=_[_0xf8f0('0x38')](_0x1db624[_0xf8f0('0x32')],_0x1db624[_0xf8f0('0x34')]);_0x3b6a05[_0xf8f0('0x37')]=_[_0xf8f0('0x38')](_0x1db624['model'],qs[_0xf8f0('0x39')](_0x49d11d[_0xf8f0('0x34')]['fields']));_0x3b6a05[_0xf8f0('0x37')]=_0x3b6a05[_0xf8f0('0x37')][_0xf8f0('0x3a')]?_0x3b6a05['attributes']:_0x1db624[_0xf8f0('0x32')];if(_0x49d11d[_0xf8f0('0x34')]['includeAll']){_0x3b6a05[_0xf8f0('0x44')]=[{'all':!![]}];}_0x3b6a05=_[_0xf8f0('0x3f')]({},_0x3b6a05,_0x49d11d[_0xf8f0('0x42')]);return db['Pause']['find'](_0x3b6a05)[_0xf8f0('0x25')](handleEntityNotFound(_0x514877,null))[_0xf8f0('0x25')](respondWithResult(_0x514877,null))[_0xf8f0('0x46')](handleError(_0x514877,null));};exports[_0xf8f0('0x48')]=function(_0x4ba1a2,_0x4f189b){return db[_0xf8f0('0x2e')]['create'](_0x4ba1a2[_0xf8f0('0x49')],{})[_0xf8f0('0x25')](function(_0x4e27a){var _0x4ab2cd=_0x4ba1a2[_0xf8f0('0x4a')][_0xf8f0('0x27')]({'plain':!![]});if(!_0x4ab2cd)throw new Error(_0xf8f0('0x4b'));if(_0x4ab2cd[_0xf8f0('0x4c')]===_0xf8f0('0x4a')){var _0x226879=_0x4e27a[_0xf8f0('0x27')]({'plain':!![]});var _0x41b1c1=_0xf8f0('0x28');return db[_0xf8f0('0x4d')][_0xf8f0('0x4e')]({'where':{'name':_0x41b1c1,'userProfileId':_0x4ab2cd[_0xf8f0('0x4f')]},'raw':!![]})[_0xf8f0('0x25')](function(_0x3056db){if(_0x3056db&&_0x3056db[_0xf8f0('0x50')]===0x0){return db[_0xf8f0('0x29')]['create']({'name':_0x226879[_0xf8f0('0x33')],'resourceId':_0x226879['id'],'type':_0x3056db[_0xf8f0('0x33')],'sectionId':_0x3056db['id']},{})[_0xf8f0('0x25')](function(){return _0x4e27a;});}else{return _0x4e27a;}})[_0xf8f0('0x46')](function(_0x503692){logger['error'](_0xf8f0('0x51'),_0x503692);throw _0x503692;});}return _0x4e27a;})[_0xf8f0('0x25')](respondWithResult(_0x4f189b,0xc9))[_0xf8f0('0x46')](handleError(_0x4f189b,null));};exports[_0xf8f0('0x52')]=function(_0x2b8d59,_0x4c995d){if(_0x2b8d59[_0xf8f0('0x49')]['id']){delete _0x2b8d59[_0xf8f0('0x49')]['id'];}return db['Pause'][_0xf8f0('0x4e')]({'where':{'id':_0x2b8d59['params']['id']}})['then'](handleEntityNotFound(_0x4c995d,null))[_0xf8f0('0x25')](saveUpdates(_0x2b8d59[_0xf8f0('0x49')],null))[_0xf8f0('0x25')](respondWithResult(_0x4c995d,null))['catch'](handleError(_0x4c995d,null));};exports[_0xf8f0('0x26')]=function(_0x35094f,_0x2226a2){return db[_0xf8f0('0x2e')][_0xf8f0('0x4e')]({'where':{'id':_0x35094f[_0xf8f0('0x53')]['id']}})[_0xf8f0('0x25')](handleEntityNotFound(_0x2226a2,null))[_0xf8f0('0x25')](removeEntity(_0x2226a2,null))[_0xf8f0('0x46')](handleError(_0x2226a2,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index ac7123e..faa5ffd 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0x5ca644,_0x3d2165){var _0x5c87a2=function(_0x3dc7d9){while(--_0x3dc7d9){_0x5ca644['push'](_0x5ca644['shift']());}};_0x5c87a2(++_0x3d2165);}(_0xabce,0x103));var _0xeabc=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xabce[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Pause',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x5b1df4,_0x32a859){var _0x3f1fe8=function(_0x4c8ca2){while(--_0x4c8ca2){_0x5b1df4['push'](_0x5b1df4['shift']());}};_0x3f1fe8(++_0x32a859);}(_0x1cb9,0x14e));var _0x91cb=function(_0x210913,_0x4694d6){_0x210913=_0x210913-0x0;var _0x580bc2=_0x1cb9[_0x210913];return _0x580bc2;};'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 diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index c4ccce2..06f613d 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(_0x374f0e,_0x2d00a9){var _0x58c96a=function(_0x5c0376){while(--_0x5c0376){_0x374f0e['push'](_0x374f0e['shift']());}};_0x58c96a(++_0x2d00a9);}(_0xb10b,0x12a));var _0xbb10=function(_0x431ae1,_0x385f06){_0x431ae1=_0x431ae1-0x0;var _0x27fcbd=_0xb10b[_0x431ae1];return _0x27fcbd;};'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(_0x28ecd3,_0x167170){var _0x55e716=function(_0x224322){while(--_0x224322){_0x28ecd3['push'](_0x28ecd3['shift']());}};_0x55e716(++_0x167170);}(_0xb10b,0x12a));var _0xbb10=function(_0x57a430,_0x281e18){_0x57a430=_0x57a430-0x0;var _0x533e30=_0xb10b[_0x57a430];return _0x533e30;};'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 59b79d9..1218f43 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 _0x9b67=['../../components/auth/service','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','upload','post','webhookPost','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9b67,0xf6));var _0x79b6=function(_0x4b11a7,_0x545c90){_0x4b11a7=_0x4b11a7-0x0;var _0x4c944b=_0x9b67[_0x4b11a7];return _0x4c944b;};'use strict';var multer=require(_0x79b6('0x0'));var util=require(_0x79b6('0x1'));var path=require(_0x79b6('0x2'));var timeout=require(_0x79b6('0x3'));var express=require(_0x79b6('0x4'));var router=express['Router']();var fs_extra=require(_0x79b6('0x5'));var auth=require(_0x79b6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x79b6('0x7'));router[_0x79b6('0x8')]('/',auth[_0x79b6('0x9')](),controller[_0x79b6('0xa')]);router[_0x79b6('0x8')](_0x79b6('0xb'),controller[_0x79b6('0xc')]);router['get'](_0x79b6('0xd'),auth[_0x79b6('0x9')](),controller[_0x79b6('0xe')]);router[_0x79b6('0x8')](_0x79b6('0xf'),auth['isAuthenticated'](),controller[_0x79b6('0x10')]);var upload=multer({'storage':multer[_0x79b6('0x11')]({'destination':function(_0x3f3b44,_0x301f13,_0x58a98b){_0x58a98b(null,path['join'](config[_0x79b6('0x12')],_0x79b6('0x13')));},'filename':function(_0x303cfb,_0x526727,_0xc05a77){_0x526727[_0x79b6('0x14')]=_0x526727[_0x79b6('0x14')][_0x79b6('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xc05a77(null,util[_0x79b6('0x16')](_0x79b6('0x17'),path[_0x79b6('0x18')](_0x526727[_0x79b6('0x14')],path[_0x79b6('0x19')](_0x526727[_0x79b6('0x14')])),Date[_0x79b6('0x1a')](),path[_0x79b6('0x19')](_0x526727[_0x79b6('0x14')])));}})});router['post']('/',upload[_0x79b6('0x1b')](_0x79b6('0x1c')),controller[_0x79b6('0x1d')]);router[_0x79b6('0x1e')](_0x79b6('0xb'),controller[_0x79b6('0x1f')]);router[_0x79b6('0x20')](_0x79b6('0xd'),auth[_0x79b6('0x9')](),controller[_0x79b6('0x21')]);router[_0x79b6('0x22')](_0x79b6('0xd'),auth[_0x79b6('0x9')](),controller['delete']);module[_0x79b6('0x23')]=router; \ No newline at end of file +var _0xbd50=['extname','post','single','upload','webhookPost','put','/:id','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/webhook','webhookGet','show','download','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename'];(function(_0xc6e86,_0x2e17d0){var _0x5f0d0c=function(_0x38ca85){while(--_0x38ca85){_0xc6e86['push'](_0xc6e86['shift']());}};_0x5f0d0c(++_0x2e17d0);}(_0xbd50,0x196));var _0x0bd5=function(_0x4dc770,_0x362b51){_0x4dc770=_0x4dc770-0x0;var _0x4ccc4d=_0xbd50[_0x4dc770];return _0x4ccc4d;};'use strict';var multer=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var path=require(_0x0bd5('0x2'));var timeout=require('connect-timeout');var express=require(_0x0bd5('0x3'));var router=express[_0x0bd5('0x4')]();var fs_extra=require(_0x0bd5('0x5'));var auth=require(_0x0bd5('0x6'));var interaction=require(_0x0bd5('0x7'));var config=require('../../config/environment');var controller=require('./plugin.controller');router['get']('/',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x9')]);router[_0x0bd5('0xa')](_0x0bd5('0xb'),controller[_0x0bd5('0xc')]);router['get']('/:id',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0xd')]);router[_0x0bd5('0xa')]('/:id/download',auth[_0x0bd5('0x8')](),controller[_0x0bd5('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x210f45,_0x7db86e,_0x4d7d17){_0x4d7d17(null,path[_0x0bd5('0xf')](config[_0x0bd5('0x10')],_0x0bd5('0x11')));},'filename':function(_0x5f49ee,_0x2f7a0c,_0x23982f){_0x2f7a0c[_0x0bd5('0x12')]=_0x2f7a0c[_0x0bd5('0x12')][_0x0bd5('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x23982f(null,util[_0x0bd5('0x14')](_0x0bd5('0x15'),path[_0x0bd5('0x16')](_0x2f7a0c['originalname'],path[_0x0bd5('0x17')](_0x2f7a0c[_0x0bd5('0x12')])),Date['now'](),path[_0x0bd5('0x17')](_0x2f7a0c[_0x0bd5('0x12')])));}})});router[_0x0bd5('0x18')]('/',upload[_0x0bd5('0x19')]('file'),controller[_0x0bd5('0x1a')]);router[_0x0bd5('0x18')](_0x0bd5('0xb'),controller[_0x0bd5('0x1b')]);router[_0x0bd5('0x1c')](_0x0bd5('0x1d'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x1e')]);router[_0x0bd5('0x1f')](_0x0bd5('0x1d'),auth[_0x0bd5('0x8')](),controller[_0x0bd5('0x1f')]);module[_0x0bd5('0x20')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 0930ebe..cee17ac 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 _0x74f6=['exports','ENUM','html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','sequelize'];(function(_0x317197,_0x166a82){var _0x43b307=function(_0x44de71){while(--_0x44de71){_0x317197['push'](_0x317197['shift']());}};_0x43b307(++_0x166a82);}(_0x74f6,0x107));var _0x674f=function(_0x5f42e8,_0x437358){_0x5f42e8=_0x5f42e8-0x0;var _0x5a700a=_0x74f6[_0x5f42e8];return _0x5a700a;};'use strict';var Sequelize=require(_0x674f('0x0'));module[_0x674f('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x674f('0x2')](_0x674f('0x3'),_0x674f('0x4'))},'description':{'type':Sequelize[_0x674f('0x5')]},'version':{'type':Sequelize[_0x674f('0x5')]},'path':{'type':Sequelize[_0x674f('0x6')],'comment':_0x674f('0x7')},'active':{'type':Sequelize[_0x674f('0x8')],'defaultValue':0x0,'comment':_0x674f('0x9')},'sidebar':{'type':Sequelize[_0x674f('0x2')](_0x674f('0xa'),'agentOnly',_0x674f('0xb'),'never'),'defaultValue':_0x674f('0xb'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x674f('0x6')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x674f('0x6')]},'scriptPath':{'type':Sequelize[_0x674f('0x6')]}}; \ No newline at end of file +var _0xbae1=['BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xbae1,0x65));var _0x1bae=function(_0x44c883,_0x1f3da4){_0x44c883=_0x44c883-0x0;var _0x337347=_0xbae1[_0x44c883];return _0x337347;};'use strict';var Sequelize=require(_0x1bae('0x0'));module[_0x1bae('0x1')]={'name':{'type':Sequelize[_0x1bae('0x2')]},'type':{'type':Sequelize[_0x1bae('0x3')]('html',_0x1bae('0x4'))},'description':{'type':Sequelize[_0x1bae('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x1bae('0x2')],'comment':_0x1bae('0x6')},'active':{'type':Sequelize[_0x1bae('0x7')],'defaultValue':0x0,'comment':_0x1bae('0x8')},'sidebar':{'type':Sequelize[_0x1bae('0x3')]('adminOnly','agentOnly',_0x1bae('0x9'),_0x1bae('0xa')),'defaultValue':_0x1bae('0x9'),'comment':_0x1bae('0xb')},'icon':{'type':Sequelize[_0x1bae('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x1bae('0x2')]},'scriptName':{'type':Sequelize[_0x1bae('0x2')]},'scriptPath':{'type':Sequelize[_0x1bae('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index a642318..0404432 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 _0x6779=['json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','Plugins','end','stack','name','Plugin','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','findAll','catch','show','params','keys','includeAll','find','path','join','root','server/files/plugins','createWriteStream','zip','warning','code','ENOENT','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','download','format','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','icon','icon-apps','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','statusCode','webhookPost','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','rimraf','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status'];(function(_0x4e1854,_0x42a3ba){var _0x385daa=function(_0x9313fa){while(--_0x9313fa){_0x4e1854['push'](_0x4e1854['shift']());}};_0x385daa(++_0x42a3ba);}(_0x6779,0x1e3));var _0x9677=function(_0x176d3e,_0x1fcb7c){_0x176d3e=_0x176d3e-0x0;var _0x9983af=_0x6779[_0x176d3e];return _0x9983af;};'use strict';var emlformat=require(_0x9677('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9677('0x1'));var jsonpatch=require(_0x9677('0x2'));var rp=require(_0x9677('0x3'));var moment=require(_0x9677('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9677('0x5'));var util=require(_0x9677('0x6'));var path=require('path');var sox=require(_0x9677('0x7'));var csv=require(_0x9677('0x8'));var ejs=require(_0x9677('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9677('0xa'));var squel=require('squel');var crypto=require(_0x9677('0xb'));var jsforce=require(_0x9677('0xc'));var deskjs=require(_0x9677('0xd'));var toCsv=require(_0x9677('0x8'));var querystring=require(_0x9677('0xe'));var Papa=require(_0x9677('0xf'));var extract=require(_0x9677('0x10'));var rimraf=require(_0x9677('0x11'));var archiver=require('archiver');var Redis=require('ioredis');var authService=require(_0x9677('0x12'));var qs=require(_0x9677('0x13'));var as=require(_0x9677('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9677('0x15'))(_0x9677('0x16'));var utils=require(_0x9677('0x17'));var config=require(_0x9677('0x18'));var licenseUtil=require(_0x9677('0x19'));var db=require(_0x9677('0x1a'))['db'];config[_0x9677('0x1b')]=_[_0x9677('0x1c')](config[_0x9677('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x9677('0x1d'))(new Redis(config['redis']));require('./plugin.socket')[_0x9677('0x1e')](socket);function respondWithStatusCode(_0x4dca27,_0x34f5e4){_0x34f5e4=_0x34f5e4||0xcc;return function(_0x4097e8){if(_0x4097e8){return _0x4dca27[_0x9677('0x1f')](_0x34f5e4);}return _0x4dca27['status'](_0x34f5e4)['end']();};}function respondWithResult(_0x4e4f56,_0x21f17d){_0x21f17d=_0x21f17d||0xc8;return function(_0x594368){if(_0x594368){return _0x4e4f56[_0x9677('0x20')](_0x21f17d)[_0x9677('0x21')](_0x594368);}};}function respondWithFilteredResult(_0x3e0ea9,_0x57cce2){return function(_0x57d58){if(_0x57d58){var _0x3a97fa=typeof _0x57cce2[_0x9677('0x22')]==='undefined'&&typeof _0x57cce2[_0x9677('0x23')]===_0x9677('0x24');var _0x2e72ab=_0x57d58['count'];var _0x515de8=_0x3a97fa?0x0:_0x57cce2['offset'];var _0x5d543b=_0x3a97fa?_0x57d58[_0x9677('0x25')]:_0x57cce2['offset']+_0x57cce2['limit'];var _0xcf5374;if(_0x5d543b>=_0x2e72ab){_0x5d543b=_0x2e72ab;_0xcf5374=0xc8;}else{_0xcf5374=0xce;}_0x3e0ea9[_0x9677('0x20')](_0xcf5374);return _0x3e0ea9[_0x9677('0x26')](_0x9677('0x27'),_0x515de8+'-'+_0x5d543b+'/'+_0x2e72ab)[_0x9677('0x21')](_0x57d58);}return null;};}function patchUpdates(_0x552aa0){return function(_0x4bccab){try{jsonpatch[_0x9677('0x28')](_0x4bccab,_0x552aa0,!![]);}catch(_0x326c16){return BPromise['reject'](_0x326c16);}return _0x4bccab[_0x9677('0x29')]();};}function saveUpdates(_0x563064,_0x4fa3eb){return function(_0x30b8af){if(_0x30b8af){return _0x30b8af[_0x9677('0x2a')](_0x563064)[_0x9677('0x2b')](function(_0x560946){return _0x560946;});}return null;};}function removeEntity(_0x37d0a2,_0x5ca6a4){return function(_0x5815c7){if(_0x5815c7){return _0x5815c7[_0x9677('0x2c')]()['then'](function(){var _0x554ca1=_0x5815c7[_0x9677('0x2d')]({'plain':!![]});var _0xa21738=_0x9677('0x2e');return db['UserProfileResource'][_0x9677('0x2c')]({'where':{'type':_0xa21738,'resourceId':_0x554ca1['id']}})[_0x9677('0x2b')](function(){return _0x5815c7;});})['then'](function(){_0x37d0a2[_0x9677('0x20')](0xcc)[_0x9677('0x2f')]();});}};}function handleEntityNotFound(_0xd4d85e,_0x3c138a){return function(_0x57dbf5){if(!_0x57dbf5){_0xd4d85e[_0x9677('0x1f')](0x194);}return _0x57dbf5;};}function handleError(_0x228080,_0x4ad6cf){_0x4ad6cf=_0x4ad6cf||0x1f4;return function(_0x15380c){logger['error'](_0x15380c[_0x9677('0x30')]);if(_0x15380c[_0x9677('0x31')]){delete _0x15380c[_0x9677('0x31')];}_0x228080[_0x9677('0x20')](_0x4ad6cf)['send'](_0x15380c);};}exports['index']=function(_0x2d4fce,_0x39c84d){var _0x372a12={},_0x2b8cef={},_0x3b89b5={'count':0x0,'rows':[]};var _0xe30454=_['map'](db[_0x9677('0x32')][_0x9677('0x33')],function(_0x44db6b){return{'name':_0x44db6b[_0x9677('0x34')],'type':_0x44db6b[_0x9677('0x35')][_0x9677('0x36')]};});_0x2b8cef[_0x9677('0x37')]=_[_0x9677('0x38')](_0xe30454,_0x9677('0x31'));_0x2b8cef[_0x9677('0x39')]=_['keys'](_0x2d4fce[_0x9677('0x39')]);_0x2b8cef[_0x9677('0x3a')]=_[_0x9677('0x3b')](_0x2b8cef[_0x9677('0x37')],_0x2b8cef[_0x9677('0x39')]);_0x372a12[_0x9677('0x3c')]=_['intersection'](_0x2b8cef['model'],qs[_0x9677('0x3d')](_0x2d4fce[_0x9677('0x39')][_0x9677('0x3d')]));_0x372a12['attributes']=_0x372a12[_0x9677('0x3c')][_0x9677('0x3e')]?_0x372a12[_0x9677('0x3c')]:_0x2b8cef[_0x9677('0x37')];if(!_0x2d4fce[_0x9677('0x39')]['hasOwnProperty'](_0x9677('0x3f'))){_0x372a12[_0x9677('0x23')]=qs['limit'](_0x2d4fce[_0x9677('0x39')][_0x9677('0x23')]);_0x372a12['offset']=qs[_0x9677('0x22')](_0x2d4fce['query'][_0x9677('0x22')]);}_0x372a12[_0x9677('0x40')]=qs[_0x9677('0x41')](_0x2d4fce[_0x9677('0x39')][_0x9677('0x41')]);_0x372a12[_0x9677('0x42')]=qs[_0x9677('0x3a')](_['pick'](_0x2d4fce[_0x9677('0x39')],_0x2b8cef[_0x9677('0x3a')]),_0xe30454);if(_0x2d4fce['query'][_0x9677('0x43')]){_0x372a12['where']=_[_0x9677('0x44')](_0x372a12['where'],{'$or':_[_0x9677('0x38')](_0xe30454,function(_0x5b574b){if(_0x5b574b[_0x9677('0x35')]!==_0x9677('0x45')){var _0x53b785={};_0x53b785[_0x5b574b['name']]={'$like':'%'+_0x2d4fce[_0x9677('0x39')]['filter']+'%'};return _0x53b785;}})});}_0x372a12=_[_0x9677('0x44')]({},_0x372a12,_0x2d4fce[_0x9677('0x46')]);var _0xf9c99={'where':_0x372a12['where']};return db[_0x9677('0x32')][_0x9677('0x25')](_0xf9c99)[_0x9677('0x2b')](function(_0xa520cd){_0x3b89b5[_0x9677('0x25')]=_0xa520cd;if(_0x2d4fce['query']['includeAll']){_0x372a12['include']=[{'all':!![]}];}return db['Plugin'][_0x9677('0x47')](_0x372a12);})[_0x9677('0x2b')](function(_0x55b844){_0x3b89b5['rows']=_0x55b844;return _0x3b89b5;})[_0x9677('0x2b')](respondWithFilteredResult(_0x39c84d,_0x372a12))[_0x9677('0x48')](handleError(_0x39c84d,null));};exports[_0x9677('0x49')]=function(_0x3125c2,_0x3d7113){var _0x10be09={'raw':!![],'where':{'id':_0x3125c2[_0x9677('0x4a')]['id']}},_0x3a2831={};_0x3a2831[_0x9677('0x37')]=_[_0x9677('0x4b')](db[_0x9677('0x32')][_0x9677('0x33')]);_0x3a2831['query']=_[_0x9677('0x4b')](_0x3125c2[_0x9677('0x39')]);_0x3a2831[_0x9677('0x3a')]=_[_0x9677('0x3b')](_0x3a2831[_0x9677('0x37')],_0x3a2831['query']);_0x10be09[_0x9677('0x3c')]=_[_0x9677('0x3b')](_0x3a2831[_0x9677('0x37')],qs[_0x9677('0x3d')](_0x3125c2[_0x9677('0x39')][_0x9677('0x3d')]));_0x10be09[_0x9677('0x3c')]=_0x10be09[_0x9677('0x3c')][_0x9677('0x3e')]?_0x10be09[_0x9677('0x3c')]:_0x3a2831[_0x9677('0x37')];if(_0x3125c2['query'][_0x9677('0x4c')]){_0x10be09['include']=[{'all':!![]}];}_0x10be09=_[_0x9677('0x44')]({},_0x10be09,_0x3125c2[_0x9677('0x46')]);return db['Plugin'][_0x9677('0x4d')](_0x10be09)[_0x9677('0x2b')](handleEntityNotFound(_0x3d7113,null))[_0x9677('0x2b')](respondWithResult(_0x3d7113,null))['catch'](handleError(_0x3d7113,null));};exports['download']=function(_0x4602c9,_0x1e3d17,_0x33940a){return db['Plugin']['find']({'where':{'id':_0x4602c9[_0x9677('0x4a')]['id']},'attributes':[_0x9677('0x31'),_0x9677('0x4e')],'raw':!![]})[_0x9677('0x2b')](handleEntityNotFound(_0x1e3d17,null))[_0x9677('0x2b')](function(_0x311b6a){if(_0x311b6a){var _0x62cfc9=path[_0x9677('0x4f')](config[_0x9677('0x50')],_0x9677('0x51'),util['format']('%s.zip',path['basename'](_0x311b6a[_0x9677('0x4e')])));var _0x247cd2=fs[_0x9677('0x52')](_0x62cfc9);var _0x1510da=archiver(_0x9677('0x53'),{'zlib':{'level':0x9}});_0x1510da['on'](_0x9677('0x54'),function(_0xfb1795){if(_0xfb1795[_0x9677('0x55')]===_0x9677('0x56')){logger[_0x9677('0x57')](_0xfb1795);}else{throw new db[(_0x9677('0x58'))][(_0x9677('0x59'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x1510da['on'](_0x9677('0x57'),function(_0x356c47){throw new db['Sequelize'][(_0x9677('0x59'))](_0x9677('0x5a'));});_0x1510da[_0x9677('0x5b')](_0x247cd2);_0x1510da[_0x9677('0x5c')](_0x9677('0x5d'),{'cwd':path[_0x9677('0x4f')](config[_0x9677('0x50')],_0x9677('0x51'),path[_0x9677('0x5e')](_0x311b6a[_0x9677('0x4e')])),'ignore':[path['join'](path[_0x9677('0x5f')](_0x311b6a['path']),_0x9677('0x60')),path[_0x9677('0x4f')](path['basename'](_0x311b6a['path']),_0x9677('0x61'))],'nodir':!![]})[_0x9677('0x62')]();_0x247cd2['on'](_0x9677('0x63'),function(){if(!fs[_0x9677('0x64')](_0x62cfc9)){throw new db[(_0x9677('0x58'))][(_0x9677('0x59'))](_0x9677('0x65'));}return _0x1e3d17[_0x9677('0x66')](_0x62cfc9,util[_0x9677('0x67')](_0x9677('0x68'),path['basename'](_0x311b6a[_0x9677('0x4e')])),function(_0x25ba27){if(_0x25ba27){throw new db[(_0x9677('0x58'))][(_0x9677('0x59'))](_0x9677('0x69'));}fs[_0x9677('0x6a')](_0x62cfc9);logger[_0x9677('0x6b')](_0x9677('0x6c'));logger[_0x9677('0x6b')](_0x9677('0x6d'));});});}return null;})['catch'](handleError(_0x1e3d17,null));};exports[_0x9677('0x6e')]=function(_0x3079e2,_0x2d1e16,_0x1c4496){var _0x5e3f96=path[_0x9677('0x5f')](_0x3079e2[_0x9677('0x6f')][_0x9677('0x70')],path['extname'](_0x3079e2[_0x9677('0x6f')][_0x9677('0x70')]));var _0x103630=path[_0x9677('0x4f')](config['root'],_0x9677('0x51'),_0x3079e2[_0x9677('0x6f')][_0x9677('0x70')]);var _0x31765d=path['join'](config[_0x9677('0x50')],_0x9677('0x51'),_0x5e3f96);logger[_0x9677('0x6b')](_0x9677('0x71'),_0x103630);logger[_0x9677('0x6b')](_0x9677('0x72'),_0x31765d);try{fs[_0x9677('0x73')](_0x103630,parseInt(_0x9677('0x74'),0x8));extract(_0x103630,{'dir':_0x31765d},function(_0x422856){if(_0x422856){logger[_0x9677('0x57')](_0x422856);handleError(_0x422856,!![]);};var _0x165628=fs[_0x9677('0x75')](_0x31765d);if(_0x165628['length']>0x1){removeReferences(_0x103630,_0x31765d);logger[_0x9677('0x57')](_0x9677('0x76'));return _0x1c4496(new Error('Invalid\x20plugin\x20structure'));}var _0x5a7205=fs['lstatSync'](path[_0x9677('0x4f')](_0x31765d,_0x165628[0x0]));if(_0x5a7205['isFile']()){removeReferences(_0x103630,_0x31765d);logger[_0x9677('0x57')](_0x9677('0x76'));return _0x1c4496(new Error(_0x9677('0x76')));}if(_0x5a7205['isDirectory']()){var _0x158010=fs[_0x9677('0x75')](path[_0x9677('0x4f')](_0x31765d,_0x165628[0x0]));if(_0x158010[_0x9677('0x3e')]===0x0){removeReferences(_0x103630,_0x31765d);logger[_0x9677('0x57')](_0x9677('0x76'));return _0x1c4496(new Error(_0x9677('0x76')));}var _0x3e023e=_0x158010[_0x9677('0x77')](function(_0xc3aa24){return _0xc3aa24===_0x9677('0x78');});if(!_0x3e023e){return _0x1c4496(new Error(_0x9677('0x79')));}var _0x368758=fs[_0x9677('0x7a')](path[_0x9677('0x4f')](_0x31765d,_0x165628[0x0],_0x9677('0x78')));var _0x594b90=JSON[_0x9677('0x7b')](_0x368758);if(_0x9677('0x24')==typeof _0x594b90[_0x9677('0x31')]){return _0x1c4496(new Error(_0x9677('0x7c')));}if(_0x9677('0x24')==typeof _0x594b90['type']){return _0x1c4496(new Error(_0x9677('0x7d')));}if(_0x9677('0x24')==typeof _0x594b90[_0x9677('0x7e')]){return _0x1c4496(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x9677('0x24')==typeof _0x594b90['parameters']){return _0x1c4496(new Error(_0x9677('0x7f')));}if(_0x594b90[_0x9677('0x35')]===_0x9677('0x80')){if(_0x9677('0x24')==typeof _0x594b90[_0x9677('0x81')][_0x9677('0x82')]){return _0x1c4496(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x9677('0x24')==typeof _0x594b90[_0x9677('0x81')]['views']['admin']&&_0x9677('0x24')==typeof _0x594b90[_0x9677('0x81')]['views'][_0x9677('0x83')]){return _0x1c4496(new Error(_0x9677('0x84')));}}else if(_0x594b90['type']==='script'){if(_0x9677('0x24')==typeof _0x594b90[_0x9677('0x81')]['scriptName']){return _0x1c4496(new Error(_0x9677('0x85')));}if(_0x9677('0x24')==typeof _0x594b90[_0x9677('0x81')][_0x9677('0x86')]){return _0x1c4496(new Error(_0x9677('0x87')));}}else{return _0x1c4496(new Error(_0x9677('0x88')));}var _0x19ad6b=_0x594b90[_0x9677('0x31')];var _0x586b57=_0x594b90['description'];var _0x19feac=_0x594b90['type'];var _0x281c27=_0x594b90[_0x9677('0x89')]?_0x594b90[_0x9677('0x89')]:'always';var _0xc7f741=_0x594b90[_0x9677('0x8a')]?_0x594b90[_0x9677('0x8a')]:_0x9677('0x8b');var _0x160fd8='';var _0xd59841='';var _0x34f334='';var _0x58b6c0='';var _0x3f6199=_0x594b90[_0x9677('0x7e')];if(_0x19feac===_0x9677('0x80')){if(_0x9677('0x24')!=typeof _0x594b90[_0x9677('0x81')]['views'][_0x9677('0x8c')]){var _0x4444a0=_0x594b90['parameters'][_0x9677('0x82')][_0x9677('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0x9677('0x8d')](_0x4444a0)){_0x160fd8=path['join'](_0x9677('0x8e'),_0x5e3f96,_0x165628[0x0],_0x4444a0);}else{_0x160fd8=_0x4444a0;}}else{logger[_0x9677('0x6b')](_0x9677('0x8f'));}if(_0x9677('0x24')!=typeof _0x594b90[_0x9677('0x81')][_0x9677('0x82')][_0x9677('0x83')]){var _0x2ee20d=_0x594b90['parameters']['views'][_0x9677('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x2ee20d)){_0xd59841=path[_0x9677('0x4f')]('plugins',_0x5e3f96,_0x165628[0x0],_0x2ee20d);}else{_0xd59841=_0x2ee20d;}}else{logger[_0x9677('0x6b')](_0x9677('0x90'));}}else if(_0x19feac==='script'){_0x34f334=_0x594b90['parameters'][_0x9677('0x91')];_0x58b6c0=_0x594b90[_0x9677('0x81')][_0x9677('0x86')];if(_0x9677('0x24')!=typeof _0x594b90['parameters'][_0x9677('0x82')]){if(_0x9677('0x24')!=typeof _0x594b90[_0x9677('0x81')][_0x9677('0x82')]['admin']){var _0x4444a0=_0x594b90[_0x9677('0x81')][_0x9677('0x82')][_0x9677('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0x9677('0x8d')](_0x4444a0)){_0x160fd8=path['join'](_0x9677('0x8e'),_0x5e3f96,_0x165628[0x0],_0x4444a0);}else{_0x160fd8=_0x4444a0;}}if(_0x9677('0x24')!=typeof _0x594b90[_0x9677('0x81')][_0x9677('0x82')][_0x9677('0x83')]){var _0x2ee20d=_0x594b90[_0x9677('0x81')][_0x9677('0x82')][_0x9677('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x2ee20d)){_0xd59841=path[_0x9677('0x4f')]('plugins',_0x5e3f96,_0x165628[0x0],_0x2ee20d);}else{_0xd59841=_0x2ee20d;}}}}var _0x53b129={'name':_0x19ad6b,'description':_0x586b57,'path':path[_0x9677('0x4f')](_0x5e3f96,_0x165628[0x0]),'type':_0x19feac,'sidebar':_0x281c27,'icon':_0xc7f741,'adminUrl':_0x160fd8,'agentUrl':_0xd59841,'scriptName':_0x34f334,'scriptPath':_0x58b6c0,'version':_0x3f6199};removeReferences(_0x103630,null);return db['Plugin'][_0x9677('0x92')](_0x53b129)['then'](function(_0x4a869c){var _0x3197af={'role':_0x3079e2['body'][_0x9677('0x93')],'userProfileId':_0x3079e2[_0x9677('0x94')][_0x9677('0x95')]};if(!_0x3197af)throw new Error(_0x9677('0x96'));if(_0x3197af[_0x9677('0x93')]===_0x9677('0x97')){var _0x18a5d7=_0x4a869c[_0x9677('0x2d')]({'plain':!![]});return db[_0x9677('0x98')]['find']({'where':{'name':_0x9677('0x2e'),'userProfileId':_0x3197af[_0x9677('0x95')]},'raw':!![]})[_0x9677('0x2b')](function(_0x20a8a5){if(_0x20a8a5&&_0x20a8a5[_0x9677('0x99')]===0x0){return db[_0x9677('0x9a')]['create']({'name':_0x18a5d7[_0x9677('0x31')],'resourceId':_0x18a5d7['id'],'type':_0x20a8a5['name'],'sectionId':_0x20a8a5['id']},{})['then'](function(){return _0x4a869c;});}else{return _0x4a869c;}})[_0x9677('0x48')](function(_0x901658){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x901658);throw _0x901658;});}return _0x4a869c;})[_0x9677('0x2b')](respondWithResult(_0x2d1e16,null))[_0x9677('0x48')](handleError(_0x2d1e16,null));}});}catch(_0x3342e2){_0x2d1e16[_0x9677('0x20')](0x1f4)[_0x9677('0x9b')](_0x3342e2);}};function removeReferences(_0x148d7f,_0x1e7ee6){try{if(_0x148d7f){fs[_0x9677('0x6a')](_0x148d7f);logger[_0x9677('0x6b')](_0x9677('0x9c'));}if(_0x1e7ee6){rimraf(_0x1e7ee6,function(){});logger[_0x9677('0x6b')](_0x9677('0x9d'));}}catch(_0x41d665){logger[_0x9677('0x57')](_0x41d665);}}exports[_0x9677('0x2a')]=function(_0x5e32b8,_0x15e438,_0x19ec95){return db[_0x9677('0x32')][_0x9677('0x4d')]({'where':{'id':_0x5e32b8[_0x9677('0x4a')]['id']}})[_0x9677('0x2b')](handleEntityNotFound(_0x15e438,null))[_0x9677('0x2b')](saveUpdates(_0x5e32b8['body'],null))[_0x9677('0x2b')](respondWithResult(_0x15e438,null))[_0x9677('0x48')](handleError(_0x15e438,null));};exports['delete']=function(_0xc0b28c,_0x3ef047,_0x1d0621){return db[_0x9677('0x32')][_0x9677('0x4d')]({'where':{'id':_0xc0b28c[_0x9677('0x4a')]['id']}})[_0x9677('0x2b')](function(_0x5a4928){if(_0x5a4928){return _0x5a4928[_0x9677('0x2c')]();}})['then'](function(_0x5f5782){rimraf(path[_0x9677('0x4f')](config['root'],_0x9677('0x51'),path[_0x9677('0x5e')](_0x5f5782['path'])),function(){});return _0x5f5782;})[_0x9677('0x2b')](handleEntityNotFound(_0x3ef047,null))['then'](respondWithStatusCode(_0x3ef047,null))[_0x9677('0x48')](handleError(_0x3ef047,null));};exports['webhookGet']=function(_0x596434,_0x4f4013,_0x5628a9){return BPromise['resolve']()['then'](function(){if(!_0x596434['query'][_0x9677('0x4e')]){throw new Error(_0x9677('0x9e'));}if(!_0x596434[_0x9677('0x39')][_0x9677('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x3838a1=_0x596434[_0x9677('0x39')]['hostname']?_0x596434[_0x9677('0x39')][_0x9677('0xa0')]+':'+_0x596434['query'][_0x9677('0x9f')]:_0x9677('0xa1')+_0x596434[_0x9677('0x39')][_0x9677('0x9f')];var _0x3bb5e4=_0x596434[_0x9677('0x39')][_0x9677('0x21')]?_0x596434['query'][_0x9677('0x21')]:!![];var _0x3a6861=_0x596434[_0x9677('0x39')][_0x9677('0xa2')]?_0x596434[_0x9677('0x39')][_0x9677('0xa2')]:null;var _0x319cab={'method':_0x596434[_0x9677('0xa3')],'uri':util[_0x9677('0x67')](_0x9677('0xa4'),_0x3838a1,_0x596434['query'][_0x9677('0x4e')]),'json':_0x3bb5e4,'resolveWithFullResponse':!![],'encoding':_0x3a6861,'qs':_0x596434['query']};if(_0x596434[_0x9677('0xa5')]){_0x319cab[_0x9677('0xa5')]=_0x596434[_0x9677('0xa5')];if(_0x319cab[_0x9677('0xa5')][_0x9677('0xa6')]){delete _0x319cab[_0x9677('0xa5')]['content-length'];}}if(_0x319cab[_0x9677('0xa5')][_0x9677('0xa7')]){delete _0x319cab['headers'][_0x9677('0xa7')];}return rp(_0x319cab);})[_0x9677('0x2b')](function(_0x391f5b){if(_0x391f5b){_0x4f4013[_0x9677('0x26')](_0x391f5b['headers']);logger['info'](_0x391f5b['body']);if(_['endsWith'](_0x596434[_0x9677('0x39')][_0x9677('0x4e')],_0x9677('0x66'))&&_0x391f5b[_0x9677('0xa8')]==0x1f4){return _0x4f4013[_0x9677('0x1f')](_0x391f5b[_0x9677('0xa8')]);}else{return _0x4f4013[_0x9677('0x20')](_0x391f5b[_0x9677('0xa8')])[_0x9677('0x9b')](_0x391f5b[_0x9677('0x94')]);}}else{return _0x4f4013['sendStatus'](0xc8);}})[_0x9677('0x48')](handleError(_0x4f4013,null));};exports[_0x9677('0xa9')]=function(_0x7e1b24,_0x5fb10f,_0xbab0fa){return BPromise[_0x9677('0xaa')]()[_0x9677('0x2b')](function(){if(!_0x7e1b24[_0x9677('0x39')][_0x9677('0x4e')]){throw new Error(_0x9677('0x9e'));}if(!_0x7e1b24[_0x9677('0x39')]['port']){throw new Error(_0x9677('0xab'));}var _0x461506=_0x7e1b24['query'][_0x9677('0xa0')]?_0x7e1b24['query'][_0x9677('0xa0')]+':'+_0x7e1b24[_0x9677('0x39')]['port']:'http://localhost:'+_0x7e1b24[_0x9677('0x39')][_0x9677('0x9f')];var _0x524416=_0x7e1b24[_0x9677('0x39')]['json']?_0x7e1b24['query'][_0x9677('0x21')]:!![];var _0x524eb6=_0x7e1b24[_0x9677('0x39')][_0x9677('0xa2')]?_0x7e1b24[_0x9677('0x39')][_0x9677('0xa2')]:null;var _0x4729c6={'method':_0x7e1b24[_0x9677('0xa3')],'uri':util[_0x9677('0x67')](_0x9677('0xa4'),_0x461506,_0x7e1b24[_0x9677('0x39')][_0x9677('0x4e')]),'json':_0x524416,'resolveWithFullResponse':!![],'encoding':_0x524eb6,'body':_0x7e1b24[_0x9677('0x94')]};if(_0x7e1b24[_0x9677('0xa5')]){_0x4729c6[_0x9677('0xa5')]=_0x7e1b24[_0x9677('0xa5')];if(_0x4729c6[_0x9677('0xa5')][_0x9677('0xa6')]){delete _0x4729c6[_0x9677('0xa5')][_0x9677('0xa6')];}}if(_0x4729c6[_0x9677('0xa5')]['content-type']){delete _0x4729c6[_0x9677('0xa5')][_0x9677('0xa7')];}return rp(_0x4729c6);})[_0x9677('0x2b')](function(_0x141857){if(_0x141857){_0x5fb10f[_0x9677('0x26')](_0x141857[_0x9677('0xa5')]);logger[_0x9677('0x6b')](_0x141857['body']);return _0x5fb10f[_0x9677('0x20')](_0x141857[_0x9677('0xa8')])[_0x9677('0x9b')](_0x141857[_0x9677('0x94')]);}else{return _0x5fb10f[_0x9677('0x1f')](0xc8);}})['catch'](handleError(_0x5fb10f,null));}; \ No newline at end of file +var _0xc939=['merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','join','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','root','dirname','node_modules/**/*','finalize','close','existsSync','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','info','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','Plugin\x20manifest\x20missing','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','admin','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','delete','destroy','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','set','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','count','Content-Range','apply','save','update','then','get','Plugins','UserProfileResource','sendStatus','error','stack','name','send','index','Plugin','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter'];(function(_0x576357,_0x5b65c5){var _0xb2308b=function(_0x122757){while(--_0x122757){_0x576357['push'](_0x576357['shift']());}};_0xb2308b(++_0x5b65c5);}(_0xc939,0x1c8));var _0x9c93=function(_0x767aa3,_0x3b82b1){_0x767aa3=_0x767aa3-0x0;var _0x39bf0f=_0xc939[_0x767aa3];return _0x39bf0f;};'use strict';var emlformat=require(_0x9c93('0x0'));var rimraf=require(_0x9c93('0x1'));var zipdir=require(_0x9c93('0x2'));var jsonpatch=require(_0x9c93('0x3'));var rp=require(_0x9c93('0x4'));var moment=require(_0x9c93('0x5'));var BPromise=require(_0x9c93('0x6'));var Mustache=require(_0x9c93('0x7'));var util=require(_0x9c93('0x8'));var path=require(_0x9c93('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9c93('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9c93('0xb'));var squel=require(_0x9c93('0xc'));var crypto=require(_0x9c93('0xd'));var jsforce=require(_0x9c93('0xe'));var deskjs=require(_0x9c93('0xf'));var toCsv=require(_0x9c93('0x10'));var querystring=require(_0x9c93('0x11'));var Papa=require('papaparse');var extract=require(_0x9c93('0x12'));var rimraf=require(_0x9c93('0x1'));var archiver=require(_0x9c93('0x13'));var Redis=require(_0x9c93('0x14'));var authService=require(_0x9c93('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x9c93('0x16'));var hardwareService=require(_0x9c93('0x17'));var logger=require(_0x9c93('0x18'))('api');var utils=require(_0x9c93('0x19'));var config=require(_0x9c93('0x1a'));var licenseUtil=require(_0x9c93('0x1b'));var db=require(_0x9c93('0x1c'))['db'];config[_0x9c93('0x1d')]=_[_0x9c93('0x1e')](config[_0x9c93('0x1d')],{'host':_0x9c93('0x1f'),'port':0x18eb});var socket=require(_0x9c93('0x20'))(new Redis(config[_0x9c93('0x1d')]));require('./plugin.socket')[_0x9c93('0x21')](socket);function respondWithStatusCode(_0x80a270,_0x18f175){_0x18f175=_0x18f175||0xcc;return function(_0x4141e9){if(_0x4141e9){return _0x80a270['sendStatus'](_0x18f175);}return _0x80a270[_0x9c93('0x22')](_0x18f175)[_0x9c93('0x23')]();};}function respondWithResult(_0x25ea08,_0x12c742){_0x12c742=_0x12c742||0xc8;return function(_0x181404){if(_0x181404){return _0x25ea08[_0x9c93('0x22')](_0x12c742)[_0x9c93('0x24')](_0x181404);}};}function respondWithFilteredResult(_0x2013c9,_0x3ed2bb){return function(_0x198284){if(_0x198284){var _0x3dcde5=typeof _0x3ed2bb[_0x9c93('0x25')]===_0x9c93('0x26')&&typeof _0x3ed2bb['limit']===_0x9c93('0x26');var _0x33a023=_0x198284[_0x9c93('0x27')];var _0x38cbf3=_0x3dcde5?0x0:_0x3ed2bb[_0x9c93('0x25')];var _0x312b20=_0x3dcde5?_0x198284['count']:_0x3ed2bb[_0x9c93('0x25')]+_0x3ed2bb['limit'];var _0x154eac;if(_0x312b20>=_0x33a023){_0x312b20=_0x33a023;_0x154eac=0xc8;}else{_0x154eac=0xce;}_0x2013c9[_0x9c93('0x22')](_0x154eac);return _0x2013c9['set'](_0x9c93('0x28'),_0x38cbf3+'-'+_0x312b20+'/'+_0x33a023)[_0x9c93('0x24')](_0x198284);}return null;};}function patchUpdates(_0x32666d){return function(_0x414a22){try{jsonpatch[_0x9c93('0x29')](_0x414a22,_0x32666d,!![]);}catch(_0x49e5f2){return BPromise['reject'](_0x49e5f2);}return _0x414a22[_0x9c93('0x2a')]();};}function saveUpdates(_0x72f904,_0x41c9c5){return function(_0x3bcf8){if(_0x3bcf8){return _0x3bcf8[_0x9c93('0x2b')](_0x72f904)['then'](function(_0x296d5c){return _0x296d5c;});}return null;};}function removeEntity(_0x5019aa,_0x220407){return function(_0x40308e){if(_0x40308e){return _0x40308e['destroy']()[_0x9c93('0x2c')](function(){var _0x391455=_0x40308e[_0x9c93('0x2d')]({'plain':!![]});var _0x2bbfbc=_0x9c93('0x2e');return db[_0x9c93('0x2f')]['destroy']({'where':{'type':_0x2bbfbc,'resourceId':_0x391455['id']}})[_0x9c93('0x2c')](function(){return _0x40308e;});})[_0x9c93('0x2c')](function(){_0x5019aa['status'](0xcc)[_0x9c93('0x23')]();});}};}function handleEntityNotFound(_0x3172f9,_0xf3cf18){return function(_0x168c7c){if(!_0x168c7c){_0x3172f9[_0x9c93('0x30')](0x194);}return _0x168c7c;};}function handleError(_0x44bc49,_0x78396c){_0x78396c=_0x78396c||0x1f4;return function(_0xabbe52){logger[_0x9c93('0x31')](_0xabbe52[_0x9c93('0x32')]);if(_0xabbe52[_0x9c93('0x33')]){delete _0xabbe52['name'];}_0x44bc49[_0x9c93('0x22')](_0x78396c)[_0x9c93('0x34')](_0xabbe52);};}exports[_0x9c93('0x35')]=function(_0x5b092b,_0x46b892){var _0xc082c8={},_0x2c9b0d={},_0x2954e9={'count':0x0,'rows':[]};var _0x569313=_['map'](db[_0x9c93('0x36')]['rawAttributes'],function(_0x5a32bd){return{'name':_0x5a32bd[_0x9c93('0x37')],'type':_0x5a32bd[_0x9c93('0x38')]['key']};});_0x2c9b0d[_0x9c93('0x39')]=_[_0x9c93('0x3a')](_0x569313,_0x9c93('0x33'));_0x2c9b0d['query']=_[_0x9c93('0x3b')](_0x5b092b[_0x9c93('0x3c')]);_0x2c9b0d[_0x9c93('0x3d')]=_[_0x9c93('0x3e')](_0x2c9b0d[_0x9c93('0x39')],_0x2c9b0d[_0x9c93('0x3c')]);_0xc082c8[_0x9c93('0x3f')]=_[_0x9c93('0x3e')](_0x2c9b0d['model'],qs[_0x9c93('0x40')](_0x5b092b[_0x9c93('0x3c')][_0x9c93('0x40')]));_0xc082c8[_0x9c93('0x3f')]=_0xc082c8['attributes']['length']?_0xc082c8['attributes']:_0x2c9b0d['model'];if(!_0x5b092b[_0x9c93('0x3c')][_0x9c93('0x41')](_0x9c93('0x42'))){_0xc082c8[_0x9c93('0x43')]=qs[_0x9c93('0x43')](_0x5b092b[_0x9c93('0x3c')][_0x9c93('0x43')]);_0xc082c8[_0x9c93('0x25')]=qs[_0x9c93('0x25')](_0x5b092b[_0x9c93('0x3c')][_0x9c93('0x25')]);}_0xc082c8['order']=qs[_0x9c93('0x44')](_0x5b092b[_0x9c93('0x3c')][_0x9c93('0x44')]);_0xc082c8[_0x9c93('0x45')]=qs['filters'](_[_0x9c93('0x46')](_0x5b092b['query'],_0x2c9b0d[_0x9c93('0x3d')]),_0x569313);if(_0x5b092b[_0x9c93('0x3c')][_0x9c93('0x47')]){_0xc082c8[_0x9c93('0x45')]=_[_0x9c93('0x48')](_0xc082c8[_0x9c93('0x45')],{'$or':_[_0x9c93('0x3a')](_0x569313,function(_0x17b6e6){if(_0x17b6e6[_0x9c93('0x38')]!==_0x9c93('0x49')){var _0x2a5422={};_0x2a5422[_0x17b6e6[_0x9c93('0x33')]]={'$like':'%'+_0x5b092b['query'][_0x9c93('0x47')]+'%'};return _0x2a5422;}})});}_0xc082c8=_['merge']({},_0xc082c8,_0x5b092b['options']);var _0x5141f8={'where':_0xc082c8['where']};return db[_0x9c93('0x36')]['count'](_0x5141f8)['then'](function(_0x502243){_0x2954e9['count']=_0x502243;if(_0x5b092b[_0x9c93('0x3c')][_0x9c93('0x4a')]){_0xc082c8[_0x9c93('0x4b')]=[{'all':!![]}];}return db[_0x9c93('0x36')][_0x9c93('0x4c')](_0xc082c8);})[_0x9c93('0x2c')](function(_0x540d5a){_0x2954e9[_0x9c93('0x4d')]=_0x540d5a;return _0x2954e9;})['then'](respondWithFilteredResult(_0x46b892,_0xc082c8))[_0x9c93('0x4e')](handleError(_0x46b892,null));};exports[_0x9c93('0x4f')]=function(_0x41bf32,_0x155bc5){var _0x5c7167={'raw':!![],'where':{'id':_0x41bf32[_0x9c93('0x50')]['id']}},_0x40142a={};_0x40142a[_0x9c93('0x39')]=_[_0x9c93('0x3b')](db[_0x9c93('0x36')][_0x9c93('0x51')]);_0x40142a[_0x9c93('0x3c')]=_[_0x9c93('0x3b')](_0x41bf32['query']);_0x40142a['filters']=_[_0x9c93('0x3e')](_0x40142a[_0x9c93('0x39')],_0x40142a[_0x9c93('0x3c')]);_0x5c7167[_0x9c93('0x3f')]=_[_0x9c93('0x3e')](_0x40142a[_0x9c93('0x39')],qs['fields'](_0x41bf32[_0x9c93('0x3c')][_0x9c93('0x40')]));_0x5c7167['attributes']=_0x5c7167[_0x9c93('0x3f')][_0x9c93('0x52')]?_0x5c7167[_0x9c93('0x3f')]:_0x40142a[_0x9c93('0x39')];if(_0x41bf32[_0x9c93('0x3c')][_0x9c93('0x4a')]){_0x5c7167[_0x9c93('0x4b')]=[{'all':!![]}];}_0x5c7167=_['merge']({},_0x5c7167,_0x41bf32[_0x9c93('0x53')]);return db[_0x9c93('0x36')][_0x9c93('0x54')](_0x5c7167)['then'](handleEntityNotFound(_0x155bc5,null))[_0x9c93('0x2c')](respondWithResult(_0x155bc5,null))['catch'](handleError(_0x155bc5,null));};exports['download']=function(_0x7c2fe5,_0x41eaa9,_0x304dc4){return db[_0x9c93('0x36')][_0x9c93('0x54')]({'where':{'id':_0x7c2fe5['params']['id']},'attributes':[_0x9c93('0x33'),'path'],'raw':!![]})[_0x9c93('0x2c')](handleEntityNotFound(_0x41eaa9,null))[_0x9c93('0x2c')](function(_0x209c2c){if(_0x209c2c){var _0x432a42=path[_0x9c93('0x55')](config['root'],_0x9c93('0x56'),util[_0x9c93('0x57')](_0x9c93('0x58'),path[_0x9c93('0x59')](_0x209c2c[_0x9c93('0x9')])));var _0x43b1b8=fs[_0x9c93('0x5a')](_0x432a42);var _0x247eeb=archiver(_0x9c93('0x5b'),{'zlib':{'level':0x9}});_0x247eeb['on']('warning',function(_0x2ed4b6){if(_0x2ed4b6['code']===_0x9c93('0x5c')){logger[_0x9c93('0x31')](_0x2ed4b6);}else{throw new db[(_0x9c93('0x5d'))][(_0x9c93('0x5e'))](_0x9c93('0x5f'));}});_0x247eeb['on'](_0x9c93('0x31'),function(_0x186970){throw new db[(_0x9c93('0x5d'))][(_0x9c93('0x5e'))](_0x9c93('0x5f'));});_0x247eeb[_0x9c93('0x60')](_0x43b1b8);_0x247eeb[_0x9c93('0x61')]('**/*',{'cwd':path['join'](config[_0x9c93('0x62')],'server/files/plugins',path[_0x9c93('0x63')](_0x209c2c[_0x9c93('0x9')])),'ignore':[path[_0x9c93('0x55')](path[_0x9c93('0x59')](_0x209c2c[_0x9c93('0x9')]),_0x9c93('0x64')),path['join'](path[_0x9c93('0x59')](_0x209c2c['path']),'attachments/**/*')],'nodir':!![]})[_0x9c93('0x65')]();_0x43b1b8['on'](_0x9c93('0x66'),function(){if(!fs[_0x9c93('0x67')](_0x432a42)){throw new db['Sequelize'][(_0x9c93('0x5e'))](_0x9c93('0x68'));}return _0x41eaa9[_0x9c93('0x69')](_0x432a42,util[_0x9c93('0x57')]('%s.zip',path[_0x9c93('0x59')](_0x209c2c[_0x9c93('0x9')])),function(_0x14915c){if(_0x14915c){throw new db[(_0x9c93('0x5d'))]['Error'](_0x9c93('0x6a'));}fs['unlinkSync'](_0x432a42);logger['info']('Download\x20completed');logger[_0x9c93('0x6b')](_0x9c93('0x6c'));});});}return null;})[_0x9c93('0x4e')](handleError(_0x41eaa9,null));};exports[_0x9c93('0x6d')]=function(_0x2557db,_0x7552f2,_0x1026c9){var _0x1d37b9=path['basename'](_0x2557db['file']['filename'],path['extname'](_0x2557db[_0x9c93('0x6e')][_0x9c93('0x6f')]));var _0x577ed0=path['join'](config[_0x9c93('0x62')],_0x9c93('0x56'),_0x2557db['file'][_0x9c93('0x6f')]);var _0x20d940=path['join'](config[_0x9c93('0x62')],'server/files/plugins',_0x1d37b9);logger[_0x9c93('0x6b')](_0x9c93('0x70'),_0x577ed0);logger[_0x9c93('0x6b')](_0x9c93('0x71'),_0x20d940);try{fs[_0x9c93('0x72')](_0x577ed0,parseInt(_0x9c93('0x73'),0x8));extract(_0x577ed0,{'dir':_0x20d940},function(_0x1d25ab){if(_0x1d25ab){logger[_0x9c93('0x31')](_0x1d25ab);handleError(_0x1d25ab,!![]);};var _0xbdeed3=fs[_0x9c93('0x74')](_0x20d940);if(_0xbdeed3['length']>0x1){removeReferences(_0x577ed0,_0x20d940);logger[_0x9c93('0x31')](_0x9c93('0x75'));return _0x1026c9(new Error(_0x9c93('0x75')));}var _0x5760ed=fs[_0x9c93('0x76')](path[_0x9c93('0x55')](_0x20d940,_0xbdeed3[0x0]));if(_0x5760ed[_0x9c93('0x77')]()){removeReferences(_0x577ed0,_0x20d940);logger['error']('Invalid\x20plugin\x20structure');return _0x1026c9(new Error('Invalid\x20plugin\x20structure'));}if(_0x5760ed[_0x9c93('0x78')]()){var _0x5e72c0=fs[_0x9c93('0x74')](path[_0x9c93('0x55')](_0x20d940,_0xbdeed3[0x0]));if(_0x5e72c0[_0x9c93('0x52')]===0x0){removeReferences(_0x577ed0,_0x20d940);logger[_0x9c93('0x31')](_0x9c93('0x75'));return _0x1026c9(new Error(_0x9c93('0x75')));}var _0x1cd74a=_0x5e72c0[_0x9c93('0x79')](function(_0x18dfe5){return _0x18dfe5==='manifest.json';});if(!_0x1cd74a){return _0x1026c9(new Error(_0x9c93('0x7a')));}var _0x10ad8e=fs['readFileSync'](path[_0x9c93('0x55')](_0x20d940,_0xbdeed3[0x0],'manifest.json'));var _0x2753d0=JSON[_0x9c93('0x7b')](_0x10ad8e);if('undefined'==typeof _0x2753d0[_0x9c93('0x33')]){return _0x1026c9(new Error(_0x9c93('0x7c')));}if('undefined'==typeof _0x2753d0[_0x9c93('0x38')]){return _0x1026c9(new Error(_0x9c93('0x7d')));}if(_0x9c93('0x26')==typeof _0x2753d0[_0x9c93('0x7e')]){return _0x1026c9(new Error(_0x9c93('0x7f')));}if(_0x9c93('0x26')==typeof _0x2753d0[_0x9c93('0x80')]){return _0x1026c9(new Error(_0x9c93('0x81')));}if(_0x2753d0[_0x9c93('0x38')]===_0x9c93('0x82')){if(_0x9c93('0x26')==typeof _0x2753d0[_0x9c93('0x80')]['views']){return _0x1026c9(new Error(_0x9c93('0x83')));}if('undefined'==typeof _0x2753d0[_0x9c93('0x80')][_0x9c93('0x84')]['admin']&&_0x9c93('0x26')==typeof _0x2753d0[_0x9c93('0x80')][_0x9c93('0x84')][_0x9c93('0x85')]){return _0x1026c9(new Error(_0x9c93('0x86')));}}else if(_0x2753d0[_0x9c93('0x38')]===_0x9c93('0x87')){if(_0x9c93('0x26')==typeof _0x2753d0[_0x9c93('0x80')][_0x9c93('0x88')]){return _0x1026c9(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x9c93('0x26')==typeof _0x2753d0[_0x9c93('0x80')][_0x9c93('0x89')]){return _0x1026c9(new Error(_0x9c93('0x8a')));}}else{return _0x1026c9(new Error(_0x9c93('0x8b')));}var _0x4f2e10=_0x2753d0['name'];var _0x310b31=_0x2753d0[_0x9c93('0x8c')];var _0x862bb=_0x2753d0[_0x9c93('0x38')];var _0x5312db=_0x2753d0[_0x9c93('0x8d')]?_0x2753d0[_0x9c93('0x8d')]:'always';var _0x508130=_0x2753d0[_0x9c93('0x8e')]?_0x2753d0[_0x9c93('0x8e')]:'icon-apps';var _0x2a2e49='';var _0x221582='';var _0x32c022='';var _0x181128='';var _0x5a066e=_0x2753d0[_0x9c93('0x7e')];if(_0x862bb===_0x9c93('0x82')){if(_0x9c93('0x26')!=typeof _0x2753d0[_0x9c93('0x80')][_0x9c93('0x84')]['admin']){var _0x561d27=_0x2753d0[_0x9c93('0x80')][_0x9c93('0x84')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x9c93('0x8f')](_0x561d27)){_0x2a2e49=path['join'](_0x9c93('0x90'),_0x1d37b9,_0xbdeed3[0x0],_0x561d27);}else{_0x2a2e49=_0x561d27;}}else{logger[_0x9c93('0x6b')](_0x9c93('0x91'));}if(_0x9c93('0x26')!=typeof _0x2753d0[_0x9c93('0x80')][_0x9c93('0x84')]['agent']){var _0x45e979=_0x2753d0[_0x9c93('0x80')][_0x9c93('0x84')][_0x9c93('0x85')];if(!/^(f|ht)tps?:\/\//i['test'](_0x45e979)){_0x221582=path[_0x9c93('0x55')](_0x9c93('0x90'),_0x1d37b9,_0xbdeed3[0x0],_0x45e979);}else{_0x221582=_0x45e979;}}else{logger['info'](_0x9c93('0x92'));}}else if(_0x862bb===_0x9c93('0x87')){_0x32c022=_0x2753d0[_0x9c93('0x80')]['scriptName'];_0x181128=_0x2753d0['parameters'][_0x9c93('0x89')];if(_0x9c93('0x26')!=typeof _0x2753d0[_0x9c93('0x80')][_0x9c93('0x84')]){if('undefined'!=typeof _0x2753d0[_0x9c93('0x80')][_0x9c93('0x84')]['admin']){var _0x561d27=_0x2753d0[_0x9c93('0x80')]['views'][_0x9c93('0x93')];if(!/^(f|ht)tps?:\/\//i['test'](_0x561d27)){_0x2a2e49=path['join']('plugins',_0x1d37b9,_0xbdeed3[0x0],_0x561d27);}else{_0x2a2e49=_0x561d27;}}if(_0x9c93('0x26')!=typeof _0x2753d0['parameters'][_0x9c93('0x84')][_0x9c93('0x85')]){var _0x45e979=_0x2753d0[_0x9c93('0x80')][_0x9c93('0x84')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x9c93('0x8f')](_0x45e979)){_0x221582=path[_0x9c93('0x55')](_0x9c93('0x90'),_0x1d37b9,_0xbdeed3[0x0],_0x45e979);}else{_0x221582=_0x45e979;}}}}var _0x41c29c={'name':_0x4f2e10,'description':_0x310b31,'path':path[_0x9c93('0x55')](_0x1d37b9,_0xbdeed3[0x0]),'type':_0x862bb,'sidebar':_0x5312db,'icon':_0x508130,'adminUrl':_0x2a2e49,'agentUrl':_0x221582,'scriptName':_0x32c022,'scriptPath':_0x181128,'version':_0x5a066e};removeReferences(_0x577ed0,null);return db[_0x9c93('0x36')][_0x9c93('0x94')](_0x41c29c)['then'](function(_0x5a9fc6){var _0x439af7={'role':_0x2557db[_0x9c93('0x95')][_0x9c93('0x96')],'userProfileId':_0x2557db['body'][_0x9c93('0x97')]};if(!_0x439af7)throw new Error(_0x9c93('0x98'));if(_0x439af7[_0x9c93('0x96')]===_0x9c93('0x99')){var _0x7e2e52=_0x5a9fc6[_0x9c93('0x2d')]({'plain':!![]});return db[_0x9c93('0x9a')][_0x9c93('0x54')]({'where':{'name':_0x9c93('0x2e'),'userProfileId':_0x439af7['userProfileId']},'raw':!![]})[_0x9c93('0x2c')](function(_0x2ec11c){if(_0x2ec11c&&_0x2ec11c[_0x9c93('0x9b')]===0x0){return db['UserProfileResource'][_0x9c93('0x94')]({'name':_0x7e2e52['name'],'resourceId':_0x7e2e52['id'],'type':_0x2ec11c[_0x9c93('0x33')],'sectionId':_0x2ec11c['id']},{})[_0x9c93('0x2c')](function(){return _0x5a9fc6;});}else{return _0x5a9fc6;}})[_0x9c93('0x4e')](function(_0x2de9c1){logger[_0x9c93('0x31')](_0x9c93('0x9c'),_0x2de9c1);throw _0x2de9c1;});}return _0x5a9fc6;})[_0x9c93('0x2c')](respondWithResult(_0x7552f2,null))[_0x9c93('0x4e')](handleError(_0x7552f2,null));}});}catch(_0xd7d9e5){_0x7552f2[_0x9c93('0x22')](0x1f4)[_0x9c93('0x34')](_0xd7d9e5);}};function removeReferences(_0x4ddbf9,_0x45b26e){try{if(_0x4ddbf9){fs['unlinkSync'](_0x4ddbf9);logger['info']('Zip\x20archive\x20removed');}if(_0x45b26e){rimraf(_0x45b26e,function(){});logger[_0x9c93('0x6b')]('Extracted\x20folder\x20removed');}}catch(_0x7d04f1){logger[_0x9c93('0x31')](_0x7d04f1);}}exports['update']=function(_0x2a0279,_0xb2fab3,_0x552742){return db['Plugin'][_0x9c93('0x54')]({'where':{'id':_0x2a0279[_0x9c93('0x50')]['id']}})[_0x9c93('0x2c')](handleEntityNotFound(_0xb2fab3,null))['then'](saveUpdates(_0x2a0279['body'],null))[_0x9c93('0x2c')](respondWithResult(_0xb2fab3,null))[_0x9c93('0x4e')](handleError(_0xb2fab3,null));};exports[_0x9c93('0x9d')]=function(_0x212a0e,_0x500f25,_0x124731){return db[_0x9c93('0x36')]['find']({'where':{'id':_0x212a0e['params']['id']}})[_0x9c93('0x2c')](function(_0x396021){if(_0x396021){return _0x396021[_0x9c93('0x9e')]();}})[_0x9c93('0x2c')](function(_0x5a0ae9){rimraf(path[_0x9c93('0x55')](config['root'],_0x9c93('0x56'),path[_0x9c93('0x63')](_0x5a0ae9[_0x9c93('0x9')])),function(){});return _0x5a0ae9;})[_0x9c93('0x2c')](handleEntityNotFound(_0x500f25,null))['then'](respondWithStatusCode(_0x500f25,null))['catch'](handleError(_0x500f25,null));};exports[_0x9c93('0x9f')]=function(_0x426549,_0x50c8c9,_0xe2a6b4){return BPromise[_0x9c93('0xa0')]()['then'](function(){if(!_0x426549[_0x9c93('0x3c')][_0x9c93('0x9')]){throw new Error(_0x9c93('0xa1'));}if(!_0x426549['query']['port']){throw new Error(_0x9c93('0xa2'));}var _0x3c0ded=_0x426549[_0x9c93('0x3c')][_0x9c93('0xa3')]?_0x426549[_0x9c93('0x3c')][_0x9c93('0xa3')]+':'+_0x426549[_0x9c93('0x3c')][_0x9c93('0xa4')]:_0x9c93('0xa5')+_0x426549[_0x9c93('0x3c')][_0x9c93('0xa4')];var _0x27347a=_0x426549[_0x9c93('0x3c')][_0x9c93('0x24')]?_0x426549[_0x9c93('0x3c')][_0x9c93('0x24')]:!![];var _0x25dd10=_0x426549[_0x9c93('0x3c')][_0x9c93('0xa6')]?_0x426549[_0x9c93('0x3c')][_0x9c93('0xa6')]:null;var _0x59533a={'method':_0x426549[_0x9c93('0xa7')],'uri':util[_0x9c93('0x57')](_0x9c93('0xa8'),_0x3c0ded,_0x426549['query'][_0x9c93('0x9')]),'json':_0x27347a,'resolveWithFullResponse':!![],'encoding':_0x25dd10,'qs':_0x426549[_0x9c93('0x3c')]};if(_0x426549[_0x9c93('0xa9')]){_0x59533a[_0x9c93('0xa9')]=_0x426549[_0x9c93('0xa9')];if(_0x59533a['headers']['content-length']){delete _0x59533a[_0x9c93('0xa9')][_0x9c93('0xaa')];}}if(_0x59533a[_0x9c93('0xa9')][_0x9c93('0xab')]){delete _0x59533a[_0x9c93('0xa9')][_0x9c93('0xab')];}return rp(_0x59533a);})['then'](function(_0x220b99){if(_0x220b99){_0x50c8c9['set'](_0x220b99['headers']);logger['info'](_0x220b99[_0x9c93('0x95')]);if(_[_0x9c93('0xac')](_0x426549[_0x9c93('0x3c')][_0x9c93('0x9')],'download')&&_0x220b99[_0x9c93('0xad')]==0x1f4){return _0x50c8c9[_0x9c93('0x30')](_0x220b99[_0x9c93('0xad')]);}else{return _0x50c8c9[_0x9c93('0x22')](_0x220b99[_0x9c93('0xad')])[_0x9c93('0x34')](_0x220b99[_0x9c93('0x95')]);}}else{return _0x50c8c9[_0x9c93('0x30')](0xc8);}})['catch'](handleError(_0x50c8c9,null));};exports[_0x9c93('0xae')]=function(_0x52f7ec,_0x305722,_0x40d1b4){return BPromise[_0x9c93('0xa0')]()['then'](function(){if(!_0x52f7ec[_0x9c93('0x3c')][_0x9c93('0x9')]){throw new Error(_0x9c93('0xa1'));}if(!_0x52f7ec[_0x9c93('0x3c')][_0x9c93('0xa4')]){throw new Error(_0x9c93('0xa2'));}var _0x361c6e=_0x52f7ec[_0x9c93('0x3c')][_0x9c93('0xa3')]?_0x52f7ec[_0x9c93('0x3c')][_0x9c93('0xa3')]+':'+_0x52f7ec[_0x9c93('0x3c')][_0x9c93('0xa4')]:_0x9c93('0xa5')+_0x52f7ec[_0x9c93('0x3c')][_0x9c93('0xa4')];var _0x142eb0=_0x52f7ec[_0x9c93('0x3c')][_0x9c93('0x24')]?_0x52f7ec[_0x9c93('0x3c')][_0x9c93('0x24')]:!![];var _0x56f23d=_0x52f7ec[_0x9c93('0x3c')]['encoding']?_0x52f7ec['query']['encoding']:null;var _0x5877e6={'method':_0x52f7ec['method'],'uri':util[_0x9c93('0x57')](_0x9c93('0xa8'),_0x361c6e,_0x52f7ec[_0x9c93('0x3c')]['path']),'json':_0x142eb0,'resolveWithFullResponse':!![],'encoding':_0x56f23d,'body':_0x52f7ec[_0x9c93('0x95')]};if(_0x52f7ec[_0x9c93('0xa9')]){_0x5877e6[_0x9c93('0xa9')]=_0x52f7ec[_0x9c93('0xa9')];if(_0x5877e6['headers'][_0x9c93('0xaa')]){delete _0x5877e6[_0x9c93('0xa9')][_0x9c93('0xaa')];}}if(_0x5877e6[_0x9c93('0xa9')][_0x9c93('0xab')]){delete _0x5877e6['headers'][_0x9c93('0xab')];}return rp(_0x5877e6);})['then'](function(_0x3e6a2b){if(_0x3e6a2b){_0x305722[_0x9c93('0xaf')](_0x3e6a2b['headers']);logger['info'](_0x3e6a2b['body']);return _0x305722[_0x9c93('0x22')](_0x3e6a2b[_0x9c93('0xad')])[_0x9c93('0x34')](_0x3e6a2b[_0x9c93('0x95')]);}else{return _0x305722[_0x9c93('0x30')](0xc8);}})['catch'](handleError(_0x305722,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 7ffdde4..957392f 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 _0xed1c=['events','../../mysqldb','remove','emit','hasOwnProperty','exports'];(function(_0x4d2f60,_0x20d42c){var _0x154d45=function(_0x1555a4){while(--_0x1555a4){_0x4d2f60['push'](_0x4d2f60['shift']());}};_0x154d45(++_0x20d42c);}(_0xed1c,0xe4));var _0xced1=function(_0xa1184d,_0x4335d6){_0xa1184d=_0xa1184d-0x0;var _0x9154b7=_0xed1c[_0xa1184d];return _0x9154b7;};'use strict';var EventEmitter=require(_0xced1('0x0'));var Plugin=require(_0xced1('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xced1('0x2')};function emitEvent(_0x329a0a){return function(_0x79202e,_0x47a45c,_0x1e23a9){PluginEvents[_0xced1('0x3')](_0x329a0a+':'+_0x79202e['id'],_0x79202e);PluginEvents[_0xced1('0x3')](_0x329a0a,_0x79202e);_0x1e23a9(null);};}for(var e in events){if(events[_0xced1('0x4')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xced1('0x5')]=PluginEvents; \ No newline at end of file +var _0xd8fb=['../../mysqldb','Plugin','setMaxListeners','emit','hasOwnProperty','exports','events'];(function(_0x4e1211,_0x1c0e26){var _0x4ae887=function(_0x6e55ff){while(--_0x6e55ff){_0x4e1211['push'](_0x4e1211['shift']());}};_0x4ae887(++_0x1c0e26);}(_0xd8fb,0x99));var _0xbd8f=function(_0x5995c4,_0x5cbd7a){_0x5995c4=_0x5995c4-0x0;var _0x49e580=_0xd8fb[_0x5995c4];return _0x49e580;};'use strict';var EventEmitter=require(_0xbd8f('0x0'));var Plugin=require(_0xbd8f('0x1'))['db'][_0xbd8f('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xbd8f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x455a12){return function(_0x43d177,_0x53cccc,_0x400dfb){PluginEvents[_0xbd8f('0x4')](_0x455a12+':'+_0x43d177['id'],_0x43d177);PluginEvents['emit'](_0x455a12,_0x43d177);_0x400dfb(null);};}for(var e in events){if(events[_0xbd8f('0x5')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xbd8f('0x6')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index b727e3a..709b19a 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 _0x7d33=['define','Plugin','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./plugin.attributes'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x7d33,0x162));var _0x37d3=function(_0x2a6268,_0x4b0429){_0x2a6268=_0x2a6268-0x0;var _0x32f1f1=_0x7d33[_0x2a6268];return _0x32f1f1;};'use strict';var _=require(_0x37d3('0x0'));var util=require('util');var logger=require(_0x37d3('0x1'))(_0x37d3('0x2'));var moment=require(_0x37d3('0x3'));var BPromise=require(_0x37d3('0x4'));var rp=require(_0x37d3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x37d3('0x6'));var config=require(_0x37d3('0x7'));var attributes=require(_0x37d3('0x8'));module['exports']=function(_0x4a5bba,_0x18ca57){return _0x4a5bba[_0x37d3('0x9')](_0x37d3('0xa'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x188e=['Plugin','plugins','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','define'];(function(_0x131585,_0x1abd33){var _0x1fcca2=function(_0x8f165b){while(--_0x8f165b){_0x131585['push'](_0x131585['shift']());}};_0x1fcca2(++_0x1abd33);}(_0x188e,0x156));var _0xe188=function(_0x27b96e,_0x56863a){_0x27b96e=_0x27b96e-0x0;var _0x3bff6b=_0x188e[_0x27b96e];return _0x3bff6b;};'use strict';var _=require(_0xe188('0x0'));var util=require(_0xe188('0x1'));var logger=require(_0xe188('0x2'))(_0xe188('0x3'));var moment=require('moment');var BPromise=require(_0xe188('0x4'));var rp=require(_0xe188('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe188('0x6'));var config=require('../../config/environment');var attributes=require('./plugin.attributes');module['exports']=function(_0xc718d3,_0x4a6fda){return _0xc718d3[_0xe188('0x7')](_0xe188('0x8'),attributes,{'tableName':_0xe188('0x9'),'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 f55ff03..25f093e 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 _0xf59d=['rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./plugin.socket','register','request','Plugin,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','CreatePlugin','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0xd81d3c,_0x8015e){var _0x1a9d6b=function(_0x4c2d61){while(--_0x4c2d61){_0xd81d3c['push'](_0xd81d3c['shift']());}};_0x1a9d6b(++_0x8015e);}(_0xf59d,0x121));var _0xdf59=function(_0x43e75e,_0x324f5f){_0x43e75e=_0x43e75e-0x0;var _0x159ee9=_0xf59d[_0x43e75e];return _0x159ee9;};'use strict';var _=require(_0xdf59('0x0'));var util=require(_0xdf59('0x1'));var moment=require(_0xdf59('0x2'));var BPromise=require(_0xdf59('0x3'));var rs=require(_0xdf59('0x4'));var fs=require('fs');var Redis=require(_0xdf59('0x5'));var db=require(_0xdf59('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdf59('0x7'))(_0xdf59('0x8'));var config=require(_0xdf59('0x9'));var jayson=require(_0xdf59('0xa'));var client=jayson[_0xdf59('0xb')]['http']({'port':0x232a});config[_0xdf59('0xc')]=_[_0xdf59('0xd')](config[_0xdf59('0xc')],{'host':_0xdf59('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdf59('0xc')]));require(_0xdf59('0xf'))[_0xdf59('0x10')](socket);function respondWithRpcPromise(_0x25d8d9,_0x45b37d,_0x4f53e2){return new BPromise(function(_0x359f4d,_0x5f4d67){return client[_0xdf59('0x11')](_0x25d8d9,_0x4f53e2)['then'](function(_0x593e67){logger['info'](_0xdf59('0x12'),_0x45b37d,'request\x20sent');logger[_0xdf59('0x13')]('Plugin,\x20%s,\x20%s,\x20%s',_0x45b37d,_0xdf59('0x14'),JSON[_0xdf59('0x15')](_0x593e67));if(_0x593e67['error']){if(_0x593e67[_0xdf59('0x16')]['code']===0x1f4){logger['error'](_0xdf59('0x12'),_0x45b37d,_0x593e67[_0xdf59('0x16')][_0xdf59('0x17')]);return _0x5f4d67(_0x593e67[_0xdf59('0x16')][_0xdf59('0x17')]);}logger[_0xdf59('0x16')](_0xdf59('0x12'),_0x45b37d,_0x593e67[_0xdf59('0x16')][_0xdf59('0x17')]);return _0x359f4d(_0x593e67[_0xdf59('0x16')][_0xdf59('0x17')]);}else{logger[_0xdf59('0x18')](_0xdf59('0x12'),_0x45b37d,_0xdf59('0x14'));_0x359f4d(_0x593e67[_0xdf59('0x19')]['message']);}})[_0xdf59('0x1a')](function(_0x12c0b9){logger[_0xdf59('0x16')](_0xdf59('0x12'),_0x45b37d,_0x12c0b9);_0x5f4d67(_0x12c0b9);});});}exports[_0xdf59('0x1b')]=function(_0x56526c){var _0x28ae2f=this;return new Promise(function(_0x99564c,_0x1b87c1){return db['Plugin'][_0xdf59('0x1c')](_0x56526c[_0xdf59('0x1d')],{'raw':_0x56526c['options']?_0x56526c[_0xdf59('0x1e')][_0xdf59('0x1f')]===undefined?!![]:![]:!![]})[_0xdf59('0x20')](function(_0x1a3e70){logger[_0xdf59('0x18')](_0xdf59('0x1b'),_0x56526c);logger[_0xdf59('0x13')]('CreatePlugin',_0x56526c,JSON[_0xdf59('0x15')](_0x1a3e70));_0x99564c(_0x1a3e70);})[_0xdf59('0x1a')](function(_0x21192e){logger[_0xdf59('0x16')]('CreatePlugin',_0x21192e[_0xdf59('0x17')],_0x56526c);_0x1b87c1(_0x28ae2f[_0xdf59('0x16')](0x1f4,_0x21192e[_0xdf59('0x17')]));});});}; \ No newline at end of file +var _0x4f95=['debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result','body','options','raw','CreatePlugin','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent'];(function(_0x551844,_0x415299){var _0x2e7dac=function(_0x5b68a4){while(--_0x5b68a4){_0x551844['push'](_0x551844['shift']());}};_0x2e7dac(++_0x415299);}(_0x4f95,0x160));var _0x54f9=function(_0xa7da4c,_0x2eebf7){_0xa7da4c=_0xa7da4c-0x0;var _0xd24712=_0x4f95[_0xa7da4c];return _0xd24712;};'use strict';var _=require(_0x54f9('0x0'));var util=require(_0x54f9('0x1'));var moment=require('moment');var BPromise=require(_0x54f9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x54f9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x54f9('0x4'))(_0x54f9('0x5'));var config=require(_0x54f9('0x6'));var jayson=require(_0x54f9('0x7'));var client=jayson[_0x54f9('0x8')][_0x54f9('0x9')]({'port':0x232a});config[_0x54f9('0xa')]=_[_0x54f9('0xb')](config[_0x54f9('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x54f9('0xc'))(new Redis(config['redis']));require(_0x54f9('0xd'))[_0x54f9('0xe')](socket);function respondWithRpcPromise(_0x5cf2da,_0x22aa2d,_0x57e77){return new BPromise(function(_0x138103,_0x368448){return client[_0x54f9('0xf')](_0x5cf2da,_0x57e77)[_0x54f9('0x10')](function(_0x4fac3c){logger[_0x54f9('0x11')](_0x54f9('0x12'),_0x22aa2d,_0x54f9('0x13'));logger[_0x54f9('0x14')](_0x54f9('0x15'),_0x22aa2d,_0x54f9('0x13'),JSON['stringify'](_0x4fac3c));if(_0x4fac3c[_0x54f9('0x16')]){if(_0x4fac3c[_0x54f9('0x16')][_0x54f9('0x17')]===0x1f4){logger[_0x54f9('0x16')](_0x54f9('0x12'),_0x22aa2d,_0x4fac3c['error'][_0x54f9('0x18')]);return _0x368448(_0x4fac3c[_0x54f9('0x16')][_0x54f9('0x18')]);}logger[_0x54f9('0x16')]('Plugin,\x20%s,\x20%s',_0x22aa2d,_0x4fac3c[_0x54f9('0x16')][_0x54f9('0x18')]);return _0x138103(_0x4fac3c[_0x54f9('0x16')][_0x54f9('0x18')]);}else{logger[_0x54f9('0x11')](_0x54f9('0x12'),_0x22aa2d,_0x54f9('0x13'));_0x138103(_0x4fac3c[_0x54f9('0x19')][_0x54f9('0x18')]);}})['catch'](function(_0x4af89a){logger[_0x54f9('0x16')]('Plugin,\x20%s,\x20%s',_0x22aa2d,_0x4af89a);_0x368448(_0x4af89a);});});}exports['CreatePlugin']=function(_0x331606){var _0x1ed298=this;return new Promise(function(_0x3c61cc,_0x1a97fd){return db['Plugin']['create'](_0x331606[_0x54f9('0x1a')],{'raw':_0x331606[_0x54f9('0x1b')]?_0x331606[_0x54f9('0x1b')][_0x54f9('0x1c')]===undefined?!![]:![]:!![]})[_0x54f9('0x10')](function(_0xbad964){logger[_0x54f9('0x11')](_0x54f9('0x1d'),_0x331606);logger[_0x54f9('0x14')](_0x54f9('0x1d'),_0x331606,JSON['stringify'](_0xbad964));_0x3c61cc(_0xbad964);})[_0x54f9('0x1e')](function(_0x3aa3af){logger['error'](_0x54f9('0x1d'),_0x3aa3af[_0x54f9('0x18')],_0x331606);_0x1a97fd(_0x1ed298['error'](0x1f4,_0x3aa3af['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index d702564..7037edb 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 _0xcb85=['length','./plugin.events','save','remove','update','emit','removeListener','register'];(function(_0x3ad6fc,_0xd9485c){var _0x2a3703=function(_0x4b7776){while(--_0x4b7776){_0x3ad6fc['push'](_0x3ad6fc['shift']());}};_0x2a3703(++_0xd9485c);}(_0xcb85,0x109));var _0x5cb8=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0xcb85[_0x251d9c];return _0x16ae64;};'use strict';var PluginEvents=require(_0x5cb8('0x0'));var events=[_0x5cb8('0x1'),_0x5cb8('0x2'),_0x5cb8('0x3')];function createListener(_0x362589,_0x1d4e2b){return function(_0x45debb){_0x1d4e2b[_0x5cb8('0x4')](_0x362589,_0x45debb);};}function removeListener(_0x5cb852,_0x186307){return function(){PluginEvents[_0x5cb8('0x5')](_0x5cb852,_0x186307);};}exports[_0x5cb8('0x6')]=function(_0x30f8){for(var _0x354666=0x0,_0x34e4f1=events[_0x5cb8('0x7')];_0x354666<_0x34e4f1;_0x354666++){var _0x320dc1=events[_0x354666];var _0x36fe62=createListener('plugin:'+_0x320dc1,_0x30f8);PluginEvents['on'](_0x320dc1,_0x36fe62);}}; \ No newline at end of file +var _0xedd7=['remove','update','removeListener','./plugin.events'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0xedd7,0x167));var _0x7edd=function(_0x37dfdb,_0x51140f){_0x37dfdb=_0x37dfdb-0x0;var _0x1f1715=_0xedd7[_0x37dfdb];return _0x1f1715;};'use strict';var PluginEvents=require(_0x7edd('0x0'));var events=['save',_0x7edd('0x1'),_0x7edd('0x2')];function createListener(_0x3399cc,_0x3310a7){return function(_0x15d82c){_0x3310a7['emit'](_0x3399cc,_0x15d82c);};}function removeListener(_0x5afd7b,_0x2839ba){return function(){PluginEvents[_0x7edd('0x3')](_0x5afd7b,_0x2839ba);};}exports['register']=function(_0x3f881b){for(var _0x54a6ad=0x0,_0x34f76d=events['length'];_0x54a6ad<_0x34f76d;_0x54a6ad++){var _0x33df0d=events[_0x54a6ad];var _0x46db41=createListener('plugin:'+_0x33df0d,_0x3f881b);PluginEvents['on'](_0x33df0d,_0x46db41);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 2369041..aa5fdfc 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(_0x3a6a3c,_0x2b142f){var _0xbc86ef=function(_0x90ba9a){while(--_0x90ba9a){_0x3a6a3c['push'](_0x3a6a3c['shift']());}};_0xbc86ef(++_0x2b142f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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(_0x26a580,_0x3875a3){var _0x38c3a2=function(_0x1e15cb){while(--_0x1e15cb){_0x26a580['push'](_0x26a580['shift']());}};_0x38c3a2(++_0x3875a3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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 0476177..3495fa8 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 _0x4483=['error','stack','name','send','npm\x20install','info','list','express','motion2','length','then','catch','show','describe','body','script','join','../../files/plugins','chdir','dirname','start','dump','update','restart','stop','hasOwnProperty','params','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','path','child_process','exec','bluebird','sendStatus','status','json'];(function(_0x577ee0,_0x71b173){var _0x3cc806=function(_0x189c6b){while(--_0x189c6b){_0x577ee0['push'](_0x577ee0['shift']());}};_0x3cc806(++_0x71b173);}(_0x4483,0x1a3));var _0x3448=function(_0xa54684,_0x3c26bf){_0xa54684=_0xa54684-0x0;var _0xecc9d9=_0x4483[_0xa54684];return _0xecc9d9;};'use strict';var _=require(_0x3448('0x0'));var pm2=require(_0x3448('0x1'));var logger=require(_0x3448('0x2'))('api');var path=require(_0x3448('0x3'));var exec=require(_0x3448('0x4'))[_0x3448('0x5')];var BPromise=require(_0x3448('0x6'));function handleEntityNotFound(_0xef1a93,_0x5f5163){return function(_0xeb5b8){if(!_0xeb5b8){_0xef1a93[_0x3448('0x7')](0x194);;}return _0xeb5b8;};}function respondWithResult(_0x1b05db,_0xd3606d){_0xd3606d=_0xd3606d||0xc8;return function(_0x1bb7e5){if(_0x1bb7e5){return _0x1b05db[_0x3448('0x8')](_0xd3606d)[_0x3448('0x9')](_0x1bb7e5);}return null;};}function handleError(_0x34b926,_0x5923ee){_0x5923ee=_0x5923ee||0x1f4;return function(_0x5c82c6){logger[_0x3448('0xa')](_0x5c82c6[_0x3448('0xb')]);if(_0x5c82c6[_0x3448('0xc')]){delete _0x5c82c6[_0x3448('0xc')];}_0x34b926[_0x3448('0x8')](_0x5923ee)[_0x3448('0xd')](_0x5c82c6);};}function execChildProcess(){return new BPromise(function(_0x2bdf02,_0x32cd61){exec(_0x3448('0xe'),function(_0x35bb7b,_0x2a6048,_0x481a6f){logger['info'](_0x2a6048);logger[_0x3448('0xf')](_0x481a6f);if(_0x35bb7b){logger[_0x3448('0xa')](_0x35bb7b);return _0x32cd61(_0x35bb7b);}return _0x2bdf02(_0x2a6048);});});}exports['index']=function(_0x2661e1,_0xdfb89d){return pm2[_0x3448('0x10')]()['then'](function(_0x14104c){if(_0x14104c){var _0x2952a6=_['reject'](_0x14104c,function(_0x2387a3){return _0x2387a3[_0x3448('0xc')]===_0x3448('0x11')||_0x2387a3['name']===_0x3448('0x12');});return{'rows':_0x2952a6,'count':_0x2952a6[_0x3448('0x13')]};}return null;})[_0x3448('0x14')](respondWithResult(_0xdfb89d,null))[_0x3448('0x15')](handleError(_0xdfb89d,null));};exports[_0x3448('0x16')]=function(_0x1b2081,_0x247d1a){return pm2[_0x3448('0x17')](_0x1b2081['params']['id'])[_0x3448('0x14')](respondWithResult(_0x247d1a,null))['then'](handleEntityNotFound(_0x247d1a,null))['catch'](handleError(_0x247d1a,null));};exports['create']=function(_0x1e9774,_0x278736){if(_0x1e9774[_0x3448('0x18')]['name']&&_0x1e9774[_0x3448('0x18')][_0x3448('0x19')]){var _0x317de6=path[_0x3448('0x1a')](__dirname,_0x3448('0x1b'),_0x1e9774[_0x3448('0x18')]['script']);var _0x54c7ee=process['cwd']();process[_0x3448('0x1c')](path[_0x3448('0x1d')](_0x317de6));return execChildProcess()['then'](function(_0x5b1f7c){process[_0x3448('0x1c')](_0x54c7ee);return pm2[_0x3448('0x1e')]({'name':_0x1e9774[_0x3448('0x18')][_0x3448('0xc')],'script':_0x317de6});})[_0x3448('0x14')](function(_0x566ff5){pm2[_0x3448('0x1f')]();return _0x566ff5[0x0];})[_0x3448('0x14')](respondWithResult(_0x278736,0xc9))[_0x3448('0x15')](handleError(_0x278736,null));}else{return _0x278736[_0x3448('0x8')](0x1f4)[_0x3448('0xd')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x3448('0x20')]=function(_0x393081,_0x52c163){if(_0x393081[_0x3448('0x18')]['id']){delete _0x393081[_0x3448('0x18')]['id'];}var _0x310912={'online':_0x3448('0x21'),'stopped':_0x3448('0x22')};if(_0x310912[_0x3448('0x23')](_0x393081[_0x3448('0x18')][_0x3448('0x8')])){return pm2[_0x310912[_0x393081['body'][_0x3448('0x8')]]](_0x393081[_0x3448('0x24')]['id'])[_0x3448('0x14')](respondWithResult(_0x52c163,0xc8))['catch'](handleError(_0x52c163,null));}else{return _0x52c163[_0x3448('0x8')](0x1f4)['send']({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x52fb48,_0xff6513){if(_0x52fb48['body']['id']){delete _0x52fb48['body']['id'];}if(_0x52fb48[_0x3448('0x24')]['id']){return pm2[_0x3448('0x25')](_0x52fb48[_0x3448('0x24')]['id'])[_0x3448('0x14')](function(_0x4f4f32){pm2[_0x3448('0x1f')]();return _0x4f4f32[0x0];})[_0x3448('0x14')](respondWithResult(_0xff6513,null))[_0x3448('0x15')](handleError(_0xff6513,null));}else{return _0xff6513['status'](0x1f4)[_0x3448('0xd')]({'message':_0x3448('0x26')});}}; \ No newline at end of file +var _0xbec5=['Unknown\x20id','lodash','../../config/pm2','api','path','child_process','exec','bluebird','sendStatus','status','json','error','name','send','npm\x20install','info','index','list','then','reject','express','motion2','catch','show','create','body','join','../../files/plugins','script','cwd','dirname','chdir','start','dump','restart','hasOwnProperty','params','destroy'];(function(_0x337571,_0x195458){var _0x57d5fd=function(_0x1cd91a){while(--_0x1cd91a){_0x337571['push'](_0x337571['shift']());}};_0x57d5fd(++_0x195458);}(_0xbec5,0xe5));var _0x5bec=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0xbec5[_0x4c6d6f];return _0x2d4478;};'use strict';var _=require(_0x5bec('0x0'));var pm2=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var path=require(_0x5bec('0x3'));var exec=require(_0x5bec('0x4'))[_0x5bec('0x5')];var BPromise=require(_0x5bec('0x6'));function handleEntityNotFound(_0x4ee982,_0x1f8933){return function(_0x376cdb){if(!_0x376cdb){_0x4ee982[_0x5bec('0x7')](0x194);;}return _0x376cdb;};}function respondWithResult(_0x4aaac6,_0x3ed67a){_0x3ed67a=_0x3ed67a||0xc8;return function(_0x28a427){if(_0x28a427){return _0x4aaac6[_0x5bec('0x8')](_0x3ed67a)[_0x5bec('0x9')](_0x28a427);}return null;};}function handleError(_0x43d96e,_0x302aae){_0x302aae=_0x302aae||0x1f4;return function(_0x6406a1){logger[_0x5bec('0xa')](_0x6406a1['stack']);if(_0x6406a1[_0x5bec('0xb')]){delete _0x6406a1['name'];}_0x43d96e[_0x5bec('0x8')](_0x302aae)[_0x5bec('0xc')](_0x6406a1);};}function execChildProcess(){return new BPromise(function(_0x117162,_0x4a5482){exec(_0x5bec('0xd'),function(_0x18fa47,_0x16226b,_0x57ffc4){logger[_0x5bec('0xe')](_0x16226b);logger[_0x5bec('0xe')](_0x57ffc4);if(_0x18fa47){logger['error'](_0x18fa47);return _0x4a5482(_0x18fa47);}return _0x117162(_0x16226b);});});}exports[_0x5bec('0xf')]=function(_0xaa984d,_0x35393a){return pm2[_0x5bec('0x10')]()[_0x5bec('0x11')](function(_0xcd6d90){if(_0xcd6d90){var _0x24dcd6=_[_0x5bec('0x12')](_0xcd6d90,function(_0x259588){return _0x259588[_0x5bec('0xb')]===_0x5bec('0x13')||_0x259588[_0x5bec('0xb')]===_0x5bec('0x14');});return{'rows':_0x24dcd6,'count':_0x24dcd6['length']};}return null;})['then'](respondWithResult(_0x35393a,null))[_0x5bec('0x15')](handleError(_0x35393a,null));};exports[_0x5bec('0x16')]=function(_0x31ad9c,_0x1771e7){return pm2['describe'](_0x31ad9c['params']['id'])[_0x5bec('0x11')](respondWithResult(_0x1771e7,null))[_0x5bec('0x11')](handleEntityNotFound(_0x1771e7,null))['catch'](handleError(_0x1771e7,null));};exports[_0x5bec('0x17')]=function(_0xa7e223,_0x32a846){if(_0xa7e223[_0x5bec('0x18')]['name']&&_0xa7e223[_0x5bec('0x18')]['script']){var _0x191c0f=path[_0x5bec('0x19')](__dirname,_0x5bec('0x1a'),_0xa7e223[_0x5bec('0x18')][_0x5bec('0x1b')]);var _0x5e154e=process[_0x5bec('0x1c')]();process['chdir'](path[_0x5bec('0x1d')](_0x191c0f));return execChildProcess()[_0x5bec('0x11')](function(_0x5b2636){process[_0x5bec('0x1e')](_0x5e154e);return pm2[_0x5bec('0x1f')]({'name':_0xa7e223['body'][_0x5bec('0xb')],'script':_0x191c0f});})[_0x5bec('0x11')](function(_0x43d460){pm2[_0x5bec('0x20')]();return _0x43d460[0x0];})[_0x5bec('0x11')](respondWithResult(_0x32a846,0xc9))[_0x5bec('0x15')](handleError(_0x32a846,null));}else{return _0x32a846[_0x5bec('0x8')](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x2961bd,_0x2cdd2f){if(_0x2961bd[_0x5bec('0x18')]['id']){delete _0x2961bd['body']['id'];}var _0x2b3b2c={'online':_0x5bec('0x21'),'stopped':'stop'};if(_0x2b3b2c[_0x5bec('0x22')](_0x2961bd[_0x5bec('0x18')]['status'])){return pm2[_0x2b3b2c[_0x2961bd['body'][_0x5bec('0x8')]]](_0x2961bd[_0x5bec('0x23')]['id'])[_0x5bec('0x11')](respondWithResult(_0x2cdd2f,0xc8))[_0x5bec('0x15')](handleError(_0x2cdd2f,null));}else{return _0x2cdd2f[_0x5bec('0x8')](0x1f4)[_0x5bec('0xc')]({'message':'Unknown\x20status'});}};exports[_0x5bec('0x24')]=function(_0x59b5b6,_0x45863b){if(_0x59b5b6[_0x5bec('0x18')]['id']){delete _0x59b5b6[_0x5bec('0x18')]['id'];}if(_0x59b5b6[_0x5bec('0x23')]['id']){return pm2['delete'](_0x59b5b6[_0x5bec('0x23')]['id'])[_0x5bec('0x11')](function(_0xfc7d41){pm2['dump']();return _0xfc7d41[0x0];})[_0x5bec('0x11')](respondWithResult(_0x45863b,null))['catch'](handleError(_0x45863b,null));}else{return _0x45863b[_0x5bec('0x8')](0x1f4)[_0x5bec('0xc')]({'message':_0x5bec('0x25')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 22c83eb..00eb306 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 _0x7a00=['/queues','getQueues','exports','express','Router','../../components/auth/service','/agents','isAuthenticated','getAgents','get'];(function(_0x229b4a,_0x56a63a){var _0x1d45a4=function(_0x4f6e42){while(--_0x4f6e42){_0x229b4a['push'](_0x229b4a['shift']());}};_0x1d45a4(++_0x56a63a);}(_0x7a00,0x12f));var _0x07a0=function(_0x31fb32,_0x52dd18){_0x31fb32=_0x31fb32-0x0;var _0x3ee276=_0x7a00[_0x31fb32];return _0x3ee276;};'use strict';var express=require(_0x07a0('0x0'));var router=express[_0x07a0('0x1')]();var auth=require(_0x07a0('0x2'));var controller=require('./realtime.controller');router['get'](_0x07a0('0x3'),auth[_0x07a0('0x4')](),controller[_0x07a0('0x5')]);router[_0x07a0('0x6')](_0x07a0('0x7'),auth[_0x07a0('0x4')](),controller[_0x07a0('0x8')]);module[_0x07a0('0x9')]=router; \ No newline at end of file +var _0x5a2e=['isAuthenticated','getQueues','exports','express','Router','get','/agents'];(function(_0x2dfd28,_0x153b3c){var _0x49c016=function(_0x1cfb4d){while(--_0x1cfb4d){_0x2dfd28['push'](_0x2dfd28['shift']());}};_0x49c016(++_0x153b3c);}(_0x5a2e,0x96));var _0xe5a2=function(_0x51db59,_0x264d48){_0x51db59=_0x51db59-0x0;var _0x425d02=_0x5a2e[_0x51db59];return _0x425d02;};'use strict';var express=require(_0xe5a2('0x0'));var router=express[_0xe5a2('0x1')]();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router[_0xe5a2('0x2')](_0xe5a2('0x3'),auth[_0xe5a2('0x4')](),controller['getAgents']);router[_0xe5a2('0x2')]('/queues',auth[_0xe5a2('0x4')](),controller[_0xe5a2('0x5')]);module[_0xe5a2('0x6')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 58674f6..abf22df 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 _0x8958=['offset','undefined','count','limit','set','Content-Range','json','getAgents','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','then','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','getUpdatedSortOptions','fields','getRealtimeAgents','getAgentIdsByStatus','length','User','rawAttributes','fieldName','type','agent','online','getOptions','raw','sequelize','literal','FIELD(id,','order','forEach','push','Pause','merge','user','role','userProfileId','UserProfile','getResources','rows','find','filterAgentAttributes','getAgentStatus','Status','map','pick','format','Queue','key','name','voice','join','outbound','startCase','Queues','filter','assign','findAndCountAll','getRealtimeQueues','initializeQueues','catch','util','../../mysqldb','APIBadRequestError','../../errors/api','handleError'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x8958,0x93));var _0x8895=function(_0x4d986d,_0x1d9bd1){_0x4d986d=_0x4d986d-0x0;var _0x1e6676=_0x8958[_0x4d986d];return _0x1e6676;};'use strict';var _=require('lodash');var util=require(_0x8895('0x0'));var rta=require('../../components/realtime/agents');var rtq=require('../../components/realtime/queues');var qs=require('../../components/parsers/qs');var utils=require('../../config/utils');var db=require(_0x8895('0x1'))['db'];var APIBadRequestError=require('../../errors/api')[_0x8895('0x2')];var APIHandleError=require(_0x8895('0x3'))[_0x8895('0x4')];function respondWithFilteredResult(_0x59e641,_0x22fa52){return function(_0x2f03ad){if(_0x2f03ad){var _0x124e1e=typeof _0x22fa52[_0x8895('0x5')]===_0x8895('0x6')&&typeof _0x22fa52['limit']===_0x8895('0x6');var _0xc2be9f=_0x2f03ad[_0x8895('0x7')];var _0x24fe49=_0x124e1e?0x0:_0x22fa52[_0x8895('0x5')];var _0x29c126=_0x124e1e?_0x2f03ad[_0x8895('0x7')]:_0x22fa52[_0x8895('0x5')]+_0x22fa52[_0x8895('0x8')];var _0x107d86;if(_0x29c126>=_0xc2be9f){_0x29c126=_0xc2be9f;_0x107d86=0xc8;}else{_0x107d86=0xce;}_0x59e641['status'](_0x107d86);return _0x59e641[_0x8895('0x9')](_0x8895('0xa'),_0x24fe49+'-'+_0x29c126+'/'+_0xc2be9f)[_0x8895('0xb')](_0x2f03ad);}return null;};}exports[_0x8895('0xc')]=function(_0x446e1a,_0xaf93bc){var _0x5af0ef={'count':0x0,'rows':[]};var _0x24c53d={};var _0x34e856;var _0x56c18e=utils['getChannels']();var _0x47b9fe;var _0x9191b8;var _0x4e8f53=_0x446e1a[_0x8895('0xd')][_0x8895('0xe')];var _0x195789=_0x446e1a[_0x8895('0xd')][_0x8895('0xf')];var _0x5b4c2e=_0x446e1a[_0x8895('0xd')][_0x8895('0x10')];var _0x24906b=_0x195789===_0x8895('0x11')||_0x195789===_0x8895('0x12')?!![]:![];var _0x1b5c82=[];var _0x304be6;var _0x26cee0;Promise[_0x8895('0x13')]()[_0x8895('0x14')](function(){if(_0x446e1a[_0x8895('0xd')][_0x8895('0x15')]){if(!utils[_0x8895('0x16')](_0x446e1a['query']['channel'])){throw new APIBadRequestError(util['format'](_0x8895('0x17'),_0x446e1a[_0x8895('0xd')][_0x8895('0x15')]));}_0x34e856=_0x446e1a[_0x8895('0xd')][_0x8895('0x15')][_0x8895('0x18')]();}if(!_0x446e1a[_0x8895('0xd')][_0x8895('0x19')]||!_0x446e1a['query'][_0x8895('0x19')][_0x8895('0x1a')](_0x8895('0x1b'))){_0x446e1a[_0x8895('0xd')][_0x8895('0x19')]=rta['validateSortParameter'](_0x446e1a['query'][_0x8895('0x19')]);return;}var _0x398382=rta[_0x8895('0x1c')](_0x446e1a[_0x8895('0xd')]['sort']);_0x446e1a[_0x8895('0xd')][_0x8895('0x19')]=_0x398382[_0x8895('0x1d')]['join'](',');_0x304be6=_0x398382['order'];})[_0x8895('0x14')](function(){if(!_0x4e8f53){return[];}return rta['getAgentIdsByQueues'](_0x4e8f53,_0x34e856);})[_0x8895('0x14')](function(_0x3e3b48){_0x1b5c82=_0x3e3b48;return rta[_0x8895('0x1e')]();})[_0x8895('0x14')](function(_0x153220){_0x9191b8=_0x153220['rows'];if((!_0x195789||_0x24906b)&&!_0x304be6){return _0x1b5c82;}if(_0x304be6&&!_0x195789){return rta['getSortedAgentsIdsByStatus'](_0x9191b8,_0x1b5c82,_0x304be6);}else{return rta[_0x8895('0x1f')](_0x9191b8,_0x1b5c82,_0x195789);}})[_0x8895('0x14')](function(_0x3fc4cc){_0x1b5c82=_0x3fc4cc;var _0x16b65b=![];if(_0x1b5c82[_0x8895('0x20')]===0x0){if(_0x4e8f53||_0x195789){_0x16b65b=!![];}if(_0x24906b){_0x16b65b=![];}}if(_0x16b65b){return _0x5af0ef;}var _0x560b93=_['map'](db[_0x8895('0x21')][_0x8895('0x22')],function(_0x1c16f6){return{'name':_0x1c16f6[_0x8895('0x23')],'type':_0x1c16f6[_0x8895('0x24')]['key']};});_0x446e1a[_0x8895('0xd')]['role']=_0x8895('0x25');_0x446e1a['query'][_0x8895('0x26')]=!![];_0x24c53d=qs[_0x8895('0x27')](_0x560b93,_0x446e1a);_0x24c53d[_0x8895('0x28')]=!![];var _0x3e71fa=[];if(_0x1b5c82[_0x8895('0x20')]>0x0){_0x3e71fa['push']({'id':{'$in':_0x1b5c82}});if(_0x304be6&&!_0x195789){_0x26cee0=[db[_0x8895('0x29')][_0x8895('0x2a')](_0x8895('0x2b')+_0x1b5c82+')')];_0x24c53d[_0x8895('0x2c')]=_0x26cee0;}}if(_0x24906b){_0x56c18e[_0x8895('0x2d')](function(_0x574f0e){var _0x2880a6=!![];if(_0x195789==='*pause'&&_0x34e856!==_0x574f0e){_0x2880a6=![];}_0x3e71fa[_0x8895('0x2e')]({[_0x574f0e+'Pause']:_0x2880a6});});if(_0x5b4c2e){_0x3e71fa[_0x8895('0x2e')]({'pauseType':_0x5b4c2e});}}else if(_0x195789){_0x56c18e[_0x8895('0x2d')](function(_0x20907a){_0x3e71fa[_0x8895('0x2e')]({[_0x20907a+_0x8895('0x2f')]:![]});});}_0x24c53d['where']=_[_0x8895('0x30')](_0x24c53d['where'],{'$and':_0x3e71fa});if(_0x446e1a[_0x8895('0x31')][_0x8895('0x32')]===_0x8895('0x31')){var _0x9297ea={'params':{'id':_0x446e1a[_0x8895('0x31')][_0x8895('0x33')]},'query':{'section':'Agents','role':_0x8895('0x25'),'online':!![],'raw':!![],'ids':_0x1b5c82,'customSorting':_0x26cee0}};if(_0x24906b){_0x9297ea[_0x8895('0xd')]['extraQueryConditions']=_0x3e71fa;}_0x9297ea[_0x8895('0xd')]=Object['assign'](_0x9297ea[_0x8895('0xd')],_0x446e1a[_0x8895('0xd')]);delete _0x9297ea['query']['id'];return db[_0x8895('0x34')][_0x8895('0x35')](_0x9297ea);}return db['User']['findAndCountAll'](_0x24c53d);})[_0x8895('0x14')](function(_0xf0b378){_0x5af0ef[_0x8895('0x7')]=_0xf0b378[_0x8895('0x7')];_0x47b9fe=_0xf0b378[_0x8895('0x36')];return _0x47b9fe['map'](function(_0x42ed1f){var _0x25c854=_[_0x8895('0x37')](_0x9191b8,['id',_0x42ed1f['id']]);if(_0x25c854){var _0x10005f=rta[_0x8895('0x38')](_0x25c854);_[_0x8895('0x30')](_0x42ed1f,_0x10005f);}_0x42ed1f['globalStatus']=rta[_0x8895('0x39')](_0x42ed1f);if(_0x42ed1f['globalStatus'][_0x8895('0x1a')](_0x8895('0x11'))){_0x56c18e['forEach'](function(_0x1ca234){if(_0x42ed1f[_0x1ca234+'Pause']){_0x42ed1f[_0x1ca234+_0x8895('0x3a')]='pause';}});}return _0x42ed1f;});})['then'](function(_0x51277b){if(!_0x304be6||_0x26cee0){return _0x51277b;}return rta['sortAgentsByStatus'](_0x51277b,_0x304be6);})['then'](function(_0x47cf10){var _0x447ed6=null;if(_0x446e1a[_0x8895('0xd')]['fields']){var _0x4835d7=_0x446e1a[_0x8895('0xd')][_0x8895('0x1d')]['split'](',');_0x447ed6=_0x47cf10[_0x8895('0x3b')](function(_0x349f96){return _[_0x8895('0x3c')](_0x349f96,_0x4835d7);});}_0x5af0ef[_0x8895('0x36')]=_0x447ed6||_0x47cf10;return _0x5af0ef;})[_0x8895('0x14')](respondWithFilteredResult(_0xaf93bc,_0x24c53d))['catch'](APIHandleError(_0xaf93bc));};exports['getQueues']=function(_0x558c55,_0x157647){var _0x5ab709={'count':0x0,'rows':[]};var _0x44ab93={};var _0x35c45a;var _0x2bfd7c;var _0x28aaa9;Promise['resolve']()[_0x8895('0x14')](function(){if(_0x558c55[_0x8895('0xd')][_0x8895('0x15')]){if(!utils[_0x8895('0x16')](_0x558c55[_0x8895('0xd')][_0x8895('0x15')])){throw new APIBadRequestError(util[_0x8895('0x3d')](_0x8895('0x17'),_0x558c55['query'][_0x8895('0x15')]));}_0x35c45a=_0x558c55[_0x8895('0xd')]['channel'][_0x8895('0x18')]();}var _0x55bd4a=_['startCase'](_0x35c45a)+_0x8895('0x3e');var _0x337a9f=_[_0x8895('0x3b')](db[_0x55bd4a]['rawAttributes'],function(_0x227587){return{'name':_0x227587['fieldName'],'type':_0x227587[_0x8895('0x24')][_0x8895('0x3f')]};});if(!_0x558c55[_0x8895('0xd')][_0x8895('0x1d')]){var _0x2f3bf1=['id',_0x8895('0x40')];if(_0x35c45a===_0x8895('0x41')){_0x2f3bf1['push']('type');if(_0x558c55[_0x8895('0xd')][_0x8895('0x24')]==='outbound'){_0x2f3bf1[_0x8895('0x2e')](['dialActive','dialMethod']);}}_0x558c55[_0x8895('0xd')]['fields']=_0x2f3bf1[_0x8895('0x42')](',');}_0x44ab93=qs[_0x8895('0x27')](_0x337a9f,_0x558c55);if(_0x558c55[_0x8895('0x31')][_0x8895('0x32')]===_0x8895('0x31')){var _0x39a1d9={'params':{'id':_0x558c55[_0x8895('0x31')][_0x8895('0x33')]},'query':{'section':_0x35c45a==='voice'&&_0x558c55[_0x8895('0xd')][_0x8895('0x24')]===_0x8895('0x43')?'QueueCampaigns':_[_0x8895('0x44')](_0x35c45a)+_0x8895('0x45'),'type':_0x558c55[_0x8895('0xd')][_0x8895('0x24')],'nolimit':!![],'sort':_0x8895('0x40'),'filter':_0x558c55[_0x8895('0xd')][_0x8895('0x46')]}};_0x39a1d9[_0x8895('0xd')]=Object[_0x8895('0x47')](_0x39a1d9[_0x8895('0xd')],_0x558c55['query']);delete _0x39a1d9[_0x8895('0xd')]['id'];return db[_0x8895('0x34')][_0x8895('0x35')](_0x39a1d9);}return db[_0x55bd4a][_0x8895('0x48')](_0x44ab93);})[_0x8895('0x14')](function(_0x4dfa4b){_0x5ab709[_0x8895('0x7')]=_0x4dfa4b[_0x8895('0x7')];_0x2bfd7c=_0x4dfa4b[_0x8895('0x36')];return rtq[_0x8895('0x49')](_0x558c55,_0x35c45a);})[_0x8895('0x14')](function(_0x58dd6c){_0x28aaa9=_0x58dd6c[_0x8895('0x36')];return rtq[_0x8895('0x4a')](_0x2bfd7c,_0x28aaa9,_0x35c45a,_0x558c55[_0x8895('0xd')]['type']);})[_0x8895('0x14')](function(_0x5eca9d){_0x5ab709[_0x8895('0x36')]=_0x5eca9d;return _0x5ab709;})['then'](respondWithFilteredResult(_0x157647,_0x44ab93))[_0x8895('0x4b')](APIHandleError(_0x157647));}; \ No newline at end of file +var _0x24ca=['join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','rawAttributes','fieldName','key','role','online','getOptions','push','sequelize','forEach','Pause','where','merge','user','userProfileId','Agents','agent','UserProfile','getResources','find','filterAgentAttributes','globalStatus','Status','sortAgentsByStatus','fields','split','catch','getQueues','format','Channel\x20parameter\x20%s\x20is\x20invalid','Queue','type','name','outbound','voice','QueueCampaigns','startCase','filter','findAndCountAll','initializeQueues','lodash','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../mysqldb','../../errors/api','APIBadRequestError','handleError','offset','undefined','count','limit','status','set','Content-Range','getAgents','getChannels','query','globalStatusFilter','pauseTypeFilter','*pause','resolve','then','channel','isValidChannel','toLowerCase','sort','includes','validateSortParameter','getUpdatedSortOptions'];(function(_0x39707b,_0x2caf4d){var _0xd9864b=function(_0xb94f2b){while(--_0xb94f2b){_0x39707b['push'](_0x39707b['shift']());}};_0xd9864b(++_0x2caf4d);}(_0x24ca,0x1bc));var _0xa24c=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0x24ca[_0x111e94];return _0x3de107;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var rta=require(_0xa24c('0x1'));var rtq=require(_0xa24c('0x2'));var qs=require(_0xa24c('0x3'));var utils=require('../../config/utils');var db=require(_0xa24c('0x4'))['db'];var APIBadRequestError=require(_0xa24c('0x5'))[_0xa24c('0x6')];var APIHandleError=require(_0xa24c('0x5'))[_0xa24c('0x7')];function respondWithFilteredResult(_0x15a5cd,_0xf0511){return function(_0x3c0aaa){if(_0x3c0aaa){var _0x2dd348=typeof _0xf0511[_0xa24c('0x8')]===_0xa24c('0x9')&&typeof _0xf0511['limit']===_0xa24c('0x9');var _0x3a5727=_0x3c0aaa[_0xa24c('0xa')];var _0x5eac78=_0x2dd348?0x0:_0xf0511[_0xa24c('0x8')];var _0x325c6d=_0x2dd348?_0x3c0aaa[_0xa24c('0xa')]:_0xf0511[_0xa24c('0x8')]+_0xf0511[_0xa24c('0xb')];var _0x43aa5a;if(_0x325c6d>=_0x3a5727){_0x325c6d=_0x3a5727;_0x43aa5a=0xc8;}else{_0x43aa5a=0xce;}_0x15a5cd[_0xa24c('0xc')](_0x43aa5a);return _0x15a5cd[_0xa24c('0xd')](_0xa24c('0xe'),_0x5eac78+'-'+_0x325c6d+'/'+_0x3a5727)['json'](_0x3c0aaa);}return null;};}exports[_0xa24c('0xf')]=function(_0x11090c,_0xcee4fe){var _0x2c2af8={'count':0x0,'rows':[]};var _0x5a9486={};var _0x3ad0bf;var _0x3c23fc=utils[_0xa24c('0x10')]();var _0x2fcd8b;var _0x1cb08e;var _0x2d185c=_0x11090c[_0xa24c('0x11')]['globalQueueFilter'];var _0x47a063=_0x11090c[_0xa24c('0x11')][_0xa24c('0x12')];var _0x49ce53=_0x11090c['query'][_0xa24c('0x13')];var _0x1b29ad=_0x47a063==='pause'||_0x47a063===_0xa24c('0x14')?!![]:![];var _0x5de3e6=[];var _0x558dc7;var _0x2a610a;Promise[_0xa24c('0x15')]()[_0xa24c('0x16')](function(){if(_0x11090c['query'][_0xa24c('0x17')]){if(!utils[_0xa24c('0x18')](_0x11090c[_0xa24c('0x11')]['channel'])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x11090c['query'][_0xa24c('0x17')]));}_0x3ad0bf=_0x11090c[_0xa24c('0x11')][_0xa24c('0x17')][_0xa24c('0x19')]();}if(!_0x11090c['query'][_0xa24c('0x1a')]||!_0x11090c['query'][_0xa24c('0x1a')][_0xa24c('0x1b')]('globalStatus')){_0x11090c[_0xa24c('0x11')][_0xa24c('0x1a')]=rta[_0xa24c('0x1c')](_0x11090c[_0xa24c('0x11')][_0xa24c('0x1a')]);return;}var _0x47e0eb=rta[_0xa24c('0x1d')](_0x11090c['query'][_0xa24c('0x1a')]);_0x11090c[_0xa24c('0x11')][_0xa24c('0x1a')]=_0x47e0eb['fields'][_0xa24c('0x1e')](',');_0x558dc7=_0x47e0eb[_0xa24c('0x1f')];})[_0xa24c('0x16')](function(){if(!_0x2d185c){return[];}return rta[_0xa24c('0x20')](_0x2d185c,_0x3ad0bf);})[_0xa24c('0x16')](function(_0x3ad0e6){_0x5de3e6=_0x3ad0e6;return rta[_0xa24c('0x21')]();})['then'](function(_0xa0c48e){_0x1cb08e=_0xa0c48e[_0xa24c('0x22')];if((!_0x47a063||_0x1b29ad)&&!_0x558dc7){return _0x5de3e6;}if(_0x558dc7&&!_0x47a063){return rta[_0xa24c('0x23')](_0x1cb08e,_0x5de3e6,_0x558dc7);}else{return rta[_0xa24c('0x24')](_0x1cb08e,_0x5de3e6,_0x47a063);}})['then'](function(_0x21d2a8){_0x5de3e6=_0x21d2a8;var _0xc96ce7=![];if(_0x5de3e6[_0xa24c('0x25')]===0x0){if(_0x2d185c||_0x47a063){_0xc96ce7=!![];}if(_0x1b29ad){_0xc96ce7=![];}}if(_0xc96ce7){return _0x2c2af8;}var _0x59dbeb=_[_0xa24c('0x26')](db[_0xa24c('0x27')][_0xa24c('0x28')],function(_0x4ae35c){return{'name':_0x4ae35c[_0xa24c('0x29')],'type':_0x4ae35c['type'][_0xa24c('0x2a')]};});_0x11090c[_0xa24c('0x11')][_0xa24c('0x2b')]='agent';_0x11090c[_0xa24c('0x11')][_0xa24c('0x2c')]=!![];_0x5a9486=qs[_0xa24c('0x2d')](_0x59dbeb,_0x11090c);_0x5a9486['raw']=!![];var _0x1c1ed3=[];if(_0x5de3e6['length']>0x0){_0x1c1ed3[_0xa24c('0x2e')]({'id':{'$in':_0x5de3e6}});if(_0x558dc7&&!_0x47a063){_0x2a610a=[db[_0xa24c('0x2f')]['literal']('FIELD(id,'+_0x5de3e6+')')];_0x5a9486[_0xa24c('0x1f')]=_0x2a610a;}}if(_0x1b29ad){_0x3c23fc[_0xa24c('0x30')](function(_0x182e86){var _0x3c7522=!![];if(_0x47a063===_0xa24c('0x14')&&_0x3ad0bf!==_0x182e86){_0x3c7522=![];}_0x1c1ed3[_0xa24c('0x2e')]({[_0x182e86+_0xa24c('0x31')]:_0x3c7522});});if(_0x49ce53){_0x1c1ed3['push']({'pauseType':_0x49ce53});}}else if(_0x47a063){_0x3c23fc[_0xa24c('0x30')](function(_0x3ea442){_0x1c1ed3[_0xa24c('0x2e')]({[_0x3ea442+_0xa24c('0x31')]:![]});});}_0x5a9486[_0xa24c('0x32')]=_[_0xa24c('0x33')](_0x5a9486[_0xa24c('0x32')],{'$and':_0x1c1ed3});if(_0x11090c[_0xa24c('0x34')][_0xa24c('0x2b')]===_0xa24c('0x34')){var _0x4c7a30={'params':{'id':_0x11090c[_0xa24c('0x34')][_0xa24c('0x35')]},'query':{'section':_0xa24c('0x36'),'role':_0xa24c('0x37'),'online':!![],'raw':!![],'ids':_0x5de3e6,'customSorting':_0x2a610a}};if(_0x1b29ad){_0x4c7a30['query']['extraQueryConditions']=_0x1c1ed3;}_0x4c7a30[_0xa24c('0x11')]=Object['assign'](_0x4c7a30[_0xa24c('0x11')],_0x11090c[_0xa24c('0x11')]);delete _0x4c7a30[_0xa24c('0x11')]['id'];return db[_0xa24c('0x38')][_0xa24c('0x39')](_0x4c7a30);}return db['User']['findAndCountAll'](_0x5a9486);})[_0xa24c('0x16')](function(_0xc661c7){_0x2c2af8[_0xa24c('0xa')]=_0xc661c7[_0xa24c('0xa')];_0x2fcd8b=_0xc661c7[_0xa24c('0x22')];return _0x2fcd8b[_0xa24c('0x26')](function(_0x5080d0){var _0x56f392=_[_0xa24c('0x3a')](_0x1cb08e,['id',_0x5080d0['id']]);if(_0x56f392){var _0x1ce83e=rta[_0xa24c('0x3b')](_0x56f392);_[_0xa24c('0x33')](_0x5080d0,_0x1ce83e);}_0x5080d0[_0xa24c('0x3c')]=rta['getAgentStatus'](_0x5080d0);if(_0x5080d0[_0xa24c('0x3c')][_0xa24c('0x1b')]('pause')){_0x3c23fc['forEach'](function(_0xba7407){if(_0x5080d0[_0xba7407+_0xa24c('0x31')]){_0x5080d0[_0xba7407+_0xa24c('0x3d')]='pause';}});}return _0x5080d0;});})['then'](function(_0x21e204){if(!_0x558dc7||_0x2a610a){return _0x21e204;}return rta[_0xa24c('0x3e')](_0x21e204,_0x558dc7);})[_0xa24c('0x16')](function(_0x3ccc37){var _0x3f640e=null;if(_0x11090c[_0xa24c('0x11')][_0xa24c('0x3f')]){var _0x394d19=_0x11090c['query']['fields'][_0xa24c('0x40')](',');_0x3f640e=_0x3ccc37[_0xa24c('0x26')](function(_0x455256){return _['pick'](_0x455256,_0x394d19);});}_0x2c2af8[_0xa24c('0x22')]=_0x3f640e||_0x3ccc37;return _0x2c2af8;})[_0xa24c('0x16')](respondWithFilteredResult(_0xcee4fe,_0x5a9486))[_0xa24c('0x41')](APIHandleError(_0xcee4fe));};exports[_0xa24c('0x42')]=function(_0x442ede,_0x262550){var _0x1e7e97={'count':0x0,'rows':[]};var _0x35ed8a={};var _0x3f52fe;var _0x320582;var _0x4bbf93;Promise[_0xa24c('0x15')]()[_0xa24c('0x16')](function(){if(_0x442ede[_0xa24c('0x11')]['channel']){if(!utils[_0xa24c('0x18')](_0x442ede[_0xa24c('0x11')][_0xa24c('0x17')])){throw new APIBadRequestError(util[_0xa24c('0x43')](_0xa24c('0x44'),_0x442ede[_0xa24c('0x11')][_0xa24c('0x17')]));}_0x3f52fe=_0x442ede[_0xa24c('0x11')][_0xa24c('0x17')][_0xa24c('0x19')]();}var _0x418525=_['startCase'](_0x3f52fe)+_0xa24c('0x45');var _0x96b977=_[_0xa24c('0x26')](db[_0x418525][_0xa24c('0x28')],function(_0x1a1d02){return{'name':_0x1a1d02[_0xa24c('0x29')],'type':_0x1a1d02[_0xa24c('0x46')][_0xa24c('0x2a')]};});if(!_0x442ede[_0xa24c('0x11')]['fields']){var _0x540da8=['id',_0xa24c('0x47')];if(_0x3f52fe==='voice'){_0x540da8[_0xa24c('0x2e')](_0xa24c('0x46'));if(_0x442ede['query'][_0xa24c('0x46')]===_0xa24c('0x48')){_0x540da8[_0xa24c('0x2e')](['dialActive','dialMethod']);}}_0x442ede[_0xa24c('0x11')]['fields']=_0x540da8[_0xa24c('0x1e')](',');}_0x35ed8a=qs[_0xa24c('0x2d')](_0x96b977,_0x442ede);if(_0x442ede[_0xa24c('0x34')][_0xa24c('0x2b')]===_0xa24c('0x34')){var _0x1fa739={'params':{'id':_0x442ede[_0xa24c('0x34')][_0xa24c('0x35')]},'query':{'section':_0x3f52fe===_0xa24c('0x49')&&_0x442ede[_0xa24c('0x11')]['type']===_0xa24c('0x48')?_0xa24c('0x4a'):_[_0xa24c('0x4b')](_0x3f52fe)+'Queues','type':_0x442ede['query']['type'],'nolimit':!![],'sort':_0xa24c('0x47'),'filter':_0x442ede['query'][_0xa24c('0x4c')]}};_0x1fa739[_0xa24c('0x11')]=Object['assign'](_0x1fa739[_0xa24c('0x11')],_0x442ede[_0xa24c('0x11')]);delete _0x1fa739[_0xa24c('0x11')]['id'];return db[_0xa24c('0x38')][_0xa24c('0x39')](_0x1fa739);}return db[_0x418525][_0xa24c('0x4d')](_0x35ed8a);})[_0xa24c('0x16')](function(_0xbeab78){_0x1e7e97['count']=_0xbeab78[_0xa24c('0xa')];_0x320582=_0xbeab78['rows'];return rtq['getRealtimeQueues'](_0x442ede,_0x3f52fe);})['then'](function(_0x5bd2af){_0x4bbf93=_0x5bd2af['rows'];return rtq[_0xa24c('0x4e')](_0x320582,_0x4bbf93,_0x3f52fe,_0x442ede['query'][_0xa24c('0x46')]);})[_0xa24c('0x16')](function(_0x5247f9){_0x1e7e97[_0xa24c('0x22')]=_0x5247f9;return _0x1e7e97;})[_0xa24c('0x16')](respondWithFilteredResult(_0x262550,_0x35ed8a))[_0xa24c('0x41')](APIHandleError(_0x262550));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 4ae12d6..4270f46 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x47f3cf,_0xf33a5a){var _0x1c4ca9=function(_0x122d58){while(--_0x122d58){_0x47f3cf['push'](_0x47f3cf['shift']());}};_0x1c4ca9(++_0xf33a5a);}(_0x70e0,0x17b));var _0x070e=function(_0x537221,_0x37aec2){_0x537221=_0x537221-0x0;var _0x56edb7=_0x70e0[_0x537221];return _0x56edb7;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x667ff8,_0x59e7df){var _0x2ddfc7=function(_0x5a4a46){while(--_0x5a4a46){_0x667ff8['push'](_0x667ff8['shift']());}};_0x2ddfc7(++_0x59e7df);}(_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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 04e73d8..2c97476 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 _0xabce=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xabce,0x103));var _0xeabc=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xabce[_0x2160a9];return _0xa88cf7;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'state':{'type':Sequelize[_0xeabc('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xeabc('0x3')]},'scheduledat':{'type':Sequelize[_0xeabc('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xeabc('0x4')]},'ringtime':{'type':Sequelize[_0xeabc('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xeabc('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x71ad=['STRING','DATE','INTEGER','sequelize','exports'];(function(_0x2b8dd9,_0x29e442){var _0x5687d3=function(_0x458eaa){while(--_0x458eaa){_0x2b8dd9['push'](_0x2b8dd9['shift']());}};_0x5687d3(++_0x29e442);}(_0x71ad,0xee));var _0xd71a=function(_0x43f379,_0xcfe04e){_0x43f379=_0x43f379-0x0;var _0x2aac8f=_0x71ad[_0x43f379];return _0x2aac8f;};'use strict';var Sequelize=require(_0xd71a('0x0'));module[_0xd71a('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xd71a('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xd71a('0x2')]},'starttime':{'type':Sequelize[_0xd71a('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xd71a('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xd71a('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index c4f7fc8..26fd0d6 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 _0x0306=['lodash','util','../../config/logger','moment','bluebird','rimraf','./reportAgentPreview.attributes','exports','define','report_agent_preview'];(function(_0x84179b,_0x2234ba){var _0x459238=function(_0x1c696b){while(--_0x1c696b){_0x84179b['push'](_0x84179b['shift']());}};_0x459238(++_0x2234ba);}(_0x0306,0x172));var _0x6030=function(_0x479b43,_0x5b35c0){_0x479b43=_0x479b43-0x0;var _0x31a3ad=_0x0306[_0x479b43];return _0x31a3ad;};'use strict';var _=require(_0x6030('0x0'));var util=require(_0x6030('0x1'));var logger=require(_0x6030('0x2'))('api');var moment=require(_0x6030('0x3'));var BPromise=require(_0x6030('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6030('0x5'));var config=require('../../config/environment');var attributes=require(_0x6030('0x6'));module[_0x6030('0x7')]=function(_0x4a0166,_0x1ccf26){return _0x4a0166[_0x6030('0x8')]('ReportAgentPreview',attributes,{'tableName':_0x6030('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab1d=['../../config/environment','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xab1d,0x155));var _0xdab1=function(_0x51e942,_0x113998){_0x51e942=_0x51e942-0x0;var _0x4dc96a=_0xab1d[_0x51e942];return _0x4dc96a;};'use strict';var _=require(_0xdab1('0x0'));var util=require(_0xdab1('0x1'));var logger=require(_0xdab1('0x2'))('api');var moment=require(_0xdab1('0x3'));var BPromise=require(_0xdab1('0x4'));var rp=require(_0xdab1('0x5'));var fs=require('fs');var path=require(_0xdab1('0x6'));var rimraf=require('rimraf');var config=require(_0xdab1('0x7'));var attributes=require('./reportAgentPreview.attributes');module[_0xdab1('0x8')]=function(_0x14d919,_0x5ed8dc){return _0x14d919[_0xdab1('0x9')](_0xdab1('0xa'),attributes,{'tableName':_0xdab1('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 cec0faa..01cc8c0 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 _0x83a6=['ReportAgentPreview','options','raw','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateReportAgentPreview'];(function(_0x3c1e16,_0x2d4500){var _0xc00835=function(_0x1dab6f){while(--_0x1dab6f){_0x3c1e16['push'](_0x3c1e16['shift']());}};_0xc00835(++_0x2d4500);}(_0x83a6,0x162));var _0x683a=function(_0x519f6b,_0x48ef69){_0x519f6b=_0x519f6b-0x0;var _0x312b75=_0x83a6[_0x519f6b];return _0x312b75;};'use strict';var _=require(_0x683a('0x0'));var util=require(_0x683a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x683a('0x2'));var fs=require('fs');var Redis=require(_0x683a('0x3'));var db=require(_0x683a('0x4'))['db'];var utils=require(_0x683a('0x5'));var logger=require('../../config/logger')(_0x683a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x683a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2df02e,_0x889a09,_0x4105ff){return new BPromise(function(_0x434021,_0x50c377){return client[_0x683a('0x8')](_0x2df02e,_0x4105ff)[_0x683a('0x9')](function(_0x4df5e2){logger[_0x683a('0xa')](_0x683a('0xb'),_0x889a09,_0x683a('0xc'));logger[_0x683a('0xd')](_0x683a('0xe'),_0x889a09,_0x683a('0xc'),JSON['stringify'](_0x4df5e2));if(_0x4df5e2['error']){if(_0x4df5e2[_0x683a('0xf')][_0x683a('0x10')]===0x1f4){logger[_0x683a('0xf')](_0x683a('0xb'),_0x889a09,_0x4df5e2[_0x683a('0xf')]['message']);return _0x50c377(_0x4df5e2[_0x683a('0xf')][_0x683a('0x11')]);}logger[_0x683a('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x889a09,_0x4df5e2[_0x683a('0xf')][_0x683a('0x11')]);return _0x434021(_0x4df5e2[_0x683a('0xf')][_0x683a('0x11')]);}else{logger[_0x683a('0xa')](_0x683a('0xb'),_0x889a09,_0x683a('0xc'));_0x434021(_0x4df5e2[_0x683a('0x12')]['message']);}})[_0x683a('0x13')](function(_0x3c5208){logger[_0x683a('0xf')](_0x683a('0xb'),_0x889a09,_0x3c5208);_0x50c377(_0x3c5208);});});}exports[_0x683a('0x14')]=function(_0x5dadbe){var _0x347efb=this;return new Promise(function(_0x4eeac7,_0x17c2cc){return db[_0x683a('0x15')]['create'](_0x5dadbe['body'],{'raw':_0x5dadbe[_0x683a('0x16')]?_0x5dadbe['options'][_0x683a('0x17')]===undefined?!![]:![]:!![]})[_0x683a('0x9')](function(_0x4eec3d){logger[_0x683a('0xa')](_0x683a('0x14'),_0x5dadbe);logger[_0x683a('0xd')](_0x683a('0x14'),_0x5dadbe,JSON[_0x683a('0x18')](_0x4eec3d));_0x4eeac7(_0x4eec3d);})[_0x683a('0x13')](function(_0x4fa6a4){logger[_0x683a('0xf')](_0x683a('0x14'),_0x4fa6a4['message'],_0x5dadbe);_0x17c2cc(_0x347efb[_0x683a('0xf')](0x1f4,_0x4fa6a4[_0x683a('0x11')]));});});}; \ No newline at end of file +var _0x61e3=['code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','options','then','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x4cb0a4,_0x2c168d){var _0x52da2a=function(_0xfb0c22){while(--_0xfb0c22){_0x4cb0a4['push'](_0x4cb0a4['shift']());}};_0x52da2a(++_0x2c168d);}(_0x61e3,0xa5));var _0x361e=function(_0x170cd7,_0x57624b){_0x170cd7=_0x170cd7-0x0;var _0x5c82e9=_0x61e3[_0x170cd7];return _0x5c82e9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x361e('0x0'));var BPromise=require(_0x361e('0x1'));var rs=require(_0x361e('0x2'));var fs=require('fs');var Redis=require(_0x361e('0x3'));var db=require(_0x361e('0x4'))['db'];var utils=require(_0x361e('0x5'));var logger=require(_0x361e('0x6'))(_0x361e('0x7'));var config=require(_0x361e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x361e('0x9')][_0x361e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x484fcd,_0x3390a0,_0x2d37dd){return new BPromise(function(_0x4d4478,_0x14f9b6){return client['request'](_0x484fcd,_0x2d37dd)['then'](function(_0x4c661f){logger[_0x361e('0xb')](_0x361e('0xc'),_0x3390a0,_0x361e('0xd'));logger[_0x361e('0xe')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x3390a0,_0x361e('0xd'),JSON[_0x361e('0xf')](_0x4c661f));if(_0x4c661f[_0x361e('0x10')]){if(_0x4c661f[_0x361e('0x10')][_0x361e('0x11')]===0x1f4){logger[_0x361e('0x10')](_0x361e('0xc'),_0x3390a0,_0x4c661f[_0x361e('0x10')]['message']);return _0x14f9b6(_0x4c661f['error'][_0x361e('0x12')]);}logger['error'](_0x361e('0xc'),_0x3390a0,_0x4c661f[_0x361e('0x10')][_0x361e('0x12')]);return _0x4d4478(_0x4c661f['error'][_0x361e('0x12')]);}else{logger['info'](_0x361e('0xc'),_0x3390a0,_0x361e('0xd'));_0x4d4478(_0x4c661f[_0x361e('0x13')][_0x361e('0x12')]);}})[_0x361e('0x14')](function(_0x1a3e7b){logger[_0x361e('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x3390a0,_0x1a3e7b);_0x14f9b6(_0x1a3e7b);});});}exports[_0x361e('0x15')]=function(_0x4fa90a){var _0x10d433=this;return new Promise(function(_0x36b79c,_0x32dc15){return db[_0x361e('0x16')][_0x361e('0x17')](_0x4fa90a['body'],{'raw':_0x4fa90a['options']?_0x4fa90a[_0x361e('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x361e('0x19')](function(_0x5b26a9){logger['info'](_0x361e('0x15'),_0x4fa90a);logger[_0x361e('0xe')](_0x361e('0x15'),_0x4fa90a,JSON['stringify'](_0x5b26a9));_0x36b79c(_0x5b26a9);})[_0x361e('0x14')](function(_0x43dc4e){logger['error']('CreateReportAgentPreview',_0x43dc4e['message'],_0x4fa90a);_0x32dc15(_0x10d433[_0x361e('0x10')](0x1f4,_0x43dc4e[_0x361e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 39b274a..de747f0 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 _0xebf3=['/openchannel/queues','/sms/queues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','put','/voice/queues/:id','updateVoiceQueue','/outbound','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','post','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','path','express','Router','./rpc.controller','get','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','mailQueues','mailAccounts'];(function(_0x46d8b2,_0x3829c4){var _0x1a351f=function(_0x279ce5){while(--_0x279ce5){_0x46d8b2['push'](_0x46d8b2['shift']());}};_0x1a351f(++_0x3829c4);}(_0xebf3,0x1e1));var _0x3ebf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xebf3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3ebf('0x0'));var util=require('util');var path=require(_0x3ebf('0x1'));var express=require(_0x3ebf('0x2'));var router=express[_0x3ebf('0x3')]();var auth=require('../../components/auth/service');var controller=require(_0x3ebf('0x4'));router[_0x3ebf('0x5')]('/voice/channels',auth['isAuthenticated'](),controller[_0x3ebf('0x6')]);router[_0x3ebf('0x5')](_0x3ebf('0x7'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x9')]);router[_0x3ebf('0x5')](_0x3ebf('0xa'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0xb')]);router[_0x3ebf('0x5')](_0x3ebf('0xc'),auth['isAuthenticated'](),controller['voiceQueues']);router[_0x3ebf('0x5')](_0x3ebf('0xd'),auth['isAuthenticated'](),controller[_0x3ebf('0xe')]);router[_0x3ebf('0x5')]('/mail/queues',auth[_0x3ebf('0x8')](),controller[_0x3ebf('0xf')]);router['get']('/mail/accounts',auth['isAuthenticated'](),controller[_0x3ebf('0x10')]);router[_0x3ebf('0x5')](_0x3ebf('0x11'),auth[_0x3ebf('0x8')](),controller['openchannelQueues']);router['get'](_0x3ebf('0x12'),auth['isAuthenticated'](),controller['smsQueues']);router['get'](_0x3ebf('0x13'),auth[_0x3ebf('0x8')](),controller['whatsappQueues']);router[_0x3ebf('0x5')](_0x3ebf('0x14'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x15')]);router[_0x3ebf('0x5')](_0x3ebf('0x16'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x17')]);router[_0x3ebf('0x5')](_0x3ebf('0x18'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x19')]);router['get'](_0x3ebf('0x1a'),auth[_0x3ebf('0x8')](),controller['voiceQueuesChannel']);router[_0x3ebf('0x5')]('/voice/queues/channels/:uniqueid/hangup',auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x3ebf('0x5')](_0x3ebf('0x1b'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x1c')]);router[_0x3ebf('0x5')]('/voice/queues/:id',auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x1d')]);router[_0x3ebf('0x1e')](_0x3ebf('0x1f'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x20')]);router[_0x3ebf('0x5')](_0x3ebf('0x21'),auth[_0x3ebf('0x8')](),controller['outbound']);router['get']('/outbound/channels',auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x22')]);router['get'](_0x3ebf('0x23'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x24')]);router['put'](_0x3ebf('0x25'),auth['isAuthenticated'](),controller[_0x3ebf('0x26')]);router[_0x3ebf('0x5')](_0x3ebf('0x27'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x28')]);router[_0x3ebf('0x5')](_0x3ebf('0x29'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x2a')]);router['get'](_0x3ebf('0x2b'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x2c')]);router[_0x3ebf('0x5')](_0x3ebf('0x2d'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x2e')]);router[_0x3ebf('0x5')](_0x3ebf('0x2f'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x30')]);router['get'](_0x3ebf('0x31'),auth['isAuthenticated'](),controller[_0x3ebf('0x32')]);router['get']('/openchannel/queues/waitinginteractions',auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x33')]);router['get'](_0x3ebf('0x34'),auth[_0x3ebf('0x8')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x3ebf('0x5')](_0x3ebf('0x35'),auth['isAuthenticated'](),controller[_0x3ebf('0x36')]);router[_0x3ebf('0x5')](_0x3ebf('0x37'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x38')]);router[_0x3ebf('0x5')](_0x3ebf('0x39'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x3a')]);router['post'](_0x3ebf('0x3b'),auth['isAuthenticated'](),controller[_0x3ebf('0x3c')](_0x3ebf('0x3d')));router[_0x3ebf('0x5')](_0x3ebf('0x3e'),auth['isAuthenticated'](),controller['showMailQueues']);router[_0x3ebf('0x3f')](_0x3ebf('0x40'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x3c')](_0x3ebf('0x41')));router[_0x3ebf('0x5')](_0x3ebf('0x42'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x43')]);router[_0x3ebf('0x3f')](_0x3ebf('0x44'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x3c')](_0x3ebf('0x45')));router[_0x3ebf('0x5')](_0x3ebf('0x46'),auth['isAuthenticated'](),controller['showFaxQueues']);router[_0x3ebf('0x3f')](_0x3ebf('0x47'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x3c')](_0x3ebf('0x48')));router['get'](_0x3ebf('0x49'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x4a')]);router[_0x3ebf('0x3f')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0x3ebf('0x3c')]('sms'));router[_0x3ebf('0x3f')](_0x3ebf('0x4b'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x3c')]('whatsapp'));router[_0x3ebf('0x5')](_0x3ebf('0x4c'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x4d')]);router['get'](_0x3ebf('0x4e'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x4f')]);router['post'](_0x3ebf('0x50'),auth[_0x3ebf('0x8')](),controller[_0x3ebf('0x51')]);module[_0x3ebf('0x52')]=router; \ No newline at end of file +var _0x7325=['/chat/queues/:id/notify','queueNotify','chat','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','agentNotify','exports','path','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','outbound','/outbound/channels','/agents','put','/agents/:id/capacity','/telephones','telephones','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues'];(function(_0x5a488c,_0x4cc470){var _0x53a7d6=function(_0x43a0d8){while(--_0x43a0d8){_0x5a488c['push'](_0x5a488c['shift']());}};_0x53a7d6(++_0x4cc470);}(_0x7325,0x1ec));var _0x5732=function(_0x3aeebd,_0x372a76){_0x3aeebd=_0x3aeebd-0x0;var _0x546130=_0x7325[_0x3aeebd];return _0x546130;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5732('0x0'));var express=require('express');var router=express[_0x5732('0x1')]();var auth=require(_0x5732('0x2'));var controller=require(_0x5732('0x3'));router[_0x5732('0x4')](_0x5732('0x5'),auth[_0x5732('0x6')](),controller[_0x5732('0x7')]);router[_0x5732('0x4')](_0x5732('0x8'),auth[_0x5732('0x6')](),controller[_0x5732('0x9')]);router[_0x5732('0x4')]('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller[_0x5732('0xa')]);router[_0x5732('0x4')]('/voice/queues',auth[_0x5732('0x6')](),controller[_0x5732('0xb')]);router[_0x5732('0x4')](_0x5732('0xc'),auth[_0x5732('0x6')](),controller[_0x5732('0xd')]);router[_0x5732('0x4')](_0x5732('0xe'),auth[_0x5732('0x6')](),controller[_0x5732('0xf')]);router['get'](_0x5732('0x10'),auth[_0x5732('0x6')](),controller[_0x5732('0x11')]);router['get'](_0x5732('0x12'),auth[_0x5732('0x6')](),controller[_0x5732('0x13')]);router[_0x5732('0x4')]('/sms/queues',auth['isAuthenticated'](),controller[_0x5732('0x14')]);router[_0x5732('0x4')](_0x5732('0x15'),auth[_0x5732('0x6')](),controller[_0x5732('0x16')]);router[_0x5732('0x4')]('/fax/queues',auth['isAuthenticated'](),controller[_0x5732('0x17')]);router[_0x5732('0x4')](_0x5732('0x18'),auth[_0x5732('0x6')](),controller[_0x5732('0x19')]);router['get']('/voice/queues/channels',auth[_0x5732('0x6')](),controller[_0x5732('0x1a')]);router[_0x5732('0x4')]('/voice/queues/channels/:uniqueid',auth[_0x5732('0x6')](),controller['voiceQueuesChannel']);router[_0x5732('0x4')](_0x5732('0x1b'),auth['isAuthenticated'](),controller[_0x5732('0x1c')]);router[_0x5732('0x4')](_0x5732('0x1d'),auth[_0x5732('0x6')](),controller[_0x5732('0x1e')]);router[_0x5732('0x4')](_0x5732('0x1f'),auth[_0x5732('0x6')](),controller[_0x5732('0x20')]);router['put'](_0x5732('0x1f'),auth['isAuthenticated'](),controller[_0x5732('0x21')]);router[_0x5732('0x4')](_0x5732('0x22'),auth[_0x5732('0x6')](),controller[_0x5732('0x23')]);router['get'](_0x5732('0x24'),auth[_0x5732('0x6')](),controller['outboundChannels']);router[_0x5732('0x4')](_0x5732('0x25'),auth[_0x5732('0x6')](),controller['agents']);router[_0x5732('0x26')](_0x5732('0x27'),auth['isAuthenticated'](),controller['agentCapacity']);router['get'](_0x5732('0x28'),auth[_0x5732('0x6')](),controller[_0x5732('0x29')]);router[_0x5732('0x4')]('/trunks',auth[_0x5732('0x6')](),controller['trunks']);router['get'](_0x5732('0x2a'),auth[_0x5732('0x6')](),controller[_0x5732('0x2b')]);router[_0x5732('0x4')](_0x5732('0x2c'),auth[_0x5732('0x6')](),controller[_0x5732('0x2d')]);router[_0x5732('0x4')](_0x5732('0x2e'),auth[_0x5732('0x6')](),controller[_0x5732('0x2f')]);router[_0x5732('0x4')](_0x5732('0x30'),auth[_0x5732('0x6')](),controller['mailQueuesWaitingInteractions']);router[_0x5732('0x4')](_0x5732('0x31'),auth[_0x5732('0x6')](),controller['openchannelQueuesWaitingInteractions']);router[_0x5732('0x4')]('/openchannel/queues/:id/waitinginteractions',auth[_0x5732('0x6')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x5732('0x4')](_0x5732('0x32'),auth[_0x5732('0x6')](),controller[_0x5732('0x33')]);router['get'](_0x5732('0x34'),auth[_0x5732('0x6')](),controller[_0x5732('0x35')]);router[_0x5732('0x4')](_0x5732('0x36'),auth['isAuthenticated'](),controller[_0x5732('0x37')]);router[_0x5732('0x38')](_0x5732('0x39'),auth[_0x5732('0x6')](),controller['queueNotify'](_0x5732('0x3a')));router[_0x5732('0x4')](_0x5732('0x3b'),auth['isAuthenticated'](),controller[_0x5732('0x3c')]);router[_0x5732('0x38')](_0x5732('0x3d'),auth[_0x5732('0x6')](),controller[_0x5732('0x3e')](_0x5732('0x3f')));router[_0x5732('0x4')]('/chat/queues/:id',auth[_0x5732('0x6')](),controller[_0x5732('0x40')]);router[_0x5732('0x38')](_0x5732('0x41'),auth[_0x5732('0x6')](),controller[_0x5732('0x3e')](_0x5732('0x42')));router[_0x5732('0x4')]('/fax/queues/:id',auth[_0x5732('0x6')](),controller[_0x5732('0x43')]);router['post'](_0x5732('0x44'),auth[_0x5732('0x6')](),controller['queueNotify'](_0x5732('0x45')));router[_0x5732('0x4')]('/openchannel/queues/:id',auth[_0x5732('0x6')](),controller[_0x5732('0x46')]);router[_0x5732('0x38')](_0x5732('0x47'),auth['isAuthenticated'](),controller['queueNotify'](_0x5732('0x48')));router[_0x5732('0x38')](_0x5732('0x49'),auth[_0x5732('0x6')](),controller[_0x5732('0x3e')](_0x5732('0x4a')));router['get'](_0x5732('0x4b'),auth[_0x5732('0x6')](),controller['showSmsQueues']);router['get'](_0x5732('0x4c'),auth[_0x5732('0x6')](),controller['showWhatsappQueues']);router['post']('/agents/:id/notify',auth[_0x5732('0x6')](),controller[_0x5732('0x4d')]);module[_0x5732('0x4e')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 0e0a050..376b777 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 _0xf559=['MessageId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','User','Agent\x20not\x20found','InteractionId','Start','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','then','error','code','message','result','status','name','isNil','rows','find','voiceChannels','VoiceChannels','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','OutboundChannels','agents','Agents','agentCapacity','body','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','SIP/%s','interface','format','agent','internal','AgentCapacity','capacity','telephones','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue'];(function(_0x23b1d5,_0x3043fa){var _0x3f5702=function(_0xc9b7eb){while(--_0xc9b7eb){_0x23b1d5['push'](_0x23b1d5['shift']());}};_0x3f5702(++_0x3043fa);}(_0xf559,0x90));var _0x9f55=function(_0x27f9ed,_0x13fde4){_0x27f9ed=_0x27f9ed-0x0;var _0x88aec0=_0xf559[_0x27f9ed];return _0x88aec0;};'use strict';var BPromise=require(_0x9f55('0x0'));var moment=require(_0x9f55('0x1'));var _=require(_0x9f55('0x2'));var util=require(_0x9f55('0x3'));var db=require(_0x9f55('0x4'))['db'];var logger=require(_0x9f55('0x5'))(_0x9f55('0x6'));var jayson=require('jayson/promise');var amiClient=jayson[_0x9f55('0x7')][_0x9f55('0x8')]({'port':0x232a});var mailClient=jayson[_0x9f55('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0x9f55('0x7')][_0x9f55('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x3fdf99,_0x870783,_0x414a8b){return new BPromise(function(_0x445862,_0x4538ae){var _0x4a6de3=_0x414a8b?_0x414a8b:amiClient;return _0x4a6de3['request'](_0x3fdf99,_0x870783)[_0x9f55('0x9')](function(_0x4a04cd){if(_0x4a04cd[_0x9f55('0xa')]){if(_0x4a04cd[_0x9f55('0xa')][_0x9f55('0xb')]===0x1f4){return _0x4538ae(_0x4a04cd[_0x9f55('0xa')][_0x9f55('0xc')]);}return _0x445862(_0x4a04cd[_0x9f55('0xa')]['message']);}else{_0x445862(_0x4a04cd[_0x9f55('0xd')]);}})['catch'](function(_0x3d2f69){_0x4538ae(_0x3d2f69);});});}function respondWithResult(_0x32293f,_0x360492){_0x360492=_0x360492||0xc8;return function(_0x4a1b6a){if(_0x4a1b6a){return _0x32293f[_0x9f55('0xe')](_0x360492)['json'](_0x4a1b6a);}return _0x32293f['sendStatus'](0x194);};}function handleError(_0x4f69ff,_0x1742b6){_0x1742b6=_0x1742b6||0x1f4;return function(_0x4c9e13){logger[_0x9f55('0xa')](_0x4c9e13['stack']);if(_0x4c9e13[_0x9f55('0xf')]){delete _0x4c9e13[_0x9f55('0xf')];}_0x4f69ff[_0x9f55('0xe')](_0x1742b6)['send'](_0x4c9e13);};}function findById(_0x5e8f40){return function(_0x469fcf){if(!_[_0x9f55('0x10')](_0x5e8f40)&&!_['isNil'](_0x469fcf)&&!_[_0x9f55('0x10')](_0x469fcf[_0x9f55('0x11')])){return _[_0x9f55('0x12')](_0x469fcf[_0x9f55('0x11')],function(_0x8ac466){return _0x8ac466['id']==_0x5e8f40;});}return null;};}exports[_0x9f55('0x13')]=function(_0x3a8082,_0x5aa6ed){return respondWithRpcPromise(_0x9f55('0x14'),_0x3a8082[_0x9f55('0x15')])[_0x9f55('0x9')](respondWithResult(_0x5aa6ed,null))[_0x9f55('0x16')](handleError(_0x5aa6ed,null));};exports[_0x9f55('0x17')]=function(_0x54aded,_0x346425){return respondWithRpcPromise(_0x9f55('0x18'),_[_0x9f55('0x19')](_0x54aded[_0x9f55('0x15')],_0x54aded[_0x9f55('0x1a')]))[_0x9f55('0x9')](respondWithResult(_0x346425,null))[_0x9f55('0x16')](handleError(_0x346425,null));};exports[_0x9f55('0x1b')]=function(_0x3920ce,_0x3b7bec){return respondWithRpcPromise(_0x9f55('0x1c'),_[_0x9f55('0x19')](_0x3920ce['query'],_0x3920ce['params']))[_0x9f55('0x9')](respondWithResult(_0x3b7bec,null))[_0x9f55('0x16')](handleError(_0x3b7bec,null));};exports[_0x9f55('0x1d')]=function(_0x3355ca,_0xb90943){return respondWithRpcPromise(_0x9f55('0x1e'),_0x3355ca[_0x9f55('0x15')])[_0x9f55('0x9')](respondWithResult(_0xb90943,null))['catch'](handleError(_0xb90943,null));};exports[_0x9f55('0x1f')]=function(_0x47062a,_0x243c54){return respondWithRpcPromise(_0x9f55('0x1e'),_0x47062a['query'])[_0x9f55('0x9')](findById(_0x47062a['params']['id']))['then'](respondWithResult(_0x243c54,null))[_0x9f55('0x16')](handleError(_0x243c54,null));};exports[_0x9f55('0x20')]=function(_0x4026f0,_0x15c85c){return respondWithRpcPromise('UpdateVoiceQueue',_['merge'](_0x4026f0['body'],_0x4026f0[_0x9f55('0x1a')]))[_0x9f55('0x9')](respondWithResult(_0x15c85c,null))[_0x9f55('0x16')](handleError(_0x15c85c,null));};exports[_0x9f55('0x21')]=function(_0x433e5d,_0x2b277d){return respondWithRpcPromise(_0x9f55('0x22'),_[_0x9f55('0x19')](_0x433e5d[_0x9f55('0x15')],_0x433e5d[_0x9f55('0x1a')]))['then'](respondWithResult(_0x2b277d,null))[_0x9f55('0x16')](handleError(_0x2b277d,null));};exports[_0x9f55('0x23')]=function(_0x6a3737,_0x5ddbd5){return respondWithRpcPromise('VoiceQueuesChannels',_0x6a3737[_0x9f55('0x15')])['then'](respondWithResult(_0x5ddbd5,null))[_0x9f55('0x16')](handleError(_0x5ddbd5,null));};exports[_0x9f55('0x24')]=function(_0x36bee6,_0xd8094c){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x9f55('0x19')](_0x36bee6[_0x9f55('0x15')],_0x36bee6[_0x9f55('0x1a')]))[_0x9f55('0x9')](respondWithResult(_0xd8094c,null))[_0x9f55('0x16')](handleError(_0xd8094c,null));};exports[_0x9f55('0x25')]=function(_0x3b6a9d,_0x4de146){return respondWithRpcPromise(_0x9f55('0x26'),_[_0x9f55('0x19')](_0x3b6a9d[_0x9f55('0x15')],_0x3b6a9d[_0x9f55('0x1a')]))['then'](respondWithResult(_0x4de146,null))[_0x9f55('0x16')](handleError(_0x4de146,null));};exports[_0x9f55('0x27')]=function(_0x17d3a5,_0x420660){return respondWithRpcPromise(_0x9f55('0x28'),_['merge'](_0x17d3a5[_0x9f55('0x15')],_0x17d3a5['params']))['then'](respondWithResult(_0x420660,null))[_0x9f55('0x16')](handleError(_0x420660,null));};exports['outbound']=function(_0x3bde19,_0x4ed7e7){return respondWithRpcPromise('Outbound',_0x3bde19[_0x9f55('0x15')])[_0x9f55('0x9')](respondWithResult(_0x4ed7e7,null))[_0x9f55('0x16')](handleError(_0x4ed7e7,null));};exports['outboundChannels']=function(_0x1dc175,_0x17e80e){return respondWithRpcPromise(_0x9f55('0x29'),_0x1dc175[_0x9f55('0x15')])[_0x9f55('0x9')](respondWithResult(_0x17e80e,null))[_0x9f55('0x16')](handleError(_0x17e80e,null));};exports[_0x9f55('0x2a')]=function(_0x25a5dd,_0x5c0cf6){var _0x420b07;return respondWithRpcPromise('Agents',_0x25a5dd[_0x9f55('0x15')])[_0x9f55('0x9')](function(_0x2c6966){_0x420b07=_0x2c6966;return respondWithRpcPromise(_0x9f55('0x2b'),_0x25a5dd[_0x9f55('0x15')],routingClient);})[_0x9f55('0x9')](function(_0x4f77de){return _[_0x9f55('0x19')]({},_0x4f77de,_0x420b07);})['then'](respondWithResult(_0x5c0cf6,null))['catch'](handleError(_0x5c0cf6,null));};exports[_0x9f55('0x2c')]=function(_0x4283d1,_0x1b8a0f){if(_0x4283d1[_0x9f55('0x2d')]&&_0x4283d1[_0x9f55('0x2d')]['interaction']&&_0x4283d1[_0x9f55('0x2e')]&&_0x4283d1[_0x9f55('0x2e')][_0x9f55('0xf')]){for(var _0x533d58 in _0x4283d1[_0x9f55('0x2d')][_0x9f55('0x2f')]){if(_0x4283d1[_0x9f55('0x2d')]['interaction'][_0x9f55('0x30')](_0x533d58)){db[_0x9f55('0x31')][_0x9f55('0x32')]({'where':{'channel':_0x533d58,'membername':_0x4283d1['user'][_0x9f55('0xf')],'type':_0x9f55('0x33'),'exitAt':null,'uniqueid':_0x4283d1[_0x9f55('0x2d')][_0x9f55('0x2f')][_0x533d58]&&_0x4283d1[_0x9f55('0x2d')][_0x9f55('0x2f')][_0x533d58][_0x9f55('0x34')]?{'$notIn':_0x4283d1['body'][_0x9f55('0x2f')][_0x533d58]}:{'$ne':null}}})[_0x9f55('0x9')](function(_0xbb6ff2){var _0x2ea480=moment()['format'](_0x9f55('0x35'));for(var _0x106b6e=0x0,_0x42441c=_0xbb6ff2[_0x9f55('0x34')];_0x106b6e<_0x42441c;_0x106b6e+=0x1){_0xbb6ff2[_0x106b6e]['updateAttributes']({'exitAt':_0x2ea480});}});for(var _0x20b794=0x0;_0x20b794<_0x4283d1[_0x9f55('0x2d')][_0x9f55('0x2f')][_0x533d58][_0x9f55('0x34')];_0x20b794+=0x1){db[_0x9f55('0x31')][_0x9f55('0x36')]({'where':{'channel':_0x533d58,'membername':_0x4283d1[_0x9f55('0x2e')]['name'],'type':'INTERACTION','uniqueid':_0x4283d1[_0x9f55('0x2d')][_0x9f55('0x2f')][_0x533d58][_0x20b794],'exitAt':null},'defaults':{'channel':_0x533d58,'membername':_0x4283d1[_0x9f55('0x2e')][_0x9f55('0xf')],'interface':_[_0x9f55('0x10')](_0x4283d1[_0x9f55('0x2e')]['interface'])?util['format'](_0x9f55('0x37'),_0x4283d1['user'][_0x9f55('0xf')]):_0x4283d1[_0x9f55('0x2e')][_0x9f55('0x38')],'type':_0x9f55('0x33'),'enterAt':moment()[_0x9f55('0x39')](_0x9f55('0x35')),'role':_0x9f55('0x3a'),'internal':_0x4283d1[_0x9f55('0x2e')][_0x9f55('0x3b')],'uniqueid':_0x4283d1[_0x9f55('0x2d')][_0x9f55('0x2f')][_0x533d58][_0x20b794]}});}}}}return respondWithRpcPromise(_0x9f55('0x3c'),{'id':_0x4283d1[_0x9f55('0x1a')]['id'],'capacity':_0x4283d1['body'][_0x9f55('0x3d')]},routingClient)[_0x9f55('0x9')](respondWithResult(_0x1b8a0f,null))[_0x9f55('0x16')](handleError(_0x1b8a0f,null));};exports[_0x9f55('0x3e')]=function(_0x454983,_0x6c6e55){return respondWithRpcPromise('Telephones',_0x454983[_0x9f55('0x15')])[_0x9f55('0x9')](respondWithResult(_0x6c6e55,null))[_0x9f55('0x16')](handleError(_0x6c6e55,null));};exports['trunks']=function(_0x1293d6,_0x331b58){return respondWithRpcPromise(_0x9f55('0x3f'),_0x1293d6[_0x9f55('0x15')])[_0x9f55('0x9')](respondWithResult(_0x331b58,null))[_0x9f55('0x16')](handleError(_0x331b58,null));};exports[_0x9f55('0x40')]=function(_0x2bde0a,_0x184133){return respondWithRpcPromise(_0x9f55('0x41'),_0x2bde0a[_0x9f55('0x15')])[_0x9f55('0x9')](respondWithResult(_0x184133,null))[_0x9f55('0x16')](handleError(_0x184133,null));};exports[_0x9f55('0x42')]=function(_0x1083b9,_0x38a446){return respondWithRpcPromise(_0x9f55('0x43'),_0x1083b9['query'],routingClient)[_0x9f55('0x9')](respondWithResult(_0x38a446,null))[_0x9f55('0x16')](handleError(_0x38a446,null));};exports[_0x9f55('0x44')]=function(_0x137fb8,_0x335b07){return respondWithRpcPromise(_0x9f55('0x43'),_0x137fb8[_0x9f55('0x15')],routingClient)[_0x9f55('0x9')](findById(_0x137fb8[_0x9f55('0x1a')]['id']))['then'](respondWithResult(_0x335b07,null))[_0x9f55('0x16')](handleError(_0x335b07,null));};exports[_0x9f55('0x45')]=function(_0x2f3d55,_0x5a0d4d){return respondWithRpcPromise(_0x9f55('0x46'),_0x2f3d55['query'],routingClient)[_0x9f55('0x9')](respondWithResult(_0x5a0d4d,null))[_0x9f55('0x16')](handleError(_0x5a0d4d,null));};exports[_0x9f55('0x47')]=function(_0x18d2ce,_0x105c78){return respondWithRpcPromise(_0x9f55('0x46'),_0x18d2ce['query'],routingClient)[_0x9f55('0x9')](findById(_0x18d2ce['params']['id']))[_0x9f55('0x9')](respondWithResult(_0x105c78,null))['catch'](handleError(_0x105c78,null));};exports['mailAccounts']=function(_0x1f67cd,_0x624188){return respondWithRpcPromise('MailAccounts',_0x1f67cd[_0x9f55('0x15')],mailClient)[_0x9f55('0x9')](respondWithResult(_0x624188,null))[_0x9f55('0x16')](handleError(_0x624188,null));};exports[_0x9f55('0x48')]=function(_0xaad1d7,_0x119437){return respondWithRpcPromise(_0x9f55('0x49'),_0xaad1d7['query'],routingClient)['then'](respondWithResult(_0x119437,null))['catch'](handleError(_0x119437,null));};exports[_0x9f55('0x4a')]=function(_0x16a6a3,_0x4ef291){return respondWithRpcPromise(_0x9f55('0x49'),_0x16a6a3[_0x9f55('0x15')],routingClient)[_0x9f55('0x9')](findById(_0x16a6a3[_0x9f55('0x1a')]['id']))[_0x9f55('0x9')](respondWithResult(_0x4ef291,null))[_0x9f55('0x16')](handleError(_0x4ef291,null));};exports[_0x9f55('0x4b')]=function(_0x3ec5eb,_0xf36eb8){return respondWithRpcPromise(_0x9f55('0x4c'),_0x3ec5eb[_0x9f55('0x15')],routingClient)[_0x9f55('0x9')](respondWithResult(_0xf36eb8,null))[_0x9f55('0x16')](handleError(_0xf36eb8,null));};exports[_0x9f55('0x4d')]=function(_0x136b0b,_0x2cb4eb){return respondWithRpcPromise(_0x9f55('0x4c'),_0x136b0b[_0x9f55('0x15')],routingClient)['then'](findById(_0x136b0b[_0x9f55('0x1a')]['id']))[_0x9f55('0x9')](respondWithResult(_0x2cb4eb,null))[_0x9f55('0x16')](handleError(_0x2cb4eb,null));};exports[_0x9f55('0x4e')]=function(_0x2aa83d,_0x4b1d37){return respondWithRpcPromise(_0x9f55('0x4f'),_0x2aa83d[_0x9f55('0x15')],routingClient)[_0x9f55('0x9')](respondWithResult(_0x4b1d37,null))[_0x9f55('0x16')](handleError(_0x4b1d37,null));};exports[_0x9f55('0x50')]=function(_0x44ba46,_0x1ca4f5){return respondWithRpcPromise('WhatsappQueues',_0x44ba46['query'],routingClient)[_0x9f55('0x9')](findById(_0x44ba46[_0x9f55('0x1a')]['id']))['then'](respondWithResult(_0x1ca4f5,null))['catch'](handleError(_0x1ca4f5,null));};exports[_0x9f55('0x51')]=function(_0x5c15ad,_0x52bee8){return respondWithRpcPromise(_0x9f55('0x52'),_0x5c15ad[_0x9f55('0x15')],routingClient)[_0x9f55('0x9')](respondWithResult(_0x52bee8,null))[_0x9f55('0x16')](handleError(_0x52bee8,null));};exports[_0x9f55('0x53')]=function(_0x260d4b,_0x2de1c6){return respondWithRpcPromise(_0x9f55('0x52'),_0x260d4b[_0x9f55('0x15')],routingClient)[_0x9f55('0x9')](findById(_0x260d4b[_0x9f55('0x1a')]['id']))[_0x9f55('0x9')](respondWithResult(_0x2de1c6,null))[_0x9f55('0x16')](handleError(_0x2de1c6,null));};exports[_0x9f55('0x54')]=function(_0x39145f,_0x5bbcd9){return respondWithRpcPromise(_0x9f55('0x55'),_0x39145f[_0x9f55('0x15')])[_0x9f55('0x9')](respondWithResult(_0x5bbcd9,null))[_0x9f55('0x16')](handleError(_0x5bbcd9,null));};exports['chatQueuesWaitingInteractions']=function(_0x1e0d79,_0x3d382c){return respondWithRpcPromise(_0x9f55('0x56'),_0x1e0d79[_0x9f55('0x15')],routingClient)[_0x9f55('0x9')](respondWithResult(_0x3d382c,null))[_0x9f55('0x16')](handleError(_0x3d382c,null));};exports['mailQueuesWaitingInteractions']=function(_0x4c8c0d,_0x2e5a94){return respondWithRpcPromise(_0x9f55('0x57'),_0x4c8c0d[_0x9f55('0x15')],routingClient)[_0x9f55('0x9')](respondWithResult(_0x2e5a94,null))['catch'](handleError(_0x2e5a94,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x2430b7,_0x44376a){return respondWithRpcPromise(_0x9f55('0x58'),_0x2430b7[_0x9f55('0x15')],routingClient)['then'](respondWithResult(_0x44376a,null))[_0x9f55('0x16')](handleError(_0x44376a,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x32a49c,_0x2ba34c){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x32a49c['query'],routingClient)['then'](function(_0x2437e9){if(_0x32a49c[_0x9f55('0x15')][_0x9f55('0x59')]!==undefined){var _0x4c4e8b=_(_0x2437e9['rows'])[_0x9f55('0x5a')]([_0x32a49c[_0x9f55('0x15')][_0x9f55('0x59')],_0x32a49c[_0x9f55('0x1a')]['id']])[_0x9f55('0x5b')](_0x9f55('0x5c'))[_0x9f55('0x5d')]()[_0x9f55('0x5e')]();return _0x2437e9[_0x9f55('0x11')][_0x9f55('0x5a')](function(_0x2ce453){return _0x4c4e8b[_0x9f55('0x5f')](_0x2ce453['queue_id'])>-0x1;});}else{return _0x2437e9[_0x9f55('0x11')][_0x9f55('0x5a')](function(_0x3facca){return _0x3facca[_0x9f55('0x5c')]===parseInt(_0x32a49c[_0x9f55('0x1a')]['id']);});}})[_0x9f55('0x9')](respondWithResult(_0x2ba34c,null))[_0x9f55('0x16')](handleError(_0x2ba34c,null));};exports[_0x9f55('0x60')]=function(_0x1bf26b,_0x4397d2){return respondWithRpcPromise(_0x9f55('0x61'),_0x1bf26b[_0x9f55('0x15')],routingClient)['then'](respondWithResult(_0x4397d2,null))['catch'](handleError(_0x4397d2,null));};exports[_0x9f55('0x62')]=function(_0x2f358f,_0x1761ae){return respondWithRpcPromise(_0x9f55('0x63'),_0x2f358f[_0x9f55('0x15')],routingClient)['then'](respondWithResult(_0x1761ae,null))[_0x9f55('0x16')](handleError(_0x1761ae,null));};exports[_0x9f55('0x64')]=function(_0xc4048d,_0x186b07){return respondWithRpcPromise(_0x9f55('0x65'),_0xc4048d['query'],routingClient)['then'](respondWithResult(_0x186b07,null))[_0x9f55('0x16')](handleError(_0x186b07,null));};exports[_0x9f55('0x66')]=function(_0x589578){return function(_0xebe7fc,_0x2de4a0){var _0xac2529,_0x4e4bee;var _0x568ebd=_[_0x9f55('0x67')](_0x589578);var _0x5a3750=_0x589578===_0x9f55('0x68')?_0x9f55('0x69'):_0x9f55('0x6a');return db[_0x568ebd+_0x9f55('0x6b')]['findOne']({'raw':!![],'where':{'id':_0xebe7fc['params']['id']}})['then'](function(_0x325934){if(_['isNil'](_0x325934)){throw new Error(_0x568ebd+_0x9f55('0x6c'));}_0xac2529=_0x325934;return db[_0x568ebd+_0x9f55('0x6d')][_0x9f55('0x6e')]({'where':{'id':_0xebe7fc[_0x9f55('0x2d')][_0x9f55('0x6f')]},'include':[{'model':db[_0x568ebd+_0x9f55('0x70')],'as':'Interaction'},{'model':db[_0x568ebd+_0x5a3750],'as':'Account'}]});})[_0x9f55('0x9')](function(_0x20dd1a){if(_['isNil'](_0x20dd1a)){throw new Error(_0x568ebd+_0x9f55('0x71'));}_0x4e4bee=_0x20dd1a;return _0x20dd1a[_0x9f55('0x72')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x4aeb38={'uniqueid':_0x589578+'.'+_0x4e4bee['id']+'.'+_0x4e4bee[_0x9f55('0x70')]['id'],'FromUserId':_0xebe7fc[_0x9f55('0x2e')]['id'],'type':_0x9f55('0x73')};_0x4aeb38[_0x568ebd+_0x9f55('0x74')]=_0x4e4bee['id'];_0x4aeb38[_0x568ebd+'InteractionId']=_0x4e4bee[_0x9f55('0x70')]['id'];_0x4aeb38[_0x9f55('0x75')+_0x568ebd+_0x5a3750+'Id']=_0x4e4bee[_0x9f55('0x6a')]['id'];_0x4aeb38['To'+_0x568ebd+_0x9f55('0x76')]=_0xac2529['id'];return db[_0x568ebd+_0x9f55('0x77')][_0x9f55('0x78')](_0x4aeb38);})[_0x9f55('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0x589578,'interaction':_0x4e4bee[_0x9f55('0x70')],'message':_0x4e4bee,'account':_0x4e4bee[_0x9f55('0x6a')],'applications':[{'id':0x0,'priority':0x1,'app':_0x9f55('0x73'),'appdata':_0xac2529['name']+','+(_0x4e4bee[_0x9f55('0x6a')][_0x9f55('0x79')]||0x12c),'interval':_0x9f55('0x7a')}]},routingClient);})[_0x9f55('0x9')](respondWithResult(_0x2de4a0,null))[_0x9f55('0x16')](handleError(_0x2de4a0,null));};};exports[_0x9f55('0x7b')]=function(_0x382488,_0x41ec6c){var _0x4a59d0,_0x5287b3;if(_[_0x9f55('0x10')](_0x382488[_0x9f55('0x2d')]['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x1ceefd=_0x382488['body'][_0x9f55('0x7c')];var _0xe97ae2=_['capitalize'](_0x1ceefd);var _0x2398b1=_0x1ceefd==='chat'?_0x9f55('0x69'):_0x9f55('0x6a');return db[_0x9f55('0x7d')]['findOne']({'raw':!![],'where':{'id':_0x382488[_0x9f55('0x1a')]['id'],'role':_0x9f55('0x3a')}})[_0x9f55('0x9')](function(_0x278009){if(_[_0x9f55('0x10')](_0x278009)){throw new Error(_0x9f55('0x7e'));}_0x4a59d0=_0x278009;return db[_0xe97ae2+_0x9f55('0x6d')][_0x9f55('0x6e')]({'where':{'id':_0x382488[_0x9f55('0x2d')]['messageId']},'include':[{'model':db[_0xe97ae2+_0x9f55('0x70')],'as':_0x9f55('0x70')},{'model':db[_0xe97ae2+_0x2398b1],'as':_0x9f55('0x6a')}]});})[_0x9f55('0x9')](function(_0x30836d){if(_['isNil'](_0x30836d)){throw new Error(_0xe97ae2+_0x9f55('0x71'));}_0x5287b3=_0x30836d;return _0x30836d[_0x9f55('0x72')]({'read':0x0,'readAt':null,'UserId':null});})[_0x9f55('0x9')](function(){var _0x248bab={'uniqueid':_0x1ceefd+'.'+_0x5287b3['id']+'.'+_0x5287b3[_0x9f55('0x70')]['id'],'FromUserId':_0x382488[_0x9f55('0x2e')]['id'],'type':_0x9f55('0x3a'),'ToUserId':_0x4a59d0['id']};_0x248bab[_0xe97ae2+_0x9f55('0x74')]=_0x5287b3['id'];_0x248bab[_0xe97ae2+_0x9f55('0x7f')]=_0x5287b3[_0x9f55('0x70')]['id'];_0x248bab['From'+_0xe97ae2+_0x2398b1+'Id']=_0x5287b3['Account']['id'];return db[_0xe97ae2+_0x9f55('0x77')]['create'](_0x248bab);})[_0x9f55('0x9')](function(){return respondWithRpcPromise(_0x9f55('0x80'),{'channel':_0x1ceefd,'interaction':_0x5287b3[_0x9f55('0x70')],'message':_0x5287b3,'account':_0x5287b3[_0x9f55('0x6a')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x4a59d0[_0x9f55('0xf')]+','+(_0x5287b3[_0x9f55('0x6a')][_0x9f55('0x81')]||0x12c),'interval':_0x9f55('0x7a')}]},routingClient);})['then'](respondWithResult(_0x41ec6c,null))['catch'](handleError(_0x41ec6c,null));}; \ No newline at end of file +var _0x901c=['params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','OutboundChannels','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','map','queue_id','filter','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','User','create','agentTransferTimeout','bluebird','moment','lodash','util','../../config/logger','client','http','request','then','error','message','result','catch','status','json','sendStatus','stack','name','send','isNil','find','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge'];(function(_0x40c043,_0x1d064e){var _0x5c2c8d=function(_0xab4403){while(--_0xab4403){_0x40c043['push'](_0x40c043['shift']());}};_0x5c2c8d(++_0x1d064e);}(_0x901c,0x1d0));var _0xc901=function(_0x23baf2,_0x401058){_0x23baf2=_0x23baf2-0x0;var _0x2e0001=_0x901c[_0x23baf2];return _0x2e0001;};'use strict';var BPromise=require(_0xc901('0x0'));var moment=require(_0xc901('0x1'));var _=require(_0xc901('0x2'));var util=require(_0xc901('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xc901('0x4'))('api');var jayson=require('jayson/promise');var amiClient=jayson[_0xc901('0x5')][_0xc901('0x6')]({'port':0x232a});var mailClient=jayson[_0xc901('0x5')][_0xc901('0x6')]({'port':0x232b});var routingClient=jayson[_0xc901('0x5')][_0xc901('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x529e3d,_0x30b86a,_0x4448d0){return new BPromise(function(_0xc9971f,_0xafe756){var _0x3964ff=_0x4448d0?_0x4448d0:amiClient;return _0x3964ff[_0xc901('0x7')](_0x529e3d,_0x30b86a)[_0xc901('0x8')](function(_0x41abac){if(_0x41abac[_0xc901('0x9')]){if(_0x41abac['error']['code']===0x1f4){return _0xafe756(_0x41abac['error']['message']);}return _0xc9971f(_0x41abac[_0xc901('0x9')][_0xc901('0xa')]);}else{_0xc9971f(_0x41abac[_0xc901('0xb')]);}})[_0xc901('0xc')](function(_0x370425){_0xafe756(_0x370425);});});}function respondWithResult(_0x212b87,_0x10ee6a){_0x10ee6a=_0x10ee6a||0xc8;return function(_0x3bf0a8){if(_0x3bf0a8){return _0x212b87[_0xc901('0xd')](_0x10ee6a)[_0xc901('0xe')](_0x3bf0a8);}return _0x212b87[_0xc901('0xf')](0x194);};}function handleError(_0x52d121,_0x1838f0){_0x1838f0=_0x1838f0||0x1f4;return function(_0x41dbc3){logger[_0xc901('0x9')](_0x41dbc3[_0xc901('0x10')]);if(_0x41dbc3[_0xc901('0x11')]){delete _0x41dbc3[_0xc901('0x11')];}_0x52d121[_0xc901('0xd')](_0x1838f0)[_0xc901('0x12')](_0x41dbc3);};}function findById(_0x4292e2){return function(_0x5e739f){if(!_['isNil'](_0x4292e2)&&!_[_0xc901('0x13')](_0x5e739f)&&!_['isNil'](_0x5e739f['rows'])){return _[_0xc901('0x14')](_0x5e739f[_0xc901('0x15')],function(_0x3d54a2){return _0x3d54a2['id']==_0x4292e2;});}return null;};}exports[_0xc901('0x16')]=function(_0x2fdaa8,_0x2c2fda){return respondWithRpcPromise(_0xc901('0x17'),_0x2fdaa8[_0xc901('0x18')])['then'](respondWithResult(_0x2c2fda,null))['catch'](handleError(_0x2c2fda,null));};exports[_0xc901('0x19')]=function(_0xc51afb,_0x3382fa){return respondWithRpcPromise(_0xc901('0x1a'),_[_0xc901('0x1b')](_0xc51afb[_0xc901('0x18')],_0xc51afb[_0xc901('0x1c')]))[_0xc901('0x8')](respondWithResult(_0x3382fa,null))[_0xc901('0xc')](handleError(_0x3382fa,null));};exports['voiceChannelStopMixMonitor']=function(_0x54cc21,_0x2598b1){return respondWithRpcPromise(_0xc901('0x1d'),_[_0xc901('0x1b')](_0x54cc21[_0xc901('0x18')],_0x54cc21[_0xc901('0x1c')]))[_0xc901('0x8')](respondWithResult(_0x2598b1,null))[_0xc901('0xc')](handleError(_0x2598b1,null));};exports[_0xc901('0x1e')]=function(_0x24f193,_0x37cd72){return respondWithRpcPromise('VoiceQueues',_0x24f193[_0xc901('0x18')])[_0xc901('0x8')](respondWithResult(_0x37cd72,null))['catch'](handleError(_0x37cd72,null));};exports['showVoiceQueues']=function(_0x5b2074,_0x42472b){return respondWithRpcPromise(_0xc901('0x1f'),_0x5b2074[_0xc901('0x18')])[_0xc901('0x8')](findById(_0x5b2074['params']['id']))['then'](respondWithResult(_0x42472b,null))[_0xc901('0xc')](handleError(_0x42472b,null));};exports['updateVoiceQueue']=function(_0x3250e2,_0x5944ef){return respondWithRpcPromise(_0xc901('0x20'),_[_0xc901('0x1b')](_0x3250e2['body'],_0x3250e2[_0xc901('0x1c')]))['then'](respondWithResult(_0x5944ef,null))[_0xc901('0xc')](handleError(_0x5944ef,null));};exports[_0xc901('0x21')]=function(_0xae9cc7,_0x426ebf){return respondWithRpcPromise(_0xc901('0x22'),_[_0xc901('0x1b')](_0xae9cc7[_0xc901('0x18')],_0xae9cc7[_0xc901('0x1c')]))[_0xc901('0x8')](respondWithResult(_0x426ebf,null))['catch'](handleError(_0x426ebf,null));};exports[_0xc901('0x23')]=function(_0x564b5e,_0x230010){return respondWithRpcPromise('VoiceQueuesChannels',_0x564b5e[_0xc901('0x18')])['then'](respondWithResult(_0x230010,null))[_0xc901('0xc')](handleError(_0x230010,null));};exports[_0xc901('0x24')]=function(_0x2e2880,_0x5e8313){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xc901('0x1b')](_0x2e2880[_0xc901('0x18')],_0x2e2880['params']))[_0xc901('0x8')](respondWithResult(_0x5e8313,null))[_0xc901('0xc')](handleError(_0x5e8313,null));};exports['voiceQueuesChannelHangup']=function(_0x8e516f,_0x14e08e){return respondWithRpcPromise(_0xc901('0x25'),_[_0xc901('0x1b')](_0x8e516f[_0xc901('0x18')],_0x8e516f[_0xc901('0x1c')]))[_0xc901('0x8')](respondWithResult(_0x14e08e,null))[_0xc901('0xc')](handleError(_0x14e08e,null));};exports[_0xc901('0x26')]=function(_0xeb2b68,_0x1bbf77){return respondWithRpcPromise(_0xc901('0x27'),_['merge'](_0xeb2b68[_0xc901('0x18')],_0xeb2b68[_0xc901('0x1c')]))[_0xc901('0x8')](respondWithResult(_0x1bbf77,null))[_0xc901('0xc')](handleError(_0x1bbf77,null));};exports[_0xc901('0x28')]=function(_0x104dd1,_0x13a178){return respondWithRpcPromise(_0xc901('0x29'),_0x104dd1['query'])[_0xc901('0x8')](respondWithResult(_0x13a178,null))[_0xc901('0xc')](handleError(_0x13a178,null));};exports['outboundChannels']=function(_0x5c5997,_0xa3604e){return respondWithRpcPromise(_0xc901('0x2a'),_0x5c5997[_0xc901('0x18')])[_0xc901('0x8')](respondWithResult(_0xa3604e,null))['catch'](handleError(_0xa3604e,null));};exports['agents']=function(_0x429e64,_0x1a7085){var _0x39203a;return respondWithRpcPromise(_0xc901('0x2b'),_0x429e64['query'])[_0xc901('0x8')](function(_0x36cbcb){_0x39203a=_0x36cbcb;return respondWithRpcPromise(_0xc901('0x2b'),_0x429e64[_0xc901('0x18')],routingClient);})[_0xc901('0x8')](function(_0x3e7100){return _['merge']({},_0x3e7100,_0x39203a);})[_0xc901('0x8')](respondWithResult(_0x1a7085,null))[_0xc901('0xc')](handleError(_0x1a7085,null));};exports[_0xc901('0x2c')]=function(_0x5a811d,_0x122620){if(_0x5a811d[_0xc901('0x2d')]&&_0x5a811d['body'][_0xc901('0x2e')]&&_0x5a811d[_0xc901('0x2f')]&&_0x5a811d['user'][_0xc901('0x11')]){for(var _0x410349 in _0x5a811d[_0xc901('0x2d')][_0xc901('0x2e')]){if(_0x5a811d[_0xc901('0x2d')]['interaction'][_0xc901('0x30')](_0x410349)){db[_0xc901('0x31')]['findAll']({'where':{'channel':_0x410349,'membername':_0x5a811d[_0xc901('0x2f')]['name'],'type':_0xc901('0x32'),'exitAt':null,'uniqueid':_0x5a811d[_0xc901('0x2d')][_0xc901('0x2e')][_0x410349]&&_0x5a811d[_0xc901('0x2d')]['interaction'][_0x410349]['length']?{'$notIn':_0x5a811d['body'][_0xc901('0x2e')][_0x410349]}:{'$ne':null}}})['then'](function(_0x2171a0){var _0x221e7f=moment()[_0xc901('0x33')](_0xc901('0x34'));for(var _0x4c9aa8=0x0,_0xe5fba6=_0x2171a0[_0xc901('0x35')];_0x4c9aa8<_0xe5fba6;_0x4c9aa8+=0x1){_0x2171a0[_0x4c9aa8][_0xc901('0x36')]({'exitAt':_0x221e7f});}});for(var _0x2303e8=0x0;_0x2303e8<_0x5a811d[_0xc901('0x2d')][_0xc901('0x2e')][_0x410349][_0xc901('0x35')];_0x2303e8+=0x1){db[_0xc901('0x31')]['findOrCreate']({'where':{'channel':_0x410349,'membername':_0x5a811d['user']['name'],'type':'INTERACTION','uniqueid':_0x5a811d[_0xc901('0x2d')]['interaction'][_0x410349][_0x2303e8],'exitAt':null},'defaults':{'channel':_0x410349,'membername':_0x5a811d[_0xc901('0x2f')][_0xc901('0x11')],'interface':_['isNil'](_0x5a811d['user'][_0xc901('0x37')])?util[_0xc901('0x33')](_0xc901('0x38'),_0x5a811d[_0xc901('0x2f')][_0xc901('0x11')]):_0x5a811d[_0xc901('0x2f')][_0xc901('0x37')],'type':'INTERACTION','enterAt':moment()[_0xc901('0x33')](_0xc901('0x34')),'role':_0xc901('0x39'),'internal':_0x5a811d[_0xc901('0x2f')][_0xc901('0x3a')],'uniqueid':_0x5a811d[_0xc901('0x2d')]['interaction'][_0x410349][_0x2303e8]}});}}}}return respondWithRpcPromise(_0xc901('0x3b'),{'id':_0x5a811d[_0xc901('0x1c')]['id'],'capacity':_0x5a811d['body'][_0xc901('0x3c')]},routingClient)[_0xc901('0x8')](respondWithResult(_0x122620,null))[_0xc901('0xc')](handleError(_0x122620,null));};exports[_0xc901('0x3d')]=function(_0x2fc20d,_0x959471){return respondWithRpcPromise(_0xc901('0x3e'),_0x2fc20d['query'])[_0xc901('0x8')](respondWithResult(_0x959471,null))[_0xc901('0xc')](handleError(_0x959471,null));};exports[_0xc901('0x3f')]=function(_0x1f7304,_0xc74169){return respondWithRpcPromise(_0xc901('0x40'),_0x1f7304[_0xc901('0x18')])['then'](respondWithResult(_0xc74169,null))[_0xc901('0xc')](handleError(_0xc74169,null));};exports['campaigns']=function(_0x45c70a,_0x256f92){return respondWithRpcPromise('Campaigns',_0x45c70a['query'])[_0xc901('0x8')](respondWithResult(_0x256f92,null))['catch'](handleError(_0x256f92,null));};exports[_0xc901('0x41')]=function(_0x36b318,_0x4289e0){return respondWithRpcPromise(_0xc901('0x42'),_0x36b318[_0xc901('0x18')],routingClient)[_0xc901('0x8')](respondWithResult(_0x4289e0,null))[_0xc901('0xc')](handleError(_0x4289e0,null));};exports[_0xc901('0x43')]=function(_0x222230,_0x4a896d){return respondWithRpcPromise(_0xc901('0x42'),_0x222230[_0xc901('0x18')],routingClient)['then'](findById(_0x222230[_0xc901('0x1c')]['id']))[_0xc901('0x8')](respondWithResult(_0x4a896d,null))[_0xc901('0xc')](handleError(_0x4a896d,null));};exports['mailQueues']=function(_0x460a6b,_0x469cf8){return respondWithRpcPromise(_0xc901('0x44'),_0x460a6b['query'],routingClient)[_0xc901('0x8')](respondWithResult(_0x469cf8,null))['catch'](handleError(_0x469cf8,null));};exports[_0xc901('0x45')]=function(_0x248f16,_0x34b07f){return respondWithRpcPromise(_0xc901('0x44'),_0x248f16[_0xc901('0x18')],routingClient)['then'](findById(_0x248f16['params']['id']))[_0xc901('0x8')](respondWithResult(_0x34b07f,null))['catch'](handleError(_0x34b07f,null));};exports[_0xc901('0x46')]=function(_0x2cdc72,_0x48a421){return respondWithRpcPromise(_0xc901('0x47'),_0x2cdc72[_0xc901('0x18')],mailClient)[_0xc901('0x8')](respondWithResult(_0x48a421,null))[_0xc901('0xc')](handleError(_0x48a421,null));};exports['openchannelQueues']=function(_0x5c5625,_0x1a6292){return respondWithRpcPromise(_0xc901('0x48'),_0x5c5625[_0xc901('0x18')],routingClient)[_0xc901('0x8')](respondWithResult(_0x1a6292,null))[_0xc901('0xc')](handleError(_0x1a6292,null));};exports[_0xc901('0x49')]=function(_0xbc1a1,_0x4bdd2f){return respondWithRpcPromise('OpenchannelQueues',_0xbc1a1['query'],routingClient)[_0xc901('0x8')](findById(_0xbc1a1[_0xc901('0x1c')]['id']))[_0xc901('0x8')](respondWithResult(_0x4bdd2f,null))[_0xc901('0xc')](handleError(_0x4bdd2f,null));};exports[_0xc901('0x4a')]=function(_0xed89ed,_0x5b4a75){return respondWithRpcPromise(_0xc901('0x4b'),_0xed89ed[_0xc901('0x18')],routingClient)[_0xc901('0x8')](respondWithResult(_0x5b4a75,null))[_0xc901('0xc')](handleError(_0x5b4a75,null));};exports['showSmsQueues']=function(_0x26d757,_0x4ef0e8){return respondWithRpcPromise(_0xc901('0x4b'),_0x26d757[_0xc901('0x18')],routingClient)[_0xc901('0x8')](findById(_0x26d757['params']['id']))[_0xc901('0x8')](respondWithResult(_0x4ef0e8,null))[_0xc901('0xc')](handleError(_0x4ef0e8,null));};exports[_0xc901('0x4c')]=function(_0x1e60a1,_0x368963){return respondWithRpcPromise(_0xc901('0x4d'),_0x1e60a1[_0xc901('0x18')],routingClient)[_0xc901('0x8')](respondWithResult(_0x368963,null))[_0xc901('0xc')](handleError(_0x368963,null));};exports[_0xc901('0x4e')]=function(_0x172c3c,_0x321d7d){return respondWithRpcPromise(_0xc901('0x4d'),_0x172c3c[_0xc901('0x18')],routingClient)['then'](findById(_0x172c3c[_0xc901('0x1c')]['id']))[_0xc901('0x8')](respondWithResult(_0x321d7d,null))[_0xc901('0xc')](handleError(_0x321d7d,null));};exports[_0xc901('0x4f')]=function(_0x160984,_0xdb1cb4){return respondWithRpcPromise(_0xc901('0x50'),_0x160984['query'],routingClient)['then'](respondWithResult(_0xdb1cb4,null))['catch'](handleError(_0xdb1cb4,null));};exports['showFaxQueues']=function(_0x478dd2,_0x3abf7e){return respondWithRpcPromise(_0xc901('0x50'),_0x478dd2[_0xc901('0x18')],routingClient)[_0xc901('0x8')](findById(_0x478dd2[_0xc901('0x1c')]['id']))[_0xc901('0x8')](respondWithResult(_0x3abf7e,null))['catch'](handleError(_0x3abf7e,null));};exports[_0xc901('0x51')]=function(_0xef7cfd,_0x4d3295){return respondWithRpcPromise(_0xc901('0x52'),_0xef7cfd['query'])[_0xc901('0x8')](respondWithResult(_0x4d3295,null))['catch'](handleError(_0x4d3295,null));};exports['chatQueuesWaitingInteractions']=function(_0x1b967e,_0x57d9da){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x1b967e['query'],routingClient)['then'](respondWithResult(_0x57d9da,null))[_0xc901('0xc')](handleError(_0x57d9da,null));};exports[_0xc901('0x53')]=function(_0x5b2139,_0x5e43fd){return respondWithRpcPromise(_0xc901('0x54'),_0x5b2139['query'],routingClient)[_0xc901('0x8')](respondWithResult(_0x5e43fd,null))[_0xc901('0xc')](handleError(_0x5e43fd,null));};exports[_0xc901('0x55')]=function(_0x4659ca,_0x59fc3b){return respondWithRpcPromise(_0xc901('0x56'),_0x4659ca[_0xc901('0x18')],routingClient)[_0xc901('0x8')](respondWithResult(_0x59fc3b,null))['catch'](handleError(_0x59fc3b,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x20b9b8,_0x23255b){return respondWithRpcPromise(_0xc901('0x56'),_0x20b9b8['query'],routingClient)[_0xc901('0x8')](function(_0x3f269c){if(_0x20b9b8[_0xc901('0x18')][_0xc901('0x57')]!==undefined){var _0x5bc69f=_(_0x3f269c[_0xc901('0x15')])['filter']([_0x20b9b8[_0xc901('0x18')][_0xc901('0x57')],_0x20b9b8[_0xc901('0x1c')]['id']])[_0xc901('0x58')](_0xc901('0x59'))['uniq']()['value']();return _0x3f269c[_0xc901('0x15')][_0xc901('0x5a')](function(_0x42d73d){return _0x5bc69f['indexOf'](_0x42d73d['queue_id'])>-0x1;});}else{return _0x3f269c['rows'][_0xc901('0x5a')](function(_0x29a374){return _0x29a374['queue_id']===parseInt(_0x20b9b8['params']['id']);});}})[_0xc901('0x8')](respondWithResult(_0x23255b,null))['catch'](handleError(_0x23255b,null));};exports['smsQueuesWaitingInteractions']=function(_0x50f85f,_0xd26e9e){return respondWithRpcPromise(_0xc901('0x5b'),_0x50f85f[_0xc901('0x18')],routingClient)[_0xc901('0x8')](respondWithResult(_0xd26e9e,null))['catch'](handleError(_0xd26e9e,null));};exports[_0xc901('0x5c')]=function(_0x14c2f1,_0x11f144){return respondWithRpcPromise(_0xc901('0x5d'),_0x14c2f1[_0xc901('0x18')],routingClient)[_0xc901('0x8')](respondWithResult(_0x11f144,null))[_0xc901('0xc')](handleError(_0x11f144,null));};exports[_0xc901('0x5e')]=function(_0x14fbda,_0x117373){return respondWithRpcPromise(_0xc901('0x5f'),_0x14fbda[_0xc901('0x18')],routingClient)['then'](respondWithResult(_0x117373,null))['catch'](handleError(_0x117373,null));};exports[_0xc901('0x60')]=function(_0x13a9da){return function(_0x3ee530,_0xdcdbc6){var _0x23f6c9,_0x3dd62b;var _0x3c7479=_[_0xc901('0x61')](_0x13a9da);var _0x37f901=_0x13a9da===_0xc901('0x62')?_0xc901('0x63'):_0xc901('0x64');return db[_0x3c7479+_0xc901('0x65')][_0xc901('0x66')]({'raw':!![],'where':{'id':_0x3ee530[_0xc901('0x1c')]['id']}})['then'](function(_0x55bffa){if(_[_0xc901('0x13')](_0x55bffa)){throw new Error(_0x3c7479+_0xc901('0x67'));}_0x23f6c9=_0x55bffa;return db[_0x3c7479+_0xc901('0x68')][_0xc901('0x66')]({'where':{'id':_0x3ee530[_0xc901('0x2d')][_0xc901('0x69')]},'include':[{'model':db[_0x3c7479+_0xc901('0x6a')],'as':'Interaction'},{'model':db[_0x3c7479+_0x37f901],'as':_0xc901('0x64')}]});})['then'](function(_0x226bfe){if(_[_0xc901('0x13')](_0x226bfe)){throw new Error(_0x3c7479+_0xc901('0x6b'));}_0x3dd62b=_0x226bfe;return _0x226bfe[_0xc901('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x12b020={'uniqueid':_0x13a9da+'.'+_0x3dd62b['id']+'.'+_0x3dd62b[_0xc901('0x6a')]['id'],'FromUserId':_0x3ee530[_0xc901('0x2f')]['id'],'type':_0xc901('0x6d')};_0x12b020[_0x3c7479+_0xc901('0x6e')]=_0x3dd62b['id'];_0x12b020[_0x3c7479+_0xc901('0x6f')]=_0x3dd62b[_0xc901('0x6a')]['id'];_0x12b020[_0xc901('0x70')+_0x3c7479+_0x37f901+'Id']=_0x3dd62b['Account']['id'];_0x12b020['To'+_0x3c7479+_0xc901('0x71')]=_0x23f6c9['id'];return db[_0x3c7479+_0xc901('0x72')]['create'](_0x12b020);})[_0xc901('0x8')](function(){return respondWithRpcPromise(_0xc901('0x73'),{'channel':_0x13a9da,'interaction':_0x3dd62b[_0xc901('0x6a')],'message':_0x3dd62b,'account':_0x3dd62b[_0xc901('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x23f6c9[_0xc901('0x11')]+','+(_0x3dd62b['Account'][_0xc901('0x74')]||0x12c),'interval':_0xc901('0x75')}]},routingClient);})[_0xc901('0x8')](respondWithResult(_0xdcdbc6,null))[_0xc901('0xc')](handleError(_0xdcdbc6,null));};};exports['agentNotify']=function(_0xb89ce2,_0x37a6b4){var _0x31b654,_0x5863a3;if(_[_0xc901('0x13')](_0xb89ce2[_0xc901('0x2d')][_0xc901('0x76')])){throw new Error(_0xc901('0x77'));}var _0x34717a=_0xb89ce2[_0xc901('0x2d')][_0xc901('0x76')];var _0x29f051=_['capitalize'](_0x34717a);var _0x548d36=_0x34717a==='chat'?_0xc901('0x63'):_0xc901('0x64');return db[_0xc901('0x78')][_0xc901('0x66')]({'raw':!![],'where':{'id':_0xb89ce2[_0xc901('0x1c')]['id'],'role':_0xc901('0x39')}})[_0xc901('0x8')](function(_0x21a5c5){if(_['isNil'](_0x21a5c5)){throw new Error('Agent\x20not\x20found');}_0x31b654=_0x21a5c5;return db[_0x29f051+_0xc901('0x68')][_0xc901('0x66')]({'where':{'id':_0xb89ce2[_0xc901('0x2d')][_0xc901('0x69')]},'include':[{'model':db[_0x29f051+_0xc901('0x6a')],'as':_0xc901('0x6a')},{'model':db[_0x29f051+_0x548d36],'as':_0xc901('0x64')}]});})[_0xc901('0x8')](function(_0x392360){if(_[_0xc901('0x13')](_0x392360)){throw new Error(_0x29f051+_0xc901('0x6b'));}_0x5863a3=_0x392360;return _0x392360[_0xc901('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})[_0xc901('0x8')](function(){var _0x3ea553={'uniqueid':_0x34717a+'.'+_0x5863a3['id']+'.'+_0x5863a3[_0xc901('0x6a')]['id'],'FromUserId':_0xb89ce2[_0xc901('0x2f')]['id'],'type':'agent','ToUserId':_0x31b654['id']};_0x3ea553[_0x29f051+_0xc901('0x6e')]=_0x5863a3['id'];_0x3ea553[_0x29f051+_0xc901('0x6f')]=_0x5863a3[_0xc901('0x6a')]['id'];_0x3ea553['From'+_0x29f051+_0x548d36+'Id']=_0x5863a3[_0xc901('0x64')]['id'];return db[_0x29f051+_0xc901('0x72')][_0xc901('0x79')](_0x3ea553);})[_0xc901('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x34717a,'interaction':_0x5863a3[_0xc901('0x6a')],'message':_0x5863a3,'account':_0x5863a3[_0xc901('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x31b654['name']+','+(_0x5863a3['Account'][_0xc901('0x7a')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xc901('0x8')](respondWithResult(_0x37a6b4,null))[_0xc901('0xc')](handleError(_0x37a6b4,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 3b0fd12..fddb5a8 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 _0x936c=['create','put','/:id','delete','destroy','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/run','run'];(function(_0x4d2366,_0x412bfe){var _0xefd8bb=function(_0x17e49c){while(--_0x17e49c){_0x4d2366['push'](_0x4d2366['shift']());}};_0xefd8bb(++_0x412bfe);}(_0x936c,0x104));var _0xc936=function(_0x2575ee,_0xf3bd61){_0x2575ee=_0x2575ee-0x0;var _0x3ec172=_0x936c[_0x2575ee];return _0x3ec172;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc936('0x0'));var router=express[_0xc936('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xc936('0x2'));var interaction=require(_0xc936('0x3'));var config=require(_0xc936('0x4'));var controller=require('./schedule.controller');router[_0xc936('0x5')]('/',auth[_0xc936('0x6')](),controller[_0xc936('0x7')]);router['get']('/:id',auth[_0xc936('0x6')](),controller['show']);router[_0xc936('0x5')](_0xc936('0x8'),auth[_0xc936('0x6')](),controller[_0xc936('0x9')]);router['post']('/',auth[_0xc936('0x6')](),controller[_0xc936('0xa')]);router[_0xc936('0xb')](_0xc936('0xc'),auth[_0xc936('0x6')](),controller['update']);router[_0xc936('0xd')](_0xc936('0xc'),auth[_0xc936('0x6')](),controller[_0xc936('0xe')]);module['exports']=router; \ No newline at end of file +var _0x59c0=['exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/run','run','create','put','update','/:id'];(function(_0xc0134a,_0x3e22b1){var _0x5e1a65=function(_0x3d4c1a){while(--_0x3d4c1a){_0xc0134a['push'](_0xc0134a['shift']());}};_0x5e1a65(++_0x3e22b1);}(_0x59c0,0xc7));var _0x059c=function(_0x475095,_0x1fbad8){_0x475095=_0x475095-0x0;var _0x1edc0e=_0x59c0[_0x475095];return _0x1edc0e;};'use strict';var multer=require(_0x059c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x059c('0x1'));var express=require(_0x059c('0x2'));var router=express['Router']();var fs_extra=require(_0x059c('0x3'));var auth=require(_0x059c('0x4'));var interaction=require(_0x059c('0x5'));var config=require(_0x059c('0x6'));var controller=require('./schedule.controller');router[_0x059c('0x7')]('/',auth[_0x059c('0x8')](),controller[_0x059c('0x9')]);router[_0x059c('0x7')]('/:id',auth[_0x059c('0x8')](),controller[_0x059c('0xa')]);router[_0x059c('0x7')](_0x059c('0xb'),auth[_0x059c('0x8')](),controller[_0x059c('0xc')]);router['post']('/',auth[_0x059c('0x8')](),controller[_0x059c('0xd')]);router[_0x059c('0xe')]('/:id',auth[_0x059c('0x8')](),controller[_0x059c('0xf')]);router['delete'](_0x059c('0x10'),auth[_0x059c('0x8')](),controller['destroy']);module[_0x059c('0x11')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 6d754df..0696b75 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 _0x3dd2=['INTEGER','ENUM','years','quarters','months','weeks','days','minutes','pdf','xlsx','default','custom','BOOLEAN','TEXT','exports','STRING','0\x200\x20*\x20*\x20*','DATE'];(function(_0x2b595d,_0x5e5838){var _0x4e377f=function(_0x3e441a){while(--_0x3e441a){_0x2b595d['push'](_0x2b595d['shift']());}};_0x4e377f(++_0x5e5838);}(_0x3dd2,0x164));var _0x23dd=function(_0xb7d76f,_0x57523b){_0xb7d76f=_0xb7d76f-0x0;var _0x244606=_0x3dd2[_0xb7d76f];return _0x244606;};'use strict';var Sequelize=require('sequelize');module[_0x23dd('0x0')]={'name':{'type':Sequelize[_0x23dd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x23dd('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x23dd('0x1')],'allowNull':![],'defaultValue':_0x23dd('0x2')},'startAt':{'type':Sequelize[_0x23dd('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x23dd('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x23dd('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x23dd('0x5')](_0x23dd('0x6'),_0x23dd('0x7'),_0x23dd('0x8'),_0x23dd('0x9'),_0x23dd('0xa'),'hours',_0x23dd('0xb')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x23dd('0x5')]('csv',_0x23dd('0xc'),_0x23dd('0xd')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x23dd('0x5')]('custom',_0x23dd('0xe')),'allowNull':![],'defaultValue':_0x23dd('0xf')},'sendMail':{'type':Sequelize[_0x23dd('0x10')],'defaultValue':![]},'email':{'type':Sequelize[_0x23dd('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x23dd('0x11')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x7509=['BOOLEAN','0\x200\x20*\x20*\x20*','DATE','quarters','months','weeks','hours','minutes','days','ENUM','csv','xlsx','custom','default','TEXT','sequelize','exports','STRING'];(function(_0x54bac2,_0x2b09f9){var _0x1ffdf9=function(_0x55eff4){while(--_0x55eff4){_0x54bac2['push'](_0x54bac2['shift']());}};_0x1ffdf9(++_0x2b09f9);}(_0x7509,0x12f));var _0x9750=function(_0x19f564,_0x45fd69){_0x19f564=_0x19f564-0x0;var _0xf5be2a=_0x7509[_0x19f564];return _0xf5be2a;};'use strict';var Sequelize=require(_0x9750('0x0'));module[_0x9750('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x9750('0x2')]},'active':{'type':Sequelize[_0x9750('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9750('0x4')},'startAt':{'type':Sequelize[_0x9750('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x9750('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years',_0x9750('0x6'),_0x9750('0x7'),_0x9750('0x8'),'days',_0x9750('0x9'),_0x9750('0xa')),'allowNull':![],'defaultValue':_0x9750('0xb')},'output':{'type':Sequelize[_0x9750('0xc')](_0x9750('0xd'),'pdf',_0x9750('0xe')),'allowNull':![],'defaultValue':_0x9750('0xd')},'type':{'type':Sequelize[_0x9750('0xc')](_0x9750('0xf'),_0x9750('0x10')),'allowNull':![],'defaultValue':_0x9750('0xf')},'sendMail':{'type':Sequelize[_0x9750('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x9750('0x2')]},'cc':{'type':Sequelize[_0x9750('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x9750('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 316ff19..95cb5dd 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 _0x55d5=['run','../../config/schedule','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','Scheduler','UserProfileResource','then','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','options','includeAll','include','findAll','show','keys','catch','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','params'];(function(_0x35d856,_0xa52d38){var _0x3f94cb=function(_0x1a38aa){while(--_0x1a38aa){_0x35d856['push'](_0x35d856['shift']());}};_0x3f94cb(++_0xa52d38);}(_0x55d5,0xf8));var _0x555d=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x55d5[_0x4a747d];return _0x3a5b5c;};'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(_0x555d('0x0'));var moment=require('moment');var BPromise=require(_0x555d('0x1'));var Mustache=require(_0x555d('0x2'));var util=require(_0x555d('0x3'));var path=require(_0x555d('0x4'));var sox=require(_0x555d('0x5'));var csv=require(_0x555d('0x6'));var ejs=require(_0x555d('0x7'));var fs=require('fs');var fs_extra=require(_0x555d('0x8'));var _=require(_0x555d('0x9'));var squel=require(_0x555d('0xa'));var crypto=require(_0x555d('0xb'));var jsforce=require(_0x555d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x555d('0x6'));var querystring=require(_0x555d('0xd'));var Papa=require(_0x555d('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x555d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x555d('0x10'));var logger=require(_0x555d('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x555d('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x555d('0x13'))['db'];function respondWithStatusCode(_0x19a37e,_0x4c3b4e){_0x4c3b4e=_0x4c3b4e||0xcc;return function(_0x5bfd7b){if(_0x5bfd7b){return _0x19a37e[_0x555d('0x14')](_0x4c3b4e);}return _0x19a37e['status'](_0x4c3b4e)[_0x555d('0x15')]();};}function respondWithResult(_0x3ea74f,_0xe9f71d){_0xe9f71d=_0xe9f71d||0xc8;return function(_0xce1533){if(_0xce1533){return _0x3ea74f[_0x555d('0x16')](_0xe9f71d)[_0x555d('0x17')](_0xce1533);}};}function respondWithFilteredResult(_0x28579e,_0x5cb791){return function(_0x3d7208){if(_0x3d7208){var _0x590622=typeof _0x5cb791['offset']===_0x555d('0x18')&&typeof _0x5cb791[_0x555d('0x19')]===_0x555d('0x18');var _0x54aaa5=_0x3d7208[_0x555d('0x1a')];var _0x169f65=_0x590622?0x0:_0x5cb791[_0x555d('0x1b')];var _0x5ecef1=_0x590622?_0x3d7208[_0x555d('0x1a')]:_0x5cb791[_0x555d('0x1b')]+_0x5cb791['limit'];var _0x9c6c18;if(_0x5ecef1>=_0x54aaa5){_0x5ecef1=_0x54aaa5;_0x9c6c18=0xc8;}else{_0x9c6c18=0xce;}_0x28579e['status'](_0x9c6c18);return _0x28579e[_0x555d('0x1c')]('Content-Range',_0x169f65+'-'+_0x5ecef1+'/'+_0x54aaa5)[_0x555d('0x17')](_0x3d7208);}return null;};}function patchUpdates(_0x10394c){return function(_0x1b1e8a){try{jsonpatch[_0x555d('0x1d')](_0x1b1e8a,_0x10394c,!![]);}catch(_0x3522fe){return BPromise[_0x555d('0x1e')](_0x3522fe);}return _0x1b1e8a[_0x555d('0x1f')]();};}function saveUpdates(_0x3e00b9,_0x1e559c){return function(_0x346b1e){if(_0x346b1e){return _0x346b1e[_0x555d('0x20')](_0x3e00b9)['then'](function(_0x17b77e){return _0x17b77e;});}return null;};}function removeEntity(_0xc8c69b,_0x186dec){return function(_0x3a5297){if(_0x3a5297){return _0x3a5297[_0x555d('0x21')]()['then'](function(){var _0x1b5696=_0x3a5297['get']({'plain':!![]});var _0x40f200=_0x555d('0x22');return db[_0x555d('0x23')][_0x555d('0x21')]({'where':{'type':_0x40f200,'resourceId':_0x1b5696['id']}})['then'](function(){return _0x3a5297;});})[_0x555d('0x24')](function(){_0xc8c69b[_0x555d('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14de1a,_0x4dfdab){return function(_0x31858d){if(!_0x31858d){_0x14de1a[_0x555d('0x14')](0x194);}return _0x31858d;};}function handleError(_0x439f22,_0x4658c0){_0x4658c0=_0x4658c0||0x1f4;return function(_0x347c95){logger[_0x555d('0x25')](_0x347c95[_0x555d('0x26')]);if(_0x347c95[_0x555d('0x27')]){delete _0x347c95[_0x555d('0x27')];}_0x439f22['status'](_0x4658c0)[_0x555d('0x28')](_0x347c95);};}exports[_0x555d('0x29')]=function(_0x1e45da,_0x5736d0){var _0x3c3b53={},_0x25db43={},_0x55d033={'count':0x0,'rows':[]};var _0x2ce86f=_[_0x555d('0x2a')](db[_0x555d('0x2b')][_0x555d('0x2c')],function(_0x40a479){return{'name':_0x40a479[_0x555d('0x2d')],'type':_0x40a479[_0x555d('0x2e')][_0x555d('0x2f')]};});_0x25db43[_0x555d('0x30')]=_[_0x555d('0x2a')](_0x2ce86f,_0x555d('0x27'));_0x25db43[_0x555d('0x31')]=_['keys'](_0x1e45da[_0x555d('0x31')]);_0x25db43['filters']=_[_0x555d('0x32')](_0x25db43[_0x555d('0x30')],_0x25db43[_0x555d('0x31')]);_0x3c3b53[_0x555d('0x33')]=_[_0x555d('0x32')](_0x25db43[_0x555d('0x30')],qs[_0x555d('0x34')](_0x1e45da[_0x555d('0x31')][_0x555d('0x34')]));_0x3c3b53['attributes']=_0x3c3b53['attributes'][_0x555d('0x35')]?_0x3c3b53['attributes']:_0x25db43[_0x555d('0x30')];if(!_0x1e45da['query'][_0x555d('0x36')](_0x555d('0x37'))){_0x3c3b53['limit']=qs['limit'](_0x1e45da[_0x555d('0x31')]['limit']);_0x3c3b53[_0x555d('0x1b')]=qs['offset'](_0x1e45da[_0x555d('0x31')]['offset']);}_0x3c3b53[_0x555d('0x38')]=qs['sort'](_0x1e45da[_0x555d('0x31')]['sort']);_0x3c3b53[_0x555d('0x39')]=qs['filters'](_[_0x555d('0x3a')](_0x1e45da['query'],_0x25db43[_0x555d('0x3b')]),_0x2ce86f);if(_0x1e45da[_0x555d('0x31')][_0x555d('0x3c')]){_0x3c3b53[_0x555d('0x39')]=_[_0x555d('0x3d')](_0x3c3b53[_0x555d('0x39')],{'$or':_[_0x555d('0x2a')](_0x2ce86f,function(_0x1f0641){if(_0x1f0641[_0x555d('0x2e')]!=='VIRTUAL'){var _0x3f6d7d={};_0x3f6d7d[_0x1f0641[_0x555d('0x27')]]={'$like':'%'+_0x1e45da[_0x555d('0x31')][_0x555d('0x3c')]+'%'};return _0x3f6d7d;}})});}_0x3c3b53=_[_0x555d('0x3d')]({},_0x3c3b53,_0x1e45da[_0x555d('0x3e')]);var _0x1eb373={'where':_0x3c3b53[_0x555d('0x39')]};return db[_0x555d('0x2b')][_0x555d('0x1a')](_0x1eb373)[_0x555d('0x24')](function(_0x20d116){_0x55d033['count']=_0x20d116;if(_0x1e45da[_0x555d('0x31')][_0x555d('0x3f')]){_0x3c3b53[_0x555d('0x40')]=[{'all':!![]}];}return db[_0x555d('0x2b')][_0x555d('0x41')](_0x3c3b53);})[_0x555d('0x24')](function(_0x5023ce){_0x55d033['rows']=_0x5023ce;return _0x55d033;})['then'](respondWithFilteredResult(_0x5736d0,_0x3c3b53))['catch'](handleError(_0x5736d0,null));};exports[_0x555d('0x42')]=function(_0x583906,_0x5e8c65){var _0x15a7ac={'raw':![],'where':{'id':_0x583906['params']['id']}},_0x42fa47={};_0x42fa47[_0x555d('0x30')]=_[_0x555d('0x43')](db[_0x555d('0x2b')][_0x555d('0x2c')]);_0x42fa47[_0x555d('0x31')]=_['keys'](_0x583906[_0x555d('0x31')]);_0x42fa47[_0x555d('0x3b')]=_['intersection'](_0x42fa47[_0x555d('0x30')],_0x42fa47[_0x555d('0x31')]);_0x15a7ac['attributes']=_[_0x555d('0x32')](_0x42fa47[_0x555d('0x30')],qs[_0x555d('0x34')](_0x583906[_0x555d('0x31')][_0x555d('0x34')]));_0x15a7ac[_0x555d('0x33')]=_0x15a7ac['attributes'][_0x555d('0x35')]?_0x15a7ac[_0x555d('0x33')]:_0x42fa47[_0x555d('0x30')];if(_0x583906[_0x555d('0x31')]['includeAll']){_0x15a7ac[_0x555d('0x40')]=[{'all':!![]}];}_0x15a7ac=_[_0x555d('0x3d')]({},_0x15a7ac,_0x583906[_0x555d('0x3e')]);return db['Schedule']['find'](_0x15a7ac)[_0x555d('0x24')](handleEntityNotFound(_0x5e8c65,null))[_0x555d('0x24')](respondWithResult(_0x5e8c65,null))[_0x555d('0x44')](handleError(_0x5e8c65,null));};exports['create']=function(_0x3f8817,_0x310e11){return db[_0x555d('0x2b')][_0x555d('0x45')](_0x3f8817[_0x555d('0x46')],{})[_0x555d('0x24')](function(_0x2985a7){var _0x4071e0=_0x3f8817[_0x555d('0x47')][_0x555d('0x48')]({'plain':!![]});if(!_0x4071e0)throw new Error(_0x555d('0x49'));if(_0x4071e0['role']===_0x555d('0x47')){var _0x13df57=_0x2985a7[_0x555d('0x48')]({'plain':!![]});var _0x26f148=_0x555d('0x22');return db[_0x555d('0x4a')][_0x555d('0x4b')]({'where':{'name':_0x26f148,'userProfileId':_0x4071e0[_0x555d('0x4c')]},'raw':!![]})[_0x555d('0x24')](function(_0x242e02){if(_0x242e02&&_0x242e02[_0x555d('0x4d')]===0x0){return db[_0x555d('0x23')][_0x555d('0x45')]({'name':_0x13df57[_0x555d('0x27')],'resourceId':_0x13df57['id'],'type':_0x242e02['name'],'sectionId':_0x242e02['id']},{})[_0x555d('0x24')](function(){return _0x2985a7;});}else{return _0x2985a7;}})[_0x555d('0x44')](function(_0x3dce6a){logger['error'](_0x555d('0x4e'),_0x3dce6a);throw _0x3dce6a;});}return _0x2985a7;})[_0x555d('0x24')](respondWithResult(_0x310e11,0xc9))['catch'](handleError(_0x310e11,null));};exports[_0x555d('0x20')]=function(_0x3c4691,_0x1cab2f){if(_0x3c4691[_0x555d('0x46')]['id']){delete _0x3c4691[_0x555d('0x46')]['id'];}return db[_0x555d('0x2b')]['find']({'where':{'id':_0x3c4691[_0x555d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1cab2f,null))[_0x555d('0x24')](saveUpdates(_0x3c4691['body'],null))[_0x555d('0x24')](respondWithResult(_0x1cab2f,null))[_0x555d('0x44')](handleError(_0x1cab2f,null));};exports[_0x555d('0x21')]=function(_0x4ae031,_0x2be5b4){return db[_0x555d('0x2b')][_0x555d('0x4b')]({'where':{'id':_0x4ae031[_0x555d('0x4f')]['id']}})[_0x555d('0x24')](handleEntityNotFound(_0x2be5b4,null))[_0x555d('0x24')](removeEntity(_0x2be5b4,null))[_0x555d('0x44')](handleError(_0x2be5b4,null));};exports[_0x555d('0x50')]=function(_0x6e0112,_0x51bab2,_0x1d4e35){var _0x3d6183=require(_0x555d('0x51'));return db[_0x555d('0x2b')][_0x555d('0x4b')]({'where':{'id':_0x6e0112['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x51bab2,null))[_0x555d('0x24')](function(){_0x3d6183[_0x555d('0x50')](_0x6e0112[_0x555d('0x4f')]['id']);})[_0x555d('0x24')](respondWithStatusCode(_0x51bab2,null))[_0x555d('0x44')](handleError(_0x51bab2,null));}; \ No newline at end of file +var _0xd683=['to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','json','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','stack','name','map','Schedule','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','../../config/schedule','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x2db028,_0x1cc47d){var _0x11b379=function(_0x5787dc){while(--_0x5787dc){_0x2db028['push'](_0x2db028['shift']());}};_0x11b379(++_0x1cc47d);}(_0xd683,0x190));var _0x3d68=function(_0x31fc7a,_0x4fde7d){_0x31fc7a=_0x31fc7a-0x0;var _0x4539b1=_0xd683[_0x31fc7a];return _0x4539b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3d68('0x0'));var zipdir=require(_0x3d68('0x1'));var jsonpatch=require(_0x3d68('0x2'));var rp=require(_0x3d68('0x3'));var moment=require(_0x3d68('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3d68('0x5'));var util=require(_0x3d68('0x6'));var path=require(_0x3d68('0x7'));var sox=require(_0x3d68('0x8'));var csv=require('to-csv');var ejs=require(_0x3d68('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d68('0xa'));var squel=require(_0x3d68('0xb'));var crypto=require(_0x3d68('0xc'));var jsforce=require(_0x3d68('0xd'));var deskjs=require(_0x3d68('0xe'));var toCsv=require(_0x3d68('0xf'));var querystring=require(_0x3d68('0x10'));var Papa=require(_0x3d68('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3d68('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d68('0x13'));var logger=require(_0x3d68('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x3d68('0x15'));var licenseUtil=require(_0x3d68('0x16'));var db=require(_0x3d68('0x17'))['db'];function respondWithStatusCode(_0x589d32,_0x4d3c51){_0x4d3c51=_0x4d3c51||0xcc;return function(_0x535e6f){if(_0x535e6f){return _0x589d32[_0x3d68('0x18')](_0x4d3c51);}return _0x589d32[_0x3d68('0x19')](_0x4d3c51)[_0x3d68('0x1a')]();};}function respondWithResult(_0x526917,_0x3252bc){_0x3252bc=_0x3252bc||0xc8;return function(_0x22ae2f){if(_0x22ae2f){return _0x526917[_0x3d68('0x19')](_0x3252bc)['json'](_0x22ae2f);}};}function respondWithFilteredResult(_0x503d92,_0x16e761){return function(_0x8f557a){if(_0x8f557a){var _0x48fd82=typeof _0x16e761['offset']===_0x3d68('0x1b')&&typeof _0x16e761['limit']===_0x3d68('0x1b');var _0x4c8989=_0x8f557a[_0x3d68('0x1c')];var _0x511947=_0x48fd82?0x0:_0x16e761['offset'];var _0x496149=_0x48fd82?_0x8f557a[_0x3d68('0x1c')]:_0x16e761[_0x3d68('0x1d')]+_0x16e761[_0x3d68('0x1e')];var _0x3e8841;if(_0x496149>=_0x4c8989){_0x496149=_0x4c8989;_0x3e8841=0xc8;}else{_0x3e8841=0xce;}_0x503d92[_0x3d68('0x19')](_0x3e8841);return _0x503d92[_0x3d68('0x1f')]('Content-Range',_0x511947+'-'+_0x496149+'/'+_0x4c8989)[_0x3d68('0x20')](_0x8f557a);}return null;};}function patchUpdates(_0x1f53ad){return function(_0x571971){try{jsonpatch[_0x3d68('0x21')](_0x571971,_0x1f53ad,!![]);}catch(_0x450afa){return BPromise[_0x3d68('0x22')](_0x450afa);}return _0x571971[_0x3d68('0x23')]();};}function saveUpdates(_0x1c054e,_0x531cac){return function(_0xe61a8e){if(_0xe61a8e){return _0xe61a8e[_0x3d68('0x24')](_0x1c054e)[_0x3d68('0x25')](function(_0x2fcc33){return _0x2fcc33;});}return null;};}function removeEntity(_0x4f0423,_0x514993){return function(_0x7ca43a){if(_0x7ca43a){return _0x7ca43a[_0x3d68('0x26')]()['then'](function(){var _0x5c5245=_0x7ca43a[_0x3d68('0x27')]({'plain':!![]});var _0x1d4da1=_0x3d68('0x28');return db[_0x3d68('0x29')][_0x3d68('0x26')]({'where':{'type':_0x1d4da1,'resourceId':_0x5c5245['id']}})[_0x3d68('0x25')](function(){return _0x7ca43a;});})['then'](function(){_0x4f0423[_0x3d68('0x19')](0xcc)[_0x3d68('0x1a')]();});}};}function handleEntityNotFound(_0x3ed82a,_0x21e0d3){return function(_0x2382a8){if(!_0x2382a8){_0x3ed82a[_0x3d68('0x18')](0x194);}return _0x2382a8;};}function handleError(_0x319fdc,_0x2be0e9){_0x2be0e9=_0x2be0e9||0x1f4;return function(_0x54888a){logger['error'](_0x54888a[_0x3d68('0x2a')]);if(_0x54888a[_0x3d68('0x2b')]){delete _0x54888a[_0x3d68('0x2b')];}_0x319fdc[_0x3d68('0x19')](_0x2be0e9)['send'](_0x54888a);};}exports['index']=function(_0xe33c8a,_0xbfb887){var _0x444875={},_0x35a888={},_0x44a42d={'count':0x0,'rows':[]};var _0x4bd0a1=_[_0x3d68('0x2c')](db[_0x3d68('0x2d')][_0x3d68('0x2e')],function(_0x20c21f){return{'name':_0x20c21f[_0x3d68('0x2f')],'type':_0x20c21f['type'][_0x3d68('0x30')]};});_0x35a888[_0x3d68('0x31')]=_[_0x3d68('0x2c')](_0x4bd0a1,_0x3d68('0x2b'));_0x35a888[_0x3d68('0x32')]=_['keys'](_0xe33c8a[_0x3d68('0x32')]);_0x35a888[_0x3d68('0x33')]=_[_0x3d68('0x34')](_0x35a888[_0x3d68('0x31')],_0x35a888['query']);_0x444875[_0x3d68('0x35')]=_['intersection'](_0x35a888[_0x3d68('0x31')],qs[_0x3d68('0x36')](_0xe33c8a[_0x3d68('0x32')][_0x3d68('0x36')]));_0x444875[_0x3d68('0x35')]=_0x444875[_0x3d68('0x35')][_0x3d68('0x37')]?_0x444875[_0x3d68('0x35')]:_0x35a888['model'];if(!_0xe33c8a[_0x3d68('0x32')]['hasOwnProperty'](_0x3d68('0x38'))){_0x444875[_0x3d68('0x1e')]=qs[_0x3d68('0x1e')](_0xe33c8a[_0x3d68('0x32')]['limit']);_0x444875['offset']=qs['offset'](_0xe33c8a[_0x3d68('0x32')]['offset']);}_0x444875[_0x3d68('0x39')]=qs[_0x3d68('0x3a')](_0xe33c8a[_0x3d68('0x32')][_0x3d68('0x3a')]);_0x444875['where']=qs[_0x3d68('0x33')](_[_0x3d68('0x3b')](_0xe33c8a['query'],_0x35a888['filters']),_0x4bd0a1);if(_0xe33c8a[_0x3d68('0x32')][_0x3d68('0x3c')]){_0x444875[_0x3d68('0x3d')]=_[_0x3d68('0x3e')](_0x444875['where'],{'$or':_[_0x3d68('0x2c')](_0x4bd0a1,function(_0x54a3a3){if(_0x54a3a3[_0x3d68('0x3f')]!==_0x3d68('0x40')){var _0x1f3474={};_0x1f3474[_0x54a3a3[_0x3d68('0x2b')]]={'$like':'%'+_0xe33c8a[_0x3d68('0x32')]['filter']+'%'};return _0x1f3474;}})});}_0x444875=_[_0x3d68('0x3e')]({},_0x444875,_0xe33c8a[_0x3d68('0x41')]);var _0x2050cf={'where':_0x444875['where']};return db[_0x3d68('0x2d')]['count'](_0x2050cf)[_0x3d68('0x25')](function(_0x1a964a){_0x44a42d['count']=_0x1a964a;if(_0xe33c8a['query'][_0x3d68('0x42')]){_0x444875[_0x3d68('0x43')]=[{'all':!![]}];}return db[_0x3d68('0x2d')]['findAll'](_0x444875);})[_0x3d68('0x25')](function(_0x230853){_0x44a42d[_0x3d68('0x44')]=_0x230853;return _0x44a42d;})[_0x3d68('0x25')](respondWithFilteredResult(_0xbfb887,_0x444875))['catch'](handleError(_0xbfb887,null));};exports[_0x3d68('0x45')]=function(_0x58b802,_0x280025){var _0x206899={'raw':![],'where':{'id':_0x58b802[_0x3d68('0x46')]['id']}},_0x375d9c={};_0x375d9c[_0x3d68('0x31')]=_['keys'](db[_0x3d68('0x2d')]['rawAttributes']);_0x375d9c[_0x3d68('0x32')]=_['keys'](_0x58b802[_0x3d68('0x32')]);_0x375d9c[_0x3d68('0x33')]=_[_0x3d68('0x34')](_0x375d9c['model'],_0x375d9c[_0x3d68('0x32')]);_0x206899[_0x3d68('0x35')]=_[_0x3d68('0x34')](_0x375d9c[_0x3d68('0x31')],qs['fields'](_0x58b802[_0x3d68('0x32')][_0x3d68('0x36')]));_0x206899[_0x3d68('0x35')]=_0x206899[_0x3d68('0x35')][_0x3d68('0x37')]?_0x206899['attributes']:_0x375d9c[_0x3d68('0x31')];if(_0x58b802['query'][_0x3d68('0x42')]){_0x206899['include']=[{'all':!![]}];}_0x206899=_[_0x3d68('0x3e')]({},_0x206899,_0x58b802[_0x3d68('0x41')]);return db[_0x3d68('0x2d')]['find'](_0x206899)[_0x3d68('0x25')](handleEntityNotFound(_0x280025,null))['then'](respondWithResult(_0x280025,null))['catch'](handleError(_0x280025,null));};exports[_0x3d68('0x47')]=function(_0x1d73c4,_0x9bd436){return db[_0x3d68('0x2d')][_0x3d68('0x47')](_0x1d73c4['body'],{})['then'](function(_0x111297){var _0x3e6abd=_0x1d73c4[_0x3d68('0x48')]['get']({'plain':!![]});if(!_0x3e6abd)throw new Error(_0x3d68('0x49'));if(_0x3e6abd[_0x3d68('0x4a')]===_0x3d68('0x48')){var _0x38fb8a=_0x111297[_0x3d68('0x27')]({'plain':!![]});var _0x115d56=_0x3d68('0x28');return db['UserProfileSection'][_0x3d68('0x4b')]({'where':{'name':_0x115d56,'userProfileId':_0x3e6abd[_0x3d68('0x4c')]},'raw':!![]})[_0x3d68('0x25')](function(_0x43eda9){if(_0x43eda9&&_0x43eda9['autoAssociation']===0x0){return db[_0x3d68('0x29')]['create']({'name':_0x38fb8a[_0x3d68('0x2b')],'resourceId':_0x38fb8a['id'],'type':_0x43eda9['name'],'sectionId':_0x43eda9['id']},{})[_0x3d68('0x25')](function(){return _0x111297;});}else{return _0x111297;}})[_0x3d68('0x4d')](function(_0x13b834){logger[_0x3d68('0x4e')](_0x3d68('0x4f'),_0x13b834);throw _0x13b834;});}return _0x111297;})[_0x3d68('0x25')](respondWithResult(_0x9bd436,0xc9))[_0x3d68('0x4d')](handleError(_0x9bd436,null));};exports['update']=function(_0x545503,_0x558657){if(_0x545503['body']['id']){delete _0x545503['body']['id'];}return db[_0x3d68('0x2d')][_0x3d68('0x4b')]({'where':{'id':_0x545503[_0x3d68('0x46')]['id']}})['then'](handleEntityNotFound(_0x558657,null))[_0x3d68('0x25')](saveUpdates(_0x545503[_0x3d68('0x50')],null))[_0x3d68('0x25')](respondWithResult(_0x558657,null))['catch'](handleError(_0x558657,null));};exports[_0x3d68('0x26')]=function(_0x54794f,_0x5af311){return db[_0x3d68('0x2d')][_0x3d68('0x4b')]({'where':{'id':_0x54794f[_0x3d68('0x46')]['id']}})[_0x3d68('0x25')](handleEntityNotFound(_0x5af311,null))[_0x3d68('0x25')](removeEntity(_0x5af311,null))['catch'](handleError(_0x5af311,null));};exports[_0x3d68('0x51')]=function(_0x19636d,_0x34d388,_0x4338b6){var _0xa8f059=require(_0x3d68('0x52'));return db['Schedule'][_0x3d68('0x4b')]({'where':{'id':_0x19636d[_0x3d68('0x46')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x34d388,null))[_0x3d68('0x25')](function(){_0xa8f059['run'](_0x19636d[_0x3d68('0x46')]['id']);})['then'](respondWithStatusCode(_0x34d388,null))[_0x3d68('0x4d')](handleError(_0x34d388,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 649592b..3516d04 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 _0x955e=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','tools_schedules'];(function(_0x19f451,_0x4b5e9b){var _0x376db5=function(_0x29b5d6){while(--_0x29b5d6){_0x19f451['push'](_0x19f451['shift']());}};_0x376db5(++_0x4b5e9b);}(_0x955e,0x84));var _0xe955=function(_0xb875ee,_0x583042){_0xb875ee=_0xb875ee-0x0;var _0x4c7f3a=_0x955e[_0xb875ee];return _0x4c7f3a;};'use strict';var _=require(_0xe955('0x0'));var util=require(_0xe955('0x1'));var logger=require(_0xe955('0x2'))('api');var moment=require(_0xe955('0x3'));var BPromise=require(_0xe955('0x4'));var rp=require(_0xe955('0x5'));var fs=require('fs');var path=require(_0xe955('0x6'));var rimraf=require(_0xe955('0x7'));var config=require(_0xe955('0x8'));var attributes=require(_0xe955('0x9'));module[_0xe955('0xa')]=function(_0x2fe74e,_0x1d77c0){return _0x2fe74e['define']('Schedule',attributes,{'tableName':_0xe955('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a2d=['./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','../../config/logger','bluebird','request-promise','../../config/environment'];(function(_0x7192f6,_0x2e6a89){var _0x477b1c=function(_0x165855){while(--_0x165855){_0x7192f6['push'](_0x7192f6['shift']());}};_0x477b1c(++_0x2e6a89);}(_0x0a2d,0x131));var _0xd0a2=function(_0x163444,_0xd51d57){_0x163444=_0x163444-0x0;var _0x407b3e=_0x0a2d[_0x163444];return _0x407b3e;};'use strict';var _=require(_0xd0a2('0x0'));var util=require('util');var logger=require(_0xd0a2('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd0a2('0x2'));var rp=require(_0xd0a2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd0a2('0x4'));var attributes=require(_0xd0a2('0x5'));module[_0xd0a2('0x6')]=function(_0x29651b,_0x2698e7){return _0x29651b[_0xd0a2('0x7')](_0xd0a2('0x8'),attributes,{'tableName':_0xd0a2('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 a885433..76074b9 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 _0x2147=['message','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','http','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x578482,_0x5f3424){var _0x5582ea=function(_0x5bbe5f){while(--_0x5bbe5f){_0x578482['push'](_0x578482['shift']());}};_0x5582ea(++_0x5f3424);}(_0x2147,0x192));var _0x7214=function(_0x509ca9,_0x2203bd){_0x509ca9=_0x509ca9-0x0;var _0x446f32=_0x2147[_0x509ca9];return _0x446f32;};'use strict';var _=require(_0x7214('0x0'));var util=require(_0x7214('0x1'));var moment=require('moment');var BPromise=require(_0x7214('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7214('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7214('0x4'))(_0x7214('0x5'));var config=require(_0x7214('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7214('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4f30d8,_0x444eca,_0x55048a){return new BPromise(function(_0x2b95b2,_0x405d2e){return client['request'](_0x4f30d8,_0x55048a)['then'](function(_0x510a3b){logger[_0x7214('0x8')](_0x7214('0x9'),_0x444eca,_0x7214('0xa'));logger['debug'](_0x7214('0xb'),_0x444eca,_0x7214('0xa'),JSON['stringify'](_0x510a3b));if(_0x510a3b[_0x7214('0xc')]){if(_0x510a3b[_0x7214('0xc')][_0x7214('0xd')]===0x1f4){logger[_0x7214('0xc')](_0x7214('0x9'),_0x444eca,_0x510a3b[_0x7214('0xc')]['message']);return _0x405d2e(_0x510a3b[_0x7214('0xc')][_0x7214('0xe')]);}logger['error'](_0x7214('0x9'),_0x444eca,_0x510a3b[_0x7214('0xc')][_0x7214('0xe')]);return _0x2b95b2(_0x510a3b['error'][_0x7214('0xe')]);}else{logger[_0x7214('0x8')](_0x7214('0x9'),_0x444eca,_0x7214('0xa'));_0x2b95b2(_0x510a3b['result'][_0x7214('0xe')]);}})[_0x7214('0xf')](function(_0x36098f){logger[_0x7214('0xc')]('Schedule,\x20%s,\x20%s',_0x444eca,_0x36098f);_0x405d2e(_0x36098f);});});} \ No newline at end of file +var _0xdff7=['then','info','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','error','code','Schedule,\x20%s,\x20%s','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x59f5a3,_0x1beca7){var _0x2d1932=function(_0x42841f){while(--_0x42841f){_0x59f5a3['push'](_0x59f5a3['shift']());}};_0x2d1932(++_0x1beca7);}(_0xdff7,0xb9));var _0x7dff=function(_0x3958b1,_0x2954e1){_0x3958b1=_0x3958b1-0x0;var _0xb70fe3=_0xdff7[_0x3958b1];return _0xb70fe3;};'use strict';var _=require('lodash');var util=require(_0x7dff('0x0'));var moment=require('moment');var BPromise=require(_0x7dff('0x1'));var rs=require(_0x7dff('0x2'));var fs=require('fs');var Redis=require(_0x7dff('0x3'));var db=require(_0x7dff('0x4'))['db'];var utils=require(_0x7dff('0x5'));var logger=require(_0x7dff('0x6'))(_0x7dff('0x7'));var config=require(_0x7dff('0x8'));var jayson=require(_0x7dff('0x9'));var client=jayson[_0x7dff('0xa')][_0x7dff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x298a9b,_0x3c64cd,_0x1cf170){return new BPromise(function(_0x40a211,_0x1ad554){return client[_0x7dff('0xc')](_0x298a9b,_0x1cf170)[_0x7dff('0xd')](function(_0x6479ab){logger[_0x7dff('0xe')]('Schedule,\x20%s,\x20%s',_0x3c64cd,_0x7dff('0xf'));logger['debug'](_0x7dff('0x10'),_0x3c64cd,_0x7dff('0xf'),JSON['stringify'](_0x6479ab));if(_0x6479ab[_0x7dff('0x11')]){if(_0x6479ab['error'][_0x7dff('0x12')]===0x1f4){logger[_0x7dff('0x11')](_0x7dff('0x13'),_0x3c64cd,_0x6479ab['error'][_0x7dff('0x14')]);return _0x1ad554(_0x6479ab[_0x7dff('0x11')][_0x7dff('0x14')]);}logger[_0x7dff('0x11')]('Schedule,\x20%s,\x20%s',_0x3c64cd,_0x6479ab[_0x7dff('0x11')][_0x7dff('0x14')]);return _0x40a211(_0x6479ab[_0x7dff('0x11')][_0x7dff('0x14')]);}else{logger[_0x7dff('0xe')]('Schedule,\x20%s,\x20%s',_0x3c64cd,_0x7dff('0xf'));_0x40a211(_0x6479ab[_0x7dff('0x15')]['message']);}})['catch'](function(_0x90b35c){logger[_0x7dff('0x11')](_0x7dff('0x13'),_0x3c64cd,_0x90b35c);_0x1ad554(_0x90b35c);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 47dc28b..7fb4948 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 _0xf54e=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','/:id/download','download','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x37de27,_0x2f9fa9){var _0xd7770f=function(_0x1aefbe){while(--_0x1aefbe){_0x37de27['push'](_0x37de27['shift']());}};_0xd7770f(++_0x2f9fa9);}(_0xf54e,0xec));var _0xef54=function(_0x1a9390,_0x3339e6){_0x1a9390=_0x1a9390-0x0;var _0x2b4514=_0xf54e[_0x1a9390];return _0x2b4514;};'use strict';var multer=require(_0xef54('0x0'));var util=require(_0xef54('0x1'));var path=require(_0xef54('0x2'));var timeout=require(_0xef54('0x3'));var express=require(_0xef54('0x4'));var router=express[_0xef54('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xef54('0x6'));var interaction=require(_0xef54('0x7'));var config=require(_0xef54('0x8'));var controller=require('./screenRecording.controller');router[_0xef54('0x9')]('/',auth[_0xef54('0xa')](),controller[_0xef54('0xb')]);router['get'](_0xef54('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xef54('0x9')](_0xef54('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xef54('0x9')](_0xef54('0xe'),auth[_0xef54('0xa')](),controller[_0xef54('0xf')]);router[_0xef54('0x10')]('/',auth[_0xef54('0xa')](),controller[_0xef54('0x11')]);router[_0xef54('0x12')](_0xef54('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xef54('0x13')](_0xef54('0xd'),auth[_0xef54('0xa')](),controller[_0xef54('0x14')]);module[_0xef54('0x15')]=router; \ No newline at end of file +var _0xc883=['get','isAuthenticated','index','/describe','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./screenRecording.controller'];(function(_0x4787d2,_0x2114f4){var _0x367d75=function(_0xde4b66){while(--_0xde4b66){_0x4787d2['push'](_0x4787d2['shift']());}};_0x367d75(++_0x2114f4);}(_0xc883,0xcf));var _0x3c88=function(_0x59ddb0,_0x2081c3){_0x59ddb0=_0x59ddb0-0x0;var _0x1dba64=_0xc883[_0x59ddb0];return _0x1dba64;};'use strict';var multer=require(_0x3c88('0x0'));var util=require(_0x3c88('0x1'));var path=require(_0x3c88('0x2'));var timeout=require(_0x3c88('0x3'));var express=require(_0x3c88('0x4'));var router=express[_0x3c88('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3c88('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3c88('0x7'));var controller=require(_0x3c88('0x8'));router[_0x3c88('0x9')]('/',auth[_0x3c88('0xa')](),controller[_0x3c88('0xb')]);router[_0x3c88('0x9')](_0x3c88('0xc'),auth[_0x3c88('0xa')](),controller['describe']);router[_0x3c88('0x9')](_0x3c88('0xd'),auth[_0x3c88('0xa')](),controller[_0x3c88('0xe')]);router[_0x3c88('0x9')](_0x3c88('0xf'),auth[_0x3c88('0xa')](),controller[_0x3c88('0x10')]);router[_0x3c88('0x11')]('/',auth[_0x3c88('0xa')](),controller[_0x3c88('0x12')]);router[_0x3c88('0x13')]('/:id',auth[_0x3c88('0xa')](),controller[_0x3c88('0x14')]);router[_0x3c88('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x3c88('0x16')]);module[_0x3c88('0x17')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 194d18e..5d82d7c 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 _0x500c=['value','extname','STRING','replace','INTEGER','setDataValue','startedAt','MM-DD-YYYY\x20HH:mm','toString','DATE','closedAt','format','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue'];(function(_0x737a1f,_0x235fef){var _0x16eba1=function(_0x292aa8){while(--_0x292aa8){_0x737a1f['push'](_0x737a1f['shift']());}};_0x16eba1(++_0x235fef);}(_0x500c,0x188));var _0xc500=function(_0x2e169f,_0x420058){_0x2e169f=_0x2e169f-0x0;var _0x2f2552=_0x500c[_0x2e169f];return _0x2f2552;};'use strict';var Sequelize=require(_0xc500('0x0'));var moment=require(_0xc500('0x1'));var path=require(_0xc500('0x2'));var config=require(_0xc500('0x3'));module[_0xc500('0x4')]={'format':{'type':Sequelize[_0xc500('0x5')],'get':function(){return this[_0xc500('0x6')](_0xc500('0x7'))?path[_0xc500('0x8')](this[_0xc500('0x6')](_0xc500('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0xc500('0x9')]},'channel':{'type':Sequelize[_0xc500('0x9')]},'value':{'type':Sequelize[_0xc500('0x9')],'set':function(_0x3bc410){var _0x5dd365=_0x3bc410[_0xc500('0xa')](/\\/g,'/');this['setDataValue'](_0xc500('0x7'),_0x5dd365);}},'rating':{'type':Sequelize[_0xc500('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xc500('0xb')],'set':function(_0x3b40f2){this[_0xc500('0xc')](_0xc500('0xd'),moment()['subtract'](_0x3b40f2,'ms'));this[_0xc500('0xc')]('closedAt',moment());this[_0xc500('0xc')]('duration',_0x3b40f2);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xc500('0x6')](_0xc500('0xd')))['format'](_0xc500('0xe'))[_0xc500('0xf')]();}},'closedAt':{'type':Sequelize[_0xc500('0x10')],'get':function(){return moment(this[_0xc500('0x6')](_0xc500('0x11')))[_0xc500('0x12')](_0xc500('0xe'))[_0xc500('0xf')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xc500('0x6')](_0xc500('0x13')))['format'](_0xc500('0xe'))[_0xc500('0xf')]();}},'updatedAt':{'type':Sequelize[_0xc500('0x10')],'get':function(){return moment(this[_0xc500('0x6')](_0xc500('0x14')))[_0xc500('0x12')](_0xc500('0xe'))['toString']();}}}; \ No newline at end of file +var _0x7916=['setDataValue','INTEGER','startedAt','subtract','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','closedAt','updatedAt','sequelize','path','../../config/environment','VIRTUAL','getDataValue','value','extname','STRING'];(function(_0x51aea2,_0x3492b0){var _0x269bb9=function(_0x1bc4ef){while(--_0x1bc4ef){_0x51aea2['push'](_0x51aea2['shift']());}};_0x269bb9(++_0x3492b0);}(_0x7916,0x128));var _0x6791=function(_0x378277,_0x3405d1){_0x378277=_0x378277-0x0;var _0x4b0831=_0x7916[_0x378277];return _0x4b0831;};'use strict';var Sequelize=require(_0x6791('0x0'));var moment=require('moment');var path=require(_0x6791('0x1'));var config=require(_0x6791('0x2'));module['exports']={'format':{'type':Sequelize[_0x6791('0x3')],'get':function(){return this[_0x6791('0x4')](_0x6791('0x5'))?path[_0x6791('0x6')](this['getDataValue'](_0x6791('0x5'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x6791('0x7')]},'value':{'type':Sequelize[_0x6791('0x7')],'set':function(_0x5ad8c0){var _0x8b85ff=_0x5ad8c0['replace'](/\\/g,'/');this[_0x6791('0x8')]('value',_0x8b85ff);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x6791('0x9')],'set':function(_0x198a64){this['setDataValue'](_0x6791('0xa'),moment()[_0x6791('0xb')](_0x198a64,'ms'));this[_0x6791('0x8')]('closedAt',moment());this[_0x6791('0x8')](_0x6791('0xc'),_0x198a64);}},'startedAt':{'type':Sequelize[_0x6791('0xd')],'get':function(){return moment(this[_0x6791('0x4')](_0x6791('0xa')))[_0x6791('0xe')](_0x6791('0xf'))[_0x6791('0x10')]();}},'closedAt':{'type':Sequelize[_0x6791('0xd')],'get':function(){return moment(this[_0x6791('0x4')](_0x6791('0x11')))['format']('MM-DD-YYYY\x20HH:mm')[_0x6791('0x10')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x6791('0x4')]('createdAt'))[_0x6791('0xe')](_0x6791('0xf'))['toString']();}},'updatedAt':{'type':Sequelize[_0x6791('0xd')],'get':function(){return moment(this['getDataValue'](_0x6791('0x12')))[_0x6791('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x6791('0x10')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 8b31bb4..fbb8379 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 _0x46ed=['intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','keys','include','options','find','create','body','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','params','value','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','recording','existsSync','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','end','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','set','Content-Range','json','apply','reject','update','then','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','format','query','filters'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x46ed,0x168));var _0xd46e=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x46ed[_0x46698a];return _0x356db0;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];function respondWithStatusCode(_0x5bc1da,_0x48550b){_0x48550b=_0x48550b||0xcc;return function(_0xf3048c){if(_0xf3048c){return _0x5bc1da[_0xd46e('0x1a')](_0x48550b);}return _0x5bc1da['status'](_0x48550b)['end']();};}function respondWithResult(_0xacd799,_0x4688ae){_0x4688ae=_0x4688ae||0xc8;return function(_0x1e9aae){if(_0x1e9aae){return _0xacd799[_0xd46e('0x1b')](_0x4688ae)['json'](_0x1e9aae);}};}function respondWithFilteredResult(_0x3b6d25,_0x44a620){return function(_0x417402){if(_0x417402){var _0x3d72ce=typeof _0x44a620[_0xd46e('0x1c')]==='undefined'&&typeof _0x44a620[_0xd46e('0x1d')]===_0xd46e('0x1e');var _0x3583a5=_0x417402['count'];var _0x5ddd04=_0x3d72ce?0x0:_0x44a620[_0xd46e('0x1c')];var _0x1bd574=_0x3d72ce?_0x417402['count']:_0x44a620['offset']+_0x44a620[_0xd46e('0x1d')];var _0x2f2571;if(_0x1bd574>=_0x3583a5){_0x1bd574=_0x3583a5;_0x2f2571=0xc8;}else{_0x2f2571=0xce;}_0x3b6d25[_0xd46e('0x1b')](_0x2f2571);return _0x3b6d25[_0xd46e('0x1f')](_0xd46e('0x20'),_0x5ddd04+'-'+_0x1bd574+'/'+_0x3583a5)[_0xd46e('0x21')](_0x417402);}return null;};}function patchUpdates(_0x3b5fa4){return function(_0x327b7e){try{jsonpatch[_0xd46e('0x22')](_0x327b7e,_0x3b5fa4,!![]);}catch(_0x3c7e91){return BPromise[_0xd46e('0x23')](_0x3c7e91);}return _0x327b7e['save']();};}function saveUpdates(_0x259072,_0x1c83fa){return function(_0x79aa51){if(_0x79aa51){return _0x79aa51[_0xd46e('0x24')](_0x259072)[_0xd46e('0x25')](function(_0xc1af7f){return _0xc1af7f;});}return null;};}function removeEntity(_0x33c2e0,_0x8a1be){return function(_0x62dea5){if(_0x62dea5){return _0x62dea5['destroy']()[_0xd46e('0x25')](function(){_0x33c2e0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x371054,_0x2a5271){return function(_0x21135f){if(!_0x21135f){_0x371054[_0xd46e('0x1a')](0x194);}return _0x21135f;};}function handleError(_0x247b9f,_0x180851){_0x180851=_0x180851||0x1f4;return function(_0x1740d1){logger['error'](_0x1740d1[_0xd46e('0x26')]);if(_0x1740d1[_0xd46e('0x27')]){delete _0x1740d1[_0xd46e('0x27')];}_0x247b9f[_0xd46e('0x1b')](_0x180851)[_0xd46e('0x28')](_0x1740d1);};}exports[_0xd46e('0x29')]=function(_0x58aeef,_0x465d54){var _0x3a1ced={},_0x2d1afe={},_0xa716ce={'count':0x0,'rows':[]};var _0x106edc=_[_0xd46e('0x2a')](db[_0xd46e('0x2b')][_0xd46e('0x2c')],function(_0x18f060){return{'name':_0x18f060[_0xd46e('0x2d')],'type':_0x18f060[_0xd46e('0x2e')][_0xd46e('0x2f')]};});_0x2d1afe[_0xd46e('0x30')]=_['differenceBy'](_[_0xd46e('0x2a')](_0x106edc,_0xd46e('0x27')),[_0xd46e('0x31')]);_0x2d1afe[_0xd46e('0x32')]=_['keys'](_0x58aeef[_0xd46e('0x32')]);_0x2d1afe[_0xd46e('0x33')]=_['intersection'](_0x2d1afe[_0xd46e('0x30')],_0x2d1afe[_0xd46e('0x32')]);_0x3a1ced['attributes']=_[_0xd46e('0x34')](_0x2d1afe[_0xd46e('0x30')],qs[_0xd46e('0x35')](_0x58aeef['query']['fields']));_0x3a1ced[_0xd46e('0x36')]=_0x3a1ced[_0xd46e('0x36')][_0xd46e('0x37')]?_0x3a1ced[_0xd46e('0x36')]:_0x2d1afe[_0xd46e('0x30')];if(!_0x58aeef[_0xd46e('0x32')][_0xd46e('0x38')](_0xd46e('0x39'))){_0x3a1ced['limit']=qs[_0xd46e('0x1d')](_0x58aeef[_0xd46e('0x32')][_0xd46e('0x1d')]);_0x3a1ced[_0xd46e('0x1c')]=qs[_0xd46e('0x1c')](_0x58aeef[_0xd46e('0x32')][_0xd46e('0x1c')]);}_0x3a1ced['order']=qs[_0xd46e('0x3a')](_0x58aeef[_0xd46e('0x32')]['sort']);_0x3a1ced[_0xd46e('0x3b')]=qs[_0xd46e('0x33')](_[_0xd46e('0x3c')](_0x58aeef[_0xd46e('0x32')],_0x2d1afe['filters']),_0x106edc);if(_0x58aeef[_0xd46e('0x32')][_0xd46e('0x3d')]){_0x3a1ced[_0xd46e('0x3b')]=_[_0xd46e('0x3e')](_0x3a1ced[_0xd46e('0x3b')],{'$or':_[_0xd46e('0x2a')](_0x106edc,function(_0x220c57){if(_0x220c57[_0xd46e('0x2e')]!=='VIRTUAL'){var _0x232e6f={};_0x232e6f[_0x220c57[_0xd46e('0x27')]]={'$like':'%'+_0x58aeef[_0xd46e('0x32')][_0xd46e('0x3d')]+'%'};return _0x232e6f;}})});}_0x3a1ced=_[_0xd46e('0x3e')]({},_0x3a1ced,_0x58aeef['options']);var _0x964c66={'where':_0x3a1ced['where']};return db['ScreenRecording']['count'](_0x964c66)['then'](function(_0x17c3d9){_0xa716ce['count']=_0x17c3d9;if(_0x58aeef[_0xd46e('0x32')][_0xd46e('0x3f')]){_0x3a1ced['include']=[{'all':!![]}];}return db[_0xd46e('0x2b')][_0xd46e('0x40')](_0x3a1ced);})[_0xd46e('0x25')](function(_0x31ba12){_0xa716ce[_0xd46e('0x41')]=_0x31ba12;return _0xa716ce;})[_0xd46e('0x25')](respondWithFilteredResult(_0x465d54,_0x3a1ced))[_0xd46e('0x42')](handleError(_0x465d54,null));};exports[_0xd46e('0x43')]=function(_0x3a98e4,_0xec367d){var _0x259e2={'raw':![],'where':{'id':_0x3a98e4['params']['id']}},_0x5ea048={};_0x5ea048['model']=_[_0xd46e('0x44')](db['ScreenRecording'][_0xd46e('0x2c')]);_0x5ea048[_0xd46e('0x32')]=_[_0xd46e('0x44')](_0x3a98e4[_0xd46e('0x32')]);_0x5ea048[_0xd46e('0x33')]=_[_0xd46e('0x34')](_0x5ea048[_0xd46e('0x30')],_0x5ea048[_0xd46e('0x32')]);_0x259e2['attributes']=_[_0xd46e('0x34')](_0x5ea048['model'],qs[_0xd46e('0x35')](_0x3a98e4[_0xd46e('0x32')][_0xd46e('0x35')]));_0x259e2[_0xd46e('0x36')]=_0x259e2[_0xd46e('0x36')]['length']?_0x259e2[_0xd46e('0x36')]:_0x5ea048[_0xd46e('0x30')];if(_0x3a98e4[_0xd46e('0x32')][_0xd46e('0x3f')]){_0x259e2[_0xd46e('0x45')]=[{'all':!![]}];}_0x259e2=_['merge']({},_0x259e2,_0x3a98e4[_0xd46e('0x46')]);return db[_0xd46e('0x2b')][_0xd46e('0x47')](_0x259e2)[_0xd46e('0x25')](handleEntityNotFound(_0xec367d,null))[_0xd46e('0x25')](respondWithResult(_0xec367d,null))['catch'](handleError(_0xec367d,null));};exports[_0xd46e('0x48')]=function(_0x3ea9e6,_0x45baf1){return db[_0xd46e('0x2b')][_0xd46e('0x48')](_0x3ea9e6[_0xd46e('0x49')],{})[_0xd46e('0x25')](respondWithResult(_0x45baf1,0xc9))[_0xd46e('0x42')](handleError(_0x45baf1,null));};exports['update']=function(_0xf9dab,_0x71a8dc){if(_0xf9dab[_0xd46e('0x49')]['id']){delete _0xf9dab[_0xd46e('0x49')]['id'];}delete _0xf9dab[_0xd46e('0x49')]['duration'];delete _0xf9dab['body'][_0xd46e('0x4a')];delete _0xf9dab[_0xd46e('0x49')][_0xd46e('0x4b')];delete _0xf9dab['body']['value'];return db[_0xd46e('0x2b')][_0xd46e('0x47')]({'where':{'id':_0xf9dab['params']['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x71a8dc,null))[_0xd46e('0x25')](saveUpdates(_0xf9dab[_0xd46e('0x49')],null))[_0xd46e('0x25')](respondWithResult(_0x71a8dc,null))[_0xd46e('0x42')](handleError(_0x71a8dc,null));};exports[_0xd46e('0x4c')]=function(_0x80ed51,_0x16ca0e){return db['ScreenRecording'][_0xd46e('0x4c')]()[_0xd46e('0x25')](respondWithResult(_0x16ca0e,null))[_0xd46e('0x42')](handleError(_0x16ca0e,null));};exports[_0xd46e('0x4d')]=function(_0x4ec295,_0x56dd9a,_0xced102){var _0x5a4a44=require(_0xd46e('0x4e'));var _0x2af20b=![];var _0x393cb9={};if(_0x4ec295[_0xd46e('0x32')][_0xd46e('0x2e')]&&_0x4ec295[_0xd46e('0x32')]['type']===_0xd46e('0x4f')){_0x393cb9[_0xd46e('0x4f')]=_0x4ec295[_0xd46e('0x50')]['id'];}else{_0x393cb9['id']=_0x4ec295['params']['id'];}return db[_0xd46e('0x2b')][_0xd46e('0x47')]({'where':_0x393cb9,'attributes':['id',_0xd46e('0x51')],'raw':!![]})[_0xd46e('0x25')](handleEntityNotFound(_0x56dd9a,null))[_0xd46e('0x25')](function(_0x2cc676){if(_0x2cc676){var _0x2760ef=path[_0xd46e('0x52')](config[_0xd46e('0x53')],_0xd46e('0x54'),_0x2cc676[_0xd46e('0x51')]);var _0x411b19=util[_0xd46e('0x31')](_0xd46e('0x55'),_0x2760ef);if(fs['existsSync'](_0x411b19)){_0x2af20b=!![];return _0x5a4a44[_0xd46e('0x56')](_0x411b19,_0x2760ef,config[_0xd46e('0x57')][_0xd46e('0x58')])[_0xd46e('0x25')](function(){return _0x2cc676;});}return _0x2cc676;}})['then'](function(_0x636f15){if(_0x636f15){var _0x36e18a=path[_0xd46e('0x52')](config[_0xd46e('0x53')],'server/files/screen_recordings',_0x636f15[_0xd46e('0x51')]);if(!fs[_0xd46e('0x59')](_0x36e18a)){throw new db['Sequelize']['ValidationError'](_0xd46e('0x5a'));}if(_0x636f15[_0xd46e('0x5b')]){return _0x56dd9a[_0xd46e('0x4d')](_0x36e18a,_0x636f15['filename']+path['extname'](_0x36e18a),function(){if(_0x2af20b){fs[_0xd46e('0x5c')](_0x36e18a);}});}else{return _0x56dd9a[_0xd46e('0x4d')](_0x36e18a,function(_0x1f310d){if(_0x2af20b){fs[_0xd46e('0x5c')](_0x36e18a);}});}}})[_0xd46e('0x42')](function(_0x2f9fcb){if(_0x2f9fcb[_0xd46e('0x5d')]===_0xd46e('0x5a')){_0x56dd9a[_0xd46e('0x1b')](0x194)[_0xd46e('0x28')](_0xd46e('0x5e'));}else{return handleError(_0x56dd9a,null);}});};exports[_0xd46e('0x5f')]=function(_0x272514,_0x329204){return db[_0xd46e('0x2b')][_0xd46e('0x47')]({'where':{'id':_0x272514['params']['id']}})[_0xd46e('0x25')](function(_0x1a3771){if(_[_0xd46e('0x60')](_0x1a3771)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1a3771;})[_0xd46e('0x25')](function(_0x313c7e){var _0x4dec29=path[_0xd46e('0x52')](config[_0xd46e('0x53')],_0xd46e('0x54'),_0x313c7e['value']);logger[_0xd46e('0x61')](_0xd46e('0x62'),_0x4dec29);if(!_[_0xd46e('0x60')](_0x313c7e['value'])&&fs[_0xd46e('0x59')](_0x4dec29)){logger['info'](_0xd46e('0x63')+_0x4dec29+_0xd46e('0x64'));fs[_0xd46e('0x65')](_0x4dec29);}_0x4dec29=_0x4dec29+'.cypher';if(!_[_0xd46e('0x60')](_0x313c7e[_0xd46e('0x51')])&&fs[_0xd46e('0x59')](_0x4dec29)){logger[_0xd46e('0x61')](_0xd46e('0x63')+_0x4dec29+_0xd46e('0x64'));fs[_0xd46e('0x65')](_0x4dec29);}return _0x313c7e;})[_0xd46e('0x25')](function(_0x300ee9){if(!_0x300ee9)throw new InternalError();return _0x300ee9[_0xd46e('0x5f')]();})[_0xd46e('0x25')](function(){_0x329204[_0xd46e('0x1b')](0xcc)[_0xd46e('0x66')]();})[_0xd46e('0x42')](handleError(_0x329204,null));}; \ No newline at end of file +var _0x7217=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','ScreenRecording','fieldName','type','model','differenceBy','format','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','includeAll','rows','catch','params','rawAttributes','intersection','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','decryptFile','ValidationError','filename','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','existsSync','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x494fa2,_0x84b5d8){var _0xf013c7=function(_0x348859){while(--_0x348859){_0x494fa2['push'](_0x494fa2['shift']());}};_0xf013c7(++_0x84b5d8);}(_0x7217,0x19e));var _0x7721=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x7217[_0x1da04e];return _0xdd8c41;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x34')](_[_0x7721('0x2f')](_0x5c54f0,'name'),[_0x7721('0x35')]);_0xd7d703[_0x7721('0x36')]=_[_0x7721('0x37')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x38')]=_['intersection'](_0xd7d703[_0x7721('0x33')],_0xd7d703[_0x7721('0x36')]);_0x37b9f0[_0x7721('0x39')]=_['intersection'](_0xd7d703[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x158d98['query'][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')][_0x7721('0x3b')]?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3c')](_0x7721('0x3d'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0['offset']=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x3f')](_0x158d98[_0x7721('0x36')][_0x7721('0x3f')]);_0x37b9f0[_0x7721('0x40')]=qs['filters'](_['pick'](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98[_0x7721('0x36')][_0x7721('0x41')]){_0x37b9f0[_0x7721('0x40')]=_[_0x7721('0x42')](_0x37b9f0['where'],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4cf659){if(_0x4cf659[_0x7721('0x32')]!==_0x7721('0x43')){var _0x5a278e={};_0x5a278e[_0x4cf659[_0x7721('0x44')]]={'$like':'%'+_0x158d98[_0x7721('0x36')]['filter']+'%'};return _0x5a278e;}})});}_0x37b9f0=_['merge']({},_0x37b9f0,_0x158d98[_0x7721('0x45')]);var _0xfc4dc4={'where':_0x37b9f0[_0x7721('0x40')]};return db[_0x7721('0x30')]['count'](_0xfc4dc4)[_0x7721('0x29')](function(_0x120de9){_0x1da2d8[_0x7721('0x22')]=_0x120de9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x46')]){_0x37b9f0['include']=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a5b59){_0x1da2d8[_0x7721('0x47')]=_0x4a5b59;return _0x1da2d8;})[_0x7721('0x29')](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x48')](handleError(_0x1ea4d,null));};exports['show']=function(_0x1453d4,_0x11d853){var _0x1ad315={'raw':![],'where':{'id':_0x1453d4[_0x7721('0x49')]['id']}},_0x481fa8={};_0x481fa8[_0x7721('0x33')]=_[_0x7721('0x37')](db[_0x7721('0x30')][_0x7721('0x4a')]);_0x481fa8[_0x7721('0x36')]=_[_0x7721('0x37')](_0x1453d4['query']);_0x481fa8['filters']=_[_0x7721('0x4b')](_0x481fa8[_0x7721('0x33')],_0x481fa8[_0x7721('0x36')]);_0x1ad315[_0x7721('0x39')]=_[_0x7721('0x4b')](_0x481fa8[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x1453d4[_0x7721('0x36')][_0x7721('0x3a')]));_0x1ad315[_0x7721('0x39')]=_0x1ad315['attributes']['length']?_0x1ad315[_0x7721('0x39')]:_0x481fa8[_0x7721('0x33')];if(_0x1453d4[_0x7721('0x36')][_0x7721('0x46')]){_0x1ad315['include']=[{'all':!![]}];}_0x1ad315=_[_0x7721('0x42')]({},_0x1ad315,_0x1453d4[_0x7721('0x45')]);return db['ScreenRecording'][_0x7721('0x4c')](_0x1ad315)['then'](handleEntityNotFound(_0x11d853,null))[_0x7721('0x29')](respondWithResult(_0x11d853,null))['catch'](handleError(_0x11d853,null));};exports[_0x7721('0x4d')]=function(_0x196be4,_0xf17c40){return db['ScreenRecording'][_0x7721('0x4d')](_0x196be4[_0x7721('0x4e')],{})['then'](respondWithResult(_0xf17c40,0xc9))[_0x7721('0x48')](handleError(_0xf17c40,null));};exports[_0x7721('0x28')]=function(_0xf88e8c,_0x5c4078){if(_0xf88e8c[_0x7721('0x4e')]['id']){delete _0xf88e8c['body']['id'];}delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x4f')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x50')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x51')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x52')];return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':{'id':_0xf88e8c[_0x7721('0x49')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x5c4078,null))[_0x7721('0x29')](saveUpdates(_0xf88e8c[_0x7721('0x4e')],null))[_0x7721('0x29')](respondWithResult(_0x5c4078,null))['catch'](handleError(_0x5c4078,null));};exports[_0x7721('0x53')]=function(_0x2f6f30,_0x8e1214){return db[_0x7721('0x30')][_0x7721('0x53')]()[_0x7721('0x29')](respondWithResult(_0x8e1214,null))[_0x7721('0x48')](handleError(_0x8e1214,null));};exports['download']=function(_0x234bee,_0x17036e,_0x134908){var _0x3b7382=require(_0x7721('0x54'));var _0x9c0d4=![];var _0x7fbd6c={};if(_0x234bee[_0x7721('0x36')][_0x7721('0x32')]&&_0x234bee[_0x7721('0x36')][_0x7721('0x32')]==='uniqueid'){_0x7fbd6c[_0x7721('0x55')]=_0x234bee[_0x7721('0x49')]['id'];}else{_0x7fbd6c['id']=_0x234bee[_0x7721('0x49')]['id'];}return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':_0x7fbd6c,'attributes':['id',_0x7721('0x52')],'raw':!![]})[_0x7721('0x29')](handleEntityNotFound(_0x17036e,null))[_0x7721('0x29')](function(_0x360882){if(_0x360882){var _0x287452=path[_0x7721('0x56')](config[_0x7721('0x57')],_0x7721('0x58'),_0x360882[_0x7721('0x52')]);var _0x300ea4=util['format']('%s.cypher',_0x287452);if(fs['existsSync'](_0x300ea4)){_0x9c0d4=!![];return _0x3b7382[_0x7721('0x59')](_0x300ea4,_0x287452,config['secrets']['recording'])['then'](function(){return _0x360882;});}return _0x360882;}})['then'](function(_0x47925a){if(_0x47925a){var _0x219181=path[_0x7721('0x56')](config['root'],_0x7721('0x58'),_0x47925a['value']);if(!fs['existsSync'](_0x219181)){throw new db['Sequelize'][(_0x7721('0x5a'))]('ScreenRecording\x20not\x20found');}if(_0x47925a['filename']){return _0x17036e['download'](_0x219181,_0x47925a[_0x7721('0x5b')]+path[_0x7721('0x5c')](_0x219181),function(){if(_0x9c0d4){fs[_0x7721('0x5d')](_0x219181);}});}else{return _0x17036e['download'](_0x219181,function(_0x2a025c){if(_0x9c0d4){fs[_0x7721('0x5d')](_0x219181);}});}}})[_0x7721('0x48')](function(_0x168343){if(_0x168343[_0x7721('0x5e')]===_0x7721('0x5f')){_0x17036e[_0x7721('0x1c')](0x194)[_0x7721('0x2d')](_0x7721('0x60'));}else{return handleError(_0x17036e,null);}});};exports[_0x7721('0x2a')]=function(_0x3b03cf,_0x10666e){return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':{'id':_0x3b03cf[_0x7721('0x49')]['id']}})['then'](function(_0x233e5d){if(_[_0x7721('0x61')](_0x233e5d)){throw new ReferenceError(_0x7721('0x62'));}return _0x233e5d;})[_0x7721('0x29')](function(_0x542e30){var _0x103009=path[_0x7721('0x56')](config['root'],_0x7721('0x58'),_0x542e30['value']);logger[_0x7721('0x63')](_0x7721('0x64'),_0x103009);if(!_[_0x7721('0x61')](_0x542e30[_0x7721('0x52')])&&fs[_0x7721('0x65')](_0x103009)){logger[_0x7721('0x63')](_0x7721('0x66')+_0x103009+_0x7721('0x67'));fs[_0x7721('0x68')](_0x103009);}_0x103009=_0x103009+'.cypher';if(!_[_0x7721('0x61')](_0x542e30[_0x7721('0x52')])&&fs[_0x7721('0x65')](_0x103009)){logger[_0x7721('0x63')](_0x7721('0x66')+_0x103009+_0x7721('0x67'));fs[_0x7721('0x68')](_0x103009);}return _0x542e30;})['then'](function(_0xb6f2f2){if(!_0xb6f2f2)throw new InternalError();return _0xb6f2f2[_0x7721('0x2a')]();})['then'](function(){_0x10666e[_0x7721('0x1c')](0xcc)['end']();})[_0x7721('0x48')](handleError(_0x10666e,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index e2f905f..683cb08 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 _0x1cd8=['define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports'];(function(_0x2dcf49,_0x1ecc9b){var _0x161c42=function(_0x1bf1fd){while(--_0x1bf1fd){_0x2dcf49['push'](_0x2dcf49['shift']());}};_0x161c42(++_0x1ecc9b);}(_0x1cd8,0x1f4));var _0x81cd=function(_0x2c7626,_0x6c430e){_0x2c7626=_0x2c7626-0x0;var _0x3a2add=_0x1cd8[_0x2c7626];return _0x3a2add;};'use strict';var _=require(_0x81cd('0x0'));var util=require(_0x81cd('0x1'));var logger=require(_0x81cd('0x2'))(_0x81cd('0x3'));var moment=require(_0x81cd('0x4'));var BPromise=require(_0x81cd('0x5'));var rp=require(_0x81cd('0x6'));var fs=require('fs');var path=require(_0x81cd('0x7'));var rimraf=require(_0x81cd('0x8'));var config=require(_0x81cd('0x9'));var attributes=require(_0x81cd('0xa'));module[_0x81cd('0xb')]=function(_0x2f5a56,_0x44da61){return _0x2f5a56[_0x81cd('0xc')](_0x81cd('0xd'),attributes,{'tableName':_0x81cd('0xe'),'paranoid':![],'indexes':[{'name':_0x81cd('0xf'),'fields':[_0x81cd('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8d08=['path','rimraf','exports','define','ScreenRecording','interactionid','lodash','util','api','moment','bluebird','request-promise'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8d08,0x66));var _0x88d0=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x8d08[_0x1abb09];return _0xea1c07;};'use strict';var _=require(_0x88d0('0x0'));var util=require(_0x88d0('0x1'));var logger=require('../../config/logger')(_0x88d0('0x2'));var moment=require(_0x88d0('0x3'));var BPromise=require(_0x88d0('0x4'));var rp=require(_0x88d0('0x5'));var fs=require('fs');var path=require(_0x88d0('0x6'));var rimraf=require(_0x88d0('0x7'));var config=require('../../config/environment');var attributes=require('./screenRecording.attributes');module[_0x88d0('0x8')]=function(_0x1ab646,_0x3b36fd){return _0x1ab646[_0x88d0('0x9')](_0x88d0('0xa'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x88d0('0xb'),'fields':[_0x88d0('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 40ec0a9..cbca188 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 _0xc3fb=['info','ScreenRecording,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x5d1b02,_0xbcf431){var _0x33fca0=function(_0x38abfd){while(--_0x38abfd){_0x5d1b02['push'](_0x5d1b02['shift']());}};_0x33fca0(++_0xbcf431);}(_0xc3fb,0x171));var _0xbc3f=function(_0x2db17a,_0x499db9){_0x2db17a=_0x2db17a-0x0;var _0x1544da=_0xc3fb[_0x2db17a];return _0x1544da;};'use strict';var _=require(_0xbc3f('0x0'));var util=require(_0xbc3f('0x1'));var moment=require(_0xbc3f('0x2'));var BPromise=require(_0xbc3f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc3f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbc3f('0x5'));var logger=require(_0xbc3f('0x6'))('rpc');var config=require(_0xbc3f('0x7'));var jayson=require(_0xbc3f('0x8'));var client=jayson['client'][_0xbc3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44d9cd,_0x596f75,_0xdfa91d){return new BPromise(function(_0x1a5b1f,_0xad3c1a){return client[_0xbc3f('0xa')](_0x44d9cd,_0xdfa91d)['then'](function(_0x3afd71){logger[_0xbc3f('0xb')](_0xbc3f('0xc'),_0x596f75,'request\x20sent');logger[_0xbc3f('0xd')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x596f75,_0xbc3f('0xe'),JSON['stringify'](_0x3afd71));if(_0x3afd71[_0xbc3f('0xf')]){if(_0x3afd71['error'][_0xbc3f('0x10')]===0x1f4){logger[_0xbc3f('0xf')](_0xbc3f('0xc'),_0x596f75,_0x3afd71[_0xbc3f('0xf')][_0xbc3f('0x11')]);return _0xad3c1a(_0x3afd71[_0xbc3f('0xf')][_0xbc3f('0x11')]);}logger[_0xbc3f('0xf')](_0xbc3f('0xc'),_0x596f75,_0x3afd71[_0xbc3f('0xf')][_0xbc3f('0x11')]);return _0x1a5b1f(_0x3afd71['error']['message']);}else{logger[_0xbc3f('0xb')](_0xbc3f('0xc'),_0x596f75,_0xbc3f('0xe'));_0x1a5b1f(_0x3afd71['result'][_0xbc3f('0x11')]);}})[_0xbc3f('0x12')](function(_0x26f914){logger[_0xbc3f('0xf')](_0xbc3f('0xc'),_0x596f75,_0x26f914);_0xad3c1a(_0x26f914);});});} \ No newline at end of file +var _0x35d9=['message','catch','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x3dd0d9,_0x51a3b2){var _0x261731=function(_0x4398c4){while(--_0x4398c4){_0x3dd0d9['push'](_0x3dd0d9['shift']());}};_0x261731(++_0x51a3b2);}(_0x35d9,0x9a));var _0x935d=function(_0xe03d39,_0x4154a1){_0xe03d39=_0xe03d39-0x0;var _0x359940=_0x35d9[_0xe03d39];return _0x359940;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x935d('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x935d('0x1'))['db'];var utils=require(_0x935d('0x2'));var logger=require(_0x935d('0x3'))(_0x935d('0x4'));var config=require(_0x935d('0x5'));var jayson=require(_0x935d('0x6'));var client=jayson[_0x935d('0x7')][_0x935d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4550d9,_0x96330f,_0x5ac5d7){return new BPromise(function(_0x329e40,_0x3d80a0){return client[_0x935d('0x9')](_0x4550d9,_0x5ac5d7)[_0x935d('0xa')](function(_0x168b1d){logger[_0x935d('0xb')](_0x935d('0xc'),_0x96330f,_0x935d('0xd'));logger[_0x935d('0xe')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x96330f,_0x935d('0xd'),JSON['stringify'](_0x168b1d));if(_0x168b1d[_0x935d('0xf')]){if(_0x168b1d[_0x935d('0xf')][_0x935d('0x10')]===0x1f4){logger['error'](_0x935d('0xc'),_0x96330f,_0x168b1d[_0x935d('0xf')][_0x935d('0x11')]);return _0x3d80a0(_0x168b1d['error'][_0x935d('0x11')]);}logger[_0x935d('0xf')](_0x935d('0xc'),_0x96330f,_0x168b1d[_0x935d('0xf')][_0x935d('0x11')]);return _0x329e40(_0x168b1d[_0x935d('0xf')]['message']);}else{logger[_0x935d('0xb')](_0x935d('0xc'),_0x96330f,'request\x20sent');_0x329e40(_0x168b1d['result']['message']);}})[_0x935d('0x12')](function(_0x9b5964){logger[_0x935d('0xf')](_0x935d('0xc'),_0x96330f,_0x9b5964);_0x3d80a0(_0x9b5964);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 54db254..6318bb9 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 _0xfefa=['single','file','addLogo','/:id/logo_login','addLogoLogin','diskStorage','format','preferred','/:id/preferred','addPreferred','join','favicon','/:id/favicon','addFavicon','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','/:id','show','getLogo','getLogoLogin','/:id/gdpr','gdpr','getFavicon','root','server/files/images/logos/','%s%s','logo','extname','originalname','post','/:id/logo'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xfefa,0x14c));var _0xafef=function(_0x225972,_0x45d62e){_0x225972=_0x225972-0x0;var _0x3a349d=_0xfefa[_0x225972];return _0x3a349d;};'use strict';var multer=require(_0xafef('0x0'));var util=require(_0xafef('0x1'));var path=require(_0xafef('0x2'));var timeout=require(_0xafef('0x3'));var express=require(_0xafef('0x4'));var router=express[_0xafef('0x5')]();var fs_extra=require(_0xafef('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xafef('0x7'));var controller=require(_0xafef('0x8'));router[_0xafef('0x9')]('/',auth[_0xafef('0xa')](),controller[_0xafef('0xb')]);router[_0xafef('0x9')](_0xafef('0xc'),controller['getDate']);router[_0xafef('0x9')](_0xafef('0xd'),controller[_0xafef('0xe')]);router[_0xafef('0x9')]('/:id/logo',controller[_0xafef('0xf')]);router[_0xafef('0x9')]('/:id/logo_login',controller[_0xafef('0x10')]);router[_0xafef('0x9')](_0xafef('0x11'),controller[_0xafef('0x12')]);router[_0xafef('0x9')]('/:id/preferred',controller['getPreferred']);router['get']('/:id/favicon',controller[_0xafef('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x33a06c,_0x5dbcaf,_0x22be15){_0x22be15(null,path['join'](config[_0xafef('0x14')],_0xafef('0x15')));},'filename':function(_0xffd91e,_0x2620f8,_0xc9c820){_0xc9c820(null,util['format'](_0xafef('0x16'),_0xafef('0x17'),path[_0xafef('0x18')](_0x2620f8[_0xafef('0x19')])));}})});router[_0xafef('0x1a')](_0xafef('0x1b'),upload[_0xafef('0x1c')](_0xafef('0x1d')),controller[_0xafef('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x54bdb9,_0x42d6ab,_0x3f4145){_0x3f4145(null,path['join'](config[_0xafef('0x14')],'server/files/images/logos/'));},'filename':function(_0x4a0459,_0x4c8c4b,_0x49ae9c){_0x49ae9c(null,util['format'](_0xafef('0x16'),'logologin',path[_0xafef('0x18')](_0x4c8c4b['originalname'])));}})});router[_0xafef('0x1a')](_0xafef('0x1f'),upload[_0xafef('0x1c')](_0xafef('0x1d')),controller[_0xafef('0x20')]);var upload=multer({'storage':multer[_0xafef('0x21')]({'destination':function(_0x246ce6,_0x16ecd7,_0x39f97a){_0x39f97a(null,path['join'](config[_0xafef('0x14')],_0xafef('0x15')));},'filename':function(_0x2e2f7a,_0x1d628f,_0x1f211d){_0x1f211d(null,util[_0xafef('0x22')]('%s%s',_0xafef('0x23'),path[_0xafef('0x18')](_0x1d628f[_0xafef('0x19')])));}})});router['post'](_0xafef('0x24'),upload[_0xafef('0x1c')](_0xafef('0x1d')),controller[_0xafef('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x190518,_0x34a3b8,_0x5d85df){_0x5d85df(null,path[_0xafef('0x26')](config[_0xafef('0x14')],_0xafef('0x15')));},'filename':function(_0x3c8c3b,_0x10d278,_0x54e4cb){_0x54e4cb(null,util['format'](_0xafef('0x16'),_0xafef('0x27'),path['extname'](_0x10d278[_0xafef('0x19')])));}})});router['post'](_0xafef('0x28'),upload[_0xafef('0x1c')](_0xafef('0x1d')),controller[_0xafef('0x29')]);router[_0xafef('0x2a')](_0xafef('0xd'),auth[_0xafef('0xa')](),controller[_0xafef('0x2b')]);module[_0xafef('0x2c')]=router; \ No newline at end of file +var _0x93b9=['getDate','/:id','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','single','file','diskStorage','logologin','post','addLogoLogin','preferred','addPreferred','favicon','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','get','/now'];(function(_0x224367,_0x3beb79){var _0x332760=function(_0x5617e4){while(--_0x5617e4){_0x224367['push'](_0x224367['shift']());}};_0x332760(++_0x3beb79);}(_0x93b9,0x7c));var _0x993b=function(_0x2962b4,_0x4b0786){_0x2962b4=_0x2962b4-0x0;var _0x411b7d=_0x93b9[_0x2962b4];return _0x411b7d;};'use strict';var multer=require(_0x993b('0x0'));var util=require('util');var path=require(_0x993b('0x1'));var timeout=require(_0x993b('0x2'));var express=require(_0x993b('0x3'));var router=express[_0x993b('0x4')]();var fs_extra=require(_0x993b('0x5'));var auth=require(_0x993b('0x6'));var interaction=require(_0x993b('0x7'));var config=require(_0x993b('0x8'));var controller=require(_0x993b('0x9'));router['get']('/',auth[_0x993b('0xa')](),controller[_0x993b('0xb')]);router[_0x993b('0xc')](_0x993b('0xd'),controller[_0x993b('0xe')]);router[_0x993b('0xc')](_0x993b('0xf'),controller[_0x993b('0x10')]);router['get'](_0x993b('0x11'),controller['getLogo']);router['get'](_0x993b('0x12'),controller[_0x993b('0x13')]);router[_0x993b('0xc')](_0x993b('0x14'),controller[_0x993b('0x15')]);router[_0x993b('0xc')](_0x993b('0x16'),controller[_0x993b('0x17')]);router[_0x993b('0xc')](_0x993b('0x18'),controller[_0x993b('0x19')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x282d77,_0x475bd3,_0x80d667){_0x80d667(null,path[_0x993b('0x1a')](config[_0x993b('0x1b')],_0x993b('0x1c')));},'filename':function(_0x3eb400,_0x59e53e,_0x3dbaf5){_0x3dbaf5(null,util[_0x993b('0x1d')](_0x993b('0x1e'),_0x993b('0x1f'),path[_0x993b('0x20')](_0x59e53e[_0x993b('0x21')])));}})});router['post']('/:id/logo',upload[_0x993b('0x22')](_0x993b('0x23')),controller['addLogo']);var upload=multer({'storage':multer[_0x993b('0x24')]({'destination':function(_0x249816,_0xade74e,_0x4f195b){_0x4f195b(null,path[_0x993b('0x1a')](config[_0x993b('0x1b')],_0x993b('0x1c')));},'filename':function(_0xb65504,_0xb2b87b,_0x77ae6a){_0x77ae6a(null,util['format'](_0x993b('0x1e'),_0x993b('0x25'),path[_0x993b('0x20')](_0xb2b87b[_0x993b('0x21')])));}})});router[_0x993b('0x26')](_0x993b('0x12'),upload['single'](_0x993b('0x23')),controller[_0x993b('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3e4d52,_0x179c70,_0x260995){_0x260995(null,path['join'](config[_0x993b('0x1b')],_0x993b('0x1c')));},'filename':function(_0x185251,_0x356121,_0x3829b4){_0x3829b4(null,util[_0x993b('0x1d')](_0x993b('0x1e'),_0x993b('0x28'),path[_0x993b('0x20')](_0x356121['originalname'])));}})});router[_0x993b('0x26')](_0x993b('0x16'),upload[_0x993b('0x22')]('file'),controller[_0x993b('0x29')]);var upload=multer({'storage':multer[_0x993b('0x24')]({'destination':function(_0x54d6cb,_0x541ee7,_0x47f217){_0x47f217(null,path[_0x993b('0x1a')](config[_0x993b('0x1b')],'server/files/images/logos/'));},'filename':function(_0x3e938f,_0x399452,_0x4087f4){_0x4087f4(null,util[_0x993b('0x1d')](_0x993b('0x1e'),_0x993b('0x2a'),path['extname'](_0x399452[_0x993b('0x21')])));}})});router[_0x993b('0x26')](_0x993b('0x18'),upload[_0x993b('0x22')]('file'),controller['addFavicon']);router[_0x993b('0x2b')](_0x993b('0xf'),auth[_0x993b('0xa')](),controller[_0x993b('0x2c')]);module[_0x993b('0x2d')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index eae251b..9ec1e33 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(_0x2375e1,_0x3c8f47){var _0x1081fe=function(_0x5c2ff5){while(--_0x5c2ff5){_0x2375e1['push'](_0x2375e1['shift']());}};_0x1081fe(++_0x3c8f47);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0x56d001,_0x1ad780){var _0x27773d=function(_0x153090){while(--_0x153090){_0x56d001['push'](_0x56d001['shift']());}};_0x27773d(++_0x1ad780);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 d4cdc9b..7912ea6 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 _0x6c96=['debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','end','stack','name','Setting','rawAttributes','key','model','map','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','body','addLogo','file','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','logo','preferred','favicon','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','custom','default_logo.svg','Sequelize','upperFirst','download','getLogoLogin','getLicense','defaultLoginLogo','default_loginLogo.svg','default','ValidationError','\x20not\x20found','addPreferred','getPreferred','defaultLogo','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','info','Setting,\x20%s,\x20%s','request\x20sent'];(function(_0x335067,_0x517e06){var _0xeb9182=function(_0x48559f){while(--_0x48559f){_0x335067['push'](_0x335067['shift']());}};_0xeb9182(++_0x517e06);}(_0x6c96,0x1c1));var _0x66c9=function(_0x3db5db,_0x1b9311){_0x3db5db=_0x3db5db-0x0;var _0x5af381=_0x6c96[_0x3db5db];return _0x5af381;};'use strict';var emlformat=require(_0x66c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x66c9('0x1'));var jsonpatch=require(_0x66c9('0x2'));var rp=require('request-promise');var moment=require(_0x66c9('0x3'));var BPromise=require(_0x66c9('0x4'));var Mustache=require(_0x66c9('0x5'));var util=require(_0x66c9('0x6'));var path=require(_0x66c9('0x7'));var sox=require(_0x66c9('0x8'));var csv=require(_0x66c9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x66c9('0xa'));var _=require('lodash');var squel=require(_0x66c9('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x66c9('0xc'));var toCsv=require(_0x66c9('0x9'));var querystring=require(_0x66c9('0xd'));var Papa=require(_0x66c9('0xe'));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(_0x66c9('0xf'));var logger=require(_0x66c9('0x10'))(_0x66c9('0x11'));var utils=require('../../config/utils');var config=require(_0x66c9('0x12'));var licenseUtil=require(_0x66c9('0x13'));var db=require(_0x66c9('0x14'))['db'];var jayson=require(_0x66c9('0x15'));var client=jayson['client'][_0x66c9('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x4caeb1,_0x319411,_0x3cecb7,_0x3f395b){return new BPromise(function(_0x9d1e75,_0x555c76){var _0x196274=_0x3f395b||client;return _0x196274[_0x66c9('0x17')](_0x4caeb1,_0x3cecb7)['then'](function(_0x609292){logger[_0x66c9('0x18')](_0x66c9('0x19'),_0x319411,_0x66c9('0x1a'));logger[_0x66c9('0x1b')](_0x66c9('0x1c'),_0x319411,_0x66c9('0x1a'),JSON[_0x66c9('0x1d')](_0x609292));if(_0x609292['error']){if(_0x609292[_0x66c9('0x1e')]['code']===0x1f4){logger['error'](_0x66c9('0x19'),_0x319411,_0x609292[_0x66c9('0x1e')][_0x66c9('0x1f')]);return _0x555c76(_0x609292[_0x66c9('0x1e')][_0x66c9('0x1f')]);}logger[_0x66c9('0x1e')](_0x66c9('0x19'),_0x319411,_0x609292['error']['message']);return _0x9d1e75(_0x609292[_0x66c9('0x1e')][_0x66c9('0x1f')]);}else{logger[_0x66c9('0x18')](_0x66c9('0x19'),_0x319411,_0x66c9('0x1a'));_0x9d1e75(_0x609292['result'][_0x66c9('0x1f')]);}})[_0x66c9('0x20')](function(_0x578887){logger[_0x66c9('0x1e')](_0x66c9('0x19'),_0x319411,_0x578887);_0x555c76(_0x578887);});});}function respondWithStatusCode(_0x193b6c,_0x3f3be1){_0x3f3be1=_0x3f3be1||0xcc;return function(_0x2e1884){if(_0x2e1884){return _0x193b6c[_0x66c9('0x21')](_0x3f3be1);}return _0x193b6c[_0x66c9('0x22')](_0x3f3be1)['end']();};}function respondWithResult(_0x32e3d5,_0x5bb599){_0x5bb599=_0x5bb599||0xc8;return function(_0x4d3ebc){if(_0x4d3ebc){return _0x32e3d5[_0x66c9('0x22')](_0x5bb599)['json'](_0x4d3ebc);}};}function respondWithFilteredResult(_0x193ded,_0x493c0f){return function(_0x95ce9f){if(_0x95ce9f){var _0x4af545=typeof _0x493c0f[_0x66c9('0x23')]===_0x66c9('0x24')&&typeof _0x493c0f[_0x66c9('0x25')]===_0x66c9('0x24');var _0x1ef1f4=_0x95ce9f['count'];var _0x26a80e=_0x4af545?0x0:_0x493c0f[_0x66c9('0x23')];var _0x3d596e=_0x4af545?_0x95ce9f[_0x66c9('0x26')]:_0x493c0f['offset']+_0x493c0f[_0x66c9('0x25')];var _0x514859;if(_0x3d596e>=_0x1ef1f4){_0x3d596e=_0x1ef1f4;_0x514859=0xc8;}else{_0x514859=0xce;}_0x193ded[_0x66c9('0x22')](_0x514859);return _0x193ded[_0x66c9('0x27')](_0x66c9('0x28'),_0x26a80e+'-'+_0x3d596e+'/'+_0x1ef1f4)[_0x66c9('0x29')](_0x95ce9f);}return null;};}function patchUpdates(_0x58de72){return function(_0x338569){try{jsonpatch['apply'](_0x338569,_0x58de72,!![]);}catch(_0x232f1a){return BPromise[_0x66c9('0x2a')](_0x232f1a);}return _0x338569[_0x66c9('0x2b')]();};}function saveUpdates(_0x1049e7,_0x482fa7){return function(_0x84bfe9){if(_0x84bfe9){return _0x84bfe9[_0x66c9('0x2c')](_0x1049e7)[_0x66c9('0x2d')](function(_0x23b2b6){return _0x23b2b6;});}return null;};}function removeEntity(_0x1c4735,_0x214217){return function(_0x4dd0dc){if(_0x4dd0dc){return _0x4dd0dc[_0x66c9('0x2e')]()['then'](function(){_0x1c4735['status'](0xcc)[_0x66c9('0x2f')]();});}};}function handleEntityNotFound(_0x6645f6,_0x2382a9){return function(_0x40d8b8){if(!_0x40d8b8){_0x6645f6[_0x66c9('0x21')](0x194);}return _0x40d8b8;};}function handleError(_0x4ea491,_0x551613){_0x551613=_0x551613||0x1f4;return function(_0x47f7ba){logger[_0x66c9('0x1e')](_0x47f7ba[_0x66c9('0x30')]);if(_0x47f7ba[_0x66c9('0x31')]){delete _0x47f7ba[_0x66c9('0x31')];}_0x4ea491[_0x66c9('0x22')](_0x551613)['send'](_0x47f7ba);};}exports['index']=function(_0x580788,_0x27ac2a){var _0xfd37bf={},_0x5b23ba={},_0x2132cf={'count':0x0,'rows':[]};var _0x5458cf=_['map'](db[_0x66c9('0x32')][_0x66c9('0x33')],function(_0x10fbef){return{'name':_0x10fbef['fieldName'],'type':_0x10fbef['type'][_0x66c9('0x34')]};});_0x5b23ba[_0x66c9('0x35')]=_[_0x66c9('0x36')](_0x5458cf,'name');_0x5b23ba['query']=_[_0x66c9('0x37')](_0x580788[_0x66c9('0x38')]);_0x5b23ba[_0x66c9('0x39')]=_[_0x66c9('0x3a')](_0x5b23ba[_0x66c9('0x35')],_0x5b23ba['query']);_0xfd37bf['attributes']=_[_0x66c9('0x3a')](_0x5b23ba[_0x66c9('0x35')],qs[_0x66c9('0x3b')](_0x580788['query'][_0x66c9('0x3b')]));_0xfd37bf[_0x66c9('0x3c')]=_0xfd37bf[_0x66c9('0x3c')][_0x66c9('0x3d')]?_0xfd37bf[_0x66c9('0x3c')]:_0x5b23ba[_0x66c9('0x35')];if(!_0x580788[_0x66c9('0x38')]['hasOwnProperty'](_0x66c9('0x3e'))){_0xfd37bf[_0x66c9('0x25')]=qs['limit'](_0x580788[_0x66c9('0x38')][_0x66c9('0x25')]);_0xfd37bf[_0x66c9('0x23')]=qs[_0x66c9('0x23')](_0x580788[_0x66c9('0x38')][_0x66c9('0x23')]);}_0xfd37bf[_0x66c9('0x3f')]=qs[_0x66c9('0x40')](_0x580788[_0x66c9('0x38')][_0x66c9('0x40')]);_0xfd37bf[_0x66c9('0x41')]=qs[_0x66c9('0x39')](_['pick'](_0x580788['query'],_0x5b23ba[_0x66c9('0x39')]),_0x5458cf);if(_0x580788[_0x66c9('0x38')][_0x66c9('0x42')]){_0xfd37bf[_0x66c9('0x41')]=_['merge'](_0xfd37bf[_0x66c9('0x41')],{'$or':_[_0x66c9('0x36')](_0x5458cf,function(_0x6ea0e3){if(_0x6ea0e3['type']!==_0x66c9('0x43')){var _0x39d284={};_0x39d284[_0x6ea0e3[_0x66c9('0x31')]]={'$like':'%'+_0x580788[_0x66c9('0x38')][_0x66c9('0x42')]+'%'};return _0x39d284;}})});}_0xfd37bf=_[_0x66c9('0x44')]({},_0xfd37bf,_0x580788[_0x66c9('0x45')]);var _0x1ca035={'where':_0xfd37bf[_0x66c9('0x41')]};return db[_0x66c9('0x32')][_0x66c9('0x26')](_0x1ca035)[_0x66c9('0x2d')](function(_0x271325){_0x2132cf['count']=_0x271325;if(_0x580788[_0x66c9('0x38')][_0x66c9('0x46')]){_0xfd37bf[_0x66c9('0x47')]=[{'all':!![]}];}return db[_0x66c9('0x32')][_0x66c9('0x48')](_0xfd37bf);})[_0x66c9('0x2d')](function(_0x48cf35){_0x2132cf[_0x66c9('0x49')]=_0x48cf35;return _0x2132cf;})['then'](respondWithFilteredResult(_0x27ac2a,_0xfd37bf))[_0x66c9('0x20')](handleError(_0x27ac2a,null));};exports[_0x66c9('0x4a')]=function(_0x4133a5,_0x3cb0d0){var _0x28c381={'raw':![],'where':{'id':_0x4133a5[_0x66c9('0x4b')]['id']}},_0x526683={};_0x526683[_0x66c9('0x35')]=_[_0x66c9('0x37')](db[_0x66c9('0x32')]['rawAttributes']);_0x526683[_0x66c9('0x38')]=_['keys'](_0x4133a5[_0x66c9('0x38')]);_0x526683['filters']=_[_0x66c9('0x3a')](_0x526683[_0x66c9('0x35')],_0x526683[_0x66c9('0x38')]);_0x28c381[_0x66c9('0x3c')]=_[_0x66c9('0x3a')](_0x526683[_0x66c9('0x35')],qs[_0x66c9('0x3b')](_0x4133a5[_0x66c9('0x38')][_0x66c9('0x3b')]));_0x28c381[_0x66c9('0x3c')]=_0x28c381['attributes'][_0x66c9('0x3d')]?_0x28c381[_0x66c9('0x3c')]:_0x526683[_0x66c9('0x35')];if(_0x4133a5['query'][_0x66c9('0x46')]){_0x28c381[_0x66c9('0x47')]=[{'all':!![]}];}_0x28c381=_[_0x66c9('0x44')]({},_0x28c381,_0x4133a5[_0x66c9('0x45')]);return db[_0x66c9('0x32')][_0x66c9('0x4c')](_0x28c381)[_0x66c9('0x2d')](handleEntityNotFound(_0x3cb0d0,null))[_0x66c9('0x2d')](respondWithResult(_0x3cb0d0,null))[_0x66c9('0x20')](handleError(_0x3cb0d0,null));};exports[_0x66c9('0x2c')]=function(_0x1b5877,_0x4c2263){if(_0x1b5877[_0x66c9('0x4d')]['id']){delete _0x1b5877[_0x66c9('0x4d')]['id'];}return db[_0x66c9('0x32')][_0x66c9('0x4c')]({'where':{'id':_0x1b5877[_0x66c9('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4c2263,null))['then'](saveUpdates(_0x1b5877[_0x66c9('0x4d')],null))[_0x66c9('0x2d')](respondWithResult(_0x4c2263,null))[_0x66c9('0x20')](handleError(_0x4c2263,null));};exports[_0x66c9('0x4e')]=function(_0x18290b,_0x11197c,_0x225ae9){if(_0x18290b['file']&&_0x18290b[_0x66c9('0x4f')][_0x66c9('0x50')]){_0x18290b[_0x66c9('0x4d')]['logo']=_0x18290b[_0x66c9('0x4f')][_0x66c9('0x50')];}return db['Setting']['find']({'where':{'id':_0x18290b[_0x66c9('0x4b')]['id']}})[_0x66c9('0x2d')](handleEntityNotFound(_0x11197c,null))[_0x66c9('0x2d')](saveUpdates(_0x18290b[_0x66c9('0x4d')],null))['then'](respondWithResult(_0x11197c,null))[_0x66c9('0x20')](handleError(_0x11197c,null));};exports[_0x66c9('0x51')]=function(_0x5846cc,_0x3c67f1,_0x14dfab){if(_0x5846cc['file']&&_0x5846cc[_0x66c9('0x4f')][_0x66c9('0x50')]){_0x5846cc['body'][_0x66c9('0x52')]=_0x5846cc[_0x66c9('0x4f')][_0x66c9('0x50')];}return db[_0x66c9('0x32')][_0x66c9('0x4c')]({'where':{'id':_0x5846cc[_0x66c9('0x4b')]['id']}})[_0x66c9('0x2d')](handleEntityNotFound(_0x3c67f1,null))[_0x66c9('0x2d')](saveUpdates(_0x5846cc[_0x66c9('0x4d')],null))[_0x66c9('0x2d')](respondWithResult(_0x3c67f1,null))[_0x66c9('0x20')](handleError(_0x3c67f1,null));};var utilLicense=require(_0x66c9('0x13'));exports[_0x66c9('0x53')]=function(_0x370f85,_0x315b13,_0x34644d){var _0x320255=_0x66c9('0x54');var _0x49416c={'custom':![]};return utilLicense['getLicense']()[_0x66c9('0x2d')](function(_0x2be011){if(_0x2be011){_0x49416c=_0x2be011;}return db[_0x66c9('0x32')][_0x66c9('0x4c')]({'where':{'id':_0x370f85[_0x66c9('0x4b')]['id']},'attributes':[_0x66c9('0x55'),'loginLogo',_0x66c9('0x56'),_0x66c9('0x57'),'defaultLogo','defaultLoginLogo',_0x66c9('0x58'),_0x66c9('0x59')],'raw':!![]});})[_0x66c9('0x2d')](handleEntityNotFound(_0x315b13,null))[_0x66c9('0x2d')](function(_0x540bd0){if(_0x540bd0){var _0x5641da=_0x540bd0['logo']&&fs[_0x66c9('0x5a')](path[_0x66c9('0x5b')](config[_0x66c9('0x5c')],_0x320255,_[_0x66c9('0x5d')](_0x540bd0['logo'])))?path[_0x66c9('0x5b')](config[_0x66c9('0x5c')],_0x320255,_[_0x66c9('0x5d')](_0x540bd0[_0x66c9('0x55')])):path[_0x66c9('0x5b')](config[_0x66c9('0x5c')],_0x320255,_[_0x66c9('0x5d')]('default_logo.svg'));var _0x160d1e='default'+_['upperFirst'](_0x66c9('0x55'));if(_0x540bd0[_0x160d1e]||!_0x49416c[_0x66c9('0x5e')]){_0x5641da=path['join'](config[_0x66c9('0x5c')],_0x320255,_[_0x66c9('0x5d')](_0x66c9('0x5f')));}if(!fs[_0x66c9('0x5a')](_0x5641da)){throw new db[(_0x66c9('0x60'))]['ValidationError'](_[_0x66c9('0x61')](_0x66c9('0x55'))+'\x20not\x20found');}return _0x315b13[_0x66c9('0x62')](_0x5641da);}})[_0x66c9('0x20')](handleError(_0x315b13,null));};var utilLicense=require(_0x66c9('0x13'));exports[_0x66c9('0x63')]=function(_0xe0ba3c,_0x2fd995,_0x73dcbd){var _0x27a632=_0x66c9('0x54');var _0x20f148={'custom':![]};return utilLicense[_0x66c9('0x64')]()[_0x66c9('0x2d')](function(_0x508c03){if(_0x508c03){_0x20f148=_0x508c03;}return db[_0x66c9('0x32')]['find']({'where':{'id':_0xe0ba3c['params']['id']},'attributes':[_0x66c9('0x55'),'loginLogo',_0x66c9('0x56'),_0x66c9('0x57'),'defaultLogo',_0x66c9('0x65'),_0x66c9('0x58'),_0x66c9('0x59')],'raw':!![]});})[_0x66c9('0x2d')](handleEntityNotFound(_0x2fd995,null))[_0x66c9('0x2d')](function(_0x2542ef){if(_0x2542ef){var _0x48b4af=_0x2542ef['loginLogo']&&fs['existsSync'](path[_0x66c9('0x5b')](config['root'],_0x27a632,_['toLower'](_0x2542ef[_0x66c9('0x52')])))?path[_0x66c9('0x5b')](config[_0x66c9('0x5c')],_0x27a632,_[_0x66c9('0x5d')](_0x2542ef[_0x66c9('0x52')])):path['join'](config[_0x66c9('0x5c')],_0x27a632,_[_0x66c9('0x5d')](_0x66c9('0x66')));var _0x311527=_0x66c9('0x67')+_['upperFirst'](_0x66c9('0x52'));if(_0x2542ef[_0x311527]||!_0x20f148[_0x66c9('0x5e')]){_0x48b4af=path[_0x66c9('0x5b')](config[_0x66c9('0x5c')],_0x27a632,_[_0x66c9('0x5d')](_0x66c9('0x66')));}if(!fs[_0x66c9('0x5a')](_0x48b4af)){throw new db['Sequelize'][(_0x66c9('0x68'))](_['upperFirst'](_0x66c9('0x52'))+_0x66c9('0x69'));}return _0x2fd995[_0x66c9('0x62')](_0x48b4af);}})['catch'](handleError(_0x2fd995,null));};exports['gdpr']=function(_0x2e4615,_0x266010){return db['Setting']['find']({'where':{'id':_0x2e4615[_0x66c9('0x4b')]['id']},'attributes':['securePassword']})['then'](respondWithResult(_0x266010,null))['catch'](handleError(_0x266010,null));};exports[_0x66c9('0x6a')]=function(_0x1c2e4a,_0x228f10,_0x4418b4){if(_0x1c2e4a[_0x66c9('0x4f')]&&_0x1c2e4a[_0x66c9('0x4f')][_0x66c9('0x50')]){_0x1c2e4a[_0x66c9('0x4d')]['preferred']=_0x1c2e4a[_0x66c9('0x4f')]['filename'];}return db[_0x66c9('0x32')][_0x66c9('0x4c')]({'where':{'id':_0x1c2e4a[_0x66c9('0x4b')]['id']}})[_0x66c9('0x2d')](handleEntityNotFound(_0x228f10,null))[_0x66c9('0x2d')](saveUpdates(_0x1c2e4a['body'],null))[_0x66c9('0x2d')](respondWithResult(_0x228f10,null))['catch'](handleError(_0x228f10,null));};var utilLicense=require('../../config/license/util');exports[_0x66c9('0x6b')]=function(_0x2a6999,_0x528f1e,_0x5aa1e0){var _0x2f9afe=_0x66c9('0x54');var _0x4fadc8={'custom':![]};return utilLicense['getLicense']()[_0x66c9('0x2d')](function(_0x42c246){if(_0x42c246){_0x4fadc8=_0x42c246;}return db[_0x66c9('0x32')][_0x66c9('0x4c')]({'where':{'id':_0x2a6999['params']['id']},'attributes':['logo','loginLogo',_0x66c9('0x56'),'favicon',_0x66c9('0x6c'),_0x66c9('0x65'),'defaultPreferred',_0x66c9('0x59')],'raw':!![]});})['then'](handleEntityNotFound(_0x528f1e,null))[_0x66c9('0x2d')](function(_0x58c822){if(_0x58c822){var _0x52e3c3=_0x58c822[_0x66c9('0x56')]&&fs[_0x66c9('0x5a')](path['join'](config[_0x66c9('0x5c')],_0x2f9afe,_[_0x66c9('0x5d')](_0x58c822[_0x66c9('0x56')])))?path[_0x66c9('0x5b')](config['root'],_0x2f9afe,_['toLower'](_0x58c822[_0x66c9('0x56')])):path['join'](config['root'],_0x2f9afe,_[_0x66c9('0x5d')](_0x66c9('0x6d')));var _0x5e96fe=_0x66c9('0x67')+_['upperFirst'](_0x66c9('0x56'));if(_0x58c822[_0x5e96fe]||!_0x4fadc8[_0x66c9('0x5e')]||!_0x4fadc8[_0x66c9('0x56')]){_0x52e3c3=path['join'](config[_0x66c9('0x5c')],_0x2f9afe,_[_0x66c9('0x5d')]('default_preferred.png'));}if(!fs[_0x66c9('0x5a')](_0x52e3c3)){throw new db[(_0x66c9('0x60'))]['ValidationError'](_['upperFirst']('preferred')+_0x66c9('0x69'));}return _0x528f1e[_0x66c9('0x62')](_0x52e3c3);}})[_0x66c9('0x20')](handleError(_0x528f1e,null));};exports[_0x66c9('0x6e')]=function(_0x26ce2c,_0x3b29d3,_0x308620){if(_0x26ce2c[_0x66c9('0x4f')]&&_0x26ce2c[_0x66c9('0x4f')][_0x66c9('0x50')]){_0x26ce2c[_0x66c9('0x4d')][_0x66c9('0x57')]=_0x26ce2c['file'][_0x66c9('0x50')];}return db[_0x66c9('0x32')][_0x66c9('0x4c')]({'where':{'id':_0x26ce2c[_0x66c9('0x4b')]['id']}})[_0x66c9('0x2d')](handleEntityNotFound(_0x3b29d3,null))[_0x66c9('0x2d')](saveUpdates(_0x26ce2c[_0x66c9('0x4d')],null))[_0x66c9('0x2d')](respondWithResult(_0x3b29d3,null))[_0x66c9('0x20')](handleError(_0x3b29d3,null));};var utilLicense=require(_0x66c9('0x13'));exports[_0x66c9('0x6f')]=function(_0x550044,_0x5e37ef,_0x1ef9c7){var _0x39be3e=_0x66c9('0x54');var _0x448988={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x209a50){if(_0x209a50){_0x448988=_0x209a50;}return db['Setting']['find']({'where':{'id':_0x550044[_0x66c9('0x4b')]['id']},'attributes':[_0x66c9('0x55'),_0x66c9('0x52'),_0x66c9('0x56'),_0x66c9('0x57'),_0x66c9('0x6c'),_0x66c9('0x65'),_0x66c9('0x58'),_0x66c9('0x59')],'raw':!![]});})[_0x66c9('0x2d')](handleEntityNotFound(_0x5e37ef,null))[_0x66c9('0x2d')](function(_0x4a3228){if(_0x4a3228){var _0x48277c=_0x4a3228[_0x66c9('0x57')]&&fs[_0x66c9('0x5a')](path[_0x66c9('0x5b')](config[_0x66c9('0x5c')],_0x39be3e,_[_0x66c9('0x5d')](_0x4a3228[_0x66c9('0x57')])))?path[_0x66c9('0x5b')](config[_0x66c9('0x5c')],_0x39be3e,_['toLower'](_0x4a3228[_0x66c9('0x57')])):path[_0x66c9('0x5b')](config[_0x66c9('0x5c')],_0x39be3e,_[_0x66c9('0x5d')](_0x66c9('0x70')));var _0x10333d='default'+_[_0x66c9('0x61')](_0x66c9('0x57'));if(_0x4a3228[_0x10333d]||!_0x448988[_0x66c9('0x5e')]){_0x48277c=path[_0x66c9('0x5b')](config['root'],_0x39be3e,_[_0x66c9('0x5d')](_0x66c9('0x70')));}if(!fs['existsSync'](_0x48277c)){throw new db['Sequelize']['ValidationError'](_[_0x66c9('0x61')](_0x66c9('0x57'))+_0x66c9('0x69'));}return _0x5e37ef[_0x66c9('0x62')](_0x48277c);}})[_0x66c9('0x20')](handleError(_0x5e37ef,null));};exports[_0x66c9('0x71')]=function(_0x1bd071,_0x450280){var _0xd32d93={'offset':moment()[_0x66c9('0x72')]()};_0xd32d93[_0x66c9('0x73')]=moment()[_0x66c9('0x72')](_0xd32d93[_0x66c9('0x23')])[_0x66c9('0x74')](_0x66c9('0x75'));return _0x450280['status'](0xc8)[_0x66c9('0x76')](_0xd32d93);}; \ No newline at end of file +var _0x3ffb=['count','limit','set','apply','reject','save','destroy','name','send','index','map','Setting','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','options','includeAll','rows','show','params','keys','include','find','update','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','getLicense','default_loginLogo.svg','addPreferred','getPreferred','default_preferred.png','default','addFavicon','getFavicon','getDate','now','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','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','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3ffb,0x13f));var _0xb3ff=function(_0x40e849,_0x4879bc){_0x40e849=_0x40e849-0x0;var _0x28602d=_0x3ffb[_0x40e849];return _0x28602d;};'use strict';var emlformat=require(_0xb3ff('0x0'));var rimraf=require(_0xb3ff('0x1'));var zipdir=require(_0xb3ff('0x2'));var jsonpatch=require(_0xb3ff('0x3'));var rp=require(_0xb3ff('0x4'));var moment=require('moment');var BPromise=require(_0xb3ff('0x5'));var Mustache=require(_0xb3ff('0x6'));var util=require(_0xb3ff('0x7'));var path=require(_0xb3ff('0x8'));var sox=require(_0xb3ff('0x9'));var csv=require(_0xb3ff('0xa'));var ejs=require(_0xb3ff('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb3ff('0xc'));var squel=require(_0xb3ff('0xd'));var crypto=require(_0xb3ff('0xe'));var jsforce=require(_0xb3ff('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb3ff('0x10'));var Papa=require(_0xb3ff('0x11'));var Redis=require(_0xb3ff('0x12'));var authService=require(_0xb3ff('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb3ff('0x14'));var hardwareService=require(_0xb3ff('0x15'));var logger=require('../../config/logger')(_0xb3ff('0x16'));var utils=require(_0xb3ff('0x17'));var config=require(_0xb3ff('0x18'));var licenseUtil=require(_0xb3ff('0x19'));var db=require(_0xb3ff('0x1a'))['db'];var jayson=require(_0xb3ff('0x1b'));var client=jayson[_0xb3ff('0x1c')][_0xb3ff('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x57056a,_0x2f548b,_0x2f8f65,_0x2db25a){return new BPromise(function(_0xb7cfa0,_0xb0c045){var _0xad770=_0x2db25a||client;return _0xad770['request'](_0x57056a,_0x2f8f65)[_0xb3ff('0x1e')](function(_0x4d8826){logger[_0xb3ff('0x1f')](_0xb3ff('0x20'),_0x2f548b,'request\x20sent');logger[_0xb3ff('0x21')](_0xb3ff('0x22'),_0x2f548b,_0xb3ff('0x23'),JSON[_0xb3ff('0x24')](_0x4d8826));if(_0x4d8826[_0xb3ff('0x25')]){if(_0x4d8826[_0xb3ff('0x25')][_0xb3ff('0x26')]===0x1f4){logger[_0xb3ff('0x25')]('Setting,\x20%s,\x20%s',_0x2f548b,_0x4d8826[_0xb3ff('0x25')]['message']);return _0xb0c045(_0x4d8826[_0xb3ff('0x25')]['message']);}logger[_0xb3ff('0x25')](_0xb3ff('0x20'),_0x2f548b,_0x4d8826['error'][_0xb3ff('0x27')]);return _0xb7cfa0(_0x4d8826[_0xb3ff('0x25')]['message']);}else{logger[_0xb3ff('0x1f')](_0xb3ff('0x20'),_0x2f548b,_0xb3ff('0x23'));_0xb7cfa0(_0x4d8826['result'][_0xb3ff('0x27')]);}})[_0xb3ff('0x28')](function(_0x4cfd0a){logger['error'](_0xb3ff('0x20'),_0x2f548b,_0x4cfd0a);_0xb0c045(_0x4cfd0a);});});}function respondWithStatusCode(_0x3d7b88,_0x3465be){_0x3465be=_0x3465be||0xcc;return function(_0x3056b9){if(_0x3056b9){return _0x3d7b88[_0xb3ff('0x29')](_0x3465be);}return _0x3d7b88[_0xb3ff('0x2a')](_0x3465be)[_0xb3ff('0x2b')]();};}function respondWithResult(_0x2dba59,_0x3f8017){_0x3f8017=_0x3f8017||0xc8;return function(_0x38f9ef){if(_0x38f9ef){return _0x2dba59[_0xb3ff('0x2a')](_0x3f8017)[_0xb3ff('0x2c')](_0x38f9ef);}};}function respondWithFilteredResult(_0x1d092d,_0x50a318){return function(_0x599f87){if(_0x599f87){var _0x22b4f6=typeof _0x50a318[_0xb3ff('0x2d')]==='undefined'&&typeof _0x50a318['limit']===_0xb3ff('0x2e');var _0x41369e=_0x599f87['count'];var _0x3466f2=_0x22b4f6?0x0:_0x50a318[_0xb3ff('0x2d')];var _0x1fb7ed=_0x22b4f6?_0x599f87[_0xb3ff('0x2f')]:_0x50a318[_0xb3ff('0x2d')]+_0x50a318[_0xb3ff('0x30')];var _0x341c9c;if(_0x1fb7ed>=_0x41369e){_0x1fb7ed=_0x41369e;_0x341c9c=0xc8;}else{_0x341c9c=0xce;}_0x1d092d[_0xb3ff('0x2a')](_0x341c9c);return _0x1d092d[_0xb3ff('0x31')]('Content-Range',_0x3466f2+'-'+_0x1fb7ed+'/'+_0x41369e)[_0xb3ff('0x2c')](_0x599f87);}return null;};}function patchUpdates(_0x2827eb){return function(_0x1f47f9){try{jsonpatch[_0xb3ff('0x32')](_0x1f47f9,_0x2827eb,!![]);}catch(_0x4ace33){return BPromise[_0xb3ff('0x33')](_0x4ace33);}return _0x1f47f9[_0xb3ff('0x34')]();};}function saveUpdates(_0x2c2059,_0x406870){return function(_0x5104d8){if(_0x5104d8){return _0x5104d8['update'](_0x2c2059)['then'](function(_0x2990e3){return _0x2990e3;});}return null;};}function removeEntity(_0x67f1a6,_0x11e7c6){return function(_0x3cefd4){if(_0x3cefd4){return _0x3cefd4[_0xb3ff('0x35')]()[_0xb3ff('0x1e')](function(){_0x67f1a6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x57adce,_0xcbfa6e){return function(_0x1bb717){if(!_0x1bb717){_0x57adce[_0xb3ff('0x29')](0x194);}return _0x1bb717;};}function handleError(_0x44addf,_0x503a31){_0x503a31=_0x503a31||0x1f4;return function(_0x37352a){logger[_0xb3ff('0x25')](_0x37352a['stack']);if(_0x37352a[_0xb3ff('0x36')]){delete _0x37352a[_0xb3ff('0x36')];}_0x44addf['status'](_0x503a31)[_0xb3ff('0x37')](_0x37352a);};}exports[_0xb3ff('0x38')]=function(_0xa67e66,_0x316ca3){var _0x49b156={},_0x5469ff={},_0xa98669={'count':0x0,'rows':[]};var _0x2f34aa=_[_0xb3ff('0x39')](db[_0xb3ff('0x3a')]['rawAttributes'],function(_0x3d70ab){return{'name':_0x3d70ab[_0xb3ff('0x3b')],'type':_0x3d70ab['type']['key']};});_0x5469ff[_0xb3ff('0x3c')]=_['map'](_0x2f34aa,'name');_0x5469ff[_0xb3ff('0x3d')]=_['keys'](_0xa67e66[_0xb3ff('0x3d')]);_0x5469ff['filters']=_[_0xb3ff('0x3e')](_0x5469ff[_0xb3ff('0x3c')],_0x5469ff[_0xb3ff('0x3d')]);_0x49b156[_0xb3ff('0x3f')]=_[_0xb3ff('0x3e')](_0x5469ff[_0xb3ff('0x3c')],qs['fields'](_0xa67e66[_0xb3ff('0x3d')][_0xb3ff('0x40')]));_0x49b156[_0xb3ff('0x3f')]=_0x49b156['attributes'][_0xb3ff('0x41')]?_0x49b156[_0xb3ff('0x3f')]:_0x5469ff['model'];if(!_0xa67e66[_0xb3ff('0x3d')][_0xb3ff('0x42')](_0xb3ff('0x43'))){_0x49b156[_0xb3ff('0x30')]=qs['limit'](_0xa67e66[_0xb3ff('0x3d')][_0xb3ff('0x30')]);_0x49b156[_0xb3ff('0x2d')]=qs[_0xb3ff('0x2d')](_0xa67e66[_0xb3ff('0x3d')][_0xb3ff('0x2d')]);}_0x49b156['order']=qs['sort'](_0xa67e66[_0xb3ff('0x3d')][_0xb3ff('0x44')]);_0x49b156[_0xb3ff('0x45')]=qs[_0xb3ff('0x46')](_[_0xb3ff('0x47')](_0xa67e66['query'],_0x5469ff[_0xb3ff('0x46')]),_0x2f34aa);if(_0xa67e66['query']['filter']){_0x49b156[_0xb3ff('0x45')]=_['merge'](_0x49b156[_0xb3ff('0x45')],{'$or':_[_0xb3ff('0x39')](_0x2f34aa,function(_0x28a021){if(_0x28a021['type']!==_0xb3ff('0x48')){var _0xc42e40={};_0xc42e40[_0x28a021[_0xb3ff('0x36')]]={'$like':'%'+_0xa67e66[_0xb3ff('0x3d')][_0xb3ff('0x49')]+'%'};return _0xc42e40;}})});}_0x49b156=_['merge']({},_0x49b156,_0xa67e66[_0xb3ff('0x4a')]);var _0x4a23d1={'where':_0x49b156[_0xb3ff('0x45')]};return db['Setting'][_0xb3ff('0x2f')](_0x4a23d1)[_0xb3ff('0x1e')](function(_0x57e5e7){_0xa98669[_0xb3ff('0x2f')]=_0x57e5e7;if(_0xa67e66[_0xb3ff('0x3d')][_0xb3ff('0x4b')]){_0x49b156['include']=[{'all':!![]}];}return db[_0xb3ff('0x3a')]['findAll'](_0x49b156);})[_0xb3ff('0x1e')](function(_0x89fc8a){_0xa98669[_0xb3ff('0x4c')]=_0x89fc8a;return _0xa98669;})[_0xb3ff('0x1e')](respondWithFilteredResult(_0x316ca3,_0x49b156))[_0xb3ff('0x28')](handleError(_0x316ca3,null));};exports[_0xb3ff('0x4d')]=function(_0x3253c4,_0x549b8a){var _0x206fea={'raw':![],'where':{'id':_0x3253c4[_0xb3ff('0x4e')]['id']}},_0x2eba0c={};_0x2eba0c[_0xb3ff('0x3c')]=_['keys'](db['Setting']['rawAttributes']);_0x2eba0c[_0xb3ff('0x3d')]=_[_0xb3ff('0x4f')](_0x3253c4[_0xb3ff('0x3d')]);_0x2eba0c[_0xb3ff('0x46')]=_['intersection'](_0x2eba0c[_0xb3ff('0x3c')],_0x2eba0c[_0xb3ff('0x3d')]);_0x206fea[_0xb3ff('0x3f')]=_[_0xb3ff('0x3e')](_0x2eba0c['model'],qs[_0xb3ff('0x40')](_0x3253c4[_0xb3ff('0x3d')][_0xb3ff('0x40')]));_0x206fea['attributes']=_0x206fea['attributes'][_0xb3ff('0x41')]?_0x206fea['attributes']:_0x2eba0c[_0xb3ff('0x3c')];if(_0x3253c4['query'][_0xb3ff('0x4b')]){_0x206fea[_0xb3ff('0x50')]=[{'all':!![]}];}_0x206fea=_['merge']({},_0x206fea,_0x3253c4[_0xb3ff('0x4a')]);return db[_0xb3ff('0x3a')][_0xb3ff('0x51')](_0x206fea)[_0xb3ff('0x1e')](handleEntityNotFound(_0x549b8a,null))['then'](respondWithResult(_0x549b8a,null))[_0xb3ff('0x28')](handleError(_0x549b8a,null));};exports[_0xb3ff('0x52')]=function(_0x5b2138,_0x5cdffd){if(_0x5b2138[_0xb3ff('0x53')]['id']){delete _0x5b2138['body']['id'];}return db[_0xb3ff('0x3a')][_0xb3ff('0x51')]({'where':{'id':_0x5b2138[_0xb3ff('0x4e')]['id']}})[_0xb3ff('0x1e')](handleEntityNotFound(_0x5cdffd,null))[_0xb3ff('0x1e')](saveUpdates(_0x5b2138[_0xb3ff('0x53')],null))[_0xb3ff('0x1e')](respondWithResult(_0x5cdffd,null))['catch'](handleError(_0x5cdffd,null));};exports[_0xb3ff('0x54')]=function(_0xdcd869,_0x4d5aec,_0x17249b){if(_0xdcd869[_0xb3ff('0x55')]&&_0xdcd869[_0xb3ff('0x55')][_0xb3ff('0x56')]){_0xdcd869[_0xb3ff('0x53')][_0xb3ff('0x57')]=_0xdcd869[_0xb3ff('0x55')][_0xb3ff('0x56')];}return db[_0xb3ff('0x3a')]['find']({'where':{'id':_0xdcd869[_0xb3ff('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4d5aec,null))[_0xb3ff('0x1e')](saveUpdates(_0xdcd869['body'],null))[_0xb3ff('0x1e')](respondWithResult(_0x4d5aec,null))[_0xb3ff('0x28')](handleError(_0x4d5aec,null));};exports[_0xb3ff('0x58')]=function(_0xc32f7,_0x3ca0a5,_0x5bee7f){if(_0xc32f7[_0xb3ff('0x55')]&&_0xc32f7['file'][_0xb3ff('0x56')]){_0xc32f7['body'][_0xb3ff('0x59')]=_0xc32f7['file']['filename'];}return db[_0xb3ff('0x3a')][_0xb3ff('0x51')]({'where':{'id':_0xc32f7[_0xb3ff('0x4e')]['id']}})[_0xb3ff('0x1e')](handleEntityNotFound(_0x3ca0a5,null))['then'](saveUpdates(_0xc32f7['body'],null))[_0xb3ff('0x1e')](respondWithResult(_0x3ca0a5,null))['catch'](handleError(_0x3ca0a5,null));};var utilLicense=require(_0xb3ff('0x19'));exports[_0xb3ff('0x5a')]=function(_0x2bf307,_0x41d7b0,_0x28c0ac){var _0x417cf8=_0xb3ff('0x5b');var _0x140a76={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x21426d){if(_0x21426d){_0x140a76=_0x21426d;}return db[_0xb3ff('0x3a')][_0xb3ff('0x51')]({'where':{'id':_0x2bf307['params']['id']},'attributes':['logo','loginLogo',_0xb3ff('0x5c'),_0xb3ff('0x5d'),_0xb3ff('0x5e'),_0xb3ff('0x5f'),_0xb3ff('0x60'),_0xb3ff('0x61')],'raw':!![]});})[_0xb3ff('0x1e')](handleEntityNotFound(_0x41d7b0,null))['then'](function(_0x236622){if(_0x236622){var _0x1efec8=_0x236622[_0xb3ff('0x57')]&&fs[_0xb3ff('0x62')](path[_0xb3ff('0x63')](config['root'],_0x417cf8,_['toLower'](_0x236622[_0xb3ff('0x57')])))?path['join'](config[_0xb3ff('0x64')],_0x417cf8,_[_0xb3ff('0x65')](_0x236622[_0xb3ff('0x57')])):path[_0xb3ff('0x63')](config[_0xb3ff('0x64')],_0x417cf8,_['toLower'](_0xb3ff('0x66')));var _0x2123e7='default'+_[_0xb3ff('0x67')](_0xb3ff('0x57'));if(_0x236622[_0x2123e7]||!_0x140a76[_0xb3ff('0x68')]){_0x1efec8=path[_0xb3ff('0x63')](config[_0xb3ff('0x64')],_0x417cf8,_[_0xb3ff('0x65')]('default_logo.svg'));}if(!fs['existsSync'](_0x1efec8)){throw new db[(_0xb3ff('0x69'))][(_0xb3ff('0x6a'))](_['upperFirst'](_0xb3ff('0x57'))+_0xb3ff('0x6b'));}return _0x41d7b0[_0xb3ff('0x6c')](_0x1efec8);}})[_0xb3ff('0x28')](handleError(_0x41d7b0,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0x5e210e,_0x72b470,_0x4593ce){var _0x82d465=_0xb3ff('0x5b');var _0x135565={'custom':![]};return utilLicense[_0xb3ff('0x6d')]()[_0xb3ff('0x1e')](function(_0x58edc2){if(_0x58edc2){_0x135565=_0x58edc2;}return db[_0xb3ff('0x3a')]['find']({'where':{'id':_0x5e210e[_0xb3ff('0x4e')]['id']},'attributes':['logo',_0xb3ff('0x59'),_0xb3ff('0x5c'),'favicon',_0xb3ff('0x5e'),_0xb3ff('0x5f'),_0xb3ff('0x60'),'defaultFavicon'],'raw':!![]});})[_0xb3ff('0x1e')](handleEntityNotFound(_0x72b470,null))[_0xb3ff('0x1e')](function(_0x291892){if(_0x291892){var _0x31f895=_0x291892['loginLogo']&&fs[_0xb3ff('0x62')](path['join'](config[_0xb3ff('0x64')],_0x82d465,_[_0xb3ff('0x65')](_0x291892[_0xb3ff('0x59')])))?path[_0xb3ff('0x63')](config[_0xb3ff('0x64')],_0x82d465,_[_0xb3ff('0x65')](_0x291892['loginLogo'])):path['join'](config[_0xb3ff('0x64')],_0x82d465,_['toLower'](_0xb3ff('0x6e')));var _0x4833aa='default'+_['upperFirst']('loginLogo');if(_0x291892[_0x4833aa]||!_0x135565[_0xb3ff('0x68')]){_0x31f895=path['join'](config[_0xb3ff('0x64')],_0x82d465,_[_0xb3ff('0x65')](_0xb3ff('0x6e')));}if(!fs['existsSync'](_0x31f895)){throw new db['Sequelize'][(_0xb3ff('0x6a'))](_[_0xb3ff('0x67')](_0xb3ff('0x59'))+'\x20not\x20found');}return _0x72b470[_0xb3ff('0x6c')](_0x31f895);}})[_0xb3ff('0x28')](handleError(_0x72b470,null));};exports['gdpr']=function(_0x301a5d,_0x551d4c){return db[_0xb3ff('0x3a')][_0xb3ff('0x51')]({'where':{'id':_0x301a5d['params']['id']},'attributes':['securePassword']})[_0xb3ff('0x1e')](respondWithResult(_0x551d4c,null))['catch'](handleError(_0x551d4c,null));};exports[_0xb3ff('0x6f')]=function(_0x229598,_0xb3d9b0,_0x439f54){if(_0x229598[_0xb3ff('0x55')]&&_0x229598['file'][_0xb3ff('0x56')]){_0x229598[_0xb3ff('0x53')][_0xb3ff('0x5c')]=_0x229598['file'][_0xb3ff('0x56')];}return db['Setting']['find']({'where':{'id':_0x229598[_0xb3ff('0x4e')]['id']}})[_0xb3ff('0x1e')](handleEntityNotFound(_0xb3d9b0,null))[_0xb3ff('0x1e')](saveUpdates(_0x229598[_0xb3ff('0x53')],null))[_0xb3ff('0x1e')](respondWithResult(_0xb3d9b0,null))['catch'](handleError(_0xb3d9b0,null));};var utilLicense=require('../../config/license/util');exports[_0xb3ff('0x70')]=function(_0x3eb7f4,_0x3d24fe,_0x3753c7){var _0x3c840f=_0xb3ff('0x5b');var _0x26cb0b={'custom':![]};return utilLicense[_0xb3ff('0x6d')]()[_0xb3ff('0x1e')](function(_0x6881da){if(_0x6881da){_0x26cb0b=_0x6881da;}return db[_0xb3ff('0x3a')][_0xb3ff('0x51')]({'where':{'id':_0x3eb7f4[_0xb3ff('0x4e')]['id']},'attributes':[_0xb3ff('0x57'),'loginLogo',_0xb3ff('0x5c'),'favicon',_0xb3ff('0x5e'),_0xb3ff('0x5f'),_0xb3ff('0x60'),'defaultFavicon'],'raw':!![]});})[_0xb3ff('0x1e')](handleEntityNotFound(_0x3d24fe,null))[_0xb3ff('0x1e')](function(_0x3cc968){if(_0x3cc968){var _0x5139b4=_0x3cc968[_0xb3ff('0x5c')]&&fs[_0xb3ff('0x62')](path[_0xb3ff('0x63')](config[_0xb3ff('0x64')],_0x3c840f,_[_0xb3ff('0x65')](_0x3cc968[_0xb3ff('0x5c')])))?path[_0xb3ff('0x63')](config[_0xb3ff('0x64')],_0x3c840f,_['toLower'](_0x3cc968[_0xb3ff('0x5c')])):path[_0xb3ff('0x63')](config[_0xb3ff('0x64')],_0x3c840f,_[_0xb3ff('0x65')](_0xb3ff('0x71')));var _0xc2b35c=_0xb3ff('0x72')+_[_0xb3ff('0x67')](_0xb3ff('0x5c'));if(_0x3cc968[_0xc2b35c]||!_0x26cb0b[_0xb3ff('0x68')]||!_0x26cb0b[_0xb3ff('0x5c')]){_0x5139b4=path[_0xb3ff('0x63')](config[_0xb3ff('0x64')],_0x3c840f,_[_0xb3ff('0x65')](_0xb3ff('0x71')));}if(!fs[_0xb3ff('0x62')](_0x5139b4)){throw new db[(_0xb3ff('0x69'))][(_0xb3ff('0x6a'))](_[_0xb3ff('0x67')](_0xb3ff('0x5c'))+_0xb3ff('0x6b'));}return _0x3d24fe['download'](_0x5139b4);}})[_0xb3ff('0x28')](handleError(_0x3d24fe,null));};exports[_0xb3ff('0x73')]=function(_0x867e14,_0x2508e3,_0x10ff94){if(_0x867e14[_0xb3ff('0x55')]&&_0x867e14[_0xb3ff('0x55')][_0xb3ff('0x56')]){_0x867e14[_0xb3ff('0x53')][_0xb3ff('0x5d')]=_0x867e14[_0xb3ff('0x55')][_0xb3ff('0x56')];}return db[_0xb3ff('0x3a')][_0xb3ff('0x51')]({'where':{'id':_0x867e14[_0xb3ff('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2508e3,null))['then'](saveUpdates(_0x867e14['body'],null))['then'](respondWithResult(_0x2508e3,null))[_0xb3ff('0x28')](handleError(_0x2508e3,null));};var utilLicense=require(_0xb3ff('0x19'));exports[_0xb3ff('0x74')]=function(_0x4b9adb,_0xb7a1be,_0xa34cd5){var _0x266239=_0xb3ff('0x5b');var _0x524395={'custom':![]};return utilLicense[_0xb3ff('0x6d')]()['then'](function(_0x43dbb9){if(_0x43dbb9){_0x524395=_0x43dbb9;}return db[_0xb3ff('0x3a')]['find']({'where':{'id':_0x4b9adb[_0xb3ff('0x4e')]['id']},'attributes':['logo','loginLogo',_0xb3ff('0x5c'),'favicon',_0xb3ff('0x5e'),_0xb3ff('0x5f'),'defaultPreferred',_0xb3ff('0x61')],'raw':!![]});})[_0xb3ff('0x1e')](handleEntityNotFound(_0xb7a1be,null))[_0xb3ff('0x1e')](function(_0x27d8e9){if(_0x27d8e9){var _0x2ae3c6=_0x27d8e9[_0xb3ff('0x5d')]&&fs[_0xb3ff('0x62')](path['join'](config[_0xb3ff('0x64')],_0x266239,_[_0xb3ff('0x65')](_0x27d8e9['favicon'])))?path[_0xb3ff('0x63')](config[_0xb3ff('0x64')],_0x266239,_[_0xb3ff('0x65')](_0x27d8e9[_0xb3ff('0x5d')])):path[_0xb3ff('0x63')](config['root'],_0x266239,_[_0xb3ff('0x65')]('default_favicon.ico'));var _0x15abe7='default'+_['upperFirst'](_0xb3ff('0x5d'));if(_0x27d8e9[_0x15abe7]||!_0x524395[_0xb3ff('0x68')]){_0x2ae3c6=path[_0xb3ff('0x63')](config['root'],_0x266239,_[_0xb3ff('0x65')]('default_favicon.ico'));}if(!fs['existsSync'](_0x2ae3c6)){throw new db[(_0xb3ff('0x69'))][(_0xb3ff('0x6a'))](_[_0xb3ff('0x67')](_0xb3ff('0x5d'))+_0xb3ff('0x6b'));}return _0xb7a1be[_0xb3ff('0x6c')](_0x2ae3c6);}})[_0xb3ff('0x28')](handleError(_0xb7a1be,null));};exports[_0xb3ff('0x75')]=function(_0x5cdae2,_0x2f8c2e){var _0x54080d={'offset':moment()['utcOffset']()};_0x54080d[_0xb3ff('0x76')]=moment()[_0xb3ff('0x77')](_0x54080d[_0xb3ff('0x2d')])[_0xb3ff('0x78')](_0xb3ff('0x79'));return _0x2f8c2e['status'](0xc8)[_0xb3ff('0x37')](_0x54080d);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index f57e6e0..3fc4866 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 _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x5093e9,_0x5154d0){var _0x4c9a22=function(_0x15176d){while(--_0x15176d){_0x5093e9['push'](_0x5093e9['shift']());}};_0x4c9a22(++_0x5154d0);}(_0x3e74,0x175));var _0x43e7=function(_0xdd954e,_0x51d458){_0xdd954e=_0xdd954e-0x0;var _0x1af328=_0x3e74[_0xdd954e];return _0x1af328;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x243c99,_0x1fa5cc){var _0x13efac=function(_0x475b56){while(--_0x475b56){_0x243c99['push'](_0x243c99['shift']());}};_0x13efac(++_0x1fa5cc);}(_0x3e74,0x175));var _0x43e7=function(_0x178a9f,_0x3a7361){_0x178a9f=_0x178a9f-0x0;var _0x4fe443=_0x3e74[_0x178a9f];return _0x4fe443;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index d768b20..8556527 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 _0xb0e0=['request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ShowSetting','Setting','find','options','raw','attributes','map','include','model','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s'];(function(_0xe45118,_0x5dffbc){var _0x15e15d=function(_0x17eaec){while(--_0x17eaec){_0xe45118['push'](_0xe45118['shift']());}};_0x15e15d(++_0x5dffbc);}(_0xb0e0,0xd7));var _0x0b0e=function(_0x1bd078,_0xa04cfa){_0x1bd078=_0x1bd078-0x0;var _0x290958=_0xb0e0[_0x1bd078];return _0x290958;};'use strict';var _=require(_0x0b0e('0x0'));var util=require(_0x0b0e('0x1'));var moment=require(_0x0b0e('0x2'));var BPromise=require('bluebird');var rs=require(_0x0b0e('0x3'));var fs=require('fs');var Redis=require(_0x0b0e('0x4'));var db=require(_0x0b0e('0x5'))['db'];var utils=require(_0x0b0e('0x6'));var logger=require(_0x0b0e('0x7'))(_0x0b0e('0x8'));var config=require(_0x0b0e('0x9'));var jayson=require(_0x0b0e('0xa'));var client=jayson[_0x0b0e('0xb')][_0x0b0e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x508003,_0x5288d6,_0x4f9e8d){return new BPromise(function(_0x2fe600,_0x4f413b){return client['request'](_0x508003,_0x4f9e8d)[_0x0b0e('0xd')](function(_0x7d4eea){logger[_0x0b0e('0xe')](_0x0b0e('0xf'),_0x5288d6,_0x0b0e('0x10'));logger[_0x0b0e('0x11')](_0x0b0e('0x12'),_0x5288d6,_0x0b0e('0x10'),JSON[_0x0b0e('0x13')](_0x7d4eea));if(_0x7d4eea[_0x0b0e('0x14')]){if(_0x7d4eea[_0x0b0e('0x14')]['code']===0x1f4){logger[_0x0b0e('0x14')](_0x0b0e('0xf'),_0x5288d6,_0x7d4eea[_0x0b0e('0x14')][_0x0b0e('0x15')]);return _0x4f413b(_0x7d4eea[_0x0b0e('0x14')][_0x0b0e('0x15')]);}logger[_0x0b0e('0x14')](_0x0b0e('0xf'),_0x5288d6,_0x7d4eea[_0x0b0e('0x14')][_0x0b0e('0x15')]);return _0x2fe600(_0x7d4eea[_0x0b0e('0x14')][_0x0b0e('0x15')]);}else{logger['info'](_0x0b0e('0xf'),_0x5288d6,_0x0b0e('0x10'));_0x2fe600(_0x7d4eea[_0x0b0e('0x16')][_0x0b0e('0x15')]);}})['catch'](function(_0x9cc665){logger['error'](_0x0b0e('0xf'),_0x5288d6,_0x9cc665);_0x4f413b(_0x9cc665);});});}exports[_0x0b0e('0x17')]=function(_0x24f03e){var _0xeae22d=this;return new Promise(function(_0x239855,_0x29a157){return db[_0x0b0e('0x18')][_0x0b0e('0x19')]({'raw':_0x24f03e['options']?_0x24f03e[_0x0b0e('0x1a')][_0x0b0e('0x1b')]===undefined?!![]:![]:!![],'where':_0x24f03e['options']?_0x24f03e[_0x0b0e('0x1a')]['where']||null:null,'attributes':_0x24f03e['options']?_0x24f03e['options'][_0x0b0e('0x1c')]||null:null,'include':_0x24f03e[_0x0b0e('0x1a')]?_0x24f03e[_0x0b0e('0x1a')]['include']?_[_0x0b0e('0x1d')](_0x24f03e[_0x0b0e('0x1a')][_0x0b0e('0x1e')],function(_0x31ed8c){return{'model':db[_0x31ed8c['model']],'as':_0x31ed8c['as'],'attributes':_0x31ed8c['attributes'],'include':_0x31ed8c[_0x0b0e('0x1e')]?_[_0x0b0e('0x1d')](_0x31ed8c[_0x0b0e('0x1e')],function(_0x415277){return{'model':db[_0x415277[_0x0b0e('0x1f')]],'as':_0x415277['as'],'attributes':_0x415277[_0x0b0e('0x1c')],'include':_0x415277[_0x0b0e('0x1e')]?_['map'](_0x415277[_0x0b0e('0x1e')],function(_0x5b5149){return{'model':db[_0x5b5149['model']],'as':_0x5b5149['as'],'attributes':_0x5b5149[_0x0b0e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0b0e('0xd')](function(_0x24871f){logger[_0x0b0e('0xe')](_0x0b0e('0x17'),_0x24f03e);logger[_0x0b0e('0x11')]('ShowSetting',_0x24f03e,JSON[_0x0b0e('0x13')](_0x24871f));_0x239855(_0x24871f);})[_0x0b0e('0x20')](function(_0x1cbd52){logger[_0x0b0e('0x14')](_0x0b0e('0x17'),_0x1cbd52[_0x0b0e('0x15')],_0x24f03e);_0x29a157(_0xeae22d[_0x0b0e('0x14')](0x1f4,_0x1cbd52[_0x0b0e('0x15')]));});});}; \ No newline at end of file +var _0xb153=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','lodash','util','moment'];(function(_0xa8ae1f,_0x5cd40e){var _0x1dfaac=function(_0x5ef72a){while(--_0x5ef72a){_0xa8ae1f['push'](_0xa8ae1f['shift']());}};_0x1dfaac(++_0x5cd40e);}(_0xb153,0x13d));var _0x3b15=function(_0x425910,_0x50470c){_0x425910=_0x425910-0x0;var _0x1b95c6=_0xb153[_0x425910];return _0x1b95c6;};'use strict';var _=require(_0x3b15('0x0'));var util=require(_0x3b15('0x1'));var moment=require(_0x3b15('0x2'));var BPromise=require(_0x3b15('0x3'));var rs=require(_0x3b15('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3b15('0x5'))['db'];var utils=require(_0x3b15('0x6'));var logger=require('../../config/logger')(_0x3b15('0x7'));var config=require(_0x3b15('0x8'));var jayson=require(_0x3b15('0x9'));var client=jayson[_0x3b15('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf40b76,_0x428c74,_0x483ce6){return new BPromise(function(_0x3a64a4,_0x1ea93f){return client[_0x3b15('0xb')](_0xf40b76,_0x483ce6)[_0x3b15('0xc')](function(_0x139b20){logger[_0x3b15('0xd')](_0x3b15('0xe'),_0x428c74,_0x3b15('0xf'));logger[_0x3b15('0x10')]('Setting,\x20%s,\x20%s,\x20%s',_0x428c74,_0x3b15('0xf'),JSON[_0x3b15('0x11')](_0x139b20));if(_0x139b20[_0x3b15('0x12')]){if(_0x139b20['error'][_0x3b15('0x13')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x428c74,_0x139b20[_0x3b15('0x12')]['message']);return _0x1ea93f(_0x139b20[_0x3b15('0x12')]['message']);}logger[_0x3b15('0x12')](_0x3b15('0xe'),_0x428c74,_0x139b20[_0x3b15('0x12')][_0x3b15('0x14')]);return _0x3a64a4(_0x139b20[_0x3b15('0x12')]['message']);}else{logger[_0x3b15('0xd')](_0x3b15('0xe'),_0x428c74,'request\x20sent');_0x3a64a4(_0x139b20[_0x3b15('0x15')][_0x3b15('0x14')]);}})['catch'](function(_0x27839a){logger[_0x3b15('0x12')](_0x3b15('0xe'),_0x428c74,_0x27839a);_0x1ea93f(_0x27839a);});});}exports[_0x3b15('0x16')]=function(_0x450e5a){var _0x6fdf05=this;return new Promise(function(_0x15c395,_0x2fee0a){return db[_0x3b15('0x17')][_0x3b15('0x18')]({'raw':_0x450e5a[_0x3b15('0x19')]?_0x450e5a[_0x3b15('0x19')][_0x3b15('0x1a')]===undefined?!![]:![]:!![],'where':_0x450e5a['options']?_0x450e5a['options'][_0x3b15('0x1b')]||null:null,'attributes':_0x450e5a[_0x3b15('0x19')]?_0x450e5a[_0x3b15('0x19')][_0x3b15('0x1c')]||null:null,'include':_0x450e5a[_0x3b15('0x19')]?_0x450e5a['options'][_0x3b15('0x1d')]?_[_0x3b15('0x1e')](_0x450e5a[_0x3b15('0x19')][_0x3b15('0x1d')],function(_0x10e87a){return{'model':db[_0x10e87a[_0x3b15('0x1f')]],'as':_0x10e87a['as'],'attributes':_0x10e87a['attributes'],'include':_0x10e87a['include']?_[_0x3b15('0x1e')](_0x10e87a[_0x3b15('0x1d')],function(_0x616938){return{'model':db[_0x616938[_0x3b15('0x1f')]],'as':_0x616938['as'],'attributes':_0x616938[_0x3b15('0x1c')],'include':_0x616938[_0x3b15('0x1d')]?_[_0x3b15('0x1e')](_0x616938[_0x3b15('0x1d')],function(_0x406ce7){return{'model':db[_0x406ce7[_0x3b15('0x1f')]],'as':_0x406ce7['as'],'attributes':_0x406ce7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ed9d3){logger['info'](_0x3b15('0x16'),_0x450e5a);logger['debug'](_0x3b15('0x16'),_0x450e5a,JSON[_0x3b15('0x11')](_0x1ed9d3));_0x15c395(_0x1ed9d3);})['catch'](function(_0x4bcc13){logger[_0x3b15('0x12')](_0x3b15('0x16'),_0x4bcc13[_0x3b15('0x14')],_0x450e5a);_0x2fee0a(_0x6fdf05['error'](0x1f4,_0x4bcc13[_0x3b15('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 9b08c3f..ddeb7fc 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 _0x1cb9=['/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addAnswer','/:id/notify','notify','/:id/applications','/:id/send','/:id/status','status','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2782af,_0x2ff447){_0x2782af=_0x2782af-0x0;var _0x310802=_0x1cb9[_0x2782af];return _0x310802;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0x8')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x8')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x8')]('/:id/applications',auth[_0x91cb('0x9')](),controller[_0x91cb('0x13')]);router['get'](_0x91cb('0x14'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x15')]);router[_0x91cb('0x8')]('/:id/status',controller['statusGet']);router[_0x91cb('0x8')](_0x91cb('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0x91cb('0x17')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x18')]);router['post'](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller['addDisposition']);router[_0x91cb('0x17')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x19')]);router['post'](_0x91cb('0x1a'),controller[_0x91cb('0x1b')]);router['post'](_0x91cb('0x1c'),auth['isAuthenticated'](),controller['addApplications']);router[_0x91cb('0x17')](_0x91cb('0x1d'),auth['isAuthenticated'](),controller['send']);router['post'](_0x91cb('0x1e'),controller[_0x91cb('0x1f')]);router[_0x91cb('0x17')](_0x91cb('0x16'),auth['isAuthenticated'](),controller[_0x91cb('0x20')]);router[_0x91cb('0x21')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x22')]);router[_0x91cb('0x23')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x24')]);router[_0x91cb('0x23')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x25')]);router['delete']('/:id/canned_answers',auth[_0x91cb('0x9')](),controller['removeAnswers']);router[_0x91cb('0x23')](_0x91cb('0x16'),auth[_0x91cb('0x9')](),controller['removeAgents']);module[_0x91cb('0x26')]=router; \ No newline at end of file +var _0xc4aa=['statusGet','/:id/users','getAgents','post','addDisposition','addAnswer','notify','addApplications','/:id/send','send','status','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x1b470a,_0x17af22){var _0x4e0446=function(_0x656886){while(--_0x656886){_0x1b470a['push'](_0x1b470a['shift']());}};_0x4e0446(++_0x17af22);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xc4aa[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['describe']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['get'](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['get'](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);router['get'](_0xac4a('0x12'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x13')]);router['get'](_0xac4a('0x14'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x15')]);router[_0xac4a('0x8')](_0xac4a('0x16'),controller[_0xac4a('0x17')]);router[_0xac4a('0x8')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x19')]);router[_0xac4a('0x1a')]('/',auth[_0xac4a('0x9')](),controller['create']);router[_0xac4a('0x1a')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1b')]);router[_0xac4a('0x1a')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1c')]);router['post']('/:id/notify',controller[_0xac4a('0x1d')]);router[_0xac4a('0x1a')](_0xac4a('0x12'),auth['isAuthenticated'](),controller[_0xac4a('0x1e')]);router[_0xac4a('0x1a')](_0xac4a('0x1f'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x20')]);router[_0xac4a('0x1a')](_0xac4a('0x16'),controller[_0xac4a('0x21')]);router['post'](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller['addAgents']);router[_0xac4a('0x22')](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x23')]);router['delete'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x24')]);router[_0xac4a('0x25')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x26')]);router[_0xac4a('0x25')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x27')]);router[_0xac4a('0x25')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x28')]);module[_0xac4a('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 fab58a1..a985164 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 _0xb162=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM','twilio','skebby','plivo','bandwidth','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER'];(function(_0x56cd24,_0x464fe1){var _0x14a280=function(_0x3d9a75){while(--_0x3d9a75){_0x56cd24['push'](_0x56cd24['shift']());}};_0x14a280(++_0x464fe1);}(_0xb162,0x155));var _0x2b16=function(_0xdb4814,_0x539dbe){_0xdb4814=_0xdb4814-0x0;var _0x29b7ef=_0xb162[_0xdb4814];return _0x29b7ef;};'use strict';var Sequelize=require(_0x2b16('0x0'));var rs=require(_0x2b16('0x1'));module[_0x2b16('0x2')]={'name':{'type':Sequelize[_0x2b16('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x2b16('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x2b16('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x2b16('0x3')],'defaultValue':function(){return rs[_0x2b16('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2b16('0x5')](_0x2b16('0x6'),_0x2b16('0x7'),'connectel','clicksend',_0x2b16('0x8'),'clickatell',_0x2b16('0x9'),'csc',_0x2b16('0xa'),_0x2b16('0xb'))},'accountSid':{'type':Sequelize[_0x2b16('0x3')]},'authId':{'type':Sequelize[_0x2b16('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x2b16('0x3')]},'apiKey':{'type':Sequelize[_0x2b16('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x2b16('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0x2b16('0x3')]},'notificationTemplate':{'type':Sequelize[_0x2b16('0xd')],'defaultValue':function(){return _0x2b16('0xe');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2b16('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2b16('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2b16('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2b16('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2b16('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x2b16('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2b16('0xf')],'comment':_0x2b16('0x10')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2b16('0x11'),'set':function(_0xef92f){if(!_0xef92f)this[_0x2b16('0x12')](_0x2b16('0x13'),null);this['setDataValue'](_0x2b16('0x14'),_0xef92f);}}}; \ No newline at end of file +var _0x7167=['STRING','generate','twilio','skebby','clicksend','plivo','clickatell','csc','infobip','intelepeer','ENUM','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','name'];(function(_0x3caae0,_0x59b01e){var _0x2cff1b=function(_0x18f482){while(--_0x18f482){_0x3caae0['push'](_0x3caae0['shift']());}};_0x2cff1b(++_0x59b01e);}(_0x7167,0x89));var _0x7716=function(_0x18b931,_0x2cad1d){_0x18b931=_0x18b931-0x0;var _0x114958=_0x7167[_0x18b931];return _0x114958;};'use strict';var Sequelize=require(_0x7716('0x0'));var rs=require(_0x7716('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x7716('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x7716('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x7716('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x7716('0x4')]();}},'phone':{'type':Sequelize[_0x7716('0x3')]},'type':{'type':Sequelize['ENUM'](_0x7716('0x5'),_0x7716('0x6'),'connectel',_0x7716('0x7'),_0x7716('0x8'),_0x7716('0x9'),'bandwidth',_0x7716('0xa'),_0x7716('0xb'),_0x7716('0xc'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x7716('0x3')]},'authToken':{'type':Sequelize[_0x7716('0x3')]},'smsMethod':{'type':Sequelize[_0x7716('0xd')]('SI','TI','GP')},'username':{'type':Sequelize[_0x7716('0x3')]},'password':{'type':Sequelize[_0x7716('0x3')]},'apiKey':{'type':Sequelize[_0x7716('0x3')]},'applicationId':{'type':Sequelize[_0x7716('0x3')]},'accountId':{'type':Sequelize[_0x7716('0x3')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x7716('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x7716('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x7716('0xf');}},'notificationSound':{'type':Sequelize[_0x7716('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7716('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7716('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7716('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7716('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7716('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x7716('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7716('0x10')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x7716('0xe')],'defaultValue':![],'comment':_0x7716('0x11'),'set':function(_0x3a862d){if(!_0x3a862d)this['setDataValue'](_0x7716('0x12'),null);this['setDataValue'](_0x7716('0x13'),_0x3a862d);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index e1d1883..a4f20f8 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 _0xa811=['offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','SmsAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','SmsAccount','includeAll','include','rows','show','params','mandatoryDispositionPause','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','describe','addDisposition','SmsAccountId','findOne','Disposition','order','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','account','orderBy','priority','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','from','From','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','from\x20is\x20mandatory','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','CmContact','Contacts','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','push','applications','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','getApplications','getInteractions','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','status_code','groupName','redif','DELIVERED','inspect','DELIVERED_TO_GATEWAY','DELIVRD','message-id','state','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','User','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json'];(function(_0x4f4587,_0x5da216){var _0x312205=function(_0x545508){while(--_0x545508){_0x4f4587['push'](_0x4f4587['shift']());}};_0x312205(++_0x5da216);}(_0xa811,0xba));var _0x1a81=function(_0xeb3a54,_0x50f750){_0xeb3a54=_0xeb3a54-0x0;var _0x4abf64=_0xa811[_0xeb3a54];return _0x4abf64;};'use strict';var emlformat=require(_0x1a81('0x0'));var rimraf=require(_0x1a81('0x1'));var zipdir=require(_0x1a81('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a81('0x3'));var moment=require(_0x1a81('0x4'));var BPromise=require(_0x1a81('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1a81('0x6'));var sox=require(_0x1a81('0x7'));var csv=require(_0x1a81('0x8'));var ejs=require(_0x1a81('0x9'));var fs=require('fs');var fs_extra=require(_0x1a81('0xa'));var _=require(_0x1a81('0xb'));var squel=require(_0x1a81('0xc'));var crypto=require(_0x1a81('0xd'));var jsforce=require(_0x1a81('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1a81('0x8'));var querystring=require(_0x1a81('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1a81('0x10'));var qs=require(_0x1a81('0x11'));var as=require(_0x1a81('0x12'));var hardwareService=require(_0x1a81('0x13'));var logger=require('../../config/logger')(_0x1a81('0x14'));var utils=require(_0x1a81('0x15'));var config=require(_0x1a81('0x16'));var licenseUtil=require(_0x1a81('0x17'));var db=require(_0x1a81('0x18'))['db'];config[_0x1a81('0x19')]=_[_0x1a81('0x1a')](config[_0x1a81('0x19')],{'host':_0x1a81('0x1b'),'port':0x18eb});var socket=require(_0x1a81('0x1c'))(new Redis(config['redis']));require(_0x1a81('0x1d'))[_0x1a81('0x1e')](socket);var jayson=require(_0x1a81('0x1f'));var client=jayson[_0x1a81('0x20')][_0x1a81('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x25aa99,_0x1e905a,_0x2b414c,_0x4e361a){return new BPromise(function(_0x53094b,_0x65683c){var _0x47fdf9=_0x4e361a||client;return _0x47fdf9[_0x1a81('0x22')](_0x25aa99,_0x2b414c)['then'](function(_0x68d85b){logger[_0x1a81('0x23')]('SmsAccount,\x20%s,\x20%s',_0x1e905a,_0x1a81('0x24'));logger[_0x1a81('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1e905a,_0x1a81('0x24'),JSON[_0x1a81('0x26')](_0x68d85b));if(_0x68d85b['error']){if(_0x68d85b['error']['code']===0x1f4){logger[_0x1a81('0x27')](_0x1a81('0x28'),_0x1e905a,_0x68d85b[_0x1a81('0x27')][_0x1a81('0x29')]);return _0x65683c(_0x68d85b[_0x1a81('0x27')][_0x1a81('0x29')]);}logger[_0x1a81('0x27')]('SmsAccount,\x20%s,\x20%s',_0x1e905a,_0x68d85b['error']['message']);return _0x53094b(_0x68d85b[_0x1a81('0x27')][_0x1a81('0x29')]);}else{logger[_0x1a81('0x23')](_0x1a81('0x28'),_0x1e905a,'request\x20sent');_0x53094b(_0x68d85b[_0x1a81('0x2a')]['message']);}})[_0x1a81('0x2b')](function(_0x3a9705){logger[_0x1a81('0x27')](_0x1a81('0x28'),_0x1e905a,_0x3a9705);_0x65683c(_0x3a9705);});});}function respondWithStatusCode(_0x48b6c6,_0x4aefb5){_0x4aefb5=_0x4aefb5||0xcc;return function(_0x2e7481){if(_0x2e7481){return _0x48b6c6[_0x1a81('0x2c')](_0x4aefb5);}return _0x48b6c6[_0x1a81('0x2d')](_0x4aefb5)[_0x1a81('0x2e')]();};}function respondWithResult(_0x226f18,_0x49b416){_0x49b416=_0x49b416||0xc8;return function(_0x5dbc7d){if(_0x5dbc7d){return _0x226f18[_0x1a81('0x2d')](_0x49b416)[_0x1a81('0x2f')](_0x5dbc7d);}};}function respondWithFilteredResult(_0x2baad9,_0x7f20b1){return function(_0xdba0f1){if(_0xdba0f1){var _0x2edbe6=typeof _0x7f20b1[_0x1a81('0x30')]==='undefined'&&typeof _0x7f20b1[_0x1a81('0x31')]===_0x1a81('0x32');var _0xbe2ea3=_0xdba0f1[_0x1a81('0x33')];var _0x2498f3=_0x2edbe6?0x0:_0x7f20b1[_0x1a81('0x30')];var _0x3ed532=_0x2edbe6?_0xdba0f1[_0x1a81('0x33')]:_0x7f20b1['offset']+_0x7f20b1[_0x1a81('0x31')];var _0x1e78cd;if(_0x3ed532>=_0xbe2ea3){_0x3ed532=_0xbe2ea3;_0x1e78cd=0xc8;}else{_0x1e78cd=0xce;}_0x2baad9[_0x1a81('0x2d')](_0x1e78cd);return _0x2baad9[_0x1a81('0x34')](_0x1a81('0x35'),_0x2498f3+'-'+_0x3ed532+'/'+_0xbe2ea3)[_0x1a81('0x2f')](_0xdba0f1);}return null;};}function patchUpdates(_0x3ea542){return function(_0x9caf22){try{jsonpatch[_0x1a81('0x36')](_0x9caf22,_0x3ea542,!![]);}catch(_0x30e39f){return BPromise[_0x1a81('0x37')](_0x30e39f);}return _0x9caf22[_0x1a81('0x38')]();};}function saveUpdates(_0x1bf039,_0xa17cc7){return function(_0x5567ba){if(_0x5567ba){return _0x5567ba[_0x1a81('0x39')](_0x1bf039)['then'](function(_0x5468c6){return _0x5468c6;});}return null;};}function removeEntity(_0x350050,_0x5166d7){return function(_0x117bec){if(_0x117bec){return _0x117bec['destroy']()[_0x1a81('0x3a')](function(){var _0x58c637=_0x117bec[_0x1a81('0x3b')]({'plain':!![]});var _0x83dfa2=_0x1a81('0x3c');return db[_0x1a81('0x3d')][_0x1a81('0x3e')]({'where':{'type':_0x83dfa2,'resourceId':_0x58c637['id']}})[_0x1a81('0x3a')](function(){return _0x117bec;});})['then'](function(){_0x350050[_0x1a81('0x2d')](0xcc)[_0x1a81('0x2e')]();});}};}function handleEntityNotFound(_0x3680c0,_0x4146d0){return function(_0x4524ae){if(!_0x4524ae){_0x3680c0['sendStatus'](0x194);}return _0x4524ae;};}function handleError(_0x483d5d,_0x4e580a){_0x4e580a=_0x4e580a||0x1f4;return function(_0x26ab84){logger['error'](_0x26ab84[_0x1a81('0x3f')]);if(_0x26ab84[_0x1a81('0x40')]){delete _0x26ab84[_0x1a81('0x40')];}_0x483d5d[_0x1a81('0x2d')](_0x4e580a)[_0x1a81('0x41')](_0x26ab84);};}exports[_0x1a81('0x42')]=function(_0x5d1fba,_0x3d808d){var _0x2dd1c6={'include':[{'model':db[_0x1a81('0x43')],'as':'mandatoryDispositionPause'}]},_0x21e190={},_0x4099bc={'count':0x0,'rows':[]};var _0x3b0ddf=_['map'](db['SmsAccount'][_0x1a81('0x44')],function(_0x5e7dc2){return{'name':_0x5e7dc2[_0x1a81('0x45')],'type':_0x5e7dc2[_0x1a81('0x46')][_0x1a81('0x47')]};});_0x21e190['model']=_[_0x1a81('0x48')](_0x3b0ddf,_0x1a81('0x40'));_0x21e190['query']=_[_0x1a81('0x49')](_0x5d1fba[_0x1a81('0x4a')]);_0x21e190[_0x1a81('0x4b')]=_[_0x1a81('0x4c')](_0x21e190['model'],_0x21e190[_0x1a81('0x4a')]);_0x2dd1c6[_0x1a81('0x4d')]=_[_0x1a81('0x4c')](_0x21e190[_0x1a81('0x4e')],qs['fields'](_0x5d1fba[_0x1a81('0x4a')][_0x1a81('0x4f')]));_0x2dd1c6[_0x1a81('0x4d')]=_0x2dd1c6[_0x1a81('0x4d')]['length']?_0x2dd1c6[_0x1a81('0x4d')]:_0x21e190[_0x1a81('0x4e')];if(!_0x5d1fba['query'][_0x1a81('0x50')](_0x1a81('0x51'))){_0x2dd1c6[_0x1a81('0x31')]=qs[_0x1a81('0x31')](_0x5d1fba[_0x1a81('0x4a')][_0x1a81('0x31')]);_0x2dd1c6[_0x1a81('0x30')]=qs[_0x1a81('0x30')](_0x5d1fba['query'][_0x1a81('0x30')]);}_0x2dd1c6['order']=qs['sort'](_0x5d1fba[_0x1a81('0x4a')][_0x1a81('0x52')]);_0x2dd1c6[_0x1a81('0x53')]=qs[_0x1a81('0x4b')](_[_0x1a81('0x54')](_0x5d1fba['query'],_0x21e190[_0x1a81('0x4b')]),_0x3b0ddf);if(_0x5d1fba[_0x1a81('0x4a')][_0x1a81('0x55')]){_0x2dd1c6[_0x1a81('0x53')]=_[_0x1a81('0x56')](_0x2dd1c6[_0x1a81('0x53')],{'$or':_[_0x1a81('0x48')](_0x3b0ddf,function(_0x19a45e){if(_0x19a45e[_0x1a81('0x46')]!==_0x1a81('0x57')){var _0x35bcea={};_0x35bcea[_0x19a45e['name']]={'$like':'%'+_0x5d1fba[_0x1a81('0x4a')][_0x1a81('0x55')]+'%'};return _0x35bcea;}})});}_0x2dd1c6=_['merge']({},_0x2dd1c6,_0x5d1fba[_0x1a81('0x58')]);var _0x2460e2={'where':_0x2dd1c6['where']};return db[_0x1a81('0x59')][_0x1a81('0x33')](_0x2460e2)[_0x1a81('0x3a')](function(_0x44a73f){_0x4099bc['count']=_0x44a73f;if(_0x5d1fba[_0x1a81('0x4a')][_0x1a81('0x5a')]){_0x2dd1c6[_0x1a81('0x5b')]=[{'all':!![]}];}return db[_0x1a81('0x59')]['findAll'](_0x2dd1c6);})[_0x1a81('0x3a')](function(_0x22d63f){_0x4099bc[_0x1a81('0x5c')]=_0x22d63f;return _0x4099bc;})[_0x1a81('0x3a')](respondWithFilteredResult(_0x3d808d,_0x2dd1c6))[_0x1a81('0x2b')](handleError(_0x3d808d,null));};exports[_0x1a81('0x5d')]=function(_0x2b56f1,_0x1334ed){var _0x571765={'raw':![],'where':{'id':_0x2b56f1[_0x1a81('0x5e')]['id']},'include':[{'model':db[_0x1a81('0x43')],'as':_0x1a81('0x5f')}]},_0x8069cd={};_0x8069cd[_0x1a81('0x4e')]=_[_0x1a81('0x49')](db[_0x1a81('0x59')][_0x1a81('0x44')]);_0x8069cd[_0x1a81('0x4a')]=_[_0x1a81('0x49')](_0x2b56f1[_0x1a81('0x4a')]);_0x8069cd[_0x1a81('0x4b')]=_[_0x1a81('0x4c')](_0x8069cd[_0x1a81('0x4e')],_0x8069cd['query']);_0x571765[_0x1a81('0x4d')]=_['intersection'](_0x8069cd[_0x1a81('0x4e')],qs[_0x1a81('0x4f')](_0x2b56f1[_0x1a81('0x4a')][_0x1a81('0x4f')]));_0x571765[_0x1a81('0x4d')]=_0x571765[_0x1a81('0x4d')][_0x1a81('0x60')]?_0x571765[_0x1a81('0x4d')]:_0x8069cd[_0x1a81('0x4e')];if(_0x2b56f1[_0x1a81('0x4a')]['includeAll']){_0x571765[_0x1a81('0x5b')]=[{'all':!![]}];}_0x571765=_[_0x1a81('0x56')]({},_0x571765,_0x2b56f1[_0x1a81('0x58')]);return db[_0x1a81('0x59')]['find'](_0x571765)[_0x1a81('0x3a')](handleEntityNotFound(_0x1334ed,null))[_0x1a81('0x3a')](respondWithResult(_0x1334ed,null))[_0x1a81('0x2b')](handleError(_0x1334ed,null));};exports[_0x1a81('0x61')]=function(_0x10cc0b,_0xae9182){return db[_0x1a81('0x59')][_0x1a81('0x61')](_0x10cc0b[_0x1a81('0x62')],{})[_0x1a81('0x3a')](function(_0x4928ca){var _0x34c867=_0x10cc0b['user'][_0x1a81('0x3b')]({'plain':!![]});if(!_0x34c867)throw new Error(_0x1a81('0x63'));if(_0x34c867[_0x1a81('0x64')]===_0x1a81('0x65')){var _0x475d62=_0x4928ca['get']({'plain':!![]});var _0x39a4fb='SmsAccounts';return db[_0x1a81('0x66')][_0x1a81('0x67')]({'where':{'name':_0x39a4fb,'userProfileId':_0x34c867['userProfileId']},'raw':!![]})[_0x1a81('0x3a')](function(_0x5b0acc){if(_0x5b0acc&&_0x5b0acc[_0x1a81('0x68')]===0x0){return db[_0x1a81('0x3d')][_0x1a81('0x61')]({'name':_0x475d62[_0x1a81('0x40')],'resourceId':_0x475d62['id'],'type':_0x5b0acc[_0x1a81('0x40')],'sectionId':_0x5b0acc['id']},{})[_0x1a81('0x3a')](function(){return _0x4928ca;});}else{return _0x4928ca;}})[_0x1a81('0x2b')](function(_0x3f10d5){logger[_0x1a81('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f10d5);throw _0x3f10d5;});}return _0x4928ca;})['then'](respondWithResult(_0xae9182,0xc9))[_0x1a81('0x2b')](handleError(_0xae9182,null));};exports[_0x1a81('0x39')]=function(_0x49285,_0xe59a2d){if(_0x49285['body']['id']){delete _0x49285[_0x1a81('0x62')]['id'];}return db[_0x1a81('0x59')][_0x1a81('0x67')]({'where':{'id':_0x49285[_0x1a81('0x5e')]['id']},'include':[{'model':db[_0x1a81('0x43')],'as':_0x1a81('0x5f')}]})[_0x1a81('0x3a')](handleEntityNotFound(_0xe59a2d,null))[_0x1a81('0x3a')](saveUpdates(_0x49285[_0x1a81('0x62')],null))['then'](respondWithResult(_0xe59a2d,null))[_0x1a81('0x2b')](handleError(_0xe59a2d,null));};exports[_0x1a81('0x3e')]=function(_0x1c547f,_0x2725ca){return db[_0x1a81('0x59')][_0x1a81('0x67')]({'where':{'id':_0x1c547f[_0x1a81('0x5e')]['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0x2725ca,null))[_0x1a81('0x3a')](removeEntity(_0x2725ca,null))['catch'](handleError(_0x2725ca,null));};exports['describe']=function(_0x38ad61,_0x3a13dc){return db['SmsAccount'][_0x1a81('0x69')]()[_0x1a81('0x3a')](respondWithResult(_0x3a13dc,null))[_0x1a81('0x2b')](handleError(_0x3a13dc,null));};exports[_0x1a81('0x6a')]=function(_0xa69b84,_0x373b13,_0x2d0f40){if(_0xa69b84[_0x1a81('0x62')]['id']){delete _0xa69b84[_0x1a81('0x62')]['id'];}return db[_0x1a81('0x59')][_0x1a81('0x67')]({'where':{'id':_0xa69b84['params']['id']}})['then'](handleEntityNotFound(_0x373b13,null))['then'](function(_0x262136){if(_0x262136){_0xa69b84[_0x1a81('0x62')][_0x1a81('0x6b')]=_0x262136['id'];return db['Disposition']['create'](_0xa69b84[_0x1a81('0x62')]);}})[_0x1a81('0x3a')](respondWithResult(_0x373b13,null))[_0x1a81('0x2b')](handleError(_0x373b13,null));};exports['getDispositions']=function(_0x30d2bf,_0x3fc815,_0x4b03d3){var _0x4f0ccc={'raw':![],'where':{}};var _0xe62a96={};var _0x335d1f={'count':0x0,'rows':[]};return db[_0x1a81('0x59')][_0x1a81('0x6c')]({'where':{'id':_0x30d2bf[_0x1a81('0x5e')]['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0x3fc815,null))[_0x1a81('0x3a')](function(_0x1382c8){if(_0x1382c8){_0xe62a96['model']=_[_0x1a81('0x49')](db[_0x1a81('0x6d')]['rawAttributes']);_0xe62a96[_0x1a81('0x4a')]=_[_0x1a81('0x49')](_0x30d2bf['query']);_0xe62a96[_0x1a81('0x4b')]=_['intersection'](_0xe62a96[_0x1a81('0x4e')],_0xe62a96[_0x1a81('0x4a')]);_0x4f0ccc['attributes']=_[_0x1a81('0x4c')](_0xe62a96[_0x1a81('0x4e')],qs[_0x1a81('0x4f')](_0x30d2bf[_0x1a81('0x4a')]['fields']));_0x4f0ccc['attributes']=_0x4f0ccc[_0x1a81('0x4d')][_0x1a81('0x60')]?_0x4f0ccc['attributes']:_0xe62a96[_0x1a81('0x4e')];if(!_0x30d2bf[_0x1a81('0x4a')][_0x1a81('0x50')](_0x1a81('0x51'))){_0x4f0ccc[_0x1a81('0x31')]=qs[_0x1a81('0x31')](_0x30d2bf['query'][_0x1a81('0x31')]);_0x4f0ccc[_0x1a81('0x30')]=qs[_0x1a81('0x30')](_0x30d2bf[_0x1a81('0x4a')][_0x1a81('0x30')]);}_0x4f0ccc[_0x1a81('0x6e')]=qs[_0x1a81('0x52')](_0x30d2bf[_0x1a81('0x4a')][_0x1a81('0x52')]);_0x4f0ccc[_0x1a81('0x53')]=qs[_0x1a81('0x4b')](_[_0x1a81('0x54')](_0x30d2bf[_0x1a81('0x4a')],_0xe62a96[_0x1a81('0x4b')]));_0x4f0ccc['where'][_0x1a81('0x6b')]=_0x1382c8['id'];if(_0x30d2bf[_0x1a81('0x4a')][_0x1a81('0x55')]){_0x4f0ccc[_0x1a81('0x53')]=_['merge'](_0x4f0ccc[_0x1a81('0x53')],{'$or':_['map'](_0x4f0ccc['attributes'],function(_0x2392ea){var _0x58defe={};_0x58defe[_0x2392ea]={'$like':'%'+_0x30d2bf[_0x1a81('0x4a')][_0x1a81('0x55')]+'%'};return _0x58defe;})});}_0x4f0ccc=_[_0x1a81('0x56')]({},_0x4f0ccc,_0x30d2bf['options']);return db[_0x1a81('0x6d')][_0x1a81('0x33')]({'where':_0x4f0ccc[_0x1a81('0x53')]})[_0x1a81('0x3a')](function(_0xd7a2a6){_0x335d1f['count']=_0xd7a2a6;if(_0x30d2bf[_0x1a81('0x4a')][_0x1a81('0x5a')]){_0x4f0ccc[_0x1a81('0x5b')]=[{'all':!![]}];}return db[_0x1a81('0x6d')][_0x1a81('0x6f')](_0x4f0ccc);})[_0x1a81('0x3a')](function(_0x1ae0ce){_0x335d1f[_0x1a81('0x5c')]=_0x1ae0ce;return _0x335d1f;});}})[_0x1a81('0x3a')](respondWithFilteredResult(_0x3fc815,_0x4f0ccc))[_0x1a81('0x2b')](handleError(_0x3fc815,null));};exports[_0x1a81('0x70')]=function(_0x369fa9,_0x1db1bc,_0x26bab7){return db['SmsAccount'][_0x1a81('0x67')]({'where':{'id':_0x369fa9['params']['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0x1db1bc,null))['then'](function(_0x118209){if(_0x118209){return _0x118209[_0x1a81('0x70')](_0x369fa9[_0x1a81('0x4a')][_0x1a81('0x71')]);}})[_0x1a81('0x3a')](respondWithStatusCode(_0x1db1bc,null))['catch'](handleError(_0x1db1bc,null));};exports[_0x1a81('0x72')]=function(_0x4c29fa,_0x50f7f1,_0x2a6588){if(_0x4c29fa['body']['id']){delete _0x4c29fa[_0x1a81('0x62')]['id'];}return db[_0x1a81('0x59')][_0x1a81('0x67')]({'where':{'id':_0x4c29fa[_0x1a81('0x5e')]['id']}})['then'](handleEntityNotFound(_0x50f7f1,null))[_0x1a81('0x3a')](function(_0xd506fd){if(_0xd506fd){_0x4c29fa[_0x1a81('0x62')][_0x1a81('0x6b')]=_0xd506fd['id'];return db[_0x1a81('0x73')][_0x1a81('0x61')](_0x4c29fa[_0x1a81('0x62')]);}})['then'](respondWithResult(_0x50f7f1,null))[_0x1a81('0x2b')](handleError(_0x50f7f1,null));};exports[_0x1a81('0x74')]=function(_0x3e5aff,_0x58a662,_0x2c7886){var _0x17f457={'raw':![],'where':{}};var _0x5da61f={};var _0x914219={'count':0x0,'rows':[]};return db[_0x1a81('0x59')][_0x1a81('0x6c')]({'where':{'id':_0x3e5aff[_0x1a81('0x5e')]['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0x58a662,null))[_0x1a81('0x3a')](function(_0x520c8b){if(_0x520c8b){_0x5da61f['model']=_[_0x1a81('0x49')](db[_0x1a81('0x73')][_0x1a81('0x44')]);_0x5da61f[_0x1a81('0x4a')]=_['keys'](_0x3e5aff['query']);_0x5da61f[_0x1a81('0x4b')]=_[_0x1a81('0x4c')](_0x5da61f[_0x1a81('0x4e')],_0x5da61f[_0x1a81('0x4a')]);_0x17f457[_0x1a81('0x4d')]=_[_0x1a81('0x4c')](_0x5da61f[_0x1a81('0x4e')],qs[_0x1a81('0x4f')](_0x3e5aff['query'][_0x1a81('0x4f')]));_0x17f457[_0x1a81('0x4d')]=_0x17f457[_0x1a81('0x4d')][_0x1a81('0x60')]?_0x17f457[_0x1a81('0x4d')]:_0x5da61f[_0x1a81('0x4e')];if(!_0x3e5aff['query']['hasOwnProperty']('nolimit')){_0x17f457['limit']=qs[_0x1a81('0x31')](_0x3e5aff[_0x1a81('0x4a')]['limit']);_0x17f457[_0x1a81('0x30')]=qs[_0x1a81('0x30')](_0x3e5aff['query']['offset']);}_0x17f457['order']=qs['sort'](_0x3e5aff[_0x1a81('0x4a')][_0x1a81('0x52')]);_0x17f457[_0x1a81('0x53')]=qs[_0x1a81('0x4b')](_[_0x1a81('0x54')](_0x3e5aff[_0x1a81('0x4a')],_0x5da61f[_0x1a81('0x4b')]));_0x17f457['where'][_0x1a81('0x6b')]=_0x520c8b['id'];if(_0x3e5aff[_0x1a81('0x4a')][_0x1a81('0x55')]){_0x17f457[_0x1a81('0x53')]=_[_0x1a81('0x56')](_0x17f457['where'],{'$or':_[_0x1a81('0x48')](_0x17f457['attributes'],function(_0x143c15){var _0xc014f1={};_0xc014f1[_0x143c15]={'$like':'%'+_0x3e5aff['query']['filter']+'%'};return _0xc014f1;})});}_0x17f457=_[_0x1a81('0x56')]({},_0x17f457,_0x3e5aff[_0x1a81('0x58')]);return db['CannedAnswer'][_0x1a81('0x33')]({'where':_0x17f457[_0x1a81('0x53')]})['then'](function(_0x279b9b){_0x914219[_0x1a81('0x33')]=_0x279b9b;if(_0x3e5aff[_0x1a81('0x4a')][_0x1a81('0x5a')]){_0x17f457[_0x1a81('0x5b')]=[{'all':!![]}];}return db[_0x1a81('0x73')][_0x1a81('0x6f')](_0x17f457);})[_0x1a81('0x3a')](function(_0x49398d){_0x914219[_0x1a81('0x5c')]=_0x49398d;return _0x914219;});}})[_0x1a81('0x3a')](respondWithFilteredResult(_0x58a662,_0x17f457))[_0x1a81('0x2b')](handleError(_0x58a662,null));};exports[_0x1a81('0x75')]=function(_0x56bfa5,_0x4af9c8,_0x21227c){return db[_0x1a81('0x59')][_0x1a81('0x67')]({'where':{'id':_0x56bfa5[_0x1a81('0x5e')]['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0x4af9c8,null))[_0x1a81('0x3a')](function(_0x5ace33){if(_0x5ace33){return _0x5ace33[_0x1a81('0x75')](_0x56bfa5[_0x1a81('0x4a')][_0x1a81('0x71')]);}})['then'](respondWithStatusCode(_0x4af9c8,null))[_0x1a81('0x2b')](handleError(_0x4af9c8,null));};exports[_0x1a81('0x76')]=function(_0x13e3e4,_0x5c865d,_0x24178f){var _0x3b6d01={'channel':_0x1a81('0x77')};var _0x2e2b0b=[];var _0x517c22=[];var _0x5d5568={};return db[_0x1a81('0x59')][_0x1a81('0x67')]({'where':{'id':_0x13e3e4[_0x1a81('0x5e')]['id']},'include':[{'model':db[_0x1a81('0x78')],'as':_0x1a81('0x79')}]})[_0x1a81('0x3a')](handleEntityNotFound(_0x5c865d,null))['then'](function(_0x1ed22){_0x3b6d01[_0x1a81('0x7a')]=_0x1ed22;_0x3b6d01['applications']=_[_0x1a81('0x7b')](_0x1ed22[_0x1a81('0x79')],[_0x1a81('0x7c')],[_0x1a81('0x7d')]);if(_0x3b6d01[_0x1a81('0x7a')][_0x1a81('0x79')]){delete _0x3b6d01[_0x1a81('0x7a')]['Applications'];}return db['CmContact'][_0x1a81('0x69')]();})[_0x1a81('0x3a')](function(_0x392afb){if(!_0x392afb){throw new db[(_0x1a81('0x7e'))][(_0x1a81('0x7f'))](_0x1a81('0x80'));}_0x2e2b0b=_[_0x1a81('0x81')](_[_0x1a81('0x49')](_0x392afb),[_0x1a81('0x82'),_0x1a81('0x83')]);_0x517c22=_[_0x1a81('0x81')](_['keys'](_0x392afb),[_0x1a81('0x82'),_0x1a81('0x83'),'CompanyId',_0x1a81('0x84')]);_0x3b6d01[_0x1a81('0x62')]={'mapKey':_0x1a81('0x85')};if(_0x3b6d01[_0x1a81('0x7a')][_0x1a81('0x46')]){switch(_0x3b6d01[_0x1a81('0x7a')][_0x1a81('0x46')]){case _0x1a81('0x86'):_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')]=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x88')];_0x3b6d01['body'][_0x1a81('0x62')]=_0x13e3e4[_0x1a81('0x62')]['Body'];_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x89')]=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x8a')];break;case _0x1a81('0x8b'):_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')]='+'+_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x8c')];_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x62')]=_0x13e3e4['body'][_0x1a81('0x8d')];break;case _0x1a81('0x8e'):_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')]=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x87')];_0x3b6d01[_0x1a81('0x62')]['body']=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x29')];break;case _0x1a81('0x8f'):_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')]=_0x13e3e4['body']['from'];_0x3b6d01['body'][_0x1a81('0x62')]=_0x13e3e4[_0x1a81('0x62')]['body'];_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x89')]=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x90')];break;case _0x1a81('0x91'):_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')]=_0x13e3e4['body']['From'];_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x62')]=_0x13e3e4[_0x1a81('0x62')]['Text'];_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x89')]=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x92')];break;case _0x1a81('0x93'):_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')]='+'+_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x94')][0x0][_0x1a81('0x87')];_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x62')]=_0x13e3e4['body']['results'][0x0][_0x1a81('0x8d')];_0x3b6d01['body'][_0x1a81('0x89')]=_0x13e3e4[_0x1a81('0x62')]['results'][0x0][_0x1a81('0x89')];break;case _0x1a81('0x95'):_0x3b6d01['body']['from']=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x96')];_0x3b6d01[_0x1a81('0x62')]['body']=_0x13e3e4['body'][_0x1a81('0x97')]['message'];break;case _0x1a81('0x98'):_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')]=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x99')];_0x3b6d01[_0x1a81('0x62')]['body']=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x8d')];_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x89')]=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x9a')];break;case _0x1a81('0x9b'):_0x3b6d01[_0x1a81('0x62')]['messageId']=_0x13e3e4[_0x1a81('0x62')][0x0][_0x1a81('0x29')]['id'];_0x3b6d01['body'][_0x1a81('0x87')]=_0x13e3e4['body'][0x0][_0x1a81('0x29')][_0x1a81('0x87')];_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x62')]=_0x13e3e4[_0x1a81('0x62')][0x0][_0x1a81('0x29')][_0x1a81('0x8d')];break;case _0x1a81('0x9c'):_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')]=_0x13e3e4[_0x1a81('0x62')]['from'];_0x3b6d01['body'][_0x1a81('0x62')]=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x29')];_0x3b6d01['body'][_0x1a81('0x89')]=_0x13e3e4[_0x1a81('0x62')][_0x1a81('0x9d')];break;}}if(_0x3b6d01[_0x1a81('0x62')]['id']){delete _0x3b6d01['body']['id'];}if(_['isNil'](_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')])){throw new db[(_0x1a81('0x7e'))]['ValidationError'](_0x1a81('0x9e'));}if(_[_0x1a81('0x9f')](_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x62')])||_0x3b6d01['body'][_0x1a81('0x62')]===''){throw new db[(_0x1a81('0x7e'))][(_0x1a81('0x7f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x3b6d01['body']['mapKey'])){throw new db[(_0x1a81('0x7e'))][(_0x1a81('0x7f'))](_0x1a81('0xa0')+_0x517c22);}if(!_[_0x1a81('0xa1')](_0x517c22,_0x3b6d01[_0x1a81('0x62')]['mapKey'])){throw new db[(_0x1a81('0x7e'))][(_0x1a81('0x7f'))](_0x1a81('0xa2')+_0x517c22);}_0x5d5568[_0x3b6d01[_0x1a81('0x62')][_0x1a81('0xa3')]]=_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')];return db[_0x1a81('0xa4')]['find']({'where':{'id':_0x3b6d01[_0x1a81('0x7a')][_0x1a81('0x84')]},'include':[{'model':db[_0x1a81('0xa5')],'as':_0x1a81('0xa6'),'where':_0x5d5568,'limit':0x1,'order':[[_0x1a81('0x83'),'DESC']]}]});})[_0x1a81('0x3a')](handleEntityNotFound(_0x5c865d,null))[_0x1a81('0x3a')](function(_0x4b4030){if(_0x4b4030){_0x3b6d01[_0x1a81('0xa7')]=_[_0x1a81('0xa8')](_0x4b4030,[_0x1a81('0xa6')]);if(_0x4b4030[_0x1a81('0xa6')]['length']){return _0x4b4030[_0x1a81('0xa6')][0x0];}var _0x373948=_['defaults'](_0x3b6d01[_0x1a81('0x62')],{'firstName':_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')],'ListId':_0x4b4030['id']});_0x373948[_0x3b6d01[_0x1a81('0x62')][_0x1a81('0xa3')]]=_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')];return db[_0x1a81('0xa5')][_0x1a81('0x61')](_0x373948,{'fields':_0x2e2b0b,'raw':!![]});}})[_0x1a81('0x3a')](handleEntityNotFound(_0x5c865d,null))[_0x1a81('0x3a')](function(_0xf296c8){if(_0xf296c8){_0x3b6d01[_0x1a81('0xa9')]=_0xf296c8;var _0x3c54e9={'ContactId':_0xf296c8['id'],'phone':_0x3b6d01[_0x1a81('0x62')]['from'],'SmsAccountId':_0x13e3e4[_0x1a81('0x5e')]['id']};var _0x4e304a={'ContactId':_0xf296c8['id'],'SmsAccountId':_0x13e3e4[_0x1a81('0x5e')]['id'],'closed':![]};return db[_0x1a81('0xaa')][_0x1a81('0x67')]({'where':_0x4e304a})[_0x1a81('0x3a')](function(_0x2df5e0){if(_0x2df5e0){return[_0x2df5e0,![]];}return db[_0x1a81('0xaa')][_0x1a81('0x61')](_0x3c54e9)[_0x1a81('0x3a')](function(_0x283102){return[_0x283102,!![]];});});}})[_0x1a81('0xab')](function(_0x2078c2,_0x2e9321){_0x3b6d01['interaction']=_0x2078c2[_0x1a81('0x3b')]({'plain':!![]});_0x3b6d01[_0x1a81('0xac')][_0x1a81('0xad')]=![];if(_0x2e9321){if(_0x3b6d01[_0x1a81('0x7a')][_0x1a81('0xae')]){_0x3b6d01['applications'][_0x1a81('0xaf')]({'id':0x0,'priority':_0x3b6d01[_0x1a81('0xb0')]['length']+0x1,'app':_0x1a81('0xb1'),'appdata':_0x1a81('0xb2'),'interval':_0x1a81('0xb3')});}_0x3b6d01[_0x1a81('0xac')][_0x1a81('0xad')]=!![];}return db[_0x1a81('0xb4')][_0x1a81('0x61')]({'phone':_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x87')],'messageId':_0x3b6d01['body'][_0x1a81('0x89')],'body':_0x3b6d01[_0x1a81('0x62')][_0x1a81('0x62')],'SmsAccountId':_0x13e3e4[_0x1a81('0x5e')]['id'],'SmsInteractionId':_0x2078c2['id'],'direction':'in','ContactId':_0x2078c2[_0x1a81('0xb5')],'AttachmentId':_0x3b6d01[_0x1a81('0x62')][_0x1a81('0xb6')]});})['then'](function(_0x58ef97){_0x3b6d01[_0x1a81('0x29')]=_0x58ef97;if(_0x3b6d01[_0x1a81('0xac')]['UserId']){return db['User'][_0x1a81('0x67')]({'attributes':['id','name'],'where':{'id':_0x3b6d01[_0x1a81('0xac')][_0x1a81('0xb7')]}})[_0x1a81('0x3a')](function(_0x4e36ee){if(_0x4e36ee){_0x3b6d01[_0x1a81('0xb0')][_0x1a81('0xb8')]({'id':0x0,'priority':0x0,'app':_0x1a81('0xb9'),'appdata':_0x4e36ee[_0x1a81('0x40')]+','+(_0x3b6d01[_0x1a81('0x7a')][_0x1a81('0xba')]||0xa),'interval':_0x1a81('0xb3')});}return respondWithRpcPromise('Start',_0x1a81('0xbb'),_0x3b6d01);});}return respondWithRpcPromise(_0x1a81('0xbc'),_0x1a81('0xbb'),_0x3b6d01);})[_0x1a81('0x3a')](function(_0x115713){if(_0x115713){var _0x1d0562=0xc8;var _0x1daaa1=_0x1a81('0xbd');logger[_0x1a81('0x23')](_0x1a81('0xbe'),_0x1daaa1,_0x1d0562,'entity\x20found');logger[_0x1a81('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x1daaa1,_0x1d0562,_0x1a81('0xbf'),JSON[_0x1a81('0x26')](_0x115713));if(_0x3b6d01[_0x1a81('0x7a')]['type']===_0x1a81('0x86')){return _0x5c865d[_0x1a81('0x2d')](_0x1d0562)[_0x1a81('0x34')](_0x1a81('0xc0'),'text/xml')['send'](_0x1a81('0xc1'));}else{return _0x5c865d[_0x1a81('0x2d')](_0x1d0562)[_0x1a81('0x2f')](_0x115713);}}})['catch'](handleError(_0x5c865d,null));};exports[_0x1a81('0xc2')]=function(_0x2dd037,_0x5e0708){var _0x18cd07=_0x2dd037['params']['id'];var _0x2568a6=_0x2dd037['body'];var _0x148b03=0xc8;var _0x1e57fb=null;return db[_0x1a81('0xc3')][_0x1a81('0xc4')]({'isolationLevel':db['sequelize'][_0x1a81('0xc5')][_0x1a81('0xc6')][_0x1a81('0xc7')]},function(_0x4a6d2f){return db[_0x1a81('0x59')][_0x1a81('0x6c')]({'where':{'id':_0x18cd07},'transaction':_0x4a6d2f})[_0x1a81('0x3a')](function(_0x5e1684){if(_0x5e1684){return db[_0x1a81('0x78')]['destroy']({'where':{'SmsAccountId':_0x18cd07},'transaction':_0x4a6d2f})[_0x1a81('0x3a')](function(){var _0x662d70=_[_0x1a81('0x48')](_0x2568a6,function(_0x5430fb){_0x5430fb[_0x1a81('0x6b')]=_0x18cd07;return _0x5430fb;});return db[_0x1a81('0x78')][_0x1a81('0xc8')](_0x662d70,{'transaction':_0x4a6d2f});});}else{_0x148b03=0x194;_0x1e57fb=[];}});})[_0x1a81('0x3a')](function(){if(_0x148b03!==0x194){return db[_0x1a81('0x78')]['findAndCountAll']({'where':{'SmsAccountId':_0x18cd07},'order':_0x1a81('0x7c')})[_0x1a81('0x3a')](function(_0x48f658){_0x1e57fb=_0x48f658;});}})[_0x1a81('0x2b')](function(_0x3a80d2){_0x148b03=0x1f4;logger[_0x1a81('0x27')](_0x3a80d2[_0x1a81('0x3f')]);if(_0x3a80d2[_0x1a81('0x40')]){delete _0x3a80d2[_0x1a81('0x40')];}_0x1e57fb=_0x3a80d2;})['finally'](function(){if(_0x1e57fb===null){_0x5e0708[_0x1a81('0x2c')](_0x148b03);}else{if(_0x148b03===0x1f4){_0x5e0708['status'](_0x148b03)[_0x1a81('0x41')](_0x1e57fb);}else{_0x5e0708[_0x1a81('0x2d')](_0x148b03)[_0x1a81('0x2f')](_0x1e57fb);}}});};exports[_0x1a81('0xc9')]=function(_0x4e27f7,_0x4743e2,_0x55efe8){var _0x2b155e={};var _0x3a765d={};var _0xa18c13;var _0x3e411d;return db[_0x1a81('0x59')][_0x1a81('0x6c')]({'where':{'id':_0x4e27f7['params']['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0x4743e2,null))['then'](function(_0x1e0997){if(_0x1e0997){_0xa18c13=_0x1e0997;_0x3a765d['model']=_[_0x1a81('0x49')](db[_0x1a81('0x78')]['rawAttributes']);_0x3a765d[_0x1a81('0x4a')]=_[_0x1a81('0x49')](_0x4e27f7[_0x1a81('0x4a')]);_0x3a765d[_0x1a81('0x4b')]=_['intersection'](_0x3a765d[_0x1a81('0x4e')],_0x3a765d['query']);_0x2b155e['attributes']=_[_0x1a81('0x4c')](_0x3a765d[_0x1a81('0x4e')],qs[_0x1a81('0x4f')](_0x4e27f7[_0x1a81('0x4a')]['fields']));_0x2b155e['attributes']=_0x2b155e[_0x1a81('0x4d')][_0x1a81('0x60')]?_0x2b155e[_0x1a81('0x4d')]:_0x3a765d[_0x1a81('0x4e')];_0x2b155e[_0x1a81('0x6e')]=qs[_0x1a81('0x52')](_0x4e27f7[_0x1a81('0x4a')][_0x1a81('0x52')]);_0x2b155e[_0x1a81('0x53')]=qs['filters'](_[_0x1a81('0x54')](_0x4e27f7[_0x1a81('0x4a')],_0x3a765d[_0x1a81('0x4b')]));if(_0x4e27f7[_0x1a81('0x4a')][_0x1a81('0x55')]){_0x2b155e['where']=_[_0x1a81('0x56')](_0x2b155e['where'],{'$or':_[_0x1a81('0x48')](_0x2b155e[_0x1a81('0x4d')],function(_0x143d8b){var _0x22b55d={};_0x22b55d[_0x143d8b]={'$like':'%'+_0x4e27f7['query'][_0x1a81('0x55')]+'%'};return _0x22b55d;})});}_0x2b155e=_[_0x1a81('0x56')]({},_0x2b155e,_0x4e27f7[_0x1a81('0x58')]);return _0xa18c13[_0x1a81('0xc9')](_0x2b155e);}})[_0x1a81('0x3a')](function(_0x585e15){if(_0x585e15){_0x3e411d=_0x585e15['length'];if(!_0x4e27f7[_0x1a81('0x4a')][_0x1a81('0x50')](_0x1a81('0x51'))){_0x2b155e[_0x1a81('0x31')]=qs[_0x1a81('0x31')](_0x4e27f7[_0x1a81('0x4a')][_0x1a81('0x31')]);_0x2b155e[_0x1a81('0x30')]=qs['offset'](_0x4e27f7[_0x1a81('0x4a')][_0x1a81('0x30')]);}return _0xa18c13[_0x1a81('0xc9')](_0x2b155e);}})['then'](function(_0x5a0954){if(_0x5a0954){return _0x5a0954?{'count':_0x3e411d,'rows':_0x5a0954}:null;}})['then'](respondWithResult(_0x4743e2,null))['catch'](handleError(_0x4743e2,null));};exports[_0x1a81('0xca')]=function(_0x2993d6,_0x2128e8,_0x42e901){var _0xc00599={'raw':![],'where':{}};var _0x2827d7={};var _0x31e98c={'count':0x0,'rows':[]};return db[_0x1a81('0x59')][_0x1a81('0x6c')]({'where':{'id':_0x2993d6['params']['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0x2128e8,null))[_0x1a81('0x3a')](function(_0x17828c){if(_0x17828c){_0x2827d7[_0x1a81('0x4e')]=_[_0x1a81('0x49')](db['SmsInteraction'][_0x1a81('0x44')]);_0x2827d7['query']=_[_0x1a81('0x49')](_0x2993d6[_0x1a81('0x4a')]);_0x2827d7[_0x1a81('0x4b')]=_[_0x1a81('0x4c')](_0x2827d7['model'],_0x2827d7[_0x1a81('0x4a')]);_0xc00599[_0x1a81('0x4d')]=_[_0x1a81('0x4c')](_0x2827d7[_0x1a81('0x4e')],qs[_0x1a81('0x4f')](_0x2993d6[_0x1a81('0x4a')][_0x1a81('0x4f')]));_0xc00599[_0x1a81('0x4d')]=_0xc00599['attributes']['length']?_0xc00599[_0x1a81('0x4d')]:_0x2827d7[_0x1a81('0x4e')];if(!_0x2993d6[_0x1a81('0x4a')][_0x1a81('0x50')](_0x1a81('0x51'))){_0xc00599[_0x1a81('0x31')]=qs[_0x1a81('0x31')](_0x2993d6[_0x1a81('0x4a')][_0x1a81('0x31')]);_0xc00599['offset']=qs[_0x1a81('0x30')](_0x2993d6[_0x1a81('0x4a')][_0x1a81('0x30')]);}_0xc00599[_0x1a81('0x6e')]=qs[_0x1a81('0x52')](_0x2993d6[_0x1a81('0x4a')]['sort']);_0xc00599[_0x1a81('0x53')]=qs[_0x1a81('0x4b')](_['pick'](_0x2993d6[_0x1a81('0x4a')],_0x2827d7[_0x1a81('0x4b')]));_0xc00599[_0x1a81('0x53')][_0x1a81('0x6b')]=_0x17828c['id'];if(_0x2993d6[_0x1a81('0x4a')][_0x1a81('0x55')]){_0xc00599['where']=_[_0x1a81('0x56')](_0xc00599[_0x1a81('0x53')],{'$or':_[_0x1a81('0x48')](_0xc00599[_0x1a81('0x4d')],function(_0x435b37){var _0x3e6c22={};_0x3e6c22[_0x435b37]={'$like':'%'+_0x2993d6[_0x1a81('0x4a')]['filter']+'%'};return _0x3e6c22;})});}_0xc00599=_[_0x1a81('0x56')]({},_0xc00599,_0x2993d6['options']);return db[_0x1a81('0xaa')][_0x1a81('0x33')]({'where':_0xc00599[_0x1a81('0x53')]})['then'](function(_0x5e254c){_0x31e98c[_0x1a81('0x33')]=_0x5e254c;if(_0x2993d6['query'][_0x1a81('0x5a')]){_0xc00599[_0x1a81('0x5b')]=[{'model':db[_0x1a81('0xa5')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x1a81('0xcb'),_0x1a81('0xcc')],'required':![]},{'model':db[_0x1a81('0xcd')],'as':'Tags','attributes':['id','name',_0x1a81('0xce')],'where':_0x2993d6[_0x1a81('0x4a')][_0x1a81('0xcf')]?{'id':_0x2993d6['query']['tag']}:undefined,'required':_0x2993d6['query']['tag']?!![]:![]}];}return db['SmsInteraction'][_0x1a81('0x6f')](_0xc00599);})[_0x1a81('0x3a')](function(_0x50420a){_0x31e98c[_0x1a81('0x5c')]=_0x50420a;return _0x31e98c;});}})[_0x1a81('0x3a')](respondWithFilteredResult(_0x2128e8,_0xc00599))['catch'](handleError(_0x2128e8,null));};exports[_0x1a81('0x41')]=function(_0x4eebff,_0x16ee48,_0x4ec1eb){var _0x43234e,_0x4119f3,_0x385738;if(_['isNil'](_0x4eebff[_0x1a81('0x62')][_0x1a81('0x62')])||_0x4eebff[_0x1a81('0x62')][_0x1a81('0x62')]===''){throw new db[(_0x1a81('0x7e'))][(_0x1a81('0x7f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x1a81('0x9f')](_0x4eebff[_0x1a81('0x62')]['to'])){throw new db['Sequelize']['ValidationError'](_0x1a81('0xd0'));}_0x43234e=_0x4eebff[_0x1a81('0x62')]['to'];return db[_0x1a81('0x59')][_0x1a81('0x67')]({'where':{'id':_0x4eebff[_0x1a81('0x5e')]['id']},'include':[{'model':db['CmList'],'as':_0x1a81('0xd1'),'include':[{'model':db[_0x1a81('0xa5')],'as':_0x1a81('0xa6'),'where':{'mobile':_0x43234e},'limit':0x1,'order':[[_0x1a81('0x83'),_0x1a81('0xd2')]]}]}]})['then'](handleEntityNotFound(_0x16ee48,null))['then'](function(_0x598afc){if(_0x598afc&&_0x598afc[_0x1a81('0xd1')]){_0x4119f3=_0x598afc[_0x1a81('0x3b')]({'plain':!![]});if(_0x4119f3[_0x1a81('0xd1')]&&_0x4119f3[_0x1a81('0xd1')][_0x1a81('0xa6')][_0x1a81('0x60')]){return _0x4119f3[_0x1a81('0xd1')]['Contacts'][0x0];}return db['CmContact'][_0x1a81('0x61')](_['defaults'](_0x4eebff['body'],{'firstName':_0x43234e,'mobile':_0x43234e,'phone':_0x43234e,'ListId':_0x4119f3['ListId']}));}})[_0x1a81('0x3a')](handleEntityNotFound(_0x16ee48,null))['then'](function(_0x4b219b){if(_0x4b219b){_0x385738=_0x4b219b;return db['SmsInteraction'][_0x1a81('0x67')]({'where':{'ContactId':_0x385738['id'],'closed':![],'SmsAccountId':_0x4119f3['id']}})[_0x1a81('0x3a')](function(_0x2c5b24){if(_0x2c5b24){return[_0x2c5b24,![]];}return db[_0x1a81('0xaa')][_0x1a81('0x61')]({'UserId':_0x4eebff[_0x1a81('0x65')]['id'],'ContactId':_0x385738['id'],'SmsAccountId':_0x4119f3['id'],'phone':_0x43234e,'firstMsgDirection':_0x1a81('0xd3'),'Messages':[_['merge'](_0x4eebff[_0x1a81('0x62')],{'read':![],'body':_0x4eebff['body'][_0x1a81('0x62')],'phone':_0x43234e,'SmsAccountId':_0x4119f3['id'],'UserId':_0x4eebff[_0x1a81('0x65')]['id'],'ContactId':_0x385738['id']})]},{'include':[{'model':db[_0x1a81('0xb4')],'as':_0x1a81('0xd4')}]})[_0x1a81('0x3a')](function(_0x43472b){return[_0x43472b,!![]];});});}})[_0x1a81('0xab')](function(_0x54a530,_0x34541c){if(_0x34541c){return _0x54a530;}return db['SmsMessage'][_0x1a81('0x61')](_[_0x1a81('0x56')](_0x4eebff[_0x1a81('0x62')],{'read':![],'body':_0x4eebff[_0x1a81('0x62')]['body'],'phone':_0x43234e,'SmsAccountId':_0x4119f3['id'],'SmsInteractionId':_0x54a530['id'],'UserId':_0x4eebff[_0x1a81('0x65')]['id'],'ContactId':_0x385738['id']}))[_0x1a81('0x3a')](function(_0x1ef30c){_0x54a530[_0x1a81('0xd5')][_0x1a81('0xd4')]=[];_0x54a530[_0x1a81('0xd5')][_0x1a81('0xd4')][_0x1a81('0xaf')](_0x1ef30c[_0x1a81('0xd5')]);return _0x54a530;});})['then'](respondWithResult(_0x16ee48,null))[_0x1a81('0x2b')](handleError(_0x16ee48,null));};exports[_0x1a81('0x2d')]=function(_0x265e13,_0x1fc0ad,_0xf74873){if(_0x265e13[_0x1a81('0x62')]['id']){delete _0x265e13['body']['id'];}var _0x24cd27,_0x560cef,_0x2a5a9b;return db[_0x1a81('0x59')]['find']({'where':{'id':_0x265e13[_0x1a81('0x5e')]['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0x1fc0ad,null))[_0x1a81('0x3a')](function(_0x24da51){if(_0x24da51){_0x2a5a9b=_0x24da51;logger['debug'](_0x1a81('0xbe'),_0x1a81('0x2d'),_0x1a81('0xd6'),_0x24da51[_0x1a81('0x46')],util['inspect'](_0x265e13[_0x1a81('0x62')],{'showHidden':![],'depth':null}));switch(_0x24da51[_0x1a81('0x46')]){case'skebby':if(_0x265e13['body'][_0x1a81('0xd7')]&&_0x265e13[_0x1a81('0x62')][_0x1a81('0x2d')]){_0x560cef=_0x265e13['body'][_0x1a81('0x2d')];return db[_0x1a81('0xb4')][_0x1a81('0x67')]({'where':{'messageId':_0x265e13['body'][_0x1a81('0xd7')]}});}break;case _0x1a81('0x8e'):if(_0x265e13[_0x1a81('0x62')][_0x1a81('0xd8')]&&_0x265e13[_0x1a81('0x62')][_0x1a81('0xd9')]){_0x560cef=_0x265e13[_0x1a81('0x62')][_0x1a81('0xd9')];return db[_0x1a81('0xb4')]['find']({'where':{'messageId':_0x265e13['body'][_0x1a81('0xd8')]}});}break;case _0x1a81('0x8f'):if(_0x265e13['body']['message_id']&&_0x265e13['body'][_0x1a81('0xda')]){_0x560cef=_0x265e13[_0x1a81('0x62')]['status_code'];return db[_0x1a81('0xb4')][_0x1a81('0x67')]({'where':{'messageId':_0x265e13['body']['message_id']}});}break;case'infobip':var _0x4baacd=_0x265e13[_0x1a81('0x62')]['results'][0x0];if(_0x4baacd[_0x1a81('0x89')]&&_0x4baacd[_0x1a81('0x2d')][_0x1a81('0xdb')]==='DELIVERED'){_0x560cef=_0x4baacd[_0x1a81('0x2d')][_0x1a81('0xdb')];return db[_0x1a81('0xb4')][_0x1a81('0x67')]({'where':{'messageId':_0x4baacd['messageId']}});}break;case _0x1a81('0x98'):if(_0x265e13[_0x1a81('0x62')][_0x1a81('0x89')]&&_0x265e13['body'][_0x1a81('0x2d')]){_0x560cef=_0x265e13[_0x1a81('0x62')][_0x1a81('0x2d')];return db[_0x1a81('0xb4')]['find']({'where':{'messageId':_0x265e13[_0x1a81('0x62')][_0x1a81('0x89')]}});}break;case'bandwidth':if(_0x265e13[_0x1a81('0x62')][0x0][_0x1a81('0x29')]['id']){_0x560cef=_0x265e13[_0x1a81('0x62')][0x0][_0x1a81('0x46')];return db[_0x1a81('0xb4')][_0x1a81('0x67')]({'where':{'messageId':_0x265e13['body'][0x0][_0x1a81('0x29')]['id']}});}break;case _0x1a81('0x9c'):if(_0x265e13[_0x1a81('0x62')][_0x1a81('0xdc')]&&_0x265e13[_0x1a81('0x62')]['status']){_0x560cef=_0x265e13[_0x1a81('0x62')]['status'];return db['SmsMessage'][_0x1a81('0x67')]({'where':{'messageId':_0x265e13['body']['redif']}});}break;}}})[_0x1a81('0x3a')](handleEntityNotFound(_0x1fc0ad,null))['then'](function(_0x34c56f){if(_0x34c56f){_0x24cd27=_0x34c56f;switch(_0x2a5a9b[_0x1a81('0x46')]){case'skebby':if(_0x560cef===_0x1a81('0xdd')){return _0x24cd27['update']({'read':!![]});}else{logger[_0x1a81('0x27')](_0x1a81('0xbe'),_0x1a81('0x2d'),'skebby',util['inspect'](_0x265e13['body'],{'showHidden':![],'depth':null}));}break;case _0x1a81('0x8e'):if(_0x560cef==='1'){return _0x24cd27[_0x1a81('0x39')]({'read':!![]});}else{logger[_0x1a81('0x27')](_0x1a81('0xbe'),'status',_0x1a81('0x8b'),util[_0x1a81('0xde')](_0x265e13[_0x1a81('0x62')],{'showHidden':![],'depth':null}));}break;case _0x1a81('0x8f'):if(!_0x265e13['body']['error_code']&&_0x560cef>=0xc8&&_0x560cef<=0xce){return _0x24cd27[_0x1a81('0x39')]({'read':!![]});}else{logger[_0x1a81('0x27')](_0x1a81('0xbe'),_0x1a81('0x2d'),'clicksend',util[_0x1a81('0xde')](_0x265e13['body'],{'showHidden':![],'depth':null}));}break;case _0x1a81('0x93'):var _0x5637a8=_0x265e13[_0x1a81('0x62')][_0x1a81('0x94')][0x0];if(_0x5637a8['status'][_0x1a81('0xdb')]===_0x1a81('0xdd')){return _0x24cd27[_0x1a81('0x39')]({'read':!![]});}else{logger[_0x1a81('0x27')](_0x1a81('0xbe'),_0x1a81('0x2d'),_0x1a81('0x93'),util['inspect'](_0x265e13[_0x1a81('0x62')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x560cef==_0x1a81('0xdf')||_0x560cef=='RECEIVED_BY_RECIPIENT'){return _0x24cd27[_0x1a81('0x39')]({'read':!![]});}else{logger[_0x1a81('0x27')](_0x1a81('0xbe'),_0x1a81('0x2d'),_0x1a81('0x98'),util['inspect'](_0x265e13[_0x1a81('0x62')],{'showHidden':![],'depth':null}));}break;case _0x1a81('0x9b'):if(_0x560cef=='message-delivered'){return _0x24cd27[_0x1a81('0x39')]({'read':!![]});}else{logger[_0x1a81('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1a81('0x2d'),_0x1a81('0x9b'),util[_0x1a81('0xde')](_0x265e13[_0x1a81('0x62')],{'showHidden':![],'depth':null}));}break;case _0x1a81('0x9c'):if(_0x560cef===_0x1a81('0xe0')||_0x560cef==='ACCEPTD'){return _0x24cd27[_0x1a81('0x39')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x1a81('0x9c'),util[_0x1a81('0xde')](_0x265e13[_0x1a81('0x62')],{'showHidden':![],'depth':null}));}break;}return _0x24cd27;}})[_0x1a81('0x3a')](respondWithResult(_0x1fc0ad,null))[_0x1a81('0x2b')](handleError(_0x1fc0ad,null));};exports['statusGet']=function(_0x342715,_0x5735f9,_0x5d6e2b){var _0x1c8e3d,_0x3e9d80,_0x4ddb8b;return db[_0x1a81('0x59')]['find']({'where':{'id':_0x342715[_0x1a81('0x5e')]['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0x5735f9,null))['then'](function(_0x467a9e){if(_0x467a9e){_0x4ddb8b=_0x467a9e;logger[_0x1a81('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1a81('0x2d'),_0x1a81('0xd6'),_0x467a9e['type'],util[_0x1a81('0xde')](_0x342715[_0x1a81('0x4a')],{'showHidden':![],'depth':null}));switch(_0x467a9e[_0x1a81('0x46')]){case'csc':if(_0x342715[_0x1a81('0x4a')][_0x1a81('0xe1')]&&_0x342715[_0x1a81('0x4a')][_0x1a81('0xe2')]){_0x3e9d80=_0x342715[_0x1a81('0x4a')][_0x1a81('0xe2')];return db[_0x1a81('0xb4')][_0x1a81('0x67')]({'where':{'messageId':_0x342715['query'][_0x1a81('0xe1')]}});}break;}}})[_0x1a81('0x3a')](handleEntityNotFound(_0x5735f9,null))['then'](function(_0x1abd35){if(_0x1abd35){_0x1c8e3d=_0x1abd35;switch(_0x4ddb8b[_0x1a81('0x46')]){case _0x1a81('0x95'):if(_0x3e9d80==='2'||_0x3e9d80==='6'){return _0x1c8e3d[_0x1a81('0x39')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1a81('0x2d'),_0x1a81('0x95'),util['inspect'](_0x342715[_0x1a81('0x4a')],{'showHidden':![],'depth':null}));};break;}return _0x1c8e3d;}})[_0x1a81('0x3a')](respondWithResult(_0x5735f9,null))[_0x1a81('0x2b')](handleError(_0x5735f9,null));};exports[_0x1a81('0xe3')]=function(_0x3969c0,_0xac53a2,_0x3e3c2c){return db[_0x1a81('0x59')][_0x1a81('0x67')]({'where':{'id':_0x3969c0[_0x1a81('0x5e')]['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0xac53a2,null))[_0x1a81('0x3a')](function(_0x49d2f7){if(_0x49d2f7){return _0x49d2f7[_0x1a81('0xe3')](_0x3969c0[_0x1a81('0x62')][_0x1a81('0x71')],_[_0x1a81('0xa8')](_0x3969c0['body'],[_0x1a81('0x71'),'id'])||{})[_0x1a81('0xab')](function(_0x51b495){for(var _0x31192d=0x0;_0x31192d<_0x3969c0[_0x1a81('0x62')][_0x1a81('0x71')][_0x1a81('0x60')];_0x31192d+=0x1){socket[_0x1a81('0xe4')]('userSmsAccount:save',{'UserId':Number(_0x3969c0[_0x1a81('0x62')][_0x1a81('0x71')][_0x31192d]),'SmsAccountId':Number(_0x3969c0['params']['id'])});}return _0x51b495;});}})[_0x1a81('0x3a')](respondWithResult(_0xac53a2,null))[_0x1a81('0x2b')](handleError(_0xac53a2,null));};exports[_0x1a81('0xe5')]=function(_0x47b973,_0x473cd4,_0x238285){return db[_0x1a81('0x59')][_0x1a81('0x67')]({'where':{'id':_0x47b973[_0x1a81('0x5e')]['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0x473cd4,null))[_0x1a81('0x3a')](function(_0x39f43f){if(_0x39f43f){return _0x39f43f['removeAgents'](_0x47b973['query'][_0x1a81('0x71')])[_0x1a81('0x3a')](function(){if(_[_0x1a81('0xe6')](_0x47b973['query'][_0x1a81('0x71')])){for(var _0x276ef0=0x0;_0x276ef0<_0x47b973[_0x1a81('0x4a')][_0x1a81('0x71')][_0x1a81('0x60')];_0x276ef0+=0x1){socket['emit'](_0x1a81('0xe7'),{'UserId':Number(_0x47b973[_0x1a81('0x4a')][_0x1a81('0x71')][_0x276ef0]),'SmsAccountId':Number(_0x47b973[_0x1a81('0x5e')]['id'])});}}else{socket[_0x1a81('0xe4')](_0x1a81('0xe7'),{'UserId':Number(_0x47b973[_0x1a81('0x4a')][_0x1a81('0x71')]),'SmsAccountId':Number(_0x47b973[_0x1a81('0x5e')]['id'])});}});}})[_0x1a81('0x3a')](respondWithStatusCode(_0x473cd4,null))[_0x1a81('0x2b')](handleError(_0x473cd4,null));};exports['getAgents']=function(_0x573edb,_0x3d37f4,_0x48755a){var _0x5c0501={};var _0x4749aa={};var _0x46b6dc;var _0x481d21;return db[_0x1a81('0x59')][_0x1a81('0x6c')]({'where':{'id':_0x573edb['params']['id']}})[_0x1a81('0x3a')](handleEntityNotFound(_0x3d37f4,null))['then'](function(_0x115d7c){if(_0x115d7c){_0x46b6dc=_0x115d7c;_0x4749aa[_0x1a81('0x4e')]=_[_0x1a81('0x49')](db[_0x1a81('0xe8')][_0x1a81('0x44')]);_0x4749aa[_0x1a81('0x4a')]=_[_0x1a81('0x49')](_0x573edb[_0x1a81('0x4a')]);_0x4749aa[_0x1a81('0x4b')]=_[_0x1a81('0x4c')](_0x4749aa[_0x1a81('0x4e')],_0x4749aa['query']);_0x5c0501[_0x1a81('0x4d')]=_[_0x1a81('0x4c')](_0x4749aa[_0x1a81('0x4e')],qs[_0x1a81('0x4f')](_0x573edb[_0x1a81('0x4a')][_0x1a81('0x4f')]));_0x5c0501[_0x1a81('0x4d')]=_0x5c0501[_0x1a81('0x4d')][_0x1a81('0x60')]?_0x5c0501[_0x1a81('0x4d')]:_0x4749aa['model'];_0x5c0501[_0x1a81('0x6e')]=qs[_0x1a81('0x52')](_0x573edb['query'][_0x1a81('0x52')]);_0x5c0501[_0x1a81('0x53')]=qs[_0x1a81('0x4b')](_[_0x1a81('0x54')](_0x573edb[_0x1a81('0x4a')],_0x4749aa[_0x1a81('0x4b')]));if(_0x573edb['query'][_0x1a81('0x55')]){_0x5c0501[_0x1a81('0x53')]=_[_0x1a81('0x56')](_0x5c0501['where'],{'$or':_[_0x1a81('0x48')](_0x5c0501[_0x1a81('0x4d')],function(_0x25b280){var _0x2300ea={};_0x2300ea[_0x25b280]={'$like':'%'+_0x573edb['query'][_0x1a81('0x55')]+'%'};return _0x2300ea;})});}_0x5c0501=_[_0x1a81('0x56')]({},_0x5c0501,_0x573edb[_0x1a81('0x58')]);return _0x46b6dc[_0x1a81('0xe9')](_0x5c0501);}})[_0x1a81('0x3a')](function(_0x33a778){if(_0x33a778){_0x481d21=_0x33a778[_0x1a81('0x60')];if(!_0x573edb['query']['hasOwnProperty'](_0x1a81('0x51'))){_0x5c0501[_0x1a81('0x31')]=qs['limit'](_0x573edb[_0x1a81('0x4a')][_0x1a81('0x31')]);_0x5c0501[_0x1a81('0x30')]=qs['offset'](_0x573edb[_0x1a81('0x4a')][_0x1a81('0x30')]);}return _0x46b6dc[_0x1a81('0xe9')](_0x5c0501);}})[_0x1a81('0x3a')](function(_0x1159a0){if(_0x1159a0){return _0x1159a0?{'count':_0x481d21,'rows':_0x1159a0}:null;}})[_0x1a81('0x3a')](respondWithResult(_0x3d37f4,null))[_0x1a81('0x2b')](handleError(_0x3d37f4,null));}; \ No newline at end of file +var _0xa599=['Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','getApplications','getInteractions','Contact','User','Owner','internal','Tags','tag','to\x20is\x20mandatory','List','DESC','out','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','message_id','status_code','DELIVERED','groupName','redif','error_code','RECEIVED_BY_RECIPIENT','bandwidth','DELIVRD','statusGet','message-id','state','addAgents','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','http','request','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','status','end','json','offset','limit','count','set','save','update','then','destroy','SmsAccounts','sendStatus','stack','name','send','index','map','SmsAccount','fieldName','model','keys','query','intersection','attributes','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','show','params','Pause','mandatoryDispositionPause','fields','length','include','options','create','body','role','user','get','find','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','Disposition','getDispositions','findOne','rawAttributes','hasOwnProperty','SmsAccountId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','nolimit','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','mobile','from','From','Body','messageId','MessageSid','skebby','text','connectel','clicksend','plivo','Text','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','intelepeer','refid','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','updatedAt','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','waitForTheAssignedAgent'];(function(_0x3c0935,_0x76cef4){var _0x4669fe=function(_0x3ea952){while(--_0x3ea952){_0x3c0935['push'](_0x3c0935['shift']());}};_0x4669fe(++_0x76cef4);}(_0xa599,0x10d));var _0x9a59=function(_0x112f2c,_0x164562){_0x112f2c=_0x112f2c-0x0;var _0x4683de=_0xa599[_0x112f2c];return _0x4683de;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a59('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9a59('0x1'));var moment=require(_0x9a59('0x2'));var BPromise=require(_0x9a59('0x3'));var Mustache=require(_0x9a59('0x4'));var util=require(_0x9a59('0x5'));var path=require(_0x9a59('0x6'));var sox=require('sox');var csv=require(_0x9a59('0x7'));var ejs=require(_0x9a59('0x8'));var fs=require('fs');var fs_extra=require(_0x9a59('0x9'));var _=require(_0x9a59('0xa'));var squel=require(_0x9a59('0xb'));var crypto=require(_0x9a59('0xc'));var jsforce=require(_0x9a59('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9a59('0x7'));var querystring=require('querystring');var Papa=require(_0x9a59('0xe'));var Redis=require(_0x9a59('0xf'));var authService=require(_0x9a59('0x10'));var qs=require(_0x9a59('0x11'));var as=require(_0x9a59('0x12'));var hardwareService=require(_0x9a59('0x13'));var logger=require('../../config/logger')(_0x9a59('0x14'));var utils=require('../../config/utils');var config=require(_0x9a59('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9a59('0x16'))['db'];config['redis']=_[_0x9a59('0x17')](config[_0x9a59('0x18')],{'host':_0x9a59('0x19'),'port':0x18eb});var socket=require(_0x9a59('0x1a'))(new Redis(config[_0x9a59('0x18')]));require(_0x9a59('0x1b'))[_0x9a59('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x9a59('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x32b85f,_0xe310ba,_0x1506aa,_0x3787b3){return new BPromise(function(_0x22eaf6,_0x3ac6db){var _0x290bac=_0x3787b3||client;return _0x290bac[_0x9a59('0x1e')](_0x32b85f,_0x1506aa)['then'](function(_0x5f42cf){logger['info'](_0x9a59('0x1f'),_0xe310ba,_0x9a59('0x20'));logger['debug'](_0x9a59('0x21'),_0xe310ba,_0x9a59('0x20'),JSON[_0x9a59('0x22')](_0x5f42cf));if(_0x5f42cf[_0x9a59('0x23')]){if(_0x5f42cf['error']['code']===0x1f4){logger['error'](_0x9a59('0x1f'),_0xe310ba,_0x5f42cf[_0x9a59('0x23')][_0x9a59('0x24')]);return _0x3ac6db(_0x5f42cf[_0x9a59('0x23')][_0x9a59('0x24')]);}logger[_0x9a59('0x23')](_0x9a59('0x1f'),_0xe310ba,_0x5f42cf[_0x9a59('0x23')][_0x9a59('0x24')]);return _0x22eaf6(_0x5f42cf[_0x9a59('0x23')][_0x9a59('0x24')]);}else{logger[_0x9a59('0x25')]('SmsAccount,\x20%s,\x20%s',_0xe310ba,'request\x20sent');_0x22eaf6(_0x5f42cf[_0x9a59('0x26')]['message']);}})[_0x9a59('0x27')](function(_0x54cb4a){logger['error'](_0x9a59('0x1f'),_0xe310ba,_0x54cb4a);_0x3ac6db(_0x54cb4a);});});}function respondWithStatusCode(_0x213f98,_0xffb474){_0xffb474=_0xffb474||0xcc;return function(_0x496e00){if(_0x496e00){return _0x213f98['sendStatus'](_0xffb474);}return _0x213f98[_0x9a59('0x28')](_0xffb474)[_0x9a59('0x29')]();};}function respondWithResult(_0x1f6793,_0x122c4f){_0x122c4f=_0x122c4f||0xc8;return function(_0x2970ec){if(_0x2970ec){return _0x1f6793[_0x9a59('0x28')](_0x122c4f)[_0x9a59('0x2a')](_0x2970ec);}};}function respondWithFilteredResult(_0x55c47f,_0x4a35d7){return function(_0x1d4577){if(_0x1d4577){var _0x48494f=typeof _0x4a35d7[_0x9a59('0x2b')]==='undefined'&&typeof _0x4a35d7[_0x9a59('0x2c')]==='undefined';var _0xc0db6e=_0x1d4577[_0x9a59('0x2d')];var _0x289c76=_0x48494f?0x0:_0x4a35d7['offset'];var _0xb732da=_0x48494f?_0x1d4577['count']:_0x4a35d7[_0x9a59('0x2b')]+_0x4a35d7['limit'];var _0x436094;if(_0xb732da>=_0xc0db6e){_0xb732da=_0xc0db6e;_0x436094=0xc8;}else{_0x436094=0xce;}_0x55c47f[_0x9a59('0x28')](_0x436094);return _0x55c47f[_0x9a59('0x2e')]('Content-Range',_0x289c76+'-'+_0xb732da+'/'+_0xc0db6e)[_0x9a59('0x2a')](_0x1d4577);}return null;};}function patchUpdates(_0x131654){return function(_0x537d7d){try{jsonpatch['apply'](_0x537d7d,_0x131654,!![]);}catch(_0x945a0f){return BPromise['reject'](_0x945a0f);}return _0x537d7d[_0x9a59('0x2f')]();};}function saveUpdates(_0x382283,_0x476079){return function(_0x3a6daf){if(_0x3a6daf){return _0x3a6daf[_0x9a59('0x30')](_0x382283)[_0x9a59('0x31')](function(_0x4d3a14){return _0x4d3a14;});}return null;};}function removeEntity(_0x20ee06,_0xd9f797){return function(_0x2d85d0){if(_0x2d85d0){return _0x2d85d0[_0x9a59('0x32')]()[_0x9a59('0x31')](function(){var _0x131cda=_0x2d85d0['get']({'plain':!![]});var _0x3ea2df=_0x9a59('0x33');return db['UserProfileResource'][_0x9a59('0x32')]({'where':{'type':_0x3ea2df,'resourceId':_0x131cda['id']}})[_0x9a59('0x31')](function(){return _0x2d85d0;});})[_0x9a59('0x31')](function(){_0x20ee06[_0x9a59('0x28')](0xcc)[_0x9a59('0x29')]();});}};}function handleEntityNotFound(_0x4dd8c9,_0x5b5b6f){return function(_0x4fcca5){if(!_0x4fcca5){_0x4dd8c9[_0x9a59('0x34')](0x194);}return _0x4fcca5;};}function handleError(_0x256239,_0x38ee07){_0x38ee07=_0x38ee07||0x1f4;return function(_0x156344){logger[_0x9a59('0x23')](_0x156344[_0x9a59('0x35')]);if(_0x156344[_0x9a59('0x36')]){delete _0x156344['name'];}_0x256239[_0x9a59('0x28')](_0x38ee07)[_0x9a59('0x37')](_0x156344);};}exports[_0x9a59('0x38')]=function(_0x24e37a,_0x4b364a){var _0x23d6b3={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x36e936={},_0x509f19={'count':0x0,'rows':[]};var _0x3a103f=_[_0x9a59('0x39')](db[_0x9a59('0x3a')]['rawAttributes'],function(_0x3d1527){return{'name':_0x3d1527[_0x9a59('0x3b')],'type':_0x3d1527['type']['key']};});_0x36e936[_0x9a59('0x3c')]=_[_0x9a59('0x39')](_0x3a103f,_0x9a59('0x36'));_0x36e936['query']=_[_0x9a59('0x3d')](_0x24e37a[_0x9a59('0x3e')]);_0x36e936['filters']=_[_0x9a59('0x3f')](_0x36e936['model'],_0x36e936[_0x9a59('0x3e')]);_0x23d6b3['attributes']=_[_0x9a59('0x3f')](_0x36e936['model'],qs['fields'](_0x24e37a['query']['fields']));_0x23d6b3[_0x9a59('0x40')]=_0x23d6b3[_0x9a59('0x40')]['length']?_0x23d6b3[_0x9a59('0x40')]:_0x36e936[_0x9a59('0x3c')];if(!_0x24e37a[_0x9a59('0x3e')]['hasOwnProperty']('nolimit')){_0x23d6b3[_0x9a59('0x2c')]=qs['limit'](_0x24e37a['query'][_0x9a59('0x2c')]);_0x23d6b3[_0x9a59('0x2b')]=qs['offset'](_0x24e37a['query'][_0x9a59('0x2b')]);}_0x23d6b3[_0x9a59('0x41')]=qs[_0x9a59('0x42')](_0x24e37a[_0x9a59('0x3e')][_0x9a59('0x42')]);_0x23d6b3[_0x9a59('0x43')]=qs[_0x9a59('0x44')](_[_0x9a59('0x45')](_0x24e37a[_0x9a59('0x3e')],_0x36e936['filters']),_0x3a103f);if(_0x24e37a['query'][_0x9a59('0x46')]){_0x23d6b3[_0x9a59('0x43')]=_[_0x9a59('0x47')](_0x23d6b3['where'],{'$or':_[_0x9a59('0x39')](_0x3a103f,function(_0x363472){if(_0x363472[_0x9a59('0x48')]!==_0x9a59('0x49')){var _0xbb08b7={};_0xbb08b7[_0x363472['name']]={'$like':'%'+_0x24e37a['query']['filter']+'%'};return _0xbb08b7;}})});}_0x23d6b3=_['merge']({},_0x23d6b3,_0x24e37a['options']);var _0x57039c={'where':_0x23d6b3[_0x9a59('0x43')]};return db[_0x9a59('0x3a')]['count'](_0x57039c)[_0x9a59('0x31')](function(_0x28942f){_0x509f19[_0x9a59('0x2d')]=_0x28942f;if(_0x24e37a[_0x9a59('0x3e')][_0x9a59('0x4a')]){_0x23d6b3['include']=[{'all':!![]}];}return db[_0x9a59('0x3a')][_0x9a59('0x4b')](_0x23d6b3);})[_0x9a59('0x31')](function(_0x57e81f){_0x509f19[_0x9a59('0x4c')]=_0x57e81f;return _0x509f19;})[_0x9a59('0x31')](respondWithFilteredResult(_0x4b364a,_0x23d6b3))['catch'](handleError(_0x4b364a,null));};exports[_0x9a59('0x4d')]=function(_0x21adb3,_0x3e752a){var _0x995b3={'raw':![],'where':{'id':_0x21adb3[_0x9a59('0x4e')]['id']},'include':[{'model':db[_0x9a59('0x4f')],'as':_0x9a59('0x50')}]},_0x580c90={};_0x580c90[_0x9a59('0x3c')]=_[_0x9a59('0x3d')](db[_0x9a59('0x3a')]['rawAttributes']);_0x580c90[_0x9a59('0x3e')]=_[_0x9a59('0x3d')](_0x21adb3[_0x9a59('0x3e')]);_0x580c90['filters']=_['intersection'](_0x580c90['model'],_0x580c90[_0x9a59('0x3e')]);_0x995b3[_0x9a59('0x40')]=_['intersection'](_0x580c90['model'],qs[_0x9a59('0x51')](_0x21adb3[_0x9a59('0x3e')][_0x9a59('0x51')]));_0x995b3[_0x9a59('0x40')]=_0x995b3[_0x9a59('0x40')][_0x9a59('0x52')]?_0x995b3[_0x9a59('0x40')]:_0x580c90[_0x9a59('0x3c')];if(_0x21adb3['query']['includeAll']){_0x995b3[_0x9a59('0x53')]=[{'all':!![]}];}_0x995b3=_[_0x9a59('0x47')]({},_0x995b3,_0x21adb3[_0x9a59('0x54')]);return db[_0x9a59('0x3a')]['find'](_0x995b3)[_0x9a59('0x31')](handleEntityNotFound(_0x3e752a,null))[_0x9a59('0x31')](respondWithResult(_0x3e752a,null))[_0x9a59('0x27')](handleError(_0x3e752a,null));};exports[_0x9a59('0x55')]=function(_0x3d648f,_0x93ca77){return db['SmsAccount'][_0x9a59('0x55')](_0x3d648f[_0x9a59('0x56')],{})['then'](function(_0x2f92b6){var _0x3d5417=_0x3d648f['user']['get']({'plain':!![]});if(!_0x3d5417)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d5417[_0x9a59('0x57')]===_0x9a59('0x58')){var _0x3bb45b=_0x2f92b6[_0x9a59('0x59')]({'plain':!![]});var _0x481c61=_0x9a59('0x33');return db['UserProfileSection'][_0x9a59('0x5a')]({'where':{'name':_0x481c61,'userProfileId':_0x3d5417[_0x9a59('0x5b')]},'raw':!![]})[_0x9a59('0x31')](function(_0x15dcec){if(_0x15dcec&&_0x15dcec[_0x9a59('0x5c')]===0x0){return db[_0x9a59('0x5d')][_0x9a59('0x55')]({'name':_0x3bb45b[_0x9a59('0x36')],'resourceId':_0x3bb45b['id'],'type':_0x15dcec[_0x9a59('0x36')],'sectionId':_0x15dcec['id']},{})[_0x9a59('0x31')](function(){return _0x2f92b6;});}else{return _0x2f92b6;}})['catch'](function(_0xbcaa19){logger[_0x9a59('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xbcaa19);throw _0xbcaa19;});}return _0x2f92b6;})[_0x9a59('0x31')](respondWithResult(_0x93ca77,0xc9))[_0x9a59('0x27')](handleError(_0x93ca77,null));};exports[_0x9a59('0x30')]=function(_0x44f659,_0x384304){if(_0x44f659[_0x9a59('0x56')]['id']){delete _0x44f659[_0x9a59('0x56')]['id'];}return db[_0x9a59('0x3a')]['find']({'where':{'id':_0x44f659[_0x9a59('0x4e')]['id']},'include':[{'model':db[_0x9a59('0x4f')],'as':_0x9a59('0x50')}]})['then'](handleEntityNotFound(_0x384304,null))[_0x9a59('0x31')](saveUpdates(_0x44f659[_0x9a59('0x56')],null))[_0x9a59('0x31')](respondWithResult(_0x384304,null))[_0x9a59('0x27')](handleError(_0x384304,null));};exports[_0x9a59('0x32')]=function(_0x4e5242,_0x409ede){return db['SmsAccount'][_0x9a59('0x5a')]({'where':{'id':_0x4e5242[_0x9a59('0x4e')]['id']}})[_0x9a59('0x31')](handleEntityNotFound(_0x409ede,null))[_0x9a59('0x31')](removeEntity(_0x409ede,null))[_0x9a59('0x27')](handleError(_0x409ede,null));};exports[_0x9a59('0x5e')]=function(_0x42aa41,_0x3955e6){return db[_0x9a59('0x3a')][_0x9a59('0x5e')]()[_0x9a59('0x31')](respondWithResult(_0x3955e6,null))[_0x9a59('0x27')](handleError(_0x3955e6,null));};exports[_0x9a59('0x5f')]=function(_0x583b5a,_0x546b7b,_0x98edeb){if(_0x583b5a[_0x9a59('0x56')]['id']){delete _0x583b5a[_0x9a59('0x56')]['id'];}return db[_0x9a59('0x3a')][_0x9a59('0x5a')]({'where':{'id':_0x583b5a[_0x9a59('0x4e')]['id']}})['then'](handleEntityNotFound(_0x546b7b,null))['then'](function(_0x5eba2e){if(_0x5eba2e){_0x583b5a[_0x9a59('0x56')]['SmsAccountId']=_0x5eba2e['id'];return db[_0x9a59('0x60')][_0x9a59('0x55')](_0x583b5a['body']);}})['then'](respondWithResult(_0x546b7b,null))[_0x9a59('0x27')](handleError(_0x546b7b,null));};exports[_0x9a59('0x61')]=function(_0x12a0f6,_0x5d9830,_0x1b029b){var _0x32f40d={'raw':![],'where':{}};var _0x5b1ca8={};var _0x5f4508={'count':0x0,'rows':[]};return db['SmsAccount'][_0x9a59('0x62')]({'where':{'id':_0x12a0f6[_0x9a59('0x4e')]['id']}})[_0x9a59('0x31')](handleEntityNotFound(_0x5d9830,null))['then'](function(_0x2f59bc){if(_0x2f59bc){_0x5b1ca8['model']=_[_0x9a59('0x3d')](db[_0x9a59('0x60')][_0x9a59('0x63')]);_0x5b1ca8[_0x9a59('0x3e')]=_[_0x9a59('0x3d')](_0x12a0f6['query']);_0x5b1ca8['filters']=_[_0x9a59('0x3f')](_0x5b1ca8[_0x9a59('0x3c')],_0x5b1ca8['query']);_0x32f40d[_0x9a59('0x40')]=_[_0x9a59('0x3f')](_0x5b1ca8['model'],qs['fields'](_0x12a0f6['query']['fields']));_0x32f40d[_0x9a59('0x40')]=_0x32f40d[_0x9a59('0x40')][_0x9a59('0x52')]?_0x32f40d[_0x9a59('0x40')]:_0x5b1ca8[_0x9a59('0x3c')];if(!_0x12a0f6['query'][_0x9a59('0x64')]('nolimit')){_0x32f40d[_0x9a59('0x2c')]=qs[_0x9a59('0x2c')](_0x12a0f6[_0x9a59('0x3e')][_0x9a59('0x2c')]);_0x32f40d[_0x9a59('0x2b')]=qs[_0x9a59('0x2b')](_0x12a0f6[_0x9a59('0x3e')]['offset']);}_0x32f40d[_0x9a59('0x41')]=qs['sort'](_0x12a0f6[_0x9a59('0x3e')]['sort']);_0x32f40d[_0x9a59('0x43')]=qs['filters'](_[_0x9a59('0x45')](_0x12a0f6[_0x9a59('0x3e')],_0x5b1ca8[_0x9a59('0x44')]));_0x32f40d[_0x9a59('0x43')][_0x9a59('0x65')]=_0x2f59bc['id'];if(_0x12a0f6[_0x9a59('0x3e')]['filter']){_0x32f40d[_0x9a59('0x43')]=_[_0x9a59('0x47')](_0x32f40d['where'],{'$or':_['map'](_0x32f40d[_0x9a59('0x40')],function(_0x257b4a){var _0x115517={};_0x115517[_0x257b4a]={'$like':'%'+_0x12a0f6[_0x9a59('0x3e')][_0x9a59('0x46')]+'%'};return _0x115517;})});}_0x32f40d=_['merge']({},_0x32f40d,_0x12a0f6['options']);return db[_0x9a59('0x60')][_0x9a59('0x2d')]({'where':_0x32f40d['where']})[_0x9a59('0x31')](function(_0x450391){_0x5f4508[_0x9a59('0x2d')]=_0x450391;if(_0x12a0f6[_0x9a59('0x3e')][_0x9a59('0x4a')]){_0x32f40d[_0x9a59('0x53')]=[{'all':!![]}];}return db['Disposition'][_0x9a59('0x4b')](_0x32f40d);})['then'](function(_0x19641d){_0x5f4508['rows']=_0x19641d;return _0x5f4508;});}})[_0x9a59('0x31')](respondWithFilteredResult(_0x5d9830,_0x32f40d))[_0x9a59('0x27')](handleError(_0x5d9830,null));};exports[_0x9a59('0x66')]=function(_0x2eabd0,_0x3849b9,_0x59d1a7){return db[_0x9a59('0x3a')]['find']({'where':{'id':_0x2eabd0[_0x9a59('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3849b9,null))[_0x9a59('0x31')](function(_0x44180e){if(_0x44180e){return _0x44180e[_0x9a59('0x66')](_0x2eabd0['query'][_0x9a59('0x67')]);}})['then'](respondWithStatusCode(_0x3849b9,null))[_0x9a59('0x27')](handleError(_0x3849b9,null));};exports[_0x9a59('0x68')]=function(_0x26bae8,_0x28d0b0,_0x979699){if(_0x26bae8['body']['id']){delete _0x26bae8['body']['id'];}return db['SmsAccount'][_0x9a59('0x5a')]({'where':{'id':_0x26bae8[_0x9a59('0x4e')]['id']}})[_0x9a59('0x31')](handleEntityNotFound(_0x28d0b0,null))['then'](function(_0x42e049){if(_0x42e049){_0x26bae8[_0x9a59('0x56')][_0x9a59('0x65')]=_0x42e049['id'];return db['CannedAnswer'][_0x9a59('0x55')](_0x26bae8[_0x9a59('0x56')]);}})[_0x9a59('0x31')](respondWithResult(_0x28d0b0,null))[_0x9a59('0x27')](handleError(_0x28d0b0,null));};exports[_0x9a59('0x69')]=function(_0x4d3fef,_0x41d749,_0x3ef896){var _0x33f996={'raw':![],'where':{}};var _0x5841a4={};var _0xf80b2a={'count':0x0,'rows':[]};return db[_0x9a59('0x3a')][_0x9a59('0x62')]({'where':{'id':_0x4d3fef[_0x9a59('0x4e')]['id']}})[_0x9a59('0x31')](handleEntityNotFound(_0x41d749,null))[_0x9a59('0x31')](function(_0x349301){if(_0x349301){_0x5841a4[_0x9a59('0x3c')]=_[_0x9a59('0x3d')](db[_0x9a59('0x6a')][_0x9a59('0x63')]);_0x5841a4[_0x9a59('0x3e')]=_[_0x9a59('0x3d')](_0x4d3fef['query']);_0x5841a4[_0x9a59('0x44')]=_[_0x9a59('0x3f')](_0x5841a4[_0x9a59('0x3c')],_0x5841a4['query']);_0x33f996[_0x9a59('0x40')]=_[_0x9a59('0x3f')](_0x5841a4[_0x9a59('0x3c')],qs[_0x9a59('0x51')](_0x4d3fef[_0x9a59('0x3e')][_0x9a59('0x51')]));_0x33f996[_0x9a59('0x40')]=_0x33f996[_0x9a59('0x40')][_0x9a59('0x52')]?_0x33f996['attributes']:_0x5841a4[_0x9a59('0x3c')];if(!_0x4d3fef[_0x9a59('0x3e')]['hasOwnProperty'](_0x9a59('0x6b'))){_0x33f996[_0x9a59('0x2c')]=qs[_0x9a59('0x2c')](_0x4d3fef[_0x9a59('0x3e')][_0x9a59('0x2c')]);_0x33f996['offset']=qs[_0x9a59('0x2b')](_0x4d3fef['query']['offset']);}_0x33f996['order']=qs[_0x9a59('0x42')](_0x4d3fef[_0x9a59('0x3e')][_0x9a59('0x42')]);_0x33f996[_0x9a59('0x43')]=qs['filters'](_['pick'](_0x4d3fef[_0x9a59('0x3e')],_0x5841a4[_0x9a59('0x44')]));_0x33f996[_0x9a59('0x43')][_0x9a59('0x65')]=_0x349301['id'];if(_0x4d3fef[_0x9a59('0x3e')][_0x9a59('0x46')]){_0x33f996['where']=_['merge'](_0x33f996[_0x9a59('0x43')],{'$or':_['map'](_0x33f996[_0x9a59('0x40')],function(_0x1a1b15){var _0x4618e2={};_0x4618e2[_0x1a1b15]={'$like':'%'+_0x4d3fef['query']['filter']+'%'};return _0x4618e2;})});}_0x33f996=_['merge']({},_0x33f996,_0x4d3fef[_0x9a59('0x54')]);return db[_0x9a59('0x6a')][_0x9a59('0x2d')]({'where':_0x33f996[_0x9a59('0x43')]})['then'](function(_0x3f9fed){_0xf80b2a['count']=_0x3f9fed;if(_0x4d3fef[_0x9a59('0x3e')]['includeAll']){_0x33f996['include']=[{'all':!![]}];}return db[_0x9a59('0x6a')][_0x9a59('0x4b')](_0x33f996);})[_0x9a59('0x31')](function(_0x36fd0b){_0xf80b2a[_0x9a59('0x4c')]=_0x36fd0b;return _0xf80b2a;});}})[_0x9a59('0x31')](respondWithFilteredResult(_0x41d749,_0x33f996))[_0x9a59('0x27')](handleError(_0x41d749,null));};exports[_0x9a59('0x6c')]=function(_0x5a5846,_0x473325,_0x32e053){return db[_0x9a59('0x3a')]['find']({'where':{'id':_0x5a5846[_0x9a59('0x4e')]['id']}})[_0x9a59('0x31')](handleEntityNotFound(_0x473325,null))[_0x9a59('0x31')](function(_0x4d07e3){if(_0x4d07e3){return _0x4d07e3[_0x9a59('0x6c')](_0x5a5846['query'][_0x9a59('0x67')]);}})[_0x9a59('0x31')](respondWithStatusCode(_0x473325,null))['catch'](handleError(_0x473325,null));};exports[_0x9a59('0x6d')]=function(_0xb503a4,_0x23845a,_0x49acbf){var _0x4b7247={'channel':_0x9a59('0x6e')};var _0x591208=[];var _0x47af4a=[];var _0x134850={};return db[_0x9a59('0x3a')][_0x9a59('0x5a')]({'where':{'id':_0xb503a4[_0x9a59('0x4e')]['id']},'include':[{'model':db[_0x9a59('0x6f')],'as':_0x9a59('0x70')}]})[_0x9a59('0x31')](handleEntityNotFound(_0x23845a,null))[_0x9a59('0x31')](function(_0x33b178){_0x4b7247[_0x9a59('0x71')]=_0x33b178;_0x4b7247[_0x9a59('0x72')]=_[_0x9a59('0x73')](_0x33b178[_0x9a59('0x70')],[_0x9a59('0x74')],[_0x9a59('0x75')]);if(_0x4b7247['account'][_0x9a59('0x70')]){delete _0x4b7247[_0x9a59('0x71')][_0x9a59('0x70')];}return db['CmContact']['describe']();})[_0x9a59('0x31')](function(_0x4f67d3){if(!_0x4f67d3){throw new db[(_0x9a59('0x76'))][(_0x9a59('0x77'))](_0x9a59('0x78'));}_0x591208=_[_0x9a59('0x79')](_['keys'](_0x4f67d3),[_0x9a59('0x7a'),'updatedAt']);_0x47af4a=_[_0x9a59('0x79')](_[_0x9a59('0x3d')](_0x4f67d3),['createdAt','updatedAt',_0x9a59('0x7b'),_0x9a59('0x7c')]);_0x4b7247[_0x9a59('0x56')]={'mapKey':_0x9a59('0x7d')};if(_0x4b7247[_0x9a59('0x71')][_0x9a59('0x48')]){switch(_0x4b7247[_0x9a59('0x71')]['type']){case'twilio':_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')]=_0xb503a4[_0x9a59('0x56')][_0x9a59('0x7f')];_0x4b7247[_0x9a59('0x56')]['body']=_0xb503a4[_0x9a59('0x56')][_0x9a59('0x80')];_0x4b7247[_0x9a59('0x56')][_0x9a59('0x81')]=_0xb503a4[_0x9a59('0x56')][_0x9a59('0x82')];break;case _0x9a59('0x83'):_0x4b7247[_0x9a59('0x56')]['from']='+'+_0xb503a4[_0x9a59('0x56')]['sender'];_0x4b7247['body'][_0x9a59('0x56')]=_0xb503a4[_0x9a59('0x56')][_0x9a59('0x84')];break;case _0x9a59('0x85'):_0x4b7247[_0x9a59('0x56')]['from']=_0xb503a4[_0x9a59('0x56')][_0x9a59('0x7e')];_0x4b7247[_0x9a59('0x56')][_0x9a59('0x56')]=_0xb503a4['body']['message'];break;case _0x9a59('0x86'):_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')]=_0xb503a4[_0x9a59('0x56')][_0x9a59('0x7e')];_0x4b7247[_0x9a59('0x56')][_0x9a59('0x56')]=_0xb503a4['body'][_0x9a59('0x56')];_0x4b7247[_0x9a59('0x56')][_0x9a59('0x81')]=_0xb503a4['body']['message_id'];break;case _0x9a59('0x87'):_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')]=_0xb503a4[_0x9a59('0x56')][_0x9a59('0x7f')];_0x4b7247[_0x9a59('0x56')]['body']=_0xb503a4[_0x9a59('0x56')][_0x9a59('0x88')];_0x4b7247[_0x9a59('0x56')][_0x9a59('0x81')]=_0xb503a4[_0x9a59('0x56')]['MessageUUID'];break;case _0x9a59('0x89'):_0x4b7247[_0x9a59('0x56')]['from']='+'+_0xb503a4[_0x9a59('0x56')][_0x9a59('0x8a')][0x0][_0x9a59('0x7e')];_0x4b7247[_0x9a59('0x56')][_0x9a59('0x56')]=_0xb503a4[_0x9a59('0x56')][_0x9a59('0x8a')][0x0][_0x9a59('0x84')];_0x4b7247[_0x9a59('0x56')][_0x9a59('0x81')]=_0xb503a4['body'][_0x9a59('0x8a')][0x0][_0x9a59('0x81')];break;case _0x9a59('0x8b'):_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')]=_0xb503a4[_0x9a59('0x56')][_0x9a59('0x8c')];_0x4b7247[_0x9a59('0x56')][_0x9a59('0x56')]=_0xb503a4[_0x9a59('0x56')][_0x9a59('0x8d')][_0x9a59('0x24')];break;case _0x9a59('0x8e'):_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')]=_0xb503a4[_0x9a59('0x56')]['fromNumber'];_0x4b7247['body'][_0x9a59('0x56')]=_0xb503a4['body'][_0x9a59('0x84')];_0x4b7247[_0x9a59('0x56')]['messageId']=_0xb503a4[_0x9a59('0x56')]['replyMessageId'];break;case'bandwidth':_0x4b7247[_0x9a59('0x56')]['messageId']=_0xb503a4[_0x9a59('0x56')][0x0][_0x9a59('0x24')]['id'];_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')]=_0xb503a4['body'][0x0][_0x9a59('0x24')][_0x9a59('0x7e')];_0x4b7247[_0x9a59('0x56')][_0x9a59('0x56')]=_0xb503a4[_0x9a59('0x56')][0x0][_0x9a59('0x24')][_0x9a59('0x84')];break;case _0x9a59('0x8f'):_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')]=_0xb503a4[_0x9a59('0x56')]['from'];_0x4b7247['body'][_0x9a59('0x56')]=_0xb503a4['body'][_0x9a59('0x24')];_0x4b7247[_0x9a59('0x56')][_0x9a59('0x81')]=_0xb503a4['body'][_0x9a59('0x90')];break;}}if(_0x4b7247[_0x9a59('0x56')]['id']){delete _0x4b7247[_0x9a59('0x56')]['id'];}if(_['isNil'](_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')])){throw new db[(_0x9a59('0x76'))][(_0x9a59('0x77'))](_0x9a59('0x91'));}if(_['isNil'](_0x4b7247[_0x9a59('0x56')][_0x9a59('0x56')])||_0x4b7247['body'][_0x9a59('0x56')]===''){throw new db['Sequelize']['ValidationError'](_0x9a59('0x92'));}if(_[_0x9a59('0x93')](_0x4b7247[_0x9a59('0x56')][_0x9a59('0x94')])){throw new db[(_0x9a59('0x76'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x47af4a);}if(!_[_0x9a59('0x95')](_0x47af4a,_0x4b7247[_0x9a59('0x56')][_0x9a59('0x94')])){throw new db[(_0x9a59('0x76'))][(_0x9a59('0x77'))](_0x9a59('0x96')+_0x47af4a);}_0x134850[_0x4b7247[_0x9a59('0x56')][_0x9a59('0x94')]]=_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')];return db[_0x9a59('0x97')][_0x9a59('0x5a')]({'where':{'id':_0x4b7247['account'][_0x9a59('0x7c')]},'include':[{'model':db[_0x9a59('0x98')],'as':_0x9a59('0x99'),'where':_0x134850,'limit':0x1,'order':[[_0x9a59('0x9a'),'DESC']]}]});})[_0x9a59('0x31')](handleEntityNotFound(_0x23845a,null))['then'](function(_0x2f5373){if(_0x2f5373){_0x4b7247[_0x9a59('0x9b')]=_[_0x9a59('0x9c')](_0x2f5373,['Contacts']);if(_0x2f5373['Contacts'][_0x9a59('0x52')]){return _0x2f5373[_0x9a59('0x99')][0x0];}var _0x107b7e=_[_0x9a59('0x17')](_0x4b7247[_0x9a59('0x56')],{'firstName':_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')],'ListId':_0x2f5373['id']});_0x107b7e[_0x4b7247['body'][_0x9a59('0x94')]]=_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')];return db['CmContact'][_0x9a59('0x55')](_0x107b7e,{'fields':_0x591208,'raw':!![]});}})[_0x9a59('0x31')](handleEntityNotFound(_0x23845a,null))[_0x9a59('0x31')](function(_0x16ce26){if(_0x16ce26){_0x4b7247[_0x9a59('0x9d')]=_0x16ce26;var _0x1e3001={'ContactId':_0x16ce26['id'],'phone':_0x4b7247['body'][_0x9a59('0x7e')],'SmsAccountId':_0xb503a4['params']['id']};var _0x238e3a={'ContactId':_0x16ce26['id'],'SmsAccountId':_0xb503a4[_0x9a59('0x4e')]['id'],'closed':![]};return db[_0x9a59('0x9e')][_0x9a59('0x5a')]({'where':_0x238e3a})['then'](function(_0x57a404){if(_0x57a404){return[_0x57a404,![]];}return db[_0x9a59('0x9e')][_0x9a59('0x55')](_0x1e3001)['then'](function(_0x1bb62f){return[_0x1bb62f,!![]];});});}})[_0x9a59('0x9f')](function(_0x5821ff,_0x3b0d27){_0x4b7247[_0x9a59('0xa0')]=_0x5821ff['get']({'plain':!![]});_0x4b7247[_0x9a59('0xa0')][_0x9a59('0xa1')]=![];if(_0x3b0d27){if(_0x4b7247['account'][_0x9a59('0xa2')]){_0x4b7247['applications']['push']({'id':0x0,'priority':_0x4b7247[_0x9a59('0x72')][_0x9a59('0x52')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x9a59('0xa3')});}_0x4b7247[_0x9a59('0xa0')][_0x9a59('0xa1')]=!![];}return db[_0x9a59('0xa4')]['create']({'phone':_0x4b7247[_0x9a59('0x56')][_0x9a59('0x7e')],'messageId':_0x4b7247['body'][_0x9a59('0x81')],'body':_0x4b7247['body']['body'],'SmsAccountId':_0xb503a4[_0x9a59('0x4e')]['id'],'SmsInteractionId':_0x5821ff['id'],'direction':'in','ContactId':_0x5821ff[_0x9a59('0xa5')],'AttachmentId':_0x4b7247['body'][_0x9a59('0xa6')]});})[_0x9a59('0x31')](function(_0x3ee483){_0x4b7247['message']=_0x3ee483;if(_0x4b7247[_0x9a59('0xa0')][_0x9a59('0xa7')]){return db['User'][_0x9a59('0x5a')]({'attributes':['id',_0x9a59('0x36')],'where':{'id':_0x4b7247[_0x9a59('0xa0')]['UserId']}})[_0x9a59('0x31')](function(_0x207bb5){if(_0x207bb5){_0x4b7247[_0x9a59('0x72')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x207bb5['name']+','+(_0x4b7247[_0x9a59('0x71')][_0x9a59('0xa8')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x9a59('0xa9'),'startRouting',_0x4b7247);});}return respondWithRpcPromise(_0x9a59('0xa9'),_0x9a59('0xaa'),_0x4b7247);})[_0x9a59('0x31')](function(_0x5f0682){if(_0x5f0682){var _0x45ff2b=0xc8;var _0x464ec9=_0x9a59('0xab');logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x464ec9,_0x45ff2b,_0x9a59('0xac'));logger[_0x9a59('0xad')](_0x9a59('0xae'),_0x464ec9,_0x45ff2b,_0x9a59('0xac'),JSON[_0x9a59('0x22')](_0x5f0682));if(_0x4b7247['account']['type']===_0x9a59('0xaf')){return _0x23845a[_0x9a59('0x28')](_0x45ff2b)[_0x9a59('0x2e')](_0x9a59('0xb0'),_0x9a59('0xb1'))[_0x9a59('0x37')]('\x0a');}else{return _0x23845a[_0x9a59('0x28')](_0x45ff2b)[_0x9a59('0x2a')](_0x5f0682);}}})[_0x9a59('0x27')](handleError(_0x23845a,null));};exports['addApplications']=function(_0x1a3035,_0x44e2b7){var _0x11eecc=_0x1a3035[_0x9a59('0x4e')]['id'];var _0x56dd0c=_0x1a3035[_0x9a59('0x56')];var _0x4a267e=0xc8;var _0x125d06=null;return db['sequelize'][_0x9a59('0xb2')]({'isolationLevel':db['sequelize'][_0x9a59('0xb3')][_0x9a59('0xb4')][_0x9a59('0xb5')]},function(_0x12acf0){return db[_0x9a59('0x3a')]['findOne']({'where':{'id':_0x11eecc},'transaction':_0x12acf0})[_0x9a59('0x31')](function(_0x142b70){if(_0x142b70){return db[_0x9a59('0x6f')]['destroy']({'where':{'SmsAccountId':_0x11eecc},'transaction':_0x12acf0})[_0x9a59('0x31')](function(){var _0x271dc0=_[_0x9a59('0x39')](_0x56dd0c,function(_0x4c623d){_0x4c623d[_0x9a59('0x65')]=_0x11eecc;return _0x4c623d;});return db[_0x9a59('0x6f')][_0x9a59('0xb6')](_0x271dc0,{'transaction':_0x12acf0});});}else{_0x4a267e=0x194;_0x125d06=[];}});})[_0x9a59('0x31')](function(){if(_0x4a267e!==0x194){return db[_0x9a59('0x6f')]['findAndCountAll']({'where':{'SmsAccountId':_0x11eecc},'order':_0x9a59('0x74')})[_0x9a59('0x31')](function(_0x36c6b0){_0x125d06=_0x36c6b0;});}})[_0x9a59('0x27')](function(_0x2f27c2){_0x4a267e=0x1f4;logger['error'](_0x2f27c2[_0x9a59('0x35')]);if(_0x2f27c2[_0x9a59('0x36')]){delete _0x2f27c2[_0x9a59('0x36')];}_0x125d06=_0x2f27c2;})['finally'](function(){if(_0x125d06===null){_0x44e2b7[_0x9a59('0x34')](_0x4a267e);}else{if(_0x4a267e===0x1f4){_0x44e2b7[_0x9a59('0x28')](_0x4a267e)[_0x9a59('0x37')](_0x125d06);}else{_0x44e2b7[_0x9a59('0x28')](_0x4a267e)[_0x9a59('0x2a')](_0x125d06);}}});};exports['getApplications']=function(_0x1379ba,_0x16fc20,_0x539ea6){var _0x246085={};var _0xfdfa1d={};var _0x316ea8;var _0x222557;return db[_0x9a59('0x3a')][_0x9a59('0x62')]({'where':{'id':_0x1379ba[_0x9a59('0x4e')]['id']}})[_0x9a59('0x31')](handleEntityNotFound(_0x16fc20,null))[_0x9a59('0x31')](function(_0x7f43a){if(_0x7f43a){_0x316ea8=_0x7f43a;_0xfdfa1d[_0x9a59('0x3c')]=_[_0x9a59('0x3d')](db[_0x9a59('0x6f')]['rawAttributes']);_0xfdfa1d['query']=_[_0x9a59('0x3d')](_0x1379ba[_0x9a59('0x3e')]);_0xfdfa1d[_0x9a59('0x44')]=_['intersection'](_0xfdfa1d[_0x9a59('0x3c')],_0xfdfa1d[_0x9a59('0x3e')]);_0x246085[_0x9a59('0x40')]=_[_0x9a59('0x3f')](_0xfdfa1d[_0x9a59('0x3c')],qs[_0x9a59('0x51')](_0x1379ba[_0x9a59('0x3e')][_0x9a59('0x51')]));_0x246085['attributes']=_0x246085['attributes'][_0x9a59('0x52')]?_0x246085['attributes']:_0xfdfa1d[_0x9a59('0x3c')];_0x246085['order']=qs[_0x9a59('0x42')](_0x1379ba[_0x9a59('0x3e')][_0x9a59('0x42')]);_0x246085[_0x9a59('0x43')]=qs[_0x9a59('0x44')](_[_0x9a59('0x45')](_0x1379ba[_0x9a59('0x3e')],_0xfdfa1d[_0x9a59('0x44')]));if(_0x1379ba['query'][_0x9a59('0x46')]){_0x246085[_0x9a59('0x43')]=_[_0x9a59('0x47')](_0x246085[_0x9a59('0x43')],{'$or':_['map'](_0x246085[_0x9a59('0x40')],function(_0x2748e0){var _0xc24637={};_0xc24637[_0x2748e0]={'$like':'%'+_0x1379ba[_0x9a59('0x3e')][_0x9a59('0x46')]+'%'};return _0xc24637;})});}_0x246085=_[_0x9a59('0x47')]({},_0x246085,_0x1379ba[_0x9a59('0x54')]);return _0x316ea8[_0x9a59('0xb7')](_0x246085);}})['then'](function(_0x39a0ee){if(_0x39a0ee){_0x222557=_0x39a0ee[_0x9a59('0x52')];if(!_0x1379ba[_0x9a59('0x3e')][_0x9a59('0x64')](_0x9a59('0x6b'))){_0x246085['limit']=qs[_0x9a59('0x2c')](_0x1379ba[_0x9a59('0x3e')]['limit']);_0x246085[_0x9a59('0x2b')]=qs[_0x9a59('0x2b')](_0x1379ba['query'][_0x9a59('0x2b')]);}return _0x316ea8[_0x9a59('0xb7')](_0x246085);}})[_0x9a59('0x31')](function(_0x196656){if(_0x196656){return _0x196656?{'count':_0x222557,'rows':_0x196656}:null;}})[_0x9a59('0x31')](respondWithResult(_0x16fc20,null))['catch'](handleError(_0x16fc20,null));};exports[_0x9a59('0xb8')]=function(_0x4ee52b,_0x3261ac,_0x50d87e){var _0x3441c8={'raw':![],'where':{}};var _0x1f126f={};var _0xc8a9db={'count':0x0,'rows':[]};return db[_0x9a59('0x3a')][_0x9a59('0x62')]({'where':{'id':_0x4ee52b[_0x9a59('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3261ac,null))['then'](function(_0x5d07f4){if(_0x5d07f4){_0x1f126f[_0x9a59('0x3c')]=_['keys'](db[_0x9a59('0x9e')][_0x9a59('0x63')]);_0x1f126f[_0x9a59('0x3e')]=_[_0x9a59('0x3d')](_0x4ee52b[_0x9a59('0x3e')]);_0x1f126f[_0x9a59('0x44')]=_['intersection'](_0x1f126f[_0x9a59('0x3c')],_0x1f126f[_0x9a59('0x3e')]);_0x3441c8[_0x9a59('0x40')]=_['intersection'](_0x1f126f['model'],qs[_0x9a59('0x51')](_0x4ee52b[_0x9a59('0x3e')]['fields']));_0x3441c8[_0x9a59('0x40')]=_0x3441c8[_0x9a59('0x40')][_0x9a59('0x52')]?_0x3441c8[_0x9a59('0x40')]:_0x1f126f[_0x9a59('0x3c')];if(!_0x4ee52b[_0x9a59('0x3e')]['hasOwnProperty']('nolimit')){_0x3441c8[_0x9a59('0x2c')]=qs[_0x9a59('0x2c')](_0x4ee52b[_0x9a59('0x3e')][_0x9a59('0x2c')]);_0x3441c8[_0x9a59('0x2b')]=qs['offset'](_0x4ee52b[_0x9a59('0x3e')]['offset']);}_0x3441c8[_0x9a59('0x41')]=qs['sort'](_0x4ee52b['query']['sort']);_0x3441c8[_0x9a59('0x43')]=qs['filters'](_[_0x9a59('0x45')](_0x4ee52b[_0x9a59('0x3e')],_0x1f126f[_0x9a59('0x44')]));_0x3441c8[_0x9a59('0x43')][_0x9a59('0x65')]=_0x5d07f4['id'];if(_0x4ee52b[_0x9a59('0x3e')]['filter']){_0x3441c8[_0x9a59('0x43')]=_[_0x9a59('0x47')](_0x3441c8['where'],{'$or':_[_0x9a59('0x39')](_0x3441c8['attributes'],function(_0x238d3e){var _0xa8a0ee={};_0xa8a0ee[_0x238d3e]={'$like':'%'+_0x4ee52b[_0x9a59('0x3e')][_0x9a59('0x46')]+'%'};return _0xa8a0ee;})});}_0x3441c8=_[_0x9a59('0x47')]({},_0x3441c8,_0x4ee52b['options']);return db['SmsInteraction']['count']({'where':_0x3441c8['where']})[_0x9a59('0x31')](function(_0x2a9d90){_0xc8a9db['count']=_0x2a9d90;if(_0x4ee52b['query'][_0x9a59('0x4a')]){_0x3441c8[_0x9a59('0x53')]=[{'model':db[_0x9a59('0x98')],'as':_0x9a59('0xb9'),'required':![]},{'model':db[_0x9a59('0xba')],'as':_0x9a59('0xbb'),'attributes':[_0x9a59('0x36'),'fullname',_0x9a59('0xbc')],'required':![]},{'model':db['Tag'],'as':_0x9a59('0xbd'),'attributes':['id',_0x9a59('0x36'),'color'],'where':_0x4ee52b[_0x9a59('0x3e')]['tag']?{'id':_0x4ee52b[_0x9a59('0x3e')]['tag']}:undefined,'required':_0x4ee52b['query'][_0x9a59('0xbe')]?!![]:![]}];}return db[_0x9a59('0x9e')][_0x9a59('0x4b')](_0x3441c8);})[_0x9a59('0x31')](function(_0xbefa0a){_0xc8a9db[_0x9a59('0x4c')]=_0xbefa0a;return _0xc8a9db;});}})[_0x9a59('0x31')](respondWithFilteredResult(_0x3261ac,_0x3441c8))['catch'](handleError(_0x3261ac,null));};exports['send']=function(_0x4ed62a,_0x322f54,_0x558895){var _0x4895e2,_0x59616b,_0x2c87bc;if(_['isNil'](_0x4ed62a[_0x9a59('0x56')][_0x9a59('0x56')])||_0x4ed62a['body']['body']===''){throw new db[(_0x9a59('0x76'))][(_0x9a59('0x77'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9a59('0x93')](_0x4ed62a['body']['to'])){throw new db[(_0x9a59('0x76'))]['ValidationError'](_0x9a59('0xbf'));}_0x4895e2=_0x4ed62a[_0x9a59('0x56')]['to'];return db[_0x9a59('0x3a')][_0x9a59('0x5a')]({'where':{'id':_0x4ed62a[_0x9a59('0x4e')]['id']},'include':[{'model':db[_0x9a59('0x97')],'as':_0x9a59('0xc0'),'include':[{'model':db[_0x9a59('0x98')],'as':'Contacts','where':{'mobile':_0x4895e2},'limit':0x1,'order':[[_0x9a59('0x9a'),_0x9a59('0xc1')]]}]}]})[_0x9a59('0x31')](handleEntityNotFound(_0x322f54,null))['then'](function(_0x5e8f0f){if(_0x5e8f0f&&_0x5e8f0f['List']){_0x59616b=_0x5e8f0f[_0x9a59('0x59')]({'plain':!![]});if(_0x59616b['List']&&_0x59616b['List']['Contacts'][_0x9a59('0x52')]){return _0x59616b['List'][_0x9a59('0x99')][0x0];}return db[_0x9a59('0x98')][_0x9a59('0x55')](_[_0x9a59('0x17')](_0x4ed62a[_0x9a59('0x56')],{'firstName':_0x4895e2,'mobile':_0x4895e2,'phone':_0x4895e2,'ListId':_0x59616b['ListId']}));}})[_0x9a59('0x31')](handleEntityNotFound(_0x322f54,null))['then'](function(_0x243c4b){if(_0x243c4b){_0x2c87bc=_0x243c4b;return db[_0x9a59('0x9e')]['find']({'where':{'ContactId':_0x2c87bc['id'],'closed':![],'SmsAccountId':_0x59616b['id']}})[_0x9a59('0x31')](function(_0x6e76f2){if(_0x6e76f2){return[_0x6e76f2,![]];}return db[_0x9a59('0x9e')][_0x9a59('0x55')]({'UserId':_0x4ed62a[_0x9a59('0x58')]['id'],'ContactId':_0x2c87bc['id'],'SmsAccountId':_0x59616b['id'],'phone':_0x4895e2,'firstMsgDirection':_0x9a59('0xc2'),'Messages':[_[_0x9a59('0x47')](_0x4ed62a['body'],{'read':![],'body':_0x4ed62a['body'][_0x9a59('0x56')],'phone':_0x4895e2,'SmsAccountId':_0x59616b['id'],'UserId':_0x4ed62a[_0x9a59('0x58')]['id'],'ContactId':_0x2c87bc['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})['then'](function(_0x3ae1d1){return[_0x3ae1d1,!![]];});});}})[_0x9a59('0x9f')](function(_0xa3b048,_0x33e982){if(_0x33e982){return _0xa3b048;}return db[_0x9a59('0xa4')][_0x9a59('0x55')](_[_0x9a59('0x47')](_0x4ed62a[_0x9a59('0x56')],{'read':![],'body':_0x4ed62a['body'][_0x9a59('0x56')],'phone':_0x4895e2,'SmsAccountId':_0x59616b['id'],'SmsInteractionId':_0xa3b048['id'],'UserId':_0x4ed62a[_0x9a59('0x58')]['id'],'ContactId':_0x2c87bc['id']}))['then'](function(_0x312ab5){_0xa3b048[_0x9a59('0xc3')]['Messages']=[];_0xa3b048[_0x9a59('0xc3')]['Messages']['push'](_0x312ab5[_0x9a59('0xc3')]);return _0xa3b048;});})[_0x9a59('0x31')](respondWithResult(_0x322f54,null))[_0x9a59('0x27')](handleError(_0x322f54,null));};exports[_0x9a59('0x28')]=function(_0x249d74,_0x15397a,_0x117699){if(_0x249d74[_0x9a59('0x56')]['id']){delete _0x249d74[_0x9a59('0x56')]['id'];}var _0x4fa8fc,_0x2005e7,_0x2709cd;return db[_0x9a59('0x3a')]['find']({'where':{'id':_0x249d74['params']['id']}})[_0x9a59('0x31')](handleEntityNotFound(_0x15397a,null))[_0x9a59('0x31')](function(_0x8389d8){if(_0x8389d8){_0x2709cd=_0x8389d8;logger[_0x9a59('0xad')](_0x9a59('0x21'),_0x9a59('0x28'),_0x9a59('0xc4'),_0x8389d8[_0x9a59('0x48')],util[_0x9a59('0xc5')](_0x249d74[_0x9a59('0x56')],{'showHidden':![],'depth':null}));switch(_0x8389d8[_0x9a59('0x48')]){case _0x9a59('0x83'):if(_0x249d74[_0x9a59('0x56')][_0x9a59('0xc6')]&&_0x249d74[_0x9a59('0x56')]['status']){_0x2005e7=_0x249d74[_0x9a59('0x56')]['status'];return db[_0x9a59('0xa4')][_0x9a59('0x5a')]({'where':{'messageId':_0x249d74[_0x9a59('0x56')][_0x9a59('0xc6')]}});}break;case _0x9a59('0x85'):if(_0x249d74[_0x9a59('0x56')]['requestid']&&_0x249d74['body'][_0x9a59('0xc7')]){_0x2005e7=_0x249d74[_0x9a59('0x56')][_0x9a59('0xc7')];return db[_0x9a59('0xa4')][_0x9a59('0x5a')]({'where':{'messageId':_0x249d74['body'][_0x9a59('0xc8')]}});}break;case'clicksend':if(_0x249d74[_0x9a59('0x56')][_0x9a59('0xc9')]&&_0x249d74[_0x9a59('0x56')][_0x9a59('0xca')]){_0x2005e7=_0x249d74['body'][_0x9a59('0xca')];return db['SmsMessage']['find']({'where':{'messageId':_0x249d74[_0x9a59('0x56')][_0x9a59('0xc9')]}});}break;case'infobip':var _0x30a898=_0x249d74['body']['results'][0x0];if(_0x30a898[_0x9a59('0x81')]&&_0x30a898['status']['groupName']===_0x9a59('0xcb')){_0x2005e7=_0x30a898[_0x9a59('0x28')][_0x9a59('0xcc')];return db[_0x9a59('0xa4')]['find']({'where':{'messageId':_0x30a898[_0x9a59('0x81')]}});}break;case _0x9a59('0x8e'):if(_0x249d74[_0x9a59('0x56')]['messageId']&&_0x249d74[_0x9a59('0x56')][_0x9a59('0x28')]){_0x2005e7=_0x249d74[_0x9a59('0x56')][_0x9a59('0x28')];return db[_0x9a59('0xa4')][_0x9a59('0x5a')]({'where':{'messageId':_0x249d74[_0x9a59('0x56')]['messageId']}});}break;case'bandwidth':if(_0x249d74[_0x9a59('0x56')][0x0][_0x9a59('0x24')]['id']){_0x2005e7=_0x249d74[_0x9a59('0x56')][0x0][_0x9a59('0x48')];return db['SmsMessage'][_0x9a59('0x5a')]({'where':{'messageId':_0x249d74[_0x9a59('0x56')][0x0][_0x9a59('0x24')]['id']}});}break;case _0x9a59('0x8f'):if(_0x249d74[_0x9a59('0x56')]['redif']&&_0x249d74[_0x9a59('0x56')][_0x9a59('0x28')]){_0x2005e7=_0x249d74['body'][_0x9a59('0x28')];return db['SmsMessage'][_0x9a59('0x5a')]({'where':{'messageId':_0x249d74['body'][_0x9a59('0xcd')]}});}break;}}})[_0x9a59('0x31')](handleEntityNotFound(_0x15397a,null))[_0x9a59('0x31')](function(_0x31c1d9){if(_0x31c1d9){_0x4fa8fc=_0x31c1d9;switch(_0x2709cd[_0x9a59('0x48')]){case _0x9a59('0x83'):if(_0x2005e7==='DELIVERED'){return _0x4fa8fc['update']({'read':!![]});}else{logger['error'](_0x9a59('0x21'),_0x9a59('0x28'),_0x9a59('0x83'),util['inspect'](_0x249d74[_0x9a59('0x56')],{'showHidden':![],'depth':null}));}break;case _0x9a59('0x85'):if(_0x2005e7==='1'){return _0x4fa8fc['update']({'read':!![]});}else{logger[_0x9a59('0x23')](_0x9a59('0x21'),_0x9a59('0x28'),_0x9a59('0x83'),util[_0x9a59('0xc5')](_0x249d74['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x249d74['body'][_0x9a59('0xce')]&&_0x2005e7>=0xc8&&_0x2005e7<=0xce){return _0x4fa8fc[_0x9a59('0x30')]({'read':!![]});}else{logger['error'](_0x9a59('0x21'),_0x9a59('0x28'),_0x9a59('0x86'),util[_0x9a59('0xc5')](_0x249d74[_0x9a59('0x56')],{'showHidden':![],'depth':null}));}break;case _0x9a59('0x89'):var _0x52753d=_0x249d74[_0x9a59('0x56')][_0x9a59('0x8a')][0x0];if(_0x52753d['status'][_0x9a59('0xcc')]===_0x9a59('0xcb')){return _0x4fa8fc[_0x9a59('0x30')]({'read':!![]});}else{logger[_0x9a59('0x23')](_0x9a59('0x21'),'status',_0x9a59('0x89'),util[_0x9a59('0xc5')](_0x249d74[_0x9a59('0x56')],{'showHidden':![],'depth':null}));}break;case _0x9a59('0x8e'):if(_0x2005e7=='DELIVERED_TO_GATEWAY'||_0x2005e7==_0x9a59('0xcf')){return _0x4fa8fc['update']({'read':!![]});}else{logger[_0x9a59('0x23')](_0x9a59('0x21'),_0x9a59('0x28'),_0x9a59('0x8e'),util[_0x9a59('0xc5')](_0x249d74[_0x9a59('0x56')],{'showHidden':![],'depth':null}));}break;case _0x9a59('0xd0'):if(_0x2005e7=='message-delivered'){return _0x4fa8fc[_0x9a59('0x30')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x9a59('0x28'),_0x9a59('0xd0'),util[_0x9a59('0xc5')](_0x249d74[_0x9a59('0x56')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x2005e7===_0x9a59('0xd1')||_0x2005e7==='ACCEPTD'){return _0x4fa8fc[_0x9a59('0x30')]({'read':!![]});}else{logger[_0x9a59('0x23')](_0x9a59('0x21'),_0x9a59('0x28'),_0x9a59('0x8f'),util[_0x9a59('0xc5')](_0x249d74[_0x9a59('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x4fa8fc;}})[_0x9a59('0x31')](respondWithResult(_0x15397a,null))[_0x9a59('0x27')](handleError(_0x15397a,null));};exports[_0x9a59('0xd2')]=function(_0x22daaf,_0xcedac6,_0x5c78ee){var _0x576ab1,_0x4225ed,_0x2ce599;return db[_0x9a59('0x3a')][_0x9a59('0x5a')]({'where':{'id':_0x22daaf[_0x9a59('0x4e')]['id']}})[_0x9a59('0x31')](handleEntityNotFound(_0xcedac6,null))['then'](function(_0xfb0643){if(_0xfb0643){_0x2ce599=_0xfb0643;logger[_0x9a59('0xad')](_0x9a59('0x21'),_0x9a59('0x28'),_0x9a59('0xc4'),_0xfb0643[_0x9a59('0x48')],util['inspect'](_0x22daaf[_0x9a59('0x3e')],{'showHidden':![],'depth':null}));switch(_0xfb0643[_0x9a59('0x48')]){case _0x9a59('0x8b'):if(_0x22daaf[_0x9a59('0x3e')][_0x9a59('0xd3')]&&_0x22daaf[_0x9a59('0x3e')][_0x9a59('0xd4')]){_0x4225ed=_0x22daaf[_0x9a59('0x3e')][_0x9a59('0xd4')];return db[_0x9a59('0xa4')]['find']({'where':{'messageId':_0x22daaf['query'][_0x9a59('0xd3')]}});}break;}}})[_0x9a59('0x31')](handleEntityNotFound(_0xcedac6,null))['then'](function(_0x1f920c){if(_0x1f920c){_0x576ab1=_0x1f920c;switch(_0x2ce599[_0x9a59('0x48')]){case _0x9a59('0x8b'):if(_0x4225ed==='2'||_0x4225ed==='6'){return _0x576ab1[_0x9a59('0x30')]({'read':!![]});}else{logger['error'](_0x9a59('0x21'),'status',_0x9a59('0x8b'),util[_0x9a59('0xc5')](_0x22daaf[_0x9a59('0x3e')],{'showHidden':![],'depth':null}));};break;}return _0x576ab1;}})[_0x9a59('0x31')](respondWithResult(_0xcedac6,null))[_0x9a59('0x27')](handleError(_0xcedac6,null));};exports[_0x9a59('0xd5')]=function(_0x27d6ba,_0x101775,_0x5b29be){return db['SmsAccount'][_0x9a59('0x5a')]({'where':{'id':_0x27d6ba[_0x9a59('0x4e')]['id']}})[_0x9a59('0x31')](handleEntityNotFound(_0x101775,null))[_0x9a59('0x31')](function(_0x4027c2){if(_0x4027c2){return _0x4027c2[_0x9a59('0xd5')](_0x27d6ba[_0x9a59('0x56')][_0x9a59('0x67')],_[_0x9a59('0x9c')](_0x27d6ba[_0x9a59('0x56')],[_0x9a59('0x67'),'id'])||{})[_0x9a59('0x9f')](function(_0x1bdcb2){for(var _0x45f0d4=0x0;_0x45f0d4<_0x27d6ba['body'][_0x9a59('0x67')][_0x9a59('0x52')];_0x45f0d4+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x27d6ba[_0x9a59('0x56')][_0x9a59('0x67')][_0x45f0d4]),'SmsAccountId':Number(_0x27d6ba[_0x9a59('0x4e')]['id'])});}return _0x1bdcb2;});}})['then'](respondWithResult(_0x101775,null))[_0x9a59('0x27')](handleError(_0x101775,null));};exports[_0x9a59('0xd6')]=function(_0x244d3d,_0x5b5754,_0x51169c){return db['SmsAccount'][_0x9a59('0x5a')]({'where':{'id':_0x244d3d[_0x9a59('0x4e')]['id']}})[_0x9a59('0x31')](handleEntityNotFound(_0x5b5754,null))[_0x9a59('0x31')](function(_0xcd9884){if(_0xcd9884){return _0xcd9884[_0x9a59('0xd6')](_0x244d3d[_0x9a59('0x3e')]['ids'])[_0x9a59('0x31')](function(){if(_[_0x9a59('0xd7')](_0x244d3d[_0x9a59('0x3e')][_0x9a59('0x67')])){for(var _0x48e1b5=0x0;_0x48e1b5<_0x244d3d['query']['ids'][_0x9a59('0x52')];_0x48e1b5+=0x1){socket[_0x9a59('0xd8')](_0x9a59('0xd9'),{'UserId':Number(_0x244d3d[_0x9a59('0x3e')][_0x9a59('0x67')][_0x48e1b5]),'SmsAccountId':Number(_0x244d3d[_0x9a59('0x4e')]['id'])});}}else{socket[_0x9a59('0xd8')]('userSmsAccount:remove',{'UserId':Number(_0x244d3d['query']['ids']),'SmsAccountId':Number(_0x244d3d[_0x9a59('0x4e')]['id'])});}});}})[_0x9a59('0x31')](respondWithStatusCode(_0x5b5754,null))['catch'](handleError(_0x5b5754,null));};exports[_0x9a59('0xda')]=function(_0x5cee67,_0x42b840,_0x4ff641){var _0x2ba68a={};var _0x92c833={};var _0xe4bb40;var _0xd9739b;return db[_0x9a59('0x3a')]['findOne']({'where':{'id':_0x5cee67[_0x9a59('0x4e')]['id']}})[_0x9a59('0x31')](handleEntityNotFound(_0x42b840,null))[_0x9a59('0x31')](function(_0x1a5336){if(_0x1a5336){_0xe4bb40=_0x1a5336;_0x92c833[_0x9a59('0x3c')]=_[_0x9a59('0x3d')](db['User'][_0x9a59('0x63')]);_0x92c833[_0x9a59('0x3e')]=_['keys'](_0x5cee67['query']);_0x92c833[_0x9a59('0x44')]=_[_0x9a59('0x3f')](_0x92c833[_0x9a59('0x3c')],_0x92c833[_0x9a59('0x3e')]);_0x2ba68a[_0x9a59('0x40')]=_[_0x9a59('0x3f')](_0x92c833[_0x9a59('0x3c')],qs['fields'](_0x5cee67[_0x9a59('0x3e')][_0x9a59('0x51')]));_0x2ba68a[_0x9a59('0x40')]=_0x2ba68a['attributes'][_0x9a59('0x52')]?_0x2ba68a[_0x9a59('0x40')]:_0x92c833['model'];_0x2ba68a[_0x9a59('0x41')]=qs[_0x9a59('0x42')](_0x5cee67[_0x9a59('0x3e')][_0x9a59('0x42')]);_0x2ba68a[_0x9a59('0x43')]=qs[_0x9a59('0x44')](_[_0x9a59('0x45')](_0x5cee67[_0x9a59('0x3e')],_0x92c833[_0x9a59('0x44')]));if(_0x5cee67['query'][_0x9a59('0x46')]){_0x2ba68a[_0x9a59('0x43')]=_[_0x9a59('0x47')](_0x2ba68a[_0x9a59('0x43')],{'$or':_[_0x9a59('0x39')](_0x2ba68a['attributes'],function(_0x201f61){var _0x347353={};_0x347353[_0x201f61]={'$like':'%'+_0x5cee67[_0x9a59('0x3e')][_0x9a59('0x46')]+'%'};return _0x347353;})});}_0x2ba68a=_[_0x9a59('0x47')]({},_0x2ba68a,_0x5cee67['options']);return _0xe4bb40[_0x9a59('0xda')](_0x2ba68a);}})[_0x9a59('0x31')](function(_0x55bdc2){if(_0x55bdc2){_0xd9739b=_0x55bdc2[_0x9a59('0x52')];if(!_0x5cee67['query'][_0x9a59('0x64')](_0x9a59('0x6b'))){_0x2ba68a[_0x9a59('0x2c')]=qs[_0x9a59('0x2c')](_0x5cee67[_0x9a59('0x3e')]['limit']);_0x2ba68a[_0x9a59('0x2b')]=qs[_0x9a59('0x2b')](_0x5cee67['query'][_0x9a59('0x2b')]);}return _0xe4bb40[_0x9a59('0xda')](_0x2ba68a);}})['then'](function(_0xdbd8f1){if(_0xdbd8f1){return _0xdbd8f1?{'count':_0xd9739b,'rows':_0xdbd8f1}:null;}})[_0x9a59('0x31')](respondWithResult(_0x42b840,null))['catch'](handleError(_0x42b840,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 2337f1f..f7bbad5 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 _0xc407=['events','../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5c42bd,_0x45b22b){var _0x5b3ea2=function(_0xd028cf){while(--_0xd028cf){_0x5c42bd['push'](_0x5c42bd['shift']());}};_0x5b3ea2(++_0x45b22b);}(_0xc407,0x1d8));var _0x7c40=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xc407[_0x465028];return _0xb783d4;};'use strict';var EventEmitter=require(_0x7c40('0x0'));var SmsAccount=require(_0x7c40('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x7c40('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7c40('0x3')};function emitEvent(_0x225fb7){return function(_0x140c2f,_0x583e03,_0x1d6d69){SmsAccountEvents[_0x7c40('0x4')](_0x225fb7+':'+_0x140c2f['id'],_0x140c2f);SmsAccountEvents[_0x7c40('0x4')](_0x225fb7,_0x140c2f);_0x1d6d69(null);};}for(var e in events){if(events[_0x7c40('0x5')](e)){var event=events[e];SmsAccount[_0x7c40('0x6')](e,emitEvent(event));}}module[_0x7c40('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0x4639=['hook','events','../../mysqldb','setMaxListeners','save','emit'];(function(_0x2b954b,_0x301ea9){var _0x2a9f5d=function(_0x2988f4){while(--_0x2988f4){_0x2b954b['push'](_0x2b954b['shift']());}};_0x2a9f5d(++_0x301ea9);}(_0x4639,0x1b7));var _0x9463=function(_0x545f6d,_0x16c27e){_0x545f6d=_0x545f6d-0x0;var _0x594012=_0x4639[_0x545f6d];return _0x594012;};'use strict';var EventEmitter=require(_0x9463('0x0'));var SmsAccount=require(_0x9463('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x9463('0x2')](0x0);var events={'afterCreate':_0x9463('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1095d2){return function(_0x242d3e,_0x460fe7,_0xf721c2){SmsAccountEvents['emit'](_0x1095d2+':'+_0x242d3e['id'],_0x242d3e);SmsAccountEvents[_0x9463('0x4')](_0x1095d2,_0x242d3e);_0xf721c2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x9463('0x5')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 1180f0c..5e02ce5 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 _0xc190=['path','rimraf','../../config/environment','exports','define','SmsAccount','lodash','util','api','moment','bluebird','request-promise'];(function(_0x435b1f,_0x1d2b9c){var _0x2a482c=function(_0x248c60){while(--_0x248c60){_0x435b1f['push'](_0x435b1f['shift']());}};_0x2a482c(++_0x1d2b9c);}(_0xc190,0x8a));var _0x0c19=function(_0x470ce2,_0x4b3815){_0x470ce2=_0x470ce2-0x0;var _0x739076=_0xc190[_0x470ce2];return _0x739076;};'use strict';var _=require(_0x0c19('0x0'));var util=require(_0x0c19('0x1'));var logger=require('../../config/logger')(_0x0c19('0x2'));var moment=require(_0x0c19('0x3'));var BPromise=require(_0x0c19('0x4'));var rp=require(_0x0c19('0x5'));var fs=require('fs');var path=require(_0x0c19('0x6'));var rimraf=require(_0x0c19('0x7'));var config=require(_0x0c19('0x8'));var attributes=require('./smsAccount.attributes');module[_0x0c19('0x9')]=function(_0xe4b853,_0x41ac2e){return _0xe4b853[_0x0c19('0xa')](_0x0c19('0xb'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf1c1=['rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','util','api','moment','request-promise','path'];(function(_0x59533a,_0x246b94){var _0x23511a=function(_0x366c2e){while(--_0x366c2e){_0x59533a['push'](_0x59533a['shift']());}};_0x23511a(++_0x246b94);}(_0xf1c1,0x157));var _0x1f1c=function(_0x45158e,_0x2e0642){_0x45158e=_0x45158e-0x0;var _0x3abfff=_0xf1c1[_0x45158e];return _0x3abfff;};'use strict';var _=require('lodash');var util=require(_0x1f1c('0x0'));var logger=require('../../config/logger')(_0x1f1c('0x1'));var moment=require(_0x1f1c('0x2'));var BPromise=require('bluebird');var rp=require(_0x1f1c('0x3'));var fs=require('fs');var path=require(_0x1f1c('0x4'));var rimraf=require(_0x1f1c('0x5'));var config=require(_0x1f1c('0x6'));var attributes=require(_0x1f1c('0x7'));module[_0x1f1c('0x8')]=function(_0x5d8e2e,_0x476a99){return _0x5d8e2e[_0x1f1c('0x9')](_0x1f1c('0xa'),attributes,{'tableName':_0x1f1c('0xb'),'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 fbc3a14..0227fce 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 _0x340d=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSmsAccount','find','options','where','attributes','include','map','model','then','debug','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x1237b5,_0x4786ad){var _0x5a2b68=function(_0x369986){while(--_0x369986){_0x1237b5['push'](_0x1237b5['shift']());}};_0x5a2b68(++_0x4786ad);}(_0x340d,0x13d));var _0xd340=function(_0x380ea0,_0x10cb3c){_0x380ea0=_0x380ea0-0x0;var _0x5e71ce=_0x340d[_0x380ea0];return _0x5e71ce;};'use strict';var _=require(_0xd340('0x0'));var util=require(_0xd340('0x1'));var moment=require('moment');var BPromise=require(_0xd340('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd340('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd340('0x4'))(_0xd340('0x5'));var config=require(_0xd340('0x6'));var jayson=require(_0xd340('0x7'));var client=jayson[_0xd340('0x8')][_0xd340('0x9')]({'port':0x232a});config[_0xd340('0xa')]=_[_0xd340('0xb')](config['redis'],{'host':_0xd340('0xc'),'port':0x18eb});var socket=require(_0xd340('0xd'))(new Redis(config[_0xd340('0xa')]));require(_0xd340('0xe'))[_0xd340('0xf')](socket);function respondWithRpcPromise(_0x53343e,_0x334cde,_0x249c02){return new BPromise(function(_0x2576e7,_0x37aebd){return client['request'](_0x53343e,_0x249c02)['then'](function(_0x40d0f4){logger['info'](_0xd340('0x10'),_0x334cde,_0xd340('0x11'));logger['debug'](_0xd340('0x12'),_0x334cde,_0xd340('0x11'),JSON[_0xd340('0x13')](_0x40d0f4));if(_0x40d0f4[_0xd340('0x14')]){if(_0x40d0f4[_0xd340('0x14')][_0xd340('0x15')]===0x1f4){logger[_0xd340('0x14')](_0xd340('0x10'),_0x334cde,_0x40d0f4[_0xd340('0x14')]['message']);return _0x37aebd(_0x40d0f4[_0xd340('0x14')][_0xd340('0x16')]);}logger[_0xd340('0x14')](_0xd340('0x10'),_0x334cde,_0x40d0f4[_0xd340('0x14')][_0xd340('0x16')]);return _0x2576e7(_0x40d0f4[_0xd340('0x14')][_0xd340('0x16')]);}else{logger[_0xd340('0x17')](_0xd340('0x10'),_0x334cde,'request\x20sent');_0x2576e7(_0x40d0f4[_0xd340('0x18')]['message']);}})[_0xd340('0x19')](function(_0x217ead){logger['error'](_0xd340('0x10'),_0x334cde,_0x217ead);_0x37aebd(_0x217ead);});});}exports[_0xd340('0x1a')]=function(_0x19fc11){var _0x389e47=this;return new Promise(function(_0x304586,_0x3d8ab1){return db['SmsAccount'][_0xd340('0x1b')]({'raw':_0x19fc11[_0xd340('0x1c')]?_0x19fc11[_0xd340('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x19fc11[_0xd340('0x1c')]?_0x19fc11[_0xd340('0x1c')][_0xd340('0x1d')]||null:null,'attributes':_0x19fc11[_0xd340('0x1c')]?_0x19fc11[_0xd340('0x1c')][_0xd340('0x1e')]||null:null,'include':_0x19fc11[_0xd340('0x1c')]?_0x19fc11[_0xd340('0x1c')][_0xd340('0x1f')]?_[_0xd340('0x20')](_0x19fc11['options'][_0xd340('0x1f')],function(_0xf96cc8){return{'model':db[_0xf96cc8[_0xd340('0x21')]],'as':_0xf96cc8['as'],'attributes':_0xf96cc8[_0xd340('0x1e')],'include':_0xf96cc8[_0xd340('0x1f')]?_['map'](_0xf96cc8['include'],function(_0x59c44b){return{'model':db[_0x59c44b[_0xd340('0x21')]],'as':_0x59c44b['as'],'attributes':_0x59c44b['attributes'],'include':_0x59c44b[_0xd340('0x1f')]?_[_0xd340('0x20')](_0x59c44b[_0xd340('0x1f')],function(_0x4fa44a){return{'model':db[_0x4fa44a['model']],'as':_0x4fa44a['as'],'attributes':_0x4fa44a[_0xd340('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd340('0x22')](function(_0x155ba2){logger['info'](_0xd340('0x1a'),_0x19fc11);logger[_0xd340('0x23')](_0xd340('0x1a'),_0x19fc11,JSON[_0xd340('0x13')](_0x155ba2));_0x304586(_0x155ba2);})[_0xd340('0x19')](function(_0x2b1543){logger[_0xd340('0x14')]('ShowSmsAccount',_0x2b1543['message'],_0x19fc11);_0x3d8ab1(_0x389e47['error'](0x1f4,_0x2b1543['message']));});});}; \ No newline at end of file +var _0x89bf=['include','map','model','info','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','SmsAccount,\x20%s,\x20%s','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x89bf,0x1e6));var _0xf89b=function(_0x17fa7f,_0x417958){_0x17fa7f=_0x17fa7f-0x0;var _0x2ce71f=_0x89bf[_0x17fa7f];return _0x2ce71f;};'use strict';var _=require(_0xf89b('0x0'));var util=require('util');var moment=require(_0xf89b('0x1'));var BPromise=require(_0xf89b('0x2'));var rs=require(_0xf89b('0x3'));var fs=require('fs');var Redis=require(_0xf89b('0x4'));var db=require(_0xf89b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf89b('0x6'))(_0xf89b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf89b('0x8')][_0xf89b('0x9')]({'port':0x232a});config[_0xf89b('0xa')]=_[_0xf89b('0xb')](config['redis'],{'host':_0xf89b('0xc'),'port':0x18eb});var socket=require(_0xf89b('0xd'))(new Redis(config['redis']));require(_0xf89b('0xe'))[_0xf89b('0xf')](socket);function respondWithRpcPromise(_0x1fcdd5,_0x2e5588,_0x59d898){return new BPromise(function(_0x43faa2,_0x20b25a){return client[_0xf89b('0x10')](_0x1fcdd5,_0x59d898)['then'](function(_0x52481a){logger['info']('SmsAccount,\x20%s,\x20%s',_0x2e5588,'request\x20sent');logger[_0xf89b('0x11')](_0xf89b('0x12'),_0x2e5588,_0xf89b('0x13'),JSON['stringify'](_0x52481a));if(_0x52481a[_0xf89b('0x14')]){if(_0x52481a['error']['code']===0x1f4){logger[_0xf89b('0x14')](_0xf89b('0x15'),_0x2e5588,_0x52481a[_0xf89b('0x14')][_0xf89b('0x16')]);return _0x20b25a(_0x52481a[_0xf89b('0x14')][_0xf89b('0x16')]);}logger['error'](_0xf89b('0x15'),_0x2e5588,_0x52481a[_0xf89b('0x14')][_0xf89b('0x16')]);return _0x43faa2(_0x52481a[_0xf89b('0x14')][_0xf89b('0x16')]);}else{logger['info'](_0xf89b('0x15'),_0x2e5588,_0xf89b('0x13'));_0x43faa2(_0x52481a[_0xf89b('0x17')][_0xf89b('0x16')]);}})[_0xf89b('0x18')](function(_0x556841){logger[_0xf89b('0x14')]('SmsAccount,\x20%s,\x20%s',_0x2e5588,_0x556841);_0x20b25a(_0x556841);});});}exports[_0xf89b('0x19')]=function(_0x2fa7e9){var _0xd0c102=this;return new Promise(function(_0x125c72,_0x4ed814){return db[_0xf89b('0x1a')][_0xf89b('0x1b')]({'raw':_0x2fa7e9[_0xf89b('0x1c')]?_0x2fa7e9['options'][_0xf89b('0x1d')]===undefined?!![]:![]:!![],'where':_0x2fa7e9[_0xf89b('0x1c')]?_0x2fa7e9[_0xf89b('0x1c')][_0xf89b('0x1e')]||null:null,'attributes':_0x2fa7e9['options']?_0x2fa7e9[_0xf89b('0x1c')][_0xf89b('0x1f')]||null:null,'include':_0x2fa7e9[_0xf89b('0x1c')]?_0x2fa7e9[_0xf89b('0x1c')][_0xf89b('0x20')]?_[_0xf89b('0x21')](_0x2fa7e9[_0xf89b('0x1c')][_0xf89b('0x20')],function(_0x2bea6b){return{'model':db[_0x2bea6b[_0xf89b('0x22')]],'as':_0x2bea6b['as'],'attributes':_0x2bea6b[_0xf89b('0x1f')],'include':_0x2bea6b[_0xf89b('0x20')]?_['map'](_0x2bea6b[_0xf89b('0x20')],function(_0x58bafc){return{'model':db[_0x58bafc[_0xf89b('0x22')]],'as':_0x58bafc['as'],'attributes':_0x58bafc[_0xf89b('0x1f')],'include':_0x58bafc[_0xf89b('0x20')]?_[_0xf89b('0x21')](_0x58bafc[_0xf89b('0x20')],function(_0x36dd09){return{'model':db[_0x36dd09[_0xf89b('0x22')]],'as':_0x36dd09['as'],'attributes':_0x36dd09['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e64a6){logger[_0xf89b('0x23')](_0xf89b('0x19'),_0x2fa7e9);logger[_0xf89b('0x11')](_0xf89b('0x19'),_0x2fa7e9,JSON[_0xf89b('0x24')](_0x1e64a6));_0x125c72(_0x1e64a6);})[_0xf89b('0x18')](function(_0x451b9b){logger[_0xf89b('0x14')](_0xf89b('0x19'),_0x451b9b[_0xf89b('0x16')],_0x2fa7e9);_0x4ed814(_0xd0c102[_0xf89b('0x14')](0x1f4,_0x451b9b['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index e35c6db..690f59a 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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 faf3009..5976f29 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_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('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 _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x43409f,_0x381529){var _0x4e71cc=function(_0x32c876){while(--_0x32c876){_0x43409f['push'](_0x43409f['shift']());}};_0x4e71cc(++_0x381529);}(_0xedd9,0xfc));var _0x9edd=function(_0x4c16c4,_0x1f4fb2){_0x4c16c4=_0x4c16c4-0x0;var _0x2d2ddf=_0xedd9[_0x4c16c4];return _0x2d2ddf;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 1543ebe..26827a2 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 _0xe3c5=['sequelize','exports','STRING','noop','TEXT'];(function(_0x50f92b,_0x59b5fe){var _0x192945=function(_0x1d8c88){while(--_0x1d8c88){_0x50f92b['push'](_0x50f92b['shift']());}};_0x192945(++_0x59b5fe);}(_0xe3c5,0xd2));var _0x5e3c=function(_0x470212,_0x1387de){_0x470212=_0x470212-0x0;var _0x5083cb=_0xe3c5[_0x470212];return _0x5083cb;};'use strict';var Sequelize=require(_0x5e3c('0x0'));module[_0x5e3c('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5e3c('0x2')],'allowNull':![],'defaultValue':_0x5e3c('0x3')},'appdata':{'type':Sequelize[_0x5e3c('0x4')]()},'description':{'type':Sequelize[_0x5e3c('0x2')]},'interval':{'type':Sequelize[_0x5e3c('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xf36b=['sequelize','INTEGER','STRING','noop','*,*,*,*'];(function(_0x5c0dd3,_0x121bea){var _0x428248=function(_0x25a209){while(--_0x25a209){_0x5c0dd3['push'](_0x5c0dd3['shift']());}};_0x428248(++_0x121bea);}(_0xf36b,0x122));var _0xbf36=function(_0x2ee185,_0x51c0ab){_0x2ee185=_0x2ee185-0x0;var _0x474975=_0xf36b[_0x2ee185];return _0x474975;};'use strict';var Sequelize=require(_0xbf36('0x0'));module['exports']={'priority':{'type':Sequelize[_0xbf36('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xbf36('0x2')],'allowNull':![],'defaultValue':_0xbf36('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbf36('0x2')],'defaultValue':_0xbf36('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 0c89365..273040f 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 _0x99c0=['SmsApplication','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','crypto','jsforce','to-csv','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','limit','undefined','count','set','Content-Range','apply','reject','update','then','name','send','index'];(function(_0x504296,_0x2f7e2e){var _0x5e8e99=function(_0xc8be69){while(--_0xc8be69){_0x504296['push'](_0x504296['shift']());}};_0x5e8e99(++_0x2f7e2e);}(_0x99c0,0x140));var _0x099c=function(_0x2d95d9,_0x13fab6){_0x2d95d9=_0x2d95d9-0x0;var _0xba7b6e=_0x99c0[_0x2d95d9];return _0xba7b6e;};'use strict';var emlformat=require(_0x099c('0x0'));var rimraf=require(_0x099c('0x1'));var zipdir=require(_0x099c('0x2'));var jsonpatch=require(_0x099c('0x3'));var rp=require(_0x099c('0x4'));var moment=require(_0x099c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x099c('0x6'));var util=require(_0x099c('0x7'));var path=require(_0x099c('0x8'));var sox=require(_0x099c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x099c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x099c('0xb'));var jsforce=require(_0x099c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x099c('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x099c('0xe'));var authService=require(_0x099c('0xf'));var qs=require(_0x099c('0x10'));var as=require(_0x099c('0x11'));var hardwareService=require(_0x099c('0x12'));var logger=require('../../config/logger')(_0x099c('0x13'));var utils=require(_0x099c('0x14'));var config=require(_0x099c('0x15'));var licenseUtil=require(_0x099c('0x16'));var db=require(_0x099c('0x17'))['db'];function respondWithStatusCode(_0x2e4bd9,_0x20c934){_0x20c934=_0x20c934||0xcc;return function(_0x149988){if(_0x149988){return _0x2e4bd9[_0x099c('0x18')](_0x20c934);}return _0x2e4bd9['status'](_0x20c934)['end']();};}function respondWithResult(_0x5e6e08,_0x82049b){_0x82049b=_0x82049b||0xc8;return function(_0x4d7a70){if(_0x4d7a70){return _0x5e6e08[_0x099c('0x19')](_0x82049b)[_0x099c('0x1a')](_0x4d7a70);}};}function respondWithFilteredResult(_0x512e47,_0x2bb9cc){return function(_0x5d7e45){if(_0x5d7e45){var _0x38277b=typeof _0x2bb9cc[_0x099c('0x1b')]==='undefined'&&typeof _0x2bb9cc[_0x099c('0x1c')]===_0x099c('0x1d');var _0x5f56df=_0x5d7e45[_0x099c('0x1e')];var _0x3e1d78=_0x38277b?0x0:_0x2bb9cc[_0x099c('0x1b')];var _0x39ae71=_0x38277b?_0x5d7e45[_0x099c('0x1e')]:_0x2bb9cc[_0x099c('0x1b')]+_0x2bb9cc['limit'];var _0x5b9c91;if(_0x39ae71>=_0x5f56df){_0x39ae71=_0x5f56df;_0x5b9c91=0xc8;}else{_0x5b9c91=0xce;}_0x512e47[_0x099c('0x19')](_0x5b9c91);return _0x512e47[_0x099c('0x1f')](_0x099c('0x20'),_0x3e1d78+'-'+_0x39ae71+'/'+_0x5f56df)[_0x099c('0x1a')](_0x5d7e45);}return null;};}function patchUpdates(_0x2e09c7){return function(_0x956845){try{jsonpatch[_0x099c('0x21')](_0x956845,_0x2e09c7,!![]);}catch(_0x51f745){return BPromise[_0x099c('0x22')](_0x51f745);}return _0x956845['save']();};}function saveUpdates(_0x51f6b6,_0xa9ff28){return function(_0x138d2d){if(_0x138d2d){return _0x138d2d[_0x099c('0x23')](_0x51f6b6)[_0x099c('0x24')](function(_0x33e3ec){return _0x33e3ec;});}return null;};}function removeEntity(_0x564f7f,_0x2f77f7){return function(_0x276834){if(_0x276834){return _0x276834['destroy']()[_0x099c('0x24')](function(){_0x564f7f[_0x099c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c5c76,_0x29fff5){return function(_0x16c653){if(!_0x16c653){_0x4c5c76[_0x099c('0x18')](0x194);}return _0x16c653;};}function handleError(_0x3243f0,_0xb88dea){_0xb88dea=_0xb88dea||0x1f4;return function(_0x5ecf61){logger['error'](_0x5ecf61['stack']);if(_0x5ecf61[_0x099c('0x25')]){delete _0x5ecf61['name'];}_0x3243f0[_0x099c('0x19')](_0xb88dea)[_0x099c('0x26')](_0x5ecf61);};}exports[_0x099c('0x27')]=function(_0x44eab3,_0x218107){var _0x35a7eb={},_0xed5b95={},_0xfc794={'count':0x0,'rows':[]};var _0x1f90c7=_['map'](db[_0x099c('0x28')]['rawAttributes'],function(_0x33acb6){return{'name':_0x33acb6[_0x099c('0x29')],'type':_0x33acb6[_0x099c('0x2a')]['key']};});_0xed5b95[_0x099c('0x2b')]=_[_0x099c('0x2c')](_0x1f90c7,_0x099c('0x25'));_0xed5b95[_0x099c('0x2d')]=_[_0x099c('0x2e')](_0x44eab3[_0x099c('0x2d')]);_0xed5b95[_0x099c('0x2f')]=_[_0x099c('0x30')](_0xed5b95[_0x099c('0x2b')],_0xed5b95['query']);_0x35a7eb[_0x099c('0x31')]=_[_0x099c('0x30')](_0xed5b95['model'],qs['fields'](_0x44eab3[_0x099c('0x2d')][_0x099c('0x32')]));_0x35a7eb[_0x099c('0x31')]=_0x35a7eb[_0x099c('0x31')][_0x099c('0x33')]?_0x35a7eb[_0x099c('0x31')]:_0xed5b95['model'];if(!_0x44eab3[_0x099c('0x2d')][_0x099c('0x34')](_0x099c('0x35'))){_0x35a7eb[_0x099c('0x1c')]=qs[_0x099c('0x1c')](_0x44eab3[_0x099c('0x2d')][_0x099c('0x1c')]);_0x35a7eb['offset']=qs[_0x099c('0x1b')](_0x44eab3[_0x099c('0x2d')][_0x099c('0x1b')]);}_0x35a7eb['order']=qs['sort'](_0x44eab3[_0x099c('0x2d')][_0x099c('0x36')]);_0x35a7eb[_0x099c('0x37')]=qs[_0x099c('0x2f')](_['pick'](_0x44eab3[_0x099c('0x2d')],_0xed5b95[_0x099c('0x2f')]),_0x1f90c7);if(_0x44eab3[_0x099c('0x2d')][_0x099c('0x38')]){_0x35a7eb['where']=_[_0x099c('0x39')](_0x35a7eb['where'],{'$or':_[_0x099c('0x2c')](_0x1f90c7,function(_0x5db15e){if(_0x5db15e[_0x099c('0x2a')]!==_0x099c('0x3a')){var _0x5d3de9={};_0x5d3de9[_0x5db15e['name']]={'$like':'%'+_0x44eab3[_0x099c('0x2d')][_0x099c('0x38')]+'%'};return _0x5d3de9;}})});}_0x35a7eb=_[_0x099c('0x39')]({},_0x35a7eb,_0x44eab3[_0x099c('0x3b')]);var _0xacfba2={'where':_0x35a7eb[_0x099c('0x37')]};return db[_0x099c('0x28')]['count'](_0xacfba2)[_0x099c('0x24')](function(_0x500b5f){_0xfc794['count']=_0x500b5f;if(_0x44eab3[_0x099c('0x2d')][_0x099c('0x3c')]){_0x35a7eb[_0x099c('0x3d')]=[{'all':!![]}];}return db[_0x099c('0x28')][_0x099c('0x3e')](_0x35a7eb);})[_0x099c('0x24')](function(_0x2d857c){_0xfc794[_0x099c('0x3f')]=_0x2d857c;return _0xfc794;})[_0x099c('0x24')](respondWithFilteredResult(_0x218107,_0x35a7eb))[_0x099c('0x40')](handleError(_0x218107,null));};exports[_0x099c('0x41')]=function(_0x58871b,_0x334355){var _0x539df9={'raw':!![],'where':{'id':_0x58871b[_0x099c('0x42')]['id']}},_0x2878a3={};_0x2878a3['model']=_['keys'](db['SmsApplication'][_0x099c('0x43')]);_0x2878a3[_0x099c('0x2d')]=_[_0x099c('0x2e')](_0x58871b['query']);_0x2878a3[_0x099c('0x2f')]=_[_0x099c('0x30')](_0x2878a3[_0x099c('0x2b')],_0x2878a3[_0x099c('0x2d')]);_0x539df9[_0x099c('0x31')]=_[_0x099c('0x30')](_0x2878a3[_0x099c('0x2b')],qs[_0x099c('0x32')](_0x58871b[_0x099c('0x2d')][_0x099c('0x32')]));_0x539df9['attributes']=_0x539df9[_0x099c('0x31')][_0x099c('0x33')]?_0x539df9[_0x099c('0x31')]:_0x2878a3[_0x099c('0x2b')];if(_0x58871b['query'][_0x099c('0x3c')]){_0x539df9[_0x099c('0x3d')]=[{'all':!![]}];}_0x539df9=_[_0x099c('0x39')]({},_0x539df9,_0x58871b[_0x099c('0x3b')]);return db[_0x099c('0x28')][_0x099c('0x44')](_0x539df9)[_0x099c('0x24')](handleEntityNotFound(_0x334355,null))[_0x099c('0x24')](respondWithResult(_0x334355,null))['catch'](handleError(_0x334355,null));};exports[_0x099c('0x45')]=function(_0xb9e621,_0x420921){return db[_0x099c('0x28')][_0x099c('0x45')](_0xb9e621[_0x099c('0x46')],{})[_0x099c('0x24')](respondWithResult(_0x420921,0xc9))['catch'](handleError(_0x420921,null));};exports[_0x099c('0x23')]=function(_0x4d0478,_0x3446e2){if(_0x4d0478[_0x099c('0x46')]['id']){delete _0x4d0478[_0x099c('0x46')]['id'];}return db[_0x099c('0x28')][_0x099c('0x44')]({'where':{'id':_0x4d0478[_0x099c('0x42')]['id']}})[_0x099c('0x24')](handleEntityNotFound(_0x3446e2,null))[_0x099c('0x24')](saveUpdates(_0x4d0478[_0x099c('0x46')],null))['then'](respondWithResult(_0x3446e2,null))[_0x099c('0x40')](handleError(_0x3446e2,null));};exports[_0x099c('0x47')]=function(_0x536181,_0x2f1ffd){return db['SmsApplication']['find']({'where':{'id':_0x536181['params']['id']}})[_0x099c('0x24')](handleEntityNotFound(_0x2f1ffd,null))[_0x099c('0x24')](removeEntity(_0x2f1ffd,null))[_0x099c('0x40')](handleError(_0x2f1ffd,null));}; \ No newline at end of file +var _0x988b=['VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','fs-extra','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','update','destroy','then','stack','name','send','index','map','SmsApplication','fieldName','key','query','intersection','model','attributes','fields','length','nolimit','sort','filters','pick','filter','where','merge','type'];(function(_0x4a6df7,_0x5a7cf0){var _0x392744=function(_0x57e6e5){while(--_0x57e6e5){_0x4a6df7['push'](_0x4a6df7['shift']());}};_0x392744(++_0x5a7cf0);}(_0x988b,0x125));var _0xb988=function(_0x38c3c4,_0x22fa29){_0x38c3c4=_0x38c3c4-0x0;var _0x2cf445=_0x988b[_0x38c3c4];return _0x2cf445;};'use strict';var emlformat=require(_0xb988('0x0'));var rimraf=require(_0xb988('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb988('0x2'));var rp=require(_0xb988('0x3'));var moment=require('moment');var BPromise=require(_0xb988('0x4'));var Mustache=require(_0xb988('0x5'));var util=require('util');var path=require('path');var sox=require(_0xb988('0x6'));var csv=require(_0xb988('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb988('0x8'));var _=require(_0xb988('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb988('0xa'));var toCsv=require(_0xb988('0x7'));var querystring=require(_0xb988('0xb'));var Papa=require('papaparse');var Redis=require(_0xb988('0xc'));var authService=require(_0xb988('0xd'));var qs=require(_0xb988('0xe'));var as=require(_0xb988('0xf'));var hardwareService=require(_0xb988('0x10'));var logger=require('../../config/logger')(_0xb988('0x11'));var utils=require(_0xb988('0x12'));var config=require(_0xb988('0x13'));var licenseUtil=require(_0xb988('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56000a,_0x340128){_0x340128=_0x340128||0xcc;return function(_0x210004){if(_0x210004){return _0x56000a[_0xb988('0x15')](_0x340128);}return _0x56000a[_0xb988('0x16')](_0x340128)[_0xb988('0x17')]();};}function respondWithResult(_0x16db25,_0x3e5220){_0x3e5220=_0x3e5220||0xc8;return function(_0x48e687){if(_0x48e687){return _0x16db25['status'](_0x3e5220)['json'](_0x48e687);}};}function respondWithFilteredResult(_0x50c151,_0x33c1eb){return function(_0xcffea9){if(_0xcffea9){var _0x2c8d1c=typeof _0x33c1eb[_0xb988('0x18')]===_0xb988('0x19')&&typeof _0x33c1eb['limit']===_0xb988('0x19');var _0x50f140=_0xcffea9[_0xb988('0x1a')];var _0x5ce6b8=_0x2c8d1c?0x0:_0x33c1eb[_0xb988('0x18')];var _0x3c5c2e=_0x2c8d1c?_0xcffea9[_0xb988('0x1a')]:_0x33c1eb[_0xb988('0x18')]+_0x33c1eb[_0xb988('0x1b')];var _0x4ce92c;if(_0x3c5c2e>=_0x50f140){_0x3c5c2e=_0x50f140;_0x4ce92c=0xc8;}else{_0x4ce92c=0xce;}_0x50c151[_0xb988('0x16')](_0x4ce92c);return _0x50c151[_0xb988('0x1c')](_0xb988('0x1d'),_0x5ce6b8+'-'+_0x3c5c2e+'/'+_0x50f140)[_0xb988('0x1e')](_0xcffea9);}return null;};}function patchUpdates(_0x3d66af){return function(_0x34f7fa){try{jsonpatch['apply'](_0x34f7fa,_0x3d66af,!![]);}catch(_0x5afc5f){return BPromise[_0xb988('0x1f')](_0x5afc5f);}return _0x34f7fa['save']();};}function saveUpdates(_0x56fa1d,_0x12317e){return function(_0x30b053){if(_0x30b053){return _0x30b053[_0xb988('0x20')](_0x56fa1d)['then'](function(_0x2c9684){return _0x2c9684;});}return null;};}function removeEntity(_0x3a4ea7,_0x2481c0){return function(_0x53db49){if(_0x53db49){return _0x53db49[_0xb988('0x21')]()[_0xb988('0x22')](function(){_0x3a4ea7['status'](0xcc)[_0xb988('0x17')]();});}};}function handleEntityNotFound(_0x37bd05,_0x345a28){return function(_0x51cae8){if(!_0x51cae8){_0x37bd05['sendStatus'](0x194);}return _0x51cae8;};}function handleError(_0xc64a65,_0x555205){_0x555205=_0x555205||0x1f4;return function(_0x3a9c2d){logger['error'](_0x3a9c2d[_0xb988('0x23')]);if(_0x3a9c2d[_0xb988('0x24')]){delete _0x3a9c2d[_0xb988('0x24')];}_0xc64a65['status'](_0x555205)[_0xb988('0x25')](_0x3a9c2d);};}exports[_0xb988('0x26')]=function(_0x1eb5d0,_0x109754){var _0x527360={},_0x70f617={},_0x193d50={'count':0x0,'rows':[]};var _0x3fb876=_[_0xb988('0x27')](db[_0xb988('0x28')]['rawAttributes'],function(_0x314fab){return{'name':_0x314fab[_0xb988('0x29')],'type':_0x314fab['type'][_0xb988('0x2a')]};});_0x70f617['model']=_[_0xb988('0x27')](_0x3fb876,'name');_0x70f617[_0xb988('0x2b')]=_['keys'](_0x1eb5d0[_0xb988('0x2b')]);_0x70f617['filters']=_[_0xb988('0x2c')](_0x70f617[_0xb988('0x2d')],_0x70f617[_0xb988('0x2b')]);_0x527360[_0xb988('0x2e')]=_[_0xb988('0x2c')](_0x70f617[_0xb988('0x2d')],qs[_0xb988('0x2f')](_0x1eb5d0[_0xb988('0x2b')]['fields']));_0x527360[_0xb988('0x2e')]=_0x527360[_0xb988('0x2e')][_0xb988('0x30')]?_0x527360[_0xb988('0x2e')]:_0x70f617[_0xb988('0x2d')];if(!_0x1eb5d0[_0xb988('0x2b')]['hasOwnProperty'](_0xb988('0x31'))){_0x527360['limit']=qs[_0xb988('0x1b')](_0x1eb5d0[_0xb988('0x2b')]['limit']);_0x527360['offset']=qs[_0xb988('0x18')](_0x1eb5d0['query'][_0xb988('0x18')]);}_0x527360['order']=qs[_0xb988('0x32')](_0x1eb5d0[_0xb988('0x2b')][_0xb988('0x32')]);_0x527360['where']=qs[_0xb988('0x33')](_[_0xb988('0x34')](_0x1eb5d0[_0xb988('0x2b')],_0x70f617['filters']),_0x3fb876);if(_0x1eb5d0['query'][_0xb988('0x35')]){_0x527360[_0xb988('0x36')]=_[_0xb988('0x37')](_0x527360[_0xb988('0x36')],{'$or':_[_0xb988('0x27')](_0x3fb876,function(_0x5d812b){if(_0x5d812b[_0xb988('0x38')]!==_0xb988('0x39')){var _0x4f35f8={};_0x4f35f8[_0x5d812b[_0xb988('0x24')]]={'$like':'%'+_0x1eb5d0['query'][_0xb988('0x35')]+'%'};return _0x4f35f8;}})});}_0x527360=_['merge']({},_0x527360,_0x1eb5d0[_0xb988('0x3a')]);var _0x45015a={'where':_0x527360[_0xb988('0x36')]};return db[_0xb988('0x28')][_0xb988('0x1a')](_0x45015a)[_0xb988('0x22')](function(_0x2adde1){_0x193d50[_0xb988('0x1a')]=_0x2adde1;if(_0x1eb5d0[_0xb988('0x2b')][_0xb988('0x3b')]){_0x527360[_0xb988('0x3c')]=[{'all':!![]}];}return db['SmsApplication'][_0xb988('0x3d')](_0x527360);})['then'](function(_0x2eadd9){_0x193d50[_0xb988('0x3e')]=_0x2eadd9;return _0x193d50;})[_0xb988('0x22')](respondWithFilteredResult(_0x109754,_0x527360))[_0xb988('0x3f')](handleError(_0x109754,null));};exports['show']=function(_0x28de6b,_0x34c7fb){var _0x413928={'raw':!![],'where':{'id':_0x28de6b[_0xb988('0x40')]['id']}},_0x37c864={};_0x37c864[_0xb988('0x2d')]=_[_0xb988('0x41')](db[_0xb988('0x28')][_0xb988('0x42')]);_0x37c864[_0xb988('0x2b')]=_[_0xb988('0x41')](_0x28de6b['query']);_0x37c864['filters']=_[_0xb988('0x2c')](_0x37c864[_0xb988('0x2d')],_0x37c864[_0xb988('0x2b')]);_0x413928[_0xb988('0x2e')]=_[_0xb988('0x2c')](_0x37c864[_0xb988('0x2d')],qs[_0xb988('0x2f')](_0x28de6b[_0xb988('0x2b')][_0xb988('0x2f')]));_0x413928[_0xb988('0x2e')]=_0x413928[_0xb988('0x2e')][_0xb988('0x30')]?_0x413928[_0xb988('0x2e')]:_0x37c864[_0xb988('0x2d')];if(_0x28de6b[_0xb988('0x2b')][_0xb988('0x3b')]){_0x413928[_0xb988('0x3c')]=[{'all':!![]}];}_0x413928=_[_0xb988('0x37')]({},_0x413928,_0x28de6b['options']);return db[_0xb988('0x28')]['find'](_0x413928)[_0xb988('0x22')](handleEntityNotFound(_0x34c7fb,null))[_0xb988('0x22')](respondWithResult(_0x34c7fb,null))['catch'](handleError(_0x34c7fb,null));};exports[_0xb988('0x43')]=function(_0x3255b6,_0x5a3ceb){return db[_0xb988('0x28')]['create'](_0x3255b6[_0xb988('0x44')],{})[_0xb988('0x22')](respondWithResult(_0x5a3ceb,0xc9))[_0xb988('0x3f')](handleError(_0x5a3ceb,null));};exports['update']=function(_0x1bb61b,_0x42a148){if(_0x1bb61b[_0xb988('0x44')]['id']){delete _0x1bb61b[_0xb988('0x44')]['id'];}return db[_0xb988('0x28')][_0xb988('0x45')]({'where':{'id':_0x1bb61b[_0xb988('0x40')]['id']}})[_0xb988('0x22')](handleEntityNotFound(_0x42a148,null))[_0xb988('0x22')](saveUpdates(_0x1bb61b[_0xb988('0x44')],null))[_0xb988('0x22')](respondWithResult(_0x42a148,null))[_0xb988('0x3f')](handleError(_0x42a148,null));};exports[_0xb988('0x21')]=function(_0x342f84,_0x41c0a3){return db[_0xb988('0x28')]['find']({'where':{'id':_0x342f84['params']['id']}})['then'](handleEntityNotFound(_0x41c0a3,null))[_0xb988('0x22')](removeEntity(_0x41c0a3,null))[_0xb988('0x3f')](handleError(_0x41c0a3,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index e895cc3..352f283 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 _0xe3ff=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x49e66,_0x43f4b9){var _0x545549=function(_0x18b28f){while(--_0x18b28f){_0x49e66['push'](_0x49e66['shift']());}};_0x545549(++_0x43f4b9);}(_0xe3ff,0x6e));var _0xfe3f=function(_0x569174,_0x4e2eb5){_0x569174=_0x569174-0x0;var _0x5d6ef4=_0xe3ff[_0x569174];return _0x5d6ef4;};'use strict';var _=require(_0xfe3f('0x0'));var util=require(_0xfe3f('0x1'));var logger=require(_0xfe3f('0x2'))(_0xfe3f('0x3'));var moment=require('moment');var BPromise=require(_0xfe3f('0x4'));var rp=require(_0xfe3f('0x5'));var fs=require('fs');var path=require(_0xfe3f('0x6'));var rimraf=require(_0xfe3f('0x7'));var config=require(_0xfe3f('0x8'));var attributes=require(_0xfe3f('0x9'));module[_0xfe3f('0xa')]=function(_0x1af7f5,_0x1132d4){return _0x1af7f5[_0xfe3f('0xb')](_0xfe3f('0xc'),attributes,{'tableName':_0xfe3f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfe3f('0xe'),'collate':_0xfe3f('0xf')});}; \ No newline at end of file +var _0x305f=['SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','exports','define'];(function(_0x503950,_0x5022eb){var _0x1657a9=function(_0x4c1e8f){while(--_0x4c1e8f){_0x503950['push'](_0x503950['shift']());}};_0x1657a9(++_0x5022eb);}(_0x305f,0xdb));var _0xf305=function(_0x29f748,_0x237a1e){_0x29f748=_0x29f748-0x0;var _0x4f4591=_0x305f[_0x29f748];return _0x4f4591;};'use strict';var _=require(_0xf305('0x0'));var util=require(_0xf305('0x1'));var logger=require(_0xf305('0x2'))(_0xf305('0x3'));var moment=require(_0xf305('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf305('0x5'));var config=require(_0xf305('0x6'));var attributes=require('./smsApplication.attributes');module[_0xf305('0x7')]=function(_0x2c561f,_0x1e6b00){return _0x2c561f[_0xf305('0x8')](_0xf305('0x9'),attributes,{'tableName':_0xf305('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf305('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 236d3b4..5819e39 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 _0xb016=['error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3441fe,_0x2ccd1f){var _0x2c3b27=function(_0x29f5d2){while(--_0x29f5d2){_0x3441fe['push'](_0x3441fe['shift']());}};_0x2c3b27(++_0x2ccd1f);}(_0xb016,0x159));var _0x6b01=function(_0x12249a,_0x2019da){_0x12249a=_0x12249a-0x0;var _0x7412c5=_0xb016[_0x12249a];return _0x7412c5;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b01('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b01('0x3'))['db'];var utils=require(_0x6b01('0x4'));var logger=require(_0x6b01('0x5'))(_0x6b01('0x6'));var config=require('../../config/environment');var jayson=require(_0x6b01('0x7'));var client=jayson[_0x6b01('0x8')][_0x6b01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5759a1,_0x5c5bfb,_0x374aab){return new BPromise(function(_0x39f9fa,_0x526a7d){return client['request'](_0x5759a1,_0x374aab)[_0x6b01('0xa')](function(_0x1cb3a6){logger[_0x6b01('0xb')](_0x6b01('0xc'),_0x5c5bfb,_0x6b01('0xd'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'),JSON[_0x6b01('0xe')](_0x1cb3a6));if(_0x1cb3a6[_0x6b01('0xf')]){if(_0x1cb3a6['error'][_0x6b01('0x10')]===0x1f4){logger['error']('SmsApplication,\x20%s,\x20%s',_0x5c5bfb,_0x1cb3a6[_0x6b01('0xf')]['message']);return _0x526a7d(_0x1cb3a6[_0x6b01('0xf')][_0x6b01('0x11')]);}logger['error'](_0x6b01('0xc'),_0x5c5bfb,_0x1cb3a6['error']['message']);return _0x39f9fa(_0x1cb3a6['error'][_0x6b01('0x11')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'));_0x39f9fa(_0x1cb3a6[_0x6b01('0x12')][_0x6b01('0x11')]);}})[_0x6b01('0x13')](function(_0x3d7045){logger[_0x6b01('0xf')](_0x6b01('0xc'),_0x5c5bfb,_0x3d7045);_0x526a7d(_0x3d7045);});});} \ No newline at end of file +var _0x3024=['rpc','../../config/environment','client','http','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','../../config/utils'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x3024,0x64));var _0x4302=function(_0x4a5c17,_0x422a49){_0x4a5c17=_0x4a5c17-0x0;var _0x4f65b2=_0x3024[_0x4a5c17];return _0x4f65b2;};'use strict';var _=require(_0x4302('0x0'));var util=require(_0x4302('0x1'));var moment=require('moment');var BPromise=require(_0x4302('0x2'));var rs=require(_0x4302('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4302('0x4'));var logger=require('../../config/logger')(_0x4302('0x5'));var config=require(_0x4302('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4302('0x7')][_0x4302('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c3983,_0xced9fc,_0x2aecd7){return new BPromise(function(_0x3c007b,_0x285613){return client[_0x4302('0x9')](_0x4c3983,_0x2aecd7)[_0x4302('0xa')](function(_0x41580c){logger['info'](_0x4302('0xb'),_0xced9fc,_0x4302('0xc'));logger[_0x4302('0xd')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0xced9fc,_0x4302('0xc'),JSON[_0x4302('0xe')](_0x41580c));if(_0x41580c['error']){if(_0x41580c[_0x4302('0xf')][_0x4302('0x10')]===0x1f4){logger[_0x4302('0xf')]('SmsApplication,\x20%s,\x20%s',_0xced9fc,_0x41580c[_0x4302('0xf')][_0x4302('0x11')]);return _0x285613(_0x41580c['error'][_0x4302('0x11')]);}logger[_0x4302('0xf')](_0x4302('0xb'),_0xced9fc,_0x41580c['error'][_0x4302('0x11')]);return _0x3c007b(_0x41580c[_0x4302('0xf')]['message']);}else{logger[_0x4302('0x12')](_0x4302('0xb'),_0xced9fc,'request\x20sent');_0x3c007b(_0x41580c[_0x4302('0x13')][_0x4302('0x11')]);}})[_0x4302('0x14')](function(_0x32178f){logger[_0x4302('0xf')](_0x4302('0xb'),_0xced9fc,_0x32178f);_0x285613(_0x32178f);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 2a2e055..f44140d 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 _0x2547=['/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x365ecc,_0x5da237){var _0x52f7a1=function(_0x2e81ca){while(--_0x2e81ca){_0x365ecc['push'](_0x365ecc['shift']());}};_0x52f7a1(++_0x5da237);}(_0x2547,0x1cd));var _0x7254=function(_0xf7d448,_0x355fbb){_0xf7d448=_0xf7d448-0x0;var _0x54812a=_0x2547[_0xf7d448];return _0x54812a;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['get'](_0x7254('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);router[_0x7254('0x9')](_0x7254('0x11'),auth[_0x7254('0xa')](),controller['download']);router[_0x7254('0x12')]('/',auth['isAuthenticated'](),controller[_0x7254('0x13')]);router['post'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x14')]);router[_0x7254('0x12')](_0x7254('0x15'),auth[_0x7254('0xa')](),interaction[_0x7254('0x16')](_0x7254('0x17'),_0x7254('0x18')),controller[_0x7254('0x19')]);router[_0x7254('0x1a')](_0x7254('0xe'),auth[_0x7254('0xa')](),interaction['tracked'](_0x7254('0x17'),_0x7254('0x1b')),controller[_0x7254('0x1c')]);router[_0x7254('0x1d')](_0x7254('0xe'),auth[_0x7254('0xa')](),interaction[_0x7254('0x16')]('sms',_0x7254('0x1e')),controller[_0x7254('0x1f')]);router[_0x7254('0x1d')](_0x7254('0x15'),auth[_0x7254('0xa')](),controller[_0x7254('0x20')]);module[_0x7254('0x21')]=router; \ No newline at end of file +var _0x4cf8=['/:id','/:id/messages','getMessages','/:id/download','create','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','describe'];(function(_0x3fc8e8,_0x412f3a){var _0x3d9259=function(_0x5df018){while(--_0x5df018){_0x3fc8e8['push'](_0x3fc8e8['shift']());}};_0x3d9259(++_0x412f3a);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x262323,_0x4a81f1){_0x262323=_0x262323-0x0;var _0xa963c3=_0x4cf8[_0x262323];return _0xa963c3;};'use strict';var multer=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var path=require(_0x84cf('0x2'));var timeout=require(_0x84cf('0x3'));var express=require(_0x84cf('0x4'));var router=express[_0x84cf('0x5')]();var fs_extra=require(_0x84cf('0x6'));var auth=require(_0x84cf('0x7'));var interaction=require(_0x84cf('0x8'));var config=require(_0x84cf('0x9'));var controller=require(_0x84cf('0xa'));router[_0x84cf('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x84cf('0xb')]('/describe',auth[_0x84cf('0xc')](),controller[_0x84cf('0xd')]);router['get'](_0x84cf('0xe'),auth[_0x84cf('0xc')](),controller['show']);router[_0x84cf('0xb')](_0x84cf('0xf'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x10')]);router['get'](_0x84cf('0x11'),auth[_0x84cf('0xc')](),controller['download']);router['post']('/',auth[_0x84cf('0xc')](),controller[_0x84cf('0x12')]);router[_0x84cf('0x13')](_0x84cf('0xf'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x14')]);router[_0x84cf('0x13')](_0x84cf('0x15'),auth[_0x84cf('0xc')](),interaction[_0x84cf('0x16')](_0x84cf('0x17'),_0x84cf('0x18')),controller[_0x84cf('0x19')]);router[_0x84cf('0x1a')](_0x84cf('0xe'),auth[_0x84cf('0xc')](),interaction[_0x84cf('0x16')](_0x84cf('0x17'),_0x84cf('0x1b')),controller['update']);router[_0x84cf('0x1c')](_0x84cf('0xe'),auth[_0x84cf('0xc')](),interaction[_0x84cf('0x16')](_0x84cf('0x17'),_0x84cf('0x1d')),controller[_0x84cf('0x1e')]);router['delete']('/:id/tags',auth[_0x84cf('0xc')](),controller[_0x84cf('0x1f')]);module[_0x84cf('0x20')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 90c6acb..01e888e 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 _0x3a0f=['BOOLEAN','exports','STRING','DATE','ENUM','out'];(function(_0xbf7d94,_0x344efc){var _0x509057=function(_0x139f0d){while(--_0x139f0d){_0xbf7d94['push'](_0xbf7d94['shift']());}};_0x509057(++_0x344efc);}(_0x3a0f,0x145));var _0xf3a0=function(_0x2ef1c3,_0x1ae8ae){_0x2ef1c3=_0x2ef1c3-0x0;var _0x357be1=_0x3a0f[_0x2ef1c3];return _0x357be1;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xf3a0('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xf3a0('0x1')]},'secondDisposition':{'type':Sequelize[_0xf3a0('0x1')]},'thirdDisposition':{'type':Sequelize[_0xf3a0('0x1')]},'note':{'type':Sequelize[_0xf3a0('0x1')]},'phone':{'type':Sequelize[_0xf3a0('0x1')]},'read1stAt':{'type':Sequelize[_0xf3a0('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xf3a0('0x3')]('in',_0xf3a0('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xf3a0('0x3')]('in',_0xf3a0('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf3a0('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x6c7b=['ENUM','out','BOOLEAN','sequelize','DATE','STRING'];(function(_0x331d75,_0xbbe089){var _0x32619b=function(_0x2255f1){while(--_0x2255f1){_0x331d75['push'](_0x331d75['shift']());}};_0x32619b(++_0xbbe089);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x47bc4b,_0x44f4a0){_0x47bc4b=_0x47bc4b-0x0;var _0x22ca41=_0x6c7b[_0x47bc4b];return _0x22ca41;};'use strict';var Sequelize=require(_0xb6c7('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb6c7('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xb6c7('0x2')]},'thirdDisposition':{'type':Sequelize[_0xb6c7('0x2')]},'note':{'type':Sequelize[_0xb6c7('0x2')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xb6c7('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xb6c7('0x3')]('in',_0xb6c7('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb6c7('0x1')]},'lastMsgDirection':{'type':Sequelize[_0xb6c7('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb6c7('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index a0d39e6..83ea802 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 _0xa5f1=['status','end','json','offset','undefined','limit','set','Content-Range','then','destroy','sendStatus','error','stack','name','map','SmsInteraction','rawAttributes','fieldName','type','key','findAll','query','user','catch','show','params','model','keys','filters','attributes','intersection','fields','length','includeAll','include','merge','create','body','update','find','describe','SmsMessage','addMessage','omit','ids','getMessages','nolimit','sort','pick','where','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','count','rows','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','toString','root','server','files','tmp','transcript-%d-%s.zip','join','push','User','fullname','CmContact','firstName','Messages','secret','read','SmsAccount','mkdirSync','Sms','Account','Owner','createdAt','closed','closedAt','direction','out','Contact','lastName','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','bluebird','util','path','ejs','lodash','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0xa5f1,0xdc));var _0x1a5f=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa5f1[_0x484e36];return _0xafc85d;};'use strict';var rimraf=require(_0x1a5f('0x0'));var zipdir=require(_0x1a5f('0x1'));var moment=require('moment');var BPromise=require(_0x1a5f('0x2'));var util=require(_0x1a5f('0x3'));var path=require(_0x1a5f('0x4'));var ejs=require(_0x1a5f('0x5'));var fs=require('fs');var _=require(_0x1a5f('0x6'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0x1a5f('0x7'));var pdf=require(_0x1a5f('0x8'));var logger=require('../../config/logger')('api');var config=require(_0x1a5f('0x9'));var db=require(_0x1a5f('0xa'))['db'];config[_0x1a5f('0xb')]=_[_0x1a5f('0xc')](config[_0x1a5f('0xb')],{'host':_0x1a5f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1a5f('0xb')]));require(_0x1a5f('0xe'))[_0x1a5f('0xf')](socket);function respondWithStatusCode(_0x4928ad,_0x2bdfd6){_0x2bdfd6=_0x2bdfd6||0xcc;return function(_0xc41748){if(_0xc41748){return _0x4928ad['sendStatus'](_0x2bdfd6);}return _0x4928ad[_0x1a5f('0x10')](_0x2bdfd6)[_0x1a5f('0x11')]();};}function respondWithResult(_0x42c785,_0x1c34bc){_0x1c34bc=_0x1c34bc||0xc8;return function(_0x54e0ff){if(_0x54e0ff){return _0x42c785['status'](_0x1c34bc)[_0x1a5f('0x12')](_0x54e0ff);}};}function respondWithFilteredResult(_0x1f1e53,_0x354d81){return function(_0x4c01f4){if(_0x4c01f4){var _0x2067b5=typeof _0x354d81[_0x1a5f('0x13')]==='undefined'&&typeof _0x354d81['limit']===_0x1a5f('0x14');var _0x3c0899=_0x4c01f4['count'];var _0x14f36c=_0x2067b5?0x0:_0x354d81[_0x1a5f('0x13')];var _0x432c14=_0x2067b5?_0x4c01f4['count']:_0x354d81[_0x1a5f('0x13')]+_0x354d81[_0x1a5f('0x15')];var _0x2e61bb;if(_0x432c14>=_0x3c0899){_0x432c14=_0x3c0899;_0x2e61bb=0xc8;}else{_0x2e61bb=0xce;}_0x1f1e53[_0x1a5f('0x10')](_0x2e61bb);return _0x1f1e53[_0x1a5f('0x16')](_0x1a5f('0x17'),_0x14f36c+'-'+_0x432c14+'/'+_0x3c0899)[_0x1a5f('0x12')](_0x4c01f4);}return null;};}function saveUpdates(_0xb67e24){return function(_0x5b03d3){if(_0x5b03d3){return _0x5b03d3['update'](_0xb67e24)[_0x1a5f('0x18')](function(_0x528d69){return _0x528d69;});}return null;};}function removeEntity(_0x3dafc4){return function(_0x3f4508){if(_0x3f4508){return _0x3f4508[_0x1a5f('0x19')]()[_0x1a5f('0x18')](function(){_0x3dafc4[_0x1a5f('0x10')](0xcc)[_0x1a5f('0x11')]();});}};}function handleEntityNotFound(_0x520f63){return function(_0x166a13){if(!_0x166a13){_0x520f63[_0x1a5f('0x1a')](0x194);}return _0x166a13;};}function handleError(_0x3c2ce0,_0x4e92f4){_0x4e92f4=_0x4e92f4||0x1f4;return function(_0x5e4a7c){logger[_0x1a5f('0x1b')](_0x5e4a7c[_0x1a5f('0x1c')]);if(_0x5e4a7c[_0x1a5f('0x1d')]){delete _0x5e4a7c[_0x1a5f('0x1d')];}_0x3c2ce0[_0x1a5f('0x10')](_0x4e92f4)['send'](_0x5e4a7c);};}exports['index']=function(_0x32c6c2,_0x215a53){var _0x8eeb16={};var _0x1e5c89=_[_0x1a5f('0x1e')](db[_0x1a5f('0x1f')][_0x1a5f('0x20')],function(_0x28e88f){return{'name':_0x28e88f[_0x1a5f('0x21')],'type':_0x28e88f[_0x1a5f('0x22')][_0x1a5f('0x23')]};});_0x8eeb16=qs['getOptions'](_0x1e5c89,_0x32c6c2);return interaction[_0x1a5f('0x24')]('sms',_0x32c6c2[_0x1a5f('0x25')],_0x32c6c2[_0x1a5f('0x26')],_0x8eeb16,_0x1e5c89)[_0x1a5f('0x18')](respondWithFilteredResult(_0x215a53,_0x8eeb16))[_0x1a5f('0x27')](handleError(_0x215a53,null));};exports[_0x1a5f('0x28')]=function(_0x2856da,_0x1144e7){var _0x5d5e4e={'raw':![],'where':{'id':_0x2856da[_0x1a5f('0x29')]['id']}},_0x4fadab={};_0x4fadab[_0x1a5f('0x2a')]=_[_0x1a5f('0x2b')](db[_0x1a5f('0x1f')][_0x1a5f('0x20')]);_0x4fadab[_0x1a5f('0x25')]=_['keys'](_0x2856da[_0x1a5f('0x25')]);_0x4fadab[_0x1a5f('0x2c')]=_['intersection'](_0x4fadab[_0x1a5f('0x2a')],_0x4fadab[_0x1a5f('0x25')]);_0x5d5e4e[_0x1a5f('0x2d')]=_[_0x1a5f('0x2e')](_0x4fadab['model'],qs[_0x1a5f('0x2f')](_0x2856da['query']['fields']));_0x5d5e4e[_0x1a5f('0x2d')]=_0x5d5e4e[_0x1a5f('0x2d')][_0x1a5f('0x30')]?_0x5d5e4e[_0x1a5f('0x2d')]:_0x4fadab['model'];if(_0x2856da['query'][_0x1a5f('0x31')]){_0x5d5e4e[_0x1a5f('0x32')]=[{'all':!![]}];}_0x5d5e4e=_[_0x1a5f('0x33')]({},_0x5d5e4e,_0x2856da['options']);return db['SmsInteraction']['find'](_0x5d5e4e)['then'](handleEntityNotFound(_0x1144e7,null))[_0x1a5f('0x18')](respondWithResult(_0x1144e7,null))[_0x1a5f('0x27')](handleError(_0x1144e7,null));};exports[_0x1a5f('0x34')]=function(_0x2839aa,_0x150ea2){return db['SmsInteraction'][_0x1a5f('0x34')](_0x2839aa[_0x1a5f('0x35')],{})[_0x1a5f('0x18')](respondWithResult(_0x150ea2,0xc9))[_0x1a5f('0x27')](handleError(_0x150ea2,null));};exports[_0x1a5f('0x36')]=function(_0x512e3e,_0x39283a){if(_0x512e3e['body']['id']){delete _0x512e3e['body']['id'];}return db[_0x1a5f('0x1f')][_0x1a5f('0x37')]({'where':{'id':_0x512e3e['params']['id']}})['then'](handleEntityNotFound(_0x39283a,null))[_0x1a5f('0x18')](saveUpdates(_0x512e3e[_0x1a5f('0x35')],null))[_0x1a5f('0x18')](respondWithResult(_0x39283a,null))[_0x1a5f('0x27')](handleError(_0x39283a,null));};exports[_0x1a5f('0x19')]=function(_0x59f472,_0x2e829a){return db['SmsInteraction'][_0x1a5f('0x37')]({'where':{'id':_0x59f472[_0x1a5f('0x29')]['id']}})[_0x1a5f('0x18')](handleEntityNotFound(_0x2e829a,null))['then'](removeEntity(_0x2e829a,null))[_0x1a5f('0x27')](handleError(_0x2e829a,null));};exports[_0x1a5f('0x38')]=function(_0x300dc8,_0x540518){return db['SmsInteraction']['describe']()[_0x1a5f('0x18')](respondWithResult(_0x540518,null))[_0x1a5f('0x27')](handleError(_0x540518,null));};exports['addMessage']=function(_0x29840a,_0x49e1c4){return db[_0x1a5f('0x39')][_0x1a5f('0x37')]({'where':{'id':_0x29840a[_0x1a5f('0x29')]['id']}})[_0x1a5f('0x18')](handleEntityNotFound(_0x49e1c4,null))[_0x1a5f('0x18')](function(_0x3f7ea5){if(_0x3f7ea5){return _0x3f7ea5[_0x1a5f('0x3a')](_0x29840a[_0x1a5f('0x35')]['ids'],_[_0x1a5f('0x3b')](_0x29840a[_0x1a5f('0x35')],[_0x1a5f('0x3c'),'id'])||{});}})[_0x1a5f('0x18')](respondWithResult(_0x49e1c4,null))[_0x1a5f('0x27')](handleError(_0x49e1c4,null));};exports[_0x1a5f('0x3d')]=function(_0x3a354b,_0x2fd362){var _0x1754fc={'raw':![],'where':{}};var _0x42992e={};var _0x54b3f7={'count':0x0,'rows':[]};return db[_0x1a5f('0x1f')]['findOne']({'where':{'id':_0x3a354b[_0x1a5f('0x29')]['id']}})['then'](handleEntityNotFound(_0x2fd362,null))[_0x1a5f('0x18')](function(_0x34df17){if(_0x34df17){_0x42992e[_0x1a5f('0x2a')]=_[_0x1a5f('0x2b')](db[_0x1a5f('0x39')][_0x1a5f('0x20')]);_0x42992e['query']=_[_0x1a5f('0x2b')](_0x3a354b['query']);_0x42992e['filters']=_['intersection'](_0x42992e['model'],_0x42992e[_0x1a5f('0x25')]);_0x1754fc[_0x1a5f('0x2d')]=_[_0x1a5f('0x2e')](_0x42992e[_0x1a5f('0x2a')],qs[_0x1a5f('0x2f')](_0x3a354b[_0x1a5f('0x25')][_0x1a5f('0x2f')]));_0x1754fc[_0x1a5f('0x2d')]=_0x1754fc[_0x1a5f('0x2d')]['length']?_0x1754fc['attributes']:_0x42992e['model'];if(!_0x3a354b[_0x1a5f('0x25')]['hasOwnProperty'](_0x1a5f('0x3e'))){_0x1754fc[_0x1a5f('0x15')]=qs['limit'](_0x3a354b[_0x1a5f('0x25')][_0x1a5f('0x15')]);_0x1754fc[_0x1a5f('0x13')]=qs['offset'](_0x3a354b[_0x1a5f('0x25')][_0x1a5f('0x13')]);}_0x1754fc['order']=qs[_0x1a5f('0x3f')](_0x3a354b[_0x1a5f('0x25')][_0x1a5f('0x3f')]);_0x1754fc['where']=qs[_0x1a5f('0x2c')](_[_0x1a5f('0x40')](_0x3a354b[_0x1a5f('0x25')],_0x42992e[_0x1a5f('0x2c')]));_0x1754fc[_0x1a5f('0x41')][_0x1a5f('0x42')]=_0x34df17['id'];if(_0x3a354b[_0x1a5f('0x25')][_0x1a5f('0x43')]){_0x1754fc[_0x1a5f('0x41')]=_[_0x1a5f('0x33')](_0x1754fc['where'],{'$or':_[_0x1a5f('0x1e')](_0x1754fc['attributes'],function(_0x4b9fc7){var _0x480035={};_0x480035[_0x4b9fc7]={'$like':'%'+_0x3a354b[_0x1a5f('0x25')]['filter']+'%'};return _0x480035;})});}if(_0x3a354b[_0x1a5f('0x25')][_0x1a5f('0x44')]){var _0x12f473=_0x3a354b[_0x1a5f('0x25')]['$gte'][_0x1a5f('0x45')](',');var _0x40e058={};_0x40e058[_0x12f473[0x0]]={'$gte':moment(_0x12f473[0x1])[_0x1a5f('0x46')](_0x1a5f('0x47'))};_0x1754fc[_0x1a5f('0x41')]=_[_0x1a5f('0x33')](_0x1754fc[_0x1a5f('0x41')],_0x40e058);}_0x1754fc=_[_0x1a5f('0x33')]({},_0x1754fc,_0x3a354b['options']);return db[_0x1a5f('0x39')][_0x1a5f('0x48')]({'where':_0x1754fc[_0x1a5f('0x41')]})['then'](function(_0x134b2f){_0x54b3f7[_0x1a5f('0x48')]=_0x134b2f;if(_0x3a354b[_0x1a5f('0x25')][_0x1a5f('0x31')]){_0x1754fc[_0x1a5f('0x32')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x1754fc);})[_0x1a5f('0x18')](function(_0x484d85){_0x54b3f7[_0x1a5f('0x49')]=_0x484d85;return _0x54b3f7;});}})['then'](respondWithFilteredResult(_0x2fd362,_0x1754fc))[_0x1a5f('0x27')](handleError(_0x2fd362,null));};exports[_0x1a5f('0x4a')]=function(_0x2f700a,_0x53a226){return db['SmsInteraction']['find']({'where':{'id':_0x2f700a[_0x1a5f('0x29')]['id']}})['then'](handleEntityNotFound(_0x53a226,null))['then'](function(_0x1cfbeb){if(_0x1cfbeb){return _0x1cfbeb[_0x1a5f('0x4b')](_0x2f700a[_0x1a5f('0x35')][_0x1a5f('0x3c')],_['omit'](_0x2f700a[_0x1a5f('0x35')],['ids','id'])||{})[_0x1a5f('0x4c')](function(){return db['Tag']['findAll']({'attributes':['id',_0x1a5f('0x1d'),'color'],'where':{'id':_0x2f700a['body'][_0x1a5f('0x3c')]}});})[_0x1a5f('0x18')](function(_0x241886){socket[_0x1a5f('0x4d')](_0x1a5f('0x4e'),{'id':Number(_0x2f700a[_0x1a5f('0x29')]['id']),'tags':_0x241886||[]});return{'id':Number(_0x2f700a[_0x1a5f('0x29')]['id']),'tags':_0x241886||[]};});}})[_0x1a5f('0x18')](respondWithResult(_0x53a226,null))[_0x1a5f('0x27')](handleError(_0x53a226,null));};exports['removeTags']=function(_0x34677e,_0x2add72){return db['SmsInteraction'][_0x1a5f('0x37')]({'where':{'id':_0x34677e[_0x1a5f('0x29')]['id']}})[_0x1a5f('0x18')](handleEntityNotFound(_0x2add72,null))[_0x1a5f('0x18')](function(_0x3145d4){if(_0x3145d4){return _0x3145d4[_0x1a5f('0x4f')](_0x34677e['query'][_0x1a5f('0x3c')]);}})['then'](respondWithStatusCode(_0x2add72,null))['catch'](handleError(_0x2add72,null));};exports[_0x1a5f('0x50')]=function(_0xc7b2e3,_0x42a052){var _0x5d29be=moment()[_0x1a5f('0x51')]()[_0x1a5f('0x52')]();var _0x5932ae=path['join'](config[_0x1a5f('0x53')],_0x1a5f('0x54'),_0x1a5f('0x55'),_0x1a5f('0x56'));var _0x48d4e6=path['join'](_0x5932ae,_0x5d29be);var _0x1777c2=util[_0x1a5f('0x46')](_0x1a5f('0x57'),_0xc7b2e3[_0x1a5f('0x29')]['id'],_0x5d29be);var _0x45f3e2=path[_0x1a5f('0x58')](_0x5932ae,_0x1777c2);var _0x17e39a=[];_0x17e39a[_0x1a5f('0x59')]({'model':db[_0x1a5f('0x5a')],'as':'User','attributes':['id',_0x1a5f('0x5b')],'raw':!![]});_0x17e39a['push']({'model':db[_0x1a5f('0x5c')],'as':'Contact','attributes':['id',_0x1a5f('0x5d'),'lastName'],'raw':!![]});var _0x60c1d0=[{'model':db[_0x1a5f('0x39')],'as':_0x1a5f('0x5e'),'attributes':['id',_0x1a5f('0x35'),'createdAt','direction',_0x1a5f('0x5f'),_0x1a5f('0x60')],'include':_0x17e39a}];_0x60c1d0['push']({'model':db[_0x1a5f('0x61')],'as':'Account','attributes':['id',_0x1a5f('0x1d')]});_0x60c1d0[_0x1a5f('0x59')]({'model':db[_0x1a5f('0x5a')],'as':'Owner','attributes':['id',_0x1a5f('0x5b')]});return db[_0x1a5f('0x1f')][_0x1a5f('0x37')]({'where':{'id':_0xc7b2e3['params']['id']},'include':_0x60c1d0})[_0x1a5f('0x18')](handleEntityNotFound(_0x42a052,null))[_0x1a5f('0x18')](function(_0x314d71){if(_0x314d71){var _0x18ea22=_0x314d71['get']({'plain':!![]});fs[_0x1a5f('0x62')](_0x48d4e6);var _0x535e9e={'channel':_0x1a5f('0x63'),'account':_0x18ea22[_0x1a5f('0x64')][_0x1a5f('0x1d')],'agent':_0x18ea22[_0x1a5f('0x65')]?_0x18ea22[_0x1a5f('0x65')][_0x1a5f('0x5b')]:'N.A.','createdAt':moment(_0x18ea22[_0x1a5f('0x66')])[_0x1a5f('0x46')](_0x1a5f('0x47'))[_0x1a5f('0x52')](),'closedAt':_0x18ea22[_0x1a5f('0x67')]?moment(_0x18ea22[_0x1a5f('0x68')])[_0x1a5f('0x46')](_0x1a5f('0x47'))[_0x1a5f('0x52')]():'','disposition':_0x18ea22['disposition'],'messages':_(_0x18ea22[_0x1a5f('0x5e')])[_0x1a5f('0x43')]({'secret':![]})[_0x1a5f('0x1e')](function(_0xa4aa89){return{'date':moment(_0xa4aa89[_0x1a5f('0x66')])[_0x1a5f('0x46')](_0x1a5f('0x47'))[_0x1a5f('0x52')](),'sender':_0xa4aa89[_0x1a5f('0x69')]===_0x1a5f('0x6a')?_0xa4aa89[_0x1a5f('0x5a')]?_0xa4aa89[_0x1a5f('0x5a')][_0x1a5f('0x5b')]:'System':_0xa4aa89[_0x1a5f('0x6b')][_0x1a5f('0x5d')]+(_0xa4aa89[_0x1a5f('0x6b')][_0x1a5f('0x6c')]?'\x20'+_0xa4aa89[_0x1a5f('0x6b')][_0x1a5f('0x6c')]:''),'body':_0xa4aa89[_0x1a5f('0x35')],'direction':_0xa4aa89['direction']===_0x1a5f('0x6a')?'A':'C','secret':_0xa4aa89[_0x1a5f('0x5f')],'read':_0xa4aa89['read']};})[_0x1a5f('0x6d')]()};return ejs['renderFile'](path[_0x1a5f('0x58')](config[_0x1a5f('0x53')],_0x1a5f('0x54'),_0x1a5f('0x6e'),_0x1a5f('0x6f')),{'interaction':_0x535e9e})[_0x1a5f('0x18')](function(_0x1005ae){var _0xd31906=path[_0x1a5f('0x58')](_0x48d4e6,_0x1a5f('0x70')+_0x18ea22['id']+'-'+_0x5d29be+_0x1a5f('0x71'));var _0x5e3e8e={'path':_0xd31906,'channel':'Sms','interactionId':_0x18ea22['id']};return pdf[_0x1a5f('0x72')](_0x1005ae,_0x5e3e8e);})[_0x1a5f('0x18')](function(){return new BPromise(function(_0x4f3dd7,_0xcd7449){zipdir(_0x48d4e6,{'saveTo':_0x45f3e2},function(_0xa28449,_0x1bf0fb){if(_0xa28449)return _0xcd7449(_0xa28449);return _0x4f3dd7(_0x1bf0fb);});})[_0x1a5f('0x18')](function(){return new BPromise(function(_0x1d9f9e,_0x36a303){rimraf(_0x48d4e6,function(_0x27cf73){if(_0x27cf73)_0x36a303(_0x27cf73);return _0x1d9f9e();});});})[_0x1a5f('0x18')](function(){return _0x42a052[_0x1a5f('0x50')](_0x45f3e2,_0x1777c2,function(_0x50c368){if(_0x50c368){console[_0x1a5f('0x73')](_0x1a5f('0x74'),_0x50c368);}else{fs[_0x1a5f('0x75')](_0x45f3e2);}});});});}else{return _0x42a052[_0x1a5f('0x1a')](0xc8);}})[_0x1a5f('0x27')](handleError(_0x42a052,null));}; \ No newline at end of file +var _0x5827=['getMessages','findOne','length','hasOwnProperty','nolimit','sort','where','pick','SmsInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','count','rows','addTags','setTags','Tag','color','emit','smsInteractionTags:save','removeTags','download','toString','join','root','server','tmp','push','User','fullname','CmContact','Contact','firstName','lastName','Messages','createdAt','direction','read','SmsAccount','Account','Owner','mkdirSync','N.A.','closed','closedAt','out','System','secret','renderFile','views','transcript-','.pdf','Sms','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','moment','ejs','lodash','../../components/parsers/qs','../../components/export/pdf','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','json','undefined','limit','offset','set','Content-Range','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','sms','query','user','catch','show','params','SmsInteraction','keys','filters','intersection','model','attributes','fields','includeAll','include','merge','options','create','body','find','describe','addMessage','SmsMessage','omit','ids'];(function(_0x2faa3b,_0x49881f){var _0x2258c7=function(_0x2249a2){while(--_0x2249a2){_0x2faa3b['push'](_0x2faa3b['shift']());}};_0x2258c7(++_0x49881f);}(_0x5827,0xb0));var _0x7582=function(_0x5e4a48,_0x1c6958){_0x5e4a48=_0x5e4a48-0x0;var _0x5edeab=_0x5827[_0x5e4a48];return _0x5edeab;};'use strict';var rimraf=require(_0x7582('0x0'));var zipdir=require(_0x7582('0x1'));var moment=require(_0x7582('0x2'));var BPromise=require('bluebird');var util=require('util');var path=require('path');var ejs=require(_0x7582('0x3'));var fs=require('fs');var _=require(_0x7582('0x4'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0x7582('0x5'));var pdf=require(_0x7582('0x6'));var logger=require('../../config/logger')(_0x7582('0x7'));var config=require('../../config/environment');var db=require(_0x7582('0x8'))['db'];config[_0x7582('0x9')]=_[_0x7582('0xa')](config['redis'],{'host':_0x7582('0xb'),'port':0x18eb});var socket=require(_0x7582('0xc'))(new Redis(config['redis']));require(_0x7582('0xd'))[_0x7582('0xe')](socket);function respondWithStatusCode(_0x504057,_0x41700b){_0x41700b=_0x41700b||0xcc;return function(_0x766fc4){if(_0x766fc4){return _0x504057[_0x7582('0xf')](_0x41700b);}return _0x504057[_0x7582('0x10')](_0x41700b)['end']();};}function respondWithResult(_0x5d8750,_0x31b3b7){_0x31b3b7=_0x31b3b7||0xc8;return function(_0x362064){if(_0x362064){return _0x5d8750[_0x7582('0x10')](_0x31b3b7)[_0x7582('0x11')](_0x362064);}};}function respondWithFilteredResult(_0x141470,_0x29114a){return function(_0x260d1e){if(_0x260d1e){var _0x3b343a=typeof _0x29114a['offset']===_0x7582('0x12')&&typeof _0x29114a[_0x7582('0x13')]===_0x7582('0x12');var _0x59abbd=_0x260d1e['count'];var _0x2f42c5=_0x3b343a?0x0:_0x29114a[_0x7582('0x14')];var _0x161035=_0x3b343a?_0x260d1e['count']:_0x29114a[_0x7582('0x14')]+_0x29114a[_0x7582('0x13')];var _0x567880;if(_0x161035>=_0x59abbd){_0x161035=_0x59abbd;_0x567880=0xc8;}else{_0x567880=0xce;}_0x141470['status'](_0x567880);return _0x141470[_0x7582('0x15')](_0x7582('0x16'),_0x2f42c5+'-'+_0x161035+'/'+_0x59abbd)['json'](_0x260d1e);}return null;};}function saveUpdates(_0xcb26a){return function(_0x42a5ce){if(_0x42a5ce){return _0x42a5ce['update'](_0xcb26a)[_0x7582('0x17')](function(_0x5f1bff){return _0x5f1bff;});}return null;};}function removeEntity(_0x38aed2){return function(_0x4422e5){if(_0x4422e5){return _0x4422e5[_0x7582('0x18')]()[_0x7582('0x17')](function(){_0x38aed2[_0x7582('0x10')](0xcc)[_0x7582('0x19')]();});}};}function handleEntityNotFound(_0x24df35){return function(_0x238f27){if(!_0x238f27){_0x24df35[_0x7582('0xf')](0x194);}return _0x238f27;};}function handleError(_0x34b131,_0x37f9e2){_0x37f9e2=_0x37f9e2||0x1f4;return function(_0x59a0a7){logger[_0x7582('0x1a')](_0x59a0a7['stack']);if(_0x59a0a7[_0x7582('0x1b')]){delete _0x59a0a7[_0x7582('0x1b')];}_0x34b131[_0x7582('0x10')](_0x37f9e2)[_0x7582('0x1c')](_0x59a0a7);};}exports[_0x7582('0x1d')]=function(_0x53df0e,_0x235416){var _0x1741ef={};var _0x1f8de4=_[_0x7582('0x1e')](db['SmsInteraction'][_0x7582('0x1f')],function(_0x32f8ba){return{'name':_0x32f8ba[_0x7582('0x20')],'type':_0x32f8ba[_0x7582('0x21')][_0x7582('0x22')]};});_0x1741ef=qs[_0x7582('0x23')](_0x1f8de4,_0x53df0e);return interaction[_0x7582('0x24')](_0x7582('0x25'),_0x53df0e[_0x7582('0x26')],_0x53df0e[_0x7582('0x27')],_0x1741ef,_0x1f8de4)['then'](respondWithFilteredResult(_0x235416,_0x1741ef))[_0x7582('0x28')](handleError(_0x235416,null));};exports[_0x7582('0x29')]=function(_0x19fef2,_0x16e731){var _0x248cc5={'raw':![],'where':{'id':_0x19fef2[_0x7582('0x2a')]['id']}},_0x54569d={};_0x54569d['model']=_['keys'](db[_0x7582('0x2b')][_0x7582('0x1f')]);_0x54569d[_0x7582('0x26')]=_[_0x7582('0x2c')](_0x19fef2[_0x7582('0x26')]);_0x54569d[_0x7582('0x2d')]=_[_0x7582('0x2e')](_0x54569d[_0x7582('0x2f')],_0x54569d[_0x7582('0x26')]);_0x248cc5[_0x7582('0x30')]=_[_0x7582('0x2e')](_0x54569d['model'],qs['fields'](_0x19fef2['query'][_0x7582('0x31')]));_0x248cc5['attributes']=_0x248cc5[_0x7582('0x30')]['length']?_0x248cc5[_0x7582('0x30')]:_0x54569d[_0x7582('0x2f')];if(_0x19fef2[_0x7582('0x26')][_0x7582('0x32')]){_0x248cc5[_0x7582('0x33')]=[{'all':!![]}];}_0x248cc5=_[_0x7582('0x34')]({},_0x248cc5,_0x19fef2[_0x7582('0x35')]);return db[_0x7582('0x2b')]['find'](_0x248cc5)[_0x7582('0x17')](handleEntityNotFound(_0x16e731,null))['then'](respondWithResult(_0x16e731,null))[_0x7582('0x28')](handleError(_0x16e731,null));};exports[_0x7582('0x36')]=function(_0x457c68,_0xa1029b){return db[_0x7582('0x2b')]['create'](_0x457c68[_0x7582('0x37')],{})['then'](respondWithResult(_0xa1029b,0xc9))['catch'](handleError(_0xa1029b,null));};exports['update']=function(_0x27d50f,_0x3a6e31){if(_0x27d50f['body']['id']){delete _0x27d50f[_0x7582('0x37')]['id'];}return db['SmsInteraction']['find']({'where':{'id':_0x27d50f[_0x7582('0x2a')]['id']}})[_0x7582('0x17')](handleEntityNotFound(_0x3a6e31,null))[_0x7582('0x17')](saveUpdates(_0x27d50f[_0x7582('0x37')],null))['then'](respondWithResult(_0x3a6e31,null))[_0x7582('0x28')](handleError(_0x3a6e31,null));};exports['destroy']=function(_0x235528,_0x232d4f){return db[_0x7582('0x2b')][_0x7582('0x38')]({'where':{'id':_0x235528[_0x7582('0x2a')]['id']}})[_0x7582('0x17')](handleEntityNotFound(_0x232d4f,null))[_0x7582('0x17')](removeEntity(_0x232d4f,null))[_0x7582('0x28')](handleError(_0x232d4f,null));};exports[_0x7582('0x39')]=function(_0x4fc39a,_0xb8ed35){return db['SmsInteraction'][_0x7582('0x39')]()['then'](respondWithResult(_0xb8ed35,null))[_0x7582('0x28')](handleError(_0xb8ed35,null));};exports[_0x7582('0x3a')]=function(_0x2320f7,_0x4aa240){return db[_0x7582('0x3b')][_0x7582('0x38')]({'where':{'id':_0x2320f7[_0x7582('0x2a')]['id']}})['then'](handleEntityNotFound(_0x4aa240,null))[_0x7582('0x17')](function(_0xd13856){if(_0xd13856){return _0xd13856['addMessage'](_0x2320f7[_0x7582('0x37')]['ids'],_[_0x7582('0x3c')](_0x2320f7[_0x7582('0x37')],[_0x7582('0x3d'),'id'])||{});}})[_0x7582('0x17')](respondWithResult(_0x4aa240,null))[_0x7582('0x28')](handleError(_0x4aa240,null));};exports[_0x7582('0x3e')]=function(_0x5b8c20,_0x77e9dd){var _0x4cfdf9={'raw':![],'where':{}};var _0x1996bb={};var _0x23f866={'count':0x0,'rows':[]};return db[_0x7582('0x2b')][_0x7582('0x3f')]({'where':{'id':_0x5b8c20['params']['id']}})[_0x7582('0x17')](handleEntityNotFound(_0x77e9dd,null))[_0x7582('0x17')](function(_0x2faf43){if(_0x2faf43){_0x1996bb['model']=_['keys'](db[_0x7582('0x3b')][_0x7582('0x1f')]);_0x1996bb['query']=_[_0x7582('0x2c')](_0x5b8c20[_0x7582('0x26')]);_0x1996bb[_0x7582('0x2d')]=_[_0x7582('0x2e')](_0x1996bb['model'],_0x1996bb['query']);_0x4cfdf9[_0x7582('0x30')]=_[_0x7582('0x2e')](_0x1996bb[_0x7582('0x2f')],qs[_0x7582('0x31')](_0x5b8c20[_0x7582('0x26')][_0x7582('0x31')]));_0x4cfdf9[_0x7582('0x30')]=_0x4cfdf9[_0x7582('0x30')][_0x7582('0x40')]?_0x4cfdf9[_0x7582('0x30')]:_0x1996bb['model'];if(!_0x5b8c20[_0x7582('0x26')][_0x7582('0x41')](_0x7582('0x42'))){_0x4cfdf9[_0x7582('0x13')]=qs[_0x7582('0x13')](_0x5b8c20[_0x7582('0x26')][_0x7582('0x13')]);_0x4cfdf9[_0x7582('0x14')]=qs['offset'](_0x5b8c20[_0x7582('0x26')][_0x7582('0x14')]);}_0x4cfdf9['order']=qs['sort'](_0x5b8c20[_0x7582('0x26')][_0x7582('0x43')]);_0x4cfdf9[_0x7582('0x44')]=qs['filters'](_[_0x7582('0x45')](_0x5b8c20['query'],_0x1996bb[_0x7582('0x2d')]));_0x4cfdf9['where'][_0x7582('0x46')]=_0x2faf43['id'];if(_0x5b8c20[_0x7582('0x26')]['filter']){_0x4cfdf9[_0x7582('0x44')]=_[_0x7582('0x34')](_0x4cfdf9[_0x7582('0x44')],{'$or':_[_0x7582('0x1e')](_0x4cfdf9[_0x7582('0x30')],function(_0x5ca1b6){var _0x347730={};_0x347730[_0x5ca1b6]={'$like':'%'+_0x5b8c20['query'][_0x7582('0x47')]+'%'};return _0x347730;})});}if(_0x5b8c20[_0x7582('0x26')][_0x7582('0x48')]){var _0x41adea=_0x5b8c20[_0x7582('0x26')]['$gte']['split'](',');var _0x368f8e={};_0x368f8e[_0x41adea[0x0]]={'$gte':moment(_0x41adea[0x1])[_0x7582('0x49')](_0x7582('0x4a'))};_0x4cfdf9[_0x7582('0x44')]=_[_0x7582('0x34')](_0x4cfdf9[_0x7582('0x44')],_0x368f8e);}_0x4cfdf9=_['merge']({},_0x4cfdf9,_0x5b8c20[_0x7582('0x35')]);return db[_0x7582('0x3b')][_0x7582('0x4b')]({'where':_0x4cfdf9['where']})[_0x7582('0x17')](function(_0x31140b){_0x23f866['count']=_0x31140b;if(_0x5b8c20['query'][_0x7582('0x32')]){_0x4cfdf9[_0x7582('0x33')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x4cfdf9);})[_0x7582('0x17')](function(_0x1bba18){_0x23f866[_0x7582('0x4c')]=_0x1bba18;return _0x23f866;});}})[_0x7582('0x17')](respondWithFilteredResult(_0x77e9dd,_0x4cfdf9))[_0x7582('0x28')](handleError(_0x77e9dd,null));};exports[_0x7582('0x4d')]=function(_0x2f4236,_0x552892){return db[_0x7582('0x2b')]['find']({'where':{'id':_0x2f4236['params']['id']}})[_0x7582('0x17')](handleEntityNotFound(_0x552892,null))[_0x7582('0x17')](function(_0x5e32bc){if(_0x5e32bc){return _0x5e32bc[_0x7582('0x4e')](_0x2f4236[_0x7582('0x37')][_0x7582('0x3d')],_[_0x7582('0x3c')](_0x2f4236[_0x7582('0x37')],['ids','id'])||{})['spread'](function(){return db[_0x7582('0x4f')][_0x7582('0x24')]({'attributes':['id',_0x7582('0x1b'),_0x7582('0x50')],'where':{'id':_0x2f4236[_0x7582('0x37')]['ids']}});})[_0x7582('0x17')](function(_0x51647b){socket[_0x7582('0x51')](_0x7582('0x52'),{'id':Number(_0x2f4236[_0x7582('0x2a')]['id']),'tags':_0x51647b||[]});return{'id':Number(_0x2f4236[_0x7582('0x2a')]['id']),'tags':_0x51647b||[]};});}})[_0x7582('0x17')](respondWithResult(_0x552892,null))[_0x7582('0x28')](handleError(_0x552892,null));};exports[_0x7582('0x53')]=function(_0x22654a,_0x9ceaba){return db[_0x7582('0x2b')]['find']({'where':{'id':_0x22654a['params']['id']}})[_0x7582('0x17')](handleEntityNotFound(_0x9ceaba,null))[_0x7582('0x17')](function(_0x196b57){if(_0x196b57){return _0x196b57['removeTags'](_0x22654a[_0x7582('0x26')]['ids']);}})[_0x7582('0x17')](respondWithStatusCode(_0x9ceaba,null))[_0x7582('0x28')](handleError(_0x9ceaba,null));};exports[_0x7582('0x54')]=function(_0x5dc3f7,_0x590798){var _0x8f34b0=moment()['unix']()[_0x7582('0x55')]();var _0x5bc610=path[_0x7582('0x56')](config[_0x7582('0x57')],_0x7582('0x58'),'files',_0x7582('0x59'));var _0xf9ee12=path['join'](_0x5bc610,_0x8f34b0);var _0x4eec37=util[_0x7582('0x49')]('transcript-%d-%s.zip',_0x5dc3f7[_0x7582('0x2a')]['id'],_0x8f34b0);var _0x3bdb36=path[_0x7582('0x56')](_0x5bc610,_0x4eec37);var _0x261fed=[];_0x261fed[_0x7582('0x5a')]({'model':db['User'],'as':_0x7582('0x5b'),'attributes':['id',_0x7582('0x5c')],'raw':!![]});_0x261fed[_0x7582('0x5a')]({'model':db[_0x7582('0x5d')],'as':_0x7582('0x5e'),'attributes':['id',_0x7582('0x5f'),_0x7582('0x60')],'raw':!![]});var _0x29e94a=[{'model':db['SmsMessage'],'as':_0x7582('0x61'),'attributes':['id',_0x7582('0x37'),_0x7582('0x62'),_0x7582('0x63'),'secret',_0x7582('0x64')],'include':_0x261fed}];_0x29e94a['push']({'model':db[_0x7582('0x65')],'as':_0x7582('0x66'),'attributes':['id','name']});_0x29e94a[_0x7582('0x5a')]({'model':db[_0x7582('0x5b')],'as':_0x7582('0x67'),'attributes':['id',_0x7582('0x5c')]});return db[_0x7582('0x2b')][_0x7582('0x38')]({'where':{'id':_0x5dc3f7[_0x7582('0x2a')]['id']},'include':_0x29e94a})[_0x7582('0x17')](handleEntityNotFound(_0x590798,null))['then'](function(_0xe992a){if(_0xe992a){var _0x4071c6=_0xe992a['get']({'plain':!![]});fs[_0x7582('0x68')](_0xf9ee12);var _0x2c6883={'channel':'Sms','account':_0x4071c6[_0x7582('0x66')][_0x7582('0x1b')],'agent':_0x4071c6['Owner']?_0x4071c6[_0x7582('0x67')]['fullname']:_0x7582('0x69'),'createdAt':moment(_0x4071c6[_0x7582('0x62')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x4071c6[_0x7582('0x6a')]?moment(_0x4071c6[_0x7582('0x6b')])[_0x7582('0x49')](_0x7582('0x4a'))[_0x7582('0x55')]():'','disposition':_0x4071c6['disposition'],'messages':_(_0x4071c6[_0x7582('0x61')])['filter']({'secret':![]})[_0x7582('0x1e')](function(_0xf49e00){return{'date':moment(_0xf49e00[_0x7582('0x62')])[_0x7582('0x49')](_0x7582('0x4a'))[_0x7582('0x55')](),'sender':_0xf49e00[_0x7582('0x63')]===_0x7582('0x6c')?_0xf49e00['User']?_0xf49e00['User'][_0x7582('0x5c')]:_0x7582('0x6d'):_0xf49e00['Contact'][_0x7582('0x5f')]+(_0xf49e00[_0x7582('0x5e')]['lastName']?'\x20'+_0xf49e00[_0x7582('0x5e')][_0x7582('0x60')]:''),'body':_0xf49e00['body'],'direction':_0xf49e00[_0x7582('0x63')]===_0x7582('0x6c')?'A':'C','secret':_0xf49e00[_0x7582('0x6e')],'read':_0xf49e00[_0x7582('0x64')]};})['value']()};return ejs[_0x7582('0x6f')](path[_0x7582('0x56')](config[_0x7582('0x57')],_0x7582('0x58'),_0x7582('0x70'),'downloadInteraction.ejs'),{'interaction':_0x2c6883})['then'](function(_0x5c2f90){var _0x207843=path[_0x7582('0x56')](_0xf9ee12,_0x7582('0x71')+_0x4071c6['id']+'-'+_0x8f34b0+_0x7582('0x72'));var _0x168b88={'path':_0x207843,'channel':_0x7582('0x73'),'interactionId':_0x4071c6['id']};return pdf[_0x7582('0x74')](_0x5c2f90,_0x168b88);})[_0x7582('0x17')](function(){return new BPromise(function(_0x3bd235,_0x5e43d9){zipdir(_0xf9ee12,{'saveTo':_0x3bdb36},function(_0x3d500c,_0x1a925a){if(_0x3d500c)return _0x5e43d9(_0x3d500c);return _0x3bd235(_0x1a925a);});})[_0x7582('0x17')](function(){return new BPromise(function(_0x4f2104,_0x52dd56){rimraf(_0xf9ee12,function(_0x492de5){if(_0x492de5)_0x52dd56(_0x492de5);return _0x4f2104();});});})['then'](function(){return _0x590798[_0x7582('0x54')](_0x3bdb36,_0x4eec37,function(_0x1db771){if(_0x1db771){console[_0x7582('0x75')]('err',_0x1db771);}else{fs[_0x7582('0x76')](_0x3bdb36);}});});});}else{return _0x590798[_0x7582('0xf')](0xc8);}})['catch'](handleError(_0x590798,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 7de8695..e8060fc 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(_0x4aae11,_0x1daa85){var _0x1a5532=function(_0x185eb6){while(--_0x185eb6){_0x4aae11['push'](_0x4aae11['shift']());}};_0x1a5532(++_0x1daa85);}(_0x4888,0x198));var _0x8488=function(_0x8c7dcb,_0xea478d){_0x8c7dcb=_0x8c7dcb-0x0;var _0x3952e5=_0x4888[_0x8c7dcb];return _0x3952e5;};'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 _0xf4f4=['findAll','unreadMessages','length','emit','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x3762d4,_0x40a34d){_0x3762d4=_0x3762d4-0x0;var _0x424eb1=_0xf4f4[_0x3762d4];return _0x424eb1;};'use strict';var EventEmitter=require(_0x4f4f('0x0'));var SmsInteraction=require(_0x4f4f('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x4f4f('0x1'))['db'][_0x4f4f('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x4f4f('0x3')](0x0);var events={'afterCreate':_0x4f4f('0x4'),'afterUpdate':_0x4f4f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5a752b){return function(_0x593952,_0x3f274d,_0x132d5c){_0x593952[_0x4f4f('0x6')]({'attributes':['id'],'raw':!![]})[_0x4f4f('0x7')](function(_0x3c4877){_0x593952[_0x4f4f('0x8')](_0x4f4f('0x9'),_0x3c4877[_0x4f4f('0xa')](function(_0x48f6b9){return{'id':_0x48f6b9['id']};}));return SmsMessage[_0x4f4f('0xb')]({'where':{'SmsInteractionId':_0x593952['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4f4f('0x7')](function(_0x39e36b){_0x593952[_0x4f4f('0x8')](_0x4f4f('0xc'),_0x39e36b[_0x4f4f('0xd')]);SmsInteractionEvents[_0x4f4f('0xe')](_0x5a752b+':'+_0x593952['id'],_0x593952);SmsInteractionEvents[_0x4f4f('0xe')](_0x5a752b,_0x593952);_0x132d5c(null);})['catch'](_0x132d5c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x4f4f('0xf')](e,emitEvent(event));}}module[_0x4f4f('0x10')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 35caf40..90417c0 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 _0x7385=['moment','bluebird','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x5429e6,_0x1f78fe){var _0x3c6711=function(_0x2aca23){while(--_0x2aca23){_0x5429e6['push'](_0x5429e6['shift']());}};_0x3c6711(++_0x1f78fe);}(_0x7385,0x83));var _0x5738=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7385[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x5738('0x0'));var util=require(_0x5738('0x1'));var logger=require(_0x5738('0x2'))(_0x5738('0x3'));var moment=require(_0x5738('0x4'));var BPromise=require(_0x5738('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5738('0x6'));module[_0x5738('0x7')]=function(_0x312c1b,_0x5c4104){return _0x312c1b[_0x5738('0x8')](_0x5738('0x9'),attributes,{'tableName':_0x5738('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x531de8,_0x57a3f0,_0x307c74){if(_0x531de8[_0x5738('0xb')](_0x5738('0xc'))){_0x531de8[_0x5738('0xd')]=moment()['format'](_0x5738('0xe'));}_0x307c74(null,_0x531de8);}}});}; \ No newline at end of file +var _0x9ab1=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','closed','closedAt'];(function(_0x10c548,_0x2c92cb){var _0x4a8150=function(_0x2218f0){while(--_0x2218f0){_0x10c548['push'](_0x10c548['shift']());}};_0x4a8150(++_0x2c92cb);}(_0x9ab1,0x1b5));var _0x19ab=function(_0x19b9af,_0x372260){_0x19b9af=_0x19b9af-0x0;var _0x24e338=_0x9ab1[_0x19b9af];return _0x24e338;};'use strict';var _=require(_0x19ab('0x0'));var util=require(_0x19ab('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x19ab('0x2'));var BPromise=require(_0x19ab('0x3'));var rp=require(_0x19ab('0x4'));var fs=require('fs');var path=require(_0x19ab('0x5'));var rimraf=require(_0x19ab('0x6'));var config=require(_0x19ab('0x7'));var attributes=require(_0x19ab('0x8'));module['exports']=function(_0x50731c,_0x39fcdb){return _0x50731c[_0x19ab('0x9')](_0x19ab('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2003fe,_0x4c936c,_0x24ed4e){if(_0x2003fe['changed'](_0x19ab('0xb'))){_0x2003fe[_0x19ab('0xc')]=moment()[_0x19ab('0xd')](_0x19ab('0xe'));}_0x24ed4e(null,_0x2003fe);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 6b6999f..fdd3efe 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 _0x3cb2=['body','options','where','attributes','limit','then','debug','stringify','catch','AddTagsToSmsInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','request','info','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','error','message','SmsInteraction,\x20%s,\x20%s','UpdateSmsInteraction','SmsInteraction','update'];(function(_0x268396,_0x864c1c){var _0x2d7b5d=function(_0x4a3a6a){while(--_0x4a3a6a){_0x268396['push'](_0x268396['shift']());}};_0x2d7b5d(++_0x864c1c);}(_0x3cb2,0x135));var _0x23cb=function(_0xcc18a5,_0x4dbb0a){_0xcc18a5=_0xcc18a5-0x0;var _0x314c9b=_0x3cb2[_0xcc18a5];return _0x314c9b;};'use strict';var _=require(_0x23cb('0x0'));var util=require(_0x23cb('0x1'));var moment=require(_0x23cb('0x2'));var BPromise=require(_0x23cb('0x3'));var rs=require(_0x23cb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x23cb('0x5'))['db'];var utils=require(_0x23cb('0x6'));var logger=require(_0x23cb('0x7'))(_0x23cb('0x8'));var config=require(_0x23cb('0x9'));var jayson=require(_0x23cb('0xa'));var client=jayson[_0x23cb('0xb')]['http']({'port':0x232a});config[_0x23cb('0xc')]=_[_0x23cb('0xd')](config[_0x23cb('0xc')],{'host':_0x23cb('0xe'),'port':0x18eb});var socket=require(_0x23cb('0xf'))(new Redis(config[_0x23cb('0xc')]));require(_0x23cb('0x10'))['register'](socket);function respondWithRpcPromise(_0x49d870,_0x4e4cf1,_0x11a12f){return new BPromise(function(_0xe53904,_0x494993){return client[_0x23cb('0x11')](_0x49d870,_0x11a12f)['then'](function(_0x1c24ed){logger[_0x23cb('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x4e4cf1,_0x23cb('0x13'));logger['debug'](_0x23cb('0x14'),_0x4e4cf1,_0x23cb('0x13'),JSON['stringify'](_0x1c24ed));if(_0x1c24ed[_0x23cb('0x15')]){if(_0x1c24ed[_0x23cb('0x15')]['code']===0x1f4){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x4e4cf1,_0x1c24ed[_0x23cb('0x15')][_0x23cb('0x16')]);return _0x494993(_0x1c24ed['error']['message']);}logger[_0x23cb('0x15')](_0x23cb('0x17'),_0x4e4cf1,_0x1c24ed[_0x23cb('0x15')][_0x23cb('0x16')]);return _0xe53904(_0x1c24ed['error'][_0x23cb('0x16')]);}else{logger['info'](_0x23cb('0x17'),_0x4e4cf1,'request\x20sent');_0xe53904(_0x1c24ed['result']['message']);}})['catch'](function(_0x5a2d49){logger['error'](_0x23cb('0x17'),_0x4e4cf1,_0x5a2d49);_0x494993(_0x5a2d49);});});}exports[_0x23cb('0x18')]=function(_0x169c7f){var _0x56e7db=this;return new Promise(function(_0x25c457,_0x1720b2){return db[_0x23cb('0x19')][_0x23cb('0x1a')](_0x169c7f[_0x23cb('0x1b')],{'raw':_0x169c7f[_0x23cb('0x1c')]?_0x169c7f[_0x23cb('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x169c7f[_0x23cb('0x1c')]?_0x169c7f[_0x23cb('0x1c')][_0x23cb('0x1d')]||null:null,'attributes':_0x169c7f[_0x23cb('0x1c')]?_0x169c7f[_0x23cb('0x1c')][_0x23cb('0x1e')]||null:null,'limit':_0x169c7f['options']?_0x169c7f[_0x23cb('0x1c')][_0x23cb('0x1f')]||null:null})[_0x23cb('0x20')](function(_0x39db63){logger[_0x23cb('0x12')](_0x23cb('0x18'),_0x169c7f);logger[_0x23cb('0x21')](_0x23cb('0x18'),_0x169c7f,JSON[_0x23cb('0x22')](_0x39db63));_0x25c457(_0x39db63);})[_0x23cb('0x23')](function(_0x44dd87){logger[_0x23cb('0x15')](_0x23cb('0x18'),_0x44dd87[_0x23cb('0x16')],_0x169c7f);_0x1720b2(_0x56e7db[_0x23cb('0x15')](0x1f4,_0x44dd87[_0x23cb('0x16')]));});});};exports[_0x23cb('0x24')]=function(_0x4317bc){return new Promise(function(_0x4ab136,_0x597cae){return db['SmsInteraction'][_0x23cb('0x25')]({'where':_0x4317bc[_0x23cb('0x1c')]?_0x4317bc['options']['where']||null:null})[_0x23cb('0x20')](function(_0x4a3d69){if(_0x4a3d69){return _0x4a3d69['addTags'](_0x4317bc[_0x23cb('0x1b')][_0x23cb('0x26')],_[_0x23cb('0x27')](_0x4317bc[_0x23cb('0x1b')],[_0x23cb('0x26'),'id'])||{});}})[_0x23cb('0x28')](function(_0x39398f){logger[_0x23cb('0x12')](_0x23cb('0x29'),_0x4317bc);logger[_0x23cb('0x21')](_0x23cb('0x29'),_0x4317bc,JSON[_0x23cb('0x22')](_0x39398f));_0x4ab136(_0x39398f);})[_0x23cb('0x23')](function(_0x3d8a2f){logger['error'](_0x23cb('0x29'),_0x3d8a2f['message'],_0x4317bc);_0x597cae(_this[_0x23cb('0x15')](0x1f4,_0x3d8a2f[_0x23cb('0x16')]));});});}; \ No newline at end of file +var _0x6193=['where','attributes','limit','then','debug','AddTagsToSmsInteraction','find','addTags','omit','ids','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsInteraction.socket','register','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw'];(function(_0x546012,_0x29b549){var _0x43b7e2=function(_0x152435){while(--_0x152435){_0x546012['push'](_0x546012['shift']());}};_0x43b7e2(++_0x29b549);}(_0x6193,0x107));var _0x3619=function(_0xa91f22,_0x546c7b){_0xa91f22=_0xa91f22-0x0;var _0x4dabec=_0x6193[_0xa91f22];return _0x4dabec;};'use strict';var _=require('lodash');var util=require(_0x3619('0x0'));var moment=require(_0x3619('0x1'));var BPromise=require(_0x3619('0x2'));var rs=require(_0x3619('0x3'));var fs=require('fs');var Redis=require(_0x3619('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3619('0x5'));var logger=require('../../config/logger')(_0x3619('0x6'));var config=require(_0x3619('0x7'));var jayson=require(_0x3619('0x8'));var client=jayson[_0x3619('0x9')][_0x3619('0xa')]({'port':0x232a});config[_0x3619('0xb')]=_[_0x3619('0xc')](config[_0x3619('0xb')],{'host':_0x3619('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3619('0xe'))[_0x3619('0xf')](socket);function respondWithRpcPromise(_0xc3ec66,_0x4873f2,_0x250cfd){return new BPromise(function(_0x12f8e7,_0x1bce42){return client['request'](_0xc3ec66,_0x250cfd)['then'](function(_0x3de1a7){logger[_0x3619('0x10')](_0x3619('0x11'),_0x4873f2,_0x3619('0x12'));logger['debug'](_0x3619('0x13'),_0x4873f2,_0x3619('0x12'),JSON[_0x3619('0x14')](_0x3de1a7));if(_0x3de1a7[_0x3619('0x15')]){if(_0x3de1a7[_0x3619('0x15')]['code']===0x1f4){logger[_0x3619('0x15')](_0x3619('0x11'),_0x4873f2,_0x3de1a7[_0x3619('0x15')]['message']);return _0x1bce42(_0x3de1a7[_0x3619('0x15')]['message']);}logger[_0x3619('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x4873f2,_0x3de1a7[_0x3619('0x15')][_0x3619('0x16')]);return _0x12f8e7(_0x3de1a7[_0x3619('0x15')][_0x3619('0x16')]);}else{logger[_0x3619('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x4873f2,_0x3619('0x12'));_0x12f8e7(_0x3de1a7[_0x3619('0x17')]['message']);}})[_0x3619('0x18')](function(_0x15b004){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x4873f2,_0x15b004);_0x1bce42(_0x15b004);});});}exports[_0x3619('0x19')]=function(_0x15aa31){var _0x27dba0=this;return new Promise(function(_0x506b37,_0x14b0cb){return db[_0x3619('0x1a')][_0x3619('0x1b')](_0x15aa31[_0x3619('0x1c')],{'raw':_0x15aa31[_0x3619('0x1d')]?_0x15aa31['options'][_0x3619('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15aa31['options']?_0x15aa31[_0x3619('0x1d')][_0x3619('0x1f')]||null:null,'attributes':_0x15aa31[_0x3619('0x1d')]?_0x15aa31[_0x3619('0x1d')][_0x3619('0x20')]||null:null,'limit':_0x15aa31[_0x3619('0x1d')]?_0x15aa31[_0x3619('0x1d')][_0x3619('0x21')]||null:null})[_0x3619('0x22')](function(_0x21e332){logger[_0x3619('0x10')]('UpdateSmsInteraction',_0x15aa31);logger[_0x3619('0x23')](_0x3619('0x19'),_0x15aa31,JSON[_0x3619('0x14')](_0x21e332));_0x506b37(_0x21e332);})[_0x3619('0x18')](function(_0x42f4a4){logger[_0x3619('0x15')](_0x3619('0x19'),_0x42f4a4[_0x3619('0x16')],_0x15aa31);_0x14b0cb(_0x27dba0[_0x3619('0x15')](0x1f4,_0x42f4a4[_0x3619('0x16')]));});});};exports[_0x3619('0x24')]=function(_0x41f896){return new Promise(function(_0x5d77e1,_0x38ad88){return db[_0x3619('0x1a')][_0x3619('0x25')]({'where':_0x41f896['options']?_0x41f896['options'][_0x3619('0x1f')]||null:null})[_0x3619('0x22')](function(_0x514f61){if(_0x514f61){return _0x514f61[_0x3619('0x26')](_0x41f896[_0x3619('0x1c')]['ids'],_[_0x3619('0x27')](_0x41f896[_0x3619('0x1c')],[_0x3619('0x28'),'id'])||{});}})['spread'](function(_0x1f842c){logger[_0x3619('0x10')]('AddTags',_0x41f896);logger[_0x3619('0x23')](_0x3619('0x29'),_0x41f896,JSON[_0x3619('0x14')](_0x1f842c));_0x5d77e1(_0x1f842c);})[_0x3619('0x18')](function(_0x28687c){logger[_0x3619('0x15')](_0x3619('0x29'),_0x28687c['message'],_0x41f896);_0x38ad88(_this['error'](0x1f4,_0x28687c[_0x3619('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 1b0ee8d..df12390 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 _0x1c42=['emit','removeListener','register','length','smsInteraction:','save','update'];(function(_0x360221,_0x3508db){var _0x122542=function(_0x1ef1c7){while(--_0x1ef1c7){_0x360221['push'](_0x360221['shift']());}};_0x122542(++_0x3508db);}(_0x1c42,0x124));var _0x21c4=function(_0x496b81,_0x22571c){_0x496b81=_0x496b81-0x0;var _0xd99bbe=_0x1c42[_0x496b81];return _0xd99bbe;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x21c4('0x0'),'remove',_0x21c4('0x1')];function createListener(_0x5d432a,_0x2bb36d){return function(_0xaccc70){_0x2bb36d[_0x21c4('0x2')](_0x5d432a,_0xaccc70);};}function removeListener(_0x36a896,_0x1d6f21){return function(){SmsInteractionEvents[_0x21c4('0x3')](_0x36a896,_0x1d6f21);};}exports[_0x21c4('0x4')]=function(_0x24950b){for(var _0x55b00e=0x0,_0x3a18b1=events[_0x21c4('0x5')];_0x55b00e<_0x3a18b1;_0x55b00e++){var _0x4b4f04=events[_0x55b00e];var _0x2fb3d9=createListener(_0x21c4('0x6')+_0x4b4f04,_0x24950b);SmsInteractionEvents['on'](_0x4b4f04,_0x2fb3d9);}}; \ No newline at end of file +var _0x68b4=['remove','emit','register','length','smsInteraction:','./smsInteraction.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x68b4,0x191));var _0x468b=function(_0x52475e,_0x33f505){_0x52475e=_0x52475e-0x0;var _0x49319c=_0x68b4[_0x52475e];return _0x49319c;};'use strict';var SmsInteractionEvents=require(_0x468b('0x0'));var events=['save',_0x468b('0x1'),'update'];function createListener(_0x325ed1,_0x3e6420){return function(_0x344b53){_0x3e6420[_0x468b('0x2')](_0x325ed1,_0x344b53);};}function removeListener(_0x2973b1,_0xbc03d){return function(){SmsInteractionEvents['removeListener'](_0x2973b1,_0xbc03d);};}exports[_0x468b('0x3')]=function(_0x3d1259){for(var _0x3f286d=0x0,_0x24cb42=events[_0x468b('0x4')];_0x3f286d<_0x24cb42;_0x3f286d++){var _0x10cd9c=events[_0x3f286d];var _0x3c5880=createListener(_0x468b('0x5')+_0x10cd9c,_0x3d1259);SmsInteractionEvents['on'](_0x10cd9c,_0x3c5880);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 7b01926..48f84d1 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 _0x6017=['multer','util','path','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','tracked','sms','create','post','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x6017,0xae));var _0x7601=function(_0x4c9bec,_0x3ff0f0){_0x4c9bec=_0x4c9bec-0x0;var _0x265c75=_0x6017[_0x4c9bec];return _0x265c75;};'use strict';var multer=require(_0x7601('0x0'));var util=require(_0x7601('0x1'));var path=require(_0x7601('0x2'));var timeout=require('connect-timeout');var express=require(_0x7601('0x3'));var router=express[_0x7601('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7601('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7601('0x6'));var controller=require('./smsMessage.controller');router['get']('/',auth[_0x7601('0x7')](),controller[_0x7601('0x8')]);router[_0x7601('0x9')](_0x7601('0xa'),auth[_0x7601('0x7')](),controller[_0x7601('0xb')]);router['get'](_0x7601('0xc'),auth[_0x7601('0x7')](),controller[_0x7601('0xd')]);router['post']('/',auth[_0x7601('0x7')](),interaction[_0x7601('0xe')](_0x7601('0xf'),'smsmessage:create'),controller[_0x7601('0x10')]);router[_0x7601('0x11')](_0x7601('0x12'),controller[_0x7601('0x13')]);router[_0x7601('0x14')](_0x7601('0xc'),auth[_0x7601('0x7')](),controller[_0x7601('0x15')]);router[_0x7601('0x14')](_0x7601('0x16'),auth['isAuthenticated'](),controller[_0x7601('0x17')]);router['put'](_0x7601('0x18'),auth[_0x7601('0x7')](),controller[_0x7601('0x19')]);router[_0x7601('0x1a')](_0x7601('0xc'),auth[_0x7601('0x7')](),controller[_0x7601('0x1b')]);module[_0x7601('0x1c')]=router; \ No newline at end of file +var _0xaf4c=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','get','/describe','describe','/:id','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','/:id/accept','/:id/reject','reject','destroy','exports','util'];(function(_0x4a33f1,_0x3ab06b){var _0xda34fc=function(_0x511801){while(--_0x511801){_0x4a33f1['push'](_0x4a33f1['shift']());}};_0xda34fc(++_0x3ab06b);}(_0xaf4c,0x1ed));var _0xcaf4=function(_0x23d804,_0x45aa8f){_0x23d804=_0x23d804-0x0;var _0x3c7139=_0xaf4c[_0x23d804];return _0x3c7139;};'use strict';var multer=require('multer');var util=require(_0xcaf4('0x0'));var path=require(_0xcaf4('0x1'));var timeout=require('connect-timeout');var express=require(_0xcaf4('0x2'));var router=express[_0xcaf4('0x3')]();var fs_extra=require(_0xcaf4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcaf4('0x5'));var config=require(_0xcaf4('0x6'));var controller=require(_0xcaf4('0x7'));router['get']('/',auth[_0xcaf4('0x8')](),controller['index']);router[_0xcaf4('0x9')](_0xcaf4('0xa'),auth[_0xcaf4('0x8')](),controller[_0xcaf4('0xb')]);router[_0xcaf4('0x9')](_0xcaf4('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xcaf4('0xd')]('/',auth[_0xcaf4('0x8')](),interaction[_0xcaf4('0xe')](_0xcaf4('0xf'),_0xcaf4('0x10')),controller[_0xcaf4('0x11')]);router[_0xcaf4('0xd')](_0xcaf4('0x12'),controller[_0xcaf4('0x13')]);router['put'](_0xcaf4('0xc'),auth[_0xcaf4('0x8')](),controller['update']);router[_0xcaf4('0x14')](_0xcaf4('0x15'),auth[_0xcaf4('0x8')](),controller['accept']);router[_0xcaf4('0x14')](_0xcaf4('0x16'),auth['isAuthenticated'](),controller[_0xcaf4('0x17')]);router['delete'](_0xcaf4('0xc'),auth[_0xcaf4('0x8')](),controller[_0xcaf4('0x18')]);module[_0xcaf4('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 0f7e85f..a2c9ee9 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 _0x861a=['ENUM','out','STRING','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x25fded,_0x34216e){var _0x269156=function(_0x190fe0){while(--_0x190fe0){_0x25fded['push'](_0x25fded['shift']());}};_0x269156(++_0x34216e);}(_0x861a,0x194));var _0xa861=function(_0x3ddbf8,_0x306050){_0x3ddbf8=_0x3ddbf8-0x0;var _0x363d1a=_0x861a[_0x3ddbf8];return _0x363d1a;};'use strict';var Sequelize=require(_0xa861('0x0'));module['exports']={'body':{'type':Sequelize[_0xa861('0x1')](_0xa861('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xa861('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa861('0x4')]('in',_0xa861('0x5')),'defaultValue':_0xa861('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xa861('0x6')]},'readAt':{'type':Sequelize[_0xa861('0x7')]},'secret':{'type':Sequelize[_0xa861('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa861('0x6')]},'providerResponse':{'type':Sequelize[_0xa861('0x1')]}}; \ No newline at end of file +var _0x03dc=['sequelize','exports','BOOLEAN','ENUM','out','STRING','TEXT'];(function(_0x53a469,_0x21de43){var _0x297a6e=function(_0x1bcaf8){while(--_0x1bcaf8){_0x53a469['push'](_0x53a469['shift']());}};_0x297a6e(++_0x21de43);}(_0x03dc,0x85));var _0xc03d=function(_0x4409bf,_0x305f4c){_0x4409bf=_0x4409bf-0x0;var _0x3b71bb=_0x03dc[_0x4409bf];return _0x3b71bb;};'use strict';var Sequelize=require(_0xc03d('0x0'));module[_0xc03d('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xc03d('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc03d('0x3')]('in',_0xc03d('0x4')),'defaultValue':_0xc03d('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc03d('0x5')](0xbe)},'phone':{'type':Sequelize[_0xc03d('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xc03d('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc03d('0x5')]},'providerResponse':{'type':Sequelize[_0xc03d('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index a8cccc7..43e39e4 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 _0x9906=['merge','VIRTUAL','SmsMessage','includeAll','include','rows','show','params','keys','options','find','create','body','describe','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','internal','SIP/%s','channel','motionChannel','event','EventManager','sms-interactions','reject','sms','SmsInteraction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','email','interface','rejectmessage','SmsAccount','SmsAccountId','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','register','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x656f1c,_0x20b306){var _0xe6efed=function(_0x183f28){while(--_0x183f28){_0x656f1c['push'](_0x656f1c['shift']());}};_0xe6efed(++_0x20b306);}(_0x9906,0x1f1));var _0x6990=function(_0x56f58c,_0x2b983a){_0x56f58c=_0x56f58c-0x0;var _0x50ab50=_0x9906[_0x56f58c];return _0x50ab50;};'use strict';var emlformat=require(_0x6990('0x0'));var rimraf=require(_0x6990('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6990('0x2'));var moment=require(_0x6990('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6990('0x4'));var util=require(_0x6990('0x5'));var path=require(_0x6990('0x6'));var sox=require('sox');var csv=require(_0x6990('0x7'));var ejs=require(_0x6990('0x8'));var fs=require('fs');var fs_extra=require(_0x6990('0x9'));var _=require('lodash');var squel=require(_0x6990('0xa'));var crypto=require(_0x6990('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6990('0xc'));var toCsv=require(_0x6990('0x7'));var querystring=require(_0x6990('0xd'));var Papa=require('papaparse');var Redis=require(_0x6990('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6990('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6990('0x10'));var logger=require(_0x6990('0x11'))(_0x6990('0x12'));var utils=require(_0x6990('0x13'));var config=require(_0x6990('0x14'));var licenseUtil=require(_0x6990('0x15'));var db=require(_0x6990('0x16'))['db'];config[_0x6990('0x17')]=_[_0x6990('0x18')](config[_0x6990('0x17')],{'host':_0x6990('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6990('0x17')]));require(_0x6990('0x1a'))[_0x6990('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6990('0x1c')][_0x6990('0x1d')]({'port':0x232c});var client9002=jayson[_0x6990('0x1c')][_0x6990('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xfd415b,_0x351c80,_0x68b7c0,_0x5bb59b){return new BPromise(function(_0x4d42ab,_0x9a1121){var _0x458094=_0x5bb59b||client;return _0x458094[_0x6990('0x1e')](_0xfd415b,_0x68b7c0)[_0x6990('0x1f')](function(_0x453b7e){logger[_0x6990('0x20')](_0x6990('0x21'),_0x351c80,_0x6990('0x22'));logger[_0x6990('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x351c80,_0x6990('0x22'),JSON[_0x6990('0x24')](_0x453b7e));if(_0x453b7e['error']){if(_0x453b7e['error'][_0x6990('0x25')]===0x1f4){logger[_0x6990('0x26')]('SmsMessage,\x20%s,\x20%s',_0x351c80,_0x453b7e[_0x6990('0x26')][_0x6990('0x27')]);return _0x9a1121(_0x453b7e[_0x6990('0x26')][_0x6990('0x27')]);}logger['error'](_0x6990('0x21'),_0x351c80,_0x453b7e[_0x6990('0x26')][_0x6990('0x27')]);return _0x4d42ab(_0x453b7e[_0x6990('0x26')][_0x6990('0x27')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x351c80,_0x6990('0x22'));_0x4d42ab(_0x453b7e['result'][_0x6990('0x27')]);}})[_0x6990('0x28')](function(_0x5f5afa){logger[_0x6990('0x26')](_0x6990('0x21'),_0x351c80,_0x5f5afa);_0x9a1121(_0x5f5afa);});});}function respondWithStatusCode(_0x326701,_0x14ad37){_0x14ad37=_0x14ad37||0xcc;return function(_0x36fd42){if(_0x36fd42){return _0x326701[_0x6990('0x29')](_0x14ad37);}return _0x326701[_0x6990('0x2a')](_0x14ad37)[_0x6990('0x2b')]();};}function respondWithResult(_0x2ccbd5,_0x1eb169){_0x1eb169=_0x1eb169||0xc8;return function(_0x205d32){if(_0x205d32){return _0x2ccbd5[_0x6990('0x2a')](_0x1eb169)[_0x6990('0x2c')](_0x205d32);}};}function respondWithFilteredResult(_0x4736fe,_0x2bf2bf){return function(_0x863fe7){if(_0x863fe7){var _0x42b755=typeof _0x2bf2bf[_0x6990('0x2d')]===_0x6990('0x2e')&&typeof _0x2bf2bf[_0x6990('0x2f')]===_0x6990('0x2e');var _0x26fd87=_0x863fe7['count'];var _0x525008=_0x42b755?0x0:_0x2bf2bf[_0x6990('0x2d')];var _0x751bf2=_0x42b755?_0x863fe7[_0x6990('0x30')]:_0x2bf2bf[_0x6990('0x2d')]+_0x2bf2bf[_0x6990('0x2f')];var _0x877600;if(_0x751bf2>=_0x26fd87){_0x751bf2=_0x26fd87;_0x877600=0xc8;}else{_0x877600=0xce;}_0x4736fe[_0x6990('0x2a')](_0x877600);return _0x4736fe[_0x6990('0x31')](_0x6990('0x32'),_0x525008+'-'+_0x751bf2+'/'+_0x26fd87)[_0x6990('0x2c')](_0x863fe7);}return null;};}function patchUpdates(_0x3d96f7){return function(_0xe8a957){try{jsonpatch['apply'](_0xe8a957,_0x3d96f7,!![]);}catch(_0x54df8f){return BPromise['reject'](_0x54df8f);}return _0xe8a957['save']();};}function saveUpdates(_0x329647,_0x46830b){return function(_0x5e57f7){if(_0x5e57f7){return _0x5e57f7[_0x6990('0x33')](_0x329647)['then'](function(_0x136bf7){return _0x136bf7;});}return null;};}function removeEntity(_0x4de7cb,_0x2c1f0e){return function(_0x10ccde){if(_0x10ccde){return _0x10ccde[_0x6990('0x34')]()[_0x6990('0x1f')](function(){_0x4de7cb[_0x6990('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49f36a,_0xd21afe){return function(_0x42ac82){if(!_0x42ac82){_0x49f36a[_0x6990('0x29')](0x194);}return _0x42ac82;};}function handleError(_0x4d9ba4,_0x5e3a72){_0x5e3a72=_0x5e3a72||0x1f4;return function(_0x4eec63){logger[_0x6990('0x26')](_0x4eec63['stack']);if(_0x4eec63[_0x6990('0x35')]){delete _0x4eec63[_0x6990('0x35')];}_0x4d9ba4['status'](_0x5e3a72)[_0x6990('0x36')](_0x4eec63);};}exports[_0x6990('0x37')]=function(_0x396f95,_0x11d1b5){var _0x103a0f={},_0x18d14a={},_0x2dea57={'count':0x0,'rows':[]};var _0x2eb42e=_['map'](db['SmsMessage'][_0x6990('0x38')],function(_0x19a236){return{'name':_0x19a236[_0x6990('0x39')],'type':_0x19a236[_0x6990('0x3a')][_0x6990('0x3b')]};});_0x18d14a[_0x6990('0x3c')]=_[_0x6990('0x3d')](_0x2eb42e,_0x6990('0x35'));_0x18d14a[_0x6990('0x3e')]=_['keys'](_0x396f95[_0x6990('0x3e')]);_0x18d14a[_0x6990('0x3f')]=_[_0x6990('0x40')](_0x18d14a[_0x6990('0x3c')],_0x18d14a['query']);_0x103a0f['attributes']=_[_0x6990('0x40')](_0x18d14a['model'],qs['fields'](_0x396f95[_0x6990('0x3e')][_0x6990('0x41')]));_0x103a0f['attributes']=_0x103a0f[_0x6990('0x42')][_0x6990('0x43')]?_0x103a0f['attributes']:_0x18d14a[_0x6990('0x3c')];if(!_0x396f95[_0x6990('0x3e')][_0x6990('0x44')](_0x6990('0x45'))){_0x103a0f[_0x6990('0x2f')]=qs[_0x6990('0x2f')](_0x396f95[_0x6990('0x3e')][_0x6990('0x2f')]);_0x103a0f[_0x6990('0x2d')]=qs[_0x6990('0x2d')](_0x396f95[_0x6990('0x3e')][_0x6990('0x2d')]);}_0x103a0f[_0x6990('0x46')]=qs['sort'](_0x396f95[_0x6990('0x3e')][_0x6990('0x47')]);_0x103a0f['where']=qs[_0x6990('0x3f')](_[_0x6990('0x48')](_0x396f95['query'],_0x18d14a[_0x6990('0x3f')]),_0x2eb42e);if(_0x396f95[_0x6990('0x3e')][_0x6990('0x49')]){_0x103a0f[_0x6990('0x4a')]=_[_0x6990('0x4b')](_0x103a0f[_0x6990('0x4a')],{'$or':_[_0x6990('0x3d')](_0x2eb42e,function(_0x3c443b){if(_0x3c443b[_0x6990('0x3a')]!==_0x6990('0x4c')){var _0x446952={};_0x446952[_0x3c443b['name']]={'$like':'%'+_0x396f95['query'][_0x6990('0x49')]+'%'};return _0x446952;}})});}_0x103a0f=_[_0x6990('0x4b')]({},_0x103a0f,_0x396f95['options']);var _0x277428={'where':_0x103a0f[_0x6990('0x4a')]};return db[_0x6990('0x4d')][_0x6990('0x30')](_0x277428)['then'](function(_0x5c14fb){_0x2dea57[_0x6990('0x30')]=_0x5c14fb;if(_0x396f95[_0x6990('0x3e')][_0x6990('0x4e')]){_0x103a0f[_0x6990('0x4f')]=[{'all':!![]}];}return db[_0x6990('0x4d')]['findAll'](_0x103a0f);})[_0x6990('0x1f')](function(_0x5367d4){_0x2dea57[_0x6990('0x50')]=_0x5367d4;return _0x2dea57;})['then'](respondWithFilteredResult(_0x11d1b5,_0x103a0f))[_0x6990('0x28')](handleError(_0x11d1b5,null));};exports[_0x6990('0x51')]=function(_0x56c09c,_0x5d18da){var _0x57e5e9={'raw':!![],'where':{'id':_0x56c09c[_0x6990('0x52')]['id']}},_0x5b7499={};_0x5b7499['model']=_[_0x6990('0x53')](db[_0x6990('0x4d')][_0x6990('0x38')]);_0x5b7499[_0x6990('0x3e')]=_[_0x6990('0x53')](_0x56c09c[_0x6990('0x3e')]);_0x5b7499['filters']=_[_0x6990('0x40')](_0x5b7499['model'],_0x5b7499[_0x6990('0x3e')]);_0x57e5e9[_0x6990('0x42')]=_['intersection'](_0x5b7499['model'],qs[_0x6990('0x41')](_0x56c09c[_0x6990('0x3e')][_0x6990('0x41')]));_0x57e5e9['attributes']=_0x57e5e9['attributes'][_0x6990('0x43')]?_0x57e5e9[_0x6990('0x42')]:_0x5b7499['model'];if(_0x56c09c[_0x6990('0x3e')][_0x6990('0x4e')]){_0x57e5e9[_0x6990('0x4f')]=[{'all':!![]}];}_0x57e5e9=_[_0x6990('0x4b')]({},_0x57e5e9,_0x56c09c[_0x6990('0x54')]);return db['SmsMessage'][_0x6990('0x55')](_0x57e5e9)[_0x6990('0x1f')](handleEntityNotFound(_0x5d18da,null))['then'](respondWithResult(_0x5d18da,null))['catch'](handleError(_0x5d18da,null));};exports[_0x6990('0x56')]=function(_0x2bda3e,_0x2a13d6){return db[_0x6990('0x4d')]['create'](_0x2bda3e[_0x6990('0x57')],{})[_0x6990('0x1f')](respondWithResult(_0x2a13d6,0xc9))[_0x6990('0x28')](handleError(_0x2a13d6,null));};exports[_0x6990('0x33')]=function(_0x411137,_0x51a8fb){if(_0x411137[_0x6990('0x57')]['id']){delete _0x411137[_0x6990('0x57')]['id'];}return db['SmsMessage'][_0x6990('0x55')]({'where':{'id':_0x411137[_0x6990('0x52')]['id']}})[_0x6990('0x1f')](handleEntityNotFound(_0x51a8fb,null))['then'](saveUpdates(_0x411137['body'],null))[_0x6990('0x1f')](respondWithResult(_0x51a8fb,null))[_0x6990('0x28')](handleError(_0x51a8fb,null));};exports[_0x6990('0x34')]=function(_0x5bb73d,_0x40b947){return db[_0x6990('0x4d')][_0x6990('0x55')]({'where':{'id':_0x5bb73d['params']['id']}})['then'](handleEntityNotFound(_0x40b947,null))['then'](removeEntity(_0x40b947,null))[_0x6990('0x28')](handleError(_0x40b947,null));};exports[_0x6990('0x58')]=function(_0xaa3f44,_0xaef210){return db[_0x6990('0x4d')]['describe']()['then'](respondWithResult(_0xaef210,null))[_0x6990('0x28')](handleError(_0xaef210,null));};var interaction_log=require(_0x6990('0x11'))('sms-interactions');exports[_0x6990('0x59')]=function(_0x32537e,_0x36ce04,_0x5ac1eb){var _0x4b9560={'agent':{},'channel':'sms'};if(_0x32537e[_0x6990('0x57')]['id']){delete _0x32537e[_0x6990('0x57')]['id'];}_0x32537e['body']['read']=!![];_0x32537e[_0x6990('0x57')][_0x6990('0x5a')]=moment()[_0x6990('0x5b')](_0x6990('0x5c'));_0x32537e[_0x6990('0x57')]['UserId']=_0x32537e[_0x6990('0x57')][_0x6990('0x5d')]||_0x32537e[_0x6990('0x5e')]['id'];_0x4b9560[_0x6990('0x5f')]['id']=_0x32537e['body'][_0x6990('0x5d')];return db[_0x6990('0x4d')]['find']({'where':{'id':_0x32537e['params']['id'],'UserId':null}})[_0x6990('0x1f')](handleEntityNotFound(_0x36ce04,null))[_0x6990('0x1f')](saveUpdates(_0x32537e['body'],null))[_0x6990('0x1f')](function(_0x31fffa){if(_0x31fffa){_0x4b9560[_0x6990('0x27')]=_0x31fffa[_0x6990('0x60')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x31fffa[_0x6990('0x61')]}});}return null;})[_0x6990('0x1f')](handleEntityNotFound(_0x36ce04,null))[_0x6990('0x1f')](function(_0xf68ac9){if(_0xf68ac9){return _0xf68ac9['update']({'UserId':_0x32537e[_0x6990('0x57')][_0x6990('0x5d')],'read1stAt':_[_0x6990('0x62')](_0xf68ac9[_0x6990('0x63')])?moment()[_0x6990('0x5b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6990('0x1f')](function(_0x48b8b2){if(_0x48b8b2){_0x4b9560[_0x6990('0x64')]=_0x48b8b2[_0x6990('0x60')]({'plain':!![]});interaction_log[_0x6990('0x20')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x32537e['user']['id'],_0x32537e[_0x6990('0x5e')][_0x6990('0x35')],_0x32537e[_0x6990('0x5e')][_0x6990('0x65')],_0x4b9560[_0x6990('0x64')]['id'],_0x32537e[_0x6990('0x57')]?JSON[_0x6990('0x24')](_0x32537e[_0x6990('0x57')]):_0x6990('0x66'));return respondWithRpcPromise(_0x6990('0x67'),_0x6990('0x68'),_0x4b9560);}return null;})[_0x6990('0x1f')](function(_0x3f7b7c){var _0x52069e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3f7b7c[_0x6990('0x27')][_0x6990('0x69')];return db[_0x6990('0x6a')][_0x6990('0x3e')](_0x52069e,{'type':db[_0x6990('0x6b')][_0x6990('0x6c')][_0x6990('0x6d')],'raw':!![]})[_0x6990('0x1f')](function(_0x419db6){return _0x419db6;});})[_0x6990('0x1f')](function(_0x5f411e){if(_0x5f411e){_0x4b9560['message'][_0x6990('0x6e')]=_0x5f411e[0x0];if(!_0x32537e[_0x6990('0x57')][_0x6990('0x5d')])return;return db['User']['find']({'where':{'id':_0x32537e[_0x6990('0x57')]['UserId'],'role':_0x6990('0x5f')},'attributes':['id',_0x6990('0x35'),_0x6990('0x6f'),'email',_0x6990('0x70')],'raw':!![]});}return null;})[_0x6990('0x1f')](function(_0x5bd529){if(!_0x5bd529)return null;_0x4b9560[_0x6990('0x27')][_0x6990('0x5f')]=_0x5bd529;return _0x4b9560;})['then'](function(_0x554f4c){if(_0x554f4c){if(_0x32537e[_0x6990('0x57')]['manual']){_0x4b9560[_0x6990('0x27')]['interface']=util[_0x6990('0x5b')](_0x6990('0x71'),_0x32537e[_0x6990('0x5e')][_0x6990('0x35')]);_0x4b9560['message'][_0x6990('0x72')]=_0x4b9560[_0x6990('0x72')];_0x4b9560[_0x6990('0x27')][_0x6990('0x73')]=_0x4b9560[_0x6990('0x72')];_0x4b9560[_0x6990('0x27')][_0x6990('0x74')]=_0x6990('0x59');return respondWithRpcPromise(_0x6990('0x75'),_0x6990('0x75'),{'event':'acceptmessage','message':_0x4b9560[_0x6990('0x27')]},client9002)[_0x6990('0x1f')](function(){return _0x4b9560;});}return _0x4b9560;}return null;})[_0x6990('0x1f')](respondWithResult(_0x36ce04,null))[_0x6990('0x28')](handleError(_0x36ce04,null));};var interaction_log=require(_0x6990('0x11'))(_0x6990('0x76'));exports[_0x6990('0x77')]=function(_0x283cab,_0x5ca1c3,_0x34daf2){var _0x5ef65b={'agent':{},'channel':_0x6990('0x78')};if(_0x283cab[_0x6990('0x57')]['id']){delete _0x283cab[_0x6990('0x57')]['id'];}_0x283cab[_0x6990('0x57')][_0x6990('0x5d')]=_0x283cab[_0x6990('0x57')]['UserId']||_0x283cab[_0x6990('0x5e')]['id'];_0x5ef65b[_0x6990('0x5f')]['id']=_0x283cab[_0x6990('0x57')][_0x6990('0x5d')];return db[_0x6990('0x4d')]['find']({'where':{'id':_0x283cab[_0x6990('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5ca1c3,null))[_0x6990('0x1f')](function(_0xa71c2e){if(_0xa71c2e){_0x5ef65b[_0x6990('0x27')]=_0xa71c2e[_0x6990('0x60')]({'plain':!![]});return db[_0x6990('0x79')][_0x6990('0x55')]({'where':{'id':_0xa71c2e[_0x6990('0x61')]}});}return null;})[_0x6990('0x1f')](handleEntityNotFound(_0x5ca1c3,null))['then'](function(_0x78f906){if(_0x78f906){_0x5ef65b[_0x6990('0x64')]=_0x78f906[_0x6990('0x60')]({'plain':!![]});interaction_log[_0x6990('0x20')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x283cab[_0x6990('0x5e')]['id'],_0x283cab[_0x6990('0x5e')][_0x6990('0x35')],_0x283cab['user'][_0x6990('0x65')],_0x5ef65b[_0x6990('0x64')]['id'],_0x283cab[_0x6990('0x57')]?JSON[_0x6990('0x24')](_0x283cab['body']):_0x6990('0x66'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x5ef65b);}return null;})['then'](function(_0x5cfc7d){var _0x22d14f=_0x6990('0x7a')+_0x5cfc7d[_0x6990('0x27')][_0x6990('0x69')];return db[_0x6990('0x6a')]['query'](_0x22d14f,{'type':db[_0x6990('0x6b')][_0x6990('0x6c')][_0x6990('0x6d')],'raw':!![]})[_0x6990('0x1f')](function(_0x56b2fb){return _0x56b2fb;});})[_0x6990('0x1f')](function(_0xcbf9e5){if(_0xcbf9e5){_0x5ef65b[_0x6990('0x27')][_0x6990('0x6e')]=_0xcbf9e5[0x0];if(!_0x283cab[_0x6990('0x57')][_0x6990('0x5d')])return;return db['User'][_0x6990('0x55')]({'where':{'id':_0x283cab['body'][_0x6990('0x5d')],'role':_0x6990('0x5f')},'attributes':['id',_0x6990('0x35'),'fullname',_0x6990('0x7b'),_0x6990('0x70')],'raw':!![]});}return null;})['then'](function(_0x25af8d){if(!_0x25af8d)return null;_0x5ef65b[_0x6990('0x27')][_0x6990('0x5f')]=_0x25af8d;return _0x5ef65b;})['then'](function(_0x41eb8b){if(_0x41eb8b){_0x41eb8b[_0x6990('0x27')][_0x6990('0x7c')]=util[_0x6990('0x5b')](_0x6990('0x71'),_0x283cab[_0x6990('0x5e')][_0x6990('0x35')]);_0x41eb8b[_0x6990('0x27')]['channel']=_0x5ef65b[_0x6990('0x72')];_0x41eb8b[_0x6990('0x27')][_0x6990('0x73')]=_0x5ef65b['channel'];_0x41eb8b[_0x6990('0x27')][_0x6990('0x74')]=_0x6990('0x77');respondWithRpcPromise(_0x6990('0x75'),_0x6990('0x75'),{'event':_0x6990('0x7d'),'message':_0x41eb8b['message']},client9002);return _0x5ef65b;}return null;})[_0x6990('0x1f')](respondWithResult(_0x5ca1c3,null))['catch'](handleError(_0x5ca1c3,null));};exports['status']=function(_0x374b9a,_0x5b8a7e,_0x134dd0){if(_0x374b9a['body']['id']){delete _0x374b9a['body']['id'];}var _0x1a4365;return db[_0x6990('0x4d')][_0x6990('0x55')]({'where':{'id':_0x374b9a[_0x6990('0x52')]['id']}})[_0x6990('0x1f')](handleEntityNotFound(_0x5b8a7e,null))[_0x6990('0x1f')](function(_0x15dec8){if(_0x15dec8){_0x1a4365=_0x15dec8;return db[_0x6990('0x7e')][_0x6990('0x55')]({'where':{'id':_0x15dec8[_0x6990('0x7f')]}});}})[_0x6990('0x1f')](handleEntityNotFound(_0x5b8a7e,null))['then'](function(_0x3e3c47){if(_0x3e3c47){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6990('0x2a'),'received\x20delivery\x20report\x20from',_0x3e3c47[_0x6990('0x3a')],util[_0x6990('0x80')](_0x374b9a['body'],{'showHidden':![],'depth':null}));switch(_0x3e3c47[_0x6990('0x3a')]){case'twilio':if(_0x374b9a[_0x6990('0x57')][_0x6990('0x81')]&&_0x374b9a[_0x6990('0x57')][_0x6990('0x81')]===_0x1a4365[_0x6990('0x82')]){return _0x1a4365['update']({'read':!![]});}else{logger[_0x6990('0x26')](_0x6990('0x83'),_0x6990('0x2a'),_0x6990('0x84'),util[_0x6990('0x80')](_0x374b9a[_0x6990('0x57')],{'showHidden':![],'depth':null}));}break;case _0x6990('0x85'):if(_0x374b9a[_0x6990('0x57')]['MessageUUID']&&_0x374b9a['body'][_0x6990('0x86')]===_0x1a4365[_0x6990('0x82')]&&_['indexOf']([_0x6990('0x87'),_0x6990('0x88')],_0x374b9a[_0x6990('0x57')][_0x6990('0x89')])>=0x0){return _0x1a4365[_0x6990('0x33')]({'read':!![]});}else{logger[_0x6990('0x26')](_0x6990('0x83'),_0x6990('0x2a'),_0x6990('0x8a'),util['inspect'](_0x374b9a[_0x6990('0x57')],{'showHidden':![],'depth':null}));}break;case _0x6990('0x8b'):var _0x420a34=_0x374b9a[_0x6990('0x57')][_0x6990('0x8c')][0x0];if(_0x420a34['status'][_0x6990('0x8d')]===_0x6990('0x8e')){return _0x1a4365[_0x6990('0x33')]({'read':!![]});}else{logger['error'](_0x6990('0x83'),_0x6990('0x2a'),_0x6990('0x8b'),util[_0x6990('0x80')](_0x374b9a[_0x6990('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x1a4365;}})[_0x6990('0x1f')](respondWithResult(_0x5b8a7e,null))[_0x6990('0x28')](handleError(_0x5b8a7e,null));}; \ No newline at end of file +var _0xb03e=['agent','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','sms','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','motionChannel','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','sent','Status','infobip','results','groupName','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','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','stringify','error','code','message','result','catch','sendStatus','status','end','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','SmsMessage','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','includeAll','merge','find','create','body','describe','sms-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','SmsInteractionId','read1stAt','interaction','get','[SMSMESSAGE: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','SELECT','contact','User','fullname','email','internal'];(function(_0xe7281f,_0x2d77c3){var _0x90dc99=function(_0x1e335b){while(--_0x1e335b){_0xe7281f['push'](_0xe7281f['shift']());}};_0x90dc99(++_0x2d77c3);}(_0xb03e,0x1eb));var _0xeb03=function(_0x420ea6,_0x23b3ae){_0x420ea6=_0x420ea6-0x0;var _0x57b470=_0xb03e[_0x420ea6];return _0x57b470;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb03('0x0'));var zipdir=require(_0xeb03('0x1'));var jsonpatch=require(_0xeb03('0x2'));var rp=require(_0xeb03('0x3'));var moment=require(_0xeb03('0x4'));var BPromise=require(_0xeb03('0x5'));var Mustache=require(_0xeb03('0x6'));var util=require(_0xeb03('0x7'));var path=require(_0xeb03('0x8'));var sox=require(_0xeb03('0x9'));var csv=require(_0xeb03('0xa'));var ejs=require(_0xeb03('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb03('0xc'));var squel=require(_0xeb03('0xd'));var crypto=require(_0xeb03('0xe'));var jsforce=require(_0xeb03('0xf'));var deskjs=require(_0xeb03('0x10'));var toCsv=require(_0xeb03('0xa'));var querystring=require('querystring');var Papa=require(_0xeb03('0x11'));var Redis=require(_0xeb03('0x12'));var authService=require(_0xeb03('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb03('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb03('0x15'))(_0xeb03('0x16'));var utils=require(_0xeb03('0x17'));var config=require(_0xeb03('0x18'));var licenseUtil=require(_0xeb03('0x19'));var db=require(_0xeb03('0x1a'))['db'];config[_0xeb03('0x1b')]=_[_0xeb03('0x1c')](config[_0xeb03('0x1b')],{'host':_0xeb03('0x1d'),'port':0x18eb});var socket=require(_0xeb03('0x1e'))(new Redis(config[_0xeb03('0x1b')]));require('./smsMessage.socket')[_0xeb03('0x1f')](socket);var jayson=require(_0xeb03('0x20'));var client=jayson[_0xeb03('0x21')][_0xeb03('0x22')]({'port':0x232c});var client9002=jayson['client'][_0xeb03('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x36f5d8,_0x3f26ef,_0x478989,_0x7ce874){return new BPromise(function(_0x46dd1b,_0x4095c3){var _0x44716c=_0x7ce874||client;return _0x44716c[_0xeb03('0x23')](_0x36f5d8,_0x478989)[_0xeb03('0x24')](function(_0x167a33){logger[_0xeb03('0x25')](_0xeb03('0x26'),_0x3f26ef,_0xeb03('0x27'));logger[_0xeb03('0x28')](_0xeb03('0x29'),_0x3f26ef,_0xeb03('0x27'),JSON[_0xeb03('0x2a')](_0x167a33));if(_0x167a33['error']){if(_0x167a33[_0xeb03('0x2b')][_0xeb03('0x2c')]===0x1f4){logger[_0xeb03('0x2b')](_0xeb03('0x26'),_0x3f26ef,_0x167a33[_0xeb03('0x2b')][_0xeb03('0x2d')]);return _0x4095c3(_0x167a33[_0xeb03('0x2b')][_0xeb03('0x2d')]);}logger[_0xeb03('0x2b')]('SmsMessage,\x20%s,\x20%s',_0x3f26ef,_0x167a33[_0xeb03('0x2b')][_0xeb03('0x2d')]);return _0x46dd1b(_0x167a33[_0xeb03('0x2b')][_0xeb03('0x2d')]);}else{logger[_0xeb03('0x25')]('SmsMessage,\x20%s,\x20%s',_0x3f26ef,_0xeb03('0x27'));_0x46dd1b(_0x167a33[_0xeb03('0x2e')][_0xeb03('0x2d')]);}})[_0xeb03('0x2f')](function(_0x3f276a){logger[_0xeb03('0x2b')](_0xeb03('0x26'),_0x3f26ef,_0x3f276a);_0x4095c3(_0x3f276a);});});}function respondWithStatusCode(_0x3f68f3,_0xbb7ff){_0xbb7ff=_0xbb7ff||0xcc;return function(_0x4984f6){if(_0x4984f6){return _0x3f68f3[_0xeb03('0x30')](_0xbb7ff);}return _0x3f68f3[_0xeb03('0x31')](_0xbb7ff)[_0xeb03('0x32')]();};}function respondWithResult(_0x1ada2e,_0x4cdea6){_0x4cdea6=_0x4cdea6||0xc8;return function(_0x581685){if(_0x581685){return _0x1ada2e[_0xeb03('0x31')](_0x4cdea6)['json'](_0x581685);}};}function respondWithFilteredResult(_0x31a622,_0x8bd544){return function(_0x160a37){if(_0x160a37){var _0x5db8bb=typeof _0x8bd544[_0xeb03('0x33')]==='undefined'&&typeof _0x8bd544['limit']==='undefined';var _0x538d19=_0x160a37[_0xeb03('0x34')];var _0x433ce8=_0x5db8bb?0x0:_0x8bd544['offset'];var _0x528479=_0x5db8bb?_0x160a37['count']:_0x8bd544['offset']+_0x8bd544[_0xeb03('0x35')];var _0x3655c3;if(_0x528479>=_0x538d19){_0x528479=_0x538d19;_0x3655c3=0xc8;}else{_0x3655c3=0xce;}_0x31a622[_0xeb03('0x31')](_0x3655c3);return _0x31a622[_0xeb03('0x36')](_0xeb03('0x37'),_0x433ce8+'-'+_0x528479+'/'+_0x538d19)['json'](_0x160a37);}return null;};}function patchUpdates(_0x13efc6){return function(_0x543a29){try{jsonpatch[_0xeb03('0x38')](_0x543a29,_0x13efc6,!![]);}catch(_0x13a016){return BPromise[_0xeb03('0x39')](_0x13a016);}return _0x543a29[_0xeb03('0x3a')]();};}function saveUpdates(_0x29a584,_0x436df2){return function(_0xdfb18){if(_0xdfb18){return _0xdfb18[_0xeb03('0x3b')](_0x29a584)['then'](function(_0x24256d){return _0x24256d;});}return null;};}function removeEntity(_0x4a68b4,_0x40de0c){return function(_0xe3c81a){if(_0xe3c81a){return _0xe3c81a[_0xeb03('0x3c')]()[_0xeb03('0x24')](function(){_0x4a68b4[_0xeb03('0x31')](0xcc)[_0xeb03('0x32')]();});}};}function handleEntityNotFound(_0x5a3915,_0x155b53){return function(_0x4bfd68){if(!_0x4bfd68){_0x5a3915['sendStatus'](0x194);}return _0x4bfd68;};}function handleError(_0x4c61e4,_0x164530){_0x164530=_0x164530||0x1f4;return function(_0x452868){logger[_0xeb03('0x2b')](_0x452868[_0xeb03('0x3d')]);if(_0x452868[_0xeb03('0x3e')]){delete _0x452868['name'];}_0x4c61e4[_0xeb03('0x31')](_0x164530)[_0xeb03('0x3f')](_0x452868);};}exports[_0xeb03('0x40')]=function(_0x51a4ba,_0x4efbb7){var _0xac05c4={},_0x27e61f={},_0x47118d={'count':0x0,'rows':[]};var _0x5a1ef1=_[_0xeb03('0x41')](db[_0xeb03('0x42')]['rawAttributes'],function(_0x49edb3){return{'name':_0x49edb3[_0xeb03('0x43')],'type':_0x49edb3[_0xeb03('0x44')]['key']};});_0x27e61f[_0xeb03('0x45')]=_[_0xeb03('0x41')](_0x5a1ef1,_0xeb03('0x3e'));_0x27e61f[_0xeb03('0x46')]=_[_0xeb03('0x47')](_0x51a4ba[_0xeb03('0x46')]);_0x27e61f[_0xeb03('0x48')]=_[_0xeb03('0x49')](_0x27e61f[_0xeb03('0x45')],_0x27e61f[_0xeb03('0x46')]);_0xac05c4[_0xeb03('0x4a')]=_[_0xeb03('0x49')](_0x27e61f[_0xeb03('0x45')],qs[_0xeb03('0x4b')](_0x51a4ba[_0xeb03('0x46')][_0xeb03('0x4b')]));_0xac05c4[_0xeb03('0x4a')]=_0xac05c4[_0xeb03('0x4a')][_0xeb03('0x4c')]?_0xac05c4[_0xeb03('0x4a')]:_0x27e61f[_0xeb03('0x45')];if(!_0x51a4ba[_0xeb03('0x46')][_0xeb03('0x4d')]('nolimit')){_0xac05c4['limit']=qs[_0xeb03('0x35')](_0x51a4ba[_0xeb03('0x46')][_0xeb03('0x35')]);_0xac05c4[_0xeb03('0x33')]=qs[_0xeb03('0x33')](_0x51a4ba[_0xeb03('0x46')][_0xeb03('0x33')]);}_0xac05c4[_0xeb03('0x4e')]=qs['sort'](_0x51a4ba[_0xeb03('0x46')][_0xeb03('0x4f')]);_0xac05c4[_0xeb03('0x50')]=qs[_0xeb03('0x48')](_[_0xeb03('0x51')](_0x51a4ba['query'],_0x27e61f['filters']),_0x5a1ef1);if(_0x51a4ba[_0xeb03('0x46')]['filter']){_0xac05c4['where']=_['merge'](_0xac05c4[_0xeb03('0x50')],{'$or':_[_0xeb03('0x41')](_0x5a1ef1,function(_0x38423f){if(_0x38423f[_0xeb03('0x44')]!==_0xeb03('0x52')){var _0x2393a0={};_0x2393a0[_0x38423f['name']]={'$like':'%'+_0x51a4ba[_0xeb03('0x46')]['filter']+'%'};return _0x2393a0;}})});}_0xac05c4=_['merge']({},_0xac05c4,_0x51a4ba[_0xeb03('0x53')]);var _0x841262={'where':_0xac05c4[_0xeb03('0x50')]};return db['SmsMessage'][_0xeb03('0x34')](_0x841262)[_0xeb03('0x24')](function(_0x351055){_0x47118d[_0xeb03('0x34')]=_0x351055;if(_0x51a4ba[_0xeb03('0x46')]['includeAll']){_0xac05c4[_0xeb03('0x54')]=[{'all':!![]}];}return db['SmsMessage'][_0xeb03('0x55')](_0xac05c4);})[_0xeb03('0x24')](function(_0x14f1d0){_0x47118d[_0xeb03('0x56')]=_0x14f1d0;return _0x47118d;})[_0xeb03('0x24')](respondWithFilteredResult(_0x4efbb7,_0xac05c4))[_0xeb03('0x2f')](handleError(_0x4efbb7,null));};exports[_0xeb03('0x57')]=function(_0x292319,_0x38c993){var _0x2fe435={'raw':!![],'where':{'id':_0x292319[_0xeb03('0x58')]['id']}},_0x40ea76={};_0x40ea76[_0xeb03('0x45')]=_[_0xeb03('0x47')](db[_0xeb03('0x42')][_0xeb03('0x59')]);_0x40ea76[_0xeb03('0x46')]=_[_0xeb03('0x47')](_0x292319[_0xeb03('0x46')]);_0x40ea76[_0xeb03('0x48')]=_[_0xeb03('0x49')](_0x40ea76[_0xeb03('0x45')],_0x40ea76[_0xeb03('0x46')]);_0x2fe435[_0xeb03('0x4a')]=_['intersection'](_0x40ea76[_0xeb03('0x45')],qs[_0xeb03('0x4b')](_0x292319[_0xeb03('0x46')]['fields']));_0x2fe435[_0xeb03('0x4a')]=_0x2fe435[_0xeb03('0x4a')][_0xeb03('0x4c')]?_0x2fe435[_0xeb03('0x4a')]:_0x40ea76[_0xeb03('0x45')];if(_0x292319[_0xeb03('0x46')][_0xeb03('0x5a')]){_0x2fe435[_0xeb03('0x54')]=[{'all':!![]}];}_0x2fe435=_[_0xeb03('0x5b')]({},_0x2fe435,_0x292319[_0xeb03('0x53')]);return db[_0xeb03('0x42')][_0xeb03('0x5c')](_0x2fe435)[_0xeb03('0x24')](handleEntityNotFound(_0x38c993,null))[_0xeb03('0x24')](respondWithResult(_0x38c993,null))['catch'](handleError(_0x38c993,null));};exports[_0xeb03('0x5d')]=function(_0x32a64c,_0x379cd0){return db[_0xeb03('0x42')][_0xeb03('0x5d')](_0x32a64c[_0xeb03('0x5e')],{})[_0xeb03('0x24')](respondWithResult(_0x379cd0,0xc9))[_0xeb03('0x2f')](handleError(_0x379cd0,null));};exports[_0xeb03('0x3b')]=function(_0x23406a,_0x5baf6f){if(_0x23406a[_0xeb03('0x5e')]['id']){delete _0x23406a[_0xeb03('0x5e')]['id'];}return db[_0xeb03('0x42')][_0xeb03('0x5c')]({'where':{'id':_0x23406a['params']['id']}})[_0xeb03('0x24')](handleEntityNotFound(_0x5baf6f,null))[_0xeb03('0x24')](saveUpdates(_0x23406a[_0xeb03('0x5e')],null))[_0xeb03('0x24')](respondWithResult(_0x5baf6f,null))[_0xeb03('0x2f')](handleError(_0x5baf6f,null));};exports['destroy']=function(_0x43efc3,_0x10beeb){return db[_0xeb03('0x42')]['find']({'where':{'id':_0x43efc3[_0xeb03('0x58')]['id']}})[_0xeb03('0x24')](handleEntityNotFound(_0x10beeb,null))['then'](removeEntity(_0x10beeb,null))[_0xeb03('0x2f')](handleError(_0x10beeb,null));};exports[_0xeb03('0x5f')]=function(_0x3750f1,_0x5693cf){return db[_0xeb03('0x42')][_0xeb03('0x5f')]()['then'](respondWithResult(_0x5693cf,null))[_0xeb03('0x2f')](handleError(_0x5693cf,null));};var interaction_log=require(_0xeb03('0x15'))(_0xeb03('0x60'));exports[_0xeb03('0x61')]=function(_0x3963a7,_0x38618e,_0x218ea5){var _0x1ac556={'agent':{},'channel':'sms'};if(_0x3963a7[_0xeb03('0x5e')]['id']){delete _0x3963a7['body']['id'];}_0x3963a7[_0xeb03('0x5e')][_0xeb03('0x62')]=!![];_0x3963a7[_0xeb03('0x5e')]['readAt']=moment()[_0xeb03('0x63')](_0xeb03('0x64'));_0x3963a7[_0xeb03('0x5e')][_0xeb03('0x65')]=_0x3963a7['body'][_0xeb03('0x65')]||_0x3963a7[_0xeb03('0x66')]['id'];_0x1ac556['agent']['id']=_0x3963a7['body']['UserId'];return db[_0xeb03('0x42')][_0xeb03('0x5c')]({'where':{'id':_0x3963a7[_0xeb03('0x58')]['id'],'UserId':null}})[_0xeb03('0x24')](handleEntityNotFound(_0x38618e,null))[_0xeb03('0x24')](saveUpdates(_0x3963a7[_0xeb03('0x5e')],null))[_0xeb03('0x24')](function(_0x240178){if(_0x240178){_0x1ac556[_0xeb03('0x2d')]=_0x240178['get']({'plain':!![]});return db['SmsInteraction'][_0xeb03('0x5c')]({'where':{'id':_0x240178[_0xeb03('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x38618e,null))[_0xeb03('0x24')](function(_0x3e003d){if(_0x3e003d){return _0x3e003d[_0xeb03('0x3b')]({'UserId':_0x3963a7[_0xeb03('0x5e')]['UserId'],'read1stAt':_['isNil'](_0x3e003d[_0xeb03('0x68')])?moment()[_0xeb03('0x63')](_0xeb03('0x64')):undefined});}return null;})[_0xeb03('0x24')](function(_0x34dd41){if(_0x34dd41){_0x1ac556[_0xeb03('0x69')]=_0x34dd41[_0xeb03('0x6a')]({'plain':!![]});interaction_log[_0xeb03('0x25')](_0xeb03('0x6b'),_0x3963a7[_0xeb03('0x66')]['id'],_0x3963a7[_0xeb03('0x66')]['name'],_0x3963a7['user'][_0xeb03('0x6c')],_0x1ac556['interaction']['id'],_0x3963a7[_0xeb03('0x5e')]?JSON['stringify'](_0x3963a7[_0xeb03('0x5e')]):'null');return respondWithRpcPromise(_0xeb03('0x6d'),_0xeb03('0x6e'),_0x1ac556);}return null;})['then'](function(_0x34927f){var _0x5f43a7=_0xeb03('0x6f')+_0x34927f['message'][_0xeb03('0x70')];return db['sequelize']['query'](_0x5f43a7,{'type':db[_0xeb03('0x71')][_0xeb03('0x72')][_0xeb03('0x73')],'raw':!![]})[_0xeb03('0x24')](function(_0x25c171){return _0x25c171;});})[_0xeb03('0x24')](function(_0x39c15d){if(_0x39c15d){_0x1ac556['message'][_0xeb03('0x74')]=_0x39c15d[0x0];if(!_0x3963a7[_0xeb03('0x5e')][_0xeb03('0x65')])return;return db[_0xeb03('0x75')][_0xeb03('0x5c')]({'where':{'id':_0x3963a7[_0xeb03('0x5e')][_0xeb03('0x65')],'role':'agent'},'attributes':['id',_0xeb03('0x3e'),_0xeb03('0x76'),_0xeb03('0x77'),_0xeb03('0x78')],'raw':!![]});}return null;})[_0xeb03('0x24')](function(_0xcd7ab1){if(!_0xcd7ab1)return null;_0x1ac556[_0xeb03('0x2d')][_0xeb03('0x79')]=_0xcd7ab1;return _0x1ac556;})['then'](function(_0x8153c8){if(_0x8153c8){if(_0x3963a7[_0xeb03('0x5e')][_0xeb03('0x7a')]){_0x1ac556[_0xeb03('0x2d')][_0xeb03('0x7b')]=util['format'](_0xeb03('0x7c'),_0x3963a7[_0xeb03('0x66')][_0xeb03('0x3e')]);_0x1ac556[_0xeb03('0x2d')][_0xeb03('0x7d')]=_0x1ac556[_0xeb03('0x7d')];_0x1ac556[_0xeb03('0x2d')]['motionChannel']=_0x1ac556[_0xeb03('0x7d')];_0x1ac556[_0xeb03('0x2d')][_0xeb03('0x7e')]=_0xeb03('0x61');return respondWithRpcPromise(_0xeb03('0x7f'),'EventManager',{'event':_0xeb03('0x80'),'message':_0x1ac556[_0xeb03('0x2d')]},client9002)[_0xeb03('0x24')](function(){return _0x1ac556;});}return _0x1ac556;}return null;})[_0xeb03('0x24')](respondWithResult(_0x38618e,null))[_0xeb03('0x2f')](handleError(_0x38618e,null));};var interaction_log=require(_0xeb03('0x15'))(_0xeb03('0x60'));exports['reject']=function(_0x7668ab,_0xe517f9,_0x2695b0){var _0x433780={'agent':{},'channel':_0xeb03('0x81')};if(_0x7668ab[_0xeb03('0x5e')]['id']){delete _0x7668ab['body']['id'];}_0x7668ab[_0xeb03('0x5e')][_0xeb03('0x65')]=_0x7668ab[_0xeb03('0x5e')]['UserId']||_0x7668ab[_0xeb03('0x66')]['id'];_0x433780[_0xeb03('0x79')]['id']=_0x7668ab[_0xeb03('0x5e')][_0xeb03('0x65')];return db[_0xeb03('0x42')][_0xeb03('0x5c')]({'where':{'id':_0x7668ab[_0xeb03('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xe517f9,null))['then'](function(_0x15bd4a){if(_0x15bd4a){_0x433780[_0xeb03('0x2d')]=_0x15bd4a[_0xeb03('0x6a')]({'plain':!![]});return db[_0xeb03('0x82')]['find']({'where':{'id':_0x15bd4a[_0xeb03('0x67')]}});}return null;})[_0xeb03('0x24')](handleEntityNotFound(_0xe517f9,null))['then'](function(_0x45fd83){if(_0x45fd83){_0x433780[_0xeb03('0x69')]=_0x45fd83[_0xeb03('0x6a')]({'plain':!![]});interaction_log[_0xeb03('0x25')](_0xeb03('0x83'),_0x7668ab[_0xeb03('0x66')]['id'],_0x7668ab['user'][_0xeb03('0x3e')],_0x7668ab[_0xeb03('0x66')][_0xeb03('0x6c')],_0x433780[_0xeb03('0x69')]['id'],_0x7668ab[_0xeb03('0x5e')]?JSON[_0xeb03('0x2a')](_0x7668ab[_0xeb03('0x5e')]):_0xeb03('0x84'));return respondWithRpcPromise(_0xeb03('0x85'),_0xeb03('0x86'),_0x433780);}return null;})['then'](function(_0x14c2ac){var _0x4416aa='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x14c2ac[_0xeb03('0x2d')][_0xeb03('0x70')];return db['sequelize'][_0xeb03('0x46')](_0x4416aa,{'type':db[_0xeb03('0x71')][_0xeb03('0x72')][_0xeb03('0x73')],'raw':!![]})[_0xeb03('0x24')](function(_0x501a3b){return _0x501a3b;});})['then'](function(_0x536277){if(_0x536277){_0x433780[_0xeb03('0x2d')]['contact']=_0x536277[0x0];if(!_0x7668ab[_0xeb03('0x5e')][_0xeb03('0x65')])return;return db[_0xeb03('0x75')][_0xeb03('0x5c')]({'where':{'id':_0x7668ab[_0xeb03('0x5e')][_0xeb03('0x65')],'role':_0xeb03('0x79')},'attributes':['id',_0xeb03('0x3e'),_0xeb03('0x76'),_0xeb03('0x77'),_0xeb03('0x78')],'raw':!![]});}return null;})[_0xeb03('0x24')](function(_0x4ec45c){if(!_0x4ec45c)return null;_0x433780['message'][_0xeb03('0x79')]=_0x4ec45c;return _0x433780;})['then'](function(_0x5d5962){if(_0x5d5962){_0x5d5962[_0xeb03('0x2d')][_0xeb03('0x7b')]=util['format']('SIP/%s',_0x7668ab[_0xeb03('0x66')][_0xeb03('0x3e')]);_0x5d5962['message'][_0xeb03('0x7d')]=_0x433780[_0xeb03('0x7d')];_0x5d5962[_0xeb03('0x2d')][_0xeb03('0x87')]=_0x433780[_0xeb03('0x7d')];_0x5d5962['message'][_0xeb03('0x7e')]='reject';respondWithRpcPromise('EventManager',_0xeb03('0x7f'),{'event':_0xeb03('0x88'),'message':_0x5d5962[_0xeb03('0x2d')]},client9002);return _0x433780;}return null;})[_0xeb03('0x24')](respondWithResult(_0xe517f9,null))['catch'](handleError(_0xe517f9,null));};exports['status']=function(_0xf9f2d3,_0x847253,_0x70343f){if(_0xf9f2d3[_0xeb03('0x5e')]['id']){delete _0xf9f2d3[_0xeb03('0x5e')]['id'];}var _0x3dc483;return db[_0xeb03('0x42')][_0xeb03('0x5c')]({'where':{'id':_0xf9f2d3['params']['id']}})['then'](handleEntityNotFound(_0x847253,null))[_0xeb03('0x24')](function(_0x5741d4){if(_0x5741d4){_0x3dc483=_0x5741d4;return db[_0xeb03('0x89')]['find']({'where':{'id':_0x5741d4[_0xeb03('0x8a')]}});}})[_0xeb03('0x24')](handleEntityNotFound(_0x847253,null))[_0xeb03('0x24')](function(_0x22f291){if(_0x22f291){logger[_0xeb03('0x28')](_0xeb03('0x29'),_0xeb03('0x31'),_0xeb03('0x8b'),_0x22f291['type'],util['inspect'](_0xf9f2d3[_0xeb03('0x5e')],{'showHidden':![],'depth':null}));switch(_0x22f291[_0xeb03('0x44')]){case _0xeb03('0x8c'):if(_0xf9f2d3[_0xeb03('0x5e')][_0xeb03('0x8d')]&&_0xf9f2d3['body'][_0xeb03('0x8d')]===_0x3dc483[_0xeb03('0x8e')]){return _0x3dc483['update']({'read':!![]});}else{logger[_0xeb03('0x2b')](_0xeb03('0x8f'),_0xeb03('0x31'),_0xeb03('0x8c'),util[_0xeb03('0x90')](_0xf9f2d3[_0xeb03('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xeb03('0x91'):if(_0xf9f2d3[_0xeb03('0x5e')][_0xeb03('0x92')]&&_0xf9f2d3[_0xeb03('0x5e')][_0xeb03('0x92')]===_0x3dc483[_0xeb03('0x8e')]&&_[_0xeb03('0x93')]([_0xeb03('0x94'),'delivered'],_0xf9f2d3[_0xeb03('0x5e')][_0xeb03('0x95')])>=0x0){return _0x3dc483['update']({'read':!![]});}else{logger[_0xeb03('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xeb03('0x31'),'plivio',util[_0xeb03('0x90')](_0xf9f2d3[_0xeb03('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xeb03('0x96'):var _0x1df994=_0xf9f2d3[_0xeb03('0x5e')][_0xeb03('0x97')][0x0];if(_0x1df994[_0xeb03('0x31')][_0xeb03('0x98')]==='DELIVERED'){return _0x3dc483[_0xeb03('0x3b')]({'read':!![]});}else{logger[_0xeb03('0x2b')](_0xeb03('0x8f'),_0xeb03('0x31'),'infobip',util[_0xeb03('0x90')](_0xf9f2d3['body'],{'showHidden':![],'depth':null}));}break;}return _0x3dc483;}})[_0xeb03('0x24')](respondWithResult(_0x847253,null))[_0xeb03('0x2f')](handleError(_0x847253,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 134356f..c64d4ff 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 _0xc266=['SmsMessage','setMaxListeners','update','hook','events'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xc266,0x1bc));var _0x6c26=function(_0x35e534,_0x6337d9){_0x35e534=_0x35e534-0x0;var _0x1304e4=_0xc266[_0x35e534];return _0x1304e4;};'use strict';var EventEmitter=require(_0x6c26('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x6c26('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x6c26('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6c26('0x3'),'afterDestroy':'remove'};function emitEvent(_0x41008a){return function(_0x2c7c65,_0x5692ee,_0x1e7dc9){SmsMessageEvents['emit'](_0x41008a+':'+_0x2c7c65['id'],_0x2c7c65);SmsMessageEvents['emit'](_0x41008a,_0x2c7c65);_0x1e7dc9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x6c26('0x4')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x06ac=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','SmsMessage','setMaxListeners','save'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x06ac,0xa6));var _0xc06a=function(_0x4d7433,_0x225b4f){_0x4d7433=_0x4d7433-0x0;var _0x23917d=_0x06ac[_0x4d7433];return _0x23917d;};'use strict';var EventEmitter=require(_0xc06a('0x0'));var SmsMessage=require(_0xc06a('0x1'))['db'][_0xc06a('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xc06a('0x3')](0x0);var events={'afterCreate':_0xc06a('0x4'),'afterUpdate':'update','afterDestroy':_0xc06a('0x5')};function emitEvent(_0x4766d3){return function(_0x4ba151,_0x54f61b,_0x32cfc8){SmsMessageEvents[_0xc06a('0x6')](_0x4766d3+':'+_0x4ba151['id'],_0x4ba151);SmsMessageEvents[_0xc06a('0x6')](_0x4766d3,_0x4ba151);_0x32cfc8(null);};}for(var e in events){if(events[_0xc06a('0x7')](e)){var event=events[e];SmsMessage[_0xc06a('0x8')](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 f939863..4408d30 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 _0xd793=['https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','Bearer\x20','code','message','refid','status','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','messageId','fti_sms_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','update','createdAt','SmsAccount','find','SmsAccountId','then','type','twilio','authToken','phone','messages','create','body','remote','/status?token=','sid','catch','error','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','GET','sms','POST','user_key','total_sent','internal_order_id','read','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','Basic\x20%s','toString','http_code','data','queued_count','message_id','clickSend','plivo','authId','/api/sms/messages/','token','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','base64','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','apiKey','sender','text','timestamp','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','keys','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth'];(function(_0x3d145d,_0x3aa561){var _0x200285=function(_0x51e7ce){while(--_0x51e7ce){_0x3d145d['push'](_0x3d145d['shift']());}};_0x200285(++_0x3aa561);}(_0xd793,0x10d));var _0x3d79=function(_0x37870d,_0x356e02){_0x37870d=_0x37870d-0x0;var _0x1ae695=_0xd793[_0x37870d];return _0x1ae695;};'use strict';var _=require(_0x3d79('0x0'));var util=require(_0x3d79('0x1'));var logger=require(_0x3d79('0x2'))(_0x3d79('0x3'));var moment=require(_0x3d79('0x4'));var BPromise=require('bluebird');var rp=require(_0x3d79('0x5'));var fs=require('fs');var path=require(_0x3d79('0x6'));var rimraf=require(_0x3d79('0x7'));var config=require(_0x3d79('0x8'));var attributes=require(_0x3d79('0x9'));module['exports']=function(_0x33ab50,_0x11bee8){return _0x33ab50[_0x3d79('0xa')](_0x3d79('0xb'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x3d79('0xc'),'fields':[_0x3d79('0xc')]},{'name':_0x3d79('0xd'),'fields':['body'],'type':_0x3d79('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x170f48,_0x3e1379,_0x3b2e03){var _0x314d43=_0x33ab50[_0x3d79('0xf')];var _0x473ff8=_0x170f48[_0x3d79('0x10')]({'plain':!![]});if(_0x473ff8[_0x3d79('0x11')][_0x3d79('0x12')]()==='in'||_0x473ff8[_0x3d79('0x11')][_0x3d79('0x12')]()===_0x3d79('0x13')&&!_0x473ff8[_0x3d79('0x14')]&&!_[_0x3d79('0x15')](_0x473ff8[_0x3d79('0x16')])&&!_[_0x3d79('0x15')](_0x473ff8[_0x3d79('0x17')])){_0x314d43[_0x3d79('0x18')]['findOne']({'where':{'id':_0x473ff8[_0x3d79('0x17')]}})['then'](function(_0x56e1c6){if(_0x56e1c6){_0x56e1c6[_0x3d79('0x19')]({'lastMsgAt':_0x473ff8[_0x3d79('0x1a')],'lastMsgDirection':_0x473ff8[_0x3d79('0x11')][_0x3d79('0x12')]()});}})['catch'](function(_0x1567c9){console['error'](_0x1567c9);});}if(_0x473ff8[_0x3d79('0x11')]===_0x3d79('0x13')&&!_0x473ff8[_0x3d79('0x14')]){var _0x53b6a5;_0x314d43[_0x3d79('0x1b')][_0x3d79('0x1c')]({'where':{'id':_0x473ff8[_0x3d79('0x1d')]},'raw':!![]})[_0x3d79('0x1e')](function(_0x3f7c08){_0x53b6a5=_0x3f7c08;if(_0x53b6a5&&_0x53b6a5[_0x3d79('0x1f')]){switch(_0x53b6a5[_0x3d79('0x1f')]){case _0x3d79('0x20'):var _0x503d90=require(_0x3d79('0x20'));if(_0x53b6a5['accountSid']&&_0x53b6a5[_0x3d79('0x21')]&&_0x53b6a5[_0x3d79('0x22')]){var _0x46673a=new _0x503d90(_0x53b6a5['accountSid'],_0x53b6a5[_0x3d79('0x21')]);_0x46673a[_0x3d79('0x23')][_0x3d79('0x24')]({'body':_0x473ff8[_0x3d79('0x25')],'to':_0x473ff8['phone'],'from':_0x53b6a5[_0x3d79('0x22')],'statusCallback':_0x53b6a5[_0x3d79('0x26')]+'/api/sms/messages/'+_0x473ff8['id']+_0x3d79('0x27')+_0x53b6a5['token']})[_0x3d79('0x1e')](function(_0x2a03fb){if(_0x2a03fb['sid']){return _0x170f48[_0x3d79('0x19')]({'messageId':_0x2a03fb[_0x3d79('0x28')]});}})[_0x3d79('0x29')](function(_0xa48f5d){logger[_0x3d79('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3d79('0x2b'),_0x3d79('0x20'),util[_0x3d79('0x2c')](_0xa48f5d,{'showHidden':![],'depth':null}));});}else{logger[_0x3d79('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3d79('0x2b'),_0x3d79('0x20'),_0x3d79('0x2d'));}break;case'skebby':var _0x5f2ba9=_0x3d79('0x2e');if(_0x53b6a5[_0x3d79('0x2f')]&&_0x53b6a5[_0x3d79('0x30')]){var _0x214bcc={'recipient':[_0x473ff8['phone']],'message':_0x473ff8[_0x3d79('0x25')],'message_type':_0x53b6a5[_0x3d79('0x31')]};if(_0x53b6a5[_0x3d79('0x31')]&&_0x53b6a5[_0x3d79('0x31')]!=='SI'){_0x214bcc['sender']=_0x53b6a5[_0x3d79('0x22')];}var _0x12e6fe={'url':_0x5f2ba9+_0x3d79('0x32')+_0x53b6a5[_0x3d79('0x2f')]+'&password='+_0x53b6a5['password'],'method':_0x3d79('0x33')};rp(_0x12e6fe)[_0x3d79('0x1e')](function(_0x5bf315){var _0x7cb169=_0x5bf315['split'](';');var _0x16a09a={'user_key':_0x7cb169[0x0],'session_key':_0x7cb169[0x1]};_0x12e6fe={'url':_0x5f2ba9+_0x3d79('0x34'),'method':_0x3d79('0x35'),'headers':{'user_key':_0x16a09a[_0x3d79('0x36')],'Session_key':_0x16a09a['session_key']},'json':!![],'body':_0x214bcc};return rp(_0x12e6fe);})['then'](function(_0x1c9860){if(_0x1c9860[_0x3d79('0x37')]>=0x1){var _0x36c7e5={'messageId':_0x1c9860[_0x3d79('0x38')]};if(_0x53b6a5[_0x3d79('0x31')]!=='GP'||!_0x53b6a5['deliveryReport']){_0x36c7e5[_0x3d79('0x39')]=!![];}return _0x170f48[_0x3d79('0x19')](_0x36c7e5);}else{return logger['error'](_0x3d79('0x3a'),'afterCreate',_0x3d79('0x3b'),util[_0x3d79('0x2c')](_0x1c9860,{'showHidden':![],'depth':null}));}})[_0x3d79('0x29')](function(_0x4fce28){return logger[_0x3d79('0x2a')](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x3b'),util[_0x3d79('0x2c')](_0x4fce28,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3d79('0x3b'),_0x3d79('0x3c'));}break;case _0x3d79('0x3d'):if(_0x53b6a5[_0x3d79('0x21')]){var _0x2102ee={'recipient':_0x473ff8['phone'],'message':_0x473ff8[_0x3d79('0x25')],'sender':_0x53b6a5[_0x3d79('0x3e')]||_0x53b6a5[_0x3d79('0x22')],'authorization':_0x53b6a5[_0x3d79('0x21')]};var _0x3e1379={'method':'POST','uri':_0x3d79('0x3f'),'body':_0x2102ee,'json':!![]};rp(_0x3e1379)[_0x3d79('0x1e')](function(_0x15ab0f){var _0x2f7359={'messageId':_0x15ab0f[_0x3d79('0x40')]};if(!_0x53b6a5[_0x3d79('0x41')]){_0x2f7359[_0x3d79('0x39')]=!![];}return _0x170f48[_0x3d79('0x19')](_0x2f7359);})[_0x3d79('0x29')](function(_0x148d85){logger[_0x3d79('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3d79('0x2b'),_0x3d79('0x3d'),util[_0x3d79('0x2c')](_0x148d85,{'showHidden':![],'depth':null}));});}else{logger[_0x3d79('0x2a')](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x3d'),_0x3d79('0x42'));}break;case _0x3d79('0x43'):if(_0x53b6a5[_0x3d79('0x2f')]&&_0x53b6a5[_0x3d79('0x30')]){var _0x2102ee={'messages':[{'source':_0x3d79('0x44'),'to':_0x473ff8[_0x3d79('0x22')],'body':_0x473ff8[_0x3d79('0x25')],'from':_0x53b6a5['senderString']||_0x53b6a5[_0x3d79('0x22')]}]};var _0x2bf342=util[_0x3d79('0x45')]('%s:%s',_0x53b6a5['username'],_0x53b6a5[_0x3d79('0x30')]);var _0x3e1379={'method':_0x3d79('0x35'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x2102ee,'headers':{'Authorization':util[_0x3d79('0x45')](_0x3d79('0x46'),new Buffer(_0x2bf342)[_0x3d79('0x47')]('base64'))},'json':!![]};rp(_0x3e1379)[_0x3d79('0x1e')](function(_0x2f46c7){if(_0x2f46c7[_0x3d79('0x48')]>=0xc8&&_0x2f46c7[_0x3d79('0x48')]<=0xce){if(_0x2f46c7[_0x3d79('0x49')]&&_0x2f46c7[_0x3d79('0x49')][_0x3d79('0x4a')]>0x0){var _0x28b17e=_['head'](_0x2f46c7[_0x3d79('0x49')][_0x3d79('0x23')]);var _0x1b3454={'messageId':_0x28b17e[_0x3d79('0x4b')]};if(!_0x53b6a5['deliveryReport']){_0x1b3454[_0x3d79('0x39')]=!![];}return _0x170f48[_0x3d79('0x19')](_0x1b3454);}else{logger['error'](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x4c'),util[_0x3d79('0x2c')](_0x2f46c7,{'showHidden':![],'depth':null}));}}else{logger[_0x3d79('0x2a')](_0x3d79('0x3a'),_0x3d79('0x2b'),'clickSend',util[_0x3d79('0x2c')](_0x2f46c7,{'showHidden':![],'depth':null}));}})[_0x3d79('0x29')](function(_0x447546){logger[_0x3d79('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3d79('0x2b'),'clickSend',util[_0x3d79('0x2c')](_0x447546,{'showHidden':![],'depth':null}));});}else{logger[_0x3d79('0x2a')](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x4c'),_0x3d79('0x3c'));}break;case _0x3d79('0x4d'):if(_0x53b6a5[_0x3d79('0x4e')]&&_0x53b6a5[_0x3d79('0x21')]){var _0x2102ee={'dst':_0x473ff8[_0x3d79('0x22')],'text':_0x473ff8['body'],'src':_0x53b6a5[_0x3d79('0x3e')]||_0x53b6a5[_0x3d79('0x22')],'url':_0x53b6a5[_0x3d79('0x26')]+_0x3d79('0x4f')+_0x473ff8['id']+_0x3d79('0x27')+_0x53b6a5[_0x3d79('0x50')]};var _0x2bf342=util['format'](_0x3d79('0x51'),_0x53b6a5[_0x3d79('0x4e')],_0x53b6a5[_0x3d79('0x21')]);var _0x3e1379={'method':_0x3d79('0x35'),'uri':util['format'](_0x3d79('0x52'),_0x53b6a5[_0x3d79('0x4e')]),'body':_0x2102ee,'headers':{'Authorization':util['format'](_0x3d79('0x46'),new Buffer(_0x2bf342)[_0x3d79('0x47')](_0x3d79('0x53')))},'json':!![]};rp(_0x3e1379)[_0x3d79('0x1e')](function(_0x57f693){var _0x4c788e={'messageId':_0x57f693['message_uuid'][0x0]};return _0x170f48[_0x3d79('0x19')](_0x4c788e);})[_0x3d79('0x29')](function(_0x491741){logger[_0x3d79('0x2a')](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x4d'),util[_0x3d79('0x2c')](_0x491741,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x4d'),_0x3d79('0x54'));}break;case _0x3d79('0x55'):if(_0x53b6a5[_0x3d79('0x2f')]&&_0x53b6a5[_0x3d79('0x30')]){if(_0x53b6a5[_0x3d79('0x56')]){var _0x1ada08={'method':_0x3d79('0x35'),'uri':_0x53b6a5[_0x3d79('0x56')]+_0x3d79('0x57'),'body':{'username':_0x53b6a5[_0x3d79('0x2f')],'password':_0x53b6a5['password']},'json':!![]};return rp(_0x1ada08)['then'](function(_0xa918cc){var _0x34b549={'method':'POST','uri':_0x53b6a5['baseUrl']+_0x3d79('0x58'),'body':{'messages':[{'from':_0x53b6a5[_0x3d79('0x22')],'destinations':[{'to':_0x473ff8[_0x3d79('0x22')]}],'text':_0x473ff8[_0x3d79('0x25')],'notifyUrl':_0x53b6a5[_0x3d79('0x26')]+_0x3d79('0x4f')+_0x473ff8['id']+'/status?token='+_0x53b6a5[_0x3d79('0x50')],'notifyContentType':_0x3d79('0x59'),'callbackData':_0x53b6a5[_0x3d79('0x22')]+';'+_0x473ff8[_0x3d79('0x25')]}]},'headers':{'Authorization':_0x3d79('0x5a')+_0xa918cc['token']},'json':!![]};return rp(_0x34b549)['then'](function(_0xa82494){if(_0xa82494[_0x3d79('0x23')]){var _0x928f77={'messageId':_0xa82494[_0x3d79('0x23')][0x0][_0x3d79('0xc')]};if(!_0x53b6a5[_0x3d79('0x41')]){_0x928f77[_0x3d79('0x39')]=!![];}return _0x170f48[_0x3d79('0x19')](_0x928f77);}else{return logger[_0x3d79('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3d79('0x2b'),_0x3d79('0x55'),util[_0x3d79('0x2c')](_0xa82494,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x507659){return logger[_0x3d79('0x2a')](_0x3d79('0x3a'),'afterCreate','infobip',util[_0x3d79('0x2c')](_0x507659,{'showHidden':![],'depth':null}));});}else{logger[_0x3d79('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3d79('0x2b'),_0x3d79('0x55'),_0x3d79('0x5b'));}}else{logger[_0x3d79('0x2a')](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x55'),'Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x39813f=require(_0x3d79('0x5c'));if(_0x53b6a5[_0x3d79('0x5d')]){var _0x364ce2={};_0x364ce2['login']=_0x53b6a5[_0x3d79('0x2f')];_0x364ce2[_0x3d79('0x22')]=_0x473ff8[_0x3d79('0x22')];_0x364ce2[_0x3d79('0x5e')]=_0x53b6a5[_0x3d79('0x22')];_0x364ce2[_0x3d79('0x5f')]=_0x473ff8[_0x3d79('0x25')];_0x364ce2[_0x3d79('0x60')]=+new Date();var _0x185724='';var _0x731eba='';var _0x86f564=Object['keys'](_0x364ce2);_0x86f564[_0x3d79('0x61')]();for(var _0x51000f=0x0;_0x51000f<_0x86f564[_0x3d79('0x62')];_0x51000f++){if(_0x185724!=''){_0x185724+='&';}_0x185724+=_0x86f564[_0x51000f]+'='+encodeURIComponent(_0x364ce2[_0x86f564[_0x51000f]]);_0x731eba+=_0x364ce2[_0x86f564[_0x51000f]];}_0x731eba+=_0x53b6a5[_0x3d79('0x5d')];_0x731eba=_0x39813f[_0x3d79('0x63')](_0x3d79('0x64'))['update'](_0x731eba)[_0x3d79('0x65')](_0x3d79('0x66'));if(_0x185724!==''){_0x185724+='&';}_0x185724+=_0x3d79('0x67')+_0x731eba;var _0x12e6fe={'method':_0x3d79('0x33'),'uri':_0x53b6a5['baseUrl']+_0x3d79('0x68')+_0x185724,'json':!![]};return rp(_0x12e6fe)[_0x3d79('0x1e')](function(_0x35ba8a){var _0x127459=Object[_0x3d79('0x69')](_0x35ba8a);if(_0x35ba8a[_0x127459[0x0]][_0x3d79('0x2a')]&&parseInt(_0x35ba8a[_0x127459[0x0]]['error'])===0x0){var _0x1e85ce={'messageId':_0x35ba8a[_0x127459[0x0]][_0x3d79('0x6a')]};if(!_0x53b6a5['deliveryReport']){_0x1e85ce[_0x3d79('0x39')]=!![];}return _0x170f48['update'](_0x1e85ce);}else{return logger[_0x3d79('0x2a')](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x6b'),util[_0x3d79('0x2c')](_0x35ba8a[_0x3d79('0x2a')],{'showHidden':![],'depth':null}));}})[_0x3d79('0x29')](function(_0x5221d6){return logger[_0x3d79('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3d79('0x2b'),_0x3d79('0x6b'),util['inspect'](_0x5221d6,{'showHidden':![],'depth':null}));});}else{logger[_0x3d79('0x2a')](_0x3d79('0x3a'),_0x3d79('0x2b'),'csc',_0x3d79('0x6c'));}break;case _0x3d79('0x6d'):if(_0x53b6a5['apiKey']){var _0x3fa0e9={'method':_0x3d79('0x35'),'uri':_0x3d79('0x6e'),'headers':{'Authorization':_0x53b6a5['apiKey']},'body':{'content':_0x473ff8['body'],'to':[_0x473ff8[_0x3d79('0x22')]],'from':_0x53b6a5['phone'],'binary':![],'clientMessageId':_0x3d79('0x6f'),'charset':_0x3d79('0x70')},'json':!![]};rp(_0x3fa0e9)[_0x3d79('0x1e')](function(_0x457a1a){if(!_0x457a1a['error']){var _0x5e998e={'messageId':_0x457a1a[_0x3d79('0x23')][0x0][_0x3d79('0x71')]};if(!_0x53b6a5[_0x3d79('0x41')]){_0x5e998e[_0x3d79('0x39')]=!![];}return _0x170f48[_0x3d79('0x19')](_0x5e998e);}else{return logger[_0x3d79('0x2a')](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x6d'),util[_0x3d79('0x2c')](_0x457a1a[_0x3d79('0x2a')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x211238){return logger['error'](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x6d'),util[_0x3d79('0x2c')](_0x211238,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x6d'),_0x3d79('0x6c'));}break;case _0x3d79('0x72'):if(_0x53b6a5[_0x3d79('0x2f')]&&_0x53b6a5[_0x3d79('0x30')]){var _0x2bf342=util[_0x3d79('0x45')](_0x3d79('0x51'),_0x53b6a5[_0x3d79('0x2f')],_0x53b6a5[_0x3d79('0x30')]);var _0x3e1379={'method':_0x3d79('0x35'),'uri':_0x3d79('0x73')+_0x53b6a5[_0x3d79('0x74')]+_0x3d79('0x75'),'body':{'to':[_0x473ff8['phone']],'text':_0x473ff8[_0x3d79('0x25')],'from':_0x53b6a5['phone'],'applicationId':_0x53b6a5[_0x3d79('0x76')]},'headers':{'Authorization':util[_0x3d79('0x45')]('Basic\x20%s',new Buffer(_0x2bf342)[_0x3d79('0x47')](_0x3d79('0x53')))},'json':!![]};rp(_0x3e1379)[_0x3d79('0x1e')](function(_0xb4c1d6){if(_0xb4c1d6['id']){var _0x58c8bd={'messageId':_0xb4c1d6['id']};return _0x170f48[_0x3d79('0x19')](_0x58c8bd);}else{logger[_0x3d79('0x2a')](_0x3d79('0x3a'),'afterCreate',_0x3d79('0x72'),util['inspect'](_0xb4c1d6,{'showHidden':![],'depth':null}));}})[_0x3d79('0x29')](function(_0x1b4842){logger['error'](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x72'),util['inspect'](_0x1b4842,{'showHidden':![],'depth':null}));});}else{logger[_0x3d79('0x2a')](_0x3d79('0x3a'),'afterCreate',_0x3d79('0x72'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x3d79('0x77'):if(_0x53b6a5[_0x3d79('0x5d')]){var _0x73ef75={};var _0x12e6fe={'method':_0x3d79('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x3d79('0x78')+_0x53b6a5[_0x3d79('0x5d')],'Content-Type':_0x3d79('0x59')},'body':{'from':_0x53b6a5[_0x3d79('0x22')],'to':_0x473ff8[_0x3d79('0x22')],'text':_0x473ff8[_0x3d79('0x25')]},'json':!![]};return rp(_0x12e6fe)[_0x3d79('0x1e')](function(_0x4eee72){if(_0x4eee72[_0x3d79('0x79')]==0xca){_0x73ef75[_0x3d79('0x7a')]=_0x4eee72;var _0x5a1679={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x3d79('0x78')+_0x53b6a5[_0x3d79('0x5d')],'Content-Type':_0x3d79('0x59')},'body':{'refid':_0x73ef75[_0x3d79('0x7a')][_0x3d79('0x7b')]},'json':!![]};return rp(_0x5a1679)[_0x3d79('0x1e')](function(_0x14c2b8){_0x73ef75[_0x3d79('0x7c')]=_0x14c2b8;var _0x39a48b={'messageId':_0x73ef75['message']['refid'],'read':!![]};return _0x170f48[_0x3d79('0x19')](_0x39a48b);});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3d79('0x2b'),_0x3d79('0x77'),util[_0x3d79('0x2c')](_0x4eee72,{'showHidden':![],'depth':null}));}})[_0x3d79('0x29')](function(_0x534e83){return logger[_0x3d79('0x2a')](_0x3d79('0x3a'),'afterCreate',_0x3d79('0x77'),util[_0x3d79('0x2c')](_0x534e83,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x3d79('0x3a'),_0x3d79('0x2b'),_0x3d79('0x77'),'Token\x20not\x20received');}break;}}})[_0x3d79('0x7d')](function(){_0x3b2e03();});}else{_0x3b2e03();}}},'charset':_0x3d79('0x7e'),'collate':_0x3d79('0x7f')});}; \ No newline at end of file +var _0xcf10=['uuid','UTF-8','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','bandwidth','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','exports','sms_messages','messageId','fti_sms_messages','models','direction','toLowerCase','out','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','catch','secret','SmsAccount','find','twilio','accountSid','authToken','messages','create','phone','remote','/status?token=','token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','body','smsMethod','sender','login?username=','password','GET','split','POST','user_key','session_key','total_sent','internal_order_id','read','skebby','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','deliveryReport','connectel','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','data','head','message_id','clickSend','plivo','/api/sms/messages/','authId','base64','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','timestamp','length','createHash','md5','digest','hex','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages'];(function(_0x1d0a56,_0x37c741){var _0x16d2eb=function(_0x1c3778){while(--_0x1c3778){_0x1d0a56['push'](_0x1d0a56['shift']());}};_0x16d2eb(++_0x37c741);}(_0xcf10,0x1e3));var _0x0cf1=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xcf10[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0x0cf1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0cf1('0x1'));var moment=require(_0x0cf1('0x2'));var BPromise=require('bluebird');var rp=require(_0x0cf1('0x3'));var fs=require('fs');var path=require(_0x0cf1('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module[_0x0cf1('0x5')]=function(_0x244598,_0x998cca){return _0x244598['define']('SmsMessage',attributes,{'tableName':_0x0cf1('0x6'),'paranoid':![],'indexes':[{'name':_0x0cf1('0x7'),'fields':[_0x0cf1('0x7')]},{'name':_0x0cf1('0x8'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x44e15e,_0x470306,_0x3d54ee){var _0x31edeb=_0x244598[_0x0cf1('0x9')];var _0x3041e9=_0x44e15e['get']({'plain':!![]});if(_0x3041e9[_0x0cf1('0xa')]['toLowerCase']()==='in'||_0x3041e9[_0x0cf1('0xa')][_0x0cf1('0xb')]()===_0x0cf1('0xc')&&!_0x3041e9['secret']&&!_[_0x0cf1('0xd')](_0x3041e9[_0x0cf1('0xe')])&&!_[_0x0cf1('0xd')](_0x3041e9[_0x0cf1('0xf')])){_0x31edeb[_0x0cf1('0x10')][_0x0cf1('0x11')]({'where':{'id':_0x3041e9[_0x0cf1('0xf')]}})[_0x0cf1('0x12')](function(_0x5667cf){if(_0x5667cf){_0x5667cf[_0x0cf1('0x13')]({'lastMsgAt':_0x3041e9['createdAt'],'lastMsgDirection':_0x3041e9[_0x0cf1('0xa')]['toLowerCase']()});}})[_0x0cf1('0x14')](function(_0x32944c){console['error'](_0x32944c);});}if(_0x3041e9[_0x0cf1('0xa')]===_0x0cf1('0xc')&&!_0x3041e9[_0x0cf1('0x15')]){var _0x1697fa;_0x31edeb[_0x0cf1('0x16')][_0x0cf1('0x17')]({'where':{'id':_0x3041e9['SmsAccountId']},'raw':!![]})[_0x0cf1('0x12')](function(_0x119b1e){_0x1697fa=_0x119b1e;if(_0x1697fa&&_0x1697fa['type']){switch(_0x1697fa['type']){case'twilio':var _0x421927=require(_0x0cf1('0x18'));if(_0x1697fa[_0x0cf1('0x19')]&&_0x1697fa[_0x0cf1('0x1a')]&&_0x1697fa['phone']){var _0x4b7c67=new _0x421927(_0x1697fa[_0x0cf1('0x19')],_0x1697fa['authToken']);_0x4b7c67[_0x0cf1('0x1b')][_0x0cf1('0x1c')]({'body':_0x3041e9['body'],'to':_0x3041e9['phone'],'from':_0x1697fa[_0x0cf1('0x1d')],'statusCallback':_0x1697fa[_0x0cf1('0x1e')]+'/api/sms/messages/'+_0x3041e9['id']+_0x0cf1('0x1f')+_0x1697fa[_0x0cf1('0x20')]})[_0x0cf1('0x12')](function(_0x4be3aa){if(_0x4be3aa[_0x0cf1('0x21')]){return _0x44e15e[_0x0cf1('0x13')]({'messageId':_0x4be3aa[_0x0cf1('0x21')]});}})[_0x0cf1('0x14')](function(_0x3e075c){logger[_0x0cf1('0x22')](_0x0cf1('0x23'),'afterCreate',_0x0cf1('0x18'),util[_0x0cf1('0x24')](_0x3e075c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0cf1('0x23'),_0x0cf1('0x25'),_0x0cf1('0x18'),_0x0cf1('0x26'));}break;case'skebby':var _0x2b5ba6=_0x0cf1('0x27');if(_0x1697fa[_0x0cf1('0x28')]&&_0x1697fa['password']){var _0x517688={'recipient':[_0x3041e9[_0x0cf1('0x1d')]],'message':_0x3041e9[_0x0cf1('0x29')],'message_type':_0x1697fa[_0x0cf1('0x2a')]};if(_0x1697fa[_0x0cf1('0x2a')]&&_0x1697fa[_0x0cf1('0x2a')]!=='SI'){_0x517688[_0x0cf1('0x2b')]=_0x1697fa['phone'];}var _0x519d48={'url':_0x2b5ba6+_0x0cf1('0x2c')+_0x1697fa[_0x0cf1('0x28')]+'&password='+_0x1697fa[_0x0cf1('0x2d')],'method':_0x0cf1('0x2e')};rp(_0x519d48)[_0x0cf1('0x12')](function(_0x4c085b){var _0xcab7c8=_0x4c085b[_0x0cf1('0x2f')](';');var _0x20097f={'user_key':_0xcab7c8[0x0],'session_key':_0xcab7c8[0x1]};_0x519d48={'url':_0x2b5ba6+'sms','method':_0x0cf1('0x30'),'headers':{'user_key':_0x20097f[_0x0cf1('0x31')],'Session_key':_0x20097f[_0x0cf1('0x32')]},'json':!![],'body':_0x517688};return rp(_0x519d48);})[_0x0cf1('0x12')](function(_0x300aa1){if(_0x300aa1[_0x0cf1('0x33')]>=0x1){var _0x5dc5b6={'messageId':_0x300aa1[_0x0cf1('0x34')]};if(_0x1697fa[_0x0cf1('0x2a')]!=='GP'||!_0x1697fa['deliveryReport']){_0x5dc5b6[_0x0cf1('0x35')]=!![];}return _0x44e15e[_0x0cf1('0x13')](_0x5dc5b6);}else{return logger[_0x0cf1('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0cf1('0x25'),_0x0cf1('0x36'),util[_0x0cf1('0x24')](_0x300aa1,{'showHidden':![],'depth':null}));}})[_0x0cf1('0x14')](function(_0x2d42da){return logger[_0x0cf1('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0cf1('0x36'),util[_0x0cf1('0x24')](_0x2d42da,{'showHidden':![],'depth':null}));});}else{logger[_0x0cf1('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0cf1('0x25'),_0x0cf1('0x36'),_0x0cf1('0x37'));}break;case'connectel':if(_0x1697fa[_0x0cf1('0x1a')]){var _0x279989={'recipient':_0x3041e9['phone'],'message':_0x3041e9[_0x0cf1('0x29')],'sender':_0x1697fa[_0x0cf1('0x38')]||_0x1697fa[_0x0cf1('0x1d')],'authorization':_0x1697fa['authToken']};var _0x470306={'method':_0x0cf1('0x30'),'uri':_0x0cf1('0x39'),'body':_0x279989,'json':!![]};rp(_0x470306)[_0x0cf1('0x12')](function(_0x3a335b){var _0x16169a={'messageId':_0x3a335b['requestid']};if(!_0x1697fa[_0x0cf1('0x3a')]){_0x16169a['read']=!![];}return _0x44e15e[_0x0cf1('0x13')](_0x16169a);})['catch'](function(_0x35c7c5){logger[_0x0cf1('0x22')](_0x0cf1('0x23'),_0x0cf1('0x25'),_0x0cf1('0x3b'),util['inspect'](_0x35c7c5,{'showHidden':![],'depth':null}));});}else{logger[_0x0cf1('0x22')](_0x0cf1('0x23'),_0x0cf1('0x25'),'connectel','Missing\x20parameters:\x20authToken');}break;case _0x0cf1('0x3c'):if(_0x1697fa['username']&&_0x1697fa['password']){var _0x279989={'messages':[{'source':_0x0cf1('0x3d'),'to':_0x3041e9[_0x0cf1('0x1d')],'body':_0x3041e9[_0x0cf1('0x29')],'from':_0x1697fa[_0x0cf1('0x38')]||_0x1697fa['phone']}]};var _0x57791c=util[_0x0cf1('0x3e')](_0x0cf1('0x3f'),_0x1697fa[_0x0cf1('0x28')],_0x1697fa[_0x0cf1('0x2d')]);var _0x470306={'method':_0x0cf1('0x30'),'uri':_0x0cf1('0x40'),'body':_0x279989,'headers':{'Authorization':util[_0x0cf1('0x3e')](_0x0cf1('0x41'),new Buffer(_0x57791c)[_0x0cf1('0x42')]('base64'))},'json':!![]};rp(_0x470306)['then'](function(_0x515107){if(_0x515107[_0x0cf1('0x43')]>=0xc8&&_0x515107['http_code']<=0xce){if(_0x515107[_0x0cf1('0x44')]&&_0x515107[_0x0cf1('0x44')]['queued_count']>0x0){var _0x58110c=_[_0x0cf1('0x45')](_0x515107[_0x0cf1('0x44')][_0x0cf1('0x1b')]);var _0x5e5832={'messageId':_0x58110c[_0x0cf1('0x46')]};if(!_0x1697fa[_0x0cf1('0x3a')]){_0x5e5832[_0x0cf1('0x35')]=!![];}return _0x44e15e[_0x0cf1('0x13')](_0x5e5832);}else{logger[_0x0cf1('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend',util['inspect'](_0x515107,{'showHidden':![],'depth':null}));}}else{logger[_0x0cf1('0x22')](_0x0cf1('0x23'),'afterCreate',_0x0cf1('0x47'),util['inspect'](_0x515107,{'showHidden':![],'depth':null}));}})[_0x0cf1('0x14')](function(_0x2ee2be){logger[_0x0cf1('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0cf1('0x25'),_0x0cf1('0x47'),util['inspect'](_0x2ee2be,{'showHidden':![],'depth':null}));});}else{logger[_0x0cf1('0x22')](_0x0cf1('0x23'),'afterCreate',_0x0cf1('0x47'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x0cf1('0x48'):if(_0x1697fa['authId']&&_0x1697fa['authToken']){var _0x279989={'dst':_0x3041e9[_0x0cf1('0x1d')],'text':_0x3041e9[_0x0cf1('0x29')],'src':_0x1697fa[_0x0cf1('0x38')]||_0x1697fa[_0x0cf1('0x1d')],'url':_0x1697fa[_0x0cf1('0x1e')]+_0x0cf1('0x49')+_0x3041e9['id']+_0x0cf1('0x1f')+_0x1697fa['token']};var _0x57791c=util[_0x0cf1('0x3e')](_0x0cf1('0x3f'),_0x1697fa[_0x0cf1('0x4a')],_0x1697fa[_0x0cf1('0x1a')]);var _0x470306={'method':_0x0cf1('0x30'),'uri':util[_0x0cf1('0x3e')]('https://api.plivo.com/v1/Account/%s/Message/',_0x1697fa['authId']),'body':_0x279989,'headers':{'Authorization':util[_0x0cf1('0x3e')](_0x0cf1('0x41'),new Buffer(_0x57791c)[_0x0cf1('0x42')](_0x0cf1('0x4b')))},'json':!![]};rp(_0x470306)[_0x0cf1('0x12')](function(_0x2870f2){var _0x5a75df={'messageId':_0x2870f2['message_uuid'][0x0]};return _0x44e15e[_0x0cf1('0x13')](_0x5a75df);})[_0x0cf1('0x14')](function(_0x4ad372){logger[_0x0cf1('0x22')](_0x0cf1('0x23'),'afterCreate',_0x0cf1('0x48'),util[_0x0cf1('0x24')](_0x4ad372,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0cf1('0x23'),_0x0cf1('0x25'),_0x0cf1('0x48'),_0x0cf1('0x4c'));}break;case _0x0cf1('0x4d'):if(_0x1697fa['username']&&_0x1697fa[_0x0cf1('0x2d')]){if(_0x1697fa[_0x0cf1('0x4e')]){var _0x22d543={'method':_0x0cf1('0x30'),'uri':_0x1697fa[_0x0cf1('0x4e')]+'/auth/1/session','body':{'username':_0x1697fa['username'],'password':_0x1697fa[_0x0cf1('0x2d')]},'json':!![]};return rp(_0x22d543)[_0x0cf1('0x12')](function(_0x49329b){var _0x5e8178={'method':'POST','uri':_0x1697fa['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x1697fa[_0x0cf1('0x1d')],'destinations':[{'to':_0x3041e9[_0x0cf1('0x1d')]}],'text':_0x3041e9[_0x0cf1('0x29')],'notifyUrl':_0x1697fa[_0x0cf1('0x1e')]+_0x0cf1('0x49')+_0x3041e9['id']+_0x0cf1('0x1f')+_0x1697fa['token'],'notifyContentType':_0x0cf1('0x4f'),'callbackData':_0x1697fa[_0x0cf1('0x1d')]+';'+_0x3041e9[_0x0cf1('0x29')]}]},'headers':{'Authorization':_0x0cf1('0x50')+_0x49329b['token']},'json':!![]};return rp(_0x5e8178)[_0x0cf1('0x12')](function(_0x43d4bb){if(_0x43d4bb[_0x0cf1('0x1b')]){var _0x2ed7c2={'messageId':_0x43d4bb['messages'][0x0]['messageId']};if(!_0x1697fa[_0x0cf1('0x3a')]){_0x2ed7c2['read']=!![];}return _0x44e15e[_0x0cf1('0x13')](_0x2ed7c2);}else{return logger[_0x0cf1('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','infobip',util['inspect'](_0x43d4bb,{'showHidden':![],'depth':null}));}});})[_0x0cf1('0x14')](function(_0x343129){return logger[_0x0cf1('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0cf1('0x25'),_0x0cf1('0x4d'),util['inspect'](_0x343129,{'showHidden':![],'depth':null}));});}else{logger[_0x0cf1('0x22')](_0x0cf1('0x23'),'afterCreate',_0x0cf1('0x4d'),_0x0cf1('0x51'));}}else{logger[_0x0cf1('0x22')](_0x0cf1('0x23'),_0x0cf1('0x25'),_0x0cf1('0x4d'),_0x0cf1('0x37'));}break;case'csc':var _0x2959f5=require(_0x0cf1('0x52'));if(_0x1697fa[_0x0cf1('0x53')]){var _0x5e56a0={};_0x5e56a0[_0x0cf1('0x54')]=_0x1697fa['username'];_0x5e56a0['phone']=_0x3041e9[_0x0cf1('0x1d')];_0x5e56a0[_0x0cf1('0x2b')]=_0x1697fa[_0x0cf1('0x1d')];_0x5e56a0[_0x0cf1('0x55')]=_0x3041e9[_0x0cf1('0x29')];_0x5e56a0[_0x0cf1('0x56')]=+new Date();var _0x3b47ea='';var _0x3bd5fd='';var _0xa905c8=Object['keys'](_0x5e56a0);_0xa905c8['sort']();for(var _0x3442da=0x0;_0x3442da<_0xa905c8[_0x0cf1('0x57')];_0x3442da++){if(_0x3b47ea!=''){_0x3b47ea+='&';}_0x3b47ea+=_0xa905c8[_0x3442da]+'='+encodeURIComponent(_0x5e56a0[_0xa905c8[_0x3442da]]);_0x3bd5fd+=_0x5e56a0[_0xa905c8[_0x3442da]];}_0x3bd5fd+=_0x1697fa[_0x0cf1('0x53')];_0x3bd5fd=_0x2959f5[_0x0cf1('0x58')](_0x0cf1('0x59'))[_0x0cf1('0x13')](_0x3bd5fd)[_0x0cf1('0x5a')](_0x0cf1('0x5b'));if(_0x3b47ea!==''){_0x3b47ea+='&';}_0x3b47ea+='signature='+_0x3bd5fd;var _0x519d48={'method':_0x0cf1('0x2e'),'uri':_0x1697fa[_0x0cf1('0x4e')]+'/external/get/send.php?'+_0x3b47ea,'json':!![]};return rp(_0x519d48)[_0x0cf1('0x12')](function(_0x268526){var _0x5ad6a4=Object['keys'](_0x268526);if(_0x268526[_0x5ad6a4[0x0]][_0x0cf1('0x22')]&&parseInt(_0x268526[_0x5ad6a4[0x0]][_0x0cf1('0x22')])===0x0){var _0x1fcff1={'messageId':_0x268526[_0x5ad6a4[0x0]][_0x0cf1('0x5c')]};if(!_0x1697fa[_0x0cf1('0x3a')]){_0x1fcff1[_0x0cf1('0x35')]=!![];}return _0x44e15e[_0x0cf1('0x13')](_0x1fcff1);}else{return logger[_0x0cf1('0x22')](_0x0cf1('0x23'),'afterCreate',_0x0cf1('0x5d'),util[_0x0cf1('0x24')](_0x268526[_0x0cf1('0x22')],{'showHidden':![],'depth':null}));}})[_0x0cf1('0x14')](function(_0xd646ef){return logger[_0x0cf1('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0cf1('0x25'),'csc',util[_0x0cf1('0x24')](_0xd646ef,{'showHidden':![],'depth':null}));});}else{logger[_0x0cf1('0x22')](_0x0cf1('0x23'),_0x0cf1('0x25'),_0x0cf1('0x5d'),_0x0cf1('0x5e'));}break;case _0x0cf1('0x5f'):if(_0x1697fa['apiKey']){var _0x5a1d04={'method':'POST','uri':_0x0cf1('0x60'),'headers':{'Authorization':_0x1697fa[_0x0cf1('0x53')]},'body':{'content':_0x3041e9[_0x0cf1('0x29')],'to':[_0x3041e9['phone']],'from':_0x1697fa[_0x0cf1('0x1d')],'binary':![],'clientMessageId':_0x0cf1('0x61'),'charset':_0x0cf1('0x62')},'json':!![]};rp(_0x5a1d04)[_0x0cf1('0x12')](function(_0x22bc96){if(!_0x22bc96[_0x0cf1('0x22')]){var _0x313dee={'messageId':_0x22bc96[_0x0cf1('0x1b')][0x0][_0x0cf1('0x63')]};if(!_0x1697fa[_0x0cf1('0x3a')]){_0x313dee[_0x0cf1('0x35')]=!![];}return _0x44e15e['update'](_0x313dee);}else{return logger[_0x0cf1('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0cf1('0x25'),_0x0cf1('0x5f'),util['inspect'](_0x22bc96['error'],{'showHidden':![],'depth':null}));}})[_0x0cf1('0x14')](function(_0x24d9bb){return logger[_0x0cf1('0x22')](_0x0cf1('0x23'),_0x0cf1('0x25'),_0x0cf1('0x5f'),util[_0x0cf1('0x24')](_0x24d9bb,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0cf1('0x23'),'afterCreate',_0x0cf1('0x5f'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x1697fa[_0x0cf1('0x28')]&&_0x1697fa[_0x0cf1('0x2d')]){var _0x57791c=util['format']('%s:%s',_0x1697fa[_0x0cf1('0x28')],_0x1697fa[_0x0cf1('0x2d')]);var _0x470306={'method':'POST','uri':_0x0cf1('0x64')+_0x1697fa[_0x0cf1('0x65')]+'/messages','body':{'to':[_0x3041e9['phone']],'text':_0x3041e9['body'],'from':_0x1697fa[_0x0cf1('0x1d')],'applicationId':_0x1697fa[_0x0cf1('0x66')]},'headers':{'Authorization':util[_0x0cf1('0x3e')](_0x0cf1('0x41'),new Buffer(_0x57791c)[_0x0cf1('0x42')](_0x0cf1('0x4b')))},'json':!![]};rp(_0x470306)['then'](function(_0x4a92e0){if(_0x4a92e0['id']){var _0x432504={'messageId':_0x4a92e0['id']};return _0x44e15e[_0x0cf1('0x13')](_0x432504);}else{logger[_0x0cf1('0x22')](_0x0cf1('0x23'),_0x0cf1('0x25'),_0x0cf1('0x67'),util[_0x0cf1('0x24')](_0x4a92e0,{'showHidden':![],'depth':null}));}})[_0x0cf1('0x14')](function(_0xbcc7a4){logger[_0x0cf1('0x22')](_0x0cf1('0x23'),_0x0cf1('0x25'),_0x0cf1('0x67'),util[_0x0cf1('0x24')](_0xbcc7a4,{'showHidden':![],'depth':null}));});}else{logger[_0x0cf1('0x22')](_0x0cf1('0x23'),_0x0cf1('0x25'),_0x0cf1('0x67'),'Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x1697fa[_0x0cf1('0x53')]){var _0x29fdd4={};var _0x519d48={'method':_0x0cf1('0x30'),'uri':_0x0cf1('0x68'),'headers':{'Authorization':_0x0cf1('0x69')+_0x1697fa[_0x0cf1('0x53')],'Content-Type':_0x0cf1('0x4f')},'body':{'from':_0x1697fa[_0x0cf1('0x1d')],'to':_0x3041e9['phone'],'text':_0x3041e9[_0x0cf1('0x29')]},'json':!![]};return rp(_0x519d48)['then'](function(_0x3e3f93){if(_0x3e3f93[_0x0cf1('0x6a')]==0xca){_0x29fdd4[_0x0cf1('0x6b')]=_0x3e3f93;var _0x4e3b18={'method':_0x0cf1('0x30'),'uri':_0x0cf1('0x6c'),'headers':{'Authorization':_0x0cf1('0x69')+_0x1697fa[_0x0cf1('0x53')],'Content-Type':_0x0cf1('0x4f')},'body':{'refid':_0x29fdd4[_0x0cf1('0x6b')][_0x0cf1('0x6d')]},'json':!![]};return rp(_0x4e3b18)[_0x0cf1('0x12')](function(_0x3563ec){_0x29fdd4[_0x0cf1('0x6e')]=_0x3563ec;var _0x533c05={'messageId':_0x29fdd4['message'][_0x0cf1('0x6d')],'read':!![]};return _0x44e15e[_0x0cf1('0x13')](_0x533c05);});}else{return logger[_0x0cf1('0x22')](_0x0cf1('0x23'),_0x0cf1('0x25'),'intelepeer',util['inspect'](_0x3e3f93,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2eb344){return logger[_0x0cf1('0x22')](_0x0cf1('0x23'),_0x0cf1('0x25'),_0x0cf1('0x6f'),util[_0x0cf1('0x24')](_0x2eb344,{'showHidden':![],'depth':null}));});}else{return logger[_0x0cf1('0x22')](_0x0cf1('0x23'),_0x0cf1('0x25'),'intelepeer',_0x0cf1('0x70'));}break;}}})[_0x0cf1('0x71')](function(){_0x3d54ee();});}else{_0x3d54ee();}}},'charset':_0x0cf1('0x72'),'collate':_0x0cf1('0x73')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index fa8568b..a4d86a9 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 _0x3c62=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','./smsMessage.socket','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSmsMessage','SmsMessage','create','options','raw'];(function(_0x331769,_0x21ce6d){var _0x55d5f0=function(_0x5ba830){while(--_0x5ba830){_0x331769['push'](_0x331769['shift']());}};_0x55d5f0(++_0x21ce6d);}(_0x3c62,0x140));var _0x23c6=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x3c62[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0x23c6('0x0'));var util=require(_0x23c6('0x1'));var moment=require(_0x23c6('0x2'));var BPromise=require(_0x23c6('0x3'));var rs=require(_0x23c6('0x4'));var fs=require('fs');var Redis=require(_0x23c6('0x5'));var db=require(_0x23c6('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x23c6('0x7'));var config=require(_0x23c6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x23c6('0x9')][_0x23c6('0xa')]({'port':0x232a});config[_0x23c6('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x23c6('0xb')]));require(_0x23c6('0xc'))['register'](socket);function respondWithRpcPromise(_0x13e5bc,_0xe335c7,_0x45abd1){return new BPromise(function(_0x2a7d04,_0x4d356a){return client['request'](_0x13e5bc,_0x45abd1)[_0x23c6('0xd')](function(_0x402597){logger[_0x23c6('0xe')](_0x23c6('0xf'),_0xe335c7,_0x23c6('0x10'));logger['debug'](_0x23c6('0x11'),_0xe335c7,_0x23c6('0x10'),JSON[_0x23c6('0x12')](_0x402597));if(_0x402597[_0x23c6('0x13')]){if(_0x402597[_0x23c6('0x13')][_0x23c6('0x14')]===0x1f4){logger[_0x23c6('0x13')](_0x23c6('0xf'),_0xe335c7,_0x402597[_0x23c6('0x13')][_0x23c6('0x15')]);return _0x4d356a(_0x402597[_0x23c6('0x13')][_0x23c6('0x15')]);}logger[_0x23c6('0x13')](_0x23c6('0xf'),_0xe335c7,_0x402597[_0x23c6('0x13')][_0x23c6('0x15')]);return _0x2a7d04(_0x402597[_0x23c6('0x13')][_0x23c6('0x15')]);}else{logger[_0x23c6('0xe')](_0x23c6('0xf'),_0xe335c7,_0x23c6('0x10'));_0x2a7d04(_0x402597[_0x23c6('0x16')]['message']);}})['catch'](function(_0x1bb7c5){logger['error'](_0x23c6('0xf'),_0xe335c7,_0x1bb7c5);_0x4d356a(_0x1bb7c5);});});}exports[_0x23c6('0x17')]=function(_0x118e4){var _0x2f07a0=this;return new Promise(function(_0x2c94ab,_0x54911d){return db[_0x23c6('0x18')][_0x23c6('0x19')](_0x118e4['body'],{'raw':_0x118e4[_0x23c6('0x1a')]?_0x118e4[_0x23c6('0x1a')][_0x23c6('0x1b')]===undefined?!![]:![]:!![]})[_0x23c6('0xd')](function(_0x419e31){logger[_0x23c6('0xe')](_0x23c6('0x17'),_0x118e4);logger['debug'](_0x23c6('0x17'),_0x118e4,JSON[_0x23c6('0x12')](_0x419e31));_0x2c94ab(_0x419e31);})[_0x23c6('0x1c')](function(_0x5da9f4){logger['error'](_0x23c6('0x17'),_0x5da9f4[_0x23c6('0x15')],_0x118e4);_0x54911d(_0x2f07a0[_0x23c6('0x13')](0x1f4,_0x5da9f4['message']));});});}; \ No newline at end of file +var _0x3ad1=['body','options','raw','CreateSmsMessage','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./smsMessage.socket','register','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','SmsMessage','create'];(function(_0x449347,_0x3f49ef){var _0x4994a5=function(_0x28fff8){while(--_0x28fff8){_0x449347['push'](_0x449347['shift']());}};_0x4994a5(++_0x3f49ef);}(_0x3ad1,0x10c));var _0x13ad=function(_0x2c5a99,_0x257114){_0x2c5a99=_0x2c5a99-0x0;var _0x59c60b=_0x3ad1[_0x2c5a99];return _0x59c60b;};'use strict';var _=require(_0x13ad('0x0'));var util=require(_0x13ad('0x1'));var moment=require(_0x13ad('0x2'));var BPromise=require(_0x13ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x13ad('0x4'))['db'];var utils=require(_0x13ad('0x5'));var logger=require(_0x13ad('0x6'))(_0x13ad('0x7'));var config=require(_0x13ad('0x8'));var jayson=require(_0x13ad('0x9'));var client=jayson[_0x13ad('0xa')][_0x13ad('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x13ad('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x13ad('0xd'))(new Redis(config[_0x13ad('0xc')]));require(_0x13ad('0xe'))[_0x13ad('0xf')](socket);function respondWithRpcPromise(_0x40ac46,_0xe0c158,_0x49e348){return new BPromise(function(_0x24186a,_0xf3f5de){return client[_0x13ad('0x10')](_0x40ac46,_0x49e348)[_0x13ad('0x11')](function(_0x53b826){logger['info'](_0x13ad('0x12'),_0xe0c158,_0x13ad('0x13'));logger['debug'](_0x13ad('0x14'),_0xe0c158,_0x13ad('0x13'),JSON[_0x13ad('0x15')](_0x53b826));if(_0x53b826[_0x13ad('0x16')]){if(_0x53b826['error']['code']===0x1f4){logger['error'](_0x13ad('0x12'),_0xe0c158,_0x53b826[_0x13ad('0x16')][_0x13ad('0x17')]);return _0xf3f5de(_0x53b826[_0x13ad('0x16')]['message']);}logger[_0x13ad('0x16')]('SmsMessage,\x20%s,\x20%s',_0xe0c158,_0x53b826[_0x13ad('0x16')][_0x13ad('0x17')]);return _0x24186a(_0x53b826[_0x13ad('0x16')][_0x13ad('0x17')]);}else{logger[_0x13ad('0x18')]('SmsMessage,\x20%s,\x20%s',_0xe0c158,'request\x20sent');_0x24186a(_0x53b826[_0x13ad('0x19')][_0x13ad('0x17')]);}})[_0x13ad('0x1a')](function(_0x3c8a8c){logger[_0x13ad('0x16')](_0x13ad('0x12'),_0xe0c158,_0x3c8a8c);_0xf3f5de(_0x3c8a8c);});});}exports['CreateSmsMessage']=function(_0x25e65e){var _0x471db6=this;return new Promise(function(_0x50f0d6,_0x15f9cd){return db[_0x13ad('0x1b')][_0x13ad('0x1c')](_0x25e65e[_0x13ad('0x1d')],{'raw':_0x25e65e[_0x13ad('0x1e')]?_0x25e65e[_0x13ad('0x1e')][_0x13ad('0x1f')]===undefined?!![]:![]:!![]})[_0x13ad('0x11')](function(_0x50a48c){logger['info'](_0x13ad('0x20'),_0x25e65e);logger['debug']('CreateSmsMessage',_0x25e65e,JSON[_0x13ad('0x15')](_0x50a48c));_0x50f0d6(_0x50a48c);})[_0x13ad('0x1a')](function(_0x1b984c){logger[_0x13ad('0x16')](_0x13ad('0x20'),_0x1b984c['message'],_0x25e65e);_0x15f9cd(_0x471db6[_0x13ad('0x16')](0x1f4,_0x1b984c[_0x13ad('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 6b70316..1054146 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 _0xa713=['emit','removeListener','register','smsMessage:','./smsMessage.events','save','remove','update'];(function(_0x395e5b,_0x10aeca){var _0x195e9c=function(_0x580eb2){while(--_0x580eb2){_0x395e5b['push'](_0x395e5b['shift']());}};_0x195e9c(++_0x10aeca);}(_0xa713,0x8c));var _0x3a71=function(_0x4ed869,_0xc6bc90){_0x4ed869=_0x4ed869-0x0;var _0xac2f37=_0xa713[_0x4ed869];return _0xac2f37;};'use strict';var SmsMessageEvents=require(_0x3a71('0x0'));var events=[_0x3a71('0x1'),_0x3a71('0x2'),_0x3a71('0x3')];function createListener(_0x180f08,_0x7c1154){return function(_0x2168f3){_0x7c1154[_0x3a71('0x4')](_0x180f08,_0x2168f3);};}function removeListener(_0x1b5c1e,_0x162716){return function(){SmsMessageEvents[_0x3a71('0x5')](_0x1b5c1e,_0x162716);};}exports[_0x3a71('0x6')]=function(_0x26ab1a){for(var _0xc313ee=0x0,_0x4b1e58=events['length'];_0xc313ee<_0x4b1e58;_0xc313ee++){var _0x524f46=events[_0xc313ee];var _0x18cece=createListener(_0x3a71('0x7')+_0x524f46,_0x26ab1a);SmsMessageEvents['on'](_0x524f46,_0x18cece);}}; \ No newline at end of file +var _0x7c63=['register','smsMessage:','./smsMessage.events','remove','removeListener'];(function(_0x348ca1,_0x429707){var _0x466322=function(_0x131ed7){while(--_0x131ed7){_0x348ca1['push'](_0x348ca1['shift']());}};_0x466322(++_0x429707);}(_0x7c63,0x17e));var _0x37c6=function(_0x198a1e,_0x16338c){_0x198a1e=_0x198a1e-0x0;var _0x50ffe2=_0x7c63[_0x198a1e];return _0x50ffe2;};'use strict';var SmsMessageEvents=require(_0x37c6('0x0'));var events=['save',_0x37c6('0x1'),'update'];function createListener(_0x32832e,_0x964414){return function(_0x48d6cc){_0x964414['emit'](_0x32832e,_0x48d6cc);};}function removeListener(_0x320a5b,_0x5370f8){return function(){SmsMessageEvents[_0x37c6('0x2')](_0x320a5b,_0x5370f8);};}exports[_0x37c6('0x3')]=function(_0x5afb8b){for(var _0x4c59db=0x0,_0x1cd0b4=events['length'];_0x4c59db<_0x1cd0b4;_0x4c59db++){var _0x2a456d=events[_0x4c59db];var _0x3077a6=createListener(_0x37c6('0x4')+_0x2a456d,_0x5afb8b);SmsMessageEvents['on'](_0x2a456d,_0x3077a6);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 7aa1fb5..44d3789 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 _0x873f=['getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/members','/:id/teams'];(function(_0x2cffa1,_0x444234){var _0x50b04c=function(_0x45087d){while(--_0x45087d){_0x2cffa1['push'](_0x2cffa1['shift']());}};_0x50b04c(++_0x444234);}(_0x873f,0x66));var _0xf873=function(_0x586c40,_0x59fb32){_0x586c40=_0x586c40-0x0;var _0x5db3a6=_0x873f[_0x586c40];return _0x5db3a6;};'use strict';var multer=require(_0xf873('0x0'));var util=require(_0xf873('0x1'));var path=require(_0xf873('0x2'));var timeout=require('connect-timeout');var express=require(_0xf873('0x3'));var router=express[_0xf873('0x4')]();var fs_extra=require(_0xf873('0x5'));var auth=require(_0xf873('0x6'));var interaction=require(_0xf873('0x7'));var config=require(_0xf873('0x8'));var controller=require(_0xf873('0x9'));router['get']('/',auth[_0xf873('0xa')](),controller['index']);router[_0xf873('0xb')](_0xf873('0xc'),auth['isAuthenticated'](),controller[_0xf873('0xd')]);router[_0xf873('0xb')](_0xf873('0xe'),auth[_0xf873('0xa')](),controller[_0xf873('0xf')]);router[_0xf873('0xb')](_0xf873('0x10'),auth[_0xf873('0xa')](),controller['getMembers']);router[_0xf873('0xb')](_0xf873('0x11'),auth[_0xf873('0xa')](),controller[_0xf873('0x12')]);router[_0xf873('0xb')]('/:id/users',auth[_0xf873('0xa')](),controller[_0xf873('0x13')]);router[_0xf873('0x14')]('/',auth['isAuthenticated'](),controller[_0xf873('0x15')]);router['post']('/:id/teams',auth[_0xf873('0xa')](),controller[_0xf873('0x16')]);router['post'](_0xf873('0x17'),auth[_0xf873('0xa')](),controller[_0xf873('0x18')]);router[_0xf873('0x19')](_0xf873('0xe'),auth[_0xf873('0xa')](),controller[_0xf873('0x1a')]);router[_0xf873('0x1b')]('/:id',auth[_0xf873('0xa')](),controller['destroy']);router[_0xf873('0x1b')](_0xf873('0x11'),auth[_0xf873('0xa')](),controller[_0xf873('0x1c')]);router['delete'](_0xf873('0x17'),auth['isAuthenticated'](),controller[_0xf873('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x408c=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','isAuthenticated','index','get','/describe','/:id','show','getMembers','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','destroy','delete','/:id/teams','removeTeams','removeAgents','exports','multer'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x408c,0x167));var _0xc408=function(_0xaf2c0d,_0x39086c){_0xaf2c0d=_0xaf2c0d-0x0;var _0x119747=_0x408c[_0xaf2c0d];return _0x119747;};'use strict';var multer=require(_0xc408('0x0'));var util=require('util');var path=require(_0xc408('0x1'));var timeout=require(_0xc408('0x2'));var express=require(_0xc408('0x3'));var router=express[_0xc408('0x4')]();var fs_extra=require(_0xc408('0x5'));var auth=require(_0xc408('0x6'));var interaction=require(_0xc408('0x7'));var config=require('../../config/environment');var controller=require(_0xc408('0x8'));router['get']('/',auth[_0xc408('0x9')](),controller[_0xc408('0xa')]);router[_0xc408('0xb')](_0xc408('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xc408('0xb')](_0xc408('0xd'),auth[_0xc408('0x9')](),controller[_0xc408('0xe')]);router[_0xc408('0xb')]('/:id/members',auth[_0xc408('0x9')](),controller[_0xc408('0xf')]);router[_0xc408('0xb')]('/:id/teams',auth[_0xc408('0x9')](),controller['getTeams']);router[_0xc408('0xb')]('/:id/users',auth[_0xc408('0x9')](),controller[_0xc408('0x10')]);router[_0xc408('0x11')]('/',auth[_0xc408('0x9')](),controller[_0xc408('0x12')]);router[_0xc408('0x11')]('/:id/teams',auth[_0xc408('0x9')](),controller[_0xc408('0x13')]);router[_0xc408('0x11')](_0xc408('0x14'),auth[_0xc408('0x9')](),controller[_0xc408('0x15')]);router[_0xc408('0x16')]('/:id',auth[_0xc408('0x9')](),controller[_0xc408('0x17')]);router['delete'](_0xc408('0xd'),auth[_0xc408('0x9')](),controller[_0xc408('0x18')]);router[_0xc408('0x19')](_0xc408('0x1a'),auth['isAuthenticated'](),controller[_0xc408('0x1b')]);router['delete'](_0xc408('0x14'),auth[_0xc408('0x9')](),controller[_0xc408('0x1c')]);module[_0xc408('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 79eb811..e4cfc2e 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 _0x4661=['exports','name','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x3bc5be,_0x39bfd1){var _0x3cc587=function(_0x4e85c7){while(--_0x4e85c7){_0x3bc5be['push'](_0x3bc5be['shift']());}};_0x3cc587(++_0x39bfd1);}(_0x4661,0xe0));var _0x1466=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4661[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x1466('0x0'));module[_0x1466('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1466('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1466('0x3')]},'timeout':{'type':Sequelize[_0x1466('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1466('0x5')](_0x1466('0x6'),_0x1466('0x7'),_0x1466('0x8'))}}; \ No newline at end of file +var _0x1e3a=['exports','name','STRING','INTEGER','rrmemory','beepall'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x1e3a,0xfc));var _0xa1e3=function(_0x169790,_0x48aa33){_0x169790=_0x169790-0x0;var _0x4d0f36=_0x1e3a[_0x169790];return _0x4d0f36;};'use strict';var Sequelize=require('sequelize');module[_0xa1e3('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xa1e3('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa1e3('0x2')]},'timeout':{'type':Sequelize[_0xa1e3('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa1e3('0x4'),_0xa1e3('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index d01dce9..8398483 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 _0x176a=['eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','count','limit','set','Content-Range','save','update','then','get','UserProfileResource','destroy','stack','send','index','map','type','key','name','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','SmsQueue','includeAll','include','findAll','rows','catch','show','keys','length','options','create','body','user','role','SmsQueues','UserProfileSection','userProfileId','error','find','params','describe','getMembers','UserSmsQueue','rawAttributes','SmsQueueId','merge','findAndCountAll','UserId','smsPause','createdAt','format','%s/%s','updatedAt','getTeams','findOne','addTeams','ids','Team','User','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','push','toString','SELECT','every','all','union','compact','value','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','spread','isArray','getAgents'];(function(_0x1328fd,_0x510201){var _0x265566=function(_0x2bc378){while(--_0x2bc378){_0x1328fd['push'](_0x1328fd['shift']());}};_0x265566(++_0x510201);}(_0x176a,0x8a));var _0xa176=function(_0x589a91,_0x3c4dd7){_0x589a91=_0x589a91-0x0;var _0x396516=_0x176a[_0x589a91];return _0x396516;};'use strict';var emlformat=require(_0xa176('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa176('0x1'));var moment=require(_0xa176('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa176('0x3'));var util=require(_0xa176('0x4'));var path=require(_0xa176('0x5'));var sox=require(_0xa176('0x6'));var csv=require(_0xa176('0x7'));var ejs=require(_0xa176('0x8'));var fs=require('fs');var fs_extra=require(_0xa176('0x9'));var _=require(_0xa176('0xa'));var squel=require(_0xa176('0xb'));var crypto=require(_0xa176('0xc'));var jsforce=require(_0xa176('0xd'));var deskjs=require(_0xa176('0xe'));var toCsv=require(_0xa176('0x7'));var querystring=require(_0xa176('0xf'));var Papa=require('papaparse');var Redis=require(_0xa176('0x10'));var authService=require(_0xa176('0x11'));var qs=require(_0xa176('0x12'));var as=require(_0xa176('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa176('0x14'))(_0xa176('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa176('0x16'));var db=require(_0xa176('0x17'))['db'];config[_0xa176('0x18')]=_[_0xa176('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa176('0x1a'))(new Redis(config[_0xa176('0x18')]));require(_0xa176('0x1b'))[_0xa176('0x1c')](socket);function respondWithStatusCode(_0x56d48e,_0x527712){_0x527712=_0x527712||0xcc;return function(_0x2a5f52){if(_0x2a5f52){return _0x56d48e[_0xa176('0x1d')](_0x527712);}return _0x56d48e[_0xa176('0x1e')](_0x527712)[_0xa176('0x1f')]();};}function respondWithResult(_0x47d40c,_0x45e989){_0x45e989=_0x45e989||0xc8;return function(_0x537813){if(_0x537813){return _0x47d40c[_0xa176('0x1e')](_0x45e989)[_0xa176('0x20')](_0x537813);}};}function respondWithFilteredResult(_0x39a536,_0x38cad2){return function(_0x1a55c8){if(_0x1a55c8){var _0x50a3ea=typeof _0x38cad2[_0xa176('0x21')]==='undefined'&&typeof _0x38cad2['limit']==='undefined';var _0x17abdc=_0x1a55c8[_0xa176('0x22')];var _0x2619d6=_0x50a3ea?0x0:_0x38cad2['offset'];var _0x20c318=_0x50a3ea?_0x1a55c8[_0xa176('0x22')]:_0x38cad2[_0xa176('0x21')]+_0x38cad2[_0xa176('0x23')];var _0x5db5aa;if(_0x20c318>=_0x17abdc){_0x20c318=_0x17abdc;_0x5db5aa=0xc8;}else{_0x5db5aa=0xce;}_0x39a536[_0xa176('0x1e')](_0x5db5aa);return _0x39a536[_0xa176('0x24')](_0xa176('0x25'),_0x2619d6+'-'+_0x20c318+'/'+_0x17abdc)[_0xa176('0x20')](_0x1a55c8);}return null;};}function patchUpdates(_0x153aab){return function(_0x485543){try{jsonpatch['apply'](_0x485543,_0x153aab,!![]);}catch(_0x6f1748){return BPromise['reject'](_0x6f1748);}return _0x485543[_0xa176('0x26')]();};}function saveUpdates(_0x29c328,_0x5bb30a){return function(_0x44e288){if(_0x44e288){return _0x44e288[_0xa176('0x27')](_0x29c328)['then'](function(_0x57ee1a){return _0x57ee1a;});}return null;};}function removeEntity(_0x1e3069,_0x4426b4){return function(_0x255188){if(_0x255188){return _0x255188['destroy']()[_0xa176('0x28')](function(){var _0xd23a52=_0x255188[_0xa176('0x29')]({'plain':!![]});var _0x42b7fa='SmsQueues';return db[_0xa176('0x2a')][_0xa176('0x2b')]({'where':{'type':_0x42b7fa,'resourceId':_0xd23a52['id']}})[_0xa176('0x28')](function(){return _0x255188;});})[_0xa176('0x28')](function(){_0x1e3069['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ba1c5,_0x433fe4){return function(_0x4988c0){if(!_0x4988c0){_0x3ba1c5[_0xa176('0x1d')](0x194);}return _0x4988c0;};}function handleError(_0x24160b,_0x338c5a){_0x338c5a=_0x338c5a||0x1f4;return function(_0x392ea5){logger['error'](_0x392ea5[_0xa176('0x2c')]);if(_0x392ea5['name']){delete _0x392ea5['name'];}_0x24160b[_0xa176('0x1e')](_0x338c5a)[_0xa176('0x2d')](_0x392ea5);};}exports[_0xa176('0x2e')]=function(_0x5d07ff,_0x565a71){var _0x5ccd67={},_0x223b68={},_0x574660={'count':0x0,'rows':[]};var _0x431c2e=_[_0xa176('0x2f')](db['SmsQueue']['rawAttributes'],function(_0x345bb3){return{'name':_0x345bb3['fieldName'],'type':_0x345bb3[_0xa176('0x30')][_0xa176('0x31')]};});_0x223b68['model']=_[_0xa176('0x2f')](_0x431c2e,_0xa176('0x32'));_0x223b68['query']=_['keys'](_0x5d07ff['query']);_0x223b68[_0xa176('0x33')]=_[_0xa176('0x34')](_0x223b68[_0xa176('0x35')],_0x223b68[_0xa176('0x36')]);_0x5ccd67[_0xa176('0x37')]=_[_0xa176('0x34')](_0x223b68[_0xa176('0x35')],qs[_0xa176('0x38')](_0x5d07ff[_0xa176('0x36')]['fields']));_0x5ccd67[_0xa176('0x37')]=_0x5ccd67['attributes']['length']?_0x5ccd67[_0xa176('0x37')]:_0x223b68[_0xa176('0x35')];if(!_0x5d07ff['query'][_0xa176('0x39')](_0xa176('0x3a'))){_0x5ccd67[_0xa176('0x23')]=qs[_0xa176('0x23')](_0x5d07ff[_0xa176('0x36')][_0xa176('0x23')]);_0x5ccd67[_0xa176('0x21')]=qs[_0xa176('0x21')](_0x5d07ff[_0xa176('0x36')][_0xa176('0x21')]);}_0x5ccd67[_0xa176('0x3b')]=qs[_0xa176('0x3c')](_0x5d07ff[_0xa176('0x36')][_0xa176('0x3c')]);_0x5ccd67[_0xa176('0x3d')]=qs[_0xa176('0x33')](_[_0xa176('0x3e')](_0x5d07ff[_0xa176('0x36')],_0x223b68['filters']),_0x431c2e);if(_0x5d07ff['query'][_0xa176('0x3f')]){_0x5ccd67['where']=_['merge'](_0x5ccd67[_0xa176('0x3d')],{'$or':_[_0xa176('0x2f')](_0x431c2e,function(_0x1018d0){if(_0x1018d0['type']!==_0xa176('0x40')){var _0x301db4={};_0x301db4[_0x1018d0[_0xa176('0x32')]]={'$like':'%'+_0x5d07ff['query']['filter']+'%'};return _0x301db4;}})});}_0x5ccd67=_['merge']({},_0x5ccd67,_0x5d07ff['options']);var _0x32ced5={'where':_0x5ccd67['where']};return db[_0xa176('0x41')][_0xa176('0x22')](_0x32ced5)[_0xa176('0x28')](function(_0x323a28){_0x574660[_0xa176('0x22')]=_0x323a28;if(_0x5d07ff[_0xa176('0x36')][_0xa176('0x42')]){_0x5ccd67[_0xa176('0x43')]=[{'all':!![]}];}return db[_0xa176('0x41')][_0xa176('0x44')](_0x5ccd67);})[_0xa176('0x28')](function(_0x446ba5){_0x574660[_0xa176('0x45')]=_0x446ba5;return _0x574660;})['then'](respondWithFilteredResult(_0x565a71,_0x5ccd67))[_0xa176('0x46')](handleError(_0x565a71,null));};exports[_0xa176('0x47')]=function(_0x2b763d,_0x549969){var _0x544907={'raw':!![],'where':{'id':_0x2b763d['params']['id']}},_0x260eb9={};_0x260eb9[_0xa176('0x35')]=_[_0xa176('0x48')](db[_0xa176('0x41')]['rawAttributes']);_0x260eb9['query']=_['keys'](_0x2b763d[_0xa176('0x36')]);_0x260eb9[_0xa176('0x33')]=_[_0xa176('0x34')](_0x260eb9[_0xa176('0x35')],_0x260eb9[_0xa176('0x36')]);_0x544907['attributes']=_[_0xa176('0x34')](_0x260eb9[_0xa176('0x35')],qs[_0xa176('0x38')](_0x2b763d[_0xa176('0x36')][_0xa176('0x38')]));_0x544907[_0xa176('0x37')]=_0x544907[_0xa176('0x37')][_0xa176('0x49')]?_0x544907['attributes']:_0x260eb9[_0xa176('0x35')];if(_0x2b763d['query']['includeAll']){_0x544907[_0xa176('0x43')]=[{'all':!![]}];}_0x544907=_['merge']({},_0x544907,_0x2b763d[_0xa176('0x4a')]);return db[_0xa176('0x41')]['find'](_0x544907)['then'](handleEntityNotFound(_0x549969,null))[_0xa176('0x28')](respondWithResult(_0x549969,null))['catch'](handleError(_0x549969,null));};exports['create']=function(_0xc3525f,_0x2bb228){return db[_0xa176('0x41')][_0xa176('0x4b')](_0xc3525f[_0xa176('0x4c')],{})[_0xa176('0x28')](function(_0x4ff8ef){var _0x1870a6=_0xc3525f[_0xa176('0x4d')][_0xa176('0x29')]({'plain':!![]});if(!_0x1870a6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1870a6[_0xa176('0x4e')]===_0xa176('0x4d')){var _0x2204cc=_0x4ff8ef['get']({'plain':!![]});var _0xcbcb7f=_0xa176('0x4f');return db[_0xa176('0x50')]['find']({'where':{'name':_0xcbcb7f,'userProfileId':_0x1870a6[_0xa176('0x51')]},'raw':!![]})['then'](function(_0x4c4c98){if(_0x4c4c98&&_0x4c4c98['autoAssociation']===0x0){return db[_0xa176('0x2a')][_0xa176('0x4b')]({'name':_0x2204cc[_0xa176('0x32')],'resourceId':_0x2204cc['id'],'type':_0x4c4c98[_0xa176('0x32')],'sectionId':_0x4c4c98['id']},{})['then'](function(){return _0x4ff8ef;});}else{return _0x4ff8ef;}})[_0xa176('0x46')](function(_0x18ab75){logger[_0xa176('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18ab75);throw _0x18ab75;});}return _0x4ff8ef;})[_0xa176('0x28')](respondWithResult(_0x2bb228,0xc9))['catch'](handleError(_0x2bb228,null));};exports[_0xa176('0x27')]=function(_0x5ec8d0,_0x56f92b){if(_0x5ec8d0['body']['id']){delete _0x5ec8d0['body']['id'];}return db[_0xa176('0x41')][_0xa176('0x53')]({'where':{'id':_0x5ec8d0[_0xa176('0x54')]['id']}})[_0xa176('0x28')](handleEntityNotFound(_0x56f92b,null))[_0xa176('0x28')](saveUpdates(_0x5ec8d0['body'],null))[_0xa176('0x28')](respondWithResult(_0x56f92b,null))['catch'](handleError(_0x56f92b,null));};exports[_0xa176('0x2b')]=function(_0x4e2ffe,_0x1bab9a){return db[_0xa176('0x41')][_0xa176('0x53')]({'where':{'id':_0x4e2ffe['params']['id']}})[_0xa176('0x28')](handleEntityNotFound(_0x1bab9a,null))['then'](removeEntity(_0x1bab9a,null))[_0xa176('0x46')](handleError(_0x1bab9a,null));};exports['describe']=function(_0x368b13,_0x3983ec){return db['SmsQueue'][_0xa176('0x55')]()[_0xa176('0x28')](respondWithResult(_0x3983ec,null))[_0xa176('0x46')](handleError(_0x3983ec,null));};exports[_0xa176('0x56')]=function(_0x5b9d8b,_0x309436,_0x3fdbc3){var _0x560a8c={'raw':!![],'where':{}},_0x539e4c={},_0x8366da;return db['SmsQueue']['findOne']({'where':{'id':_0x5b9d8b['params']['id']}})[_0xa176('0x28')](handleEntityNotFound(_0x309436,null))[_0xa176('0x28')](function(_0x36c7ef){if(_0x36c7ef){_0x8366da=_0x36c7ef['get']({'plain':!![]});_0x539e4c[_0xa176('0x35')]=_[_0xa176('0x48')](db[_0xa176('0x57')][_0xa176('0x58')]);_0x539e4c[_0xa176('0x36')]=_['keys'](_0x5b9d8b['query']);_0x539e4c[_0xa176('0x33')]=_[_0xa176('0x34')](_0x539e4c['model'],_0x539e4c['query']);_0x560a8c[_0xa176('0x37')]=_[_0xa176('0x34')](_0x539e4c['model'],qs['fields'](_0x5b9d8b[_0xa176('0x36')]['fields']));_0x560a8c[_0xa176('0x37')]=_0x560a8c[_0xa176('0x37')][_0xa176('0x49')]?_0x560a8c[_0xa176('0x37')]:_0x539e4c[_0xa176('0x35')];if(!_0x5b9d8b['query']['hasOwnProperty'](_0xa176('0x3a'))){_0x560a8c[_0xa176('0x23')]=qs[_0xa176('0x23')](_0x5b9d8b[_0xa176('0x36')]['limit']);_0x560a8c['offset']=qs[_0xa176('0x21')](_0x5b9d8b[_0xa176('0x36')]['offset']);}_0x560a8c['order']=qs['sort'](_0x5b9d8b[_0xa176('0x36')][_0xa176('0x3c')]);_0x560a8c['where']=qs['filters'](_['pick'](_0x5b9d8b[_0xa176('0x36')],_0x539e4c[_0xa176('0x33')]));_0x560a8c[_0xa176('0x3d')][_0xa176('0x59')]=_0x36c7ef['id'];if(_0x5b9d8b['query'][_0xa176('0x3f')]){_0x560a8c[_0xa176('0x3d')]=_[_0xa176('0x5a')](_0x560a8c[_0xa176('0x3d')],{'$or':_[_0xa176('0x2f')](_0x560a8c[_0xa176('0x37')],function(_0x326839){var _0x1f72ff={};_0x1f72ff[_0x326839]={'$like':'%'+_0x5b9d8b[_0xa176('0x36')][_0xa176('0x3f')]+'%'};return _0x1f72ff;})});}_0x560a8c=_['merge']({},_0x560a8c,_0x5b9d8b[_0xa176('0x4a')]);return db[_0xa176('0x57')][_0xa176('0x44')](_0x560a8c);}})[_0xa176('0x28')](function(_0x589ccc){if(_0x589ccc){return db['User'][_0xa176('0x5b')]({'where':{'id':_[_0xa176('0x2f')](_0x589ccc,_0xa176('0x5c')),'role':'agent'},'attributes':['id',_0xa176('0x32'),_0xa176('0x5d'),'updatedAt',_0xa176('0x5e')]});}})['then'](function(_0x1e8f7a){if(_0x1e8f7a){return{'count':_0x1e8f7a['count'],'rows':_[_0xa176('0x2f')](_0x1e8f7a[_0xa176('0x45')],function(_0x899333){return{'membername':_0x899333[_0xa176('0x32')],'UserId':_0x899333['id'],'queue_name':_0x8366da[_0xa176('0x32')],'SmsQueueId':_0x8366da['id'],'interface':util[_0xa176('0x5f')](_0xa176('0x60'),'SIP',_0x899333[_0xa176('0x32')]),'penalty':0x0,'paused':_0x899333[_0xa176('0x5d')],'createdAt':_0x899333['createdAt'],'updatedAt':_0x899333[_0xa176('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa176('0x28')](respondWithFilteredResult(_0x309436,_0x560a8c))[_0xa176('0x46')](handleError(_0x309436,null));};exports[_0xa176('0x62')]=function(_0x18940a,_0x580389,_0x2d3c80){var _0x201a2f={};var _0x3d08e8={};var _0x5edb9e;var _0x4b2cfe;return db[_0xa176('0x41')][_0xa176('0x63')]({'where':{'id':_0x18940a[_0xa176('0x54')]['id']}})[_0xa176('0x28')](handleEntityNotFound(_0x580389,null))[_0xa176('0x28')](function(_0x412682){if(_0x412682){_0x5edb9e=_0x412682;_0x3d08e8[_0xa176('0x35')]=_[_0xa176('0x48')](db['Team'][_0xa176('0x58')]);_0x3d08e8[_0xa176('0x36')]=_[_0xa176('0x48')](_0x18940a[_0xa176('0x36')]);_0x3d08e8[_0xa176('0x33')]=_[_0xa176('0x34')](_0x3d08e8['model'],_0x3d08e8[_0xa176('0x36')]);_0x201a2f[_0xa176('0x37')]=_['intersection'](_0x3d08e8[_0xa176('0x35')],qs[_0xa176('0x38')](_0x18940a[_0xa176('0x36')]['fields']));_0x201a2f[_0xa176('0x37')]=_0x201a2f[_0xa176('0x37')][_0xa176('0x49')]?_0x201a2f[_0xa176('0x37')]:_0x3d08e8['model'];_0x201a2f['order']=qs[_0xa176('0x3c')](_0x18940a[_0xa176('0x36')][_0xa176('0x3c')]);_0x201a2f[_0xa176('0x3d')]=qs[_0xa176('0x33')](_[_0xa176('0x3e')](_0x18940a[_0xa176('0x36')],_0x3d08e8[_0xa176('0x33')]));if(_0x18940a[_0xa176('0x36')][_0xa176('0x3f')]){_0x201a2f[_0xa176('0x3d')]=_[_0xa176('0x5a')](_0x201a2f[_0xa176('0x3d')],{'$or':_[_0xa176('0x2f')](_0x201a2f[_0xa176('0x37')],function(_0x111404){var _0x34a3ba={};_0x34a3ba[_0x111404]={'$like':'%'+_0x18940a['query']['filter']+'%'};return _0x34a3ba;})});}_0x201a2f=_[_0xa176('0x5a')]({},_0x201a2f,_0x18940a[_0xa176('0x4a')]);return _0x5edb9e[_0xa176('0x62')](_0x201a2f);}})['then'](function(_0x480d30){if(_0x480d30){_0x4b2cfe=_0x480d30[_0xa176('0x49')];if(!_0x18940a[_0xa176('0x36')][_0xa176('0x39')](_0xa176('0x3a'))){_0x201a2f['limit']=qs[_0xa176('0x23')](_0x18940a[_0xa176('0x36')][_0xa176('0x23')]);_0x201a2f[_0xa176('0x21')]=qs[_0xa176('0x21')](_0x18940a[_0xa176('0x36')][_0xa176('0x21')]);}return _0x5edb9e['getTeams'](_0x201a2f);}})[_0xa176('0x28')](function(_0x3a3aaa){if(_0x3a3aaa){return _0x3a3aaa?{'count':_0x4b2cfe,'rows':_0x3a3aaa}:null;}})[_0xa176('0x28')](respondWithResult(_0x580389,null))[_0xa176('0x46')](handleError(_0x580389,null));};exports[_0xa176('0x64')]=function(_0x47d7fe,_0x236f0f,_0x37c4da){var _0x5c2b16=_0x47d7fe[_0xa176('0x4c')][_0xa176('0x65')];return db[_0xa176('0x66')][_0xa176('0x44')]({'where':{'id':_0x5c2b16},'attributes':['id'],'include':[{'model':db[_0xa176('0x67')],'as':_0xa176('0x68'),'attributes':['id',_0xa176('0x32'),_0xa176('0x69'),_0xa176('0x6a'),_0xa176('0x6b')],'raw':!![]}]})[_0xa176('0x28')](function(_0x4cfdfb){if(_0x4cfdfb){var _0x4dc203=_['flatMap'](_0x4cfdfb,function(_0x31f49f){var _0x52e3b0=_0x31f49f[_0xa176('0x29')]({'plain':!![]});return _0x52e3b0[_0xa176('0x68')];});return db[_0xa176('0x41')]['find']({'where':{'id':_0x47d7fe[_0xa176('0x54')]['id']}})[_0xa176('0x28')](function(_0x8a686a){return db[_0xa176('0x6c')][_0xa176('0x6d')](function(_0x144af2){return _0x8a686a['addTeams'](_0x5c2b16,{'transaction':_0x144af2})['then'](function(){return BPromise[_0xa176('0x6e')](_0x4dc203,function(_0x438080){return db['UserSmsQueue'][_0xa176('0x6f')]({'where':{'UserId':_0x438080['id'],'SmsQueueId':_0x47d7fe[_0xa176('0x54')]['id']},'transaction':_0x144af2});});})[_0xa176('0x28')](function(){_0x4dc203[_0xa176('0x70')](function(_0x1e7591){socket['emit'](_0xa176('0x71'),{'UserId':_0x1e7591['id'],'SmsQueueId':_0x8a686a['id']});});});});});}})[_0xa176('0x28')](respondWithStatusCode(_0x236f0f,null))['catch'](handleError(_0x236f0f,null));};exports[_0xa176('0x72')]=function(_0x20864c,_0xcf8e9f,_0x1a0732){return db['Team']['findAll']({'where':{'id':_0x20864c[_0xa176('0x36')][_0xa176('0x65')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa176('0x68'),'attributes':['id'],'raw':!![]}]})[_0xa176('0x28')](handleEntityNotFound(_0xcf8e9f,null))['then'](function(_0x20de15){var _0x101a36=_[_0xa176('0x2f')](_0x20de15,'id');var _0x501a12=[];var _0x37245d=[];var _0x595856=squel['select']();_0x595856[_0xa176('0x73')](_0xa176('0x74'))[_0xa176('0x75')](_0xa176('0x76'),'tq')[_0xa176('0x77')](_0xa176('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa176('0x3d')](_0xa176('0x79'),_0x20864c[_0xa176('0x54')]['id']);for(var _0x24f5fe=0x0;_0x24f5fe<_0x20de15[_0xa176('0x49')];_0x24f5fe+=0x1){let _0x5dc1ef=_0x20de15[_0x24f5fe];for(var _0x13ab30=0x0;_0x13ab30<_0x5dc1ef[_0xa176('0x68')]['length'];_0x13ab30+=0x1){let _0x5e8a7f=_0x5dc1ef[_0xa176('0x68')][_0x13ab30];var _0x5674c2=_0x595856['clone']();_0x5674c2['where']('ut.UserId\x20=\x20?',_0x5e8a7f['id']);_0x37245d[_0xa176('0x7a')](db[_0xa176('0x6c')]['query'](_0x5674c2[_0xa176('0x7b')](),{'type':db[_0xa176('0x6c')]['QueryTypes'][_0xa176('0x7c')]})['then'](function(_0x2606d7){if(_0x2606d7['length']===0x1){return _0x5e8a7f['id'];}else{var _0xf7af61=_[_0xa176('0x7d')](_[_0xa176('0x2f')](_0x2606d7,'TeamId'),function(_0x4ed289){return _['includes'](_0x101a36,_0x4ed289);});if(_0xf7af61){return _0x5e8a7f['id'];}}}));}}return BPromise[_0xa176('0x7e')](_0x37245d)[_0xa176('0x28')](function(_0x10ec55){_0x501a12=_(_0x501a12)[_0xa176('0x7f')](_0x10ec55)[_0xa176('0x80')]()[_0xa176('0x81')]();return db[_0xa176('0x41')]['find']({'where':{'id':_0x20864c[_0xa176('0x54')]['id']}})[_0xa176('0x28')](function(_0x435e63){return db[_0xa176('0x6c')]['transaction'](function(_0x37b451){return _0x435e63[_0xa176('0x72')](_0x20864c[_0xa176('0x36')][_0xa176('0x65')],{'transaction':_0x37b451})['then'](function(){if(!_[_0xa176('0x82')](_0x501a12)){return _0x435e63[_0xa176('0x83')](_0x501a12,{'transaction':_0x37b451});}})[_0xa176('0x28')](function(){_0x501a12[_0xa176('0x70')](function(_0x51b985){socket[_0xa176('0x84')](_0xa176('0x85'),{'UserId':_0x51b985,'SmsQueueId':_0x435e63['id']});});});});});});})[_0xa176('0x28')](respondWithStatusCode(_0xcf8e9f,null))['catch'](handleError(_0xcf8e9f,null));};exports[_0xa176('0x86')]=function(_0x267998,_0x16635e,_0x31d4f5){return db[_0xa176('0x41')][_0xa176('0x53')]({'where':{'id':_0x267998[_0xa176('0x54')]['id']}})[_0xa176('0x28')](handleEntityNotFound(_0x16635e,null))['then'](function(_0x2a1865){if(_0x2a1865){return _0x2a1865[_0xa176('0x86')](_0x267998[_0xa176('0x4c')]['ids'],_['omit'](_0x267998[_0xa176('0x4c')],[_0xa176('0x65'),'id'])||{})[_0xa176('0x87')](function(_0x2c6bec){for(var _0xe4b53e=0x0;_0xe4b53e<_0x267998[_0xa176('0x4c')][_0xa176('0x65')][_0xa176('0x49')];_0xe4b53e+=0x1){socket[_0xa176('0x84')]('userSmsQueue:save',{'UserId':Number(_0x267998[_0xa176('0x4c')][_0xa176('0x65')][_0xe4b53e]),'SmsQueueId':Number(_0x267998[_0xa176('0x54')]['id'])});}return _0x2c6bec;});}})[_0xa176('0x28')](respondWithResult(_0x16635e,null))['catch'](handleError(_0x16635e,null));};exports[_0xa176('0x83')]=function(_0x49165d,_0x6a3fa9,_0x36cf9){return db['SmsQueue'][_0xa176('0x53')]({'where':{'id':_0x49165d[_0xa176('0x54')]['id']}})[_0xa176('0x28')](handleEntityNotFound(_0x6a3fa9,null))[_0xa176('0x28')](function(_0x491830){if(_0x491830){return _0x491830[_0xa176('0x83')](_0x49165d[_0xa176('0x36')]['ids'])['then'](function(){if(_[_0xa176('0x88')](_0x49165d[_0xa176('0x36')][_0xa176('0x65')])){for(var _0x524cc1=0x0;_0x524cc1<_0x49165d['query'][_0xa176('0x65')][_0xa176('0x49')];_0x524cc1+=0x1){socket[_0xa176('0x84')]('userSmsQueue:remove',{'UserId':Number(_0x49165d[_0xa176('0x36')][_0xa176('0x65')][_0x524cc1]),'SmsQueueId':Number(_0x49165d[_0xa176('0x54')]['id'])});}}else{socket[_0xa176('0x84')]('userSmsQueue:remove',{'UserId':Number(_0x49165d['query'][_0xa176('0x65')]),'SmsQueueId':Number(_0x49165d[_0xa176('0x54')]['id'])});}});}})[_0xa176('0x28')](respondWithStatusCode(_0x6a3fa9,null))[_0xa176('0x46')](handleError(_0x6a3fa9,null));};exports[_0xa176('0x89')]=function(_0x360290,_0x4e4e1e,_0x2ef288){var _0x300a88={};var _0x111226={};var _0x4018ee;var _0x52494b;return db[_0xa176('0x41')][_0xa176('0x63')]({'where':{'id':_0x360290['params']['id']}})[_0xa176('0x28')](handleEntityNotFound(_0x4e4e1e,null))['then'](function(_0x4897c0){if(_0x4897c0){_0x4018ee=_0x4897c0;_0x111226[_0xa176('0x35')]=_['keys'](db[_0xa176('0x67')][_0xa176('0x58')]);_0x111226[_0xa176('0x36')]=_['keys'](_0x360290[_0xa176('0x36')]);_0x111226[_0xa176('0x33')]=_['intersection'](_0x111226[_0xa176('0x35')],_0x111226[_0xa176('0x36')]);_0x300a88[_0xa176('0x37')]=_['intersection'](_0x111226['model'],qs[_0xa176('0x38')](_0x360290[_0xa176('0x36')][_0xa176('0x38')]));_0x300a88[_0xa176('0x37')]=_0x300a88[_0xa176('0x37')][_0xa176('0x49')]?_0x300a88[_0xa176('0x37')]:_0x111226[_0xa176('0x35')];_0x300a88[_0xa176('0x3b')]=qs['sort'](_0x360290[_0xa176('0x36')][_0xa176('0x3c')]);_0x300a88[_0xa176('0x3d')]=qs[_0xa176('0x33')](_[_0xa176('0x3e')](_0x360290[_0xa176('0x36')],_0x111226[_0xa176('0x33')]));if(_0x360290[_0xa176('0x36')][_0xa176('0x3f')]){_0x300a88[_0xa176('0x3d')]=_['merge'](_0x300a88[_0xa176('0x3d')],{'$or':_[_0xa176('0x2f')](_0x300a88['attributes'],function(_0x568426){var _0x3f8f04={};_0x3f8f04[_0x568426]={'$like':'%'+_0x360290[_0xa176('0x36')][_0xa176('0x3f')]+'%'};return _0x3f8f04;})});}_0x300a88=_[_0xa176('0x5a')]({},_0x300a88,_0x360290[_0xa176('0x4a')]);return _0x4018ee[_0xa176('0x89')](_0x300a88);}})[_0xa176('0x28')](function(_0xee8d66){if(_0xee8d66){_0x52494b=_0xee8d66['length'];if(!_0x360290[_0xa176('0x36')][_0xa176('0x39')](_0xa176('0x3a'))){_0x300a88[_0xa176('0x23')]=qs['limit'](_0x360290[_0xa176('0x36')][_0xa176('0x23')]);_0x300a88[_0xa176('0x21')]=qs[_0xa176('0x21')](_0x360290[_0xa176('0x36')][_0xa176('0x21')]);}return _0x4018ee[_0xa176('0x89')](_0x300a88);}})[_0xa176('0x28')](function(_0xb40ae6){if(_0xb40ae6){return _0xb40ae6?{'count':_0x52494b,'rows':_0xb40ae6}:null;}})[_0xa176('0x28')](respondWithResult(_0x4e4e1e,null))[_0xa176('0x46')](handleError(_0x4e4e1e,null));}; \ No newline at end of file +var _0xeb38=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserSmsQueue','order','SmsQueueId','User','findAndCountAll','agent','smsPause','createdAt','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','every','includes','all','union','compact','value','ids','isEmpty','removeAgents','emit','isArray','userSmsQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','SmsQueues','UserProfileResource','sendStatus','stack','name','send','map','SmsQueue','rawAttributes','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation'];(function(_0x18e2a1,_0x56a737){var _0x1b70e9=function(_0x5b4322){while(--_0x5b4322){_0x18e2a1['push'](_0x18e2a1['shift']());}};_0x1b70e9(++_0x56a737);}(_0xeb38,0x15b));var _0x8eb3=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xeb38[_0x5a776b];return _0xbbef59;};'use strict';var emlformat=require(_0x8eb3('0x0'));var rimraf=require(_0x8eb3('0x1'));var zipdir=require(_0x8eb3('0x2'));var jsonpatch=require(_0x8eb3('0x3'));var rp=require(_0x8eb3('0x4'));var moment=require(_0x8eb3('0x5'));var BPromise=require(_0x8eb3('0x6'));var Mustache=require(_0x8eb3('0x7'));var util=require(_0x8eb3('0x8'));var path=require(_0x8eb3('0x9'));var sox=require(_0x8eb3('0xa'));var csv=require(_0x8eb3('0xb'));var ejs=require(_0x8eb3('0xc'));var fs=require('fs');var fs_extra=require(_0x8eb3('0xd'));var _=require(_0x8eb3('0xe'));var squel=require('squel');var crypto=require(_0x8eb3('0xf'));var jsforce=require(_0x8eb3('0x10'));var deskjs=require(_0x8eb3('0x11'));var toCsv=require(_0x8eb3('0xb'));var querystring=require(_0x8eb3('0x12'));var Papa=require(_0x8eb3('0x13'));var Redis=require(_0x8eb3('0x14'));var authService=require(_0x8eb3('0x15'));var qs=require(_0x8eb3('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8eb3('0x17'));var logger=require('../../config/logger')(_0x8eb3('0x18'));var utils=require(_0x8eb3('0x19'));var config=require(_0x8eb3('0x1a'));var licenseUtil=require(_0x8eb3('0x1b'));var db=require(_0x8eb3('0x1c'))['db'];config[_0x8eb3('0x1d')]=_[_0x8eb3('0x1e')](config[_0x8eb3('0x1d')],{'host':_0x8eb3('0x1f'),'port':0x18eb});var socket=require(_0x8eb3('0x20'))(new Redis(config['redis']));require(_0x8eb3('0x21'))[_0x8eb3('0x22')](socket);function respondWithStatusCode(_0x5bf5f7,_0x35e941){_0x35e941=_0x35e941||0xcc;return function(_0x1606fa){if(_0x1606fa){return _0x5bf5f7['sendStatus'](_0x35e941);}return _0x5bf5f7[_0x8eb3('0x23')](_0x35e941)[_0x8eb3('0x24')]();};}function respondWithResult(_0xdb630e,_0x6140de){_0x6140de=_0x6140de||0xc8;return function(_0x2c3f8f){if(_0x2c3f8f){return _0xdb630e[_0x8eb3('0x23')](_0x6140de)['json'](_0x2c3f8f);}};}function respondWithFilteredResult(_0xa3f853,_0x122c3e){return function(_0x5b04af){if(_0x5b04af){var _0x4f2509=typeof _0x122c3e[_0x8eb3('0x25')]==='undefined'&&typeof _0x122c3e[_0x8eb3('0x26')]==='undefined';var _0x1753a2=_0x5b04af[_0x8eb3('0x27')];var _0x217cbc=_0x4f2509?0x0:_0x122c3e[_0x8eb3('0x25')];var _0x5d0645=_0x4f2509?_0x5b04af[_0x8eb3('0x27')]:_0x122c3e[_0x8eb3('0x25')]+_0x122c3e[_0x8eb3('0x26')];var _0x15f8cf;if(_0x5d0645>=_0x1753a2){_0x5d0645=_0x1753a2;_0x15f8cf=0xc8;}else{_0x15f8cf=0xce;}_0xa3f853[_0x8eb3('0x23')](_0x15f8cf);return _0xa3f853[_0x8eb3('0x28')](_0x8eb3('0x29'),_0x217cbc+'-'+_0x5d0645+'/'+_0x1753a2)[_0x8eb3('0x2a')](_0x5b04af);}return null;};}function patchUpdates(_0x31a9d4){return function(_0x27b144){try{jsonpatch[_0x8eb3('0x2b')](_0x27b144,_0x31a9d4,!![]);}catch(_0x1ab62e){return BPromise[_0x8eb3('0x2c')](_0x1ab62e);}return _0x27b144[_0x8eb3('0x2d')]();};}function saveUpdates(_0x1b3273,_0x331be8){return function(_0x3dc830){if(_0x3dc830){return _0x3dc830['update'](_0x1b3273)[_0x8eb3('0x2e')](function(_0x3f6c3f){return _0x3f6c3f;});}return null;};}function removeEntity(_0x132d49,_0x340097){return function(_0xa7cdfe){if(_0xa7cdfe){return _0xa7cdfe[_0x8eb3('0x2f')]()[_0x8eb3('0x2e')](function(){var _0x2a0408=_0xa7cdfe[_0x8eb3('0x30')]({'plain':!![]});var _0x3acd55=_0x8eb3('0x31');return db[_0x8eb3('0x32')][_0x8eb3('0x2f')]({'where':{'type':_0x3acd55,'resourceId':_0x2a0408['id']}})[_0x8eb3('0x2e')](function(){return _0xa7cdfe;});})[_0x8eb3('0x2e')](function(){_0x132d49[_0x8eb3('0x23')](0xcc)[_0x8eb3('0x24')]();});}};}function handleEntityNotFound(_0x178fb6,_0x2d29eb){return function(_0x4f7a72){if(!_0x4f7a72){_0x178fb6[_0x8eb3('0x33')](0x194);}return _0x4f7a72;};}function handleError(_0x26f343,_0x1dffb7){_0x1dffb7=_0x1dffb7||0x1f4;return function(_0x561150){logger['error'](_0x561150[_0x8eb3('0x34')]);if(_0x561150['name']){delete _0x561150[_0x8eb3('0x35')];}_0x26f343[_0x8eb3('0x23')](_0x1dffb7)[_0x8eb3('0x36')](_0x561150);};}exports['index']=function(_0x200228,_0x10bc88){var _0x8e6f83={},_0x318ea3={},_0x110fa7={'count':0x0,'rows':[]};var _0x5551c0=_[_0x8eb3('0x37')](db[_0x8eb3('0x38')][_0x8eb3('0x39')],function(_0x3490b6){return{'name':_0x3490b6['fieldName'],'type':_0x3490b6[_0x8eb3('0x3a')][_0x8eb3('0x3b')]};});_0x318ea3['model']=_[_0x8eb3('0x37')](_0x5551c0,_0x8eb3('0x35'));_0x318ea3[_0x8eb3('0x3c')]=_['keys'](_0x200228[_0x8eb3('0x3c')]);_0x318ea3[_0x8eb3('0x3d')]=_['intersection'](_0x318ea3[_0x8eb3('0x3e')],_0x318ea3[_0x8eb3('0x3c')]);_0x8e6f83[_0x8eb3('0x3f')]=_[_0x8eb3('0x40')](_0x318ea3['model'],qs[_0x8eb3('0x41')](_0x200228[_0x8eb3('0x3c')][_0x8eb3('0x41')]));_0x8e6f83[_0x8eb3('0x3f')]=_0x8e6f83['attributes'][_0x8eb3('0x42')]?_0x8e6f83['attributes']:_0x318ea3[_0x8eb3('0x3e')];if(!_0x200228[_0x8eb3('0x3c')][_0x8eb3('0x43')](_0x8eb3('0x44'))){_0x8e6f83[_0x8eb3('0x26')]=qs[_0x8eb3('0x26')](_0x200228[_0x8eb3('0x3c')]['limit']);_0x8e6f83['offset']=qs['offset'](_0x200228[_0x8eb3('0x3c')]['offset']);}_0x8e6f83['order']=qs[_0x8eb3('0x45')](_0x200228[_0x8eb3('0x3c')][_0x8eb3('0x45')]);_0x8e6f83[_0x8eb3('0x46')]=qs[_0x8eb3('0x3d')](_[_0x8eb3('0x47')](_0x200228[_0x8eb3('0x3c')],_0x318ea3[_0x8eb3('0x3d')]),_0x5551c0);if(_0x200228[_0x8eb3('0x3c')]['filter']){_0x8e6f83[_0x8eb3('0x46')]=_[_0x8eb3('0x48')](_0x8e6f83[_0x8eb3('0x46')],{'$or':_[_0x8eb3('0x37')](_0x5551c0,function(_0x38b977){if(_0x38b977[_0x8eb3('0x3a')]!==_0x8eb3('0x49')){var _0x3dd0f9={};_0x3dd0f9[_0x38b977[_0x8eb3('0x35')]]={'$like':'%'+_0x200228[_0x8eb3('0x3c')][_0x8eb3('0x4a')]+'%'};return _0x3dd0f9;}})});}_0x8e6f83=_[_0x8eb3('0x48')]({},_0x8e6f83,_0x200228[_0x8eb3('0x4b')]);var _0x14ed36={'where':_0x8e6f83[_0x8eb3('0x46')]};return db['SmsQueue'][_0x8eb3('0x27')](_0x14ed36)['then'](function(_0x4a27d3){_0x110fa7[_0x8eb3('0x27')]=_0x4a27d3;if(_0x200228[_0x8eb3('0x3c')][_0x8eb3('0x4c')]){_0x8e6f83[_0x8eb3('0x4d')]=[{'all':!![]}];}return db[_0x8eb3('0x38')][_0x8eb3('0x4e')](_0x8e6f83);})[_0x8eb3('0x2e')](function(_0x57fb87){_0x110fa7[_0x8eb3('0x4f')]=_0x57fb87;return _0x110fa7;})['then'](respondWithFilteredResult(_0x10bc88,_0x8e6f83))[_0x8eb3('0x50')](handleError(_0x10bc88,null));};exports[_0x8eb3('0x51')]=function(_0x483a5d,_0x4bade3){var _0x11e0af={'raw':!![],'where':{'id':_0x483a5d[_0x8eb3('0x52')]['id']}},_0x34a0a6={};_0x34a0a6['model']=_[_0x8eb3('0x53')](db[_0x8eb3('0x38')][_0x8eb3('0x39')]);_0x34a0a6[_0x8eb3('0x3c')]=_[_0x8eb3('0x53')](_0x483a5d[_0x8eb3('0x3c')]);_0x34a0a6[_0x8eb3('0x3d')]=_[_0x8eb3('0x40')](_0x34a0a6[_0x8eb3('0x3e')],_0x34a0a6[_0x8eb3('0x3c')]);_0x11e0af[_0x8eb3('0x3f')]=_[_0x8eb3('0x40')](_0x34a0a6['model'],qs[_0x8eb3('0x41')](_0x483a5d[_0x8eb3('0x3c')]['fields']));_0x11e0af[_0x8eb3('0x3f')]=_0x11e0af[_0x8eb3('0x3f')]['length']?_0x11e0af[_0x8eb3('0x3f')]:_0x34a0a6['model'];if(_0x483a5d[_0x8eb3('0x3c')]['includeAll']){_0x11e0af[_0x8eb3('0x4d')]=[{'all':!![]}];}_0x11e0af=_[_0x8eb3('0x48')]({},_0x11e0af,_0x483a5d[_0x8eb3('0x4b')]);return db[_0x8eb3('0x38')][_0x8eb3('0x54')](_0x11e0af)[_0x8eb3('0x2e')](handleEntityNotFound(_0x4bade3,null))[_0x8eb3('0x2e')](respondWithResult(_0x4bade3,null))['catch'](handleError(_0x4bade3,null));};exports[_0x8eb3('0x55')]=function(_0x268a75,_0x523cb9){return db[_0x8eb3('0x38')][_0x8eb3('0x55')](_0x268a75['body'],{})[_0x8eb3('0x2e')](function(_0x3419f7){var _0x2a8594=_0x268a75[_0x8eb3('0x56')]['get']({'plain':!![]});if(!_0x2a8594)throw new Error(_0x8eb3('0x57'));if(_0x2a8594['role']===_0x8eb3('0x56')){var _0x5db7fe=_0x3419f7[_0x8eb3('0x30')]({'plain':!![]});var _0x401387='SmsQueues';return db[_0x8eb3('0x58')][_0x8eb3('0x54')]({'where':{'name':_0x401387,'userProfileId':_0x2a8594[_0x8eb3('0x59')]},'raw':!![]})['then'](function(_0x1d5a23){if(_0x1d5a23&&_0x1d5a23[_0x8eb3('0x5a')]===0x0){return db[_0x8eb3('0x32')][_0x8eb3('0x55')]({'name':_0x5db7fe['name'],'resourceId':_0x5db7fe['id'],'type':_0x1d5a23[_0x8eb3('0x35')],'sectionId':_0x1d5a23['id']},{})[_0x8eb3('0x2e')](function(){return _0x3419f7;});}else{return _0x3419f7;}})[_0x8eb3('0x50')](function(_0x21056f){logger[_0x8eb3('0x5b')](_0x8eb3('0x5c'),_0x21056f);throw _0x21056f;});}return _0x3419f7;})[_0x8eb3('0x2e')](respondWithResult(_0x523cb9,0xc9))[_0x8eb3('0x50')](handleError(_0x523cb9,null));};exports['update']=function(_0x2fb71f,_0x365caa){if(_0x2fb71f[_0x8eb3('0x5d')]['id']){delete _0x2fb71f[_0x8eb3('0x5d')]['id'];}return db[_0x8eb3('0x38')][_0x8eb3('0x54')]({'where':{'id':_0x2fb71f[_0x8eb3('0x52')]['id']}})[_0x8eb3('0x2e')](handleEntityNotFound(_0x365caa,null))[_0x8eb3('0x2e')](saveUpdates(_0x2fb71f[_0x8eb3('0x5d')],null))[_0x8eb3('0x2e')](respondWithResult(_0x365caa,null))['catch'](handleError(_0x365caa,null));};exports['destroy']=function(_0x1faf59,_0x51d0aa){return db[_0x8eb3('0x38')][_0x8eb3('0x54')]({'where':{'id':_0x1faf59[_0x8eb3('0x52')]['id']}})[_0x8eb3('0x2e')](handleEntityNotFound(_0x51d0aa,null))['then'](removeEntity(_0x51d0aa,null))[_0x8eb3('0x50')](handleError(_0x51d0aa,null));};exports['describe']=function(_0x14b82b,_0x4d7b26){return db[_0x8eb3('0x38')][_0x8eb3('0x5e')]()[_0x8eb3('0x2e')](respondWithResult(_0x4d7b26,null))[_0x8eb3('0x50')](handleError(_0x4d7b26,null));};exports[_0x8eb3('0x5f')]=function(_0x570144,_0x419e3f,_0x166280){var _0x2f7ff6={'raw':!![],'where':{}},_0x26f50f={},_0x197cf6;return db[_0x8eb3('0x38')][_0x8eb3('0x60')]({'where':{'id':_0x570144[_0x8eb3('0x52')]['id']}})['then'](handleEntityNotFound(_0x419e3f,null))[_0x8eb3('0x2e')](function(_0x5b1fd0){if(_0x5b1fd0){_0x197cf6=_0x5b1fd0[_0x8eb3('0x30')]({'plain':!![]});_0x26f50f[_0x8eb3('0x3e')]=_['keys'](db[_0x8eb3('0x61')][_0x8eb3('0x39')]);_0x26f50f[_0x8eb3('0x3c')]=_[_0x8eb3('0x53')](_0x570144[_0x8eb3('0x3c')]);_0x26f50f['filters']=_[_0x8eb3('0x40')](_0x26f50f[_0x8eb3('0x3e')],_0x26f50f[_0x8eb3('0x3c')]);_0x2f7ff6[_0x8eb3('0x3f')]=_[_0x8eb3('0x40')](_0x26f50f[_0x8eb3('0x3e')],qs[_0x8eb3('0x41')](_0x570144[_0x8eb3('0x3c')][_0x8eb3('0x41')]));_0x2f7ff6['attributes']=_0x2f7ff6[_0x8eb3('0x3f')][_0x8eb3('0x42')]?_0x2f7ff6[_0x8eb3('0x3f')]:_0x26f50f[_0x8eb3('0x3e')];if(!_0x570144[_0x8eb3('0x3c')][_0x8eb3('0x43')]('nolimit')){_0x2f7ff6['limit']=qs[_0x8eb3('0x26')](_0x570144[_0x8eb3('0x3c')][_0x8eb3('0x26')]);_0x2f7ff6[_0x8eb3('0x25')]=qs['offset'](_0x570144['query']['offset']);}_0x2f7ff6[_0x8eb3('0x62')]=qs['sort'](_0x570144[_0x8eb3('0x3c')][_0x8eb3('0x45')]);_0x2f7ff6[_0x8eb3('0x46')]=qs[_0x8eb3('0x3d')](_['pick'](_0x570144[_0x8eb3('0x3c')],_0x26f50f[_0x8eb3('0x3d')]));_0x2f7ff6[_0x8eb3('0x46')][_0x8eb3('0x63')]=_0x5b1fd0['id'];if(_0x570144['query'][_0x8eb3('0x4a')]){_0x2f7ff6[_0x8eb3('0x46')]=_[_0x8eb3('0x48')](_0x2f7ff6['where'],{'$or':_[_0x8eb3('0x37')](_0x2f7ff6[_0x8eb3('0x3f')],function(_0x3769f1){var _0x3d4f20={};_0x3d4f20[_0x3769f1]={'$like':'%'+_0x570144[_0x8eb3('0x3c')][_0x8eb3('0x4a')]+'%'};return _0x3d4f20;})});}_0x2f7ff6=_['merge']({},_0x2f7ff6,_0x570144['options']);return db['UserSmsQueue'][_0x8eb3('0x4e')](_0x2f7ff6);}})[_0x8eb3('0x2e')](function(_0x5d5f9e){if(_0x5d5f9e){return db[_0x8eb3('0x64')][_0x8eb3('0x65')]({'where':{'id':_[_0x8eb3('0x37')](_0x5d5f9e,'UserId'),'role':_0x8eb3('0x66')},'attributes':['id',_0x8eb3('0x35'),_0x8eb3('0x67'),'updatedAt',_0x8eb3('0x68')]});}})[_0x8eb3('0x2e')](function(_0xd98432){if(_0xd98432){return{'count':_0xd98432[_0x8eb3('0x27')],'rows':_[_0x8eb3('0x37')](_0xd98432[_0x8eb3('0x4f')],function(_0x475df0){return{'membername':_0x475df0[_0x8eb3('0x35')],'UserId':_0x475df0['id'],'queue_name':_0x197cf6[_0x8eb3('0x35')],'SmsQueueId':_0x197cf6['id'],'interface':util['format'](_0x8eb3('0x69'),_0x8eb3('0x6a'),_0x475df0['name']),'penalty':0x0,'paused':_0x475df0[_0x8eb3('0x67')],'createdAt':_0x475df0[_0x8eb3('0x68')],'updatedAt':_0x475df0[_0x8eb3('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8eb3('0x2e')](respondWithFilteredResult(_0x419e3f,_0x2f7ff6))[_0x8eb3('0x50')](handleError(_0x419e3f,null));};exports['getTeams']=function(_0x1f1be1,_0x38fe9c,_0x12cfc0){var _0x2d19f9={};var _0x44f2bf={};var _0x42cdbb;var _0x1b02e2;return db[_0x8eb3('0x38')][_0x8eb3('0x60')]({'where':{'id':_0x1f1be1[_0x8eb3('0x52')]['id']}})[_0x8eb3('0x2e')](handleEntityNotFound(_0x38fe9c,null))['then'](function(_0x3071d6){if(_0x3071d6){_0x42cdbb=_0x3071d6;_0x44f2bf[_0x8eb3('0x3e')]=_[_0x8eb3('0x53')](db[_0x8eb3('0x6c')][_0x8eb3('0x39')]);_0x44f2bf[_0x8eb3('0x3c')]=_[_0x8eb3('0x53')](_0x1f1be1['query']);_0x44f2bf[_0x8eb3('0x3d')]=_[_0x8eb3('0x40')](_0x44f2bf[_0x8eb3('0x3e')],_0x44f2bf[_0x8eb3('0x3c')]);_0x2d19f9['attributes']=_['intersection'](_0x44f2bf[_0x8eb3('0x3e')],qs['fields'](_0x1f1be1[_0x8eb3('0x3c')]['fields']));_0x2d19f9['attributes']=_0x2d19f9[_0x8eb3('0x3f')]['length']?_0x2d19f9[_0x8eb3('0x3f')]:_0x44f2bf[_0x8eb3('0x3e')];_0x2d19f9[_0x8eb3('0x62')]=qs[_0x8eb3('0x45')](_0x1f1be1[_0x8eb3('0x3c')][_0x8eb3('0x45')]);_0x2d19f9[_0x8eb3('0x46')]=qs[_0x8eb3('0x3d')](_[_0x8eb3('0x47')](_0x1f1be1[_0x8eb3('0x3c')],_0x44f2bf[_0x8eb3('0x3d')]));if(_0x1f1be1[_0x8eb3('0x3c')][_0x8eb3('0x4a')]){_0x2d19f9[_0x8eb3('0x46')]=_[_0x8eb3('0x48')](_0x2d19f9[_0x8eb3('0x46')],{'$or':_[_0x8eb3('0x37')](_0x2d19f9[_0x8eb3('0x3f')],function(_0x3958af){var _0x480928={};_0x480928[_0x3958af]={'$like':'%'+_0x1f1be1[_0x8eb3('0x3c')][_0x8eb3('0x4a')]+'%'};return _0x480928;})});}_0x2d19f9=_[_0x8eb3('0x48')]({},_0x2d19f9,_0x1f1be1[_0x8eb3('0x4b')]);return _0x42cdbb[_0x8eb3('0x6d')](_0x2d19f9);}})['then'](function(_0x1c7870){if(_0x1c7870){_0x1b02e2=_0x1c7870[_0x8eb3('0x42')];if(!_0x1f1be1[_0x8eb3('0x3c')][_0x8eb3('0x43')](_0x8eb3('0x44'))){_0x2d19f9[_0x8eb3('0x26')]=qs['limit'](_0x1f1be1['query'][_0x8eb3('0x26')]);_0x2d19f9['offset']=qs['offset'](_0x1f1be1['query'][_0x8eb3('0x25')]);}return _0x42cdbb[_0x8eb3('0x6d')](_0x2d19f9);}})[_0x8eb3('0x2e')](function(_0x1205d0){if(_0x1205d0){return _0x1205d0?{'count':_0x1b02e2,'rows':_0x1205d0}:null;}})[_0x8eb3('0x2e')](respondWithResult(_0x38fe9c,null))[_0x8eb3('0x50')](handleError(_0x38fe9c,null));};exports[_0x8eb3('0x6e')]=function(_0x226366,_0x24bac1,_0x123167){var _0x427a2a=_0x226366[_0x8eb3('0x5d')]['ids'];return db[_0x8eb3('0x6c')][_0x8eb3('0x4e')]({'where':{'id':_0x427a2a},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8eb3('0x6f'),'attributes':['id',_0x8eb3('0x35'),_0x8eb3('0x70'),_0x8eb3('0x71'),_0x8eb3('0x72')],'raw':!![]}]})[_0x8eb3('0x2e')](function(_0xf3fbc0){if(_0xf3fbc0){var _0x3958fa=_[_0x8eb3('0x73')](_0xf3fbc0,function(_0x41a424){var _0x3a4b84=_0x41a424[_0x8eb3('0x30')]({'plain':!![]});return _0x3a4b84[_0x8eb3('0x6f')];});return db[_0x8eb3('0x38')][_0x8eb3('0x54')]({'where':{'id':_0x226366[_0x8eb3('0x52')]['id']}})[_0x8eb3('0x2e')](function(_0x213700){return db[_0x8eb3('0x74')][_0x8eb3('0x75')](function(_0x1207b6){return _0x213700[_0x8eb3('0x6e')](_0x427a2a,{'transaction':_0x1207b6})[_0x8eb3('0x2e')](function(){return BPromise[_0x8eb3('0x76')](_0x3958fa,function(_0x452251){return db[_0x8eb3('0x61')][_0x8eb3('0x77')]({'where':{'UserId':_0x452251['id'],'SmsQueueId':_0x226366[_0x8eb3('0x52')]['id']},'transaction':_0x1207b6});});})['then'](function(){_0x3958fa[_0x8eb3('0x78')](function(_0x496ec0){socket['emit'](_0x8eb3('0x79'),{'UserId':_0x496ec0['id'],'SmsQueueId':_0x213700['id']});});});});});}})[_0x8eb3('0x2e')](respondWithStatusCode(_0x24bac1,null))[_0x8eb3('0x50')](handleError(_0x24bac1,null));};exports[_0x8eb3('0x7a')]=function(_0x4a0065,_0x4c3cfe,_0x1b12d6){return db[_0x8eb3('0x6c')][_0x8eb3('0x4e')]({'where':{'id':_0x4a0065['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x8eb3('0x64')],'as':_0x8eb3('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x8eb3('0x2e')](handleEntityNotFound(_0x4c3cfe,null))[_0x8eb3('0x2e')](function(_0x2ebf91){var _0x1a8d0a=_[_0x8eb3('0x37')](_0x2ebf91,'id');var _0xff7144=[];var _0x36f9e8=[];var _0x1e4425=squel['select']();_0x1e4425['field'](_0x8eb3('0x7b'))[_0x8eb3('0x7c')](_0x8eb3('0x7d'),'tq')[_0x8eb3('0x7e')](_0x8eb3('0x7f'),'ut',_0x8eb3('0x80'))[_0x8eb3('0x46')]('SmsQueueId\x20=\x20?',_0x4a0065[_0x8eb3('0x52')]['id']);for(var _0x2f970b=0x0;_0x2f970b<_0x2ebf91['length'];_0x2f970b+=0x1){let _0x5a43d7=_0x2ebf91[_0x2f970b];for(var _0x1bc952=0x0;_0x1bc952<_0x5a43d7['Agents'][_0x8eb3('0x42')];_0x1bc952+=0x1){let _0x36e520=_0x5a43d7[_0x8eb3('0x6f')][_0x1bc952];var _0x11acaa=_0x1e4425[_0x8eb3('0x81')]();_0x11acaa[_0x8eb3('0x46')]('ut.UserId\x20=\x20?',_0x36e520['id']);_0x36f9e8[_0x8eb3('0x82')](db['sequelize']['query'](_0x11acaa[_0x8eb3('0x83')](),{'type':db[_0x8eb3('0x74')][_0x8eb3('0x84')]['SELECT']})[_0x8eb3('0x2e')](function(_0xa90fdd){if(_0xa90fdd[_0x8eb3('0x42')]===0x1){return _0x36e520['id'];}else{var _0x1878ae=_[_0x8eb3('0x85')](_['map'](_0xa90fdd,'TeamId'),function(_0xe8a4ef){return _[_0x8eb3('0x86')](_0x1a8d0a,_0xe8a4ef);});if(_0x1878ae){return _0x36e520['id'];}}}));}}return BPromise[_0x8eb3('0x87')](_0x36f9e8)[_0x8eb3('0x2e')](function(_0x57b948){_0xff7144=_(_0xff7144)[_0x8eb3('0x88')](_0x57b948)[_0x8eb3('0x89')]()[_0x8eb3('0x8a')]();return db['SmsQueue'][_0x8eb3('0x54')]({'where':{'id':_0x4a0065['params']['id']}})[_0x8eb3('0x2e')](function(_0x4aafd7){return db['sequelize'][_0x8eb3('0x75')](function(_0x5d8627){return _0x4aafd7[_0x8eb3('0x7a')](_0x4a0065[_0x8eb3('0x3c')][_0x8eb3('0x8b')],{'transaction':_0x5d8627})[_0x8eb3('0x2e')](function(){if(!_[_0x8eb3('0x8c')](_0xff7144)){return _0x4aafd7[_0x8eb3('0x8d')](_0xff7144,{'transaction':_0x5d8627});}})[_0x8eb3('0x2e')](function(){_0xff7144[_0x8eb3('0x78')](function(_0x58736a){socket[_0x8eb3('0x8e')]('userSmsQueue:remove',{'UserId':_0x58736a,'SmsQueueId':_0x4aafd7['id']});});});});});});})[_0x8eb3('0x2e')](respondWithStatusCode(_0x4c3cfe,null))[_0x8eb3('0x50')](handleError(_0x4c3cfe,null));};exports['addAgents']=function(_0x37089a,_0x16cea9,_0x29d4aa){return db[_0x8eb3('0x38')][_0x8eb3('0x54')]({'where':{'id':_0x37089a[_0x8eb3('0x52')]['id']}})['then'](handleEntityNotFound(_0x16cea9,null))[_0x8eb3('0x2e')](function(_0x519f93){if(_0x519f93){return _0x519f93['addAgents'](_0x37089a[_0x8eb3('0x5d')]['ids'],_['omit'](_0x37089a['body'],[_0x8eb3('0x8b'),'id'])||{})['spread'](function(_0x328a12){for(var _0x529797=0x0;_0x529797<_0x37089a[_0x8eb3('0x5d')]['ids']['length'];_0x529797+=0x1){socket[_0x8eb3('0x8e')](_0x8eb3('0x79'),{'UserId':Number(_0x37089a[_0x8eb3('0x5d')][_0x8eb3('0x8b')][_0x529797]),'SmsQueueId':Number(_0x37089a[_0x8eb3('0x52')]['id'])});}return _0x328a12;});}})['then'](respondWithResult(_0x16cea9,null))[_0x8eb3('0x50')](handleError(_0x16cea9,null));};exports[_0x8eb3('0x8d')]=function(_0x33db19,_0x460654,_0x28c1a4){return db[_0x8eb3('0x38')][_0x8eb3('0x54')]({'where':{'id':_0x33db19['params']['id']}})[_0x8eb3('0x2e')](handleEntityNotFound(_0x460654,null))[_0x8eb3('0x2e')](function(_0x394e47){if(_0x394e47){return _0x394e47[_0x8eb3('0x8d')](_0x33db19[_0x8eb3('0x3c')][_0x8eb3('0x8b')])[_0x8eb3('0x2e')](function(){if(_[_0x8eb3('0x8f')](_0x33db19[_0x8eb3('0x3c')][_0x8eb3('0x8b')])){for(var _0x1365be=0x0;_0x1365be<_0x33db19[_0x8eb3('0x3c')][_0x8eb3('0x8b')][_0x8eb3('0x42')];_0x1365be+=0x1){socket[_0x8eb3('0x8e')]('userSmsQueue:remove',{'UserId':Number(_0x33db19[_0x8eb3('0x3c')]['ids'][_0x1365be]),'SmsQueueId':Number(_0x33db19['params']['id'])});}}else{socket['emit'](_0x8eb3('0x90'),{'UserId':Number(_0x33db19['query']['ids']),'SmsQueueId':Number(_0x33db19['params']['id'])});}});}})[_0x8eb3('0x2e')](respondWithStatusCode(_0x460654,null))[_0x8eb3('0x50')](handleError(_0x460654,null));};exports[_0x8eb3('0x91')]=function(_0x5e4e63,_0x5f242c,_0x168dba){var _0x232e76={};var _0x414e2f={};var _0x3c36e8;var _0x44a601;return db[_0x8eb3('0x38')][_0x8eb3('0x60')]({'where':{'id':_0x5e4e63[_0x8eb3('0x52')]['id']}})[_0x8eb3('0x2e')](handleEntityNotFound(_0x5f242c,null))[_0x8eb3('0x2e')](function(_0x5a403e){if(_0x5a403e){_0x3c36e8=_0x5a403e;_0x414e2f[_0x8eb3('0x3e')]=_['keys'](db[_0x8eb3('0x64')][_0x8eb3('0x39')]);_0x414e2f[_0x8eb3('0x3c')]=_['keys'](_0x5e4e63['query']);_0x414e2f[_0x8eb3('0x3d')]=_[_0x8eb3('0x40')](_0x414e2f[_0x8eb3('0x3e')],_0x414e2f[_0x8eb3('0x3c')]);_0x232e76[_0x8eb3('0x3f')]=_['intersection'](_0x414e2f['model'],qs[_0x8eb3('0x41')](_0x5e4e63[_0x8eb3('0x3c')][_0x8eb3('0x41')]));_0x232e76['attributes']=_0x232e76[_0x8eb3('0x3f')][_0x8eb3('0x42')]?_0x232e76[_0x8eb3('0x3f')]:_0x414e2f['model'];_0x232e76[_0x8eb3('0x62')]=qs[_0x8eb3('0x45')](_0x5e4e63[_0x8eb3('0x3c')]['sort']);_0x232e76[_0x8eb3('0x46')]=qs[_0x8eb3('0x3d')](_[_0x8eb3('0x47')](_0x5e4e63[_0x8eb3('0x3c')],_0x414e2f[_0x8eb3('0x3d')]));if(_0x5e4e63[_0x8eb3('0x3c')][_0x8eb3('0x4a')]){_0x232e76[_0x8eb3('0x46')]=_[_0x8eb3('0x48')](_0x232e76[_0x8eb3('0x46')],{'$or':_['map'](_0x232e76['attributes'],function(_0x5e1475){var _0xe65207={};_0xe65207[_0x5e1475]={'$like':'%'+_0x5e4e63[_0x8eb3('0x3c')][_0x8eb3('0x4a')]+'%'};return _0xe65207;})});}_0x232e76=_[_0x8eb3('0x48')]({},_0x232e76,_0x5e4e63[_0x8eb3('0x4b')]);return _0x3c36e8[_0x8eb3('0x91')](_0x232e76);}})[_0x8eb3('0x2e')](function(_0x50e724){if(_0x50e724){_0x44a601=_0x50e724[_0x8eb3('0x42')];if(!_0x5e4e63['query'][_0x8eb3('0x43')]('nolimit')){_0x232e76[_0x8eb3('0x26')]=qs[_0x8eb3('0x26')](_0x5e4e63[_0x8eb3('0x3c')][_0x8eb3('0x26')]);_0x232e76['offset']=qs['offset'](_0x5e4e63['query'][_0x8eb3('0x25')]);}return _0x3c36e8[_0x8eb3('0x91')](_0x232e76);}})[_0x8eb3('0x2e')](function(_0x2e7603){if(_0x2e7603){return _0x2e7603?{'count':_0x44a601,'rows':_0x2e7603}:null;}})[_0x8eb3('0x2e')](respondWithResult(_0x5f242c,null))[_0x8eb3('0x50')](handleError(_0x5f242c,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index db51a13..a6272ee 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 _0xe452=['../../mysqldb','SmsQueue','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events'];(function(_0xabdaff,_0x312ed){var _0x41c309=function(_0x28f913){while(--_0x28f913){_0xabdaff['push'](_0xabdaff['shift']());}};_0x41c309(++_0x312ed);}(_0xe452,0x74));var _0x2e45=function(_0x58f59d,_0x24d60e){_0x58f59d=_0x58f59d-0x0;var _0x5daff3=_0xe452[_0x58f59d];return _0x5daff3;};'use strict';var EventEmitter=require(_0x2e45('0x0'));var SmsQueue=require(_0x2e45('0x1'))['db'][_0x2e45('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x2e45('0x3')](0x0);var events={'afterCreate':_0x2e45('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2329f6){return function(_0x542bbe,_0x406bc8,_0x20484b){SmsQueueEvents[_0x2e45('0x5')](_0x2329f6+':'+_0x542bbe['id'],_0x542bbe);SmsQueueEvents[_0x2e45('0x5')](_0x2329f6,_0x542bbe);_0x20484b(null);};}for(var e in events){if(events[_0x2e45('0x6')](e)){var event=events[e];SmsQueue[_0x2e45('0x7')](e,emitEvent(event));}}module[_0x2e45('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0xd16b=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x3b109b,_0x803f48){var _0x3744dd=function(_0x585fac){while(--_0x585fac){_0x3b109b['push'](_0x3b109b['shift']());}};_0x3744dd(++_0x803f48);}(_0xd16b,0xf2));var _0xbd16=function(_0x1be055,_0x975a94){_0x1be055=_0x1be055-0x0;var _0x45bde4=_0xd16b[_0x1be055];return _0x45bde4;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xbd16('0x0'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xbd16('0x1')](0x0);var events={'afterCreate':_0xbd16('0x2'),'afterUpdate':_0xbd16('0x3'),'afterDestroy':_0xbd16('0x4')};function emitEvent(_0x2d5840){return function(_0x15c3ef,_0xbfe20b,_0x45e984){SmsQueueEvents['emit'](_0x2d5840+':'+_0x15c3ef['id'],_0x15c3ef);SmsQueueEvents[_0xbd16('0x5')](_0x2d5840,_0x15c3ef);_0x45e984(null);};}for(var e in events){if(events[_0xbd16('0x6')](e)){var event=events[e];SmsQueue[_0xbd16('0x7')](e,emitEvent(event));}}module[_0xbd16('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index b2c24b7..6a94a92 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 _0x7cc2=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','lodash','util'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x7cc2,0x196));var _0x27cc=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x7cc2[_0x20ef64];return _0x3707d8;};'use strict';var _=require(_0x27cc('0x0'));var util=require(_0x27cc('0x1'));var logger=require(_0x27cc('0x2'))(_0x27cc('0x3'));var moment=require(_0x27cc('0x4'));var BPromise=require('bluebird');var rp=require(_0x27cc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x27cc('0x6'));var config=require(_0x27cc('0x7'));var attributes=require(_0x27cc('0x8'));module[_0x27cc('0x9')]=function(_0x296d9a,_0x56ab79){return _0x296d9a[_0x27cc('0xa')](_0x27cc('0xb'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0cc6=['SmsQueue','sms_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','define'];(function(_0x5689c4,_0xb30097){var _0x5c0a94=function(_0x1b3b1f){while(--_0x1b3b1f){_0x5689c4['push'](_0x5689c4['shift']());}};_0x5c0a94(++_0xb30097);}(_0x0cc6,0x13a));var _0x60cc=function(_0x19aaa9,_0x9d0bb6){_0x19aaa9=_0x19aaa9-0x0;var _0x465463=_0x0cc6[_0x19aaa9];return _0x465463;};'use strict';var _=require(_0x60cc('0x0'));var util=require(_0x60cc('0x1'));var logger=require(_0x60cc('0x2'))(_0x60cc('0x3'));var moment=require('moment');var BPromise=require(_0x60cc('0x4'));var rp=require(_0x60cc('0x5'));var fs=require('fs');var path=require(_0x60cc('0x6'));var rimraf=require(_0x60cc('0x7'));var config=require(_0x60cc('0x8'));var attributes=require(_0x60cc('0x9'));module['exports']=function(_0x5c27d9,_0x562efe){return _0x5c27d9[_0x60cc('0xa')](_0x60cc('0xb'),attributes,{'tableName':_0x60cc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index e9ef780..2a4d35c 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 _0xe347=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetSmsQueue','ShowSmsQueue','find','lodash','util','moment','ioredis','../../config/utils'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xe347,0x16c));var _0x7e34=function(_0x57d671,_0x1a101c){_0x57d671=_0x57d671-0x0;var _0x450dfe=_0xe347[_0x57d671];return _0x450dfe;};'use strict';var _=require(_0x7e34('0x0'));var util=require(_0x7e34('0x1'));var moment=require(_0x7e34('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e34('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e34('0x4'));var logger=require(_0x7e34('0x5'))(_0x7e34('0x6'));var config=require(_0x7e34('0x7'));var jayson=require(_0x7e34('0x8'));var client=jayson[_0x7e34('0x9')][_0x7e34('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x7e34('0xb')],{'host':_0x7e34('0xc'),'port':0x18eb});var socket=require(_0x7e34('0xd'))(new Redis(config['redis']));require(_0x7e34('0xe'))[_0x7e34('0xf')](socket);function respondWithRpcPromise(_0x230720,_0x324ea6,_0x2dd5b7){return new BPromise(function(_0x3b8100,_0x547d25){return client[_0x7e34('0x10')](_0x230720,_0x2dd5b7)[_0x7e34('0x11')](function(_0x3d1da1){logger[_0x7e34('0x12')](_0x7e34('0x13'),_0x324ea6,'request\x20sent');logger[_0x7e34('0x14')](_0x7e34('0x15'),_0x324ea6,_0x7e34('0x16'),JSON[_0x7e34('0x17')](_0x3d1da1));if(_0x3d1da1['error']){if(_0x3d1da1[_0x7e34('0x18')][_0x7e34('0x19')]===0x1f4){logger[_0x7e34('0x18')](_0x7e34('0x13'),_0x324ea6,_0x3d1da1[_0x7e34('0x18')][_0x7e34('0x1a')]);return _0x547d25(_0x3d1da1['error'][_0x7e34('0x1a')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x324ea6,_0x3d1da1[_0x7e34('0x18')][_0x7e34('0x1a')]);return _0x3b8100(_0x3d1da1[_0x7e34('0x18')][_0x7e34('0x1a')]);}else{logger[_0x7e34('0x12')](_0x7e34('0x13'),_0x324ea6,_0x7e34('0x16'));_0x3b8100(_0x3d1da1['result']['message']);}})[_0x7e34('0x1b')](function(_0x469877){logger['error'](_0x7e34('0x13'),_0x324ea6,_0x469877);_0x547d25(_0x469877);});});}exports['GetSmsQueue']=function(_0x50824a){var _0xe498c8=this;return new Promise(function(_0x5eab22,_0x1e7546){return db[_0x7e34('0x1c')][_0x7e34('0x1d')]({'raw':_0x50824a[_0x7e34('0x1e')]?_0x50824a['options'][_0x7e34('0x1f')]===undefined?!![]:![]:!![],'where':_0x50824a['options']?_0x50824a[_0x7e34('0x1e')][_0x7e34('0x20')]||null:null,'attributes':_0x50824a['options']?_0x50824a['options'][_0x7e34('0x21')]||null:null,'limit':_0x50824a[_0x7e34('0x1e')]?_0x50824a[_0x7e34('0x1e')][_0x7e34('0x22')]||null:null,'include':_0x50824a[_0x7e34('0x1e')]?_0x50824a[_0x7e34('0x1e')][_0x7e34('0x23')]?_[_0x7e34('0x24')](_0x50824a[_0x7e34('0x1e')]['include'],function(_0x114892){return{'model':db[_0x114892[_0x7e34('0x25')]],'as':_0x114892['as'],'attributes':_0x114892['attributes'],'include':_0x114892['include']?_[_0x7e34('0x24')](_0x114892[_0x7e34('0x23')],function(_0x4fd0f8){return{'model':db[_0x4fd0f8[_0x7e34('0x25')]],'as':_0x4fd0f8['as'],'attributes':_0x4fd0f8[_0x7e34('0x21')],'include':_0x4fd0f8[_0x7e34('0x23')]?_[_0x7e34('0x24')](_0x4fd0f8['include'],function(_0x3470c3){return{'model':db[_0x3470c3['model']],'as':_0x3470c3['as'],'attributes':_0x3470c3['attributes']};}):[]};}):[]};}):[]:[]})[_0x7e34('0x11')](function(_0x7914b4){logger[_0x7e34('0x12')]('GetSmsQueue',_0x50824a);logger[_0x7e34('0x14')](_0x7e34('0x26'),_0x50824a,JSON[_0x7e34('0x17')](_0x7914b4));_0x5eab22(_0x7914b4);})[_0x7e34('0x1b')](function(_0x488de1){logger[_0x7e34('0x18')]('GetSmsQueue',_0x488de1['message'],_0x50824a);_0x1e7546(_0xe498c8['error'](0x1f4,_0x488de1[_0x7e34('0x1a')]));});});};exports[_0x7e34('0x27')]=function(_0x174efd){var _0x100632=this;return new Promise(function(_0x2f6d0d,_0x1f29a7){return db[_0x7e34('0x1c')][_0x7e34('0x28')]({'raw':_0x174efd[_0x7e34('0x1e')]?_0x174efd[_0x7e34('0x1e')][_0x7e34('0x1f')]===undefined?!![]:![]:!![],'where':_0x174efd[_0x7e34('0x1e')]?_0x174efd[_0x7e34('0x1e')][_0x7e34('0x20')]||null:null,'attributes':_0x174efd[_0x7e34('0x1e')]?_0x174efd[_0x7e34('0x1e')][_0x7e34('0x21')]||null:null,'include':_0x174efd[_0x7e34('0x1e')]?_0x174efd[_0x7e34('0x1e')]['include']?_[_0x7e34('0x24')](_0x174efd[_0x7e34('0x1e')]['include'],function(_0x21fb07){return{'model':db[_0x21fb07[_0x7e34('0x25')]],'as':_0x21fb07['as'],'attributes':_0x21fb07['attributes'],'include':_0x21fb07[_0x7e34('0x23')]?_[_0x7e34('0x24')](_0x21fb07[_0x7e34('0x23')],function(_0x1b97cc){return{'model':db[_0x1b97cc[_0x7e34('0x25')]],'as':_0x1b97cc['as'],'attributes':_0x1b97cc['attributes'],'include':_0x1b97cc[_0x7e34('0x23')]?_[_0x7e34('0x24')](_0x1b97cc[_0x7e34('0x23')],function(_0x3dd7fd){return{'model':db[_0x3dd7fd[_0x7e34('0x25')]],'as':_0x3dd7fd['as'],'attributes':_0x3dd7fd['attributes']};}):[]};}):[]};}):[]:[]})[_0x7e34('0x11')](function(_0x138562){logger['info'](_0x7e34('0x27'),_0x174efd);logger[_0x7e34('0x14')](_0x7e34('0x27'),_0x174efd,JSON['stringify'](_0x138562));_0x2f6d0d(_0x138562);})[_0x7e34('0x1b')](function(_0x2d9ba3){logger[_0x7e34('0x18')]('ShowSmsQueue',_0x2d9ba3[_0x7e34('0x1a')],_0x174efd);_0x1f29a7(_0x100632[_0x7e34('0x18')](0x1f4,_0x2d9ba3[_0x7e34('0x1a')]));});});}; \ No newline at end of file +var _0x0c9f=['request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','map','model','attributes','include','debug','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s'];(function(_0x50edf1,_0x17542b){var _0x3dd5df=function(_0x405287){while(--_0x405287){_0x50edf1['push'](_0x50edf1['shift']());}};_0x3dd5df(++_0x17542b);}(_0x0c9f,0x199));var _0xf0c9=function(_0x12e82a,_0x1c0627){_0x12e82a=_0x12e82a-0x0;var _0x71b393=_0x0c9f[_0x12e82a];return _0x71b393;};'use strict';var _=require(_0xf0c9('0x0'));var util=require(_0xf0c9('0x1'));var moment=require(_0xf0c9('0x2'));var BPromise=require(_0xf0c9('0x3'));var rs=require(_0xf0c9('0x4'));var fs=require('fs');var Redis=require(_0xf0c9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf0c9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xf0c9('0x7'));var jayson=require(_0xf0c9('0x8'));var client=jayson[_0xf0c9('0x9')][_0xf0c9('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf0c9('0xb')],{'host':_0xf0c9('0xc'),'port':0x18eb});var socket=require(_0xf0c9('0xd'))(new Redis(config['redis']));require(_0xf0c9('0xe'))[_0xf0c9('0xf')](socket);function respondWithRpcPromise(_0x477519,_0x3566ff,_0x57d120){return new BPromise(function(_0x3485d2,_0x42b812){return client[_0xf0c9('0x10')](_0x477519,_0x57d120)[_0xf0c9('0x11')](function(_0x30cacb){logger[_0xf0c9('0x12')](_0xf0c9('0x13'),_0x3566ff,_0xf0c9('0x14'));logger['debug'](_0xf0c9('0x15'),_0x3566ff,_0xf0c9('0x14'),JSON[_0xf0c9('0x16')](_0x30cacb));if(_0x30cacb['error']){if(_0x30cacb[_0xf0c9('0x17')]['code']===0x1f4){logger[_0xf0c9('0x17')](_0xf0c9('0x13'),_0x3566ff,_0x30cacb[_0xf0c9('0x17')][_0xf0c9('0x18')]);return _0x42b812(_0x30cacb['error'][_0xf0c9('0x18')]);}logger[_0xf0c9('0x17')](_0xf0c9('0x13'),_0x3566ff,_0x30cacb[_0xf0c9('0x17')]['message']);return _0x3485d2(_0x30cacb['error'][_0xf0c9('0x18')]);}else{logger[_0xf0c9('0x12')](_0xf0c9('0x13'),_0x3566ff,_0xf0c9('0x14'));_0x3485d2(_0x30cacb[_0xf0c9('0x19')]['message']);}})[_0xf0c9('0x1a')](function(_0x3658cb){logger['error'](_0xf0c9('0x13'),_0x3566ff,_0x3658cb);_0x42b812(_0x3658cb);});});}exports[_0xf0c9('0x1b')]=function(_0x2fd85b){var _0x49b77b=this;return new Promise(function(_0x429c97,_0x134b07){return db[_0xf0c9('0x1c')][_0xf0c9('0x1d')]({'raw':_0x2fd85b[_0xf0c9('0x1e')]?_0x2fd85b[_0xf0c9('0x1e')][_0xf0c9('0x1f')]===undefined?!![]:![]:!![],'where':_0x2fd85b['options']?_0x2fd85b[_0xf0c9('0x1e')][_0xf0c9('0x20')]||null:null,'attributes':_0x2fd85b['options']?_0x2fd85b[_0xf0c9('0x1e')]['attributes']||null:null,'limit':_0x2fd85b[_0xf0c9('0x1e')]?_0x2fd85b[_0xf0c9('0x1e')]['limit']||null:null,'include':_0x2fd85b['options']?_0x2fd85b[_0xf0c9('0x1e')]['include']?_[_0xf0c9('0x21')](_0x2fd85b[_0xf0c9('0x1e')]['include'],function(_0x469a86){return{'model':db[_0x469a86[_0xf0c9('0x22')]],'as':_0x469a86['as'],'attributes':_0x469a86[_0xf0c9('0x23')],'include':_0x469a86[_0xf0c9('0x24')]?_['map'](_0x469a86[_0xf0c9('0x24')],function(_0x529711){return{'model':db[_0x529711[_0xf0c9('0x22')]],'as':_0x529711['as'],'attributes':_0x529711['attributes'],'include':_0x529711[_0xf0c9('0x24')]?_[_0xf0c9('0x21')](_0x529711[_0xf0c9('0x24')],function(_0x2ae69c){return{'model':db[_0x2ae69c[_0xf0c9('0x22')]],'as':_0x2ae69c['as'],'attributes':_0x2ae69c['attributes']};}):[]};}):[]};}):[]:[]})[_0xf0c9('0x11')](function(_0x4c5693){logger['info']('GetSmsQueue',_0x2fd85b);logger[_0xf0c9('0x25')]('GetSmsQueue',_0x2fd85b,JSON[_0xf0c9('0x16')](_0x4c5693));_0x429c97(_0x4c5693);})[_0xf0c9('0x1a')](function(_0x373eec){logger['error']('GetSmsQueue',_0x373eec['message'],_0x2fd85b);_0x134b07(_0x49b77b[_0xf0c9('0x17')](0x1f4,_0x373eec[_0xf0c9('0x18')]));});});};exports[_0xf0c9('0x26')]=function(_0x1a59eb){var _0x289924=this;return new Promise(function(_0x356c46,_0x45a238){return db[_0xf0c9('0x1c')]['find']({'raw':_0x1a59eb[_0xf0c9('0x1e')]?_0x1a59eb[_0xf0c9('0x1e')][_0xf0c9('0x1f')]===undefined?!![]:![]:!![],'where':_0x1a59eb[_0xf0c9('0x1e')]?_0x1a59eb['options'][_0xf0c9('0x20')]||null:null,'attributes':_0x1a59eb['options']?_0x1a59eb[_0xf0c9('0x1e')]['attributes']||null:null,'include':_0x1a59eb['options']?_0x1a59eb['options']['include']?_[_0xf0c9('0x21')](_0x1a59eb['options'][_0xf0c9('0x24')],function(_0x31a58f){return{'model':db[_0x31a58f['model']],'as':_0x31a58f['as'],'attributes':_0x31a58f[_0xf0c9('0x23')],'include':_0x31a58f[_0xf0c9('0x24')]?_['map'](_0x31a58f[_0xf0c9('0x24')],function(_0x182b0a){return{'model':db[_0x182b0a[_0xf0c9('0x22')]],'as':_0x182b0a['as'],'attributes':_0x182b0a[_0xf0c9('0x23')],'include':_0x182b0a[_0xf0c9('0x24')]?_[_0xf0c9('0x21')](_0x182b0a[_0xf0c9('0x24')],function(_0x3f05ff){return{'model':db[_0x3f05ff['model']],'as':_0x3f05ff['as'],'attributes':_0x3f05ff[_0xf0c9('0x23')]};}):[]};}):[]};}):[]:[]})[_0xf0c9('0x11')](function(_0x174f48){logger[_0xf0c9('0x12')](_0xf0c9('0x26'),_0x1a59eb);logger[_0xf0c9('0x25')]('ShowSmsQueue',_0x1a59eb,JSON[_0xf0c9('0x16')](_0x174f48));_0x356c46(_0x174f48);})[_0xf0c9('0x1a')](function(_0x3ec694){logger[_0xf0c9('0x17')](_0xf0c9('0x26'),_0x3ec694[_0xf0c9('0x18')],_0x1a59eb);_0x45a238(_0x289924['error'](0x1f4,_0x3ec694[_0xf0c9('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 55be0e1..d4201ab 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 _0x7606=['emit','removeListener','register','length','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7606,0x137));var _0x6760=function(_0x2ae59b,_0x471d76){_0x2ae59b=_0x2ae59b-0x0;var _0x588c30=_0x7606[_0x2ae59b];return _0x588c30;};'use strict';var SmsQueueEvents=require(_0x6760('0x0'));var events=[_0x6760('0x1'),_0x6760('0x2'),_0x6760('0x3')];function createListener(_0x292b1b,_0x55a299){return function(_0x3ebe21){_0x55a299[_0x6760('0x4')](_0x292b1b,_0x3ebe21);};}function removeListener(_0x1076c6,_0x2a615a){return function(){SmsQueueEvents[_0x6760('0x5')](_0x1076c6,_0x2a615a);};}exports[_0x6760('0x6')]=function(_0x567cc1){for(var _0x3b77b9=0x0,_0x33da15=events[_0x6760('0x7')];_0x3b77b9<_0x33da15;_0x3b77b9++){var _0x3e8956=events[_0x3b77b9];var _0x5966bd=createListener(_0x6760('0x8')+_0x3e8956,_0x567cc1);SmsQueueEvents['on'](_0x3e8956,_0x5966bd);}}; \ No newline at end of file +var _0xb796=['emit','removeListener','length','smsQueue:','./smsQueue.events','save','update'];(function(_0x143d27,_0x2b2f86){var _0x2dd45f=function(_0x6d2345){while(--_0x6d2345){_0x143d27['push'](_0x143d27['shift']());}};_0x2dd45f(++_0x2b2f86);}(_0xb796,0x74));var _0x6b79=function(_0x4777ef,_0x208e7b){_0x4777ef=_0x4777ef-0x0;var _0x3396da=_0xb796[_0x4777ef];return _0x3396da;};'use strict';var SmsQueueEvents=require(_0x6b79('0x0'));var events=[_0x6b79('0x1'),'remove',_0x6b79('0x2')];function createListener(_0x23b899,_0x2aa98e){return function(_0x357ad0){_0x2aa98e[_0x6b79('0x3')](_0x23b899,_0x357ad0);};}function removeListener(_0x14131c,_0x302917){return function(){SmsQueueEvents[_0x6b79('0x4')](_0x14131c,_0x302917);};}exports['register']=function(_0xef8105){for(var _0x227055=0x0,_0x109edc=events[_0x6b79('0x5')];_0x227055<_0x109edc;_0x227055++){var _0xb701c=events[_0x227055];var _0xa34776=createListener(_0x6b79('0x6')+_0xb701c,_0xef8105);SmsQueueEvents['on'](_0xb701c,_0xa34776);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 259287d..a90a1b5 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 _0x49df=['./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1393f8,_0x2afa8d){var _0x5122cb=function(_0x5734b0){while(--_0x5734b0){_0x1393f8['push'](_0x1393f8['shift']());}};_0x5122cb(++_0x2afa8d);}(_0x49df,0xad));var _0xf49d=function(_0x284d8f,_0x1afc9e){_0x284d8f=_0x284d8f-0x0;var _0x6acf64=_0x49df[_0x284d8f];return _0x6acf64;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf49d('0x0'));var timeout=require(_0xf49d('0x1'));var express=require(_0xf49d('0x2'));var router=express[_0xf49d('0x3')]();var fs_extra=require(_0xf49d('0x4'));var auth=require(_0xf49d('0x5'));var interaction=require(_0xf49d('0x6'));var config=require('../../config/environment');var controller=require(_0xf49d('0x7'));router[_0xf49d('0x8')]('/',auth[_0xf49d('0x9')](),controller[_0xf49d('0xa')]);router[_0xf49d('0x8')](_0xf49d('0xb'),auth['isAuthenticated'](),controller[_0xf49d('0xc')]);router[_0xf49d('0x8')](_0xf49d('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xf49d('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf49d('0xf')](_0xf49d('0xd'),auth[_0xf49d('0x9')](),controller['update']);router[_0xf49d('0x10')](_0xf49d('0xd'),auth['isAuthenticated'](),controller[_0xf49d('0x11')]);module['exports']=router; \ No newline at end of file +var _0xed5f=['post','create','put','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x31f8aa,_0x1d1aa1){var _0x5ef007=function(_0x517d11){while(--_0x517d11){_0x31f8aa['push'](_0x31f8aa['shift']());}};_0x5ef007(++_0x1d1aa1);}(_0xed5f,0x1e6));var _0xfed5=function(_0x258e7c,_0x2581d3){_0x258e7c=_0x258e7c-0x0;var _0x513214=_0xed5f[_0x258e7c];return _0x513214;};'use strict';var multer=require('multer');var util=require(_0xfed5('0x0'));var path=require(_0xfed5('0x1'));var timeout=require(_0xfed5('0x2'));var express=require('express');var router=express[_0xfed5('0x3')]();var fs_extra=require(_0xfed5('0x4'));var auth=require(_0xfed5('0x5'));var interaction=require(_0xfed5('0x6'));var config=require('../../config/environment');var controller=require(_0xfed5('0x7'));router[_0xfed5('0x8')]('/',auth[_0xfed5('0x9')](),controller['index']);router[_0xfed5('0x8')](_0xfed5('0xa'),auth['isAuthenticated'](),controller[_0xfed5('0xb')]);router[_0xfed5('0x8')](_0xfed5('0xc'),auth[_0xfed5('0x9')](),controller[_0xfed5('0xd')]);router[_0xfed5('0xe')]('/',auth[_0xfed5('0x9')](),controller[_0xfed5('0xf')]);router[_0xfed5('0x10')](_0xfed5('0xc'),auth[_0xfed5('0x9')](),controller[_0xfed5('0x11')]);router['delete'](_0xfed5('0xc'),auth[_0xfed5('0x9')](),controller[_0xfed5('0x12')]);module[_0xfed5('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 9ebc115..b20531b 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 _0xbda9=['STRING','DATE','moment','sequelize','exports'];(function(_0x25e977,_0x2b05b3){var _0x4a86ac=function(_0x25f262){while(--_0x25f262){_0x25e977['push'](_0x25e977['shift']());}};_0x4a86ac(++_0x2b05b3);}(_0xbda9,0x101));var _0x9bda=function(_0x1b65ad,_0x1bd081){_0x1b65ad=_0x1b65ad-0x0;var _0x56aed4=_0xbda9[_0x1b65ad];return _0x56aed4;};'use strict';var moment=require(_0x9bda('0x0'));var Sequelize=require(_0x9bda('0x1'));module[_0x9bda('0x2')]={'uniqueid':{'type':Sequelize[_0x9bda('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9bda('0x3')]},'joinAt':{'type':Sequelize[_0x9bda('0x4')]},'leaveAt':{'type':Sequelize[_0x9bda('0x4')]},'acceptAt':{'type':Sequelize[_0x9bda('0x4')]},'exitAt':{'type':Sequelize[_0x9bda('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1c59=['exports','STRING','DATE','moment','sequelize'];(function(_0x1fbf27,_0x31c0e9){var _0x26002b=function(_0x1cf784){while(--_0x1cf784){_0x1fbf27['push'](_0x1fbf27['shift']());}};_0x26002b(++_0x31c0e9);}(_0x1c59,0x18e));var _0x91c5=function(_0x130934,_0x194b88){_0x130934=_0x130934-0x0;var _0x1dec02=_0x1c59[_0x130934];return _0x1dec02;};'use strict';var moment=require(_0x91c5('0x0'));var Sequelize=require(_0x91c5('0x1'));module[_0x91c5('0x2')]={'uniqueid':{'type':Sequelize[_0x91c5('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x91c5('0x3')]},'joinAt':{'type':Sequelize[_0x91c5('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x91c5('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index d978987..191d81b 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 _0x9ab5=['lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','limit','count','set','json','apply','reject','save','update','then','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','fields','options','create','body','find','destroy','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x9ab5,0xe1));var _0x59ab=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9ab5[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x59ab('0x0'));var rimraf=require(_0x59ab('0x1'));var zipdir=require(_0x59ab('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x59ab('0x3'));var moment=require(_0x59ab('0x4'));var BPromise=require(_0x59ab('0x5'));var Mustache=require(_0x59ab('0x6'));var util=require(_0x59ab('0x7'));var path=require(_0x59ab('0x8'));var sox=require('sox');var csv=require(_0x59ab('0x9'));var ejs=require(_0x59ab('0xa'));var fs=require('fs');var fs_extra=require(_0x59ab('0xb'));var _=require(_0x59ab('0xc'));var squel=require(_0x59ab('0xd'));var crypto=require(_0x59ab('0xe'));var jsforce=require(_0x59ab('0xf'));var deskjs=require(_0x59ab('0x10'));var toCsv=require(_0x59ab('0x9'));var querystring=require(_0x59ab('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x59ab('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x59ab('0x13'));var hardwareService=require(_0x59ab('0x14'));var logger=require(_0x59ab('0x15'))(_0x59ab('0x16'));var utils=require(_0x59ab('0x17'));var config=require(_0x59ab('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x59ab('0x19'))['db'];function respondWithStatusCode(_0x15e464,_0x17c5f0){_0x17c5f0=_0x17c5f0||0xcc;return function(_0x1159af){if(_0x1159af){return _0x15e464[_0x59ab('0x1a')](_0x17c5f0);}return _0x15e464['status'](_0x17c5f0)[_0x59ab('0x1b')]();};}function respondWithResult(_0x983962,_0x3d8a23){_0x3d8a23=_0x3d8a23||0xc8;return function(_0x2210c1){if(_0x2210c1){return _0x983962[_0x59ab('0x1c')](_0x3d8a23)['json'](_0x2210c1);}};}function respondWithFilteredResult(_0x2be8d3,_0x5ad812){return function(_0x540efc){if(_0x540efc){var _0x1f13bf=typeof _0x5ad812[_0x59ab('0x1d')]==='undefined'&&typeof _0x5ad812[_0x59ab('0x1e')]==='undefined';var _0x19dfd=_0x540efc['count'];var _0x56c166=_0x1f13bf?0x0:_0x5ad812[_0x59ab('0x1d')];var _0x1023cf=_0x1f13bf?_0x540efc[_0x59ab('0x1f')]:_0x5ad812[_0x59ab('0x1d')]+_0x5ad812['limit'];var _0x4d73c2;if(_0x1023cf>=_0x19dfd){_0x1023cf=_0x19dfd;_0x4d73c2=0xc8;}else{_0x4d73c2=0xce;}_0x2be8d3[_0x59ab('0x1c')](_0x4d73c2);return _0x2be8d3[_0x59ab('0x20')]('Content-Range',_0x56c166+'-'+_0x1023cf+'/'+_0x19dfd)[_0x59ab('0x21')](_0x540efc);}return null;};}function patchUpdates(_0x1515ca){return function(_0x221f2f){try{jsonpatch[_0x59ab('0x22')](_0x221f2f,_0x1515ca,!![]);}catch(_0x52463a){return BPromise[_0x59ab('0x23')](_0x52463a);}return _0x221f2f[_0x59ab('0x24')]();};}function saveUpdates(_0x2dfce2,_0x2edfd5){return function(_0x2ad552){if(_0x2ad552){return _0x2ad552[_0x59ab('0x25')](_0x2dfce2)[_0x59ab('0x26')](function(_0x5da736){return _0x5da736;});}return null;};}function removeEntity(_0x1fb77f,_0xa1bf82){return function(_0x1290f7){if(_0x1290f7){return _0x1290f7['destroy']()[_0x59ab('0x26')](function(){_0x1fb77f[_0x59ab('0x1c')](0xcc)[_0x59ab('0x1b')]();});}};}function handleEntityNotFound(_0x387209,_0x4b607b){return function(_0x1b234c){if(!_0x1b234c){_0x387209[_0x59ab('0x1a')](0x194);}return _0x1b234c;};}function handleError(_0x397b82,_0x1a77bd){_0x1a77bd=_0x1a77bd||0x1f4;return function(_0x26339f){logger[_0x59ab('0x27')](_0x26339f[_0x59ab('0x28')]);if(_0x26339f[_0x59ab('0x29')]){delete _0x26339f[_0x59ab('0x29')];}_0x397b82['status'](_0x1a77bd)[_0x59ab('0x2a')](_0x26339f);};}exports[_0x59ab('0x2b')]=function(_0x587156,_0x4e3353){var _0x216321={},_0x16f23f={},_0x1365aa={'count':0x0,'rows':[]};var _0x124bcb=_[_0x59ab('0x2c')](db[_0x59ab('0x2d')][_0x59ab('0x2e')],function(_0x24a42c){return{'name':_0x24a42c[_0x59ab('0x2f')],'type':_0x24a42c[_0x59ab('0x30')][_0x59ab('0x31')]};});_0x16f23f[_0x59ab('0x32')]=_[_0x59ab('0x2c')](_0x124bcb,_0x59ab('0x29'));_0x16f23f[_0x59ab('0x33')]=_[_0x59ab('0x34')](_0x587156[_0x59ab('0x33')]);_0x16f23f[_0x59ab('0x35')]=_[_0x59ab('0x36')](_0x16f23f[_0x59ab('0x32')],_0x16f23f[_0x59ab('0x33')]);_0x216321[_0x59ab('0x37')]=_[_0x59ab('0x36')](_0x16f23f[_0x59ab('0x32')],qs['fields'](_0x587156['query']['fields']));_0x216321[_0x59ab('0x37')]=_0x216321[_0x59ab('0x37')][_0x59ab('0x38')]?_0x216321[_0x59ab('0x37')]:_0x16f23f[_0x59ab('0x32')];if(!_0x587156[_0x59ab('0x33')][_0x59ab('0x39')](_0x59ab('0x3a'))){_0x216321[_0x59ab('0x1e')]=qs['limit'](_0x587156[_0x59ab('0x33')][_0x59ab('0x1e')]);_0x216321[_0x59ab('0x1d')]=qs['offset'](_0x587156['query'][_0x59ab('0x1d')]);}_0x216321[_0x59ab('0x3b')]=qs[_0x59ab('0x3c')](_0x587156[_0x59ab('0x33')]['sort']);_0x216321[_0x59ab('0x3d')]=qs[_0x59ab('0x35')](_[_0x59ab('0x3e')](_0x587156[_0x59ab('0x33')],_0x16f23f[_0x59ab('0x35')]),_0x124bcb);if(_0x587156[_0x59ab('0x33')][_0x59ab('0x3f')]){_0x216321['where']=_[_0x59ab('0x40')](_0x216321[_0x59ab('0x3d')],{'$or':_[_0x59ab('0x2c')](_0x124bcb,function(_0x565e98){if(_0x565e98[_0x59ab('0x30')]!==_0x59ab('0x41')){var _0x412782={};_0x412782[_0x565e98[_0x59ab('0x29')]]={'$like':'%'+_0x587156['query']['filter']+'%'};return _0x412782;}})});}_0x216321=_['merge']({},_0x216321,_0x587156['options']);var _0x49d94c={'where':_0x216321[_0x59ab('0x3d')]};return db[_0x59ab('0x2d')]['count'](_0x49d94c)['then'](function(_0x314e53){_0x1365aa['count']=_0x314e53;if(_0x587156[_0x59ab('0x33')][_0x59ab('0x42')]){_0x216321[_0x59ab('0x43')]=[{'all':!![]}];}return db[_0x59ab('0x2d')][_0x59ab('0x44')](_0x216321);})[_0x59ab('0x26')](function(_0x55829c){_0x1365aa[_0x59ab('0x45')]=_0x55829c;return _0x1365aa;})[_0x59ab('0x26')](respondWithFilteredResult(_0x4e3353,_0x216321))[_0x59ab('0x46')](handleError(_0x4e3353,null));};exports['show']=function(_0x243927,_0x3aafd9){var _0x141c35={'raw':!![],'where':{'id':_0x243927['params']['id']}},_0x4a7f69={};_0x4a7f69[_0x59ab('0x32')]=_[_0x59ab('0x34')](db[_0x59ab('0x2d')][_0x59ab('0x2e')]);_0x4a7f69[_0x59ab('0x33')]=_['keys'](_0x243927[_0x59ab('0x33')]);_0x4a7f69[_0x59ab('0x35')]=_[_0x59ab('0x36')](_0x4a7f69[_0x59ab('0x32')],_0x4a7f69[_0x59ab('0x33')]);_0x141c35[_0x59ab('0x37')]=_[_0x59ab('0x36')](_0x4a7f69[_0x59ab('0x32')],qs['fields'](_0x243927[_0x59ab('0x33')][_0x59ab('0x47')]));_0x141c35[_0x59ab('0x37')]=_0x141c35['attributes'][_0x59ab('0x38')]?_0x141c35[_0x59ab('0x37')]:_0x4a7f69[_0x59ab('0x32')];if(_0x243927[_0x59ab('0x33')][_0x59ab('0x42')]){_0x141c35['include']=[{'all':!![]}];}_0x141c35=_[_0x59ab('0x40')]({},_0x141c35,_0x243927[_0x59ab('0x48')]);return db[_0x59ab('0x2d')]['find'](_0x141c35)['then'](handleEntityNotFound(_0x3aafd9,null))[_0x59ab('0x26')](respondWithResult(_0x3aafd9,null))[_0x59ab('0x46')](handleError(_0x3aafd9,null));};exports[_0x59ab('0x49')]=function(_0x485bc9,_0x2d1ccb){return db[_0x59ab('0x2d')]['create'](_0x485bc9[_0x59ab('0x4a')],{})['then'](respondWithResult(_0x2d1ccb,0xc9))['catch'](handleError(_0x2d1ccb,null));};exports[_0x59ab('0x25')]=function(_0x4280ea,_0x5cb986){if(_0x4280ea[_0x59ab('0x4a')]['id']){delete _0x4280ea[_0x59ab('0x4a')]['id'];}return db[_0x59ab('0x2d')][_0x59ab('0x4b')]({'where':{'id':_0x4280ea['params']['id']}})[_0x59ab('0x26')](handleEntityNotFound(_0x5cb986,null))[_0x59ab('0x26')](saveUpdates(_0x4280ea[_0x59ab('0x4a')],null))[_0x59ab('0x26')](respondWithResult(_0x5cb986,null))['catch'](handleError(_0x5cb986,null));};exports[_0x59ab('0x4c')]=function(_0x30d101,_0x40c403){return db[_0x59ab('0x2d')][_0x59ab('0x4b')]({'where':{'id':_0x30d101[_0x59ab('0x4d')]['id']}})[_0x59ab('0x26')](handleEntityNotFound(_0x40c403,null))[_0x59ab('0x26')](removeEntity(_0x40c403,null))[_0x59ab('0x46')](handleError(_0x40c403,null));};exports['describe']=function(_0x56a182,_0x960217){return db[_0x59ab('0x2d')][_0x59ab('0x4e')]()['then'](respondWithResult(_0x960217,null))[_0x59ab('0x46')](handleError(_0x960217,null));}; \ No newline at end of file +var _0x754d=['squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash'];(function(_0x455fe5,_0x256762){var _0x1f8c1d=function(_0x16f911){while(--_0x16f911){_0x455fe5['push'](_0x455fe5['shift']());}};_0x1f8c1d(++_0x256762);}(_0x754d,0x8d));var _0xd754=function(_0x28571e,_0x99c3c0){_0x28571e=_0x28571e-0x0;var _0xb564a8=_0x754d[_0x28571e];return _0xb564a8;};'use strict';var emlformat=require(_0xd754('0x0'));var rimraf=require(_0xd754('0x1'));var zipdir=require(_0xd754('0x2'));var jsonpatch=require(_0xd754('0x3'));var rp=require(_0xd754('0x4'));var moment=require(_0xd754('0x5'));var BPromise=require(_0xd754('0x6'));var Mustache=require(_0xd754('0x7'));var util=require(_0xd754('0x8'));var path=require(_0xd754('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd754('0xa'));var squel=require(_0xd754('0xb'));var crypto=require(_0xd754('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd754('0xd'));var toCsv=require(_0xd754('0xe'));var querystring=require(_0xd754('0xf'));var Papa=require(_0xd754('0x10'));var Redis=require('ioredis');var authService=require(_0xd754('0x11'));var qs=require(_0xd754('0x12'));var as=require(_0xd754('0x13'));var hardwareService=require(_0xd754('0x14'));var logger=require(_0xd754('0x15'))('api');var utils=require(_0xd754('0x16'));var config=require(_0xd754('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c1b3e,_0x5913aa){_0x5913aa=_0x5913aa||0xcc;return function(_0x2dcdda){if(_0x2dcdda){return _0x2c1b3e[_0xd754('0x18')](_0x5913aa);}return _0x2c1b3e[_0xd754('0x19')](_0x5913aa)[_0xd754('0x1a')]();};}function respondWithResult(_0x2a7008,_0x2d469b){_0x2d469b=_0x2d469b||0xc8;return function(_0x717987){if(_0x717987){return _0x2a7008[_0xd754('0x19')](_0x2d469b)[_0xd754('0x1b')](_0x717987);}};}function respondWithFilteredResult(_0x1922f4,_0x1769cb){return function(_0x480635){if(_0x480635){var _0x3ef227=typeof _0x1769cb[_0xd754('0x1c')]===_0xd754('0x1d')&&typeof _0x1769cb['limit']===_0xd754('0x1d');var _0x37751e=_0x480635['count'];var _0x23c4f8=_0x3ef227?0x0:_0x1769cb[_0xd754('0x1c')];var _0x5f0b3d=_0x3ef227?_0x480635[_0xd754('0x1e')]:_0x1769cb['offset']+_0x1769cb[_0xd754('0x1f')];var _0x2296a6;if(_0x5f0b3d>=_0x37751e){_0x5f0b3d=_0x37751e;_0x2296a6=0xc8;}else{_0x2296a6=0xce;}_0x1922f4[_0xd754('0x19')](_0x2296a6);return _0x1922f4[_0xd754('0x20')](_0xd754('0x21'),_0x23c4f8+'-'+_0x5f0b3d+'/'+_0x37751e)[_0xd754('0x1b')](_0x480635);}return null;};}function patchUpdates(_0x33a017){return function(_0x48084d){try{jsonpatch[_0xd754('0x22')](_0x48084d,_0x33a017,!![]);}catch(_0x22066f){return BPromise[_0xd754('0x23')](_0x22066f);}return _0x48084d[_0xd754('0x24')]();};}function saveUpdates(_0x5c925f,_0xff77f2){return function(_0x40edec){if(_0x40edec){return _0x40edec[_0xd754('0x25')](_0x5c925f)['then'](function(_0x2a70ed){return _0x2a70ed;});}return null;};}function removeEntity(_0x526ced,_0x4d00ce){return function(_0x4a87c1){if(_0x4a87c1){return _0x4a87c1[_0xd754('0x26')]()[_0xd754('0x27')](function(){_0x526ced[_0xd754('0x19')](0xcc)[_0xd754('0x1a')]();});}};}function handleEntityNotFound(_0x1fb44d,_0x31db29){return function(_0x3b77a0){if(!_0x3b77a0){_0x1fb44d[_0xd754('0x18')](0x194);}return _0x3b77a0;};}function handleError(_0x4780ad,_0x2b370d){_0x2b370d=_0x2b370d||0x1f4;return function(_0x374698){logger['error'](_0x374698[_0xd754('0x28')]);if(_0x374698[_0xd754('0x29')]){delete _0x374698[_0xd754('0x29')];}_0x4780ad[_0xd754('0x19')](_0x2b370d)[_0xd754('0x2a')](_0x374698);};}exports[_0xd754('0x2b')]=function(_0xc19751,_0x52c313){var _0xfe3d7d={},_0xa44ef2={},_0x57aee9={'count':0x0,'rows':[]};var _0x4b7b70=_[_0xd754('0x2c')](db[_0xd754('0x2d')][_0xd754('0x2e')],function(_0x34ed58){return{'name':_0x34ed58[_0xd754('0x2f')],'type':_0x34ed58[_0xd754('0x30')][_0xd754('0x31')]};});_0xa44ef2[_0xd754('0x32')]=_[_0xd754('0x2c')](_0x4b7b70,_0xd754('0x29'));_0xa44ef2[_0xd754('0x33')]=_[_0xd754('0x34')](_0xc19751[_0xd754('0x33')]);_0xa44ef2[_0xd754('0x35')]=_[_0xd754('0x36')](_0xa44ef2['model'],_0xa44ef2['query']);_0xfe3d7d[_0xd754('0x37')]=_[_0xd754('0x36')](_0xa44ef2[_0xd754('0x32')],qs[_0xd754('0x38')](_0xc19751['query'][_0xd754('0x38')]));_0xfe3d7d[_0xd754('0x37')]=_0xfe3d7d[_0xd754('0x37')][_0xd754('0x39')]?_0xfe3d7d[_0xd754('0x37')]:_0xa44ef2[_0xd754('0x32')];if(!_0xc19751['query']['hasOwnProperty'](_0xd754('0x3a'))){_0xfe3d7d[_0xd754('0x1f')]=qs[_0xd754('0x1f')](_0xc19751[_0xd754('0x33')]['limit']);_0xfe3d7d[_0xd754('0x1c')]=qs[_0xd754('0x1c')](_0xc19751[_0xd754('0x33')][_0xd754('0x1c')]);}_0xfe3d7d['order']=qs[_0xd754('0x3b')](_0xc19751[_0xd754('0x33')][_0xd754('0x3b')]);_0xfe3d7d['where']=qs['filters'](_['pick'](_0xc19751[_0xd754('0x33')],_0xa44ef2['filters']),_0x4b7b70);if(_0xc19751['query'][_0xd754('0x3c')]){_0xfe3d7d[_0xd754('0x3d')]=_[_0xd754('0x3e')](_0xfe3d7d['where'],{'$or':_[_0xd754('0x2c')](_0x4b7b70,function(_0x4eadb9){if(_0x4eadb9[_0xd754('0x30')]!==_0xd754('0x3f')){var _0x24ada8={};_0x24ada8[_0x4eadb9['name']]={'$like':'%'+_0xc19751[_0xd754('0x33')]['filter']+'%'};return _0x24ada8;}})});}_0xfe3d7d=_['merge']({},_0xfe3d7d,_0xc19751[_0xd754('0x40')]);var _0x186b5d={'where':_0xfe3d7d[_0xd754('0x3d')]};return db[_0xd754('0x2d')][_0xd754('0x1e')](_0x186b5d)[_0xd754('0x27')](function(_0x556149){_0x57aee9['count']=_0x556149;if(_0xc19751[_0xd754('0x33')][_0xd754('0x41')]){_0xfe3d7d[_0xd754('0x42')]=[{'all':!![]}];}return db[_0xd754('0x2d')][_0xd754('0x43')](_0xfe3d7d);})[_0xd754('0x27')](function(_0x1b831d){_0x57aee9[_0xd754('0x44')]=_0x1b831d;return _0x57aee9;})['then'](respondWithFilteredResult(_0x52c313,_0xfe3d7d))[_0xd754('0x45')](handleError(_0x52c313,null));};exports[_0xd754('0x46')]=function(_0x5e1385,_0x126a13){var _0x2dff15={'raw':!![],'where':{'id':_0x5e1385[_0xd754('0x47')]['id']}},_0x2e43ec={};_0x2e43ec[_0xd754('0x32')]=_['keys'](db[_0xd754('0x2d')][_0xd754('0x2e')]);_0x2e43ec['query']=_[_0xd754('0x34')](_0x5e1385[_0xd754('0x33')]);_0x2e43ec['filters']=_['intersection'](_0x2e43ec[_0xd754('0x32')],_0x2e43ec[_0xd754('0x33')]);_0x2dff15[_0xd754('0x37')]=_['intersection'](_0x2e43ec[_0xd754('0x32')],qs[_0xd754('0x38')](_0x5e1385[_0xd754('0x33')][_0xd754('0x38')]));_0x2dff15['attributes']=_0x2dff15[_0xd754('0x37')][_0xd754('0x39')]?_0x2dff15[_0xd754('0x37')]:_0x2e43ec[_0xd754('0x32')];if(_0x5e1385[_0xd754('0x33')]['includeAll']){_0x2dff15[_0xd754('0x42')]=[{'all':!![]}];}_0x2dff15=_['merge']({},_0x2dff15,_0x5e1385[_0xd754('0x40')]);return db['SmsQueueReport'][_0xd754('0x48')](_0x2dff15)[_0xd754('0x27')](handleEntityNotFound(_0x126a13,null))['then'](respondWithResult(_0x126a13,null))[_0xd754('0x45')](handleError(_0x126a13,null));};exports['create']=function(_0x4b6a7e,_0x4d807d){return db[_0xd754('0x2d')][_0xd754('0x49')](_0x4b6a7e[_0xd754('0x4a')],{})[_0xd754('0x27')](respondWithResult(_0x4d807d,0xc9))[_0xd754('0x45')](handleError(_0x4d807d,null));};exports['update']=function(_0x54e7fc,_0x1e23c0){if(_0x54e7fc[_0xd754('0x4a')]['id']){delete _0x54e7fc[_0xd754('0x4a')]['id'];}return db['SmsQueueReport'][_0xd754('0x48')]({'where':{'id':_0x54e7fc['params']['id']}})[_0xd754('0x27')](handleEntityNotFound(_0x1e23c0,null))[_0xd754('0x27')](saveUpdates(_0x54e7fc[_0xd754('0x4a')],null))[_0xd754('0x27')](respondWithResult(_0x1e23c0,null))['catch'](handleError(_0x1e23c0,null));};exports['destroy']=function(_0xc65365,_0x34a8a1){return db[_0xd754('0x2d')]['find']({'where':{'id':_0xc65365[_0xd754('0x47')]['id']}})[_0xd754('0x27')](handleEntityNotFound(_0x34a8a1,null))[_0xd754('0x27')](removeEntity(_0x34a8a1,null))['catch'](handleError(_0x34a8a1,null));};exports['describe']=function(_0x3ab99b,_0x53887d){return db[_0xd754('0x2d')][_0xd754('0x4b')]()[_0xd754('0x27')](respondWithResult(_0x53887d,null))['catch'](handleError(_0x53887d,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index b810a00..7788e59 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 _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x34907d,_0x992447){var _0xb53e35=function(_0x133845){while(--_0x133845){_0x34907d['push'](_0x34907d['shift']());}};_0xb53e35(++_0x992447);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 0a02502..024cd4d 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 _0x0f14=['debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','UpdateSmsQueueReport','update','where','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x55aa17,_0x293b1c){var _0x2a7852=function(_0x120bb1){while(--_0x120bb1){_0x55aa17['push'](_0x55aa17['shift']());}};_0x2a7852(++_0x293b1c);}(_0x0f14,0x1b5));var _0x40f1=function(_0x4674f2,_0x39cdcd){_0x4674f2=_0x4674f2-0x0;var _0x5203ba=_0x0f14[_0x4674f2];return _0x5203ba;};'use strict';var _=require(_0x40f1('0x0'));var util=require(_0x40f1('0x1'));var moment=require(_0x40f1('0x2'));var BPromise=require(_0x40f1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x40f1('0x4'));var logger=require('../../config/logger')(_0x40f1('0x5'));var config=require(_0x40f1('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x40f1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5abace,_0x431943,_0x5abdb4){return new BPromise(function(_0x1d648f,_0x1b52ee){return client[_0x40f1('0x8')](_0x5abace,_0x5abdb4)[_0x40f1('0x9')](function(_0x525166){logger[_0x40f1('0xa')](_0x40f1('0xb'),_0x431943,_0x40f1('0xc'));logger[_0x40f1('0xd')](_0x40f1('0xe'),_0x431943,_0x40f1('0xc'),JSON[_0x40f1('0xf')](_0x525166));if(_0x525166[_0x40f1('0x10')]){if(_0x525166[_0x40f1('0x10')][_0x40f1('0x11')]===0x1f4){logger['error'](_0x40f1('0xb'),_0x431943,_0x525166[_0x40f1('0x10')]['message']);return _0x1b52ee(_0x525166[_0x40f1('0x10')]['message']);}logger['error'](_0x40f1('0xb'),_0x431943,_0x525166['error'][_0x40f1('0x12')]);return _0x1d648f(_0x525166[_0x40f1('0x10')][_0x40f1('0x12')]);}else{logger[_0x40f1('0xa')](_0x40f1('0xb'),_0x431943,'request\x20sent');_0x1d648f(_0x525166[_0x40f1('0x13')][_0x40f1('0x12')]);}})[_0x40f1('0x14')](function(_0x4d38d4){logger[_0x40f1('0x10')](_0x40f1('0xb'),_0x431943,_0x4d38d4);_0x1b52ee(_0x4d38d4);});});}exports[_0x40f1('0x15')]=function(_0x464603){var _0x14abef=this;return new Promise(function(_0x2f1a4d,_0x40755a){return db[_0x40f1('0x16')][_0x40f1('0x17')](_0x464603[_0x40f1('0x18')],{'raw':_0x464603[_0x40f1('0x19')]?_0x464603[_0x40f1('0x19')][_0x40f1('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x278e58){logger[_0x40f1('0xa')](_0x40f1('0x15'),_0x464603);logger[_0x40f1('0xd')](_0x40f1('0x15'),_0x464603,JSON[_0x40f1('0xf')](_0x278e58));_0x2f1a4d(_0x278e58);})[_0x40f1('0x14')](function(_0x43ca6b){logger['error'](_0x40f1('0x15'),_0x43ca6b[_0x40f1('0x12')],_0x464603);_0x40755a(_0x14abef[_0x40f1('0x10')](0x1f4,_0x43ca6b['message']));});});};exports[_0x40f1('0x1b')]=function(_0x5a0e8c){var _0x3327ea=this;return new Promise(function(_0x2c7048,_0x289a36){return db[_0x40f1('0x16')][_0x40f1('0x1c')](_0x5a0e8c[_0x40f1('0x18')],{'raw':_0x5a0e8c[_0x40f1('0x19')]?_0x5a0e8c[_0x40f1('0x19')][_0x40f1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a0e8c[_0x40f1('0x19')]?_0x5a0e8c[_0x40f1('0x19')][_0x40f1('0x1d')]||null:null,'attributes':_0x5a0e8c[_0x40f1('0x19')]?_0x5a0e8c[_0x40f1('0x19')]['attributes']||null:null,'limit':_0x5a0e8c[_0x40f1('0x19')]?_0x5a0e8c[_0x40f1('0x19')]['limit']||null:null})['then'](function(_0x211df8){logger['info'](_0x40f1('0x1b'),_0x5a0e8c);logger[_0x40f1('0xd')](_0x40f1('0x1b'),_0x5a0e8c,JSON[_0x40f1('0xf')](_0x211df8));_0x2c7048(_0x211df8);})[_0x40f1('0x14')](function(_0x3be8c7){logger[_0x40f1('0x10')](_0x40f1('0x1b'),_0x3be8c7['message'],_0x5a0e8c);_0x289a36(_0x3327ea[_0x40f1('0x10')](0x1f4,_0x3be8c7['message']));});});}; \ No newline at end of file +var _0x0567=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSmsQueueReport','create','body','options','raw','debug','SmsQueueReport','where','attributes','UpdateSmsQueueReport','lodash','moment','bluebird','randomstring'];(function(_0x154784,_0x526d63){var _0xf3eaed=function(_0x53d100){while(--_0x53d100){_0x154784['push'](_0x154784['shift']());}};_0xf3eaed(++_0x526d63);}(_0x0567,0x1dc));var _0x7056=function(_0x4dc1dd,_0x42b7fc){_0x4dc1dd=_0x4dc1dd-0x0;var _0x53d09f=_0x0567[_0x4dc1dd];return _0x53d09f;};'use strict';var _=require(_0x7056('0x0'));var util=require('util');var moment=require(_0x7056('0x1'));var BPromise=require(_0x7056('0x2'));var rs=require(_0x7056('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7056('0x4'))['db'];var utils=require(_0x7056('0x5'));var logger=require(_0x7056('0x6'))('rpc');var config=require(_0x7056('0x7'));var jayson=require(_0x7056('0x8'));var client=jayson['client'][_0x7056('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2824a2,_0x5b0ae7,_0x2f3d4b){return new BPromise(function(_0x3b42ee,_0x37ec0f){return client['request'](_0x2824a2,_0x2f3d4b)[_0x7056('0xa')](function(_0x2f2f20){logger[_0x7056('0xb')](_0x7056('0xc'),_0x5b0ae7,_0x7056('0xd'));logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x5b0ae7,_0x7056('0xd'),JSON[_0x7056('0xe')](_0x2f2f20));if(_0x2f2f20['error']){if(_0x2f2f20[_0x7056('0xf')][_0x7056('0x10')]===0x1f4){logger[_0x7056('0xf')](_0x7056('0xc'),_0x5b0ae7,_0x2f2f20[_0x7056('0xf')][_0x7056('0x11')]);return _0x37ec0f(_0x2f2f20[_0x7056('0xf')][_0x7056('0x11')]);}logger['error'](_0x7056('0xc'),_0x5b0ae7,_0x2f2f20[_0x7056('0xf')]['message']);return _0x3b42ee(_0x2f2f20[_0x7056('0xf')]['message']);}else{logger[_0x7056('0xb')](_0x7056('0xc'),_0x5b0ae7,_0x7056('0xd'));_0x3b42ee(_0x2f2f20[_0x7056('0x12')]['message']);}})[_0x7056('0x13')](function(_0x1b8b42){logger[_0x7056('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x5b0ae7,_0x1b8b42);_0x37ec0f(_0x1b8b42);});});}exports[_0x7056('0x14')]=function(_0x5dbc79){var _0x50ebbc=this;return new Promise(function(_0x4f2e79,_0x575ffc){return db['SmsQueueReport'][_0x7056('0x15')](_0x5dbc79[_0x7056('0x16')],{'raw':_0x5dbc79[_0x7056('0x17')]?_0x5dbc79['options'][_0x7056('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x36c116){logger['info'](_0x7056('0x14'),_0x5dbc79);logger[_0x7056('0x19')](_0x7056('0x14'),_0x5dbc79,JSON[_0x7056('0xe')](_0x36c116));_0x4f2e79(_0x36c116);})[_0x7056('0x13')](function(_0xa11d02){logger['error'](_0x7056('0x14'),_0xa11d02[_0x7056('0x11')],_0x5dbc79);_0x575ffc(_0x50ebbc[_0x7056('0xf')](0x1f4,_0xa11d02['message']));});});};exports['UpdateSmsQueueReport']=function(_0x487493){var _0x4f1f48=this;return new Promise(function(_0x15ebc8,_0x2d152a){return db[_0x7056('0x1a')]['update'](_0x487493[_0x7056('0x16')],{'raw':_0x487493['options']?_0x487493[_0x7056('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x487493[_0x7056('0x17')]?_0x487493[_0x7056('0x17')][_0x7056('0x1b')]||null:null,'attributes':_0x487493[_0x7056('0x17')]?_0x487493['options'][_0x7056('0x1c')]||null:null,'limit':_0x487493[_0x7056('0x17')]?_0x487493[_0x7056('0x17')]['limit']||null:null})[_0x7056('0xa')](function(_0x112717){logger[_0x7056('0xb')](_0x7056('0x1d'),_0x487493);logger['debug'](_0x7056('0x1d'),_0x487493,JSON[_0x7056('0xe')](_0x112717));_0x15ebc8(_0x112717);})[_0x7056('0x13')](function(_0x2e829f){logger[_0x7056('0xf')]('UpdateSmsQueueReport',_0x2e829f[_0x7056('0x11')],_0x487493);_0x2d152a(_0x4f1f48['error'](0x1f4,_0x2e829f[_0x7056('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 994f143..3ccf735 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 _0x7bae=['isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get'];(function(_0x228c67,_0x3ef29){var _0x2b7013=function(_0x13476b){while(--_0x13476b){_0x228c67['push'](_0x228c67['shift']());}};_0x2b7013(++_0x3ef29);}(_0x7bae,0x13b));var _0xe7ba=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x7bae[_0x5f09c5];return _0x426ad9;};'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 +var _0x44e8=['show','post','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0xb7b722,_0xe95ba7){var _0x217177=function(_0x463ab4){while(--_0x463ab4){_0xb7b722['push'](_0xb7b722['shift']());}};_0x217177(++_0xe95ba7);}(_0x44e8,0xd7));var _0x844e=function(_0x21a1e0,_0xee2eed){_0x21a1e0=_0x21a1e0-0x0;var _0x3335f2=_0x44e8[_0x21a1e0];return _0x3335f2;};'use strict';var multer=require(_0x844e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x844e('0x1'));var express=require(_0x844e('0x2'));var router=express[_0x844e('0x3')]();var fs_extra=require(_0x844e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x844e('0x5'));var config=require(_0x844e('0x6'));var controller=require(_0x844e('0x7'));router[_0x844e('0x8')]('/',auth['isAuthenticated'](),controller[_0x844e('0x9')]);router[_0x844e('0x8')](_0x844e('0xa'),auth[_0x844e('0xb')](),controller['describe']);router[_0x844e('0x8')](_0x844e('0xc'),auth[_0x844e('0xb')](),controller[_0x844e('0xd')]);router[_0x844e('0xe')]('/',auth[_0x844e('0xb')](),controller['create']);router[_0x844e('0xf')](_0x844e('0xc'),auth[_0x844e('0xb')](),controller[_0x844e('0x10')]);router[_0x844e('0x11')](_0x844e('0xc'),auth[_0x844e('0xb')](),controller['destroy']);module[_0x844e('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 3ff980a..81750f7 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x25383a,_0xd9b3c5){var _0x25fdb1=function(_0x343ca3){while(--_0x343ca3){_0x25383a['push'](_0x25383a['shift']());}};_0x25fdb1(++_0xd9b3c5);}(_0x008c,0x188));var _0xc008=function(_0x11b1b3,_0xf3cc69){_0x11b1b3=_0x11b1b3-0x0;var _0x437029=_0x008c[_0x11b1b3];return _0x437029;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x1950d9,_0x57bbc3){var _0x50c131=function(_0x7a1188){while(--_0x7a1188){_0x1950d9['push'](_0x1950d9['shift']());}};_0x50c131(++_0x57bbc3);}(_0x70e0,0x17b));var _0x070e=function(_0x441056,_0xdac0c0){_0x441056=_0x441056-0x0;var _0x4f8730=_0x70e0[_0x441056];return _0x4f8730;};'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/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index e7598a6..9e224ba 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 _0x6573=['catch','show','params','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','stack','name','map','SmsTransferReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows'];(function(_0x4d9f71,_0x2587cf){var _0x2d011=function(_0x5c4b59){while(--_0x5c4b59){_0x4d9f71['push'](_0x4d9f71['shift']());}};_0x2d011(++_0x2587cf);}(_0x6573,0x127));var _0x3657=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6573[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x3657('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3657('0x1'));var jsonpatch=require(_0x3657('0x2'));var rp=require(_0x3657('0x3'));var moment=require(_0x3657('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3657('0x5'));var util=require('util');var path=require(_0x3657('0x6'));var sox=require(_0x3657('0x7'));var csv=require(_0x3657('0x8'));var ejs=require(_0x3657('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3657('0xa'));var crypto=require(_0x3657('0xb'));var jsforce=require(_0x3657('0xc'));var deskjs=require(_0x3657('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3657('0xe'));var Papa=require(_0x3657('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3657('0x10'));var as=require(_0x3657('0x11'));var hardwareService=require(_0x3657('0x12'));var logger=require(_0x3657('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x3657('0x14'));var licenseUtil=require(_0x3657('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59beb1,_0x22f665){_0x22f665=_0x22f665||0xcc;return function(_0xc43774){if(_0xc43774){return _0x59beb1[_0x3657('0x16')](_0x22f665);}return _0x59beb1[_0x3657('0x17')](_0x22f665)[_0x3657('0x18')]();};}function respondWithResult(_0x3660a2,_0x268752){_0x268752=_0x268752||0xc8;return function(_0x6c5fae){if(_0x6c5fae){return _0x3660a2['status'](_0x268752)['json'](_0x6c5fae);}};}function respondWithFilteredResult(_0xdf584d,_0xf0dced){return function(_0x1f3afe){if(_0x1f3afe){var _0x270005=typeof _0xf0dced[_0x3657('0x19')]===_0x3657('0x1a')&&typeof _0xf0dced['limit']==='undefined';var _0x8ccd4a=_0x1f3afe[_0x3657('0x1b')];var _0x1ab716=_0x270005?0x0:_0xf0dced[_0x3657('0x19')];var _0x525483=_0x270005?_0x1f3afe['count']:_0xf0dced['offset']+_0xf0dced[_0x3657('0x1c')];var _0x485814;if(_0x525483>=_0x8ccd4a){_0x525483=_0x8ccd4a;_0x485814=0xc8;}else{_0x485814=0xce;}_0xdf584d['status'](_0x485814);return _0xdf584d[_0x3657('0x1d')]('Content-Range',_0x1ab716+'-'+_0x525483+'/'+_0x8ccd4a)['json'](_0x1f3afe);}return null;};}function patchUpdates(_0x49d588){return function(_0x201b86){try{jsonpatch[_0x3657('0x1e')](_0x201b86,_0x49d588,!![]);}catch(_0x22bec3){return BPromise[_0x3657('0x1f')](_0x22bec3);}return _0x201b86[_0x3657('0x20')]();};}function saveUpdates(_0x45dda6,_0x45de12){return function(_0x502345){if(_0x502345){return _0x502345[_0x3657('0x21')](_0x45dda6)[_0x3657('0x22')](function(_0x311bbb){return _0x311bbb;});}return null;};}function removeEntity(_0x1d3f7e,_0x479c81){return function(_0x1b1f95){if(_0x1b1f95){return _0x1b1f95[_0x3657('0x23')]()['then'](function(){_0x1d3f7e[_0x3657('0x17')](0xcc)[_0x3657('0x18')]();});}};}function handleEntityNotFound(_0x5cd61e,_0x2f7ccf){return function(_0x4baa04){if(!_0x4baa04){_0x5cd61e[_0x3657('0x16')](0x194);}return _0x4baa04;};}function handleError(_0x597620,_0xaa7fb6){_0xaa7fb6=_0xaa7fb6||0x1f4;return function(_0x245e2f){logger[_0x3657('0x24')](_0x245e2f[_0x3657('0x25')]);if(_0x245e2f[_0x3657('0x26')]){delete _0x245e2f[_0x3657('0x26')];}_0x597620['status'](_0xaa7fb6)['send'](_0x245e2f);};}exports['index']=function(_0x44d003,_0x46707a){var _0x219e7c={},_0xb3782d={},_0x50a6ad={'count':0x0,'rows':[]};var _0x4cdabe=_[_0x3657('0x27')](db[_0x3657('0x28')][_0x3657('0x29')],function(_0x24d901){return{'name':_0x24d901[_0x3657('0x2a')],'type':_0x24d901[_0x3657('0x2b')][_0x3657('0x2c')]};});_0xb3782d['model']=_[_0x3657('0x27')](_0x4cdabe,'name');_0xb3782d['query']=_[_0x3657('0x2d')](_0x44d003[_0x3657('0x2e')]);_0xb3782d[_0x3657('0x2f')]=_[_0x3657('0x30')](_0xb3782d[_0x3657('0x31')],_0xb3782d[_0x3657('0x2e')]);_0x219e7c[_0x3657('0x32')]=_[_0x3657('0x30')](_0xb3782d[_0x3657('0x31')],qs[_0x3657('0x33')](_0x44d003[_0x3657('0x2e')][_0x3657('0x33')]));_0x219e7c[_0x3657('0x32')]=_0x219e7c[_0x3657('0x32')][_0x3657('0x34')]?_0x219e7c[_0x3657('0x32')]:_0xb3782d[_0x3657('0x31')];if(!_0x44d003[_0x3657('0x2e')][_0x3657('0x35')](_0x3657('0x36'))){_0x219e7c['limit']=qs[_0x3657('0x1c')](_0x44d003[_0x3657('0x2e')][_0x3657('0x1c')]);_0x219e7c[_0x3657('0x19')]=qs[_0x3657('0x19')](_0x44d003['query'][_0x3657('0x19')]);}_0x219e7c['order']=qs[_0x3657('0x37')](_0x44d003['query'][_0x3657('0x37')]);_0x219e7c[_0x3657('0x38')]=qs[_0x3657('0x2f')](_[_0x3657('0x39')](_0x44d003[_0x3657('0x2e')],_0xb3782d[_0x3657('0x2f')]),_0x4cdabe);if(_0x44d003['query'][_0x3657('0x3a')]){_0x219e7c[_0x3657('0x38')]=_['merge'](_0x219e7c['where'],{'$or':_[_0x3657('0x27')](_0x4cdabe,function(_0x53701e){if(_0x53701e[_0x3657('0x2b')]!=='VIRTUAL'){var _0x21add0={};_0x21add0[_0x53701e['name']]={'$like':'%'+_0x44d003[_0x3657('0x2e')]['filter']+'%'};return _0x21add0;}})});}_0x219e7c=_[_0x3657('0x3b')]({},_0x219e7c,_0x44d003[_0x3657('0x3c')]);var _0x3ca54e={'where':_0x219e7c['where']};return db['SmsTransferReport'][_0x3657('0x1b')](_0x3ca54e)['then'](function(_0xd69474){_0x50a6ad[_0x3657('0x1b')]=_0xd69474;if(_0x44d003[_0x3657('0x2e')][_0x3657('0x3d')]){_0x219e7c[_0x3657('0x3e')]=[{'all':!![]}];}return db[_0x3657('0x28')][_0x3657('0x3f')](_0x219e7c);})[_0x3657('0x22')](function(_0x245ca7){_0x50a6ad[_0x3657('0x40')]=_0x245ca7;return _0x50a6ad;})[_0x3657('0x22')](respondWithFilteredResult(_0x46707a,_0x219e7c))[_0x3657('0x41')](handleError(_0x46707a,null));};exports[_0x3657('0x42')]=function(_0x18d942,_0x3e1e1f){var _0x251377={'raw':!![],'where':{'id':_0x18d942[_0x3657('0x43')]['id']}},_0x21cd29={};_0x21cd29[_0x3657('0x31')]=_['keys'](db[_0x3657('0x28')][_0x3657('0x29')]);_0x21cd29[_0x3657('0x2e')]=_[_0x3657('0x2d')](_0x18d942[_0x3657('0x2e')]);_0x21cd29[_0x3657('0x2f')]=_[_0x3657('0x30')](_0x21cd29[_0x3657('0x31')],_0x21cd29['query']);_0x251377[_0x3657('0x32')]=_['intersection'](_0x21cd29[_0x3657('0x31')],qs[_0x3657('0x33')](_0x18d942[_0x3657('0x2e')][_0x3657('0x33')]));_0x251377[_0x3657('0x32')]=_0x251377[_0x3657('0x32')][_0x3657('0x34')]?_0x251377[_0x3657('0x32')]:_0x21cd29[_0x3657('0x31')];if(_0x18d942['query'][_0x3657('0x3d')]){_0x251377[_0x3657('0x3e')]=[{'all':!![]}];}_0x251377=_['merge']({},_0x251377,_0x18d942[_0x3657('0x3c')]);return db[_0x3657('0x28')]['find'](_0x251377)[_0x3657('0x22')](handleEntityNotFound(_0x3e1e1f,null))[_0x3657('0x22')](respondWithResult(_0x3e1e1f,null))['catch'](handleError(_0x3e1e1f,null));};exports[_0x3657('0x44')]=function(_0x4fc0fa,_0x102079){return db[_0x3657('0x28')]['create'](_0x4fc0fa[_0x3657('0x45')],{})[_0x3657('0x22')](respondWithResult(_0x102079,0xc9))[_0x3657('0x41')](handleError(_0x102079,null));};exports[_0x3657('0x21')]=function(_0x20c60d,_0x5d09a2){if(_0x20c60d[_0x3657('0x45')]['id']){delete _0x20c60d['body']['id'];}return db[_0x3657('0x28')]['find']({'where':{'id':_0x20c60d[_0x3657('0x43')]['id']}})[_0x3657('0x22')](handleEntityNotFound(_0x5d09a2,null))[_0x3657('0x22')](saveUpdates(_0x20c60d['body'],null))[_0x3657('0x22')](respondWithResult(_0x5d09a2,null))[_0x3657('0x41')](handleError(_0x5d09a2,null));};exports[_0x3657('0x23')]=function(_0x26e794,_0x94c75c){return db[_0x3657('0x28')][_0x3657('0x46')]({'where':{'id':_0x26e794[_0x3657('0x43')]['id']}})[_0x3657('0x22')](handleEntityNotFound(_0x94c75c,null))[_0x3657('0x22')](removeEntity(_0x94c75c,null))['catch'](handleError(_0x94c75c,null));};exports[_0x3657('0x47')]=function(_0x49aea2,_0x57dec9){return db[_0x3657('0x28')][_0x3657('0x47')]()[_0x3657('0x22')](respondWithResult(_0x57dec9,null))[_0x3657('0x41')](handleError(_0x57dec9,null));}; \ No newline at end of file +var _0x3508=['offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','SmsTransferReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','rawAttributes','length','includeAll','include','find','create','body','describe','fast-json-patch','request-promise','moment','util','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x2142ea,_0x5a8f39){var _0x53e2a9=function(_0xd6a441){while(--_0xd6a441){_0x2142ea['push'](_0x2142ea['shift']());}};_0x53e2a9(++_0x5a8f39);}(_0x3508,0x75));var _0x8350=function(_0x51f950,_0x3ecf51){_0x51f950=_0x51f950-0x0;var _0x3941d9=_0x3508[_0x51f950];return _0x3941d9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8350('0x0'));var rp=require(_0x8350('0x1'));var moment=require(_0x8350('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8350('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x8350('0x4'));var ejs=require(_0x8350('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8350('0x6'));var crypto=require('crypto');var jsforce=require(_0x8350('0x7'));var deskjs=require(_0x8350('0x8'));var toCsv=require(_0x8350('0x4'));var querystring=require(_0x8350('0x9'));var Papa=require(_0x8350('0xa'));var Redis=require(_0x8350('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8350('0xc'));var hardwareService=require(_0x8350('0xd'));var logger=require('../../config/logger')(_0x8350('0xe'));var utils=require(_0x8350('0xf'));var config=require(_0x8350('0x10'));var licenseUtil=require(_0x8350('0x11'));var db=require(_0x8350('0x12'))['db'];function respondWithStatusCode(_0x49387c,_0x42326a){_0x42326a=_0x42326a||0xcc;return function(_0x4778b5){if(_0x4778b5){return _0x49387c[_0x8350('0x13')](_0x42326a);}return _0x49387c['status'](_0x42326a)[_0x8350('0x14')]();};}function respondWithResult(_0x237139,_0x1d4a7e){_0x1d4a7e=_0x1d4a7e||0xc8;return function(_0x49ac2a){if(_0x49ac2a){return _0x237139[_0x8350('0x15')](_0x1d4a7e)[_0x8350('0x16')](_0x49ac2a);}};}function respondWithFilteredResult(_0x2fd3d2,_0x81a504){return function(_0x5e56c7){if(_0x5e56c7){var _0x240acd=typeof _0x81a504[_0x8350('0x17')]===_0x8350('0x18')&&typeof _0x81a504['limit']==='undefined';var _0x750c2e=_0x5e56c7['count'];var _0x211ae8=_0x240acd?0x0:_0x81a504[_0x8350('0x17')];var _0x3fcb76=_0x240acd?_0x5e56c7[_0x8350('0x19')]:_0x81a504['offset']+_0x81a504['limit'];var _0x527447;if(_0x3fcb76>=_0x750c2e){_0x3fcb76=_0x750c2e;_0x527447=0xc8;}else{_0x527447=0xce;}_0x2fd3d2[_0x8350('0x15')](_0x527447);return _0x2fd3d2['set'](_0x8350('0x1a'),_0x211ae8+'-'+_0x3fcb76+'/'+_0x750c2e)['json'](_0x5e56c7);}return null;};}function patchUpdates(_0x27e3f1){return function(_0x55fc47){try{jsonpatch[_0x8350('0x1b')](_0x55fc47,_0x27e3f1,!![]);}catch(_0x47a499){return BPromise[_0x8350('0x1c')](_0x47a499);}return _0x55fc47[_0x8350('0x1d')]();};}function saveUpdates(_0x7c3fca,_0x2a3847){return function(_0x445c11){if(_0x445c11){return _0x445c11[_0x8350('0x1e')](_0x7c3fca)[_0x8350('0x1f')](function(_0x510385){return _0x510385;});}return null;};}function removeEntity(_0x197d36,_0x35c17a){return function(_0x134361){if(_0x134361){return _0x134361[_0x8350('0x20')]()['then'](function(){_0x197d36[_0x8350('0x15')](0xcc)[_0x8350('0x14')]();});}};}function handleEntityNotFound(_0x4ba1c7,_0x4434a1){return function(_0x41379b){if(!_0x41379b){_0x4ba1c7[_0x8350('0x13')](0x194);}return _0x41379b;};}function handleError(_0x1f11fc,_0x3cbc6b){_0x3cbc6b=_0x3cbc6b||0x1f4;return function(_0x3487ff){logger[_0x8350('0x21')](_0x3487ff[_0x8350('0x22')]);if(_0x3487ff[_0x8350('0x23')]){delete _0x3487ff[_0x8350('0x23')];}_0x1f11fc[_0x8350('0x15')](_0x3cbc6b)['send'](_0x3487ff);};}exports['index']=function(_0xe6fe77,_0x282c1b){var _0xc9b092={},_0x2c495c={},_0x150148={'count':0x0,'rows':[]};var _0x563cd8=_[_0x8350('0x24')](db[_0x8350('0x25')]['rawAttributes'],function(_0x50c696){return{'name':_0x50c696[_0x8350('0x26')],'type':_0x50c696[_0x8350('0x27')]['key']};});_0x2c495c[_0x8350('0x28')]=_[_0x8350('0x24')](_0x563cd8,_0x8350('0x23'));_0x2c495c[_0x8350('0x29')]=_[_0x8350('0x2a')](_0xe6fe77[_0x8350('0x29')]);_0x2c495c[_0x8350('0x2b')]=_[_0x8350('0x2c')](_0x2c495c['model'],_0x2c495c['query']);_0xc9b092[_0x8350('0x2d')]=_[_0x8350('0x2c')](_0x2c495c[_0x8350('0x28')],qs[_0x8350('0x2e')](_0xe6fe77[_0x8350('0x29')]['fields']));_0xc9b092[_0x8350('0x2d')]=_0xc9b092[_0x8350('0x2d')]['length']?_0xc9b092[_0x8350('0x2d')]:_0x2c495c['model'];if(!_0xe6fe77[_0x8350('0x29')][_0x8350('0x2f')](_0x8350('0x30'))){_0xc9b092[_0x8350('0x31')]=qs['limit'](_0xe6fe77[_0x8350('0x29')]['limit']);_0xc9b092[_0x8350('0x17')]=qs[_0x8350('0x17')](_0xe6fe77['query'][_0x8350('0x17')]);}_0xc9b092[_0x8350('0x32')]=qs[_0x8350('0x33')](_0xe6fe77['query'][_0x8350('0x33')]);_0xc9b092[_0x8350('0x34')]=qs[_0x8350('0x2b')](_[_0x8350('0x35')](_0xe6fe77['query'],_0x2c495c['filters']),_0x563cd8);if(_0xe6fe77[_0x8350('0x29')][_0x8350('0x36')]){_0xc9b092[_0x8350('0x34')]=_[_0x8350('0x37')](_0xc9b092[_0x8350('0x34')],{'$or':_[_0x8350('0x24')](_0x563cd8,function(_0x24d6fa){if(_0x24d6fa['type']!==_0x8350('0x38')){var _0x414080={};_0x414080[_0x24d6fa[_0x8350('0x23')]]={'$like':'%'+_0xe6fe77[_0x8350('0x29')][_0x8350('0x36')]+'%'};return _0x414080;}})});}_0xc9b092=_[_0x8350('0x37')]({},_0xc9b092,_0xe6fe77[_0x8350('0x39')]);var _0x49e15a={'where':_0xc9b092[_0x8350('0x34')]};return db[_0x8350('0x25')]['count'](_0x49e15a)[_0x8350('0x1f')](function(_0x425de5){_0x150148[_0x8350('0x19')]=_0x425de5;if(_0xe6fe77[_0x8350('0x29')]['includeAll']){_0xc9b092['include']=[{'all':!![]}];}return db[_0x8350('0x25')]['findAll'](_0xc9b092);})[_0x8350('0x1f')](function(_0x3aa272){_0x150148[_0x8350('0x3a')]=_0x3aa272;return _0x150148;})[_0x8350('0x1f')](respondWithFilteredResult(_0x282c1b,_0xc9b092))[_0x8350('0x3b')](handleError(_0x282c1b,null));};exports[_0x8350('0x3c')]=function(_0x3f9c89,_0x3a8dd6){var _0x26aef8={'raw':!![],'where':{'id':_0x3f9c89[_0x8350('0x3d')]['id']}},_0x5e94a7={};_0x5e94a7[_0x8350('0x28')]=_['keys'](db[_0x8350('0x25')][_0x8350('0x3e')]);_0x5e94a7[_0x8350('0x29')]=_[_0x8350('0x2a')](_0x3f9c89[_0x8350('0x29')]);_0x5e94a7[_0x8350('0x2b')]=_['intersection'](_0x5e94a7[_0x8350('0x28')],_0x5e94a7[_0x8350('0x29')]);_0x26aef8['attributes']=_[_0x8350('0x2c')](_0x5e94a7['model'],qs[_0x8350('0x2e')](_0x3f9c89[_0x8350('0x29')][_0x8350('0x2e')]));_0x26aef8[_0x8350('0x2d')]=_0x26aef8[_0x8350('0x2d')][_0x8350('0x3f')]?_0x26aef8[_0x8350('0x2d')]:_0x5e94a7[_0x8350('0x28')];if(_0x3f9c89[_0x8350('0x29')][_0x8350('0x40')]){_0x26aef8[_0x8350('0x41')]=[{'all':!![]}];}_0x26aef8=_[_0x8350('0x37')]({},_0x26aef8,_0x3f9c89[_0x8350('0x39')]);return db['SmsTransferReport'][_0x8350('0x42')](_0x26aef8)[_0x8350('0x1f')](handleEntityNotFound(_0x3a8dd6,null))[_0x8350('0x1f')](respondWithResult(_0x3a8dd6,null))[_0x8350('0x3b')](handleError(_0x3a8dd6,null));};exports['create']=function(_0x168ec8,_0x2425d1){return db[_0x8350('0x25')][_0x8350('0x43')](_0x168ec8[_0x8350('0x44')],{})[_0x8350('0x1f')](respondWithResult(_0x2425d1,0xc9))[_0x8350('0x3b')](handleError(_0x2425d1,null));};exports[_0x8350('0x1e')]=function(_0x4bcd83,_0x4d6e5f){if(_0x4bcd83['body']['id']){delete _0x4bcd83[_0x8350('0x44')]['id'];}return db[_0x8350('0x25')][_0x8350('0x42')]({'where':{'id':_0x4bcd83[_0x8350('0x3d')]['id']}})[_0x8350('0x1f')](handleEntityNotFound(_0x4d6e5f,null))[_0x8350('0x1f')](saveUpdates(_0x4bcd83[_0x8350('0x44')],null))[_0x8350('0x1f')](respondWithResult(_0x4d6e5f,null))[_0x8350('0x3b')](handleError(_0x4d6e5f,null));};exports[_0x8350('0x20')]=function(_0x5025eb,_0x5c6564){return db[_0x8350('0x25')][_0x8350('0x42')]({'where':{'id':_0x5025eb[_0x8350('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5c6564,null))[_0x8350('0x1f')](removeEntity(_0x5c6564,null))[_0x8350('0x3b')](handleError(_0x5c6564,null));};exports[_0x8350('0x45')]=function(_0xd0d214,_0x3312ef){return db[_0x8350('0x25')][_0x8350('0x45')]()[_0x8350('0x1f')](respondWithResult(_0x3312ef,null))[_0x8350('0x3b')](handleError(_0x3312ef,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 586a69f..4ac4a13 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 _0x4c08=['api','moment','path','rimraf','define','report_sms_transfer','lodash','../../config/logger'];(function(_0x4a9b5e,_0x57a3d9){var _0x4baae5=function(_0x275ea9){while(--_0x275ea9){_0x4a9b5e['push'](_0x4a9b5e['shift']());}};_0x4baae5(++_0x57a3d9);}(_0x4c08,0x1ee));var _0x84c0=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x4c08[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x84c0('0x0'));var util=require('util');var logger=require(_0x84c0('0x1'))(_0x84c0('0x2'));var moment=require(_0x84c0('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x84c0('0x4'));var rimraf=require(_0x84c0('0x5'));var config=require('../../config/environment');var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x1f23be,_0x1d4615){return _0x1f23be[_0x84c0('0x6')]('SmsTransferReport',attributes,{'tableName':_0x84c0('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8c77=['exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes'];(function(_0x1719ce,_0x855181){var _0x2c412c=function(_0x4a21f9){while(--_0x4a21f9){_0x1719ce['push'](_0x1719ce['shift']());}};_0x2c412c(++_0x855181);}(_0x8c77,0x1d6));var _0x78c7=function(_0x2c9099,_0x5bf853){_0x2c9099=_0x2c9099-0x0;var _0x49015b=_0x8c77[_0x2c9099];return _0x49015b;};'use strict';var _=require(_0x78c7('0x0'));var util=require(_0x78c7('0x1'));var logger=require('../../config/logger')(_0x78c7('0x2'));var moment=require(_0x78c7('0x3'));var BPromise=require(_0x78c7('0x4'));var rp=require(_0x78c7('0x5'));var fs=require('fs');var path=require(_0x78c7('0x6'));var rimraf=require(_0x78c7('0x7'));var config=require(_0x78c7('0x8'));var attributes=require(_0x78c7('0x9'));module[_0x78c7('0xa')]=function(_0x575548,_0x42ff20){return _0x575548[_0x78c7('0xb')](_0x78c7('0xc'),attributes,{'tableName':_0x78c7('0xd'),'paranoid':![],'indexes':[{'name':_0x78c7('0xe'),'fields':[_0x78c7('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index f1fb81a..bd98f1a 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 _0x4c4e=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x310947,_0x22d6da){var _0x460383=function(_0x23af25){while(--_0x23af25){_0x310947['push'](_0x310947['shift']());}};_0x460383(++_0x22d6da);}(_0x4c4e,0x152));var _0xe4c4=function(_0x4c1e26,_0x389073){_0x4c1e26=_0x4c1e26-0x0;var _0xb9e042=_0x4c4e[_0x4c1e26];return _0xb9e042;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var moment=require(_0xe4c4('0x1'));var BPromise=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4c4('0x4'))['db'];var utils=require(_0xe4c4('0x5'));var logger=require(_0xe4c4('0x6'))('rpc');var config=require(_0xe4c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe4c4('0x8')][_0xe4c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x262b64,_0xad105,_0x22085a){return new BPromise(function(_0x329d29,_0x28a42e){return client[_0xe4c4('0xa')](_0x262b64,_0x22085a)['then'](function(_0x589b2e){logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));logger[_0xe4c4('0xe')](_0xe4c4('0xf'),_0xad105,_0xe4c4('0xd'),JSON['stringify'](_0x589b2e));if(_0x589b2e[_0xe4c4('0x10')]){if(_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x11')]===0x1f4){logger[_0xe4c4('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x28a42e(_0x589b2e['error'][_0xe4c4('0x12')]);}logger[_0xe4c4('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x329d29(_0x589b2e['error'][_0xe4c4('0x12')]);}else{logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));_0x329d29(_0x589b2e[_0xe4c4('0x13')][_0xe4c4('0x12')]);}})[_0xe4c4('0x14')](function(_0x1038cb){logger[_0xe4c4('0x10')](_0xe4c4('0xc'),_0xad105,_0x1038cb);_0x28a42e(_0x1038cb);});});} \ No newline at end of file +var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x1cb9,0x14e));var _0x91cb=function(_0x312989,_0xa36734){_0x312989=_0x312989-0x0;var _0x4f7903=_0x1cb9[_0x312989];return _0x4f7903;};'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')]('SmsTransferReport,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 1545cab..a3c2b85 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 _0x0e51=['originalname','replace','format','%s-%s%s','basename','extname','post','create','put','update','delete','/:id','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','show','download','diskStorage','join','server/files/sounds/original/'];(function(_0x3200ca,_0x38a575){var _0x5e49f4=function(_0x1a7810){while(--_0x1a7810){_0x3200ca['push'](_0x3200ca['shift']());}};_0x5e49f4(++_0x38a575);}(_0x0e51,0x1e0));var _0x10e5=function(_0x45ed4c,_0x50c3e3){_0x45ed4c=_0x45ed4c-0x0;var _0x2c0299=_0x0e51[_0x45ed4c];return _0x2c0299;};'use strict';var multer=require('multer');var util=require(_0x10e5('0x0'));var path=require('path');var timeout=require(_0x10e5('0x1'));var express=require('express');var router=express[_0x10e5('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x10e5('0x3'));var interaction=require(_0x10e5('0x4'));var config=require(_0x10e5('0x5'));var controller=require(_0x10e5('0x6'));router[_0x10e5('0x7')]('/',auth[_0x10e5('0x8')](),controller['index']);router[_0x10e5('0x7')]('/:id',auth[_0x10e5('0x8')](),controller[_0x10e5('0x9')]);router['get']('/:id/download',auth[_0x10e5('0x8')](),controller[_0x10e5('0xa')]);var upload=multer({'storage':multer[_0x10e5('0xb')]({'destination':function(_0x284264,_0x12d110,_0x2af1a2){_0x2af1a2(null,path[_0x10e5('0xc')](config['root'],_0x10e5('0xd')));},'filename':function(_0x85146e,_0x294d38,_0x91e3f1){_0x294d38[_0x10e5('0xe')]=_0x294d38[_0x10e5('0xe')][_0x10e5('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x91e3f1(null,util[_0x10e5('0x10')](_0x10e5('0x11'),path[_0x10e5('0x12')](_0x294d38[_0x10e5('0xe')],path[_0x10e5('0x13')](_0x294d38[_0x10e5('0xe')])),Date['now'](),path['extname'](_0x294d38['originalname'])));}})});router[_0x10e5('0x14')]('/',upload['single']('file'),controller[_0x10e5('0x15')]);router[_0x10e5('0x16')]('/:id',auth[_0x10e5('0x8')](),controller[_0x10e5('0x17')]);router[_0x10e5('0x18')](_0x10e5('0x19'),auth[_0x10e5('0x8')](),controller['delete']);module['exports']=router; \ No newline at end of file +var _0x59e6=['put','/:id','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','index','show','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','create'];(function(_0x3ee444,_0x86f3d1){var _0x29de3e=function(_0x417b9){while(--_0x417b9){_0x3ee444['push'](_0x3ee444['shift']());}};_0x29de3e(++_0x86f3d1);}(_0x59e6,0x14d));var _0x659e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x59e6[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require(_0x659e('0x0'));var path=require(_0x659e('0x1'));var timeout=require(_0x659e('0x2'));var express=require(_0x659e('0x3'));var router=express[_0x659e('0x4')]();var fs_extra=require(_0x659e('0x5'));var auth=require(_0x659e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x659e('0x7'));var controller=require(_0x659e('0x8'));router[_0x659e('0x9')]('/',auth[_0x659e('0xa')](),controller[_0x659e('0xb')]);router['get']('/:id',auth[_0x659e('0xa')](),controller[_0x659e('0xc')]);router[_0x659e('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x659e('0xd')]);var upload=multer({'storage':multer[_0x659e('0xe')]({'destination':function(_0x28c2b4,_0x1b33ba,_0x5ab026){_0x5ab026(null,path[_0x659e('0xf')](config[_0x659e('0x10')],'server/files/sounds/original/'));},'filename':function(_0x453fee,_0x3a5ed1,_0x5a71dc){_0x3a5ed1[_0x659e('0x11')]=_0x3a5ed1[_0x659e('0x11')][_0x659e('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5a71dc(null,util[_0x659e('0x13')](_0x659e('0x14'),path[_0x659e('0x15')](_0x3a5ed1[_0x659e('0x11')],path[_0x659e('0x16')](_0x3a5ed1[_0x659e('0x11')])),Date[_0x659e('0x17')](),path[_0x659e('0x16')](_0x3a5ed1[_0x659e('0x11')])));}})});router['post']('/',upload[_0x659e('0x18')](_0x659e('0x19')),controller[_0x659e('0x1a')]);router[_0x659e('0x1b')](_0x659e('0x1c'),auth[_0x659e('0xa')](),controller['update']);router[_0x659e('0x1d')](_0x659e('0x1c'),auth[_0x659e('0xa')](),controller[_0x659e('0x1d')]);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 57d38f6..35753ed 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 _0xeab2=['name','FLOAT','BIGINT','INTEGER','sequelize','exports','STRING'];(function(_0x36a70f,_0x106909){var _0x194447=function(_0x148cc1){while(--_0x148cc1){_0x36a70f['push'](_0x36a70f['shift']());}};_0x194447(++_0x106909);}(_0xeab2,0xcf));var _0x2eab=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xeab2[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0x2eab('0x0'));module[_0x2eab('0x1')]={'name':{'type':Sequelize[_0x2eab('0x2')],'unique':_0x2eab('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x2eab('0x2')]},'display_name':{'type':Sequelize[_0x2eab('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x2eab('0x2')]},'original_duration':{'type':Sequelize[_0x2eab('0x4')]},'original_sampleCount':{'type':Sequelize[_0x2eab('0x5')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x2eab('0x6')]},'converted_format':{'type':Sequelize[_0x2eab('0x2')]},'converted_duration':{'type':Sequelize[_0x2eab('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x2eab('0x5')]},'converted_channelCount':{'type':Sequelize[_0x2eab('0x6')]},'converted_bitRate':{'type':Sequelize[_0x2eab('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x2eab('0x6')]}}; \ No newline at end of file +var _0x32ef=['STRING','name','FLOAT','BIGINT','INTEGER'];(function(_0x3b212d,_0x3f4bc3){var _0x33fca6=function(_0x3e6301){while(--_0x3e6301){_0x3b212d['push'](_0x3b212d['shift']());}};_0x33fca6(++_0x3f4bc3);}(_0x32ef,0x172));var _0xf32e=function(_0x1d031f,_0x45d6cc){_0x1d031f=_0x1d031f-0x0;var _0xcf29fc=_0x32ef[_0x1d031f];return _0xcf29fc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf32e('0x0')],'unique':_0xf32e('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0xf32e('0x0')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xf32e('0x0')]},'original_format':{'type':Sequelize[_0xf32e('0x0')]},'original_duration':{'type':Sequelize[_0xf32e('0x2')]},'original_sampleCount':{'type':Sequelize[_0xf32e('0x3')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xf32e('0x3')]},'original_sampleRate':{'type':Sequelize[_0xf32e('0x4')]},'converted_format':{'type':Sequelize[_0xf32e('0x0')]},'converted_duration':{'type':Sequelize[_0xf32e('0x2')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xf32e('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xf32e('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index bc5df0b..dd686cc 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 _0x7f87=['send','index','map','Sound','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','find','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sound\x20not\x20found','download','format','%s.%s','basename','originalname','file','filename','extname','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','dest','converted_channelCount','converted_sampleRate','sampleRate','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','original_format','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','get','Sounds','UserProfileResource','destroy','error','name'];(function(_0x55800c,_0x11c04f){var _0x5e24e6=function(_0x1d9465){while(--_0x1d9465){_0x55800c['push'](_0x55800c['shift']());}};_0x5e24e6(++_0x11c04f);}(_0x7f87,0x139));var _0x77f8=function(_0x586f57,_0x99eba5){_0x586f57=_0x586f57-0x0;var _0x117dea=_0x7f87[_0x586f57];return _0x117dea;};'use strict';var emlformat=require(_0x77f8('0x0'));var rimraf=require(_0x77f8('0x1'));var zipdir=require(_0x77f8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x77f8('0x3'));var moment=require(_0x77f8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x77f8('0x5'));var util=require(_0x77f8('0x6'));var path=require('path');var sox=require(_0x77f8('0x7'));var csv=require('to-csv');var ejs=require(_0x77f8('0x8'));var fs=require('fs');var fs_extra=require(_0x77f8('0x9'));var _=require(_0x77f8('0xa'));var squel=require(_0x77f8('0xb'));var crypto=require(_0x77f8('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x77f8('0xd'));var querystring=require(_0x77f8('0xe'));var Papa=require('papaparse');var Redis=require(_0x77f8('0xf'));var authService=require(_0x77f8('0x10'));var qs=require(_0x77f8('0x11'));var as=require(_0x77f8('0x12'));var hardwareService=require(_0x77f8('0x13'));var logger=require(_0x77f8('0x14'))(_0x77f8('0x15'));var utils=require(_0x77f8('0x16'));var config=require(_0x77f8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x77f8('0x18'))['db'];function respondWithStatusCode(_0x5b8f3f,_0x542cac){_0x542cac=_0x542cac||0xcc;return function(_0x5c9114){if(_0x5c9114){return _0x5b8f3f[_0x77f8('0x19')](_0x542cac);}return _0x5b8f3f[_0x77f8('0x1a')](_0x542cac)[_0x77f8('0x1b')]();};}function respondWithResult(_0x860b5d,_0x32e738){_0x32e738=_0x32e738||0xc8;return function(_0x25493f){if(_0x25493f){return _0x860b5d['status'](_0x32e738)[_0x77f8('0x1c')](_0x25493f);}};}function respondWithFilteredResult(_0xca2101,_0x3bf0d2){return function(_0x2cc251){if(_0x2cc251){var _0x35e71a=typeof _0x3bf0d2['offset']===_0x77f8('0x1d')&&typeof _0x3bf0d2[_0x77f8('0x1e')]==='undefined';var _0x43749b=_0x2cc251[_0x77f8('0x1f')];var _0x887edb=_0x35e71a?0x0:_0x3bf0d2['offset'];var _0x28ba85=_0x35e71a?_0x2cc251[_0x77f8('0x1f')]:_0x3bf0d2[_0x77f8('0x20')]+_0x3bf0d2[_0x77f8('0x1e')];var _0xa2e713;if(_0x28ba85>=_0x43749b){_0x28ba85=_0x43749b;_0xa2e713=0xc8;}else{_0xa2e713=0xce;}_0xca2101['status'](_0xa2e713);return _0xca2101['set'](_0x77f8('0x21'),_0x887edb+'-'+_0x28ba85+'/'+_0x43749b)[_0x77f8('0x1c')](_0x2cc251);}return null;};}function patchUpdates(_0x29052d){return function(_0x5c1ed){try{jsonpatch[_0x77f8('0x22')](_0x5c1ed,_0x29052d,!![]);}catch(_0x5ddc01){return BPromise[_0x77f8('0x23')](_0x5ddc01);}return _0x5c1ed['save']();};}function saveUpdates(_0x569d79,_0x1e7316){return function(_0x15a326){if(_0x15a326){return _0x15a326[_0x77f8('0x24')](_0x569d79)[_0x77f8('0x25')](function(_0x342b45){return _0x342b45;});}return null;};}function removeEntity(_0x5834b1,_0x20151c){return function(_0x27cd53){if(_0x27cd53){return _0x27cd53['destroy']()['then'](function(){var _0x329dd3=_0x27cd53[_0x77f8('0x26')]({'plain':!![]});var _0x29a233=_0x77f8('0x27');return db[_0x77f8('0x28')][_0x77f8('0x29')]({'where':{'type':_0x29a233,'resourceId':_0x329dd3['id']}})[_0x77f8('0x25')](function(){return _0x27cd53;});})[_0x77f8('0x25')](function(){_0x5834b1[_0x77f8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12aef4,_0x233c0f){return function(_0x2ebc3a){if(!_0x2ebc3a){_0x12aef4['sendStatus'](0x194);}return _0x2ebc3a;};}function handleError(_0x9b2e7c,_0x380e69){_0x380e69=_0x380e69||0x1f4;return function(_0x48780e){logger[_0x77f8('0x2a')](_0x48780e['stack']);if(_0x48780e[_0x77f8('0x2b')]){delete _0x48780e[_0x77f8('0x2b')];}_0x9b2e7c[_0x77f8('0x1a')](_0x380e69)[_0x77f8('0x2c')](_0x48780e);};}exports[_0x77f8('0x2d')]=function(_0x3339d3,_0x552f04){var _0x6d9e17={},_0x136507={},_0x2f2c3d={'count':0x0,'rows':[]};var _0x25254e=_[_0x77f8('0x2e')](db[_0x77f8('0x2f')][_0x77f8('0x30')],function(_0x1f1772){return{'name':_0x1f1772['fieldName'],'type':_0x1f1772[_0x77f8('0x31')][_0x77f8('0x32')]};});_0x136507[_0x77f8('0x33')]=_[_0x77f8('0x2e')](_0x25254e,_0x77f8('0x2b'));_0x136507[_0x77f8('0x34')]=_['keys'](_0x3339d3[_0x77f8('0x34')]);_0x136507[_0x77f8('0x35')]=_[_0x77f8('0x36')](_0x136507['model'],_0x136507[_0x77f8('0x34')]);_0x6d9e17[_0x77f8('0x37')]=_[_0x77f8('0x36')](_0x136507[_0x77f8('0x33')],qs[_0x77f8('0x38')](_0x3339d3[_0x77f8('0x34')]['fields']));_0x6d9e17[_0x77f8('0x37')]=_0x6d9e17[_0x77f8('0x37')]['length']?_0x6d9e17['attributes']:_0x136507['model'];if(!_0x3339d3['query'][_0x77f8('0x39')]('nolimit')){_0x6d9e17[_0x77f8('0x1e')]=qs[_0x77f8('0x1e')](_0x3339d3[_0x77f8('0x34')][_0x77f8('0x1e')]);_0x6d9e17[_0x77f8('0x20')]=qs[_0x77f8('0x20')](_0x3339d3[_0x77f8('0x34')][_0x77f8('0x20')]);}_0x6d9e17[_0x77f8('0x3a')]=qs[_0x77f8('0x3b')](_0x3339d3[_0x77f8('0x34')][_0x77f8('0x3b')]);_0x6d9e17[_0x77f8('0x3c')]=qs[_0x77f8('0x35')](_[_0x77f8('0x3d')](_0x3339d3[_0x77f8('0x34')],_0x136507[_0x77f8('0x35')]),_0x25254e);if(_0x3339d3[_0x77f8('0x34')][_0x77f8('0x3e')]){_0x6d9e17[_0x77f8('0x3c')]=_[_0x77f8('0x3f')](_0x6d9e17['where'],{'$or':_[_0x77f8('0x2e')](_0x25254e,function(_0x3b4a6c){if(_0x3b4a6c[_0x77f8('0x31')]!=='VIRTUAL'){var _0x311418={};_0x311418[_0x3b4a6c[_0x77f8('0x2b')]]={'$like':'%'+_0x3339d3['query'][_0x77f8('0x3e')]+'%'};return _0x311418;}})});}_0x6d9e17=_['merge']({},_0x6d9e17,_0x3339d3[_0x77f8('0x40')]);var _0x28e133={'where':_0x6d9e17[_0x77f8('0x3c')]};return db['Sound'][_0x77f8('0x1f')](_0x28e133)[_0x77f8('0x25')](function(_0x52e500){_0x2f2c3d[_0x77f8('0x1f')]=_0x52e500;if(_0x3339d3[_0x77f8('0x34')][_0x77f8('0x41')]){_0x6d9e17[_0x77f8('0x42')]=[{'all':!![]}];}return db[_0x77f8('0x2f')][_0x77f8('0x43')](_0x6d9e17);})[_0x77f8('0x25')](function(_0x4137c9){_0x2f2c3d['rows']=_0x4137c9;return _0x2f2c3d;})[_0x77f8('0x25')](respondWithFilteredResult(_0x552f04,_0x6d9e17))[_0x77f8('0x44')](handleError(_0x552f04,null));};exports[_0x77f8('0x45')]=function(_0x192bfb,_0x4f6d7f){var _0x5551a4={'raw':!![],'where':{'id':_0x192bfb[_0x77f8('0x46')]['id']}},_0x41ed4e={};_0x41ed4e[_0x77f8('0x33')]=_['keys'](db[_0x77f8('0x2f')][_0x77f8('0x30')]);_0x41ed4e[_0x77f8('0x34')]=_[_0x77f8('0x47')](_0x192bfb['query']);_0x41ed4e[_0x77f8('0x35')]=_[_0x77f8('0x36')](_0x41ed4e[_0x77f8('0x33')],_0x41ed4e[_0x77f8('0x34')]);_0x5551a4[_0x77f8('0x37')]=_[_0x77f8('0x36')](_0x41ed4e[_0x77f8('0x33')],qs['fields'](_0x192bfb['query'][_0x77f8('0x38')]));_0x5551a4[_0x77f8('0x37')]=_0x5551a4[_0x77f8('0x37')]['length']?_0x5551a4[_0x77f8('0x37')]:_0x41ed4e[_0x77f8('0x33')];if(_0x192bfb[_0x77f8('0x34')][_0x77f8('0x41')]){_0x5551a4[_0x77f8('0x42')]=[{'all':!![]}];}_0x5551a4=_[_0x77f8('0x3f')]({},_0x5551a4,_0x192bfb[_0x77f8('0x40')]);return db[_0x77f8('0x2f')]['find'](_0x5551a4)[_0x77f8('0x25')](handleEntityNotFound(_0x4f6d7f,null))[_0x77f8('0x25')](respondWithResult(_0x4f6d7f,null))[_0x77f8('0x44')](handleError(_0x4f6d7f,null));};exports['download']=function(_0x6ff7ca,_0x2e078a,_0x4a2151){return db[_0x77f8('0x2f')][_0x77f8('0x48')]({'where':{'id':_0x6ff7ca[_0x77f8('0x46')]['id']},'attributes':[_0x77f8('0x2b'),_0x77f8('0x49'),_0x77f8('0x4a')],'raw':!![]})['then'](handleEntityNotFound(_0x2e078a,null))[_0x77f8('0x25')](function(_0x38004d){if(_0x38004d){if(!fs[_0x77f8('0x4b')](path[_0x77f8('0x4c')](config[_0x77f8('0x4d')],_0x77f8('0x4e'),_0x38004d[_0x77f8('0x49')]+'.'+_0x38004d['converted_format']))){throw new db['Sequelize']['ValidationError'](_0x77f8('0x4f'));}return _0x2e078a[_0x77f8('0x50')](path[_0x77f8('0x4c')](config[_0x77f8('0x4d')],_0x77f8('0x4e'),util[_0x77f8('0x51')]('%s.%s',_0x38004d[_0x77f8('0x49')],_0x38004d['converted_format'])),util[_0x77f8('0x51')](_0x77f8('0x52'),_0x38004d[_0x77f8('0x2b')],_0x38004d[_0x77f8('0x4a')]));}return null;})[_0x77f8('0x44')](handleError(_0x2e078a,null));};exports['create']=function(_0x3e7539,_0x1a516a,_0x64e777){var _0x2d3c3f={'name':path[_0x77f8('0x53')](_0x3e7539['file'][_0x77f8('0x54')],path['extname'](_0x3e7539[_0x77f8('0x55')]['originalname'])),'save_name':path[_0x77f8('0x53')](_0x3e7539[_0x77f8('0x55')][_0x77f8('0x56')],path[_0x77f8('0x57')](_0x3e7539[_0x77f8('0x55')][_0x77f8('0x56')])),'original_format':path[_0x77f8('0x57')](_0x3e7539[_0x77f8('0x55')][_0x77f8('0x54')])[_0x77f8('0x58')](0x1),'converted_format':_0x77f8('0x59')};var _0x45ac8e=path[_0x77f8('0x4c')](config[_0x77f8('0x4d')],_0x77f8('0x5a'),_0x3e7539[_0x77f8('0x55')][_0x77f8('0x56')]);var _0x12e924=path[_0x77f8('0x4c')](config[_0x77f8('0x4d')],_0x77f8('0x4e'),util[_0x77f8('0x51')]('%s.%s',path[_0x77f8('0x53')](_0x3e7539[_0x77f8('0x55')]['filename'],path['extname'](_0x3e7539[_0x77f8('0x55')]['filename'])),_0x2d3c3f[_0x77f8('0x4a')]));logger[_0x77f8('0x5b')](_0x77f8('0x5c'),_0x45ac8e);logger[_0x77f8('0x5b')](_0x77f8('0x5d'),_0x12e924);try{fs[_0x77f8('0x5e')](_0x45ac8e,parseInt(_0x77f8('0x5f'),0x8));var _0x3268f7=sox[_0x77f8('0x60')](_0x45ac8e,_0x12e924,{'sampleRate':0x1f40,'format':_0x77f8('0x59'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3268f7['on'](_0x77f8('0x2a'),function(_0x26f94a){fs[_0x77f8('0x61')](_0x45ac8e);_0x1a516a[_0x77f8('0x1a')](0x1f4)[_0x77f8('0x2c')](_0x26f94a);});_0x3268f7['on']('src',function(_0x1dc67c){_0x2d3c3f['original_duration']=isNaN(_0x1dc67c[_0x77f8('0x62')])?null:_0x1dc67c[_0x77f8('0x62')]*0x3e8;_0x2d3c3f['original_sampleCount']=isNaN(_0x1dc67c[_0x77f8('0x63')])?null:_0x1dc67c[_0x77f8('0x63')];_0x2d3c3f[_0x77f8('0x64')]=isNaN(_0x1dc67c[_0x77f8('0x65')])?null:_0x1dc67c[_0x77f8('0x65')];_0x2d3c3f[_0x77f8('0x66')]=isNaN(_0x1dc67c['bitRate'])?null:_0x1dc67c[_0x77f8('0x67')];_0x2d3c3f[_0x77f8('0x68')]=isNaN(_0x1dc67c['sampleRate'])?null:_0x1dc67c['sampleRate'];});_0x3268f7['on'](_0x77f8('0x69'),function(_0x3e6045){_0x2d3c3f['converted_duration']=isNaN(_0x3e6045['duration'])?null:_0x3e6045[_0x77f8('0x62')]*0x3e8;_0x2d3c3f['converted_sampleCount']=isNaN(_0x3e6045[_0x77f8('0x63')])?null:_0x3e6045[_0x77f8('0x63')];_0x2d3c3f[_0x77f8('0x6a')]=isNaN(_0x3e6045[_0x77f8('0x65')])?null:_0x3e6045[_0x77f8('0x65')];_0x2d3c3f['converted_bitRate']=isNaN(_0x3e6045[_0x77f8('0x67')])?null:_0x3e6045['bitRate'];_0x2d3c3f[_0x77f8('0x6b')]=isNaN(_0x3e6045[_0x77f8('0x6c')])?null:_0x3e6045[_0x77f8('0x6c')];});_0x3268f7['on'](_0x77f8('0x1b'),function(){fs[_0x77f8('0x5e')](_0x12e924,parseInt(_0x77f8('0x5f'),0x8));return db['Sound'][_0x77f8('0x6d')](_0x2d3c3f)['then'](function(_0x1db9a6){var _0x480b8c={'role':_0x3e7539[_0x77f8('0x6e')]['role'],'userProfileId':_0x3e7539[_0x77f8('0x6e')][_0x77f8('0x6f')]};if(!_0x480b8c)throw new Error(_0x77f8('0x70'));if(_0x480b8c[_0x77f8('0x71')]===_0x77f8('0x72')){var _0x2964df=_0x1db9a6[_0x77f8('0x26')]({'plain':!![]});return db['UserProfileSection'][_0x77f8('0x48')]({'where':{'name':'Sounds','userProfileId':_0x480b8c[_0x77f8('0x6f')]},'raw':!![]})[_0x77f8('0x25')](function(_0xa63ad8){if(_0xa63ad8&&_0xa63ad8['autoAssociation']===0x0){return db[_0x77f8('0x28')]['create']({'name':_0x2964df[_0x77f8('0x2b')],'resourceId':_0x2964df['id'],'type':_0xa63ad8['name'],'sectionId':_0xa63ad8['id']},{})[_0x77f8('0x25')](function(){return _0x1db9a6;});}else{return _0x1db9a6;}})['catch'](function(_0x55fcc6){logger['error'](_0x77f8('0x73'),_0x55fcc6);throw _0x55fcc6;});}return _0x1db9a6;})['then'](respondWithResult(_0x1a516a,null))[_0x77f8('0x44')](handleError(_0x1a516a,null));});_0x3268f7['start']();}catch(_0x31a241){_0x1a516a[_0x77f8('0x1a')](0x1f4)['send'](_0x31a241);}};exports[_0x77f8('0x24')]=function(_0x2417d3,_0x59c656,_0x38c112){return db[_0x77f8('0x2f')]['find']({'where':{'id':_0x2417d3['params']['id']}})[_0x77f8('0x25')](handleEntityNotFound(_0x59c656,null))[_0x77f8('0x25')](saveUpdates(_[_0x77f8('0x3d')](_0x2417d3[_0x77f8('0x6e')],['name',_0x77f8('0x74')]),null))[_0x77f8('0x25')](respondWithResult(_0x59c656,null))[_0x77f8('0x44')](handleError(_0x59c656,null));};exports[_0x77f8('0x75')]=function(_0x516158,_0x431002,_0x36ecfc){return db[_0x77f8('0x2f')]['find']({'where':{'id':_0x516158[_0x77f8('0x46')]['id']}})[_0x77f8('0x25')](function(_0xf3235d){if(_0xf3235d){return _0xf3235d['destroy']();}})[_0x77f8('0x25')](function(_0x4731f2){var _0x179966=path[_0x77f8('0x4c')](config[_0x77f8('0x4d')],'server/files/sounds/original',util[_0x77f8('0x51')]('%s.%s',_0x4731f2['save_name'],_0x4731f2[_0x77f8('0x76')]));var _0x230485=path[_0x77f8('0x4c')](config[_0x77f8('0x4d')],_0x77f8('0x4e'),util[_0x77f8('0x51')](_0x77f8('0x52'),_0x4731f2[_0x77f8('0x49')],_0x4731f2['converted_format']));fs['unlinkSync'](_0x179966);fs[_0x77f8('0x61')](_0x230485);return _0x4731f2;})[_0x77f8('0x25')](function(_0x46860b){if(_0x46860b){return _0x431002['status'](0xcc)[_0x77f8('0x1b')]();}})['then'](handleEntityNotFound(_0x431002,null))[_0x77f8('0x44')](handleError(_0x431002,null));}; \ No newline at end of file +var _0xaa25=['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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','error','stack','name','send','index','map','Sound','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','rows','catch','show','params','keys','length','includeAll','find','download','save_name','existsSync','join','root','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','basename','file','originalname','filename','extname','wav','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','0777','unlinkSync','src','duration','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','userProfileId','user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','original_format','eml-format','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x5d6224,_0x19b5ea){var _0x256667=function(_0x2d813e){while(--_0x2d813e){_0x5d6224['push'](_0x5d6224['shift']());}};_0x256667(++_0x19b5ea);}(_0xaa25,0x7a));var _0x5aa2=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xaa25[_0x11005e];return _0x29338f;};'use strict';var emlformat=require(_0x5aa2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5aa2('0x1'));var jsonpatch=require(_0x5aa2('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5aa2('0x3'));var Mustache=require(_0x5aa2('0x4'));var util=require(_0x5aa2('0x5'));var path=require(_0x5aa2('0x6'));var sox=require(_0x5aa2('0x7'));var csv=require(_0x5aa2('0x8'));var ejs=require(_0x5aa2('0x9'));var fs=require('fs');var fs_extra=require(_0x5aa2('0xa'));var _=require('lodash');var squel=require(_0x5aa2('0xb'));var crypto=require('crypto');var jsforce=require(_0x5aa2('0xc'));var deskjs=require(_0x5aa2('0xd'));var toCsv=require(_0x5aa2('0x8'));var querystring=require(_0x5aa2('0xe'));var Papa=require(_0x5aa2('0xf'));var Redis=require(_0x5aa2('0x10'));var authService=require(_0x5aa2('0x11'));var qs=require(_0x5aa2('0x12'));var as=require(_0x5aa2('0x13'));var hardwareService=require(_0x5aa2('0x14'));var logger=require(_0x5aa2('0x15'))(_0x5aa2('0x16'));var utils=require(_0x5aa2('0x17'));var config=require(_0x5aa2('0x18'));var licenseUtil=require(_0x5aa2('0x19'));var db=require(_0x5aa2('0x1a'))['db'];function respondWithStatusCode(_0x3f6819,_0x568fff){_0x568fff=_0x568fff||0xcc;return function(_0x2504d4){if(_0x2504d4){return _0x3f6819[_0x5aa2('0x1b')](_0x568fff);}return _0x3f6819[_0x5aa2('0x1c')](_0x568fff)[_0x5aa2('0x1d')]();};}function respondWithResult(_0x111f7a,_0x47ca93){_0x47ca93=_0x47ca93||0xc8;return function(_0x45d446){if(_0x45d446){return _0x111f7a[_0x5aa2('0x1c')](_0x47ca93)[_0x5aa2('0x1e')](_0x45d446);}};}function respondWithFilteredResult(_0x15957,_0x5314b6){return function(_0xde08cb){if(_0xde08cb){var _0x2d344f=typeof _0x5314b6[_0x5aa2('0x1f')]===_0x5aa2('0x20')&&typeof _0x5314b6[_0x5aa2('0x21')]==='undefined';var _0x25d7d8=_0xde08cb['count'];var _0x2d228a=_0x2d344f?0x0:_0x5314b6[_0x5aa2('0x1f')];var _0x4e3d74=_0x2d344f?_0xde08cb['count']:_0x5314b6['offset']+_0x5314b6['limit'];var _0x2daa10;if(_0x4e3d74>=_0x25d7d8){_0x4e3d74=_0x25d7d8;_0x2daa10=0xc8;}else{_0x2daa10=0xce;}_0x15957[_0x5aa2('0x1c')](_0x2daa10);return _0x15957[_0x5aa2('0x22')](_0x5aa2('0x23'),_0x2d228a+'-'+_0x4e3d74+'/'+_0x25d7d8)[_0x5aa2('0x1e')](_0xde08cb);}return null;};}function patchUpdates(_0x516b26){return function(_0x3ab7c7){try{jsonpatch[_0x5aa2('0x24')](_0x3ab7c7,_0x516b26,!![]);}catch(_0x1fc998){return BPromise[_0x5aa2('0x25')](_0x1fc998);}return _0x3ab7c7[_0x5aa2('0x26')]();};}function saveUpdates(_0x443f14,_0x1b6077){return function(_0x5245cb){if(_0x5245cb){return _0x5245cb[_0x5aa2('0x27')](_0x443f14)[_0x5aa2('0x28')](function(_0x473c5c){return _0x473c5c;});}return null;};}function removeEntity(_0x4da59b,_0x2c44fc){return function(_0x21e8e5){if(_0x21e8e5){return _0x21e8e5[_0x5aa2('0x29')]()['then'](function(){var _0x3c3b72=_0x21e8e5[_0x5aa2('0x2a')]({'plain':!![]});var _0x4bdf63='Sounds';return db['UserProfileResource'][_0x5aa2('0x29')]({'where':{'type':_0x4bdf63,'resourceId':_0x3c3b72['id']}})[_0x5aa2('0x28')](function(){return _0x21e8e5;});})[_0x5aa2('0x28')](function(){_0x4da59b[_0x5aa2('0x1c')](0xcc)[_0x5aa2('0x1d')]();});}};}function handleEntityNotFound(_0x2227d7,_0x4e958a){return function(_0x439975){if(!_0x439975){_0x2227d7[_0x5aa2('0x1b')](0x194);}return _0x439975;};}function handleError(_0x1eb3fa,_0x34205e){_0x34205e=_0x34205e||0x1f4;return function(_0x26da04){logger[_0x5aa2('0x2b')](_0x26da04[_0x5aa2('0x2c')]);if(_0x26da04[_0x5aa2('0x2d')]){delete _0x26da04[_0x5aa2('0x2d')];}_0x1eb3fa[_0x5aa2('0x1c')](_0x34205e)[_0x5aa2('0x2e')](_0x26da04);};}exports[_0x5aa2('0x2f')]=function(_0x3f27d8,_0x2b0d2c){var _0x5a34c3={},_0x5eda9c={},_0xd996f3={'count':0x0,'rows':[]};var _0x2cefbc=_[_0x5aa2('0x30')](db[_0x5aa2('0x31')][_0x5aa2('0x32')],function(_0x5560a9){return{'name':_0x5560a9['fieldName'],'type':_0x5560a9[_0x5aa2('0x33')][_0x5aa2('0x34')]};});_0x5eda9c['model']=_['map'](_0x2cefbc,_0x5aa2('0x2d'));_0x5eda9c[_0x5aa2('0x35')]=_['keys'](_0x3f27d8[_0x5aa2('0x35')]);_0x5eda9c[_0x5aa2('0x36')]=_[_0x5aa2('0x37')](_0x5eda9c[_0x5aa2('0x38')],_0x5eda9c[_0x5aa2('0x35')]);_0x5a34c3['attributes']=_[_0x5aa2('0x37')](_0x5eda9c[_0x5aa2('0x38')],qs['fields'](_0x3f27d8[_0x5aa2('0x35')][_0x5aa2('0x39')]));_0x5a34c3[_0x5aa2('0x3a')]=_0x5a34c3[_0x5aa2('0x3a')]['length']?_0x5a34c3['attributes']:_0x5eda9c[_0x5aa2('0x38')];if(!_0x3f27d8[_0x5aa2('0x35')][_0x5aa2('0x3b')](_0x5aa2('0x3c'))){_0x5a34c3[_0x5aa2('0x21')]=qs[_0x5aa2('0x21')](_0x3f27d8[_0x5aa2('0x35')][_0x5aa2('0x21')]);_0x5a34c3[_0x5aa2('0x1f')]=qs[_0x5aa2('0x1f')](_0x3f27d8[_0x5aa2('0x35')][_0x5aa2('0x1f')]);}_0x5a34c3[_0x5aa2('0x3d')]=qs[_0x5aa2('0x3e')](_0x3f27d8[_0x5aa2('0x35')][_0x5aa2('0x3e')]);_0x5a34c3[_0x5aa2('0x3f')]=qs[_0x5aa2('0x36')](_[_0x5aa2('0x40')](_0x3f27d8['query'],_0x5eda9c[_0x5aa2('0x36')]),_0x2cefbc);if(_0x3f27d8[_0x5aa2('0x35')][_0x5aa2('0x41')]){_0x5a34c3[_0x5aa2('0x3f')]=_[_0x5aa2('0x42')](_0x5a34c3['where'],{'$or':_[_0x5aa2('0x30')](_0x2cefbc,function(_0x404d70){if(_0x404d70[_0x5aa2('0x33')]!==_0x5aa2('0x43')){var _0x55687e={};_0x55687e[_0x404d70[_0x5aa2('0x2d')]]={'$like':'%'+_0x3f27d8[_0x5aa2('0x35')][_0x5aa2('0x41')]+'%'};return _0x55687e;}})});}_0x5a34c3=_[_0x5aa2('0x42')]({},_0x5a34c3,_0x3f27d8[_0x5aa2('0x44')]);var _0xc3b870={'where':_0x5a34c3[_0x5aa2('0x3f')]};return db[_0x5aa2('0x31')][_0x5aa2('0x45')](_0xc3b870)[_0x5aa2('0x28')](function(_0x1e9b1e){_0xd996f3[_0x5aa2('0x45')]=_0x1e9b1e;if(_0x3f27d8[_0x5aa2('0x35')]['includeAll']){_0x5a34c3[_0x5aa2('0x46')]=[{'all':!![]}];}return db[_0x5aa2('0x31')]['findAll'](_0x5a34c3);})[_0x5aa2('0x28')](function(_0x582a9a){_0xd996f3[_0x5aa2('0x47')]=_0x582a9a;return _0xd996f3;})['then'](respondWithFilteredResult(_0x2b0d2c,_0x5a34c3))[_0x5aa2('0x48')](handleError(_0x2b0d2c,null));};exports[_0x5aa2('0x49')]=function(_0x30ff57,_0x51d85e){var _0x3faedb={'raw':!![],'where':{'id':_0x30ff57[_0x5aa2('0x4a')]['id']}},_0x2886f4={};_0x2886f4[_0x5aa2('0x38')]=_[_0x5aa2('0x4b')](db['Sound'][_0x5aa2('0x32')]);_0x2886f4['query']=_[_0x5aa2('0x4b')](_0x30ff57[_0x5aa2('0x35')]);_0x2886f4[_0x5aa2('0x36')]=_['intersection'](_0x2886f4[_0x5aa2('0x38')],_0x2886f4['query']);_0x3faedb[_0x5aa2('0x3a')]=_['intersection'](_0x2886f4[_0x5aa2('0x38')],qs[_0x5aa2('0x39')](_0x30ff57[_0x5aa2('0x35')][_0x5aa2('0x39')]));_0x3faedb[_0x5aa2('0x3a')]=_0x3faedb['attributes'][_0x5aa2('0x4c')]?_0x3faedb[_0x5aa2('0x3a')]:_0x2886f4[_0x5aa2('0x38')];if(_0x30ff57[_0x5aa2('0x35')][_0x5aa2('0x4d')]){_0x3faedb[_0x5aa2('0x46')]=[{'all':!![]}];}_0x3faedb=_[_0x5aa2('0x42')]({},_0x3faedb,_0x30ff57[_0x5aa2('0x44')]);return db[_0x5aa2('0x31')][_0x5aa2('0x4e')](_0x3faedb)[_0x5aa2('0x28')](handleEntityNotFound(_0x51d85e,null))[_0x5aa2('0x28')](respondWithResult(_0x51d85e,null))[_0x5aa2('0x48')](handleError(_0x51d85e,null));};exports[_0x5aa2('0x4f')]=function(_0x3440cf,_0x8e4889,_0x247bd1){return db[_0x5aa2('0x31')][_0x5aa2('0x4e')]({'where':{'id':_0x3440cf[_0x5aa2('0x4a')]['id']},'attributes':['name',_0x5aa2('0x50'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x8e4889,null))[_0x5aa2('0x28')](function(_0x35340a){if(_0x35340a){if(!fs[_0x5aa2('0x51')](path[_0x5aa2('0x52')](config[_0x5aa2('0x53')],'server/files/sounds/converted',_0x35340a[_0x5aa2('0x50')]+'.'+_0x35340a[_0x5aa2('0x54')]))){throw new db[(_0x5aa2('0x55'))][(_0x5aa2('0x56'))](_0x5aa2('0x57'));}return _0x8e4889[_0x5aa2('0x4f')](path[_0x5aa2('0x52')](config['root'],_0x5aa2('0x58'),util[_0x5aa2('0x59')](_0x5aa2('0x5a'),_0x35340a[_0x5aa2('0x50')],_0x35340a[_0x5aa2('0x54')])),util[_0x5aa2('0x59')](_0x5aa2('0x5a'),_0x35340a['name'],_0x35340a[_0x5aa2('0x54')]));}return null;})[_0x5aa2('0x48')](handleError(_0x8e4889,null));};exports['create']=function(_0x3c16c0,_0x2c7adc,_0x5ee75f){var _0x10e63d={'name':path[_0x5aa2('0x5b')](_0x3c16c0[_0x5aa2('0x5c')][_0x5aa2('0x5d')],path['extname'](_0x3c16c0[_0x5aa2('0x5c')]['originalname'])),'save_name':path['basename'](_0x3c16c0[_0x5aa2('0x5c')][_0x5aa2('0x5e')],path[_0x5aa2('0x5f')](_0x3c16c0['file'][_0x5aa2('0x5e')])),'original_format':path[_0x5aa2('0x5f')](_0x3c16c0[_0x5aa2('0x5c')][_0x5aa2('0x5d')])['substring'](0x1),'converted_format':_0x5aa2('0x60')};var _0x59cc95=path[_0x5aa2('0x52')](config['root'],_0x5aa2('0x61'),_0x3c16c0[_0x5aa2('0x5c')]['filename']);var _0x2147f6=path[_0x5aa2('0x52')](config['root'],_0x5aa2('0x58'),util[_0x5aa2('0x59')](_0x5aa2('0x5a'),path[_0x5aa2('0x5b')](_0x3c16c0['file']['filename'],path['extname'](_0x3c16c0[_0x5aa2('0x5c')][_0x5aa2('0x5e')])),_0x10e63d[_0x5aa2('0x54')]));logger['info'](_0x5aa2('0x62'),_0x59cc95);logger[_0x5aa2('0x63')](_0x5aa2('0x64'),_0x2147f6);try{fs['chmodSync'](_0x59cc95,parseInt(_0x5aa2('0x65'),0x8));var _0xbe353c=sox['transcode'](_0x59cc95,_0x2147f6,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xbe353c['on'](_0x5aa2('0x2b'),function(_0x4692d7){fs[_0x5aa2('0x66')](_0x59cc95);_0x2c7adc[_0x5aa2('0x1c')](0x1f4)['send'](_0x4692d7);});_0xbe353c['on'](_0x5aa2('0x67'),function(_0x566b69){_0x10e63d['original_duration']=isNaN(_0x566b69['duration'])?null:_0x566b69[_0x5aa2('0x68')]*0x3e8;_0x10e63d['original_sampleCount']=isNaN(_0x566b69['sampleCount'])?null:_0x566b69[_0x5aa2('0x69')];_0x10e63d['original_channelCount']=isNaN(_0x566b69[_0x5aa2('0x6a')])?null:_0x566b69[_0x5aa2('0x6a')];_0x10e63d[_0x5aa2('0x6b')]=isNaN(_0x566b69[_0x5aa2('0x6c')])?null:_0x566b69[_0x5aa2('0x6c')];_0x10e63d[_0x5aa2('0x6d')]=isNaN(_0x566b69[_0x5aa2('0x6e')])?null:_0x566b69[_0x5aa2('0x6e')];});_0xbe353c['on'](_0x5aa2('0x6f'),function(_0x1787f1){_0x10e63d[_0x5aa2('0x70')]=isNaN(_0x1787f1['duration'])?null:_0x1787f1[_0x5aa2('0x68')]*0x3e8;_0x10e63d[_0x5aa2('0x71')]=isNaN(_0x1787f1[_0x5aa2('0x69')])?null:_0x1787f1['sampleCount'];_0x10e63d[_0x5aa2('0x72')]=isNaN(_0x1787f1[_0x5aa2('0x6a')])?null:_0x1787f1[_0x5aa2('0x6a')];_0x10e63d[_0x5aa2('0x73')]=isNaN(_0x1787f1[_0x5aa2('0x6c')])?null:_0x1787f1[_0x5aa2('0x6c')];_0x10e63d[_0x5aa2('0x74')]=isNaN(_0x1787f1[_0x5aa2('0x6e')])?null:_0x1787f1[_0x5aa2('0x6e')];});_0xbe353c['on'](_0x5aa2('0x1d'),function(){fs['chmodSync'](_0x2147f6,parseInt(_0x5aa2('0x65'),0x8));return db['Sound'][_0x5aa2('0x75')](_0x10e63d)[_0x5aa2('0x28')](function(_0x3ac33a){var _0x13d582={'role':_0x3c16c0[_0x5aa2('0x76')]['role'],'userProfileId':_0x3c16c0[_0x5aa2('0x76')][_0x5aa2('0x77')]};if(!_0x13d582)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13d582['role']===_0x5aa2('0x78')){var _0x3543f0=_0x3ac33a[_0x5aa2('0x2a')]({'plain':!![]});return db[_0x5aa2('0x79')][_0x5aa2('0x4e')]({'where':{'name':'Sounds','userProfileId':_0x13d582[_0x5aa2('0x77')]},'raw':!![]})[_0x5aa2('0x28')](function(_0xab6766){if(_0xab6766&&_0xab6766['autoAssociation']===0x0){return db[_0x5aa2('0x7a')][_0x5aa2('0x75')]({'name':_0x3543f0[_0x5aa2('0x2d')],'resourceId':_0x3543f0['id'],'type':_0xab6766[_0x5aa2('0x2d')],'sectionId':_0xab6766['id']},{})['then'](function(){return _0x3ac33a;});}else{return _0x3ac33a;}})['catch'](function(_0x145157){logger[_0x5aa2('0x2b')](_0x5aa2('0x7b'),_0x145157);throw _0x145157;});}return _0x3ac33a;})['then'](respondWithResult(_0x2c7adc,null))[_0x5aa2('0x48')](handleError(_0x2c7adc,null));});_0xbe353c['start']();}catch(_0x4e3368){_0x2c7adc['status'](0x1f4)[_0x5aa2('0x2e')](_0x4e3368);}};exports[_0x5aa2('0x27')]=function(_0x5d6006,_0x23025a,_0x3057e3){return db[_0x5aa2('0x31')][_0x5aa2('0x4e')]({'where':{'id':_0x5d6006['params']['id']}})[_0x5aa2('0x28')](handleEntityNotFound(_0x23025a,null))[_0x5aa2('0x28')](saveUpdates(_[_0x5aa2('0x40')](_0x5d6006[_0x5aa2('0x76')],['name',_0x5aa2('0x7c')]),null))[_0x5aa2('0x28')](respondWithResult(_0x23025a,null))[_0x5aa2('0x48')](handleError(_0x23025a,null));};exports[_0x5aa2('0x7d')]=function(_0x3d201d,_0xf68432,_0x851332){return db['Sound'][_0x5aa2('0x4e')]({'where':{'id':_0x3d201d[_0x5aa2('0x4a')]['id']}})[_0x5aa2('0x28')](function(_0x3823d6){if(_0x3823d6){return _0x3823d6[_0x5aa2('0x29')]();}})[_0x5aa2('0x28')](function(_0x3d0c34){var _0x1b8123=path['join'](config[_0x5aa2('0x53')],_0x5aa2('0x61'),util['format'](_0x5aa2('0x5a'),_0x3d0c34[_0x5aa2('0x50')],_0x3d0c34[_0x5aa2('0x7e')]));var _0x224843=path[_0x5aa2('0x52')](config[_0x5aa2('0x53')],_0x5aa2('0x58'),util[_0x5aa2('0x59')](_0x5aa2('0x5a'),_0x3d0c34[_0x5aa2('0x50')],_0x3d0c34[_0x5aa2('0x54')]));fs[_0x5aa2('0x66')](_0x1b8123);fs[_0x5aa2('0x66')](_0x224843);return _0x3d0c34;})[_0x5aa2('0x28')](function(_0x5971d2){if(_0x5971d2){return _0xf68432[_0x5aa2('0x1c')](0xcc)[_0x5aa2('0x1d')]();}})[_0x5aa2('0x28')](handleEntityNotFound(_0xf68432,null))[_0x5aa2('0x48')](handleError(_0xf68432,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 4f6daca..6131a22 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 _0x9cbb=['tools_sounds','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound'];(function(_0x31628d,_0x51ce15){var _0x2c8928=function(_0xb0cef7){while(--_0xb0cef7){_0x31628d['push'](_0x31628d['shift']());}};_0x2c8928(++_0x51ce15);}(_0x9cbb,0xf8));var _0xb9cb=function(_0x4d5a63,_0x2c5231){_0x4d5a63=_0x4d5a63-0x0;var _0x5969d7=_0x9cbb[_0x4d5a63];return _0x5969d7;};'use strict';var _=require('lodash');var util=require(_0xb9cb('0x0'));var logger=require(_0xb9cb('0x1'))(_0xb9cb('0x2'));var moment=require(_0xb9cb('0x3'));var BPromise=require(_0xb9cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9cb('0x5'));var rimraf=require(_0xb9cb('0x6'));var config=require(_0xb9cb('0x7'));var attributes=require(_0xb9cb('0x8'));module[_0xb9cb('0x9')]=function(_0x5e30fe,_0x4c64e8){return _0x5e30fe[_0xb9cb('0xa')](_0xb9cb('0xb'),attributes,{'tableName':_0xb9cb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ae9=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','Sound','tools_sounds','lodash','../../config/logger','api'];(function(_0x1a4801,_0x55f4fd){var _0x5654f6=function(_0x3e0a26){while(--_0x3e0a26){_0x1a4801['push'](_0x1a4801['shift']());}};_0x5654f6(++_0x55f4fd);}(_0x1ae9,0x105));var _0x91ae=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x1ae9[_0x4e1d03];return _0x362d4b;};'use strict';var _=require(_0x91ae('0x0'));var util=require('util');var logger=require(_0x91ae('0x1'))(_0x91ae('0x2'));var moment=require(_0x91ae('0x3'));var BPromise=require(_0x91ae('0x4'));var rp=require(_0x91ae('0x5'));var fs=require('fs');var path=require(_0x91ae('0x6'));var rimraf=require(_0x91ae('0x7'));var config=require(_0x91ae('0x8'));var attributes=require('./sound.attributes');module['exports']=function(_0x475420,_0x4d82fc){return _0x475420[_0x91ae('0x9')](_0x91ae('0xa'),attributes,{'tableName':_0x91ae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index c4d4307..799a9f6 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 _0xd20d=['rpc','client','request','request\x20sent','debug','error','message','Sound,\x20%s,\x20%s','info','result','catch','ShowSound','find','options','where','attributes','map','include','model','then','stringify','lodash','moment','../../config/utils','../../config/logger'];(function(_0x30f87a,_0x2cce5a){var _0x3a8efc=function(_0x225d6b){while(--_0x225d6b){_0x30f87a['push'](_0x30f87a['shift']());}};_0x3a8efc(++_0x2cce5a);}(_0xd20d,0x1f0));var _0xdd20=function(_0x133d2e,_0x125e8b){_0x133d2e=_0x133d2e-0x0;var _0x3a895e=_0xd20d[_0x133d2e];return _0x3a895e;};'use strict';var _=require(_0xdd20('0x0'));var util=require('util');var moment=require(_0xdd20('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdd20('0x2'));var logger=require(_0xdd20('0x3'))(_0xdd20('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdd20('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1040db,_0x1780ab,_0xfa6ae2){return new BPromise(function(_0x36875e,_0xbd71e9){return client[_0xdd20('0x6')](_0x1040db,_0xfa6ae2)['then'](function(_0x361a4b){logger['info']('Sound,\x20%s,\x20%s',_0x1780ab,_0xdd20('0x7'));logger[_0xdd20('0x8')]('Sound,\x20%s,\x20%s,\x20%s',_0x1780ab,_0xdd20('0x7'),JSON['stringify'](_0x361a4b));if(_0x361a4b[_0xdd20('0x9')]){if(_0x361a4b[_0xdd20('0x9')]['code']===0x1f4){logger[_0xdd20('0x9')]('Sound,\x20%s,\x20%s',_0x1780ab,_0x361a4b['error'][_0xdd20('0xa')]);return _0xbd71e9(_0x361a4b[_0xdd20('0x9')][_0xdd20('0xa')]);}logger[_0xdd20('0x9')](_0xdd20('0xb'),_0x1780ab,_0x361a4b[_0xdd20('0x9')][_0xdd20('0xa')]);return _0x36875e(_0x361a4b[_0xdd20('0x9')][_0xdd20('0xa')]);}else{logger[_0xdd20('0xc')](_0xdd20('0xb'),_0x1780ab,_0xdd20('0x7'));_0x36875e(_0x361a4b[_0xdd20('0xd')][_0xdd20('0xa')]);}})[_0xdd20('0xe')](function(_0x2b528f){logger[_0xdd20('0x9')](_0xdd20('0xb'),_0x1780ab,_0x2b528f);_0xbd71e9(_0x2b528f);});});}exports[_0xdd20('0xf')]=function(_0x4d6d6b){var _0x3be8cd=this;return new Promise(function(_0x45aeaf,_0x5c9d25){return db['Sound'][_0xdd20('0x10')]({'raw':_0x4d6d6b[_0xdd20('0x11')]?_0x4d6d6b[_0xdd20('0x11')]['raw']===undefined?!![]:![]:!![],'where':_0x4d6d6b['options']?_0x4d6d6b[_0xdd20('0x11')][_0xdd20('0x12')]||null:null,'attributes':_0x4d6d6b[_0xdd20('0x11')]?_0x4d6d6b['options'][_0xdd20('0x13')]||null:null,'include':_0x4d6d6b[_0xdd20('0x11')]?_0x4d6d6b[_0xdd20('0x11')]['include']?_[_0xdd20('0x14')](_0x4d6d6b['options'][_0xdd20('0x15')],function(_0x4b6d89){return{'model':db[_0x4b6d89['model']],'as':_0x4b6d89['as'],'attributes':_0x4b6d89[_0xdd20('0x13')],'include':_0x4b6d89[_0xdd20('0x15')]?_['map'](_0x4b6d89[_0xdd20('0x15')],function(_0x5271b5){return{'model':db[_0x5271b5[_0xdd20('0x16')]],'as':_0x5271b5['as'],'attributes':_0x5271b5['attributes'],'include':_0x5271b5[_0xdd20('0x15')]?_[_0xdd20('0x14')](_0x5271b5[_0xdd20('0x15')],function(_0x7d224e){return{'model':db[_0x7d224e[_0xdd20('0x16')]],'as':_0x7d224e['as'],'attributes':_0x7d224e['attributes']};}):[]};}):[]};}):[]:[]})[_0xdd20('0x17')](function(_0x3fa0e6){logger[_0xdd20('0xc')](_0xdd20('0xf'),_0x4d6d6b);logger['debug'](_0xdd20('0xf'),_0x4d6d6b,JSON[_0xdd20('0x18')](_0x3fa0e6));_0x45aeaf(_0x3fa0e6);})[_0xdd20('0xe')](function(_0x2d093b){logger[_0xdd20('0x9')](_0xdd20('0xf'),_0x2d093b[_0xdd20('0xa')],_0x4d6d6b);_0x5c9d25(_0x3be8cd[_0xdd20('0x9')](0x1f4,_0x2d093b[_0xdd20('0xa')]));});});}; \ No newline at end of file +var _0x90d1=['client','http','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSound','find','options','raw','where','attributes','include','map','model','info','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x90d1,0x17d));var _0x190d=function(_0x31db02,_0x330986){_0x31db02=_0x31db02-0x0;var _0x1b2e55=_0x90d1[_0x31db02];return _0x1b2e55;};'use strict';var _=require(_0x190d('0x0'));var util=require(_0x190d('0x1'));var moment=require(_0x190d('0x2'));var BPromise=require(_0x190d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x190d('0x4'));var db=require(_0x190d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x190d('0x6'))(_0x190d('0x7'));var config=require(_0x190d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x190d('0x9')][_0x190d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fddd7,_0x9b6dff,_0x597762){return new BPromise(function(_0x1f867c,_0xd20d17){return client['request'](_0x1fddd7,_0x597762)['then'](function(_0x4a78b4){logger['info'](_0x190d('0xb'),_0x9b6dff,_0x190d('0xc'));logger[_0x190d('0xd')](_0x190d('0xe'),_0x9b6dff,_0x190d('0xc'),JSON[_0x190d('0xf')](_0x4a78b4));if(_0x4a78b4[_0x190d('0x10')]){if(_0x4a78b4[_0x190d('0x10')]['code']===0x1f4){logger['error'](_0x190d('0xb'),_0x9b6dff,_0x4a78b4[_0x190d('0x10')]['message']);return _0xd20d17(_0x4a78b4[_0x190d('0x10')]['message']);}logger[_0x190d('0x10')](_0x190d('0xb'),_0x9b6dff,_0x4a78b4[_0x190d('0x10')][_0x190d('0x11')]);return _0x1f867c(_0x4a78b4[_0x190d('0x10')]['message']);}else{logger['info'](_0x190d('0xb'),_0x9b6dff,_0x190d('0xc'));_0x1f867c(_0x4a78b4[_0x190d('0x12')]['message']);}})[_0x190d('0x13')](function(_0x3c6480){logger['error']('Sound,\x20%s,\x20%s',_0x9b6dff,_0x3c6480);_0xd20d17(_0x3c6480);});});}exports[_0x190d('0x14')]=function(_0x45950e){var _0x741af8=this;return new Promise(function(_0x26e21e,_0x392ba4){return db['Sound'][_0x190d('0x15')]({'raw':_0x45950e[_0x190d('0x16')]?_0x45950e[_0x190d('0x16')][_0x190d('0x17')]===undefined?!![]:![]:!![],'where':_0x45950e[_0x190d('0x16')]?_0x45950e[_0x190d('0x16')][_0x190d('0x18')]||null:null,'attributes':_0x45950e['options']?_0x45950e[_0x190d('0x16')][_0x190d('0x19')]||null:null,'include':_0x45950e[_0x190d('0x16')]?_0x45950e[_0x190d('0x16')][_0x190d('0x1a')]?_[_0x190d('0x1b')](_0x45950e[_0x190d('0x16')][_0x190d('0x1a')],function(_0x14ff92){return{'model':db[_0x14ff92[_0x190d('0x1c')]],'as':_0x14ff92['as'],'attributes':_0x14ff92['attributes'],'include':_0x14ff92[_0x190d('0x1a')]?_[_0x190d('0x1b')](_0x14ff92[_0x190d('0x1a')],function(_0x2933f2){return{'model':db[_0x2933f2[_0x190d('0x1c')]],'as':_0x2933f2['as'],'attributes':_0x2933f2[_0x190d('0x19')],'include':_0x2933f2['include']?_[_0x190d('0x1b')](_0x2933f2[_0x190d('0x1a')],function(_0x682f5b){return{'model':db[_0x682f5b['model']],'as':_0x682f5b['as'],'attributes':_0x682f5b[_0x190d('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x116aa1){logger[_0x190d('0x1d')](_0x190d('0x14'),_0x45950e);logger[_0x190d('0xd')](_0x190d('0x14'),_0x45950e,JSON['stringify'](_0x116aa1));_0x26e21e(_0x116aa1);})['catch'](function(_0x43ff82){logger[_0x190d('0x10')](_0x190d('0x14'),_0x43ff82[_0x190d('0x11')],_0x45950e);_0x392ba4(_0x741af8[_0x190d('0x10')](0x1f4,_0x43ff82['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 15d307b..c6aa296 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 _0x757a=['destroy','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete'];(function(_0x3ca1ec,_0x2d9992){var _0xdc34a4=function(_0x57bcba){while(--_0x57bcba){_0x3ca1ec['push'](_0x3ca1ec['shift']());}};_0xdc34a4(++_0x2d9992);}(_0x757a,0xde));var _0xa757=function(_0xa38ad0,_0x363af4){_0xa38ad0=_0xa38ad0-0x0;var _0x110170=_0x757a[_0xa38ad0];return _0x110170;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0xb')]('/',auth[_0xa757('0x9')](),controller[_0xa757('0xc')]);router['put'](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);router[_0xa757('0xf')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0x10')]);module['exports']=router; \ No newline at end of file +var _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0x2b0690,_0x4f742f){var _0x82be1=function(_0x1e1084){while(--_0x1e1084){_0x2b0690['push'](_0x2b0690['shift']());}};_0x82be1(++_0x4f742f);}(_0xda2d,0x102));var _0xdda2=function(_0x55a12d,_0x258c0f){_0x55a12d=_0x55a12d-0x0;var _0x148fd1=_0xda2d[_0x55a12d];return _0x148fd1;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('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 d6f0c2c..2b18981 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 _0xb7ae=['sequelize','STRING','TEXT','medium','ENUM','out'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xb7ae,0xc0));var _0xeb7a=function(_0x4166d7,_0x53682f){_0x4166d7=_0x4166d7-0x0;var _0x37d115=_0xb7ae[_0x4166d7];return _0x37d115;};'use strict';var Sequelize=require(_0xeb7a('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xeb7a('0x1')]},'body':{'type':Sequelize[_0xeb7a('0x2')](_0xeb7a('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xeb7a('0x4')]('in',_0xeb7a('0x5')),'defaultValue':_0xeb7a('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xeb7a('0x1')]},'providerResponse':{'type':Sequelize[_0xeb7a('0x2')]}}; \ No newline at end of file +var _0xfb77=['medium','ENUM','out','sequelize','exports','STRING','TEXT'];(function(_0x4121f4,_0x17312d){var _0x2f369a=function(_0x5ce181){while(--_0x5ce181){_0x4121f4['push'](_0x4121f4['shift']());}};_0x2f369a(++_0x17312d);}(_0xfb77,0x106));var _0x7fb7=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xfb77[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x7fb7('0x0'));module[_0x7fb7('0x1')]={'uniqueid':{'type':Sequelize[_0x7fb7('0x2')]},'body':{'type':Sequelize[_0x7fb7('0x3')](_0x7fb7('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x7fb7('0x5')]('in','out'),'defaultValue':_0x7fb7('0x6'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 9141d09..cbfbea3 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 _0x8e4f=['where','pick','filter','merge','map','type','options','SquareMessage','includeAll','include','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort'];(function(_0x3f89b6,_0x27a093){var _0x3f7d7d=function(_0x4ea57f){while(--_0x4ea57f){_0x3f89b6['push'](_0x3f89b6['shift']());}};_0x3f7d7d(++_0x27a093);}(_0x8e4f,0xa9));var _0xf8e4=function(_0x2cfa03,_0x45b41b){_0x2cfa03=_0x2cfa03-0x0;var _0x291f8c=_0x8e4f[_0x2cfa03];return _0x291f8c;};'use strict';var emlformat=require(_0xf8e4('0x0'));var rimraf=require(_0xf8e4('0x1'));var zipdir=require(_0xf8e4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8e4('0x3'));var moment=require(_0xf8e4('0x4'));var BPromise=require(_0xf8e4('0x5'));var Mustache=require(_0xf8e4('0x6'));var util=require('util');var path=require(_0xf8e4('0x7'));var sox=require(_0xf8e4('0x8'));var csv=require(_0xf8e4('0x9'));var ejs=require(_0xf8e4('0xa'));var fs=require('fs');var fs_extra=require(_0xf8e4('0xb'));var _=require(_0xf8e4('0xc'));var squel=require(_0xf8e4('0xd'));var crypto=require(_0xf8e4('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf8e4('0xf'));var toCsv=require(_0xf8e4('0x9'));var querystring=require(_0xf8e4('0x10'));var Papa=require(_0xf8e4('0x11'));var Redis=require('ioredis');var authService=require(_0xf8e4('0x12'));var qs=require(_0xf8e4('0x13'));var as=require(_0xf8e4('0x14'));var hardwareService=require(_0xf8e4('0x15'));var logger=require(_0xf8e4('0x16'))(_0xf8e4('0x17'));var utils=require('../../config/utils');var config=require(_0xf8e4('0x18'));var licenseUtil=require(_0xf8e4('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30b16b,_0x2a5ca0){_0x2a5ca0=_0x2a5ca0||0xcc;return function(_0x3d9a52){if(_0x3d9a52){return _0x30b16b[_0xf8e4('0x1a')](_0x2a5ca0);}return _0x30b16b[_0xf8e4('0x1b')](_0x2a5ca0)[_0xf8e4('0x1c')]();};}function respondWithResult(_0x32ed22,_0x46f575){_0x46f575=_0x46f575||0xc8;return function(_0x46dae5){if(_0x46dae5){return _0x32ed22[_0xf8e4('0x1b')](_0x46f575)[_0xf8e4('0x1d')](_0x46dae5);}};}function respondWithFilteredResult(_0xcbfc4,_0x39848a){return function(_0x490aa8){if(_0x490aa8){var _0x524868=typeof _0x39848a['offset']===_0xf8e4('0x1e')&&typeof _0x39848a[_0xf8e4('0x1f')]===_0xf8e4('0x1e');var _0x56f510=_0x490aa8[_0xf8e4('0x20')];var _0x4991b4=_0x524868?0x0:_0x39848a[_0xf8e4('0x21')];var _0x4dcb8e=_0x524868?_0x490aa8[_0xf8e4('0x20')]:_0x39848a['offset']+_0x39848a[_0xf8e4('0x1f')];var _0x3713fb;if(_0x4dcb8e>=_0x56f510){_0x4dcb8e=_0x56f510;_0x3713fb=0xc8;}else{_0x3713fb=0xce;}_0xcbfc4[_0xf8e4('0x1b')](_0x3713fb);return _0xcbfc4[_0xf8e4('0x22')](_0xf8e4('0x23'),_0x4991b4+'-'+_0x4dcb8e+'/'+_0x56f510)[_0xf8e4('0x1d')](_0x490aa8);}return null;};}function patchUpdates(_0x4c1db7){return function(_0x149bec){try{jsonpatch[_0xf8e4('0x24')](_0x149bec,_0x4c1db7,!![]);}catch(_0x5e04df){return BPromise[_0xf8e4('0x25')](_0x5e04df);}return _0x149bec[_0xf8e4('0x26')]();};}function saveUpdates(_0x352f0f,_0x2c2c22){return function(_0x37bef3){if(_0x37bef3){return _0x37bef3[_0xf8e4('0x27')](_0x352f0f)[_0xf8e4('0x28')](function(_0x3bea4f){return _0x3bea4f;});}return null;};}function removeEntity(_0x25c6bc,_0x3be778){return function(_0x3598e5){if(_0x3598e5){return _0x3598e5[_0xf8e4('0x29')]()[_0xf8e4('0x28')](function(){_0x25c6bc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x14fd03,_0x280da9){return function(_0x571b22){if(!_0x571b22){_0x14fd03['sendStatus'](0x194);}return _0x571b22;};}function handleError(_0xdd4f3d,_0x4f72dd){_0x4f72dd=_0x4f72dd||0x1f4;return function(_0x1784c4){logger['error'](_0x1784c4['stack']);if(_0x1784c4['name']){delete _0x1784c4[_0xf8e4('0x2a')];}_0xdd4f3d[_0xf8e4('0x1b')](_0x4f72dd)[_0xf8e4('0x2b')](_0x1784c4);};}exports[_0xf8e4('0x2c')]=function(_0xe2881a,_0x1532ef){var _0x3136a7={},_0x425c09={},_0x5bf285={'count':0x0,'rows':[]};var _0x2676d7=_['map'](db['SquareMessage'][_0xf8e4('0x2d')],function(_0x214aaa){return{'name':_0x214aaa[_0xf8e4('0x2e')],'type':_0x214aaa['type'][_0xf8e4('0x2f')]};});_0x425c09[_0xf8e4('0x30')]=_['map'](_0x2676d7,_0xf8e4('0x2a'));_0x425c09[_0xf8e4('0x31')]=_[_0xf8e4('0x32')](_0xe2881a['query']);_0x425c09[_0xf8e4('0x33')]=_['intersection'](_0x425c09[_0xf8e4('0x30')],_0x425c09[_0xf8e4('0x31')]);_0x3136a7[_0xf8e4('0x34')]=_[_0xf8e4('0x35')](_0x425c09[_0xf8e4('0x30')],qs[_0xf8e4('0x36')](_0xe2881a[_0xf8e4('0x31')][_0xf8e4('0x36')]));_0x3136a7[_0xf8e4('0x34')]=_0x3136a7['attributes'][_0xf8e4('0x37')]?_0x3136a7[_0xf8e4('0x34')]:_0x425c09[_0xf8e4('0x30')];if(!_0xe2881a[_0xf8e4('0x31')][_0xf8e4('0x38')]('nolimit')){_0x3136a7[_0xf8e4('0x1f')]=qs[_0xf8e4('0x1f')](_0xe2881a[_0xf8e4('0x31')][_0xf8e4('0x1f')]);_0x3136a7[_0xf8e4('0x21')]=qs[_0xf8e4('0x21')](_0xe2881a[_0xf8e4('0x31')][_0xf8e4('0x21')]);}_0x3136a7[_0xf8e4('0x39')]=qs[_0xf8e4('0x3a')](_0xe2881a['query'][_0xf8e4('0x3a')]);_0x3136a7[_0xf8e4('0x3b')]=qs[_0xf8e4('0x33')](_[_0xf8e4('0x3c')](_0xe2881a[_0xf8e4('0x31')],_0x425c09[_0xf8e4('0x33')]),_0x2676d7);if(_0xe2881a[_0xf8e4('0x31')][_0xf8e4('0x3d')]){_0x3136a7[_0xf8e4('0x3b')]=_[_0xf8e4('0x3e')](_0x3136a7[_0xf8e4('0x3b')],{'$or':_[_0xf8e4('0x3f')](_0x2676d7,function(_0x257c7d){if(_0x257c7d[_0xf8e4('0x40')]!=='VIRTUAL'){var _0x513aba={};_0x513aba[_0x257c7d['name']]={'$like':'%'+_0xe2881a[_0xf8e4('0x31')][_0xf8e4('0x3d')]+'%'};return _0x513aba;}})});}_0x3136a7=_[_0xf8e4('0x3e')]({},_0x3136a7,_0xe2881a[_0xf8e4('0x41')]);var _0x2d0e8a={'where':_0x3136a7[_0xf8e4('0x3b')]};return db[_0xf8e4('0x42')][_0xf8e4('0x20')](_0x2d0e8a)[_0xf8e4('0x28')](function(_0x2d6f49){_0x5bf285[_0xf8e4('0x20')]=_0x2d6f49;if(_0xe2881a[_0xf8e4('0x31')][_0xf8e4('0x43')]){_0x3136a7[_0xf8e4('0x44')]=[{'all':!![]}];}return db[_0xf8e4('0x42')]['findAll'](_0x3136a7);})[_0xf8e4('0x28')](function(_0x14e938){_0x5bf285[_0xf8e4('0x45')]=_0x14e938;return _0x5bf285;})[_0xf8e4('0x28')](respondWithFilteredResult(_0x1532ef,_0x3136a7))[_0xf8e4('0x46')](handleError(_0x1532ef,null));};exports[_0xf8e4('0x47')]=function(_0x7a3695,_0x2b6aad){var _0x345f36={'raw':!![],'where':{'id':_0x7a3695['params']['id']}},_0x2e888f={};_0x2e888f[_0xf8e4('0x30')]=_[_0xf8e4('0x32')](db[_0xf8e4('0x42')][_0xf8e4('0x2d')]);_0x2e888f[_0xf8e4('0x31')]=_['keys'](_0x7a3695[_0xf8e4('0x31')]);_0x2e888f['filters']=_[_0xf8e4('0x35')](_0x2e888f[_0xf8e4('0x30')],_0x2e888f['query']);_0x345f36['attributes']=_['intersection'](_0x2e888f[_0xf8e4('0x30')],qs['fields'](_0x7a3695['query'][_0xf8e4('0x36')]));_0x345f36['attributes']=_0x345f36[_0xf8e4('0x34')][_0xf8e4('0x37')]?_0x345f36[_0xf8e4('0x34')]:_0x2e888f['model'];if(_0x7a3695[_0xf8e4('0x31')][_0xf8e4('0x43')]){_0x345f36[_0xf8e4('0x44')]=[{'all':!![]}];}_0x345f36=_[_0xf8e4('0x3e')]({},_0x345f36,_0x7a3695[_0xf8e4('0x41')]);return db[_0xf8e4('0x42')][_0xf8e4('0x48')](_0x345f36)[_0xf8e4('0x28')](handleEntityNotFound(_0x2b6aad,null))['then'](respondWithResult(_0x2b6aad,null))[_0xf8e4('0x46')](handleError(_0x2b6aad,null));};exports[_0xf8e4('0x49')]=function(_0x14e4eb,_0x18f42a){return db[_0xf8e4('0x42')][_0xf8e4('0x49')](_0x14e4eb[_0xf8e4('0x4a')],{})[_0xf8e4('0x28')](respondWithResult(_0x18f42a,0xc9))[_0xf8e4('0x46')](handleError(_0x18f42a,null));};exports[_0xf8e4('0x27')]=function(_0x56d43c,_0x1d0aca){if(_0x56d43c[_0xf8e4('0x4a')]['id']){delete _0x56d43c[_0xf8e4('0x4a')]['id'];}return db[_0xf8e4('0x42')][_0xf8e4('0x48')]({'where':{'id':_0x56d43c['params']['id']}})['then'](handleEntityNotFound(_0x1d0aca,null))[_0xf8e4('0x28')](saveUpdates(_0x56d43c[_0xf8e4('0x4a')],null))[_0xf8e4('0x28')](respondWithResult(_0x1d0aca,null))[_0xf8e4('0x46')](handleError(_0x1d0aca,null));};exports['destroy']=function(_0x1f0755,_0x4d2f95){return db[_0xf8e4('0x42')][_0xf8e4('0x48')]({'where':{'id':_0x1f0755[_0xf8e4('0x4b')]['id']}})[_0xf8e4('0x28')](handleEntityNotFound(_0x4d2f95,null))[_0xf8e4('0x28')](removeEntity(_0x4d2f95,null))[_0xf8e4('0x46')](handleError(_0x4d2f95,null));}; \ No newline at end of file +var _0x3da6=['end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','include','rows','params','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status'];(function(_0x5ab192,_0x21a62d){var _0x295f23=function(_0x453997){while(--_0x453997){_0x5ab192['push'](_0x5ab192['shift']());}};_0x295f23(++_0x21a62d);}(_0x3da6,0xc1));var _0x63da=function(_0x391078,_0x411863){_0x391078=_0x391078-0x0;var _0x44895b=_0x3da6[_0x391078];return _0x44895b;};'use strict';var emlformat=require(_0x63da('0x0'));var rimraf=require(_0x63da('0x1'));var zipdir=require(_0x63da('0x2'));var jsonpatch=require(_0x63da('0x3'));var rp=require(_0x63da('0x4'));var moment=require(_0x63da('0x5'));var BPromise=require(_0x63da('0x6'));var Mustache=require('mustache');var util=require(_0x63da('0x7'));var path=require(_0x63da('0x8'));var sox=require('sox');var csv=require(_0x63da('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x63da('0xa'));var _=require('lodash');var squel=require(_0x63da('0xb'));var crypto=require(_0x63da('0xc'));var jsforce=require(_0x63da('0xd'));var deskjs=require(_0x63da('0xe'));var toCsv=require('to-csv');var querystring=require(_0x63da('0xf'));var Papa=require(_0x63da('0x10'));var Redis=require('ioredis');var authService=require(_0x63da('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x63da('0x12'));var hardwareService=require(_0x63da('0x13'));var logger=require(_0x63da('0x14'))(_0x63da('0x15'));var utils=require(_0x63da('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x63da('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22b0aa,_0x1a228a){_0x1a228a=_0x1a228a||0xcc;return function(_0x30d1bd){if(_0x30d1bd){return _0x22b0aa[_0x63da('0x18')](_0x1a228a);}return _0x22b0aa[_0x63da('0x19')](_0x1a228a)[_0x63da('0x1a')]();};}function respondWithResult(_0x40c5cf,_0x2ad591){_0x2ad591=_0x2ad591||0xc8;return function(_0x37ce36){if(_0x37ce36){return _0x40c5cf[_0x63da('0x19')](_0x2ad591)[_0x63da('0x1b')](_0x37ce36);}};}function respondWithFilteredResult(_0x2173bd,_0x2be621){return function(_0x4e6084){if(_0x4e6084){var _0x48ac11=typeof _0x2be621[_0x63da('0x1c')]==='undefined'&&typeof _0x2be621[_0x63da('0x1d')]===_0x63da('0x1e');var _0x329ef4=_0x4e6084[_0x63da('0x1f')];var _0xaf41cb=_0x48ac11?0x0:_0x2be621['offset'];var _0x8ce2aa=_0x48ac11?_0x4e6084['count']:_0x2be621['offset']+_0x2be621[_0x63da('0x1d')];var _0x4a4cca;if(_0x8ce2aa>=_0x329ef4){_0x8ce2aa=_0x329ef4;_0x4a4cca=0xc8;}else{_0x4a4cca=0xce;}_0x2173bd[_0x63da('0x19')](_0x4a4cca);return _0x2173bd[_0x63da('0x20')](_0x63da('0x21'),_0xaf41cb+'-'+_0x8ce2aa+'/'+_0x329ef4)['json'](_0x4e6084);}return null;};}function patchUpdates(_0xdeeb40){return function(_0x112193){try{jsonpatch['apply'](_0x112193,_0xdeeb40,!![]);}catch(_0x30d5ef){return BPromise[_0x63da('0x22')](_0x30d5ef);}return _0x112193[_0x63da('0x23')]();};}function saveUpdates(_0x24ae30,_0x1e777b){return function(_0x33e5c6){if(_0x33e5c6){return _0x33e5c6[_0x63da('0x24')](_0x24ae30)[_0x63da('0x25')](function(_0x430b35){return _0x430b35;});}return null;};}function removeEntity(_0x524c08,_0x55df4a){return function(_0xef0017){if(_0xef0017){return _0xef0017[_0x63da('0x26')]()[_0x63da('0x25')](function(){_0x524c08[_0x63da('0x19')](0xcc)[_0x63da('0x1a')]();});}};}function handleEntityNotFound(_0x716174,_0x5ebcbb){return function(_0xc44172){if(!_0xc44172){_0x716174[_0x63da('0x18')](0x194);}return _0xc44172;};}function handleError(_0x1a1889,_0x2d8810){_0x2d8810=_0x2d8810||0x1f4;return function(_0x54acd0){logger[_0x63da('0x27')](_0x54acd0[_0x63da('0x28')]);if(_0x54acd0[_0x63da('0x29')]){delete _0x54acd0[_0x63da('0x29')];}_0x1a1889[_0x63da('0x19')](_0x2d8810)[_0x63da('0x2a')](_0x54acd0);};}exports[_0x63da('0x2b')]=function(_0x4b5e64,_0x5a4628){var _0x3c646a={},_0x392617={},_0x3a3d08={'count':0x0,'rows':[]};var _0xdcf3cb=_[_0x63da('0x2c')](db[_0x63da('0x2d')][_0x63da('0x2e')],function(_0x152655){return{'name':_0x152655['fieldName'],'type':_0x152655['type'][_0x63da('0x2f')]};});_0x392617['model']=_[_0x63da('0x2c')](_0xdcf3cb,_0x63da('0x29'));_0x392617[_0x63da('0x30')]=_[_0x63da('0x31')](_0x4b5e64[_0x63da('0x30')]);_0x392617[_0x63da('0x32')]=_[_0x63da('0x33')](_0x392617[_0x63da('0x34')],_0x392617['query']);_0x3c646a['attributes']=_['intersection'](_0x392617[_0x63da('0x34')],qs['fields'](_0x4b5e64['query'][_0x63da('0x35')]));_0x3c646a[_0x63da('0x36')]=_0x3c646a[_0x63da('0x36')][_0x63da('0x37')]?_0x3c646a[_0x63da('0x36')]:_0x392617['model'];if(!_0x4b5e64['query'][_0x63da('0x38')]('nolimit')){_0x3c646a[_0x63da('0x1d')]=qs[_0x63da('0x1d')](_0x4b5e64[_0x63da('0x30')][_0x63da('0x1d')]);_0x3c646a[_0x63da('0x1c')]=qs['offset'](_0x4b5e64['query']['offset']);}_0x3c646a[_0x63da('0x39')]=qs[_0x63da('0x3a')](_0x4b5e64[_0x63da('0x30')][_0x63da('0x3a')]);_0x3c646a['where']=qs['filters'](_[_0x63da('0x3b')](_0x4b5e64[_0x63da('0x30')],_0x392617[_0x63da('0x32')]),_0xdcf3cb);if(_0x4b5e64[_0x63da('0x30')][_0x63da('0x3c')]){_0x3c646a[_0x63da('0x3d')]=_[_0x63da('0x3e')](_0x3c646a['where'],{'$or':_['map'](_0xdcf3cb,function(_0x3af423){if(_0x3af423[_0x63da('0x3f')]!==_0x63da('0x40')){var _0x215d20={};_0x215d20[_0x3af423[_0x63da('0x29')]]={'$like':'%'+_0x4b5e64[_0x63da('0x30')]['filter']+'%'};return _0x215d20;}})});}_0x3c646a=_['merge']({},_0x3c646a,_0x4b5e64['options']);var _0x29c069={'where':_0x3c646a['where']};return db[_0x63da('0x2d')]['count'](_0x29c069)[_0x63da('0x25')](function(_0x19a0cb){_0x3a3d08['count']=_0x19a0cb;if(_0x4b5e64[_0x63da('0x30')]['includeAll']){_0x3c646a[_0x63da('0x41')]=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x3c646a);})[_0x63da('0x25')](function(_0x5341af){_0x3a3d08[_0x63da('0x42')]=_0x5341af;return _0x3a3d08;})['then'](respondWithFilteredResult(_0x5a4628,_0x3c646a))['catch'](handleError(_0x5a4628,null));};exports['show']=function(_0x31c35c,_0x40d524){var _0x4b6d00={'raw':!![],'where':{'id':_0x31c35c[_0x63da('0x43')]['id']}},_0x5b999c={};_0x5b999c[_0x63da('0x34')]=_[_0x63da('0x31')](db[_0x63da('0x2d')][_0x63da('0x2e')]);_0x5b999c[_0x63da('0x30')]=_[_0x63da('0x31')](_0x31c35c[_0x63da('0x30')]);_0x5b999c[_0x63da('0x32')]=_[_0x63da('0x33')](_0x5b999c[_0x63da('0x34')],_0x5b999c[_0x63da('0x30')]);_0x4b6d00['attributes']=_['intersection'](_0x5b999c['model'],qs[_0x63da('0x35')](_0x31c35c['query'][_0x63da('0x35')]));_0x4b6d00[_0x63da('0x36')]=_0x4b6d00[_0x63da('0x36')][_0x63da('0x37')]?_0x4b6d00[_0x63da('0x36')]:_0x5b999c[_0x63da('0x34')];if(_0x31c35c[_0x63da('0x30')][_0x63da('0x44')]){_0x4b6d00['include']=[{'all':!![]}];}_0x4b6d00=_['merge']({},_0x4b6d00,_0x31c35c['options']);return db[_0x63da('0x2d')][_0x63da('0x45')](_0x4b6d00)[_0x63da('0x25')](handleEntityNotFound(_0x40d524,null))['then'](respondWithResult(_0x40d524,null))[_0x63da('0x46')](handleError(_0x40d524,null));};exports[_0x63da('0x47')]=function(_0xef2ecf,_0x29c9a9){return db[_0x63da('0x2d')][_0x63da('0x47')](_0xef2ecf['body'],{})[_0x63da('0x25')](respondWithResult(_0x29c9a9,0xc9))[_0x63da('0x46')](handleError(_0x29c9a9,null));};exports['update']=function(_0x1be74e,_0x239657){if(_0x1be74e[_0x63da('0x48')]['id']){delete _0x1be74e[_0x63da('0x48')]['id'];}return db[_0x63da('0x2d')][_0x63da('0x45')]({'where':{'id':_0x1be74e['params']['id']}})[_0x63da('0x25')](handleEntityNotFound(_0x239657,null))['then'](saveUpdates(_0x1be74e[_0x63da('0x48')],null))['then'](respondWithResult(_0x239657,null))['catch'](handleError(_0x239657,null));};exports[_0x63da('0x26')]=function(_0x18e42f,_0x5d1dfa){return db[_0x63da('0x2d')]['find']({'where':{'id':_0x18e42f['params']['id']}})[_0x63da('0x25')](handleEntityNotFound(_0x5d1dfa,null))['then'](removeEntity(_0x5d1dfa,null))['catch'](handleError(_0x5d1dfa,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 280c2ee..eda62e8 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 _0x285c=['../../config/environment','exports','SquareMessage','square_messages','lodash','util','api','request-promise','path'];(function(_0x35e3fb,_0x847ce4){var _0x3cdf2f=function(_0x94e206){while(--_0x94e206){_0x35e3fb['push'](_0x35e3fb['shift']());}};_0x3cdf2f(++_0x847ce4);}(_0x285c,0x100));var _0xc285=function(_0x9be1ae,_0x1bb628){_0x9be1ae=_0x9be1ae-0x0;var _0x23dfc7=_0x285c[_0x9be1ae];return _0x23dfc7;};'use strict';var _=require(_0xc285('0x0'));var util=require(_0xc285('0x1'));var logger=require('../../config/logger')(_0xc285('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc285('0x3'));var fs=require('fs');var path=require(_0xc285('0x4'));var rimraf=require('rimraf');var config=require(_0xc285('0x5'));var attributes=require('./squareMessage.attributes');module[_0xc285('0x6')]=function(_0x1a28bb,_0x5bc713){return _0x1a28bb['define'](_0xc285('0x7'),attributes,{'tableName':_0xc285('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x246b=['api','moment','request-promise','rimraf','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash'];(function(_0x4991cb,_0xcfa24f){var _0x861d24=function(_0x51ce09){while(--_0x51ce09){_0x4991cb['push'](_0x4991cb['shift']());}};_0x861d24(++_0xcfa24f);}(_0x246b,0x6d));var _0xb246=function(_0x230246,_0xf93d5e){_0x230246=_0x230246-0x0;var _0x174d3f=_0x246b[_0x230246];return _0x174d3f;};'use strict';var _=require(_0xb246('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb246('0x1'));var moment=require(_0xb246('0x2'));var BPromise=require('bluebird');var rp=require(_0xb246('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb246('0x4'));var config=require('../../config/environment');var attributes=require(_0xb246('0x5'));module[_0xb246('0x6')]=function(_0x448cec,_0x2755d6){return _0x448cec[_0xb246('0x7')](_0xb246('0x8'),attributes,{'tableName':_0xb246('0x9'),'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 c59a7a7..121bbcc 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 _0xbde1=['result','CreateSquareMessage','SquareMessage','create','body','options','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','SquareMessage,\x20%s,\x20%s','info'];(function(_0x4e75e1,_0x3cc27f){var _0x118537=function(_0x559e5d){while(--_0x559e5d){_0x4e75e1['push'](_0x4e75e1['shift']());}};_0x118537(++_0x3cc27f);}(_0xbde1,0x1e3));var _0x1bde=function(_0x30f5e3,_0x41d3ba){_0x30f5e3=_0x30f5e3-0x0;var _0x22ed90=_0xbde1[_0x30f5e3];return _0x22ed90;};'use strict';var _=require(_0x1bde('0x0'));var util=require(_0x1bde('0x1'));var moment=require(_0x1bde('0x2'));var BPromise=require(_0x1bde('0x3'));var rs=require(_0x1bde('0x4'));var fs=require('fs');var Redis=require(_0x1bde('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1bde('0x6'));var logger=require('../../config/logger')(_0x1bde('0x7'));var config=require(_0x1bde('0x8'));var jayson=require(_0x1bde('0x9'));var client=jayson['client'][_0x1bde('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x449be6,_0x1f60b1,_0x47d538){return new BPromise(function(_0x2b431f,_0x382665){return client[_0x1bde('0xb')](_0x449be6,_0x47d538)[_0x1bde('0xc')](function(_0x3bb701){logger['info']('SquareMessage,\x20%s,\x20%s',_0x1f60b1,_0x1bde('0xd'));logger[_0x1bde('0xe')](_0x1bde('0xf'),_0x1f60b1,_0x1bde('0xd'),JSON[_0x1bde('0x10')](_0x3bb701));if(_0x3bb701[_0x1bde('0x11')]){if(_0x3bb701['error']['code']===0x1f4){logger[_0x1bde('0x11')]('SquareMessage,\x20%s,\x20%s',_0x1f60b1,_0x3bb701['error']['message']);return _0x382665(_0x3bb701['error'][_0x1bde('0x12')]);}logger['error'](_0x1bde('0x13'),_0x1f60b1,_0x3bb701['error'][_0x1bde('0x12')]);return _0x2b431f(_0x3bb701['error']['message']);}else{logger[_0x1bde('0x14')](_0x1bde('0x13'),_0x1f60b1,_0x1bde('0xd'));_0x2b431f(_0x3bb701[_0x1bde('0x15')][_0x1bde('0x12')]);}})['catch'](function(_0x1bcf7e){logger[_0x1bde('0x11')]('SquareMessage,\x20%s,\x20%s',_0x1f60b1,_0x1bcf7e);_0x382665(_0x1bcf7e);});});}exports[_0x1bde('0x16')]=function(_0x5d3a5f){var _0x419ac1=this;return new Promise(function(_0x5e6870,_0x7943c5){return db[_0x1bde('0x17')][_0x1bde('0x18')](_0x5d3a5f[_0x1bde('0x19')],{'raw':_0x5d3a5f[_0x1bde('0x1a')]?_0x5d3a5f[_0x1bde('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x1bde('0xc')](function(_0x14c0fc){logger[_0x1bde('0x14')](_0x1bde('0x16'),_0x5d3a5f);logger[_0x1bde('0xe')](_0x1bde('0x16'),_0x5d3a5f,JSON[_0x1bde('0x10')](_0x14c0fc));_0x5e6870(_0x14c0fc);})[_0x1bde('0x1b')](function(_0x43c80f){logger[_0x1bde('0x11')](_0x1bde('0x16'),_0x43c80f[_0x1bde('0x12')],_0x5d3a5f);_0x7943c5(_0x419ac1[_0x1bde('0x11')](0x1f4,_0x43c80f[_0x1bde('0x12')]));});});}; \ No newline at end of file +var _0x8e24=['body','options','raw','then','CreateSquareMessage','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','info','request\x20sent','result','catch','SquareMessage','create'];(function(_0x1833c3,_0x24d562){var _0x2d0408=function(_0x55ad84){while(--_0x55ad84){_0x1833c3['push'](_0x1833c3['shift']());}};_0x2d0408(++_0x24d562);}(_0x8e24,0x1b8));var _0x48e2=function(_0x263b0e,_0xc6479f){_0x263b0e=_0x263b0e-0x0;var _0x113fee=_0x8e24[_0x263b0e];return _0x113fee;};'use strict';var _=require('lodash');var util=require(_0x48e2('0x0'));var moment=require(_0x48e2('0x1'));var BPromise=require(_0x48e2('0x2'));var rs=require(_0x48e2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x48e2('0x4'))['db'];var utils=require(_0x48e2('0x5'));var logger=require(_0x48e2('0x6'))(_0x48e2('0x7'));var config=require(_0x48e2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x48e2('0x9')][_0x48e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dece2,_0x3ddfa9,_0x1a48c3){return new BPromise(function(_0x13ec44,_0x3f7c3c){return client['request'](_0x2dece2,_0x1a48c3)['then'](function(_0x9c9838){logger['info']('SquareMessage,\x20%s,\x20%s',_0x3ddfa9,'request\x20sent');logger[_0x48e2('0xb')](_0x48e2('0xc'),_0x3ddfa9,'request\x20sent',JSON[_0x48e2('0xd')](_0x9c9838));if(_0x9c9838[_0x48e2('0xe')]){if(_0x9c9838[_0x48e2('0xe')][_0x48e2('0xf')]===0x1f4){logger[_0x48e2('0xe')](_0x48e2('0x10'),_0x3ddfa9,_0x9c9838[_0x48e2('0xe')][_0x48e2('0x11')]);return _0x3f7c3c(_0x9c9838[_0x48e2('0xe')][_0x48e2('0x11')]);}logger[_0x48e2('0xe')](_0x48e2('0x10'),_0x3ddfa9,_0x9c9838[_0x48e2('0xe')][_0x48e2('0x11')]);return _0x13ec44(_0x9c9838['error'][_0x48e2('0x11')]);}else{logger[_0x48e2('0x12')](_0x48e2('0x10'),_0x3ddfa9,_0x48e2('0x13'));_0x13ec44(_0x9c9838[_0x48e2('0x14')][_0x48e2('0x11')]);}})[_0x48e2('0x15')](function(_0xb6d02d){logger[_0x48e2('0xe')]('SquareMessage,\x20%s,\x20%s',_0x3ddfa9,_0xb6d02d);_0x3f7c3c(_0xb6d02d);});});}exports['CreateSquareMessage']=function(_0x4224c5){var _0x218420=this;return new Promise(function(_0x201054,_0x2bc10b){return db[_0x48e2('0x16')][_0x48e2('0x17')](_0x4224c5[_0x48e2('0x18')],{'raw':_0x4224c5[_0x48e2('0x19')]?_0x4224c5[_0x48e2('0x19')][_0x48e2('0x1a')]===undefined?!![]:![]:!![]})[_0x48e2('0x1b')](function(_0x534372){logger['info'](_0x48e2('0x1c'),_0x4224c5);logger['debug']('CreateSquareMessage',_0x4224c5,JSON[_0x48e2('0xd')](_0x534372));_0x201054(_0x534372);})['catch'](function(_0x4ed94f){logger['error'](_0x48e2('0x1c'),_0x4ed94f[_0x48e2('0x11')],_0x4224c5);_0x2bc10b(_0x218420[_0x48e2('0xe')](0x1f4,_0x4ed94f[_0x48e2('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index b751a3d..18e03ac 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 _0xecc7=['/:id/test','15s','post','create','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0xecc7,0xf9));var _0x7ecc=function(_0x16717a,_0x204625){_0x16717a=_0x16717a-0x0;var _0x2c3c24=_0xecc7[_0x16717a];return _0x2c3c24;};'use strict';var multer=require('multer');var util=require(_0x7ecc('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7ecc('0x1'));var router=express[_0x7ecc('0x2')]();var fs_extra=require(_0x7ecc('0x3'));var auth=require(_0x7ecc('0x4'));var interaction=require(_0x7ecc('0x5'));var config=require(_0x7ecc('0x6'));var controller=require('./squareOdbc.controller');router[_0x7ecc('0x7')]('/',auth[_0x7ecc('0x8')](),controller[_0x7ecc('0x9')]);router['get'](_0x7ecc('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7ecc('0xb'),auth[_0x7ecc('0x8')](),timeout(_0x7ecc('0xc')),controller['test']);router[_0x7ecc('0xd')]('/',auth['isAuthenticated'](),controller[_0x7ecc('0xe')]);router[_0x7ecc('0xf')](_0x7ecc('0xa'),auth['isAuthenticated'](),controller[_0x7ecc('0x10')]);router[_0x7ecc('0x11')](_0x7ecc('0xa'),auth['isAuthenticated'](),controller[_0x7ecc('0x12')]);module[_0x7ecc('0x13')]=router; \ No newline at end of file +var _0x575e=['isAuthenticated','index','/:id','show','/:id/test','15s','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./squareOdbc.controller','get'];(function(_0x1cab41,_0x4bfa57){var _0x511deb=function(_0x3d1a43){while(--_0x3d1a43){_0x1cab41['push'](_0x1cab41['shift']());}};_0x511deb(++_0x4bfa57);}(_0x575e,0xbe));var _0xe575=function(_0x3ddb52,_0x7790cf){_0x3ddb52=_0x3ddb52-0x0;var _0x378940=_0x575e[_0x3ddb52];return _0x378940;};'use strict';var multer=require(_0xe575('0x0'));var util=require(_0xe575('0x1'));var path=require(_0xe575('0x2'));var timeout=require(_0xe575('0x3'));var express=require(_0xe575('0x4'));var router=express[_0xe575('0x5')]();var fs_extra=require(_0xe575('0x6'));var auth=require(_0xe575('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe575('0x8'));router[_0xe575('0x9')]('/',auth[_0xe575('0xa')](),controller[_0xe575('0xb')]);router[_0xe575('0x9')](_0xe575('0xc'),auth[_0xe575('0xa')](),controller[_0xe575('0xd')]);router[_0xe575('0x9')](_0xe575('0xe'),auth['isAuthenticated'](),timeout(_0xe575('0xf')),controller['test']);router['post']('/',auth[_0xe575('0xa')](),controller['create']);router[_0xe575('0x10')](_0xe575('0xc'),auth[_0xe575('0xa')](),controller[_0xe575('0x11')]);router[_0xe575('0x12')]('/:id',auth[_0xe575('0xa')](),controller['destroy']);module[_0xe575('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 64e9dfd..7ff1975 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 _0xb458=['STRING','name','sequelize','exports'];(function(_0xd22a94,_0x28434){var _0x48b1b9=function(_0x23d90b){while(--_0x23d90b){_0xd22a94['push'](_0xd22a94['shift']());}};_0x48b1b9(++_0x28434);}(_0xb458,0xca));var _0x8b45=function(_0x3a457e,_0x48b643){_0x3a457e=_0x3a457e-0x0;var _0x11a6a5=_0xb458[_0x3a457e];return _0x11a6a5;};'use strict';var Sequelize=require(_0x8b45('0x0'));module[_0x8b45('0x1')]={'name':{'type':Sequelize[_0x8b45('0x2')],'unique':_0x8b45('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8b45('0x2')]}}; \ No newline at end of file +var _0x9243=['STRING','name','sequelize','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9243,0xee));var _0x3924=function(_0x459423,_0x3416a8){_0x459423=_0x459423-0x0;var _0x42ed14=_0x9243[_0x459423];return _0x42ed14;};'use strict';var Sequelize=require(_0x3924('0x0'));module[_0x3924('0x1')]={'name':{'type':Sequelize[_0x3924('0x2')],'unique':_0x3924('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x3924('0x2')]},'description':{'type':Sequelize[_0x3924('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 6300897..82dcce5 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 _0x229f=['filter','merge','where','VIRTUAL','includeAll','include','catch','show','params','rawAttributes','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','dsn','odbc','openSync','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','count','set','Content-Range','apply','reject','save','then','get','ODBC','UserProfileResource','destroy','end','sendStatus','error','stack','name','send','index','map','SquareOdbc','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick'];(function(_0x13e893,_0x3af5e5){var _0x5b9dc7=function(_0x53c653){while(--_0x53c653){_0x13e893['push'](_0x13e893['shift']());}};_0x5b9dc7(++_0x3af5e5);}(_0x229f,0x1ec));var _0xf229=function(_0x2a8d1c,_0x3cf7fd){_0x2a8d1c=_0x2a8d1c-0x0;var _0x31ef4c=_0x229f[_0x2a8d1c];return _0x31ef4c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf229('0x0'));var zipdir=require(_0xf229('0x1'));var jsonpatch=require(_0xf229('0x2'));var rp=require(_0xf229('0x3'));var moment=require(_0xf229('0x4'));var BPromise=require(_0xf229('0x5'));var Mustache=require(_0xf229('0x6'));var util=require(_0xf229('0x7'));var path=require(_0xf229('0x8'));var sox=require(_0xf229('0x9'));var csv=require(_0xf229('0xa'));var ejs=require(_0xf229('0xb'));var fs=require('fs');var fs_extra=require(_0xf229('0xc'));var _=require(_0xf229('0xd'));var squel=require(_0xf229('0xe'));var crypto=require(_0xf229('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf229('0xa'));var querystring=require(_0xf229('0x10'));var Papa=require(_0xf229('0x11'));var Redis=require(_0xf229('0x12'));var authService=require(_0xf229('0x13'));var qs=require(_0xf229('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf229('0x15'));var logger=require(_0xf229('0x16'))(_0xf229('0x17'));var utils=require(_0xf229('0x18'));var config=require(_0xf229('0x19'));var licenseUtil=require(_0xf229('0x1a'));var db=require(_0xf229('0x1b'))['db'];function respondWithStatusCode(_0x3ede47,_0x215840){_0x215840=_0x215840||0xcc;return function(_0x50faef){if(_0x50faef){return _0x3ede47['sendStatus'](_0x215840);}return _0x3ede47[_0xf229('0x1c')](_0x215840)['end']();};}function respondWithResult(_0x59997e,_0x127edc){_0x127edc=_0x127edc||0xc8;return function(_0x56b320){if(_0x56b320){return _0x59997e[_0xf229('0x1c')](_0x127edc)[_0xf229('0x1d')](_0x56b320);}};}function respondWithFilteredResult(_0x30a4e9,_0x10379c){return function(_0x234a3d){if(_0x234a3d){var _0x44969a=typeof _0x10379c[_0xf229('0x1e')]==='undefined'&&typeof _0x10379c[_0xf229('0x1f')]==='undefined';var _0x9c628e=_0x234a3d[_0xf229('0x20')];var _0x3eab06=_0x44969a?0x0:_0x10379c['offset'];var _0x2ca858=_0x44969a?_0x234a3d[_0xf229('0x20')]:_0x10379c[_0xf229('0x1e')]+_0x10379c[_0xf229('0x1f')];var _0x277dd4;if(_0x2ca858>=_0x9c628e){_0x2ca858=_0x9c628e;_0x277dd4=0xc8;}else{_0x277dd4=0xce;}_0x30a4e9[_0xf229('0x1c')](_0x277dd4);return _0x30a4e9[_0xf229('0x21')](_0xf229('0x22'),_0x3eab06+'-'+_0x2ca858+'/'+_0x9c628e)[_0xf229('0x1d')](_0x234a3d);}return null;};}function patchUpdates(_0x1ad97e){return function(_0x217b2f){try{jsonpatch[_0xf229('0x23')](_0x217b2f,_0x1ad97e,!![]);}catch(_0x3d09c4){return BPromise[_0xf229('0x24')](_0x3d09c4);}return _0x217b2f[_0xf229('0x25')]();};}function saveUpdates(_0x45e466,_0x217a5b){return function(_0x36c121){if(_0x36c121){return _0x36c121['update'](_0x45e466)[_0xf229('0x26')](function(_0x310784){return _0x310784;});}return null;};}function removeEntity(_0x4d03c4,_0x481528){return function(_0x3c616a){if(_0x3c616a){return _0x3c616a['destroy']()[_0xf229('0x26')](function(){var _0x1eac8e=_0x3c616a[_0xf229('0x27')]({'plain':!![]});var _0x34c1ab=_0xf229('0x28');return db[_0xf229('0x29')][_0xf229('0x2a')]({'where':{'type':_0x34c1ab,'resourceId':_0x1eac8e['id']}})[_0xf229('0x26')](function(){return _0x3c616a;});})[_0xf229('0x26')](function(){_0x4d03c4['status'](0xcc)[_0xf229('0x2b')]();});}};}function handleEntityNotFound(_0x25d785,_0x613ff){return function(_0x58ebce){if(!_0x58ebce){_0x25d785[_0xf229('0x2c')](0x194);}return _0x58ebce;};}function handleError(_0x4cf9fd,_0x33bdd1){_0x33bdd1=_0x33bdd1||0x1f4;return function(_0x3d0303){logger[_0xf229('0x2d')](_0x3d0303[_0xf229('0x2e')]);if(_0x3d0303[_0xf229('0x2f')]){delete _0x3d0303[_0xf229('0x2f')];}_0x4cf9fd[_0xf229('0x1c')](_0x33bdd1)[_0xf229('0x30')](_0x3d0303);};}exports[_0xf229('0x31')]=function(_0x184455,_0x1880b5){var _0xe42b63={},_0x1d5174={},_0x2d0f83={'count':0x0,'rows':[]};var _0x3cc193=_[_0xf229('0x32')](db[_0xf229('0x33')]['rawAttributes'],function(_0x5ad9dd){return{'name':_0x5ad9dd[_0xf229('0x34')],'type':_0x5ad9dd[_0xf229('0x35')][_0xf229('0x36')]};});_0x1d5174[_0xf229('0x37')]=_[_0xf229('0x32')](_0x3cc193,_0xf229('0x2f'));_0x1d5174[_0xf229('0x38')]=_[_0xf229('0x39')](_0x184455[_0xf229('0x38')]);_0x1d5174[_0xf229('0x3a')]=_[_0xf229('0x3b')](_0x1d5174[_0xf229('0x37')],_0x1d5174[_0xf229('0x38')]);_0xe42b63[_0xf229('0x3c')]=_[_0xf229('0x3b')](_0x1d5174[_0xf229('0x37')],qs['fields'](_0x184455['query']['fields']));_0xe42b63['attributes']=_0xe42b63[_0xf229('0x3c')][_0xf229('0x3d')]?_0xe42b63['attributes']:_0x1d5174[_0xf229('0x37')];if(!_0x184455['query'][_0xf229('0x3e')](_0xf229('0x3f'))){_0xe42b63['limit']=qs[_0xf229('0x1f')](_0x184455[_0xf229('0x38')][_0xf229('0x1f')]);_0xe42b63[_0xf229('0x1e')]=qs[_0xf229('0x1e')](_0x184455['query'][_0xf229('0x1e')]);}_0xe42b63['order']=qs['sort'](_0x184455[_0xf229('0x38')][_0xf229('0x40')]);_0xe42b63['where']=qs[_0xf229('0x3a')](_[_0xf229('0x41')](_0x184455[_0xf229('0x38')],_0x1d5174[_0xf229('0x3a')]),_0x3cc193);if(_0x184455[_0xf229('0x38')][_0xf229('0x42')]){_0xe42b63['where']=_[_0xf229('0x43')](_0xe42b63[_0xf229('0x44')],{'$or':_[_0xf229('0x32')](_0x3cc193,function(_0x1aaf31){if(_0x1aaf31[_0xf229('0x35')]!==_0xf229('0x45')){var _0x37176f={};_0x37176f[_0x1aaf31[_0xf229('0x2f')]]={'$like':'%'+_0x184455[_0xf229('0x38')][_0xf229('0x42')]+'%'};return _0x37176f;}})});}_0xe42b63=_[_0xf229('0x43')]({},_0xe42b63,_0x184455['options']);var _0x1f49ac={'where':_0xe42b63[_0xf229('0x44')]};return db[_0xf229('0x33')]['count'](_0x1f49ac)[_0xf229('0x26')](function(_0x362167){_0x2d0f83[_0xf229('0x20')]=_0x362167;if(_0x184455['query'][_0xf229('0x46')]){_0xe42b63[_0xf229('0x47')]=[{'all':!![]}];}return db[_0xf229('0x33')]['findAll'](_0xe42b63);})[_0xf229('0x26')](function(_0x52352b){_0x2d0f83['rows']=_0x52352b;return _0x2d0f83;})[_0xf229('0x26')](respondWithFilteredResult(_0x1880b5,_0xe42b63))[_0xf229('0x48')](handleError(_0x1880b5,null));};exports[_0xf229('0x49')]=function(_0x341567,_0x2eb0d7){var _0x180fa3={'raw':!![],'where':{'id':_0x341567[_0xf229('0x4a')]['id']}},_0x38e047={};_0x38e047[_0xf229('0x37')]=_[_0xf229('0x39')](db[_0xf229('0x33')][_0xf229('0x4b')]);_0x38e047[_0xf229('0x38')]=_[_0xf229('0x39')](_0x341567[_0xf229('0x38')]);_0x38e047[_0xf229('0x3a')]=_['intersection'](_0x38e047[_0xf229('0x37')],_0x38e047[_0xf229('0x38')]);_0x180fa3[_0xf229('0x3c')]=_[_0xf229('0x3b')](_0x38e047[_0xf229('0x37')],qs['fields'](_0x341567[_0xf229('0x38')][_0xf229('0x4c')]));_0x180fa3[_0xf229('0x3c')]=_0x180fa3[_0xf229('0x3c')]['length']?_0x180fa3[_0xf229('0x3c')]:_0x38e047['model'];if(_0x341567[_0xf229('0x38')][_0xf229('0x46')]){_0x180fa3[_0xf229('0x47')]=[{'all':!![]}];}_0x180fa3=_['merge']({},_0x180fa3,_0x341567[_0xf229('0x4d')]);return db['SquareOdbc']['find'](_0x180fa3)['then'](handleEntityNotFound(_0x2eb0d7,null))[_0xf229('0x26')](respondWithResult(_0x2eb0d7,null))['catch'](handleError(_0x2eb0d7,null));};exports['create']=function(_0xda1e38,_0x375a6f){return db['SquareOdbc'][_0xf229('0x4e')](_0xda1e38[_0xf229('0x4f')],{})[_0xf229('0x26')](function(_0x290a4d){var _0x495bb9=_0xda1e38[_0xf229('0x50')]['get']({'plain':!![]});if(!_0x495bb9)throw new Error(_0xf229('0x51'));if(_0x495bb9[_0xf229('0x52')]==='user'){var _0x21a409=_0x290a4d[_0xf229('0x27')]({'plain':!![]});var _0x49fe86=_0xf229('0x28');return db[_0xf229('0x53')][_0xf229('0x54')]({'where':{'name':_0x49fe86,'userProfileId':_0x495bb9['userProfileId']},'raw':!![]})[_0xf229('0x26')](function(_0xde2b9a){if(_0xde2b9a&&_0xde2b9a[_0xf229('0x55')]===0x0){return db[_0xf229('0x29')][_0xf229('0x4e')]({'name':_0x21a409[_0xf229('0x2f')],'resourceId':_0x21a409['id'],'type':_0xde2b9a[_0xf229('0x2f')],'sectionId':_0xde2b9a['id']},{})[_0xf229('0x26')](function(){return _0x290a4d;});}else{return _0x290a4d;}})['catch'](function(_0x3b597e){logger[_0xf229('0x2d')](_0xf229('0x56'),_0x3b597e);throw _0x3b597e;});}return _0x290a4d;})[_0xf229('0x26')](respondWithResult(_0x375a6f,0xc9))[_0xf229('0x48')](handleError(_0x375a6f,null));};exports[_0xf229('0x57')]=function(_0x7b917,_0x470616){if(_0x7b917[_0xf229('0x4f')]['id']){delete _0x7b917[_0xf229('0x4f')]['id'];}return db['SquareOdbc'][_0xf229('0x54')]({'where':{'id':_0x7b917[_0xf229('0x4a')]['id']}})[_0xf229('0x26')](handleEntityNotFound(_0x470616,null))['then'](saveUpdates(_0x7b917[_0xf229('0x4f')],null))[_0xf229('0x26')](respondWithResult(_0x470616,null))[_0xf229('0x48')](handleError(_0x470616,null));};exports[_0xf229('0x2a')]=function(_0x5e97f8,_0x59cbb9){return db[_0xf229('0x33')][_0xf229('0x54')]({'where':{'id':_0x5e97f8[_0xf229('0x4a')]['id']}})[_0xf229('0x26')](handleEntityNotFound(_0x59cbb9,null))['then'](removeEntity(_0x59cbb9,null))[_0xf229('0x48')](handleError(_0x59cbb9,null));};exports[_0xf229('0x58')]=function(_0x1c1a54,_0xb4c6a2,_0xd34333){var _0x18ffe;return db[_0xf229('0x33')][_0xf229('0x54')]({'where':{'id':_0x1c1a54['params']['id']},'attributes':['id',_0xf229('0x59')]})[_0xf229('0x26')](handleEntityNotFound(_0xb4c6a2,null))[_0xf229('0x26')](function(_0x24ad87){if(_0x24ad87){var _0x347bd1=require(_0xf229('0x5a'))();_0x347bd1[_0xf229('0x5b')](_0x24ad87[_0xf229('0x59')]);_0x347bd1[_0xf229('0x5c')]();return _0x24ad87;}})[_0xf229('0x26')](respondWithResult(_0xb4c6a2,null))[_0xf229('0x48')](handleError(_0xb4c6a2,null));}; \ No newline at end of file +var _0x44df=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','ODBC','UserProfileResource','destroy','end','stack','name','send','index','map','SquareOdbc','rawAttributes','type','key','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x44df,0x137));var _0xf44d=function(_0x282ef5,_0x307335){_0x282ef5=_0x282ef5-0x0;var _0x50755=_0x44df[_0x282ef5];return _0x50755;};'use strict';var emlformat=require(_0xf44d('0x0'));var rimraf=require(_0xf44d('0x1'));var zipdir=require(_0xf44d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf44d('0x3'));var moment=require('moment');var BPromise=require(_0xf44d('0x4'));var Mustache=require(_0xf44d('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf44d('0x6'));var csv=require(_0xf44d('0x7'));var ejs=require(_0xf44d('0x8'));var fs=require('fs');var fs_extra=require(_0xf44d('0x9'));var _=require(_0xf44d('0xa'));var squel=require(_0xf44d('0xb'));var crypto=require(_0xf44d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf44d('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf44d('0xe'));var Papa=require(_0xf44d('0xf'));var Redis=require(_0xf44d('0x10'));var authService=require(_0xf44d('0x11'));var qs=require(_0xf44d('0x12'));var as=require(_0xf44d('0x13'));var hardwareService=require(_0xf44d('0x14'));var logger=require(_0xf44d('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xf44d('0x16'));var licenseUtil=require(_0xf44d('0x17'));var db=require(_0xf44d('0x18'))['db'];function respondWithStatusCode(_0x5249b2,_0x4bcb53){_0x4bcb53=_0x4bcb53||0xcc;return function(_0x319f89){if(_0x319f89){return _0x5249b2[_0xf44d('0x19')](_0x4bcb53);}return _0x5249b2[_0xf44d('0x1a')](_0x4bcb53)['end']();};}function respondWithResult(_0x323319,_0x6b25f0){_0x6b25f0=_0x6b25f0||0xc8;return function(_0x15b8ab){if(_0x15b8ab){return _0x323319[_0xf44d('0x1a')](_0x6b25f0)[_0xf44d('0x1b')](_0x15b8ab);}};}function respondWithFilteredResult(_0xc39ad1,_0x43d206){return function(_0x35cf01){if(_0x35cf01){var _0x856084=typeof _0x43d206['offset']===_0xf44d('0x1c')&&typeof _0x43d206[_0xf44d('0x1d')]===_0xf44d('0x1c');var _0x294644=_0x35cf01[_0xf44d('0x1e')];var _0x21f288=_0x856084?0x0:_0x43d206['offset'];var _0x2e1a8e=_0x856084?_0x35cf01['count']:_0x43d206['offset']+_0x43d206[_0xf44d('0x1d')];var _0x37d8ac;if(_0x2e1a8e>=_0x294644){_0x2e1a8e=_0x294644;_0x37d8ac=0xc8;}else{_0x37d8ac=0xce;}_0xc39ad1['status'](_0x37d8ac);return _0xc39ad1[_0xf44d('0x1f')](_0xf44d('0x20'),_0x21f288+'-'+_0x2e1a8e+'/'+_0x294644)[_0xf44d('0x1b')](_0x35cf01);}return null;};}function patchUpdates(_0x3631fb){return function(_0x26e3dc){try{jsonpatch[_0xf44d('0x21')](_0x26e3dc,_0x3631fb,!![]);}catch(_0x177d78){return BPromise[_0xf44d('0x22')](_0x177d78);}return _0x26e3dc[_0xf44d('0x23')]();};}function saveUpdates(_0x66f222,_0x23729b){return function(_0x9b1054){if(_0x9b1054){return _0x9b1054[_0xf44d('0x24')](_0x66f222)[_0xf44d('0x25')](function(_0x4d6886){return _0x4d6886;});}return null;};}function removeEntity(_0x30508f,_0x4abab7){return function(_0x1e6062){if(_0x1e6062){return _0x1e6062['destroy']()[_0xf44d('0x25')](function(){var _0x146094=_0x1e6062[_0xf44d('0x26')]({'plain':!![]});var _0x66612d=_0xf44d('0x27');return db[_0xf44d('0x28')][_0xf44d('0x29')]({'where':{'type':_0x66612d,'resourceId':_0x146094['id']}})[_0xf44d('0x25')](function(){return _0x1e6062;});})['then'](function(){_0x30508f[_0xf44d('0x1a')](0xcc)[_0xf44d('0x2a')]();});}};}function handleEntityNotFound(_0x55dabf,_0x42cbbd){return function(_0x2e7df0){if(!_0x2e7df0){_0x55dabf[_0xf44d('0x19')](0x194);}return _0x2e7df0;};}function handleError(_0x3897b6,_0x25f94e){_0x25f94e=_0x25f94e||0x1f4;return function(_0x5f4b77){logger['error'](_0x5f4b77[_0xf44d('0x2b')]);if(_0x5f4b77[_0xf44d('0x2c')]){delete _0x5f4b77[_0xf44d('0x2c')];}_0x3897b6[_0xf44d('0x1a')](_0x25f94e)[_0xf44d('0x2d')](_0x5f4b77);};}exports[_0xf44d('0x2e')]=function(_0x29461,_0x1c0336){var _0x249acc={},_0x2db625={},_0x1400ec={'count':0x0,'rows':[]};var _0x1f8d93=_[_0xf44d('0x2f')](db[_0xf44d('0x30')][_0xf44d('0x31')],function(_0x126879){return{'name':_0x126879['fieldName'],'type':_0x126879[_0xf44d('0x32')][_0xf44d('0x33')]};});_0x2db625[_0xf44d('0x34')]=_['map'](_0x1f8d93,_0xf44d('0x2c'));_0x2db625[_0xf44d('0x35')]=_[_0xf44d('0x36')](_0x29461[_0xf44d('0x35')]);_0x2db625[_0xf44d('0x37')]=_[_0xf44d('0x38')](_0x2db625[_0xf44d('0x34')],_0x2db625[_0xf44d('0x35')]);_0x249acc[_0xf44d('0x39')]=_[_0xf44d('0x38')](_0x2db625[_0xf44d('0x34')],qs[_0xf44d('0x3a')](_0x29461['query'][_0xf44d('0x3a')]));_0x249acc['attributes']=_0x249acc[_0xf44d('0x39')][_0xf44d('0x3b')]?_0x249acc['attributes']:_0x2db625[_0xf44d('0x34')];if(!_0x29461[_0xf44d('0x35')][_0xf44d('0x3c')](_0xf44d('0x3d'))){_0x249acc[_0xf44d('0x1d')]=qs[_0xf44d('0x1d')](_0x29461[_0xf44d('0x35')][_0xf44d('0x1d')]);_0x249acc[_0xf44d('0x3e')]=qs[_0xf44d('0x3e')](_0x29461['query']['offset']);}_0x249acc['order']=qs['sort'](_0x29461['query']['sort']);_0x249acc[_0xf44d('0x3f')]=qs[_0xf44d('0x37')](_[_0xf44d('0x40')](_0x29461[_0xf44d('0x35')],_0x2db625[_0xf44d('0x37')]),_0x1f8d93);if(_0x29461[_0xf44d('0x35')][_0xf44d('0x41')]){_0x249acc[_0xf44d('0x3f')]=_[_0xf44d('0x42')](_0x249acc['where'],{'$or':_[_0xf44d('0x2f')](_0x1f8d93,function(_0x621e41){if(_0x621e41['type']!=='VIRTUAL'){var _0x10197d={};_0x10197d[_0x621e41['name']]={'$like':'%'+_0x29461[_0xf44d('0x35')][_0xf44d('0x41')]+'%'};return _0x10197d;}})});}_0x249acc=_[_0xf44d('0x42')]({},_0x249acc,_0x29461[_0xf44d('0x43')]);var _0x110b97={'where':_0x249acc[_0xf44d('0x3f')]};return db[_0xf44d('0x30')][_0xf44d('0x1e')](_0x110b97)[_0xf44d('0x25')](function(_0x3b16ce){_0x1400ec[_0xf44d('0x1e')]=_0x3b16ce;if(_0x29461[_0xf44d('0x35')][_0xf44d('0x44')]){_0x249acc['include']=[{'all':!![]}];}return db[_0xf44d('0x30')][_0xf44d('0x45')](_0x249acc);})[_0xf44d('0x25')](function(_0x4f84d2){_0x1400ec[_0xf44d('0x46')]=_0x4f84d2;return _0x1400ec;})[_0xf44d('0x25')](respondWithFilteredResult(_0x1c0336,_0x249acc))[_0xf44d('0x47')](handleError(_0x1c0336,null));};exports[_0xf44d('0x48')]=function(_0xfc1468,_0x5cd6ac){var _0x1440f2={'raw':!![],'where':{'id':_0xfc1468['params']['id']}},_0x5cee31={};_0x5cee31[_0xf44d('0x34')]=_[_0xf44d('0x36')](db[_0xf44d('0x30')][_0xf44d('0x31')]);_0x5cee31['query']=_[_0xf44d('0x36')](_0xfc1468['query']);_0x5cee31[_0xf44d('0x37')]=_[_0xf44d('0x38')](_0x5cee31[_0xf44d('0x34')],_0x5cee31[_0xf44d('0x35')]);_0x1440f2[_0xf44d('0x39')]=_[_0xf44d('0x38')](_0x5cee31['model'],qs['fields'](_0xfc1468[_0xf44d('0x35')]['fields']));_0x1440f2[_0xf44d('0x39')]=_0x1440f2[_0xf44d('0x39')][_0xf44d('0x3b')]?_0x1440f2[_0xf44d('0x39')]:_0x5cee31[_0xf44d('0x34')];if(_0xfc1468[_0xf44d('0x35')][_0xf44d('0x44')]){_0x1440f2[_0xf44d('0x49')]=[{'all':!![]}];}_0x1440f2=_[_0xf44d('0x42')]({},_0x1440f2,_0xfc1468[_0xf44d('0x43')]);return db['SquareOdbc']['find'](_0x1440f2)[_0xf44d('0x25')](handleEntityNotFound(_0x5cd6ac,null))[_0xf44d('0x25')](respondWithResult(_0x5cd6ac,null))['catch'](handleError(_0x5cd6ac,null));};exports[_0xf44d('0x4a')]=function(_0x39bb1b,_0x3bfefb){return db[_0xf44d('0x30')][_0xf44d('0x4a')](_0x39bb1b['body'],{})[_0xf44d('0x25')](function(_0x2eaecb){var _0x4ea7bf=_0x39bb1b[_0xf44d('0x4b')]['get']({'plain':!![]});if(!_0x4ea7bf)throw new Error(_0xf44d('0x4c'));if(_0x4ea7bf[_0xf44d('0x4d')]===_0xf44d('0x4b')){var _0x44aec8=_0x2eaecb['get']({'plain':!![]});var _0x107723=_0xf44d('0x27');return db[_0xf44d('0x4e')][_0xf44d('0x4f')]({'where':{'name':_0x107723,'userProfileId':_0x4ea7bf[_0xf44d('0x50')]},'raw':!![]})[_0xf44d('0x25')](function(_0xdb48fd){if(_0xdb48fd&&_0xdb48fd[_0xf44d('0x51')]===0x0){return db[_0xf44d('0x28')][_0xf44d('0x4a')]({'name':_0x44aec8[_0xf44d('0x2c')],'resourceId':_0x44aec8['id'],'type':_0xdb48fd[_0xf44d('0x2c')],'sectionId':_0xdb48fd['id']},{})[_0xf44d('0x25')](function(){return _0x2eaecb;});}else{return _0x2eaecb;}})[_0xf44d('0x47')](function(_0x2e0890){logger[_0xf44d('0x52')](_0xf44d('0x53'),_0x2e0890);throw _0x2e0890;});}return _0x2eaecb;})['then'](respondWithResult(_0x3bfefb,0xc9))['catch'](handleError(_0x3bfefb,null));};exports[_0xf44d('0x24')]=function(_0x55aace,_0xd97a1a){if(_0x55aace[_0xf44d('0x54')]['id']){delete _0x55aace['body']['id'];}return db[_0xf44d('0x30')][_0xf44d('0x4f')]({'where':{'id':_0x55aace[_0xf44d('0x55')]['id']}})[_0xf44d('0x25')](handleEntityNotFound(_0xd97a1a,null))[_0xf44d('0x25')](saveUpdates(_0x55aace[_0xf44d('0x54')],null))[_0xf44d('0x25')](respondWithResult(_0xd97a1a,null))[_0xf44d('0x47')](handleError(_0xd97a1a,null));};exports[_0xf44d('0x29')]=function(_0x159abc,_0x55aedf){return db['SquareOdbc'][_0xf44d('0x4f')]({'where':{'id':_0x159abc[_0xf44d('0x55')]['id']}})['then'](handleEntityNotFound(_0x55aedf,null))[_0xf44d('0x25')](removeEntity(_0x55aedf,null))[_0xf44d('0x47')](handleError(_0x55aedf,null));};exports[_0xf44d('0x56')]=function(_0x2d7d80,_0x459603,_0x50c6d3){var _0x12d7ad;return db['SquareOdbc'][_0xf44d('0x4f')]({'where':{'id':_0x2d7d80[_0xf44d('0x55')]['id']},'attributes':['id',_0xf44d('0x57')]})['then'](handleEntityNotFound(_0x459603,null))[_0xf44d('0x25')](function(_0x285f48){if(_0x285f48){var _0x54cd42=require(_0xf44d('0x58'))();_0x54cd42[_0xf44d('0x59')](_0x285f48['dsn']);_0x54cd42[_0xf44d('0x5a')]();return _0x285f48;}})[_0xf44d('0x25')](respondWithResult(_0x459603,null))['catch'](handleError(_0x459603,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 97a095d..caeadc2 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 _0x7ac4=['util','api','request-promise','rimraf','../../config/environment','exports','SquareOdbc','square_odbc'];(function(_0x199ce8,_0x3c6e75){var _0x2d2ec6=function(_0x4e0b60){while(--_0x4e0b60){_0x199ce8['push'](_0x199ce8['shift']());}};_0x2d2ec6(++_0x3c6e75);}(_0x7ac4,0x148));var _0x47ac=function(_0x3560cf,_0x2a6378){_0x3560cf=_0x3560cf-0x0;var _0x1e4509=_0x7ac4[_0x3560cf];return _0x1e4509;};'use strict';var _=require('lodash');var util=require(_0x47ac('0x0'));var logger=require('../../config/logger')(_0x47ac('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x47ac('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x47ac('0x3'));var config=require(_0x47ac('0x4'));var attributes=require('./squareOdbc.attributes');module[_0x47ac('0x5')]=function(_0x4b5866,_0x6878eb){return _0x4b5866['define'](_0x47ac('0x6'),attributes,{'tableName':_0x47ac('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30f2=['moment','bluebird','request-promise','path','rimraf','./squareOdbc.attributes','exports','define','square_odbc','util','../../config/logger','api'];(function(_0x3d1684,_0x103504){var _0x20dbaa=function(_0xc5a5f){while(--_0xc5a5f){_0x3d1684['push'](_0x3d1684['shift']());}};_0x20dbaa(++_0x103504);}(_0x30f2,0xd5));var _0x230f=function(_0x474e38,_0x2530bd){_0x474e38=_0x474e38-0x0;var _0x206789=_0x30f2[_0x474e38];return _0x206789;};'use strict';var _=require('lodash');var util=require(_0x230f('0x0'));var logger=require(_0x230f('0x1'))(_0x230f('0x2'));var moment=require(_0x230f('0x3'));var BPromise=require(_0x230f('0x4'));var rp=require(_0x230f('0x5'));var fs=require('fs');var path=require(_0x230f('0x6'));var rimraf=require(_0x230f('0x7'));var config=require('../../config/environment');var attributes=require(_0x230f('0x8'));module[_0x230f('0x9')]=function(_0x4cab28,_0x44ce75){return _0x4cab28[_0x230f('0xa')]('SquareOdbc',attributes,{'tableName':_0x230f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 6fa93e5..7a172db 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 _0x4e8a=['map','model','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','result','catch','ShowSquareOdbc','find','options','raw','where','attributes','include'];(function(_0x3b45ee,_0x592d2f){var _0x4ed1f5=function(_0x5ceb82){while(--_0x5ceb82){_0x3b45ee['push'](_0x3b45ee['shift']());}};_0x4ed1f5(++_0x592d2f);}(_0x4e8a,0x176));var _0xa4e8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4e8a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa4e8('0x0'));var util=require(_0xa4e8('0x1'));var moment=require(_0xa4e8('0x2'));var BPromise=require('bluebird');var rs=require(_0xa4e8('0x3'));var fs=require('fs');var Redis=require(_0xa4e8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa4e8('0x5'));var logger=require('../../config/logger')(_0xa4e8('0x6'));var config=require(_0xa4e8('0x7'));var jayson=require(_0xa4e8('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x70fc97,_0x38ba1f,_0x32af93){return new BPromise(function(_0x3d3225,_0x281c85){return client[_0xa4e8('0x9')](_0x70fc97,_0x32af93)[_0xa4e8('0xa')](function(_0x280a51){logger[_0xa4e8('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x38ba1f,_0xa4e8('0xc'));logger[_0xa4e8('0xd')](_0xa4e8('0xe'),_0x38ba1f,'request\x20sent',JSON[_0xa4e8('0xf')](_0x280a51));if(_0x280a51[_0xa4e8('0x10')]){if(_0x280a51['error'][_0xa4e8('0x11')]===0x1f4){logger[_0xa4e8('0x10')](_0xa4e8('0x12'),_0x38ba1f,_0x280a51[_0xa4e8('0x10')][_0xa4e8('0x13')]);return _0x281c85(_0x280a51[_0xa4e8('0x10')][_0xa4e8('0x13')]);}logger[_0xa4e8('0x10')](_0xa4e8('0x12'),_0x38ba1f,_0x280a51['error']['message']);return _0x3d3225(_0x280a51[_0xa4e8('0x10')][_0xa4e8('0x13')]);}else{logger['info'](_0xa4e8('0x12'),_0x38ba1f,_0xa4e8('0xc'));_0x3d3225(_0x280a51[_0xa4e8('0x14')][_0xa4e8('0x13')]);}})[_0xa4e8('0x15')](function(_0x55e046){logger[_0xa4e8('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x38ba1f,_0x55e046);_0x281c85(_0x55e046);});});}exports[_0xa4e8('0x16')]=function(_0x3d32eb){var _0x2bf15d=this;return new Promise(function(_0x3f6957,_0x239159){return db['SquareOdbc'][_0xa4e8('0x17')]({'raw':_0x3d32eb['options']?_0x3d32eb[_0xa4e8('0x18')][_0xa4e8('0x19')]===undefined?!![]:![]:!![],'where':_0x3d32eb[_0xa4e8('0x18')]?_0x3d32eb[_0xa4e8('0x18')][_0xa4e8('0x1a')]||null:null,'attributes':_0x3d32eb['options']?_0x3d32eb['options'][_0xa4e8('0x1b')]||null:null,'include':_0x3d32eb[_0xa4e8('0x18')]?_0x3d32eb[_0xa4e8('0x18')][_0xa4e8('0x1c')]?_[_0xa4e8('0x1d')](_0x3d32eb['options'][_0xa4e8('0x1c')],function(_0x22969f){return{'model':db[_0x22969f[_0xa4e8('0x1e')]],'as':_0x22969f['as'],'attributes':_0x22969f[_0xa4e8('0x1b')],'include':_0x22969f[_0xa4e8('0x1c')]?_[_0xa4e8('0x1d')](_0x22969f[_0xa4e8('0x1c')],function(_0x2ffc0a){return{'model':db[_0x2ffc0a[_0xa4e8('0x1e')]],'as':_0x2ffc0a['as'],'attributes':_0x2ffc0a[_0xa4e8('0x1b')],'include':_0x2ffc0a[_0xa4e8('0x1c')]?_[_0xa4e8('0x1d')](_0x2ffc0a[_0xa4e8('0x1c')],function(_0xf33cf){return{'model':db[_0xf33cf[_0xa4e8('0x1e')]],'as':_0xf33cf['as'],'attributes':_0xf33cf['attributes']};}):[]};}):[]};}):[]:[]})[_0xa4e8('0xa')](function(_0x40c6d6){logger['info']('ShowSquareOdbc',_0x3d32eb);logger[_0xa4e8('0xd')](_0xa4e8('0x16'),_0x3d32eb,JSON[_0xa4e8('0xf')](_0x40c6d6));_0x3f6957(_0x40c6d6);})['catch'](function(_0x2e5ee7){logger[_0xa4e8('0x10')]('ShowSquareOdbc',_0x2e5ee7['message'],_0x3d32eb);_0x239159(_0x2bf15d['error'](0x1f4,_0x2e5ee7[_0xa4e8('0x13')]));});});}; \ No newline at end of file +var _0x70db=['request\x20sent','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','SquareOdbc,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x33593e,_0x22ddd3){var _0x53db1a=function(_0x499ee5){while(--_0x499ee5){_0x33593e['push'](_0x33593e['shift']());}};_0x53db1a(++_0x22ddd3);}(_0x70db,0x8a));var _0xb70d=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x70db[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0xb70d('0x0'));var util=require(_0xb70d('0x1'));var moment=require(_0xb70d('0x2'));var BPromise=require(_0xb70d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb70d('0x4'))['db'];var utils=require(_0xb70d('0x5'));var logger=require(_0xb70d('0x6'))(_0xb70d('0x7'));var config=require('../../config/environment');var jayson=require(_0xb70d('0x8'));var client=jayson['client'][_0xb70d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x163a3c,_0x4ba26a,_0x1373a6){return new BPromise(function(_0x2b2b1c,_0x45de9a){return client['request'](_0x163a3c,_0x1373a6)[_0xb70d('0xa')](function(_0x2a52cf){logger[_0xb70d('0xb')](_0xb70d('0xc'),_0x4ba26a,'request\x20sent');logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x4ba26a,'request\x20sent',JSON[_0xb70d('0xd')](_0x2a52cf));if(_0x2a52cf[_0xb70d('0xe')]){if(_0x2a52cf[_0xb70d('0xe')][_0xb70d('0xf')]===0x1f4){logger[_0xb70d('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x4ba26a,_0x2a52cf[_0xb70d('0xe')][_0xb70d('0x10')]);return _0x45de9a(_0x2a52cf[_0xb70d('0xe')]['message']);}logger[_0xb70d('0xe')](_0xb70d('0xc'),_0x4ba26a,_0x2a52cf[_0xb70d('0xe')][_0xb70d('0x10')]);return _0x2b2b1c(_0x2a52cf[_0xb70d('0xe')][_0xb70d('0x10')]);}else{logger[_0xb70d('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x4ba26a,_0xb70d('0x11'));_0x2b2b1c(_0x2a52cf[_0xb70d('0x12')][_0xb70d('0x10')]);}})[_0xb70d('0x13')](function(_0x2c0691){logger[_0xb70d('0xe')](_0xb70d('0xc'),_0x4ba26a,_0x2c0691);_0x45de9a(_0x2c0691);});});}exports[_0xb70d('0x14')]=function(_0x102ae7){var _0x419609=this;return new Promise(function(_0x458767,_0x58386c){return db[_0xb70d('0x15')][_0xb70d('0x16')]({'raw':_0x102ae7[_0xb70d('0x17')]?_0x102ae7['options'][_0xb70d('0x18')]===undefined?!![]:![]:!![],'where':_0x102ae7[_0xb70d('0x17')]?_0x102ae7[_0xb70d('0x17')][_0xb70d('0x19')]||null:null,'attributes':_0x102ae7[_0xb70d('0x17')]?_0x102ae7[_0xb70d('0x17')][_0xb70d('0x1a')]||null:null,'include':_0x102ae7['options']?_0x102ae7[_0xb70d('0x17')][_0xb70d('0x1b')]?_[_0xb70d('0x1c')](_0x102ae7[_0xb70d('0x17')][_0xb70d('0x1b')],function(_0x2c2690){return{'model':db[_0x2c2690[_0xb70d('0x1d')]],'as':_0x2c2690['as'],'attributes':_0x2c2690[_0xb70d('0x1a')],'include':_0x2c2690[_0xb70d('0x1b')]?_[_0xb70d('0x1c')](_0x2c2690[_0xb70d('0x1b')],function(_0x55b9f1){return{'model':db[_0x55b9f1[_0xb70d('0x1d')]],'as':_0x55b9f1['as'],'attributes':_0x55b9f1[_0xb70d('0x1a')],'include':_0x55b9f1[_0xb70d('0x1b')]?_[_0xb70d('0x1c')](_0x55b9f1[_0xb70d('0x1b')],function(_0x41a5ab){return{'model':db[_0x41a5ab[_0xb70d('0x1d')]],'as':_0x41a5ab['as'],'attributes':_0x41a5ab[_0xb70d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb70d('0xa')](function(_0x27a205){logger[_0xb70d('0xb')](_0xb70d('0x14'),_0x102ae7);logger[_0xb70d('0x1e')](_0xb70d('0x14'),_0x102ae7,JSON[_0xb70d('0xd')](_0x27a205));_0x458767(_0x27a205);})['catch'](function(_0x424cf7){logger[_0xb70d('0xe')](_0xb70d('0x14'),_0x424cf7[_0xb70d('0x10')],_0x102ae7);_0x58386c(_0x419609[_0xb70d('0xe')](0x1f4,_0x424cf7['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 7b0c828..cc80eca 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 _0x17db=['../../config/environment','get','isAuthenticated','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x17db,0x13d));var _0xb17d=function(_0x86cf05,_0x5d5440){_0x86cf05=_0x86cf05-0x0;var _0x36a982=_0x17db[_0x86cf05];return _0x36a982;};'use strict';var multer=require(_0xb17d('0x0'));var util=require(_0xb17d('0x1'));var path=require(_0xb17d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb17d('0x3')]();var fs_extra=require(_0xb17d('0x4'));var auth=require(_0xb17d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb17d('0x6'));var controller=require('./squareProject.controller');router[_0xb17d('0x7')]('/',auth[_0xb17d('0x8')](),controller['index']);router[_0xb17d('0x7')]('/:id',auth[_0xb17d('0x8')](),controller['show']);router[_0xb17d('0x9')]('/',auth[_0xb17d('0x8')](),controller[_0xb17d('0xa')]);router[_0xb17d('0xb')]('/:id',auth[_0xb17d('0x8')](),controller[_0xb17d('0xc')]);router[_0xb17d('0xd')](_0xb17d('0xe'),auth[_0xb17d('0x8')](),controller[_0xb17d('0xf')]);module[_0xb17d('0x10')]=router; \ No newline at end of file +var _0x5d20=['destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','put','update','delete'];(function(_0x1e9ae1,_0x10dc5d){var _0xc6bc15=function(_0x1a6a7d){while(--_0x1a6a7d){_0x1e9ae1['push'](_0x1e9ae1['shift']());}};_0xc6bc15(++_0x10dc5d);}(_0x5d20,0xb6));var _0x05d2=function(_0x238fc1,_0x5257c0){_0x238fc1=_0x238fc1-0x0;var _0x5e8351=_0x5d20[_0x238fc1];return _0x5e8351;};'use strict';var multer=require(_0x05d2('0x0'));var util=require(_0x05d2('0x1'));var path=require(_0x05d2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x05d2('0x3'));var auth=require(_0x05d2('0x4'));var interaction=require(_0x05d2('0x5'));var config=require(_0x05d2('0x6'));var controller=require(_0x05d2('0x7'));router[_0x05d2('0x8')]('/',auth[_0x05d2('0x9')](),controller[_0x05d2('0xa')]);router['get'](_0x05d2('0xb'),auth[_0x05d2('0x9')](),controller[_0x05d2('0xc')]);router['post']('/',auth[_0x05d2('0x9')](),controller['create']);router[_0x05d2('0xd')](_0x05d2('0xb'),auth[_0x05d2('0x9')](),controller[_0x05d2('0xe')]);router[_0x05d2('0xf')](_0x05d2('0xb'),auth[_0x05d2('0x9')](),controller[_0x05d2('0x10')]);module[_0x05d2('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index a3c5819..3a40477 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 _0x21eb=['preproduction','production','utf8','DATE','sequelize','exports','STRING','name','TEXT','long','getDataValue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x21eb,0x190));var _0xb21e=function(_0x447c4e,_0x5e3359){_0x447c4e=_0x447c4e-0x0;var _0x2feb5a=_0x21eb[_0x447c4e];return _0x2feb5a;};'use strict';var Sequelize=require(_0xb21e('0x0'));module[_0xb21e('0x1')]={'name':{'type':Sequelize[_0xb21e('0x2')],'unique':_0xb21e('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0xb21e('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0xb21e('0x5')),'get':function(){if(this[_0xb21e('0x6')](_0xb21e('0x7'))){return this[_0xb21e('0x6')](_0xb21e('0x7'))['toString']('utf8');}}},'production':{'type':Sequelize['BLOB'](_0xb21e('0x5')),'get':function(){if(this[_0xb21e('0x6')](_0xb21e('0x8'))){return this[_0xb21e('0x6')](_0xb21e('0x8'))['toString'](_0xb21e('0x9'));}}},'savedAt':{'type':Sequelize[_0xb21e('0xa')]},'publishedAt':{'type':Sequelize[_0xb21e('0xa')]}}; \ No newline at end of file +var _0x9918=['sequelize','exports','name','STRING','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE'];(function(_0x40f31d,_0x166318){var _0x10d4e4=function(_0x427148){while(--_0x427148){_0x40f31d['push'](_0x40f31d['shift']());}};_0x10d4e4(++_0x166318);}(_0x9918,0x186));var _0x8991=function(_0x127d68,_0x44b77b){_0x127d68=_0x127d68-0x0;var _0xa5a78b=_0x9918[_0x127d68];return _0xa5a78b;};'use strict';var Sequelize=require(_0x8991('0x0'));module[_0x8991('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8991('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x8991('0x3')]},'notes':{'type':Sequelize[_0x8991('0x4')]},'preproduction':{'type':Sequelize[_0x8991('0x5')](_0x8991('0x6')),'get':function(){if(this[_0x8991('0x7')](_0x8991('0x8'))){return this[_0x8991('0x7')](_0x8991('0x8'))[_0x8991('0x9')](_0x8991('0xa'));}}},'production':{'type':Sequelize[_0x8991('0x5')](_0x8991('0x6')),'get':function(){if(this['getDataValue']('production')){return this['getDataValue'](_0x8991('0xb'))[_0x8991('0x9')]('utf8');}}},'savedAt':{'type':Sequelize[_0x8991('0xc')]},'publishedAt':{'type':Sequelize[_0x8991('0xc')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index b241ca3..c430bb2 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 _0xad4a=['ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','status','json','offset','undefined','count','limit','set','Content-Range','then','destroy','SquareProjects','publish','agi','end','error','name','map','fieldName','type','key','model','keys','query','filters','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','SquareProject','includeAll','include','findAll','rows','params','rawAttributes','intersection','fields','find','catch','create','role','get','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','stringify','production','lodash'];(function(_0x55a860,_0x37a53f){var _0x1d3867=function(_0x374ffe){while(--_0x374ffe){_0x55a860['push'](_0x55a860['shift']());}};_0x1d3867(++_0x37a53f);}(_0xad4a,0x149));var _0xaad4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xad4a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xaad4('0x0'));var Redis=require(_0xaad4('0x1'));var qs=require(_0xaad4('0x2'));var logger=require(_0xaad4('0x3'))(_0xaad4('0x4'));var config=require(_0xaad4('0x5'));var db=require(_0xaad4('0x6'))['db'];config[_0xaad4('0x7')]=_['defaults'](config[_0xaad4('0x7')],{'host':_0xaad4('0x8'),'port':0x18eb});var socket=require(_0xaad4('0x9'))(new Redis(config['redis']));require(_0xaad4('0xa'))['register'](socket);function respondWithResult(_0xd896c,_0x5deda8){_0x5deda8=_0x5deda8||0xc8;return function(_0x29e10d){if(_0x29e10d){return _0xd896c[_0xaad4('0xb')](_0x5deda8)[_0xaad4('0xc')](_0x29e10d);}};}function respondWithFilteredResult(_0x215391,_0x745a08){return function(_0x339a3f){if(_0x339a3f){var _0x2a05f6=typeof _0x745a08[_0xaad4('0xd')]===_0xaad4('0xe')&&typeof _0x745a08['limit']===_0xaad4('0xe');var _0x2dcb1b=_0x339a3f['count'];var _0x1e61b8=_0x2a05f6?0x0:_0x745a08['offset'];var _0x2b8a95=_0x2a05f6?_0x339a3f[_0xaad4('0xf')]:_0x745a08[_0xaad4('0xd')]+_0x745a08[_0xaad4('0x10')];var _0x5b5f94;if(_0x2b8a95>=_0x2dcb1b){_0x2b8a95=_0x2dcb1b;_0x5b5f94=0xc8;}else{_0x5b5f94=0xce;}_0x215391[_0xaad4('0xb')](_0x5b5f94);return _0x215391[_0xaad4('0x11')](_0xaad4('0x12'),_0x1e61b8+'-'+_0x2b8a95+'/'+_0x2dcb1b)[_0xaad4('0xc')](_0x339a3f);}return null;};}function saveUpdates(_0x5bfd9b){return function(_0x257416){if(_0x257416){return _0x257416['update'](_0x5bfd9b)[_0xaad4('0x13')](function(_0x2985c6){return _0x2985c6;});}return null;};}function removeEntity(_0x559ff9){return function(_0x3815bf){if(_0x3815bf){return _0x3815bf[_0xaad4('0x14')]()[_0xaad4('0x13')](function(){var _0x598160=_0x3815bf['get']({'plain':!![]});var _0x24e764=_0xaad4('0x15');return db['UserProfileResource'][_0xaad4('0x14')]({'where':{'type':_0x24e764,'resourceId':_0x598160['id']}})[_0xaad4('0x13')](function(){return _0x3815bf;});})[_0xaad4('0x13')](function(){var _0x1bfff3=new Redis(config[_0xaad4('0x7')]);_0x1bfff3[_0xaad4('0x16')](_0xaad4('0x17'),JSON['stringify']({'id':_0x3815bf['id'],'deleted':!![]}));})['then'](function(){_0x559ff9['status'](0xcc)[_0xaad4('0x18')]();});}};}function handleEntityNotFound(_0x18f59e){return function(_0x28716b){if(!_0x28716b){_0x18f59e['sendStatus'](0x194);}return _0x28716b;};}function handleError(_0x5d8130,_0x16b65a){_0x16b65a=_0x16b65a||0x1f4;return function(_0x3d47fd){logger[_0xaad4('0x19')](_0x3d47fd['stack']);if(_0x3d47fd[_0xaad4('0x1a')]){delete _0x3d47fd[_0xaad4('0x1a')];}_0x5d8130[_0xaad4('0xb')](_0x16b65a)['send'](_0x3d47fd);};}exports['index']=function(_0xbc6047,_0xa5507b){var _0x4bf0d6={},_0x2e459d={},_0x35ac4a={'count':0x0,'rows':[]};var _0x5694c8=_[_0xaad4('0x1b')](db['SquareProject']['rawAttributes'],function(_0x26d98d){return{'name':_0x26d98d[_0xaad4('0x1c')],'type':_0x26d98d[_0xaad4('0x1d')][_0xaad4('0x1e')]};});_0x2e459d[_0xaad4('0x1f')]=_[_0xaad4('0x1b')](_0x5694c8,_0xaad4('0x1a'));_0x2e459d['query']=_[_0xaad4('0x20')](_0xbc6047[_0xaad4('0x21')]);_0x2e459d[_0xaad4('0x22')]=_['intersection'](_0x2e459d[_0xaad4('0x1f')],_0x2e459d['query']);_0x4bf0d6[_0xaad4('0x23')]=_['intersection'](_0x2e459d[_0xaad4('0x1f')],qs['fields'](_0xbc6047[_0xaad4('0x21')]['fields']));_0x4bf0d6[_0xaad4('0x23')]=_0x4bf0d6[_0xaad4('0x23')]['length']?_0x4bf0d6['attributes']:_0x2e459d['model'];if(!_0xbc6047['query'][_0xaad4('0x24')](_0xaad4('0x25'))){_0x4bf0d6[_0xaad4('0x10')]=qs[_0xaad4('0x10')](_0xbc6047[_0xaad4('0x21')][_0xaad4('0x10')]);_0x4bf0d6[_0xaad4('0xd')]=qs[_0xaad4('0xd')](_0xbc6047[_0xaad4('0x21')][_0xaad4('0xd')]);}_0x4bf0d6[_0xaad4('0x26')]=qs['sort'](_0xbc6047[_0xaad4('0x21')][_0xaad4('0x27')]);_0x4bf0d6['where']=qs['filters'](_[_0xaad4('0x28')](_0xbc6047['query'],_0x2e459d['filters']),_0x5694c8);if(_0xbc6047['query'][_0xaad4('0x29')]){_0x4bf0d6[_0xaad4('0x2a')]=_[_0xaad4('0x2b')](_0x4bf0d6['where'],{'$or':_[_0xaad4('0x1b')](_0x5694c8,function(_0x198256){if(_0x198256[_0xaad4('0x1d')]!==_0xaad4('0x2c')){var _0x1a34bf={};_0x1a34bf[_0x198256[_0xaad4('0x1a')]]={'$like':'%'+_0xbc6047[_0xaad4('0x21')][_0xaad4('0x29')]+'%'};return _0x1a34bf;}})});}_0x4bf0d6=_[_0xaad4('0x2b')]({},_0x4bf0d6,_0xbc6047[_0xaad4('0x2d')]);var _0x40e5d3={'where':_0x4bf0d6[_0xaad4('0x2a')]};return db[_0xaad4('0x2e')][_0xaad4('0xf')](_0x40e5d3)[_0xaad4('0x13')](function(_0x4994c4){_0x35ac4a[_0xaad4('0xf')]=_0x4994c4;if(_0xbc6047[_0xaad4('0x21')][_0xaad4('0x2f')]){_0x4bf0d6[_0xaad4('0x30')]=[{'all':!![]}];}return db['SquareProject'][_0xaad4('0x31')](_0x4bf0d6);})['then'](function(_0xe53fc8){_0x35ac4a[_0xaad4('0x32')]=_0xe53fc8;return _0x35ac4a;})[_0xaad4('0x13')](respondWithFilteredResult(_0xa5507b,_0x4bf0d6))['catch'](handleError(_0xa5507b,null));};exports['show']=function(_0x399047,_0x1cedf2){var _0x4a26ba={'raw':![],'where':{'id':_0x399047[_0xaad4('0x33')]['id']}},_0x379f23={};_0x379f23[_0xaad4('0x1f')]=_[_0xaad4('0x20')](db[_0xaad4('0x2e')][_0xaad4('0x34')]);_0x379f23[_0xaad4('0x21')]=_[_0xaad4('0x20')](_0x399047[_0xaad4('0x21')]);_0x379f23[_0xaad4('0x22')]=_[_0xaad4('0x35')](_0x379f23[_0xaad4('0x1f')],_0x379f23[_0xaad4('0x21')]);_0x4a26ba['attributes']=_['intersection'](_0x379f23['model'],qs['fields'](_0x399047[_0xaad4('0x21')][_0xaad4('0x36')]));_0x4a26ba[_0xaad4('0x23')]=_0x4a26ba[_0xaad4('0x23')]['length']?_0x4a26ba[_0xaad4('0x23')]:_0x379f23[_0xaad4('0x1f')];if(_0x399047[_0xaad4('0x21')][_0xaad4('0x2f')]){_0x4a26ba[_0xaad4('0x30')]=[{'all':!![]}];}_0x4a26ba=_[_0xaad4('0x2b')]({},_0x4a26ba,_0x399047[_0xaad4('0x2d')]);return db[_0xaad4('0x2e')][_0xaad4('0x37')](_0x4a26ba)[_0xaad4('0x13')](handleEntityNotFound(_0x1cedf2,null))[_0xaad4('0x13')](respondWithResult(_0x1cedf2,null))[_0xaad4('0x38')](handleError(_0x1cedf2,null));};exports[_0xaad4('0x39')]=function(_0x20003c,_0x19362a){return db[_0xaad4('0x2e')][_0xaad4('0x39')](_0x20003c['body'],{})[_0xaad4('0x13')](function(_0x27015e){var _0x396db8=_0x20003c['user']['get']({'plain':!![]});if(!_0x396db8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x396db8[_0xaad4('0x3a')]==='user'){var _0x540fb3=_0x27015e[_0xaad4('0x3b')]({'plain':!![]});var _0x375048='SquareProjects';return db['UserProfileSection'][_0xaad4('0x37')]({'where':{'name':_0x375048,'userProfileId':_0x396db8['userProfileId']},'raw':!![]})[_0xaad4('0x13')](function(_0x480e03){if(_0x480e03&&_0x480e03[_0xaad4('0x3c')]===0x0){return db[_0xaad4('0x3d')][_0xaad4('0x39')]({'name':_0x540fb3[_0xaad4('0x1a')],'resourceId':_0x540fb3['id'],'type':_0x480e03[_0xaad4('0x1a')],'sectionId':_0x480e03['id']},{})[_0xaad4('0x13')](function(){return _0x27015e;});}else{return _0x27015e;}})[_0xaad4('0x38')](function(_0x14dcfb){logger[_0xaad4('0x19')](_0xaad4('0x3e'),_0x14dcfb);throw _0x14dcfb;});}return _0x27015e;})[_0xaad4('0x13')](respondWithResult(_0x19362a,0xc9))['catch'](handleError(_0x19362a,null));};exports['update']=function(_0x2f22fc,_0x24ddca){if(_0x2f22fc['body']['id']){delete _0x2f22fc[_0xaad4('0x3f')]['id'];}return db[_0xaad4('0x2e')][_0xaad4('0x37')]({'where':{'id':_0x2f22fc[_0xaad4('0x33')]['id']}})['then'](handleEntityNotFound(_0x24ddca,null))[_0xaad4('0x13')](saveUpdates(_0x2f22fc[_0xaad4('0x3f')],null))[_0xaad4('0x13')](function(_0x37faca){if(!_0x37faca)return;var _0x1d105d=_0x37faca['get']({'plain':!![]});return _0x1d105d;})[_0xaad4('0x13')](function(_0x3a81f1){var _0x4a6a78=new Redis(config[_0xaad4('0x7')]);_0x4a6a78[_0xaad4('0x16')](_0xaad4('0x17'),JSON[_0xaad4('0x40')](_[_0xaad4('0x28')](_0x3a81f1,['id',_0xaad4('0x1a'),_0xaad4('0x41')])));return _0x3a81f1;})[_0xaad4('0x13')](respondWithResult(_0x24ddca,null))[_0xaad4('0x38')](handleError(_0x24ddca,null));};exports[_0xaad4('0x14')]=function(_0x526437,_0x586891){return db[_0xaad4('0x2e')][_0xaad4('0x37')]({'where':{'id':_0x526437[_0xaad4('0x33')]['id']}})[_0xaad4('0x13')](handleEntityNotFound(_0x586891,null))['then'](removeEntity(_0x586891,null))[_0xaad4('0x38')](handleError(_0x586891,null));}; \ No newline at end of file +var _0x37fa=['stack','name','send','SquareProject','fieldName','type','model','map','query','keys','filters','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','params','attributes','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','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./squareProject.socket','register','json','undefined','limit','count','offset','status','set','update','then','destroy','get','SquareProjects','UserProfileResource','publish','agi','stringify','end','error'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x37fa,0x1bf));var _0xa37f=function(_0x29af39,_0x343c56){_0x29af39=_0x29af39-0x0;var _0x3ab715=_0x37fa[_0x29af39];return _0x3ab715;};'use strict';var _=require(_0xa37f('0x0'));var Redis=require(_0xa37f('0x1'));var qs=require(_0xa37f('0x2'));var logger=require(_0xa37f('0x3'))(_0xa37f('0x4'));var config=require(_0xa37f('0x5'));var db=require(_0xa37f('0x6'))['db'];config[_0xa37f('0x7')]=_['defaults'](config[_0xa37f('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xa37f('0x8'))(new Redis(config[_0xa37f('0x7')]));require(_0xa37f('0x9'))[_0xa37f('0xa')](socket);function respondWithResult(_0x1c6d70,_0x51ddc8){_0x51ddc8=_0x51ddc8||0xc8;return function(_0x1280ca){if(_0x1280ca){return _0x1c6d70['status'](_0x51ddc8)[_0xa37f('0xb')](_0x1280ca);}};}function respondWithFilteredResult(_0x1659fd,_0x1b7e80){return function(_0x170bcc){if(_0x170bcc){var _0x246ec5=typeof _0x1b7e80['offset']===_0xa37f('0xc')&&typeof _0x1b7e80[_0xa37f('0xd')]===_0xa37f('0xc');var _0x1a85a9=_0x170bcc[_0xa37f('0xe')];var _0x8f728e=_0x246ec5?0x0:_0x1b7e80[_0xa37f('0xf')];var _0x17b3d3=_0x246ec5?_0x170bcc[_0xa37f('0xe')]:_0x1b7e80[_0xa37f('0xf')]+_0x1b7e80[_0xa37f('0xd')];var _0x2367d3;if(_0x17b3d3>=_0x1a85a9){_0x17b3d3=_0x1a85a9;_0x2367d3=0xc8;}else{_0x2367d3=0xce;}_0x1659fd[_0xa37f('0x10')](_0x2367d3);return _0x1659fd[_0xa37f('0x11')]('Content-Range',_0x8f728e+'-'+_0x17b3d3+'/'+_0x1a85a9)[_0xa37f('0xb')](_0x170bcc);}return null;};}function saveUpdates(_0x4842b7){return function(_0x4ee593){if(_0x4ee593){return _0x4ee593[_0xa37f('0x12')](_0x4842b7)[_0xa37f('0x13')](function(_0x90a6cb){return _0x90a6cb;});}return null;};}function removeEntity(_0x23a9c4){return function(_0x404689){if(_0x404689){return _0x404689[_0xa37f('0x14')]()[_0xa37f('0x13')](function(){var _0x43b962=_0x404689[_0xa37f('0x15')]({'plain':!![]});var _0x191894=_0xa37f('0x16');return db[_0xa37f('0x17')]['destroy']({'where':{'type':_0x191894,'resourceId':_0x43b962['id']}})[_0xa37f('0x13')](function(){return _0x404689;});})[_0xa37f('0x13')](function(){var _0x50fcf9=new Redis(config[_0xa37f('0x7')]);_0x50fcf9[_0xa37f('0x18')](_0xa37f('0x19'),JSON[_0xa37f('0x1a')]({'id':_0x404689['id'],'deleted':!![]}));})[_0xa37f('0x13')](function(){_0x23a9c4[_0xa37f('0x10')](0xcc)[_0xa37f('0x1b')]();});}};}function handleEntityNotFound(_0x956707){return function(_0x45bf21){if(!_0x45bf21){_0x956707['sendStatus'](0x194);}return _0x45bf21;};}function handleError(_0x56b1b1,_0x3a1cb4){_0x3a1cb4=_0x3a1cb4||0x1f4;return function(_0x429966){logger[_0xa37f('0x1c')](_0x429966[_0xa37f('0x1d')]);if(_0x429966[_0xa37f('0x1e')]){delete _0x429966[_0xa37f('0x1e')];}_0x56b1b1['status'](_0x3a1cb4)[_0xa37f('0x1f')](_0x429966);};}exports['index']=function(_0x4f8f93,_0x1f4c15){var _0x23f561={},_0x2cdd56={},_0x529211={'count':0x0,'rows':[]};var _0x344a54=_['map'](db[_0xa37f('0x20')]['rawAttributes'],function(_0x1fdfc5){return{'name':_0x1fdfc5[_0xa37f('0x21')],'type':_0x1fdfc5[_0xa37f('0x22')]['key']};});_0x2cdd56[_0xa37f('0x23')]=_[_0xa37f('0x24')](_0x344a54,_0xa37f('0x1e'));_0x2cdd56[_0xa37f('0x25')]=_[_0xa37f('0x26')](_0x4f8f93[_0xa37f('0x25')]);_0x2cdd56[_0xa37f('0x27')]=_['intersection'](_0x2cdd56[_0xa37f('0x23')],_0x2cdd56[_0xa37f('0x25')]);_0x23f561['attributes']=_[_0xa37f('0x28')](_0x2cdd56[_0xa37f('0x23')],qs[_0xa37f('0x29')](_0x4f8f93['query'][_0xa37f('0x29')]));_0x23f561['attributes']=_0x23f561['attributes'][_0xa37f('0x2a')]?_0x23f561['attributes']:_0x2cdd56[_0xa37f('0x23')];if(!_0x4f8f93[_0xa37f('0x25')][_0xa37f('0x2b')]('nolimit')){_0x23f561[_0xa37f('0xd')]=qs[_0xa37f('0xd')](_0x4f8f93[_0xa37f('0x25')][_0xa37f('0xd')]);_0x23f561['offset']=qs[_0xa37f('0xf')](_0x4f8f93[_0xa37f('0x25')][_0xa37f('0xf')]);}_0x23f561[_0xa37f('0x2c')]=qs[_0xa37f('0x2d')](_0x4f8f93[_0xa37f('0x25')]['sort']);_0x23f561[_0xa37f('0x2e')]=qs[_0xa37f('0x27')](_['pick'](_0x4f8f93[_0xa37f('0x25')],_0x2cdd56[_0xa37f('0x27')]),_0x344a54);if(_0x4f8f93[_0xa37f('0x25')][_0xa37f('0x2f')]){_0x23f561[_0xa37f('0x2e')]=_[_0xa37f('0x30')](_0x23f561[_0xa37f('0x2e')],{'$or':_[_0xa37f('0x24')](_0x344a54,function(_0x4d533d){if(_0x4d533d['type']!=='VIRTUAL'){var _0x35a74f={};_0x35a74f[_0x4d533d[_0xa37f('0x1e')]]={'$like':'%'+_0x4f8f93[_0xa37f('0x25')][_0xa37f('0x2f')]+'%'};return _0x35a74f;}})});}_0x23f561=_[_0xa37f('0x30')]({},_0x23f561,_0x4f8f93['options']);var _0x3a5935={'where':_0x23f561[_0xa37f('0x2e')]};return db['SquareProject'][_0xa37f('0xe')](_0x3a5935)[_0xa37f('0x13')](function(_0x5d69df){_0x529211['count']=_0x5d69df;if(_0x4f8f93[_0xa37f('0x25')][_0xa37f('0x31')]){_0x23f561[_0xa37f('0x32')]=[{'all':!![]}];}return db[_0xa37f('0x20')][_0xa37f('0x33')](_0x23f561);})[_0xa37f('0x13')](function(_0x32b669){_0x529211[_0xa37f('0x34')]=_0x32b669;return _0x529211;})[_0xa37f('0x13')](respondWithFilteredResult(_0x1f4c15,_0x23f561))[_0xa37f('0x35')](handleError(_0x1f4c15,null));};exports['show']=function(_0x446608,_0x4488c9){var _0x1c35da={'raw':![],'where':{'id':_0x446608[_0xa37f('0x36')]['id']}},_0x4c87ea={};_0x4c87ea[_0xa37f('0x23')]=_[_0xa37f('0x26')](db[_0xa37f('0x20')]['rawAttributes']);_0x4c87ea[_0xa37f('0x25')]=_['keys'](_0x446608[_0xa37f('0x25')]);_0x4c87ea[_0xa37f('0x27')]=_[_0xa37f('0x28')](_0x4c87ea['model'],_0x4c87ea[_0xa37f('0x25')]);_0x1c35da[_0xa37f('0x37')]=_[_0xa37f('0x28')](_0x4c87ea['model'],qs[_0xa37f('0x29')](_0x446608[_0xa37f('0x25')]['fields']));_0x1c35da[_0xa37f('0x37')]=_0x1c35da['attributes']['length']?_0x1c35da[_0xa37f('0x37')]:_0x4c87ea[_0xa37f('0x23')];if(_0x446608['query'][_0xa37f('0x31')]){_0x1c35da[_0xa37f('0x32')]=[{'all':!![]}];}_0x1c35da=_[_0xa37f('0x30')]({},_0x1c35da,_0x446608[_0xa37f('0x38')]);return db[_0xa37f('0x20')][_0xa37f('0x39')](_0x1c35da)[_0xa37f('0x13')](handleEntityNotFound(_0x4488c9,null))[_0xa37f('0x13')](respondWithResult(_0x4488c9,null))[_0xa37f('0x35')](handleError(_0x4488c9,null));};exports[_0xa37f('0x3a')]=function(_0x5cfaee,_0x55401b){return db['SquareProject'][_0xa37f('0x3a')](_0x5cfaee[_0xa37f('0x3b')],{})[_0xa37f('0x13')](function(_0x152174){var _0x597164=_0x5cfaee[_0xa37f('0x3c')]['get']({'plain':!![]});if(!_0x597164)throw new Error(_0xa37f('0x3d'));if(_0x597164[_0xa37f('0x3e')]===_0xa37f('0x3c')){var _0x44fcb3=_0x152174['get']({'plain':!![]});var _0x665423='SquareProjects';return db[_0xa37f('0x3f')][_0xa37f('0x39')]({'where':{'name':_0x665423,'userProfileId':_0x597164[_0xa37f('0x40')]},'raw':!![]})[_0xa37f('0x13')](function(_0x247e8f){if(_0x247e8f&&_0x247e8f[_0xa37f('0x41')]===0x0){return db[_0xa37f('0x17')]['create']({'name':_0x44fcb3[_0xa37f('0x1e')],'resourceId':_0x44fcb3['id'],'type':_0x247e8f['name'],'sectionId':_0x247e8f['id']},{})['then'](function(){return _0x152174;});}else{return _0x152174;}})['catch'](function(_0x5ab7c2){logger[_0xa37f('0x1c')](_0xa37f('0x42'),_0x5ab7c2);throw _0x5ab7c2;});}return _0x152174;})[_0xa37f('0x13')](respondWithResult(_0x55401b,0xc9))[_0xa37f('0x35')](handleError(_0x55401b,null));};exports[_0xa37f('0x12')]=function(_0x35dbef,_0x1f9ac2){if(_0x35dbef[_0xa37f('0x3b')]['id']){delete _0x35dbef[_0xa37f('0x3b')]['id'];}return db[_0xa37f('0x20')][_0xa37f('0x39')]({'where':{'id':_0x35dbef[_0xa37f('0x36')]['id']}})[_0xa37f('0x13')](handleEntityNotFound(_0x1f9ac2,null))[_0xa37f('0x13')](saveUpdates(_0x35dbef[_0xa37f('0x3b')],null))['then'](function(_0x63fd5d){if(!_0x63fd5d)return;var _0x49af26=_0x63fd5d[_0xa37f('0x15')]({'plain':!![]});return _0x49af26;})[_0xa37f('0x13')](function(_0x23a4db){var _0x39658b=new Redis(config[_0xa37f('0x7')]);_0x39658b[_0xa37f('0x18')](_0xa37f('0x19'),JSON['stringify'](_['pick'](_0x23a4db,['id','name',_0xa37f('0x43')])));return _0x23a4db;})[_0xa37f('0x13')](respondWithResult(_0x1f9ac2,null))['catch'](handleError(_0x1f9ac2,null));};exports[_0xa37f('0x14')]=function(_0x5088b6,_0x4e675d){return db[_0xa37f('0x20')][_0xa37f('0x39')]({'where':{'id':_0x5088b6[_0xa37f('0x36')]['id']}})[_0xa37f('0x13')](handleEntityNotFound(_0x4e675d,null))[_0xa37f('0x13')](removeEntity(_0x4e675d,null))[_0xa37f('0x35')](handleError(_0x4e675d,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index f578368..6bda466 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 _0xa48f=['events','../../mysqldb','setMaxListeners','save','emit'];(function(_0x4c9922,_0x3d65c9){var _0xa5454f=function(_0x13db5a){while(--_0x13db5a){_0x4c9922['push'](_0x4c9922['shift']());}};_0xa5454f(++_0x3d65c9);}(_0xa48f,0x78));var _0xfa48=function(_0x53d6d0,_0x4f8469){_0x53d6d0=_0x53d6d0-0x0;var _0x221091=_0xa48f[_0x53d6d0];return _0x221091;};'use strict';var EventEmitter=require(_0xfa48('0x0'));var SquareProject=require(_0xfa48('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xfa48('0x2')](0x0);var events={'afterCreate':_0xfa48('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3641bf){return function(_0x10e655,_0x24a853,_0x17475b){SquareProjectEvents[_0xfa48('0x4')](_0x3641bf+':'+_0x10e655['id'],_0x10e655);SquareProjectEvents['emit'](_0x3641bf,_0x10e655);_0x17475b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0x314e=['../../mysqldb','SquareProject','setMaxListeners','save','update','emit','hook','exports','events'];(function(_0x42a085,_0x30817a){var _0x256817=function(_0x1cbed1){while(--_0x1cbed1){_0x42a085['push'](_0x42a085['shift']());}};_0x256817(++_0x30817a);}(_0x314e,0xe9));var _0xe314=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x314e[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xe314('0x0'));var SquareProject=require(_0xe314('0x1'))['db'][_0xe314('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xe314('0x3')](0x0);var events={'afterCreate':_0xe314('0x4'),'afterUpdate':_0xe314('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4078c3){return function(_0x5ea467,_0x126f04,_0x2ec853){SquareProjectEvents['emit'](_0x4078c3+':'+_0x5ea467['id'],_0x5ea467);SquareProjectEvents[_0xe314('0x6')](_0x4078c3,_0x5ea467);_0x2ec853(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xe314('0x7')](e,emitEvent(event));}}module[_0xe314('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index e512954..c7f08b1 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 _0x73bc=['../../config/logger','api','moment','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','square_projects','preproduction','changed','production','publishedAt','format','lodash','util'];(function(_0x4a43dc,_0x10302e){var _0x29066b=function(_0x4cb52c){while(--_0x4cb52c){_0x4a43dc['push'](_0x4a43dc['shift']());}};_0x29066b(++_0x10302e);}(_0x73bc,0xa8));var _0xc73b=function(_0x1de9d8,_0x30478b){_0x1de9d8=_0x1de9d8-0x0;var _0x32def9=_0x73bc[_0x1de9d8];return _0x32def9;};'use strict';var _=require(_0xc73b('0x0'));var util=require(_0xc73b('0x1'));var logger=require(_0xc73b('0x2'))(_0xc73b('0x3'));var moment=require(_0xc73b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc73b('0x5'));var rimraf=require(_0xc73b('0x6'));var config=require(_0xc73b('0x7'));var attributes=require(_0xc73b('0x8'));module[_0xc73b('0x9')]=function(_0x529a44,_0x244fec){return _0x529a44[_0xc73b('0xa')]('SquareProject',attributes,{'tableName':_0xc73b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x7a6d90,_0x257acb,_0x3bde91){if(_0x7a6d90['changed'](_0xc73b('0xc'))){_0x7a6d90['savedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x7a6d90[_0xc73b('0xd')](_0xc73b('0xe'))){_0x7a6d90[_0xc73b('0xf')]=moment()[_0xc73b('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3bde91(null,_0x7a6d90);}}});}; \ No newline at end of file +var _0x37a6=['../../config/environment','exports','define','square_projects','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','publishedAt','lodash','../../config/logger','api','bluebird','path','rimraf'];(function(_0x27fdcc,_0x421cb5){var _0x17c2de=function(_0x2fa372){while(--_0x2fa372){_0x27fdcc['push'](_0x27fdcc['shift']());}};_0x17c2de(++_0x421cb5);}(_0x37a6,0xae));var _0x637a=function(_0xd4b570,_0x57c71c){_0xd4b570=_0xd4b570-0x0;var _0x44d795=_0x37a6[_0xd4b570];return _0x44d795;};'use strict';var _=require(_0x637a('0x0'));var util=require('util');var logger=require(_0x637a('0x1'))(_0x637a('0x2'));var moment=require('moment');var BPromise=require(_0x637a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x637a('0x4'));var rimraf=require(_0x637a('0x5'));var config=require(_0x637a('0x6'));var attributes=require('./squareProject.attributes');module[_0x637a('0x7')]=function(_0x22c4d3,_0x43bd6d){return _0x22c4d3[_0x637a('0x8')]('SquareProject',attributes,{'tableName':_0x637a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4b7e92,_0x5c5b0a,_0x42cfaa){if(_0x4b7e92[_0x637a('0xa')](_0x637a('0xb'))){_0x4b7e92[_0x637a('0xc')]=moment()['format'](_0x637a('0xd'));}if(_0x4b7e92[_0x637a('0xa')]('production')){_0x4b7e92[_0x637a('0xe')]=moment()['format'](_0x637a('0xd'));}_0x42cfaa(null,_0x4b7e92);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 15abfb1..c6df2a5 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 _0x0bbd=['ioredis','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','GetSquareProjects','findAll','options','raw','where','attributes','include','map','model','debug','stringify','error','message','SquareProject','find','then','catch','ShowSquareProject'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x0bbd,0x129));var _0xd0bb=function(_0xbce3b4,_0x506fcd){_0xbce3b4=_0xbce3b4-0x0;var _0x3c1466=_0x0bbd[_0xbce3b4];return _0x3c1466;};'use strict';var _=require('lodash');var Redis=require(_0xd0bb('0x0'));var db=require('../../mysqldb')['db'];var logger=require(_0xd0bb('0x1'))(_0xd0bb('0x2'));var config=require(_0xd0bb('0x3'));config[_0xd0bb('0x4')]=_[_0xd0bb('0x5')](config[_0xd0bb('0x4')],{'host':_0xd0bb('0x6'),'port':0x18eb});var socket=require(_0xd0bb('0x7'))(new Redis(config['redis']));require(_0xd0bb('0x8'))['register'](socket);exports[_0xd0bb('0x9')]=function(_0x5090ce){var _0x1234bc=this;return new Promise(function(_0x5206fe,_0x2ac972){return db['SquareProject'][_0xd0bb('0xa')]({'raw':_0x5090ce[_0xd0bb('0xb')]?_0x5090ce['options'][_0xd0bb('0xc')]===undefined?!![]:![]:!![],'where':_0x5090ce[_0xd0bb('0xb')]?_0x5090ce[_0xd0bb('0xb')][_0xd0bb('0xd')]||null:null,'attributes':_0x5090ce[_0xd0bb('0xb')]?_0x5090ce[_0xd0bb('0xb')][_0xd0bb('0xe')]||null:null,'limit':_0x5090ce[_0xd0bb('0xb')]?_0x5090ce[_0xd0bb('0xb')]['limit']||null:null,'include':_0x5090ce[_0xd0bb('0xb')]?_0x5090ce[_0xd0bb('0xb')][_0xd0bb('0xf')]?_[_0xd0bb('0x10')](_0x5090ce[_0xd0bb('0xb')]['include'],function(_0x112ba6){return{'model':db[_0x112ba6[_0xd0bb('0x11')]],'as':_0x112ba6['as'],'attributes':_0x112ba6['attributes'],'include':_0x112ba6[_0xd0bb('0xf')]?_[_0xd0bb('0x10')](_0x112ba6[_0xd0bb('0xf')],function(_0x3470ea){return{'model':db[_0x3470ea['model']],'as':_0x3470ea['as'],'attributes':_0x3470ea['attributes'],'include':_0x3470ea['include']?_[_0xd0bb('0x10')](_0x3470ea['include'],function(_0x3810f5){return{'model':db[_0x3810f5[_0xd0bb('0x11')]],'as':_0x3810f5['as'],'attributes':_0x3810f5[_0xd0bb('0xe')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x529c96){logger['info'](_0xd0bb('0x9'),_0x5090ce);logger[_0xd0bb('0x12')](_0xd0bb('0x9'),_0x5090ce,JSON[_0xd0bb('0x13')](_0x529c96));_0x5206fe(_0x529c96);})['catch'](function(_0x34c2bc){logger[_0xd0bb('0x14')]('GetSquareProjects',_0x34c2bc[_0xd0bb('0x15')],_0x5090ce);_0x2ac972(_0x1234bc['error'](0x1f4,_0x34c2bc[_0xd0bb('0x15')]));});});};exports['ShowSquareProject']=function(_0x457afc){var _0x3e781d=this;return new Promise(function(_0x88c2cb,_0x3c11f5){return db[_0xd0bb('0x16')][_0xd0bb('0x17')]({'raw':_0x457afc['options']?_0x457afc[_0xd0bb('0xb')][_0xd0bb('0xc')]===undefined?!![]:![]:!![],'where':_0x457afc[_0xd0bb('0xb')]?_0x457afc['options'][_0xd0bb('0xd')]||null:null,'attributes':_0x457afc['options']?_0x457afc[_0xd0bb('0xb')][_0xd0bb('0xe')]||null:null,'include':_0x457afc[_0xd0bb('0xb')]?_0x457afc[_0xd0bb('0xb')]['include']?_[_0xd0bb('0x10')](_0x457afc['options'][_0xd0bb('0xf')],function(_0x3a53cd){return{'model':db[_0x3a53cd[_0xd0bb('0x11')]],'as':_0x3a53cd['as'],'attributes':_0x3a53cd['attributes'],'include':_0x3a53cd[_0xd0bb('0xf')]?_['map'](_0x3a53cd[_0xd0bb('0xf')],function(_0x4390fb){return{'model':db[_0x4390fb['model']],'as':_0x4390fb['as'],'attributes':_0x4390fb[_0xd0bb('0xe')],'include':_0x4390fb[_0xd0bb('0xf')]?_['map'](_0x4390fb[_0xd0bb('0xf')],function(_0x3963a9){return{'model':db[_0x3963a9[_0xd0bb('0x11')]],'as':_0x3963a9['as'],'attributes':_0x3963a9[_0xd0bb('0xe')]};}):[]};}):[]};}):[]:[]})[_0xd0bb('0x18')](function(_0x59ea93){logger['info']('ShowSquareProject',_0x457afc);logger['debug']('ShowSquareProject',_0x457afc,JSON['stringify'](_0x59ea93));_0x88c2cb(_0x59ea93);})[_0xd0bb('0x19')](function(_0x195d9c){logger['error'](_0xd0bb('0x1a'),_0x195d9c[_0xd0bb('0x15')],_0x457afc);_0x3c11f5(_0x3e781d[_0xd0bb('0x14')](0x1f4,_0x195d9c[_0xd0bb('0x15')]));});});}; \ No newline at end of file +var _0x0f7a=['GetSquareProjects','SquareProject','findAll','options','raw','where','limit','include','map','model','attributes','then','info','debug','catch','error','message','ShowSquareProject','stringify','lodash','../../mysqldb','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x0f7a,0x87));var _0xa0f7=function(_0x292360,_0x212e1c){_0x292360=_0x292360-0x0;var _0x4658d1=_0x0f7a[_0x292360];return _0x4658d1;};'use strict';var _=require(_0xa0f7('0x0'));var Redis=require('ioredis');var db=require(_0xa0f7('0x1'))['db'];var logger=require(_0xa0f7('0x2'))('rpc');var config=require(_0xa0f7('0x3'));config[_0xa0f7('0x4')]=_[_0xa0f7('0x5')](config[_0xa0f7('0x4')],{'host':_0xa0f7('0x6'),'port':0x18eb});var socket=require(_0xa0f7('0x7'))(new Redis(config[_0xa0f7('0x4')]));require(_0xa0f7('0x8'))[_0xa0f7('0x9')](socket);exports[_0xa0f7('0xa')]=function(_0x3e364){var _0x517859=this;return new Promise(function(_0x2e4eb6,_0x2dc008){return db[_0xa0f7('0xb')][_0xa0f7('0xc')]({'raw':_0x3e364[_0xa0f7('0xd')]?_0x3e364[_0xa0f7('0xd')][_0xa0f7('0xe')]===undefined?!![]:![]:!![],'where':_0x3e364[_0xa0f7('0xd')]?_0x3e364[_0xa0f7('0xd')][_0xa0f7('0xf')]||null:null,'attributes':_0x3e364['options']?_0x3e364[_0xa0f7('0xd')]['attributes']||null:null,'limit':_0x3e364[_0xa0f7('0xd')]?_0x3e364[_0xa0f7('0xd')][_0xa0f7('0x10')]||null:null,'include':_0x3e364[_0xa0f7('0xd')]?_0x3e364[_0xa0f7('0xd')][_0xa0f7('0x11')]?_[_0xa0f7('0x12')](_0x3e364[_0xa0f7('0xd')][_0xa0f7('0x11')],function(_0x4a168f){return{'model':db[_0x4a168f[_0xa0f7('0x13')]],'as':_0x4a168f['as'],'attributes':_0x4a168f[_0xa0f7('0x14')],'include':_0x4a168f[_0xa0f7('0x11')]?_[_0xa0f7('0x12')](_0x4a168f[_0xa0f7('0x11')],function(_0xb5d3dd){return{'model':db[_0xb5d3dd['model']],'as':_0xb5d3dd['as'],'attributes':_0xb5d3dd['attributes'],'include':_0xb5d3dd[_0xa0f7('0x11')]?_[_0xa0f7('0x12')](_0xb5d3dd[_0xa0f7('0x11')],function(_0x116fbe){return{'model':db[_0x116fbe[_0xa0f7('0x13')]],'as':_0x116fbe['as'],'attributes':_0x116fbe['attributes']};}):[]};}):[]};}):[]:[]})[_0xa0f7('0x15')](function(_0x59c3d6){logger[_0xa0f7('0x16')](_0xa0f7('0xa'),_0x3e364);logger[_0xa0f7('0x17')]('GetSquareProjects',_0x3e364,JSON['stringify'](_0x59c3d6));_0x2e4eb6(_0x59c3d6);})[_0xa0f7('0x18')](function(_0x4fce1e){logger[_0xa0f7('0x19')]('GetSquareProjects',_0x4fce1e['message'],_0x3e364);_0x2dc008(_0x517859[_0xa0f7('0x19')](0x1f4,_0x4fce1e[_0xa0f7('0x1a')]));});});};exports[_0xa0f7('0x1b')]=function(_0x12f66d){var _0x8a913=this;return new Promise(function(_0x1ea73c,_0x59ae2a){return db[_0xa0f7('0xb')]['find']({'raw':_0x12f66d[_0xa0f7('0xd')]?_0x12f66d['options'][_0xa0f7('0xe')]===undefined?!![]:![]:!![],'where':_0x12f66d[_0xa0f7('0xd')]?_0x12f66d[_0xa0f7('0xd')][_0xa0f7('0xf')]||null:null,'attributes':_0x12f66d['options']?_0x12f66d[_0xa0f7('0xd')][_0xa0f7('0x14')]||null:null,'include':_0x12f66d[_0xa0f7('0xd')]?_0x12f66d['options']['include']?_['map'](_0x12f66d['options'][_0xa0f7('0x11')],function(_0x21e924){return{'model':db[_0x21e924['model']],'as':_0x21e924['as'],'attributes':_0x21e924[_0xa0f7('0x14')],'include':_0x21e924[_0xa0f7('0x11')]?_[_0xa0f7('0x12')](_0x21e924['include'],function(_0x1fd955){return{'model':db[_0x1fd955['model']],'as':_0x1fd955['as'],'attributes':_0x1fd955[_0xa0f7('0x14')],'include':_0x1fd955[_0xa0f7('0x11')]?_[_0xa0f7('0x12')](_0x1fd955['include'],function(_0x3ddcde){return{'model':db[_0x3ddcde[_0xa0f7('0x13')]],'as':_0x3ddcde['as'],'attributes':_0x3ddcde[_0xa0f7('0x14')]};}):[]};}):[]};}):[]:[]})[_0xa0f7('0x15')](function(_0x511f13){logger[_0xa0f7('0x16')](_0xa0f7('0x1b'),_0x12f66d);logger['debug']('ShowSquareProject',_0x12f66d,JSON[_0xa0f7('0x1c')](_0x511f13));_0x1ea73c(_0x511f13);})['catch'](function(_0x130990){logger[_0xa0f7('0x19')](_0xa0f7('0x1b'),_0x130990[_0xa0f7('0x1a')],_0x12f66d);_0x59ae2a(_0x8a913[_0xa0f7('0x19')](0x1f4,_0x130990[_0xa0f7('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index a40c062..de6ed04 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 _0x93fd=['remove','update','emit','removeListener','register','length','squareProject:','./squareProject.events'];(function(_0x1f8053,_0x111077){var _0x174fd8=function(_0x2f92fc){while(--_0x2f92fc){_0x1f8053['push'](_0x1f8053['shift']());}};_0x174fd8(++_0x111077);}(_0x93fd,0x147));var _0xd93f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x93fd[_0x5b644e];return _0x49c6bf;};'use strict';var SquareProjectEvents=require(_0xd93f('0x0'));var events=['save',_0xd93f('0x1'),_0xd93f('0x2')];function createListener(_0x8cb9e6,_0x397594){return function(_0x60751){_0x397594[_0xd93f('0x3')](_0x8cb9e6,_0x60751);};}function removeListener(_0x41cbdb,_0x2ebb64){return function(){SquareProjectEvents[_0xd93f('0x4')](_0x41cbdb,_0x2ebb64);};}exports[_0xd93f('0x5')]=function(_0x3ff61f){for(var _0x3616d9=0x0,_0x4da67c=events[_0xd93f('0x6')];_0x3616d9<_0x4da67c;_0x3616d9++){var _0xf2e7ac=events[_0x3616d9];var _0x410c6e=createListener(_0xd93f('0x7')+_0xf2e7ac,_0x3ff61f);SquareProjectEvents['on'](_0xf2e7ac,_0x410c6e);}}; \ No newline at end of file +var _0xa72f=['length','squareProject:','./squareProject.events','save','remove','update','removeListener','register'];(function(_0x495b3d,_0x4d3da4){var _0x4cb329=function(_0xdef9f0){while(--_0xdef9f0){_0x495b3d['push'](_0x495b3d['shift']());}};_0x4cb329(++_0x4d3da4);}(_0xa72f,0x132));var _0xfa72=function(_0x2f36d2,_0x24285c){_0x2f36d2=_0x2f36d2-0x0;var _0x147f7f=_0xa72f[_0x2f36d2];return _0x147f7f;};'use strict';var SquareProjectEvents=require(_0xfa72('0x0'));var events=[_0xfa72('0x1'),_0xfa72('0x2'),_0xfa72('0x3')];function createListener(_0x489bef,_0x7c4703){return function(_0x55984a){_0x7c4703['emit'](_0x489bef,_0x55984a);};}function removeListener(_0x2a5909,_0xfd509e){return function(){SquareProjectEvents[_0xfa72('0x4')](_0x2a5909,_0xfd509e);};}exports[_0xfa72('0x5')]=function(_0x9efc66){for(var _0x2356a5=0x0,_0x312b35=events[_0xfa72('0x6')];_0x2356a5<_0x312b35;_0x2356a5++){var _0x574918=events[_0x2356a5];var _0x197fb9=createListener(_0xfa72('0x7')+_0x574918,_0x9efc66);SquareProjectEvents['on'](_0x574918,_0x197fb9);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index fe9e7ca..b98e8af 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7fbe=['/:id','show','/:id/download','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index'];(function(_0x17bd21,_0x20d3d3){var _0x2917b4=function(_0x1756f3){while(--_0x1756f3){_0x17bd21['push'](_0x17bd21['shift']());}};_0x2917b4(++_0x20d3d3);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3fc31d,_0x432bc9){_0x3fc31d=_0x3fc31d-0x0;var _0x31bb91=_0x7fbe[_0x3fc31d];return _0x31bb91;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['download']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router; \ No newline at end of file +var _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','/:id','multer','util','connect-timeout'];(function(_0x22491e,_0x2cd0bf){var _0x6a93f8=function(_0xdca25e){while(--_0xdca25e){_0x22491e['push'](_0x22491e['shift']());}};_0x6a93f8(++_0x2cd0bf);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3b0912,_0x39d739){_0x3b0912=_0x3b0912-0x0;var _0xa8f339=_0x5fc3[_0x3b0912];return _0xa8f339;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0x12'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 3a8ed6f..305a9a7 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 _0x2bd8=['STRING','VIRTUAL','getDataValue','substring','sequelize'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x2bd8,0x130));var _0x82bd=function(_0x52879a,_0x1cc1a4){_0x52879a=_0x52879a-0x0;var _0xedcf62=_0x2bd8[_0x52879a];return _0xedcf62;};'use strict';var Sequelize=require(_0x82bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x82bd('0x1')]},'callerid':{'type':Sequelize[_0x82bd('0x1')]},'calleridname':{'type':Sequelize[_0x82bd('0x1')]},'context':{'type':Sequelize[_0x82bd('0x1')]},'extension':{'type':Sequelize[_0x82bd('0x1')]},'priority':{'type':Sequelize[_0x82bd('0x1')]},'accountcode':{'type':Sequelize[_0x82bd('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x82bd('0x1')]},'saveName':{'type':Sequelize[_0x82bd('0x1')]},'filename':{'type':Sequelize[_0x82bd('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x82bd('0x2')],'get':function(){var _0x77d7a9='';var _0x226f60=this[_0x82bd('0x3')]('savePath');if(_0x226f60){_0x77d7a9=_0x226f60[_0x82bd('0x4')](_0x226f60['lastIndexOf']('.'));}return _0x77d7a9;}}}; \ No newline at end of file +var _0xabce=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','lastIndexOf'];(function(_0xa3463d,_0x32f8da){var _0x50fd67=function(_0xb984fd){while(--_0xb984fd){_0xa3463d['push'](_0xa3463d['shift']());}};_0x50fd67(++_0x32f8da);}(_0xabce,0x103));var _0xeabc=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xabce[_0x1d9aa0];return _0x226868;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'uniqueid':{'type':Sequelize[_0xeabc('0x2')]},'callerid':{'type':Sequelize[_0xeabc('0x2')]},'calleridname':{'type':Sequelize[_0xeabc('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xeabc('0x2')]},'accountcode':{'type':Sequelize[_0xeabc('0x2')]},'dnid':{'type':Sequelize[_0xeabc('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xeabc('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xeabc('0x3')],'get':function(){var _0x52ede8='';var _0x3bdc29=this[_0xeabc('0x4')](_0xeabc('0x5'));if(_0x3bdc29){_0x52ede8=_0x3bdc29['substring'](_0x3bdc29[_0xeabc('0x6')]('.'));}return _0x52ede8;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 580174e..476fccb 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 _0xf823=['then','stack','name','map','SquareRecording','fieldName','type','key','model','keys','filters','intersection','attributes','query','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','fields','create','body','update','uniqueid','savePath','filename','%s.cypher','decryptFile','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','unlink','send','destroy','find','info','isNil','File:\x20\x22','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','count','limit','Content-Range','apply','reject','save'];(function(_0x321d95,_0xcb39ac){var _0x4e8a0d=function(_0x45a4ae){while(--_0x45a4ae){_0x321d95['push'](_0x321d95['shift']());}};_0x4e8a0d(++_0xcb39ac);}(_0xf823,0x13c));var _0x3f82=function(_0x1619aa,_0x1444a9){_0x1619aa=_0x1619aa-0x0;var _0x30db3b=_0xf823[_0x1619aa];return _0x30db3b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f82('0x0'));var zipdir=require(_0x3f82('0x1'));var jsonpatch=require(_0x3f82('0x2'));var rp=require(_0x3f82('0x3'));var moment=require(_0x3f82('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3f82('0x5'));var util=require('util');var path=require(_0x3f82('0x6'));var sox=require(_0x3f82('0x7'));var csv=require('to-csv');var ejs=require(_0x3f82('0x8'));var fs=require('fs');var fs_extra=require(_0x3f82('0x9'));var _=require(_0x3f82('0xa'));var squel=require(_0x3f82('0xb'));var crypto=require(_0x3f82('0xc'));var jsforce=require(_0x3f82('0xd'));var deskjs=require(_0x3f82('0xe'));var toCsv=require(_0x3f82('0xf'));var querystring=require(_0x3f82('0x10'));var Papa=require(_0x3f82('0x11'));var Redis=require(_0x3f82('0x12'));var authService=require(_0x3f82('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3f82('0x14'));var hardwareService=require(_0x3f82('0x15'));var logger=require(_0x3f82('0x16'))('api');var utils=require(_0x3f82('0x17'));var config=require(_0x3f82('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe939a6,_0x3e5be2){_0x3e5be2=_0x3e5be2||0xcc;return function(_0x4b1715){if(_0x4b1715){return _0xe939a6[_0x3f82('0x19')](_0x3e5be2);}return _0xe939a6[_0x3f82('0x1a')](_0x3e5be2)[_0x3f82('0x1b')]();};}function respondWithResult(_0x44d73c,_0x261b48){_0x261b48=_0x261b48||0xc8;return function(_0x5aebd2){if(_0x5aebd2){return _0x44d73c['status'](_0x261b48)[_0x3f82('0x1c')](_0x5aebd2);}};}function respondWithFilteredResult(_0x431efc,_0x24c6d6){return function(_0x167611){if(_0x167611){var _0x461ea8=typeof _0x24c6d6[_0x3f82('0x1d')]==='undefined'&&typeof _0x24c6d6['limit']==='undefined';var _0x5cf5f7=_0x167611[_0x3f82('0x1e')];var _0x24ed20=_0x461ea8?0x0:_0x24c6d6[_0x3f82('0x1d')];var _0x2d70e8=_0x461ea8?_0x167611[_0x3f82('0x1e')]:_0x24c6d6[_0x3f82('0x1d')]+_0x24c6d6[_0x3f82('0x1f')];var _0x401de7;if(_0x2d70e8>=_0x5cf5f7){_0x2d70e8=_0x5cf5f7;_0x401de7=0xc8;}else{_0x401de7=0xce;}_0x431efc[_0x3f82('0x1a')](_0x401de7);return _0x431efc['set'](_0x3f82('0x20'),_0x24ed20+'-'+_0x2d70e8+'/'+_0x5cf5f7)[_0x3f82('0x1c')](_0x167611);}return null;};}function patchUpdates(_0x56ac6e){return function(_0x582488){try{jsonpatch[_0x3f82('0x21')](_0x582488,_0x56ac6e,!![]);}catch(_0x53bbec){return BPromise[_0x3f82('0x22')](_0x53bbec);}return _0x582488[_0x3f82('0x23')]();};}function saveUpdates(_0x5d263e,_0x24d363){return function(_0x4432fb){if(_0x4432fb){return _0x4432fb['update'](_0x5d263e)[_0x3f82('0x24')](function(_0x476dc1){return _0x476dc1;});}return null;};}function removeEntity(_0x5ce48d,_0xd2c4a4){return function(_0x52ef6d){if(_0x52ef6d){return _0x52ef6d['destroy']()['then'](function(){_0x5ce48d[_0x3f82('0x1a')](0xcc)[_0x3f82('0x1b')]();});}};}function handleEntityNotFound(_0x484d8d,_0x453829){return function(_0x28b40f){if(!_0x28b40f){_0x484d8d[_0x3f82('0x19')](0x194);}return _0x28b40f;};}function handleError(_0x37aad4,_0x42914d){_0x42914d=_0x42914d||0x1f4;return function(_0x1ca8ab){logger['error'](_0x1ca8ab[_0x3f82('0x25')]);if(_0x1ca8ab['name']){delete _0x1ca8ab[_0x3f82('0x26')];}_0x37aad4[_0x3f82('0x1a')](_0x42914d)['send'](_0x1ca8ab);};}exports['index']=function(_0x487409,_0x414dba){var _0x139ed5={},_0x3dbade={},_0x314d97={'count':0x0,'rows':[]};var _0x313191=_[_0x3f82('0x27')](db[_0x3f82('0x28')]['rawAttributes'],function(_0x2900f4){return{'name':_0x2900f4[_0x3f82('0x29')],'type':_0x2900f4[_0x3f82('0x2a')][_0x3f82('0x2b')]};});_0x3dbade[_0x3f82('0x2c')]=_[_0x3f82('0x27')](_0x313191,_0x3f82('0x26'));_0x3dbade['query']=_[_0x3f82('0x2d')](_0x487409['query']);_0x3dbade[_0x3f82('0x2e')]=_[_0x3f82('0x2f')](_0x3dbade[_0x3f82('0x2c')],_0x3dbade['query']);_0x139ed5[_0x3f82('0x30')]=_[_0x3f82('0x2f')](_0x3dbade[_0x3f82('0x2c')],qs['fields'](_0x487409[_0x3f82('0x31')]['fields']));_0x139ed5[_0x3f82('0x30')]=_0x139ed5['attributes'][_0x3f82('0x32')]?_0x139ed5[_0x3f82('0x30')]:_0x3dbade[_0x3f82('0x2c')];if(!_0x487409[_0x3f82('0x31')][_0x3f82('0x33')](_0x3f82('0x34'))){_0x139ed5[_0x3f82('0x1f')]=qs[_0x3f82('0x1f')](_0x487409['query'][_0x3f82('0x1f')]);_0x139ed5['offset']=qs[_0x3f82('0x1d')](_0x487409[_0x3f82('0x31')][_0x3f82('0x1d')]);}_0x139ed5['order']=qs[_0x3f82('0x35')](_0x487409['query'][_0x3f82('0x35')]);_0x139ed5[_0x3f82('0x36')]=qs[_0x3f82('0x2e')](_[_0x3f82('0x37')](_0x487409[_0x3f82('0x31')],_0x3dbade[_0x3f82('0x2e')]),_0x313191);if(_0x487409[_0x3f82('0x31')][_0x3f82('0x38')]){_0x139ed5[_0x3f82('0x36')]=_[_0x3f82('0x39')](_0x139ed5[_0x3f82('0x36')],{'$or':_['map'](_0x313191,function(_0x1a863e){if(_0x1a863e[_0x3f82('0x2a')]!=='VIRTUAL'){var _0x16c97c={};_0x16c97c[_0x1a863e[_0x3f82('0x26')]]={'$like':'%'+_0x487409[_0x3f82('0x31')][_0x3f82('0x38')]+'%'};return _0x16c97c;}})});}_0x139ed5=_[_0x3f82('0x39')]({},_0x139ed5,_0x487409[_0x3f82('0x3a')]);var _0x699966={'where':_0x139ed5[_0x3f82('0x36')]};return db[_0x3f82('0x28')][_0x3f82('0x1e')](_0x699966)['then'](function(_0xeb37d4){_0x314d97[_0x3f82('0x1e')]=_0xeb37d4;if(_0x487409[_0x3f82('0x31')][_0x3f82('0x3b')]){_0x139ed5[_0x3f82('0x3c')]=[{'all':!![]}];}return db[_0x3f82('0x28')]['findAll'](_0x139ed5);})[_0x3f82('0x24')](function(_0x36a99c){_0x314d97[_0x3f82('0x3d')]=_0x36a99c;return _0x314d97;})[_0x3f82('0x24')](respondWithFilteredResult(_0x414dba,_0x139ed5))[_0x3f82('0x3e')](handleError(_0x414dba,null));};exports[_0x3f82('0x3f')]=function(_0x38ecca,_0x2fe788){var _0x2bdca2={'raw':!![],'where':{'id':_0x38ecca[_0x3f82('0x40')]['id']}},_0x4a5edf={};_0x4a5edf[_0x3f82('0x2c')]=_[_0x3f82('0x2d')](db[_0x3f82('0x28')]['rawAttributes']);_0x4a5edf[_0x3f82('0x31')]=_['keys'](_0x38ecca[_0x3f82('0x31')]);_0x4a5edf[_0x3f82('0x2e')]=_['intersection'](_0x4a5edf[_0x3f82('0x2c')],_0x4a5edf[_0x3f82('0x31')]);_0x2bdca2['attributes']=_[_0x3f82('0x2f')](_0x4a5edf[_0x3f82('0x2c')],qs['fields'](_0x38ecca[_0x3f82('0x31')][_0x3f82('0x41')]));_0x2bdca2[_0x3f82('0x30')]=_0x2bdca2[_0x3f82('0x30')]['length']?_0x2bdca2[_0x3f82('0x30')]:_0x4a5edf[_0x3f82('0x2c')];if(_0x38ecca[_0x3f82('0x31')]['includeAll']){_0x2bdca2[_0x3f82('0x3c')]=[{'all':!![]}];}_0x2bdca2=_[_0x3f82('0x39')]({},_0x2bdca2,_0x38ecca['options']);return db[_0x3f82('0x28')]['find'](_0x2bdca2)[_0x3f82('0x24')](handleEntityNotFound(_0x2fe788,null))[_0x3f82('0x24')](respondWithResult(_0x2fe788,null))[_0x3f82('0x3e')](handleError(_0x2fe788,null));};exports[_0x3f82('0x42')]=function(_0x18096d,_0x5db218){return db[_0x3f82('0x28')]['create'](_0x18096d[_0x3f82('0x43')],{})[_0x3f82('0x24')](respondWithResult(_0x5db218,0xc9))[_0x3f82('0x3e')](handleError(_0x5db218,null));};exports[_0x3f82('0x44')]=function(_0x1e2cbd,_0x568ac8){if(_0x1e2cbd[_0x3f82('0x43')]['id']){delete _0x1e2cbd[_0x3f82('0x43')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0x1e2cbd[_0x3f82('0x40')]['id']}})[_0x3f82('0x24')](handleEntityNotFound(_0x568ac8,null))[_0x3f82('0x24')](saveUpdates(_0x1e2cbd['body'],null))[_0x3f82('0x24')](respondWithResult(_0x568ac8,null))['catch'](handleError(_0x568ac8,null));};exports['download']=function(_0xb564b3,_0x4fdb46,_0x16276b){var _0x5342c9=require('../../components/encryptor');var _0x161e99=![];var _0x28226d={};if(_0xb564b3[_0x3f82('0x31')][_0x3f82('0x2a')]&&_0xb564b3['query']['type']==='uniqueid'){_0x28226d[_0x3f82('0x45')]=_0xb564b3['params']['id'];}else{_0x28226d['id']=_0xb564b3['params']['id'];}return db[_0x3f82('0x28')]['find']({'where':_0x28226d,'attributes':['id',_0x3f82('0x46'),_0x3f82('0x47')],'raw':!![]})['then'](handleEntityNotFound(_0x4fdb46,null))[_0x3f82('0x24')](function(_0x1f3c86){if(_0x1f3c86){var _0x226356=_0x1f3c86['savePath'];var _0xaf5835=util['format'](_0x3f82('0x48'),_0x226356);if(fs['existsSync'](_0xaf5835)){_0x161e99=!![];return _0x5342c9[_0x3f82('0x49')](_0xaf5835,_0x226356,config['secrets']['recording'])[_0x3f82('0x24')](function(){return _0x1f3c86;});}return _0x1f3c86;}})[_0x3f82('0x24')](function(_0x5a92c){if(_0x5a92c){var _0x5ae459=_0x5a92c['savePath'];if(!fs[_0x3f82('0x4a')](_0x5ae459)){throw new db[(_0x3f82('0x4b'))][(_0x3f82('0x4c'))](_0x3f82('0x4d'));}if(_0x5a92c[_0x3f82('0x47')]){return _0x4fdb46[_0x3f82('0x4e')](_0x5ae459,_0x5a92c['filename']+path['extname'](_0x5ae459),function(){if(_0x161e99){fs[_0x3f82('0x4f')](_0x5ae459);}});}else{return _0x4fdb46[_0x3f82('0x4e')](_0x5ae459,function(_0x18f392){if(_0x161e99){fs[_0x3f82('0x4f')](_0x5ae459);}});}}})[_0x3f82('0x3e')](function(_0x1cf58b){if(_0x1cf58b['message']===_0x3f82('0x4d')){_0x4fdb46[_0x3f82('0x1a')](0x194)[_0x3f82('0x50')]('Not\x20found');}else{return handleError(_0x4fdb46,null);}});};exports[_0x3f82('0x51')]=function(_0xd6b6d5,_0x1e9e13){return db[_0x3f82('0x28')][_0x3f82('0x52')]({'where':{'id':_0xd6b6d5[_0x3f82('0x40')]['id']}})[_0x3f82('0x24')](function(_0x49740f){if(_['isNil'](_0x49740f)){throw new ReferenceError('Entity\x20not\x20found');}return _0x49740f;})[_0x3f82('0x24')](function(_0x484f54){var _0x46a653=_0x484f54[_0x3f82('0x46')];logger[_0x3f82('0x53')]('cancellazione\x20fisica\x20documento\x20%s',_0x46a653);if(!_[_0x3f82('0x54')](_0x484f54[_0x3f82('0x46')])&&fs[_0x3f82('0x4a')](_0x46a653)){logger[_0x3f82('0x53')](_0x3f82('0x55')+_0x46a653+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x3f82('0x56')](_0x46a653);}_0x46a653=_0x46a653+_0x3f82('0x57');if(!_['isNil'](_0x484f54['savePath'])&&fs['existsSync'](_0x46a653)){logger[_0x3f82('0x53')](_0x3f82('0x55')+_0x46a653+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x3f82('0x56')](_0x46a653);}return _0x484f54;})[_0x3f82('0x24')](function(_0x56cb4d){if(!_0x56cb4d)throw new InternalError();return _0x56cb4d[_0x3f82('0x51')]();})['then'](function(){_0x1e9e13[_0x3f82('0x1a')](0xcc)['end']();})[_0x3f82('0x3e')](handleError(_0x1e9e13,null));}; \ No newline at end of file +var _0x5a3c=['undefined','limit','count','offset','status','set','Content-Range','apply','reject','update','then','error','stack','name','send','map','SquareRecording','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','body','find','download','../../components/encryptor','uniqueid','savePath','filename','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','json'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x5a3c,0x164));var _0xc5a3=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5a3c[_0x5d4607];return _0x5e4a86;};'use strict';var emlformat=require(_0xc5a3('0x0'));var rimraf=require(_0xc5a3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc5a3('0x2'));var rp=require(_0xc5a3('0x3'));var moment=require('moment');var BPromise=require(_0xc5a3('0x4'));var Mustache=require(_0xc5a3('0x5'));var util=require(_0xc5a3('0x6'));var path=require(_0xc5a3('0x7'));var sox=require(_0xc5a3('0x8'));var csv=require(_0xc5a3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc5a3('0xa'));var _=require(_0xc5a3('0xb'));var squel=require(_0xc5a3('0xc'));var crypto=require(_0xc5a3('0xd'));var jsforce=require(_0xc5a3('0xe'));var deskjs=require(_0xc5a3('0xf'));var toCsv=require(_0xc5a3('0x9'));var querystring=require(_0xc5a3('0x10'));var Papa=require(_0xc5a3('0x11'));var Redis=require(_0xc5a3('0x12'));var authService=require(_0xc5a3('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc5a3('0x14'));var hardwareService=require(_0xc5a3('0x15'));var logger=require(_0xc5a3('0x16'))(_0xc5a3('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc5a3('0x18'))['db'];function respondWithStatusCode(_0x4fc493,_0xcfd222){_0xcfd222=_0xcfd222||0xcc;return function(_0x163b7e){if(_0x163b7e){return _0x4fc493[_0xc5a3('0x19')](_0xcfd222);}return _0x4fc493['status'](_0xcfd222)[_0xc5a3('0x1a')]();};}function respondWithResult(_0x269639,_0x4c230a){_0x4c230a=_0x4c230a||0xc8;return function(_0x977e4e){if(_0x977e4e){return _0x269639['status'](_0x4c230a)[_0xc5a3('0x1b')](_0x977e4e);}};}function respondWithFilteredResult(_0x19287d,_0x14059c){return function(_0x45fdaf){if(_0x45fdaf){var _0x3a77f4=typeof _0x14059c['offset']===_0xc5a3('0x1c')&&typeof _0x14059c[_0xc5a3('0x1d')]==='undefined';var _0x2534ab=_0x45fdaf[_0xc5a3('0x1e')];var _0x1cab25=_0x3a77f4?0x0:_0x14059c[_0xc5a3('0x1f')];var _0x1751b2=_0x3a77f4?_0x45fdaf[_0xc5a3('0x1e')]:_0x14059c[_0xc5a3('0x1f')]+_0x14059c[_0xc5a3('0x1d')];var _0x1bec0f;if(_0x1751b2>=_0x2534ab){_0x1751b2=_0x2534ab;_0x1bec0f=0xc8;}else{_0x1bec0f=0xce;}_0x19287d[_0xc5a3('0x20')](_0x1bec0f);return _0x19287d[_0xc5a3('0x21')](_0xc5a3('0x22'),_0x1cab25+'-'+_0x1751b2+'/'+_0x2534ab)['json'](_0x45fdaf);}return null;};}function patchUpdates(_0x36c1a9){return function(_0x534ebe){try{jsonpatch[_0xc5a3('0x23')](_0x534ebe,_0x36c1a9,!![]);}catch(_0x25cfdd){return BPromise[_0xc5a3('0x24')](_0x25cfdd);}return _0x534ebe['save']();};}function saveUpdates(_0x10b17c,_0x21cf10){return function(_0x44cda0){if(_0x44cda0){return _0x44cda0[_0xc5a3('0x25')](_0x10b17c)[_0xc5a3('0x26')](function(_0x108e46){return _0x108e46;});}return null;};}function removeEntity(_0x1d3b28,_0x19e6e2){return function(_0x491c37){if(_0x491c37){return _0x491c37['destroy']()[_0xc5a3('0x26')](function(){_0x1d3b28[_0xc5a3('0x20')](0xcc)[_0xc5a3('0x1a')]();});}};}function handleEntityNotFound(_0x3ac6f2,_0xe7cc17){return function(_0x184ee0){if(!_0x184ee0){_0x3ac6f2[_0xc5a3('0x19')](0x194);}return _0x184ee0;};}function handleError(_0x36c9bd,_0x2e6101){_0x2e6101=_0x2e6101||0x1f4;return function(_0x1d658d){logger[_0xc5a3('0x27')](_0x1d658d[_0xc5a3('0x28')]);if(_0x1d658d[_0xc5a3('0x29')]){delete _0x1d658d['name'];}_0x36c9bd[_0xc5a3('0x20')](_0x2e6101)[_0xc5a3('0x2a')](_0x1d658d);};}exports['index']=function(_0x244e3c,_0x17bd15){var _0x44679b={},_0x5eab5b={},_0x49edd7={'count':0x0,'rows':[]};var _0x2282d4=_[_0xc5a3('0x2b')](db[_0xc5a3('0x2c')][_0xc5a3('0x2d')],function(_0x1aeaad){return{'name':_0x1aeaad[_0xc5a3('0x2e')],'type':_0x1aeaad[_0xc5a3('0x2f')]['key']};});_0x5eab5b['model']=_[_0xc5a3('0x2b')](_0x2282d4,_0xc5a3('0x29'));_0x5eab5b[_0xc5a3('0x30')]=_[_0xc5a3('0x31')](_0x244e3c[_0xc5a3('0x30')]);_0x5eab5b[_0xc5a3('0x32')]=_[_0xc5a3('0x33')](_0x5eab5b['model'],_0x5eab5b[_0xc5a3('0x30')]);_0x44679b[_0xc5a3('0x34')]=_[_0xc5a3('0x33')](_0x5eab5b[_0xc5a3('0x35')],qs['fields'](_0x244e3c[_0xc5a3('0x30')][_0xc5a3('0x36')]));_0x44679b['attributes']=_0x44679b['attributes'][_0xc5a3('0x37')]?_0x44679b[_0xc5a3('0x34')]:_0x5eab5b['model'];if(!_0x244e3c[_0xc5a3('0x30')][_0xc5a3('0x38')]('nolimit')){_0x44679b[_0xc5a3('0x1d')]=qs[_0xc5a3('0x1d')](_0x244e3c['query']['limit']);_0x44679b[_0xc5a3('0x1f')]=qs[_0xc5a3('0x1f')](_0x244e3c[_0xc5a3('0x30')]['offset']);}_0x44679b[_0xc5a3('0x39')]=qs['sort'](_0x244e3c['query'][_0xc5a3('0x3a')]);_0x44679b[_0xc5a3('0x3b')]=qs[_0xc5a3('0x32')](_[_0xc5a3('0x3c')](_0x244e3c[_0xc5a3('0x30')],_0x5eab5b[_0xc5a3('0x32')]),_0x2282d4);if(_0x244e3c[_0xc5a3('0x30')]['filter']){_0x44679b[_0xc5a3('0x3b')]=_[_0xc5a3('0x3d')](_0x44679b[_0xc5a3('0x3b')],{'$or':_[_0xc5a3('0x2b')](_0x2282d4,function(_0x2f392a){if(_0x2f392a[_0xc5a3('0x2f')]!==_0xc5a3('0x3e')){var _0x150207={};_0x150207[_0x2f392a['name']]={'$like':'%'+_0x244e3c[_0xc5a3('0x30')][_0xc5a3('0x3f')]+'%'};return _0x150207;}})});}_0x44679b=_[_0xc5a3('0x3d')]({},_0x44679b,_0x244e3c[_0xc5a3('0x40')]);var _0x3f1693={'where':_0x44679b[_0xc5a3('0x3b')]};return db['SquareRecording'][_0xc5a3('0x1e')](_0x3f1693)['then'](function(_0x494629){_0x49edd7[_0xc5a3('0x1e')]=_0x494629;if(_0x244e3c[_0xc5a3('0x30')][_0xc5a3('0x41')]){_0x44679b[_0xc5a3('0x42')]=[{'all':!![]}];}return db[_0xc5a3('0x2c')][_0xc5a3('0x43')](_0x44679b);})[_0xc5a3('0x26')](function(_0x25b28c){_0x49edd7['rows']=_0x25b28c;return _0x49edd7;})[_0xc5a3('0x26')](respondWithFilteredResult(_0x17bd15,_0x44679b))[_0xc5a3('0x44')](handleError(_0x17bd15,null));};exports[_0xc5a3('0x45')]=function(_0x41fa8d,_0x2d835d){var _0x5be2a3={'raw':!![],'where':{'id':_0x41fa8d[_0xc5a3('0x46')]['id']}},_0x1f71d6={};_0x1f71d6[_0xc5a3('0x35')]=_[_0xc5a3('0x31')](db[_0xc5a3('0x2c')][_0xc5a3('0x2d')]);_0x1f71d6['query']=_[_0xc5a3('0x31')](_0x41fa8d['query']);_0x1f71d6[_0xc5a3('0x32')]=_[_0xc5a3('0x33')](_0x1f71d6[_0xc5a3('0x35')],_0x1f71d6['query']);_0x5be2a3[_0xc5a3('0x34')]=_[_0xc5a3('0x33')](_0x1f71d6['model'],qs[_0xc5a3('0x36')](_0x41fa8d[_0xc5a3('0x30')]['fields']));_0x5be2a3[_0xc5a3('0x34')]=_0x5be2a3[_0xc5a3('0x34')][_0xc5a3('0x37')]?_0x5be2a3[_0xc5a3('0x34')]:_0x1f71d6['model'];if(_0x41fa8d['query'][_0xc5a3('0x41')]){_0x5be2a3[_0xc5a3('0x42')]=[{'all':!![]}];}_0x5be2a3=_[_0xc5a3('0x3d')]({},_0x5be2a3,_0x41fa8d[_0xc5a3('0x40')]);return db[_0xc5a3('0x2c')]['find'](_0x5be2a3)[_0xc5a3('0x26')](handleEntityNotFound(_0x2d835d,null))[_0xc5a3('0x26')](respondWithResult(_0x2d835d,null))['catch'](handleError(_0x2d835d,null));};exports['create']=function(_0x6c933e,_0x4e1a3c){return db[_0xc5a3('0x2c')]['create'](_0x6c933e[_0xc5a3('0x47')],{})[_0xc5a3('0x26')](respondWithResult(_0x4e1a3c,0xc9))[_0xc5a3('0x44')](handleError(_0x4e1a3c,null));};exports[_0xc5a3('0x25')]=function(_0x57385b,_0x1e57ba){if(_0x57385b[_0xc5a3('0x47')]['id']){delete _0x57385b[_0xc5a3('0x47')]['id'];}return db[_0xc5a3('0x2c')][_0xc5a3('0x48')]({'where':{'id':_0x57385b[_0xc5a3('0x46')]['id']}})['then'](handleEntityNotFound(_0x1e57ba,null))[_0xc5a3('0x26')](saveUpdates(_0x57385b['body'],null))[_0xc5a3('0x26')](respondWithResult(_0x1e57ba,null))[_0xc5a3('0x44')](handleError(_0x1e57ba,null));};exports[_0xc5a3('0x49')]=function(_0x3ec570,_0x5b5d33,_0x31585b){var _0x2c68a5=require(_0xc5a3('0x4a'));var _0x1672dd=![];var _0x273ada={};if(_0x3ec570[_0xc5a3('0x30')][_0xc5a3('0x2f')]&&_0x3ec570[_0xc5a3('0x30')][_0xc5a3('0x2f')]===_0xc5a3('0x4b')){_0x273ada['uniqueid']=_0x3ec570[_0xc5a3('0x46')]['id'];}else{_0x273ada['id']=_0x3ec570['params']['id'];}return db[_0xc5a3('0x2c')][_0xc5a3('0x48')]({'where':_0x273ada,'attributes':['id',_0xc5a3('0x4c'),_0xc5a3('0x4d')],'raw':!![]})[_0xc5a3('0x26')](handleEntityNotFound(_0x5b5d33,null))['then'](function(_0x49f2f1){if(_0x49f2f1){var _0x13a007=_0x49f2f1[_0xc5a3('0x4c')];var _0x3c1b6a=util['format']('%s.cypher',_0x13a007);if(fs[_0xc5a3('0x4e')](_0x3c1b6a)){_0x1672dd=!![];return _0x2c68a5[_0xc5a3('0x4f')](_0x3c1b6a,_0x13a007,config[_0xc5a3('0x50')][_0xc5a3('0x51')])[_0xc5a3('0x26')](function(){return _0x49f2f1;});}return _0x49f2f1;}})[_0xc5a3('0x26')](function(_0x30b54d){if(_0x30b54d){var _0x40fd31=_0x30b54d['savePath'];if(!fs[_0xc5a3('0x4e')](_0x40fd31)){throw new db[(_0xc5a3('0x52'))][(_0xc5a3('0x53'))](_0xc5a3('0x54'));}if(_0x30b54d[_0xc5a3('0x4d')]){return _0x5b5d33[_0xc5a3('0x49')](_0x40fd31,_0x30b54d['filename']+path['extname'](_0x40fd31),function(){if(_0x1672dd){fs[_0xc5a3('0x55')](_0x40fd31);}});}else{return _0x5b5d33[_0xc5a3('0x49')](_0x40fd31,function(_0x2e24ea){if(_0x1672dd){fs[_0xc5a3('0x55')](_0x40fd31);}});}}})[_0xc5a3('0x44')](function(_0x19ad4c){if(_0x19ad4c[_0xc5a3('0x56')]===_0xc5a3('0x54')){_0x5b5d33[_0xc5a3('0x20')](0x194)[_0xc5a3('0x2a')]('Not\x20found');}else{return handleError(_0x5b5d33,null);}});};exports[_0xc5a3('0x57')]=function(_0x551570,_0x351212){return db[_0xc5a3('0x2c')][_0xc5a3('0x48')]({'where':{'id':_0x551570[_0xc5a3('0x46')]['id']}})['then'](function(_0xd47a04){if(_[_0xc5a3('0x58')](_0xd47a04)){throw new ReferenceError(_0xc5a3('0x59'));}return _0xd47a04;})[_0xc5a3('0x26')](function(_0x522061){var _0x23cf0e=_0x522061[_0xc5a3('0x4c')];logger[_0xc5a3('0x5a')](_0xc5a3('0x5b'),_0x23cf0e);if(!_[_0xc5a3('0x58')](_0x522061[_0xc5a3('0x4c')])&&fs[_0xc5a3('0x4e')](_0x23cf0e)){logger[_0xc5a3('0x5a')](_0xc5a3('0x5c')+_0x23cf0e+_0xc5a3('0x5d'));fs[_0xc5a3('0x5e')](_0x23cf0e);}_0x23cf0e=_0x23cf0e+_0xc5a3('0x5f');if(!_[_0xc5a3('0x58')](_0x522061[_0xc5a3('0x4c')])&&fs[_0xc5a3('0x4e')](_0x23cf0e)){logger['info'](_0xc5a3('0x5c')+_0x23cf0e+_0xc5a3('0x5d'));fs['unlinkSync'](_0x23cf0e);}return _0x522061;})[_0xc5a3('0x26')](function(_0x4dfe6d){if(!_0x4dfe6d)throw new InternalError();return _0x4dfe6d[_0xc5a3('0x57')]();})[_0xc5a3('0x26')](function(){_0x351212['status'](0xcc)[_0xc5a3('0x1a')]();})[_0xc5a3('0x44')](handleError(_0x351212,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 4f7d1ba..dd227d6 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 _0x44fe=['./squareRecording.attributes','define','square_recordings','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x44fe,0x16f));var _0xe44f=function(_0x290e85,_0x16d1bd){_0x290e85=_0x290e85-0x0;var _0x2ae316=_0x44fe[_0x290e85];return _0x2ae316;};'use strict';var _=require(_0xe44f('0x0'));var util=require(_0xe44f('0x1'));var logger=require(_0xe44f('0x2'))(_0xe44f('0x3'));var moment=require(_0xe44f('0x4'));var BPromise=require(_0xe44f('0x5'));var rp=require(_0xe44f('0x6'));var fs=require('fs');var path=require(_0xe44f('0x7'));var rimraf=require(_0xe44f('0x8'));var config=require(_0xe44f('0x9'));var attributes=require(_0xe44f('0xa'));module['exports']=function(_0x4a41be,_0x1abe56){return _0x4a41be[_0xe44f('0xb')]('SquareRecording',attributes,{'tableName':_0xe44f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7db=['./squareRecording.attributes','define','SquareRecording','square_recordings','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa7db,0xbf));var _0xba7d=function(_0x2b8dd3,_0x25ccbc){_0x2b8dd3=_0x2b8dd3-0x0;var _0x200b5a=_0xa7db[_0x2b8dd3];return _0x200b5a;};'use strict';var _=require(_0xba7d('0x0'));var util=require(_0xba7d('0x1'));var logger=require(_0xba7d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xba7d('0x3'));var fs=require('fs');var path=require(_0xba7d('0x4'));var rimraf=require(_0xba7d('0x5'));var config=require(_0xba7d('0x6'));var attributes=require(_0xba7d('0x7'));module['exports']=function(_0x2f6d8d,_0x257384){return _0x2f6d8d[_0xba7d('0x8')](_0xba7d('0x9'),attributes,{'tableName':_0xba7d('0xa'),'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 b69ae96..13a74b5 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 _0xd46a=['message','info','result','catch','CreateSquareRecording','body','options','raw','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareRecording,\x20%s,\x20%s'];(function(_0x3cbb14,_0x3c95a7){var _0x2bfb35=function(_0x384c4d){while(--_0x384c4d){_0x3cbb14['push'](_0x3cbb14['shift']());}};_0x2bfb35(++_0x3c95a7);}(_0xd46a,0x80));var _0xad46=function(_0x119fe2,_0x181701){_0x119fe2=_0x119fe2-0x0;var _0x39f686=_0xd46a[_0x119fe2];return _0x39f686;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xad46('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad46('0x1'));var db=require(_0xad46('0x2'))['db'];var utils=require(_0xad46('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xad46('0x4'));var jayson=require(_0xad46('0x5'));var client=jayson['client'][_0xad46('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4fff9a,_0x302cbc,_0x12eac4){return new BPromise(function(_0x11e95e,_0x5c561c){return client[_0xad46('0x7')](_0x4fff9a,_0x12eac4)[_0xad46('0x8')](function(_0xb97c0f){logger['info']('SquareRecording,\x20%s,\x20%s',_0x302cbc,_0xad46('0x9'));logger[_0xad46('0xa')](_0xad46('0xb'),_0x302cbc,'request\x20sent',JSON[_0xad46('0xc')](_0xb97c0f));if(_0xb97c0f[_0xad46('0xd')]){if(_0xb97c0f[_0xad46('0xd')][_0xad46('0xe')]===0x1f4){logger['error'](_0xad46('0xf'),_0x302cbc,_0xb97c0f[_0xad46('0xd')][_0xad46('0x10')]);return _0x5c561c(_0xb97c0f[_0xad46('0xd')][_0xad46('0x10')]);}logger[_0xad46('0xd')](_0xad46('0xf'),_0x302cbc,_0xb97c0f['error']['message']);return _0x11e95e(_0xb97c0f[_0xad46('0xd')][_0xad46('0x10')]);}else{logger[_0xad46('0x11')](_0xad46('0xf'),_0x302cbc,_0xad46('0x9'));_0x11e95e(_0xb97c0f[_0xad46('0x12')][_0xad46('0x10')]);}})[_0xad46('0x13')](function(_0x5be741){logger[_0xad46('0xd')]('SquareRecording,\x20%s,\x20%s',_0x302cbc,_0x5be741);_0x5c561c(_0x5be741);});});}exports[_0xad46('0x14')]=function(_0x5c0a28){var _0x509fb9=this;return new Promise(function(_0x29fe60,_0x2ac520){return db['SquareRecording']['create'](_0x5c0a28[_0xad46('0x15')],{'raw':_0x5c0a28[_0xad46('0x16')]?_0x5c0a28[_0xad46('0x16')][_0xad46('0x17')]===undefined?!![]:![]:!![]})[_0xad46('0x8')](function(_0x2dfd76){logger[_0xad46('0x11')](_0xad46('0x14'),_0x5c0a28);logger['debug'](_0xad46('0x14'),_0x5c0a28,JSON[_0xad46('0xc')](_0x2dfd76));_0x29fe60(_0x2dfd76);})[_0xad46('0x13')](function(_0x15e287){logger['error'](_0xad46('0x14'),_0x15e287['message'],_0x5c0a28);_0x2ac520(_0x509fb9[_0xad46('0xd')](0x1f4,_0x15e287[_0xad46('0x10')]));});});}; \ No newline at end of file +var _0x1e94=['body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','create'];(function(_0x36da03,_0x592e0f){var _0x40855a=function(_0x383e1f){while(--_0x383e1f){_0x36da03['push'](_0x36da03['shift']());}};_0x40855a(++_0x592e0f);}(_0x1e94,0x1c3));var _0x41e9=function(_0x4b477a,_0x3e3f1e){_0x4b477a=_0x4b477a-0x0;var _0x291072=_0x1e94[_0x4b477a];return _0x291072;};'use strict';var _=require(_0x41e9('0x0'));var util=require(_0x41e9('0x1'));var moment=require(_0x41e9('0x2'));var BPromise=require(_0x41e9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x41e9('0x4'));var db=require(_0x41e9('0x5'))['db'];var utils=require(_0x41e9('0x6'));var logger=require(_0x41e9('0x7'))('rpc');var config=require(_0x41e9('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x41e9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e938d,_0x1c8e11,_0x3c13d4){return new BPromise(function(_0x2dfd83,_0x50f399){return client[_0x41e9('0xa')](_0x1e938d,_0x3c13d4)[_0x41e9('0xb')](function(_0x512e3){logger[_0x41e9('0xc')](_0x41e9('0xd'),_0x1c8e11,_0x41e9('0xe'));logger[_0x41e9('0xf')](_0x41e9('0x10'),_0x1c8e11,'request\x20sent',JSON[_0x41e9('0x11')](_0x512e3));if(_0x512e3[_0x41e9('0x12')]){if(_0x512e3[_0x41e9('0x12')][_0x41e9('0x13')]===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0x1c8e11,_0x512e3[_0x41e9('0x12')][_0x41e9('0x14')]);return _0x50f399(_0x512e3[_0x41e9('0x12')][_0x41e9('0x14')]);}logger[_0x41e9('0x12')](_0x41e9('0xd'),_0x1c8e11,_0x512e3[_0x41e9('0x12')]['message']);return _0x2dfd83(_0x512e3[_0x41e9('0x12')]['message']);}else{logger[_0x41e9('0xc')]('SquareRecording,\x20%s,\x20%s',_0x1c8e11,'request\x20sent');_0x2dfd83(_0x512e3[_0x41e9('0x15')][_0x41e9('0x14')]);}})[_0x41e9('0x16')](function(_0x3b3417){logger[_0x41e9('0x12')]('SquareRecording,\x20%s,\x20%s',_0x1c8e11,_0x3b3417);_0x50f399(_0x3b3417);});});}exports[_0x41e9('0x17')]=function(_0xd7fb5b){var _0x2b132b=this;return new Promise(function(_0x4d7080,_0x580bb9){return db['SquareRecording'][_0x41e9('0x18')](_0xd7fb5b[_0x41e9('0x19')],{'raw':_0xd7fb5b[_0x41e9('0x1a')]?_0xd7fb5b['options'][_0x41e9('0x1b')]===undefined?!![]:![]:!![]})[_0x41e9('0xb')](function(_0x3e0453){logger[_0x41e9('0xc')](_0x41e9('0x17'),_0xd7fb5b);logger['debug']('CreateSquareRecording',_0xd7fb5b,JSON[_0x41e9('0x11')](_0x3e0453));_0x4d7080(_0x3e0453);})[_0x41e9('0x16')](function(_0x33aae5){logger[_0x41e9('0x12')](_0x41e9('0x17'),_0x33aae5[_0x41e9('0x14')],_0xd7fb5b);_0x580bb9(_0x2b132b[_0x41e9('0x12')](0x1f4,_0x33aae5['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 3720341..30ae090 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 _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x31c40a,_0x4e9356){var _0x437755=function(_0x3363a7){while(--_0x3363a7){_0x31c40a['push'](_0x31c40a['shift']());}};_0x437755(++_0x4e9356);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=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(_0x4c05da,_0x414720){var _0x1614db=function(_0xa19cf6){while(--_0xa19cf6){_0x4c05da['push'](_0x4c05da['shift']());}};_0x1614db(++_0x414720);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('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 c0565cc..bdd1494 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 _0x024e=['sequelize','exports','STRING','DATE'];(function(_0x41df72,_0x2203a9){var _0x400af5=function(_0x539701){while(--_0x539701){_0x41df72['push'](_0x41df72['shift']());}};_0x400af5(++_0x2203a9);}(_0x024e,0xf0));var _0xe024=function(_0x2c18a8,_0x24eaa5){_0x2c18a8=_0x2c18a8-0x0;var _0x1e009a=_0x024e[_0x2c18a8];return _0x1e009a;};'use strict';var Sequelize=require(_0xe024('0x0'));module[_0xe024('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xe024('0x2')]},'request':{'type':Sequelize[_0xe024('0x2')]},'channel':{'type':Sequelize[_0xe024('0x2')]},'language':{'type':Sequelize[_0xe024('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xe024('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xe024('0x2')]},'calleridname':{'type':Sequelize[_0xe024('0x2')]},'callingpres':{'type':Sequelize[_0xe024('0x2')]},'callingani2':{'type':Sequelize[_0xe024('0x2')]},'callington':{'type':Sequelize[_0xe024('0x2')]},'callingtns':{'type':Sequelize[_0xe024('0x2')]},'dnid':{'type':Sequelize[_0xe024('0x2')]},'rdnis':{'type':Sequelize[_0xe024('0x2')]},'context':{'type':Sequelize[_0xe024('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xe024('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xe024('0x2')]},'project_name':{'type':Sequelize[_0xe024('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xe024('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x462c=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0xd03256,_0x53527d){var _0x335958=function(_0x959fe4){while(--_0x959fe4){_0xd03256['push'](_0xd03256['shift']());}};_0x335958(++_0x53527d);}(_0x462c,0xf6));var _0xc462=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x462c[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0xc462('0x0'));module[_0xc462('0x1')]={'network':{'type':Sequelize[_0xc462('0x2')]},'network_script':{'type':Sequelize[_0xc462('0x2')]},'request':{'type':Sequelize[_0xc462('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc462('0x2')]},'uniqueid':{'type':Sequelize[_0xc462('0x2')]},'version':{'type':Sequelize[_0xc462('0x2')]},'callerid':{'type':Sequelize[_0xc462('0x2')]},'calleridname':{'type':Sequelize[_0xc462('0x2')]},'callingpres':{'type':Sequelize[_0xc462('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xc462('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xc462('0x2')]},'priority':{'type':Sequelize[_0xc462('0x2')]},'enhanced':{'type':Sequelize[_0xc462('0x2')]},'accountcode':{'type':Sequelize[_0xc462('0x2')]},'threadid':{'type':Sequelize[_0xc462('0x2')]},'project_name':{'type':Sequelize[_0xc462('0x2')]},'joinAt':{'type':Sequelize[_0xc462('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xc462('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 ab12859..c5c178d 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 _0x63af=['where','merge','VIRTUAL','name','filter','options','includeAll','SquareReport','rows','catch','show','params','keys','length','body','find','destroy','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','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','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','end','error','stack','index','map','rawAttributes','key','model','filters','intersection','query','attributes','fields','sort'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x63af,0x1b6));var _0xf63a=function(_0x206053,_0x422374){_0x206053=_0x206053-0x0;var _0x39e8db=_0x63af[_0x206053];return _0x39e8db;};'use strict';var emlformat=require(_0xf63a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf63a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf63a('0x2'));var moment=require(_0xf63a('0x3'));var BPromise=require(_0xf63a('0x4'));var Mustache=require('mustache');var util=require(_0xf63a('0x5'));var path=require(_0xf63a('0x6'));var sox=require(_0xf63a('0x7'));var csv=require(_0xf63a('0x8'));var ejs=require(_0xf63a('0x9'));var fs=require('fs');var fs_extra=require(_0xf63a('0xa'));var _=require(_0xf63a('0xb'));var squel=require('squel');var crypto=require(_0xf63a('0xc'));var jsforce=require(_0xf63a('0xd'));var deskjs=require(_0xf63a('0xe'));var toCsv=require(_0xf63a('0x8'));var querystring=require(_0xf63a('0xf'));var Papa=require(_0xf63a('0x10'));var Redis=require('ioredis');var authService=require(_0xf63a('0x11'));var qs=require(_0xf63a('0x12'));var as=require(_0xf63a('0x13'));var hardwareService=require(_0xf63a('0x14'));var logger=require(_0xf63a('0x15'))(_0xf63a('0x16'));var utils=require(_0xf63a('0x17'));var config=require(_0xf63a('0x18'));var licenseUtil=require(_0xf63a('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1662bf,_0x185ca2){_0x185ca2=_0x185ca2||0xcc;return function(_0x3d8cd2){if(_0x3d8cd2){return _0x1662bf['sendStatus'](_0x185ca2);}return _0x1662bf[_0xf63a('0x1a')](_0x185ca2)['end']();};}function respondWithResult(_0x1ed3f5,_0x576876){_0x576876=_0x576876||0xc8;return function(_0xca9c5f){if(_0xca9c5f){return _0x1ed3f5[_0xf63a('0x1a')](_0x576876)[_0xf63a('0x1b')](_0xca9c5f);}};}function respondWithFilteredResult(_0x3a2509,_0x7748e9){return function(_0x3b43e7){if(_0x3b43e7){var _0x50b537=typeof _0x7748e9['offset']===_0xf63a('0x1c')&&typeof _0x7748e9[_0xf63a('0x1d')]===_0xf63a('0x1c');var _0x4cb728=_0x3b43e7[_0xf63a('0x1e')];var _0x9125cd=_0x50b537?0x0:_0x7748e9['offset'];var _0x51877e=_0x50b537?_0x3b43e7[_0xf63a('0x1e')]:_0x7748e9[_0xf63a('0x1f')]+_0x7748e9[_0xf63a('0x1d')];var _0x3bae97;if(_0x51877e>=_0x4cb728){_0x51877e=_0x4cb728;_0x3bae97=0xc8;}else{_0x3bae97=0xce;}_0x3a2509[_0xf63a('0x1a')](_0x3bae97);return _0x3a2509[_0xf63a('0x20')]('Content-Range',_0x9125cd+'-'+_0x51877e+'/'+_0x4cb728)[_0xf63a('0x1b')](_0x3b43e7);}return null;};}function patchUpdates(_0x524907){return function(_0x5df1d1){try{jsonpatch[_0xf63a('0x21')](_0x5df1d1,_0x524907,!![]);}catch(_0x484907){return BPromise[_0xf63a('0x22')](_0x484907);}return _0x5df1d1[_0xf63a('0x23')]();};}function saveUpdates(_0x454965,_0x3dd057){return function(_0x4e851d){if(_0x4e851d){return _0x4e851d[_0xf63a('0x24')](_0x454965)[_0xf63a('0x25')](function(_0x42addc){return _0x42addc;});}return null;};}function removeEntity(_0x5bb859,_0x2ba3b0){return function(_0x266fd8){if(_0x266fd8){return _0x266fd8['destroy']()[_0xf63a('0x25')](function(){_0x5bb859[_0xf63a('0x1a')](0xcc)[_0xf63a('0x26')]();});}};}function handleEntityNotFound(_0x1844c3,_0xb60c43){return function(_0x467077){if(!_0x467077){_0x1844c3['sendStatus'](0x194);}return _0x467077;};}function handleError(_0x8780e4,_0x1a7b0f){_0x1a7b0f=_0x1a7b0f||0x1f4;return function(_0x4c2845){logger[_0xf63a('0x27')](_0x4c2845[_0xf63a('0x28')]);if(_0x4c2845['name']){delete _0x4c2845['name'];}_0x8780e4[_0xf63a('0x1a')](_0x1a7b0f)['send'](_0x4c2845);};}exports[_0xf63a('0x29')]=function(_0x223ef6,_0x223682){var _0x337e2c={},_0x275b61={},_0x305914={'count':0x0,'rows':[]};var _0x210286=_[_0xf63a('0x2a')](db['SquareReport'][_0xf63a('0x2b')],function(_0x509831){return{'name':_0x509831['fieldName'],'type':_0x509831['type'][_0xf63a('0x2c')]};});_0x275b61[_0xf63a('0x2d')]=_[_0xf63a('0x2a')](_0x210286,'name');_0x275b61['query']=_['keys'](_0x223ef6['query']);_0x275b61[_0xf63a('0x2e')]=_[_0xf63a('0x2f')](_0x275b61[_0xf63a('0x2d')],_0x275b61[_0xf63a('0x30')]);_0x337e2c[_0xf63a('0x31')]=_['intersection'](_0x275b61[_0xf63a('0x2d')],qs['fields'](_0x223ef6[_0xf63a('0x30')][_0xf63a('0x32')]));_0x337e2c[_0xf63a('0x31')]=_0x337e2c[_0xf63a('0x31')]['length']?_0x337e2c[_0xf63a('0x31')]:_0x275b61[_0xf63a('0x2d')];if(!_0x223ef6['query']['hasOwnProperty']('nolimit')){_0x337e2c[_0xf63a('0x1d')]=qs[_0xf63a('0x1d')](_0x223ef6['query']['limit']);_0x337e2c[_0xf63a('0x1f')]=qs[_0xf63a('0x1f')](_0x223ef6['query']['offset']);}_0x337e2c['order']=qs['sort'](_0x223ef6[_0xf63a('0x30')][_0xf63a('0x33')]);_0x337e2c[_0xf63a('0x34')]=qs[_0xf63a('0x2e')](_['pick'](_0x223ef6[_0xf63a('0x30')],_0x275b61[_0xf63a('0x2e')]),_0x210286);if(_0x223ef6['query']['filter']){_0x337e2c[_0xf63a('0x34')]=_[_0xf63a('0x35')](_0x337e2c[_0xf63a('0x34')],{'$or':_['map'](_0x210286,function(_0x44d90e){if(_0x44d90e['type']!==_0xf63a('0x36')){var _0x592c9b={};_0x592c9b[_0x44d90e[_0xf63a('0x37')]]={'$like':'%'+_0x223ef6[_0xf63a('0x30')][_0xf63a('0x38')]+'%'};return _0x592c9b;}})});}_0x337e2c=_[_0xf63a('0x35')]({},_0x337e2c,_0x223ef6[_0xf63a('0x39')]);var _0x2a0a47={'where':_0x337e2c[_0xf63a('0x34')]};return db['SquareReport'][_0xf63a('0x1e')](_0x2a0a47)[_0xf63a('0x25')](function(_0x421db1){_0x305914[_0xf63a('0x1e')]=_0x421db1;if(_0x223ef6[_0xf63a('0x30')][_0xf63a('0x3a')]){_0x337e2c['include']=[{'all':!![]}];}return db[_0xf63a('0x3b')]['findAll'](_0x337e2c);})[_0xf63a('0x25')](function(_0x21f489){_0x305914[_0xf63a('0x3c')]=_0x21f489;return _0x305914;})[_0xf63a('0x25')](respondWithFilteredResult(_0x223682,_0x337e2c))[_0xf63a('0x3d')](handleError(_0x223682,null));};exports[_0xf63a('0x3e')]=function(_0x483abe,_0x1ba11f){var _0x161d83={'raw':!![],'where':{'id':_0x483abe[_0xf63a('0x3f')]['id']}},_0x5a6f72={};_0x5a6f72[_0xf63a('0x2d')]=_[_0xf63a('0x40')](db[_0xf63a('0x3b')]['rawAttributes']);_0x5a6f72[_0xf63a('0x30')]=_['keys'](_0x483abe[_0xf63a('0x30')]);_0x5a6f72['filters']=_[_0xf63a('0x2f')](_0x5a6f72[_0xf63a('0x2d')],_0x5a6f72[_0xf63a('0x30')]);_0x161d83[_0xf63a('0x31')]=_['intersection'](_0x5a6f72[_0xf63a('0x2d')],qs[_0xf63a('0x32')](_0x483abe[_0xf63a('0x30')][_0xf63a('0x32')]));_0x161d83[_0xf63a('0x31')]=_0x161d83[_0xf63a('0x31')][_0xf63a('0x41')]?_0x161d83[_0xf63a('0x31')]:_0x5a6f72[_0xf63a('0x2d')];if(_0x483abe['query'][_0xf63a('0x3a')]){_0x161d83['include']=[{'all':!![]}];}_0x161d83=_['merge']({},_0x161d83,_0x483abe['options']);return db[_0xf63a('0x3b')]['find'](_0x161d83)[_0xf63a('0x25')](handleEntityNotFound(_0x1ba11f,null))['then'](respondWithResult(_0x1ba11f,null))[_0xf63a('0x3d')](handleError(_0x1ba11f,null));};exports['create']=function(_0x275e2f,_0x4de72b){return db['SquareReport']['create'](_0x275e2f['body'],{})['then'](respondWithResult(_0x4de72b,0xc9))[_0xf63a('0x3d')](handleError(_0x4de72b,null));};exports[_0xf63a('0x24')]=function(_0xdb8c74,_0x185d68){if(_0xdb8c74['body']['id']){delete _0xdb8c74[_0xf63a('0x42')]['id'];}return db[_0xf63a('0x3b')][_0xf63a('0x43')]({'where':{'id':_0xdb8c74[_0xf63a('0x3f')]['id']}})[_0xf63a('0x25')](handleEntityNotFound(_0x185d68,null))[_0xf63a('0x25')](saveUpdates(_0xdb8c74[_0xf63a('0x42')],null))['then'](respondWithResult(_0x185d68,null))[_0xf63a('0x3d')](handleError(_0x185d68,null));};exports[_0xf63a('0x44')]=function(_0x545faa,_0x514cd2){return db['SquareReport'][_0xf63a('0x43')]({'where':{'id':_0x545faa[_0xf63a('0x3f')]['id']}})[_0xf63a('0x25')](handleEntityNotFound(_0x514cd2,null))[_0xf63a('0x25')](removeEntity(_0x514cd2,null))[_0xf63a('0x3d')](handleError(_0x514cd2,null));};exports[_0xf63a('0x45')]=function(_0x7f7d9f,_0x4539cd){return db[_0xf63a('0x3b')][_0xf63a('0x45')]()[_0xf63a('0x25')](respondWithResult(_0x4539cd,null))['catch'](handleError(_0x4539cd,null));}; \ No newline at end of file +var _0x0964=['index','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','SquareReport','findAll','rows','show','params','include','merge','find','catch','create','body','update','describe','eml-format','zip-dir','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','end','error','name','send'];(function(_0xe5f98c,_0x3a6ed9){var _0xbb6f62=function(_0x26090){while(--_0x26090){_0xe5f98c['push'](_0xe5f98c['shift']());}};_0xbb6f62(++_0x3a6ed9);}(_0x0964,0x1d9));var _0x4096=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x0964[_0x263a74];return _0x2aa86c;};'use strict';var emlformat=require(_0x4096('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4096('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4096('0x2'));var BPromise=require(_0x4096('0x3'));var Mustache=require(_0x4096('0x4'));var util=require(_0x4096('0x5'));var path=require(_0x4096('0x6'));var sox=require('sox');var csv=require(_0x4096('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4096('0x8'));var _=require('lodash');var squel=require(_0x4096('0x9'));var crypto=require(_0x4096('0xa'));var jsforce=require(_0x4096('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4096('0x7'));var querystring=require(_0x4096('0xc'));var Papa=require('papaparse');var Redis=require(_0x4096('0xd'));var authService=require(_0x4096('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4096('0xf'))(_0x4096('0x10'));var utils=require(_0x4096('0x11'));var config=require(_0x4096('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x4096('0x13'))['db'];function respondWithStatusCode(_0x54f029,_0x30afaf){_0x30afaf=_0x30afaf||0xcc;return function(_0x4eeab2){if(_0x4eeab2){return _0x54f029[_0x4096('0x14')](_0x30afaf);}return _0x54f029[_0x4096('0x15')](_0x30afaf)['end']();};}function respondWithResult(_0x30577,_0x2e7018){_0x2e7018=_0x2e7018||0xc8;return function(_0x1f6e71){if(_0x1f6e71){return _0x30577['status'](_0x2e7018)[_0x4096('0x16')](_0x1f6e71);}};}function respondWithFilteredResult(_0x444655,_0x5c94b7){return function(_0xa6f351){if(_0xa6f351){var _0x186533=typeof _0x5c94b7[_0x4096('0x17')]==='undefined'&&typeof _0x5c94b7[_0x4096('0x18')]===_0x4096('0x19');var _0x5f81ae=_0xa6f351['count'];var _0x36990d=_0x186533?0x0:_0x5c94b7[_0x4096('0x17')];var _0x338672=_0x186533?_0xa6f351[_0x4096('0x1a')]:_0x5c94b7['offset']+_0x5c94b7['limit'];var _0x38c3b5;if(_0x338672>=_0x5f81ae){_0x338672=_0x5f81ae;_0x38c3b5=0xc8;}else{_0x38c3b5=0xce;}_0x444655[_0x4096('0x15')](_0x38c3b5);return _0x444655[_0x4096('0x1b')](_0x4096('0x1c'),_0x36990d+'-'+_0x338672+'/'+_0x5f81ae)[_0x4096('0x16')](_0xa6f351);}return null;};}function patchUpdates(_0x53fa89){return function(_0x4c24c7){try{jsonpatch[_0x4096('0x1d')](_0x4c24c7,_0x53fa89,!![]);}catch(_0x4e787b){return BPromise[_0x4096('0x1e')](_0x4e787b);}return _0x4c24c7[_0x4096('0x1f')]();};}function saveUpdates(_0x33c4eb,_0x1809e1){return function(_0x5b5145){if(_0x5b5145){return _0x5b5145['update'](_0x33c4eb)['then'](function(_0x13ae58){return _0x13ae58;});}return null;};}function removeEntity(_0x273680,_0x1f9e0b){return function(_0x50acd4){if(_0x50acd4){return _0x50acd4[_0x4096('0x20')]()[_0x4096('0x21')](function(){_0x273680['status'](0xcc)[_0x4096('0x22')]();});}};}function handleEntityNotFound(_0x29123d,_0x29d868){return function(_0x14b7ed){if(!_0x14b7ed){_0x29123d['sendStatus'](0x194);}return _0x14b7ed;};}function handleError(_0x52b4a0,_0x19e057){_0x19e057=_0x19e057||0x1f4;return function(_0x2cbe74){logger[_0x4096('0x23')](_0x2cbe74['stack']);if(_0x2cbe74[_0x4096('0x24')]){delete _0x2cbe74[_0x4096('0x24')];}_0x52b4a0[_0x4096('0x15')](_0x19e057)[_0x4096('0x25')](_0x2cbe74);};}exports[_0x4096('0x26')]=function(_0x594d50,_0x5f48e0){var _0x493691={},_0x361016={},_0x43dcee={'count':0x0,'rows':[]};var _0x1cc7ea=_[_0x4096('0x27')](db['SquareReport'][_0x4096('0x28')],function(_0x2f06cd){return{'name':_0x2f06cd['fieldName'],'type':_0x2f06cd[_0x4096('0x29')][_0x4096('0x2a')]};});_0x361016['model']=_[_0x4096('0x27')](_0x1cc7ea,_0x4096('0x24'));_0x361016[_0x4096('0x2b')]=_[_0x4096('0x2c')](_0x594d50[_0x4096('0x2b')]);_0x361016[_0x4096('0x2d')]=_[_0x4096('0x2e')](_0x361016[_0x4096('0x2f')],_0x361016[_0x4096('0x2b')]);_0x493691[_0x4096('0x30')]=_[_0x4096('0x2e')](_0x361016[_0x4096('0x2f')],qs[_0x4096('0x31')](_0x594d50[_0x4096('0x2b')]['fields']));_0x493691[_0x4096('0x30')]=_0x493691['attributes'][_0x4096('0x32')]?_0x493691[_0x4096('0x30')]:_0x361016[_0x4096('0x2f')];if(!_0x594d50['query'][_0x4096('0x33')](_0x4096('0x34'))){_0x493691[_0x4096('0x18')]=qs[_0x4096('0x18')](_0x594d50[_0x4096('0x2b')][_0x4096('0x18')]);_0x493691['offset']=qs[_0x4096('0x17')](_0x594d50[_0x4096('0x2b')][_0x4096('0x17')]);}_0x493691[_0x4096('0x35')]=qs[_0x4096('0x36')](_0x594d50[_0x4096('0x2b')][_0x4096('0x36')]);_0x493691[_0x4096('0x37')]=qs[_0x4096('0x2d')](_[_0x4096('0x38')](_0x594d50['query'],_0x361016[_0x4096('0x2d')]),_0x1cc7ea);if(_0x594d50['query'][_0x4096('0x39')]){_0x493691[_0x4096('0x37')]=_['merge'](_0x493691[_0x4096('0x37')],{'$or':_[_0x4096('0x27')](_0x1cc7ea,function(_0x417492){if(_0x417492[_0x4096('0x29')]!==_0x4096('0x3a')){var _0x25c9fa={};_0x25c9fa[_0x417492[_0x4096('0x24')]]={'$like':'%'+_0x594d50['query'][_0x4096('0x39')]+'%'};return _0x25c9fa;}})});}_0x493691=_['merge']({},_0x493691,_0x594d50[_0x4096('0x3b')]);var _0x4d4677={'where':_0x493691[_0x4096('0x37')]};return db[_0x4096('0x3c')]['count'](_0x4d4677)[_0x4096('0x21')](function(_0x11814e){_0x43dcee['count']=_0x11814e;if(_0x594d50['query']['includeAll']){_0x493691['include']=[{'all':!![]}];}return db[_0x4096('0x3c')][_0x4096('0x3d')](_0x493691);})[_0x4096('0x21')](function(_0x2544ad){_0x43dcee[_0x4096('0x3e')]=_0x2544ad;return _0x43dcee;})['then'](respondWithFilteredResult(_0x5f48e0,_0x493691))['catch'](handleError(_0x5f48e0,null));};exports[_0x4096('0x3f')]=function(_0x15776a,_0x3f504b){var _0x72f466={'raw':!![],'where':{'id':_0x15776a[_0x4096('0x40')]['id']}},_0x199aea={};_0x199aea[_0x4096('0x2f')]=_['keys'](db[_0x4096('0x3c')][_0x4096('0x28')]);_0x199aea[_0x4096('0x2b')]=_[_0x4096('0x2c')](_0x15776a[_0x4096('0x2b')]);_0x199aea[_0x4096('0x2d')]=_[_0x4096('0x2e')](_0x199aea[_0x4096('0x2f')],_0x199aea[_0x4096('0x2b')]);_0x72f466[_0x4096('0x30')]=_[_0x4096('0x2e')](_0x199aea['model'],qs['fields'](_0x15776a[_0x4096('0x2b')]['fields']));_0x72f466[_0x4096('0x30')]=_0x72f466[_0x4096('0x30')]['length']?_0x72f466[_0x4096('0x30')]:_0x199aea[_0x4096('0x2f')];if(_0x15776a['query']['includeAll']){_0x72f466[_0x4096('0x41')]=[{'all':!![]}];}_0x72f466=_[_0x4096('0x42')]({},_0x72f466,_0x15776a['options']);return db[_0x4096('0x3c')][_0x4096('0x43')](_0x72f466)[_0x4096('0x21')](handleEntityNotFound(_0x3f504b,null))[_0x4096('0x21')](respondWithResult(_0x3f504b,null))[_0x4096('0x44')](handleError(_0x3f504b,null));};exports[_0x4096('0x45')]=function(_0x2ca4c1,_0x74b475){return db['SquareReport']['create'](_0x2ca4c1[_0x4096('0x46')],{})[_0x4096('0x21')](respondWithResult(_0x74b475,0xc9))[_0x4096('0x44')](handleError(_0x74b475,null));};exports[_0x4096('0x47')]=function(_0x65ad82,_0x113720){if(_0x65ad82[_0x4096('0x46')]['id']){delete _0x65ad82[_0x4096('0x46')]['id'];}return db[_0x4096('0x3c')][_0x4096('0x43')]({'where':{'id':_0x65ad82[_0x4096('0x40')]['id']}})[_0x4096('0x21')](handleEntityNotFound(_0x113720,null))[_0x4096('0x21')](saveUpdates(_0x65ad82[_0x4096('0x46')],null))[_0x4096('0x21')](respondWithResult(_0x113720,null))[_0x4096('0x44')](handleError(_0x113720,null));};exports['destroy']=function(_0x38cbb4,_0x18e21c){return db[_0x4096('0x3c')][_0x4096('0x43')]({'where':{'id':_0x38cbb4[_0x4096('0x40')]['id']}})['then'](handleEntityNotFound(_0x18e21c,null))[_0x4096('0x21')](removeEntity(_0x18e21c,null))[_0x4096('0x44')](handleError(_0x18e21c,null));};exports[_0x4096('0x48')]=function(_0x36dccc,_0x110b9f){return db[_0x4096('0x3c')]['describe']()['then'](respondWithResult(_0x110b9f,null))[_0x4096('0x44')](handleError(_0x110b9f,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index c236fbc..ff61034 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 _0x21ba=['uniqueid','project_name','leaveAt','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','SquareReport','report_square','uid_pname'];(function(_0x547ebe,_0x4f7358){var _0x8001ff=function(_0x332f62){while(--_0x332f62){_0x547ebe['push'](_0x547ebe['shift']());}};_0x8001ff(++_0x4f7358);}(_0x21ba,0xf1));var _0xa21b=function(_0x42e63e,_0x1ac8ad){_0x42e63e=_0x42e63e-0x0;var _0x4e4e1d=_0x21ba[_0x42e63e];return _0x4e4e1d;};'use strict';var _=require(_0xa21b('0x0'));var util=require('util');var logger=require(_0xa21b('0x1'))(_0xa21b('0x2'));var moment=require(_0xa21b('0x3'));var BPromise=require(_0xa21b('0x4'));var rp=require(_0xa21b('0x5'));var fs=require('fs');var path=require(_0xa21b('0x6'));var rimraf=require(_0xa21b('0x7'));var config=require(_0xa21b('0x8'));var attributes=require(_0xa21b('0x9'));module[_0xa21b('0xa')]=function(_0x86bcc7,_0x488cfb){return _0x86bcc7['define'](_0xa21b('0xb'),attributes,{'tableName':_0xa21b('0xc'),'paranoid':![],'indexes':[{'name':_0xa21b('0xd'),'fields':[_0xa21b('0xe'),_0xa21b('0xf')]},{'name':_0xa21b('0x10'),'fields':[_0xa21b('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf6ee=['./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x502662,_0x2a759d){var _0x413217=function(_0x1b9542){while(--_0x1b9542){_0x502662['push'](_0x502662['shift']());}};_0x413217(++_0x2a759d);}(_0xf6ee,0x1c9));var _0xef6e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf6ee[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xef6e('0x0'));var util=require('util');var logger=require(_0xef6e('0x1'))(_0xef6e('0x2'));var moment=require('moment');var BPromise=require(_0xef6e('0x3'));var rp=require(_0xef6e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xef6e('0x5'));var config=require(_0xef6e('0x6'));var attributes=require(_0xef6e('0x7'));module[_0xef6e('0x8')]=function(_0x3d8a01,_0x312f1a){return _0x3d8a01[_0xef6e('0x9')](_0xef6e('0xa'),attributes,{'tableName':_0xef6e('0xb'),'paranoid':![],'indexes':[{'name':_0xef6e('0xc'),'fields':[_0xef6e('0xd'),_0xef6e('0xe')]},{'name':'leaveAt','fields':[_0xef6e('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index c586495..ce30243 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 _0xc570=['catch','SquareReport','create','options','raw','info','CreateSquareReport','UpdateSquareReport','update','body','where','attributes','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x490545,_0x1e75bb){var _0x22c710=function(_0x59ea28){while(--_0x59ea28){_0x490545['push'](_0x490545['shift']());}};_0x22c710(++_0x1e75bb);}(_0xc570,0xb1));var _0x0c57=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xc570[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x0c57('0x0'));var util=require(_0x0c57('0x1'));var moment=require('moment');var BPromise=require(_0x0c57('0x2'));var rs=require(_0x0c57('0x3'));var fs=require('fs');var Redis=require(_0x0c57('0x4'));var db=require(_0x0c57('0x5'))['db'];var utils=require(_0x0c57('0x6'));var logger=require('../../config/logger')(_0x0c57('0x7'));var config=require(_0x0c57('0x8'));var jayson=require(_0x0c57('0x9'));var client=jayson[_0x0c57('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3141a7,_0x27e942,_0x289d00){return new BPromise(function(_0x5be112,_0x5277bd){return client[_0x0c57('0xb')](_0x3141a7,_0x289d00)[_0x0c57('0xc')](function(_0x1d7974){logger['info'](_0x0c57('0xd'),_0x27e942,_0x0c57('0xe'));logger[_0x0c57('0xf')](_0x0c57('0x10'),_0x27e942,'request\x20sent',JSON[_0x0c57('0x11')](_0x1d7974));if(_0x1d7974[_0x0c57('0x12')]){if(_0x1d7974[_0x0c57('0x12')][_0x0c57('0x13')]===0x1f4){logger['error'](_0x0c57('0xd'),_0x27e942,_0x1d7974[_0x0c57('0x12')][_0x0c57('0x14')]);return _0x5277bd(_0x1d7974['error']['message']);}logger[_0x0c57('0x12')](_0x0c57('0xd'),_0x27e942,_0x1d7974[_0x0c57('0x12')][_0x0c57('0x14')]);return _0x5be112(_0x1d7974[_0x0c57('0x12')]['message']);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x27e942,_0x0c57('0xe'));_0x5be112(_0x1d7974['result'][_0x0c57('0x14')]);}})[_0x0c57('0x15')](function(_0x2f73a9){logger['error'](_0x0c57('0xd'),_0x27e942,_0x2f73a9);_0x5277bd(_0x2f73a9);});});}exports['CreateSquareReport']=function(_0x4a323c){var _0x33cd10=this;return new Promise(function(_0x439165,_0x5572ca){return db[_0x0c57('0x16')][_0x0c57('0x17')](_0x4a323c['body'],{'raw':_0x4a323c[_0x0c57('0x18')]?_0x4a323c[_0x0c57('0x18')][_0x0c57('0x19')]===undefined?!![]:![]:!![]})[_0x0c57('0xc')](function(_0x5a5492){logger[_0x0c57('0x1a')](_0x0c57('0x1b'),_0x4a323c);logger[_0x0c57('0xf')](_0x0c57('0x1b'),_0x4a323c,JSON[_0x0c57('0x11')](_0x5a5492));_0x439165(_0x5a5492);})[_0x0c57('0x15')](function(_0x301161){logger[_0x0c57('0x12')](_0x0c57('0x1b'),_0x301161[_0x0c57('0x14')],_0x4a323c);_0x5572ca(_0x33cd10[_0x0c57('0x12')](0x1f4,_0x301161['message']));});});};exports[_0x0c57('0x1c')]=function(_0x4ac3cb){var _0x4ca4aa=this;return new Promise(function(_0x12a92e,_0x476924){return db['SquareReport'][_0x0c57('0x1d')](_0x4ac3cb[_0x0c57('0x1e')],{'raw':_0x4ac3cb[_0x0c57('0x18')]?_0x4ac3cb[_0x0c57('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ac3cb['options']?_0x4ac3cb[_0x0c57('0x18')][_0x0c57('0x1f')]||null:null,'attributes':_0x4ac3cb[_0x0c57('0x18')]?_0x4ac3cb[_0x0c57('0x18')][_0x0c57('0x20')]||null:null,'limit':_0x4ac3cb[_0x0c57('0x18')]?_0x4ac3cb[_0x0c57('0x18')]['limit']||null:null})['then'](function(_0x5291d8){logger['info'](_0x0c57('0x1c'),_0x4ac3cb);logger[_0x0c57('0xf')](_0x0c57('0x1c'),_0x4ac3cb,JSON['stringify'](_0x5291d8));_0x12a92e(_0x5291d8);})[_0x0c57('0x15')](function(_0x3ac010){logger['error'](_0x0c57('0x1c'),_0x3ac010[_0x0c57('0x14')],_0x4ac3cb);_0x476924(_0x4ca4aa[_0x0c57('0x12')](0x1f4,_0x3ac010[_0x0c57('0x14')]));});});}; \ No newline at end of file +var _0x53e0=['SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareReport,\x20%s,\x20%s','message','result','catch','CreateSquareReport','SquareReport','body','options','then','debug','UpdateSquareReport','update','raw','where','limit','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent'];(function(_0x3ae38d,_0x2357de){var _0x4e7d5e=function(_0xd99aee){while(--_0xd99aee){_0x3ae38d['push'](_0x3ae38d['shift']());}};_0x4e7d5e(++_0x2357de);}(_0x53e0,0x8f));var _0x053e=function(_0x173dd9,_0x4ecf44){_0x173dd9=_0x173dd9-0x0;var _0x5a0d5a=_0x53e0[_0x173dd9];return _0x5a0d5a;};'use strict';var _=require(_0x053e('0x0'));var util=require('util');var moment=require(_0x053e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x053e('0x2'))['db'];var utils=require(_0x053e('0x3'));var logger=require(_0x053e('0x4'))(_0x053e('0x5'));var config=require(_0x053e('0x6'));var jayson=require(_0x053e('0x7'));var client=jayson[_0x053e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x461d41,_0x3f174e,_0x1cc7d1){return new BPromise(function(_0x20c317,_0xcde946){return client[_0x053e('0x9')](_0x461d41,_0x1cc7d1)['then'](function(_0x235355){logger[_0x053e('0xa')]('SquareReport,\x20%s,\x20%s',_0x3f174e,_0x053e('0xb'));logger['debug'](_0x053e('0xc'),_0x3f174e,_0x053e('0xb'),JSON[_0x053e('0xd')](_0x235355));if(_0x235355[_0x053e('0xe')]){if(_0x235355[_0x053e('0xe')][_0x053e('0xf')]===0x1f4){logger[_0x053e('0xe')](_0x053e('0x10'),_0x3f174e,_0x235355['error'][_0x053e('0x11')]);return _0xcde946(_0x235355[_0x053e('0xe')][_0x053e('0x11')]);}logger[_0x053e('0xe')](_0x053e('0x10'),_0x3f174e,_0x235355[_0x053e('0xe')]['message']);return _0x20c317(_0x235355[_0x053e('0xe')][_0x053e('0x11')]);}else{logger['info'](_0x053e('0x10'),_0x3f174e,_0x053e('0xb'));_0x20c317(_0x235355[_0x053e('0x12')][_0x053e('0x11')]);}})[_0x053e('0x13')](function(_0x50a56c){logger[_0x053e('0xe')]('SquareReport,\x20%s,\x20%s',_0x3f174e,_0x50a56c);_0xcde946(_0x50a56c);});});}exports[_0x053e('0x14')]=function(_0x5587d4){var _0x583eba=this;return new Promise(function(_0x267c00,_0x5e3e84){return db[_0x053e('0x15')]['create'](_0x5587d4[_0x053e('0x16')],{'raw':_0x5587d4['options']?_0x5587d4[_0x053e('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x053e('0x18')](function(_0x4e0bea){logger[_0x053e('0xa')]('CreateSquareReport',_0x5587d4);logger[_0x053e('0x19')](_0x053e('0x14'),_0x5587d4,JSON[_0x053e('0xd')](_0x4e0bea));_0x267c00(_0x4e0bea);})[_0x053e('0x13')](function(_0x40c819){logger['error'](_0x053e('0x14'),_0x40c819[_0x053e('0x11')],_0x5587d4);_0x5e3e84(_0x583eba[_0x053e('0xe')](0x1f4,_0x40c819[_0x053e('0x11')]));});});};exports[_0x053e('0x1a')]=function(_0x3f07ff){var _0x1c1849=this;return new Promise(function(_0x22720e,_0x3f75c2){return db['SquareReport'][_0x053e('0x1b')](_0x3f07ff[_0x053e('0x16')],{'raw':_0x3f07ff[_0x053e('0x17')]?_0x3f07ff[_0x053e('0x17')][_0x053e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f07ff[_0x053e('0x17')]?_0x3f07ff[_0x053e('0x17')][_0x053e('0x1d')]||null:null,'attributes':_0x3f07ff['options']?_0x3f07ff[_0x053e('0x17')]['attributes']||null:null,'limit':_0x3f07ff[_0x053e('0x17')]?_0x3f07ff['options'][_0x053e('0x1e')]||null:null})[_0x053e('0x18')](function(_0x4d517f){logger['info'](_0x053e('0x1a'),_0x3f07ff);logger[_0x053e('0x19')](_0x053e('0x1a'),_0x3f07ff,JSON[_0x053e('0xd')](_0x4d517f));_0x22720e(_0x4d517f);})[_0x053e('0x13')](function(_0x1f9cbe){logger[_0x053e('0xe')](_0x053e('0x1a'),_0x1f9cbe[_0x053e('0x11')],_0x3f07ff);_0x3f75c2(_0x1c1849[_0x053e('0xe')](0x1f4,_0x1f9cbe['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 650a57b..52d44e4 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 _0x824b=['delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','/describe','describe','/:id','put'];(function(_0x36770e,_0x152503){var _0x30d73b=function(_0x2b7c0){while(--_0x2b7c0){_0x36770e['push'](_0x36770e['shift']());}};_0x30d73b(++_0x152503);}(_0x824b,0xbe));var _0xb824=function(_0x393084,_0x4badb4){_0x393084=_0x393084-0x0;var _0x42807f=_0x824b[_0x393084];return _0x42807f;};'use strict';var multer=require(_0xb824('0x0'));var util=require(_0xb824('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb824('0x2'));var router=express[_0xb824('0x3')]();var fs_extra=require(_0xb824('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb824('0x5'));var config=require(_0xb824('0x6'));var controller=require(_0xb824('0x7'));router[_0xb824('0x8')]('/',auth[_0xb824('0x9')](),controller['index']);router[_0xb824('0x8')](_0xb824('0xa'),auth[_0xb824('0x9')](),controller[_0xb824('0xb')]);router[_0xb824('0x8')](_0xb824('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xb824('0x9')](),controller['create']);router[_0xb824('0xd')](_0xb824('0xc'),auth[_0xb824('0x9')](),controller['update']);router[_0xb824('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xb824('0xf')]);module[_0xb824('0x10')]=router; \ No newline at end of file +var _0x091e=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','exports','multer','util','express'];(function(_0x495b3d,_0x4d3da4){var _0x4cb329=function(_0xdef9f0){while(--_0xdef9f0){_0x495b3d['push'](_0x495b3d['shift']());}};_0x4cb329(++_0x4d3da4);}(_0x091e,0x189));var _0xe091=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x091e[_0x47aa64];return _0x549c7a;};'use strict';var multer=require(_0xe091('0x0'));var util=require(_0xe091('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe091('0x2'));var router=express[_0xe091('0x3')]();var fs_extra=require(_0xe091('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe091('0x5'));var config=require(_0xe091('0x6'));var controller=require('./squareReportDetail.controller');router[_0xe091('0x7')]('/',auth[_0xe091('0x8')](),controller['index']);router[_0xe091('0x7')](_0xe091('0x9'),auth[_0xe091('0x8')](),controller[_0xe091('0xa')]);router[_0xe091('0x7')](_0xe091('0xb'),auth[_0xe091('0x8')](),controller[_0xe091('0xc')]);router[_0xe091('0xd')]('/',auth[_0xe091('0x8')](),controller[_0xe091('0xe')]);router[_0xe091('0xf')](_0xe091('0xb'),auth[_0xe091('0x8')](),controller['update']);router[_0xe091('0x10')](_0xe091('0xb'),auth[_0xe091('0x8')](),controller['destroy']);module[_0xe091('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 2aefae9..da9a24e 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 _0xdd10=['sequelize','exports','STRING','TEXT'];(function(_0x55255f,_0x5cf36c){var _0x387fef=function(_0x8a134){while(--_0x8a134){_0x55255f['push'](_0x55255f['shift']());}};_0x387fef(++_0x5cf36c);}(_0xdd10,0x1d4));var _0x0dd1=function(_0x241368,_0x31d283){_0x241368=_0x241368-0x0;var _0x3855a=_0xdd10[_0x241368];return _0x3855a;};'use strict';var Sequelize=require(_0x0dd1('0x0'));module[_0x0dd1('0x1')]={'uniqueid':{'type':Sequelize[_0x0dd1('0x2')]},'node':{'type':Sequelize[_0x0dd1('0x2')]},'application':{'type':Sequelize[_0x0dd1('0x2')]},'data':{'type':Sequelize[_0x0dd1('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x0dd1('0x2')]}}; \ No newline at end of file +var _0x77a9=['STRING','TEXT','sequelize','exports'];(function(_0x3bd5f1,_0x3db05d){var _0x88a393=function(_0x2a02de){while(--_0x2a02de){_0x3bd5f1['push'](_0x3bd5f1['shift']());}};_0x88a393(++_0x3db05d);}(_0x77a9,0x182));var _0x977a=function(_0x1371ed,_0x5bff22){_0x1371ed=_0x1371ed-0x0;var _0x1065ef=_0x77a9[_0x1371ed];return _0x1065ef;};'use strict';var Sequelize=require(_0x977a('0x0'));module[_0x977a('0x1')]={'uniqueid':{'type':Sequelize[_0x977a('0x2')]},'node':{'type':Sequelize[_0x977a('0x2')]},'application':{'type':Sequelize[_0x977a('0x2')]},'data':{'type':Sequelize[_0x977a('0x3')]},'project_name':{'type':Sequelize[_0x977a('0x2')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index b5c3e2c..91cb7a0 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 _0x55e3=['squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','then','sendStatus','error','stack','name','send','index','map','SquareDetailsReport','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','findAll','rows','show','rawAttributes','keys','length','includeAll','catch','create','body','destroy','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x55e3,0xd4));var _0x355e=function(_0x30efdc,_0x241e18){_0x30efdc=_0x30efdc-0x0;var _0x47c278=_0x55e3[_0x30efdc];return _0x47c278;};'use strict';var emlformat=require(_0x355e('0x0'));var rimraf=require(_0x355e('0x1'));var zipdir=require(_0x355e('0x2'));var jsonpatch=require(_0x355e('0x3'));var rp=require(_0x355e('0x4'));var moment=require(_0x355e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x355e('0x6'));var util=require(_0x355e('0x7'));var path=require(_0x355e('0x8'));var sox=require(_0x355e('0x9'));var csv=require(_0x355e('0xa'));var ejs=require(_0x355e('0xb'));var fs=require('fs');var fs_extra=require(_0x355e('0xc'));var _=require('lodash');var squel=require(_0x355e('0xd'));var crypto=require(_0x355e('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x355e('0xa'));var querystring=require(_0x355e('0xf'));var Papa=require(_0x355e('0x10'));var Redis=require(_0x355e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x355e('0x12'));var hardwareService=require(_0x355e('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x355e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x355e('0x15'));var db=require(_0x355e('0x16'))['db'];function respondWithStatusCode(_0x2ee4cc,_0x5d2ec6){_0x5d2ec6=_0x5d2ec6||0xcc;return function(_0x1d5022){if(_0x1d5022){return _0x2ee4cc['sendStatus'](_0x5d2ec6);}return _0x2ee4cc[_0x355e('0x17')](_0x5d2ec6)[_0x355e('0x18')]();};}function respondWithResult(_0x1ed400,_0x2faa8e){_0x2faa8e=_0x2faa8e||0xc8;return function(_0xdf1180){if(_0xdf1180){return _0x1ed400['status'](_0x2faa8e)[_0x355e('0x19')](_0xdf1180);}};}function respondWithFilteredResult(_0x1cc719,_0x4bfbf2){return function(_0x5d52c2){if(_0x5d52c2){var _0xc5783=typeof _0x4bfbf2['offset']===_0x355e('0x1a')&&typeof _0x4bfbf2[_0x355e('0x1b')]===_0x355e('0x1a');var _0x1f9b6b=_0x5d52c2['count'];var _0x1b3cac=_0xc5783?0x0:_0x4bfbf2[_0x355e('0x1c')];var _0x2713fa=_0xc5783?_0x5d52c2[_0x355e('0x1d')]:_0x4bfbf2[_0x355e('0x1c')]+_0x4bfbf2[_0x355e('0x1b')];var _0x5465fe;if(_0x2713fa>=_0x1f9b6b){_0x2713fa=_0x1f9b6b;_0x5465fe=0xc8;}else{_0x5465fe=0xce;}_0x1cc719[_0x355e('0x17')](_0x5465fe);return _0x1cc719[_0x355e('0x1e')](_0x355e('0x1f'),_0x1b3cac+'-'+_0x2713fa+'/'+_0x1f9b6b)[_0x355e('0x19')](_0x5d52c2);}return null;};}function patchUpdates(_0x54b6b6){return function(_0x170972){try{jsonpatch[_0x355e('0x20')](_0x170972,_0x54b6b6,!![]);}catch(_0x4f5f17){return BPromise['reject'](_0x4f5f17);}return _0x170972['save']();};}function saveUpdates(_0x51b687,_0x56582b){return function(_0x3b1959){if(_0x3b1959){return _0x3b1959['update'](_0x51b687)[_0x355e('0x21')](function(_0x3f7c16){return _0x3f7c16;});}return null;};}function removeEntity(_0x1341be,_0xc58e4e){return function(_0x43c165){if(_0x43c165){return _0x43c165['destroy']()['then'](function(){_0x1341be[_0x355e('0x17')](0xcc)[_0x355e('0x18')]();});}};}function handleEntityNotFound(_0x50a39b,_0x32133e){return function(_0x558385){if(!_0x558385){_0x50a39b[_0x355e('0x22')](0x194);}return _0x558385;};}function handleError(_0x236ca7,_0xed4dfd){_0xed4dfd=_0xed4dfd||0x1f4;return function(_0x468aa4){logger[_0x355e('0x23')](_0x468aa4[_0x355e('0x24')]);if(_0x468aa4[_0x355e('0x25')]){delete _0x468aa4[_0x355e('0x25')];}_0x236ca7[_0x355e('0x17')](_0xed4dfd)[_0x355e('0x26')](_0x468aa4);};}exports[_0x355e('0x27')]=function(_0x168706,_0x5f3977){var _0x26ddaf={},_0x13c228={},_0x5a8ff8={'count':0x0,'rows':[]};var _0x24e6b2=_[_0x355e('0x28')](db[_0x355e('0x29')]['rawAttributes'],function(_0x3501cb){return{'name':_0x3501cb[_0x355e('0x2a')],'type':_0x3501cb['type'][_0x355e('0x2b')]};});_0x13c228[_0x355e('0x2c')]=_[_0x355e('0x28')](_0x24e6b2,'name');_0x13c228[_0x355e('0x2d')]=_['keys'](_0x168706['query']);_0x13c228[_0x355e('0x2e')]=_[_0x355e('0x2f')](_0x13c228[_0x355e('0x2c')],_0x13c228[_0x355e('0x2d')]);_0x26ddaf['attributes']=_['intersection'](_0x13c228[_0x355e('0x2c')],qs['fields'](_0x168706[_0x355e('0x2d')][_0x355e('0x30')]));_0x26ddaf[_0x355e('0x31')]=_0x26ddaf[_0x355e('0x31')]['length']?_0x26ddaf['attributes']:_0x13c228[_0x355e('0x2c')];if(!_0x168706['query'][_0x355e('0x32')](_0x355e('0x33'))){_0x26ddaf['limit']=qs['limit'](_0x168706[_0x355e('0x2d')][_0x355e('0x1b')]);_0x26ddaf['offset']=qs[_0x355e('0x1c')](_0x168706[_0x355e('0x2d')]['offset']);}_0x26ddaf[_0x355e('0x34')]=qs['sort'](_0x168706[_0x355e('0x2d')][_0x355e('0x35')]);_0x26ddaf['where']=qs[_0x355e('0x2e')](_[_0x355e('0x36')](_0x168706['query'],_0x13c228[_0x355e('0x2e')]),_0x24e6b2);if(_0x168706[_0x355e('0x2d')][_0x355e('0x37')]){_0x26ddaf[_0x355e('0x38')]=_['merge'](_0x26ddaf[_0x355e('0x38')],{'$or':_[_0x355e('0x28')](_0x24e6b2,function(_0x2f83e5){if(_0x2f83e5[_0x355e('0x39')]!==_0x355e('0x3a')){var _0x2272d8={};_0x2272d8[_0x2f83e5['name']]={'$like':'%'+_0x168706['query'][_0x355e('0x37')]+'%'};return _0x2272d8;}})});}_0x26ddaf=_[_0x355e('0x3b')]({},_0x26ddaf,_0x168706[_0x355e('0x3c')]);var _0x1d46ac={'where':_0x26ddaf[_0x355e('0x38')]};return db[_0x355e('0x29')][_0x355e('0x1d')](_0x1d46ac)['then'](function(_0x25690b){_0x5a8ff8[_0x355e('0x1d')]=_0x25690b;if(_0x168706[_0x355e('0x2d')]['includeAll']){_0x26ddaf['include']=[{'all':!![]}];}return db[_0x355e('0x29')][_0x355e('0x3d')](_0x26ddaf);})[_0x355e('0x21')](function(_0x3c5e9a){_0x5a8ff8[_0x355e('0x3e')]=_0x3c5e9a;return _0x5a8ff8;})[_0x355e('0x21')](respondWithFilteredResult(_0x5f3977,_0x26ddaf))['catch'](handleError(_0x5f3977,null));};exports[_0x355e('0x3f')]=function(_0x2e9c70,_0x56b4b7){var _0xa1ff80={'raw':!![],'where':{'id':_0x2e9c70['params']['id']}},_0x52c3ba={};_0x52c3ba['model']=_['keys'](db[_0x355e('0x29')][_0x355e('0x40')]);_0x52c3ba['query']=_[_0x355e('0x41')](_0x2e9c70[_0x355e('0x2d')]);_0x52c3ba['filters']=_[_0x355e('0x2f')](_0x52c3ba[_0x355e('0x2c')],_0x52c3ba[_0x355e('0x2d')]);_0xa1ff80['attributes']=_[_0x355e('0x2f')](_0x52c3ba['model'],qs[_0x355e('0x30')](_0x2e9c70[_0x355e('0x2d')][_0x355e('0x30')]));_0xa1ff80[_0x355e('0x31')]=_0xa1ff80['attributes'][_0x355e('0x42')]?_0xa1ff80['attributes']:_0x52c3ba[_0x355e('0x2c')];if(_0x2e9c70[_0x355e('0x2d')][_0x355e('0x43')]){_0xa1ff80['include']=[{'all':!![]}];}_0xa1ff80=_[_0x355e('0x3b')]({},_0xa1ff80,_0x2e9c70[_0x355e('0x3c')]);return db[_0x355e('0x29')]['find'](_0xa1ff80)[_0x355e('0x21')](handleEntityNotFound(_0x56b4b7,null))[_0x355e('0x21')](respondWithResult(_0x56b4b7,null))[_0x355e('0x44')](handleError(_0x56b4b7,null));};exports[_0x355e('0x45')]=function(_0x38eae0,_0x344ee7){return db[_0x355e('0x29')][_0x355e('0x45')](_0x38eae0[_0x355e('0x46')],{})[_0x355e('0x21')](respondWithResult(_0x344ee7,0xc9))[_0x355e('0x44')](handleError(_0x344ee7,null));};exports['update']=function(_0x40e0d6,_0x3f1090){if(_0x40e0d6[_0x355e('0x46')]['id']){delete _0x40e0d6[_0x355e('0x46')]['id'];}return db[_0x355e('0x29')]['find']({'where':{'id':_0x40e0d6['params']['id']}})[_0x355e('0x21')](handleEntityNotFound(_0x3f1090,null))['then'](saveUpdates(_0x40e0d6['body'],null))[_0x355e('0x21')](respondWithResult(_0x3f1090,null))[_0x355e('0x44')](handleError(_0x3f1090,null));};exports[_0x355e('0x47')]=function(_0x607a34,_0x8a4175){return db[_0x355e('0x29')][_0x355e('0x48')]({'where':{'id':_0x607a34[_0x355e('0x49')]['id']}})[_0x355e('0x21')](handleEntityNotFound(_0x8a4175,null))['then'](removeEntity(_0x8a4175,null))['catch'](handleError(_0x8a4175,null));};exports[_0x355e('0x4a')]=function(_0x4ca499,_0xd5f9b1){return db[_0x355e('0x29')][_0x355e('0x4a')]()['then'](respondWithResult(_0xd5f9b1,null))[_0x355e('0x44')](handleError(_0xd5f9b1,null));}; \ No newline at end of file +var _0xdcfa=['filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','stack','name','send','index','map','SquareDetailsReport','rawAttributes','type','key','query','keys','model','attributes','intersection','fields','hasOwnProperty','sort','where','filters'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xdcfa,0x182));var _0xadcf=function(_0x3a951e,_0x35eade){_0x3a951e=_0x3a951e-0x0;var _0x142e63=_0xdcfa[_0x3a951e];return _0x142e63;};'use strict';var emlformat=require(_0xadcf('0x0'));var rimraf=require(_0xadcf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xadcf('0x2'));var rp=require(_0xadcf('0x3'));var moment=require(_0xadcf('0x4'));var BPromise=require(_0xadcf('0x5'));var Mustache=require(_0xadcf('0x6'));var util=require('util');var path=require('path');var sox=require(_0xadcf('0x7'));var csv=require(_0xadcf('0x8'));var ejs=require(_0xadcf('0x9'));var fs=require('fs');var fs_extra=require(_0xadcf('0xa'));var _=require(_0xadcf('0xb'));var squel=require('squel');var crypto=require(_0xadcf('0xc'));var jsforce=require(_0xadcf('0xd'));var deskjs=require(_0xadcf('0xe'));var toCsv=require(_0xadcf('0x8'));var querystring=require(_0xadcf('0xf'));var Papa=require('papaparse');var Redis=require(_0xadcf('0x10'));var authService=require(_0xadcf('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xadcf('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xadcf('0x13'))(_0xadcf('0x14'));var utils=require(_0xadcf('0x15'));var config=require(_0xadcf('0x16'));var licenseUtil=require(_0xadcf('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cfb01,_0x5cfc06){_0x5cfc06=_0x5cfc06||0xcc;return function(_0x566c9a){if(_0x566c9a){return _0x1cfb01[_0xadcf('0x18')](_0x5cfc06);}return _0x1cfb01['status'](_0x5cfc06)[_0xadcf('0x19')]();};}function respondWithResult(_0x576edd,_0x5c04be){_0x5c04be=_0x5c04be||0xc8;return function(_0x441d74){if(_0x441d74){return _0x576edd[_0xadcf('0x1a')](_0x5c04be)[_0xadcf('0x1b')](_0x441d74);}};}function respondWithFilteredResult(_0x142acb,_0x4c6677){return function(_0x59f7fd){if(_0x59f7fd){var _0x2aefb0=typeof _0x4c6677[_0xadcf('0x1c')]==='undefined'&&typeof _0x4c6677[_0xadcf('0x1d')]===_0xadcf('0x1e');var _0x45a1e2=_0x59f7fd[_0xadcf('0x1f')];var _0x298f42=_0x2aefb0?0x0:_0x4c6677['offset'];var _0x104750=_0x2aefb0?_0x59f7fd[_0xadcf('0x1f')]:_0x4c6677[_0xadcf('0x1c')]+_0x4c6677[_0xadcf('0x1d')];var _0x174c3f;if(_0x104750>=_0x45a1e2){_0x104750=_0x45a1e2;_0x174c3f=0xc8;}else{_0x174c3f=0xce;}_0x142acb['status'](_0x174c3f);return _0x142acb[_0xadcf('0x20')](_0xadcf('0x21'),_0x298f42+'-'+_0x104750+'/'+_0x45a1e2)[_0xadcf('0x1b')](_0x59f7fd);}return null;};}function patchUpdates(_0x3b3a5f){return function(_0x1be41b){try{jsonpatch[_0xadcf('0x22')](_0x1be41b,_0x3b3a5f,!![]);}catch(_0x1f25a3){return BPromise['reject'](_0x1f25a3);}return _0x1be41b[_0xadcf('0x23')]();};}function saveUpdates(_0x2def15,_0x5bff8b){return function(_0x3225c1){if(_0x3225c1){return _0x3225c1[_0xadcf('0x24')](_0x2def15)['then'](function(_0x2a44bb){return _0x2a44bb;});}return null;};}function removeEntity(_0x593af4,_0x1b1b59){return function(_0x2c9fc0){if(_0x2c9fc0){return _0x2c9fc0[_0xadcf('0x25')]()[_0xadcf('0x26')](function(){_0x593af4[_0xadcf('0x1a')](0xcc)[_0xadcf('0x19')]();});}};}function handleEntityNotFound(_0x26c6e4,_0x47efe6){return function(_0x5b2bbc){if(!_0x5b2bbc){_0x26c6e4['sendStatus'](0x194);}return _0x5b2bbc;};}function handleError(_0x519feb,_0x4d4e42){_0x4d4e42=_0x4d4e42||0x1f4;return function(_0x416e5a){logger['error'](_0x416e5a[_0xadcf('0x27')]);if(_0x416e5a['name']){delete _0x416e5a[_0xadcf('0x28')];}_0x519feb[_0xadcf('0x1a')](_0x4d4e42)[_0xadcf('0x29')](_0x416e5a);};}exports[_0xadcf('0x2a')]=function(_0xc7e240,_0x30bb5e){var _0x2a48d9={},_0x4c49f0={},_0x18e9e6={'count':0x0,'rows':[]};var _0x453c6a=_[_0xadcf('0x2b')](db[_0xadcf('0x2c')][_0xadcf('0x2d')],function(_0x4c3cd3){return{'name':_0x4c3cd3['fieldName'],'type':_0x4c3cd3[_0xadcf('0x2e')][_0xadcf('0x2f')]};});_0x4c49f0['model']=_[_0xadcf('0x2b')](_0x453c6a,_0xadcf('0x28'));_0x4c49f0[_0xadcf('0x30')]=_[_0xadcf('0x31')](_0xc7e240[_0xadcf('0x30')]);_0x4c49f0['filters']=_['intersection'](_0x4c49f0[_0xadcf('0x32')],_0x4c49f0['query']);_0x2a48d9[_0xadcf('0x33')]=_[_0xadcf('0x34')](_0x4c49f0[_0xadcf('0x32')],qs['fields'](_0xc7e240[_0xadcf('0x30')][_0xadcf('0x35')]));_0x2a48d9[_0xadcf('0x33')]=_0x2a48d9[_0xadcf('0x33')]['length']?_0x2a48d9[_0xadcf('0x33')]:_0x4c49f0[_0xadcf('0x32')];if(!_0xc7e240[_0xadcf('0x30')][_0xadcf('0x36')]('nolimit')){_0x2a48d9[_0xadcf('0x1d')]=qs[_0xadcf('0x1d')](_0xc7e240[_0xadcf('0x30')][_0xadcf('0x1d')]);_0x2a48d9[_0xadcf('0x1c')]=qs[_0xadcf('0x1c')](_0xc7e240[_0xadcf('0x30')][_0xadcf('0x1c')]);}_0x2a48d9['order']=qs[_0xadcf('0x37')](_0xc7e240[_0xadcf('0x30')]['sort']);_0x2a48d9[_0xadcf('0x38')]=qs[_0xadcf('0x39')](_['pick'](_0xc7e240[_0xadcf('0x30')],_0x4c49f0['filters']),_0x453c6a);if(_0xc7e240[_0xadcf('0x30')][_0xadcf('0x3a')]){_0x2a48d9[_0xadcf('0x38')]=_[_0xadcf('0x3b')](_0x2a48d9[_0xadcf('0x38')],{'$or':_[_0xadcf('0x2b')](_0x453c6a,function(_0x281cdd){if(_0x281cdd['type']!==_0xadcf('0x3c')){var _0x44dda2={};_0x44dda2[_0x281cdd['name']]={'$like':'%'+_0xc7e240[_0xadcf('0x30')][_0xadcf('0x3a')]+'%'};return _0x44dda2;}})});}_0x2a48d9=_[_0xadcf('0x3b')]({},_0x2a48d9,_0xc7e240[_0xadcf('0x3d')]);var _0x312115={'where':_0x2a48d9[_0xadcf('0x38')]};return db[_0xadcf('0x2c')][_0xadcf('0x1f')](_0x312115)['then'](function(_0x49f715){_0x18e9e6[_0xadcf('0x1f')]=_0x49f715;if(_0xc7e240[_0xadcf('0x30')][_0xadcf('0x3e')]){_0x2a48d9[_0xadcf('0x3f')]=[{'all':!![]}];}return db[_0xadcf('0x2c')][_0xadcf('0x40')](_0x2a48d9);})['then'](function(_0xa44c76){_0x18e9e6[_0xadcf('0x41')]=_0xa44c76;return _0x18e9e6;})[_0xadcf('0x26')](respondWithFilteredResult(_0x30bb5e,_0x2a48d9))[_0xadcf('0x42')](handleError(_0x30bb5e,null));};exports[_0xadcf('0x43')]=function(_0x3e1453,_0x2279fc){var _0x22bdb4={'raw':!![],'where':{'id':_0x3e1453[_0xadcf('0x44')]['id']}},_0x40d152={};_0x40d152[_0xadcf('0x32')]=_['keys'](db[_0xadcf('0x2c')][_0xadcf('0x2d')]);_0x40d152[_0xadcf('0x30')]=_[_0xadcf('0x31')](_0x3e1453[_0xadcf('0x30')]);_0x40d152['filters']=_[_0xadcf('0x34')](_0x40d152['model'],_0x40d152['query']);_0x22bdb4[_0xadcf('0x33')]=_[_0xadcf('0x34')](_0x40d152[_0xadcf('0x32')],qs[_0xadcf('0x35')](_0x3e1453[_0xadcf('0x30')][_0xadcf('0x35')]));_0x22bdb4[_0xadcf('0x33')]=_0x22bdb4[_0xadcf('0x33')][_0xadcf('0x45')]?_0x22bdb4[_0xadcf('0x33')]:_0x40d152[_0xadcf('0x32')];if(_0x3e1453[_0xadcf('0x30')][_0xadcf('0x3e')]){_0x22bdb4['include']=[{'all':!![]}];}_0x22bdb4=_[_0xadcf('0x3b')]({},_0x22bdb4,_0x3e1453[_0xadcf('0x3d')]);return db[_0xadcf('0x2c')][_0xadcf('0x46')](_0x22bdb4)[_0xadcf('0x26')](handleEntityNotFound(_0x2279fc,null))['then'](respondWithResult(_0x2279fc,null))[_0xadcf('0x42')](handleError(_0x2279fc,null));};exports[_0xadcf('0x47')]=function(_0x12b3ba,_0x379c94){return db[_0xadcf('0x2c')][_0xadcf('0x47')](_0x12b3ba[_0xadcf('0x48')],{})[_0xadcf('0x26')](respondWithResult(_0x379c94,0xc9))[_0xadcf('0x42')](handleError(_0x379c94,null));};exports['update']=function(_0xd935b,_0x21f366){if(_0xd935b[_0xadcf('0x48')]['id']){delete _0xd935b[_0xadcf('0x48')]['id'];}return db[_0xadcf('0x2c')][_0xadcf('0x46')]({'where':{'id':_0xd935b[_0xadcf('0x44')]['id']}})[_0xadcf('0x26')](handleEntityNotFound(_0x21f366,null))[_0xadcf('0x26')](saveUpdates(_0xd935b[_0xadcf('0x48')],null))[_0xadcf('0x26')](respondWithResult(_0x21f366,null))[_0xadcf('0x42')](handleError(_0x21f366,null));};exports[_0xadcf('0x25')]=function(_0xaa1be9,_0x12546e){return db[_0xadcf('0x2c')][_0xadcf('0x46')]({'where':{'id':_0xaa1be9[_0xadcf('0x44')]['id']}})[_0xadcf('0x26')](handleEntityNotFound(_0x12546e,null))['then'](removeEntity(_0x12546e,null))[_0xadcf('0x42')](handleError(_0x12546e,null));};exports[_0xadcf('0x49')]=function(_0x15219c,_0x226eb7){return db[_0xadcf('0x2c')][_0xadcf('0x49')]()[_0xadcf('0x26')](respondWithResult(_0x226eb7,null))[_0xadcf('0x42')](handleError(_0x226eb7,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 4734b86..165fefb 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 _0x94b8=['SquareDetailsReport','report_square_details','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0xfe26da,_0x5ac1b7){var _0x2abe6e=function(_0x586ea1){while(--_0x586ea1){_0xfe26da['push'](_0xfe26da['shift']());}};_0x2abe6e(++_0x5ac1b7);}(_0x94b8,0x1a2));var _0x894b=function(_0x2d8ada,_0x51ca25){_0x2d8ada=_0x2d8ada-0x0;var _0x2fb834=_0x94b8[_0x2d8ada];return _0x2fb834;};'use strict';var _=require(_0x894b('0x0'));var util=require('util');var logger=require(_0x894b('0x1'))(_0x894b('0x2'));var moment=require(_0x894b('0x3'));var BPromise=require(_0x894b('0x4'));var rp=require(_0x894b('0x5'));var fs=require('fs');var path=require(_0x894b('0x6'));var rimraf=require(_0x894b('0x7'));var config=require(_0x894b('0x8'));var attributes=require('./squareReportDetail.attributes');module[_0x894b('0x9')]=function(_0x5e2f44,_0x27a8c3){return _0x5e2f44[_0x894b('0xa')](_0x894b('0xb'),attributes,{'tableName':_0x894b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x814f=['util','api','moment','request-promise','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash'];(function(_0x130696,_0x2b15b9){var _0x2143d9=function(_0x2bf115){while(--_0x2bf115){_0x130696['push'](_0x130696['shift']());}};_0x2143d9(++_0x2b15b9);}(_0x814f,0xcb));var _0xf814=function(_0x2ef8c4,_0x250f29){_0x2ef8c4=_0x2ef8c4-0x0;var _0x4dfe2c=_0x814f[_0x2ef8c4];return _0x4dfe2c;};'use strict';var _=require(_0xf814('0x0'));var util=require(_0xf814('0x1'));var logger=require('../../config/logger')(_0xf814('0x2'));var moment=require(_0xf814('0x3'));var BPromise=require('bluebird');var rp=require(_0xf814('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf814('0x5'));var config=require(_0xf814('0x6'));var attributes=require(_0xf814('0x7'));module[_0xf814('0x8')]=function(_0x477f4e,_0x5aff8f){return _0x477f4e[_0xf814('0x9')](_0xf814('0xa'),attributes,{'tableName':_0xf814('0xb'),'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 9f54178..9b41fc0 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 _0x6cb4=['raw','then','CreateSquareDetailsReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','info','request\x20sent','debug','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','SquareDetailsReport','create','body','options'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0x6cb4,0xff));var _0x46cb=function(_0x325f34,_0x50d355){_0x325f34=_0x325f34-0x0;var _0x594d39=_0x6cb4[_0x325f34];return _0x594d39;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var moment=require(_0x46cb('0x2'));var BPromise=require(_0x46cb('0x3'));var rs=require(_0x46cb('0x4'));var fs=require('fs');var Redis=require(_0x46cb('0x5'));var db=require(_0x46cb('0x6'))['db'];var utils=require(_0x46cb('0x7'));var logger=require(_0x46cb('0x8'))('rpc');var config=require(_0x46cb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x46cb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11262d,_0x148d0f,_0x31b35b){return new BPromise(function(_0x2d6c29,_0x24b4f5){return client[_0x46cb('0xb')](_0x11262d,_0x31b35b)['then'](function(_0x3d7663){logger[_0x46cb('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x148d0f,_0x46cb('0xd'));logger[_0x46cb('0xe')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x148d0f,_0x46cb('0xd'),JSON[_0x46cb('0xf')](_0x3d7663));if(_0x3d7663['error']){if(_0x3d7663['error']['code']===0x1f4){logger[_0x46cb('0x10')](_0x46cb('0x11'),_0x148d0f,_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);return _0x24b4f5(_0x3d7663['error'][_0x46cb('0x12')]);}logger[_0x46cb('0x10')](_0x46cb('0x11'),_0x148d0f,_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);return _0x2d6c29(_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);}else{logger[_0x46cb('0xc')](_0x46cb('0x11'),_0x148d0f,_0x46cb('0xd'));_0x2d6c29(_0x3d7663[_0x46cb('0x13')]['message']);}})[_0x46cb('0x14')](function(_0x5796d2){logger[_0x46cb('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x148d0f,_0x5796d2);_0x24b4f5(_0x5796d2);});});}exports['CreateSquareDetailsReport']=function(_0x4e3454){var _0x1b6646=this;return new Promise(function(_0x1f2891,_0x4df1f0){return db[_0x46cb('0x15')][_0x46cb('0x16')](_0x4e3454[_0x46cb('0x17')],{'raw':_0x4e3454[_0x46cb('0x18')]?_0x4e3454[_0x46cb('0x18')][_0x46cb('0x19')]===undefined?!![]:![]:!![]})[_0x46cb('0x1a')](function(_0x149483){logger[_0x46cb('0xc')](_0x46cb('0x1b'),_0x4e3454);logger[_0x46cb('0xe')](_0x46cb('0x1b'),_0x4e3454,JSON[_0x46cb('0xf')](_0x149483));_0x1f2891(_0x149483);})[_0x46cb('0x14')](function(_0x1fb467){logger[_0x46cb('0x10')](_0x46cb('0x1b'),_0x1fb467[_0x46cb('0x12')],_0x4e3454);_0x4df1f0(_0x1b6646[_0x46cb('0x10')](0x1f4,_0x1fb467[_0x46cb('0x12')]));});});}; \ No newline at end of file +var _0xd7d1=['debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','create','body','options','raw'];(function(_0xa1cc71,_0x5841c1){var _0x19b112=function(_0x5ccfe4){while(--_0x5ccfe4){_0xa1cc71['push'](_0xa1cc71['shift']());}};_0x19b112(++_0x5841c1);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x3c91d8,_0x21df3d){_0x3c91d8=_0x3c91d8-0x0;var _0x195357=_0xd7d1[_0x3c91d8];return _0x195357;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var moment=require(_0x1d7d('0x2'));var BPromise=require(_0x1d7d('0x3'));var rs=require(_0x1d7d('0x4'));var fs=require('fs');var Redis=require(_0x1d7d('0x5'));var db=require(_0x1d7d('0x6'))['db'];var utils=require(_0x1d7d('0x7'));var logger=require(_0x1d7d('0x8'))(_0x1d7d('0x9'));var config=require(_0x1d7d('0xa'));var jayson=require(_0x1d7d('0xb'));var client=jayson[_0x1d7d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462ef8,_0x1aa456,_0x14dbf6){return new BPromise(function(_0x3675a2,_0xd6189e){return client[_0x1d7d('0xd')](_0x462ef8,_0x14dbf6)[_0x1d7d('0xe')](function(_0xa44223){logger[_0x1d7d('0xf')](_0x1d7d('0x10'),_0x1aa456,_0x1d7d('0x11'));logger['debug'](_0x1d7d('0x12'),_0x1aa456,'request\x20sent',JSON[_0x1d7d('0x13')](_0xa44223));if(_0xa44223[_0x1d7d('0x14')]){if(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x15')]===0x1f4){logger['error'](_0x1d7d('0x10'),_0x1aa456,_0xa44223['error']['message']);return _0xd6189e(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x1aa456,_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);return _0x3675a2(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}else{logger[_0x1d7d('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x1aa456,_0x1d7d('0x11'));_0x3675a2(_0xa44223[_0x1d7d('0x17')]['message']);}})[_0x1d7d('0x18')](function(_0x162c3a){logger[_0x1d7d('0x14')](_0x1d7d('0x10'),_0x1aa456,_0x162c3a);_0xd6189e(_0x162c3a);});});}exports[_0x1d7d('0x19')]=function(_0x4db4f2){var _0x664e3f=this;return new Promise(function(_0x191024,_0x5cbb8f){return db['SquareDetailsReport'][_0x1d7d('0x1a')](_0x4db4f2[_0x1d7d('0x1b')],{'raw':_0x4db4f2[_0x1d7d('0x1c')]?_0x4db4f2[_0x1d7d('0x1c')][_0x1d7d('0x1d')]===undefined?!![]:![]:!![]})[_0x1d7d('0xe')](function(_0x54d401){logger[_0x1d7d('0xf')](_0x1d7d('0x19'),_0x4db4f2);logger[_0x1d7d('0x1e')]('CreateSquareDetailsReport',_0x4db4f2,JSON[_0x1d7d('0x13')](_0x54d401));_0x191024(_0x54d401);})[_0x1d7d('0x18')](function(_0x4a1cdc){logger['error'](_0x1d7d('0x19'),_0x4a1cdc[_0x1d7d('0x16')],_0x4db4f2);_0x5cbb8f(_0x664e3f[_0x1d7d('0x14')](0x1f4,_0x4a1cdc['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index b42f260..443e4d5 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 _0xe05b=['./system.controller','index','/process/:pid/kill','killProcess','exports','express','Router'];(function(_0x3970c0,_0x17e90c){var _0x484130=function(_0x167b31){while(--_0x167b31){_0x3970c0['push'](_0x3970c0['shift']());}};_0x484130(++_0x17e90c);}(_0xe05b,0x171));var _0xbe05=function(_0x159ae9,_0x365723){_0x159ae9=_0x159ae9-0x0;var _0x39689d=_0xe05b[_0x159ae9];return _0x39689d;};'use strict';var express=require(_0xbe05('0x0'));var router=express[_0xbe05('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xbe05('0x2'));router['get']('/',auth['isAuthenticated'](),controller[_0xbe05('0x3')]);router['get'](_0xbe05('0x4'),auth['isAuthenticated'](),controller[_0xbe05('0x5')]);module[_0xbe05('0x6')]=router; \ No newline at end of file +var _0x798a=['./system.controller','get','isAuthenticated','index','/process/:pid/kill','exports','../../components/auth/service'];(function(_0x1a513c,_0x5acd41){var _0x1ce495=function(_0x6bec46){while(--_0x6bec46){_0x1a513c['push'](_0x1a513c['shift']());}};_0x1ce495(++_0x5acd41);}(_0x798a,0x92));var _0xa798=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x798a[_0x263a74];return _0x2aa86c;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xa798('0x0'));var controller=require(_0xa798('0x1'));router[_0xa798('0x2')]('/',auth[_0xa798('0x3')](),controller[_0xa798('0x4')]);router[_0xa798('0x2')](_0xa798('0x5'),auth[_0xa798('0x3')](),controller['killProcess']);module[_0xa798('0x6')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 753103c..8e8af4d 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 _0xcaa0=['status','send','index','getAllData','then','catch','json','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','util','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s'];(function(_0x24f862,_0x4b645a){var _0x198aa4=function(_0x131195){while(--_0x131195){_0x24f862['push'](_0x24f862['shift']());}};_0x198aa4(++_0x4b645a);}(_0xcaa0,0x84));var _0x0caa=function(_0x3f1937,_0x37d49c){_0x3f1937=_0x3f1937-0x0;var _0x46733e=_0xcaa0[_0x3f1937];return _0x46733e;};'use strict';var info=require(_0x0caa('0x0'));var exec=require(_0x0caa('0x1'))[_0x0caa('0x2')];var logger=require(_0x0caa('0x3'))(_0x0caa('0x4'));var util=require(_0x0caa('0x5'));var BPromise=require('bluebird');var _=require(_0x0caa('0x6'));function handleError(_0x3cd6a7,_0x33aca5,_0x18bfb1){_0x33aca5=_0x33aca5||0x1f4;return function(_0x25c9fe){logger['error'](_0x0caa('0x7'),_0x18bfb1,_0x33aca5,util['inspect'](_0x25c9fe,{'showHidden':![],'depth':null}));delete _0x25c9fe['name'];_0x3cd6a7[_0x0caa('0x8')](_0x33aca5)[_0x0caa('0x9')](_0x25c9fe);};}exports[_0x0caa('0xa')]=function(_0x2e4680,_0x34f5b0){return info[_0x0caa('0xb')]()[_0x0caa('0xc')](function(_0x2148a4){return _0x34f5b0[_0x0caa('0x8')](0xc8)['json'](_0x2148a4);})[_0x0caa('0xd')](function(_0xaaf641){return _0x34f5b0[_0x0caa('0x8')](0x1f4)[_0x0caa('0xe')](_0xaaf641);});};exports[_0x0caa('0xf')]=function(_0x2fc27b,_0x5c1cf9){var _0xf91bd4=[_0x0caa('0x10')];return new BPromise(function(_0x6d7440,_0x14e716){return exec(util['format'](_0x0caa('0x11'),_0x2fc27b[_0x0caa('0x12')]['pid']),function(_0x120739,_0x55c266,_0x3f4da0){if(_0x120739){return _0x14e716(_0x120739);}return _0x6d7440(_0x55c266);});})['then'](function(_0xa24354){var _0x58d3b1=![];var _0x19da9b=_0xa24354[_0x0caa('0x13')](/\n/);for(var _0x3a781e=0x0,_0x2b1a53=_0xf91bd4[_0x0caa('0x14')];_0x3a781e<_0x2b1a53,_0x58d3b1===![];_0x3a781e+=0x1){if(_0xa24354[_0x0caa('0x15')](_0xf91bd4[_0x3a781e])>=0x0){_0x58d3b1=!![];}}if(!_0x58d3b1){throw new Error(util[_0x0caa('0x16')](_0x0caa('0x17'),_0x2fc27b[_0x0caa('0x12')][_0x0caa('0x18')]));}process[_0x0caa('0x19')](_0x2fc27b[_0x0caa('0x12')][_0x0caa('0x18')],_0x0caa('0x1a'));return _0x5c1cf9['status'](0xc8)[_0x0caa('0xe')]({'message':util[_0x0caa('0x16')](_0x0caa('0x1b'),_0x2fc27b[_0x0caa('0x12')][_0x0caa('0x18')])});})['catch'](handleError(_0x5c1cf9,null,_0x0caa('0xf')));}; \ No newline at end of file +var _0xa551=['child_process','exec','../../config/logger','util','bluebird','inspect','name','send','index','getAllData','then','status','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation'];(function(_0xc6b1f2,_0x5ed974){var _0x3c3a6a=function(_0x546697){while(--_0x546697){_0xc6b1f2['push'](_0xc6b1f2['shift']());}};_0x3c3a6a(++_0x5ed974);}(_0xa551,0x133));var _0x1a55=function(_0x1fd13e,_0x346670){_0x1fd13e=_0x1fd13e-0x0;var _0x26f2bc=_0xa551[_0x1fd13e];return _0x26f2bc;};'use strict';var info=require(_0x1a55('0x0'));var exec=require(_0x1a55('0x1'))[_0x1a55('0x2')];var logger=require(_0x1a55('0x3'))('api');var util=require(_0x1a55('0x4'));var BPromise=require(_0x1a55('0x5'));var _=require('lodash');function handleError(_0x48fe99,_0x11d8c9,_0x410dcd){_0x11d8c9=_0x11d8c9||0x1f4;return function(_0x2bff53){logger['error']('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x410dcd,_0x11d8c9,util[_0x1a55('0x6')](_0x2bff53,{'showHidden':![],'depth':null}));delete _0x2bff53[_0x1a55('0x7')];_0x48fe99['status'](_0x11d8c9)[_0x1a55('0x8')](_0x2bff53);};}exports[_0x1a55('0x9')]=function(_0x2a1571,_0x1c3b12){return info[_0x1a55('0xa')]()[_0x1a55('0xb')](function(_0x4c01e2){return _0x1c3b12[_0x1a55('0xc')](0xc8)[_0x1a55('0xd')](_0x4c01e2);})[_0x1a55('0xe')](function(_0x2c17bb){return _0x1c3b12['status'](0x1f4)[_0x1a55('0xd')](_0x2c17bb);});};exports[_0x1a55('0xf')]=function(_0x548a3f,_0x532501){var _0x180852=[_0x1a55('0x10')];return new BPromise(function(_0x393235,_0x2684a4){return exec(util[_0x1a55('0x11')](_0x1a55('0x12'),_0x548a3f[_0x1a55('0x13')]['pid']),function(_0x3ef1a3,_0x5f0a91,_0x410913){if(_0x3ef1a3){return _0x2684a4(_0x3ef1a3);}return _0x393235(_0x5f0a91);});})['then'](function(_0x24012b){var _0x26040a=![];var _0x38597c=_0x24012b[_0x1a55('0x14')](/\n/);for(var _0x21fe10=0x0,_0x315fe1=_0x180852[_0x1a55('0x15')];_0x21fe10<_0x315fe1,_0x26040a===![];_0x21fe10+=0x1){if(_0x24012b[_0x1a55('0x16')](_0x180852[_0x21fe10])>=0x0){_0x26040a=!![];}}if(!_0x26040a){throw new Error(util[_0x1a55('0x11')](_0x1a55('0x17'),_0x548a3f[_0x1a55('0x13')][_0x1a55('0x18')]));}process[_0x1a55('0x19')](_0x548a3f['params'][_0x1a55('0x18')],_0x1a55('0x1a'));return _0x532501[_0x1a55('0xc')](0xc8)[_0x1a55('0xd')]({'message':util['format'](_0x1a55('0x1b'),_0x548a3f[_0x1a55('0x13')][_0x1a55('0x18')])});})[_0x1a55('0xe')](handleError(_0x532501,null,_0x1a55('0xf')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 5eca12e..d5dbd0b 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 _0x32f4=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','post','create','put','update','destroy'];(function(_0x151415,_0x108f84){var _0x5c06a9=function(_0x463b26){while(--_0x463b26){_0x151415['push'](_0x151415['shift']());}};_0x5c06a9(++_0x108f84);}(_0x32f4,0x154));var _0x432f=function(_0x4189fe,_0x49f887){_0x4189fe=_0x4189fe-0x0;var _0x3b0e8b=_0x32f4[_0x4189fe];return _0x3b0e8b;};'use strict';var multer=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var path=require(_0x432f('0x2'));var timeout=require(_0x432f('0x3'));var express=require('express');var router=express[_0x432f('0x4')]();var fs_extra=require(_0x432f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x432f('0x6'));var config=require(_0x432f('0x7'));var controller=require(_0x432f('0x8'));router[_0x432f('0x9')]('/',auth[_0x432f('0xa')](),controller['index']);router['get'](_0x432f('0xb'),auth[_0x432f('0xa')](),controller['show']);router[_0x432f('0xc')]('/',auth['isAuthenticated'](),controller[_0x432f('0xd')]);router[_0x432f('0xe')](_0x432f('0xb'),auth[_0x432f('0xa')](),controller[_0x432f('0xf')]);router['delete'](_0x432f('0xb'),auth['isAuthenticated'](),controller[_0x432f('0x10')]);module['exports']=router; \ No newline at end of file +var _0x1678=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x4805c7,_0x158dee){var _0xd2a127=function(_0x47b5af){while(--_0x47b5af){_0x4805c7['push'](_0x4805c7['shift']());}};_0xd2a127(++_0x158dee);}(_0x1678,0x17b));var _0x8167=function(_0x2f9ca3,_0x1cf071){_0x2f9ca3=_0x2f9ca3-0x0;var _0x38f970=_0x1678[_0x2f9ca3];return _0x38f970;};'use strict';var multer=require(_0x8167('0x0'));var util=require(_0x8167('0x1'));var path=require(_0x8167('0x2'));var timeout=require(_0x8167('0x3'));var express=require(_0x8167('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8167('0x5'));var interaction=require(_0x8167('0x6'));var config=require(_0x8167('0x7'));var controller=require(_0x8167('0x8'));router[_0x8167('0x9')]('/',auth[_0x8167('0xa')](),controller[_0x8167('0xb')]);router['get'](_0x8167('0xc'),auth[_0x8167('0xa')](),controller[_0x8167('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8167('0xe')]);router[_0x8167('0xf')]('/:id',auth[_0x8167('0xa')](),controller[_0x8167('0x10')]);router[_0x8167('0x11')](_0x8167('0xc'),auth[_0x8167('0xa')](),controller[_0x8167('0x12')]);module[_0x8167('0x13')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 915d7fe..1c54284 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 _0xcb9c=['name','#0091EA','sequelize','exports','STRING'];(function(_0xbb3cd0,_0x2e4390){var _0x182543=function(_0x158761){while(--_0x158761){_0xbb3cd0['push'](_0xbb3cd0['shift']());}};_0x182543(++_0x2e4390);}(_0xcb9c,0x110));var _0xccb9=function(_0x11f015,_0x435779){_0x11f015=_0x11f015-0x0;var _0x4cd6a1=_0xcb9c[_0x11f015];return _0x4cd6a1;};'use strict';var Sequelize=require(_0xccb9('0x0'));module[_0xccb9('0x1')]={'name':{'type':Sequelize[_0xccb9('0x2')],'unique':_0xccb9('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xccb9('0x2')],'defaultValue':_0xccb9('0x4')},'description':{'type':Sequelize[_0xccb9('0x2')]}}; \ No newline at end of file +var _0x422f=['name','STRING','exports'];(function(_0x2b9e8a,_0x7b21d4){var _0x520e67=function(_0x22bce8){while(--_0x22bce8){_0x2b9e8a['push'](_0x2b9e8a['shift']());}};_0x520e67(++_0x7b21d4);}(_0x422f,0x1c7));var _0xf422=function(_0x291b38,_0x335ae){_0x291b38=_0x291b38-0x0;var _0x4d3001=_0x422f[_0x291b38];return _0x4d3001;};'use strict';var Sequelize=require('sequelize');module[_0xf422('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xf422('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xf422('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xf422('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 7b881a4..4056d51 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 _0xf290=['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','Tags','UserProfileResource','error','stack','name','send','map','key','keys','query','filters','intersection','model','attributes','fields','length','sort','where','filter','merge','type','VIRTUAL','options','Tag','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','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x42ce61,_0x119e47){var _0x2e3202=function(_0x5546b0){while(--_0x5546b0){_0x42ce61['push'](_0x42ce61['shift']());}};_0x2e3202(++_0x119e47);}(_0xf290,0xde));var _0x0f29=function(_0x2fbcf6,_0x2e7155){_0x2fbcf6=_0x2fbcf6-0x0;var _0x3e7265=_0xf290[_0x2fbcf6];return _0x3e7265;};'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['Tag']['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['Tag']['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['Tag']['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['Tag'][_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));}; \ No newline at end of file +var _0xde64=['limit','count','set','Content-Range','apply','reject','save','then','destroy','get','Tags','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','Tag','catch','params','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xde64,0x17c));var _0x4de6=function(_0x53eb1f,_0x3f3e91){_0x53eb1f=_0x53eb1f-0x0;var _0x505efe=_0xde64[_0x53eb1f];return _0x505efe;};'use strict';var emlformat=require(_0x4de6('0x0'));var rimraf=require(_0x4de6('0x1'));var zipdir=require(_0x4de6('0x2'));var jsonpatch=require(_0x4de6('0x3'));var rp=require(_0x4de6('0x4'));var moment=require(_0x4de6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4de6('0x6'));var util=require(_0x4de6('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4de6('0x8'));var ejs=require(_0x4de6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4de6('0xa'));var crypto=require(_0x4de6('0xb'));var jsforce=require(_0x4de6('0xc'));var deskjs=require(_0x4de6('0xd'));var toCsv=require(_0x4de6('0x8'));var querystring=require(_0x4de6('0xe'));var Papa=require('papaparse');var Redis=require(_0x4de6('0xf'));var authService=require(_0x4de6('0x10'));var qs=require(_0x4de6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4de6('0x12'));var logger=require(_0x4de6('0x13'))(_0x4de6('0x14'));var utils=require(_0x4de6('0x15'));var config=require(_0x4de6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4de6('0x17'))['db'];function respondWithStatusCode(_0x3baa31,_0xb8e256){_0xb8e256=_0xb8e256||0xcc;return function(_0x509002){if(_0x509002){return _0x3baa31[_0x4de6('0x18')](_0xb8e256);}return _0x3baa31[_0x4de6('0x19')](_0xb8e256)[_0x4de6('0x1a')]();};}function respondWithResult(_0x2bd121,_0x58b0c1){_0x58b0c1=_0x58b0c1||0xc8;return function(_0x1ccfee){if(_0x1ccfee){return _0x2bd121[_0x4de6('0x19')](_0x58b0c1)[_0x4de6('0x1b')](_0x1ccfee);}};}function respondWithFilteredResult(_0x4dd3b5,_0x33fd67){return function(_0x54e2f2){if(_0x54e2f2){var _0x4cbb5c=typeof _0x33fd67[_0x4de6('0x1c')]===_0x4de6('0x1d')&&typeof _0x33fd67[_0x4de6('0x1e')]===_0x4de6('0x1d');var _0x37975a=_0x54e2f2[_0x4de6('0x1f')];var _0x324202=_0x4cbb5c?0x0:_0x33fd67['offset'];var _0x420f7c=_0x4cbb5c?_0x54e2f2[_0x4de6('0x1f')]:_0x33fd67[_0x4de6('0x1c')]+_0x33fd67[_0x4de6('0x1e')];var _0x167c7c;if(_0x420f7c>=_0x37975a){_0x420f7c=_0x37975a;_0x167c7c=0xc8;}else{_0x167c7c=0xce;}_0x4dd3b5[_0x4de6('0x19')](_0x167c7c);return _0x4dd3b5[_0x4de6('0x20')](_0x4de6('0x21'),_0x324202+'-'+_0x420f7c+'/'+_0x37975a)[_0x4de6('0x1b')](_0x54e2f2);}return null;};}function patchUpdates(_0x15c923){return function(_0x4c4d13){try{jsonpatch[_0x4de6('0x22')](_0x4c4d13,_0x15c923,!![]);}catch(_0x51ad13){return BPromise[_0x4de6('0x23')](_0x51ad13);}return _0x4c4d13[_0x4de6('0x24')]();};}function saveUpdates(_0x43771b,_0x5de99f){return function(_0xe1b69d){if(_0xe1b69d){return _0xe1b69d['update'](_0x43771b)[_0x4de6('0x25')](function(_0x385cae){return _0x385cae;});}return null;};}function removeEntity(_0x1a64e9,_0x5ddbab){return function(_0x478d83){if(_0x478d83){return _0x478d83[_0x4de6('0x26')]()[_0x4de6('0x25')](function(){var _0x3be904=_0x478d83[_0x4de6('0x27')]({'plain':!![]});var _0x25a76b=_0x4de6('0x28');return db['UserProfileResource'][_0x4de6('0x26')]({'where':{'type':_0x25a76b,'resourceId':_0x3be904['id']}})[_0x4de6('0x25')](function(){return _0x478d83;});})[_0x4de6('0x25')](function(){_0x1a64e9[_0x4de6('0x19')](0xcc)[_0x4de6('0x1a')]();});}};}function handleEntityNotFound(_0x281060,_0xa2b88c){return function(_0x7bc61e){if(!_0x7bc61e){_0x281060[_0x4de6('0x18')](0x194);}return _0x7bc61e;};}function handleError(_0x4f168b,_0x2065b4){_0x2065b4=_0x2065b4||0x1f4;return function(_0x2a5592){logger[_0x4de6('0x29')](_0x2a5592[_0x4de6('0x2a')]);if(_0x2a5592[_0x4de6('0x2b')]){delete _0x2a5592['name'];}_0x4f168b[_0x4de6('0x19')](_0x2065b4)['send'](_0x2a5592);};}exports[_0x4de6('0x2c')]=function(_0x2bfc77,_0x1df7c0){var _0x1b5607={},_0x592799={},_0x5593e8={'count':0x0,'rows':[]};var _0x530e04=_['map'](db['Tag'][_0x4de6('0x2d')],function(_0x1da3b1){return{'name':_0x1da3b1[_0x4de6('0x2e')],'type':_0x1da3b1[_0x4de6('0x2f')][_0x4de6('0x30')]};});_0x592799[_0x4de6('0x31')]=_[_0x4de6('0x32')](_0x530e04,_0x4de6('0x2b'));_0x592799[_0x4de6('0x33')]=_[_0x4de6('0x34')](_0x2bfc77[_0x4de6('0x33')]);_0x592799[_0x4de6('0x35')]=_[_0x4de6('0x36')](_0x592799[_0x4de6('0x31')],_0x592799[_0x4de6('0x33')]);_0x1b5607[_0x4de6('0x37')]=_[_0x4de6('0x36')](_0x592799[_0x4de6('0x31')],qs[_0x4de6('0x38')](_0x2bfc77[_0x4de6('0x33')][_0x4de6('0x38')]));_0x1b5607[_0x4de6('0x37')]=_0x1b5607[_0x4de6('0x37')][_0x4de6('0x39')]?_0x1b5607[_0x4de6('0x37')]:_0x592799[_0x4de6('0x31')];if(!_0x2bfc77[_0x4de6('0x33')][_0x4de6('0x3a')](_0x4de6('0x3b'))){_0x1b5607['limit']=qs[_0x4de6('0x1e')](_0x2bfc77[_0x4de6('0x33')][_0x4de6('0x1e')]);_0x1b5607[_0x4de6('0x1c')]=qs['offset'](_0x2bfc77[_0x4de6('0x33')][_0x4de6('0x1c')]);}_0x1b5607[_0x4de6('0x3c')]=qs[_0x4de6('0x3d')](_0x2bfc77['query'][_0x4de6('0x3d')]);_0x1b5607['where']=qs[_0x4de6('0x35')](_[_0x4de6('0x3e')](_0x2bfc77[_0x4de6('0x33')],_0x592799[_0x4de6('0x35')]),_0x530e04);if(_0x2bfc77[_0x4de6('0x33')][_0x4de6('0x3f')]){_0x1b5607[_0x4de6('0x40')]=_[_0x4de6('0x41')](_0x1b5607[_0x4de6('0x40')],{'$or':_[_0x4de6('0x32')](_0x530e04,function(_0x85581b){if(_0x85581b[_0x4de6('0x2f')]!=='VIRTUAL'){var _0x57a6ca={};_0x57a6ca[_0x85581b[_0x4de6('0x2b')]]={'$like':'%'+_0x2bfc77[_0x4de6('0x33')][_0x4de6('0x3f')]+'%'};return _0x57a6ca;}})});}_0x1b5607=_[_0x4de6('0x41')]({},_0x1b5607,_0x2bfc77['options']);var _0x5d07aa={'where':_0x1b5607[_0x4de6('0x40')]};return db['Tag'][_0x4de6('0x1f')](_0x5d07aa)['then'](function(_0x3696c8){_0x5593e8['count']=_0x3696c8;if(_0x2bfc77[_0x4de6('0x33')][_0x4de6('0x42')]){_0x1b5607[_0x4de6('0x43')]=[{'all':!![]}];}return db[_0x4de6('0x44')]['findAll'](_0x1b5607);})[_0x4de6('0x25')](function(_0x4049ed){_0x5593e8['rows']=_0x4049ed;return _0x5593e8;})['then'](respondWithFilteredResult(_0x1df7c0,_0x1b5607))[_0x4de6('0x45')](handleError(_0x1df7c0,null));};exports['show']=function(_0x118eb3,_0x3260bc){var _0x3f0f08={'raw':!![],'where':{'id':_0x118eb3[_0x4de6('0x46')]['id']}},_0x349688={};_0x349688[_0x4de6('0x31')]=_[_0x4de6('0x34')](db[_0x4de6('0x44')][_0x4de6('0x2d')]);_0x349688[_0x4de6('0x33')]=_[_0x4de6('0x34')](_0x118eb3[_0x4de6('0x33')]);_0x349688['filters']=_['intersection'](_0x349688['model'],_0x349688[_0x4de6('0x33')]);_0x3f0f08[_0x4de6('0x37')]=_['intersection'](_0x349688['model'],qs[_0x4de6('0x38')](_0x118eb3['query'][_0x4de6('0x38')]));_0x3f0f08[_0x4de6('0x37')]=_0x3f0f08['attributes'][_0x4de6('0x39')]?_0x3f0f08[_0x4de6('0x37')]:_0x349688[_0x4de6('0x31')];if(_0x118eb3[_0x4de6('0x33')][_0x4de6('0x42')]){_0x3f0f08['include']=[{'all':!![]}];}_0x3f0f08=_[_0x4de6('0x41')]({},_0x3f0f08,_0x118eb3[_0x4de6('0x47')]);return db[_0x4de6('0x44')][_0x4de6('0x48')](_0x3f0f08)[_0x4de6('0x25')](handleEntityNotFound(_0x3260bc,null))[_0x4de6('0x25')](respondWithResult(_0x3260bc,null))[_0x4de6('0x45')](handleError(_0x3260bc,null));};exports[_0x4de6('0x49')]=function(_0x698dcb,_0x3126f1){return db[_0x4de6('0x44')][_0x4de6('0x49')](_0x698dcb[_0x4de6('0x4a')],{})[_0x4de6('0x25')](function(_0x354558){var _0x12ce25=_0x698dcb[_0x4de6('0x4b')]['get']({'plain':!![]});if(!_0x12ce25)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12ce25[_0x4de6('0x4c')]===_0x4de6('0x4b')){var _0x524807=_0x354558[_0x4de6('0x27')]({'plain':!![]});var _0x191f93=_0x4de6('0x28');return db[_0x4de6('0x4d')][_0x4de6('0x48')]({'where':{'name':_0x191f93,'userProfileId':_0x12ce25[_0x4de6('0x4e')]},'raw':!![]})[_0x4de6('0x25')](function(_0x502e4d){if(_0x502e4d&&_0x502e4d[_0x4de6('0x4f')]===0x0){return db['UserProfileResource'][_0x4de6('0x49')]({'name':_0x524807[_0x4de6('0x2b')],'resourceId':_0x524807['id'],'type':_0x502e4d[_0x4de6('0x2b')],'sectionId':_0x502e4d['id']},{})[_0x4de6('0x25')](function(){return _0x354558;});}else{return _0x354558;}})[_0x4de6('0x45')](function(_0xac3eb5){logger[_0x4de6('0x29')](_0x4de6('0x50'),_0xac3eb5);throw _0xac3eb5;});}return _0x354558;})['then'](respondWithResult(_0x3126f1,0xc9))['catch'](handleError(_0x3126f1,null));};exports[_0x4de6('0x51')]=function(_0x198054,_0x61bc5d){if(_0x198054[_0x4de6('0x4a')]['id']){delete _0x198054['body']['id'];}return db[_0x4de6('0x44')][_0x4de6('0x48')]({'where':{'id':_0x198054[_0x4de6('0x46')]['id']}})['then'](handleEntityNotFound(_0x61bc5d,null))[_0x4de6('0x25')](saveUpdates(_0x198054['body'],null))[_0x4de6('0x25')](respondWithResult(_0x61bc5d,null))[_0x4de6('0x45')](handleError(_0x61bc5d,null));};exports['destroy']=function(_0x19f34a,_0x1b71cf){return db['Tag'][_0x4de6('0x48')]({'where':{'id':_0x19f34a[_0x4de6('0x46')]['id']}})[_0x4de6('0x25')](handleEntityNotFound(_0x1b71cf,null))[_0x4de6('0x25')](removeEntity(_0x1b71cf,null))[_0x4de6('0x45')](handleError(_0x1b71cf,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 10c33da..8769da3 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 _0xa7ec=['rimraf','Tag','tools_tags','lodash','util','../../config/logger','api','path'];(function(_0xf7dbeb,_0x262c6b){var _0x1e89ec=function(_0x314bd2){while(--_0x314bd2){_0xf7dbeb['push'](_0xf7dbeb['shift']());}};_0x1e89ec(++_0x262c6b);}(_0xa7ec,0x14b));var _0xca7e=function(_0x79643c,_0xf4ddf3){_0x79643c=_0x79643c-0x0;var _0x476c28=_0xa7ec[_0x79643c];return _0x476c28;};'use strict';var _=require(_0xca7e('0x0'));var util=require(_0xca7e('0x1'));var logger=require(_0xca7e('0x2'))(_0xca7e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xca7e('0x4'));var rimraf=require(_0xca7e('0x5'));var config=require('../../config/environment');var attributes=require('./tag.attributes');module['exports']=function(_0x2f8fb5,_0x2f3afd){return _0x2f8fb5['define'](_0xca7e('0x6'),attributes,{'tableName':_0xca7e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77ce=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./tag.attributes','exports','define'];(function(_0x501d2a,_0x5afe46){var _0x48bda4=function(_0x268a1e){while(--_0x268a1e){_0x501d2a['push'](_0x501d2a['shift']());}};_0x48bda4(++_0x5afe46);}(_0x77ce,0x1b8));var _0xe77c=function(_0x34a718,_0x43b4d2){_0x34a718=_0x34a718-0x0;var _0xa214e5=_0x77ce[_0x34a718];return _0xa214e5;};'use strict';var _=require(_0xe77c('0x0'));var util=require(_0xe77c('0x1'));var logger=require(_0xe77c('0x2'))(_0xe77c('0x3'));var moment=require(_0xe77c('0x4'));var BPromise=require(_0xe77c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe77c('0x6'));var rimraf=require(_0xe77c('0x7'));var config=require('../../config/environment');var attributes=require(_0xe77c('0x8'));module[_0xe77c('0x9')]=function(_0x39596f,_0x25a09d){return _0x39596f[_0xe77c('0xa')]('Tag',attributes,{'tableName':'tools_tags','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 b7fdaed..3cb8b0d 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 _0xe739=['rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','error','code','Tag,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../config/logger'];(function(_0x23977e,_0x8a5ff8){var _0x5c4733=function(_0x5e896a){while(--_0x5e896a){_0x23977e['push'](_0x23977e['shift']());}};_0x5c4733(++_0x8a5ff8);}(_0xe739,0x105));var _0x9e73=function(_0xf0b144,_0x43c9ad){_0xf0b144=_0xf0b144-0x0;var _0x4c948f=_0xe739[_0xf0b144];return _0x4c948f;};'use strict';var _=require(_0x9e73('0x0'));var util=require('util');var moment=require(_0x9e73('0x1'));var BPromise=require(_0x9e73('0x2'));var rs=require(_0x9e73('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9e73('0x4'))(_0x9e73('0x5'));var config=require(_0x9e73('0x6'));var jayson=require(_0x9e73('0x7'));var client=jayson['client'][_0x9e73('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26cb5b,_0xb37872,_0x5e46e7){return new BPromise(function(_0xa49f86,_0x1ee042){return client[_0x9e73('0x9')](_0x26cb5b,_0x5e46e7)[_0x9e73('0xa')](function(_0x14de8a){logger[_0x9e73('0xb')]('Tag,\x20%s,\x20%s',_0xb37872,_0x9e73('0xc'));logger['debug']('Tag,\x20%s,\x20%s,\x20%s',_0xb37872,_0x9e73('0xc'),JSON['stringify'](_0x14de8a));if(_0x14de8a[_0x9e73('0xd')]){if(_0x14de8a[_0x9e73('0xd')][_0x9e73('0xe')]===0x1f4){logger['error'](_0x9e73('0xf'),_0xb37872,_0x14de8a[_0x9e73('0xd')][_0x9e73('0x10')]);return _0x1ee042(_0x14de8a[_0x9e73('0xd')]['message']);}logger[_0x9e73('0xd')](_0x9e73('0xf'),_0xb37872,_0x14de8a[_0x9e73('0xd')]['message']);return _0xa49f86(_0x14de8a[_0x9e73('0xd')][_0x9e73('0x10')]);}else{logger['info'](_0x9e73('0xf'),_0xb37872,_0x9e73('0xc'));_0xa49f86(_0x14de8a[_0x9e73('0x11')]['message']);}})[_0x9e73('0x12')](function(_0x51968a){logger[_0x9e73('0xd')]('Tag,\x20%s,\x20%s',_0xb37872,_0x51968a);_0x1ee042(_0x51968a);});});} \ No newline at end of file +var _0x0624=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1c15d8,_0x325671){var _0x2c77ea=function(_0x83e440){while(--_0x83e440){_0x1c15d8['push'](_0x1c15d8['shift']());}};_0x2c77ea(++_0x325671);}(_0x0624,0x132));var _0x4062=function(_0x314bf8,_0x2277c8){_0x314bf8=_0x314bf8-0x0;var _0x146d10=_0x0624[_0x314bf8];return _0x146d10;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4062('0x0'));var fs=require('fs');var Redis=require(_0x4062('0x1'));var db=require(_0x4062('0x2'))['db'];var utils=require(_0x4062('0x3'));var logger=require(_0x4062('0x4'))(_0x4062('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4062('0x6')][_0x4062('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2f4928,_0xdff88c,_0x27794b){return new BPromise(function(_0x5d19e8,_0x75ce4e){return client['request'](_0x2f4928,_0x27794b)[_0x4062('0x8')](function(_0x35663b){logger[_0x4062('0x9')](_0x4062('0xa'),_0xdff88c,_0x4062('0xb'));logger[_0x4062('0xc')](_0x4062('0xd'),_0xdff88c,'request\x20sent',JSON[_0x4062('0xe')](_0x35663b));if(_0x35663b['error']){if(_0x35663b[_0x4062('0xf')][_0x4062('0x10')]===0x1f4){logger[_0x4062('0xf')](_0x4062('0xa'),_0xdff88c,_0x35663b[_0x4062('0xf')]['message']);return _0x75ce4e(_0x35663b[_0x4062('0xf')][_0x4062('0x11')]);}logger['error'](_0x4062('0xa'),_0xdff88c,_0x35663b[_0x4062('0xf')][_0x4062('0x11')]);return _0x5d19e8(_0x35663b['error']['message']);}else{logger[_0x4062('0x9')](_0x4062('0xa'),_0xdff88c,'request\x20sent');_0x5d19e8(_0x35663b['result']['message']);}})['catch'](function(_0x437432){logger['error'](_0x4062('0xa'),_0xdff88c,_0x437432);_0x75ce4e(_0x437432);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 2560a49..e8fe468 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_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['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 126d9b1..7f8dec6 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 _0x757a=['exports','STRING'];(function(_0x2be9e9,_0x1ed065){var _0x21981e=function(_0x680d0a){while(--_0x680d0a){_0x2be9e9['push'](_0x2be9e9['shift']());}};_0x21981e(++_0x1ed065);}(_0x757a,0xde));var _0xa757=function(_0x2c3bd3,_0x2f3d5a){_0x2c3bd3=_0x2c3bd3-0x0;var _0x411d4e=_0x757a[_0x2c3bd3];return _0x411d4e;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb10b=['name','sequelize','STRING'];(function(_0x2349fd,_0x1660fb){var _0x6c8162=function(_0xe0702){while(--_0xe0702){_0x2349fd['push'](_0x2349fd['shift']());}};_0x6c8162(++_0x1660fb);}(_0xb10b,0x12a));var _0xbb10=function(_0x1269c6,_0x1c8942){_0x1269c6=_0x1269c6-0x0;var _0x4868c7=_0xb10b[_0x1269c6];return _0x4868c7;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index a9d4768..adad513 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 _0xaebc=['sequelize','Sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','UserVoiceQueue','MailQueueId','UserMailQueue','destroy','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','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','UserVoicePrefix','VoicePrefixId','end','getQueues','findOne','channel','Unknown\x20channel','capitalize','sort','toLowerCase','Queues','addQueues','ValidationError','add','ids','isArray','Voice','Fax','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','Queue','findOrCreate','emit','online','voicePause','interface','UserVoiceQueueRt','format','SIP/%s','all','upsert','addAgents','spread','Chat','Mail','Sms','removeAgents','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','reject','save','then','error','name','send','index','Team','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','find','autoAssociation','UserProfileResource','update','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'];(function(_0x538ba2,_0x5743f0){var _0x5e77ae=function(_0x225894){while(--_0x225894){_0x538ba2['push'](_0x538ba2['shift']());}};_0x5e77ae(++_0x5743f0);}(_0xaebc,0x172));var _0xcaeb=function(_0x392dc2,_0x47c3f3){_0x392dc2=_0x392dc2-0x0;var _0x14150f=_0xaebc[_0x392dc2];return _0x14150f;};'use strict';var emlformat=require(_0xcaeb('0x0'));var rimraf=require(_0xcaeb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcaeb('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcaeb('0x3'));var Mustache=require(_0xcaeb('0x4'));var util=require(_0xcaeb('0x5'));var path=require(_0xcaeb('0x6'));var sox=require(_0xcaeb('0x7'));var csv=require('to-csv');var ejs=require(_0xcaeb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcaeb('0x9'));var squel=require('squel');var crypto=require(_0xcaeb('0xa'));var jsforce=require(_0xcaeb('0xb'));var deskjs=require(_0xcaeb('0xc'));var toCsv=require(_0xcaeb('0xd'));var querystring=require(_0xcaeb('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcaeb('0xf'));var qs=require(_0xcaeb('0x10'));var as=require(_0xcaeb('0x11'));var hardwareService=require(_0xcaeb('0x12'));var logger=require('../../config/logger')(_0xcaeb('0x13'));var utils=require(_0xcaeb('0x14'));var config=require(_0xcaeb('0x15'));var licenseUtil=require(_0xcaeb('0x16'));var db=require(_0xcaeb('0x17'))['db'];config[_0xcaeb('0x18')]=_[_0xcaeb('0x19')](config[_0xcaeb('0x18')],{'host':_0xcaeb('0x1a'),'port':0x18eb});var socket=require(_0xcaeb('0x1b'))(new Redis(config[_0xcaeb('0x18')]));require(_0xcaeb('0x1c'))[_0xcaeb('0x1d')](socket);function respondWithStatusCode(_0x13de50,_0x537e27){_0x537e27=_0x537e27||0xcc;return function(_0x5bd751){if(_0x5bd751){return _0x13de50[_0xcaeb('0x1e')](_0x537e27);}return _0x13de50[_0xcaeb('0x1f')](_0x537e27)['end']();};}function respondWithResult(_0x3f6a9e,_0xbbff75){_0xbbff75=_0xbbff75||0xc8;return function(_0x3ae2fd){if(_0x3ae2fd){return _0x3f6a9e[_0xcaeb('0x1f')](_0xbbff75)[_0xcaeb('0x20')](_0x3ae2fd);}};}function respondWithFilteredResult(_0x17e604,_0x2de891){return function(_0x381bed){if(_0x381bed){var _0x1ed204=typeof _0x2de891['offset']===_0xcaeb('0x21')&&typeof _0x2de891['limit']==='undefined';var _0x331998=_0x381bed['count'];var _0x478847=_0x1ed204?0x0:_0x2de891[_0xcaeb('0x22')];var _0x158f40=_0x1ed204?_0x381bed[_0xcaeb('0x23')]:_0x2de891[_0xcaeb('0x22')]+_0x2de891[_0xcaeb('0x24')];var _0x39811c;if(_0x158f40>=_0x331998){_0x158f40=_0x331998;_0x39811c=0xc8;}else{_0x39811c=0xce;}_0x17e604[_0xcaeb('0x1f')](_0x39811c);return _0x17e604[_0xcaeb('0x25')](_0xcaeb('0x26'),_0x478847+'-'+_0x158f40+'/'+_0x331998)[_0xcaeb('0x20')](_0x381bed);}return null;};}function patchUpdates(_0x529e39){return function(_0x2a7fbf){try{jsonpatch['apply'](_0x2a7fbf,_0x529e39,!![]);}catch(_0x518815){return BPromise[_0xcaeb('0x27')](_0x518815);}return _0x2a7fbf[_0xcaeb('0x28')]();};}function saveUpdates(_0x5f0058,_0x16d02b){return function(_0x32531e){if(_0x32531e){return _0x32531e['update'](_0x5f0058)[_0xcaeb('0x29')](function(_0x4ac9fd){return _0x4ac9fd;});}return null;};}function handleEntityNotFound(_0x3d71f1,_0x1a0127){return function(_0x3e5874){if(!_0x3e5874){_0x3d71f1[_0xcaeb('0x1e')](0x194);}return _0x3e5874;};}function handleError(_0x4be37c,_0x16f56d){_0x16f56d=_0x16f56d||0x1f4;return function(_0x1a66bf){logger[_0xcaeb('0x2a')](_0x1a66bf['stack']);if(_0x1a66bf[_0xcaeb('0x2b')]){delete _0x1a66bf['name'];}_0x4be37c[_0xcaeb('0x1f')](_0x16f56d)[_0xcaeb('0x2c')](_0x1a66bf);};}exports[_0xcaeb('0x2d')]=function(_0x554793,_0x23005d){var _0x1e945d={},_0x3840ab={},_0x47d89d={'count':0x0,'rows':[]};var _0x2c5385=_['map'](db[_0xcaeb('0x2e')][_0xcaeb('0x2f')],function(_0x117596){return{'name':_0x117596[_0xcaeb('0x30')],'type':_0x117596['type']['key']};});_0x3840ab[_0xcaeb('0x31')]=_[_0xcaeb('0x32')](_0x2c5385,'name');_0x3840ab[_0xcaeb('0x33')]=_[_0xcaeb('0x34')](_0x554793[_0xcaeb('0x33')]);_0x3840ab[_0xcaeb('0x35')]=_[_0xcaeb('0x36')](_0x3840ab[_0xcaeb('0x31')],_0x3840ab['query']);_0x1e945d[_0xcaeb('0x37')]=_[_0xcaeb('0x36')](_0x3840ab['model'],qs[_0xcaeb('0x38')](_0x554793[_0xcaeb('0x33')][_0xcaeb('0x38')]));_0x1e945d[_0xcaeb('0x37')]=_0x1e945d[_0xcaeb('0x37')]['length']?_0x1e945d['attributes']:_0x3840ab[_0xcaeb('0x31')];if(!_0x554793['query'][_0xcaeb('0x39')]('nolimit')){_0x1e945d[_0xcaeb('0x24')]=qs[_0xcaeb('0x24')](_0x554793[_0xcaeb('0x33')][_0xcaeb('0x24')]);_0x1e945d[_0xcaeb('0x22')]=qs[_0xcaeb('0x22')](_0x554793['query'][_0xcaeb('0x22')]);}_0x1e945d[_0xcaeb('0x3a')]=qs['sort'](_0x554793[_0xcaeb('0x33')]['sort']);_0x1e945d[_0xcaeb('0x3b')]=qs[_0xcaeb('0x35')](_[_0xcaeb('0x3c')](_0x554793['query'],_0x3840ab[_0xcaeb('0x35')]),_0x2c5385);if(_0x554793[_0xcaeb('0x33')][_0xcaeb('0x3d')]){_0x1e945d['where']=_[_0xcaeb('0x3e')](_0x1e945d[_0xcaeb('0x3b')],{'$or':_['map'](_0x2c5385,function(_0x4bde6a){if(_0x4bde6a[_0xcaeb('0x3f')]!==_0xcaeb('0x40')){var _0x4e0a22={};_0x4e0a22[_0x4bde6a[_0xcaeb('0x2b')]]={'$like':'%'+_0x554793['query'][_0xcaeb('0x3d')]+'%'};return _0x4e0a22;}})});}_0x1e945d=_[_0xcaeb('0x3e')]({},_0x1e945d,_0x554793[_0xcaeb('0x41')]);var _0x33c6ef={'where':_0x1e945d['where']};return db[_0xcaeb('0x2e')][_0xcaeb('0x23')](_0x33c6ef)['then'](function(_0x14f3a7){_0x47d89d[_0xcaeb('0x23')]=_0x14f3a7;if(_0x554793[_0xcaeb('0x33')]['includeAll']){_0x1e945d[_0xcaeb('0x42')]=[{'all':!![]}];}return db['Team'][_0xcaeb('0x43')](_0x1e945d);})['then'](function(_0x143ad6){_0x47d89d[_0xcaeb('0x44')]=_0x143ad6;return _0x47d89d;})[_0xcaeb('0x29')](respondWithFilteredResult(_0x23005d,_0x1e945d))[_0xcaeb('0x45')](handleError(_0x23005d,null));};exports[_0xcaeb('0x46')]=function(_0xff2e7e,_0x307a17){var _0xe82e23={'raw':![],'where':{'id':_0xff2e7e[_0xcaeb('0x47')]['id']}},_0x2b74f0={};_0x2b74f0[_0xcaeb('0x31')]=_[_0xcaeb('0x34')](db[_0xcaeb('0x2e')]['rawAttributes']);_0x2b74f0[_0xcaeb('0x33')]=_['keys'](_0xff2e7e[_0xcaeb('0x33')]);_0x2b74f0[_0xcaeb('0x35')]=_[_0xcaeb('0x36')](_0x2b74f0[_0xcaeb('0x31')],_0x2b74f0['query']);_0xe82e23[_0xcaeb('0x37')]=_[_0xcaeb('0x36')](_0x2b74f0[_0xcaeb('0x31')],qs[_0xcaeb('0x38')](_0xff2e7e[_0xcaeb('0x33')][_0xcaeb('0x38')]));_0xe82e23[_0xcaeb('0x37')]=_0xe82e23[_0xcaeb('0x37')][_0xcaeb('0x48')]?_0xe82e23['attributes']:_0x2b74f0[_0xcaeb('0x31')];if(_0xff2e7e['query']['includeAll']){_0xe82e23[_0xcaeb('0x42')]=[{'all':!![]}];}_0xe82e23=_[_0xcaeb('0x3e')]({},_0xe82e23,_0xff2e7e[_0xcaeb('0x41')]);return db['Team']['find'](_0xe82e23)[_0xcaeb('0x29')](handleEntityNotFound(_0x307a17,null))[_0xcaeb('0x29')](respondWithResult(_0x307a17,null))[_0xcaeb('0x45')](handleError(_0x307a17,null));};exports[_0xcaeb('0x49')]=function(_0x38489d,_0x5589de){return db[_0xcaeb('0x2e')][_0xcaeb('0x49')](_0x38489d[_0xcaeb('0x4a')],{})[_0xcaeb('0x29')](function(_0x240c4d){var _0x20d5c3=_0x38489d[_0xcaeb('0x4b')][_0xcaeb('0x4c')]({'plain':!![]});if(!_0x20d5c3)throw new Error(_0xcaeb('0x4d'));if(_0x20d5c3[_0xcaeb('0x4e')]==='user'){var _0x2986b6=_0x240c4d[_0xcaeb('0x4c')]({'plain':!![]});var _0x1b549b=_0xcaeb('0x4f');return db[_0xcaeb('0x50')][_0xcaeb('0x51')]({'where':{'name':_0x1b549b,'userProfileId':_0x20d5c3['userProfileId']},'raw':!![]})[_0xcaeb('0x29')](function(_0x51015d){if(_0x51015d&&_0x51015d[_0xcaeb('0x52')]===0x0){return db[_0xcaeb('0x53')]['create']({'name':_0x2986b6['name'],'resourceId':_0x2986b6['id'],'type':_0x51015d[_0xcaeb('0x2b')],'sectionId':_0x51015d['id']},{})[_0xcaeb('0x29')](function(){return _0x240c4d;});}else{return _0x240c4d;}})['catch'](function(_0x22547c){logger[_0xcaeb('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22547c);throw _0x22547c;});}return _0x240c4d;})[_0xcaeb('0x29')](respondWithResult(_0x5589de,0xc9))['catch'](handleError(_0x5589de,null));};exports[_0xcaeb('0x54')]=function(_0x289043,_0x123297){if(_0x289043[_0xcaeb('0x4a')]['id']){delete _0x289043[_0xcaeb('0x4a')]['id'];}return db[_0xcaeb('0x2e')][_0xcaeb('0x51')]({'where':{'id':_0x289043[_0xcaeb('0x47')]['id']}})[_0xcaeb('0x29')](handleEntityNotFound(_0x123297,null))['then'](saveUpdates(_0x289043[_0xcaeb('0x4a')],null))[_0xcaeb('0x29')](respondWithResult(_0x123297,null))[_0xcaeb('0x45')](handleError(_0x123297,null));};exports['destroy']=function(_0x9dfcf,_0x4dc083){var _0x2a7be4=_0x9dfcf[_0xcaeb('0x47')]['id'];var _0x88fb70=[];return db['sequelize']['transaction'](function(_0x386175){var _0x5372fb=_0xcaeb('0x55')+_0x2a7be4;return db[_0xcaeb('0x56')][_0xcaeb('0x33')](_0x5372fb,{'type':db[_0xcaeb('0x57')]['QueryTypes'][_0xcaeb('0x58')],'raw':!![],'transaction':_0x386175})[_0xcaeb('0x29')](function(_0x16ef6c){_0x88fb70=_[_0xcaeb('0x32')](_0x16ef6c,function(_0x1f0822){return Number(_0x1f0822[_0xcaeb('0x59')]);});})[_0xcaeb('0x29')](function(){var _0x43639b=_0xcaeb('0x5a')+_0x2a7be4;return db['sequelize'][_0xcaeb('0x33')](_0x43639b,{'type':db[_0xcaeb('0x57')][_0xcaeb('0x5b')][_0xcaeb('0x58')],'raw':!![],'transaction':_0x386175});})['then'](function(_0x152700){var _0x1e5589=_[_0xcaeb('0x32')](_0x152700,function(_0x9ed898){return Number(_0x9ed898['VoiceQueueId']);});return db[_0xcaeb('0x5c')]['destroy']({'where':{'UserId':{'$in':_0x88fb70},'VoiceQueueId':{'$in':_0x1e5589}},'transaction':_0x386175});})[_0xcaeb('0x29')](function(){var _0x116953='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2a7be4;return db['sequelize'][_0xcaeb('0x33')](_0x116953,{'type':db[_0xcaeb('0x57')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x386175});})['then'](function(_0x3ec6c4){var _0x3eb2ef=_['map'](_0x3ec6c4,function(_0x58add2){return Number(_0x58add2[_0xcaeb('0x5d')]);});return db[_0xcaeb('0x5e')][_0xcaeb('0x5f')]({'where':{'UserId':{'$in':_0x88fb70},'MailQueueId':{'$in':_0x3eb2ef}},'transaction':_0x386175});})[_0xcaeb('0x29')](function(){var _0x55b9bc=_0xcaeb('0x60')+_0x2a7be4;return db[_0xcaeb('0x56')][_0xcaeb('0x33')](_0x55b9bc,{'type':db[_0xcaeb('0x57')][_0xcaeb('0x5b')]['SELECT'],'raw':!![],'transaction':_0x386175});})[_0xcaeb('0x29')](function(_0x46ad74){var _0x19829e=_[_0xcaeb('0x32')](_0x46ad74,function(_0x1cf65d){return Number(_0x1cf65d[_0xcaeb('0x61')]);});return db[_0xcaeb('0x62')][_0xcaeb('0x5f')]({'where':{'UserId':{'$in':_0x88fb70},'SmsQueueId':{'$in':_0x19829e}},'transaction':_0x386175});})['then'](function(){var _0x1f003a='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2a7be4;return db[_0xcaeb('0x56')][_0xcaeb('0x33')](_0x1f003a,{'type':db[_0xcaeb('0x57')][_0xcaeb('0x5b')][_0xcaeb('0x58')],'raw':!![],'transaction':_0x386175});})[_0xcaeb('0x29')](function(_0x5bea14){var _0x5861e6=_[_0xcaeb('0x32')](_0x5bea14,function(_0x28127d){return Number(_0x28127d[_0xcaeb('0x63')]);});return db[_0xcaeb('0x64')][_0xcaeb('0x5f')]({'where':{'UserId':{'$in':_0x88fb70},'ChatQueueId':{'$in':_0x5861e6}},'transaction':_0x386175});})['then'](function(){var _0x235b03=_0xcaeb('0x65')+_0x2a7be4;return db[_0xcaeb('0x56')][_0xcaeb('0x33')](_0x235b03,{'type':db[_0xcaeb('0x57')][_0xcaeb('0x5b')]['SELECT'],'raw':!![],'transaction':_0x386175});})[_0xcaeb('0x29')](function(_0x49d508){var _0x10e9f9=_[_0xcaeb('0x32')](_0x49d508,function(_0x39f05a){return Number(_0x39f05a[_0xcaeb('0x66')]);});return db[_0xcaeb('0x67')]['destroy']({'where':{'UserId':{'$in':_0x88fb70},'FaxQueueId':{'$in':_0x10e9f9}},'transaction':_0x386175});})['then'](function(){var _0x1bfc8e=_0xcaeb('0x68')+_0x2a7be4;return db[_0xcaeb('0x56')][_0xcaeb('0x33')](_0x1bfc8e,{'type':db[_0xcaeb('0x57')][_0xcaeb('0x5b')]['SELECT'],'raw':!![],'transaction':_0x386175});})[_0xcaeb('0x29')](function(_0x4e46c3){var _0x22c009=_[_0xcaeb('0x32')](_0x4e46c3,function(_0x38f526){return Number(_0x38f526[_0xcaeb('0x69')]);});return db['UserOpenchannelQueue']['destroy']({'where':{'UserId':{'$in':_0x88fb70},'OpenchannelQueueId':{'$in':_0x22c009}},'transaction':_0x386175});})[_0xcaeb('0x29')](function(){var _0x28b197=_0xcaeb('0x6a')+_0x2a7be4;return db[_0xcaeb('0x56')]['query'](_0x28b197,{'type':db[_0xcaeb('0x57')][_0xcaeb('0x5b')][_0xcaeb('0x58')],'raw':!![],'transaction':_0x386175});})[_0xcaeb('0x29')](function(_0x1294c6){var _0x19b726=_[_0xcaeb('0x32')](_0x1294c6,function(_0x394d71){return Number(_0x394d71[_0xcaeb('0x6b')]);});return db[_0xcaeb('0x6c')][_0xcaeb('0x5f')]({'where':{'UserId':{'$in':_0x88fb70},'WhatsappQueueId':{'$in':_0x19b726}},'transaction':_0x386175});})[_0xcaeb('0x29')](function(){return db[_0xcaeb('0x6d')][_0xcaeb('0x51')]({'where':{'TeamId':_0x2a7be4}});})[_0xcaeb('0x29')](function(_0x5eeab8){if(_0x5eeab8===null){return;}return db[_0xcaeb('0x6e')][_0xcaeb('0x5f')]({'where':{'UserId':{'$in':_0x88fb70},'VoicePrefixId':_0x5eeab8[_0xcaeb('0x6f')]},'transaction':_0x386175});})[_0xcaeb('0x29')](function(){return db[_0xcaeb('0x2e')][_0xcaeb('0x5f')]({'where':{'id':_0x2a7be4},'cascade':!![],'transaction':_0x386175});})['then'](function(_0x175116){if(_0x175116===0x0){_0x4dc083[_0xcaeb('0x1e')](0x194);}else{return db[_0xcaeb('0x53')][_0xcaeb('0x5f')]({'where':{'type':_0xcaeb('0x4f'),'resourceId':_0x2a7be4},'cascade':!![],'transaction':_0x386175})['then'](function(){_0x4dc083[_0xcaeb('0x1f')](0xcc)[_0xcaeb('0x70')]();});}})[_0xcaeb('0x45')](function(_0x141ccd){_0x4dc083[_0xcaeb('0x1f')](0x1f4)[_0xcaeb('0x2c')](_0x141ccd);});});};exports[_0xcaeb('0x71')]=function(_0x5ab8c2,_0x587abe,_0xc57090){return db[_0xcaeb('0x2e')][_0xcaeb('0x72')]({'where':{'id':_0x5ab8c2[_0xcaeb('0x47')]['id']}})[_0xcaeb('0x29')](handleEntityNotFound(_0x587abe,null))[_0xcaeb('0x29')](function(_0x3b5a1d){if(!_0x5ab8c2[_0xcaeb('0x33')][_0xcaeb('0x73')]||!utils['isValidChannel'](_0x5ab8c2['query'][_0xcaeb('0x73')])){throw new db[(_0xcaeb('0x57'))]['ValidationError'](_0xcaeb('0x74'));}var _0x4e9ac7={};var _0x4cbfe3={};_0x4cbfe3['model']=_[_0xcaeb('0x34')](db[_[_0xcaeb('0x75')](_0x5ab8c2[_0xcaeb('0x33')][_0xcaeb('0x73')]['toLowerCase']())+'Queue'][_0xcaeb('0x2f')]);_0x4cbfe3[_0xcaeb('0x33')]=_[_0xcaeb('0x34')](_0x5ab8c2['query']);_0x4cbfe3[_0xcaeb('0x35')]=_[_0xcaeb('0x36')](_0x4cbfe3[_0xcaeb('0x31')],_0x4cbfe3[_0xcaeb('0x33')]);_0x4e9ac7[_0xcaeb('0x37')]=_[_0xcaeb('0x36')](_0x4cbfe3[_0xcaeb('0x31')],qs[_0xcaeb('0x38')](_0x5ab8c2[_0xcaeb('0x33')]['fields']));_0x4e9ac7[_0xcaeb('0x37')]=_0x4e9ac7[_0xcaeb('0x37')]['length']?_0x4e9ac7[_0xcaeb('0x37')]:_0x4cbfe3[_0xcaeb('0x31')];_0x4e9ac7[_0xcaeb('0x24')]=qs['limit'](_0x5ab8c2['query'][_0xcaeb('0x24')]);_0x4e9ac7[_0xcaeb('0x22')]=qs[_0xcaeb('0x22')](_0x5ab8c2['query'][_0xcaeb('0x22')]);_0x4e9ac7[_0xcaeb('0x3a')]=qs[_0xcaeb('0x76')](_0x5ab8c2[_0xcaeb('0x33')][_0xcaeb('0x76')]);_0x4e9ac7[_0xcaeb('0x3b')]=qs[_0xcaeb('0x35')](_[_0xcaeb('0x3c')](_0x5ab8c2[_0xcaeb('0x33')],_0x4cbfe3[_0xcaeb('0x35')]));_0x4e9ac7=_[_0xcaeb('0x3e')]({},_0x4e9ac7,_0x5ab8c2[_0xcaeb('0x41')]);return _0x3b5a1d[_0xcaeb('0x4c')+_['capitalize'](_0x5ab8c2['query'][_0xcaeb('0x73')][_0xcaeb('0x77')]())+_0xcaeb('0x78')](_0x4e9ac7);})[_0xcaeb('0x29')](respondWithResult(_0x587abe,null))[_0xcaeb('0x45')](handleError(_0x587abe,null));};exports[_0xcaeb('0x79')]=function(_0x29e23b,_0x1e1fb4,_0x1dbf72){return db[_0xcaeb('0x2e')][_0xcaeb('0x72')]({'where':{'id':_0x29e23b[_0xcaeb('0x47')]['id']}})['then'](function(_0x2af12b){if(_0x2af12b){if(!_0x29e23b['body'][_0xcaeb('0x73')]||!utils['isValidChannel'](_0x29e23b[_0xcaeb('0x4a')][_0xcaeb('0x73')])){throw new db['Sequelize'][(_0xcaeb('0x7a'))](_0xcaeb('0x74'));}return _0x2af12b[_0xcaeb('0x7b')+_[_0xcaeb('0x75')](_0x29e23b['body'][_0xcaeb('0x73')][_0xcaeb('0x77')]())+_0xcaeb('0x78')](_0x29e23b[_0xcaeb('0x4a')][_0xcaeb('0x7c')]);}return null;})['then'](handleEntityNotFound(_0x1e1fb4,null))[_0xcaeb('0x29')](respondWithStatusCode(_0x1e1fb4,null))[_0xcaeb('0x45')](handleError(_0x1e1fb4,null));};exports['removeQueues']=function(_0x5634f3,_0x453c73,_0x49a986){return db[_0xcaeb('0x2e')][_0xcaeb('0x72')]({'where':{'id':_0x5634f3[_0xcaeb('0x47')]['id']}})['then'](function(_0x5728f5){if(_0x5728f5){if(!_0x5634f3['query']['channel']||!utils['isValidChannel'](_0x5634f3[_0xcaeb('0x33')][_0xcaeb('0x73')])){throw new db[(_0xcaeb('0x57'))][(_0xcaeb('0x7a'))](_0xcaeb('0x74'));}return _0x5728f5['remove'+_[_0xcaeb('0x75')](_0x5634f3[_0xcaeb('0x33')][_0xcaeb('0x73')][_0xcaeb('0x77')]())+_0xcaeb('0x78')](_0x5634f3[_0xcaeb('0x33')][_0xcaeb('0x7c')]);}return null;})[_0xcaeb('0x29')](handleEntityNotFound(_0x453c73,null))[_0xcaeb('0x29')](respondWithStatusCode(_0x453c73,null))[_0xcaeb('0x45')](handleError(_0x453c73,null));};exports['addAgents']=function(_0x348ac2,_0x23d7cd){var _0x30f900=_[_0xcaeb('0x7d')](_0x348ac2['body'][_0xcaeb('0x7c')])?_0x348ac2[_0xcaeb('0x4a')][_0xcaeb('0x7c')]:[_0x348ac2[_0xcaeb('0x4a')][_0xcaeb('0x7c')]];var _0x24f87d=_0x348ac2[_0xcaeb('0x47')]['id'];return db[_0xcaeb('0x2e')][_0xcaeb('0x51')]({'where':{'id':_0x24f87d}})['then'](handleEntityNotFound(_0x23d7cd,null))['then'](function(_0x310f87){if(_0x310f87){var _0x350a4e=[_0xcaeb('0x7e'),'Chat','Mail','Sms',_0xcaeb('0x7f'),_0xcaeb('0x80'),_0xcaeb('0x81')];return db[_0xcaeb('0x56')]['transaction'](function(_0x30af09){var _0x320810=_[_0xcaeb('0x32')](_0x350a4e,function(_0x3a4745){var _0x38e062={'attributes':['id',_0xcaeb('0x2b')]};if(_0x3a4745===_0xcaeb('0x7e')){_0x38e062[_0xcaeb('0x82')]={'attributes':[_0xcaeb('0x83')]};}return _0x310f87[_0xcaeb('0x4c')+_0x3a4745+_0xcaeb('0x78')](_0x38e062)[_0xcaeb('0x29')](function(_0x35d07a){var _0x5e79a5=_[_0xcaeb('0x32')](_0x35d07a,function(_0x4b926a){var _0x21a424=_[_0xcaeb('0x32')](_0x30f900,function(_0x105172){var _0x1b1a02={'where':{'UserId':_0x105172,[_0x3a4745+_0xcaeb('0x84')]:_0x4b926a['id']},'transaction':_0x30af09};if(_0x3a4745===_0xcaeb('0x7e')){_0x1b1a02[_0xcaeb('0x19')]={'penalty':_0x4b926a[_0xcaeb('0x85')][_0xcaeb('0x83')]};}return db[_0xcaeb('0x86')+_0x3a4745+_0xcaeb('0x87')][_0xcaeb('0x88')](_0x1b1a02)[_0xcaeb('0x29')](function(){socket[_0xcaeb('0x89')](_0xcaeb('0x4b')+_0x3a4745+'Queue:save',{'UserId':_0x105172,[_0x3a4745+_0xcaeb('0x84')]:_0x4b926a['id']});if(_0x3a4745!==_0xcaeb('0x7e')){return;}return db[_0xcaeb('0x86')]['findAll']({'where':{'id':_0x30f900,'online':0x1},'attributes':['id',_0xcaeb('0x2b'),_0xcaeb('0x8a'),_0xcaeb('0x8b'),_0xcaeb('0x8c')],'raw':!![]})[_0xcaeb('0x29')](function(_0x137d77){var _0xea34d9=_[_0xcaeb('0x32')](_0x137d77,function(_0x3b9474){return db[_0xcaeb('0x8d')]['upsert']({'membername':_0x3b9474[_0xcaeb('0x2b')],'UserId':_0x3b9474['id'],'queue_name':_0x4b926a[_0xcaeb('0x2b')],'VoiceQueueId':_0x4b926a['id'],'interface':_['isNil'](_0x3b9474[_0xcaeb('0x8c')])?util[_0xcaeb('0x8e')](_0xcaeb('0x8f'),_0x3b9474[_0xcaeb('0x2b')]):_0x3b9474[_0xcaeb('0x8c')],'paused':_0x3b9474[_0xcaeb('0x8b')]||![],'penalty':_0x4b926a['TeamVoiceQueue'][_0xcaeb('0x83')]},{'transaction':_0x30af09});});return Promise[_0xcaeb('0x90')](_0xea34d9);});});});return Promise[_0xcaeb('0x90')](_0x21a424);});return Promise[_0xcaeb('0x90')](_0x5e79a5);})[_0xcaeb('0x29')](function(){return db[_0xcaeb('0x6d')][_0xcaeb('0x72')]({'where':{'teamId':_0x24f87d}})[_0xcaeb('0x29')](function(_0x4485d1){if(_0x4485d1){var _0x53e6c7=_['map'](_0x30f900,function(_0x2eefee){db['UserVoicePrefix'][_0xcaeb('0x91')]({'UserId':_0x2eefee,'VoicePrefixId':_0x4485d1[_0xcaeb('0x6f')]});});return Promise['all'](_0x53e6c7);}});});});return Promise[_0xcaeb('0x90')](_0x320810)['then'](function(){return _0x310f87[_0xcaeb('0x92')](_0x30f900,{'transaction':_0x30af09})[_0xcaeb('0x93')](function(_0x308b84){return _0x308b84;});});});}})['then'](respondWithResult(_0x23d7cd,null))[_0xcaeb('0x45')](handleError(_0x23d7cd,null));};exports['removeAgents']=function(_0x138a1e,_0x4583b0){var _0x9953a6=_[_0xcaeb('0x7d')](_0x138a1e[_0xcaeb('0x33')][_0xcaeb('0x7c')])?_0x138a1e[_0xcaeb('0x33')][_0xcaeb('0x7c')]:[_0x138a1e[_0xcaeb('0x33')]['ids']];var _0x49c773=_0x138a1e[_0xcaeb('0x47')]['id'];return db['Team'][_0xcaeb('0x51')]({'where':{'id':_0x49c773}})[_0xcaeb('0x29')](handleEntityNotFound(_0x4583b0,null))['then'](function(_0x501031){if(_0x501031){var _0x397582=['Voice',_0xcaeb('0x94'),_0xcaeb('0x95'),_0xcaeb('0x96'),_0xcaeb('0x7f'),_0xcaeb('0x80'),_0xcaeb('0x81')];return db['sequelize']['transaction'](function(_0xdab437){var _0xcb677c=_[_0xcaeb('0x32')](_0x397582,function(_0x5822e9){var _0xa86b1a={'attributes':['id',_0xcaeb('0x2b')]};return _0x501031['get'+_0x5822e9+'Queues'](_0xa86b1a)['then'](function(_0x5cc164){var _0x528346=_[_0xcaeb('0x32')](_0x5cc164,function(_0x482837){return _0x482837[_0xcaeb('0x97')](_0x9953a6,{'transaction':_0xdab437})[_0xcaeb('0x29')](function(){var _0x2e1f32=_['map'](_0x9953a6,function(_0x237566){socket[_0xcaeb('0x89')](_0xcaeb('0x4b')+_0x5822e9+'Queue:remove',{'UserId':Number(_0x237566),[_0x5822e9+_0xcaeb('0x84')]:_0x482837['id']});if(_0x5822e9!==_0xcaeb('0x7e')){return;}return db[_0xcaeb('0x8d')]['destroy']({'where':{'VoiceQueueId':_0x482837['id'],'UserId':_0x237566},'transaction':_0xdab437});});return Promise[_0xcaeb('0x90')](_0x2e1f32);});});return Promise['all'](_0x528346);});});return Promise['all'](_0xcb677c)[_0xcaeb('0x29')](function(){return _0x501031['removeAgents'](_0x9953a6,{'transaction':_0xdab437});})[_0xcaeb('0x29')](function(){return db[_0xcaeb('0x6d')][_0xcaeb('0x72')]({'where':{'teamId':_0x49c773}})[_0xcaeb('0x29')](function(_0x5d4807){if(_0x5d4807){var _0xf3be95=_[_0xcaeb('0x32')](_0x9953a6,function(_0x54090e){db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x54090e,'VoicePrefixId':_0x5d4807[_0xcaeb('0x6f')]}});});return Promise[_0xcaeb('0x90')](_0xf3be95);}});});});}})[_0xcaeb('0x29')](respondWithStatusCode(_0x4583b0,null))[_0xcaeb('0x45')](handleError(_0x4583b0,null));};exports['getAgents']=function(_0x5c669d,_0x34b67b,_0x33cd50){var _0x2bfa42={};var _0x3af409={};var _0x2e3e68;var _0x23fa73;return db['Team'][_0xcaeb('0x72')]({'where':{'id':_0x5c669d['params']['id']}})['then'](handleEntityNotFound(_0x34b67b,null))[_0xcaeb('0x29')](function(_0x1f9e0c){if(_0x1f9e0c){_0x2e3e68=_0x1f9e0c;_0x3af409[_0xcaeb('0x31')]=_[_0xcaeb('0x34')](db[_0xcaeb('0x86')][_0xcaeb('0x2f')]);_0x3af409[_0xcaeb('0x33')]=_[_0xcaeb('0x34')](_0x5c669d[_0xcaeb('0x33')]);_0x3af409[_0xcaeb('0x35')]=_[_0xcaeb('0x36')](_0x3af409[_0xcaeb('0x31')],_0x3af409[_0xcaeb('0x33')]);_0x2bfa42['attributes']=_[_0xcaeb('0x36')](_0x3af409['model'],qs[_0xcaeb('0x38')](_0x5c669d[_0xcaeb('0x33')]['fields']));_0x2bfa42[_0xcaeb('0x37')]=_0x2bfa42[_0xcaeb('0x37')][_0xcaeb('0x48')]?_0x2bfa42[_0xcaeb('0x37')]:_0x3af409['model'];_0x2bfa42[_0xcaeb('0x3a')]=qs[_0xcaeb('0x76')](_0x5c669d[_0xcaeb('0x33')][_0xcaeb('0x76')]);_0x2bfa42[_0xcaeb('0x3b')]=qs['filters'](_[_0xcaeb('0x3c')](_0x5c669d[_0xcaeb('0x33')],_0x3af409[_0xcaeb('0x35')]));if(_0x5c669d[_0xcaeb('0x33')][_0xcaeb('0x3d')]){_0x2bfa42[_0xcaeb('0x3b')]=_['merge'](_0x2bfa42['where'],{'$or':_['map'](_0x2bfa42[_0xcaeb('0x37')],function(_0x40b0c1){var _0x300bb3={};_0x300bb3[_0x40b0c1]={'$like':'%'+_0x5c669d[_0xcaeb('0x33')][_0xcaeb('0x3d')]+'%'};return _0x300bb3;})});}_0x2bfa42=_['merge']({},_0x2bfa42,_0x5c669d[_0xcaeb('0x41')]);return _0x2e3e68['getAgents'](_0x2bfa42);}})[_0xcaeb('0x29')](function(_0x20a191){if(_0x20a191){_0x23fa73=_0x20a191[_0xcaeb('0x48')];if(!_0x5c669d[_0xcaeb('0x33')][_0xcaeb('0x39')]('nolimit')){_0x2bfa42[_0xcaeb('0x24')]=qs[_0xcaeb('0x24')](_0x5c669d[_0xcaeb('0x33')][_0xcaeb('0x24')]);_0x2bfa42[_0xcaeb('0x22')]=qs['offset'](_0x5c669d['query']['offset']);}return _0x2e3e68['getAgents'](_0x2bfa42);}})[_0xcaeb('0x29')](function(_0x4a6d28){if(_0x4a6d28){return _0x4a6d28?{'count':_0x23fa73,'rows':_0x4a6d28}:null;}})[_0xcaeb('0x29')](respondWithResult(_0x34b67b,null))[_0xcaeb('0x45')](handleError(_0x34b67b,null));}; \ No newline at end of file +var _0x0c18=['key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','type','VIRTUAL','merge','options','then','includeAll','include','rows','catch','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','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','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','destroy','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','end','getQueues','findOne','channel','isValidChannel','ValidationError','pick','capitalize','toLowerCase','Queues','addQueues','Unknown\x20channel','add','removeQueues','remove','addAgents','ids','Chat','Mail','Fax','Whatsapp','Voice','penalty','QueueId','TeamVoiceQueue','User','Queue','findOrCreate','emit','findAll','online','upsert','isNil','interface','format','SIP/%s','all','spread','removeAgents','isArray','Sms','Openchannel','Queue:remove','UserVoiceQueueRt','getAgents','filter','hasOwnProperty','eml-format','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','./team.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','reject','save','error','name','send','index','map','Team','rawAttributes','fieldName'];(function(_0x51f4fc,_0x1fe3ef){var _0x4d96fc=function(_0xddc9){while(--_0xddc9){_0x51f4fc['push'](_0x51f4fc['shift']());}};_0x4d96fc(++_0x1fe3ef);}(_0x0c18,0x101));var _0x80c1=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0x0c18[_0x44b3bd];return _0x1efc4a;};'use strict';var emlformat=require(_0x80c1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x80c1('0x1'));var moment=require(_0x80c1('0x2'));var BPromise=require(_0x80c1('0x3'));var Mustache=require('mustache');var util=require(_0x80c1('0x4'));var path=require(_0x80c1('0x5'));var sox=require(_0x80c1('0x6'));var csv=require(_0x80c1('0x7'));var ejs=require(_0x80c1('0x8'));var fs=require('fs');var fs_extra=require(_0x80c1('0x9'));var _=require(_0x80c1('0xa'));var squel=require(_0x80c1('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x80c1('0xc'));var toCsv=require(_0x80c1('0x7'));var querystring=require('querystring');var Papa=require(_0x80c1('0xd'));var Redis=require(_0x80c1('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x80c1('0xf'));var hardwareService=require(_0x80c1('0x10'));var logger=require(_0x80c1('0x11'))(_0x80c1('0x12'));var utils=require(_0x80c1('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x80c1('0x14'));var db=require('../../mysqldb')['db'];config[_0x80c1('0x15')]=_[_0x80c1('0x16')](config[_0x80c1('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x80c1('0x15')]));require(_0x80c1('0x17'))[_0x80c1('0x18')](socket);function respondWithStatusCode(_0x23c8ce,_0x3dcde7){_0x3dcde7=_0x3dcde7||0xcc;return function(_0x3f6635){if(_0x3f6635){return _0x23c8ce[_0x80c1('0x19')](_0x3dcde7);}return _0x23c8ce['status'](_0x3dcde7)['end']();};}function respondWithResult(_0x2ea2af,_0xce2364){_0xce2364=_0xce2364||0xc8;return function(_0x9e4497){if(_0x9e4497){return _0x2ea2af[_0x80c1('0x1a')](_0xce2364)[_0x80c1('0x1b')](_0x9e4497);}};}function respondWithFilteredResult(_0x5a1173,_0x2ad9fe){return function(_0x2cc1b1){if(_0x2cc1b1){var _0x39fe91=typeof _0x2ad9fe[_0x80c1('0x1c')]===_0x80c1('0x1d')&&typeof _0x2ad9fe['limit']===_0x80c1('0x1d');var _0x2c9a7b=_0x2cc1b1[_0x80c1('0x1e')];var _0x1f7ac7=_0x39fe91?0x0:_0x2ad9fe[_0x80c1('0x1c')];var _0x236d3c=_0x39fe91?_0x2cc1b1['count']:_0x2ad9fe[_0x80c1('0x1c')]+_0x2ad9fe[_0x80c1('0x1f')];var _0x545119;if(_0x236d3c>=_0x2c9a7b){_0x236d3c=_0x2c9a7b;_0x545119=0xc8;}else{_0x545119=0xce;}_0x5a1173[_0x80c1('0x1a')](_0x545119);return _0x5a1173[_0x80c1('0x20')]('Content-Range',_0x1f7ac7+'-'+_0x236d3c+'/'+_0x2c9a7b)[_0x80c1('0x1b')](_0x2cc1b1);}return null;};}function patchUpdates(_0x13960d){return function(_0x231c9){try{jsonpatch['apply'](_0x231c9,_0x13960d,!![]);}catch(_0x3c2d82){return BPromise[_0x80c1('0x21')](_0x3c2d82);}return _0x231c9[_0x80c1('0x22')]();};}function saveUpdates(_0x6a32bc,_0x49a9e2){return function(_0x390773){if(_0x390773){return _0x390773['update'](_0x6a32bc)['then'](function(_0x5b80cf){return _0x5b80cf;});}return null;};}function handleEntityNotFound(_0x381284,_0x3b5fe4){return function(_0x3a3155){if(!_0x3a3155){_0x381284['sendStatus'](0x194);}return _0x3a3155;};}function handleError(_0xce50e,_0x713bd0){_0x713bd0=_0x713bd0||0x1f4;return function(_0x4c8ac4){logger[_0x80c1('0x23')](_0x4c8ac4['stack']);if(_0x4c8ac4[_0x80c1('0x24')]){delete _0x4c8ac4[_0x80c1('0x24')];}_0xce50e[_0x80c1('0x1a')](_0x713bd0)[_0x80c1('0x25')](_0x4c8ac4);};}exports[_0x80c1('0x26')]=function(_0x2c1775,_0x598d3b){var _0x506422={},_0x124765={},_0x4f6ce9={'count':0x0,'rows':[]};var _0x9a38d2=_[_0x80c1('0x27')](db[_0x80c1('0x28')][_0x80c1('0x29')],function(_0x31bb4d){return{'name':_0x31bb4d[_0x80c1('0x2a')],'type':_0x31bb4d['type'][_0x80c1('0x2b')]};});_0x124765[_0x80c1('0x2c')]=_[_0x80c1('0x27')](_0x9a38d2,_0x80c1('0x24'));_0x124765[_0x80c1('0x2d')]=_[_0x80c1('0x2e')](_0x2c1775[_0x80c1('0x2d')]);_0x124765['filters']=_[_0x80c1('0x2f')](_0x124765['model'],_0x124765[_0x80c1('0x2d')]);_0x506422[_0x80c1('0x30')]=_[_0x80c1('0x2f')](_0x124765[_0x80c1('0x2c')],qs[_0x80c1('0x31')](_0x2c1775[_0x80c1('0x2d')][_0x80c1('0x31')]));_0x506422[_0x80c1('0x30')]=_0x506422[_0x80c1('0x30')][_0x80c1('0x32')]?_0x506422[_0x80c1('0x30')]:_0x124765[_0x80c1('0x2c')];if(!_0x2c1775[_0x80c1('0x2d')]['hasOwnProperty'](_0x80c1('0x33'))){_0x506422[_0x80c1('0x1f')]=qs[_0x80c1('0x1f')](_0x2c1775[_0x80c1('0x2d')]['limit']);_0x506422[_0x80c1('0x1c')]=qs['offset'](_0x2c1775[_0x80c1('0x2d')]['offset']);}_0x506422[_0x80c1('0x34')]=qs[_0x80c1('0x35')](_0x2c1775['query'][_0x80c1('0x35')]);_0x506422[_0x80c1('0x36')]=qs['filters'](_['pick'](_0x2c1775[_0x80c1('0x2d')],_0x124765[_0x80c1('0x37')]),_0x9a38d2);if(_0x2c1775[_0x80c1('0x2d')]['filter']){_0x506422[_0x80c1('0x36')]=_['merge'](_0x506422[_0x80c1('0x36')],{'$or':_[_0x80c1('0x27')](_0x9a38d2,function(_0x24429c){if(_0x24429c[_0x80c1('0x38')]!==_0x80c1('0x39')){var _0x29e146={};_0x29e146[_0x24429c[_0x80c1('0x24')]]={'$like':'%'+_0x2c1775[_0x80c1('0x2d')]['filter']+'%'};return _0x29e146;}})});}_0x506422=_[_0x80c1('0x3a')]({},_0x506422,_0x2c1775[_0x80c1('0x3b')]);var _0x59d06f={'where':_0x506422[_0x80c1('0x36')]};return db['Team'][_0x80c1('0x1e')](_0x59d06f)[_0x80c1('0x3c')](function(_0x7affee){_0x4f6ce9['count']=_0x7affee;if(_0x2c1775[_0x80c1('0x2d')][_0x80c1('0x3d')]){_0x506422[_0x80c1('0x3e')]=[{'all':!![]}];}return db['Team']['findAll'](_0x506422);})[_0x80c1('0x3c')](function(_0x5a92c9){_0x4f6ce9[_0x80c1('0x3f')]=_0x5a92c9;return _0x4f6ce9;})[_0x80c1('0x3c')](respondWithFilteredResult(_0x598d3b,_0x506422))[_0x80c1('0x40')](handleError(_0x598d3b,null));};exports['show']=function(_0x11d524,_0x2b12ed){var _0x2f197b={'raw':![],'where':{'id':_0x11d524[_0x80c1('0x41')]['id']}},_0x5e800b={};_0x5e800b[_0x80c1('0x2c')]=_[_0x80c1('0x2e')](db[_0x80c1('0x28')]['rawAttributes']);_0x5e800b['query']=_[_0x80c1('0x2e')](_0x11d524['query']);_0x5e800b[_0x80c1('0x37')]=_[_0x80c1('0x2f')](_0x5e800b['model'],_0x5e800b[_0x80c1('0x2d')]);_0x2f197b['attributes']=_[_0x80c1('0x2f')](_0x5e800b['model'],qs[_0x80c1('0x31')](_0x11d524['query'][_0x80c1('0x31')]));_0x2f197b[_0x80c1('0x30')]=_0x2f197b[_0x80c1('0x30')][_0x80c1('0x32')]?_0x2f197b[_0x80c1('0x30')]:_0x5e800b[_0x80c1('0x2c')];if(_0x11d524[_0x80c1('0x2d')][_0x80c1('0x3d')]){_0x2f197b[_0x80c1('0x3e')]=[{'all':!![]}];}_0x2f197b=_['merge']({},_0x2f197b,_0x11d524['options']);return db[_0x80c1('0x28')][_0x80c1('0x42')](_0x2f197b)[_0x80c1('0x3c')](handleEntityNotFound(_0x2b12ed,null))[_0x80c1('0x3c')](respondWithResult(_0x2b12ed,null))['catch'](handleError(_0x2b12ed,null));};exports[_0x80c1('0x43')]=function(_0x17c48a,_0x94a4f1){return db[_0x80c1('0x28')][_0x80c1('0x43')](_0x17c48a[_0x80c1('0x44')],{})[_0x80c1('0x3c')](function(_0x27a935){var _0x4c4447=_0x17c48a['user'][_0x80c1('0x45')]({'plain':!![]});if(!_0x4c4447)throw new Error(_0x80c1('0x46'));if(_0x4c4447[_0x80c1('0x47')]===_0x80c1('0x48')){var _0x2a2602=_0x27a935[_0x80c1('0x45')]({'plain':!![]});var _0xd12c8f=_0x80c1('0x49');return db[_0x80c1('0x4a')][_0x80c1('0x42')]({'where':{'name':_0xd12c8f,'userProfileId':_0x4c4447[_0x80c1('0x4b')]},'raw':!![]})['then'](function(_0x44ac67){if(_0x44ac67&&_0x44ac67[_0x80c1('0x4c')]===0x0){return db[_0x80c1('0x4d')][_0x80c1('0x43')]({'name':_0x2a2602[_0x80c1('0x24')],'resourceId':_0x2a2602['id'],'type':_0x44ac67[_0x80c1('0x24')],'sectionId':_0x44ac67['id']},{})[_0x80c1('0x3c')](function(){return _0x27a935;});}else{return _0x27a935;}})['catch'](function(_0x4e0ed9){logger[_0x80c1('0x23')](_0x80c1('0x4e'),_0x4e0ed9);throw _0x4e0ed9;});}return _0x27a935;})[_0x80c1('0x3c')](respondWithResult(_0x94a4f1,0xc9))[_0x80c1('0x40')](handleError(_0x94a4f1,null));};exports[_0x80c1('0x4f')]=function(_0x3cddbc,_0x1c786b){if(_0x3cddbc['body']['id']){delete _0x3cddbc[_0x80c1('0x44')]['id'];}return db[_0x80c1('0x28')][_0x80c1('0x42')]({'where':{'id':_0x3cddbc[_0x80c1('0x41')]['id']}})['then'](handleEntityNotFound(_0x1c786b,null))['then'](saveUpdates(_0x3cddbc[_0x80c1('0x44')],null))['then'](respondWithResult(_0x1c786b,null))[_0x80c1('0x40')](handleError(_0x1c786b,null));};exports['destroy']=function(_0x52c89d,_0x3fa4a4){var _0x2f0e96=_0x52c89d[_0x80c1('0x41')]['id'];var _0x326e4d=[];return db[_0x80c1('0x50')][_0x80c1('0x51')](function(_0x1635b5){var _0x39f1d0=_0x80c1('0x52')+_0x2f0e96;return db[_0x80c1('0x50')][_0x80c1('0x2d')](_0x39f1d0,{'type':db[_0x80c1('0x53')][_0x80c1('0x54')][_0x80c1('0x55')],'raw':!![],'transaction':_0x1635b5})['then'](function(_0x45c7d0){_0x326e4d=_[_0x80c1('0x27')](_0x45c7d0,function(_0x302143){return Number(_0x302143[_0x80c1('0x56')]);});})[_0x80c1('0x3c')](function(){var _0x3cadb1='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2f0e96;return db[_0x80c1('0x50')][_0x80c1('0x2d')](_0x3cadb1,{'type':db['Sequelize'][_0x80c1('0x54')][_0x80c1('0x55')],'raw':!![],'transaction':_0x1635b5});})[_0x80c1('0x3c')](function(_0x29031e){var _0x28e75c=_[_0x80c1('0x27')](_0x29031e,function(_0x308736){return Number(_0x308736[_0x80c1('0x57')]);});return db['UserVoiceQueue']['destroy']({'where':{'UserId':{'$in':_0x326e4d},'VoiceQueueId':{'$in':_0x28e75c}},'transaction':_0x1635b5});})[_0x80c1('0x3c')](function(){var _0x2e6291=_0x80c1('0x58')+_0x2f0e96;return db[_0x80c1('0x50')][_0x80c1('0x2d')](_0x2e6291,{'type':db[_0x80c1('0x53')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x1635b5});})[_0x80c1('0x3c')](function(_0xfc1c75){var _0x5bfe9d=_[_0x80c1('0x27')](_0xfc1c75,function(_0x6ac2c9){return Number(_0x6ac2c9['MailQueueId']);});return db['UserMailQueue'][_0x80c1('0x59')]({'where':{'UserId':{'$in':_0x326e4d},'MailQueueId':{'$in':_0x5bfe9d}},'transaction':_0x1635b5});})[_0x80c1('0x3c')](function(){var _0x535630=_0x80c1('0x5a')+_0x2f0e96;return db[_0x80c1('0x50')]['query'](_0x535630,{'type':db[_0x80c1('0x53')][_0x80c1('0x54')][_0x80c1('0x55')],'raw':!![],'transaction':_0x1635b5});})[_0x80c1('0x3c')](function(_0x4a68bd){var _0x8a65d6=_[_0x80c1('0x27')](_0x4a68bd,function(_0x1ecfec){return Number(_0x1ecfec[_0x80c1('0x5b')]);});return db[_0x80c1('0x5c')][_0x80c1('0x59')]({'where':{'UserId':{'$in':_0x326e4d},'SmsQueueId':{'$in':_0x8a65d6}},'transaction':_0x1635b5});})['then'](function(){var _0x11be22='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2f0e96;return db['sequelize'][_0x80c1('0x2d')](_0x11be22,{'type':db[_0x80c1('0x53')][_0x80c1('0x54')][_0x80c1('0x55')],'raw':!![],'transaction':_0x1635b5});})[_0x80c1('0x3c')](function(_0x3742c8){var _0x3c7336=_[_0x80c1('0x27')](_0x3742c8,function(_0x8f21d0){return Number(_0x8f21d0['ChatQueueId']);});return db['UserChatQueue'][_0x80c1('0x59')]({'where':{'UserId':{'$in':_0x326e4d},'ChatQueueId':{'$in':_0x3c7336}},'transaction':_0x1635b5});})['then'](function(){var _0x13aba3=_0x80c1('0x5d')+_0x2f0e96;return db['sequelize'][_0x80c1('0x2d')](_0x13aba3,{'type':db[_0x80c1('0x53')][_0x80c1('0x54')][_0x80c1('0x55')],'raw':!![],'transaction':_0x1635b5});})[_0x80c1('0x3c')](function(_0x48e3a0){var _0x1dbf6e=_[_0x80c1('0x27')](_0x48e3a0,function(_0x513adc){return Number(_0x513adc[_0x80c1('0x5e')]);});return db[_0x80c1('0x5f')][_0x80c1('0x59')]({'where':{'UserId':{'$in':_0x326e4d},'FaxQueueId':{'$in':_0x1dbf6e}},'transaction':_0x1635b5});})[_0x80c1('0x3c')](function(){var _0x3544dd=_0x80c1('0x60')+_0x2f0e96;return db['sequelize'][_0x80c1('0x2d')](_0x3544dd,{'type':db[_0x80c1('0x53')][_0x80c1('0x54')][_0x80c1('0x55')],'raw':!![],'transaction':_0x1635b5});})[_0x80c1('0x3c')](function(_0x52ccfe){var _0x384ac0=_[_0x80c1('0x27')](_0x52ccfe,function(_0x1becad){return Number(_0x1becad['OpenchannelQueueId']);});return db[_0x80c1('0x61')]['destroy']({'where':{'UserId':{'$in':_0x326e4d},'OpenchannelQueueId':{'$in':_0x384ac0}},'transaction':_0x1635b5});})['then'](function(){var _0x22ab30=_0x80c1('0x62')+_0x2f0e96;return db['sequelize'][_0x80c1('0x2d')](_0x22ab30,{'type':db[_0x80c1('0x53')][_0x80c1('0x54')]['SELECT'],'raw':!![],'transaction':_0x1635b5});})['then'](function(_0x459141){var _0x31ec21=_[_0x80c1('0x27')](_0x459141,function(_0x2b5760){return Number(_0x2b5760[_0x80c1('0x63')]);});return db['UserWhatsappQueue'][_0x80c1('0x59')]({'where':{'UserId':{'$in':_0x326e4d},'WhatsappQueueId':{'$in':_0x31ec21}},'transaction':_0x1635b5});})[_0x80c1('0x3c')](function(){return db[_0x80c1('0x64')][_0x80c1('0x42')]({'where':{'TeamId':_0x2f0e96}});})[_0x80c1('0x3c')](function(_0x197f2b){if(_0x197f2b===null){return;}return db[_0x80c1('0x65')][_0x80c1('0x59')]({'where':{'UserId':{'$in':_0x326e4d},'VoicePrefixId':_0x197f2b[_0x80c1('0x66')]},'transaction':_0x1635b5});})[_0x80c1('0x3c')](function(){return db[_0x80c1('0x28')][_0x80c1('0x59')]({'where':{'id':_0x2f0e96},'cascade':!![],'transaction':_0x1635b5});})['then'](function(_0x26a15a){if(_0x26a15a===0x0){_0x3fa4a4['sendStatus'](0x194);}else{return db[_0x80c1('0x4d')][_0x80c1('0x59')]({'where':{'type':'Teams','resourceId':_0x2f0e96},'cascade':!![],'transaction':_0x1635b5})[_0x80c1('0x3c')](function(){_0x3fa4a4[_0x80c1('0x1a')](0xcc)[_0x80c1('0x67')]();});}})[_0x80c1('0x40')](function(_0x87ac59){_0x3fa4a4[_0x80c1('0x1a')](0x1f4)[_0x80c1('0x25')](_0x87ac59);});});};exports[_0x80c1('0x68')]=function(_0x43a07d,_0x2ac090,_0x2e5c46){return db[_0x80c1('0x28')][_0x80c1('0x69')]({'where':{'id':_0x43a07d[_0x80c1('0x41')]['id']}})[_0x80c1('0x3c')](handleEntityNotFound(_0x2ac090,null))[_0x80c1('0x3c')](function(_0x4fe0af){if(!_0x43a07d[_0x80c1('0x2d')][_0x80c1('0x6a')]||!utils[_0x80c1('0x6b')](_0x43a07d[_0x80c1('0x2d')]['channel'])){throw new db[(_0x80c1('0x53'))][(_0x80c1('0x6c'))]('Unknown\x20channel');}var _0x2fa349={};var _0x171850={};_0x171850[_0x80c1('0x2c')]=_[_0x80c1('0x2e')](db[_['capitalize'](_0x43a07d[_0x80c1('0x2d')]['channel']['toLowerCase']())+'Queue'][_0x80c1('0x29')]);_0x171850[_0x80c1('0x2d')]=_[_0x80c1('0x2e')](_0x43a07d[_0x80c1('0x2d')]);_0x171850[_0x80c1('0x37')]=_['intersection'](_0x171850[_0x80c1('0x2c')],_0x171850[_0x80c1('0x2d')]);_0x2fa349['attributes']=_['intersection'](_0x171850[_0x80c1('0x2c')],qs['fields'](_0x43a07d[_0x80c1('0x2d')][_0x80c1('0x31')]));_0x2fa349[_0x80c1('0x30')]=_0x2fa349['attributes']['length']?_0x2fa349[_0x80c1('0x30')]:_0x171850['model'];_0x2fa349[_0x80c1('0x1f')]=qs[_0x80c1('0x1f')](_0x43a07d[_0x80c1('0x2d')][_0x80c1('0x1f')]);_0x2fa349[_0x80c1('0x1c')]=qs[_0x80c1('0x1c')](_0x43a07d['query']['offset']);_0x2fa349[_0x80c1('0x34')]=qs['sort'](_0x43a07d[_0x80c1('0x2d')][_0x80c1('0x35')]);_0x2fa349['where']=qs[_0x80c1('0x37')](_[_0x80c1('0x6d')](_0x43a07d[_0x80c1('0x2d')],_0x171850[_0x80c1('0x37')]));_0x2fa349=_[_0x80c1('0x3a')]({},_0x2fa349,_0x43a07d['options']);return _0x4fe0af[_0x80c1('0x45')+_[_0x80c1('0x6e')](_0x43a07d[_0x80c1('0x2d')][_0x80c1('0x6a')][_0x80c1('0x6f')]())+_0x80c1('0x70')](_0x2fa349);})[_0x80c1('0x3c')](respondWithResult(_0x2ac090,null))[_0x80c1('0x40')](handleError(_0x2ac090,null));};exports[_0x80c1('0x71')]=function(_0x393737,_0x182b60,_0x6d241){return db[_0x80c1('0x28')][_0x80c1('0x69')]({'where':{'id':_0x393737['params']['id']}})['then'](function(_0x2d74b8){if(_0x2d74b8){if(!_0x393737[_0x80c1('0x44')][_0x80c1('0x6a')]||!utils['isValidChannel'](_0x393737[_0x80c1('0x44')][_0x80c1('0x6a')])){throw new db[(_0x80c1('0x53'))][(_0x80c1('0x6c'))](_0x80c1('0x72'));}return _0x2d74b8[_0x80c1('0x73')+_['capitalize'](_0x393737[_0x80c1('0x44')]['channel'][_0x80c1('0x6f')]())+'Queues'](_0x393737[_0x80c1('0x44')]['ids']);}return null;})[_0x80c1('0x3c')](handleEntityNotFound(_0x182b60,null))[_0x80c1('0x3c')](respondWithStatusCode(_0x182b60,null))[_0x80c1('0x40')](handleError(_0x182b60,null));};exports[_0x80c1('0x74')]=function(_0x42678b,_0x26115f,_0x41d974){return db[_0x80c1('0x28')][_0x80c1('0x69')]({'where':{'id':_0x42678b[_0x80c1('0x41')]['id']}})['then'](function(_0x305dfa){if(_0x305dfa){if(!_0x42678b[_0x80c1('0x2d')]['channel']||!utils[_0x80c1('0x6b')](_0x42678b['query'][_0x80c1('0x6a')])){throw new db[(_0x80c1('0x53'))][(_0x80c1('0x6c'))]('Unknown\x20channel');}return _0x305dfa[_0x80c1('0x75')+_[_0x80c1('0x6e')](_0x42678b[_0x80c1('0x2d')][_0x80c1('0x6a')][_0x80c1('0x6f')]())+'Queues'](_0x42678b[_0x80c1('0x2d')]['ids']);}return null;})[_0x80c1('0x3c')](handleEntityNotFound(_0x26115f,null))[_0x80c1('0x3c')](respondWithStatusCode(_0x26115f,null))[_0x80c1('0x40')](handleError(_0x26115f,null));};exports[_0x80c1('0x76')]=function(_0x1bfbdf,_0x4ebe72){var _0x11b8fe=_['isArray'](_0x1bfbdf['body']['ids'])?_0x1bfbdf[_0x80c1('0x44')][_0x80c1('0x77')]:[_0x1bfbdf[_0x80c1('0x44')][_0x80c1('0x77')]];var _0x48c19c=_0x1bfbdf['params']['id'];return db[_0x80c1('0x28')][_0x80c1('0x42')]({'where':{'id':_0x48c19c}})[_0x80c1('0x3c')](handleEntityNotFound(_0x4ebe72,null))[_0x80c1('0x3c')](function(_0x510d37){if(_0x510d37){var _0x45c7e9=['Voice',_0x80c1('0x78'),_0x80c1('0x79'),'Sms',_0x80c1('0x7a'),'Openchannel',_0x80c1('0x7b')];return db[_0x80c1('0x50')]['transaction'](function(_0x2b181f){var _0x3eb09a=_[_0x80c1('0x27')](_0x45c7e9,function(_0x8c5f2e){var _0x264f3b={'attributes':['id',_0x80c1('0x24')]};if(_0x8c5f2e===_0x80c1('0x7c')){_0x264f3b['through']={'attributes':[_0x80c1('0x7d')]};}return _0x510d37[_0x80c1('0x45')+_0x8c5f2e+_0x80c1('0x70')](_0x264f3b)['then'](function(_0x1bc033){var _0x7e07e2=_['map'](_0x1bc033,function(_0x3c553c){var _0x9e102e=_[_0x80c1('0x27')](_0x11b8fe,function(_0x5be50a){var _0x115c86={'where':{'UserId':_0x5be50a,[_0x8c5f2e+_0x80c1('0x7e')]:_0x3c553c['id']},'transaction':_0x2b181f};if(_0x8c5f2e===_0x80c1('0x7c')){_0x115c86[_0x80c1('0x16')]={'penalty':_0x3c553c[_0x80c1('0x7f')]['penalty']};}return db[_0x80c1('0x80')+_0x8c5f2e+_0x80c1('0x81')][_0x80c1('0x82')](_0x115c86)['then'](function(){socket[_0x80c1('0x83')](_0x80c1('0x48')+_0x8c5f2e+'Queue:save',{'UserId':_0x5be50a,[_0x8c5f2e+_0x80c1('0x7e')]:_0x3c553c['id']});if(_0x8c5f2e!=='Voice'){return;}return db[_0x80c1('0x80')][_0x80c1('0x84')]({'where':{'id':_0x11b8fe,'online':0x1},'attributes':['id',_0x80c1('0x24'),_0x80c1('0x85'),'voicePause','interface'],'raw':!![]})[_0x80c1('0x3c')](function(_0x56dd11){var _0x1dabf4=_[_0x80c1('0x27')](_0x56dd11,function(_0x5283ed){return db['UserVoiceQueueRt'][_0x80c1('0x86')]({'membername':_0x5283ed['name'],'UserId':_0x5283ed['id'],'queue_name':_0x3c553c[_0x80c1('0x24')],'VoiceQueueId':_0x3c553c['id'],'interface':_[_0x80c1('0x87')](_0x5283ed[_0x80c1('0x88')])?util[_0x80c1('0x89')](_0x80c1('0x8a'),_0x5283ed[_0x80c1('0x24')]):_0x5283ed[_0x80c1('0x88')],'paused':_0x5283ed['voicePause']||![],'penalty':_0x3c553c['TeamVoiceQueue'][_0x80c1('0x7d')]},{'transaction':_0x2b181f});});return Promise['all'](_0x1dabf4);});});});return Promise[_0x80c1('0x8b')](_0x9e102e);});return Promise[_0x80c1('0x8b')](_0x7e07e2);})[_0x80c1('0x3c')](function(){return db[_0x80c1('0x64')][_0x80c1('0x69')]({'where':{'teamId':_0x48c19c}})[_0x80c1('0x3c')](function(_0x826316){if(_0x826316){var _0x5045be=_[_0x80c1('0x27')](_0x11b8fe,function(_0x2e4347){db[_0x80c1('0x65')][_0x80c1('0x86')]({'UserId':_0x2e4347,'VoicePrefixId':_0x826316[_0x80c1('0x66')]});});return Promise[_0x80c1('0x8b')](_0x5045be);}});});});return Promise[_0x80c1('0x8b')](_0x3eb09a)[_0x80c1('0x3c')](function(){return _0x510d37[_0x80c1('0x76')](_0x11b8fe,{'transaction':_0x2b181f})[_0x80c1('0x8c')](function(_0x37188c){return _0x37188c;});});});}})[_0x80c1('0x3c')](respondWithResult(_0x4ebe72,null))[_0x80c1('0x40')](handleError(_0x4ebe72,null));};exports[_0x80c1('0x8d')]=function(_0x1e2393,_0x239644){var _0xfee74=_[_0x80c1('0x8e')](_0x1e2393[_0x80c1('0x2d')][_0x80c1('0x77')])?_0x1e2393[_0x80c1('0x2d')][_0x80c1('0x77')]:[_0x1e2393[_0x80c1('0x2d')]['ids']];var _0x4d9cc9=_0x1e2393[_0x80c1('0x41')]['id'];return db['Team'][_0x80c1('0x42')]({'where':{'id':_0x4d9cc9}})[_0x80c1('0x3c')](handleEntityNotFound(_0x239644,null))[_0x80c1('0x3c')](function(_0x4a9b97){if(_0x4a9b97){var _0x308577=[_0x80c1('0x7c'),_0x80c1('0x78'),_0x80c1('0x79'),_0x80c1('0x8f'),_0x80c1('0x7a'),_0x80c1('0x90'),_0x80c1('0x7b')];return db[_0x80c1('0x50')][_0x80c1('0x51')](function(_0x274f47){var _0x1033f4=_[_0x80c1('0x27')](_0x308577,function(_0x401d18){var _0x571c31={'attributes':['id','name']};return _0x4a9b97[_0x80c1('0x45')+_0x401d18+_0x80c1('0x70')](_0x571c31)[_0x80c1('0x3c')](function(_0x368f27){var _0x8d9fb4=_['map'](_0x368f27,function(_0x1daa18){return _0x1daa18[_0x80c1('0x8d')](_0xfee74,{'transaction':_0x274f47})[_0x80c1('0x3c')](function(){var _0x28f4a0=_[_0x80c1('0x27')](_0xfee74,function(_0x20f23c){socket[_0x80c1('0x83')]('user'+_0x401d18+_0x80c1('0x91'),{'UserId':Number(_0x20f23c),[_0x401d18+_0x80c1('0x7e')]:_0x1daa18['id']});if(_0x401d18!==_0x80c1('0x7c')){return;}return db[_0x80c1('0x92')][_0x80c1('0x59')]({'where':{'VoiceQueueId':_0x1daa18['id'],'UserId':_0x20f23c},'transaction':_0x274f47});});return Promise['all'](_0x28f4a0);});});return Promise[_0x80c1('0x8b')](_0x8d9fb4);});});return Promise[_0x80c1('0x8b')](_0x1033f4)['then'](function(){return _0x4a9b97['removeAgents'](_0xfee74,{'transaction':_0x274f47});})[_0x80c1('0x3c')](function(){return db[_0x80c1('0x64')][_0x80c1('0x69')]({'where':{'teamId':_0x4d9cc9}})[_0x80c1('0x3c')](function(_0x1c29c3){if(_0x1c29c3){var _0x4e8d0a=_[_0x80c1('0x27')](_0xfee74,function(_0x19fe4b){db['UserVoicePrefix'][_0x80c1('0x59')]({'where':{'UserId':_0x19fe4b,'VoicePrefixId':_0x1c29c3[_0x80c1('0x66')]}});});return Promise[_0x80c1('0x8b')](_0x4e8d0a);}});});});}})[_0x80c1('0x3c')](respondWithStatusCode(_0x239644,null))[_0x80c1('0x40')](handleError(_0x239644,null));};exports[_0x80c1('0x93')]=function(_0x2a4e68,_0x10cf43,_0x534f81){var _0x23c4a5={};var _0x26af9c={};var _0x2fdfa7;var _0x913051;return db[_0x80c1('0x28')]['findOne']({'where':{'id':_0x2a4e68[_0x80c1('0x41')]['id']}})[_0x80c1('0x3c')](handleEntityNotFound(_0x10cf43,null))[_0x80c1('0x3c')](function(_0x2a37ec){if(_0x2a37ec){_0x2fdfa7=_0x2a37ec;_0x26af9c[_0x80c1('0x2c')]=_[_0x80c1('0x2e')](db[_0x80c1('0x80')][_0x80c1('0x29')]);_0x26af9c[_0x80c1('0x2d')]=_['keys'](_0x2a4e68['query']);_0x26af9c[_0x80c1('0x37')]=_[_0x80c1('0x2f')](_0x26af9c['model'],_0x26af9c['query']);_0x23c4a5[_0x80c1('0x30')]=_[_0x80c1('0x2f')](_0x26af9c[_0x80c1('0x2c')],qs['fields'](_0x2a4e68[_0x80c1('0x2d')][_0x80c1('0x31')]));_0x23c4a5[_0x80c1('0x30')]=_0x23c4a5[_0x80c1('0x30')]['length']?_0x23c4a5[_0x80c1('0x30')]:_0x26af9c[_0x80c1('0x2c')];_0x23c4a5[_0x80c1('0x34')]=qs[_0x80c1('0x35')](_0x2a4e68['query'][_0x80c1('0x35')]);_0x23c4a5[_0x80c1('0x36')]=qs['filters'](_[_0x80c1('0x6d')](_0x2a4e68['query'],_0x26af9c[_0x80c1('0x37')]));if(_0x2a4e68['query'][_0x80c1('0x94')]){_0x23c4a5[_0x80c1('0x36')]=_['merge'](_0x23c4a5[_0x80c1('0x36')],{'$or':_[_0x80c1('0x27')](_0x23c4a5['attributes'],function(_0x5ecf6e){var _0x413cfe={};_0x413cfe[_0x5ecf6e]={'$like':'%'+_0x2a4e68[_0x80c1('0x2d')][_0x80c1('0x94')]+'%'};return _0x413cfe;})});}_0x23c4a5=_[_0x80c1('0x3a')]({},_0x23c4a5,_0x2a4e68['options']);return _0x2fdfa7[_0x80c1('0x93')](_0x23c4a5);}})[_0x80c1('0x3c')](function(_0x4b0a1e){if(_0x4b0a1e){_0x913051=_0x4b0a1e[_0x80c1('0x32')];if(!_0x2a4e68[_0x80c1('0x2d')][_0x80c1('0x95')](_0x80c1('0x33'))){_0x23c4a5[_0x80c1('0x1f')]=qs[_0x80c1('0x1f')](_0x2a4e68[_0x80c1('0x2d')][_0x80c1('0x1f')]);_0x23c4a5['offset']=qs[_0x80c1('0x1c')](_0x2a4e68[_0x80c1('0x2d')][_0x80c1('0x1c')]);}return _0x2fdfa7[_0x80c1('0x93')](_0x23c4a5);}})[_0x80c1('0x3c')](function(_0x4ba06f){if(_0x4ba06f){return _0x4ba06f?{'count':_0x913051,'rows':_0x4ba06f}:null;}})[_0x80c1('0x3c')](respondWithResult(_0x10cf43,null))[_0x80c1('0x40')](handleError(_0x10cf43,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index a7a9291..ddc1751 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 _0x6a70=['../../mysqldb','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x44e709,_0x4c7a18){var _0x26ccd6=function(_0x40adcd){while(--_0x40adcd){_0x44e709['push'](_0x44e709['shift']());}};_0x26ccd6(++_0x4c7a18);}(_0x6a70,0xca));var _0x06a7=function(_0x23219e,_0x3d6a04){_0x23219e=_0x23219e-0x0;var _0x13f74a=_0x6a70[_0x23219e];return _0x13f74a;};'use strict';var EventEmitter=require(_0x06a7('0x0'));var Team=require(_0x06a7('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x06a7('0x2'),'afterDestroy':'remove'};function emitEvent(_0x3c29d5){return function(_0x47f3e4,_0x24616c,_0x1e6058){TeamEvents[_0x06a7('0x3')](_0x3c29d5+':'+_0x47f3e4['id'],_0x47f3e4);TeamEvents[_0x06a7('0x3')](_0x3c29d5,_0x47f3e4);_0x1e6058(null);};}for(var e in events){if(events[_0x06a7('0x4')](e)){var event=events[e];Team[_0x06a7('0x5')](e,emitEvent(event));}}module[_0x06a7('0x6')]=TeamEvents; \ No newline at end of file +var _0x8220=['events','../../mysqldb','Team','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x29d2d2,_0x3344){var _0x3f6476=function(_0x29c2a2){while(--_0x29c2a2){_0x29d2d2['push'](_0x29d2d2['shift']());}};_0x3f6476(++_0x3344);}(_0x8220,0x120));var _0x0822=function(_0xd4d4aa,_0x5db1f0){_0xd4d4aa=_0xd4d4aa-0x0;var _0x3f2237=_0x8220[_0xd4d4aa];return _0x3f2237;};'use strict';var EventEmitter=require(_0x0822('0x0'));var Team=require(_0x0822('0x1'))['db'][_0x0822('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0822('0x3'),'afterUpdate':'update','afterDestroy':_0x0822('0x4')};function emitEvent(_0x4fd015){return function(_0x1bf0d5,_0x445bc9,_0x27f2f8){TeamEvents[_0x0822('0x5')](_0x4fd015+':'+_0x1bf0d5['id'],_0x1bf0d5);TeamEvents[_0x0822('0x5')](_0x4fd015,_0x1bf0d5);_0x27f2f8(null);};}for(var e in events){if(events[_0x0822('0x6')](e)){var event=events[e];Team[_0x0822('0x7')](e,emitEvent(event));}}module[_0x0822('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 d360df1..9e85b31 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 _0xa429=['Sms','Voice','Whatsapp','resolve','all','lodash','then','map','setDataValue','channel','catch','exports','Team','teams','Openchannel'];(function(_0x478e6a,_0x5d511d){var _0x4195d0=function(_0x337deb){while(--_0x337deb){_0x478e6a['push'](_0x478e6a['shift']());}};_0x4195d0(++_0x5d511d);}(_0xa429,0x1b8));var _0x9a42=function(_0x2587c5,_0x4f717f){_0x2587c5=_0x2587c5-0x0;var _0x258dfd=_0xa429[_0x2587c5];return _0x258dfd;};'use strict';var _=require(_0x9a42('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x424ec8,_0x1430ba){var _0xd0fbd='get'+_0x1430ba+'Queues';return _0x424ec8[_0xd0fbd]()[_0x9a42('0x1')](function(_0x460e68){return _[_0x9a42('0x2')](_0x460e68,function(_0x7e3680){_0x7e3680[_0x9a42('0x3')](_0x9a42('0x4'),_0x1430ba);return _0x7e3680;});})[_0x9a42('0x5')](function(_0x3e208e){throw _0x3e208e;});}module[_0x9a42('0x6')]=function(_0x111308){return _0x111308['define'](_0x9a42('0x7'),attributes,{'tableName':_0x9a42('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x45c8db=this;var _0x14e39d=['Chat','Fax','Mail',_0x9a42('0x9'),_0x9a42('0xa'),_0x9a42('0xb'),_0x9a42('0xc')];return Promise[_0x9a42('0xd')]()[_0x9a42('0x1')](function(){var _0x3c5755=_[_0x9a42('0x2')](_0x14e39d,function(_0x48f966){return getQueuesByChannel(_0x45c8db,_0x48f966);});return Promise[_0x9a42('0xe')](_0x3c5755);})[_0x9a42('0x5')](function(_0x28f263){throw _0x28f263;});}}});}; \ No newline at end of file +var _0x5e6d=['then','channel','catch','exports','define','Team','Chat','Fax','Openchannel','Sms','Whatsapp','resolve','map','lodash','./team.attributes','get','Queues'];(function(_0x4c1928,_0x521def){var _0x31d660=function(_0x4d1ce3){while(--_0x4d1ce3){_0x4c1928['push'](_0x4c1928['shift']());}};_0x31d660(++_0x521def);}(_0x5e6d,0xc8));var _0xd5e6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5e6d[_0x5f0089];return _0x193892;};'use strict';var _=require(_0xd5e6('0x0'));var attributes=require(_0xd5e6('0x1'));function getQueuesByChannel(_0x59cf05,_0x4fd549){var _0x192c45=_0xd5e6('0x2')+_0x4fd549+_0xd5e6('0x3');return _0x59cf05[_0x192c45]()[_0xd5e6('0x4')](function(_0x44db65){return _['map'](_0x44db65,function(_0xf26b7b){_0xf26b7b['setDataValue'](_0xd5e6('0x5'),_0x4fd549);return _0xf26b7b;});})[_0xd5e6('0x6')](function(_0x60319f){throw _0x60319f;});}module[_0xd5e6('0x7')]=function(_0x4a0be2){return _0x4a0be2[_0xd5e6('0x8')](_0xd5e6('0x9'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x4d0eaa=this;var _0x15923c=[_0xd5e6('0xa'),_0xd5e6('0xb'),'Mail',_0xd5e6('0xc'),_0xd5e6('0xd'),'Voice',_0xd5e6('0xe')];return Promise[_0xd5e6('0xf')]()[_0xd5e6('0x4')](function(){var _0x5a7f4d=_[_0xd5e6('0x10')](_0x15923c,function(_0x151290){return getQueuesByChannel(_0x4d0eaa,_0x151290);});return Promise['all'](_0x5a7f4d);})[_0xd5e6('0x6')](function(_0x504020){throw _0x504020;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 9443086..9eeab45 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 _0x39ed=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x1bad1a,_0x1c8796){var _0x55ef3f=function(_0x45010e){while(--_0x45010e){_0x1bad1a['push'](_0x1bad1a['shift']());}};_0x55ef3f(++_0x1c8796);}(_0x39ed,0x153));var _0xd39e=function(_0x48e7bc,_0x36fced){_0x48e7bc=_0x48e7bc-0x0;var _0x4e3613=_0x39ed[_0x48e7bc];return _0x4e3613;};'use strict';var _=require('lodash');var util=require(_0xd39e('0x0'));var moment=require(_0xd39e('0x1'));var BPromise=require(_0xd39e('0x2'));var rs=require(_0xd39e('0x3'));var fs=require('fs');var Redis=require(_0xd39e('0x4'));var db=require(_0xd39e('0x5'))['db'];var utils=require(_0xd39e('0x6'));var logger=require(_0xd39e('0x7'))('rpc');var config=require(_0xd39e('0x8'));var jayson=require(_0xd39e('0x9'));var client=jayson[_0xd39e('0xa')][_0xd39e('0xb')]({'port':0x232a});config[_0xd39e('0xc')]=_[_0xd39e('0xd')](config[_0xd39e('0xc')],{'host':_0xd39e('0xe'),'port':0x18eb});var socket=require(_0xd39e('0xf'))(new Redis(config[_0xd39e('0xc')]));require('./team.socket')[_0xd39e('0x10')](socket);function respondWithRpcPromise(_0x4e23be,_0x5c0f0e,_0x2dabf8){return new BPromise(function(_0x122d5c,_0x1ccb10){return client[_0xd39e('0x11')](_0x4e23be,_0x2dabf8)[_0xd39e('0x12')](function(_0x30e5b5){logger[_0xd39e('0x13')](_0xd39e('0x14'),_0x5c0f0e,_0xd39e('0x15'));logger[_0xd39e('0x16')](_0xd39e('0x17'),_0x5c0f0e,'request\x20sent',JSON[_0xd39e('0x18')](_0x30e5b5));if(_0x30e5b5[_0xd39e('0x19')]){if(_0x30e5b5[_0xd39e('0x19')][_0xd39e('0x1a')]===0x1f4){logger[_0xd39e('0x19')](_0xd39e('0x14'),_0x5c0f0e,_0x30e5b5[_0xd39e('0x19')][_0xd39e('0x1b')]);return _0x1ccb10(_0x30e5b5['error']['message']);}logger[_0xd39e('0x19')](_0xd39e('0x14'),_0x5c0f0e,_0x30e5b5[_0xd39e('0x19')][_0xd39e('0x1b')]);return _0x122d5c(_0x30e5b5[_0xd39e('0x19')][_0xd39e('0x1b')]);}else{logger[_0xd39e('0x13')]('Team,\x20%s,\x20%s',_0x5c0f0e,_0xd39e('0x15'));_0x122d5c(_0x30e5b5[_0xd39e('0x1c')][_0xd39e('0x1b')]);}})['catch'](function(_0x41b734){logger[_0xd39e('0x19')](_0xd39e('0x14'),_0x5c0f0e,_0x41b734);_0x1ccb10(_0x41b734);});});} \ No newline at end of file +var _0xf3b2=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./team.socket','register','request','then','Team,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info'];(function(_0x2aeff4,_0x3686a8){var _0x25d78=function(_0x15a242){while(--_0x15a242){_0x2aeff4['push'](_0x2aeff4['shift']());}};_0x25d78(++_0x3686a8);}(_0xf3b2,0x1d2));var _0x2f3b=function(_0x56e063,_0x453233){_0x56e063=_0x56e063-0x0;var _0x766fcf=_0xf3b2[_0x56e063];return _0x766fcf;};'use strict';var _=require('lodash');var util=require(_0x2f3b('0x0'));var moment=require(_0x2f3b('0x1'));var BPromise=require(_0x2f3b('0x2'));var rs=require(_0x2f3b('0x3'));var fs=require('fs');var Redis=require(_0x2f3b('0x4'));var db=require(_0x2f3b('0x5'))['db'];var utils=require(_0x2f3b('0x6'));var logger=require(_0x2f3b('0x7'))(_0x2f3b('0x8'));var config=require(_0x2f3b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2f3b('0xa')][_0x2f3b('0xb')]({'port':0x232a});config['redis']=_[_0x2f3b('0xc')](config[_0x2f3b('0xd')],{'host':_0x2f3b('0xe'),'port':0x18eb});var socket=require(_0x2f3b('0xf'))(new Redis(config[_0x2f3b('0xd')]));require(_0x2f3b('0x10'))[_0x2f3b('0x11')](socket);function respondWithRpcPromise(_0x19bc86,_0x414286,_0xab09b){return new BPromise(function(_0x39dfca,_0x34ce83){return client[_0x2f3b('0x12')](_0x19bc86,_0xab09b)[_0x2f3b('0x13')](function(_0x367982){logger['info'](_0x2f3b('0x14'),_0x414286,_0x2f3b('0x15'));logger[_0x2f3b('0x16')]('Team,\x20%s,\x20%s,\x20%s',_0x414286,_0x2f3b('0x15'),JSON['stringify'](_0x367982));if(_0x367982['error']){if(_0x367982[_0x2f3b('0x17')][_0x2f3b('0x18')]===0x1f4){logger['error'](_0x2f3b('0x14'),_0x414286,_0x367982[_0x2f3b('0x17')][_0x2f3b('0x19')]);return _0x34ce83(_0x367982[_0x2f3b('0x17')][_0x2f3b('0x19')]);}logger['error'](_0x2f3b('0x14'),_0x414286,_0x367982[_0x2f3b('0x17')][_0x2f3b('0x19')]);return _0x39dfca(_0x367982[_0x2f3b('0x17')][_0x2f3b('0x19')]);}else{logger[_0x2f3b('0x1a')]('Team,\x20%s,\x20%s',_0x414286,'request\x20sent');_0x39dfca(_0x367982[_0x2f3b('0x1b')][_0x2f3b('0x19')]);}})[_0x2f3b('0x1c')](function(_0x5ee823){logger[_0x2f3b('0x17')](_0x2f3b('0x14'),_0x414286,_0x5ee823);_0x34ce83(_0x5ee823);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index df8f736..2422284 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 _0xd866=['save','emit','removeListener','length','team:','./team.events'];(function(_0x201861,_0x3c387c){var _0x5971f1=function(_0x1e0a2e){while(--_0x1e0a2e){_0x201861['push'](_0x201861['shift']());}};_0x5971f1(++_0x3c387c);}(_0xd866,0xbf));var _0x6d86=function(_0x10cde6,_0x5c823a){_0x10cde6=_0x10cde6-0x0;var _0x1fd24e=_0xd866[_0x10cde6];return _0x1fd24e;};'use strict';var TeamEvents=require(_0x6d86('0x0'));var events=[_0x6d86('0x1'),'remove','update'];function createListener(_0x2519c9,_0x3704cd){return function(_0x41ba97){_0x3704cd[_0x6d86('0x2')](_0x2519c9,_0x41ba97);};}function removeListener(_0x3681c8,_0x2b8be5){return function(){TeamEvents[_0x6d86('0x3')](_0x3681c8,_0x2b8be5);};}exports['register']=function(_0x51a5ee){for(var _0x38d573=0x0,_0x1598f6=events[_0x6d86('0x4')];_0x38d573<_0x1598f6;_0x38d573++){var _0x16db07=events[_0x38d573];var _0xb5b872=createListener(_0x6d86('0x5')+_0x16db07,_0x51a5ee);TeamEvents['on'](_0x16db07,_0xb5b872);}}; \ No newline at end of file +var _0x282b=['emit','removeListener','register','team:','./team.events','save','remove','update'];(function(_0x1acc2d,_0x597696){var _0xabfa6d=function(_0x41e83c){while(--_0x41e83c){_0x1acc2d['push'](_0x1acc2d['shift']());}};_0xabfa6d(++_0x597696);}(_0x282b,0xec));var _0xb282=function(_0x46c60f,_0x56f5f0){_0x46c60f=_0x46c60f-0x0;var _0x35d447=_0x282b[_0x46c60f];return _0x35d447;};'use strict';var TeamEvents=require(_0xb282('0x0'));var events=[_0xb282('0x1'),_0xb282('0x2'),_0xb282('0x3')];function createListener(_0x527989,_0x55ae9d){return function(_0x5d78d5){_0x55ae9d[_0xb282('0x4')](_0x527989,_0x5d78d5);};}function removeListener(_0x5cadd7,_0x3fbbaf){return function(){TeamEvents[_0xb282('0x5')](_0x5cadd7,_0x3fbbaf);};}exports[_0xb282('0x6')]=function(_0x1dd19b){for(var _0x3cad41=0x0,_0x33635f=events['length'];_0x3cad41<_0x33635f;_0x3cad41++){var _0x4a0d28=events[_0x3cad41];var _0x17fba1=createListener(_0xb282('0x7')+_0x4a0d28,_0x1dd19b);TeamEvents['on'](_0x4a0d28,_0x17fba1);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index ed5b1f5..22acf5f 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 _0x2504=['INTEGER','sequelize','exports'];(function(_0x13c74c,_0x164d6c){var _0x15a397=function(_0xb63aab){while(--_0xb63aab){_0x13c74c['push'](_0x13c74c['shift']());}};_0x15a397(++_0x164d6c);}(_0x2504,0xee));var _0x4250=function(_0x5ba8ca,_0x2da360){_0x5ba8ca=_0x5ba8ca-0x0;var _0x301286=_0x2504[_0x5ba8ca];return _0x301286;};'use strict';var Sequelize=require(_0x4250('0x0'));module[_0x4250('0x1')]={'TeamId':{'type':Sequelize[_0x4250('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x4250('0x2')]}}; \ No newline at end of file +var _0x8db0=['exports','INTEGER','sequelize'];(function(_0x40762c,_0x5ec18f){var _0x39fcd2=function(_0x8d40cc){while(--_0x8d40cc){_0x40762c['push'](_0x40762c['shift']());}};_0x39fcd2(++_0x5ec18f);}(_0x8db0,0x65));var _0x08db=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x8db0[_0x42bc91];return _0x3f5507;};'use strict';var Sequelize=require(_0x08db('0x0'));module[_0x08db('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x08db('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 67fa4ab..624cf38 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 _0x8a9a=['./teamVoicePrefix.attributes','exports','define','../../config/logger','api','moment','request-promise','path'];(function(_0x308036,_0x1c58ce){var _0x4c6a79=function(_0x820621){while(--_0x820621){_0x308036['push'](_0x308036['shift']());}};_0x4c6a79(++_0x1c58ce);}(_0x8a9a,0x193));var _0xa8a9=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x8a9a[_0x5f09c5];return _0x426ad9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa8a9('0x0'))(_0xa8a9('0x1'));var moment=require(_0xa8a9('0x2'));var BPromise=require('bluebird');var rp=require(_0xa8a9('0x3'));var fs=require('fs');var path=require(_0xa8a9('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa8a9('0x5'));module[_0xa8a9('0x6')]=function(_0x16b086,_0x39d1db){return _0x16b086[_0xa8a9('0x7')]('TeamVoicePrefix',attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x74f4=['../../config/environment','./teamVoicePrefix.attributes','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','api','moment','request-promise','rimraf'];(function(_0x117f4c,_0x36a9b1){var _0x2b24e9=function(_0x31761b){while(--_0x31761b){_0x117f4c['push'](_0x117f4c['shift']());}};_0x2b24e9(++_0x36a9b1);}(_0x74f4,0xaa));var _0x474f=function(_0x418fa3,_0x464468){_0x418fa3=_0x418fa3-0x0;var _0x845083=_0x74f4[_0x418fa3];return _0x845083;};'use strict';var _=require(_0x474f('0x0'));var util=require(_0x474f('0x1'));var logger=require('../../config/logger')(_0x474f('0x2'));var moment=require(_0x474f('0x3'));var BPromise=require('bluebird');var rp=require(_0x474f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x474f('0x5'));var config=require(_0x474f('0x6'));var attributes=require(_0x474f('0x7'));module['exports']=function(_0x5b6d20,_0x119d22){return _0x5b6d20[_0x474f('0x8')](_0x474f('0x9'),attributes,{'tableName':_0x474f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 08935e2..63db237 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x17ca87,_0x537b70){var _0xf236c5=function(_0x160e17){while(--_0x160e17){_0x17ca87['push'](_0x17ca87['shift']());}};_0xf236c5(++_0x537b70);}(_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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x51e153,_0x9b2da6){var _0x31c711=function(_0x42cc48){while(--_0x42cc48){_0x51e153['push'](_0x51e153['shift']());}};_0x31c711(++_0x9b2da6);}(_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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 123c117..033e978 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 _0x140b=['INTEGER'];(function(_0x2525f1,_0x47034f){var _0x13c1b5=function(_0x2beb2e){while(--_0x2beb2e){_0x2525f1['push'](_0x2525f1['shift']());}};_0x13c1b5(++_0x47034f);}(_0x140b,0x6f));var _0xb140=function(_0x191a30,_0x20b2e7){_0x191a30=_0x191a30-0x0;var _0x2a9ecb=_0x140b[_0x191a30];return _0x2a9ecb;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xb140('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x48db=['INTEGER','sequelize','exports'];(function(_0x379e2c,_0x26bcc3){var _0x3ded97=function(_0x38180c){while(--_0x38180c){_0x379e2c['push'](_0x379e2c['shift']());}};_0x3ded97(++_0x26bcc3);}(_0x48db,0x16c));var _0xb48d=function(_0x38ac8d,_0x49ef60){_0x38ac8d=_0x38ac8d-0x0;var _0x28169d=_0x48db[_0x38ac8d];return _0x28169d;};'use strict';var Sequelize=require(_0xb48d('0x0'));module[_0xb48d('0x1')]={'penalty':{'type':Sequelize[_0xb48d('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 01ea288..62a9b14 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 _0xa9e5=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xa9e5,0x8a));var _0x5a9e=function(_0xb165dc,_0x136c7c){_0xb165dc=_0xb165dc-0x0;var _0x74342a=_0xa9e5[_0xb165dc];return _0x74342a;};'use strict';var _=require(_0x5a9e('0x0'));var util=require(_0x5a9e('0x1'));var logger=require('../../config/logger')(_0x5a9e('0x2'));var moment=require(_0x5a9e('0x3'));var BPromise=require(_0x5a9e('0x4'));var rp=require(_0x5a9e('0x5'));var fs=require('fs');var path=require(_0x5a9e('0x6'));var rimraf=require(_0x5a9e('0x7'));var config=require(_0x5a9e('0x8'));var attributes=require(_0x5a9e('0x9'));module[_0x5a9e('0xa')]=function(_0x34a9ed,_0x1fb122){return _0x34a9ed[_0x5a9e('0xb')](_0x5a9e('0xc'),attributes,{'tableName':_0x5a9e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x33a4=['util','api','moment','bluebird','../../config/environment','./teamVoiceQueue.attributes','exports','TeamVoiceQueue'];(function(_0x13b76d,_0x352902){var _0x3f6ecf=function(_0x55cbfa){while(--_0x55cbfa){_0x13b76d['push'](_0x13b76d['shift']());}};_0x3f6ecf(++_0x352902);}(_0x33a4,0x88));var _0x433a=function(_0x198ff1,_0x543034){_0x198ff1=_0x198ff1-0x0;var _0x43747a=_0x33a4[_0x198ff1];return _0x43747a;};'use strict';var _=require('lodash');var util=require(_0x433a('0x0'));var logger=require('../../config/logger')(_0x433a('0x1'));var moment=require(_0x433a('0x2'));var BPromise=require(_0x433a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x433a('0x4'));var attributes=require(_0x433a('0x5'));module[_0x433a('0x6')]=function(_0x60b6b3,_0x1b6f5a){return _0x60b6b3['define'](_0x433a('0x7'),attributes,{'tableName':'team_has_voice_queues','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 1169da4..f72ca91 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 _0x132b=['../../config/logger','../../config/environment','jayson/promise','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x491d35,_0x43f6e5){var _0x5a2de7=function(_0x119155){while(--_0x119155){_0x491d35['push'](_0x491d35['shift']());}};_0x5a2de7(++_0x43f6e5);}(_0x132b,0x8d));var _0xb132=function(_0x439e7d,_0x43d4e9){_0x439e7d=_0x439e7d-0x0;var _0x2513c3=_0x132b[_0x439e7d];return _0x2513c3;};'use strict';var _=require(_0xb132('0x0'));var util=require(_0xb132('0x1'));var moment=require('moment');var BPromise=require(_0xb132('0x2'));var rs=require(_0xb132('0x3'));var fs=require('fs');var Redis=require(_0xb132('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb132('0x5'));var logger=require(_0xb132('0x6'))('rpc');var config=require(_0xb132('0x7'));var jayson=require(_0xb132('0x8'));var client=jayson['client'][_0xb132('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fef52,_0x22f0b9,_0x560e8c){return new BPromise(function(_0x425a2c,_0x1125b){return client[_0xb132('0xa')](_0x3fef52,_0x560e8c)['then'](function(_0xfca39e){logger[_0xb132('0xb')](_0xb132('0xc'),_0x22f0b9,_0xb132('0xd'));logger[_0xb132('0xe')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x22f0b9,_0xb132('0xd'),JSON[_0xb132('0xf')](_0xfca39e));if(_0xfca39e[_0xb132('0x10')]){if(_0xfca39e[_0xb132('0x10')][_0xb132('0x11')]===0x1f4){logger[_0xb132('0x10')](_0xb132('0xc'),_0x22f0b9,_0xfca39e[_0xb132('0x10')][_0xb132('0x12')]);return _0x1125b(_0xfca39e[_0xb132('0x10')][_0xb132('0x12')]);}logger['error'](_0xb132('0xc'),_0x22f0b9,_0xfca39e[_0xb132('0x10')]['message']);return _0x425a2c(_0xfca39e[_0xb132('0x10')][_0xb132('0x12')]);}else{logger[_0xb132('0xb')](_0xb132('0xc'),_0x22f0b9,_0xb132('0xd'));_0x425a2c(_0xfca39e[_0xb132('0x13')]['message']);}})[_0xb132('0x14')](function(_0x1f0eab){logger[_0xb132('0x10')](_0xb132('0xc'),_0x22f0b9,_0x1f0eab);_0x1125b(_0x1f0eab);});});} \ No newline at end of file +var _0xb1fc=['../../config/environment','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x3d78d7,_0x44acea){var _0x4b6784=function(_0x284157){while(--_0x284157){_0x3d78d7['push'](_0x3d78d7['shift']());}};_0x4b6784(++_0x44acea);}(_0xb1fc,0x78));var _0xcb1f=function(_0x5b2bbd,_0x9d5a11){_0x5b2bbd=_0x5b2bbd-0x0;var _0x2b2c67=_0xb1fc[_0x5b2bbd];return _0x2b2c67;};'use strict';var _=require(_0xcb1f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcb1f('0x1'));var fs=require('fs');var Redis=require(_0xcb1f('0x2'));var db=require(_0xcb1f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb1f('0x4'))(_0xcb1f('0x5'));var config=require(_0xcb1f('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcb1f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2c386c,_0x544bce,_0x2e489d){return new BPromise(function(_0x58a748,_0x225cb7){return client[_0xcb1f('0x8')](_0x2c386c,_0x2e489d)['then'](function(_0x3cc88a){logger[_0xcb1f('0x9')](_0xcb1f('0xa'),_0x544bce,'request\x20sent');logger['debug'](_0xcb1f('0xb'),_0x544bce,'request\x20sent',JSON[_0xcb1f('0xc')](_0x3cc88a));if(_0x3cc88a[_0xcb1f('0xd')]){if(_0x3cc88a[_0xcb1f('0xd')]['code']===0x1f4){logger[_0xcb1f('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x544bce,_0x3cc88a[_0xcb1f('0xd')][_0xcb1f('0xe')]);return _0x225cb7(_0x3cc88a['error'][_0xcb1f('0xe')]);}logger[_0xcb1f('0xd')](_0xcb1f('0xa'),_0x544bce,_0x3cc88a[_0xcb1f('0xd')][_0xcb1f('0xe')]);return _0x58a748(_0x3cc88a[_0xcb1f('0xd')][_0xcb1f('0xe')]);}else{logger[_0xcb1f('0x9')](_0xcb1f('0xa'),_0x544bce,_0xcb1f('0xf'));_0x58a748(_0x3cc88a[_0xcb1f('0x10')]['message']);}})[_0xcb1f('0x11')](function(_0x16dfdd){logger[_0xcb1f('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x544bce,_0x16dfdd);_0x225cb7(_0x16dfdd);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index d567e7c..2dde573 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 _0x8710=['Router','../../components/auth/service','../../components/interaction/service','./template.controller','isAuthenticated','index','get','/:id','show','create','put','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x8710,0x68));var _0x0871=function(_0x2076d5,_0x5ef2e2){_0x2076d5=_0x2076d5-0x0;var _0x1dde7f=_0x8710[_0x2076d5];return _0x1dde7f;};'use strict';var multer=require(_0x0871('0x0'));var util=require(_0x0871('0x1'));var path=require('path');var timeout=require(_0x0871('0x2'));var express=require(_0x0871('0x3'));var router=express[_0x0871('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0871('0x5'));var interaction=require(_0x0871('0x6'));var config=require('../../config/environment');var controller=require(_0x0871('0x7'));router['get']('/',auth[_0x0871('0x8')](),controller[_0x0871('0x9')]);router[_0x0871('0xa')](_0x0871('0xb'),auth[_0x0871('0x8')](),controller[_0x0871('0xc')]);router['post']('/',auth[_0x0871('0x8')](),controller[_0x0871('0xd')]);router[_0x0871('0xe')](_0x0871('0xb'),auth[_0x0871('0x8')](),controller['update']);router[_0x0871('0xf')](_0x0871('0xb'),auth[_0x0871('0x8')](),controller[_0x0871('0x10')]);module[_0x0871('0x11')]=router; \ No newline at end of file +var _0x7cdc=['util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','put','update','destroy','exports'];(function(_0x5f519b,_0x5b606f){var _0x2461e2=function(_0x510241){while(--_0x510241){_0x5f519b['push'](_0x5f519b['shift']());}};_0x2461e2(++_0x5b606f);}(_0x7cdc,0x190));var _0xc7cd=function(_0x3b704d,_0x1ce7f9){_0x3b704d=_0x3b704d-0x0;var _0x4a02ac=_0x7cdc[_0x3b704d];return _0x4a02ac;};'use strict';var multer=require('multer');var util=require(_0xc7cd('0x0'));var path=require(_0xc7cd('0x1'));var timeout=require('connect-timeout');var express=require(_0xc7cd('0x2'));var router=express[_0xc7cd('0x3')]();var fs_extra=require(_0xc7cd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc7cd('0x5'));var config=require(_0xc7cd('0x6'));var controller=require('./template.controller');router[_0xc7cd('0x7')]('/',auth[_0xc7cd('0x8')](),controller[_0xc7cd('0x9')]);router[_0xc7cd('0x7')](_0xc7cd('0xa'),auth[_0xc7cd('0x8')](),controller[_0xc7cd('0xb')]);router['post']('/',auth[_0xc7cd('0x8')](),controller['create']);router[_0xc7cd('0xc')](_0xc7cd('0xa'),auth[_0xc7cd('0x8')](),controller[_0xc7cd('0xd')]);router['delete'](_0xc7cd('0xa'),auth[_0xc7cd('0x8')](),controller[_0xc7cd('0xe')]);module[_0xc7cd('0xf')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index a1b17f9..29081cb 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 _0x166e=['exports','STRING','TEXT','sequelize'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x166e,0x107));var _0xe166=function(_0x472518,_0x5c68ac){_0x472518=_0x472518-0x0;var _0x47b0c4=_0x166e[_0x472518];return _0x47b0c4;};'use strict';var Sequelize=require(_0xe166('0x0'));module[_0xe166('0x1')]={'name':{'type':Sequelize[_0xe166('0x2')]},'description':{'type':Sequelize[_0xe166('0x2')]},'html':{'type':Sequelize[_0xe166('0x3')]}}; \ No newline at end of file +var _0xf63e=['STRING','TEXT'];(function(_0x1330eb,_0x476ed1){var _0x15ebc2=function(_0x40b54f){while(--_0x40b54f){_0x1330eb['push'](_0x1330eb['shift']());}};_0x15ebc2(++_0x476ed1);}(_0xf63e,0x78));var _0xef63=function(_0x25b01d,_0x3b7cea){_0x25b01d=_0x25b01d-0x0;var _0x10e87a=_0xf63e[_0x25b01d];return _0x10e87a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xef63('0x0')]},'description':{'type':Sequelize[_0xef63('0x0')]},'html':{'type':Sequelize[_0xef63('0x1')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 8e123cb..b12dbe3 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 _0xa53e=['ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','reject','save','update','destroy','get','Templates','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','VIRTUAL','filter','merge','Template','includeAll','include','rows','show','catch','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa53e,0x127));var _0xea53=function(_0x361c5c,_0x46d1b0){_0x361c5c=_0x361c5c-0x0;var _0x38d826=_0xa53e[_0x361c5c];return _0x38d826;};'use strict';var emlformat=require(_0xea53('0x0'));var rimraf=require(_0xea53('0x1'));var zipdir=require(_0xea53('0x2'));var jsonpatch=require(_0xea53('0x3'));var rp=require(_0xea53('0x4'));var moment=require(_0xea53('0x5'));var BPromise=require(_0xea53('0x6'));var Mustache=require(_0xea53('0x7'));var util=require('util');var path=require(_0xea53('0x8'));var sox=require(_0xea53('0x9'));var csv=require(_0xea53('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea53('0xb'));var _=require(_0xea53('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xea53('0xd'));var deskjs=require(_0xea53('0xe'));var toCsv=require('to-csv');var querystring=require(_0xea53('0xf'));var Papa=require(_0xea53('0x10'));var Redis=require(_0xea53('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xea53('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xea53('0x13'));var logger=require(_0xea53('0x14'))(_0xea53('0x15'));var utils=require('../../config/utils');var config=require(_0xea53('0x16'));var licenseUtil=require(_0xea53('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e9b95,_0x6508c7){_0x6508c7=_0x6508c7||0xcc;return function(_0xf4fd6c){if(_0xf4fd6c){return _0x1e9b95['sendStatus'](_0x6508c7);}return _0x1e9b95[_0xea53('0x18')](_0x6508c7)['end']();};}function respondWithResult(_0x6a3067,_0x5d1e5b){_0x5d1e5b=_0x5d1e5b||0xc8;return function(_0x576fae){if(_0x576fae){return _0x6a3067['status'](_0x5d1e5b)[_0xea53('0x19')](_0x576fae);}};}function respondWithFilteredResult(_0x38b2c6,_0x5417dd){return function(_0x5c9344){if(_0x5c9344){var _0x22c94b=typeof _0x5417dd[_0xea53('0x1a')]===_0xea53('0x1b')&&typeof _0x5417dd[_0xea53('0x1c')]===_0xea53('0x1b');var _0x156e8f=_0x5c9344[_0xea53('0x1d')];var _0x562238=_0x22c94b?0x0:_0x5417dd[_0xea53('0x1a')];var _0x5b560b=_0x22c94b?_0x5c9344[_0xea53('0x1d')]:_0x5417dd[_0xea53('0x1a')]+_0x5417dd[_0xea53('0x1c')];var _0x5855ca;if(_0x5b560b>=_0x156e8f){_0x5b560b=_0x156e8f;_0x5855ca=0xc8;}else{_0x5855ca=0xce;}_0x38b2c6[_0xea53('0x18')](_0x5855ca);return _0x38b2c6[_0xea53('0x1e')]('Content-Range',_0x562238+'-'+_0x5b560b+'/'+_0x156e8f)[_0xea53('0x19')](_0x5c9344);}return null;};}function patchUpdates(_0x468bf8){return function(_0x5a782b){try{jsonpatch['apply'](_0x5a782b,_0x468bf8,!![]);}catch(_0x39b121){return BPromise[_0xea53('0x1f')](_0x39b121);}return _0x5a782b[_0xea53('0x20')]();};}function saveUpdates(_0x5570ee,_0x57683f){return function(_0x42cd45){if(_0x42cd45){return _0x42cd45[_0xea53('0x21')](_0x5570ee)['then'](function(_0x3cb51a){return _0x3cb51a;});}return null;};}function removeEntity(_0x42bbe3,_0x1a9d34){return function(_0x524492){if(_0x524492){return _0x524492[_0xea53('0x22')]()['then'](function(){var _0x228a79=_0x524492[_0xea53('0x23')]({'plain':!![]});var _0x1aa7aa=_0xea53('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x1aa7aa,'resourceId':_0x228a79['id']}})[_0xea53('0x25')](function(){return _0x524492;});})[_0xea53('0x25')](function(){_0x42bbe3[_0xea53('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x352b43,_0x146eb0){return function(_0x20b902){if(!_0x20b902){_0x352b43['sendStatus'](0x194);}return _0x20b902;};}function handleError(_0x204281,_0x13a937){_0x13a937=_0x13a937||0x1f4;return function(_0x2b0c79){logger[_0xea53('0x26')](_0x2b0c79[_0xea53('0x27')]);if(_0x2b0c79[_0xea53('0x28')]){delete _0x2b0c79['name'];}_0x204281['status'](_0x13a937)[_0xea53('0x29')](_0x2b0c79);};}exports[_0xea53('0x2a')]=function(_0x5bd14e,_0x2dce85){var _0x26ab2a={},_0x254498={},_0x45cb96={'count':0x0,'rows':[]};var _0x563b0e=_[_0xea53('0x2b')](db['Template'][_0xea53('0x2c')],function(_0x284e16){return{'name':_0x284e16[_0xea53('0x2d')],'type':_0x284e16[_0xea53('0x2e')]['key']};});_0x254498[_0xea53('0x2f')]=_[_0xea53('0x2b')](_0x563b0e,'name');_0x254498[_0xea53('0x30')]=_[_0xea53('0x31')](_0x5bd14e[_0xea53('0x30')]);_0x254498[_0xea53('0x32')]=_[_0xea53('0x33')](_0x254498[_0xea53('0x2f')],_0x254498[_0xea53('0x30')]);_0x26ab2a['attributes']=_[_0xea53('0x33')](_0x254498[_0xea53('0x2f')],qs[_0xea53('0x34')](_0x5bd14e[_0xea53('0x30')][_0xea53('0x34')]));_0x26ab2a[_0xea53('0x35')]=_0x26ab2a[_0xea53('0x35')][_0xea53('0x36')]?_0x26ab2a['attributes']:_0x254498[_0xea53('0x2f')];if(!_0x5bd14e[_0xea53('0x30')][_0xea53('0x37')]('nolimit')){_0x26ab2a[_0xea53('0x1c')]=qs['limit'](_0x5bd14e[_0xea53('0x30')][_0xea53('0x1c')]);_0x26ab2a[_0xea53('0x1a')]=qs[_0xea53('0x1a')](_0x5bd14e[_0xea53('0x30')][_0xea53('0x1a')]);}_0x26ab2a['order']=qs[_0xea53('0x38')](_0x5bd14e[_0xea53('0x30')]['sort']);_0x26ab2a[_0xea53('0x39')]=qs[_0xea53('0x32')](_['pick'](_0x5bd14e['query'],_0x254498['filters']),_0x563b0e);if(_0x5bd14e[_0xea53('0x30')]['filter']){_0x26ab2a[_0xea53('0x39')]=_['merge'](_0x26ab2a[_0xea53('0x39')],{'$or':_[_0xea53('0x2b')](_0x563b0e,function(_0x3a0ba1){if(_0x3a0ba1[_0xea53('0x2e')]!==_0xea53('0x3a')){var _0xed60a8={};_0xed60a8[_0x3a0ba1['name']]={'$like':'%'+_0x5bd14e[_0xea53('0x30')][_0xea53('0x3b')]+'%'};return _0xed60a8;}})});}_0x26ab2a=_[_0xea53('0x3c')]({},_0x26ab2a,_0x5bd14e['options']);var _0x1bf4dd={'where':_0x26ab2a[_0xea53('0x39')]};return db[_0xea53('0x3d')][_0xea53('0x1d')](_0x1bf4dd)[_0xea53('0x25')](function(_0x5cadc1){_0x45cb96[_0xea53('0x1d')]=_0x5cadc1;if(_0x5bd14e['query'][_0xea53('0x3e')]){_0x26ab2a[_0xea53('0x3f')]=[{'all':!![]}];}return db[_0xea53('0x3d')]['findAll'](_0x26ab2a);})[_0xea53('0x25')](function(_0x46ed3a){_0x45cb96[_0xea53('0x40')]=_0x46ed3a;return _0x45cb96;})['then'](respondWithFilteredResult(_0x2dce85,_0x26ab2a))['catch'](handleError(_0x2dce85,null));};exports[_0xea53('0x41')]=function(_0x2ea4cc,_0x129ed2){var _0x2d565d={'raw':!![],'where':{'id':_0x2ea4cc['params']['id']}},_0x243eec={};_0x243eec[_0xea53('0x2f')]=_['keys'](db[_0xea53('0x3d')]['rawAttributes']);_0x243eec['query']=_[_0xea53('0x31')](_0x2ea4cc[_0xea53('0x30')]);_0x243eec[_0xea53('0x32')]=_[_0xea53('0x33')](_0x243eec[_0xea53('0x2f')],_0x243eec['query']);_0x2d565d[_0xea53('0x35')]=_[_0xea53('0x33')](_0x243eec[_0xea53('0x2f')],qs[_0xea53('0x34')](_0x2ea4cc['query']['fields']));_0x2d565d[_0xea53('0x35')]=_0x2d565d[_0xea53('0x35')][_0xea53('0x36')]?_0x2d565d[_0xea53('0x35')]:_0x243eec[_0xea53('0x2f')];if(_0x2ea4cc[_0xea53('0x30')][_0xea53('0x3e')]){_0x2d565d[_0xea53('0x3f')]=[{'all':!![]}];}_0x2d565d=_[_0xea53('0x3c')]({},_0x2d565d,_0x2ea4cc['options']);return db[_0xea53('0x3d')]['find'](_0x2d565d)[_0xea53('0x25')](handleEntityNotFound(_0x129ed2,null))[_0xea53('0x25')](respondWithResult(_0x129ed2,null))[_0xea53('0x42')](handleError(_0x129ed2,null));};exports['create']=function(_0x16766f,_0x2455d5){return db[_0xea53('0x3d')]['create'](_0x16766f['body'],{})['then'](function(_0x4882b0){var _0x3fbf0e=_0x16766f[_0xea53('0x43')][_0xea53('0x23')]({'plain':!![]});if(!_0x3fbf0e)throw new Error(_0xea53('0x44'));if(_0x3fbf0e[_0xea53('0x45')]===_0xea53('0x43')){var _0xdea0a9=_0x4882b0[_0xea53('0x23')]({'plain':!![]});var _0xda5299=_0xea53('0x24');return db[_0xea53('0x46')]['find']({'where':{'name':_0xda5299,'userProfileId':_0x3fbf0e[_0xea53('0x47')]},'raw':!![]})[_0xea53('0x25')](function(_0xc3446b){if(_0xc3446b&&_0xc3446b[_0xea53('0x48')]===0x0){return db[_0xea53('0x49')][_0xea53('0x4a')]({'name':_0xdea0a9[_0xea53('0x28')],'resourceId':_0xdea0a9['id'],'type':_0xc3446b['name'],'sectionId':_0xc3446b['id']},{})['then'](function(){return _0x4882b0;});}else{return _0x4882b0;}})['catch'](function(_0x45f3c9){logger[_0xea53('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45f3c9);throw _0x45f3c9;});}return _0x4882b0;})[_0xea53('0x25')](respondWithResult(_0x2455d5,0xc9))[_0xea53('0x42')](handleError(_0x2455d5,null));};exports[_0xea53('0x21')]=function(_0x500600,_0xa8e3e4){if(_0x500600[_0xea53('0x4b')]['id']){delete _0x500600['body']['id'];}return db[_0xea53('0x3d')][_0xea53('0x4c')]({'where':{'id':_0x500600[_0xea53('0x4d')]['id']}})[_0xea53('0x25')](handleEntityNotFound(_0xa8e3e4,null))[_0xea53('0x25')](saveUpdates(_0x500600[_0xea53('0x4b')],null))[_0xea53('0x25')](respondWithResult(_0xa8e3e4,null))[_0xea53('0x42')](handleError(_0xa8e3e4,null));};exports[_0xea53('0x22')]=function(_0x471af9,_0x10834e){return db[_0xea53('0x3d')][_0xea53('0x4c')]({'where':{'id':_0x471af9[_0xea53('0x4d')]['id']}})[_0xea53('0x25')](handleEntityNotFound(_0x10834e,null))['then'](removeEntity(_0x10834e,null))[_0xea53('0x42')](handleError(_0x10834e,null));}; \ No newline at end of file +var _0xe88f=['update','destroy','then','Templates','UserProfileResource','end','name','index','map','Template','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','type','include','findAll','rows','show','params','keys','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save'];(function(_0x261798,_0x199810){var _0x2604d8=function(_0x1ee9fa){while(--_0x1ee9fa){_0x261798['push'](_0x261798['shift']());}};_0x2604d8(++_0x199810);}(_0xe88f,0x17a));var _0xfe88=function(_0x329664,_0x130748){_0x329664=_0x329664-0x0;var _0x4e346e=_0xe88f[_0x329664];return _0x4e346e;};'use strict';var emlformat=require(_0xfe88('0x0'));var rimraf=require(_0xfe88('0x1'));var zipdir=require(_0xfe88('0x2'));var jsonpatch=require(_0xfe88('0x3'));var rp=require(_0xfe88('0x4'));var moment=require(_0xfe88('0x5'));var BPromise=require(_0xfe88('0x6'));var Mustache=require(_0xfe88('0x7'));var util=require(_0xfe88('0x8'));var path=require(_0xfe88('0x9'));var sox=require('sox');var csv=require(_0xfe88('0xa'));var ejs=require(_0xfe88('0xb'));var fs=require('fs');var fs_extra=require(_0xfe88('0xc'));var _=require(_0xfe88('0xd'));var squel=require(_0xfe88('0xe'));var crypto=require(_0xfe88('0xf'));var jsforce=require(_0xfe88('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xfe88('0xa'));var querystring=require('querystring');var Papa=require(_0xfe88('0x11'));var Redis=require(_0xfe88('0x12'));var authService=require(_0xfe88('0x13'));var qs=require(_0xfe88('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe88('0x15'));var logger=require('../../config/logger')(_0xfe88('0x16'));var utils=require(_0xfe88('0x17'));var config=require(_0xfe88('0x18'));var licenseUtil=require(_0xfe88('0x19'));var db=require(_0xfe88('0x1a'))['db'];function respondWithStatusCode(_0x5b44fa,_0x5d7f8d){_0x5d7f8d=_0x5d7f8d||0xcc;return function(_0x56ee7b){if(_0x56ee7b){return _0x5b44fa[_0xfe88('0x1b')](_0x5d7f8d);}return _0x5b44fa[_0xfe88('0x1c')](_0x5d7f8d)['end']();};}function respondWithResult(_0x43dfb7,_0x1f633b){_0x1f633b=_0x1f633b||0xc8;return function(_0x29b714){if(_0x29b714){return _0x43dfb7[_0xfe88('0x1c')](_0x1f633b)[_0xfe88('0x1d')](_0x29b714);}};}function respondWithFilteredResult(_0x4fc1aa,_0x229673){return function(_0x1335ce){if(_0x1335ce){var _0x16aced=typeof _0x229673[_0xfe88('0x1e')]==='undefined'&&typeof _0x229673['limit']===_0xfe88('0x1f');var _0x3044b5=_0x1335ce[_0xfe88('0x20')];var _0x2c8ad9=_0x16aced?0x0:_0x229673[_0xfe88('0x1e')];var _0x1ed30a=_0x16aced?_0x1335ce[_0xfe88('0x20')]:_0x229673[_0xfe88('0x1e')]+_0x229673['limit'];var _0x348f00;if(_0x1ed30a>=_0x3044b5){_0x1ed30a=_0x3044b5;_0x348f00=0xc8;}else{_0x348f00=0xce;}_0x4fc1aa[_0xfe88('0x1c')](_0x348f00);return _0x4fc1aa['set'](_0xfe88('0x21'),_0x2c8ad9+'-'+_0x1ed30a+'/'+_0x3044b5)[_0xfe88('0x1d')](_0x1335ce);}return null;};}function patchUpdates(_0x51e74d){return function(_0x354840){try{jsonpatch[_0xfe88('0x22')](_0x354840,_0x51e74d,!![]);}catch(_0x298df4){return BPromise[_0xfe88('0x23')](_0x298df4);}return _0x354840[_0xfe88('0x24')]();};}function saveUpdates(_0x3e0582,_0x100ade){return function(_0x596842){if(_0x596842){return _0x596842[_0xfe88('0x25')](_0x3e0582)['then'](function(_0x38dee0){return _0x38dee0;});}return null;};}function removeEntity(_0x453fac,_0x5e0499){return function(_0x6cdf2f){if(_0x6cdf2f){return _0x6cdf2f[_0xfe88('0x26')]()[_0xfe88('0x27')](function(){var _0x6875a0=_0x6cdf2f['get']({'plain':!![]});var _0x46c2af=_0xfe88('0x28');return db[_0xfe88('0x29')][_0xfe88('0x26')]({'where':{'type':_0x46c2af,'resourceId':_0x6875a0['id']}})['then'](function(){return _0x6cdf2f;});})[_0xfe88('0x27')](function(){_0x453fac[_0xfe88('0x1c')](0xcc)[_0xfe88('0x2a')]();});}};}function handleEntityNotFound(_0x2d2dd9,_0x3d38fa){return function(_0x1c96a8){if(!_0x1c96a8){_0x2d2dd9[_0xfe88('0x1b')](0x194);}return _0x1c96a8;};}function handleError(_0x4acce,_0x1bb61a){_0x1bb61a=_0x1bb61a||0x1f4;return function(_0x127004){logger['error'](_0x127004['stack']);if(_0x127004[_0xfe88('0x2b')]){delete _0x127004[_0xfe88('0x2b')];}_0x4acce['status'](_0x1bb61a)['send'](_0x127004);};}exports[_0xfe88('0x2c')]=function(_0x56fd8,_0x3d4d00){var _0x5b83bb={},_0x4ee8ee={},_0x18d685={'count':0x0,'rows':[]};var _0x21edac=_[_0xfe88('0x2d')](db[_0xfe88('0x2e')][_0xfe88('0x2f')],function(_0x19d52){return{'name':_0x19d52[_0xfe88('0x30')],'type':_0x19d52['type'][_0xfe88('0x31')]};});_0x4ee8ee['model']=_[_0xfe88('0x2d')](_0x21edac,_0xfe88('0x2b'));_0x4ee8ee[_0xfe88('0x32')]=_['keys'](_0x56fd8[_0xfe88('0x32')]);_0x4ee8ee[_0xfe88('0x33')]=_[_0xfe88('0x34')](_0x4ee8ee[_0xfe88('0x35')],_0x4ee8ee['query']);_0x5b83bb[_0xfe88('0x36')]=_[_0xfe88('0x34')](_0x4ee8ee[_0xfe88('0x35')],qs[_0xfe88('0x37')](_0x56fd8[_0xfe88('0x32')][_0xfe88('0x37')]));_0x5b83bb[_0xfe88('0x36')]=_0x5b83bb['attributes'][_0xfe88('0x38')]?_0x5b83bb[_0xfe88('0x36')]:_0x4ee8ee[_0xfe88('0x35')];if(!_0x56fd8[_0xfe88('0x32')][_0xfe88('0x39')]('nolimit')){_0x5b83bb['limit']=qs['limit'](_0x56fd8[_0xfe88('0x32')][_0xfe88('0x3a')]);_0x5b83bb['offset']=qs[_0xfe88('0x1e')](_0x56fd8[_0xfe88('0x32')][_0xfe88('0x1e')]);}_0x5b83bb[_0xfe88('0x3b')]=qs['sort'](_0x56fd8[_0xfe88('0x32')][_0xfe88('0x3c')]);_0x5b83bb[_0xfe88('0x3d')]=qs[_0xfe88('0x33')](_[_0xfe88('0x3e')](_0x56fd8[_0xfe88('0x32')],_0x4ee8ee['filters']),_0x21edac);if(_0x56fd8[_0xfe88('0x32')][_0xfe88('0x3f')]){_0x5b83bb[_0xfe88('0x3d')]=_[_0xfe88('0x40')](_0x5b83bb['where'],{'$or':_[_0xfe88('0x2d')](_0x21edac,function(_0x5c21c6){if(_0x5c21c6[_0xfe88('0x41')]!=='VIRTUAL'){var _0x5e745b={};_0x5e745b[_0x5c21c6[_0xfe88('0x2b')]]={'$like':'%'+_0x56fd8[_0xfe88('0x32')][_0xfe88('0x3f')]+'%'};return _0x5e745b;}})});}_0x5b83bb=_['merge']({},_0x5b83bb,_0x56fd8['options']);var _0x5452a9={'where':_0x5b83bb[_0xfe88('0x3d')]};return db['Template']['count'](_0x5452a9)[_0xfe88('0x27')](function(_0x5dacfa){_0x18d685['count']=_0x5dacfa;if(_0x56fd8[_0xfe88('0x32')]['includeAll']){_0x5b83bb[_0xfe88('0x42')]=[{'all':!![]}];}return db[_0xfe88('0x2e')][_0xfe88('0x43')](_0x5b83bb);})['then'](function(_0x49a68a){_0x18d685[_0xfe88('0x44')]=_0x49a68a;return _0x18d685;})[_0xfe88('0x27')](respondWithFilteredResult(_0x3d4d00,_0x5b83bb))['catch'](handleError(_0x3d4d00,null));};exports[_0xfe88('0x45')]=function(_0x4ce470,_0x528fe9){var _0x2a5614={'raw':!![],'where':{'id':_0x4ce470[_0xfe88('0x46')]['id']}},_0x13dfa5={};_0x13dfa5[_0xfe88('0x35')]=_['keys'](db['Template']['rawAttributes']);_0x13dfa5[_0xfe88('0x32')]=_[_0xfe88('0x47')](_0x4ce470[_0xfe88('0x32')]);_0x13dfa5['filters']=_['intersection'](_0x13dfa5[_0xfe88('0x35')],_0x13dfa5[_0xfe88('0x32')]);_0x2a5614[_0xfe88('0x36')]=_[_0xfe88('0x34')](_0x13dfa5[_0xfe88('0x35')],qs[_0xfe88('0x37')](_0x4ce470[_0xfe88('0x32')][_0xfe88('0x37')]));_0x2a5614[_0xfe88('0x36')]=_0x2a5614['attributes'][_0xfe88('0x38')]?_0x2a5614['attributes']:_0x13dfa5[_0xfe88('0x35')];if(_0x4ce470[_0xfe88('0x32')]['includeAll']){_0x2a5614[_0xfe88('0x42')]=[{'all':!![]}];}_0x2a5614=_[_0xfe88('0x40')]({},_0x2a5614,_0x4ce470[_0xfe88('0x48')]);return db[_0xfe88('0x2e')][_0xfe88('0x49')](_0x2a5614)[_0xfe88('0x27')](handleEntityNotFound(_0x528fe9,null))[_0xfe88('0x27')](respondWithResult(_0x528fe9,null))[_0xfe88('0x4a')](handleError(_0x528fe9,null));};exports[_0xfe88('0x4b')]=function(_0xb0565e,_0x20bc11){return db['Template'][_0xfe88('0x4b')](_0xb0565e[_0xfe88('0x4c')],{})[_0xfe88('0x27')](function(_0x2a32cd){var _0x800f34=_0xb0565e['user']['get']({'plain':!![]});if(!_0x800f34)throw new Error(_0xfe88('0x4d'));if(_0x800f34['role']==='user'){var _0x5a2beb=_0x2a32cd[_0xfe88('0x4e')]({'plain':!![]});var _0x3e179d=_0xfe88('0x28');return db['UserProfileSection'][_0xfe88('0x49')]({'where':{'name':_0x3e179d,'userProfileId':_0x800f34[_0xfe88('0x4f')]},'raw':!![]})[_0xfe88('0x27')](function(_0x1aabb3){if(_0x1aabb3&&_0x1aabb3[_0xfe88('0x50')]===0x0){return db['UserProfileResource'][_0xfe88('0x4b')]({'name':_0x5a2beb[_0xfe88('0x2b')],'resourceId':_0x5a2beb['id'],'type':_0x1aabb3[_0xfe88('0x2b')],'sectionId':_0x1aabb3['id']},{})[_0xfe88('0x27')](function(){return _0x2a32cd;});}else{return _0x2a32cd;}})['catch'](function(_0x5b833b){logger[_0xfe88('0x51')](_0xfe88('0x52'),_0x5b833b);throw _0x5b833b;});}return _0x2a32cd;})[_0xfe88('0x27')](respondWithResult(_0x20bc11,0xc9))[_0xfe88('0x4a')](handleError(_0x20bc11,null));};exports[_0xfe88('0x25')]=function(_0x36eadf,_0x4cae27){if(_0x36eadf['body']['id']){delete _0x36eadf[_0xfe88('0x4c')]['id'];}return db[_0xfe88('0x2e')]['find']({'where':{'id':_0x36eadf['params']['id']}})[_0xfe88('0x27')](handleEntityNotFound(_0x4cae27,null))[_0xfe88('0x27')](saveUpdates(_0x36eadf['body'],null))[_0xfe88('0x27')](respondWithResult(_0x4cae27,null))[_0xfe88('0x4a')](handleError(_0x4cae27,null));};exports['destroy']=function(_0x4b17cd,_0x470cf1){return db[_0xfe88('0x2e')][_0xfe88('0x49')]({'where':{'id':_0x4b17cd[_0xfe88('0x46')]['id']}})['then'](handleEntityNotFound(_0x470cf1,null))[_0xfe88('0x27')](removeEntity(_0x470cf1,null))[_0xfe88('0x4a')](handleError(_0x470cf1,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 6282528..c998809 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 _0xa080=['lodash','util','../../config/logger','bluebird','request-promise','rimraf','define','tools_templates'];(function(_0x4a3168,_0x494f38){var _0x35c154=function(_0x1ab446){while(--_0x1ab446){_0x4a3168['push'](_0x4a3168['shift']());}};_0x35c154(++_0x494f38);}(_0xa080,0x90));var _0x0a08=function(_0x23f9ec,_0x568e44){_0x23f9ec=_0x23f9ec-0x0;var _0x168e8b=_0xa080[_0x23f9ec];return _0x168e8b;};'use strict';var _=require(_0x0a08('0x0'));var util=require(_0x0a08('0x1'));var logger=require(_0x0a08('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a08('0x3'));var rp=require(_0x0a08('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a08('0x5'));var config=require('../../config/environment');var attributes=require('./template.attributes');module['exports']=function(_0x5c8fe7,_0x3aae89){return _0x5c8fe7[_0x0a08('0x6')]('Template',attributes,{'tableName':_0x0a08('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd049=['Template','tools_templates','lodash','util','bluebird','request-promise','rimraf','./template.attributes','exports','define'];(function(_0x347489,_0x52e2c5){var _0x24fb5a=function(_0x5b650a){while(--_0x5b650a){_0x347489['push'](_0x347489['shift']());}};_0x24fb5a(++_0x52e2c5);}(_0xd049,0xde));var _0x9d04=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xd049[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x9d04('0x0'));var util=require(_0x9d04('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9d04('0x2'));var rp=require(_0x9d04('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9d04('0x4'));var config=require('../../config/environment');var attributes=require(_0x9d04('0x5'));module[_0x9d04('0x6')]=function(_0xa0929d,_0x377073){return _0xa0929d[_0x9d04('0x7')](_0x9d04('0x8'),attributes,{'tableName':_0x9d04('0x9'),'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 f02fc0e..3d294c2 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 _0x8220=['message','result','catch','Template','findAll','options','raw','attributes','limit','include','map','GetTemplate','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x516766,_0x592739){var _0x8aba9e=function(_0x4ba046){while(--_0x4ba046){_0x516766['push'](_0x516766['shift']());}};_0x8aba9e(++_0x592739);}(_0x8220,0x93));var _0x0822=function(_0x260ce2,_0x2e22b8){_0x260ce2=_0x260ce2-0x0;var _0x16b105=_0x8220[_0x260ce2];return _0x16b105;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0822('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0822('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x0822('0x2'));var logger=require(_0x0822('0x3'))('rpc');var config=require(_0x0822('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x0822('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc1acd9,_0x5ef17a,_0x491bf5){return new BPromise(function(_0x4018bf,_0x35717d){return client[_0x0822('0x6')](_0xc1acd9,_0x491bf5)[_0x0822('0x7')](function(_0x17b194){logger[_0x0822('0x8')](_0x0822('0x9'),_0x5ef17a,_0x0822('0xa'));logger[_0x0822('0xb')](_0x0822('0xc'),_0x5ef17a,_0x0822('0xa'),JSON['stringify'](_0x17b194));if(_0x17b194[_0x0822('0xd')]){if(_0x17b194[_0x0822('0xd')][_0x0822('0xe')]===0x1f4){logger[_0x0822('0xd')](_0x0822('0x9'),_0x5ef17a,_0x17b194[_0x0822('0xd')][_0x0822('0xf')]);return _0x35717d(_0x17b194[_0x0822('0xd')]['message']);}logger[_0x0822('0xd')]('Template,\x20%s,\x20%s',_0x5ef17a,_0x17b194[_0x0822('0xd')]['message']);return _0x4018bf(_0x17b194['error'][_0x0822('0xf')]);}else{logger[_0x0822('0x8')](_0x0822('0x9'),_0x5ef17a,_0x0822('0xa'));_0x4018bf(_0x17b194[_0x0822('0x10')]['message']);}})[_0x0822('0x11')](function(_0x13eab2){logger['error'](_0x0822('0x9'),_0x5ef17a,_0x13eab2);_0x35717d(_0x13eab2);});});}exports['GetTemplate']=function(_0x5c09fe){var _0x4bdb1e=this;return new Promise(function(_0x276af4,_0x21d3f7){return db[_0x0822('0x12')][_0x0822('0x13')]({'raw':_0x5c09fe[_0x0822('0x14')]?_0x5c09fe['options'][_0x0822('0x15')]===undefined?!![]:![]:!![],'where':_0x5c09fe[_0x0822('0x14')]?_0x5c09fe['options']['where']||null:null,'attributes':_0x5c09fe[_0x0822('0x14')]?_0x5c09fe[_0x0822('0x14')][_0x0822('0x16')]||null:null,'limit':_0x5c09fe[_0x0822('0x14')]?_0x5c09fe[_0x0822('0x14')][_0x0822('0x17')]||null:null,'include':_0x5c09fe[_0x0822('0x14')]?_0x5c09fe[_0x0822('0x14')][_0x0822('0x18')]?_[_0x0822('0x19')](_0x5c09fe['options'][_0x0822('0x18')],function(_0x266b7b){return{'model':db[_0x266b7b['model']],'as':_0x266b7b['as'],'attributes':_0x266b7b[_0x0822('0x16')],'include':_0x266b7b[_0x0822('0x18')]?_[_0x0822('0x19')](_0x266b7b['include'],function(_0x1a62d4){return{'model':db[_0x1a62d4['model']],'as':_0x1a62d4['as'],'attributes':_0x1a62d4['attributes'],'include':_0x1a62d4['include']?_[_0x0822('0x19')](_0x1a62d4[_0x0822('0x18')],function(_0x2088a5){return{'model':db[_0x2088a5['model']],'as':_0x2088a5['as'],'attributes':_0x2088a5[_0x0822('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x22b109){logger[_0x0822('0x8')]('GetTemplate',_0x5c09fe);logger['debug'](_0x0822('0x1a'),_0x5c09fe,JSON['stringify'](_0x22b109));_0x276af4(_0x22b109);})[_0x0822('0x11')](function(_0x5bd634){logger[_0x0822('0xd')]('GetTemplate',_0x5bd634[_0x0822('0xf')],_0x5c09fe);_0x21d3f7(_0x4bdb1e['error'](0x1f4,_0x5bd634['message']));});});}; \ No newline at end of file +var _0x65e5=['where','limit','include','model','map','attributes','GetTemplate','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','stringify','error','code','message','result','catch','Template','options','raw'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0x65e5,0x1b9));var _0x565e=function(_0x233500,_0x543ec9){_0x233500=_0x233500-0x0;var _0x35a784=_0x65e5[_0x233500];return _0x35a784;};'use strict';var _=require(_0x565e('0x0'));var util=require(_0x565e('0x1'));var moment=require(_0x565e('0x2'));var BPromise=require(_0x565e('0x3'));var rs=require(_0x565e('0x4'));var fs=require('fs');var Redis=require(_0x565e('0x5'));var db=require(_0x565e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x565e('0x7'));var config=require(_0x565e('0x8'));var jayson=require(_0x565e('0x9'));var client=jayson['client'][_0x565e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1253d3,_0x5fdd9c,_0x55ed43){return new BPromise(function(_0x28e8c0,_0x3ab83a){return client[_0x565e('0xb')](_0x1253d3,_0x55ed43)[_0x565e('0xc')](function(_0x406a82){logger[_0x565e('0xd')]('Template,\x20%s,\x20%s',_0x5fdd9c,'request\x20sent');logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x5fdd9c,_0x565e('0xe'),JSON[_0x565e('0xf')](_0x406a82));if(_0x406a82[_0x565e('0x10')]){if(_0x406a82[_0x565e('0x10')][_0x565e('0x11')]===0x1f4){logger[_0x565e('0x10')]('Template,\x20%s,\x20%s',_0x5fdd9c,_0x406a82[_0x565e('0x10')][_0x565e('0x12')]);return _0x3ab83a(_0x406a82[_0x565e('0x10')][_0x565e('0x12')]);}logger[_0x565e('0x10')]('Template,\x20%s,\x20%s',_0x5fdd9c,_0x406a82[_0x565e('0x10')][_0x565e('0x12')]);return _0x28e8c0(_0x406a82[_0x565e('0x10')][_0x565e('0x12')]);}else{logger[_0x565e('0xd')]('Template,\x20%s,\x20%s',_0x5fdd9c,_0x565e('0xe'));_0x28e8c0(_0x406a82[_0x565e('0x13')][_0x565e('0x12')]);}})[_0x565e('0x14')](function(_0x4d5d70){logger[_0x565e('0x10')]('Template,\x20%s,\x20%s',_0x5fdd9c,_0x4d5d70);_0x3ab83a(_0x4d5d70);});});}exports['GetTemplate']=function(_0x309e8c){var _0x3a5b98=this;return new Promise(function(_0x2ac970,_0x35cbc4){return db[_0x565e('0x15')]['findAll']({'raw':_0x309e8c[_0x565e('0x16')]?_0x309e8c[_0x565e('0x16')][_0x565e('0x17')]===undefined?!![]:![]:!![],'where':_0x309e8c['options']?_0x309e8c[_0x565e('0x16')][_0x565e('0x18')]||null:null,'attributes':_0x309e8c[_0x565e('0x16')]?_0x309e8c[_0x565e('0x16')]['attributes']||null:null,'limit':_0x309e8c[_0x565e('0x16')]?_0x309e8c['options'][_0x565e('0x19')]||null:null,'include':_0x309e8c['options']?_0x309e8c[_0x565e('0x16')]['include']?_['map'](_0x309e8c['options'][_0x565e('0x1a')],function(_0x450eed){return{'model':db[_0x450eed[_0x565e('0x1b')]],'as':_0x450eed['as'],'attributes':_0x450eed['attributes'],'include':_0x450eed[_0x565e('0x1a')]?_[_0x565e('0x1c')](_0x450eed[_0x565e('0x1a')],function(_0x36b305){return{'model':db[_0x36b305['model']],'as':_0x36b305['as'],'attributes':_0x36b305[_0x565e('0x1d')],'include':_0x36b305['include']?_[_0x565e('0x1c')](_0x36b305['include'],function(_0x480561){return{'model':db[_0x480561[_0x565e('0x1b')]],'as':_0x480561['as'],'attributes':_0x480561[_0x565e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x565e('0xc')](function(_0x5b82bc){logger[_0x565e('0xd')](_0x565e('0x1e'),_0x309e8c);logger['debug'](_0x565e('0x1e'),_0x309e8c,JSON['stringify'](_0x5b82bc));_0x2ac970(_0x5b82bc);})['catch'](function(_0x4d8aea){logger[_0x565e('0x10')]('GetTemplate',_0x4d8aea[_0x565e('0x12')],_0x309e8c);_0x35cbc4(_0x3a5b98[_0x565e('0x10')](0x1f4,_0x4d8aea[_0x565e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 1a87cd4..7469649 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 _0xd76b=['fs-extra','../../components/auth/service','get','index','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction','put','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x2f2de2,_0x4f1a4e){var _0x23ae9=function(_0x5b4ced){while(--_0x5b4ced){_0x2f2de2['push'](_0x2f2de2['shift']());}};_0x23ae9(++_0x4f1a4e);}(_0xd76b,0x11a));var _0xbd76=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xd76b[_0x17b6e3];return _0x3906f3;};'use strict';var multer=require(_0xbd76('0x0'));var util=require(_0xbd76('0x1'));var path=require('path');var timeout=require(_0xbd76('0x2'));var express=require(_0xbd76('0x3'));var router=express['Router']();var fs_extra=require(_0xbd76('0x4'));var auth=require(_0xbd76('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./trigger.controller');router[_0xbd76('0x6')]('/',auth['isAuthenticated'](),controller[_0xbd76('0x7')]);router[_0xbd76('0x6')](_0xbd76('0x8'),auth[_0xbd76('0x9')](),controller[_0xbd76('0xa')]);router['get'](_0xbd76('0xb'),auth[_0xbd76('0x9')](),controller[_0xbd76('0xc')]);router['get'](_0xbd76('0xd'),auth[_0xbd76('0x9')](),controller[_0xbd76('0xe')]);router[_0xbd76('0x6')](_0xbd76('0xf'),auth['isAuthenticated'](),controller[_0xbd76('0x10')]);router[_0xbd76('0x11')]('/',auth['isAuthenticated'](),controller[_0xbd76('0x12')]);router[_0xbd76('0x11')](_0xbd76('0xb'),auth[_0xbd76('0x9')](),controller[_0xbd76('0x13')]);router[_0xbd76('0x11')](_0xbd76('0xd'),auth[_0xbd76('0x9')](),controller[_0xbd76('0x14')]);router[_0xbd76('0x11')]('/:id/actions',auth[_0xbd76('0x9')](),controller[_0xbd76('0x15')]);router[_0xbd76('0x16')](_0xbd76('0x8'),auth[_0xbd76('0x9')](),controller['update']);router[_0xbd76('0x17')](_0xbd76('0x8'),auth[_0xbd76('0x9')](),controller[_0xbd76('0x18')]);module[_0xbd76('0x19')]=router; \ No newline at end of file +var _0xf3ad=['/:id/actions','getActions','post','addAnyCondition','addAction','update','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xf3ad,0xb6));var _0xdf3a=function(_0x1ca585,_0x1000cb){_0x1ca585=_0x1ca585-0x0;var _0x16d0e4=_0xf3ad[_0x1ca585];return _0x16d0e4;};'use strict';var multer=require('multer');var util=require(_0xdf3a('0x0'));var path=require(_0xdf3a('0x1'));var timeout=require(_0xdf3a('0x2'));var express=require('express');var router=express[_0xdf3a('0x3')]();var fs_extra=require(_0xdf3a('0x4'));var auth=require(_0xdf3a('0x5'));var interaction=require(_0xdf3a('0x6'));var config=require(_0xdf3a('0x7'));var controller=require(_0xdf3a('0x8'));router[_0xdf3a('0x9')]('/',auth[_0xdf3a('0xa')](),controller[_0xdf3a('0xb')]);router[_0xdf3a('0x9')](_0xdf3a('0xc'),auth[_0xdf3a('0xa')](),controller[_0xdf3a('0xd')]);router[_0xdf3a('0x9')](_0xdf3a('0xe'),auth[_0xdf3a('0xa')](),controller[_0xdf3a('0xf')]);router[_0xdf3a('0x9')](_0xdf3a('0x10'),auth[_0xdf3a('0xa')](),controller[_0xdf3a('0x11')]);router[_0xdf3a('0x9')](_0xdf3a('0x12'),auth[_0xdf3a('0xa')](),controller[_0xdf3a('0x13')]);router['post']('/',auth[_0xdf3a('0xa')](),controller['create']);router[_0xdf3a('0x14')](_0xdf3a('0xe'),auth[_0xdf3a('0xa')](),controller['addAllCondition']);router[_0xdf3a('0x14')](_0xdf3a('0x10'),auth['isAuthenticated'](),controller[_0xdf3a('0x15')]);router['post'](_0xdf3a('0x12'),auth[_0xdf3a('0xa')](),controller[_0xdf3a('0x16')]);router['put']('/:id',auth[_0xdf3a('0xa')](),controller[_0xdf3a('0x17')]);router['delete'](_0xdf3a('0xc'),auth[_0xdf3a('0xa')](),controller['destroy']);module[_0xdf3a('0x18')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 7fb3e9c..a353777 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 _0x5bbe=['STRING','BOOLEAN','sequelize','exports'];(function(_0x74b7e,_0x13fea5){var _0x50fbb0=function(_0x4d9658){while(--_0x4d9658){_0x74b7e['push'](_0x74b7e['shift']());}};_0x50fbb0(++_0x13fea5);}(_0x5bbe,0x6e));var _0xe5bb=function(_0x3857e6,_0x160cf6){_0x3857e6=_0x3857e6-0x0;var _0x27b40a=_0x5bbe[_0x3857e6];return _0x27b40a;};'use strict';var Sequelize=require(_0xe5bb('0x0'));module[_0xe5bb('0x1')]={'name':{'type':Sequelize[_0xe5bb('0x2')]},'channel':{'type':Sequelize[_0xe5bb('0x2')]},'description':{'type':Sequelize[_0xe5bb('0x2')]},'status':{'type':Sequelize[_0xe5bb('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x7d35=['STRING','exports'];(function(_0x970068,_0x3e4142){var _0x51063d=function(_0x32b30e){while(--_0x32b30e){_0x970068['push'](_0x970068['shift']());}};_0x51063d(++_0x3e4142);}(_0x7d35,0xad));var _0x57d3=function(_0x37d870,_0x43470b){_0x37d870=_0x37d870-0x0;var _0x4b2c5f=_0x7d35[_0x37d870];return _0x4b2c5f;};'use strict';var Sequelize=require('sequelize');module[_0x57d3('0x0')]={'name':{'type':Sequelize[_0x57d3('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x57d3('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index f1eb70b..753d80b 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 _0x1b56=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','nolimit','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','Triggers','UserProfileResource','destroy','error','stack','name','index','map','Trigger','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','findAll','rows','catch','show','params','includeAll','include','options','find','create'];(function(_0x51ed62,_0x574379){var _0x34aee3=function(_0x2958bc){while(--_0x2958bc){_0x51ed62['push'](_0x51ed62['shift']());}};_0x34aee3(++_0x574379);}(_0x1b56,0x198));var _0x61b5=function(_0x4347ec,_0x41c4b8){_0x4347ec=_0x4347ec-0x0;var _0x4c8314=_0x1b56[_0x4347ec];return _0x4c8314;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x61b5('0x0'));var zipdir=require(_0x61b5('0x1'));var jsonpatch=require(_0x61b5('0x2'));var rp=require(_0x61b5('0x3'));var moment=require('moment');var BPromise=require(_0x61b5('0x4'));var Mustache=require('mustache');var util=require(_0x61b5('0x5'));var path=require('path');var sox=require(_0x61b5('0x6'));var csv=require(_0x61b5('0x7'));var ejs=require(_0x61b5('0x8'));var fs=require('fs');var fs_extra=require(_0x61b5('0x9'));var _=require(_0x61b5('0xa'));var squel=require(_0x61b5('0xb'));var crypto=require(_0x61b5('0xc'));var jsforce=require(_0x61b5('0xd'));var deskjs=require(_0x61b5('0xe'));var toCsv=require(_0x61b5('0x7'));var querystring=require(_0x61b5('0xf'));var Papa=require(_0x61b5('0x10'));var Redis=require(_0x61b5('0x11'));var authService=require(_0x61b5('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x61b5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x61b5('0x14'));var utils=require(_0x61b5('0x15'));var config=require(_0x61b5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x61b5('0x17'))['db'];function respondWithStatusCode(_0x4943ba,_0x1b6dc3){_0x1b6dc3=_0x1b6dc3||0xcc;return function(_0xed26f0){if(_0xed26f0){return _0x4943ba[_0x61b5('0x18')](_0x1b6dc3);}return _0x4943ba[_0x61b5('0x19')](_0x1b6dc3)[_0x61b5('0x1a')]();};}function respondWithResult(_0x168e72,_0x57d28c){_0x57d28c=_0x57d28c||0xc8;return function(_0x39501b){if(_0x39501b){return _0x168e72['status'](_0x57d28c)[_0x61b5('0x1b')](_0x39501b);}};}function respondWithFilteredResult(_0x1de744,_0x1c3581){return function(_0x481cf3){if(_0x481cf3){var _0x45fe7d=typeof _0x1c3581[_0x61b5('0x1c')]==='undefined'&&typeof _0x1c3581[_0x61b5('0x1d')]===_0x61b5('0x1e');var _0x889d65=_0x481cf3[_0x61b5('0x1f')];var _0x32325e=_0x45fe7d?0x0:_0x1c3581['offset'];var _0x42c259=_0x45fe7d?_0x481cf3[_0x61b5('0x1f')]:_0x1c3581['offset']+_0x1c3581[_0x61b5('0x1d')];var _0x299162;if(_0x42c259>=_0x889d65){_0x42c259=_0x889d65;_0x299162=0xc8;}else{_0x299162=0xce;}_0x1de744[_0x61b5('0x19')](_0x299162);return _0x1de744[_0x61b5('0x20')](_0x61b5('0x21'),_0x32325e+'-'+_0x42c259+'/'+_0x889d65)[_0x61b5('0x1b')](_0x481cf3);}return null;};}function patchUpdates(_0x481ecb){return function(_0x4affd4){try{jsonpatch['apply'](_0x4affd4,_0x481ecb,!![]);}catch(_0x542dae){return BPromise[_0x61b5('0x22')](_0x542dae);}return _0x4affd4[_0x61b5('0x23')]();};}function saveUpdates(_0xda783d,_0x5a7fd1){return function(_0x13b2d3){if(_0x13b2d3){return _0x13b2d3[_0x61b5('0x24')](_0xda783d)[_0x61b5('0x25')](function(_0x4c25d0){return _0x4c25d0;});}return null;};}function removeEntity(_0x1d7626,_0x5ae6ff){return function(_0x3ab23a){if(_0x3ab23a){return _0x3ab23a['destroy']()[_0x61b5('0x25')](function(){var _0x2aed3b=_0x3ab23a[_0x61b5('0x26')]({'plain':!![]});var _0x2b64f9=_0x61b5('0x27');return db[_0x61b5('0x28')][_0x61b5('0x29')]({'where':{'type':_0x2b64f9,'resourceId':_0x2aed3b['id']}})[_0x61b5('0x25')](function(){return _0x3ab23a;});})[_0x61b5('0x25')](function(){_0x1d7626['status'](0xcc)[_0x61b5('0x1a')]();});}};}function handleEntityNotFound(_0x3f4519,_0x454d19){return function(_0x5825c6){if(!_0x5825c6){_0x3f4519['sendStatus'](0x194);}return _0x5825c6;};}function handleError(_0x54b3ce,_0x1675f8){_0x1675f8=_0x1675f8||0x1f4;return function(_0x49039d){logger[_0x61b5('0x2a')](_0x49039d[_0x61b5('0x2b')]);if(_0x49039d[_0x61b5('0x2c')]){delete _0x49039d['name'];}_0x54b3ce['status'](_0x1675f8)['send'](_0x49039d);};}exports[_0x61b5('0x2d')]=function(_0x301cd9,_0x159ffa){var _0x567ce0={},_0x2d4ac1={},_0x3440f9={'count':0x0,'rows':[]};var _0x1cfd0f=_[_0x61b5('0x2e')](db[_0x61b5('0x2f')][_0x61b5('0x30')],function(_0x865f36){return{'name':_0x865f36['fieldName'],'type':_0x865f36[_0x61b5('0x31')][_0x61b5('0x32')]};});_0x2d4ac1[_0x61b5('0x33')]=_[_0x61b5('0x2e')](_0x1cfd0f,_0x61b5('0x2c'));_0x2d4ac1[_0x61b5('0x34')]=_[_0x61b5('0x35')](_0x301cd9[_0x61b5('0x34')]);_0x2d4ac1[_0x61b5('0x36')]=_[_0x61b5('0x37')](_0x2d4ac1[_0x61b5('0x33')],_0x2d4ac1[_0x61b5('0x34')]);_0x567ce0[_0x61b5('0x38')]=_[_0x61b5('0x37')](_0x2d4ac1[_0x61b5('0x33')],qs[_0x61b5('0x39')](_0x301cd9[_0x61b5('0x34')]['fields']));_0x567ce0[_0x61b5('0x38')]=_0x567ce0[_0x61b5('0x38')][_0x61b5('0x3a')]?_0x567ce0['attributes']:_0x2d4ac1[_0x61b5('0x33')];if(!_0x301cd9[_0x61b5('0x34')][_0x61b5('0x3b')]('nolimit')){_0x567ce0[_0x61b5('0x1d')]=qs[_0x61b5('0x1d')](_0x301cd9[_0x61b5('0x34')][_0x61b5('0x1d')]);_0x567ce0[_0x61b5('0x1c')]=qs['offset'](_0x301cd9[_0x61b5('0x34')][_0x61b5('0x1c')]);}_0x567ce0[_0x61b5('0x3c')]=qs[_0x61b5('0x3d')](_0x301cd9[_0x61b5('0x34')]['sort']);_0x567ce0['where']=qs['filters'](_[_0x61b5('0x3e')](_0x301cd9[_0x61b5('0x34')],_0x2d4ac1['filters']),_0x1cfd0f);if(_0x301cd9['query'][_0x61b5('0x3f')]){_0x567ce0[_0x61b5('0x40')]=_[_0x61b5('0x41')](_0x567ce0[_0x61b5('0x40')],{'$or':_[_0x61b5('0x2e')](_0x1cfd0f,function(_0x5ab8c5){if(_0x5ab8c5[_0x61b5('0x31')]!==_0x61b5('0x42')){var _0x40ac65={};_0x40ac65[_0x5ab8c5[_0x61b5('0x2c')]]={'$like':'%'+_0x301cd9[_0x61b5('0x34')][_0x61b5('0x3f')]+'%'};return _0x40ac65;}})});}_0x567ce0=_[_0x61b5('0x41')]({},_0x567ce0,_0x301cd9['options']);var _0x4cabc7={'where':_0x567ce0[_0x61b5('0x40')]};return db[_0x61b5('0x2f')][_0x61b5('0x1f')](_0x4cabc7)[_0x61b5('0x25')](function(_0x357c2c){_0x3440f9[_0x61b5('0x1f')]=_0x357c2c;if(_0x301cd9[_0x61b5('0x34')]['includeAll']){_0x567ce0['include']=[{'all':!![]}];}return db[_0x61b5('0x2f')][_0x61b5('0x43')](_0x567ce0);})['then'](function(_0x2bc18e){_0x3440f9[_0x61b5('0x44')]=_0x2bc18e;return _0x3440f9;})[_0x61b5('0x25')](respondWithFilteredResult(_0x159ffa,_0x567ce0))[_0x61b5('0x45')](handleError(_0x159ffa,null));};exports[_0x61b5('0x46')]=function(_0x54060d,_0x138c68){var _0x520885={'raw':![],'where':{'id':_0x54060d[_0x61b5('0x47')]['id']}},_0x4240ec={};_0x4240ec[_0x61b5('0x33')]=_[_0x61b5('0x35')](db[_0x61b5('0x2f')][_0x61b5('0x30')]);_0x4240ec[_0x61b5('0x34')]=_[_0x61b5('0x35')](_0x54060d[_0x61b5('0x34')]);_0x4240ec[_0x61b5('0x36')]=_[_0x61b5('0x37')](_0x4240ec[_0x61b5('0x33')],_0x4240ec[_0x61b5('0x34')]);_0x520885[_0x61b5('0x38')]=_[_0x61b5('0x37')](_0x4240ec['model'],qs['fields'](_0x54060d[_0x61b5('0x34')][_0x61b5('0x39')]));_0x520885[_0x61b5('0x38')]=_0x520885[_0x61b5('0x38')][_0x61b5('0x3a')]?_0x520885[_0x61b5('0x38')]:_0x4240ec[_0x61b5('0x33')];if(_0x54060d[_0x61b5('0x34')][_0x61b5('0x48')]){_0x520885[_0x61b5('0x49')]=[{'all':!![]}];}_0x520885=_[_0x61b5('0x41')]({},_0x520885,_0x54060d[_0x61b5('0x4a')]);return db['Trigger'][_0x61b5('0x4b')](_0x520885)[_0x61b5('0x25')](handleEntityNotFound(_0x138c68,null))[_0x61b5('0x25')](respondWithResult(_0x138c68,null))[_0x61b5('0x45')](handleError(_0x138c68,null));};exports[_0x61b5('0x4c')]=function(_0x52d072,_0x5d5785){return db['Trigger'][_0x61b5('0x4c')](_0x52d072[_0x61b5('0x4d')],{})['then'](function(_0x563fb4){var _0x17932a=_0x52d072[_0x61b5('0x4e')][_0x61b5('0x26')]({'plain':!![]});if(!_0x17932a)throw new Error(_0x61b5('0x4f'));if(_0x17932a['role']==='user'){var _0x1e505e=_0x563fb4[_0x61b5('0x26')]({'plain':!![]});var _0x1b36b6=_0x61b5('0x27');return db[_0x61b5('0x50')]['find']({'where':{'name':_0x1b36b6,'userProfileId':_0x17932a[_0x61b5('0x51')]},'raw':!![]})['then'](function(_0x4589c5){if(_0x4589c5&&_0x4589c5[_0x61b5('0x52')]===0x0){return db[_0x61b5('0x28')][_0x61b5('0x4c')]({'name':_0x1e505e['name'],'resourceId':_0x1e505e['id'],'type':_0x4589c5[_0x61b5('0x2c')],'sectionId':_0x4589c5['id']},{})[_0x61b5('0x25')](function(){return _0x563fb4;});}else{return _0x563fb4;}})[_0x61b5('0x45')](function(_0x56563a){logger['error'](_0x61b5('0x53'),_0x56563a);throw _0x56563a;});}return _0x563fb4;})[_0x61b5('0x25')](respondWithResult(_0x5d5785,0xc9))[_0x61b5('0x45')](handleError(_0x5d5785,null));};exports[_0x61b5('0x24')]=function(_0x5b1a38,_0x53b609){if(_0x5b1a38[_0x61b5('0x4d')]['id']){delete _0x5b1a38[_0x61b5('0x4d')]['id'];}return db[_0x61b5('0x2f')][_0x61b5('0x4b')]({'where':{'id':_0x5b1a38[_0x61b5('0x47')]['id']}})[_0x61b5('0x25')](handleEntityNotFound(_0x53b609,null))[_0x61b5('0x25')](saveUpdates(_0x5b1a38[_0x61b5('0x4d')],null))[_0x61b5('0x25')](respondWithResult(_0x53b609,null))[_0x61b5('0x45')](handleError(_0x53b609,null));};exports[_0x61b5('0x29')]=function(_0x7a8711,_0x2be3b5){return db[_0x61b5('0x2f')][_0x61b5('0x4b')]({'where':{'id':_0x7a8711[_0x61b5('0x47')]['id']}})[_0x61b5('0x25')](handleEntityNotFound(_0x2be3b5,null))['then'](removeEntity(_0x2be3b5,null))[_0x61b5('0x45')](handleError(_0x2be3b5,null));};exports[_0x61b5('0x54')]=function(_0x486447,_0x33ab1d,_0x3d69fb){if(_0x486447[_0x61b5('0x4d')]['id']){delete _0x486447[_0x61b5('0x4d')]['id'];}return db[_0x61b5('0x2f')][_0x61b5('0x4b')]({'where':{'id':_0x486447[_0x61b5('0x47')]['id']}})[_0x61b5('0x25')](handleEntityNotFound(_0x33ab1d,null))[_0x61b5('0x25')](function(_0x4ee8c6){if(_0x4ee8c6){_0x486447['body'][_0x61b5('0x55')]=_0x4ee8c6['id'];return db[_0x61b5('0x56')][_0x61b5('0x4c')](_0x486447[_0x61b5('0x4d')]);}})[_0x61b5('0x25')](respondWithResult(_0x33ab1d,null))[_0x61b5('0x45')](handleError(_0x33ab1d,null));};exports[_0x61b5('0x57')]=function(_0x188368,_0x28d77f,_0x47e1ca){if(_0x188368[_0x61b5('0x4d')]['id']){delete _0x188368[_0x61b5('0x4d')]['id'];}return db['Trigger']['find']({'where':{'id':_0x188368['params']['id']}})[_0x61b5('0x25')](handleEntityNotFound(_0x28d77f,null))['then'](function(_0x171206){if(_0x171206){_0x188368['body'][_0x61b5('0x58')]=_0x171206['id'];return db[_0x61b5('0x56')]['create'](_0x188368[_0x61b5('0x4d')]);}})[_0x61b5('0x25')](respondWithResult(_0x28d77f,null))['catch'](handleError(_0x28d77f,null));};exports[_0x61b5('0x59')]=function(_0x3d55a5,_0x331aea,_0x2f0f82){var _0x59474a={};var _0x3fa1b2={};var _0x4baa06;var _0x357104;return db['Trigger']['findOne']({'where':{'id':_0x3d55a5[_0x61b5('0x47')]['id']}})[_0x61b5('0x25')](handleEntityNotFound(_0x331aea,null))[_0x61b5('0x25')](function(_0x9a0612){if(_0x9a0612){_0x4baa06=_0x9a0612;_0x3fa1b2[_0x61b5('0x33')]=_[_0x61b5('0x35')](db[_0x61b5('0x56')][_0x61b5('0x30')]);_0x3fa1b2[_0x61b5('0x34')]=_[_0x61b5('0x35')](_0x3d55a5[_0x61b5('0x34')]);_0x3fa1b2['filters']=_[_0x61b5('0x37')](_0x3fa1b2[_0x61b5('0x33')],_0x3fa1b2[_0x61b5('0x34')]);_0x59474a[_0x61b5('0x38')]=_[_0x61b5('0x37')](_0x3fa1b2[_0x61b5('0x33')],qs[_0x61b5('0x39')](_0x3d55a5[_0x61b5('0x34')][_0x61b5('0x39')]));_0x59474a[_0x61b5('0x38')]=_0x59474a[_0x61b5('0x38')][_0x61b5('0x3a')]?_0x59474a[_0x61b5('0x38')]:_0x3fa1b2[_0x61b5('0x33')];_0x59474a[_0x61b5('0x3c')]=qs[_0x61b5('0x3d')](_0x3d55a5['query'][_0x61b5('0x3d')]);_0x59474a['where']=qs['filters'](_['pick'](_0x3d55a5[_0x61b5('0x34')],_0x3fa1b2[_0x61b5('0x36')]));if(_0x3d55a5[_0x61b5('0x34')][_0x61b5('0x3f')]){_0x59474a['where']=_[_0x61b5('0x41')](_0x59474a['where'],{'$or':_['map'](_0x59474a[_0x61b5('0x38')],function(_0x30bdb2){var _0x35ea69={};_0x35ea69[_0x30bdb2]={'$like':'%'+_0x3d55a5[_0x61b5('0x34')][_0x61b5('0x3f')]+'%'};return _0x35ea69;})});}_0x59474a=_[_0x61b5('0x41')]({},_0x59474a,_0x3d55a5[_0x61b5('0x4a')]);return _0x4baa06[_0x61b5('0x59')](_0x59474a);}})['then'](function(_0x10f77e){if(_0x10f77e){_0x357104=_0x10f77e[_0x61b5('0x3a')];if(!_0x3d55a5['query'][_0x61b5('0x3b')](_0x61b5('0x5a'))){_0x59474a[_0x61b5('0x1d')]=qs['limit'](_0x3d55a5[_0x61b5('0x34')][_0x61b5('0x1d')]);_0x59474a[_0x61b5('0x1c')]=qs[_0x61b5('0x1c')](_0x3d55a5[_0x61b5('0x34')][_0x61b5('0x1c')]);}return _0x4baa06['getAllConditions'](_0x59474a);}})[_0x61b5('0x25')](function(_0x5ea0d8){if(_0x5ea0d8){return _0x5ea0d8?{'count':_0x357104,'rows':_0x5ea0d8}:null;}})[_0x61b5('0x25')](respondWithResult(_0x331aea,null))['catch'](handleError(_0x331aea,null));};exports['getAnyConditions']=function(_0x450f6c,_0x419896,_0xad4b4d){var _0x290a9b={};var _0x291868={};var _0x5bb2b3;var _0x29e508;return db[_0x61b5('0x2f')][_0x61b5('0x5b')]({'where':{'id':_0x450f6c[_0x61b5('0x47')]['id']}})['then'](handleEntityNotFound(_0x419896,null))[_0x61b5('0x25')](function(_0x1d7eed){if(_0x1d7eed){_0x5bb2b3=_0x1d7eed;_0x291868['model']=_[_0x61b5('0x35')](db['Condition']['rawAttributes']);_0x291868[_0x61b5('0x34')]=_['keys'](_0x450f6c[_0x61b5('0x34')]);_0x291868[_0x61b5('0x36')]=_[_0x61b5('0x37')](_0x291868[_0x61b5('0x33')],_0x291868[_0x61b5('0x34')]);_0x290a9b[_0x61b5('0x38')]=_[_0x61b5('0x37')](_0x291868[_0x61b5('0x33')],qs[_0x61b5('0x39')](_0x450f6c['query'][_0x61b5('0x39')]));_0x290a9b[_0x61b5('0x38')]=_0x290a9b[_0x61b5('0x38')]['length']?_0x290a9b[_0x61b5('0x38')]:_0x291868['model'];_0x290a9b[_0x61b5('0x3c')]=qs[_0x61b5('0x3d')](_0x450f6c[_0x61b5('0x34')][_0x61b5('0x3d')]);_0x290a9b[_0x61b5('0x40')]=qs['filters'](_['pick'](_0x450f6c[_0x61b5('0x34')],_0x291868[_0x61b5('0x36')]));if(_0x450f6c[_0x61b5('0x34')]['filter']){_0x290a9b[_0x61b5('0x40')]=_['merge'](_0x290a9b[_0x61b5('0x40')],{'$or':_[_0x61b5('0x2e')](_0x290a9b[_0x61b5('0x38')],function(_0x45d502){var _0x3fd063={};_0x3fd063[_0x45d502]={'$like':'%'+_0x450f6c[_0x61b5('0x34')][_0x61b5('0x3f')]+'%'};return _0x3fd063;})});}_0x290a9b=_[_0x61b5('0x41')]({},_0x290a9b,_0x450f6c[_0x61b5('0x4a')]);return _0x5bb2b3[_0x61b5('0x5c')](_0x290a9b);}})['then'](function(_0x78b369){if(_0x78b369){_0x29e508=_0x78b369[_0x61b5('0x3a')];if(!_0x450f6c[_0x61b5('0x34')][_0x61b5('0x3b')](_0x61b5('0x5a'))){_0x290a9b[_0x61b5('0x1d')]=qs[_0x61b5('0x1d')](_0x450f6c[_0x61b5('0x34')][_0x61b5('0x1d')]);_0x290a9b['offset']=qs[_0x61b5('0x1c')](_0x450f6c[_0x61b5('0x34')][_0x61b5('0x1c')]);}return _0x5bb2b3['getAnyConditions'](_0x290a9b);}})[_0x61b5('0x25')](function(_0x288110){if(_0x288110){return _0x288110?{'count':_0x29e508,'rows':_0x288110}:null;}})[_0x61b5('0x25')](respondWithResult(_0x419896,null))[_0x61b5('0x45')](handleError(_0x419896,null));};exports[_0x61b5('0x5d')]=function(_0x3d7997,_0x57b87c,_0x5d3971){if(_0x3d7997[_0x61b5('0x4d')]['id']){delete _0x3d7997[_0x61b5('0x4d')]['id'];}return db[_0x61b5('0x2f')]['find']({'where':{'id':_0x3d7997[_0x61b5('0x47')]['id']}})['then'](handleEntityNotFound(_0x57b87c,null))[_0x61b5('0x25')](function(_0x317944){if(_0x317944){_0x3d7997['body'][_0x61b5('0x5e')]=_0x317944['id'];return db[_0x61b5('0x5f')][_0x61b5('0x4c')](_0x3d7997['body']);}})[_0x61b5('0x25')](respondWithResult(_0x57b87c,null))[_0x61b5('0x45')](handleError(_0x57b87c,null));};exports[_0x61b5('0x60')]=function(_0x48836f,_0xff3673,_0x37bf34){var _0x4cc19a={};var _0x50d21b={};var _0x44dc89;var _0x2675eb;return db[_0x61b5('0x2f')][_0x61b5('0x5b')]({'where':{'id':_0x48836f[_0x61b5('0x47')]['id']}})['then'](handleEntityNotFound(_0xff3673,null))[_0x61b5('0x25')](function(_0x5c28a8){if(_0x5c28a8){_0x44dc89=_0x5c28a8;_0x50d21b[_0x61b5('0x33')]=_['keys'](db['Action']['rawAttributes']);_0x50d21b[_0x61b5('0x34')]=_[_0x61b5('0x35')](_0x48836f[_0x61b5('0x34')]);_0x50d21b['filters']=_['intersection'](_0x50d21b[_0x61b5('0x33')],_0x50d21b[_0x61b5('0x34')]);_0x4cc19a[_0x61b5('0x38')]=_['intersection'](_0x50d21b['model'],qs[_0x61b5('0x39')](_0x48836f[_0x61b5('0x34')][_0x61b5('0x39')]));_0x4cc19a[_0x61b5('0x38')]=_0x4cc19a[_0x61b5('0x38')][_0x61b5('0x3a')]?_0x4cc19a[_0x61b5('0x38')]:_0x50d21b[_0x61b5('0x33')];_0x4cc19a[_0x61b5('0x3c')]=qs[_0x61b5('0x3d')](_0x48836f[_0x61b5('0x34')]['sort']);_0x4cc19a['where']=qs[_0x61b5('0x36')](_[_0x61b5('0x3e')](_0x48836f['query'],_0x50d21b[_0x61b5('0x36')]));if(_0x48836f[_0x61b5('0x34')]['filter']){_0x4cc19a[_0x61b5('0x40')]=_[_0x61b5('0x41')](_0x4cc19a[_0x61b5('0x40')],{'$or':_['map'](_0x4cc19a[_0x61b5('0x38')],function(_0x55ec1d){var _0x8aa965={};_0x8aa965[_0x55ec1d]={'$like':'%'+_0x48836f['query'][_0x61b5('0x3f')]+'%'};return _0x8aa965;})});}_0x4cc19a=_[_0x61b5('0x41')]({},_0x4cc19a,_0x48836f[_0x61b5('0x4a')]);return _0x44dc89[_0x61b5('0x60')](_0x4cc19a);}})['then'](function(_0x319154){if(_0x319154){_0x2675eb=_0x319154[_0x61b5('0x3a')];if(!_0x48836f[_0x61b5('0x34')]['hasOwnProperty']('nolimit')){_0x4cc19a['limit']=qs[_0x61b5('0x1d')](_0x48836f[_0x61b5('0x34')][_0x61b5('0x1d')]);_0x4cc19a[_0x61b5('0x1c')]=qs[_0x61b5('0x1c')](_0x48836f[_0x61b5('0x34')][_0x61b5('0x1c')]);}return _0x44dc89[_0x61b5('0x60')](_0x4cc19a);}})['then'](function(_0x468bca){if(_0x468bca){return _0x468bca?{'count':_0x2675eb,'rows':_0x468bca}:null;}})[_0x61b5('0x25')](respondWithResult(_0xff3673,null))[_0x61b5('0x45')](handleError(_0xff3673,null));}; \ No newline at end of file +var _0xe965=['eml-format','rimraf','moment','bluebird','mustache','util','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','Trigger','rawAttributes','type','key','query','keys','filters','attributes','intersection','model','fields','length','nolimit','order','sort','pick','filter','merge','options','where','include','findAll','rows','catch','show','params','includeAll','find','create','body','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','map','hasOwnProperty','addAction','TriggerId','Action','getActions'];(function(_0x39b82d,_0x48efa9){var _0xcb204d=function(_0x3ce1cd){while(--_0x3ce1cd){_0x39b82d['push'](_0x39b82d['shift']());}};_0xcb204d(++_0x48efa9);}(_0xe965,0x170));var _0x5e96=function(_0x3d3cdc,_0x507968){_0x3d3cdc=_0x3d3cdc-0x0;var _0x1d1bb5=_0xe965[_0x3d3cdc];return _0x1d1bb5;};'use strict';var emlformat=require(_0x5e96('0x0'));var rimraf=require(_0x5e96('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5e96('0x2'));var BPromise=require(_0x5e96('0x3'));var Mustache=require(_0x5e96('0x4'));var util=require(_0x5e96('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5e96('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5e96('0x7'));var crypto=require(_0x5e96('0x8'));var jsforce=require(_0x5e96('0x9'));var deskjs=require(_0x5e96('0xa'));var toCsv=require(_0x5e96('0xb'));var querystring=require(_0x5e96('0xc'));var Papa=require(_0x5e96('0xd'));var Redis=require(_0x5e96('0xe'));var authService=require(_0x5e96('0xf'));var qs=require(_0x5e96('0x10'));var as=require(_0x5e96('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5e96('0x12'));var utils=require(_0x5e96('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5e96('0x14'));var db=require(_0x5e96('0x15'))['db'];function respondWithStatusCode(_0x125307,_0x2046af){_0x2046af=_0x2046af||0xcc;return function(_0x2f3c2a){if(_0x2f3c2a){return _0x125307['sendStatus'](_0x2046af);}return _0x125307[_0x5e96('0x16')](_0x2046af)[_0x5e96('0x17')]();};}function respondWithResult(_0x2b3ff1,_0x39036f){_0x39036f=_0x39036f||0xc8;return function(_0x255cb7){if(_0x255cb7){return _0x2b3ff1[_0x5e96('0x16')](_0x39036f)[_0x5e96('0x18')](_0x255cb7);}};}function respondWithFilteredResult(_0x3926f8,_0x2b85ae){return function(_0x19d78a){if(_0x19d78a){var _0x297902=typeof _0x2b85ae[_0x5e96('0x19')]===_0x5e96('0x1a')&&typeof _0x2b85ae[_0x5e96('0x1b')]===_0x5e96('0x1a');var _0x41ac34=_0x19d78a[_0x5e96('0x1c')];var _0x3ebaa3=_0x297902?0x0:_0x2b85ae['offset'];var _0x153323=_0x297902?_0x19d78a[_0x5e96('0x1c')]:_0x2b85ae[_0x5e96('0x19')]+_0x2b85ae[_0x5e96('0x1b')];var _0x10dda5;if(_0x153323>=_0x41ac34){_0x153323=_0x41ac34;_0x10dda5=0xc8;}else{_0x10dda5=0xce;}_0x3926f8[_0x5e96('0x16')](_0x10dda5);return _0x3926f8[_0x5e96('0x1d')]('Content-Range',_0x3ebaa3+'-'+_0x153323+'/'+_0x41ac34)[_0x5e96('0x18')](_0x19d78a);}return null;};}function patchUpdates(_0x3f4d23){return function(_0x320237){try{jsonpatch[_0x5e96('0x1e')](_0x320237,_0x3f4d23,!![]);}catch(_0x3d1a5b){return BPromise[_0x5e96('0x1f')](_0x3d1a5b);}return _0x320237[_0x5e96('0x20')]();};}function saveUpdates(_0x31c683,_0xcff78c){return function(_0x5e6d10){if(_0x5e6d10){return _0x5e6d10[_0x5e96('0x21')](_0x31c683)[_0x5e96('0x22')](function(_0x7753f0){return _0x7753f0;});}return null;};}function removeEntity(_0x14d676,_0x13fff7){return function(_0x43cd96){if(_0x43cd96){return _0x43cd96[_0x5e96('0x23')]()[_0x5e96('0x22')](function(){var _0x8628eb=_0x43cd96[_0x5e96('0x24')]({'plain':!![]});var _0x5b7f5f='Triggers';return db[_0x5e96('0x25')]['destroy']({'where':{'type':_0x5b7f5f,'resourceId':_0x8628eb['id']}})[_0x5e96('0x22')](function(){return _0x43cd96;});})[_0x5e96('0x22')](function(){_0x14d676[_0x5e96('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e73a6,_0x37918a){return function(_0x56e94e){if(!_0x56e94e){_0x3e73a6[_0x5e96('0x26')](0x194);}return _0x56e94e;};}function handleError(_0x31f7c2,_0x3ca3ee){_0x3ca3ee=_0x3ca3ee||0x1f4;return function(_0x355971){logger[_0x5e96('0x27')](_0x355971[_0x5e96('0x28')]);if(_0x355971['name']){delete _0x355971[_0x5e96('0x29')];}_0x31f7c2[_0x5e96('0x16')](_0x3ca3ee)[_0x5e96('0x2a')](_0x355971);};}exports[_0x5e96('0x2b')]=function(_0xc5d2c5,_0x53b7cb){var _0x1ab17d={},_0xb645da={},_0x5f1900={'count':0x0,'rows':[]};var _0x15fbab=_['map'](db[_0x5e96('0x2c')][_0x5e96('0x2d')],function(_0x1b237c){return{'name':_0x1b237c['fieldName'],'type':_0x1b237c[_0x5e96('0x2e')][_0x5e96('0x2f')]};});_0xb645da['model']=_['map'](_0x15fbab,_0x5e96('0x29'));_0xb645da[_0x5e96('0x30')]=_[_0x5e96('0x31')](_0xc5d2c5[_0x5e96('0x30')]);_0xb645da[_0x5e96('0x32')]=_['intersection'](_0xb645da['model'],_0xb645da[_0x5e96('0x30')]);_0x1ab17d[_0x5e96('0x33')]=_[_0x5e96('0x34')](_0xb645da[_0x5e96('0x35')],qs[_0x5e96('0x36')](_0xc5d2c5[_0x5e96('0x30')][_0x5e96('0x36')]));_0x1ab17d['attributes']=_0x1ab17d[_0x5e96('0x33')][_0x5e96('0x37')]?_0x1ab17d['attributes']:_0xb645da[_0x5e96('0x35')];if(!_0xc5d2c5[_0x5e96('0x30')]['hasOwnProperty'](_0x5e96('0x38'))){_0x1ab17d[_0x5e96('0x1b')]=qs[_0x5e96('0x1b')](_0xc5d2c5[_0x5e96('0x30')][_0x5e96('0x1b')]);_0x1ab17d['offset']=qs[_0x5e96('0x19')](_0xc5d2c5[_0x5e96('0x30')]['offset']);}_0x1ab17d[_0x5e96('0x39')]=qs[_0x5e96('0x3a')](_0xc5d2c5['query'][_0x5e96('0x3a')]);_0x1ab17d['where']=qs[_0x5e96('0x32')](_[_0x5e96('0x3b')](_0xc5d2c5[_0x5e96('0x30')],_0xb645da[_0x5e96('0x32')]),_0x15fbab);if(_0xc5d2c5[_0x5e96('0x30')][_0x5e96('0x3c')]){_0x1ab17d['where']=_['merge'](_0x1ab17d['where'],{'$or':_['map'](_0x15fbab,function(_0x8390f2){if(_0x8390f2[_0x5e96('0x2e')]!=='VIRTUAL'){var _0x30dea9={};_0x30dea9[_0x8390f2[_0x5e96('0x29')]]={'$like':'%'+_0xc5d2c5[_0x5e96('0x30')][_0x5e96('0x3c')]+'%'};return _0x30dea9;}})});}_0x1ab17d=_[_0x5e96('0x3d')]({},_0x1ab17d,_0xc5d2c5[_0x5e96('0x3e')]);var _0x3f6e19={'where':_0x1ab17d[_0x5e96('0x3f')]};return db['Trigger'][_0x5e96('0x1c')](_0x3f6e19)[_0x5e96('0x22')](function(_0x1da97e){_0x5f1900[_0x5e96('0x1c')]=_0x1da97e;if(_0xc5d2c5[_0x5e96('0x30')]['includeAll']){_0x1ab17d[_0x5e96('0x40')]=[{'all':!![]}];}return db[_0x5e96('0x2c')][_0x5e96('0x41')](_0x1ab17d);})[_0x5e96('0x22')](function(_0x12447d){_0x5f1900[_0x5e96('0x42')]=_0x12447d;return _0x5f1900;})[_0x5e96('0x22')](respondWithFilteredResult(_0x53b7cb,_0x1ab17d))[_0x5e96('0x43')](handleError(_0x53b7cb,null));};exports[_0x5e96('0x44')]=function(_0x2ed0ba,_0x3dfad3){var _0x8d9bcb={'raw':![],'where':{'id':_0x2ed0ba[_0x5e96('0x45')]['id']}},_0x3a74b0={};_0x3a74b0[_0x5e96('0x35')]=_[_0x5e96('0x31')](db[_0x5e96('0x2c')][_0x5e96('0x2d')]);_0x3a74b0[_0x5e96('0x30')]=_[_0x5e96('0x31')](_0x2ed0ba[_0x5e96('0x30')]);_0x3a74b0['filters']=_[_0x5e96('0x34')](_0x3a74b0[_0x5e96('0x35')],_0x3a74b0[_0x5e96('0x30')]);_0x8d9bcb[_0x5e96('0x33')]=_['intersection'](_0x3a74b0['model'],qs[_0x5e96('0x36')](_0x2ed0ba[_0x5e96('0x30')][_0x5e96('0x36')]));_0x8d9bcb[_0x5e96('0x33')]=_0x8d9bcb[_0x5e96('0x33')]['length']?_0x8d9bcb[_0x5e96('0x33')]:_0x3a74b0[_0x5e96('0x35')];if(_0x2ed0ba[_0x5e96('0x30')][_0x5e96('0x46')]){_0x8d9bcb[_0x5e96('0x40')]=[{'all':!![]}];}_0x8d9bcb=_['merge']({},_0x8d9bcb,_0x2ed0ba['options']);return db[_0x5e96('0x2c')][_0x5e96('0x47')](_0x8d9bcb)[_0x5e96('0x22')](handleEntityNotFound(_0x3dfad3,null))[_0x5e96('0x22')](respondWithResult(_0x3dfad3,null))[_0x5e96('0x43')](handleError(_0x3dfad3,null));};exports[_0x5e96('0x48')]=function(_0x2be2a3,_0x126cdd){return db['Trigger'][_0x5e96('0x48')](_0x2be2a3[_0x5e96('0x49')],{})[_0x5e96('0x22')](function(_0x349556){var _0x41435c=_0x2be2a3['user'][_0x5e96('0x24')]({'plain':!![]});if(!_0x41435c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41435c[_0x5e96('0x4a')]===_0x5e96('0x4b')){var _0x6b6380=_0x349556[_0x5e96('0x24')]({'plain':!![]});var _0x11c17d='Triggers';return db['UserProfileSection'][_0x5e96('0x47')]({'where':{'name':_0x11c17d,'userProfileId':_0x41435c['userProfileId']},'raw':!![]})[_0x5e96('0x22')](function(_0x2debdf){if(_0x2debdf&&_0x2debdf[_0x5e96('0x4c')]===0x0){return db[_0x5e96('0x25')]['create']({'name':_0x6b6380[_0x5e96('0x29')],'resourceId':_0x6b6380['id'],'type':_0x2debdf['name'],'sectionId':_0x2debdf['id']},{})['then'](function(){return _0x349556;});}else{return _0x349556;}})[_0x5e96('0x43')](function(_0x5cfc33){logger[_0x5e96('0x27')](_0x5e96('0x4d'),_0x5cfc33);throw _0x5cfc33;});}return _0x349556;})[_0x5e96('0x22')](respondWithResult(_0x126cdd,0xc9))[_0x5e96('0x43')](handleError(_0x126cdd,null));};exports['update']=function(_0x86f42c,_0x4198be){if(_0x86f42c['body']['id']){delete _0x86f42c['body']['id'];}return db[_0x5e96('0x2c')]['find']({'where':{'id':_0x86f42c[_0x5e96('0x45')]['id']}})[_0x5e96('0x22')](handleEntityNotFound(_0x4198be,null))[_0x5e96('0x22')](saveUpdates(_0x86f42c['body'],null))[_0x5e96('0x22')](respondWithResult(_0x4198be,null))[_0x5e96('0x43')](handleError(_0x4198be,null));};exports[_0x5e96('0x23')]=function(_0x2a9b3a,_0x55a510){return db[_0x5e96('0x2c')][_0x5e96('0x47')]({'where':{'id':_0x2a9b3a[_0x5e96('0x45')]['id']}})[_0x5e96('0x22')](handleEntityNotFound(_0x55a510,null))[_0x5e96('0x22')](removeEntity(_0x55a510,null))['catch'](handleError(_0x55a510,null));};exports[_0x5e96('0x4e')]=function(_0xb9c7d6,_0x2f11d1,_0x441d78){if(_0xb9c7d6[_0x5e96('0x49')]['id']){delete _0xb9c7d6[_0x5e96('0x49')]['id'];}return db[_0x5e96('0x2c')][_0x5e96('0x47')]({'where':{'id':_0xb9c7d6['params']['id']}})['then'](handleEntityNotFound(_0x2f11d1,null))[_0x5e96('0x22')](function(_0x99e7b9){if(_0x99e7b9){_0xb9c7d6[_0x5e96('0x49')][_0x5e96('0x4f')]=_0x99e7b9['id'];return db[_0x5e96('0x50')]['create'](_0xb9c7d6[_0x5e96('0x49')]);}})[_0x5e96('0x22')](respondWithResult(_0x2f11d1,null))[_0x5e96('0x43')](handleError(_0x2f11d1,null));};exports[_0x5e96('0x51')]=function(_0x1b744a,_0x4306d6,_0x17a217){if(_0x1b744a[_0x5e96('0x49')]['id']){delete _0x1b744a['body']['id'];}return db['Trigger']['find']({'where':{'id':_0x1b744a[_0x5e96('0x45')]['id']}})[_0x5e96('0x22')](handleEntityNotFound(_0x4306d6,null))[_0x5e96('0x22')](function(_0x44f009){if(_0x44f009){_0x1b744a[_0x5e96('0x49')][_0x5e96('0x52')]=_0x44f009['id'];return db[_0x5e96('0x50')][_0x5e96('0x48')](_0x1b744a[_0x5e96('0x49')]);}})['then'](respondWithResult(_0x4306d6,null))[_0x5e96('0x43')](handleError(_0x4306d6,null));};exports[_0x5e96('0x53')]=function(_0x4a23de,_0x5f1300,_0x35f274){var _0x44d821={};var _0x524268={};var _0x2ee9f3;var _0x16f7cb;return db['Trigger'][_0x5e96('0x54')]({'where':{'id':_0x4a23de[_0x5e96('0x45')]['id']}})[_0x5e96('0x22')](handleEntityNotFound(_0x5f1300,null))[_0x5e96('0x22')](function(_0x1cdff8){if(_0x1cdff8){_0x2ee9f3=_0x1cdff8;_0x524268['model']=_['keys'](db[_0x5e96('0x50')]['rawAttributes']);_0x524268[_0x5e96('0x30')]=_[_0x5e96('0x31')](_0x4a23de['query']);_0x524268[_0x5e96('0x32')]=_[_0x5e96('0x34')](_0x524268['model'],_0x524268['query']);_0x44d821[_0x5e96('0x33')]=_[_0x5e96('0x34')](_0x524268[_0x5e96('0x35')],qs[_0x5e96('0x36')](_0x4a23de[_0x5e96('0x30')][_0x5e96('0x36')]));_0x44d821[_0x5e96('0x33')]=_0x44d821[_0x5e96('0x33')][_0x5e96('0x37')]?_0x44d821['attributes']:_0x524268['model'];_0x44d821[_0x5e96('0x39')]=qs['sort'](_0x4a23de[_0x5e96('0x30')][_0x5e96('0x3a')]);_0x44d821['where']=qs[_0x5e96('0x32')](_['pick'](_0x4a23de['query'],_0x524268[_0x5e96('0x32')]));if(_0x4a23de[_0x5e96('0x30')][_0x5e96('0x3c')]){_0x44d821[_0x5e96('0x3f')]=_[_0x5e96('0x3d')](_0x44d821[_0x5e96('0x3f')],{'$or':_['map'](_0x44d821[_0x5e96('0x33')],function(_0x3dea3d){var _0x290de1={};_0x290de1[_0x3dea3d]={'$like':'%'+_0x4a23de[_0x5e96('0x30')][_0x5e96('0x3c')]+'%'};return _0x290de1;})});}_0x44d821=_['merge']({},_0x44d821,_0x4a23de[_0x5e96('0x3e')]);return _0x2ee9f3[_0x5e96('0x53')](_0x44d821);}})['then'](function(_0x5d09de){if(_0x5d09de){_0x16f7cb=_0x5d09de['length'];if(!_0x4a23de[_0x5e96('0x30')]['hasOwnProperty'](_0x5e96('0x38'))){_0x44d821['limit']=qs[_0x5e96('0x1b')](_0x4a23de[_0x5e96('0x30')]['limit']);_0x44d821[_0x5e96('0x19')]=qs['offset'](_0x4a23de[_0x5e96('0x30')][_0x5e96('0x19')]);}return _0x2ee9f3['getAllConditions'](_0x44d821);}})[_0x5e96('0x22')](function(_0x347249){if(_0x347249){return _0x347249?{'count':_0x16f7cb,'rows':_0x347249}:null;}})[_0x5e96('0x22')](respondWithResult(_0x5f1300,null))['catch'](handleError(_0x5f1300,null));};exports[_0x5e96('0x55')]=function(_0x2c0a16,_0x53c54a,_0x229fc0){var _0x8dc6fd={};var _0x345fdb={};var _0xfe943f;var _0x8c3318;return db[_0x5e96('0x2c')]['findOne']({'where':{'id':_0x2c0a16[_0x5e96('0x45')]['id']}})[_0x5e96('0x22')](handleEntityNotFound(_0x53c54a,null))[_0x5e96('0x22')](function(_0x1c7163){if(_0x1c7163){_0xfe943f=_0x1c7163;_0x345fdb[_0x5e96('0x35')]=_[_0x5e96('0x31')](db[_0x5e96('0x50')][_0x5e96('0x2d')]);_0x345fdb[_0x5e96('0x30')]=_[_0x5e96('0x31')](_0x2c0a16[_0x5e96('0x30')]);_0x345fdb[_0x5e96('0x32')]=_[_0x5e96('0x34')](_0x345fdb[_0x5e96('0x35')],_0x345fdb[_0x5e96('0x30')]);_0x8dc6fd[_0x5e96('0x33')]=_[_0x5e96('0x34')](_0x345fdb[_0x5e96('0x35')],qs['fields'](_0x2c0a16[_0x5e96('0x30')]['fields']));_0x8dc6fd[_0x5e96('0x33')]=_0x8dc6fd[_0x5e96('0x33')][_0x5e96('0x37')]?_0x8dc6fd[_0x5e96('0x33')]:_0x345fdb[_0x5e96('0x35')];_0x8dc6fd[_0x5e96('0x39')]=qs['sort'](_0x2c0a16[_0x5e96('0x30')][_0x5e96('0x3a')]);_0x8dc6fd[_0x5e96('0x3f')]=qs[_0x5e96('0x32')](_['pick'](_0x2c0a16[_0x5e96('0x30')],_0x345fdb[_0x5e96('0x32')]));if(_0x2c0a16[_0x5e96('0x30')]['filter']){_0x8dc6fd[_0x5e96('0x3f')]=_['merge'](_0x8dc6fd[_0x5e96('0x3f')],{'$or':_[_0x5e96('0x56')](_0x8dc6fd[_0x5e96('0x33')],function(_0x9b2709){var _0x2b1eb8={};_0x2b1eb8[_0x9b2709]={'$like':'%'+_0x2c0a16[_0x5e96('0x30')][_0x5e96('0x3c')]+'%'};return _0x2b1eb8;})});}_0x8dc6fd=_[_0x5e96('0x3d')]({},_0x8dc6fd,_0x2c0a16['options']);return _0xfe943f[_0x5e96('0x55')](_0x8dc6fd);}})[_0x5e96('0x22')](function(_0xd32155){if(_0xd32155){_0x8c3318=_0xd32155['length'];if(!_0x2c0a16['query'][_0x5e96('0x57')](_0x5e96('0x38'))){_0x8dc6fd['limit']=qs['limit'](_0x2c0a16[_0x5e96('0x30')][_0x5e96('0x1b')]);_0x8dc6fd[_0x5e96('0x19')]=qs[_0x5e96('0x19')](_0x2c0a16[_0x5e96('0x30')]['offset']);}return _0xfe943f[_0x5e96('0x55')](_0x8dc6fd);}})[_0x5e96('0x22')](function(_0x8a6a9c){if(_0x8a6a9c){return _0x8a6a9c?{'count':_0x8c3318,'rows':_0x8a6a9c}:null;}})[_0x5e96('0x22')](respondWithResult(_0x53c54a,null))['catch'](handleError(_0x53c54a,null));};exports[_0x5e96('0x58')]=function(_0x52df95,_0x2f3962,_0x5efa8f){if(_0x52df95[_0x5e96('0x49')]['id']){delete _0x52df95[_0x5e96('0x49')]['id'];}return db[_0x5e96('0x2c')]['find']({'where':{'id':_0x52df95[_0x5e96('0x45')]['id']}})[_0x5e96('0x22')](handleEntityNotFound(_0x2f3962,null))[_0x5e96('0x22')](function(_0x4a1717){if(_0x4a1717){_0x52df95[_0x5e96('0x49')][_0x5e96('0x59')]=_0x4a1717['id'];return db[_0x5e96('0x5a')][_0x5e96('0x48')](_0x52df95[_0x5e96('0x49')]);}})[_0x5e96('0x22')](respondWithResult(_0x2f3962,null))[_0x5e96('0x43')](handleError(_0x2f3962,null));};exports[_0x5e96('0x5b')]=function(_0x240462,_0x966868,_0x21c64f){var _0x19e40c={};var _0x3f3b6a={};var _0x2c085f;var _0x24be1d;return db[_0x5e96('0x2c')]['findOne']({'where':{'id':_0x240462['params']['id']}})[_0x5e96('0x22')](handleEntityNotFound(_0x966868,null))['then'](function(_0xf1a4e5){if(_0xf1a4e5){_0x2c085f=_0xf1a4e5;_0x3f3b6a[_0x5e96('0x35')]=_[_0x5e96('0x31')](db['Action'][_0x5e96('0x2d')]);_0x3f3b6a[_0x5e96('0x30')]=_['keys'](_0x240462[_0x5e96('0x30')]);_0x3f3b6a[_0x5e96('0x32')]=_['intersection'](_0x3f3b6a[_0x5e96('0x35')],_0x3f3b6a[_0x5e96('0x30')]);_0x19e40c['attributes']=_[_0x5e96('0x34')](_0x3f3b6a['model'],qs[_0x5e96('0x36')](_0x240462['query'][_0x5e96('0x36')]));_0x19e40c[_0x5e96('0x33')]=_0x19e40c['attributes'][_0x5e96('0x37')]?_0x19e40c[_0x5e96('0x33')]:_0x3f3b6a['model'];_0x19e40c[_0x5e96('0x39')]=qs[_0x5e96('0x3a')](_0x240462['query'][_0x5e96('0x3a')]);_0x19e40c[_0x5e96('0x3f')]=qs[_0x5e96('0x32')](_[_0x5e96('0x3b')](_0x240462[_0x5e96('0x30')],_0x3f3b6a['filters']));if(_0x240462['query']['filter']){_0x19e40c[_0x5e96('0x3f')]=_[_0x5e96('0x3d')](_0x19e40c[_0x5e96('0x3f')],{'$or':_[_0x5e96('0x56')](_0x19e40c[_0x5e96('0x33')],function(_0x4f598b){var _0x236db2={};_0x236db2[_0x4f598b]={'$like':'%'+_0x240462[_0x5e96('0x30')][_0x5e96('0x3c')]+'%'};return _0x236db2;})});}_0x19e40c=_[_0x5e96('0x3d')]({},_0x19e40c,_0x240462['options']);return _0x2c085f['getActions'](_0x19e40c);}})[_0x5e96('0x22')](function(_0xb2275e){if(_0xb2275e){_0x24be1d=_0xb2275e[_0x5e96('0x37')];if(!_0x240462[_0x5e96('0x30')][_0x5e96('0x57')](_0x5e96('0x38'))){_0x19e40c[_0x5e96('0x1b')]=qs['limit'](_0x240462[_0x5e96('0x30')][_0x5e96('0x1b')]);_0x19e40c[_0x5e96('0x19')]=qs['offset'](_0x240462['query'][_0x5e96('0x19')]);}return _0x2c085f[_0x5e96('0x5b')](_0x19e40c);}})[_0x5e96('0x22')](function(_0x211430){if(_0x211430){return _0x211430?{'count':_0x24be1d,'rows':_0x211430}:null;}})[_0x5e96('0x22')](respondWithResult(_0x966868,null))[_0x5e96('0x43')](handleError(_0x966868,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index c198b71..2250c8d 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 _0x303a=['bluebird','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','lodash','../../config/logger','api','moment'];(function(_0x47cc3e,_0x2dc2f8){var _0x72d849=function(_0x16a926){while(--_0x16a926){_0x47cc3e['push'](_0x47cc3e['shift']());}};_0x72d849(++_0x2dc2f8);}(_0x303a,0x1a0));var _0xa303=function(_0x5ad3cb,_0x4ff404){_0x5ad3cb=_0x5ad3cb-0x0;var _0xbea1e2=_0x303a[_0x5ad3cb];return _0xbea1e2;};'use strict';var _=require(_0xa303('0x0'));var util=require('util');var logger=require(_0xa303('0x1'))(_0xa303('0x2'));var moment=require(_0xa303('0x3'));var BPromise=require(_0xa303('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa303('0x5'));var rimraf=require(_0xa303('0x6'));var config=require(_0xa303('0x7'));var attributes=require(_0xa303('0x8'));module[_0xa303('0x9')]=function(_0x1c7ee9,_0x2bc3d7){return _0x1c7ee9[_0xa303('0xa')](_0xa303('0xb'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd82a=['rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x1c5da6,_0x140669){var _0x2ae01a=function(_0x243b04){while(--_0x243b04){_0x1c5da6['push'](_0x1c5da6['shift']());}};_0x2ae01a(++_0x140669);}(_0xd82a,0xbd));var _0xad82=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xd82a[_0x20589d];return _0x422de9;};'use strict';var _=require(_0xad82('0x0'));var util=require(_0xad82('0x1'));var logger=require(_0xad82('0x2'))(_0xad82('0x3'));var moment=require('moment');var BPromise=require(_0xad82('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xad82('0x5'));var rimraf=require(_0xad82('0x6'));var config=require(_0xad82('0x7'));var attributes=require(_0xad82('0x8'));module[_0xad82('0x9')]=function(_0x19e277,_0x343d52){return _0x19e277[_0xad82('0xa')](_0xad82('0xb'),attributes,{'tableName':_0xad82('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 43c4ecc..711c1d7 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 _0x6286=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','error','code','message','Trigger,\x20%s,\x20%s','GetTrigger','Trigger','options','raw','attributes','limit','include','map','model','stringify','catch','ShowTrigger','find','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x1b8e3c,_0x32e0e3){var _0x35aa7c=function(_0x5001be){while(--_0x5001be){_0x1b8e3c['push'](_0x1b8e3c['shift']());}};_0x35aa7c(++_0x32e0e3);}(_0x6286,0x1ea));var _0x6628=function(_0x169ef0,_0x5a60d9){_0x169ef0=_0x169ef0-0x0;var _0x497bba=_0x6286[_0x169ef0];return _0x497bba;};'use strict';var _=require(_0x6628('0x0'));var util=require(_0x6628('0x1'));var moment=require(_0x6628('0x2'));var BPromise=require('bluebird');var rs=require(_0x6628('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6628('0x4'))['db'];var utils=require(_0x6628('0x5'));var logger=require(_0x6628('0x6'))(_0x6628('0x7'));var config=require(_0x6628('0x8'));var jayson=require(_0x6628('0x9'));var client=jayson[_0x6628('0xa')][_0x6628('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25bb5d,_0x5b8875,_0x1a2c54){return new BPromise(function(_0x40c103,_0x3dd1e8){return client['request'](_0x25bb5d,_0x1a2c54)[_0x6628('0xc')](function(_0x1d8f71){logger[_0x6628('0xd')]('Trigger,\x20%s,\x20%s',_0x5b8875,_0x6628('0xe'));logger[_0x6628('0xf')]('Trigger,\x20%s,\x20%s,\x20%s',_0x5b8875,'request\x20sent',JSON['stringify'](_0x1d8f71));if(_0x1d8f71['error']){if(_0x1d8f71[_0x6628('0x10')][_0x6628('0x11')]===0x1f4){logger[_0x6628('0x10')]('Trigger,\x20%s,\x20%s',_0x5b8875,_0x1d8f71[_0x6628('0x10')][_0x6628('0x12')]);return _0x3dd1e8(_0x1d8f71['error']['message']);}logger[_0x6628('0x10')]('Trigger,\x20%s,\x20%s',_0x5b8875,_0x1d8f71[_0x6628('0x10')][_0x6628('0x12')]);return _0x40c103(_0x1d8f71['error'][_0x6628('0x12')]);}else{logger[_0x6628('0xd')](_0x6628('0x13'),_0x5b8875,_0x6628('0xe'));_0x40c103(_0x1d8f71['result']['message']);}})['catch'](function(_0x149773){logger[_0x6628('0x10')](_0x6628('0x13'),_0x5b8875,_0x149773);_0x3dd1e8(_0x149773);});});}exports[_0x6628('0x14')]=function(_0x26709d){var _0x19e6b9=this;return new Promise(function(_0x4524a8,_0x33cbc1){return db[_0x6628('0x15')]['findAll']({'raw':_0x26709d[_0x6628('0x16')]?_0x26709d[_0x6628('0x16')][_0x6628('0x17')]===undefined?!![]:![]:!![],'where':_0x26709d[_0x6628('0x16')]?_0x26709d[_0x6628('0x16')]['where']||null:null,'attributes':_0x26709d[_0x6628('0x16')]?_0x26709d[_0x6628('0x16')][_0x6628('0x18')]||null:null,'limit':_0x26709d[_0x6628('0x16')]?_0x26709d[_0x6628('0x16')][_0x6628('0x19')]||null:null,'include':_0x26709d[_0x6628('0x16')]?_0x26709d[_0x6628('0x16')][_0x6628('0x1a')]?_[_0x6628('0x1b')](_0x26709d[_0x6628('0x16')][_0x6628('0x1a')],function(_0x428b58){return{'model':db[_0x428b58['model']],'as':_0x428b58['as'],'attributes':_0x428b58[_0x6628('0x18')],'include':_0x428b58[_0x6628('0x1a')]?_['map'](_0x428b58['include'],function(_0x52dc00){return{'model':db[_0x52dc00[_0x6628('0x1c')]],'as':_0x52dc00['as'],'attributes':_0x52dc00[_0x6628('0x18')],'include':_0x52dc00['include']?_[_0x6628('0x1b')](_0x52dc00['include'],function(_0x13d56d){return{'model':db[_0x13d56d[_0x6628('0x1c')]],'as':_0x13d56d['as'],'attributes':_0x13d56d[_0x6628('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x488fa0){logger[_0x6628('0xd')](_0x6628('0x14'),_0x26709d);logger[_0x6628('0xf')](_0x6628('0x14'),_0x26709d,JSON[_0x6628('0x1d')](_0x488fa0));_0x4524a8(_0x488fa0);})[_0x6628('0x1e')](function(_0x3ed81a){logger[_0x6628('0x10')]('GetTrigger',_0x3ed81a[_0x6628('0x12')],_0x26709d);_0x33cbc1(_0x19e6b9[_0x6628('0x10')](0x1f4,_0x3ed81a[_0x6628('0x12')]));});});};exports[_0x6628('0x1f')]=function(_0x323c47){var _0x50b67b=this;return new Promise(function(_0x175573,_0x485657){return db[_0x6628('0x15')][_0x6628('0x20')]({'raw':_0x323c47[_0x6628('0x16')]?_0x323c47[_0x6628('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x323c47[_0x6628('0x16')]?_0x323c47[_0x6628('0x16')]['where']||null:null,'attributes':_0x323c47['options']?_0x323c47[_0x6628('0x16')][_0x6628('0x18')]||null:null,'include':_0x323c47['options']?_0x323c47[_0x6628('0x16')]['include']?_[_0x6628('0x1b')](_0x323c47[_0x6628('0x16')][_0x6628('0x1a')],function(_0x5448a2){return{'model':db[_0x5448a2[_0x6628('0x1c')]],'as':_0x5448a2['as'],'attributes':_0x5448a2[_0x6628('0x18')],'include':_0x5448a2[_0x6628('0x1a')]?_['map'](_0x5448a2[_0x6628('0x1a')],function(_0x466452){return{'model':db[_0x466452[_0x6628('0x1c')]],'as':_0x466452['as'],'attributes':_0x466452[_0x6628('0x18')],'include':_0x466452['include']?_[_0x6628('0x1b')](_0x466452['include'],function(_0x9c7494){return{'model':db[_0x9c7494[_0x6628('0x1c')]],'as':_0x9c7494['as'],'attributes':_0x9c7494[_0x6628('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6628('0xc')](function(_0x6139a0){logger[_0x6628('0xd')](_0x6628('0x1f'),_0x323c47);logger[_0x6628('0xf')](_0x6628('0x1f'),_0x323c47,JSON[_0x6628('0x1d')](_0x6139a0));_0x175573(_0x6139a0);})['catch'](function(_0x280886){logger[_0x6628('0x10')](_0x6628('0x1f'),_0x280886[_0x6628('0x12')],_0x323c47);_0x485657(_0x50b67b[_0x6628('0x10')](0x1f4,_0x280886[_0x6628('0x12')]));});});}; \ No newline at end of file +var _0xf737=['debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetTrigger','findAll','options','raw','where','attributes','limit','include','map','model','ShowTrigger','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','Trigger,\x20%s,\x20%s','request\x20sent'];(function(_0x2d2844,_0x363974){var _0x142331=function(_0x3e4635){while(--_0x3e4635){_0x2d2844['push'](_0x2d2844['shift']());}};_0x142331(++_0x363974);}(_0xf737,0x7e));var _0x7f73=function(_0x5061ff,_0x314c19){_0x5061ff=_0x5061ff-0x0;var _0x35ba91=_0xf737[_0x5061ff];return _0x35ba91;};'use strict';var _=require(_0x7f73('0x0'));var util=require(_0x7f73('0x1'));var moment=require(_0x7f73('0x2'));var BPromise=require(_0x7f73('0x3'));var rs=require(_0x7f73('0x4'));var fs=require('fs');var Redis=require(_0x7f73('0x5'));var db=require(_0x7f73('0x6'))['db'];var utils=require(_0x7f73('0x7'));var logger=require('../../config/logger')(_0x7f73('0x8'));var config=require('../../config/environment');var jayson=require(_0x7f73('0x9'));var client=jayson[_0x7f73('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x335612,_0x4a1198,_0x2a29ae){return new BPromise(function(_0x4f30c1,_0x120230){return client['request'](_0x335612,_0x2a29ae)[_0x7f73('0xb')](function(_0x4585e0){logger['info'](_0x7f73('0xc'),_0x4a1198,_0x7f73('0xd'));logger[_0x7f73('0xe')](_0x7f73('0xf'),_0x4a1198,_0x7f73('0xd'),JSON[_0x7f73('0x10')](_0x4585e0));if(_0x4585e0[_0x7f73('0x11')]){if(_0x4585e0['error'][_0x7f73('0x12')]===0x1f4){logger[_0x7f73('0x11')](_0x7f73('0xc'),_0x4a1198,_0x4585e0['error'][_0x7f73('0x13')]);return _0x120230(_0x4585e0['error'][_0x7f73('0x13')]);}logger[_0x7f73('0x11')](_0x7f73('0xc'),_0x4a1198,_0x4585e0[_0x7f73('0x11')][_0x7f73('0x13')]);return _0x4f30c1(_0x4585e0[_0x7f73('0x11')]['message']);}else{logger[_0x7f73('0x14')](_0x7f73('0xc'),_0x4a1198,_0x7f73('0xd'));_0x4f30c1(_0x4585e0[_0x7f73('0x15')][_0x7f73('0x13')]);}})[_0x7f73('0x16')](function(_0x1c2791){logger[_0x7f73('0x11')]('Trigger,\x20%s,\x20%s',_0x4a1198,_0x1c2791);_0x120230(_0x1c2791);});});}exports[_0x7f73('0x17')]=function(_0x4d5627){var _0x2dfa84=this;return new Promise(function(_0x439dc5,_0x32f9d6){return db['Trigger'][_0x7f73('0x18')]({'raw':_0x4d5627[_0x7f73('0x19')]?_0x4d5627[_0x7f73('0x19')][_0x7f73('0x1a')]===undefined?!![]:![]:!![],'where':_0x4d5627[_0x7f73('0x19')]?_0x4d5627[_0x7f73('0x19')][_0x7f73('0x1b')]||null:null,'attributes':_0x4d5627[_0x7f73('0x19')]?_0x4d5627[_0x7f73('0x19')][_0x7f73('0x1c')]||null:null,'limit':_0x4d5627['options']?_0x4d5627[_0x7f73('0x19')][_0x7f73('0x1d')]||null:null,'include':_0x4d5627[_0x7f73('0x19')]?_0x4d5627[_0x7f73('0x19')][_0x7f73('0x1e')]?_[_0x7f73('0x1f')](_0x4d5627[_0x7f73('0x19')][_0x7f73('0x1e')],function(_0x119d13){return{'model':db[_0x119d13[_0x7f73('0x20')]],'as':_0x119d13['as'],'attributes':_0x119d13[_0x7f73('0x1c')],'include':_0x119d13[_0x7f73('0x1e')]?_[_0x7f73('0x1f')](_0x119d13[_0x7f73('0x1e')],function(_0x597fba){return{'model':db[_0x597fba['model']],'as':_0x597fba['as'],'attributes':_0x597fba[_0x7f73('0x1c')],'include':_0x597fba[_0x7f73('0x1e')]?_[_0x7f73('0x1f')](_0x597fba[_0x7f73('0x1e')],function(_0x5c92d4){return{'model':db[_0x5c92d4[_0x7f73('0x20')]],'as':_0x5c92d4['as'],'attributes':_0x5c92d4[_0x7f73('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7f73('0xb')](function(_0x122b4f){logger[_0x7f73('0x14')]('GetTrigger',_0x4d5627);logger[_0x7f73('0xe')](_0x7f73('0x17'),_0x4d5627,JSON[_0x7f73('0x10')](_0x122b4f));_0x439dc5(_0x122b4f);})[_0x7f73('0x16')](function(_0x4e60ed){logger[_0x7f73('0x11')]('GetTrigger',_0x4e60ed[_0x7f73('0x13')],_0x4d5627);_0x32f9d6(_0x2dfa84[_0x7f73('0x11')](0x1f4,_0x4e60ed[_0x7f73('0x13')]));});});};exports[_0x7f73('0x21')]=function(_0x20cbe9){var _0x1c8fd5=this;return new Promise(function(_0x17ed7f,_0x34daf4){return db['Trigger'][_0x7f73('0x22')]({'raw':_0x20cbe9['options']?_0x20cbe9[_0x7f73('0x19')][_0x7f73('0x1a')]===undefined?!![]:![]:!![],'where':_0x20cbe9[_0x7f73('0x19')]?_0x20cbe9[_0x7f73('0x19')][_0x7f73('0x1b')]||null:null,'attributes':_0x20cbe9[_0x7f73('0x19')]?_0x20cbe9[_0x7f73('0x19')]['attributes']||null:null,'include':_0x20cbe9[_0x7f73('0x19')]?_0x20cbe9['options'][_0x7f73('0x1e')]?_['map'](_0x20cbe9[_0x7f73('0x19')][_0x7f73('0x1e')],function(_0x5807f6){return{'model':db[_0x5807f6[_0x7f73('0x20')]],'as':_0x5807f6['as'],'attributes':_0x5807f6[_0x7f73('0x1c')],'include':_0x5807f6[_0x7f73('0x1e')]?_['map'](_0x5807f6['include'],function(_0x564455){return{'model':db[_0x564455[_0x7f73('0x20')]],'as':_0x564455['as'],'attributes':_0x564455[_0x7f73('0x1c')],'include':_0x564455[_0x7f73('0x1e')]?_[_0x7f73('0x1f')](_0x564455[_0x7f73('0x1e')],function(_0x322f3c){return{'model':db[_0x322f3c['model']],'as':_0x322f3c['as'],'attributes':_0x322f3c[_0x7f73('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a9f10){logger['info'](_0x7f73('0x21'),_0x20cbe9);logger['debug'](_0x7f73('0x21'),_0x20cbe9,JSON[_0x7f73('0x10')](_0x3a9f10));_0x17ed7f(_0x3a9f10);})['catch'](function(_0x3bf29c){logger[_0x7f73('0x11')](_0x7f73('0x21'),_0x3bf29c['message'],_0x20cbe9);_0x34daf4(_0x1c8fd5[_0x7f73('0x11')](0x1f4,_0x3bf29c[_0x7f73('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 04969aa..7921c04 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 _0x1375=['../../config/environment','./trunk.controller','get','index','isAuthenticated','show','post','/:id/clone','clone','create','update','delete','/:id','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x7e306,_0x293879){var _0x3addab=function(_0x1755cc){while(--_0x1755cc){_0x7e306['push'](_0x7e306['shift']());}};_0x3addab(++_0x293879);}(_0x1375,0x16e));var _0x5137=function(_0x323db9,_0x142aa1){_0x323db9=_0x323db9-0x0;var _0x40842c=_0x1375[_0x323db9];return _0x40842c;};'use strict';var multer=require('multer');var util=require(_0x5137('0x0'));var path=require(_0x5137('0x1'));var timeout=require(_0x5137('0x2'));var express=require(_0x5137('0x3'));var router=express[_0x5137('0x4')]();var fs_extra=require(_0x5137('0x5'));var auth=require(_0x5137('0x6'));var interaction=require(_0x5137('0x7'));var config=require(_0x5137('0x8'));var controller=require(_0x5137('0x9'));router[_0x5137('0xa')]('/',auth['isAuthenticated'](),controller[_0x5137('0xb')]);router[_0x5137('0xa')]('/:id',auth[_0x5137('0xc')](),controller[_0x5137('0xd')]);router[_0x5137('0xe')](_0x5137('0xf'),auth[_0x5137('0xc')](),controller[_0x5137('0x10')]);router['post']('/',auth[_0x5137('0xc')](),controller[_0x5137('0x11')]);router['put']('/:id',auth[_0x5137('0xc')](),controller[_0x5137('0x12')]);router[_0x5137('0x13')](_0x5137('0x14'),auth[_0x5137('0xc')](),controller['destroy']);module[_0x5137('0x15')]=router; \ No newline at end of file +var _0x9a8c=['put','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','index','/:id','isAuthenticated','show','/:id/clone','clone','post','create'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x9a8c,0xd4));var _0xc9a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a8c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc9a8('0x0'));var util=require(_0xc9a8('0x1'));var path=require(_0xc9a8('0x2'));var timeout=require(_0xc9a8('0x3'));var express=require(_0xc9a8('0x4'));var router=express[_0xc9a8('0x5')]();var fs_extra=require(_0xc9a8('0x6'));var auth=require(_0xc9a8('0x7'));var interaction=require(_0xc9a8('0x8'));var config=require('../../config/environment');var controller=require(_0xc9a8('0x9'));router[_0xc9a8('0xa')]('/',auth['isAuthenticated'](),controller[_0xc9a8('0xb')]);router[_0xc9a8('0xa')](_0xc9a8('0xc'),auth[_0xc9a8('0xd')](),controller[_0xc9a8('0xe')]);router['post'](_0xc9a8('0xf'),auth[_0xc9a8('0xd')](),controller[_0xc9a8('0x10')]);router[_0xc9a8('0x11')]('/',auth[_0xc9a8('0xd')](),controller[_0xc9a8('0x12')]);router[_0xc9a8('0x13')](_0xc9a8('0xc'),auth[_0xc9a8('0xd')](),controller['update']);router['delete'](_0xc9a8('0xc'),auth[_0xc9a8('0xd')](),controller['destroy']);module[_0xc9a8('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 54b7cff..943b0e4 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 _0xfc3e=['port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','originate','uac','uas','fingerprint','certificate','passive','update','BOOLEAN','sequelize','name','ENUM','friend','user','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','STRING','udp','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','shortinfo','inband','auto','yes','nonat','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'];(function(_0x246227,_0x12bfcb){var _0x37bd4a=function(_0x4670f4){while(--_0x4670f4){_0x246227['push'](_0x246227['shift']());}};_0x37bd4a(++_0x12bfcb);}(_0xfc3e,0x1b7));var _0xefc3=function(_0x516a3d,_0x270647){_0x516a3d=_0x516a3d-0x0;var _0x32f9eb=_0xfc3e[_0x516a3d];return _0x32f9eb;};'use strict';var Sequelize=require(_0xefc3('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xefc3('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x3'),_0xefc3('0x4'),'peer'),'allowNull':![],'defaultValue':_0xefc3('0x3')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x5'),_0xefc3('0x6'),_0xefc3('0x7'),_0xefc3('0x8'),_0xefc3('0x9'),_0xefc3('0xa'),'PROHIB_FAILED_SCREEN',_0xefc3('0xb'))},'deny':{'type':Sequelize[_0xefc3('0xc')]},'permit':{'type':Sequelize[_0xefc3('0xc')]},'secret':{'type':Sequelize[_0xefc3('0xc')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0xefc3('0xc')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xefc3('0xd'),'set':function(_0x3c26c4){this['setDataValue']('transport',_0x3c26c4?_0x3c26c4[_0xefc3('0xe')](','):null);},'get':function(){return this[_0xefc3('0xf')](_0xefc3('0x10'))?this[_0xefc3('0xf')](_0xefc3('0x10'))[_0xefc3('0x11')](','):null;},'comment':_0xefc3('0x12')},'dtmfmode':{'type':Sequelize[_0xefc3('0x2')]('rfc2833','info',_0xefc3('0x13'),_0xefc3('0x14'),_0xefc3('0x15')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no',_0xefc3('0x17'),'update','outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xefc3('0xc')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xefc3('0xc')],'defaultValue':_0xefc3('0x18'),'set':function(_0x585b77){this[_0xefc3('0x19')](_0xefc3('0x1a'),_0x585b77?_0x585b77[_0xefc3('0xe')](','):null);},'get':function(){return this[_0xefc3('0xf')](_0xefc3('0x1a'))?this['getDataValue'](_0xefc3('0x1a'))['split'](','):null;},'comment':_0xefc3('0x1b')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xefc3('0xc')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xefc3('0xc')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xefc3('0xc')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xefc3('0xc')],'defaultValue':'all'},'allow':{'type':Sequelize[_0xefc3('0xc')],'allowNull':![],'defaultValue':_0xefc3('0x1c'),'set':function(_0xdd9ea8){this[_0xefc3('0x19')](_0xefc3('0x1d'),_0xdd9ea8?_0xdd9ea8['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xefc3('0xf')](_0xefc3('0x1d'))?this[_0xefc3('0xf')]('allow')[_0xefc3('0x11')](';'):null;},'comment':_0xefc3('0x1e')},'autoframing':{'type':Sequelize['ENUM'](_0xefc3('0x16'),'no')},'insecure':{'type':Sequelize[_0xefc3('0xc')],'defaultValue':_0xefc3('0x1f'),'set':function(_0x19ad09){this[_0xefc3('0x19')](_0xefc3('0x20'),_0x19ad09?_0x19ad09[_0xefc3('0xe')](','):null);},'get':function(){return this['getDataValue'](_0xefc3('0x20'))?this['getDataValue'](_0xefc3('0x20'))[_0xefc3('0x11')](','):null;},'comment':_0xefc3('0x21')},'trustrpid':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xefc3('0x16'),'no',_0xefc3('0x22'))},'promiscredir':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize[_0xefc3('0x23')](0xb)},'setvar':{'type':Sequelize[_0xefc3('0xc')]},'callerid':{'type':Sequelize[_0xefc3('0xc')],'defaultValue':_0xefc3('0x24')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM'](_0xefc3('0x16'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xefc3('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0xefc3('0xc')]},'template':{'type':Sequelize[_0xefc3('0xc')]},'videosupport':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no',_0xefc3('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x26'),'refuse',_0xefc3('0x27'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xefc3('0x23')](0xb)},'session_refresher':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x28'),_0xefc3('0x29')),'defaultValue':_0xefc3('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0xefc3('0xc')]},'regexten':{'type':Sequelize[_0xefc3('0xc')]},'fromdomain':{'type':Sequelize[_0xefc3('0xc')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xefc3('0x23')](0x5)},'qualify':{'type':Sequelize[_0xefc3('0x2')]('yes','no'),'defaultValue':_0xefc3('0x16')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xefc3('0xc')]},'rtptimeout':{'type':Sequelize[_0xefc3('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xefc3('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xefc3('0x23')](0xb)},'sendrpid':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xefc3('0xc')]},'callbackextension':{'type':Sequelize[_0xefc3('0xc')]},'timert1':{'type':Sequelize[_0xefc3('0x23')](0xb)},'timerb':{'type':Sequelize[_0xefc3('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0xefc3('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0xefc3('0xc')]},'contactdeny':{'type':Sequelize[_0xefc3('0xc')]},'contactacl':{'type':Sequelize[_0xefc3('0xc')]},'unsolicited_mailbox':{'type':Sequelize[_0xefc3('0xc')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xefc3('0x23')](0xb)},'encryption':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0xefc3('0x16'),'no')},'icesupport':{'type':Sequelize['ENUM']('yes','no')},'dtlsenable':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xefc3('0x16'),'no',_0xefc3('0x2a'),_0xefc3('0x2b'))},'dtlsrekey':{'type':Sequelize[_0xefc3('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0xefc3('0xc')]},'dtlsprivatekey':{'type':Sequelize[_0xefc3('0xc')]},'dtlscipher':{'type':Sequelize[_0xefc3('0xc')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0xefc3('0xc')]},'dtlssetup':{'type':Sequelize[_0xefc3('0x2')]('active',_0xefc3('0x2c'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xefc3('0xc')]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xefc3('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xefc3('0x2')]('yes','no')},'subscribemwi':{'type':Sequelize[_0xefc3('0x2')](_0xefc3('0x16'),'no')},'vmexten':{'type':Sequelize[_0xefc3('0xc')]},'mohinterpret':{'type':Sequelize[_0xefc3('0xc')]},'mohsuggest':{'type':Sequelize[_0xefc3('0xc')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xefc3('0xc')]},'host':{'type':Sequelize[_0xefc3('0xc')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM'](_0xefc3('0x16'),'no','nonat',_0xefc3('0x2d'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xefc3('0xc')]},'otherFields':{'type':Sequelize[_0xefc3('0xc')]},'active':{'type':Sequelize[_0xefc3('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xefc3('0xc')],'defaultValue':'no'}}; \ No newline at end of file +var _0x5429=['update','outgoing','yes','force_rport,comedia','join','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','actpass','dynamic','nonat','update,nonat','exports','STRING','name','ENUM','friend','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5429,0x88));var _0x9542=function(_0x1793de,_0x4d7233){_0x1793de=_0x1793de-0x0;var _0x4f0309=_0x5429[_0x1793de];return _0x4f0309;};'use strict';var Sequelize=require('sequelize');module[_0x9542('0x0')]={'name':{'type':Sequelize[_0x9542('0x1')],'allowNull':![],'unique':_0x9542('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x4'),'user',_0x9542('0x5')),'allowNull':![],'defaultValue':_0x9542('0x4')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9542('0x6')},'callingpres':{'type':Sequelize['ENUM'](_0x9542('0x7'),_0x9542('0x8'),_0x9542('0x9'),_0x9542('0xa'),_0x9542('0xb'),_0x9542('0xc'),_0x9542('0xd'),_0x9542('0xe'))},'deny':{'type':Sequelize[_0x9542('0x1')]},'permit':{'type':Sequelize[_0x9542('0x1')]},'secret':{'type':Sequelize[_0x9542('0x1')]},'md5secret':{'type':Sequelize[_0x9542('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x9542('0x1')],'defaultValue':_0x9542('0xf'),'set':function(_0x5149be){this[_0x9542('0x10')](_0x9542('0x11'),_0x5149be?_0x5149be['join'](','):null);},'get':function(){return this[_0x9542('0x12')](_0x9542('0x11'))?this['getDataValue'](_0x9542('0x11'))[_0x9542('0x13')](','):null;},'comment':_0x9542('0x14')},'dtmfmode':{'type':Sequelize[_0x9542('0x3')]('rfc2833',_0x9542('0x15'),_0x9542('0x16'),_0x9542('0x17'),_0x9542('0x18')),'defaultValue':_0x9542('0x19')},'directmedia':{'type':Sequelize[_0x9542('0x3')]('yes','no','nonat',_0x9542('0x1a'),_0x9542('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x9542('0x1c'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9542('0x1')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x9542('0x1')],'defaultValue':_0x9542('0x1d'),'set':function(_0x4d52f6){this[_0x9542('0x10')]('nat',_0x4d52f6?_0x4d52f6[_0x9542('0x1e')](','):null);},'get':function(){return this['getDataValue'](_0x9542('0x1f'))?this[_0x9542('0x12')](_0x9542('0x1f'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x9542('0x1')]},'namedcallgroup':{'type':Sequelize[_0x9542('0x1')]},'pickupgroup':{'type':Sequelize[_0x9542('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x9542('0x1')]},'language':{'type':Sequelize[_0x9542('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9542('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x9542('0x1')],'defaultValue':_0x9542('0x20')},'allow':{'type':Sequelize[_0x9542('0x1')],'allowNull':![],'defaultValue':_0x9542('0x21'),'set':function(_0x46e6f7){this[_0x9542('0x10')]('allow',_0x46e6f7?_0x46e6f7[_0x9542('0x1e')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x9542('0x12')]('allow')?this[_0x9542('0x12')](_0x9542('0x22'))['split'](';'):null;},'comment':_0x9542('0x23')},'autoframing':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no')},'insecure':{'type':Sequelize[_0x9542('0x1')],'defaultValue':_0x9542('0x24'),'set':function(_0x33c853){this['setDataValue'](_0x9542('0x25'),_0x33c853?_0x33c853[_0x9542('0x1e')](','):null);},'get':function(){return this[_0x9542('0x12')](_0x9542('0x25'))?this[_0x9542('0x12')](_0x9542('0x25'))[_0x9542('0x13')](','):null;},'comment':_0x9542('0x26')},'trustrpid':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x9542('0x1c'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x9542('0x1c'),'no',_0x9542('0x27'))},'promiscredir':{'type':Sequelize['ENUM'](_0x9542('0x1c'),'no')},'useclientcode':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no')},'accountcode':{'type':Sequelize[_0x9542('0x28')](0xb)},'setvar':{'type':Sequelize[_0x9542('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x9542('0x1')]},'callcounter':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x9542('0x28')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x9542('0x1c'),'no')},'allowsubscribe':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no')},'allowtransfer':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x9542('0x1c'),'no')},'subscribecontext':{'type':Sequelize[_0x9542('0x1')]},'template':{'type':Sequelize[_0x9542('0x1')]},'videosupport':{'type':Sequelize[_0x9542('0x3')]('yes','no',_0x9542('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9542('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no')},'mailbox':{'type':Sequelize[_0x9542('0x1')]},'session_timers':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x2a'),_0x9542('0x2b'),_0x9542('0x2c'))},'session_expires':{'type':Sequelize[_0x9542('0x28')](0xb)},'session_minse':{'type':Sequelize[_0x9542('0x28')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x9542('0x2d'),'uas'),'defaultValue':_0x9542('0x2e')},'t38pt_usertpsource':{'type':Sequelize[_0x9542('0x1')]},'regexten':{'type':Sequelize[_0x9542('0x1')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x9542('0x1')]},'port':{'type':Sequelize[_0x9542('0x28')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x9542('0x1c')},'keepalive':{'type':Sequelize[_0x9542('0x28')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x9542('0x1')]},'rtptimeout':{'type':Sequelize[_0x9542('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x9542('0x28')](0xb)},'sendrpid':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9542('0x1')]},'callbackextension':{'type':Sequelize[_0x9542('0x1')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x9542('0x28')](0xb)},'qualifyfreq':{'type':Sequelize[_0x9542('0x28')](0xb)},'contactpermit':{'type':Sequelize[_0x9542('0x1')]},'contactdeny':{'type':Sequelize[_0x9542('0x1')]},'contactacl':{'type':Sequelize[_0x9542('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x9542('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x9542('0x28')](0xb)},'encryption':{'type':Sequelize[_0x9542('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x9542('0x1c'),'no')},'icesupport':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x9542('0x1c'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x9542('0x1c'),'no',_0x9542('0x2f'),_0x9542('0x30'))},'dtlsrekey':{'type':Sequelize[_0x9542('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0x9542('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x9542('0x1')]},'dtlscapath':{'type':Sequelize[_0x9542('0x1')]},'dtlssetup':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x31'),'passive',_0x9542('0x32')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9542('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x9542('0x28')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x9542('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x9542('0x3')](_0x9542('0x1c'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x9542('0x1')]},'mohsuggest':{'type':Sequelize[_0x9542('0x1')]},'parkinglot':{'type':Sequelize[_0x9542('0x1')]},'description':{'type':Sequelize[_0x9542('0x1')]},'host':{'type':Sequelize[_0x9542('0x1')],'defaultValue':_0x9542('0x33')},'canreinvite':{'type':Sequelize[_0x9542('0x3')]('yes','no',_0x9542('0x34'),_0x9542('0x1a'),_0x9542('0x35')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x9542('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'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 4b18521..e0b2172 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 _0xb821=['model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Trunk','includeAll','findAll','intersection','length','include','find','params','get','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','server/files/templates/trunk.ejs','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','root','rimraf','zip-dir','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','code','Trunk,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Trunks','name','send','index','rawAttributes','fieldName','key'];(function(_0x178728,_0x3257cd){var _0x17a2da=function(_0x2bbc66){while(--_0x2bbc66){_0x178728['push'](_0x178728['shift']());}};_0x17a2da(++_0x3257cd);}(_0xb821,0xa7));var _0x1b82=function(_0x522a1a,_0x12daa5){_0x522a1a=_0x522a1a-0x0;var _0x116d7c=_0xb821[_0x522a1a];return _0x116d7c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b82('0x0'));var zipdir=require(_0x1b82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1b82('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1b82('0x3'));var path=require(_0x1b82('0x4'));var sox=require(_0x1b82('0x5'));var csv=require(_0x1b82('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b82('0x7'));var _=require(_0x1b82('0x8'));var squel=require(_0x1b82('0x9'));var crypto=require(_0x1b82('0xa'));var jsforce=require(_0x1b82('0xb'));var deskjs=require(_0x1b82('0xc'));var toCsv=require(_0x1b82('0x6'));var querystring=require(_0x1b82('0xd'));var Papa=require(_0x1b82('0xe'));var Redis=require('ioredis');var authService=require(_0x1b82('0xf'));var qs=require(_0x1b82('0x10'));var as=require(_0x1b82('0x11'));var hardwareService=require(_0x1b82('0x12'));var logger=require(_0x1b82('0x13'))(_0x1b82('0x14'));var utils=require(_0x1b82('0x15'));var config=require(_0x1b82('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b82('0x17'))['db'];var jayson=require(_0x1b82('0x18'));var client=jayson[_0x1b82('0x19')][_0x1b82('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x50aed7,_0x1a6285,_0x5767aa,_0x54915f){return new BPromise(function(_0x1e553a,_0x4bf75b){var _0x1cffd1=_0x54915f||client;return _0x1cffd1[_0x1b82('0x1b')](_0x50aed7,_0x5767aa)['then'](function(_0x46c2cf){logger['info']('Trunk,\x20%s,\x20%s',_0x1a6285,_0x1b82('0x1c'));logger['debug'](_0x1b82('0x1d'),_0x1a6285,_0x1b82('0x1c'),JSON[_0x1b82('0x1e')](_0x46c2cf));if(_0x46c2cf['error']){if(_0x46c2cf['error'][_0x1b82('0x1f')]===0x1f4){logger['error'](_0x1b82('0x20'),_0x1a6285,_0x46c2cf[_0x1b82('0x21')][_0x1b82('0x22')]);return _0x4bf75b(_0x46c2cf['error'][_0x1b82('0x22')]);}logger[_0x1b82('0x21')](_0x1b82('0x20'),_0x1a6285,_0x46c2cf[_0x1b82('0x21')][_0x1b82('0x22')]);return _0x1e553a(_0x46c2cf['error'][_0x1b82('0x22')]);}else{logger[_0x1b82('0x23')](_0x1b82('0x20'),_0x1a6285,_0x1b82('0x1c'));_0x1e553a(_0x46c2cf[_0x1b82('0x24')][_0x1b82('0x22')]);}})[_0x1b82('0x25')](function(_0x486e92){logger[_0x1b82('0x21')](_0x1b82('0x20'),_0x1a6285,_0x486e92);_0x4bf75b(_0x486e92);});});}function respondWithStatusCode(_0x5b8d09,_0x561d78){_0x561d78=_0x561d78||0xcc;return function(_0x225b81){if(_0x225b81){return _0x5b8d09[_0x1b82('0x26')](_0x561d78);}return _0x5b8d09['status'](_0x561d78)[_0x1b82('0x27')]();};}function respondWithResult(_0x4db690,_0x5cd458){_0x5cd458=_0x5cd458||0xc8;return function(_0x5f556b){if(_0x5f556b){return _0x4db690[_0x1b82('0x28')](_0x5cd458)[_0x1b82('0x29')](_0x5f556b);}};}function respondWithFilteredResult(_0xfd00d1,_0x257b79){return function(_0x548a3b){if(_0x548a3b){var _0x222483=typeof _0x257b79[_0x1b82('0x2a')]===_0x1b82('0x2b')&&typeof _0x257b79[_0x1b82('0x2c')]===_0x1b82('0x2b');var _0x1b8b6f=_0x548a3b[_0x1b82('0x2d')];var _0x21ea34=_0x222483?0x0:_0x257b79[_0x1b82('0x2a')];var _0x1f9c6b=_0x222483?_0x548a3b[_0x1b82('0x2d')]:_0x257b79[_0x1b82('0x2a')]+_0x257b79[_0x1b82('0x2c')];var _0x5ea890;if(_0x1f9c6b>=_0x1b8b6f){_0x1f9c6b=_0x1b8b6f;_0x5ea890=0xc8;}else{_0x5ea890=0xce;}_0xfd00d1[_0x1b82('0x28')](_0x5ea890);return _0xfd00d1[_0x1b82('0x2e')](_0x1b82('0x2f'),_0x21ea34+'-'+_0x1f9c6b+'/'+_0x1b8b6f)[_0x1b82('0x29')](_0x548a3b);}return null;};}function patchUpdates(_0x18e4ff){return function(_0x115ce7){try{jsonpatch[_0x1b82('0x30')](_0x115ce7,_0x18e4ff,!![]);}catch(_0x46575f){return BPromise[_0x1b82('0x31')](_0x46575f);}return _0x115ce7[_0x1b82('0x32')]();};}function saveUpdates(_0x501ab0,_0x225c06){return function(_0x29a31e){if(_0x29a31e){return _0x29a31e[_0x1b82('0x33')](_0x501ab0)[_0x1b82('0x34')](function(_0x5b7b18){return _0x5b7b18;});}return null;};}function removeEntity(_0x474218,_0xbf65a){return function(_0x544bd5){if(_0x544bd5){return _0x544bd5[_0x1b82('0x35')]()[_0x1b82('0x34')](function(){var _0x365c3c=_0x544bd5['get']({'plain':!![]});var _0x5efb8e=_0x1b82('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x5efb8e,'resourceId':_0x365c3c['id']}})[_0x1b82('0x34')](function(){return _0x544bd5;});})[_0x1b82('0x34')](function(){_0x474218[_0x1b82('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42a64e,_0x366db3){return function(_0xea774a){if(!_0xea774a){_0x42a64e[_0x1b82('0x26')](0x194);}return _0xea774a;};}function handleError(_0x4dd64a,_0x42c1c4){_0x42c1c4=_0x42c1c4||0x1f4;return function(_0x1cd7de){logger[_0x1b82('0x21')](_0x1cd7de['stack']);if(_0x1cd7de['name']){delete _0x1cd7de[_0x1b82('0x37')];}_0x4dd64a['status'](_0x42c1c4)[_0x1b82('0x38')](_0x1cd7de);};}exports[_0x1b82('0x39')]=function(_0x286b4b,_0x348880){var _0x1255db={},_0x3ab35c={},_0x39fe4a={'count':0x0,'rows':[]};var _0x1368df=_['map'](db['Trunk'][_0x1b82('0x3a')],function(_0x5f4baf){return{'name':_0x5f4baf[_0x1b82('0x3b')],'type':_0x5f4baf['type'][_0x1b82('0x3c')]};});_0x3ab35c[_0x1b82('0x3d')]=_[_0x1b82('0x3e')](_0x1368df,_0x1b82('0x37'));_0x3ab35c[_0x1b82('0x3f')]=_[_0x1b82('0x40')](_0x286b4b['query']);_0x3ab35c[_0x1b82('0x41')]=_['intersection'](_0x3ab35c[_0x1b82('0x3d')],_0x3ab35c['query']);_0x1255db[_0x1b82('0x42')]=_['intersection'](_0x3ab35c['model'],qs[_0x1b82('0x43')](_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x1255db[_0x1b82('0x42')]=_0x1255db[_0x1b82('0x42')]['length']?_0x1255db[_0x1b82('0x42')]:_0x3ab35c['model'];if(!_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x44')](_0x1b82('0x45'))){_0x1255db[_0x1b82('0x2c')]=qs[_0x1b82('0x2c')](_0x286b4b['query'][_0x1b82('0x2c')]);_0x1255db['offset']=qs[_0x1b82('0x2a')](_0x286b4b[_0x1b82('0x3f')]['offset']);}_0x1255db[_0x1b82('0x46')]=qs[_0x1b82('0x47')](_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x47')]);_0x1255db[_0x1b82('0x48')]=qs[_0x1b82('0x41')](_[_0x1b82('0x49')](_0x286b4b['query'],_0x3ab35c[_0x1b82('0x41')]),_0x1368df);if(_0x286b4b['query'][_0x1b82('0x4a')]){_0x1255db[_0x1b82('0x48')]=_[_0x1b82('0x4b')](_0x1255db[_0x1b82('0x48')],{'$or':_[_0x1b82('0x3e')](_0x1368df,function(_0x1d24d6){if(_0x1d24d6[_0x1b82('0x4c')]!==_0x1b82('0x4d')){var _0x192ce3={};_0x192ce3[_0x1d24d6[_0x1b82('0x37')]]={'$like':'%'+_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x4a')]+'%'};return _0x192ce3;}})});}_0x1255db=_[_0x1b82('0x4b')]({},_0x1255db,_0x286b4b[_0x1b82('0x4e')]);var _0x4fb92f={'where':_0x1255db['where']};return db[_0x1b82('0x4f')]['count'](_0x4fb92f)[_0x1b82('0x34')](function(_0x3df0af){_0x39fe4a[_0x1b82('0x2d')]=_0x3df0af;if(_0x286b4b['query'][_0x1b82('0x50')]){_0x1255db['include']=[{'all':!![]}];}return db['Trunk'][_0x1b82('0x51')](_0x1255db);})[_0x1b82('0x34')](function(_0x242324){_0x39fe4a['rows']=_0x242324;return _0x39fe4a;})[_0x1b82('0x34')](respondWithFilteredResult(_0x348880,_0x1255db))[_0x1b82('0x25')](handleError(_0x348880,null));};exports['show']=function(_0x5ca898,_0x106282){var _0x2e676a={'raw':![],'where':{'id':_0x5ca898['params']['id']}},_0x2dc53e={};_0x2dc53e[_0x1b82('0x3d')]=_[_0x1b82('0x40')](db[_0x1b82('0x4f')][_0x1b82('0x3a')]);_0x2dc53e[_0x1b82('0x3f')]=_[_0x1b82('0x40')](_0x5ca898['query']);_0x2dc53e[_0x1b82('0x41')]=_['intersection'](_0x2dc53e[_0x1b82('0x3d')],_0x2dc53e[_0x1b82('0x3f')]);_0x2e676a['attributes']=_[_0x1b82('0x52')](_0x2dc53e['model'],qs[_0x1b82('0x43')](_0x5ca898[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x2e676a[_0x1b82('0x42')]=_0x2e676a[_0x1b82('0x42')][_0x1b82('0x53')]?_0x2e676a['attributes']:_0x2dc53e['model'];if(_0x5ca898[_0x1b82('0x3f')][_0x1b82('0x50')]){_0x2e676a[_0x1b82('0x54')]=[{'all':!![]}];}_0x2e676a=_[_0x1b82('0x4b')]({},_0x2e676a,_0x5ca898[_0x1b82('0x4e')]);return db[_0x1b82('0x4f')][_0x1b82('0x55')](_0x2e676a)[_0x1b82('0x34')](handleEntityNotFound(_0x106282,null))['then'](respondWithResult(_0x106282,null))['catch'](handleError(_0x106282,null));};exports['clone']=function(_0x2658b5,_0x2a95d2){var _0x207f1c={'where':{'id':_0x2658b5[_0x1b82('0x56')]['id']}},_0x27ad80={};_0x27ad80[_0x1b82('0x3d')]=_[_0x1b82('0x40')](db['Trunk'][_0x1b82('0x3a')]);_0x207f1c[_0x1b82('0x42')]=_[_0x1b82('0x52')](_0x27ad80[_0x1b82('0x3d')],qs[_0x1b82('0x43')](_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x207f1c[_0x1b82('0x42')]=_0x207f1c['attributes'][_0x1b82('0x53')]?_0x207f1c[_0x1b82('0x42')]:_0x27ad80[_0x1b82('0x3d')];if(_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x50')]){_0x207f1c['include']=[{'all':!![]}];}_0x207f1c=_['merge']({},_0x207f1c,_0x2658b5[_0x1b82('0x4e')]);return db[_0x1b82('0x4f')][_0x1b82('0x55')](_0x207f1c)[_0x1b82('0x34')](handleEntityNotFound(_0x2a95d2,null))['then'](function(_0x170905){if(_0x170905){var _0x352603=_0x170905[_0x1b82('0x57')]({'plain':!![]});_0x352603=qs[_0x1b82('0x58')](_0x352603,['id',_0x1b82('0x59'),_0x1b82('0x5a')]);_0x2658b5[_0x1b82('0x5b')]=_[_0x1b82('0x58')](_0x2658b5[_0x1b82('0x5b')],['id',_0x1b82('0x59'),'updatedAt']);return db[_0x1b82('0x4f')][_0x1b82('0x5c')](_['merge'](_0x352603,_0x2658b5[_0x1b82('0x5b')]),{'include':_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x50')]?[{'all':!![]}]:undefined})[_0x1b82('0x34')](function(_0x4b26c4){var _0x30f13a=_0x2658b5[_0x1b82('0x5d')][_0x1b82('0x57')]({'plain':!![]});if(!_0x30f13a)throw new Error(_0x1b82('0x5e'));if(_0x30f13a[_0x1b82('0x5f')]===_0x1b82('0x5d')){var _0x4e8fa2=_0x4b26c4[_0x1b82('0x57')]({'plain':!![]});var _0x5267c3=_0x1b82('0x36');return db['UserProfileSection'][_0x1b82('0x55')]({'where':{'name':_0x5267c3,'userProfileId':_0x30f13a[_0x1b82('0x60')]},'raw':!![]})[_0x1b82('0x34')](function(_0x2db0fe){if(_0x2db0fe&&_0x2db0fe[_0x1b82('0x61')]===0x0){return db[_0x1b82('0x62')][_0x1b82('0x5c')]({'name':_0x4e8fa2['name'],'resourceId':_0x4e8fa2['id'],'type':_0x2db0fe[_0x1b82('0x37')],'sectionId':_0x2db0fe['id']},{})[_0x1b82('0x34')](function(){return _0x4b26c4;});}else{return _0x4b26c4;}})[_0x1b82('0x25')](function(_0x2de10c){logger[_0x1b82('0x21')](_0x1b82('0x63'),_0x2de10c);throw _0x2de10c;});}return _0x4b26c4;});}})[_0x1b82('0x34')](respondWithResult(_0x2a95d2,0xc9))[_0x1b82('0x25')](handleError(_0x2a95d2,null));};exports[_0x1b82('0x5c')]=function(_0x3f7690,_0x1873de,_0xe31cbc){var _0x1ef92c;return db['Trunk'][_0x1b82('0x5c')](_0x3f7690[_0x1b82('0x5b')],{'raw':!![]})[_0x1b82('0x34')](function(_0x4a229e){_0x1ef92c=_0x4a229e;return db[_0x1b82('0x4f')][_0x1b82('0x51')]({'raw':!![]});})['then'](function(_0x3bf106){var _0x5cc386=fs[_0x1b82('0x64')](path['join'](config['root'],_0x1b82('0x65')),_0x1b82('0x66'));var _0x3b4088=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config['root'],_0x1b82('0x68')),'utf8');var _0x143689=ejs[_0x1b82('0x69')](_0x5cc386,{'trunks':_0x3bf106||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6b'),_0x143689);if(_0x1ef92c[_0x1b82('0x6c')]){var _0x29c42e=ejs[_0x1b82('0x69')](_0x3b4088,{'trunks':_0x3bf106||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6d'),_0x29c42e);}})[_0x1b82('0x34')](function(){return respondWithRpcPromise(_0x1b82('0x6e'),'create',{'module':_0x1b82('0x6f')});})['then'](function(){var _0x4c2e52=_0x3f7690[_0x1b82('0x5d')][_0x1b82('0x57')]({'plain':!![]});if(!_0x4c2e52)throw new Error(_0x1b82('0x5e'));if(_0x4c2e52[_0x1b82('0x5f')]===_0x1b82('0x5d')){var _0x1dd3a1=_0x1ef92c[_0x1b82('0x57')]({'plain':!![]});return db[_0x1b82('0x70')][_0x1b82('0x55')]({'where':{'name':_0x1b82('0x36'),'userProfileId':_0x4c2e52['userProfileId']},'raw':!![]})[_0x1b82('0x34')](function(_0x4d496b){if(_0x4d496b&&_0x4d496b[_0x1b82('0x61')]===0x0){return db['UserProfileResource'][_0x1b82('0x5c')]({'name':_0x1dd3a1[_0x1b82('0x37')],'resourceId':_0x1dd3a1['id'],'type':_0x4d496b[_0x1b82('0x37')],'sectionId':_0x4d496b['id']},{})[_0x1b82('0x34')](function(){return _0x1ef92c;});}else{return _0x1ef92c;}})[_0x1b82('0x25')](function(_0x49a202){logger[_0x1b82('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49a202);throw _0x49a202;});}return _0x1ef92c;})['then'](respondWithResult(_0x1873de,0xc9))[_0x1b82('0x25')](handleError(_0x1873de,null));};exports[_0x1b82('0x33')]=function(_0x1a4826,_0x4d986c,_0x2e9191){var _0x52f16e;return db[_0x1b82('0x4f')]['find']({'where':{'id':_0x1a4826[_0x1b82('0x56')]['id']}})[_0x1b82('0x34')](handleEntityNotFound(_0x4d986c,null))[_0x1b82('0x34')](saveUpdates(_0x1a4826[_0x1b82('0x5b')],null))['then'](function(_0x46cae4){if(_0x46cae4){_0x52f16e=_0x46cae4;return db['Trunk'][_0x1b82('0x51')]({'raw':!![]});}})[_0x1b82('0x34')](function(_0x1095fb){if(_0x1095fb){var _0x185fce=fs[_0x1b82('0x64')](path['join'](config[_0x1b82('0x71')],'server/files/templates/trunk.ejs'),_0x1b82('0x66'));var _0x5ce247=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config[_0x1b82('0x71')],'server/files/templates/registry.ejs'),_0x1b82('0x66'));var _0x31a56e=ejs[_0x1b82('0x69')](_0x185fce,{'trunks':_0x1095fb||[]});fs['writeFileSync'](_0x1b82('0x6b'),_0x31a56e);var _0x396272=ejs[_0x1b82('0x69')](_0x5ce247,{'trunks':_0x1095fb||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6d'),_0x396272);return respondWithRpcPromise('Reload',_0x1b82('0x33'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x2759ac){if(_0x2759ac){return _0x52f16e;}})['then'](respondWithResult(_0x4d986c,null))[_0x1b82('0x25')](handleError(_0x4d986c,null));};exports[_0x1b82('0x35')]=function(_0x5f349f,_0x3e17b0,_0x391207){var _0x553ac5;return db['Trunk']['find']({'where':{'id':_0x5f349f['params']['id']}})[_0x1b82('0x34')](handleEntityNotFound(_0x3e17b0,null))[_0x1b82('0x34')](removeEntity(_0x3e17b0,null))[_0x1b82('0x34')](function(){return db['Trunk'][_0x1b82('0x51')]({'raw':!![]});})['then'](function(_0x7d95b6){var _0x372c3b=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config['root'],_0x1b82('0x65')),_0x1b82('0x66'));var _0x14510c=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config[_0x1b82('0x71')],_0x1b82('0x68')),'utf8');var _0x58e180=ejs[_0x1b82('0x69')](_0x372c3b,{'trunks':_0x7d95b6});var _0x531d3f=ejs['render'](_0x14510c,{'trunks':_0x7d95b6});fs[_0x1b82('0x6a')](_0x1b82('0x6b'),_0x58e180);fs[_0x1b82('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x531d3f);return respondWithRpcPromise(_0x1b82('0x6e'),'destroy',{'module':_0x1b82('0x6f')});})[_0x1b82('0x25')](handleError(_0x3e17b0,null));}; \ No newline at end of file +var _0x84ab=['../../mysqldb','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','destroy','stack','name','index','map','rawAttributes','fieldName','type','query','keys','intersection','fields','attributes','length','model','order','sort','where','filters','pick','merge','filter','options','Trunk','count','includeAll','rows','params','include','find','createdAt','updatedAt','body','omit','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','userProfileId','autoAssociation','root','chan_sip.so','server/files/templates/trunk.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x169790,_0x48aa33){var _0x4d0f36=function(_0x2a848d){while(--_0x2a848d){_0x169790['push'](_0x169790['shift']());}};_0x4d0f36(++_0x48aa33);}(_0x84ab,0x12f));var _0xb84a=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0x84ab[_0x1e4150];return _0x1ce3ee;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xb84a('0x16')][_0xb84a('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x39a0df,_0x3c161c,_0x44b26b,_0x11dfe9){return new BPromise(function(_0x12ccab,_0x475b){var _0x3113a2=_0x11dfe9||client;return _0x3113a2[_0xb84a('0x18')](_0x39a0df,_0x44b26b)[_0xb84a('0x19')](function(_0x1251ec){logger['info'](_0xb84a('0x1a'),_0x3c161c,_0xb84a('0x1b'));logger[_0xb84a('0x1c')](_0xb84a('0x1d'),_0x3c161c,_0xb84a('0x1b'),JSON[_0xb84a('0x1e')](_0x1251ec));if(_0x1251ec[_0xb84a('0x1f')]){if(_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x20')]===0x1f4){logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x21')]);return _0x475b(_0x1251ec[_0xb84a('0x1f')]['message']);}logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x1251ec['error'][_0xb84a('0x21')]);return _0x12ccab(_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x21')]);}else{logger[_0xb84a('0x22')]('Trunk,\x20%s,\x20%s',_0x3c161c,'request\x20sent');_0x12ccab(_0x1251ec[_0xb84a('0x23')][_0xb84a('0x21')]);}})[_0xb84a('0x24')](function(_0x259f74){logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x259f74);_0x475b(_0x259f74);});});}function respondWithStatusCode(_0x8b28cd,_0x21d0d3){_0x21d0d3=_0x21d0d3||0xcc;return function(_0x3aa06f){if(_0x3aa06f){return _0x8b28cd[_0xb84a('0x25')](_0x21d0d3);}return _0x8b28cd[_0xb84a('0x26')](_0x21d0d3)[_0xb84a('0x27')]();};}function respondWithResult(_0x218aef,_0x409df0){_0x409df0=_0x409df0||0xc8;return function(_0x19bdfa){if(_0x19bdfa){return _0x218aef[_0xb84a('0x26')](_0x409df0)[_0xb84a('0x28')](_0x19bdfa);}};}function respondWithFilteredResult(_0x3ff0bc,_0x3b6805){return function(_0xd468c3){if(_0xd468c3){var _0x33bf1d=typeof _0x3b6805[_0xb84a('0x29')]===_0xb84a('0x2a')&&typeof _0x3b6805[_0xb84a('0x2b')]===_0xb84a('0x2a');var _0x97d71b=_0xd468c3['count'];var _0x582954=_0x33bf1d?0x0:_0x3b6805[_0xb84a('0x29')];var _0x2c30b0=_0x33bf1d?_0xd468c3['count']:_0x3b6805[_0xb84a('0x29')]+_0x3b6805[_0xb84a('0x2b')];var _0x52c23c;if(_0x2c30b0>=_0x97d71b){_0x2c30b0=_0x97d71b;_0x52c23c=0xc8;}else{_0x52c23c=0xce;}_0x3ff0bc['status'](_0x52c23c);return _0x3ff0bc[_0xb84a('0x2c')](_0xb84a('0x2d'),_0x582954+'-'+_0x2c30b0+'/'+_0x97d71b)['json'](_0xd468c3);}return null;};}function patchUpdates(_0x251778){return function(_0xba1147){try{jsonpatch[_0xb84a('0x2e')](_0xba1147,_0x251778,!![]);}catch(_0x44a405){return BPromise[_0xb84a('0x2f')](_0x44a405);}return _0xba1147[_0xb84a('0x30')]();};}function saveUpdates(_0x34b212,_0xac214f){return function(_0x54ec50){if(_0x54ec50){return _0x54ec50[_0xb84a('0x31')](_0x34b212)['then'](function(_0x4bca85){return _0x4bca85;});}return null;};}function removeEntity(_0x2eea7e,_0x3b4515){return function(_0x47a5b6){if(_0x47a5b6){return _0x47a5b6['destroy']()[_0xb84a('0x19')](function(){var _0x13c167=_0x47a5b6[_0xb84a('0x32')]({'plain':!![]});var _0x308240=_0xb84a('0x33');return db[_0xb84a('0x34')][_0xb84a('0x35')]({'where':{'type':_0x308240,'resourceId':_0x13c167['id']}})[_0xb84a('0x19')](function(){return _0x47a5b6;});})['then'](function(){_0x2eea7e[_0xb84a('0x26')](0xcc)[_0xb84a('0x27')]();});}};}function handleEntityNotFound(_0x10b944,_0xf894a6){return function(_0x36aa07){if(!_0x36aa07){_0x10b944[_0xb84a('0x25')](0x194);}return _0x36aa07;};}function handleError(_0x2a5130,_0x5aa2ae){_0x5aa2ae=_0x5aa2ae||0x1f4;return function(_0x30d22d){logger['error'](_0x30d22d[_0xb84a('0x36')]);if(_0x30d22d[_0xb84a('0x37')]){delete _0x30d22d[_0xb84a('0x37')];}_0x2a5130['status'](_0x5aa2ae)['send'](_0x30d22d);};}exports[_0xb84a('0x38')]=function(_0x75e6e6,_0x4a3737){var _0x2d3e08={},_0xab76ce={},_0x4cb5d4={'count':0x0,'rows':[]};var _0x19aa4c=_[_0xb84a('0x39')](db['Trunk'][_0xb84a('0x3a')],function(_0xe6f19e){return{'name':_0xe6f19e[_0xb84a('0x3b')],'type':_0xe6f19e[_0xb84a('0x3c')]['key']};});_0xab76ce['model']=_['map'](_0x19aa4c,_0xb84a('0x37'));_0xab76ce[_0xb84a('0x3d')]=_[_0xb84a('0x3e')](_0x75e6e6[_0xb84a('0x3d')]);_0xab76ce['filters']=_[_0xb84a('0x3f')](_0xab76ce['model'],_0xab76ce[_0xb84a('0x3d')]);_0x2d3e08['attributes']=_['intersection'](_0xab76ce['model'],qs[_0xb84a('0x40')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x40')]));_0x2d3e08[_0xb84a('0x41')]=_0x2d3e08['attributes'][_0xb84a('0x42')]?_0x2d3e08[_0xb84a('0x41')]:_0xab76ce[_0xb84a('0x43')];if(!_0x75e6e6[_0xb84a('0x3d')]['hasOwnProperty']('nolimit')){_0x2d3e08[_0xb84a('0x2b')]=qs[_0xb84a('0x2b')](_0x75e6e6['query'][_0xb84a('0x2b')]);_0x2d3e08[_0xb84a('0x29')]=qs[_0xb84a('0x29')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x29')]);}_0x2d3e08[_0xb84a('0x44')]=qs[_0xb84a('0x45')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x45')]);_0x2d3e08[_0xb84a('0x46')]=qs[_0xb84a('0x47')](_[_0xb84a('0x48')](_0x75e6e6[_0xb84a('0x3d')],_0xab76ce[_0xb84a('0x47')]),_0x19aa4c);if(_0x75e6e6[_0xb84a('0x3d')]['filter']){_0x2d3e08[_0xb84a('0x46')]=_[_0xb84a('0x49')](_0x2d3e08[_0xb84a('0x46')],{'$or':_[_0xb84a('0x39')](_0x19aa4c,function(_0x37f4fe){if(_0x37f4fe[_0xb84a('0x3c')]!=='VIRTUAL'){var _0xfd2927={};_0xfd2927[_0x37f4fe['name']]={'$like':'%'+_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x4a')]+'%'};return _0xfd2927;}})});}_0x2d3e08=_[_0xb84a('0x49')]({},_0x2d3e08,_0x75e6e6[_0xb84a('0x4b')]);var _0x5e7327={'where':_0x2d3e08[_0xb84a('0x46')]};return db[_0xb84a('0x4c')][_0xb84a('0x4d')](_0x5e7327)['then'](function(_0x55f39f){_0x4cb5d4[_0xb84a('0x4d')]=_0x55f39f;if(_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x4e')]){_0x2d3e08['include']=[{'all':!![]}];}return db['Trunk']['findAll'](_0x2d3e08);})[_0xb84a('0x19')](function(_0x384a0d){_0x4cb5d4[_0xb84a('0x4f')]=_0x384a0d;return _0x4cb5d4;})[_0xb84a('0x19')](respondWithFilteredResult(_0x4a3737,_0x2d3e08))[_0xb84a('0x24')](handleError(_0x4a3737,null));};exports['show']=function(_0x4b40fe,_0x5b853a){var _0x53d4d6={'raw':![],'where':{'id':_0x4b40fe[_0xb84a('0x50')]['id']}},_0x421ba0={};_0x421ba0['model']=_[_0xb84a('0x3e')](db[_0xb84a('0x4c')][_0xb84a('0x3a')]);_0x421ba0[_0xb84a('0x3d')]=_[_0xb84a('0x3e')](_0x4b40fe[_0xb84a('0x3d')]);_0x421ba0['filters']=_['intersection'](_0x421ba0[_0xb84a('0x43')],_0x421ba0['query']);_0x53d4d6[_0xb84a('0x41')]=_['intersection'](_0x421ba0['model'],qs['fields'](_0x4b40fe[_0xb84a('0x3d')][_0xb84a('0x40')]));_0x53d4d6[_0xb84a('0x41')]=_0x53d4d6[_0xb84a('0x41')][_0xb84a('0x42')]?_0x53d4d6[_0xb84a('0x41')]:_0x421ba0[_0xb84a('0x43')];if(_0x4b40fe[_0xb84a('0x3d')]['includeAll']){_0x53d4d6['include']=[{'all':!![]}];}_0x53d4d6=_['merge']({},_0x53d4d6,_0x4b40fe[_0xb84a('0x4b')]);return db[_0xb84a('0x4c')]['find'](_0x53d4d6)[_0xb84a('0x19')](handleEntityNotFound(_0x5b853a,null))['then'](respondWithResult(_0x5b853a,null))['catch'](handleError(_0x5b853a,null));};exports['clone']=function(_0x419e27,_0x172076){var _0x49a0e2={'where':{'id':_0x419e27[_0xb84a('0x50')]['id']}},_0x51c415={};_0x51c415[_0xb84a('0x43')]=_[_0xb84a('0x3e')](db['Trunk'][_0xb84a('0x3a')]);_0x49a0e2['attributes']=_['intersection'](_0x51c415[_0xb84a('0x43')],qs['fields'](_0x419e27[_0xb84a('0x3d')]['fields']));_0x49a0e2[_0xb84a('0x41')]=_0x49a0e2[_0xb84a('0x41')][_0xb84a('0x42')]?_0x49a0e2[_0xb84a('0x41')]:_0x51c415['model'];if(_0x419e27['query']['includeAll']){_0x49a0e2[_0xb84a('0x51')]=[{'all':!![]}];}_0x49a0e2=_[_0xb84a('0x49')]({},_0x49a0e2,_0x419e27['options']);return db['Trunk'][_0xb84a('0x52')](_0x49a0e2)[_0xb84a('0x19')](handleEntityNotFound(_0x172076,null))[_0xb84a('0x19')](function(_0x5f415d){if(_0x5f415d){var _0x29f67f=_0x5f415d[_0xb84a('0x32')]({'plain':!![]});_0x29f67f=qs['omit'](_0x29f67f,['id',_0xb84a('0x53'),_0xb84a('0x54')]);_0x419e27[_0xb84a('0x55')]=_[_0xb84a('0x56')](_0x419e27[_0xb84a('0x55')],['id',_0xb84a('0x53'),_0xb84a('0x54')]);return db['Trunk'][_0xb84a('0x57')](_[_0xb84a('0x49')](_0x29f67f,_0x419e27['body']),{'include':_0x419e27[_0xb84a('0x3d')][_0xb84a('0x4e')]?[{'all':!![]}]:undefined})[_0xb84a('0x19')](function(_0x3e16d8){var _0x347998=_0x419e27[_0xb84a('0x58')][_0xb84a('0x32')]({'plain':!![]});if(!_0x347998)throw new Error(_0xb84a('0x59'));if(_0x347998[_0xb84a('0x5a')]==='user'){var _0x291008=_0x3e16d8['get']({'plain':!![]});var _0x5a2d44=_0xb84a('0x33');return db['UserProfileSection'][_0xb84a('0x52')]({'where':{'name':_0x5a2d44,'userProfileId':_0x347998['userProfileId']},'raw':!![]})[_0xb84a('0x19')](function(_0x44e508){if(_0x44e508&&_0x44e508['autoAssociation']===0x0){return db[_0xb84a('0x34')][_0xb84a('0x57')]({'name':_0x291008[_0xb84a('0x37')],'resourceId':_0x291008['id'],'type':_0x44e508[_0xb84a('0x37')],'sectionId':_0x44e508['id']},{})[_0xb84a('0x19')](function(){return _0x3e16d8;});}else{return _0x3e16d8;}})[_0xb84a('0x24')](function(_0x4514f0){logger['error'](_0xb84a('0x5b'),_0x4514f0);throw _0x4514f0;});}return _0x3e16d8;});}})['then'](respondWithResult(_0x172076,0xc9))['catch'](handleError(_0x172076,null));};exports[_0xb84a('0x57')]=function(_0x2a2dc0,_0x2ee241,_0x32a455){var _0x5612f3;return db['Trunk'][_0xb84a('0x57')](_0x2a2dc0[_0xb84a('0x55')],{'raw':!![]})[_0xb84a('0x19')](function(_0x1a2e1a){_0x5612f3=_0x1a2e1a;return db['Trunk'][_0xb84a('0x5c')]({'raw':!![]});})['then'](function(_0x1eec1f){var _0x57b784=fs[_0xb84a('0x5d')](path['join'](config['root'],'server/files/templates/trunk.ejs'),_0xb84a('0x5e'));var _0xf936f1=fs[_0xb84a('0x5d')](path[_0xb84a('0x5f')](config['root'],_0xb84a('0x60')),_0xb84a('0x5e'));var _0x33d416=ejs[_0xb84a('0x61')](_0x57b784,{'trunks':_0x1eec1f||[]});fs[_0xb84a('0x62')](_0xb84a('0x63'),_0x33d416);if(_0x5612f3[_0xb84a('0x64')]){var _0x542d70=ejs[_0xb84a('0x61')](_0xf936f1,{'trunks':_0x1eec1f||[]});fs[_0xb84a('0x62')](_0xb84a('0x65'),_0x542d70);}})[_0xb84a('0x19')](function(){return respondWithRpcPromise(_0xb84a('0x66'),_0xb84a('0x57'),{'module':'chan_sip.so'});})[_0xb84a('0x19')](function(){var _0x6f8f=_0x2a2dc0[_0xb84a('0x58')][_0xb84a('0x32')]({'plain':!![]});if(!_0x6f8f)throw new Error(_0xb84a('0x59'));if(_0x6f8f['role']===_0xb84a('0x58')){var _0x4b0b18=_0x5612f3[_0xb84a('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xb84a('0x52')]({'where':{'name':_0xb84a('0x33'),'userProfileId':_0x6f8f[_0xb84a('0x67')]},'raw':!![]})['then'](function(_0x121fda){if(_0x121fda&&_0x121fda[_0xb84a('0x68')]===0x0){return db[_0xb84a('0x34')][_0xb84a('0x57')]({'name':_0x4b0b18[_0xb84a('0x37')],'resourceId':_0x4b0b18['id'],'type':_0x121fda['name'],'sectionId':_0x121fda['id']},{})[_0xb84a('0x19')](function(){return _0x5612f3;});}else{return _0x5612f3;}})[_0xb84a('0x24')](function(_0x287d25){logger['error'](_0xb84a('0x5b'),_0x287d25);throw _0x287d25;});}return _0x5612f3;})['then'](respondWithResult(_0x2ee241,0xc9))['catch'](handleError(_0x2ee241,null));};exports[_0xb84a('0x31')]=function(_0x35cb8b,_0x13c7b7,_0x3b2a2d){var _0x2047f5;return db[_0xb84a('0x4c')][_0xb84a('0x52')]({'where':{'id':_0x35cb8b[_0xb84a('0x50')]['id']}})[_0xb84a('0x19')](handleEntityNotFound(_0x13c7b7,null))[_0xb84a('0x19')](saveUpdates(_0x35cb8b[_0xb84a('0x55')],null))[_0xb84a('0x19')](function(_0x3ec1fb){if(_0x3ec1fb){_0x2047f5=_0x3ec1fb;return db[_0xb84a('0x4c')][_0xb84a('0x5c')]({'raw':!![]});}})[_0xb84a('0x19')](function(_0xb18756){if(_0xb18756){var _0x1169d1=fs['readFileSync'](path[_0xb84a('0x5f')](config[_0xb84a('0x69')],'server/files/templates/trunk.ejs'),_0xb84a('0x5e'));var _0x576df5=fs[_0xb84a('0x5d')](path['join'](config[_0xb84a('0x69')],'server/files/templates/registry.ejs'),'utf8');var _0xf3f253=ejs[_0xb84a('0x61')](_0x1169d1,{'trunks':_0xb18756||[]});fs['writeFileSync'](_0xb84a('0x63'),_0xf3f253);var _0xcf9bc2=ejs[_0xb84a('0x61')](_0x576df5,{'trunks':_0xb18756||[]});fs[_0xb84a('0x62')](_0xb84a('0x65'),_0xcf9bc2);return respondWithRpcPromise('Reload',_0xb84a('0x31'),{'module':_0xb84a('0x6a')});}return null;})[_0xb84a('0x19')](function(_0x30f7cd){if(_0x30f7cd){return _0x2047f5;}})['then'](respondWithResult(_0x13c7b7,null))[_0xb84a('0x24')](handleError(_0x13c7b7,null));};exports['destroy']=function(_0x14118c,_0x12d796,_0x54ae3e){var _0xf6765a;return db[_0xb84a('0x4c')][_0xb84a('0x52')]({'where':{'id':_0x14118c['params']['id']}})['then'](handleEntityNotFound(_0x12d796,null))[_0xb84a('0x19')](removeEntity(_0x12d796,null))[_0xb84a('0x19')](function(){return db['Trunk'][_0xb84a('0x5c')]({'raw':!![]});})['then'](function(_0x166d75){var _0x54161c=fs['readFileSync'](path[_0xb84a('0x5f')](config[_0xb84a('0x69')],_0xb84a('0x6b')),_0xb84a('0x5e'));var _0x403a3e=fs['readFileSync'](path['join'](config[_0xb84a('0x69')],_0xb84a('0x60')),'utf8');var _0x305b67=ejs[_0xb84a('0x61')](_0x54161c,{'trunks':_0x166d75});var _0x385a05=ejs[_0xb84a('0x61')](_0x403a3e,{'trunks':_0x166d75});fs['writeFileSync'](_0xb84a('0x63'),_0x305b67);fs['writeFileSync'](_0xb84a('0x65'),_0x385a05);return respondWithRpcPromise(_0xb84a('0x66'),_0xb84a('0x35'),{'module':_0xb84a('0x6a')});})[_0xb84a('0x24')](handleError(_0x12d796,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 43eb2df..51d5c8c 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 _0x4204=['request-promise','rimraf','../../config/environment','exports','Trunk','lodash','../../config/logger','api','moment','bluebird'];(function(_0x20a60a,_0x186240){var _0x2dba9d=function(_0x281a50){while(--_0x281a50){_0x20a60a['push'](_0x20a60a['shift']());}};_0x2dba9d(++_0x186240);}(_0x4204,0x69));var _0x4420=function(_0x3a73bc,_0x550aef){_0x3a73bc=_0x3a73bc-0x0;var _0x32891b=_0x4204[_0x3a73bc];return _0x32891b;};'use strict';var _=require(_0x4420('0x0'));var util=require('util');var logger=require(_0x4420('0x1'))(_0x4420('0x2'));var moment=require(_0x4420('0x3'));var BPromise=require(_0x4420('0x4'));var rp=require(_0x4420('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4420('0x6'));var config=require(_0x4420('0x7'));var attributes=require('./trunk.attributes');module[_0x4420('0x8')]=function(_0x2da656,_0x57072b){return _0x2da656['define'](_0x4420('0x9'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0442=['moment','bluebird','path','rimraf','../../config/environment','./trunk.attributes','Trunk','util','../../config/logger'];(function(_0x40927b,_0xf9b0a0){var _0x2635e8=function(_0x1f2b8c){while(--_0x1f2b8c){_0x40927b['push'](_0x40927b['shift']());}};_0x2635e8(++_0xf9b0a0);}(_0x0442,0x6a));var _0x2044=function(_0x54bac5,_0x8d3a16){_0x54bac5=_0x54bac5-0x0;var _0xc15971=_0x0442[_0x54bac5];return _0xc15971;};'use strict';var _=require('lodash');var util=require(_0x2044('0x0'));var logger=require(_0x2044('0x1'))('api');var moment=require(_0x2044('0x2'));var BPromise=require(_0x2044('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2044('0x4'));var rimraf=require(_0x2044('0x5'));var config=require(_0x2044('0x6'));var attributes=require(_0x2044('0x7'));module['exports']=function(_0x58dcb8,_0x33e918){return _0x58dcb8['define'](_0x2044('0x8'),attributes,{'tableName':'tools_trunks','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 4d5e960..dcb85aa 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 _0xd180=['model','GetTrunk','debug','ShowTrunk','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Trunk','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x34b103,_0x3168eb){var _0x363039=function(_0x27b020){while(--_0x27b020){_0x34b103['push'](_0x34b103['shift']());}};_0x363039(++_0x3168eb);}(_0xd180,0xca));var _0x0d18=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0xd180[_0x4dcc2d];return _0x1bbd79;};'use strict';var _=require(_0x0d18('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0d18('0x1'));var rs=require(_0x0d18('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d18('0x3'))['db'];var utils=require(_0x0d18('0x4'));var logger=require(_0x0d18('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0d18('0x6'));var client=jayson[_0x0d18('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd8b28,_0x3d1e1d,_0x523f78){return new BPromise(function(_0x548ce5,_0x2dff6c){return client[_0x0d18('0x8')](_0xd8b28,_0x523f78)[_0x0d18('0x9')](function(_0x34036d){logger[_0x0d18('0xa')](_0x0d18('0xb'),_0x3d1e1d,_0x0d18('0xc'));logger['debug'](_0x0d18('0xd'),_0x3d1e1d,'request\x20sent',JSON[_0x0d18('0xe')](_0x34036d));if(_0x34036d[_0x0d18('0xf')]){if(_0x34036d['error'][_0x0d18('0x10')]===0x1f4){logger['error'](_0x0d18('0xb'),_0x3d1e1d,_0x34036d[_0x0d18('0xf')][_0x0d18('0x11')]);return _0x2dff6c(_0x34036d['error'][_0x0d18('0x11')]);}logger[_0x0d18('0xf')](_0x0d18('0xb'),_0x3d1e1d,_0x34036d['error'][_0x0d18('0x11')]);return _0x548ce5(_0x34036d['error'][_0x0d18('0x11')]);}else{logger[_0x0d18('0xa')]('Trunk,\x20%s,\x20%s',_0x3d1e1d,_0x0d18('0xc'));_0x548ce5(_0x34036d[_0x0d18('0x12')]['message']);}})[_0x0d18('0x13')](function(_0x5cff9f){logger[_0x0d18('0xf')](_0x0d18('0xb'),_0x3d1e1d,_0x5cff9f);_0x2dff6c(_0x5cff9f);});});}exports['GetTrunk']=function(_0x40e70d){var _0x7dd95f=this;return new Promise(function(_0x438f5d,_0x34b241){return db[_0x0d18('0x14')][_0x0d18('0x15')]({'raw':_0x40e70d[_0x0d18('0x16')]?_0x40e70d['options'][_0x0d18('0x17')]===undefined?!![]:![]:!![],'where':_0x40e70d[_0x0d18('0x16')]?_0x40e70d[_0x0d18('0x16')][_0x0d18('0x18')]||null:null,'attributes':_0x40e70d[_0x0d18('0x16')]?_0x40e70d[_0x0d18('0x16')][_0x0d18('0x19')]||null:null,'limit':_0x40e70d[_0x0d18('0x16')]?_0x40e70d['options'][_0x0d18('0x1a')]||null:null,'include':_0x40e70d[_0x0d18('0x16')]?_0x40e70d[_0x0d18('0x16')][_0x0d18('0x1b')]?_[_0x0d18('0x1c')](_0x40e70d[_0x0d18('0x16')][_0x0d18('0x1b')],function(_0x341bfe){return{'model':db[_0x341bfe[_0x0d18('0x1d')]],'as':_0x341bfe['as'],'attributes':_0x341bfe[_0x0d18('0x19')],'include':_0x341bfe['include']?_[_0x0d18('0x1c')](_0x341bfe['include'],function(_0x1df816){return{'model':db[_0x1df816[_0x0d18('0x1d')]],'as':_0x1df816['as'],'attributes':_0x1df816[_0x0d18('0x19')],'include':_0x1df816[_0x0d18('0x1b')]?_[_0x0d18('0x1c')](_0x1df816[_0x0d18('0x1b')],function(_0x3904d8){return{'model':db[_0x3904d8['model']],'as':_0x3904d8['as'],'attributes':_0x3904d8[_0x0d18('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0d18('0x9')](function(_0x464cc0){logger[_0x0d18('0xa')](_0x0d18('0x1e'),_0x40e70d);logger[_0x0d18('0x1f')]('GetTrunk',_0x40e70d,JSON[_0x0d18('0xe')](_0x464cc0));_0x438f5d(_0x464cc0);})[_0x0d18('0x13')](function(_0x41b274){logger[_0x0d18('0xf')](_0x0d18('0x1e'),_0x41b274[_0x0d18('0x11')],_0x40e70d);_0x34b241(_0x7dd95f[_0x0d18('0xf')](0x1f4,_0x41b274[_0x0d18('0x11')]));});});};exports[_0x0d18('0x20')]=function(_0x36551d){var _0x1ada82=this;return new Promise(function(_0x3f0693,_0x4de3ab){return db[_0x0d18('0x14')]['find']({'raw':_0x36551d[_0x0d18('0x16')]?_0x36551d[_0x0d18('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x36551d[_0x0d18('0x16')]?_0x36551d[_0x0d18('0x16')][_0x0d18('0x18')]||null:null,'attributes':_0x36551d['options']?_0x36551d[_0x0d18('0x16')][_0x0d18('0x19')]||null:null,'include':_0x36551d['options']?_0x36551d['options']['include']?_[_0x0d18('0x1c')](_0x36551d['options'][_0x0d18('0x1b')],function(_0x10396c){return{'model':db[_0x10396c[_0x0d18('0x1d')]],'as':_0x10396c['as'],'attributes':_0x10396c[_0x0d18('0x19')],'include':_0x10396c[_0x0d18('0x1b')]?_[_0x0d18('0x1c')](_0x10396c[_0x0d18('0x1b')],function(_0xc86fb9){return{'model':db[_0xc86fb9['model']],'as':_0xc86fb9['as'],'attributes':_0xc86fb9[_0x0d18('0x19')],'include':_0xc86fb9['include']?_[_0x0d18('0x1c')](_0xc86fb9['include'],function(_0x5d4ae4){return{'model':db[_0x5d4ae4[_0x0d18('0x1d')]],'as':_0x5d4ae4['as'],'attributes':_0x5d4ae4[_0x0d18('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0d18('0x9')](function(_0xddbc97){logger[_0x0d18('0xa')](_0x0d18('0x20'),_0x36551d);logger['debug'](_0x0d18('0x20'),_0x36551d,JSON[_0x0d18('0xe')](_0xddbc97));_0x3f0693(_0xddbc97);})[_0x0d18('0x13')](function(_0x56e57a){logger[_0x0d18('0xf')]('ShowTrunk',_0x56e57a[_0x0d18('0x11')],_0x36551d);_0x4de3ab(_0x1ada82[_0x0d18('0xf')](0x1f4,_0x56e57a['message']));});});}; \ No newline at end of file +var _0xa38a=['http','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','findAll','options','attributes','limit','map','include','model','GetTrunk','stringify','ShowTrunk','Trunk','find','raw','where','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2b632d,_0x1d4a51){var _0x57ffdd=function(_0x56fcaa){while(--_0x56fcaa){_0x2b632d['push'](_0x2b632d['shift']());}};_0x57ffdd(++_0x1d4a51);}(_0xa38a,0x142));var _0xaa38=function(_0x47507e,_0x9a8323){_0x47507e=_0x47507e-0x0;var _0x5c66eb=_0xa38a[_0x47507e];return _0x5c66eb;};'use strict';var _=require(_0xaa38('0x0'));var util=require(_0xaa38('0x1'));var moment=require(_0xaa38('0x2'));var BPromise=require(_0xaa38('0x3'));var rs=require(_0xaa38('0x4'));var fs=require('fs');var Redis=require(_0xaa38('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xaa38('0x6'));var logger=require(_0xaa38('0x7'))(_0xaa38('0x8'));var config=require(_0xaa38('0x9'));var jayson=require(_0xaa38('0xa'));var client=jayson['client'][_0xaa38('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a6ed8,_0x3d1a1a,_0x2433f2){return new BPromise(function(_0x987ce,_0x401b27){return client['request'](_0x2a6ed8,_0x2433f2)['then'](function(_0x4501d4){logger[_0xaa38('0xc')](_0xaa38('0xd'),_0x3d1a1a,'request\x20sent');logger[_0xaa38('0xe')](_0xaa38('0xf'),_0x3d1a1a,_0xaa38('0x10'),JSON['stringify'](_0x4501d4));if(_0x4501d4[_0xaa38('0x11')]){if(_0x4501d4[_0xaa38('0x11')][_0xaa38('0x12')]===0x1f4){logger[_0xaa38('0x11')](_0xaa38('0xd'),_0x3d1a1a,_0x4501d4[_0xaa38('0x11')]['message']);return _0x401b27(_0x4501d4[_0xaa38('0x11')]['message']);}logger[_0xaa38('0x11')](_0xaa38('0xd'),_0x3d1a1a,_0x4501d4[_0xaa38('0x11')][_0xaa38('0x13')]);return _0x987ce(_0x4501d4[_0xaa38('0x11')][_0xaa38('0x13')]);}else{logger['info'](_0xaa38('0xd'),_0x3d1a1a,_0xaa38('0x10'));_0x987ce(_0x4501d4[_0xaa38('0x14')][_0xaa38('0x13')]);}})[_0xaa38('0x15')](function(_0x4e5fb3){logger[_0xaa38('0x11')](_0xaa38('0xd'),_0x3d1a1a,_0x4e5fb3);_0x401b27(_0x4e5fb3);});});}exports['GetTrunk']=function(_0x4babe2){var _0x57bd33=this;return new Promise(function(_0x1f0eed,_0x848226){return db['Trunk'][_0xaa38('0x16')]({'raw':_0x4babe2[_0xaa38('0x17')]?_0x4babe2['options']['raw']===undefined?!![]:![]:!![],'where':_0x4babe2[_0xaa38('0x17')]?_0x4babe2[_0xaa38('0x17')]['where']||null:null,'attributes':_0x4babe2[_0xaa38('0x17')]?_0x4babe2[_0xaa38('0x17')][_0xaa38('0x18')]||null:null,'limit':_0x4babe2[_0xaa38('0x17')]?_0x4babe2[_0xaa38('0x17')][_0xaa38('0x19')]||null:null,'include':_0x4babe2[_0xaa38('0x17')]?_0x4babe2[_0xaa38('0x17')]['include']?_[_0xaa38('0x1a')](_0x4babe2[_0xaa38('0x17')][_0xaa38('0x1b')],function(_0x361762){return{'model':db[_0x361762[_0xaa38('0x1c')]],'as':_0x361762['as'],'attributes':_0x361762[_0xaa38('0x18')],'include':_0x361762[_0xaa38('0x1b')]?_['map'](_0x361762[_0xaa38('0x1b')],function(_0x47b4ad){return{'model':db[_0x47b4ad[_0xaa38('0x1c')]],'as':_0x47b4ad['as'],'attributes':_0x47b4ad[_0xaa38('0x18')],'include':_0x47b4ad[_0xaa38('0x1b')]?_[_0xaa38('0x1a')](_0x47b4ad['include'],function(_0x548711){return{'model':db[_0x548711[_0xaa38('0x1c')]],'as':_0x548711['as'],'attributes':_0x548711[_0xaa38('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x38c999){logger[_0xaa38('0xc')](_0xaa38('0x1d'),_0x4babe2);logger[_0xaa38('0xe')](_0xaa38('0x1d'),_0x4babe2,JSON[_0xaa38('0x1e')](_0x38c999));_0x1f0eed(_0x38c999);})[_0xaa38('0x15')](function(_0x8f3200){logger[_0xaa38('0x11')](_0xaa38('0x1d'),_0x8f3200[_0xaa38('0x13')],_0x4babe2);_0x848226(_0x57bd33[_0xaa38('0x11')](0x1f4,_0x8f3200[_0xaa38('0x13')]));});});};exports[_0xaa38('0x1f')]=function(_0x2fc42c){var _0x20deee=this;return new Promise(function(_0x3fd0fc,_0x49546f){return db[_0xaa38('0x20')][_0xaa38('0x21')]({'raw':_0x2fc42c[_0xaa38('0x17')]?_0x2fc42c[_0xaa38('0x17')][_0xaa38('0x22')]===undefined?!![]:![]:!![],'where':_0x2fc42c[_0xaa38('0x17')]?_0x2fc42c['options'][_0xaa38('0x23')]||null:null,'attributes':_0x2fc42c['options']?_0x2fc42c['options'][_0xaa38('0x18')]||null:null,'include':_0x2fc42c[_0xaa38('0x17')]?_0x2fc42c[_0xaa38('0x17')]['include']?_[_0xaa38('0x1a')](_0x2fc42c['options']['include'],function(_0x2b4a4){return{'model':db[_0x2b4a4[_0xaa38('0x1c')]],'as':_0x2b4a4['as'],'attributes':_0x2b4a4[_0xaa38('0x18')],'include':_0x2b4a4['include']?_[_0xaa38('0x1a')](_0x2b4a4['include'],function(_0x33ae3f){return{'model':db[_0x33ae3f[_0xaa38('0x1c')]],'as':_0x33ae3f['as'],'attributes':_0x33ae3f[_0xaa38('0x18')],'include':_0x33ae3f['include']?_[_0xaa38('0x1a')](_0x33ae3f['include'],function(_0x2e60c1){return{'model':db[_0x2e60c1[_0xaa38('0x1c')]],'as':_0x2e60c1['as'],'attributes':_0x2e60c1[_0xaa38('0x18')]};}):[]};}):[]};}):[]:[]})[_0xaa38('0x24')](function(_0x4e3e32){logger[_0xaa38('0xc')](_0xaa38('0x1f'),_0x2fc42c);logger['debug'](_0xaa38('0x1f'),_0x2fc42c,JSON[_0xaa38('0x1e')](_0x4e3e32));_0x3fd0fc(_0x4e3e32);})[_0xaa38('0x15')](function(_0x338e7c){logger[_0xaa38('0x11')](_0xaa38('0x1f'),_0x338e7c[_0xaa38('0x13')],_0x2fc42c);_0x49546f(_0x20deee[_0xaa38('0x11')](0x1f4,_0x338e7c[_0xaa38('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 4e3bc42..597f706 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 _0xe80a=['../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated','update'];(function(_0x1ade5d,_0x35b587){var _0x2e7a67=function(_0x10ec4a){while(--_0x10ec4a){_0x1ade5d['push'](_0x1ade5d['shift']());}};_0x2e7a67(++_0x35b587);}(_0xe80a,0x198));var _0xae80=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xe80a[_0x4cf98e];return _0x1623ac;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xae80('0x0'));var controller=require(_0xae80('0x1'));router[_0xae80('0x2')](_0xae80('0x3'),auth[_0xae80('0x4')](),controller[_0xae80('0x5')]);module['exports']=router; \ No newline at end of file +var _0x3be7=['./user-setting.controller','put','/:id','isAuthenticated','update','exports'];(function(_0x1ffd0f,_0x4d3c33){var _0x17cbeb=function(_0xbf1daa){while(--_0xbf1daa){_0x1ffd0f['push'](_0x1ffd0f['shift']());}};_0x17cbeb(++_0x4d3c33);}(_0x3be7,0xde));var _0x73be=function(_0x450d94,_0x4706fc){_0x450d94=_0x450d94-0x0;var _0x488ede=_0x3be7[_0x450d94];return _0x488ede;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x73be('0x0'));router[_0x73be('0x1')](_0x73be('0x2'),auth[_0x73be('0x3')](),controller[_0x73be('0x4')]);module[_0x73be('0x5')]=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 fe00d53..1d835a7 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 _0x0f41=['BOOLEAN','TEXT','DATE','INTEGER','sequelize','error','warning','info','debug','exports','ENUM'];(function(_0xb725be,_0x45bd01){var _0x2f2424=function(_0x2566ca){while(--_0x2566ca){_0xb725be['push'](_0xb725be['shift']());}};_0x2f2424(++_0x45bd01);}(_0x0f41,0xb4));var _0x10f4=function(_0x29ffea,_0x320708){_0x29ffea=_0x29ffea-0x0;var _0x52b685=_0x0f41[_0x29ffea];return _0x52b685;};'use strict';var Sequelize=require(_0x10f4('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x10f4('0x1'),_0x10f4('0x2'),_0x10f4('0x3'),_0x10f4('0x4')];module[_0x10f4('0x5')]={'clientSideLoggingLevel':{'type':Sequelize[_0x10f4('0x6')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x10f4('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x10f4('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x10f4('0x8')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x10f4('0x9')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x10f4('0xa')],'unique':'UserId'}}; \ No newline at end of file +var _0x1f84=['error','warning','info','debug','ENUM','BOOLEAN','DATE','INTEGER','UserId','sequelize'];(function(_0x5dee2a,_0x47d02a){var _0x31e98e=function(_0x48b1e9){while(--_0x48b1e9){_0x5dee2a['push'](_0x5dee2a['shift']());}};_0x31e98e(++_0x47d02a);}(_0x1f84,0x1c1));var _0x41f8=function(_0x5de58a,_0x23d58e){_0x5de58a=_0x5de58a-0x0;var _0x589a6d=_0x1f84[_0x5de58a];return _0x589a6d;};'use strict';var Sequelize=require(_0x41f8('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x41f8('0x1'),_0x41f8('0x2'),_0x41f8('0x3'),_0x41f8('0x4')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0x41f8('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x41f8('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x41f8('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x41f8('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x41f8('0x8')],'unique':_0x41f8('0x9')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index da1f760..59c8383 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 _0x47c7=['./user-setting.socket','register','redis','defaults','localhost','status','json','then','sendStatus','error','name','send','update','user','role','admin','Unauthorized','UserSetting','find','params','body','catch','lodash','../../config/logger','api','../../mysqldb','socket.io-emitter'];(function(_0x1cbca7,_0x3394da){var _0x31de2d=function(_0x2f0392){while(--_0x2f0392){_0x1cbca7['push'](_0x1cbca7['shift']());}};_0x31de2d(++_0x3394da);}(_0x47c7,0x1ab));var _0x747c=function(_0x1ab180,_0x382b2c){_0x1ab180=_0x1ab180-0x0;var _0xfb2c2d=_0x47c7[_0x1ab180];return _0xfb2c2d;};'use strict';var _=require(_0x747c('0x0'));var Redis=require('ioredis');var logger=require(_0x747c('0x1'))(_0x747c('0x2'));var config=require('../../config/environment');var db=require(_0x747c('0x3'))['db'];var socket=require(_0x747c('0x4'))(new Redis(config['redis']));require(_0x747c('0x5'))[_0x747c('0x6')](socket);config[_0x747c('0x7')]=_[_0x747c('0x8')](config['redis'],{'host':_0x747c('0x9'),'port':0x18eb});function respondWithResult(_0x4eb6bc,_0xfc4504){_0xfc4504=_0xfc4504||0xc8;return function(_0x24206f){if(_0x24206f){return _0x4eb6bc[_0x747c('0xa')](_0xfc4504)[_0x747c('0xb')](_0x24206f);}};}function saveUpdates(_0x363db1){return function(_0x516705){if(_0x516705){return _0x516705['update'](_0x363db1)[_0x747c('0xc')](function(_0x3b5d7c){return _0x3b5d7c;});}return null;};}function handleEntityNotFound(_0x240d02){return function(_0x47bd62){if(!_0x47bd62){_0x240d02[_0x747c('0xd')](0x194);}return _0x47bd62;};}function handleError(_0x28b782,_0x17c985){_0x17c985=_0x17c985||0x1f4;return function(_0x59e376){logger[_0x747c('0xe')](_0x59e376['stack']);if(_0x59e376['name']){delete _0x59e376[_0x747c('0xf')];}_0x28b782[_0x747c('0xa')](_0x17c985)[_0x747c('0x10')](_0x59e376);};}exports[_0x747c('0x11')]=function(_0xc4b65f,_0x2fb1e0){if(_0xc4b65f[_0x747c('0x12')][_0x747c('0x13')]!==_0x747c('0x14'))throw new Error(_0x747c('0x15'));if(isNaN(Number(_0xc4b65f['params']['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0x747c('0x16')][_0x747c('0x17')]({'where':{'id':_0xc4b65f[_0x747c('0x18')]['id']}})['then'](handleEntityNotFound(_0x2fb1e0,null))[_0x747c('0xc')](saveUpdates(_0xc4b65f[_0x747c('0x19')],null))[_0x747c('0xc')](respondWithResult(_0x2fb1e0,null))[_0x747c('0x1a')](handleError(_0x2fb1e0,null));}; \ No newline at end of file +var _0x5bbd=['sendStatus','error','stack','name','send','role','admin','Unauthorized','UserSetting','find','body','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','defaults','status','json','update','then'];(function(_0x200b0e,_0xe7e308){var _0x4fa52c=function(_0x1255da){while(--_0x1255da){_0x200b0e['push'](_0x200b0e['shift']());}};_0x4fa52c(++_0xe7e308);}(_0x5bbd,0x12b));var _0xd5bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5bbd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd5bb('0x0'));var Redis=require(_0xd5bb('0x1'));var logger=require(_0xd5bb('0x2'))(_0xd5bb('0x3'));var config=require(_0xd5bb('0x4'));var db=require(_0xd5bb('0x5'))['db'];var socket=require(_0xd5bb('0x6'))(new Redis(config['redis']));require('./user-setting.socket')['register'](socket);config[_0xd5bb('0x7')]=_[_0xd5bb('0x8')](config['redis'],{'host':'localhost','port':0x18eb});function respondWithResult(_0x292873,_0x5093d3){_0x5093d3=_0x5093d3||0xc8;return function(_0x3878ba){if(_0x3878ba){return _0x292873[_0xd5bb('0x9')](_0x5093d3)[_0xd5bb('0xa')](_0x3878ba);}};}function saveUpdates(_0x495934){return function(_0x5187bd){if(_0x5187bd){return _0x5187bd[_0xd5bb('0xb')](_0x495934)[_0xd5bb('0xc')](function(_0xca93ab){return _0xca93ab;});}return null;};}function handleEntityNotFound(_0x4b76af){return function(_0x24349b){if(!_0x24349b){_0x4b76af[_0xd5bb('0xd')](0x194);}return _0x24349b;};}function handleError(_0x408ef2,_0x55a320){_0x55a320=_0x55a320||0x1f4;return function(_0x51705b){logger[_0xd5bb('0xe')](_0x51705b[_0xd5bb('0xf')]);if(_0x51705b['name']){delete _0x51705b[_0xd5bb('0x10')];}_0x408ef2['status'](_0x55a320)[_0xd5bb('0x11')](_0x51705b);};}exports['update']=function(_0x16cc5c,_0x67920e){if(_0x16cc5c['user'][_0xd5bb('0x12')]!==_0xd5bb('0x13'))throw new Error(_0xd5bb('0x14'));if(isNaN(Number(_0x16cc5c['params']['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0xd5bb('0x15')][_0xd5bb('0x16')]({'where':{'id':_0x16cc5c['params']['id']}})[_0xd5bb('0xc')](handleEntityNotFound(_0x67920e,null))[_0xd5bb('0xc')](saveUpdates(_0x16cc5c[_0xd5bb('0x17')],null))[_0xd5bb('0xc')](respondWithResult(_0x67920e,null))['catch'](handleError(_0x67920e,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 cb7c026..aac65c2 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 _0x48ad=['save','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x44b3bd,_0x44c97d){var _0x1efc4a=function(_0x5d0205){while(--_0x5d0205){_0x44b3bd['push'](_0x44b3bd['shift']());}};_0x1efc4a(++_0x44c97d);}(_0x48ad,0xa5));var _0xd48a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x48ad[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xd48a('0x0'));var UserSetting=require(_0xd48a('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xd48a('0x2')](0x0);var events={'afterCreate':_0xd48a('0x3'),'afterUpdate':'update','afterDestroy':_0xd48a('0x4')};function emitEvent(_0x17f413){return function(_0x2c8da8,_0x5c46a6,_0x55e4e2){UserSettingEvents[_0xd48a('0x5')](_0x17f413+':'+_0x2c8da8['id'],_0x2c8da8);UserSettingEvents['emit'](_0x17f413,_0x2c8da8);_0x55e4e2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0xd48a('0x6')](e,emitEvent(event));}}module[_0xd48a('0x7')]=UserSettingEvents; \ No newline at end of file +var _0xf01f=['save','update','remove','emit','hook','exports','UserSetting','setMaxListeners'];(function(_0x3edce4,_0x3c085c){var _0x911b58=function(_0xe39d1a){while(--_0xe39d1a){_0x3edce4['push'](_0x3edce4['shift']());}};_0x911b58(++_0x3c085c);}(_0xf01f,0x1de));var _0xff01=function(_0x2cee69,_0x3add59){_0x2cee69=_0x2cee69-0x0;var _0x370809=_0xf01f[_0x2cee69];return _0x370809;};'use strict';var EventEmitter=require('events');var UserSetting=require('../../mysqldb')['db'][_0xff01('0x0')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xff01('0x1')](0x0);var events={'afterCreate':_0xff01('0x2'),'afterUpdate':_0xff01('0x3'),'afterDestroy':_0xff01('0x4')};function emitEvent(_0x298af8){return function(_0x11d756,_0x4eb25a,_0x2b65c3){UserSettingEvents['emit'](_0x298af8+':'+_0x11d756['id'],_0x11d756);UserSettingEvents[_0xff01('0x5')](_0x298af8,_0x11d756);_0x2b65c3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0xff01('0x6')](e,emitEvent(event));}}module[_0xff01('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 cdbeb05..41c6d1f 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 _0x261b=['clientSideLoggingEnabledSince','./user-setting.attributes','exports'];(function(_0x3a0aaf,_0x307194){var _0x3a7db6=function(_0x510d5c){while(--_0x510d5c){_0x3a0aaf['push'](_0x3a0aaf['shift']());}};_0x3a7db6(++_0x307194);}(_0x261b,0x15a));var _0xb261=function(_0x14f13b,_0x24e830){_0x14f13b=_0x14f13b-0x0;var _0x55201d=_0x261b[_0x14f13b];return _0x55201d;};'use strict';var attributes=require(_0xb261('0x0'));module[_0xb261('0x1')]=function(_0x53bded){return _0x53bded['define']('UserSetting',attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x392d5c){if(!_0x392d5c['clientSideLoggingEnabled'])_0x392d5c[_0xb261('0x2')]=null;else if(_0x392d5c['clientSideLoggingEnabledSince']===null)_0x392d5c[_0xb261('0x2')]=new Date();}}});}; \ No newline at end of file +var _0xffaa=['exports','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x476a8c,_0x569ad3){var _0x5af6eb=function(_0x417695){while(--_0x417695){_0x476a8c['push'](_0x476a8c['shift']());}};_0x5af6eb(++_0x569ad3);}(_0xffaa,0x130));var _0xaffa=function(_0x1dc61f,_0x1410d4){_0x1dc61f=_0x1dc61f-0x0;var _0x26198b=_0xffaa[_0x1dc61f];return _0x26198b;};'use strict';var attributes=require(_0xaffa('0x0'));module[_0xaffa('0x1')]=function(_0x2c0e94){return _0x2c0e94['define']('UserSetting',attributes,{'tableName':_0xaffa('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2433d9){if(!_0x2433d9[_0xaffa('0x3')])_0x2433d9[_0xaffa('0x4')]=null;else if(_0x2433d9[_0xaffa('0x4')]===null)_0x2433d9[_0xaffa('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 b0f88eb..b6a9346 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 _0x947e=['user-setting:update:user-','UserId','register','user-setting:','./user-setting.events','save','remove','update','emit','user-setting:update'];(function(_0x58ad98,_0x39d6bd){var _0x3fd586=function(_0xb16ef){while(--_0xb16ef){_0x58ad98['push'](_0x58ad98['shift']());}};_0x3fd586(++_0x39d6bd);}(_0x947e,0x130));var _0xe947=function(_0xcd28,_0x314a13){_0xcd28=_0xcd28-0x0;var _0x1aa3bf=_0x947e[_0xcd28];return _0x1aa3bf;};'use strict';var UserSettingEvents=require(_0xe947('0x0'));var events=[_0xe947('0x1'),_0xe947('0x2'),_0xe947('0x3')];function createListener(_0x16e7a1,_0x4f1cbe){return function(_0xecd99){_0x4f1cbe[_0xe947('0x4')](_0x16e7a1,_0xecd99);if(_0x16e7a1===_0xe947('0x5')){_0x4f1cbe['emit'](_0xe947('0x6')+_0xecd99[_0xe947('0x7')],_0xecd99);}};}exports[_0xe947('0x8')]=function(_0x4b9d80){for(var _0x48ef87=0x0,_0x12f29d=events['length'];_0x48ef87<_0x12f29d;_0x48ef87++){var _0x280bf3=events[_0x48ef87];var _0x2dce5e=createListener(_0xe947('0x9')+_0x280bf3,_0x4b9d80);UserSettingEvents['on'](_0x280bf3,_0x2dce5e);}}; \ No newline at end of file +var _0xc926=['length','./user-setting.events','save','remove','update','emit','user-setting:update','user-setting:update:user-','UserId','register'];(function(_0x57be54,_0x5d087b){var _0x5f5893=function(_0x2342ba){while(--_0x2342ba){_0x57be54['push'](_0x57be54['shift']());}};_0x5f5893(++_0x5d087b);}(_0xc926,0x6f));var _0x6c92=function(_0x3d4b21,_0x4e708b){_0x3d4b21=_0x3d4b21-0x0;var _0x33ebf3=_0xc926[_0x3d4b21];return _0x33ebf3;};'use strict';var UserSettingEvents=require(_0x6c92('0x0'));var events=[_0x6c92('0x1'),_0x6c92('0x2'),_0x6c92('0x3')];function createListener(_0x46d19a,_0x196074){return function(_0x51932){_0x196074[_0x6c92('0x4')](_0x46d19a,_0x51932);if(_0x46d19a===_0x6c92('0x5')){_0x196074[_0x6c92('0x4')](_0x6c92('0x6')+_0x51932[_0x6c92('0x7')],_0x51932);}};}exports[_0x6c92('0x8')]=function(_0x2ff4c7){for(var _0x5ae8bf=0x0,_0x593844=events[_0x6c92('0x9')];_0x5ae8bf<_0x593844;_0x5ae8bf++){var _0x7f7d2=events[_0x5ae8bf];var _0x1e8581=createListener('user-setting:'+_0x7f7d2,_0x2ff4c7);UserSettingEvents['on'](_0x7f7d2,_0x1e8581);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 1341c36..d8ccd59 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 _0x4d11=['/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','addContacts','post','/create_many','bulkCreate','addQueues','diskStorage','join','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addOpenchannelAccounts','addWhatsappAccounts','/:id/api_key','put','changePassword','removeQueues','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/mail_accounts','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites'];(function(_0x44d869,_0x49425f){var _0x1ed521=function(_0x2c2968){while(--_0x2c2968){_0x44d869['push'](_0x44d869['shift']());}};_0x1ed521(++_0x49425f);}(_0x4d11,0x10f));var _0x14d1=function(_0x32c8ed,_0x45fef2){_0x32c8ed=_0x32c8ed-0x0;var _0x580764=_0x4d11[_0x32c8ed];return _0x580764;};'use strict';var multer=require(_0x14d1('0x0'));var util=require(_0x14d1('0x1'));var path=require(_0x14d1('0x2'));var timeout=require(_0x14d1('0x3'));var express=require('express');var router=express[_0x14d1('0x4')]();var fs_extra=require(_0x14d1('0x5'));var auth=require(_0x14d1('0x6'));var interaction=require(_0x14d1('0x7'));var config=require(_0x14d1('0x8'));var controller=require('./user.controller');router[_0x14d1('0x9')]('/',auth[_0x14d1('0xa')](),controller[_0x14d1('0xb')]);router[_0x14d1('0x9')](_0x14d1('0xc'),auth['isAuthenticated'](),controller[_0x14d1('0xd')]);router[_0x14d1('0x9')]('/whoami',auth[_0x14d1('0xa')](),controller['whoami']);router['get'](_0x14d1('0xe'),auth[_0x14d1('0xa')](),controller[_0x14d1('0xf')]);router[_0x14d1('0x9')](_0x14d1('0x10'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x11')]);router[_0x14d1('0x9')](_0x14d1('0x12'),controller[_0x14d1('0x13')]);router['get']('/:id/open_tabs',auth[_0x14d1('0xa')](),controller[_0x14d1('0x14')]);router[_0x14d1('0x9')](_0x14d1('0x15'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x16')]);router[_0x14d1('0x9')](_0x14d1('0x17'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x18')]);router[_0x14d1('0x9')](_0x14d1('0x19'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x1a')]);router['get'](_0x14d1('0x1b'),auth['isAuthenticated'](),controller[_0x14d1('0x1c')]);router[_0x14d1('0x9')]('/:id/recordings',auth['isAuthenticated'](),controller[_0x14d1('0x1d')]);router[_0x14d1('0x9')](_0x14d1('0x1e'),auth[_0x14d1('0xa')](),controller['getScreenRecordings']);router[_0x14d1('0x9')]('/:id/chat/interactions',auth[_0x14d1('0xa')](),controller[_0x14d1('0x1f')]);router['get'](_0x14d1('0x20'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x21')]);router[_0x14d1('0x9')]('/:id/mail/interactions',auth[_0x14d1('0xa')](),controller['getMailInteractions']);router[_0x14d1('0x9')]('/:id/sms/interactions',auth[_0x14d1('0xa')](),controller[_0x14d1('0x22')]);router[_0x14d1('0x9')](_0x14d1('0x23'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x24')]);router[_0x14d1('0x9')]('/:id/whatsapp/interactions',auth[_0x14d1('0xa')](),controller[_0x14d1('0x25')]);router[_0x14d1('0x9')](_0x14d1('0x26'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x27')]);router['get'](_0x14d1('0x28'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x29')]);router[_0x14d1('0x9')](_0x14d1('0x2a'),auth[_0x14d1('0xa')](),controller['getAgents']);router[_0x14d1('0x9')](_0x14d1('0x2b'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x2c')]);router[_0x14d1('0x9')](_0x14d1('0x2d'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x2e')]);router[_0x14d1('0x9')]('/:id/mail_accounts',auth[_0x14d1('0xa')](),controller[_0x14d1('0x2f')]);router[_0x14d1('0x9')](_0x14d1('0x30'),auth['isAuthenticated'](),controller[_0x14d1('0x31')]);router['get'](_0x14d1('0x32'),auth['isAuthenticated'](),controller['getSmsAccounts']);router['get'](_0x14d1('0x33'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x34')]);router[_0x14d1('0x9')](_0x14d1('0x35'),auth['isAuthenticated'](),controller[_0x14d1('0x36')]);router[_0x14d1('0x9')](_0x14d1('0x37'),auth['isAuthenticated'](),controller[_0x14d1('0x38')]);router['get']('/:id/api_key',auth[_0x14d1('0xa')](),controller['getApiKey']);router['post']('/:id/contacts',auth['isAuthenticated'](),controller[_0x14d1('0x39')]);router[_0x14d1('0x3a')]('/',auth[_0x14d1('0xa')](),controller['create']);router[_0x14d1('0x3a')](_0x14d1('0x3b'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x3c')]);router[_0x14d1('0x3a')](_0x14d1('0x17'),auth['isAuthenticated'](),controller[_0x14d1('0x3d')]);var upload=multer({'storage':multer[_0x14d1('0x3e')]({'destination':function(_0x51276e,_0x2b706b,_0x4a66a8){_0x4a66a8(null,path[_0x14d1('0x3f')](config['root'],_0x14d1('0x40')));},'filename':function(_0x88352,_0x460eb1,_0x5f2344){_0x5f2344(null,util[_0x14d1('0x41')](_0x14d1('0x42'),Date[_0x14d1('0x43')](),_0x460eb1[_0x14d1('0x44')]));}})});router[_0x14d1('0x3a')](_0x14d1('0x12'),upload[_0x14d1('0x45')](_0x14d1('0x46')),controller[_0x14d1('0x47')]);router[_0x14d1('0x3a')](_0x14d1('0x48'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x49')]);router[_0x14d1('0x3a')](_0x14d1('0x4a'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x4b')]);router[_0x14d1('0x3a')](_0x14d1('0x4c'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x4d')]);router['post'](_0x14d1('0x4e'),auth['isAuthenticated'](),controller[_0x14d1('0x4f')]);router[_0x14d1('0x3a')]('/:id/teams',auth[_0x14d1('0xa')](),controller[_0x14d1('0x50')]);router['post'](_0x14d1('0x51'),auth['isAuthenticated'](),controller['addChatInteractions']);router[_0x14d1('0x3a')](_0x14d1('0x52'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x53')]);router['post'](_0x14d1('0x54'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x55')]);router[_0x14d1('0x3a')](_0x14d1('0x56'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x57')]);router[_0x14d1('0x3a')]('/:id/openchannel_interactions',auth[_0x14d1('0xa')](),controller['addOpenchannelInteractions']);router[_0x14d1('0x3a')](_0x14d1('0x58'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x59')]);router[_0x14d1('0x3a')](_0x14d1('0x2d'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x5a')]);router[_0x14d1('0x3a')]('/:id/mail_accounts',auth[_0x14d1('0xa')](),controller['addMailAccounts']);router[_0x14d1('0x3a')](_0x14d1('0x30'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x5b')]);router[_0x14d1('0x3a')](_0x14d1('0x32'),auth['isAuthenticated'](),controller['addSmsAccounts']);router[_0x14d1('0x3a')](_0x14d1('0x33'),auth['isAuthenticated'](),controller['addChatWebsites']);router[_0x14d1('0x3a')](_0x14d1('0x35'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x5c')]);router[_0x14d1('0x3a')](_0x14d1('0x5d'),auth['isAuthenticated'](),controller['createApiKey']);router['put'](_0x14d1('0x10'),auth[_0x14d1('0xa')](),controller['update']);router[_0x14d1('0x5e')]('/:id/password',auth[_0x14d1('0xa')](),controller[_0x14d1('0x5f')]);router['delete'](_0x14d1('0x17'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x60')]);router[_0x14d1('0x61')](_0x14d1('0x26'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x62')]);router['delete']('/:id',auth[_0x14d1('0xa')](),controller[_0x14d1('0x63')]);router[_0x14d1('0x61')](_0x14d1('0x51'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x64')]);router[_0x14d1('0x61')](_0x14d1('0x52'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x65')]);router[_0x14d1('0x61')](_0x14d1('0x54'),auth[_0x14d1('0xa')](),controller['removeFaxInteractions']);router[_0x14d1('0x61')](_0x14d1('0x56'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x66')]);router[_0x14d1('0x61')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x14d1('0x67')]);router[_0x14d1('0x61')](_0x14d1('0x58'),auth[_0x14d1('0xa')](),controller['removeWhatsappInteractions']);router[_0x14d1('0x61')](_0x14d1('0x2d'),auth[_0x14d1('0xa')](),controller['removeFaxAccounts']);router[_0x14d1('0x61')](_0x14d1('0x68'),auth['isAuthenticated'](),controller['removeMailAccounts']);router['delete'](_0x14d1('0x30'),auth[_0x14d1('0xa')](),controller['removeOpenchannelAccounts']);router['delete'](_0x14d1('0x32'),auth[_0x14d1('0xa')](),controller['removeSmsAccounts']);router[_0x14d1('0x61')](_0x14d1('0x33'),auth[_0x14d1('0xa')](),controller['removeChatWebsites']);router[_0x14d1('0x61')](_0x14d1('0x35'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x69')]);router[_0x14d1('0x61')](_0x14d1('0x5d'),auth[_0x14d1('0xa')](),controller[_0x14d1('0x6a')]);module[_0x14d1('0x6b')]=router; \ No newline at end of file +var _0xeea4=['join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','/:id/fax_accounts','addMailAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','update','put','/:id/password','delete','removeQueues','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','/:id/chat_websites','removeChatWebsites','removeApiKey','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','isAuthenticated','index','get','describe','/whoami','whoami','getPresence','/:id','show','/:id/avatar','getAvatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getApiKey','addContacts','post','create','/create_many','bulkCreate','addQueues','diskStorage'];(function(_0x1f3246,_0xf1764a){var _0x5487a0=function(_0xcd419a){while(--_0xcd419a){_0x1f3246['push'](_0x1f3246['shift']());}};_0x5487a0(++_0xf1764a);}(_0xeea4,0x19e));var _0x4eea=function(_0x3b8dd8,_0x894728){_0x3b8dd8=_0x3b8dd8-0x0;var _0x4112cd=_0xeea4[_0x3b8dd8];return _0x4112cd;};'use strict';var multer=require(_0x4eea('0x0'));var util=require(_0x4eea('0x1'));var path=require(_0x4eea('0x2'));var timeout=require(_0x4eea('0x3'));var express=require(_0x4eea('0x4'));var router=express[_0x4eea('0x5')]();var fs_extra=require(_0x4eea('0x6'));var auth=require(_0x4eea('0x7'));var interaction=require(_0x4eea('0x8'));var config=require('../../config/environment');var controller=require(_0x4eea('0x9'));router['get']('/',auth[_0x4eea('0xa')](),controller[_0x4eea('0xb')]);router[_0x4eea('0xc')]('/describe',auth[_0x4eea('0xa')](),controller[_0x4eea('0xd')]);router['get'](_0x4eea('0xe'),auth[_0x4eea('0xa')](),controller[_0x4eea('0xf')]);router[_0x4eea('0xc')]('/presence',auth[_0x4eea('0xa')](),controller[_0x4eea('0x10')]);router[_0x4eea('0xc')](_0x4eea('0x11'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x12')]);router[_0x4eea('0xc')](_0x4eea('0x13'),controller[_0x4eea('0x14')]);router[_0x4eea('0xc')]('/:id/open_tabs',auth['isAuthenticated'](),controller[_0x4eea('0x15')]);router[_0x4eea('0xc')](_0x4eea('0x16'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x17')]);router[_0x4eea('0xc')](_0x4eea('0x18'),auth[_0x4eea('0xa')](),controller['getQueues']);router[_0x4eea('0xc')](_0x4eea('0x19'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x1a')]);router['get'](_0x4eea('0x1b'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x1c')]);router[_0x4eea('0xc')](_0x4eea('0x1d'),auth['isAuthenticated'](),controller[_0x4eea('0x1e')]);router[_0x4eea('0xc')]('/:id/screen_recordings',auth[_0x4eea('0xa')](),controller[_0x4eea('0x1f')]);router[_0x4eea('0xc')](_0x4eea('0x20'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x21')]);router['get'](_0x4eea('0x22'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x23')]);router[_0x4eea('0xc')](_0x4eea('0x24'),auth['isAuthenticated'](),controller['getMailInteractions']);router[_0x4eea('0xc')]('/:id/sms/interactions',auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0x4eea('0xc')](_0x4eea('0x25'),auth['isAuthenticated'](),controller[_0x4eea('0x26')]);router['get'](_0x4eea('0x27'),auth['isAuthenticated'](),controller[_0x4eea('0x28')]);router['get'](_0x4eea('0x29'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x2a')]);router[_0x4eea('0xc')](_0x4eea('0x2b'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x2c')]);router[_0x4eea('0xc')](_0x4eea('0x2d'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x2e')]);router['get']('/:id/prefixes',auth[_0x4eea('0xa')](),controller[_0x4eea('0x2f')]);router['get']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x4eea('0x30')]);router['get'](_0x4eea('0x31'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x32')]);router['get'](_0x4eea('0x33'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x34')]);router['get'](_0x4eea('0x35'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x36')]);router['get']('/:id/chat_websites',auth[_0x4eea('0xa')](),controller[_0x4eea('0x37')]);router['get'](_0x4eea('0x38'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x39')]);router[_0x4eea('0xc')]('/:id/scheduled_calls',auth[_0x4eea('0xa')](),controller['getScheduledCalls']);router[_0x4eea('0xc')]('/:id/api_key',auth[_0x4eea('0xa')](),controller[_0x4eea('0x3a')]);router['post'](_0x4eea('0x16'),auth['isAuthenticated'](),controller[_0x4eea('0x3b')]);router[_0x4eea('0x3c')]('/',auth['isAuthenticated'](),controller[_0x4eea('0x3d')]);router[_0x4eea('0x3c')](_0x4eea('0x3e'),auth['isAuthenticated'](),controller[_0x4eea('0x3f')]);router['post']('/:id/queues',auth[_0x4eea('0xa')](),controller[_0x4eea('0x40')]);var upload=multer({'storage':multer[_0x4eea('0x41')]({'destination':function(_0x4c8dd2,_0x57e9b6,_0x1c66c0){_0x1c66c0(null,path[_0x4eea('0x42')](config[_0x4eea('0x43')],_0x4eea('0x44')));},'filename':function(_0x414552,_0x484d1f,_0x1c877b){_0x1c877b(null,util[_0x4eea('0x45')](_0x4eea('0x46'),Date[_0x4eea('0x47')](),_0x484d1f[_0x4eea('0x48')]));}})});router[_0x4eea('0x3c')](_0x4eea('0x13'),upload[_0x4eea('0x49')](_0x4eea('0x4a')),controller[_0x4eea('0x4b')]);router['post'](_0x4eea('0x4c'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x4d')]);router[_0x4eea('0x3c')]('/:id/logout',auth['isAuthenticated'](),controller[_0x4eea('0x4e')]);router['post'](_0x4eea('0x4f'),auth['isAuthenticated'](),controller[_0x4eea('0x50')]);router[_0x4eea('0x3c')](_0x4eea('0x51'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x52')]);router[_0x4eea('0x3c')]('/:id/teams',auth['isAuthenticated'](),controller[_0x4eea('0x53')]);router[_0x4eea('0x3c')](_0x4eea('0x54'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x55')]);router[_0x4eea('0x3c')](_0x4eea('0x56'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x57')]);router[_0x4eea('0x3c')](_0x4eea('0x58'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x59')]);router['post'](_0x4eea('0x5a'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x5b')]);router[_0x4eea('0x3c')](_0x4eea('0x5c'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x5d')]);router[_0x4eea('0x3c')](_0x4eea('0x5e'),auth[_0x4eea('0xa')](),controller['addWhatsappInteractions']);router['post'](_0x4eea('0x5f'),auth[_0x4eea('0xa')](),controller['addFaxAccounts']);router[_0x4eea('0x3c')](_0x4eea('0x31'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x60')]);router['post'](_0x4eea('0x33'),auth[_0x4eea('0xa')](),controller['addOpenchannelAccounts']);router['post'](_0x4eea('0x35'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x61')]);router['post']('/:id/chat_websites',auth[_0x4eea('0xa')](),controller[_0x4eea('0x62')]);router[_0x4eea('0x3c')]('/:id/whatsapp_accounts',auth[_0x4eea('0xa')](),controller[_0x4eea('0x63')]);router[_0x4eea('0x3c')]('/:id/api_key',auth[_0x4eea('0xa')](),controller[_0x4eea('0x64')]);router['put'](_0x4eea('0x11'),auth['isAuthenticated'](),controller[_0x4eea('0x65')]);router[_0x4eea('0x66')](_0x4eea('0x67'),auth[_0x4eea('0xa')](),controller['changePassword']);router[_0x4eea('0x68')](_0x4eea('0x18'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x69')]);router[_0x4eea('0x68')](_0x4eea('0x29'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x4eea('0x11'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x6a')]);router[_0x4eea('0x68')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x4eea('0x6b')]);router[_0x4eea('0x68')](_0x4eea('0x56'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x6c')]);router[_0x4eea('0x68')](_0x4eea('0x58'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x6d')]);router[_0x4eea('0x68')](_0x4eea('0x5a'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x6e')]);router[_0x4eea('0x68')](_0x4eea('0x5c'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x6f')]);router[_0x4eea('0x68')]('/:id/whatsapp_interactions',auth[_0x4eea('0xa')](),controller[_0x4eea('0x70')]);router['delete'](_0x4eea('0x5f'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x71')]);router[_0x4eea('0x68')](_0x4eea('0x31'),auth[_0x4eea('0xa')](),controller['removeMailAccounts']);router[_0x4eea('0x68')](_0x4eea('0x33'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x72')]);router[_0x4eea('0x68')](_0x4eea('0x35'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x73')]);router[_0x4eea('0x68')](_0x4eea('0x74'),auth[_0x4eea('0xa')](),controller[_0x4eea('0x75')]);router[_0x4eea('0x68')](_0x4eea('0x38'),auth[_0x4eea('0xa')](),controller['removeWhatsappAccounts']);router[_0x4eea('0x68')]('/:id/api_key',auth[_0x4eea('0xa')](),controller[_0x4eea('0x76')]);module[_0x4eea('0x77')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 7b8e99b..df560fc 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 _0x9c44=['get','udp','encryption','avpf','force_avp','icesupport','dtlscertfile','dtlsprivatekey','wss','dtlsenable','dtlsverify','dtlssetup','actpass','/etc/pki/tls/certs/motion.crt','rtcp_mux','permissions','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','util','lodash','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','admin','user','telephone','local','INTEGER','internal','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','accept','refuse','originate','uac','uas','fingerprint','certificate','active','update,nonat','TEXT'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x49c4('0x0'));var _=require(_0x49c4('0x1'));module[_0x49c4('0x2')]={'name':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2ad237){this['setDataValue']('name',_0x2ad237);this[_0x49c4('0x5')]('defaultuser',_0x2ad237);},'comment':_0x49c4('0x6')},'fullname':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'set':function(_0x69bc41){this[_0x49c4('0x5')](_0x49c4('0x7'),_0x69bc41);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),_0x69bc41,this[_0x49c4('0xb')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0xc'),'validate':{'isEmail':!![]},'set':function(_0x58cad7){if(_0x58cad7){this[_0x49c4('0x5')](_0x49c4('0xc'),_0x58cad7['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x49c4('0xd'),_0x49c4('0xe'),'agent',_0x49c4('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0x10')},'internal':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':![],'unique':_0x49c4('0x12'),'set':function(_0x2decee){this[_0x49c4('0x5')](_0x49c4('0x12'),_0x2decee);this[_0x49c4('0x5')](_0x49c4('0x13'),_0x2decee);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),this[_0x49c4('0xb')](_0x49c4('0x7')),_0x2decee));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x49c4('0x3')]},'mobile':{'type':Sequelize[_0x49c4('0x3')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x49c4('0x3')]},'city':{'type':Sequelize[_0x49c4('0x3')]},'country':{'type':Sequelize[_0x49c4('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x49c4('0x14')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':_0x49c4('0x16')},'lastPauseAt':{'type':Sequelize[_0x49c4('0x14')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x17')},'ipaddr':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x19'),'user',_0x49c4('0x1a')),'allowNull':!![],'defaultValue':_0x49c4('0x19')},'context':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x1b')},'callingpres':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x1c'),_0x49c4('0x1d'),_0x49c4('0x1e'),_0x49c4('0x1f'),_0x49c4('0x20'),_0x49c4('0x21'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x38ad77){this[_0x49c4('0x5')](_0x49c4('0x22'),_0x38ad77?_0x38ad77[_0x49c4('0x23')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x49c4('0xb')](_0x49c4('0x22'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x25')},'dtmfmode':{'type':Sequelize[_0x49c4('0x18')]('rfc2833',_0x49c4('0x26'),_0x49c4('0x27'),_0x49c4('0x28'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x49c4('0x2d'),'set':function(_0x5b96df){this[_0x49c4('0x5')](_0x49c4('0x2e'),_0x5b96df?_0x5b96df[_0x49c4('0x23')](','):null);},'get':function(){return this[_0x49c4('0xb')]('nat')?this[_0x49c4('0xb')](_0x49c4('0x2e'))[_0x49c4('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedcallgroup':{'type':Sequelize[_0x49c4('0x3')]},'pickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'language':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x49c4('0x3')]},'disallow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x2f')},'allow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x30'),'set':function(_0x1e506a){this['setDataValue'](_0x49c4('0x31'),_0x1e506a?_0x1e506a[_0x49c4('0x23')](';'):_0x49c4('0x30'));},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x31'))?this[_0x49c4('0xb')](_0x49c4('0x31'))[_0x49c4('0x24')](';'):null;},'comment':_0x49c4('0x32')},'autoframing':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'set':function(_0x326142){this['setDataValue'](_0x49c4('0x33'),_0x326142?_0x326142['join'](','):null);},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x33'))?this[_0x49c4('0xb')](_0x49c4('0x33'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x34')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x35')},'amaflags':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x36'),_0x49c4('0x37'),_0x49c4('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x39'),'uas'),'allowNull':!![],'defaultValue':_0x49c4('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x3b'),_0x49c4('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x3d'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x49c4('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x49c4('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x49c4('0x3f')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x10dec7){this[_0x49c4('0x5')]('showWebBar',_0x10dec7);var _0x39c455=this[_0x49c4('0x40')]({'plain':!![]});switch(_0x10dec7){case 0x0:case 0x1:var _0x4f50bf=_0x39c455['transport']?_['isArray'](_0x39c455['transport'])?_0x39c455[_0x49c4('0x22')]['join']():_0x39c455[_0x49c4('0x22')]:_0x49c4('0x41');if(_0x4f50bf==='wss'){_0x4f50bf=_0x49c4('0x41');}this[_0x49c4('0x5')]('transport',_0x4f50bf);this[_0x49c4('0x5')](_0x49c4('0x42'),'no');this[_0x49c4('0x5')](_0x49c4('0x43'),null);this['setDataValue'](_0x49c4('0x44'),null);this[_0x49c4('0x5')](_0x49c4('0x45'),null);this[_0x49c4('0x5')]('dtlsenable',null);this[_0x49c4('0x5')]('dtlsverify',null);this['setDataValue']('dtlssetup',null);this['setDataValue'](_0x49c4('0x46'),null);this[_0x49c4('0x5')](_0x49c4('0x47'),null);this[_0x49c4('0x5')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x49c4('0x22'),_0x49c4('0x48'));this[_0x49c4('0x5')](_0x49c4('0x42'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x43'),_0x49c4('0x29'));this['setDataValue'](_0x49c4('0x44'),'yes');this[_0x49c4('0x5')](_0x49c4('0x45'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x49'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x4a'),'no');this[_0x49c4('0x5')](_0x49c4('0x4b'),_0x49c4('0x4c'));this[_0x49c4('0x5')](_0x49c4('0x46'),_0x39c455[_0x49c4('0x46')]||_0x49c4('0x4d'));this[_0x49c4('0x5')](_0x49c4('0x47'),_0x39c455[_0x49c4('0x47')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0x49c4('0x4e'),_0x49c4('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x1a15f3){this[_0x49c4('0x5')](_0x49c4('0x4f'),_0x1a15f3?_0x1a15f3[_0x49c4('0x23')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_['map'](this[_0x49c4('0xb')](_0x49c4('0x4f'))[_0x49c4('0x24')](','),function(_0x2f4289){return parseInt(_0x2f4289,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x50'))?this[_0x49c4('0xb')](_0x49c4('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x27b77d){if(typeof _0x27b77d===_0x49c4('0x51')){var _0x34870e=_0x27b77d==='1'?!![]:_0x27b77d==='0'?![]:_0x27b77d==='true'?!![]:_0x27b77d===_0x49c4('0x52')?![]:![];this[_0x49c4('0x5')](_0x49c4('0x53'),_0x34870e);}else{this[_0x49c4('0x5')](_0x49c4('0x53'),_0x27b77d);}}},'blocked':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x38b291){this[_0x49c4('0x5')](_0x49c4('0x54'),_0x38b291);if(_0x38b291===!![]){this[_0x49c4('0x5')]('blockedAt',moment());this[_0x49c4('0x5')](_0x49c4('0x55'),0x0);}else{this['setDataValue'](_0x49c4('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x49c4('0x11')](0x5)[_0x49c4('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xcb91=['toLowerCase','ENUM','admin','user','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','insecure','never','always','accept','originate','uac','uas','fingerprint','certificate','active','passive','update','showWebBar','get','isArray','encryption','avpf','icesupport','dtlsverify','dtlssetup','rtcp_mux','wss','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','util','lodash','exports','STRING','setDataValue','defaultuser','fullname','format','internal','email'];(function(_0x4ea06e,_0x2db222){var _0x3f340d=function(_0x183e24){while(--_0x183e24){_0x4ea06e['push'](_0x4ea06e['shift']());}};_0x3f340d(++_0x2db222);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x27ddf5,_0x5a3e18){_0x27ddf5=_0x27ddf5-0x0;var _0x26e74a=_0xcb91[_0x27ddf5];return _0x26e74a;};'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 6aa5fbb..c47b956 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 _0x5aa6=['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)','sequelize','QueryTypes','SELECT','from','voicemail','VoiceMail','fullname','email','103','107','108','100','114','115','create','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','findAll','Agents','isEmpty','compact','oldPassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','Sequelize','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','findOne','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','previousPasswords','updatePasswordsHistory','channel','online','loginInPause','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','emit','Queue:save','VoiceQueue','interface','format','SIP/%s','voicePause','penalty','UserVoiceQueueRt','upsert','removeQueues','isArray','QueueId','Queue:remove','voice','addAvatar','file','filename','join','root','userpic','download','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','concat','getContacts','User\x20with\x20id\x20%s\x20not\x20found','CmList','Tag','Tags','color','tag','getQueues','Queue','order','sort','merge','hasOwnProperty','nolimit','getVoiceQueuesRt','ChatGroup','getGroups','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','pick','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','phone','mobile','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','PAUSE','LOGININPAUSE','resolve','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','getTeams','Team','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','addTeams','getAssociatedQueues','flattenDeep','addAgent','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeAgent','VoicePrefixId','getLists','getAgents','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','spread','removeChatInteractions','user_has_chat_interactions:remove','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','$and','$or','$gt','$gte','$lt','$lte','$ne','$not','$between','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$any','CmHopper','firstName','lastName','CmContact','Contact','dialActive','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','apiKeyIat','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','teams','queues','inbound','flatten','lower','toString','asc','desc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','voiceStatus','busy','slice','charAt','field','ui.','user_has_','ui.UserId\x20=\x20?','moment','util','path','squel','jayson/promise','ioredis','../../components/contacts','../../components/parsers/qs','api','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','handleError','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','client','http','request','then','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','status','end','offset','undefined','limit','count','set','Content-Range','json','update','role','agent','userNotification:recalc:','destroy','get','admin','Users','user','Telephones','telephone','filter','map','value','includes','find','name','UserProfileResource','stack','send','index','User','rawAttributes','fieldName','type','key','password','salt','getOptions','where','query','includeAll','include','UserSetting','userSetting','attributes','push','rows','length','chat','dataValues','sms','fax','mail','whatsapp','all','show','params','model','differenceBy','keys','filters','intersection','fields','true','options','openchannel','body','describe','addContacts','ids','omit','internal','findById','validatePasswordPattern','max','isNil','min_internal'];(function(_0x235482,_0x14b833){var _0x5f5bea=function(_0x17a254){while(--_0x17a254){_0x235482['push'](_0x235482['shift']());}};_0x5f5bea(++_0x14b833);}(_0x5aa6,0x11a));var _0x65aa=function(_0x2f17dd,_0x189461){_0x2f17dd=_0x2f17dd-0x0;var _0x51c9b5=_0x5aa6[_0x2f17dd];return _0x51c9b5;};'use strict';var moment=require(_0x65aa('0x0'));var util=require(_0x65aa('0x1'));var path=require(_0x65aa('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x65aa('0x3'));var jayson=require(_0x65aa('0x4'));var Redis=require(_0x65aa('0x5'));var authService=require('../../components/auth/service');var contacts=require(_0x65aa('0x6'));var qs=require(_0x65aa('0x7'));var logger=require('../../config/logger')(_0x65aa('0x8'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65aa('0x9'));var APIBadRequestError=require(_0x65aa('0xa'))[_0x65aa('0xb')];var APINotFoundError=require('../../errors/api')[_0x65aa('0xc')];var APIHandleError=require(_0x65aa('0xa'))[_0x65aa('0xd')];var db=require(_0x65aa('0xe'))['db'];var socket=require(_0x65aa('0xf'))(new Redis(config[_0x65aa('0x10')]));require(_0x65aa('0x11'))[_0x65aa('0x12')](socket);config[_0x65aa('0x10')]=_[_0x65aa('0x13')](config[_0x65aa('0x10')],{'host':_0x65aa('0x14'),'port':0x18eb});var amiClient=jayson[_0x65aa('0x15')][_0x65aa('0x16')]({'port':0x232a});var values;function respondWithRpcPromise(_0x111932,_0x22a307,_0x421fef,_0x334a70){return new Promise(function(_0x311949,_0x198fd3){var _0x23d60c=_0x334a70||amiClient;return _0x23d60c[_0x65aa('0x17')](_0x111932,_0x421fef)[_0x65aa('0x18')](function(_0x1ce575){logger[_0x65aa('0x19')](_0x65aa('0x1a'),_0x22a307,'request\x20sent');logger[_0x65aa('0x1b')](_0x65aa('0x1c'),_0x22a307,'request\x20sent',JSON[_0x65aa('0x1d')](_0x1ce575));if(_0x1ce575['error']){if(_0x1ce575[_0x65aa('0x1e')][_0x65aa('0x1f')]===0x1f4){logger[_0x65aa('0x1e')]('User,\x20%s,\x20%s',_0x22a307,_0x1ce575[_0x65aa('0x1e')][_0x65aa('0x20')]);return _0x198fd3(_0x1ce575[_0x65aa('0x1e')][_0x65aa('0x20')]);}logger[_0x65aa('0x1e')]('User,\x20%s,\x20%s',_0x22a307,_0x1ce575[_0x65aa('0x1e')][_0x65aa('0x20')]);return _0x311949(_0x1ce575[_0x65aa('0x1e')][_0x65aa('0x20')]);}else{logger[_0x65aa('0x19')](_0x65aa('0x1a'),_0x22a307,_0x65aa('0x21'));_0x311949(_0x1ce575['result'][_0x65aa('0x20')]);}})[_0x65aa('0x22')](function(_0x5ba286){logger[_0x65aa('0x1e')]('User,\x20%s,\x20%s',_0x22a307,_0x5ba286);_0x198fd3(_0x5ba286);});});}function respondWithStatusCode(_0x31c6fa,_0x4d651f){_0x4d651f=_0x4d651f||0xcc;return function(_0x55b107){if(_0x55b107){return _0x31c6fa['sendStatus'](_0x4d651f);}return _0x31c6fa[_0x65aa('0x23')](_0x4d651f)[_0x65aa('0x24')]();};}function respondWithResult(_0xacad1b,_0x1ace42){_0x1ace42=_0x1ace42||0xc8;return function(_0x598c51){if(_0x598c51){return _0xacad1b[_0x65aa('0x23')](_0x1ace42)['json'](_0x598c51);}};}function respondWithFilteredResult(_0xa3d906,_0x5d1690){return function(_0x25fa90){if(_0x25fa90){var _0x2d1836=typeof _0x5d1690[_0x65aa('0x25')]===_0x65aa('0x26')&&typeof _0x5d1690[_0x65aa('0x27')]===_0x65aa('0x26');var _0xc49fa=_0x25fa90['count'];var _0x3cbccb=_0x2d1836?0x0:_0x5d1690[_0x65aa('0x25')];var _0x9cebdc=_0x2d1836?_0x25fa90[_0x65aa('0x28')]:_0x5d1690[_0x65aa('0x25')]+_0x5d1690['limit'];var _0x4ef19a;if(_0x9cebdc>=_0xc49fa){_0x9cebdc=_0xc49fa;_0x4ef19a=0xc8;}else{_0x4ef19a=0xce;}_0xa3d906[_0x65aa('0x23')](_0x4ef19a);return _0xa3d906[_0x65aa('0x29')](_0x65aa('0x2a'),_0x3cbccb+'-'+_0x9cebdc+'/'+_0xc49fa)[_0x65aa('0x2b')](_0x25fa90);}return null;};}function saveUpdates(_0x59117f){return function(_0x4ac62b){if(_0x4ac62b){return _0x4ac62b[_0x65aa('0x2c')](_0x59117f)[_0x65aa('0x18')](function(_0x50d449){if(_0x50d449[_0x65aa('0x2d')]===_0x65aa('0x2e')){socket['emit'](_0x65aa('0x2f')+_0x50d449['id'],_0x50d449);}return _0x50d449;});}return null;};}function removeEntity(_0x5ec8dc){return function(_0x9f7f14){if(_0x9f7f14){return _0x9f7f14[_0x65aa('0x30')]()[_0x65aa('0x18')](function(){var _0x147124=_0x9f7f14[_0x65aa('0x31')]({'plain':!![]});if(_0x147124[_0x65aa('0x2d')]===_0x65aa('0x32'))return;var _0xffe540=[{'name':_0x65aa('0x33'),'value':_0x65aa('0x34'),'ignore':!![]},{'name':'Agents','value':_0x65aa('0x2e'),'ignore':![]},{'name':_0x65aa('0x35'),'value':_0x65aa('0x36'),'ignore':![]}];var _0x59836c=_(_0xffe540)[_0x65aa('0x37')]('ignore')[_0x65aa('0x38')](_0x65aa('0x39'))[_0x65aa('0x39')]();if(_[_0x65aa('0x3a')](_0x59836c,_0x147124[_0x65aa('0x2d')])){return;}var _0x2ff9fe=_[_0x65aa('0x3b')](_0xffe540,[_0x65aa('0x39'),_0x147124[_0x65aa('0x2d')]])[_0x65aa('0x3c')];return db[_0x65aa('0x3d')][_0x65aa('0x30')]({'where':{'type':_0x2ff9fe,'resourceId':_0x147124['id']}})[_0x65aa('0x18')](function(){return _0x9f7f14;});})[_0x65aa('0x18')](function(){_0x5ec8dc[_0x65aa('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x276a18){return function(_0x5488be){if(!_0x5488be){_0x276a18['sendStatus'](0x194);}return _0x5488be;};}function handleError(_0x851466,_0x37327c){_0x37327c=_0x37327c||0x1f4;return function(_0x342f27){logger[_0x65aa('0x1e')](_0x342f27[_0x65aa('0x3e')]);if(_0x342f27[_0x65aa('0x3c')]){delete _0x342f27[_0x65aa('0x3c')];}_0x851466[_0x65aa('0x23')](_0x37327c)[_0x65aa('0x3f')](_0x342f27);};}exports[_0x65aa('0x40')]=function(_0x43072b,_0x1e980e){var _0x5f43e1={},_0x3562c3={'count':0x0,'rows':[]};var _0x596b4c=_(db[_0x65aa('0x41')][_0x65aa('0x42')])[_0x65aa('0x38')](function(_0x432872){return{'name':_0x432872[_0x65aa('0x43')],'type':_0x432872[_0x65aa('0x44')][_0x65aa('0x45')]};})[_0x65aa('0x37')](function(_0x409803){return!_[_0x65aa('0x3a')]([_0x65aa('0x46'),_0x65aa('0x47')],_0x409803[_0x65aa('0x3c')]);})[_0x65aa('0x39')]();_0x5f43e1=qs[_0x65aa('0x48')](_0x596b4c,_0x43072b);var _0x19c2f0={'where':_0x5f43e1[_0x65aa('0x49')]};return db['User']['count'](_0x19c2f0)[_0x65aa('0x18')](function(_0x4d222a){_0x3562c3[_0x65aa('0x28')]=_0x4d222a;if(_0x43072b[_0x65aa('0x4a')][_0x65aa('0x4b')]){_0x5f43e1[_0x65aa('0x4c')]=[{'all':!![]}];}if(_0x43072b[_0x65aa('0x4a')]['userSetting']==='true'){_0x5f43e1['include']=[{'model':db[_0x65aa('0x4d')],'as':_0x65aa('0x4e')}];}if(!_[_0x65aa('0x3a')](_0x5f43e1['attributes'],'id')){_0x5f43e1[_0x65aa('0x4f')][_0x65aa('0x50')]('id');}return db[_0x65aa('0x41')]['findAll'](_0x5f43e1);})['then'](function(_0x149b28){_0x3562c3[_0x65aa('0x51')]=_0x149b28;if(_0x43072b['query']['openTabs']==='true'){var _0x56cb62=[];for(var _0x568a35=0x0;_0x568a35<_0x3562c3[_0x65aa('0x51')][_0x65aa('0x52')];_0x568a35++){_0x56cb62[_0x65aa('0x50')](get_open_tabs(_0x65aa('0x53'),_0x3562c3[_0x65aa('0x51')][_0x568a35][_0x65aa('0x54')]));_0x56cb62[_0x65aa('0x50')](get_open_tabs(_0x65aa('0x55'),_0x3562c3[_0x65aa('0x51')][_0x568a35][_0x65aa('0x54')]));_0x56cb62[_0x65aa('0x50')](get_open_tabs(_0x65aa('0x56'),_0x3562c3[_0x65aa('0x51')][_0x568a35][_0x65aa('0x54')]));_0x56cb62[_0x65aa('0x50')](get_open_tabs(_0x65aa('0x57'),_0x3562c3['rows'][_0x568a35][_0x65aa('0x54')]));_0x56cb62[_0x65aa('0x50')](get_open_tabs('openchannel',_0x3562c3[_0x65aa('0x51')][_0x568a35]['dataValues']));_0x56cb62[_0x65aa('0x50')](get_open_tabs(_0x65aa('0x58'),_0x3562c3[_0x65aa('0x51')][_0x568a35]['dataValues']));}return Promise[_0x65aa('0x59')](_0x56cb62)[_0x65aa('0x18')](function(){return _0x3562c3;});}else{return _0x3562c3;}})[_0x65aa('0x18')](respondWithFilteredResult(_0x1e980e,_0x5f43e1))['catch'](handleError(_0x1e980e,null));};exports[_0x65aa('0x5a')]=function(_0x50103d,_0x3e4f11){var _0x10b386={'raw':![],'where':{'id':_0x50103d[_0x65aa('0x5b')]['id']}},_0x3d3a17={};_0x3d3a17[_0x65aa('0x5c')]=_[_0x65aa('0x5d')](_[_0x65aa('0x5e')](db['User']['rawAttributes']),[_0x65aa('0x46'),_0x65aa('0x47')]);_0x3d3a17[_0x65aa('0x4a')]=_[_0x65aa('0x5e')](_0x50103d[_0x65aa('0x4a')]);_0x3d3a17[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x3d3a17[_0x65aa('0x5c')],_0x3d3a17[_0x65aa('0x4a')]);_0x10b386[_0x65aa('0x4f')]=_[_0x65aa('0x60')](_0x3d3a17[_0x65aa('0x5c')],qs[_0x65aa('0x61')](_0x50103d[_0x65aa('0x4a')][_0x65aa('0x61')]));_0x10b386['attributes']=_0x10b386[_0x65aa('0x4f')]['length']?_0x10b386[_0x65aa('0x4f')]:_0x3d3a17[_0x65aa('0x5c')];if(_0x50103d['query'][_0x65aa('0x4b')]){_0x10b386[_0x65aa('0x4c')]=[{'all':!![]}];}if(_0x50103d['query'][_0x65aa('0x4e')]===_0x65aa('0x62')){_0x10b386[_0x65aa('0x4c')]=[{'model':db[_0x65aa('0x4d')],'as':'userSetting'}];}_0x10b386=_['merge']({},_0x10b386,_0x50103d[_0x65aa('0x63')]);if(!_[_0x65aa('0x3a')](_0x10b386['attributes'],'id')){_0x10b386[_0x65aa('0x4f')]['push']('id');}return db[_0x65aa('0x41')][_0x65aa('0x3b')](_0x10b386)[_0x65aa('0x18')](handleEntityNotFound(_0x3e4f11,null))[_0x65aa('0x18')](function(_0x3c96d6){var _0x3c756f=[];values=_0x3c96d6;if(_0x50103d['query']['openTabs']===_0x65aa('0x62')){_0x3c756f[_0x65aa('0x50')](get_open_tabs('chat',_0x3c96d6[_0x65aa('0x54')]));_0x3c756f[_0x65aa('0x50')](get_open_tabs('sms',_0x3c96d6[_0x65aa('0x54')]));_0x3c756f[_0x65aa('0x50')](get_open_tabs(_0x65aa('0x64'),_0x3c96d6[_0x65aa('0x54')]));_0x3c756f[_0x65aa('0x50')](get_open_tabs(_0x65aa('0x58'),_0x3c96d6['dataValues']));_0x3c756f[_0x65aa('0x50')](get_open_tabs(_0x65aa('0x56'),_0x3c96d6[_0x65aa('0x54')]));_0x3c756f[_0x65aa('0x50')](get_open_tabs(_0x65aa('0x57'),_0x3c96d6[_0x65aa('0x54')]));return Promise[_0x65aa('0x59')](_0x3c756f);}else{return values;}})[_0x65aa('0x18')](function(){return values;})['then'](respondWithResult(_0x3e4f11,null))[_0x65aa('0x22')](handleError(_0x3e4f11,null));};exports['update']=function(_0x3106f6,_0x3e7f8d){if(_0x3106f6['body']['id']){delete _0x3106f6[_0x65aa('0x65')]['id'];}delete _0x3106f6[_0x65aa('0x65')][_0x65aa('0x2d')];return db[_0x65aa('0x41')][_0x65aa('0x3b')]({'where':{'id':_0x3106f6['params']['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x3e7f8d,null))[_0x65aa('0x18')](saveUpdates(_0x3106f6[_0x65aa('0x65')],null))[_0x65aa('0x18')](respondWithResult(_0x3e7f8d,null))[_0x65aa('0x22')](handleError(_0x3e7f8d,null));};exports[_0x65aa('0x66')]=function(_0x2124ce,_0x391802){return db[_0x65aa('0x41')]['describe']()['then'](respondWithResult(_0x391802,null))[_0x65aa('0x22')](handleError(_0x391802,null));};exports['addContacts']=function(_0x29b44b,_0x171095){return db['User']['find']({'where':{'id':_0x29b44b['params']['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x171095,null))[_0x65aa('0x18')](function(_0x4c722f){if(_0x4c722f){return _0x4c722f[_0x65aa('0x67')](_0x29b44b[_0x65aa('0x65')][_0x65aa('0x68')],_[_0x65aa('0x69')](_0x29b44b[_0x65aa('0x65')],[_0x65aa('0x68'),'id'])||{});}})[_0x65aa('0x18')](respondWithResult(_0x171095,null))[_0x65aa('0x22')](handleError(_0x171095,null));};function validateUser(_0x3d51ee){return new Promise(function(_0x452026,_0x4fcc03){if(_0x3d51ee[_0x65aa('0x6a')])return _0x452026(_0x3d51ee);return db['Setting'][_0x65aa('0x6b')](0x1)[_0x65aa('0x18')](function(_0x3877ec){if(_0x3877ec['securePassword'])authService[_0x65aa('0x6c')](_0x3d51ee[_0x65aa('0x46')]);db[_0x65aa('0x41')][_0x65aa('0x6d')](_0x65aa('0x6a'))[_0x65aa('0x18')](function(_0x78447c){if(_[_0x65aa('0x6e')](_0x78447c)){_0x3d51ee['internal']=_0x3877ec[_0x65aa('0x6f')]||0x1;return;}if(_['isNil'](_0x3877ec[_0x65aa('0x6f')])||_0x3877ec[_0x65aa('0x6f')]===_0x78447c){_0x3d51ee[_0x65aa('0x6a')]=_0x78447c+0x1;return;}if(_0x3877ec[_0x65aa('0x6f')]>_0x78447c){_0x3d51ee[_0x65aa('0x6a')]=_0x3877ec[_0x65aa('0x6f')];return;}return db['sequelize'][_0x65aa('0x4a')](_0x65aa('0x70'),{'type':db[_0x65aa('0x71')][_0x65aa('0x72')][_0x65aa('0x73')]})['then'](function(_0x1ba406){if(_0x1ba406&&_0x1ba406[_0x65aa('0x52')]){for(var _0x1b9d54=0x0,_0x548b6f=_0x1ba406[_0x65aa('0x52')];_0x1b9d54<_0x548b6f&&_['isNil'](_0x3d51ee[_0x65aa('0x6a')]);_0x1b9d54++){if(_0x3877ec[_0x65aa('0x6f')]<=_0x1ba406[_0x1b9d54][_0x65aa('0x74')]){_0x3d51ee['internal']=_0x1ba406[_0x1b9d54][_0x65aa('0x74')];}else if(_0x3877ec['min_internal']>_0x1ba406[_0x1b9d54][_0x65aa('0x74')]&&_0x3877ec['min_internal']<=_0x1ba406[_0x1b9d54]['to']){_0x3d51ee[_0x65aa('0x6a')]=_0x3877ec['min_internal'];}}}if(_[_0x65aa('0x6e')](_0x3d51ee[_0x65aa('0x6a')])){_0x3d51ee[_0x65aa('0x6a')]=_0x78447c+0x1;}return _0x452026(_0x3d51ee);});});})[_0x65aa('0x22')](function(_0x10a833){_0x4fcc03(_0x10a833);});});}function updateUser(_0x436c43){return new Promise(function(_0x19bbe8,_0x54ec2c){try{if(_0x436c43[_0x65aa('0x75')]){_0x436c43['mailbox']=_0x436c43[_0x65aa('0x6a')];_0x436c43[_0x65aa('0x76')]={'mailbox':_0x436c43[_0x65aa('0x6a')],'password':_0x436c43[_0x65aa('0x46')],'fullname':_0x436c43[_0x65aa('0x77')],'email':_0x436c43[_0x65aa('0x78')]};}if(_0x436c43[_0x65aa('0x2d')]===_0x65aa('0x2e')){if(!_0x436c43['permissions'])_0x436c43['permissions']=['101','102',_0x65aa('0x79'),'113','110','104','105','106',_0x65aa('0x7a'),_0x65aa('0x7b'),'109',_0x65aa('0x7c'),'111',_0x65aa('0x7d'),_0x65aa('0x7e')];}_0x19bbe8(_0x436c43);}catch(_0x1c39f4){_0x54ec2c(_0x1c39f4);}});}exports[_0x65aa('0x7f')]=function(_0x117961,_0x16d265){if(_0x117961[_0x65aa('0x34')]['role']===_0x65aa('0x2e'))throw new Error('Unauthorized');if(_0x117961['body'][_0x65aa('0x2d')]===_0x65aa('0x34')&&_0x117961[_0x65aa('0x34')][_0x65aa('0x2d')]!==_0x65aa('0x32')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x117961['body']['role']===_0x65aa('0x32')&&_0x117961[_0x65aa('0x34')]['role']!==_0x65aa('0x32')){throw new Error(_0x65aa('0x80'));}return licenseUtil[_0x65aa('0x81')]([_0x117961[_0x65aa('0x65')]])['then'](function(){return validateUser(_0x117961[_0x65aa('0x65')]);})[_0x65aa('0x18')](function(_0x4f4522){return updateUser(_0x4f4522)[_0x65aa('0x18')](function(_0x4f2617){if(_0x4f2617['role']===_0x65aa('0x32')){_0x4f2617[_0x65aa('0x82')]=_0x117961[_0x65aa('0x34')]['settingsEnabled'];delete _0x4f2617[_0x65aa('0x83')];}return _0x4f2617;});})[_0x65aa('0x18')](function(_0x847e67){return db[_0x65aa('0x41')][_0x65aa('0x7f')](_0x847e67,{'include':[{'model':db['VoiceMail'],'as':_0x65aa('0x76')}]});})[_0x65aa('0x18')](function(_0x10d05f){if(_0x117961[_0x65aa('0x65')][_0x65aa('0x2d')]===_0x65aa('0x34'))return _0x10d05f;if(_0x117961[_0x65aa('0x34')][_0x65aa('0x2d')]!==_0x65aa('0x34'))return _0x10d05f;return db[_0x65aa('0x84')][_0x65aa('0x3b')]({'where':{'name':_0x10d05f[_0x65aa('0x2d')]===_0x65aa('0x2e')?'Agents':_0x65aa('0x35'),'userProfileId':_0x117961[_0x65aa('0x34')][_0x65aa('0x83')]},'raw':!![]})['then'](function(_0x14370c){if(!_0x14370c||_0x14370c[_0x65aa('0x85')]!=0x0)return _0x10d05f;return db[_0x65aa('0x3d')][_0x65aa('0x7f')]({'name':_0x10d05f[_0x65aa('0x3c')],'resourceId':_0x10d05f['id'],'type':_0x14370c[_0x65aa('0x3c')],'sectionId':_0x14370c['id']},{})[_0x65aa('0x18')](function(){return _0x10d05f;});})[_0x65aa('0x22')](function(_0x1eedb0){logger[_0x65aa('0x1e')](_0x65aa('0x86'),_0x1eedb0);throw _0x1eedb0;});})[_0x65aa('0x18')](respondWithResult(_0x16d265,0xc9))[_0x65aa('0x22')](handleError(_0x16d265,null));};exports[_0x65aa('0x87')]=function(_0x155842,_0x57fac0){var _0x3782ee=_0x155842[_0x65aa('0x65')];var _0xaa0c20=[];if(_0x155842[_0x65aa('0x34')][_0x65aa('0x2d')]===_0x65aa('0x2e'))throw new Error(_0x65aa('0x88'));if(_['some'](_0x3782ee,[_0x65aa('0x2d'),'user'])&&_0x155842[_0x65aa('0x34')][_0x65aa('0x2d')]!==_0x65aa('0x32')){throw new Error(_0x65aa('0x89'));}if(_[_0x65aa('0x8a')](_0x3782ee,[_0x65aa('0x2d'),_0x65aa('0x32')])&&_0x155842[_0x65aa('0x34')][_0x65aa('0x2d')]!==_0x65aa('0x32')){throw new Error(_0x65aa('0x8b'));}return licenseUtil[_0x65aa('0x81')](_0x3782ee)[_0x65aa('0x18')](function(){return validateUser(_0x3782ee[0x0]);})['then'](function(){for(var _0x5334f9=0x1;_0x5334f9<_0x3782ee[_0x65aa('0x52')];_0x5334f9++){var _0x58c18b=_0x3782ee[_0x5334f9-0x1][_0x65aa('0x6a')];if(!_0x3782ee[_0x5334f9][_0x65aa('0x6a')])_0x3782ee[_0x5334f9][_0x65aa('0x6a')]=_0x58c18b+0x1;_0xaa0c20[_0x65aa('0x50')](validateUser(_0x3782ee[_0x5334f9]));}return Promise[_0x65aa('0x59')](_0xaa0c20);})[_0x65aa('0x18')](function(){_0xaa0c20=[];for(var _0x5b928b=0x0;_0x5b928b<_0x3782ee[_0x65aa('0x52')];_0x5b928b++){_0xaa0c20[_0x65aa('0x50')](updateUser(_0x3782ee[_0x5b928b]));}return Promise[_0x65aa('0x59')](_0xaa0c20);})['then'](function(){_0xaa0c20=_0x3782ee[_0x65aa('0x38')](function(_0x1d07f5){return db['User'][_0x65aa('0x7f')](_0x1d07f5,{'include':[{'model':db[_0x65aa('0x76')],'as':'VoiceMail'}]})['then'](function(_0x4dedd5){_0x1d07f5['id']=_0x4dedd5['id'];return _0x1d07f5;});});return Promise[_0x65aa('0x59')](_0xaa0c20);})[_0x65aa('0x18')](function(_0x3f0d99){if(_0x155842[_0x65aa('0x65')]['role']==='user')return _0x3f0d99;if(_0x155842['user'][_0x65aa('0x2d')]!==_0x65aa('0x34'))return _0x3f0d99;var _0x36b5b6=_[_0x65aa('0x8a')](_0x3f0d99,function(_0x1dec15){return _0x1dec15[_0x65aa('0x2d')]===_0x65aa('0x2e')||_0x1dec15['role']==='telephone';});if(!_0x36b5b6)return _0x3f0d99;return db[_0x65aa('0x84')][_0x65aa('0x8c')]({'where':{'name':{'$or':[_0x65aa('0x8d'),_0x65aa('0x35')]},'userProfileId':_0x155842['user'][_0x65aa('0x83')]},'raw':!![]})[_0x65aa('0x18')](function(_0xa49267){if(_[_0x65aa('0x8e')](_0xa49267)||!_['some'](_0xa49267,[_0x65aa('0x85'),0x0]))return _0x3f0d99;_0xaa0c20=[];var _0x4fc7c3=_(_0xa49267)[_0x65aa('0x38')](function(_0x1a6b61){if(_0x1a6b61['autoAssociation']===0x1)return;return _0x1a6b61['name']==='Agents'?'agent':_0x65aa('0x36');})[_0x65aa('0x8f')]()[_0x65aa('0x39')]();for(var _0x4a2a36=0x0;_0x4a2a36<_0x3f0d99[_0x65aa('0x52')];_0x4a2a36++){if(!_['includes'](_0x4fc7c3,_0x3f0d99[_0x4a2a36][_0x65aa('0x2d')]))return;var _0x27bfdb=_0x3f0d99[_0x4a2a36][_0x65aa('0x2d')]==='agent'?_0x65aa('0x8d'):_0x65aa('0x35');_0xaa0c20[_0x65aa('0x50')](db[_0x65aa('0x3d')][_0x65aa('0x7f')]({'name':_0x3f0d99[_0x4a2a36][_0x65aa('0x3c')],'resourceId':_0x3f0d99[_0x4a2a36]['id'],'type':_0x27bfdb,'sectionId':_[_0x65aa('0x3b')](_0xa49267,['name',_0x27bfdb])['id']},{}));}return Promise[_0x65aa('0x59')](_0xaa0c20);});})[_0x65aa('0x18')](respondWithResult(_0x57fac0,0xc9))['catch'](handleError(_0x57fac0,null));};exports['changePassword']=function(_0x3c4166,_0x1e058d){if(_0x3c4166[_0x65aa('0x65')]['id']){delete _0x3c4166[_0x65aa('0x65')]['id'];}return db[_0x65aa('0x41')]['find']({'where':{'id':_0x3c4166['params']['id']}})[_0x65aa('0x18')](function(_0x298089){if(!_0x298089)return null;if(_0x298089['id']===_0x3c4166[_0x65aa('0x34')]['id']){if(!_0x3c4166[_0x65aa('0x65')][_0x65aa('0x90')]||!_0x3c4166[_0x65aa('0x65')][_0x65aa('0x91')]){throw new db['Sequelize'][(_0x65aa('0x92'))](_0x65aa('0x93'));}if(!_0x298089['authenticate'](_0x3c4166['body']['oldPassword'])){throw new db[(_0x65aa('0x94'))][(_0x65aa('0x92'))](_0x65aa('0x95'));}if(_0x3c4166[_0x65aa('0x65')][_0x65aa('0x90')]===_0x3c4166[_0x65aa('0x65')][_0x65aa('0x91')]){throw new db[(_0x65aa('0x94'))][(_0x65aa('0x92'))](_0x65aa('0x96'));}}else if(_0x3c4166['user'][_0x65aa('0x2d')]===_0x65aa('0x32')){if(!_0x3c4166['body'][_0x65aa('0x91')]){throw new db[(_0x65aa('0x94'))][(_0x65aa('0x92'))](_0x65aa('0x97'));}}else if(_0x3c4166[_0x65aa('0x34')][_0x65aa('0x2d')]===_0x65aa('0x34')){if(!_0x3c4166['body'][_0x65aa('0x91')]){throw new db[(_0x65aa('0x94'))][(_0x65aa('0x92'))](_0x65aa('0x97'));}if(_0x298089[_0x65aa('0x2d')]!=='agent'){throw new db['Sequelize'][(_0x65aa('0x92'))]('Unauthorized');}}else{throw new db[(_0x65aa('0x94'))][(_0x65aa('0x92'))]('Unauthorized');}return _0x298089;})[_0x65aa('0x18')](handleEntityNotFound(_0x1e058d,null))[_0x65aa('0x18')](function(_0x751286){return db[_0x65aa('0x98')][_0x65aa('0x99')]({'attributes':['id',_0x65aa('0x9a'),_0x65aa('0x9b'),_0x65aa('0x9c')]})[_0x65aa('0x18')](function(_0x4b417e){if(_0x4b417e[_0x65aa('0x9a')])authService[_0x65aa('0x6c')](_0x3c4166['body'][_0x65aa('0x91')]);if(!_0x4b417e['enforcePasswordHistory']||!_0x751286['previousPasswords'])return _0x751286;authService[_0x65aa('0x9d')](_0x3c4166[_0x65aa('0x65')][_0x65aa('0x91')],_0x751286[_0x65aa('0x9e')],_0x4b417e[_0x65aa('0x9c')]);return _0x751286;})[_0x65aa('0x18')](saveUpdates({'password':_0x3c4166[_0x65aa('0x65')][_0x65aa('0x91')],'passwordResetAt':_0x3c4166[_0x65aa('0x34')]['id']==_0x3c4166[_0x65aa('0x5b')]['id']?moment():null,'previousPasswords':authService[_0x65aa('0x9f')](_0x3c4166[_0x65aa('0x65')]['newPassword'],_0x751286[_0x65aa('0x9e')])},null));})[_0x65aa('0x18')](respondWithResult(_0x1e058d,null))['catch'](handleError(_0x1e058d,null));};exports['addQueues']=function(_0x1959cf,_0x31e4cf){var _0x2ce836=_0x1959cf[_0x65aa('0x65')][_0x65aa('0xa0')];return db['User'][_0x65aa('0x3b')]({'where':{'id':_0x1959cf[_0x65aa('0x5b')]['id']},'attributes':['id',_0x65aa('0x3c'),_0x65aa('0x2d'),_0x65aa('0xa1'),_0x65aa('0xa2'),'voicePause','interface']})['then'](handleEntityNotFound(_0x31e4cf,null))[_0x65aa('0x18')](function(_0x54016d){if(_0x54016d){if(!utils[_0x65aa('0xa3')](_0x2ce836)){throw new db[(_0x65aa('0x94'))][(_0x65aa('0x92'))](_0x65aa('0xa4'));}return _0x54016d[_0x65aa('0xa5')+_[_0x65aa('0xa6')](_0x2ce836[_0x65aa('0xa7')]())+_0x65aa('0xa8')](_0x1959cf[_0x65aa('0x65')][_0x65aa('0x68')],{'penalty':_0x1959cf[_0x65aa('0x65')]['penalty']||0x0})['spread'](function(_0x12780f){for(var _0x34746a=0x0;_0x34746a<_0x1959cf[_0x65aa('0x65')][_0x65aa('0x68')][_0x65aa('0x52')];_0x34746a+=0x1){var _0x4af06b={'UserId':Number(_0x1959cf['params']['id'])};_0x4af06b[_['capitalize'](_0x2ce836[_0x65aa('0xa7')]())+'QueueId']=Number(_0x1959cf['body'][_0x65aa('0x68')][_0x34746a]);socket[_0x65aa('0xa9')](_0x65aa('0x34')+_['capitalize'](_0x2ce836[_0x65aa('0xa7')]())+_0x65aa('0xaa'),_0x4af06b);}return _0x12780f;})[_0x65aa('0x18')](function(){if(_0x2ce836==='voice'){return db[_0x65aa('0xab')]['findAll']({'where':{'id':_0x1959cf[_0x65aa('0x65')][_0x65aa('0x68')]||[]},'raw':!![],'attributes':['id',_0x65aa('0x3c')]});}})[_0x65aa('0x18')](function(_0x2d0107){var _0xeebe5f=_0x54016d[_0x65aa('0x31')]({'plain':!![]});var _0x1e1a47=[];if(_0x2ce836==='voice'&&_0xeebe5f[_0x65aa('0x2d')]===_0x65aa('0x2e')&&_0xeebe5f[_0x65aa('0xa1')]){for(let _0x5a72b2=0x0;_0x5a72b2<_0x2d0107[_0x65aa('0x52')];_0x5a72b2+=0x1){_0x1e1a47[_0x65aa('0x50')]({'membername':_0xeebe5f[_0x65aa('0x3c')],'UserId':_0xeebe5f['id'],'queue_name':_0x2d0107[_0x5a72b2]['name'],'VoiceQueueId':_0x2d0107[_0x5a72b2]['id'],'interface':_[_0x65aa('0x6e')](_0xeebe5f[_0x65aa('0xac')])?util[_0x65aa('0xad')](_0x65aa('0xae'),_0xeebe5f[_0x65aa('0x3c')]):_0xeebe5f[_0x65aa('0xac')],'paused':_0xeebe5f[_0x65aa('0xaf')]||![],'penalty':_0x1959cf['body'][_0x65aa('0xb0')]||0x0});}return Promise[_0x65aa('0x59')](_0x1e1a47[_0x65aa('0x38')](function(_0x5519d3){return db[_0x65aa('0xb1')][_0x65aa('0xb2')](_0x5519d3);}));}return _0x54016d;});}})[_0x65aa('0x18')](respondWithStatusCode(_0x31e4cf,null))[_0x65aa('0x22')](handleError(_0x31e4cf,null));};exports[_0x65aa('0xb3')]=function(_0x3a8ce6,_0x20f4c5){var _0x216949,_0x3e7597;return db['User'][_0x65aa('0x3b')]({'where':{'id':_0x3a8ce6[_0x65aa('0x5b')]['id']},'attributes':['id',_0x65aa('0x3c'),_0x65aa('0x2d')]})[_0x65aa('0x18')](handleEntityNotFound(_0x20f4c5,null))[_0x65aa('0x18')](function(_0x40445f){if(_0x40445f){_0x216949=_0x40445f;if(!_0x3a8ce6['query'][_0x65aa('0xa0')]||!utils['isValidChannel'](_0x3a8ce6[_0x65aa('0x4a')][_0x65aa('0xa0')])){throw new db['Sequelize'][(_0x65aa('0x92'))](_0x65aa('0xa4'));}return _0x40445f['remove'+_[_0x65aa('0xa6')](_0x3a8ce6[_0x65aa('0x4a')][_0x65aa('0xa0')][_0x65aa('0xa7')]())+_0x65aa('0xa8')](_0x3a8ce6[_0x65aa('0x4a')][_0x65aa('0x68')]);}})[_0x65aa('0x18')](function(_0x7aa0b9){if(_[_0x65aa('0xb4')](_0x3a8ce6[_0x65aa('0x4a')][_0x65aa('0x68')])){for(var _0xf0532d=0x0;_0xf0532d<_0x3a8ce6[_0x65aa('0x4a')]['ids'][_0x65aa('0x52')];_0xf0532d+=0x1){_0x3e7597={'UserId':Number(_0x3a8ce6['params']['id'])};_0x3e7597[_[_0x65aa('0xa6')](_0x3a8ce6[_0x65aa('0x4a')][_0x65aa('0xa0')][_0x65aa('0xa7')]())+_0x65aa('0xb5')]=Number(_0x3a8ce6[_0x65aa('0x4a')][_0x65aa('0x68')][_0xf0532d]);socket['emit'](_0x65aa('0x34')+_['capitalize'](_0x3a8ce6['query'][_0x65aa('0xa0')][_0x65aa('0xa7')]())+_0x65aa('0xb6'),_0x3e7597);}}else{_0x3e7597={'UserId':Number(_0x3a8ce6[_0x65aa('0x5b')]['id'])};_0x3e7597[_['capitalize'](_0x3a8ce6[_0x65aa('0x4a')][_0x65aa('0xa0')]['toLowerCase']())+_0x65aa('0xb5')]=Number(_0x3a8ce6[_0x65aa('0x4a')][_0x65aa('0x68')]);socket[_0x65aa('0xa9')](_0x65aa('0x34')+_['capitalize'](_0x3a8ce6[_0x65aa('0x4a')]['channel']['toLowerCase']())+'Queue:remove',_0x3e7597);}return _0x7aa0b9;})[_0x65aa('0x18')](function(){if(_0x3a8ce6[_0x65aa('0x4a')][_0x65aa('0xa0')]===_0x65aa('0xb7')){return db[_0x65aa('0xb1')]['destroy']({'where':{'UserId':_0x3a8ce6[_0x65aa('0x5b')]['id'],'VoiceQueueId':_0x3a8ce6[_0x65aa('0x4a')][_0x65aa('0x68')]},'individualHooks':!![]})['then'](function(){return _0x216949;});}return _0x216949;})[_0x65aa('0x18')](respondWithStatusCode(_0x20f4c5,null))['catch'](handleError(_0x20f4c5,null));};exports[_0x65aa('0xb8')]=function(_0x64fc01,_0x2b801b){_0x64fc01[_0x65aa('0x65')]['userpic']=_0x64fc01[_0x65aa('0xb9')][_0x65aa('0xba')];return db[_0x65aa('0x41')][_0x65aa('0x3b')]({'where':{'id':_0x64fc01[_0x65aa('0x5b')]['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x2b801b,null))[_0x65aa('0x18')](saveUpdates(_0x64fc01[_0x65aa('0x65')],null))[_0x65aa('0x18')](respondWithResult(_0x2b801b,null))[_0x65aa('0x22')](handleError(_0x2b801b,null));};exports['getAvatar']=function(_0x4acfed,_0x56915e){var _0x4baa8d=path[_0x65aa('0xbb')](config[_0x65aa('0xbc')],'server/files/images/logos/default_profile.png');return db[_0x65aa('0x41')][_0x65aa('0x3b')]({'where':{'id':_0x4acfed[_0x65aa('0x5b')]['id']},'attributes':['id',_0x65aa('0xbd')],'raw':!![]})[_0x65aa('0x18')](handleEntityNotFound(_0x56915e,null))[_0x65aa('0x18')](function(_0x370286){if(_0x370286){if(_['isNil'](_0x370286['userpic'])){return _0x56915e[_0x65aa('0xbe')](_0x4baa8d);}else{if(!fs['existsSync'](path[_0x65aa('0xbb')](config[_0x65aa('0xbc')],_0x65aa('0xbf'),_0x370286[_0x65aa('0xbd')]))){return _0x56915e[_0x65aa('0xbe')](_0x4baa8d);}return _0x56915e['download'](path['join'](config[_0x65aa('0xbc')],_0x65aa('0xbf'),_0x370286[_0x65aa('0xbd')]));}}})['catch'](handleError(_0x56915e,null));};exports[_0x65aa('0xc0')]=function(_0x37b9d4,_0x5d5346){return db[_0x65aa('0x41')][_0x65aa('0x3b')]({'where':{'id':_0x37b9d4['params']['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x5d5346,null))[_0x65aa('0x18')](function(_0x8f1f72){var _0x256de2=[];values=_0x8f1f72[_0x65aa('0x54')];_0x256de2['push'](get_open_tabs(_0x65aa('0x53'),_0x8f1f72[_0x65aa('0x54')]));_0x256de2[_0x65aa('0x50')](get_open_tabs(_0x65aa('0x55'),_0x8f1f72[_0x65aa('0x54')]));_0x256de2[_0x65aa('0x50')](get_open_tabs('openchannel',_0x8f1f72[_0x65aa('0x54')]));_0x256de2['push'](get_open_tabs(_0x65aa('0x58'),_0x8f1f72[_0x65aa('0x54')]));_0x256de2['push'](get_open_tabs(_0x65aa('0x56'),_0x8f1f72[_0x65aa('0x54')]));_0x256de2['push'](get_open_tabs(_0x65aa('0x57'),_0x8f1f72[_0x65aa('0x54')]));return Promise[_0x65aa('0x59')](_0x256de2);})[_0x65aa('0x18')](function(_0x36e871){if(_0x36e871){var _0x359e51=_[_0x65aa('0x38')](values[_0x65aa('0xc1')],function(_0x3de27a){return{'channel':_0x65aa('0xc2'),'id':_0x3de27a['id'],'createdAt':_0x3de27a[_0x65aa('0xc3')]};});var _0x453030=_[_0x65aa('0x38')](values[_0x65aa('0xc4')],function(_0x5e79fb){return{'channel':_0x65aa('0xc5'),'id':_0x5e79fb['id'],'createdAt':_0x5e79fb[_0x65aa('0xc3')]};});var _0x2bbb3d=_[_0x65aa('0x38')](values[_0x65aa('0xc6')],function(_0x31530b){return{'channel':_0x65aa('0xc7'),'id':_0x31530b['id'],'createdAt':_0x31530b[_0x65aa('0xc3')]};});var _0x56034b=_[_0x65aa('0x38')](values[_0x65aa('0xc8')],function(_0xb94d94){return{'channel':_0x65aa('0xc9'),'id':_0xb94d94['id'],'createdAt':_0xb94d94[_0x65aa('0xc3')]};});var _0x183d66=_[_0x65aa('0x38')](values[_0x65aa('0xca')],function(_0x1fc537){return{'channel':_0x65aa('0xcb'),'id':_0x1fc537['id'],'createdAt':_0x1fc537['createdAt']};});var _0x408806=_['map'](values[_0x65aa('0xcc')],function(_0x4ab0c7){return{'channel':'WHATSAPP','id':_0x4ab0c7['id'],'createdAt':_0x4ab0c7[_0x65aa('0xc3')]};});var _0x548e6d=_[_0x65aa('0xcd')](_0x359e51,_0x453030,_0x2bbb3d,_0x56034b,_0x183d66,_0x408806);var _0x11badf={'count':_0x548e6d[_0x65aa('0x52')],'rows':_0x548e6d};return _0x11badf;}else return null;})[_0x65aa('0x18')](respondWithResult(_0x5d5346,null))[_0x65aa('0x22')](handleError(_0x5d5346,null));};exports[_0x65aa('0xce')]=function(_0x5f0d05,_0x36f2dc){var _0xa2bfe7={};return db[_0x65aa('0x41')][_0x65aa('0x99')]({'where':{'id':_0x5f0d05[_0x65aa('0x5b')]['id']}})[_0x65aa('0x18')](function(_0x2b6487){if(!_0x2b6487){throw new APINotFoundError(util[_0x65aa('0xad')](_0x65aa('0xcf'),_0x5f0d05[_0x65aa('0x5b')]['id']));}return contacts[_0x65aa('0x66')]();})[_0x65aa('0x18')](function(_0x56712f){_0x5f0d05[_0x65aa('0x4a')][_0x65aa('0x41')]=_0x5f0d05[_0x65aa('0x5b')]['id'];_0xa2bfe7=qs[_0x65aa('0x48')](_0x56712f,_0x5f0d05);if(_0x5f0d05[_0x65aa('0x4a')]['hasOwnProperty'](_0x65aa('0x4b'))){_0xa2bfe7[_0x65aa('0x4c')]=[{'model':db[_0x65aa('0xd0')],'as':'List','required':![]},{'model':db[_0x65aa('0xd1')],'as':_0x65aa('0xd2'),'attributes':['id',_0x65aa('0x3c'),_0x65aa('0xd3')],'where':_0x5f0d05[_0x65aa('0x4a')][_0x65aa('0xd4')]?{'id':_0x5f0d05['query'][_0x65aa('0xd4')]}:undefined,'required':_0x5f0d05['query'][_0x65aa('0xd4')]?!![]:![]}];}return contacts[_0x65aa('0x8c')](_0x5f0d05['query'],_0x5f0d05[_0x65aa('0x34')],_0xa2bfe7,_0x56712f);})[_0x65aa('0x18')](respondWithFilteredResult(_0x36f2dc,_0xa2bfe7))[_0x65aa('0x22')](APIHandleError(_0x36f2dc));};exports[_0x65aa('0xd5')]=function(_0x4e91d9,_0x37382d){var _0x52bec0;var _0x376063={};var _0x52f3dc;return db[_0x65aa('0x41')][_0x65aa('0x99')]({'where':{'id':_0x4e91d9[_0x65aa('0x5b')]['id']},'attributes':['id',_0x65aa('0x3c'),_0x65aa('0x2d')]})[_0x65aa('0x18')](handleEntityNotFound(_0x37382d,null))['then'](function(_0x2cddf2){if(!utils['isValidChannel'](_0x4e91d9['query'][_0x65aa('0xa0')])){throw new db[(_0x65aa('0x94'))][(_0x65aa('0x92'))]('Unknown\x20channel');}_0x52bec0=_0x2cddf2;var _0x9f84a1={};_0x9f84a1[_0x65aa('0x5c')]=_['keys'](db[_[_0x65aa('0xa6')](_0x4e91d9[_0x65aa('0x4a')][_0x65aa('0xa0')])+_0x65aa('0xd6')]['rawAttributes']);_0x9f84a1[_0x65aa('0x4a')]=_['keys'](_0x4e91d9[_0x65aa('0x4a')]);_0x9f84a1[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x9f84a1[_0x65aa('0x5c')],_0x9f84a1['query']);_0x376063[_0x65aa('0x4f')]=_[_0x65aa('0x60')](_0x9f84a1[_0x65aa('0x5c')],qs[_0x65aa('0x61')](_0x4e91d9[_0x65aa('0x4a')]['fields']));_0x376063[_0x65aa('0x4f')]=_0x376063[_0x65aa('0x4f')][_0x65aa('0x52')]?_0x376063[_0x65aa('0x4f')]:_0x9f84a1['model'];_0x376063[_0x65aa('0xd7')]=qs[_0x65aa('0xd8')](_0x4e91d9[_0x65aa('0x4a')][_0x65aa('0xd8')]);_0x376063[_0x65aa('0x49')]=qs['filters'](_['pick'](_0x4e91d9[_0x65aa('0x4a')],_0x9f84a1[_0x65aa('0x5f')]));if(_0x4e91d9['query']['filter']){_0x376063['where']=_[_0x65aa('0xd9')](_0x376063['where'],{'$or':_[_0x65aa('0x38')](_0x376063['attributes'],function(_0x89c574){var _0x1285e6={};_0x1285e6[_0x89c574]={'$like':'%'+_0x4e91d9[_0x65aa('0x4a')]['filter']+'%'};return _0x1285e6;})});}_0x376063=_[_0x65aa('0xd9')]({},_0x376063,_0x4e91d9[_0x65aa('0x63')]);switch(_0x52bec0[_0x65aa('0x2d')]){case _0x65aa('0x32'):return db[_[_0x65aa('0xa6')](_0x4e91d9[_0x65aa('0x4a')][_0x65aa('0xa0')])+_0x65aa('0xd6')][_0x65aa('0x8c')](_0x376063);case'user':case _0x65aa('0x2e'):return _0x52bec0['get'+_[_0x65aa('0xa6')](_0x4e91d9[_0x65aa('0x4a')][_0x65aa('0xa0')])+_0x65aa('0xa8')](_0x376063);default:throw new db[(_0x65aa('0x94'))]['ValidationError']('Unknown\x20role');}})[_0x65aa('0x18')](function(_0x29926c){_0x52f3dc=_0x29926c[_0x65aa('0x52')];if(!_0x4e91d9[_0x65aa('0x4a')][_0x65aa('0xda')](_0x65aa('0xdb'))){_0x376063[_0x65aa('0x27')]=qs[_0x65aa('0x27')](_0x4e91d9[_0x65aa('0x4a')][_0x65aa('0x27')]);_0x376063[_0x65aa('0x25')]=qs[_0x65aa('0x25')](_0x4e91d9[_0x65aa('0x4a')][_0x65aa('0x25')]);}switch(_0x52bec0[_0x65aa('0x2d')]){case'admin':return db[_[_0x65aa('0xa6')](_0x4e91d9['query']['channel'])+_0x65aa('0xd6')][_0x65aa('0x8c')](_0x376063);case _0x65aa('0x34'):case _0x65aa('0x2e'):return _0x52bec0[_0x65aa('0x31')+_[_0x65aa('0xa6')](_0x4e91d9[_0x65aa('0x4a')][_0x65aa('0xa0')])+_0x65aa('0xa8')](_0x376063);}})['then'](function(_0x5d87f2){return{'count':_0x52f3dc,'rows':_0x5d87f2};})[_0x65aa('0x18')](respondWithResult(_0x37382d,null))[_0x65aa('0x22')](handleError(_0x37382d,null));};exports[_0x65aa('0xdc')]=function(_0x359b3a,_0x29ebb9){var _0x43c009={};var _0x174270={};var _0x46cf4c;var _0x195a1f;return db[_0x65aa('0x41')][_0x65aa('0x99')]({'where':{'id':_0x359b3a['params']['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x29ebb9,null))[_0x65aa('0x18')](function(_0x4d58){if(_0x4d58){_0x46cf4c=_0x4d58;_0x174270[_0x65aa('0x5c')]=_[_0x65aa('0x5e')](db[_0x65aa('0xb1')][_0x65aa('0x42')]);_0x174270[_0x65aa('0x4a')]=_[_0x65aa('0x5e')](_0x359b3a[_0x65aa('0x4a')]);_0x174270[_0x65aa('0x5f')]=_['intersection'](_0x174270[_0x65aa('0x5c')],_0x174270['query']);_0x43c009['attributes']=_[_0x65aa('0x60')](_0x174270[_0x65aa('0x5c')],qs[_0x65aa('0x61')](_0x359b3a[_0x65aa('0x4a')][_0x65aa('0x61')]));_0x43c009[_0x65aa('0x4f')]=_0x43c009[_0x65aa('0x4f')][_0x65aa('0x52')]?_0x43c009[_0x65aa('0x4f')]:_0x174270['model'];_0x43c009[_0x65aa('0xd7')]=qs[_0x65aa('0xd8')](_0x359b3a['query']['sort']);_0x43c009[_0x65aa('0x49')]=qs[_0x65aa('0x5f')](_['pick'](_0x359b3a[_0x65aa('0x4a')],_0x174270['filters']));if(_0x359b3a[_0x65aa('0x4a')][_0x65aa('0x37')]){_0x43c009['where']=_['merge'](_0x43c009[_0x65aa('0x49')],{'$or':_[_0x65aa('0x38')](_0x43c009[_0x65aa('0x4f')],function(_0x340d30){var _0x316dfb={};_0x316dfb[_0x340d30]={'$like':'%'+_0x359b3a[_0x65aa('0x4a')][_0x65aa('0x37')]+'%'};return _0x316dfb;})});}_0x43c009=_[_0x65aa('0xd9')]({},_0x43c009,_0x359b3a[_0x65aa('0x63')]);return _0x46cf4c[_0x65aa('0xdc')](_0x43c009);}})[_0x65aa('0x18')](function(_0x1ebcc2){if(_0x1ebcc2){_0x195a1f=_0x1ebcc2[_0x65aa('0x52')];if(!_0x359b3a['query'][_0x65aa('0xda')](_0x65aa('0xdb'))){_0x43c009[_0x65aa('0x27')]=qs[_0x65aa('0x27')](_0x359b3a[_0x65aa('0x4a')][_0x65aa('0x27')]);_0x43c009[_0x65aa('0x25')]=qs[_0x65aa('0x25')](_0x359b3a[_0x65aa('0x4a')]['offset']);}return _0x46cf4c['getVoiceQueuesRt'](_0x43c009);}})[_0x65aa('0x18')](function(_0x4e9cf5){if(_0x4e9cf5){return _0x4e9cf5?{'count':_0x195a1f,'rows':_0x4e9cf5}:null;}})[_0x65aa('0x18')](respondWithResult(_0x29ebb9,null))[_0x65aa('0x22')](handleError(_0x29ebb9,null));};exports['getGroups']=function(_0x2484c6,_0x35c2e7){var _0x12fc1d={};var _0x14c4ee={};var _0x18d51d;var _0x8388b1;return db[_0x65aa('0x41')][_0x65aa('0x99')]({'where':{'id':_0x2484c6['params']['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x35c2e7,null))[_0x65aa('0x18')](function(_0x4e98f9){if(_0x4e98f9){_0x18d51d=_0x4e98f9;_0x14c4ee[_0x65aa('0x5c')]=_[_0x65aa('0x5e')](db[_0x65aa('0xdd')][_0x65aa('0x42')]);_0x14c4ee['query']=_[_0x65aa('0x5e')](_0x2484c6[_0x65aa('0x4a')]);_0x14c4ee[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x14c4ee[_0x65aa('0x5c')],_0x14c4ee['query']);_0x12fc1d[_0x65aa('0x4f')]=_[_0x65aa('0x60')](_0x14c4ee[_0x65aa('0x5c')],qs['fields'](_0x2484c6[_0x65aa('0x4a')][_0x65aa('0x61')]));_0x12fc1d[_0x65aa('0x4f')]=_0x12fc1d[_0x65aa('0x4f')][_0x65aa('0x52')]?_0x12fc1d[_0x65aa('0x4f')]:_0x14c4ee[_0x65aa('0x5c')];_0x12fc1d[_0x65aa('0xd7')]=qs[_0x65aa('0xd8')](_0x2484c6[_0x65aa('0x4a')][_0x65aa('0xd8')]);_0x12fc1d[_0x65aa('0x49')]=qs[_0x65aa('0x5f')](_['pick'](_0x2484c6[_0x65aa('0x4a')],_0x14c4ee[_0x65aa('0x5f')]));if(_0x2484c6[_0x65aa('0x4a')][_0x65aa('0x37')]){_0x12fc1d[_0x65aa('0x49')]=_[_0x65aa('0xd9')](_0x12fc1d['where'],{'$or':_['map'](_0x12fc1d[_0x65aa('0x4f')],function(_0x6e17c3){var _0x490b61={};_0x490b61[_0x6e17c3]={'$like':'%'+_0x2484c6[_0x65aa('0x4a')][_0x65aa('0x37')]+'%'};return _0x490b61;})});}_0x12fc1d=_[_0x65aa('0xd9')]({},_0x12fc1d,_0x2484c6[_0x65aa('0x63')]);return _0x18d51d[_0x65aa('0xde')](_0x12fc1d);}})[_0x65aa('0x18')](function(_0x45c5cf){if(_0x45c5cf){_0x8388b1=_0x45c5cf[_0x65aa('0x52')];if(!_0x2484c6[_0x65aa('0x4a')][_0x65aa('0xda')](_0x65aa('0xdb'))){_0x12fc1d[_0x65aa('0x27')]=qs[_0x65aa('0x27')](_0x2484c6[_0x65aa('0x4a')][_0x65aa('0x27')]);_0x12fc1d[_0x65aa('0x25')]=qs[_0x65aa('0x25')](_0x2484c6[_0x65aa('0x4a')]['offset']);}return _0x18d51d['getGroups'](_0x12fc1d);}})['then'](function(_0x21eca0){if(_0x21eca0){return _0x21eca0?{'count':_0x8388b1,'rows':_0x21eca0}:null;}})[_0x65aa('0x18')](respondWithResult(_0x35c2e7,null))[_0x65aa('0x22')](handleError(_0x35c2e7,null));};exports['getRecordings']=function(_0x32ac2c,_0x422b05){var _0x30a0e8={'raw':!![],'where':{}};var _0x29c37e={};var _0x20d195={'count':0x0,'rows':[]};return db[_0x65aa('0x41')][_0x65aa('0x99')]({'where':{'id':_0x32ac2c[_0x65aa('0x5b')]['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x422b05,null))[_0x65aa('0x18')](function(_0x35c323){if(_0x35c323){_0x29c37e[_0x65aa('0x5c')]=_['keys'](db['VoiceRecording'][_0x65aa('0x42')]);_0x29c37e[_0x65aa('0x4a')]=_[_0x65aa('0x5e')](_0x32ac2c['query']);_0x29c37e[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x29c37e[_0x65aa('0x5c')],_0x29c37e[_0x65aa('0x4a')]);_0x30a0e8[_0x65aa('0x4f')]=_[_0x65aa('0x60')](_0x29c37e[_0x65aa('0x5c')],qs[_0x65aa('0x61')](_0x32ac2c[_0x65aa('0x4a')]['fields']));_0x30a0e8[_0x65aa('0x4f')]=_0x30a0e8[_0x65aa('0x4f')][_0x65aa('0x52')]?_0x30a0e8[_0x65aa('0x4f')]:_0x29c37e[_0x65aa('0x5c')];if(!_0x32ac2c['query'][_0x65aa('0xda')]('nolimit')){_0x30a0e8[_0x65aa('0x27')]=qs[_0x65aa('0x27')](_0x32ac2c[_0x65aa('0x4a')][_0x65aa('0x27')]);_0x30a0e8['offset']=qs[_0x65aa('0x25')](_0x32ac2c[_0x65aa('0x4a')][_0x65aa('0x25')]);}_0x30a0e8[_0x65aa('0xd7')]=qs[_0x65aa('0xd8')](_0x32ac2c[_0x65aa('0x4a')][_0x65aa('0xd8')]);_0x30a0e8[_0x65aa('0x49')]=qs[_0x65aa('0x5f')](_['pick'](_0x32ac2c[_0x65aa('0x4a')],_0x29c37e['filters']));_0x30a0e8[_0x65aa('0x49')][_0x65aa('0xdf')]=_0x35c323['id'];if(_0x32ac2c['query']['filter']){_0x30a0e8[_0x65aa('0x49')]=_['merge'](_0x30a0e8[_0x65aa('0x49')],{'$or':_[_0x65aa('0x38')](_0x30a0e8[_0x65aa('0x4f')],function(_0x14881c){var _0x425c41={};_0x425c41[_0x14881c]={'$like':'%'+_0x32ac2c[_0x65aa('0x4a')][_0x65aa('0x37')]+'%'};return _0x425c41;})});}_0x30a0e8=_[_0x65aa('0xd9')]({},_0x30a0e8,_0x32ac2c[_0x65aa('0x63')]);return db[_0x65aa('0xe0')]['count']({'where':_0x30a0e8[_0x65aa('0x49')]})['then'](function(_0x3332e2){_0x20d195[_0x65aa('0x28')]=_0x3332e2;if(_0x32ac2c[_0x65aa('0x4a')][_0x65aa('0x4b')]){_0x30a0e8[_0x65aa('0x4c')]=[{'all':!![]}];}return db['VoiceRecording'][_0x65aa('0x8c')](_0x30a0e8);})[_0x65aa('0x18')](function(_0xbd69d7){_0x20d195['rows']=_0xbd69d7;return _0x20d195;});}})[_0x65aa('0x18')](respondWithFilteredResult(_0x422b05,_0x30a0e8))[_0x65aa('0x22')](handleError(_0x422b05,null));};exports[_0x65aa('0xe1')]=function(_0x4028c7,_0x4d509a){var _0x5be12c={'raw':!![],'where':{}};var _0x2735a5={};var _0xd5b023={'count':0x0,'rows':[]};return db[_0x65aa('0x41')][_0x65aa('0x99')]({'where':{'id':_0x4028c7[_0x65aa('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4d509a,null))[_0x65aa('0x18')](function(_0xf60494){if(_0xf60494){_0x2735a5[_0x65aa('0x5c')]=_[_0x65aa('0x5e')](db[_0x65aa('0xe2')][_0x65aa('0x42')]);_0x2735a5[_0x65aa('0x4a')]=_[_0x65aa('0x5e')](_0x4028c7[_0x65aa('0x4a')]);_0x2735a5[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x2735a5[_0x65aa('0x5c')],_0x2735a5['query']);_0x5be12c[_0x65aa('0x4f')]=_[_0x65aa('0x60')](_0x2735a5[_0x65aa('0x5c')],qs[_0x65aa('0x61')](_0x4028c7['query'][_0x65aa('0x61')]));_0x5be12c[_0x65aa('0x4f')]=_0x5be12c[_0x65aa('0x4f')]['length']?_0x5be12c[_0x65aa('0x4f')]:_0x2735a5[_0x65aa('0x5c')];if(!_0x4028c7['query'][_0x65aa('0xda')]('nolimit')){_0x5be12c[_0x65aa('0x27')]=qs[_0x65aa('0x27')](_0x4028c7[_0x65aa('0x4a')][_0x65aa('0x27')]);_0x5be12c[_0x65aa('0x25')]=qs[_0x65aa('0x25')](_0x4028c7[_0x65aa('0x4a')][_0x65aa('0x25')]);}_0x5be12c[_0x65aa('0xd7')]=qs[_0x65aa('0xd8')](_0x4028c7[_0x65aa('0x4a')][_0x65aa('0xd8')]);_0x5be12c[_0x65aa('0x49')]=qs['filters'](_[_0x65aa('0xe3')](_0x4028c7[_0x65aa('0x4a')],_0x2735a5['filters']));_0x5be12c[_0x65aa('0x49')]['UserId']=_0xf60494['id'];if(_0x4028c7[_0x65aa('0x4a')][_0x65aa('0x37')]){_0x5be12c[_0x65aa('0x49')]=_[_0x65aa('0xd9')](_0x5be12c['where'],{'$or':_[_0x65aa('0x38')](_0x5be12c[_0x65aa('0x4f')],function(_0x210515){var _0x59e6e5={};_0x59e6e5[_0x210515]={'$like':'%'+_0x4028c7[_0x65aa('0x4a')][_0x65aa('0x37')]+'%'};return _0x59e6e5;})});}_0x5be12c=_[_0x65aa('0xd9')]({},_0x5be12c,_0x4028c7['options']);return db[_0x65aa('0xe2')][_0x65aa('0x28')]({'where':_0x5be12c[_0x65aa('0x49')]})[_0x65aa('0x18')](function(_0xc5566e){_0xd5b023[_0x65aa('0x28')]=_0xc5566e;if(_0x4028c7[_0x65aa('0x4a')][_0x65aa('0x4b')]){_0x5be12c[_0x65aa('0x4c')]=[{'all':!![]}];}return db[_0x65aa('0xe2')][_0x65aa('0x8c')](_0x5be12c);})[_0x65aa('0x18')](function(_0x26b82d){_0xd5b023['rows']=_0x26b82d;return _0xd5b023;});}})[_0x65aa('0x18')](respondWithFilteredResult(_0x4d509a,_0x5be12c))[_0x65aa('0x22')](handleError(_0x4d509a,null));};exports['getChatInteractions']=function(_0x5c575c,_0x378b78){var _0x3b0a71={};var _0x5cf109={};var _0x193ce2;var _0x357961;return db['User'][_0x65aa('0x99')]({'where':{'id':_0x5c575c[_0x65aa('0x5b')]['id']}})['then'](handleEntityNotFound(_0x378b78,null))[_0x65aa('0x18')](function(_0x153e02){if(_0x153e02){_0x193ce2=_0x153e02;_0x5cf109[_0x65aa('0x5c')]=_['keys'](db[_0x65aa('0xe4')]['rawAttributes']);_0x5cf109[_0x65aa('0x4a')]=_[_0x65aa('0x5e')](_0x5c575c[_0x65aa('0x4a')]);_0x5cf109[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x5cf109[_0x65aa('0x5c')],_0x5cf109[_0x65aa('0x4a')]);_0x3b0a71[_0x65aa('0x4f')]=_['intersection'](_0x5cf109[_0x65aa('0x5c')],qs[_0x65aa('0x61')](_0x5c575c['query']['fields']));_0x3b0a71['attributes']=_0x3b0a71[_0x65aa('0x4f')][_0x65aa('0x52')]?_0x3b0a71[_0x65aa('0x4f')]:_0x5cf109[_0x65aa('0x5c')];_0x3b0a71[_0x65aa('0xd7')]=qs[_0x65aa('0xd8')](_0x5c575c['query'][_0x65aa('0xd8')]);_0x3b0a71[_0x65aa('0x49')]=qs[_0x65aa('0x5f')](_[_0x65aa('0xe3')](_0x5c575c[_0x65aa('0x4a')],_0x5cf109['filters']));if(_0x5c575c[_0x65aa('0x4a')]['filter']){_0x3b0a71['where']=_[_0x65aa('0xd9')](_0x3b0a71['where'],{'$or':_['map'](_0x3b0a71[_0x65aa('0x4f')],function(_0x169ec5){var _0x2a455b={};_0x2a455b[_0x169ec5]={'$like':'%'+_0x5c575c[_0x65aa('0x4a')][_0x65aa('0x37')]+'%'};return _0x2a455b;})});}_0x3b0a71=_[_0x65aa('0xd9')]({},_0x3b0a71,_0x5c575c['options']);return _0x193ce2[_0x65aa('0xe5')](_0x3b0a71);}})[_0x65aa('0x18')](function(_0x402e4c){if(_0x402e4c){_0x357961=_0x402e4c['length'];if(!_0x5c575c['query']['hasOwnProperty'](_0x65aa('0xdb'))){_0x3b0a71[_0x65aa('0x27')]=qs[_0x65aa('0x27')](_0x5c575c[_0x65aa('0x4a')][_0x65aa('0x27')]);_0x3b0a71['offset']=qs[_0x65aa('0x25')](_0x5c575c[_0x65aa('0x4a')][_0x65aa('0x25')]);}return _0x193ce2[_0x65aa('0xe5')](_0x3b0a71);}})['then'](function(_0x1f9f37){if(_0x1f9f37){return _0x1f9f37?{'count':_0x357961,'rows':_0x1f9f37}:null;}})['then'](respondWithResult(_0x378b78,null))[_0x65aa('0x22')](handleError(_0x378b78,null));};exports[_0x65aa('0xe6')]=function(_0x3dd945,_0x450de1){var _0x21b7de={};var _0x7bb9ea={};var _0x5b7c1a;var _0xf1243f;return db[_0x65aa('0x41')][_0x65aa('0x99')]({'where':{'id':_0x3dd945['params']['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x450de1,null))['then'](function(_0x16d6f5){if(_0x16d6f5){_0x5b7c1a=_0x16d6f5;_0x7bb9ea[_0x65aa('0x5c')]=_[_0x65aa('0x5e')](db[_0x65aa('0xe7')][_0x65aa('0x42')]);_0x7bb9ea[_0x65aa('0x4a')]=_[_0x65aa('0x5e')](_0x3dd945[_0x65aa('0x4a')]);_0x7bb9ea[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x7bb9ea[_0x65aa('0x5c')],_0x7bb9ea[_0x65aa('0x4a')]);_0x21b7de[_0x65aa('0x4f')]=_['intersection'](_0x7bb9ea[_0x65aa('0x5c')],qs[_0x65aa('0x61')](_0x3dd945[_0x65aa('0x4a')][_0x65aa('0x61')]));_0x21b7de[_0x65aa('0x4f')]=_0x21b7de[_0x65aa('0x4f')]['length']?_0x21b7de['attributes']:_0x7bb9ea[_0x65aa('0x5c')];_0x21b7de['order']=qs[_0x65aa('0xd8')](_0x3dd945['query'][_0x65aa('0xd8')]);_0x21b7de['where']=qs['filters'](_[_0x65aa('0xe3')](_0x3dd945['query'],_0x7bb9ea[_0x65aa('0x5f')]));if(_0x3dd945[_0x65aa('0x4a')][_0x65aa('0x37')]){_0x21b7de[_0x65aa('0x49')]=_[_0x65aa('0xd9')](_0x21b7de[_0x65aa('0x49')],{'$or':_[_0x65aa('0x38')](_0x21b7de[_0x65aa('0x4f')],function(_0x21925a){var _0x550ad7={};_0x550ad7[_0x21925a]={'$like':'%'+_0x3dd945[_0x65aa('0x4a')]['filter']+'%'};return _0x550ad7;})});}_0x21b7de=_[_0x65aa('0xd9')]({},_0x21b7de,_0x3dd945[_0x65aa('0x63')]);return _0x5b7c1a[_0x65aa('0xe6')](_0x21b7de);}})['then'](function(_0x57aae6){if(_0x57aae6){_0xf1243f=_0x57aae6[_0x65aa('0x52')];if(!_0x3dd945[_0x65aa('0x4a')]['hasOwnProperty'](_0x65aa('0xdb'))){_0x21b7de[_0x65aa('0x27')]=qs[_0x65aa('0x27')](_0x3dd945[_0x65aa('0x4a')]['limit']);_0x21b7de[_0x65aa('0x25')]=qs[_0x65aa('0x25')](_0x3dd945[_0x65aa('0x4a')][_0x65aa('0x25')]);}return _0x5b7c1a[_0x65aa('0xe6')](_0x21b7de);}})[_0x65aa('0x18')](function(_0x41b911){if(_0x41b911){return _0x41b911?{'count':_0xf1243f,'rows':_0x41b911}:null;}})[_0x65aa('0x18')](respondWithResult(_0x450de1,null))[_0x65aa('0x22')](handleError(_0x450de1,null));};exports[_0x65aa('0xe8')]=function(_0x321d93,_0x1c452f){var _0x1cf443={'raw':!![],'where':{}};var _0x2ef7ee={};var _0xfac2db={'count':0x0,'rows':[]};return db[_0x65aa('0x41')]['findOne']({'where':{'id':_0x321d93[_0x65aa('0x5b')]['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x1c452f,null))[_0x65aa('0x18')](function(_0x2bd767){if(_0x2bd767){_0x2ef7ee[_0x65aa('0x5c')]=_['keys'](db[_0x65aa('0xe9')][_0x65aa('0x42')]);_0x2ef7ee[_0x65aa('0x4a')]=_[_0x65aa('0x5e')](_0x321d93['query']);_0x2ef7ee[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x2ef7ee[_0x65aa('0x5c')],_0x2ef7ee[_0x65aa('0x4a')]);_0x1cf443[_0x65aa('0x4f')]=_[_0x65aa('0x60')](_0x2ef7ee[_0x65aa('0x5c')],qs['fields'](_0x321d93[_0x65aa('0x4a')][_0x65aa('0x61')]));_0x1cf443[_0x65aa('0x4f')]=_0x1cf443['attributes'][_0x65aa('0x52')]?_0x1cf443[_0x65aa('0x4f')]:_0x2ef7ee[_0x65aa('0x5c')];if(!_0x321d93[_0x65aa('0x4a')][_0x65aa('0xda')](_0x65aa('0xdb'))){_0x1cf443['limit']=qs[_0x65aa('0x27')](_0x321d93['query']['limit']);_0x1cf443[_0x65aa('0x25')]=qs[_0x65aa('0x25')](_0x321d93[_0x65aa('0x4a')][_0x65aa('0x25')]);}_0x1cf443['order']=qs['sort'](_0x321d93[_0x65aa('0x4a')][_0x65aa('0xd8')]);_0x1cf443[_0x65aa('0x49')]=qs[_0x65aa('0x5f')](_[_0x65aa('0xe3')](_0x321d93[_0x65aa('0x4a')],_0x2ef7ee[_0x65aa('0x5f')]));_0x1cf443[_0x65aa('0x49')][_0x65aa('0xdf')]=_0x2bd767['id'];if(_0x321d93[_0x65aa('0x4a')][_0x65aa('0x37')]){_0x1cf443[_0x65aa('0x49')]=_['merge'](_0x1cf443[_0x65aa('0x49')],{'$or':_[_0x65aa('0x38')](_0x1cf443[_0x65aa('0x4f')],function(_0x4e083a){var _0x4a6f25={};_0x4a6f25[_0x4e083a]={'$like':'%'+_0x321d93[_0x65aa('0x4a')][_0x65aa('0x37')]+'%'};return _0x4a6f25;})});}_0x1cf443=_[_0x65aa('0xd9')]({},_0x1cf443,_0x321d93[_0x65aa('0x63')]);return db[_0x65aa('0xe9')][_0x65aa('0x28')]({'where':_0x1cf443[_0x65aa('0x49')]})[_0x65aa('0x18')](function(_0x1e778f){_0xfac2db[_0x65aa('0x28')]=_0x1e778f;if(_0x321d93[_0x65aa('0x4a')][_0x65aa('0x4b')]){_0x1cf443['include']=[{'all':!![]}];}return db[_0x65aa('0xe9')][_0x65aa('0x8c')](_0x1cf443);})[_0x65aa('0x18')](function(_0x2fd503){_0xfac2db[_0x65aa('0x51')]=_0x2fd503;return _0xfac2db;});}})['then'](respondWithFilteredResult(_0x1c452f,_0x1cf443))['catch'](handleError(_0x1c452f,null));};exports['getSmsInteractions']=function(_0x46a04a,_0x1008fe){var _0x337c87={};var _0x23e002={};var _0x2d794f;var _0x3d85a5;return db['User'][_0x65aa('0x99')]({'where':{'id':_0x46a04a[_0x65aa('0x5b')]['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x1008fe,null))[_0x65aa('0x18')](function(_0x9db65c){if(_0x9db65c){_0x2d794f=_0x9db65c;_0x23e002[_0x65aa('0x5c')]=_[_0x65aa('0x5e')](db['SmsInteraction'][_0x65aa('0x42')]);_0x23e002[_0x65aa('0x4a')]=_[_0x65aa('0x5e')](_0x46a04a[_0x65aa('0x4a')]);_0x23e002[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x23e002['model'],_0x23e002[_0x65aa('0x4a')]);_0x337c87[_0x65aa('0x4f')]=_[_0x65aa('0x60')](_0x23e002[_0x65aa('0x5c')],qs[_0x65aa('0x61')](_0x46a04a[_0x65aa('0x4a')][_0x65aa('0x61')]));_0x337c87[_0x65aa('0x4f')]=_0x337c87[_0x65aa('0x4f')][_0x65aa('0x52')]?_0x337c87[_0x65aa('0x4f')]:_0x23e002[_0x65aa('0x5c')];_0x337c87['order']=qs[_0x65aa('0xd8')](_0x46a04a[_0x65aa('0x4a')]['sort']);_0x337c87[_0x65aa('0x49')]=qs[_0x65aa('0x5f')](_[_0x65aa('0xe3')](_0x46a04a['query'],_0x23e002[_0x65aa('0x5f')]));if(_0x46a04a[_0x65aa('0x4a')][_0x65aa('0x37')]){_0x337c87[_0x65aa('0x49')]=_[_0x65aa('0xd9')](_0x337c87[_0x65aa('0x49')],{'$or':_[_0x65aa('0x38')](_0x337c87['attributes'],function(_0x5acc82){var _0x303c93={};_0x303c93[_0x5acc82]={'$like':'%'+_0x46a04a[_0x65aa('0x4a')][_0x65aa('0x37')]+'%'};return _0x303c93;})});}_0x337c87=_[_0x65aa('0xd9')]({},_0x337c87,_0x46a04a[_0x65aa('0x63')]);return _0x2d794f[_0x65aa('0xea')](_0x337c87);}})[_0x65aa('0x18')](function(_0x141e61){if(_0x141e61){_0x3d85a5=_0x141e61[_0x65aa('0x52')];if(!_0x46a04a[_0x65aa('0x4a')][_0x65aa('0xda')](_0x65aa('0xdb'))){_0x337c87[_0x65aa('0x27')]=qs[_0x65aa('0x27')](_0x46a04a[_0x65aa('0x4a')]['limit']);_0x337c87['offset']=qs['offset'](_0x46a04a[_0x65aa('0x4a')][_0x65aa('0x25')]);}return _0x2d794f['getSmsInteractions'](_0x337c87);}})['then'](function(_0x45af8f){if(_0x45af8f){return _0x45af8f?{'count':_0x3d85a5,'rows':_0x45af8f}:null;}})['then'](respondWithResult(_0x1008fe,null))[_0x65aa('0x22')](handleError(_0x1008fe,null));};exports[_0x65aa('0xeb')]=function(_0x21cc62,_0x3cf63e){var _0x427c3a={};var _0x25c63f={};var _0x358814;var _0x3c2c4b;return db[_0x65aa('0x41')][_0x65aa('0x99')]({'where':{'id':_0x21cc62[_0x65aa('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3cf63e,null))['then'](function(_0x32a790){if(_0x32a790){_0x358814=_0x32a790;_0x25c63f[_0x65aa('0x5c')]=_['keys'](db['FaxInteraction'][_0x65aa('0x42')]);_0x25c63f[_0x65aa('0x4a')]=_['keys'](_0x21cc62[_0x65aa('0x4a')]);_0x25c63f['filters']=_[_0x65aa('0x60')](_0x25c63f[_0x65aa('0x5c')],_0x25c63f['query']);_0x427c3a[_0x65aa('0x4f')]=_[_0x65aa('0x60')](_0x25c63f['model'],qs[_0x65aa('0x61')](_0x21cc62[_0x65aa('0x4a')][_0x65aa('0x61')]));_0x427c3a[_0x65aa('0x4f')]=_0x427c3a[_0x65aa('0x4f')][_0x65aa('0x52')]?_0x427c3a['attributes']:_0x25c63f[_0x65aa('0x5c')];_0x427c3a[_0x65aa('0xd7')]=qs[_0x65aa('0xd8')](_0x21cc62[_0x65aa('0x4a')]['sort']);_0x427c3a['where']=qs[_0x65aa('0x5f')](_[_0x65aa('0xe3')](_0x21cc62[_0x65aa('0x4a')],_0x25c63f[_0x65aa('0x5f')]));if(_0x21cc62[_0x65aa('0x4a')][_0x65aa('0x37')]){_0x427c3a['where']=_['merge'](_0x427c3a[_0x65aa('0x49')],{'$or':_['map'](_0x427c3a[_0x65aa('0x4f')],function(_0x969fdb){var _0x3f4f1a={};_0x3f4f1a[_0x969fdb]={'$like':'%'+_0x21cc62[_0x65aa('0x4a')][_0x65aa('0x37')]+'%'};return _0x3f4f1a;})});}_0x427c3a=_['merge']({},_0x427c3a,_0x21cc62[_0x65aa('0x63')]);return _0x358814[_0x65aa('0xeb')](_0x427c3a);}})['then'](function(_0x42d3bd){if(_0x42d3bd){_0x3c2c4b=_0x42d3bd[_0x65aa('0x52')];if(!_0x21cc62[_0x65aa('0x4a')][_0x65aa('0xda')](_0x65aa('0xdb'))){_0x427c3a[_0x65aa('0x27')]=qs['limit'](_0x21cc62['query'][_0x65aa('0x27')]);_0x427c3a[_0x65aa('0x25')]=qs[_0x65aa('0x25')](_0x21cc62[_0x65aa('0x4a')][_0x65aa('0x25')]);}return _0x358814[_0x65aa('0xeb')](_0x427c3a);}})[_0x65aa('0x18')](function(_0x226af1){if(_0x226af1){return _0x226af1?{'count':_0x3c2c4b,'rows':_0x226af1}:null;}})[_0x65aa('0x18')](respondWithResult(_0x3cf63e,null))[_0x65aa('0x22')](handleError(_0x3cf63e,null));};exports[_0x65aa('0xec')]=function(_0x4b1fc0,_0x2ab1e0){var _0x1b047c={};var _0x26c08b={};var _0x12550b;var _0x2f61e9;return db[_0x65aa('0x41')][_0x65aa('0x99')]({'where':{'id':_0x4b1fc0[_0x65aa('0x5b')]['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x2ab1e0,null))['then'](function(_0x53827a){if(_0x53827a){_0x12550b=_0x53827a;_0x26c08b[_0x65aa('0x5c')]=_['keys'](db[_0x65aa('0xed')][_0x65aa('0x42')]);_0x26c08b['query']=_['keys'](_0x4b1fc0['query']);_0x26c08b[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x26c08b[_0x65aa('0x5c')],_0x26c08b['query']);_0x1b047c[_0x65aa('0x4f')]=_[_0x65aa('0x60')](_0x26c08b[_0x65aa('0x5c')],qs['fields'](_0x4b1fc0[_0x65aa('0x4a')][_0x65aa('0x61')]));_0x1b047c[_0x65aa('0x4f')]=_0x1b047c['attributes'][_0x65aa('0x52')]?_0x1b047c['attributes']:_0x26c08b[_0x65aa('0x5c')];_0x1b047c[_0x65aa('0xd7')]=qs[_0x65aa('0xd8')](_0x4b1fc0[_0x65aa('0x4a')][_0x65aa('0xd8')]);_0x1b047c['where']=qs[_0x65aa('0x5f')](_[_0x65aa('0xe3')](_0x4b1fc0[_0x65aa('0x4a')],_0x26c08b[_0x65aa('0x5f')]));if(_0x4b1fc0[_0x65aa('0x4a')][_0x65aa('0x37')]){_0x1b047c[_0x65aa('0x49')]=_[_0x65aa('0xd9')](_0x1b047c['where'],{'$or':_['map'](_0x1b047c['attributes'],function(_0x2bd490){var _0x191ce0={};_0x191ce0[_0x2bd490]={'$like':'%'+_0x4b1fc0['query']['filter']+'%'};return _0x191ce0;})});}_0x1b047c=_[_0x65aa('0xd9')]({},_0x1b047c,_0x4b1fc0['options']);return _0x12550b['getWhatsappInteractions'](_0x1b047c);}})[_0x65aa('0x18')](function(_0x4d073e){if(_0x4d073e){_0x2f61e9=_0x4d073e[_0x65aa('0x52')];if(!_0x4b1fc0[_0x65aa('0x4a')][_0x65aa('0xda')](_0x65aa('0xdb'))){_0x1b047c['limit']=qs[_0x65aa('0x27')](_0x4b1fc0['query'][_0x65aa('0x27')]);_0x1b047c[_0x65aa('0x25')]=qs[_0x65aa('0x25')](_0x4b1fc0['query'][_0x65aa('0x25')]);}return _0x12550b['getWhatsappInteractions'](_0x1b047c);}})[_0x65aa('0x18')](function(_0x194900){if(_0x194900){return _0x194900?{'count':_0x2f61e9,'rows':_0x194900}:null;}})[_0x65aa('0x18')](respondWithResult(_0x2ab1e0,null))[_0x65aa('0x22')](handleError(_0x2ab1e0,null));};exports['login']=function(_0x141a5d,_0x19d5c9,_0x60aca7){var _0x3bc509;var _0x16af71;var _0xe6e5d2;var _0x281ecf=!_[_0x65aa('0x6e')](_0x141a5d[_0x65aa('0x5b')]['id'])?_0x141a5d[_0x65aa('0x5b')]['id']:!_[_0x65aa('0x6e')](_0x141a5d['user']['id'])?_0x141a5d[_0x65aa('0x34')]['id']:null;return db[_0x65aa('0x41')][_0x65aa('0x3b')]({'where':{'id':_0x281ecf,'role':{'$or':[_0x65aa('0x32'),_0x65aa('0x34'),_0x65aa('0x2e')]}},'attributes':['id',_0x65aa('0x3c'),_0x65aa('0xee'),_0x65aa('0xef'),_0x65aa('0x2d'),'internal',_0x65aa('0xa2')]})[_0x65aa('0x18')](function(_0x34f76d){if(_0x34f76d){if(_0x34f76d[_0x65aa('0x2d')]===_0x65aa('0x2e')){_0x3bc509=_0x34f76d;if(_0x141a5d[_0x65aa('0x65')]['interface']){_0xe6e5d2=util['format']('LOCAL/%s@from-sip/n',_0x3bc509[_0x141a5d[_0x65aa('0x65')][_0x65aa('0xac')]]);}else if(_0x141a5d['body']['intrf']){_0xe6e5d2=util[_0x65aa('0xad')]('SIP/%s',_0x141a5d['body'][_0x65aa('0xf0')]);}else{_0xe6e5d2=util['format'](_0x65aa('0xae'),_0x3bc509['name']);}socket['to'](util['format'](_0x65aa('0xf1'),_0x3bc509['name']))[_0x65aa('0xa9')](_0x65aa('0xf2'),{'user':{'id':_0x3bc509['id'],'name':_0x3bc509[_0x65aa('0x3c')]},'ip':_0x141a5d[_0x65aa('0xf3')][_0x65aa('0xf4')]||_0x141a5d[_0x65aa('0xf5')][_0x65aa('0xf6')]||_0x141a5d[_0x65aa('0xf7')][_0x65aa('0xf6')]||_0x141a5d[_0x65aa('0xf5')][_0x65aa('0xf7')][_0x65aa('0xf6')]});return db[_0x65aa('0xb1')][_0x65aa('0x30')]({'where':{'membername':_0x3bc509[_0x65aa('0x3c')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x65aa('0x92'))](_0x65aa('0xf8'));}})['then'](function(){if(_0x3bc509){return _0x3bc509['getVoiceQueues']({'raw':!![]});}})[_0x65aa('0x18')](function(_0x47b2ed){if(_0x3bc509){if(_0x47b2ed){_0x16af71=_0x47b2ed;if(_0x16af71['length']){var _0x10e809=_0x16af71['map'](function(_0x3aee49){var _0x581dca={'membername':_0x3bc509[_0x65aa('0x3c')],'UserId':_0x3bc509['id'],'queue_name':_0x3aee49[_0x65aa('0x3c')],'VoiceQueueId':_0x3aee49['id'],'interface':_0xe6e5d2,'paused':_0x3bc509[_0x65aa('0xa2')]||![],'penalty':_0x3aee49[_0x65aa('0xf9')]||0x0};return db['UserVoiceQueueRt']['upsert'](_0x581dca);});return Promise['all'](_0x10e809);}}}})[_0x65aa('0x18')](function(){if(_0x3bc509){return db[_0x65aa('0xfa')][_0x65aa('0x8c')]({'where':{'membername':_0x3bc509[_0x65aa('0x3c')],'exitAt':null}});}})[_0x65aa('0x18')](function(_0x2c75dd){if(_0x3bc509){var _0x173079=[];_0x2c75dd[_0x65aa('0xfb')](function(_0x5c364f){_0x173079['push'](_0x5c364f[_0x65aa('0x2c')]({'exitAt':moment()[_0x65aa('0xad')](_0x65aa('0xfc'))}));});return Promise[_0x65aa('0x59')](_0x173079);}})[_0x65aa('0x18')](function(){if(_0x3bc509){var _0x2bcf5c=[];var _0x491b34=[];var _0xba3a03=utils[_0x65aa('0xfd')]();var _0x40152d={'membername':_0x3bc509[_0x65aa('0x3c')],'interface':_0xe6e5d2,'enterAt':moment()[_0x65aa('0xad')](_0x65aa('0xfc')),'role':_0x3bc509['role'],'internal':_0x3bc509['internal']};_0xba3a03[_0x65aa('0xfb')](function(_0x59665e){_0x2bcf5c[_0x65aa('0x50')](_[_0x65aa('0xd9')]({'channel':_0x59665e,'type':'LOGIN','data1':_0x141a5d[_0x65aa('0x65')]['device'],'data2':_0xe6e5d2},_0x40152d));if(_0x3bc509[_0x65aa('0xa2')]){_0x491b34['push'](_[_0x65aa('0xd9')]({'channel':_0x59665e,'type':_0x65aa('0xfe'),'data1':_0x65aa('0xff')},_0x40152d));}});return db[_0x65aa('0xfa')][_0x65aa('0x87')](_0x2bcf5c['concat'](_0x491b34),{'individualHooks':!![]});}})[_0x65aa('0x18')](function(){if(_0x3bc509){return _0x3bc509[_0x65aa('0x2c')]({'online':!![],'lastLoginAt':moment()[_0x65aa('0xad')](_0x65aa('0xfc')),'voicePause':_0x3bc509[_0x65aa('0xa2')]||![],'mailPause':_0x3bc509['loginInPause']||![],'chatPause':_0x3bc509[_0x65aa('0xa2')]||![],'faxPause':_0x3bc509['loginInPause']||![],'smsPause':_0x3bc509[_0x65aa('0xa2')]||![],'openchannelPause':_0x3bc509[_0x65aa('0xa2')]||![],'whatsappPause':_0x3bc509['loginInPause']||![],'pauseType':_0x3bc509[_0x65aa('0xa2')]?_0x65aa('0xff'):null,'interface':_0xe6e5d2,'lastPauseAt':moment()[_0x65aa('0xad')](_0x65aa('0xfc'))});}})[_0x65aa('0x18')](function(_0x40b366){if(_0x141a5d['isMiddleware']){return _0x60aca7();}else{return Promise[_0x65aa('0x100')](_0x40b366)[_0x65aa('0x18')](respondWithResult(_0x19d5c9,null));}})['catch'](handleError(_0x19d5c9,null));};exports[_0x65aa('0x101')]=function(_0x489b9b,_0x45564c){var _0x26f7e6;return db[_0x65aa('0x41')][_0x65aa('0x3b')]({'where':{'id':_0x489b9b['params']['id'],'role':_0x65aa('0x2e')},'attributes':['id','name','role']})['then'](handleEntityNotFound(_0x45564c,null))['then'](function(_0x74b4c3){if(_0x74b4c3){_0x26f7e6=_0x74b4c3;return db['UserVoiceQueueRt'][_0x65aa('0x30')]({'where':{'membername':_0x26f7e6[_0x65aa('0x3c')]},'individualHooks':!![]});}})['then'](function(){return db['MemberReport'][_0x65aa('0x8c')]({'where':{'membername':_0x26f7e6[_0x65aa('0x3c')],'exitAt':null}});})[_0x65aa('0x18')](function(_0x4971e0){var _0x504f52=[];_0x4971e0['forEach'](function(_0x37e6c4){_0x504f52[_0x65aa('0x50')](_0x37e6c4['update']({'exitAt':moment()[_0x65aa('0xad')](_0x65aa('0xfc'))}));});return Promise['all'](_0x504f52);})[_0x65aa('0x18')](function(){return _0x26f7e6[_0x65aa('0x2c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x65aa('0x18')](respondWithResult(_0x45564c,null))[_0x65aa('0x22')](handleError(_0x45564c,null));};exports[_0x65aa('0x102')]=function(_0x1d6e73,_0x26ef79){var _0x34dc56;return db[_0x65aa('0xb1')][_0x65aa('0x2c')]({'paused':0x1},{'where':{'UserId':_0x1d6e73[_0x65aa('0x5b')]['id']},'individualHooks':!![]})[_0x65aa('0x18')](function(){return db[_0x65aa('0x41')][_0x65aa('0x3b')]({'where':{'id':_0x1d6e73['params']['id'],'role':'agent'},'attributes':['id',_0x65aa('0x3c'),_0x65aa('0x2d'),'internal',_0x65aa('0xac'),_0x65aa('0xa1')]});})[_0x65aa('0x18')](handleEntityNotFound(_0x26ef79,null))['then'](function(_0x29d923){if(_0x29d923){_0x34dc56=_0x29d923;return respondWithRpcPromise(_0x65aa('0x103'),_0x65aa('0x102'),{'id':_0x34dc56['id'],'name':_0x34dc56[_0x65aa('0x3c')],'pause':!![]});}})['then'](function(){if(_0x34dc56){return db[_0x65aa('0xfa')]['findAll']({'where':{'membername':_0x34dc56[_0x65aa('0x3c')],'type':_0x65aa('0xfe'),'exitAt':null}});}})['then'](function(_0x4a04b9){if(_0x4a04b9[_0x65aa('0x52')]){var _0x3e8822=moment()[_0x65aa('0xad')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x36f815=0x0,_0x519219=_0x4a04b9['length'];_0x36f815<_0x519219;_0x36f815++){_0x4a04b9[_0x36f815][_0x65aa('0x104')]({'exitAt':_0x3e8822});}}})[_0x65aa('0x18')](function(){var _0x481c15=[];var _0x21c99d=utils['getChannels']();_0x21c99d['forEach'](function(_0x427801){_0x481c15[_0x65aa('0x50')]({'channel':_0x427801,'membername':_0x34dc56['name'],'interface':_['isNil'](_0x34dc56['interface'])?util[_0x65aa('0xad')](_0x65aa('0xae'),_0x34dc56[_0x65aa('0x3c')]):_0x34dc56['interface'],'type':_0x65aa('0xfe'),'enterAt':moment()[_0x65aa('0xad')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x1d6e73[_0x65aa('0x65')][_0x65aa('0x44')]||'DEFAULT\x20PAUSE','role':_0x34dc56[_0x65aa('0x2d')],'internal':_0x34dc56['internal']});});return db['MemberReport'][_0x65aa('0x87')](_0x481c15,{'individualHooks':!![]});})['then'](function(){return _0x34dc56[_0x65aa('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x1d6e73[_0x65aa('0x65')][_0x65aa('0x44')]||_0x65aa('0x105'),'lastPauseAt':moment()[_0x65aa('0xad')](_0x65aa('0xfc'))});})['then'](respondWithResult(_0x26ef79,null))['catch'](handleError(_0x26ef79,null));};exports[_0x65aa('0x106')]=function(_0x2de078,_0x454396){if(_0x2de078['body'][_0x65aa('0xa0')]&&!utils[_0x65aa('0xa3')](_0x2de078['body']['channel'])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x2de078['body'][_0x65aa('0xa0')]));}return db['User']['find']({'where':{'id':_0x2de078[_0x65aa('0x5b')]['id']},'attributes':['id',_0x65aa('0x3c'),_0x65aa('0x2d'),_0x65aa('0x6a'),_0x65aa('0xac'),'online',_0x65aa('0xaf'),_0x65aa('0x107'),_0x65aa('0x108'),_0x65aa('0x109'),_0x65aa('0x10a'),_0x65aa('0x10b'),_0x65aa('0x10c'),_0x65aa('0x10d'),_0x65aa('0x10e')]})[_0x65aa('0x18')](function(_0x421dbf){if(!_0x421dbf){throw new APINotFoundError(util['format'](_0x65aa('0xcf'),_0x2de078['params']['id']));}return _0x421dbf[_0x65aa('0x106')](_0x2de078[_0x65aa('0x65')][_0x65aa('0xa0')]);})['then'](respondWithResult(_0x454396,null))[_0x65aa('0x22')](APIHandleError(_0x454396));};exports[_0x65aa('0x10f')]=function(_0x2fe18f,_0x43edd9){var _0x58d4b0={};var _0x30141c={};var _0x1fa66d;var _0xf08847;return db[_0x65aa('0x41')][_0x65aa('0x99')]({'where':{'id':_0x2fe18f[_0x65aa('0x5b')]['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x43edd9,null))['then'](function(_0x37c560){if(_0x37c560){_0x1fa66d=_0x37c560;_0x30141c[_0x65aa('0x5c')]=_['keys'](db[_0x65aa('0x110')][_0x65aa('0x42')]);_0x30141c[_0x65aa('0x4a')]=_[_0x65aa('0x5e')](_0x2fe18f[_0x65aa('0x4a')]);_0x30141c[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x30141c[_0x65aa('0x5c')],_0x30141c[_0x65aa('0x4a')]);_0x58d4b0[_0x65aa('0x4f')]=_[_0x65aa('0x60')](_0x30141c[_0x65aa('0x5c')],qs['fields'](_0x2fe18f['query'][_0x65aa('0x61')]));_0x58d4b0[_0x65aa('0x4f')]=_0x58d4b0['attributes'][_0x65aa('0x52')]?_0x58d4b0[_0x65aa('0x4f')]:_0x30141c['model'];_0x58d4b0['order']=qs[_0x65aa('0xd8')](_0x2fe18f[_0x65aa('0x4a')][_0x65aa('0xd8')]);_0x58d4b0['where']=qs[_0x65aa('0x5f')](_[_0x65aa('0xe3')](_0x2fe18f[_0x65aa('0x4a')],_0x30141c[_0x65aa('0x5f')]));if(_0x2fe18f['query'][_0x65aa('0x37')]){_0x58d4b0[_0x65aa('0x49')]=_[_0x65aa('0xd9')](_0x58d4b0['where'],{'$or':_[_0x65aa('0x38')](_0x58d4b0['attributes'],function(_0x370bf4){var _0x926797={};_0x926797[_0x370bf4]={'$like':'%'+_0x2fe18f['query'][_0x65aa('0x37')]+'%'};return _0x926797;})});}_0x58d4b0=_[_0x65aa('0xd9')]({},_0x58d4b0,_0x2fe18f[_0x65aa('0x63')]);return _0x1fa66d['getTeams'](_0x58d4b0);}})[_0x65aa('0x18')](function(_0x57ad94){if(_0x57ad94){_0xf08847=_0x57ad94['length'];if(!_0x2fe18f[_0x65aa('0x4a')][_0x65aa('0xda')](_0x65aa('0xdb'))){_0x58d4b0[_0x65aa('0x27')]=qs['limit'](_0x2fe18f[_0x65aa('0x4a')]['limit']);_0x58d4b0['offset']=qs[_0x65aa('0x25')](_0x2fe18f[_0x65aa('0x4a')]['offset']);}return _0x1fa66d[_0x65aa('0x10f')](_0x58d4b0);}})['then'](function(_0x573e54){if(_0x573e54){return _0x573e54?{'count':_0xf08847,'rows':_0x573e54}:null;}})[_0x65aa('0x18')](respondWithResult(_0x43edd9,null))[_0x65aa('0x22')](handleError(_0x43edd9,null));};exports['addTeams']=function(_0x5a5070,_0x4f020f){var _0x5931dc=_0x5a5070[_0x65aa('0x5b')]['id'];var _0xf898a5=_0x5a5070['body']?_0x5a5070['body'][_0x65aa('0x68')]:null;var _0x2957a2=[];return Promise['resolve']()[_0x65aa('0x18')](function(){if(!_0xf898a5)throw new APIBadRequestError(_0x65aa('0x111'));})['then'](function(){return db['User'][_0x65aa('0x99')]({'where':{'id':_0x5931dc}});})[_0x65aa('0x18')](function(_0x273eb1){if(!_0x273eb1)throw new APINotFoundError(util[_0x65aa('0xad')]('User\x20with\x20id\x20%s\x20not\x20found',_0x5a5070[_0x65aa('0x5b')]['id']));return db[_0x65aa('0x71')][_0x65aa('0x112')](function(_0x2f681d){return _0x273eb1[_0x65aa('0x113')](_0xf898a5,{'transaction':_0x2f681d})[_0x65aa('0x18')](function(){return db[_0x65aa('0x110')][_0x65aa('0x8c')]({'where':{'id':{'$in':_0xf898a5}}});})[_0x65aa('0x18')](function(_0x2df7df){var _0x591d55=_['map'](_0x2df7df,function(_0x20f11c){return _0x20f11c[_0x65aa('0x114')]();});return Promise[_0x65aa('0x59')](_0x591d55);})['then'](function(_0x3b0938){_0x2957a2=_[_0x65aa('0x115')](_0x3b0938);var _0x2f1963=_[_0x65aa('0x38')](_0x2957a2,function(_0x1ce306){return _0x1ce306[_0x65aa('0x116')](_0x273eb1['id'],{'transaction':_0x2f681d});});return Promise['all'](_0x2f1963);})[_0x65aa('0x18')](function(){if(!_0x273eb1['online'])return;var _0x1de7e1=_[_0x65aa('0x37')](_0x2957a2,function(_0x365ba2){return _0x365ba2[_0x65aa('0x117')]('channel')===_0x65aa('0x118');});var _0xeb3996=_[_0x65aa('0x38')](_0x1de7e1,function(_0x582fa5){return db[_0x65aa('0xb1')][_0x65aa('0xb2')]({'membername':_0x273eb1['name'],'UserId':_0x273eb1['id'],'queue_name':_0x582fa5['name'],'VoiceQueueId':_0x582fa5['id'],'interface':_[_0x65aa('0x6e')](_0x273eb1[_0x65aa('0xac')])?util['format']('SIP/%s',_0x273eb1[_0x65aa('0x3c')]):_0x273eb1[_0x65aa('0xac')],'paused':_0x273eb1[_0x65aa('0xaf')]||![],'penalty':_0x273eb1[_0x65aa('0xb0')]},{'transaction':_0x2f681d});});return Promise[_0x65aa('0x59')](_0xeb3996);})[_0x65aa('0x18')](function(){return db[_0x65aa('0x119')][_0x65aa('0x8c')]({'where':{'teamId':{'$in':_0xf898a5}}});})[_0x65aa('0x18')](function(_0x2aa86b){var _0x48160f=_[_0x65aa('0x38')](_0x2aa86b,function(_0x4ff471){return db[_0x65aa('0x11a')][_0x65aa('0x7f')]({'UserId':_0x273eb1['id'],'VoicePrefixId':_0x4ff471['VoicePrefixId']},{'transaction':_0x2f681d});});return Promise[_0x65aa('0x59')](_0x48160f);});});})[_0x65aa('0x18')](function(){for(var _0x280dc5=0x0;_0x280dc5<_0x2957a2[_0x65aa('0x52')];_0x280dc5++){var _0x4657f5=_0x2957a2[_0x280dc5][_0x65aa('0x117')]('channel');var _0x5af903=_0x4657f5+_0x65aa('0xb5');socket[_0x65aa('0xa9')](_0x65aa('0x34')+_0x4657f5+_0x65aa('0xaa'),{'UserId':_0x5931dc,['queueField']:_0x2957a2[_0x280dc5]['id']});}})[_0x65aa('0x18')](respondWithStatusCode(_0x4f020f,null))[_0x65aa('0x22')](APIHandleError(_0x4f020f));};exports[_0x65aa('0x11b')]=function(_0x563c12,_0x3a24ea){var _0x1e1916=_0x563c12[_0x65aa('0x5b')]['id'];var _0x128ca2=null;if(_0x563c12[_0x65aa('0x4a')][_0x65aa('0x68')]){_0x128ca2=_[_0x65aa('0xb4')](_0x563c12['query'][_0x65aa('0x68')])?_0x563c12[_0x65aa('0x4a')][_0x65aa('0x68')]:[_0x563c12[_0x65aa('0x4a')][_0x65aa('0x68')]];}var _0x2e4146=[];return Promise[_0x65aa('0x100')]()[_0x65aa('0x18')](function(){if(!_0x128ca2)throw new APIBadRequestError(_0x65aa('0x11c'));})[_0x65aa('0x18')](function(){return db['User']['findOne']({'where':{'id':_0x1e1916}});})[_0x65aa('0x18')](function(_0x4de629){if(!_0x4de629)throw new APINotFoundError(util[_0x65aa('0xad')]('User\x20with\x20id\x20%s\x20not\x20found',_0x563c12[_0x65aa('0x5b')]['id']));return db[_0x65aa('0x71')]['transaction'](function(_0x13ce93){return _0x4de629[_0x65aa('0x11b')](_0x128ca2,{'transaction':_0x13ce93})[_0x65aa('0x18')](function(){return db[_0x65aa('0x110')][_0x65aa('0x8c')]({'where':{'id':{'$in':_0x128ca2}}});})[_0x65aa('0x18')](function(_0x4d1102){var _0x4ce5a1=_[_0x65aa('0x38')](_0x4d1102,function(_0x2090b1){return _0x2090b1[_0x65aa('0x114')]();});return Promise[_0x65aa('0x59')](_0x4ce5a1);})[_0x65aa('0x18')](function(_0x2e751b){_0x2e4146=_[_0x65aa('0x115')](_0x2e751b);var _0x3d5291=_[_0x65aa('0x38')](_0x2e4146,function(_0x254b9f){return _0x254b9f[_0x65aa('0x11d')](_0x4de629['id'],{'transaction':_0x13ce93});});return Promise[_0x65aa('0x59')](_0x3d5291);})['then'](function(){if(!_0x4de629[_0x65aa('0xa1')])return;var _0x485be4=_['filter'](_0x2e4146,function(_0x50fefc){return _0x50fefc[_0x65aa('0x117')]('channel')===_0x65aa('0x118');});var _0x50663e=_[_0x65aa('0x38')](_0x485be4,function(_0x2028c3){return db[_0x65aa('0xb1')]['destroy']({'where':{'VoiceQueueId':_0x2028c3['id'],'UserId':_0x4de629['id']},'transaction':_0x13ce93});});return Promise[_0x65aa('0x59')](_0x50663e);})[_0x65aa('0x18')](function(){return db[_0x65aa('0x119')][_0x65aa('0x8c')]({'where':{'teamId':{'$in':_0x128ca2}}});})[_0x65aa('0x18')](function(_0x8f7f87){var _0x4f5a09=_[_0x65aa('0x38')](_0x8f7f87,function(_0x40f350){return db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x4de629['id'],'VoicePrefixId':_0x40f350[_0x65aa('0x11e')]}},{'transaction':_0x13ce93});});return Promise[_0x65aa('0x59')](_0x4f5a09);});});})[_0x65aa('0x18')](function(){for(var _0xa9a85f=0x0;_0xa9a85f<_0x2e4146[_0x65aa('0x52')];_0xa9a85f++){var _0x363f4e=_0x2e4146[_0xa9a85f][_0x65aa('0x117')]('channel');var _0x34f9e3=_0x363f4e+_0x65aa('0xb5');socket['emit'](_0x65aa('0x34')+_0x363f4e+_0x65aa('0xb6'),{'UserId':_0x1e1916,['queueField']:_0x2e4146[_0xa9a85f]['id']});}})['then'](respondWithStatusCode(_0x3a24ea,null))[_0x65aa('0x22')](APIHandleError(_0x3a24ea));};exports[_0x65aa('0x11f')]=function(_0x45324e,_0x2961db){var _0x16d731={};var _0x32cd71={};var _0x684f31;var _0x595a39;return db[_0x65aa('0x41')][_0x65aa('0x99')]({'where':{'id':_0x45324e[_0x65aa('0x5b')]['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x2961db,null))['then'](function(_0x17123b){if(_0x17123b){_0x684f31=_0x17123b;_0x32cd71['model']=_[_0x65aa('0x5e')](db[_0x65aa('0xd0')][_0x65aa('0x42')]);_0x32cd71[_0x65aa('0x4a')]=_[_0x65aa('0x5e')](_0x45324e['query']);_0x32cd71[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x32cd71[_0x65aa('0x5c')],_0x32cd71[_0x65aa('0x4a')]);_0x16d731['attributes']=_['intersection'](_0x32cd71['model'],qs['fields'](_0x45324e[_0x65aa('0x4a')][_0x65aa('0x61')]));_0x16d731['attributes']=_0x16d731[_0x65aa('0x4f')][_0x65aa('0x52')]?_0x16d731[_0x65aa('0x4f')]:_0x32cd71['model'];_0x16d731[_0x65aa('0xd7')]=qs[_0x65aa('0xd8')](_0x45324e[_0x65aa('0x4a')][_0x65aa('0xd8')]);_0x16d731[_0x65aa('0x49')]=qs['filters'](_[_0x65aa('0xe3')](_0x45324e[_0x65aa('0x4a')],_0x32cd71['filters']));if(_0x45324e[_0x65aa('0x4a')][_0x65aa('0x37')]){_0x16d731['where']=_['merge'](_0x16d731[_0x65aa('0x49')],{'$or':_[_0x65aa('0x38')](_0x16d731['attributes'],function(_0x2fbb99){var _0x2571e0={};_0x2571e0[_0x2fbb99]={'$like':'%'+_0x45324e['query']['filter']+'%'};return _0x2571e0;})});}_0x16d731=_[_0x65aa('0xd9')]({},_0x16d731,_0x45324e[_0x65aa('0x63')]);return _0x684f31[_0x65aa('0x11f')](_0x16d731);}})[_0x65aa('0x18')](function(_0x55b476){if(_0x55b476){_0x595a39=_0x55b476[_0x65aa('0x52')];if(!_0x45324e['query'][_0x65aa('0xda')](_0x65aa('0xdb'))){_0x16d731[_0x65aa('0x27')]=qs[_0x65aa('0x27')](_0x45324e['query'][_0x65aa('0x27')]);_0x16d731[_0x65aa('0x25')]=qs[_0x65aa('0x25')](_0x45324e['query'][_0x65aa('0x25')]);}return _0x684f31['getLists'](_0x16d731);}})[_0x65aa('0x18')](function(_0x4bbe0c){if(_0x4bbe0c){return _0x4bbe0c?{'count':_0x595a39,'rows':_0x4bbe0c}:null;}})[_0x65aa('0x18')](respondWithResult(_0x2961db,null))[_0x65aa('0x22')](handleError(_0x2961db,null));};exports[_0x65aa('0x120')]=function(_0x218df0,_0x194287){var _0x57ca92={};var _0x13f1cc={};var _0x3cbc23;return db[_0x65aa('0x41')]['findOne']({'where':{'id':_0x218df0[_0x65aa('0x5b')]['id']}})[_0x65aa('0x18')](handleEntityNotFound(_0x194287,null))['then'](function(_0x2f5bc9){if(_0x2f5bc9){_0x3cbc23=_0x2f5bc9;_0x13f1cc[_0x65aa('0x5c')]=_[_0x65aa('0x5e')](db[_0x65aa('0x41')][_0x65aa('0x42')]);_0x13f1cc[_0x65aa('0x4a')]=_[_0x65aa('0x5e')](_0x218df0[_0x65aa('0x4a')]);_0x13f1cc[_0x65aa('0x5f')]=_[_0x65aa('0x60')](_0x13f1cc['model'],_0x13f1cc[_0x65aa('0x4a')]);_0x57ca92[_0x65aa('0x4f')]=_[_0x65aa('0x60')](_0x13f1cc[_0x65aa('0x5c')],qs[_0x65aa('0x61')](_0x218df0['query'][_0x65aa('0x61')]));_0x57ca92[_0x65aa('0x4f')]=_0x57ca92[_0x65aa('0x4f')][_0x65aa('0x52')]?_0x57ca92[_0x65aa('0x4f')]:_0x13f1cc[_0x65aa('0x5c')];_0x57ca92[_0x65aa('0xd7')]=qs['sort'](_0x218df0[_0x65aa('0x4a')][_0x65aa('0xd8')]);_0x57ca92[_0x65aa('0x49')]=qs[_0x65aa('0x5f')](_[_0x65aa('0xe3')](_0x218df0['query'],_0x13f1cc[_0x65aa('0x5f')]));if(_0x218df0[_0x65aa('0x4a')][_0x65aa('0x37')]){_0x57ca92['where']=_['merge'](_0x57ca92[_0x65aa('0x49')],{'$or':_[_0x65aa('0x38')](_0x57ca92['attributes'],function(_0x239450){var _0x4a81cc={};_0x4a81cc[_0x239450]={'$like':'%'+_0x218df0[_0x65aa('0x4a')][_0x65aa('0x37')]+'%'};return _0x4a81cc;})});}_0x57ca92['model']=db[_0x65aa('0x41')];_0x57ca92['as']='Agents';_0x57ca92=_[_0x65aa('0xd9')]({},_0x57ca92,_0x218df0[_0x65aa('0x63')]);return _0x3cbc23['getVoiceQueues']({'include':[_0x57ca92]});}})[_0x65aa('0x18')](function(_0x4db10a){if(_0x4db10a){var _0x37cb23={},_0x15eb9c=[];for(var _0xf71283=0x0;_0xf71283<_0x4db10a[_0x65aa('0x52')];_0xf71283+=0x1){for(var _0x536033=0x0,_0x27fee1;_0x536033<_0x4db10a[_0xf71283][_0x65aa('0x8d')][_0x65aa('0x52')];_0x536033+=0x1){_0x27fee1=_0x4db10a[_0xf71283][_0x65aa('0x8d')][_0x536033][_0x65aa('0x31')]({'plain':!![]});_0x37cb23[_0x27fee1['id']]=_0x27fee1;}}_0x37cb23=_['values'](_0x37cb23);for(var _0x16ed5b=qs[_0x65aa('0x25')](_0x218df0[_0x65aa('0x4a')][_0x65aa('0x25')]);_0x16ed5b<_0x37cb23[_0x65aa('0x52')]&&_0x15eb9c[_0x65aa('0x52')]=_0x48721c){_0x59cebf=_0x48721c;_0x3e988d=0xc8;}else{_0x3e988d=0xce;}_0x3a4217[_0x1439('0x1e')](_0x3e988d);return _0x3a4217[_0x1439('0x22')]('Content-Range',_0x540f06+'-'+_0x59cebf+'/'+_0x48721c)[_0x1439('0x23')](_0x3eb2fa);}return null;};}function saveUpdates(_0x49d389){return function(_0x2d29d4){if(_0x2d29d4){return _0x2d29d4[_0x1439('0x24')](_0x49d389)[_0x1439('0x14')](function(_0x58f1ea){if(_0x58f1ea[_0x1439('0x25')]==='agent'){socket[_0x1439('0x26')]('userNotification:recalc:'+_0x58f1ea['id'],_0x58f1ea);}return _0x58f1ea;});}return null;};}function removeEntity(_0x595bc0){return function(_0x286fca){if(_0x286fca){return _0x286fca['destroy']()[_0x1439('0x14')](function(){var _0x4f0575=_0x286fca[_0x1439('0x27')]({'plain':!![]});if(_0x4f0575['role']===_0x1439('0x28'))return;var _0x22bece=[{'name':'Users','value':'user','ignore':!![]},{'name':_0x1439('0x29'),'value':_0x1439('0x2a'),'ignore':![]},{'name':_0x1439('0x2b'),'value':_0x1439('0x2c'),'ignore':![]}];var _0x4751a2=_(_0x22bece)[_0x1439('0x2d')](_0x1439('0x2e'))['map'](_0x1439('0x2f'))[_0x1439('0x2f')]();if(_['includes'](_0x4751a2,_0x4f0575[_0x1439('0x25')])){return;}var _0x325d9=_[_0x1439('0x30')](_0x22bece,['value',_0x4f0575[_0x1439('0x25')]])[_0x1439('0x31')];return db[_0x1439('0x32')][_0x1439('0x33')]({'where':{'type':_0x325d9,'resourceId':_0x4f0575['id']}})['then'](function(){return _0x286fca;});})['then'](function(){_0x595bc0[_0x1439('0x1e')](0xcc)[_0x1439('0x34')]();});}};}function handleEntityNotFound(_0x2cbdb2){return function(_0x27f06f){if(!_0x27f06f){_0x2cbdb2[_0x1439('0x1d')](0x194);}return _0x27f06f;};}function handleError(_0x30e2c1,_0x3860c6){_0x3860c6=_0x3860c6||0x1f4;return function(_0x13a2bb){logger['error'](_0x13a2bb[_0x1439('0x35')]);if(_0x13a2bb[_0x1439('0x31')]){delete _0x13a2bb[_0x1439('0x31')];}_0x30e2c1[_0x1439('0x1e')](_0x3860c6)['send'](_0x13a2bb);};}function getUserAttributes(){return _(db[_0x1439('0x36')][_0x1439('0x37')])[_0x1439('0x38')](function(_0x19de36){return{'name':_0x19de36[_0x1439('0x39')],'type':_0x19de36[_0x1439('0x3a')][_0x1439('0x3b')]};})[_0x1439('0x2d')](function(_0x3402b3){return![_0x1439('0x3c'),_0x1439('0x3d'),_0x1439('0x3e'),'resetPasswordToken','resetPasswordExpires','passwordResetAt',_0x1439('0x3f')][_0x1439('0x40')](_0x3402b3[_0x1439('0x31')]);})['value']();}exports[_0x1439('0x41')]=function(_0x9ac9a9,_0x2d3cdd){var _0x243013={},_0x31ecaf={'count':0x0,'rows':[]};var _0x9a63fe=getUserAttributes();_0x243013=qs[_0x1439('0x42')](_0x9a63fe,_0x9ac9a9);var _0x4fc931={'where':_0x243013[_0x1439('0x43')]};return db[_0x1439('0x36')][_0x1439('0x21')](_0x4fc931)[_0x1439('0x14')](function(_0x4f70f6){_0x31ecaf[_0x1439('0x21')]=_0x4f70f6;if(_0x9ac9a9[_0x1439('0x44')][_0x1439('0x45')]){_0x243013['include']=[{'all':!![]}];}if(_0x9ac9a9[_0x1439('0x44')][_0x1439('0x46')]===_0x1439('0x47')){_0x243013[_0x1439('0x48')]=[{'model':db[_0x1439('0x49')],'as':_0x1439('0x46')}];}if(!_[_0x1439('0x40')](_0x243013[_0x1439('0x4a')],'id')){_0x243013[_0x1439('0x4a')][_0x1439('0x4b')]('id');}return db[_0x1439('0x36')]['findAll'](_0x243013);})['then'](function(_0x573631){_0x31ecaf[_0x1439('0x4c')]=_0x573631;if(_0x9ac9a9['query'][_0x1439('0x4d')]===_0x1439('0x47')){var _0x534256=[];for(var _0x27d3a2=0x0;_0x27d3a2<_0x31ecaf[_0x1439('0x4c')][_0x1439('0x4e')];_0x27d3a2++){_0x534256['push'](get_open_tabs(_0x1439('0x4f'),_0x31ecaf[_0x1439('0x4c')][_0x27d3a2][_0x1439('0x50')]));_0x534256[_0x1439('0x4b')](get_open_tabs(_0x1439('0x51'),_0x31ecaf[_0x1439('0x4c')][_0x27d3a2]['dataValues']));_0x534256[_0x1439('0x4b')](get_open_tabs(_0x1439('0x52'),_0x31ecaf[_0x1439('0x4c')][_0x27d3a2][_0x1439('0x50')]));_0x534256['push'](get_open_tabs(_0x1439('0x53'),_0x31ecaf[_0x1439('0x4c')][_0x27d3a2][_0x1439('0x50')]));_0x534256[_0x1439('0x4b')](get_open_tabs('openchannel',_0x31ecaf[_0x1439('0x4c')][_0x27d3a2]['dataValues']));_0x534256[_0x1439('0x4b')](get_open_tabs('whatsapp',_0x31ecaf[_0x1439('0x4c')][_0x27d3a2][_0x1439('0x50')]));}return Promise[_0x1439('0x54')](_0x534256)[_0x1439('0x14')](function(){return _0x31ecaf;});}else{return _0x31ecaf;}})[_0x1439('0x14')](respondWithFilteredResult(_0x2d3cdd,_0x243013))[_0x1439('0x55')](handleError(_0x2d3cdd,null));};exports[_0x1439('0x56')]=function(_0x3e2cb8,_0x5825e1){var _0x5bf800=getUserAttributes();var _0x488a5e=qs[_0x1439('0x42')](_0x5bf800,_0x3e2cb8);if(_0x3e2cb8[_0x1439('0x44')][_0x1439('0x45')]){_0x488a5e['include']=[{'all':!![]}];}if(_0x3e2cb8['query'][_0x1439('0x46')]===_0x1439('0x47')){_0x488a5e['include']=[{'model':db[_0x1439('0x49')],'as':_0x1439('0x46')}];}_0x488a5e=_[_0x1439('0x57')]({},_0x488a5e,_0x3e2cb8[_0x1439('0x58')]);if(!_[_0x1439('0x40')](_0x488a5e['attributes'],'id')){_0x488a5e[_0x1439('0x4a')][_0x1439('0x4b')]('id');}return db[_0x1439('0x36')][_0x1439('0x30')](_0x488a5e)[_0x1439('0x14')](handleEntityNotFound(_0x5825e1,null))[_0x1439('0x14')](function(_0x1d766c){var _0x10cdce=[];values=_0x1d766c;if(_0x3e2cb8[_0x1439('0x44')][_0x1439('0x4d')]==='true'){_0x10cdce['push'](get_open_tabs('chat',_0x1d766c[_0x1439('0x50')]));_0x10cdce['push'](get_open_tabs(_0x1439('0x51'),_0x1d766c[_0x1439('0x50')]));_0x10cdce[_0x1439('0x4b')](get_open_tabs('openchannel',_0x1d766c[_0x1439('0x50')]));_0x10cdce[_0x1439('0x4b')](get_open_tabs(_0x1439('0x59'),_0x1d766c[_0x1439('0x50')]));_0x10cdce[_0x1439('0x4b')](get_open_tabs(_0x1439('0x52'),_0x1d766c[_0x1439('0x50')]));_0x10cdce[_0x1439('0x4b')](get_open_tabs('mail',_0x1d766c['dataValues']));return Promise[_0x1439('0x54')](_0x10cdce);}else{return values;}})[_0x1439('0x14')](function(){return values;})[_0x1439('0x14')](respondWithResult(_0x5825e1,null))[_0x1439('0x55')](handleError(_0x5825e1,null));};exports['update']=function(_0x302054,_0x35cf37){if(_0x302054['body']['id']){delete _0x302054[_0x1439('0x5a')]['id'];}delete _0x302054[_0x1439('0x5a')][_0x1439('0x25')];return db['User'][_0x1439('0x30')]({'where':{'id':_0x302054[_0x1439('0x5b')]['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x35cf37,null))[_0x1439('0x14')](saveUpdates(_0x302054[_0x1439('0x5a')],null))['then'](respondWithResult(_0x35cf37,null))[_0x1439('0x55')](handleError(_0x35cf37,null));};exports[_0x1439('0x5c')]=function(_0x2b0f40,_0x4d5fb0){return db[_0x1439('0x36')][_0x1439('0x5c')]()[_0x1439('0x14')](respondWithResult(_0x4d5fb0,null))[_0x1439('0x55')](handleError(_0x4d5fb0,null));};exports[_0x1439('0x5d')]=function(_0x31ce9c,_0x5c9340){return db[_0x1439('0x36')][_0x1439('0x30')]({'where':{'id':_0x31ce9c['params']['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x5c9340,null))[_0x1439('0x14')](function(_0x233c87){if(_0x233c87){return _0x233c87[_0x1439('0x5d')](_0x31ce9c[_0x1439('0x5a')][_0x1439('0x5e')],_[_0x1439('0x5f')](_0x31ce9c[_0x1439('0x5a')],[_0x1439('0x5e'),'id'])||{});}})[_0x1439('0x14')](respondWithResult(_0x5c9340,null))[_0x1439('0x55')](handleError(_0x5c9340,null));};function validateUser(_0x431ae3){return new Promise(function(_0x50061f,_0x53339d){if(_0x431ae3[_0x1439('0x60')])return _0x50061f(_0x431ae3);return db[_0x1439('0x61')][_0x1439('0x62')](0x1)[_0x1439('0x14')](function(_0x593f6f){if(_0x593f6f[_0x1439('0x63')])authService[_0x1439('0x64')](_0x431ae3['password']);db['User'][_0x1439('0x65')](_0x1439('0x60'))['then'](function(_0x3a522b){if(_[_0x1439('0x66')](_0x3a522b)){_0x431ae3['internal']=_0x593f6f['min_internal']||0x1;return;}if(_[_0x1439('0x66')](_0x593f6f[_0x1439('0x67')])||_0x593f6f[_0x1439('0x67')]===_0x3a522b){_0x431ae3['internal']=_0x3a522b+0x1;return;}if(_0x593f6f[_0x1439('0x67')]>_0x3a522b){_0x431ae3['internal']=_0x593f6f[_0x1439('0x67')];return;}return db[_0x1439('0x68')][_0x1439('0x44')](_0x1439('0x69'),{'type':db[_0x1439('0x68')][_0x1439('0x6a')]['SELECT']})[_0x1439('0x14')](function(_0x23e571){if(_0x23e571&&_0x23e571['length']){for(var _0x5d88ea=0x0,_0x2be12f=_0x23e571[_0x1439('0x4e')];_0x5d88ea<_0x2be12f&&_[_0x1439('0x66')](_0x431ae3['internal']);_0x5d88ea++){if(_0x593f6f['min_internal']<=_0x23e571[_0x5d88ea][_0x1439('0x6b')]){_0x431ae3[_0x1439('0x60')]=_0x23e571[_0x5d88ea]['from'];}else if(_0x593f6f[_0x1439('0x67')]>_0x23e571[_0x5d88ea][_0x1439('0x6b')]&&_0x593f6f['min_internal']<=_0x23e571[_0x5d88ea]['to']){_0x431ae3[_0x1439('0x60')]=_0x593f6f[_0x1439('0x67')];}}}if(_['isNil'](_0x431ae3['internal'])){_0x431ae3['internal']=_0x3a522b+0x1;}return _0x50061f(_0x431ae3);});});})[_0x1439('0x55')](function(_0xe78277){_0x53339d(_0xe78277);});});}function updateUser(_0x3ae9f2){return new Promise(function(_0x351726,_0x2ce298){try{if(_0x3ae9f2['voicemail']){_0x3ae9f2[_0x1439('0x6c')]=_0x3ae9f2[_0x1439('0x60')];_0x3ae9f2[_0x1439('0x6d')]={'mailbox':_0x3ae9f2[_0x1439('0x60')],'password':_0x3ae9f2['password'],'fullname':_0x3ae9f2[_0x1439('0x6e')],'email':_0x3ae9f2[_0x1439('0x6f')]};}if(_0x3ae9f2[_0x1439('0x25')]===_0x1439('0x2a')){if(!_0x3ae9f2['permissions'])_0x3ae9f2[_0x1439('0x70')]=['101',_0x1439('0x71'),_0x1439('0x72'),_0x1439('0x73'),'110','104',_0x1439('0x74'),'106',_0x1439('0x75'),_0x1439('0x76'),_0x1439('0x77'),_0x1439('0x78'),_0x1439('0x79'),_0x1439('0x7a'),_0x1439('0x7b')];}_0x351726(_0x3ae9f2);}catch(_0x212f6c){_0x2ce298(_0x212f6c);}});}exports[_0x1439('0x7c')]=function(_0x2fed20,_0x584db4){if(_0x2fed20['user'][_0x1439('0x25')]===_0x1439('0x2a'))throw new Error(_0x1439('0x7d'));if(_0x2fed20[_0x1439('0x5a')][_0x1439('0x25')]===_0x1439('0x7e')&&_0x2fed20['user'][_0x1439('0x25')]!==_0x1439('0x28')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x2fed20[_0x1439('0x5a')][_0x1439('0x25')]===_0x1439('0x28')&&_0x2fed20[_0x1439('0x7e')][_0x1439('0x25')]!=='admin'){throw new Error(_0x1439('0x7f'));}return licenseUtil['checkUserLimits']([_0x2fed20[_0x1439('0x5a')]])[_0x1439('0x14')](function(){return validateUser(_0x2fed20[_0x1439('0x5a')]);})[_0x1439('0x14')](function(_0x1de2db){return updateUser(_0x1de2db)[_0x1439('0x14')](function(_0x314882){if(_0x314882[_0x1439('0x25')]===_0x1439('0x28')){_0x314882[_0x1439('0x80')]=_0x2fed20[_0x1439('0x7e')][_0x1439('0x80')];delete _0x314882[_0x1439('0x81')];}return _0x314882;});})[_0x1439('0x14')](function(_0x4631f8){return db[_0x1439('0x36')][_0x1439('0x7c')](_0x4631f8,{'include':[{'model':db[_0x1439('0x6d')],'as':_0x1439('0x6d')}]});})[_0x1439('0x14')](function(_0x41efe5){if(_0x2fed20[_0x1439('0x5a')][_0x1439('0x25')]===_0x1439('0x7e'))return _0x41efe5;if(_0x2fed20[_0x1439('0x7e')]['role']!==_0x1439('0x7e'))return _0x41efe5;return db['UserProfileSection']['find']({'where':{'name':_0x41efe5[_0x1439('0x25')]===_0x1439('0x2a')?'Agents':_0x1439('0x2b'),'userProfileId':_0x2fed20[_0x1439('0x7e')][_0x1439('0x81')]},'raw':!![]})[_0x1439('0x14')](function(_0x1cc431){if(!_0x1cc431||_0x1cc431[_0x1439('0x82')]!=0x0)return _0x41efe5;return db['UserProfileResource'][_0x1439('0x7c')]({'name':_0x41efe5[_0x1439('0x31')],'resourceId':_0x41efe5['id'],'type':_0x1cc431[_0x1439('0x31')],'sectionId':_0x1cc431['id']},{})[_0x1439('0x14')](function(){return _0x41efe5;});})['catch'](function(_0x1602a7){logger[_0x1439('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1602a7);throw _0x1602a7;});})[_0x1439('0x14')](respondWithResult(_0x584db4,0xc9))[_0x1439('0x55')](handleError(_0x584db4,null));};exports[_0x1439('0x83')]=function(_0x273cd4,_0xef9456){var _0x5a3d73=_0x273cd4['body'];var _0x43d690=[];if(_0x273cd4[_0x1439('0x7e')][_0x1439('0x25')]===_0x1439('0x2a'))throw new Error('Unauthorized');if(_['some'](_0x5a3d73,[_0x1439('0x25'),_0x1439('0x7e')])&&_0x273cd4[_0x1439('0x7e')][_0x1439('0x25')]!==_0x1439('0x28')){throw new Error(_0x1439('0x84'));}if(_[_0x1439('0x85')](_0x5a3d73,[_0x1439('0x25'),_0x1439('0x28')])&&_0x273cd4[_0x1439('0x7e')][_0x1439('0x25')]!=='admin'){throw new Error(_0x1439('0x86'));}return licenseUtil[_0x1439('0x87')](_0x5a3d73)[_0x1439('0x14')](function(){return validateUser(_0x5a3d73[0x0]);})[_0x1439('0x14')](function(){for(var _0x1e4dc4=0x1;_0x1e4dc4<_0x5a3d73[_0x1439('0x4e')];_0x1e4dc4++){var _0x2e066a=_0x5a3d73[_0x1e4dc4-0x1][_0x1439('0x60')];if(!_0x5a3d73[_0x1e4dc4]['internal'])_0x5a3d73[_0x1e4dc4][_0x1439('0x60')]=_0x2e066a+0x1;_0x43d690['push'](validateUser(_0x5a3d73[_0x1e4dc4]));}return Promise['all'](_0x43d690);})['then'](function(){_0x43d690=[];for(var _0x4f1069=0x0;_0x4f1069<_0x5a3d73[_0x1439('0x4e')];_0x4f1069++){_0x43d690['push'](updateUser(_0x5a3d73[_0x4f1069]));}return Promise[_0x1439('0x54')](_0x43d690);})['then'](function(){_0x43d690=_0x5a3d73['map'](function(_0x568416){return db[_0x1439('0x36')][_0x1439('0x7c')](_0x568416,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]})[_0x1439('0x14')](function(_0x2b8611){_0x568416['id']=_0x2b8611['id'];return _0x568416;});});return Promise[_0x1439('0x54')](_0x43d690);})[_0x1439('0x14')](function(_0x45c662){if(_0x273cd4[_0x1439('0x5a')][_0x1439('0x25')]===_0x1439('0x7e'))return _0x45c662;if(_0x273cd4[_0x1439('0x7e')][_0x1439('0x25')]!==_0x1439('0x7e'))return _0x45c662;var _0x6ce3c5=_['some'](_0x45c662,function(_0x2e0db3){return _0x2e0db3[_0x1439('0x25')]===_0x1439('0x2a')||_0x2e0db3[_0x1439('0x25')]===_0x1439('0x2c');});if(!_0x6ce3c5)return _0x45c662;return db[_0x1439('0x88')][_0x1439('0x89')]({'where':{'name':{'$or':[_0x1439('0x29'),_0x1439('0x2b')]},'userProfileId':_0x273cd4[_0x1439('0x7e')][_0x1439('0x81')]},'raw':!![]})['then'](function(_0x34b9ee){if(_[_0x1439('0x8a')](_0x34b9ee)||!_[_0x1439('0x85')](_0x34b9ee,[_0x1439('0x82'),0x0]))return _0x45c662;_0x43d690=[];var _0x4d139f=_(_0x34b9ee)[_0x1439('0x38')](function(_0x239869){if(_0x239869['autoAssociation']===0x1)return;return _0x239869[_0x1439('0x31')]===_0x1439('0x29')?_0x1439('0x2a'):'telephone';})[_0x1439('0x8b')]()['value']();for(var _0x4960f1=0x0;_0x4960f1<_0x45c662[_0x1439('0x4e')];_0x4960f1++){if(!_[_0x1439('0x40')](_0x4d139f,_0x45c662[_0x4960f1][_0x1439('0x25')]))return;var _0x17883e=_0x45c662[_0x4960f1]['role']===_0x1439('0x2a')?_0x1439('0x29'):'Telephones';_0x43d690[_0x1439('0x4b')](db['UserProfileResource'][_0x1439('0x7c')]({'name':_0x45c662[_0x4960f1]['name'],'resourceId':_0x45c662[_0x4960f1]['id'],'type':_0x17883e,'sectionId':_[_0x1439('0x30')](_0x34b9ee,['name',_0x17883e])['id']},{}));}return Promise[_0x1439('0x54')](_0x43d690);});})[_0x1439('0x14')](respondWithResult(_0xef9456,0xc9))['catch'](handleError(_0xef9456,null));};exports[_0x1439('0x8c')]=function(_0xe6c2a9,_0x375dda){if(_0xe6c2a9['body']['id']){delete _0xe6c2a9[_0x1439('0x5a')]['id'];}return db['User']['find']({'where':{'id':_0xe6c2a9['params']['id']}})[_0x1439('0x14')](function(_0x77774){if(!_0x77774)return null;if(_0x77774['id']===_0xe6c2a9[_0x1439('0x7e')]['id']){if(!_0xe6c2a9[_0x1439('0x5a')][_0x1439('0x8d')]||!_0xe6c2a9[_0x1439('0x5a')]['newPassword']){throw new db[(_0x1439('0x8e'))][(_0x1439('0x8f'))](_0x1439('0x90'));}if(!_0x77774[_0x1439('0x91')](_0xe6c2a9[_0x1439('0x5a')][_0x1439('0x8d')])){throw new db['Sequelize'][(_0x1439('0x8f'))](_0x1439('0x92'));}if(_0xe6c2a9[_0x1439('0x5a')]['oldPassword']===_0xe6c2a9['body'][_0x1439('0x93')]){throw new db['Sequelize'][(_0x1439('0x8f'))](_0x1439('0x94'));}}else if(_0xe6c2a9[_0x1439('0x7e')][_0x1439('0x25')]===_0x1439('0x28')){if(!_0xe6c2a9[_0x1439('0x5a')][_0x1439('0x93')]){throw new db[(_0x1439('0x8e'))][(_0x1439('0x8f'))](_0x1439('0x95'));}}else if(_0xe6c2a9['user']['role']===_0x1439('0x7e')){if(!_0xe6c2a9['body']['newPassword']){throw new db[(_0x1439('0x8e'))][(_0x1439('0x8f'))](_0x1439('0x95'));}if(_0x77774['role']!==_0x1439('0x2a')){throw new db[(_0x1439('0x8e'))][(_0x1439('0x8f'))](_0x1439('0x7d'));}}else{throw new db[(_0x1439('0x8e'))][(_0x1439('0x8f'))](_0x1439('0x7d'));}return _0x77774;})[_0x1439('0x14')](handleEntityNotFound(_0x375dda,null))[_0x1439('0x14')](function(_0xdfe961){return db[_0x1439('0x61')][_0x1439('0x96')]({'attributes':['id','securePassword',_0x1439('0x97'),_0x1439('0x98')]})['then'](function(_0xf607d1){if(_0xf607d1['securePassword'])authService[_0x1439('0x64')](_0xe6c2a9['body'][_0x1439('0x93')]);if(!_0xf607d1['enforcePasswordHistory']||!_0xdfe961[_0x1439('0x3e')])return _0xdfe961;authService['validatePasswordHistory'](_0xe6c2a9['body'][_0x1439('0x93')],_0xdfe961['previousPasswords'],_0xf607d1[_0x1439('0x98')]);return _0xdfe961;})['then'](saveUpdates({'password':_0xe6c2a9[_0x1439('0x5a')][_0x1439('0x93')],'passwordResetAt':_0xe6c2a9['user']['id']==_0xe6c2a9[_0x1439('0x5b')]['id']?moment():null,'previousPasswords':authService[_0x1439('0x99')](_0xe6c2a9[_0x1439('0x5a')]['newPassword'],_0xdfe961['previousPasswords'])},null));})[_0x1439('0x14')](respondWithResult(_0x375dda,null))[_0x1439('0x55')](handleError(_0x375dda,null));};exports[_0x1439('0x9a')]=function(_0x139508,_0x596df){var _0x253866=_0x139508[_0x1439('0x5a')][_0x1439('0x9b')];return db[_0x1439('0x36')][_0x1439('0x30')]({'where':{'id':_0x139508['params']['id']},'attributes':['id',_0x1439('0x31'),_0x1439('0x25'),_0x1439('0x9c'),_0x1439('0x9d'),_0x1439('0x9e'),_0x1439('0x9f')]})[_0x1439('0x14')](handleEntityNotFound(_0x596df,null))[_0x1439('0x14')](function(_0x212526){if(_0x212526){if(!utils[_0x1439('0xa0')](_0x253866)){throw new db[(_0x1439('0x8e'))][(_0x1439('0x8f'))](_0x1439('0xa1'));}return _0x212526['add'+_['capitalize'](_0x253866['toLowerCase']())+_0x1439('0xa2')](_0x139508['body']['ids'],{'penalty':_0x139508['body'][_0x1439('0xa3')]||0x0})[_0x1439('0xa4')](function(_0x5d4a6d){for(var _0x191343=0x0;_0x191343<_0x139508['body'][_0x1439('0x5e')][_0x1439('0x4e')];_0x191343+=0x1){var _0x23d4cc={'UserId':Number(_0x139508['params']['id'])};_0x23d4cc[_[_0x1439('0xa5')](_0x253866[_0x1439('0xa6')]())+_0x1439('0xa7')]=Number(_0x139508['body'][_0x1439('0x5e')][_0x191343]);socket['emit'](_0x1439('0x7e')+_[_0x1439('0xa5')](_0x253866['toLowerCase']())+_0x1439('0xa8'),_0x23d4cc);}return _0x5d4a6d;})[_0x1439('0x14')](function(){if(_0x253866===_0x1439('0xa9')){return db[_0x1439('0xaa')][_0x1439('0x89')]({'where':{'id':_0x139508['body'][_0x1439('0x5e')]||[]},'raw':!![],'attributes':['id',_0x1439('0x31')]});}})['then'](function(_0x2f24f2){var _0x387f3a=_0x212526[_0x1439('0x27')]({'plain':!![]});var _0x476a95=[];if(_0x253866===_0x1439('0xa9')&&_0x387f3a[_0x1439('0x25')]===_0x1439('0x2a')&&_0x387f3a[_0x1439('0x9c')]){for(let _0x4d8424=0x0;_0x4d8424<_0x2f24f2[_0x1439('0x4e')];_0x4d8424+=0x1){_0x476a95[_0x1439('0x4b')]({'membername':_0x387f3a[_0x1439('0x31')],'UserId':_0x387f3a['id'],'queue_name':_0x2f24f2[_0x4d8424][_0x1439('0x31')],'VoiceQueueId':_0x2f24f2[_0x4d8424]['id'],'interface':_[_0x1439('0x66')](_0x387f3a['interface'])?util[_0x1439('0xab')](_0x1439('0xac'),_0x387f3a[_0x1439('0x31')]):_0x387f3a[_0x1439('0x9f')],'paused':_0x387f3a[_0x1439('0x9e')]||![],'penalty':_0x139508['body'][_0x1439('0xa3')]||0x0});}return Promise[_0x1439('0x54')](_0x476a95['map'](function(_0x1ec064){return db[_0x1439('0xad')][_0x1439('0xae')](_0x1ec064);}));}return _0x212526;});}})[_0x1439('0x14')](respondWithStatusCode(_0x596df,null))[_0x1439('0x55')](handleError(_0x596df,null));};exports[_0x1439('0xaf')]=function(_0xce1775,_0x16e904){var _0x176032,_0x51e72a;return db['User'][_0x1439('0x30')]({'where':{'id':_0xce1775[_0x1439('0x5b')]['id']},'attributes':['id',_0x1439('0x31'),'role']})[_0x1439('0x14')](handleEntityNotFound(_0x16e904,null))[_0x1439('0x14')](function(_0x5230f6){if(_0x5230f6){_0x176032=_0x5230f6;if(!_0xce1775['query'][_0x1439('0x9b')]||!utils[_0x1439('0xa0')](_0xce1775[_0x1439('0x44')]['channel'])){throw new db[(_0x1439('0x8e'))][(_0x1439('0x8f'))](_0x1439('0xa1'));}return _0x5230f6[_0x1439('0xb0')+_[_0x1439('0xa5')](_0xce1775[_0x1439('0x44')][_0x1439('0x9b')][_0x1439('0xa6')]())+_0x1439('0xa2')](_0xce1775[_0x1439('0x44')][_0x1439('0x5e')]);}})[_0x1439('0x14')](function(_0xf58459){if(_['isArray'](_0xce1775[_0x1439('0x44')][_0x1439('0x5e')])){for(var _0x2f2909=0x0;_0x2f2909<_0xce1775[_0x1439('0x44')][_0x1439('0x5e')]['length'];_0x2f2909+=0x1){_0x51e72a={'UserId':Number(_0xce1775[_0x1439('0x5b')]['id'])};_0x51e72a[_['capitalize'](_0xce1775[_0x1439('0x44')][_0x1439('0x9b')][_0x1439('0xa6')]())+_0x1439('0xa7')]=Number(_0xce1775[_0x1439('0x44')][_0x1439('0x5e')][_0x2f2909]);socket[_0x1439('0x26')](_0x1439('0x7e')+_[_0x1439('0xa5')](_0xce1775[_0x1439('0x44')][_0x1439('0x9b')][_0x1439('0xa6')]())+_0x1439('0xb1'),_0x51e72a);}}else{_0x51e72a={'UserId':Number(_0xce1775['params']['id'])};_0x51e72a[_[_0x1439('0xa5')](_0xce1775[_0x1439('0x44')]['channel'][_0x1439('0xa6')]())+_0x1439('0xa7')]=Number(_0xce1775[_0x1439('0x44')][_0x1439('0x5e')]);socket[_0x1439('0x26')](_0x1439('0x7e')+_['capitalize'](_0xce1775[_0x1439('0x44')][_0x1439('0x9b')]['toLowerCase']())+_0x1439('0xb1'),_0x51e72a);}return _0xf58459;})[_0x1439('0x14')](function(){if(_0xce1775['query']['channel']==='voice'){return db[_0x1439('0xad')][_0x1439('0x33')]({'where':{'UserId':_0xce1775['params']['id'],'VoiceQueueId':_0xce1775['query'][_0x1439('0x5e')]},'individualHooks':!![]})[_0x1439('0x14')](function(){return _0x176032;});}return _0x176032;})[_0x1439('0x14')](respondWithStatusCode(_0x16e904,null))[_0x1439('0x55')](handleError(_0x16e904,null));};exports[_0x1439('0xb2')]=function(_0xcd2f8,_0x20a036){_0xcd2f8[_0x1439('0x5a')][_0x1439('0xb3')]=_0xcd2f8[_0x1439('0xb4')][_0x1439('0xb5')];return db[_0x1439('0x36')][_0x1439('0x30')]({'where':{'id':_0xcd2f8[_0x1439('0x5b')]['id']}})['then'](handleEntityNotFound(_0x20a036,null))[_0x1439('0x14')](saveUpdates(_0xcd2f8['body'],null))[_0x1439('0x14')](respondWithResult(_0x20a036,null))[_0x1439('0x55')](handleError(_0x20a036,null));};exports[_0x1439('0xb6')]=function(_0x2b0ef9,_0xbcbc9f){var _0x7dc8af=path[_0x1439('0xb7')](config[_0x1439('0xb8')],_0x1439('0xb9'));return db[_0x1439('0x36')][_0x1439('0x30')]({'where':{'id':_0x2b0ef9[_0x1439('0x5b')]['id']},'attributes':['id',_0x1439('0xb3')],'raw':!![]})[_0x1439('0x14')](handleEntityNotFound(_0xbcbc9f,null))[_0x1439('0x14')](function(_0x22eac8){if(_0x22eac8){if(_[_0x1439('0x66')](_0x22eac8[_0x1439('0xb3')])){return _0xbcbc9f[_0x1439('0xba')](_0x7dc8af);}else{if(!fs['existsSync'](path[_0x1439('0xb7')](config[_0x1439('0xb8')],_0x1439('0xbb'),_0x22eac8[_0x1439('0xb3')]))){return _0xbcbc9f[_0x1439('0xba')](_0x7dc8af);}return _0xbcbc9f[_0x1439('0xba')](path[_0x1439('0xb7')](config[_0x1439('0xb8')],_0x1439('0xbb'),_0x22eac8[_0x1439('0xb3')]));}}})[_0x1439('0x55')](handleError(_0xbcbc9f,null));};exports[_0x1439('0xbc')]=function(_0x377637,_0x130bc3){return db[_0x1439('0x36')][_0x1439('0x30')]({'where':{'id':_0x377637[_0x1439('0x5b')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x130bc3,null))[_0x1439('0x14')](function(_0x22b0c5){var _0x1c0923=[];values=_0x22b0c5[_0x1439('0x50')];_0x1c0923[_0x1439('0x4b')](get_open_tabs(_0x1439('0x4f'),_0x22b0c5['dataValues']));_0x1c0923[_0x1439('0x4b')](get_open_tabs(_0x1439('0x51'),_0x22b0c5[_0x1439('0x50')]));_0x1c0923[_0x1439('0x4b')](get_open_tabs(_0x1439('0xbd'),_0x22b0c5[_0x1439('0x50')]));_0x1c0923[_0x1439('0x4b')](get_open_tabs('whatsapp',_0x22b0c5[_0x1439('0x50')]));_0x1c0923[_0x1439('0x4b')](get_open_tabs(_0x1439('0x52'),_0x22b0c5[_0x1439('0x50')]));_0x1c0923[_0x1439('0x4b')](get_open_tabs(_0x1439('0x53'),_0x22b0c5[_0x1439('0x50')]));return Promise[_0x1439('0x54')](_0x1c0923);})[_0x1439('0x14')](function(_0xbd60d9){if(_0xbd60d9){var _0x43e930=_['map'](values[_0x1439('0xbe')],function(_0x215b99){return{'channel':'CHAT','id':_0x215b99['id'],'createdAt':_0x215b99[_0x1439('0xbf')]};});var _0x48cc67=_['map'](values[_0x1439('0xc0')],function(_0x2c3a7c){return{'channel':'FAX','id':_0x2c3a7c['id'],'createdAt':_0x2c3a7c[_0x1439('0xbf')]};});var _0x5d4e49=_['map'](values[_0x1439('0xc1')],function(_0x22ab51){return{'channel':'OPENCHANNEL','id':_0x22ab51['id'],'createdAt':_0x22ab51[_0x1439('0xbf')]};});var _0x3f8bea=_[_0x1439('0x38')](values['MailOpenTabs'],function(_0x33de10){return{'channel':'MAIL','id':_0x33de10['id'],'createdAt':_0x33de10['createdAt']};});var _0x15081d=_[_0x1439('0x38')](values[_0x1439('0xc2')],function(_0x26ed87){return{'channel':_0x1439('0xc3'),'id':_0x26ed87['id'],'createdAt':_0x26ed87['createdAt']};});var _0xb1952c=_['map'](values[_0x1439('0xc4')],function(_0x419ba8){return{'channel':_0x1439('0xc5'),'id':_0x419ba8['id'],'createdAt':_0x419ba8['createdAt']};});var _0x2270ed=_[_0x1439('0xc6')](_0x43e930,_0x48cc67,_0x5d4e49,_0x3f8bea,_0x15081d,_0xb1952c);var _0x18271d={'count':_0x2270ed['length'],'rows':_0x2270ed};return _0x18271d;}else return null;})[_0x1439('0x14')](respondWithResult(_0x130bc3,null))['catch'](handleError(_0x130bc3,null));};exports[_0x1439('0xc7')]=function(_0x5715b2,_0x55a794){var _0x29a838={};return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x5715b2[_0x1439('0x5b')]['id']}})['then'](function(_0xd57792){if(!_0xd57792){throw new APINotFoundError(util[_0x1439('0xab')](_0x1439('0xc8'),_0x5715b2[_0x1439('0x5b')]['id']));}return contacts[_0x1439('0x5c')]();})['then'](function(_0x1128dd){_0x5715b2[_0x1439('0x44')][_0x1439('0x36')]=_0x5715b2[_0x1439('0x5b')]['id'];_0x29a838=qs[_0x1439('0x42')](_0x1128dd,_0x5715b2);if(_0x5715b2[_0x1439('0x44')][_0x1439('0xc9')]('includeAll')){_0x29a838['include']=[{'model':db[_0x1439('0xca')],'as':_0x1439('0xcb'),'required':![]},{'model':db[_0x1439('0xcc')],'as':_0x1439('0xcd'),'attributes':['id',_0x1439('0x31'),_0x1439('0xce')],'where':_0x5715b2[_0x1439('0x44')]['tag']?{'id':_0x5715b2[_0x1439('0x44')]['tag']}:undefined,'required':_0x5715b2[_0x1439('0x44')]['tag']?!![]:![]}];}return contacts[_0x1439('0x89')](_0x5715b2[_0x1439('0x44')],_0x5715b2[_0x1439('0x7e')],_0x29a838,_0x1128dd);})[_0x1439('0x14')](respondWithFilteredResult(_0x55a794,_0x29a838))['catch'](APIHandleError(_0x55a794));};exports[_0x1439('0xcf')]=function(_0x30a784,_0xbbceb9){var _0x500370;var _0x577acb={};var _0x569034;return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x30a784[_0x1439('0x5b')]['id']},'attributes':['id',_0x1439('0x31'),_0x1439('0x25')]})[_0x1439('0x14')](handleEntityNotFound(_0xbbceb9,null))['then'](function(_0x499a08){if(!utils[_0x1439('0xa0')](_0x30a784[_0x1439('0x44')][_0x1439('0x9b')])){throw new db[(_0x1439('0x8e'))][(_0x1439('0x8f'))](_0x1439('0xa1'));}_0x500370=_0x499a08;var _0x4332dc={};_0x4332dc[_0x1439('0xd0')]=_[_0x1439('0xd1')](db[_[_0x1439('0xa5')](_0x30a784['query']['channel'])+_0x1439('0xd2')][_0x1439('0x37')]);_0x4332dc['query']=_[_0x1439('0xd1')](_0x30a784[_0x1439('0x44')]);_0x4332dc[_0x1439('0xd3')]=_[_0x1439('0xd4')](_0x4332dc[_0x1439('0xd0')],_0x4332dc[_0x1439('0x44')]);_0x577acb[_0x1439('0x4a')]=_['intersection'](_0x4332dc[_0x1439('0xd0')],qs[_0x1439('0xd5')](_0x30a784[_0x1439('0x44')]['fields']));_0x577acb['attributes']=_0x577acb[_0x1439('0x4a')]['length']?_0x577acb[_0x1439('0x4a')]:_0x4332dc[_0x1439('0xd0')];_0x577acb[_0x1439('0xd6')]=qs[_0x1439('0xd7')](_0x30a784[_0x1439('0x44')][_0x1439('0xd7')]);_0x577acb[_0x1439('0x43')]=qs[_0x1439('0xd3')](_[_0x1439('0xd8')](_0x30a784[_0x1439('0x44')],_0x4332dc[_0x1439('0xd3')]));if(_0x30a784['query']['filter']){_0x577acb[_0x1439('0x43')]=_['merge'](_0x577acb['where'],{'$or':_[_0x1439('0x38')](_0x577acb[_0x1439('0x4a')],function(_0x119dc3){var _0x1c971b={};_0x1c971b[_0x119dc3]={'$like':'%'+_0x30a784['query'][_0x1439('0x2d')]+'%'};return _0x1c971b;})});}_0x577acb=_[_0x1439('0x57')]({},_0x577acb,_0x30a784[_0x1439('0x58')]);switch(_0x500370[_0x1439('0x25')]){case'admin':return db[_[_0x1439('0xa5')](_0x30a784[_0x1439('0x44')][_0x1439('0x9b')])+_0x1439('0xd2')][_0x1439('0x89')](_0x577acb);case _0x1439('0x7e'):case _0x1439('0x2a'):return _0x500370[_0x1439('0x27')+_['capitalize'](_0x30a784[_0x1439('0x44')][_0x1439('0x9b')])+_0x1439('0xa2')](_0x577acb);default:throw new db[(_0x1439('0x8e'))][(_0x1439('0x8f'))](_0x1439('0xd9'));}})[_0x1439('0x14')](function(_0x149f61){_0x569034=_0x149f61[_0x1439('0x4e')];if(!_0x30a784[_0x1439('0x44')][_0x1439('0xc9')]('nolimit')){_0x577acb[_0x1439('0xda')]=qs[_0x1439('0xda')](_0x30a784[_0x1439('0x44')][_0x1439('0xda')]);_0x577acb[_0x1439('0x1f')]=qs[_0x1439('0x1f')](_0x30a784[_0x1439('0x44')][_0x1439('0x1f')]);}switch(_0x500370[_0x1439('0x25')]){case _0x1439('0x28'):return db[_[_0x1439('0xa5')](_0x30a784[_0x1439('0x44')][_0x1439('0x9b')])+'Queue'][_0x1439('0x89')](_0x577acb);case'user':case _0x1439('0x2a'):return _0x500370[_0x1439('0x27')+_[_0x1439('0xa5')](_0x30a784[_0x1439('0x44')][_0x1439('0x9b')])+_0x1439('0xa2')](_0x577acb);}})[_0x1439('0x14')](function(_0x2323e0){return{'count':_0x569034,'rows':_0x2323e0};})[_0x1439('0x14')](respondWithResult(_0xbbceb9,null))[_0x1439('0x55')](handleError(_0xbbceb9,null));};exports['getVoiceQueuesRt']=function(_0x54d0bb,_0x4a6fcc){var _0x144d63={};var _0x6dd316={};var _0x16f50d;var _0x273954;return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x54d0bb['params']['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x4a6fcc,null))[_0x1439('0x14')](function(_0x5ba89e){if(_0x5ba89e){_0x16f50d=_0x5ba89e;_0x6dd316[_0x1439('0xd0')]=_[_0x1439('0xd1')](db[_0x1439('0xad')][_0x1439('0x37')]);_0x6dd316[_0x1439('0x44')]=_['keys'](_0x54d0bb[_0x1439('0x44')]);_0x6dd316[_0x1439('0xd3')]=_[_0x1439('0xd4')](_0x6dd316[_0x1439('0xd0')],_0x6dd316[_0x1439('0x44')]);_0x144d63[_0x1439('0x4a')]=_[_0x1439('0xd4')](_0x6dd316[_0x1439('0xd0')],qs['fields'](_0x54d0bb[_0x1439('0x44')][_0x1439('0xd5')]));_0x144d63['attributes']=_0x144d63[_0x1439('0x4a')]['length']?_0x144d63[_0x1439('0x4a')]:_0x6dd316[_0x1439('0xd0')];_0x144d63[_0x1439('0xd6')]=qs['sort'](_0x54d0bb['query'][_0x1439('0xd7')]);_0x144d63[_0x1439('0x43')]=qs['filters'](_[_0x1439('0xd8')](_0x54d0bb['query'],_0x6dd316[_0x1439('0xd3')]));if(_0x54d0bb[_0x1439('0x44')]['filter']){_0x144d63['where']=_[_0x1439('0x57')](_0x144d63['where'],{'$or':_[_0x1439('0x38')](_0x144d63[_0x1439('0x4a')],function(_0x4a1a0c){var _0x450bc2={};_0x450bc2[_0x4a1a0c]={'$like':'%'+_0x54d0bb[_0x1439('0x44')][_0x1439('0x2d')]+'%'};return _0x450bc2;})});}_0x144d63=_[_0x1439('0x57')]({},_0x144d63,_0x54d0bb[_0x1439('0x58')]);return _0x16f50d[_0x1439('0xdb')](_0x144d63);}})[_0x1439('0x14')](function(_0xa28e52){if(_0xa28e52){_0x273954=_0xa28e52[_0x1439('0x4e')];if(!_0x54d0bb['query'][_0x1439('0xc9')](_0x1439('0xdc'))){_0x144d63[_0x1439('0xda')]=qs[_0x1439('0xda')](_0x54d0bb[_0x1439('0x44')][_0x1439('0xda')]);_0x144d63[_0x1439('0x1f')]=qs[_0x1439('0x1f')](_0x54d0bb[_0x1439('0x44')]['offset']);}return _0x16f50d[_0x1439('0xdb')](_0x144d63);}})[_0x1439('0x14')](function(_0x14f5b4){if(_0x14f5b4){return _0x14f5b4?{'count':_0x273954,'rows':_0x14f5b4}:null;}})[_0x1439('0x14')](respondWithResult(_0x4a6fcc,null))[_0x1439('0x55')](handleError(_0x4a6fcc,null));};exports[_0x1439('0xdd')]=function(_0x445710,_0x4c5b90){var _0xbcacbc={};var _0x29d738={};var _0x1f91ca;var _0x4f6e2b;return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x445710[_0x1439('0x5b')]['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x4c5b90,null))[_0x1439('0x14')](function(_0x375244){if(_0x375244){_0x1f91ca=_0x375244;_0x29d738[_0x1439('0xd0')]=_['keys'](db['ChatGroup'][_0x1439('0x37')]);_0x29d738['query']=_[_0x1439('0xd1')](_0x445710[_0x1439('0x44')]);_0x29d738['filters']=_['intersection'](_0x29d738[_0x1439('0xd0')],_0x29d738[_0x1439('0x44')]);_0xbcacbc['attributes']=_[_0x1439('0xd4')](_0x29d738[_0x1439('0xd0')],qs[_0x1439('0xd5')](_0x445710[_0x1439('0x44')]['fields']));_0xbcacbc[_0x1439('0x4a')]=_0xbcacbc[_0x1439('0x4a')][_0x1439('0x4e')]?_0xbcacbc[_0x1439('0x4a')]:_0x29d738[_0x1439('0xd0')];_0xbcacbc['order']=qs[_0x1439('0xd7')](_0x445710[_0x1439('0x44')][_0x1439('0xd7')]);_0xbcacbc[_0x1439('0x43')]=qs[_0x1439('0xd3')](_[_0x1439('0xd8')](_0x445710['query'],_0x29d738['filters']));if(_0x445710[_0x1439('0x44')]['filter']){_0xbcacbc['where']=_[_0x1439('0x57')](_0xbcacbc[_0x1439('0x43')],{'$or':_[_0x1439('0x38')](_0xbcacbc[_0x1439('0x4a')],function(_0xb73283){var _0x3c8178={};_0x3c8178[_0xb73283]={'$like':'%'+_0x445710[_0x1439('0x44')][_0x1439('0x2d')]+'%'};return _0x3c8178;})});}_0xbcacbc=_[_0x1439('0x57')]({},_0xbcacbc,_0x445710[_0x1439('0x58')]);return _0x1f91ca[_0x1439('0xdd')](_0xbcacbc);}})[_0x1439('0x14')](function(_0x5a81cb){if(_0x5a81cb){_0x4f6e2b=_0x5a81cb[_0x1439('0x4e')];if(!_0x445710[_0x1439('0x44')]['hasOwnProperty']('nolimit')){_0xbcacbc[_0x1439('0xda')]=qs['limit'](_0x445710['query']['limit']);_0xbcacbc[_0x1439('0x1f')]=qs[_0x1439('0x1f')](_0x445710[_0x1439('0x44')][_0x1439('0x1f')]);}return _0x1f91ca['getGroups'](_0xbcacbc);}})[_0x1439('0x14')](function(_0x4058d2){if(_0x4058d2){return _0x4058d2?{'count':_0x4f6e2b,'rows':_0x4058d2}:null;}})[_0x1439('0x14')](respondWithResult(_0x4c5b90,null))[_0x1439('0x55')](handleError(_0x4c5b90,null));};exports[_0x1439('0xde')]=function(_0x51f1e1,_0x44f8dc){var _0x5c8c0f={'raw':!![],'where':{}};var _0x26c5a6={};var _0x3e1b76={'count':0x0,'rows':[]};return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x51f1e1[_0x1439('0x5b')]['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x44f8dc,null))[_0x1439('0x14')](function(_0x5ecc8f){if(_0x5ecc8f){_0x26c5a6['model']=_[_0x1439('0xd1')](db[_0x1439('0xdf')][_0x1439('0x37')]);_0x26c5a6['query']=_[_0x1439('0xd1')](_0x51f1e1['query']);_0x26c5a6[_0x1439('0xd3')]=_['intersection'](_0x26c5a6['model'],_0x26c5a6[_0x1439('0x44')]);_0x5c8c0f[_0x1439('0x4a')]=_[_0x1439('0xd4')](_0x26c5a6[_0x1439('0xd0')],qs[_0x1439('0xd5')](_0x51f1e1[_0x1439('0x44')][_0x1439('0xd5')]));_0x5c8c0f[_0x1439('0x4a')]=_0x5c8c0f[_0x1439('0x4a')][_0x1439('0x4e')]?_0x5c8c0f[_0x1439('0x4a')]:_0x26c5a6[_0x1439('0xd0')];if(!_0x51f1e1[_0x1439('0x44')][_0x1439('0xc9')](_0x1439('0xdc'))){_0x5c8c0f[_0x1439('0xda')]=qs[_0x1439('0xda')](_0x51f1e1[_0x1439('0x44')][_0x1439('0xda')]);_0x5c8c0f['offset']=qs['offset'](_0x51f1e1[_0x1439('0x44')]['offset']);}_0x5c8c0f[_0x1439('0xd6')]=qs[_0x1439('0xd7')](_0x51f1e1['query'][_0x1439('0xd7')]);_0x5c8c0f[_0x1439('0x43')]=qs['filters'](_['pick'](_0x51f1e1['query'],_0x26c5a6['filters']));_0x5c8c0f['where'][_0x1439('0xe0')]=_0x5ecc8f['id'];if(_0x51f1e1[_0x1439('0x44')][_0x1439('0x2d')]){_0x5c8c0f['where']=_[_0x1439('0x57')](_0x5c8c0f['where'],{'$or':_[_0x1439('0x38')](_0x5c8c0f[_0x1439('0x4a')],function(_0x15b355){var _0x35d6a4={};_0x35d6a4[_0x15b355]={'$like':'%'+_0x51f1e1[_0x1439('0x44')][_0x1439('0x2d')]+'%'};return _0x35d6a4;})});}_0x5c8c0f=_['merge']({},_0x5c8c0f,_0x51f1e1['options']);return db[_0x1439('0xdf')][_0x1439('0x21')]({'where':_0x5c8c0f[_0x1439('0x43')]})[_0x1439('0x14')](function(_0xb27926){_0x3e1b76[_0x1439('0x21')]=_0xb27926;if(_0x51f1e1['query'][_0x1439('0x45')]){_0x5c8c0f['include']=[{'all':!![]}];}return db[_0x1439('0xdf')]['findAll'](_0x5c8c0f);})[_0x1439('0x14')](function(_0x1081ad){_0x3e1b76[_0x1439('0x4c')]=_0x1081ad;return _0x3e1b76;});}})['then'](respondWithFilteredResult(_0x44f8dc,_0x5c8c0f))[_0x1439('0x55')](handleError(_0x44f8dc,null));};exports[_0x1439('0xe1')]=function(_0x182125,_0x2204e0){var _0x1a4fb1={'raw':!![],'where':{}};var _0x535ccf={};var _0x5066fb={'count':0x0,'rows':[]};return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x182125['params']['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x2204e0,null))['then'](function(_0x2ccb90){if(_0x2ccb90){_0x535ccf[_0x1439('0xd0')]=_[_0x1439('0xd1')](db[_0x1439('0xe2')][_0x1439('0x37')]);_0x535ccf['query']=_[_0x1439('0xd1')](_0x182125[_0x1439('0x44')]);_0x535ccf[_0x1439('0xd3')]=_[_0x1439('0xd4')](_0x535ccf['model'],_0x535ccf[_0x1439('0x44')]);_0x1a4fb1[_0x1439('0x4a')]=_['intersection'](_0x535ccf['model'],qs[_0x1439('0xd5')](_0x182125[_0x1439('0x44')][_0x1439('0xd5')]));_0x1a4fb1[_0x1439('0x4a')]=_0x1a4fb1[_0x1439('0x4a')][_0x1439('0x4e')]?_0x1a4fb1[_0x1439('0x4a')]:_0x535ccf[_0x1439('0xd0')];if(!_0x182125['query'][_0x1439('0xc9')](_0x1439('0xdc'))){_0x1a4fb1[_0x1439('0xda')]=qs[_0x1439('0xda')](_0x182125[_0x1439('0x44')][_0x1439('0xda')]);_0x1a4fb1[_0x1439('0x1f')]=qs[_0x1439('0x1f')](_0x182125['query'][_0x1439('0x1f')]);}_0x1a4fb1[_0x1439('0xd6')]=qs[_0x1439('0xd7')](_0x182125[_0x1439('0x44')][_0x1439('0xd7')]);_0x1a4fb1['where']=qs[_0x1439('0xd3')](_['pick'](_0x182125[_0x1439('0x44')],_0x535ccf['filters']));_0x1a4fb1[_0x1439('0x43')][_0x1439('0xe0')]=_0x2ccb90['id'];if(_0x182125[_0x1439('0x44')][_0x1439('0x2d')]){_0x1a4fb1[_0x1439('0x43')]=_[_0x1439('0x57')](_0x1a4fb1[_0x1439('0x43')],{'$or':_[_0x1439('0x38')](_0x1a4fb1[_0x1439('0x4a')],function(_0x1965cf){var _0x28cbec={};_0x28cbec[_0x1965cf]={'$like':'%'+_0x182125[_0x1439('0x44')][_0x1439('0x2d')]+'%'};return _0x28cbec;})});}_0x1a4fb1=_[_0x1439('0x57')]({},_0x1a4fb1,_0x182125[_0x1439('0x58')]);return db[_0x1439('0xe2')][_0x1439('0x21')]({'where':_0x1a4fb1['where']})[_0x1439('0x14')](function(_0xe74e7f){_0x5066fb[_0x1439('0x21')]=_0xe74e7f;if(_0x182125[_0x1439('0x44')][_0x1439('0x45')]){_0x1a4fb1[_0x1439('0x48')]=[{'all':!![]}];}return db[_0x1439('0xe2')][_0x1439('0x89')](_0x1a4fb1);})[_0x1439('0x14')](function(_0x3bfc0e){_0x5066fb[_0x1439('0x4c')]=_0x3bfc0e;return _0x5066fb;});}})[_0x1439('0x14')](respondWithFilteredResult(_0x2204e0,_0x1a4fb1))[_0x1439('0x55')](handleError(_0x2204e0,null));};exports[_0x1439('0xe3')]=function(_0x7299d0,_0x2697fd){var _0xd60544={};var _0x3bc17e={};var _0x214433;var _0x1e66c8;return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x7299d0[_0x1439('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2697fd,null))[_0x1439('0x14')](function(_0x307f15){if(_0x307f15){_0x214433=_0x307f15;_0x3bc17e[_0x1439('0xd0')]=_[_0x1439('0xd1')](db[_0x1439('0xe4')]['rawAttributes']);_0x3bc17e['query']=_[_0x1439('0xd1')](_0x7299d0[_0x1439('0x44')]);_0x3bc17e[_0x1439('0xd3')]=_['intersection'](_0x3bc17e[_0x1439('0xd0')],_0x3bc17e[_0x1439('0x44')]);_0xd60544[_0x1439('0x4a')]=_[_0x1439('0xd4')](_0x3bc17e['model'],qs['fields'](_0x7299d0[_0x1439('0x44')][_0x1439('0xd5')]));_0xd60544['attributes']=_0xd60544[_0x1439('0x4a')][_0x1439('0x4e')]?_0xd60544[_0x1439('0x4a')]:_0x3bc17e['model'];_0xd60544[_0x1439('0xd6')]=qs[_0x1439('0xd7')](_0x7299d0[_0x1439('0x44')][_0x1439('0xd7')]);_0xd60544[_0x1439('0x43')]=qs['filters'](_[_0x1439('0xd8')](_0x7299d0[_0x1439('0x44')],_0x3bc17e[_0x1439('0xd3')]));if(_0x7299d0[_0x1439('0x44')][_0x1439('0x2d')]){_0xd60544['where']=_['merge'](_0xd60544['where'],{'$or':_['map'](_0xd60544[_0x1439('0x4a')],function(_0xddc18a){var _0x58db55={};_0x58db55[_0xddc18a]={'$like':'%'+_0x7299d0[_0x1439('0x44')][_0x1439('0x2d')]+'%'};return _0x58db55;})});}_0xd60544=_[_0x1439('0x57')]({},_0xd60544,_0x7299d0[_0x1439('0x58')]);return _0x214433[_0x1439('0xe3')](_0xd60544);}})[_0x1439('0x14')](function(_0x6a3b35){if(_0x6a3b35){_0x1e66c8=_0x6a3b35[_0x1439('0x4e')];if(!_0x7299d0[_0x1439('0x44')][_0x1439('0xc9')](_0x1439('0xdc'))){_0xd60544[_0x1439('0xda')]=qs['limit'](_0x7299d0['query']['limit']);_0xd60544[_0x1439('0x1f')]=qs['offset'](_0x7299d0[_0x1439('0x44')][_0x1439('0x1f')]);}return _0x214433[_0x1439('0xe3')](_0xd60544);}})[_0x1439('0x14')](function(_0x245cd5){if(_0x245cd5){return _0x245cd5?{'count':_0x1e66c8,'rows':_0x245cd5}:null;}})[_0x1439('0x14')](respondWithResult(_0x2697fd,null))['catch'](handleError(_0x2697fd,null));};exports['getOpenchannelInteractions']=function(_0x347991,_0x16b87e){var _0x4a2a97={};var _0x550db5={};var _0x3922cc;var _0x16cfb7;return db[_0x1439('0x36')]['findOne']({'where':{'id':_0x347991[_0x1439('0x5b')]['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x16b87e,null))[_0x1439('0x14')](function(_0x25c583){if(_0x25c583){_0x3922cc=_0x25c583;_0x550db5['model']=_[_0x1439('0xd1')](db[_0x1439('0xe5')][_0x1439('0x37')]);_0x550db5[_0x1439('0x44')]=_[_0x1439('0xd1')](_0x347991['query']);_0x550db5[_0x1439('0xd3')]=_[_0x1439('0xd4')](_0x550db5[_0x1439('0xd0')],_0x550db5[_0x1439('0x44')]);_0x4a2a97[_0x1439('0x4a')]=_[_0x1439('0xd4')](_0x550db5[_0x1439('0xd0')],qs['fields'](_0x347991['query'][_0x1439('0xd5')]));_0x4a2a97['attributes']=_0x4a2a97['attributes']['length']?_0x4a2a97[_0x1439('0x4a')]:_0x550db5[_0x1439('0xd0')];_0x4a2a97[_0x1439('0xd6')]=qs['sort'](_0x347991[_0x1439('0x44')]['sort']);_0x4a2a97[_0x1439('0x43')]=qs[_0x1439('0xd3')](_['pick'](_0x347991[_0x1439('0x44')],_0x550db5[_0x1439('0xd3')]));if(_0x347991[_0x1439('0x44')][_0x1439('0x2d')]){_0x4a2a97[_0x1439('0x43')]=_[_0x1439('0x57')](_0x4a2a97['where'],{'$or':_[_0x1439('0x38')](_0x4a2a97[_0x1439('0x4a')],function(_0x2367c9){var _0x214f0d={};_0x214f0d[_0x2367c9]={'$like':'%'+_0x347991[_0x1439('0x44')][_0x1439('0x2d')]+'%'};return _0x214f0d;})});}_0x4a2a97=_[_0x1439('0x57')]({},_0x4a2a97,_0x347991[_0x1439('0x58')]);return _0x3922cc['getOpenchannelInteractions'](_0x4a2a97);}})[_0x1439('0x14')](function(_0xa707f1){if(_0xa707f1){_0x16cfb7=_0xa707f1[_0x1439('0x4e')];if(!_0x347991[_0x1439('0x44')][_0x1439('0xc9')]('nolimit')){_0x4a2a97[_0x1439('0xda')]=qs['limit'](_0x347991[_0x1439('0x44')]['limit']);_0x4a2a97[_0x1439('0x1f')]=qs[_0x1439('0x1f')](_0x347991['query']['offset']);}return _0x3922cc[_0x1439('0xe6')](_0x4a2a97);}})['then'](function(_0x4b6362){if(_0x4b6362){return _0x4b6362?{'count':_0x16cfb7,'rows':_0x4b6362}:null;}})['then'](respondWithResult(_0x16b87e,null))[_0x1439('0x55')](handleError(_0x16b87e,null));};exports[_0x1439('0xe7')]=function(_0x1915de,_0x204f39){var _0xc3851b={'raw':!![],'where':{}};var _0x4f8e91={};var _0x3ffc92={'count':0x0,'rows':[]};return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x1915de[_0x1439('0x5b')]['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x204f39,null))[_0x1439('0x14')](function(_0x8d0a76){if(_0x8d0a76){_0x4f8e91[_0x1439('0xd0')]=_[_0x1439('0xd1')](db[_0x1439('0xe8')]['rawAttributes']);_0x4f8e91[_0x1439('0x44')]=_['keys'](_0x1915de[_0x1439('0x44')]);_0x4f8e91[_0x1439('0xd3')]=_[_0x1439('0xd4')](_0x4f8e91[_0x1439('0xd0')],_0x4f8e91[_0x1439('0x44')]);_0xc3851b[_0x1439('0x4a')]=_[_0x1439('0xd4')](_0x4f8e91['model'],qs[_0x1439('0xd5')](_0x1915de[_0x1439('0x44')][_0x1439('0xd5')]));_0xc3851b[_0x1439('0x4a')]=_0xc3851b[_0x1439('0x4a')][_0x1439('0x4e')]?_0xc3851b[_0x1439('0x4a')]:_0x4f8e91[_0x1439('0xd0')];if(!_0x1915de['query']['hasOwnProperty']('nolimit')){_0xc3851b[_0x1439('0xda')]=qs[_0x1439('0xda')](_0x1915de['query'][_0x1439('0xda')]);_0xc3851b[_0x1439('0x1f')]=qs[_0x1439('0x1f')](_0x1915de[_0x1439('0x44')][_0x1439('0x1f')]);}_0xc3851b[_0x1439('0xd6')]=qs[_0x1439('0xd7')](_0x1915de[_0x1439('0x44')][_0x1439('0xd7')]);_0xc3851b[_0x1439('0x43')]=qs['filters'](_[_0x1439('0xd8')](_0x1915de[_0x1439('0x44')],_0x4f8e91['filters']));_0xc3851b[_0x1439('0x43')]['UserId']=_0x8d0a76['id'];if(_0x1915de['query'][_0x1439('0x2d')]){_0xc3851b['where']=_[_0x1439('0x57')](_0xc3851b[_0x1439('0x43')],{'$or':_[_0x1439('0x38')](_0xc3851b[_0x1439('0x4a')],function(_0x42bdf5){var _0x499dd1={};_0x499dd1[_0x42bdf5]={'$like':'%'+_0x1915de[_0x1439('0x44')][_0x1439('0x2d')]+'%'};return _0x499dd1;})});}_0xc3851b=_[_0x1439('0x57')]({},_0xc3851b,_0x1915de[_0x1439('0x58')]);return db[_0x1439('0xe8')]['count']({'where':_0xc3851b['where']})['then'](function(_0x4e053d){_0x3ffc92[_0x1439('0x21')]=_0x4e053d;if(_0x1915de[_0x1439('0x44')][_0x1439('0x45')]){_0xc3851b[_0x1439('0x48')]=[{'all':!![]}];}return db['MailInteraction'][_0x1439('0x89')](_0xc3851b);})['then'](function(_0x23e97a){_0x3ffc92[_0x1439('0x4c')]=_0x23e97a;return _0x3ffc92;});}})[_0x1439('0x14')](respondWithFilteredResult(_0x204f39,_0xc3851b))[_0x1439('0x55')](handleError(_0x204f39,null));};exports[_0x1439('0xe9')]=function(_0x4e90ee,_0x1742e0){var _0x3bf2ec={};var _0x234d9c={};var _0x1e7f62;var _0x1d98b1;return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x4e90ee[_0x1439('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1742e0,null))['then'](function(_0x511eb2){if(_0x511eb2){_0x1e7f62=_0x511eb2;_0x234d9c[_0x1439('0xd0')]=_[_0x1439('0xd1')](db[_0x1439('0xea')][_0x1439('0x37')]);_0x234d9c[_0x1439('0x44')]=_[_0x1439('0xd1')](_0x4e90ee[_0x1439('0x44')]);_0x234d9c[_0x1439('0xd3')]=_[_0x1439('0xd4')](_0x234d9c[_0x1439('0xd0')],_0x234d9c[_0x1439('0x44')]);_0x3bf2ec[_0x1439('0x4a')]=_['intersection'](_0x234d9c[_0x1439('0xd0')],qs['fields'](_0x4e90ee[_0x1439('0x44')][_0x1439('0xd5')]));_0x3bf2ec['attributes']=_0x3bf2ec[_0x1439('0x4a')][_0x1439('0x4e')]?_0x3bf2ec[_0x1439('0x4a')]:_0x234d9c[_0x1439('0xd0')];_0x3bf2ec[_0x1439('0xd6')]=qs[_0x1439('0xd7')](_0x4e90ee[_0x1439('0x44')][_0x1439('0xd7')]);_0x3bf2ec[_0x1439('0x43')]=qs[_0x1439('0xd3')](_[_0x1439('0xd8')](_0x4e90ee[_0x1439('0x44')],_0x234d9c[_0x1439('0xd3')]));if(_0x4e90ee['query'][_0x1439('0x2d')]){_0x3bf2ec['where']=_[_0x1439('0x57')](_0x3bf2ec[_0x1439('0x43')],{'$or':_[_0x1439('0x38')](_0x3bf2ec[_0x1439('0x4a')],function(_0x189b33){var _0x509455={};_0x509455[_0x189b33]={'$like':'%'+_0x4e90ee['query'][_0x1439('0x2d')]+'%'};return _0x509455;})});}_0x3bf2ec=_[_0x1439('0x57')]({},_0x3bf2ec,_0x4e90ee[_0x1439('0x58')]);return _0x1e7f62[_0x1439('0xe9')](_0x3bf2ec);}})['then'](function(_0x399eaa){if(_0x399eaa){_0x1d98b1=_0x399eaa[_0x1439('0x4e')];if(!_0x4e90ee[_0x1439('0x44')]['hasOwnProperty'](_0x1439('0xdc'))){_0x3bf2ec[_0x1439('0xda')]=qs[_0x1439('0xda')](_0x4e90ee['query'][_0x1439('0xda')]);_0x3bf2ec[_0x1439('0x1f')]=qs[_0x1439('0x1f')](_0x4e90ee[_0x1439('0x44')][_0x1439('0x1f')]);}return _0x1e7f62[_0x1439('0xe9')](_0x3bf2ec);}})['then'](function(_0x258164){if(_0x258164){return _0x258164?{'count':_0x1d98b1,'rows':_0x258164}:null;}})[_0x1439('0x14')](respondWithResult(_0x1742e0,null))[_0x1439('0x55')](handleError(_0x1742e0,null));};exports[_0x1439('0xeb')]=function(_0x189820,_0x5cfce8){var _0x1869d7={};var _0x1b59ce={};var _0x59c2b6;var _0x191017;return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x189820[_0x1439('0x5b')]['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x5cfce8,null))['then'](function(_0x4e3809){if(_0x4e3809){_0x59c2b6=_0x4e3809;_0x1b59ce[_0x1439('0xd0')]=_['keys'](db['FaxInteraction'][_0x1439('0x37')]);_0x1b59ce[_0x1439('0x44')]=_[_0x1439('0xd1')](_0x189820['query']);_0x1b59ce['filters']=_['intersection'](_0x1b59ce[_0x1439('0xd0')],_0x1b59ce['query']);_0x1869d7[_0x1439('0x4a')]=_['intersection'](_0x1b59ce[_0x1439('0xd0')],qs[_0x1439('0xd5')](_0x189820['query'][_0x1439('0xd5')]));_0x1869d7[_0x1439('0x4a')]=_0x1869d7['attributes'][_0x1439('0x4e')]?_0x1869d7[_0x1439('0x4a')]:_0x1b59ce[_0x1439('0xd0')];_0x1869d7[_0x1439('0xd6')]=qs[_0x1439('0xd7')](_0x189820[_0x1439('0x44')][_0x1439('0xd7')]);_0x1869d7[_0x1439('0x43')]=qs[_0x1439('0xd3')](_['pick'](_0x189820[_0x1439('0x44')],_0x1b59ce['filters']));if(_0x189820[_0x1439('0x44')][_0x1439('0x2d')]){_0x1869d7[_0x1439('0x43')]=_[_0x1439('0x57')](_0x1869d7[_0x1439('0x43')],{'$or':_['map'](_0x1869d7[_0x1439('0x4a')],function(_0x53953d){var _0x210922={};_0x210922[_0x53953d]={'$like':'%'+_0x189820[_0x1439('0x44')][_0x1439('0x2d')]+'%'};return _0x210922;})});}_0x1869d7=_[_0x1439('0x57')]({},_0x1869d7,_0x189820['options']);return _0x59c2b6['getFaxInteractions'](_0x1869d7);}})[_0x1439('0x14')](function(_0x3f43fd){if(_0x3f43fd){_0x191017=_0x3f43fd[_0x1439('0x4e')];if(!_0x189820['query'][_0x1439('0xc9')](_0x1439('0xdc'))){_0x1869d7[_0x1439('0xda')]=qs[_0x1439('0xda')](_0x189820[_0x1439('0x44')][_0x1439('0xda')]);_0x1869d7[_0x1439('0x1f')]=qs[_0x1439('0x1f')](_0x189820['query']['offset']);}return _0x59c2b6[_0x1439('0xeb')](_0x1869d7);}})[_0x1439('0x14')](function(_0x4c8a08){if(_0x4c8a08){return _0x4c8a08?{'count':_0x191017,'rows':_0x4c8a08}:null;}})[_0x1439('0x14')](respondWithResult(_0x5cfce8,null))[_0x1439('0x55')](handleError(_0x5cfce8,null));};exports[_0x1439('0xec')]=function(_0x5d566e,_0x15c12a){var _0x1b0c23={};var _0x1cb93c={};var _0x44f816;var _0x1f9f88;return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x5d566e['params']['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x15c12a,null))[_0x1439('0x14')](function(_0x331522){if(_0x331522){_0x44f816=_0x331522;_0x1cb93c[_0x1439('0xd0')]=_[_0x1439('0xd1')](db[_0x1439('0xed')][_0x1439('0x37')]);_0x1cb93c['query']=_[_0x1439('0xd1')](_0x5d566e['query']);_0x1cb93c['filters']=_[_0x1439('0xd4')](_0x1cb93c[_0x1439('0xd0')],_0x1cb93c[_0x1439('0x44')]);_0x1b0c23[_0x1439('0x4a')]=_['intersection'](_0x1cb93c[_0x1439('0xd0')],qs[_0x1439('0xd5')](_0x5d566e[_0x1439('0x44')][_0x1439('0xd5')]));_0x1b0c23[_0x1439('0x4a')]=_0x1b0c23[_0x1439('0x4a')][_0x1439('0x4e')]?_0x1b0c23[_0x1439('0x4a')]:_0x1cb93c[_0x1439('0xd0')];_0x1b0c23[_0x1439('0xd6')]=qs['sort'](_0x5d566e[_0x1439('0x44')][_0x1439('0xd7')]);_0x1b0c23['where']=qs['filters'](_['pick'](_0x5d566e[_0x1439('0x44')],_0x1cb93c['filters']));if(_0x5d566e[_0x1439('0x44')][_0x1439('0x2d')]){_0x1b0c23[_0x1439('0x43')]=_[_0x1439('0x57')](_0x1b0c23[_0x1439('0x43')],{'$or':_[_0x1439('0x38')](_0x1b0c23[_0x1439('0x4a')],function(_0x5dd44d){var _0x5a6dd7={};_0x5a6dd7[_0x5dd44d]={'$like':'%'+_0x5d566e[_0x1439('0x44')][_0x1439('0x2d')]+'%'};return _0x5a6dd7;})});}_0x1b0c23=_[_0x1439('0x57')]({},_0x1b0c23,_0x5d566e['options']);return _0x44f816[_0x1439('0xec')](_0x1b0c23);}})['then'](function(_0x521e9d){if(_0x521e9d){_0x1f9f88=_0x521e9d[_0x1439('0x4e')];if(!_0x5d566e['query']['hasOwnProperty'](_0x1439('0xdc'))){_0x1b0c23['limit']=qs['limit'](_0x5d566e['query']['limit']);_0x1b0c23['offset']=qs[_0x1439('0x1f')](_0x5d566e[_0x1439('0x44')]['offset']);}return _0x44f816[_0x1439('0xec')](_0x1b0c23);}})[_0x1439('0x14')](function(_0x4f0d87){if(_0x4f0d87){return _0x4f0d87?{'count':_0x1f9f88,'rows':_0x4f0d87}:null;}})[_0x1439('0x14')](respondWithResult(_0x15c12a,null))[_0x1439('0x55')](handleError(_0x15c12a,null));};exports[_0x1439('0xee')]=function(_0x42af9d,_0xadef3f,_0x531c54){var _0x50e862;var _0x189675;var _0x5648fa;var _0x5e71ba=!_[_0x1439('0x66')](_0x42af9d['params']['id'])?_0x42af9d[_0x1439('0x5b')]['id']:!_[_0x1439('0x66')](_0x42af9d[_0x1439('0x7e')]['id'])?_0x42af9d['user']['id']:null;return db[_0x1439('0x36')]['find']({'where':{'id':_0x5e71ba,'role':{'$or':[_0x1439('0x28'),_0x1439('0x7e'),_0x1439('0x2a')]}},'attributes':['id',_0x1439('0x31'),'phone',_0x1439('0xef'),_0x1439('0x25'),_0x1439('0x60'),_0x1439('0x9d')]})[_0x1439('0x14')](function(_0x2f8673){if(_0x2f8673){if(_0x2f8673[_0x1439('0x25')]===_0x1439('0x2a')){_0x50e862=_0x2f8673;if(_0x42af9d[_0x1439('0x5a')]['interface']){_0x5648fa=util['format']('LOCAL/%s@from-sip/n',_0x50e862[_0x42af9d[_0x1439('0x5a')][_0x1439('0x9f')]]);}else if(_0x42af9d['body'][_0x1439('0xf0')]){_0x5648fa=util[_0x1439('0xab')]('SIP/%s',_0x42af9d[_0x1439('0x5a')][_0x1439('0xf0')]);}else{_0x5648fa=util[_0x1439('0xab')](_0x1439('0xac'),_0x50e862[_0x1439('0x31')]);}socket['to'](util[_0x1439('0xab')](_0x1439('0xf1'),_0x50e862[_0x1439('0x31')]))[_0x1439('0x26')](_0x1439('0xf2'),{'user':{'id':_0x50e862['id'],'name':_0x50e862[_0x1439('0x31')]},'ip':_0x42af9d[_0x1439('0xf3')]['x-forwarded-for']||_0x42af9d['connection'][_0x1439('0xf4')]||_0x42af9d['socket'][_0x1439('0xf4')]||_0x42af9d[_0x1439('0xf5')]['socket'][_0x1439('0xf4')]});return db['UserVoiceQueueRt'][_0x1439('0x33')]({'where':{'membername':_0x50e862[_0x1439('0x31')]},'individualHooks':!![]});}}else{throw new db[(_0x1439('0x8e'))][(_0x1439('0x8f'))](_0x1439('0xf6'));}})[_0x1439('0x14')](function(){if(_0x50e862){return _0x50e862[_0x1439('0xf7')]({'raw':!![]});}})[_0x1439('0x14')](function(_0x238254){if(_0x50e862){if(_0x238254){_0x189675=_0x238254;if(_0x189675['length']){var _0x473a2a=_0x189675['map'](function(_0x5d3481){var _0x372f40={'membername':_0x50e862[_0x1439('0x31')],'UserId':_0x50e862['id'],'queue_name':_0x5d3481[_0x1439('0x31')],'VoiceQueueId':_0x5d3481['id'],'interface':_0x5648fa,'paused':_0x50e862[_0x1439('0x9d')]||![],'penalty':_0x5d3481[_0x1439('0xf8')]||0x0};return db[_0x1439('0xad')][_0x1439('0xae')](_0x372f40);});return Promise[_0x1439('0x54')](_0x473a2a);}}}})[_0x1439('0x14')](function(){if(_0x50e862){return db[_0x1439('0xf9')][_0x1439('0x89')]({'where':{'membername':_0x50e862[_0x1439('0x31')],'exitAt':null}});}})[_0x1439('0x14')](function(_0x48d3de){if(_0x50e862){var _0xd14e0e=[];_0x48d3de[_0x1439('0xfa')](function(_0x559356){_0xd14e0e[_0x1439('0x4b')](_0x559356[_0x1439('0x24')]({'exitAt':moment()[_0x1439('0xab')](_0x1439('0xfb'))}));});return Promise[_0x1439('0x54')](_0xd14e0e);}})[_0x1439('0x14')](function(){if(_0x50e862){var _0x5bfc1a=[];var _0x3cfffa=[];var _0x1ac407=utils[_0x1439('0xfc')]();var _0x200106={'membername':_0x50e862['name'],'interface':_0x5648fa,'enterAt':moment()[_0x1439('0xab')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x50e862[_0x1439('0x25')],'internal':_0x50e862[_0x1439('0x60')]};_0x1ac407[_0x1439('0xfa')](function(_0x478d01){_0x5bfc1a['push'](_[_0x1439('0x57')]({'channel':_0x478d01,'type':_0x1439('0xfd'),'data1':_0x42af9d['body'][_0x1439('0xfe')],'data2':_0x5648fa},_0x200106));if(_0x50e862['loginInPause']){_0x3cfffa[_0x1439('0x4b')](_[_0x1439('0x57')]({'channel':_0x478d01,'type':_0x1439('0xff'),'data1':'LOGININPAUSE'},_0x200106));}});return db['MemberReport'][_0x1439('0x83')](_0x5bfc1a[_0x1439('0xc6')](_0x3cfffa),{'individualHooks':!![]});}})[_0x1439('0x14')](function(){if(_0x50e862){return _0x50e862['update']({'online':!![],'lastLoginAt':moment()[_0x1439('0xab')](_0x1439('0xfb')),'voicePause':_0x50e862[_0x1439('0x9d')]||![],'mailPause':_0x50e862['loginInPause']||![],'chatPause':_0x50e862[_0x1439('0x9d')]||![],'faxPause':_0x50e862['loginInPause']||![],'smsPause':_0x50e862[_0x1439('0x9d')]||![],'openchannelPause':_0x50e862[_0x1439('0x9d')]||![],'whatsappPause':_0x50e862[_0x1439('0x9d')]||![],'pauseType':_0x50e862['loginInPause']?'LOGININPAUSE':null,'interface':_0x5648fa,'lastPauseAt':moment()[_0x1439('0xab')](_0x1439('0xfb'))});}})[_0x1439('0x14')](function(_0x8db1c3){if(_0x42af9d[_0x1439('0x100')]){return _0x531c54();}else{return Promise[_0x1439('0x101')](_0x8db1c3)[_0x1439('0x14')](respondWithResult(_0xadef3f,null));}})[_0x1439('0x55')](handleError(_0xadef3f,null));};exports[_0x1439('0x102')]=function(_0x3168af,_0x34ff95){var _0x2f36d2;return db[_0x1439('0x36')]['find']({'where':{'id':_0x3168af[_0x1439('0x5b')]['id'],'role':'agent'},'attributes':['id',_0x1439('0x31'),_0x1439('0x25')]})[_0x1439('0x14')](handleEntityNotFound(_0x34ff95,null))['then'](function(_0x56b87f){if(_0x56b87f){_0x2f36d2=_0x56b87f;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x2f36d2[_0x1439('0x31')]},'individualHooks':!![]});}})['then'](function(){return db[_0x1439('0xf9')][_0x1439('0x89')]({'where':{'membername':_0x2f36d2[_0x1439('0x31')],'exitAt':null}});})[_0x1439('0x14')](function(_0x570cb3){var _0x4a251b=[];_0x570cb3['forEach'](function(_0x421e4e){_0x4a251b['push'](_0x421e4e[_0x1439('0x24')]({'exitAt':moment()['format'](_0x1439('0xfb'))}));});return Promise[_0x1439('0x54')](_0x4a251b);})[_0x1439('0x14')](function(){return _0x2f36d2[_0x1439('0x24')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x1439('0x14')](respondWithResult(_0x34ff95,null))['catch'](handleError(_0x34ff95,null));};exports[_0x1439('0x103')]=function(_0x1e9ac0,_0x4c54f4){var _0x1fad6b;return db[_0x1439('0xad')][_0x1439('0x24')]({'paused':0x1},{'where':{'UserId':_0x1e9ac0['params']['id']},'individualHooks':!![]})[_0x1439('0x14')](function(){return db['User'][_0x1439('0x30')]({'where':{'id':_0x1e9ac0[_0x1439('0x5b')]['id'],'role':'agent'},'attributes':['id','name','role',_0x1439('0x60'),_0x1439('0x9f'),_0x1439('0x9c')]});})[_0x1439('0x14')](handleEntityNotFound(_0x4c54f4,null))['then'](function(_0x51dfb5){if(_0x51dfb5){_0x1fad6b=_0x51dfb5;return respondWithRpcPromise(_0x1439('0x104'),_0x1439('0x103'),{'id':_0x1fad6b['id'],'name':_0x1fad6b[_0x1439('0x31')],'pause':!![]});}})[_0x1439('0x14')](function(){if(_0x1fad6b){return db[_0x1439('0xf9')]['findAll']({'where':{'membername':_0x1fad6b[_0x1439('0x31')],'type':_0x1439('0xff'),'exitAt':null}});}})[_0x1439('0x14')](function(_0x529f63){if(_0x529f63[_0x1439('0x4e')]){var _0x3ad4de=moment()[_0x1439('0xab')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x214b64=0x0,_0x5908fe=_0x529f63['length'];_0x214b64<_0x5908fe;_0x214b64++){_0x529f63[_0x214b64][_0x1439('0x105')]({'exitAt':_0x3ad4de});}}})[_0x1439('0x14')](function(){var _0x5c1ab3=[];var _0x10a71c=utils['getChannels']();_0x10a71c[_0x1439('0xfa')](function(_0x461381){_0x5c1ab3[_0x1439('0x4b')]({'channel':_0x461381,'membername':_0x1fad6b['name'],'interface':_[_0x1439('0x66')](_0x1fad6b[_0x1439('0x9f')])?util['format']('SIP/%s',_0x1fad6b['name']):_0x1fad6b[_0x1439('0x9f')],'type':'PAUSE','enterAt':moment()[_0x1439('0xab')](_0x1439('0xfb')),'data1':_0x1e9ac0[_0x1439('0x5a')][_0x1439('0x3a')]||_0x1439('0x106'),'role':_0x1fad6b['role'],'internal':_0x1fad6b[_0x1439('0x60')]});});return db[_0x1439('0xf9')]['bulkCreate'](_0x5c1ab3,{'individualHooks':!![]});})[_0x1439('0x14')](function(){return _0x1fad6b[_0x1439('0x24')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x1e9ac0['body'][_0x1439('0x3a')]||_0x1439('0x106'),'lastPauseAt':moment()['format'](_0x1439('0xfb'))});})['then'](respondWithResult(_0x4c54f4,null))['catch'](handleError(_0x4c54f4,null));};exports[_0x1439('0x107')]=function(_0x4aa5d6,_0x553fc1){if(_0x4aa5d6[_0x1439('0x5a')]['channel']&&!utils[_0x1439('0xa0')](_0x4aa5d6[_0x1439('0x5a')]['channel'])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x4aa5d6[_0x1439('0x5a')][_0x1439('0x9b')]));}return db[_0x1439('0x36')][_0x1439('0x30')]({'where':{'id':_0x4aa5d6[_0x1439('0x5b')]['id']},'attributes':['id',_0x1439('0x31'),_0x1439('0x25'),_0x1439('0x60'),_0x1439('0x9f'),_0x1439('0x9c'),_0x1439('0x9e'),_0x1439('0x108'),_0x1439('0x109'),'faxPause',_0x1439('0x10a'),'smsPause',_0x1439('0x10b'),_0x1439('0x10c'),_0x1439('0x10d')]})[_0x1439('0x14')](function(_0x5689bf){if(!_0x5689bf){throw new APINotFoundError(util[_0x1439('0xab')](_0x1439('0xc8'),_0x4aa5d6['params']['id']));}return _0x5689bf['unpause'](_0x4aa5d6[_0x1439('0x5a')][_0x1439('0x9b')]);})['then'](respondWithResult(_0x553fc1,null))[_0x1439('0x55')](APIHandleError(_0x553fc1));};exports[_0x1439('0x10e')]=function(_0x191254,_0x36da78){var _0x1d81cf={};var _0x4e741d={};var _0x100678;var _0x4c31f6;return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x191254[_0x1439('0x5b')]['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x36da78,null))['then'](function(_0x51ccee){if(_0x51ccee){_0x100678=_0x51ccee;_0x4e741d[_0x1439('0xd0')]=_[_0x1439('0xd1')](db['Team'][_0x1439('0x37')]);_0x4e741d[_0x1439('0x44')]=_[_0x1439('0xd1')](_0x191254[_0x1439('0x44')]);_0x4e741d['filters']=_['intersection'](_0x4e741d[_0x1439('0xd0')],_0x4e741d[_0x1439('0x44')]);_0x1d81cf[_0x1439('0x4a')]=_[_0x1439('0xd4')](_0x4e741d[_0x1439('0xd0')],qs[_0x1439('0xd5')](_0x191254['query'][_0x1439('0xd5')]));_0x1d81cf[_0x1439('0x4a')]=_0x1d81cf[_0x1439('0x4a')][_0x1439('0x4e')]?_0x1d81cf[_0x1439('0x4a')]:_0x4e741d[_0x1439('0xd0')];_0x1d81cf[_0x1439('0xd6')]=qs[_0x1439('0xd7')](_0x191254[_0x1439('0x44')][_0x1439('0xd7')]);_0x1d81cf[_0x1439('0x43')]=qs[_0x1439('0xd3')](_[_0x1439('0xd8')](_0x191254[_0x1439('0x44')],_0x4e741d[_0x1439('0xd3')]));if(_0x191254['query']['filter']){_0x1d81cf['where']=_['merge'](_0x1d81cf[_0x1439('0x43')],{'$or':_[_0x1439('0x38')](_0x1d81cf['attributes'],function(_0x54a8c9){var _0x569442={};_0x569442[_0x54a8c9]={'$like':'%'+_0x191254[_0x1439('0x44')][_0x1439('0x2d')]+'%'};return _0x569442;})});}_0x1d81cf=_[_0x1439('0x57')]({},_0x1d81cf,_0x191254['options']);return _0x100678[_0x1439('0x10e')](_0x1d81cf);}})['then'](function(_0x135fae){if(_0x135fae){_0x4c31f6=_0x135fae[_0x1439('0x4e')];if(!_0x191254[_0x1439('0x44')]['hasOwnProperty'](_0x1439('0xdc'))){_0x1d81cf[_0x1439('0xda')]=qs['limit'](_0x191254['query'][_0x1439('0xda')]);_0x1d81cf[_0x1439('0x1f')]=qs[_0x1439('0x1f')](_0x191254['query'][_0x1439('0x1f')]);}return _0x100678[_0x1439('0x10e')](_0x1d81cf);}})['then'](function(_0x8087a3){if(_0x8087a3){return _0x8087a3?{'count':_0x4c31f6,'rows':_0x8087a3}:null;}})['then'](respondWithResult(_0x36da78,null))[_0x1439('0x55')](handleError(_0x36da78,null));};exports[_0x1439('0x10f')]=function(_0x426aa8,_0x28bd3e){var _0x5e731f=_0x426aa8[_0x1439('0x5b')]['id'];var _0x46e813=_0x426aa8[_0x1439('0x5a')]?_0x426aa8[_0x1439('0x5a')][_0x1439('0x5e')]:null;var _0x3f4826=[];return Promise[_0x1439('0x101')]()[_0x1439('0x14')](function(){if(!_0x46e813)throw new APIBadRequestError(_0x1439('0x110'));})[_0x1439('0x14')](function(){return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x5e731f}});})[_0x1439('0x14')](function(_0x4a471d){if(!_0x4a471d)throw new APINotFoundError(util[_0x1439('0xab')](_0x1439('0xc8'),_0x426aa8[_0x1439('0x5b')]['id']));return db[_0x1439('0x68')]['transaction'](function(_0x15ffbd){return _0x4a471d[_0x1439('0x10f')](_0x46e813,{'transaction':_0x15ffbd})[_0x1439('0x14')](function(){return db[_0x1439('0x111')][_0x1439('0x89')]({'where':{'id':{'$in':_0x46e813}}});})[_0x1439('0x14')](function(_0x45dd1a){var _0x2a43f4=_[_0x1439('0x38')](_0x45dd1a,function(_0xe95d02){return _0xe95d02[_0x1439('0x112')]();});return Promise[_0x1439('0x54')](_0x2a43f4);})[_0x1439('0x14')](function(_0x3fdd47){_0x3f4826=_[_0x1439('0x113')](_0x3fdd47);var _0x272779=_[_0x1439('0x38')](_0x3f4826,function(_0x66cc08){return _0x66cc08[_0x1439('0x114')](_0x4a471d['id'],{'transaction':_0x15ffbd});});return Promise[_0x1439('0x54')](_0x272779);})[_0x1439('0x14')](function(){if(!_0x4a471d[_0x1439('0x9c')])return;var _0x4b9686=_[_0x1439('0x2d')](_0x3f4826,function(_0x12a8d0){return _0x12a8d0[_0x1439('0x115')](_0x1439('0x9b'))===_0x1439('0x116');});var _0x59c6ce=_[_0x1439('0x38')](_0x4b9686,function(_0x295a05){return db[_0x1439('0xad')][_0x1439('0xae')]({'membername':_0x4a471d[_0x1439('0x31')],'UserId':_0x4a471d['id'],'queue_name':_0x295a05[_0x1439('0x31')],'VoiceQueueId':_0x295a05['id'],'interface':_['isNil'](_0x4a471d[_0x1439('0x9f')])?util[_0x1439('0xab')](_0x1439('0xac'),_0x4a471d[_0x1439('0x31')]):_0x4a471d[_0x1439('0x9f')],'paused':_0x4a471d[_0x1439('0x9e')]||![],'penalty':_0x4a471d['penalty']},{'transaction':_0x15ffbd});});return Promise[_0x1439('0x54')](_0x59c6ce);})['then'](function(){return db['TeamVoicePrefix'][_0x1439('0x89')]({'where':{'teamId':{'$in':_0x46e813}}});})['then'](function(_0x17343c){var _0x3f84d8=_[_0x1439('0x38')](_0x17343c,function(_0x5ea1fe){return db[_0x1439('0x117')][_0x1439('0x7c')]({'UserId':_0x4a471d['id'],'VoicePrefixId':_0x5ea1fe['VoicePrefixId']},{'transaction':_0x15ffbd});});return Promise[_0x1439('0x54')](_0x3f84d8);});});})[_0x1439('0x14')](function(){for(var _0x2ef703=0x0;_0x2ef703<_0x3f4826[_0x1439('0x4e')];_0x2ef703++){var _0x56d3b5=_0x3f4826[_0x2ef703][_0x1439('0x115')](_0x1439('0x9b'));var _0x435dcd=_0x56d3b5+_0x1439('0xa7');socket['emit']('user'+_0x56d3b5+_0x1439('0xa8'),{'UserId':_0x5e731f,['queueField']:_0x3f4826[_0x2ef703]['id']});}})[_0x1439('0x14')](respondWithStatusCode(_0x28bd3e,null))[_0x1439('0x55')](APIHandleError(_0x28bd3e));};exports[_0x1439('0x118')]=function(_0x3b84e1,_0x5945e6){var _0x5d94ed=_0x3b84e1[_0x1439('0x5b')]['id'];var _0x17f78f=null;if(_0x3b84e1[_0x1439('0x44')][_0x1439('0x5e')]){_0x17f78f=_[_0x1439('0x119')](_0x3b84e1['query']['ids'])?_0x3b84e1['query'][_0x1439('0x5e')]:[_0x3b84e1['query']['ids']];}var _0x297e27=[];return Promise[_0x1439('0x101')]()[_0x1439('0x14')](function(){if(!_0x17f78f)throw new APIBadRequestError(_0x1439('0x11a'));})[_0x1439('0x14')](function(){return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x5d94ed}});})[_0x1439('0x14')](function(_0x4bbac8){if(!_0x4bbac8)throw new APINotFoundError(util[_0x1439('0xab')](_0x1439('0xc8'),_0x3b84e1['params']['id']));return db[_0x1439('0x68')]['transaction'](function(_0x23bf59){return _0x4bbac8[_0x1439('0x118')](_0x17f78f,{'transaction':_0x23bf59})['then'](function(){return db[_0x1439('0x111')]['findAll']({'where':{'id':{'$in':_0x17f78f}}});})[_0x1439('0x14')](function(_0x53cb79){var _0x140fc2=_['map'](_0x53cb79,function(_0x1e7479){return _0x1e7479['getAssociatedQueues']();});return Promise[_0x1439('0x54')](_0x140fc2);})[_0x1439('0x14')](function(_0x108807){_0x297e27=_[_0x1439('0x113')](_0x108807);var _0x5d24d4=_[_0x1439('0x38')](_0x297e27,function(_0x4bf26f){return _0x4bf26f['removeAgent'](_0x4bbac8['id'],{'transaction':_0x23bf59});});return Promise['all'](_0x5d24d4);})['then'](function(){if(!_0x4bbac8[_0x1439('0x9c')])return;var _0x342355=_[_0x1439('0x2d')](_0x297e27,function(_0x47fd93){return _0x47fd93['getDataValue'](_0x1439('0x9b'))===_0x1439('0x116');});var _0x3ef01a=_[_0x1439('0x38')](_0x342355,function(_0xb10d35){return db[_0x1439('0xad')][_0x1439('0x33')]({'where':{'VoiceQueueId':_0xb10d35['id'],'UserId':_0x4bbac8['id']},'transaction':_0x23bf59});});return Promise['all'](_0x3ef01a);})[_0x1439('0x14')](function(){return db[_0x1439('0x11b')][_0x1439('0x89')]({'where':{'teamId':{'$in':_0x17f78f}}});})[_0x1439('0x14')](function(_0x513aae){var _0x377352=_[_0x1439('0x38')](_0x513aae,function(_0x321f23){return db[_0x1439('0x117')][_0x1439('0x33')]({'where':{'UserId':_0x4bbac8['id'],'VoicePrefixId':_0x321f23[_0x1439('0x11c')]}},{'transaction':_0x23bf59});});return Promise['all'](_0x377352);});});})[_0x1439('0x14')](function(){for(var _0x5f0a0d=0x0;_0x5f0a0d<_0x297e27[_0x1439('0x4e')];_0x5f0a0d++){var _0x41cbc2=_0x297e27[_0x5f0a0d][_0x1439('0x115')]('channel');var _0x366836=_0x41cbc2+_0x1439('0xa7');socket[_0x1439('0x26')](_0x1439('0x7e')+_0x41cbc2+_0x1439('0xb1'),{'UserId':_0x5d94ed,['queueField']:_0x297e27[_0x5f0a0d]['id']});}})['then'](respondWithStatusCode(_0x5945e6,null))[_0x1439('0x55')](APIHandleError(_0x5945e6));};exports['getLists']=function(_0x47d87f,_0x5d0748){var _0x4c82a1={};var _0x5d3994={};var _0x4438ad;var _0x3c6c89;return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x47d87f[_0x1439('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5d0748,null))[_0x1439('0x14')](function(_0xee1e66){if(_0xee1e66){_0x4438ad=_0xee1e66;_0x5d3994[_0x1439('0xd0')]=_[_0x1439('0xd1')](db[_0x1439('0xca')][_0x1439('0x37')]);_0x5d3994[_0x1439('0x44')]=_['keys'](_0x47d87f[_0x1439('0x44')]);_0x5d3994[_0x1439('0xd3')]=_[_0x1439('0xd4')](_0x5d3994[_0x1439('0xd0')],_0x5d3994[_0x1439('0x44')]);_0x4c82a1[_0x1439('0x4a')]=_[_0x1439('0xd4')](_0x5d3994[_0x1439('0xd0')],qs[_0x1439('0xd5')](_0x47d87f[_0x1439('0x44')][_0x1439('0xd5')]));_0x4c82a1[_0x1439('0x4a')]=_0x4c82a1[_0x1439('0x4a')][_0x1439('0x4e')]?_0x4c82a1['attributes']:_0x5d3994[_0x1439('0xd0')];_0x4c82a1[_0x1439('0xd6')]=qs[_0x1439('0xd7')](_0x47d87f[_0x1439('0x44')][_0x1439('0xd7')]);_0x4c82a1[_0x1439('0x43')]=qs[_0x1439('0xd3')](_[_0x1439('0xd8')](_0x47d87f[_0x1439('0x44')],_0x5d3994['filters']));if(_0x47d87f['query'][_0x1439('0x2d')]){_0x4c82a1[_0x1439('0x43')]=_[_0x1439('0x57')](_0x4c82a1[_0x1439('0x43')],{'$or':_['map'](_0x4c82a1[_0x1439('0x4a')],function(_0x3163bb){var _0x5d92ac={};_0x5d92ac[_0x3163bb]={'$like':'%'+_0x47d87f[_0x1439('0x44')]['filter']+'%'};return _0x5d92ac;})});}_0x4c82a1=_[_0x1439('0x57')]({},_0x4c82a1,_0x47d87f['options']);return _0x4438ad[_0x1439('0x11d')](_0x4c82a1);}})[_0x1439('0x14')](function(_0x4e3ef9){if(_0x4e3ef9){_0x3c6c89=_0x4e3ef9[_0x1439('0x4e')];if(!_0x47d87f[_0x1439('0x44')][_0x1439('0xc9')](_0x1439('0xdc'))){_0x4c82a1[_0x1439('0xda')]=qs['limit'](_0x47d87f['query'][_0x1439('0xda')]);_0x4c82a1[_0x1439('0x1f')]=qs['offset'](_0x47d87f[_0x1439('0x44')]['offset']);}return _0x4438ad[_0x1439('0x11d')](_0x4c82a1);}})[_0x1439('0x14')](function(_0x88bf55){if(_0x88bf55){return _0x88bf55?{'count':_0x3c6c89,'rows':_0x88bf55}:null;}})['then'](respondWithResult(_0x5d0748,null))[_0x1439('0x55')](handleError(_0x5d0748,null));};exports['getAgents']=function(_0x5e828c,_0x55bb11){var _0x163b33={};var _0x2917ea={};var _0x43e108;return db[_0x1439('0x36')][_0x1439('0x96')]({'where':{'id':_0x5e828c[_0x1439('0x5b')]['id']}})[_0x1439('0x14')](handleEntityNotFound(_0x55bb11,null))[_0x1439('0x14')](function(_0x143292){if(_0x143292){_0x43e108=_0x143292;_0x2917ea[_0x1439('0xd0')]=_['keys'](db[_0x1439('0x36')][_0x1439('0x37')]);_0x2917ea[_0x1439('0x44')]=_[_0x1439('0xd1')](_0x5e828c['query']);_0x2917ea[_0x1439('0xd3')]=_[_0x1439('0xd4')](_0x2917ea[_0x1439('0xd0')],_0x2917ea['query']);_0x163b33[_0x1439('0x4a')]=_[_0x1439('0xd4')](_0x2917ea[_0x1439('0xd0')],qs['fields'](_0x5e828c[_0x1439('0x44')][_0x1439('0xd5')]));_0x163b33[_0x1439('0x4a')]=_0x163b33[_0x1439('0x4a')][_0x1439('0x4e')]?_0x163b33[_0x1439('0x4a')]:_0x2917ea[_0x1439('0xd0')];_0x163b33[_0x1439('0xd6')]=qs[_0x1439('0xd7')](_0x5e828c[_0x1439('0x44')][_0x1439('0xd7')]);_0x163b33['where']=qs[_0x1439('0xd3')](_[_0x1439('0xd8')](_0x5e828c[_0x1439('0x44')],_0x2917ea[_0x1439('0xd3')]));if(_0x5e828c[_0x1439('0x44')][_0x1439('0x2d')]){_0x163b33[_0x1439('0x43')]=_[_0x1439('0x57')](_0x163b33['where'],{'$or':_[_0x1439('0x38')](_0x163b33[_0x1439('0x4a')],function(_0x377e95){var _0x924fbb={};_0x924fbb[_0x377e95]={'$like':'%'+_0x5e828c['query']['filter']+'%'};return _0x924fbb;})});}_0x163b33['model']=db[_0x1439('0x36')];_0x163b33['as']=_0x1439('0x29');_0x163b33=_['merge']({},_0x163b33,_0x5e828c[_0x1439('0x58')]);return _0x43e108[_0x1439('0xf7')]({'include':[_0x163b33]});}})['then'](function(_0x426496){if(_0x426496){var _0x905f7f={},_0x93ba20=[];for(var _0x30e407=0x0;_0x30e407<_0x426496['length'];_0x30e407+=0x1){for(var _0x3aff28=0x0,_0x23e378;_0x3aff28<_0x426496[_0x30e407][_0x1439('0x29')][_0x1439('0x4e')];_0x3aff28+=0x1){_0x23e378=_0x426496[_0x30e407][_0x1439('0x29')][_0x3aff28][_0x1439('0x27')]({'plain':!![]});_0x905f7f[_0x23e378['id']]=_0x23e378;}}_0x905f7f=_[_0x1439('0x11e')](_0x905f7f);for(var _0x4e413a=qs['offset'](_0x5e828c[_0x1439('0x44')]['offset']);_0x4e413a<_0x905f7f[_0x1439('0x4e')]&&_0x93ba20[_0x1439('0x4e')]=_0x3c07cb[_0x7275('0x4c')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x7275('0x1c')](function(){if(_0x458cf3){return db[_0x7275('0x44')][_0x7275('0x4d')]({'where':{'membername':_0x458cf3[_0x7275('0x1f')]},'individualHooks':!![]});}})[_0x7275('0x1c')](function(){if(_0x458cf3){return _0x458cf3[_0x7275('0x4e')]({'raw':!![]});}})[_0x7275('0x1c')](function(_0x3adc2c){if(_0x458cf3){if(_0x3adc2c){var _0x4d2412=[];_0x4466e2=_0x3adc2c;if(_0x4466e2[_0x7275('0x27')]){for(var _0x37c517=0x0;_0x37c517<_0x4466e2[_0x7275('0x27')];_0x37c517++){_0x4d2412['push'](db[_0x7275('0x44')][_0x7275('0x4f')]({'membername':_0x458cf3[_0x7275('0x1f')],'UserId':_0x458cf3['id'],'queue_name':_0x4466e2[_0x37c517]['name'],'VoiceQueueId':_0x4466e2[_0x37c517]['id'],'interface':_0x313f6f,'paused':_0x458cf3[_0x7275('0x48')]||![],'penalty':_0x4466e2[_0x37c517][_0x7275('0x50')]||0x0}));}return BPromise['all'](_0x4d2412);}}}})['then'](function(){if(_0x458cf3){return db[_0x7275('0x2f')][_0x7275('0xc')]({'where':{'membername':_0x458cf3[_0x7275('0x1f')],'exitAt':null}});}})[_0x7275('0x1c')](function(_0x4e98c7){if(_0x458cf3){if(_0x4e98c7&&_0x4e98c7[_0x7275('0x27')]){var _0x3e6f2d=[];_0x4e98c7[_0x7275('0x29')](function(_0xe317f7){_0x3e6f2d[_0x7275('0x2a')](_0xe317f7[_0x7275('0x24')]({'exitAt':moment()[_0x7275('0x22')](_0x7275('0x26'))}));});return BPromise[_0x7275('0x45')](_0x3e6f2d);}}})[_0x7275('0x1c')](function(){if(_0x458cf3){var _0xb9b547=[];var _0x3343ee=[];var _0xa93cc6=utils[_0x7275('0x51')]();var _0x3d4726={'membername':_0x458cf3[_0x7275('0x1f')],'interface':_0x313f6f,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x458cf3['role'],'internal':_0x458cf3['internal']};_0xa93cc6['forEach'](function(_0x1e6e76){_0xb9b547[_0x7275('0x2a')](_[_0x7275('0x52')]({'channel':_0x1e6e76,'type':_0x7275('0x53'),'data1':_0x7275('0x54'),'data2':_0x313f6f},_0x3d4726));if(_0x458cf3[_0x7275('0x48')]){_0x3343ee['push'](_[_0x7275('0x52')]({'channel':_0x1e6e76,'type':_0x7275('0x25'),'data1':_0x7275('0x55')},_0x3d4726));}});return db[_0x7275('0x2f')]['bulkCreate'](_0xb9b547[_0x7275('0x56')](_0x3343ee),{'individualHooks':!![]});}})[_0x7275('0x1c')](function(){if(_0x458cf3){return _0x458cf3['update']({'online':!![],'lastLoginAt':moment()[_0x7275('0x22')](_0x7275('0x26')),'voicePause':_0x458cf3[_0x7275('0x48')]||![],'mailPause':_0x458cf3['loginInPause']||![],'chatPause':_0x458cf3[_0x7275('0x48')]||![],'faxPause':_0x458cf3[_0x7275('0x48')]||![],'smsPause':_0x458cf3[_0x7275('0x48')]||![],'openchannelPause':_0x458cf3[_0x7275('0x48')]||![],'pauseType':_0x458cf3['loginInPause']?_0x7275('0x55'):null,'lastPauseAt':moment()[_0x7275('0x22')](_0x7275('0x26')),'interface':_0x313f6f});}})[_0x7275('0x1c')](function(_0x57099e){_0x55e24a(_0x57099e);})['catch'](function(_0x50e770){_0x3214a1(_0x345144[_0x7275('0x17')](0x1f4,_0x50e770[_0x7275('0x18')]));});});}; \ No newline at end of file +var _0x8409=['GetUser','catch','error','message','find','then','ShowUser','stringify','PauseUser','name','role','internal','interface','format','User\x20with\x20id\x20%s\x20not\x20found','params','UserVoiceQueueRt','update','MemberReport','findAll','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','isNil','body','type','uniqueid','bulkCreate','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','voicePause','mailPause','faxPause','openchannelPause','smsPause','whatsappPause','lastPauseAt','system','destroy','forEach','all','mobile','loginInPause','SIP/%s','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','getChannels','merge','LOGIN','callysquare','push','PAUSE','LOGININPAUSE','lodash','bluebird','ioredis','../../config/utils','../../config/environment','redis','defaults','localhost','./user.socket','register','User','options','raw','where','attributes','limit','include','map','model','info','debug'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x8409,0x1dd));var _0x9840=function(_0x3601f2,_0x34af7a){_0x3601f2=_0x3601f2-0x0;var _0xb360a3=_0x8409[_0x3601f2];return _0xb360a3;};'use strict';var _=require(_0x9840('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9840('0x1'));var Redis=require(_0x9840('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x9840('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x9840('0x4'));config[_0x9840('0x5')]=_[_0x9840('0x6')](config[_0x9840('0x5')],{'host':_0x9840('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9840('0x8'))[_0x9840('0x9')](socket);exports['GetUser']=function(_0x2f3007){var _0x5e5394=this;return new Promise(function(_0x2eb7e6,_0x381d9c){return db[_0x9840('0xa')]['findAll']({'raw':_0x2f3007['options']?_0x2f3007[_0x9840('0xb')][_0x9840('0xc')]===undefined?!![]:![]:!![],'where':_0x2f3007[_0x9840('0xb')]?_0x2f3007[_0x9840('0xb')][_0x9840('0xd')]||null:null,'attributes':_0x2f3007[_0x9840('0xb')]?_0x2f3007[_0x9840('0xb')][_0x9840('0xe')]||null:null,'limit':_0x2f3007[_0x9840('0xb')]?_0x2f3007[_0x9840('0xb')][_0x9840('0xf')]||null:null,'include':_0x2f3007['options']?_0x2f3007[_0x9840('0xb')][_0x9840('0x10')]?_[_0x9840('0x11')](_0x2f3007['options'][_0x9840('0x10')],function(_0x1aaaa6){return{'model':db[_0x1aaaa6[_0x9840('0x12')]],'as':_0x1aaaa6['as'],'attributes':_0x1aaaa6[_0x9840('0xe')],'include':_0x1aaaa6[_0x9840('0x10')]?_[_0x9840('0x11')](_0x1aaaa6[_0x9840('0x10')],function(_0x22a905){return{'model':db[_0x22a905['model']],'as':_0x22a905['as'],'attributes':_0x22a905[_0x9840('0xe')],'include':_0x22a905[_0x9840('0x10')]?_['map'](_0x22a905[_0x9840('0x10')],function(_0x761dd1){return{'model':db[_0x761dd1[_0x9840('0x12')]],'as':_0x761dd1['as'],'attributes':_0x761dd1[_0x9840('0xe')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f605c){logger[_0x9840('0x13')]('GetUser',_0x2f3007);logger[_0x9840('0x14')](_0x9840('0x15'),_0x2f3007,JSON['stringify'](_0x2f605c));_0x2eb7e6(_0x2f605c);})[_0x9840('0x16')](function(_0x48a2a2){logger[_0x9840('0x17')](_0x9840('0x15'),_0x48a2a2['message'],_0x2f3007);_0x381d9c(_0x5e5394[_0x9840('0x17')](0x1f4,_0x48a2a2[_0x9840('0x18')]));});});};exports['ShowUser']=function(_0x57bf87){var _0x191061=this;return new Promise(function(_0x9fc3d7,_0x10fa29){return db[_0x9840('0xa')][_0x9840('0x19')]({'raw':_0x57bf87[_0x9840('0xb')]?_0x57bf87[_0x9840('0xb')][_0x9840('0xc')]===undefined?!![]:![]:!![],'where':_0x57bf87['options']?_0x57bf87[_0x9840('0xb')][_0x9840('0xd')]||null:null,'attributes':_0x57bf87[_0x9840('0xb')]?_0x57bf87[_0x9840('0xb')][_0x9840('0xe')]||null:null,'include':_0x57bf87[_0x9840('0xb')]?_0x57bf87[_0x9840('0xb')]['include']?_[_0x9840('0x11')](_0x57bf87[_0x9840('0xb')][_0x9840('0x10')],function(_0x52452a){return{'model':db[_0x52452a[_0x9840('0x12')]],'as':_0x52452a['as'],'attributes':_0x52452a[_0x9840('0xe')],'include':_0x52452a['include']?_[_0x9840('0x11')](_0x52452a[_0x9840('0x10')],function(_0xdbc087){return{'model':db[_0xdbc087['model']],'as':_0xdbc087['as'],'attributes':_0xdbc087[_0x9840('0xe')],'include':_0xdbc087[_0x9840('0x10')]?_[_0x9840('0x11')](_0xdbc087[_0x9840('0x10')],function(_0x2d9223){return{'model':db[_0x2d9223[_0x9840('0x12')]],'as':_0x2d9223['as'],'attributes':_0x2d9223['attributes']};}):[]};}):[]};}):[]:[]})[_0x9840('0x1a')](function(_0x5e8e9b){logger[_0x9840('0x13')](_0x9840('0x1b'),_0x57bf87);logger[_0x9840('0x14')](_0x9840('0x1b'),_0x57bf87,JSON[_0x9840('0x1c')](_0x5e8e9b));_0x9fc3d7(_0x5e8e9b);})[_0x9840('0x16')](function(_0x5f8ded){logger[_0x9840('0x17')]('ShowUser',_0x5f8ded['message'],_0x57bf87);_0x10fa29(_0x191061[_0x9840('0x17')](0x1f4,_0x5f8ded[_0x9840('0x18')]));});});};exports[_0x9840('0x1d')]=function(_0xd3e11f){var _0x53d1b0;return db[_0x9840('0xa')][_0x9840('0x19')]({'where':_0xd3e11f[_0x9840('0xb')][_0x9840('0xd')]||{},'attributes':['id',_0x9840('0x1e'),_0x9840('0x1f'),_0x9840('0x20'),_0x9840('0x21')]})[_0x9840('0x1a')](function(_0x324b2c){if(!_0x324b2c){throw new Error(util[_0x9840('0x22')](_0x9840('0x23'),_0xd3e11f[_0x9840('0x24')]['id']));}_0x53d1b0=_0x324b2c;return db[_0x9840('0x25')][_0x9840('0x26')]({'paused':0x1},{'where':{'UserId':_0x53d1b0['id']},'individualHooks':!![]});})[_0x9840('0x1a')](function(){return db[_0x9840('0x27')][_0x9840('0x28')]({'where':{'membername':_0x53d1b0[_0x9840('0x1e')],'type':'PAUSE','exitAt':null}});})[_0x9840('0x1a')](function(_0x9e46d3){if(_0x9e46d3&&_0x9e46d3['length']){var _0x3bfe2f=moment()[_0x9840('0x22')](_0x9840('0x29'));for(var _0x37c891=0x0,_0x3330f1=_0x9e46d3[_0x9840('0x2a')];_0x37c891<_0x3330f1;_0x37c891++){_0x9e46d3[_0x37c891][_0x9840('0x2b')]({'exitAt':_0x3bfe2f});}}})[_0x9840('0x1a')](function(){var _0x197fcd=[];var _0x321d68=utils['getChannels']();_0x321d68['forEach'](function(_0x3db15f){_0x197fcd['push']({'channel':_0x3db15f,'membername':_0x53d1b0['name'],'interface':_[_0x9840('0x2c')](_0x53d1b0[_0x9840('0x21')])?util[_0x9840('0x22')]('SIP/%s',_0x53d1b0['name']):_0x53d1b0[_0x9840('0x21')],'type':'PAUSE','enterAt':moment()[_0x9840('0x22')](_0x9840('0x29')),'data1':_0xd3e11f[_0x9840('0x2d')][_0x9840('0x2e')]||'DEFAULT\x20PAUSE','role':_0x53d1b0[_0x9840('0x1f')],'internal':_0x53d1b0[_0x9840('0x20')],'uniqueid':_0xd3e11f['body'][_0x9840('0x2f')]||null});});return db[_0x9840('0x27')][_0x9840('0x30')](_0x197fcd,{'individualHooks':!![]});})['then'](function(){return _0x53d1b0[_0x9840('0x26')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0xd3e11f[_0x9840('0x2d')][_0x9840('0x2e')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x9840('0x22')](_0x9840('0x29'))});})[_0x9840('0x16')](function(_0xbab13f){throw _0xbab13f;});};exports['UnpauseUser']=function(_0x4169c6){return Promise[_0x9840('0x31')]()['then'](function(){if(_0x4169c6[_0x9840('0x2d')][_0x9840('0x32')]&&!utils[_0x9840('0x33')](_0x4169c6[_0x9840('0x2d')][_0x9840('0x32')])){throw new Error(util[_0x9840('0x22')](_0x9840('0x34'),_0x4169c6['body'][_0x9840('0x32')]));}return db[_0x9840('0xa')][_0x9840('0x35')]({'where':_0x4169c6[_0x9840('0xb')][_0x9840('0xd')]||{},'attributes':['id',_0x9840('0x1e'),_0x9840('0x1f'),_0x9840('0x20'),_0x9840('0x21'),'online',_0x9840('0x36'),_0x9840('0x37'),'chatPause',_0x9840('0x38'),_0x9840('0x39'),_0x9840('0x3a'),_0x9840('0x3b'),'pauseType',_0x9840('0x3c')]});})[_0x9840('0x1a')](function(_0x40def1){if(!_0x40def1){throw new Error(util[_0x9840('0x22')](_0x9840('0x23'),_0x4169c6[_0x9840('0x24')]['id']));}return _0x40def1['unpause'](_0x4169c6['body']['channel'],_0x9840('0x3d'));})[_0x9840('0x16')](function(_0x181710){throw _0x181710;});};exports['LogoutUser']=function(_0xc273c8){var _0x2bea60=this;return new Promise(function(_0x35c425,_0x4e0528){var _0x3e6978;return db[_0x9840('0xa')]['findOne']({'where':_0xc273c8[_0x9840('0xb')][_0x9840('0xd')]||{},'attributes':['id',_0x9840('0x1e')]})[_0x9840('0x1a')](function(_0x41621b){if(_0x41621b){_0x3e6978=_0x41621b;return db[_0x9840('0x25')][_0x9840('0x3e')]({'where':{'membername':_0x3e6978['name']},'individualHooks':!![]});}})['then'](function(){if(_0x3e6978){return db[_0x9840('0x27')][_0x9840('0x28')]({'where':{'membername':_0x3e6978[_0x9840('0x1e')],'exitAt':null}});}})[_0x9840('0x1a')](function(_0x1455e4){if(_0x3e6978){if(_0x1455e4&&_0x1455e4[_0x9840('0x2a')]){var _0x742704=[];_0x1455e4[_0x9840('0x3f')](function(_0x4c17c2){_0x742704['push'](_0x4c17c2[_0x9840('0x26')]({'exitAt':moment()[_0x9840('0x22')](_0x9840('0x29'))}));});return BPromise[_0x9840('0x40')](_0x742704);}}})[_0x9840('0x1a')](function(){if(_0x3e6978){return _0x3e6978[_0x9840('0x26')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x9840('0x1a')](function(_0x54041c){_0x35c425(_0x54041c);})[_0x9840('0x16')](function(_0x5cce3f){_0x4e0528(_0x2bea60['error'](0x1f4,_0x5cce3f[_0x9840('0x18')]));});});};exports['LoginUser']=function(_0x4102dc){var _0x214f9c=this;return new Promise(function(_0x55ab13,_0x4ae00b){var _0x17f9d2;var _0x10ef49;var _0xc92920;var _0x18c285;return db[_0x9840('0xa')][_0x9840('0x35')]({'where':_0x4102dc['options'][_0x9840('0xd')]||{},'attributes':['id','name',_0x9840('0x1f'),_0x9840('0x41'),'phone',_0x9840('0x20'),_0x9840('0x42'),'interface']})[_0x9840('0x1a')](function(_0x44943b){if(_0x44943b){_0x17f9d2=_0x44943b;_0x18c285=_0x4102dc['body']['interface']?_0x4102dc[_0x9840('0x2d')][_0x9840('0x21')]:util[_0x9840('0x22')](_0x9840('0x43'),_0x17f9d2[_0x9840('0x1e')]);return db[_0x9840('0xa')]['count']({'where':{'role':_0x9840('0x44'),'online':!![],'id':{'$ne':_0x17f9d2['id']}}});}})[_0x9840('0x1a')](function(_0x36ec0e){if(_0x36ec0e){_0xc92920=_0x36ec0e;return require(_0x9840('0x45'))[_0x9840('0x46')]();}})[_0x9840('0x1a')](function(_0x471b75){if(_0x471b75&&_0x471b75[_0x9840('0x47')]&&_0xc92920>=_0x471b75[_0x9840('0x47')]){throw new Error(_0x9840('0x48'));}})[_0x9840('0x1a')](function(){if(_0x17f9d2){return db[_0x9840('0x25')][_0x9840('0x3e')]({'where':{'membername':_0x17f9d2[_0x9840('0x1e')]},'individualHooks':!![]});}})['then'](function(){if(_0x17f9d2){return _0x17f9d2[_0x9840('0x49')]({'raw':!![]});}})['then'](function(_0x3f020f){if(_0x17f9d2){if(_0x3f020f){var _0x17616c=[];_0x10ef49=_0x3f020f;if(_0x10ef49[_0x9840('0x2a')]){for(var _0x4863ba=0x0;_0x4863ba<_0x10ef49[_0x9840('0x2a')];_0x4863ba++){_0x17616c['push'](db['UserVoiceQueueRt'][_0x9840('0x4a')]({'membername':_0x17f9d2[_0x9840('0x1e')],'UserId':_0x17f9d2['id'],'queue_name':_0x10ef49[_0x4863ba]['name'],'VoiceQueueId':_0x10ef49[_0x4863ba]['id'],'interface':_0x18c285,'paused':_0x17f9d2[_0x9840('0x42')]||![],'penalty':_0x10ef49[_0x4863ba][_0x9840('0x4b')]||0x0}));}return BPromise[_0x9840('0x40')](_0x17616c);}}}})[_0x9840('0x1a')](function(){if(_0x17f9d2){return db[_0x9840('0x27')]['findAll']({'where':{'membername':_0x17f9d2['name'],'exitAt':null}});}})[_0x9840('0x1a')](function(_0x614c78){if(_0x17f9d2){if(_0x614c78&&_0x614c78['length']){var _0x449667=[];_0x614c78[_0x9840('0x3f')](function(_0x5aa9bf){_0x449667['push'](_0x5aa9bf['update']({'exitAt':moment()[_0x9840('0x22')](_0x9840('0x29'))}));});return BPromise[_0x9840('0x40')](_0x449667);}}})[_0x9840('0x1a')](function(){if(_0x17f9d2){var _0x1afecf=[];var _0x1148f1=[];var _0x5ec8a3=utils[_0x9840('0x4c')]();var _0x36fef7={'membername':_0x17f9d2['name'],'interface':_0x18c285,'enterAt':moment()[_0x9840('0x22')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x17f9d2['role'],'internal':_0x17f9d2[_0x9840('0x20')]};_0x5ec8a3[_0x9840('0x3f')](function(_0x5c6f59){_0x1afecf['push'](_[_0x9840('0x4d')]({'channel':_0x5c6f59,'type':_0x9840('0x4e'),'data1':_0x9840('0x4f'),'data2':_0x18c285},_0x36fef7));if(_0x17f9d2['loginInPause']){_0x1148f1[_0x9840('0x50')](_['merge']({'channel':_0x5c6f59,'type':_0x9840('0x51'),'data1':'LOGININPAUSE'},_0x36fef7));}});return db[_0x9840('0x27')][_0x9840('0x30')](_0x1afecf['concat'](_0x1148f1),{'individualHooks':!![]});}})[_0x9840('0x1a')](function(){if(_0x17f9d2){return _0x17f9d2['update']({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x17f9d2[_0x9840('0x42')]||![],'mailPause':_0x17f9d2['loginInPause']||![],'chatPause':_0x17f9d2[_0x9840('0x42')]||![],'faxPause':_0x17f9d2['loginInPause']||![],'smsPause':_0x17f9d2[_0x9840('0x42')]||![],'openchannelPause':_0x17f9d2[_0x9840('0x42')]||![],'pauseType':_0x17f9d2['loginInPause']?_0x9840('0x52'):null,'lastPauseAt':moment()[_0x9840('0x22')](_0x9840('0x29')),'interface':_0x18c285});}})['then'](function(_0x3b1a9e){_0x55ab13(_0x3b1a9e);})[_0x9840('0x16')](function(_0x43be9f){_0x4ae00b(_0x214f9c[_0x9840('0x17')](0x1f4,_0x43be9f[_0x9840('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index d1145d6..002110a 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 _0xd614=['./user.events','save','remove','update','emit','removeListener','register','length','user:'];(function(_0x4fbc83,_0x4aaabb){var _0x304f6d=function(_0x68b43a){while(--_0x68b43a){_0x4fbc83['push'](_0x4fbc83['shift']());}};_0x304f6d(++_0x4aaabb);}(_0xd614,0x75));var _0x4d61=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xd614[_0x53ccf2];return _0x5a2964;};'use strict';var UserEvents=require(_0x4d61('0x0'));var events=[_0x4d61('0x1'),_0x4d61('0x2'),_0x4d61('0x3')];function createListener(_0x19f146,_0x50cb69){return function(_0x3c3989){_0x50cb69[_0x4d61('0x4')](_0x19f146,_0x3c3989);};}function removeListener(_0xc619f1,_0x3acd2a){return function(){UserEvents[_0x4d61('0x5')](_0xc619f1,_0x3acd2a);};}exports[_0x4d61('0x6')]=function(_0x4093cf){for(var _0x4ce797=0x0,_0x8d5611=events[_0x4d61('0x7')];_0x4ce797<_0x8d5611;_0x4ce797++){var _0x2d1cb7=events[_0x4ce797];var _0x1530b4=createListener(_0x4d61('0x8')+_0x2d1cb7,_0x4093cf);UserEvents['on'](_0x2d1cb7,_0x1530b4);}}; \ No newline at end of file +var _0xf803=['./user.events','save','remove','update','emit','register','user:'];(function(_0x2c7975,_0x66dbbb){var _0x78299e=function(_0x7314f8){while(--_0x7314f8){_0x2c7975['push'](_0x2c7975['shift']());}};_0x78299e(++_0x66dbbb);}(_0xf803,0xee));var _0x3f80=function(_0x54c438,_0x325e1e){_0x54c438=_0x54c438-0x0;var _0x3b367d=_0xf803[_0x54c438];return _0x3b367d;};'use strict';var UserEvents=require(_0x3f80('0x0'));var events=[_0x3f80('0x1'),_0x3f80('0x2'),_0x3f80('0x3')];function createListener(_0xb62be0,_0xe53c6f){return function(_0xdc2c8d){_0xe53c6f[_0x3f80('0x4')](_0xb62be0,_0xdc2c8d);};}function removeListener(_0x1914aa,_0x4d264c){return function(){UserEvents['removeListener'](_0x1914aa,_0x4d264c);};}exports[_0x3f80('0x5')]=function(_0x1c360a){for(var _0x201f80=0x0,_0x4493ca=events['length'];_0x201f80<_0x4493ca;_0x201f80++){var _0xe0397b=events[_0x201f80];var _0x7a2dcf=createListener(_0x3f80('0x6')+_0xe0397b,_0x1c360a);UserEvents['on'](_0xe0397b,_0x7a2dcf);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index e9f0175..54a5e79 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(_0x549996,_0xd04634){var _0x4de5d1=function(_0x1883a7){while(--_0x1883a7){_0x549996['push'](_0x549996['shift']());}};_0x4de5d1(++_0xd04634);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5ea326,_0x3d52fa){var _0x48cf87=function(_0xb15ba1){while(--_0xb15ba1){_0x5ea326['push'](_0x5ea326['shift']());}};_0x48cf87(++_0x3d52fa);}(_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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 4c3a627..d239d33 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 _0xbac5=['sequelize'];(function(_0x5ee6fd,_0xed138c){var _0x42adda=function(_0x2ee708){while(--_0x2ee708){_0x5ee6fd['push'](_0x5ee6fd['shift']());}};_0x42adda(++_0xed138c);}(_0xbac5,0xa9));var _0x5bac=function(_0xabfec4,_0x35076e){_0xabfec4=_0xabfec4-0x0;var _0x7bafa2=_0xbac5[_0xabfec4];return _0x7bafa2;};'use strict';var Sequelize=require(_0x5bac('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xfe9b=['INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe9b,0x1d9));var _0xbfe9=function(_0xe8e98,_0x3a32d9){_0xe8e98=_0xe8e98-0x0;var _0x2d16c4=_0xfe9b[_0xe8e98];return _0x2d16c4;};'use strict';var Sequelize=require(_0xbfe9('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbfe9('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 46ac53e..0b660b8 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 _0x6476=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','UserChatQueue','lodash'];(function(_0x380ec9,_0x5512d1){var _0xba9c35=function(_0x33cf4f){while(--_0x33cf4f){_0x380ec9['push'](_0x380ec9['shift']());}};_0xba9c35(++_0x5512d1);}(_0x6476,0x11f));var _0x6647=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x6476[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x6647('0x0'));var util=require(_0x6647('0x1'));var logger=require(_0x6647('0x2'))(_0x6647('0x3'));var moment=require(_0x6647('0x4'));var BPromise=require(_0x6647('0x5'));var rp=require(_0x6647('0x6'));var fs=require('fs');var path=require(_0x6647('0x7'));var rimraf=require(_0x6647('0x8'));var config=require(_0x6647('0x9'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x52972c,_0x222f56){return _0x52972c[_0x6647('0xa')](_0x6647('0xb'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x69bd=['moment','bluebird','request-promise','path','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','util','../../config/logger','api'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x69bd,0x14f));var _0xd69b=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x69bd[_0x45bf86];return _0x1f02b7;};'use strict';var _=require('lodash');var util=require(_0xd69b('0x0'));var logger=require(_0xd69b('0x1'))(_0xd69b('0x2'));var moment=require(_0xd69b('0x3'));var BPromise=require(_0xd69b('0x4'));var rp=require(_0xd69b('0x5'));var fs=require('fs');var path=require(_0xd69b('0x6'));var rimraf=require('rimraf');var config=require(_0xd69b('0x7'));var attributes=require(_0xd69b('0x8'));module[_0xd69b('0x9')]=function(_0x2fe594,_0x2a290d){return _0x2fe594[_0xd69b('0xa')](_0xd69b('0xb'),attributes,{'tableName':_0xd69b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 8a328b3..e05e3bc 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 _0x7ea7=['request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserChatQueue,\x20%s,\x20%s'];(function(_0x5bc158,_0x20ba90){var _0x288d43=function(_0x4e1c7f){while(--_0x4e1c7f){_0x5bc158['push'](_0x5bc158['shift']());}};_0x288d43(++_0x20ba90);}(_0x7ea7,0x15a));var _0x77ea=function(_0x28d225,_0x43be18){_0x28d225=_0x28d225-0x0;var _0x1f79e1=_0x7ea7[_0x28d225];return _0x1f79e1;};'use strict';var _=require(_0x77ea('0x0'));var util=require(_0x77ea('0x1'));var moment=require(_0x77ea('0x2'));var BPromise=require('bluebird');var rs=require(_0x77ea('0x3'));var fs=require('fs');var Redis=require(_0x77ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x77ea('0x5'))(_0x77ea('0x6'));var config=require(_0x77ea('0x7'));var jayson=require(_0x77ea('0x8'));var client=jayson['client'][_0x77ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c3b77,_0x31e817,_0x1e3cc2){return new BPromise(function(_0x4f49f1,_0x17cf7b){return client[_0x77ea('0xa')](_0x3c3b77,_0x1e3cc2)[_0x77ea('0xb')](function(_0x394503){logger[_0x77ea('0xc')](_0x77ea('0xd'),_0x31e817,_0x77ea('0xe'));logger[_0x77ea('0xf')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x31e817,_0x77ea('0xe'),JSON[_0x77ea('0x10')](_0x394503));if(_0x394503[_0x77ea('0x11')]){if(_0x394503[_0x77ea('0x11')]['code']===0x1f4){logger['error'](_0x77ea('0xd'),_0x31e817,_0x394503[_0x77ea('0x11')]['message']);return _0x17cf7b(_0x394503['error'][_0x77ea('0x12')]);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x31e817,_0x394503[_0x77ea('0x11')][_0x77ea('0x12')]);return _0x4f49f1(_0x394503[_0x77ea('0x11')]['message']);}else{logger[_0x77ea('0xc')](_0x77ea('0xd'),_0x31e817,'request\x20sent');_0x4f49f1(_0x394503['result']['message']);}})[_0x77ea('0x13')](function(_0x3255b7){logger[_0x77ea('0x11')](_0x77ea('0xd'),_0x31e817,_0x3255b7);_0x17cf7b(_0x3255b7);});});} \ No newline at end of file +var _0xef37=['lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xef37,0xdc));var _0x7ef3=function(_0x2d1d2c,_0x5b31ea){_0x2d1d2c=_0x2d1d2c-0x0;var _0x46f015=_0xef37[_0x2d1d2c];return _0x46f015;};'use strict';var _=require(_0x7ef3('0x0'));var util=require(_0x7ef3('0x1'));var moment=require(_0x7ef3('0x2'));var BPromise=require('bluebird');var rs=require(_0x7ef3('0x3'));var fs=require('fs');var Redis=require(_0x7ef3('0x4'));var db=require(_0x7ef3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7ef3('0x6'));var config=require(_0x7ef3('0x7'));var jayson=require(_0x7ef3('0x8'));var client=jayson[_0x7ef3('0x9')][_0x7ef3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc2823d,_0x1740ae,_0x3f37cf){return new BPromise(function(_0x4ace7b,_0x4f2444){return client[_0x7ef3('0xb')](_0xc2823d,_0x3f37cf)[_0x7ef3('0xc')](function(_0x4145b6){logger[_0x7ef3('0xd')](_0x7ef3('0xe'),_0x1740ae,'request\x20sent');logger[_0x7ef3('0xf')](_0x7ef3('0x10'),_0x1740ae,_0x7ef3('0x11'),JSON[_0x7ef3('0x12')](_0x4145b6));if(_0x4145b6['error']){if(_0x4145b6[_0x7ef3('0x13')]['code']===0x1f4){logger[_0x7ef3('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x1740ae,_0x4145b6['error']['message']);return _0x4f2444(_0x4145b6[_0x7ef3('0x13')][_0x7ef3('0x14')]);}logger[_0x7ef3('0x13')](_0x7ef3('0xe'),_0x1740ae,_0x4145b6[_0x7ef3('0x13')]['message']);return _0x4ace7b(_0x4145b6[_0x7ef3('0x13')][_0x7ef3('0x14')]);}else{logger[_0x7ef3('0xd')](_0x7ef3('0xe'),_0x1740ae,_0x7ef3('0x11'));_0x4ace7b(_0x4145b6[_0x7ef3('0x15')]['message']);}})['catch'](function(_0x34e86b){logger['error'](_0x7ef3('0xe'),_0x1740ae,_0x34e86b);_0x4f2444(_0x34e86b);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index b79aa82..a79191b 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2eddae,_0x11711e){var _0x1b82ba=function(_0x152988){while(--_0x152988){_0x2eddae['push'](_0x2eddae['shift']());}};_0x1b82ba(++_0x11711e);}(_0x70e0,0x17b));var _0x070e=function(_0x125aa7,_0x1171a0){_0x125aa7=_0x125aa7-0x0;var _0x5be49e=_0x70e0[_0x125aa7];return _0x5be49e;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5b21c5,_0x3cc561){var _0x1bcceb=function(_0x2b451b){while(--_0x2b451b){_0x5b21c5['push'](_0x5b21c5['shift']());}};_0x1bcceb(++_0x3cc561);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x199c03,_0x3254aa){_0x199c03=_0x199c03-0x0;var _0x11a7d4=_0xcb91[_0x199c03];return _0x11a7d4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index e275355..5610d12 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 _0x016b=['sequelize','exports','INTEGER','STRING'];(function(_0x1fdd08,_0x112626){var _0x318f18=function(_0x4784d5){while(--_0x4784d5){_0x1fdd08['push'](_0x1fdd08['shift']());}};_0x318f18(++_0x112626);}(_0x016b,0x1ac));var _0xb016=function(_0x5c5092,_0xdc1960){_0x5c5092=_0x5c5092-0x0;var _0x414cbf=_0x016b[_0x5c5092];return _0x414cbf;};'use strict';var Sequelize=require(_0xb016('0x0'));module[_0xb016('0x1')]={'penalty':{'type':Sequelize[_0xb016('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xb016('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xb016('0x3')]}}; \ No newline at end of file +var _0xaf8c=['sequelize','exports','INTEGER'];(function(_0x7d005a,_0x2c0600){var _0xf97fff=function(_0x109b28){while(--_0x109b28){_0x7d005a['push'](_0x7d005a['shift']());}};_0xf97fff(++_0x2c0600);}(_0xaf8c,0x189));var _0xcaf8=function(_0x41dc37,_0x3876cf){_0x41dc37=_0x41dc37-0x0;var _0x343bb1=_0xaf8c[_0x41dc37];return _0x343bb1;};'use strict';var Sequelize=require(_0xcaf8('0x0'));module[_0xcaf8('0x1')]={'penalty':{'type':Sequelize[_0xcaf8('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xcaf8('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 167bc7d..92359eb 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 _0x685e=['rimraf','../../config/environment','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','util','../../config/logger','api','request-promise','path'];(function(_0x3b5587,_0x22a6f4){var _0x3fbb62=function(_0x41f5ce){while(--_0x41f5ce){_0x3b5587['push'](_0x3b5587['shift']());}};_0x3fbb62(++_0x22a6f4);}(_0x685e,0xa0));var _0xe685=function(_0x1b1f88,_0x3fe1cb){_0x1b1f88=_0x1b1f88-0x0;var _0x5045b9=_0x685e[_0x1b1f88];return _0x5045b9;};'use strict';var _=require('lodash');var util=require(_0xe685('0x0'));var logger=require(_0xe685('0x1'))(_0xe685('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe685('0x3'));var fs=require('fs');var path=require(_0xe685('0x4'));var rimraf=require(_0xe685('0x5'));var config=require(_0xe685('0x6'));var attributes=require(_0xe685('0x7'));module[_0xe685('0x8')]=function(_0x4b1ea6,_0x5cf00d){return _0x4b1ea6['define'](_0xe685('0x9'),attributes,{'tableName':_0xe685('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f84=['./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4d5762,_0x367d7b){var _0x453cde=function(_0x414309){while(--_0x414309){_0x4d5762['push'](_0x4d5762['shift']());}};_0x453cde(++_0x367d7b);}(_0x5f84,0x16d));var _0x45f8=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x5f84[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x45f8('0x0'));var util=require('util');var logger=require(_0x45f8('0x1'))('api');var moment=require(_0x45f8('0x2'));var BPromise=require(_0x45f8('0x3'));var rp=require(_0x45f8('0x4'));var fs=require('fs');var path=require(_0x45f8('0x5'));var rimraf=require('rimraf');var config=require(_0x45f8('0x6'));var attributes=require(_0x45f8('0x7'));module[_0x45f8('0x8')]=function(_0x2c3802,_0xceda18){return _0x2c3802[_0x45f8('0x9')](_0x45f8('0xa'),attributes,{'tableName':_0x45f8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 6d11c77..9beeffe 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 _0x752f=['error','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserFaxQueue,\x20%s,\x20%s','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xa93502,_0xf84e55){var _0x2e6992=function(_0x368f98){while(--_0x368f98){_0xa93502['push'](_0xa93502['shift']());}};_0x2e6992(++_0xf84e55);}(_0x752f,0x10d));var _0xf752=function(_0xb0c30c,_0x29320d){_0xb0c30c=_0xb0c30c-0x0;var _0x3d4810=_0x752f[_0xb0c30c];return _0x3d4810;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf752('0x0'));var BPromise=require(_0xf752('0x1'));var rs=require(_0xf752('0x2'));var fs=require('fs');var Redis=require(_0xf752('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf752('0x4'));var logger=require(_0xf752('0x5'))(_0xf752('0x6'));var config=require(_0xf752('0x7'));var jayson=require(_0xf752('0x8'));var client=jayson[_0xf752('0x9')][_0xf752('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53dd2f,_0x18398c,_0x3ee5c1){return new BPromise(function(_0x574f0f,_0x5646a0){return client[_0xf752('0xb')](_0x53dd2f,_0x3ee5c1)[_0xf752('0xc')](function(_0x27a21f){logger['info'](_0xf752('0xd'),_0x18398c,'request\x20sent');logger['debug'](_0xf752('0xe'),_0x18398c,_0xf752('0xf'),JSON[_0xf752('0x10')](_0x27a21f));if(_0x27a21f[_0xf752('0x11')]){if(_0x27a21f[_0xf752('0x11')]['code']===0x1f4){logger[_0xf752('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x18398c,_0x27a21f[_0xf752('0x11')]['message']);return _0x5646a0(_0x27a21f[_0xf752('0x11')][_0xf752('0x12')]);}logger[_0xf752('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x18398c,_0x27a21f['error']['message']);return _0x574f0f(_0x27a21f[_0xf752('0x11')][_0xf752('0x12')]);}else{logger[_0xf752('0x13')](_0xf752('0xd'),_0x18398c,'request\x20sent');_0x574f0f(_0x27a21f[_0xf752('0x14')]['message']);}})[_0xf752('0x15')](function(_0x5d235e){logger[_0xf752('0x11')](_0xf752('0xd'),_0x18398c,_0x5d235e);_0x5646a0(_0x5d235e);});});} \ No newline at end of file +var _0x4a53=['code','message','result','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2751e8,_0x439ced){var _0x416d4c=function(_0x566223){while(--_0x566223){_0x2751e8['push'](_0x2751e8['shift']());}};_0x416d4c(++_0x439ced);}(_0x4a53,0x1d2));var _0x34a5=function(_0x25fc91,_0x1bc6f5){_0x25fc91=_0x25fc91-0x0;var _0x41eca1=_0x4a53[_0x25fc91];return _0x41eca1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x34a5('0x0'));var BPromise=require(_0x34a5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34a5('0x2'))['db'];var utils=require(_0x34a5('0x3'));var logger=require(_0x34a5('0x4'))(_0x34a5('0x5'));var config=require(_0x34a5('0x6'));var jayson=require(_0x34a5('0x7'));var client=jayson[_0x34a5('0x8')][_0x34a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15ee3b,_0x37f9a1,_0x1f3b51){return new BPromise(function(_0x33d91e,_0x4deb7b){return client['request'](_0x15ee3b,_0x1f3b51)[_0x34a5('0xa')](function(_0x21029a){logger[_0x34a5('0xb')](_0x34a5('0xc'),_0x37f9a1,_0x34a5('0xd'));logger['debug'](_0x34a5('0xe'),_0x37f9a1,_0x34a5('0xd'),JSON[_0x34a5('0xf')](_0x21029a));if(_0x21029a[_0x34a5('0x10')]){if(_0x21029a[_0x34a5('0x10')][_0x34a5('0x11')]===0x1f4){logger[_0x34a5('0x10')](_0x34a5('0xc'),_0x37f9a1,_0x21029a[_0x34a5('0x10')]['message']);return _0x4deb7b(_0x21029a[_0x34a5('0x10')][_0x34a5('0x12')]);}logger['error'](_0x34a5('0xc'),_0x37f9a1,_0x21029a['error'][_0x34a5('0x12')]);return _0x33d91e(_0x21029a[_0x34a5('0x10')][_0x34a5('0x12')]);}else{logger['info'](_0x34a5('0xc'),_0x37f9a1,_0x34a5('0xd'));_0x33d91e(_0x21029a[_0x34a5('0x13')]['message']);}})[_0x34a5('0x14')](function(_0x3815aa){logger['error'](_0x34a5('0xc'),_0x37f9a1,_0x3815aa);_0x4deb7b(_0x3815aa);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 2327d31..de8ca97 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3d6e68,_0x455d10){var _0x51f6e4=function(_0x1d067c){while(--_0x1d067c){_0x3d6e68['push'](_0x3d6e68['shift']());}};_0x51f6e4(++_0x455d10);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2b1aad,_0x4ec6cc){var _0x16fed7=function(_0x537fb7){while(--_0x537fb7){_0x2b1aad['push'](_0x2b1aad['shift']());}};_0x16fed7(++_0x4ec6cc);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 17cf835..22278f1 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 _0xb828=['sequelize','exports','INTEGER'];(function(_0x2d9922,_0x59fd51){var _0xaecfe=function(_0x58aafd){while(--_0x58aafd){_0x2d9922['push'](_0x2d9922['shift']());}};_0xaecfe(++_0x59fd51);}(_0xb828,0x120));var _0x8b82=function(_0x24b773,_0x392c26){_0x24b773=_0x24b773-0x0;var _0x35f6c9=_0xb828[_0x24b773];return _0x35f6c9;};'use strict';var Sequelize=require(_0x8b82('0x0'));module[_0x8b82('0x1')]={'penalty':{'type':Sequelize[_0x8b82('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1aa4=['sequelize','exports','INTEGER'];(function(_0x83ac11,_0x46c46c){var _0x41c32a=function(_0x2141c6){while(--_0x2141c6){_0x83ac11['push'](_0x83ac11['shift']());}};_0x41c32a(++_0x46c46c);}(_0x1aa4,0x171));var _0x41aa=function(_0x3a7ace,_0x5976bb){_0x3a7ace=_0x3a7ace-0x0;var _0x296304=_0x1aa4[_0x3a7ace];return _0x296304;};'use strict';var Sequelize=require(_0x41aa('0x0'));module[_0x41aa('0x1')]={'penalty':{'type':Sequelize[_0x41aa('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 304a853..45a7e0a 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 _0x60da=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','user_has_mail_queues','lodash'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x60da,0x86));var _0xa60d=function(_0x47ab7a,_0x55d05c){_0x47ab7a=_0x47ab7a-0x0;var _0x43878c=_0x60da[_0x47ab7a];return _0x43878c;};'use strict';var _=require(_0xa60d('0x0'));var util=require('util');var logger=require(_0xa60d('0x1'))(_0xa60d('0x2'));var moment=require(_0xa60d('0x3'));var BPromise=require(_0xa60d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa60d('0x5'));var rimraf=require(_0xa60d('0x6'));var config=require(_0xa60d('0x7'));var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x49d43e,_0x1c2942){return _0x49d43e['define']('UserMailQueue',attributes,{'tableName':_0xa60d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x73e8=['rimraf','./userMailQueue.attributes','define','UserMailQueue','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x45c8c3,_0x54d7cf){var _0x40014f=function(_0x541ee2){while(--_0x541ee2){_0x45c8c3['push'](_0x45c8c3['shift']());}};_0x40014f(++_0x54d7cf);}(_0x73e8,0xca));var _0x873e=function(_0x268041,_0x5335a5){_0x268041=_0x268041-0x0;var _0x140f6e=_0x73e8[_0x268041];return _0x140f6e;};'use strict';var _=require(_0x873e('0x0'));var util=require(_0x873e('0x1'));var logger=require(_0x873e('0x2'))('api');var moment=require(_0x873e('0x3'));var BPromise=require(_0x873e('0x4'));var rp=require(_0x873e('0x5'));var fs=require('fs');var path=require(_0x873e('0x6'));var rimraf=require(_0x873e('0x7'));var config=require('../../config/environment');var attributes=require(_0x873e('0x8'));module['exports']=function(_0x563165,_0x33d9ec){return _0x563165[_0x873e('0x9')](_0x873e('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 732ea6a..7ccb52b 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 _0x4b84=['../../config/logger','rpc','http','then','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserMailQueue,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0x1b0c47,_0x436272){var _0x3c3a5f=function(_0x3aabf4){while(--_0x3aabf4){_0x1b0c47['push'](_0x1b0c47['shift']());}};_0x3c3a5f(++_0x436272);}(_0x4b84,0x1cc));var _0x44b8=function(_0x289891,_0x49a0fa){_0x289891=_0x289891-0x0;var _0x31cf2e=_0x4b84[_0x289891];return _0x31cf2e;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});} \ No newline at end of file +var _0xa41a=['rpc','../../config/environment','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x118f51,_0x1772f5){var _0x1a05f2=function(_0x10f96f){while(--_0x10f96f){_0x118f51['push'](_0x118f51['shift']());}};_0x1a05f2(++_0x1772f5);}(_0xa41a,0x6b));var _0xaa41=function(_0x67c0ea,_0x240b31){_0x67c0ea=_0x67c0ea-0x0;var _0x3c7d95=_0xa41a[_0x67c0ea];return _0x3c7d95;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 22ea928..08e7782 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 _0x674a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','multer','util','path','connect-timeout','express','Router'];(function(_0x357e06,_0x17e4e9){var _0x137954=function(_0x3b9080){while(--_0x3b9080){_0x357e06['push'](_0x357e06['shift']());}};_0x137954(++_0x17e4e9);}(_0x674a,0xbe));var _0xa674=function(_0x5256f0,_0x5ce716){_0x5256f0=_0x5256f0-0x0;var _0x116b31=_0x674a[_0x5256f0];return _0x116b31;};'use strict';var multer=require(_0xa674('0x0'));var util=require(_0xa674('0x1'));var path=require(_0xa674('0x2'));var timeout=require(_0xa674('0x3'));var express=require(_0xa674('0x4'));var router=express[_0xa674('0x5')]();var fs_extra=require(_0xa674('0x6'));var auth=require(_0xa674('0x7'));var interaction=require(_0xa674('0x8'));var config=require(_0xa674('0x9'));var controller=require(_0xa674('0xa'));router[_0xa674('0xb')]('/',auth[_0xa674('0xc')](),controller[_0xa674('0xd')]);module['exports']=router; \ No newline at end of file +var _0xa0a6=['../../components/interaction/service','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x5d4e4c,_0x27eea1){var _0x206994=function(_0x170a8b){while(--_0x170a8b){_0x5d4e4c['push'](_0x5d4e4c['shift']());}};_0x206994(++_0x27eea1);}(_0xa0a6,0xba));var _0x6a0a=function(_0x2f94e2,_0x3b1a95){_0x2f94e2=_0x2f94e2-0x0;var _0x5e3242=_0xa0a6[_0x2f94e2];return _0x5e3242;};'use strict';var multer=require(_0x6a0a('0x0'));var util=require(_0x6a0a('0x1'));var path=require('path');var timeout=require(_0x6a0a('0x2'));var express=require(_0x6a0a('0x3'));var router=express[_0x6a0a('0x4')]();var fs_extra=require(_0x6a0a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6a0a('0x6'));var config=require('../../config/environment');var controller=require(_0x6a0a('0x7'));router[_0x6a0a('0x8')]('/',auth[_0x6a0a('0x9')](),controller[_0x6a0a('0xa')]);module[_0x6a0a('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 2a41096..7e3ca04 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 _0x69b5=['TEXT','STRING','BOOLEAN','exports'];(function(_0x2c04cf,_0x2715b7){var _0x74957d=function(_0x42f57f){while(--_0x42f57f){_0x2c04cf['push'](_0x2c04cf['shift']());}};_0x74957d(++_0x2715b7);}(_0x69b5,0x1ab));var _0x569b=function(_0x44c325,_0x19c625){_0x44c325=_0x44c325-0x0;var _0x55f09e=_0x69b5[_0x44c325];return _0x55f09e;};'use strict';var Sequelize=require('sequelize');module[_0x569b('0x0')]={'body':{'type':Sequelize[_0x569b('0x1')]},'senderName':{'type':Sequelize[_0x569b('0x2')]},'recipientsId':{'type':Sequelize[_0x569b('0x1')]},'recipientsDescription':{'type':Sequelize[_0x569b('0x2')]},'beep':{'type':Sequelize[_0x569b('0x3')]}}; \ No newline at end of file +var _0x10a2=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x36f69a,_0x3c5559){var _0x4e1891=function(_0x49c127){while(--_0x49c127){_0x36f69a['push'](_0x36f69a['shift']());}};_0x4e1891(++_0x3c5559);}(_0x10a2,0x14a));var _0x210a=function(_0x363d60,_0x2f19c3){_0x363d60=_0x363d60-0x0;var _0x3635ab=_0x10a2[_0x363d60];return _0x3635ab;};'use strict';var Sequelize=require(_0x210a('0x0'));module[_0x210a('0x1')]={'body':{'type':Sequelize[_0x210a('0x2')]},'senderName':{'type':Sequelize[_0x210a('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x210a('0x3')]},'beep':{'type':Sequelize[_0x210a('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 9264955..56f39d4 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 _0xef31=['transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','startCase','union','ids','replace','queue','flatten','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','then','destroy','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xef31,0x1a8));var _0x1ef3=function(_0x714d60,_0x1ede1f){_0x714d60=_0x714d60-0x0;var _0x25b2f1=_0xef31[_0x714d60];return _0x25b2f1;};'use strict';var emlformat=require(_0x1ef3('0x0'));var rimraf=require(_0x1ef3('0x1'));var zipdir=require(_0x1ef3('0x2'));var jsonpatch=require(_0x1ef3('0x3'));var rp=require(_0x1ef3('0x4'));var moment=require('moment');var BPromise=require(_0x1ef3('0x5'));var Mustache=require(_0x1ef3('0x6'));var util=require(_0x1ef3('0x7'));var path=require('path');var sox=require(_0x1ef3('0x8'));var csv=require(_0x1ef3('0x9'));var ejs=require(_0x1ef3('0xa'));var fs=require('fs');var fs_extra=require(_0x1ef3('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1ef3('0xc'));var jsforce=require(_0x1ef3('0xd'));var deskjs=require(_0x1ef3('0xe'));var toCsv=require(_0x1ef3('0x9'));var querystring=require('querystring');var Papa=require(_0x1ef3('0xf'));var Redis=require(_0x1ef3('0x10'));var authService=require(_0x1ef3('0x11'));var qs=require(_0x1ef3('0x12'));var as=require(_0x1ef3('0x13'));var hardwareService=require(_0x1ef3('0x14'));var logger=require(_0x1ef3('0x15'))(_0x1ef3('0x16'));var utils=require('../../config/utils');var config=require(_0x1ef3('0x17'));var licenseUtil=require(_0x1ef3('0x18'));var db=require(_0x1ef3('0x19'))['db'];config[_0x1ef3('0x1a')]=_[_0x1ef3('0x1b')](config[_0x1ef3('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1ef3('0x1a')]));require('./userNotification.socket')[_0x1ef3('0x1c')](socket);function respondWithStatusCode(_0x304838,_0x2e5ffe){_0x2e5ffe=_0x2e5ffe||0xcc;return function(_0x5adbf5){if(_0x5adbf5){return _0x304838[_0x1ef3('0x1d')](_0x2e5ffe);}return _0x304838[_0x1ef3('0x1e')](_0x2e5ffe)[_0x1ef3('0x1f')]();};}function respondWithResult(_0x4618ce,_0x283124){_0x283124=_0x283124||0xc8;return function(_0x1f130b){if(_0x1f130b){return _0x4618ce[_0x1ef3('0x1e')](_0x283124)[_0x1ef3('0x20')](_0x1f130b);}};}function respondWithFilteredResult(_0x1eb2f4,_0x26933e){return function(_0xafb1a0){if(_0xafb1a0){var _0x588c6d=typeof _0x26933e[_0x1ef3('0x21')]==='undefined'&&typeof _0x26933e[_0x1ef3('0x22')]==='undefined';var _0x59eade=_0xafb1a0[_0x1ef3('0x23')];var _0x338b90=_0x588c6d?0x0:_0x26933e[_0x1ef3('0x21')];var _0x239cfc=_0x588c6d?_0xafb1a0[_0x1ef3('0x23')]:_0x26933e[_0x1ef3('0x21')]+_0x26933e['limit'];var _0x6bb48c;if(_0x239cfc>=_0x59eade){_0x239cfc=_0x59eade;_0x6bb48c=0xc8;}else{_0x6bb48c=0xce;}_0x1eb2f4[_0x1ef3('0x1e')](_0x6bb48c);return _0x1eb2f4['set'](_0x1ef3('0x24'),_0x338b90+'-'+_0x239cfc+'/'+_0x59eade)['json'](_0xafb1a0);}return null;};}function patchUpdates(_0x3c1a37){return function(_0x512c63){try{jsonpatch['apply'](_0x512c63,_0x3c1a37,!![]);}catch(_0xb91016){return BPromise[_0x1ef3('0x25')](_0xb91016);}return _0x512c63[_0x1ef3('0x26')]();};}function saveUpdates(_0x3a69be,_0x7ef248){return function(_0x36bc77){if(_0x36bc77){return _0x36bc77['update'](_0x3a69be)[_0x1ef3('0x27')](function(_0x364f5f){return _0x364f5f;});}return null;};}function removeEntity(_0x2ef323,_0x25e676){return function(_0xe3c66e){if(_0xe3c66e){return _0xe3c66e[_0x1ef3('0x28')]()[_0x1ef3('0x27')](function(){_0x2ef323[_0x1ef3('0x1e')](0xcc)[_0x1ef3('0x1f')]();});}};}function handleEntityNotFound(_0x4b1a14,_0x2291ff){return function(_0x1315a1){if(!_0x1315a1){_0x4b1a14['sendStatus'](0x194);}return _0x1315a1;};}function handleError(_0x15f5f2,_0x15a460){_0x15a460=_0x15a460||0x1f4;return function(_0x322824){logger[_0x1ef3('0x29')](_0x322824[_0x1ef3('0x2a')]);if(_0x322824[_0x1ef3('0x2b')]){delete _0x322824[_0x1ef3('0x2b')];}_0x15f5f2[_0x1ef3('0x1e')](_0x15a460)[_0x1ef3('0x2c')](_0x322824);};}exports[_0x1ef3('0x2d')]=function(_0x215706,_0x37a66f,_0x3ac0d1){if(!_0x215706[_0x1ef3('0x2e')][_0x1ef3('0x2f')](_0x1ef3('0x30'))&&!_0x215706['body'][_0x1ef3('0x2f')](_0x1ef3('0x31'))){throw new db[(_0x1ef3('0x32'))][(_0x1ef3('0x33'))](_0x1ef3('0x34'));}else{if(_0x215706[_0x1ef3('0x2e')]['hasOwnProperty'](_0x1ef3('0x31'))&&!_0x215706[_0x1ef3('0x2e')]['hasOwnProperty'](_0x1ef3('0x35'))){throw new db['Sequelize'][(_0x1ef3('0x33'))](_0x1ef3('0x36'));}if(!_0x215706['body'][_0x1ef3('0x2f')](_0x1ef3('0x37'))){throw new db[(_0x1ef3('0x32'))][(_0x1ef3('0x33'))](_0x1ef3('0x38'));}else{try{var _0x5c6263=JSON['parse'](_0x215706['body'][_0x1ef3('0x37')]);}catch(_0x392e8e){logger['error'](_0x392e8e);throw new db['Sequelize'][(_0x1ef3('0x33'))](_0x1ef3('0x39'));}var _0x418f8f=[_0x1ef3('0x3a'),_0x1ef3('0x3b'),_0x1ef3('0x3c'),_0x1ef3('0x3d'),_0x1ef3('0x3e'),_0x1ef3('0x3f'),_0x1ef3('0x40'),_0x1ef3('0x41'),_0x1ef3('0x42')];if(_['some'](_0x5c6263,function(_0xc92f1d){return!_[_0x1ef3('0x43')](_0x418f8f,_0xc92f1d[_0x1ef3('0x44')][_0x1ef3('0x45')]());})){throw new db[(_0x1ef3('0x32'))][(_0x1ef3('0x33'))](_0x1ef3('0x46'));}}}var _0x270d31={};_0x270d31['senderName']=_0x215706[_0x1ef3('0x2e')][_0x1ef3('0x2f')]('senderName')?_0x215706['body'][_0x1ef3('0x47')]:_0x215706[_0x1ef3('0x42')][_0x1ef3('0x48')];_0x270d31[_0x1ef3('0x49')]=_[_0x1ef3('0x4a')](_0x215706[_0x1ef3('0x2e')]['recipientsDescription'])?null:_0x215706[_0x1ef3('0x2e')][_0x1ef3('0x49')];_0x270d31['beep']=_0x215706['body'][_0x1ef3('0x4b')]||![];_0x270d31[_0x1ef3('0x4c')]=_0x215706[_0x1ef3('0x42')]['id'];return getContent(_0x215706['body'])['then'](function(_0x3158e4){_0x270d31[_0x1ef3('0x2e')]=_0x3158e4;return getRecipients(_0x5c6263);})[_0x1ef3('0x27')](function(_0x18ec7c){_0x270d31[_0x1ef3('0x4d')]=_[_0x1ef3('0x4e')](_0x18ec7c)[_0x1ef3('0x4f')](',');return db[_0x1ef3('0x50')][_0x1ef3('0x51')](function(_0x2e1fde){return db[_0x1ef3('0x52')][_0x1ef3('0x53')](_0x270d31,{'raw':!![],'transaction':_0x2e1fde})[_0x1ef3('0x27')](function(_0x245368){var _0x4bb225={'sender':_0x270d31['senderName'],'description':_0x270d31[_0x1ef3('0x49')],'content':_0x270d31[_0x1ef3('0x2e')],'beep':_0x270d31[_0x1ef3('0x4b')]};_0x18ec7c[_0x1ef3('0x54')](function(_0x4e21b0){_0x4bb225[_0x1ef3('0x55')]=_0x4e21b0;socket[_0x1ef3('0x56')](_0x1ef3('0x57'),_0x4bb225);});return _0x245368;});});})['then'](respondWithResult(_0x37a66f,0xc9))['catch'](handleError(_0x37a66f,null));};function getContent(_0x100705){return new BPromise(function(_0x1361bb,_0x2137b6){if(_0x100705[_0x1ef3('0x30')]){_0x1361bb(_0x100705['text']);return;}return db[_0x1ef3('0x58')][_0x1ef3('0x59')]({'attributes':[_0x1ef3('0x5a')],'where':{'id':_0x100705[_0x1ef3('0x31')]},'raw':!![]})[_0x1ef3('0x27')](function(_0x5e601d){if(!_0x5e601d)throw new db[(_0x1ef3('0x32'))][(_0x1ef3('0x33'))](_0x1ef3('0x5b'));var _0x4804ac=Mustache[_0x1ef3('0x5c')](_0x5e601d[_0x1ef3('0x5a')],_0x100705[_0x1ef3('0x35')]);_0x1361bb(_0x4804ac);})[_0x1ef3('0x5d')](function(_0x5077a3){_0x2137b6(_0x5077a3);});});}function getRecipients(_0x2d760f){return new BPromise(function(_0x3a11f0,_0x1946f2){var _0x55ef0f=[];var _0x373ea8=[];_0x2d760f['forEach'](function(_0x2688d9){var _0x2a7779=_[_0x1ef3('0x5e')](_0x2688d9[_0x1ef3('0x44')][_0x1ef3('0x45')]());if(_0x2a7779==='User'){_0x55ef0f=_[_0x1ef3('0x5f')](_0x55ef0f,_0x2688d9[_0x1ef3('0x60')]);}else{if(_['includes'](_0x2a7779,'queue'))_0x2a7779=_0x2a7779[_0x1ef3('0x61')](_0x1ef3('0x62'),'Queue');_0x2688d9['ids'][_0x1ef3('0x54')](function(_0x14dc6b){_0x373ea8['push'](getAgents(_0x2a7779,_0x14dc6b));});}});return BPromise['all'](_0x373ea8)[_0x1ef3('0x27')](function(_0x2a4be7){_0x55ef0f=_['union'](_0x55ef0f,_[_0x1ef3('0x63')](_0x2a4be7));_0x3a11f0(_0x55ef0f);})[_0x1ef3('0x5d')](function(_0x37dd21){_0x1946f2(_0x37dd21);});});}function getAgents(_0x5ee15e,_0x480a33){return new BPromise(function(_0x4a0515,_0x3c4c45){return db[_0x5ee15e][_0x1ef3('0x59')]({'where':{'id':_0x480a33}})[_0x1ef3('0x27')](function(_0x2031ae){return _0x2031ae['getAgents']({'attributes':['id'],'raw':!![]})[_0x1ef3('0x27')](function(_0xc2b573){var _0x1f289b=_[_0x1ef3('0x64')](_0xc2b573,'id');_0x4a0515(_0x1f289b);});})[_0x1ef3('0x5d')](function(_0x1e8b74){_0x3c4c45(_0x1e8b74);});});} \ No newline at end of file +var _0xb2ce=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','update','then','destroy','error','stack','name','send','hasOwnProperty','body','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','Missing\x20\x27view\x27\x20parameter','recipients','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','recipientsId','sequelize','transaction','UserNotification','create','forEach','recipient','text','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','catch','startCase','model','User','ids','queue','replace','Queue','push','all','flatten','getAgents','map','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x1198ab,_0x2820a5){var _0x211f57=function(_0x18f2df){while(--_0x18f2df){_0x1198ab['push'](_0x1198ab['shift']());}};_0x211f57(++_0x2820a5);}(_0xb2ce,0x125));var _0xeb2c=function(_0xe06a2c,_0x1293bf){_0xe06a2c=_0xe06a2c-0x0;var _0x591b0a=_0xb2ce[_0xe06a2c];return _0x591b0a;};'use strict';var emlformat=require(_0xeb2c('0x0'));var rimraf=require(_0xeb2c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xeb2c('0x2'));var moment=require(_0xeb2c('0x3'));var BPromise=require(_0xeb2c('0x4'));var Mustache=require(_0xeb2c('0x5'));var util=require(_0xeb2c('0x6'));var path=require(_0xeb2c('0x7'));var sox=require(_0xeb2c('0x8'));var csv=require(_0xeb2c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeb2c('0xa'));var _=require(_0xeb2c('0xb'));var squel=require(_0xeb2c('0xc'));var crypto=require(_0xeb2c('0xd'));var jsforce=require(_0xeb2c('0xe'));var deskjs=require(_0xeb2c('0xf'));var toCsv=require('to-csv');var querystring=require(_0xeb2c('0x10'));var Papa=require(_0xeb2c('0x11'));var Redis=require(_0xeb2c('0x12'));var authService=require(_0xeb2c('0x13'));var qs=require(_0xeb2c('0x14'));var as=require(_0xeb2c('0x15'));var hardwareService=require(_0xeb2c('0x16'));var logger=require(_0xeb2c('0x17'))(_0xeb2c('0x18'));var utils=require(_0xeb2c('0x19'));var config=require(_0xeb2c('0x1a'));var licenseUtil=require(_0xeb2c('0x1b'));var db=require(_0xeb2c('0x1c'))['db'];config[_0xeb2c('0x1d')]=_[_0xeb2c('0x1e')](config['redis'],{'host':_0xeb2c('0x1f'),'port':0x18eb});var socket=require(_0xeb2c('0x20'))(new Redis(config[_0xeb2c('0x1d')]));require(_0xeb2c('0x21'))[_0xeb2c('0x22')](socket);function respondWithStatusCode(_0x494cec,_0x359dbf){_0x359dbf=_0x359dbf||0xcc;return function(_0x376b32){if(_0x376b32){return _0x494cec[_0xeb2c('0x23')](_0x359dbf);}return _0x494cec[_0xeb2c('0x24')](_0x359dbf)[_0xeb2c('0x25')]();};}function respondWithResult(_0x2faa13,_0x1d39fa){_0x1d39fa=_0x1d39fa||0xc8;return function(_0x298bad){if(_0x298bad){return _0x2faa13[_0xeb2c('0x24')](_0x1d39fa)[_0xeb2c('0x26')](_0x298bad);}};}function respondWithFilteredResult(_0x178bee,_0x464834){return function(_0x1f14f5){if(_0x1f14f5){var _0x3fdc74=typeof _0x464834['offset']===_0xeb2c('0x27')&&typeof _0x464834[_0xeb2c('0x28')]===_0xeb2c('0x27');var _0x58d7d6=_0x1f14f5['count'];var _0xad3578=_0x3fdc74?0x0:_0x464834[_0xeb2c('0x29')];var _0x338fed=_0x3fdc74?_0x1f14f5[_0xeb2c('0x2a')]:_0x464834[_0xeb2c('0x29')]+_0x464834['limit'];var _0x37fb3a;if(_0x338fed>=_0x58d7d6){_0x338fed=_0x58d7d6;_0x37fb3a=0xc8;}else{_0x37fb3a=0xce;}_0x178bee['status'](_0x37fb3a);return _0x178bee['set'](_0xeb2c('0x2b'),_0xad3578+'-'+_0x338fed+'/'+_0x58d7d6)[_0xeb2c('0x26')](_0x1f14f5);}return null;};}function patchUpdates(_0x378b05){return function(_0x396d35){try{jsonpatch[_0xeb2c('0x2c')](_0x396d35,_0x378b05,!![]);}catch(_0x51bcab){return BPromise['reject'](_0x51bcab);}return _0x396d35['save']();};}function saveUpdates(_0x225ef5,_0x177ac6){return function(_0x406815){if(_0x406815){return _0x406815[_0xeb2c('0x2d')](_0x225ef5)[_0xeb2c('0x2e')](function(_0x2794af){return _0x2794af;});}return null;};}function removeEntity(_0x395e24,_0x13cea8){return function(_0x25f02f){if(_0x25f02f){return _0x25f02f[_0xeb2c('0x2f')]()[_0xeb2c('0x2e')](function(){_0x395e24[_0xeb2c('0x24')](0xcc)[_0xeb2c('0x25')]();});}};}function handleEntityNotFound(_0x28b11d,_0x3a60c4){return function(_0x482641){if(!_0x482641){_0x28b11d[_0xeb2c('0x23')](0x194);}return _0x482641;};}function handleError(_0x161d6e,_0xad3ef1){_0xad3ef1=_0xad3ef1||0x1f4;return function(_0x145395){logger[_0xeb2c('0x30')](_0x145395[_0xeb2c('0x31')]);if(_0x145395[_0xeb2c('0x32')]){delete _0x145395[_0xeb2c('0x32')];}_0x161d6e[_0xeb2c('0x24')](_0xad3ef1)[_0xeb2c('0x33')](_0x145395);};}exports['sendUserNotification']=function(_0x4ec2bf,_0x56ce0a,_0x427e55){if(!_0x4ec2bf['body'][_0xeb2c('0x34')]('text')&&!_0x4ec2bf[_0xeb2c('0x35')][_0xeb2c('0x34')]('TemplateId')){throw new db[(_0xeb2c('0x36'))][(_0xeb2c('0x37'))](_0xeb2c('0x38'));}else{if(_0x4ec2bf[_0xeb2c('0x35')][_0xeb2c('0x34')](_0xeb2c('0x39'))&&!_0x4ec2bf[_0xeb2c('0x35')][_0xeb2c('0x34')]('view')){throw new db[(_0xeb2c('0x36'))][(_0xeb2c('0x37'))](_0xeb2c('0x3a'));}if(!_0x4ec2bf[_0xeb2c('0x35')][_0xeb2c('0x34')](_0xeb2c('0x3b'))){throw new db[(_0xeb2c('0x36'))][(_0xeb2c('0x37'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x4c2c51=JSON[_0xeb2c('0x3c')](_0x4ec2bf[_0xeb2c('0x35')][_0xeb2c('0x3b')]);}catch(_0x2a1636){logger[_0xeb2c('0x30')](_0x2a1636);throw new db[(_0xeb2c('0x36'))]['ValidationError'](_0xeb2c('0x3d'));}var _0x448543=[_0xeb2c('0x3e'),_0xeb2c('0x3f'),_0xeb2c('0x40'),'openchannelqueue',_0xeb2c('0x41'),_0xeb2c('0x42'),_0xeb2c('0x43'),_0xeb2c('0x44'),_0xeb2c('0x45')];if(_[_0xeb2c('0x46')](_0x4c2c51,function(_0x18a90f){return!_['includes'](_0x448543,_0x18a90f['model'][_0xeb2c('0x47')]());})){throw new db[(_0xeb2c('0x36'))][(_0xeb2c('0x37'))](_0xeb2c('0x48'));}}}var _0x38c43e={};_0x38c43e[_0xeb2c('0x49')]=_0x4ec2bf[_0xeb2c('0x35')][_0xeb2c('0x34')](_0xeb2c('0x49'))?_0x4ec2bf['body'][_0xeb2c('0x49')]:_0x4ec2bf[_0xeb2c('0x45')][_0xeb2c('0x4a')];_0x38c43e['recipientsDescription']=_[_0xeb2c('0x4b')](_0x4ec2bf['body'][_0xeb2c('0x4c')])?null:_0x4ec2bf[_0xeb2c('0x35')]['recipientsDescription'];_0x38c43e['beep']=_0x4ec2bf[_0xeb2c('0x35')][_0xeb2c('0x4d')]||![];_0x38c43e['SenderId']=_0x4ec2bf['user']['id'];return getContent(_0x4ec2bf[_0xeb2c('0x35')])[_0xeb2c('0x2e')](function(_0xd41e77){_0x38c43e['body']=_0xd41e77;return getRecipients(_0x4c2c51);})[_0xeb2c('0x2e')](function(_0xdadeb4){_0x38c43e[_0xeb2c('0x4e')]=_['sortBy'](_0xdadeb4)['join'](',');return db[_0xeb2c('0x4f')][_0xeb2c('0x50')](function(_0x343aee){return db[_0xeb2c('0x51')][_0xeb2c('0x52')](_0x38c43e,{'raw':!![],'transaction':_0x343aee})[_0xeb2c('0x2e')](function(_0x8adbf2){var _0x1d365e={'sender':_0x38c43e[_0xeb2c('0x49')],'description':_0x38c43e[_0xeb2c('0x4c')],'content':_0x38c43e[_0xeb2c('0x35')],'beep':_0x38c43e[_0xeb2c('0x4d')]};_0xdadeb4[_0xeb2c('0x53')](function(_0x1ceaad){_0x1d365e[_0xeb2c('0x54')]=_0x1ceaad;socket['emit']('userNotification:send',_0x1d365e);});return _0x8adbf2;});});})[_0xeb2c('0x2e')](respondWithResult(_0x56ce0a,0xc9))['catch'](handleError(_0x56ce0a,null));};function getContent(_0x5afe92){return new BPromise(function(_0x389237,_0x291d1c){if(_0x5afe92[_0xeb2c('0x55')]){_0x389237(_0x5afe92[_0xeb2c('0x55')]);return;}return db[_0xeb2c('0x56')]['findOne']({'attributes':[_0xeb2c('0x57')],'where':{'id':_0x5afe92['TemplateId']},'raw':!![]})['then'](function(_0x3bf8e8){if(!_0x3bf8e8)throw new db['Sequelize']['ValidationError'](_0xeb2c('0x58'));var _0x2f8cea=Mustache[_0xeb2c('0x59')](_0x3bf8e8[_0xeb2c('0x57')],_0x5afe92[_0xeb2c('0x5a')]);_0x389237(_0x2f8cea);})[_0xeb2c('0x5b')](function(_0x4b508e){_0x291d1c(_0x4b508e);});});}function getRecipients(_0x228dd1){return new BPromise(function(_0x9d794d,_0x417fb0){var _0x2b4ea5=[];var _0x472c29=[];_0x228dd1[_0xeb2c('0x53')](function(_0x51c182){var _0x53671d=_[_0xeb2c('0x5c')](_0x51c182[_0xeb2c('0x5d')][_0xeb2c('0x47')]());if(_0x53671d===_0xeb2c('0x5e')){_0x2b4ea5=_['union'](_0x2b4ea5,_0x51c182[_0xeb2c('0x5f')]);}else{if(_['includes'](_0x53671d,_0xeb2c('0x60')))_0x53671d=_0x53671d[_0xeb2c('0x61')](_0xeb2c('0x60'),_0xeb2c('0x62'));_0x51c182[_0xeb2c('0x5f')]['forEach'](function(_0x11ef6a){_0x472c29[_0xeb2c('0x63')](getAgents(_0x53671d,_0x11ef6a));});}});return BPromise[_0xeb2c('0x64')](_0x472c29)['then'](function(_0x17ac3f){_0x2b4ea5=_['union'](_0x2b4ea5,_[_0xeb2c('0x65')](_0x17ac3f));_0x9d794d(_0x2b4ea5);})['catch'](function(_0x168f03){_0x417fb0(_0x168f03);});});}function getAgents(_0x2e828e,_0xc2898d){return new BPromise(function(_0x3335b2,_0x55265c){return db[_0x2e828e]['findOne']({'where':{'id':_0xc2898d}})['then'](function(_0x1ef37e){return _0x1ef37e[_0xeb2c('0x66')]({'attributes':['id'],'raw':!![]})[_0xeb2c('0x2e')](function(_0x3f371a){var _0x548da2=_[_0xeb2c('0x67')](_0x3f371a,'id');_0x3335b2(_0x548da2);});})[_0xeb2c('0x5b')](function(_0x7d5f2d){_0x55265c(_0x7d5f2d);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 1fe360b..bb452c9 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 _0x9aed=['UserNotification','save','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x5ce68f,_0x1c468d){var _0x2a7421=function(_0x3e8270){while(--_0x3e8270){_0x5ce68f['push'](_0x5ce68f['shift']());}};_0x2a7421(++_0x1c468d);}(_0x9aed,0x11e));var _0xd9ae=function(_0x734acc,_0x3b8c1f){_0x734acc=_0x734acc-0x0;var _0x50835a=_0x9aed[_0x734acc];return _0x50835a;};'use strict';var EventEmitter=require(_0xd9ae('0x0'));var UserNotification=require(_0xd9ae('0x1'))['db'][_0xd9ae('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd9ae('0x3'),'afterUpdate':'update','afterDestroy':_0xd9ae('0x4')};function emitEvent(_0x121be3){return function(_0x4c045f,_0x4d223d,_0xd72fb6){UserNotificationEvents[_0xd9ae('0x5')](_0x121be3+':'+_0x4c045f['id'],_0x4c045f);UserNotificationEvents[_0xd9ae('0x5')](_0x121be3,_0x4c045f);_0xd72fb6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0xd9ae('0x6')](e,emitEvent(event));}}module[_0xd9ae('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0xb0dd=['hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification','setMaxListeners','save','update','remove'];(function(_0x59c4a1,_0x2c941d){var _0x3da53d=function(_0x414d45){while(--_0x414d45){_0x59c4a1['push'](_0x59c4a1['shift']());}};_0x3da53d(++_0x2c941d);}(_0xb0dd,0x189));var _0xdb0d=function(_0x4ebf46,_0x417e3c){_0x4ebf46=_0x4ebf46-0x0;var _0x4f4813=_0xb0dd[_0x4ebf46];return _0x4f4813;};'use strict';var EventEmitter=require(_0xdb0d('0x0'));var UserNotification=require(_0xdb0d('0x1'))['db'][_0xdb0d('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xdb0d('0x3')](0x0);var events={'afterCreate':_0xdb0d('0x4'),'afterUpdate':_0xdb0d('0x5'),'afterDestroy':_0xdb0d('0x6')};function emitEvent(_0x473da9){return function(_0x4ef2a3,_0x4b8dea,_0x55a132){UserNotificationEvents['emit'](_0x473da9+':'+_0x4ef2a3['id'],_0x4ef2a3);UserNotificationEvents['emit'](_0x473da9,_0x4ef2a3);_0x55a132(null);};}for(var e in events){if(events[_0xdb0d('0x7')](e)){var event=events[e];UserNotification[_0xdb0d('0x8')](e,emitEvent(event));}}module[_0xdb0d('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 1db0d38..58698ff 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 _0xc674=['UserNotification','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define'];(function(_0x235482,_0x14b833){var _0x5f5bea=function(_0x17a254){while(--_0x17a254){_0x235482['push'](_0x235482['shift']());}};_0x5f5bea(++_0x14b833);}(_0xc674,0xc6));var _0x4c67=function(_0x4e0359,_0x205155){_0x4e0359=_0x4e0359-0x0;var _0x450f0a=_0xc674[_0x4e0359];return _0x450f0a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4c67('0x0'))(_0x4c67('0x1'));var moment=require('moment');var BPromise=require(_0x4c67('0x2'));var rp=require(_0x4c67('0x3'));var fs=require('fs');var path=require(_0x4c67('0x4'));var rimraf=require(_0x4c67('0x5'));var config=require(_0x4c67('0x6'));var attributes=require(_0x4c67('0x7'));module[_0x4c67('0x8')]=function(_0x553bbe,_0x126d14){return _0x553bbe[_0x4c67('0x9')](_0x4c67('0xa'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4c67('0xb'),'collate':_0x4c67('0xc')});}; \ No newline at end of file +var _0xa66d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x1241b8,_0x2dbf50){var _0x4faa5c=function(_0x5bf25c){while(--_0x5bf25c){_0x1241b8['push'](_0x1241b8['shift']());}};_0x4faa5c(++_0x2dbf50);}(_0xa66d,0xee));var _0xda66=function(_0x5ae655,_0x32a667){_0x5ae655=_0x5ae655-0x0;var _0x2a00cf=_0xa66d[_0x5ae655];return _0x2a00cf;};'use strict';var _=require(_0xda66('0x0'));var util=require(_0xda66('0x1'));var logger=require(_0xda66('0x2'))(_0xda66('0x3'));var moment=require(_0xda66('0x4'));var BPromise=require(_0xda66('0x5'));var rp=require(_0xda66('0x6'));var fs=require('fs');var path=require(_0xda66('0x7'));var rimraf=require(_0xda66('0x8'));var config=require(_0xda66('0x9'));var attributes=require(_0xda66('0xa'));module[_0xda66('0xb')]=function(_0x2c7696,_0x1e55b1){return _0x2c7696[_0xda66('0xc')](_0xda66('0xd'),attributes,{'tableName':_0xda66('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xda66('0xf'),'collate':_0xda66('0x10')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index d7863ac..6d27eb4 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 _0x1e29=['request','then','UserNotification,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x1e29,0x10d));var _0x91e2=function(_0x568c4a,_0x2fa482){_0x568c4a=_0x568c4a-0x0;var _0x16d7a1=_0x1e29[_0x568c4a];return _0x16d7a1;};'use strict';var _=require(_0x91e2('0x0'));var util=require(_0x91e2('0x1'));var moment=require(_0x91e2('0x2'));var BPromise=require(_0x91e2('0x3'));var rs=require(_0x91e2('0x4'));var fs=require('fs');var Redis=require(_0x91e2('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x91e2('0x6'))(_0x91e2('0x7'));var config=require(_0x91e2('0x8'));var jayson=require(_0x91e2('0x9'));var client=jayson[_0x91e2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x91e2('0xb')](config[_0x91e2('0xc')],{'host':_0x91e2('0xd'),'port':0x18eb});var socket=require(_0x91e2('0xe'))(new Redis(config[_0x91e2('0xc')]));require(_0x91e2('0xf'))[_0x91e2('0x10')](socket);function respondWithRpcPromise(_0x126991,_0x4b6cfe,_0x326d12){return new BPromise(function(_0x13f9e8,_0x419b3b){return client[_0x91e2('0x11')](_0x126991,_0x326d12)[_0x91e2('0x12')](function(_0x2e89a7){logger['info'](_0x91e2('0x13'),_0x4b6cfe,_0x91e2('0x14'));logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0x4b6cfe,'request\x20sent',JSON[_0x91e2('0x15')](_0x2e89a7));if(_0x2e89a7[_0x91e2('0x16')]){if(_0x2e89a7[_0x91e2('0x16')][_0x91e2('0x17')]===0x1f4){logger[_0x91e2('0x16')](_0x91e2('0x13'),_0x4b6cfe,_0x2e89a7[_0x91e2('0x16')]['message']);return _0x419b3b(_0x2e89a7[_0x91e2('0x16')]['message']);}logger['error'](_0x91e2('0x13'),_0x4b6cfe,_0x2e89a7[_0x91e2('0x16')][_0x91e2('0x18')]);return _0x13f9e8(_0x2e89a7['error']['message']);}else{logger['info'](_0x91e2('0x13'),_0x4b6cfe,_0x91e2('0x14'));_0x13f9e8(_0x2e89a7['result'][_0x91e2('0x18')]);}})[_0x91e2('0x19')](function(_0x478cd6){logger[_0x91e2('0x16')](_0x91e2('0x13'),_0x4b6cfe,_0x478cd6);_0x419b3b(_0x478cd6);});});} \ No newline at end of file +var _0x2395=['redis','defaults','socket.io-emitter','./userNotification.socket','register','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x1977c2,_0x19446a){var _0x1f591c=function(_0x33d69d){while(--_0x33d69d){_0x1977c2['push'](_0x1977c2['shift']());}};_0x1f591c(++_0x19446a);}(_0x2395,0x13b));var _0x5239=function(_0x59dc96,_0x4c04dd){_0x59dc96=_0x59dc96-0x0;var _0x1e9892=_0x2395[_0x59dc96];return _0x1e9892;};'use strict';var _=require('lodash');var util=require(_0x5239('0x0'));var moment=require('moment');var BPromise=require(_0x5239('0x1'));var rs=require(_0x5239('0x2'));var fs=require('fs');var Redis=require(_0x5239('0x3'));var db=require(_0x5239('0x4'))['db'];var utils=require(_0x5239('0x5'));var logger=require(_0x5239('0x6'))(_0x5239('0x7'));var config=require('../../config/environment');var jayson=require(_0x5239('0x8'));var client=jayson[_0x5239('0x9')]['http']({'port':0x232a});config[_0x5239('0xa')]=_[_0x5239('0xb')](config[_0x5239('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x5239('0xc'))(new Redis(config[_0x5239('0xa')]));require(_0x5239('0xd'))[_0x5239('0xe')](socket);function respondWithRpcPromise(_0x198c03,_0x36cc6f,_0x5ae438){return new BPromise(function(_0x4a7a90,_0x39accf){return client['request'](_0x198c03,_0x5ae438)[_0x5239('0xf')](function(_0x35c046){logger['info'](_0x5239('0x10'),_0x36cc6f,_0x5239('0x11'));logger[_0x5239('0x12')](_0x5239('0x13'),_0x36cc6f,_0x5239('0x11'),JSON['stringify'](_0x35c046));if(_0x35c046[_0x5239('0x14')]){if(_0x35c046[_0x5239('0x14')]['code']===0x1f4){logger[_0x5239('0x14')](_0x5239('0x10'),_0x36cc6f,_0x35c046[_0x5239('0x14')]['message']);return _0x39accf(_0x35c046['error'][_0x5239('0x15')]);}logger[_0x5239('0x14')](_0x5239('0x10'),_0x36cc6f,_0x35c046['error']['message']);return _0x4a7a90(_0x35c046['error']['message']);}else{logger[_0x5239('0x16')](_0x5239('0x10'),_0x36cc6f,'request\x20sent');_0x4a7a90(_0x35c046[_0x5239('0x17')]['message']);}})[_0x5239('0x18')](function(_0x4e8f54){logger[_0x5239('0x14')]('UserNotification,\x20%s,\x20%s',_0x36cc6f,_0x4e8f54);_0x39accf(_0x4e8f54);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 4cd51ca..714a1d0 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 _0xb8e4=['removeListener','register','length','./userNotification.events','save','remove','emit'];(function(_0x4adaaa,_0x304201){var _0x484622=function(_0x31f24c){while(--_0x31f24c){_0x4adaaa['push'](_0x4adaaa['shift']());}};_0x484622(++_0x304201);}(_0xb8e4,0xce));var _0x4b8e=function(_0xe19f98,_0x1dc352){_0xe19f98=_0xe19f98-0x0;var _0x411e53=_0xb8e4[_0xe19f98];return _0x411e53;};'use strict';var UserNotificationEvents=require(_0x4b8e('0x0'));var events=[_0x4b8e('0x1'),_0x4b8e('0x2'),'update'];function createListener(_0x356e05,_0x3270be){return function(_0x4851a1){_0x3270be[_0x4b8e('0x3')](_0x356e05,_0x4851a1);};}function removeListener(_0x4ea1eb,_0x3715d5){return function(){UserNotificationEvents[_0x4b8e('0x4')](_0x4ea1eb,_0x3715d5);};}exports[_0x4b8e('0x5')]=function(_0x160eb2){for(var _0x459072=0x0,_0x2a883b=events[_0x4b8e('0x6')];_0x459072<_0x2a883b;_0x459072++){var _0x4deae2=events[_0x459072];var _0xce956e=createListener('userNotification:'+_0x4deae2,_0x160eb2);UserNotificationEvents['on'](_0x4deae2,_0xce956e);}}; \ No newline at end of file +var _0x9483=['./userNotification.events','emit','register'];(function(_0xcc7a99,_0x269fcf){var _0x4d79fe=function(_0x18461b){while(--_0x18461b){_0xcc7a99['push'](_0xcc7a99['shift']());}};_0x4d79fe(++_0x269fcf);}(_0x9483,0x102));var _0x3948=function(_0x5e362a,_0x4f6323){_0x5e362a=_0x5e362a-0x0;var _0x25014b=_0x9483[_0x5e362a];return _0x25014b;};'use strict';var UserNotificationEvents=require(_0x3948('0x0'));var events=['save','remove','update'];function createListener(_0x56cd50,_0x27c0c8){return function(_0x1bcaba){_0x27c0c8[_0x3948('0x1')](_0x56cd50,_0x1bcaba);};}function removeListener(_0x156818,_0xebcc39){return function(){UserNotificationEvents['removeListener'](_0x156818,_0xebcc39);};}exports[_0x3948('0x2')]=function(_0x20eeb1){for(var _0x7134fb=0x0,_0x267dc2=events['length'];_0x7134fb<_0x267dc2;_0x7134fb++){var _0x4c93c7=events[_0x7134fb];var _0x353054=createListener('userNotification:'+_0x4c93c7,_0x20eeb1);UserNotificationEvents['on'](_0x4c93c7,_0x353054);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 2a61713..9b91513 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x15a5e8,_0x430184){var _0x13d3b4=function(_0x5325c4){while(--_0x5325c4){_0x15a5e8['push'](_0x15a5e8['shift']());}};_0x13d3b4(++_0x430184);}(_0x70e0,0x17b));var _0x070e=function(_0x1c834b,_0x2b2759){_0x1c834b=_0x1c834b-0x0;var _0x2239c3=_0x70e0[_0x1c834b];return _0x2239c3;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0xff6bbd,_0x34e0b6){var _0x2a2697=function(_0x2d5d9c){while(--_0x2d5d9c){_0xff6bbd['push'](_0xff6bbd['shift']());}};_0x2a2697(++_0x34e0b6);}(_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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 98f7b97..20c7052 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 _0x71b4=['sequelize'];(function(_0x591729,_0x273002){var _0x1f5b56=function(_0x2e91b0){while(--_0x2e91b0){_0x591729['push'](_0x591729['shift']());}};_0x1f5b56(++_0x273002);}(_0x71b4,0xd6));var _0x471b=function(_0x273cce,_0x6a58fa){_0x273cce=_0x273cce-0x0;var _0x582471=_0x71b4[_0x273cce];return _0x582471;};'use strict';var Sequelize=require(_0x471b('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0a9f=['exports','sequelize'];(function(_0x4bf5cd,_0xddf2f2){var _0x2f9e5a=function(_0x32acef){while(--_0x32acef){_0x4bf5cd['push'](_0x4bf5cd['shift']());}};_0x2f9e5a(++_0xddf2f2);}(_0x0a9f,0x19d));var _0xf0a9=function(_0x167b19,_0x56081a){_0x167b19=_0x167b19-0x0;var _0x1fcca2=_0x0a9f[_0x167b19];return _0x1fcca2;};'use strict';var Sequelize=require(_0xf0a9('0x0'));module[_0xf0a9('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 485fad4..d6d9274 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 _0xc671=['./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xa86155,_0x4b68ea){var _0x373fe0=function(_0x3136d7){while(--_0x3136d7){_0xa86155['push'](_0xa86155['shift']());}};_0x373fe0(++_0x4b68ea);}(_0xc671,0x75));var _0x1c67=function(_0x34342a,_0x3e16f5){_0x34342a=_0x34342a-0x0;var _0x427cdf=_0xc671[_0x34342a];return _0x427cdf;};'use strict';var _=require(_0x1c67('0x0'));var util=require(_0x1c67('0x1'));var logger=require('../../config/logger')(_0x1c67('0x2'));var moment=require(_0x1c67('0x3'));var BPromise=require(_0x1c67('0x4'));var rp=require(_0x1c67('0x5'));var fs=require('fs');var path=require(_0x1c67('0x6'));var rimraf=require(_0x1c67('0x7'));var config=require(_0x1c67('0x8'));var attributes=require(_0x1c67('0x9'));module[_0x1c67('0xa')]=function(_0x469fa0,_0x118b59){return _0x469fa0[_0x1c67('0xb')](_0x1c67('0xc'),attributes,{'tableName':_0x1c67('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe9cd=['exports','UserOpenchannelQueue','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes'];(function(_0x52b830,_0x2cc183){var _0x40eef6=function(_0x11a0ce){while(--_0x11a0ce){_0x52b830['push'](_0x52b830['shift']());}};_0x40eef6(++_0x2cc183);}(_0xe9cd,0x15e));var _0xde9c=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xe9cd[_0x279d37];return _0x530173;};'use strict';var _=require('lodash');var util=require(_0xde9c('0x0'));var logger=require(_0xde9c('0x1'))(_0xde9c('0x2'));var moment=require(_0xde9c('0x3'));var BPromise=require(_0xde9c('0x4'));var rp=require(_0xde9c('0x5'));var fs=require('fs');var path=require(_0xde9c('0x6'));var rimraf=require(_0xde9c('0x7'));var config=require(_0xde9c('0x8'));var attributes=require(_0xde9c('0x9'));module[_0xde9c('0xa')]=function(_0x2a8df4,_0x211108){return _0x2a8df4['define'](_0xde9c('0xb'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 8b1f414..f7e70fa 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 _0xecc7=['../../config/logger','rpc','jayson/promise','client','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xecc7,0x19c));var _0x7ecc=function(_0x31ba0c,_0xe12a66){_0x31ba0c=_0x31ba0c-0x0;var _0x473675=_0xecc7[_0x31ba0c];return _0x473675;};'use strict';var _=require(_0x7ecc('0x0'));var util=require(_0x7ecc('0x1'));var moment=require(_0x7ecc('0x2'));var BPromise=require(_0x7ecc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7ecc('0x4'))['db'];var utils=require(_0x7ecc('0x5'));var logger=require(_0x7ecc('0x6'))(_0x7ecc('0x7'));var config=require('../../config/environment');var jayson=require(_0x7ecc('0x8'));var client=jayson[_0x7ecc('0x9')][_0x7ecc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14781d,_0x57beb6,_0x2512fe){return new BPromise(function(_0x340145,_0x26ad34){return client['request'](_0x14781d,_0x2512fe)[_0x7ecc('0xb')](function(_0x15a627){logger[_0x7ecc('0xc')](_0x7ecc('0xd'),_0x57beb6,'request\x20sent');logger[_0x7ecc('0xe')](_0x7ecc('0xf'),_0x57beb6,_0x7ecc('0x10'),JSON[_0x7ecc('0x11')](_0x15a627));if(_0x15a627[_0x7ecc('0x12')]){if(_0x15a627[_0x7ecc('0x12')][_0x7ecc('0x13')]===0x1f4){logger[_0x7ecc('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x57beb6,_0x15a627[_0x7ecc('0x12')][_0x7ecc('0x14')]);return _0x26ad34(_0x15a627['error']['message']);}logger[_0x7ecc('0x12')](_0x7ecc('0xd'),_0x57beb6,_0x15a627[_0x7ecc('0x12')][_0x7ecc('0x14')]);return _0x340145(_0x15a627[_0x7ecc('0x12')][_0x7ecc('0x14')]);}else{logger[_0x7ecc('0xc')](_0x7ecc('0xd'),_0x57beb6,_0x7ecc('0x10'));_0x340145(_0x15a627['result']['message']);}})[_0x7ecc('0x15')](function(_0x45c77f){logger[_0x7ecc('0x12')](_0x7ecc('0xd'),_0x57beb6,_0x45c77f);_0x26ad34(_0x45c77f);});});} \ No newline at end of file +var _0x0c22=['jayson/promise','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x0c22,0x13c));var _0x20c2=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0c22[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x20c2('0x0'));var moment=require(_0x20c2('0x1'));var BPromise=require(_0x20c2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20c2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x20c2('0x4'))(_0x20c2('0x5'));var config=require(_0x20c2('0x6'));var jayson=require(_0x20c2('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xb73bfd,_0x18b995,_0xe499d0){return new BPromise(function(_0x530b15,_0x212369){return client[_0x20c2('0x8')](_0xb73bfd,_0xe499d0)[_0x20c2('0x9')](function(_0x2fdc21){logger[_0x20c2('0xa')](_0x20c2('0xb'),_0x18b995,'request\x20sent');logger['debug'](_0x20c2('0xc'),_0x18b995,_0x20c2('0xd'),JSON[_0x20c2('0xe')](_0x2fdc21));if(_0x2fdc21[_0x20c2('0xf')]){if(_0x2fdc21['error'][_0x20c2('0x10')]===0x1f4){logger['error'](_0x20c2('0xb'),_0x18b995,_0x2fdc21['error'][_0x20c2('0x11')]);return _0x212369(_0x2fdc21[_0x20c2('0xf')]['message']);}logger[_0x20c2('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x18b995,_0x2fdc21['error'][_0x20c2('0x11')]);return _0x530b15(_0x2fdc21[_0x20c2('0xf')]['message']);}else{logger['info'](_0x20c2('0xb'),_0x18b995,_0x20c2('0xd'));_0x530b15(_0x2fdc21['result'][_0x20c2('0x11')]);}})[_0x20c2('0x12')](function(_0x2e0cb7){logger[_0x20c2('0xf')](_0x20c2('0xb'),_0x18b995,_0x2e0cb7);_0x212369(_0x2e0cb7);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 382a541..c33b820 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 _0xa002=['describe','/:id','show','/:id/resources','getResources','create','/:id/clone','clone','post','/:id/sections','addResources','put','destroy','delete','removeResources','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','index','/describe'];(function(_0x26c9cb,_0xffdd47){var _0x35db22=function(_0x5af643){while(--_0x5af643){_0x26c9cb['push'](_0x26c9cb['shift']());}};_0x35db22(++_0xffdd47);}(_0xa002,0x17c));var _0x2a00=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa002[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x2a00('0x0'));var util=require(_0x2a00('0x1'));var path=require(_0x2a00('0x2'));var timeout=require(_0x2a00('0x3'));var express=require('express');var router=express[_0x2a00('0x4')]();var fs_extra=require(_0x2a00('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2a00('0x6'));var config=require('../../config/environment');var controller=require(_0x2a00('0x7'));router[_0x2a00('0x8')]('/',auth[_0x2a00('0x9')](),controller[_0x2a00('0xa')]);router[_0x2a00('0x8')](_0x2a00('0xb'),auth[_0x2a00('0x9')](),controller[_0x2a00('0xc')]);router[_0x2a00('0x8')](_0x2a00('0xd'),auth[_0x2a00('0x9')](),controller[_0x2a00('0xe')]);router[_0x2a00('0x8')]('/:id/sections',auth[_0x2a00('0x9')](),controller['getSections']);router[_0x2a00('0x8')](_0x2a00('0xf'),auth[_0x2a00('0x9')](),controller[_0x2a00('0x10')]);router['post']('/',auth[_0x2a00('0x9')](),controller[_0x2a00('0x11')]);router['post'](_0x2a00('0x12'),auth[_0x2a00('0x9')](),controller[_0x2a00('0x13')]);router[_0x2a00('0x14')](_0x2a00('0x15'),auth[_0x2a00('0x9')](),controller['addSections']);router[_0x2a00('0x14')](_0x2a00('0xf'),auth[_0x2a00('0x9')](),controller[_0x2a00('0x16')]);router[_0x2a00('0x17')](_0x2a00('0xd'),auth[_0x2a00('0x9')](),controller['update']);router['delete'](_0x2a00('0xd'),auth[_0x2a00('0x9')](),controller[_0x2a00('0x18')]);router['delete'](_0x2a00('0x15'),auth['isAuthenticated'](),controller['removeSections']);router[_0x2a00('0x19')](_0x2a00('0xf'),auth[_0x2a00('0x9')](),controller[_0x2a00('0x1a')]);module[_0x2a00('0x1b')]=router; \ No newline at end of file +var _0x02c8=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/sections','/:id/resources','getResources','create','post','/:id/clone','clone','addSections','addResources','put','update','delete','destroy','removeSections','removeResources','exports'];(function(_0x56b370,_0x5c1c44){var _0x10c934=function(_0x3d066d){while(--_0x3d066d){_0x56b370['push'](_0x56b370['shift']());}};_0x10c934(++_0x5c1c44);}(_0x02c8,0x180));var _0x802c=function(_0x2d1e92,_0x215d46){_0x2d1e92=_0x2d1e92-0x0;var _0x106351=_0x02c8[_0x2d1e92];return _0x106351;};'use strict';var multer=require(_0x802c('0x0'));var util=require(_0x802c('0x1'));var path=require(_0x802c('0x2'));var timeout=require(_0x802c('0x3'));var express=require('express');var router=express[_0x802c('0x4')]();var fs_extra=require(_0x802c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x802c('0x6'));var config=require(_0x802c('0x7'));var controller=require(_0x802c('0x8'));router[_0x802c('0x9')]('/',auth['isAuthenticated'](),controller[_0x802c('0xa')]);router[_0x802c('0x9')](_0x802c('0xb'),auth[_0x802c('0xc')](),controller[_0x802c('0xd')]);router[_0x802c('0x9')](_0x802c('0xe'),auth['isAuthenticated'](),controller[_0x802c('0xf')]);router[_0x802c('0x9')](_0x802c('0x10'),auth[_0x802c('0xc')](),controller['getSections']);router['get'](_0x802c('0x11'),auth[_0x802c('0xc')](),controller[_0x802c('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x802c('0x13')]);router[_0x802c('0x14')](_0x802c('0x15'),auth[_0x802c('0xc')](),controller[_0x802c('0x16')]);router[_0x802c('0x14')](_0x802c('0x10'),auth[_0x802c('0xc')](),controller[_0x802c('0x17')]);router[_0x802c('0x14')](_0x802c('0x11'),auth['isAuthenticated'](),controller[_0x802c('0x18')]);router[_0x802c('0x19')]('/:id',auth[_0x802c('0xc')](),controller[_0x802c('0x1a')]);router[_0x802c('0x1b')]('/:id',auth[_0x802c('0xc')](),controller[_0x802c('0x1c')]);router[_0x802c('0x1b')]('/:id/sections',auth[_0x802c('0xc')](),controller[_0x802c('0x1d')]);router[_0x802c('0x1b')]('/:id/resources',auth[_0x802c('0xc')](),controller[_0x802c('0x1e')]);module[_0x802c('0x1f')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 6beb583..41f6b5e 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 _0xf4aa=['crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x100dc5,_0xc853e9){var _0x1dc4f6=function(_0x2d4017){while(--_0x2d4017){_0x100dc5['push'](_0x100dc5['shift']());}};_0x1dc4f6(++_0xc853e9);}(_0xf4aa,0x1d9));var _0xaf4a=function(_0x2f5c7d,_0x1476bb){_0x2f5c7d=_0x2f5c7d-0x0;var _0x33686d=_0xf4aa[_0x2f5c7d];return _0x33686d;};'use strict';var Sequelize=require(_0xaf4a('0x0'));module[_0xaf4a('0x1')]={'name':{'type':Sequelize[_0xaf4a('0x2')],'allowNull':![],'unique':_0xaf4a('0x3')},'crudPermissions':{'type':Sequelize[_0xaf4a('0x2')],'set':function(_0x499204){this['setDataValue'](_0xaf4a('0x4'),_0x499204?_0x499204[_0xaf4a('0x5')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0xaf4a('0x6')]('crudPermissions')[_0xaf4a('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xaf4a('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xaf4a('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xaf4a('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xaf4a('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xaf4a('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xaf4a('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x29b4=['crudPermissions','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','getDataValue'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x29b4,0x147));var _0x429b=function(_0x249ba3,_0xb66eda){_0x249ba3=_0x249ba3-0x0;var _0x4d48df=_0x29b4[_0x249ba3];return _0x4d48df;};'use strict';var Sequelize=require(_0x429b('0x0'));module[_0x429b('0x1')]={'name':{'type':Sequelize[_0x429b('0x2')],'allowNull':![],'unique':_0x429b('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0xbc7f18){this[_0x429b('0x4')]('crudPermissions',_0xbc7f18?_0xbc7f18['join'](''):[]);},'get':function(){return this[_0x429b('0x5')]('crudPermissions')?this[_0x429b('0x5')](_0x429b('0x6'))[_0x429b('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x429b('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x429b('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x429b('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x429b('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x429b('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 116a61a..6bc7396 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 _0x9adb=['push','removeSections','ids','getSections','filter','enabled','isEmpty','includes','subsections','concat','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','desk.js','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','name','send','index','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','UserProfile','includeAll','include','findAll','rows','params','find','catch','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','UserProfileSection','describe'];(function(_0x466161,_0x29cc00){var _0x2f9c1d=function(_0x1b76cc){while(--_0x1b76cc){_0x466161['push'](_0x466161['shift']());}};_0x2f9c1d(++_0x29cc00);}(_0x9adb,0x1b8));var _0xb9ad=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9adb[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xb9ad('0x0'));var rimraf=require(_0xb9ad('0x1'));var zipdir=require(_0xb9ad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb9ad('0x3'));var moment=require(_0xb9ad('0x4'));var BPromise=require(_0xb9ad('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb9ad('0x6'));var sox=require(_0xb9ad('0x7'));var csv=require(_0xb9ad('0x8'));var ejs=require(_0xb9ad('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb9ad('0xa'));var crypto=require(_0xb9ad('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb9ad('0xc'));var toCsv=require(_0xb9ad('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb9ad('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb9ad('0xe'));var logger=require('../../config/logger')(_0xb9ad('0xf'));var utils=require('../../config/utils');var config=require(_0xb9ad('0x10'));var licenseUtil=require(_0xb9ad('0x11'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xb9ad('0x12')](config['redis'],{'host':_0xb9ad('0x13'),'port':0x18eb});var socket=require(_0xb9ad('0x14'))(new Redis(config['redis']));require(_0xb9ad('0x15'))['register'](socket);function respondWithStatusCode(_0x1e2383,_0x42363a){_0x42363a=_0x42363a||0xcc;return function(_0x49c745){if(_0x49c745){return _0x1e2383[_0xb9ad('0x16')](_0x42363a);}return _0x1e2383[_0xb9ad('0x17')](_0x42363a)[_0xb9ad('0x18')]();};}function respondWithResult(_0xdaefb4,_0x3ee7b0){_0x3ee7b0=_0x3ee7b0||0xc8;return function(_0x48f9fc){if(_0x48f9fc){return _0xdaefb4[_0xb9ad('0x17')](_0x3ee7b0)[_0xb9ad('0x19')](_0x48f9fc);}};}function respondWithFilteredResult(_0x1b2743,_0x5033d3){return function(_0x232e05){if(_0x232e05){var _0x43aa2a=typeof _0x5033d3[_0xb9ad('0x1a')]===_0xb9ad('0x1b')&&typeof _0x5033d3[_0xb9ad('0x1c')]==='undefined';var _0xbd8a5f=_0x232e05[_0xb9ad('0x1d')];var _0x466c1d=_0x43aa2a?0x0:_0x5033d3[_0xb9ad('0x1a')];var _0x3fa681=_0x43aa2a?_0x232e05[_0xb9ad('0x1d')]:_0x5033d3[_0xb9ad('0x1a')]+_0x5033d3[_0xb9ad('0x1c')];var _0x5c9656;if(_0x3fa681>=_0xbd8a5f){_0x3fa681=_0xbd8a5f;_0x5c9656=0xc8;}else{_0x5c9656=0xce;}_0x1b2743[_0xb9ad('0x17')](_0x5c9656);return _0x1b2743[_0xb9ad('0x1e')]('Content-Range',_0x466c1d+'-'+_0x3fa681+'/'+_0xbd8a5f)[_0xb9ad('0x19')](_0x232e05);}return null;};}function patchUpdates(_0x5c5561){return function(_0x3e00a9){try{jsonpatch[_0xb9ad('0x1f')](_0x3e00a9,_0x5c5561,!![]);}catch(_0x244a43){return BPromise[_0xb9ad('0x20')](_0x244a43);}return _0x3e00a9[_0xb9ad('0x21')]();};}function saveUpdates(_0x530af5,_0x528a6f){return function(_0x5338c3){if(_0x5338c3){return _0x5338c3[_0xb9ad('0x22')](_0x530af5)['then'](function(_0x10401b){return _0x10401b;});}return null;};}function removeEntity(_0x183a03,_0x93909c){return function(_0x5b68e0){if(_0x5b68e0){return _0x5b68e0[_0xb9ad('0x23')]()[_0xb9ad('0x24')](function(){_0x183a03['status'](0xcc)[_0xb9ad('0x18')]();});}};}function handleEntityNotFound(_0x3f589a,_0x39b055){return function(_0x59487f){if(!_0x59487f){_0x3f589a[_0xb9ad('0x16')](0x194);}return _0x59487f;};}function handleError(_0x5c336f,_0x2f2de4){_0x2f2de4=_0x2f2de4||0x1f4;return function(_0x197db1){logger['error'](_0x197db1['stack']);if(_0x197db1[_0xb9ad('0x25')]){delete _0x197db1['name'];}_0x5c336f[_0xb9ad('0x17')](_0x2f2de4)[_0xb9ad('0x26')](_0x197db1);};}exports[_0xb9ad('0x27')]=function(_0xcbae77,_0x1ba1f9){var _0x1d6c56={},_0x243eee={},_0x56553d={'count':0x0,'rows':[]};var _0x1233b2=_['map'](db['UserProfile'][_0xb9ad('0x28')],function(_0x7c533d){return{'name':_0x7c533d['fieldName'],'type':_0x7c533d[_0xb9ad('0x29')]['key']};});_0x243eee[_0xb9ad('0x2a')]=_[_0xb9ad('0x2b')](_0x1233b2,_0xb9ad('0x25'));_0x243eee[_0xb9ad('0x2c')]=_[_0xb9ad('0x2d')](_0xcbae77[_0xb9ad('0x2c')]);_0x243eee[_0xb9ad('0x2e')]=_[_0xb9ad('0x2f')](_0x243eee[_0xb9ad('0x2a')],_0x243eee[_0xb9ad('0x2c')]);_0x1d6c56[_0xb9ad('0x30')]=_[_0xb9ad('0x2f')](_0x243eee['model'],qs[_0xb9ad('0x31')](_0xcbae77[_0xb9ad('0x2c')][_0xb9ad('0x31')]));_0x1d6c56['attributes']=_0x1d6c56[_0xb9ad('0x30')][_0xb9ad('0x32')]?_0x1d6c56[_0xb9ad('0x30')]:_0x243eee[_0xb9ad('0x2a')];if(!_0xcbae77[_0xb9ad('0x2c')][_0xb9ad('0x33')](_0xb9ad('0x34'))){_0x1d6c56[_0xb9ad('0x1c')]=qs['limit'](_0xcbae77['query']['limit']);_0x1d6c56[_0xb9ad('0x1a')]=qs[_0xb9ad('0x1a')](_0xcbae77[_0xb9ad('0x2c')][_0xb9ad('0x1a')]);}_0x1d6c56[_0xb9ad('0x35')]=qs['sort'](_0xcbae77[_0xb9ad('0x2c')][_0xb9ad('0x36')]);_0x1d6c56[_0xb9ad('0x37')]=qs[_0xb9ad('0x2e')](_[_0xb9ad('0x38')](_0xcbae77[_0xb9ad('0x2c')],_0x243eee[_0xb9ad('0x2e')]),_0x1233b2);if(_0xcbae77['query']['filter']){_0x1d6c56[_0xb9ad('0x37')]=_[_0xb9ad('0x39')](_0x1d6c56[_0xb9ad('0x37')],{'$or':_['map'](_0x1233b2,function(_0x189654){if(_0x189654['type']!=='VIRTUAL'){var _0x5c1f08={};_0x5c1f08[_0x189654[_0xb9ad('0x25')]]={'$like':'%'+_0xcbae77[_0xb9ad('0x2c')]['filter']+'%'};return _0x5c1f08;}})});}_0x1d6c56=_[_0xb9ad('0x39')]({},_0x1d6c56,_0xcbae77[_0xb9ad('0x3a')]);var _0x58e33e={'where':_0x1d6c56[_0xb9ad('0x37')]};return db[_0xb9ad('0x3b')][_0xb9ad('0x1d')](_0x58e33e)[_0xb9ad('0x24')](function(_0xc02cc7){_0x56553d[_0xb9ad('0x1d')]=_0xc02cc7;if(_0xcbae77['query'][_0xb9ad('0x3c')]){_0x1d6c56[_0xb9ad('0x3d')]=[{'all':!![]}];}return db['UserProfile'][_0xb9ad('0x3e')](_0x1d6c56);})['then'](function(_0x34d951){_0x56553d[_0xb9ad('0x3f')]=_0x34d951;return _0x56553d;})['then'](respondWithFilteredResult(_0x1ba1f9,_0x1d6c56))['catch'](handleError(_0x1ba1f9,null));};exports['show']=function(_0x42ea9f,_0x26eb17){var _0x164040={'raw':![],'where':{'id':_0x42ea9f[_0xb9ad('0x40')]['id']}},_0x3d42fa={};_0x3d42fa[_0xb9ad('0x2a')]=_[_0xb9ad('0x2d')](db[_0xb9ad('0x3b')][_0xb9ad('0x28')]);_0x3d42fa['query']=_['keys'](_0x42ea9f[_0xb9ad('0x2c')]);_0x3d42fa[_0xb9ad('0x2e')]=_[_0xb9ad('0x2f')](_0x3d42fa[_0xb9ad('0x2a')],_0x3d42fa[_0xb9ad('0x2c')]);_0x164040['attributes']=_[_0xb9ad('0x2f')](_0x3d42fa[_0xb9ad('0x2a')],qs[_0xb9ad('0x31')](_0x42ea9f['query'][_0xb9ad('0x31')]));_0x164040['attributes']=_0x164040[_0xb9ad('0x30')]['length']?_0x164040[_0xb9ad('0x30')]:_0x3d42fa[_0xb9ad('0x2a')];if(_0x42ea9f[_0xb9ad('0x2c')][_0xb9ad('0x3c')]){_0x164040[_0xb9ad('0x3d')]=[{'all':!![]}];}_0x164040=_[_0xb9ad('0x39')]({},_0x164040,_0x42ea9f[_0xb9ad('0x3a')]);return db[_0xb9ad('0x3b')][_0xb9ad('0x41')](_0x164040)[_0xb9ad('0x24')](handleEntityNotFound(_0x26eb17,null))[_0xb9ad('0x24')](respondWithResult(_0x26eb17,null))[_0xb9ad('0x42')](handleError(_0x26eb17,null));};exports[_0xb9ad('0x43')]=function(_0x21d58d,_0x4349e8){return db[_0xb9ad('0x3b')]['create'](_0x21d58d[_0xb9ad('0x44')],{})['then'](respondWithResult(_0x4349e8,0xc9))['catch'](handleError(_0x4349e8,null));};exports[_0xb9ad('0x45')]=function(_0x1dfe19,_0x303d2d){var _0x3c9556={'where':{'id':_0x1dfe19[_0xb9ad('0x40')]['id']}},_0x2772bf={};_0x2772bf[_0xb9ad('0x2a')]=_['keys'](db[_0xb9ad('0x3b')][_0xb9ad('0x28')]);_0x3c9556[_0xb9ad('0x30')]=_[_0xb9ad('0x2f')](_0x2772bf[_0xb9ad('0x2a')],qs[_0xb9ad('0x31')](_0x1dfe19[_0xb9ad('0x2c')]['fields']));_0x3c9556[_0xb9ad('0x30')]=_0x3c9556[_0xb9ad('0x30')]['length']?_0x3c9556[_0xb9ad('0x30')]:_0x2772bf[_0xb9ad('0x2a')];if(_0x1dfe19[_0xb9ad('0x2c')][_0xb9ad('0x3c')]){_0x3c9556[_0xb9ad('0x3d')]=[{'all':!![]}];}_0x3c9556=_['merge']({},_0x3c9556,_0x1dfe19[_0xb9ad('0x3a')]);return db[_0xb9ad('0x3b')][_0xb9ad('0x41')](_0x3c9556)[_0xb9ad('0x24')](handleEntityNotFound(_0x303d2d,null))[_0xb9ad('0x24')](function(_0x2b0b86){if(_0x2b0b86){var _0x457f18=_0x2b0b86[_0xb9ad('0x46')]({'plain':!![]});_0x457f18=qs[_0xb9ad('0x47')](_0x457f18,['id',_0xb9ad('0x48'),_0xb9ad('0x49'),_0xb9ad('0x4a')]);_0x1dfe19[_0xb9ad('0x44')]=_[_0xb9ad('0x47')](_0x1dfe19[_0xb9ad('0x44')],['id',_0xb9ad('0x48'),'updatedAt']);return db[_0xb9ad('0x4b')][_0xb9ad('0x4c')](function(_0x3000e5){return db[_0xb9ad('0x3b')][_0xb9ad('0x43')](_[_0xb9ad('0x39')](_0x457f18,_0x1dfe19[_0xb9ad('0x44')]),{'include':_0x1dfe19[_0xb9ad('0x2c')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x3000e5})[_0xb9ad('0x24')](function(_0x3518b8){var _0x360387=_0x3518b8[_0xb9ad('0x46')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x1dfe19[_0xb9ad('0x40')]['id']},'raw':!![]})[_0xb9ad('0x24')](function(_0x1466e9){if(_0x1466e9){return BPromise[_0xb9ad('0x4d')](_0x1466e9,function(_0xf83216){return new BPromise(function(_0x1b72bd,_0x54a993){if(_0xf83216[_0xb9ad('0x4e')]===null||_0xf83216[_0xb9ad('0x4e')]===0x1)_0x1b72bd(null);return db[_0xb9ad('0x4f')][_0xb9ad('0x3e')]({'where':{'sectionId':_0xf83216['id']},'raw':!![]})[_0xb9ad('0x24')](function(_0x16df49){var _0x2d5e64=_[_0xb9ad('0x2b')](_0x16df49,function(_0xb85c57){return qs[_0xb9ad('0x47')](_0xb85c57,['id',_0xb9ad('0x48'),_0xb9ad('0x49'),_0xb9ad('0x50')]);});_0x1b72bd(_0x2d5e64);})[_0xb9ad('0x42')](function(_0x2680f2){_0x54a993(_0x2680f2);});})[_0xb9ad('0x24')](function(_0x7ba5ea){var _0xa60f26=qs[_0xb9ad('0x47')](_0xf83216,['id',_0xb9ad('0x48'),_0xb9ad('0x49')]);_0xa60f26[_0xb9ad('0x51')]=_0x360387['id'];if(_0x7ba5ea)_0xa60f26[_0xb9ad('0x52')]=_0x7ba5ea;return _0xa60f26;})[_0xb9ad('0x24')](function(_0x20e0da){return db[_0xb9ad('0x53')]['create'](_0x20e0da,{'include':[{'model':db[_0xb9ad('0x4f')],'as':_0xb9ad('0x52')}],'raw':!![],'transaction':_0x3000e5});});})['then'](function(){return _0x360387;});}});});});}})['then'](respondWithResult(_0x303d2d,0xc9))['catch'](handleError(_0x303d2d,null));};exports['update']=function(_0x2887f2,_0x446269){if(_0x2887f2[_0xb9ad('0x44')]['id']){delete _0x2887f2[_0xb9ad('0x44')]['id'];}return db[_0xb9ad('0x3b')][_0xb9ad('0x41')]({'where':{'id':_0x2887f2[_0xb9ad('0x40')]['id']}})[_0xb9ad('0x24')](handleEntityNotFound(_0x446269,null))[_0xb9ad('0x24')](saveUpdates(_0x2887f2[_0xb9ad('0x44')],null))[_0xb9ad('0x24')](respondWithResult(_0x446269,null))['catch'](handleError(_0x446269,null));};exports['destroy']=function(_0x3a2c22,_0x21352d){return db[_0xb9ad('0x3b')][_0xb9ad('0x41')]({'where':{'id':_0x3a2c22[_0xb9ad('0x40')]['id']}})[_0xb9ad('0x24')](handleEntityNotFound(_0x21352d,null))[_0xb9ad('0x24')](removeEntity(_0x21352d,null))[_0xb9ad('0x42')](handleError(_0x21352d,null));};exports[_0xb9ad('0x54')]=function(_0xd38da0,_0x847d88){return db[_0xb9ad('0x3b')][_0xb9ad('0x54')]()[_0xb9ad('0x24')](respondWithResult(_0x847d88,null))[_0xb9ad('0x42')](handleError(_0x847d88,null));};exports['addSections']=function(_0x493f5f,_0x1ea651){var _0x55e210=_0x493f5f[_0xb9ad('0x44')];return db['UserProfile'][_0xb9ad('0x41')]({'where':{'id':_0x493f5f[_0xb9ad('0x40')]['id']}})[_0xb9ad('0x24')](handleEntityNotFound(_0x1ea651,null))[_0xb9ad('0x24')](function(_0x361c32){if(_0x361c32){return db[_0xb9ad('0x4b')][_0xb9ad('0x4c')](function(_0x579652){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x493f5f[_0xb9ad('0x40')]['id'],'sectionId':_[_0xb9ad('0x2b')](_0x55e210,function(_0x233692){return _0x233692[_0xb9ad('0x50')];})},'transaction':_0x579652})['then'](function(){var _0x194c4b=_[_0xb9ad('0x2b')](_0x55e210,function(_0x1bed14){_0x1bed14['userProfileId']=_0x493f5f[_0xb9ad('0x40')]['id'];return _0x1bed14;});var _0x59de8a=[];return BPromise[_0xb9ad('0x4d')](_0x194c4b,function(_0x4f46b3){return db[_0xb9ad('0x53')]['create'](_0x4f46b3,{'include':[{'model':db[_0xb9ad('0x4f')],'as':'Resources'}],'raw':!![],'transaction':_0x579652})['then'](function(_0x4b97db){_0x59de8a[_0xb9ad('0x55')](_0x4b97db[_0xb9ad('0x46')]({'plain':!![]}));});})['then'](function(){return _0x59de8a;});});});}})[_0xb9ad('0x24')](function(_0x3772c9){return _0x3772c9;})[_0xb9ad('0x24')](respondWithResult(_0x1ea651,null))[_0xb9ad('0x42')](handleError(_0x1ea651,null));};exports[_0xb9ad('0x56')]=function(_0x27455d,_0x15f82c){var _0x20062f;return db[_0xb9ad('0x3b')][_0xb9ad('0x41')]({'where':{'id':_0x27455d[_0xb9ad('0x40')]['id']},'attributes':['id',_0xb9ad('0x25')]})[_0xb9ad('0x24')](handleEntityNotFound(_0x15f82c,null))[_0xb9ad('0x24')](function(_0x2f59ee){if(_0x2f59ee){_0x20062f=_0x2f59ee;return db[_0xb9ad('0x53')][_0xb9ad('0x23')]({'where':{'userProfileId':_0x27455d[_0xb9ad('0x40')]['id'],'sectionId':_0x27455d[_0xb9ad('0x2c')][_0xb9ad('0x57')]}});}})[_0xb9ad('0x24')](function(){return _0x20062f;})[_0xb9ad('0x24')](respondWithStatusCode(_0x15f82c,null))[_0xb9ad('0x42')](handleError(_0x15f82c,null));};exports[_0xb9ad('0x58')]=function(_0x2042f7,_0x44e23e){var _0x261587=[];var _0x13fec3=[];return db[_0xb9ad('0x53')][_0xb9ad('0x3e')]({'where':{'userProfileId':_0x2042f7['params']['id']},'raw':!![]})[_0xb9ad('0x24')](function(_0x2fad57){_0x261587=_[_0xb9ad('0x59')](_0x2fad57,function(_0x340d86){return _0x340d86[_0xb9ad('0x5a')]===0x1||_['includes']([0x3eb,0x709],_0x340d86['sectionId']);});if(!_[_0xb9ad('0x5b')](_0x261587)){return _[_0xb9ad('0x2b')](_0x261587,function(_0xce6841){return _0xce6841[_0xb9ad('0x50')];});}else{return;}})[_0xb9ad('0x24')](function(_0x1c40b6){if(_0x1c40b6)_0x13fec3=_0x1c40b6;if(_[_0xb9ad('0x5c')](_0x13fec3,0x64)){var _0xf97eb3=_['find'](_0x261587,{'sectionId':0x64});return hasDefaultDashboard(_0xf97eb3)[_0xb9ad('0x24')](function(_0x3d38f9){return _[_0xb9ad('0x2b')](_0x261587,function(_0x47cfeb){if(_0x47cfeb[_0xb9ad('0x50')]===0x64){_0x47cfeb[_0xb9ad('0x5d')]=_0x3d38f9;}return _0x47cfeb;});});}else{return;}})[_0xb9ad('0x24')](function(_0x1dae21){if(_0x1dae21)_0x261587=_0x1dae21;if(_[_0xb9ad('0x5c')](_0x13fec3,0x3eb)){var _0x4b569c=_[_0xb9ad('0x41')](_0x261587,{'sectionId':0x3eb});return getCustomDashboards(_0x4b569c)[_0xb9ad('0x24')](function(_0x148bfe){return _['map'](_0x261587,function(_0x54eaa7){if(_0x4b569c[_0xb9ad('0x5a')]){if(_0x54eaa7[_0xb9ad('0x50')]===0x3eb){_0x54eaa7['subsections']=_0x148bfe;}}else{if(_0x54eaa7[_0xb9ad('0x50')]===0x64){if(!_0x54eaa7[_0xb9ad('0x5d')]){_0x54eaa7[_0xb9ad('0x5d')]=[];}_0x54eaa7['subsections']=_0x54eaa7[_0xb9ad('0x5d')][_0xb9ad('0x5e')](_0x148bfe);}}return _0x54eaa7;});});}else{return;}})[_0xb9ad('0x24')](function(_0x5a0606){if(_0x5a0606)_0x261587=_0x5a0606;if(_[_0xb9ad('0x5c')](_0x13fec3,0x709)){var _0x27dda2=_[_0xb9ad('0x41')](_0x261587,{'sectionId':0x709});return getPlugins(_0x27dda2)[_0xb9ad('0x24')](function(_0x5aec57){if(_0x27dda2['enabled']){return _[_0xb9ad('0x2b')](_0x261587,function(_0x2d55be){if(_0x2d55be[_0xb9ad('0x50')]===0x709){_0x2d55be[_0xb9ad('0x5d')]=_0x5aec57;}return _0x2d55be;});}else{var _0x20607d={'sectionId':0x76c,'enabled':0x1,'subsections':_0x5aec57};var _0x35b5f7=_['map'](_0x261587);_0x35b5f7['push'](_0x20607d);return _0x35b5f7;}});}else{return;}})[_0xb9ad('0x24')](function(_0x5b0c58){if(_0x5b0c58)_0x261587=_0x5b0c58;return _[_0xb9ad('0x59')](_0x261587,[_0xb9ad('0x5a'),0x1]);})[_0xb9ad('0x24')](respondWithResult(_0x44e23e,null))[_0xb9ad('0x42')](handleError(_0x44e23e,null));};function hasDefaultDashboard(_0x596690){var _0x289890=[0x65];return new BPromise(function(_0x3653a2,_0xd0b8a1){try{if(_0x596690[_0xb9ad('0x4e')]){_0x3653a2(_0x289890);}else{return db[_0xb9ad('0x4f')][_0xb9ad('0x5f')]({'where':{'sectionId':_0x596690['id']},'raw':!![]})[_0xb9ad('0x24')](function(_0x5ae20d){_0x5ae20d?_0x3653a2(_0x289890):_0x3653a2();});}}catch(_0x50e175){_0xd0b8a1(_0x50e175);}});}function getCustomDashboards(_0x3f9084){var _0x370f71=[];return new BPromise(function(_0xb10de6,_0x4c2d13){try{if(_0x3f9084[_0xb9ad('0x4e')]){return db[_0xb9ad('0x60')][_0xb9ad('0x3e')]({'raw':!![]})['then'](function(_0x25e9ff){_0x25e9ff[_0xb9ad('0x61')](function(_0x58bb6b){_0x370f71[_0xb9ad('0x55')](_0x58bb6b['id']+0x1869f);});_0xb10de6(_0x370f71);});}else{return db[_0xb9ad('0x4f')][_0xb9ad('0x3e')]({'where':{'sectionId':_0x3f9084['id']},'raw':!![]})[_0xb9ad('0x24')](function(_0x3a4041){_0x3a4041[_0xb9ad('0x61')](function(_0x54a007){_0x370f71[_0xb9ad('0x55')](_0x54a007[_0xb9ad('0x62')]+0x1869f);});_0xb10de6(_0x370f71);});}}catch(_0x25ab1a){_0x4c2d13(_0x25ab1a);}});}function getPlugins(_0x2c601e){var _0x5e1b69=[];return new BPromise(function(_0x38d458,_0x4bc628){try{if(_0x2c601e['autoAssociation']){return db['Plugin']['findAll']({'raw':!![]})[_0xb9ad('0x24')](function(_0x3e1571){_0x3e1571[_0xb9ad('0x61')](function(_0x243f18){_0x5e1b69[_0xb9ad('0x55')](_0x243f18['id']+0x15b38);});_0x38d458(_0x5e1b69);});}else{return db[_0xb9ad('0x4f')][_0xb9ad('0x3e')]({'where':{'sectionId':_0x2c601e['id']},'raw':!![]})[_0xb9ad('0x24')](function(_0x3b26fc){_0x3b26fc['forEach'](function(_0x2e0aa6){_0x5e1b69[_0xb9ad('0x55')](_0x2e0aa6[_0xb9ad('0x62')]+0x15b38);});_0x38d458(_0x5e1b69);});}}catch(_0x1180f0){_0x4bc628(_0x1180f0);}});}exports[_0xb9ad('0x63')]=function(_0x303e23,_0x5e8171){return db[_0xb9ad('0x3b')][_0xb9ad('0x41')]({'where':{'id':_0x303e23[_0xb9ad('0x40')]['id']}})['then'](handleEntityNotFound(_0x5e8171,null))['then'](function(_0x369935){if(_0x369935){return db['sequelize']['transaction'](function(_0x1a8d75){return db[_0xb9ad('0x53')]['findAll']({'where':{'userProfileId':_0x303e23[_0xb9ad('0x40')]['id']},'attributes':['id'],'raw':!![]})[_0xb9ad('0x24')](function(_0x53d208){if(_0x53d208){return db[_0xb9ad('0x53')][_0xb9ad('0x23')]({'where':{'userProfileId':_0x303e23['params']['id'],'id':_['map'](_0x53d208,function(_0x280998){return _0x280998['id'];})},'transaction':_0x1a8d75});}})[_0xb9ad('0x24')](function(_0x246fcb){var _0x3b8bbe=_[_0xb9ad('0x2b')](_0x303e23[_0xb9ad('0x44')],function(_0x589b36){_0x589b36[_0xb9ad('0x51')]=_0x303e23['params']['id'];return _0x589b36;});return db[_0xb9ad('0x53')][_0xb9ad('0x64')](_0x3b8bbe,{'raw':!![],'transaction':_0x1a8d75});})['then'](function(_0x3b730f){var _0xd41583=_[_0xb9ad('0x59')](_[_0xb9ad('0x2b')](_0x3b730f,function(_0x5509ac){return _0x5509ac[_0xb9ad('0x46')]({'plain':!![]});}),{'includeAll':![]});if(_0xd41583){return db[_0xb9ad('0x53')][_0xb9ad('0x3e')]({'where':{'userProfileId':_0x303e23[_0xb9ad('0x40')]['id'],'sectionId':_[_0xb9ad('0x2b')](_0xd41583,function(_0x3796cb){return _0x3796cb[_0xb9ad('0x50')];})},'attributes':['id',_0xb9ad('0x50')],'raw':!![]})[_0xb9ad('0x24')](function(_0x58dde2){var _0x42b20c=_['map'](_0x303e23[_0xb9ad('0x44')],function(_0x2f46e2){_0x2f46e2[_0xb9ad('0x51')]=_0x303e23[_0xb9ad('0x40')]['id'];return _0x2f46e2;});return db[_0xb9ad('0x4f')][_0xb9ad('0x64')](_0x42b20c,{'raw':!![],'transaction':_0x1a8d75});});}})['catch'](handleError(_0x5e8171,null));});}})[_0xb9ad('0x24')](function(_0x11c4f0){var _0x4ef4e0=_['map'](_0x11c4f0,function(_0x1ce720){return _0x1ce720[_0xb9ad('0x46')]({'plain':!![]});});})[_0xb9ad('0x24')](respondWithResult(_0x5e8171,null))[_0xb9ad('0x42')](handleError(_0x5e8171,null));};exports[_0xb9ad('0x65')]=function(_0x5df71f,_0x36c424,_0x560d57){return db[_0xb9ad('0x3b')][_0xb9ad('0x41')]({'where':{'id':_0x5df71f['params']['id']}})['then'](handleEntityNotFound(_0x36c424,null))['then'](function(_0x11c79b){if(_0x11c79b){return _0x11c79b[_0xb9ad('0x65')](_0x5df71f['query']['ids']);}})[_0xb9ad('0x24')](respondWithStatusCode(_0x36c424,null))['catch'](handleError(_0x36c424,null));};exports[_0xb9ad('0x66')]=function(_0x3d8354,_0x23027b){var _0x10edfc={};if(!_0x3d8354['query'][_0xb9ad('0x67')])throw new Error('Missing\x20section\x20parameter');if(!_0x3d8354['query'][_0xb9ad('0x33')](_0xb9ad('0x34'))){_0x10edfc['limit']=qs[_0xb9ad('0x1c')](_0x3d8354[_0xb9ad('0x2c')][_0xb9ad('0x1c')]);_0x10edfc[_0xb9ad('0x1a')]=qs[_0xb9ad('0x1a')](_0x3d8354[_0xb9ad('0x2c')][_0xb9ad('0x1a')]);}return db['UserProfile'][_0xb9ad('0x41')]({'where':{'id':_0x3d8354['params']['id']}})[_0xb9ad('0x24')](function(_0x55ad2d){if(!_0x55ad2d)throw new Error(_0xb9ad('0x68')+_0x3d8354[_0xb9ad('0x40')]['id']);return db[_0xb9ad('0x3b')][_0xb9ad('0x66')](_0x3d8354);})[_0xb9ad('0x24')](respondWithFilteredResult(_0x23027b,_0x10edfc))['catch'](handleError(_0x23027b,null));}; \ No newline at end of file +var _0x6aea=['nolimit','offset','order','sort','where','pick','filter','VIRTUAL','UserProfile','includeAll','findAll','rows','catch','show','keys','length','merge','options','create','clone','params','include','find','get','omit','createdAt','updatedAt','body','UserProfileSection','each','autoAssociation','UserProfileResource','userProfileId','Resources','describe','transaction','sectionId','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','concat','findOne','Dashboard','forEach','resourceId','Plugin','sequelize','bulkCreate','removeResources','getResources','section','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6aea,0xaa));var _0xa6ae=function(_0x49ba10,_0x103217){_0x49ba10=_0x49ba10-0x0;var _0x2a6f19=_0x6aea[_0x49ba10];return _0x2a6f19;};'use strict';var emlformat=require(_0xa6ae('0x0'));var rimraf=require(_0xa6ae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa6ae('0x2'));var rp=require(_0xa6ae('0x3'));var moment=require(_0xa6ae('0x4'));var BPromise=require(_0xa6ae('0x5'));var Mustache=require(_0xa6ae('0x6'));var util=require('util');var path=require(_0xa6ae('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa6ae('0x8'));var fs=require('fs');var fs_extra=require(_0xa6ae('0x9'));var _=require(_0xa6ae('0xa'));var squel=require(_0xa6ae('0xb'));var crypto=require(_0xa6ae('0xc'));var jsforce=require(_0xa6ae('0xd'));var deskjs=require(_0xa6ae('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa6ae('0xf'));var Papa=require(_0xa6ae('0x10'));var Redis=require(_0xa6ae('0x11'));var authService=require(_0xa6ae('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa6ae('0x13'));var hardwareService=require(_0xa6ae('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xa6ae('0x15'));var config=require(_0xa6ae('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa6ae('0x17'))['db'];config[_0xa6ae('0x18')]=_[_0xa6ae('0x19')](config[_0xa6ae('0x18')],{'host':_0xa6ae('0x1a'),'port':0x18eb});var socket=require(_0xa6ae('0x1b'))(new Redis(config[_0xa6ae('0x18')]));require('./userProfile.socket')[_0xa6ae('0x1c')](socket);function respondWithStatusCode(_0x4049cf,_0xbf26b2){_0xbf26b2=_0xbf26b2||0xcc;return function(_0x2eb422){if(_0x2eb422){return _0x4049cf['sendStatus'](_0xbf26b2);}return _0x4049cf[_0xa6ae('0x1d')](_0xbf26b2)[_0xa6ae('0x1e')]();};}function respondWithResult(_0x501f85,_0x38aa01){_0x38aa01=_0x38aa01||0xc8;return function(_0x38339c){if(_0x38339c){return _0x501f85[_0xa6ae('0x1d')](_0x38aa01)[_0xa6ae('0x1f')](_0x38339c);}};}function respondWithFilteredResult(_0x458df5,_0x5907a2){return function(_0x231b6d){if(_0x231b6d){var _0x2348c=typeof _0x5907a2['offset']===_0xa6ae('0x20')&&typeof _0x5907a2[_0xa6ae('0x21')]===_0xa6ae('0x20');var _0x39c386=_0x231b6d[_0xa6ae('0x22')];var _0x58170d=_0x2348c?0x0:_0x5907a2['offset'];var _0x5354c7=_0x2348c?_0x231b6d[_0xa6ae('0x22')]:_0x5907a2['offset']+_0x5907a2[_0xa6ae('0x21')];var _0x3eb509;if(_0x5354c7>=_0x39c386){_0x5354c7=_0x39c386;_0x3eb509=0xc8;}else{_0x3eb509=0xce;}_0x458df5[_0xa6ae('0x1d')](_0x3eb509);return _0x458df5['set'](_0xa6ae('0x23'),_0x58170d+'-'+_0x5354c7+'/'+_0x39c386)[_0xa6ae('0x1f')](_0x231b6d);}return null;};}function patchUpdates(_0x1a5b56){return function(_0x181e37){try{jsonpatch[_0xa6ae('0x24')](_0x181e37,_0x1a5b56,!![]);}catch(_0xc85665){return BPromise[_0xa6ae('0x25')](_0xc85665);}return _0x181e37[_0xa6ae('0x26')]();};}function saveUpdates(_0x1faf2f,_0x153a20){return function(_0xc5a72f){if(_0xc5a72f){return _0xc5a72f[_0xa6ae('0x27')](_0x1faf2f)['then'](function(_0x5e5efd){return _0x5e5efd;});}return null;};}function removeEntity(_0x34d329,_0x4fe97a){return function(_0x108262){if(_0x108262){return _0x108262[_0xa6ae('0x28')]()[_0xa6ae('0x29')](function(){_0x34d329[_0xa6ae('0x1d')](0xcc)[_0xa6ae('0x1e')]();});}};}function handleEntityNotFound(_0x504f1d,_0x230eba){return function(_0x1d9190){if(!_0x1d9190){_0x504f1d[_0xa6ae('0x2a')](0x194);}return _0x1d9190;};}function handleError(_0x4c375e,_0x25077a){_0x25077a=_0x25077a||0x1f4;return function(_0x204908){logger['error'](_0x204908[_0xa6ae('0x2b')]);if(_0x204908[_0xa6ae('0x2c')]){delete _0x204908['name'];}_0x4c375e[_0xa6ae('0x1d')](_0x25077a)[_0xa6ae('0x2d')](_0x204908);};}exports['index']=function(_0x574643,_0x2b5e6f){var _0x1e13d0={},_0x5c9691={},_0x1b81eb={'count':0x0,'rows':[]};var _0x219104=_[_0xa6ae('0x2e')](db['UserProfile'][_0xa6ae('0x2f')],function(_0x3279b4){return{'name':_0x3279b4[_0xa6ae('0x30')],'type':_0x3279b4[_0xa6ae('0x31')][_0xa6ae('0x32')]};});_0x5c9691[_0xa6ae('0x33')]=_[_0xa6ae('0x2e')](_0x219104,_0xa6ae('0x2c'));_0x5c9691[_0xa6ae('0x34')]=_['keys'](_0x574643[_0xa6ae('0x34')]);_0x5c9691[_0xa6ae('0x35')]=_[_0xa6ae('0x36')](_0x5c9691[_0xa6ae('0x33')],_0x5c9691['query']);_0x1e13d0['attributes']=_['intersection'](_0x5c9691[_0xa6ae('0x33')],qs['fields'](_0x574643[_0xa6ae('0x34')][_0xa6ae('0x37')]));_0x1e13d0[_0xa6ae('0x38')]=_0x1e13d0[_0xa6ae('0x38')]['length']?_0x1e13d0['attributes']:_0x5c9691[_0xa6ae('0x33')];if(!_0x574643[_0xa6ae('0x34')][_0xa6ae('0x39')](_0xa6ae('0x3a'))){_0x1e13d0[_0xa6ae('0x21')]=qs['limit'](_0x574643[_0xa6ae('0x34')]['limit']);_0x1e13d0[_0xa6ae('0x3b')]=qs[_0xa6ae('0x3b')](_0x574643['query'][_0xa6ae('0x3b')]);}_0x1e13d0[_0xa6ae('0x3c')]=qs[_0xa6ae('0x3d')](_0x574643[_0xa6ae('0x34')][_0xa6ae('0x3d')]);_0x1e13d0[_0xa6ae('0x3e')]=qs['filters'](_[_0xa6ae('0x3f')](_0x574643['query'],_0x5c9691[_0xa6ae('0x35')]),_0x219104);if(_0x574643[_0xa6ae('0x34')][_0xa6ae('0x40')]){_0x1e13d0[_0xa6ae('0x3e')]=_['merge'](_0x1e13d0[_0xa6ae('0x3e')],{'$or':_[_0xa6ae('0x2e')](_0x219104,function(_0x2b58e4){if(_0x2b58e4['type']!==_0xa6ae('0x41')){var _0x595cfb={};_0x595cfb[_0x2b58e4[_0xa6ae('0x2c')]]={'$like':'%'+_0x574643[_0xa6ae('0x34')][_0xa6ae('0x40')]+'%'};return _0x595cfb;}})});}_0x1e13d0=_['merge']({},_0x1e13d0,_0x574643['options']);var _0x8591c6={'where':_0x1e13d0[_0xa6ae('0x3e')]};return db[_0xa6ae('0x42')][_0xa6ae('0x22')](_0x8591c6)[_0xa6ae('0x29')](function(_0x5c0b2b){_0x1b81eb[_0xa6ae('0x22')]=_0x5c0b2b;if(_0x574643['query'][_0xa6ae('0x43')]){_0x1e13d0['include']=[{'all':!![]}];}return db[_0xa6ae('0x42')][_0xa6ae('0x44')](_0x1e13d0);})[_0xa6ae('0x29')](function(_0x2b2dc4){_0x1b81eb[_0xa6ae('0x45')]=_0x2b2dc4;return _0x1b81eb;})[_0xa6ae('0x29')](respondWithFilteredResult(_0x2b5e6f,_0x1e13d0))[_0xa6ae('0x46')](handleError(_0x2b5e6f,null));};exports[_0xa6ae('0x47')]=function(_0x46ed1b,_0x3122e1){var _0x281a2b={'raw':![],'where':{'id':_0x46ed1b['params']['id']}},_0x483a31={};_0x483a31[_0xa6ae('0x33')]=_[_0xa6ae('0x48')](db['UserProfile'][_0xa6ae('0x2f')]);_0x483a31[_0xa6ae('0x34')]=_['keys'](_0x46ed1b['query']);_0x483a31[_0xa6ae('0x35')]=_[_0xa6ae('0x36')](_0x483a31[_0xa6ae('0x33')],_0x483a31[_0xa6ae('0x34')]);_0x281a2b['attributes']=_[_0xa6ae('0x36')](_0x483a31[_0xa6ae('0x33')],qs[_0xa6ae('0x37')](_0x46ed1b[_0xa6ae('0x34')][_0xa6ae('0x37')]));_0x281a2b['attributes']=_0x281a2b[_0xa6ae('0x38')][_0xa6ae('0x49')]?_0x281a2b[_0xa6ae('0x38')]:_0x483a31[_0xa6ae('0x33')];if(_0x46ed1b[_0xa6ae('0x34')][_0xa6ae('0x43')]){_0x281a2b['include']=[{'all':!![]}];}_0x281a2b=_[_0xa6ae('0x4a')]({},_0x281a2b,_0x46ed1b[_0xa6ae('0x4b')]);return db['UserProfile']['find'](_0x281a2b)[_0xa6ae('0x29')](handleEntityNotFound(_0x3122e1,null))['then'](respondWithResult(_0x3122e1,null))[_0xa6ae('0x46')](handleError(_0x3122e1,null));};exports[_0xa6ae('0x4c')]=function(_0x160c0f,_0xce17f8){return db[_0xa6ae('0x42')][_0xa6ae('0x4c')](_0x160c0f['body'],{})[_0xa6ae('0x29')](respondWithResult(_0xce17f8,0xc9))[_0xa6ae('0x46')](handleError(_0xce17f8,null));};exports[_0xa6ae('0x4d')]=function(_0x25949c,_0x5df4cf){var _0x48893d={'where':{'id':_0x25949c[_0xa6ae('0x4e')]['id']}},_0x4160e1={};_0x4160e1[_0xa6ae('0x33')]=_['keys'](db[_0xa6ae('0x42')][_0xa6ae('0x2f')]);_0x48893d[_0xa6ae('0x38')]=_[_0xa6ae('0x36')](_0x4160e1[_0xa6ae('0x33')],qs['fields'](_0x25949c[_0xa6ae('0x34')][_0xa6ae('0x37')]));_0x48893d[_0xa6ae('0x38')]=_0x48893d['attributes'][_0xa6ae('0x49')]?_0x48893d[_0xa6ae('0x38')]:_0x4160e1[_0xa6ae('0x33')];if(_0x25949c['query'][_0xa6ae('0x43')]){_0x48893d[_0xa6ae('0x4f')]=[{'all':!![]}];}_0x48893d=_[_0xa6ae('0x4a')]({},_0x48893d,_0x25949c[_0xa6ae('0x4b')]);return db[_0xa6ae('0x42')][_0xa6ae('0x50')](_0x48893d)[_0xa6ae('0x29')](handleEntityNotFound(_0x5df4cf,null))[_0xa6ae('0x29')](function(_0x5b47b3){if(_0x5b47b3){var _0x401e32=_0x5b47b3[_0xa6ae('0x51')]({'plain':!![]});_0x401e32=qs[_0xa6ae('0x52')](_0x401e32,['id',_0xa6ae('0x53'),_0xa6ae('0x54'),'crudPermissions']);_0x25949c[_0xa6ae('0x55')]=_[_0xa6ae('0x52')](_0x25949c[_0xa6ae('0x55')],['id','createdAt',_0xa6ae('0x54')]);return db['sequelize']['transaction'](function(_0x152e83){return db['UserProfile'][_0xa6ae('0x4c')](_[_0xa6ae('0x4a')](_0x401e32,_0x25949c[_0xa6ae('0x55')]),{'include':_0x25949c[_0xa6ae('0x34')][_0xa6ae('0x43')]?[{'all':!![]}]:undefined,'transaction':_0x152e83})[_0xa6ae('0x29')](function(_0x25dde3){var _0x542959=_0x25dde3[_0xa6ae('0x51')]({'plain':!![]});return db[_0xa6ae('0x56')][_0xa6ae('0x44')]({'where':{'userProfileId':_0x25949c[_0xa6ae('0x4e')]['id']},'raw':!![]})[_0xa6ae('0x29')](function(_0x13ffa1){if(_0x13ffa1){return BPromise[_0xa6ae('0x57')](_0x13ffa1,function(_0x183f08){return new BPromise(function(_0x3d4486,_0x148225){if(_0x183f08[_0xa6ae('0x58')]===null||_0x183f08['autoAssociation']===0x1)_0x3d4486(null);return db[_0xa6ae('0x59')][_0xa6ae('0x44')]({'where':{'sectionId':_0x183f08['id']},'raw':!![]})[_0xa6ae('0x29')](function(_0xb24604){var _0x47f3cc=_['map'](_0xb24604,function(_0x393071){return qs[_0xa6ae('0x52')](_0x393071,['id','createdAt',_0xa6ae('0x54'),'sectionId']);});_0x3d4486(_0x47f3cc);})[_0xa6ae('0x46')](function(_0x3bf57d){_0x148225(_0x3bf57d);});})[_0xa6ae('0x29')](function(_0x40d595){var _0x13ec87=qs[_0xa6ae('0x52')](_0x183f08,['id',_0xa6ae('0x53'),_0xa6ae('0x54')]);_0x13ec87[_0xa6ae('0x5a')]=_0x542959['id'];if(_0x40d595)_0x13ec87[_0xa6ae('0x5b')]=_0x40d595;return _0x13ec87;})[_0xa6ae('0x29')](function(_0x2d9197){return db['UserProfileSection'][_0xa6ae('0x4c')](_0x2d9197,{'include':[{'model':db['UserProfileResource'],'as':_0xa6ae('0x5b')}],'raw':!![],'transaction':_0x152e83});});})[_0xa6ae('0x29')](function(){return _0x542959;});}});});});}})['then'](respondWithResult(_0x5df4cf,0xc9))['catch'](handleError(_0x5df4cf,null));};exports[_0xa6ae('0x27')]=function(_0x5a4d8a,_0x1b2bbd){if(_0x5a4d8a[_0xa6ae('0x55')]['id']){delete _0x5a4d8a[_0xa6ae('0x55')]['id'];}return db['UserProfile']['find']({'where':{'id':_0x5a4d8a['params']['id']}})[_0xa6ae('0x29')](handleEntityNotFound(_0x1b2bbd,null))[_0xa6ae('0x29')](saveUpdates(_0x5a4d8a[_0xa6ae('0x55')],null))[_0xa6ae('0x29')](respondWithResult(_0x1b2bbd,null))['catch'](handleError(_0x1b2bbd,null));};exports[_0xa6ae('0x28')]=function(_0x21d801,_0x49a6c0){return db[_0xa6ae('0x42')][_0xa6ae('0x50')]({'where':{'id':_0x21d801['params']['id']}})[_0xa6ae('0x29')](handleEntityNotFound(_0x49a6c0,null))[_0xa6ae('0x29')](removeEntity(_0x49a6c0,null))[_0xa6ae('0x46')](handleError(_0x49a6c0,null));};exports[_0xa6ae('0x5c')]=function(_0x11d404,_0x41d271){return db[_0xa6ae('0x42')][_0xa6ae('0x5c')]()['then'](respondWithResult(_0x41d271,null))[_0xa6ae('0x46')](handleError(_0x41d271,null));};exports['addSections']=function(_0x3a32da,_0xdec625){var _0x56d2ac=_0x3a32da[_0xa6ae('0x55')];return db['UserProfile'][_0xa6ae('0x50')]({'where':{'id':_0x3a32da[_0xa6ae('0x4e')]['id']}})[_0xa6ae('0x29')](handleEntityNotFound(_0xdec625,null))[_0xa6ae('0x29')](function(_0x530f60){if(_0x530f60){return db['sequelize'][_0xa6ae('0x5d')](function(_0x1e97bf){return db[_0xa6ae('0x56')][_0xa6ae('0x28')]({'where':{'userProfileId':_0x3a32da[_0xa6ae('0x4e')]['id'],'sectionId':_[_0xa6ae('0x2e')](_0x56d2ac,function(_0x2c1872){return _0x2c1872[_0xa6ae('0x5e')];})},'transaction':_0x1e97bf})['then'](function(){var _0x1cd239=_[_0xa6ae('0x2e')](_0x56d2ac,function(_0xc91889){_0xc91889['userProfileId']=_0x3a32da[_0xa6ae('0x4e')]['id'];return _0xc91889;});var _0x40dadb=[];return BPromise[_0xa6ae('0x57')](_0x1cd239,function(_0x2c7285){return db[_0xa6ae('0x56')][_0xa6ae('0x4c')](_0x2c7285,{'include':[{'model':db[_0xa6ae('0x59')],'as':_0xa6ae('0x5b')}],'raw':!![],'transaction':_0x1e97bf})[_0xa6ae('0x29')](function(_0x792cbc){_0x40dadb[_0xa6ae('0x5f')](_0x792cbc['get']({'plain':!![]}));});})[_0xa6ae('0x29')](function(){return _0x40dadb;});});});}})['then'](function(_0x27af2b){return _0x27af2b;})['then'](respondWithResult(_0xdec625,null))[_0xa6ae('0x46')](handleError(_0xdec625,null));};exports[_0xa6ae('0x60')]=function(_0x37db93,_0x1a0f51){var _0x414156;return db[_0xa6ae('0x42')][_0xa6ae('0x50')]({'where':{'id':_0x37db93[_0xa6ae('0x4e')]['id']},'attributes':['id',_0xa6ae('0x2c')]})[_0xa6ae('0x29')](handleEntityNotFound(_0x1a0f51,null))[_0xa6ae('0x29')](function(_0x353c8e){if(_0x353c8e){_0x414156=_0x353c8e;return db[_0xa6ae('0x56')][_0xa6ae('0x28')]({'where':{'userProfileId':_0x37db93[_0xa6ae('0x4e')]['id'],'sectionId':_0x37db93[_0xa6ae('0x34')][_0xa6ae('0x61')]}});}})['then'](function(){return _0x414156;})[_0xa6ae('0x29')](respondWithStatusCode(_0x1a0f51,null))['catch'](handleError(_0x1a0f51,null));};exports[_0xa6ae('0x62')]=function(_0x2d507a,_0x43d0e4){var _0x4858f2=[];var _0x5418a8=[];return db[_0xa6ae('0x56')][_0xa6ae('0x44')]({'where':{'userProfileId':_0x2d507a[_0xa6ae('0x4e')]['id']},'raw':!![]})[_0xa6ae('0x29')](function(_0xd0994e){_0x4858f2=_[_0xa6ae('0x40')](_0xd0994e,function(_0x18bb3f){return _0x18bb3f[_0xa6ae('0x63')]===0x1||_[_0xa6ae('0x64')]([0x3eb,0x709],_0x18bb3f['sectionId']);});if(!_[_0xa6ae('0x65')](_0x4858f2)){return _[_0xa6ae('0x2e')](_0x4858f2,function(_0x187b4f){return _0x187b4f[_0xa6ae('0x5e')];});}else{return;}})[_0xa6ae('0x29')](function(_0x4111f6){if(_0x4111f6)_0x5418a8=_0x4111f6;if(_[_0xa6ae('0x64')](_0x5418a8,0x64)){var _0x1f17d7=_['find'](_0x4858f2,{'sectionId':0x64});return hasDefaultDashboard(_0x1f17d7)[_0xa6ae('0x29')](function(_0x49a0ea){return _[_0xa6ae('0x2e')](_0x4858f2,function(_0x55819b){if(_0x55819b[_0xa6ae('0x5e')]===0x64){_0x55819b[_0xa6ae('0x66')]=_0x49a0ea;}return _0x55819b;});});}else{return;}})[_0xa6ae('0x29')](function(_0x5d9692){if(_0x5d9692)_0x4858f2=_0x5d9692;if(_[_0xa6ae('0x64')](_0x5418a8,0x3eb)){var _0x387a54=_[_0xa6ae('0x50')](_0x4858f2,{'sectionId':0x3eb});return getCustomDashboards(_0x387a54)['then'](function(_0x553aae){return _[_0xa6ae('0x2e')](_0x4858f2,function(_0x4b8612){if(_0x387a54['enabled']){if(_0x4b8612[_0xa6ae('0x5e')]===0x3eb){_0x4b8612[_0xa6ae('0x66')]=_0x553aae;}}else{if(_0x4b8612[_0xa6ae('0x5e')]===0x64){if(!_0x4b8612[_0xa6ae('0x66')]){_0x4b8612[_0xa6ae('0x66')]=[];}_0x4b8612[_0xa6ae('0x66')]=_0x4b8612[_0xa6ae('0x66')][_0xa6ae('0x67')](_0x553aae);}}return _0x4b8612;});});}else{return;}})['then'](function(_0x4c27ec){if(_0x4c27ec)_0x4858f2=_0x4c27ec;if(_['includes'](_0x5418a8,0x709)){var _0x329f72=_[_0xa6ae('0x50')](_0x4858f2,{'sectionId':0x709});return getPlugins(_0x329f72)['then'](function(_0x4889be){if(_0x329f72['enabled']){return _[_0xa6ae('0x2e')](_0x4858f2,function(_0xc249c8){if(_0xc249c8[_0xa6ae('0x5e')]===0x709){_0xc249c8['subsections']=_0x4889be;}return _0xc249c8;});}else{var _0x25320f={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4889be};var _0x150a8d=_[_0xa6ae('0x2e')](_0x4858f2);_0x150a8d['push'](_0x25320f);return _0x150a8d;}});}else{return;}})[_0xa6ae('0x29')](function(_0x31c239){if(_0x31c239)_0x4858f2=_0x31c239;return _[_0xa6ae('0x40')](_0x4858f2,[_0xa6ae('0x63'),0x1]);})[_0xa6ae('0x29')](respondWithResult(_0x43d0e4,null))[_0xa6ae('0x46')](handleError(_0x43d0e4,null));};function hasDefaultDashboard(_0x973d68){var _0x136ba1=[0x65];return new BPromise(function(_0x4fd130,_0x521d39){try{if(_0x973d68[_0xa6ae('0x58')]){_0x4fd130(_0x136ba1);}else{return db['UserProfileResource'][_0xa6ae('0x68')]({'where':{'sectionId':_0x973d68['id']},'raw':!![]})[_0xa6ae('0x29')](function(_0xda09b){_0xda09b?_0x4fd130(_0x136ba1):_0x4fd130();});}}catch(_0x57e1f8){_0x521d39(_0x57e1f8);}});}function getCustomDashboards(_0x3579f0){var _0x15786f=[];return new BPromise(function(_0x200a9b,_0x4bf1c9){try{if(_0x3579f0['autoAssociation']){return db[_0xa6ae('0x69')]['findAll']({'raw':!![]})['then'](function(_0x805359){_0x805359['forEach'](function(_0x33295b){_0x15786f['push'](_0x33295b['id']+0x1869f);});_0x200a9b(_0x15786f);});}else{return db[_0xa6ae('0x59')][_0xa6ae('0x44')]({'where':{'sectionId':_0x3579f0['id']},'raw':!![]})['then'](function(_0x554e1d){_0x554e1d[_0xa6ae('0x6a')](function(_0x1b02fa){_0x15786f[_0xa6ae('0x5f')](_0x1b02fa[_0xa6ae('0x6b')]+0x1869f);});_0x200a9b(_0x15786f);});}}catch(_0x493e5e){_0x4bf1c9(_0x493e5e);}});}function getPlugins(_0x206917){var _0x1c8262=[];return new BPromise(function(_0x478846,_0x2eddfd){try{if(_0x206917[_0xa6ae('0x58')]){return db[_0xa6ae('0x6c')]['findAll']({'raw':!![]})[_0xa6ae('0x29')](function(_0x1e573e){_0x1e573e[_0xa6ae('0x6a')](function(_0x20ca59){_0x1c8262[_0xa6ae('0x5f')](_0x20ca59['id']+0x15b38);});_0x478846(_0x1c8262);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x206917['id']},'raw':!![]})[_0xa6ae('0x29')](function(_0x1416d2){_0x1416d2[_0xa6ae('0x6a')](function(_0x5a90f4){_0x1c8262[_0xa6ae('0x5f')](_0x5a90f4[_0xa6ae('0x6b')]+0x15b38);});_0x478846(_0x1c8262);});}}catch(_0x11d303){_0x2eddfd(_0x11d303);}});}exports['addResources']=function(_0x5cbbcc,_0x1ed29f){return db[_0xa6ae('0x42')][_0xa6ae('0x50')]({'where':{'id':_0x5cbbcc['params']['id']}})[_0xa6ae('0x29')](handleEntityNotFound(_0x1ed29f,null))[_0xa6ae('0x29')](function(_0x18288d){if(_0x18288d){return db[_0xa6ae('0x6d')]['transaction'](function(_0x3f4d4d){return db[_0xa6ae('0x56')][_0xa6ae('0x44')]({'where':{'userProfileId':_0x5cbbcc[_0xa6ae('0x4e')]['id']},'attributes':['id'],'raw':!![]})[_0xa6ae('0x29')](function(_0x28577a){if(_0x28577a){return db[_0xa6ae('0x56')][_0xa6ae('0x28')]({'where':{'userProfileId':_0x5cbbcc['params']['id'],'id':_[_0xa6ae('0x2e')](_0x28577a,function(_0xad4a52){return _0xad4a52['id'];})},'transaction':_0x3f4d4d});}})[_0xa6ae('0x29')](function(_0x21bbb6){var _0x1d569e=_[_0xa6ae('0x2e')](_0x5cbbcc['body'],function(_0x365144){_0x365144[_0xa6ae('0x5a')]=_0x5cbbcc[_0xa6ae('0x4e')]['id'];return _0x365144;});return db['UserProfileSection'][_0xa6ae('0x6e')](_0x1d569e,{'raw':!![],'transaction':_0x3f4d4d});})[_0xa6ae('0x29')](function(_0xc03ab2){var _0x11e319=_[_0xa6ae('0x40')](_[_0xa6ae('0x2e')](_0xc03ab2,function(_0x225bf4){return _0x225bf4['get']({'plain':!![]});}),{'includeAll':![]});if(_0x11e319){return db['UserProfileSection'][_0xa6ae('0x44')]({'where':{'userProfileId':_0x5cbbcc[_0xa6ae('0x4e')]['id'],'sectionId':_[_0xa6ae('0x2e')](_0x11e319,function(_0x22e36f){return _0x22e36f[_0xa6ae('0x5e')];})},'attributes':['id',_0xa6ae('0x5e')],'raw':!![]})[_0xa6ae('0x29')](function(_0x276dca){var _0x15e577=_['map'](_0x5cbbcc[_0xa6ae('0x55')],function(_0xca2c70){_0xca2c70[_0xa6ae('0x5a')]=_0x5cbbcc['params']['id'];return _0xca2c70;});return db['UserProfileResource'][_0xa6ae('0x6e')](_0x15e577,{'raw':!![],'transaction':_0x3f4d4d});});}})['catch'](handleError(_0x1ed29f,null));});}})['then'](function(_0x3b045b){var _0x17cd60=_[_0xa6ae('0x2e')](_0x3b045b,function(_0x1858a9){return _0x1858a9[_0xa6ae('0x51')]({'plain':!![]});});})['then'](respondWithResult(_0x1ed29f,null))[_0xa6ae('0x46')](handleError(_0x1ed29f,null));};exports[_0xa6ae('0x6f')]=function(_0x4b628d,_0xd2bc75,_0x218c3e){return db[_0xa6ae('0x42')][_0xa6ae('0x50')]({'where':{'id':_0x4b628d[_0xa6ae('0x4e')]['id']}})[_0xa6ae('0x29')](handleEntityNotFound(_0xd2bc75,null))['then'](function(_0x3339de){if(_0x3339de){return _0x3339de[_0xa6ae('0x6f')](_0x4b628d['query'][_0xa6ae('0x61')]);}})[_0xa6ae('0x29')](respondWithStatusCode(_0xd2bc75,null))[_0xa6ae('0x46')](handleError(_0xd2bc75,null));};exports[_0xa6ae('0x70')]=function(_0x4d2dea,_0x1f77a2){var _0x28317d={};if(!_0x4d2dea[_0xa6ae('0x34')][_0xa6ae('0x71')])throw new Error('Missing\x20section\x20parameter');if(!_0x4d2dea[_0xa6ae('0x34')]['hasOwnProperty'](_0xa6ae('0x3a'))){_0x28317d['limit']=qs[_0xa6ae('0x21')](_0x4d2dea[_0xa6ae('0x34')][_0xa6ae('0x21')]);_0x28317d['offset']=qs[_0xa6ae('0x3b')](_0x4d2dea['query'][_0xa6ae('0x3b')]);}return db[_0xa6ae('0x42')][_0xa6ae('0x50')]({'where':{'id':_0x4d2dea[_0xa6ae('0x4e')]['id']}})[_0xa6ae('0x29')](function(_0x7f8369){if(!_0x7f8369)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x4d2dea['params']['id']);return db[_0xa6ae('0x42')][_0xa6ae('0x70')](_0x4d2dea);})[_0xa6ae('0x29')](respondWithFilteredResult(_0x1f77a2,_0x28317d))[_0xa6ae('0x46')](handleError(_0x1f77a2,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index d108fd7..0334d17 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 _0x4753=['update','emit','hasOwnProperty','exports','events','../../mysqldb','UserProfile','save'];(function(_0x53b1af,_0x5e78ff){var _0x514986=function(_0x14b36a){while(--_0x14b36a){_0x53b1af['push'](_0x53b1af['shift']());}};_0x514986(++_0x5e78ff);}(_0x4753,0x1f4));var _0x3475=function(_0x32e78f,_0xf3347e){_0x32e78f=_0x32e78f-0x0;var _0xec21b0=_0x4753[_0x32e78f];return _0xec21b0;};'use strict';var EventEmitter=require(_0x3475('0x0'));var UserProfile=require(_0x3475('0x1'))['db'][_0x3475('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3475('0x3'),'afterUpdate':_0x3475('0x4'),'afterDestroy':'remove'};function emitEvent(_0x212d98){return function(_0x4c6fd2,_0x5a801b,_0x5de37e){UserProfileEvents['emit'](_0x212d98+':'+_0x4c6fd2['id'],_0x4c6fd2);UserProfileEvents[_0x3475('0x5')](_0x212d98,_0x4c6fd2);_0x5de37e(null);};}for(var e in events){if(events[_0x3475('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x3475('0x7')]=UserProfileEvents; \ No newline at end of file +var _0xf981=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','UserProfile','setMaxListeners'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xf981,0xe6));var _0x1f98=function(_0x1f0cdc,_0x21df8d){_0x1f0cdc=_0x1f0cdc-0x0;var _0x1de2fd=_0xf981[_0x1f0cdc];return _0x1de2fd;};'use strict';var EventEmitter=require(_0x1f98('0x0'));var UserProfile=require(_0x1f98('0x1'))['db'][_0x1f98('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x1f98('0x3')](0x0);var events={'afterCreate':_0x1f98('0x4'),'afterUpdate':_0x1f98('0x5'),'afterDestroy':_0x1f98('0x6')};function emitEvent(_0xd68165){return function(_0x562a81,_0x14da55,_0x15c6fa){UserProfileEvents[_0x1f98('0x7')](_0xd68165+':'+_0x562a81['id'],_0x562a81);UserProfileEvents[_0x1f98('0x7')](_0xd68165,_0x562a81);_0x15c6fa(null);};}for(var e in events){if(events[_0x1f98('0x8')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index db4c251..6b333b3 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 _0x62b4=['role','Telephones','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','zendeskaccounts','ZendeskAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','Schedule','sounds','tags','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','slice','Sequelize','QueryTypes','select','ui.','InteractionId','ui.createdAt','from','_interactions','ui.UserId\x20=\x20?','sequelize','query','define','user_profiles','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','params','all','ignore','union','model','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','where','pick','key','VIRTUAL','find','foreignKey','forEach','merge','options','autoAssociation','includeAll','include','reportType','DefaultReports','custom','CustomReports','count','rows','ids','extraQueryConditions','CmContact','Tags','color','tag','Tag','ThroughTags','true','chat','sms','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','resolve','AnalyticExtractedReport','resourceId','type','squareprojects','childModel','SquareOdbc','squarerecordings','parentSections','SquareProjects','name','projectName','projects','Lists','ListId','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','VoiceRecording','Agents','membername','User'];(function(_0x377e04,_0x53aaac){var _0x1219f7=function(_0x154ddb){while(--_0x154ddb){_0x377e04['push'](_0x377e04['shift']());}};_0x1219f7(++_0x53aaac);}(_0x62b4,0x8e));var _0x462b=function(_0x45f6cb,_0x531af6){_0x45f6cb=_0x45f6cb-0x0;var _0x5b7f93=_0x62b4[_0x45f6cb];return _0x5b7f93;};'use strict';var _=require(_0x462b('0x0'));var attributes=require(_0x462b('0x1'));var qs=require(_0x462b('0x2'));var squel=require(_0x462b('0x3'));module[_0x462b('0x4')]=function(_0x43c959){var _0x181803=_0x43c959[_0x462b('0x5')];function _0x42860c(_0x3b001d,_0x546041){return new Promise(function(_0x2676d3,_0x28f510){if(!_0x546041)return _0x2676d3(null);var _0x1b22ec=_0x546041[_0x462b('0x6')]?{[_0x546041[_0x462b('0x6')][_0x462b('0x7')]]:_0x546041[_0x462b('0x6')][_0x462b('0x8')]}:undefined;return _0x181803[_0x3b001d][_0x462b('0x9')]({'where':_0x1b22ec,'raw':!![]})[_0x462b('0xa')](function(_0x296fe1){_0x546041[_0x462b('0xb')]=_[_0x462b('0xc')](_0x296fe1,'id');_0x2676d3(_0x546041);})['catch'](function(_0x1cd919){_0x28f510(_0x1cd919);});});}function _0x4d200b(_0x6ce833,_0x250f56){return new Promise(function(_0x301424,_0x3e5d98){var _0x5eeb7a=_0x6ce833[_0x462b('0x6')]?{[_0x6ce833[_0x462b('0x6')]['field']]:_0x6ce833[_0x462b('0x6')][_0x462b('0x8')]}:undefined;return _0x181803[_0x6ce833['model']][_0x462b('0x9')]({'where':_0x5eeb7a,'raw':!![]})['then'](function(_0x32175c){_0x250f56[_0x462b('0xb')]=_[_0x462b('0xc')](_0x32175c,function(_0x3bd70a){return _0x3bd70a['name'];});_0x301424(_0x250f56);})[_0x462b('0xd')](function(_0x59b316){_0x3e5d98(_0x59b316);});});}function _0xb28c05(_0x5311d3,_0xdd5379,_0x519953){if(!_0xdd5379)return Promise[_0x462b('0xe')](null);return new Promise(function(_0x44c717,_0x154f73){return _0x181803['UserProfileResource']['findAll']({'where':{'sectionId':_0xdd5379['id']},'raw':!![]})[_0x462b('0xa')](function(_0x5726a0){if(_0x5311d3[_0x462b('0x7')]&&_0x5311d3[_0x462b('0x7')]!=='id'){_0xdd5379[_0x462b('0xb')]=_[_0x462b('0xc')](_0x5726a0,function(_0x408f13){return _0x408f13[_0x5311d3[_0x462b('0x7')]];});}else{if(_0x519953===_0x462b('0xf')){_0xdd5379[_0x462b('0xb')]=_[_0x462b('0xc')](_0x5726a0,function(_0x311994){return{'id':_0x311994[_0x462b('0x10')],'type':_0x311994[_0x462b('0x11')]};});}else{_0xdd5379[_0x462b('0xb')]=_['map'](_0x5726a0,function(_0x53aaef){return _0x53aaef[_0x462b('0x10')];});}}_0x44c717(_0xdd5379);})['catch'](function(_0x1d8549){_0x154f73(_0x1d8549);});});}function _0x5bc0a0(_0xe13dfd,_0x534f0b){var _0x167613={'parentSections':[]};switch(_0xe13dfd['toLowerCase']()){case _0x462b('0x12'):_0x167613[_0x462b('0x13')]='SquareProject';break;case'odbc':_0x167613['childModel']=_0x462b('0x14');break;case _0x462b('0x15'):_0x167613[_0x462b('0x13')]='SquareRecording';_0x167613[_0x462b('0x16')]=[{'name':_0x462b('0x17'),'field':_0x462b('0x18'),'foreignKey':_0x462b('0x19')}];break;case _0x462b('0x1a'):_0x167613[_0x462b('0x13')]='JscriptyProject';break;case'contacts':_0x167613[_0x462b('0x13')]='CmContact';_0x167613[_0x462b('0x16')]=[{'name':_0x462b('0x1b'),'field':'id','foreignKey':_0x462b('0x1c')}];break;case'lists':_0x167613[_0x462b('0x13')]='CmList';break;case'companies':_0x167613['childModel']=_0x462b('0x1d');break;case _0x462b('0x1e'):_0x167613[_0x462b('0x13')]='CmCustomField';break;case _0x462b('0x1f'):_0x167613[_0x462b('0x13')]=_0x462b('0x20');break;case _0x462b('0x21'):_0x167613[_0x462b('0x13')]='ChatWebsite';break;case'faxqueues':_0x167613[_0x462b('0x13')]=_0x462b('0x22');break;case _0x462b('0x23'):_0x167613[_0x462b('0x13')]=_0x462b('0x24');break;case _0x462b('0x25'):case'internalroutes':case _0x462b('0x26'):_0x167613[_0x462b('0x13')]=_0x462b('0x27');break;case _0x462b('0x28'):_0x167613[_0x462b('0x13')]=_0x462b('0x29');break;case'voicemails':_0x167613[_0x462b('0x13')]=_0x462b('0x2a');break;case'voicerecordings':_0x167613[_0x462b('0x13')]=_0x462b('0x2b');_0x167613[_0x462b('0x16')]=[{'name':_0x462b('0x2c'),'field':_0x462b('0x18'),'foreignKey':_0x462b('0x2d'),'model':_0x462b('0x2e'),'filter':{'field':_0x462b('0x2f'),'value':['agent']}},{'name':_0x462b('0x30'),'field':_0x462b('0x18'),'foreignKey':_0x462b('0x2d'),'model':'User','filter':{'field':'role','value':[_0x462b('0x31')]}},{'name':_0x462b('0x32'),'field':_0x462b('0x18'),'foreignKey':_0x462b('0x33'),'model':_0x462b('0x34'),'filter':{'field':_0x462b('0x11'),'value':['inbound']}},{'name':_0x462b('0x35'),'field':_0x462b('0x18'),'foreignKey':_0x462b('0x33'),'model':_0x462b('0x34'),'filter':{'field':_0x462b('0x11'),'value':[_0x462b('0x36')]}}];break;case'musiconholds':_0x167613['childModel']='VoiceMusicOnHold';break;case _0x462b('0x37'):_0x167613[_0x462b('0x13')]='VoiceChanSpy';break;case _0x462b('0x38'):_0x167613[_0x462b('0x13')]=_0x462b('0x39');break;case _0x462b('0x3a'):_0x167613[_0x462b('0x13')]=_0x462b('0x3b');break;case'mailqueues':_0x167613[_0x462b('0x13')]=_0x462b('0x3c');break;case _0x462b('0x3d'):_0x167613[_0x462b('0x13')]=_0x462b('0x3e');break;case _0x462b('0x3f'):_0x167613['childModel']=_0x462b('0x40');break;case _0x462b('0x41'):_0x167613[_0x462b('0x13')]=_0x462b('0x42');break;case _0x462b('0x43'):_0x167613['childModel']='OpenchannelAccount';break;case _0x462b('0x44'):_0x167613[_0x462b('0x13')]=_0x462b('0x45');break;case _0x462b('0x46'):_0x167613[_0x462b('0x13')]=_0x462b('0x47');break;case'whatsappqueues':_0x167613[_0x462b('0x13')]=_0x462b('0x48');break;case _0x462b('0x49'):_0x167613['childModel']=_0x462b('0x4a');break;case _0x462b('0x4b'):_0x167613[_0x462b('0x13')]=_0x462b('0x4c');break;case _0x462b('0x4d'):case _0x462b('0x4e'):_0x167613[_0x462b('0x13')]=_0x462b('0x34');if(_0x534f0b){_0x167613[_0x462b('0x16')]=[{'name':'VoiceQueues'},{'name':_0x462b('0x35')}];}break;case _0x462b('0x4f'):case _0x462b('0x50'):case _0x462b('0x51'):_0x167613[_0x462b('0x13')]=_0x462b('0x2e');if(_0x534f0b){_0x167613[_0x462b('0x16')]=[{'name':_0x462b('0x52'),'filter':{'field':_0x462b('0x2f'),'value':['admin','user']},'ignore':!![]},{'name':'Agents'},{'name':_0x462b('0x30')}];}break;case _0x462b('0x53'):_0x167613[_0x462b('0x13')]=_0x462b('0x54');break;case'salesforceaccounts':_0x167613[_0x462b('0x13')]='SalesforceAccount';break;case _0x462b('0x55'):_0x167613[_0x462b('0x13')]=_0x462b('0x56');break;case _0x462b('0x57'):_0x167613[_0x462b('0x13')]=_0x462b('0x58');break;case _0x462b('0x59'):_0x167613[_0x462b('0x13')]=_0x462b('0x5a');break;case _0x462b('0x5b'):_0x167613[_0x462b('0x13')]=_0x462b('0x5c');break;case'vtigeraccounts':_0x167613[_0x462b('0x13')]=_0x462b('0x2e');break;case _0x462b('0x5d'):_0x167613[_0x462b('0x13')]=_0x462b('0x5e');break;case'dispositions':_0x167613[_0x462b('0x13')]=_0x462b('0x5f');break;case _0x462b('0x60'):_0x167613[_0x462b('0x13')]=_0x462b('0x61');break;case _0x462b('0x62'):_0x167613['childModel']=_0x462b('0x63');break;case _0x462b('0x64'):_0x167613[_0x462b('0x13')]=_0x462b('0x65');break;case'scheduler':_0x167613[_0x462b('0x13')]=_0x462b('0x66');break;case _0x462b('0x67'):_0x167613[_0x462b('0x13')]='Sound';break;case _0x462b('0x68'):_0x167613[_0x462b('0x13')]='Tag';break;case _0x462b('0x69'):_0x167613[_0x462b('0x13')]=_0x462b('0x6a');break;case _0x462b('0x6b'):_0x167613[_0x462b('0x13')]=_0x462b('0x6c');break;case _0x462b('0x6d'):_0x167613[_0x462b('0x13')]=_0x462b('0x6e');break;case _0x462b('0x6f'):_0x167613[_0x462b('0x13')]=_0x462b('0x70');break;case _0x462b('0x71'):_0x167613[_0x462b('0x13')]=_0x462b('0x72');break;case _0x462b('0x73'):_0x167613[_0x462b('0x13')]=_0x462b('0xf');_0x167613[_0x462b('0x16')]=[{'name':_0x462b('0x74'),'field':'id','foreignKey':_0x462b('0x75')}];break;case _0x462b('0x76'):_0x167613['childModel']=_0x462b('0x77');break;}return _0x167613;}function _0x56fefb(_0xa5060c,_0xa37aa2){var _0x58e983=_0xa5060c[_0x462b('0x78')](0x0)['toUpperCase']()+_0xa5060c[_0x462b('0x79')](0x1);var _0x4e6acd={'type':_0x181803[_0x462b('0x7a')][_0x462b('0x7b')]['SELECT'],'raw':!![]};return new Promise(function(_0xb9e8bd,_0x4c27a9){var _0x558978=squel[_0x462b('0x7c')]()['field'](_0x462b('0x7d')+_0x58e983+_0x462b('0x7e'),'id')[_0x462b('0x7')](_0x462b('0x7f'))[_0x462b('0x80')]('user_has_'+_0xa5060c+_0x462b('0x81'),'ui')['where'](_0x462b('0x82'),_0xa37aa2['id']);return _0x181803[_0x462b('0x83')][_0x462b('0x84')](_0x558978['toString'](),_0x4e6acd)[_0x462b('0xa')](function(_0x56477c){_0xa37aa2[_0x58e983+'OpenTabs']=_0x56477c;_0xb9e8bd(_0x56477c);})[_0x462b('0xd')](function(_0x217671){_0x4c27a9(_0x217671);});});}return _0x43c959[_0x462b('0x85')]('UserProfile',attributes,{'tableName':_0x462b('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xa86dfb){var _0x43ebab={'raw':_0xa86dfb['query']['raw'],'where':{}};var _0x162f30={};var _0x4d7622={'count':0x0,'rows':[]};var _0x291b31=_0xa86dfb[_0x462b('0x84')]['section'];var _0x1081b4=_0xa86dfb['query'][_0x462b('0x87')]||![];var _0x1d3c56=_0x5bc0a0(_0x291b31,_0x1081b4);if(!_0x1d3c56[_0x462b('0x13')])throw new Error(_0x462b('0x88')+_0x291b31+'\x27');var _0x5ac59f=[{'name':_0x291b31}];if(!_[_0x462b('0x89')](_0x1d3c56[_0x462b('0x16')]))_0x5ac59f=_0x1d3c56[_0x462b('0x16')];var _0x26aa63=[];for(var _0x4da617=0x0;_0x4da617<_0x5ac59f[_0x462b('0x8a')];_0x4da617++){_0x26aa63[_0x462b('0x8b')](_0x181803['UserProfileSection']['find']({'where':{'userProfileId':_0xa86dfb[_0x462b('0x8c')]['id'],'name':_0x5ac59f[_0x4da617][_0x462b('0x18')]},'raw':!![]}));}return Promise[_0x462b('0x8d')](_0x26aa63)['then'](function(_0x479e70){var _0xf8ff88=_['filter'](_0x479e70,function(_0x1a3b13){return _0x1a3b13?_0x1a3b13:undefined;});var _0x1c1560=_[_0x462b('0x6')](_0x5ac59f,[_0x462b('0x8e'),!![]]);var _0x298193=_['isEmpty'](_0xf8ff88)&&_[_0x462b('0x89')](_0x1c1560)?null:_[_0x462b('0x8f')](_0x1c1560,_0xf8ff88);if(!_0x298193)return null;var _0x515b65=[];for(var _0x54d051=0x0;_0x54d051<_0x298193[_0x462b('0x8a')];_0x54d051++){var _0xb4a9e7=_['find'](_0x5ac59f,function(_0x295889){return _0x298193[_0x54d051]?_0x295889[_0x462b('0x18')]===_0x298193[_0x54d051][_0x462b('0x18')]:null;});if(_0xb4a9e7){if(_0x298193[_0x54d051][_0x462b('0x8e')]){_0x515b65['push'](_0x42860c(_0x1d3c56[_0x462b('0x13')],_0x298193[_0x54d051]));}else{if(!_0x298193[_0x54d051]['autoAssociation']){_0x515b65[_0x462b('0x8b')](_0xb28c05(_0xb4a9e7,_0x298193[_0x54d051],_0x1d3c56[_0x462b('0x13')]));}else{if(_0xb4a9e7[_0x462b('0x90')]){_0x515b65[_0x462b('0x8b')](_0x4d200b(_0xb4a9e7,_0x298193[_0x54d051]));}}}}}return Promise[_0x462b('0x8d')](_0x515b65);})[_0x462b('0xa')](function(_0x5cb78a){var _0x3fb309=_0x5cb78a;var _0x5389ae=null;if(_0x3fb309){_0x5389ae=_0x3fb309['length']===0x1?_0x3fb309[0x0]:null;}if(!_0x5389ae&&!_0x3fb309)return _0x4d7622;var _0x4412f7=_0x181803[_0x1d3c56[_0x462b('0x13')]]['rawAttributes'];_0x162f30[_0x462b('0x90')]=_[_0x462b('0x91')](_0x4412f7);_0x162f30[_0x462b('0x84')]=_[_0x462b('0x91')](_0xa86dfb[_0x462b('0x84')]);_0x162f30[_0x462b('0x92')]=_[_0x462b('0x93')](_0x162f30[_0x462b('0x90')],_0x162f30[_0x462b('0x84')]);_0x43ebab[_0x462b('0x94')]=_[_0x462b('0x93')](_0x162f30[_0x462b('0x90')],qs['fields'](_0xa86dfb['query'][_0x462b('0x95')]));_0x43ebab['attributes']=_0x43ebab[_0x462b('0x94')]['length']?_0x43ebab[_0x462b('0x94')]:_0x162f30[_0x462b('0x90')];if(!_0xa86dfb['query'][_0x462b('0x96')]('nolimit')){_0x43ebab[_0x462b('0x97')]=qs['limit'](_0xa86dfb[_0x462b('0x84')][_0x462b('0x97')]);_0x43ebab[_0x462b('0x98')]=qs[_0x462b('0x98')](_0xa86dfb[_0x462b('0x84')][_0x462b('0x98')]);}_0x43ebab[_0x462b('0x99')]=qs[_0x462b('0x9a')](_0xa86dfb[_0x462b('0x84')][_0x462b('0x9a')]);_0x43ebab[_0x462b('0x9b')]=qs['filters'](_[_0x462b('0x9c')](_0xa86dfb[_0x462b('0x84')],_0x162f30[_0x462b('0x92')]));if(_0xa86dfb[_0x462b('0x84')][_0x462b('0x6')]){_0x43ebab[_0x462b('0x9b')]=_['merge'](_0x43ebab['where'],{'$or':_['map'](_0x4412f7,function(_0x20054f){if(_0x20054f[_0x462b('0x11')][_0x462b('0x9d')]!==_0x462b('0x9e')){var _0x2d188e={};_0x2d188e[_0x20054f['field']]={'$like':'%'+_0xa86dfb[_0x462b('0x84')][_0x462b('0x6')]+'%'};return _0x2d188e;}})});}var _0x3998e6=[];var _0x16d375=null;var _0xf32998={};if(_0x5389ae){_0x16d375=_[_0x462b('0x9f')](_0x5ac59f,[_0x462b('0x18'),_0x5389ae[_0x462b('0x18')]]);if(_0x16d375[_0x462b('0x7')]){_0xf32998={};if(_0x1d3c56[_0x462b('0x13')]===_0x462b('0xf')){_0xf32998[_0x16d375[_0x462b('0xa0')]]=_[_0x462b('0xc')](_0x5389ae[_0x462b('0xb')],'id');}else{_0xf32998[_0x16d375['foreignKey']]=_0x5389ae[_0x462b('0xb')];}_0x3998e6[_0x462b('0x8b')](_0xf32998);}else{_0x43ebab[_0x462b('0x9b')]['id']=_0x5389ae['associatedResources'];}}else{for(var _0x3ebf25=0x0;_0x3ebf25<_0x3fb309[_0x462b('0x8a')];_0x3ebf25++){_0x16d375=_[_0x462b('0x9f')](_0x5ac59f,[_0x462b('0x18'),_0x3fb309[_0x3ebf25][_0x462b('0x18')]]);if(_0x16d375[_0x462b('0x7')]){_0xf32998={};_0xf32998[_0x16d375[_0x462b('0xa0')]]=_0x3fb309[_0x3ebf25][_0x462b('0xb')];_0x3998e6[_0x462b('0x8b')](_0xf32998);}else{if(!_0x43ebab[_0x462b('0x9b')]['id'])_0x43ebab[_0x462b('0x9b')]['id']=[];_0x3fb309[_0x3ebf25]['associatedResources'][_0x462b('0xa1')](function(_0x13f9b7){_0x43ebab['where']['id'][_0x462b('0x8b')](_0x13f9b7);});}}}if(!_['isEmpty'](_0x3998e6)){_0x43ebab[_0x462b('0x9b')]=_[_0x462b('0xa2')](_0x43ebab[_0x462b('0x9b')],{'$and':{'$or':_0x3998e6}});}_0x43ebab=_['merge']({},_0x43ebab,_0xa86dfb[_0x462b('0xa3')]);if(_0x5389ae&&!_0x5389ae[_0x462b('0xa4')]&&_0x1d3c56['childModel']===_0x462b('0xf')){if(_0xa86dfb[_0x462b('0x84')][_0x462b('0xa5')]){_0x43ebab[_0x462b('0xa6')]=[{'all':!![]}];}return _0x181803[_0x1d3c56[_0x462b('0x13')]][_0x462b('0x9')](_0x43ebab)['then'](function(_0x1440ae){var _0x15363d=[];_0x1440ae[_0x462b('0xa1')](function(_0x43a54){var _0x944cd7;switch(_0x43a54[_0x462b('0xa7')]){case'default':_0x944cd7=_[_0x462b('0x9f')](_0x5389ae[_0x462b('0xb')],function(_0x29cbf8){return _0x29cbf8['id']===_0x43a54[_0x462b('0x75')]&&_0x29cbf8[_0x462b('0x11')]===_0x462b('0xa8');});break;case _0x462b('0xa9'):_0x944cd7=_[_0x462b('0x9f')](_0x5389ae[_0x462b('0xb')],function(_0x4068ae){return _0x4068ae['id']===_0x43a54[_0x462b('0x75')]&&_0x4068ae[_0x462b('0x11')]===_0x462b('0xaa');});break;}if(_0x944cd7)_0x15363d[_0x462b('0x8b')](_0x43a54);});_0x4d7622[_0x462b('0xab')]=_0x15363d[_0x462b('0x8a')];_0x4d7622[_0x462b('0xac')]=_0x15363d;return _0x4d7622;});}else{if(!_[_0x462b('0x89')](_0xa86dfb[_0x462b('0x84')]['ids'])){_0x43ebab['where']['id']=_0x43ebab[_0x462b('0x9b')]['id']?_[_0x462b('0x93')](_0x43ebab[_0x462b('0x9b')]['id'],_0xa86dfb['query'][_0x462b('0xad')]):_0xa86dfb[_0x462b('0x84')][_0x462b('0xad')];if(_0xa86dfb[_0x462b('0x84')]['customSorting']){_0x43ebab[_0x462b('0x99')]=_0xa86dfb[_0x462b('0x84')]['customSorting'];}}if(_0xa86dfb[_0x462b('0x84')]['extraQueryConditions']){_0x43ebab[_0x462b('0x9b')]=_[_0x462b('0xa2')](_0x43ebab[_0x462b('0x9b')],{'$and':_0xa86dfb['query'][_0x462b('0xae')]});}return _0x181803[_0x1d3c56[_0x462b('0x13')]][_0x462b('0xab')]({'where':_0x43ebab[_0x462b('0x9b')]})['then'](function(_0xe01bbc){_0x4d7622[_0x462b('0xab')]=_0xe01bbc;if(_0xa86dfb[_0x462b('0x84')][_0x462b('0xa5')]){if(_0x1d3c56[_0x462b('0x13')]===_0x462b('0xaf')){_0x43ebab[_0x462b('0xa6')]=[{'model':_0x181803['Tag'],'as':_0x462b('0xb0'),'attributes':['id',_0x462b('0x18'),_0x462b('0xb1')],'required':_0xa86dfb[_0x462b('0x84')][_0x462b('0xb2')]?!![]:![]},{'model':_0x181803[_0x462b('0xb3')],'as':_0x462b('0xb4'),'attributes':['id','name',_0x462b('0xb1')],'through':_0xa86dfb[_0x462b('0x84')][_0x462b('0xb2')]?{'attributes':[],'where':{'TagId':_0xa86dfb['query'][_0x462b('0xb2')]||undefined}}:{},'required':_0xa86dfb[_0x462b('0x84')][_0x462b('0xb2')]?!![]:![]}];}else{_0x43ebab[_0x462b('0xa6')]=[{'all':!![]}];}}return _0x181803[_0x1d3c56[_0x462b('0x13')]][_0x462b('0x9')](_0x43ebab);})[_0x462b('0xa')](function(_0x2f7fb6){_0x4d7622['rows']=_0x2f7fb6;if(_0x291b31===_0x462b('0x2c')&&_0xa86dfb[_0x462b('0x84')]['openTabs']===_0x462b('0xb5')){var _0x1ae37a=[];for(var _0x35d6dc=0x0;_0x35d6dc<_0x4d7622[_0x462b('0xac')][_0x462b('0x8a')];_0x35d6dc++){_0x1ae37a[_0x462b('0x8b')](_0x56fefb(_0x462b('0xb6'),_0x4d7622['rows'][_0x35d6dc]['dataValues']));_0x1ae37a[_0x462b('0x8b')](_0x56fefb(_0x462b('0xb7'),_0x4d7622[_0x462b('0xac')][_0x35d6dc][_0x462b('0xb8')]));_0x1ae37a['push'](_0x56fefb(_0x462b('0xb9'),_0x4d7622[_0x462b('0xac')][_0x35d6dc][_0x462b('0xb8')]));_0x1ae37a[_0x462b('0x8b')](_0x56fefb(_0x462b('0xba'),_0x4d7622[_0x462b('0xac')][_0x35d6dc][_0x462b('0xb8')]));_0x1ae37a[_0x462b('0x8b')](_0x56fefb(_0x462b('0xbb'),_0x4d7622[_0x462b('0xac')][_0x35d6dc]['dataValues']));_0x1ae37a['push'](_0x56fefb(_0x462b('0xbc'),_0x4d7622['rows'][_0x35d6dc][_0x462b('0xb8')]));}return Promise[_0x462b('0x8d')](_0x1ae37a)[_0x462b('0xa')](function(){return _0x4d7622;});}return _0x4d7622;});}});}}});}; \ No newline at end of file +var _0x2f58=['Team','voicequeues','queuecampaigns','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','pauses','scheduler','Schedule','Sound','tags','Tag','triggers','Trigger','trunks','Trunk','variables','Variable','Plugin','Reports','metrics','AnalyticMetric','charAt','slice','Sequelize','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','user_profiles','section','mergeResources','isEmpty','length','UserProfileSection','find','ignore','union','push','autoAssociation','all','rawAttributes','keys','intersection','attributes','fields','limit','offset','sort','where','filters','key','VIRTUAL','foreignKey','merge','options','includeAll','reportType','default','reportId','DefaultReports','custom','count','rows','ids','customSorting','order','extraQueryConditions','include','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','field','value','findAll','then','associatedResources','map','catch','model','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','childModel','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','JscriptyProject','contacts','CmContact','parentSections','Lists','lists','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatWebsite','faxqueues','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','VoiceRecording','Agents','name','membername','User','role','agent','Telephones','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','type','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','OpenchannelAccount','SmsAccount','WhatsappQueue','WhatsappAccount','teams'];(function(_0x56c1e5,_0x1d766d){var _0x3e3233=function(_0x4710fe){while(--_0x4710fe){_0x56c1e5['push'](_0x56c1e5['shift']());}};_0x3e3233(++_0x1d766d);}(_0x2f58,0x6c));var _0x82f5=function(_0x469d75,_0x4040d9){_0x469d75=_0x469d75-0x0;var _0x2c8a3c=_0x2f58[_0x469d75];return _0x2c8a3c;};'use strict';var _=require(_0x82f5('0x0'));var attributes=require(_0x82f5('0x1'));var qs=require(_0x82f5('0x2'));var squel=require(_0x82f5('0x3'));module['exports']=function(_0xdfd2d1){var _0x248336=_0xdfd2d1[_0x82f5('0x4')];function _0x5a3936(_0x425b02,_0x5cc991){return new Promise(function(_0x3ddfd1,_0x5d7611){if(!_0x5cc991)return _0x3ddfd1(null);var _0x325bc2=_0x5cc991[_0x82f5('0x5')]?{[_0x5cc991[_0x82f5('0x5')][_0x82f5('0x6')]]:_0x5cc991[_0x82f5('0x5')][_0x82f5('0x7')]}:undefined;return _0x248336[_0x425b02][_0x82f5('0x8')]({'where':_0x325bc2,'raw':!![]})[_0x82f5('0x9')](function(_0x2f81d0){_0x5cc991[_0x82f5('0xa')]=_[_0x82f5('0xb')](_0x2f81d0,'id');_0x3ddfd1(_0x5cc991);})[_0x82f5('0xc')](function(_0x332fb2){_0x5d7611(_0x332fb2);});});}function _0x2cbefb(_0x1f60d9,_0x4d1794){return new Promise(function(_0x4919f0,_0x22514e){var _0x921ba5=_0x1f60d9['filter']?{[_0x1f60d9['filter'][_0x82f5('0x6')]]:_0x1f60d9[_0x82f5('0x5')]['value']}:undefined;return _0x248336[_0x1f60d9[_0x82f5('0xd')]][_0x82f5('0x8')]({'where':_0x921ba5,'raw':!![]})[_0x82f5('0x9')](function(_0x2b2b5e){_0x4d1794[_0x82f5('0xa')]=_[_0x82f5('0xb')](_0x2b2b5e,function(_0x5ce23f){return _0x5ce23f['name'];});_0x4919f0(_0x4d1794);})[_0x82f5('0xc')](function(_0xb07fe5){_0x22514e(_0xb07fe5);});});}function _0x182c3b(_0x42f3da,_0x25603f,_0x11e6c2){if(!_0x25603f)return Promise[_0x82f5('0xe')](null);return new Promise(function(_0x886c0a,_0x34edba){return _0x248336[_0x82f5('0xf')][_0x82f5('0x8')]({'where':{'sectionId':_0x25603f['id']},'raw':!![]})[_0x82f5('0x9')](function(_0x206c10){if(_0x42f3da[_0x82f5('0x6')]&&_0x42f3da[_0x82f5('0x6')]!=='id'){_0x25603f['associatedResources']=_[_0x82f5('0xb')](_0x206c10,function(_0x267bb2){return _0x267bb2[_0x42f3da['field']];});}else{if(_0x11e6c2===_0x82f5('0x10')){_0x25603f[_0x82f5('0xa')]=_[_0x82f5('0xb')](_0x206c10,function(_0x308300){return{'id':_0x308300[_0x82f5('0x11')],'type':_0x308300['type']};});}else{_0x25603f[_0x82f5('0xa')]=_[_0x82f5('0xb')](_0x206c10,function(_0x73c9d8){return _0x73c9d8[_0x82f5('0x11')];});}}_0x886c0a(_0x25603f);})[_0x82f5('0xc')](function(_0x1945fa){_0x34edba(_0x1945fa);});});}function _0x3bcc91(_0x41ca7b,_0x3f00a){var _0x904649={'parentSections':[]};switch(_0x41ca7b[_0x82f5('0x12')]()){case _0x82f5('0x13'):_0x904649[_0x82f5('0x14')]='SquareProject';break;case'odbc':_0x904649['childModel']=_0x82f5('0x15');break;case _0x82f5('0x16'):_0x904649['childModel']=_0x82f5('0x17');_0x904649['parentSections']=[{'name':_0x82f5('0x18'),'field':'name','foreignKey':_0x82f5('0x19')}];break;case'projects':_0x904649['childModel']=_0x82f5('0x1a');break;case _0x82f5('0x1b'):_0x904649['childModel']=_0x82f5('0x1c');_0x904649[_0x82f5('0x1d')]=[{'name':_0x82f5('0x1e'),'field':'id','foreignKey':'ListId'}];break;case _0x82f5('0x1f'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x20');break;case _0x82f5('0x21'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x22');break;case _0x82f5('0x23'):_0x904649[_0x82f5('0x14')]='CmCustomField';break;case _0x82f5('0x24'):_0x904649[_0x82f5('0x14')]='ChatQueue';break;case'chatwebsites':_0x904649[_0x82f5('0x14')]=_0x82f5('0x25');break;case _0x82f5('0x26'):_0x904649[_0x82f5('0x14')]='FaxQueue';break;case _0x82f5('0x27'):_0x904649[_0x82f5('0x14')]='FaxAccount';break;case _0x82f5('0x28'):case _0x82f5('0x29'):case _0x82f5('0x2a'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x2b');break;case _0x82f5('0x2c'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x2d');break;case _0x82f5('0x2e'):_0x904649['childModel']=_0x82f5('0x2f');break;case'voicerecordings':_0x904649['childModel']=_0x82f5('0x30');_0x904649[_0x82f5('0x1d')]=[{'name':_0x82f5('0x31'),'field':_0x82f5('0x32'),'foreignKey':_0x82f5('0x33'),'model':_0x82f5('0x34'),'filter':{'field':_0x82f5('0x35'),'value':[_0x82f5('0x36')]}},{'name':_0x82f5('0x37'),'field':_0x82f5('0x32'),'foreignKey':'membername','model':_0x82f5('0x34'),'filter':{'field':_0x82f5('0x35'),'value':[_0x82f5('0x38')]}},{'name':_0x82f5('0x39'),'field':_0x82f5('0x32'),'foreignKey':'queue','model':_0x82f5('0x3a'),'filter':{'field':'type','value':[_0x82f5('0x3b')]}},{'name':_0x82f5('0x3c'),'field':_0x82f5('0x32'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0x82f5('0x3d'),'value':[_0x82f5('0x3e')]}}];break;case _0x82f5('0x3f'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x40');break;case _0x82f5('0x41'):_0x904649['childModel']=_0x82f5('0x42');break;case _0x82f5('0x43'):_0x904649['childModel']=_0x82f5('0x44');break;case _0x82f5('0x45'):_0x904649['childModel']=_0x82f5('0x46');break;case _0x82f5('0x47'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x48');break;case _0x82f5('0x49'):_0x904649['childModel']=_0x82f5('0x4a');break;case'mailsubstatuses':_0x904649[_0x82f5('0x14')]=_0x82f5('0x4b');break;case _0x82f5('0x4c'):_0x904649[_0x82f5('0x14')]='OpenchannelQueue';break;case'openchannelaccounts':_0x904649['childModel']=_0x82f5('0x4d');break;case'smsqueues':_0x904649['childModel']='SmsQueue';break;case'smsaccounts':_0x904649[_0x82f5('0x14')]=_0x82f5('0x4e');break;case'whatsappqueues':_0x904649['childModel']=_0x82f5('0x4f');break;case'whatsappaccounts':_0x904649[_0x82f5('0x14')]=_0x82f5('0x50');break;case _0x82f5('0x51'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x52');break;case _0x82f5('0x53'):case _0x82f5('0x54'):_0x904649['childModel']=_0x82f5('0x3a');if(_0x3f00a){_0x904649[_0x82f5('0x1d')]=[{'name':'VoiceQueues'},{'name':_0x82f5('0x3c')}];}break;case'users':case _0x82f5('0x55'):case _0x82f5('0x56'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x34');if(_0x3f00a){_0x904649['parentSections']=[{'name':_0x82f5('0x57'),'filter':{'field':'role','value':[_0x82f5('0x58'),_0x82f5('0x59')]},'ignore':!![]},{'name':'Agents'},{'name':_0x82f5('0x37')}];}break;case _0x82f5('0x5a'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x5b');break;case'salesforceaccounts':_0x904649[_0x82f5('0x14')]=_0x82f5('0x5c');break;case _0x82f5('0x5d'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x5e');break;case _0x82f5('0x5f'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x60');break;case'deskaccounts':_0x904649[_0x82f5('0x14')]=_0x82f5('0x61');break;case _0x82f5('0x62'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x63');break;case _0x82f5('0x64'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x34');break;case'cannedanswers':_0x904649[_0x82f5('0x14')]=_0x82f5('0x65');break;case _0x82f5('0x66'):_0x904649['childModel']=_0x82f5('0x67');break;case _0x82f5('0x68'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x69');break;case _0x82f5('0x6a'):_0x904649[_0x82f5('0x14')]='Interval';break;case _0x82f5('0x6b'):_0x904649[_0x82f5('0x14')]='Pause';break;case _0x82f5('0x6c'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x6d');break;case'sounds':_0x904649[_0x82f5('0x14')]=_0x82f5('0x6e');break;case _0x82f5('0x6f'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x70');break;case'templates':_0x904649['childModel']='Template';break;case _0x82f5('0x71'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x72');break;case _0x82f5('0x73'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x74');break;case _0x82f5('0x75'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x76');break;case'plugins':_0x904649[_0x82f5('0x14')]=_0x82f5('0x77');break;case'extractedreports':_0x904649[_0x82f5('0x14')]=_0x82f5('0x10');_0x904649[_0x82f5('0x1d')]=[{'name':_0x82f5('0x78'),'field':'id','foreignKey':'reportId'}];break;case _0x82f5('0x79'):_0x904649[_0x82f5('0x14')]=_0x82f5('0x7a');break;}return _0x904649;}function _0x4d97f4(_0x1d7f35,_0x3db06a){var _0x49fb28=_0x1d7f35[_0x82f5('0x7b')](0x0)['toUpperCase']()+_0x1d7f35[_0x82f5('0x7c')](0x1);var _0x4a17a6={'type':_0x248336[_0x82f5('0x7d')]['QueryTypes'][_0x82f5('0x7e')],'raw':!![]};return new Promise(function(_0x52ae1f,_0x2e8e82){var _0x15175e=squel[_0x82f5('0x7f')]()[_0x82f5('0x6')](_0x82f5('0x80')+_0x49fb28+_0x82f5('0x81'),'id')['field'](_0x82f5('0x82'))[_0x82f5('0x83')](_0x82f5('0x84')+_0x1d7f35+'_interactions','ui')['where'](_0x82f5('0x85'),_0x3db06a['id']);return _0x248336[_0x82f5('0x86')][_0x82f5('0x87')](_0x15175e[_0x82f5('0x88')](),_0x4a17a6)['then'](function(_0x3a5be9){_0x3db06a[_0x49fb28+_0x82f5('0x89')]=_0x3a5be9;_0x52ae1f(_0x3a5be9);})['catch'](function(_0x537b68){_0x2e8e82(_0x537b68);});});}return _0xdfd2d1[_0x82f5('0x8a')]('UserProfile',attributes,{'tableName':_0x82f5('0x8b'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2c52ea){var _0x2e2423={'raw':_0x2c52ea[_0x82f5('0x87')]['raw'],'where':{}};var _0x24c9df={};var _0x238eb6={'count':0x0,'rows':[]};var _0x470d44=_0x2c52ea['query'][_0x82f5('0x8c')];var _0xad3269=_0x2c52ea[_0x82f5('0x87')][_0x82f5('0x8d')]||![];var _0x578083=_0x3bcc91(_0x470d44,_0xad3269);if(!_0x578083[_0x82f5('0x14')])throw new Error('Invalid\x20section\x20\x27'+_0x470d44+'\x27');var _0xe42a0e=[{'name':_0x470d44}];if(!_[_0x82f5('0x8e')](_0x578083[_0x82f5('0x1d')]))_0xe42a0e=_0x578083[_0x82f5('0x1d')];var _0x10295c=[];for(var _0x45e080=0x0;_0x45e080<_0xe42a0e[_0x82f5('0x8f')];_0x45e080++){_0x10295c['push'](_0x248336[_0x82f5('0x90')][_0x82f5('0x91')]({'where':{'userProfileId':_0x2c52ea['params']['id'],'name':_0xe42a0e[_0x45e080][_0x82f5('0x32')]},'raw':!![]}));}return Promise['all'](_0x10295c)[_0x82f5('0x9')](function(_0x52229c){var _0x26480a=_[_0x82f5('0x5')](_0x52229c,function(_0x22a843){return _0x22a843?_0x22a843:undefined;});var _0x26ee95=_[_0x82f5('0x5')](_0xe42a0e,[_0x82f5('0x92'),!![]]);var _0x51ce0e=_[_0x82f5('0x8e')](_0x26480a)&&_[_0x82f5('0x8e')](_0x26ee95)?null:_[_0x82f5('0x93')](_0x26ee95,_0x26480a);if(!_0x51ce0e)return null;var _0x2e6cf4=[];for(var _0x47cec9=0x0;_0x47cec9<_0x51ce0e['length'];_0x47cec9++){var _0x547477=_[_0x82f5('0x91')](_0xe42a0e,function(_0x3ab43f){return _0x51ce0e[_0x47cec9]?_0x3ab43f[_0x82f5('0x32')]===_0x51ce0e[_0x47cec9][_0x82f5('0x32')]:null;});if(_0x547477){if(_0x51ce0e[_0x47cec9][_0x82f5('0x92')]){_0x2e6cf4[_0x82f5('0x94')](_0x5a3936(_0x578083[_0x82f5('0x14')],_0x51ce0e[_0x47cec9]));}else{if(!_0x51ce0e[_0x47cec9][_0x82f5('0x95')]){_0x2e6cf4[_0x82f5('0x94')](_0x182c3b(_0x547477,_0x51ce0e[_0x47cec9],_0x578083[_0x82f5('0x14')]));}else{if(_0x547477[_0x82f5('0xd')]){_0x2e6cf4['push'](_0x2cbefb(_0x547477,_0x51ce0e[_0x47cec9]));}}}}}return Promise[_0x82f5('0x96')](_0x2e6cf4);})[_0x82f5('0x9')](function(_0x41ca9a){var _0x2e3f64=_0x41ca9a;var _0x3ac301=null;if(_0x2e3f64){_0x3ac301=_0x2e3f64[_0x82f5('0x8f')]===0x1?_0x2e3f64[0x0]:null;}if(!_0x3ac301&&!_0x2e3f64)return _0x238eb6;var _0x5a0cf5=_0x248336[_0x578083['childModel']][_0x82f5('0x97')];_0x24c9df[_0x82f5('0xd')]=_[_0x82f5('0x98')](_0x5a0cf5);_0x24c9df[_0x82f5('0x87')]=_[_0x82f5('0x98')](_0x2c52ea[_0x82f5('0x87')]);_0x24c9df['filters']=_[_0x82f5('0x99')](_0x24c9df[_0x82f5('0xd')],_0x24c9df[_0x82f5('0x87')]);_0x2e2423[_0x82f5('0x9a')]=_[_0x82f5('0x99')](_0x24c9df[_0x82f5('0xd')],qs[_0x82f5('0x9b')](_0x2c52ea[_0x82f5('0x87')][_0x82f5('0x9b')]));_0x2e2423['attributes']=_0x2e2423[_0x82f5('0x9a')][_0x82f5('0x8f')]?_0x2e2423[_0x82f5('0x9a')]:_0x24c9df['model'];if(!_0x2c52ea[_0x82f5('0x87')]['hasOwnProperty']('nolimit')){_0x2e2423[_0x82f5('0x9c')]=qs[_0x82f5('0x9c')](_0x2c52ea[_0x82f5('0x87')][_0x82f5('0x9c')]);_0x2e2423[_0x82f5('0x9d')]=qs[_0x82f5('0x9d')](_0x2c52ea[_0x82f5('0x87')][_0x82f5('0x9d')]);}_0x2e2423['order']=qs[_0x82f5('0x9e')](_0x2c52ea['query'][_0x82f5('0x9e')]);_0x2e2423[_0x82f5('0x9f')]=qs['filters'](_['pick'](_0x2c52ea['query'],_0x24c9df[_0x82f5('0xa0')]));if(_0x2c52ea['query'][_0x82f5('0x5')]){_0x2e2423[_0x82f5('0x9f')]=_['merge'](_0x2e2423['where'],{'$or':_[_0x82f5('0xb')](_0x5a0cf5,function(_0x401aa0){if(_0x401aa0[_0x82f5('0x3d')][_0x82f5('0xa1')]!==_0x82f5('0xa2')){var _0xc59a34={};_0xc59a34[_0x401aa0[_0x82f5('0x6')]]={'$like':'%'+_0x2c52ea[_0x82f5('0x87')][_0x82f5('0x5')]+'%'};return _0xc59a34;}})});}var _0x8af871=[];var _0xc2deef=null;var _0x13eda4={};if(_0x3ac301){_0xc2deef=_[_0x82f5('0x91')](_0xe42a0e,[_0x82f5('0x32'),_0x3ac301['name']]);if(_0xc2deef[_0x82f5('0x6')]){_0x13eda4={};if(_0x578083[_0x82f5('0x14')]===_0x82f5('0x10')){_0x13eda4[_0xc2deef['foreignKey']]=_[_0x82f5('0xb')](_0x3ac301[_0x82f5('0xa')],'id');}else{_0x13eda4[_0xc2deef[_0x82f5('0xa3')]]=_0x3ac301[_0x82f5('0xa')];}_0x8af871[_0x82f5('0x94')](_0x13eda4);}else{_0x2e2423[_0x82f5('0x9f')]['id']=_0x3ac301[_0x82f5('0xa')];}}else{for(var _0x5e595b=0x0;_0x5e595b<_0x2e3f64[_0x82f5('0x8f')];_0x5e595b++){_0xc2deef=_[_0x82f5('0x91')](_0xe42a0e,['name',_0x2e3f64[_0x5e595b][_0x82f5('0x32')]]);if(_0xc2deef[_0x82f5('0x6')]){_0x13eda4={};_0x13eda4[_0xc2deef[_0x82f5('0xa3')]]=_0x2e3f64[_0x5e595b][_0x82f5('0xa')];_0x8af871[_0x82f5('0x94')](_0x13eda4);}else{if(!_0x2e2423[_0x82f5('0x9f')]['id'])_0x2e2423[_0x82f5('0x9f')]['id']=[];_0x2e3f64[_0x5e595b][_0x82f5('0xa')]['forEach'](function(_0x4dab28){_0x2e2423[_0x82f5('0x9f')]['id'][_0x82f5('0x94')](_0x4dab28);});}}}if(!_[_0x82f5('0x8e')](_0x8af871)){_0x2e2423[_0x82f5('0x9f')]=_[_0x82f5('0xa4')](_0x2e2423[_0x82f5('0x9f')],{'$and':{'$or':_0x8af871}});}_0x2e2423=_['merge']({},_0x2e2423,_0x2c52ea[_0x82f5('0xa5')]);if(_0x3ac301&&!_0x3ac301[_0x82f5('0x95')]&&_0x578083[_0x82f5('0x14')]===_0x82f5('0x10')){if(_0x2c52ea['query'][_0x82f5('0xa6')]){_0x2e2423['include']=[{'all':!![]}];}return _0x248336[_0x578083[_0x82f5('0x14')]]['findAll'](_0x2e2423)[_0x82f5('0x9')](function(_0x544a9c){var _0x53a79e=[];_0x544a9c['forEach'](function(_0x16e811){var _0x5124db;switch(_0x16e811[_0x82f5('0xa7')]){case _0x82f5('0xa8'):_0x5124db=_[_0x82f5('0x91')](_0x3ac301[_0x82f5('0xa')],function(_0x1001e8){return _0x1001e8['id']===_0x16e811[_0x82f5('0xa9')]&&_0x1001e8[_0x82f5('0x3d')]===_0x82f5('0xaa');});break;case _0x82f5('0xab'):_0x5124db=_[_0x82f5('0x91')](_0x3ac301['associatedResources'],function(_0x247236){return _0x247236['id']===_0x16e811[_0x82f5('0xa9')]&&_0x247236[_0x82f5('0x3d')]==='CustomReports';});break;}if(_0x5124db)_0x53a79e[_0x82f5('0x94')](_0x16e811);});_0x238eb6[_0x82f5('0xac')]=_0x53a79e[_0x82f5('0x8f')];_0x238eb6[_0x82f5('0xad')]=_0x53a79e;return _0x238eb6;});}else{if(!_[_0x82f5('0x8e')](_0x2c52ea[_0x82f5('0x87')][_0x82f5('0xae')])){_0x2e2423[_0x82f5('0x9f')]['id']=_0x2e2423[_0x82f5('0x9f')]['id']?_[_0x82f5('0x99')](_0x2e2423[_0x82f5('0x9f')]['id'],_0x2c52ea[_0x82f5('0x87')]['ids']):_0x2c52ea[_0x82f5('0x87')]['ids'];if(_0x2c52ea['query'][_0x82f5('0xaf')]){_0x2e2423[_0x82f5('0xb0')]=_0x2c52ea[_0x82f5('0x87')]['customSorting'];}}if(_0x2c52ea[_0x82f5('0x87')][_0x82f5('0xb1')]){_0x2e2423[_0x82f5('0x9f')]=_['merge'](_0x2e2423['where'],{'$and':_0x2c52ea[_0x82f5('0x87')][_0x82f5('0xb1')]});}return _0x248336[_0x578083[_0x82f5('0x14')]][_0x82f5('0xac')]({'where':_0x2e2423[_0x82f5('0x9f')]})[_0x82f5('0x9')](function(_0x644f6d){_0x238eb6['count']=_0x644f6d;if(_0x2c52ea[_0x82f5('0x87')][_0x82f5('0xa6')]){if(_0x578083[_0x82f5('0x14')]==='CmContact'){_0x2e2423[_0x82f5('0xb2')]=[{'model':_0x248336[_0x82f5('0x70')],'as':_0x82f5('0xb3'),'attributes':['id',_0x82f5('0x32'),_0x82f5('0xb4')],'required':_0x2c52ea[_0x82f5('0x87')][_0x82f5('0xb5')]?!![]:![]},{'model':_0x248336[_0x82f5('0x70')],'as':_0x82f5('0xb6'),'attributes':['id',_0x82f5('0x32'),'color'],'through':_0x2c52ea[_0x82f5('0x87')][_0x82f5('0xb5')]?{'attributes':[],'where':{'TagId':_0x2c52ea['query'][_0x82f5('0xb5')]||undefined}}:{},'required':_0x2c52ea[_0x82f5('0x87')][_0x82f5('0xb5')]?!![]:![]}];}else{_0x2e2423[_0x82f5('0xb2')]=[{'all':!![]}];}}return _0x248336[_0x578083['childModel']][_0x82f5('0x8')](_0x2e2423);})[_0x82f5('0x9')](function(_0x59b7cb){_0x238eb6[_0x82f5('0xad')]=_0x59b7cb;if(_0x470d44==='Agents'&&_0x2c52ea[_0x82f5('0x87')][_0x82f5('0xb7')]===_0x82f5('0xb8')){var _0x2798ae=[];for(var _0x4111de=0x0;_0x4111de<_0x238eb6['rows'][_0x82f5('0x8f')];_0x4111de++){_0x2798ae[_0x82f5('0x94')](_0x4d97f4(_0x82f5('0xb9'),_0x238eb6['rows'][_0x4111de][_0x82f5('0xba')]));_0x2798ae['push'](_0x4d97f4(_0x82f5('0xbb'),_0x238eb6['rows'][_0x4111de][_0x82f5('0xba')]));_0x2798ae['push'](_0x4d97f4(_0x82f5('0xbc'),_0x238eb6[_0x82f5('0xad')][_0x4111de][_0x82f5('0xba')]));_0x2798ae[_0x82f5('0x94')](_0x4d97f4('mail',_0x238eb6[_0x82f5('0xad')][_0x4111de][_0x82f5('0xba')]));_0x2798ae[_0x82f5('0x94')](_0x4d97f4(_0x82f5('0xbd'),_0x238eb6[_0x82f5('0xad')][_0x4111de][_0x82f5('0xba')]));_0x2798ae[_0x82f5('0x94')](_0x4d97f4('whatsapp',_0x238eb6['rows'][_0x4111de][_0x82f5('0xba')]));}return Promise[_0x82f5('0x96')](_0x2798ae)[_0x82f5('0x9')](function(){return _0x238eb6;});}return _0x238eb6;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index b18353d..285b189 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 _0xd3c8=['stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s'];(function(_0x5cf1a1,_0x1ab924){var _0x52cbcc=function(_0xdc1230){while(--_0xdc1230){_0x5cf1a1['push'](_0x5cf1a1['shift']());}};_0x52cbcc(++_0x1ab924);}(_0xd3c8,0x161));var _0x8d3c=function(_0x4df77e,_0x367494){_0x4df77e=_0x4df77e-0x0;var _0x11244=_0xd3c8[_0x4df77e];return _0x11244;};'use strict';var _=require(_0x8d3c('0x0'));var util=require(_0x8d3c('0x1'));var moment=require(_0x8d3c('0x2'));var BPromise=require(_0x8d3c('0x3'));var rs=require(_0x8d3c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d3c('0x5'))['db'];var utils=require(_0x8d3c('0x6'));var logger=require(_0x8d3c('0x7'))(_0x8d3c('0x8'));var config=require('../../config/environment');var jayson=require(_0x8d3c('0x9'));var client=jayson[_0x8d3c('0xa')][_0x8d3c('0xb')]({'port':0x232a});config[_0x8d3c('0xc')]=_[_0x8d3c('0xd')](config[_0x8d3c('0xc')],{'host':_0x8d3c('0xe'),'port':0x18eb});var socket=require(_0x8d3c('0xf'))(new Redis(config[_0x8d3c('0xc')]));require(_0x8d3c('0x10'))['register'](socket);function respondWithRpcPromise(_0x566c3c,_0x5dff75,_0x4500ba){return new BPromise(function(_0x1c47ef,_0xf8e143){return client[_0x8d3c('0x11')](_0x566c3c,_0x4500ba)[_0x8d3c('0x12')](function(_0x6446fb){logger[_0x8d3c('0x13')](_0x8d3c('0x14'),_0x5dff75,_0x8d3c('0x15'));logger[_0x8d3c('0x16')](_0x8d3c('0x17'),_0x5dff75,_0x8d3c('0x15'),JSON[_0x8d3c('0x18')](_0x6446fb));if(_0x6446fb[_0x8d3c('0x19')]){if(_0x6446fb[_0x8d3c('0x19')][_0x8d3c('0x1a')]===0x1f4){logger[_0x8d3c('0x19')](_0x8d3c('0x14'),_0x5dff75,_0x6446fb[_0x8d3c('0x19')][_0x8d3c('0x1b')]);return _0xf8e143(_0x6446fb['error'][_0x8d3c('0x1b')]);}logger[_0x8d3c('0x19')](_0x8d3c('0x14'),_0x5dff75,_0x6446fb[_0x8d3c('0x19')][_0x8d3c('0x1b')]);return _0x1c47ef(_0x6446fb[_0x8d3c('0x19')][_0x8d3c('0x1b')]);}else{logger[_0x8d3c('0x13')](_0x8d3c('0x14'),_0x5dff75,_0x8d3c('0x15'));_0x1c47ef(_0x6446fb[_0x8d3c('0x1c')][_0x8d3c('0x1b')]);}})['catch'](function(_0x5cf870){logger[_0x8d3c('0x19')](_0x8d3c('0x14'),_0x5dff75,_0x5cf870);_0xf8e143(_0x5cf870);});});} \ No newline at end of file +var _0xe978=['error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe978,0x70));var _0x8e97=function(_0x384816,_0x535e97){_0x384816=_0x384816-0x0;var _0x30976a=_0xe978[_0x384816];return _0x30976a;};'use strict';var _=require(_0x8e97('0x0'));var util=require(_0x8e97('0x1'));var moment=require(_0x8e97('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8e97('0x3'));var db=require(_0x8e97('0x4'))['db'];var utils=require(_0x8e97('0x5'));var logger=require(_0x8e97('0x6'))(_0x8e97('0x7'));var config=require('../../config/environment');var jayson=require(_0x8e97('0x8'));var client=jayson[_0x8e97('0x9')][_0x8e97('0xa')]({'port':0x232a});config[_0x8e97('0xb')]=_[_0x8e97('0xc')](config['redis'],{'host':_0x8e97('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8e97('0xb')]));require(_0x8e97('0xe'))[_0x8e97('0xf')](socket);function respondWithRpcPromise(_0x515bc2,_0x3149de,_0x1d2aa1){return new BPromise(function(_0x4406ad,_0x37b212){return client[_0x8e97('0x10')](_0x515bc2,_0x1d2aa1)[_0x8e97('0x11')](function(_0xa97614){logger[_0x8e97('0x12')](_0x8e97('0x13'),_0x3149de,_0x8e97('0x14'));logger[_0x8e97('0x15')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x3149de,_0x8e97('0x14'),JSON[_0x8e97('0x16')](_0xa97614));if(_0xa97614[_0x8e97('0x17')]){if(_0xa97614[_0x8e97('0x17')]['code']===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x3149de,_0xa97614['error']['message']);return _0x37b212(_0xa97614['error'][_0x8e97('0x18')]);}logger['error'](_0x8e97('0x13'),_0x3149de,_0xa97614[_0x8e97('0x17')]['message']);return _0x4406ad(_0xa97614['error'][_0x8e97('0x18')]);}else{logger[_0x8e97('0x12')](_0x8e97('0x13'),_0x3149de,_0x8e97('0x14'));_0x4406ad(_0xa97614[_0x8e97('0x19')][_0x8e97('0x18')]);}})[_0x8e97('0x1a')](function(_0x2a0800){logger[_0x8e97('0x17')]('UserProfile,\x20%s,\x20%s',_0x3149de,_0x2a0800);_0x37b212(_0x2a0800);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 0caa085..e2bb233 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 _0x3aab=['remove','emit','removeListener','userProfile:','./userProfile.events','save'];(function(_0x3d4bf2,_0x5bb4a1){var _0x599965=function(_0x402f39){while(--_0x402f39){_0x3d4bf2['push'](_0x3d4bf2['shift']());}};_0x599965(++_0x5bb4a1);}(_0x3aab,0xb8));var _0xb3aa=function(_0x3b5428,_0x3935b8){_0x3b5428=_0x3b5428-0x0;var _0x55f647=_0x3aab[_0x3b5428];return _0x55f647;};'use strict';var UserProfileEvents=require(_0xb3aa('0x0'));var events=[_0xb3aa('0x1'),_0xb3aa('0x2'),'update'];function createListener(_0x1d3bca,_0x47d207){return function(_0x30451e){_0x47d207[_0xb3aa('0x3')](_0x1d3bca,_0x30451e);};}function removeListener(_0x1b3bf6,_0x12552d){return function(){UserProfileEvents[_0xb3aa('0x4')](_0x1b3bf6,_0x12552d);};}exports['register']=function(_0x521176){for(var _0x518121=0x0,_0x41e411=events['length'];_0x518121<_0x41e411;_0x518121++){var _0x43862c=events[_0x518121];var _0x2dabca=createListener(_0xb3aa('0x5')+_0x43862c,_0x521176);UserProfileEvents['on'](_0x43862c,_0x2dabca);}}; \ No newline at end of file +var _0x16ae=['save','remove','update','emit','removeListener','register','length','userProfile:','./userProfile.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x16ae,0xfb));var _0xe16a=function(_0x3d067c,_0x423ef1){_0x3d067c=_0x3d067c-0x0;var _0x4d8350=_0x16ae[_0x3d067c];return _0x4d8350;};'use strict';var UserProfileEvents=require(_0xe16a('0x0'));var events=[_0xe16a('0x1'),_0xe16a('0x2'),_0xe16a('0x3')];function createListener(_0x5aeeba,_0x3ab8ea){return function(_0x14786f){_0x3ab8ea[_0xe16a('0x4')](_0x5aeeba,_0x14786f);};}function removeListener(_0x329e5f,_0xe51edb){return function(){UserProfileEvents[_0xe16a('0x5')](_0x329e5f,_0xe51edb);};}exports[_0xe16a('0x6')]=function(_0x690422){for(var _0x339dec=0x0,_0x927071=events[_0xe16a('0x7')];_0x339dec<_0x927071;_0x339dec++){var _0x301e92=events[_0x339dec];var _0x263d31=createListener(_0xe16a('0x8')+_0x301e92,_0x690422);UserProfileEvents['on'](_0x301e92,_0x263d31);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index efcbd64..27efed8 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 _0xb87a=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','show','create','/:id','update','delete','destroy','exports'];(function(_0x48c006,_0x1eb604){var _0x43c48e=function(_0x3d5ba1){while(--_0x3d5ba1){_0x48c006['push'](_0x48c006['shift']());}};_0x43c48e(++_0x1eb604);}(_0xb87a,0xfc));var _0xab87=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xb87a[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0xab87('0x0'));var util=require('util');var path=require(_0xab87('0x1'));var timeout=require(_0xab87('0x2'));var express=require(_0xab87('0x3'));var router=express[_0xab87('0x4')]();var fs_extra=require(_0xab87('0x5'));var auth=require(_0xab87('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xab87('0x7'));var controller=require(_0xab87('0x8'));router[_0xab87('0x9')]('/',auth[_0xab87('0xa')](),controller[_0xab87('0xb')]);router['get'](_0xab87('0xc'),auth[_0xab87('0xa')](),controller[_0xab87('0xd')]);router[_0xab87('0x9')]('/:id',auth[_0xab87('0xa')](),controller[_0xab87('0xe')]);router['post']('/',auth[_0xab87('0xa')](),controller[_0xab87('0xf')]);router['put'](_0xab87('0x10'),auth[_0xab87('0xa')](),controller[_0xab87('0x11')]);router[_0xab87('0x12')](_0xab87('0x10'),auth['isAuthenticated'](),controller[_0xab87('0x13')]);module[_0xab87('0x14')]=router; \ No newline at end of file +var _0xd585=['Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd585,0x8f));var _0x5d58=function(_0x2e941b,_0x45be74){_0x2e941b=_0x2e941b-0x0;var _0x3b3320=_0xd585[_0x2e941b];return _0x3b3320;};'use strict';var multer=require(_0x5d58('0x0'));var util=require('util');var path=require(_0x5d58('0x1'));var timeout=require(_0x5d58('0x2'));var express=require(_0x5d58('0x3'));var router=express[_0x5d58('0x4')]();var fs_extra=require(_0x5d58('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5d58('0x6'));var config=require(_0x5d58('0x7'));var controller=require(_0x5d58('0x8'));router[_0x5d58('0x9')]('/',auth['isAuthenticated'](),controller[_0x5d58('0xa')]);router[_0x5d58('0x9')](_0x5d58('0xb'),auth[_0x5d58('0xc')](),controller[_0x5d58('0xd')]);router['get'](_0x5d58('0xe'),auth[_0x5d58('0xc')](),controller[_0x5d58('0xf')]);router[_0x5d58('0x10')]('/',auth[_0x5d58('0xc')](),controller[_0x5d58('0x11')]);router['put'](_0x5d58('0xe'),auth[_0x5d58('0xc')](),controller[_0x5d58('0x12')]);router[_0x5d58('0x13')](_0x5d58('0xe'),auth[_0x5d58('0xc')](),controller[_0x5d58('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 5fe235d..1a9ec32 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 _0x0b3a=['exports','STRING','INTEGER','sequelize'];(function(_0x196062,_0x344ef9){var _0x2097ec=function(_0x5129b2){while(--_0x5129b2){_0x196062['push'](_0x196062['shift']());}};_0x2097ec(++_0x344ef9);}(_0x0b3a,0xd3));var _0xa0b3=function(_0x17e771,_0x55fd17){_0x17e771=_0x17e771-0x0;var _0x1f3a6d=_0x0b3a[_0x17e771];return _0x1f3a6d;};'use strict';var Sequelize=require(_0xa0b3('0x0'));module[_0xa0b3('0x1')]={'name':{'type':Sequelize[_0xa0b3('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xa0b3('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xa0b3('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x3054=['STRING','INTEGER','sequelize','exports'];(function(_0x14984a,_0x4bec35){var _0x4122d5=function(_0x1a4e77){while(--_0x1a4e77){_0x14984a['push'](_0x14984a['shift']());}};_0x4122d5(++_0x4bec35);}(_0x3054,0xe6));var _0x4305=function(_0x308412,_0x11bdf8){_0x308412=_0x308412-0x0;var _0x1c54c6=_0x3054[_0x308412];return _0x1c54c6;};'use strict';var Sequelize=require(_0x4305('0x0'));module[_0x4305('0x1')]={'name':{'type':Sequelize[_0x4305('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x4305('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 3b4b0d8..6b8a676 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 _0x47c5=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','count','includeAll','include','findAll','show','params','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','model'];(function(_0x4fd85e,_0x442dd6){var _0x57c249=function(_0x18dcb7){while(--_0x18dcb7){_0x4fd85e['push'](_0x4fd85e['shift']());}};_0x57c249(++_0x442dd6);}(_0x47c5,0x165));var _0x547c=function(_0x36f8b7,_0x3c9fa2){_0x36f8b7=_0x36f8b7-0x0;var _0x1f3e7d=_0x47c5[_0x36f8b7];return _0x1f3e7d;};'use strict';var emlformat=require(_0x547c('0x0'));var rimraf=require(_0x547c('0x1'));var zipdir=require(_0x547c('0x2'));var jsonpatch=require(_0x547c('0x3'));var rp=require(_0x547c('0x4'));var moment=require(_0x547c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x547c('0x6'));var util=require(_0x547c('0x7'));var path=require('path');var sox=require(_0x547c('0x8'));var csv=require(_0x547c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x547c('0xa'));var _=require(_0x547c('0xb'));var squel=require(_0x547c('0xc'));var crypto=require(_0x547c('0xd'));var jsforce=require(_0x547c('0xe'));var deskjs=require(_0x547c('0xf'));var toCsv=require(_0x547c('0x9'));var querystring=require(_0x547c('0x10'));var Papa=require(_0x547c('0x11'));var Redis=require(_0x547c('0x12'));var authService=require(_0x547c('0x13'));var qs=require(_0x547c('0x14'));var as=require(_0x547c('0x15'));var hardwareService=require(_0x547c('0x16'));var logger=require(_0x547c('0x17'))(_0x547c('0x18'));var utils=require(_0x547c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x547c('0x1a'));var db=require(_0x547c('0x1b'))['db'];function respondWithStatusCode(_0x5eea67,_0x436c19){_0x436c19=_0x436c19||0xcc;return function(_0x201d95){if(_0x201d95){return _0x5eea67[_0x547c('0x1c')](_0x436c19);}return _0x5eea67[_0x547c('0x1d')](_0x436c19)[_0x547c('0x1e')]();};}function respondWithResult(_0x150317,_0x2bc289){_0x2bc289=_0x2bc289||0xc8;return function(_0xa3c7b0){if(_0xa3c7b0){return _0x150317[_0x547c('0x1d')](_0x2bc289)[_0x547c('0x1f')](_0xa3c7b0);}};}function respondWithFilteredResult(_0x240243,_0x103455){return function(_0x39f316){if(_0x39f316){var _0x23644b=typeof _0x103455[_0x547c('0x20')]===_0x547c('0x21')&&typeof _0x103455[_0x547c('0x22')]===_0x547c('0x21');var _0x49acca=_0x39f316['count'];var _0x23fa9e=_0x23644b?0x0:_0x103455[_0x547c('0x20')];var _0xeb059e=_0x23644b?_0x39f316['count']:_0x103455[_0x547c('0x20')]+_0x103455[_0x547c('0x22')];var _0x1ddbd3;if(_0xeb059e>=_0x49acca){_0xeb059e=_0x49acca;_0x1ddbd3=0xc8;}else{_0x1ddbd3=0xce;}_0x240243['status'](_0x1ddbd3);return _0x240243[_0x547c('0x23')](_0x547c('0x24'),_0x23fa9e+'-'+_0xeb059e+'/'+_0x49acca)['json'](_0x39f316);}return null;};}function patchUpdates(_0x5453f9){return function(_0x35040a){try{jsonpatch[_0x547c('0x25')](_0x35040a,_0x5453f9,!![]);}catch(_0x4f20c1){return BPromise[_0x547c('0x26')](_0x4f20c1);}return _0x35040a[_0x547c('0x27')]();};}function saveUpdates(_0x592e46,_0x2e317a){return function(_0x17fd97){if(_0x17fd97){return _0x17fd97[_0x547c('0x28')](_0x592e46)['then'](function(_0x3a55a0){return _0x3a55a0;});}return null;};}function removeEntity(_0x361c5c,_0x470694){return function(_0x26823c){if(_0x26823c){return _0x26823c[_0x547c('0x29')]()[_0x547c('0x2a')](function(){_0x361c5c[_0x547c('0x1d')](0xcc)[_0x547c('0x1e')]();});}};}function handleEntityNotFound(_0x507895,_0x39c5f9){return function(_0x4c66b9){if(!_0x4c66b9){_0x507895['sendStatus'](0x194);}return _0x4c66b9;};}function handleError(_0x4855fd,_0x478f04){_0x478f04=_0x478f04||0x1f4;return function(_0x2c725d){logger['error'](_0x2c725d[_0x547c('0x2b')]);if(_0x2c725d['name']){delete _0x2c725d[_0x547c('0x2c')];}_0x4855fd['status'](_0x478f04)[_0x547c('0x2d')](_0x2c725d);};}exports[_0x547c('0x2e')]=function(_0x2389de,_0x30a96c){var _0x198afb={},_0x569924={},_0x575c74={'count':0x0,'rows':[]};var _0x28c282=_['map'](db[_0x547c('0x2f')][_0x547c('0x30')],function(_0x3e7652){return{'name':_0x3e7652[_0x547c('0x31')],'type':_0x3e7652[_0x547c('0x32')][_0x547c('0x33')]};});_0x569924[_0x547c('0x34')]=_['map'](_0x28c282,'name');_0x569924[_0x547c('0x35')]=_[_0x547c('0x36')](_0x2389de[_0x547c('0x35')]);_0x569924[_0x547c('0x37')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],_0x569924[_0x547c('0x35')]);_0x198afb[_0x547c('0x39')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],qs[_0x547c('0x3a')](_0x2389de[_0x547c('0x35')][_0x547c('0x3a')]));_0x198afb[_0x547c('0x39')]=_0x198afb['attributes'][_0x547c('0x3b')]?_0x198afb['attributes']:_0x569924['model'];if(!_0x2389de['query'][_0x547c('0x3c')](_0x547c('0x3d'))){_0x198afb[_0x547c('0x22')]=qs[_0x547c('0x22')](_0x2389de[_0x547c('0x35')][_0x547c('0x22')]);_0x198afb['offset']=qs['offset'](_0x2389de['query'][_0x547c('0x20')]);}_0x198afb[_0x547c('0x3e')]=qs[_0x547c('0x3f')](_0x2389de[_0x547c('0x35')][_0x547c('0x3f')]);_0x198afb[_0x547c('0x40')]=qs['filters'](_[_0x547c('0x41')](_0x2389de['query'],_0x569924[_0x547c('0x37')]),_0x28c282);if(_0x2389de[_0x547c('0x35')]['filter']){_0x198afb[_0x547c('0x40')]=_['merge'](_0x198afb['where'],{'$or':_[_0x547c('0x42')](_0x28c282,function(_0x281d52){if(_0x281d52[_0x547c('0x32')]!==_0x547c('0x43')){var _0x4c36b9={};_0x4c36b9[_0x281d52['name']]={'$like':'%'+_0x2389de[_0x547c('0x35')][_0x547c('0x44')]+'%'};return _0x4c36b9;}})});}_0x198afb=_[_0x547c('0x45')]({},_0x198afb,_0x2389de['options']);var _0x3886ae={'where':_0x198afb[_0x547c('0x40')]};return db[_0x547c('0x2f')]['count'](_0x3886ae)[_0x547c('0x2a')](function(_0x3a6a0a){_0x575c74[_0x547c('0x46')]=_0x3a6a0a;if(_0x2389de['query'][_0x547c('0x47')]){_0x198afb[_0x547c('0x48')]=[{'all':!![]}];}return db['UserProfileResource'][_0x547c('0x49')](_0x198afb);})[_0x547c('0x2a')](function(_0x9c3cb2){_0x575c74['rows']=_0x9c3cb2;return _0x575c74;})[_0x547c('0x2a')](respondWithFilteredResult(_0x30a96c,_0x198afb))['catch'](handleError(_0x30a96c,null));};exports[_0x547c('0x4a')]=function(_0x5393a2,_0xb86f5f){var _0x414b9d={'raw':![],'where':{'id':_0x5393a2[_0x547c('0x4b')]['id']}},_0x3d37d7={};_0x3d37d7[_0x547c('0x34')]=_[_0x547c('0x36')](db['UserProfileResource']['rawAttributes']);_0x3d37d7[_0x547c('0x35')]=_[_0x547c('0x36')](_0x5393a2[_0x547c('0x35')]);_0x3d37d7['filters']=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],_0x3d37d7[_0x547c('0x35')]);_0x414b9d[_0x547c('0x39')]=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],qs['fields'](_0x5393a2[_0x547c('0x35')][_0x547c('0x3a')]));_0x414b9d[_0x547c('0x39')]=_0x414b9d['attributes'][_0x547c('0x3b')]?_0x414b9d[_0x547c('0x39')]:_0x3d37d7[_0x547c('0x34')];if(_0x5393a2[_0x547c('0x35')]['includeAll']){_0x414b9d[_0x547c('0x48')]=[{'all':!![]}];}_0x414b9d=_['merge']({},_0x414b9d,_0x5393a2[_0x547c('0x4c')]);return db['UserProfileResource'][_0x547c('0x4d')](_0x414b9d)[_0x547c('0x2a')](handleEntityNotFound(_0xb86f5f,null))['then'](respondWithResult(_0xb86f5f,null))[_0x547c('0x4e')](handleError(_0xb86f5f,null));};exports[_0x547c('0x4f')]=function(_0xa005cc,_0x1ddf30){return db['UserProfileResource'][_0x547c('0x4f')](_0xa005cc['body'],{})['then'](respondWithResult(_0x1ddf30,0xc9))[_0x547c('0x4e')](handleError(_0x1ddf30,null));};exports[_0x547c('0x28')]=function(_0x3e3f52,_0x11a878){if(_0x3e3f52[_0x547c('0x50')]['id']){delete _0x3e3f52[_0x547c('0x50')]['id'];}return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x3e3f52[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x11a878,null))[_0x547c('0x2a')](saveUpdates(_0x3e3f52[_0x547c('0x50')],null))['then'](respondWithResult(_0x11a878,null))['catch'](handleError(_0x11a878,null));};exports[_0x547c('0x29')]=function(_0x21ea26,_0x48de6e){return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x21ea26[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x48de6e,null))[_0x547c('0x2a')](removeEntity(_0x48de6e,null))[_0x547c('0x4e')](handleError(_0x48de6e,null));};exports['describe']=function(_0x152982,_0x5258cf){return db[_0x547c('0x2f')][_0x547c('0x51')]()[_0x547c('0x2a')](respondWithResult(_0x5258cf,null))['catch'](handleError(_0x5258cf,null));}; \ No newline at end of file +var _0x7096=['Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','params','UserProfileResource','find','catch','create','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set'];(function(_0x1f3850,_0x1792a2){var _0x53f2b9=function(_0x1c4bf3){while(--_0x1c4bf3){_0x1f3850['push'](_0x1f3850['shift']());}};_0x53f2b9(++_0x1792a2);}(_0x7096,0x10c));var _0x6709=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7096[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6709('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6709('0x1'));var rp=require('request-promise');var moment=require(_0x6709('0x2'));var BPromise=require(_0x6709('0x3'));var Mustache=require(_0x6709('0x4'));var util=require(_0x6709('0x5'));var path=require(_0x6709('0x6'));var sox=require(_0x6709('0x7'));var csv=require(_0x6709('0x8'));var ejs=require(_0x6709('0x9'));var fs=require('fs');var fs_extra=require(_0x6709('0xa'));var _=require(_0x6709('0xb'));var squel=require(_0x6709('0xc'));var crypto=require(_0x6709('0xd'));var jsforce=require(_0x6709('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6709('0xf'));var Papa=require(_0x6709('0x10'));var Redis=require(_0x6709('0x11'));var authService=require(_0x6709('0x12'));var qs=require(_0x6709('0x13'));var as=require(_0x6709('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6709('0x15'));var utils=require(_0x6709('0x16'));var config=require(_0x6709('0x17'));var licenseUtil=require(_0x6709('0x18'));var db=require(_0x6709('0x19'))['db'];function respondWithStatusCode(_0x288f51,_0x1d56a5){_0x1d56a5=_0x1d56a5||0xcc;return function(_0x1ac547){if(_0x1ac547){return _0x288f51['sendStatus'](_0x1d56a5);}return _0x288f51[_0x6709('0x1a')](_0x1d56a5)[_0x6709('0x1b')]();};}function respondWithResult(_0x4d5255,_0x3706e1){_0x3706e1=_0x3706e1||0xc8;return function(_0x4e4587){if(_0x4e4587){return _0x4d5255[_0x6709('0x1a')](_0x3706e1)['json'](_0x4e4587);}};}function respondWithFilteredResult(_0x41af1f,_0x4bc059){return function(_0x149233){if(_0x149233){var _0x28866a=typeof _0x4bc059[_0x6709('0x1c')]===_0x6709('0x1d')&&typeof _0x4bc059['limit']==='undefined';var _0x5c4f94=_0x149233[_0x6709('0x1e')];var _0x235a54=_0x28866a?0x0:_0x4bc059['offset'];var _0x9c1fd8=_0x28866a?_0x149233[_0x6709('0x1e')]:_0x4bc059[_0x6709('0x1c')]+_0x4bc059['limit'];var _0x13cf04;if(_0x9c1fd8>=_0x5c4f94){_0x9c1fd8=_0x5c4f94;_0x13cf04=0xc8;}else{_0x13cf04=0xce;}_0x41af1f[_0x6709('0x1a')](_0x13cf04);return _0x41af1f[_0x6709('0x1f')](_0x6709('0x20'),_0x235a54+'-'+_0x9c1fd8+'/'+_0x5c4f94)['json'](_0x149233);}return null;};}function patchUpdates(_0x3c4971){return function(_0x1edac3){try{jsonpatch[_0x6709('0x21')](_0x1edac3,_0x3c4971,!![]);}catch(_0x3cf882){return BPromise[_0x6709('0x22')](_0x3cf882);}return _0x1edac3[_0x6709('0x23')]();};}function saveUpdates(_0x45921e,_0x17763d){return function(_0x386224){if(_0x386224){return _0x386224[_0x6709('0x24')](_0x45921e)[_0x6709('0x25')](function(_0xa36371){return _0xa36371;});}return null;};}function removeEntity(_0x5cf48b,_0x29f25f){return function(_0x81138e){if(_0x81138e){return _0x81138e[_0x6709('0x26')]()['then'](function(){_0x5cf48b[_0x6709('0x1a')](0xcc)[_0x6709('0x1b')]();});}};}function handleEntityNotFound(_0x20a347,_0x44b465){return function(_0x588e00){if(!_0x588e00){_0x20a347[_0x6709('0x27')](0x194);}return _0x588e00;};}function handleError(_0x3076fe,_0x50f7d6){_0x50f7d6=_0x50f7d6||0x1f4;return function(_0x585073){logger[_0x6709('0x28')](_0x585073['stack']);if(_0x585073[_0x6709('0x29')]){delete _0x585073[_0x6709('0x29')];}_0x3076fe['status'](_0x50f7d6)[_0x6709('0x2a')](_0x585073);};}exports['index']=function(_0x46a325,_0x3cd555){var _0x5b6906={},_0x137137={},_0x4e6989={'count':0x0,'rows':[]};var _0xe066d8=_[_0x6709('0x2b')](db['UserProfileResource'][_0x6709('0x2c')],function(_0x5deff5){return{'name':_0x5deff5[_0x6709('0x2d')],'type':_0x5deff5[_0x6709('0x2e')]['key']};});_0x137137['model']=_[_0x6709('0x2b')](_0xe066d8,_0x6709('0x29'));_0x137137[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x46a325[_0x6709('0x2f')]);_0x137137[_0x6709('0x31')]=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],_0x137137[_0x6709('0x2f')]);_0x5b6906['attributes']=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],qs[_0x6709('0x34')](_0x46a325[_0x6709('0x2f')]['fields']));_0x5b6906[_0x6709('0x35')]=_0x5b6906[_0x6709('0x35')][_0x6709('0x36')]?_0x5b6906[_0x6709('0x35')]:_0x137137['model'];if(!_0x46a325[_0x6709('0x2f')][_0x6709('0x37')]('nolimit')){_0x5b6906[_0x6709('0x38')]=qs[_0x6709('0x38')](_0x46a325['query'][_0x6709('0x38')]);_0x5b6906[_0x6709('0x1c')]=qs[_0x6709('0x1c')](_0x46a325[_0x6709('0x2f')][_0x6709('0x1c')]);}_0x5b6906[_0x6709('0x39')]=qs[_0x6709('0x3a')](_0x46a325['query'][_0x6709('0x3a')]);_0x5b6906[_0x6709('0x3b')]=qs['filters'](_[_0x6709('0x3c')](_0x46a325[_0x6709('0x2f')],_0x137137[_0x6709('0x31')]),_0xe066d8);if(_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]){_0x5b6906[_0x6709('0x3b')]=_['merge'](_0x5b6906[_0x6709('0x3b')],{'$or':_['map'](_0xe066d8,function(_0x31e05a){if(_0x31e05a[_0x6709('0x2e')]!==_0x6709('0x3e')){var _0x48492f={};_0x48492f[_0x31e05a[_0x6709('0x29')]]={'$like':'%'+_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]+'%'};return _0x48492f;}})});}_0x5b6906=_[_0x6709('0x3f')]({},_0x5b6906,_0x46a325[_0x6709('0x40')]);var _0x1030ee={'where':_0x5b6906[_0x6709('0x3b')]};return db['UserProfileResource'][_0x6709('0x1e')](_0x1030ee)[_0x6709('0x25')](function(_0x50fbcd){_0x4e6989[_0x6709('0x1e')]=_0x50fbcd;if(_0x46a325[_0x6709('0x2f')][_0x6709('0x41')]){_0x5b6906[_0x6709('0x42')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x5b6906);})[_0x6709('0x25')](function(_0x3f0da1){_0x4e6989[_0x6709('0x43')]=_0x3f0da1;return _0x4e6989;})[_0x6709('0x25')](respondWithFilteredResult(_0x3cd555,_0x5b6906))['catch'](handleError(_0x3cd555,null));};exports['show']=function(_0x5af1fb,_0x3d4237){var _0x293577={'raw':![],'where':{'id':_0x5af1fb[_0x6709('0x44')]['id']}},_0x54f74e={};_0x54f74e[_0x6709('0x33')]=_['keys'](db['UserProfileResource'][_0x6709('0x2c')]);_0x54f74e[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x5af1fb[_0x6709('0x2f')]);_0x54f74e[_0x6709('0x31')]=_['intersection'](_0x54f74e[_0x6709('0x33')],_0x54f74e['query']);_0x293577[_0x6709('0x35')]=_[_0x6709('0x32')](_0x54f74e[_0x6709('0x33')],qs['fields'](_0x5af1fb[_0x6709('0x2f')]['fields']));_0x293577['attributes']=_0x293577[_0x6709('0x35')][_0x6709('0x36')]?_0x293577[_0x6709('0x35')]:_0x54f74e[_0x6709('0x33')];if(_0x5af1fb[_0x6709('0x2f')][_0x6709('0x41')]){_0x293577[_0x6709('0x42')]=[{'all':!![]}];}_0x293577=_[_0x6709('0x3f')]({},_0x293577,_0x5af1fb[_0x6709('0x40')]);return db[_0x6709('0x45')][_0x6709('0x46')](_0x293577)[_0x6709('0x25')](handleEntityNotFound(_0x3d4237,null))[_0x6709('0x25')](respondWithResult(_0x3d4237,null))[_0x6709('0x47')](handleError(_0x3d4237,null));};exports[_0x6709('0x48')]=function(_0x4f82a0,_0xfbb810){return db['UserProfileResource']['create'](_0x4f82a0[_0x6709('0x49')],{})[_0x6709('0x25')](respondWithResult(_0xfbb810,0xc9))[_0x6709('0x47')](handleError(_0xfbb810,null));};exports[_0x6709('0x24')]=function(_0x22363b,_0x2b05dc){if(_0x22363b[_0x6709('0x49')]['id']){delete _0x22363b[_0x6709('0x49')]['id'];}return db['UserProfileResource'][_0x6709('0x46')]({'where':{'id':_0x22363b[_0x6709('0x44')]['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2b05dc,null))[_0x6709('0x25')](saveUpdates(_0x22363b['body'],null))[_0x6709('0x25')](respondWithResult(_0x2b05dc,null))['catch'](handleError(_0x2b05dc,null));};exports[_0x6709('0x26')]=function(_0x34a950,_0x2a563b){return db[_0x6709('0x45')][_0x6709('0x46')]({'where':{'id':_0x34a950['params']['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2a563b,null))[_0x6709('0x25')](removeEntity(_0x2a563b,null))[_0x6709('0x47')](handleError(_0x2a563b,null));};exports[_0x6709('0x4a')]=function(_0x1015e0,_0x55188c){return db['UserProfileResource'][_0x6709('0x4a')]()['then'](respondWithResult(_0x55188c,null))['catch'](handleError(_0x55188c,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 340e24f..6bce549 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 _0xdf39=['util','../../config/logger','api','moment','path','./userProfileResource.attributes','exports','UserProfileResource','compositeIndex','resourceId','lodash'];(function(_0x3e15ce,_0x1447f5){var _0x5aca71=function(_0x80abc6){while(--_0x80abc6){_0x3e15ce['push'](_0x3e15ce['shift']());}};_0x5aca71(++_0x1447f5);}(_0xdf39,0x83));var _0x9df3=function(_0x349337,_0x3363d5){_0x349337=_0x349337-0x0;var _0x219cbd=_0xdf39[_0x349337];return _0x219cbd;};'use strict';var _=require(_0x9df3('0x0'));var util=require(_0x9df3('0x1'));var logger=require(_0x9df3('0x2'))(_0x9df3('0x3'));var moment=require(_0x9df3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9df3('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9df3('0x6'));module[_0x9df3('0x7')]=function(_0xec89b3,_0x34615a){return _0xec89b3['define'](_0x9df3('0x8'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x9df3('0x9'),'fields':[_0x9df3('0xa'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe453=['lodash','util','../../config/logger','api','moment','request-promise','path','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','resourceId'];(function(_0x4e0625,_0x1109f3){var _0x3778ec=function(_0x3b8382){while(--_0x3b8382){_0x4e0625['push'](_0x4e0625['shift']());}};_0x3778ec(++_0x1109f3);}(_0xe453,0x75));var _0x3e45=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe453[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x3e45('0x0'));var util=require(_0x3e45('0x1'));var logger=require(_0x3e45('0x2'))(_0x3e45('0x3'));var moment=require(_0x3e45('0x4'));var BPromise=require('bluebird');var rp=require(_0x3e45('0x5'));var fs=require('fs');var path=require(_0x3e45('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3e45('0x7'));module[_0x3e45('0x8')]=function(_0x36d6c2,_0x4fe086){return _0x36d6c2[_0x3e45('0x9')](_0x3e45('0xa'),attributes,{'tableName':_0x3e45('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x3e45('0xc'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 54a6656..3dc436c 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 _0x2269=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2269,0x18f));var _0x9226=function(_0x10ad33,_0x1987a8){_0x10ad33=_0x10ad33-0x0;var _0x23eeaa=_0x2269[_0x10ad33];return _0x23eeaa;};'use strict';var _=require(_0x9226('0x0'));var util=require(_0x9226('0x1'));var moment=require(_0x9226('0x2'));var BPromise=require(_0x9226('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9226('0x4'))['db'];var utils=require(_0x9226('0x5'));var logger=require(_0x9226('0x6'))(_0x9226('0x7'));var config=require('../../config/environment');var jayson=require(_0x9226('0x8'));var client=jayson[_0x9226('0x9')][_0x9226('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfe333f,_0x4bf276,_0x37717d){return new BPromise(function(_0x3363d3,_0x1832d4){return client[_0x9226('0xb')](_0xfe333f,_0x37717d)[_0x9226('0xc')](function(_0x1c9688){logger[_0x9226('0xd')](_0x9226('0xe'),_0x4bf276,_0x9226('0xf'));logger[_0x9226('0x10')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x4bf276,_0x9226('0xf'),JSON[_0x9226('0x11')](_0x1c9688));if(_0x1c9688[_0x9226('0x12')]){if(_0x1c9688[_0x9226('0x12')]['code']===0x1f4){logger[_0x9226('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x4bf276,_0x1c9688[_0x9226('0x12')][_0x9226('0x13')]);return _0x1832d4(_0x1c9688['error'][_0x9226('0x13')]);}logger[_0x9226('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x4bf276,_0x1c9688[_0x9226('0x12')][_0x9226('0x13')]);return _0x3363d3(_0x1c9688[_0x9226('0x12')][_0x9226('0x13')]);}else{logger['info'](_0x9226('0xe'),_0x4bf276,'request\x20sent');_0x3363d3(_0x1c9688['result'][_0x9226('0x13')]);}})[_0x9226('0x14')](function(_0x39d74d){logger[_0x9226('0x12')](_0x9226('0xe'),_0x4bf276,_0x39d74d);_0x1832d4(_0x39d74d);});});} \ No newline at end of file +var _0x8217=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x4454b2,_0x3f408b){var _0x50b8f1=function(_0x5bdbe8){while(--_0x5bdbe8){_0x4454b2['push'](_0x4454b2['shift']());}};_0x50b8f1(++_0x3f408b);}(_0x8217,0x134));var _0x7821=function(_0x55d58f,_0x2bea83){_0x55d58f=_0x55d58f-0x0;var _0x1ad6e6=_0x8217[_0x55d58f];return _0x1ad6e6;};'use strict';var _=require(_0x7821('0x0'));var util=require(_0x7821('0x1'));var moment=require(_0x7821('0x2'));var BPromise=require(_0x7821('0x3'));var rs=require(_0x7821('0x4'));var fs=require('fs');var Redis=require(_0x7821('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7821('0x6'))('rpc');var config=require(_0x7821('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7821('0x8')][_0x7821('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41b445,_0x39455a,_0xeb8e05){return new BPromise(function(_0x6944cc,_0x2b0e06){return client[_0x7821('0xa')](_0x41b445,_0xeb8e05)[_0x7821('0xb')](function(_0x13a3b9){logger[_0x7821('0xc')](_0x7821('0xd'),_0x39455a,_0x7821('0xe'));logger[_0x7821('0xf')](_0x7821('0x10'),_0x39455a,_0x7821('0xe'),JSON['stringify'](_0x13a3b9));if(_0x13a3b9[_0x7821('0x11')]){if(_0x13a3b9[_0x7821('0x11')][_0x7821('0x12')]===0x1f4){logger[_0x7821('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x39455a,_0x13a3b9[_0x7821('0x11')][_0x7821('0x13')]);return _0x2b0e06(_0x13a3b9[_0x7821('0x11')]['message']);}logger[_0x7821('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x39455a,_0x13a3b9[_0x7821('0x11')]['message']);return _0x6944cc(_0x13a3b9[_0x7821('0x11')][_0x7821('0x13')]);}else{logger['info'](_0x7821('0xd'),_0x39455a,_0x7821('0xe'));_0x6944cc(_0x13a3b9[_0x7821('0x14')][_0x7821('0x13')]);}})[_0x7821('0x15')](function(_0x218786){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x39455a,_0x218786);_0x2b0e06(_0x218786);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index b67ed82..14e9272 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 _0x39f2=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x472596,_0x29f567){var _0x40f670=function(_0x1bbfad){while(--_0x1bbfad){_0x472596['push'](_0x472596['shift']());}};_0x40f670(++_0x29f567);}(_0x39f2,0x154));var _0x239f=function(_0xcc1484,_0x4570fd){_0xcc1484=_0xcc1484-0x0;var _0x2300dd=_0x39f2[_0xcc1484];return _0x2300dd;};'use strict';var multer=require(_0x239f('0x0'));var util=require(_0x239f('0x1'));var path=require('path');var timeout=require(_0x239f('0x2'));var express=require(_0x239f('0x3'));var router=express[_0x239f('0x4')]();var fs_extra=require(_0x239f('0x5'));var auth=require(_0x239f('0x6'));var interaction=require(_0x239f('0x7'));var config=require(_0x239f('0x8'));var controller=require(_0x239f('0x9'));router[_0x239f('0xa')]('/',auth['isAuthenticated'](),controller[_0x239f('0xb')]);router[_0x239f('0xa')](_0x239f('0xc'),auth[_0x239f('0xd')](),controller[_0x239f('0xe')]);router[_0x239f('0xa')](_0x239f('0xf'),auth[_0x239f('0xd')](),controller[_0x239f('0x10')]);router[_0x239f('0x11')]('/',auth[_0x239f('0xd')](),controller[_0x239f('0x12')]);router[_0x239f('0x13')](_0x239f('0xf'),auth[_0x239f('0xd')](),controller['update']);router[_0x239f('0x14')](_0x239f('0xf'),auth[_0x239f('0xd')](),controller[_0x239f('0x15')]);module[_0x239f('0x16')]=router; \ No newline at end of file +var _0x1e61=['../../config/environment','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5383af,_0xb2349){var _0x42d304=function(_0x11c1ae){while(--_0x11c1ae){_0x5383af['push'](_0x5383af['shift']());}};_0x42d304(++_0xb2349);}(_0x1e61,0x150));var _0x11e6=function(_0x4aaa7f,_0x44aeb6){_0x4aaa7f=_0x4aaa7f-0x0;var _0x11617c=_0x1e61[_0x4aaa7f];return _0x11617c;};'use strict';var multer=require(_0x11e6('0x0'));var util=require(_0x11e6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x11e6('0x2'));var router=express[_0x11e6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x11e6('0x4'));var interaction=require(_0x11e6('0x5'));var config=require(_0x11e6('0x6'));var controller=require('./userProfileSection.controller');router[_0x11e6('0x7')]('/',auth['isAuthenticated'](),controller[_0x11e6('0x8')]);router['get'](_0x11e6('0x9'),auth[_0x11e6('0xa')](),controller['describe']);router['get'](_0x11e6('0xb'),auth[_0x11e6('0xa')](),controller[_0x11e6('0xc')]);router[_0x11e6('0xd')]('/',auth[_0x11e6('0xa')](),controller[_0x11e6('0xe')]);router[_0x11e6('0xf')]('/:id',auth[_0x11e6('0xa')](),controller[_0x11e6('0x10')]);router[_0x11e6('0x11')]('/:id',auth[_0x11e6('0xa')](),controller[_0x11e6('0x12')]);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 36ed052..4161e54 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 _0x5eb8=['STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x353fca,_0xe7dac5){var _0x508fe7=function(_0x65ed4f){while(--_0x65ed4f){_0x353fca['push'](_0x353fca['shift']());}};_0x508fe7(++_0xe7dac5);}(_0x5eb8,0xb0));var _0x85eb=function(_0x22c50e,_0x4ea131){_0x22c50e=_0x22c50e-0x0;var _0x500f85=_0x5eb8[_0x22c50e];return _0x500f85;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x85eb('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x85eb('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x85eb('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0x85eb('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x85eb('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x85eb('0x0')],'set':function(_0x13b1df){this[_0x85eb('0x3')](_0x85eb('0x4'),_0x13b1df?_0x13b1df[_0x85eb('0x5')](''):[]);},'get':function(){return this[_0x85eb('0x6')](_0x85eb('0x4'))?this['getDataValue'](_0x85eb('0x4'))[_0x85eb('0x7')](''):[];}}}; \ No newline at end of file +var _0x056b=['getDataValue','split','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x226a3f,_0x4b8900){var _0x16cb5d=function(_0x58a83c){while(--_0x58a83c){_0x226a3f['push'](_0x226a3f['shift']());}};_0x16cb5d(++_0x4b8900);}(_0x056b,0xb6));var _0xb056=function(_0x4bc9da,_0x42dace){_0x4bc9da=_0x4bc9da-0x0;var _0x14573c=_0x056b[_0x4bc9da];return _0x14573c;};'use strict';var Sequelize=require('sequelize');module[_0xb056('0x0')]={'name':{'type':Sequelize[_0xb056('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xb056('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xb056('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xb056('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xb056('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xb056('0x1')],'set':function(_0x4157e0){this[_0xb056('0x4')](_0xb056('0x5'),_0x4157e0?_0x4157e0[_0xb056('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0xb056('0x5'))?this[_0xb056('0x7')](_0xb056('0x5'))[_0xb056('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index caefcc2..5b6851a 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 _0x06ad=['create','body','find','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','UserProfileSection','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show'];(function(_0x16286b,_0x4bf44f){var _0x20cd41=function(_0x4faf0e){while(--_0x4faf0e){_0x16286b['push'](_0x16286b['shift']());}};_0x20cd41(++_0x4bf44f);}(_0x06ad,0x9d));var _0xd06a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x06ad[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd06a('0x0'));var rimraf=require(_0xd06a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd06a('0x2'));var rp=require('request-promise');var moment=require(_0xd06a('0x3'));var BPromise=require(_0xd06a('0x4'));var Mustache=require(_0xd06a('0x5'));var util=require(_0xd06a('0x6'));var path=require('path');var sox=require(_0xd06a('0x7'));var csv=require(_0xd06a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd06a('0x9'));var _=require('lodash');var squel=require(_0xd06a('0xa'));var crypto=require(_0xd06a('0xb'));var jsforce=require(_0xd06a('0xc'));var deskjs=require(_0xd06a('0xd'));var toCsv=require(_0xd06a('0x8'));var querystring=require(_0xd06a('0xe'));var Papa=require(_0xd06a('0xf'));var Redis=require('ioredis');var authService=require(_0xd06a('0x10'));var qs=require(_0xd06a('0x11'));var as=require(_0xd06a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd06a('0x13'))(_0xd06a('0x14'));var utils=require(_0xd06a('0x15'));var config=require(_0xd06a('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a00cd,_0x16e39a){_0x16e39a=_0x16e39a||0xcc;return function(_0x38770b){if(_0x38770b){return _0x2a00cd[_0xd06a('0x17')](_0x16e39a);}return _0x2a00cd[_0xd06a('0x18')](_0x16e39a)[_0xd06a('0x19')]();};}function respondWithResult(_0xed1ed8,_0x5e6fbe){_0x5e6fbe=_0x5e6fbe||0xc8;return function(_0x70bcb5){if(_0x70bcb5){return _0xed1ed8[_0xd06a('0x18')](_0x5e6fbe)[_0xd06a('0x1a')](_0x70bcb5);}};}function respondWithFilteredResult(_0x60c883,_0x16bffa){return function(_0x4c3086){if(_0x4c3086){var _0xf5893e=typeof _0x16bffa[_0xd06a('0x1b')]===_0xd06a('0x1c')&&typeof _0x16bffa[_0xd06a('0x1d')]===_0xd06a('0x1c');var _0xe640dd=_0x4c3086[_0xd06a('0x1e')];var _0x1807a0=_0xf5893e?0x0:_0x16bffa[_0xd06a('0x1b')];var _0x3f5ee3=_0xf5893e?_0x4c3086['count']:_0x16bffa[_0xd06a('0x1b')]+_0x16bffa[_0xd06a('0x1d')];var _0x3d1470;if(_0x3f5ee3>=_0xe640dd){_0x3f5ee3=_0xe640dd;_0x3d1470=0xc8;}else{_0x3d1470=0xce;}_0x60c883[_0xd06a('0x18')](_0x3d1470);return _0x60c883[_0xd06a('0x1f')](_0xd06a('0x20'),_0x1807a0+'-'+_0x3f5ee3+'/'+_0xe640dd)[_0xd06a('0x1a')](_0x4c3086);}return null;};}function patchUpdates(_0x5ca67e){return function(_0x36ef3b){try{jsonpatch['apply'](_0x36ef3b,_0x5ca67e,!![]);}catch(_0x299d01){return BPromise['reject'](_0x299d01);}return _0x36ef3b[_0xd06a('0x21')]();};}function saveUpdates(_0x32e65b,_0x7e27cc){return function(_0x261ad0){if(_0x261ad0){return _0x261ad0[_0xd06a('0x22')](_0x32e65b)[_0xd06a('0x23')](function(_0x588984){return _0x588984;});}return null;};}function removeEntity(_0x5817be,_0x555d2d){return function(_0x346f53){if(_0x346f53){return _0x346f53[_0xd06a('0x24')]()[_0xd06a('0x23')](function(){_0x5817be[_0xd06a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x393c49,_0x50d13a){return function(_0x27d68c){if(!_0x27d68c){_0x393c49[_0xd06a('0x17')](0x194);}return _0x27d68c;};}function handleError(_0x3d1263,_0x35b5ac){_0x35b5ac=_0x35b5ac||0x1f4;return function(_0x383fb0){logger[_0xd06a('0x25')](_0x383fb0[_0xd06a('0x26')]);if(_0x383fb0[_0xd06a('0x27')]){delete _0x383fb0[_0xd06a('0x27')];}_0x3d1263[_0xd06a('0x18')](_0x35b5ac)[_0xd06a('0x28')](_0x383fb0);};}exports[_0xd06a('0x29')]=function(_0x28ca85,_0x191c06){var _0x508029={},_0x1eb4ba={},_0x4fb29c={'count':0x0,'rows':[]};var _0x251444=_[_0xd06a('0x2a')](db[_0xd06a('0x2b')][_0xd06a('0x2c')],function(_0x237c2f){return{'name':_0x237c2f['fieldName'],'type':_0x237c2f[_0xd06a('0x2d')][_0xd06a('0x2e')]};});_0x1eb4ba[_0xd06a('0x2f')]=_[_0xd06a('0x2a')](_0x251444,'name');_0x1eb4ba[_0xd06a('0x30')]=_[_0xd06a('0x31')](_0x28ca85['query']);_0x1eb4ba[_0xd06a('0x32')]=_[_0xd06a('0x33')](_0x1eb4ba['model'],_0x1eb4ba[_0xd06a('0x30')]);_0x508029[_0xd06a('0x34')]=_[_0xd06a('0x33')](_0x1eb4ba['model'],qs[_0xd06a('0x35')](_0x28ca85[_0xd06a('0x30')][_0xd06a('0x35')]));_0x508029['attributes']=_0x508029[_0xd06a('0x34')][_0xd06a('0x36')]?_0x508029[_0xd06a('0x34')]:_0x1eb4ba[_0xd06a('0x2f')];if(!_0x28ca85['query'][_0xd06a('0x37')](_0xd06a('0x38'))){_0x508029[_0xd06a('0x1d')]=qs['limit'](_0x28ca85['query'][_0xd06a('0x1d')]);_0x508029['offset']=qs[_0xd06a('0x1b')](_0x28ca85[_0xd06a('0x30')][_0xd06a('0x1b')]);}_0x508029[_0xd06a('0x39')]=qs[_0xd06a('0x3a')](_0x28ca85['query']['sort']);_0x508029[_0xd06a('0x3b')]=qs[_0xd06a('0x32')](_[_0xd06a('0x3c')](_0x28ca85[_0xd06a('0x30')],_0x1eb4ba['filters']),_0x251444);if(_0x28ca85[_0xd06a('0x30')]['filter']){_0x508029[_0xd06a('0x3b')]=_[_0xd06a('0x3d')](_0x508029[_0xd06a('0x3b')],{'$or':_[_0xd06a('0x2a')](_0x251444,function(_0x41e0d8){if(_0x41e0d8['type']!==_0xd06a('0x3e')){var _0x57aef8={};_0x57aef8[_0x41e0d8[_0xd06a('0x27')]]={'$like':'%'+_0x28ca85['query'][_0xd06a('0x3f')]+'%'};return _0x57aef8;}})});}_0x508029=_[_0xd06a('0x3d')]({},_0x508029,_0x28ca85[_0xd06a('0x40')]);var _0x375e60={'where':_0x508029[_0xd06a('0x3b')]};return db['UserProfileSection'][_0xd06a('0x1e')](_0x375e60)[_0xd06a('0x23')](function(_0x3d3e41){_0x4fb29c[_0xd06a('0x1e')]=_0x3d3e41;if(_0x28ca85[_0xd06a('0x30')][_0xd06a('0x41')]){_0x508029[_0xd06a('0x42')]=[{'all':!![]}];}return db[_0xd06a('0x2b')][_0xd06a('0x43')](_0x508029);})[_0xd06a('0x23')](function(_0xb6d3b8){_0x4fb29c[_0xd06a('0x44')]=_0xb6d3b8;return _0x4fb29c;})['then'](respondWithFilteredResult(_0x191c06,_0x508029))[_0xd06a('0x45')](handleError(_0x191c06,null));};exports[_0xd06a('0x46')]=function(_0x2f9f2a,_0x3ca386){var _0x379cef={'raw':![],'where':{'id':_0x2f9f2a['params']['id']}},_0x4747ee={};_0x4747ee['model']=_[_0xd06a('0x31')](db[_0xd06a('0x2b')][_0xd06a('0x2c')]);_0x4747ee['query']=_[_0xd06a('0x31')](_0x2f9f2a[_0xd06a('0x30')]);_0x4747ee[_0xd06a('0x32')]=_[_0xd06a('0x33')](_0x4747ee[_0xd06a('0x2f')],_0x4747ee['query']);_0x379cef[_0xd06a('0x34')]=_[_0xd06a('0x33')](_0x4747ee[_0xd06a('0x2f')],qs[_0xd06a('0x35')](_0x2f9f2a['query'][_0xd06a('0x35')]));_0x379cef['attributes']=_0x379cef['attributes'][_0xd06a('0x36')]?_0x379cef[_0xd06a('0x34')]:_0x4747ee[_0xd06a('0x2f')];if(_0x2f9f2a['query'][_0xd06a('0x41')]){_0x379cef['include']=[{'all':!![]}];}_0x379cef=_[_0xd06a('0x3d')]({},_0x379cef,_0x2f9f2a['options']);return db['UserProfileSection']['find'](_0x379cef)[_0xd06a('0x23')](handleEntityNotFound(_0x3ca386,null))[_0xd06a('0x23')](respondWithResult(_0x3ca386,null))[_0xd06a('0x45')](handleError(_0x3ca386,null));};exports[_0xd06a('0x47')]=function(_0x19e162,_0x42090d){return db[_0xd06a('0x2b')][_0xd06a('0x47')](_0x19e162[_0xd06a('0x48')],{})[_0xd06a('0x23')](respondWithResult(_0x42090d,0xc9))[_0xd06a('0x45')](handleError(_0x42090d,null));};exports[_0xd06a('0x22')]=function(_0x5c34b2,_0x97f802){if(_0x5c34b2[_0xd06a('0x48')]['id']){delete _0x5c34b2[_0xd06a('0x48')]['id'];}return db[_0xd06a('0x2b')][_0xd06a('0x49')]({'where':{'id':_0x5c34b2[_0xd06a('0x4a')]['id']}})[_0xd06a('0x23')](handleEntityNotFound(_0x97f802,null))[_0xd06a('0x23')](saveUpdates(_0x5c34b2[_0xd06a('0x48')],null))[_0xd06a('0x23')](respondWithResult(_0x97f802,null))[_0xd06a('0x45')](handleError(_0x97f802,null));};exports[_0xd06a('0x24')]=function(_0x4e7a24,_0x872862){return db['UserProfileSection'][_0xd06a('0x49')]({'where':{'id':_0x4e7a24[_0xd06a('0x4a')]['id']}})[_0xd06a('0x23')](handleEntityNotFound(_0x872862,null))[_0xd06a('0x23')](removeEntity(_0x872862,null))[_0xd06a('0x45')](handleError(_0x872862,null));};exports[_0xd06a('0x4b')]=function(_0x41adfe,_0x3a5aa0){return db[_0xd06a('0x2b')]['describe']()[_0xd06a('0x23')](respondWithResult(_0x3a5aa0,null))[_0xd06a('0x45')](handleError(_0x3a5aa0,null));}; \ No newline at end of file +var _0x5d20=['nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','end','sendStatus','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','length'];(function(_0x484630,_0x439a47){var _0x4c35ce=function(_0x5b9a68){while(--_0x5b9a68){_0x484630['push'](_0x484630['shift']());}};_0x4c35ce(++_0x439a47);}(_0x5d20,0xfa));var _0x05d2=function(_0x52a31e,_0x303640){_0x52a31e=_0x52a31e-0x0;var _0x524743=_0x5d20[_0x52a31e];return _0x524743;};'use strict';var emlformat=require(_0x05d2('0x0'));var rimraf=require(_0x05d2('0x1'));var zipdir=require(_0x05d2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x05d2('0x3'));var moment=require(_0x05d2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x05d2('0x5'));var util=require(_0x05d2('0x6'));var path=require(_0x05d2('0x7'));var sox=require(_0x05d2('0x8'));var csv=require(_0x05d2('0x9'));var ejs=require(_0x05d2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x05d2('0xb'));var squel=require(_0x05d2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x05d2('0xd'));var toCsv=require(_0x05d2('0x9'));var querystring=require(_0x05d2('0xe'));var Papa=require('papaparse');var Redis=require(_0x05d2('0xf'));var authService=require(_0x05d2('0x10'));var qs=require(_0x05d2('0x11'));var as=require(_0x05d2('0x12'));var hardwareService=require(_0x05d2('0x13'));var logger=require(_0x05d2('0x14'))(_0x05d2('0x15'));var utils=require(_0x05d2('0x16'));var config=require(_0x05d2('0x17'));var licenseUtil=require(_0x05d2('0x18'));var db=require(_0x05d2('0x19'))['db'];function respondWithStatusCode(_0x5a982c,_0xd2f461){_0xd2f461=_0xd2f461||0xcc;return function(_0x1fca11){if(_0x1fca11){return _0x5a982c['sendStatus'](_0xd2f461);}return _0x5a982c[_0x05d2('0x1a')](_0xd2f461)['end']();};}function respondWithResult(_0x2bb417,_0x4a004b){_0x4a004b=_0x4a004b||0xc8;return function(_0x21ce14){if(_0x21ce14){return _0x2bb417[_0x05d2('0x1a')](_0x4a004b)[_0x05d2('0x1b')](_0x21ce14);}};}function respondWithFilteredResult(_0x181393,_0x5ea4d1){return function(_0x2cc139){if(_0x2cc139){var _0x12289d=typeof _0x5ea4d1[_0x05d2('0x1c')]===_0x05d2('0x1d')&&typeof _0x5ea4d1['limit']===_0x05d2('0x1d');var _0x18f158=_0x2cc139[_0x05d2('0x1e')];var _0x23e72e=_0x12289d?0x0:_0x5ea4d1['offset'];var _0x2f84c0=_0x12289d?_0x2cc139[_0x05d2('0x1e')]:_0x5ea4d1[_0x05d2('0x1c')]+_0x5ea4d1[_0x05d2('0x1f')];var _0x50bb71;if(_0x2f84c0>=_0x18f158){_0x2f84c0=_0x18f158;_0x50bb71=0xc8;}else{_0x50bb71=0xce;}_0x181393[_0x05d2('0x1a')](_0x50bb71);return _0x181393['set'](_0x05d2('0x20'),_0x23e72e+'-'+_0x2f84c0+'/'+_0x18f158)[_0x05d2('0x1b')](_0x2cc139);}return null;};}function patchUpdates(_0x104215){return function(_0x3a8ea9){try{jsonpatch[_0x05d2('0x21')](_0x3a8ea9,_0x104215,!![]);}catch(_0x1343bb){return BPromise[_0x05d2('0x22')](_0x1343bb);}return _0x3a8ea9['save']();};}function saveUpdates(_0x141f0b,_0xc950b6){return function(_0x3b4715){if(_0x3b4715){return _0x3b4715[_0x05d2('0x23')](_0x141f0b)[_0x05d2('0x24')](function(_0x187918){return _0x187918;});}return null;};}function removeEntity(_0x290cbd,_0x166431){return function(_0xc4ffb5){if(_0xc4ffb5){return _0xc4ffb5['destroy']()[_0x05d2('0x24')](function(){_0x290cbd[_0x05d2('0x1a')](0xcc)[_0x05d2('0x25')]();});}};}function handleEntityNotFound(_0xc7648b,_0xfa28f9){return function(_0x20722d){if(!_0x20722d){_0xc7648b[_0x05d2('0x26')](0x194);}return _0x20722d;};}function handleError(_0x3f3927,_0x3cf1e7){_0x3cf1e7=_0x3cf1e7||0x1f4;return function(_0x850507){logger['error'](_0x850507[_0x05d2('0x27')]);if(_0x850507[_0x05d2('0x28')]){delete _0x850507[_0x05d2('0x28')];}_0x3f3927[_0x05d2('0x1a')](_0x3cf1e7)[_0x05d2('0x29')](_0x850507);};}exports[_0x05d2('0x2a')]=function(_0x228780,_0x1839f7){var _0x278da2={},_0x220f91={},_0x37dfbd={'count':0x0,'rows':[]};var _0x519378=_[_0x05d2('0x2b')](db[_0x05d2('0x2c')][_0x05d2('0x2d')],function(_0x82957c){return{'name':_0x82957c[_0x05d2('0x2e')],'type':_0x82957c['type']['key']};});_0x220f91['model']=_[_0x05d2('0x2b')](_0x519378,_0x05d2('0x28'));_0x220f91[_0x05d2('0x2f')]=_['keys'](_0x228780[_0x05d2('0x2f')]);_0x220f91[_0x05d2('0x30')]=_[_0x05d2('0x31')](_0x220f91[_0x05d2('0x32')],_0x220f91[_0x05d2('0x2f')]);_0x278da2[_0x05d2('0x33')]=_[_0x05d2('0x31')](_0x220f91[_0x05d2('0x32')],qs[_0x05d2('0x34')](_0x228780[_0x05d2('0x2f')][_0x05d2('0x34')]));_0x278da2[_0x05d2('0x33')]=_0x278da2[_0x05d2('0x33')][_0x05d2('0x35')]?_0x278da2[_0x05d2('0x33')]:_0x220f91[_0x05d2('0x32')];if(!_0x228780[_0x05d2('0x2f')]['hasOwnProperty'](_0x05d2('0x36'))){_0x278da2[_0x05d2('0x1f')]=qs[_0x05d2('0x1f')](_0x228780['query'][_0x05d2('0x1f')]);_0x278da2[_0x05d2('0x1c')]=qs[_0x05d2('0x1c')](_0x228780['query']['offset']);}_0x278da2[_0x05d2('0x37')]=qs[_0x05d2('0x38')](_0x228780[_0x05d2('0x2f')]['sort']);_0x278da2['where']=qs[_0x05d2('0x30')](_[_0x05d2('0x39')](_0x228780[_0x05d2('0x2f')],_0x220f91[_0x05d2('0x30')]),_0x519378);if(_0x228780[_0x05d2('0x2f')][_0x05d2('0x3a')]){_0x278da2[_0x05d2('0x3b')]=_[_0x05d2('0x3c')](_0x278da2['where'],{'$or':_[_0x05d2('0x2b')](_0x519378,function(_0x2d3d75){if(_0x2d3d75['type']!==_0x05d2('0x3d')){var _0x32e063={};_0x32e063[_0x2d3d75[_0x05d2('0x28')]]={'$like':'%'+_0x228780[_0x05d2('0x2f')][_0x05d2('0x3a')]+'%'};return _0x32e063;}})});}_0x278da2=_[_0x05d2('0x3c')]({},_0x278da2,_0x228780[_0x05d2('0x3e')]);var _0x4ba621={'where':_0x278da2[_0x05d2('0x3b')]};return db[_0x05d2('0x2c')][_0x05d2('0x1e')](_0x4ba621)[_0x05d2('0x24')](function(_0x440290){_0x37dfbd[_0x05d2('0x1e')]=_0x440290;if(_0x228780[_0x05d2('0x2f')]['includeAll']){_0x278da2[_0x05d2('0x3f')]=[{'all':!![]}];}return db['UserProfileSection'][_0x05d2('0x40')](_0x278da2);})[_0x05d2('0x24')](function(_0x57220d){_0x37dfbd[_0x05d2('0x41')]=_0x57220d;return _0x37dfbd;})['then'](respondWithFilteredResult(_0x1839f7,_0x278da2))[_0x05d2('0x42')](handleError(_0x1839f7,null));};exports[_0x05d2('0x43')]=function(_0x7b1221,_0x183c5b){var _0x3fb2ee={'raw':![],'where':{'id':_0x7b1221[_0x05d2('0x44')]['id']}},_0x597e71={};_0x597e71['model']=_[_0x05d2('0x45')](db[_0x05d2('0x2c')][_0x05d2('0x2d')]);_0x597e71[_0x05d2('0x2f')]=_[_0x05d2('0x45')](_0x7b1221[_0x05d2('0x2f')]);_0x597e71[_0x05d2('0x30')]=_[_0x05d2('0x31')](_0x597e71[_0x05d2('0x32')],_0x597e71[_0x05d2('0x2f')]);_0x3fb2ee[_0x05d2('0x33')]=_[_0x05d2('0x31')](_0x597e71[_0x05d2('0x32')],qs[_0x05d2('0x34')](_0x7b1221[_0x05d2('0x2f')][_0x05d2('0x34')]));_0x3fb2ee[_0x05d2('0x33')]=_0x3fb2ee['attributes'][_0x05d2('0x35')]?_0x3fb2ee[_0x05d2('0x33')]:_0x597e71['model'];if(_0x7b1221[_0x05d2('0x2f')][_0x05d2('0x46')]){_0x3fb2ee[_0x05d2('0x3f')]=[{'all':!![]}];}_0x3fb2ee=_[_0x05d2('0x3c')]({},_0x3fb2ee,_0x7b1221['options']);return db[_0x05d2('0x2c')][_0x05d2('0x47')](_0x3fb2ee)['then'](handleEntityNotFound(_0x183c5b,null))[_0x05d2('0x24')](respondWithResult(_0x183c5b,null))[_0x05d2('0x42')](handleError(_0x183c5b,null));};exports[_0x05d2('0x48')]=function(_0x23b23d,_0x5d3f9f){return db['UserProfileSection'][_0x05d2('0x48')](_0x23b23d['body'],{})[_0x05d2('0x24')](respondWithResult(_0x5d3f9f,0xc9))['catch'](handleError(_0x5d3f9f,null));};exports['update']=function(_0x35e0ef,_0x407500){if(_0x35e0ef[_0x05d2('0x49')]['id']){delete _0x35e0ef[_0x05d2('0x49')]['id'];}return db[_0x05d2('0x2c')][_0x05d2('0x47')]({'where':{'id':_0x35e0ef['params']['id']}})[_0x05d2('0x24')](handleEntityNotFound(_0x407500,null))['then'](saveUpdates(_0x35e0ef['body'],null))[_0x05d2('0x24')](respondWithResult(_0x407500,null))[_0x05d2('0x42')](handleError(_0x407500,null));};exports[_0x05d2('0x4a')]=function(_0x348b4e,_0x3fb72c){return db[_0x05d2('0x2c')][_0x05d2('0x47')]({'where':{'id':_0x348b4e['params']['id']}})[_0x05d2('0x24')](handleEntityNotFound(_0x3fb72c,null))[_0x05d2('0x24')](removeEntity(_0x3fb72c,null))[_0x05d2('0x42')](handleError(_0x3fb72c,null));};exports['describe']=function(_0x5007be,_0xc27675){return db[_0x05d2('0x2c')][_0x05d2('0x4b')]()[_0x05d2('0x24')](respondWithResult(_0xc27675,null))[_0x05d2('0x42')](handleError(_0xc27675,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 640a51c..d385975 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 _0x0798=['./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3c623f,_0x55efeb){var _0xcd5f57=function(_0x47b121){while(--_0x47b121){_0x3c623f['push'](_0x3c623f['shift']());}};_0xcd5f57(++_0x55efeb);}(_0x0798,0x1b9));var _0x8079=function(_0xe80430,_0x13b9eb){_0xe80430=_0xe80430-0x0;var _0x3d7f64=_0x0798[_0xe80430];return _0x3d7f64;};'use strict';var _=require(_0x8079('0x0'));var util=require(_0x8079('0x1'));var logger=require(_0x8079('0x2'))(_0x8079('0x3'));var moment=require(_0x8079('0x4'));var BPromise=require('bluebird');var rp=require(_0x8079('0x5'));var fs=require('fs');var path=require(_0x8079('0x6'));var rimraf=require(_0x8079('0x7'));var config=require(_0x8079('0x8'));var attributes=require(_0x8079('0x9'));module[_0x8079('0xa')]=function(_0x1dd5eb,_0x2fde5a){return _0x1dd5eb['define'](_0x8079('0xb'),attributes,{'tableName':_0x8079('0xc'),'paranoid':![],'indexes':[{'name':_0x8079('0xd'),'fields':['sectionId',_0x8079('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3ba7=['moment','bluebird','request-promise','path','rimraf','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','sectionId','userProfileId','lodash','util','../../config/logger','api'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x3ba7,0x16c));var _0x73ba=function(_0xe06841,_0x5a1a51){_0xe06841=_0xe06841-0x0;var _0x19d3bb=_0x3ba7[_0xe06841];return _0x19d3bb;};'use strict';var _=require(_0x73ba('0x0'));var util=require(_0x73ba('0x1'));var logger=require(_0x73ba('0x2'))(_0x73ba('0x3'));var moment=require(_0x73ba('0x4'));var BPromise=require(_0x73ba('0x5'));var rp=require(_0x73ba('0x6'));var fs=require('fs');var path=require(_0x73ba('0x7'));var rimraf=require(_0x73ba('0x8'));var config=require('../../config/environment');var attributes=require(_0x73ba('0x9'));module[_0x73ba('0xa')]=function(_0x2014fb,_0x15b550){return _0x2014fb[_0x73ba('0xb')](_0x73ba('0xc'),attributes,{'tableName':_0x73ba('0xd'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x73ba('0xe'),_0x73ba('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 9f98ae2..06473da 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 _0xdb5a=['../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x4ae32d,_0x256489){var _0x550537=function(_0x534d63){while(--_0x534d63){_0x4ae32d['push'](_0x4ae32d['shift']());}};_0x550537(++_0x256489);}(_0xdb5a,0x1f2));var _0xadb5=function(_0x17d4e1,_0x10eacd){_0x17d4e1=_0x17d4e1-0x0;var _0x42108f=_0xdb5a[_0x17d4e1];return _0x42108f;};'use strict';var _=require(_0xadb5('0x0'));var util=require(_0xadb5('0x1'));var moment=require(_0xadb5('0x2'));var BPromise=require('bluebird');var rs=require(_0xadb5('0x3'));var fs=require('fs');var Redis=require(_0xadb5('0x4'));var db=require(_0xadb5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xadb5('0x6'))(_0xadb5('0x7'));var config=require(_0xadb5('0x8'));var jayson=require(_0xadb5('0x9'));var client=jayson['client'][_0xadb5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x138ecb,_0x2f8a9e,_0x4f0979){return new BPromise(function(_0x202aa4,_0xf9e2c1){return client[_0xadb5('0xb')](_0x138ecb,_0x4f0979)[_0xadb5('0xc')](function(_0x2e28d8){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x2f8a9e,_0xadb5('0xd'));logger[_0xadb5('0xe')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x2f8a9e,'request\x20sent',JSON[_0xadb5('0xf')](_0x2e28d8));if(_0x2e28d8[_0xadb5('0x10')]){if(_0x2e28d8[_0xadb5('0x10')][_0xadb5('0x11')]===0x1f4){logger[_0xadb5('0x10')](_0xadb5('0x12'),_0x2f8a9e,_0x2e28d8[_0xadb5('0x10')]['message']);return _0xf9e2c1(_0x2e28d8['error']['message']);}logger[_0xadb5('0x10')](_0xadb5('0x12'),_0x2f8a9e,_0x2e28d8['error']['message']);return _0x202aa4(_0x2e28d8['error'][_0xadb5('0x13')]);}else{logger[_0xadb5('0x14')](_0xadb5('0x12'),_0x2f8a9e,_0xadb5('0xd'));_0x202aa4(_0x2e28d8['result']['message']);}})[_0xadb5('0x15')](function(_0x312f81){logger[_0xadb5('0x10')](_0xadb5('0x12'),_0x2f8a9e,_0x312f81);_0xf9e2c1(_0x312f81);});});} \ No newline at end of file +var _0x3436=['info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x4d8dc3,_0x585fd1){var _0x9b03d9=function(_0x7a31d5){while(--_0x7a31d5){_0x4d8dc3['push'](_0x4d8dc3['shift']());}};_0x9b03d9(++_0x585fd1);}(_0x3436,0x192));var _0x6343=function(_0x43248e,_0x562773){_0x43248e=_0x43248e-0x0;var _0x2c042d=_0x3436[_0x43248e];return _0x2c042d;};'use strict';var _=require(_0x6343('0x0'));var util=require(_0x6343('0x1'));var moment=require('moment');var BPromise=require(_0x6343('0x2'));var rs=require(_0x6343('0x3'));var fs=require('fs');var Redis=require(_0x6343('0x4'));var db=require(_0x6343('0x5'))['db'];var utils=require(_0x6343('0x6'));var logger=require(_0x6343('0x7'))(_0x6343('0x8'));var config=require('../../config/environment');var jayson=require(_0x6343('0x9'));var client=jayson[_0x6343('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x492c2d,_0x505d7e,_0x4d42e0){return new BPromise(function(_0x2bd211,_0x575309){return client['request'](_0x492c2d,_0x4d42e0)[_0x6343('0xb')](function(_0x198421){logger['info'](_0x6343('0xc'),_0x505d7e,_0x6343('0xd'));logger['debug'](_0x6343('0xe'),_0x505d7e,'request\x20sent',JSON[_0x6343('0xf')](_0x198421));if(_0x198421[_0x6343('0x10')]){if(_0x198421[_0x6343('0x10')]['code']===0x1f4){logger['error'](_0x6343('0xc'),_0x505d7e,_0x198421[_0x6343('0x10')]['message']);return _0x575309(_0x198421[_0x6343('0x10')]['message']);}logger[_0x6343('0x10')](_0x6343('0xc'),_0x505d7e,_0x198421[_0x6343('0x10')][_0x6343('0x11')]);return _0x2bd211(_0x198421[_0x6343('0x10')][_0x6343('0x11')]);}else{logger[_0x6343('0x12')](_0x6343('0xc'),_0x505d7e,'request\x20sent');_0x2bd211(_0x198421[_0x6343('0x13')][_0x6343('0x11')]);}})[_0x6343('0x14')](function(_0x3999ad){logger[_0x6343('0x10')](_0x6343('0xc'),_0x505d7e,_0x3999ad);_0x575309(_0x3999ad);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 95ae3c3..ea745e2 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x534fda,_0x4ed79e){var _0x3560a2=function(_0x4ccae1){while(--_0x4ccae1){_0x534fda['push'](_0x534fda['shift']());}};_0x3560a2(++_0x4ed79e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xf441b6,_0x484362){var _0x4ab58f=function(_0x3a3bb0){while(--_0x3a3bb0){_0xf441b6['push'](_0xf441b6['shift']());}};_0x4ab58f(++_0x484362);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 7e2fe0b..da2de2f 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 _0xf442=['exports','INTEGER','sequelize'];(function(_0x2b73fa,_0x11125d){var _0x6207be=function(_0x3afc5d){while(--_0x3afc5d){_0x2b73fa['push'](_0x2b73fa['shift']());}};_0x6207be(++_0x11125d);}(_0xf442,0xbc));var _0x2f44=function(_0x4ac5e1,_0x2c108b){_0x4ac5e1=_0x4ac5e1-0x0;var _0x5be3a4=_0xf442[_0x4ac5e1];return _0x5be3a4;};'use strict';var Sequelize=require(_0x2f44('0x0'));module[_0x2f44('0x1')]={'penalty':{'type':Sequelize[_0x2f44('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4b36=['exports','sequelize'];(function(_0x300383,_0x4c1fb3){var _0x3c95e8=function(_0x2a76eb){while(--_0x2a76eb){_0x300383['push'](_0x300383['shift']());}};_0x3c95e8(++_0x4c1fb3);}(_0x4b36,0x14f));var _0x64b3=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x4b36[_0x13b8f3];return _0x1a6d06;};'use strict';var Sequelize=require(_0x64b3('0x0'));module[_0x64b3('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 9f0f0a8..8efa82b 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 _0x4317=['./userSmsQueue.attributes','define','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4a5b93,_0x30b4fd){var _0x318f46=function(_0x15dfb4){while(--_0x15dfb4){_0x4a5b93['push'](_0x4a5b93['shift']());}};_0x318f46(++_0x30b4fd);}(_0x4317,0x7c));var _0x7431=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4317[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x7431('0x0'));var logger=require(_0x7431('0x1'))(_0x7431('0x2'));var moment=require('moment');var BPromise=require(_0x7431('0x3'));var rp=require(_0x7431('0x4'));var fs=require('fs');var path=require(_0x7431('0x5'));var rimraf=require(_0x7431('0x6'));var config=require(_0x7431('0x7'));var attributes=require(_0x7431('0x8'));module['exports']=function(_0x57adc1,_0x1e1f35){return _0x57adc1[_0x7431('0x9')](_0x7431('0xa'),attributes,{'tableName':_0x7431('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fdc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x303c8c,_0x503d95){var _0x298a23=function(_0x15c856){while(--_0x15c856){_0x303c8c['push'](_0x303c8c['shift']());}};_0x298a23(++_0x503d95);}(_0x5fdc,0x127));var _0xc5fd=function(_0x5e0f09,_0x4459c9){_0x5e0f09=_0x5e0f09-0x0;var _0x2e471a=_0x5fdc[_0x5e0f09];return _0x2e471a;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var logger=require(_0xc5fd('0x2'))(_0xc5fd('0x3'));var moment=require(_0xc5fd('0x4'));var BPromise=require(_0xc5fd('0x5'));var rp=require(_0xc5fd('0x6'));var fs=require('fs');var path=require(_0xc5fd('0x7'));var rimraf=require(_0xc5fd('0x8'));var config=require(_0xc5fd('0x9'));var attributes=require(_0xc5fd('0xa'));module[_0xc5fd('0xb')]=function(_0x44722b,_0x216902){return _0x44722b[_0xc5fd('0xc')]('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index f74de5b..eb59800 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 _0x9340=['code','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x3a607e,_0x54d530){var _0x37b106=function(_0x1becae){while(--_0x1becae){_0x3a607e['push'](_0x3a607e['shift']());}};_0x37b106(++_0x54d530);}(_0x9340,0x1e6));var _0x0934=function(_0x5be6a6,_0x5b53e8){_0x5be6a6=_0x5be6a6-0x0;var _0x5d62b0=_0x9340[_0x5be6a6];return _0x5d62b0;};'use strict';var _=require('lodash');var util=require(_0x0934('0x0'));var moment=require(_0x0934('0x1'));var BPromise=require(_0x0934('0x2'));var rs=require(_0x0934('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0934('0x4'))['db'];var utils=require(_0x0934('0x5'));var logger=require(_0x0934('0x6'))(_0x0934('0x7'));var config=require('../../config/environment');var jayson=require(_0x0934('0x8'));var client=jayson[_0x0934('0x9')][_0x0934('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xdbd5,_0x2252ac,_0x708c7e){return new BPromise(function(_0x4279ff,_0x16f821){return client['request'](_0xdbd5,_0x708c7e)[_0x0934('0xb')](function(_0x3b9fb6){logger[_0x0934('0xc')](_0x0934('0xd'),_0x2252ac,_0x0934('0xe'));logger[_0x0934('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x2252ac,'request\x20sent',JSON[_0x0934('0x10')](_0x3b9fb6));if(_0x3b9fb6['error']){if(_0x3b9fb6[_0x0934('0x11')][_0x0934('0x12')]===0x1f4){logger[_0x0934('0x11')](_0x0934('0xd'),_0x2252ac,_0x3b9fb6[_0x0934('0x11')][_0x0934('0x13')]);return _0x16f821(_0x3b9fb6['error'][_0x0934('0x13')]);}logger[_0x0934('0x11')](_0x0934('0xd'),_0x2252ac,_0x3b9fb6[_0x0934('0x11')][_0x0934('0x13')]);return _0x4279ff(_0x3b9fb6[_0x0934('0x11')]['message']);}else{logger['info'](_0x0934('0xd'),_0x2252ac,'request\x20sent');_0x4279ff(_0x3b9fb6['result'][_0x0934('0x13')]);}})[_0x0934('0x14')](function(_0x3d9bb1){logger[_0x0934('0x11')](_0x0934('0xd'),_0x2252ac,_0x3d9bb1);_0x16f821(_0x3d9bb1);});});} \ No newline at end of file +var _0x1b2f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x55c1f0,_0x4f574f){var _0x1530fa=function(_0x631542){while(--_0x631542){_0x55c1f0['push'](_0x55c1f0['shift']());}};_0x1530fa(++_0x4f574f);}(_0x1b2f,0x88));var _0xf1b2=function(_0x285ca7,_0x552758){_0x285ca7=_0x285ca7-0x0;var _0x1a9197=_0x1b2f[_0x285ca7];return _0x1a9197;};'use strict';var _=require(_0xf1b2('0x0'));var util=require(_0xf1b2('0x1'));var moment=require(_0xf1b2('0x2'));var BPromise=require(_0xf1b2('0x3'));var rs=require(_0xf1b2('0x4'));var fs=require('fs');var Redis=require(_0xf1b2('0x5'));var db=require(_0xf1b2('0x6'))['db'];var utils=require(_0xf1b2('0x7'));var logger=require(_0xf1b2('0x8'))(_0xf1b2('0x9'));var config=require(_0xf1b2('0xa'));var jayson=require(_0xf1b2('0xb'));var client=jayson[_0xf1b2('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33b604,_0x36fabf,_0x317f2b){return new BPromise(function(_0x5df76a,_0x37fb34){return client[_0xf1b2('0xd')](_0x33b604,_0x317f2b)['then'](function(_0x2b724d){logger['info'](_0xf1b2('0xe'),_0x36fabf,_0xf1b2('0xf'));logger[_0xf1b2('0x10')](_0xf1b2('0x11'),_0x36fabf,_0xf1b2('0xf'),JSON[_0xf1b2('0x12')](_0x2b724d));if(_0x2b724d[_0xf1b2('0x13')]){if(_0x2b724d[_0xf1b2('0x13')]['code']===0x1f4){logger['error'](_0xf1b2('0xe'),_0x36fabf,_0x2b724d['error']['message']);return _0x37fb34(_0x2b724d[_0xf1b2('0x13')][_0xf1b2('0x14')]);}logger[_0xf1b2('0x13')](_0xf1b2('0xe'),_0x36fabf,_0x2b724d[_0xf1b2('0x13')][_0xf1b2('0x14')]);return _0x5df76a(_0x2b724d['error'][_0xf1b2('0x14')]);}else{logger[_0xf1b2('0x15')]('UserSmsQueue,\x20%s,\x20%s',_0x36fabf,_0xf1b2('0xf'));_0x5df76a(_0x2b724d[_0xf1b2('0x16')][_0xf1b2('0x14')]);}})[_0xf1b2('0x17')](function(_0x252760){logger[_0xf1b2('0x13')](_0xf1b2('0xe'),_0x36fabf,_0x252760);_0x37fb34(_0x252760);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index ca5ba4d..764b05f 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 _0xe56c=['exports','INTEGER'];(function(_0x3b3f4f,_0x403216){var _0x174dbe=function(_0x30e333){while(--_0x30e333){_0x3b3f4f['push'](_0x3b3f4f['shift']());}};_0x174dbe(++_0x403216);}(_0xe56c,0x11c));var _0xce56=function(_0x47fd8a,_0x35af75){_0x47fd8a=_0x47fd8a-0x0;var _0x5e2f98=_0xe56c[_0x47fd8a];return _0x5e2f98;};'use strict';var Sequelize=require('sequelize');module[_0xce56('0x0')]={'UserId':{'type':Sequelize[_0xce56('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xce56('0x1')]}}; \ No newline at end of file +var _0xef12=['INTEGER','sequelize','exports'];(function(_0xdb4955,_0x145b00){var _0x39daf9=function(_0x183327){while(--_0x183327){_0xdb4955['push'](_0xdb4955['shift']());}};_0x39daf9(++_0x145b00);}(_0xef12,0xe8));var _0x2ef1=function(_0x99f296,_0xd901b6){_0x99f296=_0x99f296-0x0;var _0x237bf0=_0xef12[_0x99f296];return _0x237bf0;};'use strict';var Sequelize=require(_0x2ef1('0x0'));module[_0x2ef1('0x1')]={'UserId':{'type':Sequelize[_0x2ef1('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x2ef1('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index c5520ae..c7da336 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(_0x14a869,_0x2af958){var _0x45779b=function(_0x2441d8){while(--_0x2441d8){_0x14a869['push'](_0x14a869['shift']());}};_0x45779b(++_0x2af958);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0xdc5897,_0x19b34d){var _0x3a859d=function(_0x344bd9){while(--_0x344bd9){_0xdc5897['push'](_0xdc5897['shift']());}};_0x3a859d(++_0x19b34d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 6266110..2b660f9 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2301bd,_0xdc0686){var _0x27cc09=function(_0x249434){while(--_0x249434){_0x2301bd['push'](_0x2301bd['shift']());}};_0x27cc09(++_0xdc0686);}(_0xe706,0xa3));var _0x6e70=function(_0x224ad0,_0x2482bd){_0x224ad0=_0x224ad0-0x0;var _0x2e04fc=_0xe706[_0x224ad0];return _0x2e04fc;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x426c27,_0x3f295f){var _0x496a1f=function(_0x20d4a9){while(--_0x20d4a9){_0x426c27['push'](_0x426c27['shift']());}};_0x496a1f(++_0x3f295f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1afabf,_0x56fdcc){_0x1afabf=_0x1afabf-0x0;var _0x497ff1=_0xcb91[_0x1afabf];return _0x497ff1;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 5cc22c4..263d74a 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 _0x6439=['sequelize'];(function(_0x1180f5,_0x2a10e1){var _0x12b95a=function(_0x51a209){while(--_0x51a209){_0x1180f5['push'](_0x1180f5['shift']());}};_0x12b95a(++_0x2a10e1);}(_0x6439,0x1ce));var _0x9643=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x6439[_0x11ce46];return _0x368a1e;};'use strict';var Sequelize=require(_0x9643('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x1b9c=['exports','sequelize'];(function(_0x450e47,_0x2b0ba4){var _0x342bc5=function(_0x3708d5){while(--_0x3708d5){_0x450e47['push'](_0x450e47['shift']());}};_0x342bc5(++_0x2b0ba4);}(_0x1b9c,0x1ad));var _0xc1b9=function(_0x3fe87c,_0x437400){_0x3fe87c=_0x3fe87c-0x0;var _0xd9bc3e=_0x1b9c[_0x3fe87c];return _0xd9bc3e;};'use strict';var Sequelize=require(_0xc1b9('0x0'));module[_0xc1b9('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 f6b2fe7..3188ce6 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 _0x4e8c=['bluebird','request-promise','../../config/environment','exports','define','UserVoiceQueue','lodash','../../config/logger','api','moment'];(function(_0x576451,_0x62b2e){var _0x21fb5d=function(_0x567a92){while(--_0x567a92){_0x576451['push'](_0x576451['shift']());}};_0x21fb5d(++_0x62b2e);}(_0x4e8c,0xd8));var _0xc4e8=function(_0x29105c,_0x1dd29f){_0x29105c=_0x29105c-0x0;var _0x16be8d=_0x4e8c[_0x29105c];return _0x16be8d;};'use strict';var _=require(_0xc4e8('0x0'));var util=require('util');var logger=require(_0xc4e8('0x1'))(_0xc4e8('0x2'));var moment=require(_0xc4e8('0x3'));var BPromise=require(_0xc4e8('0x4'));var rp=require(_0xc4e8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc4e8('0x6'));var attributes=require('./userVoiceQueue.attributes');module[_0xc4e8('0x7')]=function(_0x328101,_0x5d52ce){return _0x328101[_0xc4e8('0x8')](_0xc4e8('0x9'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x861d=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','user_has_voice_queues'];(function(_0x2622c2,_0x53a1af){var _0x3325f9=function(_0x10bb23){while(--_0x10bb23){_0x2622c2['push'](_0x2622c2['shift']());}};_0x3325f9(++_0x53a1af);}(_0x861d,0x150));var _0xd861=function(_0x565dfa,_0x5ca74b){_0x565dfa=_0x565dfa-0x0;var _0x3d8102=_0x861d[_0x565dfa];return _0x3d8102;};'use strict';var _=require(_0xd861('0x0'));var util=require(_0xd861('0x1'));var logger=require(_0xd861('0x2'))(_0xd861('0x3'));var moment=require(_0xd861('0x4'));var BPromise=require('bluebird');var rp=require(_0xd861('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd861('0x6'));var config=require(_0xd861('0x7'));var attributes=require(_0xd861('0x8'));module[_0xd861('0x9')]=function(_0x22879f,_0x3b4870){return _0x22879f[_0xd861('0xa')]('UserVoiceQueue',attributes,{'tableName':_0xd861('0xb'),'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 a98916e..0eb19bd 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 _0xb03c=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','lodash','util','bluebird'];(function(_0x6f150c,_0x30a5d5){var _0x5edb6f=function(_0x3e9251){while(--_0x3e9251){_0x6f150c['push'](_0x6f150c['shift']());}};_0x5edb6f(++_0x30a5d5);}(_0xb03c,0x14d));var _0xcb03=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xb03c[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0xcb03('0x0'));var util=require(_0xcb03('0x1'));var moment=require('moment');var BPromise=require(_0xcb03('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb03('0x3'))['db'];var utils=require(_0xcb03('0x4'));var logger=require(_0xcb03('0x5'))(_0xcb03('0x6'));var config=require(_0xcb03('0x7'));var jayson=require(_0xcb03('0x8'));var client=jayson[_0xcb03('0x9')][_0xcb03('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25f6af,_0x2ce234,_0x5a97cf){return new BPromise(function(_0x3b2b00,_0x230521){return client[_0xcb03('0xb')](_0x25f6af,_0x5a97cf)['then'](function(_0x529a01){logger[_0xcb03('0xc')](_0xcb03('0xd'),_0x2ce234,_0xcb03('0xe'));logger[_0xcb03('0xf')](_0xcb03('0x10'),_0x2ce234,'request\x20sent',JSON[_0xcb03('0x11')](_0x529a01));if(_0x529a01['error']){if(_0x529a01['error'][_0xcb03('0x12')]===0x1f4){logger[_0xcb03('0x13')]('UserVoiceQueue,\x20%s,\x20%s',_0x2ce234,_0x529a01['error'][_0xcb03('0x14')]);return _0x230521(_0x529a01[_0xcb03('0x13')][_0xcb03('0x14')]);}logger['error'](_0xcb03('0xd'),_0x2ce234,_0x529a01[_0xcb03('0x13')][_0xcb03('0x14')]);return _0x3b2b00(_0x529a01[_0xcb03('0x13')][_0xcb03('0x14')]);}else{logger[_0xcb03('0xc')](_0xcb03('0xd'),_0x2ce234,_0xcb03('0xe'));_0x3b2b00(_0x529a01['result'][_0xcb03('0x14')]);}})['catch'](function(_0x21bc5a){logger[_0xcb03('0x13')](_0xcb03('0xd'),_0x2ce234,_0x21bc5a);_0x230521(_0x21bc5a);});});} \ No newline at end of file +var _0xccb2=['rpc','../../config/environment','jayson/promise','request','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x109340,_0x376092){var _0x461a3a=function(_0x1c6d05){while(--_0x1c6d05){_0x109340['push'](_0x109340['shift']());}};_0x461a3a(++_0x376092);}(_0xccb2,0xa2));var _0x2ccb=function(_0x547599,_0x279866){_0x547599=_0x547599-0x0;var _0x3506bc=_0xccb2[_0x547599];return _0x3506bc;};'use strict';var _=require(_0x2ccb('0x0'));var util=require('util');var moment=require(_0x2ccb('0x1'));var BPromise=require(_0x2ccb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ccb('0x3'))['db'];var utils=require(_0x2ccb('0x4'));var logger=require(_0x2ccb('0x5'))(_0x2ccb('0x6'));var config=require(_0x2ccb('0x7'));var jayson=require(_0x2ccb('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c9e21,_0xcd6acb,_0x5eab88){return new BPromise(function(_0x1d74b8,_0x366072){return client[_0x2ccb('0x9')](_0x1c9e21,_0x5eab88)['then'](function(_0x3e2759){logger[_0x2ccb('0xa')]('UserVoiceQueue,\x20%s,\x20%s',_0xcd6acb,_0x2ccb('0xb'));logger[_0x2ccb('0xc')](_0x2ccb('0xd'),_0xcd6acb,'request\x20sent',JSON[_0x2ccb('0xe')](_0x3e2759));if(_0x3e2759[_0x2ccb('0xf')]){if(_0x3e2759['error'][_0x2ccb('0x10')]===0x1f4){logger[_0x2ccb('0xf')](_0x2ccb('0x11'),_0xcd6acb,_0x3e2759[_0x2ccb('0xf')]['message']);return _0x366072(_0x3e2759[_0x2ccb('0xf')][_0x2ccb('0x12')]);}logger[_0x2ccb('0xf')](_0x2ccb('0x11'),_0xcd6acb,_0x3e2759[_0x2ccb('0xf')][_0x2ccb('0x12')]);return _0x1d74b8(_0x3e2759['error'][_0x2ccb('0x12')]);}else{logger[_0x2ccb('0xa')](_0x2ccb('0x11'),_0xcd6acb,_0x2ccb('0xb'));_0x1d74b8(_0x3e2759[_0x2ccb('0x13')][_0x2ccb('0x12')]);}})[_0x2ccb('0x14')](function(_0xbb85d6){logger[_0x2ccb('0xf')](_0x2ccb('0x11'),_0xcd6acb,_0xbb85d6);_0x366072(_0xbb85d6);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index db6b875..d3fb27c 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x52deaf,_0x3493a0){var _0x3bb42d=function(_0x28b4b1){while(--_0x28b4b1){_0x52deaf['push'](_0x52deaf['shift']());}};_0x3bb42d(++_0x3493a0);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3726a1,_0xa80e67){var _0x592991=function(_0x10afce){while(--_0x10afce){_0x3726a1['push'](_0x3726a1['shift']());}};_0x592991(++_0xa80e67);}(_0xe706,0xa3));var _0x6e70=function(_0x4d30c0,_0x3a0ae7){_0x4d30c0=_0x4d30c0-0x0;var _0x5b0c2e=_0xe706[_0x4d30c0];return _0x5b0c2e;};'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 9e7fce5..f42a9a2 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 _0x9664=['Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface','sequelize'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x9664,0x126));var _0x4966=function(_0x282ff6,_0x26a577){_0x282ff6=_0x282ff6-0x0;var _0x2d5d60=_0x9664[_0x282ff6];return _0x2d5d60;};'use strict';var Sequelize=require(_0x4966('0x0'));module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x4966('0x1')},'membername':{'type':Sequelize[_0x4966('0x2')],'allowNull':![],'comment':_0x4966('0x1')},'UserId':{'type':Sequelize[_0x4966('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x4966('0x2')],'allowNull':![],'unique':_0x4966('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x4966('0x3')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4966('0x4'),'comment':_0x4966('0x1')},'penalty':{'type':Sequelize[_0x4966('0x3')](0xb),'defaultValue':0x0,'comment':_0x4966('0x1')},'paused':{'type':Sequelize[_0x4966('0x3')](0xb),'defaultValue':0x0,'comment':_0x4966('0x1')}}; \ No newline at end of file +var _0x204b=['STRING','Required\x20by\x20Asterisk','queue_interface','sequelize','exports','INTEGER'];(function(_0x230bb8,_0xa1718){var _0x16cb9a=function(_0x2848fe){while(--_0x2848fe){_0x230bb8['push'](_0x230bb8['shift']());}};_0x16cb9a(++_0xa1718);}(_0x204b,0x6f));var _0xb204=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x204b[_0x5608a3];return _0x1ed50a;};'use strict';var Sequelize=require(_0xb204('0x0'));module[_0xb204('0x1')]={'uniqueid':{'type':Sequelize[_0xb204('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xb204('0x3')],'allowNull':![],'comment':_0xb204('0x4')},'UserId':{'type':Sequelize[_0xb204('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xb204('0x3')],'allowNull':![],'unique':_0xb204('0x5'),'comment':_0xb204('0x4')},'VoiceQueueId':{'type':Sequelize[_0xb204('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb204('0x5'),'comment':_0xb204('0x4')},'penalty':{'type':Sequelize[_0xb204('0x2')](0xb),'defaultValue':0x0,'comment':_0xb204('0x4')},'paused':{'type':Sequelize[_0xb204('0x2')](0xb),'defaultValue':0x0,'comment':_0xb204('0x4')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 5cc1621..2ab4f03 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 _0x93d4=['emit','hasOwnProperty','exports','events','UserVoiceQueueRt','setMaxListeners','save','update','remove'];(function(_0xf2c786,_0xc3d82d){var _0xf52afa=function(_0x3b5f9b){while(--_0x3b5f9b){_0xf2c786['push'](_0xf2c786['shift']());}};_0xf52afa(++_0xc3d82d);}(_0x93d4,0x135));var _0x493d=function(_0x5a8b23,_0x29df6f){_0x5a8b23=_0x5a8b23-0x0;var _0x3ed018=_0x93d4[_0x5a8b23];return _0x3ed018;};'use strict';var EventEmitter=require(_0x493d('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x493d('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x493d('0x2')](0x0);var events={'afterCreate':_0x493d('0x3'),'afterUpdate':_0x493d('0x4'),'afterDestroy':_0x493d('0x5')};function emitEvent(_0x41f2fb){return function(_0x33acb3,_0x11245f,_0x174ff1){UserVoiceQueueRtEvents['emit'](_0x41f2fb+':'+_0x33acb3['id'],_0x33acb3);UserVoiceQueueRtEvents[_0x493d('0x6')](_0x41f2fb,_0x33acb3);_0x174ff1(null);};}for(var e in events){if(events[_0x493d('0x7')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x493d('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x0ebe=['exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x33ff0c,_0x448c2a){var _0x44bdc2=function(_0x4f8652){while(--_0x4f8652){_0x33ff0c['push'](_0x33ff0c['shift']());}};_0x44bdc2(++_0x448c2a);}(_0x0ebe,0x157));var _0xe0eb=function(_0x308557,_0x31eeec){_0x308557=_0x308557-0x0;var _0x3fd626=_0x0ebe[_0x308557];return _0x3fd626;};'use strict';var EventEmitter=require(_0xe0eb('0x0'));var UserVoiceQueueRt=require(_0xe0eb('0x1'))['db'][_0xe0eb('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xe0eb('0x3')](0x0);var events={'afterCreate':_0xe0eb('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2626c1){return function(_0xc4004f,_0x59bd16,_0x34953f){UserVoiceQueueRtEvents[_0xe0eb('0x5')](_0x2626c1+':'+_0xc4004f['id'],_0xc4004f);UserVoiceQueueRtEvents[_0xe0eb('0x5')](_0x2626c1,_0xc4004f);_0x34953f(null);};}for(var e in events){if(events[_0xe0eb('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0xe0eb('0x7')](e,emitEvent(event));}}module[_0xe0eb('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 3ac5f12..916f84b 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 _0x66ff=['api','moment','bluebird','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x66ff,0x107));var _0xf66f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x66ff[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf66f('0x0'))(_0xf66f('0x1'));var moment=require(_0xf66f('0x2'));var BPromise=require(_0xf66f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf66f('0x4'));var rimraf=require(_0xf66f('0x5'));var config=require(_0xf66f('0x6'));var attributes=require(_0xf66f('0x7'));module[_0xf66f('0x8')]=function(_0x96f5b1,_0x15c6a4){return _0x96f5b1[_0xf66f('0x9')](_0xf66f('0xa'),attributes,{'tableName':_0xf66f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x50e7=['request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','moment','bluebird'];(function(_0x11a534,_0x1d9019){var _0x4f0ed8=function(_0x1a07f5){while(--_0x1a07f5){_0x11a534['push'](_0x11a534['shift']());}};_0x4f0ed8(++_0x1d9019);}(_0x50e7,0x8a));var _0x750e=function(_0x6fc5c8,_0x3cf855){_0x6fc5c8=_0x6fc5c8-0x0;var _0x51303a=_0x50e7[_0x6fc5c8];return _0x51303a;};'use strict';var _=require(_0x750e('0x0'));var util=require(_0x750e('0x1'));var logger=require(_0x750e('0x2'))('api');var moment=require(_0x750e('0x3'));var BPromise=require(_0x750e('0x4'));var rp=require(_0x750e('0x5'));var fs=require('fs');var path=require(_0x750e('0x6'));var rimraf=require(_0x750e('0x7'));var config=require(_0x750e('0x8'));var attributes=require(_0x750e('0x9'));module['exports']=function(_0x349559,_0x48fc36){return _0x349559[_0x750e('0xa')](_0x750e('0xb'),attributes,{'tableName':_0x750e('0xc'),'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 ec41b9a..774f596 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 _0x7305=['catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x40579e,_0x1f4bcc){var _0x406aee=function(_0x149f47){while(--_0x149f47){_0x40579e['push'](_0x40579e['shift']());}};_0x406aee(++_0x1f4bcc);}(_0x7305,0x16a));var _0x5730=function(_0x1e280d,_0x57d661){_0x1e280d=_0x1e280d-0x0;var _0x1de867=_0x7305[_0x1e280d];return _0x1de867;};'use strict';var _=require('lodash');var util=require(_0x5730('0x0'));var moment=require(_0x5730('0x1'));var BPromise=require(_0x5730('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5730('0x3'));var db=require(_0x5730('0x4'))['db'];var utils=require(_0x5730('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x5730('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5730('0x7')][_0x5730('0x8')]({'port':0x232a});config[_0x5730('0x9')]=_['defaults'](config[_0x5730('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x5730('0xa'))(new Redis(config[_0x5730('0x9')]));require(_0x5730('0xb'))[_0x5730('0xc')](socket);function respondWithRpcPromise(_0x1bd206,_0x2290cd,_0x3d7ada){return new BPromise(function(_0x244a31,_0x5cff06){return client['request'](_0x1bd206,_0x3d7ada)[_0x5730('0xd')](function(_0x2c1014){logger[_0x5730('0xe')](_0x5730('0xf'),_0x2290cd,_0x5730('0x10'));logger[_0x5730('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x2290cd,_0x5730('0x10'),JSON[_0x5730('0x12')](_0x2c1014));if(_0x2c1014[_0x5730('0x13')]){if(_0x2c1014['error']['code']===0x1f4){logger[_0x5730('0x13')](_0x5730('0xf'),_0x2290cd,_0x2c1014[_0x5730('0x13')]['message']);return _0x5cff06(_0x2c1014[_0x5730('0x13')][_0x5730('0x14')]);}logger[_0x5730('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2290cd,_0x2c1014['error'][_0x5730('0x14')]);return _0x244a31(_0x2c1014['error']['message']);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x2290cd,'request\x20sent');_0x244a31(_0x2c1014[_0x5730('0x15')][_0x5730('0x14')]);}})[_0x5730('0x16')](function(_0x106cb0){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x2290cd,_0x106cb0);_0x5cff06(_0x106cb0);});});}exports[_0x5730('0x17')]=function(_0x24fed8){var _0x3f9840=this;return new Promise(function(_0x54cc08,_0x4ee6ae){return db[_0x5730('0x18')][_0x5730('0x19')]({'raw':_0x24fed8[_0x5730('0x1a')]?_0x24fed8[_0x5730('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24fed8[_0x5730('0x1a')]?_0x24fed8[_0x5730('0x1a')][_0x5730('0x1b')]||null:null,'attributes':[[db[_0x5730('0x1c')]['fn']('COUNT',db[_0x5730('0x1c')]['fn']('IF',db[_0x5730('0x1c')][_0x5730('0x1d')](_0x5730('0x1e')))),_0x5730('0x1f')]]})[_0x5730('0xd')](function(_0x1b68c5){logger['info'](_0x5730('0x17'),_0x24fed8);logger[_0x5730('0x11')](_0x5730('0x17'),_0x24fed8,JSON[_0x5730('0x12')](_0x1b68c5));_0x54cc08(_0x1b68c5);})[_0x5730('0x16')](function(_0x36d5bc){logger[_0x5730('0x13')]('GetVoiceQueueRtPauses',_0x36d5bc[_0x5730('0x14')],_0x24fed8);_0x4ee6ae(_0x3f9840[_0x5730('0x13')](0x1f4,_0x36d5bc[_0x5730('0x14')]));});});}; \ No newline at end of file +var _0xfcc2=['request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','util','bluebird','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s'];(function(_0x1d36d1,_0x41d0ab){var _0x10d430=function(_0x4db227){while(--_0x4db227){_0x1d36d1['push'](_0x1d36d1['shift']());}};_0x10d430(++_0x41d0ab);}(_0xfcc2,0x131));var _0x2fcc=function(_0x3beea0,_0x416691){_0x3beea0=_0x3beea0-0x0;var _0x314eb1=_0xfcc2[_0x3beea0];return _0x314eb1;};'use strict';var _=require('lodash');var util=require(_0x2fcc('0x0'));var moment=require('moment');var BPromise=require(_0x2fcc('0x1'));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(_0x2fcc('0x2'))('rpc');var config=require(_0x2fcc('0x3'));var jayson=require(_0x2fcc('0x4'));var client=jayson[_0x2fcc('0x5')]['http']({'port':0x232a});config[_0x2fcc('0x6')]=_['defaults'](config['redis'],{'host':_0x2fcc('0x7'),'port':0x18eb});var socket=require(_0x2fcc('0x8'))(new Redis(config['redis']));require(_0x2fcc('0x9'))[_0x2fcc('0xa')](socket);function respondWithRpcPromise(_0x4fdf79,_0x41adb1,_0x227216){return new BPromise(function(_0x36a617,_0x43494e){return client[_0x2fcc('0xb')](_0x4fdf79,_0x227216)[_0x2fcc('0xc')](function(_0x3050cb){logger[_0x2fcc('0xd')](_0x2fcc('0xe'),_0x41adb1,_0x2fcc('0xf'));logger[_0x2fcc('0x10')](_0x2fcc('0x11'),_0x41adb1,_0x2fcc('0xf'),JSON[_0x2fcc('0x12')](_0x3050cb));if(_0x3050cb[_0x2fcc('0x13')]){if(_0x3050cb[_0x2fcc('0x13')][_0x2fcc('0x14')]===0x1f4){logger[_0x2fcc('0x13')](_0x2fcc('0xe'),_0x41adb1,_0x3050cb[_0x2fcc('0x13')][_0x2fcc('0x15')]);return _0x43494e(_0x3050cb[_0x2fcc('0x13')][_0x2fcc('0x15')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x41adb1,_0x3050cb['error'][_0x2fcc('0x15')]);return _0x36a617(_0x3050cb['error']['message']);}else{logger[_0x2fcc('0xd')](_0x2fcc('0xe'),_0x41adb1,_0x2fcc('0xf'));_0x36a617(_0x3050cb[_0x2fcc('0x16')][_0x2fcc('0x15')]);}})[_0x2fcc('0x17')](function(_0x2c1034){logger[_0x2fcc('0x13')](_0x2fcc('0xe'),_0x41adb1,_0x2c1034);_0x43494e(_0x2c1034);});});}exports['GetVoiceQueueRtPauses']=function(_0x3bf61c){var _0x403dcd=this;return new Promise(function(_0x426175,_0x215392){return db['UserVoiceQueueRt'][_0x2fcc('0x18')]({'raw':_0x3bf61c['options']?_0x3bf61c[_0x2fcc('0x19')][_0x2fcc('0x1a')]===undefined?!![]:![]:!![],'where':_0x3bf61c[_0x2fcc('0x19')]?_0x3bf61c['options']['where']||null:null,'attributes':[[db[_0x2fcc('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x2fcc('0x1c')](_0x2fcc('0x1d')))),_0x2fcc('0x1e')]]})[_0x2fcc('0xc')](function(_0x4a91aa){logger[_0x2fcc('0xd')](_0x2fcc('0x1f'),_0x3bf61c);logger[_0x2fcc('0x10')](_0x2fcc('0x1f'),_0x3bf61c,JSON['stringify'](_0x4a91aa));_0x426175(_0x4a91aa);})[_0x2fcc('0x17')](function(_0x25685d){logger[_0x2fcc('0x13')]('GetVoiceQueueRtPauses',_0x25685d['message'],_0x3bf61c);_0x215392(_0x403dcd['error'](0x1f4,_0x25685d[_0x2fcc('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 6741638..8451a75 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 _0x7409=['update','emit','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x15781b,_0x4db9bb){var _0x20f955=function(_0x636ad0){while(--_0x636ad0){_0x15781b['push'](_0x15781b['shift']());}};_0x20f955(++_0x4db9bb);}(_0x7409,0x6e));var _0x9740=function(_0x2bd6d9,_0x2071cb){_0x2bd6d9=_0x2bd6d9-0x0;var _0x4b4929=_0x7409[_0x2bd6d9];return _0x4b4929;};'use strict';var UserVoiceQueueRtEvents=require(_0x9740('0x0'));var events=[_0x9740('0x1'),'remove',_0x9740('0x2')];function createListener(_0xafb57,_0x266af6){return function(_0x437957){_0x266af6[_0x9740('0x3')](_0xafb57,_0x437957);};}function removeListener(_0x2c15f1,_0xf40233){return function(){UserVoiceQueueRtEvents[_0x9740('0x4')](_0x2c15f1,_0xf40233);};}exports[_0x9740('0x5')]=function(_0x547490){for(var _0x19865c=0x0,_0x96d19c=events[_0x9740('0x6')];_0x19865c<_0x96d19c;_0x19865c++){var _0x529edf=events[_0x19865c];var _0x279226=createListener(_0x9740('0x7')+_0x529edf,_0x547490);UserVoiceQueueRtEvents['on'](_0x529edf,_0x279226);}}; \ No newline at end of file +var _0xe548=['removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update'];(function(_0x11fc47,_0x370085){var _0x55b4dc=function(_0x5cfa1f){while(--_0x5cfa1f){_0x11fc47['push'](_0x11fc47['shift']());}};_0x55b4dc(++_0x370085);}(_0xe548,0x184));var _0x8e54=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0xe548[_0x47e549];return _0x251374;};'use strict';var UserVoiceQueueRtEvents=require(_0x8e54('0x0'));var events=[_0x8e54('0x1'),_0x8e54('0x2'),_0x8e54('0x3')];function createListener(_0x8824f6,_0x48a491){return function(_0x5d61b0){_0x48a491['emit'](_0x8824f6,_0x5d61b0);};}function removeListener(_0x4aa36a,_0x4b69ef){return function(){UserVoiceQueueRtEvents[_0x8e54('0x4')](_0x4aa36a,_0x4b69ef);};}exports['register']=function(_0x288be8){for(var _0x47a58d=0x0,_0xc6281c=events[_0x8e54('0x5')];_0x47a58d<_0xc6281c;_0x47a58d++){var _0x148c1f=events[_0x47a58d];var _0x3d6444=createListener(_0x8e54('0x6')+_0x148c1f,_0x288be8);UserVoiceQueueRtEvents['on'](_0x148c1f,_0x3d6444);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 4b12073..ea35ec2 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x340d91,_0x950fe3){var _0x58d6ef=function(_0x5ed866){while(--_0x5ed866){_0x340d91['push'](_0x340d91['shift']());}};_0x58d6ef(++_0x950fe3);}(_0x70e0,0x17b));var _0x070e=function(_0xd6df9,_0x1193b6){_0xd6df9=_0xd6df9-0x0;var _0x1066ef=_0x70e0[_0xd6df9];return _0x1066ef;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3ff356,_0x3d6276){var _0x5cbcc7=function(_0x5a3e0d){while(--_0x5a3e0d){_0x3ff356['push'](_0x3ff356['shift']());}};_0x5cbcc7(++_0x3d6276);}(_0xe706,0xa3));var _0x6e70=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0xe706[_0x37cc52];return _0x2b4a90;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 7d9c39c..35695df 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 _0x6506=['sequelize'];(function(_0x598dcc,_0x1ca55d){var _0x546548=function(_0x4b0085){while(--_0x4b0085){_0x598dcc['push'](_0x598dcc['shift']());}};_0x546548(++_0x1ca55d);}(_0x6506,0xbc));var _0x6650=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x6506[_0x87b0ff];return _0x3bc0b2;};'use strict';var Sequelize=require(_0x6650('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x79a8=['sequelize','INTEGER'];(function(_0x15238c,_0x10558a){var _0x1daacf=function(_0x176013){while(--_0x176013){_0x15238c['push'](_0x15238c['shift']());}};_0x1daacf(++_0x10558a);}(_0x79a8,0x1d0));var _0x879a=function(_0x1cb783,_0x197145){_0x1cb783=_0x1cb783-0x0;var _0x4fae14=_0x79a8[_0x1cb783];return _0x4fae14;};'use strict';var Sequelize=require(_0x879a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x879a('0x1')],'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 eb77b9f..aa57d91 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 _0xe8be=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userWhatsappQueue.attributes','define','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x4f1f41,_0x3c411c){var _0x2ca902=function(_0x4b5af5){while(--_0x4b5af5){_0x4f1f41['push'](_0x4f1f41['shift']());}};_0x2ca902(++_0x3c411c);}(_0xe8be,0x111));var _0xee8b=function(_0x533132,_0xf5b6fa){_0x533132=_0x533132-0x0;var _0x1a7447=_0xe8be[_0x533132];return _0x1a7447;};'use strict';var _=require(_0xee8b('0x0'));var util=require(_0xee8b('0x1'));var logger=require(_0xee8b('0x2'))(_0xee8b('0x3'));var moment=require(_0xee8b('0x4'));var BPromise=require(_0xee8b('0x5'));var rp=require(_0xee8b('0x6'));var fs=require('fs');var path=require(_0xee8b('0x7'));var rimraf=require('rimraf');var config=require(_0xee8b('0x8'));var attributes=require(_0xee8b('0x9'));module['exports']=function(_0x5b2de3,_0x5564ad){return _0x5b2de3[_0xee8b('0xa')](_0xee8b('0xb'),attributes,{'tableName':_0xee8b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6b8=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','define','UserWhatsappQueue','user_has_whatsapp_queues','util','../../config/logger'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xe6b8,0x1d2));var _0x8e6b=function(_0xe823f,_0x339dd5){_0xe823f=_0xe823f-0x0;var _0x192e57=_0xe6b8[_0xe823f];return _0x192e57;};'use strict';var _=require('lodash');var util=require(_0x8e6b('0x0'));var logger=require(_0x8e6b('0x1'))(_0x8e6b('0x2'));var moment=require(_0x8e6b('0x3'));var BPromise=require(_0x8e6b('0x4'));var rp=require(_0x8e6b('0x5'));var fs=require('fs');var path=require(_0x8e6b('0x6'));var rimraf=require(_0x8e6b('0x7'));var config=require(_0x8e6b('0x8'));var attributes=require(_0x8e6b('0x9'));module['exports']=function(_0x50da5c,_0x468585){return _0x50da5c[_0x8e6b('0xa')](_0x8e6b('0xb'),attributes,{'tableName':_0x8e6b('0xc'),'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 0f781bf..b8b7aa8 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 _0x26d2=['catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','UserWhatsappQueue,\x20%s,\x20%s','result'];(function(_0x132222,_0x3d42c1){var _0x52c8f5=function(_0x355a69){while(--_0x355a69){_0x132222['push'](_0x132222['shift']());}};_0x52c8f5(++_0x3d42c1);}(_0x26d2,0x119));var _0x226d=function(_0x4d7a70,_0x2d3bfa){_0x4d7a70=_0x4d7a70-0x0;var _0x3aafbb=_0x26d2[_0x4d7a70];return _0x3aafbb;};'use strict';var _=require('lodash');var util=require(_0x226d('0x0'));var moment=require('moment');var BPromise=require(_0x226d('0x1'));var rs=require(_0x226d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x226d('0x3'))['db'];var utils=require(_0x226d('0x4'));var logger=require(_0x226d('0x5'))(_0x226d('0x6'));var config=require(_0x226d('0x7'));var jayson=require(_0x226d('0x8'));var client=jayson[_0x226d('0x9')][_0x226d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56ef2a,_0x18ef8c,_0x56b23b){return new BPromise(function(_0x2dbab3,_0x54ba4d){return client['request'](_0x56ef2a,_0x56b23b)['then'](function(_0x1a7854){logger[_0x226d('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x18ef8c,_0x226d('0xc'));logger[_0x226d('0xd')](_0x226d('0xe'),_0x18ef8c,_0x226d('0xc'),JSON['stringify'](_0x1a7854));if(_0x1a7854[_0x226d('0xf')]){if(_0x1a7854[_0x226d('0xf')]['code']===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x18ef8c,_0x1a7854[_0x226d('0xf')][_0x226d('0x10')]);return _0x54ba4d(_0x1a7854[_0x226d('0xf')][_0x226d('0x10')]);}logger[_0x226d('0xf')](_0x226d('0x11'),_0x18ef8c,_0x1a7854[_0x226d('0xf')][_0x226d('0x10')]);return _0x2dbab3(_0x1a7854[_0x226d('0xf')][_0x226d('0x10')]);}else{logger[_0x226d('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x18ef8c,_0x226d('0xc'));_0x2dbab3(_0x1a7854[_0x226d('0x12')][_0x226d('0x10')]);}})[_0x226d('0x13')](function(_0x3ab130){logger[_0x226d('0xf')](_0x226d('0x11'),_0x18ef8c,_0x3ab130);_0x54ba4d(_0x3ab130);});});} \ No newline at end of file +var _0x5fc1=['code','UserWhatsappQueue,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x49ca8f,_0xa20902){var _0x3dc6f5=function(_0x3ef96e){while(--_0x3ef96e){_0x49ca8f['push'](_0x49ca8f['shift']());}};_0x3dc6f5(++_0xa20902);}(_0x5fc1,0x17e));var _0x15fc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5fc1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x15fc('0x0'));var util=require('util');var moment=require(_0x15fc('0x1'));var BPromise=require(_0x15fc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x15fc('0x3'))['db'];var utils=require(_0x15fc('0x4'));var logger=require(_0x15fc('0x5'))(_0x15fc('0x6'));var config=require(_0x15fc('0x7'));var jayson=require(_0x15fc('0x8'));var client=jayson['client'][_0x15fc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x526028,_0x4ae268,_0x7c9879){return new BPromise(function(_0x1fb388,_0x1112f0){return client['request'](_0x526028,_0x7c9879)[_0x15fc('0xa')](function(_0x5f972a){logger[_0x15fc('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4ae268,_0x15fc('0xc'));logger[_0x15fc('0xd')](_0x15fc('0xe'),_0x4ae268,_0x15fc('0xc'),JSON[_0x15fc('0xf')](_0x5f972a));if(_0x5f972a[_0x15fc('0x10')]){if(_0x5f972a['error'][_0x15fc('0x11')]===0x1f4){logger[_0x15fc('0x10')](_0x15fc('0x12'),_0x4ae268,_0x5f972a[_0x15fc('0x10')][_0x15fc('0x13')]);return _0x1112f0(_0x5f972a[_0x15fc('0x10')][_0x15fc('0x13')]);}logger[_0x15fc('0x10')](_0x15fc('0x12'),_0x4ae268,_0x5f972a[_0x15fc('0x10')][_0x15fc('0x13')]);return _0x1fb388(_0x5f972a[_0x15fc('0x10')][_0x15fc('0x13')]);}else{logger['info'](_0x15fc('0x12'),_0x4ae268,_0x15fc('0xc'));_0x1fb388(_0x5f972a['result'][_0x15fc('0x13')]);}})[_0x15fc('0x14')](function(_0x11fedc){logger[_0x15fc('0x10')](_0x15fc('0x12'),_0x4ae268,_0x11fedc);_0x1112f0(_0x11fedc);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index f7874b0..60b34be 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 _0x0b40=['put','update','delete','/:id','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create'];(function(_0x4cdecc,_0x501c72){var _0x3557cf=function(_0x50bb6b){while(--_0x50bb6b){_0x4cdecc['push'](_0x4cdecc['shift']());}};_0x3557cf(++_0x501c72);}(_0x0b40,0xba));var _0x00b4=function(_0xa30766,_0x6f613e){_0xa30766=_0xa30766-0x0;var _0x24e780=_0x0b40[_0xa30766];return _0x24e780;};'use strict';var multer=require('multer');var util=require(_0x00b4('0x0'));var path=require(_0x00b4('0x1'));var timeout=require('connect-timeout');var express=require(_0x00b4('0x2'));var router=express[_0x00b4('0x3')]();var fs_extra=require(_0x00b4('0x4'));var auth=require(_0x00b4('0x5'));var interaction=require(_0x00b4('0x6'));var config=require(_0x00b4('0x7'));var controller=require('./variable.controller');router[_0x00b4('0x8')]('/',auth[_0x00b4('0x9')](),controller[_0x00b4('0xa')]);router[_0x00b4('0x8')]('/:id',auth[_0x00b4('0x9')](),controller[_0x00b4('0xb')]);router[_0x00b4('0xc')]('/',auth['isAuthenticated'](),controller[_0x00b4('0xd')]);router[_0x00b4('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x00b4('0xf')]);router[_0x00b4('0x10')](_0x00b4('0x11'),auth[_0x00b4('0x9')](),controller[_0x00b4('0x12')]);module[_0x00b4('0x13')]=router; \ No newline at end of file +var _0x9ffd=['isAuthenticated','get','/:id','show','post','create','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x462582,_0x279982){var _0x176aac=function(_0xc93667){while(--_0xc93667){_0x462582['push'](_0x462582['shift']());}};_0x176aac(++_0x279982);}(_0x9ffd,0x1d7));var _0xd9ff=function(_0x3ac567,_0x11009f){_0x3ac567=_0x3ac567-0x0;var _0x36e6f1=_0x9ffd[_0x3ac567];return _0x36e6f1;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require(_0xd9ff('0x3'));var express=require('express');var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var controller=require('./variable.controller');router['get']('/',auth[_0xd9ff('0x9')](),controller['index']);router[_0xd9ff('0xa')](_0xd9ff('0xb'),auth['isAuthenticated'](),controller[_0xd9ff('0xc')]);router[_0xd9ff('0xd')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xe')]);router['put'](_0xd9ff('0xb'),auth[_0xd9ff('0x9')](),controller['update']);router[_0xd9ff('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 87b3f34..93f5a3f 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 _0x61d7=['exports','STRING','name'];(function(_0x2c32c3,_0x2dbbbb){var _0x41d0bc=function(_0x18a6a4){while(--_0x18a6a4){_0x2c32c3['push'](_0x2c32c3['shift']());}};_0x41d0bc(++_0x2dbbbb);}(_0x61d7,0x1dd));var _0x761d=function(_0x1f6e87,_0x4a92b9){_0x1f6e87=_0x1f6e87-0x0;var _0x59352e=_0x61d7[_0x1f6e87];return _0x59352e;};'use strict';var Sequelize=require('sequelize');module[_0x761d('0x0')]={'name':{'type':Sequelize[_0x761d('0x1')],'unique':_0x761d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x761d('0x1')]}}; \ No newline at end of file +var _0x59ad=['STRING','name','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x59ad,0xee));var _0xd59a=function(_0x5cc0ab,_0x1e3097){_0x5cc0ab=_0x5cc0ab-0x0;var _0x5de250=_0x59ad[_0x5cc0ab];return _0x5de250;};'use strict';var Sequelize=require(_0xd59a('0x0'));module[_0xd59a('0x1')]={'name':{'type':Sequelize[_0xd59a('0x2')],'unique':_0xd59a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd59a('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 3adfcb8..1b735c9 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 _0x238a=['name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','body','user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','get','Variables','UserProfileResource','end','error','stack'];(function(_0x374236,_0x544109){var _0x1d688c=function(_0x1f2626){while(--_0x1f2626){_0x374236['push'](_0x374236['shift']());}};_0x1d688c(++_0x544109);}(_0x238a,0x80));var _0xa238=function(_0x35e75a,_0x5ed225){_0x35e75a=_0x35e75a-0x0;var _0xb23c7f=_0x238a[_0x35e75a];return _0xb23c7f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa238('0x0'));var jsonpatch=require(_0xa238('0x1'));var rp=require(_0xa238('0x2'));var moment=require(_0xa238('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa238('0x4'));var util=require('util');var path=require(_0xa238('0x5'));var sox=require('sox');var csv=require(_0xa238('0x6'));var ejs=require(_0xa238('0x7'));var fs=require('fs');var fs_extra=require(_0xa238('0x8'));var _=require(_0xa238('0x9'));var squel=require(_0xa238('0xa'));var crypto=require(_0xa238('0xb'));var jsforce=require(_0xa238('0xc'));var deskjs=require(_0xa238('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa238('0xe'));var Papa=require(_0xa238('0xf'));var Redis=require('ioredis');var authService=require(_0xa238('0x10'));var qs=require(_0xa238('0x11'));var as=require(_0xa238('0x12'));var hardwareService=require(_0xa238('0x13'));var logger=require(_0xa238('0x14'))('api');var utils=require(_0xa238('0x15'));var config=require(_0xa238('0x16'));var licenseUtil=require(_0xa238('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c83b8,_0x30ec71){_0x30ec71=_0x30ec71||0xcc;return function(_0x216a66){if(_0x216a66){return _0x5c83b8[_0xa238('0x18')](_0x30ec71);}return _0x5c83b8['status'](_0x30ec71)['end']();};}function respondWithResult(_0x546258,_0x447602){_0x447602=_0x447602||0xc8;return function(_0x508d8d){if(_0x508d8d){return _0x546258[_0xa238('0x19')](_0x447602)['json'](_0x508d8d);}};}function respondWithFilteredResult(_0x12812d,_0x1175e9){return function(_0x2c11c7){if(_0x2c11c7){var _0x3be97e=typeof _0x1175e9['offset']===_0xa238('0x1a')&&typeof _0x1175e9[_0xa238('0x1b')]===_0xa238('0x1a');var _0x2637c2=_0x2c11c7[_0xa238('0x1c')];var _0x2ddca5=_0x3be97e?0x0:_0x1175e9[_0xa238('0x1d')];var _0x4a567e=_0x3be97e?_0x2c11c7[_0xa238('0x1c')]:_0x1175e9[_0xa238('0x1d')]+_0x1175e9[_0xa238('0x1b')];var _0x33506f;if(_0x4a567e>=_0x2637c2){_0x4a567e=_0x2637c2;_0x33506f=0xc8;}else{_0x33506f=0xce;}_0x12812d[_0xa238('0x19')](_0x33506f);return _0x12812d[_0xa238('0x1e')](_0xa238('0x1f'),_0x2ddca5+'-'+_0x4a567e+'/'+_0x2637c2)[_0xa238('0x20')](_0x2c11c7);}return null;};}function patchUpdates(_0x3b1c7a){return function(_0x56fd1e){try{jsonpatch[_0xa238('0x21')](_0x56fd1e,_0x3b1c7a,!![]);}catch(_0x4a6aa6){return BPromise['reject'](_0x4a6aa6);}return _0x56fd1e[_0xa238('0x22')]();};}function saveUpdates(_0x378935,_0x335367){return function(_0x4286ce){if(_0x4286ce){return _0x4286ce[_0xa238('0x23')](_0x378935)[_0xa238('0x24')](function(_0x4870c5){return _0x4870c5;});}return null;};}function removeEntity(_0x177ab5,_0x2c7804){return function(_0x3bcbcb){if(_0x3bcbcb){return _0x3bcbcb[_0xa238('0x25')]()['then'](function(){var _0x34b0a9=_0x3bcbcb[_0xa238('0x26')]({'plain':!![]});var _0x1f6915=_0xa238('0x27');return db[_0xa238('0x28')]['destroy']({'where':{'type':_0x1f6915,'resourceId':_0x34b0a9['id']}})[_0xa238('0x24')](function(){return _0x3bcbcb;});})['then'](function(){_0x177ab5['status'](0xcc)[_0xa238('0x29')]();});}};}function handleEntityNotFound(_0x4f1960,_0x492b2a){return function(_0x65d9ba){if(!_0x65d9ba){_0x4f1960['sendStatus'](0x194);}return _0x65d9ba;};}function handleError(_0x2950c8,_0x5bb97a){_0x5bb97a=_0x5bb97a||0x1f4;return function(_0x4933c2){logger[_0xa238('0x2a')](_0x4933c2[_0xa238('0x2b')]);if(_0x4933c2['name']){delete _0x4933c2[_0xa238('0x2c')];}_0x2950c8[_0xa238('0x19')](_0x5bb97a)[_0xa238('0x2d')](_0x4933c2);};}exports[_0xa238('0x2e')]=function(_0x13e5c3,_0x8c997){var _0x2feb3d={},_0x540fd4={},_0x32f15a={'count':0x0,'rows':[]};var _0x2af636=_[_0xa238('0x2f')](db[_0xa238('0x30')][_0xa238('0x31')],function(_0x3159dd){return{'name':_0x3159dd[_0xa238('0x32')],'type':_0x3159dd[_0xa238('0x33')][_0xa238('0x34')]};});_0x540fd4[_0xa238('0x35')]=_[_0xa238('0x2f')](_0x2af636,_0xa238('0x2c'));_0x540fd4[_0xa238('0x36')]=_[_0xa238('0x37')](_0x13e5c3[_0xa238('0x36')]);_0x540fd4[_0xa238('0x38')]=_['intersection'](_0x540fd4['model'],_0x540fd4[_0xa238('0x36')]);_0x2feb3d[_0xa238('0x39')]=_[_0xa238('0x3a')](_0x540fd4[_0xa238('0x35')],qs[_0xa238('0x3b')](_0x13e5c3[_0xa238('0x36')]['fields']));_0x2feb3d[_0xa238('0x39')]=_0x2feb3d[_0xa238('0x39')][_0xa238('0x3c')]?_0x2feb3d['attributes']:_0x540fd4['model'];if(!_0x13e5c3['query'][_0xa238('0x3d')](_0xa238('0x3e'))){_0x2feb3d[_0xa238('0x1b')]=qs[_0xa238('0x1b')](_0x13e5c3[_0xa238('0x36')][_0xa238('0x1b')]);_0x2feb3d['offset']=qs[_0xa238('0x1d')](_0x13e5c3[_0xa238('0x36')]['offset']);}_0x2feb3d[_0xa238('0x3f')]=qs[_0xa238('0x40')](_0x13e5c3[_0xa238('0x36')][_0xa238('0x40')]);_0x2feb3d[_0xa238('0x41')]=qs[_0xa238('0x38')](_[_0xa238('0x42')](_0x13e5c3['query'],_0x540fd4['filters']),_0x2af636);if(_0x13e5c3[_0xa238('0x36')][_0xa238('0x43')]){_0x2feb3d[_0xa238('0x41')]=_[_0xa238('0x44')](_0x2feb3d[_0xa238('0x41')],{'$or':_[_0xa238('0x2f')](_0x2af636,function(_0x176e53){if(_0x176e53[_0xa238('0x33')]!==_0xa238('0x45')){var _0x1420ae={};_0x1420ae[_0x176e53[_0xa238('0x2c')]]={'$like':'%'+_0x13e5c3[_0xa238('0x36')][_0xa238('0x43')]+'%'};return _0x1420ae;}})});}_0x2feb3d=_[_0xa238('0x44')]({},_0x2feb3d,_0x13e5c3[_0xa238('0x46')]);var _0x83b9a2={'where':_0x2feb3d['where']};return db[_0xa238('0x30')][_0xa238('0x1c')](_0x83b9a2)[_0xa238('0x24')](function(_0x315cfa){_0x32f15a['count']=_0x315cfa;if(_0x13e5c3[_0xa238('0x36')]['includeAll']){_0x2feb3d[_0xa238('0x47')]=[{'all':!![]}];}return db[_0xa238('0x30')][_0xa238('0x48')](_0x2feb3d);})[_0xa238('0x24')](function(_0x39e90d){_0x32f15a[_0xa238('0x49')]=_0x39e90d;return _0x32f15a;})[_0xa238('0x24')](respondWithFilteredResult(_0x8c997,_0x2feb3d))[_0xa238('0x4a')](handleError(_0x8c997,null));};exports[_0xa238('0x4b')]=function(_0x4894cf,_0x35be06){var _0x2f1434={'raw':!![],'where':{'id':_0x4894cf[_0xa238('0x4c')]['id']}},_0x499aaa={};_0x499aaa[_0xa238('0x35')]=_[_0xa238('0x37')](db[_0xa238('0x30')][_0xa238('0x31')]);_0x499aaa[_0xa238('0x36')]=_[_0xa238('0x37')](_0x4894cf['query']);_0x499aaa[_0xa238('0x38')]=_[_0xa238('0x3a')](_0x499aaa[_0xa238('0x35')],_0x499aaa['query']);_0x2f1434[_0xa238('0x39')]=_['intersection'](_0x499aaa[_0xa238('0x35')],qs[_0xa238('0x3b')](_0x4894cf[_0xa238('0x36')][_0xa238('0x3b')]));_0x2f1434[_0xa238('0x39')]=_0x2f1434[_0xa238('0x39')][_0xa238('0x3c')]?_0x2f1434[_0xa238('0x39')]:_0x499aaa[_0xa238('0x35')];if(_0x4894cf[_0xa238('0x36')][_0xa238('0x4d')]){_0x2f1434[_0xa238('0x47')]=[{'all':!![]}];}_0x2f1434=_['merge']({},_0x2f1434,_0x4894cf[_0xa238('0x46')]);return db[_0xa238('0x30')]['find'](_0x2f1434)[_0xa238('0x24')](handleEntityNotFound(_0x35be06,null))[_0xa238('0x24')](respondWithResult(_0x35be06,null))['catch'](handleError(_0x35be06,null));};exports[_0xa238('0x4e')]=function(_0x12537a,_0x2d3309){return db[_0xa238('0x30')]['create'](_0x12537a[_0xa238('0x4f')],{})[_0xa238('0x24')](function(_0x33fdf0){var _0xf0b63a=_0x12537a[_0xa238('0x50')][_0xa238('0x26')]({'plain':!![]});if(!_0xf0b63a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf0b63a[_0xa238('0x51')]===_0xa238('0x50')){var _0x3c7e85=_0x33fdf0[_0xa238('0x26')]({'plain':!![]});var _0x188af3=_0xa238('0x27');return db['UserProfileSection'][_0xa238('0x52')]({'where':{'name':_0x188af3,'userProfileId':_0xf0b63a[_0xa238('0x53')]},'raw':!![]})[_0xa238('0x24')](function(_0x149318){if(_0x149318&&_0x149318[_0xa238('0x54')]===0x0){return db[_0xa238('0x28')][_0xa238('0x4e')]({'name':_0x3c7e85[_0xa238('0x2c')],'resourceId':_0x3c7e85['id'],'type':_0x149318['name'],'sectionId':_0x149318['id']},{})[_0xa238('0x24')](function(){return _0x33fdf0;});}else{return _0x33fdf0;}})[_0xa238('0x4a')](function(_0x6f948b){logger[_0xa238('0x2a')](_0xa238('0x55'),_0x6f948b);throw _0x6f948b;});}return _0x33fdf0;})[_0xa238('0x24')](respondWithResult(_0x2d3309,0xc9))['catch'](handleError(_0x2d3309,null));};exports[_0xa238('0x23')]=function(_0x44343c,_0x44fe59){if(_0x44343c[_0xa238('0x4f')]['id']){delete _0x44343c['body']['id'];}return db[_0xa238('0x30')][_0xa238('0x52')]({'where':{'id':_0x44343c['params']['id']}})[_0xa238('0x24')](handleEntityNotFound(_0x44fe59,null))[_0xa238('0x24')](saveUpdates(_0x44343c[_0xa238('0x4f')],null))[_0xa238('0x24')](respondWithResult(_0x44fe59,null))[_0xa238('0x4a')](handleError(_0x44fe59,null));};exports[_0xa238('0x25')]=function(_0x129337,_0x10e233){return db['Variable'][_0xa238('0x52')]({'where':{'id':_0x129337['params']['id']}})[_0xa238('0x24')](handleEntityNotFound(_0x10e233,null))[_0xa238('0x24')](removeEntity(_0x10e233,null))[_0xa238('0x4a')](handleError(_0x10e233,null));}; \ No newline at end of file +var _0xa7c4=['include','findAll','rows','params','model','rawAttributes','length','includeAll','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','end','sendStatus','stack','name','send','map','Variable','type','key','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','pick','where','merge','VIRTUAL','filter','options'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xa7c4,0x1e5));var _0x4a7c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa7c4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4a7c('0x0'));var zipdir=require(_0x4a7c('0x1'));var jsonpatch=require(_0x4a7c('0x2'));var rp=require(_0x4a7c('0x3'));var moment=require(_0x4a7c('0x4'));var BPromise=require(_0x4a7c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4a7c('0x6'));var sox=require('sox');var csv=require(_0x4a7c('0x7'));var ejs=require(_0x4a7c('0x8'));var fs=require('fs');var fs_extra=require(_0x4a7c('0x9'));var _=require(_0x4a7c('0xa'));var squel=require(_0x4a7c('0xb'));var crypto=require(_0x4a7c('0xc'));var jsforce=require(_0x4a7c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4a7c('0xe'));var Redis=require(_0x4a7c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4a7c('0x10'));var as=require(_0x4a7c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x4a7c('0x12'));var config=require(_0x4a7c('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf46d1c,_0x4f9a0d){_0x4f9a0d=_0x4f9a0d||0xcc;return function(_0x43c57c){if(_0x43c57c){return _0xf46d1c['sendStatus'](_0x4f9a0d);}return _0xf46d1c['status'](_0x4f9a0d)['end']();};}function respondWithResult(_0x59a430,_0x43123e){_0x43123e=_0x43123e||0xc8;return function(_0x58df2b){if(_0x58df2b){return _0x59a430[_0x4a7c('0x14')](_0x43123e)['json'](_0x58df2b);}};}function respondWithFilteredResult(_0x5508a2,_0xe8d58e){return function(_0xb0ce50){if(_0xb0ce50){var _0x23b16d=typeof _0xe8d58e[_0x4a7c('0x15')]===_0x4a7c('0x16')&&typeof _0xe8d58e[_0x4a7c('0x17')]==='undefined';var _0x1b06f7=_0xb0ce50[_0x4a7c('0x18')];var _0x22aa77=_0x23b16d?0x0:_0xe8d58e[_0x4a7c('0x15')];var _0x4168fb=_0x23b16d?_0xb0ce50[_0x4a7c('0x18')]:_0xe8d58e[_0x4a7c('0x15')]+_0xe8d58e[_0x4a7c('0x17')];var _0x1aefbe;if(_0x4168fb>=_0x1b06f7){_0x4168fb=_0x1b06f7;_0x1aefbe=0xc8;}else{_0x1aefbe=0xce;}_0x5508a2['status'](_0x1aefbe);return _0x5508a2[_0x4a7c('0x19')](_0x4a7c('0x1a'),_0x22aa77+'-'+_0x4168fb+'/'+_0x1b06f7)[_0x4a7c('0x1b')](_0xb0ce50);}return null;};}function patchUpdates(_0x223fb2){return function(_0x53457e){try{jsonpatch[_0x4a7c('0x1c')](_0x53457e,_0x223fb2,!![]);}catch(_0x33e377){return BPromise[_0x4a7c('0x1d')](_0x33e377);}return _0x53457e[_0x4a7c('0x1e')]();};}function saveUpdates(_0x3f6ee0,_0x4b2c57){return function(_0x362419){if(_0x362419){return _0x362419[_0x4a7c('0x1f')](_0x3f6ee0)[_0x4a7c('0x20')](function(_0x5c949b){return _0x5c949b;});}return null;};}function removeEntity(_0xb80e96,_0x3a4736){return function(_0x3acb38){if(_0x3acb38){return _0x3acb38[_0x4a7c('0x21')]()['then'](function(){var _0x183fbc=_0x3acb38[_0x4a7c('0x22')]({'plain':!![]});var _0x4b019a=_0x4a7c('0x23');return db[_0x4a7c('0x24')][_0x4a7c('0x21')]({'where':{'type':_0x4b019a,'resourceId':_0x183fbc['id']}})[_0x4a7c('0x20')](function(){return _0x3acb38;});})[_0x4a7c('0x20')](function(){_0xb80e96[_0x4a7c('0x14')](0xcc)[_0x4a7c('0x25')]();});}};}function handleEntityNotFound(_0x5c454d,_0x161bc7){return function(_0x55d2aa){if(!_0x55d2aa){_0x5c454d[_0x4a7c('0x26')](0x194);}return _0x55d2aa;};}function handleError(_0x3f32f4,_0x66eb2c){_0x66eb2c=_0x66eb2c||0x1f4;return function(_0x5be8f9){logger['error'](_0x5be8f9[_0x4a7c('0x27')]);if(_0x5be8f9[_0x4a7c('0x28')]){delete _0x5be8f9[_0x4a7c('0x28')];}_0x3f32f4[_0x4a7c('0x14')](_0x66eb2c)[_0x4a7c('0x29')](_0x5be8f9);};}exports['index']=function(_0x9f4643,_0x5f1ad9){var _0x3c7332={},_0x1d9b00={},_0x2869d5={'count':0x0,'rows':[]};var _0x22fa19=_[_0x4a7c('0x2a')](db[_0x4a7c('0x2b')]['rawAttributes'],function(_0x4df761){return{'name':_0x4df761['fieldName'],'type':_0x4df761[_0x4a7c('0x2c')][_0x4a7c('0x2d')]};});_0x1d9b00['model']=_[_0x4a7c('0x2a')](_0x22fa19,'name');_0x1d9b00[_0x4a7c('0x2e')]=_[_0x4a7c('0x2f')](_0x9f4643[_0x4a7c('0x2e')]);_0x1d9b00['filters']=_[_0x4a7c('0x30')](_0x1d9b00['model'],_0x1d9b00[_0x4a7c('0x2e')]);_0x3c7332[_0x4a7c('0x31')]=_[_0x4a7c('0x30')](_0x1d9b00['model'],qs[_0x4a7c('0x32')](_0x9f4643[_0x4a7c('0x2e')][_0x4a7c('0x32')]));_0x3c7332[_0x4a7c('0x31')]=_0x3c7332[_0x4a7c('0x31')]['length']?_0x3c7332[_0x4a7c('0x31')]:_0x1d9b00['model'];if(!_0x9f4643[_0x4a7c('0x2e')][_0x4a7c('0x33')]('nolimit')){_0x3c7332[_0x4a7c('0x17')]=qs[_0x4a7c('0x17')](_0x9f4643['query']['limit']);_0x3c7332[_0x4a7c('0x15')]=qs[_0x4a7c('0x15')](_0x9f4643[_0x4a7c('0x2e')][_0x4a7c('0x15')]);}_0x3c7332[_0x4a7c('0x34')]=qs[_0x4a7c('0x35')](_0x9f4643[_0x4a7c('0x2e')]['sort']);_0x3c7332['where']=qs[_0x4a7c('0x36')](_[_0x4a7c('0x37')](_0x9f4643[_0x4a7c('0x2e')],_0x1d9b00[_0x4a7c('0x36')]),_0x22fa19);if(_0x9f4643[_0x4a7c('0x2e')]['filter']){_0x3c7332[_0x4a7c('0x38')]=_[_0x4a7c('0x39')](_0x3c7332[_0x4a7c('0x38')],{'$or':_[_0x4a7c('0x2a')](_0x22fa19,function(_0x3ba984){if(_0x3ba984[_0x4a7c('0x2c')]!==_0x4a7c('0x3a')){var _0x20ca22={};_0x20ca22[_0x3ba984[_0x4a7c('0x28')]]={'$like':'%'+_0x9f4643[_0x4a7c('0x2e')][_0x4a7c('0x3b')]+'%'};return _0x20ca22;}})});}_0x3c7332=_[_0x4a7c('0x39')]({},_0x3c7332,_0x9f4643[_0x4a7c('0x3c')]);var _0xa43b80={'where':_0x3c7332[_0x4a7c('0x38')]};return db[_0x4a7c('0x2b')]['count'](_0xa43b80)[_0x4a7c('0x20')](function(_0x1a8f67){_0x2869d5[_0x4a7c('0x18')]=_0x1a8f67;if(_0x9f4643[_0x4a7c('0x2e')]['includeAll']){_0x3c7332[_0x4a7c('0x3d')]=[{'all':!![]}];}return db[_0x4a7c('0x2b')][_0x4a7c('0x3e')](_0x3c7332);})[_0x4a7c('0x20')](function(_0x25cd3d){_0x2869d5[_0x4a7c('0x3f')]=_0x25cd3d;return _0x2869d5;})[_0x4a7c('0x20')](respondWithFilteredResult(_0x5f1ad9,_0x3c7332))['catch'](handleError(_0x5f1ad9,null));};exports['show']=function(_0x2a6e15,_0x425450){var _0x300ce6={'raw':!![],'where':{'id':_0x2a6e15[_0x4a7c('0x40')]['id']}},_0x15a7b3={};_0x15a7b3[_0x4a7c('0x41')]=_[_0x4a7c('0x2f')](db[_0x4a7c('0x2b')][_0x4a7c('0x42')]);_0x15a7b3[_0x4a7c('0x2e')]=_[_0x4a7c('0x2f')](_0x2a6e15[_0x4a7c('0x2e')]);_0x15a7b3['filters']=_[_0x4a7c('0x30')](_0x15a7b3['model'],_0x15a7b3[_0x4a7c('0x2e')]);_0x300ce6[_0x4a7c('0x31')]=_[_0x4a7c('0x30')](_0x15a7b3[_0x4a7c('0x41')],qs[_0x4a7c('0x32')](_0x2a6e15['query']['fields']));_0x300ce6[_0x4a7c('0x31')]=_0x300ce6[_0x4a7c('0x31')][_0x4a7c('0x43')]?_0x300ce6[_0x4a7c('0x31')]:_0x15a7b3[_0x4a7c('0x41')];if(_0x2a6e15[_0x4a7c('0x2e')][_0x4a7c('0x44')]){_0x300ce6[_0x4a7c('0x3d')]=[{'all':!![]}];}_0x300ce6=_[_0x4a7c('0x39')]({},_0x300ce6,_0x2a6e15['options']);return db['Variable'][_0x4a7c('0x45')](_0x300ce6)['then'](handleEntityNotFound(_0x425450,null))['then'](respondWithResult(_0x425450,null))[_0x4a7c('0x46')](handleError(_0x425450,null));};exports[_0x4a7c('0x47')]=function(_0x11fda9,_0x2c4949){return db[_0x4a7c('0x2b')][_0x4a7c('0x47')](_0x11fda9[_0x4a7c('0x48')],{})[_0x4a7c('0x20')](function(_0x43f36a){var _0x3f6ea8=_0x11fda9['user']['get']({'plain':!![]});if(!_0x3f6ea8)throw new Error(_0x4a7c('0x49'));if(_0x3f6ea8[_0x4a7c('0x4a')]===_0x4a7c('0x4b')){var _0x443e02=_0x43f36a['get']({'plain':!![]});var _0x1a482f=_0x4a7c('0x23');return db['UserProfileSection'][_0x4a7c('0x45')]({'where':{'name':_0x1a482f,'userProfileId':_0x3f6ea8[_0x4a7c('0x4c')]},'raw':!![]})[_0x4a7c('0x20')](function(_0x2aafea){if(_0x2aafea&&_0x2aafea['autoAssociation']===0x0){return db[_0x4a7c('0x24')][_0x4a7c('0x47')]({'name':_0x443e02[_0x4a7c('0x28')],'resourceId':_0x443e02['id'],'type':_0x2aafea[_0x4a7c('0x28')],'sectionId':_0x2aafea['id']},{})[_0x4a7c('0x20')](function(){return _0x43f36a;});}else{return _0x43f36a;}})['catch'](function(_0x2b926c){logger['error'](_0x4a7c('0x4d'),_0x2b926c);throw _0x2b926c;});}return _0x43f36a;})[_0x4a7c('0x20')](respondWithResult(_0x2c4949,0xc9))['catch'](handleError(_0x2c4949,null));};exports[_0x4a7c('0x1f')]=function(_0x4825ed,_0x39d321){if(_0x4825ed[_0x4a7c('0x48')]['id']){delete _0x4825ed[_0x4a7c('0x48')]['id'];}return db[_0x4a7c('0x2b')][_0x4a7c('0x45')]({'where':{'id':_0x4825ed[_0x4a7c('0x40')]['id']}})['then'](handleEntityNotFound(_0x39d321,null))[_0x4a7c('0x20')](saveUpdates(_0x4825ed['body'],null))[_0x4a7c('0x20')](respondWithResult(_0x39d321,null))[_0x4a7c('0x46')](handleError(_0x39d321,null));};exports[_0x4a7c('0x21')]=function(_0x456c76,_0x25c17a){return db['Variable'][_0x4a7c('0x45')]({'where':{'id':_0x456c76[_0x4a7c('0x40')]['id']}})['then'](handleEntityNotFound(_0x25c17a,null))[_0x4a7c('0x20')](removeEntity(_0x25c17a,null))[_0x4a7c('0x46')](handleError(_0x25c17a,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 750ba91..68bfdc1 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 _0x8f2f=['define','Variable','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./variable.attributes','exports'];(function(_0x350f77,_0x12a9b8){var _0x1305b6=function(_0x1477a9){while(--_0x1477a9){_0x350f77['push'](_0x350f77['shift']());}};_0x1305b6(++_0x12a9b8);}(_0x8f2f,0x14c));var _0xf8f2=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x8f2f[_0x49d41c];return _0xb64c5f;};'use strict';var _=require(_0xf8f2('0x0'));var util=require(_0xf8f2('0x1'));var logger=require(_0xf8f2('0x2'))(_0xf8f2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf8f2('0x4'));var rimraf=require(_0xf8f2('0x5'));var config=require(_0xf8f2('0x6'));var attributes=require(_0xf8f2('0x7'));module[_0xf8f2('0x8')]=function(_0x36ab94,_0x399c72){return _0x36ab94[_0xf8f2('0x9')](_0xf8f2('0xa'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e5c=['Variable','tools_variables','util','api','moment','bluebird','request-promise','rimraf','exports','define'];(function(_0x69d91e,_0x12fec6){var _0x381436=function(_0x9a01a0){while(--_0x9a01a0){_0x69d91e['push'](_0x69d91e['shift']());}};_0x381436(++_0x12fec6);}(_0x0e5c,0x1b0));var _0xc0e5=function(_0x93942f,_0xb48547){_0x93942f=_0x93942f-0x0;var _0x23fcd8=_0x0e5c[_0x93942f];return _0x23fcd8;};'use strict';var _=require('lodash');var util=require(_0xc0e5('0x0'));var logger=require('../../config/logger')(_0xc0e5('0x1'));var moment=require(_0xc0e5('0x2'));var BPromise=require(_0xc0e5('0x3'));var rp=require(_0xc0e5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc0e5('0x5'));var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0xc0e5('0x6')]=function(_0x250270,_0x322e90){return _0x250270[_0xc0e5('0x7')](_0xc0e5('0x8'),attributes,{'tableName':_0xc0e5('0x9'),'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 f008c2f..8995a63 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 _0x7fbe=['stringify','error','code','message','result','catch','Variable','find','options','where','attributes','include','map','model','info','ShowVariable','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0x447e82,_0x3bce4c){var _0x4a99b9=function(_0x2f2836){while(--_0x2f2836){_0x447e82['push'](_0x447e82['shift']());}};_0x4a99b9(++_0x3bce4c);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4839a2,_0x1f67eb){_0x4839a2=_0x4839a2-0x0;var _0x465147=_0x7fbe[_0x4839a2];return _0x465147;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}exports['ShowVariable']=function(_0x293a47){var _0x546463=this;return new Promise(function(_0x1e77fd,_0x4708f7){return db[_0xe7fb('0x18')][_0xe7fb('0x19')]({'raw':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x293a47[_0xe7fb('0x1a')]?_0x293a47['options'][_0xe7fb('0x1b')]||null:null,'attributes':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1c')]||null:null,'include':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1d')]?_[_0xe7fb('0x1e')](_0x293a47['options'][_0xe7fb('0x1d')],function(_0x469ead){return{'model':db[_0x469ead['model']],'as':_0x469ead['as'],'attributes':_0x469ead['attributes'],'include':_0x469ead['include']?_[_0xe7fb('0x1e')](_0x469ead['include'],function(_0x49b219){return{'model':db[_0x49b219[_0xe7fb('0x1f')]],'as':_0x49b219['as'],'attributes':_0x49b219[_0xe7fb('0x1c')],'include':_0x49b219[_0xe7fb('0x1d')]?_['map'](_0x49b219[_0xe7fb('0x1d')],function(_0x2b69c4){return{'model':db[_0x2b69c4[_0xe7fb('0x1f')]],'as':_0x2b69c4['as'],'attributes':_0x2b69c4[_0xe7fb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe7fb('0xd')](function(_0x16237a){logger[_0xe7fb('0x20')]('ShowVariable',_0x293a47);logger['debug'](_0xe7fb('0x21'),_0x293a47,JSON[_0xe7fb('0x12')](_0x16237a));_0x1e77fd(_0x16237a);})[_0xe7fb('0x17')](function(_0x4fd290){logger[_0xe7fb('0x13')](_0xe7fb('0x21'),_0x4fd290[_0xe7fb('0x15')],_0x293a47);_0x4708f7(_0x546463[_0xe7fb('0x13')](0x1f4,_0x4fd290[_0xe7fb('0x15')]));});});}; \ No newline at end of file +var _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0x4639ac,_0x313164){var _0xacd216=function(_0x390bb1){while(--_0x390bb1){_0x4639ac['push'](_0x4639ac['shift']());}};_0xacd216(++_0x313164);}(_0x6aa7,0x178));var _0x76aa=function(_0x4d2305,_0x2703d9){_0x4d2305=_0x4d2305-0x0;var _0x51d476=_0x6aa7[_0x4d2305];return _0x51d476;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 65dc19a..4c94538 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 _0x2981=['fetch','isAuthenticated','/pull','pull','/restart','restart','/migrations','migrations','express','../../components/auth/service','./version.controller','get','canUpdate'];(function(_0x2e5101,_0x28abaa){var _0x23b40d=function(_0x451550){while(--_0x451550){_0x2e5101['push'](_0x2e5101['shift']());}};_0x23b40d(++_0x28abaa);}(_0x2981,0x167));var _0x1298=function(_0x2a1987,_0x4e233c){_0x2a1987=_0x2a1987-0x0;var _0x2a8d63=_0x2981[_0x2a1987];return _0x2a8d63;};'use strict';var express=require(_0x1298('0x0'));var router=express['Router']();var auth=require(_0x1298('0x1'));var controller=require(_0x1298('0x2'));router['get']('/',controller['index']);router[_0x1298('0x3')]('/fetch',auth['isAuthenticated'](),auth[_0x1298('0x4')](),controller[_0x1298('0x5')]);router['get']('/reset',auth[_0x1298('0x6')](),auth[_0x1298('0x4')](),controller['reset']);router[_0x1298('0x3')](_0x1298('0x7'),auth['isAuthenticated'](),auth[_0x1298('0x4')](),controller[_0x1298('0x8')]);router['get'](_0x1298('0x9'),auth[_0x1298('0x6')](),controller[_0x1298('0xa')]);router[_0x1298('0x3')](_0x1298('0xb'),controller[_0x1298('0xc')]);module['exports']=router; \ No newline at end of file +var _0xb0ac=['migrations','exports','Router','../../components/auth/service','./version.controller','get','index','isAuthenticated','canUpdate','fetch','/reset','reset','pull','restart','/migrations'];(function(_0x10e74e,_0x1603ae){var _0x2198c1=function(_0x4b627c){while(--_0x4b627c){_0x10e74e['push'](_0x10e74e['shift']());}};_0x2198c1(++_0x1603ae);}(_0xb0ac,0x1f1));var _0xcb0a=function(_0x7c728f,_0x284a44){_0x7c728f=_0x7c728f-0x0;var _0x219875=_0xb0ac[_0x7c728f];return _0x219875;};'use strict';var express=require('express');var router=express[_0xcb0a('0x0')]();var auth=require(_0xcb0a('0x1'));var controller=require(_0xcb0a('0x2'));router[_0xcb0a('0x3')]('/',controller[_0xcb0a('0x4')]);router[_0xcb0a('0x3')]('/fetch',auth[_0xcb0a('0x5')](),auth[_0xcb0a('0x6')](),controller[_0xcb0a('0x7')]);router['get'](_0xcb0a('0x8'),auth[_0xcb0a('0x5')](),auth[_0xcb0a('0x6')](),controller[_0xcb0a('0x9')]);router[_0xcb0a('0x3')]('/pull',auth[_0xcb0a('0x5')](),auth[_0xcb0a('0x6')](),controller[_0xcb0a('0xa')]);router[_0xcb0a('0x3')]('/restart',auth[_0xcb0a('0x5')](),controller[_0xcb0a('0xb')]);router['get'](_0xcb0a('0xc'),controller[_0xcb0a('0xd')]);module[_0xcb0a('0xe')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index b0025f5..123a112 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 _0x8745=['FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace','exports','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','\x20to\x20','last','UniqueConstraintError','path','lodash','pkginfo','version','child_process','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','root','index','query','fetch','tags','latest','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard'];(function(_0x397d61,_0x1f2002){var _0x270833=function(_0x330677){while(--_0x330677){_0x397d61['push'](_0x397d61['shift']());}};_0x270833(++_0x1f2002);}(_0x8745,0xbd));var _0x5874=function(_0x1a836e,_0x258a2f){_0x1a836e=_0x1a836e-0x0;var _0x432043=_0x8745[_0x1a836e];return _0x432043;};'use strict';var Umzug=require('umzug');var path=require(_0x5874('0x0'));var fs=require('fs');var _=require(_0x5874('0x1'));var pkginfo=require(_0x5874('0x2'))(module,_0x5874('0x3'));var compareVersions=require('compare-versions');var exec=require(_0x5874('0x4'))['exec'];var db=require(_0x5874('0x5'))['db'];var config=require(_0x5874('0x6'));var pm2=require('../../config/pm2');var logger=require(_0x5874('0x7'))(_0x5874('0x8'));var git=require(_0x5874('0x9'))(config[_0x5874('0xa')]);exports[_0x5874('0xb')]=function(_0xfa2e61,_0x21cf50){var _0x2cef61={'current':module['exports'][_0x5874('0x3')],'phonebar':0x2};if(_0xfa2e61[_0x5874('0xc')]&&_0xfa2e61['query']['latest']){return git[_0x5874('0xd')]()[_0x5874('0xe')](function(_0x2f393a,_0x89da18){_0x2cef61[_0x5874('0xf')]=(_0x2f393a?module['exports']['version']:_0x89da18['latest'])||_0x5874('0x10');return _0x21cf50['status'](0xc8)['json'](_0x2cef61);});}else{return _0x21cf50[_0x5874('0x11')](0xc8)[_0x5874('0x12')](_0x2cef61);}};exports[_0x5874('0xd')]=function(_0x5a2da1,_0x21b4be){return git['fetch']([_0x5874('0x13'),_0x5874('0x14')],function(_0x2e8bec){if(_0x2e8bec){logger[_0x5874('0x15')](_0x2e8bec);return _0x21b4be[_0x5874('0x11')](0x1f4)[_0x5874('0x12')](_0x2e8bec);}logger[_0x5874('0x16')](_0x5874('0x17'));return _0x21b4be[_0x5874('0x11')](0xc8)[_0x5874('0x12')]({'output':_0x5874('0x18')});});};exports[_0x5874('0x19')]=function(_0x5ea989,_0x816122){return git['reset']([_0x5874('0x1a'),_0x5874('0x1b')],function(_0x5ea366){if(_0x5ea366){logger['error'](_0x5ea366);return _0x816122['status'](0x1f4)[_0x5874('0x12')](_0x5ea366);}logger['info'](_0x5874('0x1c'));return _0x816122[_0x5874('0x11')](0xc8)['json']({'output':_0x5874('0x1d')});});};exports[_0x5874('0x1e')]=function(_0x3017f9,_0x30d212){exec('npm\x20install\x20--production',function(_0xfa8b7e,_0x519c45,_0x5605fb){logger[_0x5874('0x16')](_0x519c45);logger[_0x5874('0x16')](_0x5605fb);if(_0xfa8b7e){logger[_0x5874('0x15')](_0xfa8b7e);return _0x30d212['status'](0x1f4)[_0x5874('0x12')](_0xfa8b7e);}return _0x30d212['status'](0xc8)[_0x5874('0x12')]({'output':_0x519c45});});};exports[_0x5874('0x1f')]=function(_0x3921ed,_0x2cb8df){return pm2[_0x5874('0x1f')](_0x5874('0x20'))[_0x5874('0x21')](function(_0x4b2b70){logger[_0x5874('0x16')]('pm2\x20restart\x20motion\x20%s',_0x4b2b70);return _0x2cb8df[_0x5874('0x11')](0xc8)[_0x5874('0x12')]({'output':_0x5874('0x22')});})[_0x5874('0x23')](function(_0x3f4e4a){logger[_0x5874('0x15')](_0x3f4e4a);return _0x2cb8df['status'](0x1f4)[_0x5874('0x12')](_0x3f4e4a);});};exports[_0x5874('0x24')]=function(_0x27cd6e,_0x31486b){var _0x129145=fs[_0x5874('0x25')](path[_0x5874('0x26')](config['root'],_0x5874('0x27'),'migrations'));var _0x3c3c4e=[];for(var _0x2c26db=0x0;_0x2c26db<_0x129145[_0x5874('0x28')];_0x2c26db++){var _0x303e80=_0x129145[_0x2c26db][_0x5874('0x29')]('.js','');if(compareVersions(module[_0x5874('0x2a')][_0x5874('0x3')],_0x303e80)===-0x1){_0x3c3c4e[_0x5874('0x2b')](_0x303e80);}}if(_0x3c3c4e['length']){var _0x437ac2=_0x3c3c4e[_0x5874('0x2c')](compareVersions);var _0x1940a6=new Umzug({'storage':_0x5874('0x2d'),'storageOptions':{'model':db[_0x5874('0x2e')],'modelName':_0x5874('0x2e'),'columnName':_0x5874('0x3')},'migrations':{'params':[db[_0x5874('0x2d')]['getQueryInterface'](),db['sequelize']['constructor'],function(){throw new Error(_0x5874('0x2f'));}],'path':path[_0x5874('0x26')](config[_0x5874('0xa')],'server','migrations'),'pattern':/\.js$/}});_0x1940a6['up']({'migrations':_[_0x5874('0x30')](_0x437ac2,function(_0x4b601e){return _0x4b601e+_0x5874('0x31');})})[_0x5874('0x21')](function(){return _0x31486b[_0x5874('0x11')](0xc8)['json']({'output':_0x5874('0x32')+module['exports'][_0x5874('0x3')]+_0x5874('0x33')+_[_0x5874('0x34')](_0x437ac2),'migrations':_[_0x5874('0x26')](_0x437ac2)});})['catch'](function(_0x594f21){if(_0x594f21 instanceof db[_0x5874('0x2d')][_0x5874('0x35')]){return _0x31486b['status'](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}else{return _0x31486b[_0x5874('0x11')](0x1f4)[_0x5874('0x12')](_0x594f21);}});}else{return _0x31486b[_0x5874('0x11')](0xc8)[_0x5874('0x12')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0xe1aa=['npm\x20install\x20--production','restart','pm2\x20restart\x20motion\x20%s','catch','readdirSync','server','migrations','replace','.js','exports','length','sort','sequelize','Migration','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','\x20to\x20','umzug','path','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','query','latest','fetch','tags','status','json','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xe1aa,0x1d4));var _0xae1a=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xe1aa[_0x6131cd];return _0x47e916;};'use strict';var Umzug=require(_0xae1a('0x0'));var path=require(_0xae1a('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,_0xae1a('0x2'));var compareVersions=require(_0xae1a('0x3'));var exec=require(_0xae1a('0x4'))[_0xae1a('0x5')];var db=require(_0xae1a('0x6'))['db'];var config=require(_0xae1a('0x7'));var pm2=require(_0xae1a('0x8'));var logger=require(_0xae1a('0x9'))(_0xae1a('0xa'));var git=require(_0xae1a('0xb'))(config[_0xae1a('0xc')]);exports['index']=function(_0x4fc315,_0x20ac45){var _0x12a735={'current':module['exports'][_0xae1a('0x2')],'phonebar':0x2};if(_0x4fc315['query']&&_0x4fc315[_0xae1a('0xd')][_0xae1a('0xe')]){return git[_0xae1a('0xf')]()[_0xae1a('0x10')](function(_0x235cda,_0x58ed79){_0x12a735[_0xae1a('0xe')]=(_0x235cda?module['exports'][_0xae1a('0x2')]:_0x58ed79[_0xae1a('0xe')])||'2.0.0';return _0x20ac45[_0xae1a('0x11')](0xc8)[_0xae1a('0x12')](_0x12a735);});}else{return _0x20ac45[_0xae1a('0x11')](0xc8)[_0xae1a('0x12')](_0x12a735);}};exports['fetch']=function(_0x106588,_0x4d41df){return git[_0xae1a('0xf')](['origin',_0xae1a('0x13')],function(_0xbba5a2){if(_0xbba5a2){logger[_0xae1a('0x14')](_0xbba5a2);return _0x4d41df['status'](0x1f4)[_0xae1a('0x12')](_0xbba5a2);}logger[_0xae1a('0x15')](_0xae1a('0x16'));return _0x4d41df[_0xae1a('0x11')](0xc8)[_0xae1a('0x12')]({'output':_0xae1a('0x17')});});};exports['reset']=function(_0x42851c,_0x28dae4){return git[_0xae1a('0x18')](['--hard',_0xae1a('0x19')],function(_0x3e7a28){if(_0x3e7a28){logger[_0xae1a('0x14')](_0x3e7a28);return _0x28dae4['status'](0x1f4)[_0xae1a('0x12')](_0x3e7a28);}logger[_0xae1a('0x15')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x28dae4['status'](0xc8)[_0xae1a('0x12')]({'output':_0xae1a('0x1a')});});};exports['pull']=function(_0x9e7384,_0x345a31){exec(_0xae1a('0x1b'),function(_0x259cb5,_0xeb5454,_0x37bb55){logger[_0xae1a('0x15')](_0xeb5454);logger[_0xae1a('0x15')](_0x37bb55);if(_0x259cb5){logger['error'](_0x259cb5);return _0x345a31[_0xae1a('0x11')](0x1f4)['json'](_0x259cb5);}return _0x345a31[_0xae1a('0x11')](0xc8)[_0xae1a('0x12')]({'output':_0xeb5454});});};exports[_0xae1a('0x1c')]=function(_0x55d6f1,_0x6a7ce3){return pm2['restart']('motion2')['then'](function(_0x366594){logger[_0xae1a('0x15')](_0xae1a('0x1d'),_0x366594);return _0x6a7ce3[_0xae1a('0x11')](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xae1a('0x1e')](function(_0xd8c189){logger[_0xae1a('0x14')](_0xd8c189);return _0x6a7ce3['status'](0x1f4)[_0xae1a('0x12')](_0xd8c189);});};exports['migrations']=function(_0x9d24c1,_0x14b57a){var _0x4dd15f=fs[_0xae1a('0x1f')](path['join'](config['root'],_0xae1a('0x20'),_0xae1a('0x21')));var _0x599e33=[];for(var _0x389f98=0x0;_0x389f98<_0x4dd15f['length'];_0x389f98++){var _0x3c9d5d=_0x4dd15f[_0x389f98][_0xae1a('0x22')](_0xae1a('0x23'),'');if(compareVersions(module[_0xae1a('0x24')]['version'],_0x3c9d5d)===-0x1){_0x599e33['push'](_0x3c9d5d);}}if(_0x599e33[_0xae1a('0x25')]){var _0x1d3b9d=_0x599e33[_0xae1a('0x26')](compareVersions);var _0x32dc99=new Umzug({'storage':_0xae1a('0x27'),'storageOptions':{'model':db[_0xae1a('0x28')],'modelName':'Migration','columnName':_0xae1a('0x2')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db[_0xae1a('0x27')]['constructor'],function(){throw new Error(_0xae1a('0x29'));}],'path':path[_0xae1a('0x2a')](config[_0xae1a('0xc')],_0xae1a('0x20'),_0xae1a('0x21')),'pattern':/\.js$/}});_0x32dc99['up']({'migrations':_[_0xae1a('0x2b')](_0x1d3b9d,function(_0x1d67c4){return _0x1d67c4+_0xae1a('0x23');})})['then'](function(){return _0x14b57a[_0xae1a('0x11')](0xc8)[_0xae1a('0x12')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0xae1a('0x2')]+_0xae1a('0x2c')+_['last'](_0x1d3b9d),'migrations':_[_0xae1a('0x2a')](_0x1d3b9d)});})[_0xae1a('0x1e')](function(_0x5adc54){if(_0x5adc54 instanceof db[_0xae1a('0x27')]['UniqueConstraintError']){return _0x14b57a['status'](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}else{return _0x14b57a[_0xae1a('0x11')](0x1f4)[_0xae1a('0x12')](_0x5adc54);}});}else{return _0x14b57a[_0xae1a('0x11')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 5689334..6ad2a42 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 _0x9d16=['index','/describe','describe','/:id','post','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated'];(function(_0xc5d16d,_0x1bdef3){var _0x5a1e52=function(_0x3c2aee){while(--_0x3c2aee){_0xc5d16d['push'](_0xc5d16d['shift']());}};_0x5a1e52(++_0x1bdef3);}(_0x9d16,0x68));var _0x69d1=function(_0x2c1aa8,_0x3e0609){_0x2c1aa8=_0x2c1aa8-0x0;var _0x4019f5=_0x9d16[_0x2c1aa8];return _0x4019f5;};'use strict';var multer=require(_0x69d1('0x0'));var util=require(_0x69d1('0x1'));var path=require('path');var timeout=require(_0x69d1('0x2'));var express=require(_0x69d1('0x3'));var router=express[_0x69d1('0x4')]();var fs_extra=require(_0x69d1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x69d1('0x6'));var config=require('../../config/environment');var controller=require(_0x69d1('0x7'));router[_0x69d1('0x8')]('/',auth[_0x69d1('0x9')](),controller[_0x69d1('0xa')]);router[_0x69d1('0x8')](_0x69d1('0xb'),auth['isAuthenticated'](),controller[_0x69d1('0xc')]);router['get'](_0x69d1('0xd'),auth[_0x69d1('0x9')](),controller['show']);router[_0x69d1('0xe')]('/',auth[_0x69d1('0x9')](),controller[_0x69d1('0xf')]);router[_0x69d1('0x10')](_0x69d1('0xd'),auth[_0x69d1('0x9')](),controller[_0x69d1('0x11')]);router[_0x69d1('0x12')](_0x69d1('0xd'),auth[_0x69d1('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x02ef=['fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','show','post','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','Router'];(function(_0xa7a587,_0x1103e1){var _0x74b664=function(_0x476035){while(--_0x476035){_0xa7a587['push'](_0xa7a587['shift']());}};_0x74b664(++_0x1103e1);}(_0x02ef,0x11c));var _0xf02e=function(_0x5b51d2,_0xd3846c){_0x5b51d2=_0x5b51d2-0x0;var _0x1ecc32=_0x02ef[_0x5b51d2];return _0x1ecc32;};'use strict';var multer=require(_0xf02e('0x0'));var util=require(_0xf02e('0x1'));var path=require('path');var timeout=require(_0xf02e('0x2'));var express=require('express');var router=express[_0xf02e('0x3')]();var fs_extra=require(_0xf02e('0x4'));var auth=require(_0xf02e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0xf02e('0x6')]('/',auth[_0xf02e('0x7')](),controller[_0xf02e('0x8')]);router[_0xf02e('0x6')](_0xf02e('0x9'),auth[_0xf02e('0x7')](),controller['describe']);router['get']('/:id',auth[_0xf02e('0x7')](),controller[_0xf02e('0xa')]);router[_0xf02e('0xb')]('/',auth[_0xf02e('0x7')](),controller[_0xf02e('0xc')]);router[_0xf02e('0xd')](_0xf02e('0xe'),auth[_0xf02e('0x7')](),controller[_0xf02e('0xf')]);router[_0xf02e('0x10')](_0xf02e('0xe'),auth[_0xf02e('0x7')](),controller[_0xf02e('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index ce97be1..cde3907 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 _0x42f4=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x1508e9,_0x5dfaec){var _0x5a0bf5=function(_0x1e2a64){while(--_0x1e2a64){_0x1508e9['push'](_0x1508e9['shift']());}};_0x5a0bf5(++_0x5dfaec);}(_0x42f4,0x19d));var _0x442f=function(_0x10a212,_0x579d85){_0x10a212=_0x10a212-0x0;var _0x23c82b=_0x42f4[_0x10a212];return _0x23c82b;};'use strict';var Sequelize=require(_0x442f('0x0'));module['exports']={'type':{'type':Sequelize[_0x442f('0x1')]},'uniqueid':{'type':Sequelize[_0x442f('0x1')]},'calleridnum':{'type':Sequelize[_0x442f('0x1')]},'calleridname':{'type':Sequelize[_0x442f('0x1')]},'queue':{'type':Sequelize[_0x442f('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x442f('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x442f('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x442f('0x2')]},'holdtime':{'type':Sequelize[_0x442f('0x3')]},'agentcomplete':{'type':Sequelize[_0x442f('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x442f('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x442f('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x442f('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x442f('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x442f('0x3')]},'channelstatedesc':{'type':Sequelize[_0x442f('0x1')]},'connectedlinenum':{'type':Sequelize[_0x442f('0x1')]},'connectedlinename':{'type':Sequelize[_0x442f('0x1')]},'language':{'type':Sequelize[_0x442f('0x1')]},'accountcode':{'type':Sequelize[_0x442f('0x1')]},'context':{'type':Sequelize[_0x442f('0x1')]},'exten':{'type':Sequelize[_0x442f('0x1')]},'priority':{'type':Sequelize[_0x442f('0x1')]},'destchannel':{'type':Sequelize[_0x442f('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x442f('0x1')]},'destcalleridnum':{'type':Sequelize[_0x442f('0x1')]},'destcalleridname':{'type':Sequelize[_0x442f('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x442f('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x442f('0x1')]},'destlanguage':{'type':Sequelize[_0x442f('0x1')]},'destaccountcode':{'type':Sequelize[_0x442f('0x1')]},'destcontext':{'type':Sequelize[_0x442f('0x1')]},'destexten':{'type':Sequelize[_0x442f('0x1')]},'destpriority':{'type':Sequelize[_0x442f('0x1')]},'destuniqueid':{'type':Sequelize[_0x442f('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x442f('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x442f('0x1')]},'transfer':{'type':Sequelize[_0x442f('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x442f('0x1')],'comment':_0x442f('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x442f('0x1')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xe9e8=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x3b0825,_0xfa127c){var _0x4888b6=function(_0xbc9afc){while(--_0xbc9afc){_0x3b0825['push'](_0x3b0825['shift']());}};_0x4888b6(++_0xfa127c);}(_0xe9e8,0x6b));var _0x8e9e=function(_0x5f0765,_0x2e723e){_0x5f0765=_0x5f0765-0x0;var _0x191335=_0xe9e8[_0x5f0765];return _0x191335;};'use strict';var Sequelize=require(_0x8e9e('0x0'));module[_0x8e9e('0x1')]={'type':{'type':Sequelize[_0x8e9e('0x2')]},'uniqueid':{'type':Sequelize[_0x8e9e('0x2')]},'calleridnum':{'type':Sequelize[_0x8e9e('0x2')]},'calleridname':{'type':Sequelize[_0x8e9e('0x2')]},'queue':{'type':Sequelize[_0x8e9e('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8e9e('0x2')]},'agentcalledAt':{'type':Sequelize[_0x8e9e('0x3')]},'agentconnectAt':{'type':Sequelize[_0x8e9e('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x8e9e('0x3')]},'agentdumpAt':{'type':Sequelize[_0x8e9e('0x3')]},'holdtime':{'type':Sequelize[_0x8e9e('0x4')]},'agentcomplete':{'type':Sequelize[_0x8e9e('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x8e9e('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x8e9e('0x4')]},'agentacw':{'type':Sequelize[_0x8e9e('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x8e9e('0x2')]},'lastevent':{'type':Sequelize[_0x8e9e('0x2')]},'channel':{'type':Sequelize[_0x8e9e('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x8e9e('0x2')]},'connectedlinenum':{'type':Sequelize[_0x8e9e('0x2')]},'connectedlinename':{'type':Sequelize[_0x8e9e('0x2')]},'language':{'type':Sequelize[_0x8e9e('0x2')]},'accountcode':{'type':Sequelize[_0x8e9e('0x2')]},'context':{'type':Sequelize[_0x8e9e('0x2')]},'exten':{'type':Sequelize[_0x8e9e('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x8e9e('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x8e9e('0x2')]},'destcalleridnum':{'type':Sequelize[_0x8e9e('0x2')]},'destcalleridname':{'type':Sequelize[_0x8e9e('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x8e9e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x8e9e('0x2')]},'destlanguage':{'type':Sequelize[_0x8e9e('0x2')]},'destaccountcode':{'type':Sequelize[_0x8e9e('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x8e9e('0x2')]},'destuniqueid':{'type':Sequelize[_0x8e9e('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x8e9e('0x2')]},'transfer':{'type':Sequelize[_0x8e9e('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8e9e('0x2')],'comment':_0x8e9e('0x6')},'transferexten':{'type':Sequelize[_0x8e9e('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 8f82be0..6d4124a 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(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 482f654..e157cf6 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 _0x2bd8=['bluebird','request-promise','path','rimraf','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x2bd8,0x130));var _0x82bd=function(_0x5df19c,_0x42c9d1){_0x5df19c=_0x5df19c-0x0;var _0x21e63c=_0x2bd8[_0x5df19c];return _0x21e63c;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var logger=require(_0x82bd('0x1'))(_0x82bd('0x2'));var moment=require(_0x82bd('0x3'));var BPromise=require(_0x82bd('0x4'));var rp=require(_0x82bd('0x5'));var fs=require('fs');var path=require(_0x82bd('0x6'));var rimraf=require(_0x82bd('0x7'));var config=require('../../config/environment');var attributes=require(_0x82bd('0x8'));module[_0x82bd('0x9')]=function(_0x3bf810,_0x5ceb60){return _0x3bf810[_0x82bd('0xa')](_0x82bd('0xb'),attributes,{'tableName':_0x82bd('0xc'),'paranoid':![],'indexes':[{'fields':[_0x82bd('0xd'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x47c7=['api','bluebird','request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','../../config/logger'];(function(_0x1b51ea,_0x394fd9){var _0x18bbdc=function(_0x45b83f){while(--_0x45b83f){_0x1b51ea['push'](_0x1b51ea['shift']());}};_0x18bbdc(++_0x394fd9);}(_0x47c7,0x1ab));var _0x747c=function(_0x1bc013,_0x7771c6){_0x1bc013=_0x1bc013-0x0;var _0x55df36=_0x47c7[_0x1bc013];return _0x55df36;};'use strict';var _=require(_0x747c('0x0'));var util=require('util');var logger=require(_0x747c('0x1'))(_0x747c('0x2'));var moment=require('moment');var BPromise=require(_0x747c('0x3'));var rp=require(_0x747c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x747c('0x5'));var config=require(_0x747c('0x6'));var attributes=require(_0x747c('0x7'));module[_0x747c('0x8')]=function(_0x5e991e,_0xa1148a){return _0x5e991e['define'](_0x747c('0x9'),attributes,{'tableName':_0x747c('0xa'),'paranoid':![],'indexes':[{'fields':[_0x747c('0xb'),_0x747c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 3fd30fb..6040dd2 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 _0xbe2a=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','VoiceAgentReport','create','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','limit','stringify','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x590425,_0x11c129){var _0x5d4b80=function(_0x3e1af4){while(--_0x3e1af4){_0x590425['push'](_0x590425['shift']());}};_0x5d4b80(++_0x11c129);}(_0xbe2a,0x17b));var _0xabe2=function(_0x949274,_0x4f3034){_0x949274=_0x949274-0x0;var _0x573a7f=_0xbe2a[_0x949274];return _0x573a7f;};'use strict';var _=require(_0xabe2('0x0'));var util=require(_0xabe2('0x1'));var moment=require(_0xabe2('0x2'));var BPromise=require('bluebird');var rs=require(_0xabe2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabe2('0x4'))['db'];var utils=require(_0xabe2('0x5'));var logger=require(_0xabe2('0x6'))(_0xabe2('0x7'));var config=require(_0xabe2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xabe2('0x9')][_0xabe2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bcb59,_0x134260,_0x3d31ae){return new BPromise(function(_0x155196,_0x6975f4){return client['request'](_0x3bcb59,_0x3d31ae)['then'](function(_0x2efd3e){logger['info'](_0xabe2('0xb'),_0x134260,'request\x20sent');logger[_0xabe2('0xc')](_0xabe2('0xd'),_0x134260,_0xabe2('0xe'),JSON['stringify'](_0x2efd3e));if(_0x2efd3e[_0xabe2('0xf')]){if(_0x2efd3e[_0xabe2('0xf')]['code']===0x1f4){logger['error'](_0xabe2('0xb'),_0x134260,_0x2efd3e[_0xabe2('0xf')][_0xabe2('0x10')]);return _0x6975f4(_0x2efd3e[_0xabe2('0xf')][_0xabe2('0x10')]);}logger[_0xabe2('0xf')](_0xabe2('0xb'),_0x134260,_0x2efd3e[_0xabe2('0xf')][_0xabe2('0x10')]);return _0x155196(_0x2efd3e['error'][_0xabe2('0x10')]);}else{logger[_0xabe2('0x11')](_0xabe2('0xb'),_0x134260,_0xabe2('0xe'));_0x155196(_0x2efd3e[_0xabe2('0x12')]['message']);}})[_0xabe2('0x13')](function(_0x3a05d9){logger['error'](_0xabe2('0xb'),_0x134260,_0x3a05d9);_0x6975f4(_0x3a05d9);});});}exports['CreateVoiceAgentReport']=function(_0x433878){var _0x19a346=this;return new Promise(function(_0x13fb96,_0x517662){return db[_0xabe2('0x14')][_0xabe2('0x15')](_0x433878[_0xabe2('0x16')],{'raw':_0x433878['options']?_0x433878[_0xabe2('0x17')][_0xabe2('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x7a5d58){logger[_0xabe2('0x11')](_0xabe2('0x19'),_0x433878);logger[_0xabe2('0xc')](_0xabe2('0x19'),_0x433878,JSON['stringify'](_0x7a5d58));_0x13fb96(_0x7a5d58);})[_0xabe2('0x13')](function(_0x4d4191){logger[_0xabe2('0xf')](_0xabe2('0x19'),_0x4d4191[_0xabe2('0x10')],_0x433878);_0x517662(_0x19a346[_0xabe2('0xf')](0x1f4,_0x4d4191[_0xabe2('0x10')]));});});};exports[_0xabe2('0x1a')]=function(_0xbb7934){var _0x3839cf=this;return new Promise(function(_0x42e2d6,_0x3924a1){return db[_0xabe2('0x14')][_0xabe2('0x1b')](_0xbb7934[_0xabe2('0x16')],{'raw':_0xbb7934[_0xabe2('0x17')]?_0xbb7934[_0xabe2('0x17')][_0xabe2('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbb7934[_0xabe2('0x17')]?_0xbb7934[_0xabe2('0x17')][_0xabe2('0x1c')]||null:null,'attributes':_0xbb7934['options']?_0xbb7934[_0xabe2('0x17')][_0xabe2('0x1d')]||null:null,'limit':_0xbb7934[_0xabe2('0x17')]?_0xbb7934['options'][_0xabe2('0x1e')]||null:null})['then'](function(_0x1f8464){logger[_0xabe2('0x11')]('UpdateVoiceAgentReport',_0xbb7934);logger[_0xabe2('0xc')](_0xabe2('0x1a'),_0xbb7934,JSON[_0xabe2('0x1f')](_0x1f8464));_0x42e2d6(_0x1f8464);})[_0xabe2('0x13')](function(_0x1cff8d){logger[_0xabe2('0xf')]('UpdateVoiceAgentReport',_0x1cff8d['message'],_0xbb7934);_0x3924a1(_0x3839cf[_0xabe2('0xf')](0x1f4,_0x1cff8d[_0xabe2('0x10')]));});});}; \ No newline at end of file +var _0xd341=['where','attributes','limit','UpdateVoiceAgentReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceAgentReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','CreateVoiceAgentReport','VoiceAgentReport','create','options','raw','catch','update'];(function(_0x481e97,_0x248bea){var _0x181f42=function(_0x5b4d83){while(--_0x5b4d83){_0x481e97['push'](_0x481e97['shift']());}};_0x181f42(++_0x248bea);}(_0xd341,0x13f));var _0x1d34=function(_0x268987,_0x3d4499){_0x268987=_0x268987-0x0;var _0x2d7b99=_0xd341[_0x268987];return _0x2d7b99;};'use strict';var _=require(_0x1d34('0x0'));var util=require(_0x1d34('0x1'));var moment=require(_0x1d34('0x2'));var BPromise=require(_0x1d34('0x3'));var rs=require(_0x1d34('0x4'));var fs=require('fs');var Redis=require(_0x1d34('0x5'));var db=require(_0x1d34('0x6'))['db'];var utils=require(_0x1d34('0x7'));var logger=require(_0x1d34('0x8'))(_0x1d34('0x9'));var config=require(_0x1d34('0xa'));var jayson=require(_0x1d34('0xb'));var client=jayson['client'][_0x1d34('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x456aad,_0x3af851,_0x3da43d){return new BPromise(function(_0xbbe970,_0x3fbffd){return client[_0x1d34('0xd')](_0x456aad,_0x3da43d)[_0x1d34('0xe')](function(_0x4224b3){logger['info'](_0x1d34('0xf'),_0x3af851,'request\x20sent');logger[_0x1d34('0x10')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x3af851,_0x1d34('0x11'),JSON[_0x1d34('0x12')](_0x4224b3));if(_0x4224b3[_0x1d34('0x13')]){if(_0x4224b3[_0x1d34('0x13')][_0x1d34('0x14')]===0x1f4){logger[_0x1d34('0x13')](_0x1d34('0xf'),_0x3af851,_0x4224b3[_0x1d34('0x13')]['message']);return _0x3fbffd(_0x4224b3[_0x1d34('0x13')][_0x1d34('0x15')]);}logger[_0x1d34('0x13')](_0x1d34('0xf'),_0x3af851,_0x4224b3['error'][_0x1d34('0x15')]);return _0xbbe970(_0x4224b3['error'][_0x1d34('0x15')]);}else{logger[_0x1d34('0x16')](_0x1d34('0xf'),_0x3af851,_0x1d34('0x11'));_0xbbe970(_0x4224b3[_0x1d34('0x17')]['message']);}})['catch'](function(_0x56ae0e){logger[_0x1d34('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x3af851,_0x56ae0e);_0x3fbffd(_0x56ae0e);});});}exports[_0x1d34('0x18')]=function(_0x344c52){var _0x408598=this;return new Promise(function(_0x514945,_0xfe4cb7){return db[_0x1d34('0x19')][_0x1d34('0x1a')](_0x344c52['body'],{'raw':_0x344c52[_0x1d34('0x1b')]?_0x344c52['options'][_0x1d34('0x1c')]===undefined?!![]:![]:!![]})[_0x1d34('0xe')](function(_0x291ba8){logger['info'](_0x1d34('0x18'),_0x344c52);logger['debug'](_0x1d34('0x18'),_0x344c52,JSON[_0x1d34('0x12')](_0x291ba8));_0x514945(_0x291ba8);})[_0x1d34('0x1d')](function(_0x13442d){logger[_0x1d34('0x13')](_0x1d34('0x18'),_0x13442d[_0x1d34('0x15')],_0x344c52);_0xfe4cb7(_0x408598[_0x1d34('0x13')](0x1f4,_0x13442d[_0x1d34('0x15')]));});});};exports['UpdateVoiceAgentReport']=function(_0x2adf85){var _0x34f5d8=this;return new Promise(function(_0xc587ff,_0x397edc){return db['VoiceAgentReport'][_0x1d34('0x1e')](_0x2adf85['body'],{'raw':_0x2adf85['options']?_0x2adf85[_0x1d34('0x1b')][_0x1d34('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2adf85['options']?_0x2adf85[_0x1d34('0x1b')][_0x1d34('0x1f')]||null:null,'attributes':_0x2adf85['options']?_0x2adf85[_0x1d34('0x1b')][_0x1d34('0x20')]||null:null,'limit':_0x2adf85['options']?_0x2adf85[_0x1d34('0x1b')][_0x1d34('0x21')]||null:null})['then'](function(_0x45a3d7){logger[_0x1d34('0x16')]('UpdateVoiceAgentReport',_0x2adf85);logger['debug'](_0x1d34('0x22'),_0x2adf85,JSON[_0x1d34('0x12')](_0x45a3d7));_0xc587ff(_0x45a3d7);})[_0x1d34('0x1d')](function(_0x177fc4){logger['error'](_0x1d34('0x22'),_0x177fc4[_0x1d34('0x15')],_0x2adf85);_0x397edc(_0x34f5d8[_0x1d34('0x13')](0x1f4,_0x177fc4[_0x1d34('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 4f943fe..0f72e34 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 _0x33c5=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','util'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x33c5,0xe6));var _0x533c=function(_0x34a087,_0x4bd68e){_0x34a087=_0x34a087-0x0;var _0x5c15d7=_0x33c5[_0x34a087];return _0x5c15d7;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')]('/',auth[_0x533c('0x9')](),controller[_0x533c('0xa')]);router[_0x533c('0x8')](_0x533c('0xb'),auth[_0x533c('0x9')](),controller[_0x533c('0xc')]);router[_0x533c('0x8')](_0x533c('0xd'),auth[_0x533c('0x9')](),controller[_0x533c('0xe')]);router[_0x533c('0xf')]('/',auth[_0x533c('0x9')](),controller[_0x533c('0x10')]);router[_0x533c('0x11')]('/:id',auth[_0x533c('0x9')](),controller[_0x533c('0x12')]);router[_0x533c('0x13')](_0x533c('0xd'),auth[_0x533c('0x9')](),controller[_0x533c('0x14')]);module['exports']=router; \ No newline at end of file +var _0x9a19=['delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x547971,_0x5ebb81){var _0xc4587e=function(_0x70eb46){while(--_0x70eb46){_0x547971['push'](_0x547971['shift']());}};_0xc4587e(++_0x5ebb81);}(_0x9a19,0x114));var _0x99a1=function(_0x4cce65,_0x40021e){_0x4cce65=_0x4cce65-0x0;var _0x4d1b45=_0x9a19[_0x4cce65];return _0x4d1b45;};'use strict';var multer=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var path=require(_0x99a1('0x2'));var timeout=require('connect-timeout');var express=require(_0x99a1('0x3'));var router=express[_0x99a1('0x4')]();var fs_extra=require(_0x99a1('0x5'));var auth=require(_0x99a1('0x6'));var interaction=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var controller=require(_0x99a1('0x9'));router[_0x99a1('0xa')]('/',auth[_0x99a1('0xb')](),controller[_0x99a1('0xc')]);router[_0x99a1('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x99a1('0xa')](_0x99a1('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x99a1('0xe')]('/',auth[_0x99a1('0xb')](),controller[_0x99a1('0xf')]);router[_0x99a1('0x10')](_0x99a1('0xd'),auth['isAuthenticated'](),controller[_0x99a1('0x11')]);router[_0x99a1('0x12')](_0x99a1('0xd'),auth[_0x99a1('0xb')](),controller[_0x99a1('0x13')]);module[_0x99a1('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index a291f07..36214a8 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 _0xd2b0=['outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','STRING','ENUM','inbound','internal'];(function(_0x3a64ab,_0x367ce8){var _0x33a7c3=function(_0x258f2f){while(--_0x258f2f){_0x3a64ab['push'](_0x3a64ab['shift']());}};_0x33a7c3(++_0x367ce8);}(_0xd2b0,0x13b));var _0x0d2b=function(_0x6dd5c,_0x4bfc19){_0x6dd5c=_0x6dd5c-0x0;var _0x5a87fa=_0xd2b0[_0x6dd5c];return _0x5a87fa;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x0d2b('0x0')]},'type':{'type':Sequelize[_0x0d2b('0x1')](_0x0d2b('0x2'),_0x0d2b('0x3'),_0x0d2b('0x4'),_0x0d2b('0x5'),_0x0d2b('0x6'),_0x0d2b('0x7'))},'tag':{'type':Sequelize[_0x0d2b('0x0')]},'accountcode':{'type':Sequelize[_0x0d2b('0x0')]},'source':{'type':Sequelize[_0x0d2b('0x0')]},'destination':{'type':Sequelize[_0x0d2b('0x0')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x0d2b('0x0')]},'channel':{'type':Sequelize[_0x0d2b('0x0')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0d2b('0x0')]},'lastdata':{'type':Sequelize[_0x0d2b('0x8')]},'starttime':{'type':Sequelize[_0x0d2b('0x9')]},'systemanswertime':{'type':Sequelize[_0x0d2b('0x9')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x0d2b('0x9')]},'duration':{'type':Sequelize[_0x0d2b('0xa')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x0d2b('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x0d2b('0x0')]},'userfield':{'type':Sequelize[_0x0d2b('0x0')]},'userDisposition':{'type':Sequelize[_0x0d2b('0x0')]},'userSecondDisposition':{'type':Sequelize[_0x0d2b('0x0')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0d2b('0x0')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x0d2b('0xa')]},'sipcallid':{'type':Sequelize[_0x0d2b('0x0')]}}; \ No newline at end of file +var _0xc5dc=['outbound','outbound-fax','TEXT','DATE','INTEGER','STRING','internal'];(function(_0x1e50da,_0x2c91ef){var _0x22d8ed=function(_0x273755){while(--_0x273755){_0x1e50da['push'](_0x1e50da['shift']());}};_0x22d8ed(++_0x2c91ef);}(_0xc5dc,0xc2));var _0xcc5d=function(_0x4f9c62,_0x108d62){_0x4f9c62=_0x4f9c62-0x0;var _0x5b04c3=_0xc5dc[_0x4f9c62];return _0x5b04c3;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xcc5d('0x0')]},'type':{'type':Sequelize['ENUM']('inbound',_0xcc5d('0x1'),_0xcc5d('0x2'),'inbound-fax',_0xcc5d('0x3'),'dialer')},'tag':{'type':Sequelize[_0xcc5d('0x0')]},'accountcode':{'type':Sequelize[_0xcc5d('0x0')]},'source':{'type':Sequelize[_0xcc5d('0x0')]},'destination':{'type':Sequelize[_0xcc5d('0x0')]},'destinationcontext':{'type':Sequelize[_0xcc5d('0x0')]},'callerid':{'type':Sequelize[_0xcc5d('0x0')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0xcc5d('0x0')]},'lastdata':{'type':Sequelize[_0xcc5d('0x4')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xcc5d('0x5')]},'endtime':{'type':Sequelize[_0xcc5d('0x5')]},'duration':{'type':Sequelize[_0xcc5d('0x6')]},'billableseconds':{'type':Sequelize[_0xcc5d('0x6')]},'mohtime':{'type':Sequelize[_0xcc5d('0x6')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xcc5d('0x0')]},'userfield':{'type':Sequelize[_0xcc5d('0x0')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0xcc5d('0x0')]},'userThirdDisposition':{'type':Sequelize[_0xcc5d('0x0')]},'note':{'type':Sequelize[_0xcc5d('0x0')]},'prefix':{'type':Sequelize[_0xcc5d('0x0')]},'routeid':{'type':Sequelize[_0xcc5d('0x6')]},'sipcallid':{'type':Sequelize[_0xcc5d('0x0')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 0ffdab3..6172589 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 _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0x2ef3,0xba));var _0x32ef=function(_0x55924e,_0x46bb7f){_0x55924e=_0x55924e-0x0;var _0x2f2302=_0x2ef3[_0x55924e];return _0x2f2302;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file +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(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'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 20df06b..6561d08 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 _0x372b=['./voiceCallReport.attributes','exports','define','report_call','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x276683,_0x55ada9){var _0x41cb61=function(_0x116b12){while(--_0x116b12){_0x276683['push'](_0x276683['shift']());}};_0x41cb61(++_0x55ada9);}(_0x372b,0xc9));var _0xb372=function(_0x3dcbca,_0x1d82a9){_0x3dcbca=_0x3dcbca-0x0;var _0x573be0=_0x372b[_0x3dcbca];return _0x573be0;};'use strict';var _=require(_0xb372('0x0'));var util=require(_0xb372('0x1'));var logger=require(_0xb372('0x2'))(_0xb372('0x3'));var moment=require('moment');var BPromise=require(_0xb372('0x4'));var rp=require(_0xb372('0x5'));var fs=require('fs');var path=require(_0xb372('0x6'));var rimraf=require(_0xb372('0x7'));var config=require(_0xb372('0x8'));var attributes=require(_0xb372('0x9'));module[_0xb372('0xa')]=function(_0x295c9d,_0x1f9cab){return _0x295c9d[_0xb372('0xb')]('VoiceCallReport',attributes,{'tableName':_0xb372('0xc'),'paranoid':![],'indexes':[{'fields':[_0xb372('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7ee=['exports','define','VoiceCallReport','report_call','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceCallReport.attributes'];(function(_0x2049bd,_0xd5e939){var _0x407aaf=function(_0x132602){while(--_0x132602){_0x2049bd['push'](_0x2049bd['shift']());}};_0x407aaf(++_0xd5e939);}(_0xb7ee,0xba));var _0xeb7e=function(_0x5aae0c,_0x1568e2){_0x5aae0c=_0x5aae0c-0x0;var _0x268b6d=_0xb7ee[_0x5aae0c];return _0x268b6d;};'use strict';var _=require(_0xeb7e('0x0'));var util=require(_0xeb7e('0x1'));var logger=require(_0xeb7e('0x2'))('api');var moment=require(_0xeb7e('0x3'));var BPromise=require(_0xeb7e('0x4'));var rp=require(_0xeb7e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb7e('0x6'));var config=require(_0xeb7e('0x7'));var attributes=require(_0xeb7e('0x8'));module[_0xeb7e('0x9')]=function(_0x4731aa,_0x3ba801){return _0x4731aa[_0xeb7e('0xa')](_0xeb7e('0xb'),attributes,{'tableName':_0xeb7e('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 867eb84..ca79ebc 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 _0x6a2c=['create','update','body','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','GetVoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','info','stringify','catch','CreateVoiceCallReport','VoiceCallReport'];(function(_0x5b3eb4,_0x51b47c){var _0x57696c=function(_0x2d8965){while(--_0x2d8965){_0x5b3eb4['push'](_0x5b3eb4['shift']());}};_0x57696c(++_0x51b47c);}(_0x6a2c,0x9c));var _0xc6a2=function(_0x1eee57,_0x32ecd2){_0x1eee57=_0x1eee57-0x0;var _0x280af6=_0x6a2c[_0x1eee57];return _0x280af6;};'use strict';var _=require(_0xc6a2('0x0'));var util=require(_0xc6a2('0x1'));var moment=require(_0xc6a2('0x2'));var BPromise=require(_0xc6a2('0x3'));var rs=require(_0xc6a2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6a2('0x5'))['db'];var utils=require(_0xc6a2('0x6'));var logger=require(_0xc6a2('0x7'))(_0xc6a2('0x8'));var config=require(_0xc6a2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc6a2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x157890,_0x598538,_0x427ed3){return new BPromise(function(_0x40f057,_0x291cfb){return client['request'](_0x157890,_0x427ed3)[_0xc6a2('0xb')](function(_0x1d1b30){logger['info'](_0xc6a2('0xc'),_0x598538,_0xc6a2('0xd'));logger[_0xc6a2('0xe')](_0xc6a2('0xf'),_0x598538,'request\x20sent',JSON['stringify'](_0x1d1b30));if(_0x1d1b30[_0xc6a2('0x10')]){if(_0x1d1b30['error'][_0xc6a2('0x11')]===0x1f4){logger[_0xc6a2('0x10')](_0xc6a2('0xc'),_0x598538,_0x1d1b30[_0xc6a2('0x10')][_0xc6a2('0x12')]);return _0x291cfb(_0x1d1b30[_0xc6a2('0x10')][_0xc6a2('0x12')]);}logger['error'](_0xc6a2('0xc'),_0x598538,_0x1d1b30[_0xc6a2('0x10')][_0xc6a2('0x12')]);return _0x40f057(_0x1d1b30['error']['message']);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x598538,_0xc6a2('0xd'));_0x40f057(_0x1d1b30['result']['message']);}})['catch'](function(_0x502482){logger[_0xc6a2('0x10')](_0xc6a2('0xc'),_0x598538,_0x502482);_0x291cfb(_0x502482);});});}exports[_0xc6a2('0x13')]=function(_0x4de8b7){var _0x1c43ea=this;return new Promise(function(_0x4ab4b4,_0x4e92e7){return db['VoiceCallReport'][_0xc6a2('0x14')]({'raw':_0x4de8b7[_0xc6a2('0x15')]?_0x4de8b7[_0xc6a2('0x15')][_0xc6a2('0x16')]===undefined?!![]:![]:!![],'where':_0x4de8b7[_0xc6a2('0x15')]?_0x4de8b7[_0xc6a2('0x15')][_0xc6a2('0x17')]||null:null,'attributes':_0x4de8b7[_0xc6a2('0x15')]?_0x4de8b7[_0xc6a2('0x15')][_0xc6a2('0x18')]||null:null,'limit':_0x4de8b7['options']?_0x4de8b7[_0xc6a2('0x15')][_0xc6a2('0x19')]||null:null,'include':_0x4de8b7[_0xc6a2('0x15')]?_0x4de8b7['options'][_0xc6a2('0x1a')]?_[_0xc6a2('0x1b')](_0x4de8b7[_0xc6a2('0x15')]['include'],function(_0x1df166){return{'model':db[_0x1df166['model']],'as':_0x1df166['as'],'attributes':_0x1df166[_0xc6a2('0x18')],'include':_0x1df166[_0xc6a2('0x1a')]?_[_0xc6a2('0x1b')](_0x1df166['include'],function(_0x1128a4){return{'model':db[_0x1128a4[_0xc6a2('0x1c')]],'as':_0x1128a4['as'],'attributes':_0x1128a4[_0xc6a2('0x18')],'include':_0x1128a4['include']?_[_0xc6a2('0x1b')](_0x1128a4[_0xc6a2('0x1a')],function(_0x14c7f4){return{'model':db[_0x14c7f4['model']],'as':_0x14c7f4['as'],'attributes':_0x14c7f4[_0xc6a2('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39dd51){logger[_0xc6a2('0x1d')](_0xc6a2('0x13'),_0x4de8b7);logger['debug'](_0xc6a2('0x13'),_0x4de8b7,JSON[_0xc6a2('0x1e')](_0x39dd51));_0x4ab4b4(_0x39dd51);})[_0xc6a2('0x1f')](function(_0x1ba716){logger['error'](_0xc6a2('0x13'),_0x1ba716[_0xc6a2('0x12')],_0x4de8b7);_0x4e92e7(_0x1c43ea[_0xc6a2('0x10')](0x1f4,_0x1ba716[_0xc6a2('0x12')]));});});};exports[_0xc6a2('0x20')]=function(_0x1f22ee){var _0x5e3115=this;return new Promise(function(_0x31355d,_0x8294fa){return db[_0xc6a2('0x21')][_0xc6a2('0x22')](_0x1f22ee['body'],{'raw':_0x1f22ee[_0xc6a2('0x15')]?_0x1f22ee['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5ee8fa){logger[_0xc6a2('0x1d')](_0xc6a2('0x20'),_0x1f22ee);logger[_0xc6a2('0xe')]('CreateVoiceCallReport',_0x1f22ee,JSON[_0xc6a2('0x1e')](_0x5ee8fa));_0x31355d(_0x5ee8fa);})[_0xc6a2('0x1f')](function(_0x5cf6d4){logger['error']('CreateVoiceCallReport',_0x5cf6d4['message'],_0x1f22ee);_0x8294fa(_0x5e3115[_0xc6a2('0x10')](0x1f4,_0x5cf6d4['message']));});});};exports['UpdateVoiceCallReport']=function(_0x5cda3e){var _0x3c79d0=this;return new Promise(function(_0xb7d3a0,_0x56b40a){return db[_0xc6a2('0x21')][_0xc6a2('0x23')](_0x5cda3e[_0xc6a2('0x24')],{'raw':_0x5cda3e[_0xc6a2('0x15')]?_0x5cda3e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cda3e['options']?_0x5cda3e[_0xc6a2('0x15')][_0xc6a2('0x17')]||null:null,'attributes':_0x5cda3e['options']?_0x5cda3e[_0xc6a2('0x15')][_0xc6a2('0x18')]||null:null,'limit':_0x5cda3e['options']?_0x5cda3e[_0xc6a2('0x15')][_0xc6a2('0x19')]||null:null})[_0xc6a2('0xb')](function(_0x323377){logger[_0xc6a2('0x1d')](_0xc6a2('0x25'),_0x5cda3e);logger[_0xc6a2('0xe')](_0xc6a2('0x25'),_0x5cda3e,JSON[_0xc6a2('0x1e')](_0x323377));_0xb7d3a0(_0x323377);})['catch'](function(_0x3dc51d){logger[_0xc6a2('0x10')](_0xc6a2('0x25'),_0x3dc51d['message'],_0x5cda3e);_0x56b40a(_0x3c79d0[_0xc6a2('0x10')](0x1f4,_0x3dc51d[_0xc6a2('0x12')]));});});}; \ No newline at end of file +var _0xbedf=['limit','include','model','attributes','then','CreateVoiceCallReport','create','raw','UpdateVoiceCallReport','update','body','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0xbedf,0x11b));var _0xfbed=function(_0x11eb1f,_0x826f0b){_0x11eb1f=_0x11eb1f-0x0;var _0x2121e9=_0xbedf[_0x11eb1f];return _0x2121e9;};'use strict';var _=require(_0xfbed('0x0'));var util=require(_0xfbed('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfbed('0x2'))['db'];var utils=require(_0xfbed('0x3'));var logger=require(_0xfbed('0x4'))(_0xfbed('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfbed('0x6')][_0xfbed('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1a6bdb,_0x146330,_0x566c50){return new BPromise(function(_0x3c2190,_0x372c09){return client['request'](_0x1a6bdb,_0x566c50)['then'](function(_0x1e7062){logger[_0xfbed('0x8')](_0xfbed('0x9'),_0x146330,'request\x20sent');logger[_0xfbed('0xa')](_0xfbed('0xb'),_0x146330,_0xfbed('0xc'),JSON[_0xfbed('0xd')](_0x1e7062));if(_0x1e7062[_0xfbed('0xe')]){if(_0x1e7062['error']['code']===0x1f4){logger[_0xfbed('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x146330,_0x1e7062[_0xfbed('0xe')][_0xfbed('0xf')]);return _0x372c09(_0x1e7062['error'][_0xfbed('0xf')]);}logger[_0xfbed('0xe')](_0xfbed('0x9'),_0x146330,_0x1e7062['error']['message']);return _0x3c2190(_0x1e7062[_0xfbed('0xe')]['message']);}else{logger['info'](_0xfbed('0x9'),_0x146330,_0xfbed('0xc'));_0x3c2190(_0x1e7062[_0xfbed('0x10')][_0xfbed('0xf')]);}})[_0xfbed('0x11')](function(_0x5a2381){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x146330,_0x5a2381);_0x372c09(_0x5a2381);});});}exports[_0xfbed('0x12')]=function(_0x312bec){var _0x41cc01=this;return new Promise(function(_0x5c417b,_0x10b1ac){return db[_0xfbed('0x13')][_0xfbed('0x14')]({'raw':_0x312bec['options']?_0x312bec[_0xfbed('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x312bec['options']?_0x312bec[_0xfbed('0x15')][_0xfbed('0x16')]||null:null,'attributes':_0x312bec['options']?_0x312bec['options']['attributes']||null:null,'limit':_0x312bec['options']?_0x312bec[_0xfbed('0x15')][_0xfbed('0x17')]||null:null,'include':_0x312bec[_0xfbed('0x15')]?_0x312bec[_0xfbed('0x15')][_0xfbed('0x18')]?_['map'](_0x312bec[_0xfbed('0x15')][_0xfbed('0x18')],function(_0x52ac10){return{'model':db[_0x52ac10[_0xfbed('0x19')]],'as':_0x52ac10['as'],'attributes':_0x52ac10[_0xfbed('0x1a')],'include':_0x52ac10['include']?_['map'](_0x52ac10[_0xfbed('0x18')],function(_0x2e895c){return{'model':db[_0x2e895c['model']],'as':_0x2e895c['as'],'attributes':_0x2e895c['attributes'],'include':_0x2e895c[_0xfbed('0x18')]?_['map'](_0x2e895c[_0xfbed('0x18')],function(_0x108368){return{'model':db[_0x108368['model']],'as':_0x108368['as'],'attributes':_0x108368[_0xfbed('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xfbed('0x1b')](function(_0x450551){logger[_0xfbed('0x8')]('GetVoiceCallReport',_0x312bec);logger[_0xfbed('0xa')](_0xfbed('0x12'),_0x312bec,JSON['stringify'](_0x450551));_0x5c417b(_0x450551);})[_0xfbed('0x11')](function(_0x2bdccd){logger[_0xfbed('0xe')](_0xfbed('0x12'),_0x2bdccd['message'],_0x312bec);_0x10b1ac(_0x41cc01[_0xfbed('0xe')](0x1f4,_0x2bdccd['message']));});});};exports[_0xfbed('0x1c')]=function(_0x586b67){var _0xbb0802=this;return new Promise(function(_0x428734,_0x3f87e9){return db[_0xfbed('0x13')][_0xfbed('0x1d')](_0x586b67['body'],{'raw':_0x586b67['options']?_0x586b67[_0xfbed('0x15')][_0xfbed('0x1e')]===undefined?!![]:![]:!![]})[_0xfbed('0x1b')](function(_0x3bdbbd){logger[_0xfbed('0x8')](_0xfbed('0x1c'),_0x586b67);logger['debug']('CreateVoiceCallReport',_0x586b67,JSON[_0xfbed('0xd')](_0x3bdbbd));_0x428734(_0x3bdbbd);})[_0xfbed('0x11')](function(_0x3551ba){logger[_0xfbed('0xe')](_0xfbed('0x1c'),_0x3551ba[_0xfbed('0xf')],_0x586b67);_0x3f87e9(_0xbb0802['error'](0x1f4,_0x3551ba[_0xfbed('0xf')]));});});};exports[_0xfbed('0x1f')]=function(_0x4b8eb7){var _0x574326=this;return new Promise(function(_0x273e29,_0x3e2420){return db[_0xfbed('0x13')][_0xfbed('0x20')](_0x4b8eb7[_0xfbed('0x21')],{'raw':_0x4b8eb7['options']?_0x4b8eb7['options'][_0xfbed('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b8eb7[_0xfbed('0x15')]?_0x4b8eb7[_0xfbed('0x15')][_0xfbed('0x16')]||null:null,'attributes':_0x4b8eb7[_0xfbed('0x15')]?_0x4b8eb7['options'][_0xfbed('0x1a')]||null:null,'limit':_0x4b8eb7['options']?_0x4b8eb7[_0xfbed('0x15')][_0xfbed('0x17')]||null:null})[_0xfbed('0x1b')](function(_0x696277){logger[_0xfbed('0x8')](_0xfbed('0x1f'),_0x4b8eb7);logger[_0xfbed('0xa')](_0xfbed('0x1f'),_0x4b8eb7,JSON['stringify'](_0x696277));_0x273e29(_0x696277);})[_0xfbed('0x11')](function(_0x38a59b){logger[_0xfbed('0xe')](_0xfbed('0x1f'),_0x38a59b[_0xfbed('0xf')],_0x4b8eb7);_0x3e2420(_0x574326[_0xfbed('0xe')](0x1f4,_0x38a59b[_0xfbed('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 6ed8ebf..3dc158e 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 _0x48bb=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','get','show','post','/:id','update','delete','destroy','exports','multer'];(function(_0x21ce0f,_0x38a284){var _0x8fee42=function(_0x4ea750){while(--_0x4ea750){_0x21ce0f['push'](_0x21ce0f['shift']());}};_0x8fee42(++_0x38a284);}(_0x48bb,0x1af));var _0xb48b=function(_0x2c2980,_0x34282a){_0x2c2980=_0x2c2980-0x0;var _0x2a20a9=_0x48bb[_0x2c2980];return _0x2a20a9;};'use strict';var multer=require(_0xb48b('0x0'));var util=require('util');var path=require(_0xb48b('0x1'));var timeout=require(_0xb48b('0x2'));var express=require(_0xb48b('0x3'));var router=express[_0xb48b('0x4')]();var fs_extra=require(_0xb48b('0x5'));var auth=require(_0xb48b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb48b('0x7'));var controller=require(_0xb48b('0x8'));router['get']('/',auth[_0xb48b('0x9')](),controller['index']);router[_0xb48b('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xb48b('0xb')]);router[_0xb48b('0xc')]('/',auth[_0xb48b('0x9')](),controller['create']);router['put'](_0xb48b('0xd'),auth[_0xb48b('0x9')](),controller[_0xb48b('0xe')]);router[_0xb48b('0xf')](_0xb48b('0xd'),auth[_0xb48b('0x9')](),controller[_0xb48b('0x10')]);module[_0xb48b('0x11')]=router; \ No newline at end of file +var _0x0c0c=['../../config/environment','./voiceChanSpy.controller','get','index','/:id','isAuthenticated','post','create','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x0c0c,0x19b));var _0xc0c0=function(_0x3d736e,_0x379572){_0x3d736e=_0x3d736e-0x0;var _0x404263=_0x0c0c[_0x3d736e];return _0x404263;};'use strict';var multer=require(_0xc0c0('0x0'));var util=require(_0xc0c0('0x1'));var path=require(_0xc0c0('0x2'));var timeout=require('connect-timeout');var express=require(_0xc0c0('0x3'));var router=express[_0xc0c0('0x4')]();var fs_extra=require(_0xc0c0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc0c0('0x6'));var config=require(_0xc0c0('0x7'));var controller=require(_0xc0c0('0x8'));router[_0xc0c0('0x9')]('/',auth['isAuthenticated'](),controller[_0xc0c0('0xa')]);router[_0xc0c0('0x9')](_0xc0c0('0xb'),auth[_0xc0c0('0xc')](),controller['show']);router[_0xc0c0('0xd')]('/',auth[_0xc0c0('0xc')](),controller[_0xc0c0('0xe')]);router[_0xc0c0('0xf')](_0xc0c0('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xc0c0('0x10')](_0xc0c0('0xb'),auth[_0xc0c0('0xc')](),controller[_0xc0c0('0x11')]);module[_0xc0c0('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 8e79cd6..a5c398a 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 _0x1545=['STRING','setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize','name'];(function(_0x290b8c,_0x562926){var _0x10787d=function(_0x3d97ae){while(--_0x3d97ae){_0x290b8c['push'](_0x290b8c['shift']());}};_0x10787d(++_0x562926);}(_0x1545,0xa0));var _0x5154=function(_0x315861,_0x735b4){_0x315861=_0x315861-0x0;var _0x3e2b76=_0x1545[_0x315861];return _0x3e2b76;};'use strict';var Sequelize=require(_0x5154('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0x5154('0x1'),'allowNull':![]},'options':{'type':Sequelize[_0x5154('0x2')],'set':function(_0x41238f){this[_0x5154('0x3')](_0x5154('0x4'),_0x41238f?_0x41238f[_0x5154('0x5')](''):[]);},'get':function(){return this[_0x5154('0x6')](_0x5154('0x4'))?this['getDataValue']('options')[_0x5154('0x7')](''):[];}},'auth':{'type':Sequelize[_0x5154('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x5154('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x5154('0x2')]},'description':{'type':Sequelize[_0x5154('0x2')]}}; \ No newline at end of file +var _0x96aa=['setDataValue','options','getDataValue','split','BOOLEAN','sequelize','exports','STRING'];(function(_0x210c74,_0x4e2446){var _0x2c6ffd=function(_0x434243){while(--_0x434243){_0x210c74['push'](_0x210c74['shift']());}};_0x2c6ffd(++_0x4e2446);}(_0x96aa,0x175));var _0xa96a=function(_0x4cc894,_0x2671f5){_0x4cc894=_0x4cc894-0x0;var _0x24f93e=_0x96aa[_0x4cc894];return _0x24f93e;};'use strict';var Sequelize=require(_0xa96a('0x0'));module[_0xa96a('0x1')]={'name':{'type':Sequelize[_0xa96a('0x2')]},'prefix':{'type':Sequelize[_0xa96a('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x206825){this[_0xa96a('0x3')](_0xa96a('0x4'),_0x206825?_0x206825['join'](''):[]);},'get':function(){return this[_0xa96a('0x5')](_0xa96a('0x4'))?this[_0xa96a('0x5')]('options')[_0xa96a('0x6')](''):[];}},'auth':{'type':Sequelize[_0xa96a('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xa96a('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xa96a('0x2')]},'description':{'type':Sequelize[_0xa96a('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 4efbb9a..bc02125 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 _0x851e=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../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','save','destroy','then','get','name','send','index','map','VoiceChanSpy','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x851e,0x1e8));var _0xe851=function(_0x556e75,_0x244403){_0x556e75=_0x556e75-0x0;var _0xd46094=_0x851e[_0x556e75];return _0xd46094;};'use strict';var emlformat=require(_0xe851('0x0'));var rimraf=require(_0xe851('0x1'));var zipdir=require(_0xe851('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe851('0x3'));var BPromise=require(_0xe851('0x4'));var Mustache=require(_0xe851('0x5'));var util=require(_0xe851('0x6'));var path=require(_0xe851('0x7'));var sox=require('sox');var csv=require(_0xe851('0x8'));var ejs=require(_0xe851('0x9'));var fs=require('fs');var fs_extra=require(_0xe851('0xa'));var _=require(_0xe851('0xb'));var squel=require(_0xe851('0xc'));var crypto=require('crypto');var jsforce=require(_0xe851('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe851('0xe'));var Papa=require(_0xe851('0xf'));var Redis=require(_0xe851('0x10'));var authService=require(_0xe851('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe851('0x12'));var hardwareService=require(_0xe851('0x13'));var logger=require(_0xe851('0x14'))('api');var utils=require(_0xe851('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe851('0x16'));var db=require(_0xe851('0x17'))['db'];function respondWithStatusCode(_0x5bb014,_0x2b76af){_0x2b76af=_0x2b76af||0xcc;return function(_0x4fff7e){if(_0x4fff7e){return _0x5bb014[_0xe851('0x18')](_0x2b76af);}return _0x5bb014['status'](_0x2b76af)[_0xe851('0x19')]();};}function respondWithResult(_0x32b54e,_0x5960f2){_0x5960f2=_0x5960f2||0xc8;return function(_0x391632){if(_0x391632){return _0x32b54e[_0xe851('0x1a')](_0x5960f2)[_0xe851('0x1b')](_0x391632);}};}function respondWithFilteredResult(_0x4e5195,_0x4d902d){return function(_0x11ba80){if(_0x11ba80){var _0x2f073c=typeof _0x4d902d[_0xe851('0x1c')]===_0xe851('0x1d')&&typeof _0x4d902d[_0xe851('0x1e')]===_0xe851('0x1d');var _0x53c7e0=_0x11ba80[_0xe851('0x1f')];var _0x48a1b3=_0x2f073c?0x0:_0x4d902d[_0xe851('0x1c')];var _0x55dd83=_0x2f073c?_0x11ba80[_0xe851('0x1f')]:_0x4d902d['offset']+_0x4d902d[_0xe851('0x1e')];var _0x2d8015;if(_0x55dd83>=_0x53c7e0){_0x55dd83=_0x53c7e0;_0x2d8015=0xc8;}else{_0x2d8015=0xce;}_0x4e5195[_0xe851('0x1a')](_0x2d8015);return _0x4e5195[_0xe851('0x20')](_0xe851('0x21'),_0x48a1b3+'-'+_0x55dd83+'/'+_0x53c7e0)[_0xe851('0x1b')](_0x11ba80);}return null;};}function patchUpdates(_0x37ab53){return function(_0x409796){try{jsonpatch['apply'](_0x409796,_0x37ab53,!![]);}catch(_0x238a5c){return BPromise['reject'](_0x238a5c);}return _0x409796[_0xe851('0x22')]();};}function saveUpdates(_0x545b9d,_0x3eb7f9){return function(_0x453392){if(_0x453392){return _0x453392['update'](_0x545b9d)['then'](function(_0x1d5aa2){return _0x1d5aa2;});}return null;};}function removeEntity(_0x44ccb3,_0x3bb018){return function(_0x181b19){if(_0x181b19){return _0x181b19[_0xe851('0x23')]()[_0xe851('0x24')](function(){var _0x4ce93a=_0x181b19[_0xe851('0x25')]({'plain':!![]});var _0x2d508='ChanSpies';return db['UserProfileResource'][_0xe851('0x23')]({'where':{'type':_0x2d508,'resourceId':_0x4ce93a['id']}})['then'](function(){return _0x181b19;});})[_0xe851('0x24')](function(){_0x44ccb3[_0xe851('0x1a')](0xcc)[_0xe851('0x19')]();});}};}function handleEntityNotFound(_0x2ff847,_0x1ad48e){return function(_0x1d4c78){if(!_0x1d4c78){_0x2ff847[_0xe851('0x18')](0x194);}return _0x1d4c78;};}function handleError(_0x4c67ee,_0x45771c){_0x45771c=_0x45771c||0x1f4;return function(_0x25f50a){logger['error'](_0x25f50a['stack']);if(_0x25f50a['name']){delete _0x25f50a[_0xe851('0x26')];}_0x4c67ee[_0xe851('0x1a')](_0x45771c)[_0xe851('0x27')](_0x25f50a);};}exports[_0xe851('0x28')]=function(_0x4ef1e2,_0x4d9d17){var _0x29f8d5={},_0x3d4ee3={},_0x160b7f={'count':0x0,'rows':[]};var _0x7d1569=_[_0xe851('0x29')](db[_0xe851('0x2a')][_0xe851('0x2b')],function(_0x592aa1){return{'name':_0x592aa1['fieldName'],'type':_0x592aa1[_0xe851('0x2c')][_0xe851('0x2d')]};});_0x3d4ee3[_0xe851('0x2e')]=_[_0xe851('0x29')](_0x7d1569,_0xe851('0x26'));_0x3d4ee3[_0xe851('0x2f')]=_[_0xe851('0x30')](_0x4ef1e2[_0xe851('0x2f')]);_0x3d4ee3[_0xe851('0x31')]=_[_0xe851('0x32')](_0x3d4ee3['model'],_0x3d4ee3[_0xe851('0x2f')]);_0x29f8d5[_0xe851('0x33')]=_[_0xe851('0x32')](_0x3d4ee3['model'],qs[_0xe851('0x34')](_0x4ef1e2[_0xe851('0x2f')]['fields']));_0x29f8d5[_0xe851('0x33')]=_0x29f8d5[_0xe851('0x33')][_0xe851('0x35')]?_0x29f8d5['attributes']:_0x3d4ee3[_0xe851('0x2e')];if(!_0x4ef1e2[_0xe851('0x2f')][_0xe851('0x36')](_0xe851('0x37'))){_0x29f8d5['limit']=qs[_0xe851('0x1e')](_0x4ef1e2[_0xe851('0x2f')][_0xe851('0x1e')]);_0x29f8d5['offset']=qs[_0xe851('0x1c')](_0x4ef1e2['query'][_0xe851('0x1c')]);}_0x29f8d5[_0xe851('0x38')]=qs[_0xe851('0x39')](_0x4ef1e2[_0xe851('0x2f')][_0xe851('0x39')]);_0x29f8d5[_0xe851('0x3a')]=qs[_0xe851('0x31')](_[_0xe851('0x3b')](_0x4ef1e2[_0xe851('0x2f')],_0x3d4ee3[_0xe851('0x31')]),_0x7d1569);if(_0x4ef1e2['query'][_0xe851('0x3c')]){_0x29f8d5['where']=_[_0xe851('0x3d')](_0x29f8d5[_0xe851('0x3a')],{'$or':_[_0xe851('0x29')](_0x7d1569,function(_0x189a1b){if(_0x189a1b['type']!==_0xe851('0x3e')){var _0x45d9f7={};_0x45d9f7[_0x189a1b[_0xe851('0x26')]]={'$like':'%'+_0x4ef1e2[_0xe851('0x2f')][_0xe851('0x3c')]+'%'};return _0x45d9f7;}})});}_0x29f8d5=_[_0xe851('0x3d')]({},_0x29f8d5,_0x4ef1e2[_0xe851('0x3f')]);var _0x577eec={'where':_0x29f8d5[_0xe851('0x3a')]};return db[_0xe851('0x2a')][_0xe851('0x1f')](_0x577eec)[_0xe851('0x24')](function(_0x4890b9){_0x160b7f['count']=_0x4890b9;if(_0x4ef1e2[_0xe851('0x2f')][_0xe851('0x40')]){_0x29f8d5[_0xe851('0x41')]=[{'all':!![]}];}return db[_0xe851('0x2a')][_0xe851('0x42')](_0x29f8d5);})[_0xe851('0x24')](function(_0x355f76){_0x160b7f[_0xe851('0x43')]=_0x355f76;return _0x160b7f;})['then'](respondWithFilteredResult(_0x4d9d17,_0x29f8d5))['catch'](handleError(_0x4d9d17,null));};exports[_0xe851('0x44')]=function(_0x2d0768,_0x3df1e9){var _0x1fdda8={'raw':![],'where':{'id':_0x2d0768[_0xe851('0x45')]['id']}},_0x487346={};_0x487346[_0xe851('0x2e')]=_[_0xe851('0x30')](db['VoiceChanSpy'][_0xe851('0x2b')]);_0x487346[_0xe851('0x2f')]=_[_0xe851('0x30')](_0x2d0768[_0xe851('0x2f')]);_0x487346[_0xe851('0x31')]=_[_0xe851('0x32')](_0x487346[_0xe851('0x2e')],_0x487346['query']);_0x1fdda8['attributes']=_['intersection'](_0x487346['model'],qs[_0xe851('0x34')](_0x2d0768[_0xe851('0x2f')][_0xe851('0x34')]));_0x1fdda8[_0xe851('0x33')]=_0x1fdda8[_0xe851('0x33')][_0xe851('0x35')]?_0x1fdda8[_0xe851('0x33')]:_0x487346['model'];if(_0x2d0768[_0xe851('0x2f')][_0xe851('0x40')]){_0x1fdda8[_0xe851('0x41')]=[{'all':!![]}];}_0x1fdda8=_['merge']({},_0x1fdda8,_0x2d0768[_0xe851('0x3f')]);return db[_0xe851('0x2a')][_0xe851('0x46')](_0x1fdda8)[_0xe851('0x24')](handleEntityNotFound(_0x3df1e9,null))[_0xe851('0x24')](respondWithResult(_0x3df1e9,null))[_0xe851('0x47')](handleError(_0x3df1e9,null));};exports[_0xe851('0x48')]=function(_0x4662da,_0x1fb5ed){return db[_0xe851('0x2a')][_0xe851('0x48')](_0x4662da[_0xe851('0x49')],{})['then'](function(_0x328646){var _0x54782d=_0x4662da[_0xe851('0x4a')][_0xe851('0x25')]({'plain':!![]});if(!_0x54782d)throw new Error(_0xe851('0x4b'));if(_0x54782d[_0xe851('0x4c')]===_0xe851('0x4a')){var _0x5458f6=_0x328646[_0xe851('0x25')]({'plain':!![]});var _0x3c7f7c='ChanSpies';return db['UserProfileSection']['find']({'where':{'name':_0x3c7f7c,'userProfileId':_0x54782d[_0xe851('0x4d')]},'raw':!![]})[_0xe851('0x24')](function(_0x42e954){if(_0x42e954&&_0x42e954[_0xe851('0x4e')]===0x0){return db[_0xe851('0x4f')][_0xe851('0x48')]({'name':_0x5458f6[_0xe851('0x26')],'resourceId':_0x5458f6['id'],'type':_0x42e954[_0xe851('0x26')],'sectionId':_0x42e954['id']},{})[_0xe851('0x24')](function(){return _0x328646;});}else{return _0x328646;}})[_0xe851('0x47')](function(_0xc32db4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc32db4);throw _0xc32db4;});}return _0x328646;})[_0xe851('0x24')](respondWithResult(_0x1fb5ed,0xc9))[_0xe851('0x47')](handleError(_0x1fb5ed,null));};exports['update']=function(_0x341ae9,_0x52eccd){if(_0x341ae9[_0xe851('0x49')]['id']){delete _0x341ae9[_0xe851('0x49')]['id'];}return db[_0xe851('0x2a')][_0xe851('0x46')]({'where':{'id':_0x341ae9[_0xe851('0x45')]['id']}})[_0xe851('0x24')](handleEntityNotFound(_0x52eccd,null))[_0xe851('0x24')](saveUpdates(_0x341ae9[_0xe851('0x49')],null))[_0xe851('0x24')](respondWithResult(_0x52eccd,null))[_0xe851('0x47')](handleError(_0x52eccd,null));};exports[_0xe851('0x23')]=function(_0x1ff342,_0x482b6d){return db[_0xe851('0x2a')][_0xe851('0x46')]({'where':{'id':_0x1ff342['params']['id']}})[_0xe851('0x24')](handleEntityNotFound(_0x482b6d,null))[_0xe851('0x24')](removeEntity(_0x482b6d,null))[_0xe851('0x47')](handleError(_0x482b6d,null));}; \ No newline at end of file +var _0x82b0=['stack','name','send','index','map','VoiceChanSpy','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','ChanSpies','UserProfileResource','sendStatus'];(function(_0x5149c7,_0xfd2f67){var _0x5010b0=function(_0x408cb0){while(--_0x408cb0){_0x5149c7['push'](_0x5149c7['shift']());}};_0x5010b0(++_0xfd2f67);}(_0x82b0,0x81));var _0x082b=function(_0x367995,_0x129ae2){_0x367995=_0x367995-0x0;var _0x22daa8=_0x82b0[_0x367995];return _0x22daa8;};'use strict';var emlformat=require(_0x082b('0x0'));var rimraf=require(_0x082b('0x1'));var zipdir=require(_0x082b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x082b('0x3'));var moment=require(_0x082b('0x4'));var BPromise=require(_0x082b('0x5'));var Mustache=require(_0x082b('0x6'));var util=require('util');var path=require(_0x082b('0x7'));var sox=require(_0x082b('0x8'));var csv=require(_0x082b('0x9'));var ejs=require(_0x082b('0xa'));var fs=require('fs');var fs_extra=require(_0x082b('0xb'));var _=require('lodash');var squel=require(_0x082b('0xc'));var crypto=require(_0x082b('0xd'));var jsforce=require(_0x082b('0xe'));var deskjs=require(_0x082b('0xf'));var toCsv=require(_0x082b('0x9'));var querystring=require(_0x082b('0x10'));var Papa=require(_0x082b('0x11'));var Redis=require(_0x082b('0x12'));var authService=require(_0x082b('0x13'));var qs=require(_0x082b('0x14'));var as=require(_0x082b('0x15'));var hardwareService=require(_0x082b('0x16'));var logger=require(_0x082b('0x17'))(_0x082b('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x082b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54bffb,_0x1c1f9d){_0x1c1f9d=_0x1c1f9d||0xcc;return function(_0x324251){if(_0x324251){return _0x54bffb['sendStatus'](_0x1c1f9d);}return _0x54bffb[_0x082b('0x1a')](_0x1c1f9d)[_0x082b('0x1b')]();};}function respondWithResult(_0x27bc44,_0x1f0c32){_0x1f0c32=_0x1f0c32||0xc8;return function(_0x40e206){if(_0x40e206){return _0x27bc44['status'](_0x1f0c32)[_0x082b('0x1c')](_0x40e206);}};}function respondWithFilteredResult(_0x1dc46e,_0x49db08){return function(_0x2c4f86){if(_0x2c4f86){var _0x588d8a=typeof _0x49db08[_0x082b('0x1d')]===_0x082b('0x1e')&&typeof _0x49db08['limit']===_0x082b('0x1e');var _0x4785fb=_0x2c4f86[_0x082b('0x1f')];var _0x3aa0ed=_0x588d8a?0x0:_0x49db08['offset'];var _0x2772e9=_0x588d8a?_0x2c4f86[_0x082b('0x1f')]:_0x49db08[_0x082b('0x1d')]+_0x49db08[_0x082b('0x20')];var _0x1e8fa5;if(_0x2772e9>=_0x4785fb){_0x2772e9=_0x4785fb;_0x1e8fa5=0xc8;}else{_0x1e8fa5=0xce;}_0x1dc46e[_0x082b('0x1a')](_0x1e8fa5);return _0x1dc46e[_0x082b('0x21')](_0x082b('0x22'),_0x3aa0ed+'-'+_0x2772e9+'/'+_0x4785fb)['json'](_0x2c4f86);}return null;};}function patchUpdates(_0x9faf2){return function(_0x2fffc3){try{jsonpatch[_0x082b('0x23')](_0x2fffc3,_0x9faf2,!![]);}catch(_0x5aab0a){return BPromise[_0x082b('0x24')](_0x5aab0a);}return _0x2fffc3[_0x082b('0x25')]();};}function saveUpdates(_0x42c0ab,_0x56fbd2){return function(_0x47c0d9){if(_0x47c0d9){return _0x47c0d9[_0x082b('0x26')](_0x42c0ab)['then'](function(_0x5cb670){return _0x5cb670;});}return null;};}function removeEntity(_0x3ae657,_0xaa7eb){return function(_0x271340){if(_0x271340){return _0x271340[_0x082b('0x27')]()[_0x082b('0x28')](function(){var _0x4ed723=_0x271340[_0x082b('0x29')]({'plain':!![]});var _0x1254fd=_0x082b('0x2a');return db[_0x082b('0x2b')][_0x082b('0x27')]({'where':{'type':_0x1254fd,'resourceId':_0x4ed723['id']}})[_0x082b('0x28')](function(){return _0x271340;});})[_0x082b('0x28')](function(){_0x3ae657['status'](0xcc)[_0x082b('0x1b')]();});}};}function handleEntityNotFound(_0x5ee68e,_0x2155d4){return function(_0x4d102b){if(!_0x4d102b){_0x5ee68e[_0x082b('0x2c')](0x194);}return _0x4d102b;};}function handleError(_0x15c093,_0x545fd6){_0x545fd6=_0x545fd6||0x1f4;return function(_0x2279d7){logger['error'](_0x2279d7[_0x082b('0x2d')]);if(_0x2279d7['name']){delete _0x2279d7[_0x082b('0x2e')];}_0x15c093[_0x082b('0x1a')](_0x545fd6)[_0x082b('0x2f')](_0x2279d7);};}exports[_0x082b('0x30')]=function(_0x2f4e63,_0x219baa){var _0x3194d5={},_0x2c9197={},_0xab3a99={'count':0x0,'rows':[]};var _0x40ee66=_[_0x082b('0x31')](db[_0x082b('0x32')]['rawAttributes'],function(_0x2ed47f){return{'name':_0x2ed47f[_0x082b('0x33')],'type':_0x2ed47f[_0x082b('0x34')][_0x082b('0x35')]};});_0x2c9197[_0x082b('0x36')]=_['map'](_0x40ee66,'name');_0x2c9197[_0x082b('0x37')]=_[_0x082b('0x38')](_0x2f4e63['query']);_0x2c9197[_0x082b('0x39')]=_[_0x082b('0x3a')](_0x2c9197['model'],_0x2c9197[_0x082b('0x37')]);_0x3194d5['attributes']=_[_0x082b('0x3a')](_0x2c9197[_0x082b('0x36')],qs['fields'](_0x2f4e63[_0x082b('0x37')][_0x082b('0x3b')]));_0x3194d5[_0x082b('0x3c')]=_0x3194d5[_0x082b('0x3c')][_0x082b('0x3d')]?_0x3194d5['attributes']:_0x2c9197[_0x082b('0x36')];if(!_0x2f4e63['query'][_0x082b('0x3e')](_0x082b('0x3f'))){_0x3194d5[_0x082b('0x20')]=qs[_0x082b('0x20')](_0x2f4e63[_0x082b('0x37')][_0x082b('0x20')]);_0x3194d5[_0x082b('0x1d')]=qs[_0x082b('0x1d')](_0x2f4e63['query'][_0x082b('0x1d')]);}_0x3194d5[_0x082b('0x40')]=qs['sort'](_0x2f4e63[_0x082b('0x37')][_0x082b('0x41')]);_0x3194d5[_0x082b('0x42')]=qs[_0x082b('0x39')](_[_0x082b('0x43')](_0x2f4e63[_0x082b('0x37')],_0x2c9197[_0x082b('0x39')]),_0x40ee66);if(_0x2f4e63[_0x082b('0x37')]['filter']){_0x3194d5[_0x082b('0x42')]=_[_0x082b('0x44')](_0x3194d5[_0x082b('0x42')],{'$or':_[_0x082b('0x31')](_0x40ee66,function(_0x494e9e){if(_0x494e9e[_0x082b('0x34')]!==_0x082b('0x45')){var _0x2fb0a3={};_0x2fb0a3[_0x494e9e[_0x082b('0x2e')]]={'$like':'%'+_0x2f4e63[_0x082b('0x37')]['filter']+'%'};return _0x2fb0a3;}})});}_0x3194d5=_[_0x082b('0x44')]({},_0x3194d5,_0x2f4e63[_0x082b('0x46')]);var _0x4d8235={'where':_0x3194d5[_0x082b('0x42')]};return db[_0x082b('0x32')]['count'](_0x4d8235)[_0x082b('0x28')](function(_0xfb034d){_0xab3a99[_0x082b('0x1f')]=_0xfb034d;if(_0x2f4e63[_0x082b('0x37')][_0x082b('0x47')]){_0x3194d5[_0x082b('0x48')]=[{'all':!![]}];}return db[_0x082b('0x32')][_0x082b('0x49')](_0x3194d5);})[_0x082b('0x28')](function(_0x5ed239){_0xab3a99[_0x082b('0x4a')]=_0x5ed239;return _0xab3a99;})[_0x082b('0x28')](respondWithFilteredResult(_0x219baa,_0x3194d5))[_0x082b('0x4b')](handleError(_0x219baa,null));};exports[_0x082b('0x4c')]=function(_0x530cb4,_0x34a3e4){var _0x19cca1={'raw':![],'where':{'id':_0x530cb4['params']['id']}},_0xfa87a8={};_0xfa87a8[_0x082b('0x36')]=_[_0x082b('0x38')](db[_0x082b('0x32')][_0x082b('0x4d')]);_0xfa87a8[_0x082b('0x37')]=_[_0x082b('0x38')](_0x530cb4['query']);_0xfa87a8[_0x082b('0x39')]=_[_0x082b('0x3a')](_0xfa87a8[_0x082b('0x36')],_0xfa87a8[_0x082b('0x37')]);_0x19cca1[_0x082b('0x3c')]=_[_0x082b('0x3a')](_0xfa87a8[_0x082b('0x36')],qs[_0x082b('0x3b')](_0x530cb4['query'][_0x082b('0x3b')]));_0x19cca1[_0x082b('0x3c')]=_0x19cca1[_0x082b('0x3c')]['length']?_0x19cca1[_0x082b('0x3c')]:_0xfa87a8[_0x082b('0x36')];if(_0x530cb4['query'][_0x082b('0x47')]){_0x19cca1['include']=[{'all':!![]}];}_0x19cca1=_[_0x082b('0x44')]({},_0x19cca1,_0x530cb4[_0x082b('0x46')]);return db[_0x082b('0x32')]['find'](_0x19cca1)[_0x082b('0x28')](handleEntityNotFound(_0x34a3e4,null))['then'](respondWithResult(_0x34a3e4,null))[_0x082b('0x4b')](handleError(_0x34a3e4,null));};exports['create']=function(_0x3d043c,_0x518f6b){return db[_0x082b('0x32')][_0x082b('0x4e')](_0x3d043c[_0x082b('0x4f')],{})[_0x082b('0x28')](function(_0x299d76){var _0x14a1ed=_0x3d043c[_0x082b('0x50')]['get']({'plain':!![]});if(!_0x14a1ed)throw new Error(_0x082b('0x51'));if(_0x14a1ed[_0x082b('0x52')]===_0x082b('0x50')){var _0x57ed0a=_0x299d76[_0x082b('0x29')]({'plain':!![]});var _0x41d21c=_0x082b('0x2a');return db[_0x082b('0x53')][_0x082b('0x54')]({'where':{'name':_0x41d21c,'userProfileId':_0x14a1ed[_0x082b('0x55')]},'raw':!![]})[_0x082b('0x28')](function(_0x5c6055){if(_0x5c6055&&_0x5c6055['autoAssociation']===0x0){return db[_0x082b('0x2b')]['create']({'name':_0x57ed0a[_0x082b('0x2e')],'resourceId':_0x57ed0a['id'],'type':_0x5c6055[_0x082b('0x2e')],'sectionId':_0x5c6055['id']},{})[_0x082b('0x28')](function(){return _0x299d76;});}else{return _0x299d76;}})['catch'](function(_0x4a48f8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a48f8);throw _0x4a48f8;});}return _0x299d76;})[_0x082b('0x28')](respondWithResult(_0x518f6b,0xc9))[_0x082b('0x4b')](handleError(_0x518f6b,null));};exports['update']=function(_0x397f3d,_0x35ffad){if(_0x397f3d[_0x082b('0x4f')]['id']){delete _0x397f3d[_0x082b('0x4f')]['id'];}return db['VoiceChanSpy'][_0x082b('0x54')]({'where':{'id':_0x397f3d[_0x082b('0x56')]['id']}})[_0x082b('0x28')](handleEntityNotFound(_0x35ffad,null))[_0x082b('0x28')](saveUpdates(_0x397f3d[_0x082b('0x4f')],null))['then'](respondWithResult(_0x35ffad,null))[_0x082b('0x4b')](handleError(_0x35ffad,null));};exports[_0x082b('0x27')]=function(_0x4a5896,_0x22964b){return db[_0x082b('0x32')]['find']({'where':{'id':_0x4a5896[_0x082b('0x56')]['id']}})['then'](handleEntityNotFound(_0x22964b,null))[_0x082b('0x28')](removeEntity(_0x22964b,null))[_0x082b('0x4b')](handleError(_0x22964b,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index a07817b..73adac0 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 _0xfd51=['internal','User','then','exports','models','define','bulkCreate','catch','VoiceExtension','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','from-sip','format','prefix','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xfd51,0x1aa));var _0x1fd5=function(_0x47fc4f,_0x5addfd){_0x47fc4f=_0x47fc4f-0x0;var _0x469cf5=_0xfd51[_0x47fc4f];return _0x469cf5;};'use strict';var _=require(_0x1fd5('0x0'));var util=require(_0x1fd5('0x1'));var BPromise=require(_0x1fd5('0x2'));var attributes=require(_0x1fd5('0x3'));var getUserApplications=function(_0x48f38b,_0x226c20,_0x41e813){var _0x593495=0x1;var _0x30b332=[];var _0x30d792={'context':_0x226c20['context']||_0x1fd5('0x4'),'exten':util[_0x1fd5('0x5')]('%s%s',_0x48f38b[_0x1fd5('0x6')],_0x41e813),'type':'system','isApp':![],'ChanSpyId':_0x48f38b['id'],'UserId':_0x226c20['id']};_0x30b332[_0x1fd5('0x7')](_[_0x1fd5('0x8')]({'app':_0x1fd5('0x9'),'appdata':util[_0x1fd5('0x5')](_0x1fd5('0xa'),_0x1fd5('0xb')),'priority':_0x593495++},_0x30d792));if(_0x48f38b[_0x1fd5('0xc')]){_0x30b332[_0x1fd5('0x7')](_[_0x1fd5('0x8')]({'app':_0x1fd5('0xd'),'appdata':util[_0x1fd5('0x5')](_0x1fd5('0xe'),_0x48f38b['recordingFormat']),'priority':_0x593495++},_0x30d792));}if(_0x48f38b['auth']){_0x30b332[_0x1fd5('0x7')](_[_0x1fd5('0x8')]({'app':'Authenticate','appdata':_0x48f38b['password'],'priority':_0x593495++},_0x30d792));}_0x30b332['push'](_[_0x1fd5('0x8')]({'app':'ChanSpy','appdata':util['format'](_0x1fd5('0xf'),_0x226c20[_0x1fd5('0x10')],_0x48f38b[_0x1fd5('0x11')]?_0x48f38b[_0x1fd5('0x11')][_0x1fd5('0x12')](''):''),'priority':_0x593495++},_0x30d792));if(_0x48f38b[_0x1fd5('0xc')]){_0x30b332[_0x1fd5('0x7')](_[_0x1fd5('0x8')]({'app':_0x1fd5('0x13'),'priority':_0x593495++},_0x30d792));}return _0x30b332;};var getChanSpyApplications=function(_0xd51ea3,_0x37fd73){var _0x203398=[];for(var _0x57202a=0x0,_0xe8529f=0x1;_0x57202a<_0x37fd73[_0x1fd5('0x14')];_0x57202a++,_0xe8529f=0x1){_0x203398=_0x203398[_0x1fd5('0x15')](getUserApplications(_0xd51ea3,_0x37fd73[_0x57202a],_0x37fd73[_0x57202a][_0x1fd5('0x16')]));if(_0x37fd73[_0x57202a]['internal']!=_0x37fd73[_0x57202a][_0x1fd5('0x10')]){_0x203398=_0x203398[_0x1fd5('0x15')](getUserApplications(_0xd51ea3,_0x37fd73[_0x57202a],_0x37fd73[_0x57202a][_0x1fd5('0x10')]));}}return _0x203398;};var getChanSpyPromise=function(_0x5cf7fe,_0x2590d4){return new BPromise(function(_0x156dfb,_0x38501d){return _0x5cf7fe[_0x1fd5('0x17')]['findAll']({'attributes':['id','name','internal'],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x1fd5('0x18')](function(_0x17b798){if(_0x17b798){return _0x156dfb(getChanSpyApplications(_0x2590d4,_0x17b798));}return _0x156dfb([]);})['catch'](function(_0x44df99){_0x38501d(_0x44df99);});});};module[_0x1fd5('0x19')]=function(_0x11e080,_0x8850ef){var _0x2c8111=_0x11e080[_0x1fd5('0x1a')];return _0x11e080[_0x1fd5('0x1b')]('VoiceChanSpy',attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3d1aa5,_0x5bb4af,_0x2ca373){return getChanSpyPromise(_0x2c8111,_0x3d1aa5)[_0x1fd5('0x18')](function(_0x424cee){if(_0x424cee&&_0x424cee[_0x1fd5('0x14')]){return _0x2c8111['VoiceExtension'][_0x1fd5('0x1c')](_0x424cee);}})[_0x1fd5('0x18')](function(){_0x2ca373();})[_0x1fd5('0x1d')](function(_0x40bba2){_0x2ca373(_0x40bba2);});},'afterUpdate':function(_0xcde51a,_0x3e486d,_0x3eaf13){return _0x2c8111[_0x1fd5('0x1e')][_0x1fd5('0x1f')]({'where':{'ChanSpyId':_0xcde51a['id']}})[_0x1fd5('0x18')](function(){return getChanSpyPromise(_0x2c8111,_0xcde51a);})['then'](function(_0x593325){if(_0x593325&&_0x593325[_0x1fd5('0x14')]){return _0x2c8111[_0x1fd5('0x1e')][_0x1fd5('0x1c')](_0x593325);}})['then'](function(){_0x3eaf13();})['catch'](function(_0x149f6d){_0x3eaf13(_0x149f6d);});},'afterDestroy':function(_0xa73d8,_0x418eb7,_0x29130a){return _0x2c8111[_0x1fd5('0x1e')][_0x1fd5('0x1f')]({'where':{'ChanSpyId':_0xa73d8['id']}})['then'](function(){_0x29130a();})[_0x1fd5('0x1d')](function(_0x4e62ad){_0x29130a(_0x4e62ad);});}}});}; \ No newline at end of file +var _0xfa18=['recordingFormat','auth','merge','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','agent','catch','exports','define','VoiceChanSpy','voice_chanspy','then','VoiceExtension','bulkCreate','destroy','lodash','./voiceChanSpy.attributes','context','format','%s%s','prefix','system','Set','CDR(type)=%s','chanspy','record','push','MixMonitor'];(function(_0x42dd6c,_0x4ea28c){var _0x3346a2=function(_0x17877b){while(--_0x17877b){_0x42dd6c['push'](_0x42dd6c['shift']());}};_0x3346a2(++_0x4ea28c);}(_0xfa18,0xd7));var _0x8fa1=function(_0x344b3c,_0x524c9e){_0x344b3c=_0x344b3c-0x0;var _0x2613f8=_0xfa18[_0x344b3c];return _0x2613f8;};'use strict';var _=require(_0x8fa1('0x0'));var util=require('util');var BPromise=require('bluebird');var attributes=require(_0x8fa1('0x1'));var getUserApplications=function(_0x467d1a,_0x5854e8,_0x4d174d){var _0x3d1a1f=0x1;var _0x19ecba=[];var _0x4d073f={'context':_0x5854e8[_0x8fa1('0x2')]||'from-sip','exten':util[_0x8fa1('0x3')](_0x8fa1('0x4'),_0x467d1a[_0x8fa1('0x5')],_0x4d174d),'type':_0x8fa1('0x6'),'isApp':![],'ChanSpyId':_0x467d1a['id'],'UserId':_0x5854e8['id']};_0x19ecba['push'](_['merge']({'app':_0x8fa1('0x7'),'appdata':util['format'](_0x8fa1('0x8'),_0x8fa1('0x9')),'priority':_0x3d1a1f++},_0x4d073f));if(_0x467d1a[_0x8fa1('0xa')]){_0x19ecba[_0x8fa1('0xb')](_['merge']({'app':_0x8fa1('0xc'),'appdata':util['format']('${UNIQUEID}.%s,a',_0x467d1a[_0x8fa1('0xd')]),'priority':_0x3d1a1f++},_0x4d073f));}if(_0x467d1a[_0x8fa1('0xe')]){_0x19ecba[_0x8fa1('0xb')](_[_0x8fa1('0xf')]({'app':'Authenticate','appdata':_0x467d1a[_0x8fa1('0x10')],'priority':_0x3d1a1f++},_0x4d073f));}_0x19ecba[_0x8fa1('0xb')](_[_0x8fa1('0xf')]({'app':_0x8fa1('0x11'),'appdata':util['format'](_0x8fa1('0x12'),_0x5854e8[_0x8fa1('0x13')],_0x467d1a[_0x8fa1('0x14')]?_0x467d1a[_0x8fa1('0x14')][_0x8fa1('0x15')](''):''),'priority':_0x3d1a1f++},_0x4d073f));if(_0x467d1a[_0x8fa1('0xa')]){_0x19ecba[_0x8fa1('0xb')](_[_0x8fa1('0xf')]({'app':_0x8fa1('0x16'),'priority':_0x3d1a1f++},_0x4d073f));}return _0x19ecba;};var getChanSpyApplications=function(_0x46405f,_0x1769a8){var _0x3c9cde=[];for(var _0x5de447=0x0,_0x491585=0x1;_0x5de447<_0x1769a8[_0x8fa1('0x17')];_0x5de447++,_0x491585=0x1){_0x3c9cde=_0x3c9cde[_0x8fa1('0x18')](getUserApplications(_0x46405f,_0x1769a8[_0x5de447],_0x1769a8[_0x5de447]['internal']));if(_0x1769a8[_0x5de447][_0x8fa1('0x19')]!=_0x1769a8[_0x5de447][_0x8fa1('0x13')]){_0x3c9cde=_0x3c9cde[_0x8fa1('0x18')](getUserApplications(_0x46405f,_0x1769a8[_0x5de447],_0x1769a8[_0x5de447][_0x8fa1('0x13')]));}}return _0x3c9cde;};var getChanSpyPromise=function(_0x245a41,_0x5e0b0e){return new BPromise(function(_0xf77a2,_0x4270a5){return _0x245a41[_0x8fa1('0x1a')][_0x8fa1('0x1b')]({'attributes':['id','name',_0x8fa1('0x19')],'where':{'role':_0x8fa1('0x1c'),'chanspy':!![]},'raw':!![]})['then'](function(_0x183397){if(_0x183397){return _0xf77a2(getChanSpyApplications(_0x5e0b0e,_0x183397));}return _0xf77a2([]);})[_0x8fa1('0x1d')](function(_0x7bc935){_0x4270a5(_0x7bc935);});});};module[_0x8fa1('0x1e')]=function(_0x108cc5,_0x40e6c6){var _0x7589fc=_0x108cc5['models'];return _0x108cc5[_0x8fa1('0x1f')](_0x8fa1('0x20'),attributes,{'tableName':_0x8fa1('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x590cdb,_0x32a85b,_0x1aca2f){return getChanSpyPromise(_0x7589fc,_0x590cdb)[_0x8fa1('0x22')](function(_0x1cccc6){if(_0x1cccc6&&_0x1cccc6[_0x8fa1('0x17')]){return _0x7589fc[_0x8fa1('0x23')][_0x8fa1('0x24')](_0x1cccc6);}})[_0x8fa1('0x22')](function(){_0x1aca2f();})[_0x8fa1('0x1d')](function(_0x372a04){_0x1aca2f(_0x372a04);});},'afterUpdate':function(_0x4cf66e,_0x4ac444,_0x481e61){return _0x7589fc[_0x8fa1('0x23')][_0x8fa1('0x25')]({'where':{'ChanSpyId':_0x4cf66e['id']}})['then'](function(){return getChanSpyPromise(_0x7589fc,_0x4cf66e);})[_0x8fa1('0x22')](function(_0x4e93d9){if(_0x4e93d9&&_0x4e93d9['length']){return _0x7589fc[_0x8fa1('0x23')][_0x8fa1('0x24')](_0x4e93d9);}})[_0x8fa1('0x22')](function(){_0x481e61();})[_0x8fa1('0x1d')](function(_0x32d566){_0x481e61(_0x32d566);});},'afterDestroy':function(_0x331f1a,_0x2a23a8,_0x4ba7d4){return _0x7589fc['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x331f1a['id']}})[_0x8fa1('0x22')](function(){_0x4ba7d4();})[_0x8fa1('0x1d')](function(_0x4d869c){_0x4ba7d4(_0x4d869c);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 2202b61..3a7cda8 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 _0xc901=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','lodash'];(function(_0x13567e,_0x32f315){var _0x38d74f=function(_0x252126){while(--_0x252126){_0x13567e['push'](_0x13567e['shift']());}};_0x38d74f(++_0x32f315);}(_0xc901,0x142));var _0x1c90=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc901[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x1c90('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c90('0x1'));var db=require(_0x1c90('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c90('0x3'))(_0x1c90('0x4'));var config=require(_0x1c90('0x5'));var jayson=require(_0x1c90('0x6'));var client=jayson[_0x1c90('0x7')][_0x1c90('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x912860,_0x12c07d,_0x423cfb){return new BPromise(function(_0x19196f,_0x514386){return client[_0x1c90('0x9')](_0x912860,_0x423cfb)[_0x1c90('0xa')](function(_0x38cd18){logger[_0x1c90('0xb')](_0x1c90('0xc'),_0x12c07d,_0x1c90('0xd'));logger[_0x1c90('0xe')](_0x1c90('0xf'),_0x12c07d,'request\x20sent',JSON['stringify'](_0x38cd18));if(_0x38cd18[_0x1c90('0x10')]){if(_0x38cd18[_0x1c90('0x10')][_0x1c90('0x11')]===0x1f4){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x12c07d,_0x38cd18[_0x1c90('0x10')][_0x1c90('0x12')]);return _0x514386(_0x38cd18['error'][_0x1c90('0x12')]);}logger[_0x1c90('0x10')](_0x1c90('0xc'),_0x12c07d,_0x38cd18['error'][_0x1c90('0x12')]);return _0x19196f(_0x38cd18['error'][_0x1c90('0x12')]);}else{logger[_0x1c90('0xb')](_0x1c90('0xc'),_0x12c07d,_0x1c90('0xd'));_0x19196f(_0x38cd18['result'][_0x1c90('0x12')]);}})['catch'](function(_0x2d3c90){logger[_0x1c90('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x12c07d,_0x2d3c90);_0x514386(_0x2d3c90);});});} \ No newline at end of file +var _0x57f8=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x298378,_0x84f466){var _0x467ced=function(_0xe6b6e9){while(--_0xe6b6e9){_0x298378['push'](_0x298378['shift']());}};_0x467ced(++_0x84f466);}(_0x57f8,0x198));var _0x857f=function(_0x424a50,_0x1fd66d){_0x424a50=_0x424a50-0x0;var _0x1427b2=_0x57f8[_0x424a50];return _0x1427b2;};'use strict';var _=require('lodash');var util=require(_0x857f('0x0'));var moment=require(_0x857f('0x1'));var BPromise=require(_0x857f('0x2'));var rs=require(_0x857f('0x3'));var fs=require('fs');var Redis=require(_0x857f('0x4'));var db=require(_0x857f('0x5'))['db'];var utils=require(_0x857f('0x6'));var logger=require(_0x857f('0x7'))(_0x857f('0x8'));var config=require(_0x857f('0x9'));var jayson=require(_0x857f('0xa'));var client=jayson[_0x857f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8380e8,_0x197098,_0x1aaeea){return new BPromise(function(_0x577fc3,_0x5f6a66){return client[_0x857f('0xc')](_0x8380e8,_0x1aaeea)[_0x857f('0xd')](function(_0x4f2b09){logger[_0x857f('0xe')](_0x857f('0xf'),_0x197098,_0x857f('0x10'));logger['debug'](_0x857f('0x11'),_0x197098,_0x857f('0x10'),JSON[_0x857f('0x12')](_0x4f2b09));if(_0x4f2b09[_0x857f('0x13')]){if(_0x4f2b09[_0x857f('0x13')][_0x857f('0x14')]===0x1f4){logger[_0x857f('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x197098,_0x4f2b09[_0x857f('0x13')][_0x857f('0x15')]);return _0x5f6a66(_0x4f2b09[_0x857f('0x13')][_0x857f('0x15')]);}logger[_0x857f('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x197098,_0x4f2b09['error'][_0x857f('0x15')]);return _0x577fc3(_0x4f2b09['error'][_0x857f('0x15')]);}else{logger['info'](_0x857f('0xf'),_0x197098,_0x857f('0x10'));_0x577fc3(_0x4f2b09['result'][_0x857f('0x15')]);}})[_0x857f('0x16')](function(_0xdf14fe){logger[_0x857f('0x13')](_0x857f('0xf'),_0x197098,_0xdf14fe);_0x5f6a66(_0xdf14fe);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index f1be009..348f877 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 _0x2c26=['get','index','/:id','isAuthenticated','show','post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller'];(function(_0x2cf818,_0x1cd613){var _0x4c1fc7=function(_0x38e72f){while(--_0x38e72f){_0x2cf818['push'](_0x2cf818['shift']());}};_0x4c1fc7(++_0x1cd613);}(_0x2c26,0x1ae));var _0x62c2=function(_0x11541a,_0x1dd673){_0x11541a=_0x11541a-0x0;var _0x5dded5=_0x2c26[_0x11541a];return _0x5dded5;};'use strict';var multer=require(_0x62c2('0x0'));var util=require(_0x62c2('0x1'));var path=require(_0x62c2('0x2'));var timeout=require(_0x62c2('0x3'));var express=require(_0x62c2('0x4'));var router=express[_0x62c2('0x5')]();var fs_extra=require(_0x62c2('0x6'));var auth=require(_0x62c2('0x7'));var interaction=require(_0x62c2('0x8'));var config=require(_0x62c2('0x9'));var controller=require(_0x62c2('0xa'));router[_0x62c2('0xb')]('/',auth['isAuthenticated'](),controller[_0x62c2('0xc')]);router[_0x62c2('0xb')](_0x62c2('0xd'),auth[_0x62c2('0xe')](),controller[_0x62c2('0xf')]);router[_0x62c2('0x10')]('/',auth[_0x62c2('0xe')](),controller[_0x62c2('0x11')]);router[_0x62c2('0x12')](_0x62c2('0xd'),auth[_0x62c2('0xe')](),controller[_0x62c2('0x13')]);router[_0x62c2('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd41d=['express','fs-extra','../../components/interaction/service','./voiceContext.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x261b2c,_0xdb87c){var _0x35a619=function(_0x53fae2){while(--_0x53fae2){_0x261b2c['push'](_0x261b2c['shift']());}};_0x35a619(++_0xdb87c);}(_0xd41d,0x11c));var _0xdd41=function(_0x436882,_0x773db9){_0x436882=_0x436882-0x0;var _0x47c573=_0xd41d[_0x436882];return _0x47c573;};'use strict';var multer=require(_0xdd41('0x0'));var util=require(_0xdd41('0x1'));var path=require(_0xdd41('0x2'));var timeout=require(_0xdd41('0x3'));var express=require(_0xdd41('0x4'));var router=express['Router']();var fs_extra=require(_0xdd41('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdd41('0x6'));var config=require('../../config/environment');var controller=require(_0xdd41('0x7'));router[_0xdd41('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xdd41('0x9'),auth[_0xdd41('0xa')](),controller[_0xdd41('0xb')]);router[_0xdd41('0xc')]('/',auth[_0xdd41('0xa')](),controller[_0xdd41('0xd')]);router[_0xdd41('0xe')]('/:id',auth[_0xdd41('0xa')](),controller[_0xdd41('0xf')]);router[_0xdd41('0x10')]('/:id',auth[_0xdd41('0xa')](),controller[_0xdd41('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 988af0b..85ca78c 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 _0x995c=['STRING','sequelize','exports','name'];(function(_0x5dff5b,_0x600c5d){var _0x34dd83=function(_0x9830f8){while(--_0x9830f8){_0x5dff5b['push'](_0x5dff5b['shift']());}};_0x34dd83(++_0x600c5d);}(_0x995c,0x179));var _0xc995=function(_0x5e01bc,_0x1e745b){_0x5e01bc=_0x5e01bc-0x0;var _0x3ad966=_0x995c[_0x5e01bc];return _0x3ad966;};'use strict';var Sequelize=require(_0xc995('0x0'));module[_0xc995('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc995('0x2')},'description':{'type':Sequelize[_0xc995('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3a57=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x4814a7,_0x1a084d){var _0x406700=function(_0x77483b){while(--_0x77483b){_0x4814a7['push'](_0x4814a7['shift']());}};_0x406700(++_0x1a084d);}(_0x3a57,0xfc));var _0x73a5=function(_0x3f865a,_0xf3dc5f){_0x3f865a=_0x3f865a-0x0;var _0x467792=_0x3a57[_0x3f865a];return _0x467792;};'use strict';var Sequelize=require(_0x73a5('0x0'));module[_0x73a5('0x1')]={'name':{'type':Sequelize[_0x73a5('0x2')],'unique':_0x73a5('0x3')},'description':{'type':Sequelize[_0x73a5('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x73a5('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index af8b15d..bd21468 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 _0xb2ff=['filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','rawAttributes','fields','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','params','chan_sip.so','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','get','Contexts','destroy','end','name','send','map','VoiceContext','type','key','model','query','keys'];(function(_0x438874,_0x50bced){var _0x3a51c1=function(_0x92bd43){while(--_0x92bd43){_0x438874['push'](_0x438874['shift']());}};_0x3a51c1(++_0x50bced);}(_0xb2ff,0x15e));var _0xfb2f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb2ff[_0xfae23b];return _0x200640;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfb2f('0x0'));var rp=require('request-promise');var moment=require(_0xfb2f('0x1'));var BPromise=require(_0xfb2f('0x2'));var Mustache=require(_0xfb2f('0x3'));var util=require(_0xfb2f('0x4'));var path=require(_0xfb2f('0x5'));var sox=require(_0xfb2f('0x6'));var csv=require(_0xfb2f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfb2f('0x8'));var _=require('lodash');var squel=require(_0xfb2f('0x9'));var crypto=require(_0xfb2f('0xa'));var jsforce=require(_0xfb2f('0xb'));var deskjs=require(_0xfb2f('0xc'));var toCsv=require(_0xfb2f('0x7'));var querystring=require(_0xfb2f('0xd'));var Papa=require(_0xfb2f('0xe'));var Redis=require('ioredis');var authService=require(_0xfb2f('0xf'));var qs=require(_0xfb2f('0x10'));var as=require(_0xfb2f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfb2f('0x12'))(_0xfb2f('0x13'));var utils=require(_0xfb2f('0x14'));var config=require(_0xfb2f('0x15'));var licenseUtil=require(_0xfb2f('0x16'));var db=require(_0xfb2f('0x17'))['db'];var jayson=require(_0xfb2f('0x18'));var client=jayson['client'][_0xfb2f('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2b7eed,_0x37b0a3,_0xf196c,_0x3c7809){return new BPromise(function(_0xd5dc98,_0x1ac43c){var _0x5cd828=_0x3c7809||client;return _0x5cd828['request'](_0x2b7eed,_0xf196c)[_0xfb2f('0x1a')](function(_0x3c8af2){logger[_0xfb2f('0x1b')](_0xfb2f('0x1c'),_0x37b0a3,_0xfb2f('0x1d'));logger['debug'](_0xfb2f('0x1e'),_0x37b0a3,'request\x20sent',JSON[_0xfb2f('0x1f')](_0x3c8af2));if(_0x3c8af2[_0xfb2f('0x20')]){if(_0x3c8af2[_0xfb2f('0x20')][_0xfb2f('0x21')]===0x1f4){logger[_0xfb2f('0x20')](_0xfb2f('0x1c'),_0x37b0a3,_0x3c8af2[_0xfb2f('0x20')][_0xfb2f('0x22')]);return _0x1ac43c(_0x3c8af2[_0xfb2f('0x20')]['message']);}logger['error'](_0xfb2f('0x1c'),_0x37b0a3,_0x3c8af2[_0xfb2f('0x20')]['message']);return _0xd5dc98(_0x3c8af2[_0xfb2f('0x20')][_0xfb2f('0x22')]);}else{logger[_0xfb2f('0x1b')](_0xfb2f('0x1c'),_0x37b0a3,'request\x20sent');_0xd5dc98(_0x3c8af2[_0xfb2f('0x23')][_0xfb2f('0x22')]);}})[_0xfb2f('0x24')](function(_0x5b1b5b){logger['error'](_0xfb2f('0x1c'),_0x37b0a3,_0x5b1b5b);_0x1ac43c(_0x5b1b5b);});});}function respondWithStatusCode(_0x14a75c,_0xc51c6e){_0xc51c6e=_0xc51c6e||0xcc;return function(_0x476bbb){if(_0x476bbb){return _0x14a75c[_0xfb2f('0x25')](_0xc51c6e);}return _0x14a75c['status'](_0xc51c6e)['end']();};}function respondWithResult(_0x26f4bb,_0x22a66d){_0x22a66d=_0x22a66d||0xc8;return function(_0x2b7da5){if(_0x2b7da5){return _0x26f4bb[_0xfb2f('0x26')](_0x22a66d)[_0xfb2f('0x27')](_0x2b7da5);}};}function respondWithFilteredResult(_0x3f2b9c,_0x39e236){return function(_0x4d7e38){if(_0x4d7e38){var _0x5ac942=typeof _0x39e236[_0xfb2f('0x28')]===_0xfb2f('0x29')&&typeof _0x39e236[_0xfb2f('0x2a')]===_0xfb2f('0x29');var _0xe97097=_0x4d7e38['count'];var _0x5426d6=_0x5ac942?0x0:_0x39e236[_0xfb2f('0x28')];var _0x44af3c=_0x5ac942?_0x4d7e38[_0xfb2f('0x2b')]:_0x39e236[_0xfb2f('0x28')]+_0x39e236[_0xfb2f('0x2a')];var _0x35325d;if(_0x44af3c>=_0xe97097){_0x44af3c=_0xe97097;_0x35325d=0xc8;}else{_0x35325d=0xce;}_0x3f2b9c[_0xfb2f('0x26')](_0x35325d);return _0x3f2b9c[_0xfb2f('0x2c')](_0xfb2f('0x2d'),_0x5426d6+'-'+_0x44af3c+'/'+_0xe97097)['json'](_0x4d7e38);}return null;};}function patchUpdates(_0x30cabf){return function(_0xc82c81){try{jsonpatch['apply'](_0xc82c81,_0x30cabf,!![]);}catch(_0x4505d9){return BPromise[_0xfb2f('0x2e')](_0x4505d9);}return _0xc82c81[_0xfb2f('0x2f')]();};}function saveUpdates(_0xc7a198,_0x50e7e3){return function(_0x3671b4){if(_0x3671b4){return _0x3671b4[_0xfb2f('0x30')](_0xc7a198)[_0xfb2f('0x1a')](function(_0x519471){return _0x519471;});}return null;};}function removeEntity(_0x17dfd3,_0x580dfe){return function(_0x4985cf){if(_0x4985cf){return _0x4985cf['destroy']()[_0xfb2f('0x1a')](function(){var _0x2b9d71=_0x4985cf[_0xfb2f('0x31')]({'plain':!![]});var _0x3922fa=_0xfb2f('0x32');return db['UserProfileResource'][_0xfb2f('0x33')]({'where':{'type':_0x3922fa,'resourceId':_0x2b9d71['id']}})[_0xfb2f('0x1a')](function(){return _0x4985cf;});})[_0xfb2f('0x1a')](function(){_0x17dfd3[_0xfb2f('0x26')](0xcc)[_0xfb2f('0x34')]();});}};}function handleEntityNotFound(_0x3e46e5,_0x7bfd3){return function(_0x5ed7ed){if(!_0x5ed7ed){_0x3e46e5[_0xfb2f('0x25')](0x194);}return _0x5ed7ed;};}function handleError(_0x485d8b,_0x427cc1){_0x427cc1=_0x427cc1||0x1f4;return function(_0x530a93){logger[_0xfb2f('0x20')](_0x530a93['stack']);if(_0x530a93[_0xfb2f('0x35')]){delete _0x530a93['name'];}_0x485d8b['status'](_0x427cc1)[_0xfb2f('0x36')](_0x530a93);};}exports['index']=function(_0x2b7470,_0x5705fe){var _0x2e921d={},_0x1eab02={},_0x493bde={'count':0x0,'rows':[]};var _0x27afca=_[_0xfb2f('0x37')](db[_0xfb2f('0x38')]['rawAttributes'],function(_0x283574){return{'name':_0x283574['fieldName'],'type':_0x283574[_0xfb2f('0x39')][_0xfb2f('0x3a')]};});_0x1eab02[_0xfb2f('0x3b')]=_['map'](_0x27afca,_0xfb2f('0x35'));_0x1eab02[_0xfb2f('0x3c')]=_[_0xfb2f('0x3d')](_0x2b7470[_0xfb2f('0x3c')]);_0x1eab02[_0xfb2f('0x3e')]=_[_0xfb2f('0x3f')](_0x1eab02['model'],_0x1eab02[_0xfb2f('0x3c')]);_0x2e921d[_0xfb2f('0x40')]=_[_0xfb2f('0x3f')](_0x1eab02[_0xfb2f('0x3b')],qs['fields'](_0x2b7470[_0xfb2f('0x3c')]['fields']));_0x2e921d[_0xfb2f('0x40')]=_0x2e921d[_0xfb2f('0x40')][_0xfb2f('0x41')]?_0x2e921d[_0xfb2f('0x40')]:_0x1eab02['model'];if(!_0x2b7470[_0xfb2f('0x3c')][_0xfb2f('0x42')](_0xfb2f('0x43'))){_0x2e921d[_0xfb2f('0x2a')]=qs[_0xfb2f('0x2a')](_0x2b7470[_0xfb2f('0x3c')][_0xfb2f('0x2a')]);_0x2e921d['offset']=qs[_0xfb2f('0x28')](_0x2b7470[_0xfb2f('0x3c')]['offset']);}_0x2e921d[_0xfb2f('0x44')]=qs[_0xfb2f('0x45')](_0x2b7470['query']['sort']);_0x2e921d[_0xfb2f('0x46')]=qs[_0xfb2f('0x3e')](_[_0xfb2f('0x47')](_0x2b7470[_0xfb2f('0x3c')],_0x1eab02[_0xfb2f('0x3e')]),_0x27afca);if(_0x2b7470[_0xfb2f('0x3c')][_0xfb2f('0x48')]){_0x2e921d[_0xfb2f('0x46')]=_[_0xfb2f('0x49')](_0x2e921d[_0xfb2f('0x46')],{'$or':_[_0xfb2f('0x37')](_0x27afca,function(_0x4da228){if(_0x4da228[_0xfb2f('0x39')]!==_0xfb2f('0x4a')){var _0x2d12a2={};_0x2d12a2[_0x4da228[_0xfb2f('0x35')]]={'$like':'%'+_0x2b7470[_0xfb2f('0x3c')]['filter']+'%'};return _0x2d12a2;}})});}_0x2e921d=_[_0xfb2f('0x49')]({},_0x2e921d,_0x2b7470[_0xfb2f('0x4b')]);var _0xc19b9d={'where':_0x2e921d[_0xfb2f('0x46')]};return db[_0xfb2f('0x38')]['count'](_0xc19b9d)[_0xfb2f('0x1a')](function(_0x4d6519){_0x493bde[_0xfb2f('0x2b')]=_0x4d6519;if(_0x2b7470['query'][_0xfb2f('0x4c')]){_0x2e921d[_0xfb2f('0x4d')]=[{'all':!![]}];}return db[_0xfb2f('0x38')][_0xfb2f('0x4e')](_0x2e921d);})[_0xfb2f('0x1a')](function(_0x39a0e2){_0x493bde['rows']=_0x39a0e2;return _0x493bde;})[_0xfb2f('0x1a')](respondWithFilteredResult(_0x5705fe,_0x2e921d))['catch'](handleError(_0x5705fe,null));};exports[_0xfb2f('0x4f')]=function(_0x553351,_0x31008f){var _0x231cb4={'raw':![],'where':{'id':_0x553351['params']['id']}},_0x41171b={};_0x41171b[_0xfb2f('0x3b')]=_[_0xfb2f('0x3d')](db[_0xfb2f('0x38')][_0xfb2f('0x50')]);_0x41171b[_0xfb2f('0x3c')]=_['keys'](_0x553351[_0xfb2f('0x3c')]);_0x41171b['filters']=_[_0xfb2f('0x3f')](_0x41171b[_0xfb2f('0x3b')],_0x41171b['query']);_0x231cb4[_0xfb2f('0x40')]=_['intersection'](_0x41171b[_0xfb2f('0x3b')],qs[_0xfb2f('0x51')](_0x553351[_0xfb2f('0x3c')][_0xfb2f('0x51')]));_0x231cb4[_0xfb2f('0x40')]=_0x231cb4[_0xfb2f('0x40')][_0xfb2f('0x41')]?_0x231cb4[_0xfb2f('0x40')]:_0x41171b[_0xfb2f('0x3b')];if(_0x553351[_0xfb2f('0x3c')][_0xfb2f('0x4c')]){_0x231cb4[_0xfb2f('0x4d')]=[{'all':!![]}];}_0x231cb4=_[_0xfb2f('0x49')]({},_0x231cb4,_0x553351['options']);return db[_0xfb2f('0x38')][_0xfb2f('0x52')](_0x231cb4)[_0xfb2f('0x1a')](handleEntityNotFound(_0x31008f,null))[_0xfb2f('0x1a')](respondWithResult(_0x31008f,null))['catch'](handleError(_0x31008f,null));};exports[_0xfb2f('0x53')]=function(_0x3f7a8d,_0xfca0cb,_0x5660ad){var _0x3f280e;return db[_0xfb2f('0x38')]['create'](_0x3f7a8d[_0xfb2f('0x54')],{'raw':!![]})[_0xfb2f('0x1a')](function(_0x5bf8ad){_0x3f280e=_0x5bf8ad;return db[_0xfb2f('0x38')][_0xfb2f('0x4e')]({'raw':!![]});})[_0xfb2f('0x1a')](function(_0x4f7483){var _0x2b9e61=fs[_0xfb2f('0x55')](path[_0xfb2f('0x56')](config[_0xfb2f('0x57')],_0xfb2f('0x58')),_0xfb2f('0x59'));var _0x42c55e=ejs[_0xfb2f('0x5a')](_0x2b9e61,{'contexts':_0x4f7483||[]});fs[_0xfb2f('0x5b')](_0xfb2f('0x5c'),_0x42c55e);})['then'](function(){return respondWithRpcPromise(_0xfb2f('0x5d'),_0xfb2f('0x53'),{'module':'chan_sip.so'});})[_0xfb2f('0x1a')](function(){var _0x2da9b4=_0x3f7a8d[_0xfb2f('0x5e')][_0xfb2f('0x31')]({'plain':!![]});if(!_0x2da9b4)throw new Error(_0xfb2f('0x5f'));if(_0x2da9b4[_0xfb2f('0x60')]===_0xfb2f('0x5e')){var _0x468ef9=_0x3f280e['get']({'plain':!![]});return db[_0xfb2f('0x61')][_0xfb2f('0x52')]({'where':{'name':_0xfb2f('0x32'),'userProfileId':_0x2da9b4[_0xfb2f('0x62')]},'raw':!![]})[_0xfb2f('0x1a')](function(_0x7f033c){if(_0x7f033c&&_0x7f033c[_0xfb2f('0x63')]===0x0){return db[_0xfb2f('0x64')][_0xfb2f('0x53')]({'name':_0x468ef9['name'],'resourceId':_0x468ef9['id'],'type':_0x7f033c[_0xfb2f('0x35')],'sectionId':_0x7f033c['id']},{})[_0xfb2f('0x1a')](function(){return _0x3f280e;});}else{return _0x3f280e;}})[_0xfb2f('0x24')](function(_0x23dead){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23dead);throw _0x23dead;});}return _0x3f280e;})[_0xfb2f('0x1a')](respondWithResult(_0xfca0cb,0xc9))[_0xfb2f('0x24')](handleError(_0xfca0cb,null));};exports[_0xfb2f('0x30')]=function(_0xe9719c,_0x2ed3db,_0x4115c9){var _0x4992f3;return db[_0xfb2f('0x38')][_0xfb2f('0x52')]({'where':{'id':_0xe9719c[_0xfb2f('0x65')]['id']}})['then'](handleEntityNotFound(_0x2ed3db,null))['then'](saveUpdates(_0xe9719c['body'],null))[_0xfb2f('0x1a')](function(_0x2ee399){if(_0x2ee399){_0x4992f3=_0x2ee399;return db[_0xfb2f('0x38')][_0xfb2f('0x4e')]({'raw':!![]});}})[_0xfb2f('0x1a')](function(_0x506d04){var _0x424328=fs[_0xfb2f('0x55')](path[_0xfb2f('0x56')](config[_0xfb2f('0x57')],_0xfb2f('0x58')),_0xfb2f('0x59'));var _0xb7f46f=ejs[_0xfb2f('0x5a')](_0x424328,{'contexts':_0x506d04||[]});fs[_0xfb2f('0x5b')](_0xfb2f('0x5c'),_0xb7f46f);})[_0xfb2f('0x1a')](function(){return respondWithRpcPromise('Reload',_0xfb2f('0x30'),{'module':_0xfb2f('0x66')});})[_0xfb2f('0x1a')](function(){return _0x4992f3;})[_0xfb2f('0x1a')](respondWithResult(_0x2ed3db,null))[_0xfb2f('0x24')](handleError(_0x2ed3db,null));};exports[_0xfb2f('0x33')]=function(_0x1d0538,_0x5bad1e,_0x3e3fcb){var _0x37084a;return db[_0xfb2f('0x38')][_0xfb2f('0x52')]({'where':{'id':_0x1d0538['params']['id']}})[_0xfb2f('0x1a')](handleEntityNotFound(_0x5bad1e,null))[_0xfb2f('0x1a')](removeEntity(_0x5bad1e,null))[_0xfb2f('0x1a')](function(){return db['VoiceContext'][_0xfb2f('0x4e')]({'raw':!![]});})[_0xfb2f('0x1a')](function(_0x52f8ff){var _0xda7638=fs[_0xfb2f('0x55')](path[_0xfb2f('0x56')](config[_0xfb2f('0x57')],'server/files/templates/context.ejs'),_0xfb2f('0x59'));var _0x359800=ejs[_0xfb2f('0x5a')](_0xda7638,{'contexts':_0x52f8ff});fs[_0xfb2f('0x5b')](_0xfb2f('0x5c'),_0x359800);return respondWithRpcPromise(_0xfb2f('0x5d'),_0xfb2f('0x33'),{'module':_0xfb2f('0x66')});})[_0xfb2f('0x24')](handleError(_0x5bad1e,null));}; \ No newline at end of file +var _0x1b25=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','readFileSync','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','join','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','Contexts','UserProfileResource','destroy','name','send','index','map','VoiceContext','fieldName','type','model','query','keys','filters','intersection'];(function(_0x118139,_0x7ce965){var _0x2fece9=function(_0xd145a4){while(--_0xd145a4){_0x118139['push'](_0x118139['shift']());}};_0x2fece9(++_0x7ce965);}(_0x1b25,0x162));var _0x51b2=function(_0x36e5fe,_0x425955){_0x36e5fe=_0x36e5fe-0x0;var _0x3cded9=_0x1b25[_0x36e5fe];return _0x3cded9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x51b2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x51b2('0x1'));var rp=require(_0x51b2('0x2'));var moment=require(_0x51b2('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x51b2('0x4'));var path=require(_0x51b2('0x5'));var sox=require(_0x51b2('0x6'));var csv=require(_0x51b2('0x7'));var ejs=require(_0x51b2('0x8'));var fs=require('fs');var fs_extra=require(_0x51b2('0x9'));var _=require(_0x51b2('0xa'));var squel=require(_0x51b2('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x51b2('0xc'));var toCsv=require(_0x51b2('0x7'));var querystring=require(_0x51b2('0xd'));var Papa=require(_0x51b2('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x51b2('0xf'));var as=require(_0x51b2('0x10'));var hardwareService=require(_0x51b2('0x11'));var logger=require(_0x51b2('0x12'))(_0x51b2('0x13'));var utils=require('../../config/utils');var config=require(_0x51b2('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x51b2('0x15'));var client=jayson[_0x51b2('0x16')][_0x51b2('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x4ce0c2,_0xc437e9,_0x127436,_0x2930fa){return new BPromise(function(_0x1bd0eb,_0x2c815e){var _0xc263f7=_0x2930fa||client;return _0xc263f7[_0x51b2('0x18')](_0x4ce0c2,_0x127436)[_0x51b2('0x19')](function(_0x1686d6){logger[_0x51b2('0x1a')](_0x51b2('0x1b'),_0xc437e9,'request\x20sent');logger[_0x51b2('0x1c')](_0x51b2('0x1d'),_0xc437e9,_0x51b2('0x1e'),JSON[_0x51b2('0x1f')](_0x1686d6));if(_0x1686d6[_0x51b2('0x20')]){if(_0x1686d6[_0x51b2('0x20')][_0x51b2('0x21')]===0x1f4){logger[_0x51b2('0x20')]('VoiceContext,\x20%s,\x20%s',_0xc437e9,_0x1686d6[_0x51b2('0x20')][_0x51b2('0x22')]);return _0x2c815e(_0x1686d6['error']['message']);}logger['error'](_0x51b2('0x1b'),_0xc437e9,_0x1686d6['error'][_0x51b2('0x22')]);return _0x1bd0eb(_0x1686d6[_0x51b2('0x20')]['message']);}else{logger[_0x51b2('0x1a')](_0x51b2('0x1b'),_0xc437e9,'request\x20sent');_0x1bd0eb(_0x1686d6[_0x51b2('0x23')][_0x51b2('0x22')]);}})[_0x51b2('0x24')](function(_0x21d647){logger[_0x51b2('0x20')](_0x51b2('0x1b'),_0xc437e9,_0x21d647);_0x2c815e(_0x21d647);});});}function respondWithStatusCode(_0x313e82,_0x1514fc){_0x1514fc=_0x1514fc||0xcc;return function(_0xd8e9ea){if(_0xd8e9ea){return _0x313e82[_0x51b2('0x25')](_0x1514fc);}return _0x313e82['status'](_0x1514fc)[_0x51b2('0x26')]();};}function respondWithResult(_0x287073,_0x595935){_0x595935=_0x595935||0xc8;return function(_0x443ed2){if(_0x443ed2){return _0x287073[_0x51b2('0x27')](_0x595935)[_0x51b2('0x28')](_0x443ed2);}};}function respondWithFilteredResult(_0x1c7a78,_0x279137){return function(_0x492d55){if(_0x492d55){var _0x2b3c5f=typeof _0x279137[_0x51b2('0x29')]===_0x51b2('0x2a')&&typeof _0x279137[_0x51b2('0x2b')]===_0x51b2('0x2a');var _0x3424eb=_0x492d55[_0x51b2('0x2c')];var _0x26ca71=_0x2b3c5f?0x0:_0x279137[_0x51b2('0x29')];var _0x4cb214=_0x2b3c5f?_0x492d55[_0x51b2('0x2c')]:_0x279137['offset']+_0x279137['limit'];var _0x5834b2;if(_0x4cb214>=_0x3424eb){_0x4cb214=_0x3424eb;_0x5834b2=0xc8;}else{_0x5834b2=0xce;}_0x1c7a78[_0x51b2('0x27')](_0x5834b2);return _0x1c7a78[_0x51b2('0x2d')](_0x51b2('0x2e'),_0x26ca71+'-'+_0x4cb214+'/'+_0x3424eb)['json'](_0x492d55);}return null;};}function patchUpdates(_0x267c1c){return function(_0x23133b){try{jsonpatch[_0x51b2('0x2f')](_0x23133b,_0x267c1c,!![]);}catch(_0xb6ff40){return BPromise[_0x51b2('0x30')](_0xb6ff40);}return _0x23133b[_0x51b2('0x31')]();};}function saveUpdates(_0x58e010,_0x4a13f2){return function(_0x187f2a){if(_0x187f2a){return _0x187f2a[_0x51b2('0x32')](_0x58e010)[_0x51b2('0x19')](function(_0x4c5329){return _0x4c5329;});}return null;};}function removeEntity(_0x10e183,_0xa7cbd9){return function(_0x58cd6b){if(_0x58cd6b){return _0x58cd6b['destroy']()[_0x51b2('0x19')](function(){var _0x2f735c=_0x58cd6b['get']({'plain':!![]});var _0xbc486b=_0x51b2('0x33');return db[_0x51b2('0x34')][_0x51b2('0x35')]({'where':{'type':_0xbc486b,'resourceId':_0x2f735c['id']}})[_0x51b2('0x19')](function(){return _0x58cd6b;});})['then'](function(){_0x10e183[_0x51b2('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa39af,_0x224c5f){return function(_0x182580){if(!_0x182580){_0xa39af[_0x51b2('0x25')](0x194);}return _0x182580;};}function handleError(_0x5e82f8,_0x34b49b){_0x34b49b=_0x34b49b||0x1f4;return function(_0x5b4167){logger[_0x51b2('0x20')](_0x5b4167['stack']);if(_0x5b4167[_0x51b2('0x36')]){delete _0x5b4167['name'];}_0x5e82f8[_0x51b2('0x27')](_0x34b49b)[_0x51b2('0x37')](_0x5b4167);};}exports[_0x51b2('0x38')]=function(_0x2c42d3,_0x1ce1bd){var _0x16339a={},_0x1c5109={},_0x56854f={'count':0x0,'rows':[]};var _0x219d33=_[_0x51b2('0x39')](db[_0x51b2('0x3a')]['rawAttributes'],function(_0x2fa380){return{'name':_0x2fa380[_0x51b2('0x3b')],'type':_0x2fa380[_0x51b2('0x3c')]['key']};});_0x1c5109[_0x51b2('0x3d')]=_[_0x51b2('0x39')](_0x219d33,_0x51b2('0x36'));_0x1c5109[_0x51b2('0x3e')]=_[_0x51b2('0x3f')](_0x2c42d3['query']);_0x1c5109[_0x51b2('0x40')]=_[_0x51b2('0x41')](_0x1c5109[_0x51b2('0x3d')],_0x1c5109[_0x51b2('0x3e')]);_0x16339a[_0x51b2('0x42')]=_[_0x51b2('0x41')](_0x1c5109[_0x51b2('0x3d')],qs[_0x51b2('0x43')](_0x2c42d3[_0x51b2('0x3e')][_0x51b2('0x43')]));_0x16339a[_0x51b2('0x42')]=_0x16339a[_0x51b2('0x42')][_0x51b2('0x44')]?_0x16339a[_0x51b2('0x42')]:_0x1c5109[_0x51b2('0x3d')];if(!_0x2c42d3[_0x51b2('0x3e')][_0x51b2('0x45')](_0x51b2('0x46'))){_0x16339a[_0x51b2('0x2b')]=qs[_0x51b2('0x2b')](_0x2c42d3['query']['limit']);_0x16339a['offset']=qs[_0x51b2('0x29')](_0x2c42d3[_0x51b2('0x3e')][_0x51b2('0x29')]);}_0x16339a[_0x51b2('0x47')]=qs[_0x51b2('0x48')](_0x2c42d3[_0x51b2('0x3e')][_0x51b2('0x48')]);_0x16339a[_0x51b2('0x49')]=qs[_0x51b2('0x40')](_[_0x51b2('0x4a')](_0x2c42d3[_0x51b2('0x3e')],_0x1c5109[_0x51b2('0x40')]),_0x219d33);if(_0x2c42d3['query'][_0x51b2('0x4b')]){_0x16339a[_0x51b2('0x49')]=_[_0x51b2('0x4c')](_0x16339a['where'],{'$or':_['map'](_0x219d33,function(_0x22498e){if(_0x22498e[_0x51b2('0x3c')]!==_0x51b2('0x4d')){var _0x174423={};_0x174423[_0x22498e[_0x51b2('0x36')]]={'$like':'%'+_0x2c42d3['query'][_0x51b2('0x4b')]+'%'};return _0x174423;}})});}_0x16339a=_[_0x51b2('0x4c')]({},_0x16339a,_0x2c42d3[_0x51b2('0x4e')]);var _0x434ada={'where':_0x16339a[_0x51b2('0x49')]};return db[_0x51b2('0x3a')]['count'](_0x434ada)[_0x51b2('0x19')](function(_0x57a4a9){_0x56854f[_0x51b2('0x2c')]=_0x57a4a9;if(_0x2c42d3[_0x51b2('0x3e')][_0x51b2('0x4f')]){_0x16339a[_0x51b2('0x50')]=[{'all':!![]}];}return db['VoiceContext'][_0x51b2('0x51')](_0x16339a);})[_0x51b2('0x19')](function(_0x32bd9a){_0x56854f[_0x51b2('0x52')]=_0x32bd9a;return _0x56854f;})[_0x51b2('0x19')](respondWithFilteredResult(_0x1ce1bd,_0x16339a))['catch'](handleError(_0x1ce1bd,null));};exports[_0x51b2('0x53')]=function(_0x2e8dec,_0x278128){var _0x303341={'raw':![],'where':{'id':_0x2e8dec[_0x51b2('0x54')]['id']}},_0x1084bc={};_0x1084bc['model']=_[_0x51b2('0x3f')](db[_0x51b2('0x3a')][_0x51b2('0x55')]);_0x1084bc[_0x51b2('0x3e')]=_['keys'](_0x2e8dec[_0x51b2('0x3e')]);_0x1084bc['filters']=_[_0x51b2('0x41')](_0x1084bc['model'],_0x1084bc[_0x51b2('0x3e')]);_0x303341[_0x51b2('0x42')]=_['intersection'](_0x1084bc[_0x51b2('0x3d')],qs['fields'](_0x2e8dec['query'][_0x51b2('0x43')]));_0x303341[_0x51b2('0x42')]=_0x303341['attributes'][_0x51b2('0x44')]?_0x303341[_0x51b2('0x42')]:_0x1084bc[_0x51b2('0x3d')];if(_0x2e8dec[_0x51b2('0x3e')][_0x51b2('0x4f')]){_0x303341[_0x51b2('0x50')]=[{'all':!![]}];}_0x303341=_[_0x51b2('0x4c')]({},_0x303341,_0x2e8dec[_0x51b2('0x4e')]);return db[_0x51b2('0x3a')][_0x51b2('0x56')](_0x303341)[_0x51b2('0x19')](handleEntityNotFound(_0x278128,null))[_0x51b2('0x19')](respondWithResult(_0x278128,null))[_0x51b2('0x24')](handleError(_0x278128,null));};exports[_0x51b2('0x57')]=function(_0x311ce7,_0x58b495,_0x2460cb){var _0x4abccb;return db[_0x51b2('0x3a')][_0x51b2('0x57')](_0x311ce7[_0x51b2('0x58')],{'raw':!![]})[_0x51b2('0x19')](function(_0x3b5a63){_0x4abccb=_0x3b5a63;return db[_0x51b2('0x3a')][_0x51b2('0x51')]({'raw':!![]});})['then'](function(_0x73bbbd){var _0x5c26fc=fs[_0x51b2('0x59')](path['join'](config[_0x51b2('0x5a')],_0x51b2('0x5b')),_0x51b2('0x5c'));var _0x660c10=ejs[_0x51b2('0x5d')](_0x5c26fc,{'contexts':_0x73bbbd||[]});fs[_0x51b2('0x5e')](_0x51b2('0x5f'),_0x660c10);})[_0x51b2('0x19')](function(){return respondWithRpcPromise(_0x51b2('0x60'),_0x51b2('0x57'),{'module':_0x51b2('0x61')});})[_0x51b2('0x19')](function(){var _0x51bc7a=_0x311ce7[_0x51b2('0x62')][_0x51b2('0x63')]({'plain':!![]});if(!_0x51bc7a)throw new Error(_0x51b2('0x64'));if(_0x51bc7a[_0x51b2('0x65')]===_0x51b2('0x62')){var _0x242ca4=_0x4abccb['get']({'plain':!![]});return db[_0x51b2('0x66')][_0x51b2('0x56')]({'where':{'name':_0x51b2('0x33'),'userProfileId':_0x51bc7a[_0x51b2('0x67')]},'raw':!![]})[_0x51b2('0x19')](function(_0x554733){if(_0x554733&&_0x554733['autoAssociation']===0x0){return db[_0x51b2('0x34')][_0x51b2('0x57')]({'name':_0x242ca4[_0x51b2('0x36')],'resourceId':_0x242ca4['id'],'type':_0x554733['name'],'sectionId':_0x554733['id']},{})[_0x51b2('0x19')](function(){return _0x4abccb;});}else{return _0x4abccb;}})[_0x51b2('0x24')](function(_0xf55349){logger[_0x51b2('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf55349);throw _0xf55349;});}return _0x4abccb;})[_0x51b2('0x19')](respondWithResult(_0x58b495,0xc9))[_0x51b2('0x24')](handleError(_0x58b495,null));};exports[_0x51b2('0x32')]=function(_0x471259,_0x2b1cf8,_0x4051a3){var _0x3467fb;return db['VoiceContext'][_0x51b2('0x56')]({'where':{'id':_0x471259['params']['id']}})[_0x51b2('0x19')](handleEntityNotFound(_0x2b1cf8,null))[_0x51b2('0x19')](saveUpdates(_0x471259['body'],null))['then'](function(_0xfe1815){if(_0xfe1815){_0x3467fb=_0xfe1815;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0x51b2('0x19')](function(_0x2d9415){var _0x3431dd=fs[_0x51b2('0x59')](path[_0x51b2('0x68')](config['root'],_0x51b2('0x5b')),_0x51b2('0x5c'));var _0x1b0506=ejs['render'](_0x3431dd,{'contexts':_0x2d9415||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x1b0506);})['then'](function(){return respondWithRpcPromise('Reload',_0x51b2('0x32'),{'module':_0x51b2('0x61')});})['then'](function(){return _0x3467fb;})['then'](respondWithResult(_0x2b1cf8,null))['catch'](handleError(_0x2b1cf8,null));};exports[_0x51b2('0x35')]=function(_0x572053,_0x4d34a4,_0x350511){var _0x5f5125;return db[_0x51b2('0x3a')]['find']({'where':{'id':_0x572053[_0x51b2('0x54')]['id']}})[_0x51b2('0x19')](handleEntityNotFound(_0x4d34a4,null))[_0x51b2('0x19')](removeEntity(_0x4d34a4,null))[_0x51b2('0x19')](function(){return db[_0x51b2('0x3a')][_0x51b2('0x51')]({'raw':!![]});})['then'](function(_0xeb633a){var _0x3a84a5=fs[_0x51b2('0x59')](path[_0x51b2('0x68')](config['root'],_0x51b2('0x5b')),_0x51b2('0x5c'));var _0x262976=ejs[_0x51b2('0x5d')](_0x3a84a5,{'contexts':_0xeb633a});fs['writeFileSync'](_0x51b2('0x5f'),_0x262976);return respondWithRpcPromise(_0x51b2('0x60'),_0x51b2('0x35'),{'module':_0x51b2('0x61')});})['catch'](handleError(_0x4d34a4,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 09ae189..560a65a 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 _0x6739=['VoiceContext','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./voiceContext.attributes','define'];(function(_0x1637cc,_0xed3f4e){var _0x3777df=function(_0xa9c554){while(--_0xa9c554){_0x1637cc['push'](_0x1637cc['shift']());}};_0x3777df(++_0xed3f4e);}(_0x6739,0xd3));var _0x9673=function(_0x4b61bd,_0x50507c){_0x4b61bd=_0x4b61bd-0x0;var _0x261d91=_0x6739[_0x4b61bd];return _0x261d91;};'use strict';var _=require(_0x9673('0x0'));var util=require(_0x9673('0x1'));var logger=require(_0x9673('0x2'))(_0x9673('0x3'));var moment=require(_0x9673('0x4'));var BPromise=require(_0x9673('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9673('0x6'));var config=require('../../config/environment');var attributes=require(_0x9673('0x7'));module['exports']=function(_0x57a9d5,_0x27f94b){return _0x57a9d5[_0x9673('0x8')](_0x9673('0x9'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c4a=['path','../../config/environment','exports','VoiceContext','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4c4a,0x1d0));var _0xa4c4=function(_0x4ebffa,_0x1ab8db){_0x4ebffa=_0x4ebffa-0x0;var _0x4aec5f=_0x4c4a[_0x4ebffa];return _0x4aec5f;};'use strict';var _=require(_0xa4c4('0x0'));var util=require(_0xa4c4('0x1'));var logger=require(_0xa4c4('0x2'))('api');var moment=require(_0xa4c4('0x3'));var BPromise=require(_0xa4c4('0x4'));var rp=require(_0xa4c4('0x5'));var fs=require('fs');var path=require(_0xa4c4('0x6'));var rimraf=require('rimraf');var config=require(_0xa4c4('0x7'));var attributes=require('./voiceContext.attributes');module[_0xa4c4('0x8')]=function(_0x11aded,_0x5ca539){return _0x11aded['define'](_0xa4c4('0x9'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index e1bdc96..22eb7c6 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 _0x7c47=['VoiceContext,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x240261,_0x4fe66c){var _0x45c332=function(_0x4f367a){while(--_0x4f367a){_0x240261['push'](_0x240261['shift']());}};_0x45c332(++_0x4fe66c);}(_0x7c47,0x1b8));var _0x77c4=function(_0x35fe20,_0x19d91d){_0x35fe20=_0x35fe20-0x0;var _0x2e956e=_0x7c47[_0x35fe20];return _0x2e956e;};'use strict';var _=require(_0x77c4('0x0'));var util=require('util');var moment=require(_0x77c4('0x1'));var BPromise=require(_0x77c4('0x2'));var rs=require(_0x77c4('0x3'));var fs=require('fs');var Redis=require(_0x77c4('0x4'));var db=require(_0x77c4('0x5'))['db'];var utils=require(_0x77c4('0x6'));var logger=require(_0x77c4('0x7'))('rpc');var config=require(_0x77c4('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x77c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x440887,_0x47d899,_0x2ca0f9){return new BPromise(function(_0x3ce6b1,_0x470702){return client[_0x77c4('0xa')](_0x440887,_0x2ca0f9)[_0x77c4('0xb')](function(_0x3760e5){logger[_0x77c4('0xc')]('VoiceContext,\x20%s,\x20%s',_0x47d899,_0x77c4('0xd'));logger[_0x77c4('0xe')](_0x77c4('0xf'),_0x47d899,_0x77c4('0xd'),JSON[_0x77c4('0x10')](_0x3760e5));if(_0x3760e5[_0x77c4('0x11')]){if(_0x3760e5['error'][_0x77c4('0x12')]===0x1f4){logger[_0x77c4('0x11')]('VoiceContext,\x20%s,\x20%s',_0x47d899,_0x3760e5['error'][_0x77c4('0x13')]);return _0x470702(_0x3760e5[_0x77c4('0x11')]['message']);}logger[_0x77c4('0x11')](_0x77c4('0x14'),_0x47d899,_0x3760e5[_0x77c4('0x11')][_0x77c4('0x13')]);return _0x3ce6b1(_0x3760e5[_0x77c4('0x11')]['message']);}else{logger[_0x77c4('0xc')](_0x77c4('0x14'),_0x47d899,'request\x20sent');_0x3ce6b1(_0x3760e5[_0x77c4('0x15')][_0x77c4('0x13')]);}})[_0x77c4('0x16')](function(_0x2611f8){logger['error'](_0x77c4('0x14'),_0x47d899,_0x2611f8);_0x470702(_0x2611f8);});});} \ No newline at end of file +var _0x076b=['rpc','../../config/environment','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x291517,_0x438909){var _0x1473cc=function(_0x2ff13b){while(--_0x2ff13b){_0x291517['push'](_0x291517['shift']());}};_0x1473cc(++_0x438909);}(_0x076b,0x1c1));var _0xb076=function(_0x110005,_0x54031f){_0x110005=_0x110005-0x0;var _0x162ac7=_0x076b[_0x110005];return _0x162ac7;};'use strict';var _=require(_0xb076('0x0'));var util=require(_0xb076('0x1'));var moment=require(_0xb076('0x2'));var BPromise=require(_0xb076('0x3'));var rs=require(_0xb076('0x4'));var fs=require('fs');var Redis=require(_0xb076('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb076('0x6'))(_0xb076('0x7'));var config=require(_0xb076('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x43270b,_0x1821c4,_0x593373){return new BPromise(function(_0x5bda23,_0x26aca5){return client[_0xb076('0x9')](_0x43270b,_0x593373)['then'](function(_0x3dbea1){logger[_0xb076('0xa')](_0xb076('0xb'),_0x1821c4,_0xb076('0xc'));logger[_0xb076('0xd')](_0xb076('0xe'),_0x1821c4,'request\x20sent',JSON['stringify'](_0x3dbea1));if(_0x3dbea1[_0xb076('0xf')]){if(_0x3dbea1[_0xb076('0xf')][_0xb076('0x10')]===0x1f4){logger['error'](_0xb076('0xb'),_0x1821c4,_0x3dbea1[_0xb076('0xf')]['message']);return _0x26aca5(_0x3dbea1['error'][_0xb076('0x11')]);}logger[_0xb076('0xf')](_0xb076('0xb'),_0x1821c4,_0x3dbea1[_0xb076('0xf')]['message']);return _0x5bda23(_0x3dbea1[_0xb076('0xf')]['message']);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x1821c4,'request\x20sent');_0x5bda23(_0x3dbea1[_0xb076('0x12')][_0xb076('0x11')]);}})['catch'](function(_0x4402c4){logger[_0xb076('0xf')]('VoiceContext,\x20%s,\x20%s',_0x1821c4,_0x4402c4);_0x26aca5(_0x4402c4);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index b4e13af..eafc563 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 _0xb6ec=['express','Router','fs-extra','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','index','/:id','show','create','update','destroy','exports','multer','util','path'];(function(_0x170bba,_0x2be92f){var _0xa7c249=function(_0x2b6505){while(--_0x2b6505){_0x170bba['push'](_0x170bba['shift']());}};_0xa7c249(++_0x2be92f);}(_0xb6ec,0x74));var _0xcb6e=function(_0x30fede,_0x9a91d0){_0x30fede=_0x30fede-0x0;var _0x3089ad=_0xb6ec[_0x30fede];return _0x3089ad;};'use strict';var multer=require(_0xcb6e('0x0'));var util=require(_0xcb6e('0x1'));var path=require(_0xcb6e('0x2'));var timeout=require('connect-timeout');var express=require(_0xcb6e('0x3'));var router=express[_0xcb6e('0x4')]();var fs_extra=require(_0xcb6e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcb6e('0x6'));var config=require('../../config/environment');var controller=require(_0xcb6e('0x7'));router[_0xcb6e('0x8')]('/',auth[_0xcb6e('0x9')](),controller[_0xcb6e('0xa')]);router[_0xcb6e('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xcb6e('0x8')](_0xcb6e('0xb'),auth[_0xcb6e('0x9')](),controller[_0xcb6e('0xc')]);router['post']('/',auth[_0xcb6e('0x9')](),controller[_0xcb6e('0xd')]);router['put'](_0xcb6e('0xb'),auth['isAuthenticated'](),controller[_0xcb6e('0xe')]);router['delete'](_0xcb6e('0xb'),auth[_0xcb6e('0x9')](),controller[_0xcb6e('0xf')]);module[_0xcb6e('0x10')]=router; \ No newline at end of file +var _0x9bde=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','delete','destroy','util','connect-timeout','Router'];(function(_0x406184,_0x3712fb){var _0x23e4f9=function(_0xabd8a8){while(--_0xabd8a8){_0x406184['push'](_0x406184['shift']());}};_0x23e4f9(++_0x3712fb);}(_0x9bde,0xe1));var _0xe9bd=function(_0x1afafe,_0x469709){_0x1afafe=_0x1afafe-0x0;var _0x595639=_0x9bde[_0x1afafe];return _0x595639;};'use strict';var multer=require('multer');var util=require(_0xe9bd('0x0'));var path=require('path');var timeout=require(_0xe9bd('0x1'));var express=require('express');var router=express[_0xe9bd('0x2')]();var fs_extra=require(_0xe9bd('0x3'));var auth=require(_0xe9bd('0x4'));var interaction=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var controller=require(_0xe9bd('0x7'));router[_0xe9bd('0x8')]('/',auth['isAuthenticated'](),controller[_0xe9bd('0x9')]);router[_0xe9bd('0x8')](_0xe9bd('0xa'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xc')]);router[_0xe9bd('0x8')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xe')]);router[_0xe9bd('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe9bd('0x10')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller['update']);router[_0xe9bd('0x11')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 3b1362b..44c4e48 100644 --- a/server/api/voiceDialReport/voiceDialReport.attributes.js +++ b/server/api/voiceDialReport/voiceDialReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x4f13a5,_0x20eedb){var _0x22f0cd=function(_0x4768c9){while(--_0x4768c9){_0x4f13a5['push'](_0x4f13a5['shift']());}};_0x22f0cd(++_0x20eedb);}(_0x008c,0x188));var _0xc008=function(_0x53b071,_0x1e4fcf){_0x53b071=_0x53b071-0x0;var _0xf1c6c1=_0x008c[_0x53b071];return _0xf1c6c1;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'privilege':{'type':Sequelize[_0xc008('0x2')]},'channel':{'type':Sequelize[_0xc008('0x2')]},'channelstate':{'type':Sequelize[_0xc008('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc008('0x2')]},'calleridname':{'type':Sequelize[_0xc008('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'connectedlinename':{'type':Sequelize[_0xc008('0x2')]},'language':{'type':Sequelize[_0xc008('0x2')]},'accountcode':{'type':Sequelize[_0xc008('0x2')]},'context':{'type':Sequelize[_0xc008('0x2')]},'exten':{'type':Sequelize[_0xc008('0x2')]},'priority':{'type':Sequelize[_0xc008('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xc008('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc008('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xc008('0x2')]},'destexten':{'type':Sequelize[_0xc008('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xc008('0x2')]},'destlinkedid':{'type':Sequelize[_0xc008('0x2')]},'dialstring':{'type':Sequelize[_0xc008('0x2')]},'dialstatus':{'type':Sequelize[_0xc008('0x2')]},'starttime':{'type':Sequelize[_0xc008('0x4')]},'answertime':{'type':Sequelize[_0xc008('0x4')]},'endtime':{'type':Sequelize[_0xc008('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xc008('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xc008('0x3')]},'billableseconds':{'type':Sequelize[_0xc008('0x3')]}}; \ No newline at end of file +var _0x9957=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x32ad3f,_0x179fb4){var _0x10959f=function(_0x566075){while(--_0x566075){_0x32ad3f['push'](_0x32ad3f['shift']());}};_0x10959f(++_0x179fb4);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'privilege':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize[_0x7995('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x7995('0x2')]},'calleridnum':{'type':Sequelize[_0x7995('0x2')]},'calleridname':{'type':Sequelize[_0x7995('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7995('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'context':{'type':Sequelize[_0x7995('0x2')]},'exten':{'type':Sequelize[_0x7995('0x2')]},'priority':{'type':Sequelize[_0x7995('0x3')]},'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x7995('0x2')]},'destchannelstate':{'type':Sequelize[_0x7995('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x7995('0x2')]},'destcalleridname':{'type':Sequelize[_0x7995('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x7995('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x7995('0x2')]},'destlanguage':{'type':Sequelize[_0x7995('0x2')]},'destaccountcode':{'type':Sequelize[_0x7995('0x2')]},'destcontext':{'type':Sequelize[_0x7995('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x7995('0x3')]},'destuniqueid':{'type':Sequelize[_0x7995('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x7995('0x2')]},'dialstatus':{'type':Sequelize[_0x7995('0x2')]},'starttime':{'type':Sequelize[_0x7995('0x4')]},'answertime':{'type':Sequelize[_0x7995('0x4')]},'endtime':{'type':Sequelize[_0x7995('0x4')]},'lastevent':{'type':Sequelize[_0x7995('0x2')],'comment':_0x7995('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x7995('0x3')]},'billableseconds':{'type':Sequelize[_0x7995('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 1f54f03..736c4d8 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 _0xb0d7=['length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','params','create','body','find','describe','eml-format','moment','bluebird','mustache','path','to-csv','fs-extra','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','VoiceDialReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields'];(function(_0x2cee3c,_0x2ac545){var _0x1ab328=function(_0xc4b6bf){while(--_0xc4b6bf){_0x2cee3c['push'](_0x2cee3c['shift']());}};_0x1ab328(++_0x2ac545);}(_0xb0d7,0x141));var _0x7b0d=function(_0x49e93f,_0x586891){_0x49e93f=_0x49e93f-0x0;var _0xb56c11=_0xb0d7[_0x49e93f];return _0xb56c11;};'use strict';var emlformat=require(_0x7b0d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b0d('0x1'));var BPromise=require(_0x7b0d('0x2'));var Mustache=require(_0x7b0d('0x3'));var util=require('util');var path=require(_0x7b0d('0x4'));var sox=require('sox');var csv=require(_0x7b0d('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b0d('0x6'));var _=require(_0x7b0d('0x7'));var squel=require(_0x7b0d('0x8'));var crypto=require(_0x7b0d('0x9'));var jsforce=require(_0x7b0d('0xa'));var deskjs=require(_0x7b0d('0xb'));var toCsv=require(_0x7b0d('0x5'));var querystring=require(_0x7b0d('0xc'));var Papa=require(_0x7b0d('0xd'));var Redis=require(_0x7b0d('0xe'));var authService=require(_0x7b0d('0xf'));var qs=require(_0x7b0d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b0d('0x11'));var logger=require('../../config/logger')(_0x7b0d('0x12'));var utils=require(_0x7b0d('0x13'));var config=require(_0x7b0d('0x14'));var licenseUtil=require(_0x7b0d('0x15'));var db=require(_0x7b0d('0x16'))['db'];function respondWithStatusCode(_0x12beb0,_0x4e38fb){_0x4e38fb=_0x4e38fb||0xcc;return function(_0x2a8c1b){if(_0x2a8c1b){return _0x12beb0[_0x7b0d('0x17')](_0x4e38fb);}return _0x12beb0[_0x7b0d('0x18')](_0x4e38fb)[_0x7b0d('0x19')]();};}function respondWithResult(_0x2db82e,_0x4cac74){_0x4cac74=_0x4cac74||0xc8;return function(_0x25a836){if(_0x25a836){return _0x2db82e[_0x7b0d('0x18')](_0x4cac74)[_0x7b0d('0x1a')](_0x25a836);}};}function respondWithFilteredResult(_0xe7d282,_0x2278a5){return function(_0x4ea517){if(_0x4ea517){var _0x31b0f1=typeof _0x2278a5[_0x7b0d('0x1b')]==='undefined'&&typeof _0x2278a5['limit']===_0x7b0d('0x1c');var _0x4f07c0=_0x4ea517[_0x7b0d('0x1d')];var _0x5f1016=_0x31b0f1?0x0:_0x2278a5[_0x7b0d('0x1b')];var _0x206ba3=_0x31b0f1?_0x4ea517[_0x7b0d('0x1d')]:_0x2278a5[_0x7b0d('0x1b')]+_0x2278a5['limit'];var _0x396799;if(_0x206ba3>=_0x4f07c0){_0x206ba3=_0x4f07c0;_0x396799=0xc8;}else{_0x396799=0xce;}_0xe7d282[_0x7b0d('0x18')](_0x396799);return _0xe7d282[_0x7b0d('0x1e')](_0x7b0d('0x1f'),_0x5f1016+'-'+_0x206ba3+'/'+_0x4f07c0)[_0x7b0d('0x1a')](_0x4ea517);}return null;};}function patchUpdates(_0x516970){return function(_0x28e0f8){try{jsonpatch[_0x7b0d('0x20')](_0x28e0f8,_0x516970,!![]);}catch(_0x1ddd5e){return BPromise[_0x7b0d('0x21')](_0x1ddd5e);}return _0x28e0f8[_0x7b0d('0x22')]();};}function saveUpdates(_0x1325b0,_0x272f69){return function(_0x54fee6){if(_0x54fee6){return _0x54fee6[_0x7b0d('0x23')](_0x1325b0)[_0x7b0d('0x24')](function(_0x484941){return _0x484941;});}return null;};}function removeEntity(_0x3b67e9,_0x55bc1a){return function(_0x7617c){if(_0x7617c){return _0x7617c[_0x7b0d('0x25')]()[_0x7b0d('0x24')](function(){_0x3b67e9[_0x7b0d('0x18')](0xcc)[_0x7b0d('0x19')]();});}};}function handleEntityNotFound(_0x38764a,_0x5d0573){return function(_0x5003e3){if(!_0x5003e3){_0x38764a[_0x7b0d('0x17')](0x194);}return _0x5003e3;};}function handleError(_0x113e1d,_0x4b16c6){_0x4b16c6=_0x4b16c6||0x1f4;return function(_0x22df49){logger[_0x7b0d('0x26')](_0x22df49[_0x7b0d('0x27')]);if(_0x22df49[_0x7b0d('0x28')]){delete _0x22df49[_0x7b0d('0x28')];}_0x113e1d[_0x7b0d('0x18')](_0x4b16c6)[_0x7b0d('0x29')](_0x22df49);};}exports['index']=function(_0x474799,_0x6e67e2){var _0xb2490d={},_0x4d00bc={},_0xdf51db={'count':0x0,'rows':[]};var _0x1dbac5=_[_0x7b0d('0x2a')](db[_0x7b0d('0x2b')][_0x7b0d('0x2c')],function(_0x4abd94){return{'name':_0x4abd94[_0x7b0d('0x2d')],'type':_0x4abd94['type'][_0x7b0d('0x2e')]};});_0x4d00bc['model']=_[_0x7b0d('0x2a')](_0x1dbac5,_0x7b0d('0x28'));_0x4d00bc[_0x7b0d('0x2f')]=_[_0x7b0d('0x30')](_0x474799['query']);_0x4d00bc[_0x7b0d('0x31')]=_[_0x7b0d('0x32')](_0x4d00bc[_0x7b0d('0x33')],_0x4d00bc['query']);_0xb2490d[_0x7b0d('0x34')]=_[_0x7b0d('0x32')](_0x4d00bc['model'],qs[_0x7b0d('0x35')](_0x474799[_0x7b0d('0x2f')][_0x7b0d('0x35')]));_0xb2490d[_0x7b0d('0x34')]=_0xb2490d[_0x7b0d('0x34')][_0x7b0d('0x36')]?_0xb2490d['attributes']:_0x4d00bc[_0x7b0d('0x33')];if(!_0x474799[_0x7b0d('0x2f')][_0x7b0d('0x37')](_0x7b0d('0x38'))){_0xb2490d[_0x7b0d('0x39')]=qs['limit'](_0x474799[_0x7b0d('0x2f')][_0x7b0d('0x39')]);_0xb2490d[_0x7b0d('0x1b')]=qs[_0x7b0d('0x1b')](_0x474799['query'][_0x7b0d('0x1b')]);}_0xb2490d[_0x7b0d('0x3a')]=qs['sort'](_0x474799[_0x7b0d('0x2f')][_0x7b0d('0x3b')]);_0xb2490d[_0x7b0d('0x3c')]=qs['filters'](_['pick'](_0x474799['query'],_0x4d00bc['filters']),_0x1dbac5);if(_0x474799['query'][_0x7b0d('0x3d')]){_0xb2490d[_0x7b0d('0x3c')]=_[_0x7b0d('0x3e')](_0xb2490d[_0x7b0d('0x3c')],{'$or':_[_0x7b0d('0x2a')](_0x1dbac5,function(_0x13fbe1){if(_0x13fbe1[_0x7b0d('0x3f')]!==_0x7b0d('0x40')){var _0x3e23f4={};_0x3e23f4[_0x13fbe1[_0x7b0d('0x28')]]={'$like':'%'+_0x474799[_0x7b0d('0x2f')][_0x7b0d('0x3d')]+'%'};return _0x3e23f4;}})});}_0xb2490d=_[_0x7b0d('0x3e')]({},_0xb2490d,_0x474799[_0x7b0d('0x41')]);var _0x5ea415={'where':_0xb2490d[_0x7b0d('0x3c')]};return db[_0x7b0d('0x2b')][_0x7b0d('0x1d')](_0x5ea415)[_0x7b0d('0x24')](function(_0x4b6703){_0xdf51db[_0x7b0d('0x1d')]=_0x4b6703;if(_0x474799[_0x7b0d('0x2f')]['includeAll']){_0xb2490d[_0x7b0d('0x42')]=[{'all':!![]}];}return db[_0x7b0d('0x2b')][_0x7b0d('0x43')](_0xb2490d);})[_0x7b0d('0x24')](function(_0x34e45b){_0xdf51db[_0x7b0d('0x44')]=_0x34e45b;return _0xdf51db;})[_0x7b0d('0x24')](respondWithFilteredResult(_0x6e67e2,_0xb2490d))[_0x7b0d('0x45')](handleError(_0x6e67e2,null));};exports['show']=function(_0x1daadd,_0x1baeca){var _0x4ebb6c={'raw':!![],'where':{'id':_0x1daadd[_0x7b0d('0x46')]['id']}},_0x2073b5={};_0x2073b5[_0x7b0d('0x33')]=_[_0x7b0d('0x30')](db[_0x7b0d('0x2b')][_0x7b0d('0x2c')]);_0x2073b5['query']=_[_0x7b0d('0x30')](_0x1daadd['query']);_0x2073b5[_0x7b0d('0x31')]=_[_0x7b0d('0x32')](_0x2073b5[_0x7b0d('0x33')],_0x2073b5[_0x7b0d('0x2f')]);_0x4ebb6c[_0x7b0d('0x34')]=_['intersection'](_0x2073b5[_0x7b0d('0x33')],qs[_0x7b0d('0x35')](_0x1daadd[_0x7b0d('0x2f')][_0x7b0d('0x35')]));_0x4ebb6c[_0x7b0d('0x34')]=_0x4ebb6c['attributes']['length']?_0x4ebb6c[_0x7b0d('0x34')]:_0x2073b5[_0x7b0d('0x33')];if(_0x1daadd[_0x7b0d('0x2f')]['includeAll']){_0x4ebb6c[_0x7b0d('0x42')]=[{'all':!![]}];}_0x4ebb6c=_['merge']({},_0x4ebb6c,_0x1daadd[_0x7b0d('0x41')]);return db[_0x7b0d('0x2b')]['find'](_0x4ebb6c)[_0x7b0d('0x24')](handleEntityNotFound(_0x1baeca,null))['then'](respondWithResult(_0x1baeca,null))[_0x7b0d('0x45')](handleError(_0x1baeca,null));};exports[_0x7b0d('0x47')]=function(_0x4d33ba,_0x3537a9){return db[_0x7b0d('0x2b')][_0x7b0d('0x47')](_0x4d33ba[_0x7b0d('0x48')],{})[_0x7b0d('0x24')](respondWithResult(_0x3537a9,0xc9))[_0x7b0d('0x45')](handleError(_0x3537a9,null));};exports[_0x7b0d('0x23')]=function(_0x1c8ccf,_0x3dd2d1){if(_0x1c8ccf[_0x7b0d('0x48')]['id']){delete _0x1c8ccf[_0x7b0d('0x48')]['id'];}return db['VoiceDialReport'][_0x7b0d('0x49')]({'where':{'id':_0x1c8ccf['params']['id']}})[_0x7b0d('0x24')](handleEntityNotFound(_0x3dd2d1,null))[_0x7b0d('0x24')](saveUpdates(_0x1c8ccf[_0x7b0d('0x48')],null))['then'](respondWithResult(_0x3dd2d1,null))['catch'](handleError(_0x3dd2d1,null));};exports[_0x7b0d('0x25')]=function(_0x8048a7,_0x56e4c9){return db[_0x7b0d('0x2b')][_0x7b0d('0x49')]({'where':{'id':_0x8048a7[_0x7b0d('0x46')]['id']}})[_0x7b0d('0x24')](handleEntityNotFound(_0x56e4c9,null))[_0x7b0d('0x24')](removeEntity(_0x56e4c9,null))[_0x7b0d('0x45')](handleError(_0x56e4c9,null));};exports[_0x7b0d('0x4a')]=function(_0x336f64,_0x34fda7){return db[_0x7b0d('0x2b')][_0x7b0d('0x4a')]()[_0x7b0d('0x24')](respondWithResult(_0x34fda7,null))['catch'](handleError(_0x34fda7,null));}; \ No newline at end of file +var _0x50a2=['bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','name','index','VoiceDialReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','keys','options','find','create','describe','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x44a14f,_0x1c6d76){var _0x5f274a=function(_0x23635b){while(--_0x23635b){_0x44a14f['push'](_0x44a14f['shift']());}};_0x5f274a(++_0x1c6d76);}(_0x50a2,0x1f3));var _0x250a=function(_0x2f90e5,_0x33f676){_0x2f90e5=_0x2f90e5-0x0;var _0x30e9a3=_0x50a2[_0x2f90e5];return _0x30e9a3;};'use strict';var emlformat=require(_0x250a('0x0'));var rimraf=require(_0x250a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x250a('0x2'));var rp=require(_0x250a('0x3'));var moment=require(_0x250a('0x4'));var BPromise=require(_0x250a('0x5'));var Mustache=require(_0x250a('0x6'));var util=require(_0x250a('0x7'));var path=require(_0x250a('0x8'));var sox=require(_0x250a('0x9'));var csv=require(_0x250a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x250a('0xb'));var _=require(_0x250a('0xc'));var squel=require(_0x250a('0xd'));var crypto=require(_0x250a('0xe'));var jsforce=require(_0x250a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x250a('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x250a('0x10'));var authService=require(_0x250a('0x11'));var qs=require(_0x250a('0x12'));var as=require(_0x250a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x250a('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x250a('0x15'));var licenseUtil=require(_0x250a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x516961,_0x31b0e6){_0x31b0e6=_0x31b0e6||0xcc;return function(_0x417310){if(_0x417310){return _0x516961[_0x250a('0x17')](_0x31b0e6);}return _0x516961[_0x250a('0x18')](_0x31b0e6)['end']();};}function respondWithResult(_0x1db21d,_0xb1fdc4){_0xb1fdc4=_0xb1fdc4||0xc8;return function(_0x12cb1d){if(_0x12cb1d){return _0x1db21d[_0x250a('0x18')](_0xb1fdc4)[_0x250a('0x19')](_0x12cb1d);}};}function respondWithFilteredResult(_0x49b472,_0x11b850){return function(_0x11e3ca){if(_0x11e3ca){var _0x2cbab9=typeof _0x11b850[_0x250a('0x1a')]===_0x250a('0x1b')&&typeof _0x11b850[_0x250a('0x1c')]===_0x250a('0x1b');var _0x4a57dd=_0x11e3ca['count'];var _0x2748c4=_0x2cbab9?0x0:_0x11b850['offset'];var _0x5404b8=_0x2cbab9?_0x11e3ca[_0x250a('0x1d')]:_0x11b850[_0x250a('0x1a')]+_0x11b850[_0x250a('0x1c')];var _0x45d63e;if(_0x5404b8>=_0x4a57dd){_0x5404b8=_0x4a57dd;_0x45d63e=0xc8;}else{_0x45d63e=0xce;}_0x49b472[_0x250a('0x18')](_0x45d63e);return _0x49b472[_0x250a('0x1e')](_0x250a('0x1f'),_0x2748c4+'-'+_0x5404b8+'/'+_0x4a57dd)[_0x250a('0x19')](_0x11e3ca);}return null;};}function patchUpdates(_0x3668a1){return function(_0x47e57b){try{jsonpatch[_0x250a('0x20')](_0x47e57b,_0x3668a1,!![]);}catch(_0x5dd1b1){return BPromise[_0x250a('0x21')](_0x5dd1b1);}return _0x47e57b[_0x250a('0x22')]();};}function saveUpdates(_0x2827ea,_0xf8b40b){return function(_0x1a6bd8){if(_0x1a6bd8){return _0x1a6bd8[_0x250a('0x23')](_0x2827ea)[_0x250a('0x24')](function(_0x330a2c){return _0x330a2c;});}return null;};}function removeEntity(_0x5474c3,_0xe4b163){return function(_0x320693){if(_0x320693){return _0x320693['destroy']()['then'](function(){_0x5474c3['status'](0xcc)[_0x250a('0x25')]();});}};}function handleEntityNotFound(_0x4a0cc8,_0x103ef1){return function(_0x9b0d13){if(!_0x9b0d13){_0x4a0cc8[_0x250a('0x17')](0x194);}return _0x9b0d13;};}function handleError(_0x56f7af,_0x1555fe){_0x1555fe=_0x1555fe||0x1f4;return function(_0xd1d5dc){logger[_0x250a('0x26')](_0xd1d5dc['stack']);if(_0xd1d5dc['name']){delete _0xd1d5dc[_0x250a('0x27')];}_0x56f7af[_0x250a('0x18')](_0x1555fe)['send'](_0xd1d5dc);};}exports[_0x250a('0x28')]=function(_0x4c5ce9,_0x48d1a0){var _0x4d63ad={},_0x31a52c={},_0x211efc={'count':0x0,'rows':[]};var _0x1211ec=_['map'](db[_0x250a('0x29')][_0x250a('0x2a')],function(_0x1f6b8d){return{'name':_0x1f6b8d[_0x250a('0x2b')],'type':_0x1f6b8d[_0x250a('0x2c')][_0x250a('0x2d')]};});_0x31a52c[_0x250a('0x2e')]=_[_0x250a('0x2f')](_0x1211ec,_0x250a('0x27'));_0x31a52c[_0x250a('0x30')]=_['keys'](_0x4c5ce9[_0x250a('0x30')]);_0x31a52c[_0x250a('0x31')]=_[_0x250a('0x32')](_0x31a52c[_0x250a('0x2e')],_0x31a52c['query']);_0x4d63ad[_0x250a('0x33')]=_['intersection'](_0x31a52c[_0x250a('0x2e')],qs[_0x250a('0x34')](_0x4c5ce9['query'][_0x250a('0x34')]));_0x4d63ad[_0x250a('0x33')]=_0x4d63ad['attributes']['length']?_0x4d63ad[_0x250a('0x33')]:_0x31a52c[_0x250a('0x2e')];if(!_0x4c5ce9[_0x250a('0x30')][_0x250a('0x35')](_0x250a('0x36'))){_0x4d63ad[_0x250a('0x1c')]=qs[_0x250a('0x1c')](_0x4c5ce9[_0x250a('0x30')][_0x250a('0x1c')]);_0x4d63ad['offset']=qs[_0x250a('0x1a')](_0x4c5ce9[_0x250a('0x30')][_0x250a('0x1a')]);}_0x4d63ad[_0x250a('0x37')]=qs['sort'](_0x4c5ce9[_0x250a('0x30')][_0x250a('0x38')]);_0x4d63ad['where']=qs[_0x250a('0x31')](_['pick'](_0x4c5ce9[_0x250a('0x30')],_0x31a52c[_0x250a('0x31')]),_0x1211ec);if(_0x4c5ce9[_0x250a('0x30')]['filter']){_0x4d63ad[_0x250a('0x39')]=_[_0x250a('0x3a')](_0x4d63ad[_0x250a('0x39')],{'$or':_['map'](_0x1211ec,function(_0x6adaa9){if(_0x6adaa9[_0x250a('0x2c')]!==_0x250a('0x3b')){var _0x1a8e13={};_0x1a8e13[_0x6adaa9['name']]={'$like':'%'+_0x4c5ce9[_0x250a('0x30')][_0x250a('0x3c')]+'%'};return _0x1a8e13;}})});}_0x4d63ad=_['merge']({},_0x4d63ad,_0x4c5ce9['options']);var _0x3ef174={'where':_0x4d63ad[_0x250a('0x39')]};return db[_0x250a('0x29')][_0x250a('0x1d')](_0x3ef174)[_0x250a('0x24')](function(_0x508cc7){_0x211efc[_0x250a('0x1d')]=_0x508cc7;if(_0x4c5ce9[_0x250a('0x30')][_0x250a('0x3d')]){_0x4d63ad[_0x250a('0x3e')]=[{'all':!![]}];}return db[_0x250a('0x29')][_0x250a('0x3f')](_0x4d63ad);})['then'](function(_0xdf64d3){_0x211efc[_0x250a('0x40')]=_0xdf64d3;return _0x211efc;})[_0x250a('0x24')](respondWithFilteredResult(_0x48d1a0,_0x4d63ad))[_0x250a('0x41')](handleError(_0x48d1a0,null));};exports['show']=function(_0x14a468,_0x1adf18){var _0x58f806={'raw':!![],'where':{'id':_0x14a468[_0x250a('0x42')]['id']}},_0x1b20d5={};_0x1b20d5[_0x250a('0x2e')]=_[_0x250a('0x43')](db[_0x250a('0x29')]['rawAttributes']);_0x1b20d5[_0x250a('0x30')]=_[_0x250a('0x43')](_0x14a468[_0x250a('0x30')]);_0x1b20d5[_0x250a('0x31')]=_[_0x250a('0x32')](_0x1b20d5[_0x250a('0x2e')],_0x1b20d5[_0x250a('0x30')]);_0x58f806['attributes']=_[_0x250a('0x32')](_0x1b20d5[_0x250a('0x2e')],qs[_0x250a('0x34')](_0x14a468[_0x250a('0x30')][_0x250a('0x34')]));_0x58f806['attributes']=_0x58f806[_0x250a('0x33')]['length']?_0x58f806[_0x250a('0x33')]:_0x1b20d5[_0x250a('0x2e')];if(_0x14a468[_0x250a('0x30')][_0x250a('0x3d')]){_0x58f806[_0x250a('0x3e')]=[{'all':!![]}];}_0x58f806=_[_0x250a('0x3a')]({},_0x58f806,_0x14a468[_0x250a('0x44')]);return db[_0x250a('0x29')][_0x250a('0x45')](_0x58f806)['then'](handleEntityNotFound(_0x1adf18,null))[_0x250a('0x24')](respondWithResult(_0x1adf18,null))['catch'](handleError(_0x1adf18,null));};exports[_0x250a('0x46')]=function(_0x2f213c,_0x39f577){return db['VoiceDialReport'][_0x250a('0x46')](_0x2f213c['body'],{})[_0x250a('0x24')](respondWithResult(_0x39f577,0xc9))['catch'](handleError(_0x39f577,null));};exports[_0x250a('0x23')]=function(_0x5358f7,_0x1ede5f){if(_0x5358f7['body']['id']){delete _0x5358f7['body']['id'];}return db['VoiceDialReport'][_0x250a('0x45')]({'where':{'id':_0x5358f7[_0x250a('0x42')]['id']}})['then'](handleEntityNotFound(_0x1ede5f,null))[_0x250a('0x24')](saveUpdates(_0x5358f7['body'],null))[_0x250a('0x24')](respondWithResult(_0x1ede5f,null))['catch'](handleError(_0x1ede5f,null));};exports['destroy']=function(_0x3f0ecd,_0x33c621){return db[_0x250a('0x29')][_0x250a('0x45')]({'where':{'id':_0x3f0ecd[_0x250a('0x42')]['id']}})[_0x250a('0x24')](handleEntityNotFound(_0x33c621,null))[_0x250a('0x24')](removeEntity(_0x33c621,null))[_0x250a('0x41')](handleError(_0x33c621,null));};exports[_0x250a('0x47')]=function(_0xf028a8,_0x617185){return db[_0x250a('0x29')][_0x250a('0x47')]()[_0x250a('0x24')](respondWithResult(_0x617185,null))['catch'](handleError(_0x617185,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index cbb6e8b..6292889 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 _0xec96=['bluebird','request-promise','path','../../config/environment','./voiceDialReport.attributes','define','VoiceDialReport','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x57ec62,_0x477fec){var _0x2bd069=function(_0x209f70){while(--_0x209f70){_0x57ec62['push'](_0x57ec62['shift']());}};_0x2bd069(++_0x477fec);}(_0xec96,0x119));var _0x6ec9=function(_0x4fda5b,_0x5f0784){_0x4fda5b=_0x4fda5b-0x0;var _0x11b743=_0xec96[_0x4fda5b];return _0x11b743;};'use strict';var _=require(_0x6ec9('0x0'));var util=require(_0x6ec9('0x1'));var logger=require(_0x6ec9('0x2'))(_0x6ec9('0x3'));var moment=require(_0x6ec9('0x4'));var BPromise=require(_0x6ec9('0x5'));var rp=require(_0x6ec9('0x6'));var fs=require('fs');var path=require(_0x6ec9('0x7'));var rimraf=require('rimraf');var config=require(_0x6ec9('0x8'));var attributes=require(_0x6ec9('0x9'));module['exports']=function(_0x2a37b6,_0x3ccc23){return _0x2a37b6[_0x6ec9('0xa')](_0x6ec9('0xb'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x6ec9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3291=['define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x57e692,_0x533428){var _0x373592=function(_0x11ac5b){while(--_0x11ac5b){_0x57e692['push'](_0x57e692['shift']());}};_0x373592(++_0x533428);}(_0x3291,0x1cb));var _0x1329=function(_0x119840,_0x5610b7){_0x119840=_0x119840-0x0;var _0x262bdd=_0x3291[_0x119840];return _0x262bdd;};'use strict';var _=require(_0x1329('0x0'));var util=require(_0x1329('0x1'));var logger=require(_0x1329('0x2'))('api');var moment=require(_0x1329('0x3'));var BPromise=require(_0x1329('0x4'));var rp=require(_0x1329('0x5'));var fs=require('fs');var path=require(_0x1329('0x6'));var rimraf=require(_0x1329('0x7'));var config=require(_0x1329('0x8'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x556d3c,_0x44381f){return _0x556d3c[_0x1329('0x9')](_0x1329('0xa'),attributes,{'tableName':_0x1329('0xb'),'paranoid':![],'indexes':[{'fields':[_0x1329('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index bc586fb..f58f375 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 _0xe0aa=['../../config/environment','http','request','VoiceDialReport,\x20%s,\x20%s','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','CreateVoiceDialReport','VoiceDialReport','body','options','raw','then','catch','UpdateVoiceDialReport','where','attributes','limit','debug','lodash','util','moment','../../config/logger','rpc'];(function(_0x614ef4,_0x28a060){var _0x35e8e2=function(_0x55e81b){while(--_0x55e81b){_0x614ef4['push'](_0x614ef4['shift']());}};_0x35e8e2(++_0x28a060);}(_0xe0aa,0x191));var _0xae0a=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xe0aa[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0xae0a('0x0'));var util=require(_0xae0a('0x1'));var moment=require(_0xae0a('0x2'));var BPromise=require('bluebird');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(_0xae0a('0x3'))(_0xae0a('0x4'));var config=require(_0xae0a('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xae0a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x22d783,_0x20f830,_0x172f63){return new BPromise(function(_0x1e748c,_0x57dff1){return client[_0xae0a('0x7')](_0x22d783,_0x172f63)['then'](function(_0x56ecab){logger['info'](_0xae0a('0x8'),_0x20f830,'request\x20sent');logger['debug'](_0xae0a('0x9'),_0x20f830,'request\x20sent',JSON[_0xae0a('0xa')](_0x56ecab));if(_0x56ecab[_0xae0a('0xb')]){if(_0x56ecab[_0xae0a('0xb')][_0xae0a('0xc')]===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x20f830,_0x56ecab[_0xae0a('0xb')][_0xae0a('0xd')]);return _0x57dff1(_0x56ecab[_0xae0a('0xb')][_0xae0a('0xd')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x20f830,_0x56ecab[_0xae0a('0xb')][_0xae0a('0xd')]);return _0x1e748c(_0x56ecab[_0xae0a('0xb')][_0xae0a('0xd')]);}else{logger[_0xae0a('0xe')](_0xae0a('0x8'),_0x20f830,_0xae0a('0xf'));_0x1e748c(_0x56ecab[_0xae0a('0x10')]['message']);}})['catch'](function(_0x4dc723){logger[_0xae0a('0xb')]('VoiceDialReport,\x20%s,\x20%s',_0x20f830,_0x4dc723);_0x57dff1(_0x4dc723);});});}exports[_0xae0a('0x11')]=function(_0x2fbe75){var _0x19a36c=this;return new Promise(function(_0x3ce9ce,_0x3c9e63){return db[_0xae0a('0x12')]['create'](_0x2fbe75[_0xae0a('0x13')],{'raw':_0x2fbe75[_0xae0a('0x14')]?_0x2fbe75[_0xae0a('0x14')][_0xae0a('0x15')]===undefined?!![]:![]:!![]})[_0xae0a('0x16')](function(_0x196670){logger[_0xae0a('0xe')](_0xae0a('0x11'),_0x2fbe75);logger['debug'](_0xae0a('0x11'),_0x2fbe75,JSON[_0xae0a('0xa')](_0x196670));_0x3ce9ce(_0x196670);})[_0xae0a('0x17')](function(_0x442d3a){logger[_0xae0a('0xb')](_0xae0a('0x11'),_0x442d3a[_0xae0a('0xd')],_0x2fbe75);_0x3c9e63(_0x19a36c[_0xae0a('0xb')](0x1f4,_0x442d3a['message']));});});};exports[_0xae0a('0x18')]=function(_0x104645){var _0x12cef9=this;return new Promise(function(_0x313e41,_0x526375){return db[_0xae0a('0x12')]['update'](_0x104645[_0xae0a('0x13')],{'raw':_0x104645['options']?_0x104645[_0xae0a('0x14')][_0xae0a('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x104645[_0xae0a('0x14')]?_0x104645['options'][_0xae0a('0x19')]||null:null,'attributes':_0x104645[_0xae0a('0x14')]?_0x104645['options'][_0xae0a('0x1a')]||null:null,'limit':_0x104645[_0xae0a('0x14')]?_0x104645[_0xae0a('0x14')][_0xae0a('0x1b')]||null:null})[_0xae0a('0x16')](function(_0x2ba8ab){logger[_0xae0a('0xe')]('UpdateVoiceDialReport',_0x104645);logger[_0xae0a('0x1c')](_0xae0a('0x18'),_0x104645,JSON['stringify'](_0x2ba8ab));_0x313e41(_0x2ba8ab);})[_0xae0a('0x17')](function(_0x224ae8){logger[_0xae0a('0xb')](_0xae0a('0x18'),_0x224ae8[_0xae0a('0xd')],_0x104645);_0x526375(_0x12cef9[_0xae0a('0xb')](0x1f4,_0x224ae8[_0xae0a('0xd')]));});});}; \ No newline at end of file +var _0x6038=['then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','options','raw','UpdateVoiceDialReport','body','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6038,0xfc));var _0x8603=function(_0x1f26fe,_0xe0e914){_0x1f26fe=_0x1f26fe-0x0;var _0x4a73f6=_0x6038[_0x1f26fe];return _0x4a73f6;};'use strict';var _=require('lodash');var util=require(_0x8603('0x0'));var moment=require(_0x8603('0x1'));var BPromise=require(_0x8603('0x2'));var rs=require(_0x8603('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8603('0x4'))['db'];var utils=require(_0x8603('0x5'));var logger=require(_0x8603('0x6'))('rpc');var config=require(_0x8603('0x7'));var jayson=require(_0x8603('0x8'));var client=jayson[_0x8603('0x9')][_0x8603('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1127fa,_0x5d664a,_0x517c85){return new BPromise(function(_0x2cdb86,_0x2afbbb){return client[_0x8603('0xb')](_0x1127fa,_0x517c85)[_0x8603('0xc')](function(_0x161359){logger[_0x8603('0xd')](_0x8603('0xe'),_0x5d664a,'request\x20sent');logger[_0x8603('0xf')](_0x8603('0x10'),_0x5d664a,_0x8603('0x11'),JSON[_0x8603('0x12')](_0x161359));if(_0x161359[_0x8603('0x13')]){if(_0x161359['error'][_0x8603('0x14')]===0x1f4){logger[_0x8603('0x13')](_0x8603('0xe'),_0x5d664a,_0x161359[_0x8603('0x13')][_0x8603('0x15')]);return _0x2afbbb(_0x161359['error'][_0x8603('0x15')]);}logger[_0x8603('0x13')](_0x8603('0xe'),_0x5d664a,_0x161359['error'][_0x8603('0x15')]);return _0x2cdb86(_0x161359[_0x8603('0x13')][_0x8603('0x15')]);}else{logger['info'](_0x8603('0xe'),_0x5d664a,_0x8603('0x11'));_0x2cdb86(_0x161359[_0x8603('0x16')][_0x8603('0x15')]);}})[_0x8603('0x17')](function(_0x16cbde){logger[_0x8603('0x13')](_0x8603('0xe'),_0x5d664a,_0x16cbde);_0x2afbbb(_0x16cbde);});});}exports[_0x8603('0x18')]=function(_0x2c2610){var _0x503ce0=this;return new Promise(function(_0x4ab14f,_0x1e29d0){return db[_0x8603('0x19')][_0x8603('0x1a')](_0x2c2610['body'],{'raw':_0x2c2610['options']?_0x2c2610[_0x8603('0x1b')][_0x8603('0x1c')]===undefined?!![]:![]:!![]})[_0x8603('0xc')](function(_0x5919fe){logger[_0x8603('0xd')](_0x8603('0x18'),_0x2c2610);logger[_0x8603('0xf')](_0x8603('0x18'),_0x2c2610,JSON[_0x8603('0x12')](_0x5919fe));_0x4ab14f(_0x5919fe);})['catch'](function(_0x3ff34b){logger[_0x8603('0x13')](_0x8603('0x18'),_0x3ff34b[_0x8603('0x15')],_0x2c2610);_0x1e29d0(_0x503ce0['error'](0x1f4,_0x3ff34b['message']));});});};exports[_0x8603('0x1d')]=function(_0x4b2dc0){var _0x37989c=this;return new Promise(function(_0x1b033d,_0x1f8b55){return db[_0x8603('0x19')]['update'](_0x4b2dc0[_0x8603('0x1e')],{'raw':_0x4b2dc0[_0x8603('0x1b')]?_0x4b2dc0['options'][_0x8603('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b2dc0['options']?_0x4b2dc0['options']['where']||null:null,'attributes':_0x4b2dc0[_0x8603('0x1b')]?_0x4b2dc0[_0x8603('0x1b')][_0x8603('0x1f')]||null:null,'limit':_0x4b2dc0[_0x8603('0x1b')]?_0x4b2dc0[_0x8603('0x1b')][_0x8603('0x20')]||null:null})[_0x8603('0xc')](function(_0x41d10){logger[_0x8603('0xd')](_0x8603('0x1d'),_0x4b2dc0);logger[_0x8603('0xf')](_0x8603('0x1d'),_0x4b2dc0,JSON[_0x8603('0x12')](_0x41d10));_0x1b033d(_0x41d10);})[_0x8603('0x17')](function(_0x4c16e9){logger[_0x8603('0x13')](_0x8603('0x1d'),_0x4c16e9[_0x8603('0x15')],_0x4b2dc0);_0x1f8b55(_0x37989c[_0x8603('0x13')](0x1f4,_0x4c16e9[_0x8603('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index b6377e1..278b0a0 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 _0x887e=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','isAuthenticated','index','/:id','show','post','/:id/applications','addApplications','put','update','delete','destroy','multer','util'];(function(_0x2654d0,_0x53ae74){var _0x38384f=function(_0x474639){while(--_0x474639){_0x2654d0['push'](_0x2654d0['shift']());}};_0x38384f(++_0x53ae74);}(_0x887e,0x174));var _0xe887=function(_0x5066b8,_0x435bb3){_0x5066b8=_0x5066b8-0x0;var _0x372683=_0x887e[_0x5066b8];return _0x372683;};'use strict';var multer=require(_0xe887('0x0'));var util=require(_0xe887('0x1'));var path=require(_0xe887('0x2'));var timeout=require(_0xe887('0x3'));var express=require(_0xe887('0x4'));var router=express[_0xe887('0x5')]();var fs_extra=require(_0xe887('0x6'));var auth=require(_0xe887('0x7'));var interaction=require(_0xe887('0x8'));var config=require(_0xe887('0x9'));var controller=require(_0xe887('0xa'));router['get']('/',auth[_0xe887('0xb')](),controller[_0xe887('0xc')]);router['get'](_0xe887('0xd'),auth[_0xe887('0xb')](),controller[_0xe887('0xe')]);router[_0xe887('0xf')]('/',auth[_0xe887('0xb')](),controller['create']);router[_0xe887('0xf')](_0xe887('0x10'),auth['isAuthenticated'](),controller[_0xe887('0x11')]);router[_0xe887('0x12')](_0xe887('0xd'),auth[_0xe887('0xb')](),controller[_0xe887('0x13')]);router[_0xe887('0x14')]('/:id',auth[_0xe887('0xb')](),controller[_0xe887('0x15')]);module['exports']=router; \ No newline at end of file +var _0x8fa8=['util','path','connect-timeout','Router','fs-extra','../../config/environment','./voiceExtension.controller','isAuthenticated','get','/:id','show','post','addApplications','put','destroy','multer'];(function(_0x13137e,_0x29c0f3){var _0x346261=function(_0x8c7d4f){while(--_0x8c7d4f){_0x13137e['push'](_0x13137e['shift']());}};_0x346261(++_0x29c0f3);}(_0x8fa8,0xef));var _0x88fa=function(_0x43f235,_0x4f58e6){_0x43f235=_0x43f235-0x0;var _0x299390=_0x8fa8[_0x43f235];return _0x299390;};'use strict';var multer=require(_0x88fa('0x0'));var util=require(_0x88fa('0x1'));var path=require(_0x88fa('0x2'));var timeout=require(_0x88fa('0x3'));var express=require('express');var router=express[_0x88fa('0x4')]();var fs_extra=require(_0x88fa('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x88fa('0x6'));var controller=require(_0x88fa('0x7'));router['get']('/',auth[_0x88fa('0x8')](),controller['index']);router[_0x88fa('0x9')](_0x88fa('0xa'),auth[_0x88fa('0x8')](),controller[_0x88fa('0xb')]);router[_0x88fa('0xc')]('/',auth[_0x88fa('0x8')](),controller['create']);router['post']('/:id/applications',auth[_0x88fa('0x8')](),controller[_0x88fa('0xd')]);router[_0x88fa('0xe')](_0x88fa('0xa'),auth[_0x88fa('0x8')](),controller['update']);router['delete'](_0x88fa('0xa'),auth['isAuthenticated'](),controller[_0x88fa('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 677e63d..56d5811 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 _0xc6a6=['internal','outbound-fax','system','any','BOOLEAN','INTEGER','wav','getDataValue','sequelize','exports','STRING','compositeIndex','NoOp','ENUM'];(function(_0x190dd3,_0x49c59c){var _0x57cabc=function(_0x450732){while(--_0x450732){_0x190dd3['push'](_0x190dd3['shift']());}};_0x57cabc(++_0x49c59c);}(_0xc6a6,0x158));var _0x6c6a=function(_0x926def,_0x42c0e9){_0x926def=_0x926def-0x0;var _0x2d3d82=_0xc6a6[_0x926def];return _0x2d3d82;};'use strict';var Sequelize=require(_0x6c6a('0x0'));module[_0x6c6a('0x1')]={'context':{'type':Sequelize[_0x6c6a('0x2')],'allowNull':![],'unique':_0x6c6a('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x6c6a('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x6c6a('0x3')},'tag':{'type':Sequelize[_0x6c6a('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x6c6a('0x2')],'allowNull':![],'defaultValue':_0x6c6a('0x4')},'appdata':{'type':Sequelize[_0x6c6a('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x6c6a('0x5')]('inbound','outbound',_0x6c6a('0x6'),'inbound-fax',_0x6c6a('0x7'),_0x6c6a('0x8'),_0x6c6a('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x6c6a('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x6c6a('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x6c6a('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x6c6a('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x6c6a('0xb')]},'recordingFormat':{'type':Sequelize[_0x6c6a('0x2')],'defaultValue':_0x6c6a('0xc')},'answer':{'type':Sequelize[_0x6c6a('0xa')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xf69475){return this[_0x6c6a('0xd')]('exten');}},'alias':{'type':Sequelize[_0x6c6a('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xd648=['STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','outbound-fax','any','INTEGER','BOOLEAN','wav','VIRTUAL','exten','sequelize','exports'];(function(_0x351cbd,_0x11342b){var _0x164e92=function(_0x559443){while(--_0x559443){_0x351cbd['push'](_0x351cbd['shift']());}};_0x164e92(++_0x11342b);}(_0xd648,0x9e));var _0x8d64=function(_0x4c0a7a,_0xc8e1ac){_0x4c0a7a=_0x4c0a7a-0x0;var _0xe258c8=_0xd648[_0x4c0a7a];return _0xe258c8;};'use strict';var Sequelize=require(_0x8d64('0x0'));module[_0x8d64('0x1')]={'context':{'type':Sequelize[_0x8d64('0x2')],'allowNull':![],'unique':_0x8d64('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8d64('0x3')},'priority':{'type':Sequelize[_0x8d64('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x8d64('0x3')},'tag':{'type':Sequelize[_0x8d64('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8d64('0x4')},'appdata':{'type':Sequelize[_0x8d64('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x8d64('0x5')](_0x8d64('0x6'),_0x8d64('0x7'),_0x8d64('0x8'),'inbound-fax',_0x8d64('0x9'),'system',_0x8d64('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x8d64('0x2')]},'interval':{'type':Sequelize[_0x8d64('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x8d64('0xb')]},'isApp':{'type':Sequelize[_0x8d64('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x8d64('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x8d64('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x8d64('0xb')]},'recordingFormat':{'type':Sequelize[_0x8d64('0x2')],'defaultValue':_0x8d64('0xd')},'answer':{'type':Sequelize[_0x8d64('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x8d64('0xe')],'get':function(_0x3d53b3){return this['getDataValue'](_0x8d64('0xf'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 737cf78..2d5646e 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 _0xcf92=['hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','options','include','findAll','rows','catch','fields','length','includeAll','params','create','outbound','startsWith','body','exten','concat','role','user','InboundRoutes','inbound','InternalRoutes','find','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','cutdigits','alias','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','then','get','OutboundRoutes','internal','filter','ignore','map','value','includes','type','name','UserProfileResource','destroy','error','stack','send','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes'];(function(_0x5e8282,_0x1f2962){var _0x5cd37d=function(_0x208ec7){while(--_0x208ec7){_0x5e8282['push'](_0x5e8282['shift']());}};_0x5cd37d(++_0x1f2962);}(_0xcf92,0xea));var _0x2cf9=function(_0x49f07c,_0x455715){_0x49f07c=_0x49f07c-0x0;var _0x5d09ba=_0xcf92[_0x49f07c];return _0x5d09ba;};'use strict';var _=require(_0x2cf9('0x0'));var Redis=require(_0x2cf9('0x1'));var qs=require(_0x2cf9('0x2'));var logger=require('../../config/logger')(_0x2cf9('0x3'));var config=require(_0x2cf9('0x4'));var db=require('../../mysqldb')['db'];config[_0x2cf9('0x5')]=_[_0x2cf9('0x6')](config[_0x2cf9('0x5')],{'host':_0x2cf9('0x7'),'port':0x18eb});var socket=require(_0x2cf9('0x8'))(new Redis(config[_0x2cf9('0x5')]));require(_0x2cf9('0x9'))['register'](socket);function respondWithStatusCode(_0x33e375,_0x218240){_0x218240=_0x218240||0xcc;return function(_0x35df30){if(_0x35df30){return _0x33e375[_0x2cf9('0xa')](_0x218240);}return _0x33e375[_0x2cf9('0xb')](_0x218240)[_0x2cf9('0xc')]();};}function respondWithResult(_0x14d49d,_0x536918){_0x536918=_0x536918||0xc8;return function(_0xc6a0a6){if(_0xc6a0a6){return _0x14d49d['status'](_0x536918)[_0x2cf9('0xd')](_0xc6a0a6);}};}function respondWithFilteredResult(_0x5e3f1b,_0x137efd){return function(_0x508fd0){if(_0x508fd0){var _0x45966d=typeof _0x137efd['offset']===_0x2cf9('0xe')&&typeof _0x137efd[_0x2cf9('0xf')]==='undefined';var _0x521d2b=_0x508fd0[_0x2cf9('0x10')];var _0x4bed9f=_0x45966d?0x0:_0x137efd[_0x2cf9('0x11')];var _0x542c18=_0x45966d?_0x508fd0['count']:_0x137efd[_0x2cf9('0x11')]+_0x137efd['limit'];var _0x4647b0;if(_0x542c18>=_0x521d2b){_0x542c18=_0x521d2b;_0x4647b0=0xc8;}else{_0x4647b0=0xce;}_0x5e3f1b['status'](_0x4647b0);return _0x5e3f1b[_0x2cf9('0x12')]('Content-Range',_0x4bed9f+'-'+_0x542c18+'/'+_0x521d2b)[_0x2cf9('0xd')](_0x508fd0);}return null;};}function removeEntity(_0xc82894){return function(_0x120550){if(_0x120550){return _0x120550['destroy']()[_0x2cf9('0x13')](function(){var _0x14bb17=_0x120550[_0x2cf9('0x14')]({'plain':!![]});var _0x550158=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':_0x2cf9('0x15'),'value':'outbound','ignore':![]},{'name':'InternalRoutes','value':_0x2cf9('0x16'),'ignore':![]}];var _0x5b1de3=_(_0x550158)[_0x2cf9('0x17')](_0x2cf9('0x18'))[_0x2cf9('0x19')]('value')[_0x2cf9('0x1a')]();if(_[_0x2cf9('0x1b')](_0x5b1de3,_0x14bb17[_0x2cf9('0x1c')])){return;}var _0x2abf75=_['find'](_0x550158,[_0x2cf9('0x1a'),_0x14bb17[_0x2cf9('0x1c')]])[_0x2cf9('0x1d')];return db[_0x2cf9('0x1e')][_0x2cf9('0x1f')]({'where':{'type':_0x2abf75,'resourceId':_0x14bb17['id']}})[_0x2cf9('0x13')](function(){return _0x120550;});})[_0x2cf9('0x13')](function(){_0xc82894['status'](0xcc)[_0x2cf9('0xc')]();});}};}function handleEntityNotFound(_0x1f3d30){return function(_0x1a1cbe){if(!_0x1a1cbe){_0x1f3d30[_0x2cf9('0xa')](0x194);}return _0x1a1cbe;};}function handleError(_0x17e70f,_0x27db98){_0x27db98=_0x27db98||0x1f4;return function(_0x1added){logger[_0x2cf9('0x20')](_0x1added[_0x2cf9('0x21')]);if(_0x1added['name']){delete _0x1added['name'];}_0x17e70f[_0x2cf9('0xb')](_0x27db98)[_0x2cf9('0x22')](_0x1added);};}exports['index']=function(_0x5a073d,_0x327cde){var _0x2e5b2b={},_0x1b0991={},_0x4ba24e={'count':0x0,'rows':[]};var _0xae2bc3=_[_0x2cf9('0x19')](db[_0x2cf9('0x23')][_0x2cf9('0x24')],function(_0x512e69){return{'name':_0x512e69[_0x2cf9('0x25')],'type':_0x512e69[_0x2cf9('0x1c')][_0x2cf9('0x26')]};});_0x1b0991[_0x2cf9('0x27')]=_[_0x2cf9('0x19')](_0xae2bc3,'name');_0x1b0991[_0x2cf9('0x28')]=_[_0x2cf9('0x29')](_0x5a073d[_0x2cf9('0x28')]);_0x1b0991[_0x2cf9('0x2a')]=_[_0x2cf9('0x2b')](_0x1b0991[_0x2cf9('0x27')],_0x1b0991[_0x2cf9('0x28')]);_0x2e5b2b[_0x2cf9('0x2c')]=_[_0x2cf9('0x2b')](_0x1b0991[_0x2cf9('0x27')],qs['fields'](_0x5a073d['query']['fields']));_0x2e5b2b[_0x2cf9('0x2c')]=_0x2e5b2b[_0x2cf9('0x2c')]['length']?_0x2e5b2b['attributes']:_0x1b0991[_0x2cf9('0x27')];if(!_0x5a073d[_0x2cf9('0x28')][_0x2cf9('0x2d')]('nolimit')){_0x2e5b2b[_0x2cf9('0xf')]=qs[_0x2cf9('0xf')](_0x5a073d['query'][_0x2cf9('0xf')]);_0x2e5b2b[_0x2cf9('0x11')]=qs['offset'](_0x5a073d[_0x2cf9('0x28')]['offset']);}_0x2e5b2b[_0x2cf9('0x2e')]=qs[_0x2cf9('0x2f')](_0x5a073d[_0x2cf9('0x28')][_0x2cf9('0x2f')]);_0x2e5b2b['where']=qs[_0x2cf9('0x2a')](_[_0x2cf9('0x30')](_0x5a073d[_0x2cf9('0x28')],_0x1b0991[_0x2cf9('0x2a')]),_0xae2bc3);if(_0x5a073d[_0x2cf9('0x28')][_0x2cf9('0x17')]){_0x2e5b2b[_0x2cf9('0x31')]=_[_0x2cf9('0x32')](_0x2e5b2b['where'],{'$or':_[_0x2cf9('0x19')](_0xae2bc3,function(_0x257110){if(_0x257110[_0x2cf9('0x1c')]!==_0x2cf9('0x33')){var _0x5476ec={};_0x5476ec[_0x257110['name']]={'$like':'%'+_0x5a073d[_0x2cf9('0x28')][_0x2cf9('0x17')]+'%'};return _0x5476ec;}})});}_0x2e5b2b=_[_0x2cf9('0x32')]({},_0x2e5b2b,_0x5a073d[_0x2cf9('0x34')]);var _0x19464a={'where':_0x2e5b2b[_0x2cf9('0x31')]};return db[_0x2cf9('0x23')][_0x2cf9('0x10')](_0x19464a)[_0x2cf9('0x13')](function(_0x31105e){_0x4ba24e[_0x2cf9('0x10')]=_0x31105e;if(_0x5a073d[_0x2cf9('0x28')]['includeAll']){_0x2e5b2b[_0x2cf9('0x35')]=[{'all':!![]}];}return db[_0x2cf9('0x23')][_0x2cf9('0x36')](_0x2e5b2b);})[_0x2cf9('0x13')](function(_0x50ab96){_0x4ba24e[_0x2cf9('0x37')]=_0x50ab96;return _0x4ba24e;})['then'](respondWithFilteredResult(_0x327cde,_0x2e5b2b))[_0x2cf9('0x38')](handleError(_0x327cde,null));};exports['show']=function(_0x3a0065,_0x39fc86){var _0x4a11cf={'raw':![],'where':{'id':_0x3a0065['params']['id']}},_0x371368={};_0x371368[_0x2cf9('0x27')]=_['keys'](db[_0x2cf9('0x23')]['rawAttributes']);_0x371368[_0x2cf9('0x28')]=_['keys'](_0x3a0065[_0x2cf9('0x28')]);_0x371368[_0x2cf9('0x2a')]=_[_0x2cf9('0x2b')](_0x371368[_0x2cf9('0x27')],_0x371368[_0x2cf9('0x28')]);_0x4a11cf[_0x2cf9('0x2c')]=_[_0x2cf9('0x2b')](_0x371368[_0x2cf9('0x27')],qs[_0x2cf9('0x39')](_0x3a0065[_0x2cf9('0x28')]['fields']));_0x4a11cf[_0x2cf9('0x2c')]=_0x4a11cf[_0x2cf9('0x2c')][_0x2cf9('0x3a')]?_0x4a11cf[_0x2cf9('0x2c')]:_0x371368[_0x2cf9('0x27')];if(_0x3a0065[_0x2cf9('0x28')][_0x2cf9('0x3b')]){_0x4a11cf[_0x2cf9('0x35')]=[{'all':!![]}];}_0x4a11cf=_['merge']({},_0x4a11cf,_0x3a0065[_0x2cf9('0x34')]);return db['VoiceExtension']['find'](_0x4a11cf)[_0x2cf9('0x13')](handleEntityNotFound(_0x39fc86,null))['then'](respondWithResult(_0x39fc86,null))['catch'](handleError(_0x39fc86,null));};exports[_0x2cf9('0x1f')]=function(_0x57355f,_0x520270){return db[_0x2cf9('0x23')]['find']({'where':{'id':_0x57355f[_0x2cf9('0x3c')]['id']}})[_0x2cf9('0x13')](handleEntityNotFound(_0x520270,null))[_0x2cf9('0x13')](removeEntity(_0x520270,null))[_0x2cf9('0x38')](handleError(_0x520270,null));};exports[_0x2cf9('0x3d')]=function(_0xb9ba40,_0x13f2ad){if(_0xb9ba40['body']['type']===_0x2cf9('0x3e')&&!_[_0x2cf9('0x3f')](_0xb9ba40[_0x2cf9('0x40')]['exten'],'_')){_0xb9ba40['body'][_0x2cf9('0x41')]='_'[_0x2cf9('0x42')](_0xb9ba40[_0x2cf9('0x40')]['exten']);}return db[_0x2cf9('0x23')][_0x2cf9('0x3d')](_0xb9ba40[_0x2cf9('0x40')],{'raw':![]})[_0x2cf9('0x13')](function(_0xfcbf5e){var _0x496321=_0xb9ba40['user']['get']({'plain':!![]});if(!_0x496321)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x496321[_0x2cf9('0x43')]===_0x2cf9('0x44')){var _0x17b04b=_0xfcbf5e[_0x2cf9('0x14')]({'plain':!![]});var _0x1c8d8f=[{'name':_0x2cf9('0x45'),'value':_0x2cf9('0x46')},{'name':_0x2cf9('0x15'),'value':_0x2cf9('0x3e')},{'name':_0x2cf9('0x47'),'value':_0x2cf9('0x16')}];var _0x9d9b55=_[_0x2cf9('0x48')](_0x1c8d8f,[_0x2cf9('0x1a'),_0x17b04b[_0x2cf9('0x1c')]])['name'];return db[_0x2cf9('0x49')]['find']({'where':{'name':_0x9d9b55,'userProfileId':_0x496321['userProfileId']},'raw':!![]})[_0x2cf9('0x13')](function(_0x473afd){if(_0x473afd&&_0x473afd[_0x2cf9('0x4a')]===0x0){return db['UserProfileResource'][_0x2cf9('0x3d')]({'name':_0x17b04b['name'],'resourceId':_0x17b04b['id'],'type':_0x473afd['name'],'sectionId':_0x473afd['id']},{})[_0x2cf9('0x13')](function(){return _0xfcbf5e;});}else{return _0xfcbf5e;}})['catch'](function(_0x3717eb){logger[_0x2cf9('0x20')](_0x2cf9('0x4b'),_0x3717eb);throw _0x3717eb;});}return _0xfcbf5e;})[_0x2cf9('0x13')](respondWithResult(_0x13f2ad,0xc9))['catch'](handleError(_0x13f2ad,null));};exports[_0x2cf9('0x4c')]=function(_0x42470c,_0x1cd809){if(_0x42470c[_0x2cf9('0x40')]['id']){delete _0x42470c['body']['id'];}return db[_0x2cf9('0x23')]['find']({'where':{'id':_0x42470c[_0x2cf9('0x3c')]['id']}})[_0x2cf9('0x13')](handleEntityNotFound(_0x1cd809,null))['then'](function(_0x3fd95b){if(_0x3fd95b){return db[_0x2cf9('0x23')][_0x2cf9('0x4c')](_[_0x2cf9('0x30')](_0x42470c[_0x2cf9('0x40')],[_0x2cf9('0x41'),_0x2cf9('0x4d'),'description',_0x2cf9('0x4e'),_0x2cf9('0x4f'),'mandatoryDisposition',_0x2cf9('0x50')]),{'where':{'context':_0x3fd95b[_0x2cf9('0x4d')],'exten':_0x3fd95b[_0x2cf9('0x41')]},'individualHooks':!![]})[_0x2cf9('0x13')](function(_0x69e83a){return _0x69e83a;});}return null;})[_0x2cf9('0x13')](respondWithStatusCode(_0x1cd809,null))[_0x2cf9('0x38')](handleError(_0x1cd809,null));};exports[_0x2cf9('0x51')]=function(_0x4efdf4,_0x4742df){var _0x408768=_0x4efdf4['params']['id'];var _0x3e87de=_0x4efdf4[_0x2cf9('0x40')];var _0x231fc3=0xc8;var _0x34ba79=null;return db[_0x2cf9('0x52')][_0x2cf9('0x53')]({'isolationLevel':db['sequelize'][_0x2cf9('0x54')][_0x2cf9('0x55')][_0x2cf9('0x56')]},function(_0x434bb1){return db['VoiceExtension'][_0x2cf9('0x57')]({'where':{'id':_0x408768},'transaction':_0x434bb1})[_0x2cf9('0x13')](function(_0x234c69){if(_0x234c69){return db['VoiceExtension'][_0x2cf9('0x1f')]({'where':{'VoiceExtensionId':_0x408768},'transaction':_0x434bb1})['then'](function(){var _0x469046=_['map'](_0x3e87de,function(_0x225f74){_0x225f74[_0x2cf9('0x58')]=_0x408768;_0x225f74[_0x2cf9('0x59')]=!![];return _0x225f74;});return _0x234c69['createRouting'](_0x469046);})[_0x2cf9('0x13')](function(_0x3f1054){return db[_0x2cf9('0x23')]['bulkCreate'](_0x3f1054,{'transaction':_0x434bb1});});}else{_0x231fc3=0x194;_0x34ba79=[];}});})[_0x2cf9('0x13')](function(){if(_0x231fc3!==0x194){return db[_0x2cf9('0x23')][_0x2cf9('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x408768},'order':_0x2cf9('0x5b')})[_0x2cf9('0x13')](function(_0x20ead8){_0x34ba79=_0x20ead8;});}})[_0x2cf9('0x38')](function(_0x1908f3){_0x231fc3=0x1f4;logger[_0x2cf9('0x20')](_0x1908f3[_0x2cf9('0x21')]);if(_0x1908f3[_0x2cf9('0x1d')]){delete _0x1908f3[_0x2cf9('0x1d')];}_0x34ba79=_0x1908f3;})[_0x2cf9('0x5c')](function(){if(_0x34ba79===null){_0x4742df['sendStatus'](_0x231fc3);}else{if(_0x231fc3===0x1f4){_0x4742df['status'](_0x231fc3)[_0x2cf9('0x22')](_0x34ba79);}else{_0x4742df[_0x2cf9('0xb')](_0x231fc3)[_0x2cf9('0xd')](_0x34ba79);}}});}; \ No newline at end of file +var _0x28e2=['redis','defaults','register','sendStatus','end','status','json','undefined','limit','count','offset','set','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','UserProfileResource','then','stack','name','send','index','VoiceExtension','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','sort','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','keys','options','body','startsWith','exten','concat','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','mandatoryDisposition','alias','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb'];(function(_0x3576e9,_0x1c581b){var _0x5c959d=function(_0x7a72d6){while(--_0x7a72d6){_0x3576e9['push'](_0x3576e9['shift']());}};_0x5c959d(++_0x1c581b);}(_0x28e2,0x10e));var _0x228e=function(_0x9bf4c,_0x8deb29){_0x9bf4c=_0x9bf4c-0x0;var _0x3d5b2f=_0x28e2[_0x9bf4c];return _0x3d5b2f;};'use strict';var _=require(_0x228e('0x0'));var Redis=require(_0x228e('0x1'));var qs=require(_0x228e('0x2'));var logger=require(_0x228e('0x3'))('api');var config=require(_0x228e('0x4'));var db=require(_0x228e('0x5'))['db'];config[_0x228e('0x6')]=_[_0x228e('0x7')](config[_0x228e('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x228e('0x6')]));require('./voiceExtension.socket')[_0x228e('0x8')](socket);function respondWithStatusCode(_0xcca7b1,_0x2c9818){_0x2c9818=_0x2c9818||0xcc;return function(_0xd3bcf6){if(_0xd3bcf6){return _0xcca7b1[_0x228e('0x9')](_0x2c9818);}return _0xcca7b1['status'](_0x2c9818)[_0x228e('0xa')]();};}function respondWithResult(_0x36d7d,_0x2018cb){_0x2018cb=_0x2018cb||0xc8;return function(_0x3b4e14){if(_0x3b4e14){return _0x36d7d[_0x228e('0xb')](_0x2018cb)[_0x228e('0xc')](_0x3b4e14);}};}function respondWithFilteredResult(_0x5b70a6,_0x5b0535){return function(_0x53a5a9){if(_0x53a5a9){var _0x1d05db=typeof _0x5b0535['offset']===_0x228e('0xd')&&typeof _0x5b0535[_0x228e('0xe')]===_0x228e('0xd');var _0x2a9ffa=_0x53a5a9['count'];var _0x5f0d74=_0x1d05db?0x0:_0x5b0535['offset'];var _0x207cff=_0x1d05db?_0x53a5a9[_0x228e('0xf')]:_0x5b0535[_0x228e('0x10')]+_0x5b0535[_0x228e('0xe')];var _0x320009;if(_0x207cff>=_0x2a9ffa){_0x207cff=_0x2a9ffa;_0x320009=0xc8;}else{_0x320009=0xce;}_0x5b70a6['status'](_0x320009);return _0x5b70a6[_0x228e('0x11')]('Content-Range',_0x5f0d74+'-'+_0x207cff+'/'+_0x2a9ffa)['json'](_0x53a5a9);}return null;};}function removeEntity(_0x194cf3){return function(_0x403b13){if(_0x403b13){return _0x403b13[_0x228e('0x12')]()['then'](function(){var _0x4162ff=_0x403b13[_0x228e('0x13')]({'plain':!![]});var _0x433912=[{'name':_0x228e('0x14'),'value':_0x228e('0x15'),'ignore':![]},{'name':_0x228e('0x16'),'value':_0x228e('0x17'),'ignore':![]},{'name':_0x228e('0x18'),'value':_0x228e('0x19'),'ignore':![]}];var _0x5e0ae0=_(_0x433912)[_0x228e('0x1a')](_0x228e('0x1b'))[_0x228e('0x1c')](_0x228e('0x1d'))[_0x228e('0x1d')]();if(_[_0x228e('0x1e')](_0x5e0ae0,_0x4162ff[_0x228e('0x1f')])){return;}var _0x3bdb87=_[_0x228e('0x20')](_0x433912,['value',_0x4162ff['type']])['name'];return db[_0x228e('0x21')][_0x228e('0x12')]({'where':{'type':_0x3bdb87,'resourceId':_0x4162ff['id']}})[_0x228e('0x22')](function(){return _0x403b13;});})[_0x228e('0x22')](function(){_0x194cf3[_0x228e('0xb')](0xcc)[_0x228e('0xa')]();});}};}function handleEntityNotFound(_0x385ea7){return function(_0x597003){if(!_0x597003){_0x385ea7['sendStatus'](0x194);}return _0x597003;};}function handleError(_0x29f0c1,_0x4e99ae){_0x4e99ae=_0x4e99ae||0x1f4;return function(_0x217cad){logger['error'](_0x217cad[_0x228e('0x23')]);if(_0x217cad['name']){delete _0x217cad[_0x228e('0x24')];}_0x29f0c1[_0x228e('0xb')](_0x4e99ae)[_0x228e('0x25')](_0x217cad);};}exports[_0x228e('0x26')]=function(_0x254fc8,_0x3e9534){var _0x2c3425={},_0x27b3ce={},_0xd24eeb={'count':0x0,'rows':[]};var _0x54d8f5=_[_0x228e('0x1c')](db[_0x228e('0x27')][_0x228e('0x28')],function(_0x515170){return{'name':_0x515170[_0x228e('0x29')],'type':_0x515170['type']['key']};});_0x27b3ce[_0x228e('0x2a')]=_[_0x228e('0x1c')](_0x54d8f5,_0x228e('0x24'));_0x27b3ce[_0x228e('0x2b')]=_['keys'](_0x254fc8[_0x228e('0x2b')]);_0x27b3ce[_0x228e('0x2c')]=_[_0x228e('0x2d')](_0x27b3ce[_0x228e('0x2a')],_0x27b3ce['query']);_0x2c3425['attributes']=_[_0x228e('0x2d')](_0x27b3ce[_0x228e('0x2a')],qs[_0x228e('0x2e')](_0x254fc8[_0x228e('0x2b')][_0x228e('0x2e')]));_0x2c3425[_0x228e('0x2f')]=_0x2c3425[_0x228e('0x2f')][_0x228e('0x30')]?_0x2c3425[_0x228e('0x2f')]:_0x27b3ce['model'];if(!_0x254fc8[_0x228e('0x2b')]['hasOwnProperty']('nolimit')){_0x2c3425[_0x228e('0xe')]=qs[_0x228e('0xe')](_0x254fc8['query'][_0x228e('0xe')]);_0x2c3425['offset']=qs[_0x228e('0x10')](_0x254fc8['query'][_0x228e('0x10')]);}_0x2c3425['order']=qs['sort'](_0x254fc8[_0x228e('0x2b')][_0x228e('0x31')]);_0x2c3425[_0x228e('0x32')]=qs[_0x228e('0x2c')](_['pick'](_0x254fc8[_0x228e('0x2b')],_0x27b3ce['filters']),_0x54d8f5);if(_0x254fc8[_0x228e('0x2b')][_0x228e('0x1a')]){_0x2c3425['where']=_['merge'](_0x2c3425['where'],{'$or':_[_0x228e('0x1c')](_0x54d8f5,function(_0x254e04){if(_0x254e04[_0x228e('0x1f')]!==_0x228e('0x33')){var _0x5b11ca={};_0x5b11ca[_0x254e04[_0x228e('0x24')]]={'$like':'%'+_0x254fc8[_0x228e('0x2b')][_0x228e('0x1a')]+'%'};return _0x5b11ca;}})});}_0x2c3425=_[_0x228e('0x34')]({},_0x2c3425,_0x254fc8['options']);var _0x461cd5={'where':_0x2c3425[_0x228e('0x32')]};return db['VoiceExtension'][_0x228e('0xf')](_0x461cd5)[_0x228e('0x22')](function(_0x2f312c){_0xd24eeb[_0x228e('0xf')]=_0x2f312c;if(_0x254fc8[_0x228e('0x2b')][_0x228e('0x35')]){_0x2c3425[_0x228e('0x36')]=[{'all':!![]}];}return db[_0x228e('0x27')][_0x228e('0x37')](_0x2c3425);})[_0x228e('0x22')](function(_0x5b7f80){_0xd24eeb[_0x228e('0x38')]=_0x5b7f80;return _0xd24eeb;})[_0x228e('0x22')](respondWithFilteredResult(_0x3e9534,_0x2c3425))[_0x228e('0x39')](handleError(_0x3e9534,null));};exports['show']=function(_0x55df2f,_0x209b78){var _0x445982={'raw':![],'where':{'id':_0x55df2f[_0x228e('0x3a')]['id']}},_0x3fb029={};_0x3fb029[_0x228e('0x2a')]=_['keys'](db[_0x228e('0x27')][_0x228e('0x28')]);_0x3fb029[_0x228e('0x2b')]=_[_0x228e('0x3b')](_0x55df2f[_0x228e('0x2b')]);_0x3fb029[_0x228e('0x2c')]=_[_0x228e('0x2d')](_0x3fb029[_0x228e('0x2a')],_0x3fb029[_0x228e('0x2b')]);_0x445982[_0x228e('0x2f')]=_[_0x228e('0x2d')](_0x3fb029[_0x228e('0x2a')],qs['fields'](_0x55df2f[_0x228e('0x2b')][_0x228e('0x2e')]));_0x445982[_0x228e('0x2f')]=_0x445982['attributes'][_0x228e('0x30')]?_0x445982['attributes']:_0x3fb029[_0x228e('0x2a')];if(_0x55df2f['query'][_0x228e('0x35')]){_0x445982[_0x228e('0x36')]=[{'all':!![]}];}_0x445982=_[_0x228e('0x34')]({},_0x445982,_0x55df2f[_0x228e('0x3c')]);return db[_0x228e('0x27')][_0x228e('0x20')](_0x445982)['then'](handleEntityNotFound(_0x209b78,null))[_0x228e('0x22')](respondWithResult(_0x209b78,null))[_0x228e('0x39')](handleError(_0x209b78,null));};exports[_0x228e('0x12')]=function(_0x146548,_0x434a17){return db[_0x228e('0x27')][_0x228e('0x20')]({'where':{'id':_0x146548[_0x228e('0x3a')]['id']}})[_0x228e('0x22')](handleEntityNotFound(_0x434a17,null))[_0x228e('0x22')](removeEntity(_0x434a17,null))[_0x228e('0x39')](handleError(_0x434a17,null));};exports['create']=function(_0x1b5d38,_0x2ff9e8){if(_0x1b5d38[_0x228e('0x3d')][_0x228e('0x1f')]===_0x228e('0x17')&&!_[_0x228e('0x3e')](_0x1b5d38[_0x228e('0x3d')]['exten'],'_')){_0x1b5d38['body'][_0x228e('0x3f')]='_'[_0x228e('0x40')](_0x1b5d38['body'][_0x228e('0x3f')]);}return db['VoiceExtension'][_0x228e('0x41')](_0x1b5d38[_0x228e('0x3d')],{'raw':![]})[_0x228e('0x22')](function(_0x56db6c){var _0x4444af=_0x1b5d38['user'][_0x228e('0x13')]({'plain':!![]});if(!_0x4444af)throw new Error(_0x228e('0x42'));if(_0x4444af[_0x228e('0x43')]===_0x228e('0x44')){var _0x3c62c0=_0x56db6c[_0x228e('0x13')]({'plain':!![]});var _0x4bbed7=[{'name':_0x228e('0x14'),'value':'inbound'},{'name':'OutboundRoutes','value':_0x228e('0x17')},{'name':'InternalRoutes','value':_0x228e('0x19')}];var _0x1e71fd=_['find'](_0x4bbed7,[_0x228e('0x1d'),_0x3c62c0['type']])['name'];return db[_0x228e('0x45')][_0x228e('0x20')]({'where':{'name':_0x1e71fd,'userProfileId':_0x4444af[_0x228e('0x46')]},'raw':!![]})[_0x228e('0x22')](function(_0x35a089){if(_0x35a089&&_0x35a089[_0x228e('0x47')]===0x0){return db['UserProfileResource'][_0x228e('0x41')]({'name':_0x3c62c0[_0x228e('0x24')],'resourceId':_0x3c62c0['id'],'type':_0x35a089['name'],'sectionId':_0x35a089['id']},{})[_0x228e('0x22')](function(){return _0x56db6c;});}else{return _0x56db6c;}})[_0x228e('0x39')](function(_0xd31caa){logger[_0x228e('0x48')](_0x228e('0x49'),_0xd31caa);throw _0xd31caa;});}return _0x56db6c;})[_0x228e('0x22')](respondWithResult(_0x2ff9e8,0xc9))[_0x228e('0x39')](handleError(_0x2ff9e8,null));};exports[_0x228e('0x4a')]=function(_0x268f28,_0x5ee1c9){if(_0x268f28['body']['id']){delete _0x268f28[_0x228e('0x3d')]['id'];}return db[_0x228e('0x27')][_0x228e('0x20')]({'where':{'id':_0x268f28['params']['id']}})[_0x228e('0x22')](handleEntityNotFound(_0x5ee1c9,null))[_0x228e('0x22')](function(_0x2c48cc){if(_0x2c48cc){return db[_0x228e('0x27')][_0x228e('0x4a')](_['pick'](_0x268f28['body'],[_0x228e('0x3f'),_0x228e('0x4b'),_0x228e('0x4c'),'recordingFormat','cutdigits',_0x228e('0x4d'),_0x228e('0x4e')]),{'where':{'context':_0x2c48cc[_0x228e('0x4b')],'exten':_0x2c48cc[_0x228e('0x3f')]},'individualHooks':!![]})['then'](function(_0x81c459){return _0x81c459;});}return null;})['then'](respondWithStatusCode(_0x5ee1c9,null))[_0x228e('0x39')](handleError(_0x5ee1c9,null));};exports[_0x228e('0x4f')]=function(_0x57649b,_0x505921){var _0x3addd6=_0x57649b[_0x228e('0x3a')]['id'];var _0x25ffe4=_0x57649b[_0x228e('0x3d')];var _0x166c00=0xc8;var _0x541c6f=null;return db[_0x228e('0x50')][_0x228e('0x51')]({'isolationLevel':db['sequelize'][_0x228e('0x52')]['ISOLATION_LEVELS'][_0x228e('0x53')]},function(_0x22952e){return db['VoiceExtension'][_0x228e('0x54')]({'where':{'id':_0x3addd6},'transaction':_0x22952e})[_0x228e('0x22')](function(_0x1be6bc){if(_0x1be6bc){return db[_0x228e('0x27')]['destroy']({'where':{'VoiceExtensionId':_0x3addd6},'transaction':_0x22952e})['then'](function(){var _0x34dbd2=_[_0x228e('0x1c')](_0x25ffe4,function(_0xca0592){_0xca0592[_0x228e('0x55')]=_0x3addd6;_0xca0592[_0x228e('0x56')]=!![];return _0xca0592;});return _0x1be6bc[_0x228e('0x57')](_0x34dbd2);})[_0x228e('0x22')](function(_0x1bc87b){return db[_0x228e('0x27')][_0x228e('0x58')](_0x1bc87b,{'transaction':_0x22952e});});}else{_0x166c00=0x194;_0x541c6f=[];}});})['then'](function(){if(_0x166c00!==0x194){return db[_0x228e('0x27')][_0x228e('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x3addd6},'order':_0x228e('0x5a')})[_0x228e('0x22')](function(_0x2a8abb){_0x541c6f=_0x2a8abb;});}})[_0x228e('0x39')](function(_0x5597d2){_0x166c00=0x1f4;logger[_0x228e('0x48')](_0x5597d2[_0x228e('0x23')]);if(_0x5597d2[_0x228e('0x24')]){delete _0x5597d2[_0x228e('0x24')];}_0x541c6f=_0x5597d2;})[_0x228e('0x5b')](function(){if(_0x541c6f===null){_0x505921[_0x228e('0x9')](_0x166c00);}else{if(_0x166c00===0x1f4){_0x505921[_0x228e('0xb')](_0x166c00)[_0x228e('0x25')](_0x541c6f);}else{_0x505921[_0x228e('0xb')](_0x166c00)['json'](_0x541c6f);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 504e243..cafbc05 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 _0x8039=['events','../../mysqldb','setMaxListeners','save','update','emit','hook','exports'];(function(_0x3dc089,_0x5ccb0d){var _0x34d9d3=function(_0x4556bf){while(--_0x4556bf){_0x3dc089['push'](_0x3dc089['shift']());}};_0x34d9d3(++_0x5ccb0d);}(_0x8039,0xf0));var _0x9803=function(_0x54b283,_0x5eb8a6){_0x54b283=_0x54b283-0x0;var _0x2462b3=_0x8039[_0x54b283];return _0x2462b3;};'use strict';var EventEmitter=require(_0x9803('0x0'));var VoiceExtension=require(_0x9803('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x9803('0x2')](0x0);var events={'afterCreate':_0x9803('0x3'),'afterUpdate':_0x9803('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2d3099){return function(_0x1c3c20,_0x2fd74c,_0x1cb946){VoiceExtensionEvents['emit'](_0x2d3099+':'+_0x1c3c20['id'],_0x1c3c20);VoiceExtensionEvents[_0x9803('0x5')](_0x2d3099,_0x1c3c20);_0x1cb946(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x9803('0x6')](e,emitEvent(event));}}module[_0x9803('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0x56dc=['../../mysqldb','VoiceExtension','update','emit','hasOwnProperty','hook','events'];(function(_0x5796d9,_0x2f67a6){var _0x430a31=function(_0x45d577){while(--_0x45d577){_0x5796d9['push'](_0x5796d9['shift']());}};_0x430a31(++_0x2f67a6);}(_0x56dc,0x1cd));var _0xc56d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56dc[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xc56d('0x0'));var VoiceExtension=require(_0xc56d('0x1'))['db'][_0xc56d('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc56d('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3fce06){return function(_0x581280,_0xe14da3,_0xa90056){VoiceExtensionEvents[_0xc56d('0x4')](_0x3fce06+':'+_0x581280['id'],_0x581280);VoiceExtensionEvents[_0xc56d('0x4')](_0x3fce06,_0x581280);_0xa90056(null);};}for(var e in events){if(events[_0xc56d('0x5')](e)){var event=events[e];VoiceExtension[_0xc56d('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 50c6223..40a1536 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 _0x7266=['then','Hangup','lodash','./voiceExtension.attributes','exports','Set','CDR(type)=','type','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','url','split','param','phone','prefix','${EXTEN}','SIP','join','options','replace','U(xcally-mixmonitor-context)','isEmpty','findAll','length','interval','intervals','IntervalId','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','outboundDial','appdata','priority','last','concat','catch','define','VoiceExtension'];(function(_0x3a2c92,_0x5309c8){var _0x3afdb1=function(_0x26dbbc){while(--_0x26dbbc){_0x3a2c92['push'](_0x3a2c92['shift']());}};_0x3afdb1(++_0x5309c8);}(_0x7266,0xec));var _0x6726=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x7266[_0x432682];return _0x463d05;};'use strict';var _=require(_0x6726('0x0'));var attributes=require(_0x6726('0x1'));module[_0x6726('0x2')]=function(_0x128797){var _0x438753=_0x128797['models'];function _0x5dd7a7(_0x47093e){var _0x4e215d=0x2;var _0x5939ff=[{'type':_0x47093e['type'],'app':_0x6726('0x3'),'appdata':_0x6726('0x4')+_0x47093e[_0x6726('0x5')],'context':_0x47093e[_0x6726('0x6')],'exten':_0x47093e[_0x6726('0x7')],'priority':_0x4e215d++,'VoiceExtensionId':_0x47093e['id']},{'type':_0x47093e[_0x6726('0x5')],'app':_0x47093e[_0x6726('0x8')]?_0x6726('0x3'):_0x6726('0x9'),'appdata':_0x47093e[_0x6726('0x8')]?_0x6726('0xa')+_0x47093e[_0x6726('0x8')]:_0x6726('0xb'),'context':_0x47093e['context'],'exten':_0x47093e[_0x6726('0x7')],'priority':_0x4e215d++,'VoiceExtensionId':_0x47093e['id']}];if(_0x47093e[_0x6726('0x5')]===_0x6726('0xc')){_0x5939ff[_0x6726('0xd')]({'type':'inbound','app':_0x6726('0x3'),'appdata':'CDR(routeid)='+_0x47093e['id'],'context':_0x47093e[_0x6726('0x6')],'exten':_0x47093e[_0x6726('0x7')],'priority':_0x4e215d++,'VoiceExtensionId':_0x47093e['id']});}_0x5939ff['push']({'type':_0x47093e[_0x6726('0x5')],'app':_0x6726('0x3'),'appdata':_0x6726('0xe'),'context':_0x47093e[_0x6726('0x6')],'exten':_0x47093e['exten'],'priority':_0x4e215d++,'VoiceExtensionId':_0x47093e['id']},{'type':_0x47093e[_0x6726('0x5')],'app':_0x6726('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x47093e[_0x6726('0x6')],'exten':_0x47093e['exten'],'priority':_0x4e215d++,'VoiceExtensionId':_0x47093e['id']},{'type':_0x47093e[_0x6726('0x5')],'app':_0x6726('0x3'),'appdata':_0x6726('0xf'),'context':_0x47093e[_0x6726('0x6')],'exten':_0x47093e['exten'],'priority':_0x4e215d++,'VoiceExtensionId':_0x47093e['id']});return _0x5939ff;}function _0x8323b2(_0x46c5f5){var _0x4adb51=0x2;var _0x153832=[{'type':'outbound','app':'Set','appdata':'CDR(type)=outbound','context':_0x46c5f5[_0x6726('0x6')],'exten':_0x46c5f5[_0x6726('0x7')],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']},{'type':'outbound','app':_0x46c5f5[_0x6726('0x8')]?_0x6726('0x3'):_0x6726('0x9'),'appdata':_0x46c5f5[_0x6726('0x8')]?_0x6726('0xa')+_0x46c5f5[_0x6726('0x8')]:'No\x20alias\x20set','context':_0x46c5f5[_0x6726('0x6')],'exten':_0x46c5f5['exten'],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']},{'type':_0x6726('0x10'),'app':_0x6726('0x3'),'appdata':_0x6726('0x11')+(_0x46c5f5[_0x6726('0x12')]?_0x6726('0x13')+_0x46c5f5[_0x6726('0x12')]+'}':'${EXTEN}'),'context':_0x46c5f5[_0x6726('0x6')],'exten':_0x46c5f5[_0x6726('0x7')],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']},{'type':_0x6726('0x10'),'app':_0x6726('0x3'),'appdata':'CDR(routeid)='+_0x46c5f5['id'],'context':_0x46c5f5[_0x6726('0x6')],'exten':_0x46c5f5['exten'],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']},{'type':'outbound','app':_0x6726('0x14'),'appdata':_0x6726('0x15')+(_0x4adb51+0x2)+_0x6726('0x16')+(_0x4adb51+0x1)+')','context':_0x46c5f5[_0x6726('0x6')],'exten':_0x46c5f5['exten'],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']},{'type':_0x6726('0x10'),'app':_0x6726('0x3'),'appdata':_0x46c5f5[_0x6726('0x12')]?'CDR(prefix)=${EXTEN:0:'+_0x46c5f5[_0x6726('0x12')]+'}':'CDR(prefix)=noprefix','context':_0x46c5f5['context'],'exten':_0x46c5f5['exten'],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']},{'type':_0x6726('0x10'),'app':_0x6726('0x3'),'appdata':_0x6726('0xe'),'context':_0x46c5f5[_0x6726('0x6')],'exten':_0x46c5f5['exten'],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']},{'type':_0x6726('0x10'),'app':_0x6726('0x3'),'appdata':_0x6726('0x17'),'context':_0x46c5f5['context'],'exten':_0x46c5f5[_0x6726('0x7')],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']},{'type':_0x6726('0x10'),'app':'Set','appdata':_0x6726('0xf'),'context':_0x46c5f5[_0x6726('0x6')],'exten':_0x46c5f5[_0x6726('0x7')],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']},{'type':_0x6726('0x10'),'app':_0x6726('0x3'),'appdata':_0x6726('0x18')+_0x46c5f5['id'],'context':_0x46c5f5[_0x6726('0x6')],'exten':_0x46c5f5[_0x6726('0x7')],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']}];if(_0x46c5f5['hasOwnProperty'](_0x6726('0x19'))&&_0x46c5f5[_0x6726('0x19')]!==_0x6726('0x1a')){_0x153832[_0x6726('0xd')]({'type':_0x6726('0x10'),'app':_0x6726('0x3'),'appdata':_0x6726('0x1b'),'context':_0x46c5f5[_0x6726('0x6')],'exten':_0x46c5f5['exten'],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']},{'type':'outbound','app':_0x6726('0x3'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x46c5f5[_0x6726('0x19')]||_0x6726('0x1c'),'context':_0x46c5f5['context'],'exten':_0x46c5f5[_0x6726('0x7')],'priority':_0x4adb51++,'VoiceExtensionId':_0x46c5f5['id']});}return _0x153832;}function _0x41ec6b(_0x186e32,_0x4f7241){var _0x234076=[{'name':_0x6726('0x1d'),'param':0x0},{'name':'timeout','param':0x1},{'name':'options','param':0x2},{'name':_0x6726('0x1e'),'param':0x3}];var _0x3fada5={};var _0x44ff92=_0x4f7241[_0x6726('0x1f')](',');var _0x378c66=[];for(var _0x33a6ec=0x0;_0x33a6ec<_0x234076['length'];_0x33a6ec++){switch(_0x234076[_0x33a6ec]['name']){case _0x6726('0x1d'):_0x3fada5[_0x6726('0x1d')]=_0x44ff92[_0x234076[_0x33a6ec][_0x6726('0x20')]][_0x6726('0x1f')]('/')[0x1];_0x3fada5[_0x6726('0x21')]=_0x44ff92[_0x234076[_0x33a6ec]['param']][_0x6726('0x1f')]('/')[0x2];_0x3fada5[_0x6726('0x22')]=_0x3fada5['phone']?_0x3fada5[_0x6726('0x21')][_0x6726('0x1f')]('$')[0x0]:undefined;_0x3fada5[_0x6726('0x21')]=_0x186e32[_0x6726('0x12')]?(_0x3fada5[_0x6726('0x22')]||'')+_0x6726('0x13')+_0x186e32[_0x6726('0x12')]+'}':(_0x3fada5[_0x6726('0x22')]||'')+_0x6726('0x23');_0x378c66[_0x234076[_0x33a6ec][_0x6726('0x20')]]=[_0x6726('0x24'),_0x3fada5[_0x6726('0x1d')],_0x3fada5[_0x6726('0x21')]][_0x6726('0x25')]('/');break;case _0x6726('0x26'):_0x3fada5[_0x6726('0x26')]=_0x44ff92[_0x234076[_0x33a6ec][_0x6726('0x20')]];if(_0x186e32[_0x6726('0x19')]!==_0x6726('0x1a')){if(_0x3fada5[_0x6726('0x26')]['indexOf']('U(xcally-mixmonitor-context)')<0x0){_0x3fada5[_0x6726('0x26')]+='U(xcally-mixmonitor-context)';}}else{_0x3fada5[_0x6726('0x26')]=_0x3fada5[_0x6726('0x26')][_0x6726('0x27')](_0x6726('0x28'),'');}_0x378c66[_0x234076[_0x33a6ec][_0x6726('0x20')]]=_0x3fada5[_0x6726('0x26')];break;default:_0x378c66[_0x234076[_0x33a6ec]['param']]=_0x44ff92[_0x234076[_0x33a6ec][_0x6726('0x20')]];}}return _0x378c66['join'](',');}function _0x2fe233(_0x4ee1c0,_0x5d0d14,_0x15ae05){return new Promise(function(_0x1e3b7b,_0x5e74cb){var _0x398ec3=[];if(_[_0x6726('0x29')](_0x5d0d14))return _0x1e3b7b(_0x398ec3);_0x438753['Interval'][_0x6726('0x2a')]({'attributes':['id','interval','IntervalId'],'raw':!![]})['then'](function(_0x4526d6){for(var _0x5829b7=0x0,_0x5f097d=0x0;_0x5829b7<_0x5d0d14[_0x6726('0x2b')];_0x5829b7++,_0x5f097d=0x0){var _0x56e9f5=_0x5d0d14[_0x5829b7];var _0x4c25ee=[];var _0x1e0fea=[];delete _0x56e9f5['id'];if(_0x56e9f5[_0x6726('0x2c')]!=='*,*,*,*'){_0x56e9f5['intervals']=[_0x56e9f5[_0x6726('0x2c')]];}else{_0x56e9f5[_0x6726('0x2d')]=_0x56e9f5[_0x6726('0x2e')]?_[_0x6726('0x2f')](_[_0x6726('0x30')](_0x4526d6,{'IntervalId':_0x56e9f5[_0x6726('0x2e')]}),_0x6726('0x2c')):[];}_0x56e9f5[_0x6726('0x6')]=_0x4ee1c0[_0x6726('0x6')];_0x56e9f5[_0x6726('0x7')]=_0x4ee1c0[_0x6726('0x7')];if(_0x56e9f5[_0x6726('0x5')])_0x56e9f5['type']=_0x56e9f5[_0x6726('0x5')][_0x6726('0x31')]();if(_0x4ee1c0['type']===_0x6726('0x10')){if(_0x56e9f5[_0x6726('0x32')](_0x6726('0x33'))&&_0x56e9f5[_0x6726('0x33')]&&_0x56e9f5[_0x6726('0x33')]!=='--'){_0x4c25ee['push']({'type':_0x56e9f5[_0x6726('0x5')][_0x6726('0x31')](),'app':_0x6726('0x3'),'appdata':_0x6726('0x34')+_0x56e9f5[_0x6726('0x33')],'context':_0x4ee1c0[_0x6726('0x6')],'exten':_0x4ee1c0[_0x6726('0x7')],'priority':_0x56e9f5[_0x6726('0x2d')]['length']+_0x15ae05+_0x5f097d++,'VoiceExtensionId':_0x4ee1c0['id']});}_0x4c25ee['push']({'type':_0x56e9f5[_0x6726('0x5')][_0x6726('0x31')](),'app':_0x6726('0x14'),'appdata':_0x6726('0x35')+(_0x56e9f5['callerID']?_0x6726('0x36')+_0x56e9f5[_0x6726('0x37')]+')':'NoOp(No\x20number\x20available)'),'context':_0x4ee1c0[_0x6726('0x6')],'exten':_0x4ee1c0[_0x6726('0x7')],'priority':_0x56e9f5[_0x6726('0x2d')]['length']+_0x15ae05+_0x5f097d++,'VoiceExtensionId':_0x4ee1c0['id']});}else{if(_0x56e9f5[_0x6726('0x32')](_0x6726('0x38'))){if([_0x6726('0x39'),_0x6726('0x3a')][_0x6726('0x3b')](_0x56e9f5[_0x6726('0x3c')][_0x6726('0x31')]())&&_0x56e9f5[_0x6726('0x3d')]!==_0x6726('0x3e')){if(_0x56e9f5['answer']){_0x4c25ee[_0x6726('0xd')]({'type':_0x56e9f5[_0x6726('0x5')][_0x6726('0x31')](),'app':_0x6726('0x14'),'appdata':_0x6726('0x3f'),'context':_0x4ee1c0[_0x6726('0x6')],'exten':_0x4ee1c0[_0x6726('0x7')],'priority':_0x56e9f5[_0x6726('0x2d')][_0x6726('0x2b')]+_0x15ae05+_0x5f097d++,'VoiceExtensionId':_0x4ee1c0['id']});_0x4c25ee[_0x6726('0xd')]({'type':_0x56e9f5['type']['toLowerCase'](),'app':_0x6726('0x3'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x4ee1c0['context'],'exten':_0x4ee1c0[_0x6726('0x7')],'priority':_0x56e9f5['intervals'][_0x6726('0x2b')]+_0x15ae05+_0x5f097d++,'VoiceExtensionId':_0x4ee1c0['id']});}else{_0x4c25ee[_0x6726('0xd')]({'type':_0x56e9f5[_0x6726('0x5')][_0x6726('0x31')](),'app':_0x6726('0x14'),'appdata':_0x6726('0x40'),'context':_0x4ee1c0[_0x6726('0x6')],'exten':_0x4ee1c0[_0x6726('0x7')],'priority':_0x56e9f5['intervals'][_0x6726('0x2b')]+_0x15ae05+_0x5f097d++,'VoiceExtensionId':_0x4ee1c0['id']});_0x4c25ee[_0x6726('0xd')]({'type':_0x56e9f5[_0x6726('0x5')][_0x6726('0x31')](),'app':_0x6726('0x3'),'appdata':_0x6726('0x41'),'context':_0x4ee1c0[_0x6726('0x6')],'exten':_0x4ee1c0['exten'],'priority':_0x56e9f5[_0x6726('0x2d')][_0x6726('0x2b')]+_0x15ae05+_0x5f097d++,'VoiceExtensionId':_0x4ee1c0['id']});}}}}for(var _0x309921=0x0;_0x309921<_0x56e9f5['intervals']['length'];_0x309921++){var _0x254b1b=_0x15ae05+_0x56e9f5[_0x6726('0x2d')]['length'];var _0x242a67=_0x309921===_0x56e9f5[_0x6726('0x2d')]['length']-0x1?_0x15ae05+_0x4c25ee['length']+_0x1e0fea['length']+0x2:_0x15ae05+_0x309921+0x1;_0x4c25ee[_0x6726('0x42')](_0x309921,0x0,{'type':_0x4ee1c0[_0x6726('0x5')],'app':_0x6726('0x43'),'appdata':_0x56e9f5[_0x6726('0x2d')][_0x309921]+'?'+_0x4ee1c0[_0x6726('0x6')]+',${EXTEN},'+_0x254b1b+':'+_0x4ee1c0[_0x6726('0x6')]+',${EXTEN},'+_0x242a67,'exten':_0x4ee1c0[_0x6726('0x7')],'context':_0x4ee1c0['context'],'priority':_0x15ae05+_0x309921,'VoiceExtensionId':_0x4ee1c0['id']});}if(_0x56e9f5[_0x6726('0x3d')]===_0x6726('0x44'))_0x56e9f5[_0x6726('0x45')]=_0x41ec6b(_0x4ee1c0,_0x56e9f5[_0x6726('0x45')]);_0x56e9f5[_0x6726('0x46')]=_0x4c25ee['length']?_[_0x6726('0x47')](_0x4c25ee)['priority']+0x1:_0x15ae05;_0x398ec3=_[_0x6726('0x48')](_0x398ec3,_0x4c25ee,[_0x56e9f5],_0x1e0fea);_0x15ae05=_[_0x6726('0x47')](_0x398ec3)[_0x6726('0x46')]+0x1;}return _0x1e3b7b(_0x398ec3);})[_0x6726('0x49')](function(_0x149343){_0x5e74cb(_0x149343);});});}return _0x128797[_0x6726('0x4a')](_0x6726('0x4b'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x448720){var _0x16218c=this['get']({'plain':!![]});var _0x5bb851=_0x16218c[_0x6726('0x5')]===_0x6726('0x10')?_0x8323b2(_0x16218c):_0x5dd7a7(_0x16218c);return _0x2fe233(_0x16218c,_0x448720,_[_0x6726('0x47')](_0x5bb851)[_0x6726('0x46')]+0x1)[_0x6726('0x4c')](function(_0xd2e2c0){var _0x3a3542=_[_0x6726('0x48')](_0x5bb851,_0xd2e2c0);_0x3a3542[_0x6726('0xd')]({'type':_0x16218c[_0x6726('0x5')],'app':_0x6726('0x4d'),'exten':_0x16218c[_0x6726('0x7')],'context':_0x16218c[_0x6726('0x6')],'priority':_[_0x6726('0x47')](_0x3a3542)[_0x6726('0x46')]+0x1,'VoiceExtensionId':_0x16218c['id']});return _0x3a3542;});}}});}; \ No newline at end of file +var _0xf8de=['./voiceExtension.attributes','exports','type','Set','alias','CDR(routeAlias)=','No\x20alias\x20set','context','exten','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','none','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','options','url','split','length','name','param','phone','prefix','${EXTEN:','recordingFormat','U(xcally-mixmonitor-context)','join','findAll','interval','IntervalId','intervals','map','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','ExecIf','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','last','concat','priority','define','VoiceExtension','voice_extensions','get','then','Hangup'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf8de,0x1d4));var _0xef8d=function(_0x92426b,_0x1c1a47){_0x92426b=_0x92426b-0x0;var _0x3896eb=_0xf8de[_0x92426b];return _0x3896eb;};'use strict';var _=require('lodash');var attributes=require(_0xef8d('0x0'));module[_0xef8d('0x1')]=function(_0x51c905){var _0x1b57df=_0x51c905['models'];function _0x3651ec(_0x1426a9){var _0x3cdc6d=0x2;var _0x58851e=[{'type':_0x1426a9[_0xef8d('0x2')],'app':_0xef8d('0x3'),'appdata':'CDR(type)='+_0x1426a9[_0xef8d('0x2')],'context':_0x1426a9['context'],'exten':_0x1426a9['exten'],'priority':_0x3cdc6d++,'VoiceExtensionId':_0x1426a9['id']},{'type':_0x1426a9[_0xef8d('0x2')],'app':_0x1426a9[_0xef8d('0x4')]?_0xef8d('0x3'):'NoOp','appdata':_0x1426a9['alias']?_0xef8d('0x5')+_0x1426a9[_0xef8d('0x4')]:_0xef8d('0x6'),'context':_0x1426a9[_0xef8d('0x7')],'exten':_0x1426a9[_0xef8d('0x8')],'priority':_0x3cdc6d++,'VoiceExtensionId':_0x1426a9['id']}];if(_0x1426a9[_0xef8d('0x2')]===_0xef8d('0x9')){_0x58851e[_0xef8d('0xa')]({'type':_0xef8d('0x9'),'app':_0xef8d('0x3'),'appdata':_0xef8d('0xb')+_0x1426a9['id'],'context':_0x1426a9[_0xef8d('0x7')],'exten':_0x1426a9[_0xef8d('0x8')],'priority':_0x3cdc6d++,'VoiceExtensionId':_0x1426a9['id']});}_0x58851e[_0xef8d('0xa')]({'type':_0x1426a9[_0xef8d('0x2')],'app':_0xef8d('0x3'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1426a9['context'],'exten':_0x1426a9[_0xef8d('0x8')],'priority':_0x3cdc6d++,'VoiceExtensionId':_0x1426a9['id']},{'type':_0x1426a9['type'],'app':_0xef8d('0x3'),'appdata':_0xef8d('0xc'),'context':_0x1426a9[_0xef8d('0x7')],'exten':_0x1426a9[_0xef8d('0x8')],'priority':_0x3cdc6d++,'VoiceExtensionId':_0x1426a9['id']},{'type':_0x1426a9['type'],'app':'Set','appdata':_0xef8d('0xd'),'context':_0x1426a9[_0xef8d('0x7')],'exten':_0x1426a9[_0xef8d('0x8')],'priority':_0x3cdc6d++,'VoiceExtensionId':_0x1426a9['id']});return _0x58851e;}function _0x3311e5(_0x2315e5){var _0x595fe8=0x2;var _0x346f3b=[{'type':_0xef8d('0xe'),'app':_0xef8d('0x3'),'appdata':_0xef8d('0xf'),'context':_0x2315e5[_0xef8d('0x7')],'exten':_0x2315e5[_0xef8d('0x8')],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']},{'type':'outbound','app':_0x2315e5[_0xef8d('0x4')]?_0xef8d('0x3'):_0xef8d('0x10'),'appdata':_0x2315e5[_0xef8d('0x4')]?_0xef8d('0x5')+_0x2315e5['alias']:_0xef8d('0x6'),'context':_0x2315e5[_0xef8d('0x7')],'exten':_0x2315e5[_0xef8d('0x8')],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']},{'type':_0xef8d('0xe'),'app':_0xef8d('0x3'),'appdata':'CDR(destination)='+(_0x2315e5[_0xef8d('0x11')]?'${EXTEN:'+_0x2315e5['cutdigits']+'}':_0xef8d('0x12')),'context':_0x2315e5[_0xef8d('0x7')],'exten':_0x2315e5[_0xef8d('0x8')],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']},{'type':_0xef8d('0xe'),'app':_0xef8d('0x3'),'appdata':_0xef8d('0xb')+_0x2315e5['id'],'context':_0x2315e5[_0xef8d('0x7')],'exten':_0x2315e5['exten'],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']},{'type':_0xef8d('0xe'),'app':'ExecIf','appdata':_0xef8d('0x13')+(_0x595fe8+0x2)+_0xef8d('0x14')+(_0x595fe8+0x1)+')','context':_0x2315e5[_0xef8d('0x7')],'exten':_0x2315e5[_0xef8d('0x8')],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']},{'type':_0xef8d('0xe'),'app':_0xef8d('0x3'),'appdata':_0x2315e5[_0xef8d('0x11')]?'CDR(prefix)=${EXTEN:0:'+_0x2315e5[_0xef8d('0x11')]+'}':_0xef8d('0x15'),'context':_0x2315e5[_0xef8d('0x7')],'exten':_0x2315e5[_0xef8d('0x8')],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']},{'type':_0xef8d('0xe'),'app':_0xef8d('0x3'),'appdata':_0xef8d('0x16'),'context':_0x2315e5[_0xef8d('0x7')],'exten':_0x2315e5[_0xef8d('0x8')],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']},{'type':_0xef8d('0xe'),'app':'Set','appdata':_0xef8d('0xc'),'context':_0x2315e5[_0xef8d('0x7')],'exten':_0x2315e5[_0xef8d('0x8')],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']},{'type':_0xef8d('0xe'),'app':_0xef8d('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0x2315e5[_0xef8d('0x7')],'exten':_0x2315e5[_0xef8d('0x8')],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']},{'type':'outbound','app':_0xef8d('0x3'),'appdata':_0xef8d('0x17')+_0x2315e5['id'],'context':_0x2315e5['context'],'exten':_0x2315e5[_0xef8d('0x8')],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']}];if(_0x2315e5[_0xef8d('0x18')]('recordingFormat')&&_0x2315e5['recordingFormat']!==_0xef8d('0x19')){_0x346f3b[_0xef8d('0xa')]({'type':_0xef8d('0xe'),'app':_0xef8d('0x3'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x2315e5['context'],'exten':_0x2315e5['exten'],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']},{'type':_0xef8d('0xe'),'app':'Set','appdata':_0xef8d('0x1a')+_0x2315e5['recordingFormat']||_0xef8d('0x1b'),'context':_0x2315e5[_0xef8d('0x7')],'exten':_0x2315e5[_0xef8d('0x8')],'priority':_0x595fe8++,'VoiceExtensionId':_0x2315e5['id']});}return _0x346f3b;}function _0x37c108(_0x2b37b9,_0x55d441){var _0x246878=[{'name':_0xef8d('0x1c'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0xef8d('0x1d'),'param':0x2},{'name':_0xef8d('0x1e'),'param':0x3}];var _0x13b05b={};var _0x326089=_0x55d441[_0xef8d('0x1f')](',');var _0x39b36a=[];for(var _0xc98f91=0x0;_0xc98f91<_0x246878[_0xef8d('0x20')];_0xc98f91++){switch(_0x246878[_0xc98f91][_0xef8d('0x21')]){case'trunk':_0x13b05b[_0xef8d('0x1c')]=_0x326089[_0x246878[_0xc98f91][_0xef8d('0x22')]][_0xef8d('0x1f')]('/')[0x1];_0x13b05b[_0xef8d('0x23')]=_0x326089[_0x246878[_0xc98f91][_0xef8d('0x22')]]['split']('/')[0x2];_0x13b05b[_0xef8d('0x24')]=_0x13b05b[_0xef8d('0x23')]?_0x13b05b[_0xef8d('0x23')][_0xef8d('0x1f')]('$')[0x0]:undefined;_0x13b05b[_0xef8d('0x23')]=_0x2b37b9[_0xef8d('0x11')]?(_0x13b05b[_0xef8d('0x24')]||'')+_0xef8d('0x25')+_0x2b37b9[_0xef8d('0x11')]+'}':(_0x13b05b[_0xef8d('0x24')]||'')+'${EXTEN}';_0x39b36a[_0x246878[_0xc98f91][_0xef8d('0x22')]]=['SIP',_0x13b05b[_0xef8d('0x1c')],_0x13b05b[_0xef8d('0x23')]]['join']('/');break;case'options':_0x13b05b[_0xef8d('0x1d')]=_0x326089[_0x246878[_0xc98f91][_0xef8d('0x22')]];if(_0x2b37b9[_0xef8d('0x26')]!=='none'){if(_0x13b05b[_0xef8d('0x1d')]['indexOf'](_0xef8d('0x27'))<0x0){_0x13b05b[_0xef8d('0x1d')]+=_0xef8d('0x27');}}else{_0x13b05b[_0xef8d('0x1d')]=_0x13b05b['options']['replace'](_0xef8d('0x27'),'');}_0x39b36a[_0x246878[_0xc98f91][_0xef8d('0x22')]]=_0x13b05b[_0xef8d('0x1d')];break;default:_0x39b36a[_0x246878[_0xc98f91][_0xef8d('0x22')]]=_0x326089[_0x246878[_0xc98f91]['param']];}}return _0x39b36a[_0xef8d('0x28')](',');}function _0x766c76(_0x5ae7fc,_0x273bc7,_0x5c2a69){return new Promise(function(_0x194fd7,_0x2acbb3){var _0x517316=[];if(_['isEmpty'](_0x273bc7))return _0x194fd7(_0x517316);_0x1b57df['Interval'][_0xef8d('0x29')]({'attributes':['id',_0xef8d('0x2a'),_0xef8d('0x2b')],'raw':!![]})['then'](function(_0x223005){for(var _0x1064d3=0x0,_0xf68025=0x0;_0x1064d3<_0x273bc7[_0xef8d('0x20')];_0x1064d3++,_0xf68025=0x0){var _0x1bdf3d=_0x273bc7[_0x1064d3];var _0x4e9a9d=[];var _0xd397d1=[];delete _0x1bdf3d['id'];if(_0x1bdf3d[_0xef8d('0x2a')]!=='*,*,*,*'){_0x1bdf3d['intervals']=[_0x1bdf3d[_0xef8d('0x2a')]];}else{_0x1bdf3d[_0xef8d('0x2c')]=_0x1bdf3d['IntervalId']?_[_0xef8d('0x2d')](_['filter'](_0x223005,{'IntervalId':_0x1bdf3d[_0xef8d('0x2b')]}),_0xef8d('0x2a')):[];}_0x1bdf3d[_0xef8d('0x7')]=_0x5ae7fc[_0xef8d('0x7')];_0x1bdf3d['exten']=_0x5ae7fc[_0xef8d('0x8')];if(_0x1bdf3d[_0xef8d('0x2')])_0x1bdf3d[_0xef8d('0x2')]=_0x1bdf3d[_0xef8d('0x2')]['toLowerCase']();if(_0x5ae7fc[_0xef8d('0x2')]===_0xef8d('0xe')){if(_0x1bdf3d[_0xef8d('0x18')]('tag')&&_0x1bdf3d[_0xef8d('0x2e')]&&_0x1bdf3d[_0xef8d('0x2e')]!=='--'){_0x4e9a9d[_0xef8d('0xa')]({'type':_0x1bdf3d['type'][_0xef8d('0x2f')](),'app':_0xef8d('0x3'),'appdata':_0xef8d('0x30')+_0x1bdf3d['tag'],'context':_0x5ae7fc['context'],'exten':_0x5ae7fc['exten'],'priority':_0x1bdf3d[_0xef8d('0x2c')]['length']+_0x5c2a69+_0xf68025++,'VoiceExtensionId':_0x5ae7fc['id']});}_0x4e9a9d[_0xef8d('0xa')]({'type':_0x1bdf3d['type'][_0xef8d('0x2f')](),'app':'ExecIf','appdata':_0xef8d('0x31')+(_0x1bdf3d[_0xef8d('0x32')]?_0xef8d('0x33')+_0x1bdf3d['callerID']+')':_0xef8d('0x34')),'context':_0x5ae7fc[_0xef8d('0x7')],'exten':_0x5ae7fc['exten'],'priority':_0x1bdf3d[_0xef8d('0x2c')][_0xef8d('0x20')]+_0x5c2a69+_0xf68025++,'VoiceExtensionId':_0x5ae7fc['id']});}else{if(_0x1bdf3d[_0xef8d('0x18')](_0xef8d('0x35'))){if([_0xef8d('0x36'),_0xef8d('0x37')][_0xef8d('0x38')](_0x1bdf3d[_0xef8d('0x39')][_0xef8d('0x2f')]())&&_0x1bdf3d[_0xef8d('0x3a')]!==_0xef8d('0x3b')){if(_0x1bdf3d['answer']){_0x4e9a9d[_0xef8d('0xa')]({'type':_0x1bdf3d[_0xef8d('0x2')][_0xef8d('0x2f')](),'app':_0xef8d('0x3c'),'appdata':_0xef8d('0x3d'),'context':_0x5ae7fc[_0xef8d('0x7')],'exten':_0x5ae7fc[_0xef8d('0x8')],'priority':_0x1bdf3d[_0xef8d('0x2c')][_0xef8d('0x20')]+_0x5c2a69+_0xf68025++,'VoiceExtensionId':_0x5ae7fc['id']});_0x4e9a9d['push']({'type':_0x1bdf3d[_0xef8d('0x2')][_0xef8d('0x2f')](),'app':'Set','appdata':_0xef8d('0x3e'),'context':_0x5ae7fc[_0xef8d('0x7')],'exten':_0x5ae7fc[_0xef8d('0x8')],'priority':_0x1bdf3d[_0xef8d('0x2c')]['length']+_0x5c2a69+_0xf68025++,'VoiceExtensionId':_0x5ae7fc['id']});}else{_0x4e9a9d[_0xef8d('0xa')]({'type':_0x1bdf3d[_0xef8d('0x2')][_0xef8d('0x2f')](),'app':_0xef8d('0x3c'),'appdata':_0xef8d('0x3f'),'context':_0x5ae7fc[_0xef8d('0x7')],'exten':_0x5ae7fc[_0xef8d('0x8')],'priority':_0x1bdf3d[_0xef8d('0x2c')][_0xef8d('0x20')]+_0x5c2a69+_0xf68025++,'VoiceExtensionId':_0x5ae7fc['id']});_0x4e9a9d[_0xef8d('0xa')]({'type':_0x1bdf3d[_0xef8d('0x2')]['toLowerCase'](),'app':_0xef8d('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x5ae7fc[_0xef8d('0x7')],'exten':_0x5ae7fc[_0xef8d('0x8')],'priority':_0x1bdf3d[_0xef8d('0x2c')]['length']+_0x5c2a69+_0xf68025++,'VoiceExtensionId':_0x5ae7fc['id']});}}}}for(var _0x51e93d=0x0;_0x51e93d<_0x1bdf3d[_0xef8d('0x2c')]['length'];_0x51e93d++){var _0x54269e=_0x5c2a69+_0x1bdf3d[_0xef8d('0x2c')][_0xef8d('0x20')];var _0x413cd8=_0x51e93d===_0x1bdf3d[_0xef8d('0x2c')][_0xef8d('0x20')]-0x1?_0x5c2a69+_0x4e9a9d[_0xef8d('0x20')]+_0xd397d1[_0xef8d('0x20')]+0x2:_0x5c2a69+_0x51e93d+0x1;_0x4e9a9d[_0xef8d('0x40')](_0x51e93d,0x0,{'type':_0x5ae7fc[_0xef8d('0x2')],'app':_0xef8d('0x41'),'appdata':_0x1bdf3d[_0xef8d('0x2c')][_0x51e93d]+'?'+_0x5ae7fc[_0xef8d('0x7')]+_0xef8d('0x42')+_0x54269e+':'+_0x5ae7fc['context']+_0xef8d('0x42')+_0x413cd8,'exten':_0x5ae7fc[_0xef8d('0x8')],'context':_0x5ae7fc[_0xef8d('0x7')],'priority':_0x5c2a69+_0x51e93d,'VoiceExtensionId':_0x5ae7fc['id']});}if(_0x1bdf3d[_0xef8d('0x3a')]===_0xef8d('0x43'))_0x1bdf3d['appdata']=_0x37c108(_0x5ae7fc,_0x1bdf3d[_0xef8d('0x44')]);_0x1bdf3d['priority']=_0x4e9a9d[_0xef8d('0x20')]?_[_0xef8d('0x45')](_0x4e9a9d)['priority']+0x1:_0x5c2a69;_0x517316=_[_0xef8d('0x46')](_0x517316,_0x4e9a9d,[_0x1bdf3d],_0xd397d1);_0x5c2a69=_['last'](_0x517316)[_0xef8d('0x47')]+0x1;}return _0x194fd7(_0x517316);})['catch'](function(_0x4ab161){_0x2acbb3(_0x4ab161);});});}return _0x51c905[_0xef8d('0x48')](_0xef8d('0x49'),attributes,{'tableName':_0xef8d('0x4a'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1678e7){var _0x5e7237=this[_0xef8d('0x4b')]({'plain':!![]});var _0x5eda3a=_0x5e7237['type']===_0xef8d('0xe')?_0x3311e5(_0x5e7237):_0x3651ec(_0x5e7237);return _0x766c76(_0x5e7237,_0x1678e7,_[_0xef8d('0x45')](_0x5eda3a)['priority']+0x1)[_0xef8d('0x4c')](function(_0x1ee613){var _0x347a55=_[_0xef8d('0x46')](_0x5eda3a,_0x1ee613);_0x347a55['push']({'type':_0x5e7237[_0xef8d('0x2')],'app':_0xef8d('0x4d'),'exten':_0x5e7237['exten'],'context':_0x5e7237['context'],'priority':_[_0xef8d('0x45')](_0x347a55)[_0xef8d('0x47')]+0x1,'VoiceExtensionId':_0x5e7237['id']});return _0x347a55;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 3ad9e5d..decb834 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 _0x522b=['include','model','then','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','register','info','VoiceExtension,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','map'];(function(_0x3acb0f,_0x143f26){var _0x4972c7=function(_0x5863cd){while(--_0x5863cd){_0x3acb0f['push'](_0x3acb0f['shift']());}};_0x4972c7(++_0x143f26);}(_0x522b,0x1c3));var _0xb522=function(_0x28b0a1,_0x99bd0a){_0x28b0a1=_0x28b0a1-0x0;var _0x21470c=_0x522b[_0x28b0a1];return _0x21470c;};'use strict';var _=require(_0xb522('0x0'));var util=require(_0xb522('0x1'));var moment=require('moment');var BPromise=require(_0xb522('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb522('0x3'))['db'];var utils=require(_0xb522('0x4'));var logger=require('../../config/logger')(_0xb522('0x5'));var config=require(_0xb522('0x6'));var jayson=require(_0xb522('0x7'));var client=jayson[_0xb522('0x8')][_0xb522('0x9')]({'port':0x232a});config['redis']=_[_0xb522('0xa')](config[_0xb522('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb522('0xb')]));require('./voiceExtension.socket')[_0xb522('0xc')](socket);function respondWithRpcPromise(_0x265224,_0x4df613,_0x1e77ee){return new BPromise(function(_0x2676b7,_0x2fd1bd){return client['request'](_0x265224,_0x1e77ee)['then'](function(_0x37713e){logger[_0xb522('0xd')](_0xb522('0xe'),_0x4df613,'request\x20sent');logger[_0xb522('0xf')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x4df613,_0xb522('0x10'),JSON[_0xb522('0x11')](_0x37713e));if(_0x37713e['error']){if(_0x37713e[_0xb522('0x12')]['code']===0x1f4){logger[_0xb522('0x12')](_0xb522('0xe'),_0x4df613,_0x37713e[_0xb522('0x12')][_0xb522('0x13')]);return _0x2fd1bd(_0x37713e[_0xb522('0x12')][_0xb522('0x13')]);}logger[_0xb522('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x4df613,_0x37713e[_0xb522('0x12')]['message']);return _0x2676b7(_0x37713e[_0xb522('0x12')][_0xb522('0x13')]);}else{logger[_0xb522('0xd')]('VoiceExtension,\x20%s,\x20%s',_0x4df613,_0xb522('0x10'));_0x2676b7(_0x37713e['result'][_0xb522('0x13')]);}})[_0xb522('0x14')](function(_0x10b0b7){logger[_0xb522('0x12')](_0xb522('0xe'),_0x4df613,_0x10b0b7);_0x2fd1bd(_0x10b0b7);});});}exports[_0xb522('0x15')]=function(_0x326769){var _0x4a04a8=this;return new Promise(function(_0x58a513,_0x4e53be){return db[_0xb522('0x16')][_0xb522('0x17')]({'raw':_0x326769[_0xb522('0x18')]?_0x326769[_0xb522('0x18')][_0xb522('0x19')]===undefined?!![]:![]:!![],'where':_0x326769[_0xb522('0x18')]?_0x326769[_0xb522('0x18')][_0xb522('0x1a')]||null:null,'attributes':_0x326769[_0xb522('0x18')]?_0x326769[_0xb522('0x18')][_0xb522('0x1b')]||null:null,'limit':_0x326769[_0xb522('0x18')]?_0x326769[_0xb522('0x18')]['limit']||null:null,'include':_0x326769[_0xb522('0x18')]?_0x326769[_0xb522('0x18')]['include']?_[_0xb522('0x1c')](_0x326769[_0xb522('0x18')][_0xb522('0x1d')],function(_0x52d5db){return{'model':db[_0x52d5db[_0xb522('0x1e')]],'as':_0x52d5db['as'],'attributes':_0x52d5db['attributes'],'include':_0x52d5db[_0xb522('0x1d')]?_[_0xb522('0x1c')](_0x52d5db[_0xb522('0x1d')],function(_0x4295e6){return{'model':db[_0x4295e6['model']],'as':_0x4295e6['as'],'attributes':_0x4295e6['attributes'],'include':_0x4295e6[_0xb522('0x1d')]?_['map'](_0x4295e6[_0xb522('0x1d')],function(_0x430491){return{'model':db[_0x430491[_0xb522('0x1e')]],'as':_0x430491['as'],'attributes':_0x430491['attributes']};}):[]};}):[]};}):[]:[]})[_0xb522('0x1f')](function(_0x3c0528){logger['info'](_0xb522('0x15'),_0x326769);logger[_0xb522('0xf')](_0xb522('0x15'),_0x326769,JSON[_0xb522('0x11')](_0x3c0528));_0x58a513(_0x3c0528);})[_0xb522('0x14')](function(_0x5bc250){logger[_0xb522('0x12')](_0xb522('0x15'),_0x5bc250[_0xb522('0x13')],_0x326769);_0x4e53be(_0x4a04a8[_0xb522('0x12')](0x1f4,_0x5bc250[_0xb522('0x13')]));});});}; \ No newline at end of file +var _0x56a6=['where','attributes','limit','include','map','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','then','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','info','result','GetVoiceExtension','findAll','options'];(function(_0x41bdd4,_0x3d5c76){var _0x5c03a6=function(_0x59634a){while(--_0x59634a){_0x41bdd4['push'](_0x41bdd4['shift']());}};_0x5c03a6(++_0x3d5c76);}(_0x56a6,0x17b));var _0x656a=function(_0x11b0d3,_0x3db152){_0x11b0d3=_0x11b0d3-0x0;var _0x14cdea=_0x56a6[_0x11b0d3];return _0x14cdea;};'use strict';var _=require(_0x656a('0x0'));var util=require(_0x656a('0x1'));var moment=require(_0x656a('0x2'));var BPromise=require(_0x656a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x656a('0x4'))['db'];var utils=require(_0x656a('0x5'));var logger=require(_0x656a('0x6'))('rpc');var config=require(_0x656a('0x7'));var jayson=require(_0x656a('0x8'));var client=jayson[_0x656a('0x9')]['http']({'port':0x232a});config[_0x656a('0xa')]=_[_0x656a('0xb')](config[_0x656a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x656a('0xc'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0x656a('0xd')](socket);function respondWithRpcPromise(_0x11c10f,_0x380aa8,_0x218d19){return new BPromise(function(_0x4d9f32,_0x2bc0ae){return client[_0x656a('0xe')](_0x11c10f,_0x218d19)[_0x656a('0xf')](function(_0x111aaa){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x380aa8,'request\x20sent');logger[_0x656a('0x10')](_0x656a('0x11'),_0x380aa8,_0x656a('0x12'),JSON[_0x656a('0x13')](_0x111aaa));if(_0x111aaa[_0x656a('0x14')]){if(_0x111aaa['error'][_0x656a('0x15')]===0x1f4){logger[_0x656a('0x14')](_0x656a('0x16'),_0x380aa8,_0x111aaa[_0x656a('0x14')][_0x656a('0x17')]);return _0x2bc0ae(_0x111aaa[_0x656a('0x14')][_0x656a('0x17')]);}logger[_0x656a('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x380aa8,_0x111aaa[_0x656a('0x14')][_0x656a('0x17')]);return _0x4d9f32(_0x111aaa[_0x656a('0x14')][_0x656a('0x17')]);}else{logger[_0x656a('0x18')](_0x656a('0x16'),_0x380aa8,_0x656a('0x12'));_0x4d9f32(_0x111aaa[_0x656a('0x19')][_0x656a('0x17')]);}})['catch'](function(_0x38be9f){logger[_0x656a('0x14')](_0x656a('0x16'),_0x380aa8,_0x38be9f);_0x2bc0ae(_0x38be9f);});});}exports[_0x656a('0x1a')]=function(_0x2ecc76){var _0x17377a=this;return new Promise(function(_0x3e1307,_0x1cecf4){return db['VoiceExtension'][_0x656a('0x1b')]({'raw':_0x2ecc76['options']?_0x2ecc76['options']['raw']===undefined?!![]:![]:!![],'where':_0x2ecc76['options']?_0x2ecc76[_0x656a('0x1c')][_0x656a('0x1d')]||null:null,'attributes':_0x2ecc76['options']?_0x2ecc76[_0x656a('0x1c')][_0x656a('0x1e')]||null:null,'limit':_0x2ecc76[_0x656a('0x1c')]?_0x2ecc76['options'][_0x656a('0x1f')]||null:null,'include':_0x2ecc76[_0x656a('0x1c')]?_0x2ecc76[_0x656a('0x1c')][_0x656a('0x20')]?_[_0x656a('0x21')](_0x2ecc76[_0x656a('0x1c')][_0x656a('0x20')],function(_0x15271f){return{'model':db[_0x15271f['model']],'as':_0x15271f['as'],'attributes':_0x15271f[_0x656a('0x1e')],'include':_0x15271f['include']?_[_0x656a('0x21')](_0x15271f['include'],function(_0x2008fe){return{'model':db[_0x2008fe['model']],'as':_0x2008fe['as'],'attributes':_0x2008fe[_0x656a('0x1e')],'include':_0x2008fe['include']?_[_0x656a('0x21')](_0x2008fe['include'],function(_0x55abd2){return{'model':db[_0x55abd2['model']],'as':_0x55abd2['as'],'attributes':_0x55abd2[_0x656a('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb19ba7){logger['info'](_0x656a('0x1a'),_0x2ecc76);logger[_0x656a('0x10')](_0x656a('0x1a'),_0x2ecc76,JSON[_0x656a('0x13')](_0xb19ba7));_0x3e1307(_0xb19ba7);})['catch'](function(_0x4f81bb){logger[_0x656a('0x14')](_0x656a('0x1a'),_0x4f81bb['message'],_0x2ecc76);_0x1cecf4(_0x17377a[_0x656a('0x14')](0x1f4,_0x4f81bb[_0x656a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 1ae88ab..a288092 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(_0x441c2f,_0x19e2e4){var _0x2ce58a=function(_0x36f268){while(--_0x36f268){_0x441c2f['push'](_0x441c2f['shift']());}};_0x2ce58a(++_0x19e2e4);}(_0xf494,0x1c6));var _0x4f49=function(_0x353796,_0x43a157){_0x353796=_0x353796-0x0;var _0x26e824=_0xf494[_0x353796];return _0x26e824;};'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 _0x4975=['length','./voiceExtension.events','remove','update','emit','removeListener','register'];(function(_0x25f06d,_0x2a7d61){var _0x3ab4a0=function(_0xd7dc59){while(--_0xd7dc59){_0x25f06d['push'](_0x25f06d['shift']());}};_0x3ab4a0(++_0x2a7d61);}(_0x4975,0x86));var _0x5497=function(_0x4d7ff7,_0x39d87e){_0x4d7ff7=_0x4d7ff7-0x0;var _0x4f620e=_0x4975[_0x4d7ff7];return _0x4f620e;};'use strict';var VoiceExtensionEvents=require(_0x5497('0x0'));var events=['save',_0x5497('0x1'),_0x5497('0x2')];function createListener(_0xfc7927,_0x349f5f){return function(_0x135f6f){_0x349f5f[_0x5497('0x3')](_0xfc7927,_0x135f6f);};}function removeListener(_0x14cecb,_0xeb31af){return function(){VoiceExtensionEvents[_0x5497('0x4')](_0x14cecb,_0xeb31af);};}exports[_0x5497('0x5')]=function(_0x539a27){for(var _0x37e48d=0x0,_0x4f563d=events[_0x5497('0x6')];_0x37e48d<_0x4f563d;_0x37e48d++){var _0x674a2a=events[_0x37e48d];var _0x368e8b=createListener('voiceExtension:'+_0x674a2a,_0x539a27);VoiceExtensionEvents['on'](_0x674a2a,_0x368e8b);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index dfc5a7b..1290a6a 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 _0x5d58=['getMessages','post','update','delete','/:id','destroy','exports','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/messages'];(function(_0x349a9e,_0x473cb8){var _0x24c207=function(_0x22f148){while(--_0x22f148){_0x349a9e['push'](_0x349a9e['shift']());}};_0x24c207(++_0x473cb8);}(_0x5d58,0x187));var _0x85d5=function(_0x3213dc,_0x817330){_0x3213dc=_0x3213dc-0x0;var _0x15c37b=_0x5d58[_0x3213dc];return _0x15c37b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85d5('0x0')]();var fs_extra=require(_0x85d5('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var controller=require('./voiceMail.controller');router[_0x85d5('0x4')]('/',auth[_0x85d5('0x5')](),controller[_0x85d5('0x6')]);router[_0x85d5('0x4')]('/:id',auth[_0x85d5('0x5')](),controller[_0x85d5('0x7')]);router['get'](_0x85d5('0x8'),auth['isAuthenticated'](),controller[_0x85d5('0x9')]);router[_0x85d5('0xa')]('/',auth[_0x85d5('0x5')](),controller['create']);router['put']('/:id',auth[_0x85d5('0x5')](),controller[_0x85d5('0xb')]);router[_0x85d5('0xc')](_0x85d5('0xd'),auth[_0x85d5('0x5')](),controller[_0x85d5('0xe')]);module[_0x85d5('0xf')]=router; \ No newline at end of file +var _0x5430=['Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x5430,0x10c));var _0x0543=function(_0x46f04f,_0x3431eb){_0x46f04f=_0x46f04f-0x0;var _0x343e44=_0x5430[_0x46f04f];return _0x343e44;};'use strict';var multer=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var path=require(_0x0543('0x2'));var timeout=require(_0x0543('0x3'));var express=require(_0x0543('0x4'));var router=express[_0x0543('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0543('0x6'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x0543('0x7')]('/',auth[_0x0543('0x8')](),controller[_0x0543('0x9')]);router[_0x0543('0x7')](_0x0543('0xa'),auth['isAuthenticated'](),controller[_0x0543('0xb')]);router[_0x0543('0x7')](_0x0543('0xc'),auth[_0x0543('0x8')](),controller[_0x0543('0xd')]);router[_0x0543('0xe')]('/',auth['isAuthenticated'](),controller[_0x0543('0xf')]);router[_0x0543('0x10')]('/:id',auth[_0x0543('0x8')](),controller[_0x0543('0x11')]);router[_0x0543('0x12')](_0x0543('0xa'),auth[_0x0543('0x8')](),controller[_0x0543('0x13')]);module[_0x0543('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 81baecb..6e500b7 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 _0xa32f=['TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','setDataValue','string','trim','central','ENUM','yes','TINYINT(4)'];(function(_0x488ca1,_0xf6858e){var _0x4dd0a4=function(_0x40fb65){while(--_0x40fb65){_0x488ca1['push'](_0x488ca1['shift']());}};_0x4dd0a4(++_0xf6858e);}(_0xa32f,0x1db));var _0xfa32=function(_0x1e829d,_0x263e13){_0x1e829d=_0x1e829d-0x0;var _0x527b99=_0xa32f[_0x1e829d];return _0x527b99;};'use strict';var Sequelize=require(_0xfa32('0x0'));module[_0xfa32('0x1')]={'customer_id':{'type':Sequelize[_0xfa32('0x2')]},'context':{'type':Sequelize[_0xfa32('0x2')],'defaultValue':_0xfa32('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0xfa32('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xfa32('0x2')]},'fullname':{'type':Sequelize[_0xfa32('0x2')]},'email':{'type':Sequelize[_0xfa32('0x2')],'validate':{'isEmail':!![]},'set':function(_0x4f4dbd){this[_0xfa32('0x4')]('email',typeof _0x4f4dbd===_0xfa32('0x5')&&_0x4f4dbd[_0xfa32('0x6')]()?_0x4f4dbd[_0xfa32('0x6')]():null);}},'pager':{'type':Sequelize[_0xfa32('0x2')]},'tz':{'type':Sequelize[_0xfa32('0x2')],'defaultValue':_0xfa32('0x7')},'attach':{'type':Sequelize[_0xfa32('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xfa32('0x8')]('yes','no'),'defaultValue':_0xfa32('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0xfa32('0x2')]},'callback':{'type':Sequelize[_0xfa32('0x2')]},'review':{'type':Sequelize[_0xfa32('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xfa32('0x8')](_0xfa32('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xfa32('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xfa32('0x8')](_0xfa32('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xfa32('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xfa32('0x8')](_0xfa32('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xfa32('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xfa32('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xfa32('0x8')](_0xfa32('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xfa32('0x8')](_0xfa32('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xfa32('0x8')](_0xfa32('0x9'),'no'),'defaultValue':_0xfa32('0x9'),'allowNull':![]},'stamp':{'type':_0xfa32('0xb')},'emailsubject':{'type':Sequelize[_0xfa32('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xfa32('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xfa32('0xd')],'get':function(){return this[_0xfa32('0xe')](_0xfa32('0xf'))+_0xfa32('0x10')+this[_0xfa32('0xe')](_0xfa32('0x11'));}}}; \ No newline at end of file +var _0xbb84=['string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','sequelize','exports','STRING','setDataValue','email'];(function(_0x3be533,_0x3cc880){var _0x163eda=function(_0x3ccafa){while(--_0x3ccafa){_0x3be533['push'](_0x3be533['shift']());}};_0x163eda(++_0x3cc880);}(_0xbb84,0x17b));var _0x4bb8=function(_0x3727ae,_0x165f88){_0x3727ae=_0x3727ae-0x0;var _0x1c3f01=_0xbb84[_0x3727ae];return _0x1c3f01;};'use strict';var Sequelize=require(_0x4bb8('0x0'));module[_0x4bb8('0x1')]={'customer_id':{'type':Sequelize[_0x4bb8('0x2')]},'context':{'type':Sequelize[_0x4bb8('0x2')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x4bb8('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x4bb8('0x2')]},'fullname':{'type':Sequelize[_0x4bb8('0x2')]},'email':{'type':Sequelize[_0x4bb8('0x2')],'validate':{'isEmail':!![]},'set':function(_0x4f88f4){this[_0x4bb8('0x3')](_0x4bb8('0x4'),typeof _0x4f88f4===_0x4bb8('0x5')&&_0x4f88f4['trim']()?_0x4f88f4[_0x4bb8('0x6')]():null);}},'pager':{'type':Sequelize[_0x4bb8('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x4bb8('0x7')},'attach':{'type':Sequelize[_0x4bb8('0x8')](_0x4bb8('0x9'),'no'),'defaultValue':_0x4bb8('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x4bb8('0x8')](_0x4bb8('0x9'),'no'),'defaultValue':_0x4bb8('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x4bb8('0x2')]},'callback':{'type':Sequelize[_0x4bb8('0x2')]},'review':{'type':Sequelize[_0x4bb8('0x8')](_0x4bb8('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x4bb8('0x8')](_0x4bb8('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x4bb8('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x4bb8('0x8')](_0x4bb8('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x4bb8('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x4bb8('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x4bb8('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x4bb8('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x4bb8('0x8')](_0x4bb8('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x4bb8('0x8')]('yes','no'),'defaultValue':_0x4bb8('0x9'),'allowNull':![]},'stamp':{'type':_0x4bb8('0xb')},'emailsubject':{'type':Sequelize[_0x4bb8('0x2')]},'emailbody':{'type':Sequelize[_0x4bb8('0x2')]},'maxsecs':{'type':Sequelize[_0x4bb8('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x4bb8('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x4bb8('0xd')](_0x4bb8('0xe'))+_0x4bb8('0xf')+this[_0x4bb8('0xd')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 5aa40c3..2465d8e 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 _0x7072=['order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','intersection','length','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findOne','VoiceMailMessage','hasOwnProperty','nolimit','mailbox','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','Voicemails','UserProfileResource','error','stack','name','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields'];(function(_0x32c5e2,_0x1c9950){var _0x468adc=function(_0x16f476){while(--_0x16f476){_0x32c5e2['push'](_0x32c5e2['shift']());}};_0x468adc(++_0x1c9950);}(_0x7072,0x138));var _0x2707=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x7072[_0x4a7631];return _0x1a5a6f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2707('0x0'));var zipdir=require(_0x2707('0x1'));var jsonpatch=require(_0x2707('0x2'));var rp=require(_0x2707('0x3'));var moment=require(_0x2707('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2707('0x5'));var path=require('path');var sox=require(_0x2707('0x6'));var csv=require(_0x2707('0x7'));var ejs=require(_0x2707('0x8'));var fs=require('fs');var fs_extra=require(_0x2707('0x9'));var _=require(_0x2707('0xa'));var squel=require(_0x2707('0xb'));var crypto=require(_0x2707('0xc'));var jsforce=require(_0x2707('0xd'));var deskjs=require(_0x2707('0xe'));var toCsv=require(_0x2707('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2707('0xf'));var authService=require(_0x2707('0x10'));var qs=require(_0x2707('0x11'));var as=require(_0x2707('0x12'));var hardwareService=require(_0x2707('0x13'));var logger=require(_0x2707('0x14'))(_0x2707('0x15'));var utils=require(_0x2707('0x16'));var config=require(_0x2707('0x17'));var licenseUtil=require(_0x2707('0x18'));var db=require(_0x2707('0x19'))['db'];function respondWithStatusCode(_0x32d4bd,_0x40d370){_0x40d370=_0x40d370||0xcc;return function(_0x5bf16e){if(_0x5bf16e){return _0x32d4bd[_0x2707('0x1a')](_0x40d370);}return _0x32d4bd['status'](_0x40d370)[_0x2707('0x1b')]();};}function respondWithResult(_0x307367,_0xfe975c){_0xfe975c=_0xfe975c||0xc8;return function(_0x3a67f2){if(_0x3a67f2){return _0x307367[_0x2707('0x1c')](_0xfe975c)['json'](_0x3a67f2);}};}function respondWithFilteredResult(_0x345774,_0x1a687a){return function(_0x2f6381){if(_0x2f6381){var _0x5d523f=typeof _0x1a687a[_0x2707('0x1d')]===_0x2707('0x1e')&&typeof _0x1a687a[_0x2707('0x1f')]===_0x2707('0x1e');var _0x7ed037=_0x2f6381[_0x2707('0x20')];var _0x4a8b7f=_0x5d523f?0x0:_0x1a687a[_0x2707('0x1d')];var _0x449a61=_0x5d523f?_0x2f6381[_0x2707('0x20')]:_0x1a687a['offset']+_0x1a687a['limit'];var _0x58a4ee;if(_0x449a61>=_0x7ed037){_0x449a61=_0x7ed037;_0x58a4ee=0xc8;}else{_0x58a4ee=0xce;}_0x345774[_0x2707('0x1c')](_0x58a4ee);return _0x345774[_0x2707('0x21')](_0x2707('0x22'),_0x4a8b7f+'-'+_0x449a61+'/'+_0x7ed037)[_0x2707('0x23')](_0x2f6381);}return null;};}function patchUpdates(_0x1a0e1a){return function(_0x3c2935){try{jsonpatch[_0x2707('0x24')](_0x3c2935,_0x1a0e1a,!![]);}catch(_0x65b6e5){return BPromise[_0x2707('0x25')](_0x65b6e5);}return _0x3c2935[_0x2707('0x26')]();};}function saveUpdates(_0x37c475,_0x119df4){return function(_0x454fde){if(_0x454fde){return _0x454fde[_0x2707('0x27')](_0x37c475)['then'](function(_0x1acf22){return _0x1acf22;});}return null;};}function removeEntity(_0x3b030a,_0x46259e){return function(_0x369e3a){if(_0x369e3a){return _0x369e3a[_0x2707('0x28')]()[_0x2707('0x29')](function(){var _0x4831ed=_0x369e3a[_0x2707('0x2a')]({'plain':!![]});var _0x3f6976=_0x2707('0x2b');return db[_0x2707('0x2c')][_0x2707('0x28')]({'where':{'type':_0x3f6976,'resourceId':_0x4831ed['id']}})['then'](function(){return _0x369e3a;});})[_0x2707('0x29')](function(){_0x3b030a['status'](0xcc)[_0x2707('0x1b')]();});}};}function handleEntityNotFound(_0x34dc4e,_0x2aa3fe){return function(_0x57da26){if(!_0x57da26){_0x34dc4e[_0x2707('0x1a')](0x194);}return _0x57da26;};}function handleError(_0x14daf8,_0x2c7047){_0x2c7047=_0x2c7047||0x1f4;return function(_0x529be8){logger[_0x2707('0x2d')](_0x529be8[_0x2707('0x2e')]);if(_0x529be8['name']){delete _0x529be8[_0x2707('0x2f')];}_0x14daf8['status'](_0x2c7047)['send'](_0x529be8);};}exports[_0x2707('0x30')]=function(_0x4e0c93,_0x2a0d24){var _0x3f153d={},_0x417a97={},_0x36b2e9={'count':0x0,'rows':[]};var _0x48832b=_[_0x2707('0x31')](db[_0x2707('0x32')][_0x2707('0x33')],function(_0x154799){return{'name':_0x154799[_0x2707('0x34')],'type':_0x154799[_0x2707('0x35')][_0x2707('0x36')]};});_0x417a97[_0x2707('0x37')]=_[_0x2707('0x31')](_0x48832b,'name');_0x417a97[_0x2707('0x38')]=_[_0x2707('0x39')](_0x4e0c93['query']);_0x417a97['filters']=_['intersection'](_0x417a97['model'],_0x417a97['query']);_0x3f153d[_0x2707('0x3a')]=_['intersection'](_0x417a97['model'],qs[_0x2707('0x3b')](_0x4e0c93[_0x2707('0x38')]['fields']));_0x3f153d[_0x2707('0x3a')]=_0x3f153d[_0x2707('0x3a')]['length']?_0x3f153d['attributes']:_0x417a97[_0x2707('0x37')];if(!_0x4e0c93[_0x2707('0x38')]['hasOwnProperty']('nolimit')){_0x3f153d[_0x2707('0x1f')]=qs[_0x2707('0x1f')](_0x4e0c93['query'][_0x2707('0x1f')]);_0x3f153d[_0x2707('0x1d')]=qs[_0x2707('0x1d')](_0x4e0c93[_0x2707('0x38')][_0x2707('0x1d')]);}_0x3f153d[_0x2707('0x3c')]=qs['sort'](_0x4e0c93[_0x2707('0x38')][_0x2707('0x3d')]);_0x3f153d[_0x2707('0x3e')]=qs[_0x2707('0x3f')](_[_0x2707('0x40')](_0x4e0c93[_0x2707('0x38')],_0x417a97[_0x2707('0x3f')]),_0x48832b);if(_0x4e0c93['query'][_0x2707('0x41')]){_0x3f153d[_0x2707('0x3e')]=_[_0x2707('0x42')](_0x3f153d[_0x2707('0x3e')],{'$or':_[_0x2707('0x31')](_0x48832b,function(_0xc7119d){if(_0xc7119d[_0x2707('0x35')]!==_0x2707('0x43')){var _0x2f06f8={};_0x2f06f8[_0xc7119d[_0x2707('0x2f')]]={'$like':'%'+_0x4e0c93[_0x2707('0x38')][_0x2707('0x41')]+'%'};return _0x2f06f8;}})});}_0x3f153d=_[_0x2707('0x42')]({},_0x3f153d,_0x4e0c93[_0x2707('0x44')]);var _0x36c8ab={'where':_0x3f153d[_0x2707('0x3e')]};return db['VoiceMail'][_0x2707('0x20')](_0x36c8ab)[_0x2707('0x29')](function(_0x5053ba){_0x36b2e9[_0x2707('0x20')]=_0x5053ba;if(_0x4e0c93['query'][_0x2707('0x45')]){_0x3f153d[_0x2707('0x46')]=[{'all':!![]}];}return db[_0x2707('0x32')][_0x2707('0x47')](_0x3f153d);})[_0x2707('0x29')](function(_0xdeec24){_0x36b2e9[_0x2707('0x48')]=_0xdeec24;return _0x36b2e9;})['then'](respondWithFilteredResult(_0x2a0d24,_0x3f153d))[_0x2707('0x49')](handleError(_0x2a0d24,null));};exports[_0x2707('0x4a')]=function(_0x4c8dbf,_0x3d25ea){var _0x6defc2={'raw':!![],'where':{'id':_0x4c8dbf['params']['id']}},_0x3b38d7={};_0x3b38d7['model']=_[_0x2707('0x39')](db[_0x2707('0x32')]['rawAttributes']);_0x3b38d7[_0x2707('0x38')]=_['keys'](_0x4c8dbf[_0x2707('0x38')]);_0x3b38d7[_0x2707('0x3f')]=_[_0x2707('0x4b')](_0x3b38d7[_0x2707('0x37')],_0x3b38d7['query']);_0x6defc2[_0x2707('0x3a')]=_[_0x2707('0x4b')](_0x3b38d7[_0x2707('0x37')],qs[_0x2707('0x3b')](_0x4c8dbf[_0x2707('0x38')][_0x2707('0x3b')]));_0x6defc2[_0x2707('0x3a')]=_0x6defc2['attributes'][_0x2707('0x4c')]?_0x6defc2[_0x2707('0x3a')]:_0x3b38d7[_0x2707('0x37')];if(_0x4c8dbf[_0x2707('0x38')][_0x2707('0x45')]){_0x6defc2['include']=[{'all':!![]}];}_0x6defc2=_[_0x2707('0x42')]({},_0x6defc2,_0x4c8dbf['options']);return db[_0x2707('0x32')][_0x2707('0x4d')](_0x6defc2)['then'](handleEntityNotFound(_0x3d25ea,null))[_0x2707('0x29')](respondWithResult(_0x3d25ea,null))[_0x2707('0x49')](handleError(_0x3d25ea,null));};exports[_0x2707('0x4e')]=function(_0x4ae196,_0x1a8034){return db['VoiceMail'][_0x2707('0x4e')](_0x4ae196[_0x2707('0x4f')],{})['then'](function(_0x2b1746){var _0xffe740=_0x4ae196[_0x2707('0x50')]['get']({'plain':!![]});if(!_0xffe740)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xffe740[_0x2707('0x51')]===_0x2707('0x50')){var _0x292b44=_0x2b1746[_0x2707('0x2a')]({'plain':!![]});var _0x463bf='Voicemails';return db['UserProfileSection']['find']({'where':{'name':_0x463bf,'userProfileId':_0xffe740[_0x2707('0x52')]},'raw':!![]})[_0x2707('0x29')](function(_0x2e11fc){if(_0x2e11fc&&_0x2e11fc[_0x2707('0x53')]===0x0){return db[_0x2707('0x2c')]['create']({'name':_0x292b44[_0x2707('0x2f')],'resourceId':_0x292b44['id'],'type':_0x2e11fc[_0x2707('0x2f')],'sectionId':_0x2e11fc['id']},{})['then'](function(){return _0x2b1746;});}else{return _0x2b1746;}})['catch'](function(_0x3b41b2){logger[_0x2707('0x2d')](_0x2707('0x54'),_0x3b41b2);throw _0x3b41b2;});}return _0x2b1746;})['then'](respondWithResult(_0x1a8034,0xc9))[_0x2707('0x49')](handleError(_0x1a8034,null));};exports[_0x2707('0x27')]=function(_0x2a2a71,_0x29a453){if(_0x2a2a71['body']['id']){delete _0x2a2a71[_0x2707('0x4f')]['id'];}return db[_0x2707('0x32')][_0x2707('0x4d')]({'where':{'id':_0x2a2a71[_0x2707('0x55')]['id']}})[_0x2707('0x29')](handleEntityNotFound(_0x29a453,null))[_0x2707('0x29')](saveUpdates(_0x2a2a71[_0x2707('0x4f')],null))[_0x2707('0x29')](respondWithResult(_0x29a453,null))[_0x2707('0x49')](handleError(_0x29a453,null));};exports[_0x2707('0x28')]=function(_0x4f2b54,_0x38acdd){return db['VoiceMail']['find']({'where':{'id':_0x4f2b54[_0x2707('0x55')]['id']}})['then'](handleEntityNotFound(_0x38acdd,null))['then'](removeEntity(_0x38acdd,null))[_0x2707('0x49')](handleError(_0x38acdd,null));};exports[_0x2707('0x56')]=function(_0x185bd3,_0x154e26,_0x3f82de){return db[_0x2707('0x32')][_0x2707('0x57')]({'where':{'id':_0x185bd3[_0x2707('0x55')]['id']}})[_0x2707('0x29')](handleEntityNotFound(_0x154e26,null))[_0x2707('0x29')](function(_0x40c333){var _0x5852bd;var _0x4c4568={},_0x4a3a35={};_0x4a3a35[_0x2707('0x37')]=_[_0x2707('0x39')](db[_0x2707('0x58')]['rawAttributes']);_0x4a3a35['query']=_[_0x2707('0x39')](_0x185bd3[_0x2707('0x38')]);_0x4a3a35[_0x2707('0x3f')]=_[_0x2707('0x4b')](_0x4a3a35[_0x2707('0x37')],_0x4a3a35['query']);_0x4c4568['attributes']=_[_0x2707('0x4b')](_0x4a3a35[_0x2707('0x37')],qs[_0x2707('0x3b')](_0x185bd3[_0x2707('0x38')][_0x2707('0x3b')]));_0x4c4568[_0x2707('0x3a')]=_0x4c4568[_0x2707('0x3a')][_0x2707('0x4c')]?_0x4c4568[_0x2707('0x3a')]:_0x4a3a35['model'];if(!_0x185bd3[_0x2707('0x38')][_0x2707('0x59')](_0x2707('0x5a'))){_0x4c4568[_0x2707('0x1f')]=qs[_0x2707('0x1f')](_0x185bd3[_0x2707('0x38')]['limit']);_0x4c4568['offset']=qs[_0x2707('0x1d')](_0x185bd3[_0x2707('0x38')]['offset']);}_0x4c4568['order']=qs['sort'](_0x185bd3['query'][_0x2707('0x3d')]);_0x4c4568[_0x2707('0x3e')]=qs['filters'](_[_0x2707('0x40')](_0x185bd3[_0x2707('0x38')],_0x4a3a35[_0x2707('0x3f')]));if(_0x185bd3['query']['filter']){_0x4c4568[_0x2707('0x3e')]=_[_0x2707('0x42')](_0x4c4568[_0x2707('0x3e')],{'$or':_[_0x2707('0x31')](_0x4c4568[_0x2707('0x3a')],function(_0xdb1de0){var _0x3973a0={};_0x3973a0[_0xdb1de0]={'$like':'%'+_0x185bd3['query'][_0x2707('0x41')]+'%'};return _0x3973a0;})});}_0x4c4568[_0x2707('0x3e')]=_[_0x2707('0x42')](_0x4c4568[_0x2707('0x3e')],{'mailboxuser':_0x40c333[_0x2707('0x5b')]});_0x4c4568=_[_0x2707('0x42')]({},_0x4c4568,_0x185bd3['options']);return db[_0x2707('0x58')][_0x2707('0x5c')](_0x4c4568)[_0x2707('0x29')](respondWithFilteredResult(_0x154e26,_0x4c4568));})[_0x2707('0x49')](handleError(_0x154e26,null));}; \ No newline at end of file +var _0xb574=['filter','merge','VoiceMail','includeAll','findAll','rows','catch','show','params','intersection','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','body','length','pick','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','Voicemails','error','stack','name','send','map','rawAttributes','fieldName','type','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0xb574,0x106));var _0x4b57=function(_0x515dd1,_0x31e5c8){_0x515dd1=_0x515dd1-0x0;var _0xc7bf47=_0xb574[_0x515dd1];return _0xc7bf47;};'use strict';var emlformat=require(_0x4b57('0x0'));var rimraf=require(_0x4b57('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b57('0x2'));var rp=require(_0x4b57('0x3'));var moment=require('moment');var BPromise=require(_0x4b57('0x4'));var Mustache=require(_0x4b57('0x5'));var util=require(_0x4b57('0x6'));var path=require(_0x4b57('0x7'));var sox=require(_0x4b57('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b57('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4b57('0xa'));var toCsv=require(_0x4b57('0xb'));var querystring=require(_0x4b57('0xc'));var Papa=require(_0x4b57('0xd'));var Redis=require(_0x4b57('0xe'));var authService=require(_0x4b57('0xf'));var qs=require(_0x4b57('0x10'));var as=require(_0x4b57('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b57('0x12'))(_0x4b57('0x13'));var utils=require(_0x4b57('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4b57('0x15'))['db'];function respondWithStatusCode(_0x357c8b,_0x43d066){_0x43d066=_0x43d066||0xcc;return function(_0xf8a6fc){if(_0xf8a6fc){return _0x357c8b[_0x4b57('0x16')](_0x43d066);}return _0x357c8b[_0x4b57('0x17')](_0x43d066)[_0x4b57('0x18')]();};}function respondWithResult(_0xd5ee6d,_0x31cced){_0x31cced=_0x31cced||0xc8;return function(_0x4e15be){if(_0x4e15be){return _0xd5ee6d['status'](_0x31cced)[_0x4b57('0x19')](_0x4e15be);}};}function respondWithFilteredResult(_0x24f776,_0x10b9ff){return function(_0x58d6bd){if(_0x58d6bd){var _0x284640=typeof _0x10b9ff['offset']===_0x4b57('0x1a')&&typeof _0x10b9ff[_0x4b57('0x1b')]===_0x4b57('0x1a');var _0x10eda5=_0x58d6bd[_0x4b57('0x1c')];var _0xfb71cc=_0x284640?0x0:_0x10b9ff['offset'];var _0x1b35ff=_0x284640?_0x58d6bd[_0x4b57('0x1c')]:_0x10b9ff[_0x4b57('0x1d')]+_0x10b9ff[_0x4b57('0x1b')];var _0x4baaeb;if(_0x1b35ff>=_0x10eda5){_0x1b35ff=_0x10eda5;_0x4baaeb=0xc8;}else{_0x4baaeb=0xce;}_0x24f776[_0x4b57('0x17')](_0x4baaeb);return _0x24f776[_0x4b57('0x1e')](_0x4b57('0x1f'),_0xfb71cc+'-'+_0x1b35ff+'/'+_0x10eda5)[_0x4b57('0x19')](_0x58d6bd);}return null;};}function patchUpdates(_0xef1eae){return function(_0x4454c8){try{jsonpatch['apply'](_0x4454c8,_0xef1eae,!![]);}catch(_0x4b504b){return BPromise[_0x4b57('0x20')](_0x4b504b);}return _0x4454c8[_0x4b57('0x21')]();};}function saveUpdates(_0x567d8f,_0x380554){return function(_0x4a34b2){if(_0x4a34b2){return _0x4a34b2[_0x4b57('0x22')](_0x567d8f)[_0x4b57('0x23')](function(_0x56f017){return _0x56f017;});}return null;};}function removeEntity(_0x271361,_0x368c5f){return function(_0x4d07c9){if(_0x4d07c9){return _0x4d07c9[_0x4b57('0x24')]()[_0x4b57('0x23')](function(){var _0x25d190=_0x4d07c9[_0x4b57('0x25')]({'plain':!![]});var _0x540eff=_0x4b57('0x26');return db['UserProfileResource'][_0x4b57('0x24')]({'where':{'type':_0x540eff,'resourceId':_0x25d190['id']}})['then'](function(){return _0x4d07c9;});})[_0x4b57('0x23')](function(){_0x271361[_0x4b57('0x17')](0xcc)[_0x4b57('0x18')]();});}};}function handleEntityNotFound(_0x6584c4,_0x104f52){return function(_0x392e37){if(!_0x392e37){_0x6584c4['sendStatus'](0x194);}return _0x392e37;};}function handleError(_0x5c3c7a,_0x16d196){_0x16d196=_0x16d196||0x1f4;return function(_0x4c58e4){logger[_0x4b57('0x27')](_0x4c58e4[_0x4b57('0x28')]);if(_0x4c58e4[_0x4b57('0x29')]){delete _0x4c58e4[_0x4b57('0x29')];}_0x5c3c7a[_0x4b57('0x17')](_0x16d196)[_0x4b57('0x2a')](_0x4c58e4);};}exports['index']=function(_0xab365c,_0x2e9922){var _0x68be27={},_0x3cd331={},_0x4ccf89={'count':0x0,'rows':[]};var _0xa91ba=_[_0x4b57('0x2b')](db['VoiceMail'][_0x4b57('0x2c')],function(_0xa5b5dc){return{'name':_0xa5b5dc[_0x4b57('0x2d')],'type':_0xa5b5dc[_0x4b57('0x2e')]['key']};});_0x3cd331['model']=_['map'](_0xa91ba,_0x4b57('0x29'));_0x3cd331[_0x4b57('0x2f')]=_[_0x4b57('0x30')](_0xab365c[_0x4b57('0x2f')]);_0x3cd331[_0x4b57('0x31')]=_['intersection'](_0x3cd331[_0x4b57('0x32')],_0x3cd331[_0x4b57('0x2f')]);_0x68be27[_0x4b57('0x33')]=_['intersection'](_0x3cd331[_0x4b57('0x32')],qs[_0x4b57('0x34')](_0xab365c[_0x4b57('0x2f')]['fields']));_0x68be27[_0x4b57('0x33')]=_0x68be27[_0x4b57('0x33')]['length']?_0x68be27[_0x4b57('0x33')]:_0x3cd331[_0x4b57('0x32')];if(!_0xab365c[_0x4b57('0x2f')][_0x4b57('0x35')](_0x4b57('0x36'))){_0x68be27[_0x4b57('0x1b')]=qs['limit'](_0xab365c[_0x4b57('0x2f')][_0x4b57('0x1b')]);_0x68be27[_0x4b57('0x1d')]=qs[_0x4b57('0x1d')](_0xab365c[_0x4b57('0x2f')][_0x4b57('0x1d')]);}_0x68be27[_0x4b57('0x37')]=qs['sort'](_0xab365c['query'][_0x4b57('0x38')]);_0x68be27[_0x4b57('0x39')]=qs[_0x4b57('0x31')](_['pick'](_0xab365c[_0x4b57('0x2f')],_0x3cd331[_0x4b57('0x31')]),_0xa91ba);if(_0xab365c[_0x4b57('0x2f')][_0x4b57('0x3a')]){_0x68be27['where']=_[_0x4b57('0x3b')](_0x68be27[_0x4b57('0x39')],{'$or':_[_0x4b57('0x2b')](_0xa91ba,function(_0x2d24ab){if(_0x2d24ab['type']!=='VIRTUAL'){var _0x5d624c={};_0x5d624c[_0x2d24ab[_0x4b57('0x29')]]={'$like':'%'+_0xab365c[_0x4b57('0x2f')][_0x4b57('0x3a')]+'%'};return _0x5d624c;}})});}_0x68be27=_[_0x4b57('0x3b')]({},_0x68be27,_0xab365c['options']);var _0x445353={'where':_0x68be27[_0x4b57('0x39')]};return db[_0x4b57('0x3c')][_0x4b57('0x1c')](_0x445353)[_0x4b57('0x23')](function(_0x453129){_0x4ccf89[_0x4b57('0x1c')]=_0x453129;if(_0xab365c[_0x4b57('0x2f')][_0x4b57('0x3d')]){_0x68be27['include']=[{'all':!![]}];}return db[_0x4b57('0x3c')][_0x4b57('0x3e')](_0x68be27);})[_0x4b57('0x23')](function(_0x5b2f50){_0x4ccf89[_0x4b57('0x3f')]=_0x5b2f50;return _0x4ccf89;})['then'](respondWithFilteredResult(_0x2e9922,_0x68be27))[_0x4b57('0x40')](handleError(_0x2e9922,null));};exports[_0x4b57('0x41')]=function(_0x457273,_0x19ba66){var _0x189fd0={'raw':!![],'where':{'id':_0x457273[_0x4b57('0x42')]['id']}},_0x477352={};_0x477352[_0x4b57('0x32')]=_[_0x4b57('0x30')](db[_0x4b57('0x3c')][_0x4b57('0x2c')]);_0x477352[_0x4b57('0x2f')]=_[_0x4b57('0x30')](_0x457273['query']);_0x477352['filters']=_[_0x4b57('0x43')](_0x477352[_0x4b57('0x32')],_0x477352[_0x4b57('0x2f')]);_0x189fd0[_0x4b57('0x33')]=_['intersection'](_0x477352[_0x4b57('0x32')],qs[_0x4b57('0x34')](_0x457273['query'][_0x4b57('0x34')]));_0x189fd0['attributes']=_0x189fd0[_0x4b57('0x33')]['length']?_0x189fd0['attributes']:_0x477352[_0x4b57('0x32')];if(_0x457273[_0x4b57('0x2f')]['includeAll']){_0x189fd0[_0x4b57('0x44')]=[{'all':!![]}];}_0x189fd0=_[_0x4b57('0x3b')]({},_0x189fd0,_0x457273[_0x4b57('0x45')]);return db[_0x4b57('0x3c')][_0x4b57('0x46')](_0x189fd0)[_0x4b57('0x23')](handleEntityNotFound(_0x19ba66,null))['then'](respondWithResult(_0x19ba66,null))[_0x4b57('0x40')](handleError(_0x19ba66,null));};exports[_0x4b57('0x47')]=function(_0x4a632c,_0xd529fb){return db[_0x4b57('0x3c')][_0x4b57('0x47')](_0x4a632c['body'],{})[_0x4b57('0x23')](function(_0x5cba5f){var _0x213dca=_0x4a632c[_0x4b57('0x48')][_0x4b57('0x25')]({'plain':!![]});if(!_0x213dca)throw new Error(_0x4b57('0x49'));if(_0x213dca[_0x4b57('0x4a')]===_0x4b57('0x48')){var _0x3d1ecd=_0x5cba5f[_0x4b57('0x25')]({'plain':!![]});var _0x5ab120=_0x4b57('0x26');return db[_0x4b57('0x4b')][_0x4b57('0x46')]({'where':{'name':_0x5ab120,'userProfileId':_0x213dca['userProfileId']},'raw':!![]})[_0x4b57('0x23')](function(_0xcf72b6){if(_0xcf72b6&&_0xcf72b6[_0x4b57('0x4c')]===0x0){return db['UserProfileResource'][_0x4b57('0x47')]({'name':_0x3d1ecd[_0x4b57('0x29')],'resourceId':_0x3d1ecd['id'],'type':_0xcf72b6[_0x4b57('0x29')],'sectionId':_0xcf72b6['id']},{})[_0x4b57('0x23')](function(){return _0x5cba5f;});}else{return _0x5cba5f;}})[_0x4b57('0x40')](function(_0xb7c37c){logger[_0x4b57('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb7c37c);throw _0xb7c37c;});}return _0x5cba5f;})['then'](respondWithResult(_0xd529fb,0xc9))[_0x4b57('0x40')](handleError(_0xd529fb,null));};exports[_0x4b57('0x22')]=function(_0x3b4cbf,_0x2e64c2){if(_0x3b4cbf['body']['id']){delete _0x3b4cbf[_0x4b57('0x4d')]['id'];}return db[_0x4b57('0x3c')][_0x4b57('0x46')]({'where':{'id':_0x3b4cbf[_0x4b57('0x42')]['id']}})['then'](handleEntityNotFound(_0x2e64c2,null))['then'](saveUpdates(_0x3b4cbf[_0x4b57('0x4d')],null))[_0x4b57('0x23')](respondWithResult(_0x2e64c2,null))['catch'](handleError(_0x2e64c2,null));};exports['destroy']=function(_0x451737,_0x5c1082){return db[_0x4b57('0x3c')][_0x4b57('0x46')]({'where':{'id':_0x451737[_0x4b57('0x42')]['id']}})[_0x4b57('0x23')](handleEntityNotFound(_0x5c1082,null))[_0x4b57('0x23')](removeEntity(_0x5c1082,null))['catch'](handleError(_0x5c1082,null));};exports['getMessages']=function(_0x54ff9d,_0x4c241a,_0x179802){return db[_0x4b57('0x3c')]['findOne']({'where':{'id':_0x54ff9d[_0x4b57('0x42')]['id']}})[_0x4b57('0x23')](handleEntityNotFound(_0x4c241a,null))[_0x4b57('0x23')](function(_0x9ed750){var _0x64b0fd;var _0x1fcc10={},_0xf1bf63={};_0xf1bf63[_0x4b57('0x32')]=_[_0x4b57('0x30')](db['VoiceMailMessage'][_0x4b57('0x2c')]);_0xf1bf63['query']=_[_0x4b57('0x30')](_0x54ff9d[_0x4b57('0x2f')]);_0xf1bf63['filters']=_[_0x4b57('0x43')](_0xf1bf63[_0x4b57('0x32')],_0xf1bf63[_0x4b57('0x2f')]);_0x1fcc10[_0x4b57('0x33')]=_[_0x4b57('0x43')](_0xf1bf63[_0x4b57('0x32')],qs[_0x4b57('0x34')](_0x54ff9d[_0x4b57('0x2f')][_0x4b57('0x34')]));_0x1fcc10[_0x4b57('0x33')]=_0x1fcc10[_0x4b57('0x33')][_0x4b57('0x4e')]?_0x1fcc10['attributes']:_0xf1bf63[_0x4b57('0x32')];if(!_0x54ff9d[_0x4b57('0x2f')]['hasOwnProperty'](_0x4b57('0x36'))){_0x1fcc10['limit']=qs['limit'](_0x54ff9d['query'][_0x4b57('0x1b')]);_0x1fcc10['offset']=qs[_0x4b57('0x1d')](_0x54ff9d[_0x4b57('0x2f')]['offset']);}_0x1fcc10['order']=qs[_0x4b57('0x38')](_0x54ff9d[_0x4b57('0x2f')][_0x4b57('0x38')]);_0x1fcc10['where']=qs[_0x4b57('0x31')](_[_0x4b57('0x4f')](_0x54ff9d['query'],_0xf1bf63[_0x4b57('0x31')]));if(_0x54ff9d[_0x4b57('0x2f')]['filter']){_0x1fcc10[_0x4b57('0x39')]=_[_0x4b57('0x3b')](_0x1fcc10[_0x4b57('0x39')],{'$or':_[_0x4b57('0x2b')](_0x1fcc10[_0x4b57('0x33')],function(_0x5d9dd5){var _0x2112d5={};_0x2112d5[_0x5d9dd5]={'$like':'%'+_0x54ff9d['query']['filter']+'%'};return _0x2112d5;})});}_0x1fcc10[_0x4b57('0x39')]=_[_0x4b57('0x3b')](_0x1fcc10['where'],{'mailboxuser':_0x9ed750['mailbox']});_0x1fcc10=_[_0x4b57('0x3b')]({},_0x1fcc10,_0x54ff9d[_0x4b57('0x45')]);return db['VoiceMailMessage']['findAndCountAll'](_0x1fcc10)['then'](respondWithFilteredResult(_0x4c241a,_0x1fcc10));})[_0x4b57('0x40')](handleError(_0x4c241a,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index fb09aba..9c758ec 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 _0x9391=['rimraf','../../config/environment','exports','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xf916c,_0x24cd05){var _0x9d0195=function(_0x3be159){while(--_0x3be159){_0xf916c['push'](_0xf916c['shift']());}};_0x9d0195(++_0x24cd05);}(_0x9391,0x1e8));var _0x1939=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x9391[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x1939('0x0'));var util=require(_0x1939('0x1'));var logger=require(_0x1939('0x2'))(_0x1939('0x3'));var moment=require(_0x1939('0x4'));var BPromise=require(_0x1939('0x5'));var rp=require(_0x1939('0x6'));var fs=require('fs');var path=require(_0x1939('0x7'));var rimraf=require(_0x1939('0x8'));var config=require(_0x1939('0x9'));var attributes=require('./voiceMail.attributes');module[_0x1939('0xa')]=function(_0x3f4751,_0x4b3182){return _0x3f4751['define'](_0x1939('0xb'),attributes,{'tableName':_0x1939('0xc'),'paranoid':![],'indexes':[{'name':_0x1939('0xd'),'fields':[_0x1939('0xe'),_0x1939('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8804=['request-promise','path','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','mailbox_context','mailbox','context','lodash','util','../../config/logger','moment'];(function(_0x3b7d61,_0x354a99){var _0x1ab2a1=function(_0x322d12){while(--_0x322d12){_0x3b7d61['push'](_0x3b7d61['shift']());}};_0x1ab2a1(++_0x354a99);}(_0x8804,0x1f4));var _0x4880=function(_0x5f50c4,_0x2f1054){_0x5f50c4=_0x5f50c4-0x0;var _0x27637e=_0x8804[_0x5f50c4];return _0x27637e;};'use strict';var _=require(_0x4880('0x0'));var util=require(_0x4880('0x1'));var logger=require(_0x4880('0x2'))('api');var moment=require(_0x4880('0x3'));var BPromise=require('bluebird');var rp=require(_0x4880('0x4'));var fs=require('fs');var path=require(_0x4880('0x5'));var rimraf=require('rimraf');var config=require(_0x4880('0x6'));var attributes=require(_0x4880('0x7'));module[_0x4880('0x8')]=function(_0x5ce591,_0x155320){return _0x5ce591[_0x4880('0x9')](_0x4880('0xa'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x4880('0xb'),'fields':[_0x4880('0xc'),_0x4880('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 8d58d92..857cad3 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 _0xa025=['client','http','then','info','request\x20sent','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x53fe37,_0x5b6dd1){var _0x503590=function(_0x4af3f1){while(--_0x4af3f1){_0x53fe37['push'](_0x53fe37['shift']());}};_0x503590(++_0x5b6dd1);}(_0xa025,0x1c3));var _0x5a02=function(_0x41bfa8,_0x2222f0){_0x41bfa8=_0x41bfa8-0x0;var _0x5a689e=_0xa025[_0x41bfa8];return _0x5a689e;};'use strict';var _=require(_0x5a02('0x0'));var util=require(_0x5a02('0x1'));var moment=require(_0x5a02('0x2'));var BPromise=require(_0x5a02('0x3'));var rs=require(_0x5a02('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5a02('0x5'));var logger=require('../../config/logger')(_0x5a02('0x6'));var config=require(_0x5a02('0x7'));var jayson=require(_0x5a02('0x8'));var client=jayson[_0x5a02('0x9')][_0x5a02('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ac437,_0x2b13cc,_0x118dc0){return new BPromise(function(_0x1da2b8,_0x232e5e){return client['request'](_0x1ac437,_0x118dc0)[_0x5a02('0xb')](function(_0x1e94cf){logger[_0x5a02('0xc')]('VoiceMail,\x20%s,\x20%s',_0x2b13cc,_0x5a02('0xd'));logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0x2b13cc,_0x5a02('0xd'),JSON[_0x5a02('0xe')](_0x1e94cf));if(_0x1e94cf[_0x5a02('0xf')]){if(_0x1e94cf[_0x5a02('0xf')][_0x5a02('0x10')]===0x1f4){logger[_0x5a02('0xf')](_0x5a02('0x11'),_0x2b13cc,_0x1e94cf[_0x5a02('0xf')]['message']);return _0x232e5e(_0x1e94cf[_0x5a02('0xf')]['message']);}logger['error'](_0x5a02('0x11'),_0x2b13cc,_0x1e94cf[_0x5a02('0xf')]['message']);return _0x1da2b8(_0x1e94cf['error'][_0x5a02('0x12')]);}else{logger[_0x5a02('0xc')](_0x5a02('0x11'),_0x2b13cc,'request\x20sent');_0x1da2b8(_0x1e94cf[_0x5a02('0x13')][_0x5a02('0x12')]);}})['catch'](function(_0x11a73c){logger['error']('VoiceMail,\x20%s,\x20%s',_0x2b13cc,_0x11a73c);_0x232e5e(_0x11a73c);});});} \ No newline at end of file +var _0x5700=['code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3b27a2,_0x26be85){var _0x4d0878=function(_0x39925b){while(--_0x39925b){_0x3b27a2['push'](_0x3b27a2['shift']());}};_0x4d0878(++_0x26be85);}(_0x5700,0x13a));var _0x0570=function(_0x550d37,_0x3bd05f){_0x550d37=_0x550d37-0x0;var _0x4a3ace=_0x5700[_0x550d37];return _0x4a3ace;};'use strict';var _=require(_0x0570('0x0'));var util=require(_0x0570('0x1'));var moment=require(_0x0570('0x2'));var BPromise=require(_0x0570('0x3'));var rs=require(_0x0570('0x4'));var fs=require('fs');var Redis=require(_0x0570('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0570('0x6'));var logger=require(_0x0570('0x7'))(_0x0570('0x8'));var config=require(_0x0570('0x9'));var jayson=require(_0x0570('0xa'));var client=jayson[_0x0570('0xb')][_0x0570('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e1d84,_0x2b17d3,_0x128a54){return new BPromise(function(_0x20b02c,_0x29e7e8){return client[_0x0570('0xd')](_0x3e1d84,_0x128a54)[_0x0570('0xe')](function(_0x27e378){logger[_0x0570('0xf')](_0x0570('0x10'),_0x2b17d3,'request\x20sent');logger[_0x0570('0x11')](_0x0570('0x12'),_0x2b17d3,_0x0570('0x13'),JSON[_0x0570('0x14')](_0x27e378));if(_0x27e378[_0x0570('0x15')]){if(_0x27e378['error'][_0x0570('0x16')]===0x1f4){logger[_0x0570('0x15')](_0x0570('0x10'),_0x2b17d3,_0x27e378['error'][_0x0570('0x17')]);return _0x29e7e8(_0x27e378['error']['message']);}logger[_0x0570('0x15')](_0x0570('0x10'),_0x2b17d3,_0x27e378[_0x0570('0x15')][_0x0570('0x17')]);return _0x20b02c(_0x27e378[_0x0570('0x15')][_0x0570('0x17')]);}else{logger[_0x0570('0xf')](_0x0570('0x10'),_0x2b17d3,_0x0570('0x13'));_0x20b02c(_0x27e378['result'][_0x0570('0x17')]);}})['catch'](function(_0x35ee9b){logger['error'](_0x0570('0x10'),_0x2b17d3,_0x35ee9b);_0x29e7e8(_0x35ee9b);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 22266e1..a342b98 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 _0x0e1f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','create','put','update','destroy','multer','util','path','connect-timeout','Router'];(function(_0x1433e3,_0x10e219){var _0x25c08b=function(_0x528e40){while(--_0x528e40){_0x1433e3['push'](_0x1433e3['shift']());}};_0x25c08b(++_0x10e219);}(_0x0e1f,0xc1));var _0xf0e1=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0e1f[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xf0e1('0x0'));var util=require(_0xf0e1('0x1'));var path=require(_0xf0e1('0x2'));var timeout=require(_0xf0e1('0x3'));var express=require('express');var router=express[_0xf0e1('0x4')]();var fs_extra=require(_0xf0e1('0x5'));var auth=require(_0xf0e1('0x6'));var interaction=require(_0xf0e1('0x7'));var config=require(_0xf0e1('0x8'));var controller=require(_0xf0e1('0x9'));router[_0xf0e1('0xa')]('/',auth[_0xf0e1('0xb')](),controller['index']);router[_0xf0e1('0xa')](_0xf0e1('0xc'),auth['isAuthenticated'](),controller[_0xf0e1('0xd')]);router[_0xf0e1('0xa')]('/:id/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0xf0e1('0xe')]);router[_0xf0e1('0xf')]('/:id',auth[_0xf0e1('0xb')](),controller[_0xf0e1('0x10')]);router['delete'](_0xf0e1('0xc'),auth[_0xf0e1('0xb')](),controller[_0xf0e1('0x11')]);module['exports']=router; \ No newline at end of file +var _0xcca8=['show','/:id/download','download','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','index'];(function(_0x138697,_0x2cf1f4){var _0x24b07a=function(_0x3ff19b){while(--_0x3ff19b){_0x138697['push'](_0x138697['shift']());}};_0x24b07a(++_0x2cf1f4);}(_0xcca8,0x197));var _0x8cca=function(_0x1c4b31,_0x33f926){_0x1c4b31=_0x1c4b31-0x0;var _0x429be1=_0xcca8[_0x1c4b31];return _0x429be1;};'use strict';var multer=require(_0x8cca('0x0'));var util=require(_0x8cca('0x1'));var path=require('path');var timeout=require(_0x8cca('0x2'));var express=require(_0x8cca('0x3'));var router=express[_0x8cca('0x4')]();var fs_extra=require(_0x8cca('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8cca('0x6'));var config=require('../../config/environment');var controller=require(_0x8cca('0x7'));router[_0x8cca('0x8')]('/',auth[_0x8cca('0x9')](),controller[_0x8cca('0xa')]);router[_0x8cca('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x8cca('0xb')]);router[_0x8cca('0x8')](_0x8cca('0xc'),auth[_0x8cca('0x9')](),controller[_0x8cca('0xd')]);router[_0x8cca('0xe')]('/',auth[_0x8cca('0x9')](),controller[_0x8cca('0xf')]);router[_0x8cca('0x10')](_0x8cca('0x11'),auth[_0x8cca('0x9')](),controller[_0x8cca('0x12')]);router[_0x8cca('0x13')](_0x8cca('0x11'),auth[_0x8cca('0x9')](),controller[_0x8cca('0x14')]);module[_0x8cca('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 4c9701f..8daf7b4 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 _0xc53f=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','STRING','long'];(function(_0x4eef56,_0x3ad39b){var _0x349d4a=function(_0x4f264e){while(--_0x4f264e){_0x4eef56['push'](_0x4eef56['shift']());}};_0x349d4a(++_0x3ad39b);}(_0xc53f,0x13a));var _0xfc53=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xc53f[_0x1c546c];return _0x2cc384;};'use strict';var Sequelize=require(_0xfc53('0x0'));module[_0xfc53('0x1')]={'name':{'type':Sequelize[_0xfc53('0x2')],'get':function(_0x357aea){return this[_0xfc53('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xfc53('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xfc53('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xfc53('0x4')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xfc53('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xfc53('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xfc53('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xfc53('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xfc53('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xfc53('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xfc53('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xfc53('0x6')](_0xfc53('0x7'))}}; \ No newline at end of file +var _0x042b=['sequelize','exports','VIRTUAL','getDataValue','STRING','BLOB','long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x1c319e,_0xfa1167){var _0x381d3a=function(_0x41011f){while(--_0x41011f){_0x1c319e['push'](_0x1c319e['shift']());}};_0x381d3a(++_0xfa1167);}(_0x042b,0x6c));var _0xb042=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x042b[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xb042('0x0'));module[_0xb042('0x1')]={'name':{'type':Sequelize[_0xb042('0x2')],'get':function(_0x2656ca){return this[_0xb042('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xb042('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xb042('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xb042('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xb042('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xb042('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xb042('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xb042('0x5')](_0xb042('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xb042('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb042('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xb042('0x7')](_0xb042('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 007cb2b..7930ca0 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 _0x854a=['squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','key','model','differenceBy','query','attributes','intersection','fields','nolimit','order','sort','where','filters','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','keys','length','options','create','body','find','destroy','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra'];(function(_0x31f527,_0x461a15){var _0x55f7ef=function(_0xdd88e2){while(--_0xdd88e2){_0x31f527['push'](_0x31f527['shift']());}};_0x55f7ef(++_0x461a15);}(_0x854a,0x1e2));var _0xa854=function(_0x12a118,_0x4ea938){_0x12a118=_0x12a118-0x0;var _0x4146cb=_0x854a[_0x12a118];return _0x4146cb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa854('0x0'));var zipdir=require(_0xa854('0x1'));var jsonpatch=require(_0xa854('0x2'));var rp=require(_0xa854('0x3'));var moment=require('moment');var BPromise=require(_0xa854('0x4'));var Mustache=require('mustache');var util=require(_0xa854('0x5'));var path=require(_0xa854('0x6'));var sox=require(_0xa854('0x7'));var csv=require(_0xa854('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa854('0x9'));var _=require('lodash');var squel=require(_0xa854('0xa'));var crypto=require('crypto');var jsforce=require(_0xa854('0xb'));var deskjs=require(_0xa854('0xc'));var toCsv=require(_0xa854('0x8'));var querystring=require(_0xa854('0xd'));var Papa=require(_0xa854('0xe'));var Redis=require('ioredis');var authService=require(_0xa854('0xf'));var qs=require(_0xa854('0x10'));var as=require(_0xa854('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa854('0x12'))(_0xa854('0x13'));var utils=require(_0xa854('0x14'));var config=require(_0xa854('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe57ba5,_0x5d5507){_0x5d5507=_0x5d5507||0xcc;return function(_0x11edeb){if(_0x11edeb){return _0xe57ba5[_0xa854('0x16')](_0x5d5507);}return _0xe57ba5[_0xa854('0x17')](_0x5d5507)[_0xa854('0x18')]();};}function respondWithResult(_0x504823,_0x5357cf){_0x5357cf=_0x5357cf||0xc8;return function(_0x107840){if(_0x107840){return _0x504823[_0xa854('0x17')](_0x5357cf)[_0xa854('0x19')](_0x107840);}};}function respondWithFilteredResult(_0x1bda54,_0x26372a){return function(_0x3271d3){if(_0x3271d3){var _0x2e2810=typeof _0x26372a[_0xa854('0x1a')]===_0xa854('0x1b')&&typeof _0x26372a[_0xa854('0x1c')]===_0xa854('0x1b');var _0x5cea9f=_0x3271d3[_0xa854('0x1d')];var _0x2bc7a3=_0x2e2810?0x0:_0x26372a[_0xa854('0x1a')];var _0x53fcc9=_0x2e2810?_0x3271d3[_0xa854('0x1d')]:_0x26372a['offset']+_0x26372a[_0xa854('0x1c')];var _0x159eb1;if(_0x53fcc9>=_0x5cea9f){_0x53fcc9=_0x5cea9f;_0x159eb1=0xc8;}else{_0x159eb1=0xce;}_0x1bda54[_0xa854('0x17')](_0x159eb1);return _0x1bda54[_0xa854('0x1e')]('Content-Range',_0x2bc7a3+'-'+_0x53fcc9+'/'+_0x5cea9f)['json'](_0x3271d3);}return null;};}function patchUpdates(_0x38ac16){return function(_0x28049d){try{jsonpatch[_0xa854('0x1f')](_0x28049d,_0x38ac16,!![]);}catch(_0x5a3bde){return BPromise[_0xa854('0x20')](_0x5a3bde);}return _0x28049d[_0xa854('0x21')]();};}function saveUpdates(_0x3ed593,_0x362edc){return function(_0x2ecd3e){if(_0x2ecd3e){return _0x2ecd3e[_0xa854('0x22')](_0x3ed593)['then'](function(_0x4178ff){return _0x4178ff;});}return null;};}function removeEntity(_0x269d26,_0xb4855){return function(_0x1a5de4){if(_0x1a5de4){return _0x1a5de4['destroy']()[_0xa854('0x23')](function(){_0x269d26[_0xa854('0x17')](0xcc)[_0xa854('0x18')]();});}};}function handleEntityNotFound(_0x275ae0,_0xdc22ab){return function(_0xa65480){if(!_0xa65480){_0x275ae0['sendStatus'](0x194);}return _0xa65480;};}function handleError(_0x56693d,_0x3a7452){_0x3a7452=_0x3a7452||0x1f4;return function(_0x258447){logger['error'](_0x258447[_0xa854('0x24')]);if(_0x258447[_0xa854('0x25')]){delete _0x258447['name'];}_0x56693d['status'](_0x3a7452)[_0xa854('0x26')](_0x258447);};}exports[_0xa854('0x27')]=function(_0x5d04d3,_0x42ccd5){var _0x25285d={},_0x22a68f={},_0x22c7de={'count':0x0,'rows':[]};var _0xb27333=_[_0xa854('0x28')](db[_0xa854('0x29')][_0xa854('0x2a')],function(_0x3010cf){return{'name':_0x3010cf[_0xa854('0x2b')],'type':_0x3010cf['type'][_0xa854('0x2c')]};});_0x22a68f[_0xa854('0x2d')]=_[_0xa854('0x2e')](_[_0xa854('0x28')](_0xb27333,_0xa854('0x25')),[_0xa854('0x25')]);_0x22a68f[_0xa854('0x2f')]=_['keys'](_0x5d04d3[_0xa854('0x2f')]);_0x22a68f['filters']=_['intersection'](_0x22a68f[_0xa854('0x2d')],_0x22a68f[_0xa854('0x2f')]);_0x25285d[_0xa854('0x30')]=_[_0xa854('0x31')](_0x22a68f['model'],qs[_0xa854('0x32')](_0x5d04d3[_0xa854('0x2f')][_0xa854('0x32')]));_0x25285d[_0xa854('0x30')]=_0x25285d[_0xa854('0x30')]['length']?_0x25285d[_0xa854('0x30')]:_0x22a68f['model'];if(!_0x5d04d3[_0xa854('0x2f')]['hasOwnProperty'](_0xa854('0x33'))){_0x25285d[_0xa854('0x1c')]=qs[_0xa854('0x1c')](_0x5d04d3[_0xa854('0x2f')][_0xa854('0x1c')]);_0x25285d[_0xa854('0x1a')]=qs[_0xa854('0x1a')](_0x5d04d3[_0xa854('0x2f')][_0xa854('0x1a')]);}_0x25285d[_0xa854('0x34')]=qs[_0xa854('0x35')](_0x5d04d3['query'][_0xa854('0x35')]);_0x25285d[_0xa854('0x36')]=qs[_0xa854('0x37')](_['pick'](_0x5d04d3[_0xa854('0x2f')],_0x22a68f[_0xa854('0x37')]),_0xb27333);if(_0x5d04d3[_0xa854('0x2f')]['filter']){_0x25285d[_0xa854('0x36')]=_[_0xa854('0x38')](_0x25285d[_0xa854('0x36')],{'$or':_['map'](_0xb27333,function(_0xde371e){if(_0xde371e[_0xa854('0x39')]!==_0xa854('0x3a')){var _0x2a7944={};_0x2a7944[_0xde371e[_0xa854('0x25')]]={'$like':'%'+_0x5d04d3['query'][_0xa854('0x3b')]+'%'};return _0x2a7944;}})});}_0x25285d=_[_0xa854('0x38')]({},_0x25285d,_0x5d04d3['options']);var _0x4a334e={'where':_0x25285d[_0xa854('0x36')]};return db[_0xa854('0x29')][_0xa854('0x1d')](_0x4a334e)[_0xa854('0x23')](function(_0x318cee){_0x22c7de[_0xa854('0x1d')]=_0x318cee;if(_0x5d04d3[_0xa854('0x2f')][_0xa854('0x3c')]){_0x25285d[_0xa854('0x3d')]=[{'all':!![]}];}return db[_0xa854('0x29')][_0xa854('0x3e')](_0x25285d);})['then'](function(_0x42da87){_0x22c7de[_0xa854('0x3f')]=_0x42da87;return _0x22c7de;})['then'](respondWithFilteredResult(_0x42ccd5,_0x25285d))[_0xa854('0x40')](handleError(_0x42ccd5,null));};exports[_0xa854('0x41')]=function(_0x5f14bd,_0x22b94e){var _0x4f3412={'raw':!![],'where':{'id':_0x5f14bd[_0xa854('0x42')]['id']}},_0x3c442e={};_0x3c442e[_0xa854('0x2d')]=_['keys'](db[_0xa854('0x29')][_0xa854('0x2a')]);_0x3c442e[_0xa854('0x2f')]=_[_0xa854('0x43')](_0x5f14bd[_0xa854('0x2f')]);_0x3c442e['filters']=_[_0xa854('0x31')](_0x3c442e[_0xa854('0x2d')],_0x3c442e[_0xa854('0x2f')]);_0x4f3412[_0xa854('0x30')]=_['intersection'](_0x3c442e[_0xa854('0x2d')],qs['fields'](_0x5f14bd[_0xa854('0x2f')][_0xa854('0x32')]));_0x4f3412['attributes']=_0x4f3412[_0xa854('0x30')][_0xa854('0x44')]?_0x4f3412[_0xa854('0x30')]:_0x3c442e[_0xa854('0x2d')];if(_0x5f14bd['query'][_0xa854('0x3c')]){_0x4f3412['include']=[{'all':!![]}];}_0x4f3412=_[_0xa854('0x38')]({},_0x4f3412,_0x5f14bd[_0xa854('0x45')]);return db['VoiceMailMessage']['find'](_0x4f3412)[_0xa854('0x23')](handleEntityNotFound(_0x22b94e,null))[_0xa854('0x23')](respondWithResult(_0x22b94e,null))[_0xa854('0x40')](handleError(_0x22b94e,null));};exports[_0xa854('0x46')]=function(_0x270aae,_0x5af6af){return db[_0xa854('0x29')][_0xa854('0x46')](_0x270aae[_0xa854('0x47')],{})['then'](respondWithResult(_0x5af6af,0xc9))[_0xa854('0x40')](handleError(_0x5af6af,null));};exports[_0xa854('0x22')]=function(_0x293b55,_0x20ede3){if(_0x293b55[_0xa854('0x47')]['id']){delete _0x293b55[_0xa854('0x47')]['id'];}return db[_0xa854('0x29')][_0xa854('0x48')]({'where':{'id':_0x293b55[_0xa854('0x42')]['id']}})['then'](handleEntityNotFound(_0x20ede3,null))[_0xa854('0x23')](saveUpdates(_0x293b55[_0xa854('0x47')],null))['then'](respondWithResult(_0x20ede3,null))[_0xa854('0x40')](handleError(_0x20ede3,null));};exports[_0xa854('0x49')]=function(_0x442811,_0x242964){return db[_0xa854('0x29')][_0xa854('0x48')]({'where':{'id':_0x442811[_0xa854('0x42')]['id']}})[_0xa854('0x23')](handleEntityNotFound(_0x242964,null))[_0xa854('0x23')](removeEntity(_0x242964,null))[_0xa854('0x40')](handleError(_0x242964,null));};exports[_0xa854('0x4a')]=function(_0x40f95b,_0x3fea11,_0x53e32a){return db[_0xa854('0x29')][_0xa854('0x48')]({'where':{'id':_0x40f95b[_0xa854('0x42')]['id']},'attributes':['id',_0xa854('0x4b'),_0xa854('0x4c')]})[_0xa854('0x23')](handleEntityNotFound(_0x3fea11,null))[_0xa854('0x23')](function(_0x46951d){if(_0x46951d){if(!_0x46951d[_0xa854('0x4b')]){throw new db['Sequelize'][(_0xa854('0x4d'))](_0xa854('0x4e'));}var _0x3074f2={'Content-Type':_0xa854('0x4f'),'Content-Disposition':'attachment'};if(_0x46951d[_0xa854('0x4c')]){_0x3074f2[_0xa854('0x50')]=_0xa854('0x51')+_0x46951d[_0xa854('0x4c')]+'.wav\x22';}_0x3fea11[_0xa854('0x1e')](_0x3074f2);return _0x3fea11[_0xa854('0x26')](new Buffer(_0x46951d[_0xa854('0x4b')]));}})[_0xa854('0x40')](handleError(_0x3fea11,null));}; \ No newline at end of file +var _0x277a=['mustache','util','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','status','error','name','send','map','VoiceMailMessage','rawAttributes','fieldName','type','model','differenceBy','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','findAll','rows','catch','params','find','create','body','download','recording','Sequelize','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x32f4c8,_0x29b891){var _0x4e551a=function(_0x583455){while(--_0x583455){_0x32f4c8['push'](_0x32f4c8['shift']());}};_0x4e551a(++_0x29b891);}(_0x277a,0x18a));var _0xa277=function(_0x4a9c61,_0x2cce4e){_0x4a9c61=_0x4a9c61-0x0;var _0x43d663=_0x277a[_0x4a9c61];return _0x43d663;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa277('0x0'));var zipdir=require(_0xa277('0x1'));var jsonpatch=require(_0xa277('0x2'));var rp=require(_0xa277('0x3'));var moment=require(_0xa277('0x4'));var BPromise=require(_0xa277('0x5'));var Mustache=require(_0xa277('0x6'));var util=require(_0xa277('0x7'));var path=require('path');var sox=require(_0xa277('0x8'));var csv=require(_0xa277('0x9'));var ejs=require(_0xa277('0xa'));var fs=require('fs');var fs_extra=require(_0xa277('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa277('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa277('0x9'));var querystring=require(_0xa277('0xd'));var Papa=require(_0xa277('0xe'));var Redis=require(_0xa277('0xf'));var authService=require(_0xa277('0x10'));var qs=require(_0xa277('0x11'));var as=require(_0xa277('0x12'));var hardwareService=require(_0xa277('0x13'));var logger=require('../../config/logger')(_0xa277('0x14'));var utils=require(_0xa277('0x15'));var config=require(_0xa277('0x16'));var licenseUtil=require(_0xa277('0x17'));var db=require(_0xa277('0x18'))['db'];function respondWithStatusCode(_0x547f12,_0x2457cd){_0x2457cd=_0x2457cd||0xcc;return function(_0x48c6d2){if(_0x48c6d2){return _0x547f12[_0xa277('0x19')](_0x2457cd);}return _0x547f12['status'](_0x2457cd)[_0xa277('0x1a')]();};}function respondWithResult(_0x140f23,_0x164ee1){_0x164ee1=_0x164ee1||0xc8;return function(_0x4ac510){if(_0x4ac510){return _0x140f23['status'](_0x164ee1)[_0xa277('0x1b')](_0x4ac510);}};}function respondWithFilteredResult(_0x4c03e2,_0x3964de){return function(_0x306fce){if(_0x306fce){var _0x5ed46a=typeof _0x3964de[_0xa277('0x1c')]==='undefined'&&typeof _0x3964de[_0xa277('0x1d')]==='undefined';var _0x2e8c1e=_0x306fce[_0xa277('0x1e')];var _0x57adef=_0x5ed46a?0x0:_0x3964de[_0xa277('0x1c')];var _0x4376e2=_0x5ed46a?_0x306fce[_0xa277('0x1e')]:_0x3964de['offset']+_0x3964de[_0xa277('0x1d')];var _0xa4c39;if(_0x4376e2>=_0x2e8c1e){_0x4376e2=_0x2e8c1e;_0xa4c39=0xc8;}else{_0xa4c39=0xce;}_0x4c03e2['status'](_0xa4c39);return _0x4c03e2[_0xa277('0x1f')](_0xa277('0x20'),_0x57adef+'-'+_0x4376e2+'/'+_0x2e8c1e)[_0xa277('0x1b')](_0x306fce);}return null;};}function patchUpdates(_0xb1fb7b){return function(_0x5599c1){try{jsonpatch[_0xa277('0x21')](_0x5599c1,_0xb1fb7b,!![]);}catch(_0x114461){return BPromise[_0xa277('0x22')](_0x114461);}return _0x5599c1[_0xa277('0x23')]();};}function saveUpdates(_0x1625a1,_0x192be7){return function(_0x222118){if(_0x222118){return _0x222118[_0xa277('0x24')](_0x1625a1)[_0xa277('0x25')](function(_0x2a6a9f){return _0x2a6a9f;});}return null;};}function removeEntity(_0x2e0332,_0x54ebc4){return function(_0x3bbd34){if(_0x3bbd34){return _0x3bbd34[_0xa277('0x26')]()['then'](function(){_0x2e0332[_0xa277('0x27')](0xcc)[_0xa277('0x1a')]();});}};}function handleEntityNotFound(_0x1dbfb2,_0x3102ed){return function(_0x2c35c4){if(!_0x2c35c4){_0x1dbfb2['sendStatus'](0x194);}return _0x2c35c4;};}function handleError(_0x48eb0f,_0x40dae4){_0x40dae4=_0x40dae4||0x1f4;return function(_0x325205){logger[_0xa277('0x28')](_0x325205['stack']);if(_0x325205[_0xa277('0x29')]){delete _0x325205['name'];}_0x48eb0f[_0xa277('0x27')](_0x40dae4)[_0xa277('0x2a')](_0x325205);};}exports['index']=function(_0x55accf,_0x1fc964){var _0x1521a0={},_0x4d07f4={},_0x19059c={'count':0x0,'rows':[]};var _0x475fea=_[_0xa277('0x2b')](db[_0xa277('0x2c')][_0xa277('0x2d')],function(_0x2c3177){return{'name':_0x2c3177[_0xa277('0x2e')],'type':_0x2c3177[_0xa277('0x2f')]['key']};});_0x4d07f4[_0xa277('0x30')]=_[_0xa277('0x31')](_['map'](_0x475fea,'name'),[_0xa277('0x29')]);_0x4d07f4['query']=_[_0xa277('0x32')](_0x55accf['query']);_0x4d07f4[_0xa277('0x33')]=_['intersection'](_0x4d07f4[_0xa277('0x30')],_0x4d07f4[_0xa277('0x34')]);_0x1521a0[_0xa277('0x35')]=_[_0xa277('0x36')](_0x4d07f4[_0xa277('0x30')],qs[_0xa277('0x37')](_0x55accf['query'][_0xa277('0x37')]));_0x1521a0['attributes']=_0x1521a0[_0xa277('0x35')][_0xa277('0x38')]?_0x1521a0[_0xa277('0x35')]:_0x4d07f4['model'];if(!_0x55accf['query'][_0xa277('0x39')](_0xa277('0x3a'))){_0x1521a0['limit']=qs[_0xa277('0x1d')](_0x55accf['query'][_0xa277('0x1d')]);_0x1521a0['offset']=qs[_0xa277('0x1c')](_0x55accf[_0xa277('0x34')][_0xa277('0x1c')]);}_0x1521a0[_0xa277('0x3b')]=qs['sort'](_0x55accf[_0xa277('0x34')][_0xa277('0x3c')]);_0x1521a0[_0xa277('0x3d')]=qs[_0xa277('0x33')](_[_0xa277('0x3e')](_0x55accf[_0xa277('0x34')],_0x4d07f4[_0xa277('0x33')]),_0x475fea);if(_0x55accf[_0xa277('0x34')][_0xa277('0x3f')]){_0x1521a0[_0xa277('0x3d')]=_['merge'](_0x1521a0[_0xa277('0x3d')],{'$or':_[_0xa277('0x2b')](_0x475fea,function(_0x56fbb7){if(_0x56fbb7['type']!=='VIRTUAL'){var _0x211aca={};_0x211aca[_0x56fbb7[_0xa277('0x29')]]={'$like':'%'+_0x55accf[_0xa277('0x34')]['filter']+'%'};return _0x211aca;}})});}_0x1521a0=_['merge']({},_0x1521a0,_0x55accf[_0xa277('0x40')]);var _0x14f044={'where':_0x1521a0[_0xa277('0x3d')]};return db[_0xa277('0x2c')][_0xa277('0x1e')](_0x14f044)[_0xa277('0x25')](function(_0xeeacd1){_0x19059c[_0xa277('0x1e')]=_0xeeacd1;if(_0x55accf[_0xa277('0x34')]['includeAll']){_0x1521a0['include']=[{'all':!![]}];}return db['VoiceMailMessage'][_0xa277('0x41')](_0x1521a0);})['then'](function(_0x3cb014){_0x19059c[_0xa277('0x42')]=_0x3cb014;return _0x19059c;})['then'](respondWithFilteredResult(_0x1fc964,_0x1521a0))[_0xa277('0x43')](handleError(_0x1fc964,null));};exports['show']=function(_0x2fe4aa,_0x3403bf){var _0x502fac={'raw':!![],'where':{'id':_0x2fe4aa[_0xa277('0x44')]['id']}},_0x2d694f={};_0x2d694f[_0xa277('0x30')]=_[_0xa277('0x32')](db[_0xa277('0x2c')]['rawAttributes']);_0x2d694f['query']=_['keys'](_0x2fe4aa[_0xa277('0x34')]);_0x2d694f[_0xa277('0x33')]=_[_0xa277('0x36')](_0x2d694f['model'],_0x2d694f[_0xa277('0x34')]);_0x502fac[_0xa277('0x35')]=_[_0xa277('0x36')](_0x2d694f[_0xa277('0x30')],qs['fields'](_0x2fe4aa[_0xa277('0x34')][_0xa277('0x37')]));_0x502fac['attributes']=_0x502fac[_0xa277('0x35')][_0xa277('0x38')]?_0x502fac['attributes']:_0x2d694f[_0xa277('0x30')];if(_0x2fe4aa[_0xa277('0x34')]['includeAll']){_0x502fac['include']=[{'all':!![]}];}_0x502fac=_['merge']({},_0x502fac,_0x2fe4aa['options']);return db[_0xa277('0x2c')][_0xa277('0x45')](_0x502fac)[_0xa277('0x25')](handleEntityNotFound(_0x3403bf,null))[_0xa277('0x25')](respondWithResult(_0x3403bf,null))[_0xa277('0x43')](handleError(_0x3403bf,null));};exports[_0xa277('0x46')]=function(_0x502e94,_0xb6be7f){return db[_0xa277('0x2c')][_0xa277('0x46')](_0x502e94[_0xa277('0x47')],{})[_0xa277('0x25')](respondWithResult(_0xb6be7f,0xc9))[_0xa277('0x43')](handleError(_0xb6be7f,null));};exports[_0xa277('0x24')]=function(_0x6f92f0,_0x11e37b){if(_0x6f92f0[_0xa277('0x47')]['id']){delete _0x6f92f0[_0xa277('0x47')]['id'];}return db[_0xa277('0x2c')][_0xa277('0x45')]({'where':{'id':_0x6f92f0[_0xa277('0x44')]['id']}})['then'](handleEntityNotFound(_0x11e37b,null))[_0xa277('0x25')](saveUpdates(_0x6f92f0[_0xa277('0x47')],null))[_0xa277('0x25')](respondWithResult(_0x11e37b,null))['catch'](handleError(_0x11e37b,null));};exports[_0xa277('0x26')]=function(_0x5e2a83,_0x59c583){return db[_0xa277('0x2c')][_0xa277('0x45')]({'where':{'id':_0x5e2a83['params']['id']}})['then'](handleEntityNotFound(_0x59c583,null))[_0xa277('0x25')](removeEntity(_0x59c583,null))[_0xa277('0x43')](handleError(_0x59c583,null));};exports[_0xa277('0x48')]=function(_0x4016de,_0x5d02db,_0x1bba07){return db['VoiceMailMessage'][_0xa277('0x45')]({'where':{'id':_0x4016de[_0xa277('0x44')]['id']},'attributes':['id',_0xa277('0x49'),'msg_id']})[_0xa277('0x25')](handleEntityNotFound(_0x5d02db,null))[_0xa277('0x25')](function(_0x2f8c67){if(_0x2f8c67){if(!_0x2f8c67[_0xa277('0x49')]){throw new db[(_0xa277('0x4a'))]['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x1db231={'Content-Type':'audio/wav','Content-Disposition':_0xa277('0x4b')};if(_0x2f8c67[_0xa277('0x4c')]){_0x1db231[_0xa277('0x4d')]=_0xa277('0x4e')+_0x2f8c67[_0xa277('0x4c')]+_0xa277('0x4f');}_0x5d02db[_0xa277('0x1f')](_0x1db231);return _0x5d02db[_0xa277('0x2a')](new Buffer(_0x2f8c67[_0xa277('0x49')]));}})[_0xa277('0x43')](handleError(_0x5d02db,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 99a981d..39681bf 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 _0x37a9=['path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x58bf5f,_0x248d2b){var _0x266f41=function(_0x4a8f3d){while(--_0x4a8f3d){_0x58bf5f['push'](_0x58bf5f['shift']());}};_0x266f41(++_0x248d2b);}(_0x37a9,0xf2));var _0x937a=function(_0x4a2e5d,_0x3cbf2e){_0x4a2e5d=_0x4a2e5d-0x0;var _0x46f06a=_0x37a9[_0x4a2e5d];return _0x46f06a;};'use strict';var _=require('lodash');var util=require(_0x937a('0x0'));var logger=require(_0x937a('0x1'))('api');var moment=require(_0x937a('0x2'));var BPromise=require(_0x937a('0x3'));var rp=require(_0x937a('0x4'));var fs=require('fs');var path=require(_0x937a('0x5'));var rimraf=require(_0x937a('0x6'));var config=require(_0x937a('0x7'));var attributes=require(_0x937a('0x8'));module[_0x937a('0x9')]=function(_0x215695,_0x1227fa){return _0x215695['define'](_0x937a('0xa'),attributes,{'tableName':_0x937a('0xb'),'paranoid':![],'indexes':[{'name':_0x937a('0xc'),'fields':[_0x937a('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x3a88=['request-promise','path','../../config/environment','exports','define','voice_voicemail_messages','dir','lodash','../../config/logger','moment','bluebird'];(function(_0x39f670,_0x1767b3){var _0x5b574d=function(_0x5ed586){while(--_0x5ed586){_0x39f670['push'](_0x39f670['shift']());}};_0x5b574d(++_0x1767b3);}(_0x3a88,0x13b));var _0x83a8=function(_0x9e0cb3,_0x9cd497){_0x9e0cb3=_0x9e0cb3-0x0;var _0x5926b7=_0x3a88[_0x9e0cb3];return _0x5926b7;};'use strict';var _=require(_0x83a8('0x0'));var util=require('util');var logger=require(_0x83a8('0x1'))('api');var moment=require(_0x83a8('0x2'));var BPromise=require(_0x83a8('0x3'));var rp=require(_0x83a8('0x4'));var fs=require('fs');var path=require(_0x83a8('0x5'));var rimraf=require('rimraf');var config=require(_0x83a8('0x6'));var attributes=require('./voiceMailMessage.attributes');module[_0x83a8('0x7')]=function(_0x32352a,_0x399158){return _0x32352a[_0x83a8('0x8')]('VoiceMailMessage',attributes,{'tableName':_0x83a8('0x9'),'paranoid':![],'indexes':[{'name':_0x83a8('0xa'),'fields':[_0x83a8('0xa')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 3e28e82..c85cb71 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 _0x150e=['request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','info','VoiceMailMessage,\x20%s,\x20%s'];(function(_0x46f414,_0x304cf6){var _0x153c05=function(_0x226250){while(--_0x226250){_0x46f414['push'](_0x46f414['shift']());}};_0x153c05(++_0x304cf6);}(_0x150e,0xc4));var _0xe150=function(_0xa651d4,_0x5df6cb){_0xa651d4=_0xa651d4-0x0;var _0x1301be=_0x150e[_0xa651d4];return _0x1301be;};'use strict';var _=require(_0xe150('0x0'));var util=require(_0xe150('0x1'));var moment=require(_0xe150('0x2'));var BPromise=require(_0xe150('0x3'));var rs=require(_0xe150('0x4'));var fs=require('fs');var Redis=require(_0xe150('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe150('0x6'))(_0xe150('0x7'));var config=require('../../config/environment');var jayson=require(_0xe150('0x8'));var client=jayson[_0xe150('0x9')][_0xe150('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50ccdc,_0x426ce5,_0x5cde99){return new BPromise(function(_0x277259,_0x42e610){return client['request'](_0x50ccdc,_0x5cde99)['then'](function(_0x54f72d){logger[_0xe150('0xb')](_0xe150('0xc'),_0x426ce5,_0xe150('0xd'));logger['debug'](_0xe150('0xe'),_0x426ce5,_0xe150('0xd'),JSON[_0xe150('0xf')](_0x54f72d));if(_0x54f72d[_0xe150('0x10')]){if(_0x54f72d[_0xe150('0x10')]['code']===0x1f4){logger[_0xe150('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x426ce5,_0x54f72d[_0xe150('0x10')][_0xe150('0x11')]);return _0x42e610(_0x54f72d[_0xe150('0x10')][_0xe150('0x11')]);}logger[_0xe150('0x10')](_0xe150('0xc'),_0x426ce5,_0x54f72d[_0xe150('0x10')][_0xe150('0x11')]);return _0x277259(_0x54f72d['error']['message']);}else{logger[_0xe150('0xb')](_0xe150('0xc'),_0x426ce5,_0xe150('0xd'));_0x277259(_0x54f72d[_0xe150('0x12')][_0xe150('0x11')]);}})['catch'](function(_0x151fea){logger['error'](_0xe150('0xc'),_0x426ce5,_0x151fea);_0x42e610(_0x151fea);});});} \ No newline at end of file +var _0xeeeb=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xeeeb,0x153));var _0xbeee=function(_0x1355ac,_0xc35a81){_0x1355ac=_0x1355ac-0x0;var _0x53e3fa=_0xeeeb[_0x1355ac];return _0x53e3fa;};'use strict';var _=require('lodash');var util=require(_0xbeee('0x0'));var moment=require('moment');var BPromise=require(_0xbeee('0x1'));var rs=require(_0xbeee('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbeee('0x3'));var logger=require(_0xbeee('0x4'))(_0xbeee('0x5'));var config=require('../../config/environment');var jayson=require(_0xbeee('0x6'));var client=jayson[_0xbeee('0x7')][_0xbeee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10d0dc,_0x42e460,_0x2204af){return new BPromise(function(_0x2a1f0b,_0x21b085){return client[_0xbeee('0x9')](_0x10d0dc,_0x2204af)['then'](function(_0x520aa8){logger['info'](_0xbeee('0xa'),_0x42e460,_0xbeee('0xb'));logger[_0xbeee('0xc')](_0xbeee('0xd'),_0x42e460,_0xbeee('0xb'),JSON[_0xbeee('0xe')](_0x520aa8));if(_0x520aa8[_0xbeee('0xf')]){if(_0x520aa8['error'][_0xbeee('0x10')]===0x1f4){logger[_0xbeee('0xf')](_0xbeee('0xa'),_0x42e460,_0x520aa8[_0xbeee('0xf')][_0xbeee('0x11')]);return _0x21b085(_0x520aa8['error'][_0xbeee('0x11')]);}logger[_0xbeee('0xf')](_0xbeee('0xa'),_0x42e460,_0x520aa8['error'][_0xbeee('0x11')]);return _0x2a1f0b(_0x520aa8[_0xbeee('0xf')][_0xbeee('0x11')]);}else{logger[_0xbeee('0x12')](_0xbeee('0xa'),_0x42e460,_0xbeee('0xb'));_0x2a1f0b(_0x520aa8[_0xbeee('0x13')][_0xbeee('0x11')]);}})['catch'](function(_0x117942){logger[_0xbeee('0xf')](_0xbeee('0xa'),_0x42e460,_0x117942);_0x21b085(_0x117942);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 395e87c..d8c4a70 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 _0xf7a9=['./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','/:id/sounds','create','post','addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xcd3189,_0x472491){var _0x144113=function(_0x21b885){while(--_0x21b885){_0xcd3189['push'](_0xcd3189['shift']());}};_0x144113(++_0x472491);}(_0xf7a9,0x16e));var _0x9f7a=function(_0x43a6bd,_0x57e1bf){_0x43a6bd=_0x43a6bd-0x0;var _0x16e745=_0xf7a9[_0x43a6bd];return _0x16e745;};'use strict';var multer=require(_0x9f7a('0x0'));var util=require(_0x9f7a('0x1'));var path=require('path');var timeout=require(_0x9f7a('0x2'));var express=require(_0x9f7a('0x3'));var router=express[_0x9f7a('0x4')]();var fs_extra=require(_0x9f7a('0x5'));var auth=require(_0x9f7a('0x6'));var interaction=require(_0x9f7a('0x7'));var config=require(_0x9f7a('0x8'));var controller=require(_0x9f7a('0x9'));router[_0x9f7a('0xa')]('/',auth[_0x9f7a('0xb')](),controller['index']);router['get'](_0x9f7a('0xc'),auth[_0x9f7a('0xb')](),controller[_0x9f7a('0xd')]);router[_0x9f7a('0xa')](_0x9f7a('0xe'),auth[_0x9f7a('0xb')](),controller['getSounds']);router['post']('/',auth[_0x9f7a('0xb')](),controller[_0x9f7a('0xf')]);router[_0x9f7a('0x10')](_0x9f7a('0xe'),auth[_0x9f7a('0xb')](),controller[_0x9f7a('0x11')]);router[_0x9f7a('0x12')](_0x9f7a('0xc'),auth[_0x9f7a('0xb')](),controller[_0x9f7a('0x13')]);router[_0x9f7a('0x14')]('/:id',auth[_0x9f7a('0xb')](),controller[_0x9f7a('0x15')]);router[_0x9f7a('0x14')](_0x9f7a('0x16'),auth['isAuthenticated'](),controller[_0x9f7a('0x17')]);module[_0x9f7a('0x18')]=router; \ No newline at end of file +var _0x043a=['delete','destroy','/:id/sounds/:id2','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','index','show','/:id/sounds','isAuthenticated','getSounds','post','create','addSound','put','/:id','update'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x043a,0x17b));var _0xa043=function(_0x4cda86,_0x573385){_0x4cda86=_0x4cda86-0x0;var _0x20cdad=_0x043a[_0x4cda86];return _0x20cdad;};'use strict';var multer=require(_0xa043('0x0'));var util=require(_0xa043('0x1'));var path=require(_0xa043('0x2'));var timeout=require('connect-timeout');var express=require(_0xa043('0x3'));var router=express['Router']();var fs_extra=require(_0xa043('0x4'));var auth=require(_0xa043('0x5'));var interaction=require(_0xa043('0x6'));var config=require(_0xa043('0x7'));var controller=require(_0xa043('0x8'));router[_0xa043('0x9')]('/',auth['isAuthenticated'](),controller[_0xa043('0xa')]);router[_0xa043('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xa043('0xb')]);router['get'](_0xa043('0xc'),auth[_0xa043('0xd')](),controller[_0xa043('0xe')]);router[_0xa043('0xf')]('/',auth['isAuthenticated'](),controller[_0xa043('0x10')]);router[_0xa043('0xf')](_0xa043('0xc'),auth[_0xa043('0xd')](),controller[_0xa043('0x11')]);router[_0xa043('0x12')](_0xa043('0x13'),auth[_0xa043('0xd')](),controller[_0xa043('0x14')]);router[_0xa043('0x15')](_0xa043('0x13'),auth['isAuthenticated'](),controller[_0xa043('0x16')]);router[_0xa043('0x15')](_0xa043('0x17'),auth['isAuthenticated'](),controller['removeSound']);module[_0xa043('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 7efcbd8..c41f8c8 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 _0x10b6=['alpha','TIMESTAMP','BOOLEAN','sequelize','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3'];(function(_0x1a3a7f,_0x53770e){var _0x5dbcc5=function(_0x261964){while(--_0x261964){_0x1a3a7f['push'](_0x1a3a7f['shift']());}};_0x5dbcc5(++_0x53770e);}(_0x10b6,0x10b));var _0x610b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x10b6[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x610b('0x0'));module['exports']={'name':{'type':Sequelize[_0x610b('0x1')],'allowNull':![],'unique':_0x610b('0x2')},'mode':{'type':Sequelize[_0x610b('0x3')](_0x610b('0x4'),_0x610b('0x5'),_0x610b('0x6'),_0x610b('0x7'),_0x610b('0x8'),'mp3'),'allowNull':!![],'defaultValue':_0x610b('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x610b('0x1')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x610b('0x1')],'allowNull':!![],'defaultValue':_0x610b('0x9')},'format':{'type':Sequelize[_0x610b('0x1')],'allowNull':!![]},'stamp':{'type':_0x610b('0xa')},'defaultEntry':{'type':Sequelize[_0x610b('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x07b7=['mp3','alpha','TIMESTAMP','BOOLEAN','exports','STRING','custom','files'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x07b7,0x9c));var _0x707b=function(_0x5700d2,_0x59b5fa){_0x5700d2=_0x5700d2-0x0;var _0x25c1e0=_0x07b7[_0x5700d2];return _0x25c1e0;};'use strict';var Sequelize=require('sequelize');module[_0x707b('0x0')]={'name':{'type':Sequelize[_0x707b('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM'](_0x707b('0x2'),_0x707b('0x3'),'mp3nb','quietmp3nb','quietmp3',_0x707b('0x4')),'allowNull':!![],'defaultValue':_0x707b('0x3')},'directory':{'type':Sequelize[_0x707b('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x707b('0x1')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x707b('0x1')],'allowNull':!![],'defaultValue':_0x707b('0x5')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x707b('0x6')},'defaultEntry':{'type':Sequelize[_0x707b('0x7')],'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 e593f32..1007945 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 _0x47a2=['addSound','Sound','findOne','save_name','createdAt','server/files/sounds/converted','format','%s.%s','converted_format','symlinkSync','message','removeSound','id2','Sequelize','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send','index','map','type','key','model','keys','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMusicOnHold','includeAll','include','rows','catch','show','params','rawAttributes','fields','body','find','sequelize','mode','directory','join','root','server/files/moh','create','files','mkdirSync','0777','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','forEach','rmdirSync','ValidationError'];(function(_0x307086,_0x3bfe4e){var _0x699043=function(_0x1a7677){while(--_0x1a7677){_0x307086['push'](_0x307086['shift']());}};_0x699043(++_0x3bfe4e);}(_0x47a2,0x171));var _0x247a=function(_0x555379,_0x2abd07){_0x555379=_0x555379-0x0;var _0x51a1fd=_0x47a2[_0x555379];return _0x51a1fd;};'use strict';var emlformat=require(_0x247a('0x0'));var rimraf=require(_0x247a('0x1'));var zipdir=require(_0x247a('0x2'));var jsonpatch=require(_0x247a('0x3'));var rp=require(_0x247a('0x4'));var moment=require(_0x247a('0x5'));var BPromise=require(_0x247a('0x6'));var Mustache=require(_0x247a('0x7'));var util=require(_0x247a('0x8'));var path=require(_0x247a('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x247a('0xa'));var fs=require('fs');var fs_extra=require(_0x247a('0xb'));var _=require(_0x247a('0xc'));var squel=require(_0x247a('0xd'));var crypto=require(_0x247a('0xe'));var jsforce=require(_0x247a('0xf'));var deskjs=require(_0x247a('0x10'));var toCsv=require(_0x247a('0x11'));var querystring=require(_0x247a('0x12'));var Papa=require('papaparse');var Redis=require(_0x247a('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x247a('0x14'));var hardwareService=require(_0x247a('0x15'));var logger=require(_0x247a('0x16'))(_0x247a('0x17'));var utils=require('../../config/utils');var config=require(_0x247a('0x18'));var licenseUtil=require(_0x247a('0x19'));var db=require(_0x247a('0x1a'))['db'];function respondWithStatusCode(_0x230d99,_0x3ced94){_0x3ced94=_0x3ced94||0xcc;return function(_0x50ae63){if(_0x50ae63){return _0x230d99[_0x247a('0x1b')](_0x3ced94);}return _0x230d99[_0x247a('0x1c')](_0x3ced94)[_0x247a('0x1d')]();};}function respondWithResult(_0x86f075,_0x35743c){_0x35743c=_0x35743c||0xc8;return function(_0x457cf8){if(_0x457cf8){return _0x86f075[_0x247a('0x1c')](_0x35743c)[_0x247a('0x1e')](_0x457cf8);}};}function respondWithFilteredResult(_0x337108,_0xdb8a8c){return function(_0xb9d426){if(_0xb9d426){var _0x3a38da=typeof _0xdb8a8c[_0x247a('0x1f')]===_0x247a('0x20')&&typeof _0xdb8a8c[_0x247a('0x21')]==='undefined';var _0x3d4017=_0xb9d426[_0x247a('0x22')];var _0x32e8cd=_0x3a38da?0x0:_0xdb8a8c[_0x247a('0x1f')];var _0x4fb800=_0x3a38da?_0xb9d426[_0x247a('0x22')]:_0xdb8a8c['offset']+_0xdb8a8c[_0x247a('0x21')];var _0x52b7b0;if(_0x4fb800>=_0x3d4017){_0x4fb800=_0x3d4017;_0x52b7b0=0xc8;}else{_0x52b7b0=0xce;}_0x337108[_0x247a('0x1c')](_0x52b7b0);return _0x337108[_0x247a('0x23')](_0x247a('0x24'),_0x32e8cd+'-'+_0x4fb800+'/'+_0x3d4017)[_0x247a('0x1e')](_0xb9d426);}return null;};}function patchUpdates(_0x492736){return function(_0x3e16be){try{jsonpatch[_0x247a('0x25')](_0x3e16be,_0x492736,!![]);}catch(_0x3d1fe1){return BPromise[_0x247a('0x26')](_0x3d1fe1);}return _0x3e16be[_0x247a('0x27')]();};}function saveUpdates(_0x45a964,_0x21a3ce){return function(_0x4c7dd6){if(_0x4c7dd6){return _0x4c7dd6[_0x247a('0x28')](_0x45a964)[_0x247a('0x29')](function(_0x3ae991){return _0x3ae991;});}return null;};}function removeEntity(_0xd8b748,_0x58b953){return function(_0x1986e5){if(_0x1986e5){return _0x1986e5[_0x247a('0x2a')]()[_0x247a('0x29')](function(){var _0x340467=_0x1986e5[_0x247a('0x2b')]({'plain':!![]});var _0x18cb98=_0x247a('0x2c');return db[_0x247a('0x2d')][_0x247a('0x2a')]({'where':{'type':_0x18cb98,'resourceId':_0x340467['id']}})['then'](function(){return _0x1986e5;});})[_0x247a('0x29')](function(){_0xd8b748[_0x247a('0x1c')](0xcc)[_0x247a('0x1d')]();});}};}function handleEntityNotFound(_0x4a5dfa,_0x5777d9){return function(_0xc7d73d){if(!_0xc7d73d){_0x4a5dfa['sendStatus'](0x194);}return _0xc7d73d;};}function handleError(_0x2c6b5f,_0x2fa1eb){_0x2fa1eb=_0x2fa1eb||0x1f4;return function(_0x39cd5e){logger[_0x247a('0x2e')](_0x39cd5e[_0x247a('0x2f')]);if(_0x39cd5e['name']){delete _0x39cd5e[_0x247a('0x30')];}_0x2c6b5f['status'](_0x2fa1eb)[_0x247a('0x31')](_0x39cd5e);};}exports[_0x247a('0x32')]=function(_0x1f4c72,_0x478c39){var _0xf05005={},_0x4e3b13={},_0x548b58={'count':0x0,'rows':[]};var _0x311f92=_[_0x247a('0x33')](db['VoiceMusicOnHold']['rawAttributes'],function(_0x2ab757){return{'name':_0x2ab757['fieldName'],'type':_0x2ab757[_0x247a('0x34')][_0x247a('0x35')]};});_0x4e3b13[_0x247a('0x36')]=_['map'](_0x311f92,_0x247a('0x30'));_0x4e3b13['query']=_[_0x247a('0x37')](_0x1f4c72['query']);_0x4e3b13[_0x247a('0x38')]=_[_0x247a('0x39')](_0x4e3b13[_0x247a('0x36')],_0x4e3b13[_0x247a('0x3a')]);_0xf05005[_0x247a('0x3b')]=_[_0x247a('0x39')](_0x4e3b13[_0x247a('0x36')],qs['fields'](_0x1f4c72[_0x247a('0x3a')]['fields']));_0xf05005['attributes']=_0xf05005[_0x247a('0x3b')][_0x247a('0x3c')]?_0xf05005[_0x247a('0x3b')]:_0x4e3b13[_0x247a('0x36')];if(!_0x1f4c72[_0x247a('0x3a')][_0x247a('0x3d')](_0x247a('0x3e'))){_0xf05005[_0x247a('0x21')]=qs[_0x247a('0x21')](_0x1f4c72['query'][_0x247a('0x21')]);_0xf05005[_0x247a('0x1f')]=qs[_0x247a('0x1f')](_0x1f4c72[_0x247a('0x3a')]['offset']);}_0xf05005[_0x247a('0x3f')]=qs[_0x247a('0x40')](_0x1f4c72['query']['sort']);delete _0x1f4c72[_0x247a('0x3a')][_0x247a('0x40')];_0xf05005[_0x247a('0x41')]=qs[_0x247a('0x38')](_[_0x247a('0x42')](_0x1f4c72['query'],_0x4e3b13[_0x247a('0x38')]),_0x311f92);if(_0x1f4c72[_0x247a('0x3a')][_0x247a('0x43')]){_0xf05005[_0x247a('0x41')]=_[_0x247a('0x44')](_0xf05005[_0x247a('0x41')],{'$or':_['map'](_0x311f92,function(_0x587336){if(_0x587336[_0x247a('0x34')]!==_0x247a('0x45')){var _0x21097c={};_0x21097c[_0x587336[_0x247a('0x30')]]={'$like':'%'+_0x1f4c72[_0x247a('0x3a')][_0x247a('0x43')]+'%'};return _0x21097c;}})});}_0xf05005=_[_0x247a('0x44')]({},_0xf05005,_0x1f4c72[_0x247a('0x46')]);var _0x3cf9c5={'where':_0xf05005[_0x247a('0x41')]};return db[_0x247a('0x47')]['count'](_0x3cf9c5)[_0x247a('0x29')](function(_0x31f23f){_0x548b58[_0x247a('0x22')]=_0x31f23f;if(_0x1f4c72[_0x247a('0x3a')][_0x247a('0x48')]){_0xf05005[_0x247a('0x49')]=[{'all':!![]}];}return db[_0x247a('0x47')]['findAll'](_0xf05005);})[_0x247a('0x29')](function(_0x29b690){_0x548b58[_0x247a('0x4a')]=_0x29b690;return _0x548b58;})['then'](respondWithFilteredResult(_0x478c39,_0xf05005))[_0x247a('0x4b')](handleError(_0x478c39,null));};exports[_0x247a('0x4c')]=function(_0x5e7f96,_0x523d34){var _0x4c7e8a={'raw':![],'where':{'id':_0x5e7f96[_0x247a('0x4d')]['id']}},_0x522a6d={};_0x522a6d[_0x247a('0x36')]=_[_0x247a('0x37')](db[_0x247a('0x47')][_0x247a('0x4e')]);_0x522a6d[_0x247a('0x3a')]=_[_0x247a('0x37')](_0x5e7f96['query']);_0x522a6d['filters']=_[_0x247a('0x39')](_0x522a6d['model'],_0x522a6d['query']);_0x4c7e8a['attributes']=_[_0x247a('0x39')](_0x522a6d[_0x247a('0x36')],qs[_0x247a('0x4f')](_0x5e7f96[_0x247a('0x3a')][_0x247a('0x4f')]));_0x4c7e8a['attributes']=_0x4c7e8a['attributes']['length']?_0x4c7e8a[_0x247a('0x3b')]:_0x522a6d[_0x247a('0x36')];if(_0x5e7f96[_0x247a('0x3a')][_0x247a('0x48')]){_0x4c7e8a['include']=[{'all':!![]}];}_0x4c7e8a=_[_0x247a('0x44')]({},_0x4c7e8a,_0x5e7f96[_0x247a('0x46')]);return db[_0x247a('0x47')]['find'](_0x4c7e8a)[_0x247a('0x29')](handleEntityNotFound(_0x523d34,null))[_0x247a('0x29')](respondWithResult(_0x523d34,null))[_0x247a('0x4b')](handleError(_0x523d34,null));};exports['update']=function(_0x3d998c,_0x180ec4){if(_0x3d998c['body']['id']){delete _0x3d998c[_0x247a('0x50')]['id'];}return db[_0x247a('0x47')][_0x247a('0x51')]({'where':{'id':_0x3d998c[_0x247a('0x4d')]['id']}})[_0x247a('0x29')](handleEntityNotFound(_0x180ec4,null))[_0x247a('0x29')](saveUpdates(_0x3d998c[_0x247a('0x50')],null))[_0x247a('0x29')](respondWithResult(_0x180ec4,null))[_0x247a('0x4b')](handleError(_0x180ec4,null));};exports['create']=function(_0x2c7c7d,_0x344d0b,_0x387e8d){return db[_0x247a('0x52')]['transaction'](function(_0x142ce6){if(_0x2c7c7d[_0x247a('0x50')][_0x247a('0x53')]==='files'){_0x2c7c7d[_0x247a('0x50')][_0x247a('0x54')]=path[_0x247a('0x55')](config[_0x247a('0x56')],_0x247a('0x57'),_0x2c7c7d[_0x247a('0x50')][_0x247a('0x30')]);}return db[_0x247a('0x47')][_0x247a('0x58')](_0x2c7c7d[_0x247a('0x50')],{'transaction':_0x142ce6})['then'](function(_0x5cc106){if(_0x2c7c7d['body'][_0x247a('0x53')]===_0x247a('0x59')){fs[_0x247a('0x5a')](_0x5cc106[_0x247a('0x54')],parseInt(_0x247a('0x5b'),0x8));}var _0x517edb=_0x2c7c7d['user']['get']({'plain':!![]});if(!_0x517edb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x517edb[_0x247a('0x5c')]===_0x247a('0x5d')){var _0x345c1f=_0x5cc106['get']({'plain':!![]});return db[_0x247a('0x5e')][_0x247a('0x51')]({'where':{'name':'MusicOnHolds','userProfileId':_0x517edb[_0x247a('0x5f')]},'raw':!![]})[_0x247a('0x29')](function(_0x3f3bea){if(_0x3f3bea&&_0x3f3bea[_0x247a('0x60')]===0x0){return db[_0x247a('0x2d')][_0x247a('0x58')]({'name':_0x345c1f[_0x247a('0x30')],'resourceId':_0x345c1f['id'],'type':_0x3f3bea['name'],'sectionId':_0x3f3bea['id']},{})[_0x247a('0x29')](function(){return _0x5cc106;});}else{return _0x5cc106;}})['catch'](function(_0x4b3edd){logger['error'](_0x247a('0x61'),_0x4b3edd);});}return _0x5cc106;});})['then'](respondWithResult(_0x344d0b,0xc9))[_0x247a('0x4b')](handleError(_0x344d0b,null));};exports[_0x247a('0x2a')]=function(_0x2888dc,_0x45c0d,_0x2038d7){var _0x5dacf7;return db['VoiceMusicOnHold'][_0x247a('0x51')]({'where':{'id':_0x2888dc[_0x247a('0x4d')]['id']}})[_0x247a('0x29')](function(_0x3118a0){if(_0x3118a0){return db[_0x247a('0x52')][_0x247a('0x62')](function(_0x35de18){return _0x3118a0[_0x247a('0x2a')]({'transaction':_0x35de18,'raw':!![]})['then'](function(_0x2bcf30){if(_0x2bcf30['directory']){fs[_0x247a('0x63')](_0x2bcf30[_0x247a('0x54')])[_0x247a('0x64')](function(_0x80feb1){fs['unlinkSync'](path['join'](_0x2bcf30[_0x247a('0x54')],_0x80feb1));});fs[_0x247a('0x65')](_0x2bcf30['directory']);}return _0x2bcf30;});})['catch'](function(_0x25215d){throw new db['Sequelize'][(_0x247a('0x66'))](_0x25215d['message']);});}})[_0x247a('0x29')](handleEntityNotFound(_0x45c0d,null))['then'](removeEntity(_0x45c0d,null))[_0x247a('0x4b')](handleError(_0x45c0d,null));};exports[_0x247a('0x67')]=function(_0x326aa2,_0x28ba2a,_0x2fdaec){return db[_0x247a('0x52')][_0x247a('0x62')](function(_0x294924){var _0x256865;return db['VoiceMusicOnHold'][_0x247a('0x51')]({'where':{'id':_0x326aa2[_0x247a('0x4d')]['id']}})['then'](function(_0x38dc17){if(_0x38dc17){_0x256865=_0x38dc17;return _0x38dc17['addSound'](_0x326aa2[_0x247a('0x50')]['id'],{'transaction':_0x294924});}})[_0x247a('0x29')](function(_0x4c8d8c){if(_0x4c8d8c){return db[_0x247a('0x68')][_0x247a('0x69')]({'where':{'id':_0x326aa2[_0x247a('0x50')]['id']},'attributes':['id',_0x247a('0x30'),_0x247a('0x6a'),'converted_format',_0x247a('0x6b')],'raw':!![]});}})['then'](function(_0x85c35d){if(_0x85c35d){var _0x3eb2ff=path[_0x247a('0x55')](config[_0x247a('0x56')],_0x247a('0x6c'),util[_0x247a('0x6d')](_0x247a('0x6e'),path['basename'](_0x85c35d[_0x247a('0x6a')],path['extname'](_0x85c35d[_0x247a('0x6a')])),_0x85c35d[_0x247a('0x6f')]));var _0x2dd4c6=path[_0x247a('0x55')](config[_0x247a('0x56')],_0x247a('0x57'),_0x256865[_0x247a('0x30')],util[_0x247a('0x6d')](_0x247a('0x6e'),_0x85c35d[_0x247a('0x30')],_0x85c35d[_0x247a('0x6f')]));fs[_0x247a('0x70')](_0x3eb2ff,_0x2dd4c6);return _0x85c35d;}})[_0x247a('0x4b')](function(_0x5b588a){throw new db['Sequelize'][(_0x247a('0x66'))](_0x5b588a[_0x247a('0x71')]);});})[_0x247a('0x29')](handleEntityNotFound(_0x28ba2a,null))[_0x247a('0x29')](respondWithResult(_0x28ba2a,0xc9))[_0x247a('0x4b')](handleError(_0x28ba2a,null));};exports[_0x247a('0x72')]=function(_0x291f7a,_0x1e7b98,_0x362e58){return db[_0x247a('0x52')][_0x247a('0x62')](function(_0x578f55){var _0x548959;return db[_0x247a('0x47')][_0x247a('0x69')]({'where':{'id':_0x291f7a[_0x247a('0x4d')]['id']}})[_0x247a('0x29')](handleEntityNotFound(_0x1e7b98,null))[_0x247a('0x29')](function(_0x11af3b){if(_0x11af3b){_0x548959=_0x11af3b;return _0x11af3b['removeSound'](_0x291f7a[_0x247a('0x4d')]['id2']);}})[_0x247a('0x29')](function(_0x28def7){if(_0x28def7){return db[_0x247a('0x68')]['findOne']({'where':{'id':_0x291f7a[_0x247a('0x4d')][_0x247a('0x73')]},'attributes':['id',_0x247a('0x30'),'save_name','converted_format',_0x247a('0x6b')],'raw':!![]});}})[_0x247a('0x29')](function(_0x521f15){if(_0x521f15){fs['unlinkSync'](path['join'](_0x548959[_0x247a('0x54')],util[_0x247a('0x6d')](_0x247a('0x6e'),_0x521f15[_0x247a('0x30')],_0x521f15[_0x247a('0x6f')])));return _0x521f15;}})['catch'](function(_0x468f42){throw new db[(_0x247a('0x74'))]['ValidationError'](_0x468f42[_0x247a('0x71')]);});})[_0x247a('0x29')](handleEntityNotFound(_0x1e7b98,null))[_0x247a('0x29')](respondWithStatusCode(_0x1e7b98,0xcc))[_0x247a('0x4b')](handleError(_0x1e7b98,null));};exports[_0x247a('0x75')]=function(_0x2bb0bd,_0x2ef638,_0x143d10){var _0x25f092={};var _0x3c469d={};var _0x4f7ad0;var _0x3d5708;return db[_0x247a('0x47')][_0x247a('0x69')]({'where':{'id':_0x2bb0bd[_0x247a('0x4d')]['id']}})[_0x247a('0x29')](handleEntityNotFound(_0x2ef638,null))[_0x247a('0x29')](function(_0x263ce4){if(_0x263ce4){_0x4f7ad0=_0x263ce4;_0x3c469d[_0x247a('0x36')]=_['keys'](db[_0x247a('0x68')][_0x247a('0x4e')]);_0x3c469d[_0x247a('0x3a')]=_['keys'](_0x2bb0bd[_0x247a('0x3a')]);_0x3c469d[_0x247a('0x38')]=_[_0x247a('0x39')](_0x3c469d[_0x247a('0x36')],_0x3c469d[_0x247a('0x3a')]);_0x25f092[_0x247a('0x3b')]=_[_0x247a('0x39')](_0x3c469d['model'],qs[_0x247a('0x4f')](_0x2bb0bd[_0x247a('0x3a')][_0x247a('0x4f')]));_0x25f092[_0x247a('0x3b')]=_0x25f092[_0x247a('0x3b')][_0x247a('0x3c')]?_0x25f092[_0x247a('0x3b')]:_0x3c469d[_0x247a('0x36')];_0x25f092[_0x247a('0x3f')]=qs[_0x247a('0x40')](_0x2bb0bd['query'][_0x247a('0x40')]);_0x25f092['where']=qs[_0x247a('0x38')](_[_0x247a('0x42')](_0x2bb0bd[_0x247a('0x3a')],_0x3c469d[_0x247a('0x38')]));if(_0x2bb0bd[_0x247a('0x3a')]['filter']){_0x25f092[_0x247a('0x41')]=_[_0x247a('0x44')](_0x25f092[_0x247a('0x41')],{'$or':_[_0x247a('0x33')](_0x25f092[_0x247a('0x3b')],function(_0x4ca3b4){var _0x56c473={};_0x56c473[_0x4ca3b4]={'$like':'%'+_0x2bb0bd[_0x247a('0x3a')][_0x247a('0x43')]+'%'};return _0x56c473;})});}_0x25f092=_[_0x247a('0x44')]({},_0x25f092,_0x2bb0bd['options']);return _0x4f7ad0[_0x247a('0x75')](_0x25f092);}})[_0x247a('0x29')](function(_0x2da4df){if(_0x2da4df){_0x3d5708=_0x2da4df['length'];if(!_0x2bb0bd[_0x247a('0x3a')][_0x247a('0x3d')](_0x247a('0x3e'))){_0x25f092[_0x247a('0x21')]=qs[_0x247a('0x21')](_0x2bb0bd[_0x247a('0x3a')][_0x247a('0x21')]);_0x25f092['offset']=qs[_0x247a('0x1f')](_0x2bb0bd[_0x247a('0x3a')][_0x247a('0x1f')]);}return _0x4f7ad0['getSounds'](_0x25f092);}})['then'](function(_0x4b8e23){if(_0x4b8e23){return _0x4b8e23?{'count':_0x3d5708,'rows':_0x4b8e23}:null;}})[_0x247a('0x29')](respondWithResult(_0x2ef638,null))[_0x247a('0x4b')](handleError(_0x2ef638,null));}; \ No newline at end of file +var _0x6bbe=['request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','set','Content-Range','apply','save','update','destroy','then','get','MusicOnHolds','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','limit','offset','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','VoiceMusicOnHold','findAll','rows','catch','show','params','find','body','sequelize','transaction','directory','root','server/files/moh','create','files','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','join','rmdirSync','Sequelize','message','addSound','Sound','findOne','save_name','converted_format','format','extname','%s.%s','symlinkSync','ValidationError','removeSound','id2','createdAt','getSounds','eml-format','rimraf','fast-json-patch'];(function(_0x3c07b0,_0x4ab6ec){var _0x16b9a8=function(_0x5b5628){while(--_0x5b5628){_0x3c07b0['push'](_0x3c07b0['shift']());}};_0x16b9a8(++_0x4ab6ec);}(_0x6bbe,0xdd));var _0xe6bb=function(_0x577093,_0x34015e){_0x577093=_0x577093-0x0;var _0xffc12e=_0x6bbe[_0x577093];return _0xffc12e;};'use strict';var emlformat=require(_0xe6bb('0x0'));var rimraf=require(_0xe6bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe6bb('0x2'));var rp=require(_0xe6bb('0x3'));var moment=require('moment');var BPromise=require(_0xe6bb('0x4'));var Mustache=require('mustache');var util=require(_0xe6bb('0x5'));var path=require(_0xe6bb('0x6'));var sox=require(_0xe6bb('0x7'));var csv=require(_0xe6bb('0x8'));var ejs=require(_0xe6bb('0x9'));var fs=require('fs');var fs_extra=require(_0xe6bb('0xa'));var _=require('lodash');var squel=require(_0xe6bb('0xb'));var crypto=require(_0xe6bb('0xc'));var jsforce=require(_0xe6bb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe6bb('0xe'));var Papa=require(_0xe6bb('0xf'));var Redis=require('ioredis');var authService=require(_0xe6bb('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe6bb('0x11'));var hardwareService=require(_0xe6bb('0x12'));var logger=require(_0xe6bb('0x13'))('api');var utils=require(_0xe6bb('0x14'));var config=require(_0xe6bb('0x15'));var licenseUtil=require(_0xe6bb('0x16'));var db=require(_0xe6bb('0x17'))['db'];function respondWithStatusCode(_0x54f0dc,_0x2312f6){_0x2312f6=_0x2312f6||0xcc;return function(_0x49e25a){if(_0x49e25a){return _0x54f0dc[_0xe6bb('0x18')](_0x2312f6);}return _0x54f0dc[_0xe6bb('0x19')](_0x2312f6)[_0xe6bb('0x1a')]();};}function respondWithResult(_0x386024,_0x54e112){_0x54e112=_0x54e112||0xc8;return function(_0x43d689){if(_0x43d689){return _0x386024[_0xe6bb('0x19')](_0x54e112)[_0xe6bb('0x1b')](_0x43d689);}};}function respondWithFilteredResult(_0x1abe0f,_0xef708b){return function(_0x331651){if(_0x331651){var _0x5a64e7=typeof _0xef708b['offset']===_0xe6bb('0x1c')&&typeof _0xef708b['limit']===_0xe6bb('0x1c');var _0x5a2e71=_0x331651[_0xe6bb('0x1d')];var _0x33b4e0=_0x5a64e7?0x0:_0xef708b['offset'];var _0x13c61a=_0x5a64e7?_0x331651[_0xe6bb('0x1d')]:_0xef708b['offset']+_0xef708b['limit'];var _0xfd1e13;if(_0x13c61a>=_0x5a2e71){_0x13c61a=_0x5a2e71;_0xfd1e13=0xc8;}else{_0xfd1e13=0xce;}_0x1abe0f[_0xe6bb('0x19')](_0xfd1e13);return _0x1abe0f[_0xe6bb('0x1e')](_0xe6bb('0x1f'),_0x33b4e0+'-'+_0x13c61a+'/'+_0x5a2e71)['json'](_0x331651);}return null;};}function patchUpdates(_0x2f6d87){return function(_0x8fabbb){try{jsonpatch[_0xe6bb('0x20')](_0x8fabbb,_0x2f6d87,!![]);}catch(_0x444df0){return BPromise['reject'](_0x444df0);}return _0x8fabbb[_0xe6bb('0x21')]();};}function saveUpdates(_0x36186b,_0x31aba3){return function(_0x25fe35){if(_0x25fe35){return _0x25fe35[_0xe6bb('0x22')](_0x36186b)['then'](function(_0x56d392){return _0x56d392;});}return null;};}function removeEntity(_0x585b00,_0x4aebd0){return function(_0x508178){if(_0x508178){return _0x508178[_0xe6bb('0x23')]()[_0xe6bb('0x24')](function(){var _0x686482=_0x508178[_0xe6bb('0x25')]({'plain':!![]});var _0x18f11d=_0xe6bb('0x26');return db[_0xe6bb('0x27')][_0xe6bb('0x23')]({'where':{'type':_0x18f11d,'resourceId':_0x686482['id']}})[_0xe6bb('0x24')](function(){return _0x508178;});})[_0xe6bb('0x24')](function(){_0x585b00[_0xe6bb('0x19')](0xcc)[_0xe6bb('0x1a')]();});}};}function handleEntityNotFound(_0x3b1efa,_0x366e93){return function(_0x4a1c78){if(!_0x4a1c78){_0x3b1efa[_0xe6bb('0x18')](0x194);}return _0x4a1c78;};}function handleError(_0x363193,_0x4862a7){_0x4862a7=_0x4862a7||0x1f4;return function(_0x5e85b8){logger['error'](_0x5e85b8[_0xe6bb('0x28')]);if(_0x5e85b8[_0xe6bb('0x29')]){delete _0x5e85b8[_0xe6bb('0x29')];}_0x363193[_0xe6bb('0x19')](_0x4862a7)[_0xe6bb('0x2a')](_0x5e85b8);};}exports[_0xe6bb('0x2b')]=function(_0x454555,_0x579901){var _0x25062e={},_0x196103={},_0x55a9ad={'count':0x0,'rows':[]};var _0x5e3cb1=_[_0xe6bb('0x2c')](db['VoiceMusicOnHold'][_0xe6bb('0x2d')],function(_0x428ecc){return{'name':_0x428ecc[_0xe6bb('0x2e')],'type':_0x428ecc['type']['key']};});_0x196103[_0xe6bb('0x2f')]=_[_0xe6bb('0x2c')](_0x5e3cb1,_0xe6bb('0x29'));_0x196103['query']=_[_0xe6bb('0x30')](_0x454555[_0xe6bb('0x31')]);_0x196103['filters']=_['intersection'](_0x196103[_0xe6bb('0x2f')],_0x196103[_0xe6bb('0x31')]);_0x25062e[_0xe6bb('0x32')]=_[_0xe6bb('0x33')](_0x196103[_0xe6bb('0x2f')],qs['fields'](_0x454555['query'][_0xe6bb('0x34')]));_0x25062e[_0xe6bb('0x32')]=_0x25062e[_0xe6bb('0x32')][_0xe6bb('0x35')]?_0x25062e[_0xe6bb('0x32')]:_0x196103[_0xe6bb('0x2f')];if(!_0x454555[_0xe6bb('0x31')][_0xe6bb('0x36')]('nolimit')){_0x25062e[_0xe6bb('0x37')]=qs[_0xe6bb('0x37')](_0x454555[_0xe6bb('0x31')][_0xe6bb('0x37')]);_0x25062e[_0xe6bb('0x38')]=qs[_0xe6bb('0x38')](_0x454555[_0xe6bb('0x31')][_0xe6bb('0x38')]);}_0x25062e[_0xe6bb('0x39')]=qs['sort'](_0x454555['query'][_0xe6bb('0x3a')]);delete _0x454555[_0xe6bb('0x31')][_0xe6bb('0x3a')];_0x25062e[_0xe6bb('0x3b')]=qs[_0xe6bb('0x3c')](_[_0xe6bb('0x3d')](_0x454555['query'],_0x196103[_0xe6bb('0x3c')]),_0x5e3cb1);if(_0x454555[_0xe6bb('0x31')][_0xe6bb('0x3e')]){_0x25062e[_0xe6bb('0x3b')]=_['merge'](_0x25062e[_0xe6bb('0x3b')],{'$or':_[_0xe6bb('0x2c')](_0x5e3cb1,function(_0x496e89){if(_0x496e89['type']!==_0xe6bb('0x3f')){var _0x2dc36f={};_0x2dc36f[_0x496e89['name']]={'$like':'%'+_0x454555[_0xe6bb('0x31')]['filter']+'%'};return _0x2dc36f;}})});}_0x25062e=_[_0xe6bb('0x40')]({},_0x25062e,_0x454555[_0xe6bb('0x41')]);var _0x533700={'where':_0x25062e[_0xe6bb('0x3b')]};return db['VoiceMusicOnHold'][_0xe6bb('0x1d')](_0x533700)[_0xe6bb('0x24')](function(_0x57619c){_0x55a9ad[_0xe6bb('0x1d')]=_0x57619c;if(_0x454555[_0xe6bb('0x31')][_0xe6bb('0x42')]){_0x25062e[_0xe6bb('0x43')]=[{'all':!![]}];}return db[_0xe6bb('0x44')][_0xe6bb('0x45')](_0x25062e);})[_0xe6bb('0x24')](function(_0x4c27a2){_0x55a9ad[_0xe6bb('0x46')]=_0x4c27a2;return _0x55a9ad;})[_0xe6bb('0x24')](respondWithFilteredResult(_0x579901,_0x25062e))[_0xe6bb('0x47')](handleError(_0x579901,null));};exports[_0xe6bb('0x48')]=function(_0x3356db,_0x1e70a9){var _0x59cbdb={'raw':![],'where':{'id':_0x3356db[_0xe6bb('0x49')]['id']}},_0x4e0533={};_0x4e0533[_0xe6bb('0x2f')]=_[_0xe6bb('0x30')](db['VoiceMusicOnHold'][_0xe6bb('0x2d')]);_0x4e0533[_0xe6bb('0x31')]=_['keys'](_0x3356db[_0xe6bb('0x31')]);_0x4e0533[_0xe6bb('0x3c')]=_[_0xe6bb('0x33')](_0x4e0533[_0xe6bb('0x2f')],_0x4e0533[_0xe6bb('0x31')]);_0x59cbdb['attributes']=_['intersection'](_0x4e0533[_0xe6bb('0x2f')],qs['fields'](_0x3356db[_0xe6bb('0x31')][_0xe6bb('0x34')]));_0x59cbdb[_0xe6bb('0x32')]=_0x59cbdb[_0xe6bb('0x32')][_0xe6bb('0x35')]?_0x59cbdb[_0xe6bb('0x32')]:_0x4e0533['model'];if(_0x3356db['query'][_0xe6bb('0x42')]){_0x59cbdb['include']=[{'all':!![]}];}_0x59cbdb=_[_0xe6bb('0x40')]({},_0x59cbdb,_0x3356db[_0xe6bb('0x41')]);return db[_0xe6bb('0x44')][_0xe6bb('0x4a')](_0x59cbdb)[_0xe6bb('0x24')](handleEntityNotFound(_0x1e70a9,null))[_0xe6bb('0x24')](respondWithResult(_0x1e70a9,null))[_0xe6bb('0x47')](handleError(_0x1e70a9,null));};exports['update']=function(_0x45794c,_0x551676){if(_0x45794c[_0xe6bb('0x4b')]['id']){delete _0x45794c[_0xe6bb('0x4b')]['id'];}return db[_0xe6bb('0x44')][_0xe6bb('0x4a')]({'where':{'id':_0x45794c['params']['id']}})[_0xe6bb('0x24')](handleEntityNotFound(_0x551676,null))[_0xe6bb('0x24')](saveUpdates(_0x45794c[_0xe6bb('0x4b')],null))[_0xe6bb('0x24')](respondWithResult(_0x551676,null))[_0xe6bb('0x47')](handleError(_0x551676,null));};exports['create']=function(_0x1fa704,_0x15bf4c,_0x228358){return db[_0xe6bb('0x4c')][_0xe6bb('0x4d')](function(_0x1d4bbe){if(_0x1fa704['body']['mode']==='files'){_0x1fa704['body'][_0xe6bb('0x4e')]=path['join'](config[_0xe6bb('0x4f')],_0xe6bb('0x50'),_0x1fa704[_0xe6bb('0x4b')][_0xe6bb('0x29')]);}return db[_0xe6bb('0x44')][_0xe6bb('0x51')](_0x1fa704[_0xe6bb('0x4b')],{'transaction':_0x1d4bbe})['then'](function(_0x22d093){if(_0x1fa704[_0xe6bb('0x4b')]['mode']===_0xe6bb('0x52')){fs[_0xe6bb('0x53')](_0x22d093[_0xe6bb('0x4e')],parseInt(_0xe6bb('0x54'),0x8));}var _0xa7122a=_0x1fa704[_0xe6bb('0x55')][_0xe6bb('0x25')]({'plain':!![]});if(!_0xa7122a)throw new Error(_0xe6bb('0x56'));if(_0xa7122a[_0xe6bb('0x57')]===_0xe6bb('0x55')){var _0x2b0b69=_0x22d093[_0xe6bb('0x25')]({'plain':!![]});return db[_0xe6bb('0x58')]['find']({'where':{'name':_0xe6bb('0x26'),'userProfileId':_0xa7122a[_0xe6bb('0x59')]},'raw':!![]})[_0xe6bb('0x24')](function(_0x59ff44){if(_0x59ff44&&_0x59ff44['autoAssociation']===0x0){return db[_0xe6bb('0x27')]['create']({'name':_0x2b0b69[_0xe6bb('0x29')],'resourceId':_0x2b0b69['id'],'type':_0x59ff44[_0xe6bb('0x29')],'sectionId':_0x59ff44['id']},{})[_0xe6bb('0x24')](function(){return _0x22d093;});}else{return _0x22d093;}})[_0xe6bb('0x47')](function(_0x40f290){logger['error'](_0xe6bb('0x5a'),_0x40f290);});}return _0x22d093;});})[_0xe6bb('0x24')](respondWithResult(_0x15bf4c,0xc9))[_0xe6bb('0x47')](handleError(_0x15bf4c,null));};exports[_0xe6bb('0x23')]=function(_0x48e2e6,_0x10855d,_0x1a2052){var _0x2b4bf5;return db[_0xe6bb('0x44')][_0xe6bb('0x4a')]({'where':{'id':_0x48e2e6[_0xe6bb('0x49')]['id']}})['then'](function(_0x515fcc){if(_0x515fcc){return db[_0xe6bb('0x4c')][_0xe6bb('0x4d')](function(_0x1f38ed){return _0x515fcc[_0xe6bb('0x23')]({'transaction':_0x1f38ed,'raw':!![]})[_0xe6bb('0x24')](function(_0x58f44e){if(_0x58f44e[_0xe6bb('0x4e')]){fs[_0xe6bb('0x5b')](_0x58f44e['directory'])[_0xe6bb('0x5c')](function(_0x497b22){fs[_0xe6bb('0x5d')](path[_0xe6bb('0x5e')](_0x58f44e[_0xe6bb('0x4e')],_0x497b22));});fs[_0xe6bb('0x5f')](_0x58f44e[_0xe6bb('0x4e')]);}return _0x58f44e;});})['catch'](function(_0x41bbc0){throw new db[(_0xe6bb('0x60'))]['ValidationError'](_0x41bbc0[_0xe6bb('0x61')]);});}})['then'](handleEntityNotFound(_0x10855d,null))[_0xe6bb('0x24')](removeEntity(_0x10855d,null))[_0xe6bb('0x47')](handleError(_0x10855d,null));};exports[_0xe6bb('0x62')]=function(_0x4c916f,_0x103479,_0x3563d7){return db[_0xe6bb('0x4c')][_0xe6bb('0x4d')](function(_0x585bd3){var _0x59124c;return db['VoiceMusicOnHold'][_0xe6bb('0x4a')]({'where':{'id':_0x4c916f[_0xe6bb('0x49')]['id']}})[_0xe6bb('0x24')](function(_0x5485f4){if(_0x5485f4){_0x59124c=_0x5485f4;return _0x5485f4[_0xe6bb('0x62')](_0x4c916f['body']['id'],{'transaction':_0x585bd3});}})[_0xe6bb('0x24')](function(_0x345f54){if(_0x345f54){return db[_0xe6bb('0x63')][_0xe6bb('0x64')]({'where':{'id':_0x4c916f[_0xe6bb('0x4b')]['id']},'attributes':['id','name',_0xe6bb('0x65'),_0xe6bb('0x66'),'createdAt'],'raw':!![]});}})[_0xe6bb('0x24')](function(_0x380057){if(_0x380057){var _0x5315f1=path['join'](config[_0xe6bb('0x4f')],'server/files/sounds/converted',util[_0xe6bb('0x67')]('%s.%s',path['basename'](_0x380057['save_name'],path[_0xe6bb('0x68')](_0x380057[_0xe6bb('0x65')])),_0x380057['converted_format']));var _0x335327=path[_0xe6bb('0x5e')](config[_0xe6bb('0x4f')],_0xe6bb('0x50'),_0x59124c[_0xe6bb('0x29')],util[_0xe6bb('0x67')](_0xe6bb('0x69'),_0x380057[_0xe6bb('0x29')],_0x380057[_0xe6bb('0x66')]));fs[_0xe6bb('0x6a')](_0x5315f1,_0x335327);return _0x380057;}})[_0xe6bb('0x47')](function(_0x13dc1b){throw new db['Sequelize'][(_0xe6bb('0x6b'))](_0x13dc1b[_0xe6bb('0x61')]);});})['then'](handleEntityNotFound(_0x103479,null))[_0xe6bb('0x24')](respondWithResult(_0x103479,0xc9))[_0xe6bb('0x47')](handleError(_0x103479,null));};exports[_0xe6bb('0x6c')]=function(_0x5e1cef,_0x72e794,_0x1f8be0){return db[_0xe6bb('0x4c')]['transaction'](function(_0xc2246f){var _0x3f1195;return db[_0xe6bb('0x44')]['findOne']({'where':{'id':_0x5e1cef[_0xe6bb('0x49')]['id']}})[_0xe6bb('0x24')](handleEntityNotFound(_0x72e794,null))[_0xe6bb('0x24')](function(_0x2957c4){if(_0x2957c4){_0x3f1195=_0x2957c4;return _0x2957c4[_0xe6bb('0x6c')](_0x5e1cef[_0xe6bb('0x49')][_0xe6bb('0x6d')]);}})['then'](function(_0x4d3c18){if(_0x4d3c18){return db[_0xe6bb('0x63')]['findOne']({'where':{'id':_0x5e1cef[_0xe6bb('0x49')]['id2']},'attributes':['id','name',_0xe6bb('0x65'),_0xe6bb('0x66'),_0xe6bb('0x6e')],'raw':!![]});}})[_0xe6bb('0x24')](function(_0x5afac6){if(_0x5afac6){fs[_0xe6bb('0x5d')](path['join'](_0x3f1195[_0xe6bb('0x4e')],util[_0xe6bb('0x67')](_0xe6bb('0x69'),_0x5afac6[_0xe6bb('0x29')],_0x5afac6[_0xe6bb('0x66')])));return _0x5afac6;}})[_0xe6bb('0x47')](function(_0x3df8cf){throw new db['Sequelize'][(_0xe6bb('0x6b'))](_0x3df8cf[_0xe6bb('0x61')]);});})['then'](handleEntityNotFound(_0x72e794,null))[_0xe6bb('0x24')](respondWithStatusCode(_0x72e794,0xcc))['catch'](handleError(_0x72e794,null));};exports[_0xe6bb('0x6f')]=function(_0x184dfa,_0x4f18c7,_0x1dbc0d){var _0x3d6b77={};var _0xd2e618={};var _0xb6223f;var _0x552677;return db[_0xe6bb('0x44')]['findOne']({'where':{'id':_0x184dfa[_0xe6bb('0x49')]['id']}})[_0xe6bb('0x24')](handleEntityNotFound(_0x4f18c7,null))['then'](function(_0x3643bf){if(_0x3643bf){_0xb6223f=_0x3643bf;_0xd2e618[_0xe6bb('0x2f')]=_[_0xe6bb('0x30')](db[_0xe6bb('0x63')][_0xe6bb('0x2d')]);_0xd2e618[_0xe6bb('0x31')]=_[_0xe6bb('0x30')](_0x184dfa[_0xe6bb('0x31')]);_0xd2e618[_0xe6bb('0x3c')]=_[_0xe6bb('0x33')](_0xd2e618[_0xe6bb('0x2f')],_0xd2e618[_0xe6bb('0x31')]);_0x3d6b77['attributes']=_[_0xe6bb('0x33')](_0xd2e618[_0xe6bb('0x2f')],qs[_0xe6bb('0x34')](_0x184dfa['query']['fields']));_0x3d6b77[_0xe6bb('0x32')]=_0x3d6b77[_0xe6bb('0x32')]['length']?_0x3d6b77[_0xe6bb('0x32')]:_0xd2e618[_0xe6bb('0x2f')];_0x3d6b77['order']=qs[_0xe6bb('0x3a')](_0x184dfa[_0xe6bb('0x31')]['sort']);_0x3d6b77[_0xe6bb('0x3b')]=qs[_0xe6bb('0x3c')](_['pick'](_0x184dfa[_0xe6bb('0x31')],_0xd2e618[_0xe6bb('0x3c')]));if(_0x184dfa[_0xe6bb('0x31')][_0xe6bb('0x3e')]){_0x3d6b77[_0xe6bb('0x3b')]=_[_0xe6bb('0x40')](_0x3d6b77[_0xe6bb('0x3b')],{'$or':_[_0xe6bb('0x2c')](_0x3d6b77[_0xe6bb('0x32')],function(_0x39778a){var _0x285fed={};_0x285fed[_0x39778a]={'$like':'%'+_0x184dfa[_0xe6bb('0x31')]['filter']+'%'};return _0x285fed;})});}_0x3d6b77=_[_0xe6bb('0x40')]({},_0x3d6b77,_0x184dfa[_0xe6bb('0x41')]);return _0xb6223f[_0xe6bb('0x6f')](_0x3d6b77);}})[_0xe6bb('0x24')](function(_0x42fa71){if(_0x42fa71){_0x552677=_0x42fa71[_0xe6bb('0x35')];if(!_0x184dfa[_0xe6bb('0x31')][_0xe6bb('0x36')]('nolimit')){_0x3d6b77['limit']=qs[_0xe6bb('0x37')](_0x184dfa[_0xe6bb('0x31')][_0xe6bb('0x37')]);_0x3d6b77[_0xe6bb('0x38')]=qs[_0xe6bb('0x38')](_0x184dfa[_0xe6bb('0x31')][_0xe6bb('0x38')]);}return _0xb6223f[_0xe6bb('0x6f')](_0x3d6b77);}})[_0xe6bb('0x24')](function(_0x4c383c){if(_0x4c383c){return _0x4c383c?{'count':_0x552677,'rows':_0x4c383c}:null;}})[_0xe6bb('0x24')](respondWithResult(_0x4f18c7,null))[_0xe6bb('0x47')](handleError(_0x4f18c7,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index f99c280..5fcd9f4 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 _0xe246=['api','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','lodash','../../config/logger'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xe246,0x120));var _0x6e24=function(_0x52c368,_0x376dbd){_0x52c368=_0x52c368-0x0;var _0x329245=_0xe246[_0x52c368];return _0x329245;};'use strict';var _=require(_0x6e24('0x0'));var util=require('util');var logger=require(_0x6e24('0x1'))(_0x6e24('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6e24('0x3'));var fs=require('fs');var path=require(_0x6e24('0x4'));var rimraf=require(_0x6e24('0x5'));var config=require(_0x6e24('0x6'));var attributes=require(_0x6e24('0x7'));module[_0x6e24('0x8')]=function(_0xc97037,_0x560abb){return _0xc97037['define'](_0x6e24('0x9'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a7d=['util','moment','bluebird','request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a7d,0x17b));var _0xd7a7=function(_0x4ef7c0,_0x5d99ba){_0x4ef7c0=_0x4ef7c0-0x0;var _0x544af5=_0x7a7d[_0x4ef7c0];return _0x544af5;};'use strict';var _=require(_0xd7a7('0x0'));var util=require(_0xd7a7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd7a7('0x2'));var BPromise=require(_0xd7a7('0x3'));var rp=require(_0xd7a7('0x4'));var fs=require('fs');var path=require(_0xd7a7('0x5'));var rimraf=require('rimraf');var config=require(_0xd7a7('0x6'));var attributes=require(_0xd7a7('0x7'));module['exports']=function(_0x8ca44e,_0x57499a){return _0x8ca44e[_0xd7a7('0x8')](_0xd7a7('0x9'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 73fbf6f..cef2597 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x145edb,_0x45a36d){var _0x5e38d1=function(_0x59e776){while(--_0x59e776){_0x145edb['push'](_0x145edb['shift']());}};_0x5e38d1(++_0x45a36d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xcb91[_0x160c73];return _0xd9302;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _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(_0x4633eb,_0x1dbb0c){var _0x46a764=function(_0x25a3db){while(--_0x25a3db){_0x4633eb['push'](_0x4633eb['shift']());}};_0x46a764(++_0x1dbb0c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 01ee728..d788c3c 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 _0x3d94=['path','connect-timeout','Router','fs-extra','../../config/environment','./voicePrefix.controller','isAuthenticated','get','/describe','describe','/:id','show','getAgents','/:id/teams','getTeams','post','create','/:id/users','addTeams','put','update','destroy','delete','removeAgents','removeTeams','exports','util'];(function(_0x134467,_0x40bd2a){var _0x2ab317=function(_0x575401){while(--_0x575401){_0x134467['push'](_0x134467['shift']());}};_0x2ab317(++_0x40bd2a);}(_0x3d94,0xd7));var _0x43d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d94[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x43d9('0x0'));var path=require(_0x43d9('0x1'));var timeout=require(_0x43d9('0x2'));var express=require('express');var router=express[_0x43d9('0x3')]();var fs_extra=require(_0x43d9('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x43d9('0x5'));var controller=require(_0x43d9('0x6'));router['get']('/',auth[_0x43d9('0x7')](),controller['index']);router[_0x43d9('0x8')](_0x43d9('0x9'),auth['isAuthenticated'](),controller[_0x43d9('0xa')]);router[_0x43d9('0x8')](_0x43d9('0xb'),auth[_0x43d9('0x7')](),controller[_0x43d9('0xc')]);router['get']('/:id/users',auth[_0x43d9('0x7')](),controller[_0x43d9('0xd')]);router[_0x43d9('0x8')](_0x43d9('0xe'),auth[_0x43d9('0x7')](),controller[_0x43d9('0xf')]);router[_0x43d9('0x10')]('/',auth[_0x43d9('0x7')](),controller[_0x43d9('0x11')]);router['post'](_0x43d9('0x12'),auth[_0x43d9('0x7')](),controller['addAgents']);router[_0x43d9('0x10')](_0x43d9('0xe'),auth[_0x43d9('0x7')](),controller[_0x43d9('0x13')]);router[_0x43d9('0x14')](_0x43d9('0xb'),auth[_0x43d9('0x7')](),controller[_0x43d9('0x15')]);router['delete'](_0x43d9('0xb'),auth[_0x43d9('0x7')](),controller[_0x43d9('0x16')]);router[_0x43d9('0x17')]('/:id/users',auth[_0x43d9('0x7')](),controller[_0x43d9('0x18')]);router[_0x43d9('0x17')](_0x43d9('0xe'),auth[_0x43d9('0x7')](),controller[_0x43d9('0x19')]);module[_0x43d9('0x1a')]=router; \ No newline at end of file +var _0xea81=['addTeams','put','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xea81,0x1ed));var _0x1ea8=function(_0x3565f7,_0x216844){_0x3565f7=_0x3565f7-0x0;var _0x3b9e0f=_0xea81[_0x3565f7];return _0x3b9e0f;};'use strict';var multer=require(_0x1ea8('0x0'));var util=require(_0x1ea8('0x1'));var path=require(_0x1ea8('0x2'));var timeout=require(_0x1ea8('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1ea8('0x4'));var auth=require(_0x1ea8('0x5'));var interaction=require(_0x1ea8('0x6'));var config=require(_0x1ea8('0x7'));var controller=require(_0x1ea8('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1ea8('0x9')](_0x1ea8('0xa'),auth[_0x1ea8('0xb')](),controller[_0x1ea8('0xc')]);router['get'](_0x1ea8('0xd'),auth[_0x1ea8('0xb')](),controller[_0x1ea8('0xe')]);router[_0x1ea8('0x9')](_0x1ea8('0xf'),auth['isAuthenticated'](),controller[_0x1ea8('0x10')]);router['get'](_0x1ea8('0x11'),auth[_0x1ea8('0xb')](),controller[_0x1ea8('0x12')]);router[_0x1ea8('0x13')]('/',auth[_0x1ea8('0xb')](),controller['create']);router['post'](_0x1ea8('0xf'),auth[_0x1ea8('0xb')](),controller['addAgents']);router[_0x1ea8('0x13')](_0x1ea8('0x11'),auth[_0x1ea8('0xb')](),controller[_0x1ea8('0x14')]);router[_0x1ea8('0x15')]('/:id',auth[_0x1ea8('0xb')](),controller[_0x1ea8('0x16')]);router[_0x1ea8('0x17')]('/:id',auth[_0x1ea8('0xb')](),controller[_0x1ea8('0x18')]);router['delete']('/:id/users',auth[_0x1ea8('0xb')](),controller['removeAgents']);router[_0x1ea8('0x17')]('/:id/teams',auth[_0x1ea8('0xb')](),controller[_0x1ea8('0x19')]);module[_0x1ea8('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 c456b68..4f6c365 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 _0x6d86=['getDataValue','INTEGER','sequelize','exports','STRING','name','VIRTUAL','system-'];(function(_0x4a8418,_0x39078a){var _0x390174=function(_0x173ea6){while(--_0x173ea6){_0x4a8418['push'](_0x4a8418['shift']());}};_0x390174(++_0x39078a);}(_0x6d86,0x142));var _0x66d8=function(_0x2d7aa6,_0x4645ec){_0x2d7aa6=_0x2d7aa6-0x0;var _0x4d7e41=_0x6d86[_0x2d7aa6];return _0x4d7e41;};'use strict';var Sequelize=require(_0x66d8('0x0'));module[_0x66d8('0x1')]={'name':{'type':Sequelize[_0x66d8('0x2')],'allowNull':![],'unique':_0x66d8('0x3')},'prefix':{'type':Sequelize[_0x66d8('0x4')],'get':function(_0x3add17){return _0x66d8('0x5')+this[_0x66d8('0x6')](_0x66d8('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x66d8('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x66d8('0x7')]}}; \ No newline at end of file +var _0xf7a7=['sequelize','exports','STRING','name','VIRTUAL','system-','getDataValue','INTEGER'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xf7a7,0x88));var _0x7f7a=function(_0x408eef,_0x40838c){_0x408eef=_0x408eef-0x0;var _0x564096=_0xf7a7[_0x408eef];return _0x564096;};'use strict';var Sequelize=require(_0x7f7a('0x0'));module[_0x7f7a('0x1')]={'name':{'type':Sequelize[_0x7f7a('0x2')],'allowNull':![],'unique':_0x7f7a('0x3')},'prefix':{'type':Sequelize[_0x7f7a('0x4')],'get':function(_0x58ff3c){return _0x7f7a('0x5')+this[_0x7f7a('0x6')](_0x7f7a('0x3'))+'-';}},'description':{'type':Sequelize[_0x7f7a('0x2')]},'callerIdAll':{'type':Sequelize[_0x7f7a('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x7f7a('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 8336150..119ad28 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 _0x8603=['send','map','VoicePrefix','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','find','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','app','system','description','Voice\x20Prefix\x20Extension','priority','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','NoOp','goto','charAt','update','system-','findById','addAgents','omit','ids','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','getAgents','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','each','upsert','findOrCreate','removeTeams','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','clone','toString','QueryTypes','every','includes','all','union','compact','forEach','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','get','VoicePrefixes','UserProfileResource','destroy','stack','name'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8603,0x190));var _0x3860=function(_0x53d96a,_0x537fb8){_0x53d96a=_0x53d96a-0x0;var _0x4ef9d2=_0x8603[_0x53d96a];return _0x4ef9d2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3860('0x0'));var zipdir=require(_0x3860('0x1'));var jsonpatch=require(_0x3860('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3860('0x3'));var Mustache=require(_0x3860('0x4'));var util=require(_0x3860('0x5'));var path=require('path');var sox=require(_0x3860('0x6'));var csv=require('to-csv');var ejs=require(_0x3860('0x7'));var fs=require('fs');var fs_extra=require(_0x3860('0x8'));var _=require(_0x3860('0x9'));var squel=require(_0x3860('0xa'));var crypto=require(_0x3860('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3860('0xc'));var Papa=require(_0x3860('0xd'));var Redis=require('ioredis');var authService=require(_0x3860('0xe'));var qs=require(_0x3860('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3860('0x10'));var logger=require(_0x3860('0x11'))('api');var utils=require(_0x3860('0x12'));var config=require(_0x3860('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3860('0x14'))['db'];config[_0x3860('0x15')]=_[_0x3860('0x16')](config[_0x3860('0x15')],{'host':_0x3860('0x17'),'port':0x18eb});var socket=require(_0x3860('0x18'))(new Redis(config[_0x3860('0x15')]));require(_0x3860('0x19'))[_0x3860('0x1a')](socket);function respondWithStatusCode(_0x46264d,_0x54dbc3){_0x54dbc3=_0x54dbc3||0xcc;return function(_0x3d861d){if(_0x3d861d){return _0x46264d[_0x3860('0x1b')](_0x54dbc3);}return _0x46264d[_0x3860('0x1c')](_0x54dbc3)[_0x3860('0x1d')]();};}function respondWithResult(_0x1055b3,_0xfa0c9a){_0xfa0c9a=_0xfa0c9a||0xc8;return function(_0x2d8a3a){if(_0x2d8a3a){return _0x1055b3[_0x3860('0x1c')](_0xfa0c9a)[_0x3860('0x1e')](_0x2d8a3a);}};}function respondWithFilteredResult(_0x3c0d91,_0x3e51b4){return function(_0x45b799){if(_0x45b799){var _0x4b6b15=typeof _0x3e51b4['offset']===_0x3860('0x1f')&&typeof _0x3e51b4[_0x3860('0x20')]===_0x3860('0x1f');var _0x53fc63=_0x45b799[_0x3860('0x21')];var _0x145b26=_0x4b6b15?0x0:_0x3e51b4[_0x3860('0x22')];var _0x3af33a=_0x4b6b15?_0x45b799[_0x3860('0x21')]:_0x3e51b4[_0x3860('0x22')]+_0x3e51b4[_0x3860('0x20')];var _0x1f8891;if(_0x3af33a>=_0x53fc63){_0x3af33a=_0x53fc63;_0x1f8891=0xc8;}else{_0x1f8891=0xce;}_0x3c0d91[_0x3860('0x1c')](_0x1f8891);return _0x3c0d91[_0x3860('0x23')](_0x3860('0x24'),_0x145b26+'-'+_0x3af33a+'/'+_0x53fc63)[_0x3860('0x1e')](_0x45b799);}return null;};}function patchUpdates(_0x280ea9){return function(_0x9eaaa1){try{jsonpatch[_0x3860('0x25')](_0x9eaaa1,_0x280ea9,!![]);}catch(_0x564efd){return BPromise[_0x3860('0x26')](_0x564efd);}return _0x9eaaa1[_0x3860('0x27')]();};}function saveUpdates(_0x2b91f2,_0x301e03){return function(_0x20bb1e){if(_0x20bb1e){return _0x20bb1e['update'](_0x2b91f2)[_0x3860('0x28')](function(_0x568515){return _0x568515;});}return null;};}function removeEntity(_0x577750,_0xfa9705){return function(_0x1c4bbc){if(_0x1c4bbc){return _0x1c4bbc['destroy']()['then'](function(){var _0x5f42d5=_0x1c4bbc[_0x3860('0x29')]({'plain':!![]});var _0x3ebc5b=_0x3860('0x2a');return db[_0x3860('0x2b')][_0x3860('0x2c')]({'where':{'type':_0x3ebc5b,'resourceId':_0x5f42d5['id']}})[_0x3860('0x28')](function(){return _0x1c4bbc;});})['then'](function(){_0x577750['status'](0xcc)[_0x3860('0x1d')]();});}};}function handleEntityNotFound(_0x1f1809,_0x5a9af2){return function(_0x2551f4){if(!_0x2551f4){_0x1f1809[_0x3860('0x1b')](0x194);}return _0x2551f4;};}function handleError(_0x10d9e4,_0x426e6c){_0x426e6c=_0x426e6c||0x1f4;return function(_0x3628f7){logger['error'](_0x3628f7[_0x3860('0x2d')]);if(_0x3628f7[_0x3860('0x2e')]){delete _0x3628f7[_0x3860('0x2e')];}_0x10d9e4['status'](_0x426e6c)[_0x3860('0x2f')](_0x3628f7);};}exports['index']=function(_0x294b3a,_0x4825f0){var _0x1c498c={},_0x2e542a={},_0x24cf39={'count':0x0,'rows':[]};var _0x47e350=_[_0x3860('0x30')](db[_0x3860('0x31')]['rawAttributes'],function(_0x1c94cc){return{'name':_0x1c94cc['fieldName'],'type':_0x1c94cc[_0x3860('0x32')][_0x3860('0x33')]};});_0x2e542a[_0x3860('0x34')]=_[_0x3860('0x30')](_0x47e350,_0x3860('0x2e'));_0x2e542a[_0x3860('0x35')]=_[_0x3860('0x36')](_0x294b3a['query']);_0x2e542a[_0x3860('0x37')]=_[_0x3860('0x38')](_0x2e542a['model'],_0x2e542a[_0x3860('0x35')]);_0x1c498c[_0x3860('0x39')]=_[_0x3860('0x38')](_0x2e542a['model'],qs['fields'](_0x294b3a[_0x3860('0x35')][_0x3860('0x3a')]));_0x1c498c[_0x3860('0x39')]=_0x1c498c[_0x3860('0x39')]['length']?_0x1c498c['attributes']:_0x2e542a[_0x3860('0x34')];if(!_0x294b3a[_0x3860('0x35')][_0x3860('0x3b')](_0x3860('0x3c'))){_0x1c498c[_0x3860('0x20')]=qs['limit'](_0x294b3a[_0x3860('0x35')][_0x3860('0x20')]);_0x1c498c['offset']=qs['offset'](_0x294b3a[_0x3860('0x35')][_0x3860('0x22')]);}_0x1c498c[_0x3860('0x3d')]=qs[_0x3860('0x3e')](_0x294b3a[_0x3860('0x35')]['sort']);_0x1c498c[_0x3860('0x3f')]=qs['filters'](_[_0x3860('0x40')](_0x294b3a[_0x3860('0x35')],_0x2e542a['filters']),_0x47e350);if(_0x294b3a[_0x3860('0x35')][_0x3860('0x41')]){_0x1c498c['where']=_[_0x3860('0x42')](_0x1c498c[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x47e350,function(_0xf346e){if(_0xf346e['type']!==_0x3860('0x43')){var _0x47141b={};_0x47141b[_0xf346e[_0x3860('0x2e')]]={'$like':'%'+_0x294b3a['query'][_0x3860('0x41')]+'%'};return _0x47141b;}})});}_0x1c498c=_['merge']({},_0x1c498c,_0x294b3a[_0x3860('0x44')]);var _0x424801={'where':_0x1c498c[_0x3860('0x3f')]};return db[_0x3860('0x31')][_0x3860('0x21')](_0x424801)[_0x3860('0x28')](function(_0x4e0a44){_0x24cf39[_0x3860('0x21')]=_0x4e0a44;if(_0x294b3a[_0x3860('0x35')]['includeAll']){_0x1c498c['include']=[{'all':!![]}];}return db[_0x3860('0x31')][_0x3860('0x45')](_0x1c498c);})['then'](function(_0x164a77){_0x24cf39[_0x3860('0x46')]=_0x164a77;return _0x24cf39;})['then'](respondWithFilteredResult(_0x4825f0,_0x1c498c))[_0x3860('0x47')](handleError(_0x4825f0,null));};exports[_0x3860('0x48')]=function(_0x392dc3,_0x37e5c3){var _0x14f5b2={'raw':![],'where':{'id':_0x392dc3[_0x3860('0x49')]['id']}},_0x3fa282={};_0x3fa282[_0x3860('0x34')]=_[_0x3860('0x36')](db[_0x3860('0x31')][_0x3860('0x4a')]);_0x3fa282[_0x3860('0x35')]=_[_0x3860('0x36')](_0x392dc3['query']);_0x3fa282[_0x3860('0x37')]=_['intersection'](_0x3fa282[_0x3860('0x34')],_0x3fa282[_0x3860('0x35')]);_0x14f5b2[_0x3860('0x39')]=_[_0x3860('0x38')](_0x3fa282[_0x3860('0x34')],qs[_0x3860('0x3a')](_0x392dc3[_0x3860('0x35')][_0x3860('0x3a')]));_0x14f5b2['attributes']=_0x14f5b2[_0x3860('0x39')][_0x3860('0x4b')]?_0x14f5b2[_0x3860('0x39')]:_0x3fa282['model'];if(_0x392dc3[_0x3860('0x35')][_0x3860('0x4c')]){_0x14f5b2[_0x3860('0x4d')]=[{'all':!![]}];}_0x14f5b2=_[_0x3860('0x42')]({},_0x14f5b2,_0x392dc3['options']);return db['VoicePrefix'][_0x3860('0x4e')](_0x14f5b2)['then'](handleEntityNotFound(_0x37e5c3,null))[_0x3860('0x28')](respondWithResult(_0x37e5c3,null))[_0x3860('0x47')](handleError(_0x37e5c3,null));};exports[_0x3860('0x2c')]=function(_0x52456e,_0x29c52d){return db['VoicePrefix'][_0x3860('0x4e')]({'where':{'id':_0x52456e['params']['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x29c52d,null))[_0x3860('0x28')](removeEntity(_0x29c52d,null))[_0x3860('0x47')](handleError(_0x29c52d,null));};exports['describe']=function(_0x4876ab,_0x4408b5){return db[_0x3860('0x31')]['describe']()[_0x3860('0x28')](respondWithResult(_0x4408b5,null))['catch'](handleError(_0x4408b5,null));};exports[_0x3860('0x4f')]=function(_0x1267e1,_0x254631){var _0x233eee;return db[_0x3860('0x50')][_0x3860('0x51')](function(_0x3fad85){return db['VoicePrefix'][_0x3860('0x4f')](_0x1267e1[_0x3860('0x52')],{'transaction':_0x3fad85})[_0x3860('0x28')](function(_0x137789){_0x233eee=_0x137789[_0x3860('0x29')]({'plain':!![]});return db[_0x3860('0x53')]['find']({'where':{'id':_0x233eee[_0x3860('0x54')]},'raw':!![]})[_0x3860('0x28')](function(_0x19a26d){return createVoicePrefixExtensions(_0x233eee,_0x19a26d,_0x3fad85);});});})[_0x3860('0x28')](function(){var _0x3a55e7=_0x1267e1[_0x3860('0x55')][_0x3860('0x29')]({'plain':!![]});if(!_0x3a55e7)throw new Error(_0x3860('0x56'));if(_0x3a55e7['role']===_0x3860('0x55')){var _0x2ff0bf=_0x233eee;return db['UserProfileSection'][_0x3860('0x4e')]({'where':{'name':_0x3860('0x2a'),'userProfileId':_0x3a55e7[_0x3860('0x57')]},'raw':!![]})['then'](function(_0x17d2df){if(_0x17d2df&&_0x17d2df['autoAssociation']===0x0){return db[_0x3860('0x2b')][_0x3860('0x4f')]({'name':_0x2ff0bf[_0x3860('0x2e')],'resourceId':_0x2ff0bf['id'],'type':_0x17d2df[_0x3860('0x2e')],'sectionId':_0x17d2df['id']},{})[_0x3860('0x28')](function(){return _0x233eee;});}else{return _0x233eee;}})[_0x3860('0x47')](function(_0x1a4f58){logger[_0x3860('0x58')](_0x3860('0x59'),_0x1a4f58);throw _0x1a4f58;});}return _0x233eee;})[_0x3860('0x28')](respondWithResult(_0x254631,null))[_0x3860('0x47')](handleError(_0x254631,null));};function Extension(_0x2bac24,_0x58147d,_0x5ce9a4,_0x5111e0){this[_0x3860('0x5a')]='from-sip';this['exten']=_0x2bac24;this[_0x3860('0x5b')]=_0x5ce9a4;this[_0x3860('0x32')]=_0x3860('0x5c');this[_0x3860('0x5d')]=_0x3860('0x5e');this[_0x3860('0x5f')]=_0x58147d;this['appdata']=_0x5111e0;}function createVoicePrefixExtensions(_0x49ec68,_0x4df47b,_0x1d6c70){return new BPromise(function(_0x1c1da4,_0x2d1646){var _0x5ec169=new Extension(formatPrefixName(_0x49ec68[_0x3860('0x60')]),0x1,'NoOp',_0x3860('0x61'));_0x5ec169[_0x3860('0x62')]=_0x49ec68['id'];return db['VoiceExtension'][_0x3860('0x4f')](_0x5ec169,{'transaction':_0x1d6c70})[_0x3860('0x28')](function(_0xfe45d8){var _0x27f817=_0xfe45d8['get']({'plain':!![]});var _0x18cc37=_[_0x3860('0x30')](addVoicePrefixExtensions(_0x49ec68,_0x4df47b),function(_0x17f248){_0x17f248['VoiceExtensionId']=_0x27f817['id'];_0x17f248['VoicePrefixId']=_0x49ec68['id'];return _0x17f248;});return db[_0x3860('0x53')][_0x3860('0x63')](_0x18cc37,{'transaction':_0x1d6c70})[_0x3860('0x28')](function(_0x1ca0e7){if(!_0x1ca0e7){return _0x2d1646(_0x3860('0x64'));}else{return _0x1c1da4(_0x1ca0e7);}})[_0x3860('0x47')](function(_0x5d0210){return _0x2d1646(_0x5d0210);});});;});};function addVoicePrefixExtensions(_0x2d916a,_0x4fe4e8){var _0x5db8f9=[];var _0x15fa2d=formatPrefixName(_0x2d916a[_0x3860('0x60')]);_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x2,_0x3860('0x66'),_0x3860('0x67')+_0x2d916a[_0x3860('0x2e')]));if(_0x2d916a['callerIdAll']){_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x3,_0x3860('0x66'),_0x3860('0x68')+_0x2d916a[_0x3860('0x69')]));}else{_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x3,_0x3860('0x6a'),'No\x20callerid\x20available'));}_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x4,_0x3860('0x6b'),_0x4fe4e8[_0x3860('0x5a')]+','+'${EXTEN:'+(0x8+_0x2d916a['name'][_0x3860('0x4b')])+'}'+','+0x1));return _0x5db8f9;}function formatPrefixName(_0x2d425d){var _0x11c2c8='_';for(var _0x3b7a76=0x0;_0x3b7a76<_0x2d425d[_0x3860('0x4b')];_0x3b7a76++){if(_0x2d425d['charAt'](_0x3b7a76)=='-'){_0x11c2c8+=_0x2d425d['charAt'](_0x3b7a76);}else{_0x11c2c8+='['+_0x2d425d[_0x3860('0x6c')](_0x3b7a76)+']';}}_0x11c2c8+='.';return _0x11c2c8;}exports[_0x3860('0x6d')]=function(_0x47e144,_0x5d9416,_0x2fd2ec){var _0x38ad4e=_0x47e144['body'];_0x38ad4e[_0x3860('0x60')]=_0x3860('0x6e')+_0x38ad4e[_0x3860('0x2e')]+'-';return db[_0x3860('0x50')]['transaction'](function(_0x1e8c5c){return db[_0x3860('0x31')]['update'](_0x38ad4e,{'where':{'id':_0x38ad4e['id']},'transaction':_0x1e8c5c})['then'](function(){return db[_0x3860('0x53')][_0x3860('0x2c')]({'where':{'VoicePrefixId':_0x38ad4e['id']},'transaction':_0x1e8c5c})['then'](function(){return db[_0x3860('0x53')]['find']({'where':{'id':_0x38ad4e[_0x3860('0x54')]},'raw':!![]})['then'](function(_0x543574){return createVoicePrefixExtensions(_0x38ad4e,_0x543574,_0x1e8c5c);});});});})[_0x3860('0x28')](function(){return db['VoicePrefix'][_0x3860('0x6f')](_0x38ad4e['id']);})[_0x3860('0x28')](respondWithResult(_0x5d9416,null))[_0x3860('0x47')](handleError(_0x5d9416,null));};exports[_0x3860('0x70')]=function(_0x19f717,_0x43c5a1,_0x4b3447){return db[_0x3860('0x31')][_0x3860('0x4e')]({'where':{'id':_0x19f717[_0x3860('0x49')]['id']}})['then'](handleEntityNotFound(_0x43c5a1,null))[_0x3860('0x28')](function(_0x55661a){if(_0x55661a){return _0x55661a[_0x3860('0x70')](_0x19f717[_0x3860('0x52')]['ids'],_[_0x3860('0x71')](_0x19f717[_0x3860('0x52')],[_0x3860('0x72'),'id'])||{})['spread'](function(_0x572707){for(var _0x5a282a=0x0;_0x5a282a<_0x19f717['body'][_0x3860('0x72')][_0x3860('0x4b')];_0x5a282a+=0x1){socket[_0x3860('0x73')](_0x3860('0x74'),{'UserId':Number(_0x19f717['body']['ids'][_0x5a282a]),'VoicePrefixId':Number(_0x19f717[_0x3860('0x49')]['id'])});}return _0x572707;});}})[_0x3860('0x28')](respondWithResult(_0x43c5a1,null))[_0x3860('0x47')](handleError(_0x43c5a1,null));};exports[_0x3860('0x75')]=function(_0x4b0652,_0x3a7c0c,_0x306560){return db['VoicePrefix']['find']({'where':{'id':_0x4b0652[_0x3860('0x49')]['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x3a7c0c,null))[_0x3860('0x28')](function(_0x27894f){if(_0x27894f){return _0x27894f['removeAgents'](_0x4b0652['query'][_0x3860('0x72')])['then'](function(){if(_[_0x3860('0x76')](_0x4b0652[_0x3860('0x35')]['ids'])){for(var _0x4e7713=0x0;_0x4e7713<_0x4b0652['query'][_0x3860('0x72')][_0x3860('0x4b')];_0x4e7713+=0x1){socket['emit'](_0x3860('0x77'),{'UserId':Number(_0x4b0652[_0x3860('0x35')][_0x3860('0x72')][_0x4e7713]),'VoicePrefixId':Number(_0x4b0652[_0x3860('0x49')]['id'])});}}else{socket[_0x3860('0x73')]('userVoicePrefix:remove',{'UserId':Number(_0x4b0652[_0x3860('0x35')][_0x3860('0x72')]),'VoicePrefixId':Number(_0x4b0652[_0x3860('0x49')]['id'])});}});}})[_0x3860('0x28')](respondWithStatusCode(_0x3a7c0c,null))[_0x3860('0x47')](handleError(_0x3a7c0c,null));};exports['getAgents']=function(_0x313366,_0xf57e80,_0x2f3759){var _0x41ee6f={};var _0x28fcb6={};var _0x543c98;var _0x532370;return db[_0x3860('0x31')][_0x3860('0x78')]({'where':{'id':_0x313366[_0x3860('0x49')]['id']}})[_0x3860('0x28')](handleEntityNotFound(_0xf57e80,null))[_0x3860('0x28')](function(_0x293c60){if(_0x293c60){_0x543c98=_0x293c60;_0x28fcb6[_0x3860('0x34')]=_['keys'](db[_0x3860('0x79')][_0x3860('0x4a')]);_0x28fcb6['query']=_[_0x3860('0x36')](_0x313366[_0x3860('0x35')]);_0x28fcb6[_0x3860('0x37')]=_['intersection'](_0x28fcb6[_0x3860('0x34')],_0x28fcb6[_0x3860('0x35')]);_0x41ee6f['attributes']=_[_0x3860('0x38')](_0x28fcb6['model'],qs[_0x3860('0x3a')](_0x313366[_0x3860('0x35')]['fields']));_0x41ee6f[_0x3860('0x39')]=_0x41ee6f[_0x3860('0x39')][_0x3860('0x4b')]?_0x41ee6f[_0x3860('0x39')]:_0x28fcb6[_0x3860('0x34')];_0x41ee6f['order']=qs[_0x3860('0x3e')](_0x313366[_0x3860('0x35')][_0x3860('0x3e')]);_0x41ee6f[_0x3860('0x3f')]=qs[_0x3860('0x37')](_['pick'](_0x313366['query'],_0x28fcb6[_0x3860('0x37')]));if(_0x313366[_0x3860('0x35')]['filter']){_0x41ee6f[_0x3860('0x3f')]=_[_0x3860('0x42')](_0x41ee6f[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x41ee6f['attributes'],function(_0x3a0719){var _0x5a2f99={};_0x5a2f99[_0x3a0719]={'$like':'%'+_0x313366[_0x3860('0x35')][_0x3860('0x41')]+'%'};return _0x5a2f99;})});}_0x41ee6f=_[_0x3860('0x42')]({},_0x41ee6f,_0x313366[_0x3860('0x44')]);return _0x543c98[_0x3860('0x7a')](_0x41ee6f);}})[_0x3860('0x28')](function(_0x467b1b){if(_0x467b1b){_0x532370=_0x467b1b['length'];if(!_0x313366[_0x3860('0x35')][_0x3860('0x3b')]('nolimit')){_0x41ee6f['limit']=qs['limit'](_0x313366['query'][_0x3860('0x20')]);_0x41ee6f[_0x3860('0x22')]=qs[_0x3860('0x22')](_0x313366[_0x3860('0x35')][_0x3860('0x22')]);}return _0x543c98[_0x3860('0x7a')](_0x41ee6f);}})['then'](function(_0x204da6){if(_0x204da6){return _0x204da6?{'count':_0x532370,'rows':_0x204da6}:null;}})['then'](respondWithResult(_0xf57e80,null))[_0x3860('0x47')](handleError(_0xf57e80,null));};exports[_0x3860('0x7b')]=function(_0x897ea0,_0x221229,_0x459b6c){var _0x1108d2={};var _0x23d7f0={};var _0x52987a;var _0xcd4bd3;return db[_0x3860('0x31')][_0x3860('0x78')]({'where':{'id':_0x897ea0['params']['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x221229,null))[_0x3860('0x28')](function(_0x1c87bd){if(_0x1c87bd){_0x52987a=_0x1c87bd;_0x23d7f0['model']=_[_0x3860('0x36')](db[_0x3860('0x7c')][_0x3860('0x4a')]);_0x23d7f0[_0x3860('0x35')]=_['keys'](_0x897ea0[_0x3860('0x35')]);_0x23d7f0[_0x3860('0x37')]=_[_0x3860('0x38')](_0x23d7f0['model'],_0x23d7f0[_0x3860('0x35')]);_0x1108d2[_0x3860('0x39')]=_[_0x3860('0x38')](_0x23d7f0['model'],qs[_0x3860('0x3a')](_0x897ea0[_0x3860('0x35')][_0x3860('0x3a')]));_0x1108d2['attributes']=_0x1108d2[_0x3860('0x39')][_0x3860('0x4b')]?_0x1108d2[_0x3860('0x39')]:_0x23d7f0['model'];_0x1108d2[_0x3860('0x3d')]=qs[_0x3860('0x3e')](_0x897ea0[_0x3860('0x35')]['sort']);_0x1108d2[_0x3860('0x3f')]=qs['filters'](_[_0x3860('0x40')](_0x897ea0['query'],_0x23d7f0[_0x3860('0x37')]));if(_0x897ea0[_0x3860('0x35')][_0x3860('0x41')]){_0x1108d2[_0x3860('0x3f')]=_[_0x3860('0x42')](_0x1108d2[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x1108d2[_0x3860('0x39')],function(_0x3f808c){var _0x1de607={};_0x1de607[_0x3f808c]={'$like':'%'+_0x897ea0[_0x3860('0x35')][_0x3860('0x41')]+'%'};return _0x1de607;})});}_0x1108d2=_[_0x3860('0x42')]({},_0x1108d2,_0x897ea0[_0x3860('0x44')]);return _0x52987a[_0x3860('0x7b')](_0x1108d2);}})[_0x3860('0x28')](function(_0x46661f){if(_0x46661f){_0xcd4bd3=_0x46661f[_0x3860('0x4b')];if(!_0x897ea0['query'][_0x3860('0x3b')](_0x3860('0x3c'))){_0x1108d2[_0x3860('0x20')]=qs[_0x3860('0x20')](_0x897ea0[_0x3860('0x35')][_0x3860('0x20')]);_0x1108d2[_0x3860('0x22')]=qs[_0x3860('0x22')](_0x897ea0[_0x3860('0x35')][_0x3860('0x22')]);}return _0x52987a[_0x3860('0x7b')](_0x1108d2);}})['then'](function(_0x252c19){if(_0x252c19){return _0x252c19?{'count':_0xcd4bd3,'rows':_0x252c19}:null;}})[_0x3860('0x28')](respondWithResult(_0x221229,null))[_0x3860('0x47')](handleError(_0x221229,null));};exports[_0x3860('0x7d')]=function(_0x4a929e,_0x1a1994,_0x2ece36){var _0x2fcf2c=_0x4a929e[_0x3860('0x52')]['ids'];var _0x280747;return db['Team']['findAll']({'where':{'id':_0x2fcf2c},'attributes':['id'],'include':[{'model':db[_0x3860('0x79')],'as':_0x3860('0x7e'),'attributes':['id',_0x3860('0x2e'),_0x3860('0x7f'),_0x3860('0x80'),_0x3860('0x81')],'raw':!![]}]})[_0x3860('0x28')](function(_0x273fed){if(_0x273fed){_0x280747=_0x273fed;var _0x3e4a88=_[_0x3860('0x82')](_0x273fed,function(_0x4677b0){var _0x559c=_0x4677b0[_0x3860('0x29')]({'plain':!![]});return _0x559c['Agents'];});return db[_0x3860('0x31')]['find']({'where':{'id':_0x4a929e[_0x3860('0x49')]['id']}})[_0x3860('0x28')](function(_0x5891d8){return db[_0x3860('0x50')][_0x3860('0x51')](function(_0x1a9158){return _0x5891d8[_0x3860('0x7d')](_0x2fcf2c,{'transaction':_0x1a9158})[_0x3860('0x28')](function(){return BPromise[_0x3860('0x83')](_0x280747,function(_0x12296a){return db['TeamVoicePrefix'][_0x3860('0x84')]({'TeamId':_0x12296a['id'],'VoicePrefixId':_0x4a929e[_0x3860('0x49')]['id']},{'transaction':_0x1a9158});});})[_0x3860('0x28')](function(){return BPromise[_0x3860('0x83')](_0x3e4a88,function(_0x469ae6){return db['UserVoicePrefix'][_0x3860('0x85')]({'where':{'UserId':_0x469ae6['id'],'VoicePrefixId':_0x4a929e['params']['id']},'transaction':_0x1a9158});});})['then'](function(){_0x3e4a88['forEach'](function(_0x1059a4){socket[_0x3860('0x73')](_0x3860('0x74'),{'UserId':_0x1059a4['id'],'VoicePrefixId':_0x5891d8['id']});});});});});}})[_0x3860('0x28')](respondWithStatusCode(_0x1a1994,null))[_0x3860('0x47')](handleError(_0x1a1994,null));};exports[_0x3860('0x86')]=function(_0x270ca1,_0xe24a1d,_0x59c203){return db[_0x3860('0x7c')][_0x3860('0x45')]({'where':{'id':_0x270ca1['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x3860('0x79')],'as':_0x3860('0x7e'),'attributes':['id'],'raw':!![]}]})[_0x3860('0x28')](handleEntityNotFound(_0xe24a1d,null))['then'](function(_0x1fe2d8){var _0x4f07f3=_[_0x3860('0x30')](_0x1fe2d8,'id');var _0x5c196e=[];var _0x41fd53=[];var _0xf91fc2=squel['select']();_0xf91fc2[_0x3860('0x87')](_0x3860('0x88'))['from'](_0x3860('0x89'),'tq')[_0x3860('0x8a')](_0x3860('0x8b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3860('0x3f')]('VoicePrefixId\x20=\x20?',_0x270ca1[_0x3860('0x49')]['id']);for(var _0x18b845=0x0;_0x18b845<_0x1fe2d8['length'];_0x18b845+=0x1){let _0x20edc7=_0x1fe2d8[_0x18b845];for(var _0x2d8581=0x0;_0x2d8581<_0x20edc7[_0x3860('0x7e')][_0x3860('0x4b')];_0x2d8581+=0x1){let _0x2d4744=_0x20edc7['Agents'][_0x2d8581];var _0x410bf4=_0xf91fc2[_0x3860('0x8c')]();_0x410bf4['where']('ut.UserId\x20=\x20?',_0x2d4744['id']);_0x41fd53[_0x3860('0x65')](db['sequelize'][_0x3860('0x35')](_0x410bf4[_0x3860('0x8d')](),{'type':db['sequelize'][_0x3860('0x8e')]['SELECT']})[_0x3860('0x28')](function(_0x4b8128){if(_0x4b8128[_0x3860('0x4b')]===0x1){return _0x2d4744['id'];}else{var _0x24788d=_[_0x3860('0x8f')](_[_0x3860('0x30')](_0x4b8128,'TeamId'),function(_0x25a8f7){return _[_0x3860('0x90')](_0x4f07f3,_0x25a8f7);});if(_0x24788d){return _0x2d4744['id'];}}}));}}return BPromise[_0x3860('0x91')](_0x41fd53)[_0x3860('0x28')](function(_0x4b7f2a){_0x5c196e=_(_0x5c196e)[_0x3860('0x92')](_0x4b7f2a)[_0x3860('0x93')]()['value']();return db[_0x3860('0x31')][_0x3860('0x4e')]({'where':{'id':_0x270ca1[_0x3860('0x49')]['id']}})[_0x3860('0x28')](function(_0x514374){return db[_0x3860('0x50')][_0x3860('0x51')](function(_0xd2167f){return _0x514374[_0x3860('0x86')](_0x270ca1['query'][_0x3860('0x72')],{'transaction':_0xd2167f})['then'](function(){if(!_['isEmpty'](_0x5c196e)){return _0x514374['removeAgents'](_0x5c196e,{'transaction':_0xd2167f});}})[_0x3860('0x28')](function(){_0x5c196e[_0x3860('0x94')](function(_0x1a6929){socket['emit'](_0x3860('0x77'),{'UserId':_0x1a6929,'VoicePrefixId':_0x514374['id']});});});});});});})['then'](respondWithStatusCode(_0xe24a1d,null))[_0x3860('0x47')](handleError(_0xe24a1d,null));}; \ No newline at end of file +var _0x36ee=['show','params','find','describe','create','sequelize','transaction','get','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','Voice\x20Prefix','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','charAt','body','findById','addAgents','spread','ids','userVoicePrefix:save','removeAgents','emit','userVoicePrefix:remove','getAgents','User','nolimit','getTeams','findOne','Team','findAll','Agents','voicePause','interface','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','field','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','includes','all','forEach','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','update','then','destroy','UserProfileResource','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch'];(function(_0x3e6b6e,_0x4e0b58){var _0x56d4f9=function(_0x275ed6){while(--_0x275ed6){_0x3e6b6e['push'](_0x3e6b6e['shift']());}};_0x56d4f9(++_0x4e0b58);}(_0x36ee,0xe8));var _0xe36e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x36ee[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe36e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe36e('0x1'));var moment=require(_0xe36e('0x2'));var BPromise=require(_0xe36e('0x3'));var Mustache=require(_0xe36e('0x4'));var util=require(_0xe36e('0x5'));var path=require(_0xe36e('0x6'));var sox=require(_0xe36e('0x7'));var csv=require(_0xe36e('0x8'));var ejs=require(_0xe36e('0x9'));var fs=require('fs');var fs_extra=require(_0xe36e('0xa'));var _=require(_0xe36e('0xb'));var squel=require(_0xe36e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe36e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe36e('0x8'));var querystring=require(_0xe36e('0xe'));var Papa=require(_0xe36e('0xf'));var Redis=require('ioredis');var authService=require(_0xe36e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe36e('0x11'));var hardwareService=require(_0xe36e('0x12'));var logger=require(_0xe36e('0x13'))(_0xe36e('0x14'));var utils=require(_0xe36e('0x15'));var config=require(_0xe36e('0x16'));var licenseUtil=require(_0xe36e('0x17'));var db=require(_0xe36e('0x18'))['db'];config['redis']=_[_0xe36e('0x19')](config[_0xe36e('0x1a')],{'host':_0xe36e('0x1b'),'port':0x18eb});var socket=require(_0xe36e('0x1c'))(new Redis(config['redis']));require(_0xe36e('0x1d'))['register'](socket);function respondWithStatusCode(_0x525155,_0x27ff47){_0x27ff47=_0x27ff47||0xcc;return function(_0x300f21){if(_0x300f21){return _0x525155[_0xe36e('0x1e')](_0x27ff47);}return _0x525155[_0xe36e('0x1f')](_0x27ff47)[_0xe36e('0x20')]();};}function respondWithResult(_0x924cd5,_0x2096f6){_0x2096f6=_0x2096f6||0xc8;return function(_0x39bae8){if(_0x39bae8){return _0x924cd5[_0xe36e('0x1f')](_0x2096f6)[_0xe36e('0x21')](_0x39bae8);}};}function respondWithFilteredResult(_0x5792e8,_0x333554){return function(_0x2184ae){if(_0x2184ae){var _0x56c019=typeof _0x333554[_0xe36e('0x22')]==='undefined'&&typeof _0x333554[_0xe36e('0x23')]===_0xe36e('0x24');var _0x5e15f5=_0x2184ae[_0xe36e('0x25')];var _0x6aa186=_0x56c019?0x0:_0x333554[_0xe36e('0x22')];var _0x597331=_0x56c019?_0x2184ae[_0xe36e('0x25')]:_0x333554[_0xe36e('0x22')]+_0x333554[_0xe36e('0x23')];var _0x3c4017;if(_0x597331>=_0x5e15f5){_0x597331=_0x5e15f5;_0x3c4017=0xc8;}else{_0x3c4017=0xce;}_0x5792e8[_0xe36e('0x1f')](_0x3c4017);return _0x5792e8[_0xe36e('0x26')]('Content-Range',_0x6aa186+'-'+_0x597331+'/'+_0x5e15f5)[_0xe36e('0x21')](_0x2184ae);}return null;};}function patchUpdates(_0x4f214a){return function(_0x23bcf3){try{jsonpatch[_0xe36e('0x27')](_0x23bcf3,_0x4f214a,!![]);}catch(_0x437f3f){return BPromise['reject'](_0x437f3f);}return _0x23bcf3['save']();};}function saveUpdates(_0x4749a8,_0x10818d){return function(_0xb0cd85){if(_0xb0cd85){return _0xb0cd85[_0xe36e('0x28')](_0x4749a8)[_0xe36e('0x29')](function(_0x1507f9){return _0x1507f9;});}return null;};}function removeEntity(_0x1a045c,_0x5ac484){return function(_0x3cafbf){if(_0x3cafbf){return _0x3cafbf[_0xe36e('0x2a')]()[_0xe36e('0x29')](function(){var _0x262caa=_0x3cafbf['get']({'plain':!![]});var _0x2d757c='VoicePrefixes';return db[_0xe36e('0x2b')]['destroy']({'where':{'type':_0x2d757c,'resourceId':_0x262caa['id']}})[_0xe36e('0x29')](function(){return _0x3cafbf;});})['then'](function(){_0x1a045c[_0xe36e('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b1045,_0x59548b){return function(_0x4bb75b){if(!_0x4bb75b){_0x3b1045['sendStatus'](0x194);}return _0x4bb75b;};}function handleError(_0x5b5d53,_0x203fa2){_0x203fa2=_0x203fa2||0x1f4;return function(_0x1fc639){logger['error'](_0x1fc639['stack']);if(_0x1fc639[_0xe36e('0x2c')]){delete _0x1fc639[_0xe36e('0x2c')];}_0x5b5d53[_0xe36e('0x1f')](_0x203fa2)[_0xe36e('0x2d')](_0x1fc639);};}exports[_0xe36e('0x2e')]=function(_0x4759b4,_0x57bb9b){var _0xb98e78={},_0x11c95d={},_0x57272f={'count':0x0,'rows':[]};var _0x87e595=_[_0xe36e('0x2f')](db[_0xe36e('0x30')][_0xe36e('0x31')],function(_0x21623e){return{'name':_0x21623e[_0xe36e('0x32')],'type':_0x21623e[_0xe36e('0x33')][_0xe36e('0x34')]};});_0x11c95d[_0xe36e('0x35')]=_[_0xe36e('0x2f')](_0x87e595,_0xe36e('0x2c'));_0x11c95d['query']=_[_0xe36e('0x36')](_0x4759b4['query']);_0x11c95d['filters']=_[_0xe36e('0x37')](_0x11c95d['model'],_0x11c95d[_0xe36e('0x38')]);_0xb98e78[_0xe36e('0x39')]=_[_0xe36e('0x37')](_0x11c95d[_0xe36e('0x35')],qs['fields'](_0x4759b4['query'][_0xe36e('0x3a')]));_0xb98e78[_0xe36e('0x39')]=_0xb98e78[_0xe36e('0x39')][_0xe36e('0x3b')]?_0xb98e78['attributes']:_0x11c95d[_0xe36e('0x35')];if(!_0x4759b4[_0xe36e('0x38')][_0xe36e('0x3c')]('nolimit')){_0xb98e78[_0xe36e('0x23')]=qs[_0xe36e('0x23')](_0x4759b4['query'][_0xe36e('0x23')]);_0xb98e78[_0xe36e('0x22')]=qs[_0xe36e('0x22')](_0x4759b4[_0xe36e('0x38')][_0xe36e('0x22')]);}_0xb98e78[_0xe36e('0x3d')]=qs[_0xe36e('0x3e')](_0x4759b4[_0xe36e('0x38')][_0xe36e('0x3e')]);_0xb98e78[_0xe36e('0x3f')]=qs[_0xe36e('0x40')](_[_0xe36e('0x41')](_0x4759b4[_0xe36e('0x38')],_0x11c95d['filters']),_0x87e595);if(_0x4759b4[_0xe36e('0x38')][_0xe36e('0x42')]){_0xb98e78[_0xe36e('0x3f')]=_[_0xe36e('0x43')](_0xb98e78[_0xe36e('0x3f')],{'$or':_['map'](_0x87e595,function(_0x591e33){if(_0x591e33[_0xe36e('0x33')]!==_0xe36e('0x44')){var _0x1acc12={};_0x1acc12[_0x591e33[_0xe36e('0x2c')]]={'$like':'%'+_0x4759b4[_0xe36e('0x38')][_0xe36e('0x42')]+'%'};return _0x1acc12;}})});}_0xb98e78=_[_0xe36e('0x43')]({},_0xb98e78,_0x4759b4[_0xe36e('0x45')]);var _0x48066c={'where':_0xb98e78[_0xe36e('0x3f')]};return db[_0xe36e('0x30')]['count'](_0x48066c)[_0xe36e('0x29')](function(_0x5ef3e4){_0x57272f[_0xe36e('0x25')]=_0x5ef3e4;if(_0x4759b4[_0xe36e('0x38')][_0xe36e('0x46')]){_0xb98e78[_0xe36e('0x47')]=[{'all':!![]}];}return db[_0xe36e('0x30')]['findAll'](_0xb98e78);})[_0xe36e('0x29')](function(_0x2961c9){_0x57272f[_0xe36e('0x48')]=_0x2961c9;return _0x57272f;})[_0xe36e('0x29')](respondWithFilteredResult(_0x57bb9b,_0xb98e78))[_0xe36e('0x49')](handleError(_0x57bb9b,null));};exports[_0xe36e('0x4a')]=function(_0x569809,_0x122704){var _0x134d71={'raw':![],'where':{'id':_0x569809[_0xe36e('0x4b')]['id']}},_0x2a6817={};_0x2a6817[_0xe36e('0x35')]=_['keys'](db[_0xe36e('0x30')][_0xe36e('0x31')]);_0x2a6817[_0xe36e('0x38')]=_[_0xe36e('0x36')](_0x569809[_0xe36e('0x38')]);_0x2a6817[_0xe36e('0x40')]=_[_0xe36e('0x37')](_0x2a6817[_0xe36e('0x35')],_0x2a6817[_0xe36e('0x38')]);_0x134d71['attributes']=_['intersection'](_0x2a6817[_0xe36e('0x35')],qs['fields'](_0x569809[_0xe36e('0x38')][_0xe36e('0x3a')]));_0x134d71[_0xe36e('0x39')]=_0x134d71[_0xe36e('0x39')]['length']?_0x134d71[_0xe36e('0x39')]:_0x2a6817[_0xe36e('0x35')];if(_0x569809['query'][_0xe36e('0x46')]){_0x134d71[_0xe36e('0x47')]=[{'all':!![]}];}_0x134d71=_[_0xe36e('0x43')]({},_0x134d71,_0x569809[_0xe36e('0x45')]);return db[_0xe36e('0x30')][_0xe36e('0x4c')](_0x134d71)[_0xe36e('0x29')](handleEntityNotFound(_0x122704,null))[_0xe36e('0x29')](respondWithResult(_0x122704,null))[_0xe36e('0x49')](handleError(_0x122704,null));};exports[_0xe36e('0x2a')]=function(_0x7307bc,_0x13ccc5){return db[_0xe36e('0x30')][_0xe36e('0x4c')]({'where':{'id':_0x7307bc[_0xe36e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x13ccc5,null))[_0xe36e('0x29')](removeEntity(_0x13ccc5,null))['catch'](handleError(_0x13ccc5,null));};exports['describe']=function(_0x10b8ff,_0x3e8ccb){return db['VoicePrefix'][_0xe36e('0x4d')]()[_0xe36e('0x29')](respondWithResult(_0x3e8ccb,null))[_0xe36e('0x49')](handleError(_0x3e8ccb,null));};exports[_0xe36e('0x4e')]=function(_0xa4be24,_0x22788b){var _0x935e84;return db[_0xe36e('0x4f')][_0xe36e('0x50')](function(_0x55d190){return db[_0xe36e('0x30')][_0xe36e('0x4e')](_0xa4be24['body'],{'transaction':_0x55d190})[_0xe36e('0x29')](function(_0x1da952){_0x935e84=_0x1da952[_0xe36e('0x51')]({'plain':!![]});return db[_0xe36e('0x52')][_0xe36e('0x4c')]({'where':{'id':_0x935e84['VoiceExtensionId']},'raw':!![]})['then'](function(_0x56f5b6){return createVoicePrefixExtensions(_0x935e84,_0x56f5b6,_0x55d190);});});})['then'](function(){var _0x47605d=_0xa4be24[_0xe36e('0x53')][_0xe36e('0x51')]({'plain':!![]});if(!_0x47605d)throw new Error(_0xe36e('0x54'));if(_0x47605d[_0xe36e('0x55')]===_0xe36e('0x53')){var _0x7c3766=_0x935e84;return db[_0xe36e('0x56')][_0xe36e('0x4c')]({'where':{'name':'VoicePrefixes','userProfileId':_0x47605d[_0xe36e('0x57')]},'raw':!![]})[_0xe36e('0x29')](function(_0x5a058b){if(_0x5a058b&&_0x5a058b[_0xe36e('0x58')]===0x0){return db[_0xe36e('0x2b')][_0xe36e('0x4e')]({'name':_0x7c3766[_0xe36e('0x2c')],'resourceId':_0x7c3766['id'],'type':_0x5a058b[_0xe36e('0x2c')],'sectionId':_0x5a058b['id']},{})[_0xe36e('0x29')](function(){return _0x935e84;});}else{return _0x935e84;}})[_0xe36e('0x49')](function(_0x1a70d1){logger[_0xe36e('0x59')](_0xe36e('0x5a'),_0x1a70d1);throw _0x1a70d1;});}return _0x935e84;})[_0xe36e('0x29')](respondWithResult(_0x22788b,null))[_0xe36e('0x49')](handleError(_0x22788b,null));};function Extension(_0x389e91,_0x6f979f,_0x3512ec,_0x3e4860){this[_0xe36e('0x5b')]=_0xe36e('0x5c');this[_0xe36e('0x5d')]=_0x389e91;this[_0xe36e('0x5e')]=_0x3512ec;this[_0xe36e('0x33')]=_0xe36e('0x5f');this[_0xe36e('0x60')]=_0xe36e('0x61');this[_0xe36e('0x62')]=_0x6f979f;this['appdata']=_0x3e4860;}function createVoicePrefixExtensions(_0x429a01,_0xedaa96,_0x49336b){return new BPromise(function(_0xce5583,_0x41bad0){var _0x180dc3=new Extension(formatPrefixName(_0x429a01[_0xe36e('0x63')]),0x1,_0xe36e('0x64'),_0xe36e('0x65'));_0x180dc3['VoicePrefixId']=_0x429a01['id'];return db[_0xe36e('0x52')]['create'](_0x180dc3,{'transaction':_0x49336b})[_0xe36e('0x29')](function(_0x1fc1e5){var _0x2b0059=_0x1fc1e5[_0xe36e('0x51')]({'plain':!![]});var _0x2a767d=_[_0xe36e('0x2f')](addVoicePrefixExtensions(_0x429a01,_0xedaa96),function(_0x2ab6aa){_0x2ab6aa[_0xe36e('0x66')]=_0x2b0059['id'];_0x2ab6aa['VoicePrefixId']=_0x429a01['id'];return _0x2ab6aa;});return db[_0xe36e('0x52')][_0xe36e('0x67')](_0x2a767d,{'transaction':_0x49336b})['then'](function(_0x3068e1){if(!_0x3068e1){return _0x41bad0(_0xe36e('0x68'));}else{return _0xce5583(_0x3068e1);}})[_0xe36e('0x49')](function(_0x1e8943){return _0x41bad0(_0x1e8943);});});;});};function addVoicePrefixExtensions(_0x30786a,_0x3565cb){var _0x3d4874=[];var _0x48ff05=formatPrefixName(_0x30786a[_0xe36e('0x63')]);_0x3d4874[_0xe36e('0x69')](new Extension(_0x48ff05,0x2,_0xe36e('0x6a'),_0xe36e('0x6b')+_0x30786a[_0xe36e('0x2c')]));if(_0x30786a[_0xe36e('0x6c')]){_0x3d4874[_0xe36e('0x69')](new Extension(_0x48ff05,0x3,_0xe36e('0x6a'),_0xe36e('0x6d')+_0x30786a[_0xe36e('0x6c')]));}else{_0x3d4874[_0xe36e('0x69')](new Extension(_0x48ff05,0x3,'NoOp',_0xe36e('0x6e')));}_0x3d4874[_0xe36e('0x69')](new Extension(_0x48ff05,0x4,_0xe36e('0x6f'),_0x3565cb[_0xe36e('0x5b')]+','+'${EXTEN:'+(0x8+_0x30786a['name'][_0xe36e('0x3b')])+'}'+','+0x1));return _0x3d4874;}function formatPrefixName(_0x55911b){var _0x585bd5='_';for(var _0x59c454=0x0;_0x59c454<_0x55911b[_0xe36e('0x3b')];_0x59c454++){if(_0x55911b['charAt'](_0x59c454)=='-'){_0x585bd5+=_0x55911b[_0xe36e('0x70')](_0x59c454);}else{_0x585bd5+='['+_0x55911b[_0xe36e('0x70')](_0x59c454)+']';}}_0x585bd5+='.';return _0x585bd5;}exports[_0xe36e('0x28')]=function(_0x221a90,_0x1bd60d,_0x46f789){var _0x11e610=_0x221a90[_0xe36e('0x71')];_0x11e610[_0xe36e('0x63')]='system-'+_0x11e610[_0xe36e('0x2c')]+'-';return db['sequelize'][_0xe36e('0x50')](function(_0x517c2a){return db[_0xe36e('0x30')][_0xe36e('0x28')](_0x11e610,{'where':{'id':_0x11e610['id']},'transaction':_0x517c2a})[_0xe36e('0x29')](function(){return db[_0xe36e('0x52')]['destroy']({'where':{'VoicePrefixId':_0x11e610['id']},'transaction':_0x517c2a})['then'](function(){return db[_0xe36e('0x52')][_0xe36e('0x4c')]({'where':{'id':_0x11e610[_0xe36e('0x66')]},'raw':!![]})[_0xe36e('0x29')](function(_0x3be728){return createVoicePrefixExtensions(_0x11e610,_0x3be728,_0x517c2a);});});});})[_0xe36e('0x29')](function(){return db['VoicePrefix'][_0xe36e('0x72')](_0x11e610['id']);})[_0xe36e('0x29')](respondWithResult(_0x1bd60d,null))['catch'](handleError(_0x1bd60d,null));};exports[_0xe36e('0x73')]=function(_0x5eea4f,_0x45ebca,_0x421c28){return db[_0xe36e('0x30')][_0xe36e('0x4c')]({'where':{'id':_0x5eea4f['params']['id']}})[_0xe36e('0x29')](handleEntityNotFound(_0x45ebca,null))['then'](function(_0x49a74b){if(_0x49a74b){return _0x49a74b[_0xe36e('0x73')](_0x5eea4f[_0xe36e('0x71')]['ids'],_['omit'](_0x5eea4f[_0xe36e('0x71')],['ids','id'])||{})[_0xe36e('0x74')](function(_0x36ddc0){for(var _0x2c0ed5=0x0;_0x2c0ed5<_0x5eea4f[_0xe36e('0x71')][_0xe36e('0x75')][_0xe36e('0x3b')];_0x2c0ed5+=0x1){socket['emit'](_0xe36e('0x76'),{'UserId':Number(_0x5eea4f[_0xe36e('0x71')][_0xe36e('0x75')][_0x2c0ed5]),'VoicePrefixId':Number(_0x5eea4f[_0xe36e('0x4b')]['id'])});}return _0x36ddc0;});}})['then'](respondWithResult(_0x45ebca,null))[_0xe36e('0x49')](handleError(_0x45ebca,null));};exports[_0xe36e('0x77')]=function(_0x2eef73,_0x39c9fe,_0x5ee201){return db[_0xe36e('0x30')]['find']({'where':{'id':_0x2eef73[_0xe36e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x39c9fe,null))[_0xe36e('0x29')](function(_0x522968){if(_0x522968){return _0x522968['removeAgents'](_0x2eef73[_0xe36e('0x38')][_0xe36e('0x75')])[_0xe36e('0x29')](function(){if(_['isArray'](_0x2eef73[_0xe36e('0x38')][_0xe36e('0x75')])){for(var _0x48e4f5=0x0;_0x48e4f5<_0x2eef73[_0xe36e('0x38')][_0xe36e('0x75')][_0xe36e('0x3b')];_0x48e4f5+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x2eef73[_0xe36e('0x38')][_0xe36e('0x75')][_0x48e4f5]),'VoicePrefixId':Number(_0x2eef73[_0xe36e('0x4b')]['id'])});}}else{socket[_0xe36e('0x78')](_0xe36e('0x79'),{'UserId':Number(_0x2eef73['query'][_0xe36e('0x75')]),'VoicePrefixId':Number(_0x2eef73[_0xe36e('0x4b')]['id'])});}});}})[_0xe36e('0x29')](respondWithStatusCode(_0x39c9fe,null))[_0xe36e('0x49')](handleError(_0x39c9fe,null));};exports[_0xe36e('0x7a')]=function(_0x5bdeea,_0x3712f6,_0x24fcf8){var _0x188dc9={};var _0x493d0f={};var _0x25e4eb;var _0x499f0a;return db[_0xe36e('0x30')]['findOne']({'where':{'id':_0x5bdeea[_0xe36e('0x4b')]['id']}})[_0xe36e('0x29')](handleEntityNotFound(_0x3712f6,null))['then'](function(_0x463355){if(_0x463355){_0x25e4eb=_0x463355;_0x493d0f['model']=_[_0xe36e('0x36')](db[_0xe36e('0x7b')][_0xe36e('0x31')]);_0x493d0f[_0xe36e('0x38')]=_[_0xe36e('0x36')](_0x5bdeea['query']);_0x493d0f[_0xe36e('0x40')]=_['intersection'](_0x493d0f[_0xe36e('0x35')],_0x493d0f[_0xe36e('0x38')]);_0x188dc9[_0xe36e('0x39')]=_[_0xe36e('0x37')](_0x493d0f[_0xe36e('0x35')],qs[_0xe36e('0x3a')](_0x5bdeea['query'][_0xe36e('0x3a')]));_0x188dc9[_0xe36e('0x39')]=_0x188dc9[_0xe36e('0x39')]['length']?_0x188dc9[_0xe36e('0x39')]:_0x493d0f[_0xe36e('0x35')];_0x188dc9[_0xe36e('0x3d')]=qs[_0xe36e('0x3e')](_0x5bdeea['query'][_0xe36e('0x3e')]);_0x188dc9['where']=qs[_0xe36e('0x40')](_['pick'](_0x5bdeea[_0xe36e('0x38')],_0x493d0f[_0xe36e('0x40')]));if(_0x5bdeea[_0xe36e('0x38')]['filter']){_0x188dc9[_0xe36e('0x3f')]=_[_0xe36e('0x43')](_0x188dc9['where'],{'$or':_[_0xe36e('0x2f')](_0x188dc9[_0xe36e('0x39')],function(_0x1f4dd2){var _0x531eac={};_0x531eac[_0x1f4dd2]={'$like':'%'+_0x5bdeea['query'][_0xe36e('0x42')]+'%'};return _0x531eac;})});}_0x188dc9=_[_0xe36e('0x43')]({},_0x188dc9,_0x5bdeea[_0xe36e('0x45')]);return _0x25e4eb[_0xe36e('0x7a')](_0x188dc9);}})[_0xe36e('0x29')](function(_0x5e62f1){if(_0x5e62f1){_0x499f0a=_0x5e62f1[_0xe36e('0x3b')];if(!_0x5bdeea[_0xe36e('0x38')][_0xe36e('0x3c')](_0xe36e('0x7c'))){_0x188dc9['limit']=qs[_0xe36e('0x23')](_0x5bdeea[_0xe36e('0x38')]['limit']);_0x188dc9['offset']=qs['offset'](_0x5bdeea[_0xe36e('0x38')]['offset']);}return _0x25e4eb['getAgents'](_0x188dc9);}})[_0xe36e('0x29')](function(_0x96f37a){if(_0x96f37a){return _0x96f37a?{'count':_0x499f0a,'rows':_0x96f37a}:null;}})[_0xe36e('0x29')](respondWithResult(_0x3712f6,null))[_0xe36e('0x49')](handleError(_0x3712f6,null));};exports[_0xe36e('0x7d')]=function(_0x378126,_0x48fbed,_0x2ebe8e){var _0x4f9354={};var _0x493692={};var _0x4451ec;var _0x21644d;return db[_0xe36e('0x30')][_0xe36e('0x7e')]({'where':{'id':_0x378126['params']['id']}})[_0xe36e('0x29')](handleEntityNotFound(_0x48fbed,null))[_0xe36e('0x29')](function(_0x23e62d){if(_0x23e62d){_0x4451ec=_0x23e62d;_0x493692[_0xe36e('0x35')]=_['keys'](db[_0xe36e('0x7f')]['rawAttributes']);_0x493692[_0xe36e('0x38')]=_[_0xe36e('0x36')](_0x378126[_0xe36e('0x38')]);_0x493692[_0xe36e('0x40')]=_[_0xe36e('0x37')](_0x493692['model'],_0x493692[_0xe36e('0x38')]);_0x4f9354[_0xe36e('0x39')]=_[_0xe36e('0x37')](_0x493692[_0xe36e('0x35')],qs[_0xe36e('0x3a')](_0x378126[_0xe36e('0x38')][_0xe36e('0x3a')]));_0x4f9354[_0xe36e('0x39')]=_0x4f9354[_0xe36e('0x39')][_0xe36e('0x3b')]?_0x4f9354[_0xe36e('0x39')]:_0x493692[_0xe36e('0x35')];_0x4f9354[_0xe36e('0x3d')]=qs['sort'](_0x378126['query']['sort']);_0x4f9354[_0xe36e('0x3f')]=qs[_0xe36e('0x40')](_[_0xe36e('0x41')](_0x378126[_0xe36e('0x38')],_0x493692['filters']));if(_0x378126[_0xe36e('0x38')][_0xe36e('0x42')]){_0x4f9354[_0xe36e('0x3f')]=_[_0xe36e('0x43')](_0x4f9354['where'],{'$or':_[_0xe36e('0x2f')](_0x4f9354[_0xe36e('0x39')],function(_0xdd1816){var _0x18dd36={};_0x18dd36[_0xdd1816]={'$like':'%'+_0x378126['query']['filter']+'%'};return _0x18dd36;})});}_0x4f9354=_[_0xe36e('0x43')]({},_0x4f9354,_0x378126[_0xe36e('0x45')]);return _0x4451ec['getTeams'](_0x4f9354);}})['then'](function(_0x59bf4d){if(_0x59bf4d){_0x21644d=_0x59bf4d[_0xe36e('0x3b')];if(!_0x378126[_0xe36e('0x38')][_0xe36e('0x3c')]('nolimit')){_0x4f9354[_0xe36e('0x23')]=qs[_0xe36e('0x23')](_0x378126[_0xe36e('0x38')][_0xe36e('0x23')]);_0x4f9354['offset']=qs[_0xe36e('0x22')](_0x378126[_0xe36e('0x38')][_0xe36e('0x22')]);}return _0x4451ec[_0xe36e('0x7d')](_0x4f9354);}})['then'](function(_0x3de53b){if(_0x3de53b){return _0x3de53b?{'count':_0x21644d,'rows':_0x3de53b}:null;}})['then'](respondWithResult(_0x48fbed,null))[_0xe36e('0x49')](handleError(_0x48fbed,null));};exports['addTeams']=function(_0x1c95cd,_0x2b3e81,_0x498822){var _0x2376b2=_0x1c95cd[_0xe36e('0x71')]['ids'];var _0x179b3f;return db[_0xe36e('0x7f')][_0xe36e('0x80')]({'where':{'id':_0x2376b2},'attributes':['id'],'include':[{'model':db[_0xe36e('0x7b')],'as':_0xe36e('0x81'),'attributes':['id',_0xe36e('0x2c'),'online',_0xe36e('0x82'),_0xe36e('0x83')],'raw':!![]}]})['then'](function(_0xda5f86){if(_0xda5f86){_0x179b3f=_0xda5f86;var _0x48e276=_[_0xe36e('0x84')](_0xda5f86,function(_0x7872d5){var _0x2aefd4=_0x7872d5[_0xe36e('0x51')]({'plain':!![]});return _0x2aefd4['Agents'];});return db[_0xe36e('0x30')][_0xe36e('0x4c')]({'where':{'id':_0x1c95cd[_0xe36e('0x4b')]['id']}})[_0xe36e('0x29')](function(_0x43f149){return db['sequelize'][_0xe36e('0x50')](function(_0x25abc5){return _0x43f149['addTeams'](_0x2376b2,{'transaction':_0x25abc5})['then'](function(){return BPromise[_0xe36e('0x85')](_0x179b3f,function(_0x51c98c){return db[_0xe36e('0x86')][_0xe36e('0x87')]({'TeamId':_0x51c98c['id'],'VoicePrefixId':_0x1c95cd[_0xe36e('0x4b')]['id']},{'transaction':_0x25abc5});});})[_0xe36e('0x29')](function(){return BPromise[_0xe36e('0x85')](_0x48e276,function(_0x3bd8e1){return db[_0xe36e('0x88')][_0xe36e('0x89')]({'where':{'UserId':_0x3bd8e1['id'],'VoicePrefixId':_0x1c95cd[_0xe36e('0x4b')]['id']},'transaction':_0x25abc5});});})[_0xe36e('0x29')](function(){_0x48e276['forEach'](function(_0xab0e50){socket['emit'](_0xe36e('0x76'),{'UserId':_0xab0e50['id'],'VoicePrefixId':_0x43f149['id']});});});});});}})[_0xe36e('0x29')](respondWithStatusCode(_0x2b3e81,null))[_0xe36e('0x49')](handleError(_0x2b3e81,null));};exports['removeTeams']=function(_0x3fc054,_0x947053,_0x51c758){return db[_0xe36e('0x7f')]['findAll']({'where':{'id':_0x3fc054[_0xe36e('0x38')][_0xe36e('0x75')]},'attributes':['id'],'include':[{'model':db[_0xe36e('0x7b')],'as':_0xe36e('0x81'),'attributes':['id'],'raw':!![]}]})[_0xe36e('0x29')](handleEntityNotFound(_0x947053,null))[_0xe36e('0x29')](function(_0x257b00){var _0x2056ed=_[_0xe36e('0x2f')](_0x257b00,'id');var _0x31ae71=[];var _0x166c22=[];var _0x47b082=squel['select']();_0x47b082[_0xe36e('0x8a')](_0xe36e('0x8b'))[_0xe36e('0x8c')](_0xe36e('0x8d'),'tq')['join'](_0xe36e('0x8e'),'ut',_0xe36e('0x8f'))['where'](_0xe36e('0x90'),_0x3fc054['params']['id']);for(var _0x260fff=0x0;_0x260fff<_0x257b00[_0xe36e('0x3b')];_0x260fff+=0x1){let _0x27d09b=_0x257b00[_0x260fff];for(var _0x5bc8b1=0x0;_0x5bc8b1<_0x27d09b[_0xe36e('0x81')][_0xe36e('0x3b')];_0x5bc8b1+=0x1){let _0x2e0e12=_0x27d09b[_0xe36e('0x81')][_0x5bc8b1];var _0x7a5d80=_0x47b082[_0xe36e('0x91')]();_0x7a5d80[_0xe36e('0x3f')]('ut.UserId\x20=\x20?',_0x2e0e12['id']);_0x166c22[_0xe36e('0x69')](db[_0xe36e('0x4f')][_0xe36e('0x38')](_0x7a5d80[_0xe36e('0x92')](),{'type':db[_0xe36e('0x4f')][_0xe36e('0x93')][_0xe36e('0x94')]})[_0xe36e('0x29')](function(_0xacc91e){if(_0xacc91e['length']===0x1){return _0x2e0e12['id'];}else{var _0x3e0dc9=_[_0xe36e('0x95')](_['map'](_0xacc91e,'TeamId'),function(_0x546461){return _[_0xe36e('0x96')](_0x2056ed,_0x546461);});if(_0x3e0dc9){return _0x2e0e12['id'];}}}));}}return BPromise[_0xe36e('0x97')](_0x166c22)['then'](function(_0x20208c){_0x31ae71=_(_0x31ae71)['union'](_0x20208c)['compact']()['value']();return db[_0xe36e('0x30')][_0xe36e('0x4c')]({'where':{'id':_0x3fc054['params']['id']}})[_0xe36e('0x29')](function(_0x2c9191){return db['sequelize'][_0xe36e('0x50')](function(_0x15b38e){return _0x2c9191['removeTeams'](_0x3fc054[_0xe36e('0x38')][_0xe36e('0x75')],{'transaction':_0x15b38e})['then'](function(){if(!_['isEmpty'](_0x31ae71)){return _0x2c9191[_0xe36e('0x77')](_0x31ae71,{'transaction':_0x15b38e});}})[_0xe36e('0x29')](function(){_0x31ae71[_0xe36e('0x98')](function(_0x3c7778){socket[_0xe36e('0x78')](_0xe36e('0x79'),{'UserId':_0x3c7778,'VoicePrefixId':_0x2c9191['id']});});});});});});})[_0xe36e('0x29')](respondWithStatusCode(_0x947053,null))[_0xe36e('0x49')](handleError(_0x947053,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index d13e21c..a93356d 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 _0x6784=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x31e455,_0x52e633){var _0x3d09dc=function(_0x38f408){while(--_0x38f408){_0x31e455['push'](_0x31e455['shift']());}};_0x3d09dc(++_0x52e633);}(_0x6784,0x1bf));var _0x4678=function(_0x133277,_0xb1d6b2){_0x133277=_0x133277-0x0;var _0x5b4a22=_0x6784[_0x133277];return _0x5b4a22;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x4678('0x0'))['db'][_0x4678('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x4678('0x2')](0x0);var events={'afterCreate':_0x4678('0x3'),'afterUpdate':_0x4678('0x4'),'afterDestroy':_0x4678('0x5')};function emitEvent(_0x5192e2){return function(_0x1a77fd,_0x2e45ad,_0x5cf5da){VoicePrefixEvents[_0x4678('0x6')](_0x5192e2+':'+_0x1a77fd['id'],_0x1a77fd);VoicePrefixEvents[_0x4678('0x6')](_0x5192e2,_0x1a77fd);_0x5cf5da(null);};}for(var e in events){if(events[_0x4678('0x7')](e)){var event=events[e];VoicePrefix[_0x4678('0x8')](e,emitEvent(event));}}module[_0x4678('0x9')]=VoicePrefixEvents; \ No newline at end of file +var _0x4b2f=['hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x4f1af9,_0xc95c63){var _0x11a60e=function(_0x19de7f){while(--_0x19de7f){_0x4f1af9['push'](_0x4f1af9['shift']());}};_0x11a60e(++_0xc95c63);}(_0x4b2f,0x106));var _0xf4b2=function(_0x44039a,_0x2ac8a8){_0x44039a=_0x44039a-0x0;var _0x525de5=_0x4b2f[_0x44039a];return _0x525de5;};'use strict';var EventEmitter=require(_0xf4b2('0x0'));var VoicePrefix=require(_0xf4b2('0x1'))['db'][_0xf4b2('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xf4b2('0x3')](0x0);var events={'afterCreate':_0xf4b2('0x4'),'afterUpdate':'update','afterDestroy':_0xf4b2('0x5')};function emitEvent(_0x5429a9){return function(_0x3d187b,_0x19e7b4,_0x358630){VoicePrefixEvents[_0xf4b2('0x6')](_0x5429a9+':'+_0x3d187b['id'],_0x3d187b);VoicePrefixEvents['emit'](_0x5429a9,_0x3d187b);_0x358630(null);};}for(var e in events){if(events[_0xf4b2('0x7')](e)){var event=events[e];VoicePrefix[_0xf4b2('0x8')](e,emitEvent(event));}}module[_0xf4b2('0x9')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 2e41bb5..2e1cbf6 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 _0x929c=['../../config/logger','moment','bluebird','path','rimraf','./voicePrefix.attributes','define','VoicePrefix'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x929c,0x118));var _0xc929=function(_0x38d08,_0xb264c1){_0x38d08=_0x38d08-0x0;var _0x428708=_0x929c[_0x38d08];return _0x428708;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc929('0x0'))('api');var moment=require(_0xc929('0x1'));var BPromise=require(_0xc929('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc929('0x3'));var rimraf=require(_0xc929('0x4'));var config=require('../../config/environment');var attributes=require(_0xc929('0x5'));module['exports']=function(_0x1a4ed,_0x3dbf49){return _0x1a4ed[_0xc929('0x6')](_0xc929('0x7'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeae2=['request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','VoicePrefix','util','api','bluebird'];(function(_0x519c2b,_0x734ea){var _0x2abc77=function(_0x530a9d){while(--_0x530a9d){_0x519c2b['push'](_0x519c2b['shift']());}};_0x2abc77(++_0x734ea);}(_0xeae2,0x13d));var _0x2eae=function(_0x2d2acf,_0x44bd65){_0x2d2acf=_0x2d2acf-0x0;var _0x11127f=_0xeae2[_0x2d2acf];return _0x11127f;};'use strict';var _=require('lodash');var util=require(_0x2eae('0x0'));var logger=require('../../config/logger')(_0x2eae('0x1'));var moment=require('moment');var BPromise=require(_0x2eae('0x2'));var rp=require(_0x2eae('0x3'));var fs=require('fs');var path=require(_0x2eae('0x4'));var rimraf=require(_0x2eae('0x5'));var config=require(_0x2eae('0x6'));var attributes=require(_0x2eae('0x7'));module[_0x2eae('0x8')]=function(_0x225216,_0x361287){return _0x225216['define'](_0x2eae('0x9'),attributes,{'tableName':'voice_prefixes','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 d44f695..8295221 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 _0xb091=['stringify','error','message','VoicePrefix,\x20%s,\x20%s','info','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','then','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xb091,0x16e));var _0x1b09=function(_0x72bd79,_0x3d8f32){_0x72bd79=_0x72bd79-0x0;var _0x2ea29c=_0xb091[_0x72bd79];return _0x2ea29c;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var moment=require(_0x1b09('0x1'));var BPromise=require(_0x1b09('0x2'));var rs=require(_0x1b09('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b09('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1b09('0x5'));var config=require(_0x1b09('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1b09('0x7')][_0x1b09('0x8')]({'port':0x232a});config[_0x1b09('0x9')]=_['defaults'](config[_0x1b09('0x9')],{'host':_0x1b09('0xa'),'port':0x18eb});var socket=require(_0x1b09('0xb'))(new Redis(config[_0x1b09('0x9')]));require(_0x1b09('0xc'))[_0x1b09('0xd')](socket);function respondWithRpcPromise(_0x211f05,_0x124d02,_0x3249a1){return new BPromise(function(_0x36aa1b,_0x14dac6){return client['request'](_0x211f05,_0x3249a1)[_0x1b09('0xe')](function(_0x894b73){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x124d02,_0x1b09('0xf'));logger[_0x1b09('0x10')](_0x1b09('0x11'),_0x124d02,_0x1b09('0xf'),JSON[_0x1b09('0x12')](_0x894b73));if(_0x894b73[_0x1b09('0x13')]){if(_0x894b73[_0x1b09('0x13')]['code']===0x1f4){logger[_0x1b09('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x124d02,_0x894b73[_0x1b09('0x13')][_0x1b09('0x14')]);return _0x14dac6(_0x894b73[_0x1b09('0x13')][_0x1b09('0x14')]);}logger[_0x1b09('0x13')](_0x1b09('0x15'),_0x124d02,_0x894b73[_0x1b09('0x13')][_0x1b09('0x14')]);return _0x36aa1b(_0x894b73[_0x1b09('0x13')][_0x1b09('0x14')]);}else{logger[_0x1b09('0x16')](_0x1b09('0x15'),_0x124d02,_0x1b09('0xf'));_0x36aa1b(_0x894b73['result'][_0x1b09('0x14')]);}})[_0x1b09('0x17')](function(_0x5483ef){logger['error'](_0x1b09('0x15'),_0x124d02,_0x5483ef);_0x14dac6(_0x5483ef);});});} \ No newline at end of file +var _0xa5c1=['util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voicePrefix.socket','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x5b2e68,_0x339b1b){var _0x160b72=function(_0x4f1a40){while(--_0x4f1a40){_0x5b2e68['push'](_0x5b2e68['shift']());}};_0x160b72(++_0x339b1b);}(_0xa5c1,0x19f));var _0x1a5c=function(_0x58b1c3,_0x5d1ded){_0x58b1c3=_0x58b1c3-0x0;var _0x1e6f8e=_0xa5c1[_0x58b1c3];return _0x1e6f8e;};'use strict';var _=require(_0x1a5c('0x0'));var util=require(_0x1a5c('0x1'));var moment=require(_0x1a5c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a5c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a5c('0x4'));var logger=require(_0x1a5c('0x5'))(_0x1a5c('0x6'));var config=require(_0x1a5c('0x7'));var jayson=require(_0x1a5c('0x8'));var client=jayson[_0x1a5c('0x9')]['http']({'port':0x232a});config[_0x1a5c('0xa')]=_['defaults'](config[_0x1a5c('0xa')],{'host':_0x1a5c('0xb'),'port':0x18eb});var socket=require(_0x1a5c('0xc'))(new Redis(config['redis']));require(_0x1a5c('0xd'))['register'](socket);function respondWithRpcPromise(_0x211e4b,_0x4edb10,_0x5097cf){return new BPromise(function(_0x1323be,_0x1ac373){return client['request'](_0x211e4b,_0x5097cf)[_0x1a5c('0xe')](function(_0x3f7368){logger[_0x1a5c('0xf')](_0x1a5c('0x10'),_0x4edb10,_0x1a5c('0x11'));logger[_0x1a5c('0x12')](_0x1a5c('0x13'),_0x4edb10,'request\x20sent',JSON[_0x1a5c('0x14')](_0x3f7368));if(_0x3f7368[_0x1a5c('0x15')]){if(_0x3f7368['error'][_0x1a5c('0x16')]===0x1f4){logger[_0x1a5c('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x4edb10,_0x3f7368[_0x1a5c('0x15')][_0x1a5c('0x17')]);return _0x1ac373(_0x3f7368[_0x1a5c('0x15')][_0x1a5c('0x17')]);}logger['error'](_0x1a5c('0x10'),_0x4edb10,_0x3f7368['error'][_0x1a5c('0x17')]);return _0x1323be(_0x3f7368[_0x1a5c('0x15')][_0x1a5c('0x17')]);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x4edb10,_0x1a5c('0x11'));_0x1323be(_0x3f7368[_0x1a5c('0x18')][_0x1a5c('0x17')]);}})[_0x1a5c('0x19')](function(_0x232798){logger['error'](_0x1a5c('0x10'),_0x4edb10,_0x232798);_0x1ac373(_0x232798);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index a5b8ecf..8136acb 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 _0x4345=['save','update','removeListener','register','voicePrefix:','./voicePrefix.events'];(function(_0x3b6ca1,_0x57c344){var _0x598955=function(_0xb88b16){while(--_0xb88b16){_0x3b6ca1['push'](_0x3b6ca1['shift']());}};_0x598955(++_0x57c344);}(_0x4345,0x77));var _0x5434=function(_0x1645d5,_0x2c5610){_0x1645d5=_0x1645d5-0x0;var _0x32750b=_0x4345[_0x1645d5];return _0x32750b;};'use strict';var VoicePrefixEvents=require(_0x5434('0x0'));var events=[_0x5434('0x1'),'remove',_0x5434('0x2')];function createListener(_0x393043,_0x38d317){return function(_0x46df60){_0x38d317['emit'](_0x393043,_0x46df60);};}function removeListener(_0x18b717,_0x4e402c){return function(){VoicePrefixEvents[_0x5434('0x3')](_0x18b717,_0x4e402c);};}exports[_0x5434('0x4')]=function(_0x14d339){for(var _0x5001cc=0x0,_0x1b26fe=events['length'];_0x5001cc<_0x1b26fe;_0x5001cc++){var _0x395e5c=events[_0x5001cc];var _0x457fe8=createListener(_0x5434('0x5')+_0x395e5c,_0x14d339);VoicePrefixEvents['on'](_0x395e5c,_0x457fe8);}}; \ No newline at end of file +var _0x8b1a=['length','voicePrefix:','./voicePrefix.events','save','remove','removeListener','register'];(function(_0x43af2e,_0x1b6991){var _0x39f771=function(_0x3b4b45){while(--_0x3b4b45){_0x43af2e['push'](_0x43af2e['shift']());}};_0x39f771(++_0x1b6991);}(_0x8b1a,0x152));var _0xa8b1=function(_0x1d109b,_0x258f57){_0x1d109b=_0x1d109b-0x0;var _0xa6d98a=_0x8b1a[_0x1d109b];return _0xa6d98a;};'use strict';var VoicePrefixEvents=require(_0xa8b1('0x0'));var events=[_0xa8b1('0x1'),_0xa8b1('0x2'),'update'];function createListener(_0x88101,_0x201783){return function(_0x39eb72){_0x201783['emit'](_0x88101,_0x39eb72);};}function removeListener(_0x353bea,_0x2427cc){return function(){VoicePrefixEvents[_0xa8b1('0x3')](_0x353bea,_0x2427cc);};}exports[_0xa8b1('0x4')]=function(_0x493b8e){for(var _0x90c588=0x0,_0x5db169=events[_0xa8b1('0x5')];_0x90c588<_0x5db169;_0x90c588++){var _0x459cf9=events[_0x90c588];var _0x5d958d=createListener(_0xa8b1('0x6')+_0x459cf9,_0x493b8e);VoicePrefixEvents['on'](_0x459cf9,_0x5d958d);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index fa5e692..e381739 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 _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0xbb0ce8,_0xb63549){var _0x1a1b17=function(_0x171af3){while(--_0x171af3){_0xbb0ce8['push'](_0xbb0ce8['shift']());}};_0x1a1b17(++_0xb63549);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a3553,_0x12e68f){_0x4a3553=_0x4a3553-0x0;var _0x569d42=_0xb10b[_0x4a3553];return _0x569d42;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +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(_0x3c3e68,_0x280a1e){var _0x4f0b42=function(_0xc74161){while(--_0xc74161){_0x3c3e68['push'](_0x3c3e68['shift']());}};_0x4f0b42(++_0x280a1e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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 c30c612..ab4617b 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 _0x371e=['dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#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','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','getDataValue','type','dialMethod','strategy','preview','booked','roundrobin','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','BOOLEAN','Active/Disactive\x20Campaign','progressive','power','predictive','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor'];(function(_0x4f4ef7,_0x11642b){var _0x5e3efc=function(_0x274b04){while(--_0x274b04){_0x4f4ef7['push'](_0x4f4ef7['shift']());}};_0x5e3efc(++_0x11642b);}(_0x371e,0x168));var _0xe371=function(_0x2ff208,_0x48214e){_0x2ff208=_0x2ff208-0x0;var _0xa4a53b=_0x371e[_0x2ff208];return _0xa4a53b;};'use strict';var Sequelize=require(_0xe371('0x0'));module[_0xe371('0x1')]={'name':{'type':Sequelize[_0xe371('0x2')],'allowNull':![],'unique':_0xe371('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xe371('0x4')](_0xe371('0x5'),_0xe371('0x6')),'allowNull':![],'defaultValue':_0xe371('0x5')},'musiconhold':{'type':Sequelize[_0xe371('0x2')],'defaultValue':_0xe371('0x7')},'announce':{'type':Sequelize[_0xe371('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xe371('0x4')]('rr',_0xe371('0x8'),_0xe371('0x9'),_0xe371('0xa'),_0xe371('0xb'),_0xe371('0xc'),_0xe371('0xd'),_0xe371('0xe'),_0xe371('0xf')),'allowNull':![],'defaultValue':_0xe371('0x8'),'set':function(_0x502a3d){this[_0xe371('0x10')]('strategy',_0x502a3d?_0x502a3d:_0xe371('0xc'));},'get':function(){var _0x96e473=this[_0xe371('0x11')](_0xe371('0x12'));var _0xdfc21=this[_0xe371('0x11')](_0xe371('0x13'));var _0x5dbb0c=this[_0xe371('0x11')](_0xe371('0x14'));if(_0x96e473==='outbound'){if(_0xdfc21===_0xe371('0x15')){return null;}if(_0xdfc21===_0xe371('0x16')&&!['rrmemory',_0xe371('0x17')]['includes'](_0x5dbb0c)){this[_0xe371('0x10')](_0xe371('0x14'),_0xe371('0xc'));}}return _0x5dbb0c;}},'servicelevel':{'type':Sequelize[_0xe371('0x18')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xe371('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xe371('0x18')](0xb)},'timeout':{'type':Sequelize[_0xe371('0x18')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xe371('0x18')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xe371('0x2')]},'weight':{'type':Sequelize[_0xe371('0x18')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xe371('0x18')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xe371('0x4')](_0xe371('0x19'),'no'),'defaultValue':_0xe371('0x19')},'autopause':{'type':Sequelize[_0xe371('0x4')](_0xe371('0x19'),'no',_0xe371('0x1a')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xe371('0x18')](0xb)},'autopausebusy':{'type':Sequelize[_0xe371('0x4')](_0xe371('0x19'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xe371('0x4')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xe371('0x4')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xe371('0x4')](_0xe371('0x19'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xe371('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xe371('0x18')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xe371('0x18')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xe371('0x18')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xe371('0x4')](_0xe371('0x19'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xe371('0x4')](_0xe371('0x19'),'no'),'defaultValue':_0xe371('0x19')},'announce_holdtime':{'type':Sequelize['ENUM'](_0xe371('0x19'),'no',_0xe371('0x1b')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xe371('0x4')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xe371('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xe371('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xe371('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xe371('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xe371('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xe371('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xe371('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xe371('0x2')]},'queue_quantity1':{'type':Sequelize[_0xe371('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xe371('0x2')]},'queue_less_than':{'type':Sequelize[_0xe371('0x2')]},'periodic_announce':{'type':Sequelize[_0xe371('0x1c')],'set':function(_0xea196a){this[_0xe371('0x10')](_0xe371('0x1d'),_0xea196a?_0xea196a[_0xe371('0x1e')](','):[]);},'get':function(){return this['getDataValue'](_0xe371('0x1d'))?this[_0xe371('0x11')](_0xe371('0x1d'))[_0xe371('0x1f')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xe371('0x19'),'set':function(_0x17dc1){this[_0xe371('0x10')](_0xe371('0x20'),_0x17dc1?_0x17dc1[_0xe371('0x1e')](','):undefined);},'get':function(){return this[_0xe371('0x11')](_0xe371('0x20'))?this[_0xe371('0x11')](_0xe371('0x20'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x1eb529){this[_0xe371('0x10')](_0xe371('0x21'),_0x1eb529?_0x1eb529[_0xe371('0x1e')](','):undefined);},'get':function(){return this[_0xe371('0x11')](_0xe371('0x21'))?this[_0xe371('0x11')]('leavewhenempty')[_0xe371('0x1f')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xe371('0x4')](_0xe371('0x19'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xe371('0x4')](_0xe371('0x19'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xe371('0x4')](_0xe371('0x19'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xe371('0x2')]},'description':{'type':Sequelize[_0xe371('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x22bc81){this[_0xe371('0x10')](_0xe371('0x22'),_0x22bc81);if(_0x22bc81){if(this[_0xe371('0x11')]('wrapuptime')<0x2){this['setDataValue']('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0xe371('0x18')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xe371('0x23')],'defaultValue':0x0,'comment':_0xe371('0x24')},'dialMethod':{'type':Sequelize[_0xe371('0x4')](_0xe371('0x15'),_0xe371('0x25'),_0xe371('0x26'),_0xe371('0x27'),'booked'),'defaultValue':_0xe371('0x25'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0xe371('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xe371('0x29')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xe371('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0xe371('0x2a')](0x2)[_0xe371('0x28')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xe371('0x2b')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xe371('0x2c'),_0xe371('0x2d')),'defaultValue':_0xe371('0x2d'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xe371('0x2a')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xe371('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0xe371('0x18')](0x3)[_0xe371('0x28')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0xe371('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xe371('0x18')](0x3)[_0xe371('0x28')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe371('0x2f')},'dialQueueOptions':{'type':Sequelize[_0xe371('0x2')],'defaultValue':_0xe371('0x30'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xe371('0x18')](0x3)[_0xe371('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe371('0x31')},'dialQueueProject':{'type':Sequelize[_0xe371('0x2')],'comment':_0xe371('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0xe371('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe371('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe371('0x33')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe371('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0xe371('0x18')](0x5)[_0xe371('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe371('0x28')],'defaultValue':0x3,'comment':_0xe371('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe371('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe371('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0xe371('0x18')](0x3)[_0xe371('0x28')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe371('0x37')},'dialTimezone':{'type':Sequelize[_0xe371('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe371('0x2')],'defaultValue':_0xe371('0x38')},'dialPrefix':{'type':Sequelize[_0xe371('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xe371('0x4')]('always','never','onlyIfOpen'),'defaultValue':_0xe371('0x39')},'dialAMDActive':{'type':Sequelize[_0xe371('0x23')],'defaultValue':0x0,'comment':_0xe371('0x3a')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xe371('0x28')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xe371('0x18')](0x9)[_0xe371('0x28')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe371('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe371('0x18')](0x9)[_0xe371('0x28')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe371('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe371('0x18')](0x9)[_0xe371('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe371('0x3d')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe371('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xe371('0x28')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xe371('0x28')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe371('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe371('0x18')](0x5)[_0xe371('0x28')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe371('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe371('0x18')](0x9)[_0xe371('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe371('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0xe371('0x18')](0x5)[_0xe371('0x28')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xe371('0x42')},'dialRecallInQueue':{'type':Sequelize[_0xe371('0x23')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xe371('0x4')]('DESC',_0xe371('0x43')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xe371('0x2')],'comment':_0xe371('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xe371('0x23')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xe371('0x23')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xe371('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe371('0x44')},'dialCutDigit':{'type':Sequelize[_0xe371('0x18')](0x3)[_0xe371('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe371('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe371('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe371('0x47')},'dialDropMaxRetry':{'type':Sequelize[_0xe371('0x18')](0x3)[_0xe371('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xe371('0x18')](0x5)[_0xe371('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe371('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe371('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe371('0x18')](0x5)[_0xe371('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe371('0x49')},'dialMachineMaxRetry':{'type':Sequelize[_0xe371('0x18')](0x3)[_0xe371('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xe371('0x18')](0x5)[_0xe371('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe371('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe371('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe371('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xe371('0x18')](0x5)[_0xe371('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe371('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xe371('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0xe371('0x23')],'defaultValue':![],'comment':_0xe371('0x4e'),'set':function(_0x219735){if(!_0x219735)this['setDataValue'](_0xe371('0x4f'),null);this[_0xe371('0x10')](_0xe371('0x50'),_0x219735);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xe371('0x28')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xe371('0x18')](0x3)[_0xe371('0x28')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0xe371('0x28')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xe371('0x23')],'defaultValue':![]}}; \ No newline at end of file +var _0xee93=['Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\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)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','outbound','inbound','default','ENUM','ringall','leastrecent','fewestcalls','rrmemory','linear','wrandom','rrordered','strategy','getDataValue','type','dialMethod','preview','booked','roundrobin','includes','INTEGER','yes','all','TEXT','periodic_announce','join','split','setDataValue','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate'];(function(_0x191cdc,_0x140a9d){var _0x4e53e3=function(_0x14c7a0){while(--_0x14c7a0){_0x191cdc['push'](_0x191cdc['shift']());}};_0x4e53e3(++_0x140a9d);}(_0xee93,0x78));var _0x3ee9=function(_0x57ce61,_0x40a9e9){_0x57ce61=_0x57ce61-0x0;var _0x1b17ee=_0xee93[_0x57ce61];return _0x1b17ee;};'use strict';var Sequelize=require(_0x3ee9('0x0'));module[_0x3ee9('0x1')]={'name':{'type':Sequelize[_0x3ee9('0x2')],'allowNull':![],'unique':_0x3ee9('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0x3ee9('0x4')),'allowNull':![],'defaultValue':_0x3ee9('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x3ee9('0x6')},'announce':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x3ee9('0x7')]('rr',_0x3ee9('0x8'),_0x3ee9('0x9'),_0x3ee9('0xa'),'random',_0x3ee9('0xb'),_0x3ee9('0xc'),_0x3ee9('0xd'),_0x3ee9('0xe')),'allowNull':![],'defaultValue':_0x3ee9('0x8'),'set':function(_0x4a7756){this['setDataValue'](_0x3ee9('0xf'),_0x4a7756?_0x4a7756:_0x3ee9('0xb'));},'get':function(){var _0x32ec3b=this[_0x3ee9('0x10')](_0x3ee9('0x11'));var _0x40dc2b=this['getDataValue'](_0x3ee9('0x12'));var _0x28a585=this['getDataValue'](_0x3ee9('0xf'));if(_0x32ec3b==='outbound'){if(_0x40dc2b===_0x3ee9('0x13')){return null;}if(_0x40dc2b===_0x3ee9('0x14')&&!['rrmemory',_0x3ee9('0x15')][_0x3ee9('0x16')](_0x28a585)){this['setDataValue'](_0x3ee9('0xf'),_0x3ee9('0xb'));}}return _0x28a585;}},'servicelevel':{'type':Sequelize[_0x3ee9('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x3ee9('0x17')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x3ee9('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x3ee9('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x3ee9('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x3ee9('0x7')](_0x3ee9('0x18'),'no'),'defaultValue':_0x3ee9('0x18')},'autopause':{'type':Sequelize[_0x3ee9('0x7')](_0x3ee9('0x18'),'no',_0x3ee9('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x3ee9('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x3ee9('0x7')](_0x3ee9('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x3ee9('0x7')](_0x3ee9('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x3ee9('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x3ee9('0x7')](_0x3ee9('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x3ee9('0x7')](_0x3ee9('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x3ee9('0x7')](_0x3ee9('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x3ee9('0x7')](_0x3ee9('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x3ee9('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x3ee9('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x3ee9('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x3ee9('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x3ee9('0x7')]('yes','no'),'defaultValue':_0x3ee9('0x18')},'announce_holdtime':{'type':Sequelize[_0x3ee9('0x7')]('yes','no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x3ee9('0x7')](_0x3ee9('0x18'),'no')},'announce_position_limit':{'type':Sequelize[_0x3ee9('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x3ee9('0x7')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x3ee9('0x2')]},'queue_youarenext':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x3ee9('0x2')]},'queue_quantity2':{'type':Sequelize[_0x3ee9('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x3ee9('0x2')]},'queue_less_than':{'type':Sequelize[_0x3ee9('0x2')]},'periodic_announce':{'type':Sequelize[_0x3ee9('0x1a')],'set':function(_0x1c8150){this['setDataValue'](_0x3ee9('0x1b'),_0x1c8150?_0x1c8150[_0x3ee9('0x1c')](','):[]);},'get':function(){return this[_0x3ee9('0x10')](_0x3ee9('0x1b'))?this[_0x3ee9('0x10')](_0x3ee9('0x1b'))[_0x3ee9('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':_0x3ee9('0x18'),'set':function(_0x179271){this[_0x3ee9('0x1e')](_0x3ee9('0x1f'),_0x179271?_0x179271[_0x3ee9('0x1c')](','):undefined);},'get':function(){return this[_0x3ee9('0x10')](_0x3ee9('0x1f'))?this[_0x3ee9('0x10')](_0x3ee9('0x1f'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':'no','set':function(_0x214819){this[_0x3ee9('0x1e')](_0x3ee9('0x20'),_0x214819?_0x214819[_0x3ee9('0x1c')](','):undefined);},'get':function(){return this['getDataValue']('leavewhenempty')?this[_0x3ee9('0x10')](_0x3ee9('0x20'))[_0x3ee9('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x3ee9('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x3ee9('0x7')](_0x3ee9('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x3ee9('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x3ee9('0x2')]},'description':{'type':Sequelize[_0x3ee9('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x324e1f){this[_0x3ee9('0x1e')](_0x3ee9('0x21'),_0x324e1f);if(_0x324e1f){if(this[_0x3ee9('0x10')](_0x3ee9('0x22'))<0x2){this['setDataValue'](_0x3ee9('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x3ee9('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x3ee9('0x23')],'defaultValue':0x0,'comment':_0x3ee9('0x24')},'dialMethod':{'type':Sequelize['ENUM'](_0x3ee9('0x13'),'progressive','power','predictive',_0x3ee9('0x14')),'defaultValue':_0x3ee9('0x25'),'comment':_0x3ee9('0x26')},'dialLimitChannel':{'type':Sequelize[_0x3ee9('0x17')](0x4)[_0x3ee9('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3ee9('0x28')},'dialLimitQueue':{'type':Sequelize[_0x3ee9('0x17')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3ee9('0x29')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x3ee9('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x3ee9('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x3ee9('0x7')]('agentBusyFactor',_0x3ee9('0x2b')),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x3ee9('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x3ee9('0x17')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x3ee9('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x3ee9('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x3ee9('0x17')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ee9('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':'tTxX','comment':_0x3ee9('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x3ee9('0x17')](0x3)[_0x3ee9('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ee9('0x2f')},'dialQueueProject':{'type':Sequelize[_0x3ee9('0x2')],'comment':_0x3ee9('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0x3ee9('0x17')](0x3)[_0x3ee9('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ee9('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3ee9('0x17')](0x5)[_0x3ee9('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ee9('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0x3ee9('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x3ee9('0x17')](0x5)[_0x3ee9('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ee9('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3ee9('0x17')](0x3)[_0x3ee9('0x27')],'defaultValue':0x3,'comment':_0x3ee9('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3ee9('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x3ee9('0x17')](0x3)[_0x3ee9('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':_0x3ee9('0x35')},'dialPrefix':{'type':Sequelize[_0x3ee9('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x3ee9('0x36'),_0x3ee9('0x37'),'onlyIfOpen'),'defaultValue':_0x3ee9('0x36')},'dialAMDActive':{'type':Sequelize[_0x3ee9('0x23')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x3ee9('0x17')](0x9)[_0x3ee9('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x3ee9('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3ee9('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3ee9('0x17')](0x9)[_0x3ee9('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x3ee9('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3ee9('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0x3ee9('0x17')](0x9)[_0x3ee9('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3ee9('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x3ee9('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3ee9('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3ee9('0x17')](0x9)[_0x3ee9('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3ee9('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3ee9('0x17')](0x5)[_0x3ee9('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3ee9('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3ee9('0x17')](0x9)[_0x3ee9('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3ee9('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x3ee9('0x17')](0x5)[_0x3ee9('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x3ee9('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x3ee9('0x23')],'defaultValue':0x0,'comment':_0x3ee9('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0x3ee9('0x7')](_0x3ee9('0x41'),_0x3ee9('0x42')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x3ee9('0x2')],'comment':_0x3ee9('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x3ee9('0x23')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x3ee9('0x23')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3ee9('0x43')},'dialCutDigit':{'type':Sequelize[_0x3ee9('0x17')](0x3)[_0x3ee9('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3ee9('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3ee9('0x17')](0x3)[_0x3ee9('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3ee9('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ee9('0x45')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3ee9('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ee9('0x46')},'dialDropRetryFrequency':{'type':Sequelize[_0x3ee9('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ee9('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3ee9('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ee9('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ee9('0x49')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ee9('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize[_0x3ee9('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ee9('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x3ee9('0x17')](0x3)[_0x3ee9('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ee9('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x3ee9('0x17')](0x5)[_0x3ee9('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ee9('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x3ee9('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x3ee9('0x23')],'defaultValue':![],'comment':_0x3ee9('0x4f'),'set':function(_0x564a0e){if(!_0x564a0e)this[_0x3ee9('0x1e')](_0x3ee9('0x50'),null);this[_0x3ee9('0x1e')](_0x3ee9('0x51'),_0x564a0e);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x3ee9('0x17')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x3ee9('0x17')](0x3)[_0x3ee9('0x27')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x3ee9('0x23')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x3ee9('0x17')](0x3)['UNSIGNED'],'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 59cb171..a3df850 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 _0x7c1a=['inbound','outbound','filter','ignore','map','value','includes','type','name','UserProfileResource','error','stack','send','index','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','VoiceQueue','findAll','rows','catch','show','params','rawAttributes','body','user','get','role','QueueCampaigns','find','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','userProfileId','autoAssociation','getHoppers','findOne','CmHopper','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','Agents','online','flatMap','forEach','penalty','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','interface','SIP/%s','voicePause','userVoiceQueue:save','removeTeams','ids','User','select','field','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','QueryTypes','SELECT','every','TeamId','all','compact','userVoiceQueue:remove','addAgents','spread','emit','push','isNil','format','removeAgents','isArray','getAgents','getMembers','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','insert','into','phone','scheduledAt','ContactId','ListId','CmListId','cm_contacts','ListId\x20=\x20?','toString','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','fromQuery','deletedAt\x20IS\x20NULL','OrderBy','h.id','ci.item','ci.OrderBy+1','h.ContactId=ci.CmContactId','h.scheduledat=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','destroy','then','VoiceQueues'];(function(_0x5bed13,_0x14f5ab){var _0x4aa52c=function(_0x39726f){while(--_0x39726f){_0x5bed13['push'](_0x5bed13['shift']());}};_0x4aa52c(++_0x14f5ab);}(_0x7c1a,0x159));var _0xa7c1=function(_0x2393f2,_0x34f0d3){_0x2393f2=_0x2393f2-0x0;var _0x157435=_0x7c1a[_0x2393f2];return _0x157435;};'use strict';var emlformat=require(_0xa7c1('0x0'));var rimraf=require(_0xa7c1('0x1'));var zipdir=require(_0xa7c1('0x2'));var jsonpatch=require(_0xa7c1('0x3'));var rp=require(_0xa7c1('0x4'));var moment=require(_0xa7c1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa7c1('0x6'));var util=require(_0xa7c1('0x7'));var path=require('path');var sox=require(_0xa7c1('0x8'));var csv=require('to-csv');var ejs=require(_0xa7c1('0x9'));var fs=require('fs');var fs_extra=require(_0xa7c1('0xa'));var _=require(_0xa7c1('0xb'));var squel=require(_0xa7c1('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa7c1('0xd'));var toCsv=require(_0xa7c1('0xe'));var querystring=require(_0xa7c1('0xf'));var Papa=require('papaparse');var Redis=require(_0xa7c1('0x10'));var authService=require(_0xa7c1('0x11'));var qs=require(_0xa7c1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa7c1('0x13'));var logger=require(_0xa7c1('0x14'))('api');var utils=require(_0xa7c1('0x15'));var config=require(_0xa7c1('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa7c1('0x17'))['db'];config[_0xa7c1('0x18')]=_[_0xa7c1('0x19')](config[_0xa7c1('0x18')],{'host':_0xa7c1('0x1a'),'port':0x18eb});var socket=require(_0xa7c1('0x1b'))(new Redis(config[_0xa7c1('0x18')]));require(_0xa7c1('0x1c'))[_0xa7c1('0x1d')](socket);function respondWithStatusCode(_0x21ce41,_0x3a4284){_0x3a4284=_0x3a4284||0xcc;return function(_0x30b538){if(_0x30b538){return _0x21ce41[_0xa7c1('0x1e')](_0x3a4284);}return _0x21ce41['status'](_0x3a4284)[_0xa7c1('0x1f')]();};}function respondWithResult(_0x3a6f47,_0x1790c3){_0x1790c3=_0x1790c3||0xc8;return function(_0x1ca843){if(_0x1ca843){return _0x3a6f47[_0xa7c1('0x20')](_0x1790c3)['json'](_0x1ca843);}};}function respondWithFilteredResult(_0x3b77af,_0x554f08){return function(_0x440251){if(_0x440251){var _0x337db4=typeof _0x554f08['offset']===_0xa7c1('0x21')&&typeof _0x554f08[_0xa7c1('0x22')]===_0xa7c1('0x21');var _0x5d3841=_0x440251[_0xa7c1('0x23')];var _0x81396e=_0x337db4?0x0:_0x554f08[_0xa7c1('0x24')];var _0x422447=_0x337db4?_0x440251[_0xa7c1('0x23')]:_0x554f08[_0xa7c1('0x24')]+_0x554f08[_0xa7c1('0x22')];var _0xdfcbd9;if(_0x422447>=_0x5d3841){_0x422447=_0x5d3841;_0xdfcbd9=0xc8;}else{_0xdfcbd9=0xce;}_0x3b77af[_0xa7c1('0x20')](_0xdfcbd9);return _0x3b77af['set'](_0xa7c1('0x25'),_0x81396e+'-'+_0x422447+'/'+_0x5d3841)[_0xa7c1('0x26')](_0x440251);}return null;};}function patchUpdates(_0x1ebcdd){return function(_0x5be37a){try{jsonpatch[_0xa7c1('0x27')](_0x5be37a,_0x1ebcdd,!![]);}catch(_0x7dbe77){return BPromise[_0xa7c1('0x28')](_0x7dbe77);}return _0x5be37a[_0xa7c1('0x29')]();};}function saveUpdates(_0x30cb15,_0x37da75){return function(_0x3c9866){if(_0x3c9866){return _0x3c9866['update'](_0x30cb15)['then'](function(_0x48280a){return _0x48280a;});}return null;};}function removeEntity(_0x1ea97e,_0x40c478){return function(_0xd17267){if(_0xd17267){return _0xd17267[_0xa7c1('0x2a')]()[_0xa7c1('0x2b')](function(){var _0x5d62cb=_0xd17267['get']({'plain':!![]});var _0x465dd1=[{'name':_0xa7c1('0x2c'),'value':_0xa7c1('0x2d'),'ignore':![]},{'name':'QueueCampaigns','value':_0xa7c1('0x2e'),'ignore':![]}];var _0x9a6f55=_(_0x465dd1)[_0xa7c1('0x2f')](_0xa7c1('0x30'))[_0xa7c1('0x31')](_0xa7c1('0x32'))[_0xa7c1('0x32')]();if(_[_0xa7c1('0x33')](_0x9a6f55,_0x5d62cb[_0xa7c1('0x34')])){return;}var _0x197bdc=_['find'](_0x465dd1,[_0xa7c1('0x32'),_0x5d62cb[_0xa7c1('0x34')]])[_0xa7c1('0x35')];return db[_0xa7c1('0x36')][_0xa7c1('0x2a')]({'where':{'type':_0x197bdc,'resourceId':_0x5d62cb['id']}})[_0xa7c1('0x2b')](function(){return _0xd17267;});})[_0xa7c1('0x2b')](function(){_0x1ea97e[_0xa7c1('0x20')](0xcc)[_0xa7c1('0x1f')]();});}};}function handleEntityNotFound(_0x5ab57b,_0x1dc174){return function(_0x97bc0d){if(!_0x97bc0d){_0x5ab57b[_0xa7c1('0x1e')](0x194);}return _0x97bc0d;};}function handleError(_0x27feee,_0x56d94c){_0x56d94c=_0x56d94c||0x1f4;return function(_0x5c8956){logger[_0xa7c1('0x37')](_0x5c8956[_0xa7c1('0x38')]);if(_0x5c8956[_0xa7c1('0x35')]){delete _0x5c8956['name'];}_0x27feee['status'](_0x56d94c)[_0xa7c1('0x39')](_0x5c8956);};}exports[_0xa7c1('0x3a')]=function(_0x5182ca,_0x1dc655){var _0x55e4e0={},_0x2c1569={},_0x55b3ea={'count':0x0,'rows':[]};var _0x46bdb1=_[_0xa7c1('0x31')](db['VoiceQueue']['rawAttributes'],function(_0x1a7261){return{'name':_0x1a7261[_0xa7c1('0x3b')],'type':_0x1a7261[_0xa7c1('0x34')][_0xa7c1('0x3c')]};});_0x2c1569[_0xa7c1('0x3d')]=_[_0xa7c1('0x31')](_0x46bdb1,_0xa7c1('0x35'));_0x2c1569['query']=_[_0xa7c1('0x3e')](_0x5182ca[_0xa7c1('0x3f')]);_0x2c1569[_0xa7c1('0x40')]=_[_0xa7c1('0x41')](_0x2c1569[_0xa7c1('0x3d')],_0x2c1569[_0xa7c1('0x3f')]);_0x55e4e0['attributes']=_[_0xa7c1('0x41')](_0x2c1569[_0xa7c1('0x3d')],qs[_0xa7c1('0x42')](_0x5182ca[_0xa7c1('0x3f')][_0xa7c1('0x42')]));_0x55e4e0[_0xa7c1('0x43')]=_0x55e4e0[_0xa7c1('0x43')][_0xa7c1('0x44')]?_0x55e4e0['attributes']:_0x2c1569[_0xa7c1('0x3d')];if(!_0x5182ca[_0xa7c1('0x3f')][_0xa7c1('0x45')](_0xa7c1('0x46'))){_0x55e4e0[_0xa7c1('0x22')]=qs[_0xa7c1('0x22')](_0x5182ca[_0xa7c1('0x3f')][_0xa7c1('0x22')]);_0x55e4e0[_0xa7c1('0x24')]=qs[_0xa7c1('0x24')](_0x5182ca[_0xa7c1('0x3f')][_0xa7c1('0x24')]);}_0x55e4e0[_0xa7c1('0x47')]=qs[_0xa7c1('0x48')](_0x5182ca[_0xa7c1('0x3f')][_0xa7c1('0x48')]);_0x55e4e0[_0xa7c1('0x49')]=qs['filters'](_[_0xa7c1('0x4a')](_0x5182ca[_0xa7c1('0x3f')],_0x2c1569['filters']),_0x46bdb1);if(_0x5182ca[_0xa7c1('0x3f')][_0xa7c1('0x2f')]){_0x55e4e0[_0xa7c1('0x49')]=_[_0xa7c1('0x4b')](_0x55e4e0['where'],{'$or':_[_0xa7c1('0x31')](_0x46bdb1,function(_0x4f6acf){if(_0x4f6acf['type']!==_0xa7c1('0x4c')){var _0x1d131e={};_0x1d131e[_0x4f6acf[_0xa7c1('0x35')]]={'$like':'%'+_0x5182ca[_0xa7c1('0x3f')][_0xa7c1('0x2f')]+'%'};return _0x1d131e;}})});}_0x55e4e0=_['merge']({},_0x55e4e0,_0x5182ca[_0xa7c1('0x4d')]);var _0xf2a7b0={'where':_0x55e4e0[_0xa7c1('0x49')]};return db['VoiceQueue']['count'](_0xf2a7b0)[_0xa7c1('0x2b')](function(_0x2e3f75){_0x55b3ea['count']=_0x2e3f75;if(_0x5182ca[_0xa7c1('0x3f')][_0xa7c1('0x4e')]){_0x55e4e0[_0xa7c1('0x4f')]=[{'all':!![]}];}return db[_0xa7c1('0x50')][_0xa7c1('0x51')](_0x55e4e0);})['then'](function(_0x404362){_0x55b3ea[_0xa7c1('0x52')]=_0x404362;return _0x55b3ea;})[_0xa7c1('0x2b')](respondWithFilteredResult(_0x1dc655,_0x55e4e0))[_0xa7c1('0x53')](handleError(_0x1dc655,null));};exports[_0xa7c1('0x54')]=function(_0x4c3c0a,_0x3a274d){var _0x96b8a0={'raw':![],'where':{'id':_0x4c3c0a[_0xa7c1('0x55')]['id']}},_0x609ac3={};_0x609ac3[_0xa7c1('0x3d')]=_[_0xa7c1('0x3e')](db['VoiceQueue'][_0xa7c1('0x56')]);_0x609ac3[_0xa7c1('0x3f')]=_[_0xa7c1('0x3e')](_0x4c3c0a[_0xa7c1('0x3f')]);_0x609ac3['filters']=_['intersection'](_0x609ac3[_0xa7c1('0x3d')],_0x609ac3['query']);_0x96b8a0[_0xa7c1('0x43')]=_[_0xa7c1('0x41')](_0x609ac3[_0xa7c1('0x3d')],qs['fields'](_0x4c3c0a[_0xa7c1('0x3f')][_0xa7c1('0x42')]));_0x96b8a0['attributes']=_0x96b8a0['attributes'][_0xa7c1('0x44')]?_0x96b8a0[_0xa7c1('0x43')]:_0x609ac3[_0xa7c1('0x3d')];if(_0x4c3c0a['query'][_0xa7c1('0x4e')]){_0x96b8a0[_0xa7c1('0x4f')]=[{'all':!![]}];}_0x96b8a0=_[_0xa7c1('0x4b')]({},_0x96b8a0,_0x4c3c0a[_0xa7c1('0x4d')]);return db[_0xa7c1('0x50')]['find'](_0x96b8a0)['then'](handleEntityNotFound(_0x3a274d,null))[_0xa7c1('0x2b')](respondWithResult(_0x3a274d,null))[_0xa7c1('0x53')](handleError(_0x3a274d,null));};exports['create']=function(_0x4b8aaf,_0x183182){return db[_0xa7c1('0x50')]['create'](_0x4b8aaf[_0xa7c1('0x57')],{})['then'](function(_0x598587){var _0x40feb=_0x4b8aaf[_0xa7c1('0x58')][_0xa7c1('0x59')]({'plain':!![]});if(!_0x40feb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40feb[_0xa7c1('0x5a')]==='user'){var _0x2169f1=_0x598587[_0xa7c1('0x59')]({'plain':!![]});var _0x544d16=[{'name':_0xa7c1('0x2c'),'value':'inbound'},{'name':_0xa7c1('0x5b'),'value':_0xa7c1('0x2e')}];var _0x4e22bf=_[_0xa7c1('0x5c')](_0x544d16,['value',_0x2169f1[_0xa7c1('0x34')]])[_0xa7c1('0x35')];return db[_0xa7c1('0x5d')][_0xa7c1('0x5c')]({'where':{'name':_0x4e22bf,'userProfileId':_0x40feb['userProfileId']},'raw':!![]})[_0xa7c1('0x2b')](function(_0x1af57d){if(_0x1af57d&&_0x1af57d['autoAssociation']===0x0){return db['UserProfileResource'][_0xa7c1('0x5e')]({'name':_0x2169f1[_0xa7c1('0x35')],'resourceId':_0x2169f1['id'],'type':_0x1af57d[_0xa7c1('0x35')],'sectionId':_0x1af57d['id']},{})[_0xa7c1('0x2b')](function(){return _0x598587;});}else{return _0x598587;}})[_0xa7c1('0x53')](function(_0x402088){logger[_0xa7c1('0x37')](_0xa7c1('0x5f'),_0x402088);throw _0x402088;});}return _0x598587;})[_0xa7c1('0x2b')](respondWithResult(_0x183182,0xc9))['catch'](handleError(_0x183182,null));};exports[_0xa7c1('0x60')]=function(_0x1b6d5e,_0x409d97){var _0x269319={'where':{'id':_0x1b6d5e[_0xa7c1('0x55')]['id']}},_0x4d71dd={};_0x4d71dd['model']=_['keys'](db[_0xa7c1('0x50')][_0xa7c1('0x56')]);_0x269319[_0xa7c1('0x43')]=_[_0xa7c1('0x41')](_0x4d71dd[_0xa7c1('0x3d')],qs[_0xa7c1('0x42')](_0x1b6d5e[_0xa7c1('0x3f')][_0xa7c1('0x42')]));_0x269319[_0xa7c1('0x43')]=_0x269319[_0xa7c1('0x43')]['length']?_0x269319[_0xa7c1('0x43')]:_0x4d71dd[_0xa7c1('0x3d')];if(_0x1b6d5e[_0xa7c1('0x3f')]['includeAll']){_0x269319[_0xa7c1('0x4f')]=[{'all':!![]}];}_0x269319=_['merge']({},_0x269319,_0x1b6d5e['options']);return db[_0xa7c1('0x50')][_0xa7c1('0x5c')](_0x269319)[_0xa7c1('0x2b')](handleEntityNotFound(_0x409d97,null))[_0xa7c1('0x2b')](function(_0x17cab1){if(_0x17cab1){var _0x2d9468=_0x17cab1['get']({'plain':!![]});_0x2d9468=qs['omit'](_0x2d9468,['id',_0xa7c1('0x61'),_0xa7c1('0x62')]);_0x1b6d5e['body']=_[_0xa7c1('0x63')](_0x1b6d5e['body'],['id',_0xa7c1('0x61'),_0xa7c1('0x62')]);return db[_0xa7c1('0x50')][_0xa7c1('0x5e')](_[_0xa7c1('0x4b')](_0x2d9468,_0x1b6d5e['body']),{'include':_0x1b6d5e['query'][_0xa7c1('0x4e')]?[{'all':!![]}]:undefined})[_0xa7c1('0x2b')](function(_0x44886e){var _0x1012d3=_0x1b6d5e['user'][_0xa7c1('0x59')]({'plain':!![]});if(!_0x1012d3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1012d3[_0xa7c1('0x5a')]===_0xa7c1('0x58')){var _0x3b0f9c=_0x44886e[_0xa7c1('0x59')]({'plain':!![]});var _0x45585e=[{'name':_0xa7c1('0x2c'),'value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x266f20=_[_0xa7c1('0x5c')](_0x45585e,[_0xa7c1('0x32'),_0x3b0f9c[_0xa7c1('0x34')]])[_0xa7c1('0x35')];return db[_0xa7c1('0x5d')][_0xa7c1('0x5c')]({'where':{'name':_0x266f20,'userProfileId':_0x1012d3[_0xa7c1('0x64')]},'raw':!![]})[_0xa7c1('0x2b')](function(_0x228753){if(_0x228753&&_0x228753[_0xa7c1('0x65')]===0x0){return db[_0xa7c1('0x36')][_0xa7c1('0x5e')]({'name':_0x3b0f9c[_0xa7c1('0x35')],'resourceId':_0x3b0f9c['id'],'type':_0x228753[_0xa7c1('0x35')],'sectionId':_0x228753['id']},{})[_0xa7c1('0x2b')](function(){return _0x44886e;});}else{return _0x44886e;}})['catch'](function(_0xbd5784){logger['error'](_0xa7c1('0x5f'),_0xbd5784);throw _0xbd5784;});}return _0x44886e;});}})[_0xa7c1('0x2b')](respondWithResult(_0x409d97,0xc9))['catch'](handleError(_0x409d97,null));};exports['update']=function(_0x1d4671,_0x9cf732){if(_0x1d4671[_0xa7c1('0x57')]['id']){delete _0x1d4671[_0xa7c1('0x57')]['id'];}return db[_0xa7c1('0x50')][_0xa7c1('0x5c')]({'where':{'id':_0x1d4671[_0xa7c1('0x55')]['id']}})['then'](handleEntityNotFound(_0x9cf732,null))['then'](saveUpdates(_0x1d4671[_0xa7c1('0x57')],null))[_0xa7c1('0x2b')](respondWithResult(_0x9cf732,null))[_0xa7c1('0x53')](handleError(_0x9cf732,null));};exports[_0xa7c1('0x2a')]=function(_0x43bb79,_0x5af423){return db[_0xa7c1('0x50')][_0xa7c1('0x5c')]({'where':{'id':_0x43bb79[_0xa7c1('0x55')]['id']}})['then'](handleEntityNotFound(_0x5af423,null))[_0xa7c1('0x2b')](removeEntity(_0x5af423,null))['catch'](handleError(_0x5af423,null));};exports[_0xa7c1('0x66')]=function(_0x48393b,_0x5cfbc3,_0x24a032){var _0x49d606={'raw':![],'where':{}};var _0x37ab5f={};var _0x2a1ed6={'count':0x0,'rows':[]};return db[_0xa7c1('0x50')][_0xa7c1('0x67')]({'where':{'id':_0x48393b['params']['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x5cfbc3,null))[_0xa7c1('0x2b')](function(_0x2f42e3){if(_0x2f42e3){_0x37ab5f[_0xa7c1('0x3d')]=_[_0xa7c1('0x3e')](db[_0xa7c1('0x68')][_0xa7c1('0x56')]);_0x37ab5f[_0xa7c1('0x3f')]=_[_0xa7c1('0x3e')](_0x48393b[_0xa7c1('0x3f')]);_0x37ab5f['filters']=_['intersection'](_0x37ab5f['model'],_0x37ab5f['query']);_0x49d606['attributes']=_[_0xa7c1('0x41')](_0x37ab5f[_0xa7c1('0x3d')],qs[_0xa7c1('0x42')](_0x48393b[_0xa7c1('0x3f')]['fields']));_0x49d606[_0xa7c1('0x43')]=_0x49d606['attributes'][_0xa7c1('0x44')]?_0x49d606[_0xa7c1('0x43')]:_0x37ab5f[_0xa7c1('0x3d')];if(!_0x48393b[_0xa7c1('0x3f')][_0xa7c1('0x45')](_0xa7c1('0x46'))){_0x49d606[_0xa7c1('0x22')]=qs[_0xa7c1('0x22')](_0x48393b[_0xa7c1('0x3f')][_0xa7c1('0x22')]);_0x49d606[_0xa7c1('0x24')]=qs[_0xa7c1('0x24')](_0x48393b[_0xa7c1('0x3f')][_0xa7c1('0x24')]);}_0x49d606[_0xa7c1('0x47')]=qs[_0xa7c1('0x48')](_0x48393b['query']['sort']);_0x49d606[_0xa7c1('0x49')]=qs[_0xa7c1('0x40')](_[_0xa7c1('0x4a')](_0x48393b[_0xa7c1('0x3f')],_0x37ab5f[_0xa7c1('0x40')]));_0x49d606['where']['VoiceQueueId']=_0x2f42e3['id'];if(_0x48393b[_0xa7c1('0x3f')]['filter']){_0x49d606[_0xa7c1('0x49')]=_[_0xa7c1('0x4b')](_0x49d606[_0xa7c1('0x49')],{'$or':_['map'](_0x49d606[_0xa7c1('0x43')],function(_0x3f53e9){var _0x5c02d0={};_0x5c02d0[_0x3f53e9]={'$like':'%'+_0x48393b[_0xa7c1('0x3f')][_0xa7c1('0x2f')]+'%'};return _0x5c02d0;})});}_0x49d606=_[_0xa7c1('0x4b')]({},_0x49d606,_0x48393b[_0xa7c1('0x4d')]);return db[_0xa7c1('0x68')][_0xa7c1('0x23')]({'where':_0x49d606[_0xa7c1('0x49')]})['then'](function(_0x5cdb1d){_0x2a1ed6[_0xa7c1('0x23')]=_0x5cdb1d;if(_0x48393b[_0xa7c1('0x3f')]['includeAll']){_0x49d606[_0xa7c1('0x4f')]=[{'all':!![]}];}return db[_0xa7c1('0x68')][_0xa7c1('0x51')](_0x49d606);})[_0xa7c1('0x2b')](function(_0x395114){_0x2a1ed6[_0xa7c1('0x52')]=_0x395114;return _0x2a1ed6;});}})['then'](respondWithFilteredResult(_0x5cfbc3,_0x49d606))[_0xa7c1('0x53')](handleError(_0x5cfbc3,null));};exports['getHopperHistories']=function(_0x2d700f,_0x29ecf4,_0xc23dde){var _0xd1f7b1={'raw':!![],'where':{}};var _0x5e5a62={};var _0x4ecdaa={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xa7c1('0x67')]({'where':{'id':_0x2d700f[_0xa7c1('0x55')]['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x29ecf4,null))[_0xa7c1('0x2b')](function(_0x1f1de1){if(_0x1f1de1){_0x5e5a62[_0xa7c1('0x3d')]=_['keys'](db[_0xa7c1('0x69')]['rawAttributes']);_0x5e5a62['query']=_[_0xa7c1('0x3e')](_0x2d700f[_0xa7c1('0x3f')]);_0x5e5a62[_0xa7c1('0x40')]=_[_0xa7c1('0x41')](_0x5e5a62['model'],_0x5e5a62[_0xa7c1('0x3f')]);_0xd1f7b1[_0xa7c1('0x43')]=_[_0xa7c1('0x41')](_0x5e5a62[_0xa7c1('0x3d')],qs['fields'](_0x2d700f[_0xa7c1('0x3f')][_0xa7c1('0x42')]));_0xd1f7b1['attributes']=_0xd1f7b1[_0xa7c1('0x43')][_0xa7c1('0x44')]?_0xd1f7b1[_0xa7c1('0x43')]:_0x5e5a62[_0xa7c1('0x3d')];if(!_0x2d700f[_0xa7c1('0x3f')][_0xa7c1('0x45')](_0xa7c1('0x46'))){_0xd1f7b1['limit']=qs[_0xa7c1('0x22')](_0x2d700f[_0xa7c1('0x3f')]['limit']);_0xd1f7b1['offset']=qs['offset'](_0x2d700f[_0xa7c1('0x3f')][_0xa7c1('0x24')]);}_0xd1f7b1[_0xa7c1('0x47')]=qs[_0xa7c1('0x48')](_0x2d700f[_0xa7c1('0x3f')][_0xa7c1('0x48')]);_0xd1f7b1[_0xa7c1('0x49')]=qs['filters'](_[_0xa7c1('0x4a')](_0x2d700f[_0xa7c1('0x3f')],_0x5e5a62[_0xa7c1('0x40')]));_0xd1f7b1[_0xa7c1('0x49')][_0xa7c1('0x6a')]=_0x1f1de1['id'];if(_0x2d700f[_0xa7c1('0x3f')]['filter']){_0xd1f7b1[_0xa7c1('0x49')]=_['merge'](_0xd1f7b1[_0xa7c1('0x49')],{'$or':_[_0xa7c1('0x31')](_0xd1f7b1[_0xa7c1('0x43')],function(_0x1c1ca2){var _0x26e65f={};_0x26e65f[_0x1c1ca2]={'$like':'%'+_0x2d700f[_0xa7c1('0x3f')][_0xa7c1('0x2f')]+'%'};return _0x26e65f;})});}_0xd1f7b1=_[_0xa7c1('0x4b')]({},_0xd1f7b1,_0x2d700f[_0xa7c1('0x4d')]);return db[_0xa7c1('0x69')][_0xa7c1('0x23')]({'where':_0xd1f7b1[_0xa7c1('0x49')]})[_0xa7c1('0x2b')](function(_0x364212){_0x4ecdaa[_0xa7c1('0x23')]=_0x364212;if(_0x2d700f[_0xa7c1('0x3f')][_0xa7c1('0x4e')]){_0xd1f7b1[_0xa7c1('0x4f')]=[{'all':!![]}];}return db[_0xa7c1('0x69')][_0xa7c1('0x51')](_0xd1f7b1);})[_0xa7c1('0x2b')](function(_0x4b07bc){_0x4ecdaa['rows']=_0x4b07bc;return _0x4ecdaa;});}})[_0xa7c1('0x2b')](respondWithFilteredResult(_0x29ecf4,_0xd1f7b1))[_0xa7c1('0x53')](handleError(_0x29ecf4,null));};exports[_0xa7c1('0x6b')]=function(_0x42991e,_0x5d7a99,_0x27a229){var _0x3de5d2={'raw':!![],'where':{}};var _0x71aab4={};var _0x23a671={'count':0x0,'rows':[]};return db[_0xa7c1('0x50')]['findOne']({'where':{'id':_0x42991e[_0xa7c1('0x55')]['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x5d7a99,null))[_0xa7c1('0x2b')](function(_0x343542){if(_0x343542){_0x71aab4[_0xa7c1('0x3d')]=_[_0xa7c1('0x3e')](db[_0xa7c1('0x6c')][_0xa7c1('0x56')]);_0x71aab4['query']=_[_0xa7c1('0x3e')](_0x42991e[_0xa7c1('0x3f')]);_0x71aab4[_0xa7c1('0x40')]=_[_0xa7c1('0x41')](_0x71aab4[_0xa7c1('0x3d')],_0x71aab4[_0xa7c1('0x3f')]);_0x3de5d2[_0xa7c1('0x43')]=_['intersection'](_0x71aab4[_0xa7c1('0x3d')],qs['fields'](_0x42991e[_0xa7c1('0x3f')][_0xa7c1('0x42')]));_0x3de5d2['attributes']=_0x3de5d2[_0xa7c1('0x43')][_0xa7c1('0x44')]?_0x3de5d2[_0xa7c1('0x43')]:_0x71aab4[_0xa7c1('0x3d')];if(!_0x42991e['query']['hasOwnProperty'](_0xa7c1('0x46'))){_0x3de5d2[_0xa7c1('0x22')]=qs[_0xa7c1('0x22')](_0x42991e[_0xa7c1('0x3f')][_0xa7c1('0x22')]);_0x3de5d2['offset']=qs['offset'](_0x42991e[_0xa7c1('0x3f')][_0xa7c1('0x24')]);}_0x3de5d2[_0xa7c1('0x47')]=qs['sort'](_0x42991e[_0xa7c1('0x3f')]['sort']);_0x3de5d2[_0xa7c1('0x49')]=qs['filters'](_[_0xa7c1('0x4a')](_0x42991e['query'],_0x71aab4[_0xa7c1('0x40')]));_0x3de5d2[_0xa7c1('0x49')][_0xa7c1('0x6a')]=_0x343542['id'];if(_0x42991e[_0xa7c1('0x3f')][_0xa7c1('0x2f')]){_0x3de5d2[_0xa7c1('0x49')]=_[_0xa7c1('0x4b')](_0x3de5d2[_0xa7c1('0x49')],{'$or':_[_0xa7c1('0x31')](_0x3de5d2['attributes'],function(_0xda3fc5){var _0x5ac4e9={};_0x5ac4e9[_0xda3fc5]={'$like':'%'+_0x42991e[_0xa7c1('0x3f')][_0xa7c1('0x2f')]+'%'};return _0x5ac4e9;})});}_0x3de5d2=_['merge']({},_0x3de5d2,_0x42991e[_0xa7c1('0x4d')]);return db[_0xa7c1('0x6c')]['count']({'where':_0x3de5d2[_0xa7c1('0x49')]})[_0xa7c1('0x2b')](function(_0x2f0ba2){_0x23a671['count']=_0x2f0ba2;if(_0x42991e[_0xa7c1('0x3f')][_0xa7c1('0x4e')]){_0x3de5d2['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xa7c1('0x51')](_0x3de5d2);})[_0xa7c1('0x2b')](function(_0x2bd4fa){_0x23a671[_0xa7c1('0x52')]=_0x2bd4fa;return _0x23a671;});}})[_0xa7c1('0x2b')](respondWithFilteredResult(_0x5d7a99,_0x3de5d2))[_0xa7c1('0x53')](handleError(_0x5d7a99,null));};exports[_0xa7c1('0x6d')]=function(_0x10928d,_0x27feb2,_0x262ad6){var _0xe3aadc={'raw':!![],'where':{}};var _0xe7d8dc={};var _0x589c5a={'count':0x0,'rows':[]};return db[_0xa7c1('0x50')][_0xa7c1('0x67')]({'where':{'id':_0x10928d['params']['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x27feb2,null))[_0xa7c1('0x2b')](function(_0x586ebd){if(_0x586ebd){_0xe7d8dc['model']=_[_0xa7c1('0x3e')](db[_0xa7c1('0x6e')][_0xa7c1('0x56')]);_0xe7d8dc['query']=_[_0xa7c1('0x3e')](_0x10928d[_0xa7c1('0x3f')]);_0xe7d8dc[_0xa7c1('0x40')]=_[_0xa7c1('0x41')](_0xe7d8dc[_0xa7c1('0x3d')],_0xe7d8dc[_0xa7c1('0x3f')]);_0xe3aadc['attributes']=_['intersection'](_0xe7d8dc['model'],qs[_0xa7c1('0x42')](_0x10928d[_0xa7c1('0x3f')][_0xa7c1('0x42')]));_0xe3aadc[_0xa7c1('0x43')]=_0xe3aadc[_0xa7c1('0x43')]['length']?_0xe3aadc['attributes']:_0xe7d8dc[_0xa7c1('0x3d')];if(!_0x10928d[_0xa7c1('0x3f')][_0xa7c1('0x45')](_0xa7c1('0x46'))){_0xe3aadc[_0xa7c1('0x22')]=qs[_0xa7c1('0x22')](_0x10928d[_0xa7c1('0x3f')][_0xa7c1('0x22')]);_0xe3aadc[_0xa7c1('0x24')]=qs[_0xa7c1('0x24')](_0x10928d[_0xa7c1('0x3f')]['offset']);}_0xe3aadc[_0xa7c1('0x47')]=qs[_0xa7c1('0x48')](_0x10928d['query'][_0xa7c1('0x48')]);_0xe3aadc[_0xa7c1('0x49')]=qs['filters'](_['pick'](_0x10928d[_0xa7c1('0x3f')],_0xe7d8dc[_0xa7c1('0x40')]));_0xe3aadc[_0xa7c1('0x49')][_0xa7c1('0x6a')]=_0x586ebd['id'];if(_0x10928d[_0xa7c1('0x3f')][_0xa7c1('0x2f')]){_0xe3aadc[_0xa7c1('0x49')]=_[_0xa7c1('0x4b')](_0xe3aadc[_0xa7c1('0x49')],{'$or':_[_0xa7c1('0x31')](_0xe3aadc[_0xa7c1('0x43')],function(_0x5689a5){var _0x6b881e={};_0x6b881e[_0x5689a5]={'$like':'%'+_0x10928d[_0xa7c1('0x3f')]['filter']+'%'};return _0x6b881e;})});}_0xe3aadc=_['merge']({},_0xe3aadc,_0x10928d[_0xa7c1('0x4d')]);return db[_0xa7c1('0x6e')]['count']({'where':_0xe3aadc[_0xa7c1('0x49')]})[_0xa7c1('0x2b')](function(_0xb1903b){_0x589c5a[_0xa7c1('0x23')]=_0xb1903b;if(_0x10928d[_0xa7c1('0x3f')]['includeAll']){_0xe3aadc[_0xa7c1('0x4f')]=[{'all':!![]}];}return db[_0xa7c1('0x6e')][_0xa7c1('0x51')](_0xe3aadc);})[_0xa7c1('0x2b')](function(_0x4452fc){_0x589c5a[_0xa7c1('0x52')]=_0x4452fc;return _0x589c5a;});}})[_0xa7c1('0x2b')](respondWithFilteredResult(_0x27feb2,_0xe3aadc))[_0xa7c1('0x53')](handleError(_0x27feb2,null));};exports['getTeams']=function(_0x5d8d31,_0x3d8031,_0x5b688f){var _0x22e529={};var _0x1ea02f={};var _0x604b0b;var _0x22ab1f;return db[_0xa7c1('0x50')][_0xa7c1('0x67')]({'where':{'id':_0x5d8d31['params']['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x3d8031,null))[_0xa7c1('0x2b')](function(_0x41bf62){if(_0x41bf62){_0x604b0b=_0x41bf62;_0x1ea02f[_0xa7c1('0x3d')]=_[_0xa7c1('0x3e')](db[_0xa7c1('0x6f')][_0xa7c1('0x56')]);_0x1ea02f[_0xa7c1('0x3f')]=_[_0xa7c1('0x3e')](_0x5d8d31[_0xa7c1('0x3f')]);_0x1ea02f[_0xa7c1('0x40')]=_[_0xa7c1('0x41')](_0x1ea02f[_0xa7c1('0x3d')],_0x1ea02f[_0xa7c1('0x3f')]);_0x22e529[_0xa7c1('0x43')]=_[_0xa7c1('0x41')](_0x1ea02f[_0xa7c1('0x3d')],qs[_0xa7c1('0x42')](_0x5d8d31[_0xa7c1('0x3f')]['fields']));_0x22e529['attributes']=_0x22e529[_0xa7c1('0x43')]['length']?_0x22e529[_0xa7c1('0x43')]:_0x1ea02f[_0xa7c1('0x3d')];_0x22e529[_0xa7c1('0x47')]=qs['sort'](_0x5d8d31[_0xa7c1('0x3f')][_0xa7c1('0x48')]);_0x22e529['where']=qs[_0xa7c1('0x40')](_[_0xa7c1('0x4a')](_0x5d8d31[_0xa7c1('0x3f')],_0x1ea02f[_0xa7c1('0x40')]));if(_0x5d8d31[_0xa7c1('0x3f')][_0xa7c1('0x2f')]){_0x22e529['where']=_[_0xa7c1('0x4b')](_0x22e529[_0xa7c1('0x49')],{'$or':_['map'](_0x22e529[_0xa7c1('0x43')],function(_0x1ae239){var _0x5ed5ac={};_0x5ed5ac[_0x1ae239]={'$like':'%'+_0x5d8d31[_0xa7c1('0x3f')][_0xa7c1('0x2f')]+'%'};return _0x5ed5ac;})});}_0x22e529=_[_0xa7c1('0x4b')]({},_0x22e529,_0x5d8d31[_0xa7c1('0x4d')]);return _0x604b0b[_0xa7c1('0x70')](_0x22e529);}})[_0xa7c1('0x2b')](function(_0x1fb8e7){if(_0x1fb8e7){_0x22ab1f=_0x1fb8e7[_0xa7c1('0x44')];if(!_0x5d8d31[_0xa7c1('0x3f')]['hasOwnProperty'](_0xa7c1('0x46'))){_0x22e529[_0xa7c1('0x22')]=qs['limit'](_0x5d8d31[_0xa7c1('0x3f')]['limit']);_0x22e529['offset']=qs['offset'](_0x5d8d31[_0xa7c1('0x3f')][_0xa7c1('0x24')]);}return _0x604b0b[_0xa7c1('0x70')](_0x22e529);}})[_0xa7c1('0x2b')](function(_0x1ef82d){if(_0x1ef82d){return _0x1ef82d?{'count':_0x22ab1f,'rows':_0x1ef82d}:null;}})[_0xa7c1('0x2b')](respondWithResult(_0x3d8031,null))['catch'](handleError(_0x3d8031,null));};exports[_0xa7c1('0x71')]=function(_0x5e3cee,_0x4288da,_0xc27e0e){var _0x5ddd31=_0x5e3cee['body'][_0xa7c1('0x72')];var _0xb9fa5=_[_0xa7c1('0x31')](_0x5ddd31,'id');return db['Team'][_0xa7c1('0x51')]({'where':{'id':_0xb9fa5},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa7c1('0x73'),'attributes':['id',_0xa7c1('0x35'),_0xa7c1('0x74'),'voicePause','interface'],'raw':!![]}]})[_0xa7c1('0x2b')](function(_0x388ffd){if(_0x388ffd){var _0x13e6fd=_[_0xa7c1('0x75')](_0x388ffd,function(_0x4fbcaf){var _0x1e11c2=_0x4fbcaf['get']({'plain':!![]});_0x1e11c2[_0xa7c1('0x73')][_0xa7c1('0x76')](function(_0x5899a5){_0x5899a5[_0xa7c1('0x77')]=_[_0xa7c1('0x5c')](_0x5ddd31,{'id':_0x1e11c2['id']})[_0xa7c1('0x77')];});return _0x1e11c2[_0xa7c1('0x73')];});return db[_0xa7c1('0x50')]['find']({'where':{'id':_0x5e3cee['params']['id']}})[_0xa7c1('0x2b')](function(_0x1d2258){return db['sequelize'][_0xa7c1('0x78')](function(_0x21f025){return _0x1d2258[_0xa7c1('0x71')](_0xb9fa5,{'transaction':_0x21f025})['then'](function(){return BPromise[_0xa7c1('0x79')](_0x5ddd31,function(_0x4702cd){return db[_0xa7c1('0x7a')][_0xa7c1('0x7b')]({'TeamId':_0x4702cd['id'],'VoiceQueueId':_0x5e3cee[_0xa7c1('0x55')]['id'],'penalty':_0x4702cd[_0xa7c1('0x77')]},{'transaction':_0x21f025});});})['then'](function(){return BPromise[_0xa7c1('0x79')](_0x13e6fd,function(_0x2c3710){return db[_0xa7c1('0x7c')]['findOrCreate']({'where':{'UserId':_0x2c3710['id'],'VoiceQueueId':_0x5e3cee[_0xa7c1('0x55')]['id']},'defaults':{'penalty':_0x2c3710['penalty']},'transaction':_0x21f025});});})[_0xa7c1('0x2b')](function(){return BPromise['each'](_[_0xa7c1('0x2f')](_0x13e6fd,{'online':!![]}),function(_0x5744b9){return db[_0xa7c1('0x7d')]['upsert']({'membername':_0x5744b9[_0xa7c1('0x35')],'UserId':_0x5744b9['id'],'queue_name':_0x1d2258['name'],'VoiceQueueId':_0x1d2258['id'],'interface':_['isNil'](_0x5744b9[_0xa7c1('0x7e')])?util['format'](_0xa7c1('0x7f'),_0x5744b9[_0xa7c1('0x35')]):_0x5744b9['interface'],'paused':_0x5744b9[_0xa7c1('0x80')]||![],'penalty':_0x5744b9[_0xa7c1('0x77')]},{'transaction':_0x21f025});});})[_0xa7c1('0x2b')](function(){_0x13e6fd[_0xa7c1('0x76')](function(_0x510075){socket['emit'](_0xa7c1('0x81'),{'UserId':_0x510075['id'],'VoiceQueueId':_0x1d2258['id']});});});});});}})[_0xa7c1('0x2b')](respondWithStatusCode(_0x4288da,null))[_0xa7c1('0x53')](handleError(_0x4288da,null));};exports[_0xa7c1('0x82')]=function(_0xab38c3,_0x1387f5,_0x242245){return db[_0xa7c1('0x6f')][_0xa7c1('0x51')]({'where':{'id':_0xab38c3[_0xa7c1('0x3f')][_0xa7c1('0x83')]},'attributes':['id'],'include':[{'model':db[_0xa7c1('0x84')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa7c1('0x2b')](handleEntityNotFound(_0x1387f5,null))[_0xa7c1('0x2b')](function(_0x2a605f){var _0x3a5476=_[_0xa7c1('0x31')](_0x2a605f,'id');var _0x4c27f7=[];var _0x37564e=[];var _0xae15ad=squel[_0xa7c1('0x85')]();_0xae15ad[_0xa7c1('0x86')]('tq.TeamId')[_0xa7c1('0x87')](_0xa7c1('0x88'),'tq')[_0xa7c1('0x89')](_0xa7c1('0x8a'),'ut',_0xa7c1('0x8b'))[_0xa7c1('0x49')](_0xa7c1('0x8c'),_0xab38c3['params']['id']);for(var _0x5020d9=0x0;_0x5020d9<_0x2a605f[_0xa7c1('0x44')];_0x5020d9+=0x1){let _0x33a100=_0x2a605f[_0x5020d9];for(var _0x5769da=0x0;_0x5769da<_0x33a100['Agents'][_0xa7c1('0x44')];_0x5769da+=0x1){let _0x2703aa=_0x33a100[_0xa7c1('0x73')][_0x5769da];var _0x36077c=_0xae15ad[_0xa7c1('0x60')]();_0x36077c[_0xa7c1('0x49')]('ut.UserId\x20=\x20?',_0x2703aa['id']);_0x37564e['push'](db['sequelize'][_0xa7c1('0x3f')](_0x36077c['toString'](),{'type':db['sequelize'][_0xa7c1('0x8d')][_0xa7c1('0x8e')]})[_0xa7c1('0x2b')](function(_0x21a1df){if(_0x21a1df['length']===0x1){return _0x2703aa['id'];}else{var _0x749781=_[_0xa7c1('0x8f')](_[_0xa7c1('0x31')](_0x21a1df,_0xa7c1('0x90')),function(_0x123ba2){return _[_0xa7c1('0x33')](_0x3a5476,_0x123ba2);});if(_0x749781){return _0x2703aa['id'];}}}));}}return BPromise[_0xa7c1('0x91')](_0x37564e)[_0xa7c1('0x2b')](function(_0x5da6a0){_0x4c27f7=_(_0x4c27f7)['union'](_0x5da6a0)[_0xa7c1('0x92')]()[_0xa7c1('0x32')]();return db[_0xa7c1('0x50')][_0xa7c1('0x5c')]({'where':{'id':_0xab38c3[_0xa7c1('0x55')]['id']}})[_0xa7c1('0x2b')](function(_0x48d695){return db['sequelize'][_0xa7c1('0x78')](function(_0xbef497){return _0x48d695[_0xa7c1('0x82')](_0xab38c3[_0xa7c1('0x3f')][_0xa7c1('0x83')],{'transaction':_0xbef497})[_0xa7c1('0x2b')](function(){if(!_['isEmpty'](_0x4c27f7)){return _0x48d695['removeAgents'](_0x4c27f7,{'transaction':_0xbef497})[_0xa7c1('0x2b')](function(){return db[_0xa7c1('0x7d')]['destroy']({'where':{'VoiceQueueId':_0xab38c3[_0xa7c1('0x55')]['id'],'UserId':_0x4c27f7},'transaction':_0xbef497});});}})[_0xa7c1('0x2b')](function(){_0x4c27f7[_0xa7c1('0x76')](function(_0x317000){socket['emit'](_0xa7c1('0x93'),{'UserId':_0x317000,'VoiceQueueId':_0x48d695['id']});});});});});});})[_0xa7c1('0x2b')](respondWithStatusCode(_0x1387f5,null))[_0xa7c1('0x53')](handleError(_0x1387f5,null));};exports[_0xa7c1('0x94')]=function(_0x3aa4a7,_0x334a2b,_0x3459d2){var _0x5c3879,_0x141a73;return db[_0xa7c1('0x50')][_0xa7c1('0x5c')]({'where':{'id':_0x3aa4a7[_0xa7c1('0x55')]['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x334a2b,null))[_0xa7c1('0x2b')](function(_0x323b4e){if(_0x323b4e){_0x141a73=_0x323b4e;return _0x323b4e['addAgents'](_0x3aa4a7[_0xa7c1('0x57')][_0xa7c1('0x83')],_[_0xa7c1('0x63')](_0x3aa4a7[_0xa7c1('0x57')],[_0xa7c1('0x83'),'id'])||{})[_0xa7c1('0x95')](function(_0x9a3a58){for(var _0x663f02=0x0;_0x663f02<_0x3aa4a7[_0xa7c1('0x57')][_0xa7c1('0x83')]['length'];_0x663f02+=0x1){socket[_0xa7c1('0x96')]('userVoiceQueue:save',{'UserId':Number(_0x3aa4a7[_0xa7c1('0x57')][_0xa7c1('0x83')][_0x663f02]),'VoiceQueueId':Number(_0x3aa4a7[_0xa7c1('0x55')]['id'])});}return _0x9a3a58;});}})[_0xa7c1('0x2b')](function(_0x283a9d){_0x5c3879=_0x283a9d||[];if(_0x141a73){return db[_0xa7c1('0x84')][_0xa7c1('0x51')]({'where':{'id':_0x3aa4a7['body']['ids']},'attributes':['id',_0xa7c1('0x35'),_0xa7c1('0x74'),'voicePause','interface'],'raw':!![]});}})[_0xa7c1('0x2b')](function(_0x514fee){if(!_['isEmpty'](_0x514fee)){var _0x4789a7=[];for(var _0x576b06=0x0;_0x576b06<_0x514fee[_0xa7c1('0x44')];_0x576b06++){if(_0x514fee[_0x576b06][_0xa7c1('0x74')]){_0x4789a7[_0xa7c1('0x97')](db[_0xa7c1('0x7d')]['upsert']({'membername':_0x514fee[_0x576b06][_0xa7c1('0x35')],'UserId':_0x514fee[_0x576b06]['id'],'queue_name':_0x141a73[_0xa7c1('0x35')],'VoiceQueueId':_0x141a73['id'],'interface':_[_0xa7c1('0x98')](_0x514fee[_0x576b06][_0xa7c1('0x7e')])?util[_0xa7c1('0x99')]('SIP/%s',_0x514fee[_0x576b06][_0xa7c1('0x35')]):_0x514fee[_0x576b06][_0xa7c1('0x7e')],'paused':_0x514fee[_0x576b06]['voicePause']||![],'penalty':_0x3aa4a7[_0xa7c1('0x57')][_0xa7c1('0x77')]||0x0}));}}return BPromise[_0xa7c1('0x91')](_0x4789a7);}})[_0xa7c1('0x2b')](function(){return _0x5c3879;})[_0xa7c1('0x2b')](respondWithResult(_0x334a2b,null))[_0xa7c1('0x53')](handleError(_0x334a2b,null));};exports[_0xa7c1('0x9a')]=function(_0x38361f,_0x221166,_0x5f35ad){return db[_0xa7c1('0x50')][_0xa7c1('0x5c')]({'where':{'id':_0x38361f[_0xa7c1('0x55')]['id']}})['then'](handleEntityNotFound(_0x221166,null))['then'](function(_0x50becc){if(_0x50becc){return _0x50becc[_0xa7c1('0x9a')](_0x38361f['query'][_0xa7c1('0x83')])['then'](function(){if(_[_0xa7c1('0x9b')](_0x38361f[_0xa7c1('0x3f')]['ids'])){for(var _0x2a47cf=0x0;_0x2a47cf<_0x38361f['query']['ids'][_0xa7c1('0x44')];_0x2a47cf+=0x1){socket[_0xa7c1('0x96')](_0xa7c1('0x93'),{'UserId':Number(_0x38361f[_0xa7c1('0x3f')]['ids'][_0x2a47cf]),'VoiceQueueId':Number(_0x38361f['params']['id'])});}}else{socket[_0xa7c1('0x96')](_0xa7c1('0x93'),{'UserId':Number(_0x38361f[_0xa7c1('0x3f')]['ids']),'VoiceQueueId':Number(_0x38361f[_0xa7c1('0x55')]['id'])});}});}})[_0xa7c1('0x2b')](function(_0xff25a0){return db[_0xa7c1('0x7d')]['destroy']({'where':{'VoiceQueueId':_0x38361f['params']['id'],'UserId':_0x38361f['query'][_0xa7c1('0x83')]}})['then'](function(){return _0xff25a0;});})[_0xa7c1('0x2b')](respondWithStatusCode(_0x221166,null))[_0xa7c1('0x53')](handleError(_0x221166,null));};exports[_0xa7c1('0x9c')]=function(_0x4dd889,_0x1b5f9a,_0x5591c7){var _0xac829d={};var _0x189f06={};var _0x48a6d8;var _0x468dc6;return db[_0xa7c1('0x50')][_0xa7c1('0x67')]({'where':{'id':_0x4dd889[_0xa7c1('0x55')]['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x1b5f9a,null))[_0xa7c1('0x2b')](function(_0x1b72af){if(_0x1b72af){_0x48a6d8=_0x1b72af;_0x189f06[_0xa7c1('0x3d')]=_['keys'](db[_0xa7c1('0x84')][_0xa7c1('0x56')]);_0x189f06[_0xa7c1('0x3f')]=_['keys'](_0x4dd889[_0xa7c1('0x3f')]);_0x189f06['filters']=_[_0xa7c1('0x41')](_0x189f06[_0xa7c1('0x3d')],_0x189f06['query']);_0xac829d['attributes']=_[_0xa7c1('0x41')](_0x189f06[_0xa7c1('0x3d')],qs['fields'](_0x4dd889[_0xa7c1('0x3f')][_0xa7c1('0x42')]));_0xac829d[_0xa7c1('0x43')]=_0xac829d[_0xa7c1('0x43')][_0xa7c1('0x44')]?_0xac829d[_0xa7c1('0x43')]:_0x189f06[_0xa7c1('0x3d')];_0xac829d['order']=qs[_0xa7c1('0x48')](_0x4dd889[_0xa7c1('0x3f')][_0xa7c1('0x48')]);_0xac829d[_0xa7c1('0x49')]=qs[_0xa7c1('0x40')](_[_0xa7c1('0x4a')](_0x4dd889[_0xa7c1('0x3f')],_0x189f06[_0xa7c1('0x40')]));if(_0x4dd889[_0xa7c1('0x3f')][_0xa7c1('0x2f')]){_0xac829d[_0xa7c1('0x49')]=_[_0xa7c1('0x4b')](_0xac829d['where'],{'$or':_[_0xa7c1('0x31')](_0xac829d['attributes'],function(_0x566db5){var _0x1d2b08={};_0x1d2b08[_0x566db5]={'$like':'%'+_0x4dd889['query'][_0xa7c1('0x2f')]+'%'};return _0x1d2b08;})});}_0xac829d=_[_0xa7c1('0x4b')]({},_0xac829d,_0x4dd889[_0xa7c1('0x4d')]);return _0x48a6d8[_0xa7c1('0x9c')](_0xac829d);}})['then'](function(_0x65f542){if(_0x65f542){_0x468dc6=_0x65f542[_0xa7c1('0x44')];if(!_0x4dd889[_0xa7c1('0x3f')][_0xa7c1('0x45')]('nolimit')){_0xac829d[_0xa7c1('0x22')]=qs[_0xa7c1('0x22')](_0x4dd889[_0xa7c1('0x3f')][_0xa7c1('0x22')]);_0xac829d[_0xa7c1('0x24')]=qs['offset'](_0x4dd889[_0xa7c1('0x3f')]['offset']);}return _0x48a6d8[_0xa7c1('0x9c')](_0xac829d);}})[_0xa7c1('0x2b')](function(_0x54e4f7){if(_0x54e4f7){return _0x54e4f7?{'count':_0x468dc6,'rows':_0x54e4f7}:null;}})[_0xa7c1('0x2b')](respondWithResult(_0x1b5f9a,null))[_0xa7c1('0x53')](handleError(_0x1b5f9a,null));};exports['getMembers']=function(_0x2b6232,_0x5cb7a4,_0x57699f){var _0x93c465={};var _0x1798d={};var _0x1a0f60;var _0x214c7b;return db[_0xa7c1('0x50')]['findOne']({'where':{'id':_0x2b6232['params']['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x5cb7a4,null))[_0xa7c1('0x2b')](function(_0x1cf1ec){if(_0x1cf1ec){_0x1a0f60=_0x1cf1ec;_0x1798d[_0xa7c1('0x3d')]=_[_0xa7c1('0x3e')](db[_0xa7c1('0x7d')][_0xa7c1('0x56')]);_0x1798d[_0xa7c1('0x3f')]=_[_0xa7c1('0x3e')](_0x2b6232['query']);_0x1798d[_0xa7c1('0x40')]=_[_0xa7c1('0x41')](_0x1798d['model'],_0x1798d[_0xa7c1('0x3f')]);_0x93c465[_0xa7c1('0x43')]=_['intersection'](_0x1798d[_0xa7c1('0x3d')],qs[_0xa7c1('0x42')](_0x2b6232[_0xa7c1('0x3f')][_0xa7c1('0x42')]));_0x93c465[_0xa7c1('0x43')]=_0x93c465[_0xa7c1('0x43')][_0xa7c1('0x44')]?_0x93c465['attributes']:_0x1798d[_0xa7c1('0x3d')];_0x93c465[_0xa7c1('0x47')]=qs[_0xa7c1('0x48')](_0x2b6232['query'][_0xa7c1('0x48')]);_0x93c465[_0xa7c1('0x49')]=qs['filters'](_[_0xa7c1('0x4a')](_0x2b6232[_0xa7c1('0x3f')],_0x1798d['filters']));if(_0x2b6232[_0xa7c1('0x3f')][_0xa7c1('0x2f')]){_0x93c465['where']=_['merge'](_0x93c465[_0xa7c1('0x49')],{'$or':_[_0xa7c1('0x31')](_0x93c465[_0xa7c1('0x43')],function(_0x4db8c5){var _0x18c28b={};_0x18c28b[_0x4db8c5]={'$like':'%'+_0x2b6232[_0xa7c1('0x3f')][_0xa7c1('0x2f')]+'%'};return _0x18c28b;})});}_0x93c465=_[_0xa7c1('0x4b')]({},_0x93c465,_0x2b6232[_0xa7c1('0x4d')]);return _0x1a0f60['getMembers'](_0x93c465);}})[_0xa7c1('0x2b')](function(_0x9d1ce8){if(_0x9d1ce8){_0x214c7b=_0x9d1ce8[_0xa7c1('0x44')];if(!_0x2b6232[_0xa7c1('0x3f')][_0xa7c1('0x45')]('nolimit')){_0x93c465[_0xa7c1('0x22')]=qs[_0xa7c1('0x22')](_0x2b6232[_0xa7c1('0x3f')]['limit']);_0x93c465[_0xa7c1('0x24')]=qs['offset'](_0x2b6232[_0xa7c1('0x3f')][_0xa7c1('0x24')]);}return _0x1a0f60[_0xa7c1('0x9d')](_0x93c465);}})['then'](function(_0x21bab7){return _0x21bab7?{'count':_0x214c7b,'rows':_0x21bab7}:null;})[_0xa7c1('0x2b')](respondWithResult(_0x5cb7a4,null))[_0xa7c1('0x53')](handleError(_0x5cb7a4,null));};exports['getLists']=function(_0x63208b,_0x1aaece,_0x41b242){var _0x246bb8={};var _0x5828c4={};var _0x4a7ce8;var _0x1e5104;return db[_0xa7c1('0x50')]['findOne']({'where':{'id':_0x63208b[_0xa7c1('0x55')]['id']}})['then'](handleEntityNotFound(_0x1aaece,null))[_0xa7c1('0x2b')](function(_0x2c28f1){if(_0x2c28f1){_0x4a7ce8=_0x2c28f1;_0x5828c4[_0xa7c1('0x3d')]=_[_0xa7c1('0x3e')](db[_0xa7c1('0x9e')][_0xa7c1('0x56')]);_0x5828c4['query']=_['keys'](_0x63208b[_0xa7c1('0x3f')]);_0x5828c4[_0xa7c1('0x40')]=_[_0xa7c1('0x41')](_0x5828c4[_0xa7c1('0x3d')],_0x5828c4[_0xa7c1('0x3f')]);_0x246bb8['attributes']=_[_0xa7c1('0x41')](_0x5828c4[_0xa7c1('0x3d')],qs[_0xa7c1('0x42')](_0x63208b[_0xa7c1('0x3f')][_0xa7c1('0x42')]));_0x246bb8[_0xa7c1('0x43')]=_0x246bb8['attributes']['length']?_0x246bb8[_0xa7c1('0x43')]:_0x5828c4[_0xa7c1('0x3d')];_0x246bb8[_0xa7c1('0x47')]=qs['sort'](_0x63208b[_0xa7c1('0x3f')]['sort']);_0x246bb8[_0xa7c1('0x49')]=qs[_0xa7c1('0x40')](_['pick'](_0x63208b[_0xa7c1('0x3f')],_0x5828c4['filters']));if(_0x63208b[_0xa7c1('0x3f')][_0xa7c1('0x2f')]){_0x246bb8['where']=_['merge'](_0x246bb8[_0xa7c1('0x49')],{'$or':_[_0xa7c1('0x31')](_0x246bb8[_0xa7c1('0x43')],function(_0x46e935){var _0x260557={};_0x260557[_0x46e935]={'$like':'%'+_0x63208b[_0xa7c1('0x3f')]['filter']+'%'};return _0x260557;})});}_0x246bb8=_[_0xa7c1('0x4b')]({},_0x246bb8,_0x63208b[_0xa7c1('0x4d')]);return _0x4a7ce8[_0xa7c1('0x9f')](_0x246bb8);}})[_0xa7c1('0x2b')](function(_0x1c96d7){if(_0x1c96d7){_0x1e5104=_0x1c96d7['length'];if(!_0x63208b[_0xa7c1('0x3f')][_0xa7c1('0x45')]('nolimit')){_0x246bb8['limit']=qs[_0xa7c1('0x22')](_0x63208b[_0xa7c1('0x3f')][_0xa7c1('0x22')]);_0x246bb8[_0xa7c1('0x24')]=qs[_0xa7c1('0x24')](_0x63208b['query']['offset']);}return _0x4a7ce8[_0xa7c1('0x9f')](_0x246bb8);}})[_0xa7c1('0x2b')](function(_0x47c4ad){if(_0x47c4ad){return _0x47c4ad?{'count':_0x1e5104,'rows':_0x47c4ad}:null;}})['then'](respondWithResult(_0x1aaece,null))[_0xa7c1('0x53')](handleError(_0x1aaece,null));};exports[_0xa7c1('0xa0')]=function(_0x20aab8,_0x45caa,_0x3c377d){var _0x1a06a2=moment()['format'](_0xa7c1('0xa1'));var _0x12eda0,_0x1fa9f5;return db['VoiceQueue']['find']({'where':{'id':_0x20aab8[_0xa7c1('0x55')]['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x45caa,null))['then'](function(_0x576cd2){if(_0x576cd2){_0x1fa9f5=_0x576cd2;return _0x576cd2['addLists'](_0x20aab8[_0xa7c1('0x57')][_0xa7c1('0x83')],_[_0xa7c1('0x63')](_0x20aab8[_0xa7c1('0x57')],[_0xa7c1('0x83'),'id'])||{});}return null;})[_0xa7c1('0x95')](function(_0x3c9193){var _0x54327f;_0x12eda0=_0x3c9193||[];var _0x4f48bd=[];if(_0x3c9193){for(var _0x210440=0x0;_0x210440<_0x3c9193[_0xa7c1('0x44')];_0x210440+=0x1){var _0x367aa6=_0x3c9193[_0x210440][_0xa7c1('0x59')]({'plain':!![]});_0x1fa9f5[_0xa7c1('0xa2')]=_0x20aab8[_0xa7c1('0x57')][_0xa7c1('0xa2')]?_0x20aab8[_0xa7c1('0x57')][_0xa7c1('0xa2')]:_0x1fa9f5['dialCheckDuplicateType'];switch(_0x1fa9f5[_0xa7c1('0xa2')]){case'always':_0x54327f=squel[_0xa7c1('0xa3')]()[_0xa7c1('0xa4')]('cm_hopper')['fromQuery']([_0xa7c1('0xa5'),_0xa7c1('0xa6'),_0xa7c1('0xa7'),_0xa7c1('0xa8'),'VoiceQueueId',_0xa7c1('0x61'),_0xa7c1('0x62')],squel[_0xa7c1('0x85')]()[_0xa7c1('0x86')](_0xa7c1('0xa5'),_0xa7c1('0xa5'))['field']('\x27'+_0x1a06a2+'\x27',_0xa7c1('0xa6'))['field']('id',_0xa7c1('0xa7'))['field'](_0x367aa6[_0xa7c1('0xa9')]['toString'](),_0xa7c1('0xa8'))[_0xa7c1('0x86')](_0x20aab8['params']['id']['toString'](),'VoiceQueueId')[_0xa7c1('0x86')]('\x27'+_0x1a06a2+'\x27',_0xa7c1('0x61'))[_0xa7c1('0x86')]('\x27'+_0x1a06a2+'\x27',_0xa7c1('0x62'))['from'](_0xa7c1('0xaa'))[_0xa7c1('0x49')]('deletedAt\x20IS\x20NULL')[_0xa7c1('0x49')](_0xa7c1('0xab'),_0x367aa6[_0xa7c1('0xa9')][_0xa7c1('0xac')]())[_0xa7c1('0x49')](_0xa7c1('0xad'))[_0xa7c1('0x49')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa7c1('0x85')]()[_0xa7c1('0x86')]('COALESCE(calleridnum,\x27\x27)')[_0xa7c1('0x87')](_0xa7c1('0xae'))['where']('VoiceQueueId\x20=\x20?',_0x20aab8[_0xa7c1('0x55')]['id'][_0xa7c1('0xac')]()))[_0xa7c1('0x49')](_0xa7c1('0xaf'),squel[_0xa7c1('0x85')]()[_0xa7c1('0x86')](_0xa7c1('0xb0'))['from'](_0xa7c1('0xb1'))[_0xa7c1('0x49')](_0xa7c1('0x8c'),_0x20aab8[_0xa7c1('0x55')]['id'][_0xa7c1('0xac')]())))[_0xa7c1('0xac')]();break;case _0xa7c1('0xb2'):_0x54327f=squel['insert']()['into'](_0xa7c1('0xb1'))[_0xa7c1('0xb3')]([_0xa7c1('0xa5'),'scheduledAt',_0xa7c1('0xa7'),_0xa7c1('0xa8'),_0xa7c1('0x6a'),'createdAt',_0xa7c1('0x62')],squel[_0xa7c1('0x85')]()[_0xa7c1('0x86')](_0xa7c1('0xa5'),_0xa7c1('0xa5'))[_0xa7c1('0x86')]('\x27'+_0x1a06a2+'\x27',_0xa7c1('0xa6'))[_0xa7c1('0x86')]('id',_0xa7c1('0xa7'))[_0xa7c1('0x86')](_0x367aa6['CmListId'][_0xa7c1('0xac')](),'ListId')[_0xa7c1('0x86')](_0x20aab8[_0xa7c1('0x55')]['id'][_0xa7c1('0xac')](),_0xa7c1('0x6a'))[_0xa7c1('0x86')]('\x27'+_0x1a06a2+'\x27',_0xa7c1('0x61'))[_0xa7c1('0x86')]('\x27'+_0x1a06a2+'\x27',_0xa7c1('0x62'))[_0xa7c1('0x87')](_0xa7c1('0xaa'))[_0xa7c1('0x49')](_0xa7c1('0xb4'))[_0xa7c1('0x49')]('ListId\x20=\x20?',_0x367aa6[_0xa7c1('0xa9')]['toString']())[_0xa7c1('0x49')](_0xa7c1('0xad'))[_0xa7c1('0x49')](_0xa7c1('0xaf'),squel[_0xa7c1('0x85')]()['field'](_0xa7c1('0xb0'))[_0xa7c1('0x87')]('cm_hopper')[_0xa7c1('0x49')](_0xa7c1('0x8c'),_0x20aab8[_0xa7c1('0x55')]['id'][_0xa7c1('0xac')]())))[_0xa7c1('0xac')]();break;default:_0x54327f=squel[_0xa7c1('0xa3')]()[_0xa7c1('0xa4')]('cm_hopper')[_0xa7c1('0xb3')]([_0xa7c1('0xa5'),'scheduledAt',_0xa7c1('0xa7'),_0xa7c1('0xa8'),_0xa7c1('0x6a'),_0xa7c1('0x61'),_0xa7c1('0x62')],squel['select']()[_0xa7c1('0x86')](_0xa7c1('0xa5'),'phone')[_0xa7c1('0x86')]('\x27'+_0x1a06a2+'\x27',_0xa7c1('0xa6'))[_0xa7c1('0x86')]('id',_0xa7c1('0xa7'))['field'](_0x367aa6[_0xa7c1('0xa9')][_0xa7c1('0xac')](),_0xa7c1('0xa8'))[_0xa7c1('0x86')](_0x20aab8[_0xa7c1('0x55')]['id'][_0xa7c1('0xac')](),'VoiceQueueId')['field']('\x27'+_0x1a06a2+'\x27',_0xa7c1('0x61'))[_0xa7c1('0x86')]('\x27'+_0x1a06a2+'\x27',_0xa7c1('0x62'))[_0xa7c1('0x87')]('cm_contacts')[_0xa7c1('0x49')](_0xa7c1('0xb4'))[_0xa7c1('0x49')]('ListId\x20=\x20?',_0x367aa6[_0xa7c1('0xa9')][_0xa7c1('0xac')]())[_0xa7c1('0x49')](_0xa7c1('0xad')))['toString']();}_0x4f48bd['push'](db['sequelize'][_0xa7c1('0x3f')](_0x54327f));}return BPromise[_0xa7c1('0x91')](_0x4f48bd);}})['then'](function(){var _0x51be31=[];var _0x5c0c0f=squel[_0xa7c1('0xa3')]()[_0xa7c1('0xa4')]('cm_hopper_additional_phones')['fromQuery'](['CmHopperId',_0xa7c1('0xa5'),_0xa7c1('0xb5'),'createdAt',_0xa7c1('0x62')],squel['select']()[_0xa7c1('0x86')](_0xa7c1('0xb6'))[_0xa7c1('0x86')](_0xa7c1('0xb7'))['field'](_0xa7c1('0xb8'))[_0xa7c1('0x86')]('\x27'+_0x1a06a2+'\x27',_0xa7c1('0x61'))['field']('\x27'+_0x1a06a2+'\x27','updatedAt')['from']('cm_contact_has_items','ci')[_0xa7c1('0x89')](_0xa7c1('0xb1'),'h',_0xa7c1('0xb9'))['where'](_0xa7c1('0xba'),_0x1a06a2)['where']('ci.ItemClass=?',_0xa7c1('0xbb')))['toString']();_0x51be31[_0xa7c1('0x97')](db['sequelize'][_0xa7c1('0x3f')](_0x5c0c0f));return BPromise[_0xa7c1('0x91')](_0x51be31);})[_0xa7c1('0x2b')](function(){return _0x12eda0;})['then'](respondWithResult(_0x45caa,null))[_0xa7c1('0x53')](handleError(_0x45caa,null));};exports[_0xa7c1('0xbc')]=function(_0x509d7f,_0x29feb8,_0x96ed4b){return db['VoiceQueue'][_0xa7c1('0x5c')]({'where':{'id':_0x509d7f['params']['id']}})['then'](handleEntityNotFound(_0x29feb8,null))[_0xa7c1('0x2b')](function(_0x3c50aa){if(_0x3c50aa){return _0x3c50aa[_0xa7c1('0xbc')](_0x509d7f[_0xa7c1('0x3f')][_0xa7c1('0x83')]);}})[_0xa7c1('0x2b')](function(_0x4ae649){if(_0x4ae649){return db['CmHopper']['destroy']({'where':{'ListId':_0x509d7f[_0xa7c1('0x3f')][_0xa7c1('0x83')],'VoiceQueueId':_0x509d7f[_0xa7c1('0x55')]['id']}})[_0xa7c1('0x2b')](function(){return _0x4ae649;});}})[_0xa7c1('0x2b')](respondWithStatusCode(_0x29feb8,null))[_0xa7c1('0x53')](handleError(_0x29feb8,null));};exports[_0xa7c1('0xbd')]=function(_0x2c965e,_0x3531d0,_0x484dd3){var _0x494fc0={};var _0xeaa87a={};var _0x3c86be;var _0x3cd165;return db['VoiceQueue'][_0xa7c1('0x67')]({'where':{'id':_0x2c965e['params']['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x3531d0,null))[_0xa7c1('0x2b')](function(_0x14b678){if(_0x14b678){_0x3c86be=_0x14b678;_0xeaa87a[_0xa7c1('0x3d')]=_['keys'](db[_0xa7c1('0x9e')]['rawAttributes']);_0xeaa87a[_0xa7c1('0x3f')]=_[_0xa7c1('0x3e')](_0x2c965e[_0xa7c1('0x3f')]);_0xeaa87a['filters']=_[_0xa7c1('0x41')](_0xeaa87a[_0xa7c1('0x3d')],_0xeaa87a[_0xa7c1('0x3f')]);_0x494fc0[_0xa7c1('0x43')]=_['intersection'](_0xeaa87a[_0xa7c1('0x3d')],qs['fields'](_0x2c965e[_0xa7c1('0x3f')][_0xa7c1('0x42')]));_0x494fc0[_0xa7c1('0x43')]=_0x494fc0['attributes'][_0xa7c1('0x44')]?_0x494fc0[_0xa7c1('0x43')]:_0xeaa87a['model'];_0x494fc0[_0xa7c1('0x47')]=qs[_0xa7c1('0x48')](_0x2c965e[_0xa7c1('0x3f')][_0xa7c1('0x48')]);_0x494fc0[_0xa7c1('0x49')]=qs['filters'](_[_0xa7c1('0x4a')](_0x2c965e[_0xa7c1('0x3f')],_0xeaa87a[_0xa7c1('0x40')]));if(_0x2c965e[_0xa7c1('0x3f')][_0xa7c1('0x2f')]){_0x494fc0['where']=_[_0xa7c1('0x4b')](_0x494fc0[_0xa7c1('0x49')],{'$or':_[_0xa7c1('0x31')](_0x494fc0['attributes'],function(_0x53d8e4){var _0x52dfdc={};_0x52dfdc[_0x53d8e4]={'$like':'%'+_0x2c965e[_0xa7c1('0x3f')][_0xa7c1('0x2f')]+'%'};return _0x52dfdc;})});}_0x494fc0=_[_0xa7c1('0x4b')]({},_0x494fc0,_0x2c965e[_0xa7c1('0x4d')]);return _0x3c86be[_0xa7c1('0xbd')](_0x494fc0);}})['then'](function(_0xfd1886){if(_0xfd1886){_0x3cd165=_0xfd1886[_0xa7c1('0x44')];if(!_0x2c965e[_0xa7c1('0x3f')][_0xa7c1('0x45')](_0xa7c1('0x46'))){_0x494fc0[_0xa7c1('0x22')]=qs['limit'](_0x2c965e[_0xa7c1('0x3f')][_0xa7c1('0x22')]);_0x494fc0[_0xa7c1('0x24')]=qs[_0xa7c1('0x24')](_0x2c965e[_0xa7c1('0x3f')]['offset']);}return _0x3c86be[_0xa7c1('0xbd')](_0x494fc0);}})[_0xa7c1('0x2b')](function(_0x5e2af5){if(_0x5e2af5){return _0x5e2af5?{'count':_0x3cd165,'rows':_0x5e2af5}:null;}})['then'](respondWithResult(_0x3531d0,null))['catch'](handleError(_0x3531d0,null));};exports[_0xa7c1('0xbe')]=function(_0x2fe2a4,_0x180f20,_0x11eb33){var _0x30181f,_0xd7700f;return db['VoiceQueue'][_0xa7c1('0x5c')]({'where':{'id':_0x2fe2a4[_0xa7c1('0x55')]['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x180f20,null))[_0xa7c1('0x2b')](function(_0x5e45e6){if(_0x5e45e6){_0xd7700f=_0x5e45e6;return _0x5e45e6[_0xa7c1('0xbe')](_0x2fe2a4['body'][_0xa7c1('0x83')],_[_0xa7c1('0x63')](_0x2fe2a4[_0xa7c1('0x57')],['ids','id'])||{});}return null;})['spread'](function(_0x15512f){var _0x2b1bf6;_0x30181f=_0x15512f||[];var _0x524e0f=[];if(_0x15512f){for(var _0x89d41c=0x0;_0x89d41c<_0x15512f[_0xa7c1('0x44')];_0x89d41c+=0x1){var _0x1c69c2=_0x15512f[_0x89d41c][_0xa7c1('0x59')]({'plain':!![]});_0x2b1bf6=squel['insert']()[_0xa7c1('0xa4')](_0xa7c1('0xbf'))[_0xa7c1('0xb3')](['phone',_0xa7c1('0xa7'),_0xa7c1('0xa8'),_0xa7c1('0x6a'),_0xa7c1('0x61'),'updatedAt'],squel[_0xa7c1('0x85')]()[_0xa7c1('0x86')](_0xa7c1('0xa5'),_0xa7c1('0xa5'))[_0xa7c1('0x86')]('id',_0xa7c1('0xa7'))[_0xa7c1('0x86')](_0x1c69c2[_0xa7c1('0xa9')][_0xa7c1('0xac')](),'ListId')[_0xa7c1('0x86')](_0x2fe2a4[_0xa7c1('0x55')]['id'][_0xa7c1('0xac')](),_0xa7c1('0x6a'))['field'](_0xa7c1('0xc0'),'createdAt')[_0xa7c1('0x86')](_0xa7c1('0xc0'),'updatedAt')[_0xa7c1('0x87')]('cm_contacts')[_0xa7c1('0x49')](_0xa7c1('0xb4'))[_0xa7c1('0x49')](_0xa7c1('0xab'),_0x1c69c2[_0xa7c1('0xa9')]['toString']())[_0xa7c1('0x49')]('phone\x20IS\x20NOT\x20NULL'))[_0xa7c1('0xac')]();_0x524e0f[_0xa7c1('0x97')](db[_0xa7c1('0xc1')][_0xa7c1('0x3f')](_0x2b1bf6));}return BPromise[_0xa7c1('0x91')](_0x524e0f);}})[_0xa7c1('0x2b')](function(){return _0x30181f;})[_0xa7c1('0x2b')](respondWithResult(_0x180f20,null))[_0xa7c1('0x53')](handleError(_0x180f20,null));};exports[_0xa7c1('0xc2')]=function(_0x5609bd,_0x4b5849,_0x2912b3){return db[_0xa7c1('0x50')][_0xa7c1('0x5c')]({'where':{'id':_0x5609bd['params']['id']}})[_0xa7c1('0x2b')](handleEntityNotFound(_0x4b5849,null))[_0xa7c1('0x2b')](function(_0x36d5bb){if(_0x36d5bb){return _0x36d5bb[_0xa7c1('0xc2')](_0x5609bd['query'][_0xa7c1('0x83')]);}})[_0xa7c1('0x2b')](function(_0x34c722){if(_0x34c722){return db['CmHopperBlack'][_0xa7c1('0x2a')]({'where':{'ListId':_0x5609bd[_0xa7c1('0x3f')][_0xa7c1('0x83')],'VoiceQueueId':_0x5609bd[_0xa7c1('0x55')]['id']}})[_0xa7c1('0x2b')](function(){return _0x34c722;});}})['then'](respondWithStatusCode(_0x4b5849,null))['catch'](handleError(_0x4b5849,null));}; \ No newline at end of file +var _0xaafc=['sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','type','find','name','UserProfileResource','destroy','end','error','stack','send','index','fieldName','model','keys','filters','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','VoiceQueue','includeAll','include','rows','catch','show','params','intersection','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','CmHopper','order','getHopperHistories','findOne','CmHopperHistory','VoiceQueueId','findAll','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','User','online','voicePause','interface','Agents','forEach','penalty','transaction','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','format','emit','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','sequelize','SELECT','every','includes','all','union','compact','isEmpty','removeAgents','addAgents','userVoiceQueue:save','SIP/%s','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','YYYY-MM-DD\x20HH:mm:ss','addLists','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','CmListId','ListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId\x20=\x20?','cm_hopper','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','NOW()','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','register'];(function(_0x1733e5,_0x296d54){var _0x232fa1=function(_0x595ae8){while(--_0x595ae8){_0x1733e5['push'](_0x1733e5['shift']());}};_0x232fa1(++_0x296d54);}(_0xaafc,0x176));var _0xcaaf=function(_0x5618ce,_0x3b99ac){_0x5618ce=_0x5618ce-0x0;var _0x59fa1a=_0xaafc[_0x5618ce];return _0x59fa1a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcaaf('0x0'));var zipdir=require(_0xcaaf('0x1'));var jsonpatch=require(_0xcaaf('0x2'));var rp=require(_0xcaaf('0x3'));var moment=require('moment');var BPromise=require(_0xcaaf('0x4'));var Mustache=require(_0xcaaf('0x5'));var util=require('util');var path=require('path');var sox=require(_0xcaaf('0x6'));var csv=require('to-csv');var ejs=require(_0xcaaf('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcaaf('0x8'));var squel=require(_0xcaaf('0x9'));var crypto=require(_0xcaaf('0xa'));var jsforce=require(_0xcaaf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcaaf('0xc'));var querystring=require('querystring');var Papa=require(_0xcaaf('0xd'));var Redis=require('ioredis');var authService=require(_0xcaaf('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xcaaf('0xf'));var hardwareService=require(_0xcaaf('0x10'));var logger=require(_0xcaaf('0x11'))(_0xcaaf('0x12'));var utils=require(_0xcaaf('0x13'));var config=require(_0xcaaf('0x14'));var licenseUtil=require(_0xcaaf('0x15'));var db=require(_0xcaaf('0x16'))['db'];config[_0xcaaf('0x17')]=_['defaults'](config[_0xcaaf('0x17')],{'host':_0xcaaf('0x18'),'port':0x18eb});var socket=require(_0xcaaf('0x19'))(new Redis(config[_0xcaaf('0x17')]));require(_0xcaaf('0x1a'))[_0xcaaf('0x1b')](socket);function respondWithStatusCode(_0x6afc3,_0x439c40){_0x439c40=_0x439c40||0xcc;return function(_0x42861d){if(_0x42861d){return _0x6afc3[_0xcaaf('0x1c')](_0x439c40);}return _0x6afc3[_0xcaaf('0x1d')](_0x439c40)['end']();};}function respondWithResult(_0x301344,_0xb8532b){_0xb8532b=_0xb8532b||0xc8;return function(_0x7f23fb){if(_0x7f23fb){return _0x301344[_0xcaaf('0x1d')](_0xb8532b)[_0xcaaf('0x1e')](_0x7f23fb);}};}function respondWithFilteredResult(_0x360078,_0x4b55e3){return function(_0xf8e303){if(_0xf8e303){var _0x10ad54=typeof _0x4b55e3['offset']===_0xcaaf('0x1f')&&typeof _0x4b55e3[_0xcaaf('0x20')]===_0xcaaf('0x1f');var _0x43631b=_0xf8e303[_0xcaaf('0x21')];var _0x535eb8=_0x10ad54?0x0:_0x4b55e3[_0xcaaf('0x22')];var _0x731e33=_0x10ad54?_0xf8e303[_0xcaaf('0x21')]:_0x4b55e3[_0xcaaf('0x22')]+_0x4b55e3[_0xcaaf('0x20')];var _0x5bdc7a;if(_0x731e33>=_0x43631b){_0x731e33=_0x43631b;_0x5bdc7a=0xc8;}else{_0x5bdc7a=0xce;}_0x360078[_0xcaaf('0x1d')](_0x5bdc7a);return _0x360078[_0xcaaf('0x23')](_0xcaaf('0x24'),_0x535eb8+'-'+_0x731e33+'/'+_0x43631b)[_0xcaaf('0x1e')](_0xf8e303);}return null;};}function patchUpdates(_0x359339){return function(_0x16f83d){try{jsonpatch[_0xcaaf('0x25')](_0x16f83d,_0x359339,!![]);}catch(_0x5e0463){return BPromise[_0xcaaf('0x26')](_0x5e0463);}return _0x16f83d[_0xcaaf('0x27')]();};}function saveUpdates(_0x3f62c8,_0x4c1dcd){return function(_0x34f878){if(_0x34f878){return _0x34f878[_0xcaaf('0x28')](_0x3f62c8)[_0xcaaf('0x29')](function(_0x3dac7d){return _0x3dac7d;});}return null;};}function removeEntity(_0x2a6d15,_0x4346e2){return function(_0x1cc1fb){if(_0x1cc1fb){return _0x1cc1fb['destroy']()[_0xcaaf('0x29')](function(){var _0x52145b=_0x1cc1fb['get']({'plain':!![]});var _0x548b1d=[{'name':_0xcaaf('0x2a'),'value':_0xcaaf('0x2b'),'ignore':![]},{'name':_0xcaaf('0x2c'),'value':_0xcaaf('0x2d'),'ignore':![]}];var _0xc98ce4=_(_0x548b1d)[_0xcaaf('0x2e')](_0xcaaf('0x2f'))[_0xcaaf('0x30')](_0xcaaf('0x31'))['value']();if(_['includes'](_0xc98ce4,_0x52145b[_0xcaaf('0x32')])){return;}var _0x563769=_[_0xcaaf('0x33')](_0x548b1d,['value',_0x52145b[_0xcaaf('0x32')]])[_0xcaaf('0x34')];return db[_0xcaaf('0x35')][_0xcaaf('0x36')]({'where':{'type':_0x563769,'resourceId':_0x52145b['id']}})['then'](function(){return _0x1cc1fb;});})[_0xcaaf('0x29')](function(){_0x2a6d15[_0xcaaf('0x1d')](0xcc)[_0xcaaf('0x37')]();});}};}function handleEntityNotFound(_0x571948,_0x4b204a){return function(_0x120e52){if(!_0x120e52){_0x571948[_0xcaaf('0x1c')](0x194);}return _0x120e52;};}function handleError(_0x5696e4,_0x38a8eb){_0x38a8eb=_0x38a8eb||0x1f4;return function(_0x315565){logger[_0xcaaf('0x38')](_0x315565[_0xcaaf('0x39')]);if(_0x315565[_0xcaaf('0x34')]){delete _0x315565[_0xcaaf('0x34')];}_0x5696e4[_0xcaaf('0x1d')](_0x38a8eb)[_0xcaaf('0x3a')](_0x315565);};}exports[_0xcaaf('0x3b')]=function(_0x4f1eb1,_0x48b018){var _0x318e42={},_0x581c02={},_0xf88073={'count':0x0,'rows':[]};var _0x351beb=_[_0xcaaf('0x30')](db['VoiceQueue']['rawAttributes'],function(_0x41b0f0){return{'name':_0x41b0f0[_0xcaaf('0x3c')],'type':_0x41b0f0['type']['key']};});_0x581c02[_0xcaaf('0x3d')]=_[_0xcaaf('0x30')](_0x351beb,_0xcaaf('0x34'));_0x581c02['query']=_[_0xcaaf('0x3e')](_0x4f1eb1['query']);_0x581c02[_0xcaaf('0x3f')]=_['intersection'](_0x581c02[_0xcaaf('0x3d')],_0x581c02[_0xcaaf('0x40')]);_0x318e42['attributes']=_['intersection'](_0x581c02[_0xcaaf('0x3d')],qs[_0xcaaf('0x41')](_0x4f1eb1['query'][_0xcaaf('0x41')]));_0x318e42[_0xcaaf('0x42')]=_0x318e42['attributes'][_0xcaaf('0x43')]?_0x318e42['attributes']:_0x581c02[_0xcaaf('0x3d')];if(!_0x4f1eb1[_0xcaaf('0x40')][_0xcaaf('0x44')](_0xcaaf('0x45'))){_0x318e42[_0xcaaf('0x20')]=qs[_0xcaaf('0x20')](_0x4f1eb1[_0xcaaf('0x40')][_0xcaaf('0x20')]);_0x318e42[_0xcaaf('0x22')]=qs['offset'](_0x4f1eb1['query'][_0xcaaf('0x22')]);}_0x318e42['order']=qs[_0xcaaf('0x46')](_0x4f1eb1['query'][_0xcaaf('0x46')]);_0x318e42[_0xcaaf('0x47')]=qs[_0xcaaf('0x3f')](_[_0xcaaf('0x48')](_0x4f1eb1['query'],_0x581c02[_0xcaaf('0x3f')]),_0x351beb);if(_0x4f1eb1[_0xcaaf('0x40')]['filter']){_0x318e42[_0xcaaf('0x47')]=_[_0xcaaf('0x49')](_0x318e42[_0xcaaf('0x47')],{'$or':_[_0xcaaf('0x30')](_0x351beb,function(_0xc45f78){if(_0xc45f78[_0xcaaf('0x32')]!==_0xcaaf('0x4a')){var _0xaed7a3={};_0xaed7a3[_0xc45f78[_0xcaaf('0x34')]]={'$like':'%'+_0x4f1eb1[_0xcaaf('0x40')][_0xcaaf('0x2e')]+'%'};return _0xaed7a3;}})});}_0x318e42=_[_0xcaaf('0x49')]({},_0x318e42,_0x4f1eb1[_0xcaaf('0x4b')]);var _0x307f3c={'where':_0x318e42[_0xcaaf('0x47')]};return db[_0xcaaf('0x4c')]['count'](_0x307f3c)['then'](function(_0x4849e9){_0xf88073['count']=_0x4849e9;if(_0x4f1eb1[_0xcaaf('0x40')][_0xcaaf('0x4d')]){_0x318e42[_0xcaaf('0x4e')]=[{'all':!![]}];}return db[_0xcaaf('0x4c')]['findAll'](_0x318e42);})['then'](function(_0x50eeb1){_0xf88073[_0xcaaf('0x4f')]=_0x50eeb1;return _0xf88073;})[_0xcaaf('0x29')](respondWithFilteredResult(_0x48b018,_0x318e42))[_0xcaaf('0x50')](handleError(_0x48b018,null));};exports[_0xcaaf('0x51')]=function(_0x1d4304,_0x389374){var _0x3e5e78={'raw':![],'where':{'id':_0x1d4304[_0xcaaf('0x52')]['id']}},_0x549326={};_0x549326[_0xcaaf('0x3d')]=_['keys'](db['VoiceQueue']['rawAttributes']);_0x549326[_0xcaaf('0x40')]=_[_0xcaaf('0x3e')](_0x1d4304['query']);_0x549326[_0xcaaf('0x3f')]=_['intersection'](_0x549326['model'],_0x549326[_0xcaaf('0x40')]);_0x3e5e78[_0xcaaf('0x42')]=_[_0xcaaf('0x53')](_0x549326[_0xcaaf('0x3d')],qs[_0xcaaf('0x41')](_0x1d4304[_0xcaaf('0x40')][_0xcaaf('0x41')]));_0x3e5e78['attributes']=_0x3e5e78[_0xcaaf('0x42')]['length']?_0x3e5e78[_0xcaaf('0x42')]:_0x549326[_0xcaaf('0x3d')];if(_0x1d4304[_0xcaaf('0x40')][_0xcaaf('0x4d')]){_0x3e5e78['include']=[{'all':!![]}];}_0x3e5e78=_[_0xcaaf('0x49')]({},_0x3e5e78,_0x1d4304['options']);return db[_0xcaaf('0x4c')][_0xcaaf('0x33')](_0x3e5e78)[_0xcaaf('0x29')](handleEntityNotFound(_0x389374,null))[_0xcaaf('0x29')](respondWithResult(_0x389374,null))[_0xcaaf('0x50')](handleError(_0x389374,null));};exports[_0xcaaf('0x54')]=function(_0x7ce144,_0xb003d4){return db['VoiceQueue'][_0xcaaf('0x54')](_0x7ce144[_0xcaaf('0x55')],{})['then'](function(_0x2fe994){var _0x5a84ab=_0x7ce144[_0xcaaf('0x56')][_0xcaaf('0x57')]({'plain':!![]});if(!_0x5a84ab)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a84ab[_0xcaaf('0x58')]===_0xcaaf('0x56')){var _0x596c5e=_0x2fe994[_0xcaaf('0x57')]({'plain':!![]});var _0x4ab689=[{'name':_0xcaaf('0x2a'),'value':'inbound'},{'name':_0xcaaf('0x2c'),'value':_0xcaaf('0x2d')}];var _0xd456d4=_[_0xcaaf('0x33')](_0x4ab689,[_0xcaaf('0x31'),_0x596c5e[_0xcaaf('0x32')]])[_0xcaaf('0x34')];return db[_0xcaaf('0x59')][_0xcaaf('0x33')]({'where':{'name':_0xd456d4,'userProfileId':_0x5a84ab[_0xcaaf('0x5a')]},'raw':!![]})[_0xcaaf('0x29')](function(_0x516c6c){if(_0x516c6c&&_0x516c6c[_0xcaaf('0x5b')]===0x0){return db[_0xcaaf('0x35')][_0xcaaf('0x54')]({'name':_0x596c5e[_0xcaaf('0x34')],'resourceId':_0x596c5e['id'],'type':_0x516c6c[_0xcaaf('0x34')],'sectionId':_0x516c6c['id']},{})[_0xcaaf('0x29')](function(){return _0x2fe994;});}else{return _0x2fe994;}})[_0xcaaf('0x50')](function(_0x2aabf8){logger[_0xcaaf('0x38')](_0xcaaf('0x5c'),_0x2aabf8);throw _0x2aabf8;});}return _0x2fe994;})['then'](respondWithResult(_0xb003d4,0xc9))['catch'](handleError(_0xb003d4,null));};exports[_0xcaaf('0x5d')]=function(_0x6807c6,_0x5c9b2b){var _0x8fc513={'where':{'id':_0x6807c6['params']['id']}},_0x233695={};_0x233695[_0xcaaf('0x3d')]=_[_0xcaaf('0x3e')](db['VoiceQueue'][_0xcaaf('0x5e')]);_0x8fc513[_0xcaaf('0x42')]=_[_0xcaaf('0x53')](_0x233695['model'],qs[_0xcaaf('0x41')](_0x6807c6[_0xcaaf('0x40')][_0xcaaf('0x41')]));_0x8fc513[_0xcaaf('0x42')]=_0x8fc513[_0xcaaf('0x42')][_0xcaaf('0x43')]?_0x8fc513[_0xcaaf('0x42')]:_0x233695['model'];if(_0x6807c6['query'][_0xcaaf('0x4d')]){_0x8fc513[_0xcaaf('0x4e')]=[{'all':!![]}];}_0x8fc513=_[_0xcaaf('0x49')]({},_0x8fc513,_0x6807c6['options']);return db[_0xcaaf('0x4c')][_0xcaaf('0x33')](_0x8fc513)['then'](handleEntityNotFound(_0x5c9b2b,null))[_0xcaaf('0x29')](function(_0x328a53){if(_0x328a53){var _0x21df31=_0x328a53[_0xcaaf('0x57')]({'plain':!![]});_0x21df31=qs[_0xcaaf('0x5f')](_0x21df31,['id','createdAt',_0xcaaf('0x60')]);_0x6807c6[_0xcaaf('0x55')]=_[_0xcaaf('0x5f')](_0x6807c6[_0xcaaf('0x55')],['id',_0xcaaf('0x61'),_0xcaaf('0x60')]);return db[_0xcaaf('0x4c')]['create'](_[_0xcaaf('0x49')](_0x21df31,_0x6807c6['body']),{'include':_0x6807c6[_0xcaaf('0x40')]['includeAll']?[{'all':!![]}]:undefined})[_0xcaaf('0x29')](function(_0x2ff77a){var _0x21b3bc=_0x6807c6[_0xcaaf('0x56')][_0xcaaf('0x57')]({'plain':!![]});if(!_0x21b3bc)throw new Error(_0xcaaf('0x62'));if(_0x21b3bc['role']===_0xcaaf('0x56')){var _0x324d87=_0x2ff77a[_0xcaaf('0x57')]({'plain':!![]});var _0x277854=[{'name':_0xcaaf('0x2a'),'value':_0xcaaf('0x2b')},{'name':_0xcaaf('0x2c'),'value':_0xcaaf('0x2d')}];var _0x3ff275=_[_0xcaaf('0x33')](_0x277854,['value',_0x324d87[_0xcaaf('0x32')]])['name'];return db[_0xcaaf('0x59')][_0xcaaf('0x33')]({'where':{'name':_0x3ff275,'userProfileId':_0x21b3bc[_0xcaaf('0x5a')]},'raw':!![]})[_0xcaaf('0x29')](function(_0x5066cb){if(_0x5066cb&&_0x5066cb[_0xcaaf('0x5b')]===0x0){return db[_0xcaaf('0x35')][_0xcaaf('0x54')]({'name':_0x324d87[_0xcaaf('0x34')],'resourceId':_0x324d87['id'],'type':_0x5066cb[_0xcaaf('0x34')],'sectionId':_0x5066cb['id']},{})['then'](function(){return _0x2ff77a;});}else{return _0x2ff77a;}})[_0xcaaf('0x50')](function(_0x128bf6){logger[_0xcaaf('0x38')](_0xcaaf('0x5c'),_0x128bf6);throw _0x128bf6;});}return _0x2ff77a;});}})[_0xcaaf('0x29')](respondWithResult(_0x5c9b2b,0xc9))[_0xcaaf('0x50')](handleError(_0x5c9b2b,null));};exports[_0xcaaf('0x28')]=function(_0x459131,_0x5bc89e){if(_0x459131[_0xcaaf('0x55')]['id']){delete _0x459131['body']['id'];}return db[_0xcaaf('0x4c')][_0xcaaf('0x33')]({'where':{'id':_0x459131[_0xcaaf('0x52')]['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x5bc89e,null))['then'](saveUpdates(_0x459131[_0xcaaf('0x55')],null))['then'](respondWithResult(_0x5bc89e,null))[_0xcaaf('0x50')](handleError(_0x5bc89e,null));};exports[_0xcaaf('0x36')]=function(_0x260eb7,_0xb3f865){return db[_0xcaaf('0x4c')]['find']({'where':{'id':_0x260eb7['params']['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0xb3f865,null))[_0xcaaf('0x29')](removeEntity(_0xb3f865,null))[_0xcaaf('0x50')](handleError(_0xb3f865,null));};exports[_0xcaaf('0x63')]=function(_0x1b27df,_0x170c15,_0x500c95){var _0x11e4a3={'raw':![],'where':{}};var _0x30b544={};var _0x5614c8={'count':0x0,'rows':[]};return db[_0xcaaf('0x4c')]['findOne']({'where':{'id':_0x1b27df[_0xcaaf('0x52')]['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x170c15,null))['then'](function(_0x58f134){if(_0x58f134){_0x30b544[_0xcaaf('0x3d')]=_[_0xcaaf('0x3e')](db[_0xcaaf('0x64')][_0xcaaf('0x5e')]);_0x30b544[_0xcaaf('0x40')]=_[_0xcaaf('0x3e')](_0x1b27df[_0xcaaf('0x40')]);_0x30b544[_0xcaaf('0x3f')]=_[_0xcaaf('0x53')](_0x30b544[_0xcaaf('0x3d')],_0x30b544[_0xcaaf('0x40')]);_0x11e4a3[_0xcaaf('0x42')]=_[_0xcaaf('0x53')](_0x30b544['model'],qs[_0xcaaf('0x41')](_0x1b27df[_0xcaaf('0x40')][_0xcaaf('0x41')]));_0x11e4a3[_0xcaaf('0x42')]=_0x11e4a3[_0xcaaf('0x42')][_0xcaaf('0x43')]?_0x11e4a3['attributes']:_0x30b544['model'];if(!_0x1b27df[_0xcaaf('0x40')]['hasOwnProperty'](_0xcaaf('0x45'))){_0x11e4a3[_0xcaaf('0x20')]=qs['limit'](_0x1b27df[_0xcaaf('0x40')][_0xcaaf('0x20')]);_0x11e4a3['offset']=qs[_0xcaaf('0x22')](_0x1b27df[_0xcaaf('0x40')][_0xcaaf('0x22')]);}_0x11e4a3[_0xcaaf('0x65')]=qs[_0xcaaf('0x46')](_0x1b27df[_0xcaaf('0x40')][_0xcaaf('0x46')]);_0x11e4a3['where']=qs[_0xcaaf('0x3f')](_[_0xcaaf('0x48')](_0x1b27df[_0xcaaf('0x40')],_0x30b544[_0xcaaf('0x3f')]));_0x11e4a3[_0xcaaf('0x47')]['VoiceQueueId']=_0x58f134['id'];if(_0x1b27df[_0xcaaf('0x40')]['filter']){_0x11e4a3[_0xcaaf('0x47')]=_['merge'](_0x11e4a3[_0xcaaf('0x47')],{'$or':_['map'](_0x11e4a3['attributes'],function(_0x3d45df){var _0x31113e={};_0x31113e[_0x3d45df]={'$like':'%'+_0x1b27df[_0xcaaf('0x40')][_0xcaaf('0x2e')]+'%'};return _0x31113e;})});}_0x11e4a3=_[_0xcaaf('0x49')]({},_0x11e4a3,_0x1b27df['options']);return db[_0xcaaf('0x64')][_0xcaaf('0x21')]({'where':_0x11e4a3[_0xcaaf('0x47')]})[_0xcaaf('0x29')](function(_0x5d358a){_0x5614c8['count']=_0x5d358a;if(_0x1b27df['query'][_0xcaaf('0x4d')]){_0x11e4a3[_0xcaaf('0x4e')]=[{'all':!![]}];}return db[_0xcaaf('0x64')]['findAll'](_0x11e4a3);})[_0xcaaf('0x29')](function(_0x216853){_0x5614c8['rows']=_0x216853;return _0x5614c8;});}})['then'](respondWithFilteredResult(_0x170c15,_0x11e4a3))[_0xcaaf('0x50')](handleError(_0x170c15,null));};exports[_0xcaaf('0x66')]=function(_0x4acd87,_0x575eed,_0x5eb172){var _0x2ffad7={'raw':!![],'where':{}};var _0xf998a0={};var _0xd7242f={'count':0x0,'rows':[]};return db[_0xcaaf('0x4c')][_0xcaaf('0x67')]({'where':{'id':_0x4acd87['params']['id']}})['then'](handleEntityNotFound(_0x575eed,null))[_0xcaaf('0x29')](function(_0x208b08){if(_0x208b08){_0xf998a0['model']=_[_0xcaaf('0x3e')](db[_0xcaaf('0x68')]['rawAttributes']);_0xf998a0[_0xcaaf('0x40')]=_[_0xcaaf('0x3e')](_0x4acd87[_0xcaaf('0x40')]);_0xf998a0[_0xcaaf('0x3f')]=_[_0xcaaf('0x53')](_0xf998a0[_0xcaaf('0x3d')],_0xf998a0[_0xcaaf('0x40')]);_0x2ffad7[_0xcaaf('0x42')]=_[_0xcaaf('0x53')](_0xf998a0[_0xcaaf('0x3d')],qs['fields'](_0x4acd87[_0xcaaf('0x40')][_0xcaaf('0x41')]));_0x2ffad7[_0xcaaf('0x42')]=_0x2ffad7['attributes'][_0xcaaf('0x43')]?_0x2ffad7[_0xcaaf('0x42')]:_0xf998a0[_0xcaaf('0x3d')];if(!_0x4acd87[_0xcaaf('0x40')]['hasOwnProperty'](_0xcaaf('0x45'))){_0x2ffad7['limit']=qs['limit'](_0x4acd87[_0xcaaf('0x40')][_0xcaaf('0x20')]);_0x2ffad7['offset']=qs[_0xcaaf('0x22')](_0x4acd87[_0xcaaf('0x40')]['offset']);}_0x2ffad7[_0xcaaf('0x65')]=qs[_0xcaaf('0x46')](_0x4acd87[_0xcaaf('0x40')]['sort']);_0x2ffad7[_0xcaaf('0x47')]=qs[_0xcaaf('0x3f')](_[_0xcaaf('0x48')](_0x4acd87[_0xcaaf('0x40')],_0xf998a0[_0xcaaf('0x3f')]));_0x2ffad7[_0xcaaf('0x47')][_0xcaaf('0x69')]=_0x208b08['id'];if(_0x4acd87[_0xcaaf('0x40')][_0xcaaf('0x2e')]){_0x2ffad7['where']=_[_0xcaaf('0x49')](_0x2ffad7[_0xcaaf('0x47')],{'$or':_['map'](_0x2ffad7['attributes'],function(_0x3a631c){var _0x29a759={};_0x29a759[_0x3a631c]={'$like':'%'+_0x4acd87['query']['filter']+'%'};return _0x29a759;})});}_0x2ffad7=_[_0xcaaf('0x49')]({},_0x2ffad7,_0x4acd87[_0xcaaf('0x4b')]);return db[_0xcaaf('0x68')][_0xcaaf('0x21')]({'where':_0x2ffad7[_0xcaaf('0x47')]})[_0xcaaf('0x29')](function(_0x33a955){_0xd7242f[_0xcaaf('0x21')]=_0x33a955;if(_0x4acd87[_0xcaaf('0x40')][_0xcaaf('0x4d')]){_0x2ffad7['include']=[{'all':!![]}];}return db[_0xcaaf('0x68')][_0xcaaf('0x6a')](_0x2ffad7);})[_0xcaaf('0x29')](function(_0x39db13){_0xd7242f['rows']=_0x39db13;return _0xd7242f;});}})[_0xcaaf('0x29')](respondWithFilteredResult(_0x575eed,_0x2ffad7))[_0xcaaf('0x50')](handleError(_0x575eed,null));};exports[_0xcaaf('0x6b')]=function(_0x41940c,_0xb29707,_0x350d7c){var _0x19ce1a={'raw':!![],'where':{}};var _0x3ba3f7={};var _0x533b5d={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x41940c[_0xcaaf('0x52')]['id']}})['then'](handleEntityNotFound(_0xb29707,null))['then'](function(_0x134c09){if(_0x134c09){_0x3ba3f7[_0xcaaf('0x3d')]=_[_0xcaaf('0x3e')](db[_0xcaaf('0x6c')][_0xcaaf('0x5e')]);_0x3ba3f7[_0xcaaf('0x40')]=_[_0xcaaf('0x3e')](_0x41940c[_0xcaaf('0x40')]);_0x3ba3f7[_0xcaaf('0x3f')]=_[_0xcaaf('0x53')](_0x3ba3f7[_0xcaaf('0x3d')],_0x3ba3f7[_0xcaaf('0x40')]);_0x19ce1a['attributes']=_[_0xcaaf('0x53')](_0x3ba3f7[_0xcaaf('0x3d')],qs[_0xcaaf('0x41')](_0x41940c['query'][_0xcaaf('0x41')]));_0x19ce1a[_0xcaaf('0x42')]=_0x19ce1a[_0xcaaf('0x42')][_0xcaaf('0x43')]?_0x19ce1a[_0xcaaf('0x42')]:_0x3ba3f7['model'];if(!_0x41940c[_0xcaaf('0x40')][_0xcaaf('0x44')](_0xcaaf('0x45'))){_0x19ce1a[_0xcaaf('0x20')]=qs[_0xcaaf('0x20')](_0x41940c[_0xcaaf('0x40')][_0xcaaf('0x20')]);_0x19ce1a[_0xcaaf('0x22')]=qs[_0xcaaf('0x22')](_0x41940c[_0xcaaf('0x40')][_0xcaaf('0x22')]);}_0x19ce1a[_0xcaaf('0x65')]=qs[_0xcaaf('0x46')](_0x41940c['query']['sort']);_0x19ce1a['where']=qs[_0xcaaf('0x3f')](_[_0xcaaf('0x48')](_0x41940c[_0xcaaf('0x40')],_0x3ba3f7[_0xcaaf('0x3f')]));_0x19ce1a[_0xcaaf('0x47')][_0xcaaf('0x69')]=_0x134c09['id'];if(_0x41940c[_0xcaaf('0x40')][_0xcaaf('0x2e')]){_0x19ce1a[_0xcaaf('0x47')]=_[_0xcaaf('0x49')](_0x19ce1a['where'],{'$or':_[_0xcaaf('0x30')](_0x19ce1a[_0xcaaf('0x42')],function(_0x3edfba){var _0x57c543={};_0x57c543[_0x3edfba]={'$like':'%'+_0x41940c[_0xcaaf('0x40')]['filter']+'%'};return _0x57c543;})});}_0x19ce1a=_[_0xcaaf('0x49')]({},_0x19ce1a,_0x41940c['options']);return db[_0xcaaf('0x6c')][_0xcaaf('0x21')]({'where':_0x19ce1a['where']})['then'](function(_0x45ceb0){_0x533b5d[_0xcaaf('0x21')]=_0x45ceb0;if(_0x41940c[_0xcaaf('0x40')]['includeAll']){_0x19ce1a[_0xcaaf('0x4e')]=[{'all':!![]}];}return db[_0xcaaf('0x6c')]['findAll'](_0x19ce1a);})[_0xcaaf('0x29')](function(_0x247eed){_0x533b5d['rows']=_0x247eed;return _0x533b5d;});}})[_0xcaaf('0x29')](respondWithFilteredResult(_0xb29707,_0x19ce1a))[_0xcaaf('0x50')](handleError(_0xb29707,null));};exports[_0xcaaf('0x6d')]=function(_0x13ce94,_0x3f3943,_0x3129a9){var _0xbf198f={'raw':!![],'where':{}};var _0xb3f5f7={};var _0x1d6a0c={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xcaaf('0x67')]({'where':{'id':_0x13ce94['params']['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x3f3943,null))['then'](function(_0x2946f0){if(_0x2946f0){_0xb3f5f7[_0xcaaf('0x3d')]=_['keys'](db[_0xcaaf('0x6e')][_0xcaaf('0x5e')]);_0xb3f5f7['query']=_[_0xcaaf('0x3e')](_0x13ce94[_0xcaaf('0x40')]);_0xb3f5f7['filters']=_[_0xcaaf('0x53')](_0xb3f5f7[_0xcaaf('0x3d')],_0xb3f5f7[_0xcaaf('0x40')]);_0xbf198f['attributes']=_[_0xcaaf('0x53')](_0xb3f5f7[_0xcaaf('0x3d')],qs['fields'](_0x13ce94[_0xcaaf('0x40')][_0xcaaf('0x41')]));_0xbf198f[_0xcaaf('0x42')]=_0xbf198f[_0xcaaf('0x42')][_0xcaaf('0x43')]?_0xbf198f[_0xcaaf('0x42')]:_0xb3f5f7[_0xcaaf('0x3d')];if(!_0x13ce94['query']['hasOwnProperty']('nolimit')){_0xbf198f[_0xcaaf('0x20')]=qs[_0xcaaf('0x20')](_0x13ce94['query'][_0xcaaf('0x20')]);_0xbf198f['offset']=qs[_0xcaaf('0x22')](_0x13ce94['query'][_0xcaaf('0x22')]);}_0xbf198f[_0xcaaf('0x65')]=qs['sort'](_0x13ce94[_0xcaaf('0x40')][_0xcaaf('0x46')]);_0xbf198f['where']=qs[_0xcaaf('0x3f')](_[_0xcaaf('0x48')](_0x13ce94[_0xcaaf('0x40')],_0xb3f5f7[_0xcaaf('0x3f')]));_0xbf198f[_0xcaaf('0x47')][_0xcaaf('0x69')]=_0x2946f0['id'];if(_0x13ce94[_0xcaaf('0x40')][_0xcaaf('0x2e')]){_0xbf198f[_0xcaaf('0x47')]=_['merge'](_0xbf198f[_0xcaaf('0x47')],{'$or':_[_0xcaaf('0x30')](_0xbf198f[_0xcaaf('0x42')],function(_0x40bf4d){var _0x49b260={};_0x49b260[_0x40bf4d]={'$like':'%'+_0x13ce94['query'][_0xcaaf('0x2e')]+'%'};return _0x49b260;})});}_0xbf198f=_['merge']({},_0xbf198f,_0x13ce94[_0xcaaf('0x4b')]);return db['CmHopperBlack'][_0xcaaf('0x21')]({'where':_0xbf198f['where']})[_0xcaaf('0x29')](function(_0x391365){_0x1d6a0c[_0xcaaf('0x21')]=_0x391365;if(_0x13ce94[_0xcaaf('0x40')]['includeAll']){_0xbf198f[_0xcaaf('0x4e')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xcaaf('0x6a')](_0xbf198f);})[_0xcaaf('0x29')](function(_0x573a25){_0x1d6a0c['rows']=_0x573a25;return _0x1d6a0c;});}})[_0xcaaf('0x29')](respondWithFilteredResult(_0x3f3943,_0xbf198f))[_0xcaaf('0x50')](handleError(_0x3f3943,null));};exports[_0xcaaf('0x6f')]=function(_0x2222d8,_0x2867e6,_0x53389e){var _0xa6e28a={};var _0x39feff={};var _0x56e144;var _0x4b79a;return db[_0xcaaf('0x4c')][_0xcaaf('0x67')]({'where':{'id':_0x2222d8['params']['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x2867e6,null))[_0xcaaf('0x29')](function(_0x31df8b){if(_0x31df8b){_0x56e144=_0x31df8b;_0x39feff[_0xcaaf('0x3d')]=_[_0xcaaf('0x3e')](db[_0xcaaf('0x70')][_0xcaaf('0x5e')]);_0x39feff['query']=_['keys'](_0x2222d8[_0xcaaf('0x40')]);_0x39feff[_0xcaaf('0x3f')]=_['intersection'](_0x39feff[_0xcaaf('0x3d')],_0x39feff[_0xcaaf('0x40')]);_0xa6e28a[_0xcaaf('0x42')]=_[_0xcaaf('0x53')](_0x39feff[_0xcaaf('0x3d')],qs['fields'](_0x2222d8[_0xcaaf('0x40')][_0xcaaf('0x41')]));_0xa6e28a[_0xcaaf('0x42')]=_0xa6e28a[_0xcaaf('0x42')][_0xcaaf('0x43')]?_0xa6e28a[_0xcaaf('0x42')]:_0x39feff['model'];_0xa6e28a[_0xcaaf('0x65')]=qs[_0xcaaf('0x46')](_0x2222d8['query'][_0xcaaf('0x46')]);_0xa6e28a[_0xcaaf('0x47')]=qs[_0xcaaf('0x3f')](_[_0xcaaf('0x48')](_0x2222d8[_0xcaaf('0x40')],_0x39feff[_0xcaaf('0x3f')]));if(_0x2222d8[_0xcaaf('0x40')][_0xcaaf('0x2e')]){_0xa6e28a[_0xcaaf('0x47')]=_['merge'](_0xa6e28a[_0xcaaf('0x47')],{'$or':_[_0xcaaf('0x30')](_0xa6e28a[_0xcaaf('0x42')],function(_0x215f4c){var _0x121bef={};_0x121bef[_0x215f4c]={'$like':'%'+_0x2222d8['query'][_0xcaaf('0x2e')]+'%'};return _0x121bef;})});}_0xa6e28a=_[_0xcaaf('0x49')]({},_0xa6e28a,_0x2222d8['options']);return _0x56e144[_0xcaaf('0x6f')](_0xa6e28a);}})[_0xcaaf('0x29')](function(_0x4235bc){if(_0x4235bc){_0x4b79a=_0x4235bc[_0xcaaf('0x43')];if(!_0x2222d8[_0xcaaf('0x40')]['hasOwnProperty']('nolimit')){_0xa6e28a[_0xcaaf('0x20')]=qs['limit'](_0x2222d8[_0xcaaf('0x40')][_0xcaaf('0x20')]);_0xa6e28a[_0xcaaf('0x22')]=qs[_0xcaaf('0x22')](_0x2222d8[_0xcaaf('0x40')][_0xcaaf('0x22')]);}return _0x56e144[_0xcaaf('0x6f')](_0xa6e28a);}})[_0xcaaf('0x29')](function(_0x5a14a1){if(_0x5a14a1){return _0x5a14a1?{'count':_0x4b79a,'rows':_0x5a14a1}:null;}})[_0xcaaf('0x29')](respondWithResult(_0x2867e6,null))[_0xcaaf('0x50')](handleError(_0x2867e6,null));};exports[_0xcaaf('0x71')]=function(_0x141bbf,_0x14bc83,_0x428424){var _0x5ce1f9=_0x141bbf[_0xcaaf('0x55')]['teams'];var _0x468220=_[_0xcaaf('0x30')](_0x5ce1f9,'id');return db[_0xcaaf('0x70')][_0xcaaf('0x6a')]({'where':{'id':_0x468220},'attributes':['id'],'include':[{'model':db[_0xcaaf('0x72')],'as':'Agents','attributes':['id','name',_0xcaaf('0x73'),_0xcaaf('0x74'),_0xcaaf('0x75')],'raw':!![]}]})[_0xcaaf('0x29')](function(_0x309971){if(_0x309971){var _0x3a37f0=_['flatMap'](_0x309971,function(_0x388a3a){var _0x5753dc=_0x388a3a[_0xcaaf('0x57')]({'plain':!![]});_0x5753dc[_0xcaaf('0x76')][_0xcaaf('0x77')](function(_0x5b4560){_0x5b4560[_0xcaaf('0x78')]=_[_0xcaaf('0x33')](_0x5ce1f9,{'id':_0x5753dc['id']})[_0xcaaf('0x78')];});return _0x5753dc[_0xcaaf('0x76')];});return db[_0xcaaf('0x4c')][_0xcaaf('0x33')]({'where':{'id':_0x141bbf[_0xcaaf('0x52')]['id']}})[_0xcaaf('0x29')](function(_0x355c28){return db['sequelize'][_0xcaaf('0x79')](function(_0x408fdf){return _0x355c28['addTeams'](_0x468220,{'transaction':_0x408fdf})[_0xcaaf('0x29')](function(){return BPromise['each'](_0x5ce1f9,function(_0x1da9e3){return db['TeamVoiceQueue']['upsert']({'TeamId':_0x1da9e3['id'],'VoiceQueueId':_0x141bbf[_0xcaaf('0x52')]['id'],'penalty':_0x1da9e3[_0xcaaf('0x78')]},{'transaction':_0x408fdf});});})[_0xcaaf('0x29')](function(){return BPromise[_0xcaaf('0x7a')](_0x3a37f0,function(_0x5eb0c4){return db[_0xcaaf('0x7b')][_0xcaaf('0x7c')]({'where':{'UserId':_0x5eb0c4['id'],'VoiceQueueId':_0x141bbf[_0xcaaf('0x52')]['id']},'defaults':{'penalty':_0x5eb0c4['penalty']},'transaction':_0x408fdf});});})[_0xcaaf('0x29')](function(){return BPromise['each'](_['filter'](_0x3a37f0,{'online':!![]}),function(_0xa7037a){return db[_0xcaaf('0x7d')][_0xcaaf('0x7e')]({'membername':_0xa7037a[_0xcaaf('0x34')],'UserId':_0xa7037a['id'],'queue_name':_0x355c28[_0xcaaf('0x34')],'VoiceQueueId':_0x355c28['id'],'interface':_[_0xcaaf('0x7f')](_0xa7037a[_0xcaaf('0x75')])?util[_0xcaaf('0x80')]('SIP/%s',_0xa7037a[_0xcaaf('0x34')]):_0xa7037a[_0xcaaf('0x75')],'paused':_0xa7037a['voicePause']||![],'penalty':_0xa7037a[_0xcaaf('0x78')]},{'transaction':_0x408fdf});});})['then'](function(){_0x3a37f0[_0xcaaf('0x77')](function(_0x5a9d46){socket[_0xcaaf('0x81')]('userVoiceQueue:save',{'UserId':_0x5a9d46['id'],'VoiceQueueId':_0x355c28['id']});});});});});}})[_0xcaaf('0x29')](respondWithStatusCode(_0x14bc83,null))[_0xcaaf('0x50')](handleError(_0x14bc83,null));};exports[_0xcaaf('0x82')]=function(_0x72fcbf,_0x53230f,_0x5250e3){return db[_0xcaaf('0x70')]['findAll']({'where':{'id':_0x72fcbf['query'][_0xcaaf('0x83')]},'attributes':['id'],'include':[{'model':db[_0xcaaf('0x72')],'as':_0xcaaf('0x76'),'attributes':['id'],'raw':!![]}]})[_0xcaaf('0x29')](handleEntityNotFound(_0x53230f,null))[_0xcaaf('0x29')](function(_0x27b76f){var _0x26d915=_['map'](_0x27b76f,'id');var _0x43877d=[];var _0x534ea8=[];var _0x214ff8=squel[_0xcaaf('0x84')]();_0x214ff8[_0xcaaf('0x85')](_0xcaaf('0x86'))[_0xcaaf('0x87')](_0xcaaf('0x88'),'tq')[_0xcaaf('0x89')]('user_has_teams','ut',_0xcaaf('0x8a'))[_0xcaaf('0x47')]('VoiceQueueId\x20=\x20?',_0x72fcbf[_0xcaaf('0x52')]['id']);for(var _0x174477=0x0;_0x174477<_0x27b76f[_0xcaaf('0x43')];_0x174477+=0x1){let _0x57d0db=_0x27b76f[_0x174477];for(var _0x2986eb=0x0;_0x2986eb<_0x57d0db[_0xcaaf('0x76')][_0xcaaf('0x43')];_0x2986eb+=0x1){let _0x3563c1=_0x57d0db[_0xcaaf('0x76')][_0x2986eb];var _0x29b03f=_0x214ff8[_0xcaaf('0x5d')]();_0x29b03f['where'](_0xcaaf('0x8b'),_0x3563c1['id']);_0x534ea8[_0xcaaf('0x8c')](db['sequelize']['query'](_0x29b03f[_0xcaaf('0x8d')](),{'type':db[_0xcaaf('0x8e')]['QueryTypes'][_0xcaaf('0x8f')]})[_0xcaaf('0x29')](function(_0x49efa8){if(_0x49efa8['length']===0x1){return _0x3563c1['id'];}else{var _0x5ee8ee=_[_0xcaaf('0x90')](_['map'](_0x49efa8,'TeamId'),function(_0x75d543){return _[_0xcaaf('0x91')](_0x26d915,_0x75d543);});if(_0x5ee8ee){return _0x3563c1['id'];}}}));}}return BPromise[_0xcaaf('0x92')](_0x534ea8)[_0xcaaf('0x29')](function(_0x5b5ea0){_0x43877d=_(_0x43877d)[_0xcaaf('0x93')](_0x5b5ea0)[_0xcaaf('0x94')]()['value']();return db[_0xcaaf('0x4c')][_0xcaaf('0x33')]({'where':{'id':_0x72fcbf[_0xcaaf('0x52')]['id']}})['then'](function(_0x5b3909){return db['sequelize'][_0xcaaf('0x79')](function(_0x74bca3){return _0x5b3909[_0xcaaf('0x82')](_0x72fcbf['query']['ids'],{'transaction':_0x74bca3})['then'](function(){if(!_[_0xcaaf('0x95')](_0x43877d)){return _0x5b3909[_0xcaaf('0x96')](_0x43877d,{'transaction':_0x74bca3})[_0xcaaf('0x29')](function(){return db['UserVoiceQueueRt'][_0xcaaf('0x36')]({'where':{'VoiceQueueId':_0x72fcbf['params']['id'],'UserId':_0x43877d},'transaction':_0x74bca3});});}})[_0xcaaf('0x29')](function(){_0x43877d['forEach'](function(_0x5298fb){socket[_0xcaaf('0x81')]('userVoiceQueue:remove',{'UserId':_0x5298fb,'VoiceQueueId':_0x5b3909['id']});});});});});});})[_0xcaaf('0x29')](respondWithStatusCode(_0x53230f,null))[_0xcaaf('0x50')](handleError(_0x53230f,null));};exports[_0xcaaf('0x97')]=function(_0x37ceac,_0x5c657a,_0x2981a6){var _0x10107c,_0x93dfda;return db[_0xcaaf('0x4c')][_0xcaaf('0x33')]({'where':{'id':_0x37ceac['params']['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x5c657a,null))[_0xcaaf('0x29')](function(_0x15ab82){if(_0x15ab82){_0x93dfda=_0x15ab82;return _0x15ab82[_0xcaaf('0x97')](_0x37ceac[_0xcaaf('0x55')][_0xcaaf('0x83')],_[_0xcaaf('0x5f')](_0x37ceac['body'],['ids','id'])||{})['spread'](function(_0x29be61){for(var _0x34a149=0x0;_0x34a149<_0x37ceac['body']['ids']['length'];_0x34a149+=0x1){socket['emit'](_0xcaaf('0x98'),{'UserId':Number(_0x37ceac['body']['ids'][_0x34a149]),'VoiceQueueId':Number(_0x37ceac[_0xcaaf('0x52')]['id'])});}return _0x29be61;});}})[_0xcaaf('0x29')](function(_0x4b852c){_0x10107c=_0x4b852c||[];if(_0x93dfda){return db['User'][_0xcaaf('0x6a')]({'where':{'id':_0x37ceac[_0xcaaf('0x55')][_0xcaaf('0x83')]},'attributes':['id',_0xcaaf('0x34'),'online',_0xcaaf('0x74'),_0xcaaf('0x75')],'raw':!![]});}})[_0xcaaf('0x29')](function(_0x35bf2a){if(!_[_0xcaaf('0x95')](_0x35bf2a)){var _0x4c32c3=[];for(var _0x1f675f=0x0;_0x1f675f<_0x35bf2a[_0xcaaf('0x43')];_0x1f675f++){if(_0x35bf2a[_0x1f675f][_0xcaaf('0x73')]){_0x4c32c3[_0xcaaf('0x8c')](db[_0xcaaf('0x7d')][_0xcaaf('0x7e')]({'membername':_0x35bf2a[_0x1f675f][_0xcaaf('0x34')],'UserId':_0x35bf2a[_0x1f675f]['id'],'queue_name':_0x93dfda[_0xcaaf('0x34')],'VoiceQueueId':_0x93dfda['id'],'interface':_[_0xcaaf('0x7f')](_0x35bf2a[_0x1f675f][_0xcaaf('0x75')])?util[_0xcaaf('0x80')](_0xcaaf('0x99'),_0x35bf2a[_0x1f675f][_0xcaaf('0x34')]):_0x35bf2a[_0x1f675f][_0xcaaf('0x75')],'paused':_0x35bf2a[_0x1f675f][_0xcaaf('0x74')]||![],'penalty':_0x37ceac[_0xcaaf('0x55')]['penalty']||0x0}));}}return BPromise[_0xcaaf('0x92')](_0x4c32c3);}})['then'](function(){return _0x10107c;})[_0xcaaf('0x29')](respondWithResult(_0x5c657a,null))[_0xcaaf('0x50')](handleError(_0x5c657a,null));};exports[_0xcaaf('0x96')]=function(_0x36e48c,_0x2e12bf,_0x2fcb83){return db[_0xcaaf('0x4c')]['find']({'where':{'id':_0x36e48c[_0xcaaf('0x52')]['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x2e12bf,null))['then'](function(_0x2fdb86){if(_0x2fdb86){return _0x2fdb86[_0xcaaf('0x96')](_0x36e48c[_0xcaaf('0x40')]['ids'])[_0xcaaf('0x29')](function(){if(_[_0xcaaf('0x9a')](_0x36e48c[_0xcaaf('0x40')][_0xcaaf('0x83')])){for(var _0x1522ea=0x0;_0x1522ea<_0x36e48c[_0xcaaf('0x40')][_0xcaaf('0x83')][_0xcaaf('0x43')];_0x1522ea+=0x1){socket['emit'](_0xcaaf('0x9b'),{'UserId':Number(_0x36e48c[_0xcaaf('0x40')][_0xcaaf('0x83')][_0x1522ea]),'VoiceQueueId':Number(_0x36e48c[_0xcaaf('0x52')]['id'])});}}else{socket['emit'](_0xcaaf('0x9b'),{'UserId':Number(_0x36e48c['query'][_0xcaaf('0x83')]),'VoiceQueueId':Number(_0x36e48c['params']['id'])});}});}})[_0xcaaf('0x29')](function(_0x380a81){return db['UserVoiceQueueRt'][_0xcaaf('0x36')]({'where':{'VoiceQueueId':_0x36e48c[_0xcaaf('0x52')]['id'],'UserId':_0x36e48c[_0xcaaf('0x40')]['ids']}})['then'](function(){return _0x380a81;});})[_0xcaaf('0x29')](respondWithStatusCode(_0x2e12bf,null))[_0xcaaf('0x50')](handleError(_0x2e12bf,null));};exports[_0xcaaf('0x9c')]=function(_0x106633,_0x26c4ca,_0x1a7199){var _0x1a9084={};var _0x2137a5={};var _0x541a6b;var _0x168a96;return db['VoiceQueue'][_0xcaaf('0x67')]({'where':{'id':_0x106633[_0xcaaf('0x52')]['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x26c4ca,null))[_0xcaaf('0x29')](function(_0x402b32){if(_0x402b32){_0x541a6b=_0x402b32;_0x2137a5[_0xcaaf('0x3d')]=_[_0xcaaf('0x3e')](db['User']['rawAttributes']);_0x2137a5[_0xcaaf('0x40')]=_[_0xcaaf('0x3e')](_0x106633[_0xcaaf('0x40')]);_0x2137a5['filters']=_[_0xcaaf('0x53')](_0x2137a5[_0xcaaf('0x3d')],_0x2137a5['query']);_0x1a9084[_0xcaaf('0x42')]=_['intersection'](_0x2137a5[_0xcaaf('0x3d')],qs[_0xcaaf('0x41')](_0x106633[_0xcaaf('0x40')][_0xcaaf('0x41')]));_0x1a9084[_0xcaaf('0x42')]=_0x1a9084[_0xcaaf('0x42')][_0xcaaf('0x43')]?_0x1a9084[_0xcaaf('0x42')]:_0x2137a5[_0xcaaf('0x3d')];_0x1a9084['order']=qs[_0xcaaf('0x46')](_0x106633[_0xcaaf('0x40')][_0xcaaf('0x46')]);_0x1a9084['where']=qs[_0xcaaf('0x3f')](_[_0xcaaf('0x48')](_0x106633['query'],_0x2137a5[_0xcaaf('0x3f')]));if(_0x106633[_0xcaaf('0x40')][_0xcaaf('0x2e')]){_0x1a9084[_0xcaaf('0x47')]=_[_0xcaaf('0x49')](_0x1a9084[_0xcaaf('0x47')],{'$or':_['map'](_0x1a9084['attributes'],function(_0x1aa8e3){var _0x164db0={};_0x164db0[_0x1aa8e3]={'$like':'%'+_0x106633['query']['filter']+'%'};return _0x164db0;})});}_0x1a9084=_[_0xcaaf('0x49')]({},_0x1a9084,_0x106633[_0xcaaf('0x4b')]);return _0x541a6b['getAgents'](_0x1a9084);}})['then'](function(_0x53f736){if(_0x53f736){_0x168a96=_0x53f736[_0xcaaf('0x43')];if(!_0x106633[_0xcaaf('0x40')][_0xcaaf('0x44')](_0xcaaf('0x45'))){_0x1a9084[_0xcaaf('0x20')]=qs[_0xcaaf('0x20')](_0x106633[_0xcaaf('0x40')][_0xcaaf('0x20')]);_0x1a9084['offset']=qs[_0xcaaf('0x22')](_0x106633[_0xcaaf('0x40')][_0xcaaf('0x22')]);}return _0x541a6b[_0xcaaf('0x9c')](_0x1a9084);}})[_0xcaaf('0x29')](function(_0x2c984d){if(_0x2c984d){return _0x2c984d?{'count':_0x168a96,'rows':_0x2c984d}:null;}})[_0xcaaf('0x29')](respondWithResult(_0x26c4ca,null))[_0xcaaf('0x50')](handleError(_0x26c4ca,null));};exports[_0xcaaf('0x9d')]=function(_0x40d661,_0x5d5ee3,_0x2332b5){var _0x14eb32={};var _0x70e4be={};var _0x2a8933;var _0x1e8ad5;return db[_0xcaaf('0x4c')][_0xcaaf('0x67')]({'where':{'id':_0x40d661['params']['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x5d5ee3,null))['then'](function(_0x1b6882){if(_0x1b6882){_0x2a8933=_0x1b6882;_0x70e4be[_0xcaaf('0x3d')]=_[_0xcaaf('0x3e')](db[_0xcaaf('0x7d')]['rawAttributes']);_0x70e4be[_0xcaaf('0x40')]=_['keys'](_0x40d661[_0xcaaf('0x40')]);_0x70e4be[_0xcaaf('0x3f')]=_[_0xcaaf('0x53')](_0x70e4be['model'],_0x70e4be['query']);_0x14eb32[_0xcaaf('0x42')]=_[_0xcaaf('0x53')](_0x70e4be[_0xcaaf('0x3d')],qs[_0xcaaf('0x41')](_0x40d661[_0xcaaf('0x40')][_0xcaaf('0x41')]));_0x14eb32[_0xcaaf('0x42')]=_0x14eb32[_0xcaaf('0x42')][_0xcaaf('0x43')]?_0x14eb32['attributes']:_0x70e4be[_0xcaaf('0x3d')];_0x14eb32[_0xcaaf('0x65')]=qs['sort'](_0x40d661[_0xcaaf('0x40')][_0xcaaf('0x46')]);_0x14eb32[_0xcaaf('0x47')]=qs[_0xcaaf('0x3f')](_[_0xcaaf('0x48')](_0x40d661[_0xcaaf('0x40')],_0x70e4be[_0xcaaf('0x3f')]));if(_0x40d661[_0xcaaf('0x40')][_0xcaaf('0x2e')]){_0x14eb32['where']=_['merge'](_0x14eb32[_0xcaaf('0x47')],{'$or':_['map'](_0x14eb32[_0xcaaf('0x42')],function(_0xc28592){var _0x15389f={};_0x15389f[_0xc28592]={'$like':'%'+_0x40d661['query']['filter']+'%'};return _0x15389f;})});}_0x14eb32=_[_0xcaaf('0x49')]({},_0x14eb32,_0x40d661[_0xcaaf('0x4b')]);return _0x2a8933[_0xcaaf('0x9d')](_0x14eb32);}})[_0xcaaf('0x29')](function(_0x3ffd4e){if(_0x3ffd4e){_0x1e8ad5=_0x3ffd4e['length'];if(!_0x40d661[_0xcaaf('0x40')][_0xcaaf('0x44')](_0xcaaf('0x45'))){_0x14eb32[_0xcaaf('0x20')]=qs[_0xcaaf('0x20')](_0x40d661[_0xcaaf('0x40')]['limit']);_0x14eb32['offset']=qs[_0xcaaf('0x22')](_0x40d661[_0xcaaf('0x40')][_0xcaaf('0x22')]);}return _0x2a8933['getMembers'](_0x14eb32);}})[_0xcaaf('0x29')](function(_0x2931c4){return _0x2931c4?{'count':_0x1e8ad5,'rows':_0x2931c4}:null;})[_0xcaaf('0x29')](respondWithResult(_0x5d5ee3,null))['catch'](handleError(_0x5d5ee3,null));};exports[_0xcaaf('0x9e')]=function(_0x4145f2,_0x23e686,_0x55e7d8){var _0x4354e2={};var _0xd2db7c={};var _0x14285c;var _0x284d84;return db[_0xcaaf('0x4c')][_0xcaaf('0x67')]({'where':{'id':_0x4145f2[_0xcaaf('0x52')]['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x23e686,null))[_0xcaaf('0x29')](function(_0x58904e){if(_0x58904e){_0x14285c=_0x58904e;_0xd2db7c[_0xcaaf('0x3d')]=_['keys'](db[_0xcaaf('0x9f')][_0xcaaf('0x5e')]);_0xd2db7c[_0xcaaf('0x40')]=_[_0xcaaf('0x3e')](_0x4145f2[_0xcaaf('0x40')]);_0xd2db7c[_0xcaaf('0x3f')]=_[_0xcaaf('0x53')](_0xd2db7c[_0xcaaf('0x3d')],_0xd2db7c[_0xcaaf('0x40')]);_0x4354e2[_0xcaaf('0x42')]=_['intersection'](_0xd2db7c[_0xcaaf('0x3d')],qs['fields'](_0x4145f2[_0xcaaf('0x40')][_0xcaaf('0x41')]));_0x4354e2[_0xcaaf('0x42')]=_0x4354e2['attributes']['length']?_0x4354e2[_0xcaaf('0x42')]:_0xd2db7c[_0xcaaf('0x3d')];_0x4354e2[_0xcaaf('0x65')]=qs[_0xcaaf('0x46')](_0x4145f2[_0xcaaf('0x40')][_0xcaaf('0x46')]);_0x4354e2[_0xcaaf('0x47')]=qs['filters'](_[_0xcaaf('0x48')](_0x4145f2[_0xcaaf('0x40')],_0xd2db7c[_0xcaaf('0x3f')]));if(_0x4145f2['query'][_0xcaaf('0x2e')]){_0x4354e2[_0xcaaf('0x47')]=_['merge'](_0x4354e2['where'],{'$or':_['map'](_0x4354e2[_0xcaaf('0x42')],function(_0x120107){var _0x1a2dae={};_0x1a2dae[_0x120107]={'$like':'%'+_0x4145f2[_0xcaaf('0x40')]['filter']+'%'};return _0x1a2dae;})});}_0x4354e2=_[_0xcaaf('0x49')]({},_0x4354e2,_0x4145f2[_0xcaaf('0x4b')]);return _0x14285c[_0xcaaf('0x9e')](_0x4354e2);}})['then'](function(_0x2dc9d7){if(_0x2dc9d7){_0x284d84=_0x2dc9d7[_0xcaaf('0x43')];if(!_0x4145f2['query']['hasOwnProperty'](_0xcaaf('0x45'))){_0x4354e2[_0xcaaf('0x20')]=qs[_0xcaaf('0x20')](_0x4145f2[_0xcaaf('0x40')]['limit']);_0x4354e2[_0xcaaf('0x22')]=qs[_0xcaaf('0x22')](_0x4145f2[_0xcaaf('0x40')][_0xcaaf('0x22')]);}return _0x14285c[_0xcaaf('0x9e')](_0x4354e2);}})[_0xcaaf('0x29')](function(_0x35aaf9){if(_0x35aaf9){return _0x35aaf9?{'count':_0x284d84,'rows':_0x35aaf9}:null;}})[_0xcaaf('0x29')](respondWithResult(_0x23e686,null))['catch'](handleError(_0x23e686,null));};exports['addLists']=function(_0x15f8f9,_0x122730,_0x2e757d){var _0x3c77c7=moment()[_0xcaaf('0x80')](_0xcaaf('0xa0'));var _0x2dcdf4,_0x25786c;return db[_0xcaaf('0x4c')][_0xcaaf('0x33')]({'where':{'id':_0x15f8f9[_0xcaaf('0x52')]['id']}})['then'](handleEntityNotFound(_0x122730,null))['then'](function(_0x226c32){if(_0x226c32){_0x25786c=_0x226c32;return _0x226c32[_0xcaaf('0xa1')](_0x15f8f9['body'][_0xcaaf('0x83')],_['omit'](_0x15f8f9[_0xcaaf('0x55')],[_0xcaaf('0x83'),'id'])||{});}return null;})['spread'](function(_0x464f1c){var _0x1d346f;_0x2dcdf4=_0x464f1c||[];var _0x1160fd=[];if(_0x464f1c){for(var _0x1006d1=0x0;_0x1006d1<_0x464f1c[_0xcaaf('0x43')];_0x1006d1+=0x1){var _0x19e303=_0x464f1c[_0x1006d1]['get']({'plain':!![]});_0x25786c['dialCheckDuplicateType']=_0x15f8f9[_0xcaaf('0x55')][_0xcaaf('0xa2')]?_0x15f8f9['body'][_0xcaaf('0xa2')]:_0x25786c[_0xcaaf('0xa2')];switch(_0x25786c[_0xcaaf('0xa2')]){case _0xcaaf('0xa3'):_0x1d346f=squel[_0xcaaf('0xa4')]()[_0xcaaf('0xa5')]('cm_hopper')[_0xcaaf('0xa6')](['phone','scheduledAt','ContactId','ListId',_0xcaaf('0x69'),_0xcaaf('0x61'),_0xcaaf('0x60')],squel['select']()['field']('phone',_0xcaaf('0xa7'))[_0xcaaf('0x85')]('\x27'+_0x3c77c7+'\x27',_0xcaaf('0xa8'))[_0xcaaf('0x85')]('id',_0xcaaf('0xa9'))['field'](_0x19e303[_0xcaaf('0xaa')][_0xcaaf('0x8d')](),_0xcaaf('0xab'))[_0xcaaf('0x85')](_0x15f8f9[_0xcaaf('0x52')]['id'][_0xcaaf('0x8d')](),_0xcaaf('0x69'))[_0xcaaf('0x85')]('\x27'+_0x3c77c7+'\x27',_0xcaaf('0x61'))[_0xcaaf('0x85')]('\x27'+_0x3c77c7+'\x27',_0xcaaf('0x60'))[_0xcaaf('0x87')](_0xcaaf('0xac'))[_0xcaaf('0x47')](_0xcaaf('0xad'))['where']('ListId\x20=\x20?',_0x19e303[_0xcaaf('0xaa')]['toString']())['where'](_0xcaaf('0xae'))['where'](_0xcaaf('0xaf'),squel[_0xcaaf('0x84')]()['field'](_0xcaaf('0xb0'))[_0xcaaf('0x87')](_0xcaaf('0xb1'))[_0xcaaf('0x47')](_0xcaaf('0xb2'),_0x15f8f9[_0xcaaf('0x52')]['id']['toString']()))[_0xcaaf('0x47')](_0xcaaf('0xaf'),squel['select']()[_0xcaaf('0x85')](_0xcaaf('0xb3'))[_0xcaaf('0x87')]('cm_hopper')['where'](_0xcaaf('0xb2'),_0x15f8f9['params']['id'][_0xcaaf('0x8d')]())))[_0xcaaf('0x8d')]();break;case _0xcaaf('0xb4'):_0x1d346f=squel[_0xcaaf('0xa4')]()[_0xcaaf('0xa5')]('cm_hopper')['fromQuery']([_0xcaaf('0xa7'),_0xcaaf('0xa8'),'ContactId',_0xcaaf('0xab'),'VoiceQueueId',_0xcaaf('0x61'),'updatedAt'],squel[_0xcaaf('0x84')]()[_0xcaaf('0x85')](_0xcaaf('0xa7'),'phone')[_0xcaaf('0x85')]('\x27'+_0x3c77c7+'\x27',_0xcaaf('0xa8'))[_0xcaaf('0x85')]('id',_0xcaaf('0xa9'))[_0xcaaf('0x85')](_0x19e303[_0xcaaf('0xaa')][_0xcaaf('0x8d')](),_0xcaaf('0xab'))['field'](_0x15f8f9[_0xcaaf('0x52')]['id']['toString'](),_0xcaaf('0x69'))[_0xcaaf('0x85')]('\x27'+_0x3c77c7+'\x27',_0xcaaf('0x61'))[_0xcaaf('0x85')]('\x27'+_0x3c77c7+'\x27',_0xcaaf('0x60'))[_0xcaaf('0x87')](_0xcaaf('0xac'))[_0xcaaf('0x47')](_0xcaaf('0xad'))[_0xcaaf('0x47')](_0xcaaf('0xb5'),_0x19e303['CmListId']['toString']())[_0xcaaf('0x47')](_0xcaaf('0xae'))[_0xcaaf('0x47')](_0xcaaf('0xaf'),squel['select']()[_0xcaaf('0x85')](_0xcaaf('0xb3'))[_0xcaaf('0x87')](_0xcaaf('0xb6'))['where'](_0xcaaf('0xb2'),_0x15f8f9[_0xcaaf('0x52')]['id'][_0xcaaf('0x8d')]())))[_0xcaaf('0x8d')]();break;default:_0x1d346f=squel[_0xcaaf('0xa4')]()[_0xcaaf('0xa5')](_0xcaaf('0xb6'))[_0xcaaf('0xa6')]([_0xcaaf('0xa7'),'scheduledAt',_0xcaaf('0xa9'),'ListId',_0xcaaf('0x69'),'createdAt',_0xcaaf('0x60')],squel[_0xcaaf('0x84')]()[_0xcaaf('0x85')](_0xcaaf('0xa7'),_0xcaaf('0xa7'))['field']('\x27'+_0x3c77c7+'\x27',_0xcaaf('0xa8'))[_0xcaaf('0x85')]('id',_0xcaaf('0xa9'))[_0xcaaf('0x85')](_0x19e303[_0xcaaf('0xaa')][_0xcaaf('0x8d')](),'ListId')['field'](_0x15f8f9[_0xcaaf('0x52')]['id'][_0xcaaf('0x8d')](),_0xcaaf('0x69'))[_0xcaaf('0x85')]('\x27'+_0x3c77c7+'\x27','createdAt')['field']('\x27'+_0x3c77c7+'\x27',_0xcaaf('0x60'))[_0xcaaf('0x87')](_0xcaaf('0xac'))[_0xcaaf('0x47')]('deletedAt\x20IS\x20NULL')[_0xcaaf('0x47')]('ListId\x20=\x20?',_0x19e303['CmListId'][_0xcaaf('0x8d')]())['where'](_0xcaaf('0xae')))['toString']();}_0x1160fd[_0xcaaf('0x8c')](db['sequelize']['query'](_0x1d346f));}return BPromise[_0xcaaf('0x92')](_0x1160fd);}})[_0xcaaf('0x29')](function(){var _0x3d84a4=[];var _0x36d7b9=squel[_0xcaaf('0xa4')]()[_0xcaaf('0xa5')](_0xcaaf('0xb7'))[_0xcaaf('0xa6')]([_0xcaaf('0xb8'),_0xcaaf('0xa7'),_0xcaaf('0xb9'),_0xcaaf('0x61'),_0xcaaf('0x60')],squel[_0xcaaf('0x84')]()['field'](_0xcaaf('0xba'))[_0xcaaf('0x85')](_0xcaaf('0xbb'))[_0xcaaf('0x85')](_0xcaaf('0xbc'))['field']('\x27'+_0x3c77c7+'\x27',_0xcaaf('0x61'))[_0xcaaf('0x85')]('\x27'+_0x3c77c7+'\x27',_0xcaaf('0x60'))[_0xcaaf('0x87')](_0xcaaf('0xbd'),'ci')[_0xcaaf('0x89')]('cm_hopper','h',_0xcaaf('0xbe'))[_0xcaaf('0x47')](_0xcaaf('0xbf'),_0x3c77c7)['where'](_0xcaaf('0xc0'),_0xcaaf('0xc1')))[_0xcaaf('0x8d')]();_0x3d84a4[_0xcaaf('0x8c')](db[_0xcaaf('0x8e')][_0xcaaf('0x40')](_0x36d7b9));return BPromise[_0xcaaf('0x92')](_0x3d84a4);})[_0xcaaf('0x29')](function(){return _0x2dcdf4;})[_0xcaaf('0x29')](respondWithResult(_0x122730,null))[_0xcaaf('0x50')](handleError(_0x122730,null));};exports[_0xcaaf('0xc2')]=function(_0x477420,_0x3e2fd0,_0x47893b){return db[_0xcaaf('0x4c')][_0xcaaf('0x33')]({'where':{'id':_0x477420['params']['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x3e2fd0,null))[_0xcaaf('0x29')](function(_0x50494e){if(_0x50494e){return _0x50494e['removeLists'](_0x477420[_0xcaaf('0x40')][_0xcaaf('0x83')]);}})[_0xcaaf('0x29')](function(_0x7fbe59){if(_0x7fbe59){return db[_0xcaaf('0x64')][_0xcaaf('0x36')]({'where':{'ListId':_0x477420['query']['ids'],'VoiceQueueId':_0x477420['params']['id']}})[_0xcaaf('0x29')](function(){return _0x7fbe59;});}})['then'](respondWithStatusCode(_0x3e2fd0,null))[_0xcaaf('0x50')](handleError(_0x3e2fd0,null));};exports[_0xcaaf('0xc3')]=function(_0x80e581,_0x2c1947,_0x5ec143){var _0x3b4bdc={};var _0x327b0a={};var _0x20850c;var _0x16de28;return db[_0xcaaf('0x4c')]['findOne']({'where':{'id':_0x80e581[_0xcaaf('0x52')]['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x2c1947,null))[_0xcaaf('0x29')](function(_0x10e3df){if(_0x10e3df){_0x20850c=_0x10e3df;_0x327b0a[_0xcaaf('0x3d')]=_[_0xcaaf('0x3e')](db['CmList']['rawAttributes']);_0x327b0a[_0xcaaf('0x40')]=_['keys'](_0x80e581['query']);_0x327b0a[_0xcaaf('0x3f')]=_['intersection'](_0x327b0a[_0xcaaf('0x3d')],_0x327b0a['query']);_0x3b4bdc[_0xcaaf('0x42')]=_['intersection'](_0x327b0a[_0xcaaf('0x3d')],qs[_0xcaaf('0x41')](_0x80e581[_0xcaaf('0x40')]['fields']));_0x3b4bdc['attributes']=_0x3b4bdc[_0xcaaf('0x42')][_0xcaaf('0x43')]?_0x3b4bdc['attributes']:_0x327b0a[_0xcaaf('0x3d')];_0x3b4bdc[_0xcaaf('0x65')]=qs['sort'](_0x80e581['query']['sort']);_0x3b4bdc[_0xcaaf('0x47')]=qs[_0xcaaf('0x3f')](_[_0xcaaf('0x48')](_0x80e581['query'],_0x327b0a[_0xcaaf('0x3f')]));if(_0x80e581[_0xcaaf('0x40')][_0xcaaf('0x2e')]){_0x3b4bdc['where']=_[_0xcaaf('0x49')](_0x3b4bdc[_0xcaaf('0x47')],{'$or':_['map'](_0x3b4bdc[_0xcaaf('0x42')],function(_0x40ff82){var _0x102aba={};_0x102aba[_0x40ff82]={'$like':'%'+_0x80e581[_0xcaaf('0x40')][_0xcaaf('0x2e')]+'%'};return _0x102aba;})});}_0x3b4bdc=_[_0xcaaf('0x49')]({},_0x3b4bdc,_0x80e581['options']);return _0x20850c[_0xcaaf('0xc3')](_0x3b4bdc);}})[_0xcaaf('0x29')](function(_0x45b9c4){if(_0x45b9c4){_0x16de28=_0x45b9c4['length'];if(!_0x80e581[_0xcaaf('0x40')][_0xcaaf('0x44')](_0xcaaf('0x45'))){_0x3b4bdc[_0xcaaf('0x20')]=qs[_0xcaaf('0x20')](_0x80e581[_0xcaaf('0x40')]['limit']);_0x3b4bdc[_0xcaaf('0x22')]=qs['offset'](_0x80e581[_0xcaaf('0x40')]['offset']);}return _0x20850c[_0xcaaf('0xc3')](_0x3b4bdc);}})['then'](function(_0x11ca86){if(_0x11ca86){return _0x11ca86?{'count':_0x16de28,'rows':_0x11ca86}:null;}})['then'](respondWithResult(_0x2c1947,null))[_0xcaaf('0x50')](handleError(_0x2c1947,null));};exports[_0xcaaf('0xc4')]=function(_0x1f76cd,_0x56ee5f,_0x28fe6e){var _0x235db6,_0x312db9;return db[_0xcaaf('0x4c')][_0xcaaf('0x33')]({'where':{'id':_0x1f76cd[_0xcaaf('0x52')]['id']}})[_0xcaaf('0x29')](handleEntityNotFound(_0x56ee5f,null))[_0xcaaf('0x29')](function(_0x3f3ae6){if(_0x3f3ae6){_0x312db9=_0x3f3ae6;return _0x3f3ae6[_0xcaaf('0xc4')](_0x1f76cd[_0xcaaf('0x55')][_0xcaaf('0x83')],_[_0xcaaf('0x5f')](_0x1f76cd[_0xcaaf('0x55')],['ids','id'])||{});}return null;})[_0xcaaf('0xc5')](function(_0x794900){var _0x237a6e;_0x235db6=_0x794900||[];var _0x5364e4=[];if(_0x794900){for(var _0x1913ac=0x0;_0x1913ac<_0x794900[_0xcaaf('0x43')];_0x1913ac+=0x1){var _0x5b6042=_0x794900[_0x1913ac]['get']({'plain':!![]});_0x237a6e=squel[_0xcaaf('0xa4')]()[_0xcaaf('0xa5')](_0xcaaf('0xc6'))[_0xcaaf('0xa6')]([_0xcaaf('0xa7'),_0xcaaf('0xa9'),_0xcaaf('0xab'),_0xcaaf('0x69'),_0xcaaf('0x61'),'updatedAt'],squel[_0xcaaf('0x84')]()[_0xcaaf('0x85')](_0xcaaf('0xa7'),_0xcaaf('0xa7'))[_0xcaaf('0x85')]('id',_0xcaaf('0xa9'))[_0xcaaf('0x85')](_0x5b6042[_0xcaaf('0xaa')][_0xcaaf('0x8d')](),_0xcaaf('0xab'))[_0xcaaf('0x85')](_0x1f76cd['params']['id'][_0xcaaf('0x8d')](),_0xcaaf('0x69'))['field'](_0xcaaf('0xc7'),_0xcaaf('0x61'))[_0xcaaf('0x85')](_0xcaaf('0xc7'),_0xcaaf('0x60'))['from'](_0xcaaf('0xac'))[_0xcaaf('0x47')]('deletedAt\x20IS\x20NULL')[_0xcaaf('0x47')](_0xcaaf('0xb5'),_0x5b6042[_0xcaaf('0xaa')]['toString']())['where'](_0xcaaf('0xae')))[_0xcaaf('0x8d')]();_0x5364e4[_0xcaaf('0x8c')](db[_0xcaaf('0x8e')][_0xcaaf('0x40')](_0x237a6e));}return BPromise[_0xcaaf('0x92')](_0x5364e4);}})['then'](function(){return _0x235db6;})[_0xcaaf('0x29')](respondWithResult(_0x56ee5f,null))[_0xcaaf('0x50')](handleError(_0x56ee5f,null));};exports['removeBlackLists']=function(_0x39bdac,_0x12c4c1,_0x2a4521){return db['VoiceQueue']['find']({'where':{'id':_0x39bdac[_0xcaaf('0x52')]['id']}})['then'](handleEntityNotFound(_0x12c4c1,null))[_0xcaaf('0x29')](function(_0x1fe409){if(_0x1fe409){return _0x1fe409[_0xcaaf('0xc8')](_0x39bdac['query']['ids']);}})['then'](function(_0x572b9b){if(_0x572b9b){return db[_0xcaaf('0x6e')][_0xcaaf('0x36')]({'where':{'ListId':_0x39bdac[_0xcaaf('0x40')][_0xcaaf('0x83')],'VoiceQueueId':_0x39bdac[_0xcaaf('0x52')]['id']}})[_0xcaaf('0x29')](function(){return _0x572b9b;});}})[_0xcaaf('0x29')](respondWithStatusCode(_0x12c4c1,null))[_0xcaaf('0x50')](handleError(_0x12c4c1,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 662fa1d..ec3e981 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 _0x423c=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','remove','emit'];(function(_0x34660e,_0x16f7fe){var _0x561cde=function(_0x2b3498){while(--_0x2b3498){_0x34660e['push'](_0x34660e['shift']());}};_0x561cde(++_0x16f7fe);}(_0x423c,0x18b));var _0xc423=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x423c[_0x3d42d8];return _0x27fc41;};'use strict';var EventEmitter=require(_0xc423('0x0'));var VoiceQueue=require(_0xc423('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xc423('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc423('0x3')};function emitEvent(_0x3dcb83){return function(_0x3d23da,_0x921d02,_0x1ae0e6){VoiceQueueEvents[_0xc423('0x4')](_0x3dcb83+':'+_0x3d23da['id'],_0x3d23da);VoiceQueueEvents[_0xc423('0x4')](_0x3dcb83,_0x3d23da);_0x1ae0e6(null);};}for(var e in events){if(events[_0xc423('0x5')](e)){var event=events[e];VoiceQueue[_0xc423('0x6')](e,emitEvent(event));}}module[_0xc423('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0x11c0=['save','update','remove','exports','events','../../mysqldb','VoiceQueue'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x11c0,0x138));var _0x011c=function(_0xbe3803,_0x82837c){_0xbe3803=_0xbe3803-0x0;var _0x58652a=_0x11c0[_0xbe3803];return _0x58652a;};'use strict';var EventEmitter=require(_0x011c('0x0'));var VoiceQueue=require(_0x011c('0x1'))['db'][_0x011c('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x011c('0x3'),'afterUpdate':_0x011c('0x4'),'afterDestroy':_0x011c('0x5')};function emitEvent(_0x6529ca){return function(_0x533df9,_0x21c601,_0xcf1698){VoiceQueueEvents['emit'](_0x6529ca+':'+_0x533df9['id'],_0x533df9);VoiceQueueEvents['emit'](_0x6529ca,_0x533df9);_0xcf1698(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x011c('0x6')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 2e6de37..aeeb4d3 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 _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x231258,_0x521dd7){var _0x6ccc83=function(_0x30de98){while(--_0x30de98){_0x231258['push'](_0x231258['shift']());}};_0x6ccc83(++_0x521dd7);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0xfe4a8d,_0x33d75d){var _0x1bf633=function(_0x57f0e5){while(--_0x57f0e5){_0xfe4a8d['push'](_0xfe4a8d['shift']());}};_0x1bf633(++_0x33d75d);}(_0x008c,0x188));var _0xc008=function(_0x20d9ff,_0x1bcc4b){_0x20d9ff=_0x20d9ff-0x0;var _0x1f78aa=_0x008c[_0x20d9ff];return _0x1f78aa;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'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 2d838a1..3a12cb7 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 _0x1584=['defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VoiceQueue,\x20%s,\x20%s','message','info','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','include','map','attributes','model','then','find','ShowVoiceQueue','lodash','moment','bluebird','rpc','../../config/environment','client','http','redis'];(function(_0x62adfc,_0x3f9e5d){var _0x39e48c=function(_0x2fd528){while(--_0x2fd528){_0x62adfc['push'](_0x62adfc['shift']());}};_0x39e48c(++_0x3f9e5d);}(_0x1584,0x88));var _0x4158=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x1584[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x4158('0x0'));var util=require('util');var moment=require(_0x4158('0x1'));var BPromise=require(_0x4158('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('../../config/logger')(_0x4158('0x3'));var config=require(_0x4158('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x4158('0x5')][_0x4158('0x6')]({'port':0x232a});config[_0x4158('0x7')]=_[_0x4158('0x8')](config[_0x4158('0x7')],{'host':_0x4158('0x9'),'port':0x18eb});var socket=require(_0x4158('0xa'))(new Redis(config[_0x4158('0x7')]));require(_0x4158('0xb'))[_0x4158('0xc')](socket);function respondWithRpcPromise(_0x57f6fd,_0x217400,_0x5e6a28){return new BPromise(function(_0x55735c,_0x51022d){return client[_0x4158('0xd')](_0x57f6fd,_0x5e6a28)['then'](function(_0x5a9f66){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x217400,'request\x20sent');logger[_0x4158('0xe')](_0x4158('0xf'),_0x217400,_0x4158('0x10'),JSON[_0x4158('0x11')](_0x5a9f66));if(_0x5a9f66['error']){if(_0x5a9f66['error']['code']===0x1f4){logger[_0x4158('0x12')](_0x4158('0x13'),_0x217400,_0x5a9f66[_0x4158('0x12')][_0x4158('0x14')]);return _0x51022d(_0x5a9f66[_0x4158('0x12')][_0x4158('0x14')]);}logger['error'](_0x4158('0x13'),_0x217400,_0x5a9f66['error'][_0x4158('0x14')]);return _0x55735c(_0x5a9f66['error'][_0x4158('0x14')]);}else{logger[_0x4158('0x15')](_0x4158('0x13'),_0x217400,'request\x20sent');_0x55735c(_0x5a9f66['result'][_0x4158('0x14')]);}})[_0x4158('0x16')](function(_0x27b8d5){logger[_0x4158('0x12')](_0x4158('0x13'),_0x217400,_0x27b8d5);_0x51022d(_0x27b8d5);});});}exports[_0x4158('0x17')]=function(_0xa1903c){var _0x3828f4=this;return new Promise(function(_0x59a95f,_0x419c87){return db[_0x4158('0x18')][_0x4158('0x19')]({'raw':_0xa1903c[_0x4158('0x1a')]?_0xa1903c['options'][_0x4158('0x1b')]===undefined?!![]:![]:!![],'where':_0xa1903c[_0x4158('0x1a')]?_0xa1903c['options'][_0x4158('0x1c')]||null:null,'attributes':_0xa1903c[_0x4158('0x1a')]?_0xa1903c[_0x4158('0x1a')]['attributes']||null:null,'limit':_0xa1903c[_0x4158('0x1a')]?_0xa1903c['options']['limit']||null:null,'include':_0xa1903c[_0x4158('0x1a')]?_0xa1903c[_0x4158('0x1a')][_0x4158('0x1d')]?_[_0x4158('0x1e')](_0xa1903c[_0x4158('0x1a')][_0x4158('0x1d')],function(_0x5d7f0e){return{'model':db[_0x5d7f0e['model']],'as':_0x5d7f0e['as'],'attributes':_0x5d7f0e[_0x4158('0x1f')],'include':_0x5d7f0e[_0x4158('0x1d')]?_[_0x4158('0x1e')](_0x5d7f0e[_0x4158('0x1d')],function(_0x58f6ae){return{'model':db[_0x58f6ae[_0x4158('0x20')]],'as':_0x58f6ae['as'],'attributes':_0x58f6ae['attributes'],'include':_0x58f6ae['include']?_[_0x4158('0x1e')](_0x58f6ae[_0x4158('0x1d')],function(_0x328737){return{'model':db[_0x328737[_0x4158('0x20')]],'as':_0x328737['as'],'attributes':_0x328737[_0x4158('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4158('0x21')](function(_0x174245){logger[_0x4158('0x15')](_0x4158('0x17'),_0xa1903c);logger[_0x4158('0xe')](_0x4158('0x17'),_0xa1903c,JSON[_0x4158('0x11')](_0x174245));_0x59a95f(_0x174245);})[_0x4158('0x16')](function(_0x1a8280){logger[_0x4158('0x12')](_0x4158('0x17'),_0x1a8280[_0x4158('0x14')],_0xa1903c);_0x419c87(_0x3828f4['error'](0x1f4,_0x1a8280[_0x4158('0x14')]));});});};exports['ShowVoiceQueue']=function(_0x9f216d){var _0x57f794=this;return new Promise(function(_0x4cb7af,_0x58a41a){return db[_0x4158('0x18')][_0x4158('0x22')]({'raw':_0x9f216d[_0x4158('0x1a')]?_0x9f216d[_0x4158('0x1a')][_0x4158('0x1b')]===undefined?!![]:![]:!![],'where':_0x9f216d[_0x4158('0x1a')]?_0x9f216d['options'][_0x4158('0x1c')]||null:null,'attributes':_0x9f216d[_0x4158('0x1a')]?_0x9f216d[_0x4158('0x1a')][_0x4158('0x1f')]||null:null,'include':_0x9f216d['options']?_0x9f216d[_0x4158('0x1a')]['include']?_[_0x4158('0x1e')](_0x9f216d[_0x4158('0x1a')]['include'],function(_0x41f7b5){return{'model':db[_0x41f7b5[_0x4158('0x20')]],'as':_0x41f7b5['as'],'attributes':_0x41f7b5[_0x4158('0x1f')],'include':_0x41f7b5['include']?_[_0x4158('0x1e')](_0x41f7b5[_0x4158('0x1d')],function(_0x1ac89e){return{'model':db[_0x1ac89e[_0x4158('0x20')]],'as':_0x1ac89e['as'],'attributes':_0x1ac89e['attributes'],'include':_0x1ac89e['include']?_[_0x4158('0x1e')](_0x1ac89e[_0x4158('0x1d')],function(_0x3b3a47){return{'model':db[_0x3b3a47['model']],'as':_0x3b3a47['as'],'attributes':_0x3b3a47[_0x4158('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4158('0x21')](function(_0x50b01c){logger[_0x4158('0x15')](_0x4158('0x23'),_0x9f216d);logger['debug'](_0x4158('0x23'),_0x9f216d,JSON[_0x4158('0x11')](_0x50b01c));_0x4cb7af(_0x50b01c);})[_0x4158('0x16')](function(_0x4a945c){logger[_0x4158('0x12')]('ShowVoiceQueue',_0x4a945c['message'],_0x9f216d);_0x58a41a(_0x57f794[_0x4158('0x12')](0x1f4,_0x4a945c[_0x4158('0x14')]));});});}; \ No newline at end of file +var _0x71b7=['raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','error','message','catch','GetVoiceQueue','VoiceQueue','options','where','limit','include','map','model','attributes','then','debug','stringify','ShowVoiceQueue','find'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x71b7,0x160));var _0x771b=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0x71b7[_0x31eb67];return _0x2a8cb8;};'use strict';var _=require(_0x771b('0x0'));var util=require(_0x771b('0x1'));var moment=require(_0x771b('0x2'));var BPromise=require(_0x771b('0x3'));var rs=require(_0x771b('0x4'));var fs=require('fs');var Redis=require(_0x771b('0x5'));var db=require(_0x771b('0x6'))['db'];var utils=require(_0x771b('0x7'));var logger=require(_0x771b('0x8'))(_0x771b('0x9'));var config=require('../../config/environment');var jayson=require(_0x771b('0xa'));var client=jayson[_0x771b('0xb')]['http']({'port':0x232a});config[_0x771b('0xc')]=_[_0x771b('0xd')](config[_0x771b('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x771b('0xc')]));require(_0x771b('0xe'))[_0x771b('0xf')](socket);function respondWithRpcPromise(_0x1fff47,_0x44f554,_0x104188){return new BPromise(function(_0x10e185,_0x12c33e){return client[_0x771b('0x10')](_0x1fff47,_0x104188)['then'](function(_0x50a7d5){logger[_0x771b('0x11')](_0x771b('0x12'),_0x44f554,_0x771b('0x13'));logger['debug'](_0x771b('0x14'),_0x44f554,_0x771b('0x13'),JSON['stringify'](_0x50a7d5));if(_0x50a7d5[_0x771b('0x15')]){if(_0x50a7d5['error']['code']===0x1f4){logger[_0x771b('0x15')](_0x771b('0x12'),_0x44f554,_0x50a7d5[_0x771b('0x15')][_0x771b('0x16')]);return _0x12c33e(_0x50a7d5[_0x771b('0x15')]['message']);}logger[_0x771b('0x15')](_0x771b('0x12'),_0x44f554,_0x50a7d5[_0x771b('0x15')][_0x771b('0x16')]);return _0x10e185(_0x50a7d5['error'][_0x771b('0x16')]);}else{logger[_0x771b('0x11')](_0x771b('0x12'),_0x44f554,'request\x20sent');_0x10e185(_0x50a7d5['result'][_0x771b('0x16')]);}})[_0x771b('0x17')](function(_0x4d0c07){logger[_0x771b('0x15')](_0x771b('0x12'),_0x44f554,_0x4d0c07);_0x12c33e(_0x4d0c07);});});}exports[_0x771b('0x18')]=function(_0x4dcc51){var _0x535027=this;return new Promise(function(_0x43eb16,_0x584d50){return db[_0x771b('0x19')]['findAll']({'raw':_0x4dcc51['options']?_0x4dcc51[_0x771b('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4dcc51[_0x771b('0x1a')]?_0x4dcc51[_0x771b('0x1a')][_0x771b('0x1b')]||null:null,'attributes':_0x4dcc51[_0x771b('0x1a')]?_0x4dcc51[_0x771b('0x1a')]['attributes']||null:null,'limit':_0x4dcc51[_0x771b('0x1a')]?_0x4dcc51[_0x771b('0x1a')][_0x771b('0x1c')]||null:null,'include':_0x4dcc51['options']?_0x4dcc51[_0x771b('0x1a')][_0x771b('0x1d')]?_[_0x771b('0x1e')](_0x4dcc51[_0x771b('0x1a')]['include'],function(_0x1343f0){return{'model':db[_0x1343f0[_0x771b('0x1f')]],'as':_0x1343f0['as'],'attributes':_0x1343f0[_0x771b('0x20')],'include':_0x1343f0[_0x771b('0x1d')]?_[_0x771b('0x1e')](_0x1343f0[_0x771b('0x1d')],function(_0x463d28){return{'model':db[_0x463d28[_0x771b('0x1f')]],'as':_0x463d28['as'],'attributes':_0x463d28[_0x771b('0x20')],'include':_0x463d28[_0x771b('0x1d')]?_[_0x771b('0x1e')](_0x463d28[_0x771b('0x1d')],function(_0x16c7f8){return{'model':db[_0x16c7f8[_0x771b('0x1f')]],'as':_0x16c7f8['as'],'attributes':_0x16c7f8[_0x771b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x771b('0x21')](function(_0x1137f4){logger[_0x771b('0x11')](_0x771b('0x18'),_0x4dcc51);logger[_0x771b('0x22')]('GetVoiceQueue',_0x4dcc51,JSON[_0x771b('0x23')](_0x1137f4));_0x43eb16(_0x1137f4);})[_0x771b('0x17')](function(_0x26cb04){logger[_0x771b('0x15')](_0x771b('0x18'),_0x26cb04[_0x771b('0x16')],_0x4dcc51);_0x584d50(_0x535027[_0x771b('0x15')](0x1f4,_0x26cb04[_0x771b('0x16')]));});});};exports[_0x771b('0x24')]=function(_0x304ac0){var _0x5bdd5d=this;return new Promise(function(_0x1f78a6,_0x2adb70){return db['VoiceQueue'][_0x771b('0x25')]({'raw':_0x304ac0['options']?_0x304ac0[_0x771b('0x1a')][_0x771b('0x26')]===undefined?!![]:![]:!![],'where':_0x304ac0[_0x771b('0x1a')]?_0x304ac0['options'][_0x771b('0x1b')]||null:null,'attributes':_0x304ac0[_0x771b('0x1a')]?_0x304ac0[_0x771b('0x1a')][_0x771b('0x20')]||null:null,'include':_0x304ac0[_0x771b('0x1a')]?_0x304ac0[_0x771b('0x1a')]['include']?_[_0x771b('0x1e')](_0x304ac0[_0x771b('0x1a')][_0x771b('0x1d')],function(_0x1290ed){return{'model':db[_0x1290ed['model']],'as':_0x1290ed['as'],'attributes':_0x1290ed[_0x771b('0x20')],'include':_0x1290ed[_0x771b('0x1d')]?_[_0x771b('0x1e')](_0x1290ed['include'],function(_0x1d6129){return{'model':db[_0x1d6129['model']],'as':_0x1d6129['as'],'attributes':_0x1d6129[_0x771b('0x20')],'include':_0x1d6129['include']?_[_0x771b('0x1e')](_0x1d6129[_0x771b('0x1d')],function(_0x1f985d){return{'model':db[_0x1f985d[_0x771b('0x1f')]],'as':_0x1f985d['as'],'attributes':_0x1f985d[_0x771b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x771b('0x21')](function(_0x540cfa){logger[_0x771b('0x11')](_0x771b('0x24'),_0x304ac0);logger['debug'](_0x771b('0x24'),_0x304ac0,JSON[_0x771b('0x23')](_0x540cfa));_0x1f78a6(_0x540cfa);})[_0x771b('0x17')](function(_0x503187){logger[_0x771b('0x15')]('ShowVoiceQueue',_0x503187[_0x771b('0x16')],_0x304ac0);_0x2adb70(_0x5bdd5d[_0x771b('0x15')](0x1f4,_0x503187[_0x771b('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 1040ea3..56f893f 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 _0x47b3=['save','remove','update','emit','removeListener','length','./voiceQueue.events'];(function(_0x1f607d,_0x57d512){var _0xb8a603=function(_0x4e93ab){while(--_0x4e93ab){_0x1f607d['push'](_0x1f607d['shift']());}};_0xb8a603(++_0x57d512);}(_0x47b3,0x18e));var _0x347b=function(_0x974594,_0x55b3e5){_0x974594=_0x974594-0x0;var _0x235200=_0x47b3[_0x974594];return _0x235200;};'use strict';var VoiceQueueEvents=require(_0x347b('0x0'));var events=[_0x347b('0x1'),_0x347b('0x2'),_0x347b('0x3')];function createListener(_0x49d8a2,_0x1a6993){return function(_0x477c41){_0x1a6993[_0x347b('0x4')](_0x49d8a2,_0x477c41);};}function removeListener(_0x4a9153,_0x52120b){return function(){VoiceQueueEvents[_0x347b('0x5')](_0x4a9153,_0x52120b);};}exports['register']=function(_0x524a23){for(var _0x1e6c04=0x0,_0x46b6f6=events[_0x347b('0x6')];_0x1e6c04<_0x46b6f6;_0x1e6c04++){var _0x170dcc=events[_0x1e6c04];var _0x253d39=createListener('voiceQueue:'+_0x170dcc,_0x524a23);VoiceQueueEvents['on'](_0x170dcc,_0x253d39);}}; \ No newline at end of file +var _0x9c3a=['voiceQueue:','remove','emit','removeListener','register','length'];(function(_0x38d92b,_0x1be181){var _0x56c746=function(_0x2d8a65){while(--_0x2d8a65){_0x38d92b['push'](_0x38d92b['shift']());}};_0x56c746(++_0x1be181);}(_0x9c3a,0xf7));var _0xa9c3=function(_0x10946e,_0x10e622){_0x10946e=_0x10946e-0x0;var _0x3b3bb2=_0x9c3a[_0x10946e];return _0x3b3bb2;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=['save',_0xa9c3('0x0'),'update'];function createListener(_0x3b678b,_0x551ec5){return function(_0x5112f1){_0x551ec5[_0xa9c3('0x1')](_0x3b678b,_0x5112f1);};}function removeListener(_0x3a09e7,_0x210333){return function(){VoiceQueueEvents[_0xa9c3('0x2')](_0x3a09e7,_0x210333);};}exports[_0xa9c3('0x3')]=function(_0x2032f8){for(var _0x1192c5=0x0,_0x2791a0=events[_0xa9c3('0x4')];_0x1192c5<_0x2791a0;_0x1192c5++){var _0x225429=events[_0x1192c5];var _0x438e24=createListener(_0xa9c3('0x5')+_0x225429,_0x2032f8);VoiceQueueEvents['on'](_0x225429,_0x438e24);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 56126b1..2b24c1f 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 _0x59e6=['./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','show','post','create','put','update','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x36067f,_0xba548e){var _0x44f0b3=function(_0x1954af){while(--_0x1954af){_0x36067f['push'](_0x36067f['shift']());}};_0x44f0b3(++_0xba548e);}(_0x59e6,0x1f3));var _0x659e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x59e6[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x659e('0x0'));var util=require(_0x659e('0x1'));var path=require(_0x659e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x659e('0x3')]();var fs_extra=require(_0x659e('0x4'));var auth=require(_0x659e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x659e('0x6'));var controller=require(_0x659e('0x7'));router[_0x659e('0x8')]('/',auth[_0x659e('0x9')](),controller[_0x659e('0xa')]);router[_0x659e('0x8')](_0x659e('0xb'),auth['isAuthenticated'](),controller[_0x659e('0xc')]);router['get'](_0x659e('0xd'),auth[_0x659e('0x9')](),controller[_0x659e('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x659e('0xf')]);router[_0x659e('0x10')]('/',auth[_0x659e('0x9')](),controller[_0x659e('0x11')]);router[_0x659e('0x12')]('/:id',auth[_0x659e('0x9')](),controller[_0x659e('0x13')]);router[_0x659e('0x14')]('/:id',auth[_0x659e('0x9')](),controller[_0x659e('0x15')]);module['exports']=router; \ No newline at end of file +var _0x0d56=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/index','/:id','show','post','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x0d56,0x1c3));var _0x60d5=function(_0x1b46e1,_0x441fd6){_0x1b46e1=_0x1b46e1-0x0;var _0x594ad1=_0x0d56[_0x1b46e1];return _0x594ad1;};'use strict';var multer=require('multer');var util=require(_0x60d5('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x60d5('0x1'));var router=express[_0x60d5('0x2')]();var fs_extra=require(_0x60d5('0x3'));var auth=require(_0x60d5('0x4'));var interaction=require(_0x60d5('0x5'));var config=require(_0x60d5('0x6'));var controller=require('./voiceQueueReport.controller');router[_0x60d5('0x7')]('/',auth[_0x60d5('0x8')](),controller['index']);router['get'](_0x60d5('0x9'),auth['isAuthenticated'](),controller[_0x60d5('0xa')]);router[_0x60d5('0x7')](_0x60d5('0xb'),auth[_0x60d5('0x8')](),controller['getVoiceQueuesReport']);router[_0x60d5('0x7')](_0x60d5('0xc'),auth[_0x60d5('0x8')](),controller[_0x60d5('0xd')]);router[_0x60d5('0xe')]('/',auth[_0x60d5('0x8')](),controller['create']);router['put'](_0x60d5('0xc'),auth[_0x60d5('0x8')](),controller[_0x60d5('0xf')]);router[_0x60d5('0x10')](_0x60d5('0xc'),auth[_0x60d5('0x8')](),controller[_0x60d5('0x11')]);module[_0x60d5('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index c8d7c03..9775d0d 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 _0x6bd9=['setDataValue','holdtime','INTEGER','BOOLEAN','STRING','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt'];(function(_0x49b6e0,_0x14a6e6){var _0x2c5fe9=function(_0x4f2836){while(--_0x4f2836){_0x49b6e0['push'](_0x49b6e0['shift']());}};_0x2c5fe9(++_0x14a6e6);}(_0x6bd9,0x19f));var _0x96bd=function(_0x5dfe92,_0x175639){_0x5dfe92=_0x5dfe92-0x0;var _0x519980=_0x6bd9[_0x5dfe92];return _0x519980;};'use strict';var Sequelize=require(_0x96bd('0x0'));var moment=require(_0x96bd('0x1'));module[_0x96bd('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x96bd('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x1bd4a7){var _0x39fdfb=moment(_0x1bd4a7);var _0x2b5fbf=moment(this[_0x96bd('0x4')]('queuecallerjoinAt'))[_0x96bd('0x5')](_0x96bd('0x6'));var _0x54a2a9=_0x39fdfb[_0x96bd('0x7')](_0x2b5fbf,_0x96bd('0x8'));this['setDataValue'](_0x96bd('0x9'),_0x1bd4a7);this[_0x96bd('0xa')](_0x96bd('0xb'),_0x54a2a9||null);}},'position':{'type':Sequelize[_0x96bd('0xc')]},'count':{'type':Sequelize[_0x96bd('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x96bd('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x96bd('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x96bd('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x96bd('0x3')]},'queuecallerexit':{'type':Sequelize[_0x96bd('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x96bd('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x96bd('0xe')],'comment':_0x96bd('0xf')},'originalposition':{'type':Sequelize[_0x96bd('0xc')]},'channel':{'type':Sequelize[_0x96bd('0xe')]},'connectedlinenum':{'type':Sequelize[_0x96bd('0xe')]},'connectedlinename':{'type':Sequelize[_0x96bd('0xe')]},'accountcode':{'type':Sequelize[_0x96bd('0xe')]},'context':{'type':Sequelize[_0x96bd('0xe')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x96bd('0xe')]},'holdtime':{'type':Sequelize[_0x96bd('0xc')]},'mohtime':{'type':Sequelize[_0x96bd('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x96bd('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x96bd('0xe')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x96bd('0xe')],'comment':_0x96bd('0x10')},'transferexten':{'type':Sequelize[_0x96bd('0xe')]},'transferuniqueid':{'type':Sequelize[_0x96bd('0xe')]},'disposition':{'type':Sequelize[_0x96bd('0xe')]},'secondDisposition':{'type':Sequelize[_0x96bd('0xe')]},'thirdDisposition':{'type':Sequelize[_0x96bd('0xe')]},'queuecallerenterreason':{'type':Sequelize[_0x96bd('0xc')],'defaultValue':0x0},'note':{'type':Sequelize[_0x96bd('0xe')]}}; \ No newline at end of file +var _0x2e48=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','holdtime','INTEGER','BOOLEAN'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x2e48,0x16a));var _0x82e4=function(_0x5ef161,_0x27d16c){_0x5ef161=_0x5ef161-0x0;var _0x1c6e9e=_0x2e48[_0x5ef161];return _0x1c6e9e;};'use strict';var Sequelize=require(_0x82e4('0x0'));var moment=require(_0x82e4('0x1'));module['exports']={'type':{'type':Sequelize[_0x82e4('0x2')]},'uniqueid':{'type':Sequelize[_0x82e4('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x82e4('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x82e4('0x3')],'set':function(_0xdb2435){var _0x322a58=moment(_0xdb2435);var _0xb6e754=moment(this[_0x82e4('0x4')](_0x82e4('0x5')))['format'](_0x82e4('0x6'));var _0x442b70=_0x322a58[_0x82e4('0x7')](_0xb6e754,_0x82e4('0x8'));this[_0x82e4('0x9')]('queuecallerleaveAt',_0xdb2435);this['setDataValue'](_0x82e4('0xa'),_0x442b70||null);}},'position':{'type':Sequelize[_0x82e4('0xb')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x82e4('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x82e4('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x82e4('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x82e4('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x82e4('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x82e4('0xd')},'originalposition':{'type':Sequelize[_0x82e4('0xb')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x82e4('0x2')]},'accountcode':{'type':Sequelize[_0x82e4('0x2')]},'context':{'type':Sequelize[_0x82e4('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x82e4('0x2')]},'holdtime':{'type':Sequelize[_0x82e4('0xb')]},'mohtime':{'type':Sequelize[_0x82e4('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x82e4('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x82e4('0x2')]},'transfer':{'type':Sequelize[_0x82e4('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x82e4('0xe')},'transferexten':{'type':Sequelize[_0x82e4('0x2')]},'transferuniqueid':{'type':Sequelize[_0x82e4('0x2')]},'disposition':{'type':Sequelize[_0x82e4('0x2')]},'secondDisposition':{'type':Sequelize[_0x82e4('0x2')]},'thirdDisposition':{'type':Sequelize[_0x82e4('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0x82e4('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index ce69841..e9a51dc 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 _0xd82d=['name','index','map','VoiceQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','filter','options','include','catch','show','params','fields','includeAll','create','body','find','describe','getVoiceQueuesReport','pick','merge','findAll','rows','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack'];(function(_0x27f3b0,_0x2b3193){var _0x1f226d=function(_0x1dc2c4){while(--_0x1dc2c4){_0x27f3b0['push'](_0x27f3b0['shift']());}};_0x1f226d(++_0x2b3193);}(_0xd82d,0x11f));var _0xdd82=function(_0x4725b2,_0x32c5f9){_0x4725b2=_0x4725b2-0x0;var _0x295fe4=_0xd82d[_0x4725b2];return _0x295fe4;};'use strict';var emlformat=require(_0xdd82('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdd82('0x1'));var rp=require(_0xdd82('0x2'));var moment=require('moment');var BPromise=require(_0xdd82('0x3'));var Mustache=require(_0xdd82('0x4'));var util=require(_0xdd82('0x5'));var path=require(_0xdd82('0x6'));var sox=require('sox');var csv=require(_0xdd82('0x7'));var ejs=require(_0xdd82('0x8'));var fs=require('fs');var fs_extra=require(_0xdd82('0x9'));var _=require(_0xdd82('0xa'));var squel=require('squel');var crypto=require(_0xdd82('0xb'));var jsforce=require(_0xdd82('0xc'));var deskjs=require(_0xdd82('0xd'));var toCsv=require(_0xdd82('0x7'));var querystring=require(_0xdd82('0xe'));var Papa=require(_0xdd82('0xf'));var Redis=require(_0xdd82('0x10'));var authService=require(_0xdd82('0x11'));var qs=require(_0xdd82('0x12'));var as=require(_0xdd82('0x13'));var hardwareService=require(_0xdd82('0x14'));var logger=require('../../config/logger')(_0xdd82('0x15'));var utils=require('../../config/utils');var config=require(_0xdd82('0x16'));var licenseUtil=require(_0xdd82('0x17'));var db=require(_0xdd82('0x18'))['db'];config[_0xdd82('0x19')]=_[_0xdd82('0x1a')](config[_0xdd82('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xdd82('0x1b'))(new Redis(config[_0xdd82('0x19')]));require('./voiceQueueReport.socket')[_0xdd82('0x1c')](socket);function respondWithStatusCode(_0x34924c,_0x16b278){_0x16b278=_0x16b278||0xcc;return function(_0x3dba5e){if(_0x3dba5e){return _0x34924c[_0xdd82('0x1d')](_0x16b278);}return _0x34924c[_0xdd82('0x1e')](_0x16b278)['end']();};}function respondWithResult(_0x3c98a5,_0x73402){_0x73402=_0x73402||0xc8;return function(_0x16a4b2){if(_0x16a4b2){return _0x3c98a5[_0xdd82('0x1e')](_0x73402)[_0xdd82('0x1f')](_0x16a4b2);}};}function respondWithFilteredResult(_0x4ed77d,_0x2ad750){return function(_0x496ed1){if(_0x496ed1){var _0x46ea62=typeof _0x2ad750[_0xdd82('0x20')]===_0xdd82('0x21')&&typeof _0x2ad750[_0xdd82('0x22')]==='undefined';var _0x4a6198=_0x496ed1['count'];var _0x11c63d=_0x46ea62?0x0:_0x2ad750['offset'];var _0x49e5dd=_0x46ea62?_0x496ed1[_0xdd82('0x23')]:_0x2ad750[_0xdd82('0x20')]+_0x2ad750[_0xdd82('0x22')];var _0x388659;if(_0x49e5dd>=_0x4a6198){_0x49e5dd=_0x4a6198;_0x388659=0xc8;}else{_0x388659=0xce;}_0x4ed77d['status'](_0x388659);return _0x4ed77d[_0xdd82('0x24')](_0xdd82('0x25'),_0x11c63d+'-'+_0x49e5dd+'/'+_0x4a6198)['json'](_0x496ed1);}return null;};}function patchUpdates(_0x1a143a){return function(_0x1fa100){try{jsonpatch[_0xdd82('0x26')](_0x1fa100,_0x1a143a,!![]);}catch(_0x1a52d3){return BPromise['reject'](_0x1a52d3);}return _0x1fa100[_0xdd82('0x27')]();};}function saveUpdates(_0x423e70,_0x2b2b7e){return function(_0x1660f6){if(_0x1660f6){return _0x1660f6[_0xdd82('0x28')](_0x423e70)[_0xdd82('0x29')](function(_0x3646a8){return _0x3646a8;});}return null;};}function removeEntity(_0x2efc32,_0x31333e){return function(_0x5c97ee){if(_0x5c97ee){return _0x5c97ee[_0xdd82('0x2a')]()[_0xdd82('0x29')](function(){_0x2efc32[_0xdd82('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c5f18,_0x493390){return function(_0x5e7b83){if(!_0x5e7b83){_0x4c5f18[_0xdd82('0x1d')](0x194);}return _0x5e7b83;};}function handleError(_0x1d7a1c,_0x2c3306){_0x2c3306=_0x2c3306||0x1f4;return function(_0x38a501){logger[_0xdd82('0x2b')](_0x38a501[_0xdd82('0x2c')]);if(_0x38a501[_0xdd82('0x2d')]){delete _0x38a501[_0xdd82('0x2d')];}_0x1d7a1c[_0xdd82('0x1e')](_0x2c3306)['send'](_0x38a501);};}exports[_0xdd82('0x2e')]=function(_0x5091ea,_0x42c851){var _0x38bfde={},_0x2b24e3={},_0x143b01={'count':0x0,'rows':[]};var _0x2b0333=_[_0xdd82('0x2f')](db[_0xdd82('0x30')][_0xdd82('0x31')],function(_0x39420d){return{'name':_0x39420d[_0xdd82('0x32')],'type':_0x39420d['type'][_0xdd82('0x33')]};});_0x2b24e3[_0xdd82('0x34')]=_['map'](_0x2b0333,_0xdd82('0x2d'));_0x2b24e3[_0xdd82('0x35')]=_[_0xdd82('0x36')](_0x5091ea[_0xdd82('0x35')]);_0x2b24e3[_0xdd82('0x37')]=_['intersection'](_0x2b24e3[_0xdd82('0x34')],_0x2b24e3[_0xdd82('0x35')]);_0x38bfde[_0xdd82('0x38')]=_[_0xdd82('0x39')](_0x2b24e3[_0xdd82('0x34')],qs['fields'](_0x5091ea[_0xdd82('0x35')]['fields']));_0x38bfde[_0xdd82('0x38')]=_0x38bfde['attributes'][_0xdd82('0x3a')]?_0x38bfde[_0xdd82('0x38')]:_0x2b24e3[_0xdd82('0x34')];if(!_0x5091ea[_0xdd82('0x35')][_0xdd82('0x3b')](_0xdd82('0x3c'))){_0x38bfde[_0xdd82('0x22')]=qs['limit'](_0x5091ea[_0xdd82('0x35')]['limit']);_0x38bfde[_0xdd82('0x20')]=qs[_0xdd82('0x20')](_0x5091ea[_0xdd82('0x35')][_0xdd82('0x20')]);}_0x38bfde[_0xdd82('0x3d')]=qs[_0xdd82('0x3e')](_0x5091ea[_0xdd82('0x35')][_0xdd82('0x3e')]);_0x38bfde[_0xdd82('0x3f')]=qs['filters'](_['pick'](_0x5091ea[_0xdd82('0x35')],_0x2b24e3['filters']),_0x2b0333);if(_0x5091ea[_0xdd82('0x35')]['filter']){_0x38bfde[_0xdd82('0x3f')]=_['merge'](_0x38bfde[_0xdd82('0x3f')],{'$or':_[_0xdd82('0x2f')](_0x2b0333,function(_0x1e093f){if(_0x1e093f[_0xdd82('0x40')]!==_0xdd82('0x41')){var _0x47a71c={};_0x47a71c[_0x1e093f[_0xdd82('0x2d')]]={'$like':'%'+_0x5091ea['query'][_0xdd82('0x42')]+'%'};return _0x47a71c;}})});}_0x38bfde=_['merge']({},_0x38bfde,_0x5091ea[_0xdd82('0x43')]);var _0x361df2={'where':_0x38bfde[_0xdd82('0x3f')]};return db[_0xdd82('0x30')][_0xdd82('0x23')](_0x361df2)[_0xdd82('0x29')](function(_0x333ee0){_0x143b01[_0xdd82('0x23')]=_0x333ee0;if(_0x5091ea[_0xdd82('0x35')]['includeAll']){_0x38bfde[_0xdd82('0x44')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x38bfde);})[_0xdd82('0x29')](function(_0x44c019){_0x143b01['rows']=_0x44c019;return _0x143b01;})[_0xdd82('0x29')](respondWithFilteredResult(_0x42c851,_0x38bfde))[_0xdd82('0x45')](handleError(_0x42c851,null));};exports[_0xdd82('0x46')]=function(_0x590420,_0x5592b4){var _0x2d1ea8={'raw':![],'where':{'id':_0x590420[_0xdd82('0x47')]['id']}},_0x55bd60={};_0x55bd60['model']=_['keys'](db['VoiceQueueReport'][_0xdd82('0x31')]);_0x55bd60[_0xdd82('0x35')]=_['keys'](_0x590420['query']);_0x55bd60[_0xdd82('0x37')]=_[_0xdd82('0x39')](_0x55bd60['model'],_0x55bd60[_0xdd82('0x35')]);_0x2d1ea8[_0xdd82('0x38')]=_[_0xdd82('0x39')](_0x55bd60[_0xdd82('0x34')],qs[_0xdd82('0x48')](_0x590420[_0xdd82('0x35')][_0xdd82('0x48')]));_0x2d1ea8['attributes']=_0x2d1ea8['attributes'][_0xdd82('0x3a')]?_0x2d1ea8[_0xdd82('0x38')]:_0x55bd60[_0xdd82('0x34')];if(_0x590420[_0xdd82('0x35')][_0xdd82('0x49')]){_0x2d1ea8[_0xdd82('0x44')]=[{'all':!![]}];}_0x2d1ea8=_['merge']({},_0x2d1ea8,_0x590420[_0xdd82('0x43')]);return db[_0xdd82('0x30')]['find'](_0x2d1ea8)[_0xdd82('0x29')](handleEntityNotFound(_0x5592b4,null))[_0xdd82('0x29')](respondWithResult(_0x5592b4,null))[_0xdd82('0x45')](handleError(_0x5592b4,null));};exports[_0xdd82('0x4a')]=function(_0x31875d,_0x5b8a06){return db[_0xdd82('0x30')][_0xdd82('0x4a')](_0x31875d[_0xdd82('0x4b')],{})['then'](respondWithResult(_0x5b8a06,0xc9))[_0xdd82('0x45')](handleError(_0x5b8a06,null));};exports[_0xdd82('0x28')]=function(_0x35b8f4,_0x2b8509){if(_0x35b8f4['body']['id']){delete _0x35b8f4[_0xdd82('0x4b')]['id'];}return db[_0xdd82('0x30')][_0xdd82('0x4c')]({'where':{'id':_0x35b8f4['params']['id']}})[_0xdd82('0x29')](handleEntityNotFound(_0x2b8509,null))[_0xdd82('0x29')](saveUpdates(_0x35b8f4[_0xdd82('0x4b')],null))[_0xdd82('0x29')](respondWithResult(_0x2b8509,null))[_0xdd82('0x45')](handleError(_0x2b8509,null));};exports[_0xdd82('0x2a')]=function(_0xd93043,_0x88629b){return db[_0xdd82('0x30')][_0xdd82('0x4c')]({'where':{'id':_0xd93043[_0xdd82('0x47')]['id']}})[_0xdd82('0x29')](handleEntityNotFound(_0x88629b,null))[_0xdd82('0x29')](removeEntity(_0x88629b,null))[_0xdd82('0x45')](handleError(_0x88629b,null));};exports[_0xdd82('0x4d')]=function(_0x17075f,_0x5127b0){return db['VoiceQueueReport']['describe']()[_0xdd82('0x29')](respondWithResult(_0x5127b0,null))[_0xdd82('0x45')](handleError(_0x5127b0,null));};exports[_0xdd82('0x4e')]=function(_0x364921,_0x5c685){var _0x4a9922={},_0x49f9ca={},_0x50d2d1={'count':0x0,'rows':[]};_0x49f9ca['model']=_[_0xdd82('0x36')](db[_0xdd82('0x30')][_0xdd82('0x31')]);_0x49f9ca[_0xdd82('0x35')]=_[_0xdd82('0x36')](_0x364921[_0xdd82('0x35')]);_0x49f9ca['filters']=_[_0xdd82('0x39')](_0x49f9ca[_0xdd82('0x34')],_0x49f9ca[_0xdd82('0x35')]);_0x4a9922[_0xdd82('0x38')]=_['intersection'](_0x49f9ca['model'],qs[_0xdd82('0x48')](_0x364921[_0xdd82('0x35')]['fields']));_0x4a9922['attributes']=_0x4a9922[_0xdd82('0x38')][_0xdd82('0x3a')]?_0x4a9922[_0xdd82('0x38')]:_0x49f9ca[_0xdd82('0x34')];if(!_0x364921[_0xdd82('0x35')]['hasOwnProperty']('nolimit')){_0x4a9922[_0xdd82('0x22')]=qs[_0xdd82('0x22')](_0x364921['query'][_0xdd82('0x22')]);_0x4a9922[_0xdd82('0x20')]=qs[_0xdd82('0x20')](_0x364921['query'][_0xdd82('0x20')]);}_0x4a9922[_0xdd82('0x3d')]=qs['sort'](_0x364921[_0xdd82('0x35')][_0xdd82('0x3e')]);_0x4a9922[_0xdd82('0x3f')]=qs[_0xdd82('0x37')](_[_0xdd82('0x4f')](_0x364921[_0xdd82('0x35')],_0x49f9ca[_0xdd82('0x37')]));if(_0x364921[_0xdd82('0x35')][_0xdd82('0x42')]){_0x4a9922[_0xdd82('0x3f')]=_[_0xdd82('0x50')](_0x4a9922['where'],{'$or':_[_0xdd82('0x2f')](_0x4a9922[_0xdd82('0x38')],function(_0x46435e){var _0x27f5fe={};_0x27f5fe[_0x46435e]={'$like':'%'+_0x364921[_0xdd82('0x35')][_0xdd82('0x42')]+'%'};return _0x27f5fe;})});}_0x4a9922=_[_0xdd82('0x50')]({},_0x4a9922,_0x364921[_0xdd82('0x43')]);var _0x202154={'where':_0x4a9922[_0xdd82('0x3f')]};return db['VoiceQueueReport'][_0xdd82('0x23')](_0x202154)[_0xdd82('0x29')](function(_0x1c04f6){_0x50d2d1[_0xdd82('0x23')]=_0x1c04f6;if(_0x364921[_0xdd82('0x35')][_0xdd82('0x49')]){_0x4a9922[_0xdd82('0x44')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xdd82('0x51')](_0x4a9922);})[_0xdd82('0x29')](function(_0x47cdd6){_0x50d2d1[_0xdd82('0x52')]=_0x47cdd6;return _0x50d2d1;})[_0xdd82('0x29')](respondWithFilteredResult(_0x5c685,_0x4a9922,'getVoiceQueuesReport'))[_0xdd82('0x45')](handleError(_0x5c685,null,_0xdd82('0x4e')));}; \ No newline at end of file +var _0xc548=['rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','VoiceQueueReport','include','findAll','catch','params','includeAll','options','find','create','body','destroy','describe','getVoiceQueuesReport','map','rows','rimraf','fast-json-patch','request-promise','moment','sox','fs-extra','squel','crypto','desk.js','to-csv','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','./voiceQueueReport.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send'];(function(_0xe95813,_0x501a97){var _0x47a6ec=function(_0x12be33){while(--_0x12be33){_0xe95813['push'](_0xe95813['shift']());}};_0x47a6ec(++_0x501a97);}(_0xc548,0x1b3));var _0x8c54=function(_0x395c1c,_0x18ef5b){_0x395c1c=_0x395c1c-0x0;var _0x391a95=_0xc548[_0x395c1c];return _0x391a95;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8c54('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8c54('0x1'));var rp=require(_0x8c54('0x2'));var moment=require(_0x8c54('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8c54('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8c54('0x5'));var _=require('lodash');var squel=require(_0x8c54('0x6'));var crypto=require(_0x8c54('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x8c54('0x8'));var toCsv=require(_0x8c54('0x9'));var querystring=require('querystring');var Papa=require(_0x8c54('0xa'));var Redis=require(_0x8c54('0xb'));var authService=require(_0x8c54('0xc'));var qs=require(_0x8c54('0xd'));var as=require(_0x8c54('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c54('0xf'))(_0x8c54('0x10'));var utils=require(_0x8c54('0x11'));var config=require(_0x8c54('0x12'));var licenseUtil=require(_0x8c54('0x13'));var db=require(_0x8c54('0x14'))['db'];config['redis']=_[_0x8c54('0x15')](config[_0x8c54('0x16')],{'host':_0x8c54('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8c54('0x16')]));require(_0x8c54('0x18'))[_0x8c54('0x19')](socket);function respondWithStatusCode(_0x4e6c57,_0x112e38){_0x112e38=_0x112e38||0xcc;return function(_0x45b2c4){if(_0x45b2c4){return _0x4e6c57[_0x8c54('0x1a')](_0x112e38);}return _0x4e6c57['status'](_0x112e38)[_0x8c54('0x1b')]();};}function respondWithResult(_0x588be1,_0x7e881b){_0x7e881b=_0x7e881b||0xc8;return function(_0xad7853){if(_0xad7853){return _0x588be1[_0x8c54('0x1c')](_0x7e881b)[_0x8c54('0x1d')](_0xad7853);}};}function respondWithFilteredResult(_0x40ecf4,_0x543ccd){return function(_0x237b06){if(_0x237b06){var _0x590b01=typeof _0x543ccd[_0x8c54('0x1e')]===_0x8c54('0x1f')&&typeof _0x543ccd['limit']===_0x8c54('0x1f');var _0x2cf407=_0x237b06[_0x8c54('0x20')];var _0xe10ee8=_0x590b01?0x0:_0x543ccd[_0x8c54('0x1e')];var _0x4552f5=_0x590b01?_0x237b06[_0x8c54('0x20')]:_0x543ccd[_0x8c54('0x1e')]+_0x543ccd[_0x8c54('0x21')];var _0x3ff9b5;if(_0x4552f5>=_0x2cf407){_0x4552f5=_0x2cf407;_0x3ff9b5=0xc8;}else{_0x3ff9b5=0xce;}_0x40ecf4[_0x8c54('0x1c')](_0x3ff9b5);return _0x40ecf4[_0x8c54('0x22')](_0x8c54('0x23'),_0xe10ee8+'-'+_0x4552f5+'/'+_0x2cf407)[_0x8c54('0x1d')](_0x237b06);}return null;};}function patchUpdates(_0x3c69aa){return function(_0x4013bf){try{jsonpatch[_0x8c54('0x24')](_0x4013bf,_0x3c69aa,!![]);}catch(_0x511712){return BPromise[_0x8c54('0x25')](_0x511712);}return _0x4013bf[_0x8c54('0x26')]();};}function saveUpdates(_0x29fd84,_0x2d21bf){return function(_0x142ab2){if(_0x142ab2){return _0x142ab2[_0x8c54('0x27')](_0x29fd84)['then'](function(_0x2a226f){return _0x2a226f;});}return null;};}function removeEntity(_0x585727,_0x1d93c7){return function(_0x956569){if(_0x956569){return _0x956569['destroy']()[_0x8c54('0x28')](function(){_0x585727[_0x8c54('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c09f5,_0x67253b){return function(_0x561a5c){if(!_0x561a5c){_0x5c09f5['sendStatus'](0x194);}return _0x561a5c;};}function handleError(_0x52cfa0,_0x52e87c){_0x52e87c=_0x52e87c||0x1f4;return function(_0xe2acaa){logger[_0x8c54('0x29')](_0xe2acaa[_0x8c54('0x2a')]);if(_0xe2acaa[_0x8c54('0x2b')]){delete _0xe2acaa[_0x8c54('0x2b')];}_0x52cfa0[_0x8c54('0x1c')](_0x52e87c)[_0x8c54('0x2c')](_0xe2acaa);};}exports['index']=function(_0x1204ef,_0x457550){var _0x4588b2={},_0x295300={},_0x3af3a2={'count':0x0,'rows':[]};var _0x3401b0=_['map'](db['VoiceQueueReport'][_0x8c54('0x2d')],function(_0x237183){return{'name':_0x237183[_0x8c54('0x2e')],'type':_0x237183[_0x8c54('0x2f')]['key']};});_0x295300[_0x8c54('0x30')]=_['map'](_0x3401b0,_0x8c54('0x2b'));_0x295300[_0x8c54('0x31')]=_[_0x8c54('0x32')](_0x1204ef[_0x8c54('0x31')]);_0x295300[_0x8c54('0x33')]=_[_0x8c54('0x34')](_0x295300[_0x8c54('0x30')],_0x295300['query']);_0x4588b2[_0x8c54('0x35')]=_[_0x8c54('0x34')](_0x295300[_0x8c54('0x30')],qs[_0x8c54('0x36')](_0x1204ef['query'][_0x8c54('0x36')]));_0x4588b2[_0x8c54('0x35')]=_0x4588b2['attributes'][_0x8c54('0x37')]?_0x4588b2[_0x8c54('0x35')]:_0x295300[_0x8c54('0x30')];if(!_0x1204ef[_0x8c54('0x31')][_0x8c54('0x38')](_0x8c54('0x39'))){_0x4588b2[_0x8c54('0x21')]=qs['limit'](_0x1204ef[_0x8c54('0x31')][_0x8c54('0x21')]);_0x4588b2[_0x8c54('0x1e')]=qs[_0x8c54('0x1e')](_0x1204ef['query'][_0x8c54('0x1e')]);}_0x4588b2[_0x8c54('0x3a')]=qs[_0x8c54('0x3b')](_0x1204ef[_0x8c54('0x31')][_0x8c54('0x3b')]);_0x4588b2['where']=qs[_0x8c54('0x33')](_[_0x8c54('0x3c')](_0x1204ef[_0x8c54('0x31')],_0x295300['filters']),_0x3401b0);if(_0x1204ef[_0x8c54('0x31')][_0x8c54('0x3d')]){_0x4588b2[_0x8c54('0x3e')]=_['merge'](_0x4588b2['where'],{'$or':_['map'](_0x3401b0,function(_0xa4c90f){if(_0xa4c90f[_0x8c54('0x2f')]!==_0x8c54('0x3f')){var _0x91ae38={};_0x91ae38[_0xa4c90f['name']]={'$like':'%'+_0x1204ef[_0x8c54('0x31')]['filter']+'%'};return _0x91ae38;}})});}_0x4588b2=_[_0x8c54('0x40')]({},_0x4588b2,_0x1204ef['options']);var _0x594ef6={'where':_0x4588b2['where']};return db[_0x8c54('0x41')][_0x8c54('0x20')](_0x594ef6)[_0x8c54('0x28')](function(_0x51587a){_0x3af3a2[_0x8c54('0x20')]=_0x51587a;if(_0x1204ef['query']['includeAll']){_0x4588b2[_0x8c54('0x42')]=[{'all':!![]}];}return db[_0x8c54('0x41')][_0x8c54('0x43')](_0x4588b2);})[_0x8c54('0x28')](function(_0x188b58){_0x3af3a2['rows']=_0x188b58;return _0x3af3a2;})[_0x8c54('0x28')](respondWithFilteredResult(_0x457550,_0x4588b2))[_0x8c54('0x44')](handleError(_0x457550,null));};exports['show']=function(_0x1dc4fd,_0x4ee6af){var _0x11f9cd={'raw':![],'where':{'id':_0x1dc4fd[_0x8c54('0x45')]['id']}},_0x50491c={};_0x50491c['model']=_['keys'](db[_0x8c54('0x41')]['rawAttributes']);_0x50491c['query']=_[_0x8c54('0x32')](_0x1dc4fd[_0x8c54('0x31')]);_0x50491c[_0x8c54('0x33')]=_[_0x8c54('0x34')](_0x50491c[_0x8c54('0x30')],_0x50491c[_0x8c54('0x31')]);_0x11f9cd[_0x8c54('0x35')]=_[_0x8c54('0x34')](_0x50491c['model'],qs[_0x8c54('0x36')](_0x1dc4fd[_0x8c54('0x31')][_0x8c54('0x36')]));_0x11f9cd[_0x8c54('0x35')]=_0x11f9cd['attributes'][_0x8c54('0x37')]?_0x11f9cd[_0x8c54('0x35')]:_0x50491c['model'];if(_0x1dc4fd['query'][_0x8c54('0x46')]){_0x11f9cd['include']=[{'all':!![]}];}_0x11f9cd=_['merge']({},_0x11f9cd,_0x1dc4fd[_0x8c54('0x47')]);return db[_0x8c54('0x41')][_0x8c54('0x48')](_0x11f9cd)[_0x8c54('0x28')](handleEntityNotFound(_0x4ee6af,null))[_0x8c54('0x28')](respondWithResult(_0x4ee6af,null))[_0x8c54('0x44')](handleError(_0x4ee6af,null));};exports[_0x8c54('0x49')]=function(_0x357abd,_0x7a53f5){return db['VoiceQueueReport'][_0x8c54('0x49')](_0x357abd[_0x8c54('0x4a')],{})[_0x8c54('0x28')](respondWithResult(_0x7a53f5,0xc9))[_0x8c54('0x44')](handleError(_0x7a53f5,null));};exports[_0x8c54('0x27')]=function(_0x21ebb3,_0x13366b){if(_0x21ebb3[_0x8c54('0x4a')]['id']){delete _0x21ebb3[_0x8c54('0x4a')]['id'];}return db[_0x8c54('0x41')][_0x8c54('0x48')]({'where':{'id':_0x21ebb3[_0x8c54('0x45')]['id']}})['then'](handleEntityNotFound(_0x13366b,null))[_0x8c54('0x28')](saveUpdates(_0x21ebb3[_0x8c54('0x4a')],null))[_0x8c54('0x28')](respondWithResult(_0x13366b,null))[_0x8c54('0x44')](handleError(_0x13366b,null));};exports[_0x8c54('0x4b')]=function(_0x40b292,_0x38e652){return db[_0x8c54('0x41')][_0x8c54('0x48')]({'where':{'id':_0x40b292[_0x8c54('0x45')]['id']}})[_0x8c54('0x28')](handleEntityNotFound(_0x38e652,null))[_0x8c54('0x28')](removeEntity(_0x38e652,null))[_0x8c54('0x44')](handleError(_0x38e652,null));};exports[_0x8c54('0x4c')]=function(_0x2c7665,_0x56a8dd){return db[_0x8c54('0x41')]['describe']()[_0x8c54('0x28')](respondWithResult(_0x56a8dd,null))['catch'](handleError(_0x56a8dd,null));};exports[_0x8c54('0x4d')]=function(_0x40ea25,_0x5b463b){var _0x389a94={},_0x71891b={},_0x5d7c78={'count':0x0,'rows':[]};_0x71891b[_0x8c54('0x30')]=_[_0x8c54('0x32')](db[_0x8c54('0x41')][_0x8c54('0x2d')]);_0x71891b[_0x8c54('0x31')]=_[_0x8c54('0x32')](_0x40ea25[_0x8c54('0x31')]);_0x71891b[_0x8c54('0x33')]=_[_0x8c54('0x34')](_0x71891b[_0x8c54('0x30')],_0x71891b[_0x8c54('0x31')]);_0x389a94[_0x8c54('0x35')]=_[_0x8c54('0x34')](_0x71891b[_0x8c54('0x30')],qs[_0x8c54('0x36')](_0x40ea25[_0x8c54('0x31')]['fields']));_0x389a94[_0x8c54('0x35')]=_0x389a94[_0x8c54('0x35')][_0x8c54('0x37')]?_0x389a94['attributes']:_0x71891b[_0x8c54('0x30')];if(!_0x40ea25[_0x8c54('0x31')][_0x8c54('0x38')](_0x8c54('0x39'))){_0x389a94[_0x8c54('0x21')]=qs['limit'](_0x40ea25[_0x8c54('0x31')][_0x8c54('0x21')]);_0x389a94[_0x8c54('0x1e')]=qs[_0x8c54('0x1e')](_0x40ea25[_0x8c54('0x31')][_0x8c54('0x1e')]);}_0x389a94[_0x8c54('0x3a')]=qs[_0x8c54('0x3b')](_0x40ea25[_0x8c54('0x31')]['sort']);_0x389a94[_0x8c54('0x3e')]=qs['filters'](_[_0x8c54('0x3c')](_0x40ea25[_0x8c54('0x31')],_0x71891b[_0x8c54('0x33')]));if(_0x40ea25[_0x8c54('0x31')][_0x8c54('0x3d')]){_0x389a94[_0x8c54('0x3e')]=_[_0x8c54('0x40')](_0x389a94[_0x8c54('0x3e')],{'$or':_[_0x8c54('0x4e')](_0x389a94[_0x8c54('0x35')],function(_0x8013cc){var _0x58210a={};_0x58210a[_0x8013cc]={'$like':'%'+_0x40ea25[_0x8c54('0x31')][_0x8c54('0x3d')]+'%'};return _0x58210a;})});}_0x389a94=_[_0x8c54('0x40')]({},_0x389a94,_0x40ea25[_0x8c54('0x47')]);var _0x5430fe={'where':_0x389a94[_0x8c54('0x3e')]};return db[_0x8c54('0x41')][_0x8c54('0x20')](_0x5430fe)[_0x8c54('0x28')](function(_0x38740f){_0x5d7c78[_0x8c54('0x20')]=_0x38740f;if(_0x40ea25[_0x8c54('0x31')][_0x8c54('0x46')]){_0x389a94[_0x8c54('0x42')]=[{'all':!![]}];}return db[_0x8c54('0x41')]['findAll'](_0x389a94);})['then'](function(_0x10b118){_0x5d7c78[_0x8c54('0x4f')]=_0x10b118;return _0x5d7c78;})[_0x8c54('0x28')](respondWithFilteredResult(_0x5b463b,_0x389a94,_0x8c54('0x4d')))[_0x8c54('0x44')](handleError(_0x5b463b,null,_0x8c54('0x4d')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 4062ece..a54884f 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 _0x17df=['VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x17df,0x1cc));var _0xf17d=function(_0x25b60a,_0x1d6ff0){_0x25b60a=_0x25b60a-0x0;var _0x5a2fb6=_0x17df[_0x25b60a];return _0x5a2fb6;};'use strict';var EventEmitter=require(_0xf17d('0x0'));var VoiceQueueReport=require(_0xf17d('0x1'))['db'][_0xf17d('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xf17d('0x3')](0x0);var events={'afterCreate':_0xf17d('0x4'),'afterUpdate':_0xf17d('0x5'),'afterDestroy':_0xf17d('0x6')};function emitEvent(_0x4d9791){return function(_0x1dfd83,_0x3bd9e6,_0xc1d64f){VoiceQueueReportEvents[_0xf17d('0x7')](_0x4d9791+':'+_0x1dfd83['id'],_0x1dfd83);VoiceQueueReportEvents['emit'](_0x4d9791,_0x1dfd83);_0xc1d64f(null);};}for(var e in events){if(events[_0xf17d('0x8')](e)){var event=events[e];VoiceQueueReport[_0xf17d('0x9')](e,emitEvent(event));}}module[_0xf17d('0xa')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x7441=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x58aabf,_0x36bc75){var _0x40f31a=function(_0x2a7e46){while(--_0x2a7e46){_0x58aabf['push'](_0x58aabf['shift']());}};_0x40f31a(++_0x36bc75);}(_0x7441,0x194));var _0x1744=function(_0x4bd57d,_0x40b79f){_0x4bd57d=_0x4bd57d-0x0;var _0x2283d1=_0x7441[_0x4bd57d];return _0x2283d1;};'use strict';var EventEmitter=require(_0x1744('0x0'));var VoiceQueueReport=require(_0x1744('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x1744('0x2')](0x0);var events={'afterCreate':_0x1744('0x3'),'afterUpdate':_0x1744('0x4'),'afterDestroy':_0x1744('0x5')};function emitEvent(_0x5bbbcf){return function(_0x14de52,_0x3ca22a,_0x3410b8){VoiceQueueReportEvents[_0x1744('0x6')](_0x5bbbcf+':'+_0x14de52['id'],_0x14de52);VoiceQueueReportEvents['emit'](_0x5bbbcf,_0x14de52);_0x3410b8(null);};}for(var e in events){if(events[_0x1744('0x7')](e)){var event=events[e];VoiceQueueReport[_0x1744('0x8')](e,emitEvent(event));}}module[_0x1744('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 2a2691b..6d4860e 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 _0xf08d=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','uniqueid','calleridnum','lodash'];(function(_0x30500b,_0xf375ee){var _0x2dd979=function(_0x2bc310){while(--_0x2bc310){_0x30500b['push'](_0x30500b['shift']());}};_0x2dd979(++_0xf375ee);}(_0xf08d,0x1eb));var _0xdf08=function(_0x3373a1,_0x4feadb){_0x3373a1=_0x3373a1-0x0;var _0x31e33c=_0xf08d[_0x3373a1];return _0x31e33c;};'use strict';var _=require(_0xdf08('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdf08('0x1'));var moment=require(_0xdf08('0x2'));var BPromise=require(_0xdf08('0x3'));var rp=require(_0xdf08('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdf08('0x5'));var config=require(_0xdf08('0x6'));var attributes=require(_0xdf08('0x7'));module[_0xdf08('0x8')]=function(_0x143123,_0x4f440b){return _0x143123[_0xdf08('0x9')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xdf08('0xa')]},{'fields':[_0xdf08('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x982c=['rimraf','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x4f6b61,_0x14cc4d){var _0x281cd0=function(_0x4e0822){while(--_0x4e0822){_0x4f6b61['push'](_0x4f6b61['shift']());}};_0x281cd0(++_0x14cc4d);}(_0x982c,0x1c8));var _0xc982=function(_0x56aed2,_0x50b419){_0x56aed2=_0x56aed2-0x0;var _0x571ed4=_0x982c[_0x56aed2];return _0x571ed4;};'use strict';var _=require(_0xc982('0x0'));var util=require(_0xc982('0x1'));var logger=require(_0xc982('0x2'))('api');var moment=require(_0xc982('0x3'));var BPromise=require(_0xc982('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc982('0x5'));var rimraf=require(_0xc982('0x6'));var config=require(_0xc982('0x7'));var attributes=require(_0xc982('0x8'));module['exports']=function(_0x146259,_0x48ac44){return _0x146259[_0xc982('0x9')](_0xc982('0xa'),attributes,{'tableName':_0xc982('0xb'),'paranoid':![],'indexes':[{'fields':[_0xc982('0xc')]},{'fields':[_0xc982('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 147900d..ea18824 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 _0xa36d=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','request','then','info','debug','stringify','error','code','message','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceQueueReport','VoiceQueueReport','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xa36d,0xa1));var _0xda36=function(_0x377dd9,_0x485a88){_0x377dd9=_0x377dd9-0x0;var _0x508fe8=_0xa36d[_0x377dd9];return _0x508fe8;};'use strict';var _=require('lodash');var util=require(_0xda36('0x0'));var moment=require(_0xda36('0x1'));var BPromise=require(_0xda36('0x2'));var rs=require(_0xda36('0x3'));var fs=require('fs');var Redis=require(_0xda36('0x4'));var db=require(_0xda36('0x5'))['db'];var utils=require(_0xda36('0x6'));var logger=require(_0xda36('0x7'))(_0xda36('0x8'));var config=require(_0xda36('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xda36('0xa')][_0xda36('0xb')]({'port':0x232a});config[_0xda36('0xc')]=_[_0xda36('0xd')](config[_0xda36('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xda36('0xe'))(new Redis(config[_0xda36('0xc')]));require(_0xda36('0xf'))['register'](socket);function respondWithRpcPromise(_0x533069,_0x4d6673,_0x13e7e8){return new BPromise(function(_0x1affe4,_0x2aacae){return client[_0xda36('0x10')](_0x533069,_0x13e7e8)[_0xda36('0x11')](function(_0x2a6f1a){logger[_0xda36('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x4d6673,'request\x20sent');logger[_0xda36('0x13')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x4d6673,'request\x20sent',JSON[_0xda36('0x14')](_0x2a6f1a));if(_0x2a6f1a[_0xda36('0x15')]){if(_0x2a6f1a['error'][_0xda36('0x16')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x4d6673,_0x2a6f1a[_0xda36('0x15')][_0xda36('0x17')]);return _0x2aacae(_0x2a6f1a[_0xda36('0x15')][_0xda36('0x17')]);}logger[_0xda36('0x15')](_0xda36('0x18'),_0x4d6673,_0x2a6f1a['error'][_0xda36('0x17')]);return _0x1affe4(_0x2a6f1a['error'][_0xda36('0x17')]);}else{logger[_0xda36('0x12')](_0xda36('0x18'),_0x4d6673,_0xda36('0x19'));_0x1affe4(_0x2a6f1a['result']['message']);}})[_0xda36('0x1a')](function(_0x4c442b){logger[_0xda36('0x15')](_0xda36('0x18'),_0x4d6673,_0x4c442b);_0x2aacae(_0x4c442b);});});}exports['GetVoiceQueueReport']=function(_0x5ed836){var _0x99b23e=this;return new Promise(function(_0x34f510,_0x1ef90d){return db['VoiceQueueReport'][_0xda36('0x1b')]({'raw':_0x5ed836[_0xda36('0x1c')]?_0x5ed836['options'][_0xda36('0x1d')]===undefined?!![]:![]:!![],'where':_0x5ed836['options']?_0x5ed836[_0xda36('0x1c')][_0xda36('0x1e')]||null:null,'attributes':_0x5ed836['options']?_0x5ed836[_0xda36('0x1c')][_0xda36('0x1f')]||null:null,'limit':_0x5ed836[_0xda36('0x1c')]?_0x5ed836[_0xda36('0x1c')][_0xda36('0x20')]||null:null,'include':_0x5ed836['options']?_0x5ed836[_0xda36('0x1c')][_0xda36('0x21')]?_[_0xda36('0x22')](_0x5ed836[_0xda36('0x1c')]['include'],function(_0x47754d){return{'model':db[_0x47754d['model']],'as':_0x47754d['as'],'attributes':_0x47754d[_0xda36('0x1f')],'include':_0x47754d['include']?_[_0xda36('0x22')](_0x47754d['include'],function(_0x3d220c){return{'model':db[_0x3d220c['model']],'as':_0x3d220c['as'],'attributes':_0x3d220c[_0xda36('0x1f')],'include':_0x3d220c['include']?_[_0xda36('0x22')](_0x3d220c[_0xda36('0x21')],function(_0xed94d2){return{'model':db[_0xed94d2[_0xda36('0x23')]],'as':_0xed94d2['as'],'attributes':_0xed94d2[_0xda36('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xda36('0x11')](function(_0x3e202c){logger['info'](_0xda36('0x24'),_0x5ed836);logger[_0xda36('0x13')](_0xda36('0x24'),_0x5ed836,JSON['stringify'](_0x3e202c));_0x34f510(_0x3e202c);})['catch'](function(_0x67a921){logger[_0xda36('0x15')](_0xda36('0x24'),_0x67a921[_0xda36('0x17')],_0x5ed836);_0x1ef90d(_0x99b23e[_0xda36('0x15')](0x1f4,_0x67a921[_0xda36('0x17')]));});});};exports['CreateVoiceQueueReport']=function(_0x44c978){var _0x359de3=this;return new Promise(function(_0x24eee4,_0x2a6f85){return db[_0xda36('0x25')][_0xda36('0x26')](_0x44c978[_0xda36('0x27')],{'raw':_0x44c978[_0xda36('0x1c')]?_0x44c978[_0xda36('0x1c')][_0xda36('0x1d')]===undefined?!![]:![]:!![]})[_0xda36('0x11')](function(_0x248ce8){logger[_0xda36('0x12')]('CreateVoiceQueueReport',_0x44c978);logger[_0xda36('0x13')](_0xda36('0x28'),_0x44c978,JSON[_0xda36('0x14')](_0x248ce8));_0x24eee4(_0x248ce8);})['catch'](function(_0x2aada6){logger[_0xda36('0x15')](_0xda36('0x28'),_0x2aada6[_0xda36('0x17')],_0x44c978);_0x2a6f85(_0x359de3[_0xda36('0x15')](0x1f4,_0x2aada6[_0xda36('0x17')]));});});};exports[_0xda36('0x29')]=function(_0x207e27){var _0x528ea9=this;return new Promise(function(_0x5a3020,_0x2e1c90){return db[_0xda36('0x25')]['update'](_0x207e27[_0xda36('0x27')],{'raw':_0x207e27[_0xda36('0x1c')]?_0x207e27[_0xda36('0x1c')][_0xda36('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x207e27['options']?_0x207e27[_0xda36('0x1c')][_0xda36('0x1e')]||null:null,'attributes':_0x207e27[_0xda36('0x1c')]?_0x207e27['options'][_0xda36('0x1f')]||null:null,'limit':_0x207e27['options']?_0x207e27['options'][_0xda36('0x20')]||null:null})[_0xda36('0x11')](function(_0x391142){logger[_0xda36('0x12')](_0xda36('0x29'),_0x207e27);logger['debug'](_0xda36('0x29'),_0x207e27,JSON['stringify'](_0x391142));_0x5a3020(_0x391142);})[_0xda36('0x1a')](function(_0x1cea68){logger[_0xda36('0x15')]('UpdateVoiceQueueReport',_0x1cea68[_0xda36('0x17')],_0x207e27);_0x2e1c90(_0x528ea9[_0xda36('0x15')](0x1f4,_0x1cea68[_0xda36('0x17')]));});});}; \ No newline at end of file +var _0x01da=['CreateVoiceQueueReport','create','body','where','UpdateVoiceQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','attributes','limit','include','map','model','stringify','catch'];(function(_0x5f516e,_0x298150){var _0x1c81e5=function(_0x25be12){while(--_0x25be12){_0x5f516e['push'](_0x5f516e['shift']());}};_0x1c81e5(++_0x298150);}(_0x01da,0x188));var _0xa01d=function(_0x3dc9c7,_0x469098){_0x3dc9c7=_0x3dc9c7-0x0;var _0x4cb08c=_0x01da[_0x3dc9c7];return _0x4cb08c;};'use strict';var _=require('lodash');var util=require(_0xa01d('0x0'));var moment=require(_0xa01d('0x1'));var BPromise=require(_0xa01d('0x2'));var rs=require(_0xa01d('0x3'));var fs=require('fs');var Redis=require(_0xa01d('0x4'));var db=require(_0xa01d('0x5'))['db'];var utils=require(_0xa01d('0x6'));var logger=require(_0xa01d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa01d('0x8'));var client=jayson[_0xa01d('0x9')][_0xa01d('0xa')]({'port':0x232a});config['redis']=_[_0xa01d('0xb')](config[_0xa01d('0xc')],{'host':_0xa01d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa01d('0xc')]));require('./voiceQueueReport.socket')[_0xa01d('0xe')](socket);function respondWithRpcPromise(_0x24fd67,_0x49c46c,_0x26de50){return new BPromise(function(_0x2552f0,_0x40de13){return client[_0xa01d('0xf')](_0x24fd67,_0x26de50)[_0xa01d('0x10')](function(_0x110165){logger[_0xa01d('0x11')](_0xa01d('0x12'),_0x49c46c,_0xa01d('0x13'));logger[_0xa01d('0x14')](_0xa01d('0x15'),_0x49c46c,_0xa01d('0x13'),JSON['stringify'](_0x110165));if(_0x110165['error']){if(_0x110165[_0xa01d('0x16')][_0xa01d('0x17')]===0x1f4){logger[_0xa01d('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x49c46c,_0x110165[_0xa01d('0x16')][_0xa01d('0x18')]);return _0x40de13(_0x110165[_0xa01d('0x16')][_0xa01d('0x18')]);}logger[_0xa01d('0x16')](_0xa01d('0x12'),_0x49c46c,_0x110165[_0xa01d('0x16')][_0xa01d('0x18')]);return _0x2552f0(_0x110165[_0xa01d('0x16')]['message']);}else{logger[_0xa01d('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x49c46c,_0xa01d('0x13'));_0x2552f0(_0x110165[_0xa01d('0x19')][_0xa01d('0x18')]);}})['catch'](function(_0x43f754){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x49c46c,_0x43f754);_0x40de13(_0x43f754);});});}exports[_0xa01d('0x1a')]=function(_0x494589){var _0x5d927f=this;return new Promise(function(_0x5f43e1,_0x70a2d9){return db[_0xa01d('0x1b')][_0xa01d('0x1c')]({'raw':_0x494589[_0xa01d('0x1d')]?_0x494589[_0xa01d('0x1d')][_0xa01d('0x1e')]===undefined?!![]:![]:!![],'where':_0x494589[_0xa01d('0x1d')]?_0x494589[_0xa01d('0x1d')]['where']||null:null,'attributes':_0x494589[_0xa01d('0x1d')]?_0x494589['options'][_0xa01d('0x1f')]||null:null,'limit':_0x494589['options']?_0x494589[_0xa01d('0x1d')][_0xa01d('0x20')]||null:null,'include':_0x494589[_0xa01d('0x1d')]?_0x494589[_0xa01d('0x1d')][_0xa01d('0x21')]?_[_0xa01d('0x22')](_0x494589[_0xa01d('0x1d')]['include'],function(_0x162058){return{'model':db[_0x162058[_0xa01d('0x23')]],'as':_0x162058['as'],'attributes':_0x162058['attributes'],'include':_0x162058['include']?_[_0xa01d('0x22')](_0x162058[_0xa01d('0x21')],function(_0x56bc19){return{'model':db[_0x56bc19[_0xa01d('0x23')]],'as':_0x56bc19['as'],'attributes':_0x56bc19['attributes'],'include':_0x56bc19['include']?_[_0xa01d('0x22')](_0x56bc19[_0xa01d('0x21')],function(_0x34d944){return{'model':db[_0x34d944[_0xa01d('0x23')]],'as':_0x34d944['as'],'attributes':_0x34d944[_0xa01d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa01d('0x10')](function(_0x1094a3){logger[_0xa01d('0x11')](_0xa01d('0x1a'),_0x494589);logger[_0xa01d('0x14')](_0xa01d('0x1a'),_0x494589,JSON[_0xa01d('0x24')](_0x1094a3));_0x5f43e1(_0x1094a3);})[_0xa01d('0x25')](function(_0x5bcf59){logger[_0xa01d('0x16')](_0xa01d('0x1a'),_0x5bcf59[_0xa01d('0x18')],_0x494589);_0x70a2d9(_0x5d927f['error'](0x1f4,_0x5bcf59[_0xa01d('0x18')]));});});};exports[_0xa01d('0x26')]=function(_0x3cd582){var _0x813407=this;return new Promise(function(_0x29d0c4,_0x15b164){return db[_0xa01d('0x1b')][_0xa01d('0x27')](_0x3cd582[_0xa01d('0x28')],{'raw':_0x3cd582['options']?_0x3cd582[_0xa01d('0x1d')][_0xa01d('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x13538d){logger[_0xa01d('0x11')](_0xa01d('0x26'),_0x3cd582);logger[_0xa01d('0x14')](_0xa01d('0x26'),_0x3cd582,JSON[_0xa01d('0x24')](_0x13538d));_0x29d0c4(_0x13538d);})[_0xa01d('0x25')](function(_0x4b602a){logger[_0xa01d('0x16')](_0xa01d('0x26'),_0x4b602a[_0xa01d('0x18')],_0x3cd582);_0x15b164(_0x813407['error'](0x1f4,_0x4b602a['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x3b94b6){var _0x2fcf9c=this;return new Promise(function(_0x442dd0,_0x10b3ec){return db[_0xa01d('0x1b')]['update'](_0x3b94b6[_0xa01d('0x28')],{'raw':_0x3b94b6['options']?_0x3b94b6[_0xa01d('0x1d')][_0xa01d('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b94b6[_0xa01d('0x1d')]?_0x3b94b6[_0xa01d('0x1d')][_0xa01d('0x29')]||null:null,'attributes':_0x3b94b6[_0xa01d('0x1d')]?_0x3b94b6[_0xa01d('0x1d')][_0xa01d('0x1f')]||null:null,'limit':_0x3b94b6[_0xa01d('0x1d')]?_0x3b94b6[_0xa01d('0x1d')][_0xa01d('0x20')]||null:null})[_0xa01d('0x10')](function(_0x58fe80){logger[_0xa01d('0x11')]('UpdateVoiceQueueReport',_0x3b94b6);logger[_0xa01d('0x14')](_0xa01d('0x2a'),_0x3b94b6,JSON['stringify'](_0x58fe80));_0x442dd0(_0x58fe80);})['catch'](function(_0x24279f){logger[_0xa01d('0x16')](_0xa01d('0x2a'),_0x24279f[_0xa01d('0x18')],_0x3b94b6);_0x10b3ec(_0x2fcf9c[_0xa01d('0x16')](0x1f4,_0x24279f[_0xa01d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 6f3d7ca..d6a7062 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 _0xc0c2=['update','emit','removeListener','register','voiceQueueReport:','save','remove'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xc0c2,0x1b7));var _0x2c0c=function(_0x2a9f4,_0x25c14a){_0x2a9f4=_0x2a9f4-0x0;var _0x3c39e0=_0xc0c2[_0x2a9f4];return _0x3c39e0;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x2c0c('0x0'),_0x2c0c('0x1'),_0x2c0c('0x2')];function createListener(_0x38b445,_0x4f7b21){return function(_0x3b582e){_0x4f7b21[_0x2c0c('0x3')](_0x38b445,_0x3b582e);};}function removeListener(_0x362d03,_0x276285){return function(){VoiceQueueReportEvents[_0x2c0c('0x4')](_0x362d03,_0x276285);};}exports[_0x2c0c('0x5')]=function(_0x29065c){for(var _0x407dad=0x0,_0x5472d9=events['length'];_0x407dad<_0x5472d9;_0x407dad++){var _0x3d6ee6=events[_0x407dad];var _0x20d58d=createListener(_0x2c0c('0x6')+_0x3d6ee6,_0x29065c);VoiceQueueReportEvents['on'](_0x3d6ee6,_0x20d58d);}}; \ No newline at end of file +var _0x97ed=['voiceQueueReport:','./voiceQueueReport.events','save','emit','removeListener','length'];(function(_0x38722f,_0x369bdc){var _0x219d0c=function(_0x4ad531){while(--_0x4ad531){_0x38722f['push'](_0x38722f['shift']());}};_0x219d0c(++_0x369bdc);}(_0x97ed,0x1e7));var _0xd97e=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x97ed[_0x4b369d];return _0x571a98;};'use strict';var VoiceQueueReportEvents=require(_0xd97e('0x0'));var events=[_0xd97e('0x1'),'remove','update'];function createListener(_0x1069c7,_0x18d811){return function(_0x5cc925){_0x18d811[_0xd97e('0x2')](_0x1069c7,_0x5cc925);};}function removeListener(_0x27b80c,_0x3d09f8){return function(){VoiceQueueReportEvents[_0xd97e('0x3')](_0x27b80c,_0x3d09f8);};}exports['register']=function(_0x2468bc){for(var _0x538bdd=0x0,_0x4f7f99=events[_0xd97e('0x4')];_0x538bdd<_0x4f7f99;_0x538bdd++){var _0x52a86d=events[_0x538bdd];var _0x51a495=createListener(_0xd97e('0x5')+_0x52a86d,_0x2468bc);VoiceQueueReportEvents['on'](_0x52a86d,_0x51a495);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 0e1823a..18430ea 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 _0xc556=['put','/:id','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','show','post'];(function(_0x23345f,_0xc1cd34){var _0x1865e0=function(_0x4c76e3){while(--_0x4c76e3){_0x23345f['push'](_0x23345f['shift']());}};_0x1865e0(++_0xc1cd34);}(_0xc556,0xc3));var _0x6c55=function(_0x4ab371,_0x218c3b){_0x4ab371=_0x4ab371-0x0;var _0xccf2ba=_0xc556[_0x4ab371];return _0xccf2ba;};'use strict';var multer=require(_0x6c55('0x0'));var util=require('util');var path=require(_0x6c55('0x1'));var timeout=require(_0x6c55('0x2'));var express=require(_0x6c55('0x3'));var router=express['Router']();var fs_extra=require(_0x6c55('0x4'));var auth=require(_0x6c55('0x5'));var interaction=require(_0x6c55('0x6'));var config=require(_0x6c55('0x7'));var controller=require(_0x6c55('0x8'));router[_0x6c55('0x9')]('/',auth[_0x6c55('0xa')](),controller[_0x6c55('0xb')]);router[_0x6c55('0x9')]('/:id',auth[_0x6c55('0xa')](),controller[_0x6c55('0xc')]);router[_0x6c55('0xd')]('/',auth[_0x6c55('0xa')](),controller['create']);router[_0x6c55('0xe')](_0x6c55('0xf'),auth[_0x6c55('0xa')](),controller[_0x6c55('0x10')]);router[_0x6c55('0x11')](_0x6c55('0xf'),auth[_0x6c55('0xa')](),controller[_0x6c55('0x12')]);module['exports']=router; \ No newline at end of file +var _0xb035=['get','/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index'];(function(_0x4c2769,_0x42aadd){var _0x27bdf9=function(_0x4136a5){while(--_0x4136a5){_0x4c2769['push'](_0x4c2769['shift']());}};_0x27bdf9(++_0x42aadd);}(_0xb035,0x87));var _0x5b03=function(_0x2ecfca,_0x4f5d2c){_0x2ecfca=_0x2ecfca-0x0;var _0x3cbd36=_0xb035[_0x2ecfca];return _0x3cbd36;};'use strict';var multer=require(_0x5b03('0x0'));var util=require('util');var path=require(_0x5b03('0x1'));var timeout=require(_0x5b03('0x2'));var express=require(_0x5b03('0x3'));var router=express[_0x5b03('0x4')]();var fs_extra=require(_0x5b03('0x5'));var auth=require(_0x5b03('0x6'));var interaction=require(_0x5b03('0x7'));var config=require(_0x5b03('0x8'));var controller=require(_0x5b03('0x9'));router['get']('/',auth[_0x5b03('0xa')](),controller[_0x5b03('0xb')]);router[_0x5b03('0xc')](_0x5b03('0xd'),auth[_0x5b03('0xa')](),controller[_0x5b03('0xe')]);router[_0x5b03('0xf')]('/',auth[_0x5b03('0xa')](),controller[_0x5b03('0x10')]);router[_0x5b03('0x11')](_0x5b03('0xd'),auth['isAuthenticated'](),controller[_0x5b03('0x12')]);router[_0x5b03('0x13')](_0x5b03('0xd'),auth[_0x5b03('0xa')](),controller[_0x5b03('0x14')]);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 d857dfd..3cf1c2e 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 _0x94dc=['STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports'];(function(_0x1ff6b3,_0x272d37){var _0x3f6774=function(_0x235292){while(--_0x235292){_0x1ff6b3['push'](_0x1ff6b3['shift']());}};_0x3f6774(++_0x272d37);}(_0x94dc,0x90));var _0xc94d=function(_0x30d156,_0x50c7f6){_0x30d156=_0x30d156-0x0;var _0xf9e49f=_0x94dc[_0x30d156];return _0xf9e49f;};'use strict';var Sequelize=require(_0xc94d('0x0'));var moment=require(_0xc94d('0x1'));module[_0xc94d('0x2')]={'time':{'type':Sequelize[_0xc94d('0x3')]},'callid':{'type':Sequelize[_0xc94d('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xc94d('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xc94d('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xc94d('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xc94d('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xc94d('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xc94d('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xc94d('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xc94d('0x4')],'allowNull':![],'defaultValue':Sequelize[_0xc94d('0x5')](_0xc94d('0x6'))}}; \ No newline at end of file +var _0xe98d=['STRING','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment'];(function(_0x36c467,_0x537519){var _0x240018=function(_0x5a4df9){while(--_0x5a4df9){_0x36c467['push'](_0x36c467['shift']());}};_0x240018(++_0x537519);}(_0xe98d,0x1d2));var _0xde98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe98d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xde98('0x0'));var moment=require(_0xde98('0x1'));module['exports']={'time':{'type':Sequelize[_0xde98('0x2')]},'callid':{'type':Sequelize[_0xde98('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xde98('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xde98('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xde98('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xde98('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xde98('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xde98('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xde98('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['literal'](_0xde98('0x3'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 2d72566..bed18be 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 _0xe62f=['moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','include','findAll','catch','params','fields','length','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x5afd4f,_0x37f92c){var _0x4d5f07=function(_0x5558f6){while(--_0x5558f6){_0x5afd4f['push'](_0x5afd4f['shift']());}};_0x4d5f07(++_0x37f92c);}(_0xe62f,0xdd));var _0xfe62=function(_0x13e106,_0x136633){_0x13e106=_0x13e106-0x0;var _0x16602e=_0xe62f[_0x13e106];return _0x16602e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe62('0x0'));var zipdir=require(_0xfe62('0x1'));var jsonpatch=require(_0xfe62('0x2'));var rp=require(_0xfe62('0x3'));var moment=require(_0xfe62('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfe62('0x5'));var util=require(_0xfe62('0x6'));var path=require(_0xfe62('0x7'));var sox=require(_0xfe62('0x8'));var csv=require(_0xfe62('0x9'));var ejs=require(_0xfe62('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe62('0xb'));var squel=require(_0xfe62('0xc'));var crypto=require(_0xfe62('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfe62('0xe'));var toCsv=require(_0xfe62('0x9'));var querystring=require('querystring');var Papa=require(_0xfe62('0xf'));var Redis=require('ioredis');var authService=require(_0xfe62('0x10'));var qs=require(_0xfe62('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe62('0x12'));var logger=require(_0xfe62('0x13'))(_0xfe62('0x14'));var utils=require(_0xfe62('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xfe62('0x16'));var db=require(_0xfe62('0x17'))['db'];function respondWithStatusCode(_0x59a30f,_0x2a3aa2){_0x2a3aa2=_0x2a3aa2||0xcc;return function(_0x415400){if(_0x415400){return _0x59a30f['sendStatus'](_0x2a3aa2);}return _0x59a30f[_0xfe62('0x18')](_0x2a3aa2)[_0xfe62('0x19')]();};}function respondWithResult(_0x8b716c,_0x59f227){_0x59f227=_0x59f227||0xc8;return function(_0x4955d6){if(_0x4955d6){return _0x8b716c[_0xfe62('0x18')](_0x59f227)[_0xfe62('0x1a')](_0x4955d6);}};}function respondWithFilteredResult(_0x43c403,_0x205097){return function(_0x220521){if(_0x220521){var _0x143d42=typeof _0x205097[_0xfe62('0x1b')]==='undefined'&&typeof _0x205097[_0xfe62('0x1c')]===_0xfe62('0x1d');var _0x258f78=_0x220521[_0xfe62('0x1e')];var _0x2bfdbc=_0x143d42?0x0:_0x205097[_0xfe62('0x1b')];var _0x147e8a=_0x143d42?_0x220521[_0xfe62('0x1e')]:_0x205097[_0xfe62('0x1b')]+_0x205097[_0xfe62('0x1c')];var _0x3d99d4;if(_0x147e8a>=_0x258f78){_0x147e8a=_0x258f78;_0x3d99d4=0xc8;}else{_0x3d99d4=0xce;}_0x43c403['status'](_0x3d99d4);return _0x43c403[_0xfe62('0x1f')](_0xfe62('0x20'),_0x2bfdbc+'-'+_0x147e8a+'/'+_0x258f78)[_0xfe62('0x1a')](_0x220521);}return null;};}function patchUpdates(_0x3189c3){return function(_0xeedf16){try{jsonpatch[_0xfe62('0x21')](_0xeedf16,_0x3189c3,!![]);}catch(_0x350b5c){return BPromise[_0xfe62('0x22')](_0x350b5c);}return _0xeedf16[_0xfe62('0x23')]();};}function saveUpdates(_0x44a7e4,_0x3b0975){return function(_0x45e96d){if(_0x45e96d){return _0x45e96d['update'](_0x44a7e4)[_0xfe62('0x24')](function(_0x514735){return _0x514735;});}return null;};}function removeEntity(_0x463f16,_0x2c1c7b){return function(_0x4c8a70){if(_0x4c8a70){return _0x4c8a70[_0xfe62('0x25')]()[_0xfe62('0x24')](function(){_0x463f16[_0xfe62('0x18')](0xcc)[_0xfe62('0x19')]();});}};}function handleEntityNotFound(_0x3fc5f6,_0x124584){return function(_0x52e4f9){if(!_0x52e4f9){_0x3fc5f6[_0xfe62('0x26')](0x194);}return _0x52e4f9;};}function handleError(_0x5036f1,_0x168dfa){_0x168dfa=_0x168dfa||0x1f4;return function(_0x116b8a){logger[_0xfe62('0x27')](_0x116b8a[_0xfe62('0x28')]);if(_0x116b8a['name']){delete _0x116b8a['name'];}_0x5036f1[_0xfe62('0x18')](_0x168dfa)[_0xfe62('0x29')](_0x116b8a);};}exports[_0xfe62('0x2a')]=function(_0x359835,_0x551a38){var _0x3a8a0b={},_0x120d81={},_0xd7a94={'count':0x0,'rows':[]};var _0x4b1b98=_[_0xfe62('0x2b')](db[_0xfe62('0x2c')][_0xfe62('0x2d')],function(_0x23f75d){return{'name':_0x23f75d[_0xfe62('0x2e')],'type':_0x23f75d[_0xfe62('0x2f')][_0xfe62('0x30')]};});_0x120d81[_0xfe62('0x31')]=_[_0xfe62('0x2b')](_0x4b1b98,'name');_0x120d81[_0xfe62('0x32')]=_[_0xfe62('0x33')](_0x359835['query']);_0x120d81[_0xfe62('0x34')]=_[_0xfe62('0x35')](_0x120d81[_0xfe62('0x31')],_0x120d81[_0xfe62('0x32')]);_0x3a8a0b[_0xfe62('0x36')]=_['intersection'](_0x120d81[_0xfe62('0x31')],qs['fields'](_0x359835[_0xfe62('0x32')]['fields']));_0x3a8a0b[_0xfe62('0x36')]=_0x3a8a0b[_0xfe62('0x36')]['length']?_0x3a8a0b['attributes']:_0x120d81['model'];if(!_0x359835[_0xfe62('0x32')][_0xfe62('0x37')]('nolimit')){_0x3a8a0b[_0xfe62('0x1c')]=qs[_0xfe62('0x1c')](_0x359835[_0xfe62('0x32')][_0xfe62('0x1c')]);_0x3a8a0b[_0xfe62('0x1b')]=qs['offset'](_0x359835['query'][_0xfe62('0x1b')]);}_0x3a8a0b[_0xfe62('0x38')]=qs[_0xfe62('0x39')](_0x359835[_0xfe62('0x32')][_0xfe62('0x39')]);_0x3a8a0b[_0xfe62('0x3a')]=qs['filters'](_[_0xfe62('0x3b')](_0x359835[_0xfe62('0x32')],_0x120d81[_0xfe62('0x34')]),_0x4b1b98);if(_0x359835[_0xfe62('0x32')][_0xfe62('0x3c')]){_0x3a8a0b[_0xfe62('0x3a')]=_[_0xfe62('0x3d')](_0x3a8a0b[_0xfe62('0x3a')],{'$or':_[_0xfe62('0x2b')](_0x4b1b98,function(_0x2205ca){if(_0x2205ca[_0xfe62('0x2f')]!==_0xfe62('0x3e')){var _0x55559b={};_0x55559b[_0x2205ca[_0xfe62('0x3f')]]={'$like':'%'+_0x359835[_0xfe62('0x32')][_0xfe62('0x3c')]+'%'};return _0x55559b;}})});}_0x3a8a0b=_['merge']({},_0x3a8a0b,_0x359835[_0xfe62('0x40')]);var _0x2b2870={'where':_0x3a8a0b[_0xfe62('0x3a')]};return db['VoiceQueuesLog'][_0xfe62('0x1e')](_0x2b2870)['then'](function(_0x177f11){_0xd7a94['count']=_0x177f11;if(_0x359835[_0xfe62('0x32')][_0xfe62('0x41')]){_0x3a8a0b[_0xfe62('0x42')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xfe62('0x43')](_0x3a8a0b);})['then'](function(_0x235a20){_0xd7a94['rows']=_0x235a20;return _0xd7a94;})[_0xfe62('0x24')](respondWithFilteredResult(_0x551a38,_0x3a8a0b))[_0xfe62('0x44')](handleError(_0x551a38,null));};exports['show']=function(_0x25bfe5,_0x4ff173){var _0x538287={'raw':!![],'where':{'id':_0x25bfe5[_0xfe62('0x45')]['id']}},_0x3f6f82={};_0x3f6f82[_0xfe62('0x31')]=_['keys'](db[_0xfe62('0x2c')][_0xfe62('0x2d')]);_0x3f6f82['query']=_[_0xfe62('0x33')](_0x25bfe5[_0xfe62('0x32')]);_0x3f6f82['filters']=_[_0xfe62('0x35')](_0x3f6f82[_0xfe62('0x31')],_0x3f6f82[_0xfe62('0x32')]);_0x538287[_0xfe62('0x36')]=_[_0xfe62('0x35')](_0x3f6f82[_0xfe62('0x31')],qs[_0xfe62('0x46')](_0x25bfe5[_0xfe62('0x32')][_0xfe62('0x46')]));_0x538287[_0xfe62('0x36')]=_0x538287[_0xfe62('0x36')][_0xfe62('0x47')]?_0x538287[_0xfe62('0x36')]:_0x3f6f82[_0xfe62('0x31')];if(_0x25bfe5[_0xfe62('0x32')][_0xfe62('0x41')]){_0x538287['include']=[{'all':!![]}];}_0x538287=_[_0xfe62('0x3d')]({},_0x538287,_0x25bfe5['options']);return db[_0xfe62('0x2c')]['find'](_0x538287)[_0xfe62('0x24')](handleEntityNotFound(_0x4ff173,null))[_0xfe62('0x24')](respondWithResult(_0x4ff173,null))['catch'](handleError(_0x4ff173,null));};exports['create']=function(_0x556846,_0x287ec3){return db[_0xfe62('0x2c')][_0xfe62('0x48')](_0x556846['body'],{})[_0xfe62('0x24')](respondWithResult(_0x287ec3,0xc9))[_0xfe62('0x44')](handleError(_0x287ec3,null));};exports['update']=function(_0x2c0dcf,_0x5a39a5){if(_0x2c0dcf[_0xfe62('0x49')]['id']){delete _0x2c0dcf[_0xfe62('0x49')]['id'];}return db[_0xfe62('0x2c')][_0xfe62('0x4a')]({'where':{'id':_0x2c0dcf[_0xfe62('0x45')]['id']}})[_0xfe62('0x24')](handleEntityNotFound(_0x5a39a5,null))[_0xfe62('0x24')](saveUpdates(_0x2c0dcf[_0xfe62('0x49')],null))[_0xfe62('0x24')](respondWithResult(_0x5a39a5,null))[_0xfe62('0x44')](handleError(_0x5a39a5,null));};exports[_0xfe62('0x25')]=function(_0x5607a5,_0x2853c0){return db[_0xfe62('0x2c')][_0xfe62('0x4a')]({'where':{'id':_0x5607a5[_0xfe62('0x45')]['id']}})[_0xfe62('0x24')](handleEntityNotFound(_0x2853c0,null))[_0xfe62('0x24')](removeEntity(_0x2853c0,null))[_0xfe62('0x44')](handleError(_0x2853c0,null));}; \ No newline at end of file +var _0xa664=['options','includeAll','include','findAll','rows','show','params','rawAttributes','keys','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','offset','count','limit','set','reject','save','update','then','destroy','error','name','send','VoiceQueuesLog','type','key','map','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','where'];(function(_0x53c3ba,_0xf3c01){var _0x423b79=function(_0x41e5ff){while(--_0x41e5ff){_0x53c3ba['push'](_0x53c3ba['shift']());}};_0x423b79(++_0xf3c01);}(_0xa664,0x1c9));var _0x4a66=function(_0x2d4f30,_0x421b00){_0x2d4f30=_0x2d4f30-0x0;var _0x8a4b42=_0xa664[_0x2d4f30];return _0x8a4b42;};'use strict';var emlformat=require(_0x4a66('0x0'));var rimraf=require(_0x4a66('0x1'));var zipdir=require(_0x4a66('0x2'));var jsonpatch=require(_0x4a66('0x3'));var rp=require(_0x4a66('0x4'));var moment=require('moment');var BPromise=require(_0x4a66('0x5'));var Mustache=require(_0x4a66('0x6'));var util=require('util');var path=require(_0x4a66('0x7'));var sox=require(_0x4a66('0x8'));var csv=require(_0x4a66('0x9'));var ejs=require(_0x4a66('0xa'));var fs=require('fs');var fs_extra=require(_0x4a66('0xb'));var _=require(_0x4a66('0xc'));var squel=require(_0x4a66('0xd'));var crypto=require(_0x4a66('0xe'));var jsforce=require(_0x4a66('0xf'));var deskjs=require(_0x4a66('0x10'));var toCsv=require(_0x4a66('0x9'));var querystring=require(_0x4a66('0x11'));var Papa=require(_0x4a66('0x12'));var Redis=require(_0x4a66('0x13'));var authService=require(_0x4a66('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x4a66('0x15'));var hardwareService=require(_0x4a66('0x16'));var logger=require('../../config/logger')(_0x4a66('0x17'));var utils=require(_0x4a66('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4a66('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x588022,_0x17c44d){_0x17c44d=_0x17c44d||0xcc;return function(_0x1edff0){if(_0x1edff0){return _0x588022[_0x4a66('0x1a')](_0x17c44d);}return _0x588022[_0x4a66('0x1b')](_0x17c44d)[_0x4a66('0x1c')]();};}function respondWithResult(_0x2d1beb,_0x389ed4){_0x389ed4=_0x389ed4||0xc8;return function(_0x26b838){if(_0x26b838){return _0x2d1beb[_0x4a66('0x1b')](_0x389ed4)[_0x4a66('0x1d')](_0x26b838);}};}function respondWithFilteredResult(_0x3c71fa,_0x320802){return function(_0x1c42a6){if(_0x1c42a6){var _0x59859c=typeof _0x320802['offset']===_0x4a66('0x1e')&&typeof _0x320802['limit']===_0x4a66('0x1e');var _0x558719=_0x1c42a6['count'];var _0x3ba757=_0x59859c?0x0:_0x320802[_0x4a66('0x1f')];var _0x5ad578=_0x59859c?_0x1c42a6[_0x4a66('0x20')]:_0x320802['offset']+_0x320802[_0x4a66('0x21')];var _0x3052a4;if(_0x5ad578>=_0x558719){_0x5ad578=_0x558719;_0x3052a4=0xc8;}else{_0x3052a4=0xce;}_0x3c71fa['status'](_0x3052a4);return _0x3c71fa[_0x4a66('0x22')]('Content-Range',_0x3ba757+'-'+_0x5ad578+'/'+_0x558719)[_0x4a66('0x1d')](_0x1c42a6);}return null;};}function patchUpdates(_0x5ca19c){return function(_0x4c61f6){try{jsonpatch['apply'](_0x4c61f6,_0x5ca19c,!![]);}catch(_0x6b1d1f){return BPromise[_0x4a66('0x23')](_0x6b1d1f);}return _0x4c61f6[_0x4a66('0x24')]();};}function saveUpdates(_0x166959,_0x18242f){return function(_0x4f129c){if(_0x4f129c){return _0x4f129c[_0x4a66('0x25')](_0x166959)[_0x4a66('0x26')](function(_0x3c5635){return _0x3c5635;});}return null;};}function removeEntity(_0x42831f,_0x4aa180){return function(_0x25f1f6){if(_0x25f1f6){return _0x25f1f6[_0x4a66('0x27')]()[_0x4a66('0x26')](function(){_0x42831f[_0x4a66('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42d902,_0x53addd){return function(_0x1c30e6){if(!_0x1c30e6){_0x42d902['sendStatus'](0x194);}return _0x1c30e6;};}function handleError(_0x3a3f15,_0x5bc3ac){_0x5bc3ac=_0x5bc3ac||0x1f4;return function(_0x94e4d){logger[_0x4a66('0x28')](_0x94e4d['stack']);if(_0x94e4d[_0x4a66('0x29')]){delete _0x94e4d[_0x4a66('0x29')];}_0x3a3f15[_0x4a66('0x1b')](_0x5bc3ac)[_0x4a66('0x2a')](_0x94e4d);};}exports['index']=function(_0xf76eeb,_0x1523f9){var _0xc731f6={},_0x1fee13={},_0x2487f6={'count':0x0,'rows':[]};var _0x2d836a=_['map'](db[_0x4a66('0x2b')]['rawAttributes'],function(_0x23b58f){return{'name':_0x23b58f['fieldName'],'type':_0x23b58f[_0x4a66('0x2c')][_0x4a66('0x2d')]};});_0x1fee13['model']=_[_0x4a66('0x2e')](_0x2d836a,_0x4a66('0x29'));_0x1fee13['query']=_['keys'](_0xf76eeb[_0x4a66('0x2f')]);_0x1fee13['filters']=_[_0x4a66('0x30')](_0x1fee13[_0x4a66('0x31')],_0x1fee13[_0x4a66('0x2f')]);_0xc731f6[_0x4a66('0x32')]=_[_0x4a66('0x30')](_0x1fee13['model'],qs['fields'](_0xf76eeb[_0x4a66('0x2f')][_0x4a66('0x33')]));_0xc731f6['attributes']=_0xc731f6[_0x4a66('0x32')][_0x4a66('0x34')]?_0xc731f6[_0x4a66('0x32')]:_0x1fee13[_0x4a66('0x31')];if(!_0xf76eeb['query'][_0x4a66('0x35')](_0x4a66('0x36'))){_0xc731f6['limit']=qs[_0x4a66('0x21')](_0xf76eeb[_0x4a66('0x2f')]['limit']);_0xc731f6[_0x4a66('0x1f')]=qs[_0x4a66('0x1f')](_0xf76eeb[_0x4a66('0x2f')][_0x4a66('0x1f')]);}_0xc731f6['order']=qs[_0x4a66('0x37')](_0xf76eeb['query'][_0x4a66('0x37')]);_0xc731f6['where']=qs[_0x4a66('0x38')](_[_0x4a66('0x39')](_0xf76eeb['query'],_0x1fee13['filters']),_0x2d836a);if(_0xf76eeb[_0x4a66('0x2f')][_0x4a66('0x3a')]){_0xc731f6['where']=_[_0x4a66('0x3b')](_0xc731f6[_0x4a66('0x3c')],{'$or':_[_0x4a66('0x2e')](_0x2d836a,function(_0xc9566a){if(_0xc9566a[_0x4a66('0x2c')]!=='VIRTUAL'){var _0x4b8877={};_0x4b8877[_0xc9566a[_0x4a66('0x29')]]={'$like':'%'+_0xf76eeb[_0x4a66('0x2f')][_0x4a66('0x3a')]+'%'};return _0x4b8877;}})});}_0xc731f6=_['merge']({},_0xc731f6,_0xf76eeb[_0x4a66('0x3d')]);var _0x1f0b33={'where':_0xc731f6[_0x4a66('0x3c')]};return db[_0x4a66('0x2b')][_0x4a66('0x20')](_0x1f0b33)['then'](function(_0x357b20){_0x2487f6[_0x4a66('0x20')]=_0x357b20;if(_0xf76eeb[_0x4a66('0x2f')][_0x4a66('0x3e')]){_0xc731f6[_0x4a66('0x3f')]=[{'all':!![]}];}return db[_0x4a66('0x2b')][_0x4a66('0x40')](_0xc731f6);})[_0x4a66('0x26')](function(_0x36fb37){_0x2487f6[_0x4a66('0x41')]=_0x36fb37;return _0x2487f6;})[_0x4a66('0x26')](respondWithFilteredResult(_0x1523f9,_0xc731f6))['catch'](handleError(_0x1523f9,null));};exports[_0x4a66('0x42')]=function(_0x3d87a3,_0x248e0f){var _0x50bd8f={'raw':!![],'where':{'id':_0x3d87a3[_0x4a66('0x43')]['id']}},_0x4ff02f={};_0x4ff02f[_0x4a66('0x31')]=_['keys'](db[_0x4a66('0x2b')][_0x4a66('0x44')]);_0x4ff02f[_0x4a66('0x2f')]=_[_0x4a66('0x45')](_0x3d87a3['query']);_0x4ff02f[_0x4a66('0x38')]=_['intersection'](_0x4ff02f[_0x4a66('0x31')],_0x4ff02f[_0x4a66('0x2f')]);_0x50bd8f['attributes']=_[_0x4a66('0x30')](_0x4ff02f[_0x4a66('0x31')],qs[_0x4a66('0x33')](_0x3d87a3[_0x4a66('0x2f')][_0x4a66('0x33')]));_0x50bd8f[_0x4a66('0x32')]=_0x50bd8f['attributes'][_0x4a66('0x34')]?_0x50bd8f[_0x4a66('0x32')]:_0x4ff02f[_0x4a66('0x31')];if(_0x3d87a3[_0x4a66('0x2f')][_0x4a66('0x3e')]){_0x50bd8f[_0x4a66('0x3f')]=[{'all':!![]}];}_0x50bd8f=_['merge']({},_0x50bd8f,_0x3d87a3[_0x4a66('0x3d')]);return db[_0x4a66('0x2b')][_0x4a66('0x46')](_0x50bd8f)[_0x4a66('0x26')](handleEntityNotFound(_0x248e0f,null))[_0x4a66('0x26')](respondWithResult(_0x248e0f,null))[_0x4a66('0x47')](handleError(_0x248e0f,null));};exports['create']=function(_0x3a7b70,_0x538690){return db[_0x4a66('0x2b')][_0x4a66('0x48')](_0x3a7b70[_0x4a66('0x49')],{})['then'](respondWithResult(_0x538690,0xc9))[_0x4a66('0x47')](handleError(_0x538690,null));};exports[_0x4a66('0x25')]=function(_0x166187,_0x1d0d87){if(_0x166187[_0x4a66('0x49')]['id']){delete _0x166187[_0x4a66('0x49')]['id'];}return db[_0x4a66('0x2b')][_0x4a66('0x46')]({'where':{'id':_0x166187[_0x4a66('0x43')]['id']}})[_0x4a66('0x26')](handleEntityNotFound(_0x1d0d87,null))[_0x4a66('0x26')](saveUpdates(_0x166187[_0x4a66('0x49')],null))['then'](respondWithResult(_0x1d0d87,null))['catch'](handleError(_0x1d0d87,null));};exports['destroy']=function(_0x73296,_0x49bf9e){return db['VoiceQueuesLog']['find']({'where':{'id':_0x73296[_0x4a66('0x43')]['id']}})[_0x4a66('0x26')](handleEntityNotFound(_0x49bf9e,null))[_0x4a66('0x26')](removeEntity(_0x49bf9e,null))[_0x4a66('0x47')](handleError(_0x49bf9e,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 8f4c90c..1ab9e9e 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 _0xf491=['event','dtm','lodash','util','../../config/logger','bluebird','path','../../config/environment','./voiceQueuesLog.attributes','exports','define'];(function(_0x32cfe3,_0x2ecf7d){var _0x54c01d=function(_0x25430c){while(--_0x25430c){_0x32cfe3['push'](_0x32cfe3['shift']());}};_0x54c01d(++_0x2ecf7d);}(_0xf491,0x178));var _0x1f49=function(_0x277fcf,_0x1952c6){_0x277fcf=_0x277fcf-0x0;var _0x3dcfc6=_0xf491[_0x277fcf];return _0x3dcfc6;};'use strict';var _=require(_0x1f49('0x0'));var util=require(_0x1f49('0x1'));var logger=require(_0x1f49('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1f49('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f49('0x4'));var rimraf=require('rimraf');var config=require(_0x1f49('0x5'));var attributes=require(_0x1f49('0x6'));module[_0x1f49('0x7')]=function(_0x52d5b5,_0x4c04bb){return _0x52d5b5[_0x1f49('0x8')]('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x1f49('0x9'),_0x1f49('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0xe7e4=['path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','voice_queues_log','event','dtm','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3c5aee,_0x419da5){var _0x47c4b4=function(_0x4e9e2e){while(--_0x4e9e2e){_0x3c5aee['push'](_0x3c5aee['shift']());}};_0x47c4b4(++_0x419da5);}(_0xe7e4,0xa3));var _0x4e7e=function(_0x13bbe6,_0x128ce5){_0x13bbe6=_0x13bbe6-0x0;var _0xc0a81d=_0xe7e4[_0x13bbe6];return _0xc0a81d;};'use strict';var _=require('lodash');var util=require(_0x4e7e('0x0'));var logger=require(_0x4e7e('0x1'))('api');var moment=require(_0x4e7e('0x2'));var BPromise=require(_0x4e7e('0x3'));var rp=require(_0x4e7e('0x4'));var fs=require('fs');var path=require(_0x4e7e('0x5'));var rimraf=require(_0x4e7e('0x6'));var config=require(_0x4e7e('0x7'));var attributes=require(_0x4e7e('0x8'));module[_0x4e7e('0x9')]=function(_0x4f038a,_0x38a076){return _0x4f038a['define'](_0x4e7e('0xa'),attributes,{'tableName':_0x4e7e('0xb'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x4e7e('0xc'),_0x4e7e('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 7de6bd7..d2809c2 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 _0x0689=['request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x4a442b,_0x1ef81e){var _0x513360=function(_0x32bde9){while(--_0x32bde9){_0x4a442b['push'](_0x4a442b['shift']());}};_0x513360(++_0x1ef81e);}(_0x0689,0x10f));var _0x9068=function(_0x918313,_0x53b353){_0x918313=_0x918313-0x0;var _0x4c0f8c=_0x0689[_0x918313];return _0x4c0f8c;};'use strict';var _=require(_0x9068('0x0'));var util=require('util');var moment=require(_0x9068('0x1'));var BPromise=require('bluebird');var rs=require(_0x9068('0x2'));var fs=require('fs');var Redis=require(_0x9068('0x3'));var db=require(_0x9068('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9068('0x5'))('rpc');var config=require(_0x9068('0x6'));var jayson=require(_0x9068('0x7'));var client=jayson[_0x9068('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x554a90,_0xea1f21,_0x3a7c67){return new BPromise(function(_0x34e96b,_0x1169e6){return client[_0x9068('0x9')](_0x554a90,_0x3a7c67)[_0x9068('0xa')](function(_0x3ed4ab){logger[_0x9068('0xb')](_0x9068('0xc'),_0xea1f21,_0x9068('0xd'));logger[_0x9068('0xe')](_0x9068('0xf'),_0xea1f21,_0x9068('0xd'),JSON[_0x9068('0x10')](_0x3ed4ab));if(_0x3ed4ab[_0x9068('0x11')]){if(_0x3ed4ab[_0x9068('0x11')]['code']===0x1f4){logger[_0x9068('0x11')](_0x9068('0xc'),_0xea1f21,_0x3ed4ab[_0x9068('0x11')]['message']);return _0x1169e6(_0x3ed4ab['error'][_0x9068('0x12')]);}logger[_0x9068('0x11')](_0x9068('0xc'),_0xea1f21,_0x3ed4ab[_0x9068('0x11')][_0x9068('0x12')]);return _0x34e96b(_0x3ed4ab[_0x9068('0x11')][_0x9068('0x12')]);}else{logger[_0x9068('0xb')](_0x9068('0xc'),_0xea1f21,_0x9068('0xd'));_0x34e96b(_0x3ed4ab['result'][_0x9068('0x12')]);}})[_0x9068('0x13')](function(_0x3f02bb){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0xea1f21,_0x3f02bb);_0x1169e6(_0x3f02bb);});});} \ No newline at end of file +var _0x44f8=['util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceQueuesLog,\x20%s,\x20%s','catch','lodash'];(function(_0x1320fe,_0x5dae3a){var _0xe9340a=function(_0x465a8d){while(--_0x465a8d){_0x1320fe['push'](_0x1320fe['shift']());}};_0xe9340a(++_0x5dae3a);}(_0x44f8,0xfb));var _0x844f=function(_0x22e2c7,_0x202cac){_0x22e2c7=_0x22e2c7-0x0;var _0x350b99=_0x44f8[_0x22e2c7];return _0x350b99;};'use strict';var _=require(_0x844f('0x0'));var util=require(_0x844f('0x1'));var moment=require(_0x844f('0x2'));var BPromise=require('bluebird');var rs=require(_0x844f('0x3'));var fs=require('fs');var Redis=require(_0x844f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x844f('0x5'))(_0x844f('0x6'));var config=require(_0x844f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x844f('0x8')][_0x844f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fc3be,_0x3e5ece,_0x3bc2d4){return new BPromise(function(_0xca8bd6,_0x36ff38){return client[_0x844f('0xa')](_0x2fc3be,_0x3bc2d4)['then'](function(_0xe1201d){logger[_0x844f('0xb')]('VoiceQueuesLog,\x20%s,\x20%s',_0x3e5ece,_0x844f('0xc'));logger[_0x844f('0xd')](_0x844f('0xe'),_0x3e5ece,_0x844f('0xc'),JSON[_0x844f('0xf')](_0xe1201d));if(_0xe1201d[_0x844f('0x10')]){if(_0xe1201d[_0x844f('0x10')][_0x844f('0x11')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x3e5ece,_0xe1201d[_0x844f('0x10')]['message']);return _0x36ff38(_0xe1201d[_0x844f('0x10')][_0x844f('0x12')]);}logger[_0x844f('0x10')](_0x844f('0x13'),_0x3e5ece,_0xe1201d[_0x844f('0x10')][_0x844f('0x12')]);return _0xca8bd6(_0xe1201d[_0x844f('0x10')][_0x844f('0x12')]);}else{logger[_0x844f('0xb')](_0x844f('0x13'),_0x3e5ece,'request\x20sent');_0xca8bd6(_0xe1201d['result'][_0x844f('0x12')]);}})[_0x844f('0x14')](function(_0x41f991){logger[_0x844f('0x10')](_0x844f('0x13'),_0x3e5ece,_0x41f991);_0x36ff38(_0x41f991);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 95c9ebc..96bcba3 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 _0x26ef=['runTranscribe','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','get','/describe','/:id','/:id/download','download','/:id/downloads','downloadTranscribe','post','create'];(function(_0x1da22a,_0x1d378e){var _0x44aa30=function(_0x47c454){while(--_0x47c454){_0x1da22a['push'](_0x1da22a['shift']());}};_0x44aa30(++_0x1d378e);}(_0x26ef,0xe7));var _0xf26e=function(_0x566036,_0x519710){_0x566036=_0x566036-0x0;var _0x216d49=_0x26ef[_0x566036];return _0x216d49;};'use strict';var multer=require('multer');var util=require(_0xf26e('0x0'));var path=require(_0xf26e('0x1'));var timeout=require(_0xf26e('0x2'));var express=require(_0xf26e('0x3'));var router=express['Router']();var fs_extra=require(_0xf26e('0x4'));var auth=require(_0xf26e('0x5'));var interaction=require(_0xf26e('0x6'));var config=require(_0xf26e('0x7'));var controller=require(_0xf26e('0x8'));router['get']('/',auth[_0xf26e('0x9')](),controller['index']);router[_0xf26e('0xa')](_0xf26e('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xf26e('0xc'),auth[_0xf26e('0x9')](),controller['show']);router['get'](_0xf26e('0xd'),auth[_0xf26e('0x9')](),controller[_0xf26e('0xe')]);router[_0xf26e('0xa')](_0xf26e('0xf'),controller['downloads']);router['get']('/:id/transcribe',auth[_0xf26e('0x9')](),controller[_0xf26e('0x10')]);router[_0xf26e('0x11')]('/',auth[_0xf26e('0x9')](),controller[_0xf26e('0x12')]);router[_0xf26e('0x11')]('/:id/transcribe',auth[_0xf26e('0x9')](),controller[_0xf26e('0x13')]);router[_0xf26e('0x14')](_0xf26e('0xc'),auth[_0xf26e('0x9')](),controller[_0xf26e('0x15')]);router[_0xf26e('0x16')](_0xf26e('0xc'),auth['isAuthenticated'](),controller[_0xf26e('0x17')]);module[_0xf26e('0x18')]=router; \ No newline at end of file +var _0x690c=['download','/:id/downloads','/:id/transcribe','downloadTranscribe','create','post','runTranscribe','update','delete','destroy','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','/:id/download'];(function(_0x3845c6,_0x199090){var _0x2ace58=function(_0x42b108){while(--_0x42b108){_0x3845c6['push'](_0x3845c6['shift']());}};_0x2ace58(++_0x199090);}(_0x690c,0xba));var _0xc690=function(_0x3b9607,_0x1806da){_0x3b9607=_0x3b9607-0x0;var _0x3d530f=_0x690c[_0x3b9607];return _0x3d530f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xc690('0x0'));var express=require('express');var router=express[_0xc690('0x1')]();var fs_extra=require(_0xc690('0x2'));var auth=require(_0xc690('0x3'));var interaction=require(_0xc690('0x4'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router[_0xc690('0x5')]('/',auth[_0xc690('0x6')](),controller[_0xc690('0x7')]);router[_0xc690('0x5')]('/describe',auth[_0xc690('0x6')](),controller[_0xc690('0x8')]);router[_0xc690('0x5')](_0xc690('0x9'),auth['isAuthenticated'](),controller[_0xc690('0xa')]);router[_0xc690('0x5')](_0xc690('0xb'),auth[_0xc690('0x6')](),controller[_0xc690('0xc')]);router[_0xc690('0x5')](_0xc690('0xd'),controller['downloads']);router[_0xc690('0x5')](_0xc690('0xe'),auth[_0xc690('0x6')](),controller[_0xc690('0xf')]);router['post']('/',auth[_0xc690('0x6')](),controller[_0xc690('0x10')]);router[_0xc690('0x11')](_0xc690('0xe'),auth[_0xc690('0x6')](),controller[_0xc690('0x12')]);router['put'](_0xc690('0x9'),auth[_0xc690('0x6')](),controller[_0xc690('0x13')]);router[_0xc690('0x14')](_0xc690('0x9'),auth['isAuthenticated'](),controller[_0xc690('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index d296ae4..e17c826 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(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 924f39e..0d4d0c6 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 _0x6c3c=['TranscriptionJobStatus','runTranscribe','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribe','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','catch','params','includeAll','find','create','body','update','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','downloads','MD5','col','$and','push','decryptFile','extname','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','basename','readFileSync','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus'];(function(_0x5be9b4,_0x1b8b7d){var _0x41db1d=function(_0xd42c40){while(--_0xd42c40){_0x5be9b4['push'](_0x5be9b4['shift']());}};_0x41db1d(++_0x1b8b7d);}(_0x6c3c,0xba));var _0xc6c3=function(_0x5b7712,_0x346914){_0x5b7712=_0x5b7712-0x0;var _0x4fa082=_0x6c3c[_0x5b7712];return _0x4fa082;};'use strict';var emlformat=require(_0xc6c3('0x0'));var rimraf=require(_0xc6c3('0x1'));var zipdir=require(_0xc6c3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc6c3('0x3'));var moment=require(_0xc6c3('0x4'));var BPromise=require(_0xc6c3('0x5'));var Mustache=require(_0xc6c3('0x6'));var util=require('util');var path=require(_0xc6c3('0x7'));var sox=require(_0xc6c3('0x8'));var csv=require('to-csv');var ejs=require(_0xc6c3('0x9'));var fs=require('fs');var fs_extra=require(_0xc6c3('0xa'));var _=require(_0xc6c3('0xb'));var squel=require(_0xc6c3('0xc'));var crypto=require(_0xc6c3('0xd'));var jsforce=require(_0xc6c3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc6c3('0xf'));var querystring=require(_0xc6c3('0x10'));var Papa=require(_0xc6c3('0x11'));var AWS=require('aws-sdk');var uuidv4=require(_0xc6c3('0x12'));var Redis=require(_0xc6c3('0x13'));var authService=require(_0xc6c3('0x14'));var qs=require(_0xc6c3('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc6c3('0x16'));var logger=require(_0xc6c3('0x17'))(_0xc6c3('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc6c3('0x19'));var db=require(_0xc6c3('0x1a'))['db'];function respondWithStatusCode(_0x4e369f,_0x41d77c){_0x41d77c=_0x41d77c||0xcc;return function(_0x52661d){if(_0x52661d){return _0x4e369f[_0xc6c3('0x1b')](_0x41d77c);}return _0x4e369f[_0xc6c3('0x1c')](_0x41d77c)[_0xc6c3('0x1d')]();};}function respondWithResult(_0x4ee6ad,_0x178b06){_0x178b06=_0x178b06||0xc8;return function(_0x442314){if(_0x442314){return _0x4ee6ad[_0xc6c3('0x1c')](_0x178b06)[_0xc6c3('0x1e')](_0x442314);}};}function respondWithFilteredResult(_0x57cbf9,_0x4f1eff){return function(_0x2a95f4){if(_0x2a95f4){var _0x39b6de=typeof _0x4f1eff[_0xc6c3('0x1f')]===_0xc6c3('0x20')&&typeof _0x4f1eff[_0xc6c3('0x21')]===_0xc6c3('0x20');var _0x22c081=_0x2a95f4['count'];var _0x160931=_0x39b6de?0x0:_0x4f1eff[_0xc6c3('0x1f')];var _0x2dc386=_0x39b6de?_0x2a95f4[_0xc6c3('0x22')]:_0x4f1eff[_0xc6c3('0x1f')]+_0x4f1eff['limit'];var _0x22fa9e;if(_0x2dc386>=_0x22c081){_0x2dc386=_0x22c081;_0x22fa9e=0xc8;}else{_0x22fa9e=0xce;}_0x57cbf9[_0xc6c3('0x1c')](_0x22fa9e);return _0x57cbf9[_0xc6c3('0x23')](_0xc6c3('0x24'),_0x160931+'-'+_0x2dc386+'/'+_0x22c081)['json'](_0x2a95f4);}return null;};}function patchUpdates(_0x334152){return function(_0x5c7f85){try{jsonpatch['apply'](_0x5c7f85,_0x334152,!![]);}catch(_0x3cc332){return BPromise[_0xc6c3('0x25')](_0x3cc332);}return _0x5c7f85[_0xc6c3('0x26')]();};}function saveUpdates(_0x752e90,_0x2aa9ff){return function(_0x47ba18){if(_0x47ba18){return _0x47ba18['update'](_0x752e90)[_0xc6c3('0x27')](function(_0x2413c7){return _0x2413c7;});}return null;};}function removeEntity(_0x41825e,_0x191892){return function(_0x3673d0){if(_0x3673d0){return _0x3673d0[_0xc6c3('0x28')]()[_0xc6c3('0x27')](function(){_0x41825e['status'](0xcc)[_0xc6c3('0x1d')]();});}};}function handleEntityNotFound(_0x45f83d,_0x141a7c){return function(_0x36ddd8){if(!_0x36ddd8){_0x45f83d[_0xc6c3('0x1b')](0x194);}return _0x36ddd8;};}function handleError(_0x52644f,_0x2f6ebd){_0x2f6ebd=_0x2f6ebd||0x1f4;return function(_0x320f31){logger[_0xc6c3('0x29')](_0x320f31[_0xc6c3('0x2a')]);if(_0x320f31[_0xc6c3('0x2b')]){delete _0x320f31[_0xc6c3('0x2b')];}_0x52644f[_0xc6c3('0x1c')](_0x2f6ebd)[_0xc6c3('0x2c')](_0x320f31);};}exports['index']=function(_0x422add,_0x5729b8){var _0x33a6df={},_0x13a716={},_0x1cd112={'count':0x0,'rows':[]};var _0x3b7c01=_[_0xc6c3('0x2d')](db[_0xc6c3('0x2e')][_0xc6c3('0x2f')],function(_0x3d86ef){return{'name':_0x3d86ef[_0xc6c3('0x30')],'type':_0x3d86ef[_0xc6c3('0x31')][_0xc6c3('0x32')]};});_0x13a716[_0xc6c3('0x33')]=_[_0xc6c3('0x34')](_['map'](_0x3b7c01,_0xc6c3('0x2b')),['format']);_0x13a716[_0xc6c3('0x35')]=_[_0xc6c3('0x36')](_0x422add[_0xc6c3('0x35')]);_0x13a716['filters']=_['intersection'](_0x13a716['model'],_0x13a716[_0xc6c3('0x35')]);_0x33a6df[_0xc6c3('0x37')]=_[_0xc6c3('0x38')](_0x13a716['model'],qs[_0xc6c3('0x39')](_0x422add[_0xc6c3('0x35')][_0xc6c3('0x39')]));_0x33a6df[_0xc6c3('0x37')]=_0x33a6df[_0xc6c3('0x37')][_0xc6c3('0x3a')]?_0x33a6df['attributes']:_0x13a716[_0xc6c3('0x33')];if(!_0x422add[_0xc6c3('0x35')][_0xc6c3('0x3b')]('nolimit')){_0x33a6df[_0xc6c3('0x21')]=qs[_0xc6c3('0x21')](_0x422add[_0xc6c3('0x35')][_0xc6c3('0x21')]);_0x33a6df[_0xc6c3('0x1f')]=qs[_0xc6c3('0x1f')](_0x422add['query'][_0xc6c3('0x1f')]);}_0x33a6df['order']=qs[_0xc6c3('0x3c')](_0x422add['query'][_0xc6c3('0x3c')]);_0x33a6df[_0xc6c3('0x3d')]=qs[_0xc6c3('0x3e')](_['pick'](_0x422add[_0xc6c3('0x35')],_0x13a716[_0xc6c3('0x3e')]),_0x3b7c01);if(_0x422add[_0xc6c3('0x35')][_0xc6c3('0x3f')]){_0x33a6df[_0xc6c3('0x3d')]=_[_0xc6c3('0x40')](_0x33a6df[_0xc6c3('0x3d')],{'$or':_[_0xc6c3('0x2d')](_0x3b7c01,function(_0x308023){if(_0x308023[_0xc6c3('0x31')]!==_0xc6c3('0x41')){var _0x272eee={};_0x272eee[_0x308023['name']]={'$like':'%'+_0x422add[_0xc6c3('0x35')][_0xc6c3('0x3f')]+'%'};return _0x272eee;}})});}_0x33a6df=_[_0xc6c3('0x40')]({},_0x33a6df,_0x422add[_0xc6c3('0x42')]);var _0x36be0c={'where':_0x33a6df['where']};return db[_0xc6c3('0x2e')][_0xc6c3('0x22')](_0x36be0c)[_0xc6c3('0x27')](function(_0x274fe9){_0x1cd112[_0xc6c3('0x22')]=_0x274fe9;if(_0x422add[_0xc6c3('0x35')]['includeAll']){_0x33a6df[_0xc6c3('0x43')]=[{'all':!![]}];}return db[_0xc6c3('0x2e')][_0xc6c3('0x44')](_0x33a6df);})[_0xc6c3('0x27')](function(_0x408345){_0x1cd112['rows']=_0x408345;return _0x1cd112;})[_0xc6c3('0x27')](respondWithFilteredResult(_0x5729b8,_0x33a6df))[_0xc6c3('0x45')](handleError(_0x5729b8,null));};exports['show']=function(_0x58c43a,_0x137d0f){var _0x468bc5={'raw':![],'where':{'id':_0x58c43a[_0xc6c3('0x46')]['id']}},_0x46be72={};_0x46be72['model']=_[_0xc6c3('0x36')](db[_0xc6c3('0x2e')][_0xc6c3('0x2f')]);_0x46be72['query']=_[_0xc6c3('0x36')](_0x58c43a[_0xc6c3('0x35')]);_0x46be72['filters']=_[_0xc6c3('0x38')](_0x46be72[_0xc6c3('0x33')],_0x46be72['query']);_0x468bc5[_0xc6c3('0x37')]=_['intersection'](_0x46be72['model'],qs[_0xc6c3('0x39')](_0x58c43a[_0xc6c3('0x35')][_0xc6c3('0x39')]));_0x468bc5['attributes']=_0x468bc5[_0xc6c3('0x37')][_0xc6c3('0x3a')]?_0x468bc5['attributes']:_0x46be72['model'];if(_0x58c43a[_0xc6c3('0x35')][_0xc6c3('0x47')]){_0x468bc5['include']=[{'all':!![]}];}_0x468bc5=_['merge']({},_0x468bc5,_0x58c43a[_0xc6c3('0x42')]);return db['VoiceRecording'][_0xc6c3('0x48')](_0x468bc5)[_0xc6c3('0x27')](handleEntityNotFound(_0x137d0f,null))[_0xc6c3('0x27')](respondWithResult(_0x137d0f,null))[_0xc6c3('0x45')](handleError(_0x137d0f,null));};exports[_0xc6c3('0x49')]=function(_0x2309c6,_0x5cd7b9){return db[_0xc6c3('0x2e')][_0xc6c3('0x49')](_0x2309c6[_0xc6c3('0x4a')],{})[_0xc6c3('0x27')](respondWithResult(_0x5cd7b9,0xc9))[_0xc6c3('0x45')](handleError(_0x5cd7b9,null));};exports[_0xc6c3('0x4b')]=function(_0x206b99,_0x31fe5f){if(_0x206b99[_0xc6c3('0x4a')]['id']){delete _0x206b99['body']['id'];}return db[_0xc6c3('0x2e')][_0xc6c3('0x48')]({'where':{'id':_0x206b99['params']['id']}})[_0xc6c3('0x27')](handleEntityNotFound(_0x31fe5f,null))['then'](saveUpdates(_0x206b99[_0xc6c3('0x4a')],null))[_0xc6c3('0x27')](respondWithResult(_0x31fe5f,null))[_0xc6c3('0x45')](handleError(_0x31fe5f,null));};exports[_0xc6c3('0x4c')]=function(_0x2db7fb,_0x559b18){return db[_0xc6c3('0x2e')][_0xc6c3('0x4c')]()[_0xc6c3('0x27')](respondWithResult(_0x559b18,null))[_0xc6c3('0x45')](handleError(_0x559b18,null));};exports[_0xc6c3('0x4d')]=function(_0x553745,_0x5ef979,_0x37b20c){var _0x4b44f9=require(_0xc6c3('0x4e'));var _0x20e7bb=![];var _0x1b766a={};if(_0x553745['query'][_0xc6c3('0x31')]&&_0x553745[_0xc6c3('0x35')]['type']===_0xc6c3('0x4f')){_0x1b766a[_0xc6c3('0x4f')]=_0x553745[_0xc6c3('0x46')]['id'];}else{_0x1b766a['id']=_0x553745[_0xc6c3('0x46')]['id'];}return db[_0xc6c3('0x2e')][_0xc6c3('0x48')]({'where':_0x1b766a,'attributes':['id',_0xc6c3('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x5ef979,null))['then'](function(_0x34bab5){if(_0x34bab5){var _0x55e69e=_0x34bab5[_0xc6c3('0x50')];var _0x376860=util[_0xc6c3('0x51')](_0xc6c3('0x52'),_0x55e69e);if(fs[_0xc6c3('0x53')](_0x376860)){_0x20e7bb=!![];return _0x4b44f9['decryptFile'](_0x376860,_0x55e69e,config[_0xc6c3('0x54')][_0xc6c3('0x55')])[_0xc6c3('0x27')](function(){return _0x34bab5;});}return _0x34bab5;}})[_0xc6c3('0x27')](function(_0x18f934){if(_0x18f934){var _0x413c14=_0x18f934[_0xc6c3('0x50')];if(!fs[_0xc6c3('0x53')](_0x413c14)){throw new db[(_0xc6c3('0x56'))][(_0xc6c3('0x57'))](_0xc6c3('0x58'));}if(_0x18f934['filename']){return _0x5ef979[_0xc6c3('0x4d')](_0x413c14,_0x18f934[_0xc6c3('0x59')]+path['extname'](_0x413c14),function(){if(_0x20e7bb){fs[_0xc6c3('0x5a')](_0x413c14);}});}else{return _0x5ef979[_0xc6c3('0x4d')](_0x413c14,function(_0x2e7596){if(_0x20e7bb){fs[_0xc6c3('0x5a')](_0x413c14);}});}}})[_0xc6c3('0x45')](function(_0x5d1dc6){if(_0x5d1dc6[_0xc6c3('0x5b')]==='VoiceRecording\x20not\x20found'){_0x5ef979[_0xc6c3('0x1c')](0x194)[_0xc6c3('0x2c')](_0xc6c3('0x5c'));}else{return handleError(_0x5ef979,null);}});};exports[_0xc6c3('0x5d')]=function(_0x6f9f26,_0x712e3d,_0x280695){var _0x5a1439=require(_0xc6c3('0x4e'));var _0x5194dc=![];var _0x4d602a={'$and':[db['sequelize'][_0xc6c3('0x3d')](db['sequelize']['fn'](_0xc6c3('0x5e'),db['sequelize'][_0xc6c3('0x5f')](_0xc6c3('0x4f'))),_0x6f9f26['query']['token'])]};if(_0x6f9f26['query'][_0xc6c3('0x31')]&&_0x6f9f26[_0xc6c3('0x35')]['type']==='uniqueid'){_0x4d602a[_0xc6c3('0x60')]['push']({'uniqueid':_0x6f9f26['params']['id']});}else{_0x4d602a[_0xc6c3('0x60')][_0xc6c3('0x61')]({'id':_0x6f9f26[_0xc6c3('0x46')]['id']});}return db[_0xc6c3('0x2e')]['find']({'where':_0x4d602a,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x712e3d,null))[_0xc6c3('0x27')](function(_0x6ec71d){if(_0x6ec71d){var _0x4db10b=util[_0xc6c3('0x51')](_0xc6c3('0x52'),_0x6ec71d[_0xc6c3('0x50')]);if(fs[_0xc6c3('0x53')](_0x4db10b)){_0x5194dc=!![];return _0x5a1439[_0xc6c3('0x62')](_0x4db10b,_0x6ec71d['value'],config[_0xc6c3('0x54')]['recording'])[_0xc6c3('0x27')](function(){return _0x6ec71d;});}return _0x6ec71d;}})[_0xc6c3('0x27')](function(_0x268ac4){if(_0x268ac4){if(!fs['existsSync'](_0x268ac4[_0xc6c3('0x50')])){throw new db[(_0xc6c3('0x56'))][(_0xc6c3('0x57'))](_0xc6c3('0x58'));}if(_0x268ac4[_0xc6c3('0x59')]){return _0x712e3d[_0xc6c3('0x4d')](_0x268ac4[_0xc6c3('0x50')],_0x268ac4['filename']+path[_0xc6c3('0x63')](_0x268ac4[_0xc6c3('0x50')]),function(){if(_0x5194dc){fs[_0xc6c3('0x5a')](_0x268ac4[_0xc6c3('0x50')]);}});}else{return _0x712e3d[_0xc6c3('0x4d')](_0x268ac4[_0xc6c3('0x50')],function(_0x1d853a){if(_0x5194dc){fs['unlink'](_0x268ac4[_0xc6c3('0x50')]);}});}}})[_0xc6c3('0x45')](handleError(_0x712e3d,null));};exports[_0xc6c3('0x28')]=function(_0x3e1c20,_0x53c31c){return db[_0xc6c3('0x2e')]['find']({'where':{'id':_0x3e1c20['params']['id']}})['then'](function(_0xea72d){if(_[_0xc6c3('0x64')](_0xea72d)){throw new ReferenceError(_0xc6c3('0x65'));}return _0xea72d;})[_0xc6c3('0x27')](function(_0x3116a8){var _0x37455d=_0x3116a8[_0xc6c3('0x50')];logger[_0xc6c3('0x66')](_0xc6c3('0x67'),_0x37455d);if(!_[_0xc6c3('0x64')](_0x3116a8[_0xc6c3('0x50')])&&fs[_0xc6c3('0x53')](_0x37455d)){logger['info'](_0xc6c3('0x68')+_0x37455d+_0xc6c3('0x69'));fs[_0xc6c3('0x6a')](_0x37455d);}_0x37455d=_0x37455d+_0xc6c3('0x6b');if(!_[_0xc6c3('0x64')](_0x3116a8['value'])&&fs[_0xc6c3('0x53')](_0x37455d)){logger['info']('File:\x20\x22'+_0x37455d+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xc6c3('0x6a')](_0x37455d);}return _0x3116a8;})[_0xc6c3('0x27')](function(_0x55e286){if(!_0x55e286)throw new InternalError();return _0x55e286[_0xc6c3('0x28')]();})[_0xc6c3('0x27')](function(){_0x53c31c[_0xc6c3('0x1c')](0xcc)['end']();})[_0xc6c3('0x45')](handleError(_0x53c31c,null));};function getBucketslist(_0x6a609,_0x565224,_0x15b41d){return new Promise(function(_0x6dd1e0,_0x3ff93e){var _0x4a6363=new AWS['S3']({'accessKeyId':_0x565224,'secretAccessKey':_0x6a609,'region':_0x15b41d});_0x4a6363[_0xc6c3('0x6c')]({},function(_0x3a5683,_0x17b11d){if(_0x3a5683){return _0x3ff93e(_0x3a5683);}else{return _0x6dd1e0(_0x17b11d);}});});}function createBucket(_0x19d532,_0x45b347,_0x2403d8,_0x15afc8){return new Promise(function(_0x2e1a1c,_0x1ece09){var _0x2f02eb=new AWS['S3']({'accessKeyId':_0x45b347,'secretAccessKey':_0x19d532,'region':_0x2403d8});_0x2f02eb[_0xc6c3('0x6d')]({'Bucket':_0x15afc8},function(_0xf3da7b,_0x284c9a){if(_0xf3da7b){return _0x1ece09(_0xf3da7b);}else{return _0x2e1a1c(_0x284c9a);}});});}function uploadFile(_0x2f3c45,_0x591873,_0x19f986,_0xdd598a,_0x13b024,_0x24e7cb){return new Promise(function(_0x37c63e,_0x1f20e2){var _0x55a551=new AWS['S3']({'accessKeyId':_0x591873,'secretAccessKey':_0x2f3c45,'region':_0x19f986});_0x55a551[_0xc6c3('0x6e')]({'Bucket':_0xdd598a,'Key':_0x13b024,'Body':_0x24e7cb},function(_0x428a61,_0x2b19ce){if(_0x428a61){return _0x1f20e2(_0x428a61);}else{return _0x37c63e(_0x2b19ce);}});});}function startTranscribe(_0xa0adca,_0xcd246c,_0x5617f8,_0x12b058,_0x50811f,_0x4b6606){return new Promise(function(_0x3d7dfc,_0x3717c0){var _0x3e5e97=new AWS[(_0xc6c3('0x6f'))]({'accessKeyId':_0xcd246c,'secretAccessKey':_0xa0adca,'region':_0x5617f8});_0x3e5e97[_0xc6c3('0x70')]({'TranscriptionJobName':_0x12b058,'LanguageCode':_0x50811f,'Media':{'MediaFileUri':_0x4b6606}},function(_0x32e7a5,_0x3040b5){if(_0x32e7a5){return _0x3717c0(_0x32e7a5);}else{return _0x3d7dfc(_0x3040b5);}});});}function transcribe(_0xfcf1c4,_0x2e3719,_0x2ca116,_0x52b1ec,_0x13f5cb,_0xce4299,_0x2a6ffd){return new Promise(function(_0x42a28f,_0x506b5b){var _0x4fec89={};logger['info'](util[_0xc6c3('0x51')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0xfcf1c4,_0x13f5cb));return uploadFile(_0x2e3719,_0x2ca116,_0x52b1ec,_0x13f5cb,path[_0xc6c3('0x71')](_0xce4299),fs[_0xc6c3('0x72')](_0xce4299))['then'](function(_0x212a2e){logger[_0xc6c3('0x66')](util[_0xc6c3('0x51')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0xfcf1c4,_0x13f5cb,_0x212a2e[_0xc6c3('0x73')]));_0x4fec89[_0xc6c3('0x74')]=_0x212a2e[_0xc6c3('0x75')];_0x4fec89[_0xc6c3('0x76')]=_0x212a2e[_0xc6c3('0x73')];logger[_0xc6c3('0x66')](util[_0xc6c3('0x51')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0xfcf1c4));return startTranscribe(_0x2e3719,_0x2ca116,_0x52b1ec,uuidv4(),_0x2a6ffd,_0x212a2e[_0xc6c3('0x73')]);})['then'](function(_0x5b1029){logger['info'](util[_0xc6c3('0x51')](_0xc6c3('0x77'),_0xfcf1c4,_0x5b1029[_0xc6c3('0x78')][_0xc6c3('0x79')]));_0x4fec89[_0xc6c3('0x7a')]=_0x5b1029[_0xc6c3('0x78')][_0xc6c3('0x79')];_0x4fec89[_0xc6c3('0x7b')]=_0x5b1029['TranscriptionJob'][_0xc6c3('0x7c')];return _0x42a28f(_0x4fec89);})[_0xc6c3('0x45')](function(_0x540c51){return _0x506b5b(_0x540c51);});});}exports[_0xc6c3('0x7d')]=function(_0x4e31d5,_0x193f9c,_0xc02b0c){var _0x12c50f;var _0x344d67;var _0x3d76b1;var _0x3c988c=require(_0xc6c3('0x4e'));return db[_0xc6c3('0x2e')]['findOne']({'where':{'id':_0x4e31d5[_0xc6c3('0x46')]['id']}})['then'](function(_0x374d8a){if(_0x374d8a){var _0x26f366=util[_0xc6c3('0x51')](_0xc6c3('0x52'),_0x374d8a[_0xc6c3('0x50')]);if(fs[_0xc6c3('0x53')](_0x26f366)){cypher=!![];return _0x3c988c[_0xc6c3('0x62')](_0x26f366,_0x374d8a[_0xc6c3('0x50')],config['secrets'][_0xc6c3('0x55')])[_0xc6c3('0x27')](function(){return _0x374d8a;});}return _0x374d8a;}})['then'](function(_0x5db283){if(!_0x5db283){throw new db['Sequelize'][(_0xc6c3('0x57'))](_0xc6c3('0x7e'));}_0x344d67=_0x5db283;return db[_0xc6c3('0x7f')][_0xc6c3('0x80')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x193f9c,null))['then'](function(_0x1ad9ff){if(_0x1ad9ff){_0x12c50f=_0x1ad9ff;if(!_0x12c50f[_0xc6c3('0x81')]||!_0x12c50f['transcribeAccountId']||!_0x12c50f[_0xc6c3('0x82')]||!_0x12c50f[_0xc6c3('0x83')]||!_0x12c50f['bucket']){throw new db[(_0xc6c3('0x56'))][(_0xc6c3('0x57'))](_0xc6c3('0x84'));}if(_0x4e31d5[_0xc6c3('0x4a')][_0xc6c3('0x85')]&&(!_0x12c50f[_0xc6c3('0x86')]||!_0x12c50f['sentimentAccountId']||!_0x12c50f[_0xc6c3('0x87')]||!_0x12c50f[_0xc6c3('0x83')]||!_0x12c50f[_0xc6c3('0x74')])){throw new db[(_0xc6c3('0x56'))][(_0xc6c3('0x57'))](_0xc6c3('0x88'));}return db[_0xc6c3('0x89')][_0xc6c3('0x80')]({'where':{'id':_0x12c50f['transcribeAccountId']}});}})[_0xc6c3('0x27')](function(_0x4d23bb){if(!_0x4d23bb){throw new db['Sequelize'][(_0xc6c3('0x57'))](_0xc6c3('0x8a'));}if(!_0x4d23bb[_0xc6c3('0x8b')]||!_0x4d23bb['data2']){throw new db[(_0xc6c3('0x56'))][(_0xc6c3('0x57'))](_0xc6c3('0x8c'));}_0x3d76b1=_0x4d23bb;return getBucketslist(_0x3d76b1[_0xc6c3('0x8b')],_0x3d76b1[_0xc6c3('0x8d')],_0x12c50f[_0xc6c3('0x82')]);})[_0xc6c3('0x27')](function(_0x2c2c5f){if(_0x2c2c5f&&_0x2c2c5f[_0xc6c3('0x8e')]){var _0x58ba25=_[_0xc6c3('0x48')](_0x2c2c5f[_0xc6c3('0x8e')],function(_0x1249e0){return _0x1249e0[_0xc6c3('0x8f')]===_0x12c50f[_0xc6c3('0x74')];});if(!_0x58ba25){logger[_0xc6c3('0x66')](util[_0xc6c3('0x51')](_0xc6c3('0x90'),_0x4e31d5[_0xc6c3('0x46')]['id'],_0x12c50f['bucket']));return createBucket(_0x3d76b1[_0xc6c3('0x8b')],_0x3d76b1[_0xc6c3('0x8d')],_0x12c50f[_0xc6c3('0x82')],_0x12c50f['bucket']);}logger[_0xc6c3('0x66')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x4e31d5[_0xc6c3('0x46')]['id'],_0x12c50f['bucket']));return;}})[_0xc6c3('0x27')](function(_0x507869){if(_0x344d67[_0xc6c3('0x7b')]===_0xc6c3('0x91')){return transcribe(_0x4e31d5['params']['id'],_0x3d76b1[_0xc6c3('0x8b')],_0x3d76b1[_0xc6c3('0x8d')],_0x12c50f[_0xc6c3('0x82')],_0x12c50f['bucket'],_0x344d67[_0xc6c3('0x50')],_0x12c50f[_0xc6c3('0x83')]);}else{logger[_0xc6c3('0x66')](util[_0xc6c3('0x51')](_0xc6c3('0x92'),_0x4e31d5[_0xc6c3('0x46')]['id']));return{'transcribeStatus':_0xc6c3('0x93')};}})[_0xc6c3('0x27')](function(_0x37ebd8){if(_0x37ebd8){_0x37ebd8['tempSentiment']=_0x4e31d5[_0xc6c3('0x4a')][_0xc6c3('0x85')];return _0x344d67[_0xc6c3('0x94')](_0x37ebd8);}})['then'](respondWithResult(_0x193f9c,null))[_0xc6c3('0x45')](handleError(_0x193f9c,null));};function writeFile(_0x4ed7dd,_0x585009){return new Promise(function(_0x3b92c2,_0x51fb69){fs[_0xc6c3('0x95')](_0x585009,_0x4ed7dd,function(_0x1754a0,_0x2a9514){if(_0x1754a0){return _0x51fb69(_0x1754a0);}else{return _0x3b92c2(_0x2a9514);}});});}exports[_0xc6c3('0x96')]=function(_0x3dcbf1,_0x419622,_0x18d1fc){return db[_0xc6c3('0x2e')][_0xc6c3('0x80')]({'where':{'id':_0x3dcbf1[_0xc6c3('0x46')]['id']}})[_0xc6c3('0x27')](handleEntityNotFound(_0x419622))[_0xc6c3('0x27')](function(_0x2838fb){if(_0x2838fb&&_0x2838fb[_0xc6c3('0x97')]){var _0x4ca827=_0x2838fb[_0xc6c3('0x97')];var _0x32dd28=config['root']+_0xc6c3('0x98')+_0x2838fb['id']+_0xc6c3('0x99');if(fs['existsSync'](_0x32dd28)){return _0x32dd28;}return writeFile(_0x4ca827,_0x32dd28)['then'](function(){return _0x32dd28;});}else{throw new db[(_0xc6c3('0x56'))][(_0xc6c3('0x57'))](_0xc6c3('0x9a'));}})[_0xc6c3('0x27')](function(_0x365c5b){return _0x419622['download'](_0x365c5b);})[_0xc6c3('0x45')](handleError(_0x419622));}; \ No newline at end of file +var _0xab38=['end','listBuckets','createBucket','startTranscriptionJob','basename','readFileSync','Location','bucket','Bucket','location','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','Voice\x20Recording\x20not\x20found','findOne','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data2','Cloud\x20Provider\x20not\x20configured','data1','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','writeFile','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','VoiceRecording','catch','show','params','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','secrets','Sequelize','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','downloads','sequelize','MD5','token','$and','push','decryptFile','recording','ValidationError','extname','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xab38,0x14b));var _0x8ab3=function(_0x1dbf16,_0x9f799d){_0x1dbf16=_0x1dbf16-0x0;var _0x34307d=_0xab38[_0x1dbf16];return _0x34307d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ab3('0x0'));var zipdir=require(_0x8ab3('0x1'));var jsonpatch=require(_0x8ab3('0x2'));var rp=require(_0x8ab3('0x3'));var moment=require(_0x8ab3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8ab3('0x5'));var path=require(_0x8ab3('0x6'));var sox=require(_0x8ab3('0x7'));var csv=require(_0x8ab3('0x8'));var ejs=require(_0x8ab3('0x9'));var fs=require('fs');var fs_extra=require(_0x8ab3('0xa'));var _=require('lodash');var squel=require(_0x8ab3('0xb'));var crypto=require('crypto');var jsforce=require(_0x8ab3('0xc'));var deskjs=require(_0x8ab3('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8ab3('0xe'));var Papa=require(_0x8ab3('0xf'));var AWS=require(_0x8ab3('0x10'));var uuidv4=require(_0x8ab3('0x11'));var Redis=require(_0x8ab3('0x12'));var authService=require(_0x8ab3('0x13'));var qs=require(_0x8ab3('0x14'));var as=require(_0x8ab3('0x15'));var hardwareService=require(_0x8ab3('0x16'));var logger=require('../../config/logger')(_0x8ab3('0x17'));var utils=require(_0x8ab3('0x18'));var config=require(_0x8ab3('0x19'));var licenseUtil=require(_0x8ab3('0x1a'));var db=require(_0x8ab3('0x1b'))['db'];function respondWithStatusCode(_0x380003,_0x453741){_0x453741=_0x453741||0xcc;return function(_0x4746fa){if(_0x4746fa){return _0x380003['sendStatus'](_0x453741);}return _0x380003['status'](_0x453741)['end']();};}function respondWithResult(_0x2daf3b,_0x129fc2){_0x129fc2=_0x129fc2||0xc8;return function(_0x40f209){if(_0x40f209){return _0x2daf3b[_0x8ab3('0x1c')](_0x129fc2)[_0x8ab3('0x1d')](_0x40f209);}};}function respondWithFilteredResult(_0x51f9c6,_0x5ecfbb){return function(_0x5cb651){if(_0x5cb651){var _0x9949f1=typeof _0x5ecfbb[_0x8ab3('0x1e')]===_0x8ab3('0x1f')&&typeof _0x5ecfbb['limit']===_0x8ab3('0x1f');var _0x491f5a=_0x5cb651[_0x8ab3('0x20')];var _0x376a98=_0x9949f1?0x0:_0x5ecfbb['offset'];var _0x33cfce=_0x9949f1?_0x5cb651[_0x8ab3('0x20')]:_0x5ecfbb['offset']+_0x5ecfbb[_0x8ab3('0x21')];var _0x1053a4;if(_0x33cfce>=_0x491f5a){_0x33cfce=_0x491f5a;_0x1053a4=0xc8;}else{_0x1053a4=0xce;}_0x51f9c6[_0x8ab3('0x1c')](_0x1053a4);return _0x51f9c6[_0x8ab3('0x22')](_0x8ab3('0x23'),_0x376a98+'-'+_0x33cfce+'/'+_0x491f5a)[_0x8ab3('0x1d')](_0x5cb651);}return null;};}function patchUpdates(_0x23e372){return function(_0x20112a){try{jsonpatch[_0x8ab3('0x24')](_0x20112a,_0x23e372,!![]);}catch(_0x397834){return BPromise[_0x8ab3('0x25')](_0x397834);}return _0x20112a['save']();};}function saveUpdates(_0x2ad37e,_0x1eb2f8){return function(_0x18798c){if(_0x18798c){return _0x18798c[_0x8ab3('0x26')](_0x2ad37e)['then'](function(_0xeb576d){return _0xeb576d;});}return null;};}function removeEntity(_0x18c210,_0x1792d4){return function(_0x15ce5e){if(_0x15ce5e){return _0x15ce5e[_0x8ab3('0x27')]()[_0x8ab3('0x28')](function(){_0x18c210[_0x8ab3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x281431,_0x3fb995){return function(_0x1e80b3){if(!_0x1e80b3){_0x281431['sendStatus'](0x194);}return _0x1e80b3;};}function handleError(_0xaefadb,_0x2b1950){_0x2b1950=_0x2b1950||0x1f4;return function(_0x2dd21a){logger['error'](_0x2dd21a[_0x8ab3('0x29')]);if(_0x2dd21a[_0x8ab3('0x2a')]){delete _0x2dd21a['name'];}_0xaefadb[_0x8ab3('0x1c')](_0x2b1950)[_0x8ab3('0x2b')](_0x2dd21a);};}exports[_0x8ab3('0x2c')]=function(_0x4d3fbf,_0x55e143){var _0x2598d0={},_0x2754b6={},_0x1f68e8={'count':0x0,'rows':[]};var _0x44ab2f=_[_0x8ab3('0x2d')](db['VoiceRecording'][_0x8ab3('0x2e')],function(_0x55aa6c){return{'name':_0x55aa6c[_0x8ab3('0x2f')],'type':_0x55aa6c['type'][_0x8ab3('0x30')]};});_0x2754b6[_0x8ab3('0x31')]=_[_0x8ab3('0x32')](_['map'](_0x44ab2f,_0x8ab3('0x2a')),[_0x8ab3('0x33')]);_0x2754b6[_0x8ab3('0x34')]=_[_0x8ab3('0x35')](_0x4d3fbf[_0x8ab3('0x34')]);_0x2754b6[_0x8ab3('0x36')]=_[_0x8ab3('0x37')](_0x2754b6[_0x8ab3('0x31')],_0x2754b6[_0x8ab3('0x34')]);_0x2598d0[_0x8ab3('0x38')]=_[_0x8ab3('0x37')](_0x2754b6[_0x8ab3('0x31')],qs[_0x8ab3('0x39')](_0x4d3fbf[_0x8ab3('0x34')][_0x8ab3('0x39')]));_0x2598d0[_0x8ab3('0x38')]=_0x2598d0[_0x8ab3('0x38')][_0x8ab3('0x3a')]?_0x2598d0['attributes']:_0x2754b6['model'];if(!_0x4d3fbf[_0x8ab3('0x34')]['hasOwnProperty']('nolimit')){_0x2598d0[_0x8ab3('0x21')]=qs[_0x8ab3('0x21')](_0x4d3fbf['query'][_0x8ab3('0x21')]);_0x2598d0[_0x8ab3('0x1e')]=qs['offset'](_0x4d3fbf['query']['offset']);}_0x2598d0[_0x8ab3('0x3b')]=qs[_0x8ab3('0x3c')](_0x4d3fbf[_0x8ab3('0x34')]['sort']);_0x2598d0['where']=qs[_0x8ab3('0x36')](_[_0x8ab3('0x3d')](_0x4d3fbf[_0x8ab3('0x34')],_0x2754b6[_0x8ab3('0x36')]),_0x44ab2f);if(_0x4d3fbf[_0x8ab3('0x34')][_0x8ab3('0x3e')]){_0x2598d0[_0x8ab3('0x3f')]=_[_0x8ab3('0x40')](_0x2598d0[_0x8ab3('0x3f')],{'$or':_[_0x8ab3('0x2d')](_0x44ab2f,function(_0x202351){if(_0x202351[_0x8ab3('0x41')]!==_0x8ab3('0x42')){var _0x785ed4={};_0x785ed4[_0x202351['name']]={'$like':'%'+_0x4d3fbf[_0x8ab3('0x34')]['filter']+'%'};return _0x785ed4;}})});}_0x2598d0=_['merge']({},_0x2598d0,_0x4d3fbf['options']);var _0x7ad008={'where':_0x2598d0[_0x8ab3('0x3f')]};return db['VoiceRecording']['count'](_0x7ad008)[_0x8ab3('0x28')](function(_0x2ca9fa){_0x1f68e8[_0x8ab3('0x20')]=_0x2ca9fa;if(_0x4d3fbf['query'][_0x8ab3('0x43')]){_0x2598d0[_0x8ab3('0x44')]=[{'all':!![]}];}return db[_0x8ab3('0x45')]['findAll'](_0x2598d0);})['then'](function(_0x1ff671){_0x1f68e8['rows']=_0x1ff671;return _0x1f68e8;})[_0x8ab3('0x28')](respondWithFilteredResult(_0x55e143,_0x2598d0))[_0x8ab3('0x46')](handleError(_0x55e143,null));};exports[_0x8ab3('0x47')]=function(_0x11eac7,_0x57a451){var _0x4874c0={'raw':![],'where':{'id':_0x11eac7[_0x8ab3('0x48')]['id']}},_0x399fdc={};_0x399fdc[_0x8ab3('0x31')]=_[_0x8ab3('0x35')](db['VoiceRecording'][_0x8ab3('0x2e')]);_0x399fdc[_0x8ab3('0x34')]=_['keys'](_0x11eac7[_0x8ab3('0x34')]);_0x399fdc[_0x8ab3('0x36')]=_['intersection'](_0x399fdc['model'],_0x399fdc['query']);_0x4874c0[_0x8ab3('0x38')]=_[_0x8ab3('0x37')](_0x399fdc[_0x8ab3('0x31')],qs[_0x8ab3('0x39')](_0x11eac7[_0x8ab3('0x34')][_0x8ab3('0x39')]));_0x4874c0['attributes']=_0x4874c0['attributes'][_0x8ab3('0x3a')]?_0x4874c0[_0x8ab3('0x38')]:_0x399fdc[_0x8ab3('0x31')];if(_0x11eac7[_0x8ab3('0x34')][_0x8ab3('0x43')]){_0x4874c0[_0x8ab3('0x44')]=[{'all':!![]}];}_0x4874c0=_[_0x8ab3('0x40')]({},_0x4874c0,_0x11eac7['options']);return db[_0x8ab3('0x45')][_0x8ab3('0x49')](_0x4874c0)['then'](handleEntityNotFound(_0x57a451,null))[_0x8ab3('0x28')](respondWithResult(_0x57a451,null))[_0x8ab3('0x46')](handleError(_0x57a451,null));};exports[_0x8ab3('0x4a')]=function(_0x132ead,_0x327d74){return db[_0x8ab3('0x45')][_0x8ab3('0x4a')](_0x132ead[_0x8ab3('0x4b')],{})[_0x8ab3('0x28')](respondWithResult(_0x327d74,0xc9))[_0x8ab3('0x46')](handleError(_0x327d74,null));};exports[_0x8ab3('0x26')]=function(_0x176e29,_0x4a7e86){if(_0x176e29[_0x8ab3('0x4b')]['id']){delete _0x176e29[_0x8ab3('0x4b')]['id'];}return db[_0x8ab3('0x45')][_0x8ab3('0x49')]({'where':{'id':_0x176e29[_0x8ab3('0x48')]['id']}})['then'](handleEntityNotFound(_0x4a7e86,null))[_0x8ab3('0x28')](saveUpdates(_0x176e29[_0x8ab3('0x4b')],null))['then'](respondWithResult(_0x4a7e86,null))['catch'](handleError(_0x4a7e86,null));};exports[_0x8ab3('0x4c')]=function(_0x334e3b,_0x56d6fd){return db['VoiceRecording']['describe']()[_0x8ab3('0x28')](respondWithResult(_0x56d6fd,null))[_0x8ab3('0x46')](handleError(_0x56d6fd,null));};exports[_0x8ab3('0x4d')]=function(_0x57b3c1,_0x11642c,_0x4dcdd2){var _0x53c0f6=require(_0x8ab3('0x4e'));var _0x27d936=![];var _0x5c0acb={};if(_0x57b3c1[_0x8ab3('0x34')][_0x8ab3('0x41')]&&_0x57b3c1['query'][_0x8ab3('0x41')]===_0x8ab3('0x4f')){_0x5c0acb[_0x8ab3('0x4f')]=_0x57b3c1[_0x8ab3('0x48')]['id'];}else{_0x5c0acb['id']=_0x57b3c1['params']['id'];}return db[_0x8ab3('0x45')]['find']({'where':_0x5c0acb,'attributes':['id','value'],'raw':!![]})[_0x8ab3('0x28')](handleEntityNotFound(_0x11642c,null))[_0x8ab3('0x28')](function(_0x86bf7f){if(_0x86bf7f){var _0x1debea=_0x86bf7f[_0x8ab3('0x50')];var _0x130e26=util['format'](_0x8ab3('0x51'),_0x1debea);if(fs[_0x8ab3('0x52')](_0x130e26)){_0x27d936=!![];return _0x53c0f6['decryptFile'](_0x130e26,_0x1debea,config[_0x8ab3('0x53')]['recording'])['then'](function(){return _0x86bf7f;});}return _0x86bf7f;}})[_0x8ab3('0x28')](function(_0x5c4fc2){if(_0x5c4fc2){var _0x2e4d33=_0x5c4fc2[_0x8ab3('0x50')];if(!fs[_0x8ab3('0x52')](_0x2e4d33)){throw new db[(_0x8ab3('0x54'))]['ValidationError'](_0x8ab3('0x55'));}if(_0x5c4fc2[_0x8ab3('0x56')]){return _0x11642c[_0x8ab3('0x4d')](_0x2e4d33,_0x5c4fc2[_0x8ab3('0x56')]+path['extname'](_0x2e4d33),function(){if(_0x27d936){fs['unlink'](_0x2e4d33);}});}else{return _0x11642c[_0x8ab3('0x4d')](_0x2e4d33,function(_0x391b41){if(_0x27d936){fs[_0x8ab3('0x57')](_0x2e4d33);}});}}})[_0x8ab3('0x46')](function(_0x201eab){if(_0x201eab[_0x8ab3('0x58')]==='VoiceRecording\x20not\x20found'){_0x11642c['status'](0x194)[_0x8ab3('0x2b')](_0x8ab3('0x59'));}else{return handleError(_0x11642c,null);}});};exports[_0x8ab3('0x5a')]=function(_0x1cf8dc,_0x22e166,_0xf1939b){var _0x525f2c=require(_0x8ab3('0x4e'));var _0x100147=![];var _0x1871f6={'$and':[db[_0x8ab3('0x5b')]['where'](db[_0x8ab3('0x5b')]['fn'](_0x8ab3('0x5c'),db['sequelize']['col']('uniqueid')),_0x1cf8dc[_0x8ab3('0x34')][_0x8ab3('0x5d')])]};if(_0x1cf8dc[_0x8ab3('0x34')][_0x8ab3('0x41')]&&_0x1cf8dc['query'][_0x8ab3('0x41')]===_0x8ab3('0x4f')){_0x1871f6[_0x8ab3('0x5e')]['push']({'uniqueid':_0x1cf8dc[_0x8ab3('0x48')]['id']});}else{_0x1871f6[_0x8ab3('0x5e')][_0x8ab3('0x5f')]({'id':_0x1cf8dc['params']['id']});}return db[_0x8ab3('0x45')][_0x8ab3('0x49')]({'where':_0x1871f6,'attributes':['id','value'],'raw':!![]})[_0x8ab3('0x28')](handleEntityNotFound(_0x22e166,null))[_0x8ab3('0x28')](function(_0x4c4ba7){if(_0x4c4ba7){var _0x30fae3=util['format'](_0x8ab3('0x51'),_0x4c4ba7['value']);if(fs[_0x8ab3('0x52')](_0x30fae3)){_0x100147=!![];return _0x525f2c[_0x8ab3('0x60')](_0x30fae3,_0x4c4ba7[_0x8ab3('0x50')],config['secrets'][_0x8ab3('0x61')])[_0x8ab3('0x28')](function(){return _0x4c4ba7;});}return _0x4c4ba7;}})[_0x8ab3('0x28')](function(_0x254702){if(_0x254702){if(!fs[_0x8ab3('0x52')](_0x254702[_0x8ab3('0x50')])){throw new db[(_0x8ab3('0x54'))][(_0x8ab3('0x62'))](_0x8ab3('0x55'));}if(_0x254702[_0x8ab3('0x56')]){return _0x22e166[_0x8ab3('0x4d')](_0x254702[_0x8ab3('0x50')],_0x254702[_0x8ab3('0x56')]+path[_0x8ab3('0x63')](_0x254702[_0x8ab3('0x50')]),function(){if(_0x100147){fs[_0x8ab3('0x57')](_0x254702[_0x8ab3('0x50')]);}});}else{return _0x22e166['download'](_0x254702[_0x8ab3('0x50')],function(_0x191d72){if(_0x100147){fs['unlink'](_0x254702[_0x8ab3('0x50')]);}});}}})[_0x8ab3('0x46')](handleError(_0x22e166,null));};exports[_0x8ab3('0x27')]=function(_0x384167,_0x154021){return db[_0x8ab3('0x45')][_0x8ab3('0x49')]({'where':{'id':_0x384167['params']['id']}})[_0x8ab3('0x28')](function(_0x18845f){if(_[_0x8ab3('0x64')](_0x18845f)){throw new ReferenceError(_0x8ab3('0x65'));}return _0x18845f;})['then'](function(_0x46cc25){var _0x4cb1d1=_0x46cc25['value'];logger[_0x8ab3('0x66')](_0x8ab3('0x67'),_0x4cb1d1);if(!_[_0x8ab3('0x64')](_0x46cc25[_0x8ab3('0x50')])&&fs[_0x8ab3('0x52')](_0x4cb1d1)){logger[_0x8ab3('0x66')](_0x8ab3('0x68')+_0x4cb1d1+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8ab3('0x69')](_0x4cb1d1);}_0x4cb1d1=_0x4cb1d1+'.cypher';if(!_[_0x8ab3('0x64')](_0x46cc25[_0x8ab3('0x50')])&&fs[_0x8ab3('0x52')](_0x4cb1d1)){logger[_0x8ab3('0x66')](_0x8ab3('0x68')+_0x4cb1d1+_0x8ab3('0x6a'));fs[_0x8ab3('0x69')](_0x4cb1d1);}return _0x46cc25;})['then'](function(_0x42a124){if(!_0x42a124)throw new InternalError();return _0x42a124[_0x8ab3('0x27')]();})[_0x8ab3('0x28')](function(){_0x154021[_0x8ab3('0x1c')](0xcc)[_0x8ab3('0x6b')]();})['catch'](handleError(_0x154021,null));};function getBucketslist(_0x21fc95,_0x768f9,_0x59209d){return new Promise(function(_0x520000,_0x1b2e46){var _0x40c010=new AWS['S3']({'accessKeyId':_0x768f9,'secretAccessKey':_0x21fc95,'region':_0x59209d});_0x40c010[_0x8ab3('0x6c')]({},function(_0x218750,_0x25cf9c){if(_0x218750){return _0x1b2e46(_0x218750);}else{return _0x520000(_0x25cf9c);}});});}function createBucket(_0x31e5b8,_0x2d08a7,_0x444f6f,_0x23a51c){return new Promise(function(_0x3747ef,_0x3b8087){var _0x42aa4c=new AWS['S3']({'accessKeyId':_0x2d08a7,'secretAccessKey':_0x31e5b8,'region':_0x444f6f});_0x42aa4c[_0x8ab3('0x6d')]({'Bucket':_0x23a51c},function(_0x3a6142,_0x52595f){if(_0x3a6142){return _0x3b8087(_0x3a6142);}else{return _0x3747ef(_0x52595f);}});});}function uploadFile(_0x57e938,_0xc088c2,_0x380c55,_0x3a52d5,_0x1914f6,_0x518cca){return new Promise(function(_0x1fe448,_0x218da3){var _0x20cbf1=new AWS['S3']({'accessKeyId':_0xc088c2,'secretAccessKey':_0x57e938,'region':_0x380c55});_0x20cbf1['upload']({'Bucket':_0x3a52d5,'Key':_0x1914f6,'Body':_0x518cca},function(_0x239d23,_0x26f646){if(_0x239d23){return _0x218da3(_0x239d23);}else{return _0x1fe448(_0x26f646);}});});}function startTranscribe(_0x40b070,_0x27fba3,_0x48ef48,_0x490c4b,_0x5c74f8,_0x80560b){return new Promise(function(_0x1ebb48,_0x7eb99e){var _0x3474f0=new AWS['TranscribeService']({'accessKeyId':_0x27fba3,'secretAccessKey':_0x40b070,'region':_0x48ef48});_0x3474f0[_0x8ab3('0x6e')]({'TranscriptionJobName':_0x490c4b,'LanguageCode':_0x5c74f8,'Media':{'MediaFileUri':_0x80560b}},function(_0x215ccc,_0x181d64){if(_0x215ccc){return _0x7eb99e(_0x215ccc);}else{return _0x1ebb48(_0x181d64);}});});}function transcribe(_0x2772ed,_0x1946ba,_0x139707,_0x2cf603,_0x20aaac,_0x2fd38c,_0x4b41e2){return new Promise(function(_0x2cf36b,_0x59e844){var _0x1354a8={};logger[_0x8ab3('0x66')](util[_0x8ab3('0x33')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x2772ed,_0x20aaac));return uploadFile(_0x1946ba,_0x139707,_0x2cf603,_0x20aaac,path[_0x8ab3('0x6f')](_0x2fd38c),fs[_0x8ab3('0x70')](_0x2fd38c))[_0x8ab3('0x28')](function(_0x18c832){logger[_0x8ab3('0x66')](util[_0x8ab3('0x33')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x2772ed,_0x20aaac,_0x18c832[_0x8ab3('0x71')]));_0x1354a8[_0x8ab3('0x72')]=_0x18c832[_0x8ab3('0x73')];_0x1354a8[_0x8ab3('0x74')]=_0x18c832[_0x8ab3('0x71')];logger[_0x8ab3('0x66')](util[_0x8ab3('0x33')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x2772ed));return startTranscribe(_0x1946ba,_0x139707,_0x2cf603,uuidv4(),_0x4b41e2,_0x18c832['Location']);})[_0x8ab3('0x28')](function(_0x4a9a30){logger[_0x8ab3('0x66')](util[_0x8ab3('0x33')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x2772ed,_0x4a9a30[_0x8ab3('0x75')][_0x8ab3('0x76')]));_0x1354a8[_0x8ab3('0x77')]=_0x4a9a30['TranscriptionJob'][_0x8ab3('0x76')];_0x1354a8[_0x8ab3('0x78')]=_0x4a9a30[_0x8ab3('0x75')][_0x8ab3('0x79')];return _0x2cf36b(_0x1354a8);})[_0x8ab3('0x46')](function(_0x4ad21b){return _0x59e844(_0x4ad21b);});});}exports['runTranscribe']=function(_0x3fd9e4,_0x4206ac,_0x20ed32){var _0x542cb9;var _0x2a6377;var _0x476401;var _0x35ed8a=require(_0x8ab3('0x4e'));return db[_0x8ab3('0x45')]['findOne']({'where':{'id':_0x3fd9e4[_0x8ab3('0x48')]['id']}})[_0x8ab3('0x28')](function(_0x2d23fc){if(_0x2d23fc){var _0xadfe64=util['format'](_0x8ab3('0x51'),_0x2d23fc[_0x8ab3('0x50')]);if(fs[_0x8ab3('0x52')](_0xadfe64)){cypher=!![];return _0x35ed8a[_0x8ab3('0x60')](_0xadfe64,_0x2d23fc[_0x8ab3('0x50')],config[_0x8ab3('0x53')][_0x8ab3('0x61')])['then'](function(){return _0x2d23fc;});}return _0x2d23fc;}})[_0x8ab3('0x28')](function(_0x5c0aed){if(!_0x5c0aed){throw new db[(_0x8ab3('0x54'))][(_0x8ab3('0x62'))](_0x8ab3('0x7a'));}_0x2a6377=_0x5c0aed;return db['Setting'][_0x8ab3('0x7b')]({'where':{'id':0x1}});})[_0x8ab3('0x28')](handleEntityNotFound(_0x4206ac,null))[_0x8ab3('0x28')](function(_0x2aeb1e){if(_0x2aeb1e){_0x542cb9=_0x2aeb1e;if(!_0x542cb9[_0x8ab3('0x7c')]||!_0x542cb9[_0x8ab3('0x7d')]||!_0x542cb9[_0x8ab3('0x7e')]||!_0x542cb9[_0x8ab3('0x7f')]||!_0x542cb9['bucket']){throw new db[(_0x8ab3('0x54'))][(_0x8ab3('0x62'))](_0x8ab3('0x80'));}if(_0x3fd9e4[_0x8ab3('0x4b')][_0x8ab3('0x81')]&&(!_0x542cb9[_0x8ab3('0x82')]||!_0x542cb9['sentimentAccountId']||!_0x542cb9['sentimentRegion']||!_0x542cb9[_0x8ab3('0x7f')]||!_0x542cb9['bucket'])){throw new db[(_0x8ab3('0x54'))][(_0x8ab3('0x62'))](_0x8ab3('0x83'));}return db[_0x8ab3('0x84')][_0x8ab3('0x7b')]({'where':{'id':_0x542cb9['transcribeAccountId']}});}})[_0x8ab3('0x28')](function(_0x5e421f){if(!_0x5e421f){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x5e421f['data1']||!_0x5e421f[_0x8ab3('0x85')]){throw new db[(_0x8ab3('0x54'))][(_0x8ab3('0x62'))](_0x8ab3('0x86'));}_0x476401=_0x5e421f;return getBucketslist(_0x476401[_0x8ab3('0x87')],_0x476401[_0x8ab3('0x85')],_0x542cb9['transcribeRegion']);})[_0x8ab3('0x28')](function(_0x127554){if(_0x127554&&_0x127554[_0x8ab3('0x88')]){var _0x4edfa7=_[_0x8ab3('0x49')](_0x127554[_0x8ab3('0x88')],function(_0x18048d){return _0x18048d['Name']===_0x542cb9['bucket'];});if(!_0x4edfa7){logger[_0x8ab3('0x66')](util[_0x8ab3('0x33')](_0x8ab3('0x89'),_0x3fd9e4[_0x8ab3('0x48')]['id'],_0x542cb9[_0x8ab3('0x72')]));return createBucket(_0x476401[_0x8ab3('0x87')],_0x476401[_0x8ab3('0x85')],_0x542cb9[_0x8ab3('0x7e')],_0x542cb9[_0x8ab3('0x72')]);}logger[_0x8ab3('0x66')](util[_0x8ab3('0x33')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x3fd9e4['params']['id'],_0x542cb9[_0x8ab3('0x72')]));return;}})[_0x8ab3('0x28')](function(_0x554839){if(_0x2a6377['transcribeStatus']===_0x8ab3('0x8a')){return transcribe(_0x3fd9e4['params']['id'],_0x476401['data1'],_0x476401['data2'],_0x542cb9[_0x8ab3('0x7e')],_0x542cb9[_0x8ab3('0x72')],_0x2a6377[_0x8ab3('0x50')],_0x542cb9[_0x8ab3('0x7f')]);}else{logger['info'](util[_0x8ab3('0x33')](_0x8ab3('0x8b'),_0x3fd9e4[_0x8ab3('0x48')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x8ab3('0x28')](function(_0x3915d7){if(_0x3915d7){_0x3915d7[_0x8ab3('0x8c')]=_0x3fd9e4[_0x8ab3('0x4b')][_0x8ab3('0x81')];return _0x2a6377['updateAttributes'](_0x3915d7);}})['then'](respondWithResult(_0x4206ac,null))[_0x8ab3('0x46')](handleError(_0x4206ac,null));};function writeFile(_0x458fdd,_0x18a8e1){return new Promise(function(_0x2c4f77,_0x221101){fs[_0x8ab3('0x8d')](_0x18a8e1,_0x458fdd,function(_0x3ab1fe,_0x51f630){if(_0x3ab1fe){return _0x221101(_0x3ab1fe);}else{return _0x2c4f77(_0x51f630);}});});}exports['downloadTranscribe']=function(_0x4b411c,_0x2278b6,_0x31ed27){return db[_0x8ab3('0x45')][_0x8ab3('0x7b')]({'where':{'id':_0x4b411c[_0x8ab3('0x48')]['id']}})[_0x8ab3('0x28')](handleEntityNotFound(_0x2278b6))['then'](function(_0x4366df){if(_0x4366df&&_0x4366df[_0x8ab3('0x8e')]){var _0x148dad=_0x4366df[_0x8ab3('0x8e')];var _0x4fedfb=config['root']+_0x8ab3('0x8f')+_0x4366df['id']+_0x8ab3('0x90');if(fs[_0x8ab3('0x52')](_0x4fedfb)){return _0x4fedfb;}return writeFile(_0x148dad,_0x4fedfb)['then'](function(){return _0x4fedfb;});}else{throw new db[(_0x8ab3('0x54'))][(_0x8ab3('0x62'))](_0x8ab3('0x91'));}})['then'](function(_0x30f6d3){return _0x2278b6[_0x8ab3('0x4d')](_0x30f6d3);})[_0x8ab3('0x46')](handleError(_0x2278b6));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 0856b57..598ed9d 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 _0x5089=['uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings'];(function(_0x3f5bb9,_0x116590){var _0xf699e6=function(_0x20bf83){while(--_0x20bf83){_0x3f5bb9['push'](_0x3f5bb9['shift']());}};_0xf699e6(++_0x116590);}(_0x5089,0x1bb));var _0x9508=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0x5089[_0x421196];return _0x2738af;};'use strict';var attributes=require(_0x9508('0x0'));module[_0x9508('0x1')]=function(_0x5eec86,_0x2d60c7){return _0x5eec86[_0x9508('0x2')](_0x9508('0x3'),attributes,{'tableName':_0x9508('0x4'),'paranoid':![],'indexes':[{'name':_0x9508('0x5'),'fields':['uniqueid']},{'name':_0x9508('0x6'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb458=['transcribeStatus','./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','uniqueid'];(function(_0x1dd4ff,_0x50c3f1){var _0x8c605e=function(_0x178e2b){while(--_0x178e2b){_0x1dd4ff['push'](_0x1dd4ff['shift']());}};_0x8c605e(++_0x50c3f1);}(_0xb458,0x103));var _0x8b45=function(_0x52ce8b,_0x2793af){_0x52ce8b=_0x52ce8b-0x0;var _0x2857f2=_0xb458[_0x52ce8b];return _0x2857f2;};'use strict';var attributes=require(_0x8b45('0x0'));module[_0x8b45('0x1')]=function(_0x4544e3,_0x494751){return _0x4544e3['define'](_0x8b45('0x2'),attributes,{'tableName':_0x8b45('0x3'),'paranoid':![],'indexes':[{'name':_0x8b45('0x4'),'fields':[_0x8b45('0x4')]},{'name':'transcribeStatus','fields':[_0x8b45('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 61c853a..048c47d 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 _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','attributes','limit','catch','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','format','%s.cypher','value','encryptFile','secrets','unlink','info','CreateVoiceRecording\x20file\x20encrypted','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x391078,_0x411863){var _0x44895b=function(_0x50fdd1){while(--_0x50fdd1){_0x391078['push'](_0x391078['shift']());}};_0x44895b(++_0x411863);}(_0xc2c7,0x134));var _0x7c2c=function(_0x56655b,_0x181774){_0x56655b=_0x56655b-0x0;var _0x1eafc7=_0xc2c7[_0x56655b];return _0x1eafc7;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});}exports[_0x7c2c('0x15')]=function(_0x14453f){var _0x2a9539=this;return new Promise(function(_0x17df4a,_0x26be0f){return db[_0x7c2c('0x16')][_0x7c2c('0x17')](_0x14453f[_0x7c2c('0x18')],{'raw':_0x14453f[_0x7c2c('0x19')]?_0x14453f[_0x7c2c('0x19')][_0x7c2c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14453f['options']?_0x14453f[_0x7c2c('0x19')]['where']||null:null,'attributes':_0x14453f['options']?_0x14453f[_0x7c2c('0x19')][_0x7c2c('0x1b')]||null:null,'limit':_0x14453f[_0x7c2c('0x19')]?_0x14453f[_0x7c2c('0x19')][_0x7c2c('0x1c')]||null:null})[_0x7c2c('0xc')](function(_0xa84620){logger['info'](_0x7c2c('0x15'),_0x14453f);logger['debug'](_0x7c2c('0x15'),_0x14453f,JSON['stringify'](_0xa84620));_0x17df4a(_0xa84620);})[_0x7c2c('0x1d')](function(_0x274c3b){logger[_0x7c2c('0x12')]('UpdateVoiceRecording',_0x274c3b['message'],_0x14453f);_0x26be0f(_0x2a9539[_0x7c2c('0x12')](0x1f4,_0x274c3b[_0x7c2c('0x14')]));});});};exports[_0x7c2c('0x1e')]=function(_0x150690){var _0x31d8f3=this;return new Promise(function(_0xa8e145,_0x3f4618){var _0x4b1dd0=require(_0x7c2c('0x1f'));var _0xf39941;return db[_0x7c2c('0x20')][_0x7c2c('0x21')]({'attributes':['id',_0x7c2c('0x22')],'where':{'id':0x1},'raw':!![]})[_0x7c2c('0xc')](function(_0xf2bfd1){_0xf39941=_0xf2bfd1;return db[_0x7c2c('0x16')][_0x7c2c('0x23')](_0x150690['body']);})[_0x7c2c('0xc')](function(_0x3a3730){if(_0xf39941[_0x7c2c('0x22')]&&fs[_0x7c2c('0x24')](_0x3a3730['value'])){var _0xcb98ba=util[_0x7c2c('0x25')](_0x7c2c('0x26'),_0x3a3730[_0x7c2c('0x27')]);return _0x4b1dd0[_0x7c2c('0x28')](_0x3a3730[_0x7c2c('0x27')],_0xcb98ba,config[_0x7c2c('0x29')]['recording'])[_0x7c2c('0xc')](function(){fs[_0x7c2c('0x2a')](_0x3a3730[_0x7c2c('0x27')]);logger[_0x7c2c('0x2b')](_0x7c2c('0x2c'));return _0x3a3730;});}return _0x3a3730;})['then'](function(_0x47ef3c){logger[_0x7c2c('0x2b')]('CreateVoiceRecording',_0x150690);logger['debug'](_0x7c2c('0x1e'),_0x150690,JSON[_0x7c2c('0x11')](_0x47ef3c));_0xa8e145(_0x47ef3c);})[_0x7c2c('0x1d')](function(_0x156c03){logger['error'](_0x7c2c('0x1e'),_0x156c03[_0x7c2c('0x14')],_0x150690);_0x3f4618(_0x31d8f3[_0x7c2c('0x12')](0x1f4,_0x156c03[_0x7c2c('0x14')]));});});}; \ No newline at end of file +var _0x2272=['client','http','request','then','info','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','format','%s.cypher','encryptFile','secrets','recording','unlink','value','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x23071e,_0x4df73d){var _0x397837=function(_0x3a1e44){while(--_0x3a1e44){_0x23071e['push'](_0x23071e['shift']());}};_0x397837(++_0x4df73d);}(_0x2272,0xd8));var _0x2227=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2272[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));var BPromise=require(_0x2227('0x3'));var rs=require(_0x2227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2227('0x5'))['db'];var utils=require(_0x2227('0x6'));var logger=require(_0x2227('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2227('0x8'));var client=jayson[_0x2227('0x9')][_0x2227('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2591db,_0xaec623,_0x1413d2){return new BPromise(function(_0x41fc3f,_0x34bdd0){return client[_0x2227('0xb')](_0x2591db,_0x1413d2)[_0x2227('0xc')](function(_0x496bbd){logger[_0x2227('0xd')]('VoiceRecording,\x20%s,\x20%s',_0xaec623,_0x2227('0xe'));logger[_0x2227('0xf')](_0x2227('0x10'),_0xaec623,_0x2227('0xe'),JSON[_0x2227('0x11')](_0x496bbd));if(_0x496bbd['error']){if(_0x496bbd[_0x2227('0x12')][_0x2227('0x13')]===0x1f4){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x496bbd[_0x2227('0x12')][_0x2227('0x15')]);return _0x34bdd0(_0x496bbd['error']['message']);}logger['error'](_0x2227('0x14'),_0xaec623,_0x496bbd['error'][_0x2227('0x15')]);return _0x41fc3f(_0x496bbd[_0x2227('0x12')]['message']);}else{logger[_0x2227('0xd')](_0x2227('0x14'),_0xaec623,_0x2227('0xe'));_0x41fc3f(_0x496bbd[_0x2227('0x16')][_0x2227('0x15')]);}})[_0x2227('0x17')](function(_0x508e92){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x508e92);_0x34bdd0(_0x508e92);});});}exports[_0x2227('0x18')]=function(_0x531f75){var _0x11bf80=this;return new Promise(function(_0x620012,_0x65e3b6){return db[_0x2227('0x19')][_0x2227('0x1a')](_0x531f75[_0x2227('0x1b')],{'raw':_0x531f75[_0x2227('0x1c')]?_0x531f75['options'][_0x2227('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x531f75['options']?_0x531f75[_0x2227('0x1c')][_0x2227('0x1e')]||null:null,'attributes':_0x531f75[_0x2227('0x1c')]?_0x531f75[_0x2227('0x1c')][_0x2227('0x1f')]||null:null,'limit':_0x531f75[_0x2227('0x1c')]?_0x531f75[_0x2227('0x1c')][_0x2227('0x20')]||null:null})[_0x2227('0xc')](function(_0x34c090){logger[_0x2227('0xd')]('UpdateVoiceRecording',_0x531f75);logger[_0x2227('0xf')](_0x2227('0x18'),_0x531f75,JSON['stringify'](_0x34c090));_0x620012(_0x34c090);})[_0x2227('0x17')](function(_0xbfdce1){logger['error']('UpdateVoiceRecording',_0xbfdce1[_0x2227('0x15')],_0x531f75);_0x65e3b6(_0x11bf80[_0x2227('0x12')](0x1f4,_0xbfdce1[_0x2227('0x15')]));});});};exports[_0x2227('0x21')]=function(_0x5be889){var _0x191a3e=this;return new Promise(function(_0x301304,_0x2d8ea0){var _0x1957ee=require('../../components/encryptor');var _0x204def;return db[_0x2227('0x22')][_0x2227('0x23')]({'attributes':['id',_0x2227('0x24')],'where':{'id':0x1},'raw':!![]})[_0x2227('0xc')](function(_0x4789eb){_0x204def=_0x4789eb;return db['VoiceRecording']['create'](_0x5be889[_0x2227('0x1b')]);})['then'](function(_0x2ba581){if(_0x204def[_0x2227('0x24')]&&fs['existsSync'](_0x2ba581['value'])){var _0x1f1ba7=util[_0x2227('0x25')](_0x2227('0x26'),_0x2ba581['value']);return _0x1957ee[_0x2227('0x27')](_0x2ba581['value'],_0x1f1ba7,config[_0x2227('0x28')][_0x2227('0x29')])[_0x2227('0xc')](function(){fs[_0x2227('0x2a')](_0x2ba581[_0x2227('0x2b')]);logger[_0x2227('0xd')](_0x2227('0x2c'));return _0x2ba581;});}return _0x2ba581;})[_0x2227('0xc')](function(_0xd38f59){logger[_0x2227('0xd')](_0x2227('0x21'),_0x5be889);logger['debug'](_0x2227('0x21'),_0x5be889,JSON[_0x2227('0x11')](_0xd38f59));_0x301304(_0xd38f59);})[_0x2227('0x17')](function(_0x6cd5d7){logger['error'](_0x2227('0x21'),_0x6cd5d7[_0x2227('0x15')],_0x5be889);_0x2d8ea0(_0x191a3e[_0x2227('0x12')](0x1f4,_0x6cd5d7[_0x2227('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index d4d0acc..5c4853d 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 _0x1604=['post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x455236,_0x418ad5){var _0x1c1615=function(_0x46d678){while(--_0x46d678){_0x455236['push'](_0x455236['shift']());}};_0x1c1615(++_0x418ad5);}(_0x1604,0x167));var _0x4160=function(_0x233b63,_0x13e7a4){_0x233b63=_0x233b63-0x0;var _0x3e2a31=_0x1604[_0x233b63];return _0x3e2a31;};'use strict';var multer=require(_0x4160('0x0'));var util=require(_0x4160('0x1'));var path=require(_0x4160('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4160('0x3')]();var fs_extra=require(_0x4160('0x4'));var auth=require(_0x4160('0x5'));var interaction=require(_0x4160('0x6'));var config=require('../../config/environment');var controller=require(_0x4160('0x7'));router[_0x4160('0x8')]('/',auth[_0x4160('0x9')](),controller[_0x4160('0xa')]);router[_0x4160('0x8')](_0x4160('0xb'),auth[_0x4160('0x9')](),controller[_0x4160('0xc')]);router[_0x4160('0x8')](_0x4160('0xd'),auth[_0x4160('0x9')](),controller[_0x4160('0xe')]);router[_0x4160('0xf')]('/',auth[_0x4160('0x9')](),controller[_0x4160('0x10')]);router[_0x4160('0x11')](_0x4160('0xd'),auth['isAuthenticated'](),controller[_0x4160('0x12')]);router[_0x4160('0x13')]('/:id',auth[_0x4160('0x9')](),controller[_0x4160('0x14')]);module[_0x4160('0x15')]=router; \ No newline at end of file +var _0xf1d1=['/:id','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe'];(function(_0x1b5a5a,_0x1c3b75){var _0x42b32d=function(_0x3d35ab){while(--_0x3d35ab){_0x1b5a5a['push'](_0x1b5a5a['shift']());}};_0x42b32d(++_0x1c3b75);}(_0xf1d1,0xeb));var _0x1f1d=function(_0x15407c,_0x337d1a){_0x15407c=_0x15407c-0x0;var _0xbf1f4f=_0xf1d1[_0x15407c];return _0xbf1f4f;};'use strict';var multer=require(_0x1f1d('0x0'));var util=require(_0x1f1d('0x1'));var path=require(_0x1f1d('0x2'));var timeout=require(_0x1f1d('0x3'));var express=require(_0x1f1d('0x4'));var router=express['Router']();var fs_extra=require(_0x1f1d('0x5'));var auth=require(_0x1f1d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1f1d('0x7'));var controller=require('./voiceTransferReport.controller');router[_0x1f1d('0x8')]('/',auth[_0x1f1d('0x9')](),controller[_0x1f1d('0xa')]);router[_0x1f1d('0x8')]('/describe',auth[_0x1f1d('0x9')](),controller[_0x1f1d('0xb')]);router[_0x1f1d('0x8')](_0x1f1d('0xc'),auth[_0x1f1d('0x9')](),controller['show']);router[_0x1f1d('0xd')]('/',auth[_0x1f1d('0x9')](),controller[_0x1f1d('0xe')]);router[_0x1f1d('0xf')](_0x1f1d('0xc'),auth['isAuthenticated'](),controller[_0x1f1d('0x10')]);router['delete'](_0x1f1d('0xc'),auth[_0x1f1d('0x9')](),controller[_0x1f1d('0x11')]);module[_0x1f1d('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index c16cfe7..e813990 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 _0x3828=['blind','attended','STRING','Yes','sequelize','moment','exports','ENUM'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x3828,0x13c));var _0x8382=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x3828[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x8382('0x0'));var moment=require(_0x8382('0x1'));module[_0x8382('0x2')]={'type':{'type':Sequelize[_0x8382('0x3')](_0x8382('0x4'),_0x8382('0x5'))},'result':{'type':Sequelize[_0x8382('0x6')]},'transfererchannel':{'type':Sequelize[_0x8382('0x6')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x8382('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0x8382('0x6')]},'transfereraccountcode':{'type':Sequelize[_0x8382('0x6')]},'transferercontext':{'type':Sequelize[_0x8382('0x6')]},'transfererexten':{'type':Sequelize[_0x8382('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x8382('0x6')]},'transfereechannel':{'type':Sequelize[_0x8382('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0x8382('0x6')]},'transfereecalleridname':{'type':Sequelize[_0x8382('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x8382('0x6')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x8382('0x6')]},'transfereecontext':{'type':Sequelize[_0x8382('0x6')]},'transfereeexten':{'type':Sequelize[_0x8382('0x6')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0x8382('0x7'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb081=['moment','ENUM','attended','STRING','Yes','sequelize'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xb081,0x15b));var _0x1b08=function(_0x103080,_0x40ac65){_0x103080=_0x103080-0x0;var _0x2d05a0=_0xb081[_0x103080];return _0x2d05a0;};'use strict';var Sequelize=require(_0x1b08('0x0'));var moment=require(_0x1b08('0x1'));module['exports']={'type':{'type':Sequelize[_0x1b08('0x2')]('blind',_0x1b08('0x3'))},'result':{'type':Sequelize[_0x1b08('0x4')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x1b08('0x4')]},'transferercalleridname':{'type':Sequelize[_0x1b08('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x1b08('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x1b08('0x4')]},'transfererexten':{'type':Sequelize[_0x1b08('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x1b08('0x4')]},'transfereechannel':{'type':Sequelize[_0x1b08('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x1b08('0x4')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x1b08('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x1b08('0x4')]},'transfereecontext':{'type':Sequelize[_0x1b08('0x4')]},'transfereeexten':{'type':Sequelize[_0x1b08('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x1b08('0x4')]},'isexternal':{'type':Sequelize[_0x1b08('0x2')](_0x1b08('0x5'),'No')},'context':{'type':Sequelize[_0x1b08('0x4')]},'extension':{'type':Sequelize[_0x1b08('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 6bdacd8..010a8ad 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 _0xb592=['map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','length','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index'];(function(_0x5cc1a2,_0x1e227a){var _0x557be9=function(_0x4dc90d){while(--_0x4dc90d){_0x5cc1a2['push'](_0x5cc1a2['shift']());}};_0x557be9(++_0x1e227a);}(_0xb592,0xb9));var _0x2b59=function(_0x517d65,_0x29cbc3){_0x517d65=_0x517d65-0x0;var _0xf911de=_0xb592[_0x517d65];return _0xf911de;};'use strict';var emlformat=require(_0x2b59('0x0'));var rimraf=require(_0x2b59('0x1'));var zipdir=require(_0x2b59('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2b59('0x3'));var Mustache=require(_0x2b59('0x4'));var util=require(_0x2b59('0x5'));var path=require(_0x2b59('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2b59('0x7'));var fs=require('fs');var fs_extra=require(_0x2b59('0x8'));var _=require(_0x2b59('0x9'));var squel=require(_0x2b59('0xa'));var crypto=require(_0x2b59('0xb'));var jsforce=require(_0x2b59('0xc'));var deskjs=require(_0x2b59('0xd'));var toCsv=require(_0x2b59('0xe'));var querystring=require('querystring');var Papa=require(_0x2b59('0xf'));var Redis=require(_0x2b59('0x10'));var authService=require(_0x2b59('0x11'));var qs=require(_0x2b59('0x12'));var as=require(_0x2b59('0x13'));var hardwareService=require(_0x2b59('0x14'));var logger=require('../../config/logger')(_0x2b59('0x15'));var utils=require('../../config/utils');var config=require(_0x2b59('0x16'));var licenseUtil=require(_0x2b59('0x17'));var db=require(_0x2b59('0x18'))['db'];function respondWithStatusCode(_0x2a93f9,_0x2d5958){_0x2d5958=_0x2d5958||0xcc;return function(_0xfbbe57){if(_0xfbbe57){return _0x2a93f9['sendStatus'](_0x2d5958);}return _0x2a93f9[_0x2b59('0x19')](_0x2d5958)[_0x2b59('0x1a')]();};}function respondWithResult(_0x491509,_0x3bad64){_0x3bad64=_0x3bad64||0xc8;return function(_0x2d57d0){if(_0x2d57d0){return _0x491509['status'](_0x3bad64)[_0x2b59('0x1b')](_0x2d57d0);}};}function respondWithFilteredResult(_0x4f6237,_0x53a97c){return function(_0x19b919){if(_0x19b919){var _0x5737e4=typeof _0x53a97c[_0x2b59('0x1c')]===_0x2b59('0x1d')&&typeof _0x53a97c[_0x2b59('0x1e')]===_0x2b59('0x1d');var _0x21740f=_0x19b919[_0x2b59('0x1f')];var _0x1f42d4=_0x5737e4?0x0:_0x53a97c['offset'];var _0x5ce4d0=_0x5737e4?_0x19b919[_0x2b59('0x1f')]:_0x53a97c[_0x2b59('0x1c')]+_0x53a97c['limit'];var _0x284e32;if(_0x5ce4d0>=_0x21740f){_0x5ce4d0=_0x21740f;_0x284e32=0xc8;}else{_0x284e32=0xce;}_0x4f6237[_0x2b59('0x19')](_0x284e32);return _0x4f6237[_0x2b59('0x20')](_0x2b59('0x21'),_0x1f42d4+'-'+_0x5ce4d0+'/'+_0x21740f)[_0x2b59('0x1b')](_0x19b919);}return null;};}function patchUpdates(_0x112db0){return function(_0x1522e5){try{jsonpatch[_0x2b59('0x22')](_0x1522e5,_0x112db0,!![]);}catch(_0x337ef8){return BPromise[_0x2b59('0x23')](_0x337ef8);}return _0x1522e5[_0x2b59('0x24')]();};}function saveUpdates(_0x340847,_0x5e1f21){return function(_0x4f38ef){if(_0x4f38ef){return _0x4f38ef[_0x2b59('0x25')](_0x340847)[_0x2b59('0x26')](function(_0x14a08){return _0x14a08;});}return null;};}function removeEntity(_0x1d39ee,_0x462b46){return function(_0x25f589){if(_0x25f589){return _0x25f589[_0x2b59('0x27')]()[_0x2b59('0x26')](function(){_0x1d39ee[_0x2b59('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x237286,_0x25376b){return function(_0xa8da47){if(!_0xa8da47){_0x237286[_0x2b59('0x28')](0x194);}return _0xa8da47;};}function handleError(_0x5bd14b,_0x48ee78){_0x48ee78=_0x48ee78||0x1f4;return function(_0x3cb8a6){logger[_0x2b59('0x29')](_0x3cb8a6[_0x2b59('0x2a')]);if(_0x3cb8a6[_0x2b59('0x2b')]){delete _0x3cb8a6[_0x2b59('0x2b')];}_0x5bd14b['status'](_0x48ee78)[_0x2b59('0x2c')](_0x3cb8a6);};}exports[_0x2b59('0x2d')]=function(_0x38d795,_0x5e45da){var _0x285606={},_0x68f08b={},_0x5213d8={'count':0x0,'rows':[]};var _0x311796=_[_0x2b59('0x2e')](db[_0x2b59('0x2f')][_0x2b59('0x30')],function(_0x198213){return{'name':_0x198213[_0x2b59('0x31')],'type':_0x198213[_0x2b59('0x32')][_0x2b59('0x33')]};});_0x68f08b[_0x2b59('0x34')]=_[_0x2b59('0x2e')](_0x311796,_0x2b59('0x2b'));_0x68f08b[_0x2b59('0x35')]=_[_0x2b59('0x36')](_0x38d795[_0x2b59('0x35')]);_0x68f08b[_0x2b59('0x37')]=_[_0x2b59('0x38')](_0x68f08b[_0x2b59('0x34')],_0x68f08b[_0x2b59('0x35')]);_0x285606['attributes']=_[_0x2b59('0x38')](_0x68f08b[_0x2b59('0x34')],qs['fields'](_0x38d795[_0x2b59('0x35')][_0x2b59('0x39')]));_0x285606[_0x2b59('0x3a')]=_0x285606['attributes']['length']?_0x285606[_0x2b59('0x3a')]:_0x68f08b[_0x2b59('0x34')];if(!_0x38d795['query']['hasOwnProperty'](_0x2b59('0x3b'))){_0x285606[_0x2b59('0x1e')]=qs['limit'](_0x38d795['query']['limit']);_0x285606[_0x2b59('0x1c')]=qs[_0x2b59('0x1c')](_0x38d795[_0x2b59('0x35')]['offset']);}_0x285606['order']=qs[_0x2b59('0x3c')](_0x38d795[_0x2b59('0x35')][_0x2b59('0x3c')]);_0x285606['where']=qs[_0x2b59('0x37')](_['pick'](_0x38d795['query'],_0x68f08b[_0x2b59('0x37')]),_0x311796);if(_0x38d795[_0x2b59('0x35')][_0x2b59('0x3d')]){_0x285606[_0x2b59('0x3e')]=_['merge'](_0x285606['where'],{'$or':_[_0x2b59('0x2e')](_0x311796,function(_0x5647b2){if(_0x5647b2['type']!==_0x2b59('0x3f')){var _0x35b9b3={};_0x35b9b3[_0x5647b2['name']]={'$like':'%'+_0x38d795['query'][_0x2b59('0x3d')]+'%'};return _0x35b9b3;}})});}_0x285606=_[_0x2b59('0x40')]({},_0x285606,_0x38d795[_0x2b59('0x41')]);var _0x4f09e6={'where':_0x285606[_0x2b59('0x3e')]};return db['VoiceTransferReport'][_0x2b59('0x1f')](_0x4f09e6)['then'](function(_0x5720ff){_0x5213d8[_0x2b59('0x1f')]=_0x5720ff;if(_0x38d795[_0x2b59('0x35')][_0x2b59('0x42')]){_0x285606[_0x2b59('0x43')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x2b59('0x44')](_0x285606);})[_0x2b59('0x26')](function(_0x101ad9){_0x5213d8[_0x2b59('0x45')]=_0x101ad9;return _0x5213d8;})['then'](respondWithFilteredResult(_0x5e45da,_0x285606))['catch'](handleError(_0x5e45da,null));};exports['show']=function(_0x3f147d,_0x1914ea){var _0x1c06a2={'raw':!![],'where':{'id':_0x3f147d['params']['id']}},_0x5c34bc={};_0x5c34bc[_0x2b59('0x34')]=_['keys'](db[_0x2b59('0x2f')][_0x2b59('0x30')]);_0x5c34bc[_0x2b59('0x35')]=_['keys'](_0x3f147d[_0x2b59('0x35')]);_0x5c34bc['filters']=_['intersection'](_0x5c34bc[_0x2b59('0x34')],_0x5c34bc[_0x2b59('0x35')]);_0x1c06a2['attributes']=_['intersection'](_0x5c34bc[_0x2b59('0x34')],qs[_0x2b59('0x39')](_0x3f147d[_0x2b59('0x35')][_0x2b59('0x39')]));_0x1c06a2[_0x2b59('0x3a')]=_0x1c06a2['attributes'][_0x2b59('0x46')]?_0x1c06a2[_0x2b59('0x3a')]:_0x5c34bc[_0x2b59('0x34')];if(_0x3f147d[_0x2b59('0x35')]['includeAll']){_0x1c06a2[_0x2b59('0x43')]=[{'all':!![]}];}_0x1c06a2=_[_0x2b59('0x40')]({},_0x1c06a2,_0x3f147d['options']);return db[_0x2b59('0x2f')][_0x2b59('0x47')](_0x1c06a2)['then'](handleEntityNotFound(_0x1914ea,null))[_0x2b59('0x26')](respondWithResult(_0x1914ea,null))[_0x2b59('0x48')](handleError(_0x1914ea,null));};exports[_0x2b59('0x49')]=function(_0x45d2fb,_0x137a08){return db[_0x2b59('0x2f')]['create'](_0x45d2fb['body'],{})[_0x2b59('0x26')](respondWithResult(_0x137a08,0xc9))['catch'](handleError(_0x137a08,null));};exports[_0x2b59('0x25')]=function(_0x37142e,_0x3430ab){if(_0x37142e['body']['id']){delete _0x37142e[_0x2b59('0x4a')]['id'];}return db[_0x2b59('0x2f')][_0x2b59('0x47')]({'where':{'id':_0x37142e[_0x2b59('0x4b')]['id']}})[_0x2b59('0x26')](handleEntityNotFound(_0x3430ab,null))[_0x2b59('0x26')](saveUpdates(_0x37142e[_0x2b59('0x4a')],null))[_0x2b59('0x26')](respondWithResult(_0x3430ab,null))[_0x2b59('0x48')](handleError(_0x3430ab,null));};exports[_0x2b59('0x27')]=function(_0x65df21,_0x35ad55){return db[_0x2b59('0x2f')][_0x2b59('0x47')]({'where':{'id':_0x65df21['params']['id']}})[_0x2b59('0x26')](handleEntityNotFound(_0x35ad55,null))[_0x2b59('0x26')](removeEntity(_0x35ad55,null))[_0x2b59('0x48')](handleError(_0x35ad55,null));};exports[_0x2b59('0x4c')]=function(_0x2ef70a,_0x506da3){return db[_0x2b59('0x2f')][_0x2b59('0x4c')]()['then'](respondWithResult(_0x506da3,null))[_0x2b59('0x48')](handleError(_0x506da3,null));}; \ No newline at end of file +var _0x5646=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','VoiceTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','catch','show','params','includeAll','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring'];(function(_0xa3a7a2,_0x3b6eeb){var _0x341268=function(_0x24bb5f){while(--_0x24bb5f){_0xa3a7a2['push'](_0xa3a7a2['shift']());}};_0x341268(++_0x3b6eeb);}(_0x5646,0x119));var _0x6564=function(_0x543242,_0xeac9fd){_0x543242=_0x543242-0x0;var _0x4c99b6=_0x5646[_0x543242];return _0x4c99b6;};'use strict';var emlformat=require(_0x6564('0x0'));var rimraf=require(_0x6564('0x1'));var zipdir=require(_0x6564('0x2'));var jsonpatch=require(_0x6564('0x3'));var rp=require(_0x6564('0x4'));var moment=require('moment');var BPromise=require(_0x6564('0x5'));var Mustache=require(_0x6564('0x6'));var util=require(_0x6564('0x7'));var path=require(_0x6564('0x8'));var sox=require('sox');var csv=require(_0x6564('0x9'));var ejs=require(_0x6564('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6564('0xb'));var crypto=require(_0x6564('0xc'));var jsforce=require(_0x6564('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6564('0xe'));var Papa=require('papaparse');var Redis=require(_0x6564('0xf'));var authService=require(_0x6564('0x10'));var qs=require(_0x6564('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6564('0x12'));var logger=require(_0x6564('0x13'))(_0x6564('0x14'));var utils=require(_0x6564('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6564('0x16'));var db=require(_0x6564('0x17'))['db'];function respondWithStatusCode(_0x2b8e5d,_0x4fb3b3){_0x4fb3b3=_0x4fb3b3||0xcc;return function(_0x27b842){if(_0x27b842){return _0x2b8e5d[_0x6564('0x18')](_0x4fb3b3);}return _0x2b8e5d['status'](_0x4fb3b3)[_0x6564('0x19')]();};}function respondWithResult(_0x3f8e16,_0x7f733f){_0x7f733f=_0x7f733f||0xc8;return function(_0x1ca28d){if(_0x1ca28d){return _0x3f8e16[_0x6564('0x1a')](_0x7f733f)[_0x6564('0x1b')](_0x1ca28d);}};}function respondWithFilteredResult(_0x5bad52,_0x4a2c18){return function(_0x534536){if(_0x534536){var _0x1fae19=typeof _0x4a2c18[_0x6564('0x1c')]===_0x6564('0x1d')&&typeof _0x4a2c18[_0x6564('0x1e')]===_0x6564('0x1d');var _0x46fe31=_0x534536[_0x6564('0x1f')];var _0x1a553f=_0x1fae19?0x0:_0x4a2c18[_0x6564('0x1c')];var _0x2e587d=_0x1fae19?_0x534536[_0x6564('0x1f')]:_0x4a2c18[_0x6564('0x1c')]+_0x4a2c18[_0x6564('0x1e')];var _0x33b12f;if(_0x2e587d>=_0x46fe31){_0x2e587d=_0x46fe31;_0x33b12f=0xc8;}else{_0x33b12f=0xce;}_0x5bad52[_0x6564('0x1a')](_0x33b12f);return _0x5bad52[_0x6564('0x20')](_0x6564('0x21'),_0x1a553f+'-'+_0x2e587d+'/'+_0x46fe31)[_0x6564('0x1b')](_0x534536);}return null;};}function patchUpdates(_0x3ec559){return function(_0x1c178d){try{jsonpatch[_0x6564('0x22')](_0x1c178d,_0x3ec559,!![]);}catch(_0x2e1207){return BPromise[_0x6564('0x23')](_0x2e1207);}return _0x1c178d[_0x6564('0x24')]();};}function saveUpdates(_0x1eea88,_0x1f5f89){return function(_0x2ea7da){if(_0x2ea7da){return _0x2ea7da[_0x6564('0x25')](_0x1eea88)[_0x6564('0x26')](function(_0x3680dd){return _0x3680dd;});}return null;};}function removeEntity(_0x2d47a2,_0x509879){return function(_0x111d26){if(_0x111d26){return _0x111d26[_0x6564('0x27')]()[_0x6564('0x26')](function(){_0x2d47a2['status'](0xcc)[_0x6564('0x19')]();});}};}function handleEntityNotFound(_0x32705d,_0xf03f4){return function(_0x5d6695){if(!_0x5d6695){_0x32705d[_0x6564('0x18')](0x194);}return _0x5d6695;};}function handleError(_0x4c87e3,_0x2bd0a3){_0x2bd0a3=_0x2bd0a3||0x1f4;return function(_0x284e6e){logger[_0x6564('0x28')](_0x284e6e['stack']);if(_0x284e6e[_0x6564('0x29')]){delete _0x284e6e['name'];}_0x4c87e3[_0x6564('0x1a')](_0x2bd0a3)[_0x6564('0x2a')](_0x284e6e);};}exports[_0x6564('0x2b')]=function(_0x43552f,_0x45d43b){var _0x46bafe={},_0x5d19f2={},_0x21929a={'count':0x0,'rows':[]};var _0x3b1c8b=_[_0x6564('0x2c')](db[_0x6564('0x2d')][_0x6564('0x2e')],function(_0x5b9993){return{'name':_0x5b9993['fieldName'],'type':_0x5b9993[_0x6564('0x2f')][_0x6564('0x30')]};});_0x5d19f2[_0x6564('0x31')]=_['map'](_0x3b1c8b,'name');_0x5d19f2[_0x6564('0x32')]=_[_0x6564('0x33')](_0x43552f['query']);_0x5d19f2[_0x6564('0x34')]=_[_0x6564('0x35')](_0x5d19f2[_0x6564('0x31')],_0x5d19f2[_0x6564('0x32')]);_0x46bafe[_0x6564('0x36')]=_[_0x6564('0x35')](_0x5d19f2[_0x6564('0x31')],qs[_0x6564('0x37')](_0x43552f[_0x6564('0x32')]['fields']));_0x46bafe[_0x6564('0x36')]=_0x46bafe[_0x6564('0x36')][_0x6564('0x38')]?_0x46bafe[_0x6564('0x36')]:_0x5d19f2['model'];if(!_0x43552f[_0x6564('0x32')][_0x6564('0x39')](_0x6564('0x3a'))){_0x46bafe[_0x6564('0x1e')]=qs[_0x6564('0x1e')](_0x43552f['query']['limit']);_0x46bafe[_0x6564('0x1c')]=qs['offset'](_0x43552f[_0x6564('0x32')][_0x6564('0x1c')]);}_0x46bafe[_0x6564('0x3b')]=qs[_0x6564('0x3c')](_0x43552f[_0x6564('0x32')][_0x6564('0x3c')]);_0x46bafe[_0x6564('0x3d')]=qs[_0x6564('0x34')](_['pick'](_0x43552f['query'],_0x5d19f2['filters']),_0x3b1c8b);if(_0x43552f[_0x6564('0x32')][_0x6564('0x3e')]){_0x46bafe[_0x6564('0x3d')]=_[_0x6564('0x3f')](_0x46bafe[_0x6564('0x3d')],{'$or':_['map'](_0x3b1c8b,function(_0x32ba4a){if(_0x32ba4a[_0x6564('0x2f')]!=='VIRTUAL'){var _0x5d4a57={};_0x5d4a57[_0x32ba4a[_0x6564('0x29')]]={'$like':'%'+_0x43552f['query'][_0x6564('0x3e')]+'%'};return _0x5d4a57;}})});}_0x46bafe=_[_0x6564('0x3f')]({},_0x46bafe,_0x43552f[_0x6564('0x40')]);var _0x503044={'where':_0x46bafe[_0x6564('0x3d')]};return db['VoiceTransferReport'][_0x6564('0x1f')](_0x503044)[_0x6564('0x26')](function(_0x3d6ee0){_0x21929a['count']=_0x3d6ee0;if(_0x43552f[_0x6564('0x32')]['includeAll']){_0x46bafe['include']=[{'all':!![]}];}return db[_0x6564('0x2d')]['findAll'](_0x46bafe);})[_0x6564('0x26')](function(_0x5a4dc4){_0x21929a['rows']=_0x5a4dc4;return _0x21929a;})['then'](respondWithFilteredResult(_0x45d43b,_0x46bafe))[_0x6564('0x41')](handleError(_0x45d43b,null));};exports[_0x6564('0x42')]=function(_0x273be9,_0x1e1d97){var _0x2d63a7={'raw':!![],'where':{'id':_0x273be9[_0x6564('0x43')]['id']}},_0x3f68b7={};_0x3f68b7[_0x6564('0x31')]=_[_0x6564('0x33')](db['VoiceTransferReport']['rawAttributes']);_0x3f68b7['query']=_[_0x6564('0x33')](_0x273be9[_0x6564('0x32')]);_0x3f68b7[_0x6564('0x34')]=_['intersection'](_0x3f68b7['model'],_0x3f68b7['query']);_0x2d63a7['attributes']=_[_0x6564('0x35')](_0x3f68b7[_0x6564('0x31')],qs[_0x6564('0x37')](_0x273be9[_0x6564('0x32')]['fields']));_0x2d63a7[_0x6564('0x36')]=_0x2d63a7[_0x6564('0x36')][_0x6564('0x38')]?_0x2d63a7['attributes']:_0x3f68b7[_0x6564('0x31')];if(_0x273be9[_0x6564('0x32')][_0x6564('0x44')]){_0x2d63a7[_0x6564('0x45')]=[{'all':!![]}];}_0x2d63a7=_[_0x6564('0x3f')]({},_0x2d63a7,_0x273be9[_0x6564('0x40')]);return db[_0x6564('0x2d')]['find'](_0x2d63a7)[_0x6564('0x26')](handleEntityNotFound(_0x1e1d97,null))[_0x6564('0x26')](respondWithResult(_0x1e1d97,null))[_0x6564('0x41')](handleError(_0x1e1d97,null));};exports[_0x6564('0x46')]=function(_0x42c37a,_0x1bb452){return db[_0x6564('0x2d')]['create'](_0x42c37a[_0x6564('0x47')],{})[_0x6564('0x26')](respondWithResult(_0x1bb452,0xc9))['catch'](handleError(_0x1bb452,null));};exports[_0x6564('0x25')]=function(_0x3b8904,_0x2692ce){if(_0x3b8904[_0x6564('0x47')]['id']){delete _0x3b8904[_0x6564('0x47')]['id'];}return db[_0x6564('0x2d')][_0x6564('0x48')]({'where':{'id':_0x3b8904[_0x6564('0x43')]['id']}})[_0x6564('0x26')](handleEntityNotFound(_0x2692ce,null))[_0x6564('0x26')](saveUpdates(_0x3b8904[_0x6564('0x47')],null))[_0x6564('0x26')](respondWithResult(_0x2692ce,null))[_0x6564('0x41')](handleError(_0x2692ce,null));};exports[_0x6564('0x27')]=function(_0x87f5f3,_0x2050a5){return db[_0x6564('0x2d')][_0x6564('0x48')]({'where':{'id':_0x87f5f3[_0x6564('0x43')]['id']}})[_0x6564('0x26')](handleEntityNotFound(_0x2050a5,null))['then'](removeEntity(_0x2050a5,null))['catch'](handleError(_0x2050a5,null));};exports[_0x6564('0x49')]=function(_0x417a73,_0x2c6c54){return db[_0x6564('0x2d')]['describe']()[_0x6564('0x26')](respondWithResult(_0x2c6c54,null))[_0x6564('0x41')](handleError(_0x2c6c54,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 24d2091..c47b661 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 _0x1362=['rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x334fea,_0x1f1e18){var _0x3c5829=function(_0x4fd6ac){while(--_0x4fd6ac){_0x334fea['push'](_0x334fea['shift']());}};_0x3c5829(++_0x1f1e18);}(_0x1362,0x117));var _0x2136=function(_0x18aec7,_0x282433){_0x18aec7=_0x18aec7-0x0;var _0x45aaf5=_0x1362[_0x18aec7];return _0x45aaf5;};'use strict';var _=require(_0x2136('0x0'));var util=require(_0x2136('0x1'));var logger=require('../../config/logger')(_0x2136('0x2'));var moment=require(_0x2136('0x3'));var BPromise=require(_0x2136('0x4'));var rp=require(_0x2136('0x5'));var fs=require('fs');var path=require(_0x2136('0x6'));var rimraf=require(_0x2136('0x7'));var config=require(_0x2136('0x8'));var attributes=require(_0x2136('0x9'));module[_0x2136('0xa')]=function(_0x3d1564,_0x485042){return _0x3d1564[_0x2136('0xb')](_0x2136('0xc'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6348=['../../config/logger','request-promise','path','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util'];(function(_0x2fa097,_0x1b3f7f){var _0x159339=function(_0xa187fc){while(--_0xa187fc){_0x2fa097['push'](_0x2fa097['shift']());}};_0x159339(++_0x1b3f7f);}(_0x6348,0xc4));var _0x8634=function(_0x30f87a,_0x2cce5a){_0x30f87a=_0x30f87a-0x0;var _0x3a8efc=_0x6348[_0x30f87a];return _0x3a8efc;};'use strict';var _=require(_0x8634('0x0'));var util=require(_0x8634('0x1'));var logger=require(_0x8634('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8634('0x3'));var fs=require('fs');var path=require(_0x8634('0x4'));var rimraf=require('rimraf');var config=require(_0x8634('0x5'));var attributes=require(_0x8634('0x6'));module[_0x8634('0x7')]=function(_0x22a17c,_0x470285){return _0x22a17c[_0x8634('0x8')](_0x8634('0x9'),attributes,{'tableName':_0x8634('0xa'),'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 6715154..4418581 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 _0xbb6c=['http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','create','body','options','CreateVoiceTransferReport','lodash','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3abe0c,_0x53f0ec){var _0x5885f0=function(_0x1f3235){while(--_0x1f3235){_0x3abe0c['push'](_0x3abe0c['shift']());}};_0x5885f0(++_0x53f0ec);}(_0xbb6c,0x156));var _0xcbb6=function(_0x5ec25b,_0x1ff58e){_0x5ec25b=_0x5ec25b-0x0;var _0x4fe26f=_0xbb6c[_0x5ec25b];return _0x4fe26f;};'use strict';var _=require(_0xcbb6('0x0'));var util=require(_0xcbb6('0x1'));var moment=require(_0xcbb6('0x2'));var BPromise=require(_0xcbb6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcbb6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcbb6('0x5'))('rpc');var config=require(_0xcbb6('0x6'));var jayson=require(_0xcbb6('0x7'));var client=jayson['client'][_0xcbb6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51df77,_0x372f76,_0x3613e4){return new BPromise(function(_0x4fad3f,_0x1cca0c){return client[_0xcbb6('0x9')](_0x51df77,_0x3613e4)[_0xcbb6('0xa')](function(_0x1c3041){logger[_0xcbb6('0xb')](_0xcbb6('0xc'),_0x372f76,_0xcbb6('0xd'));logger[_0xcbb6('0xe')](_0xcbb6('0xf'),_0x372f76,'request\x20sent',JSON[_0xcbb6('0x10')](_0x1c3041));if(_0x1c3041[_0xcbb6('0x11')]){if(_0x1c3041[_0xcbb6('0x11')][_0xcbb6('0x12')]===0x1f4){logger[_0xcbb6('0x11')](_0xcbb6('0xc'),_0x372f76,_0x1c3041[_0xcbb6('0x11')][_0xcbb6('0x13')]);return _0x1cca0c(_0x1c3041[_0xcbb6('0x11')]['message']);}logger[_0xcbb6('0x11')](_0xcbb6('0xc'),_0x372f76,_0x1c3041[_0xcbb6('0x11')][_0xcbb6('0x13')]);return _0x4fad3f(_0x1c3041[_0xcbb6('0x11')][_0xcbb6('0x13')]);}else{logger[_0xcbb6('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x372f76,_0xcbb6('0xd'));_0x4fad3f(_0x1c3041['result'][_0xcbb6('0x13')]);}})[_0xcbb6('0x14')](function(_0x37f0ee){logger[_0xcbb6('0x11')](_0xcbb6('0xc'),_0x372f76,_0x37f0ee);_0x1cca0c(_0x37f0ee);});});}exports['CreateVoiceTransferReport']=function(_0x3f9d41){var _0x50a2bb=this;return new Promise(function(_0x4c20e9,_0xbfb883){return db['VoiceTransferReport'][_0xcbb6('0x15')](_0x3f9d41[_0xcbb6('0x16')],{'raw':_0x3f9d41[_0xcbb6('0x17')]?_0x3f9d41[_0xcbb6('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xcbb6('0xa')](function(_0x1b12ef){logger[_0xcbb6('0xb')]('CreateVoiceTransferReport',_0x3f9d41);logger[_0xcbb6('0xe')](_0xcbb6('0x18'),_0x3f9d41,JSON[_0xcbb6('0x10')](_0x1b12ef));_0x4c20e9(_0x1b12ef);})['catch'](function(_0x113956){logger[_0xcbb6('0x11')](_0xcbb6('0x18'),_0x113956[_0xcbb6('0x13')],_0x3f9d41);_0xbfb883(_0x50a2bb[_0xcbb6('0x11')](0x1f4,_0x113956[_0xcbb6('0x13')]));});});}; \ No newline at end of file +var _0xd1d1=['body','options','raw','CreateVoiceTransferReport','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceTransferReport','create'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0xd1d1,0xee));var _0x1d1d=function(_0x5dcf98,_0x492c03){_0x5dcf98=_0x5dcf98-0x0;var _0x3a900c=_0xd1d1[_0x5dcf98];return _0x3a900c;};'use strict';var _=require(_0x1d1d('0x0'));var util=require(_0x1d1d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d1d('0x2'));var db=require(_0x1d1d('0x3'))['db'];var utils=require(_0x1d1d('0x4'));var logger=require('../../config/logger')(_0x1d1d('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1d1d('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fa388,_0x2432f3,_0x4696a9){return new BPromise(function(_0x45198d,_0x35c456){return client[_0x1d1d('0x7')](_0x2fa388,_0x4696a9)[_0x1d1d('0x8')](function(_0x2291b3){logger[_0x1d1d('0x9')](_0x1d1d('0xa'),_0x2432f3,_0x1d1d('0xb'));logger[_0x1d1d('0xc')](_0x1d1d('0xd'),_0x2432f3,'request\x20sent',JSON[_0x1d1d('0xe')](_0x2291b3));if(_0x2291b3[_0x1d1d('0xf')]){if(_0x2291b3[_0x1d1d('0xf')][_0x1d1d('0x10')]===0x1f4){logger['error'](_0x1d1d('0xa'),_0x2432f3,_0x2291b3[_0x1d1d('0xf')][_0x1d1d('0x11')]);return _0x35c456(_0x2291b3[_0x1d1d('0xf')]['message']);}logger['error'](_0x1d1d('0xa'),_0x2432f3,_0x2291b3['error'][_0x1d1d('0x11')]);return _0x45198d(_0x2291b3[_0x1d1d('0xf')][_0x1d1d('0x11')]);}else{logger[_0x1d1d('0x9')]('VoiceTransferReport,\x20%s,\x20%s',_0x2432f3,_0x1d1d('0xb'));_0x45198d(_0x2291b3[_0x1d1d('0x12')][_0x1d1d('0x11')]);}})[_0x1d1d('0x13')](function(_0xb8d13f){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x2432f3,_0xb8d13f);_0x35c456(_0xb8d13f);});});}exports['CreateVoiceTransferReport']=function(_0x179707){var _0x58340b=this;return new Promise(function(_0x46380a,_0x6cffb0){return db[_0x1d1d('0x14')][_0x1d1d('0x15')](_0x179707[_0x1d1d('0x16')],{'raw':_0x179707[_0x1d1d('0x17')]?_0x179707[_0x1d1d('0x17')][_0x1d1d('0x18')]===undefined?!![]:![]:!![]})[_0x1d1d('0x8')](function(_0x2f00e4){logger[_0x1d1d('0x9')](_0x1d1d('0x19'),_0x179707);logger[_0x1d1d('0xc')](_0x1d1d('0x19'),_0x179707,JSON[_0x1d1d('0xe')](_0x2f00e4));_0x46380a(_0x2f00e4);})[_0x1d1d('0x13')](function(_0x36c143){logger[_0x1d1d('0xf')](_0x1d1d('0x19'),_0x36c143[_0x1d1d('0x11')],_0x179707);_0x6cffb0(_0x58340b[_0x1d1d('0xf')](0x1f4,_0x36c143[_0x1d1d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 69ae698..8df9380 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 _0xf4eb=['/hangup','isAuthenticated','isWebrtcLicence','hangup','/hold','hold','/unhold','unhold','/calls','calls','transfer','exports','express','/originate','originate','post'];(function(_0x3b542f,_0x559e42){var _0x4b46c1=function(_0x121dfe){while(--_0x121dfe){_0x3b542f['push'](_0x3b542f['shift']());}};_0x4b46c1(++_0x559e42);}(_0xf4eb,0xec));var _0xbf4e=function(_0x12d6d7,_0x625798){_0x12d6d7=_0x12d6d7-0x0;var _0x47a2d4=_0xf4eb[_0x12d6d7];return _0x47a2d4;};'use strict';var express=require(_0xbf4e('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./webbar.controller');router['post'](_0xbf4e('0x1'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbf4e('0x2')]);router[_0xbf4e('0x3')](_0xbf4e('0x4'),auth[_0xbf4e('0x5')](),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x3')]('/answer',auth[_0xbf4e('0x5')](),auth['isWebrtcLicence'](),controller['answer']);router[_0xbf4e('0x3')](_0xbf4e('0x8'),auth[_0xbf4e('0x5')](),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x3')](_0xbf4e('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbf4e('0xb')]);router['post'](_0xbf4e('0xc'),auth[_0xbf4e('0x5')](),auth['isWebrtcLicence'](),controller[_0xbf4e('0xd')]);router['post']('/transfer',auth[_0xbf4e('0x5')](),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xe')]);module[_0xbf4e('0xf')]=router; \ No newline at end of file +var _0xaa88=['/hold','/unhold','/calls','calls','transfer','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer'];(function(_0x483d14,_0x4de57a){var _0x447a7b=function(_0x1f21f4){while(--_0x1f21f4){_0x483d14['push'](_0x483d14['shift']());}};_0x447a7b(++_0x4de57a);}(_0xaa88,0x137));var _0x8aa8=function(_0x1d9163,_0x79567d){_0x1d9163=_0x1d9163-0x0;var _0xb42197=_0xaa88[_0x1d9163];return _0xb42197;};'use strict';var express=require(_0x8aa8('0x0'));var router=express[_0x8aa8('0x1')]();var auth=require(_0x8aa8('0x2'));var controller=require(_0x8aa8('0x3'));router['post'](_0x8aa8('0x4'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0x7')]);router[_0x8aa8('0x8')](_0x8aa8('0x9'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x8aa8('0xa')]);router['post'](_0x8aa8('0xb'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0xc')]);router['post'](_0x8aa8('0xd'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller['hold']);router[_0x8aa8('0x8')](_0x8aa8('0xe'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller['unhold']);router[_0x8aa8('0x8')](_0x8aa8('0xf'),auth['isAuthenticated'](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0x10')]);router[_0x8aa8('0x8')]('/transfer',auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0x11')]);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 531ce20..383e72e 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 _0xbf6e=['bluebird','jayson/promise','client','http','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','transferNumber\x20is\x20required','info','stringify','emit','log','stack','name','status','send','NotFound','request','then','error','code','message','result','catch','User','agent','VoiceChannels','all','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','filter','UserId','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','../../mysqldb','../../config/environment','util'];(function(_0x519b24,_0x508ccd){var _0xd939dd=function(_0x384045){while(--_0x384045){_0x519b24['push'](_0x519b24['shift']());}};_0xd939dd(++_0x508ccd);}(_0xbf6e,0x149));var _0xebf6=function(_0x1bc9de,_0x30aa82){_0x1bc9de=_0x1bc9de-0x0;var _0xeacad2=_0xbf6e[_0x1bc9de];return _0xeacad2;};'use strict';var path=require('path');var fs=require('fs');var _=require('lodash');var db=require(_0xebf6('0x0'))['db'];var config=require(_0xebf6('0x1'));var util=require(_0xebf6('0x2'));var BPromise=require(_0xebf6('0x3'));var jayson=require(_0xebf6('0x4'));var amiClient=jayson[_0xebf6('0x5')][_0xebf6('0x6')]({'port':0x232a});var logger=require('../../config/logger')(_0xebf6('0x7'));var Redis=require(_0xebf6('0x8'));config[_0xebf6('0x9')]=_[_0xebf6('0xa')](config[_0xebf6('0x9')],{'host':_0xebf6('0xb'),'port':0x18eb});var io=require(_0xebf6('0xc'))(new Redis(config['redis']));var Schema=require(_0xebf6('0xd'));var originateValidation=new Schema({'userId':{'type':_0xebf6('0xe'),'required':[!![],_0xebf6('0xf')]},'callNumber':{'type':'string','required':[!![],_0xebf6('0x10')]},'callerId':{'type':_0xebf6('0x11')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xebf6('0xe'),'required':[!![],_0xebf6('0xf')]},'sessionId':{'type':_0xebf6('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xebf6('0xe'),'required':[!![],_0xebf6('0xf')]},'sessionId':{'type':_0xebf6('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xebf6('0xf')]},'sessionId':{'type':_0xebf6('0x11'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xebf6('0x11'),'required':[!![],_0xebf6('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0xebf6('0xe'),'required':[!![],_0xebf6('0xf')]},'sessionId':{'type':_0xebf6('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xebf6('0xe'),'required':[!![],_0xebf6('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xebf6('0xf')]}});function emit(_0x2c980f,_0xb164a1,_0x642167){logger[_0xebf6('0x13')](_0x2c980f,_0xb164a1,JSON[_0xebf6('0x14')](_0x642167));io['to'](_0x2c980f)[_0xebf6('0x15')](_0xb164a1,_0x642167);}function handleError(_0x2dc96f){return function(_0x2d3984){console[_0xebf6('0x16')]('handleError:',_0x2d3984,_0x2d3984 instanceof RangeError);logger['error'](_0x2d3984[_0xebf6('0x17')]);if(_0x2d3984 instanceof RangeError){if(_0x2d3984[_0xebf6('0x18')]){delete _0x2d3984[_0xebf6('0x18')];}_0x2dc96f[_0xebf6('0x19')](0x194)[_0xebf6('0x1a')](_0x2d3984);}else{if(_0x2d3984[_0xebf6('0x18')]){delete _0x2d3984[_0xebf6('0x18')];}_0x2dc96f[_0xebf6('0x19')](0x1f4)['send'](_0x2d3984);}};}function checkError(){return function(_0xbe39dd){if(!_0xbe39dd){throw new RangeError(_0xebf6('0x1b'));}return _0xbe39dd;};}function respondWithRpcPromise(_0x377934,_0x23d487){return new BPromise(function(_0x6303ac,_0x14c8ac){var _0x2f419e=amiClient;return _0x2f419e[_0xebf6('0x1c')](_0x377934,_0x23d487)[_0xebf6('0x1d')](function(_0x2e32c6){if(_0x2e32c6[_0xebf6('0x1e')]){if(_0x2e32c6[_0xebf6('0x1e')][_0xebf6('0x1f')]===0x1f4){return _0x14c8ac(_0x2e32c6[_0xebf6('0x1e')][_0xebf6('0x20')]);}return _0x6303ac(_0x2e32c6[_0xebf6('0x1e')][_0xebf6('0x20')]);}else{_0x6303ac(_0x2e32c6[_0xebf6('0x21')]);}})[_0xebf6('0x22')](function(_0x4dadf7){_0x14c8ac(_0x4dadf7);});});}function getAgent(_0x58fb66){return db[_0xebf6('0x23')]['findOne']({'where':{'id':_0x58fb66,'role':_0xebf6('0x24')}})[_0xebf6('0x1d')](checkError());}function getAgentCheckSession(_0x5a01ea,_0x4f39eb){return new BPromise(function(_0x37950c,_0x40ae57){var _0x3c3d5c=respondWithRpcPromise(_0xebf6('0x25'));var _0xedaaeb=getAgent(_0x5a01ea);Promise[_0xebf6('0x26')]([_0x3c3d5c,_0xedaaeb])[_0xebf6('0x1d')](function(_0x7551ce){var _0x4c3495=_0x7551ce[0x0];var _0x37cd67=_0x7551ce[0x1];var _0x78cdf0=_['filter'](_0x4c3495[_0xebf6('0x27')],function(_0x28bbea){return _0x28bbea['UserId']==_0x37cd67['id']&&_0x28bbea[_0xebf6('0x28')]==_0x4f39eb;});if(_0x78cdf0[_0xebf6('0x29')]==0x1){_0x37950c(_0x37cd67);}else{_0x40ae57(new RangeError(_0xebf6('0x2a')+_0x4f39eb+_0xebf6('0x2b')));}});});}exports[_0xebf6('0x2c')]=function(_0x41da63,_0x4907d0){logger[_0xebf6('0x13')](_0xebf6('0x2d'),_0x41da63['body']);var _0x534142=originateValidation[_0xebf6('0xd')](_0x41da63[_0xebf6('0x2e')]);if(_0x534142['length']>0x0){return _0x4907d0[_0xebf6('0x19')](0x190)[_0xebf6('0x2f')](_0x534142);}var _0x4d736c=_0x41da63[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x12bd27=_0x41da63['body'][_0xebf6('0x31')];var _0x20192c=_0x41da63[_0xebf6('0x2e')][_0xebf6('0x32')];var _0x4b6d95=_0x41da63['body'][_0xebf6('0x33')];return getAgent(_0x4d736c)[_0xebf6('0x1d')](function(_0x562f76){logger[_0xebf6('0x13')](_0xebf6('0x34'),_0x562f76['name']);emit(util[_0xebf6('0x35')](_0xebf6('0x36'),_0x562f76[_0xebf6('0x18')]),_0xebf6('0x37'),{'callNumber':_0x12bd27,'callerId':_0x20192c,'callbackUrl':_0x4b6d95});return _0x4907d0[_0xebf6('0x19')](0xc8)['json']({'error':![],'message':_0xebf6('0x38')});})['catch'](handleError(_0x4907d0));};exports[_0xebf6('0x39')]=function(_0x54702d,_0xafef4d){logger[_0xebf6('0x13')](_0xebf6('0x3a'),_0x54702d[_0xebf6('0x2e')]);var _0x2f1236=hangupValidation[_0xebf6('0xd')](_0x54702d['body']);if(_0x2f1236[_0xebf6('0x29')]>0x0){return _0xafef4d[_0xebf6('0x19')](0x190)[_0xebf6('0x2f')](_0x2f1236);}var _0x144b41=_0x54702d[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x49f089=_0x54702d[_0xebf6('0x2e')][_0xebf6('0x28')];return getAgent(_0x144b41)[_0xebf6('0x1d')](function(_0x111ff7){logger[_0xebf6('0x13')](_0xebf6('0x34'),_0x111ff7['name']);emit(util['format']('user:%s',_0x111ff7[_0xebf6('0x18')]),_0xebf6('0x3b'),{'sessionId':_0x49f089});return _0xafef4d[_0xebf6('0x19')](0xc8)['json']({'error':![],'message':_0xebf6('0x3c')});})[_0xebf6('0x22')](handleError(_0xafef4d));};exports[_0xebf6('0x3d')]=function(_0x5ca582,_0x8cca55){logger[_0xebf6('0x13')]('answer\x20fired:',_0x5ca582[_0xebf6('0x2e')]);var _0x1de50e=answerValidation[_0xebf6('0xd')](_0x5ca582['body']);if(_0x1de50e[_0xebf6('0x29')]>0x0){return _0x8cca55['status'](0x190)['json'](_0x1de50e);}var _0x256552=_0x5ca582[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x2ac140=_0x5ca582['body'][_0xebf6('0x28')];return getAgent(_0x256552)['then'](function(_0x4483d2){logger[_0xebf6('0x13')](_0xebf6('0x34'),_0x4483d2[_0xebf6('0x18')]);emit(util[_0xebf6('0x35')]('user:%s',_0x4483d2['name']),_0xebf6('0x3e'),{'sessionId':_0x2ac140});return _0x8cca55[_0xebf6('0x19')](0xc8)[_0xebf6('0x2f')]({'error':![],'message':_0xebf6('0x3f')});})['catch'](handleError(_0x8cca55));};exports[_0xebf6('0x40')]=function(_0x21999e,_0x41c4ce){logger[_0xebf6('0x13')](_0xebf6('0x41'),_0x21999e[_0xebf6('0x2e')]);var _0x45e0f1=holdValidation['validate'](_0x21999e[_0xebf6('0x2e')]);if(_0x45e0f1[_0xebf6('0x29')]>0x0){return _0x41c4ce[_0xebf6('0x19')](0x190)[_0xebf6('0x2f')](_0x45e0f1);}var _0x166664=_0x21999e[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x56b26b=_0x21999e[_0xebf6('0x2e')]['sessionId'];return getAgent(_0x166664)[_0xebf6('0x1d')](function(_0x31d8ba){logger['info'](_0xebf6('0x34'),_0x31d8ba['name']);emit(util[_0xebf6('0x35')](_0xebf6('0x36'),_0x31d8ba[_0xebf6('0x18')]),_0xebf6('0x42'),{'sessionId':_0x56b26b});return _0x41c4ce[_0xebf6('0x19')](0xc8)['json']({'error':![],'message':_0xebf6('0x43')});})[_0xebf6('0x22')](handleError(_0x41c4ce));};exports['unhold']=function(_0x1f98fd,_0x2765f2){logger[_0xebf6('0x13')](_0xebf6('0x44'),_0x1f98fd[_0xebf6('0x2e')]);var _0x549892=unholdValidation[_0xebf6('0xd')](_0x1f98fd[_0xebf6('0x2e')]);if(_0x549892[_0xebf6('0x29')]>0x0){return _0x2765f2[_0xebf6('0x19')](0x190)['json'](_0x549892);}var _0x3629aa=_0x1f98fd[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x303997=_0x1f98fd[_0xebf6('0x2e')][_0xebf6('0x28')];return getAgent(_0x3629aa)[_0xebf6('0x1d')](function(_0x9184ce){logger[_0xebf6('0x13')]('entityFound:',_0x9184ce[_0xebf6('0x18')]);emit(util[_0xebf6('0x35')](_0xebf6('0x36'),_0x9184ce['name']),_0xebf6('0x45'),{'sessionId':_0x303997});return _0x2765f2['status'](0xc8)['json']({'error':![],'message':_0xebf6('0x46')});})[_0xebf6('0x22')](handleError(_0x2765f2));};exports[_0xebf6('0x47')]=function(_0x32baee,_0x13c447){logger['info'](_0xebf6('0x48'),_0x13c447['body']);var _0x4ed306=callsValidation['validate'](_0x32baee[_0xebf6('0x2e')]);if(_0x4ed306[_0xebf6('0x29')]>0x0){return _0x13c447['status'](0x190)[_0xebf6('0x2f')](_0x4ed306);}var _0x151476=_0x32baee[_0xebf6('0x2e')][_0xebf6('0x30')];var _0x3a4b20=respondWithRpcPromise(_0xebf6('0x25'));var _0x246f9f=getAgent(_0x151476);return Promise['all']([_0x3a4b20,_0x246f9f])[_0xebf6('0x1d')](function(_0xddf329){var _0x40d85f=_0xddf329[0x0];var _0x3101c2=_0xddf329[0x1];var _0x39637b=_[_0xebf6('0x49')](_0x40d85f['rows'],function(_0x44a46f){return _0x44a46f[_0xebf6('0x4a')]==_0x3101c2['id'];});return _0x13c447[_0xebf6('0x19')](0xc8)[_0xebf6('0x2f')]({'count':_0x39637b[_0xebf6('0x29')],'rows':_0x39637b});})[_0xebf6('0x22')](handleError(_0x13c447));};exports['conference']=function(_0x33c973,_0x193e5b){logger[_0xebf6('0x13')](_0xebf6('0x4b'),_0x33c973[_0xebf6('0x2e')]);var _0x537751=conferenceValidation[_0xebf6('0xd')](_0x33c973[_0xebf6('0x2e')]);if(_0x537751[_0xebf6('0x29')]>0x0){return _0x193e5b[_0xebf6('0x19')](0x190)[_0xebf6('0x2f')](_0x537751);}var _0x6c43e4=_0x33c973[_0xebf6('0x2e')][_0xebf6('0x30')];return getAgent(_0x6c43e4)[_0xebf6('0x1d')](function(_0x3debd2){logger[_0xebf6('0x13')]('entityFound:',_0x3debd2[_0xebf6('0x18')]);emit(util[_0xebf6('0x35')](_0xebf6('0x36'),_0x3debd2[_0xebf6('0x18')]),_0xebf6('0x4c'));return _0x193e5b[_0xebf6('0x19')](0xc8)['json']({'error':![],'message':_0xebf6('0x4d')});})['catch'](handleError(_0x193e5b));};exports[_0xebf6('0x4e')]=function(_0x34fa02,_0x10272b){logger[_0xebf6('0x13')](_0xebf6('0x4f'),_0x34fa02[_0xebf6('0x2e')]);var _0x398074=transferValidation['validate'](_0x34fa02['body']);if(_0x398074[_0xebf6('0x29')]>0x0){return _0x10272b[_0xebf6('0x19')](0x190)['json'](_0x398074);}var _0x3dc02c=_0x34fa02[_0xebf6('0x2e')]['userId'];var _0x3bee09=_0x34fa02[_0xebf6('0x2e')]['sessionId'];var _0x35a5c4=_0x34fa02[_0xebf6('0x2e')][_0xebf6('0x50')];return getAgent(_0x3dc02c)[_0xebf6('0x1d')](function(_0x345763){logger[_0xebf6('0x13')](_0xebf6('0x34'),_0x345763['name']);emit(util[_0xebf6('0x35')](_0xebf6('0x36'),_0x345763[_0xebf6('0x18')]),_0xebf6('0x51'),{'sessionId':_0x3bee09,'transferNumber':_0x35a5c4});return _0x10272b[_0xebf6('0x19')](0xc8)[_0xebf6('0x2f')]({'error':![],'message':_0xebf6('0x52')});})[_0xebf6('0x22')](handleError(_0x10272b));}; \ No newline at end of file +var _0xc3fe=['sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','validate','status','json','userId','callNumber','callbackUrl','format','user:%s','webbar:originate','hangup','hangup\x20fired:','entityFound:','webbar:hangup','hangup\x20executed!','answer','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','rows','conference','transfer','transferNumber','webbar:transfer','path','lodash','../../mysqldb','util','bluebird','jayson/promise','http','../../config/logger','webbarapi','defaults','redis','number','userId\x20is\x20required','string','callNumber\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','send','request','then','message','catch','findOne','agent','VoiceChannels','all','filter','UserId','sessionId','length'];(function(_0x4ae974,_0x3ce884){var _0x241a27=function(_0x39c3ee){while(--_0x39c3ee){_0x4ae974['push'](_0x4ae974['shift']());}};_0x241a27(++_0x3ce884);}(_0xc3fe,0xff));var _0xec3f=function(_0x28eae0,_0x4ed189){_0x28eae0=_0x28eae0-0x0;var _0x7f4d81=_0xc3fe[_0x28eae0];return _0x7f4d81;};'use strict';var path=require(_0xec3f('0x0'));var fs=require('fs');var _=require(_0xec3f('0x1'));var db=require(_0xec3f('0x2'))['db'];var config=require('../../config/environment');var util=require(_0xec3f('0x3'));var BPromise=require(_0xec3f('0x4'));var jayson=require(_0xec3f('0x5'));var amiClient=jayson['client'][_0xec3f('0x6')]({'port':0x232a});var logger=require(_0xec3f('0x7'))(_0xec3f('0x8'));var Redis=require('ioredis');config['redis']=_[_0xec3f('0x9')](config[_0xec3f('0xa')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xec3f('0xa')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xec3f('0xb'),'required':[!![],_0xec3f('0xc')]},'callNumber':{'type':_0xec3f('0xd'),'required':[!![],_0xec3f('0xe')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xec3f('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0xec3f('0xb'),'required':[!![],_0xec3f('0xc')]},'sessionId':{'type':_0xec3f('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xec3f('0xb'),'required':[!![],_0xec3f('0xc')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xec3f('0xb'),'required':[!![],_0xec3f('0xc')]},'sessionId':{'type':_0xec3f('0xd'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':'string','required':[!![],_0xec3f('0xf')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xec3f('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xec3f('0xb'),'required':[!![],_0xec3f('0xc')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xec3f('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xec3f('0xc')]}});function emit(_0x10ff81,_0x5bd7c0,_0x225edd){logger[_0xec3f('0x10')](_0x10ff81,_0x5bd7c0,JSON[_0xec3f('0x11')](_0x225edd));io['to'](_0x10ff81)[_0xec3f('0x12')](_0x5bd7c0,_0x225edd);}function handleError(_0x54d20c){return function(_0x7805c){console[_0xec3f('0x13')](_0xec3f('0x14'),_0x7805c,_0x7805c instanceof RangeError);logger[_0xec3f('0x15')](_0x7805c[_0xec3f('0x16')]);if(_0x7805c instanceof RangeError){if(_0x7805c['name']){delete _0x7805c[_0xec3f('0x17')];}_0x54d20c['status'](0x194)[_0xec3f('0x18')](_0x7805c);}else{if(_0x7805c[_0xec3f('0x17')]){delete _0x7805c[_0xec3f('0x17')];}_0x54d20c['status'](0x1f4)[_0xec3f('0x18')](_0x7805c);}};}function checkError(){return function(_0x21fda1){if(!_0x21fda1){throw new RangeError('NotFound');}return _0x21fda1;};}function respondWithRpcPromise(_0x35fc70,_0x317805){return new BPromise(function(_0x1f173f,_0x395b9a){var _0x4d9598=amiClient;return _0x4d9598[_0xec3f('0x19')](_0x35fc70,_0x317805)[_0xec3f('0x1a')](function(_0x2f45bb){if(_0x2f45bb['error']){if(_0x2f45bb[_0xec3f('0x15')]['code']===0x1f4){return _0x395b9a(_0x2f45bb[_0xec3f('0x15')]['message']);}return _0x1f173f(_0x2f45bb['error'][_0xec3f('0x1b')]);}else{_0x1f173f(_0x2f45bb['result']);}})[_0xec3f('0x1c')](function(_0xa12054){_0x395b9a(_0xa12054);});});}function getAgent(_0x31c7ff){return db['User'][_0xec3f('0x1d')]({'where':{'id':_0x31c7ff,'role':_0xec3f('0x1e')}})['then'](checkError());}function getAgentCheckSession(_0x53cc0d,_0x3e5244){return new BPromise(function(_0x48e166,_0x1300a8){var _0x1b3155=respondWithRpcPromise(_0xec3f('0x1f'));var _0x2eac8d=getAgent(_0x53cc0d);Promise[_0xec3f('0x20')]([_0x1b3155,_0x2eac8d])[_0xec3f('0x1a')](function(_0x2f2d15){var _0x237134=_0x2f2d15[0x0];var _0x56217e=_0x2f2d15[0x1];var _0x1c2a9c=_[_0xec3f('0x21')](_0x237134['rows'],function(_0x91c11a){return _0x91c11a[_0xec3f('0x22')]==_0x56217e['id']&&_0x91c11a[_0xec3f('0x23')]==_0x3e5244;});if(_0x1c2a9c[_0xec3f('0x24')]==0x1){_0x48e166(_0x56217e);}else{_0x1300a8(new RangeError(_0xec3f('0x25')+_0x3e5244+_0xec3f('0x26')));}});});}exports[_0xec3f('0x27')]=function(_0x29af36,_0x32a522){logger[_0xec3f('0x10')](_0xec3f('0x28'),_0x29af36[_0xec3f('0x29')]);var _0x3d95d4=originateValidation[_0xec3f('0x2a')](_0x29af36[_0xec3f('0x29')]);if(_0x3d95d4['length']>0x0){return _0x32a522[_0xec3f('0x2b')](0x190)[_0xec3f('0x2c')](_0x3d95d4);}var _0x37504a=_0x29af36[_0xec3f('0x29')][_0xec3f('0x2d')];var _0x598fdc=_0x29af36[_0xec3f('0x29')][_0xec3f('0x2e')];var _0x20b655=_0x29af36['body']['callerId'];var _0x1aded9=_0x29af36['body'][_0xec3f('0x2f')];return getAgent(_0x37504a)['then'](function(_0x131839){logger['info']('entityFound:',_0x131839[_0xec3f('0x17')]);emit(util[_0xec3f('0x30')](_0xec3f('0x31'),_0x131839[_0xec3f('0x17')]),_0xec3f('0x32'),{'callNumber':_0x598fdc,'callerId':_0x20b655,'callbackUrl':_0x1aded9});return _0x32a522[_0xec3f('0x2b')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})[_0xec3f('0x1c')](handleError(_0x32a522));};exports[_0xec3f('0x33')]=function(_0x3bff24,_0xbbb4f9){logger[_0xec3f('0x10')](_0xec3f('0x34'),_0x3bff24[_0xec3f('0x29')]);var _0x4bd7a5=hangupValidation[_0xec3f('0x2a')](_0x3bff24['body']);if(_0x4bd7a5[_0xec3f('0x24')]>0x0){return _0xbbb4f9[_0xec3f('0x2b')](0x190)[_0xec3f('0x2c')](_0x4bd7a5);}var _0x2d91db=_0x3bff24[_0xec3f('0x29')][_0xec3f('0x2d')];var _0x54fbb9=_0x3bff24[_0xec3f('0x29')][_0xec3f('0x23')];return getAgent(_0x2d91db)[_0xec3f('0x1a')](function(_0x38a9e3){logger[_0xec3f('0x10')](_0xec3f('0x35'),_0x38a9e3['name']);emit(util[_0xec3f('0x30')](_0xec3f('0x31'),_0x38a9e3['name']),_0xec3f('0x36'),{'sessionId':_0x54fbb9});return _0xbbb4f9[_0xec3f('0x2b')](0xc8)['json']({'error':![],'message':_0xec3f('0x37')});})[_0xec3f('0x1c')](handleError(_0xbbb4f9));};exports[_0xec3f('0x38')]=function(_0xe96e53,_0xef42fc){logger[_0xec3f('0x10')]('answer\x20fired:',_0xe96e53[_0xec3f('0x29')]);var _0x386e96=answerValidation[_0xec3f('0x2a')](_0xe96e53[_0xec3f('0x29')]);if(_0x386e96[_0xec3f('0x24')]>0x0){return _0xef42fc[_0xec3f('0x2b')](0x190)[_0xec3f('0x2c')](_0x386e96);}var _0x18c560=_0xe96e53[_0xec3f('0x29')]['userId'];var _0x8d0f18=_0xe96e53['body'][_0xec3f('0x23')];return getAgent(_0x18c560)[_0xec3f('0x1a')](function(_0x33beca){logger[_0xec3f('0x10')](_0xec3f('0x35'),_0x33beca[_0xec3f('0x17')]);emit(util[_0xec3f('0x30')](_0xec3f('0x31'),_0x33beca[_0xec3f('0x17')]),_0xec3f('0x39'),{'sessionId':_0x8d0f18});return _0xef42fc[_0xec3f('0x2b')](0xc8)[_0xec3f('0x2c')]({'error':![],'message':'answer\x20executed!'});})[_0xec3f('0x1c')](handleError(_0xef42fc));};exports[_0xec3f('0x3a')]=function(_0x531c21,_0x2e21c7){logger[_0xec3f('0x10')](_0xec3f('0x3b'),_0x531c21[_0xec3f('0x29')]);var _0x50039e=holdValidation['validate'](_0x531c21[_0xec3f('0x29')]);if(_0x50039e[_0xec3f('0x24')]>0x0){return _0x2e21c7['status'](0x190)[_0xec3f('0x2c')](_0x50039e);}var _0x28acd1=_0x531c21[_0xec3f('0x29')]['userId'];var _0x377ff7=_0x531c21['body']['sessionId'];return getAgent(_0x28acd1)['then'](function(_0x97c57d){logger[_0xec3f('0x10')](_0xec3f('0x35'),_0x97c57d[_0xec3f('0x17')]);emit(util['format'](_0xec3f('0x31'),_0x97c57d['name']),_0xec3f('0x3c'),{'sessionId':_0x377ff7});return _0x2e21c7[_0xec3f('0x2b')](0xc8)[_0xec3f('0x2c')]({'error':![],'message':_0xec3f('0x3d')});})[_0xec3f('0x1c')](handleError(_0x2e21c7));};exports[_0xec3f('0x3e')]=function(_0x515bf2,_0x2ab636){logger['info'](_0xec3f('0x3f'),_0x515bf2['body']);var _0x425d90=unholdValidation['validate'](_0x515bf2[_0xec3f('0x29')]);if(_0x425d90[_0xec3f('0x24')]>0x0){return _0x2ab636[_0xec3f('0x2b')](0x190)[_0xec3f('0x2c')](_0x425d90);}var _0x5603c8=_0x515bf2[_0xec3f('0x29')][_0xec3f('0x2d')];var _0x10eb47=_0x515bf2['body'][_0xec3f('0x23')];return getAgent(_0x5603c8)[_0xec3f('0x1a')](function(_0x4daab6){logger[_0xec3f('0x10')]('entityFound:',_0x4daab6[_0xec3f('0x17')]);emit(util['format'](_0xec3f('0x31'),_0x4daab6['name']),_0xec3f('0x40'),{'sessionId':_0x10eb47});return _0x2ab636['status'](0xc8)[_0xec3f('0x2c')]({'error':![],'message':_0xec3f('0x41')});})[_0xec3f('0x1c')](handleError(_0x2ab636));};exports[_0xec3f('0x42')]=function(_0x2c2b81,_0x24ca77){logger['info'](_0xec3f('0x43'),_0x24ca77['body']);var _0x13825e=callsValidation[_0xec3f('0x2a')](_0x2c2b81[_0xec3f('0x29')]);if(_0x13825e[_0xec3f('0x24')]>0x0){return _0x24ca77[_0xec3f('0x2b')](0x190)[_0xec3f('0x2c')](_0x13825e);}var _0x1a9073=_0x2c2b81['body'][_0xec3f('0x2d')];var _0x218682=respondWithRpcPromise(_0xec3f('0x1f'));var _0x2e56c8=getAgent(_0x1a9073);return Promise[_0xec3f('0x20')]([_0x218682,_0x2e56c8])[_0xec3f('0x1a')](function(_0x5269b7){var _0x31eb9f=_0x5269b7[0x0];var _0x2a5a1f=_0x5269b7[0x1];var _0x2dc0b8=_[_0xec3f('0x21')](_0x31eb9f[_0xec3f('0x44')],function(_0x59d4cd){return _0x59d4cd[_0xec3f('0x22')]==_0x2a5a1f['id'];});return _0x24ca77[_0xec3f('0x2b')](0xc8)[_0xec3f('0x2c')]({'count':_0x2dc0b8['length'],'rows':_0x2dc0b8});})[_0xec3f('0x1c')](handleError(_0x24ca77));};exports[_0xec3f('0x45')]=function(_0xced939,_0x5526f5){logger['info']('conference\x20fired:',_0xced939[_0xec3f('0x29')]);var _0x32ecf3=conferenceValidation[_0xec3f('0x2a')](_0xced939['body']);if(_0x32ecf3['length']>0x0){return _0x5526f5[_0xec3f('0x2b')](0x190)[_0xec3f('0x2c')](_0x32ecf3);}var _0xc69314=_0xced939[_0xec3f('0x29')][_0xec3f('0x2d')];return getAgent(_0xc69314)[_0xec3f('0x1a')](function(_0x4e4361){logger[_0xec3f('0x10')](_0xec3f('0x35'),_0x4e4361[_0xec3f('0x17')]);emit(util['format'](_0xec3f('0x31'),_0x4e4361['name']),'webbar:conference');return _0x5526f5[_0xec3f('0x2b')](0xc8)[_0xec3f('0x2c')]({'error':![],'message':'conference\x20executed!'});})[_0xec3f('0x1c')](handleError(_0x5526f5));};exports[_0xec3f('0x46')]=function(_0xfef5e8,_0x5247db){logger[_0xec3f('0x10')]('transfer\x20fired:',_0xfef5e8[_0xec3f('0x29')]);var _0x17ef99=transferValidation[_0xec3f('0x2a')](_0xfef5e8[_0xec3f('0x29')]);if(_0x17ef99['length']>0x0){return _0x5247db[_0xec3f('0x2b')](0x190)[_0xec3f('0x2c')](_0x17ef99);}var _0x557a8d=_0xfef5e8['body'][_0xec3f('0x2d')];var _0x27c38d=_0xfef5e8['body']['sessionId'];var _0x1f8041=_0xfef5e8[_0xec3f('0x29')][_0xec3f('0x47')];return getAgent(_0x557a8d)['then'](function(_0x53502c){logger[_0xec3f('0x10')](_0xec3f('0x35'),_0x53502c[_0xec3f('0x17')]);emit(util[_0xec3f('0x30')](_0xec3f('0x31'),_0x53502c[_0xec3f('0x17')]),_0xec3f('0x48'),{'sessionId':_0x27c38d,'transferNumber':_0x1f8041});return _0x5247db[_0xec3f('0x2b')](0xc8)[_0xec3f('0x2c')]({'error':![],'message':'transfer\x20executed!'});})[_0xec3f('0x1c')](handleError(_0x5247db));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 9caaf0a..ee00cfd 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(_0x50ef1e,_0x170bbc){var _0x38834d=function(_0x1b7f36){while(--_0x1b7f36){_0x50ef1e['push'](_0x50ef1e['shift']());}};_0x38834d(++_0x170bbc);}(_0x9f0e,0x116));var _0xe9f0=function(_0x3bce26,_0x3aa048){_0x3bce26=_0x3bce26-0x0;var _0x22aa30=_0x9f0e[_0x3bce26];return _0x22aa30;};'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 _0xda2d=['/:id','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','util','path','connect-timeout','express','Router','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addApplications','/:id/notify','notify','/:id/send','send','put','delete'];(function(_0xe63091,_0x4c2ea0){var _0x551016=function(_0x4d6f6f){while(--_0x4d6f6f){_0xe63091['push'](_0xe63091['shift']());}};_0x551016(++_0x4c2ea0);}(_0xda2d,0x102));var _0xdda2=function(_0x39fdb3,_0x27f519){_0x39fdb3=_0x39fdb3-0x0;var _0x7edcf2=_0xda2d[_0x39fdb3];return _0x7edcf2;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['get'](_0xdda2('0xd'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xe')]);router[_0xdda2('0x7')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xdda2('0x7')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x12')]);router[_0xdda2('0x13')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x14')]);router['post'](_0xdda2('0xd'),auth['isAuthenticated'](),controller[_0xdda2('0x15')]);router[_0xdda2('0x13')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x16')]);router['post']('/:id/users',auth[_0xdda2('0x8')](),controller['addAgents']);router[_0xdda2('0x13')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x17')]);router[_0xdda2('0x13')](_0xdda2('0x18'),controller[_0xdda2('0x19')]);router[_0xdda2('0x13')](_0xdda2('0x1a'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x1b')]);router[_0xdda2('0x1c')]('/:id',auth[_0xdda2('0x8')](),controller['update']);router[_0xdda2('0x1d')](_0xdda2('0x1e'),auth[_0xdda2('0x8')](),controller['destroy']);router[_0xdda2('0x1d')]('/:id/dispositions',auth[_0xdda2('0x8')](),controller[_0xdda2('0x1f')]);router['delete'](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x20')]);router[_0xdda2('0x1d')](_0xdda2('0x21'),auth['isAuthenticated'](),controller[_0xdda2('0x22')]);module[_0xdda2('0x23')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 83fe9ae..b8eb572 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 _0xa6b5=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','STRING','name','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x255aaf,_0x282056){var _0x145bd2=function(_0x6e8c61){while(--_0x6e8c61){_0x255aaf['push'](_0x255aaf['shift']());}};_0x145bd2(++_0x282056);}(_0xa6b5,0x67));var _0x5a6b=function(_0x3d9180,_0x1f97c9){_0x3d9180=_0x3d9180-0x0;var _0x55896d=_0xa6b5[_0x3d9180];return _0x55896d;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x5a6b('0x0')],'unique':_0x5a6b('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0x5a6b('0x0')],'allowNull':![]},'remote':{'type':Sequelize[_0x5a6b('0x0')],'allowNull':![]},'token':{'type':Sequelize[_0x5a6b('0x0')],'defaultValue':function(){return rs[_0x5a6b('0x2')]();}},'phone':{'type':Sequelize[_0x5a6b('0x0')]},'type':{'type':Sequelize[_0x5a6b('0x3')](_0x5a6b('0x4'),_0x5a6b('0x5'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x5a6b('0x0')]},'authToken':{'type':Sequelize[_0x5a6b('0x0')]},'notificationTemplate':{'type':Sequelize[_0x5a6b('0x6')],'defaultValue':function(){return _0x5a6b('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x5a6b('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5a6b('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5a6b('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x5a6b('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x5a6b('0xb'),'set':function(_0x1bf661){if(!_0x1bf661){this[_0x5a6b('0xc')]('mandatoryDispositionPauseId',null);}this[_0x5a6b('0xc')](_0x5a6b('0xd'),_0x1bf661);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x278f=['STRING','generate','ENUM','twilio','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name'];(function(_0xd4b4ce,_0x148799){var _0x44dc6f=function(_0x4e103c){while(--_0x4e103c){_0xd4b4ce['push'](_0xd4b4ce['shift']());}};_0x44dc6f(++_0x148799);}(_0x278f,0x6c));var _0xf278=function(_0x2fe8eb,_0x32c380){_0x2fe8eb=_0x2fe8eb-0x0;var _0x3d8bec=_0x278f[_0x2fe8eb];return _0x3d8bec;};'use strict';var Sequelize=require(_0xf278('0x0'));var rs=require(_0xf278('0x1'));module[_0xf278('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xf278('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xf278('0x4')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xf278('0x5')]();}},'phone':{'type':Sequelize[_0xf278('0x4')]},'type':{'type':Sequelize[_0xf278('0x6')](_0xf278('0x7'),'sinch')},'accountSid':{'type':Sequelize[_0xf278('0x4')]},'baseUrl':{'type':Sequelize[_0xf278('0x4')]},'authToken':{'type':Sequelize[_0xf278('0x4')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xf278('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xf278('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf278('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf278('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf278('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf278('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf278('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf278('0x9')],'comment':_0xf278('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xf278('0x8')],'defaultValue':![],'comment':_0xf278('0xb'),'set':function(_0x1921c4){if(!_0x1921c4){this[_0xf278('0xc')]('mandatoryDispositionPauseId',null);}this[_0xf278('0xc')](_0xf278('0xd'),_0x1921c4);}},'description':{'type':Sequelize[_0xf278('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 1c311fc..e59a1aa 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 _0x01c7=['mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','omit','interaction','autoclose','applications','push','close','*,*,*,*','created','AttachmentId','UserId','User','agent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','Content-Type','text/xml','body\x20is\x20mandatory\x20and\x20not\x20empty','List','WhatsappInteraction','out','Messages','dataValues','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','fs-extra','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','jayson/promise','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','sendStatus','end','status','json','limit','undefined','count','set','reject','save','destroy','WhatsappAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','create','user','get','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','length','order','Disposition','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','findAll','removeAnswers','addAgents','spread','emit','removeAgents','isArray','getAgents','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','message_id','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','type','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','notifications','from\x20is\x20mandatory','isNil','mapKey'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x01c7,0x1a3));var _0x701c=function(_0xb8c520,_0x5e59af){_0xb8c520=_0xb8c520-0x0;var _0x172c9a=_0x01c7[_0xb8c520];return _0x172c9a;};'use strict';var emlformat=require(_0x701c('0x0'));var rimraf=require(_0x701c('0x1'));var zipdir=require(_0x701c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x701c('0x3'));var BPromise=require(_0x701c('0x4'));var Mustache=require('mustache');var util=require(_0x701c('0x5'));var path=require(_0x701c('0x6'));var sox=require(_0x701c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x701c('0x8'));var _=require('lodash');var squel=require(_0x701c('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x701c('0xa'));var toCsv=require(_0x701c('0xb'));var querystring=require(_0x701c('0xc'));var Papa=require(_0x701c('0xd'));var Redis=require('ioredis');var authService=require(_0x701c('0xe'));var qs=require(_0x701c('0xf'));var as=require(_0x701c('0x10'));var hardwareService=require(_0x701c('0x11'));var logger=require(_0x701c('0x12'))(_0x701c('0x13'));var utils=require(_0x701c('0x14'));var config=require(_0x701c('0x15'));var licenseUtil=require(_0x701c('0x16'));var db=require('../../mysqldb')['db'];config[_0x701c('0x17')]=_[_0x701c('0x18')](config[_0x701c('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x701c('0x19'))(new Redis(config[_0x701c('0x17')]));require('./whatsappAccount.socket')[_0x701c('0x1a')](socket);var jayson=require(_0x701c('0x1b'));var client=jayson['client'][_0x701c('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x1c6d02,_0x5e32d1,_0x531f6f,_0x3e9c80){return new BPromise(function(_0x28ebef,_0x118fab){var _0x406add=_0x3e9c80||client;return _0x406add[_0x701c('0x1d')](_0x1c6d02,_0x531f6f)[_0x701c('0x1e')](function(_0x59f0d2){logger[_0x701c('0x1f')](_0x701c('0x20'),_0x5e32d1,_0x701c('0x21'));logger[_0x701c('0x22')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x5e32d1,_0x701c('0x21'),JSON['stringify'](_0x59f0d2));if(_0x59f0d2['error']){if(_0x59f0d2['error']['code']===0x1f4){logger[_0x701c('0x23')](_0x701c('0x20'),_0x5e32d1,_0x59f0d2[_0x701c('0x23')]['message']);return _0x118fab(_0x59f0d2[_0x701c('0x23')][_0x701c('0x24')]);}logger[_0x701c('0x23')](_0x701c('0x20'),_0x5e32d1,_0x59f0d2['error'][_0x701c('0x24')]);return _0x28ebef(_0x59f0d2[_0x701c('0x23')][_0x701c('0x24')]);}else{logger[_0x701c('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0x5e32d1,_0x701c('0x21'));_0x28ebef(_0x59f0d2[_0x701c('0x25')]['message']);}})['catch'](function(_0x23daa8){logger[_0x701c('0x23')](_0x701c('0x20'),_0x5e32d1,_0x23daa8);_0x118fab(_0x23daa8);});});}function respondWithStatusCode(_0x3d09fe,_0x1f6624){_0x1f6624=_0x1f6624||0xcc;return function(_0x3af0a5){if(_0x3af0a5){return _0x3d09fe[_0x701c('0x26')](_0x1f6624);}return _0x3d09fe['status'](_0x1f6624)[_0x701c('0x27')]();};}function respondWithResult(_0x51c9d4,_0x38cc02){_0x38cc02=_0x38cc02||0xc8;return function(_0x203ba7){if(_0x203ba7){return _0x51c9d4[_0x701c('0x28')](_0x38cc02)[_0x701c('0x29')](_0x203ba7);}};}function respondWithFilteredResult(_0x4677a6,_0x2bd23f){return function(_0x4f2ce4){if(_0x4f2ce4){var _0x17ef3b=typeof _0x2bd23f['offset']==='undefined'&&typeof _0x2bd23f[_0x701c('0x2a')]===_0x701c('0x2b');var _0x5b3d21=_0x4f2ce4['count'];var _0x482ce3=_0x17ef3b?0x0:_0x2bd23f['offset'];var _0x2e5c8a=_0x17ef3b?_0x4f2ce4[_0x701c('0x2c')]:_0x2bd23f['offset']+_0x2bd23f['limit'];var _0x1f6166;if(_0x2e5c8a>=_0x5b3d21){_0x2e5c8a=_0x5b3d21;_0x1f6166=0xc8;}else{_0x1f6166=0xce;}_0x4677a6[_0x701c('0x28')](_0x1f6166);return _0x4677a6[_0x701c('0x2d')]('Content-Range',_0x482ce3+'-'+_0x2e5c8a+'/'+_0x5b3d21)['json'](_0x4f2ce4);}return null;};}function patchUpdates(_0x3fee21){return function(_0x15f681){try{jsonpatch['apply'](_0x15f681,_0x3fee21,!![]);}catch(_0x483902){return BPromise[_0x701c('0x2e')](_0x483902);}return _0x15f681[_0x701c('0x2f')]();};}function saveUpdates(_0x4f449a,_0x37ae39){return function(_0x6a8f26){if(_0x6a8f26){return _0x6a8f26['update'](_0x4f449a)['then'](function(_0x12e037){return _0x12e037;});}return null;};}function removeEntity(_0x6cd52e,_0x2ee33f){return function(_0x4736f9){if(_0x4736f9){return _0x4736f9[_0x701c('0x30')]()[_0x701c('0x1e')](function(){var _0x2f1f69=_0x4736f9['get']({'plain':!![]});var _0x35a229=_0x701c('0x31');return db[_0x701c('0x32')]['destroy']({'where':{'type':_0x35a229,'resourceId':_0x2f1f69['id']}})[_0x701c('0x1e')](function(){return _0x4736f9;});})[_0x701c('0x1e')](function(){_0x6cd52e['status'](0xcc)[_0x701c('0x27')]();});}};}function handleEntityNotFound(_0x67d921,_0x45aab3){return function(_0x5eb182){if(!_0x5eb182){_0x67d921['sendStatus'](0x194);}return _0x5eb182;};}function handleError(_0x2f33f6,_0x16992d){_0x16992d=_0x16992d||0x1f4;return function(_0x127f29){logger[_0x701c('0x23')](_0x127f29['stack']);if(_0x127f29[_0x701c('0x33')]){delete _0x127f29[_0x701c('0x33')];}_0x2f33f6[_0x701c('0x28')](_0x16992d)[_0x701c('0x34')](_0x127f29);};}exports[_0x701c('0x35')]=function(_0x1d3181,_0x33fb90){var _0x42dc19={'include':[{'model':db[_0x701c('0x36')],'as':_0x701c('0x37')}]},_0x4938ce={},_0x29f44f={'count':0x0,'rows':[]};var _0x32e497=_[_0x701c('0x38')](db[_0x701c('0x39')][_0x701c('0x3a')],function(_0x10c71f){return{'name':_0x10c71f[_0x701c('0x3b')],'type':_0x10c71f['type']['key']};});_0x4938ce[_0x701c('0x3c')]=_['map'](_0x32e497,'name');_0x4938ce[_0x701c('0x3d')]=_[_0x701c('0x3e')](_0x1d3181[_0x701c('0x3d')]);_0x4938ce['filters']=_[_0x701c('0x3f')](_0x4938ce[_0x701c('0x3c')],_0x4938ce[_0x701c('0x3d')]);_0x42dc19[_0x701c('0x40')]=_['intersection'](_0x4938ce['model'],qs[_0x701c('0x41')](_0x1d3181['query'][_0x701c('0x41')]));_0x42dc19[_0x701c('0x40')]=_0x42dc19[_0x701c('0x40')]['length']?_0x42dc19[_0x701c('0x40')]:_0x4938ce['model'];if(!_0x1d3181['query'][_0x701c('0x42')](_0x701c('0x43'))){_0x42dc19[_0x701c('0x2a')]=qs[_0x701c('0x2a')](_0x1d3181['query']['limit']);_0x42dc19[_0x701c('0x44')]=qs[_0x701c('0x44')](_0x1d3181[_0x701c('0x3d')][_0x701c('0x44')]);}_0x42dc19['order']=qs['sort'](_0x1d3181[_0x701c('0x3d')][_0x701c('0x45')]);_0x42dc19[_0x701c('0x46')]=qs[_0x701c('0x47')](_[_0x701c('0x48')](_0x1d3181[_0x701c('0x3d')],_0x4938ce[_0x701c('0x47')]),_0x32e497);if(_0x1d3181[_0x701c('0x3d')]['filter']){_0x42dc19[_0x701c('0x46')]=_['merge'](_0x42dc19[_0x701c('0x46')],{'$or':_[_0x701c('0x38')](_0x32e497,function(_0x20aaec){if(_0x20aaec['type']!==_0x701c('0x49')){var _0x1e5d0b={};_0x1e5d0b[_0x20aaec[_0x701c('0x33')]]={'$like':'%'+_0x1d3181['query'][_0x701c('0x4a')]+'%'};return _0x1e5d0b;}})});}_0x42dc19=_[_0x701c('0x4b')]({},_0x42dc19,_0x1d3181[_0x701c('0x4c')]);var _0x44ccdd={'where':_0x42dc19[_0x701c('0x46')]};return db[_0x701c('0x39')]['count'](_0x44ccdd)[_0x701c('0x1e')](function(_0xa6e945){_0x29f44f[_0x701c('0x2c')]=_0xa6e945;if(_0x1d3181[_0x701c('0x3d')][_0x701c('0x4d')]){_0x42dc19[_0x701c('0x4e')]=[{'all':!![]}];}return db[_0x701c('0x39')]['findAll'](_0x42dc19);})[_0x701c('0x1e')](function(_0x1bf1e2){_0x29f44f[_0x701c('0x4f')]=_0x1bf1e2;return _0x29f44f;})[_0x701c('0x1e')](respondWithFilteredResult(_0x33fb90,_0x42dc19))[_0x701c('0x50')](handleError(_0x33fb90,null));};exports[_0x701c('0x51')]=function(_0x86755,_0x404368){var _0x2dcd2e={'raw':![],'where':{'id':_0x86755[_0x701c('0x52')]['id']},'include':[{'model':db[_0x701c('0x36')],'as':_0x701c('0x37')}]},_0x151c40={};_0x151c40[_0x701c('0x3c')]=_[_0x701c('0x3e')](db[_0x701c('0x39')][_0x701c('0x3a')]);_0x151c40[_0x701c('0x3d')]=_[_0x701c('0x3e')](_0x86755['query']);_0x151c40['filters']=_[_0x701c('0x3f')](_0x151c40[_0x701c('0x3c')],_0x151c40[_0x701c('0x3d')]);_0x2dcd2e[_0x701c('0x40')]=_[_0x701c('0x3f')](_0x151c40[_0x701c('0x3c')],qs[_0x701c('0x41')](_0x86755[_0x701c('0x3d')][_0x701c('0x41')]));_0x2dcd2e[_0x701c('0x40')]=_0x2dcd2e[_0x701c('0x40')]['length']?_0x2dcd2e[_0x701c('0x40')]:_0x151c40['model'];if(_0x86755[_0x701c('0x3d')][_0x701c('0x4d')]){_0x2dcd2e['include']=[{'all':!![]}];}_0x2dcd2e=_['merge']({},_0x2dcd2e,_0x86755[_0x701c('0x4c')]);return db['WhatsappAccount']['find'](_0x2dcd2e)[_0x701c('0x1e')](handleEntityNotFound(_0x404368,null))[_0x701c('0x1e')](respondWithResult(_0x404368,null))['catch'](handleError(_0x404368,null));};exports[_0x701c('0x53')]=function(_0x13485e,_0x788d56){return db['WhatsappAccount'][_0x701c('0x53')](_0x13485e['body'],{})['then'](function(_0x242718){var _0x5ccad0=_0x13485e[_0x701c('0x54')][_0x701c('0x55')]({'plain':!![]});if(!_0x5ccad0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ccad0[_0x701c('0x56')]===_0x701c('0x54')){var _0x44e642=_0x242718[_0x701c('0x55')]({'plain':!![]});var _0x2e24ce=_0x701c('0x31');return db[_0x701c('0x57')][_0x701c('0x58')]({'where':{'name':_0x2e24ce,'userProfileId':_0x5ccad0[_0x701c('0x59')]},'raw':!![]})['then'](function(_0x493fd8){if(_0x493fd8&&_0x493fd8[_0x701c('0x5a')]===0x0){return db[_0x701c('0x32')][_0x701c('0x53')]({'name':_0x44e642['name'],'resourceId':_0x44e642['id'],'type':_0x493fd8[_0x701c('0x33')],'sectionId':_0x493fd8['id']},{})[_0x701c('0x1e')](function(){return _0x242718;});}else{return _0x242718;}})[_0x701c('0x50')](function(_0xadc06){logger[_0x701c('0x23')](_0x701c('0x5b'),_0xadc06);throw _0xadc06;});}return _0x242718;})[_0x701c('0x1e')](respondWithResult(_0x788d56,0xc9))[_0x701c('0x50')](handleError(_0x788d56,null));};exports[_0x701c('0x5c')]=function(_0x3d4eda,_0x3918a8){if(_0x3d4eda[_0x701c('0x5d')]['id']){delete _0x3d4eda['body']['id'];}return db[_0x701c('0x39')][_0x701c('0x58')]({'where':{'id':_0x3d4eda[_0x701c('0x52')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x3918a8,null))[_0x701c('0x1e')](saveUpdates(_0x3d4eda[_0x701c('0x5d')],null))['then'](respondWithResult(_0x3918a8,null))['catch'](handleError(_0x3918a8,null));};exports[_0x701c('0x30')]=function(_0x5878b4,_0x1b64eb){return db[_0x701c('0x39')]['find']({'where':{'id':_0x5878b4['params']['id']}})[_0x701c('0x1e')](handleEntityNotFound(_0x1b64eb,null))[_0x701c('0x1e')](removeEntity(_0x1b64eb,null))[_0x701c('0x50')](handleError(_0x1b64eb,null));};exports[_0x701c('0x5e')]=function(_0x3b095f,_0x3f1eca){return db[_0x701c('0x39')][_0x701c('0x5e')]()[_0x701c('0x1e')](respondWithResult(_0x3f1eca,null))[_0x701c('0x50')](handleError(_0x3f1eca,null));};exports[_0x701c('0x5f')]=function(_0x55f46f,_0x2edad7,_0x46fd18){if(_0x55f46f[_0x701c('0x5d')]['id']){delete _0x55f46f[_0x701c('0x5d')]['id'];}return db[_0x701c('0x39')][_0x701c('0x58')]({'where':{'id':_0x55f46f['params']['id']}})[_0x701c('0x1e')](handleEntityNotFound(_0x2edad7,null))['then'](function(_0x53e400){if(_0x53e400){_0x55f46f['body'][_0x701c('0x60')]=_0x53e400['id'];return db['Disposition'][_0x701c('0x53')](_0x55f46f[_0x701c('0x5d')]);}})[_0x701c('0x1e')](respondWithResult(_0x2edad7,null))['catch'](handleError(_0x2edad7,null));};exports[_0x701c('0x61')]=function(_0x4da340,_0x303b44,_0x1e7379){var _0x6a301={'raw':![],'where':{}};var _0x3e9a8e={};var _0x579ac2={'count':0x0,'rows':[]};return db[_0x701c('0x39')][_0x701c('0x62')]({'where':{'id':_0x4da340[_0x701c('0x52')]['id']}})[_0x701c('0x1e')](handleEntityNotFound(_0x303b44,null))[_0x701c('0x1e')](function(_0x33115c){if(_0x33115c){_0x3e9a8e[_0x701c('0x3c')]=_[_0x701c('0x3e')](db['Disposition']['rawAttributes']);_0x3e9a8e[_0x701c('0x3d')]=_['keys'](_0x4da340[_0x701c('0x3d')]);_0x3e9a8e['filters']=_['intersection'](_0x3e9a8e[_0x701c('0x3c')],_0x3e9a8e[_0x701c('0x3d')]);_0x6a301[_0x701c('0x40')]=_[_0x701c('0x3f')](_0x3e9a8e['model'],qs[_0x701c('0x41')](_0x4da340[_0x701c('0x3d')][_0x701c('0x41')]));_0x6a301[_0x701c('0x40')]=_0x6a301[_0x701c('0x40')][_0x701c('0x63')]?_0x6a301[_0x701c('0x40')]:_0x3e9a8e['model'];if(!_0x4da340[_0x701c('0x3d')][_0x701c('0x42')]('nolimit')){_0x6a301[_0x701c('0x2a')]=qs[_0x701c('0x2a')](_0x4da340[_0x701c('0x3d')][_0x701c('0x2a')]);_0x6a301[_0x701c('0x44')]=qs[_0x701c('0x44')](_0x4da340['query']['offset']);}_0x6a301[_0x701c('0x64')]=qs[_0x701c('0x45')](_0x4da340[_0x701c('0x3d')][_0x701c('0x45')]);_0x6a301['where']=qs[_0x701c('0x47')](_['pick'](_0x4da340['query'],_0x3e9a8e[_0x701c('0x47')]));_0x6a301[_0x701c('0x46')]['WhatsappAccountId']=_0x33115c['id'];if(_0x4da340[_0x701c('0x3d')][_0x701c('0x4a')]){_0x6a301['where']=_[_0x701c('0x4b')](_0x6a301[_0x701c('0x46')],{'$or':_[_0x701c('0x38')](_0x6a301[_0x701c('0x40')],function(_0x515475){var _0x30d7b3={};_0x30d7b3[_0x515475]={'$like':'%'+_0x4da340[_0x701c('0x3d')]['filter']+'%'};return _0x30d7b3;})});}_0x6a301=_['merge']({},_0x6a301,_0x4da340[_0x701c('0x4c')]);return db[_0x701c('0x65')][_0x701c('0x2c')]({'where':_0x6a301['where']})[_0x701c('0x1e')](function(_0x3df3cf){_0x579ac2['count']=_0x3df3cf;if(_0x4da340[_0x701c('0x3d')][_0x701c('0x4d')]){_0x6a301[_0x701c('0x4e')]=[{'all':!![]}];}return db[_0x701c('0x65')]['findAll'](_0x6a301);})[_0x701c('0x1e')](function(_0x4451f3){_0x579ac2['rows']=_0x4451f3;return _0x579ac2;});}})['then'](respondWithFilteredResult(_0x303b44,_0x6a301))[_0x701c('0x50')](handleError(_0x303b44,null));};exports[_0x701c('0x66')]=function(_0x49c378,_0x525606,_0x4083ed){return db[_0x701c('0x39')][_0x701c('0x58')]({'where':{'id':_0x49c378['params']['id']}})[_0x701c('0x1e')](handleEntityNotFound(_0x525606,null))[_0x701c('0x1e')](function(_0x33603c){if(_0x33603c){return _0x33603c[_0x701c('0x66')](_0x49c378['query'][_0x701c('0x67')]);}})[_0x701c('0x1e')](respondWithStatusCode(_0x525606,null))[_0x701c('0x50')](handleError(_0x525606,null));};exports[_0x701c('0x68')]=function(_0x24654c,_0x807d6c,_0x202b95){if(_0x24654c[_0x701c('0x5d')]['id']){delete _0x24654c[_0x701c('0x5d')]['id'];}return db[_0x701c('0x39')][_0x701c('0x58')]({'where':{'id':_0x24654c[_0x701c('0x52')]['id']}})[_0x701c('0x1e')](handleEntityNotFound(_0x807d6c,null))[_0x701c('0x1e')](function(_0xe87abb){if(_0xe87abb){_0x24654c[_0x701c('0x5d')][_0x701c('0x60')]=_0xe87abb['id'];return db['CannedAnswer'][_0x701c('0x53')](_0x24654c[_0x701c('0x5d')]);}})[_0x701c('0x1e')](respondWithResult(_0x807d6c,null))['catch'](handleError(_0x807d6c,null));};exports[_0x701c('0x69')]=function(_0x681408,_0x289427,_0x1d53e0){var _0x489bbe={'raw':![],'where':{}};var _0x3a2b42={};var _0x4f7ef1={'count':0x0,'rows':[]};return db[_0x701c('0x39')][_0x701c('0x62')]({'where':{'id':_0x681408[_0x701c('0x52')]['id']}})['then'](handleEntityNotFound(_0x289427,null))['then'](function(_0x26aa50){if(_0x26aa50){_0x3a2b42[_0x701c('0x3c')]=_[_0x701c('0x3e')](db['CannedAnswer'][_0x701c('0x3a')]);_0x3a2b42['query']=_[_0x701c('0x3e')](_0x681408[_0x701c('0x3d')]);_0x3a2b42[_0x701c('0x47')]=_[_0x701c('0x3f')](_0x3a2b42[_0x701c('0x3c')],_0x3a2b42[_0x701c('0x3d')]);_0x489bbe[_0x701c('0x40')]=_['intersection'](_0x3a2b42[_0x701c('0x3c')],qs[_0x701c('0x41')](_0x681408[_0x701c('0x3d')][_0x701c('0x41')]));_0x489bbe['attributes']=_0x489bbe['attributes'][_0x701c('0x63')]?_0x489bbe['attributes']:_0x3a2b42[_0x701c('0x3c')];if(!_0x681408[_0x701c('0x3d')][_0x701c('0x42')]('nolimit')){_0x489bbe[_0x701c('0x2a')]=qs['limit'](_0x681408[_0x701c('0x3d')][_0x701c('0x2a')]);_0x489bbe[_0x701c('0x44')]=qs[_0x701c('0x44')](_0x681408[_0x701c('0x3d')][_0x701c('0x44')]);}_0x489bbe[_0x701c('0x64')]=qs['sort'](_0x681408[_0x701c('0x3d')][_0x701c('0x45')]);_0x489bbe[_0x701c('0x46')]=qs[_0x701c('0x47')](_[_0x701c('0x48')](_0x681408[_0x701c('0x3d')],_0x3a2b42[_0x701c('0x47')]));_0x489bbe['where'][_0x701c('0x60')]=_0x26aa50['id'];if(_0x681408[_0x701c('0x3d')]['filter']){_0x489bbe['where']=_[_0x701c('0x4b')](_0x489bbe[_0x701c('0x46')],{'$or':_[_0x701c('0x38')](_0x489bbe['attributes'],function(_0x1de7e2){var _0x40d8f1={};_0x40d8f1[_0x1de7e2]={'$like':'%'+_0x681408['query'][_0x701c('0x4a')]+'%'};return _0x40d8f1;})});}_0x489bbe=_[_0x701c('0x4b')]({},_0x489bbe,_0x681408[_0x701c('0x4c')]);return db[_0x701c('0x6a')][_0x701c('0x2c')]({'where':_0x489bbe[_0x701c('0x46')]})['then'](function(_0x12087f){_0x4f7ef1[_0x701c('0x2c')]=_0x12087f;if(_0x681408['query'][_0x701c('0x4d')]){_0x489bbe['include']=[{'all':!![]}];}return db[_0x701c('0x6a')][_0x701c('0x6b')](_0x489bbe);})['then'](function(_0x4f0800){_0x4f7ef1['rows']=_0x4f0800;return _0x4f7ef1;});}})['then'](respondWithFilteredResult(_0x289427,_0x489bbe))[_0x701c('0x50')](handleError(_0x289427,null));};exports[_0x701c('0x6c')]=function(_0x44093c,_0x40bb45,_0x1ea1d0){return db[_0x701c('0x39')][_0x701c('0x58')]({'where':{'id':_0x44093c[_0x701c('0x52')]['id']}})[_0x701c('0x1e')](handleEntityNotFound(_0x40bb45,null))['then'](function(_0x260680){if(_0x260680){return _0x260680[_0x701c('0x6c')](_0x44093c[_0x701c('0x3d')][_0x701c('0x67')]);}})[_0x701c('0x1e')](respondWithStatusCode(_0x40bb45,null))[_0x701c('0x50')](handleError(_0x40bb45,null));};exports[_0x701c('0x6d')]=function(_0x1c0604,_0x204e01,_0x249af0){return db['WhatsappAccount'][_0x701c('0x58')]({'where':{'id':_0x1c0604[_0x701c('0x52')]['id']}})[_0x701c('0x1e')](handleEntityNotFound(_0x204e01,null))[_0x701c('0x1e')](function(_0x33fd90){if(_0x33fd90){return _0x33fd90[_0x701c('0x6d')](_0x1c0604['body'][_0x701c('0x67')],_['omit'](_0x1c0604['body'],[_0x701c('0x67'),'id'])||{})[_0x701c('0x6e')](function(_0x1f7026){for(var _0x48d683=0x0;_0x48d683<_0x1c0604[_0x701c('0x5d')][_0x701c('0x67')]['length'];_0x48d683+=0x1){socket[_0x701c('0x6f')]('userWhatsappAccount:save',{'UserId':Number(_0x1c0604[_0x701c('0x5d')]['ids'][_0x48d683]),'WhatsappAccountId':Number(_0x1c0604[_0x701c('0x52')]['id'])});}return _0x1f7026;});}})[_0x701c('0x1e')](respondWithResult(_0x204e01,null))[_0x701c('0x50')](handleError(_0x204e01,null));};exports[_0x701c('0x70')]=function(_0x3f55b1,_0x1acb79,_0x15c7f8){return db[_0x701c('0x39')][_0x701c('0x58')]({'where':{'id':_0x3f55b1[_0x701c('0x52')]['id']}})['then'](handleEntityNotFound(_0x1acb79,null))['then'](function(_0x3d3d2b){if(_0x3d3d2b){return _0x3d3d2b[_0x701c('0x70')](_0x3f55b1['query'][_0x701c('0x67')])['then'](function(){if(_[_0x701c('0x71')](_0x3f55b1[_0x701c('0x3d')][_0x701c('0x67')])){for(var _0x368b0b=0x0;_0x368b0b<_0x3f55b1[_0x701c('0x3d')][_0x701c('0x67')][_0x701c('0x63')];_0x368b0b+=0x1){socket[_0x701c('0x6f')]('userWhatsappAccount:remove',{'UserId':Number(_0x3f55b1[_0x701c('0x3d')]['ids'][_0x368b0b]),'WhatsappAccountId':Number(_0x3f55b1[_0x701c('0x52')]['id'])});}}else{socket[_0x701c('0x6f')]('userWhatsappAccount:remove',{'UserId':Number(_0x3f55b1[_0x701c('0x3d')]['ids']),'WhatsappAccountId':Number(_0x3f55b1['params']['id'])});}});}})[_0x701c('0x1e')](respondWithStatusCode(_0x1acb79,null))['catch'](handleError(_0x1acb79,null));};exports[_0x701c('0x72')]=function(_0xea54ab,_0x1d3b36,_0x5e4f86){var _0x5d7c07={};var _0x3e014d={};var _0x23b7d7;var _0x188897;return db[_0x701c('0x39')][_0x701c('0x62')]({'where':{'id':_0xea54ab[_0x701c('0x52')]['id']}})[_0x701c('0x1e')](handleEntityNotFound(_0x1d3b36,null))[_0x701c('0x1e')](function(_0x5922ef){if(_0x5922ef){_0x23b7d7=_0x5922ef;_0x3e014d[_0x701c('0x3c')]=_[_0x701c('0x3e')](db['User']['rawAttributes']);_0x3e014d[_0x701c('0x3d')]=_['keys'](_0xea54ab[_0x701c('0x3d')]);_0x3e014d['filters']=_['intersection'](_0x3e014d['model'],_0x3e014d[_0x701c('0x3d')]);_0x5d7c07[_0x701c('0x40')]=_[_0x701c('0x3f')](_0x3e014d[_0x701c('0x3c')],qs[_0x701c('0x41')](_0xea54ab['query'][_0x701c('0x41')]));_0x5d7c07[_0x701c('0x40')]=_0x5d7c07['attributes']['length']?_0x5d7c07['attributes']:_0x3e014d[_0x701c('0x3c')];_0x5d7c07[_0x701c('0x64')]=qs[_0x701c('0x45')](_0xea54ab[_0x701c('0x3d')][_0x701c('0x45')]);_0x5d7c07[_0x701c('0x46')]=qs['filters'](_[_0x701c('0x48')](_0xea54ab['query'],_0x3e014d[_0x701c('0x47')]));if(_0xea54ab[_0x701c('0x3d')][_0x701c('0x4a')]){_0x5d7c07['where']=_['merge'](_0x5d7c07[_0x701c('0x46')],{'$or':_[_0x701c('0x38')](_0x5d7c07[_0x701c('0x40')],function(_0x1dd7fb){var _0x15b794={};_0x15b794[_0x1dd7fb]={'$like':'%'+_0xea54ab[_0x701c('0x3d')][_0x701c('0x4a')]+'%'};return _0x15b794;})});}_0x5d7c07=_[_0x701c('0x4b')]({},_0x5d7c07,_0xea54ab[_0x701c('0x4c')]);return _0x23b7d7['getAgents'](_0x5d7c07);}})[_0x701c('0x1e')](function(_0x5e4a25){if(_0x5e4a25){_0x188897=_0x5e4a25['length'];if(!_0xea54ab[_0x701c('0x3d')][_0x701c('0x42')](_0x701c('0x43'))){_0x5d7c07['limit']=qs[_0x701c('0x2a')](_0xea54ab[_0x701c('0x3d')][_0x701c('0x2a')]);_0x5d7c07[_0x701c('0x44')]=qs['offset'](_0xea54ab[_0x701c('0x3d')][_0x701c('0x44')]);}return _0x23b7d7['getAgents'](_0x5d7c07);}})[_0x701c('0x1e')](function(_0x38e60a){if(_0x38e60a){return _0x38e60a?{'count':_0x188897,'rows':_0x38e60a}:null;}})[_0x701c('0x1e')](respondWithResult(_0x1d3b36,null))[_0x701c('0x50')](handleError(_0x1d3b36,null));};exports[_0x701c('0x73')]=function(_0x326e75,_0x583b5d){var _0x58c476=_0x326e75[_0x701c('0x52')]['id'];var _0x2e6b0e=_0x326e75[_0x701c('0x5d')];var _0xfa0081=0xc8;var _0x20c2c5=null;return db['sequelize'][_0x701c('0x74')]({'isolationLevel':db[_0x701c('0x75')]['Transaction'][_0x701c('0x76')][_0x701c('0x77')]},function(_0x5aa8f9){return db[_0x701c('0x39')][_0x701c('0x62')]({'where':{'id':_0x58c476},'transaction':_0x5aa8f9})[_0x701c('0x1e')](function(_0x124684){if(_0x124684){return db[_0x701c('0x78')][_0x701c('0x30')]({'where':{'WhatsappAccountId':_0x58c476},'transaction':_0x5aa8f9})[_0x701c('0x1e')](function(){var _0x123e46=_[_0x701c('0x38')](_0x2e6b0e,function(_0x5bcddb){_0x5bcddb[_0x701c('0x60')]=_0x58c476;return _0x5bcddb;});return db['WhatsappApplication'][_0x701c('0x79')](_0x123e46,{'transaction':_0x5aa8f9});});}else{_0xfa0081=0x194;_0x20c2c5=[];}});})['then'](function(){if(_0xfa0081!==0x194){return db[_0x701c('0x78')][_0x701c('0x7a')]({'where':{'WhatsappAccountId':_0x58c476},'order':_0x701c('0x7b')})[_0x701c('0x1e')](function(_0x3892ab){_0x20c2c5=_0x3892ab;});}})['catch'](function(_0x4fb064){_0xfa0081=0x1f4;logger[_0x701c('0x23')](_0x4fb064[_0x701c('0x7c')]);if(_0x4fb064['name']){delete _0x4fb064[_0x701c('0x33')];}_0x20c2c5=_0x4fb064;})[_0x701c('0x7d')](function(){if(_0x20c2c5===null){_0x583b5d['sendStatus'](_0xfa0081);}else{if(_0xfa0081===0x1f4){_0x583b5d[_0x701c('0x28')](_0xfa0081)[_0x701c('0x34')](_0x20c2c5);}else{_0x583b5d['status'](_0xfa0081)['json'](_0x20c2c5);}}});};exports[_0x701c('0x7e')]=function(_0x24023e,_0x1db6eb,_0x4906d3){var _0x4a1e6d={};var _0x31ebfb={};var _0x5cb1d5;var _0x543ff0;return db[_0x701c('0x39')][_0x701c('0x62')]({'where':{'id':_0x24023e[_0x701c('0x52')]['id']}})[_0x701c('0x1e')](handleEntityNotFound(_0x1db6eb,null))[_0x701c('0x1e')](function(_0x433867){if(_0x433867){_0x5cb1d5=_0x433867;_0x31ebfb[_0x701c('0x3c')]=_[_0x701c('0x3e')](db[_0x701c('0x78')][_0x701c('0x3a')]);_0x31ebfb[_0x701c('0x3d')]=_['keys'](_0x24023e[_0x701c('0x3d')]);_0x31ebfb[_0x701c('0x47')]=_[_0x701c('0x3f')](_0x31ebfb[_0x701c('0x3c')],_0x31ebfb[_0x701c('0x3d')]);_0x4a1e6d[_0x701c('0x40')]=_[_0x701c('0x3f')](_0x31ebfb[_0x701c('0x3c')],qs[_0x701c('0x41')](_0x24023e[_0x701c('0x3d')]['fields']));_0x4a1e6d[_0x701c('0x40')]=_0x4a1e6d[_0x701c('0x40')]['length']?_0x4a1e6d[_0x701c('0x40')]:_0x31ebfb['model'];_0x4a1e6d[_0x701c('0x64')]=qs[_0x701c('0x45')](_0x24023e[_0x701c('0x3d')][_0x701c('0x45')]);_0x4a1e6d[_0x701c('0x46')]=qs['filters'](_[_0x701c('0x48')](_0x24023e[_0x701c('0x3d')],_0x31ebfb[_0x701c('0x47')]));if(_0x24023e[_0x701c('0x3d')][_0x701c('0x4a')]){_0x4a1e6d['where']=_[_0x701c('0x4b')](_0x4a1e6d[_0x701c('0x46')],{'$or':_[_0x701c('0x38')](_0x4a1e6d[_0x701c('0x40')],function(_0x145bf9){var _0x1559f2={};_0x1559f2[_0x145bf9]={'$like':'%'+_0x24023e[_0x701c('0x3d')]['filter']+'%'};return _0x1559f2;})});}_0x4a1e6d=_[_0x701c('0x4b')]({},_0x4a1e6d,_0x24023e[_0x701c('0x4c')]);return _0x5cb1d5[_0x701c('0x7e')](_0x4a1e6d);}})[_0x701c('0x1e')](function(_0x509531){if(_0x509531){_0x543ff0=_0x509531[_0x701c('0x63')];if(!_0x24023e[_0x701c('0x3d')][_0x701c('0x42')](_0x701c('0x43'))){_0x4a1e6d['limit']=qs[_0x701c('0x2a')](_0x24023e[_0x701c('0x3d')][_0x701c('0x2a')]);_0x4a1e6d[_0x701c('0x44')]=qs[_0x701c('0x44')](_0x24023e[_0x701c('0x3d')][_0x701c('0x44')]);}return _0x5cb1d5['getApplications'](_0x4a1e6d);}})[_0x701c('0x1e')](function(_0x3fd182){if(_0x3fd182){return _0x3fd182?{'count':_0x543ff0,'rows':_0x3fd182}:null;}})[_0x701c('0x1e')](respondWithResult(_0x1db6eb,null))[_0x701c('0x50')](handleError(_0x1db6eb,null));};exports['notify']=function(_0x2cfb8c,_0x332454,_0x5eabcc){var _0x45f5c9={'channel':_0x701c('0x7f')};var _0x47614d=[];var _0x4c8161=[];var _0x339d88={};return db[_0x701c('0x39')][_0x701c('0x58')]({'where':{'id':_0x2cfb8c[_0x701c('0x52')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x701c('0x80')}]})[_0x701c('0x1e')](handleEntityNotFound(_0x332454,null))[_0x701c('0x1e')](function(_0x220dcd){_0x45f5c9[_0x701c('0x81')]=_0x220dcd;if(_0x45f5c9[_0x701c('0x81')]&&_0x45f5c9[_0x701c('0x81')]['type']===_0x701c('0x82')&&_0x2cfb8c['body'][_0x701c('0x83')]){if(_0x2cfb8c['body'][_0x701c('0x83')][_0x701c('0x63')]===0x0)return;if(_0x2cfb8c[_0x701c('0x5d')][_0x701c('0x83')][0x0][_0x701c('0x84')]!==_0x701c('0x85'))return;return db[_0x701c('0x86')]['update']({'read':!![],'readAt':_0x2cfb8c[_0x701c('0x5d')][_0x701c('0x83')][0x0]['timestamp']},{'where':{'messageId':_0x2cfb8c[_0x701c('0x5d')][_0x701c('0x83')][0x0][_0x701c('0x87')]},'individualHooks':!![]})[_0x701c('0x1e')](function(_0x7a19f4){return _0x332454[_0x701c('0x28')](0xc8)[_0x701c('0x29')](_0x7a19f4);});}_0x45f5c9['applications']=_[_0x701c('0x88')](_0x220dcd[_0x701c('0x80')],['priority'],[_0x701c('0x89')]);if(_0x45f5c9['account']['Applications']){delete _0x45f5c9['account'][_0x701c('0x80')];}return db[_0x701c('0x8a')][_0x701c('0x5e')]()[_0x701c('0x1e')](function(_0x43aca9){if(!_0x43aca9){throw new db[(_0x701c('0x8b'))][(_0x701c('0x8c'))](_0x701c('0x8d'));}_0x47614d=_['difference'](_['keys'](_0x43aca9),[_0x701c('0x8e'),_0x701c('0x8f')]);_0x4c8161=_[_0x701c('0x90')](_[_0x701c('0x3e')](_0x43aca9),['createdAt','updatedAt',_0x701c('0x91'),_0x701c('0x92')]);_0x45f5c9['body']={'mapKey':'mobile'};if(_0x45f5c9[_0x701c('0x81')]&&_0x45f5c9[_0x701c('0x81')][_0x701c('0x93')]===_0x701c('0x94')){_0x45f5c9[_0x701c('0x5d')][_0x701c('0x95')]=_0x2cfb8c[_0x701c('0x5d')][_0x701c('0x96')][_0x701c('0x97')](_0x701c('0x98'),'');_0x45f5c9[_0x701c('0x5d')][_0x701c('0x5d')]=_0x2cfb8c[_0x701c('0x5d')][_0x701c('0x99')];_0x45f5c9[_0x701c('0x5d')][_0x701c('0x9a')]=_0x2cfb8c[_0x701c('0x5d')][_0x701c('0x9b')];}if(_0x45f5c9[_0x701c('0x81')]&&_0x45f5c9[_0x701c('0x81')][_0x701c('0x93')]==='sinch'){_0x45f5c9[_0x701c('0x5d')][_0x701c('0x95')]=_0x2cfb8c[_0x701c('0x5d')][_0x701c('0x9c')][0x0][_0x701c('0x95')];_0x45f5c9[_0x701c('0x5d')][_0x701c('0x5d')]=_0x2cfb8c[_0x701c('0x5d')][_0x701c('0x9c')][0x0][_0x701c('0x24')][_0x701c('0x5d')];_0x45f5c9[_0x701c('0x5d')][_0x701c('0x9a')]=_0x2cfb8c[_0x701c('0x5d')][_0x701c('0x9c')][0x0]['message_id'];}if(_0x45f5c9[_0x701c('0x5d')]['id']){delete _0x45f5c9['body']['id'];}if(_['isNil'](_0x45f5c9[_0x701c('0x5d')][_0x701c('0x95')])){throw new db[(_0x701c('0x8b'))][(_0x701c('0x8c'))](_0x701c('0x9d'));}if(_[_0x701c('0x9e')](_0x45f5c9[_0x701c('0x5d')][_0x701c('0x5d')])||_0x45f5c9['body'][_0x701c('0x5d')]===''){throw new db[(_0x701c('0x8b'))][(_0x701c('0x8c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x45f5c9['body'][_0x701c('0x9f')])){throw new db[(_0x701c('0x8b'))][(_0x701c('0x8c'))](_0x701c('0xa0')+_0x4c8161);}if(!_[_0x701c('0xa1')](_0x4c8161,_0x45f5c9[_0x701c('0x5d')][_0x701c('0x9f')])){throw new db[(_0x701c('0x8b'))]['ValidationError'](_0x701c('0xa2')+_0x4c8161);}_0x339d88[_0x45f5c9[_0x701c('0x5d')][_0x701c('0x9f')]]=_0x45f5c9[_0x701c('0x5d')]['from'];return db['CmList'][_0x701c('0x58')]({'where':{'id':_0x45f5c9[_0x701c('0x81')][_0x701c('0x92')]},'include':[{'model':db[_0x701c('0x8a')],'as':_0x701c('0xa3'),'where':_0x339d88,'limit':0x1,'order':[[_0x701c('0x8f'),_0x701c('0xa4')]]}]});})[_0x701c('0x1e')](handleEntityNotFound(_0x332454,null))['then'](function(_0x36eeca){if(_0x36eeca){_0x45f5c9[_0x701c('0xa5')]=_[_0x701c('0xa6')](_0x36eeca,[_0x701c('0xa3')]);if(_0x36eeca[_0x701c('0xa3')][_0x701c('0x63')]){return _0x36eeca[_0x701c('0xa3')][0x0];}var _0x407d7d=_[_0x701c('0x18')](_0x45f5c9['body'],{'firstName':_0x45f5c9[_0x701c('0x5d')]['from'],'ListId':_0x36eeca['id']});_0x407d7d[_0x45f5c9[_0x701c('0x5d')]['mapKey']]=_0x45f5c9['body'][_0x701c('0x95')];return db[_0x701c('0x8a')][_0x701c('0x53')](_0x407d7d,{'fields':_0x47614d,'raw':!![]});}})['then'](handleEntityNotFound(_0x332454,null))['then'](function(_0x23b562){if(_0x23b562){_0x45f5c9['contact']=_0x23b562;var _0x3ef709={'ContactId':_0x23b562['id'],'phone':_0x45f5c9[_0x701c('0x5d')]['from'],'WhatsappAccountId':_0x2cfb8c[_0x701c('0x52')]['id']};var _0x58c528={'ContactId':_0x23b562['id'],'WhatsappAccountId':_0x2cfb8c['params']['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x58c528})[_0x701c('0x1e')](function(_0x2dbb46){if(_0x2dbb46){return[_0x2dbb46,![]];}return db['WhatsappInteraction']['create'](_0x3ef709)[_0x701c('0x1e')](function(_0x12375a){return[_0x12375a,!![]];});});}})[_0x701c('0x6e')](function(_0x13d0bd,_0x33aff1){_0x45f5c9[_0x701c('0xa7')]=_0x13d0bd[_0x701c('0x55')]({'plain':!![]});_0x45f5c9[_0x701c('0xa7')]['created']=![];if(_0x33aff1){if(_0x45f5c9[_0x701c('0x81')][_0x701c('0xa8')]){_0x45f5c9[_0x701c('0xa9')][_0x701c('0xaa')]({'id':0x0,'priority':_0x45f5c9[_0x701c('0xa9')]['length']+0x1,'app':_0x701c('0xab'),'appdata':'unmanaged','interval':_0x701c('0xac')});}_0x45f5c9[_0x701c('0xa7')][_0x701c('0xad')]=!![];}return db[_0x701c('0x86')][_0x701c('0x53')]({'phone':_0x45f5c9['body'][_0x701c('0x95')],'messageId':_0x45f5c9['body'][_0x701c('0x9a')],'body':_0x45f5c9[_0x701c('0x5d')][_0x701c('0x5d')],'WhatsappAccountId':_0x2cfb8c[_0x701c('0x52')]['id'],'WhatsappInteractionId':_0x13d0bd['id'],'direction':'in','ContactId':_0x13d0bd['ContactId'],'AttachmentId':_0x45f5c9[_0x701c('0x5d')][_0x701c('0xae')]});})[_0x701c('0x1e')](function(_0xffb532){_0x45f5c9[_0x701c('0x24')]=_0xffb532;if(_0x45f5c9['interaction'][_0x701c('0xaf')]){return db[_0x701c('0xb0')]['find']({'attributes':['id',_0x701c('0x33')],'where':{'id':_0x45f5c9[_0x701c('0xa7')]['UserId']}})[_0x701c('0x1e')](function(_0x47aaf3){if(_0x47aaf3){_0x45f5c9[_0x701c('0xa9')]['unshift']({'id':0x0,'priority':0x0,'app':_0x701c('0xb1'),'appdata':_0x47aaf3[_0x701c('0x33')]+','+(_0x45f5c9[_0x701c('0x81')]['waitForTheAssignedAgent']||0xa),'interval':_0x701c('0xac')});}return respondWithRpcPromise(_0x701c('0xb2'),_0x701c('0xb3'),_0x45f5c9);});}return respondWithRpcPromise('Start',_0x701c('0xb3'),_0x45f5c9);})['then'](function(_0x44d70c){if(_0x44d70c){var _0x5081c1=0xc8;var _0x580414=_0x701c('0xb4');logger['info'](_0x701c('0xb5'),_0x580414,_0x5081c1,'entity\x20found');logger[_0x701c('0x22')](_0x701c('0xb6'),_0x580414,_0x5081c1,_0x701c('0xb7'),JSON[_0x701c('0xb8')](_0x44d70c));if(_0x45f5c9[_0x701c('0x81')]['type']===_0x701c('0x94')){return _0x332454[_0x701c('0x28')](_0x5081c1)[_0x701c('0x2d')](_0x701c('0xb9'),_0x701c('0xba'))[_0x701c('0x34')]('\x0a');}else{return _0x332454[_0x701c('0x28')](_0x5081c1)[_0x701c('0x29')](_0x44d70c);}}});})[_0x701c('0x50')](handleError(_0x332454,null));};exports['send']=function(_0x5a72ba,_0x23936d,_0x4b730c){var _0x46a5fb,_0x326c7f,_0xaec655;if(_[_0x701c('0x9e')](_0x5a72ba[_0x701c('0x5d')][_0x701c('0x5d')])||_0x5a72ba[_0x701c('0x5d')][_0x701c('0x5d')]===''){throw new db[(_0x701c('0x8b'))][(_0x701c('0x8c'))](_0x701c('0xbb'));}if(_['isNil'](_0x5a72ba[_0x701c('0x5d')]['to'])){throw new db[(_0x701c('0x8b'))][(_0x701c('0x8c'))]('to\x20is\x20mandatory');}_0x46a5fb=_0x5a72ba[_0x701c('0x5d')]['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x5a72ba[_0x701c('0x52')]['id']},'include':[{'model':db['CmList'],'as':_0x701c('0xbc'),'include':[{'model':db['CmContact'],'as':_0x701c('0xa3'),'where':{'mobile':_0x46a5fb},'limit':0x1,'order':[['updatedAt',_0x701c('0xa4')]]}]}]})[_0x701c('0x1e')](handleEntityNotFound(_0x23936d,null))['then'](function(_0x2ca8d8){if(_0x2ca8d8&&_0x2ca8d8['List']){_0x326c7f=_0x2ca8d8[_0x701c('0x55')]({'plain':!![]});if(_0x326c7f[_0x701c('0xbc')]&&_0x326c7f[_0x701c('0xbc')][_0x701c('0xa3')][_0x701c('0x63')]){return _0x326c7f[_0x701c('0xbc')][_0x701c('0xa3')][0x0];}return db[_0x701c('0x8a')][_0x701c('0x53')](_[_0x701c('0x18')](_0x5a72ba[_0x701c('0x5d')],{'firstName':_0x46a5fb,'mobile':_0x46a5fb,'phone':_0x46a5fb,'ListId':_0x326c7f[_0x701c('0x92')]}));}})[_0x701c('0x1e')](handleEntityNotFound(_0x23936d,null))[_0x701c('0x1e')](function(_0x31068c){if(_0x31068c){_0xaec655=_0x31068c;return db[_0x701c('0xbd')][_0x701c('0x58')]({'where':{'ContactId':_0xaec655['id'],'closed':![],'WhatsappAccountId':_0x326c7f['id']}})[_0x701c('0x1e')](function(_0x92a7c4){if(_0x92a7c4){return[_0x92a7c4,![]];}return db[_0x701c('0xbd')]['create']({'UserId':_0x5a72ba['user']['id'],'ContactId':_0xaec655['id'],'WhatsappAccountId':_0x326c7f['id'],'phone':_0x46a5fb,'firstMsgDirection':_0x701c('0xbe'),'Messages':[_[_0x701c('0x4b')](_0x5a72ba[_0x701c('0x5d')],{'read':![],'body':_0x5a72ba['body'][_0x701c('0x5d')],'phone':_0x46a5fb,'WhatsappAccountId':_0x326c7f['id'],'UserId':_0x5a72ba[_0x701c('0x54')]['id'],'ContactId':_0xaec655['id']})]},{'include':[{'model':db[_0x701c('0x86')],'as':_0x701c('0xbf')}]})[_0x701c('0x1e')](function(_0x5b032d){return[_0x5b032d,!![]];});});}})['spread'](function(_0x4ccd23,_0x46e228){if(_0x46e228){return _0x4ccd23;}return db[_0x701c('0x86')][_0x701c('0x53')](_[_0x701c('0x4b')](_0x5a72ba[_0x701c('0x5d')],{'read':![],'body':_0x5a72ba['body'][_0x701c('0x5d')],'phone':_0x46a5fb,'WhatsappAccountId':_0x326c7f['id'],'WhatsappInteractionId':_0x4ccd23['id'],'UserId':_0x5a72ba[_0x701c('0x54')]['id'],'ContactId':_0xaec655['id']}))['then'](function(_0x2408f2){_0x4ccd23[_0x701c('0xc0')]['Messages']=[];_0x4ccd23[_0x701c('0xc0')][_0x701c('0xbf')][_0x701c('0xaa')](_0x2408f2[_0x701c('0xc0')]);return _0x4ccd23;});})[_0x701c('0x1e')](respondWithResult(_0x23936d,null))[_0x701c('0x50')](handleError(_0x23936d,null));}; \ No newline at end of file +var _0xd8f9=['sinch','statuses','state','read','WhatsappMessage','timestamp','priority','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','From','messageId','MessageSid','notifications','message_id','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','list','Contacts','contact','WhatsappInteraction','interaction','created','applications','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','set','text/xml','\x0a','to\x20is\x20mandatory','DESC','List','out','Messages','spread','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','WhatsappAccount,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','intersection','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','update','find','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','rawAttributes','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addAgents','omit','removeAgents','userWhatsappAccount:remove','emit','getAgents','User','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','finally','getApplications','notify','Applications'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd8f9,0x1c5));var _0x9d8f=function(_0x46685e,_0x4a6c5d){_0x46685e=_0x46685e-0x0;var _0x5492be=_0xd8f9[_0x46685e];return _0x5492be;};'use strict';var emlformat=require(_0x9d8f('0x0'));var rimraf=require(_0x9d8f('0x1'));var zipdir=require(_0x9d8f('0x2'));var jsonpatch=require(_0x9d8f('0x3'));var rp=require(_0x9d8f('0x4'));var moment=require(_0x9d8f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9d8f('0x6'));var path=require(_0x9d8f('0x7'));var sox=require(_0x9d8f('0x8'));var csv=require(_0x9d8f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9d8f('0xa'));var _=require(_0x9d8f('0xb'));var squel=require(_0x9d8f('0xc'));var crypto=require(_0x9d8f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9d8f('0xe'));var toCsv=require(_0x9d8f('0x9'));var querystring=require('querystring');var Papa=require(_0x9d8f('0xf'));var Redis=require(_0x9d8f('0x10'));var authService=require(_0x9d8f('0x11'));var qs=require(_0x9d8f('0x12'));var as=require(_0x9d8f('0x13'));var hardwareService=require(_0x9d8f('0x14'));var logger=require(_0x9d8f('0x15'))(_0x9d8f('0x16'));var utils=require(_0x9d8f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9d8f('0x18'));var db=require(_0x9d8f('0x19'))['db'];config[_0x9d8f('0x1a')]=_[_0x9d8f('0x1b')](config[_0x9d8f('0x1a')],{'host':_0x9d8f('0x1c'),'port':0x18eb});var socket=require(_0x9d8f('0x1d'))(new Redis(config['redis']));require('./whatsappAccount.socket')[_0x9d8f('0x1e')](socket);var jayson=require(_0x9d8f('0x1f'));var client=jayson[_0x9d8f('0x20')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3eef07,_0x791211,_0x3e334f,_0x4618f1){return new BPromise(function(_0x313f13,_0x528dce){var _0x351d06=_0x4618f1||client;return _0x351d06['request'](_0x3eef07,_0x3e334f)[_0x9d8f('0x21')](function(_0x4d600d){logger[_0x9d8f('0x22')]('WhatsappAccount,\x20%s,\x20%s',_0x791211,'request\x20sent');logger[_0x9d8f('0x23')](_0x9d8f('0x24'),_0x791211,_0x9d8f('0x25'),JSON['stringify'](_0x4d600d));if(_0x4d600d['error']){if(_0x4d600d['error']['code']===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x791211,_0x4d600d[_0x9d8f('0x26')]['message']);return _0x528dce(_0x4d600d[_0x9d8f('0x26')][_0x9d8f('0x27')]);}logger[_0x9d8f('0x26')](_0x9d8f('0x28'),_0x791211,_0x4d600d[_0x9d8f('0x26')]['message']);return _0x313f13(_0x4d600d[_0x9d8f('0x26')][_0x9d8f('0x27')]);}else{logger[_0x9d8f('0x22')](_0x9d8f('0x28'),_0x791211,_0x9d8f('0x25'));_0x313f13(_0x4d600d[_0x9d8f('0x29')][_0x9d8f('0x27')]);}})[_0x9d8f('0x2a')](function(_0x4c8c79){logger[_0x9d8f('0x26')](_0x9d8f('0x28'),_0x791211,_0x4c8c79);_0x528dce(_0x4c8c79);});});}function respondWithStatusCode(_0x65852a,_0x4ba8a2){_0x4ba8a2=_0x4ba8a2||0xcc;return function(_0x11112c){if(_0x11112c){return _0x65852a[_0x9d8f('0x2b')](_0x4ba8a2);}return _0x65852a[_0x9d8f('0x2c')](_0x4ba8a2)[_0x9d8f('0x2d')]();};}function respondWithResult(_0x59be6e,_0x708e01){_0x708e01=_0x708e01||0xc8;return function(_0x5ad301){if(_0x5ad301){return _0x59be6e['status'](_0x708e01)[_0x9d8f('0x2e')](_0x5ad301);}};}function respondWithFilteredResult(_0x48b406,_0x5b168f){return function(_0x5fd00){if(_0x5fd00){var _0x41b388=typeof _0x5b168f[_0x9d8f('0x2f')]===_0x9d8f('0x30')&&typeof _0x5b168f[_0x9d8f('0x31')]===_0x9d8f('0x30');var _0x15b3fe=_0x5fd00[_0x9d8f('0x32')];var _0x1c8b11=_0x41b388?0x0:_0x5b168f[_0x9d8f('0x2f')];var _0x37a4a9=_0x41b388?_0x5fd00['count']:_0x5b168f[_0x9d8f('0x2f')]+_0x5b168f['limit'];var _0x1d9016;if(_0x37a4a9>=_0x15b3fe){_0x37a4a9=_0x15b3fe;_0x1d9016=0xc8;}else{_0x1d9016=0xce;}_0x48b406[_0x9d8f('0x2c')](_0x1d9016);return _0x48b406['set'](_0x9d8f('0x33'),_0x1c8b11+'-'+_0x37a4a9+'/'+_0x15b3fe)[_0x9d8f('0x2e')](_0x5fd00);}return null;};}function patchUpdates(_0x3c4a32){return function(_0x259a9c){try{jsonpatch[_0x9d8f('0x34')](_0x259a9c,_0x3c4a32,!![]);}catch(_0x6c573f){return BPromise['reject'](_0x6c573f);}return _0x259a9c['save']();};}function saveUpdates(_0x1dba5a,_0x103b34){return function(_0x166ea2){if(_0x166ea2){return _0x166ea2['update'](_0x1dba5a)[_0x9d8f('0x21')](function(_0x22ed57){return _0x22ed57;});}return null;};}function removeEntity(_0x17dfd0,_0x5e2959){return function(_0x496d9e){if(_0x496d9e){return _0x496d9e[_0x9d8f('0x35')]()[_0x9d8f('0x21')](function(){var _0x5baedf=_0x496d9e[_0x9d8f('0x36')]({'plain':!![]});var _0x3b8f76=_0x9d8f('0x37');return db[_0x9d8f('0x38')][_0x9d8f('0x35')]({'where':{'type':_0x3b8f76,'resourceId':_0x5baedf['id']}})[_0x9d8f('0x21')](function(){return _0x496d9e;});})[_0x9d8f('0x21')](function(){_0x17dfd0[_0x9d8f('0x2c')](0xcc)[_0x9d8f('0x2d')]();});}};}function handleEntityNotFound(_0xda007b,_0x2a4a77){return function(_0xa8cf3e){if(!_0xa8cf3e){_0xda007b[_0x9d8f('0x2b')](0x194);}return _0xa8cf3e;};}function handleError(_0x8fc594,_0x3544bf){_0x3544bf=_0x3544bf||0x1f4;return function(_0x221c9e){logger[_0x9d8f('0x26')](_0x221c9e[_0x9d8f('0x39')]);if(_0x221c9e[_0x9d8f('0x3a')]){delete _0x221c9e[_0x9d8f('0x3a')];}_0x8fc594[_0x9d8f('0x2c')](_0x3544bf)[_0x9d8f('0x3b')](_0x221c9e);};}exports['index']=function(_0x53eeec,_0x576874){var _0x13ef2e={'include':[{'model':db[_0x9d8f('0x3c')],'as':_0x9d8f('0x3d')}]},_0x5b09ba={},_0x2fc65e={'count':0x0,'rows':[]};var _0xfb0042=_[_0x9d8f('0x3e')](db[_0x9d8f('0x3f')]['rawAttributes'],function(_0x523594){return{'name':_0x523594[_0x9d8f('0x40')],'type':_0x523594[_0x9d8f('0x41')]['key']};});_0x5b09ba[_0x9d8f('0x42')]=_[_0x9d8f('0x3e')](_0xfb0042,_0x9d8f('0x3a'));_0x5b09ba['query']=_[_0x9d8f('0x43')](_0x53eeec[_0x9d8f('0x44')]);_0x5b09ba[_0x9d8f('0x45')]=_['intersection'](_0x5b09ba[_0x9d8f('0x42')],_0x5b09ba[_0x9d8f('0x44')]);_0x13ef2e[_0x9d8f('0x46')]=_['intersection'](_0x5b09ba[_0x9d8f('0x42')],qs[_0x9d8f('0x47')](_0x53eeec['query'][_0x9d8f('0x47')]));_0x13ef2e[_0x9d8f('0x46')]=_0x13ef2e[_0x9d8f('0x46')]['length']?_0x13ef2e[_0x9d8f('0x46')]:_0x5b09ba[_0x9d8f('0x42')];if(!_0x53eeec[_0x9d8f('0x44')][_0x9d8f('0x48')](_0x9d8f('0x49'))){_0x13ef2e[_0x9d8f('0x31')]=qs[_0x9d8f('0x31')](_0x53eeec[_0x9d8f('0x44')][_0x9d8f('0x31')]);_0x13ef2e[_0x9d8f('0x2f')]=qs[_0x9d8f('0x2f')](_0x53eeec[_0x9d8f('0x44')][_0x9d8f('0x2f')]);}_0x13ef2e[_0x9d8f('0x4a')]=qs[_0x9d8f('0x4b')](_0x53eeec[_0x9d8f('0x44')][_0x9d8f('0x4b')]);_0x13ef2e[_0x9d8f('0x4c')]=qs[_0x9d8f('0x45')](_[_0x9d8f('0x4d')](_0x53eeec[_0x9d8f('0x44')],_0x5b09ba[_0x9d8f('0x45')]),_0xfb0042);if(_0x53eeec['query'][_0x9d8f('0x4e')]){_0x13ef2e[_0x9d8f('0x4c')]=_[_0x9d8f('0x4f')](_0x13ef2e[_0x9d8f('0x4c')],{'$or':_[_0x9d8f('0x3e')](_0xfb0042,function(_0x5e148f){if(_0x5e148f[_0x9d8f('0x41')]!==_0x9d8f('0x50')){var _0x26d59e={};_0x26d59e[_0x5e148f[_0x9d8f('0x3a')]]={'$like':'%'+_0x53eeec[_0x9d8f('0x44')]['filter']+'%'};return _0x26d59e;}})});}_0x13ef2e=_[_0x9d8f('0x4f')]({},_0x13ef2e,_0x53eeec[_0x9d8f('0x51')]);var _0x3bba7a={'where':_0x13ef2e[_0x9d8f('0x4c')]};return db[_0x9d8f('0x3f')][_0x9d8f('0x32')](_0x3bba7a)[_0x9d8f('0x21')](function(_0x3b689f){_0x2fc65e[_0x9d8f('0x32')]=_0x3b689f;if(_0x53eeec[_0x9d8f('0x44')][_0x9d8f('0x52')]){_0x13ef2e[_0x9d8f('0x53')]=[{'all':!![]}];}return db[_0x9d8f('0x3f')]['findAll'](_0x13ef2e);})[_0x9d8f('0x21')](function(_0x2801b5){_0x2fc65e[_0x9d8f('0x54')]=_0x2801b5;return _0x2fc65e;})[_0x9d8f('0x21')](respondWithFilteredResult(_0x576874,_0x13ef2e))[_0x9d8f('0x2a')](handleError(_0x576874,null));};exports[_0x9d8f('0x55')]=function(_0x23cdbf,_0xb93eef){var _0x224fe7={'raw':![],'where':{'id':_0x23cdbf[_0x9d8f('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0x9d8f('0x3d')}]},_0x47fefa={};_0x47fefa[_0x9d8f('0x42')]=_[_0x9d8f('0x43')](db[_0x9d8f('0x3f')]['rawAttributes']);_0x47fefa['query']=_[_0x9d8f('0x43')](_0x23cdbf['query']);_0x47fefa[_0x9d8f('0x45')]=_[_0x9d8f('0x57')](_0x47fefa['model'],_0x47fefa[_0x9d8f('0x44')]);_0x224fe7[_0x9d8f('0x46')]=_[_0x9d8f('0x57')](_0x47fefa['model'],qs['fields'](_0x23cdbf['query'][_0x9d8f('0x47')]));_0x224fe7['attributes']=_0x224fe7['attributes'][_0x9d8f('0x58')]?_0x224fe7[_0x9d8f('0x46')]:_0x47fefa['model'];if(_0x23cdbf['query'][_0x9d8f('0x52')]){_0x224fe7[_0x9d8f('0x53')]=[{'all':!![]}];}_0x224fe7=_[_0x9d8f('0x4f')]({},_0x224fe7,_0x23cdbf['options']);return db['WhatsappAccount']['find'](_0x224fe7)[_0x9d8f('0x21')](handleEntityNotFound(_0xb93eef,null))[_0x9d8f('0x21')](respondWithResult(_0xb93eef,null))['catch'](handleError(_0xb93eef,null));};exports[_0x9d8f('0x59')]=function(_0x172a7e,_0x4ad571){return db[_0x9d8f('0x3f')][_0x9d8f('0x59')](_0x172a7e[_0x9d8f('0x5a')],{})[_0x9d8f('0x21')](function(_0x22457d){var _0x2b02a1=_0x172a7e[_0x9d8f('0x5b')][_0x9d8f('0x36')]({'plain':!![]});if(!_0x2b02a1)throw new Error(_0x9d8f('0x5c'));if(_0x2b02a1[_0x9d8f('0x5d')]===_0x9d8f('0x5b')){var _0x46ec41=_0x22457d[_0x9d8f('0x36')]({'plain':!![]});var _0x10a9e3=_0x9d8f('0x37');return db[_0x9d8f('0x5e')]['find']({'where':{'name':_0x10a9e3,'userProfileId':_0x2b02a1['userProfileId']},'raw':!![]})['then'](function(_0x247033){if(_0x247033&&_0x247033['autoAssociation']===0x0){return db[_0x9d8f('0x38')]['create']({'name':_0x46ec41[_0x9d8f('0x3a')],'resourceId':_0x46ec41['id'],'type':_0x247033['name'],'sectionId':_0x247033['id']},{})[_0x9d8f('0x21')](function(){return _0x22457d;});}else{return _0x22457d;}})['catch'](function(_0x1a3dc8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a3dc8);throw _0x1a3dc8;});}return _0x22457d;})[_0x9d8f('0x21')](respondWithResult(_0x4ad571,0xc9))[_0x9d8f('0x2a')](handleError(_0x4ad571,null));};exports[_0x9d8f('0x5f')]=function(_0x34b6fd,_0x4f4f72){if(_0x34b6fd[_0x9d8f('0x5a')]['id']){delete _0x34b6fd[_0x9d8f('0x5a')]['id'];}return db[_0x9d8f('0x3f')][_0x9d8f('0x60')]({'where':{'id':_0x34b6fd[_0x9d8f('0x56')]['id']},'include':[{'model':db[_0x9d8f('0x3c')],'as':_0x9d8f('0x3d')}]})[_0x9d8f('0x21')](handleEntityNotFound(_0x4f4f72,null))[_0x9d8f('0x21')](saveUpdates(_0x34b6fd[_0x9d8f('0x5a')],null))[_0x9d8f('0x21')](respondWithResult(_0x4f4f72,null))[_0x9d8f('0x2a')](handleError(_0x4f4f72,null));};exports[_0x9d8f('0x35')]=function(_0x2f35f8,_0x5332c4){return db[_0x9d8f('0x3f')][_0x9d8f('0x60')]({'where':{'id':_0x2f35f8['params']['id']}})[_0x9d8f('0x21')](handleEntityNotFound(_0x5332c4,null))[_0x9d8f('0x21')](removeEntity(_0x5332c4,null))['catch'](handleError(_0x5332c4,null));};exports[_0x9d8f('0x61')]=function(_0x2ae638,_0x3a88c5){return db[_0x9d8f('0x3f')][_0x9d8f('0x61')]()['then'](respondWithResult(_0x3a88c5,null))['catch'](handleError(_0x3a88c5,null));};exports[_0x9d8f('0x62')]=function(_0x3ee82b,_0x47246f,_0x3e29a9){if(_0x3ee82b[_0x9d8f('0x5a')]['id']){delete _0x3ee82b[_0x9d8f('0x5a')]['id'];}return db[_0x9d8f('0x3f')][_0x9d8f('0x60')]({'where':{'id':_0x3ee82b[_0x9d8f('0x56')]['id']}})[_0x9d8f('0x21')](handleEntityNotFound(_0x47246f,null))['then'](function(_0x416613){if(_0x416613){_0x3ee82b[_0x9d8f('0x5a')][_0x9d8f('0x63')]=_0x416613['id'];return db[_0x9d8f('0x64')][_0x9d8f('0x59')](_0x3ee82b[_0x9d8f('0x5a')]);}})['then'](respondWithResult(_0x47246f,null))[_0x9d8f('0x2a')](handleError(_0x47246f,null));};exports[_0x9d8f('0x65')]=function(_0x1107e7,_0x5167b7,_0x2c4e62){var _0x173c6c={'raw':![],'where':{}};var _0x294e26={};var _0xd3fae6={'count':0x0,'rows':[]};return db[_0x9d8f('0x3f')]['findOne']({'where':{'id':_0x1107e7['params']['id']}})[_0x9d8f('0x21')](handleEntityNotFound(_0x5167b7,null))[_0x9d8f('0x21')](function(_0x2f1624){if(_0x2f1624){_0x294e26[_0x9d8f('0x42')]=_[_0x9d8f('0x43')](db[_0x9d8f('0x64')][_0x9d8f('0x66')]);_0x294e26['query']=_['keys'](_0x1107e7[_0x9d8f('0x44')]);_0x294e26[_0x9d8f('0x45')]=_[_0x9d8f('0x57')](_0x294e26[_0x9d8f('0x42')],_0x294e26[_0x9d8f('0x44')]);_0x173c6c['attributes']=_[_0x9d8f('0x57')](_0x294e26[_0x9d8f('0x42')],qs[_0x9d8f('0x47')](_0x1107e7[_0x9d8f('0x44')][_0x9d8f('0x47')]));_0x173c6c['attributes']=_0x173c6c[_0x9d8f('0x46')][_0x9d8f('0x58')]?_0x173c6c[_0x9d8f('0x46')]:_0x294e26[_0x9d8f('0x42')];if(!_0x1107e7[_0x9d8f('0x44')][_0x9d8f('0x48')](_0x9d8f('0x49'))){_0x173c6c[_0x9d8f('0x31')]=qs[_0x9d8f('0x31')](_0x1107e7['query']['limit']);_0x173c6c['offset']=qs['offset'](_0x1107e7[_0x9d8f('0x44')][_0x9d8f('0x2f')]);}_0x173c6c[_0x9d8f('0x4a')]=qs['sort'](_0x1107e7[_0x9d8f('0x44')][_0x9d8f('0x4b')]);_0x173c6c[_0x9d8f('0x4c')]=qs[_0x9d8f('0x45')](_[_0x9d8f('0x4d')](_0x1107e7['query'],_0x294e26['filters']));_0x173c6c[_0x9d8f('0x4c')][_0x9d8f('0x63')]=_0x2f1624['id'];if(_0x1107e7[_0x9d8f('0x44')][_0x9d8f('0x4e')]){_0x173c6c['where']=_[_0x9d8f('0x4f')](_0x173c6c[_0x9d8f('0x4c')],{'$or':_[_0x9d8f('0x3e')](_0x173c6c[_0x9d8f('0x46')],function(_0x19d5cc){var _0x481bd4={};_0x481bd4[_0x19d5cc]={'$like':'%'+_0x1107e7[_0x9d8f('0x44')][_0x9d8f('0x4e')]+'%'};return _0x481bd4;})});}_0x173c6c=_[_0x9d8f('0x4f')]({},_0x173c6c,_0x1107e7[_0x9d8f('0x51')]);return db['Disposition'][_0x9d8f('0x32')]({'where':_0x173c6c[_0x9d8f('0x4c')]})[_0x9d8f('0x21')](function(_0x276bef){_0xd3fae6[_0x9d8f('0x32')]=_0x276bef;if(_0x1107e7[_0x9d8f('0x44')][_0x9d8f('0x52')]){_0x173c6c['include']=[{'all':!![]}];}return db['Disposition'][_0x9d8f('0x67')](_0x173c6c);})[_0x9d8f('0x21')](function(_0x28c7e0){_0xd3fae6['rows']=_0x28c7e0;return _0xd3fae6;});}})[_0x9d8f('0x21')](respondWithFilteredResult(_0x5167b7,_0x173c6c))[_0x9d8f('0x2a')](handleError(_0x5167b7,null));};exports[_0x9d8f('0x68')]=function(_0x44ec79,_0x3caf24,_0xcf7191){return db['WhatsappAccount'][_0x9d8f('0x60')]({'where':{'id':_0x44ec79[_0x9d8f('0x56')]['id']}})[_0x9d8f('0x21')](handleEntityNotFound(_0x3caf24,null))[_0x9d8f('0x21')](function(_0x1eee66){if(_0x1eee66){return _0x1eee66[_0x9d8f('0x68')](_0x44ec79[_0x9d8f('0x44')][_0x9d8f('0x69')]);}})[_0x9d8f('0x21')](respondWithStatusCode(_0x3caf24,null))['catch'](handleError(_0x3caf24,null));};exports[_0x9d8f('0x6a')]=function(_0x343ad0,_0x10efdf,_0x2c45c6){if(_0x343ad0[_0x9d8f('0x5a')]['id']){delete _0x343ad0['body']['id'];}return db[_0x9d8f('0x3f')]['find']({'where':{'id':_0x343ad0[_0x9d8f('0x56')]['id']}})[_0x9d8f('0x21')](handleEntityNotFound(_0x10efdf,null))[_0x9d8f('0x21')](function(_0x47aab1){if(_0x47aab1){_0x343ad0['body'][_0x9d8f('0x63')]=_0x47aab1['id'];return db[_0x9d8f('0x6b')][_0x9d8f('0x59')](_0x343ad0[_0x9d8f('0x5a')]);}})[_0x9d8f('0x21')](respondWithResult(_0x10efdf,null))[_0x9d8f('0x2a')](handleError(_0x10efdf,null));};exports[_0x9d8f('0x6c')]=function(_0x580e78,_0x244b77,_0x5d06a2){var _0x2287c7={'raw':![],'where':{}};var _0x3f074e={};var _0x2dc52f={'count':0x0,'rows':[]};return db[_0x9d8f('0x3f')][_0x9d8f('0x6d')]({'where':{'id':_0x580e78[_0x9d8f('0x56')]['id']}})[_0x9d8f('0x21')](handleEntityNotFound(_0x244b77,null))[_0x9d8f('0x21')](function(_0x133c79){if(_0x133c79){_0x3f074e['model']=_[_0x9d8f('0x43')](db['CannedAnswer'][_0x9d8f('0x66')]);_0x3f074e[_0x9d8f('0x44')]=_['keys'](_0x580e78['query']);_0x3f074e[_0x9d8f('0x45')]=_[_0x9d8f('0x57')](_0x3f074e[_0x9d8f('0x42')],_0x3f074e[_0x9d8f('0x44')]);_0x2287c7[_0x9d8f('0x46')]=_['intersection'](_0x3f074e[_0x9d8f('0x42')],qs[_0x9d8f('0x47')](_0x580e78[_0x9d8f('0x44')][_0x9d8f('0x47')]));_0x2287c7[_0x9d8f('0x46')]=_0x2287c7['attributes'][_0x9d8f('0x58')]?_0x2287c7['attributes']:_0x3f074e['model'];if(!_0x580e78[_0x9d8f('0x44')]['hasOwnProperty'](_0x9d8f('0x49'))){_0x2287c7[_0x9d8f('0x31')]=qs[_0x9d8f('0x31')](_0x580e78[_0x9d8f('0x44')][_0x9d8f('0x31')]);_0x2287c7[_0x9d8f('0x2f')]=qs[_0x9d8f('0x2f')](_0x580e78[_0x9d8f('0x44')][_0x9d8f('0x2f')]);}_0x2287c7[_0x9d8f('0x4a')]=qs[_0x9d8f('0x4b')](_0x580e78[_0x9d8f('0x44')][_0x9d8f('0x4b')]);_0x2287c7[_0x9d8f('0x4c')]=qs['filters'](_[_0x9d8f('0x4d')](_0x580e78[_0x9d8f('0x44')],_0x3f074e['filters']));_0x2287c7['where']['WhatsappAccountId']=_0x133c79['id'];if(_0x580e78[_0x9d8f('0x44')][_0x9d8f('0x4e')]){_0x2287c7['where']=_[_0x9d8f('0x4f')](_0x2287c7[_0x9d8f('0x4c')],{'$or':_['map'](_0x2287c7['attributes'],function(_0x3654bf){var _0x1ebb0b={};_0x1ebb0b[_0x3654bf]={'$like':'%'+_0x580e78[_0x9d8f('0x44')][_0x9d8f('0x4e')]+'%'};return _0x1ebb0b;})});}_0x2287c7=_[_0x9d8f('0x4f')]({},_0x2287c7,_0x580e78[_0x9d8f('0x51')]);return db[_0x9d8f('0x6b')][_0x9d8f('0x32')]({'where':_0x2287c7['where']})[_0x9d8f('0x21')](function(_0xf7f28f){_0x2dc52f['count']=_0xf7f28f;if(_0x580e78[_0x9d8f('0x44')][_0x9d8f('0x52')]){_0x2287c7['include']=[{'all':!![]}];}return db[_0x9d8f('0x6b')]['findAll'](_0x2287c7);})['then'](function(_0x5f3227){_0x2dc52f['rows']=_0x5f3227;return _0x2dc52f;});}})['then'](respondWithFilteredResult(_0x244b77,_0x2287c7))[_0x9d8f('0x2a')](handleError(_0x244b77,null));};exports[_0x9d8f('0x6e')]=function(_0x3186ea,_0x466ac7,_0x463322){return db[_0x9d8f('0x3f')][_0x9d8f('0x60')]({'where':{'id':_0x3186ea['params']['id']}})[_0x9d8f('0x21')](handleEntityNotFound(_0x466ac7,null))[_0x9d8f('0x21')](function(_0x133a27){if(_0x133a27){return _0x133a27[_0x9d8f('0x6e')](_0x3186ea['query'][_0x9d8f('0x69')]);}})[_0x9d8f('0x21')](respondWithStatusCode(_0x466ac7,null))[_0x9d8f('0x2a')](handleError(_0x466ac7,null));};exports['addAgents']=function(_0x746294,_0x2c2202,_0xd4eb7f){return db[_0x9d8f('0x3f')][_0x9d8f('0x60')]({'where':{'id':_0x746294[_0x9d8f('0x56')]['id']}})[_0x9d8f('0x21')](handleEntityNotFound(_0x2c2202,null))[_0x9d8f('0x21')](function(_0x1cd874){if(_0x1cd874){return _0x1cd874[_0x9d8f('0x6f')](_0x746294['body']['ids'],_[_0x9d8f('0x70')](_0x746294[_0x9d8f('0x5a')],['ids','id'])||{})['spread'](function(_0x1abf20){for(var _0x453169=0x0;_0x453169<_0x746294[_0x9d8f('0x5a')]['ids'][_0x9d8f('0x58')];_0x453169+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0x746294[_0x9d8f('0x5a')][_0x9d8f('0x69')][_0x453169]),'WhatsappAccountId':Number(_0x746294['params']['id'])});}return _0x1abf20;});}})[_0x9d8f('0x21')](respondWithResult(_0x2c2202,null))[_0x9d8f('0x2a')](handleError(_0x2c2202,null));};exports[_0x9d8f('0x71')]=function(_0x68c462,_0xbefa14,_0x4d35d6){return db[_0x9d8f('0x3f')]['find']({'where':{'id':_0x68c462[_0x9d8f('0x56')]['id']}})[_0x9d8f('0x21')](handleEntityNotFound(_0xbefa14,null))['then'](function(_0x775719){if(_0x775719){return _0x775719[_0x9d8f('0x71')](_0x68c462[_0x9d8f('0x44')]['ids'])['then'](function(){if(_['isArray'](_0x68c462[_0x9d8f('0x44')]['ids'])){for(var _0x16540f=0x0;_0x16540f<_0x68c462[_0x9d8f('0x44')][_0x9d8f('0x69')][_0x9d8f('0x58')];_0x16540f+=0x1){socket['emit'](_0x9d8f('0x72'),{'UserId':Number(_0x68c462['query'][_0x9d8f('0x69')][_0x16540f]),'WhatsappAccountId':Number(_0x68c462['params']['id'])});}}else{socket[_0x9d8f('0x73')](_0x9d8f('0x72'),{'UserId':Number(_0x68c462[_0x9d8f('0x44')][_0x9d8f('0x69')]),'WhatsappAccountId':Number(_0x68c462[_0x9d8f('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0xbefa14,null))[_0x9d8f('0x2a')](handleError(_0xbefa14,null));};exports[_0x9d8f('0x74')]=function(_0xc78ea6,_0x148541,_0x4cfee4){var _0x59bcef={};var _0x10185a={};var _0x5b603b;var _0x204c61;return db['WhatsappAccount'][_0x9d8f('0x6d')]({'where':{'id':_0xc78ea6[_0x9d8f('0x56')]['id']}})['then'](handleEntityNotFound(_0x148541,null))[_0x9d8f('0x21')](function(_0x14ad6a){if(_0x14ad6a){_0x5b603b=_0x14ad6a;_0x10185a[_0x9d8f('0x42')]=_['keys'](db[_0x9d8f('0x75')][_0x9d8f('0x66')]);_0x10185a[_0x9d8f('0x44')]=_[_0x9d8f('0x43')](_0xc78ea6[_0x9d8f('0x44')]);_0x10185a[_0x9d8f('0x45')]=_['intersection'](_0x10185a[_0x9d8f('0x42')],_0x10185a[_0x9d8f('0x44')]);_0x59bcef[_0x9d8f('0x46')]=_['intersection'](_0x10185a[_0x9d8f('0x42')],qs[_0x9d8f('0x47')](_0xc78ea6[_0x9d8f('0x44')][_0x9d8f('0x47')]));_0x59bcef['attributes']=_0x59bcef['attributes'][_0x9d8f('0x58')]?_0x59bcef[_0x9d8f('0x46')]:_0x10185a[_0x9d8f('0x42')];_0x59bcef['order']=qs[_0x9d8f('0x4b')](_0xc78ea6[_0x9d8f('0x44')][_0x9d8f('0x4b')]);_0x59bcef[_0x9d8f('0x4c')]=qs[_0x9d8f('0x45')](_[_0x9d8f('0x4d')](_0xc78ea6[_0x9d8f('0x44')],_0x10185a[_0x9d8f('0x45')]));if(_0xc78ea6[_0x9d8f('0x44')][_0x9d8f('0x4e')]){_0x59bcef[_0x9d8f('0x4c')]=_[_0x9d8f('0x4f')](_0x59bcef[_0x9d8f('0x4c')],{'$or':_[_0x9d8f('0x3e')](_0x59bcef[_0x9d8f('0x46')],function(_0x20f2f8){var _0x19ce94={};_0x19ce94[_0x20f2f8]={'$like':'%'+_0xc78ea6[_0x9d8f('0x44')][_0x9d8f('0x4e')]+'%'};return _0x19ce94;})});}_0x59bcef=_[_0x9d8f('0x4f')]({},_0x59bcef,_0xc78ea6[_0x9d8f('0x51')]);return _0x5b603b[_0x9d8f('0x74')](_0x59bcef);}})[_0x9d8f('0x21')](function(_0x60f25d){if(_0x60f25d){_0x204c61=_0x60f25d['length'];if(!_0xc78ea6[_0x9d8f('0x44')][_0x9d8f('0x48')]('nolimit')){_0x59bcef[_0x9d8f('0x31')]=qs['limit'](_0xc78ea6['query'][_0x9d8f('0x31')]);_0x59bcef['offset']=qs[_0x9d8f('0x2f')](_0xc78ea6[_0x9d8f('0x44')][_0x9d8f('0x2f')]);}return _0x5b603b[_0x9d8f('0x74')](_0x59bcef);}})[_0x9d8f('0x21')](function(_0x5d470d){if(_0x5d470d){return _0x5d470d?{'count':_0x204c61,'rows':_0x5d470d}:null;}})[_0x9d8f('0x21')](respondWithResult(_0x148541,null))[_0x9d8f('0x2a')](handleError(_0x148541,null));};exports[_0x9d8f('0x76')]=function(_0x2a0e53,_0x22e60){var _0x64a492=_0x2a0e53[_0x9d8f('0x56')]['id'];var _0x4a720f=_0x2a0e53[_0x9d8f('0x5a')];var _0x1d1cf0=0xc8;var _0x5b6750=null;return db[_0x9d8f('0x77')][_0x9d8f('0x78')]({'isolationLevel':db[_0x9d8f('0x77')][_0x9d8f('0x79')]['ISOLATION_LEVELS'][_0x9d8f('0x7a')]},function(_0x3dee08){return db['WhatsappAccount'][_0x9d8f('0x6d')]({'where':{'id':_0x64a492},'transaction':_0x3dee08})[_0x9d8f('0x21')](function(_0x132f1d){if(_0x132f1d){return db[_0x9d8f('0x7b')]['destroy']({'where':{'WhatsappAccountId':_0x64a492},'transaction':_0x3dee08})[_0x9d8f('0x21')](function(){var _0x35a85d=_[_0x9d8f('0x3e')](_0x4a720f,function(_0x15a0e4){_0x15a0e4[_0x9d8f('0x63')]=_0x64a492;return _0x15a0e4;});return db[_0x9d8f('0x7b')][_0x9d8f('0x7c')](_0x35a85d,{'transaction':_0x3dee08});});}else{_0x1d1cf0=0x194;_0x5b6750=[];}});})[_0x9d8f('0x21')](function(){if(_0x1d1cf0!==0x194){return db[_0x9d8f('0x7b')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x64a492},'order':'priority'})[_0x9d8f('0x21')](function(_0x3c731a){_0x5b6750=_0x3c731a;});}})[_0x9d8f('0x2a')](function(_0x558a7b){_0x1d1cf0=0x1f4;logger[_0x9d8f('0x26')](_0x558a7b[_0x9d8f('0x39')]);if(_0x558a7b[_0x9d8f('0x3a')]){delete _0x558a7b[_0x9d8f('0x3a')];}_0x5b6750=_0x558a7b;})[_0x9d8f('0x7d')](function(){if(_0x5b6750===null){_0x22e60['sendStatus'](_0x1d1cf0);}else{if(_0x1d1cf0===0x1f4){_0x22e60[_0x9d8f('0x2c')](_0x1d1cf0)[_0x9d8f('0x3b')](_0x5b6750);}else{_0x22e60[_0x9d8f('0x2c')](_0x1d1cf0)[_0x9d8f('0x2e')](_0x5b6750);}}});};exports[_0x9d8f('0x7e')]=function(_0x3ec140,_0x26726e,_0x34615d){var _0xfcf10a={};var _0x115c68={};var _0xa1e94c;var _0x193b42;return db[_0x9d8f('0x3f')][_0x9d8f('0x6d')]({'where':{'id':_0x3ec140[_0x9d8f('0x56')]['id']}})['then'](handleEntityNotFound(_0x26726e,null))[_0x9d8f('0x21')](function(_0x524ec5){if(_0x524ec5){_0xa1e94c=_0x524ec5;_0x115c68[_0x9d8f('0x42')]=_[_0x9d8f('0x43')](db[_0x9d8f('0x7b')][_0x9d8f('0x66')]);_0x115c68['query']=_['keys'](_0x3ec140['query']);_0x115c68[_0x9d8f('0x45')]=_[_0x9d8f('0x57')](_0x115c68[_0x9d8f('0x42')],_0x115c68[_0x9d8f('0x44')]);_0xfcf10a[_0x9d8f('0x46')]=_['intersection'](_0x115c68[_0x9d8f('0x42')],qs[_0x9d8f('0x47')](_0x3ec140[_0x9d8f('0x44')][_0x9d8f('0x47')]));_0xfcf10a[_0x9d8f('0x46')]=_0xfcf10a[_0x9d8f('0x46')][_0x9d8f('0x58')]?_0xfcf10a[_0x9d8f('0x46')]:_0x115c68[_0x9d8f('0x42')];_0xfcf10a['order']=qs[_0x9d8f('0x4b')](_0x3ec140[_0x9d8f('0x44')][_0x9d8f('0x4b')]);_0xfcf10a[_0x9d8f('0x4c')]=qs[_0x9d8f('0x45')](_['pick'](_0x3ec140[_0x9d8f('0x44')],_0x115c68[_0x9d8f('0x45')]));if(_0x3ec140[_0x9d8f('0x44')]['filter']){_0xfcf10a[_0x9d8f('0x4c')]=_[_0x9d8f('0x4f')](_0xfcf10a[_0x9d8f('0x4c')],{'$or':_[_0x9d8f('0x3e')](_0xfcf10a[_0x9d8f('0x46')],function(_0x146bfe){var _0x2682d7={};_0x2682d7[_0x146bfe]={'$like':'%'+_0x3ec140[_0x9d8f('0x44')][_0x9d8f('0x4e')]+'%'};return _0x2682d7;})});}_0xfcf10a=_[_0x9d8f('0x4f')]({},_0xfcf10a,_0x3ec140[_0x9d8f('0x51')]);return _0xa1e94c[_0x9d8f('0x7e')](_0xfcf10a);}})[_0x9d8f('0x21')](function(_0x5f38ca){if(_0x5f38ca){_0x193b42=_0x5f38ca[_0x9d8f('0x58')];if(!_0x3ec140['query']['hasOwnProperty'](_0x9d8f('0x49'))){_0xfcf10a[_0x9d8f('0x31')]=qs[_0x9d8f('0x31')](_0x3ec140[_0x9d8f('0x44')]['limit']);_0xfcf10a[_0x9d8f('0x2f')]=qs['offset'](_0x3ec140[_0x9d8f('0x44')][_0x9d8f('0x2f')]);}return _0xa1e94c[_0x9d8f('0x7e')](_0xfcf10a);}})['then'](function(_0x2b6322){if(_0x2b6322){return _0x2b6322?{'count':_0x193b42,'rows':_0x2b6322}:null;}})[_0x9d8f('0x21')](respondWithResult(_0x26726e,null))[_0x9d8f('0x2a')](handleError(_0x26726e,null));};exports[_0x9d8f('0x7f')]=function(_0x49a71c,_0x52cdea,_0x161aef){var _0x469010={'channel':'whatsapp'};var _0x2eaa5e=[];var _0x34950b=[];var _0x5ab4e1={};return db['WhatsappAccount'][_0x9d8f('0x60')]({'where':{'id':_0x49a71c[_0x9d8f('0x56')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x9d8f('0x80')}]})[_0x9d8f('0x21')](handleEntityNotFound(_0x52cdea,null))['then'](function(_0x463269){_0x469010['account']=_0x463269;if(_0x469010['account']&&_0x469010['account']['type']===_0x9d8f('0x81')&&_0x49a71c['body'][_0x9d8f('0x82')]){if(_0x49a71c[_0x9d8f('0x5a')][_0x9d8f('0x82')]['length']===0x0)return;if(_0x49a71c[_0x9d8f('0x5a')][_0x9d8f('0x82')][0x0][_0x9d8f('0x83')]!==_0x9d8f('0x84'))return;return db[_0x9d8f('0x85')]['update']({'read':!![],'readAt':_0x49a71c[_0x9d8f('0x5a')]['statuses'][0x0][_0x9d8f('0x86')]},{'where':{'messageId':_0x49a71c[_0x9d8f('0x5a')][_0x9d8f('0x82')][0x0]['message_id']},'individualHooks':!![]})[_0x9d8f('0x21')](function(_0x5e3f29){return _0x52cdea[_0x9d8f('0x2c')](0xc8)['json'](_0x5e3f29);});}_0x469010['applications']=_['orderBy'](_0x463269[_0x9d8f('0x80')],[_0x9d8f('0x87')],[_0x9d8f('0x88')]);if(_0x469010[_0x9d8f('0x89')]['Applications']){delete _0x469010[_0x9d8f('0x89')][_0x9d8f('0x80')];}return db[_0x9d8f('0x8a')]['describe']()[_0x9d8f('0x21')](function(_0x552adb){if(!_0x552adb){throw new db[(_0x9d8f('0x8b'))][(_0x9d8f('0x8c'))](_0x9d8f('0x8d'));}_0x2eaa5e=_[_0x9d8f('0x8e')](_[_0x9d8f('0x43')](_0x552adb),[_0x9d8f('0x8f'),_0x9d8f('0x90')]);_0x34950b=_['difference'](_[_0x9d8f('0x43')](_0x552adb),[_0x9d8f('0x8f'),'updatedAt',_0x9d8f('0x91'),_0x9d8f('0x92')]);_0x469010[_0x9d8f('0x5a')]={'mapKey':'mobile'};if(_0x469010[_0x9d8f('0x89')]&&_0x469010['account'][_0x9d8f('0x41')]===_0x9d8f('0x93')){_0x469010['body'][_0x9d8f('0x94')]=_0x49a71c[_0x9d8f('0x5a')][_0x9d8f('0x95')]['replace']('whatsapp:','');_0x469010[_0x9d8f('0x5a')][_0x9d8f('0x5a')]=_0x49a71c[_0x9d8f('0x5a')]['Body'];_0x469010[_0x9d8f('0x5a')][_0x9d8f('0x96')]=_0x49a71c['body'][_0x9d8f('0x97')];}if(_0x469010[_0x9d8f('0x89')]&&_0x469010['account'][_0x9d8f('0x41')]===_0x9d8f('0x81')){_0x469010['body'][_0x9d8f('0x94')]=_0x49a71c[_0x9d8f('0x5a')][_0x9d8f('0x98')][0x0][_0x9d8f('0x94')];_0x469010[_0x9d8f('0x5a')][_0x9d8f('0x5a')]=_0x49a71c[_0x9d8f('0x5a')][_0x9d8f('0x98')][0x0][_0x9d8f('0x27')]['body'];_0x469010[_0x9d8f('0x5a')][_0x9d8f('0x96')]=_0x49a71c[_0x9d8f('0x5a')][_0x9d8f('0x98')][0x0][_0x9d8f('0x99')];}if(_0x469010['body']['id']){delete _0x469010[_0x9d8f('0x5a')]['id'];}if(_[_0x9d8f('0x9a')](_0x469010[_0x9d8f('0x5a')][_0x9d8f('0x94')])){throw new db[(_0x9d8f('0x8b'))][(_0x9d8f('0x8c'))](_0x9d8f('0x9b'));}if(_[_0x9d8f('0x9a')](_0x469010[_0x9d8f('0x5a')][_0x9d8f('0x5a')])||_0x469010[_0x9d8f('0x5a')]['body']===''){throw new db[(_0x9d8f('0x8b'))][(_0x9d8f('0x8c'))](_0x9d8f('0x9c'));}if(_[_0x9d8f('0x9a')](_0x469010[_0x9d8f('0x5a')][_0x9d8f('0x9d')])){throw new db['Sequelize'][(_0x9d8f('0x8c'))](_0x9d8f('0x9e')+_0x34950b);}if(!_[_0x9d8f('0x9f')](_0x34950b,_0x469010[_0x9d8f('0x5a')][_0x9d8f('0x9d')])){throw new db['Sequelize'][(_0x9d8f('0x8c'))](_0x9d8f('0xa0')+_0x34950b);}_0x5ab4e1[_0x469010['body'][_0x9d8f('0x9d')]]=_0x469010['body'][_0x9d8f('0x94')];return db[_0x9d8f('0xa1')]['find']({'where':{'id':_0x469010[_0x9d8f('0x89')][_0x9d8f('0x92')]},'include':[{'model':db[_0x9d8f('0x8a')],'as':'Contacts','where':_0x5ab4e1,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x9d8f('0x21')](handleEntityNotFound(_0x52cdea,null))[_0x9d8f('0x21')](function(_0x26fbe0){if(_0x26fbe0){_0x469010[_0x9d8f('0xa2')]=_[_0x9d8f('0x70')](_0x26fbe0,[_0x9d8f('0xa3')]);if(_0x26fbe0[_0x9d8f('0xa3')][_0x9d8f('0x58')]){return _0x26fbe0[_0x9d8f('0xa3')][0x0];}var _0x192d1d=_[_0x9d8f('0x1b')](_0x469010[_0x9d8f('0x5a')],{'firstName':_0x469010[_0x9d8f('0x5a')][_0x9d8f('0x94')],'ListId':_0x26fbe0['id']});_0x192d1d[_0x469010[_0x9d8f('0x5a')]['mapKey']]=_0x469010['body'][_0x9d8f('0x94')];return db['CmContact'][_0x9d8f('0x59')](_0x192d1d,{'fields':_0x2eaa5e,'raw':!![]});}})[_0x9d8f('0x21')](handleEntityNotFound(_0x52cdea,null))['then'](function(_0x2ca101){if(_0x2ca101){_0x469010[_0x9d8f('0xa4')]=_0x2ca101;var _0x2cb3af={'ContactId':_0x2ca101['id'],'phone':_0x469010[_0x9d8f('0x5a')]['from'],'WhatsappAccountId':_0x49a71c[_0x9d8f('0x56')]['id']};var _0x4224a7={'ContactId':_0x2ca101['id'],'WhatsappAccountId':_0x49a71c[_0x9d8f('0x56')]['id'],'closed':![]};return db[_0x9d8f('0xa5')]['find']({'where':_0x4224a7})[_0x9d8f('0x21')](function(_0x27798e){if(_0x27798e){return[_0x27798e,![]];}return db[_0x9d8f('0xa5')][_0x9d8f('0x59')](_0x2cb3af)[_0x9d8f('0x21')](function(_0x58b88f){return[_0x58b88f,!![]];});});}})['spread'](function(_0x17ae8b,_0x4def77){_0x469010[_0x9d8f('0xa6')]=_0x17ae8b[_0x9d8f('0x36')]({'plain':!![]});_0x469010[_0x9d8f('0xa6')][_0x9d8f('0xa7')]=![];if(_0x4def77){if(_0x469010[_0x9d8f('0x89')]['autoclose']){_0x469010[_0x9d8f('0xa8')]['push']({'id':0x0,'priority':_0x469010['applications'][_0x9d8f('0x58')]+0x1,'app':_0x9d8f('0xa9'),'appdata':_0x9d8f('0xaa'),'interval':_0x9d8f('0xab')});}_0x469010[_0x9d8f('0xa6')][_0x9d8f('0xa7')]=!![];}return db[_0x9d8f('0x85')][_0x9d8f('0x59')]({'phone':_0x469010[_0x9d8f('0x5a')]['from'],'messageId':_0x469010['body'][_0x9d8f('0x96')],'body':_0x469010[_0x9d8f('0x5a')][_0x9d8f('0x5a')],'WhatsappAccountId':_0x49a71c[_0x9d8f('0x56')]['id'],'WhatsappInteractionId':_0x17ae8b['id'],'direction':'in','ContactId':_0x17ae8b[_0x9d8f('0xac')],'AttachmentId':_0x469010[_0x9d8f('0x5a')][_0x9d8f('0xad')]});})[_0x9d8f('0x21')](function(_0x3de5c1){_0x469010['message']=_0x3de5c1;if(_0x469010[_0x9d8f('0xa6')][_0x9d8f('0xae')]){return db['User'][_0x9d8f('0x60')]({'attributes':['id',_0x9d8f('0x3a')],'where':{'id':_0x469010['interaction']['UserId']}})[_0x9d8f('0x21')](function(_0x5afeea){if(_0x5afeea){_0x469010[_0x9d8f('0xa8')][_0x9d8f('0xaf')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5afeea[_0x9d8f('0x3a')]+','+(_0x469010['account'][_0x9d8f('0xb0')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x9d8f('0xb1'),_0x9d8f('0xb2'),_0x469010);});}return respondWithRpcPromise(_0x9d8f('0xb1'),_0x9d8f('0xb2'),_0x469010);})[_0x9d8f('0x21')](function(_0x51c739){if(_0x51c739){var _0x2f75ba=0xc8;var _0x19a31a=_0x9d8f('0xb3');logger[_0x9d8f('0x22')](_0x9d8f('0x24'),_0x19a31a,_0x2f75ba,_0x9d8f('0xb4'));logger[_0x9d8f('0x23')](_0x9d8f('0xb5'),_0x19a31a,_0x2f75ba,'entity\x20found',JSON[_0x9d8f('0xb6')](_0x51c739));if(_0x469010[_0x9d8f('0x89')][_0x9d8f('0x41')]==='twilio'){return _0x52cdea[_0x9d8f('0x2c')](_0x2f75ba)[_0x9d8f('0xb7')]('Content-Type',_0x9d8f('0xb8'))[_0x9d8f('0x3b')](_0x9d8f('0xb9'));}else{return _0x52cdea[_0x9d8f('0x2c')](_0x2f75ba)[_0x9d8f('0x2e')](_0x51c739);}}});})[_0x9d8f('0x2a')](handleError(_0x52cdea,null));};exports[_0x9d8f('0x3b')]=function(_0x2b7f37,_0x9344b3,_0x55804f){var _0x2366d7,_0x45e6ab,_0x59e065;if(_['isNil'](_0x2b7f37[_0x9d8f('0x5a')]['body'])||_0x2b7f37[_0x9d8f('0x5a')]['body']===''){throw new db[(_0x9d8f('0x8b'))][(_0x9d8f('0x8c'))](_0x9d8f('0x9c'));}if(_[_0x9d8f('0x9a')](_0x2b7f37[_0x9d8f('0x5a')]['to'])){throw new db[(_0x9d8f('0x8b'))][(_0x9d8f('0x8c'))](_0x9d8f('0xba'));}_0x2366d7=_0x2b7f37[_0x9d8f('0x5a')]['to'];return db[_0x9d8f('0x3f')][_0x9d8f('0x60')]({'where':{'id':_0x2b7f37[_0x9d8f('0x56')]['id']},'include':[{'model':db[_0x9d8f('0xa1')],'as':'List','include':[{'model':db[_0x9d8f('0x8a')],'as':_0x9d8f('0xa3'),'where':{'mobile':_0x2366d7},'limit':0x1,'order':[[_0x9d8f('0x90'),_0x9d8f('0xbb')]]}]}]})[_0x9d8f('0x21')](handleEntityNotFound(_0x9344b3,null))[_0x9d8f('0x21')](function(_0x4d20e9){if(_0x4d20e9&&_0x4d20e9[_0x9d8f('0xbc')]){_0x45e6ab=_0x4d20e9['get']({'plain':!![]});if(_0x45e6ab[_0x9d8f('0xbc')]&&_0x45e6ab[_0x9d8f('0xbc')]['Contacts'][_0x9d8f('0x58')]){return _0x45e6ab[_0x9d8f('0xbc')][_0x9d8f('0xa3')][0x0];}return db[_0x9d8f('0x8a')]['create'](_[_0x9d8f('0x1b')](_0x2b7f37['body'],{'firstName':_0x2366d7,'mobile':_0x2366d7,'phone':_0x2366d7,'ListId':_0x45e6ab['ListId']}));}})[_0x9d8f('0x21')](handleEntityNotFound(_0x9344b3,null))[_0x9d8f('0x21')](function(_0x3cf64f){if(_0x3cf64f){_0x59e065=_0x3cf64f;return db[_0x9d8f('0xa5')][_0x9d8f('0x60')]({'where':{'ContactId':_0x59e065['id'],'closed':![],'WhatsappAccountId':_0x45e6ab['id']}})[_0x9d8f('0x21')](function(_0x551680){if(_0x551680){return[_0x551680,![]];}return db[_0x9d8f('0xa5')]['create']({'UserId':_0x2b7f37[_0x9d8f('0x5b')]['id'],'ContactId':_0x59e065['id'],'WhatsappAccountId':_0x45e6ab['id'],'phone':_0x2366d7,'firstMsgDirection':_0x9d8f('0xbd'),'Messages':[_[_0x9d8f('0x4f')](_0x2b7f37['body'],{'read':![],'body':_0x2b7f37[_0x9d8f('0x5a')][_0x9d8f('0x5a')],'phone':_0x2366d7,'WhatsappAccountId':_0x45e6ab['id'],'UserId':_0x2b7f37[_0x9d8f('0x5b')]['id'],'ContactId':_0x59e065['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x9d8f('0xbe')}]})['then'](function(_0x4cfe41){return[_0x4cfe41,!![]];});});}})[_0x9d8f('0xbf')](function(_0x42924a,_0x3acd05){if(_0x3acd05){return _0x42924a;}return db[_0x9d8f('0x85')][_0x9d8f('0x59')](_['merge'](_0x2b7f37[_0x9d8f('0x5a')],{'read':![],'body':_0x2b7f37['body'][_0x9d8f('0x5a')],'phone':_0x2366d7,'WhatsappAccountId':_0x45e6ab['id'],'WhatsappInteractionId':_0x42924a['id'],'UserId':_0x2b7f37[_0x9d8f('0x5b')]['id'],'ContactId':_0x59e065['id']}))[_0x9d8f('0x21')](function(_0x2afcfc){_0x42924a[_0x9d8f('0xc0')][_0x9d8f('0xbe')]=[];_0x42924a['dataValues']['Messages'][_0x9d8f('0xc1')](_0x2afcfc[_0x9d8f('0xc0')]);return _0x42924a;});})[_0x9d8f('0x21')](respondWithResult(_0x9344b3,null))[_0x9d8f('0x2a')](handleError(_0x9344b3,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 3e7e15e..8c8aba9 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 _0x8335=['hasOwnProperty','exports','events','../../mysqldb','WhatsappAccount','save','update','remove','emit'];(function(_0x52c066,_0x5adc97){var _0x556731=function(_0x233d0d){while(--_0x233d0d){_0x52c066['push'](_0x52c066['shift']());}};_0x556731(++_0x5adc97);}(_0x8335,0x185));var _0x5833=function(_0x392e0f,_0x55d410){_0x392e0f=_0x392e0f-0x0;var _0x2217af=_0x8335[_0x392e0f];return _0x2217af;};'use strict';var EventEmitter=require(_0x5833('0x0'));var WhatsappAccount=require(_0x5833('0x1'))['db'][_0x5833('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5833('0x3'),'afterUpdate':_0x5833('0x4'),'afterDestroy':_0x5833('0x5')};function emitEvent(_0x148086){return function(_0x1a4dce,_0x1744c3,_0x171488){WhatsappAccountEvents[_0x5833('0x6')](_0x148086+':'+_0x1a4dce['id'],_0x1a4dce);WhatsappAccountEvents[_0x5833('0x6')](_0x148086,_0x1a4dce);_0x171488(null);};}for(var e in events){if(events[_0x5833('0x7')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x5833('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0xe96b=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','remove'];(function(_0x4fa0fe,_0x23649c){var _0x45503e=function(_0x46c795){while(--_0x46c795){_0x4fa0fe['push'](_0x4fa0fe['shift']());}};_0x45503e(++_0x23649c);}(_0xe96b,0xc2));var _0xbe96=function(_0x2b9bef,_0x2596f1){_0x2b9bef=_0x2b9bef-0x0;var _0x31a71f=_0xe96b[_0x2b9bef];return _0x31a71f;};'use strict';var EventEmitter=require(_0xbe96('0x0'));var WhatsappAccount=require(_0xbe96('0x1'))['db'][_0xbe96('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xbe96('0x3')](0x0);var events={'afterCreate':_0xbe96('0x4'),'afterUpdate':'update','afterDestroy':_0xbe96('0x5')};function emitEvent(_0xadad14){return function(_0x3fcea7,_0x4aa773,_0x3e5fce){WhatsappAccountEvents[_0xbe96('0x6')](_0xadad14+':'+_0x3fcea7['id'],_0x3fcea7);WhatsappAccountEvents[_0xbe96('0x6')](_0xadad14,_0x3fcea7);_0x3e5fce(null);};}for(var e in events){if(events[_0xbe96('0x7')](e)){var event=events[e];WhatsappAccount[_0xbe96('0x8')](e,emitEvent(event));}}module[_0xbe96('0x9')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 4b56225..de59cb1 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 _0x68ea=['rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x383778,_0x4aa4d8){var _0x30b6a7=function(_0x2c00e2){while(--_0x2c00e2){_0x383778['push'](_0x383778['shift']());}};_0x30b6a7(++_0x4aa4d8);}(_0x68ea,0x11f));var _0xa68e=function(_0x48d575,_0x163ef0){_0x48d575=_0x48d575-0x0;var _0x21c041=_0x68ea[_0x48d575];return _0x21c041;};'use strict';var _=require(_0xa68e('0x0'));var util=require(_0xa68e('0x1'));var logger=require(_0xa68e('0x2'))(_0xa68e('0x3'));var moment=require(_0xa68e('0x4'));var BPromise=require('bluebird');var rp=require(_0xa68e('0x5'));var fs=require('fs');var path=require(_0xa68e('0x6'));var rimraf=require(_0xa68e('0x7'));var config=require(_0xa68e('0x8'));var attributes=require(_0xa68e('0x9'));module[_0xa68e('0xa')]=function(_0x57eadc,_0x2d2394){return _0x57eadc[_0xa68e('0xb')](_0xa68e('0xc'),attributes,{'tableName':_0xa68e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99f2=['whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./whatsappAccount.attributes','exports','define'];(function(_0x137972,_0x36f5ba){var _0x12447d=function(_0x26392a){while(--_0x26392a){_0x137972['push'](_0x137972['shift']());}};_0x12447d(++_0x36f5ba);}(_0x99f2,0xe8));var _0x299f=function(_0x4efd19,_0x13f942){_0x4efd19=_0x4efd19-0x0;var _0x3b6425=_0x99f2[_0x4efd19];return _0x3b6425;};'use strict';var _=require(_0x299f('0x0'));var util=require(_0x299f('0x1'));var logger=require(_0x299f('0x2'))(_0x299f('0x3'));var moment=require(_0x299f('0x4'));var BPromise=require(_0x299f('0x5'));var rp=require(_0x299f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x299f('0x7'));module[_0x299f('0x8')]=function(_0x1e36b8,_0xd6bb5c){return _0x1e36b8[_0x299f('0x9')]('WhatsappAccount',attributes,{'tableName':_0x299f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 09f48ed..d7f275c 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 _0x52ac=['ShowWhatsappAccount','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','redis','defaults','./whatsappAccount.socket','register','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','WhatsappAccount','options','raw','where','include','map','attributes','model','then'];(function(_0x3f4696,_0x184faa){var _0x312523=function(_0x2c053b){while(--_0x2c053b){_0x3f4696['push'](_0x3f4696['shift']());}};_0x312523(++_0x184faa);}(_0x52ac,0xcd));var _0xc52a=function(_0x3a5df2,_0x2b5517){_0x3a5df2=_0x3a5df2-0x0;var _0x3a65b6=_0x52ac[_0x3a5df2];return _0x3a65b6;};'use strict';var _=require(_0xc52a('0x0'));var util=require(_0xc52a('0x1'));var moment=require('moment');var BPromise=require(_0xc52a('0x2'));var rs=require(_0xc52a('0x3'));var fs=require('fs');var Redis=require(_0xc52a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc52a('0x5'))(_0xc52a('0x6'));var config=require('../../config/environment');var jayson=require(_0xc52a('0x7'));var client=jayson[_0xc52a('0x8')]['http']({'port':0x232a});config[_0xc52a('0x9')]=_[_0xc52a('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc52a('0xb'))[_0xc52a('0xc')](socket);function respondWithRpcPromise(_0x2f6b3,_0x239d51,_0x330ba3){return new BPromise(function(_0x525cc9,_0x31a69c){return client[_0xc52a('0xd')](_0x2f6b3,_0x330ba3)['then'](function(_0x1cf461){logger[_0xc52a('0xe')](_0xc52a('0xf'),_0x239d51,_0xc52a('0x10'));logger[_0xc52a('0x11')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x239d51,_0xc52a('0x10'),JSON[_0xc52a('0x12')](_0x1cf461));if(_0x1cf461[_0xc52a('0x13')]){if(_0x1cf461['error'][_0xc52a('0x14')]===0x1f4){logger['error'](_0xc52a('0xf'),_0x239d51,_0x1cf461[_0xc52a('0x13')][_0xc52a('0x15')]);return _0x31a69c(_0x1cf461[_0xc52a('0x13')][_0xc52a('0x15')]);}logger[_0xc52a('0x13')](_0xc52a('0xf'),_0x239d51,_0x1cf461[_0xc52a('0x13')][_0xc52a('0x15')]);return _0x525cc9(_0x1cf461[_0xc52a('0x13')][_0xc52a('0x15')]);}else{logger[_0xc52a('0xe')](_0xc52a('0xf'),_0x239d51,_0xc52a('0x10'));_0x525cc9(_0x1cf461[_0xc52a('0x16')][_0xc52a('0x15')]);}})[_0xc52a('0x17')](function(_0x5e46a0){logger[_0xc52a('0x13')](_0xc52a('0xf'),_0x239d51,_0x5e46a0);_0x31a69c(_0x5e46a0);});});}exports['ShowWhatsappAccount']=function(_0x482da1){var _0x3e161a=this;return new Promise(function(_0x23d0db,_0x239616){return db[_0xc52a('0x18')]['find']({'raw':_0x482da1[_0xc52a('0x19')]?_0x482da1[_0xc52a('0x19')][_0xc52a('0x1a')]===undefined?!![]:![]:!![],'where':_0x482da1[_0xc52a('0x19')]?_0x482da1[_0xc52a('0x19')][_0xc52a('0x1b')]||null:null,'attributes':_0x482da1[_0xc52a('0x19')]?_0x482da1[_0xc52a('0x19')]['attributes']||null:null,'include':_0x482da1[_0xc52a('0x19')]?_0x482da1['options'][_0xc52a('0x1c')]?_[_0xc52a('0x1d')](_0x482da1[_0xc52a('0x19')][_0xc52a('0x1c')],function(_0xc9b9d2){return{'model':db[_0xc9b9d2['model']],'as':_0xc9b9d2['as'],'attributes':_0xc9b9d2[_0xc52a('0x1e')],'include':_0xc9b9d2['include']?_[_0xc52a('0x1d')](_0xc9b9d2[_0xc52a('0x1c')],function(_0x3f4b22){return{'model':db[_0x3f4b22[_0xc52a('0x1f')]],'as':_0x3f4b22['as'],'attributes':_0x3f4b22[_0xc52a('0x1e')],'include':_0x3f4b22[_0xc52a('0x1c')]?_[_0xc52a('0x1d')](_0x3f4b22['include'],function(_0x569371){return{'model':db[_0x569371[_0xc52a('0x1f')]],'as':_0x569371['as'],'attributes':_0x569371[_0xc52a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc52a('0x20')](function(_0x11d33b){logger['info']('ShowWhatsappAccount',_0x482da1);logger['debug'](_0xc52a('0x21'),_0x482da1,JSON['stringify'](_0x11d33b));_0x23d0db(_0x11d33b);})[_0xc52a('0x17')](function(_0x14cba8){logger[_0xc52a('0x13')](_0xc52a('0x21'),_0x14cba8[_0xc52a('0x15')],_0x482da1);_0x239616(_0x3e161a['error'](0x1f4,_0x14cba8[_0xc52a('0x15')]));});});}; \ No newline at end of file +var _0x281a=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappAccount,\x20%s,\x20%s','result','catch','ShowWhatsappAccount','WhatsappAccount','options','where','include','map','model','attributes','debug'];(function(_0x557df9,_0x534207){var _0x533796=function(_0x31f35e){while(--_0x31f35e){_0x557df9['push'](_0x557df9['shift']());}};_0x533796(++_0x534207);}(_0x281a,0x160));var _0xa281=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x281a[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa281('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa281('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xa281('0x2'));var logger=require(_0xa281('0x3'))(_0xa281('0x4'));var config=require('../../config/environment');var jayson=require(_0xa281('0x5'));var client=jayson['client'][_0xa281('0x6')]({'port':0x232a});config[_0xa281('0x7')]=_['defaults'](config[_0xa281('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xa281('0x8'))(new Redis(config['redis']));require(_0xa281('0x9'))[_0xa281('0xa')](socket);function respondWithRpcPromise(_0x3a755c,_0x33bef3,_0x494e7b){return new BPromise(function(_0x2e3ee9,_0x285f9b){return client[_0xa281('0xb')](_0x3a755c,_0x494e7b)[_0xa281('0xc')](function(_0x28e87b){logger[_0xa281('0xd')]('WhatsappAccount,\x20%s,\x20%s',_0x33bef3,_0xa281('0xe'));logger['debug'](_0xa281('0xf'),_0x33bef3,_0xa281('0xe'),JSON[_0xa281('0x10')](_0x28e87b));if(_0x28e87b['error']){if(_0x28e87b[_0xa281('0x11')][_0xa281('0x12')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x33bef3,_0x28e87b[_0xa281('0x11')][_0xa281('0x13')]);return _0x285f9b(_0x28e87b[_0xa281('0x11')][_0xa281('0x13')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x33bef3,_0x28e87b['error'][_0xa281('0x13')]);return _0x2e3ee9(_0x28e87b[_0xa281('0x11')]['message']);}else{logger[_0xa281('0xd')](_0xa281('0x14'),_0x33bef3,'request\x20sent');_0x2e3ee9(_0x28e87b[_0xa281('0x15')][_0xa281('0x13')]);}})[_0xa281('0x16')](function(_0x90f990){logger[_0xa281('0x11')](_0xa281('0x14'),_0x33bef3,_0x90f990);_0x285f9b(_0x90f990);});});}exports[_0xa281('0x17')]=function(_0x19065c){var _0x393872=this;return new Promise(function(_0x58c44f,_0x187b46){return db[_0xa281('0x18')]['find']({'raw':_0x19065c['options']?_0x19065c[_0xa281('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x19065c[_0xa281('0x19')]?_0x19065c[_0xa281('0x19')][_0xa281('0x1a')]||null:null,'attributes':_0x19065c[_0xa281('0x19')]?_0x19065c[_0xa281('0x19')]['attributes']||null:null,'include':_0x19065c[_0xa281('0x19')]?_0x19065c['options'][_0xa281('0x1b')]?_[_0xa281('0x1c')](_0x19065c[_0xa281('0x19')][_0xa281('0x1b')],function(_0x271dfd){return{'model':db[_0x271dfd[_0xa281('0x1d')]],'as':_0x271dfd['as'],'attributes':_0x271dfd[_0xa281('0x1e')],'include':_0x271dfd[_0xa281('0x1b')]?_[_0xa281('0x1c')](_0x271dfd[_0xa281('0x1b')],function(_0x2fa0e8){return{'model':db[_0x2fa0e8[_0xa281('0x1d')]],'as':_0x2fa0e8['as'],'attributes':_0x2fa0e8[_0xa281('0x1e')],'include':_0x2fa0e8[_0xa281('0x1b')]?_[_0xa281('0x1c')](_0x2fa0e8[_0xa281('0x1b')],function(_0x7b1305){return{'model':db[_0x7b1305[_0xa281('0x1d')]],'as':_0x7b1305['as'],'attributes':_0x7b1305[_0xa281('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa281('0xc')](function(_0x5e5312){logger['info']('ShowWhatsappAccount',_0x19065c);logger[_0xa281('0x1f')](_0xa281('0x17'),_0x19065c,JSON[_0xa281('0x10')](_0x5e5312));_0x58c44f(_0x5e5312);})[_0xa281('0x16')](function(_0x4bf25f){logger[_0xa281('0x11')]('ShowWhatsappAccount',_0x4bf25f['message'],_0x19065c);_0x187b46(_0x393872[_0xa281('0x11')](0x1f4,_0x4bf25f['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 551fb28..ce97b3e 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 _0x74fc=['remove','update','emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x153e72,_0x1cde75){var _0x2d060f=function(_0xdfa3b0){while(--_0xdfa3b0){_0x153e72['push'](_0x153e72['shift']());}};_0x2d060f(++_0x1cde75);}(_0x74fc,0xef));var _0xc74f=function(_0x45552e,_0x1094d9){_0x45552e=_0x45552e-0x0;var _0x206008=_0x74fc[_0x45552e];return _0x206008;};'use strict';var WhatsappAccountEvents=require(_0xc74f('0x0'));var events=['save',_0xc74f('0x1'),_0xc74f('0x2')];function createListener(_0x3ddfe1,_0x4a45a7){return function(_0x2caad2){_0x4a45a7[_0xc74f('0x3')](_0x3ddfe1,_0x2caad2);};}function removeListener(_0x291c99,_0x8ba0d9){return function(){WhatsappAccountEvents[_0xc74f('0x4')](_0x291c99,_0x8ba0d9);};}exports[_0xc74f('0x5')]=function(_0x5ac710){for(var _0x4819a9=0x0,_0x43854d=events[_0xc74f('0x6')];_0x4819a9<_0x43854d;_0x4819a9++){var _0x41c919=events[_0x4819a9];var _0x4ae605=createListener(_0xc74f('0x7')+_0x41c919,_0x5ac710);WhatsappAccountEvents['on'](_0x41c919,_0x4ae605);}}; \ No newline at end of file +var _0x18df=['length','whatsappAccount:','./whatsappAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x2a247d,_0x31b76e){var _0x42358b=function(_0x4897aa){while(--_0x4897aa){_0x2a247d['push'](_0x2a247d['shift']());}};_0x42358b(++_0x31b76e);}(_0x18df,0x134));var _0xf18d=function(_0x229290,_0x58a651){_0x229290=_0x229290-0x0;var _0x3f463f=_0x18df[_0x229290];return _0x3f463f;};'use strict';var WhatsappAccountEvents=require(_0xf18d('0x0'));var events=[_0xf18d('0x1'),_0xf18d('0x2'),_0xf18d('0x3')];function createListener(_0x450dde,_0xa9012a){return function(_0x52f1d3){_0xa9012a[_0xf18d('0x4')](_0x450dde,_0x52f1d3);};}function removeListener(_0x258f40,_0x4b1320){return function(){WhatsappAccountEvents[_0xf18d('0x5')](_0x258f40,_0x4b1320);};}exports[_0xf18d('0x6')]=function(_0x3df182){for(var _0x4dd193=0x0,_0x4b9bab=events[_0xf18d('0x7')];_0x4dd193<_0x4b9bab;_0x4dd193++){var _0x4a212e=events[_0x4dd193];var _0x4b2a16=createListener(_0xf18d('0x8')+_0x4a212e,_0x3df182);WhatsappAccountEvents['on'](_0x4a212e,_0x4b2a16);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 949f0b8..37c8eea 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 _0x45cd=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x5ce15c,_0x19c917){var _0x36e4f5=function(_0x50fa90){while(--_0x50fa90){_0x5ce15c['push'](_0x5ce15c['shift']());}};_0x36e4f5(++_0x19c917);}(_0x45cd,0xda));var _0xd45c=function(_0x43bc4a,_0x3ce804){_0x43bc4a=_0x43bc4a-0x0;var _0x329f7d=_0x45cd[_0x43bc4a];return _0x329f7d;};'use strict';var multer=require(_0xd45c('0x0'));var util=require('util');var path=require(_0xd45c('0x1'));var timeout=require(_0xd45c('0x2'));var express=require(_0xd45c('0x3'));var router=express[_0xd45c('0x4')]();var fs_extra=require(_0xd45c('0x5'));var auth=require(_0xd45c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd45c('0x7'));router[_0xd45c('0x8')]('/',auth[_0xd45c('0x9')](),controller[_0xd45c('0xa')]);router['get'](_0xd45c('0xb'),auth[_0xd45c('0x9')](),controller[_0xd45c('0xc')]);router[_0xd45c('0xd')]('/',auth[_0xd45c('0x9')](),controller['create']);router[_0xd45c('0xe')](_0xd45c('0xb'),auth['isAuthenticated'](),controller[_0xd45c('0xf')]);router['delete'](_0xd45c('0xb'),auth[_0xd45c('0x9')](),controller[_0xd45c('0x10')]);module[_0xd45c('0x11')]=router; \ No newline at end of file +var _0x1d9f=['./whatsappApplication.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2ce6d5,_0x333e0c){var _0x32d272=function(_0x399f0b){while(--_0x399f0b){_0x2ce6d5['push'](_0x2ce6d5['shift']());}};_0x32d272(++_0x333e0c);}(_0x1d9f,0x114));var _0xf1d9=function(_0x14bea3,_0x436ec5){_0x14bea3=_0x14bea3-0x0;var _0x59bae7=_0x1d9f[_0x14bea3];return _0x59bae7;};'use strict';var multer=require(_0xf1d9('0x0'));var util=require(_0xf1d9('0x1'));var path=require(_0xf1d9('0x2'));var timeout=require('connect-timeout');var express=require(_0xf1d9('0x3'));var router=express[_0xf1d9('0x4')]();var fs_extra=require(_0xf1d9('0x5'));var auth=require(_0xf1d9('0x6'));var interaction=require(_0xf1d9('0x7'));var config=require(_0xf1d9('0x8'));var controller=require(_0xf1d9('0x9'));router[_0xf1d9('0xa')]('/',auth[_0xf1d9('0xb')](),controller['index']);router[_0xf1d9('0xa')](_0xf1d9('0xc'),auth[_0xf1d9('0xb')](),controller[_0xf1d9('0xd')]);router[_0xf1d9('0xe')]('/',auth['isAuthenticated'](),controller[_0xf1d9('0xf')]);router[_0xf1d9('0x10')](_0xf1d9('0xc'),auth[_0xf1d9('0xb')](),controller[_0xf1d9('0x11')]);router['delete'](_0xf1d9('0xc'),auth[_0xf1d9('0xb')](),controller[_0xf1d9('0x12')]);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 4d061c4..34d9af8 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 _0xbc9b=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x8a29c0,_0x1328c6){var _0x4482f7=function(_0xc0d469){while(--_0xc0d469){_0x8a29c0['push'](_0x8a29c0['shift']());}};_0x4482f7(++_0x1328c6);}(_0xbc9b,0x69));var _0xbbc9=function(_0x36051d,_0x87dac8){_0x36051d=_0x36051d-0x0;var _0x85531e=_0xbc9b[_0x36051d];return _0x85531e;};'use strict';var Sequelize=require('sequelize');module[_0xbbc9('0x0')]={'priority':{'type':Sequelize[_0xbbc9('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xbbc9('0x2')],'allowNull':![],'defaultValue':_0xbbc9('0x3')},'appdata':{'type':Sequelize[_0xbbc9('0x4')]()},'description':{'type':Sequelize[_0xbbc9('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xbbc9('0x5')}}; \ No newline at end of file +var _0x3a89=['*,*,*,*','sequelize','STRING','noop'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3a89,0x1ed));var _0x93a8=function(_0x43ba87,_0x3ddc7e){_0x43ba87=_0x43ba87-0x0;var _0x23fa6a=_0x3a89[_0x43ba87];return _0x23fa6a;};'use strict';var Sequelize=require(_0x93a8('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x93a8('0x1')],'allowNull':![],'defaultValue':_0x93a8('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x93a8('0x3')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 0f204c1..f2b86ec 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 _0xb923=['filters','pick','filter','merge','type','VIRTUAL','includeAll','include','WhatsappApplication','findAll','rows','catch','params','length','options','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','index','rawAttributes','fieldName','map','keys','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where'];(function(_0x5d54aa,_0x492c49){var _0x15ffe0=function(_0x1ead36){while(--_0x1ead36){_0x5d54aa['push'](_0x5d54aa['shift']());}};_0x15ffe0(++_0x492c49);}(_0xb923,0xa2));var _0x3b92=function(_0x17c77f,_0x200dad){_0x17c77f=_0x17c77f-0x0;var _0x180363=_0xb923[_0x17c77f];return _0x180363;};'use strict';var emlformat=require(_0x3b92('0x0'));var rimraf=require(_0x3b92('0x1'));var zipdir=require(_0x3b92('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3b92('0x3'));var moment=require(_0x3b92('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x3b92('0x5'));var sox=require(_0x3b92('0x6'));var csv=require(_0x3b92('0x7'));var ejs=require(_0x3b92('0x8'));var fs=require('fs');var fs_extra=require(_0x3b92('0x9'));var _=require(_0x3b92('0xa'));var squel=require(_0x3b92('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3b92('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3b92('0xd'));var Papa=require(_0x3b92('0xe'));var Redis=require('ioredis');var authService=require(_0x3b92('0xf'));var qs=require(_0x3b92('0x10'));var as=require(_0x3b92('0x11'));var hardwareService=require(_0x3b92('0x12'));var logger=require(_0x3b92('0x13'))('api');var utils=require(_0x3b92('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3b92('0x15'))['db'];function respondWithStatusCode(_0xdcd2b6,_0x2c4dcc){_0x2c4dcc=_0x2c4dcc||0xcc;return function(_0x3ae230){if(_0x3ae230){return _0xdcd2b6['sendStatus'](_0x2c4dcc);}return _0xdcd2b6['status'](_0x2c4dcc)[_0x3b92('0x16')]();};}function respondWithResult(_0x5524e8,_0x51143b){_0x51143b=_0x51143b||0xc8;return function(_0x10545c){if(_0x10545c){return _0x5524e8[_0x3b92('0x17')](_0x51143b)[_0x3b92('0x18')](_0x10545c);}};}function respondWithFilteredResult(_0x2470b7,_0x38bcd7){return function(_0x59bdfd){if(_0x59bdfd){var _0xd7995d=typeof _0x38bcd7[_0x3b92('0x19')]==='undefined'&&typeof _0x38bcd7['limit']===_0x3b92('0x1a');var _0x16dc44=_0x59bdfd[_0x3b92('0x1b')];var _0x1859b4=_0xd7995d?0x0:_0x38bcd7[_0x3b92('0x19')];var _0xc2cd15=_0xd7995d?_0x59bdfd[_0x3b92('0x1b')]:_0x38bcd7[_0x3b92('0x19')]+_0x38bcd7[_0x3b92('0x1c')];var _0x17225b;if(_0xc2cd15>=_0x16dc44){_0xc2cd15=_0x16dc44;_0x17225b=0xc8;}else{_0x17225b=0xce;}_0x2470b7[_0x3b92('0x17')](_0x17225b);return _0x2470b7[_0x3b92('0x1d')](_0x3b92('0x1e'),_0x1859b4+'-'+_0xc2cd15+'/'+_0x16dc44)['json'](_0x59bdfd);}return null;};}function patchUpdates(_0x35a3b1){return function(_0x237de3){try{jsonpatch[_0x3b92('0x1f')](_0x237de3,_0x35a3b1,!![]);}catch(_0x95e51c){return BPromise[_0x3b92('0x20')](_0x95e51c);}return _0x237de3[_0x3b92('0x21')]();};}function saveUpdates(_0x52b452,_0x14fbe0){return function(_0x26fc01){if(_0x26fc01){return _0x26fc01['update'](_0x52b452)['then'](function(_0x51efee){return _0x51efee;});}return null;};}function removeEntity(_0x54ac98,_0x450f2e){return function(_0x4715b6){if(_0x4715b6){return _0x4715b6[_0x3b92('0x22')]()[_0x3b92('0x23')](function(){_0x54ac98[_0x3b92('0x17')](0xcc)[_0x3b92('0x16')]();});}};}function handleEntityNotFound(_0x427a90,_0x5642b1){return function(_0x37c844){if(!_0x37c844){_0x427a90['sendStatus'](0x194);}return _0x37c844;};}function handleError(_0x2f1f58,_0x5381c3){_0x5381c3=_0x5381c3||0x1f4;return function(_0x24a15f){logger[_0x3b92('0x24')](_0x24a15f[_0x3b92('0x25')]);if(_0x24a15f[_0x3b92('0x26')]){delete _0x24a15f[_0x3b92('0x26')];}_0x2f1f58[_0x3b92('0x17')](_0x5381c3)['send'](_0x24a15f);};}exports[_0x3b92('0x27')]=function(_0xd3b5ce,_0x1299e0){var _0x56cc59={},_0x4ac7b4={},_0x1c5a18={'count':0x0,'rows':[]};var _0x3d96d5=_['map'](db['WhatsappApplication'][_0x3b92('0x28')],function(_0x5f3763){return{'name':_0x5f3763[_0x3b92('0x29')],'type':_0x5f3763['type']['key']};});_0x4ac7b4['model']=_[_0x3b92('0x2a')](_0x3d96d5,_0x3b92('0x26'));_0x4ac7b4['query']=_[_0x3b92('0x2b')](_0xd3b5ce[_0x3b92('0x2c')]);_0x4ac7b4['filters']=_[_0x3b92('0x2d')](_0x4ac7b4[_0x3b92('0x2e')],_0x4ac7b4[_0x3b92('0x2c')]);_0x56cc59['attributes']=_['intersection'](_0x4ac7b4[_0x3b92('0x2e')],qs[_0x3b92('0x2f')](_0xd3b5ce[_0x3b92('0x2c')]['fields']));_0x56cc59['attributes']=_0x56cc59[_0x3b92('0x30')]['length']?_0x56cc59[_0x3b92('0x30')]:_0x4ac7b4[_0x3b92('0x2e')];if(!_0xd3b5ce[_0x3b92('0x2c')][_0x3b92('0x31')](_0x3b92('0x32'))){_0x56cc59[_0x3b92('0x1c')]=qs[_0x3b92('0x1c')](_0xd3b5ce['query'][_0x3b92('0x1c')]);_0x56cc59[_0x3b92('0x19')]=qs[_0x3b92('0x19')](_0xd3b5ce['query'][_0x3b92('0x19')]);}_0x56cc59[_0x3b92('0x33')]=qs[_0x3b92('0x34')](_0xd3b5ce[_0x3b92('0x2c')][_0x3b92('0x34')]);_0x56cc59[_0x3b92('0x35')]=qs[_0x3b92('0x36')](_[_0x3b92('0x37')](_0xd3b5ce[_0x3b92('0x2c')],_0x4ac7b4[_0x3b92('0x36')]),_0x3d96d5);if(_0xd3b5ce[_0x3b92('0x2c')][_0x3b92('0x38')]){_0x56cc59[_0x3b92('0x35')]=_[_0x3b92('0x39')](_0x56cc59[_0x3b92('0x35')],{'$or':_[_0x3b92('0x2a')](_0x3d96d5,function(_0x407c54){if(_0x407c54[_0x3b92('0x3a')]!==_0x3b92('0x3b')){var _0x40dcb8={};_0x40dcb8[_0x407c54[_0x3b92('0x26')]]={'$like':'%'+_0xd3b5ce[_0x3b92('0x2c')][_0x3b92('0x38')]+'%'};return _0x40dcb8;}})});}_0x56cc59=_[_0x3b92('0x39')]({},_0x56cc59,_0xd3b5ce['options']);var _0x4423cb={'where':_0x56cc59[_0x3b92('0x35')]};return db['WhatsappApplication'][_0x3b92('0x1b')](_0x4423cb)[_0x3b92('0x23')](function(_0x422415){_0x1c5a18[_0x3b92('0x1b')]=_0x422415;if(_0xd3b5ce[_0x3b92('0x2c')][_0x3b92('0x3c')]){_0x56cc59[_0x3b92('0x3d')]=[{'all':!![]}];}return db[_0x3b92('0x3e')][_0x3b92('0x3f')](_0x56cc59);})['then'](function(_0xe94b3b){_0x1c5a18[_0x3b92('0x40')]=_0xe94b3b;return _0x1c5a18;})['then'](respondWithFilteredResult(_0x1299e0,_0x56cc59))[_0x3b92('0x41')](handleError(_0x1299e0,null));};exports['show']=function(_0x23c17e,_0x5906f0){var _0x18e6f4={'raw':!![],'where':{'id':_0x23c17e[_0x3b92('0x42')]['id']}},_0xf54dd1={};_0xf54dd1[_0x3b92('0x2e')]=_[_0x3b92('0x2b')](db['WhatsappApplication'][_0x3b92('0x28')]);_0xf54dd1[_0x3b92('0x2c')]=_[_0x3b92('0x2b')](_0x23c17e[_0x3b92('0x2c')]);_0xf54dd1[_0x3b92('0x36')]=_[_0x3b92('0x2d')](_0xf54dd1[_0x3b92('0x2e')],_0xf54dd1['query']);_0x18e6f4[_0x3b92('0x30')]=_[_0x3b92('0x2d')](_0xf54dd1[_0x3b92('0x2e')],qs['fields'](_0x23c17e[_0x3b92('0x2c')]['fields']));_0x18e6f4[_0x3b92('0x30')]=_0x18e6f4[_0x3b92('0x30')][_0x3b92('0x43')]?_0x18e6f4[_0x3b92('0x30')]:_0xf54dd1[_0x3b92('0x2e')];if(_0x23c17e['query']['includeAll']){_0x18e6f4[_0x3b92('0x3d')]=[{'all':!![]}];}_0x18e6f4=_['merge']({},_0x18e6f4,_0x23c17e[_0x3b92('0x44')]);return db['WhatsappApplication'][_0x3b92('0x45')](_0x18e6f4)['then'](handleEntityNotFound(_0x5906f0,null))[_0x3b92('0x23')](respondWithResult(_0x5906f0,null))[_0x3b92('0x41')](handleError(_0x5906f0,null));};exports['create']=function(_0x2624db,_0x22b7a4){return db[_0x3b92('0x3e')][_0x3b92('0x46')](_0x2624db[_0x3b92('0x47')],{})[_0x3b92('0x23')](respondWithResult(_0x22b7a4,0xc9))['catch'](handleError(_0x22b7a4,null));};exports['update']=function(_0x45e4ce,_0x2c1d45){if(_0x45e4ce[_0x3b92('0x47')]['id']){delete _0x45e4ce[_0x3b92('0x47')]['id'];}return db[_0x3b92('0x3e')][_0x3b92('0x45')]({'where':{'id':_0x45e4ce[_0x3b92('0x42')]['id']}})['then'](handleEntityNotFound(_0x2c1d45,null))[_0x3b92('0x23')](saveUpdates(_0x45e4ce[_0x3b92('0x47')],null))[_0x3b92('0x23')](respondWithResult(_0x2c1d45,null))[_0x3b92('0x41')](handleError(_0x2c1d45,null));};exports[_0x3b92('0x22')]=function(_0x120713,_0xdf0884){return db[_0x3b92('0x3e')][_0x3b92('0x45')]({'where':{'id':_0x120713[_0x3b92('0x42')]['id']}})[_0x3b92('0x23')](handleEntityNotFound(_0xdf0884,null))['then'](removeEntity(_0xdf0884,null))[_0x3b92('0x41')](handleError(_0xdf0884,null));}; \ No newline at end of file +var _0x235b=['bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','WhatsappApplication','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','where','filter','merge','type','options','includeAll','include','findAll','catch','show','params','rawAttributes','fields','create','body','find','eml-format','fast-json-patch','request-promise','moment'];(function(_0x4a29a9,_0x58cd04){var _0x386570=function(_0x1d2d09){while(--_0x1d2d09){_0x4a29a9['push'](_0x4a29a9['shift']());}};_0x386570(++_0x58cd04);}(_0x235b,0x1ed));var _0xb235=function(_0x7d20a1,_0x1eb4b0){_0x7d20a1=_0x7d20a1-0x0;var _0x4abebe=_0x235b[_0x7d20a1];return _0x4abebe;};'use strict';var emlformat=require(_0xb235('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb235('0x1'));var rp=require(_0xb235('0x2'));var moment=require(_0xb235('0x3'));var BPromise=require(_0xb235('0x4'));var Mustache=require(_0xb235('0x5'));var util=require(_0xb235('0x6'));var path=require('path');var sox=require(_0xb235('0x7'));var csv=require(_0xb235('0x8'));var ejs=require(_0xb235('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb235('0xa'));var squel=require(_0xb235('0xb'));var crypto=require(_0xb235('0xc'));var jsforce=require(_0xb235('0xd'));var deskjs=require(_0xb235('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb235('0xf'));var Redis=require(_0xb235('0x10'));var authService=require(_0xb235('0x11'));var qs=require(_0xb235('0x12'));var as=require(_0xb235('0x13'));var hardwareService=require(_0xb235('0x14'));var logger=require(_0xb235('0x15'))(_0xb235('0x16'));var utils=require('../../config/utils');var config=require(_0xb235('0x17'));var licenseUtil=require(_0xb235('0x18'));var db=require(_0xb235('0x19'))['db'];function respondWithStatusCode(_0x4e9804,_0x438371){_0x438371=_0x438371||0xcc;return function(_0x5aee68){if(_0x5aee68){return _0x4e9804[_0xb235('0x1a')](_0x438371);}return _0x4e9804[_0xb235('0x1b')](_0x438371)[_0xb235('0x1c')]();};}function respondWithResult(_0x147c1e,_0x47510a){_0x47510a=_0x47510a||0xc8;return function(_0xfa8e36){if(_0xfa8e36){return _0x147c1e[_0xb235('0x1b')](_0x47510a)['json'](_0xfa8e36);}};}function respondWithFilteredResult(_0xa2ac23,_0x2f5a4d){return function(_0x3d6ebc){if(_0x3d6ebc){var _0xa5e185=typeof _0x2f5a4d[_0xb235('0x1d')]===_0xb235('0x1e')&&typeof _0x2f5a4d[_0xb235('0x1f')]===_0xb235('0x1e');var _0x2d6520=_0x3d6ebc[_0xb235('0x20')];var _0x2f1c46=_0xa5e185?0x0:_0x2f5a4d[_0xb235('0x1d')];var _0x1f7cb9=_0xa5e185?_0x3d6ebc['count']:_0x2f5a4d[_0xb235('0x1d')]+_0x2f5a4d['limit'];var _0x2d3e1c;if(_0x1f7cb9>=_0x2d6520){_0x1f7cb9=_0x2d6520;_0x2d3e1c=0xc8;}else{_0x2d3e1c=0xce;}_0xa2ac23['status'](_0x2d3e1c);return _0xa2ac23[_0xb235('0x21')](_0xb235('0x22'),_0x2f1c46+'-'+_0x1f7cb9+'/'+_0x2d6520)['json'](_0x3d6ebc);}return null;};}function patchUpdates(_0x447ec6){return function(_0x3a9699){try{jsonpatch[_0xb235('0x23')](_0x3a9699,_0x447ec6,!![]);}catch(_0x2ed3e4){return BPromise[_0xb235('0x24')](_0x2ed3e4);}return _0x3a9699['save']();};}function saveUpdates(_0x26d55d,_0x12f787){return function(_0x403abf){if(_0x403abf){return _0x403abf[_0xb235('0x25')](_0x26d55d)[_0xb235('0x26')](function(_0x38561e){return _0x38561e;});}return null;};}function removeEntity(_0x57a3a8,_0x3eaa0d){return function(_0x57d7f5){if(_0x57d7f5){return _0x57d7f5[_0xb235('0x27')]()[_0xb235('0x26')](function(){_0x57a3a8[_0xb235('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5698b6,_0x4c4df1){return function(_0x21676c){if(!_0x21676c){_0x5698b6['sendStatus'](0x194);}return _0x21676c;};}function handleError(_0x493bd2,_0x1f0790){_0x1f0790=_0x1f0790||0x1f4;return function(_0x1c6621){logger[_0xb235('0x28')](_0x1c6621['stack']);if(_0x1c6621[_0xb235('0x29')]){delete _0x1c6621['name'];}_0x493bd2['status'](_0x1f0790)[_0xb235('0x2a')](_0x1c6621);};}exports[_0xb235('0x2b')]=function(_0x3751bd,_0x4fe640){var _0xa6def8={},_0x3b66e1={},_0x235df0={'count':0x0,'rows':[]};var _0x52f52e=_['map'](db[_0xb235('0x2c')]['rawAttributes'],function(_0x130574){return{'name':_0x130574['fieldName'],'type':_0x130574['type'][_0xb235('0x2d')]};});_0x3b66e1[_0xb235('0x2e')]=_['map'](_0x52f52e,_0xb235('0x29'));_0x3b66e1[_0xb235('0x2f')]=_[_0xb235('0x30')](_0x3751bd[_0xb235('0x2f')]);_0x3b66e1[_0xb235('0x31')]=_[_0xb235('0x32')](_0x3b66e1[_0xb235('0x2e')],_0x3b66e1[_0xb235('0x2f')]);_0xa6def8[_0xb235('0x33')]=_[_0xb235('0x32')](_0x3b66e1['model'],qs['fields'](_0x3751bd[_0xb235('0x2f')]['fields']));_0xa6def8['attributes']=_0xa6def8[_0xb235('0x33')][_0xb235('0x34')]?_0xa6def8[_0xb235('0x33')]:_0x3b66e1[_0xb235('0x2e')];if(!_0x3751bd[_0xb235('0x2f')]['hasOwnProperty'](_0xb235('0x35'))){_0xa6def8[_0xb235('0x1f')]=qs[_0xb235('0x1f')](_0x3751bd[_0xb235('0x2f')][_0xb235('0x1f')]);_0xa6def8[_0xb235('0x1d')]=qs[_0xb235('0x1d')](_0x3751bd[_0xb235('0x2f')]['offset']);}_0xa6def8[_0xb235('0x36')]=qs['sort'](_0x3751bd[_0xb235('0x2f')]['sort']);_0xa6def8[_0xb235('0x37')]=qs[_0xb235('0x31')](_['pick'](_0x3751bd[_0xb235('0x2f')],_0x3b66e1['filters']),_0x52f52e);if(_0x3751bd[_0xb235('0x2f')][_0xb235('0x38')]){_0xa6def8[_0xb235('0x37')]=_[_0xb235('0x39')](_0xa6def8['where'],{'$or':_['map'](_0x52f52e,function(_0x126218){if(_0x126218[_0xb235('0x3a')]!=='VIRTUAL'){var _0x473cd9={};_0x473cd9[_0x126218['name']]={'$like':'%'+_0x3751bd[_0xb235('0x2f')]['filter']+'%'};return _0x473cd9;}})});}_0xa6def8=_[_0xb235('0x39')]({},_0xa6def8,_0x3751bd[_0xb235('0x3b')]);var _0x3f4a74={'where':_0xa6def8['where']};return db[_0xb235('0x2c')][_0xb235('0x20')](_0x3f4a74)[_0xb235('0x26')](function(_0x3b468b){_0x235df0['count']=_0x3b468b;if(_0x3751bd[_0xb235('0x2f')][_0xb235('0x3c')]){_0xa6def8[_0xb235('0x3d')]=[{'all':!![]}];}return db[_0xb235('0x2c')][_0xb235('0x3e')](_0xa6def8);})[_0xb235('0x26')](function(_0x274ed8){_0x235df0['rows']=_0x274ed8;return _0x235df0;})[_0xb235('0x26')](respondWithFilteredResult(_0x4fe640,_0xa6def8))[_0xb235('0x3f')](handleError(_0x4fe640,null));};exports[_0xb235('0x40')]=function(_0x1ddc0f,_0x457a5a){var _0x5ad7ef={'raw':!![],'where':{'id':_0x1ddc0f[_0xb235('0x41')]['id']}},_0x4f243a={};_0x4f243a[_0xb235('0x2e')]=_[_0xb235('0x30')](db['WhatsappApplication'][_0xb235('0x42')]);_0x4f243a[_0xb235('0x2f')]=_[_0xb235('0x30')](_0x1ddc0f[_0xb235('0x2f')]);_0x4f243a[_0xb235('0x31')]=_[_0xb235('0x32')](_0x4f243a['model'],_0x4f243a['query']);_0x5ad7ef['attributes']=_[_0xb235('0x32')](_0x4f243a[_0xb235('0x2e')],qs[_0xb235('0x43')](_0x1ddc0f[_0xb235('0x2f')][_0xb235('0x43')]));_0x5ad7ef[_0xb235('0x33')]=_0x5ad7ef['attributes'][_0xb235('0x34')]?_0x5ad7ef[_0xb235('0x33')]:_0x4f243a[_0xb235('0x2e')];if(_0x1ddc0f[_0xb235('0x2f')][_0xb235('0x3c')]){_0x5ad7ef[_0xb235('0x3d')]=[{'all':!![]}];}_0x5ad7ef=_[_0xb235('0x39')]({},_0x5ad7ef,_0x1ddc0f['options']);return db['WhatsappApplication']['find'](_0x5ad7ef)[_0xb235('0x26')](handleEntityNotFound(_0x457a5a,null))['then'](respondWithResult(_0x457a5a,null))[_0xb235('0x3f')](handleError(_0x457a5a,null));};exports[_0xb235('0x44')]=function(_0x1d0916,_0x21b2aa){return db[_0xb235('0x2c')]['create'](_0x1d0916['body'],{})['then'](respondWithResult(_0x21b2aa,0xc9))[_0xb235('0x3f')](handleError(_0x21b2aa,null));};exports[_0xb235('0x25')]=function(_0x478ae8,_0x23276b){if(_0x478ae8[_0xb235('0x45')]['id']){delete _0x478ae8['body']['id'];}return db[_0xb235('0x2c')][_0xb235('0x46')]({'where':{'id':_0x478ae8['params']['id']}})['then'](handleEntityNotFound(_0x23276b,null))[_0xb235('0x26')](saveUpdates(_0x478ae8['body'],null))[_0xb235('0x26')](respondWithResult(_0x23276b,null))[_0xb235('0x3f')](handleError(_0x23276b,null));};exports[_0xb235('0x27')]=function(_0x4db9fe,_0xe2f5d0){return db['WhatsappApplication'][_0xb235('0x46')]({'where':{'id':_0x4db9fe[_0xb235('0x41')]['id']}})[_0xb235('0x26')](handleEntityNotFound(_0xe2f5d0,null))[_0xb235('0x26')](removeEntity(_0xe2f5d0,null))[_0xb235('0x3f')](handleError(_0xe2f5d0,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index d211a07..0de785f 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 _0x17ba=['request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0xd055e1,_0x99628e){var _0x1f3b41=function(_0x2d2c12){while(--_0x2d2c12){_0xd055e1['push'](_0xd055e1['shift']());}};_0x1f3b41(++_0x99628e);}(_0x17ba,0xab));var _0xa17b=function(_0x3ebcc3,_0x20d1a5){_0x3ebcc3=_0x3ebcc3-0x0;var _0x15b720=_0x17ba[_0x3ebcc3];return _0x15b720;};'use strict';var _=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var logger=require('../../config/logger')(_0xa17b('0x2'));var moment=require(_0xa17b('0x3'));var BPromise=require(_0xa17b('0x4'));var rp=require(_0xa17b('0x5'));var fs=require('fs');var path=require(_0xa17b('0x6'));var rimraf=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var attributes=require(_0xa17b('0x9'));module[_0xa17b('0xa')]=function(_0x3cced2,_0xf72ed4){return _0x3cced2[_0xa17b('0xb')](_0xa17b('0xc'),attributes,{'tableName':_0xa17b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa17b('0xe'),'collate':_0xa17b('0xf')});}; \ No newline at end of file +var _0xb717=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xb717,0x1b4));var _0x7b71=function(_0xfd8609,_0x4fafde){_0xfd8609=_0xfd8609-0x0;var _0x2514c1=_0xb717[_0xfd8609];return _0x2514c1;};'use strict';var _=require(_0x7b71('0x0'));var util=require('util');var logger=require(_0x7b71('0x1'))('api');var moment=require(_0x7b71('0x2'));var BPromise=require(_0x7b71('0x3'));var rp=require(_0x7b71('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b71('0x5'));var config=require(_0x7b71('0x6'));var attributes=require(_0x7b71('0x7'));module[_0x7b71('0x8')]=function(_0x3d3643,_0x593c15){return _0x3d3643[_0x7b71('0x9')](_0x7b71('0xa'),attributes,{'tableName':_0x7b71('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7b71('0xc'),'collate':_0x7b71('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index e45d21b..aea6cc8 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 _0x5fd1=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash'];(function(_0x21622a,_0x24224b){var _0x30ecd0=function(_0x3c1836){while(--_0x3c1836){_0x21622a['push'](_0x21622a['shift']());}};_0x30ecd0(++_0x24224b);}(_0x5fd1,0x155));var _0x15fd=function(_0x227212,_0x2ea1f8){_0x227212=_0x227212-0x0;var _0x498e83=_0x5fd1[_0x227212];return _0x498e83;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e88bf,_0x225728,_0x534e63){return new BPromise(function(_0x210e90,_0x1ee117){return client[_0x15fd('0xa')](_0x2e88bf,_0x534e63)['then'](function(_0x2d2fbb){logger['info'](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x225728,'request\x20sent',JSON[_0x15fd('0xd')](_0x2d2fbb));if(_0x2d2fbb[_0x15fd('0xe')]){if(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0xf')]===0x1f4){logger[_0x15fd('0xe')](_0x15fd('0xb'),_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x1ee117(_0x2d2fbb[_0x15fd('0xe')]['message']);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x210e90(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);}else{logger[_0x15fd('0x11')](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));_0x210e90(_0x2d2fbb[_0x15fd('0x12')]['message']);}})['catch'](function(_0x25f139){logger['error'](_0x15fd('0xb'),_0x225728,_0x25f139);_0x1ee117(_0x25f139);});});} \ No newline at end of file +var _0x4bc3=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x33d79d,_0x25afff){var _0x58a58e=function(_0x259cec){while(--_0x259cec){_0x33d79d['push'](_0x33d79d['shift']());}};_0x58a58e(++_0x25afff);}(_0x4bc3,0x16e));var _0x34bc=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x4bc3[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var moment=require('moment');var BPromise=require(_0x34bc('0x2'));var rs=require(_0x34bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34bc('0x4'))['db'];var utils=require(_0x34bc('0x5'));var logger=require(_0x34bc('0x6'))(_0x34bc('0x7'));var config=require(_0x34bc('0x8'));var jayson=require(_0x34bc('0x9'));var client=jayson[_0x34bc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21451b,_0x50320d,_0x502087){return new BPromise(function(_0x18a01c,_0x474108){return client[_0x34bc('0xb')](_0x21451b,_0x502087)[_0x34bc('0xc')](function(_0x409105){logger[_0x34bc('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x50320d,'request\x20sent');logger[_0x34bc('0xe')](_0x34bc('0xf'),_0x50320d,_0x34bc('0x10'),JSON['stringify'](_0x409105));if(_0x409105[_0x34bc('0x11')]){if(_0x409105['error'][_0x34bc('0x12')]===0x1f4){logger[_0x34bc('0x11')](_0x34bc('0x13'),_0x50320d,_0x409105['error'][_0x34bc('0x14')]);return _0x474108(_0x409105['error'][_0x34bc('0x14')]);}logger[_0x34bc('0x11')](_0x34bc('0x13'),_0x50320d,_0x409105['error']['message']);return _0x18a01c(_0x409105[_0x34bc('0x11')]['message']);}else{logger[_0x34bc('0xd')](_0x34bc('0x13'),_0x50320d,_0x34bc('0x10'));_0x18a01c(_0x409105[_0x34bc('0x15')][_0x34bc('0x14')]);}})[_0x34bc('0x16')](function(_0x5e132d){logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x50320d,_0x5e132d);_0x474108(_0x5e132d);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index f2eb75e..35ba146 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 _0x56a4=['create','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','/:id','whatsappinteraction:update','update','delete','whatsapp','whatsappinteraction:destroy','removeTags','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','isAuthenticated','describe','/:id/messages','getMessages','/:id/download','download','post'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0x56a4,0x11b));var _0x456a=function(_0x2ddf2d,_0x272b8a){_0x2ddf2d=_0x2ddf2d-0x0;var _0x53dd02=_0x56a4[_0x2ddf2d];return _0x53dd02;};'use strict';var multer=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var path=require('path');var timeout=require(_0x456a('0x2'));var express=require(_0x456a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x456a('0x4'));var interaction=require(_0x456a('0x5'));var config=require(_0x456a('0x6'));var controller=require(_0x456a('0x7'));router[_0x456a('0x8')]('/',auth['isAuthenticated'](),controller[_0x456a('0x9')]);router['get']('/describe',auth[_0x456a('0xa')](),controller[_0x456a('0xb')]);router[_0x456a('0x8')]('/:id',auth[_0x456a('0xa')](),controller['show']);router[_0x456a('0x8')](_0x456a('0xc'),auth[_0x456a('0xa')](),controller[_0x456a('0xd')]);router[_0x456a('0x8')](_0x456a('0xe'),auth[_0x456a('0xa')](),controller[_0x456a('0xf')]);router[_0x456a('0x10')]('/',auth[_0x456a('0xa')](),controller[_0x456a('0x11')]);router['post'](_0x456a('0xc'),auth['isAuthenticated'](),controller['addMessage']);router[_0x456a('0x10')](_0x456a('0x12'),auth[_0x456a('0xa')](),interaction[_0x456a('0x13')]('whatsapp',_0x456a('0x14')),controller[_0x456a('0x15')]);router[_0x456a('0x16')](_0x456a('0x17'),auth[_0x456a('0xa')](),interaction[_0x456a('0x13')]('whatsapp',_0x456a('0x18')),controller[_0x456a('0x19')]);router[_0x456a('0x1a')](_0x456a('0x17'),auth['isAuthenticated'](),interaction[_0x456a('0x13')](_0x456a('0x1b'),_0x456a('0x1c')),controller['destroy']);router[_0x456a('0x1a')]('/:id/tags',auth['isAuthenticated'](),controller[_0x456a('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x2675=['index','/describe','describe','/:id/messages','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','/:id','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','removeTags','multer','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappInteraction.controller','get','isAuthenticated'];(function(_0x437486,_0xe418db){var _0x3aac8a=function(_0x4bf79f){while(--_0x4bf79f){_0x437486['push'](_0x437486['shift']());}};_0x3aac8a(++_0xe418db);}(_0x2675,0x75));var _0x5267=function(_0x2192d5,_0x46d11a){_0x2192d5=_0x2192d5-0x0;var _0x259736=_0x2675[_0x2192d5];return _0x259736;};'use strict';var multer=require(_0x5267('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5267('0x1'));var router=express[_0x5267('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5267('0x3'));var interaction=require(_0x5267('0x4'));var config=require('../../config/environment');var controller=require(_0x5267('0x5'));router[_0x5267('0x6')]('/',auth[_0x5267('0x7')](),controller[_0x5267('0x8')]);router[_0x5267('0x6')](_0x5267('0x9'),auth['isAuthenticated'](),controller[_0x5267('0xa')]);router[_0x5267('0x6')]('/:id',auth[_0x5267('0x7')](),controller['show']);router[_0x5267('0x6')](_0x5267('0xb'),auth[_0x5267('0x7')](),controller['getMessages']);router[_0x5267('0x6')]('/:id/download',auth[_0x5267('0x7')](),controller['download']);router[_0x5267('0xc')]('/',auth[_0x5267('0x7')](),controller[_0x5267('0xd')]);router[_0x5267('0xc')](_0x5267('0xb'),auth[_0x5267('0x7')](),controller[_0x5267('0xe')]);router[_0x5267('0xc')](_0x5267('0xf'),auth[_0x5267('0x7')](),interaction[_0x5267('0x10')](_0x5267('0x11'),_0x5267('0x12')),controller['addTags']);router['put'](_0x5267('0x13'),auth[_0x5267('0x7')](),interaction[_0x5267('0x10')](_0x5267('0x11'),_0x5267('0x14')),controller[_0x5267('0x15')]);router[_0x5267('0x16')](_0x5267('0x13'),auth[_0x5267('0x7')](),interaction[_0x5267('0x10')](_0x5267('0x11'),_0x5267('0x17')),controller['destroy']);router[_0x5267('0x16')](_0x5267('0xf'),auth['isAuthenticated'](),controller[_0x5267('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 9b92be5..d08688c 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 _0x503a=['moment','BOOLEAN','STRING','DATE','ENUM','sequelize'];(function(_0x3b86f5,_0x37aee3){var _0x21aaff=function(_0x41b79f){while(--_0x41b79f){_0x3b86f5['push'](_0x3b86f5['shift']());}};_0x21aaff(++_0x37aee3);}(_0x503a,0x19d));var _0xa503=function(_0x216008,_0x2d1023){_0x216008=_0x216008-0x0;var _0x4d384f=_0x503a[_0x216008];return _0x4d384f;};'use strict';var Sequelize=require(_0xa503('0x0'));var moment=require(_0xa503('0x1'));module['exports']={'closed':{'type':Sequelize[_0xa503('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xa503('0x3')]},'secondDisposition':{'type':Sequelize[_0xa503('0x3')]},'thirdDisposition':{'type':Sequelize[_0xa503('0x3')]},'note':{'type':Sequelize[_0xa503('0x3')]},'phone':{'type':Sequelize[_0xa503('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa503('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xa503('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa503('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x3fa4=['sequelize','DATE','STRING','out','ENUM','BOOLEAN'];(function(_0x54c8ba,_0x3142d6){var _0xcd59b8=function(_0x3b1425){while(--_0x3b1425){_0x54c8ba['push'](_0x54c8ba['shift']());}};_0xcd59b8(++_0x3142d6);}(_0x3fa4,0xf0));var _0x43fa=function(_0x3ffcd6,_0x194c09){_0x3ffcd6=_0x3ffcd6-0x0;var _0x475e14=_0x3fa4[_0x3ffcd6];return _0x475e14;};'use strict';var Sequelize=require(_0x43fa('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x43fa('0x1')]},'disposition':{'type':Sequelize[_0x43fa('0x2')]},'secondDisposition':{'type':Sequelize[_0x43fa('0x2')]},'thirdDisposition':{'type':Sequelize[_0x43fa('0x2')]},'note':{'type':Sequelize[_0x43fa('0x2')]},'phone':{'type':Sequelize[_0x43fa('0x2')]},'read1stAt':{'type':Sequelize[_0x43fa('0x1')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x43fa('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x43fa('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x43fa('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x43fa('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 3968e2d..7425abc 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 _0x9da6=['closedAt','basename','createReadStream','pipe','createWriteStream','direction','System','read','root','downloadInteraction.ejs','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','json','offset','count','limit','set','update','then','destroy','sendStatus','stack','name','send','index','map','WhatsappInteraction','rawAttributes','fieldName','type','getOptions','findAll','whatsapp','query','user','show','params','model','keys','filters','intersection','fields','attributes','includeAll','include','merge','catch','create','body','find','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','length','nolimit','order','sort','pick','where','WhatsappInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','omit','spread','Tag','color','emit','removeTags','download','unix','files','join','attachments','User','fullname','CmContact','Contact','firstName','lastName','push','Attachment','Messages','createdAt','secret','WhatsappAccount','Account','get','mkdirSync','Whatsapp','Owner','N.A.','toString'];(function(_0xae5a98,_0x391942){var _0x14b180=function(_0x2f751d){while(--_0x2f751d){_0xae5a98['push'](_0xae5a98['shift']());}};_0x14b180(++_0x391942);}(_0x9da6,0xff));var _0x69da=function(_0x209354,_0x25aa5f){_0x209354=_0x209354-0x0;var _0x3b5e73=_0x9da6[_0x209354];return _0x3b5e73;};'use strict';var rimraf=require(_0x69da('0x0'));var zipdir=require(_0x69da('0x1'));var moment=require(_0x69da('0x2'));var BPromise=require('bluebird');var util=require(_0x69da('0x3'));var path=require(_0x69da('0x4'));var ejs=require(_0x69da('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x69da('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x69da('0x7'));var pdf=require(_0x69da('0x8'));var logger=require(_0x69da('0x9'))(_0x69da('0xa'));var config=require('../../config/environment');var db=require(_0x69da('0xb'))['db'];config[_0x69da('0xc')]=_[_0x69da('0xd')](config[_0x69da('0xc')],{'host':_0x69da('0xe'),'port':0x18eb});var socket=require(_0x69da('0xf'))(new Redis(config['redis']));require(_0x69da('0x10'))[_0x69da('0x11')](socket);function respondWithStatusCode(_0x3dd942,_0x13ef18){_0x13ef18=_0x13ef18||0xcc;return function(_0xe0d98c){if(_0xe0d98c){return _0x3dd942['sendStatus'](_0x13ef18);}return _0x3dd942[_0x69da('0x12')](_0x13ef18)['end']();};}function respondWithResult(_0x1aae7e,_0xe8ac80){_0xe8ac80=_0xe8ac80||0xc8;return function(_0x1df337){if(_0x1df337){return _0x1aae7e[_0x69da('0x12')](_0xe8ac80)[_0x69da('0x13')](_0x1df337);}};}function respondWithFilteredResult(_0x38735d,_0x4ef47b){return function(_0x341470){if(_0x341470){var _0x2926e1=typeof _0x4ef47b[_0x69da('0x14')]==='undefined'&&typeof _0x4ef47b['limit']==='undefined';var _0x1c8b66=_0x341470[_0x69da('0x15')];var _0x4a64e8=_0x2926e1?0x0:_0x4ef47b[_0x69da('0x14')];var _0x327342=_0x2926e1?_0x341470['count']:_0x4ef47b[_0x69da('0x14')]+_0x4ef47b[_0x69da('0x16')];var _0x4ec832;if(_0x327342>=_0x1c8b66){_0x327342=_0x1c8b66;_0x4ec832=0xc8;}else{_0x4ec832=0xce;}_0x38735d[_0x69da('0x12')](_0x4ec832);return _0x38735d[_0x69da('0x17')]('Content-Range',_0x4a64e8+'-'+_0x327342+'/'+_0x1c8b66)[_0x69da('0x13')](_0x341470);}return null;};}function saveUpdates(_0x70fff4){return function(_0x22850e){if(_0x22850e){return _0x22850e[_0x69da('0x18')](_0x70fff4)[_0x69da('0x19')](function(_0x186d80){return _0x186d80;});}return null;};}function removeEntity(_0x22aee7){return function(_0x5bca57){if(_0x5bca57){return _0x5bca57[_0x69da('0x1a')]()[_0x69da('0x19')](function(){_0x22aee7[_0x69da('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x270860){return function(_0x1c2048){if(!_0x1c2048){_0x270860[_0x69da('0x1b')](0x194);}return _0x1c2048;};}function handleError(_0x306502,_0x1d8caa){_0x1d8caa=_0x1d8caa||0x1f4;return function(_0xc9a6a5){logger['error'](_0xc9a6a5[_0x69da('0x1c')]);if(_0xc9a6a5['name']){delete _0xc9a6a5[_0x69da('0x1d')];}_0x306502['status'](_0x1d8caa)[_0x69da('0x1e')](_0xc9a6a5);};}exports[_0x69da('0x1f')]=function(_0x5c1679,_0x545f5d){var _0x1da648={};var _0x38de83=_[_0x69da('0x20')](db[_0x69da('0x21')][_0x69da('0x22')],function(_0x3c0807){return{'name':_0x3c0807[_0x69da('0x23')],'type':_0x3c0807[_0x69da('0x24')]['key']};});_0x1da648=qs[_0x69da('0x25')](_0x38de83,_0x5c1679);return interaction[_0x69da('0x26')](_0x69da('0x27'),_0x5c1679[_0x69da('0x28')],_0x5c1679[_0x69da('0x29')],_0x1da648,_0x38de83)[_0x69da('0x19')](respondWithFilteredResult(_0x545f5d,_0x1da648))['catch'](handleError(_0x545f5d,null));};exports[_0x69da('0x2a')]=function(_0x172bdd,_0x365458){var _0x54932b={'raw':![],'where':{'id':_0x172bdd[_0x69da('0x2b')]['id']}},_0x5a1aa0={};_0x5a1aa0[_0x69da('0x2c')]=_[_0x69da('0x2d')](db[_0x69da('0x21')][_0x69da('0x22')]);_0x5a1aa0[_0x69da('0x28')]=_['keys'](_0x172bdd[_0x69da('0x28')]);_0x5a1aa0[_0x69da('0x2e')]=_[_0x69da('0x2f')](_0x5a1aa0[_0x69da('0x2c')],_0x5a1aa0['query']);_0x54932b['attributes']=_['intersection'](_0x5a1aa0[_0x69da('0x2c')],qs[_0x69da('0x30')](_0x172bdd[_0x69da('0x28')]['fields']));_0x54932b[_0x69da('0x31')]=_0x54932b[_0x69da('0x31')]['length']?_0x54932b['attributes']:_0x5a1aa0[_0x69da('0x2c')];if(_0x172bdd[_0x69da('0x28')][_0x69da('0x32')]){_0x54932b[_0x69da('0x33')]=[{'all':!![]}];}_0x54932b=_[_0x69da('0x34')]({},_0x54932b,_0x172bdd['options']);return db[_0x69da('0x21')]['find'](_0x54932b)['then'](handleEntityNotFound(_0x365458,null))['then'](respondWithResult(_0x365458,null))[_0x69da('0x35')](handleError(_0x365458,null));};exports[_0x69da('0x36')]=function(_0x27441b,_0x2a0831){return db[_0x69da('0x21')]['create'](_0x27441b[_0x69da('0x37')],{})[_0x69da('0x19')](respondWithResult(_0x2a0831,0xc9))[_0x69da('0x35')](handleError(_0x2a0831,null));};exports[_0x69da('0x18')]=function(_0x57de2b,_0x2e75a0){if(_0x57de2b[_0x69da('0x37')]['id']){delete _0x57de2b[_0x69da('0x37')]['id'];}return db['WhatsappInteraction'][_0x69da('0x38')]({'where':{'id':_0x57de2b['params']['id']}})[_0x69da('0x19')](handleEntityNotFound(_0x2e75a0,null))[_0x69da('0x19')](saveUpdates(_0x57de2b[_0x69da('0x37')],null))[_0x69da('0x19')](respondWithResult(_0x2e75a0,null))['catch'](handleError(_0x2e75a0,null));};exports[_0x69da('0x1a')]=function(_0x16ba48,_0x4d7d10){return db[_0x69da('0x21')][_0x69da('0x38')]({'where':{'id':_0x16ba48[_0x69da('0x2b')]['id']}})['then'](handleEntityNotFound(_0x4d7d10,null))[_0x69da('0x19')](removeEntity(_0x4d7d10,null))[_0x69da('0x35')](handleError(_0x4d7d10,null));};exports[_0x69da('0x39')]=function(_0x3ffa2d,_0x3fa160){return db[_0x69da('0x21')][_0x69da('0x39')]()[_0x69da('0x19')](respondWithResult(_0x3fa160,null))[_0x69da('0x35')](handleError(_0x3fa160,null));};exports[_0x69da('0x3a')]=function(_0x12d8d9,_0xa4d92e){return db[_0x69da('0x3b')][_0x69da('0x38')]({'where':{'id':_0x12d8d9[_0x69da('0x2b')]['id']}})[_0x69da('0x19')](handleEntityNotFound(_0xa4d92e,null))['then'](function(_0x153bb5){if(_0x153bb5){return _0x153bb5[_0x69da('0x3a')](_0x12d8d9[_0x69da('0x37')]['ids'],_['omit'](_0x12d8d9['body'],[_0x69da('0x3c'),'id'])||{});}})[_0x69da('0x19')](respondWithResult(_0xa4d92e,null))[_0x69da('0x35')](handleError(_0xa4d92e,null));};exports[_0x69da('0x3d')]=function(_0x333d03,_0x338093){var _0x1c8d89={'raw':![],'where':{}};var _0x854c16={};var _0x5471df={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x69da('0x3e')]({'where':{'id':_0x333d03[_0x69da('0x2b')]['id']}})[_0x69da('0x19')](handleEntityNotFound(_0x338093,null))[_0x69da('0x19')](function(_0x5505c3){if(_0x5505c3){_0x854c16[_0x69da('0x2c')]=_[_0x69da('0x2d')](db[_0x69da('0x3b')]['rawAttributes']);_0x854c16[_0x69da('0x28')]=_[_0x69da('0x2d')](_0x333d03[_0x69da('0x28')]);_0x854c16[_0x69da('0x2e')]=_[_0x69da('0x2f')](_0x854c16[_0x69da('0x2c')],_0x854c16['query']);_0x1c8d89[_0x69da('0x31')]=_[_0x69da('0x2f')](_0x854c16[_0x69da('0x2c')],qs[_0x69da('0x30')](_0x333d03[_0x69da('0x28')]['fields']));_0x1c8d89[_0x69da('0x31')]=_0x1c8d89['attributes'][_0x69da('0x3f')]?_0x1c8d89['attributes']:_0x854c16[_0x69da('0x2c')];if(!_0x333d03[_0x69da('0x28')]['hasOwnProperty'](_0x69da('0x40'))){_0x1c8d89[_0x69da('0x16')]=qs[_0x69da('0x16')](_0x333d03[_0x69da('0x28')][_0x69da('0x16')]);_0x1c8d89[_0x69da('0x14')]=qs[_0x69da('0x14')](_0x333d03[_0x69da('0x28')][_0x69da('0x14')]);}_0x1c8d89[_0x69da('0x41')]=qs[_0x69da('0x42')](_0x333d03['query']['sort']);_0x1c8d89['where']=qs['filters'](_[_0x69da('0x43')](_0x333d03['query'],_0x854c16[_0x69da('0x2e')]));_0x1c8d89[_0x69da('0x44')][_0x69da('0x45')]=_0x5505c3['id'];if(_0x333d03[_0x69da('0x28')][_0x69da('0x46')]){_0x1c8d89[_0x69da('0x44')]=_[_0x69da('0x34')](_0x1c8d89[_0x69da('0x44')],{'$or':_[_0x69da('0x20')](_0x1c8d89['attributes'],function(_0x2476c5){var _0x1d3bdf={};_0x1d3bdf[_0x2476c5]={'$like':'%'+_0x333d03[_0x69da('0x28')][_0x69da('0x46')]+'%'};return _0x1d3bdf;})});}if(_0x333d03[_0x69da('0x28')][_0x69da('0x47')]){var _0x4a577d=_0x333d03[_0x69da('0x28')][_0x69da('0x47')][_0x69da('0x48')](',');var _0x2ed4e8={};_0x2ed4e8[_0x4a577d[0x0]]={'$gte':moment(_0x4a577d[0x1])[_0x69da('0x49')](_0x69da('0x4a'))};_0x1c8d89[_0x69da('0x44')]=_[_0x69da('0x34')](_0x1c8d89['where'],_0x2ed4e8);}_0x1c8d89=_['merge']({},_0x1c8d89,_0x333d03[_0x69da('0x4b')]);return db[_0x69da('0x3b')][_0x69da('0x15')]({'where':_0x1c8d89[_0x69da('0x44')]})[_0x69da('0x19')](function(_0x599113){_0x5471df[_0x69da('0x15')]=_0x599113;if(_0x333d03[_0x69da('0x28')][_0x69da('0x32')]){_0x1c8d89[_0x69da('0x33')]=[{'all':!![]}];}return db[_0x69da('0x3b')][_0x69da('0x26')](_0x1c8d89);})[_0x69da('0x19')](function(_0x39b811){_0x5471df[_0x69da('0x4c')]=_0x39b811;return _0x5471df;});}})[_0x69da('0x19')](respondWithFilteredResult(_0x338093,_0x1c8d89))[_0x69da('0x35')](handleError(_0x338093,null));};exports[_0x69da('0x4d')]=function(_0x2b4da5,_0x444776){return db['WhatsappInteraction'][_0x69da('0x38')]({'where':{'id':_0x2b4da5[_0x69da('0x2b')]['id']}})[_0x69da('0x19')](handleEntityNotFound(_0x444776,null))[_0x69da('0x19')](function(_0x38a003){if(_0x38a003){return _0x38a003['setTags'](_0x2b4da5['body'][_0x69da('0x3c')],_[_0x69da('0x4e')](_0x2b4da5['body'],[_0x69da('0x3c'),'id'])||{})[_0x69da('0x4f')](function(){return db[_0x69da('0x50')]['findAll']({'attributes':['id',_0x69da('0x1d'),_0x69da('0x51')],'where':{'id':_0x2b4da5[_0x69da('0x37')]['ids']}});})[_0x69da('0x19')](function(_0x30b898){socket[_0x69da('0x52')]('whatsappInteractionTags:save',{'id':Number(_0x2b4da5[_0x69da('0x2b')]['id']),'tags':_0x30b898||[]});return{'id':Number(_0x2b4da5[_0x69da('0x2b')]['id']),'tags':_0x30b898||[]};});}})[_0x69da('0x19')](respondWithResult(_0x444776,null))[_0x69da('0x35')](handleError(_0x444776,null));};exports[_0x69da('0x53')]=function(_0x1ca3b4,_0x343c7a){return db[_0x69da('0x21')][_0x69da('0x38')]({'where':{'id':_0x1ca3b4['params']['id']}})['then'](handleEntityNotFound(_0x343c7a,null))[_0x69da('0x19')](function(_0x43860e){if(_0x43860e){return _0x43860e[_0x69da('0x53')](_0x1ca3b4[_0x69da('0x28')][_0x69da('0x3c')]);}})[_0x69da('0x19')](respondWithStatusCode(_0x343c7a,null))[_0x69da('0x35')](handleError(_0x343c7a,null));};exports[_0x69da('0x54')]=function(_0x31fab1,_0xe1e213){var _0x45bda7=moment()[_0x69da('0x55')]()['toString']();var _0x5b660e=path['join'](config['root'],'server',_0x69da('0x56'),'tmp');var _0x136ff5=path[_0x69da('0x57')](config['root'],'server',_0x69da('0x56'),_0x69da('0x58'));var _0x63b382=path['join'](_0x5b660e,_0x45bda7);var _0x34a9b=util[_0x69da('0x49')]('transcript-%d-%s.zip',_0x31fab1[_0x69da('0x2b')]['id'],_0x45bda7);var _0x41da2d=path[_0x69da('0x57')](_0x5b660e,_0x34a9b);var _0xd6d324=[];_0xd6d324['push']({'model':db[_0x69da('0x59')],'as':_0x69da('0x59'),'attributes':['id',_0x69da('0x5a')],'raw':!![]});_0xd6d324['push']({'model':db[_0x69da('0x5b')],'as':_0x69da('0x5c'),'attributes':['id',_0x69da('0x5d'),_0x69da('0x5e')],'raw':!![]});if(_0x31fab1[_0x69da('0x28')]['attachments']){_0xd6d324[_0x69da('0x5f')]({'model':db[_0x69da('0x60')],'as':'Attachment','raw':!![]});}var _0x2ef74b=[{'model':db[_0x69da('0x3b')],'as':_0x69da('0x61'),'attributes':['id',_0x69da('0x37'),_0x69da('0x62'),'direction',_0x69da('0x63'),'read'],'include':_0xd6d324}];_0x2ef74b[_0x69da('0x5f')]({'model':db[_0x69da('0x64')],'as':_0x69da('0x65'),'attributes':['id',_0x69da('0x1d')]});_0x2ef74b[_0x69da('0x5f')]({'model':db[_0x69da('0x59')],'as':'Owner','attributes':['id',_0x69da('0x5a')]});return db[_0x69da('0x21')][_0x69da('0x38')]({'where':{'id':_0x31fab1[_0x69da('0x2b')]['id']},'include':_0x2ef74b})[_0x69da('0x19')](handleEntityNotFound(_0xe1e213,null))['then'](function(_0x5a68a1){if(_0x5a68a1){var _0x15dbc2=_0x5a68a1[_0x69da('0x66')]({'plain':!![]});fs[_0x69da('0x67')](_0x63b382);var _0x1b142f={'channel':_0x69da('0x68'),'account':_0x15dbc2[_0x69da('0x65')]['name'],'agent':_0x15dbc2[_0x69da('0x69')]?_0x15dbc2[_0x69da('0x69')][_0x69da('0x5a')]:_0x69da('0x6a'),'createdAt':moment(_0x15dbc2[_0x69da('0x62')])[_0x69da('0x49')](_0x69da('0x4a'))[_0x69da('0x6b')](),'closedAt':_0x15dbc2['closed']?moment(_0x15dbc2[_0x69da('0x6c')])[_0x69da('0x49')](_0x69da('0x4a'))[_0x69da('0x6b')]():'','disposition':_0x15dbc2['disposition'],'messages':_(_0x15dbc2[_0x69da('0x61')])[_0x69da('0x46')]({'secret':![]})[_0x69da('0x20')](function(_0xfac735){if(_0xfac735['Attachment']){var _0x4cdc0e=path[_0x69da('0x57')](_0x136ff5,_0xfac735[_0x69da('0x60')][_0x69da('0x6d')]);if(fs['existsSync'](_0x4cdc0e)){fs[_0x69da('0x6e')](_0x4cdc0e)[_0x69da('0x6f')](fs[_0x69da('0x70')](path[_0x69da('0x57')](_0x63b382,_0xfac735[_0x69da('0x60')][_0x69da('0x6d')])));}}return{'date':moment(_0xfac735[_0x69da('0x62')])[_0x69da('0x49')](_0x69da('0x4a'))['toString'](),'sender':_0xfac735[_0x69da('0x71')]==='out'?_0xfac735[_0x69da('0x59')]?_0xfac735[_0x69da('0x59')][_0x69da('0x5a')]:_0x69da('0x72'):_0xfac735[_0x69da('0x5c')][_0x69da('0x5d')]+(_0xfac735['Contact'][_0x69da('0x5e')]?'\x20'+_0xfac735[_0x69da('0x5c')][_0x69da('0x5e')]:''),'body':_0xfac735[_0x69da('0x60')]?_0xfac735[_0x69da('0x60')]['basename']:_0xfac735[_0x69da('0x37')],'direction':_0xfac735['direction']==='out'?'A':'C','secret':_0xfac735[_0x69da('0x63')],'read':_0xfac735[_0x69da('0x73')],'attachment':_0xfac735[_0x69da('0x60')]};})['value']()};return ejs['renderFile'](path['join'](config[_0x69da('0x74')],'server','views',_0x69da('0x75')),{'interaction':_0x1b142f})[_0x69da('0x19')](function(_0x58520f){var _0x5502ad=path[_0x69da('0x57')](_0x63b382,'transcript-'+_0x15dbc2['id']+'-'+_0x45bda7+_0x69da('0x76'));var _0x536a77={'path':_0x5502ad,'channel':_0x69da('0x68'),'interactionId':_0x15dbc2['id']};return pdf[_0x69da('0x77')](_0x58520f,_0x536a77);})[_0x69da('0x19')](function(){return new BPromise(function(_0x49687a,_0x2ddcfd){zipdir(_0x63b382,{'saveTo':_0x41da2d},function(_0x3907fd,_0x35bbe5){if(_0x3907fd)return _0x2ddcfd(_0x3907fd);return _0x49687a(_0x35bbe5);});})[_0x69da('0x19')](function(){return new BPromise(function(_0x8944b9,_0x143945){rimraf(_0x63b382,function(_0x2a65df){if(_0x2a65df)_0x143945(_0x2a65df);return _0x8944b9();});});})[_0x69da('0x19')](function(){return _0xe1e213[_0x69da('0x54')](_0x41da2d,_0x34a9b,function(_0x205164){if(_0x205164){console['log']('err',_0x205164);}else{fs[_0x69da('0x78')](_0x41da2d);}});});});}else{return _0xe1e213[_0x69da('0x1b')](0xc8);}})['catch'](handleError(_0xe1e213,null));}; \ No newline at end of file +var _0x378c=['where','WhatsappInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','omit','color','emit','removeTags','unix','toString','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','firstName','lastName','Messages','direction','read','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','createdAt','closed','closedAt','disposition','Attachment','basename','createReadStream','pipe','createWriteStream','System','out','secret','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','rimraf','zip-dir','bluebird','util','path','ejs','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','json','offset','undefined','count','Content-Range','update','then','destroy','end','stack','name','index','map','rawAttributes','key','getOptions','findAll','query','show','params','model','keys','WhatsappInteraction','filters','attributes','intersection','fields','length','includeAll','include','merge','options','catch','create','body','find','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','nolimit','limit','order','sort','pick'];(function(_0x2db6cb,_0x5d78fc){var _0x5e7e39=function(_0x39c11f){while(--_0x39c11f){_0x2db6cb['push'](_0x2db6cb['shift']());}};_0x5e7e39(++_0x5d78fc);}(_0x378c,0x137));var _0xc378=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x378c[_0x4c12ec];return _0x3ae42c;};'use strict';var rimraf=require(_0xc378('0x0'));var zipdir=require(_0xc378('0x1'));var moment=require('moment');var BPromise=require(_0xc378('0x2'));var util=require(_0xc378('0x3'));var path=require(_0xc378('0x4'));var ejs=require(_0xc378('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0xc378('0x6'));var qs=require(_0xc378('0x7'));var pdf=require(_0xc378('0x8'));var logger=require(_0xc378('0x9'))(_0xc378('0xa'));var config=require(_0xc378('0xb'));var db=require(_0xc378('0xc'))['db'];config[_0xc378('0xd')]=_[_0xc378('0xe')](config['redis'],{'host':_0xc378('0xf'),'port':0x18eb});var socket=require(_0xc378('0x10'))(new Redis(config[_0xc378('0xd')]));require(_0xc378('0x11'))['register'](socket);function respondWithStatusCode(_0x4c4a20,_0xf4cc3d){_0xf4cc3d=_0xf4cc3d||0xcc;return function(_0x127c63){if(_0x127c63){return _0x4c4a20[_0xc378('0x12')](_0xf4cc3d);}return _0x4c4a20[_0xc378('0x13')](_0xf4cc3d)['end']();};}function respondWithResult(_0x13024c,_0x43cf0a){_0x43cf0a=_0x43cf0a||0xc8;return function(_0x22f218){if(_0x22f218){return _0x13024c[_0xc378('0x13')](_0x43cf0a)[_0xc378('0x14')](_0x22f218);}};}function respondWithFilteredResult(_0x43958a,_0x3c05e2){return function(_0x3a2ace){if(_0x3a2ace){var _0x551bfd=typeof _0x3c05e2[_0xc378('0x15')]===_0xc378('0x16')&&typeof _0x3c05e2['limit']===_0xc378('0x16');var _0x5dbd0a=_0x3a2ace[_0xc378('0x17')];var _0x56d7cc=_0x551bfd?0x0:_0x3c05e2[_0xc378('0x15')];var _0x2ed374=_0x551bfd?_0x3a2ace[_0xc378('0x17')]:_0x3c05e2['offset']+_0x3c05e2['limit'];var _0x5a732e;if(_0x2ed374>=_0x5dbd0a){_0x2ed374=_0x5dbd0a;_0x5a732e=0xc8;}else{_0x5a732e=0xce;}_0x43958a['status'](_0x5a732e);return _0x43958a['set'](_0xc378('0x18'),_0x56d7cc+'-'+_0x2ed374+'/'+_0x5dbd0a)['json'](_0x3a2ace);}return null;};}function saveUpdates(_0x2338d0){return function(_0x4a939c){if(_0x4a939c){return _0x4a939c[_0xc378('0x19')](_0x2338d0)[_0xc378('0x1a')](function(_0x453395){return _0x453395;});}return null;};}function removeEntity(_0x1d0481){return function(_0x228907){if(_0x228907){return _0x228907[_0xc378('0x1b')]()[_0xc378('0x1a')](function(){_0x1d0481[_0xc378('0x13')](0xcc)[_0xc378('0x1c')]();});}};}function handleEntityNotFound(_0xbbe24a){return function(_0x4d156c){if(!_0x4d156c){_0xbbe24a[_0xc378('0x12')](0x194);}return _0x4d156c;};}function handleError(_0x484e03,_0xa167d8){_0xa167d8=_0xa167d8||0x1f4;return function(_0x3a0fcc){logger['error'](_0x3a0fcc[_0xc378('0x1d')]);if(_0x3a0fcc[_0xc378('0x1e')]){delete _0x3a0fcc[_0xc378('0x1e')];}_0x484e03['status'](_0xa167d8)['send'](_0x3a0fcc);};}exports[_0xc378('0x1f')]=function(_0x5e1793,_0x5f2b0f){var _0x110c04={};var _0x347d98=_[_0xc378('0x20')](db['WhatsappInteraction'][_0xc378('0x21')],function(_0xb3f913){return{'name':_0xb3f913['fieldName'],'type':_0xb3f913['type'][_0xc378('0x22')]};});_0x110c04=qs[_0xc378('0x23')](_0x347d98,_0x5e1793);return interaction[_0xc378('0x24')]('whatsapp',_0x5e1793[_0xc378('0x25')],_0x5e1793['user'],_0x110c04,_0x347d98)[_0xc378('0x1a')](respondWithFilteredResult(_0x5f2b0f,_0x110c04))['catch'](handleError(_0x5f2b0f,null));};exports[_0xc378('0x26')]=function(_0x4a8cfb,_0x377345){var _0x4e39ec={'raw':![],'where':{'id':_0x4a8cfb[_0xc378('0x27')]['id']}},_0x2d1214={};_0x2d1214[_0xc378('0x28')]=_[_0xc378('0x29')](db[_0xc378('0x2a')][_0xc378('0x21')]);_0x2d1214[_0xc378('0x25')]=_[_0xc378('0x29')](_0x4a8cfb[_0xc378('0x25')]);_0x2d1214[_0xc378('0x2b')]=_['intersection'](_0x2d1214[_0xc378('0x28')],_0x2d1214[_0xc378('0x25')]);_0x4e39ec[_0xc378('0x2c')]=_[_0xc378('0x2d')](_0x2d1214[_0xc378('0x28')],qs['fields'](_0x4a8cfb[_0xc378('0x25')][_0xc378('0x2e')]));_0x4e39ec[_0xc378('0x2c')]=_0x4e39ec[_0xc378('0x2c')][_0xc378('0x2f')]?_0x4e39ec[_0xc378('0x2c')]:_0x2d1214[_0xc378('0x28')];if(_0x4a8cfb[_0xc378('0x25')][_0xc378('0x30')]){_0x4e39ec[_0xc378('0x31')]=[{'all':!![]}];}_0x4e39ec=_[_0xc378('0x32')]({},_0x4e39ec,_0x4a8cfb[_0xc378('0x33')]);return db[_0xc378('0x2a')]['find'](_0x4e39ec)[_0xc378('0x1a')](handleEntityNotFound(_0x377345,null))[_0xc378('0x1a')](respondWithResult(_0x377345,null))[_0xc378('0x34')](handleError(_0x377345,null));};exports['create']=function(_0x1266d8,_0x5e0e86){return db[_0xc378('0x2a')][_0xc378('0x35')](_0x1266d8['body'],{})[_0xc378('0x1a')](respondWithResult(_0x5e0e86,0xc9))['catch'](handleError(_0x5e0e86,null));};exports['update']=function(_0x2ab048,_0x16d29b){if(_0x2ab048[_0xc378('0x36')]['id']){delete _0x2ab048['body']['id'];}return db['WhatsappInteraction'][_0xc378('0x37')]({'where':{'id':_0x2ab048['params']['id']}})[_0xc378('0x1a')](handleEntityNotFound(_0x16d29b,null))[_0xc378('0x1a')](saveUpdates(_0x2ab048[_0xc378('0x36')],null))['then'](respondWithResult(_0x16d29b,null))[_0xc378('0x34')](handleError(_0x16d29b,null));};exports[_0xc378('0x1b')]=function(_0x330704,_0x2fb07e){return db[_0xc378('0x2a')][_0xc378('0x37')]({'where':{'id':_0x330704[_0xc378('0x27')]['id']}})['then'](handleEntityNotFound(_0x2fb07e,null))[_0xc378('0x1a')](removeEntity(_0x2fb07e,null))[_0xc378('0x34')](handleError(_0x2fb07e,null));};exports[_0xc378('0x38')]=function(_0x26918d,_0xaa3fc7){return db[_0xc378('0x2a')][_0xc378('0x38')]()[_0xc378('0x1a')](respondWithResult(_0xaa3fc7,null))[_0xc378('0x34')](handleError(_0xaa3fc7,null));};exports[_0xc378('0x39')]=function(_0x1af20e,_0x404793){return db[_0xc378('0x3a')][_0xc378('0x37')]({'where':{'id':_0x1af20e[_0xc378('0x27')]['id']}})[_0xc378('0x1a')](handleEntityNotFound(_0x404793,null))['then'](function(_0x3ffb0a){if(_0x3ffb0a){return _0x3ffb0a[_0xc378('0x39')](_0x1af20e[_0xc378('0x36')]['ids'],_['omit'](_0x1af20e['body'],[_0xc378('0x3b'),'id'])||{});}})[_0xc378('0x1a')](respondWithResult(_0x404793,null))['catch'](handleError(_0x404793,null));};exports[_0xc378('0x3c')]=function(_0x5b70fa,_0x10e614){var _0x34f76f={'raw':![],'where':{}};var _0x45b36b={};var _0x288f78={'count':0x0,'rows':[]};return db[_0xc378('0x2a')][_0xc378('0x3d')]({'where':{'id':_0x5b70fa['params']['id']}})[_0xc378('0x1a')](handleEntityNotFound(_0x10e614,null))[_0xc378('0x1a')](function(_0x28a3ac){if(_0x28a3ac){_0x45b36b[_0xc378('0x28')]=_[_0xc378('0x29')](db['WhatsappMessage'][_0xc378('0x21')]);_0x45b36b[_0xc378('0x25')]=_['keys'](_0x5b70fa['query']);_0x45b36b[_0xc378('0x2b')]=_['intersection'](_0x45b36b[_0xc378('0x28')],_0x45b36b['query']);_0x34f76f[_0xc378('0x2c')]=_[_0xc378('0x2d')](_0x45b36b[_0xc378('0x28')],qs[_0xc378('0x2e')](_0x5b70fa[_0xc378('0x25')][_0xc378('0x2e')]));_0x34f76f[_0xc378('0x2c')]=_0x34f76f[_0xc378('0x2c')][_0xc378('0x2f')]?_0x34f76f[_0xc378('0x2c')]:_0x45b36b[_0xc378('0x28')];if(!_0x5b70fa[_0xc378('0x25')]['hasOwnProperty'](_0xc378('0x3e'))){_0x34f76f[_0xc378('0x3f')]=qs[_0xc378('0x3f')](_0x5b70fa['query']['limit']);_0x34f76f[_0xc378('0x15')]=qs[_0xc378('0x15')](_0x5b70fa[_0xc378('0x25')][_0xc378('0x15')]);}_0x34f76f[_0xc378('0x40')]=qs[_0xc378('0x41')](_0x5b70fa[_0xc378('0x25')][_0xc378('0x41')]);_0x34f76f['where']=qs[_0xc378('0x2b')](_[_0xc378('0x42')](_0x5b70fa['query'],_0x45b36b[_0xc378('0x2b')]));_0x34f76f[_0xc378('0x43')][_0xc378('0x44')]=_0x28a3ac['id'];if(_0x5b70fa[_0xc378('0x25')][_0xc378('0x45')]){_0x34f76f['where']=_['merge'](_0x34f76f[_0xc378('0x43')],{'$or':_[_0xc378('0x20')](_0x34f76f[_0xc378('0x2c')],function(_0x172184){var _0x5b8953={};_0x5b8953[_0x172184]={'$like':'%'+_0x5b70fa[_0xc378('0x25')][_0xc378('0x45')]+'%'};return _0x5b8953;})});}if(_0x5b70fa[_0xc378('0x25')][_0xc378('0x46')]){var _0x16ffb2=_0x5b70fa[_0xc378('0x25')][_0xc378('0x46')]['split'](',');var _0x3ebe93={};_0x3ebe93[_0x16ffb2[0x0]]={'$gte':moment(_0x16ffb2[0x1])[_0xc378('0x47')](_0xc378('0x48'))};_0x34f76f[_0xc378('0x43')]=_[_0xc378('0x32')](_0x34f76f['where'],_0x3ebe93);}_0x34f76f=_['merge']({},_0x34f76f,_0x5b70fa[_0xc378('0x33')]);return db[_0xc378('0x3a')][_0xc378('0x17')]({'where':_0x34f76f[_0xc378('0x43')]})[_0xc378('0x1a')](function(_0x397ed4){_0x288f78[_0xc378('0x17')]=_0x397ed4;if(_0x5b70fa['query'][_0xc378('0x30')]){_0x34f76f['include']=[{'all':!![]}];}return db[_0xc378('0x3a')][_0xc378('0x24')](_0x34f76f);})[_0xc378('0x1a')](function(_0x2bbfb5){_0x288f78['rows']=_0x2bbfb5;return _0x288f78;});}})['then'](respondWithFilteredResult(_0x10e614,_0x34f76f))['catch'](handleError(_0x10e614,null));};exports[_0xc378('0x49')]=function(_0x58af64,_0x2cf3d8){return db[_0xc378('0x2a')]['find']({'where':{'id':_0x58af64[_0xc378('0x27')]['id']}})[_0xc378('0x1a')](handleEntityNotFound(_0x2cf3d8,null))[_0xc378('0x1a')](function(_0x146996){if(_0x146996){return _0x146996['setTags'](_0x58af64[_0xc378('0x36')]['ids'],_[_0xc378('0x4a')](_0x58af64[_0xc378('0x36')],[_0xc378('0x3b'),'id'])||{})['spread'](function(){return db['Tag'][_0xc378('0x24')]({'attributes':['id',_0xc378('0x1e'),_0xc378('0x4b')],'where':{'id':_0x58af64[_0xc378('0x36')][_0xc378('0x3b')]}});})['then'](function(_0x3410c1){socket[_0xc378('0x4c')]('whatsappInteractionTags:save',{'id':Number(_0x58af64['params']['id']),'tags':_0x3410c1||[]});return{'id':Number(_0x58af64['params']['id']),'tags':_0x3410c1||[]};});}})[_0xc378('0x1a')](respondWithResult(_0x2cf3d8,null))[_0xc378('0x34')](handleError(_0x2cf3d8,null));};exports['removeTags']=function(_0x31b31e,_0x312429){return db['WhatsappInteraction']['find']({'where':{'id':_0x31b31e[_0xc378('0x27')]['id']}})['then'](handleEntityNotFound(_0x312429,null))[_0xc378('0x1a')](function(_0x56467c){if(_0x56467c){return _0x56467c[_0xc378('0x4d')](_0x31b31e[_0xc378('0x25')]['ids']);}})['then'](respondWithStatusCode(_0x312429,null))[_0xc378('0x34')](handleError(_0x312429,null));};exports['download']=function(_0x485da8,_0x10045c){var _0x3bc76f=moment()[_0xc378('0x4e')]()[_0xc378('0x4f')]();var _0x1e1a3e=path[_0xc378('0x50')](config[_0xc378('0x51')],'server',_0xc378('0x52'),_0xc378('0x53'));var _0x5b95e3=path['join'](config[_0xc378('0x51')],_0xc378('0x54'),_0xc378('0x52'),_0xc378('0x55'));var _0x381d46=path[_0xc378('0x50')](_0x1e1a3e,_0x3bc76f);var _0x21f692=util[_0xc378('0x47')](_0xc378('0x56'),_0x485da8['params']['id'],_0x3bc76f);var _0x3f0ab8=path['join'](_0x1e1a3e,_0x21f692);var _0x1fc54f=[];_0x1fc54f['push']({'model':db[_0xc378('0x57')],'as':_0xc378('0x57'),'attributes':['id',_0xc378('0x58')],'raw':!![]});_0x1fc54f[_0xc378('0x59')]({'model':db[_0xc378('0x5a')],'as':_0xc378('0x5b'),'attributes':['id',_0xc378('0x5c'),_0xc378('0x5d')],'raw':!![]});if(_0x485da8[_0xc378('0x25')][_0xc378('0x55')]){_0x1fc54f[_0xc378('0x59')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x138e42=[{'model':db['WhatsappMessage'],'as':_0xc378('0x5e'),'attributes':['id','body','createdAt',_0xc378('0x5f'),'secret',_0xc378('0x60')],'include':_0x1fc54f}];_0x138e42[_0xc378('0x59')]({'model':db[_0xc378('0x61')],'as':_0xc378('0x62'),'attributes':['id','name']});_0x138e42[_0xc378('0x59')]({'model':db[_0xc378('0x57')],'as':_0xc378('0x63'),'attributes':['id',_0xc378('0x58')]});return db['WhatsappInteraction'][_0xc378('0x37')]({'where':{'id':_0x485da8[_0xc378('0x27')]['id']},'include':_0x138e42})[_0xc378('0x1a')](handleEntityNotFound(_0x10045c,null))[_0xc378('0x1a')](function(_0x27a0b9){if(_0x27a0b9){var _0x564a45=_0x27a0b9[_0xc378('0x64')]({'plain':!![]});fs[_0xc378('0x65')](_0x381d46);var _0x3de2a1={'channel':_0xc378('0x66'),'account':_0x564a45[_0xc378('0x62')][_0xc378('0x1e')],'agent':_0x564a45['Owner']?_0x564a45['Owner'][_0xc378('0x58')]:_0xc378('0x67'),'createdAt':moment(_0x564a45[_0xc378('0x68')])['format'](_0xc378('0x48'))['toString'](),'closedAt':_0x564a45[_0xc378('0x69')]?moment(_0x564a45[_0xc378('0x6a')])[_0xc378('0x47')](_0xc378('0x48'))[_0xc378('0x4f')]():'','disposition':_0x564a45[_0xc378('0x6b')],'messages':_(_0x564a45[_0xc378('0x5e')])[_0xc378('0x45')]({'secret':![]})[_0xc378('0x20')](function(_0xfc4967){if(_0xfc4967['Attachment']){var _0x472d4f=path[_0xc378('0x50')](_0x5b95e3,_0xfc4967[_0xc378('0x6c')][_0xc378('0x6d')]);if(fs['existsSync'](_0x472d4f)){fs[_0xc378('0x6e')](_0x472d4f)[_0xc378('0x6f')](fs[_0xc378('0x70')](path[_0xc378('0x50')](_0x381d46,_0xfc4967['Attachment'][_0xc378('0x6d')])));}}return{'date':moment(_0xfc4967[_0xc378('0x68')])[_0xc378('0x47')](_0xc378('0x48'))['toString'](),'sender':_0xfc4967[_0xc378('0x5f')]==='out'?_0xfc4967['User']?_0xfc4967[_0xc378('0x57')][_0xc378('0x58')]:_0xc378('0x71'):_0xfc4967[_0xc378('0x5b')][_0xc378('0x5c')]+(_0xfc4967[_0xc378('0x5b')][_0xc378('0x5d')]?'\x20'+_0xfc4967['Contact'][_0xc378('0x5d')]:''),'body':_0xfc4967[_0xc378('0x6c')]?_0xfc4967[_0xc378('0x6c')]['basename']:_0xfc4967[_0xc378('0x36')],'direction':_0xfc4967[_0xc378('0x5f')]===_0xc378('0x72')?'A':'C','secret':_0xfc4967[_0xc378('0x73')],'read':_0xfc4967['read'],'attachment':_0xfc4967[_0xc378('0x6c')]};})[_0xc378('0x74')]()};return ejs[_0xc378('0x75')](path[_0xc378('0x50')](config[_0xc378('0x51')],_0xc378('0x54'),_0xc378('0x76'),'downloadInteraction.ejs'),{'interaction':_0x3de2a1})[_0xc378('0x1a')](function(_0x2dd661){var _0x2e4832=path[_0xc378('0x50')](_0x381d46,_0xc378('0x77')+_0x564a45['id']+'-'+_0x3bc76f+_0xc378('0x78'));var _0x5663a1={'path':_0x2e4832,'channel':_0xc378('0x66'),'interactionId':_0x564a45['id']};return pdf[_0xc378('0x79')](_0x2dd661,_0x5663a1);})['then'](function(){return new BPromise(function(_0x269cf5,_0x8f301a){zipdir(_0x381d46,{'saveTo':_0x3f0ab8},function(_0x37629d,_0x481020){if(_0x37629d)return _0x8f301a(_0x37629d);return _0x269cf5(_0x481020);});})['then'](function(){return new BPromise(function(_0x2bc334,_0x40f7f8){rimraf(_0x381d46,function(_0x49259a){if(_0x49259a)_0x40f7f8(_0x49259a);return _0x2bc334();});});})['then'](function(){return _0x10045c[_0xc378('0x7a')](_0x3f0ab8,_0x21f692,function(_0x52a59a){if(_0x52a59a){console[_0xc378('0x7b')](_0xc378('0x7c'),_0x52a59a);}else{fs[_0xc378('0x7d')](_0x3f0ab8);}});});});}else{return _0x10045c[_0xc378('0x12')](0xc8);}})[_0xc378('0x34')](handleError(_0x10045c,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 4bb9bdc..9b9ac7f 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 _0xe0c0=['emit','catch','hasOwnProperty','hook','exports','events','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove','then','setDataValue','Users','map','unreadMessages','length'];(function(_0x5dcb9d,_0x774650){var _0x4620fc=function(_0x14d286){while(--_0x14d286){_0x5dcb9d['push'](_0x5dcb9d['shift']());}};_0x4620fc(++_0x774650);}(_0xe0c0,0xa7));var _0x0e0c=function(_0x3f36df,_0x115b53){_0x3f36df=_0x3f36df-0x0;var _0x2f7bd1=_0xe0c0[_0x3f36df];return _0x2f7bd1;};'use strict';var EventEmitter=require(_0x0e0c('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x0e0c('0x1')];var WhatsappMessage=require(_0x0e0c('0x2'))['db'][_0x0e0c('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x0e0c('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0e0c('0x5'),'afterDestroy':_0x0e0c('0x6')};function emitEvent(_0x373046){return function(_0x54c73b,_0x4271d1,_0x2856d7){_0x54c73b['getUsers']({'attributes':['id'],'raw':!![]})[_0x0e0c('0x7')](function(_0xd67cf8){_0x54c73b[_0x0e0c('0x8')](_0x0e0c('0x9'),_0xd67cf8[_0x0e0c('0xa')](function(_0x512f83){return{'id':_0x512f83['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x54c73b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2bd09c){_0x54c73b['setDataValue'](_0x0e0c('0xb'),_0x2bd09c[_0x0e0c('0xc')]);WhatsappInteractionEvents[_0x0e0c('0xd')](_0x373046+':'+_0x54c73b['id'],_0x54c73b);WhatsappInteractionEvents[_0x0e0c('0xd')](_0x373046,_0x54c73b);_0x2856d7(null);})[_0x0e0c('0xe')](_0x2856d7(null));};}for(var e in events){if(events[_0x0e0c('0xf')](e)){var event=events[e];WhatsappInteraction[_0x0e0c('0x10')](e,emitEvent(event));}}module[_0x0e0c('0x11')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x915a=['hasOwnProperty','hook','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','save','getUsers','then','Users','map','findAll','setDataValue','length','emit','catch'];(function(_0x515a88,_0x186856){var _0x5ea902=function(_0x1924cc){while(--_0x1924cc){_0x515a88['push'](_0x515a88['shift']());}};_0x5ea902(++_0x186856);}(_0x915a,0x1d2));var _0xa915=function(_0x40d227,_0x40f916){_0x40d227=_0x40d227-0x0;var _0x4b774b=_0x915a[_0x40d227];return _0x4b774b;};'use strict';var EventEmitter=require(_0xa915('0x0'));var WhatsappInteraction=require(_0xa915('0x1'))['db'][_0xa915('0x2')];var WhatsappMessage=require(_0xa915('0x1'))['db'][_0xa915('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa915('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1106ee){return function(_0x422023,_0xf654ba,_0xb6900c){_0x422023[_0xa915('0x5')]({'attributes':['id'],'raw':!![]})[_0xa915('0x6')](function(_0x4e4368){_0x422023['setDataValue'](_0xa915('0x7'),_0x4e4368[_0xa915('0x8')](function(_0x173267){return{'id':_0x173267['id']};}));return WhatsappMessage[_0xa915('0x9')]({'where':{'WhatsappInteractionId':_0x422023['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x549502){_0x422023[_0xa915('0xa')]('unreadMessages',_0x549502[_0xa915('0xb')]);WhatsappInteractionEvents['emit'](_0x1106ee+':'+_0x422023['id'],_0x422023);WhatsappInteractionEvents[_0xa915('0xc')](_0x1106ee,_0x422023);_0xb6900c(null);})[_0xa915('0xd')](_0xb6900c(null));};}for(var e in events){if(events[_0xa915('0xe')](e)){var event=events[e];WhatsappInteraction[_0xa915('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 8c7bfce..f162282 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 _0xf496=['whatsapp_interactions','closed','format','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction'];(function(_0x38a050,_0x146a74){var _0x373062=function(_0xde6d5d){while(--_0xde6d5d){_0x38a050['push'](_0x38a050['shift']());}};_0x373062(++_0x146a74);}(_0xf496,0x114));var _0x6f49=function(_0xbf0e76,_0x206155){_0xbf0e76=_0xbf0e76-0x0;var _0x1ad5df=_0xf496[_0xbf0e76];return _0x1ad5df;};'use strict';var _=require(_0x6f49('0x0'));var util=require(_0x6f49('0x1'));var logger=require(_0x6f49('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6f49('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f49('0x4'));var rimraf=require(_0x6f49('0x5'));var config=require(_0x6f49('0x6'));var attributes=require(_0x6f49('0x7'));module[_0x6f49('0x8')]=function(_0xdd2a62,_0xf57f79){return _0xdd2a62['define'](_0x6f49('0x9'),attributes,{'tableName':_0x6f49('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x90f85f,_0x19c214,_0x262165){if(_0x90f85f['changed'](_0x6f49('0xb'))){_0x90f85f['closedAt']=moment()[_0x6f49('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x262165(null,_0x90f85f);}}});}; \ No newline at end of file +var _0x3e1d=['WhatsappInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','api','moment','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports'];(function(_0x276221,_0x378da4){var _0x4fa716=function(_0x4dd561){while(--_0x4dd561){_0x276221['push'](_0x276221['shift']());}};_0x4fa716(++_0x378da4);}(_0x3e1d,0x13a));var _0xd3e1=function(_0x1a8192,_0x3453f2){_0x1a8192=_0x1a8192-0x0;var _0x131de2=_0x3e1d[_0x1a8192];return _0x131de2;};'use strict';var _=require('lodash');var util=require(_0xd3e1('0x0'));var logger=require('../../config/logger')(_0xd3e1('0x1'));var moment=require(_0xd3e1('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd3e1('0x3'));var rimraf=require(_0xd3e1('0x4'));var config=require(_0xd3e1('0x5'));var attributes=require(_0xd3e1('0x6'));module[_0xd3e1('0x7')]=function(_0x428ae7,_0x2a275f){return _0x428ae7['define'](_0xd3e1('0x8'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xcf4a1a,_0x12d860,_0x80c6f0){if(_0xcf4a1a[_0xd3e1('0x9')](_0xd3e1('0xa'))){_0xcf4a1a[_0xd3e1('0xb')]=moment()[_0xd3e1('0xc')](_0xd3e1('0xd'));}_0x80c6f0(null,_0xcf4a1a);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 064bdb5..8c391ce 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 _0xe52c=['util','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','where','attributes','stringify','AddTagsToWhatsappInteraction','find','addTags','body','ids','omit','AddTags'];(function(_0xe3ec17,_0x5c0b29){var _0x5d6d56=function(_0x572657){while(--_0x572657){_0xe3ec17['push'](_0xe3ec17['shift']());}};_0x5d6d56(++_0x5c0b29);}(_0xe52c,0x1ee));var _0xce52=function(_0x62a470,_0x80f35a){_0x62a470=_0x62a470-0x0;var _0xb6ccfd=_0xe52c[_0x62a470];return _0xb6ccfd;};'use strict';var _=require('lodash');var util=require(_0xce52('0x0'));var moment=require(_0xce52('0x1'));var BPromise=require(_0xce52('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce52('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xce52('0x4'));var config=require(_0xce52('0x5'));var jayson=require(_0xce52('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0xce52('0x7')]=_[_0xce52('0x8')](config[_0xce52('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xce52('0x9'))(new Redis(config[_0xce52('0x7')]));require(_0xce52('0xa'))[_0xce52('0xb')](socket);function respondWithRpcPromise(_0x39292c,_0x1c7ac6,_0x495a5b){return new BPromise(function(_0x4f161f,_0xb4f4df){return client[_0xce52('0xc')](_0x39292c,_0x495a5b)[_0xce52('0xd')](function(_0x53f1a4){logger[_0xce52('0xe')](_0xce52('0xf'),_0x1c7ac6,_0xce52('0x10'));logger[_0xce52('0x11')](_0xce52('0x12'),_0x1c7ac6,_0xce52('0x10'),JSON['stringify'](_0x53f1a4));if(_0x53f1a4[_0xce52('0x13')]){if(_0x53f1a4[_0xce52('0x13')]['code']===0x1f4){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x1c7ac6,_0x53f1a4[_0xce52('0x13')][_0xce52('0x14')]);return _0xb4f4df(_0x53f1a4[_0xce52('0x13')][_0xce52('0x14')]);}logger[_0xce52('0x13')](_0xce52('0xf'),_0x1c7ac6,_0x53f1a4[_0xce52('0x13')][_0xce52('0x14')]);return _0x4f161f(_0x53f1a4['error']['message']);}else{logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x1c7ac6,_0xce52('0x10'));_0x4f161f(_0x53f1a4[_0xce52('0x15')][_0xce52('0x14')]);}})[_0xce52('0x16')](function(_0x51418a){logger[_0xce52('0x13')](_0xce52('0xf'),_0x1c7ac6,_0x51418a);_0xb4f4df(_0x51418a);});});}exports[_0xce52('0x17')]=function(_0x44386e){var _0x1c8e70=this;return new Promise(function(_0x2ed365,_0x467d3a){return db[_0xce52('0x18')][_0xce52('0x19')](_0x44386e['body'],{'raw':_0x44386e['options']?_0x44386e[_0xce52('0x1a')][_0xce52('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44386e['options']?_0x44386e[_0xce52('0x1a')][_0xce52('0x1c')]||null:null,'attributes':_0x44386e[_0xce52('0x1a')]?_0x44386e[_0xce52('0x1a')][_0xce52('0x1d')]||null:null,'limit':_0x44386e['options']?_0x44386e['options']['limit']||null:null})['then'](function(_0x119c14){logger['info'](_0xce52('0x17'),_0x44386e);logger[_0xce52('0x11')](_0xce52('0x17'),_0x44386e,JSON[_0xce52('0x1e')](_0x119c14));_0x2ed365(_0x119c14);})[_0xce52('0x16')](function(_0x515ea4){logger[_0xce52('0x13')]('UpdateWhatsappInteraction',_0x515ea4['message'],_0x44386e);_0x467d3a(_0x1c8e70[_0xce52('0x13')](0x1f4,_0x515ea4[_0xce52('0x14')]));});});};exports[_0xce52('0x1f')]=function(_0x3b9255){return new Promise(function(_0x598ed6,_0x1d5088){return db[_0xce52('0x18')][_0xce52('0x20')]({'where':_0x3b9255[_0xce52('0x1a')]?_0x3b9255['options'][_0xce52('0x1c')]||null:null})[_0xce52('0xd')](function(_0x4eaa11){if(_0x4eaa11){return _0x4eaa11[_0xce52('0x21')](_0x3b9255[_0xce52('0x22')][_0xce52('0x23')],_[_0xce52('0x24')](_0x3b9255['body'],[_0xce52('0x23'),'id'])||{});}})['spread'](function(_0x322c0d){logger[_0xce52('0xe')]('AddTags',_0x3b9255);logger['debug'](_0xce52('0x25'),_0x3b9255,JSON[_0xce52('0x1e')](_0x322c0d));_0x598ed6(_0x322c0d);})[_0xce52('0x16')](function(_0x1d0b8e){logger[_0xce52('0x13')](_0xce52('0x25'),_0x1d0b8e['message'],_0x3b9255);_0x1d5088(_this[_0xce52('0x13')](0x1f4,_0x1d0b8e[_0xce52('0x14')]));});});}; \ No newline at end of file +var _0xd887=['stringify','error','code','message','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','limit','debug','catch','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x9cfb,_0x3c156a){var _0x45306c=function(_0x4530ea){while(--_0x4530ea){_0x9cfb['push'](_0x9cfb['shift']());}};_0x45306c(++_0x3c156a);}(_0xd887,0x197));var _0x7d88=function(_0x1ed46f,_0x7691d7){_0x1ed46f=_0x1ed46f-0x0;var _0x43b931=_0xd887[_0x1ed46f];return _0x43b931;};'use strict';var _=require(_0x7d88('0x0'));var util=require(_0x7d88('0x1'));var moment=require(_0x7d88('0x2'));var BPromise=require(_0x7d88('0x3'));var rs=require(_0x7d88('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d88('0x5'))['db'];var utils=require(_0x7d88('0x6'));var logger=require(_0x7d88('0x7'))(_0x7d88('0x8'));var config=require('../../config/environment');var jayson=require(_0x7d88('0x9'));var client=jayson[_0x7d88('0xa')][_0x7d88('0xb')]({'port':0x232a});config[_0x7d88('0xc')]=_[_0x7d88('0xd')](config[_0x7d88('0xc')],{'host':_0x7d88('0xe'),'port':0x18eb});var socket=require(_0x7d88('0xf'))(new Redis(config['redis']));require(_0x7d88('0x10'))[_0x7d88('0x11')](socket);function respondWithRpcPromise(_0x47b9fb,_0x4328be,_0x277e7a){return new BPromise(function(_0x5d63a8,_0x21926d){return client['request'](_0x47b9fb,_0x277e7a)[_0x7d88('0x12')](function(_0x1c1b65){logger[_0x7d88('0x13')](_0x7d88('0x14'),_0x4328be,_0x7d88('0x15'));logger['debug']('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x4328be,'request\x20sent',JSON[_0x7d88('0x16')](_0x1c1b65));if(_0x1c1b65[_0x7d88('0x17')]){if(_0x1c1b65['error'][_0x7d88('0x18')]===0x1f4){logger[_0x7d88('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x4328be,_0x1c1b65[_0x7d88('0x17')][_0x7d88('0x19')]);return _0x21926d(_0x1c1b65[_0x7d88('0x17')][_0x7d88('0x19')]);}logger[_0x7d88('0x17')](_0x7d88('0x14'),_0x4328be,_0x1c1b65[_0x7d88('0x17')][_0x7d88('0x19')]);return _0x5d63a8(_0x1c1b65[_0x7d88('0x17')][_0x7d88('0x19')]);}else{logger[_0x7d88('0x13')](_0x7d88('0x14'),_0x4328be,_0x7d88('0x15'));_0x5d63a8(_0x1c1b65['result'][_0x7d88('0x19')]);}})['catch'](function(_0x45dc5b){logger[_0x7d88('0x17')](_0x7d88('0x14'),_0x4328be,_0x45dc5b);_0x21926d(_0x45dc5b);});});}exports[_0x7d88('0x1a')]=function(_0x865f31){var _0x1fd0ff=this;return new Promise(function(_0x1ddaa8,_0x39766c){return db[_0x7d88('0x1b')][_0x7d88('0x1c')](_0x865f31[_0x7d88('0x1d')],{'raw':_0x865f31[_0x7d88('0x1e')]?_0x865f31[_0x7d88('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x865f31[_0x7d88('0x1e')]?_0x865f31['options']['where']||null:null,'attributes':_0x865f31[_0x7d88('0x1e')]?_0x865f31[_0x7d88('0x1e')]['attributes']||null:null,'limit':_0x865f31[_0x7d88('0x1e')]?_0x865f31[_0x7d88('0x1e')][_0x7d88('0x1f')]||null:null})[_0x7d88('0x12')](function(_0x396562){logger[_0x7d88('0x13')](_0x7d88('0x1a'),_0x865f31);logger[_0x7d88('0x20')](_0x7d88('0x1a'),_0x865f31,JSON[_0x7d88('0x16')](_0x396562));_0x1ddaa8(_0x396562);})[_0x7d88('0x21')](function(_0x301f32){logger[_0x7d88('0x17')](_0x7d88('0x1a'),_0x301f32['message'],_0x865f31);_0x39766c(_0x1fd0ff['error'](0x1f4,_0x301f32['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x4e86b6){return new Promise(function(_0x39e497,_0x58771d){return db[_0x7d88('0x1b')][_0x7d88('0x22')]({'where':_0x4e86b6['options']?_0x4e86b6[_0x7d88('0x1e')]['where']||null:null})[_0x7d88('0x12')](function(_0x52972b){if(_0x52972b){return _0x52972b[_0x7d88('0x23')](_0x4e86b6[_0x7d88('0x1d')][_0x7d88('0x24')],_['omit'](_0x4e86b6[_0x7d88('0x1d')],[_0x7d88('0x24'),'id'])||{});}})[_0x7d88('0x25')](function(_0x31aa2d){logger['info'](_0x7d88('0x26'),_0x4e86b6);logger[_0x7d88('0x20')](_0x7d88('0x26'),_0x4e86b6,JSON[_0x7d88('0x16')](_0x31aa2d));_0x39e497(_0x31aa2d);})['catch'](function(_0x4a6fb8){logger[_0x7d88('0x17')]('AddTags',_0x4a6fb8[_0x7d88('0x19')],_0x4e86b6);_0x58771d(_this[_0x7d88('0x17')](0x1f4,_0x4a6fb8[_0x7d88('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 5a6478c..339a3eb 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 _0x44d7=['register','length','save','remove','emit','removeListener'];(function(_0x562163,_0x264e2a){var _0x551eed=function(_0x5ecde8){while(--_0x5ecde8){_0x562163['push'](_0x562163['shift']());}};_0x551eed(++_0x264e2a);}(_0x44d7,0x15e));var _0x744d=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x44d7[_0x53ccf2];return _0x5a2964;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x744d('0x0'),_0x744d('0x1'),'update'];function createListener(_0x4cae79,_0x3532af){return function(_0x1154ed){_0x3532af[_0x744d('0x2')](_0x4cae79,_0x1154ed);};}function removeListener(_0x5b5602,_0x5599d4){return function(){WhatsappInteractionEvents[_0x744d('0x3')](_0x5b5602,_0x5599d4);};}exports[_0x744d('0x4')]=function(_0x3e35a1){for(var _0x4a2014=0x0,_0x16f7d3=events[_0x744d('0x5')];_0x4a2014<_0x16f7d3;_0x4a2014++){var _0x5f26ef=events[_0x4a2014];var _0x57ad4c=createListener('whatsappInteraction:'+_0x5f26ef,_0x3e35a1);WhatsappInteractionEvents['on'](_0x5f26ef,_0x57ad4c);}}; \ No newline at end of file +var _0x09fa=['remove','update','emit','removeListener','register','length','./whatsappInteraction.events','save'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x09fa,0x1c6));var _0xa09f=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x09fa[_0x413feb];return _0x40ee88;};'use strict';var WhatsappInteractionEvents=require(_0xa09f('0x0'));var events=[_0xa09f('0x1'),_0xa09f('0x2'),_0xa09f('0x3')];function createListener(_0x4f05c5,_0x5759f3){return function(_0x276a76){_0x5759f3[_0xa09f('0x4')](_0x4f05c5,_0x276a76);};}function removeListener(_0x66dd3a,_0x2fb610){return function(){WhatsappInteractionEvents[_0xa09f('0x5')](_0x66dd3a,_0x2fb610);};}exports[_0xa09f('0x6')]=function(_0x30b84f){for(var _0x2b9f4e=0x0,_0x41a171=events[_0xa09f('0x7')];_0x2b9f4e<_0x41a171;_0x2b9f4e++){var _0xf1c9c4=events[_0x2b9f4e];var _0x215771=createListener('whatsappInteraction:'+_0xf1c9c4,_0x30b84f);WhatsappInteractionEvents['on'](_0xf1c9c4,_0x215771);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index dec9932..546d454 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 _0xc865=['put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','/:id/status','status'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0xc865,0x11c));var _0x5c86=function(_0x1eaec0,_0x37e722){_0x1eaec0=_0x1eaec0-0x0;var _0x5d02d5=_0xc865[_0x1eaec0];return _0x5d02d5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5c86('0x0'));var timeout=require(_0x5c86('0x1'));var express=require(_0x5c86('0x2'));var router=express[_0x5c86('0x3')]();var fs_extra=require(_0x5c86('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5c86('0x5'));var config=require('../../config/environment');var controller=require(_0x5c86('0x6'));router[_0x5c86('0x7')]('/',auth[_0x5c86('0x8')](),controller['index']);router['get'](_0x5c86('0x9'),auth[_0x5c86('0x8')](),controller[_0x5c86('0xa')]);router[_0x5c86('0x7')](_0x5c86('0xb'),auth['isAuthenticated'](),controller[_0x5c86('0xc')]);router[_0x5c86('0xd')]('/',auth[_0x5c86('0x8')](),interaction['tracked']('whatsapp','whatsappmessage:create'),controller['create']);router[_0x5c86('0xd')](_0x5c86('0xe'),controller[_0x5c86('0xf')]);router[_0x5c86('0x10')]('/:id',auth[_0x5c86('0x8')](),controller[_0x5c86('0x11')]);router[_0x5c86('0x10')](_0x5c86('0x12'),auth[_0x5c86('0x8')](),controller[_0x5c86('0x13')]);router[_0x5c86('0x10')](_0x5c86('0x14'),auth[_0x5c86('0x8')](),controller[_0x5c86('0x15')]);router[_0x5c86('0x16')](_0x5c86('0xb'),auth['isAuthenticated'](),controller[_0x5c86('0x17')]);module[_0x5c86('0x18')]=router; \ No newline at end of file +var _0xe54c=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','/describe','/:id','show','post','tracked','whatsapp','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util'];(function(_0x43ecf0,_0x105b05){var _0x26ce17=function(_0x37df70){while(--_0x37df70){_0x43ecf0['push'](_0x43ecf0['shift']());}};_0x26ce17(++_0x105b05);}(_0xe54c,0x85));var _0xce54=function(_0x258b93,_0x188ccc){_0x258b93=_0x258b93-0x0;var _0x35484b=_0xe54c[_0x258b93];return _0x35484b;};'use strict';var multer=require(_0xce54('0x0'));var util=require(_0xce54('0x1'));var path=require(_0xce54('0x2'));var timeout=require('connect-timeout');var express=require(_0xce54('0x3'));var router=express['Router']();var fs_extra=require(_0xce54('0x4'));var auth=require(_0xce54('0x5'));var interaction=require(_0xce54('0x6'));var config=require(_0xce54('0x7'));var controller=require(_0xce54('0x8'));router['get']('/',auth[_0xce54('0x9')](),controller[_0xce54('0xa')]);router['get'](_0xce54('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xce54('0xc'),auth[_0xce54('0x9')](),controller[_0xce54('0xd')]);router[_0xce54('0xe')]('/',auth['isAuthenticated'](),interaction[_0xce54('0xf')](_0xce54('0x10'),'whatsappmessage:create'),controller['create']);router[_0xce54('0xe')](_0xce54('0x11'),controller[_0xce54('0x12')]);router[_0xce54('0x13')](_0xce54('0xc'),auth['isAuthenticated'](),controller[_0xce54('0x14')]);router['put'](_0xce54('0x15'),auth[_0xce54('0x9')](),controller[_0xce54('0x16')]);router['put'](_0xce54('0x17'),auth[_0xce54('0x9')](),controller[_0xce54('0x18')]);router['delete'](_0xce54('0xc'),auth[_0xce54('0x9')](),controller[_0xce54('0x19')]);module[_0xce54('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 11b7749..335bafd 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 _0x652f=['STRING','DATE','TEXT','exports','medium','ENUM','out'];(function(_0x385ac4,_0x9c7883){var _0x49a74c=function(_0x35762e){while(--_0x35762e){_0x385ac4['push'](_0x385ac4['shift']());}};_0x49a74c(++_0x9c7883);}(_0x652f,0xf1));var _0xf652=function(_0x10bf07,_0x2673c7){_0x10bf07=_0x10bf07-0x0;var _0x3a1fa4=_0x652f[_0x10bf07];return _0x3a1fa4;};'use strict';var Sequelize=require('sequelize');module[_0xf652('0x0')]={'body':{'type':Sequelize['TEXT'](_0xf652('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xf652('0x2')]('in',_0xf652('0x3')),'defaultValue':_0xf652('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf652('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xf652('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xf652('0x4')]},'providerResponse':{'type':Sequelize[_0xf652('0x6')]}}; \ No newline at end of file +var _0x711a=['DATE','sequelize','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x1f4ae2,_0x2ef893){var _0x4a4d7e=function(_0x31fc8e){while(--_0x31fc8e){_0x1f4ae2['push'](_0x1f4ae2['shift']());}};_0x4a4d7e(++_0x2ef893);}(_0x711a,0x14a));var _0xa711=function(_0x316b74,_0x4440f3){_0x316b74=_0x316b74-0x0;var _0x4c7c94=_0x711a[_0x316b74];return _0x4c7c94;};'use strict';var Sequelize=require(_0xa711('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xa711('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xa711('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa711('0x3')]('in',_0xa711('0x4')),'defaultValue':_0xa711('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xa711('0x5')](0xbe)},'phone':{'type':Sequelize[_0xa711('0x5')]},'readAt':{'type':Sequelize[_0xa711('0x6')]},'secret':{'type':Sequelize[_0xa711('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa711('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 17a2640..deef559 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 _0x0319=['inspect','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','end','offset','undefined','count','limit','set','apply','update','then','sendStatus','stack','name','send','index','WhatsappMessage','rawAttributes','fieldName','key','model','map','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','query','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','find','destroy','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','contact','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','interaction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','Sequelize','QueryTypes','User','interface','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio'];(function(_0x34f8ba,_0x2bb6a8){var _0xa5ed05=function(_0x497771){while(--_0x497771){_0x34f8ba['push'](_0x34f8ba['shift']());}};_0xa5ed05(++_0x2bb6a8);}(_0x0319,0x1a8));var _0x9031=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x0319[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0x9031('0x0'));var rimraf=require(_0x9031('0x1'));var zipdir=require(_0x9031('0x2'));var jsonpatch=require(_0x9031('0x3'));var rp=require(_0x9031('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9031('0x5'));var path=require(_0x9031('0x6'));var sox=require(_0x9031('0x7'));var csv=require(_0x9031('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9031('0x9'));var crypto=require(_0x9031('0xa'));var jsforce=require(_0x9031('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9031('0xc'));var Papa=require(_0x9031('0xd'));var Redis=require(_0x9031('0xe'));var authService=require(_0x9031('0xf'));var qs=require(_0x9031('0x10'));var as=require(_0x9031('0x11'));var hardwareService=require(_0x9031('0x12'));var logger=require(_0x9031('0x13'))(_0x9031('0x14'));var utils=require(_0x9031('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x9031('0x16')]=_['defaults'](config[_0x9031('0x16')],{'host':_0x9031('0x17'),'port':0x18eb});var socket=require(_0x9031('0x18'))(new Redis(config[_0x9031('0x16')]));require(_0x9031('0x19'))[_0x9031('0x1a')](socket);var jayson=require(_0x9031('0x1b'));var client=jayson[_0x9031('0x1c')][_0x9031('0x1d')]({'port':0x232c});var client9002=jayson[_0x9031('0x1c')][_0x9031('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x22365f,_0x5bd013,_0x1953ed,_0x2a1c39){return new BPromise(function(_0x122fb5,_0x46dc8b){var _0x14d024=_0x2a1c39||client;return _0x14d024[_0x9031('0x1e')](_0x22365f,_0x1953ed)['then'](function(_0x57ca4a){logger[_0x9031('0x1f')](_0x9031('0x20'),_0x5bd013,_0x9031('0x21'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x5bd013,'request\x20sent',JSON[_0x9031('0x22')](_0x57ca4a));if(_0x57ca4a[_0x9031('0x23')]){if(_0x57ca4a[_0x9031('0x23')][_0x9031('0x24')]===0x1f4){logger['error'](_0x9031('0x20'),_0x5bd013,_0x57ca4a[_0x9031('0x23')][_0x9031('0x25')]);return _0x46dc8b(_0x57ca4a[_0x9031('0x23')]['message']);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x5bd013,_0x57ca4a['error'][_0x9031('0x25')]);return _0x122fb5(_0x57ca4a[_0x9031('0x23')]['message']);}else{logger[_0x9031('0x1f')]('WhatsappMessage,\x20%s,\x20%s',_0x5bd013,'request\x20sent');_0x122fb5(_0x57ca4a['result']['message']);}})[_0x9031('0x26')](function(_0x1b8c69){logger[_0x9031('0x23')](_0x9031('0x20'),_0x5bd013,_0x1b8c69);_0x46dc8b(_0x1b8c69);});});}function respondWithStatusCode(_0x21a28e,_0xecd10){_0xecd10=_0xecd10||0xcc;return function(_0x1a4f07){if(_0x1a4f07){return _0x21a28e['sendStatus'](_0xecd10);}return _0x21a28e[_0x9031('0x27')](_0xecd10)[_0x9031('0x28')]();};}function respondWithResult(_0x2e29f0,_0x1146d1){_0x1146d1=_0x1146d1||0xc8;return function(_0x2f8ff9){if(_0x2f8ff9){return _0x2e29f0[_0x9031('0x27')](_0x1146d1)['json'](_0x2f8ff9);}};}function respondWithFilteredResult(_0x3b8bc2,_0x48cb56){return function(_0x15cda4){if(_0x15cda4){var _0x1673ac=typeof _0x48cb56[_0x9031('0x29')]===_0x9031('0x2a')&&typeof _0x48cb56['limit']==='undefined';var _0x20f627=_0x15cda4[_0x9031('0x2b')];var _0x5b2981=_0x1673ac?0x0:_0x48cb56['offset'];var _0x29327f=_0x1673ac?_0x15cda4[_0x9031('0x2b')]:_0x48cb56[_0x9031('0x29')]+_0x48cb56[_0x9031('0x2c')];var _0x7cde95;if(_0x29327f>=_0x20f627){_0x29327f=_0x20f627;_0x7cde95=0xc8;}else{_0x7cde95=0xce;}_0x3b8bc2[_0x9031('0x27')](_0x7cde95);return _0x3b8bc2[_0x9031('0x2d')]('Content-Range',_0x5b2981+'-'+_0x29327f+'/'+_0x20f627)['json'](_0x15cda4);}return null;};}function patchUpdates(_0x150df2){return function(_0x29b077){try{jsonpatch[_0x9031('0x2e')](_0x29b077,_0x150df2,!![]);}catch(_0x35c64a){return BPromise['reject'](_0x35c64a);}return _0x29b077['save']();};}function saveUpdates(_0x2fb778,_0x5a2da7){return function(_0x1dd9c2){if(_0x1dd9c2){return _0x1dd9c2[_0x9031('0x2f')](_0x2fb778)[_0x9031('0x30')](function(_0x5a55d8){return _0x5a55d8;});}return null;};}function removeEntity(_0x57c8da,_0x2ce68e){return function(_0x477b2c){if(_0x477b2c){return _0x477b2c['destroy']()['then'](function(){_0x57c8da[_0x9031('0x27')](0xcc)[_0x9031('0x28')]();});}};}function handleEntityNotFound(_0x59d601,_0x20a9e0){return function(_0x939e9b){if(!_0x939e9b){_0x59d601[_0x9031('0x31')](0x194);}return _0x939e9b;};}function handleError(_0x8e420,_0x9750dc){_0x9750dc=_0x9750dc||0x1f4;return function(_0x4e994a){logger[_0x9031('0x23')](_0x4e994a[_0x9031('0x32')]);if(_0x4e994a[_0x9031('0x33')]){delete _0x4e994a[_0x9031('0x33')];}_0x8e420['status'](_0x9750dc)[_0x9031('0x34')](_0x4e994a);};}exports[_0x9031('0x35')]=function(_0x37e9f2,_0x43e544){var _0x426ded={},_0x4172f1={},_0x34db21={'count':0x0,'rows':[]};var _0x34fe45=_['map'](db[_0x9031('0x36')][_0x9031('0x37')],function(_0x50f996){return{'name':_0x50f996[_0x9031('0x38')],'type':_0x50f996['type'][_0x9031('0x39')]};});_0x4172f1[_0x9031('0x3a')]=_[_0x9031('0x3b')](_0x34fe45,_0x9031('0x33'));_0x4172f1['query']=_[_0x9031('0x3c')](_0x37e9f2['query']);_0x4172f1[_0x9031('0x3d')]=_[_0x9031('0x3e')](_0x4172f1[_0x9031('0x3a')],_0x4172f1['query']);_0x426ded[_0x9031('0x3f')]=_[_0x9031('0x3e')](_0x4172f1['model'],qs[_0x9031('0x40')](_0x37e9f2['query'][_0x9031('0x40')]));_0x426ded[_0x9031('0x3f')]=_0x426ded['attributes'][_0x9031('0x41')]?_0x426ded[_0x9031('0x3f')]:_0x4172f1[_0x9031('0x3a')];if(!_0x37e9f2['query'][_0x9031('0x42')](_0x9031('0x43'))){_0x426ded[_0x9031('0x2c')]=qs['limit'](_0x37e9f2[_0x9031('0x44')]['limit']);_0x426ded[_0x9031('0x29')]=qs['offset'](_0x37e9f2[_0x9031('0x44')][_0x9031('0x29')]);}_0x426ded[_0x9031('0x45')]=qs[_0x9031('0x46')](_0x37e9f2[_0x9031('0x44')][_0x9031('0x46')]);_0x426ded['where']=qs[_0x9031('0x3d')](_[_0x9031('0x47')](_0x37e9f2[_0x9031('0x44')],_0x4172f1[_0x9031('0x3d')]),_0x34fe45);if(_0x37e9f2[_0x9031('0x44')][_0x9031('0x48')]){_0x426ded[_0x9031('0x49')]=_[_0x9031('0x4a')](_0x426ded['where'],{'$or':_[_0x9031('0x3b')](_0x34fe45,function(_0x228629){if(_0x228629[_0x9031('0x4b')]!==_0x9031('0x4c')){var _0x151571={};_0x151571[_0x228629['name']]={'$like':'%'+_0x37e9f2['query']['filter']+'%'};return _0x151571;}})});}_0x426ded=_['merge']({},_0x426ded,_0x37e9f2[_0x9031('0x4d')]);var _0xab93b={'where':_0x426ded[_0x9031('0x49')]};return db[_0x9031('0x36')][_0x9031('0x2b')](_0xab93b)[_0x9031('0x30')](function(_0x360d86){_0x34db21['count']=_0x360d86;if(_0x37e9f2[_0x9031('0x44')][_0x9031('0x4e')]){_0x426ded[_0x9031('0x4f')]=[{'all':!![]}];}return db[_0x9031('0x36')][_0x9031('0x50')](_0x426ded);})[_0x9031('0x30')](function(_0x1830a8){_0x34db21[_0x9031('0x51')]=_0x1830a8;return _0x34db21;})[_0x9031('0x30')](respondWithFilteredResult(_0x43e544,_0x426ded))['catch'](handleError(_0x43e544,null));};exports[_0x9031('0x52')]=function(_0xb1ffd0,_0x109d50){var _0x43dbcd={'raw':!![],'where':{'id':_0xb1ffd0[_0x9031('0x53')]['id']}},_0x2f754f={};_0x2f754f[_0x9031('0x3a')]=_[_0x9031('0x3c')](db[_0x9031('0x36')]['rawAttributes']);_0x2f754f[_0x9031('0x44')]=_['keys'](_0xb1ffd0['query']);_0x2f754f[_0x9031('0x3d')]=_[_0x9031('0x3e')](_0x2f754f[_0x9031('0x3a')],_0x2f754f[_0x9031('0x44')]);_0x43dbcd[_0x9031('0x3f')]=_[_0x9031('0x3e')](_0x2f754f[_0x9031('0x3a')],qs[_0x9031('0x40')](_0xb1ffd0['query'][_0x9031('0x40')]));_0x43dbcd[_0x9031('0x3f')]=_0x43dbcd[_0x9031('0x3f')]['length']?_0x43dbcd['attributes']:_0x2f754f[_0x9031('0x3a')];if(_0xb1ffd0[_0x9031('0x44')][_0x9031('0x4e')]){_0x43dbcd[_0x9031('0x4f')]=[{'all':!![]}];}_0x43dbcd=_[_0x9031('0x4a')]({},_0x43dbcd,_0xb1ffd0[_0x9031('0x4d')]);return db[_0x9031('0x36')]['find'](_0x43dbcd)[_0x9031('0x30')](handleEntityNotFound(_0x109d50,null))['then'](respondWithResult(_0x109d50,null))[_0x9031('0x26')](handleError(_0x109d50,null));};exports[_0x9031('0x54')]=function(_0x4bb6da,_0x4e6c2d){return db['WhatsappMessage'][_0x9031('0x54')](_0x4bb6da[_0x9031('0x55')],{})[_0x9031('0x30')](respondWithResult(_0x4e6c2d,0xc9))[_0x9031('0x26')](handleError(_0x4e6c2d,null));};exports[_0x9031('0x2f')]=function(_0x4d23b2,_0x5cacc6){if(_0x4d23b2[_0x9031('0x55')]['id']){delete _0x4d23b2[_0x9031('0x55')]['id'];}return db[_0x9031('0x36')][_0x9031('0x56')]({'where':{'id':_0x4d23b2[_0x9031('0x53')]['id']}})[_0x9031('0x30')](handleEntityNotFound(_0x5cacc6,null))[_0x9031('0x30')](saveUpdates(_0x4d23b2[_0x9031('0x55')],null))[_0x9031('0x30')](respondWithResult(_0x5cacc6,null))[_0x9031('0x26')](handleError(_0x5cacc6,null));};exports[_0x9031('0x57')]=function(_0x40d4d5,_0x406b95){return db[_0x9031('0x36')][_0x9031('0x56')]({'where':{'id':_0x40d4d5[_0x9031('0x53')]['id']}})[_0x9031('0x30')](handleEntityNotFound(_0x406b95,null))[_0x9031('0x30')](removeEntity(_0x406b95,null))['catch'](handleError(_0x406b95,null));};exports[_0x9031('0x58')]=function(_0x35a098,_0x41688f){return db[_0x9031('0x36')]['describe']()[_0x9031('0x30')](respondWithResult(_0x41688f,null))['catch'](handleError(_0x41688f,null));};var interaction_log=require(_0x9031('0x13'))(_0x9031('0x59'));exports[_0x9031('0x5a')]=function(_0x1aa20b,_0x287b69,_0x6cee42){var _0x44726f={'agent':{},'channel':_0x9031('0x5b')};if(_0x1aa20b[_0x9031('0x55')]['id']){delete _0x1aa20b[_0x9031('0x55')]['id'];}_0x1aa20b[_0x9031('0x55')][_0x9031('0x5c')]=!![];_0x1aa20b[_0x9031('0x55')][_0x9031('0x5d')]=moment()[_0x9031('0x5e')](_0x9031('0x5f'));_0x1aa20b[_0x9031('0x55')]['UserId']=_0x1aa20b['body'][_0x9031('0x60')]||_0x1aa20b['user']['id'];_0x44726f[_0x9031('0x61')]['id']=_0x1aa20b[_0x9031('0x55')][_0x9031('0x60')];return db[_0x9031('0x36')][_0x9031('0x56')]({'where':{'id':_0x1aa20b[_0x9031('0x53')]['id'],'UserId':null}})[_0x9031('0x30')](handleEntityNotFound(_0x287b69,null))[_0x9031('0x30')](saveUpdates(_0x1aa20b[_0x9031('0x55')],null))[_0x9031('0x30')](function(_0x249bd7){if(_0x249bd7){_0x44726f['message']=_0x249bd7[_0x9031('0x62')]({'plain':!![]});return db[_0x9031('0x63')]['find']({'where':{'id':_0x249bd7[_0x9031('0x64')]}});}return null;})[_0x9031('0x30')](handleEntityNotFound(_0x287b69,null))[_0x9031('0x30')](function(_0x4d081d){if(_0x4d081d){return _0x4d081d[_0x9031('0x2f')]({'UserId':_0x1aa20b[_0x9031('0x55')]['UserId'],'read1stAt':_[_0x9031('0x65')](_0x4d081d[_0x9031('0x66')])?moment()[_0x9031('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x9031('0x30')](function(_0x334ec5){if(_0x334ec5){_0x44726f['interaction']=_0x334ec5[_0x9031('0x62')]({'plain':!![]});interaction_log[_0x9031('0x1f')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1aa20b['user']['id'],_0x1aa20b[_0x9031('0x67')][_0x9031('0x33')],_0x1aa20b[_0x9031('0x67')][_0x9031('0x68')],_0x44726f['interaction']['id'],_0x1aa20b[_0x9031('0x55')]?JSON[_0x9031('0x22')](_0x1aa20b[_0x9031('0x55')]):'null');return respondWithRpcPromise(_0x9031('0x69'),_0x9031('0x6a'),_0x44726f);}return null;})[_0x9031('0x30')](function(_0x2d68ff){var _0x23c5a8=_0x9031('0x6b')+_0x2d68ff[_0x9031('0x25')]['ContactId'];return db[_0x9031('0x6c')][_0x9031('0x44')](_0x23c5a8,{'type':db['Sequelize']['QueryTypes'][_0x9031('0x6d')],'raw':!![]})['then'](function(_0x2a39ae){return _0x2a39ae;});})[_0x9031('0x30')](function(_0x1f972d){if(_0x1f972d){_0x44726f[_0x9031('0x25')][_0x9031('0x6e')]=_0x1f972d[0x0];if(!_0x1aa20b[_0x9031('0x55')]['UserId'])return;return db['User'][_0x9031('0x56')]({'where':{'id':_0x1aa20b[_0x9031('0x55')][_0x9031('0x60')],'role':_0x9031('0x61')},'attributes':['id','name',_0x9031('0x6f'),_0x9031('0x70'),_0x9031('0x71')],'raw':!![]});}return null;})[_0x9031('0x30')](function(_0x3758b7){if(!_0x3758b7)return null;_0x44726f[_0x9031('0x25')][_0x9031('0x61')]=_0x3758b7;return _0x44726f;})[_0x9031('0x30')](function(_0x50f787){if(_0x50f787){if(_0x1aa20b[_0x9031('0x55')][_0x9031('0x72')]){_0x44726f[_0x9031('0x25')]['interface']=util['format'](_0x9031('0x73'),_0x1aa20b[_0x9031('0x67')][_0x9031('0x33')]);_0x44726f[_0x9031('0x25')]['channel']=_0x44726f[_0x9031('0x74')];_0x44726f[_0x9031('0x25')][_0x9031('0x75')]=_0x44726f[_0x9031('0x74')];_0x44726f['message'][_0x9031('0x76')]=_0x9031('0x5a');return respondWithRpcPromise(_0x9031('0x77'),_0x9031('0x77'),{'event':_0x9031('0x78'),'message':_0x44726f[_0x9031('0x25')]},client9002)['then'](function(){return _0x44726f;});}return _0x44726f;}return null;})[_0x9031('0x30')](respondWithResult(_0x287b69,null))[_0x9031('0x26')](handleError(_0x287b69,null));};var interaction_log=require(_0x9031('0x13'))(_0x9031('0x59'));exports[_0x9031('0x79')]=function(_0x2cda95,_0x222240,_0x3ee072){var _0x40e499={'agent':{},'channel':_0x9031('0x5b')};if(_0x2cda95[_0x9031('0x55')]['id']){delete _0x2cda95[_0x9031('0x55')]['id'];}_0x2cda95[_0x9031('0x55')][_0x9031('0x60')]=_0x2cda95[_0x9031('0x55')][_0x9031('0x60')]||_0x2cda95[_0x9031('0x67')]['id'];_0x40e499['agent']['id']=_0x2cda95[_0x9031('0x55')][_0x9031('0x60')];return db['WhatsappMessage'][_0x9031('0x56')]({'where':{'id':_0x2cda95[_0x9031('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x222240,null))[_0x9031('0x30')](function(_0x2fd38d){if(_0x2fd38d){_0x40e499[_0x9031('0x25')]=_0x2fd38d[_0x9031('0x62')]({'plain':!![]});return db[_0x9031('0x63')]['find']({'where':{'id':_0x2fd38d['WhatsappInteractionId']}});}return null;})[_0x9031('0x30')](handleEntityNotFound(_0x222240,null))[_0x9031('0x30')](function(_0x33a819){if(_0x33a819){_0x40e499[_0x9031('0x7a')]=_0x33a819[_0x9031('0x62')]({'plain':!![]});interaction_log[_0x9031('0x1f')](_0x9031('0x7b'),_0x2cda95[_0x9031('0x67')]['id'],_0x2cda95['user'][_0x9031('0x33')],_0x2cda95[_0x9031('0x67')][_0x9031('0x68')],_0x40e499['interaction']['id'],_0x2cda95['body']?JSON[_0x9031('0x22')](_0x2cda95['body']):_0x9031('0x7c'));return respondWithRpcPromise('RejectMessage',_0x9031('0x7d'),_0x40e499);}return null;})[_0x9031('0x30')](function(_0x25e91c){var _0x5e99f9=_0x9031('0x6b')+_0x25e91c[_0x9031('0x25')]['ContactId'];return db[_0x9031('0x6c')]['query'](_0x5e99f9,{'type':db[_0x9031('0x7e')][_0x9031('0x7f')][_0x9031('0x6d')],'raw':!![]})['then'](function(_0x1dd88d){return _0x1dd88d;});})[_0x9031('0x30')](function(_0x3f3874){if(_0x3f3874){_0x40e499['message']['contact']=_0x3f3874[0x0];if(!_0x2cda95[_0x9031('0x55')]['UserId'])return;return db[_0x9031('0x80')][_0x9031('0x56')]({'where':{'id':_0x2cda95[_0x9031('0x55')]['UserId'],'role':'agent'},'attributes':['id',_0x9031('0x33'),'fullname',_0x9031('0x70'),_0x9031('0x71')],'raw':!![]});}return null;})[_0x9031('0x30')](function(_0x1ad1f2){if(!_0x1ad1f2)return null;_0x40e499[_0x9031('0x25')][_0x9031('0x61')]=_0x1ad1f2;return _0x40e499;})['then'](function(_0x364213){if(_0x364213){_0x364213[_0x9031('0x25')][_0x9031('0x81')]=util[_0x9031('0x5e')]('SIP/%s',_0x2cda95[_0x9031('0x67')][_0x9031('0x33')]);_0x364213[_0x9031('0x25')]['channel']=_0x40e499['channel'];_0x364213[_0x9031('0x25')][_0x9031('0x75')]=_0x40e499[_0x9031('0x74')];_0x364213[_0x9031('0x25')][_0x9031('0x76')]='reject';respondWithRpcPromise(_0x9031('0x77'),_0x9031('0x77'),{'event':_0x9031('0x82'),'message':_0x364213[_0x9031('0x25')]},client9002);return _0x40e499;}return null;})[_0x9031('0x30')](respondWithResult(_0x222240,null))['catch'](handleError(_0x222240,null));};exports[_0x9031('0x27')]=function(_0x3b68c5,_0x19a0c9,_0x508be4){if(_0x3b68c5['body']['id']){delete _0x3b68c5[_0x9031('0x55')]['id'];}var _0xa2af8c;return db[_0x9031('0x36')][_0x9031('0x56')]({'where':{'id':_0x3b68c5[_0x9031('0x53')]['id']}})[_0x9031('0x30')](handleEntityNotFound(_0x19a0c9,null))['then'](function(_0x81e902){if(_0x81e902){_0xa2af8c=_0x81e902;return db[_0x9031('0x83')]['find']({'where':{'id':_0x81e902[_0x9031('0x84')]}});}})['then'](handleEntityNotFound(_0x19a0c9,null))[_0x9031('0x30')](function(_0x37a7d5){if(_0x37a7d5){logger[_0x9031('0x85')](_0x9031('0x86'),_0x9031('0x27'),_0x9031('0x87'),_0x37a7d5['type'],util['inspect'](_0x3b68c5[_0x9031('0x55')],{'showHidden':![],'depth':null}));switch(_0x37a7d5[_0x9031('0x4b')]){case'twilio':if(_0x3b68c5[_0x9031('0x55')][_0x9031('0x88')]&&_0x3b68c5[_0x9031('0x55')]['MessageSid']===_0xa2af8c['messageId']&&_0x3b68c5[_0x9031('0x55')][_0x9031('0x89')]&&_0x3b68c5[_0x9031('0x55')][_0x9031('0x89')]==='read'){return _0xa2af8c[_0x9031('0x2f')]({'read':!![]});}else{logger[_0x9031('0x23')](_0x9031('0x8a'),_0x9031('0x27'),_0x9031('0x8b'),util[_0x9031('0x8c')](_0x3b68c5[_0x9031('0x55')],{'showHidden':![],'depth':null}));}break;}return _0xa2af8c;}})[_0x9031('0x30')](respondWithResult(_0x19a0c9,null))['catch'](handleError(_0x19a0c9,null));}; \ No newline at end of file +var _0x8183=['moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','WhatsappMessage','rawAttributes','fieldName','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','describe','whatsapp-interactions','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','whatsapp','RejectMessage','rejectMessage','Sequelize','internal','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','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','zip-dir','fast-json-patch'];(function(_0x221637,_0x42a5e0){var _0x11bf9e=function(_0xbc416e){while(--_0xbc416e){_0x221637['push'](_0x221637['shift']());}};_0x11bf9e(++_0x42a5e0);}(_0x8183,0x123));var _0x3818=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x8183[_0x2df507];return _0x1f7167;};'use strict';var emlformat=require(_0x3818('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3818('0x1'));var jsonpatch=require(_0x3818('0x2'));var rp=require('request-promise');var moment=require(_0x3818('0x3'));var BPromise=require(_0x3818('0x4'));var Mustache=require(_0x3818('0x5'));var util=require(_0x3818('0x6'));var path=require('path');var sox=require(_0x3818('0x7'));var csv=require(_0x3818('0x8'));var ejs=require(_0x3818('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3818('0xa'));var squel=require(_0x3818('0xb'));var crypto=require(_0x3818('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3818('0xd'));var toCsv=require(_0x3818('0x8'));var querystring=require(_0x3818('0xe'));var Papa=require(_0x3818('0xf'));var Redis=require(_0x3818('0x10'));var authService=require(_0x3818('0x11'));var qs=require(_0x3818('0x12'));var as=require(_0x3818('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3818('0x14'))(_0x3818('0x15'));var utils=require(_0x3818('0x16'));var config=require(_0x3818('0x17'));var licenseUtil=require(_0x3818('0x18'));var db=require(_0x3818('0x19'))['db'];config[_0x3818('0x1a')]=_[_0x3818('0x1b')](config['redis'],{'host':_0x3818('0x1c'),'port':0x18eb});var socket=require(_0x3818('0x1d'))(new Redis(config[_0x3818('0x1a')]));require('./whatsappMessage.socket')[_0x3818('0x1e')](socket);var jayson=require(_0x3818('0x1f'));var client=jayson[_0x3818('0x20')][_0x3818('0x21')]({'port':0x232c});var client9002=jayson[_0x3818('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20879c,_0x4ccd8a,_0x46d5d4,_0x3a6143){return new BPromise(function(_0x4aa99f,_0x24d0e2){var _0x4f5fd0=_0x3a6143||client;return _0x4f5fd0['request'](_0x20879c,_0x46d5d4)[_0x3818('0x22')](function(_0x406f51){logger['info'](_0x3818('0x23'),_0x4ccd8a,_0x3818('0x24'));logger['debug'](_0x3818('0x25'),_0x4ccd8a,'request\x20sent',JSON['stringify'](_0x406f51));if(_0x406f51[_0x3818('0x26')]){if(_0x406f51['error'][_0x3818('0x27')]===0x1f4){logger[_0x3818('0x26')](_0x3818('0x23'),_0x4ccd8a,_0x406f51['error'][_0x3818('0x28')]);return _0x24d0e2(_0x406f51[_0x3818('0x26')][_0x3818('0x28')]);}logger[_0x3818('0x26')](_0x3818('0x23'),_0x4ccd8a,_0x406f51['error'][_0x3818('0x28')]);return _0x4aa99f(_0x406f51[_0x3818('0x26')]['message']);}else{logger[_0x3818('0x29')](_0x3818('0x23'),_0x4ccd8a,_0x3818('0x24'));_0x4aa99f(_0x406f51['result'][_0x3818('0x28')]);}})['catch'](function(_0x1444cc){logger[_0x3818('0x26')](_0x3818('0x23'),_0x4ccd8a,_0x1444cc);_0x24d0e2(_0x1444cc);});});}function respondWithStatusCode(_0x364cf2,_0x5d84a8){_0x5d84a8=_0x5d84a8||0xcc;return function(_0x695d0d){if(_0x695d0d){return _0x364cf2[_0x3818('0x2a')](_0x5d84a8);}return _0x364cf2[_0x3818('0x2b')](_0x5d84a8)['end']();};}function respondWithResult(_0x46dfab,_0x389b13){_0x389b13=_0x389b13||0xc8;return function(_0x56ebdb){if(_0x56ebdb){return _0x46dfab[_0x3818('0x2b')](_0x389b13)[_0x3818('0x2c')](_0x56ebdb);}};}function respondWithFilteredResult(_0x49f75c,_0x33d8c6){return function(_0x1fd1a6){if(_0x1fd1a6){var _0x53b5d2=typeof _0x33d8c6[_0x3818('0x2d')]==='undefined'&&typeof _0x33d8c6['limit']===_0x3818('0x2e');var _0x413075=_0x1fd1a6[_0x3818('0x2f')];var _0x59641f=_0x53b5d2?0x0:_0x33d8c6['offset'];var _0xcdf813=_0x53b5d2?_0x1fd1a6[_0x3818('0x2f')]:_0x33d8c6[_0x3818('0x2d')]+_0x33d8c6[_0x3818('0x30')];var _0x4447b0;if(_0xcdf813>=_0x413075){_0xcdf813=_0x413075;_0x4447b0=0xc8;}else{_0x4447b0=0xce;}_0x49f75c[_0x3818('0x2b')](_0x4447b0);return _0x49f75c[_0x3818('0x31')](_0x3818('0x32'),_0x59641f+'-'+_0xcdf813+'/'+_0x413075)[_0x3818('0x2c')](_0x1fd1a6);}return null;};}function patchUpdates(_0x5353b9){return function(_0x10a8fa){try{jsonpatch[_0x3818('0x33')](_0x10a8fa,_0x5353b9,!![]);}catch(_0x1dfcb0){return BPromise[_0x3818('0x34')](_0x1dfcb0);}return _0x10a8fa[_0x3818('0x35')]();};}function saveUpdates(_0x22cb01,_0x479223){return function(_0x53fedb){if(_0x53fedb){return _0x53fedb[_0x3818('0x36')](_0x22cb01)[_0x3818('0x22')](function(_0x197064){return _0x197064;});}return null;};}function removeEntity(_0x29b521,_0x1981fd){return function(_0x19e7d5){if(_0x19e7d5){return _0x19e7d5[_0x3818('0x37')]()[_0x3818('0x22')](function(){_0x29b521[_0x3818('0x2b')](0xcc)[_0x3818('0x38')]();});}};}function handleEntityNotFound(_0x5e1209,_0x27e53e){return function(_0x107357){if(!_0x107357){_0x5e1209[_0x3818('0x2a')](0x194);}return _0x107357;};}function handleError(_0x336649,_0xd13fd0){_0xd13fd0=_0xd13fd0||0x1f4;return function(_0xa99e18){logger[_0x3818('0x26')](_0xa99e18[_0x3818('0x39')]);if(_0xa99e18[_0x3818('0x3a')]){delete _0xa99e18[_0x3818('0x3a')];}_0x336649[_0x3818('0x2b')](_0xd13fd0)[_0x3818('0x3b')](_0xa99e18);};}exports[_0x3818('0x3c')]=function(_0x3ee523,_0x55ea29){var _0x2bd957={},_0x4e594f={},_0x1a0ae9={'count':0x0,'rows':[]};var _0x2c98a8=_['map'](db[_0x3818('0x3d')][_0x3818('0x3e')],function(_0x32895f){return{'name':_0x32895f[_0x3818('0x3f')],'type':_0x32895f['type'][_0x3818('0x40')]};});_0x4e594f[_0x3818('0x41')]=_[_0x3818('0x42')](_0x2c98a8,_0x3818('0x3a'));_0x4e594f[_0x3818('0x43')]=_['keys'](_0x3ee523[_0x3818('0x43')]);_0x4e594f[_0x3818('0x44')]=_['intersection'](_0x4e594f['model'],_0x4e594f['query']);_0x2bd957[_0x3818('0x45')]=_[_0x3818('0x46')](_0x4e594f[_0x3818('0x41')],qs[_0x3818('0x47')](_0x3ee523[_0x3818('0x43')][_0x3818('0x47')]));_0x2bd957[_0x3818('0x45')]=_0x2bd957[_0x3818('0x45')]['length']?_0x2bd957['attributes']:_0x4e594f[_0x3818('0x41')];if(!_0x3ee523[_0x3818('0x43')][_0x3818('0x48')](_0x3818('0x49'))){_0x2bd957[_0x3818('0x30')]=qs[_0x3818('0x30')](_0x3ee523['query'][_0x3818('0x30')]);_0x2bd957[_0x3818('0x2d')]=qs[_0x3818('0x2d')](_0x3ee523[_0x3818('0x43')][_0x3818('0x2d')]);}_0x2bd957[_0x3818('0x4a')]=qs[_0x3818('0x4b')](_0x3ee523[_0x3818('0x43')][_0x3818('0x4b')]);_0x2bd957[_0x3818('0x4c')]=qs['filters'](_[_0x3818('0x4d')](_0x3ee523['query'],_0x4e594f['filters']),_0x2c98a8);if(_0x3ee523[_0x3818('0x43')][_0x3818('0x4e')]){_0x2bd957[_0x3818('0x4c')]=_[_0x3818('0x4f')](_0x2bd957[_0x3818('0x4c')],{'$or':_[_0x3818('0x42')](_0x2c98a8,function(_0x3a8b44){if(_0x3a8b44[_0x3818('0x50')]!==_0x3818('0x51')){var _0x4fda01={};_0x4fda01[_0x3a8b44['name']]={'$like':'%'+_0x3ee523[_0x3818('0x43')][_0x3818('0x4e')]+'%'};return _0x4fda01;}})});}_0x2bd957=_[_0x3818('0x4f')]({},_0x2bd957,_0x3ee523['options']);var _0x184052={'where':_0x2bd957[_0x3818('0x4c')]};return db[_0x3818('0x3d')][_0x3818('0x2f')](_0x184052)[_0x3818('0x22')](function(_0x5bf590){_0x1a0ae9[_0x3818('0x2f')]=_0x5bf590;if(_0x3ee523[_0x3818('0x43')][_0x3818('0x52')]){_0x2bd957[_0x3818('0x53')]=[{'all':!![]}];}return db[_0x3818('0x3d')][_0x3818('0x54')](_0x2bd957);})[_0x3818('0x22')](function(_0x2f23fc){_0x1a0ae9[_0x3818('0x55')]=_0x2f23fc;return _0x1a0ae9;})[_0x3818('0x22')](respondWithFilteredResult(_0x55ea29,_0x2bd957))[_0x3818('0x56')](handleError(_0x55ea29,null));};exports[_0x3818('0x57')]=function(_0x21f86b,_0x2a42ed){var _0x44d2f9={'raw':!![],'where':{'id':_0x21f86b[_0x3818('0x58')]['id']}},_0x2768e4={};_0x2768e4['model']=_['keys'](db[_0x3818('0x3d')][_0x3818('0x3e')]);_0x2768e4[_0x3818('0x43')]=_[_0x3818('0x59')](_0x21f86b[_0x3818('0x43')]);_0x2768e4[_0x3818('0x44')]=_['intersection'](_0x2768e4['model'],_0x2768e4[_0x3818('0x43')]);_0x44d2f9[_0x3818('0x45')]=_[_0x3818('0x46')](_0x2768e4[_0x3818('0x41')],qs['fields'](_0x21f86b[_0x3818('0x43')][_0x3818('0x47')]));_0x44d2f9[_0x3818('0x45')]=_0x44d2f9[_0x3818('0x45')]['length']?_0x44d2f9[_0x3818('0x45')]:_0x2768e4[_0x3818('0x41')];if(_0x21f86b[_0x3818('0x43')][_0x3818('0x52')]){_0x44d2f9[_0x3818('0x53')]=[{'all':!![]}];}_0x44d2f9=_[_0x3818('0x4f')]({},_0x44d2f9,_0x21f86b['options']);return db[_0x3818('0x3d')]['find'](_0x44d2f9)[_0x3818('0x22')](handleEntityNotFound(_0x2a42ed,null))['then'](respondWithResult(_0x2a42ed,null))[_0x3818('0x56')](handleError(_0x2a42ed,null));};exports[_0x3818('0x5a')]=function(_0x38ceee,_0x376428){return db['WhatsappMessage'][_0x3818('0x5a')](_0x38ceee[_0x3818('0x5b')],{})[_0x3818('0x22')](respondWithResult(_0x376428,0xc9))['catch'](handleError(_0x376428,null));};exports[_0x3818('0x36')]=function(_0x568227,_0x4d6399){if(_0x568227['body']['id']){delete _0x568227[_0x3818('0x5b')]['id'];}return db[_0x3818('0x3d')]['find']({'where':{'id':_0x568227[_0x3818('0x58')]['id']}})['then'](handleEntityNotFound(_0x4d6399,null))[_0x3818('0x22')](saveUpdates(_0x568227['body'],null))[_0x3818('0x22')](respondWithResult(_0x4d6399,null))[_0x3818('0x56')](handleError(_0x4d6399,null));};exports['destroy']=function(_0xee092b,_0x455655){return db[_0x3818('0x3d')][_0x3818('0x5c')]({'where':{'id':_0xee092b['params']['id']}})[_0x3818('0x22')](handleEntityNotFound(_0x455655,null))[_0x3818('0x22')](removeEntity(_0x455655,null))[_0x3818('0x56')](handleError(_0x455655,null));};exports[_0x3818('0x5d')]=function(_0x298ead,_0x131e7e){return db['WhatsappMessage'][_0x3818('0x5d')]()['then'](respondWithResult(_0x131e7e,null))['catch'](handleError(_0x131e7e,null));};var interaction_log=require('../../config/logger')(_0x3818('0x5e'));exports['accept']=function(_0x2644df,_0x9b3ac3,_0x48bc66){var _0x176119={'agent':{},'channel':'whatsapp'};if(_0x2644df[_0x3818('0x5b')]['id']){delete _0x2644df[_0x3818('0x5b')]['id'];}_0x2644df[_0x3818('0x5b')][_0x3818('0x5f')]=!![];_0x2644df[_0x3818('0x5b')][_0x3818('0x60')]=moment()['format'](_0x3818('0x61'));_0x2644df[_0x3818('0x5b')][_0x3818('0x62')]=_0x2644df[_0x3818('0x5b')][_0x3818('0x62')]||_0x2644df[_0x3818('0x63')]['id'];_0x176119[_0x3818('0x64')]['id']=_0x2644df[_0x3818('0x5b')]['UserId'];return db[_0x3818('0x3d')][_0x3818('0x5c')]({'where':{'id':_0x2644df[_0x3818('0x58')]['id'],'UserId':null}})[_0x3818('0x22')](handleEntityNotFound(_0x9b3ac3,null))[_0x3818('0x22')](saveUpdates(_0x2644df[_0x3818('0x5b')],null))['then'](function(_0x783155){if(_0x783155){_0x176119[_0x3818('0x28')]=_0x783155['get']({'plain':!![]});return db[_0x3818('0x65')]['find']({'where':{'id':_0x783155[_0x3818('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x9b3ac3,null))['then'](function(_0xe179bd){if(_0xe179bd){return _0xe179bd['update']({'UserId':_0x2644df[_0x3818('0x5b')][_0x3818('0x62')],'read1stAt':_[_0x3818('0x67')](_0xe179bd[_0x3818('0x68')])?moment()[_0x3818('0x69')](_0x3818('0x61')):undefined});}return null;})['then'](function(_0x3e8cb9){if(_0x3e8cb9){_0x176119[_0x3818('0x6a')]=_0x3e8cb9[_0x3818('0x6b')]({'plain':!![]});interaction_log[_0x3818('0x29')](_0x3818('0x6c'),_0x2644df['user']['id'],_0x2644df[_0x3818('0x63')][_0x3818('0x3a')],_0x2644df[_0x3818('0x63')][_0x3818('0x6d')],_0x176119[_0x3818('0x6a')]['id'],_0x2644df[_0x3818('0x5b')]?JSON[_0x3818('0x6e')](_0x2644df[_0x3818('0x5b')]):_0x3818('0x6f'));return respondWithRpcPromise('AcceptMessage',_0x3818('0x70'),_0x176119);}return null;})[_0x3818('0x22')](function(_0x139c93){var _0x43d64a=_0x3818('0x71')+_0x139c93['message'][_0x3818('0x72')];return db[_0x3818('0x73')]['query'](_0x43d64a,{'type':db['Sequelize']['QueryTypes'][_0x3818('0x74')],'raw':!![]})['then'](function(_0x441b75){return _0x441b75;});})[_0x3818('0x22')](function(_0xed36c){if(_0xed36c){_0x176119[_0x3818('0x28')][_0x3818('0x75')]=_0xed36c[0x0];if(!_0x2644df[_0x3818('0x5b')][_0x3818('0x62')])return;return db[_0x3818('0x76')][_0x3818('0x5c')]({'where':{'id':_0x2644df[_0x3818('0x5b')][_0x3818('0x62')],'role':_0x3818('0x64')},'attributes':['id',_0x3818('0x3a'),_0x3818('0x77'),_0x3818('0x78'),'internal'],'raw':!![]});}return null;})[_0x3818('0x22')](function(_0x1ca595){if(!_0x1ca595)return null;_0x176119[_0x3818('0x28')][_0x3818('0x64')]=_0x1ca595;return _0x176119;})['then'](function(_0x1c0adc){if(_0x1c0adc){if(_0x2644df['body'][_0x3818('0x79')]){_0x176119[_0x3818('0x28')][_0x3818('0x7a')]=util[_0x3818('0x69')](_0x3818('0x7b'),_0x2644df['user'][_0x3818('0x3a')]);_0x176119[_0x3818('0x28')]['channel']=_0x176119[_0x3818('0x7c')];_0x176119[_0x3818('0x28')][_0x3818('0x7d')]=_0x176119['channel'];_0x176119[_0x3818('0x28')][_0x3818('0x7e')]=_0x3818('0x7f');return respondWithRpcPromise(_0x3818('0x80'),_0x3818('0x80'),{'event':_0x3818('0x81'),'message':_0x176119[_0x3818('0x28')]},client9002)[_0x3818('0x22')](function(){return _0x176119;});}return _0x176119;}return null;})[_0x3818('0x22')](respondWithResult(_0x9b3ac3,null))['catch'](handleError(_0x9b3ac3,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0x3818('0x34')]=function(_0x76a417,_0x34a6c6,_0x21fdb4){var _0x5b1496={'agent':{},'channel':_0x3818('0x82')};if(_0x76a417[_0x3818('0x5b')]['id']){delete _0x76a417['body']['id'];}_0x76a417[_0x3818('0x5b')][_0x3818('0x62')]=_0x76a417['body']['UserId']||_0x76a417[_0x3818('0x63')]['id'];_0x5b1496[_0x3818('0x64')]['id']=_0x76a417[_0x3818('0x5b')][_0x3818('0x62')];return db[_0x3818('0x3d')][_0x3818('0x5c')]({'where':{'id':_0x76a417['params']['id'],'UserId':null}})[_0x3818('0x22')](handleEntityNotFound(_0x34a6c6,null))[_0x3818('0x22')](function(_0x2da4e3){if(_0x2da4e3){_0x5b1496[_0x3818('0x28')]=_0x2da4e3['get']({'plain':!![]});return db[_0x3818('0x65')][_0x3818('0x5c')]({'where':{'id':_0x2da4e3['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x34a6c6,null))['then'](function(_0x444319){if(_0x444319){_0x5b1496[_0x3818('0x6a')]=_0x444319[_0x3818('0x6b')]({'plain':!![]});interaction_log[_0x3818('0x29')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x76a417[_0x3818('0x63')]['id'],_0x76a417[_0x3818('0x63')][_0x3818('0x3a')],_0x76a417[_0x3818('0x63')][_0x3818('0x6d')],_0x5b1496[_0x3818('0x6a')]['id'],_0x76a417[_0x3818('0x5b')]?JSON['stringify'](_0x76a417[_0x3818('0x5b')]):'null');return respondWithRpcPromise(_0x3818('0x83'),_0x3818('0x84'),_0x5b1496);}return null;})[_0x3818('0x22')](function(_0x1a57e5){var _0x512582=_0x3818('0x71')+_0x1a57e5['message'][_0x3818('0x72')];return db[_0x3818('0x73')][_0x3818('0x43')](_0x512582,{'type':db[_0x3818('0x85')]['QueryTypes'][_0x3818('0x74')],'raw':!![]})[_0x3818('0x22')](function(_0x3a39c1){return _0x3a39c1;});})['then'](function(_0xaaf890){if(_0xaaf890){_0x5b1496['message'][_0x3818('0x75')]=_0xaaf890[0x0];if(!_0x76a417[_0x3818('0x5b')][_0x3818('0x62')])return;return db[_0x3818('0x76')][_0x3818('0x5c')]({'where':{'id':_0x76a417[_0x3818('0x5b')][_0x3818('0x62')],'role':_0x3818('0x64')},'attributes':['id',_0x3818('0x3a'),_0x3818('0x77'),_0x3818('0x78'),_0x3818('0x86')],'raw':!![]});}return null;})[_0x3818('0x22')](function(_0x2eb382){if(!_0x2eb382)return null;_0x5b1496['message']['agent']=_0x2eb382;return _0x5b1496;})[_0x3818('0x22')](function(_0x220c3d){if(_0x220c3d){_0x220c3d[_0x3818('0x28')][_0x3818('0x7a')]=util['format'](_0x3818('0x7b'),_0x76a417['user'][_0x3818('0x3a')]);_0x220c3d[_0x3818('0x28')]['channel']=_0x5b1496['channel'];_0x220c3d[_0x3818('0x28')][_0x3818('0x7d')]=_0x5b1496[_0x3818('0x7c')];_0x220c3d['message']['event']=_0x3818('0x34');respondWithRpcPromise(_0x3818('0x80'),_0x3818('0x80'),{'event':_0x3818('0x87'),'message':_0x220c3d[_0x3818('0x28')]},client9002);return _0x5b1496;}return null;})[_0x3818('0x22')](respondWithResult(_0x34a6c6,null))['catch'](handleError(_0x34a6c6,null));};exports[_0x3818('0x2b')]=function(_0x10baa4,_0x41653d,_0x32a0e9){if(_0x10baa4[_0x3818('0x5b')]['id']){delete _0x10baa4[_0x3818('0x5b')]['id'];}var _0x55bfce;return db[_0x3818('0x3d')][_0x3818('0x5c')]({'where':{'id':_0x10baa4[_0x3818('0x58')]['id']}})[_0x3818('0x22')](handleEntityNotFound(_0x41653d,null))[_0x3818('0x22')](function(_0x41135e){if(_0x41135e){_0x55bfce=_0x41135e;return db[_0x3818('0x88')][_0x3818('0x5c')]({'where':{'id':_0x41135e[_0x3818('0x89')]}});}})[_0x3818('0x22')](handleEntityNotFound(_0x41653d,null))[_0x3818('0x22')](function(_0x9f203b){if(_0x9f203b){logger[_0x3818('0x8a')](_0x3818('0x8b'),'status',_0x3818('0x8c'),_0x9f203b['type'],util[_0x3818('0x8d')](_0x10baa4[_0x3818('0x5b')],{'showHidden':![],'depth':null}));switch(_0x9f203b['type']){case _0x3818('0x8e'):if(_0x10baa4[_0x3818('0x5b')][_0x3818('0x8f')]&&_0x10baa4['body']['MessageSid']===_0x55bfce[_0x3818('0x90')]&&_0x10baa4['body'][_0x3818('0x91')]&&_0x10baa4['body']['MessageStatus']===_0x3818('0x5f')){return _0x55bfce[_0x3818('0x36')]({'read':!![]});}else{logger[_0x3818('0x26')](_0x3818('0x92'),_0x3818('0x2b'),_0x3818('0x8e'),util[_0x3818('0x8d')](_0x10baa4[_0x3818('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x55bfce;}})[_0x3818('0x22')](respondWithResult(_0x41653d,null))[_0x3818('0x56')](handleError(_0x41653d,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index d5433ac..2350ad2 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 _0x94d2=['setMaxListeners','save','update','remove','emit','hasOwnProperty','WhatsappMessage'];(function(_0x15b148,_0x240ad4){var _0x220922=function(_0x1f0e4b){while(--_0x1f0e4b){_0x15b148['push'](_0x15b148['shift']());}};_0x220922(++_0x240ad4);}(_0x94d2,0x1cd));var _0x294d=function(_0x507ac5,_0x33aaee){_0x507ac5=_0x507ac5-0x0;var _0x12c1bc=_0x94d2[_0x507ac5];return _0x12c1bc;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db'][_0x294d('0x0')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x294d('0x1')](0x0);var events={'afterCreate':_0x294d('0x2'),'afterUpdate':_0x294d('0x3'),'afterDestroy':_0x294d('0x4')};function emitEvent(_0x5c1993){return function(_0x541332,_0x2f2fc8,_0x393430){WhatsappMessageEvents[_0x294d('0x5')](_0x5c1993+':'+_0x541332['id'],_0x541332);WhatsappMessageEvents[_0x294d('0x5')](_0x5c1993,_0x541332);_0x393430(null);};}for(var e in events){if(events[_0x294d('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x4af8=['emit','hasOwnProperty','exports','save','update','remove'];(function(_0x3a6830,_0x324721){var _0x380957=function(_0x3201bd){while(--_0x3201bd){_0x3a6830['push'](_0x3a6830['shift']());}};_0x380957(++_0x324721);}(_0x4af8,0x1ad));var _0x84af=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x4af8[_0x279d37];return _0x530173;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x84af('0x0'),'afterUpdate':_0x84af('0x1'),'afterDestroy':_0x84af('0x2')};function emitEvent(_0x1446d3){return function(_0x482825,_0x294e04,_0x83633){WhatsappMessageEvents['emit'](_0x1446d3+':'+_0x482825['id'],_0x482825);WhatsappMessageEvents[_0x84af('0x3')](_0x1446d3,_0x482825);_0x83633(null);};}for(var e in events){if(events[_0x84af('0x4')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x84af('0x5')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 2aa151f..1272cae 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 _0x7fbb=['util','../../config/logger','moment','bluebird','node-fetch','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','POST','application/json','statuses','message_id','err','finally','lodash'];(function(_0x513b27,_0x597d57){var _0x33e282=function(_0x460e1d){while(--_0x460e1d){_0x513b27['push'](_0x513b27['shift']());}};_0x33e282(++_0x597d57);}(_0x7fbb,0xe7));var _0xb7fb=function(_0x16bcf0,_0x3a8393){_0x16bcf0=_0x16bcf0-0x0;var _0x343264=_0x7fbb[_0x16bcf0];return _0x343264;};'use strict';var _=require(_0xb7fb('0x0'));var util=require(_0xb7fb('0x1'));var logger=require(_0xb7fb('0x2'))('api');var moment=require(_0xb7fb('0x3'));var BPromise=require(_0xb7fb('0x4'));var rp=require('request-promise');var fetch=require(_0xb7fb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb7fb('0x6'));var config=require(_0xb7fb('0x7'));var attributes=require(_0xb7fb('0x8'));module[_0xb7fb('0x9')]=function(_0x528d8d,_0x15430b){return _0x528d8d[_0xb7fb('0xa')](_0xb7fb('0xb'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xb7fb('0xc'),'fields':[_0xb7fb('0xc')]},{'name':_0xb7fb('0xd'),'fields':[_0xb7fb('0xe')],'type':_0xb7fb('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x272ba3,_0x22ec33,_0x1d257e){var _0x51a752=_0x528d8d[_0xb7fb('0x10')];var _0x18df18=_0x272ba3[_0xb7fb('0x11')]({'plain':!![]});if(_0x18df18[_0xb7fb('0x12')][_0xb7fb('0x13')]()==='in'||_0x18df18[_0xb7fb('0x12')][_0xb7fb('0x13')]()===_0xb7fb('0x14')&&!_0x18df18[_0xb7fb('0x15')]&&!_[_0xb7fb('0x16')](_0x18df18[_0xb7fb('0x17')])){_0x51a752['WhatsappInteraction'][_0xb7fb('0x18')]({'where':{'id':_0x18df18[_0xb7fb('0x19')]}})[_0xb7fb('0x1a')](function(_0x3b8c3b){if(_0x3b8c3b){_0x3b8c3b[_0xb7fb('0x1b')]({'lastMsgAt':_0x18df18[_0xb7fb('0x1c')],'lastMsgDirection':_0x18df18[_0xb7fb('0x12')][_0xb7fb('0x13')]()});}})[_0xb7fb('0x1d')](function(_0x3c9302){console[_0xb7fb('0x1e')](_0x3c9302);});}if(_0x18df18[_0xb7fb('0x12')]===_0xb7fb('0x14')&&!_0x18df18[_0xb7fb('0x15')]){var _0x2f9428;_0x51a752[_0xb7fb('0x1f')][_0xb7fb('0x20')]({'where':{'id':_0x18df18[_0xb7fb('0x21')]},'raw':!![]})['then'](function(_0x138099){_0x2f9428=_0x138099;if(_0x2f9428&&_0x2f9428['type']){switch(_0x2f9428[_0xb7fb('0x22')]){case'twilio':var _0x1c0dce=require(_0xb7fb('0x23'));if(_0x2f9428[_0xb7fb('0x24')]&&_0x2f9428[_0xb7fb('0x25')]&&_0x2f9428[_0xb7fb('0x26')]){var _0x198d5e=new _0x1c0dce(_0x2f9428['accountSid'],_0x2f9428[_0xb7fb('0x25')]);_0x198d5e[_0xb7fb('0x27')][_0xb7fb('0x28')]({'body':_0x18df18['body'],'to':_0xb7fb('0x29')+_0x18df18[_0xb7fb('0x26')],'from':_0xb7fb('0x29')+_0x2f9428[_0xb7fb('0x26')],'statusCallback':_0x2f9428[_0xb7fb('0x2a')]+'/api/whatsapp/messages/'+_0x18df18['id']+_0xb7fb('0x2b')+_0x2f9428[_0xb7fb('0x2c')]})['then'](function(_0xb39f51){if(_0xb39f51['sid']){return _0x272ba3[_0xb7fb('0x1b')]({'messageId':_0xb39f51[_0xb7fb('0x2d')]});}})[_0xb7fb('0x1d')](function(_0x252436){logger[_0xb7fb('0x1e')](_0xb7fb('0x2e'),_0xb7fb('0x2f'),'twilio',util[_0xb7fb('0x30')](_0x252436,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xb7fb('0x2f'),'twilio',_0xb7fb('0x31'));}break;case _0xb7fb('0x32'):var _0x3b63dc=_0x2f9428['accountSid'];var _0x4a722d=_0x2f9428['authToken'];var _0x5baf66=_0x2f9428[_0xb7fb('0x33')]+'/whatsapp/v1/'+_0x3b63dc+'/messages/';var _0xaadcea={'to':[_0x18df18[_0xb7fb('0x26')]],'message':{'type':'text','text':_0x18df18['body']}};var _0x6fb165={'method':_0xb7fb('0x34'),'uri':_0x5baf66,'headers':{'Authorization':'Bearer\x20'+_0x4a722d,'Content-Type':_0xb7fb('0x35')},'body':_0xaadcea,'json':!![]};rp(_0x6fb165)[_0xb7fb('0x1a')](function(_0x527352){if(_0x527352[_0xb7fb('0x36')][0x0][_0xb7fb('0x37')]){return _0x272ba3['update']({'messageId':_0x527352[_0xb7fb('0x36')][0x0][_0xb7fb('0x37')]});}})[_0xb7fb('0x1d')](function(_0x4d1bf7){logger[_0xb7fb('0x38')]('WhatsappMessage,\x20%s',_0x4d1bf7);});break;}}})[_0xb7fb('0x39')](function(){_0x1d257e();});}else{_0x1d257e();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x064e=['models','toLowerCase','direction','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','error','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch','../../config/environment','./whatsappMessage.attributes','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT'];(function(_0x4c4fe3,_0x5d6769){var _0x321a0d=function(_0x2d5c98){while(--_0x2d5c98){_0x4c4fe3['push'](_0x4c4fe3['shift']());}};_0x321a0d(++_0x5d6769);}(_0x064e,0xaa));var _0xe064=function(_0x55db5d,_0x54ca64){_0x55db5d=_0x55db5d-0x0;var _0x52839e=_0x064e[_0x55db5d];return _0x52839e;};'use strict';var _=require(_0xe064('0x0'));var util=require(_0xe064('0x1'));var logger=require(_0xe064('0x2'))(_0xe064('0x3'));var moment=require(_0xe064('0x4'));var BPromise=require(_0xe064('0x5'));var rp=require(_0xe064('0x6'));var fetch=require(_0xe064('0x7'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe064('0x8'));var attributes=require(_0xe064('0x9'));module['exports']=function(_0x378e83,_0xa0f1e1){return _0x378e83['define'](_0xe064('0xa'),attributes,{'tableName':_0xe064('0xb'),'paranoid':![],'indexes':[{'name':_0xe064('0xc'),'fields':[_0xe064('0xc')]},{'name':_0xe064('0xd'),'fields':[_0xe064('0xe')],'type':_0xe064('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4afeb2,_0x38ef00,_0x2fba1f){var _0xccd8b7=_0x378e83[_0xe064('0x10')];var _0x8271cd=_0x4afeb2['get']({'plain':!![]});if(_0x8271cd['direction'][_0xe064('0x11')]()==='in'||_0x8271cd[_0xe064('0x12')][_0xe064('0x11')]()===_0xe064('0x13')&&!_0x8271cd[_0xe064('0x14')]&&!_[_0xe064('0x15')](_0x8271cd[_0xe064('0x16')])){_0xccd8b7[_0xe064('0x17')][_0xe064('0x18')]({'where':{'id':_0x8271cd[_0xe064('0x19')]}})[_0xe064('0x1a')](function(_0x390b55){if(_0x390b55){_0x390b55[_0xe064('0x1b')]({'lastMsgAt':_0x8271cd[_0xe064('0x1c')],'lastMsgDirection':_0x8271cd['direction'][_0xe064('0x11')]()});}})['catch'](function(_0x3dca65){console['error'](_0x3dca65);});}if(_0x8271cd[_0xe064('0x12')]===_0xe064('0x13')&&!_0x8271cd['secret']){var _0x2d1697;_0xccd8b7[_0xe064('0x1d')][_0xe064('0x1e')]({'where':{'id':_0x8271cd[_0xe064('0x1f')]},'raw':!![]})[_0xe064('0x1a')](function(_0x29d2f2){_0x2d1697=_0x29d2f2;if(_0x2d1697&&_0x2d1697['type']){switch(_0x2d1697[_0xe064('0x20')]){case'twilio':var _0xd5de23=require(_0xe064('0x21'));if(_0x2d1697[_0xe064('0x22')]&&_0x2d1697[_0xe064('0x23')]&&_0x2d1697[_0xe064('0x24')]){var _0x50e93f=new _0xd5de23(_0x2d1697[_0xe064('0x22')],_0x2d1697[_0xe064('0x23')]);_0x50e93f[_0xe064('0x25')]['create']({'body':_0x8271cd['body'],'to':'whatsapp:'+_0x8271cd[_0xe064('0x24')],'from':_0xe064('0x26')+_0x2d1697[_0xe064('0x24')],'statusCallback':_0x2d1697[_0xe064('0x27')]+_0xe064('0x28')+_0x8271cd['id']+_0xe064('0x29')+_0x2d1697['token']})[_0xe064('0x1a')](function(_0x34a356){if(_0x34a356['sid']){return _0x4afeb2[_0xe064('0x1b')]({'messageId':_0x34a356['sid']});}})[_0xe064('0x2a')](function(_0x290ba1){logger['error'](_0xe064('0x2b'),_0xe064('0x2c'),_0xe064('0x21'),util[_0xe064('0x2d')](_0x290ba1,{'showHidden':![],'depth':null}));});}else{logger[_0xe064('0x2e')](_0xe064('0x2b'),_0xe064('0x2c'),_0xe064('0x21'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xe064('0x2f'):var _0x2d75d5=_0x2d1697[_0xe064('0x22')];var _0x118715=_0x2d1697[_0xe064('0x23')];var _0x149dc4=_0x2d1697[_0xe064('0x30')]+_0xe064('0x31')+_0x2d75d5+_0xe064('0x32');var _0x3812a7={'to':[_0x8271cd[_0xe064('0x24')]],'message':{'type':_0xe064('0x33'),'text':_0x8271cd[_0xe064('0xe')]}};var _0x2dc757={'method':_0xe064('0x34'),'uri':_0x149dc4,'headers':{'Authorization':_0xe064('0x35')+_0x118715,'Content-Type':_0xe064('0x36')},'body':_0x3812a7,'json':!![]};rp(_0x2dc757)[_0xe064('0x1a')](function(_0x179d37){if(_0x179d37[_0xe064('0x37')][0x0]['message_id']){return _0x4afeb2['update']({'messageId':_0x179d37[_0xe064('0x37')][0x0][_0xe064('0x38')]});}})[_0xe064('0x2a')](function(_0x2693ec){logger[_0xe064('0x39')](_0xe064('0x3a'),_0x2693ec);});break;}}})[_0xe064('0x3b')](function(){_0x2fba1f();});}else{_0x2fba1f();}}},'charset':_0xe064('0x3c'),'collate':_0xe064('0x3d')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index b85cb23..5587e4a 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 _0x5295=['rpc','../../config/environment','jayson/promise','defaults','redis','socket.io-emitter','register','request','then','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','info','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x4cb16f,_0x401628){var _0x42705a=function(_0x175ae7){while(--_0x175ae7){_0x4cb16f['push'](_0x4cb16f['shift']());}};_0x42705a(++_0x401628);}(_0x5295,0x1e9));var _0x5529=function(_0x452931,_0x3e242b){_0x452931=_0x452931-0x0;var _0x1a143e=_0x5295[_0x452931];return _0x1a143e;};'use strict';var _=require(_0x5529('0x0'));var util=require(_0x5529('0x1'));var moment=require(_0x5529('0x2'));var BPromise=require(_0x5529('0x3'));var rs=require(_0x5529('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5529('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5529('0x6'))(_0x5529('0x7'));var config=require(_0x5529('0x8'));var jayson=require(_0x5529('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x5529('0xa')](config[_0x5529('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5529('0xc'))(new Redis(config[_0x5529('0xb')]));require('./whatsappMessage.socket')[_0x5529('0xd')](socket);function respondWithRpcPromise(_0x28f51b,_0x128728,_0x3050f0){return new BPromise(function(_0x575b90,_0x11e579){return client[_0x5529('0xe')](_0x28f51b,_0x3050f0)[_0x5529('0xf')](function(_0x49d00b){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x128728,_0x5529('0x10'));logger[_0x5529('0x11')](_0x5529('0x12'),_0x128728,_0x5529('0x10'),JSON[_0x5529('0x13')](_0x49d00b));if(_0x49d00b['error']){if(_0x49d00b[_0x5529('0x14')][_0x5529('0x15')]===0x1f4){logger['error'](_0x5529('0x16'),_0x128728,_0x49d00b['error'][_0x5529('0x17')]);return _0x11e579(_0x49d00b['error'][_0x5529('0x17')]);}logger[_0x5529('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x128728,_0x49d00b[_0x5529('0x14')][_0x5529('0x17')]);return _0x575b90(_0x49d00b[_0x5529('0x14')][_0x5529('0x17')]);}else{logger[_0x5529('0x18')](_0x5529('0x16'),_0x128728,_0x5529('0x10'));_0x575b90(_0x49d00b['result'][_0x5529('0x17')]);}})[_0x5529('0x19')](function(_0x5e92a9){logger[_0x5529('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x128728,_0x5e92a9);_0x11e579(_0x5e92a9);});});}exports[_0x5529('0x1a')]=function(_0x1d4966){var _0x16586e=this;return new Promise(function(_0x3d848d,_0x871048){return db[_0x5529('0x1b')][_0x5529('0x1c')](_0x1d4966[_0x5529('0x1d')],{'raw':_0x1d4966['options']?_0x1d4966[_0x5529('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3d17aa){logger[_0x5529('0x18')]('CreateWhatsappMessage',_0x1d4966);logger[_0x5529('0x11')]('CreateWhatsappMessage',_0x1d4966,JSON[_0x5529('0x13')](_0x3d17aa));_0x3d848d(_0x3d17aa);})['catch'](function(_0x55a85b){logger['error'](_0x5529('0x1a'),_0x55a85b['message'],_0x1d4966);_0x871048(_0x16586e[_0x5529('0x14')](0x1f4,_0x55a85b['message']));});});}; \ No newline at end of file +var _0x26b7=['redis','defaults','localhost','./whatsappMessage.socket','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateWhatsappMessage','WhatsappMessage','create','options','raw','then','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x4b6d39,_0x453cf5){var _0x1b5acc=function(_0x280262){while(--_0x280262){_0x4b6d39['push'](_0x4b6d39['shift']());}};_0x1b5acc(++_0x453cf5);}(_0x26b7,0x13e));var _0x726b=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x26b7[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x726b('0x0'));var util=require(_0x726b('0x1'));var moment=require(_0x726b('0x2'));var BPromise=require(_0x726b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x726b('0x4'));var db=require(_0x726b('0x5'))['db'];var utils=require(_0x726b('0x6'));var logger=require(_0x726b('0x7'))(_0x726b('0x8'));var config=require(_0x726b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x726b('0xa')][_0x726b('0xb')]({'port':0x232a});config[_0x726b('0xc')]=_[_0x726b('0xd')](config[_0x726b('0xc')],{'host':_0x726b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x726b('0xc')]));require(_0x726b('0xf'))[_0x726b('0x10')](socket);function respondWithRpcPromise(_0x48b860,_0x4207d2,_0x1da536){return new BPromise(function(_0xd70bb3,_0x3a0819){return client[_0x726b('0x11')](_0x48b860,_0x1da536)['then'](function(_0xe47d19){logger[_0x726b('0x12')](_0x726b('0x13'),_0x4207d2,_0x726b('0x14'));logger['debug'](_0x726b('0x15'),_0x4207d2,_0x726b('0x14'),JSON[_0x726b('0x16')](_0xe47d19));if(_0xe47d19['error']){if(_0xe47d19['error']['code']===0x1f4){logger[_0x726b('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x4207d2,_0xe47d19[_0x726b('0x17')][_0x726b('0x18')]);return _0x3a0819(_0xe47d19[_0x726b('0x17')][_0x726b('0x18')]);}logger[_0x726b('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x4207d2,_0xe47d19[_0x726b('0x17')]['message']);return _0xd70bb3(_0xe47d19[_0x726b('0x17')][_0x726b('0x18')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x4207d2,_0x726b('0x14'));_0xd70bb3(_0xe47d19[_0x726b('0x19')][_0x726b('0x18')]);}})['catch'](function(_0x20abeb){logger[_0x726b('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x4207d2,_0x20abeb);_0x3a0819(_0x20abeb);});});}exports[_0x726b('0x1a')]=function(_0x2d80aa){var _0x14e77d=this;return new Promise(function(_0x338a11,_0x53049f){return db[_0x726b('0x1b')][_0x726b('0x1c')](_0x2d80aa['body'],{'raw':_0x2d80aa[_0x726b('0x1d')]?_0x2d80aa[_0x726b('0x1d')][_0x726b('0x1e')]===undefined?!![]:![]:!![]})[_0x726b('0x1f')](function(_0x35a202){logger[_0x726b('0x12')]('CreateWhatsappMessage',_0x2d80aa);logger['debug'](_0x726b('0x1a'),_0x2d80aa,JSON[_0x726b('0x16')](_0x35a202));_0x338a11(_0x35a202);})[_0x726b('0x20')](function(_0x1310ac){logger[_0x726b('0x17')](_0x726b('0x1a'),_0x1310ac['message'],_0x2d80aa);_0x53049f(_0x14e77d[_0x726b('0x17')](0x1f4,_0x1310ac[_0x726b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index b789230..e4b3964 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 _0x168f=['emit','removeListener','register','length','./whatsappMessage.events','remove','update'];(function(_0x43e219,_0x15962f){var _0x24ecad=function(_0x5765dd){while(--_0x5765dd){_0x43e219['push'](_0x43e219['shift']());}};_0x24ecad(++_0x15962f);}(_0x168f,0x100));var _0xf168=function(_0x102977,_0x3a99a6){_0x102977=_0x102977-0x0;var _0x15c466=_0x168f[_0x102977];return _0x15c466;};'use strict';var WhatsappMessageEvents=require(_0xf168('0x0'));var events=['save',_0xf168('0x1'),_0xf168('0x2')];function createListener(_0x15d430,_0x26b226){return function(_0x12cdda){_0x26b226[_0xf168('0x3')](_0x15d430,_0x12cdda);};}function removeListener(_0xcb38f2,_0x293215){return function(){WhatsappMessageEvents[_0xf168('0x4')](_0xcb38f2,_0x293215);};}exports[_0xf168('0x5')]=function(_0x3c7aa0){for(var _0x10c21b=0x0,_0x23afdc=events[_0xf168('0x6')];_0x10c21b<_0x23afdc;_0x10c21b++){var _0xb1290e=events[_0x10c21b];var _0x544f54=createListener('whatsappMessage:'+_0xb1290e,_0x3c7aa0);WhatsappMessageEvents['on'](_0xb1290e,_0x544f54);}}; \ No newline at end of file +var _0x6d10=['length','./whatsappMessage.events','remove','update','emit','register'];(function(_0x474ab8,_0x2ce35b){var _0x1db6d6=function(_0x16a631){while(--_0x16a631){_0x474ab8['push'](_0x474ab8['shift']());}};_0x1db6d6(++_0x2ce35b);}(_0x6d10,0x151));var _0x06d1=function(_0x49739f,_0x28e1b6){_0x49739f=_0x49739f-0x0;var _0x3b040f=_0x6d10[_0x49739f];return _0x3b040f;};'use strict';var WhatsappMessageEvents=require(_0x06d1('0x0'));var events=['save',_0x06d1('0x1'),_0x06d1('0x2')];function createListener(_0x374f31,_0x291828){return function(_0x31e987){_0x291828[_0x06d1('0x3')](_0x374f31,_0x31e987);};}function removeListener(_0x59a130,_0x540bf8){return function(){WhatsappMessageEvents['removeListener'](_0x59a130,_0x540bf8);};}exports[_0x06d1('0x4')]=function(_0x552a96){for(var _0x401b1f=0x0,_0x4d4649=events[_0x06d1('0x5')];_0x401b1f<_0x4d4649;_0x401b1f++){var _0x3db860=events[_0x401b1f];var _0x17b196=createListener('whatsappMessage:'+_0x3db860,_0x552a96);WhatsappMessageEvents['on'](_0x3db860,_0x17b196);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index b03a3a7..a7322ef 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 _0x2589=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','getMembers','/:id/teams','post','create','addTeams','/:id/users','addAgents','delete','destroy','removeTeams','removeAgents'];(function(_0x5cfb92,_0x5797e6){var _0x1cd7c2=function(_0x1bb452){while(--_0x1bb452){_0x5cfb92['push'](_0x5cfb92['shift']());}};_0x1cd7c2(++_0x5797e6);}(_0x2589,0x151));var _0x9258=function(_0x30ec8e,_0x5eff5d){_0x30ec8e=_0x30ec8e-0x0;var _0x2d2275=_0x2589[_0x30ec8e];return _0x2d2275;};'use strict';var multer=require(_0x9258('0x0'));var util=require(_0x9258('0x1'));var path=require(_0x9258('0x2'));var timeout=require(_0x9258('0x3'));var express=require(_0x9258('0x4'));var router=express[_0x9258('0x5')]();var fs_extra=require(_0x9258('0x6'));var auth=require(_0x9258('0x7'));var interaction=require(_0x9258('0x8'));var config=require(_0x9258('0x9'));var controller=require('./whatsappQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9258('0xa')]);router[_0x9258('0xb')](_0x9258('0xc'),auth[_0x9258('0xd')](),controller[_0x9258('0xe')]);router[_0x9258('0xb')](_0x9258('0xf'),auth[_0x9258('0xd')](),controller['show']);router[_0x9258('0xb')]('/:id/members',auth[_0x9258('0xd')](),controller[_0x9258('0x10')]);router[_0x9258('0xb')](_0x9258('0x11'),auth[_0x9258('0xd')](),controller['getTeams']);router[_0x9258('0xb')]('/:id/users',auth[_0x9258('0xd')](),controller['getAgents']);router[_0x9258('0x12')]('/',auth[_0x9258('0xd')](),controller[_0x9258('0x13')]);router[_0x9258('0x12')]('/:id/teams',auth[_0x9258('0xd')](),controller[_0x9258('0x14')]);router[_0x9258('0x12')](_0x9258('0x15'),auth['isAuthenticated'](),controller[_0x9258('0x16')]);router['put'](_0x9258('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x9258('0x17')](_0x9258('0xf'),auth['isAuthenticated'](),controller[_0x9258('0x18')]);router['delete'](_0x9258('0x11'),auth[_0x9258('0xd')](),controller[_0x9258('0x19')]);router[_0x9258('0x17')](_0x9258('0x15'),auth['isAuthenticated'](),controller[_0x9258('0x1a')]);module[_0x9258('0x1b')]=router; \ No newline at end of file +var _0xcd19=['get','/describe','isAuthenticated','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','update','delete','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueue.controller'];(function(_0x4a5494,_0x3ad336){var _0x57cbb5=function(_0xa5a1ac){while(--_0xa5a1ac){_0x4a5494['push'](_0x4a5494['shift']());}};_0x57cbb5(++_0x3ad336);}(_0xcd19,0x98));var _0x9cd1=function(_0x4a93bb,_0x495404){_0x4a93bb=_0x4a93bb-0x0;var _0x208468=_0xcd19[_0x4a93bb];return _0x208468;};'use strict';var multer=require(_0x9cd1('0x0'));var util=require(_0x9cd1('0x1'));var path=require(_0x9cd1('0x2'));var timeout=require(_0x9cd1('0x3'));var express=require(_0x9cd1('0x4'));var router=express[_0x9cd1('0x5')]();var fs_extra=require(_0x9cd1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9cd1('0x7'));var config=require(_0x9cd1('0x8'));var controller=require(_0x9cd1('0x9'));router[_0x9cd1('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x9cd1('0xb'),auth[_0x9cd1('0xc')](),controller['describe']);router[_0x9cd1('0xa')](_0x9cd1('0xd'),auth[_0x9cd1('0xc')](),controller[_0x9cd1('0xe')]);router[_0x9cd1('0xa')]('/:id/members',auth[_0x9cd1('0xc')](),controller[_0x9cd1('0xf')]);router[_0x9cd1('0xa')](_0x9cd1('0x10'),auth[_0x9cd1('0xc')](),controller[_0x9cd1('0x11')]);router[_0x9cd1('0xa')](_0x9cd1('0x12'),auth['isAuthenticated'](),controller[_0x9cd1('0x13')]);router['post']('/',auth[_0x9cd1('0xc')](),controller[_0x9cd1('0x14')]);router[_0x9cd1('0x15')](_0x9cd1('0x10'),auth[_0x9cd1('0xc')](),controller[_0x9cd1('0x16')]);router[_0x9cd1('0x15')](_0x9cd1('0x12'),auth[_0x9cd1('0xc')](),controller[_0x9cd1('0x17')]);router['put']('/:id',auth[_0x9cd1('0xc')](),controller[_0x9cd1('0x18')]);router[_0x9cd1('0x19')](_0x9cd1('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x9cd1('0x19')](_0x9cd1('0x10'),auth[_0x9cd1('0xc')](),controller['removeTeams']);router[_0x9cd1('0x19')](_0x9cd1('0x12'),auth[_0x9cd1('0xc')](),controller[_0x9cd1('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 50974b3..bf0a51d 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 _0x9090=['STRING','name','INTEGER','beepall','roundrobin','sequelize','exports'];(function(_0x1840c1,_0x44d362){var _0x58d080=function(_0x3be48b){while(--_0x3be48b){_0x1840c1['push'](_0x1840c1['shift']());}};_0x58d080(++_0x44d362);}(_0x9090,0x17f));var _0x0909=function(_0x321b2b,_0x24579b){_0x321b2b=_0x321b2b-0x0;var _0x6c245b=_0x9090[_0x321b2b];return _0x6c245b;};'use strict';var Sequelize=require(_0x0909('0x0'));module[_0x0909('0x1')]={'name':{'type':Sequelize[_0x0909('0x2')],'unique':_0x0909('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x0909('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x0909('0x5'),_0x0909('0x6'))},'description':{'type':Sequelize[_0x0909('0x2')]}}; \ No newline at end of file +var _0x4584=['roundrobin','sequelize','STRING','name','INTEGER','beepall'];(function(_0x4a8b5f,_0x2d0344){var _0x59b741=function(_0x124a96){while(--_0x124a96){_0x4a8b5f['push'](_0x4a8b5f['shift']());}};_0x59b741(++_0x2d0344);}(_0x4584,0x1cf));var _0x4458=function(_0x17b94e,_0x1b2f59){_0x17b94e=_0x17b94e-0x0;var _0x14ab53=_0x4584[_0x17b94e];return _0x14ab53;};'use strict';var Sequelize=require(_0x4458('0x0'));module['exports']={'name':{'type':Sequelize[_0x4458('0x1')],'unique':_0x4458('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x4458('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x4458('0x4'),_0x4458('0x5'))},'description':{'type':Sequelize[_0x4458('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 09db38a..34d1382 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 _0x325e=['include','rows','catch','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','UserProfileSection','userProfileId','UserProfileResource','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','nolimit','WhatsappQueueId','User','findAndCountAll','agent','whatsappPause','format','%s/%s','SIP','createdAt','updatedAt','getTeams','addTeams','ids','Team','findAll','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userWhatsappQueue:save','field','tq.TeamId','team_has_whatsapp_queues','join','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','compact','value','removeTeams','isEmpty','userWhatsappQueue:remove','addAgents','omit','spread','emit','removeAgents','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','destroy','stack','send','index','WhatsappQueue','rawAttributes','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll'];(function(_0x12097a,_0x4c9bb3){var _0x215617=function(_0x16b831){while(--_0x16b831){_0x12097a['push'](_0x12097a['shift']());}};_0x215617(++_0x4c9bb3);}(_0x325e,0x16e));var _0xe325=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x325e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe325('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe325('0x1'));var jsonpatch=require(_0xe325('0x2'));var rp=require(_0xe325('0x3'));var moment=require('moment');var BPromise=require(_0xe325('0x4'));var Mustache=require(_0xe325('0x5'));var util=require(_0xe325('0x6'));var path=require('path');var sox=require(_0xe325('0x7'));var csv=require(_0xe325('0x8'));var ejs=require(_0xe325('0x9'));var fs=require('fs');var fs_extra=require(_0xe325('0xa'));var _=require(_0xe325('0xb'));var squel=require(_0xe325('0xc'));var crypto=require(_0xe325('0xd'));var jsforce=require(_0xe325('0xe'));var deskjs=require(_0xe325('0xf'));var toCsv=require(_0xe325('0x8'));var querystring=require(_0xe325('0x10'));var Papa=require(_0xe325('0x11'));var Redis=require('ioredis');var authService=require(_0xe325('0x12'));var qs=require(_0xe325('0x13'));var as=require(_0xe325('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe325('0x15'))(_0xe325('0x16'));var utils=require(_0xe325('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe325('0x18'));var db=require(_0xe325('0x19'))['db'];config[_0xe325('0x1a')]=_[_0xe325('0x1b')](config['redis'],{'host':_0xe325('0x1c'),'port':0x18eb});var socket=require(_0xe325('0x1d'))(new Redis(config['redis']));require(_0xe325('0x1e'))[_0xe325('0x1f')](socket);function respondWithStatusCode(_0x298167,_0xc1810d){_0xc1810d=_0xc1810d||0xcc;return function(_0x48a068){if(_0x48a068){return _0x298167[_0xe325('0x20')](_0xc1810d);}return _0x298167['status'](_0xc1810d)[_0xe325('0x21')]();};}function respondWithResult(_0x4a77b6,_0x15abfd){_0x15abfd=_0x15abfd||0xc8;return function(_0x435abc){if(_0x435abc){return _0x4a77b6[_0xe325('0x22')](_0x15abfd)[_0xe325('0x23')](_0x435abc);}};}function respondWithFilteredResult(_0x3e4c8c,_0x2b7fae){return function(_0x46f986){if(_0x46f986){var _0x2a76a6=typeof _0x2b7fae[_0xe325('0x24')]===_0xe325('0x25')&&typeof _0x2b7fae[_0xe325('0x26')]===_0xe325('0x25');var _0x3acbe8=_0x46f986[_0xe325('0x27')];var _0x46f2d5=_0x2a76a6?0x0:_0x2b7fae['offset'];var _0x563f15=_0x2a76a6?_0x46f986[_0xe325('0x27')]:_0x2b7fae[_0xe325('0x24')]+_0x2b7fae[_0xe325('0x26')];var _0x10badb;if(_0x563f15>=_0x3acbe8){_0x563f15=_0x3acbe8;_0x10badb=0xc8;}else{_0x10badb=0xce;}_0x3e4c8c['status'](_0x10badb);return _0x3e4c8c['set'](_0xe325('0x28'),_0x46f2d5+'-'+_0x563f15+'/'+_0x3acbe8)[_0xe325('0x23')](_0x46f986);}return null;};}function patchUpdates(_0x352cb5){return function(_0x38f0a6){try{jsonpatch[_0xe325('0x29')](_0x38f0a6,_0x352cb5,!![]);}catch(_0x1cf82e){return BPromise[_0xe325('0x2a')](_0x1cf82e);}return _0x38f0a6[_0xe325('0x2b')]();};}function saveUpdates(_0x72f2d1,_0x3ac4ef){return function(_0x2547f9){if(_0x2547f9){return _0x2547f9[_0xe325('0x2c')](_0x72f2d1)[_0xe325('0x2d')](function(_0x1cc8ac){return _0x1cc8ac;});}return null;};}function removeEntity(_0x566d61,_0x2a50d4){return function(_0x1f912c){if(_0x1f912c){return _0x1f912c['destroy']()[_0xe325('0x2d')](function(){var _0x478a60=_0x1f912c[_0xe325('0x2e')]({'plain':!![]});var _0x14c802='WhatsappQueues';return db['UserProfileResource'][_0xe325('0x2f')]({'where':{'type':_0x14c802,'resourceId':_0x478a60['id']}})['then'](function(){return _0x1f912c;});})[_0xe325('0x2d')](function(){_0x566d61[_0xe325('0x22')](0xcc)[_0xe325('0x21')]();});}};}function handleEntityNotFound(_0x327915,_0x35597e){return function(_0x3b04fe){if(!_0x3b04fe){_0x327915['sendStatus'](0x194);}return _0x3b04fe;};}function handleError(_0x26ba2d,_0x481868){_0x481868=_0x481868||0x1f4;return function(_0x3b2f4a){logger['error'](_0x3b2f4a[_0xe325('0x30')]);if(_0x3b2f4a['name']){delete _0x3b2f4a['name'];}_0x26ba2d[_0xe325('0x22')](_0x481868)[_0xe325('0x31')](_0x3b2f4a);};}exports[_0xe325('0x32')]=function(_0x2072a8,_0x1b4ee5){var _0x33653e={},_0x762be1={},_0x379382={'count':0x0,'rows':[]};var _0xaffa0=_['map'](db[_0xe325('0x33')][_0xe325('0x34')],function(_0x21a1e7){return{'name':_0x21a1e7['fieldName'],'type':_0x21a1e7[_0xe325('0x35')][_0xe325('0x36')]};});_0x762be1[_0xe325('0x37')]=_[_0xe325('0x38')](_0xaffa0,'name');_0x762be1['query']=_['keys'](_0x2072a8[_0xe325('0x39')]);_0x762be1[_0xe325('0x3a')]=_['intersection'](_0x762be1['model'],_0x762be1['query']);_0x33653e[_0xe325('0x3b')]=_[_0xe325('0x3c')](_0x762be1[_0xe325('0x37')],qs[_0xe325('0x3d')](_0x2072a8[_0xe325('0x39')][_0xe325('0x3d')]));_0x33653e[_0xe325('0x3b')]=_0x33653e[_0xe325('0x3b')]['length']?_0x33653e[_0xe325('0x3b')]:_0x762be1[_0xe325('0x37')];if(!_0x2072a8[_0xe325('0x39')][_0xe325('0x3e')]('nolimit')){_0x33653e[_0xe325('0x26')]=qs[_0xe325('0x26')](_0x2072a8[_0xe325('0x39')]['limit']);_0x33653e[_0xe325('0x24')]=qs[_0xe325('0x24')](_0x2072a8[_0xe325('0x39')][_0xe325('0x24')]);}_0x33653e[_0xe325('0x3f')]=qs[_0xe325('0x40')](_0x2072a8[_0xe325('0x39')]['sort']);_0x33653e[_0xe325('0x41')]=qs[_0xe325('0x3a')](_[_0xe325('0x42')](_0x2072a8['query'],_0x762be1[_0xe325('0x3a')]),_0xaffa0);if(_0x2072a8['query']['filter']){_0x33653e[_0xe325('0x41')]=_[_0xe325('0x43')](_0x33653e[_0xe325('0x41')],{'$or':_[_0xe325('0x38')](_0xaffa0,function(_0x13fd98){if(_0x13fd98[_0xe325('0x35')]!==_0xe325('0x44')){var _0xb12f8f={};_0xb12f8f[_0x13fd98['name']]={'$like':'%'+_0x2072a8[_0xe325('0x39')][_0xe325('0x45')]+'%'};return _0xb12f8f;}})});}_0x33653e=_[_0xe325('0x43')]({},_0x33653e,_0x2072a8[_0xe325('0x46')]);var _0x46a110={'where':_0x33653e[_0xe325('0x41')]};return db['WhatsappQueue'][_0xe325('0x27')](_0x46a110)[_0xe325('0x2d')](function(_0x1d2c1c){_0x379382[_0xe325('0x27')]=_0x1d2c1c;if(_0x2072a8['query'][_0xe325('0x47')]){_0x33653e[_0xe325('0x48')]=[{'all':!![]}];}return db['WhatsappQueue']['findAll'](_0x33653e);})[_0xe325('0x2d')](function(_0x1ce8f3){_0x379382[_0xe325('0x49')]=_0x1ce8f3;return _0x379382;})[_0xe325('0x2d')](respondWithFilteredResult(_0x1b4ee5,_0x33653e))[_0xe325('0x4a')](handleError(_0x1b4ee5,null));};exports[_0xe325('0x4b')]=function(_0x4e1a98,_0x23bf80){var _0x5ce70b={'raw':!![],'where':{'id':_0x4e1a98[_0xe325('0x4c')]['id']}},_0x324b23={};_0x324b23['model']=_[_0xe325('0x4d')](db[_0xe325('0x33')][_0xe325('0x34')]);_0x324b23[_0xe325('0x39')]=_[_0xe325('0x4d')](_0x4e1a98[_0xe325('0x39')]);_0x324b23[_0xe325('0x3a')]=_[_0xe325('0x3c')](_0x324b23['model'],_0x324b23[_0xe325('0x39')]);_0x5ce70b['attributes']=_[_0xe325('0x3c')](_0x324b23['model'],qs['fields'](_0x4e1a98[_0xe325('0x39')][_0xe325('0x3d')]));_0x5ce70b[_0xe325('0x3b')]=_0x5ce70b[_0xe325('0x3b')][_0xe325('0x4e')]?_0x5ce70b[_0xe325('0x3b')]:_0x324b23[_0xe325('0x37')];if(_0x4e1a98[_0xe325('0x39')][_0xe325('0x47')]){_0x5ce70b[_0xe325('0x48')]=[{'all':!![]}];}_0x5ce70b=_['merge']({},_0x5ce70b,_0x4e1a98[_0xe325('0x46')]);return db[_0xe325('0x33')][_0xe325('0x4f')](_0x5ce70b)[_0xe325('0x2d')](handleEntityNotFound(_0x23bf80,null))[_0xe325('0x2d')](respondWithResult(_0x23bf80,null))[_0xe325('0x4a')](handleError(_0x23bf80,null));};exports[_0xe325('0x50')]=function(_0x24ac9e,_0x47fa5f){return db[_0xe325('0x33')][_0xe325('0x50')](_0x24ac9e[_0xe325('0x51')],{})[_0xe325('0x2d')](function(_0x5b5993){var _0x5b70fa=_0x24ac9e[_0xe325('0x52')]['get']({'plain':!![]});if(!_0x5b70fa)throw new Error(_0xe325('0x53'));if(_0x5b70fa[_0xe325('0x54')]===_0xe325('0x52')){var _0x555aee=_0x5b5993[_0xe325('0x2e')]({'plain':!![]});var _0x426e09=_0xe325('0x55');return db[_0xe325('0x56')][_0xe325('0x4f')]({'where':{'name':_0x426e09,'userProfileId':_0x5b70fa[_0xe325('0x57')]},'raw':!![]})[_0xe325('0x2d')](function(_0x367ddf){if(_0x367ddf&&_0x367ddf['autoAssociation']===0x0){return db[_0xe325('0x58')][_0xe325('0x50')]({'name':_0x555aee['name'],'resourceId':_0x555aee['id'],'type':_0x367ddf[_0xe325('0x59')],'sectionId':_0x367ddf['id']},{})['then'](function(){return _0x5b5993;});}else{return _0x5b5993;}})['catch'](function(_0x5a21cd){logger[_0xe325('0x5a')](_0xe325('0x5b'),_0x5a21cd);throw _0x5a21cd;});}return _0x5b5993;})['then'](respondWithResult(_0x47fa5f,0xc9))[_0xe325('0x4a')](handleError(_0x47fa5f,null));};exports[_0xe325('0x2c')]=function(_0x506254,_0x2bfd2a){if(_0x506254['body']['id']){delete _0x506254['body']['id'];}return db[_0xe325('0x33')][_0xe325('0x4f')]({'where':{'id':_0x506254[_0xe325('0x4c')]['id']}})[_0xe325('0x2d')](handleEntityNotFound(_0x2bfd2a,null))[_0xe325('0x2d')](saveUpdates(_0x506254[_0xe325('0x51')],null))[_0xe325('0x2d')](respondWithResult(_0x2bfd2a,null))[_0xe325('0x4a')](handleError(_0x2bfd2a,null));};exports['destroy']=function(_0xd17138,_0x4dd44d){return db['WhatsappQueue'][_0xe325('0x4f')]({'where':{'id':_0xd17138['params']['id']}})[_0xe325('0x2d')](handleEntityNotFound(_0x4dd44d,null))[_0xe325('0x2d')](removeEntity(_0x4dd44d,null))[_0xe325('0x4a')](handleError(_0x4dd44d,null));};exports[_0xe325('0x5c')]=function(_0x205b5a,_0x46448d){return db['WhatsappQueue'][_0xe325('0x5c')]()[_0xe325('0x2d')](respondWithResult(_0x46448d,null))[_0xe325('0x4a')](handleError(_0x46448d,null));};exports[_0xe325('0x5d')]=function(_0x45a311,_0x36ce6f,_0x3d7d8a){var _0x4b1f1d={'raw':!![],'where':{}},_0x4f066d={},_0x2f1421;return db[_0xe325('0x33')][_0xe325('0x5e')]({'where':{'id':_0x45a311[_0xe325('0x4c')]['id']}})[_0xe325('0x2d')](handleEntityNotFound(_0x36ce6f,null))[_0xe325('0x2d')](function(_0x3d2f44){if(_0x3d2f44){_0x2f1421=_0x3d2f44[_0xe325('0x2e')]({'plain':!![]});_0x4f066d['model']=_[_0xe325('0x4d')](db[_0xe325('0x5f')][_0xe325('0x34')]);_0x4f066d[_0xe325('0x39')]=_[_0xe325('0x4d')](_0x45a311[_0xe325('0x39')]);_0x4f066d[_0xe325('0x3a')]=_[_0xe325('0x3c')](_0x4f066d[_0xe325('0x37')],_0x4f066d[_0xe325('0x39')]);_0x4b1f1d['attributes']=_[_0xe325('0x3c')](_0x4f066d[_0xe325('0x37')],qs[_0xe325('0x3d')](_0x45a311[_0xe325('0x39')]['fields']));_0x4b1f1d[_0xe325('0x3b')]=_0x4b1f1d[_0xe325('0x3b')][_0xe325('0x4e')]?_0x4b1f1d[_0xe325('0x3b')]:_0x4f066d[_0xe325('0x37')];if(!_0x45a311[_0xe325('0x39')][_0xe325('0x3e')](_0xe325('0x60'))){_0x4b1f1d[_0xe325('0x26')]=qs['limit'](_0x45a311[_0xe325('0x39')]['limit']);_0x4b1f1d[_0xe325('0x24')]=qs['offset'](_0x45a311[_0xe325('0x39')][_0xe325('0x24')]);}_0x4b1f1d[_0xe325('0x3f')]=qs[_0xe325('0x40')](_0x45a311[_0xe325('0x39')][_0xe325('0x40')]);_0x4b1f1d[_0xe325('0x41')]=qs['filters'](_[_0xe325('0x42')](_0x45a311[_0xe325('0x39')],_0x4f066d[_0xe325('0x3a')]));_0x4b1f1d[_0xe325('0x41')][_0xe325('0x61')]=_0x3d2f44['id'];if(_0x45a311[_0xe325('0x39')][_0xe325('0x45')]){_0x4b1f1d['where']=_[_0xe325('0x43')](_0x4b1f1d[_0xe325('0x41')],{'$or':_[_0xe325('0x38')](_0x4b1f1d[_0xe325('0x3b')],function(_0x91ec33){var _0x29e733={};_0x29e733[_0x91ec33]={'$like':'%'+_0x45a311[_0xe325('0x39')][_0xe325('0x45')]+'%'};return _0x29e733;})});}_0x4b1f1d=_[_0xe325('0x43')]({},_0x4b1f1d,_0x45a311[_0xe325('0x46')]);return db[_0xe325('0x5f')]['findAll'](_0x4b1f1d);}})[_0xe325('0x2d')](function(_0x558e40){if(_0x558e40){return db[_0xe325('0x62')][_0xe325('0x63')]({'where':{'id':_[_0xe325('0x38')](_0x558e40,'UserId'),'role':_0xe325('0x64')},'attributes':['id',_0xe325('0x59'),_0xe325('0x65'),'updatedAt','createdAt']});}})[_0xe325('0x2d')](function(_0x2a94cd){if(_0x2a94cd){return{'count':_0x2a94cd['count'],'rows':_[_0xe325('0x38')](_0x2a94cd[_0xe325('0x49')],function(_0x198f17){return{'membername':_0x198f17['name'],'UserId':_0x198f17['id'],'queue_name':_0x2f1421[_0xe325('0x59')],'WhatsappQueueId':_0x2f1421['id'],'interface':util[_0xe325('0x66')](_0xe325('0x67'),_0xe325('0x68'),_0x198f17[_0xe325('0x59')]),'penalty':0x0,'paused':_0x198f17[_0xe325('0x65')],'createdAt':_0x198f17[_0xe325('0x69')],'updatedAt':_0x198f17[_0xe325('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe325('0x2d')](respondWithFilteredResult(_0x36ce6f,_0x4b1f1d))[_0xe325('0x4a')](handleError(_0x36ce6f,null));};exports[_0xe325('0x6b')]=function(_0x5c0095,_0x396c77,_0x1e7e21){var _0x386ca1={};var _0x43b3e6={};var _0x38bbe1;var _0x3a8d0a;return db[_0xe325('0x33')][_0xe325('0x5e')]({'where':{'id':_0x5c0095[_0xe325('0x4c')]['id']}})[_0xe325('0x2d')](handleEntityNotFound(_0x396c77,null))['then'](function(_0x361509){if(_0x361509){_0x38bbe1=_0x361509;_0x43b3e6['model']=_['keys'](db['Team'][_0xe325('0x34')]);_0x43b3e6['query']=_[_0xe325('0x4d')](_0x5c0095[_0xe325('0x39')]);_0x43b3e6['filters']=_[_0xe325('0x3c')](_0x43b3e6[_0xe325('0x37')],_0x43b3e6['query']);_0x386ca1[_0xe325('0x3b')]=_['intersection'](_0x43b3e6[_0xe325('0x37')],qs[_0xe325('0x3d')](_0x5c0095[_0xe325('0x39')][_0xe325('0x3d')]));_0x386ca1[_0xe325('0x3b')]=_0x386ca1[_0xe325('0x3b')][_0xe325('0x4e')]?_0x386ca1[_0xe325('0x3b')]:_0x43b3e6[_0xe325('0x37')];_0x386ca1[_0xe325('0x3f')]=qs['sort'](_0x5c0095[_0xe325('0x39')][_0xe325('0x40')]);_0x386ca1[_0xe325('0x41')]=qs['filters'](_[_0xe325('0x42')](_0x5c0095[_0xe325('0x39')],_0x43b3e6[_0xe325('0x3a')]));if(_0x5c0095[_0xe325('0x39')][_0xe325('0x45')]){_0x386ca1[_0xe325('0x41')]=_['merge'](_0x386ca1[_0xe325('0x41')],{'$or':_[_0xe325('0x38')](_0x386ca1[_0xe325('0x3b')],function(_0x4cb617){var _0x48d639={};_0x48d639[_0x4cb617]={'$like':'%'+_0x5c0095['query'][_0xe325('0x45')]+'%'};return _0x48d639;})});}_0x386ca1=_['merge']({},_0x386ca1,_0x5c0095[_0xe325('0x46')]);return _0x38bbe1[_0xe325('0x6b')](_0x386ca1);}})[_0xe325('0x2d')](function(_0x5445f5){if(_0x5445f5){_0x3a8d0a=_0x5445f5[_0xe325('0x4e')];if(!_0x5c0095[_0xe325('0x39')][_0xe325('0x3e')]('nolimit')){_0x386ca1[_0xe325('0x26')]=qs[_0xe325('0x26')](_0x5c0095['query'][_0xe325('0x26')]);_0x386ca1[_0xe325('0x24')]=qs['offset'](_0x5c0095[_0xe325('0x39')][_0xe325('0x24')]);}return _0x38bbe1[_0xe325('0x6b')](_0x386ca1);}})['then'](function(_0x59f1aa){if(_0x59f1aa){return _0x59f1aa?{'count':_0x3a8d0a,'rows':_0x59f1aa}:null;}})[_0xe325('0x2d')](respondWithResult(_0x396c77,null))[_0xe325('0x4a')](handleError(_0x396c77,null));};exports[_0xe325('0x6c')]=function(_0x83ff46,_0x2ef991,_0x348723){var _0x866b9f=_0x83ff46[_0xe325('0x51')][_0xe325('0x6d')];return db[_0xe325('0x6e')][_0xe325('0x6f')]({'where':{'id':_0x866b9f},'attributes':['id'],'include':[{'model':db[_0xe325('0x62')],'as':_0xe325('0x70'),'attributes':['id',_0xe325('0x59'),_0xe325('0x71'),_0xe325('0x72'),_0xe325('0x73')],'raw':!![]}]})['then'](function(_0x5bea08){if(_0x5bea08){var _0xf0a59e=_[_0xe325('0x74')](_0x5bea08,function(_0x5090d3){var _0x3a5ca9=_0x5090d3['get']({'plain':!![]});return _0x3a5ca9[_0xe325('0x70')];});return db[_0xe325('0x33')]['find']({'where':{'id':_0x83ff46[_0xe325('0x4c')]['id']}})[_0xe325('0x2d')](function(_0x4028bd){return db[_0xe325('0x75')][_0xe325('0x76')](function(_0x2bda13){return _0x4028bd['addTeams'](_0x866b9f,{'transaction':_0x2bda13})[_0xe325('0x2d')](function(){return BPromise[_0xe325('0x77')](_0xf0a59e,function(_0x556916){return db[_0xe325('0x5f')][_0xe325('0x78')]({'where':{'UserId':_0x556916['id'],'WhatsappQueueId':_0x83ff46['params']['id']},'transaction':_0x2bda13});});})[_0xe325('0x2d')](function(){_0xf0a59e[_0xe325('0x79')](function(_0x3eeefd){socket['emit'](_0xe325('0x7a'),{'UserId':_0x3eeefd['id'],'WhatsappQueueId':_0x4028bd['id']});});});});});}})[_0xe325('0x2d')](respondWithStatusCode(_0x2ef991,null))[_0xe325('0x4a')](handleError(_0x2ef991,null));};exports['removeTeams']=function(_0x2eee35,_0x255ef0,_0x2869a9){return db['Team'][_0xe325('0x6f')]({'where':{'id':_0x2eee35['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xe325('0x62')],'as':_0xe325('0x70'),'attributes':['id'],'raw':!![]}]})[_0xe325('0x2d')](handleEntityNotFound(_0x255ef0,null))[_0xe325('0x2d')](function(_0xf7dbbf){var _0x4b13cb=_['map'](_0xf7dbbf,'id');var _0x3b75a6=[];var _0xa07d5a=[];var _0x4aac62=squel['select']();_0x4aac62[_0xe325('0x7b')](_0xe325('0x7c'))['from'](_0xe325('0x7d'),'tq')[_0xe325('0x7e')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe325('0x41')](_0xe325('0x7f'),_0x2eee35[_0xe325('0x4c')]['id']);for(var _0x1eb7fe=0x0;_0x1eb7fe<_0xf7dbbf['length'];_0x1eb7fe+=0x1){let _0x576d3e=_0xf7dbbf[_0x1eb7fe];for(var _0x12a012=0x0;_0x12a012<_0x576d3e[_0xe325('0x70')][_0xe325('0x4e')];_0x12a012+=0x1){let _0xbbec95=_0x576d3e[_0xe325('0x70')][_0x12a012];var _0x5940c7=_0x4aac62['clone']();_0x5940c7[_0xe325('0x41')](_0xe325('0x80'),_0xbbec95['id']);_0xa07d5a['push'](db[_0xe325('0x75')][_0xe325('0x39')](_0x5940c7[_0xe325('0x81')](),{'type':db[_0xe325('0x75')][_0xe325('0x82')][_0xe325('0x83')]})[_0xe325('0x2d')](function(_0x2cb1b1){if(_0x2cb1b1['length']===0x1){return _0xbbec95['id'];}else{var _0x132154=_[_0xe325('0x84')](_[_0xe325('0x38')](_0x2cb1b1,'TeamId'),function(_0x3070fe){return _[_0xe325('0x85')](_0x4b13cb,_0x3070fe);});if(_0x132154){return _0xbbec95['id'];}}}));}}return BPromise[_0xe325('0x86')](_0xa07d5a)[_0xe325('0x2d')](function(_0x187c2e){_0x3b75a6=_(_0x3b75a6)['union'](_0x187c2e)[_0xe325('0x87')]()[_0xe325('0x88')]();return db[_0xe325('0x33')][_0xe325('0x4f')]({'where':{'id':_0x2eee35[_0xe325('0x4c')]['id']}})[_0xe325('0x2d')](function(_0x1e8c5f){return db[_0xe325('0x75')][_0xe325('0x76')](function(_0x281976){return _0x1e8c5f[_0xe325('0x89')](_0x2eee35['query']['ids'],{'transaction':_0x281976})[_0xe325('0x2d')](function(){if(!_[_0xe325('0x8a')](_0x3b75a6)){return _0x1e8c5f['removeAgents'](_0x3b75a6,{'transaction':_0x281976});}})[_0xe325('0x2d')](function(){_0x3b75a6['forEach'](function(_0x2a119a){socket['emit'](_0xe325('0x8b'),{'UserId':_0x2a119a,'WhatsappQueueId':_0x1e8c5f['id']});});});});});});})['then'](respondWithStatusCode(_0x255ef0,null))[_0xe325('0x4a')](handleError(_0x255ef0,null));};exports[_0xe325('0x8c')]=function(_0x307571,_0x4c148f,_0x474ac2){return db[_0xe325('0x33')][_0xe325('0x4f')]({'where':{'id':_0x307571[_0xe325('0x4c')]['id']}})[_0xe325('0x2d')](handleEntityNotFound(_0x4c148f,null))['then'](function(_0xf44550){if(_0xf44550){return _0xf44550[_0xe325('0x8c')](_0x307571[_0xe325('0x51')][_0xe325('0x6d')],_[_0xe325('0x8d')](_0x307571['body'],[_0xe325('0x6d'),'id'])||{})[_0xe325('0x8e')](function(_0xf6b8d9){for(var _0x29c6ec=0x0;_0x29c6ec<_0x307571[_0xe325('0x51')]['ids'][_0xe325('0x4e')];_0x29c6ec+=0x1){socket[_0xe325('0x8f')](_0xe325('0x7a'),{'UserId':Number(_0x307571[_0xe325('0x51')][_0xe325('0x6d')][_0x29c6ec]),'WhatsappQueueId':Number(_0x307571[_0xe325('0x4c')]['id'])});}return _0xf6b8d9;});}})[_0xe325('0x2d')](respondWithResult(_0x4c148f,null))[_0xe325('0x4a')](handleError(_0x4c148f,null));};exports[_0xe325('0x90')]=function(_0xd9ce30,_0x2cda29,_0x53ceac){return db[_0xe325('0x33')][_0xe325('0x4f')]({'where':{'id':_0xd9ce30[_0xe325('0x4c')]['id']}})[_0xe325('0x2d')](handleEntityNotFound(_0x2cda29,null))['then'](function(_0x20c0bd){if(_0x20c0bd){return _0x20c0bd[_0xe325('0x90')](_0xd9ce30[_0xe325('0x39')][_0xe325('0x6d')])['then'](function(){if(_['isArray'](_0xd9ce30[_0xe325('0x39')][_0xe325('0x6d')])){for(var _0x1a9508=0x0;_0x1a9508<_0xd9ce30[_0xe325('0x39')][_0xe325('0x6d')][_0xe325('0x4e')];_0x1a9508+=0x1){socket[_0xe325('0x8f')](_0xe325('0x8b'),{'UserId':Number(_0xd9ce30['query'][_0xe325('0x6d')][_0x1a9508]),'WhatsappQueueId':Number(_0xd9ce30[_0xe325('0x4c')]['id'])});}}else{socket['emit'](_0xe325('0x8b'),{'UserId':Number(_0xd9ce30[_0xe325('0x39')][_0xe325('0x6d')]),'WhatsappQueueId':Number(_0xd9ce30[_0xe325('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x2cda29,null))['catch'](handleError(_0x2cda29,null));};exports[_0xe325('0x91')]=function(_0xf02df3,_0x2d1493,_0x39d68a){var _0x11423e={};var _0x152958={};var _0x101ee3;var _0x491574;return db[_0xe325('0x33')]['findOne']({'where':{'id':_0xf02df3[_0xe325('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2d1493,null))[_0xe325('0x2d')](function(_0xeabc25){if(_0xeabc25){_0x101ee3=_0xeabc25;_0x152958['model']=_['keys'](db[_0xe325('0x62')][_0xe325('0x34')]);_0x152958['query']=_['keys'](_0xf02df3[_0xe325('0x39')]);_0x152958[_0xe325('0x3a')]=_[_0xe325('0x3c')](_0x152958[_0xe325('0x37')],_0x152958[_0xe325('0x39')]);_0x11423e[_0xe325('0x3b')]=_[_0xe325('0x3c')](_0x152958[_0xe325('0x37')],qs[_0xe325('0x3d')](_0xf02df3[_0xe325('0x39')]['fields']));_0x11423e['attributes']=_0x11423e[_0xe325('0x3b')][_0xe325('0x4e')]?_0x11423e[_0xe325('0x3b')]:_0x152958[_0xe325('0x37')];_0x11423e[_0xe325('0x3f')]=qs[_0xe325('0x40')](_0xf02df3[_0xe325('0x39')][_0xe325('0x40')]);_0x11423e[_0xe325('0x41')]=qs['filters'](_[_0xe325('0x42')](_0xf02df3[_0xe325('0x39')],_0x152958[_0xe325('0x3a')]));if(_0xf02df3['query']['filter']){_0x11423e[_0xe325('0x41')]=_[_0xe325('0x43')](_0x11423e[_0xe325('0x41')],{'$or':_[_0xe325('0x38')](_0x11423e[_0xe325('0x3b')],function(_0x1c94f1){var _0xc49ae={};_0xc49ae[_0x1c94f1]={'$like':'%'+_0xf02df3[_0xe325('0x39')]['filter']+'%'};return _0xc49ae;})});}_0x11423e=_[_0xe325('0x43')]({},_0x11423e,_0xf02df3[_0xe325('0x46')]);return _0x101ee3[_0xe325('0x91')](_0x11423e);}})[_0xe325('0x2d')](function(_0x49cbdd){if(_0x49cbdd){_0x491574=_0x49cbdd[_0xe325('0x4e')];if(!_0xf02df3[_0xe325('0x39')][_0xe325('0x3e')](_0xe325('0x60'))){_0x11423e[_0xe325('0x26')]=qs[_0xe325('0x26')](_0xf02df3['query'][_0xe325('0x26')]);_0x11423e[_0xe325('0x24')]=qs['offset'](_0xf02df3[_0xe325('0x39')][_0xe325('0x24')]);}return _0x101ee3[_0xe325('0x91')](_0x11423e);}})['then'](function(_0x5bd399){if(_0x5bd399){return _0x5bd399?{'count':_0x491574,'rows':_0x5bd399}:null;}})[_0xe325('0x2d')](respondWithResult(_0x2d1493,null))[_0xe325('0x4a')](handleError(_0x2d1493,null));}; \ No newline at end of file +var _0xedb6=['clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','transaction','isEmpty','removeAgents','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','then','destroy','get','WhatsappQueues','UserProfileResource','stack','name','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','UserWhatsappQueue','length','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','rows','format','%s/%s','findOne','getTeams','addTeams','ids','Agents','online','each','forEach','emit','userWhatsappQueue:save','removeTeams','Team','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId'];(function(_0x43e1f4,_0x5bc9ba){var _0x1da2f8=function(_0x2e6bfa){while(--_0x2e6bfa){_0x43e1f4['push'](_0x43e1f4['shift']());}};_0x1da2f8(++_0x5bc9ba);}(_0xedb6,0x124));var _0x6edb=function(_0xf34109,_0x380779){_0xf34109=_0xf34109-0x0;var _0x570bfc=_0xedb6[_0xf34109];return _0x570bfc;};'use strict';var emlformat=require(_0x6edb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6edb('0x1'));var jsonpatch=require(_0x6edb('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6edb('0x3'));var util=require(_0x6edb('0x4'));var path=require('path');var sox=require(_0x6edb('0x5'));var csv=require(_0x6edb('0x6'));var ejs=require(_0x6edb('0x7'));var fs=require('fs');var fs_extra=require(_0x6edb('0x8'));var _=require(_0x6edb('0x9'));var squel=require(_0x6edb('0xa'));var crypto=require(_0x6edb('0xb'));var jsforce=require(_0x6edb('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6edb('0xd'));var Papa=require('papaparse');var Redis=require(_0x6edb('0xe'));var authService=require(_0x6edb('0xf'));var qs=require(_0x6edb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6edb('0x11'));var logger=require(_0x6edb('0x12'))(_0x6edb('0x13'));var utils=require(_0x6edb('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6edb('0x15'));var db=require(_0x6edb('0x16'))['db'];config[_0x6edb('0x17')]=_[_0x6edb('0x18')](config[_0x6edb('0x17')],{'host':_0x6edb('0x19'),'port':0x18eb});var socket=require(_0x6edb('0x1a'))(new Redis(config[_0x6edb('0x17')]));require(_0x6edb('0x1b'))[_0x6edb('0x1c')](socket);function respondWithStatusCode(_0x1afdf9,_0x29bb08){_0x29bb08=_0x29bb08||0xcc;return function(_0x320ced){if(_0x320ced){return _0x1afdf9[_0x6edb('0x1d')](_0x29bb08);}return _0x1afdf9['status'](_0x29bb08)[_0x6edb('0x1e')]();};}function respondWithResult(_0x4cb37a,_0x1ac153){_0x1ac153=_0x1ac153||0xc8;return function(_0x2d965f){if(_0x2d965f){return _0x4cb37a[_0x6edb('0x1f')](_0x1ac153)['json'](_0x2d965f);}};}function respondWithFilteredResult(_0x380cdd,_0x53f668){return function(_0x44050f){if(_0x44050f){var _0x3a907c=typeof _0x53f668[_0x6edb('0x20')]===_0x6edb('0x21')&&typeof _0x53f668[_0x6edb('0x22')]===_0x6edb('0x21');var _0xfe4222=_0x44050f['count'];var _0x41bb31=_0x3a907c?0x0:_0x53f668[_0x6edb('0x20')];var _0x13803b=_0x3a907c?_0x44050f[_0x6edb('0x23')]:_0x53f668[_0x6edb('0x20')]+_0x53f668['limit'];var _0x159e5b;if(_0x13803b>=_0xfe4222){_0x13803b=_0xfe4222;_0x159e5b=0xc8;}else{_0x159e5b=0xce;}_0x380cdd[_0x6edb('0x1f')](_0x159e5b);return _0x380cdd[_0x6edb('0x24')]('Content-Range',_0x41bb31+'-'+_0x13803b+'/'+_0xfe4222)[_0x6edb('0x25')](_0x44050f);}return null;};}function patchUpdates(_0x1fcf32){return function(_0x371943){try{jsonpatch[_0x6edb('0x26')](_0x371943,_0x1fcf32,!![]);}catch(_0x1e9794){return BPromise[_0x6edb('0x27')](_0x1e9794);}return _0x371943[_0x6edb('0x28')]();};}function saveUpdates(_0x562aa4,_0x3a85e0){return function(_0x2aa536){if(_0x2aa536){return _0x2aa536['update'](_0x562aa4)[_0x6edb('0x29')](function(_0x5af8d8){return _0x5af8d8;});}return null;};}function removeEntity(_0x2e28f7,_0x4047bd){return function(_0x1120ff){if(_0x1120ff){return _0x1120ff[_0x6edb('0x2a')]()[_0x6edb('0x29')](function(){var _0x52d87d=_0x1120ff[_0x6edb('0x2b')]({'plain':!![]});var _0x2c4b72=_0x6edb('0x2c');return db[_0x6edb('0x2d')][_0x6edb('0x2a')]({'where':{'type':_0x2c4b72,'resourceId':_0x52d87d['id']}})[_0x6edb('0x29')](function(){return _0x1120ff;});})[_0x6edb('0x29')](function(){_0x2e28f7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x345dcb,_0x8d5fc7){return function(_0x384f0e){if(!_0x384f0e){_0x345dcb['sendStatus'](0x194);}return _0x384f0e;};}function handleError(_0x2e1b74,_0x35f980){_0x35f980=_0x35f980||0x1f4;return function(_0x3ab4d4){logger['error'](_0x3ab4d4[_0x6edb('0x2e')]);if(_0x3ab4d4[_0x6edb('0x2f')]){delete _0x3ab4d4['name'];}_0x2e1b74[_0x6edb('0x1f')](_0x35f980)['send'](_0x3ab4d4);};}exports[_0x6edb('0x30')]=function(_0x3502c1,_0x22a175){var _0x5800a1={},_0x172ed5={},_0x38fa92={'count':0x0,'rows':[]};var _0x421140=_[_0x6edb('0x31')](db[_0x6edb('0x32')][_0x6edb('0x33')],function(_0x25c165){return{'name':_0x25c165[_0x6edb('0x34')],'type':_0x25c165[_0x6edb('0x35')][_0x6edb('0x36')]};});_0x172ed5['model']=_[_0x6edb('0x31')](_0x421140,_0x6edb('0x2f'));_0x172ed5['query']=_['keys'](_0x3502c1[_0x6edb('0x37')]);_0x172ed5[_0x6edb('0x38')]=_[_0x6edb('0x39')](_0x172ed5[_0x6edb('0x3a')],_0x172ed5[_0x6edb('0x37')]);_0x5800a1[_0x6edb('0x3b')]=_[_0x6edb('0x39')](_0x172ed5[_0x6edb('0x3a')],qs[_0x6edb('0x3c')](_0x3502c1[_0x6edb('0x37')][_0x6edb('0x3c')]));_0x5800a1[_0x6edb('0x3b')]=_0x5800a1[_0x6edb('0x3b')]['length']?_0x5800a1[_0x6edb('0x3b')]:_0x172ed5[_0x6edb('0x3a')];if(!_0x3502c1[_0x6edb('0x37')][_0x6edb('0x3d')](_0x6edb('0x3e'))){_0x5800a1[_0x6edb('0x22')]=qs[_0x6edb('0x22')](_0x3502c1[_0x6edb('0x37')][_0x6edb('0x22')]);_0x5800a1[_0x6edb('0x20')]=qs[_0x6edb('0x20')](_0x3502c1['query'][_0x6edb('0x20')]);}_0x5800a1[_0x6edb('0x3f')]=qs[_0x6edb('0x40')](_0x3502c1[_0x6edb('0x37')][_0x6edb('0x40')]);_0x5800a1[_0x6edb('0x41')]=qs[_0x6edb('0x38')](_[_0x6edb('0x42')](_0x3502c1['query'],_0x172ed5[_0x6edb('0x38')]),_0x421140);if(_0x3502c1[_0x6edb('0x37')][_0x6edb('0x43')]){_0x5800a1[_0x6edb('0x41')]=_[_0x6edb('0x44')](_0x5800a1['where'],{'$or':_[_0x6edb('0x31')](_0x421140,function(_0x42a3f6){if(_0x42a3f6[_0x6edb('0x35')]!=='VIRTUAL'){var _0xcbdf04={};_0xcbdf04[_0x42a3f6['name']]={'$like':'%'+_0x3502c1[_0x6edb('0x37')][_0x6edb('0x43')]+'%'};return _0xcbdf04;}})});}_0x5800a1=_[_0x6edb('0x44')]({},_0x5800a1,_0x3502c1[_0x6edb('0x45')]);var _0x6a6a9a={'where':_0x5800a1[_0x6edb('0x41')]};return db[_0x6edb('0x32')][_0x6edb('0x23')](_0x6a6a9a)[_0x6edb('0x29')](function(_0x10bdda){_0x38fa92[_0x6edb('0x23')]=_0x10bdda;if(_0x3502c1[_0x6edb('0x37')][_0x6edb('0x46')]){_0x5800a1[_0x6edb('0x47')]=[{'all':!![]}];}return db[_0x6edb('0x32')][_0x6edb('0x48')](_0x5800a1);})['then'](function(_0x402c9c){_0x38fa92['rows']=_0x402c9c;return _0x38fa92;})[_0x6edb('0x29')](respondWithFilteredResult(_0x22a175,_0x5800a1))[_0x6edb('0x49')](handleError(_0x22a175,null));};exports[_0x6edb('0x4a')]=function(_0x55d98f,_0x1434b8){var _0x8678e1={'raw':!![],'where':{'id':_0x55d98f[_0x6edb('0x4b')]['id']}},_0xef116e={};_0xef116e[_0x6edb('0x3a')]=_[_0x6edb('0x4c')](db[_0x6edb('0x32')][_0x6edb('0x33')]);_0xef116e[_0x6edb('0x37')]=_[_0x6edb('0x4c')](_0x55d98f['query']);_0xef116e[_0x6edb('0x38')]=_[_0x6edb('0x39')](_0xef116e[_0x6edb('0x3a')],_0xef116e[_0x6edb('0x37')]);_0x8678e1[_0x6edb('0x3b')]=_[_0x6edb('0x39')](_0xef116e[_0x6edb('0x3a')],qs[_0x6edb('0x3c')](_0x55d98f[_0x6edb('0x37')][_0x6edb('0x3c')]));_0x8678e1['attributes']=_0x8678e1[_0x6edb('0x3b')]['length']?_0x8678e1[_0x6edb('0x3b')]:_0xef116e['model'];if(_0x55d98f['query'][_0x6edb('0x46')]){_0x8678e1[_0x6edb('0x47')]=[{'all':!![]}];}_0x8678e1=_['merge']({},_0x8678e1,_0x55d98f[_0x6edb('0x45')]);return db[_0x6edb('0x32')][_0x6edb('0x4d')](_0x8678e1)['then'](handleEntityNotFound(_0x1434b8,null))[_0x6edb('0x29')](respondWithResult(_0x1434b8,null))['catch'](handleError(_0x1434b8,null));};exports['create']=function(_0x1f69ae,_0x9733c5){return db['WhatsappQueue']['create'](_0x1f69ae[_0x6edb('0x4e')],{})[_0x6edb('0x29')](function(_0x5a3e88){var _0x5607d6=_0x1f69ae[_0x6edb('0x4f')][_0x6edb('0x2b')]({'plain':!![]});if(!_0x5607d6)throw new Error(_0x6edb('0x50'));if(_0x5607d6['role']===_0x6edb('0x4f')){var _0xfb103f=_0x5a3e88[_0x6edb('0x2b')]({'plain':!![]});var _0x4e789d=_0x6edb('0x2c');return db[_0x6edb('0x51')][_0x6edb('0x4d')]({'where':{'name':_0x4e789d,'userProfileId':_0x5607d6[_0x6edb('0x52')]},'raw':!![]})['then'](function(_0x5ee92a){if(_0x5ee92a&&_0x5ee92a[_0x6edb('0x53')]===0x0){return db[_0x6edb('0x2d')]['create']({'name':_0xfb103f[_0x6edb('0x2f')],'resourceId':_0xfb103f['id'],'type':_0x5ee92a[_0x6edb('0x2f')],'sectionId':_0x5ee92a['id']},{})[_0x6edb('0x29')](function(){return _0x5a3e88;});}else{return _0x5a3e88;}})[_0x6edb('0x49')](function(_0x55b4cc){logger[_0x6edb('0x54')](_0x6edb('0x55'),_0x55b4cc);throw _0x55b4cc;});}return _0x5a3e88;})['then'](respondWithResult(_0x9733c5,0xc9))[_0x6edb('0x49')](handleError(_0x9733c5,null));};exports[_0x6edb('0x56')]=function(_0x145822,_0x1fa0d7){if(_0x145822['body']['id']){delete _0x145822[_0x6edb('0x4e')]['id'];}return db[_0x6edb('0x32')][_0x6edb('0x4d')]({'where':{'id':_0x145822['params']['id']}})[_0x6edb('0x29')](handleEntityNotFound(_0x1fa0d7,null))[_0x6edb('0x29')](saveUpdates(_0x145822['body'],null))[_0x6edb('0x29')](respondWithResult(_0x1fa0d7,null))[_0x6edb('0x49')](handleError(_0x1fa0d7,null));};exports[_0x6edb('0x2a')]=function(_0x4c62f3,_0x5f01e5){return db[_0x6edb('0x32')][_0x6edb('0x4d')]({'where':{'id':_0x4c62f3[_0x6edb('0x4b')]['id']}})[_0x6edb('0x29')](handleEntityNotFound(_0x5f01e5,null))[_0x6edb('0x29')](removeEntity(_0x5f01e5,null))[_0x6edb('0x49')](handleError(_0x5f01e5,null));};exports[_0x6edb('0x57')]=function(_0x5d1f77,_0xcc9a8a){return db['WhatsappQueue'][_0x6edb('0x57')]()[_0x6edb('0x29')](respondWithResult(_0xcc9a8a,null))[_0x6edb('0x49')](handleError(_0xcc9a8a,null));};exports['getMembers']=function(_0x4f89b8,_0x1db734,_0x2a326e){var _0x340acc={'raw':!![],'where':{}},_0x5f5742={},_0x3850c9;return db[_0x6edb('0x32')]['findOne']({'where':{'id':_0x4f89b8['params']['id']}})[_0x6edb('0x29')](handleEntityNotFound(_0x1db734,null))[_0x6edb('0x29')](function(_0x23f982){if(_0x23f982){_0x3850c9=_0x23f982[_0x6edb('0x2b')]({'plain':!![]});_0x5f5742[_0x6edb('0x3a')]=_[_0x6edb('0x4c')](db[_0x6edb('0x58')][_0x6edb('0x33')]);_0x5f5742[_0x6edb('0x37')]=_[_0x6edb('0x4c')](_0x4f89b8[_0x6edb('0x37')]);_0x5f5742['filters']=_[_0x6edb('0x39')](_0x5f5742['model'],_0x5f5742['query']);_0x340acc[_0x6edb('0x3b')]=_[_0x6edb('0x39')](_0x5f5742[_0x6edb('0x3a')],qs[_0x6edb('0x3c')](_0x4f89b8['query']['fields']));_0x340acc[_0x6edb('0x3b')]=_0x340acc[_0x6edb('0x3b')][_0x6edb('0x59')]?_0x340acc['attributes']:_0x5f5742[_0x6edb('0x3a')];if(!_0x4f89b8[_0x6edb('0x37')][_0x6edb('0x3d')](_0x6edb('0x3e'))){_0x340acc[_0x6edb('0x22')]=qs['limit'](_0x4f89b8[_0x6edb('0x37')]['limit']);_0x340acc[_0x6edb('0x20')]=qs[_0x6edb('0x20')](_0x4f89b8[_0x6edb('0x37')][_0x6edb('0x20')]);}_0x340acc['order']=qs[_0x6edb('0x40')](_0x4f89b8[_0x6edb('0x37')][_0x6edb('0x40')]);_0x340acc[_0x6edb('0x41')]=qs[_0x6edb('0x38')](_['pick'](_0x4f89b8[_0x6edb('0x37')],_0x5f5742[_0x6edb('0x38')]));_0x340acc[_0x6edb('0x41')][_0x6edb('0x5a')]=_0x23f982['id'];if(_0x4f89b8[_0x6edb('0x37')][_0x6edb('0x43')]){_0x340acc[_0x6edb('0x41')]=_['merge'](_0x340acc['where'],{'$or':_['map'](_0x340acc[_0x6edb('0x3b')],function(_0x58c427){var _0x420db0={};_0x420db0[_0x58c427]={'$like':'%'+_0x4f89b8[_0x6edb('0x37')][_0x6edb('0x43')]+'%'};return _0x420db0;})});}_0x340acc=_[_0x6edb('0x44')]({},_0x340acc,_0x4f89b8[_0x6edb('0x45')]);return db[_0x6edb('0x58')][_0x6edb('0x48')](_0x340acc);}})[_0x6edb('0x29')](function(_0x4e980e){if(_0x4e980e){return db[_0x6edb('0x5b')][_0x6edb('0x5c')]({'where':{'id':_[_0x6edb('0x31')](_0x4e980e,_0x6edb('0x5d')),'role':_0x6edb('0x5e')},'attributes':['id',_0x6edb('0x2f'),_0x6edb('0x5f'),_0x6edb('0x60'),_0x6edb('0x61')]});}})[_0x6edb('0x29')](function(_0x518ee5){if(_0x518ee5){return{'count':_0x518ee5['count'],'rows':_[_0x6edb('0x31')](_0x518ee5[_0x6edb('0x62')],function(_0x55b149){return{'membername':_0x55b149[_0x6edb('0x2f')],'UserId':_0x55b149['id'],'queue_name':_0x3850c9[_0x6edb('0x2f')],'WhatsappQueueId':_0x3850c9['id'],'interface':util[_0x6edb('0x63')](_0x6edb('0x64'),'SIP',_0x55b149['name']),'penalty':0x0,'paused':_0x55b149[_0x6edb('0x5f')],'createdAt':_0x55b149[_0x6edb('0x61')],'updatedAt':_0x55b149['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6edb('0x29')](respondWithFilteredResult(_0x1db734,_0x340acc))[_0x6edb('0x49')](handleError(_0x1db734,null));};exports['getTeams']=function(_0x150a6d,_0xdf42e2,_0x141b02){var _0x1575c1={};var _0x5b05b7={};var _0x56bfd6;var _0x278afe;return db['WhatsappQueue'][_0x6edb('0x65')]({'where':{'id':_0x150a6d[_0x6edb('0x4b')]['id']}})[_0x6edb('0x29')](handleEntityNotFound(_0xdf42e2,null))['then'](function(_0x32c3e0){if(_0x32c3e0){_0x56bfd6=_0x32c3e0;_0x5b05b7['model']=_[_0x6edb('0x4c')](db['Team'][_0x6edb('0x33')]);_0x5b05b7['query']=_['keys'](_0x150a6d[_0x6edb('0x37')]);_0x5b05b7[_0x6edb('0x38')]=_[_0x6edb('0x39')](_0x5b05b7[_0x6edb('0x3a')],_0x5b05b7[_0x6edb('0x37')]);_0x1575c1[_0x6edb('0x3b')]=_[_0x6edb('0x39')](_0x5b05b7[_0x6edb('0x3a')],qs[_0x6edb('0x3c')](_0x150a6d['query'][_0x6edb('0x3c')]));_0x1575c1[_0x6edb('0x3b')]=_0x1575c1[_0x6edb('0x3b')][_0x6edb('0x59')]?_0x1575c1[_0x6edb('0x3b')]:_0x5b05b7[_0x6edb('0x3a')];_0x1575c1[_0x6edb('0x3f')]=qs['sort'](_0x150a6d[_0x6edb('0x37')][_0x6edb('0x40')]);_0x1575c1['where']=qs[_0x6edb('0x38')](_[_0x6edb('0x42')](_0x150a6d[_0x6edb('0x37')],_0x5b05b7[_0x6edb('0x38')]));if(_0x150a6d['query'][_0x6edb('0x43')]){_0x1575c1[_0x6edb('0x41')]=_[_0x6edb('0x44')](_0x1575c1['where'],{'$or':_[_0x6edb('0x31')](_0x1575c1['attributes'],function(_0x15a6fa){var _0x522f1e={};_0x522f1e[_0x15a6fa]={'$like':'%'+_0x150a6d[_0x6edb('0x37')]['filter']+'%'};return _0x522f1e;})});}_0x1575c1=_[_0x6edb('0x44')]({},_0x1575c1,_0x150a6d['options']);return _0x56bfd6[_0x6edb('0x66')](_0x1575c1);}})['then'](function(_0x713333){if(_0x713333){_0x278afe=_0x713333[_0x6edb('0x59')];if(!_0x150a6d[_0x6edb('0x37')][_0x6edb('0x3d')]('nolimit')){_0x1575c1[_0x6edb('0x22')]=qs[_0x6edb('0x22')](_0x150a6d[_0x6edb('0x37')][_0x6edb('0x22')]);_0x1575c1[_0x6edb('0x20')]=qs[_0x6edb('0x20')](_0x150a6d[_0x6edb('0x37')][_0x6edb('0x20')]);}return _0x56bfd6['getTeams'](_0x1575c1);}})[_0x6edb('0x29')](function(_0x4433da){if(_0x4433da){return _0x4433da?{'count':_0x278afe,'rows':_0x4433da}:null;}})[_0x6edb('0x29')](respondWithResult(_0xdf42e2,null))[_0x6edb('0x49')](handleError(_0xdf42e2,null));};exports[_0x6edb('0x67')]=function(_0x3553ee,_0x1f0fa5,_0x22f3a8){var _0x70afa4=_0x3553ee['body'][_0x6edb('0x68')];return db['Team'][_0x6edb('0x48')]({'where':{'id':_0x70afa4},'attributes':['id'],'include':[{'model':db[_0x6edb('0x5b')],'as':_0x6edb('0x69'),'attributes':['id',_0x6edb('0x2f'),_0x6edb('0x6a'),'voicePause','interface'],'raw':!![]}]})[_0x6edb('0x29')](function(_0x34427a){if(_0x34427a){var _0x3feea1=_['flatMap'](_0x34427a,function(_0x21c3ed){var _0x398574=_0x21c3ed[_0x6edb('0x2b')]({'plain':!![]});return _0x398574[_0x6edb('0x69')];});return db[_0x6edb('0x32')]['find']({'where':{'id':_0x3553ee[_0x6edb('0x4b')]['id']}})[_0x6edb('0x29')](function(_0x357aba){return db['sequelize']['transaction'](function(_0x4cbf86){return _0x357aba[_0x6edb('0x67')](_0x70afa4,{'transaction':_0x4cbf86})['then'](function(){return BPromise[_0x6edb('0x6b')](_0x3feea1,function(_0x466e6d){return db[_0x6edb('0x58')]['findOrCreate']({'where':{'UserId':_0x466e6d['id'],'WhatsappQueueId':_0x3553ee[_0x6edb('0x4b')]['id']},'transaction':_0x4cbf86});});})[_0x6edb('0x29')](function(){_0x3feea1[_0x6edb('0x6c')](function(_0x13719b){socket[_0x6edb('0x6d')](_0x6edb('0x6e'),{'UserId':_0x13719b['id'],'WhatsappQueueId':_0x357aba['id']});});});});});}})[_0x6edb('0x29')](respondWithStatusCode(_0x1f0fa5,null))[_0x6edb('0x49')](handleError(_0x1f0fa5,null));};exports[_0x6edb('0x6f')]=function(_0x2a8412,_0x1ad56c,_0x8d8692){return db[_0x6edb('0x70')][_0x6edb('0x48')]({'where':{'id':_0x2a8412['query'][_0x6edb('0x68')]},'attributes':['id'],'include':[{'model':db[_0x6edb('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1ad56c,null))[_0x6edb('0x29')](function(_0x4bb710){var _0x525b59=_[_0x6edb('0x31')](_0x4bb710,'id');var _0x15d437=[];var _0x510262=[];var _0x44cda4=squel['select']();_0x44cda4['field'](_0x6edb('0x71'))[_0x6edb('0x72')](_0x6edb('0x73'),'tq')[_0x6edb('0x74')](_0x6edb('0x75'),'ut',_0x6edb('0x76'))[_0x6edb('0x41')]('WhatsappQueueId\x20=\x20?',_0x2a8412[_0x6edb('0x4b')]['id']);for(var _0x2e16a8=0x0;_0x2e16a8<_0x4bb710[_0x6edb('0x59')];_0x2e16a8+=0x1){let _0x95676=_0x4bb710[_0x2e16a8];for(var _0x5774fd=0x0;_0x5774fd<_0x95676[_0x6edb('0x69')][_0x6edb('0x59')];_0x5774fd+=0x1){let _0x460877=_0x95676[_0x6edb('0x69')][_0x5774fd];var _0x33a095=_0x44cda4[_0x6edb('0x77')]();_0x33a095['where'](_0x6edb('0x78'),_0x460877['id']);_0x510262[_0x6edb('0x79')](db[_0x6edb('0x7a')][_0x6edb('0x37')](_0x33a095['toString'](),{'type':db[_0x6edb('0x7a')][_0x6edb('0x7b')][_0x6edb('0x7c')]})['then'](function(_0x2ed991){if(_0x2ed991['length']===0x1){return _0x460877['id'];}else{var _0x358d64=_[_0x6edb('0x7d')](_[_0x6edb('0x31')](_0x2ed991,_0x6edb('0x7e')),function(_0x390be4){return _[_0x6edb('0x7f')](_0x525b59,_0x390be4);});if(_0x358d64){return _0x460877['id'];}}}));}}return BPromise[_0x6edb('0x80')](_0x510262)[_0x6edb('0x29')](function(_0x2b8ac1){_0x15d437=_(_0x15d437)['union'](_0x2b8ac1)['compact']()['value']();return db['WhatsappQueue']['find']({'where':{'id':_0x2a8412[_0x6edb('0x4b')]['id']}})[_0x6edb('0x29')](function(_0x862d9b){return db[_0x6edb('0x7a')][_0x6edb('0x81')](function(_0x3cf1d5){return _0x862d9b[_0x6edb('0x6f')](_0x2a8412[_0x6edb('0x37')][_0x6edb('0x68')],{'transaction':_0x3cf1d5})['then'](function(){if(!_[_0x6edb('0x82')](_0x15d437)){return _0x862d9b[_0x6edb('0x83')](_0x15d437,{'transaction':_0x3cf1d5});}})[_0x6edb('0x29')](function(){_0x15d437[_0x6edb('0x6c')](function(_0x569381){socket[_0x6edb('0x6d')]('userWhatsappQueue:remove',{'UserId':_0x569381,'WhatsappQueueId':_0x862d9b['id']});});});});});});})['then'](respondWithStatusCode(_0x1ad56c,null))[_0x6edb('0x49')](handleError(_0x1ad56c,null));};exports[_0x6edb('0x84')]=function(_0x486772,_0x42c0ff,_0x5714c6){return db[_0x6edb('0x32')][_0x6edb('0x4d')]({'where':{'id':_0x486772[_0x6edb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x42c0ff,null))['then'](function(_0x14dc69){if(_0x14dc69){return _0x14dc69[_0x6edb('0x84')](_0x486772['body']['ids'],_[_0x6edb('0x85')](_0x486772[_0x6edb('0x4e')],[_0x6edb('0x68'),'id'])||{})[_0x6edb('0x86')](function(_0x5e4324){for(var _0x30754f=0x0;_0x30754f<_0x486772[_0x6edb('0x4e')][_0x6edb('0x68')][_0x6edb('0x59')];_0x30754f+=0x1){socket['emit'](_0x6edb('0x6e'),{'UserId':Number(_0x486772[_0x6edb('0x4e')][_0x6edb('0x68')][_0x30754f]),'WhatsappQueueId':Number(_0x486772[_0x6edb('0x4b')]['id'])});}return _0x5e4324;});}})[_0x6edb('0x29')](respondWithResult(_0x42c0ff,null))[_0x6edb('0x49')](handleError(_0x42c0ff,null));};exports[_0x6edb('0x83')]=function(_0x1b0788,_0x925ce2,_0x554c10){return db[_0x6edb('0x32')][_0x6edb('0x4d')]({'where':{'id':_0x1b0788[_0x6edb('0x4b')]['id']}})[_0x6edb('0x29')](handleEntityNotFound(_0x925ce2,null))[_0x6edb('0x29')](function(_0x4144e8){if(_0x4144e8){return _0x4144e8[_0x6edb('0x83')](_0x1b0788[_0x6edb('0x37')]['ids'])[_0x6edb('0x29')](function(){if(_[_0x6edb('0x87')](_0x1b0788[_0x6edb('0x37')][_0x6edb('0x68')])){for(var _0x26a63a=0x0;_0x26a63a<_0x1b0788[_0x6edb('0x37')][_0x6edb('0x68')][_0x6edb('0x59')];_0x26a63a+=0x1){socket[_0x6edb('0x6d')]('userWhatsappQueue:remove',{'UserId':Number(_0x1b0788['query'][_0x6edb('0x68')][_0x26a63a]),'WhatsappQueueId':Number(_0x1b0788['params']['id'])});}}else{socket[_0x6edb('0x6d')]('userWhatsappQueue:remove',{'UserId':Number(_0x1b0788[_0x6edb('0x37')]['ids']),'WhatsappQueueId':Number(_0x1b0788[_0x6edb('0x4b')]['id'])});}});}})[_0x6edb('0x29')](respondWithStatusCode(_0x925ce2,null))[_0x6edb('0x49')](handleError(_0x925ce2,null));};exports[_0x6edb('0x88')]=function(_0x2e6ea9,_0x419b19,_0x160c66){var _0x4cece4={};var _0x42a6e2={};var _0x459bd6;var _0x4c83eb;return db['WhatsappQueue'][_0x6edb('0x65')]({'where':{'id':_0x2e6ea9[_0x6edb('0x4b')]['id']}})[_0x6edb('0x29')](handleEntityNotFound(_0x419b19,null))[_0x6edb('0x29')](function(_0x382e26){if(_0x382e26){_0x459bd6=_0x382e26;_0x42a6e2[_0x6edb('0x3a')]=_[_0x6edb('0x4c')](db[_0x6edb('0x5b')]['rawAttributes']);_0x42a6e2[_0x6edb('0x37')]=_[_0x6edb('0x4c')](_0x2e6ea9[_0x6edb('0x37')]);_0x42a6e2[_0x6edb('0x38')]=_['intersection'](_0x42a6e2[_0x6edb('0x3a')],_0x42a6e2[_0x6edb('0x37')]);_0x4cece4[_0x6edb('0x3b')]=_[_0x6edb('0x39')](_0x42a6e2[_0x6edb('0x3a')],qs[_0x6edb('0x3c')](_0x2e6ea9['query'][_0x6edb('0x3c')]));_0x4cece4[_0x6edb('0x3b')]=_0x4cece4[_0x6edb('0x3b')][_0x6edb('0x59')]?_0x4cece4[_0x6edb('0x3b')]:_0x42a6e2['model'];_0x4cece4['order']=qs[_0x6edb('0x40')](_0x2e6ea9[_0x6edb('0x37')][_0x6edb('0x40')]);_0x4cece4[_0x6edb('0x41')]=qs[_0x6edb('0x38')](_[_0x6edb('0x42')](_0x2e6ea9[_0x6edb('0x37')],_0x42a6e2[_0x6edb('0x38')]));if(_0x2e6ea9[_0x6edb('0x37')][_0x6edb('0x43')]){_0x4cece4[_0x6edb('0x41')]=_[_0x6edb('0x44')](_0x4cece4[_0x6edb('0x41')],{'$or':_[_0x6edb('0x31')](_0x4cece4[_0x6edb('0x3b')],function(_0x580bfe){var _0x3ee83b={};_0x3ee83b[_0x580bfe]={'$like':'%'+_0x2e6ea9[_0x6edb('0x37')]['filter']+'%'};return _0x3ee83b;})});}_0x4cece4=_[_0x6edb('0x44')]({},_0x4cece4,_0x2e6ea9[_0x6edb('0x45')]);return _0x459bd6['getAgents'](_0x4cece4);}})['then'](function(_0xf22bad){if(_0xf22bad){_0x4c83eb=_0xf22bad[_0x6edb('0x59')];if(!_0x2e6ea9['query']['hasOwnProperty']('nolimit')){_0x4cece4['limit']=qs[_0x6edb('0x22')](_0x2e6ea9[_0x6edb('0x37')][_0x6edb('0x22')]);_0x4cece4[_0x6edb('0x20')]=qs[_0x6edb('0x20')](_0x2e6ea9[_0x6edb('0x37')]['offset']);}return _0x459bd6['getAgents'](_0x4cece4);}})[_0x6edb('0x29')](function(_0x3ecb73){if(_0x3ecb73){return _0x3ecb73?{'count':_0x4c83eb,'rows':_0x3ecb73}:null;}})[_0x6edb('0x29')](respondWithResult(_0x419b19,null))[_0x6edb('0x49')](handleError(_0x419b19,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 0dd4561..770b7d0 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 _0x56fe=['exports','events','../../mysqldb','WhatsappQueue','save','remove','emit','hasOwnProperty'];(function(_0x383c39,_0x50ba92){var _0x57515b=function(_0x55a0ab){while(--_0x55a0ab){_0x383c39['push'](_0x383c39['shift']());}};_0x57515b(++_0x50ba92);}(_0x56fe,0x191));var _0xe56f=function(_0x631f6,_0x17acf5){_0x631f6=_0x631f6-0x0;var _0x37ce01=_0x56fe[_0x631f6];return _0x37ce01;};'use strict';var EventEmitter=require(_0xe56f('0x0'));var WhatsappQueue=require(_0xe56f('0x1'))['db'][_0xe56f('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe56f('0x3'),'afterUpdate':'update','afterDestroy':_0xe56f('0x4')};function emitEvent(_0x5c09ae){return function(_0x5b9db5,_0x4d6b90,_0x411d6e){WhatsappQueueEvents['emit'](_0x5c09ae+':'+_0x5b9db5['id'],_0x5b9db5);WhatsappQueueEvents[_0xe56f('0x5')](_0x5c09ae,_0x5b9db5);_0x411d6e(null);};}for(var e in events){if(events[_0xe56f('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xe56f('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0xdd0b=['emit','hasOwnProperty','hook','../../mysqldb','WhatsappQueue','save','update'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdd0b,0x106));var _0xbdd0=function(_0x3fbf62,_0x323aef){_0x3fbf62=_0x3fbf62-0x0;var _0x669f5=_0xdd0b[_0x3fbf62];return _0x669f5;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xbdd0('0x0'))['db'][_0xbdd0('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbdd0('0x2'),'afterUpdate':_0xbdd0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x50899a){return function(_0x344705,_0x572ea8,_0x50e28a){WhatsappQueueEvents[_0xbdd0('0x4')](_0x50899a+':'+_0x344705['id'],_0x344705);WhatsappQueueEvents[_0xbdd0('0x4')](_0x50899a,_0x344705);_0x50e28a(null);};}for(var e in events){if(events[_0xbdd0('0x5')](e)){var event=events[e];WhatsappQueue[_0xbdd0('0x6')](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 8756d86..cff4ee7 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 _0x5025=['./whatsappQueue.attributes','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2f41dd,_0x5bd3a1){var _0x3b377d=function(_0x3bd677){while(--_0x3bd677){_0x2f41dd['push'](_0x2f41dd['shift']());}};_0x3b377d(++_0x5bd3a1);}(_0x5025,0x1d1));var _0x5502=function(_0x4e566c,_0x16e04c){_0x4e566c=_0x4e566c-0x0;var _0x31947e=_0x5025[_0x4e566c];return _0x31947e;};'use strict';var _=require(_0x5502('0x0'));var util=require(_0x5502('0x1'));var logger=require(_0x5502('0x2'))(_0x5502('0x3'));var moment=require('moment');var BPromise=require(_0x5502('0x4'));var rp=require(_0x5502('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5502('0x6'));var config=require(_0x5502('0x7'));var attributes=require(_0x5502('0x8'));module['exports']=function(_0x157737,_0x1aaaae){return _0x157737['define'](_0x5502('0x9'),attributes,{'tableName':_0x5502('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x36f2=['exports','define','WhatsappQueue','whatsapp_queues','lodash','../../config/logger','api','moment','request-promise','../../config/environment','./whatsappQueue.attributes'];(function(_0x48f791,_0x57dbd7){var _0x5ec5ea=function(_0x1b8718){while(--_0x1b8718){_0x48f791['push'](_0x48f791['shift']());}};_0x5ec5ea(++_0x57dbd7);}(_0x36f2,0x159));var _0x236f=function(_0x4cee49,_0x5b5316){_0x4cee49=_0x4cee49-0x0;var _0x57de24=_0x36f2[_0x4cee49];return _0x57de24;};'use strict';var _=require(_0x236f('0x0'));var util=require('util');var logger=require(_0x236f('0x1'))(_0x236f('0x2'));var moment=require(_0x236f('0x3'));var BPromise=require('bluebird');var rp=require(_0x236f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x236f('0x5'));var attributes=require(_0x236f('0x6'));module[_0x236f('0x7')]=function(_0x1562b6,_0x2f5945){return _0x1562b6[_0x236f('0x8')](_0x236f('0x9'),attributes,{'tableName':_0x236f('0xa'),'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 b48c315..22d1898 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 _0x1e34=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','request','request\x20sent','stringify','code','error','WhatsappQueue,\x20%s,\x20%s','message','info','result','catch','GetWhatsappQueue','findAll','options','raw','where','attributes','include','map','model','debug','ShowWhatsappQueue','WhatsappQueue','then','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x359af5,_0x2db18d){var _0x2218ee=function(_0x125f9d){while(--_0x125f9d){_0x359af5['push'](_0x359af5['shift']());}};_0x2218ee(++_0x2db18d);}(_0x1e34,0x180));var _0x41e3=function(_0x414c4e,_0x418bda){_0x414c4e=_0x414c4e-0x0;var _0x31a0a6=_0x1e34[_0x414c4e];return _0x31a0a6;};'use strict';var _=require(_0x41e3('0x0'));var util=require(_0x41e3('0x1'));var moment=require(_0x41e3('0x2'));var BPromise=require(_0x41e3('0x3'));var rs=require(_0x41e3('0x4'));var fs=require('fs');var Redis=require(_0x41e3('0x5'));var db=require(_0x41e3('0x6'))['db'];var utils=require(_0x41e3('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x41e3('0x8'));var jayson=require(_0x41e3('0x9'));var client=jayson[_0x41e3('0xa')]['http']({'port':0x232a});config[_0x41e3('0xb')]=_[_0x41e3('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x41e3('0xd'))(new Redis(config[_0x41e3('0xb')]));require(_0x41e3('0xe'))[_0x41e3('0xf')](socket);function respondWithRpcPromise(_0x55649c,_0x532029,_0x20360e){return new BPromise(function(_0x58e9c5,_0x5eec8e){return client[_0x41e3('0x10')](_0x55649c,_0x20360e)['then'](function(_0x168946){logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x532029,_0x41e3('0x11'));logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x532029,'request\x20sent',JSON[_0x41e3('0x12')](_0x168946));if(_0x168946['error']){if(_0x168946['error'][_0x41e3('0x13')]===0x1f4){logger[_0x41e3('0x14')](_0x41e3('0x15'),_0x532029,_0x168946[_0x41e3('0x14')][_0x41e3('0x16')]);return _0x5eec8e(_0x168946[_0x41e3('0x14')][_0x41e3('0x16')]);}logger[_0x41e3('0x14')](_0x41e3('0x15'),_0x532029,_0x168946[_0x41e3('0x14')][_0x41e3('0x16')]);return _0x58e9c5(_0x168946[_0x41e3('0x14')][_0x41e3('0x16')]);}else{logger[_0x41e3('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x532029,_0x41e3('0x11'));_0x58e9c5(_0x168946[_0x41e3('0x18')]['message']);}})[_0x41e3('0x19')](function(_0x44d3b6){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x532029,_0x44d3b6);_0x5eec8e(_0x44d3b6);});});}exports[_0x41e3('0x1a')]=function(_0x4b32bb){var _0x3030a6=this;return new Promise(function(_0x23707f,_0x230145){return db['WhatsappQueue'][_0x41e3('0x1b')]({'raw':_0x4b32bb[_0x41e3('0x1c')]?_0x4b32bb[_0x41e3('0x1c')][_0x41e3('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b32bb[_0x41e3('0x1c')]?_0x4b32bb[_0x41e3('0x1c')][_0x41e3('0x1e')]||null:null,'attributes':_0x4b32bb[_0x41e3('0x1c')]?_0x4b32bb[_0x41e3('0x1c')][_0x41e3('0x1f')]||null:null,'limit':_0x4b32bb['options']?_0x4b32bb[_0x41e3('0x1c')]['limit']||null:null,'include':_0x4b32bb[_0x41e3('0x1c')]?_0x4b32bb['options'][_0x41e3('0x20')]?_[_0x41e3('0x21')](_0x4b32bb[_0x41e3('0x1c')]['include'],function(_0x1a83c5){return{'model':db[_0x1a83c5['model']],'as':_0x1a83c5['as'],'attributes':_0x1a83c5[_0x41e3('0x1f')],'include':_0x1a83c5[_0x41e3('0x20')]?_[_0x41e3('0x21')](_0x1a83c5[_0x41e3('0x20')],function(_0x566920){return{'model':db[_0x566920[_0x41e3('0x22')]],'as':_0x566920['as'],'attributes':_0x566920[_0x41e3('0x1f')],'include':_0x566920[_0x41e3('0x20')]?_[_0x41e3('0x21')](_0x566920[_0x41e3('0x20')],function(_0x1b90e2){return{'model':db[_0x1b90e2[_0x41e3('0x22')]],'as':_0x1b90e2['as'],'attributes':_0x1b90e2[_0x41e3('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59936c){logger[_0x41e3('0x17')](_0x41e3('0x1a'),_0x4b32bb);logger[_0x41e3('0x23')](_0x41e3('0x1a'),_0x4b32bb,JSON[_0x41e3('0x12')](_0x59936c));_0x23707f(_0x59936c);})[_0x41e3('0x19')](function(_0x5d550b){logger['error'](_0x41e3('0x1a'),_0x5d550b[_0x41e3('0x16')],_0x4b32bb);_0x230145(_0x3030a6['error'](0x1f4,_0x5d550b['message']));});});};exports[_0x41e3('0x24')]=function(_0x564edd){var _0x49a955=this;return new Promise(function(_0x3921e6,_0x3cf5f7){return db[_0x41e3('0x25')]['find']({'raw':_0x564edd[_0x41e3('0x1c')]?_0x564edd[_0x41e3('0x1c')][_0x41e3('0x1d')]===undefined?!![]:![]:!![],'where':_0x564edd[_0x41e3('0x1c')]?_0x564edd['options'][_0x41e3('0x1e')]||null:null,'attributes':_0x564edd[_0x41e3('0x1c')]?_0x564edd[_0x41e3('0x1c')]['attributes']||null:null,'include':_0x564edd[_0x41e3('0x1c')]?_0x564edd[_0x41e3('0x1c')][_0x41e3('0x20')]?_['map'](_0x564edd[_0x41e3('0x1c')][_0x41e3('0x20')],function(_0x1b7468){return{'model':db[_0x1b7468[_0x41e3('0x22')]],'as':_0x1b7468['as'],'attributes':_0x1b7468[_0x41e3('0x1f')],'include':_0x1b7468[_0x41e3('0x20')]?_[_0x41e3('0x21')](_0x1b7468['include'],function(_0x10ca16){return{'model':db[_0x10ca16[_0x41e3('0x22')]],'as':_0x10ca16['as'],'attributes':_0x10ca16[_0x41e3('0x1f')],'include':_0x10ca16['include']?_[_0x41e3('0x21')](_0x10ca16[_0x41e3('0x20')],function(_0x539737){return{'model':db[_0x539737[_0x41e3('0x22')]],'as':_0x539737['as'],'attributes':_0x539737['attributes']};}):[]};}):[]};}):[]:[]})[_0x41e3('0x26')](function(_0x101816){logger[_0x41e3('0x17')](_0x41e3('0x24'),_0x564edd);logger[_0x41e3('0x23')]('ShowWhatsappQueue',_0x564edd,JSON[_0x41e3('0x12')](_0x101816));_0x3921e6(_0x101816);})[_0x41e3('0x19')](function(_0xebcd62){logger[_0x41e3('0x14')](_0x41e3('0x24'),_0xebcd62[_0x41e3('0x16')],_0x564edd);_0x3cf5f7(_0x49a955[_0x41e3('0x14')](0x1f4,_0xebcd62[_0x41e3('0x16')]));});});}; \ No newline at end of file +var _0x9b5a=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetWhatsappQueue','WhatsappQueue','options','raw','where','attributes','limit','include','map','model','catch','ShowWhatsappQueue','find','stringify','lodash','util'];(function(_0x425ed1,_0x34856f){var _0x151d21=function(_0x463387){while(--_0x463387){_0x425ed1['push'](_0x425ed1['shift']());}};_0x151d21(++_0x34856f);}(_0x9b5a,0x1de));var _0xa9b5=function(_0x1be231,_0x17ee4b){_0x1be231=_0x1be231-0x0;var _0x5309ff=_0x9b5a[_0x1be231];return _0x5309ff;};'use strict';var _=require(_0xa9b5('0x0'));var util=require(_0xa9b5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa9b5('0x2'));var fs=require('fs');var Redis=require(_0xa9b5('0x3'));var db=require(_0xa9b5('0x4'))['db'];var utils=require(_0xa9b5('0x5'));var logger=require('../../config/logger')(_0xa9b5('0x6'));var config=require(_0xa9b5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa9b5('0x8')][_0xa9b5('0x9')]({'port':0x232a});config[_0xa9b5('0xa')]=_[_0xa9b5('0xb')](config[_0xa9b5('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa9b5('0xc'))(new Redis(config['redis']));require(_0xa9b5('0xd'))[_0xa9b5('0xe')](socket);function respondWithRpcPromise(_0x571768,_0x57603e,_0x362935){return new BPromise(function(_0x56fdcd,_0x4686c2){return client[_0xa9b5('0xf')](_0x571768,_0x362935)[_0xa9b5('0x10')](function(_0x53a1e9){logger[_0xa9b5('0x11')](_0xa9b5('0x12'),_0x57603e,_0xa9b5('0x13'));logger[_0xa9b5('0x14')](_0xa9b5('0x15'),_0x57603e,_0xa9b5('0x13'),JSON['stringify'](_0x53a1e9));if(_0x53a1e9[_0xa9b5('0x16')]){if(_0x53a1e9[_0xa9b5('0x16')][_0xa9b5('0x17')]===0x1f4){logger[_0xa9b5('0x16')](_0xa9b5('0x12'),_0x57603e,_0x53a1e9[_0xa9b5('0x16')][_0xa9b5('0x18')]);return _0x4686c2(_0x53a1e9[_0xa9b5('0x16')][_0xa9b5('0x18')]);}logger[_0xa9b5('0x16')](_0xa9b5('0x12'),_0x57603e,_0x53a1e9[_0xa9b5('0x16')]['message']);return _0x56fdcd(_0x53a1e9[_0xa9b5('0x16')][_0xa9b5('0x18')]);}else{logger['info'](_0xa9b5('0x12'),_0x57603e,_0xa9b5('0x13'));_0x56fdcd(_0x53a1e9[_0xa9b5('0x19')][_0xa9b5('0x18')]);}})['catch'](function(_0x44d40d){logger[_0xa9b5('0x16')](_0xa9b5('0x12'),_0x57603e,_0x44d40d);_0x4686c2(_0x44d40d);});});}exports[_0xa9b5('0x1a')]=function(_0xacfbc1){var _0x235f4a=this;return new Promise(function(_0x55268c,_0x12d914){return db[_0xa9b5('0x1b')]['findAll']({'raw':_0xacfbc1['options']?_0xacfbc1[_0xa9b5('0x1c')][_0xa9b5('0x1d')]===undefined?!![]:![]:!![],'where':_0xacfbc1[_0xa9b5('0x1c')]?_0xacfbc1[_0xa9b5('0x1c')][_0xa9b5('0x1e')]||null:null,'attributes':_0xacfbc1[_0xa9b5('0x1c')]?_0xacfbc1[_0xa9b5('0x1c')][_0xa9b5('0x1f')]||null:null,'limit':_0xacfbc1[_0xa9b5('0x1c')]?_0xacfbc1[_0xa9b5('0x1c')][_0xa9b5('0x20')]||null:null,'include':_0xacfbc1[_0xa9b5('0x1c')]?_0xacfbc1['options'][_0xa9b5('0x21')]?_[_0xa9b5('0x22')](_0xacfbc1['options'][_0xa9b5('0x21')],function(_0x5ed93f){return{'model':db[_0x5ed93f['model']],'as':_0x5ed93f['as'],'attributes':_0x5ed93f[_0xa9b5('0x1f')],'include':_0x5ed93f[_0xa9b5('0x21')]?_['map'](_0x5ed93f['include'],function(_0x4e38d9){return{'model':db[_0x4e38d9[_0xa9b5('0x23')]],'as':_0x4e38d9['as'],'attributes':_0x4e38d9[_0xa9b5('0x1f')],'include':_0x4e38d9[_0xa9b5('0x21')]?_[_0xa9b5('0x22')](_0x4e38d9[_0xa9b5('0x21')],function(_0x70aa31){return{'model':db[_0x70aa31[_0xa9b5('0x23')]],'as':_0x70aa31['as'],'attributes':_0x70aa31[_0xa9b5('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2bb1d3){logger[_0xa9b5('0x11')](_0xa9b5('0x1a'),_0xacfbc1);logger['debug'](_0xa9b5('0x1a'),_0xacfbc1,JSON['stringify'](_0x2bb1d3));_0x55268c(_0x2bb1d3);})[_0xa9b5('0x24')](function(_0x2a8b9c){logger[_0xa9b5('0x16')]('GetWhatsappQueue',_0x2a8b9c[_0xa9b5('0x18')],_0xacfbc1);_0x12d914(_0x235f4a[_0xa9b5('0x16')](0x1f4,_0x2a8b9c['message']));});});};exports[_0xa9b5('0x25')]=function(_0x200afe){var _0x502eb7=this;return new Promise(function(_0xccf62,_0x5cbe80){return db['WhatsappQueue'][_0xa9b5('0x26')]({'raw':_0x200afe[_0xa9b5('0x1c')]?_0x200afe[_0xa9b5('0x1c')][_0xa9b5('0x1d')]===undefined?!![]:![]:!![],'where':_0x200afe[_0xa9b5('0x1c')]?_0x200afe[_0xa9b5('0x1c')]['where']||null:null,'attributes':_0x200afe[_0xa9b5('0x1c')]?_0x200afe['options'][_0xa9b5('0x1f')]||null:null,'include':_0x200afe['options']?_0x200afe[_0xa9b5('0x1c')][_0xa9b5('0x21')]?_[_0xa9b5('0x22')](_0x200afe[_0xa9b5('0x1c')]['include'],function(_0x16d223){return{'model':db[_0x16d223['model']],'as':_0x16d223['as'],'attributes':_0x16d223['attributes'],'include':_0x16d223[_0xa9b5('0x21')]?_[_0xa9b5('0x22')](_0x16d223[_0xa9b5('0x21')],function(_0x426ba7){return{'model':db[_0x426ba7[_0xa9b5('0x23')]],'as':_0x426ba7['as'],'attributes':_0x426ba7[_0xa9b5('0x1f')],'include':_0x426ba7[_0xa9b5('0x21')]?_[_0xa9b5('0x22')](_0x426ba7[_0xa9b5('0x21')],function(_0x76aae7){return{'model':db[_0x76aae7[_0xa9b5('0x23')]],'as':_0x76aae7['as'],'attributes':_0x76aae7[_0xa9b5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa9b5('0x10')](function(_0x1c41eb){logger[_0xa9b5('0x11')]('ShowWhatsappQueue',_0x200afe);logger[_0xa9b5('0x14')](_0xa9b5('0x25'),_0x200afe,JSON[_0xa9b5('0x27')](_0x1c41eb));_0xccf62(_0x1c41eb);})[_0xa9b5('0x24')](function(_0xe492f8){logger[_0xa9b5('0x16')](_0xa9b5('0x25'),_0xe492f8[_0xa9b5('0x18')],_0x200afe);_0x5cbe80(_0x502eb7['error'](0x1f4,_0xe492f8['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 91484e2..f48f2b3 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 _0xbcb2=['update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save','remove'];(function(_0x4256d4,_0x1d4bee){var _0x484a33=function(_0x5f2031){while(--_0x5f2031){_0x4256d4['push'](_0x4256d4['shift']());}};_0x484a33(++_0x1d4bee);}(_0xbcb2,0x1ec));var _0x2bcb=function(_0x30959a,_0x368eb4){_0x30959a=_0x30959a-0x0;var _0x2d7d9e=_0xbcb2[_0x30959a];return _0x2d7d9e;};'use strict';var WhatsappQueueEvents=require(_0x2bcb('0x0'));var events=[_0x2bcb('0x1'),_0x2bcb('0x2'),_0x2bcb('0x3')];function createListener(_0x5e3b4a,_0x2f5258){return function(_0x1bc50e){_0x2f5258[_0x2bcb('0x4')](_0x5e3b4a,_0x1bc50e);};}function removeListener(_0xde43cc,_0x4db3b1){return function(){WhatsappQueueEvents[_0x2bcb('0x5')](_0xde43cc,_0x4db3b1);};}exports[_0x2bcb('0x6')]=function(_0x6cb982){for(var _0x1b0b2b=0x0,_0x1618a5=events[_0x2bcb('0x7')];_0x1b0b2b<_0x1618a5;_0x1b0b2b++){var _0x1f9ef1=events[_0x1b0b2b];var _0x14cb41=createListener(_0x2bcb('0x8')+_0x1f9ef1,_0x6cb982);WhatsappQueueEvents['on'](_0x1f9ef1,_0x14cb41);}}; \ No newline at end of file +var _0xbea2=['emit','removeListener','register','./whatsappQueue.events'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xbea2,0x167));var _0x2bea=function(_0x464cca,_0x2dc048){_0x464cca=_0x464cca-0x0;var _0x3ffc68=_0xbea2[_0x464cca];return _0x3ffc68;};'use strict';var WhatsappQueueEvents=require(_0x2bea('0x0'));var events=['save','remove','update'];function createListener(_0x486f62,_0x44adf9){return function(_0x8f0d86){_0x44adf9[_0x2bea('0x1')](_0x486f62,_0x8f0d86);};}function removeListener(_0x13d813,_0x393628){return function(){WhatsappQueueEvents[_0x2bea('0x2')](_0x13d813,_0x393628);};}exports[_0x2bea('0x3')]=function(_0x5385ac){for(var _0x4a4571=0x0,_0x2acb8d=events['length'];_0x4a4571<_0x2acb8d;_0x4a4571++){var _0x21cb81=events[_0x4a4571];var _0x50d38b=createListener('whatsappQueue:'+_0x21cb81,_0x5385ac);WhatsappQueueEvents['on'](_0x21cb81,_0x50d38b);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 61f0618..38eede6 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 _0x55f2=['../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0x43b06b,_0x1929c7){var _0x2c555b=function(_0x30fa8c){while(--_0x30fa8c){_0x43b06b['push'](_0x43b06b['shift']());}};_0x2c555b(++_0x1929c7);}(_0x55f2,0x117));var _0x255f=function(_0x1c1ccf,_0xd786bc){_0x1c1ccf=_0x1c1ccf-0x0;var _0x5a3dab=_0x55f2[_0x1c1ccf];return _0x5a3dab;};'use strict';var multer=require(_0x255f('0x0'));var util=require(_0x255f('0x1'));var path=require(_0x255f('0x2'));var timeout=require(_0x255f('0x3'));var express=require(_0x255f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x255f('0x5'));var config=require(_0x255f('0x6'));var controller=require(_0x255f('0x7'));router[_0x255f('0x8')]('/',auth[_0x255f('0x9')](),controller[_0x255f('0xa')]);router[_0x255f('0x8')](_0x255f('0xb'),auth[_0x255f('0x9')](),controller[_0x255f('0xc')]);router[_0x255f('0x8')](_0x255f('0xd'),auth[_0x255f('0x9')](),controller[_0x255f('0xe')]);router['post']('/',auth[_0x255f('0x9')](),controller['create']);router[_0x255f('0xf')](_0x255f('0xd'),auth[_0x255f('0x9')](),controller[_0x255f('0x10')]);router[_0x255f('0x11')](_0x255f('0xd'),auth[_0x255f('0x9')](),controller[_0x255f('0x12')]);module['exports']=router; \ No newline at end of file +var _0x0596=['isAuthenticated','index','/describe','show','post','put','update','delete','/:id','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappQueueReport.controller','get'];(function(_0xed26d8,_0x47de0e){var _0x5d3166=function(_0x1c05cb){while(--_0x1c05cb){_0xed26d8['push'](_0xed26d8['shift']());}};_0x5d3166(++_0x47de0e);}(_0x0596,0x171));var _0x6059=function(_0x352c35,_0x4d8372){_0x352c35=_0x352c35-0x0;var _0x3bfb40=_0x0596[_0x352c35];return _0x3bfb40;};'use strict';var multer=require('multer');var util=require(_0x6059('0x0'));var path=require(_0x6059('0x1'));var timeout=require(_0x6059('0x2'));var express=require(_0x6059('0x3'));var router=express[_0x6059('0x4')]();var fs_extra=require(_0x6059('0x5'));var auth=require(_0x6059('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6059('0x7'));router[_0x6059('0x8')]('/',auth[_0x6059('0x9')](),controller[_0x6059('0xa')]);router[_0x6059('0x8')](_0x6059('0xb'),auth[_0x6059('0x9')](),controller['describe']);router[_0x6059('0x8')]('/:id',auth[_0x6059('0x9')](),controller[_0x6059('0xc')]);router[_0x6059('0xd')]('/',auth[_0x6059('0x9')](),controller['create']);router[_0x6059('0xe')]('/:id',auth[_0x6059('0x9')](),controller[_0x6059('0xf')]);router[_0x6059('0x10')](_0x6059('0x11'),auth[_0x6059('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index e6f6a29..65148ea 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(_0x4b2ad8,_0x33f8d8){var _0x51c4f6=function(_0x332c70){while(--_0x332c70){_0x4b2ad8['push'](_0x4b2ad8['shift']());}};_0x51c4f6(++_0x33f8d8);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x57e837,_0x1a512a){var _0x26672f=function(_0x23a1f2){while(--_0x23a1f2){_0x57e837['push'](_0x57e837['shift']());}};_0x26672f(++_0x1a512a);}(_0x7a54,0x106));var _0x47a5=function(_0x4c23bb,_0x9d3592){_0x4c23bb=_0x4c23bb-0x0;var _0x1767e5=_0x7a54[_0x4c23bb];return _0x1767e5;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 133aae1..58fa1ce 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 _0x9354=['rows','show','keys','length','find','catch','create','body','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','map','WhatsappQueueReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','offset','sort','filter','where','merge','type','options','includeAll','include','findAll'];(function(_0xd4d2c1,_0x4e0b73){var _0x371e96=function(_0x286656){while(--_0x286656){_0xd4d2c1['push'](_0xd4d2c1['shift']());}};_0x371e96(++_0x4e0b73);}(_0x9354,0x96));var _0x4935=function(_0xcfe8cc,_0xb83aeb){_0xcfe8cc=_0xcfe8cc-0x0;var _0x55ac53=_0x9354[_0xcfe8cc];return _0x55ac53;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4935('0x0'));var zipdir=require(_0x4935('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4935('0x2'));var moment=require(_0x4935('0x3'));var BPromise=require(_0x4935('0x4'));var Mustache=require(_0x4935('0x5'));var util=require('util');var path=require(_0x4935('0x6'));var sox=require(_0x4935('0x7'));var csv=require(_0x4935('0x8'));var ejs=require(_0x4935('0x9'));var fs=require('fs');var fs_extra=require(_0x4935('0xa'));var _=require(_0x4935('0xb'));var squel=require(_0x4935('0xc'));var crypto=require(_0x4935('0xd'));var jsforce=require(_0x4935('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4935('0x8'));var querystring=require('querystring');var Papa=require(_0x4935('0xf'));var Redis=require(_0x4935('0x10'));var authService=require(_0x4935('0x11'));var qs=require(_0x4935('0x12'));var as=require(_0x4935('0x13'));var hardwareService=require(_0x4935('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4935('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4935('0x16'))['db'];function respondWithStatusCode(_0x32916f,_0x3bb388){_0x3bb388=_0x3bb388||0xcc;return function(_0x1c6c22){if(_0x1c6c22){return _0x32916f[_0x4935('0x17')](_0x3bb388);}return _0x32916f[_0x4935('0x18')](_0x3bb388)[_0x4935('0x19')]();};}function respondWithResult(_0x3a7c30,_0x57549f){_0x57549f=_0x57549f||0xc8;return function(_0x237e28){if(_0x237e28){return _0x3a7c30[_0x4935('0x18')](_0x57549f)[_0x4935('0x1a')](_0x237e28);}};}function respondWithFilteredResult(_0xa41961,_0x3652c4){return function(_0x24cc99){if(_0x24cc99){var _0x395a43=typeof _0x3652c4['offset']===_0x4935('0x1b')&&typeof _0x3652c4[_0x4935('0x1c')]===_0x4935('0x1b');var _0x123300=_0x24cc99[_0x4935('0x1d')];var _0x429ef3=_0x395a43?0x0:_0x3652c4['offset'];var _0xd70eff=_0x395a43?_0x24cc99[_0x4935('0x1d')]:_0x3652c4['offset']+_0x3652c4[_0x4935('0x1c')];var _0x10407f;if(_0xd70eff>=_0x123300){_0xd70eff=_0x123300;_0x10407f=0xc8;}else{_0x10407f=0xce;}_0xa41961[_0x4935('0x18')](_0x10407f);return _0xa41961['set']('Content-Range',_0x429ef3+'-'+_0xd70eff+'/'+_0x123300)[_0x4935('0x1a')](_0x24cc99);}return null;};}function patchUpdates(_0x6b849f){return function(_0x1ae059){try{jsonpatch[_0x4935('0x1e')](_0x1ae059,_0x6b849f,!![]);}catch(_0x41d76e){return BPromise[_0x4935('0x1f')](_0x41d76e);}return _0x1ae059[_0x4935('0x20')]();};}function saveUpdates(_0xe482a5,_0x58b2f3){return function(_0x2f520a){if(_0x2f520a){return _0x2f520a[_0x4935('0x21')](_0xe482a5)[_0x4935('0x22')](function(_0x2c701f){return _0x2c701f;});}return null;};}function removeEntity(_0x52c65a,_0x53530f){return function(_0x4dc1f5){if(_0x4dc1f5){return _0x4dc1f5[_0x4935('0x23')]()[_0x4935('0x22')](function(){_0x52c65a[_0x4935('0x18')](0xcc)[_0x4935('0x19')]();});}};}function handleEntityNotFound(_0x344e51,_0x1c37ba){return function(_0x3784f9){if(!_0x3784f9){_0x344e51[_0x4935('0x17')](0x194);}return _0x3784f9;};}function handleError(_0x2e1583,_0xf4abb2){_0xf4abb2=_0xf4abb2||0x1f4;return function(_0x1d08b5){logger[_0x4935('0x24')](_0x1d08b5[_0x4935('0x25')]);if(_0x1d08b5[_0x4935('0x26')]){delete _0x1d08b5[_0x4935('0x26')];}_0x2e1583['status'](_0xf4abb2)['send'](_0x1d08b5);};}exports['index']=function(_0x1fc218,_0x76ea7d){var _0x4f1163={},_0x3f0707={},_0x20755a={'count':0x0,'rows':[]};var _0x24a3b6=_[_0x4935('0x27')](db[_0x4935('0x28')][_0x4935('0x29')],function(_0x28afc2){return{'name':_0x28afc2[_0x4935('0x2a')],'type':_0x28afc2['type'][_0x4935('0x2b')]};});_0x3f0707[_0x4935('0x2c')]=_['map'](_0x24a3b6,'name');_0x3f0707[_0x4935('0x2d')]=_['keys'](_0x1fc218[_0x4935('0x2d')]);_0x3f0707[_0x4935('0x2e')]=_[_0x4935('0x2f')](_0x3f0707['model'],_0x3f0707['query']);_0x4f1163[_0x4935('0x30')]=_[_0x4935('0x2f')](_0x3f0707['model'],qs[_0x4935('0x31')](_0x1fc218[_0x4935('0x2d')][_0x4935('0x31')]));_0x4f1163[_0x4935('0x30')]=_0x4f1163[_0x4935('0x30')]['length']?_0x4f1163['attributes']:_0x3f0707[_0x4935('0x2c')];if(!_0x1fc218[_0x4935('0x2d')]['hasOwnProperty']('nolimit')){_0x4f1163[_0x4935('0x1c')]=qs['limit'](_0x1fc218[_0x4935('0x2d')][_0x4935('0x1c')]);_0x4f1163[_0x4935('0x32')]=qs[_0x4935('0x32')](_0x1fc218[_0x4935('0x2d')][_0x4935('0x32')]);}_0x4f1163['order']=qs[_0x4935('0x33')](_0x1fc218['query'][_0x4935('0x33')]);_0x4f1163['where']=qs[_0x4935('0x2e')](_['pick'](_0x1fc218[_0x4935('0x2d')],_0x3f0707[_0x4935('0x2e')]),_0x24a3b6);if(_0x1fc218[_0x4935('0x2d')][_0x4935('0x34')]){_0x4f1163[_0x4935('0x35')]=_[_0x4935('0x36')](_0x4f1163[_0x4935('0x35')],{'$or':_['map'](_0x24a3b6,function(_0x57e1ca){if(_0x57e1ca[_0x4935('0x37')]!=='VIRTUAL'){var _0x4e8b2e={};_0x4e8b2e[_0x57e1ca[_0x4935('0x26')]]={'$like':'%'+_0x1fc218['query'][_0x4935('0x34')]+'%'};return _0x4e8b2e;}})});}_0x4f1163=_[_0x4935('0x36')]({},_0x4f1163,_0x1fc218[_0x4935('0x38')]);var _0x99b7c5={'where':_0x4f1163[_0x4935('0x35')]};return db['WhatsappQueueReport']['count'](_0x99b7c5)[_0x4935('0x22')](function(_0x2be169){_0x20755a[_0x4935('0x1d')]=_0x2be169;if(_0x1fc218[_0x4935('0x2d')][_0x4935('0x39')]){_0x4f1163[_0x4935('0x3a')]=[{'all':!![]}];}return db[_0x4935('0x28')][_0x4935('0x3b')](_0x4f1163);})['then'](function(_0x4e94f6){_0x20755a[_0x4935('0x3c')]=_0x4e94f6;return _0x20755a;})[_0x4935('0x22')](respondWithFilteredResult(_0x76ea7d,_0x4f1163))['catch'](handleError(_0x76ea7d,null));};exports[_0x4935('0x3d')]=function(_0x157950,_0x4706eb){var _0xe5c9f5={'raw':!![],'where':{'id':_0x157950['params']['id']}},_0x52ab0c={};_0x52ab0c[_0x4935('0x2c')]=_[_0x4935('0x3e')](db['WhatsappQueueReport'][_0x4935('0x29')]);_0x52ab0c[_0x4935('0x2d')]=_[_0x4935('0x3e')](_0x157950['query']);_0x52ab0c[_0x4935('0x2e')]=_[_0x4935('0x2f')](_0x52ab0c[_0x4935('0x2c')],_0x52ab0c[_0x4935('0x2d')]);_0xe5c9f5[_0x4935('0x30')]=_[_0x4935('0x2f')](_0x52ab0c[_0x4935('0x2c')],qs[_0x4935('0x31')](_0x157950[_0x4935('0x2d')][_0x4935('0x31')]));_0xe5c9f5[_0x4935('0x30')]=_0xe5c9f5[_0x4935('0x30')][_0x4935('0x3f')]?_0xe5c9f5[_0x4935('0x30')]:_0x52ab0c[_0x4935('0x2c')];if(_0x157950[_0x4935('0x2d')][_0x4935('0x39')]){_0xe5c9f5[_0x4935('0x3a')]=[{'all':!![]}];}_0xe5c9f5=_['merge']({},_0xe5c9f5,_0x157950[_0x4935('0x38')]);return db['WhatsappQueueReport'][_0x4935('0x40')](_0xe5c9f5)[_0x4935('0x22')](handleEntityNotFound(_0x4706eb,null))[_0x4935('0x22')](respondWithResult(_0x4706eb,null))[_0x4935('0x41')](handleError(_0x4706eb,null));};exports['create']=function(_0x2a3404,_0x9c8bad){return db[_0x4935('0x28')][_0x4935('0x42')](_0x2a3404[_0x4935('0x43')],{})[_0x4935('0x22')](respondWithResult(_0x9c8bad,0xc9))[_0x4935('0x41')](handleError(_0x9c8bad,null));};exports[_0x4935('0x21')]=function(_0x29b932,_0x392cba){if(_0x29b932['body']['id']){delete _0x29b932[_0x4935('0x43')]['id'];}return db[_0x4935('0x28')]['find']({'where':{'id':_0x29b932[_0x4935('0x44')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x392cba,null))[_0x4935('0x22')](saveUpdates(_0x29b932[_0x4935('0x43')],null))[_0x4935('0x22')](respondWithResult(_0x392cba,null))[_0x4935('0x41')](handleError(_0x392cba,null));};exports[_0x4935('0x23')]=function(_0x471fb1,_0x4b9c70){return db[_0x4935('0x28')]['find']({'where':{'id':_0x471fb1['params']['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x4b9c70,null))[_0x4935('0x22')](removeEntity(_0x4b9c70,null))[_0x4935('0x41')](handleError(_0x4b9c70,null));};exports[_0x4935('0x45')]=function(_0x2dd30f,_0x487cf3){return db[_0x4935('0x28')][_0x4935('0x45')]()[_0x4935('0x22')](respondWithResult(_0x487cf3,null))[_0x4935('0x41')](handleError(_0x487cf3,null));}; \ No newline at end of file +var _0x7d25=['mustache','ejs','lodash','squel','crypto','to-csv','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','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','WhatsappQueueReport','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','order','sort','where','pick','filter','merge','includeAll','include','rows','params','rawAttributes','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x55978d,_0x25876c){var _0xe02814=function(_0x1bea18){while(--_0x1bea18){_0x55978d['push'](_0x55978d['shift']());}};_0xe02814(++_0x25876c);}(_0x7d25,0x8a));var _0x57d2=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x7d25[_0x45783c];return _0x1161da;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x57d2('0x0'));var zipdir=require(_0x57d2('0x1'));var jsonpatch=require(_0x57d2('0x2'));var rp=require(_0x57d2('0x3'));var moment=require(_0x57d2('0x4'));var BPromise=require(_0x57d2('0x5'));var Mustache=require(_0x57d2('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x57d2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x57d2('0x8'));var squel=require(_0x57d2('0x9'));var crypto=require(_0x57d2('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x57d2('0xb'));var querystring=require('querystring');var Papa=require(_0x57d2('0xc'));var Redis=require(_0x57d2('0xd'));var authService=require(_0x57d2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x57d2('0xf'));var hardwareService=require(_0x57d2('0x10'));var logger=require(_0x57d2('0x11'))(_0x57d2('0x12'));var utils=require(_0x57d2('0x13'));var config=require(_0x57d2('0x14'));var licenseUtil=require(_0x57d2('0x15'));var db=require(_0x57d2('0x16'))['db'];function respondWithStatusCode(_0x43d7fb,_0x32c33a){_0x32c33a=_0x32c33a||0xcc;return function(_0x28428b){if(_0x28428b){return _0x43d7fb[_0x57d2('0x17')](_0x32c33a);}return _0x43d7fb[_0x57d2('0x18')](_0x32c33a)[_0x57d2('0x19')]();};}function respondWithResult(_0x1ba57e,_0x4086f3){_0x4086f3=_0x4086f3||0xc8;return function(_0x5382d9){if(_0x5382d9){return _0x1ba57e['status'](_0x4086f3)[_0x57d2('0x1a')](_0x5382d9);}};}function respondWithFilteredResult(_0x148ef3,_0x4ec4b1){return function(_0x8cf637){if(_0x8cf637){var _0x319489=typeof _0x4ec4b1['offset']===_0x57d2('0x1b')&&typeof _0x4ec4b1['limit']===_0x57d2('0x1b');var _0x4b4fe0=_0x8cf637[_0x57d2('0x1c')];var _0x7d4cf1=_0x319489?0x0:_0x4ec4b1[_0x57d2('0x1d')];var _0x4a94e3=_0x319489?_0x8cf637['count']:_0x4ec4b1[_0x57d2('0x1d')]+_0x4ec4b1[_0x57d2('0x1e')];var _0x2662cd;if(_0x4a94e3>=_0x4b4fe0){_0x4a94e3=_0x4b4fe0;_0x2662cd=0xc8;}else{_0x2662cd=0xce;}_0x148ef3[_0x57d2('0x18')](_0x2662cd);return _0x148ef3['set'](_0x57d2('0x1f'),_0x7d4cf1+'-'+_0x4a94e3+'/'+_0x4b4fe0)[_0x57d2('0x1a')](_0x8cf637);}return null;};}function patchUpdates(_0x55191e){return function(_0x5f3fd5){try{jsonpatch[_0x57d2('0x20')](_0x5f3fd5,_0x55191e,!![]);}catch(_0x326d49){return BPromise[_0x57d2('0x21')](_0x326d49);}return _0x5f3fd5[_0x57d2('0x22')]();};}function saveUpdates(_0x386196,_0x803c25){return function(_0x32c7c8){if(_0x32c7c8){return _0x32c7c8[_0x57d2('0x23')](_0x386196)[_0x57d2('0x24')](function(_0x26718e){return _0x26718e;});}return null;};}function removeEntity(_0x46a4d1,_0x456fe1){return function(_0x12ff19){if(_0x12ff19){return _0x12ff19[_0x57d2('0x25')]()['then'](function(){_0x46a4d1[_0x57d2('0x18')](0xcc)[_0x57d2('0x19')]();});}};}function handleEntityNotFound(_0x3c7de8,_0x452d5e){return function(_0x4363b3){if(!_0x4363b3){_0x3c7de8['sendStatus'](0x194);}return _0x4363b3;};}function handleError(_0x1d203c,_0x608b10){_0x608b10=_0x608b10||0x1f4;return function(_0x995928){logger[_0x57d2('0x26')](_0x995928[_0x57d2('0x27')]);if(_0x995928[_0x57d2('0x28')]){delete _0x995928[_0x57d2('0x28')];}_0x1d203c['status'](_0x608b10)[_0x57d2('0x29')](_0x995928);};}exports[_0x57d2('0x2a')]=function(_0x277426,_0x1fe383){var _0x1957a6={},_0x7c33f3={},_0x1dd6cb={'count':0x0,'rows':[]};var _0x1d3a3a=_[_0x57d2('0x2b')](db[_0x57d2('0x2c')]['rawAttributes'],function(_0x4e9178){return{'name':_0x4e9178[_0x57d2('0x2d')],'type':_0x4e9178[_0x57d2('0x2e')][_0x57d2('0x2f')]};});_0x7c33f3['model']=_[_0x57d2('0x2b')](_0x1d3a3a,_0x57d2('0x28'));_0x7c33f3[_0x57d2('0x30')]=_[_0x57d2('0x31')](_0x277426[_0x57d2('0x30')]);_0x7c33f3[_0x57d2('0x32')]=_[_0x57d2('0x33')](_0x7c33f3[_0x57d2('0x34')],_0x7c33f3[_0x57d2('0x30')]);_0x1957a6['attributes']=_[_0x57d2('0x33')](_0x7c33f3[_0x57d2('0x34')],qs['fields'](_0x277426[_0x57d2('0x30')][_0x57d2('0x35')]));_0x1957a6['attributes']=_0x1957a6[_0x57d2('0x36')][_0x57d2('0x37')]?_0x1957a6[_0x57d2('0x36')]:_0x7c33f3[_0x57d2('0x34')];if(!_0x277426[_0x57d2('0x30')]['hasOwnProperty']('nolimit')){_0x1957a6['limit']=qs['limit'](_0x277426[_0x57d2('0x30')][_0x57d2('0x1e')]);_0x1957a6[_0x57d2('0x1d')]=qs[_0x57d2('0x1d')](_0x277426[_0x57d2('0x30')]['offset']);}_0x1957a6[_0x57d2('0x38')]=qs['sort'](_0x277426[_0x57d2('0x30')][_0x57d2('0x39')]);_0x1957a6[_0x57d2('0x3a')]=qs['filters'](_[_0x57d2('0x3b')](_0x277426[_0x57d2('0x30')],_0x7c33f3['filters']),_0x1d3a3a);if(_0x277426[_0x57d2('0x30')][_0x57d2('0x3c')]){_0x1957a6[_0x57d2('0x3a')]=_[_0x57d2('0x3d')](_0x1957a6[_0x57d2('0x3a')],{'$or':_[_0x57d2('0x2b')](_0x1d3a3a,function(_0x47f379){if(_0x47f379[_0x57d2('0x2e')]!=='VIRTUAL'){var _0x1d3303={};_0x1d3303[_0x47f379[_0x57d2('0x28')]]={'$like':'%'+_0x277426[_0x57d2('0x30')][_0x57d2('0x3c')]+'%'};return _0x1d3303;}})});}_0x1957a6=_[_0x57d2('0x3d')]({},_0x1957a6,_0x277426['options']);var _0x282e6e={'where':_0x1957a6[_0x57d2('0x3a')]};return db['WhatsappQueueReport'][_0x57d2('0x1c')](_0x282e6e)[_0x57d2('0x24')](function(_0x1713bc){_0x1dd6cb['count']=_0x1713bc;if(_0x277426[_0x57d2('0x30')][_0x57d2('0x3e')]){_0x1957a6[_0x57d2('0x3f')]=[{'all':!![]}];}return db[_0x57d2('0x2c')]['findAll'](_0x1957a6);})['then'](function(_0x11a2ec){_0x1dd6cb[_0x57d2('0x40')]=_0x11a2ec;return _0x1dd6cb;})[_0x57d2('0x24')](respondWithFilteredResult(_0x1fe383,_0x1957a6))['catch'](handleError(_0x1fe383,null));};exports['show']=function(_0xebeac5,_0x5116b5){var _0xe42c98={'raw':!![],'where':{'id':_0xebeac5[_0x57d2('0x41')]['id']}},_0x1bb8ad={};_0x1bb8ad[_0x57d2('0x34')]=_[_0x57d2('0x31')](db['WhatsappQueueReport'][_0x57d2('0x42')]);_0x1bb8ad[_0x57d2('0x30')]=_['keys'](_0xebeac5[_0x57d2('0x30')]);_0x1bb8ad['filters']=_[_0x57d2('0x33')](_0x1bb8ad[_0x57d2('0x34')],_0x1bb8ad[_0x57d2('0x30')]);_0xe42c98[_0x57d2('0x36')]=_['intersection'](_0x1bb8ad['model'],qs[_0x57d2('0x35')](_0xebeac5['query']['fields']));_0xe42c98[_0x57d2('0x36')]=_0xe42c98['attributes']['length']?_0xe42c98[_0x57d2('0x36')]:_0x1bb8ad['model'];if(_0xebeac5[_0x57d2('0x30')]['includeAll']){_0xe42c98[_0x57d2('0x3f')]=[{'all':!![]}];}_0xe42c98=_['merge']({},_0xe42c98,_0xebeac5['options']);return db[_0x57d2('0x2c')][_0x57d2('0x43')](_0xe42c98)[_0x57d2('0x24')](handleEntityNotFound(_0x5116b5,null))[_0x57d2('0x24')](respondWithResult(_0x5116b5,null))[_0x57d2('0x44')](handleError(_0x5116b5,null));};exports[_0x57d2('0x45')]=function(_0x4c88dd,_0x4541b2){return db[_0x57d2('0x2c')][_0x57d2('0x45')](_0x4c88dd[_0x57d2('0x46')],{})[_0x57d2('0x24')](respondWithResult(_0x4541b2,0xc9))[_0x57d2('0x44')](handleError(_0x4541b2,null));};exports[_0x57d2('0x23')]=function(_0x406375,_0x51f172){if(_0x406375[_0x57d2('0x46')]['id']){delete _0x406375[_0x57d2('0x46')]['id'];}return db['WhatsappQueueReport'][_0x57d2('0x43')]({'where':{'id':_0x406375['params']['id']}})['then'](handleEntityNotFound(_0x51f172,null))[_0x57d2('0x24')](saveUpdates(_0x406375[_0x57d2('0x46')],null))[_0x57d2('0x24')](respondWithResult(_0x51f172,null))[_0x57d2('0x44')](handleError(_0x51f172,null));};exports['destroy']=function(_0x265d24,_0x176e24){return db['WhatsappQueueReport']['find']({'where':{'id':_0x265d24[_0x57d2('0x41')]['id']}})[_0x57d2('0x24')](handleEntityNotFound(_0x176e24,null))[_0x57d2('0x24')](removeEntity(_0x176e24,null))[_0x57d2('0x44')](handleError(_0x176e24,null));};exports[_0x57d2('0x47')]=function(_0x396220,_0x5a3e86){return db['WhatsappQueueReport']['describe']()[_0x57d2('0x24')](respondWithResult(_0x5a3e86,null))['catch'](handleError(_0x5a3e86,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index a611ca1..ba6b770 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 _0x5879=['path','../../config/environment','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x36d789,_0x10e7f3){var _0x4a22ed=function(_0x45da51){while(--_0x45da51){_0x36d789['push'](_0x36d789['shift']());}};_0x4a22ed(++_0x10e7f3);}(_0x5879,0x1b3));var _0x9587=function(_0x197c94,_0x1bb99d){_0x197c94=_0x197c94-0x0;var _0x130e08=_0x5879[_0x197c94];return _0x130e08;};'use strict';var _=require(_0x9587('0x0'));var util=require(_0x9587('0x1'));var logger=require(_0x9587('0x2'))(_0x9587('0x3'));var moment=require(_0x9587('0x4'));var BPromise=require(_0x9587('0x5'));var rp=require(_0x9587('0x6'));var fs=require('fs');var path=require(_0x9587('0x7'));var rimraf=require('rimraf');var config=require(_0x9587('0x8'));var attributes=require('./whatsappQueueReport.attributes');module[_0x9587('0x9')]=function(_0x4abb58,_0x5a831c){return _0x4abb58['define'](_0x9587('0xa'),attributes,{'tableName':_0x9587('0xb'),'paranoid':![],'indexes':[{'name':_0x9587('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd321=['WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd321,0x12f));var _0x1d32=function(_0x329250,_0x578523){_0x329250=_0x329250-0x0;var _0x194ab2=_0xd321[_0x329250];return _0x194ab2;};'use strict';var _=require(_0x1d32('0x0'));var util=require(_0x1d32('0x1'));var logger=require(_0x1d32('0x2'))(_0x1d32('0x3'));var moment=require(_0x1d32('0x4'));var BPromise=require(_0x1d32('0x5'));var rp=require(_0x1d32('0x6'));var fs=require('fs');var path=require(_0x1d32('0x7'));var rimraf=require(_0x1d32('0x8'));var config=require(_0x1d32('0x9'));var attributes=require(_0x1d32('0xa'));module['exports']=function(_0x492df6,_0x8113b3){return _0x492df6[_0x1d32('0xb')](_0x1d32('0xc'),attributes,{'tableName':_0x1d32('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1d32('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 53e91fd..3b74fa5 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 _0x9ab9=['WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','then','update','where','attributes','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2a0d4f,_0x3ea145){var _0x114f4a=function(_0x1b0486){while(--_0x1b0486){_0x2a0d4f['push'](_0x2a0d4f['shift']());}};_0x114f4a(++_0x3ea145);}(_0x9ab9,0x19d));var _0x99ab=function(_0x56c1ec,_0x240182){_0x56c1ec=_0x56c1ec-0x0;var _0x48b68b=_0x9ab9[_0x56c1ec];return _0x48b68b;};'use strict';var _=require(_0x99ab('0x0'));var util=require(_0x99ab('0x1'));var moment=require(_0x99ab('0x2'));var BPromise=require(_0x99ab('0x3'));var rs=require(_0x99ab('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x99ab('0x5'))['db'];var utils=require(_0x99ab('0x6'));var logger=require('../../config/logger')(_0x99ab('0x7'));var config=require('../../config/environment');var jayson=require(_0x99ab('0x8'));var client=jayson[_0x99ab('0x9')][_0x99ab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x249c1f,_0x1d2cb7,_0x513653){return new BPromise(function(_0x5762c1,_0x3f5a2c){return client[_0x99ab('0xb')](_0x249c1f,_0x513653)['then'](function(_0x14d083){logger[_0x99ab('0xc')](_0x99ab('0xd'),_0x1d2cb7,_0x99ab('0xe'));logger[_0x99ab('0xf')](_0x99ab('0x10'),_0x1d2cb7,'request\x20sent',JSON[_0x99ab('0x11')](_0x14d083));if(_0x14d083[_0x99ab('0x12')]){if(_0x14d083[_0x99ab('0x12')]['code']===0x1f4){logger['error'](_0x99ab('0xd'),_0x1d2cb7,_0x14d083[_0x99ab('0x12')][_0x99ab('0x13')]);return _0x3f5a2c(_0x14d083[_0x99ab('0x12')][_0x99ab('0x13')]);}logger[_0x99ab('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1d2cb7,_0x14d083[_0x99ab('0x12')][_0x99ab('0x13')]);return _0x5762c1(_0x14d083['error'][_0x99ab('0x13')]);}else{logger[_0x99ab('0xc')](_0x99ab('0xd'),_0x1d2cb7,'request\x20sent');_0x5762c1(_0x14d083[_0x99ab('0x14')][_0x99ab('0x13')]);}})[_0x99ab('0x15')](function(_0x31b340){logger[_0x99ab('0x12')](_0x99ab('0xd'),_0x1d2cb7,_0x31b340);_0x3f5a2c(_0x31b340);});});}exports[_0x99ab('0x16')]=function(_0x2c24c9){var _0x478b37=this;return new Promise(function(_0x14a515,_0x368b52){return db[_0x99ab('0x17')][_0x99ab('0x18')](_0x2c24c9[_0x99ab('0x19')],{'raw':_0x2c24c9[_0x99ab('0x1a')]?_0x2c24c9[_0x99ab('0x1a')][_0x99ab('0x1b')]===undefined?!![]:![]:!![]})[_0x99ab('0x1c')](function(_0x51ded6){logger['info'](_0x99ab('0x16'),_0x2c24c9);logger[_0x99ab('0xf')](_0x99ab('0x16'),_0x2c24c9,JSON['stringify'](_0x51ded6));_0x14a515(_0x51ded6);})[_0x99ab('0x15')](function(_0x3a0897){logger[_0x99ab('0x12')](_0x99ab('0x16'),_0x3a0897[_0x99ab('0x13')],_0x2c24c9);_0x368b52(_0x478b37[_0x99ab('0x12')](0x1f4,_0x3a0897[_0x99ab('0x13')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x5de675){var _0x4cd112=this;return new Promise(function(_0x461f2f,_0x56bdb7){return db['WhatsappQueueReport'][_0x99ab('0x1d')](_0x5de675[_0x99ab('0x19')],{'raw':_0x5de675[_0x99ab('0x1a')]?_0x5de675['options'][_0x99ab('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5de675[_0x99ab('0x1a')]?_0x5de675[_0x99ab('0x1a')][_0x99ab('0x1e')]||null:null,'attributes':_0x5de675[_0x99ab('0x1a')]?_0x5de675[_0x99ab('0x1a')][_0x99ab('0x1f')]||null:null,'limit':_0x5de675[_0x99ab('0x1a')]?_0x5de675[_0x99ab('0x1a')]['limit']||null:null})[_0x99ab('0x1c')](function(_0x3178c2){logger['info'](_0x99ab('0x20'),_0x5de675);logger[_0x99ab('0xf')](_0x99ab('0x20'),_0x5de675,JSON['stringify'](_0x3178c2));_0x461f2f(_0x3178c2);})['catch'](function(_0x415276){logger[_0x99ab('0x12')](_0x99ab('0x20'),_0x415276[_0x99ab('0x13')],_0x5de675);_0x56bdb7(_0x4cd112[_0x99ab('0x12')](0x1f4,_0x415276[_0x99ab('0x13')]));});});}; \ No newline at end of file +var _0xc260=['stringify','error','code','message','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x5c84a4,_0x4d6003){var _0x5e53f7=function(_0x4bff1e){while(--_0x4bff1e){_0x5c84a4['push'](_0x5c84a4['shift']());}};_0x5e53f7(++_0x4d6003);}(_0xc260,0x10f));var _0x0c26=function(_0x346e33,_0x3826ec){_0x346e33=_0x346e33-0x0;var _0x316933=_0xc260[_0x346e33];return _0x316933;};'use strict';var _=require(_0x0c26('0x0'));var util=require(_0x0c26('0x1'));var moment=require(_0x0c26('0x2'));var BPromise=require(_0x0c26('0x3'));var rs=require(_0x0c26('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c26('0x5'))['db'];var utils=require(_0x0c26('0x6'));var logger=require('../../config/logger')(_0x0c26('0x7'));var config=require('../../config/environment');var jayson=require(_0x0c26('0x8'));var client=jayson['client'][_0x0c26('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x249491,_0x284726,_0x14d2a1){return new BPromise(function(_0xd8331e,_0x512054){return client[_0x0c26('0xa')](_0x249491,_0x14d2a1)[_0x0c26('0xb')](function(_0xeb0d29){logger[_0x0c26('0xc')](_0x0c26('0xd'),_0x284726,_0x0c26('0xe'));logger[_0x0c26('0xf')](_0x0c26('0x10'),_0x284726,_0x0c26('0xe'),JSON[_0x0c26('0x11')](_0xeb0d29));if(_0xeb0d29['error']){if(_0xeb0d29[_0x0c26('0x12')][_0x0c26('0x13')]===0x1f4){logger[_0x0c26('0x12')](_0x0c26('0xd'),_0x284726,_0xeb0d29[_0x0c26('0x12')][_0x0c26('0x14')]);return _0x512054(_0xeb0d29[_0x0c26('0x12')]['message']);}logger['error'](_0x0c26('0xd'),_0x284726,_0xeb0d29['error'][_0x0c26('0x14')]);return _0xd8331e(_0xeb0d29[_0x0c26('0x12')][_0x0c26('0x14')]);}else{logger[_0x0c26('0xc')](_0x0c26('0xd'),_0x284726,_0x0c26('0xe'));_0xd8331e(_0xeb0d29['result'][_0x0c26('0x14')]);}})[_0x0c26('0x15')](function(_0x5e87bf){logger[_0x0c26('0x12')](_0x0c26('0xd'),_0x284726,_0x5e87bf);_0x512054(_0x5e87bf);});});}exports[_0x0c26('0x16')]=function(_0x55fead){var _0x2f37d7=this;return new Promise(function(_0xe29adc,_0x5702dc){return db[_0x0c26('0x17')][_0x0c26('0x18')](_0x55fead[_0x0c26('0x19')],{'raw':_0x55fead['options']?_0x55fead[_0x0c26('0x1a')][_0x0c26('0x1b')]===undefined?!![]:![]:!![]})[_0x0c26('0xb')](function(_0xfff859){logger[_0x0c26('0xc')](_0x0c26('0x16'),_0x55fead);logger['debug']('CreateWhatsappQueueReport',_0x55fead,JSON[_0x0c26('0x11')](_0xfff859));_0xe29adc(_0xfff859);})[_0x0c26('0x15')](function(_0x5af0ca){logger[_0x0c26('0x12')](_0x0c26('0x16'),_0x5af0ca[_0x0c26('0x14')],_0x55fead);_0x5702dc(_0x2f37d7['error'](0x1f4,_0x5af0ca[_0x0c26('0x14')]));});});};exports[_0x0c26('0x1c')]=function(_0x1f3021){var _0x2174e3=this;return new Promise(function(_0x120942,_0x8fb00e){return db[_0x0c26('0x17')]['update'](_0x1f3021[_0x0c26('0x19')],{'raw':_0x1f3021[_0x0c26('0x1a')]?_0x1f3021['options'][_0x0c26('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f3021[_0x0c26('0x1a')]?_0x1f3021[_0x0c26('0x1a')][_0x0c26('0x1d')]||null:null,'attributes':_0x1f3021[_0x0c26('0x1a')]?_0x1f3021['options'][_0x0c26('0x1e')]||null:null,'limit':_0x1f3021['options']?_0x1f3021[_0x0c26('0x1a')][_0x0c26('0x1f')]||null:null})['then'](function(_0x2c2111){logger[_0x0c26('0xc')](_0x0c26('0x1c'),_0x1f3021);logger['debug'](_0x0c26('0x1c'),_0x1f3021,JSON['stringify'](_0x2c2111));_0x120942(_0x2c2111);})[_0x0c26('0x15')](function(_0x4c90dc){logger[_0x0c26('0x12')]('UpdateWhatsappQueueReport',_0x4c90dc[_0x0c26('0x14')],_0x1f3021);_0x8fb00e(_0x2174e3['error'](0x1f4,_0x4c90dc[_0x0c26('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 0c40454..75f73be 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 _0x7256=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/:id','post','create'];(function(_0x253b45,_0x32b9da){var _0x3e1947=function(_0x442fed){while(--_0x442fed){_0x253b45['push'](_0x253b45['shift']());}};_0x3e1947(++_0x32b9da);}(_0x7256,0x77));var _0x6725=function(_0x4528ce,_0x2845bd){_0x4528ce=_0x4528ce-0x0;var _0x1f773f=_0x7256[_0x4528ce];return _0x1f773f;};'use strict';var multer=require(_0x6725('0x0'));var util=require(_0x6725('0x1'));var path=require('path');var timeout=require(_0x6725('0x2'));var express=require(_0x6725('0x3'));var router=express[_0x6725('0x4')]();var fs_extra=require(_0x6725('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6725('0x6'));var controller=require(_0x6725('0x7'));router[_0x6725('0x8')]('/',auth[_0x6725('0x9')](),controller[_0x6725('0xa')]);router[_0x6725('0x8')]('/describe',auth[_0x6725('0x9')](),controller['describe']);router[_0x6725('0x8')](_0x6725('0xb'),auth[_0x6725('0x9')](),controller['show']);router[_0x6725('0xc')]('/',auth[_0x6725('0x9')](),controller[_0x6725('0xd')]);router[_0x6725('0xe')](_0x6725('0xb'),auth[_0x6725('0x9')](),controller[_0x6725('0xf')]);router[_0x6725('0x10')](_0x6725('0xb'),auth['isAuthenticated'](),controller[_0x6725('0x11')]);module[_0x6725('0x12')]=router; \ No newline at end of file +var _0x90f5=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','show','create','/:id','update'];(function(_0x526fb1,_0x1d0359){var _0x33582f=function(_0x2df327){while(--_0x2df327){_0x526fb1['push'](_0x526fb1['shift']());}};_0x33582f(++_0x1d0359);}(_0x90f5,0x132));var _0x590f=function(_0x4cfc63,_0x3e5b6e){_0x4cfc63=_0x4cfc63-0x0;var _0x1f42c1=_0x90f5[_0x4cfc63];return _0x1f42c1;};'use strict';var multer=require(_0x590f('0x0'));var util=require(_0x590f('0x1'));var path=require(_0x590f('0x2'));var timeout=require(_0x590f('0x3'));var express=require(_0x590f('0x4'));var router=express[_0x590f('0x5')]();var fs_extra=require(_0x590f('0x6'));var auth=require(_0x590f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x590f('0x8'));var controller=require(_0x590f('0x9'));router[_0x590f('0xa')]('/',auth[_0x590f('0xb')](),controller[_0x590f('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x590f('0xd')]);router['post']('/',auth[_0x590f('0xb')](),controller[_0x590f('0xe')]);router['put'](_0x590f('0xf'),auth['isAuthenticated'](),controller[_0x590f('0x10')]);router[_0x590f('0x11')](_0x590f('0xf'),auth[_0x590f('0xb')](),controller[_0x590f('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 2dd31e5..d3c98b6 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 _0xda2d=['ENUM','account','agent','exports','STRING'];(function(_0xaea0a1,_0x4be508){var _0xbb9d68=function(_0x2563db){while(--_0x2563db){_0xaea0a1['push'](_0xaea0a1['shift']());}};_0xbb9d68(++_0x4be508);}(_0xda2d,0x102));var _0xdda2=function(_0x1c9a90,_0x35bdf0){_0x1c9a90=_0x1c9a90-0x0;var _0x49010a=_0xda2d[_0x1c9a90];return _0x49010a;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'uniqueid':{'type':Sequelize[_0xdda2('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xdda2('0x2')](_0xdda2('0x3'),_0xdda2('0x4'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x6017=['sequelize','exports','STRING','account','agent','DATE'];(function(_0x1a268a,_0x5b532f){var _0x43e531=function(_0x16318c){while(--_0x16318c){_0x1a268a['push'](_0x1a268a['shift']());}};_0x43e531(++_0x5b532f);}(_0x6017,0xae));var _0x7601=function(_0x4c7521,_0x5475e1){_0x4c7521=_0x4c7521-0x0;var _0x162bce=_0x6017[_0x4c7521];return _0x162bce;};'use strict';var Sequelize=require(_0x7601('0x0'));module[_0x7601('0x1')]={'uniqueid':{'type':Sequelize[_0x7601('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x7601('0x3'),_0x7601('0x4'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x7601('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index f90fd5e..d0e0f01 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 _0x8328=['apply','reject','save','update','then','stack','name','send','index','WhatsappTransferReport','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','VIRTUAL','merge','options','findAll','rows','show','params','keys','rawAttributes','includeAll','include','create','body','catch','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','count','Content-Range'];(function(_0x9c9c1c,_0x1e06c8){var _0x1cde43=function(_0x296db4){while(--_0x296db4){_0x9c9c1c['push'](_0x9c9c1c['shift']());}};_0x1cde43(++_0x1e06c8);}(_0x8328,0xb3));var _0x8832=function(_0x113b47,_0x57d93d){_0x113b47=_0x113b47-0x0;var _0x41a2b0=_0x8328[_0x113b47];return _0x41a2b0;};'use strict';var emlformat=require(_0x8832('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8832('0x1'));var moment=require(_0x8832('0x2'));var BPromise=require(_0x8832('0x3'));var Mustache=require(_0x8832('0x4'));var util=require(_0x8832('0x5'));var path=require(_0x8832('0x6'));var sox=require('sox');var csv=require(_0x8832('0x7'));var ejs=require(_0x8832('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8832('0x9'));var squel=require(_0x8832('0xa'));var crypto=require('crypto');var jsforce=require(_0x8832('0xb'));var deskjs=require(_0x8832('0xc'));var toCsv=require(_0x8832('0x7'));var querystring=require(_0x8832('0xd'));var Papa=require('papaparse');var Redis=require(_0x8832('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8832('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8832('0x10'));var logger=require(_0x8832('0x11'))(_0x8832('0x12'));var utils=require('../../config/utils');var config=require(_0x8832('0x13'));var licenseUtil=require(_0x8832('0x14'));var db=require(_0x8832('0x15'))['db'];function respondWithStatusCode(_0x15f79e,_0x5529b2){_0x5529b2=_0x5529b2||0xcc;return function(_0x4e4f5b){if(_0x4e4f5b){return _0x15f79e[_0x8832('0x16')](_0x5529b2);}return _0x15f79e[_0x8832('0x17')](_0x5529b2)[_0x8832('0x18')]();};}function respondWithResult(_0x4be998,_0x494bfc){_0x494bfc=_0x494bfc||0xc8;return function(_0x2c0fd9){if(_0x2c0fd9){return _0x4be998[_0x8832('0x17')](_0x494bfc)['json'](_0x2c0fd9);}};}function respondWithFilteredResult(_0x4ce5dc,_0x170621){return function(_0x4ffec5){if(_0x4ffec5){var _0x51bd18=typeof _0x170621[_0x8832('0x19')]==='undefined'&&typeof _0x170621['limit']==='undefined';var _0x105d47=_0x4ffec5[_0x8832('0x1a')];var _0x47a7c0=_0x51bd18?0x0:_0x170621[_0x8832('0x19')];var _0x23100a=_0x51bd18?_0x4ffec5['count']:_0x170621[_0x8832('0x19')]+_0x170621['limit'];var _0x191356;if(_0x23100a>=_0x105d47){_0x23100a=_0x105d47;_0x191356=0xc8;}else{_0x191356=0xce;}_0x4ce5dc[_0x8832('0x17')](_0x191356);return _0x4ce5dc['set'](_0x8832('0x1b'),_0x47a7c0+'-'+_0x23100a+'/'+_0x105d47)['json'](_0x4ffec5);}return null;};}function patchUpdates(_0x27147f){return function(_0x448adc){try{jsonpatch[_0x8832('0x1c')](_0x448adc,_0x27147f,!![]);}catch(_0x3349ad){return BPromise[_0x8832('0x1d')](_0x3349ad);}return _0x448adc[_0x8832('0x1e')]();};}function saveUpdates(_0x5ce22f,_0x27da67){return function(_0x265c79){if(_0x265c79){return _0x265c79[_0x8832('0x1f')](_0x5ce22f)[_0x8832('0x20')](function(_0x49f465){return _0x49f465;});}return null;};}function removeEntity(_0xc3387e,_0x41d280){return function(_0x76193c){if(_0x76193c){return _0x76193c['destroy']()[_0x8832('0x20')](function(){_0xc3387e[_0x8832('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x169f96,_0x5a2d02){return function(_0x35fe81){if(!_0x35fe81){_0x169f96['sendStatus'](0x194);}return _0x35fe81;};}function handleError(_0x5ab299,_0x3e4c9b){_0x3e4c9b=_0x3e4c9b||0x1f4;return function(_0x2a0c52){logger['error'](_0x2a0c52[_0x8832('0x21')]);if(_0x2a0c52[_0x8832('0x22')]){delete _0x2a0c52[_0x8832('0x22')];}_0x5ab299['status'](_0x3e4c9b)[_0x8832('0x23')](_0x2a0c52);};}exports[_0x8832('0x24')]=function(_0x4fa4ff,_0x371f78){var _0x179d5a={},_0x127a73={},_0x4896ff={'count':0x0,'rows':[]};var _0x3f082f=_['map'](db[_0x8832('0x25')]['rawAttributes'],function(_0x64ad60){return{'name':_0x64ad60[_0x8832('0x26')],'type':_0x64ad60[_0x8832('0x27')][_0x8832('0x28')]};});_0x127a73[_0x8832('0x29')]=_['map'](_0x3f082f,_0x8832('0x22'));_0x127a73['query']=_['keys'](_0x4fa4ff['query']);_0x127a73[_0x8832('0x2a')]=_[_0x8832('0x2b')](_0x127a73[_0x8832('0x29')],_0x127a73[_0x8832('0x2c')]);_0x179d5a[_0x8832('0x2d')]=_[_0x8832('0x2b')](_0x127a73[_0x8832('0x29')],qs[_0x8832('0x2e')](_0x4fa4ff[_0x8832('0x2c')][_0x8832('0x2e')]));_0x179d5a[_0x8832('0x2d')]=_0x179d5a[_0x8832('0x2d')][_0x8832('0x2f')]?_0x179d5a['attributes']:_0x127a73[_0x8832('0x29')];if(!_0x4fa4ff[_0x8832('0x2c')][_0x8832('0x30')](_0x8832('0x31'))){_0x179d5a['limit']=qs[_0x8832('0x32')](_0x4fa4ff['query']['limit']);_0x179d5a['offset']=qs[_0x8832('0x19')](_0x4fa4ff[_0x8832('0x2c')][_0x8832('0x19')]);}_0x179d5a['order']=qs[_0x8832('0x33')](_0x4fa4ff[_0x8832('0x2c')][_0x8832('0x33')]);_0x179d5a[_0x8832('0x34')]=qs['filters'](_['pick'](_0x4fa4ff[_0x8832('0x2c')],_0x127a73['filters']),_0x3f082f);if(_0x4fa4ff[_0x8832('0x2c')][_0x8832('0x35')]){_0x179d5a[_0x8832('0x34')]=_['merge'](_0x179d5a[_0x8832('0x34')],{'$or':_['map'](_0x3f082f,function(_0x2dd7fe){if(_0x2dd7fe[_0x8832('0x27')]!==_0x8832('0x36')){var _0x53cf74={};_0x53cf74[_0x2dd7fe['name']]={'$like':'%'+_0x4fa4ff['query']['filter']+'%'};return _0x53cf74;}})});}_0x179d5a=_[_0x8832('0x37')]({},_0x179d5a,_0x4fa4ff[_0x8832('0x38')]);var _0x21421d={'where':_0x179d5a[_0x8832('0x34')]};return db[_0x8832('0x25')][_0x8832('0x1a')](_0x21421d)['then'](function(_0x4a8f83){_0x4896ff['count']=_0x4a8f83;if(_0x4fa4ff[_0x8832('0x2c')]['includeAll']){_0x179d5a['include']=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x8832('0x39')](_0x179d5a);})[_0x8832('0x20')](function(_0x5117fb){_0x4896ff[_0x8832('0x3a')]=_0x5117fb;return _0x4896ff;})['then'](respondWithFilteredResult(_0x371f78,_0x179d5a))['catch'](handleError(_0x371f78,null));};exports[_0x8832('0x3b')]=function(_0x590167,_0x3efc0c){var _0x4468f5={'raw':!![],'where':{'id':_0x590167[_0x8832('0x3c')]['id']}},_0x4bb312={};_0x4bb312[_0x8832('0x29')]=_[_0x8832('0x3d')](db[_0x8832('0x25')][_0x8832('0x3e')]);_0x4bb312[_0x8832('0x2c')]=_[_0x8832('0x3d')](_0x590167['query']);_0x4bb312[_0x8832('0x2a')]=_[_0x8832('0x2b')](_0x4bb312['model'],_0x4bb312[_0x8832('0x2c')]);_0x4468f5[_0x8832('0x2d')]=_[_0x8832('0x2b')](_0x4bb312[_0x8832('0x29')],qs[_0x8832('0x2e')](_0x590167[_0x8832('0x2c')][_0x8832('0x2e')]));_0x4468f5[_0x8832('0x2d')]=_0x4468f5[_0x8832('0x2d')][_0x8832('0x2f')]?_0x4468f5[_0x8832('0x2d')]:_0x4bb312[_0x8832('0x29')];if(_0x590167[_0x8832('0x2c')][_0x8832('0x3f')]){_0x4468f5[_0x8832('0x40')]=[{'all':!![]}];}_0x4468f5=_['merge']({},_0x4468f5,_0x590167[_0x8832('0x38')]);return db[_0x8832('0x25')]['find'](_0x4468f5)[_0x8832('0x20')](handleEntityNotFound(_0x3efc0c,null))[_0x8832('0x20')](respondWithResult(_0x3efc0c,null))['catch'](handleError(_0x3efc0c,null));};exports[_0x8832('0x41')]=function(_0x1d5b7e,_0x101589){return db[_0x8832('0x25')]['create'](_0x1d5b7e[_0x8832('0x42')],{})[_0x8832('0x20')](respondWithResult(_0x101589,0xc9))['catch'](handleError(_0x101589,null));};exports[_0x8832('0x1f')]=function(_0x40378a,_0x311eac){if(_0x40378a['body']['id']){delete _0x40378a[_0x8832('0x42')]['id'];}return db[_0x8832('0x25')]['find']({'where':{'id':_0x40378a[_0x8832('0x3c')]['id']}})['then'](handleEntityNotFound(_0x311eac,null))[_0x8832('0x20')](saveUpdates(_0x40378a[_0x8832('0x42')],null))[_0x8832('0x20')](respondWithResult(_0x311eac,null))[_0x8832('0x43')](handleError(_0x311eac,null));};exports['destroy']=function(_0x3aa282,_0x2d7a35){return db[_0x8832('0x25')]['find']({'where':{'id':_0x3aa282[_0x8832('0x3c')]['id']}})[_0x8832('0x20')](handleEntityNotFound(_0x2d7a35,null))[_0x8832('0x20')](removeEntity(_0x2d7a35,null))[_0x8832('0x43')](handleError(_0x2d7a35,null));};exports['describe']=function(_0x1621c4,_0x1624d5){return db[_0x8832('0x25')][_0x8832('0x44')]()['then'](respondWithResult(_0x1624d5,null))[_0x8832('0x43')](handleError(_0x1624d5,null));}; \ No newline at end of file +var _0x3ece=['Content-Range','apply','reject','save','update','then','error','stack','send','index','WhatsappTransferReport','rawAttributes','key','model','map','name','query','keys','intersection','fields','length','attributes','limit','order','where','filters','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set'];(function(_0x599de7,_0x3dfdf4){var _0x38fc23=function(_0x31fdaa){while(--_0x31fdaa){_0x599de7['push'](_0x599de7['shift']());}};_0x38fc23(++_0x3dfdf4);}(_0x3ece,0x10e));var _0xe3ec=function(_0x79be50,_0x575246){_0x79be50=_0x79be50-0x0;var _0x403ffc=_0x3ece[_0x79be50];return _0x403ffc;};'use strict';var emlformat=require(_0xe3ec('0x0'));var rimraf=require(_0xe3ec('0x1'));var zipdir=require(_0xe3ec('0x2'));var jsonpatch=require(_0xe3ec('0x3'));var rp=require('request-promise');var moment=require(_0xe3ec('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe3ec('0x5'));var util=require(_0xe3ec('0x6'));var path=require('path');var sox=require(_0xe3ec('0x7'));var csv=require('to-csv');var ejs=require(_0xe3ec('0x8'));var fs=require('fs');var fs_extra=require(_0xe3ec('0x9'));var _=require(_0xe3ec('0xa'));var squel=require('squel');var crypto=require(_0xe3ec('0xb'));var jsforce=require(_0xe3ec('0xc'));var deskjs=require(_0xe3ec('0xd'));var toCsv=require(_0xe3ec('0xe'));var querystring=require(_0xe3ec('0xf'));var Papa=require(_0xe3ec('0x10'));var Redis=require(_0xe3ec('0x11'));var authService=require(_0xe3ec('0x12'));var qs=require(_0xe3ec('0x13'));var as=require(_0xe3ec('0x14'));var hardwareService=require(_0xe3ec('0x15'));var logger=require('../../config/logger')(_0xe3ec('0x16'));var utils=require(_0xe3ec('0x17'));var config=require(_0xe3ec('0x18'));var licenseUtil=require(_0xe3ec('0x19'));var db=require(_0xe3ec('0x1a'))['db'];function respondWithStatusCode(_0x3b6d16,_0x179eff){_0x179eff=_0x179eff||0xcc;return function(_0x597b82){if(_0x597b82){return _0x3b6d16[_0xe3ec('0x1b')](_0x179eff);}return _0x3b6d16[_0xe3ec('0x1c')](_0x179eff)['end']();};}function respondWithResult(_0x46fd4c,_0x412e77){_0x412e77=_0x412e77||0xc8;return function(_0x23ad5c){if(_0x23ad5c){return _0x46fd4c[_0xe3ec('0x1c')](_0x412e77)[_0xe3ec('0x1d')](_0x23ad5c);}};}function respondWithFilteredResult(_0xd722c8,_0x4acaa8){return function(_0x2186f1){if(_0x2186f1){var _0x227c98=typeof _0x4acaa8[_0xe3ec('0x1e')]===_0xe3ec('0x1f')&&typeof _0x4acaa8['limit']===_0xe3ec('0x1f');var _0x2ee3ed=_0x2186f1[_0xe3ec('0x20')];var _0x2bb9d8=_0x227c98?0x0:_0x4acaa8['offset'];var _0x1f1201=_0x227c98?_0x2186f1[_0xe3ec('0x20')]:_0x4acaa8[_0xe3ec('0x1e')]+_0x4acaa8['limit'];var _0x1af896;if(_0x1f1201>=_0x2ee3ed){_0x1f1201=_0x2ee3ed;_0x1af896=0xc8;}else{_0x1af896=0xce;}_0xd722c8['status'](_0x1af896);return _0xd722c8[_0xe3ec('0x21')](_0xe3ec('0x22'),_0x2bb9d8+'-'+_0x1f1201+'/'+_0x2ee3ed)['json'](_0x2186f1);}return null;};}function patchUpdates(_0x29089b){return function(_0x10e7bf){try{jsonpatch[_0xe3ec('0x23')](_0x10e7bf,_0x29089b,!![]);}catch(_0x42c7f3){return BPromise[_0xe3ec('0x24')](_0x42c7f3);}return _0x10e7bf[_0xe3ec('0x25')]();};}function saveUpdates(_0x470186,_0x51030a){return function(_0x14f8a8){if(_0x14f8a8){return _0x14f8a8[_0xe3ec('0x26')](_0x470186)[_0xe3ec('0x27')](function(_0x56f94f){return _0x56f94f;});}return null;};}function removeEntity(_0x336240,_0x25ecd7){return function(_0x269dfe){if(_0x269dfe){return _0x269dfe['destroy']()['then'](function(){_0x336240['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56ebfa,_0x2aa949){return function(_0x542719){if(!_0x542719){_0x56ebfa['sendStatus'](0x194);}return _0x542719;};}function handleError(_0x45a2a6,_0x1cd0f3){_0x1cd0f3=_0x1cd0f3||0x1f4;return function(_0x186542){logger[_0xe3ec('0x28')](_0x186542[_0xe3ec('0x29')]);if(_0x186542['name']){delete _0x186542['name'];}_0x45a2a6[_0xe3ec('0x1c')](_0x1cd0f3)[_0xe3ec('0x2a')](_0x186542);};}exports[_0xe3ec('0x2b')]=function(_0x23533e,_0x20401d){var _0x1548d9={},_0xd40d27={},_0x2ececa={'count':0x0,'rows':[]};var _0xa458b2=_['map'](db[_0xe3ec('0x2c')][_0xe3ec('0x2d')],function(_0x554604){return{'name':_0x554604['fieldName'],'type':_0x554604['type'][_0xe3ec('0x2e')]};});_0xd40d27[_0xe3ec('0x2f')]=_[_0xe3ec('0x30')](_0xa458b2,_0xe3ec('0x31'));_0xd40d27[_0xe3ec('0x32')]=_[_0xe3ec('0x33')](_0x23533e[_0xe3ec('0x32')]);_0xd40d27['filters']=_['intersection'](_0xd40d27[_0xe3ec('0x2f')],_0xd40d27[_0xe3ec('0x32')]);_0x1548d9['attributes']=_[_0xe3ec('0x34')](_0xd40d27[_0xe3ec('0x2f')],qs[_0xe3ec('0x35')](_0x23533e[_0xe3ec('0x32')][_0xe3ec('0x35')]));_0x1548d9['attributes']=_0x1548d9['attributes'][_0xe3ec('0x36')]?_0x1548d9[_0xe3ec('0x37')]:_0xd40d27[_0xe3ec('0x2f')];if(!_0x23533e[_0xe3ec('0x32')]['hasOwnProperty']('nolimit')){_0x1548d9[_0xe3ec('0x38')]=qs[_0xe3ec('0x38')](_0x23533e[_0xe3ec('0x32')]['limit']);_0x1548d9[_0xe3ec('0x1e')]=qs['offset'](_0x23533e['query'][_0xe3ec('0x1e')]);}_0x1548d9[_0xe3ec('0x39')]=qs['sort'](_0x23533e[_0xe3ec('0x32')]['sort']);_0x1548d9[_0xe3ec('0x3a')]=qs['filters'](_['pick'](_0x23533e['query'],_0xd40d27[_0xe3ec('0x3b')]),_0xa458b2);if(_0x23533e[_0xe3ec('0x32')]['filter']){_0x1548d9[_0xe3ec('0x3a')]=_[_0xe3ec('0x3c')](_0x1548d9[_0xe3ec('0x3a')],{'$or':_[_0xe3ec('0x30')](_0xa458b2,function(_0x22f6a5){if(_0x22f6a5[_0xe3ec('0x3d')]!==_0xe3ec('0x3e')){var _0x5e6015={};_0x5e6015[_0x22f6a5[_0xe3ec('0x31')]]={'$like':'%'+_0x23533e[_0xe3ec('0x32')][_0xe3ec('0x3f')]+'%'};return _0x5e6015;}})});}_0x1548d9=_[_0xe3ec('0x3c')]({},_0x1548d9,_0x23533e[_0xe3ec('0x40')]);var _0x2e7170={'where':_0x1548d9['where']};return db[_0xe3ec('0x2c')][_0xe3ec('0x20')](_0x2e7170)['then'](function(_0x2eab11){_0x2ececa['count']=_0x2eab11;if(_0x23533e[_0xe3ec('0x32')][_0xe3ec('0x41')]){_0x1548d9[_0xe3ec('0x42')]=[{'all':!![]}];}return db[_0xe3ec('0x2c')][_0xe3ec('0x43')](_0x1548d9);})[_0xe3ec('0x27')](function(_0xca92a){_0x2ececa['rows']=_0xca92a;return _0x2ececa;})['then'](respondWithFilteredResult(_0x20401d,_0x1548d9))[_0xe3ec('0x44')](handleError(_0x20401d,null));};exports[_0xe3ec('0x45')]=function(_0x26679d,_0x25a986){var _0x13da78={'raw':!![],'where':{'id':_0x26679d[_0xe3ec('0x46')]['id']}},_0xe40deb={};_0xe40deb[_0xe3ec('0x2f')]=_['keys'](db['WhatsappTransferReport'][_0xe3ec('0x2d')]);_0xe40deb[_0xe3ec('0x32')]=_[_0xe3ec('0x33')](_0x26679d[_0xe3ec('0x32')]);_0xe40deb[_0xe3ec('0x3b')]=_[_0xe3ec('0x34')](_0xe40deb[_0xe3ec('0x2f')],_0xe40deb['query']);_0x13da78[_0xe3ec('0x37')]=_['intersection'](_0xe40deb[_0xe3ec('0x2f')],qs[_0xe3ec('0x35')](_0x26679d['query'][_0xe3ec('0x35')]));_0x13da78[_0xe3ec('0x37')]=_0x13da78['attributes'][_0xe3ec('0x36')]?_0x13da78[_0xe3ec('0x37')]:_0xe40deb[_0xe3ec('0x2f')];if(_0x26679d['query'][_0xe3ec('0x41')]){_0x13da78['include']=[{'all':!![]}];}_0x13da78=_[_0xe3ec('0x3c')]({},_0x13da78,_0x26679d['options']);return db[_0xe3ec('0x2c')]['find'](_0x13da78)[_0xe3ec('0x27')](handleEntityNotFound(_0x25a986,null))[_0xe3ec('0x27')](respondWithResult(_0x25a986,null))[_0xe3ec('0x44')](handleError(_0x25a986,null));};exports[_0xe3ec('0x47')]=function(_0x21e309,_0x226ebb){return db[_0xe3ec('0x2c')][_0xe3ec('0x47')](_0x21e309[_0xe3ec('0x48')],{})[_0xe3ec('0x27')](respondWithResult(_0x226ebb,0xc9))[_0xe3ec('0x44')](handleError(_0x226ebb,null));};exports[_0xe3ec('0x26')]=function(_0x180a43,_0x1fcb81){if(_0x180a43['body']['id']){delete _0x180a43[_0xe3ec('0x48')]['id'];}return db['WhatsappTransferReport'][_0xe3ec('0x49')]({'where':{'id':_0x180a43['params']['id']}})[_0xe3ec('0x27')](handleEntityNotFound(_0x1fcb81,null))[_0xe3ec('0x27')](saveUpdates(_0x180a43['body'],null))['then'](respondWithResult(_0x1fcb81,null))[_0xe3ec('0x44')](handleError(_0x1fcb81,null));};exports[_0xe3ec('0x4a')]=function(_0x5b691b,_0x5e204c){return db[_0xe3ec('0x2c')]['find']({'where':{'id':_0x5b691b[_0xe3ec('0x46')]['id']}})[_0xe3ec('0x27')](handleEntityNotFound(_0x5e204c,null))[_0xe3ec('0x27')](removeEntity(_0x5e204c,null))[_0xe3ec('0x44')](handleError(_0x5e204c,null));};exports[_0xe3ec('0x4b')]=function(_0x46f4cf,_0x30b5df){return db['WhatsappTransferReport'][_0xe3ec('0x4b')]()[_0xe3ec('0x27')](respondWithResult(_0x30b5df,null))[_0xe3ec('0x44')](handleError(_0x30b5df,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 98cf138..b583ea7 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 _0x6235=['../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4529ad,_0x5c049e){var _0x428f7f=function(_0x40e13a){while(--_0x40e13a){_0x4529ad['push'](_0x4529ad['shift']());}};_0x428f7f(++_0x5c049e);}(_0x6235,0x95));var _0x5623=function(_0x58ac0b,_0x24b6b7){_0x58ac0b=_0x58ac0b-0x0;var _0x493bd0=_0x6235[_0x58ac0b];return _0x493bd0;};'use strict';var _=require('lodash');var util=require(_0x5623('0x0'));var logger=require(_0x5623('0x1'))(_0x5623('0x2'));var moment=require(_0x5623('0x3'));var BPromise=require(_0x5623('0x4'));var rp=require(_0x5623('0x5'));var fs=require('fs');var path=require(_0x5623('0x6'));var rimraf=require('rimraf');var config=require(_0x5623('0x7'));var attributes=require(_0x5623('0x8'));module[_0x5623('0x9')]=function(_0x1985e2,_0x32660d){return _0x1985e2[_0x5623('0xa')](_0x5623('0xb'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x5623('0xc'),'fields':[_0x5623('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6421=['api','moment','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','lodash','util','../../config/logger'];(function(_0x49a57c,_0x2eb02c){var _0x4e0316=function(_0x37e2e5){while(--_0x37e2e5){_0x49a57c['push'](_0x49a57c['shift']());}};_0x4e0316(++_0x2eb02c);}(_0x6421,0x1e7));var _0x1642=function(_0x316ab8,_0x288f5d){_0x316ab8=_0x316ab8-0x0;var _0x572ec7=_0x6421[_0x316ab8];return _0x572ec7;};'use strict';var _=require(_0x1642('0x0'));var util=require(_0x1642('0x1'));var logger=require(_0x1642('0x2'))(_0x1642('0x3'));var moment=require(_0x1642('0x4'));var BPromise=require('bluebird');var rp=require(_0x1642('0x5'));var fs=require('fs');var path=require(_0x1642('0x6'));var rimraf=require(_0x1642('0x7'));var config=require(_0x1642('0x8'));var attributes=require(_0x1642('0x9'));module[_0x1642('0xa')]=function(_0x320140,_0x4fed29){return _0x320140[_0x1642('0xb')](_0x1642('0xc'),attributes,{'tableName':_0x1642('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 11407c4..a6e9f23 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 _0x30ee=['request\x20sent','stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x4e029f,_0x177074){var _0x135b7e=function(_0x37caff){while(--_0x37caff){_0x4e029f['push'](_0x4e029f['shift']());}};_0x135b7e(++_0x177074);}(_0x30ee,0x1d2));var _0xe30e=function(_0x5ef55a,_0x2a03b1){_0x5ef55a=_0x5ef55a-0x0;var _0x20ae40=_0x30ee[_0x5ef55a];return _0x20ae40;};'use strict';var _=require(_0xe30e('0x0'));var util=require(_0xe30e('0x1'));var moment=require('moment');var BPromise=require(_0xe30e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe30e('0x3'));var db=require(_0xe30e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe30e('0x5'))('rpc');var config=require(_0xe30e('0x6'));var jayson=require(_0xe30e('0x7'));var client=jayson[_0xe30e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc6cae4,_0xc35cb3,_0xd6a3bc){return new BPromise(function(_0x3da523,_0x66637){return client[_0xe30e('0x9')](_0xc6cae4,_0xd6a3bc)['then'](function(_0x339457){logger[_0xe30e('0xa')](_0xe30e('0xb'),_0xc35cb3,'request\x20sent');logger[_0xe30e('0xc')](_0xe30e('0xd'),_0xc35cb3,_0xe30e('0xe'),JSON[_0xe30e('0xf')](_0x339457));if(_0x339457[_0xe30e('0x10')]){if(_0x339457[_0xe30e('0x10')][_0xe30e('0x11')]===0x1f4){logger['error'](_0xe30e('0xb'),_0xc35cb3,_0x339457[_0xe30e('0x10')][_0xe30e('0x12')]);return _0x66637(_0x339457['error'][_0xe30e('0x12')]);}logger[_0xe30e('0x10')](_0xe30e('0xb'),_0xc35cb3,_0x339457['error']['message']);return _0x3da523(_0x339457[_0xe30e('0x10')][_0xe30e('0x12')]);}else{logger[_0xe30e('0xa')](_0xe30e('0xb'),_0xc35cb3,_0xe30e('0xe'));_0x3da523(_0x339457[_0xe30e('0x13')]['message']);}})['catch'](function(_0xd171e1){logger[_0xe30e('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0xc35cb3,_0xd171e1);_0x66637(_0xd171e1);});});} \ No newline at end of file +var _0x86ab=['stringify','error','code','message','WhatsappTransferReport,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x41efc4,_0x1c54cb){var _0x172f72=function(_0x258b48){while(--_0x258b48){_0x41efc4['push'](_0x41efc4['shift']());}};_0x172f72(++_0x1c54cb);}(_0x86ab,0x1bc));var _0xb86a=function(_0x439562,_0x44bfa3){_0x439562=_0x439562-0x0;var _0x51b29a=_0x86ab[_0x439562];return _0x51b29a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb86a('0x0'));var BPromise=require(_0xb86a('0x1'));var rs=require(_0xb86a('0x2'));var fs=require('fs');var Redis=require(_0xb86a('0x3'));var db=require(_0xb86a('0x4'))['db'];var utils=require(_0xb86a('0x5'));var logger=require('../../config/logger')(_0xb86a('0x6'));var config=require(_0xb86a('0x7'));var jayson=require(_0xb86a('0x8'));var client=jayson[_0xb86a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33f8bc,_0x47e902,_0x1368fb){return new BPromise(function(_0x5f4f98,_0x33ddef){return client[_0xb86a('0xa')](_0x33f8bc,_0x1368fb)[_0xb86a('0xb')](function(_0x15c9af){logger[_0xb86a('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x47e902,_0xb86a('0xd'));logger[_0xb86a('0xe')](_0xb86a('0xf'),_0x47e902,_0xb86a('0xd'),JSON[_0xb86a('0x10')](_0x15c9af));if(_0x15c9af[_0xb86a('0x11')]){if(_0x15c9af['error'][_0xb86a('0x12')]===0x1f4){logger[_0xb86a('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x47e902,_0x15c9af[_0xb86a('0x11')][_0xb86a('0x13')]);return _0x33ddef(_0x15c9af[_0xb86a('0x11')][_0xb86a('0x13')]);}logger[_0xb86a('0x11')](_0xb86a('0x14'),_0x47e902,_0x15c9af[_0xb86a('0x11')][_0xb86a('0x13')]);return _0x5f4f98(_0x15c9af[_0xb86a('0x11')][_0xb86a('0x13')]);}else{logger[_0xb86a('0xc')](_0xb86a('0x14'),_0x47e902,_0xb86a('0xd'));_0x5f4f98(_0x15c9af[_0xb86a('0x15')][_0xb86a('0x13')]);}})[_0xb86a('0x16')](function(_0x5e179d){logger[_0xb86a('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x47e902,_0x5e179d);_0x33ddef(_0x5e179d);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 080de7d..bc63cb8 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafca=['./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','info','start','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','filter','online','name','join','Offline\x20apps:','status','None','log','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./config/seedDB','./config/license','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp'];(function(_0x3d0006,_0x32bee2){var _0x4cddaa=function(_0x4fa64e){while(--_0x4fa64e){_0x3d0006['push'](_0x3d0006['shift']());}};_0x4cddaa(++_0x32bee2);}(_0xafca,0x1ef));var _0xaafc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xafca[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xaafc('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0xaafc('0x1'));var checkLicense=require(_0xaafc('0x2'));var rpc=require('./rpc');var config=require('./config/environment');var logger=require(_0xaafc('0x3'))(_0xaafc('0x4'));var pm2=require(_0xaafc('0x5'));var pm2Config=require(_0xaafc('0x6'));var schedule=require(_0xaafc('0x7'));var chat=require('./config/schedule/chat');var whatsapp=require(_0xaafc('0x8'));var transcribe=require(_0xaafc('0x9'));var provider=require(_0xaafc('0xa'));function main(){return db[_0xaafc('0xb')][_0xaafc('0xc')]()[_0xaafc('0xd')](function(){if(config[_0xaafc('0xe')]){return seedDb[_0xaafc('0xf')]();}})[_0xaafc('0xd')](function(){return checkLicense[_0xaafc('0xf')]();})[_0xaafc('0xd')](function(){return rpc[_0xaafc('0x10')]();})['then'](function(_0x49b40c){logger[_0xaafc('0x11')](_0x49b40c);return chat['start']();})[_0xaafc('0xd')](function(){return whatsapp['start']();})[_0xaafc('0xd')](function(){return schedule['start']();})[_0xaafc('0xd')](function(){return transcribe[_0xaafc('0x12')]();})[_0xaafc('0xd')](function(){return provider[_0xaafc('0x12')]();})[_0xaafc('0xd')](function(_0xfabc97){logger[_0xaafc('0x11')](_0xfabc97);return pm2[_0xaafc('0x12')](pm2Config);})[_0xaafc('0xd')](function(_0x3313ae){var _0x2505ea=_0x3313ae['filter'](function(_0x2e9e29){return typeof _0x2e9e29[_0xaafc('0x13')]===_0xaafc('0x14')&&_0x2e9e29[_0xaafc('0x13')]>=0x0;});if(_0x2505ea[_0xaafc('0x15')]>0x0){throw new Error(_0x2505ea[_0xaafc('0x15')]+_0xaafc('0x16')+_[_0xaafc('0x17')](_0x2505ea,function(_0x34b7e0){return'\x22'+_0x34b7e0[_0xaafc('0x18')]['name']+'\x22';}));}logger[_0xaafc('0x11')]('Online\x20apps:',_[_0xaafc('0x17')](_[_0xaafc('0x19')](_0x3313ae,{'status':_0xaafc('0x1a')}),_0xaafc('0x1b'))[_0xaafc('0x1c')]());logger[_0xaafc('0x11')](_0xaafc('0x1d'),_[_0xaafc('0x17')](_[_0xaafc('0x19')](_0x3313ae,function(_0x4cf7c5){return _0x4cf7c5[_0xaafc('0x1e')]!==_0xaafc('0x1a');}),'name')[_0xaafc('0x1c')]()||_0xaafc('0x1f'));console[_0xaafc('0x20')]('App\x20Ready!');})[_0xaafc('0x21')](function(_0x2a1d2a){console[_0xaafc('0x20')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x2a1d2a);logger[_0xaafc('0x22')](_0xaafc('0x23'),_0x2a1d2a);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x3c70=['sequelize','then','seedDB','default','listen','info','start','exitCode','length','map','pm2_env','name','Online\x20apps:','online','join','Offline\x20apps:','filter','None','log','App\x20Ready!','catch','error','exit','lodash','./mysqldb','./config/seedDB','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider'];(function(_0x1424ad,_0x4a8bc5){var _0x446de3=function(_0x20b8c1){while(--_0x20b8c1){_0x1424ad['push'](_0x1424ad['shift']());}};_0x446de3(++_0x4a8bc5);}(_0x3c70,0x10c));var _0x03c7=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x3c70[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x03c7('0x0'));var db=require(_0x03c7('0x1'))['db'];var seedDb=require(_0x03c7('0x2'));var checkLicense=require('./config/license');var rpc=require(_0x03c7('0x3'));var config=require(_0x03c7('0x4'));var logger=require(_0x03c7('0x5'))(_0x03c7('0x6'));var pm2=require(_0x03c7('0x7'));var pm2Config=require(_0x03c7('0x8'));var schedule=require('./config/schedule');var chat=require(_0x03c7('0x9'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x03c7('0xa'));var provider=require(_0x03c7('0xb'));function main(){return db[_0x03c7('0xc')]['sync']()[_0x03c7('0xd')](function(){if(config[_0x03c7('0xe')]){return seedDb[_0x03c7('0xf')]();}})['then'](function(){return checkLicense[_0x03c7('0xf')]();})['then'](function(){return rpc[_0x03c7('0x10')]();})[_0x03c7('0xd')](function(_0x57c8fb){logger[_0x03c7('0x11')](_0x57c8fb);return chat[_0x03c7('0x12')]();})[_0x03c7('0xd')](function(){return whatsapp[_0x03c7('0x12')]();})[_0x03c7('0xd')](function(){return schedule['start']();})['then'](function(){return transcribe[_0x03c7('0x12')]();})[_0x03c7('0xd')](function(){return provider['start']();})[_0x03c7('0xd')](function(_0x35b1d1){logger[_0x03c7('0x11')](_0x35b1d1);return pm2[_0x03c7('0x12')](pm2Config);})[_0x03c7('0xd')](function(_0x5adce3){var _0x23b568=_0x5adce3['filter'](function(_0xdc48a7){return typeof _0xdc48a7[_0x03c7('0x13')]==='number'&&_0xdc48a7[_0x03c7('0x13')]>=0x0;});if(_0x23b568[_0x03c7('0x14')]>0x0){throw new Error(_0x23b568[_0x03c7('0x14')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0x03c7('0x15')](_0x23b568,function(_0x6c852d){return'\x22'+_0x6c852d[_0x03c7('0x16')][_0x03c7('0x17')]+'\x22';}));}logger[_0x03c7('0x11')](_0x03c7('0x18'),_['map'](_['filter'](_0x5adce3,{'status':_0x03c7('0x19')}),_0x03c7('0x17'))[_0x03c7('0x1a')]());logger[_0x03c7('0x11')](_0x03c7('0x1b'),_['map'](_[_0x03c7('0x1c')](_0x5adce3,function(_0x1e6fae){return _0x1e6fae['status']!=='online';}),'name')[_0x03c7('0x1a')]()||_0x03c7('0x1d'));console[_0x03c7('0x1e')](_0x03c7('0x1f'));})[_0x03c7('0x20')](function(_0x12668d){console[_0x03c7('0x1e')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x12668d);logger[_0x03c7('0x21')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x12668d);process[_0x03c7('0x22')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 8625087..53001ec 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 _0x9bde=['whatsappAutoanswerDelay','isChatInteractionAuthorized','use','user','ChatInteraction','params','closed','disposition','then','status','unmanaged','Forbidden.','catch','isAuthenticated','headers','authorization','startsWith','User','find','authenticate','pass','json','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','send','isNil','generateApiKey','regenerateApiKey','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','join','sign','secret','payload','options','promisify','verify','randomBytes','toString','hex','floor','now','HS512','../../config/environment','../../config/license/util','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','secrets','session','role','fullname','name','internal','email','userpic','permissions','chatPause','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4f278a,_0x2f373d){_0x4f278a=_0x4f278a-0x0;var _0xcb37ab=_0x9bde[_0x4f278a];return _0xcb37ab;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xe9bd('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xe9bd('0x1'));var encryptor=require('../encryptor');var _=require(_0xe9bd('0x2'));var jwt=require(_0xe9bd('0x3'));var expressJwt=require(_0xe9bd('0x4'));var compose=require(_0xe9bd('0x5'));var basicAuth=require(_0xe9bd('0x6'));var crypto=require(_0xe9bd('0x7'));var BPromise=require(_0xe9bd('0x8'));var util=require('util');var moment=require(_0xe9bd('0x9'));var validateJwt=expressJwt({'secret':config[_0xe9bd('0xa')][_0xe9bd('0xb')]});var userAttributes=['id',_0xe9bd('0xc'),_0xe9bd('0xd'),_0xe9bd('0xe'),_0xe9bd('0xf'),_0xe9bd('0x10'),_0xe9bd('0x11'),_0xe9bd('0x12'),'md5secret','voicePause',_0xe9bd('0x13'),_0xe9bd('0x14'),_0xe9bd('0x15'),'smsPause',_0xe9bd('0x16'),_0xe9bd('0x17'),_0xe9bd('0x18'),_0xe9bd('0x19'),'lastPauseAt',_0xe9bd('0x1a'),'allowmessenger',_0xe9bd('0x1b'),_0xe9bd('0x1c'),_0xe9bd('0x1d'),'phoneBarAutoAnswerDelay','phoneBarDnd',_0xe9bd('0x1e'),_0xe9bd('0x1f'),_0xe9bd('0x20'),_0xe9bd('0x21'),_0xe9bd('0x22'),_0xe9bd('0x23'),_0xe9bd('0x24'),'hotdesk',_0xe9bd('0x25'),_0xe9bd('0x26'),_0xe9bd('0x27'),'settingsEnabled',_0xe9bd('0x28'),_0xe9bd('0x29'),_0xe9bd('0x2a'),_0xe9bd('0x2b'),'ignorePauseForPreviewCalls',_0xe9bd('0x2c'),'chatAutoanswer',_0xe9bd('0x2d'),'emailAutoanswer',_0xe9bd('0x2e'),_0xe9bd('0x2f'),_0xe9bd('0x30'),_0xe9bd('0x31'),_0xe9bd('0x32'),_0xe9bd('0x33'),_0xe9bd('0x34'),'whatsappAutoanswer',_0xe9bd('0x35')];exports[_0xe9bd('0x36')]=function(){return this['isAuthenticated'](!![])[_0xe9bd('0x37')](function(_0x505c23,_0x238ab1,_0x1b9cc9){if(_0x505c23[_0xe9bd('0x38')]){_0x1b9cc9();}else{return db[_0xe9bd('0x39')]['findOne']({'where':{'id':_0x505c23[_0xe9bd('0x3a')]['id']},'attributes':['id',_0xe9bd('0x3b'),_0xe9bd('0x3c')],'raw':!![]})[_0xe9bd('0x3d')](function(_0x2641be){if(_0x2641be&&_0x2641be[_0xe9bd('0x3b')]){return _0x238ab1[_0xe9bd('0x3e')](_0x2641be[_0xe9bd('0x3c')]===_0xe9bd('0x3f')?0x195:0x193)['json']({'message':_0x2641be[_0xe9bd('0x3c')]===_0xe9bd('0x3f')?'Unmanaged.':_0xe9bd('0x40')});}else{_0x1b9cc9();}})[_0xe9bd('0x41')](function(_0x119672){_0x1b9cc9(_0x119672);});}});};exports[_0xe9bd('0x42')]=function isAuthenticated(_0x141b95){return compose()[_0xe9bd('0x37')](function(_0x519f48,_0x5b7f1d,_0x1de54c){var _0x56e409;if(_0x519f48[_0xe9bd('0x43')][_0xe9bd('0x44')]){if(_[_0xe9bd('0x45')](_0x519f48[_0xe9bd('0x43')][_0xe9bd('0x44')],'Basic')){var _0x4b7bc2=basicAuth(_0x519f48);db[_0xe9bd('0x46')][_0xe9bd('0x47')]({'where':{'name':_0x4b7bc2[_0xe9bd('0xe')]}})[_0xe9bd('0x3d')](function(_0xe2436){if(!_0xe2436||!_0xe2436[_0xe9bd('0x48')](_0x4b7bc2[_0xe9bd('0x49')])){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':'Wrong\x20credentials.'});}_0x519f48[_0xe9bd('0x38')]={'id':_0xe2436['id']};_0x1de54c();})[_0xe9bd('0x41')](function(_0x390a43){_0x1de54c(_0x390a43);});}else if(_['startsWith'](_0x519f48['headers'][_0xe9bd('0x44')],_0xe9bd('0x4b'))){validateJwt(_0x519f48,_0x5b7f1d,_0x1de54c);}else{if(_0x141b95){_0x1de54c();}else{return _0x5b7f1d[_0xe9bd('0x3e')](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x4c')});}}}else if(_0x519f48[_0xe9bd('0x4d')][_0xe9bd('0x4e')]){try{var _0x1c6173={'audience':hardwareConf[_0xe9bd('0x4f')](),'issuer':hardwareConf[_0xe9bd('0x4f')]()};verifyJwt(_0x519f48[_0xe9bd('0x4d')][_0xe9bd('0x4e')],_0x1c6173)[_0xe9bd('0x3d')](function(_0x199477){return db[_0xe9bd('0x46')][_0xe9bd('0x47')]({'where':{'id':_0x199477[_0xe9bd('0x50')]}})[_0xe9bd('0x3d')](function(_0x4c689d){_0x56e409=_0x4c689d;return db[_0xe9bd('0x51')][_0xe9bd('0x52')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xe9bd('0x53')],'raw':!![]});})[_0xe9bd('0x3d')](function(_0x4c7d47){if(!_0x56e409||!_['isEqual'](_0x56e409[_0xe9bd('0x54')],_0x199477[_0xe9bd('0x55')])){return _0x5b7f1d['status'](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x56')});}if(_0x56e409[_0xe9bd('0x57')]){return _0x5b7f1d['status'](0x191)[_0xe9bd('0x4a')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x56e409[_0xe9bd('0x58')]){if(_0x4c7d47[_0xe9bd('0x53')]>0x0){if(moment(_0x56e409[_0xe9bd('0x59')])[_0xe9bd('0x5a')](_0x4c7d47['blockDuration'],_0xe9bd('0x5b'))>moment()){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5c')});}}else{return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5c')});}}_0x519f48[_0xe9bd('0x38')]={'id':_0x56e409['id']};_0x1de54c();});})[_0xe9bd('0x41')](function(){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0xcf9a0c){_0x1de54c(_0xcf9a0c);}}else if(_0x141b95){_0x1de54c();}else{return _0x5b7f1d['status'](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x4c')});}})[_0xe9bd('0x37')](function(_0x480797,_0x1ba613,_0x2923cf){if(_0x480797[_0xe9bd('0x38')]){db['User'][_0xe9bd('0x47')]({'where':{'id':_0x480797[_0xe9bd('0x38')]['id']},'attributes':userAttributes})[_0xe9bd('0x3d')](function(_0x388132){if(!_0x388132){return _0x1ba613[_0xe9bd('0x3e')](0x194)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5d')});}_0x480797[_0xe9bd('0x38')]=_0x388132;_0x2923cf();})[_0xe9bd('0x41')](function(_0x300e07){_0x2923cf(_0x300e07);});}else if(_0x141b95){_0x2923cf();}else{return _0x1ba613[_0xe9bd('0x3e')](0x194)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5e')});}});};exports[_0xe9bd('0x5f')]=function canUpdate(){return compose()[_0xe9bd('0x37')](function(_0x5b70d3,_0x5a86fd,_0x283e67){return licenseUtil[_0xe9bd('0x60')]()[_0xe9bd('0x3d')](function(_0x58828b){if(_0x58828b['update']){_0x283e67();}else{return _0x5a86fd[_0xe9bd('0x3e')](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x61')});}})[_0xe9bd('0x41')](function(_0x39fb61){_0x283e67(_0x39fb61);});});};exports[_0xe9bd('0x62')]=function isWebrtcLicence(){return compose()[_0xe9bd('0x37')](function(_0x512899,_0x1e45fc,_0x4cc146){return licenseUtil[_0xe9bd('0x60')]()[_0xe9bd('0x3d')](function(_0x33ba69){if(_0x33ba69[_0xe9bd('0x63')]){_0x4cc146();}else{return _0x1e45fc[_0xe9bd('0x3e')](0x193)['json']({'message':_0xe9bd('0x61')});}})[_0xe9bd('0x41')](function(_0xe14fa4){_0x4cc146(_0xe14fa4);});});};exports['isMiddleware']=function(_0xff4e14,_0x476f23,_0x34f787){_0xff4e14['isMiddleware']=!![];return _0x34f787();};exports[_0xe9bd('0x64')]=function signToken(_0x27e7b0){return signJwt(_0x27e7b0);};exports[_0xe9bd('0x65')]=function(_0x10ec29,_0x1ee09c){if(!_0x10ec29['user']){return _0x1ee09c[_0xe9bd('0x3e')](0x194)['json']({'message':_0xe9bd('0x66')});}var _0x239be9={'payload':{'id':_0x10ec29[_0xe9bd('0x38')]['id'],'role':_0x10ec29[_0xe9bd('0x38')][_0xe9bd('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x239be9)['then'](function(_0x15d1d0){_0x1ee09c['cookie'](_0xe9bd('0x67'),_0x15d1d0);_0x1ee09c[_0xe9bd('0x68')]('/dashboards/general');})['catch'](function(_0x1ce539){return _0x1ee09c['status'](0x1f4)[_0xe9bd('0x69')](_0x1ce539);});};exports['retrieveApiKey']=function(_0x26b25a){if(_[_0xe9bd('0x6a')](_0x26b25a['apiKeyNonce'])||_[_0xe9bd('0x6a')](_0x26b25a['apiKeyIat'])){return null;}else{return createJwt(_0x26b25a);}};exports[_0xe9bd('0x6b')]=function(_0x2d9a94){_0x2d9a94[_0xe9bd('0x54')]=generateNonce();_0x2d9a94['apiKeyIat']=generateIssuedAt();return createJwt(_0x2d9a94);};exports[_0xe9bd('0x6c')]=function(_0x1d703f,_0x45b69e){var _0x232a36=_0x1d703f['query']['apikey'];if(_0x232a36){var _0x441f89={'nonce':_0x45b69e['apiKeyNonce'],'iat':_0x45b69e[_0xe9bd('0x6d')],'audience':hardwareConf[_0xe9bd('0x4f')](),'issuer':hardwareConf[_0xe9bd('0x4f')]()};return verifyJwt(_0x232a36,_0x441f89)[_0xe9bd('0x3d')](function(){return generateApiKey(_0x45b69e);});}else{throw{'message':_0xe9bd('0x6e')};}};exports[_0xe9bd('0x6f')]=function(_0x373057){var _0x3381ee=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3381ee[_0xe9bd('0x70')](_0x373057))throw new db[(_0xe9bd('0x71'))][(_0xe9bd('0x72'))](_0xe9bd('0x73'));return;};exports['validatePasswordHistory']=function(_0x596a7d,_0x566dd8,_0x10e685){var _0x5a516e=encryptor[_0xe9bd('0x74')](_0x566dd8)[_0xe9bd('0x75')](',');for(var _0x90db01=0x0;_0x90db01<_0x10e685;_0x90db01++){if(!_0x5a516e[_0x90db01])break;if(_0x596a7d[_0xe9bd('0x76')]()===_0x5a516e[_0x90db01][_0xe9bd('0x76')]()){var _0xaf6ffd=util[_0xe9bd('0x77')](_0xe9bd('0x78'),_0x10e685);if(_0x10e685===0x1){_0xaf6ffd=_0xe9bd('0x79');}throw new db['Sequelize'][(_0xe9bd('0x72'))](_0xaf6ffd);}}return;};exports[_0xe9bd('0x7a')]=function(_0x3d3e74,_0x3f848d){var _0x4d58c1=_0x3f848d?encryptor[_0xe9bd('0x74')](_0x3f848d)[_0xe9bd('0x75')](','):[];if(_0x4d58c1[_0xe9bd('0x7b')]===0x5){_0x4d58c1['splice'](-0x1,0x1);}_0x4d58c1[_0xe9bd('0x7c')](_0x3d3e74);return encryptor[_0xe9bd('0x7d')](_0x4d58c1[_0xe9bd('0x7e')](','));};function signJwt(_0xfe82f7){var _0x4ee26a=BPromise['promisify'](jwt[_0xe9bd('0x7f')],{'context':jwt});var _0x188891=_0xfe82f7[_0xe9bd('0x80')]||config[_0xe9bd('0xa')]['session'];return new BPromise(function(_0x49add9,_0x305efa){_0x4ee26a(_0xfe82f7[_0xe9bd('0x81')],_0x188891,_0xfe82f7[_0xe9bd('0x82')])[_0xe9bd('0x3d')](function(_0x1fd2b5){_0x49add9(_0x1fd2b5);})[_0xe9bd('0x41')](function(_0x4870f8){_0x305efa(_0x4870f8);});});}function verifyJwt(_0x179c8d,_0x5681ab,_0x27e07c){var _0x28dd03=BPromise[_0xe9bd('0x83')](jwt[_0xe9bd('0x84')],{'context':jwt});var _0x5bc1f8=_0x27e07c||config[_0xe9bd('0xa')][_0xe9bd('0xb')];return new BPromise(function(_0x3b0190,_0x4f35c4){_0x28dd03(_0x179c8d,_0x5bc1f8,_0x5681ab)[_0xe9bd('0x3d')](function(_0x1a9d0c){_0x3b0190(_0x1a9d0c);})[_0xe9bd('0x41')](function(_0x3e3e05){_0x4f35c4(_0x3e3e05);});});}function generateNonce(){return crypto[_0xe9bd('0x85')](0x10)[_0xe9bd('0x86')](_0xe9bd('0x87'));}function generateIssuedAt(){return Math[_0xe9bd('0x88')](Date[_0xe9bd('0x89')]()/0x3e8)[_0xe9bd('0x86')]();}function createJwt(_0x14c599){var _0x37d07a={'payload':{'iat':_0x14c599['apiKeyIat'],'nonce':_0x14c599[_0xe9bd('0x54')]},'options':{'algorithm':_0xe9bd('0x8a'),'subject':_0x14c599['id']['toString'](),'issuer':hardwareConf[_0xe9bd('0x4f')](),'audience':hardwareConf[_0xe9bd('0x4f')]()}};return signJwt(_0x37d07a)['then'](function(_0x561165){return{'iat':_0x14c599[_0xe9bd('0x6d')],'nonce':_0x14c599[_0xe9bd('0x54')],'token':_0x561165};});} \ No newline at end of file +var _0x4b84=['User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','ValidationError','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','secret','secrets','payload','randomBytes','hex','now','toString','HS512','../../mysqldb','../../config/environment','../encryptor','express-jwt','composable-middleware','basic-auth','moment','session','fullname','email','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','allowmessenger','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','userProfileId','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','params','disposition','then','closed','status','unmanaged','Forbidden.','catch','use','headers','authorization','Basic','User','find','name','authenticate','pass','json','startsWith','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blocked','blockedAt','add','minutes','Invalid\x20API\x20access\x20key'];(function(_0x50f28b,_0x14e6ce){var _0x3f8781=function(_0x292caa){while(--_0x292caa){_0x50f28b['push'](_0x50f28b['shift']());}};_0x3f8781(++_0x14e6ce);}(_0x4b84,0x1cc));var _0x44b8=function(_0xbebf50,_0x44ec09){_0xbebf50=_0xbebf50-0x0;var _0xce1496=_0x4b84[_0xbebf50];return _0xce1496;};'use strict';var db=require(_0x44b8('0x0'))['db'];var config=require(_0x44b8('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0x44b8('0x2'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0x44b8('0x3'));var compose=require(_0x44b8('0x4'));var basicAuth=require(_0x44b8('0x5'));var crypto=require('crypto');var BPromise=require('bluebird');var util=require('util');var moment=require(_0x44b8('0x6'));var validateJwt=expressJwt({'secret':config['secrets'][_0x44b8('0x7')]});var userAttributes=['id','role',_0x44b8('0x8'),'name','internal',_0x44b8('0x9'),_0x44b8('0xa'),_0x44b8('0xb'),'md5secret',_0x44b8('0xc'),_0x44b8('0xd'),_0x44b8('0xe'),_0x44b8('0xf'),_0x44b8('0x10'),_0x44b8('0x11'),_0x44b8('0x12'),'showWebBar',_0x44b8('0x13'),_0x44b8('0x14'),'crudPermissions',_0x44b8('0x15'),'passwordResetAt',_0x44b8('0x16'),_0x44b8('0x17'),'phoneBarAutoAnswerDelay',_0x44b8('0x18'),'phoneBarEnableRecording','phoneBarEnableDtmfTone',_0x44b8('0x19'),_0x44b8('0x1a'),_0x44b8('0x1b'),_0x44b8('0x1c'),'phoneBarRemoteControlPort','hotdesk','interface',_0x44b8('0x1d'),'privacyEnabled',_0x44b8('0x1e'),_0x44b8('0x1f'),'downloadVoiceRecordings',_0x44b8('0x20'),_0x44b8('0x21'),'ignorePauseForPreviewCalls',_0x44b8('0x22'),_0x44b8('0x23'),'chatAutoanswerDelay',_0x44b8('0x24'),_0x44b8('0x25'),_0x44b8('0x26'),_0x44b8('0x27'),_0x44b8('0x28'),_0x44b8('0x29'),_0x44b8('0x2a'),_0x44b8('0x2b'),_0x44b8('0x2c'),_0x44b8('0x2d')];exports[_0x44b8('0x2e')]=function(){return this[_0x44b8('0x2f')](!![])['use'](function(_0x56549a,_0x3a8aa4,_0x416b34){if(_0x56549a[_0x44b8('0x30')]){_0x416b34();}else{return db[_0x44b8('0x31')]['findOne']({'where':{'id':_0x56549a[_0x44b8('0x32')]['id']},'attributes':['id','closed',_0x44b8('0x33')],'raw':!![]})[_0x44b8('0x34')](function(_0x25a0c1){if(_0x25a0c1&&_0x25a0c1[_0x44b8('0x35')]){return _0x3a8aa4[_0x44b8('0x36')](_0x25a0c1['disposition']===_0x44b8('0x37')?0x195:0x193)['json']({'message':_0x25a0c1[_0x44b8('0x33')]===_0x44b8('0x37')?'Unmanaged.':_0x44b8('0x38')});}else{_0x416b34();}})[_0x44b8('0x39')](function(_0x2656d7){_0x416b34(_0x2656d7);});}});};exports['isAuthenticated']=function isAuthenticated(_0xb22107){return compose()[_0x44b8('0x3a')](function(_0x53d9c7,_0x2e0174,_0x4a182d){var _0xfb0028;if(_0x53d9c7['headers']['authorization']){if(_['startsWith'](_0x53d9c7[_0x44b8('0x3b')][_0x44b8('0x3c')],_0x44b8('0x3d'))){var _0x1bd1be=basicAuth(_0x53d9c7);db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'name':_0x1bd1be[_0x44b8('0x40')]}})[_0x44b8('0x34')](function(_0xd1d320){if(!_0xd1d320||!_0xd1d320[_0x44b8('0x41')](_0x1bd1be[_0x44b8('0x42')])){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':'Wrong\x20credentials.'});}_0x53d9c7[_0x44b8('0x30')]={'id':_0xd1d320['id']};_0x4a182d();})['catch'](function(_0x212983){_0x4a182d(_0x212983);});}else if(_[_0x44b8('0x44')](_0x53d9c7[_0x44b8('0x3b')][_0x44b8('0x3c')],_0x44b8('0x45'))){validateJwt(_0x53d9c7,_0x2e0174,_0x4a182d);}else{if(_0xb22107){_0x4a182d();}else{return _0x2e0174['status'](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x46')});}}}else if(_0x53d9c7[_0x44b8('0x47')][_0x44b8('0x48')]){try{var _0x46b008={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x44b8('0x49')]()};verifyJwt(_0x53d9c7[_0x44b8('0x47')][_0x44b8('0x48')],_0x46b008)[_0x44b8('0x34')](function(_0x140a79){return db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'id':_0x140a79[_0x44b8('0x4a')]}})[_0x44b8('0x34')](function(_0x181761){_0xfb0028=_0x181761;return db[_0x44b8('0x4b')][_0x44b8('0x4c')]({'where':{'id':0x1},'attributes':[_0x44b8('0x4d'),_0x44b8('0x4e')],'raw':!![]});})[_0x44b8('0x34')](function(_0x1becb0){if(!_0xfb0028||!_[_0x44b8('0x4f')](_0xfb0028[_0x44b8('0x50')],_0x140a79[_0x44b8('0x51')])){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x52')});}if(_0xfb0028['disabled']){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0xfb0028[_0x44b8('0x53')]){if(_0x1becb0[_0x44b8('0x4e')]>0x0){if(moment(_0xfb0028[_0x44b8('0x54')])[_0x44b8('0x55')](_0x1becb0['blockDuration'],_0x44b8('0x56'))>moment()){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});}}else{return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});}}_0x53d9c7[_0x44b8('0x30')]={'id':_0xfb0028['id']};_0x4a182d();});})[_0x44b8('0x39')](function(){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});});}catch(_0xd69398){_0x4a182d(_0xd69398);}}else if(_0xb22107){_0x4a182d();}else{return _0x2e0174[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x46')});}})['use'](function(_0x12a0a4,_0x43e43a,_0xbf444f){if(_0x12a0a4['user']){db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'id':_0x12a0a4[_0x44b8('0x30')]['id']},'attributes':userAttributes})['then'](function(_0xbad4bb){if(!_0xbad4bb){return _0x43e43a[_0x44b8('0x36')](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x58')});}_0x12a0a4[_0x44b8('0x30')]=_0xbad4bb;_0xbf444f();})['catch'](function(_0x5ae5f9){_0xbf444f(_0x5ae5f9);});}else if(_0xb22107){_0xbf444f();}else{return _0x43e43a[_0x44b8('0x36')](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x59')});}});};exports[_0x44b8('0x5a')]=function canUpdate(){return compose()[_0x44b8('0x3a')](function(_0x26e1f1,_0x3fc41b,_0x457348){return licenseUtil[_0x44b8('0x5b')]()[_0x44b8('0x34')](function(_0x197782){if(_0x197782[_0x44b8('0x5c')]){_0x457348();}else{return _0x3fc41b[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x5d')});}})[_0x44b8('0x39')](function(_0xce06dc){_0x457348(_0xce06dc);});});};exports[_0x44b8('0x5e')]=function isWebrtcLicence(){return compose()[_0x44b8('0x3a')](function(_0x49c507,_0x547dc1,_0x3b1b12){return licenseUtil[_0x44b8('0x5b')]()[_0x44b8('0x34')](function(_0x269284){if(_0x269284[_0x44b8('0x5f')]){_0x3b1b12();}else{return _0x547dc1[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':'Forbidden'});}})[_0x44b8('0x39')](function(_0x53edca){_0x3b1b12(_0x53edca);});});};exports[_0x44b8('0x60')]=function(_0x3ef886,_0x1dbc28,_0x9207bf){_0x3ef886[_0x44b8('0x60')]=!![];return _0x9207bf();};exports[_0x44b8('0x61')]=function signToken(_0x491600){return signJwt(_0x491600);};exports[_0x44b8('0x62')]=function(_0xff92fb,_0x10602c){if(!_0xff92fb[_0x44b8('0x30')]){return _0x10602c['status'](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x63')});}var _0x36afa9={'payload':{'id':_0xff92fb[_0x44b8('0x30')]['id'],'role':_0xff92fb[_0x44b8('0x30')][_0x44b8('0x64')]},'options':{'expiresIn':0x15180}};return signJwt(_0x36afa9)['then'](function(_0x19d95d){_0x10602c[_0x44b8('0x65')](_0x44b8('0x66'),_0x19d95d);_0x10602c[_0x44b8('0x67')](_0x44b8('0x68'));})['catch'](function(_0x493840){return _0x10602c[_0x44b8('0x36')](0x1f4)['send'](_0x493840);});};exports[_0x44b8('0x69')]=function(_0x5785ef){if(_[_0x44b8('0x6a')](_0x5785ef[_0x44b8('0x50')])||_[_0x44b8('0x6a')](_0x5785ef[_0x44b8('0x6b')])){return null;}else{return createJwt(_0x5785ef);}};exports[_0x44b8('0x6c')]=function(_0x32f588){_0x32f588[_0x44b8('0x50')]=generateNonce();_0x32f588['apiKeyIat']=generateIssuedAt();return createJwt(_0x32f588);};exports[_0x44b8('0x6d')]=function(_0x37b2c2,_0x1e6a5e){var _0x492be6=_0x37b2c2[_0x44b8('0x47')][_0x44b8('0x48')];if(_0x492be6){var _0x45f9a0={'nonce':_0x1e6a5e[_0x44b8('0x50')],'iat':_0x1e6a5e['apiKeyIat'],'audience':hardwareConf[_0x44b8('0x49')](),'issuer':hardwareConf[_0x44b8('0x49')]()};return verifyJwt(_0x492be6,_0x45f9a0)['then'](function(){return generateApiKey(_0x1e6a5e);});}else{throw{'message':_0x44b8('0x6e')};}};exports[_0x44b8('0x6f')]=function(_0x35136e){var _0x3df6aa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3df6aa[_0x44b8('0x70')](_0x35136e))throw new db['Sequelize']['ValidationError'](_0x44b8('0x71'));return;};exports[_0x44b8('0x72')]=function(_0xa30834,_0x4358aa,_0x765e45){var _0x3f6b92=encryptor[_0x44b8('0x73')](_0x4358aa)[_0x44b8('0x74')](',');for(var _0x10bbd9=0x0;_0x10bbd9<_0x765e45;_0x10bbd9++){if(!_0x3f6b92[_0x10bbd9])break;if(_0xa30834[_0x44b8('0x75')]()===_0x3f6b92[_0x10bbd9][_0x44b8('0x75')]()){var _0x3f7576=util['format'](_0x44b8('0x76'),_0x765e45);if(_0x765e45===0x1){_0x3f7576=_0x44b8('0x77');}throw new db[(_0x44b8('0x78'))][(_0x44b8('0x79'))](_0x3f7576);}}return;};exports[_0x44b8('0x7a')]=function(_0x1df915,_0x426a6a){var _0x172ff3=_0x426a6a?encryptor[_0x44b8('0x73')](_0x426a6a)[_0x44b8('0x74')](','):[];if(_0x172ff3[_0x44b8('0x7b')]===0x5){_0x172ff3[_0x44b8('0x7c')](-0x1,0x1);}_0x172ff3[_0x44b8('0x7d')](_0x1df915);return encryptor[_0x44b8('0x7e')](_0x172ff3[_0x44b8('0x7f')](','));};function signJwt(_0x293c2e){var _0x25f91c=BPromise[_0x44b8('0x80')](jwt['sign'],{'context':jwt});var _0x1ec516=_0x293c2e[_0x44b8('0x81')]||config[_0x44b8('0x82')][_0x44b8('0x7')];return new BPromise(function(_0x51f763,_0x29ed5d){_0x25f91c(_0x293c2e[_0x44b8('0x83')],_0x1ec516,_0x293c2e['options'])[_0x44b8('0x34')](function(_0xc4d667){_0x51f763(_0xc4d667);})['catch'](function(_0x2a95f6){_0x29ed5d(_0x2a95f6);});});}function verifyJwt(_0x3354bd,_0x520929,_0x37e42e){var _0x454fe6=BPromise[_0x44b8('0x80')](jwt['verify'],{'context':jwt});var _0x16e790=_0x37e42e||config['secrets'][_0x44b8('0x7')];return new BPromise(function(_0x5161ea,_0x176536){_0x454fe6(_0x3354bd,_0x16e790,_0x520929)[_0x44b8('0x34')](function(_0xf4d81f){_0x5161ea(_0xf4d81f);})[_0x44b8('0x39')](function(_0x3c6aad){_0x176536(_0x3c6aad);});});}function generateNonce(){return crypto[_0x44b8('0x84')](0x10)['toString'](_0x44b8('0x85'));}function generateIssuedAt(){return Math['floor'](Date[_0x44b8('0x86')]()/0x3e8)[_0x44b8('0x87')]();}function createJwt(_0x4c1a7c){var _0x3f9438={'payload':{'iat':_0x4c1a7c[_0x44b8('0x6b')],'nonce':_0x4c1a7c[_0x44b8('0x50')]},'options':{'algorithm':_0x44b8('0x88'),'subject':_0x4c1a7c['id'][_0x44b8('0x87')](),'issuer':hardwareConf[_0x44b8('0x49')](),'audience':hardwareConf[_0x44b8('0x49')]()}};return signJwt(_0x3f9438)[_0x44b8('0x34')](function(_0x3f9102){return{'iat':_0x4c1a7c[_0x44b8('0x6b')],'nonce':_0x4c1a7c[_0x44b8('0x50')],'token':_0x3f9102};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index f017a2b..6901027 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 _0xd6c6=['default','fields','filter','user','tags','checkListsRestrictions','tag','count','User','buildContactsQuery','getFilteredContacts','rows','catch','describe','CmContact','keys','startsWith','cf_','map','CmCustomField','findOne','slice','all','length','fieldType','type','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','then','search','parseAdvancedSearchFilter','parseQueryParameters','where'];(function(_0x3232fa,_0x4a640e){var _0x55955f=function(_0x35050f){while(--_0x35050f){_0x3232fa['push'](_0x3232fa['shift']());}};_0x55955f(++_0x4a640e);}(_0xd6c6,0x1d6));var _0x6d6c=function(_0x20b04e,_0x2d4f2a){_0x20b04e=_0x20b04e-0x0;var _0x477005=_0xd6c6[_0x20b04e];return _0x477005;};'use strict';var _=require(_0x6d6c('0x0'));var sqlUtils=require(_0x6d6c('0x1'));var db=require(_0x6d6c('0x2'))['db'];exports[_0x6d6c('0x3')]=function(_0x43613b,_0x56fdea,_0x384d8b,_0x538de1){var _0x539ff4={'count':0x0,'rows':[]};var _0x4f12bf=sqlUtils[_0x6d6c('0x4')](_0x56fdea,_0x43613b);if(_0x4f12bf){return Promise[_0x6d6c('0x5')](_0x539ff4);}var _0x31a903=sqlUtils['getContactsSubquery']();var _0x217909={};var _0x53f947=![];var _0x33abbc=![];return Promise[_0x6d6c('0x5')]()[_0x6d6c('0x6')](function(){if(_0x43613b[_0x6d6c('0x7')]){return sqlUtils[_0x6d6c('0x8')](_0x43613b['search'],_0x538de1);}else{return sqlUtils[_0x6d6c('0x9')](_0x43613b,_0x538de1);}})[_0x6d6c('0x6')](function(_0x232448){_0x31a903[_0x6d6c('0xa')](_0x232448[_0x6d6c('0xb')]);_0x31a903['where'](_0x232448[_0x6d6c('0xc')]);_0x31a903[_0x6d6c('0xa')](_0x232448[_0x6d6c('0xd')]);_0x31a903[_0x6d6c('0xa')](_0x232448[_0x6d6c('0xe')]['clause']);_0x217909=_0x232448[_0x6d6c('0xf')];_0x33abbc=_0x232448[_0x6d6c('0xe')]['skip'];return sqlUtils[_0x6d6c('0x10')](_0x56fdea,_0x43613b,_0x33abbc);})[_0x6d6c('0x6')](function(_0x1a23de){_0x31a903[_0x6d6c('0xa')](_0x1a23de);var _0x9bf99c=_0x43613b[_0x6d6c('0x7')]?_0x217909['ids']:_0x43613b[_0x6d6c('0x11')];_0x53f947=_0x9bf99c?!![]:![];return sqlUtils['countFilteredContacts'](_0x31a903,_0x9bf99c);})[_0x6d6c('0x6')](function(_0x458553){_0x539ff4['count']=_0x458553;if(_0x539ff4[_0x6d6c('0x12')]===0x0){return;}if(_0x43613b[_0x6d6c('0x13')]){_0x33abbc=!![];}return sqlUtils[_0x6d6c('0x14')](_0x31a903,_0x43613b['fields'],_0x384d8b,_0x53f947,_0x217909['clause'],_0x33abbc);})[_0x6d6c('0x6')](function(_0xf308a9){if(!_0xf308a9){return[];}return sqlUtils[_0x6d6c('0x15')](_0xf308a9,_0x43613b,_0x384d8b);})['then'](function(_0x2cc77c){_0x539ff4[_0x6d6c('0x16')]=_0x2cc77c;return _0x539ff4;})[_0x6d6c('0x17')](function(_0x2df941){throw _0x2df941;});};exports[_0x6d6c('0x18')]=function(){var _0x39d49f={};var _0xfb23f0=[];return db[_0x6d6c('0x19')][_0x6d6c('0x18')]()[_0x6d6c('0x6')](function(_0x786b25){_0x39d49f=_0x786b25;var _0x47ed8b=Object[_0x6d6c('0x1a')](_0x39d49f)[_0x6d6c('0xd')](function(_0x2cc529){return _[_0x6d6c('0x1b')](_0x2cc529,_0x6d6c('0x1c'))?_0x2cc529:undefined;});var _0x4012ad=_0x47ed8b[_0x6d6c('0x1d')](function(_0x12772f){return db[_0x6d6c('0x1e')][_0x6d6c('0x1f')]({'where':{'id':_0x12772f[_0x6d6c('0x20')](0x3)},'raw':!![]});});return Promise[_0x6d6c('0x21')](_0x4012ad);})[_0x6d6c('0x6')](function(_0x264475){for(var _0x400243=0x0;_0x400243<_0x264475[_0x6d6c('0x22')];_0x400243++){if(_0x264475[_0x400243]){var _0x1f5eed=_0x6d6c('0x1c')+_0x264475[_0x400243]['id'];_0x39d49f[_0x1f5eed][_0x6d6c('0x23')]=_0x264475[_0x400243][_0x6d6c('0x24')];}}_0xfb23f0=_[_0x6d6c('0x1d')](Object[_0x6d6c('0x1a')](_0x39d49f),function(_0x17a79a){return{'name':_0x17a79a,'type':_0x39d49f[_0x17a79a][_0x6d6c('0x24')]};});return _0xfb23f0;})[_0x6d6c('0x17')](function(_0x3cd1d1){throw _0x3cd1d1;});}; \ No newline at end of file +var _0xafd3=['skip','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','catch','CmContact','describe','keys','startsWith','cf_','findOne','slice','all','length','fieldType','map','type','../../mysqldb','skipContactsQuery','getContactsSubquery','resolve','then','search','parseAdvancedSearchFilter','parseQueryParameters','default','where','fields','filter','user','clause','tags'];(function(_0x239f7c,_0x4b4c0d){var _0x3d35ca=function(_0x4ca9f7){while(--_0x4ca9f7){_0x239f7c['push'](_0x239f7c['shift']());}};_0x3d35ca(++_0x4b4c0d);}(_0xafd3,0x1b8));var _0x3afd=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0xafd3[_0x26b80e];return _0x84a8a8;};'use strict';var _=require('lodash');var sqlUtils=require('./sql-utils');var db=require(_0x3afd('0x0'))['db'];exports['findAll']=function(_0x1c9ff9,_0x50ce72,_0xe49c63,_0x30dc53){var _0x46cba0={'count':0x0,'rows':[]};var _0x3c6bf4=sqlUtils[_0x3afd('0x1')](_0x50ce72,_0x1c9ff9);if(_0x3c6bf4){return Promise['resolve'](_0x46cba0);}var _0x3215db=sqlUtils[_0x3afd('0x2')]();var _0xc01e64={};var _0x13dc01=![];var _0x4db7d3=![];return Promise[_0x3afd('0x3')]()[_0x3afd('0x4')](function(){if(_0x1c9ff9[_0x3afd('0x5')]){return sqlUtils[_0x3afd('0x6')](_0x1c9ff9['search'],_0x30dc53);}else{return sqlUtils[_0x3afd('0x7')](_0x1c9ff9,_0x30dc53);}})[_0x3afd('0x4')](function(_0x424533){_0x3215db['where'](_0x424533[_0x3afd('0x8')]);_0x3215db[_0x3afd('0x9')](_0x424533[_0x3afd('0xa')]);_0x3215db[_0x3afd('0x9')](_0x424533[_0x3afd('0xb')]);_0x3215db[_0x3afd('0x9')](_0x424533[_0x3afd('0xc')][_0x3afd('0xd')]);_0xc01e64=_0x424533[_0x3afd('0xe')];_0x4db7d3=_0x424533[_0x3afd('0xc')][_0x3afd('0xf')];return sqlUtils['checkListsRestrictions'](_0x50ce72,_0x1c9ff9,_0x4db7d3);})[_0x3afd('0x4')](function(_0x2b2886){_0x3215db[_0x3afd('0x9')](_0x2b2886);var _0x1bcd15=_0x1c9ff9[_0x3afd('0x5')]?_0xc01e64[_0x3afd('0x10')]:_0x1c9ff9[_0x3afd('0x11')];_0x13dc01=_0x1bcd15?!![]:![];return sqlUtils[_0x3afd('0x12')](_0x3215db,_0x1bcd15);})[_0x3afd('0x4')](function(_0x1fb97a){_0x46cba0[_0x3afd('0x13')]=_0x1fb97a;if(_0x46cba0[_0x3afd('0x13')]===0x0){return;}if(_0x1c9ff9['User']){_0x4db7d3=!![];}return sqlUtils[_0x3afd('0x14')](_0x3215db,_0x1c9ff9[_0x3afd('0xa')],_0xe49c63,_0x13dc01,_0xc01e64[_0x3afd('0xd')],_0x4db7d3);})[_0x3afd('0x4')](function(_0x49597e){if(!_0x49597e){return[];}return sqlUtils[_0x3afd('0x15')](_0x49597e,_0x1c9ff9,_0xe49c63);})[_0x3afd('0x4')](function(_0x17f5bc){_0x46cba0['rows']=_0x17f5bc;return _0x46cba0;})[_0x3afd('0x16')](function(_0x2975c2){throw _0x2975c2;});};exports['describe']=function(){var _0x3c2674={};var _0x562463=[];return db[_0x3afd('0x17')][_0x3afd('0x18')]()[_0x3afd('0x4')](function(_0x589d87){_0x3c2674=_0x589d87;var _0x28a3b3=Object[_0x3afd('0x19')](_0x3c2674)[_0x3afd('0xb')](function(_0x22bf61){return _[_0x3afd('0x1a')](_0x22bf61,_0x3afd('0x1b'))?_0x22bf61:undefined;});var _0x82231b=_0x28a3b3['map'](function(_0x4e0a7d){return db['CmCustomField'][_0x3afd('0x1c')]({'where':{'id':_0x4e0a7d[_0x3afd('0x1d')](0x3)},'raw':!![]});});return Promise[_0x3afd('0x1e')](_0x82231b);})[_0x3afd('0x4')](function(_0x420474){for(var _0x1296bb=0x0;_0x1296bb<_0x420474[_0x3afd('0x1f')];_0x1296bb++){if(_0x420474[_0x1296bb]){var _0x15d853=_0x3afd('0x1b')+_0x420474[_0x1296bb]['id'];_0x3c2674[_0x15d853][_0x3afd('0x20')]=_0x420474[_0x1296bb]['type'];}}_0x562463=_[_0x3afd('0x21')](Object['keys'](_0x3c2674),function(_0x36877b){return{'name':_0x36877b,'type':_0x3c2674[_0x36877b][_0x3afd('0x22')]};});return _0x562463;})[_0x3afd('0x16')](function(_0x3f5063){throw _0x3f5063;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 1c006e5..10c0836 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 _0x8c92=['user','keys','some','compact','Contact','push','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','then','fields','tags','filter','resolve','role','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','from','findAll','color','keyBy','Sequelize','SELECT','sequelize','toString','Tags','clone','COUNT(*)','isEmpty','where','t.id\x20IN\x20?','QueryTypes','query','squel','../parsers/qs','../interaction/utils','../../mysqldb','agent','search','ListId','autocomplete','true','select','cm_contacts','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','tools_tags','firstName','lastName','mobile','fax','email','CompanyId','createdAt','updatedAt','deletedAt','includes','forEach','TagIds','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','fieldType','datetime','type','default','end','value','map','clause','and','User','uc.UserId\x20=\x20?'];(function(_0x28c903,_0x59bca6){var _0x345ee7=function(_0x5ab648){while(--_0x5ab648){_0x28c903['push'](_0x28c903['shift']());}};_0x345ee7(++_0x59bca6);}(_0x8c92,0xfa));var _0x28c9=function(_0x22b1a2,_0x28a9fb){_0x22b1a2=_0x22b1a2-0x0;var _0xc3df6=_0x8c92[_0x22b1a2];return _0xc3df6;};'use strict';var _=require('lodash');var squel=require(_0x28c9('0x0'));var as=require('../parsers/advancedSearch');var qs=require(_0x28c9('0x1'));var utils=require(_0x28c9('0x2'));var db=require(_0x28c9('0x3'))['db'];function skipContactsQuery(_0x27db4d,_0x487039){var _0x3b3a95=![];if(_0x27db4d['role']===_0x28c9('0x4')&&!_0x487039[_0x28c9('0x5')]&&!_0x487039[_0x28c9('0x6')]&&_0x487039[_0x28c9('0x7')]!==_0x28c9('0x8')){_0x3b3a95=!![];}return _0x3b3a95;}function getContactsSubquery(){return squel[_0x28c9('0x9')]()['from'](_0x28c9('0xa'),'c')['where'](_0x28c9('0xb'));}function applyJoinClauses(_0x46efac,_0x24a845){var _0x2ee04a=_0x24a845?'c':_0x28c9('0xc');_0x46efac[_0x28c9('0xd')](_0x28c9('0xe'),'uc',_0x28c9('0xf')+_0x2ee04a+_0x28c9('0x10'))['left_join'](_0x28c9('0x11'),'ct','ct.CmContactId\x20=\x20'+_0x2ee04a+_0x28c9('0x10'))[_0x28c9('0xd')](_0x28c9('0x12'),'t','t.id\x20=\x20ct.TagId');return _0x46efac;}function addFieldsToQuery(_0x4ed022,_0x492ccd,_0x2d8279,_0xef5496,_0xfaea9b){var _0x306657=_0xfaea9b?'c':'subqry';if(!_0x492ccd){_0x492ccd=['id',_0x28c9('0x13'),_0x28c9('0x14'),'phone',_0x28c9('0x15'),_0x28c9('0x16'),_0x28c9('0x17'),_0x28c9('0x6'),_0x28c9('0x18'),_0x28c9('0x19'),_0x28c9('0x1a'),_0x28c9('0x1b'),'TagIds'];}else if(!_0x492ccd[_0x28c9('0x1c')]('id')){_0x492ccd['push']('id');}var _0x591654=_0x2d8279&&_0xfaea9b||!_0x2d8279&&!_0xfaea9b;if(_0xef5496){_0x591654=_0xef5496&&_0xfaea9b||!_0xef5496&&!_0xfaea9b;}_0x492ccd[_0x28c9('0x1d')](function(_0x335e67){if(_0x335e67===_0x28c9('0x1e')){if(_0x591654){_0x4ed022[_0x28c9('0x1f')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x335e67);}else if(_0x2d8279||_0xef5496){_0x4ed022[_0x28c9('0x1f')](_0x306657+'.'+_0x335e67);}}else{_0x4ed022['field'](_0x306657+'.'+_0x335e67);}});return _0x4ed022;}function getSqlClauses(){var _0x41ddf5={'default':squel['expr'](),'fields':squel['expr'](),'filter':squel['expr'](),'tags':{'clause':squel[_0x28c9('0x20')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x41ddf5;}function parseTagParameter(_0x34eedf){var _0x5c0159=squel[_0x28c9('0x20')]();if(_0x34eedf){var _0x2de91b=utils[_0x28c9('0x21')](_0x34eedf);_0x2de91b[_0x28c9('0x1d')](function(_0x2cf90a){_0x5c0159['or'](_0x28c9('0x22'),'%,'+_0x2cf90a+',%');});}return _0x5c0159;}function parseSearchFilter(_0x19ded7){var _0x50db2d=squel['expr']();if(_0x19ded7){var _0x22922b=_0x19ded7[_0x28c9('0x23')]('\x5c','\x5c\x5c')[_0x28c9('0x23')](/'/g,'\x27\x27');if(_0x22922b[_0x28c9('0x24')]('\x20')[_0x28c9('0x25')]>0x1){_0x50db2d['or'](_0x28c9('0x26'),qs[_0x28c9('0x27')](_0x22922b,!![]),null);}else{if(qs[_0x28c9('0x28')](_0x22922b)){_0x50db2d['or']('c.id\x20LIKE\x20?',_0x22922b+'%');_0x50db2d['or'](_0x28c9('0x29'),_0x22922b+'%');_0x50db2d['or']('c.mobile\x20LIKE\x20?',_0x22922b+'%');_0x50db2d['or'](_0x28c9('0x2a'),_0x22922b+'%');}else if(qs[_0x28c9('0x2b')](_0x22922b)){_0x50db2d['or']('c.email\x20LIKE\x20?',_0x22922b+'%');}else{_0x50db2d['or'](_0x28c9('0x2c'),'%'+_0x22922b+'%');_0x50db2d['or']('c.lastName\x20LIKE\x20?','%'+_0x22922b+'%');_0x50db2d['or']('c.email\x20LIKE\x20?','%'+_0x22922b+'%');}}}return _0x50db2d;}function parseAdvancedSearchFilter(_0x28b69e,_0x401d8b){var _0x12833c=getSqlClauses();var _0xd1c018=as[_0x28c9('0x2d')](_0x28b69e);var _0x1c75fc=_0xd1c018[_0x28c9('0x2e')];for(var _0x6e9e14=0x0;_0x6e9e14<_0xd1c018[_0x28c9('0x2f')][_0x28c9('0x25')];_0x6e9e14++){var _0xbab7cc=_0xd1c018[_0x28c9('0x2f')][_0x6e9e14];var _0x59567f='c';var _0x30ba0c=_[_0x28c9('0x30')](_0x401d8b,[_0x28c9('0x31'),_0xbab7cc[_0x28c9('0x1f')]]);if(_0x30ba0c){if(_0xbab7cc[_0x28c9('0x1f')]===_0x28c9('0x32')||_0x30ba0c[_0x28c9('0x33')]===_0x28c9('0x34')){_0xbab7cc['castTo']='DATE';}var _0x2b9236=as['buildExpression'](_0x59567f,_0x30ba0c[_0x28c9('0x35')],_0xbab7cc);_0x12833c[_0x28c9('0x36')][_0x1c75fc](_0x2b9236['text'],_0x2b9236['value']['start'],_0x2b9236['value'][_0x28c9('0x37')]);}else{if(_0xbab7cc[_0x28c9('0x1f')]==='Tag'){var _0x1dcf66=_0xbab7cc[_0x28c9('0x38')][_0x28c9('0x24')](',')[_0x28c9('0x39')](function(_0x384d87){return Number(_0x384d87);});var _0x364796=parseTagParameter(_0x1dcf66);_0x12833c['tags'][_0x28c9('0x3a')][_0x28c9('0x3b')](_0x364796);_0x12833c['tags']['ids']=_0x1dcf66;}else if(_0xbab7cc['field']===_0x28c9('0x3c')){_0x12833c['user'][_0x28c9('0x3a')][_0x28c9('0x3b')](_0x28c9('0x3d'),_0xbab7cc['value']);_0x12833c[_0x28c9('0x3e')]['skip']=!![];}}}return _0x12833c;}function parseModelFields(_0x5ca025,_0x989bfe){var _0x4aae98=squel[_0x28c9('0x20')]();var _0x3301fe=_(_0x5ca025)[_0x28c9('0x3f')]()[_0x28c9('0x39')](function(_0xccd8a9){return _[_0x28c9('0x40')](_0x989bfe,['name',_0xccd8a9])?_0xccd8a9:undefined;})[_0x28c9('0x41')]()['value']();if(_0x5ca025[_0x28c9('0x42')]){_0x3301fe[_0x28c9('0x43')](_0x28c9('0x42'));}if(_0x5ca025[_0x28c9('0x3c')]){_0x3301fe[_0x28c9('0x43')](_0x28c9('0x3c'));}if(_0x3301fe[_0x28c9('0x25')]>0x0){_0x3301fe[_0x28c9('0x1d')](function(_0x3e31c9){if(_0x3e31c9===_0x28c9('0x6')){_0x4aae98[_0x28c9('0x3b')](_0x28c9('0x44'),[][_0x28c9('0x45')](_0x5ca025[_0x3e31c9]));}else if(_0x3e31c9===_0x28c9('0x42')){var _0x4e7788='%'+_0x5ca025[_0x3e31c9]+'%';_0x4aae98[_0x28c9('0x3b')](_0x28c9('0x46'),_0x4e7788);}else if(_0x3e31c9==='User'){_0x4aae98[_0x28c9('0x3b')](_0x28c9('0x3d'),_0x5ca025[_0x3e31c9]);}else{_0x4aae98['and']('c.'+_0x3e31c9+'\x20=\x20?',_0x5ca025[_0x3e31c9]);}});}return _0x4aae98;}function parseQueryParameters(_0x28a4b3,_0x453bb2){var _0x42ee27=getSqlClauses();return Promise['resolve']()[_0x28c9('0x47')](function(){return parseModelFields(_0x28a4b3,_0x453bb2);})[_0x28c9('0x47')](function(_0x4d6b88){_0x42ee27[_0x28c9('0x48')]['and'](_0x4d6b88);return parseTagParameter(_0x28a4b3['tag']);})[_0x28c9('0x47')](function(_0x19954a){_0x42ee27[_0x28c9('0x49')][_0x28c9('0x3a')][_0x28c9('0x3b')](_0x19954a);return parseSearchFilter(_0x28a4b3[_0x28c9('0x4a')]);})[_0x28c9('0x47')](function(_0x1da8d3){_0x42ee27[_0x28c9('0x4a')]=_0x1da8d3;return _0x42ee27;});}function checkListsRestrictions(_0x2398cb,_0x58289a,_0x51cd44){var _0x77a735=squel[_0x28c9('0x20')]();return Promise[_0x28c9('0x4b')]()[_0x28c9('0x47')](function(){if(_0x58289a[_0x28c9('0x5')]&&_0x2398cb[_0x28c9('0x4c')]===_0x28c9('0x4')&&!_0x51cd44){return _0x2398cb['getLists']({'attributes':['id'],'raw':!![]});}})[_0x28c9('0x47')](function(_0xe38de1){if(_0xe38de1){if(_0xe38de1['length']===0x0){_0x77a735[_0x28c9('0x3b')](_0x28c9('0x4d'));}else{_0x77a735['and']('c.ListId\x20IN\x20?',_['map'](_0xe38de1,'id'));}}})[_0x28c9('0x47')](function(){return _0x77a735;});}function buildContactsQuery(_0x30f829,_0xf46978,_0x3e4075,_0x285289,_0x1248d3,_0x381e42){if(_0xf46978){_0xf46978=_0x3e4075[_0x28c9('0x4e')];}_0x30f829=addFieldsToQuery(_0x30f829,_0xf46978,_0x285289,_0x381e42,!![]);var _0x5b7c1d=squel['select']();_0x5b7c1d=addFieldsToQuery(_0x5b7c1d,_0xf46978,_0x285289,_0x381e42,![]);if(_0x285289||_0x381e42){_0x30f829=applyJoinClauses(_0x30f829,!![]);_0x30f829[_0x28c9('0x4f')](_0x28c9('0x50'));if(_0x3e4075[_0x28c9('0x51')]){_0x5b7c1d[_0x28c9('0x51')](_0x3e4075[_0x28c9('0x51')]);}if(_0x3e4075[_0x28c9('0x52')]){_0x5b7c1d['offset'](_0x3e4075[_0x28c9('0x52')]);}}else{_0x5b7c1d=applyJoinClauses(_0x5b7c1d,![]);_0x5b7c1d[_0x28c9('0x4f')](_0x28c9('0x53'));if(_0x3e4075['limit']){_0x30f829[_0x28c9('0x51')](_0x3e4075[_0x28c9('0x51')]);}if(_0x3e4075['offset']){_0x30f829[_0x28c9('0x52')](_0x3e4075[_0x28c9('0x52')]);}}_0x5b7c1d[_0x28c9('0x54')](_0x1248d3);if(_0x3e4075[_0x28c9('0x55')]){_0x3e4075[_0x28c9('0x55')][_0x28c9('0x1d')](function(_0x53c3fb){_0x30f829[_0x28c9('0x55')]('c.'+_0x53c3fb[0x0],_0x53c3fb[0x1]===_0x28c9('0x56')?![]:!![]);_0x5b7c1d[_0x28c9('0x55')](_0x28c9('0x57')+_0x53c3fb[0x0],_0x53c3fb[0x1]===_0x28c9('0x56')?![]:!![]);});}_0x5b7c1d[_0x28c9('0x58')](_0x30f829,_0x28c9('0xc'));return _0x5b7c1d;}function getFilteredContacts(_0x4427d4){var _0x5adc6e=[];return db['Tag'][_0x28c9('0x59')]({'attributes':['id',_0x28c9('0x31'),_0x28c9('0x5a')],'raw':!![]})[_0x28c9('0x47')](function(_0x13277e){_0x5adc6e=_[_0x28c9('0x5b')](_0x13277e,'id');var _0x1cb893={'type':db[_0x28c9('0x5c')]['QueryTypes'][_0x28c9('0x5d')],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x28c9('0x5e')]['query'](_0x4427d4[_0x28c9('0x5f')](),_0x1cb893);})['then'](function(_0x2c0279){_0x2c0279[_0x28c9('0x1d')](function(_0x5ab55d){if(_0x5ab55d[_0x28c9('0x1e')]){_0x5ab55d[_0x28c9('0x60')]=[];_0x5ab55d[_0x28c9('0x1e')][_0x28c9('0x24')](',')[_0x28c9('0x1d')](function(_0xc24dfc){_0x5ab55d[_0x28c9('0x60')][_0x28c9('0x43')](_0x5adc6e[_0xc24dfc]);});}delete _0x5ab55d[_0x28c9('0x1e')];});return _0x2c0279;});}function countFilteredContacts(_0x131d66,_0x344071){var _0x896a48=_0x131d66[_0x28c9('0x61')]();_0x896a48[_0x28c9('0x1f')](_0x28c9('0x62'));_0x896a48=applyJoinClauses(_0x896a48,!![]);_0x131d66[_0x28c9('0x4f')](_0x28c9('0x50'));var _0x4da81e=utils[_0x28c9('0x21')](_0x344071);if(!_[_0x28c9('0x63')](_0x4da81e)){_0x896a48[_0x28c9('0x64')](_0x28c9('0x65'),_0x4da81e);}var _0x20c677={'type':db[_0x28c9('0x5c')][_0x28c9('0x66')][_0x28c9('0x5d')],'raw':!![]};return db['sequelize'][_0x28c9('0x67')](_0x896a48[_0x28c9('0x5f')](),_0x20c677)[_0x28c9('0x47')](function(_0x262c0f){return _0x262c0f[0x0][_0x28c9('0x62')];});}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 _0x99a2=['parseSearch','conditions','length','find','name','fieldType','castTo','buildExpression','type','text','value','start','end','Tag','tags','clause','and','ids','user','uc.UserId\x20=\x20?','keys','map','some','compact','Contact','push','User','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','getLists','c.ListId\x20IS\x20NULL','c.id','limit','offset','group','subqry.id','having','order','subqry.','DESC','findAll','color','keyBy','Sequelize','SELECT','CmContact','query','Tags','COUNT(*)','getSelectedTags','isEmpty','t.id\x20IN\x20?','QueryTypes','toString','exports','squel','../parsers/advancedSearch','../interaction/utils','../../mysqldb','role','agent','search','ListId','autocomplete','true','select','from','cm_contacts','where','subqry','left_join','uc.CmContactId\x20=\x20','cm_contact_has_tags','ct.CmContactId\x20=\x20','.id','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','fax','email','CompanyId','createdAt','deletedAt','forEach','TagIds','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?'];(function(_0x5d7e52,_0x7c228c){var _0x31d265=function(_0xf66218){while(--_0xf66218){_0x5d7e52['push'](_0x5d7e52['shift']());}};_0x31d265(++_0x7c228c);}(_0x99a2,0xab));var _0x299a=function(_0x51677a,_0x4761d4){_0x51677a=_0x51677a-0x0;var _0x1b1fe2=_0x99a2[_0x51677a];return _0x1b1fe2;};'use strict';var _=require('lodash');var squel=require(_0x299a('0x0'));var as=require(_0x299a('0x1'));var qs=require('../parsers/qs');var utils=require(_0x299a('0x2'));var db=require(_0x299a('0x3'))['db'];function skipContactsQuery(_0x1270fb,_0x56d878){var _0x15eaab=![];if(_0x1270fb[_0x299a('0x4')]===_0x299a('0x5')&&!_0x56d878[_0x299a('0x6')]&&!_0x56d878[_0x299a('0x7')]&&_0x56d878[_0x299a('0x8')]!==_0x299a('0x9')){_0x15eaab=!![];}return _0x15eaab;}function getContactsSubquery(){return squel[_0x299a('0xa')]()[_0x299a('0xb')](_0x299a('0xc'),'c')[_0x299a('0xd')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x25053e,_0x3dd660){var _0x33ec22=_0x3dd660?'c':_0x299a('0xe');_0x25053e[_0x299a('0xf')]('cm_user_has_contacts','uc',_0x299a('0x10')+_0x33ec22+'.id')[_0x299a('0xf')](_0x299a('0x11'),'ct',_0x299a('0x12')+_0x33ec22+_0x299a('0x13'))[_0x299a('0xf')]('tools_tags','t',_0x299a('0x14'));return _0x25053e;}function addFieldsToQuery(_0x50efdd,_0x3f5b37,_0x6eeb1d,_0x34efcd,_0x338e36){var _0x25ccf2=_0x338e36?'c':_0x299a('0xe');if(!_0x3f5b37){_0x3f5b37=['id',_0x299a('0x15'),_0x299a('0x16'),_0x299a('0x17'),_0x299a('0x18'),_0x299a('0x19'),_0x299a('0x1a'),'ListId',_0x299a('0x1b'),_0x299a('0x1c'),'updatedAt',_0x299a('0x1d'),'TagIds'];}else if(!_0x3f5b37['includes']('id')){_0x3f5b37['push']('id');}var _0x33e671=_0x6eeb1d&&_0x338e36||!_0x6eeb1d&&!_0x338e36;if(_0x34efcd){_0x33e671=_0x34efcd&&_0x338e36||!_0x34efcd&&!_0x338e36;}_0x3f5b37[_0x299a('0x1e')](function(_0x3b83b6){if(_0x3b83b6===_0x299a('0x1f')){if(_0x33e671){_0x50efdd[_0x299a('0x20')](_0x299a('0x21'),_0x3b83b6);}else if(_0x6eeb1d||_0x34efcd){_0x50efdd[_0x299a('0x20')](_0x25ccf2+'.'+_0x3b83b6);}}else{_0x50efdd[_0x299a('0x20')](_0x25ccf2+'.'+_0x3b83b6);}});return _0x50efdd;}function getSqlClauses(){var _0x3d0af4={'default':squel[_0x299a('0x22')](),'fields':squel['expr'](),'filter':squel[_0x299a('0x22')](),'tags':{'clause':squel[_0x299a('0x22')](),'ids':null},'user':{'clause':squel[_0x299a('0x22')](),'skip':![]}};return _0x3d0af4;}function parseTagParameter(_0x1b543e){var _0x42ec8d=squel[_0x299a('0x22')]();if(_0x1b543e){var _0x37a87f=utils['getSelectedTags'](_0x1b543e);_0x37a87f[_0x299a('0x1e')](function(_0x5a7a35){_0x42ec8d['or'](_0x299a('0x23'),'%,'+_0x5a7a35+',%');});}return _0x42ec8d;}function parseSearchFilter(_0x4ca3c5){var _0x5a8843=squel[_0x299a('0x22')]();if(_0x4ca3c5){var _0x3a1b20=_0x4ca3c5[_0x299a('0x24')]('\x5c','\x5c\x5c')[_0x299a('0x24')](/'/g,'\x27\x27');if(_0x3a1b20[_0x299a('0x25')]('\x20')['length']>0x1){_0x5a8843['or'](_0x299a('0x26'),qs[_0x299a('0x27')](_0x3a1b20,!![]),null);}else{if(qs['isNumeric'](_0x3a1b20)){_0x5a8843['or'](_0x299a('0x28'),_0x3a1b20+'%');_0x5a8843['or'](_0x299a('0x29'),_0x3a1b20+'%');_0x5a8843['or'](_0x299a('0x2a'),_0x3a1b20+'%');_0x5a8843['or'](_0x299a('0x2b'),_0x3a1b20+'%');}else if(qs['isEmail'](_0x3a1b20)){_0x5a8843['or'](_0x299a('0x2c'),_0x3a1b20+'%');}else{_0x5a8843['or'](_0x299a('0x2d'),'%'+_0x3a1b20+'%');_0x5a8843['or'](_0x299a('0x2e'),'%'+_0x3a1b20+'%');_0x5a8843['or'](_0x299a('0x2c'),'%'+_0x3a1b20+'%');}}}return _0x5a8843;}function parseAdvancedSearchFilter(_0x37d9b5,_0xe484aa){var _0x1191f6=getSqlClauses();var _0x28f5de=as[_0x299a('0x2f')](_0x37d9b5);var _0x43d671=_0x28f5de['sqlOperator'];for(var _0x593c93=0x0;_0x593c93<_0x28f5de[_0x299a('0x30')][_0x299a('0x31')];_0x593c93++){var _0x316ba0=_0x28f5de[_0x299a('0x30')][_0x593c93];var _0x1cc2f5='c';var _0xcce628=_[_0x299a('0x32')](_0xe484aa,[_0x299a('0x33'),_0x316ba0[_0x299a('0x20')]]);if(_0xcce628){if(_0x316ba0[_0x299a('0x20')]==='dateOfBirth'||_0xcce628[_0x299a('0x34')]==='datetime'){_0x316ba0[_0x299a('0x35')]='DATE';}var _0x46e1b4=as[_0x299a('0x36')](_0x1cc2f5,_0xcce628[_0x299a('0x37')],_0x316ba0);_0x1191f6['default'][_0x43d671](_0x46e1b4[_0x299a('0x38')],_0x46e1b4[_0x299a('0x39')][_0x299a('0x3a')],_0x46e1b4['value'][_0x299a('0x3b')]);}else{if(_0x316ba0['field']===_0x299a('0x3c')){var _0x54c5e9=_0x316ba0[_0x299a('0x39')][_0x299a('0x25')](',')['map'](function(_0x5561b5){return Number(_0x5561b5);});var _0x5ef0f1=parseTagParameter(_0x54c5e9);_0x1191f6[_0x299a('0x3d')][_0x299a('0x3e')][_0x299a('0x3f')](_0x5ef0f1);_0x1191f6['tags'][_0x299a('0x40')]=_0x54c5e9;}else if(_0x316ba0[_0x299a('0x20')]==='User'){_0x1191f6[_0x299a('0x41')][_0x299a('0x3e')]['and'](_0x299a('0x42'),_0x316ba0[_0x299a('0x39')]);_0x1191f6[_0x299a('0x41')]['skip']=!![];}}}return _0x1191f6;}function parseModelFields(_0x1079f3,_0xc23d1b){var _0x332b4f=squel['expr']();var _0x34dc01=_(_0x1079f3)[_0x299a('0x43')]()[_0x299a('0x44')](function(_0x11c256){return _[_0x299a('0x45')](_0xc23d1b,['name',_0x11c256])?_0x11c256:undefined;})[_0x299a('0x46')]()[_0x299a('0x39')]();if(_0x1079f3[_0x299a('0x47')]){_0x34dc01[_0x299a('0x48')](_0x299a('0x47'));}if(_0x1079f3[_0x299a('0x49')]){_0x34dc01[_0x299a('0x48')](_0x299a('0x49'));}if(_0x34dc01['length']>0x0){_0x34dc01[_0x299a('0x1e')](function(_0x24c9fd){if(_0x24c9fd===_0x299a('0x7')){_0x332b4f['and'](_0x299a('0x4a'),[][_0x299a('0x4b')](_0x1079f3[_0x24c9fd]));}else if(_0x24c9fd===_0x299a('0x47')){var _0x272336='%'+_0x1079f3[_0x24c9fd]+'%';_0x332b4f['and'](_0x299a('0x4c'),_0x272336);}else if(_0x24c9fd==='User'){_0x332b4f[_0x299a('0x3f')](_0x299a('0x42'),_0x1079f3[_0x24c9fd]);}else{_0x332b4f['and']('c.'+_0x24c9fd+_0x299a('0x4d'),_0x1079f3[_0x24c9fd]);}});}return _0x332b4f;}function parseQueryParameters(_0x4cfb1e,_0x5e5425){var _0x49ab11=getSqlClauses();return Promise[_0x299a('0x4e')]()['then'](function(){return parseModelFields(_0x4cfb1e,_0x5e5425);})[_0x299a('0x4f')](function(_0x5989ad){_0x49ab11[_0x299a('0x50')][_0x299a('0x3f')](_0x5989ad);return parseTagParameter(_0x4cfb1e[_0x299a('0x51')]);})['then'](function(_0x1e59f5){_0x49ab11[_0x299a('0x3d')][_0x299a('0x3e')]['and'](_0x1e59f5);return parseSearchFilter(_0x4cfb1e['filter']);})[_0x299a('0x4f')](function(_0x311718){_0x49ab11[_0x299a('0x52')]=_0x311718;return _0x49ab11;});}function checkListsRestrictions(_0x17ba87,_0x28b031,_0x48a8df){var _0x4254ba=squel[_0x299a('0x22')]();return Promise['resolve']()[_0x299a('0x4f')](function(){if(_0x28b031[_0x299a('0x6')]&&_0x17ba87[_0x299a('0x4')]===_0x299a('0x5')&&!_0x48a8df){return _0x17ba87[_0x299a('0x53')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x2d6e6a){if(_0x2d6e6a){if(_0x2d6e6a[_0x299a('0x31')]===0x0){_0x4254ba[_0x299a('0x3f')](_0x299a('0x54'));}else{_0x4254ba[_0x299a('0x3f')]('c.ListId\x20IN\x20?',_[_0x299a('0x44')](_0x2d6e6a,'id'));}}})['then'](function(){return _0x4254ba;});}function buildContactsQuery(_0x2dd4c9,_0x487e7,_0x38849c,_0x17e8d1,_0x5c3b72,_0x562d61){if(_0x487e7){_0x487e7=_0x38849c['attributes'];}_0x2dd4c9=addFieldsToQuery(_0x2dd4c9,_0x487e7,_0x17e8d1,_0x562d61,!![]);var _0x46a1f7=squel[_0x299a('0xa')]();_0x46a1f7=addFieldsToQuery(_0x46a1f7,_0x487e7,_0x17e8d1,_0x562d61,![]);if(_0x17e8d1||_0x562d61){_0x2dd4c9=applyJoinClauses(_0x2dd4c9,!![]);_0x2dd4c9['group'](_0x299a('0x55'));if(_0x38849c[_0x299a('0x56')]){_0x46a1f7[_0x299a('0x56')](_0x38849c[_0x299a('0x56')]);}if(_0x38849c['offset']){_0x46a1f7[_0x299a('0x57')](_0x38849c['offset']);}}else{_0x46a1f7=applyJoinClauses(_0x46a1f7,![]);_0x46a1f7[_0x299a('0x58')](_0x299a('0x59'));if(_0x38849c[_0x299a('0x56')]){_0x2dd4c9[_0x299a('0x56')](_0x38849c['limit']);}if(_0x38849c['offset']){_0x2dd4c9[_0x299a('0x57')](_0x38849c[_0x299a('0x57')]);}}_0x46a1f7[_0x299a('0x5a')](_0x5c3b72);if(_0x38849c['order']){_0x38849c[_0x299a('0x5b')][_0x299a('0x1e')](function(_0x378db6){_0x2dd4c9[_0x299a('0x5b')]('c.'+_0x378db6[0x0],_0x378db6[0x1]==='DESC'?![]:!![]);_0x46a1f7[_0x299a('0x5b')](_0x299a('0x5c')+_0x378db6[0x0],_0x378db6[0x1]===_0x299a('0x5d')?![]:!![]);});}_0x46a1f7[_0x299a('0xb')](_0x2dd4c9,_0x299a('0xe'));return _0x46a1f7;}function getFilteredContacts(_0x51fc74){var _0x43357f=[];return db[_0x299a('0x3c')][_0x299a('0x5e')]({'attributes':['id',_0x299a('0x33'),_0x299a('0x5f')],'raw':!![]})[_0x299a('0x4f')](function(_0x4b1bb3){_0x43357f=_[_0x299a('0x60')](_0x4b1bb3,'id');var _0x514e8a={'type':db[_0x299a('0x61')]['QueryTypes'][_0x299a('0x62')],'model':db[_0x299a('0x63')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0x299a('0x64')](_0x51fc74['toString'](),_0x514e8a);})['then'](function(_0x5b7e97){_0x5b7e97[_0x299a('0x1e')](function(_0x24f367){if(_0x24f367[_0x299a('0x1f')]){_0x24f367[_0x299a('0x65')]=[];_0x24f367[_0x299a('0x1f')]['split'](',')['forEach'](function(_0x35196f){_0x24f367['Tags'][_0x299a('0x48')](_0x43357f[_0x35196f]);});}delete _0x24f367['TagIds'];});return _0x5b7e97;});}function countFilteredContacts(_0x78c06,_0x351b42){var _0x1baa06=_0x78c06['clone']();_0x1baa06[_0x299a('0x20')](_0x299a('0x66'));_0x1baa06=applyJoinClauses(_0x1baa06,!![]);_0x78c06[_0x299a('0x58')]('c.id');var _0xe012df=utils[_0x299a('0x67')](_0x351b42);if(!_[_0x299a('0x68')](_0xe012df)){_0x1baa06[_0x299a('0xd')](_0x299a('0x69'),_0xe012df);}var _0x12444b={'type':db[_0x299a('0x61')][_0x299a('0x6a')][_0x299a('0x62')],'raw':!![]};return db['sequelize'][_0x299a('0x64')](_0x1baa06[_0x299a('0x6b')](),_0x12444b)[_0x299a('0x4f')](function(_0x591227){return _0x591227[0x0][_0x299a('0x66')];});}module[_0x299a('0x6c')]={'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 89e3fc8..64bcac7 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 _0xc26d=['is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','createReadStream','createCipher','update','binary','end','final','write','close','unlink','createWriteStream','createDecipher','encryptString','secret','utf8','base64','decryptString','lodash','../../config/logger','app','session','aes192','encrypt','algorithm','join'];(function(_0x2ffbce,_0x3b242d){var _0xd8005b=function(_0x567e42){while(--_0x567e42){_0x2ffbce['push'](_0x2ffbce['shift']());}};_0xd8005b(++_0x3b242d);}(_0xc26d,0x160));var _0xdc26=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc26d[_0x14add3];return _0x4a174f;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xdc26('0x0'));var config=require('../../config/environment');var logger=require(_0xdc26('0x1'))(_0xdc26('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xdc26('0x3')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0xdc26('0x4')};if(config[_0xdc26('0x5')]&&config[_0xdc26('0x5')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0xdc26('0x5')][_0xdc26('0x6')]);if(isSupported){fileOptions[_0xdc26('0x6')]=config[_0xdc26('0x5')][_0xdc26('0x6')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xdc26('0x7')](',\x20');logger['error'](config['encrypt'][_0xdc26('0x6')],_0xdc26('0x8'),supportedAlgorithms);}}function isASupportedCipher(_0x4b9864){return AES_SUPPORTED_RX[_0xdc26('0x9')](_0x4b9864);}function getSupportedCiphers(){return crypto[_0xdc26('0xa')]()[_0xdc26('0xb')](isASupportedCipher);}function isAlgorithmSupported(_0x49aa3f){return getSupportedCiphers()[_0xdc26('0xc')](_0x49aa3f)>-0x1;}function combineOptions(_0x5d17bc){var _0x2c2ccc={};for(var _0x4afc73 in fileOptions){if(fileOptions[_0xdc26('0xd')](_0x4afc73)){_0x2c2ccc[_0x4afc73]=fileOptions[_0x4afc73];}}if(_0x5d17bc){for(var _0x275e2d in _0x5d17bc){if(_0x5d17bc[_0xdc26('0xd')](_0x275e2d)){_0x2c2ccc[_0x275e2d]=_0x5d17bc[_0x275e2d];}}}return _0x2c2ccc;}exports['encryptFile']=function(_0x1865aa,_0x2f791c,_0x2d6d6c,_0x33df0f){return new BPromise(function(_0x277c34,_0x42635f){_0x33df0f=combineOptions(_0x33df0f);var _0x222c79=new Buffer(_0x2d6d6c);var _0x185916=fs[_0xdc26('0xe')](_0x1865aa);var _0x1f4d99=fs['createWriteStream'](_0x2f791c);var _0x297e85=crypto[_0xdc26('0xf')](_0x33df0f[_0xdc26('0x6')],_0x222c79);_0x185916['on']('data',function(_0x96ea5d){var _0xc24515=new Buffer(_0x297e85[_0xdc26('0x10')](_0x96ea5d),_0xdc26('0x11'));_0x1f4d99['write'](_0xc24515);});_0x185916['on'](_0xdc26('0x12'),function(){try{var _0xab003=new Buffer(_0x297e85[_0xdc26('0x13')](_0xdc26('0x11')),_0xdc26('0x11'));_0x1f4d99[_0xdc26('0x14')](_0xab003);_0x1f4d99[_0xdc26('0x12')]();_0x1f4d99['on'](_0xdc26('0x15'),function(){return _0x277c34(_0x2f791c);});}catch(_0x44fa2c){fs[_0xdc26('0x16')](_0x2f791c);return _0x42635f(_0x44fa2c);}});});};exports['decryptFile']=function(_0x8b398e,_0x15ac1e,_0x33686b,_0x1ea4ac){return new BPromise(function(_0x22b3f1,_0x5b677c){_0x1ea4ac=combineOptions(_0x1ea4ac);var _0x4f80fb=new Buffer(_0x33686b);var _0x3eb390=fs[_0xdc26('0xe')](_0x8b398e);var _0x4007ce=fs[_0xdc26('0x17')](_0x15ac1e);var _0x231e83=crypto[_0xdc26('0x18')](_0x1ea4ac[_0xdc26('0x6')],_0x4f80fb);_0x3eb390['on']('data',function(_0x4787dd){var _0xc6a248=new Buffer(_0x231e83[_0xdc26('0x10')](_0x4787dd),_0xdc26('0x11'));_0x4007ce[_0xdc26('0x14')](_0xc6a248);});_0x3eb390['on'](_0xdc26('0x12'),function(){try{var _0x11c502=new Buffer(_0x231e83[_0xdc26('0x13')]('binary'),_0xdc26('0x11'));_0x4007ce[_0xdc26('0x14')](_0x11c502);_0x4007ce[_0xdc26('0x12')]();_0x4007ce['on']('close',function(){return _0x22b3f1(_0x15ac1e);});}catch(_0x10d95f){fs[_0xdc26('0x16')](_0x15ac1e);return _0x5b677c(_0x10d95f);}});});};exports[_0xdc26('0x19')]=function(_0x43f4a2,_0x33acb0,_0x44ece9){var _0x402cf6=_0x44ece9||stringOptions[_0xdc26('0x6')];var _0x311f6d=_0x33acb0||stringOptions[_0xdc26('0x1a')];var _0x116cfd=crypto[_0xdc26('0xf')](_0x402cf6,_0x311f6d);var _0x389038=_0x116cfd[_0xdc26('0x10')](_0x43f4a2,_0xdc26('0x1b'),'base64');_0x389038+=_0x116cfd[_0xdc26('0x13')](_0xdc26('0x1c'));return _0x389038;};exports[_0xdc26('0x1d')]=function(_0x564c53,_0x488287,_0x240dea){var _0x217abb=_0x240dea||stringOptions[_0xdc26('0x6')];var _0x491fc6=_0x488287||stringOptions[_0xdc26('0x1a')];var _0x3324b0=crypto['createDecipher'](_0x217abb,_0x491fc6);var _0x50f89f=_0x3324b0[_0xdc26('0x10')](_0x564c53,_0xdc26('0x1c'),'utf8');_0x50f89f+=_0x3324b0['final']('utf8');return _0x50f89f;}; \ No newline at end of file +var _0xbaee=['utf8','base64','decryptString','secret','createDecipher','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','aes192','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','decryptFile','encryptString'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xbaee,0x186));var _0xebae=function(_0x11e651,_0x5fd7c3){_0x11e651=_0x11e651-0x0;var _0x2f77fb=_0xbaee[_0x11e651];return _0x2f77fb;};'use strict';var crypto=require(_0xebae('0x0'));var fs=require('fs');var BPromise=require(_0xebae('0x1'));var _=require(_0xebae('0x2'));var config=require(_0xebae('0x3'));var logger=require(_0xebae('0x4'))(_0xebae('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0xebae('0x6')};if(config['encrypt']&&config[_0xebae('0x7')][_0xebae('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0xebae('0x8')]);if(isSupported){fileOptions[_0xebae('0x8')]=config['encrypt']['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0xebae('0x9')](config[_0xebae('0x7')][_0xebae('0x8')],_0xebae('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x32487c){return AES_SUPPORTED_RX[_0xebae('0xb')](_0x32487c);}function getSupportedCiphers(){return crypto[_0xebae('0xc')]()[_0xebae('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x3eaf2d){return getSupportedCiphers()[_0xebae('0xe')](_0x3eaf2d)>-0x1;}function combineOptions(_0x61c364){var _0x250f38={};for(var _0x5be54c in fileOptions){if(fileOptions[_0xebae('0xf')](_0x5be54c)){_0x250f38[_0x5be54c]=fileOptions[_0x5be54c];}}if(_0x61c364){for(var _0x1e6196 in _0x61c364){if(_0x61c364[_0xebae('0xf')](_0x1e6196)){_0x250f38[_0x1e6196]=_0x61c364[_0x1e6196];}}}return _0x250f38;}exports[_0xebae('0x10')]=function(_0x77d04b,_0x251625,_0x201661,_0xeb74d6){return new BPromise(function(_0x5e031b,_0x100d02){_0xeb74d6=combineOptions(_0xeb74d6);var _0x4cfbd6=new Buffer(_0x201661);var _0x504e9b=fs[_0xebae('0x11')](_0x77d04b);var _0x722c5f=fs[_0xebae('0x12')](_0x251625);var _0x30a85f=crypto[_0xebae('0x13')](_0xeb74d6[_0xebae('0x8')],_0x4cfbd6);_0x504e9b['on'](_0xebae('0x14'),function(_0x14ee2a){var _0xfc35f8=new Buffer(_0x30a85f[_0xebae('0x15')](_0x14ee2a),_0xebae('0x16'));_0x722c5f[_0xebae('0x17')](_0xfc35f8);});_0x504e9b['on'](_0xebae('0x18'),function(){try{var _0x24a401=new Buffer(_0x30a85f[_0xebae('0x19')](_0xebae('0x16')),_0xebae('0x16'));_0x722c5f[_0xebae('0x17')](_0x24a401);_0x722c5f['end']();_0x722c5f['on'](_0xebae('0x1a'),function(){return _0x5e031b(_0x251625);});}catch(_0xd082a7){fs[_0xebae('0x1b')](_0x251625);return _0x100d02(_0xd082a7);}});});};exports[_0xebae('0x1c')]=function(_0x58d389,_0x594775,_0x3d98d6,_0x3b99d1){return new BPromise(function(_0x25e199,_0x1d96c6){_0x3b99d1=combineOptions(_0x3b99d1);var _0x1e3036=new Buffer(_0x3d98d6);var _0x5c4653=fs[_0xebae('0x11')](_0x58d389);var _0x566490=fs[_0xebae('0x12')](_0x594775);var _0x18af00=crypto['createDecipher'](_0x3b99d1['algorithm'],_0x1e3036);_0x5c4653['on'](_0xebae('0x14'),function(_0x197d49){var _0x14661d=new Buffer(_0x18af00[_0xebae('0x15')](_0x197d49),_0xebae('0x16'));_0x566490[_0xebae('0x17')](_0x14661d);});_0x5c4653['on']('end',function(){try{var _0x56473a=new Buffer(_0x18af00[_0xebae('0x19')](_0xebae('0x16')),'binary');_0x566490['write'](_0x56473a);_0x566490[_0xebae('0x18')]();_0x566490['on'](_0xebae('0x1a'),function(){return _0x25e199(_0x594775);});}catch(_0x9939f6){fs[_0xebae('0x1b')](_0x594775);return _0x1d96c6(_0x9939f6);}});});};exports[_0xebae('0x1d')]=function(_0x20af3b,_0x36a85d,_0x6e9ad1){var _0xacb78e=_0x6e9ad1||stringOptions[_0xebae('0x8')];var _0x5eaeff=_0x36a85d||stringOptions['secret'];var _0x232a9b=crypto[_0xebae('0x13')](_0xacb78e,_0x5eaeff);var _0x2a1f1c=_0x232a9b[_0xebae('0x15')](_0x20af3b,_0xebae('0x1e'),_0xebae('0x1f'));_0x2a1f1c+=_0x232a9b[_0xebae('0x19')](_0xebae('0x1f'));return _0x2a1f1c;};exports[_0xebae('0x20')]=function(_0x3c1271,_0x5e33e9,_0x37e820){var _0x252c20=_0x37e820||stringOptions[_0xebae('0x8')];var _0x358eaa=_0x5e33e9||stringOptions[_0xebae('0x21')];var _0x194325=crypto[_0xebae('0x22')](_0x252c20,_0x358eaa);var _0x2ac0bb=_0x194325[_0xebae('0x15')](_0x3c1271,_0xebae('0x1f'),_0xebae('0x1e'));_0x2ac0bb+=_0x194325['final']('utf8');return _0x2ac0bb;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 8125903..2c13063 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 _0xa560=['existsSync','join','csv','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','basename','.csv'];(function(_0x42ca15,_0x193ccb){var _0x1c6ded=function(_0x40989a){while(--_0x40989a){_0x42ca15['push'](_0x42ca15['shift']());}};_0x1c6ded(++_0x193ccb);}(_0xa560,0x126));var _0x0a56=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xa560[_0x2c91e9];return _0x13f0ff;};'use strict';var util=require(_0x0a56('0x0'));var path=require(_0x0a56('0x1'));var _=require(_0x0a56('0x2'));var csv=require(_0x0a56('0x3'));var fs=require('fs');var BPromise=require(_0x0a56('0x4'));var zipdir=require(_0x0a56('0x5'));var rimraf=require(_0x0a56('0x6'));var db=require(_0x0a56('0x7'))['db'];var dbH=require('../../mysqldb')[_0x0a56('0x8')];var logger=require(_0x0a56('0x9'))(_0x0a56('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x0a56('0xb')][0x2]);var QUERY=process[_0x0a56('0xb')][0x3];var PATH=process[_0x0a56('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x455b15,_0x2ad6ed){var _0x21413c={'status':_0x455b15};var _0x26122d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ad6ed){_0x21413c['savename']=_0x2ad6ed;}return db[_0x0a56('0xc')][_0x0a56('0xd')](_0x21413c,_0x26122d);}function main(){var _0x32586c=0x1388;var _0x467bba;logger['info'](util['format'](_0x0a56('0xe'),EXTRACTED_REPORT_ID,_0x0a56('0xf')));return db['Setting'][_0x0a56('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0a56('0x11'),'splitSizeCsv']})[_0x0a56('0x12')](function(_0x33994a){if(_0x33994a){_0x467bba=_0x33994a;_0x32586c=_0x467bba['splitSizeCsv']||0x1388;}})[_0x0a56('0x12')](function(){return dbH[_0x0a56('0x13')][_0x0a56('0x14')](util[_0x0a56('0x15')](_0x0a56('0x16'),QUERY),{'type':dbH[_0x0a56('0x13')]['QueryTypes'][_0x0a56('0x17')]});})[_0x0a56('0x12')](function(_0x4906cc){if(!_0x4906cc[0x0][_0x0a56('0x18')]){return analyticExtractedReport(_0x0a56('0x19'));}var _0x172e2c=[];var _0x46bc06=0x0;if(_0x467bba[_0x0a56('0x11')]){if(_0x4906cc&&_0x4906cc[_0x0a56('0x1a')]){var _0x249987=_[_0x0a56('0x1b')](_0x4906cc[0x0][_0x0a56('0x18')]/_0x32586c);var _0x547496=Number[_0x0a56('0x1c')](_0x4906cc[0x0][_0x0a56('0x18')]/_0x32586c)?_0x4906cc[0x0][_0x0a56('0x18')]%_0x32586c:0x0;_0x249987[_0x0a56('0x1d')](function(_0x43f42b){if(_0x43f42b>0x0){_0x46bc06+=_0x32586c;}_0x172e2c[_0x0a56('0x1e')](dbH['sequelize'][_0x0a56('0x14')](util[_0x0a56('0x15')](_0x0a56('0x1f'),QUERY,_0x32586c,_0x46bc06),{'type':dbH['sequelize'][_0x0a56('0x20')][_0x0a56('0x17')]}));});if(_0x547496>0x0){_0x46bc06+=_0x32586c;_0x172e2c[_0x0a56('0x1e')](dbH[_0x0a56('0x13')]['query'](util[_0x0a56('0x15')](_0x0a56('0x1f'),QUERY,_0x547496,_0x46bc06),{'type':dbH[_0x0a56('0x13')][_0x0a56('0x20')][_0x0a56('0x17')]}));}}}else{_0x172e2c['push'](dbH[_0x0a56('0x13')]['query'](QUERY,{'type':dbH[_0x0a56('0x13')][_0x0a56('0x20')][_0x0a56('0x17')]}));}var _0x256910=path['dirname'](PATH);var _0xd04a2a=path[_0x0a56('0x21')](PATH,_0x0a56('0x22'));var _0x187a1b=_0x467bba[_0x0a56('0x11')]&&_0x172e2c[_0x0a56('0x1a')]>0x1;var _0x3ebe08=[];if(!fs[_0x0a56('0x23')](path['join'](_0x256910,_0xd04a2a))&&_0x187a1b){fs['mkdirSync'](path['join'](_0x256910,_0xd04a2a));}return BPromise['each'](_0x172e2c,function(_0x41d0f9){_0x3ebe08[_0x0a56('0x1e')](_0x41d0f9);})[_0x0a56('0x12')](function(){for(var _0x486cbb=0x0;_0x486cbb<_0x3ebe08[_0x0a56('0x1a')];_0x486cbb+=0x1){var _0x367fbf;var _0x1c3617=_0x3ebe08[_0x486cbb];if(_0x187a1b){_0x367fbf=path[_0x0a56('0x24')](_0x256910,_0xd04a2a,util[_0x0a56('0x15')]('%s%d.%s',_0xd04a2a,_0x486cbb,_0x0a56('0x25')));}else{_0x367fbf=path['join'](_0x256910,util['format'](_0x0a56('0x26'),_0xd04a2a,_0x0a56('0x25')));}fs['writeFileSync'](_0x367fbf,csv(_0x1c3617));}})[_0x0a56('0x12')](function(){if(_0x187a1b){return new Promise(function(_0xfffea1){zipdir(path[_0x0a56('0x24')](_0x256910,_0xd04a2a),{'saveTo':path[_0x0a56('0x24')](_0x256910,util[_0x0a56('0x15')](_0x0a56('0x26'),_0xd04a2a,_0x0a56('0x27')))},function(_0x1cf0e4,_0x52e12e){rimraf(path[_0x0a56('0x24')](_0x256910,_0xd04a2a),function(){});_0xfffea1(_0x0a56('0x28'));});});}})['then'](function(){logger['info'](util[_0x0a56('0x15')](_0x0a56('0x29'),EXTRACTED_REPORT_ID,_0x0a56('0xf')));return analyticExtractedReport(_0x0a56('0x2a'),_0x187a1b?util['format'](_0x0a56('0x26'),_0xd04a2a,_0x187a1b?_0x0a56('0x27'):'csv'):null);});})['catch'](function(_0x1c1fce){logger[_0x0a56('0x2b')](util[_0x0a56('0x15')](_0x0a56('0x2c'),EXTRACTED_REPORT_ID,_0x0a56('0xf')),util['inspect'](_0x1c1fce,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0a56('0x2d'));})['finally'](function(){process[_0x0a56('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xebb7=['%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','writeFileSync','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','zip','csv','catch','info','inspect','Failed','finally','exit','lodash','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','format','Setting','split','splitSizeCsv','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','then','num','Empty','length','forEach'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xebb7,0x74));var _0x7ebb=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xebb7[_0x3ab9ee];return _0x82ee88;};'use strict';var util=require('util');var path=require('path');var _=require(_0x7ebb('0x0'));var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x7ebb('0x1'))[_0x7ebb('0x2')];var logger=require(_0x7ebb('0x3'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x7ebb('0x4')][0x2]);var QUERY=process[_0x7ebb('0x4')][0x3];var PATH=process[_0x7ebb('0x4')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xab91bb,_0x4efeb2){var _0x1ddde2={'status':_0xab91bb};var _0x38a46e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4efeb2){_0x1ddde2[_0x7ebb('0x5')]=_0x4efeb2;}return db[_0x7ebb('0x6')][_0x7ebb('0x7')](_0x1ddde2,_0x38a46e);}function main(){var _0x151c2c=0x1388;var _0x12e41b;logger['info'](util[_0x7ebb('0x8')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0x7ebb('0x9')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7ebb('0xa'),_0x7ebb('0xb')]})['then'](function(_0x416229){if(_0x416229){_0x12e41b=_0x416229;_0x151c2c=_0x12e41b['splitSizeCsv']||0x1388;}})['then'](function(){return dbH['sequelize'][_0x7ebb('0xc')](util['format'](_0x7ebb('0xd'),QUERY),{'type':dbH[_0x7ebb('0xe')][_0x7ebb('0xf')][_0x7ebb('0x10')]});})[_0x7ebb('0x11')](function(_0x4dfc28){if(!_0x4dfc28[0x0][_0x7ebb('0x12')]){return analyticExtractedReport(_0x7ebb('0x13'));}var _0x5459fd=[];var _0x505df5=0x0;if(_0x12e41b['split']){if(_0x4dfc28&&_0x4dfc28[_0x7ebb('0x14')]){var _0x2bf71b=_['range'](_0x4dfc28[0x0][_0x7ebb('0x12')]/_0x151c2c);var _0x1c1091=Number['isInteger'](_0x4dfc28[0x0][_0x7ebb('0x12')]/_0x151c2c)?_0x4dfc28[0x0][_0x7ebb('0x12')]%_0x151c2c:0x0;_0x2bf71b[_0x7ebb('0x15')](function(_0xdfb825){if(_0xdfb825>0x0){_0x505df5+=_0x151c2c;}_0x5459fd['push'](dbH[_0x7ebb('0xe')][_0x7ebb('0xc')](util['format'](_0x7ebb('0x16'),QUERY,_0x151c2c,_0x505df5),{'type':dbH[_0x7ebb('0xe')]['QueryTypes']['SELECT']}));});if(_0x1c1091>0x0){_0x505df5+=_0x151c2c;_0x5459fd[_0x7ebb('0x17')](dbH[_0x7ebb('0xe')][_0x7ebb('0xc')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1c1091,_0x505df5),{'type':dbH[_0x7ebb('0xe')]['QueryTypes'][_0x7ebb('0x10')]}));}}}else{_0x5459fd[_0x7ebb('0x17')](dbH[_0x7ebb('0xe')][_0x7ebb('0xc')](QUERY,{'type':dbH['sequelize'][_0x7ebb('0xf')][_0x7ebb('0x10')]}));}var _0x515919=path[_0x7ebb('0x18')](PATH);var _0x337c93=path[_0x7ebb('0x19')](PATH,_0x7ebb('0x1a'));var _0x3b7f3a=_0x12e41b[_0x7ebb('0xa')]&&_0x5459fd[_0x7ebb('0x14')]>0x1;var _0x2d7a95=[];if(!fs[_0x7ebb('0x1b')](path[_0x7ebb('0x1c')](_0x515919,_0x337c93))&&_0x3b7f3a){fs[_0x7ebb('0x1d')](path[_0x7ebb('0x1c')](_0x515919,_0x337c93));}return BPromise[_0x7ebb('0x1e')](_0x5459fd,function(_0x290819){_0x2d7a95['push'](_0x290819);})['then'](function(){for(var _0x3ef850=0x0;_0x3ef850<_0x2d7a95[_0x7ebb('0x14')];_0x3ef850+=0x1){var _0x53a227;var _0x1b7457=_0x2d7a95[_0x3ef850];if(_0x3b7f3a){_0x53a227=path[_0x7ebb('0x1c')](_0x515919,_0x337c93,util['format'](_0x7ebb('0x1f'),_0x337c93,_0x3ef850,'csv'));}else{_0x53a227=path[_0x7ebb('0x1c')](_0x515919,util[_0x7ebb('0x8')](_0x7ebb('0x20'),_0x337c93,'csv'));}fs[_0x7ebb('0x21')](_0x53a227,csv(_0x1b7457));}})[_0x7ebb('0x11')](function(){if(_0x3b7f3a){return new Promise(function(_0x4891d9){zipdir(path[_0x7ebb('0x1c')](_0x515919,_0x337c93),{'saveTo':path[_0x7ebb('0x1c')](_0x515919,util[_0x7ebb('0x8')](_0x7ebb('0x20'),_0x337c93,'zip'))},function(_0x381ecd,_0x1772e1){rimraf(path[_0x7ebb('0x1c')](_0x515919,_0x337c93),function(){});_0x4891d9(_0x7ebb('0x22'));});});}})[_0x7ebb('0x11')](function(){logger['info'](util[_0x7ebb('0x8')](_0x7ebb('0x23'),EXTRACTED_REPORT_ID,_0x7ebb('0x24')));return analyticExtractedReport(_0x7ebb('0x25'),_0x3b7f3a?util[_0x7ebb('0x8')](_0x7ebb('0x20'),_0x337c93,_0x3b7f3a?_0x7ebb('0x26'):_0x7ebb('0x27')):null);});})[_0x7ebb('0x28')](function(_0x20c665){logger[_0x7ebb('0x29')](util[_0x7ebb('0x8')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x7ebb('0x24')),util[_0x7ebb('0x2a')](_0x20c665,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7ebb('0x2b'));})[_0x7ebb('0x2c')](function(){process[_0x7ebb('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index b7ea3de..c16b442 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 _0xec85=['existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','../../mysqldb','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','tableHeader','map','pick','toString','length','body','push','concat','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','right','num','Empty','Setting','find','splitSizePdf','then','split','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','basename','.pdf'];(function(_0x382e89,_0x4768c0){var _0x3a1318=function(_0x79e1ce){while(--_0x79e1ce){_0x382e89['push'](_0x382e89['shift']());}};_0x3a1318(++_0x4768c0);}(_0xec85,0xd8));var _0x5ec8=function(_0x33ae9c,_0x75afa4){_0x33ae9c=_0x33ae9c-0x0;var _0x5c96ce=_0xec85[_0x33ae9c];return _0x5c96ce;};'use strict';var _=require(_0x5ec8('0x0'));var fs=require('fs');var util=require(_0x5ec8('0x1'));var path=require(_0x5ec8('0x2'));var moment=require(_0x5ec8('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x5ec8('0x4'));var zipdir=require(_0x5ec8('0x5'));var rimraf=require(_0x5ec8('0x6'));var JSDOM=require(_0x5ec8('0x7'))[_0x5ec8('0x8')];var window=new JSDOM('')[_0x5ec8('0x9')];var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var dbH=require(_0x5ec8('0xa'))['dbH'];var logger=require(_0x5ec8('0xb'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x5ec8('0xc')][0x2]);var QUERY=process[_0x5ec8('0xc')][0x3];var PATH=process[_0x5ec8('0xc')][0x4];var NAME=process[_0x5ec8('0xc')][0x5];var FORMAT=_0x5ec8('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5197e3,_0x22599a){var _0x3b8eab={'status':_0x5197e3};var _0x266a91={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x22599a){_0x3b8eab[_0x5ec8('0xe')]=_0x22599a;}return db['AnalyticExtractedReport'][_0x5ec8('0xf')](_0x3b8eab,_0x266a91);}function getHeaders(_0x444e9f){return _['map'](_0x444e9f,function(_0x10d0fe){return{'text':_0x10d0fe,'style':_0x5ec8('0x10')};});}function getRows(_0x10dd7b,_0x47e350){return _[_0x5ec8('0x11')](_0x47e350,function(_0x1b7bf8){return _(_0x1b7bf8)[_0x5ec8('0x12')](_0x10dd7b)[_0x5ec8('0x11')](function(_0x23b195){return _0x23b195?_[_0x5ec8('0x13')](_0x23b195):'';})['value']();});}function createTable(_0x51ec0f,_0x8c7c95){var _0x3d5886={'widths':_['fill'](Array(_0x51ec0f[_0x5ec8('0x14')]),0x91),'heights':function(_0x56916e){return _0x56916e===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x1df6bf=getHeaders(_0x51ec0f);_0x3d5886[_0x5ec8('0x15')][_0x5ec8('0x16')](_0x1df6bf);var _0xe62bcc=getRows(_0x51ec0f,_0x8c7c95);_0x3d5886[_0x5ec8('0x15')]=_0x3d5886[_0x5ec8('0x15')][_0x5ec8('0x17')](_0xe62bcc);return _0x3d5886;}function createTables(_0x271b27){var _0x163cb2=[];var _0x4c183e=_[_0x5ec8('0x18')](Object['keys'](_0x271b27[0x0]),0x5);_0x4c183e[_0x5ec8('0x19')](function(_0x9add96){_0x163cb2[_0x5ec8('0x16')](createTable(_0x9add96,_0x271b27));});return _0x163cb2;}function getPDFDocDefinition(_0x487335){var _0x50a432=util[_0x5ec8('0x1a')](_0x5ec8('0x1b'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x5ec8('0x1c')])[_0x5ec8('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x5ec8('0x1d')])[_0x5ec8('0x1a')](FORMAT));var _0x29efcf=[];for(var _0xafaba8=0x0;_0xafaba8<_0x487335[_0x5ec8('0x14')];_0xafaba8++){var _0x3aed04=[];if(_0xafaba8===0x0){_0x3aed04[_0x5ec8('0x16')]({'text':_0x50a432,'style':_0x5ec8('0x1e')});}var _0x48ad42={'table':_0x487335[_0xafaba8]};if(_0xafaba8>0x0){_0x48ad42[_0x5ec8('0x1f')]=_0x5ec8('0x20');_0x48ad42[_0x5ec8('0x21')]=[0x0,0x46,0x0,0x0];}_0x3aed04[_0x5ec8('0x16')](_0x48ad42);_0x29efcf[_0x5ec8('0x16')](_0x3aed04);}return{'pageSize':'A4','pageOrientation':_0x5ec8('0x22'),'content':_0x29efcf,'footer':function(_0x677561,_0x439b67){return{'text':_0x677561[_0x5ec8('0x13')]()+_0x5ec8('0x23')+_0x439b67,'style':'footer'};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x5ec8('0x24'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1639c0){var _0x298ec0=0x1388;var _0x75cfdf;if(!_0x1639c0[0x0][_0x5ec8('0x25')]){return analyticExtractedReport(_0x5ec8('0x26'));}return db[_0x5ec8('0x27')][_0x5ec8('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x5ec8('0x29')]})[_0x5ec8('0x2a')](function(_0x2982b0){if(_0x2982b0){_0x75cfdf=_0x2982b0;_0x298ec0=_0x75cfdf['splitSizePdf']||0x3e8;}})[_0x5ec8('0x2a')](function(){var _0x5c1081=[];var _0xe62295=0x0;if(_0x75cfdf[_0x5ec8('0x2b')]){if(_0x1639c0&&_0x1639c0[_0x5ec8('0x14')]){var _0xc5286d=_['range'](_0x1639c0[0x0]['num']/_0x298ec0);var _0x323e08=Number['isInteger'](_0x1639c0[0x0][_0x5ec8('0x25')]/_0x298ec0)?_0x1639c0[0x0][_0x5ec8('0x25')]%_0x298ec0:0x0;_0xc5286d[_0x5ec8('0x19')](function(_0x473086){if(_0x473086>0x0){_0xe62295+=_0x298ec0;}_0x5c1081['push'](dbH[_0x5ec8('0x2c')][_0x5ec8('0x2d')](util[_0x5ec8('0x1a')](_0x5ec8('0x2e'),QUERY,_0x298ec0,_0xe62295),{'type':dbH['sequelize']['QueryTypes'][_0x5ec8('0x2f')]}));});if(_0x323e08>0x0){_0xe62295+=_0x298ec0;_0x5c1081[_0x5ec8('0x16')](dbH['sequelize'][_0x5ec8('0x2d')](util[_0x5ec8('0x1a')](_0x5ec8('0x2e'),QUERY,_0x323e08,_0xe62295),{'type':dbH[_0x5ec8('0x2c')][_0x5ec8('0x30')]['SELECT']}));}}}else{_0x5c1081[_0x5ec8('0x16')](dbH['sequelize'][_0x5ec8('0x2d')](QUERY,{'type':dbH['sequelize'][_0x5ec8('0x30')][_0x5ec8('0x2f')]}));}var _0x221504=path['dirname'](PATH);var _0x143106=path[_0x5ec8('0x31')](PATH,_0x5ec8('0x32'));var _0x1a96ba=_0x75cfdf[_0x5ec8('0x2b')]&&_0x5c1081['length']>0x1;var _0x489246=[];if(!fs[_0x5ec8('0x33')](path[_0x5ec8('0x34')](_0x221504,_0x143106))&&_0x1a96ba){fs[_0x5ec8('0x35')](path['join'](_0x221504,_0x143106));}return BPromise[_0x5ec8('0x36')](_0x5c1081,function(_0x49b233){_0x489246[_0x5ec8('0x16')](_0x49b233);})[_0x5ec8('0x2a')](function(){var _0x4dfe80=[];for(var _0x597245=0x0;_0x597245<_0x489246[_0x5ec8('0x14')];_0x597245+=0x1){var _0x567e79=_0x489246[_0x597245];var _0x125512=createTables(_[_0x5ec8('0x37')](_0x567e79));var _0x3a3b2e;var _0x5f1494=getPDFDocDefinition(_0x125512);var _0x3f85a6=getPDFPrinter();var _0x4b316a=_0x3f85a6[_0x5ec8('0x38')](_0x5f1494);if(_0x1a96ba){_0x3a3b2e=path[_0x5ec8('0x34')](_0x221504,_0x143106,util['format'](_0x5ec8('0x39'),_0x143106,_0x597245,_0x5ec8('0x3a')));}else{_0x3a3b2e=path[_0x5ec8('0x34')](_0x221504,util[_0x5ec8('0x1a')](_0x5ec8('0x3b'),_0x143106,_0x5ec8('0x3a')));}_0x4dfe80[_0x5ec8('0x16')](writePDFDocument(_0x4b316a,_0x3a3b2e));}return Promise[_0x5ec8('0x3c')](_0x4dfe80);})[_0x5ec8('0x2a')](function(){if(_0x1a96ba){return new Promise(function(_0x242318){zipdir(path['join'](_0x221504,_0x143106),{'saveTo':path[_0x5ec8('0x34')](_0x221504,util['format'](_0x5ec8('0x3b'),_0x143106,_0x5ec8('0x3d')))},function(){rimraf(path[_0x5ec8('0x34')](_0x221504,_0x143106),function(){});_0x242318(_0x5ec8('0x3e'));});});}})[_0x5ec8('0x2a')](function(){if(!_0x1a96ba)return;rimraf(path['join'](_0x221504,_0x143106),function(){});})[_0x5ec8('0x2a')](function(){logger['info'](util[_0x5ec8('0x1a')](_0x5ec8('0x3f'),EXTRACTED_REPORT_ID,_0x5ec8('0x40')));return analyticExtractedReport(_0x5ec8('0x41'),_0x1a96ba?util[_0x5ec8('0x1a')]('%s.%s',_0x143106,_0x1a96ba?_0x5ec8('0x3d'):_0x5ec8('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db[_0x5ec8('0x42')][_0x5ec8('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x5ec8('0x2a')](function(_0x34a04d){EXTRACTED_REPORT=_0x34a04d;return dbH[_0x5ec8('0x2c')]['query'](util['format'](_0x5ec8('0x44'),QUERY),{'type':dbH[_0x5ec8('0x2c')]['QueryTypes']['SELECT']});})[_0x5ec8('0x2a')](extractReport)[_0x5ec8('0x45')](function(_0x5cefb8){logger[_0x5ec8('0x46')](util[_0x5ec8('0x1a')](_0x5ec8('0x47'),EXTRACTED_REPORT_ID,_0x5ec8('0x40')),util[_0x5ec8('0x48')](_0x5cefb8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5ec8('0x49'));})['finally'](function(){process[_0x5ec8('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1d3d1a=new PdfPrinter({'Arial':{'normal':__dirname+_0x5ec8('0x4b'),'bold':__dirname+_0x5ec8('0x4c'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x5ec8('0x4d')}});return _0x1d3d1a;}function getPDFDocDefinitionFromHTML(_0x5cdf18,_0xfe06){var _0x33fc59=util[_0x5ec8('0x1a')]('%s\x20#%d',_0xfe06['channel'],_0xfe06[_0x5ec8('0x4e')]);var _0x45b461=moment()[_0x5ec8('0x1a')](_0x5ec8('0x4f'))[_0x5ec8('0x13')]();var _0x9b093b=htmlToPdfmake(_0x5cdf18,{'window':window,'tableAutoSize':!![]});return{'content':[_0x9b093b],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x5ec8('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x5ec8('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x5ec8('0x50')}},'header':function(){return[{'text':_0x5ec8('0x51'),'style':_0x5ec8('0x1e')}];},'footer':function(_0x4f0c4f,_0x1ad934){return[{'text':util[_0x5ec8('0x1a')](_0x5ec8('0x52'),_0x33fc59,_0x4f0c4f,_0x1ad934,_0x45b461),'style':_0x5ec8('0x53')}];}};}function writePDFDocument(_0x2775c8,_0x5077be){return new Promise(function(_0x2a82f1,_0x2896b8){var _0xc16ea7=_0x2775c8['pipe'](fs[_0x5ec8('0x54')](_0x5077be));_0xc16ea7['on'](_0x5ec8('0x55'),function(){_0x2a82f1(_0x5ec8('0x55'));});_0xc16ea7['on'](_0x5ec8('0x56'),function(_0x5cb84a){_0x2896b8(_0x5cb84a);});_0x2775c8[_0x5ec8('0x57')]();});}exports[_0x5ec8('0x58')]=function(_0x4f8177,_0x1f4abd){var _0x5c1245=getPDFPrinter();var _0x2fddd0=getPDFDocDefinitionFromHTML(_0x4f8177,_0x1f4abd);var _0x470477=_0x5c1245[_0x5ec8('0x38')](_0x2fddd0);return writePDFDocument(_0x470477,_0x1f4abd['path'])['catch'](function(_0x269e47){throw _0x269e47;});}; \ No newline at end of file +var _0x2f67=['lodash','util','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','pick','toString','value','fill','auto','body','push','concat','chunk','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','length','header','pageBreak','before','landscape','\x20/\x20','footer','Arial','black','num','Empty','Setting','splitSizePdf','then','split','range','isInteger','forEach','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','dirname','.pdf','existsSync','join','each','createPdfKitDocument','%s.%s','pdf','zip\x20finished','PDF','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','catch'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2f67,0x10b));var _0x72f6=function(_0x1ad47f,_0x21db49){_0x1ad47f=_0x1ad47f-0x0;var _0x360dd2=_0x2f67[_0x1ad47f];return _0x360dd2;};'use strict';var _=require(_0x72f6('0x0'));var fs=require('fs');var util=require(_0x72f6('0x1'));var path=require(_0x72f6('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0x72f6('0x3'));var PdfPrinter=require(_0x72f6('0x4'));var zipdir=require(_0x72f6('0x5'));var rimraf=require(_0x72f6('0x6'));var JSDOM=require(_0x72f6('0x7'))[_0x72f6('0x8')];var window=new JSDOM('')['window'];var BPromise=require('bluebird');var db=require(_0x72f6('0x9'))['db'];var dbH=require('../../mysqldb')[_0x72f6('0xa')];var logger=require(_0x72f6('0xb'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x72f6('0xc')][0x3];var PATH=process['argv'][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x72f6('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x562972,_0x41facb){var _0x50f2cf={'status':_0x562972};var _0x4da30c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x41facb){_0x50f2cf[_0x72f6('0xe')]=_0x41facb;}return db[_0x72f6('0xf')][_0x72f6('0x10')](_0x50f2cf,_0x4da30c);}function getHeaders(_0x423a2b){return _['map'](_0x423a2b,function(_0xe10e6d){return{'text':_0xe10e6d,'style':'tableHeader'};});}function getRows(_0x5082e6,_0xc178a4){return _[_0x72f6('0x11')](_0xc178a4,function(_0xbedad6){return _(_0xbedad6)[_0x72f6('0x12')](_0x5082e6)[_0x72f6('0x11')](function(_0x370873){return _0x370873?_[_0x72f6('0x13')](_0x370873):'';})[_0x72f6('0x14')]();});}function createTable(_0x29b391,_0x5e5680){var _0x491176={'widths':_[_0x72f6('0x15')](Array(_0x29b391['length']),0x91),'heights':function(_0x5316a4){return _0x5316a4===0x0?_0x72f6('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2fb66b=getHeaders(_0x29b391);_0x491176[_0x72f6('0x17')][_0x72f6('0x18')](_0x2fb66b);var _0x32662=getRows(_0x29b391,_0x5e5680);_0x491176['body']=_0x491176[_0x72f6('0x17')][_0x72f6('0x19')](_0x32662);return _0x491176;}function createTables(_0x3f884c){var _0x209848=[];var _0x2f742f=_[_0x72f6('0x1a')](Object[_0x72f6('0x1b')](_0x3f884c[0x0]),0x5);_0x2f742f['forEach'](function(_0x1d7c93){_0x209848[_0x72f6('0x18')](createTable(_0x1d7c93,_0x3f884c));});return _0x209848;}function getPDFDocDefinition(_0x1bcd0c){var _0x512738=util[_0x72f6('0x1c')](_0x72f6('0x1d'),NAME,EXTRACTED_REPORT[_0x72f6('0x1e')],moment(EXTRACTED_REPORT[_0x72f6('0x1f')])[_0x72f6('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0x72f6('0x20')])[_0x72f6('0x1c')](FORMAT));var _0x33bc1b=[];for(var _0x1bf25a=0x0;_0x1bf25a<_0x1bcd0c[_0x72f6('0x21')];_0x1bf25a++){var _0x34f81d=[];if(_0x1bf25a===0x0){_0x34f81d[_0x72f6('0x18')]({'text':_0x512738,'style':_0x72f6('0x22')});}var _0x15609b={'table':_0x1bcd0c[_0x1bf25a]};if(_0x1bf25a>0x0){_0x15609b[_0x72f6('0x23')]=_0x72f6('0x24');_0x15609b['margin']=[0x0,0x46,0x0,0x0];}_0x34f81d['push'](_0x15609b);_0x33bc1b[_0x72f6('0x18')](_0x34f81d);}return{'pageSize':'A4','pageOrientation':_0x72f6('0x25'),'content':_0x33bc1b,'footer':function(_0x2a205e,_0x1715a2){return{'text':_0x2a205e['toString']()+_0x72f6('0x26')+_0x1715a2,'style':_0x72f6('0x27')};},'defaultStyle':{'font':_0x72f6('0x28')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x72f6('0x29')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xdcd7e9){var _0x333b15=0x1388;var _0xec7415;if(!_0xdcd7e9[0x0][_0x72f6('0x2a')]){return analyticExtractedReport(_0x72f6('0x2b'));}return db[_0x72f6('0x2c')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x72f6('0x2d')]})[_0x72f6('0x2e')](function(_0x59c29c){if(_0x59c29c){_0xec7415=_0x59c29c;_0x333b15=_0xec7415[_0x72f6('0x2d')]||0x3e8;}})[_0x72f6('0x2e')](function(){var _0x49f9d2=[];var _0x12ea9f=0x0;if(_0xec7415[_0x72f6('0x2f')]){if(_0xdcd7e9&&_0xdcd7e9[_0x72f6('0x21')]){var _0x1c606c=_[_0x72f6('0x30')](_0xdcd7e9[0x0]['num']/_0x333b15);var _0x1cd7ac=Number[_0x72f6('0x31')](_0xdcd7e9[0x0][_0x72f6('0x2a')]/_0x333b15)?_0xdcd7e9[0x0]['num']%_0x333b15:0x0;_0x1c606c[_0x72f6('0x32')](function(_0x14f868){if(_0x14f868>0x0){_0x12ea9f+=_0x333b15;}_0x49f9d2[_0x72f6('0x18')](dbH[_0x72f6('0x33')][_0x72f6('0x34')](util[_0x72f6('0x1c')](_0x72f6('0x35'),QUERY,_0x333b15,_0x12ea9f),{'type':dbH[_0x72f6('0x33')]['QueryTypes'][_0x72f6('0x36')]}));});if(_0x1cd7ac>0x0){_0x12ea9f+=_0x333b15;_0x49f9d2[_0x72f6('0x18')](dbH['sequelize'][_0x72f6('0x34')](util[_0x72f6('0x1c')](_0x72f6('0x35'),QUERY,_0x1cd7ac,_0x12ea9f),{'type':dbH[_0x72f6('0x33')][_0x72f6('0x37')][_0x72f6('0x36')]}));}}}else{_0x49f9d2[_0x72f6('0x18')](dbH[_0x72f6('0x33')]['query'](QUERY,{'type':dbH[_0x72f6('0x33')][_0x72f6('0x37')][_0x72f6('0x36')]}));}var _0x4c68a9=path[_0x72f6('0x38')](PATH);var _0x29cd26=path['basename'](PATH,_0x72f6('0x39'));var _0x3a9a1d=_0xec7415['split']&&_0x49f9d2[_0x72f6('0x21')]>0x1;var _0x13f69b=[];if(!fs[_0x72f6('0x3a')](path[_0x72f6('0x3b')](_0x4c68a9,_0x29cd26))&&_0x3a9a1d){fs['mkdirSync'](path[_0x72f6('0x3b')](_0x4c68a9,_0x29cd26));}return BPromise[_0x72f6('0x3c')](_0x49f9d2,function(_0x47728d){_0x13f69b[_0x72f6('0x18')](_0x47728d);})[_0x72f6('0x2e')](function(){var _0x19e8b8=[];for(var _0x105b80=0x0;_0x105b80<_0x13f69b['length'];_0x105b80+=0x1){var _0x8133f8=_0x13f69b[_0x105b80];var _0x4bce1d=createTables(_['flatten'](_0x8133f8));var _0x13541f;var _0x14b06a=getPDFDocDefinition(_0x4bce1d);var _0x1c2d9a=getPDFPrinter();var _0x4fd43e=_0x1c2d9a[_0x72f6('0x3d')](_0x14b06a);if(_0x3a9a1d){_0x13541f=path[_0x72f6('0x3b')](_0x4c68a9,_0x29cd26,util[_0x72f6('0x1c')]('%s%d.%s',_0x29cd26,_0x105b80,'pdf'));}else{_0x13541f=path[_0x72f6('0x3b')](_0x4c68a9,util[_0x72f6('0x1c')](_0x72f6('0x3e'),_0x29cd26,_0x72f6('0x3f')));}_0x19e8b8['push'](writePDFDocument(_0x4fd43e,_0x13541f));}return Promise['all'](_0x19e8b8);})[_0x72f6('0x2e')](function(){if(_0x3a9a1d){return new Promise(function(_0x469174){zipdir(path['join'](_0x4c68a9,_0x29cd26),{'saveTo':path[_0x72f6('0x3b')](_0x4c68a9,util['format'](_0x72f6('0x3e'),_0x29cd26,'zip'))},function(){rimraf(path[_0x72f6('0x3b')](_0x4c68a9,_0x29cd26),function(){});_0x469174(_0x72f6('0x40'));});});}})['then'](function(){if(!_0x3a9a1d)return;rimraf(path[_0x72f6('0x3b')](_0x4c68a9,_0x29cd26),function(){});})['then'](function(){logger['info'](util[_0x72f6('0x1c')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x72f6('0x41')));return analyticExtractedReport(_0x72f6('0x42'),_0x3a9a1d?util[_0x72f6('0x1c')](_0x72f6('0x3e'),_0x29cd26,_0x3a9a1d?'zip':_0x72f6('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x72f6('0x43')](util[_0x72f6('0x1c')](_0x72f6('0x44'),EXTRACTED_REPORT_ID,_0x72f6('0x41')));return db[_0x72f6('0xf')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x72f6('0x2e')](function(_0x1e9892){EXTRACTED_REPORT=_0x1e9892;return dbH[_0x72f6('0x33')][_0x72f6('0x34')](util[_0x72f6('0x1c')](_0x72f6('0x45'),QUERY),{'type':dbH[_0x72f6('0x33')][_0x72f6('0x37')]['SELECT']});})['then'](extractReport)['catch'](function(_0x346e5f){logger[_0x72f6('0x43')](util[_0x72f6('0x1c')](_0x72f6('0x46'),EXTRACTED_REPORT_ID,_0x72f6('0x41')),util['inspect'](_0x346e5f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x72f6('0x47'));})[_0x72f6('0x48')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x352539=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x72f6('0x49'),'italics':__dirname+_0x72f6('0x4a'),'bolditalics':__dirname+_0x72f6('0x4b')}});return _0x352539;}function getPDFDocDefinitionFromHTML(_0x3ed00b,_0x35fdd2){var _0x3d033c=util['format']('%s\x20#%d',_0x35fdd2[_0x72f6('0x4c')],_0x35fdd2[_0x72f6('0x4d')]);var _0x48e1b8=moment()[_0x72f6('0x1c')](_0x72f6('0x4e'))[_0x72f6('0x13')]();var _0x5ce818=htmlToPdfmake(_0x3ed00b,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5ce818],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x72f6('0x4f'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x72f6('0x4f'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x72f6('0x4f')}},'header':function(){return[{'text':_0x72f6('0x50'),'style':_0x72f6('0x22')}];},'footer':function(_0x3cf1fb,_0x5b9dfa){return[{'text':util[_0x72f6('0x1c')](_0x72f6('0x51'),_0x3d033c,_0x3cf1fb,_0x5b9dfa,_0x48e1b8),'style':_0x72f6('0x27')}];}};}function writePDFDocument(_0x12c9bb,_0x4cf4d3){return new Promise(function(_0x311bb6,_0x5d7707){var _0x41a32f=_0x12c9bb[_0x72f6('0x52')](fs[_0x72f6('0x53')](_0x4cf4d3));_0x41a32f['on'](_0x72f6('0x54'),function(){_0x311bb6(_0x72f6('0x54'));});_0x41a32f['on'](_0x72f6('0x55'),function(_0x6d0f6a){_0x5d7707(_0x6d0f6a);});_0x12c9bb[_0x72f6('0x56')]();});}exports[_0x72f6('0x57')]=function(_0x40a6f4,_0x2f6276){var _0x5205af=getPDFPrinter();var _0x4b9d11=getPDFDocDefinitionFromHTML(_0x40a6f4,_0x2f6276);var _0x1ca6de=_0x5205af[_0x72f6('0x3d')](_0x4b9d11);return writePDFDocument(_0x1ca6de,_0x2f6276[_0x72f6('0x2')])[_0x72f6('0x58')](function(_0x100872){throw _0x100872;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index cde2a89..ac7b6e5 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 _0x5934=['SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','range','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','dirname','basename','existsSync','mkdirSync','join','each','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','then','splitSizeXlsx','sequelize'];(function(_0x3fea89,_0x1dfecb){var _0x300111=function(_0x5c184c){while(--_0x5c184c){_0x3fea89['push'](_0x3fea89['shift']());}};_0x300111(++_0x1dfecb);}(_0x5934,0x84));var _0x4593=function(_0x3cf894,_0x5a4d17){_0x3cf894=_0x3cf894-0x0;var _0xad52e6=_0x5934[_0x3cf894];return _0xad52e6;};'use strict';var util=require(_0x4593('0x0'));var path=require(_0x4593('0x1'));var _=require(_0x4593('0x2'));var fs=require('fs');var json2xls=require(_0x4593('0x3'));var BPromise=require(_0x4593('0x4'));var zipdir=require(_0x4593('0x5'));var rimraf=require(_0x4593('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4593('0x7'))[_0x4593('0x8')];var logger=require(_0x4593('0x9'))(_0x4593('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5d8a36,_0x36e97d){var _0xc42541={'status':_0x5d8a36};var _0x68b016={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x36e97d){_0xc42541[_0x4593('0xb')]=_0x36e97d;}return db[_0x4593('0xc')]['update'](_0xc42541,_0x68b016);}function main(){var _0x2f19bf=0x1388;var _0x516f93;logger[_0x4593('0xd')](util[_0x4593('0xe')](_0x4593('0xf'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x4593('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x4593('0x11'),'splitSizeXlsx']})[_0x4593('0x12')](function(_0x46425b){if(_0x46425b){_0x516f93=_0x46425b;_0x2f19bf=_0x516f93[_0x4593('0x13')]||0x1388;}})[_0x4593('0x12')](function(){return dbH[_0x4593('0x14')]['query'](util['format'](_0x4593('0x15'),QUERY),{'type':dbH[_0x4593('0x14')]['QueryTypes'][_0x4593('0x16')]});})[_0x4593('0x12')](function(_0x2e773d){if(!_0x2e773d[0x0][_0x4593('0x17')]){return analyticExtractedReport(_0x4593('0x18'));}var _0x51a264=[];var _0x412e56=0x0;if(_0x516f93[_0x4593('0x11')]){if(_0x2e773d&&_0x2e773d['length']){var _0x30716f=_[_0x4593('0x19')](_0x2e773d[0x0]['num']/_0x2f19bf);var _0xc30354=Number['isInteger'](_0x2e773d[0x0][_0x4593('0x17')]/_0x2f19bf)?_0x2e773d[0x0]['num']%_0x2f19bf:0x0;_0x30716f[_0x4593('0x1a')](function(_0x10ae35){if(_0x10ae35>0x0){_0x412e56+=_0x2f19bf;}_0x51a264['push'](dbH['sequelize'][_0x4593('0x1b')](util['format'](_0x4593('0x1c'),QUERY,_0x2f19bf,_0x412e56),{'type':dbH[_0x4593('0x14')][_0x4593('0x1d')][_0x4593('0x16')]}));});if(_0xc30354>0x0){_0x412e56+=_0x2f19bf;_0x51a264[_0x4593('0x1e')](dbH[_0x4593('0x14')]['query'](util[_0x4593('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xc30354,_0x412e56),{'type':dbH['sequelize'][_0x4593('0x1d')]['SELECT']}));}}}else{_0x51a264[_0x4593('0x1e')](dbH['sequelize'][_0x4593('0x1b')](QUERY,{'type':dbH[_0x4593('0x14')][_0x4593('0x1d')]['SELECT']}));}var _0x5f43de=path[_0x4593('0x1f')](PATH);var _0xb58d71=path[_0x4593('0x20')](PATH,'.xlsx');var _0x551aec=_0x516f93[_0x4593('0x11')]&&_0x51a264['length']>0x1;var _0x5a4a85=[];if(!fs[_0x4593('0x21')](path['join'](_0x5f43de,_0xb58d71))&&_0x551aec){fs[_0x4593('0x22')](path[_0x4593('0x23')](_0x5f43de,_0xb58d71));}return BPromise[_0x4593('0x24')](_0x51a264,function(_0x5559f9){_0x5a4a85[_0x4593('0x1e')](_0x5559f9);})[_0x4593('0x12')](function(){for(var _0x2bf78d=0x0;_0x2bf78d<_0x5a4a85['length'];_0x2bf78d+=0x1){var _0x1d8830;var _0x35c8bc=_0x5a4a85[_0x2bf78d];if(_0x551aec){_0x1d8830=path[_0x4593('0x23')](_0x5f43de,_0xb58d71,util[_0x4593('0xe')]('%s%d.%s',_0xb58d71,_0x2bf78d,_0x4593('0x25')));}else{_0x1d8830=path[_0x4593('0x23')](_0x5f43de,util[_0x4593('0xe')](_0x4593('0x26'),_0xb58d71,_0x4593('0x25')));}fs[_0x4593('0x27')](_0x1d8830,json2xls(_0x35c8bc),_0x4593('0x28'));}})[_0x4593('0x12')](function(){if(_0x551aec){return new Promise(function(_0x271f67){zipdir(path[_0x4593('0x23')](_0x5f43de,_0xb58d71),{'saveTo':path[_0x4593('0x23')](_0x5f43de,util['format'](_0x4593('0x26'),_0xb58d71,_0x4593('0x29')))},function(_0x1ad323,_0x26bbda){rimraf(path['join'](_0x5f43de,_0xb58d71),function(){});_0x271f67(_0x4593('0x2a'));});});}})[_0x4593('0x12')](function(){logger['info'](util['format'](_0x4593('0x2b'),EXTRACTED_REPORT_ID,_0x4593('0x2c')));return analyticExtractedReport(_0x4593('0x2d'),_0x551aec?util['format'](_0x4593('0x26'),_0xb58d71,_0x551aec?_0x4593('0x29'):'xlsx'):null);});})[_0x4593('0x2e')](function(_0x228029){logger['info'](util[_0x4593('0xe')](_0x4593('0x2f'),EXTRACTED_REPORT_ID,_0x4593('0x2c')),util[_0x4593('0x30')](_0x228029,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x4593('0x31')](function(){process[_0x4593('0x32')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x964a=['find','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','range','format','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.xlsx','length','existsSync','join','mkdirSync','each','%s.%s','binary','zip','Completed','xlsx','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX'];(function(_0x84f43,_0x31e453){var _0x3348ab=function(_0x529151){while(--_0x529151){_0x84f43['push'](_0x84f43['shift']());}};_0x3348ab(++_0x31e453);}(_0x964a,0x13a));var _0xa964=function(_0x5381a5,_0x11c5b9){_0x5381a5=_0x5381a5-0x0;var _0x292189=_0x964a[_0x5381a5];return _0x292189;};'use strict';var util=require(_0xa964('0x0'));var path=require(_0xa964('0x1'));var _=require(_0xa964('0x2'));var fs=require('fs');var json2xls=require(_0xa964('0x3'));var BPromise=require(_0xa964('0x4'));var zipdir=require(_0xa964('0x5'));var rimraf=require(_0xa964('0x6'));var db=require(_0xa964('0x7'))['db'];var dbH=require(_0xa964('0x7'))[_0xa964('0x8')];var logger=require(_0xa964('0x9'))(_0xa964('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xa964('0xb')][0x2]);var QUERY=process[_0xa964('0xb')][0x3];var PATH=process[_0xa964('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x41dda6,_0x4bf9fd){var _0x37ce3e={'status':_0x41dda6};var _0x3eae36={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4bf9fd){_0x37ce3e[_0xa964('0xc')]=_0x4bf9fd;}return db['AnalyticExtractedReport']['update'](_0x37ce3e,_0x3eae36);}function main(){var _0x6073b6=0x1388;var _0x3e7e5d;logger['info'](util['format'](_0xa964('0xd'),EXTRACTED_REPORT_ID,_0xa964('0xe')));return db['Setting'][_0xa964('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa964('0x10'),_0xa964('0x11')]})[_0xa964('0x12')](function(_0x228e7a){if(_0x228e7a){_0x3e7e5d=_0x228e7a;_0x6073b6=_0x3e7e5d[_0xa964('0x11')]||0x1388;}})[_0xa964('0x12')](function(){return dbH['sequelize'][_0xa964('0x13')](util['format'](_0xa964('0x14'),QUERY),{'type':dbH[_0xa964('0x15')][_0xa964('0x16')][_0xa964('0x17')]});})[_0xa964('0x12')](function(_0x4163eb){if(!_0x4163eb[0x0][_0xa964('0x18')]){return analyticExtractedReport(_0xa964('0x19'));}var _0x89a48f=[];var _0x248edd=0x0;if(_0x3e7e5d[_0xa964('0x10')]){if(_0x4163eb&&_0x4163eb['length']){var _0x3b0c60=_[_0xa964('0x1a')](_0x4163eb[0x0][_0xa964('0x18')]/_0x6073b6);var _0x58b250=Number['isInteger'](_0x4163eb[0x0]['num']/_0x6073b6)?_0x4163eb[0x0][_0xa964('0x18')]%_0x6073b6:0x0;_0x3b0c60['forEach'](function(_0x4b1204){if(_0x4b1204>0x0){_0x248edd+=_0x6073b6;}_0x89a48f['push'](dbH[_0xa964('0x15')][_0xa964('0x13')](util[_0xa964('0x1b')](_0xa964('0x1c'),QUERY,_0x6073b6,_0x248edd),{'type':dbH[_0xa964('0x15')]['QueryTypes'][_0xa964('0x17')]}));});if(_0x58b250>0x0){_0x248edd+=_0x6073b6;_0x89a48f[_0xa964('0x1d')](dbH[_0xa964('0x15')]['query'](util[_0xa964('0x1b')](_0xa964('0x1c'),QUERY,_0x58b250,_0x248edd),{'type':dbH[_0xa964('0x15')][_0xa964('0x16')][_0xa964('0x17')]}));}}}else{_0x89a48f[_0xa964('0x1d')](dbH[_0xa964('0x15')][_0xa964('0x13')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0xa964('0x17')]}));}var _0x294bba=path[_0xa964('0x1e')](PATH);var _0x3e7ccc=path[_0xa964('0x1f')](PATH,_0xa964('0x20'));var _0x5c50dd=_0x3e7e5d['split']&&_0x89a48f[_0xa964('0x21')]>0x1;var _0x3fe27c=[];if(!fs[_0xa964('0x22')](path[_0xa964('0x23')](_0x294bba,_0x3e7ccc))&&_0x5c50dd){fs[_0xa964('0x24')](path[_0xa964('0x23')](_0x294bba,_0x3e7ccc));}return BPromise[_0xa964('0x25')](_0x89a48f,function(_0x159514){_0x3fe27c[_0xa964('0x1d')](_0x159514);})[_0xa964('0x12')](function(){for(var _0x50d23e=0x0;_0x50d23e<_0x3fe27c[_0xa964('0x21')];_0x50d23e+=0x1){var _0x5a2329;var _0x4d62c7=_0x3fe27c[_0x50d23e];if(_0x5c50dd){_0x5a2329=path[_0xa964('0x23')](_0x294bba,_0x3e7ccc,util[_0xa964('0x1b')]('%s%d.%s',_0x3e7ccc,_0x50d23e,'xlsx'));}else{_0x5a2329=path[_0xa964('0x23')](_0x294bba,util['format'](_0xa964('0x26'),_0x3e7ccc,'xlsx'));}fs['writeFileSync'](_0x5a2329,json2xls(_0x4d62c7),_0xa964('0x27'));}})['then'](function(){if(_0x5c50dd){return new Promise(function(_0x5e082a){zipdir(path['join'](_0x294bba,_0x3e7ccc),{'saveTo':path[_0xa964('0x23')](_0x294bba,util[_0xa964('0x1b')](_0xa964('0x26'),_0x3e7ccc,_0xa964('0x28')))},function(_0x1f0afd,_0x1efc31){rimraf(path[_0xa964('0x23')](_0x294bba,_0x3e7ccc),function(){});_0x5e082a('zip\x20finished');});});}})['then'](function(){logger['info'](util[_0xa964('0x1b')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0xa964('0x29'),_0x5c50dd?util[_0xa964('0x1b')]('%s.%s',_0x3e7ccc,_0x5c50dd?'zip':_0xa964('0x2a')):null);});})['catch'](function(_0x3737df){logger['info'](util[_0xa964('0x1b')](_0xa964('0x2b'),EXTRACTED_REPORT_ID,'XLSX'),util[_0xa964('0x2c')](_0x3737df,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa964('0x2d'));})[_0xa964('0x2e')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index adea8e2..d2517f4 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 _0x5e3f=['rewrite','lodash','findAll','then','intervals','models','VoiceExtension','uniq','exten','filter','queue','playback','hasOwnProperty','priority','extensions','extension','find','type','format','push','Set','context','VoiceExtensionId','outbound','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','interval','*,*,*,*','IntervalId','map','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','catch','error'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x5e3f,0x14b));var _0xf5e3=function(_0x519915,_0x537802){_0x519915=_0x519915-0x0;var _0x479c82=_0x5e3f[_0x519915];return _0x479c82;};'use strict';var _=require(_0xf5e3('0x0'));var util=require('util');function rewrite(_0x20474c,_0x3fdcc2){var _0x56dd66=this;return _0x20474c['models']['Interval'][_0xf5e3('0x1')]({'raw':!![]})[_0xf5e3('0x2')](function(_0x448350){_0x56dd66[_0xf5e3('0x3')]=_0x448350;return _0x20474c[_0xf5e3('0x4')][_0xf5e3('0x5')][_0xf5e3('0x1')]({'where':{'IntervalId':_0x3fdcc2['IntervalId']},'raw':!![]});})[_0xf5e3('0x2')](function(_0x3f2235){return _0x20474c[_0xf5e3('0x4')][_0xf5e3('0x5')][_0xf5e3('0x1')]({'where':{'exten':{'$in':_[_0xf5e3('0x6')](_['map'](_0x3f2235,_0xf5e3('0x7')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xf5e3('0x2')](function(_0x4c2bdb){var _0x4e36ff=_[_0xf5e3('0x8')](_0x4c2bdb,{'priority':'1'});var _0xaaf7e=_[_0xf5e3('0x8')](_0x4c2bdb,{'isApp':0x1});var _0x4fb0f4=_['groupBy'](_0xaaf7e,_0xf5e3('0x7'));var _0xaebf0c=[_0xf5e3('0x9'),_0xf5e3('0xa')];var _0x2f8d51=[];var _0x57c445=[];for(var _0x2ec4a1 in _0x4fb0f4){if(_0x4fb0f4[_0xf5e3('0xb')](_0x2ec4a1)){_0x56dd66[_0xf5e3('0xc')]=0x2;_0x56dd66[_0xf5e3('0xd')]=[];_0x56dd66[_0xf5e3('0xe')]=_[_0xf5e3('0xf')](_0x4e36ff,{'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')]});_0x56dd66['extensions']['push']({'type':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')],'app':'Set','appdata':util[_0xf5e3('0x11')]('CDR(type)=%s',_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')]),'context':_0x4fb0f4[_0x2ec4a1][0x0]['context'],'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'priority':_0x56dd66[_0xf5e3('0xc')]++,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0]['VoiceExtensionId']});if(_0x4fb0f4[_0x2ec4a1][0x0]['type']==='inbound'){_0x56dd66[_0xf5e3('0xd')][_0xf5e3('0x12')]({'type':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')],'app':_0xf5e3('0x13'),'appdata':'CDR(routeid)='+_0x4fb0f4[_0x2ec4a1][0x0]['VoiceExtensionId'],'context':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x14')],'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'priority':_0x56dd66[_0xf5e3('0xc')]++,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]});}else if(_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')]===_0xf5e3('0x16')){if(_0x56dd66[_0xf5e3('0xe')]){_0x56dd66['extensions'][_0xf5e3('0x12')]({'type':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')],'app':_0xf5e3('0x13'),'appdata':'CDR(destination)='+(_0x56dd66[_0xf5e3('0xe')]['cutdigits']?'${EXTEN:'+_0x56dd66['extension'][_0xf5e3('0x17')]+'}':_0xf5e3('0x18')),'context':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x14')],'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'priority':_0x56dd66[_0xf5e3('0xc')]++,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]});}_0x56dd66[_0xf5e3('0xd')][_0xf5e3('0x12')]({'type':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')],'app':_0xf5e3('0x13'),'appdata':_0xf5e3('0x19')+_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')],'context':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x14')],'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'priority':_0x56dd66[_0xf5e3('0xc')]++,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]});var _0x58d282=_0x56dd66[_0xf5e3('0xc')]++;_0x56dd66[_0xf5e3('0xd')][_0xf5e3('0x12')]({'type':_0x4fb0f4[_0x2ec4a1][0x0]['type'],'app':_0xf5e3('0x1a'),'appdata':_0xf5e3('0x1b')+(_0x58d282+0x2)+_0xf5e3('0x1c')+(_0x58d282+0x1)+')','context':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x14')],'exten':_0x4fb0f4[_0x2ec4a1][0x0]['exten'],'priority':_0x58d282,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]});if(_0x56dd66[_0xf5e3('0xe')]){_0x56dd66['extensions'][_0xf5e3('0x12')]({'type':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')],'app':_0xf5e3('0x13'),'appdata':_0x56dd66[_0xf5e3('0xe')][_0xf5e3('0x17')]?'CDR(prefix)=${EXTEN:0:'+_0x56dd66[_0xf5e3('0xe')][_0xf5e3('0x17')]+'}':_0xf5e3('0x1d'),'context':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x14')],'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'priority':_0x56dd66['priority']++,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0]['VoiceExtensionId']});}_0x56dd66['extensions']['push']({'type':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')],'app':_0xf5e3('0x13'),'appdata':'outboundrouteid='+_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')],'context':_0x4fb0f4[_0x2ec4a1][0x0]['context'],'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'priority':_0x56dd66['priority']++,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]});if(_0x56dd66[_0xf5e3('0xe')]&&_0x56dd66[_0xf5e3('0xe')][_0xf5e3('0xb')](_0xf5e3('0x1e'))&&_0x56dd66[_0xf5e3('0xe')]['recordingFormat']!==_0xf5e3('0x1f')){_0x56dd66[_0xf5e3('0xd')][_0xf5e3('0x12')]({'type':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x14')],'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'priority':_0x56dd66[_0xf5e3('0xc')]++,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]});_0x56dd66[_0xf5e3('0xd')][_0xf5e3('0x12')]({'type':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')],'app':_0xf5e3('0x13'),'appdata':_0xf5e3('0x20')+_0x56dd66['extension']['recordingFormat']||_0xf5e3('0x21'),'context':_0x4fb0f4[_0x2ec4a1][0x0]['context'],'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'priority':_0x56dd66['priority']++,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]});}}_0x56dd66['extensions'][_0xf5e3('0x12')]({'type':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')],'app':_0xf5e3('0x13'),'appdata':_0xf5e3('0x22'),'context':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x14')],'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'priority':_0x56dd66['priority']++,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]});_0x56dd66[_0xf5e3('0xd')]['push']({'type':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')],'app':_0xf5e3('0x13'),'appdata':_0xf5e3('0x23'),'context':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x14')],'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'priority':_0x56dd66['priority']++,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]});_0x56dd66['extensions'][_0xf5e3('0x12')]({'type':_0x4fb0f4[_0x2ec4a1][0x0]['type'],'app':'Set','appdata':_0xf5e3('0x24'),'context':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x14')],'exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'priority':_0x56dd66['priority']++,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0]['VoiceExtensionId']});for(var _0x3a0691=0x0,_0x420c81=0x0;_0x3a0691<_0x4fb0f4[_0x2ec4a1][_0xf5e3('0x25')];_0x3a0691+=0x1,_0x420c81=0x0){var _0x879087=_0x4fb0f4[_0x2ec4a1][_0x3a0691];if(_0x879087[_0xf5e3('0x10')]){_0x879087[_0xf5e3('0x10')]=_0x879087[_0xf5e3('0x10')][_0xf5e3('0x26')]();}var _0x42d93d=[];var _0xbcb20c=[];delete _0x879087['id'];delete _0x879087[_0xf5e3('0x27')];delete _0x879087['updatedAt'];var _0x141119=_0x879087[_0xf5e3('0x28')]!==_0xf5e3('0x29')?[_0x879087[_0xf5e3('0x28')]]:_0x879087[_0xf5e3('0x2a')]?_[_0xf5e3('0x2b')](_[_0xf5e3('0x8')](_0x56dd66[_0xf5e3('0x3')],{'IntervalId':_0x879087[_0xf5e3('0x2a')]}),_0xf5e3('0x28')):[];if(_0x879087['hasOwnProperty']('tag')){if(_0x879087[_0xf5e3('0x2c')]&&_0x879087[_0xf5e3('0x2c')]!=='--'){_0x42d93d[_0xf5e3('0x12')]({'type':_0x879087[_0xf5e3('0x10')],'app':_0xf5e3('0x13'),'appdata':'CDR(tag)='+_0x879087[_0xf5e3('0x2c')],'context':_0x879087['context'],'exten':_0x879087[_0xf5e3('0x7')],'priority':_0x141119[_0xf5e3('0x25')]+_0x56dd66[_0xf5e3('0xc')]+_0x420c81++,'VoiceExtensionId':_0x879087['VoiceExtensionId']});}}if(_0x879087['type']===_0xf5e3('0x16')&&_0x879087[_0xf5e3('0xb')](_0xf5e3('0x2d'))){if(_0x879087[_0xf5e3('0x2d')]){_0x42d93d[_0xf5e3('0x12')]({'type':_0x879087[_0xf5e3('0x10')],'app':_0xf5e3('0x1a'),'appdata':_0xf5e3('0x2e')+_0x879087[_0xf5e3('0x2d')]+')','context':_0x879087[_0xf5e3('0x14')],'exten':_0x879087[_0xf5e3('0x7')],'priority':_0x141119[_0xf5e3('0x25')]+_0x56dd66[_0xf5e3('0xc')]+_0x420c81++,'VoiceExtensionId':_0x879087[_0xf5e3('0x15')]});}else{_0x42d93d['push']({'type':_0x879087[_0xf5e3('0x10')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x879087[_0xf5e3('0x14')],'exten':_0x879087[_0xf5e3('0x7')],'priority':_0x141119[_0xf5e3('0x25')]+_0x56dd66[_0xf5e3('0xc')]+_0x420c81++,'VoiceExtensionId':_0x879087[_0xf5e3('0x15')]});}}if(_0x879087[_0xf5e3('0xb')](_0xf5e3('0x2f'))){if(_0xaebf0c[_0xf5e3('0x30')](_0x879087[_0xf5e3('0x31')][_0xf5e3('0x26')]())>=0x0&&_0x879087[_0xf5e3('0x32')]!==_0xf5e3('0x33')){if(_0x879087[_0xf5e3('0x2f')]){_0x42d93d[_0xf5e3('0x12')]({'type':_0x879087[_0xf5e3('0x10')],'app':_0xf5e3('0x1a'),'appdata':_0xf5e3('0x34'),'context':_0x879087[_0xf5e3('0x14')],'exten':_0x879087[_0xf5e3('0x7')],'priority':_0x141119[_0xf5e3('0x25')]+_0x56dd66[_0xf5e3('0xc')]+_0x420c81++,'VoiceExtensionId':_0x879087[_0xf5e3('0x15')]});_0x42d93d[_0xf5e3('0x12')]({'type':_0x879087[_0xf5e3('0x10')],'app':'Set','appdata':_0xf5e3('0x35'),'context':_0x879087[_0xf5e3('0x14')],'exten':_0x879087[_0xf5e3('0x7')],'priority':_0x141119['length']+_0x56dd66['priority']+_0x420c81++,'VoiceExtensionId':_0x879087['VoiceExtensionId']});}else{_0x42d93d[_0xf5e3('0x12')]({'type':_0x879087['type'],'app':_0xf5e3('0x1a'),'appdata':_0xf5e3('0x36'),'context':_0x879087[_0xf5e3('0x14')],'exten':_0x879087[_0xf5e3('0x7')],'priority':_0x141119[_0xf5e3('0x25')]+_0x56dd66[_0xf5e3('0xc')]+_0x420c81++,'VoiceExtensionId':_0x879087[_0xf5e3('0x15')]});_0x42d93d[_0xf5e3('0x12')]({'type':_0x879087[_0xf5e3('0x10')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x879087[_0xf5e3('0x14')],'exten':_0x879087['exten'],'priority':_0x141119[_0xf5e3('0x25')]+_0x56dd66[_0xf5e3('0xc')]+_0x420c81++,'VoiceExtensionId':_0x879087[_0xf5e3('0x15')]});}}}for(var _0x530522=0x0;_0x530522<_0x141119[_0xf5e3('0x25')];_0x530522+=0x1){var _0x1851ce=_0x56dd66[_0xf5e3('0xc')]+_0x141119['length'];var _0x31c6d2=_0x530522===_0x141119['length']-0x1?_0x56dd66[_0xf5e3('0xc')]+_0x42d93d['length']+_0xbcb20c[_0xf5e3('0x25')]+0x2:_0x56dd66[_0xf5e3('0xc')]+_0x530522+0x1;_0x42d93d[_0xf5e3('0x37')](_0x530522,0x0,{'type':_0x879087[_0xf5e3('0x10')],'app':'GotoIfTime','appdata':_0x141119[_0x530522]+'?'+_0x879087[_0xf5e3('0x14')]+_0xf5e3('0x38')+_0x1851ce+':'+_0x879087[_0xf5e3('0x14')]+_0xf5e3('0x38')+_0x31c6d2,'exten':_0x879087['exten'],'context':_0x879087[_0xf5e3('0x14')],'priority':_0x56dd66[_0xf5e3('0xc')]+_0x530522,'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]});}_0x879087['priority']=_0x42d93d[_0xf5e3('0x25')]?_[_0xf5e3('0x39')](_0x42d93d)['priority']+0x1:_0x56dd66[_0xf5e3('0xc')];_0x56dd66[_0xf5e3('0xc')]=(_0xbcb20c[_0xf5e3('0x25')]?_[_0xf5e3('0x39')](_0xbcb20c)[_0xf5e3('0xc')]:_0x879087[_0xf5e3('0xc')])+0x1;_0x56dd66[_0xf5e3('0xd')]=_[_0xf5e3('0x3a')](_0x56dd66[_0xf5e3('0xd')],_0x42d93d,[_0x879087],_0xbcb20c);}_0x56dd66[_0xf5e3('0xd')][_0xf5e3('0x12')]({'type':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x10')],'app':'Hangup','exten':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x7')],'context':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x14')],'priority':_0x56dd66[_0xf5e3('0xc')],'VoiceExtensionId':_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]});_0x2f8d51[_0xf5e3('0x12')](_0x4fb0f4[_0x2ec4a1][0x0][_0xf5e3('0x15')]);_0x57c445=_['concat'](_0x57c445,_0x56dd66[_0xf5e3('0xd')]);}}return _0x20474c[_0xf5e3('0x3b')](function(_0x3cf528){return _0x20474c['models']['VoiceExtension'][_0xf5e3('0x3c')]({'where':{'VoiceExtensionId':{'$in':_0x2f8d51}},'transaction':_0x3cf528})[_0xf5e3('0x2')](function(_0x11617d){return _0x20474c[_0xf5e3('0x4')]['VoiceExtension'][_0xf5e3('0x3d')](_[_0xf5e3('0x3e')](_0x57c445,_0xf5e3('0xc')),{'transaction':_0x3cf528});});});})[_0xf5e3('0x3f')](function(_0x143c5b){console[_0xf5e3('0x40')](_0x143c5b);});}exports[_0xf5e3('0x41')]=rewrite; \ No newline at end of file +var _0x6574=['answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','models','findAll','then','intervals','VoiceExtension','IntervalId','uniq','CAST(priority\x20AS\x20UNSIGNED)','filter','exten','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set','CDR(type)=%s','context','VoiceExtensionId','inbound','outbound','CDR(destination)=','${EXTEN:','cutdigits','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','interval','*,*,*,*','map','tag','length','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='];(function(_0x57fb3c,_0x6045f5){var _0x1a9344=function(_0x462e60){while(--_0x462e60){_0x57fb3c['push'](_0x57fb3c['shift']());}};_0x1a9344(++_0x6045f5);}(_0x6574,0xd9));var _0x4657=function(_0x553066,_0x1eeb56){_0x553066=_0x553066-0x0;var _0x3fd419=_0x6574[_0x553066];return _0x3fd419;};'use strict';var _=require(_0x4657('0x0'));var util=require('util');function rewrite(_0x5299cf,_0x5d46ab){var _0x4eedf3=this;return _0x5299cf[_0x4657('0x1')]['Interval'][_0x4657('0x2')]({'raw':!![]})[_0x4657('0x3')](function(_0x298837){_0x4eedf3[_0x4657('0x4')]=_0x298837;return _0x5299cf['models'][_0x4657('0x5')][_0x4657('0x2')]({'where':{'IntervalId':_0x5d46ab[_0x4657('0x6')]},'raw':!![]});})[_0x4657('0x3')](function(_0x35082d){return _0x5299cf[_0x4657('0x1')][_0x4657('0x5')][_0x4657('0x2')]({'where':{'exten':{'$in':_[_0x4657('0x7')](_['map'](_0x35082d,'exten'))}},'order':[{'raw':_0x4657('0x8')}],'raw':!![]});})[_0x4657('0x3')](function(_0x50d39d){var _0x41d05a=_[_0x4657('0x9')](_0x50d39d,{'priority':'1'});var _0x5eb37b=_[_0x4657('0x9')](_0x50d39d,{'isApp':0x1});var _0xcbbc8f=_['groupBy'](_0x5eb37b,_0x4657('0xa'));var _0x589119=[_0x4657('0xb'),_0x4657('0xc')];var _0x191cff=[];var _0x29aeb7=[];for(var _0x35b2ea in _0xcbbc8f){if(_0xcbbc8f[_0x4657('0xd')](_0x35b2ea)){_0x4eedf3[_0x4657('0xe')]=0x2;_0x4eedf3[_0x4657('0xf')]=[];_0x4eedf3[_0x4657('0x10')]=_[_0x4657('0x11')](_0x41d05a,{'exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')]});_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x13')],'app':_0x4657('0x14'),'appdata':util['format'](_0x4657('0x15'),_0xcbbc8f[_0x35b2ea][0x0]['type']),'context':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x16')],'exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')],'priority':_0x4eedf3[_0x4657('0xe')]++,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});if(_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x13')]===_0x4657('0x18')){_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x13')],'app':'Set','appdata':'CDR(routeid)='+_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')],'context':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x16')],'exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')],'priority':_0x4eedf3['priority']++,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});}else if(_0xcbbc8f[_0x35b2ea][0x0]['type']===_0x4657('0x19')){if(_0x4eedf3[_0x4657('0x10')]){_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0]['type'],'app':_0x4657('0x14'),'appdata':_0x4657('0x1a')+(_0x4eedf3['extension']['cutdigits']?_0x4657('0x1b')+_0x4eedf3[_0x4657('0x10')][_0x4657('0x1c')]+'}':'${EXTEN}'),'context':_0xcbbc8f[_0x35b2ea][0x0]['context'],'exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')],'priority':_0x4eedf3[_0x4657('0xe')]++,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});}_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0]['type'],'app':_0x4657('0x14'),'appdata':'CDR(routeid)='+_0xcbbc8f[_0x35b2ea][0x0]['VoiceExtensionId'],'context':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x16')],'exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')],'priority':_0x4eedf3[_0x4657('0xe')]++,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0]['VoiceExtensionId']});var _0x3e710f=_0x4eedf3['priority']++;_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x13')],'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x3e710f+0x2)+'):Goto('+(_0x3e710f+0x1)+')','context':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x16')],'exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')],'priority':_0x3e710f,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});if(_0x4eedf3[_0x4657('0x10')]){_0x4eedf3['extensions'][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x13')],'app':'Set','appdata':_0x4eedf3[_0x4657('0x10')][_0x4657('0x1c')]?_0x4657('0x1d')+_0x4eedf3[_0x4657('0x10')]['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x16')],'exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')],'priority':_0x4eedf3['priority']++,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});}_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x13')],'app':'Set','appdata':_0x4657('0x1e')+_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')],'context':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x16')],'exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')],'priority':_0x4eedf3[_0x4657('0xe')]++,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});if(_0x4eedf3['extension']&&_0x4eedf3[_0x4657('0x10')]['hasOwnProperty']('recordingFormat')&&_0x4eedf3[_0x4657('0x10')][_0x4657('0x1f')]!=='none'){_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x13')],'app':_0x4657('0x14'),'appdata':_0x4657('0x20'),'context':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x16')],'exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')],'priority':_0x4eedf3[_0x4657('0xe')]++,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x13')],'app':_0x4657('0x14'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x4eedf3[_0x4657('0x10')][_0x4657('0x1f')]||_0x4657('0x21'),'context':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x16')],'exten':_0xcbbc8f[_0x35b2ea][0x0]['exten'],'priority':_0x4eedf3[_0x4657('0xe')]++,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});}}_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0]['type'],'app':_0x4657('0x14'),'appdata':_0x4657('0x22'),'context':_0xcbbc8f[_0x35b2ea][0x0]['context'],'exten':_0xcbbc8f[_0x35b2ea][0x0]['exten'],'priority':_0x4eedf3[_0x4657('0xe')]++,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x13')],'app':'Set','appdata':_0x4657('0x23'),'context':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x16')],'exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')],'priority':_0x4eedf3['priority']++,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x13')],'app':_0x4657('0x14'),'appdata':_0x4657('0x24'),'context':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x16')],'exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')],'priority':_0x4eedf3[_0x4657('0xe')]++,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});for(var _0x5df576=0x0,_0x308287=0x0;_0x5df576<_0xcbbc8f[_0x35b2ea]['length'];_0x5df576+=0x1,_0x308287=0x0){var _0xfa8853=_0xcbbc8f[_0x35b2ea][_0x5df576];if(_0xfa8853[_0x4657('0x13')]){_0xfa8853[_0x4657('0x13')]=_0xfa8853[_0x4657('0x13')][_0x4657('0x25')]();}var _0x1a98f1=[];var _0x2badd7=[];delete _0xfa8853['id'];delete _0xfa8853[_0x4657('0x26')];delete _0xfa8853['updatedAt'];var _0x5e6f19=_0xfa8853[_0x4657('0x27')]!==_0x4657('0x28')?[_0xfa8853[_0x4657('0x27')]]:_0xfa8853[_0x4657('0x6')]?_[_0x4657('0x29')](_[_0x4657('0x9')](_0x4eedf3[_0x4657('0x4')],{'IntervalId':_0xfa8853['IntervalId']}),_0x4657('0x27')):[];if(_0xfa8853['hasOwnProperty'](_0x4657('0x2a'))){if(_0xfa8853[_0x4657('0x2a')]&&_0xfa8853[_0x4657('0x2a')]!=='--'){_0x1a98f1[_0x4657('0x12')]({'type':_0xfa8853[_0x4657('0x13')],'app':'Set','appdata':'CDR(tag)='+_0xfa8853['tag'],'context':_0xfa8853[_0x4657('0x16')],'exten':_0xfa8853['exten'],'priority':_0x5e6f19[_0x4657('0x2b')]+_0x4eedf3['priority']+_0x308287++,'VoiceExtensionId':_0xfa8853[_0x4657('0x17')]});}}if(_0xfa8853['type']===_0x4657('0x19')&&_0xfa8853[_0x4657('0xd')](_0x4657('0x2c'))){if(_0xfa8853[_0x4657('0x2c')]){_0x1a98f1[_0x4657('0x12')]({'type':_0xfa8853[_0x4657('0x13')],'app':_0x4657('0x2d'),'appdata':_0x4657('0x2e')+_0xfa8853[_0x4657('0x2c')]+')','context':_0xfa8853['context'],'exten':_0xfa8853[_0x4657('0xa')],'priority':_0x5e6f19[_0x4657('0x2b')]+_0x4eedf3[_0x4657('0xe')]+_0x308287++,'VoiceExtensionId':_0xfa8853[_0x4657('0x17')]});}else{_0x1a98f1['push']({'type':_0xfa8853[_0x4657('0x13')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0xfa8853['context'],'exten':_0xfa8853[_0x4657('0xa')],'priority':_0x5e6f19[_0x4657('0x2b')]+_0x4eedf3[_0x4657('0xe')]+_0x308287++,'VoiceExtensionId':_0xfa8853[_0x4657('0x17')]});}}if(_0xfa8853['hasOwnProperty'](_0x4657('0x2f'))){if(_0x589119[_0x4657('0x30')](_0xfa8853[_0x4657('0x31')]['toLowerCase']())>=0x0&&_0xfa8853[_0x4657('0x32')]!==_0x4657('0x33')){if(_0xfa8853[_0x4657('0x2f')]){_0x1a98f1[_0x4657('0x12')]({'type':_0xfa8853[_0x4657('0x13')],'app':_0x4657('0x2d'),'appdata':_0x4657('0x34'),'context':_0xfa8853[_0x4657('0x16')],'exten':_0xfa8853[_0x4657('0xa')],'priority':_0x5e6f19[_0x4657('0x2b')]+_0x4eedf3[_0x4657('0xe')]+_0x308287++,'VoiceExtensionId':_0xfa8853[_0x4657('0x17')]});_0x1a98f1[_0x4657('0x12')]({'type':_0xfa8853[_0x4657('0x13')],'app':_0x4657('0x14'),'appdata':_0x4657('0x35'),'context':_0xfa8853[_0x4657('0x16')],'exten':_0xfa8853[_0x4657('0xa')],'priority':_0x5e6f19['length']+_0x4eedf3[_0x4657('0xe')]+_0x308287++,'VoiceExtensionId':_0xfa8853['VoiceExtensionId']});}else{_0x1a98f1[_0x4657('0x12')]({'type':_0xfa8853[_0x4657('0x13')],'app':_0x4657('0x2d'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0xfa8853[_0x4657('0x16')],'exten':_0xfa8853[_0x4657('0xa')],'priority':_0x5e6f19[_0x4657('0x2b')]+_0x4eedf3['priority']+_0x308287++,'VoiceExtensionId':_0xfa8853[_0x4657('0x17')]});_0x1a98f1[_0x4657('0x12')]({'type':_0xfa8853[_0x4657('0x13')],'app':_0x4657('0x14'),'appdata':_0x4657('0x36'),'context':_0xfa8853['context'],'exten':_0xfa8853['exten'],'priority':_0x5e6f19[_0x4657('0x2b')]+_0x4eedf3[_0x4657('0xe')]+_0x308287++,'VoiceExtensionId':_0xfa8853[_0x4657('0x17')]});}}}for(var _0x185d03=0x0;_0x185d03<_0x5e6f19[_0x4657('0x2b')];_0x185d03+=0x1){var _0x67f2ec=_0x4eedf3['priority']+_0x5e6f19[_0x4657('0x2b')];var _0x5ac42a=_0x185d03===_0x5e6f19[_0x4657('0x2b')]-0x1?_0x4eedf3[_0x4657('0xe')]+_0x1a98f1[_0x4657('0x2b')]+_0x2badd7['length']+0x2:_0x4eedf3['priority']+_0x185d03+0x1;_0x1a98f1[_0x4657('0x37')](_0x185d03,0x0,{'type':_0xfa8853[_0x4657('0x13')],'app':_0x4657('0x38'),'appdata':_0x5e6f19[_0x185d03]+'?'+_0xfa8853['context']+_0x4657('0x39')+_0x67f2ec+':'+_0xfa8853[_0x4657('0x16')]+_0x4657('0x39')+_0x5ac42a,'exten':_0xfa8853['exten'],'context':_0xfa8853[_0x4657('0x16')],'priority':_0x4eedf3[_0x4657('0xe')]+_0x185d03,'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});}_0xfa8853[_0x4657('0xe')]=_0x1a98f1[_0x4657('0x2b')]?_[_0x4657('0x3a')](_0x1a98f1)['priority']+0x1:_0x4eedf3['priority'];_0x4eedf3[_0x4657('0xe')]=(_0x2badd7[_0x4657('0x2b')]?_[_0x4657('0x3a')](_0x2badd7)['priority']:_0xfa8853[_0x4657('0xe')])+0x1;_0x4eedf3['extensions']=_[_0x4657('0x3b')](_0x4eedf3['extensions'],_0x1a98f1,[_0xfa8853],_0x2badd7);}_0x4eedf3[_0x4657('0xf')][_0x4657('0x12')]({'type':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x13')],'app':'Hangup','exten':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0xa')],'context':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x16')],'priority':_0x4eedf3[_0x4657('0xe')],'VoiceExtensionId':_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]});_0x191cff[_0x4657('0x12')](_0xcbbc8f[_0x35b2ea][0x0][_0x4657('0x17')]);_0x29aeb7=_[_0x4657('0x3b')](_0x29aeb7,_0x4eedf3['extensions']);}}return _0x5299cf['transaction'](function(_0x59f76f){return _0x5299cf[_0x4657('0x1')][_0x4657('0x5')][_0x4657('0x3c')]({'where':{'VoiceExtensionId':{'$in':_0x191cff}},'transaction':_0x59f76f})['then'](function(_0x573077){return _0x5299cf[_0x4657('0x1')]['VoiceExtension'][_0x4657('0x3d')](_[_0x4657('0x3e')](_0x29aeb7,_0x4657('0xe')),{'transaction':_0x59f76f});});});})[_0x4657('0x3f')](function(_0x22ba78){console[_0x4657('0x40')](_0x22ba78);});}exports[_0x4657('0x41')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 258e165..fec7923 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 _0xfd0c=['sequelize','VoiceQueueId','query','all','VoiceQueue','findAll','BlackLists','CampaignId','onlyIfOpen','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resolve','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','info','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','length','map','errors','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','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','find','duplicate','Duplicate\x20Contact','CmContact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','field','phone','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','select','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','outbound','dialCheckDuplicateType','CmList','Lists','get','always'];(function(_0x476464,_0x49d0ef){var _0x50e289=function(_0x443ef4){while(--_0x443ef4){_0x476464['push'](_0x476464['shift']());}};_0x50e289(++_0x49d0ef);}(_0xfd0c,0x1f3));var _0xcfd0=function(_0x25e109,_0x6ab24c){_0x25e109=_0x25e109-0x0;var _0xc0f7d6=_0xfd0c[_0x25e109];return _0xc0f7d6;};'use strict';var BPromise=require('bluebird');var util=require(_0xcfd0('0x0'));var _=require(_0xcfd0('0x1'));var fs=require('fs');var squel=require(_0xcfd0('0x2'));var Papa=require(_0xcfd0('0x3'));var Redis=require(_0xcfd0('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0xcfd0('0x5'));var logger=require(_0xcfd0('0x6'))(_0xcfd0('0x7'));config[_0xcfd0('0x8')]=_[_0xcfd0('0x9')](config[_0xcfd0('0x8')],{'host':_0xcfd0('0xa'),'port':0x18eb});var socket=require(_0xcfd0('0xb'))(new Redis(config['redis']));require(_0xcfd0('0xc'))['register'](socket);try{if(!process[_0xcfd0('0xd')][0x2]||process[_0xcfd0('0xd')][0x2]===_0xcfd0('0xe')||process[_0xcfd0('0xd')][0x2]==='null'){throw new Error(_0xcfd0('0xf'));}var FILEPATH=process[_0xcfd0('0xd')][0x2];if(!process['argv'][0x3]||process['argv'][0x3]===_0xcfd0('0xe')||process['argv'][0x3]==='null'||!process[_0xcfd0('0xd')][0x4]||process[_0xcfd0('0xd')][0x4]==='undefined'||process['argv'][0x4]===_0xcfd0('0x10')){throw new Error(_0xcfd0('0x11'));}var FIELDS=_[_0xcfd0('0x12')](process[_0xcfd0('0xd')][0x3][_0xcfd0('0x13')](','),process[_0xcfd0('0xd')][0x4][_0xcfd0('0x13')](','));if(!process[_0xcfd0('0xd')][0x5]||process[_0xcfd0('0xd')][0x5]===_0xcfd0('0xe')||process[_0xcfd0('0xd')][0x5]===_0xcfd0('0x10')){throw new Error(_0xcfd0('0x14'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0xcfd0('0xd')][0x6]&&process['argv'][0x6]!=='undefined'&&process[_0xcfd0('0xd')][0x6]!==_0xcfd0('0x10')?process[_0xcfd0('0xd')][0x6]:null;var DUPLICATES=process[_0xcfd0('0xd')][0x7]&&process['argv'][0x7]!==_0xcfd0('0xe')&&process[_0xcfd0('0xd')][0x7]!==_0xcfd0('0x10')?process[_0xcfd0('0xd')][0x7]:null;if(!process[_0xcfd0('0xd')][0x8]||process[_0xcfd0('0xd')][0x8]===_0xcfd0('0xe')||process['argv'][0x8]===_0xcfd0('0x10')){throw new Error(_0xcfd0('0x15'));}var SOCKET_TIMESTAMP=process[_0xcfd0('0xd')][0x8];}catch(_0x59ff3a){logger[_0xcfd0('0x16')](_0x59ff3a);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(_0x80628,_0xb36726,_0x7e994e,_0x3e2aa9){var _0x2db72e={'message':_0xb36726};_0x2db72e[_0x80628]=!![];if(_0x7e994e){_0x2db72e[_0xcfd0('0x17')]=_0x7e994e;}if(_0x3e2aa9){_0x2db72e[_0xcfd0('0x18')]=_0x3e2aa9;}return _0x2db72e;}function isEmail(_0x253682){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))*$/[_0xcfd0('0x19')](_0x253682);}function checkRow(_0x24d718,_0x5bc7a1,_0x564e08){return new BPromise(function(_0x43c8ae,_0x3db20f){if(_[_0xcfd0('0x1a')](_0x24d718)){return _0x3db20f(handleCheckRowError('error',_0xcfd0('0x1b'),null,_0x564e08));}if(_0x24d718['errors']&&_0x24d718['errors'][_0xcfd0('0x1c')]){var _0x16bd58=_[_0xcfd0('0x1d')](_0x24d718[_0xcfd0('0x1e')],_0xcfd0('0x1f'))[_0xcfd0('0x20')](';');return _0x3db20f(handleCheckRowError('error',_0x16bd58,null,_0x564e08));}var _0x23ede4={};for(var _0x2431a6 in FIELDS){if(FIELDS[_0xcfd0('0x21')](_0x2431a6)&&FIELDS[_0x2431a6]){_0x23ede4[_0x2431a6]=_0x24d718[_0xcfd0('0x22')][0x0][FIELDS[_0x2431a6]]||_0x24d718[_0xcfd0('0x22')][0x0]['\ufeff'+FIELDS[_0x2431a6]];}}if(!_0x23ede4[_0xcfd0('0x23')]){return _0x3db20f(handleCheckRowError(_0xcfd0('0x16'),_0xcfd0('0x24'),null,_0x564e08));}if(!_0x23ede4['phone']){return _0x3db20f(handleCheckRowError(_0xcfd0('0x16'),_0xcfd0('0x25'),null,_0x564e08));}if(_0x23ede4[_0xcfd0('0x26')]){var _0x3850a5=moment(_0x23ede4[_0xcfd0('0x26')],_0xcfd0('0x27'));if(!_0x3850a5[_0xcfd0('0x28')]()){return _0x3db20f(handleCheckRowError(_0xcfd0('0x16'),_0xcfd0('0x29'),null,_0x564e08));}}if(_0x23ede4[_0xcfd0('0x2a')]){if(!isEmail(_0x23ede4[_0xcfd0('0x2a')])){return _0x3db20f(handleCheckRowError(_0xcfd0('0x16'),_0xcfd0('0x2b'),null,_0x564e08));}}_0x23ede4[_0xcfd0('0x2c')]=LISTID;_0x23ede4['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xcfd0('0x1c')]&&_0x5bc7a1){var _0x305db9={};for(var _0x146f83=0x0,_0x5c39b5=DUPLICATES['length'];_0x146f83<_0x5c39b5;_0x146f83+=0x1){_0x305db9[DUPLICATES[_0x146f83]]=_0x23ede4[DUPLICATES[_0x146f83]];}var _0x3ebe78=_[_0xcfd0('0x2d')](_0x5bc7a1,_0x305db9);if(_0x3ebe78){return _0x3db20f(handleCheckRowError(_0xcfd0('0x2e'),_0xcfd0('0x2f'),_0x3ebe78,_0x564e08));}}return db[_0xcfd0('0x30')][_0xcfd0('0x31')](_0x23ede4,{'raw':!![],'hooks':![],'fields':_['keys'](_0x23ede4)})[_0xcfd0('0x32')](function(_0x5b0cce){if(DUPLICATES&&DUPLICATES[_0xcfd0('0x1c')]&&_0x5bc7a1){_0x5bc7a1[_0xcfd0('0x33')](_[_0xcfd0('0x34')](_0x23ede4,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5b0cce['id'];return _0x43c8ae();})[_0xcfd0('0x35')](function(_0x264eba){return _0x3db20f(handleCheckRowError(_0xcfd0('0x16'),_0xcfd0('0x36')+(_0x264eba[_0xcfd0('0x1f')]||JSON[_0xcfd0('0x37')](_0x264eba)),null,_0x564e08));});});}function checkHopper(){function _0xad517c(){return function(_0x2f82f8){logger['error'](_0xcfd0('0x38'),_0xcfd0('0x39'),util[_0xcfd0('0x3a')](_0x2f82f8,{'showHidden':![],'depth':null}));};}var _0x459726=function(_0x14aea6,_0x54d182){var _0x9d7100=squel[_0xcfd0('0x3b')]()[_0xcfd0('0x3c')](_0xcfd0('0x3d'))[_0xcfd0('0x3e')](['phone',_0xcfd0('0x3f'),_0xcfd0('0x40'),'ListId',_0x54d182,_0xcfd0('0x41'),_0xcfd0('0x42')],squel['select']()[_0xcfd0('0x43')](_0xcfd0('0x44'),'phone')[_0xcfd0('0x43')](_0xcfd0('0x45'),_0xcfd0('0x3f'))[_0xcfd0('0x43')]('id',_0xcfd0('0x40'))['field'](LISTID['toString'](),'ListId')[_0xcfd0('0x43')](_0x14aea6['id'][_0xcfd0('0x46')](),_0x54d182)[_0xcfd0('0x43')]('NOW()',_0xcfd0('0x41'))[_0xcfd0('0x43')](_0xcfd0('0x45'),_0xcfd0('0x42'))[_0xcfd0('0x47')](_0xcfd0('0x48'))['where'](_0xcfd0('0x49'))['where'](_0xcfd0('0x4a'),LISTID[_0xcfd0('0x46')]())[_0xcfd0('0x4b')](_0xcfd0('0x4c'))[_0xcfd0('0x4b')](_0xcfd0('0x4d'),squel['select']()[_0xcfd0('0x43')](_0xcfd0('0x44'))[_0xcfd0('0x47')](_0xcfd0('0x3d'))[_0xcfd0('0x4b')](_0x54d182+_0xcfd0('0x4e'),_0x14aea6['id'][_0xcfd0('0x46')]())))[_0xcfd0('0x46')]();return _0x9d7100;};var _0x16c117=function(_0x47bb53,_0xcb1234){var _0x22bb02=squel[_0xcfd0('0x3b')]()[_0xcfd0('0x3c')](_0xcfd0('0x3d'))[_0xcfd0('0x3e')](['phone',_0xcfd0('0x3f'),_0xcfd0('0x40'),'ListId',_0xcb1234,_0xcfd0('0x41'),_0xcfd0('0x42')],squel[_0xcfd0('0x4f')]()[_0xcfd0('0x43')](_0xcfd0('0x44'),_0xcfd0('0x44'))[_0xcfd0('0x43')](_0xcfd0('0x45'),_0xcfd0('0x3f'))[_0xcfd0('0x43')]('id','ContactId')[_0xcfd0('0x43')](LISTID[_0xcfd0('0x46')](),_0xcfd0('0x2c'))[_0xcfd0('0x43')](_0x47bb53['id'][_0xcfd0('0x46')](),_0xcb1234)[_0xcfd0('0x43')](_0xcfd0('0x45'),_0xcfd0('0x41'))[_0xcfd0('0x43')](_0xcfd0('0x45'),_0xcfd0('0x42'))[_0xcfd0('0x47')](_0xcfd0('0x48'))[_0xcfd0('0x4b')](_0xcfd0('0x49'))[_0xcfd0('0x4b')](_0xcfd0('0x4a'),LISTID[_0xcfd0('0x46')]())[_0xcfd0('0x4b')](_0xcfd0('0x50'),squel[_0xcfd0('0x51')](hopperContacts))[_0xcfd0('0x4b')]('phone\x20IS\x20NOT\x20NULL')[_0xcfd0('0x4b')](_0xcfd0('0x4d'),squel[_0xcfd0('0x4f')]()[_0xcfd0('0x43')](_0xcfd0('0x52'))[_0xcfd0('0x47')](_0xcfd0('0x53'))['where'](_0xcb1234+'\x20=\x20?',_0x47bb53['id'][_0xcfd0('0x46')]()))[_0xcfd0('0x4b')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xcfd0('0x43')]('phone')[_0xcfd0('0x47')](_0xcfd0('0x3d'))[_0xcfd0('0x4b')](_0xcb1234+_0xcfd0('0x4e'),_0x47bb53['id'][_0xcfd0('0x46')]())))['toString']();return _0x22bb02;};function _0x2b1e1b(_0x550c99,_0x32d6e5){var _0x3218ad=squel[_0xcfd0('0x3b')]()[_0xcfd0('0x3c')](_0xcfd0('0x3d'))[_0xcfd0('0x3e')]([_0xcfd0('0x44'),_0xcfd0('0x3f'),_0xcfd0('0x40'),_0xcfd0('0x2c'),_0x32d6e5,_0xcfd0('0x41'),'updatedAt'],squel['select']()[_0xcfd0('0x43')](_0xcfd0('0x44'),_0xcfd0('0x44'))['field'](_0xcfd0('0x45'),_0xcfd0('0x3f'))['field']('id',_0xcfd0('0x40'))[_0xcfd0('0x43')](LISTID['toString'](),_0xcfd0('0x2c'))[_0xcfd0('0x43')](_0x550c99['id']['toString'](),_0x32d6e5)['field']('NOW()','createdAt')[_0xcfd0('0x43')]('NOW()',_0xcfd0('0x42'))[_0xcfd0('0x47')](_0xcfd0('0x48'))['where']('deletedAt\x20IS\x20NULL')[_0xcfd0('0x4b')]('ListId\x20=\x20?',LISTID['toString']())[_0xcfd0('0x4b')](_0xcfd0('0x50'),squel[_0xcfd0('0x51')](hopperContacts))[_0xcfd0('0x4b')](_0xcfd0('0x4c')))[_0xcfd0('0x46')]();return _0x3218ad;}function _0x3ddb80(_0x2d37d0,_0x3aeaae){var _0x5c0410=squel[_0xcfd0('0x3b')]()['into'](_0xcfd0('0x54'))['fromQuery']([_0xcfd0('0x44'),_0xcfd0('0x40'),'ListId',_0x3aeaae,'createdAt',_0xcfd0('0x42')],squel[_0xcfd0('0x4f')]()['field'](_0xcfd0('0x44'),_0xcfd0('0x44'))[_0xcfd0('0x43')]('id',_0xcfd0('0x40'))[_0xcfd0('0x43')](LISTID[_0xcfd0('0x46')](),_0xcfd0('0x2c'))[_0xcfd0('0x43')](_0x2d37d0['id'][_0xcfd0('0x46')](),_0x3aeaae)['field']('NOW()',_0xcfd0('0x41'))['field']('NOW()','updatedAt')[_0xcfd0('0x47')]('cm_contacts')[_0xcfd0('0x4b')]('deletedAt\x20IS\x20NULL')[_0xcfd0('0x4b')](_0xcfd0('0x4a'),LISTID[_0xcfd0('0x46')]())[_0xcfd0('0x4b')](_0xcfd0('0x50'),squel[_0xcfd0('0x51')](hopperContacts))[_0xcfd0('0x4b')](_0xcfd0('0x4c')))[_0xcfd0('0x46')]();return _0x5c0410;}return db['VoiceQueue']['findAll']({'where':{'type':_0xcfd0('0x55')},'attributes':['id',_0xcfd0('0x56')],'include':[{'model':db[_0xcfd0('0x57')],'as':_0xcfd0('0x58'),'where':{'id':LISTID}}]})['then'](function(_0x42acf4){var _0x34e9ba=[];if(_0x42acf4){var _0x10e4b7;for(var _0x2612c2=0x0,_0x460456;_0x2612c2<_0x42acf4[_0xcfd0('0x1c')];_0x2612c2+=0x1){_0x460456=_0x42acf4[_0x2612c2][_0xcfd0('0x59')]({'plain':!![]});switch(_0x460456[_0xcfd0('0x56')]){case _0xcfd0('0x5a'):_0x34e9ba[_0xcfd0('0x33')](db[_0xcfd0('0x5b')]['query'](_0x16c117(_0x460456,_0xcfd0('0x5c')))[_0xcfd0('0x32')](function(){})[_0xcfd0('0x35')](_0xad517c()));break;case'onlyIfOpen':_0x34e9ba[_0xcfd0('0x33')](db[_0xcfd0('0x5b')][_0xcfd0('0x5d')](_0x459726(_0x460456,'VoiceQueueId'))[_0xcfd0('0x32')](function(){})[_0xcfd0('0x35')](_0xad517c()));break;default:_0x34e9ba[_0xcfd0('0x33')](db[_0xcfd0('0x5b')][_0xcfd0('0x5d')](_0x2b1e1b(_0x460456,'VoiceQueueId'))['then'](function(){})[_0xcfd0('0x35')](_0xad517c()));}}}return _0x34e9ba;})[_0xcfd0('0x5e')]()['then'](function(){return db[_0xcfd0('0x5f')][_0xcfd0('0x60')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xcfd0('0x57')],'as':_0xcfd0('0x61'),'where':{'id':LISTID}}]})[_0xcfd0('0x32')](function(_0x317ff5){var _0x5e1f8e=[];if(_0x317ff5){var _0x27caea;for(var _0x42f18c=0x0,_0x4bc423;_0x42f18c<_0x317ff5[_0xcfd0('0x1c')];_0x42f18c+=0x1){_0x4bc423=_0x317ff5[_0x42f18c][_0xcfd0('0x59')]({'plain':!![]});_0x5e1f8e[_0xcfd0('0x33')](db[_0xcfd0('0x5b')]['query'](_0x3ddb80(_0x4bc423,_0xcfd0('0x5c')))[_0xcfd0('0x32')](function(){})[_0xcfd0('0x35')](_0xad517c()));}}return _0x5e1f8e;})[_0xcfd0('0x5e')]();})['then'](function(){return db['Campaign'][_0xcfd0('0x60')]({'attributes':['id',_0xcfd0('0x56')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0xcfd0('0x32')](function(_0x33546b){var _0x46de80=[];if(_0x33546b){for(var _0x31e1f7=0x0,_0x489ce3;_0x31e1f7<_0x33546b[_0xcfd0('0x1c')];_0x31e1f7+=0x1){_0x489ce3=_0x33546b[_0x31e1f7][_0xcfd0('0x59')]({'plain':!![]});switch(_0x489ce3[_0xcfd0('0x56')]){case _0xcfd0('0x5a'):_0x46de80[_0xcfd0('0x33')](db[_0xcfd0('0x5b')][_0xcfd0('0x5d')](_0x16c117(_0x489ce3,_0xcfd0('0x62')))[_0xcfd0('0x32')](function(){})['catch'](_0xad517c()));break;case _0xcfd0('0x63'):_0x46de80['push'](db[_0xcfd0('0x5b')][_0xcfd0('0x5d')](_0x459726(_0x489ce3,_0xcfd0('0x62')))['then'](function(){})[_0xcfd0('0x35')](_0xad517c()));break;default:_0x46de80[_0xcfd0('0x33')](db[_0xcfd0('0x5b')][_0xcfd0('0x5d')](_0x2b1e1b(_0x489ce3,_0xcfd0('0x62')))[_0xcfd0('0x32')](function(){})[_0xcfd0('0x35')](_0xad517c()));}}}return _0x46de80;})[_0xcfd0('0x5e')]();})[_0xcfd0('0x32')](function(){return db[_0xcfd0('0x64')]['findAll']({'attributes':['id'],'include':[{'model':db[_0xcfd0('0x57')],'as':_0xcfd0('0x61'),'where':{'id':LISTID}}]})[_0xcfd0('0x32')](function(_0x3bed75){var _0xd7a72f=[];if(_0x3bed75){for(var _0x251de9=0x0,_0x503234;_0x251de9<_0x3bed75[_0xcfd0('0x1c')];_0x251de9+=0x1){_0x503234=_0x3bed75[_0x251de9]['get']({'plain':!![]});_0xd7a72f[_0xcfd0('0x33')](db[_0xcfd0('0x5b')][_0xcfd0('0x5d')](_0x3ddb80(_0x503234,_0xcfd0('0x62')))[_0xcfd0('0x32')](function(){})[_0xcfd0('0x35')](_0xad517c()));}}return _0xd7a72f;})[_0xcfd0('0x5e')]();})[_0xcfd0('0x35')](function(_0x503ae2){logger[_0xcfd0('0x16')](_0xcfd0('0x65'),_0xcfd0('0x66'),_0x503ae2[_0xcfd0('0x1f')]);});}var processPromises=function(_0x2515c8){return BPromise[_0xcfd0('0x5e')](promises)[_0xcfd0('0x32')](function(_0x100388){})['catch'](function(_0x431902){logger[_0xcfd0('0x16')](_0xcfd0('0x67'),JSON[_0xcfd0('0x37')](_0x431902));})[_0xcfd0('0x68')](function(){socket['emit'](_0xcfd0('0x69')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2515c8){return _0x2515c8['resume']();}});};var endCsv=function(){return BPromise[_0xcfd0('0x6a')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xcfd0('0x32')](function(){socket[_0xcfd0('0x6b')](_0xcfd0('0x69')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xcfd0('0x6c')](FILEPATH);}catch(_0x50f3cf){logger['error'](_0xcfd0('0x6d'),JSON[_0xcfd0('0x37')](_0x50f3cf));}finally{process['exit'](0x0);}});};process['on'](_0xcfd0('0x6e'),function(){logger['info'](_0xcfd0('0x6f'));endCsv();});function main(){return BPromise[_0xcfd0('0x6a')]()[_0xcfd0('0x32')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xcfd0('0x13')](',');return db['CmContact'][_0xcfd0('0x60')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xcfd0('0x32')](function(_0x412f61){var _0x463e09=fs[_0xcfd0('0x70')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xcfd0('0x71')](_0x463e09,{'header':!![],'skipEmptyLines':!![],'step':function(_0x58180a,_0x2f4f46){total+=0x1;var _0x5b381d=total;promises['push'](checkRow(_0x58180a,_0x412f61,_0x5b381d)['then'](function(){success+=0x1;})[_0xcfd0('0x35')](function(_0xfa9b7e){if(_0xfa9b7e[_0xcfd0('0x16')]){errors+=0x1;delete _0xfa9b7e['error'];}else if(_0xfa9b7e[_0xcfd0('0x2e')]){duplicates+=0x1;delete _0xfa9b7e[_0xcfd0('0x2e')];}rows[_0xcfd0('0x33')](_0xfa9b7e);}));if(total%0xc8===0x0){_0x2f4f46[_0xcfd0('0x72')]();return processPromises(_0x2f4f46);}},'complete':function(){return processPromises()[_0xcfd0('0x32')](function(){logger[_0xcfd0('0x73')](_0xcfd0('0x74'));endCsv();});},'error':function(_0x1cec1a,_0x275050){logger['info']('CSV\x20parse\x20error',JSON[_0xcfd0('0x37')](_0x1cec1a));endCsv();}});})[_0xcfd0('0x35')](function(_0x2b0cea){logger[_0xcfd0('0x16')](_0xcfd0('0x75'),JSON[_0xcfd0('0x37')](_0x2b0cea));});}main(); \ No newline at end of file +var _0xa38f=['updatedAt','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_contacts','id\x20IN\x20?','str','cm_hopper_final','\x20=\x20?','findAll','outbound','dialCheckDuplicateType','CmList','get','always','push','sequelize','query','VoiceQueueId','all','VoiceQueue','BlackLists','Lists','CampaignId','onlyIfOpen','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','CSV\x20import\x20process\x20stopped!','createReadStream','parse','info','CSV\x20parsed\x20correctly!','bluebird','lodash','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','length','map','errors','message','join','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','pick','catch','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','select','field','NOW()','toString'];(function(_0x8b2d01,_0x14e813){var _0x36d0fb=function(_0x3119b2){while(--_0x3119b2){_0x8b2d01['push'](_0x8b2d01['shift']());}};_0x36d0fb(++_0x14e813);}(_0xa38f,0x16d));var _0xfa38=function(_0x264766,_0x377d88){_0x264766=_0x264766-0x0;var _0x553114=_0xa38f[_0x264766];return _0x553114;};'use strict';var BPromise=require(_0xfa38('0x0'));var util=require('util');var _=require(_0xfa38('0x1'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0xfa38('0x2'));var db=require('../../../mysqldb')['db'];var config=require(_0xfa38('0x3'));var logger=require(_0xfa38('0x4'))(_0xfa38('0x5'));config[_0xfa38('0x6')]=_[_0xfa38('0x7')](config[_0xfa38('0x6')],{'host':_0xfa38('0x8'),'port':0x18eb});var socket=require(_0xfa38('0x9'))(new Redis(config[_0xfa38('0x6')]));require(_0xfa38('0xa'))[_0xfa38('0xb')](socket);try{if(!process[_0xfa38('0xc')][0x2]||process['argv'][0x2]===_0xfa38('0xd')||process[_0xfa38('0xc')][0x2]===_0xfa38('0xe')){throw new Error(_0xfa38('0xf'));}var FILEPATH=process[_0xfa38('0xc')][0x2];if(!process[_0xfa38('0xc')][0x3]||process[_0xfa38('0xc')][0x3]===_0xfa38('0xd')||process[_0xfa38('0xc')][0x3]===_0xfa38('0xe')||!process[_0xfa38('0xc')][0x4]||process[_0xfa38('0xc')][0x4]===_0xfa38('0xd')||process['argv'][0x4]===_0xfa38('0xe')){throw new Error(_0xfa38('0x10'));}var FIELDS=_['zipObject'](process[_0xfa38('0xc')][0x3][_0xfa38('0x11')](','),process['argv'][0x4][_0xfa38('0x11')](','));if(!process[_0xfa38('0xc')][0x5]||process['argv'][0x5]===_0xfa38('0xd')||process[_0xfa38('0xc')][0x5]===_0xfa38('0xe')){throw new Error(_0xfa38('0x12'));}var LISTID=process[_0xfa38('0xc')][0x5];var COMPANYID=process[_0xfa38('0xc')][0x6]&&process['argv'][0x6]!==_0xfa38('0xd')&&process[_0xfa38('0xc')][0x6]!==_0xfa38('0xe')?process['argv'][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0xfa38('0xc')][0x7]!==_0xfa38('0xe')?process[_0xfa38('0xc')][0x7]:null;if(!process['argv'][0x8]||process[_0xfa38('0xc')][0x8]===_0xfa38('0xd')||process[_0xfa38('0xc')][0x8]==='null'){throw new Error(_0xfa38('0x13'));}var SOCKET_TIMESTAMP=process[_0xfa38('0xc')][0x8];}catch(_0x4b10e6){logger[_0xfa38('0x14')](_0x4b10e6);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(_0x3ee128,_0x24c1aa,_0x21dae4,_0x368826){var _0x4b6144={'message':_0x24c1aa};_0x4b6144[_0x3ee128]=!![];if(_0x21dae4){_0x4b6144[_0xfa38('0x15')]=_0x21dae4;}if(_0x368826){_0x4b6144['index']=_0x368826;}return _0x4b6144;}function isEmail(_0x47ab7c){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))*$/[_0xfa38('0x16')](_0x47ab7c);}function checkRow(_0x75ca91,_0x1f442e,_0xee457a){return new BPromise(function(_0x37ef46,_0x57aa6e){if(_[_0xfa38('0x17')](_0x75ca91)){return _0x57aa6e(handleCheckRowError(_0xfa38('0x14'),_0xfa38('0x18'),null,_0xee457a));}if(_0x75ca91['errors']&&_0x75ca91['errors'][_0xfa38('0x19')]){var _0x3708e0=_[_0xfa38('0x1a')](_0x75ca91[_0xfa38('0x1b')],_0xfa38('0x1c'))[_0xfa38('0x1d')](';');return _0x57aa6e(handleCheckRowError(_0xfa38('0x14'),_0x3708e0,null,_0xee457a));}var _0x46629f={};for(var _0x5543d5 in FIELDS){if(FIELDS['hasOwnProperty'](_0x5543d5)&&FIELDS[_0x5543d5]){_0x46629f[_0x5543d5]=_0x75ca91['data'][0x0][FIELDS[_0x5543d5]]||_0x75ca91[_0xfa38('0x1e')][0x0]['\ufeff'+FIELDS[_0x5543d5]];}}if(!_0x46629f[_0xfa38('0x1f')]){return _0x57aa6e(handleCheckRowError('error',_0xfa38('0x20'),null,_0xee457a));}if(!_0x46629f[_0xfa38('0x21')]){return _0x57aa6e(handleCheckRowError(_0xfa38('0x14'),'phone\x20not\x20specified!',null,_0xee457a));}if(_0x46629f[_0xfa38('0x22')]){var _0x5b9dd0=moment(_0x46629f[_0xfa38('0x22')],_0xfa38('0x23'));if(!_0x5b9dd0[_0xfa38('0x24')]()){return _0x57aa6e(handleCheckRowError(_0xfa38('0x14'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0xee457a));}}if(_0x46629f[_0xfa38('0x25')]){if(!isEmail(_0x46629f[_0xfa38('0x25')])){return _0x57aa6e(handleCheckRowError(_0xfa38('0x14'),_0xfa38('0x26'),null,_0xee457a));}}_0x46629f[_0xfa38('0x27')]=LISTID;_0x46629f[_0xfa38('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xfa38('0x19')]&&_0x1f442e){var _0x12a2ab={};for(var _0x48e4a2=0x0,_0x5b27fd=DUPLICATES[_0xfa38('0x19')];_0x48e4a2<_0x5b27fd;_0x48e4a2+=0x1){_0x12a2ab[DUPLICATES[_0x48e4a2]]=_0x46629f[DUPLICATES[_0x48e4a2]];}var _0x337969=_['find'](_0x1f442e,_0x12a2ab);if(_0x337969){return _0x57aa6e(handleCheckRowError(_0xfa38('0x29'),_0xfa38('0x2a'),_0x337969,_0xee457a));}}return db[_0xfa38('0x2b')][_0xfa38('0x2c')](_0x46629f,{'raw':!![],'hooks':![],'fields':_[_0xfa38('0x2d')](_0x46629f)})[_0xfa38('0x2e')](function(_0x1bfcac){if(DUPLICATES&&DUPLICATES['length']&&_0x1f442e){_0x1f442e['push'](_[_0xfa38('0x2f')](_0x46629f,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1bfcac['id'];return _0x37ef46();})[_0xfa38('0x30')](function(_0x98e4a6){return _0x57aa6e(handleCheckRowError(_0xfa38('0x14'),'Error\x20while\x20creating\x20contact:\x20'+(_0x98e4a6[_0xfa38('0x1c')]||JSON['stringify'](_0x98e4a6)),null,_0xee457a));});});}function checkHopper(){function _0x3940ae(){return function(_0x40f515){logger[_0xfa38('0x14')](_0xfa38('0x31'),_0xfa38('0x32'),util[_0xfa38('0x33')](_0x40f515,{'showHidden':![],'depth':null}));};}var _0x2f54c3=function(_0x51a2ca,_0x2840e4){var _0x20da04=squel[_0xfa38('0x34')]()[_0xfa38('0x35')](_0xfa38('0x36'))[_0xfa38('0x37')]([_0xfa38('0x21'),_0xfa38('0x38'),_0xfa38('0x39'),_0xfa38('0x27'),_0x2840e4,_0xfa38('0x3a'),'updatedAt'],squel[_0xfa38('0x3b')]()[_0xfa38('0x3c')](_0xfa38('0x21'),'phone')['field'](_0xfa38('0x3d'),_0xfa38('0x38'))[_0xfa38('0x3c')]('id','ContactId')[_0xfa38('0x3c')](LISTID['toString'](),_0xfa38('0x27'))['field'](_0x51a2ca['id'][_0xfa38('0x3e')](),_0x2840e4)[_0xfa38('0x3c')](_0xfa38('0x3d'),_0xfa38('0x3a'))[_0xfa38('0x3c')]('NOW()',_0xfa38('0x3f'))[_0xfa38('0x40')]('cm_contacts')[_0xfa38('0x41')](_0xfa38('0x42'))['where'](_0xfa38('0x43'),LISTID[_0xfa38('0x3e')]())['where'](_0xfa38('0x44'))[_0xfa38('0x41')](_0xfa38('0x45'),squel[_0xfa38('0x3b')]()[_0xfa38('0x3c')](_0xfa38('0x21'))[_0xfa38('0x40')](_0xfa38('0x36'))[_0xfa38('0x41')](_0x2840e4+'\x20=\x20?',_0x51a2ca['id'][_0xfa38('0x3e')]())))[_0xfa38('0x3e')]();return _0x20da04;};var _0x5249ab=function(_0x461c96,_0x4f2f28){var _0x3caed7=squel[_0xfa38('0x34')]()[_0xfa38('0x35')](_0xfa38('0x36'))[_0xfa38('0x37')]([_0xfa38('0x21'),_0xfa38('0x38'),_0xfa38('0x39'),_0xfa38('0x27'),_0x4f2f28,_0xfa38('0x3a'),_0xfa38('0x3f')],squel['select']()[_0xfa38('0x3c')]('phone','phone')[_0xfa38('0x3c')]('NOW()',_0xfa38('0x38'))[_0xfa38('0x3c')]('id','ContactId')[_0xfa38('0x3c')](LISTID[_0xfa38('0x3e')](),'ListId')[_0xfa38('0x3c')](_0x461c96['id']['toString'](),_0x4f2f28)[_0xfa38('0x3c')](_0xfa38('0x3d'),_0xfa38('0x3a'))[_0xfa38('0x3c')](_0xfa38('0x3d'),_0xfa38('0x3f'))[_0xfa38('0x40')](_0xfa38('0x46'))[_0xfa38('0x41')](_0xfa38('0x42'))[_0xfa38('0x41')](_0xfa38('0x43'),LISTID[_0xfa38('0x3e')]())[_0xfa38('0x41')](_0xfa38('0x47'),squel[_0xfa38('0x48')](hopperContacts))[_0xfa38('0x41')](_0xfa38('0x44'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xfa38('0x3b')]()[_0xfa38('0x3c')]('calleridnum')[_0xfa38('0x40')](_0xfa38('0x49'))['where'](_0x4f2f28+_0xfa38('0x4a'),_0x461c96['id']['toString']()))['where'](_0xfa38('0x45'),squel[_0xfa38('0x3b')]()[_0xfa38('0x3c')](_0xfa38('0x21'))['from'](_0xfa38('0x36'))[_0xfa38('0x41')](_0x4f2f28+_0xfa38('0x4a'),_0x461c96['id'][_0xfa38('0x3e')]())))[_0xfa38('0x3e')]();return _0x3caed7;};function _0x452ab8(_0x582090,_0x5be580){var _0x5211c5=squel[_0xfa38('0x34')]()[_0xfa38('0x35')](_0xfa38('0x36'))[_0xfa38('0x37')]([_0xfa38('0x21'),_0xfa38('0x38'),_0xfa38('0x39'),_0xfa38('0x27'),_0x5be580,'createdAt',_0xfa38('0x3f')],squel[_0xfa38('0x3b')]()[_0xfa38('0x3c')](_0xfa38('0x21'),_0xfa38('0x21'))[_0xfa38('0x3c')](_0xfa38('0x3d'),_0xfa38('0x38'))[_0xfa38('0x3c')]('id',_0xfa38('0x39'))[_0xfa38('0x3c')](LISTID['toString'](),_0xfa38('0x27'))[_0xfa38('0x3c')](_0x582090['id']['toString'](),_0x5be580)[_0xfa38('0x3c')](_0xfa38('0x3d'),_0xfa38('0x3a'))[_0xfa38('0x3c')](_0xfa38('0x3d'),_0xfa38('0x3f'))[_0xfa38('0x40')](_0xfa38('0x46'))[_0xfa38('0x41')](_0xfa38('0x42'))[_0xfa38('0x41')](_0xfa38('0x43'),LISTID['toString']())[_0xfa38('0x41')](_0xfa38('0x47'),squel[_0xfa38('0x48')](hopperContacts))[_0xfa38('0x41')]('phone\x20IS\x20NOT\x20NULL'))[_0xfa38('0x3e')]();return _0x5211c5;}function _0x3e248e(_0x49db04,_0x2c6fdb){var _0x4e81c9=squel[_0xfa38('0x34')]()[_0xfa38('0x35')]('cm_hopper_black')[_0xfa38('0x37')]([_0xfa38('0x21'),_0xfa38('0x39'),'ListId',_0x2c6fdb,_0xfa38('0x3a'),'updatedAt'],squel[_0xfa38('0x3b')]()[_0xfa38('0x3c')]('phone',_0xfa38('0x21'))[_0xfa38('0x3c')]('id',_0xfa38('0x39'))[_0xfa38('0x3c')](LISTID[_0xfa38('0x3e')](),_0xfa38('0x27'))[_0xfa38('0x3c')](_0x49db04['id'][_0xfa38('0x3e')](),_0x2c6fdb)[_0xfa38('0x3c')](_0xfa38('0x3d'),_0xfa38('0x3a'))[_0xfa38('0x3c')](_0xfa38('0x3d'),_0xfa38('0x3f'))[_0xfa38('0x40')]('cm_contacts')[_0xfa38('0x41')](_0xfa38('0x42'))[_0xfa38('0x41')](_0xfa38('0x43'),LISTID['toString']())[_0xfa38('0x41')](_0xfa38('0x47'),squel['str'](hopperContacts))[_0xfa38('0x41')](_0xfa38('0x44')))['toString']();return _0x4e81c9;}return db['VoiceQueue'][_0xfa38('0x4b')]({'where':{'type':_0xfa38('0x4c')},'attributes':['id',_0xfa38('0x4d')],'include':[{'model':db[_0xfa38('0x4e')],'as':'Lists','where':{'id':LISTID}}]})[_0xfa38('0x2e')](function(_0x115044){var _0x185d68=[];if(_0x115044){var _0x281ed0;for(var _0x5593a1=0x0,_0x23837a;_0x5593a1<_0x115044[_0xfa38('0x19')];_0x5593a1+=0x1){_0x23837a=_0x115044[_0x5593a1][_0xfa38('0x4f')]({'plain':!![]});switch(_0x23837a[_0xfa38('0x4d')]){case _0xfa38('0x50'):_0x185d68[_0xfa38('0x51')](db[_0xfa38('0x52')][_0xfa38('0x53')](_0x5249ab(_0x23837a,_0xfa38('0x54')))[_0xfa38('0x2e')](function(){})[_0xfa38('0x30')](_0x3940ae()));break;case'onlyIfOpen':_0x185d68[_0xfa38('0x51')](db['sequelize'][_0xfa38('0x53')](_0x2f54c3(_0x23837a,_0xfa38('0x54')))['then'](function(){})[_0xfa38('0x30')](_0x3940ae()));break;default:_0x185d68[_0xfa38('0x51')](db['sequelize']['query'](_0x452ab8(_0x23837a,_0xfa38('0x54')))[_0xfa38('0x2e')](function(){})[_0xfa38('0x30')](_0x3940ae()));}}}return _0x185d68;})[_0xfa38('0x55')]()[_0xfa38('0x2e')](function(){return db[_0xfa38('0x56')][_0xfa38('0x4b')]({'where':{'type':_0xfa38('0x4c')},'attributes':['id'],'include':[{'model':db[_0xfa38('0x4e')],'as':_0xfa38('0x57'),'where':{'id':LISTID}}]})[_0xfa38('0x2e')](function(_0x225b30){var _0x57cff4=[];if(_0x225b30){var _0x33d30d;for(var _0x47bbae=0x0,_0x1b09ba;_0x47bbae<_0x225b30[_0xfa38('0x19')];_0x47bbae+=0x1){_0x1b09ba=_0x225b30[_0x47bbae][_0xfa38('0x4f')]({'plain':!![]});_0x57cff4[_0xfa38('0x51')](db[_0xfa38('0x52')]['query'](_0x3e248e(_0x1b09ba,_0xfa38('0x54')))['then'](function(){})['catch'](_0x3940ae()));}}return _0x57cff4;})[_0xfa38('0x55')]();})[_0xfa38('0x2e')](function(){return db['Campaign']['findAll']({'attributes':['id',_0xfa38('0x4d')],'include':[{'model':db[_0xfa38('0x4e')],'as':_0xfa38('0x58'),'where':{'id':LISTID}}]})[_0xfa38('0x2e')](function(_0x22cbd8){var _0x45d03c=[];if(_0x22cbd8){for(var _0x164285=0x0,_0x36c2a1;_0x164285<_0x22cbd8[_0xfa38('0x19')];_0x164285+=0x1){_0x36c2a1=_0x22cbd8[_0x164285][_0xfa38('0x4f')]({'plain':!![]});switch(_0x36c2a1[_0xfa38('0x4d')]){case'always':_0x45d03c['push'](db['sequelize'][_0xfa38('0x53')](_0x5249ab(_0x36c2a1,_0xfa38('0x59')))[_0xfa38('0x2e')](function(){})[_0xfa38('0x30')](_0x3940ae()));break;case _0xfa38('0x5a'):_0x45d03c[_0xfa38('0x51')](db[_0xfa38('0x52')]['query'](_0x2f54c3(_0x36c2a1,'CampaignId'))[_0xfa38('0x2e')](function(){})[_0xfa38('0x30')](_0x3940ae()));break;default:_0x45d03c[_0xfa38('0x51')](db[_0xfa38('0x52')]['query'](_0x452ab8(_0x36c2a1,_0xfa38('0x59')))[_0xfa38('0x2e')](function(){})[_0xfa38('0x30')](_0x3940ae()));}}}return _0x45d03c;})[_0xfa38('0x55')]();})[_0xfa38('0x2e')](function(){return db[_0xfa38('0x5b')][_0xfa38('0x4b')]({'attributes':['id'],'include':[{'model':db[_0xfa38('0x4e')],'as':_0xfa38('0x57'),'where':{'id':LISTID}}]})[_0xfa38('0x2e')](function(_0x55cc61){var _0x525819=[];if(_0x55cc61){for(var _0x2b5e0e=0x0,_0x7d451c;_0x2b5e0e<_0x55cc61['length'];_0x2b5e0e+=0x1){_0x7d451c=_0x55cc61[_0x2b5e0e][_0xfa38('0x4f')]({'plain':!![]});_0x525819['push'](db[_0xfa38('0x52')]['query'](_0x3e248e(_0x7d451c,_0xfa38('0x59')))[_0xfa38('0x2e')](function(){})[_0xfa38('0x30')](_0x3940ae()));}}return _0x525819;})[_0xfa38('0x55')]();})[_0xfa38('0x30')](function(_0x8bf058){logger['error'](_0xfa38('0x5c'),_0xfa38('0x5d'),_0x8bf058[_0xfa38('0x1c')]);});}var processPromises=function(_0x182cc7){return BPromise[_0xfa38('0x55')](promises)[_0xfa38('0x2e')](function(_0x42c18f){})[_0xfa38('0x30')](function(_0x13c3ff){logger[_0xfa38('0x14')](_0xfa38('0x5e'),JSON[_0xfa38('0x5f')](_0x13c3ff));})[_0xfa38('0x60')](function(){socket[_0xfa38('0x61')](_0xfa38('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x182cc7){return _0x182cc7[_0xfa38('0x63')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xfa38('0x2e')](function(){if(hopperContacts){return checkHopper();}})[_0xfa38('0x2e')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xfa38('0x64')](FILEPATH);}catch(_0x5a72e7){logger[_0xfa38('0x14')](_0xfa38('0x65'),JSON[_0xfa38('0x5f')](_0x5a72e7));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger['info'](_0xfa38('0x66'));endCsv();});function main(){return BPromise['resolve']()[_0xfa38('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xfa38('0x11')](',');return db[_0xfa38('0x2b')][_0xfa38('0x4b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xfa38('0x2e')](function(_0x57f9a9){var _0x1d6286=fs[_0xfa38('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xfa38('0x68')](_0x1d6286,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3b4c88,_0x5dab04){total+=0x1;var _0x9e6e98=total;promises[_0xfa38('0x51')](checkRow(_0x3b4c88,_0x57f9a9,_0x9e6e98)['then'](function(){success+=0x1;})['catch'](function(_0x5755e3){if(_0x5755e3[_0xfa38('0x14')]){errors+=0x1;delete _0x5755e3[_0xfa38('0x14')];}else if(_0x5755e3[_0xfa38('0x29')]){duplicates+=0x1;delete _0x5755e3[_0xfa38('0x29')];}rows[_0xfa38('0x51')](_0x5755e3);}));if(total%0xc8===0x0){_0x5dab04['pause']();return processPromises(_0x5dab04);}},'complete':function(){return processPromises()[_0xfa38('0x2e')](function(){logger[_0xfa38('0x69')](_0xfa38('0x6a'));endCsv();});},'error':function(_0x3f4e9a,_0x2bea12){logger[_0xfa38('0x69')]('CSV\x20parse\x20error',JSON[_0xfa38('0x5f')](_0x3f4e9a));endCsv();}});})[_0xfa38('0x30')](function(_0x5a035b){logger[_0xfa38('0x14')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xfa38('0x5f')](_0x5a035b));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 8ecf36c..7d4252d 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 _0xab4d=['cm_contacts.scheduledat','cm_contacts.id','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','scheduledat','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.ListId','cm_contacts.createdAt','cm_hopper_black','ContactId','createdAt','cm_contacts.createdAt\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','ListId','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','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','scheduledAt',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','message','errors','code','sequelize','query','spread','catch','error','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','utcOffset','set','offset','main','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','includes','ContactItemType','name','_description','writeFileSync','data','rows','find','hasOwnProperty','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','isValid','timezones','firstName','itemTypeId','description','appendFileSync','emit','contact:import:','Abort\x20parser','abort','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','CompanyId',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','voice_queues_has_cm_blacklists','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','affectedRows','unlink','exit','complete','argv','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','map','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment/shared','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','findAll','AdditionalPhones','length','all','then','split','push','isNil','filter','CmContactHasItem','findOne','update','updated','create','cm_contacts.phone'];(function(_0x5e41a8,_0x401a4a){var _0x581b58=function(_0x18def6){while(--_0x18def6){_0x5e41a8['push'](_0x5e41a8['shift']());}};_0x581b58(++_0x401a4a);}(_0xab4d,0x92));var _0xdab4=function(_0xcd0918,_0x56bdf9){_0xcd0918=_0xcd0918-0x0;var _0x250704=_0xab4d[_0xcd0918];return _0x250704;};'use strict';var fs=require('fs');var path=require(_0xdab4('0x0'));var _=require(_0xdab4('0x1'));var Papa=require(_0xdab4('0x2'));var util=require('util');var BPromise=require(_0xdab4('0x3'));var moment=require(_0xdab4('0x4'));var squel=require(_0xdab4('0x5'));var Redis=require(_0xdab4('0x6'));var db=require(_0xdab4('0x7'))['db'];var config=require('../../../config/environment');var shared=require(_0xdab4('0x8'));var logger=require('../../../config/logger')(_0xdab4('0x9'));config[_0xdab4('0xa')]=_[_0xdab4('0xb')](config[_0xdab4('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xdab4('0xc'))(new Redis(config[_0xdab4('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xdab4('0xd')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0xdab4('0xe'));function isEmail(_0x2ef41c){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))*$/[_0xdab4('0xf')](_0x2ef41c);}function selectNotIn(_0x470c62,_0x648a08,_0x3f6540,_0x594ff5,_0x1a4e2f){return squel[_0xdab4('0x10')]()[_0xdab4('0x11')](_0xdab4('0x12'))[_0xdab4('0x13')](_0x594ff5)[_0xdab4('0x14')](_0x648a08,null,_0x648a08+_0xdab4('0x15')+_0x594ff5+'.'+_0x3f6540)[_0xdab4('0x16')](_0x594ff5+'.'+_0x3f6540+_0xdab4('0x17')+_0x470c62+'.'+_0x3f6540)[_0xdab4('0x16')](_0x648a08+_0xdab4('0x18')+_0x1a4e2f[_0xdab4('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x9f4f22,_0x290e44){promisesAdditionalPhones=[];return db['CmContact'][_0xdab4('0x19')]({'raw':!![],'attributes':['id',_0xdab4('0x1a')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x2645b1){if(_0x2645b1!==null){var _0x26629a=[];for(var _0x3a1486=0x0;_0x3a1486<_0x2645b1[_0xdab4('0x1b')];_0x3a1486++){var _0x4f96d7=_0x2645b1[_0x3a1486];_0x26629a['push'](insertAdditionalPhones(_0x4f96d7));}}Promise[_0xdab4('0x1c')](_0x26629a)[_0xdab4('0x1d')](function(){_0x9f4f22({'val':0x1});});});});}function insertAdditionalPhones(_0x467f9b){return new Promise(function(_0x215a50,_0x491cc7){var _0x1312c8=_0x467f9b['AdditionalPhones'];var _0x51de21=_0x1312c8[_0xdab4('0x1e')](';');var _0x23bdb7=[];orderBy=0x0;for(var _0x18d6ca=0x0;_0x18d6ca<_0x51de21[_0xdab4('0x1b')];_0x18d6ca++){_0x23bdb7[_0xdab4('0x1f')](splitAdditionalPhone(_0x467f9b['id'],_0x51de21[_0x18d6ca]));}Promise[_0xdab4('0x1c')](_0x23bdb7)[_0xdab4('0x1d')](function(){_0x215a50({'val':_0x51de21[_0xdab4('0x1b')]});});});}function splitAdditionalPhone(_0x2721bc,_0x209bdb){return new Promise(function(_0x34b41e,_0x421fa5){var _0x201781=_0x209bdb[_0xdab4('0x1e')](':');var _0x1ff4a4=_0x201781[0x0];var _0x501c9d=_0x201781[0x1];if(!_[_0xdab4('0x20')](_0x501c9d)){var _0x43a20d=_0x501c9d['split']('|');var _0x41d94c=[];for(var _0x2ea8a0=0x0;_0x2ea8a0<_0x43a20d[_0xdab4('0x1b')];_0x2ea8a0++){if(_0x43a20d[_0x2ea8a0]!==''){var _0x51bed7=_[_0xdab4('0x21')](promisesAdditionalPhones,{'contactId':_0x2721bc,'phone':_0x43a20d[_0x2ea8a0]});if(_0x51bed7[_0xdab4('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0xdab4('0x1f')]({'contactId':_0x2721bc,'contactTypeId':_0x1ff4a4,'phone':_0x43a20d[_0x2ea8a0],'orderBy':orderBy});}}}_0x34b41e({'ok':0x1});}else _0x34b41e({'res':0x0});});}function createAdditionalPhone(_0x3b7138,_0x54c9c9,_0x9b966a,_0x3497cb){var _0x143d97='';var _0x509265='';var _0x447c88=_0x9b966a[_0xdab4('0x1e')]('§');_0x143d97=_0x447c88[0x0];if(_0x447c88[_0xdab4('0x1b')]==0x2)_0x509265=_0x447c88[0x1];return new Promise(function(_0x313052,_0x49f75a){return db[_0xdab4('0x22')][_0xdab4('0x23')]({'where':{'CmContactId':_0x3b7138,'item':_0x143d97}})[_0xdab4('0x1d')](function(_0x4ad3c2){if(_0x4ad3c2){return db['CmContactHasItem'][_0xdab4('0x24')]({'ItemTypeId':_0x54c9c9,'description':_0x509265,'OrderBy':_0x3497cb},{'where':{'CmContactId':_0x3b7138,'item':_0x143d97}})[_0xdab4('0x1d')](function(_0x91c89a){_0x313052({'res':_0xdab4('0x25')});});}else{return db['CmContactHasItem'][_0xdab4('0x26')]({'CmContactId':_0x3b7138,'item':_0x143d97,'description':_0x509265,'ItemTypeId':_0x54c9c9,'OrderBy':_0x3497cb,'ItemClass':'PHONE'})[_0xdab4('0x1d')](function(_0x313c8e){_0x313052({'res':'inserted'});});}});});}function insertCmHopper(_0x146b3c,_0x5ea939,_0x3739ab,_0x5548be,_0x573c21){var _0x43e9a9=[_0xdab4('0x27'),_0xdab4('0x28'),_0xdab4('0x29'),'cm_contacts.ListId',_0x5ea939+'.'+_0x5548be,'cm_contacts.createdAt',_0xdab4('0x2a'),_0xdab4('0x2b'),_0xdab4('0x2c'),'\x22'+_0x573c21+'\x22'];return squel[_0xdab4('0x2d')]()[_0xdab4('0x2e')]('cm_hopper')[_0xdab4('0x2f')]([_0xdab4('0x12'),_0xdab4('0x30'),'ContactId','ListId',_0x5548be,'createdAt',_0xdab4('0x31'),_0xdab4('0x32'),_0xdab4('0x33'),_0xdab4('0x34')],squel[_0xdab4('0x10')]()[_0xdab4('0x35')](_0x43e9a9)['from'](_0x5ea939)[_0xdab4('0x14')](_0xdab4('0x36'),null,_0xdab4('0x37')+_0x5ea939+_0xdab4('0x38'))['join'](_0x3739ab,null,_0x3739ab+_0xdab4('0x15')+_0x5ea939+'.'+_0x5548be)[_0xdab4('0x16')](_0x5ea939+_0xdab4('0x39'),_0x146b3c)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xdab4('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5ea939,_0x3739ab,_0x5548be,_0xdab4('0x3a'),[_0xdab4('0x3b'),_0xdab4('0x3c')]))[_0xdab4('0x16')](_0xdab4('0x3d'),selectNotIn(_0x5ea939,_0x3739ab,_0x5548be,_0xdab4('0x3a'),[_0xdab4('0x3b')])))[_0xdab4('0x3e')]();}function insertCmHopperBlack(_0x165cce,_0x281a8c,_0x29a57b,_0x1211b1){var _0x31e0f3=[_0xdab4('0x27'),_0xdab4('0x29'),_0xdab4('0x3f'),_0x281a8c+'.'+_0x1211b1,_0xdab4('0x40'),_0xdab4('0x2a')];return squel[_0xdab4('0x2d')]()[_0xdab4('0x2e')](_0xdab4('0x41'))[_0xdab4('0x2f')]([_0xdab4('0x12'),_0xdab4('0x42'),'ListId',_0x1211b1,_0xdab4('0x43'),'updatedAt'],squel[_0xdab4('0x10')]()[_0xdab4('0x35')](_0x31e0f3)[_0xdab4('0x13')](_0x281a8c)[_0xdab4('0x14')](_0xdab4('0x36'),null,'cm_contacts.ListId\x20=\x20'+_0x281a8c+_0xdab4('0x38'))[_0xdab4('0x14')](_0x29a57b,null,_0x29a57b+_0xdab4('0x15')+_0x281a8c+'.'+_0x1211b1)['where'](_0x281a8c+'.CmListId\x20=\x20?',_0x165cce)[_0xdab4('0x16')](_0xdab4('0x44'),NOW)[_0xdab4('0x16')](_0xdab4('0x3d'),squel[_0xdab4('0x10')]()[_0xdab4('0x11')](_0xdab4('0x12'))[_0xdab4('0x13')](_0xdab4('0x41'))[_0xdab4('0x16')]('ListId\x20=\x20?',_0x165cce)[_0xdab4('0x16')](_0x1211b1+_0xdab4('0x17')+_0x281a8c+'.'+_0x1211b1)))[_0xdab4('0x3e')]();}function insertTzCmHopper(_0x34c14d,_0x5b4d68,_0x412547,_0x43cc4c,_0x4f9120,_0x5bb9b7){var _0x4baffe=[_0xdab4('0x27'),_0xdab4('0x45')+_0x5bb9b7+_0xdab4('0x46'),_0xdab4('0x29'),'cm_contacts.ListId',_0x5b4d68+'.'+_0x43cc4c,_0xdab4('0x40'),_0xdab4('0x2a'),_0xdab4('0x2b'),_0xdab4('0x2c'),'\x22'+_0x4f9120+'\x22'];var _0x80eb45=squel[_0xdab4('0x2d')]()[_0xdab4('0x2e')]('cm_hopper')[_0xdab4('0x2f')]([_0xdab4('0x12'),_0xdab4('0x30'),_0xdab4('0x42'),_0xdab4('0x47'),_0x43cc4c,_0xdab4('0x43'),_0xdab4('0x31'),'priority',_0xdab4('0x33'),_0xdab4('0x34')],squel[_0xdab4('0x10')]()['fields'](_0x4baffe)[_0xdab4('0x13')](_0x5b4d68)['join'](_0xdab4('0x36'),null,_0xdab4('0x37')+_0x5b4d68+_0xdab4('0x38'))[_0xdab4('0x14')](_0x412547,null,_0x412547+_0xdab4('0x15')+_0x5b4d68+'.'+_0x43cc4c)['join'](_0x5bb9b7,null,_0x5bb9b7+'.id\x20=\x20'+_0x5b4d68+'.'+_0x43cc4c)[_0xdab4('0x16')](_0x5b4d68+'.CmListId\x20=\x20?',_0x34c14d)[_0xdab4('0x16')](_0xdab4('0x44'),NOW)['where'](_0xdab4('0x3d'),selectNotIn(_0x5b4d68,_0x412547,_0x43cc4c,'cm_hopper',[_0xdab4('0x3b'),_0xdab4('0x3c')]))[_0xdab4('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5b4d68,_0x412547,_0x43cc4c,_0xdab4('0x3a'),['\x22always\x22'])))[_0xdab4('0x3e')]();return _0x80eb45;}function insertTzCmHopperBlack(_0x1debab,_0x24fb1a,_0x174243,_0x57f828){var _0x1e17e1=[_0xdab4('0x27'),_0xdab4('0x29'),'cm_contacts.ListId',_0x24fb1a+'.'+_0x57f828,_0xdab4('0x40'),'cm_contacts.updatedAt'];return squel[_0xdab4('0x2d')]()['into'](_0xdab4('0x41'))['fromQuery']([_0xdab4('0x12'),_0xdab4('0x42'),_0xdab4('0x47'),_0x57f828,'createdAt',_0xdab4('0x31')],squel[_0xdab4('0x10')]()[_0xdab4('0x35')](_0x1e17e1)['from'](_0x24fb1a)['join'](_0xdab4('0x36'),null,_0xdab4('0x37')+_0x24fb1a+_0xdab4('0x38'))[_0xdab4('0x14')](_0x174243,null,_0x174243+_0xdab4('0x15')+_0x24fb1a+'.'+_0x57f828)[_0xdab4('0x16')](_0x24fb1a+_0xdab4('0x39'),_0x1debab)[_0xdab4('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xdab4('0x16')](_0xdab4('0x3d'),squel[_0xdab4('0x10')]()['field'](_0xdab4('0x12'))[_0xdab4('0x13')](_0xdab4('0x41'))[_0xdab4('0x16')]('ListId\x20=\x20?',_0x1debab)['where'](_0x57f828+'\x20=\x20'+_0x24fb1a+'.'+_0x57f828)))[_0xdab4('0x3e')]();}function insertCmHopperAdditionalPhones(_0x570383){var _0x335cb7=[_0xdab4('0x48'),_0xdab4('0x49'),_0xdab4('0x4a'),_0xdab4('0x4b'),_0xdab4('0x4c')];return squel['insert']()[_0xdab4('0x2e')](_0xdab4('0x4d'))[_0xdab4('0x2f')]([_0xdab4('0x4e'),_0xdab4('0x12'),'OrderBy',_0xdab4('0x43'),_0xdab4('0x31')],squel[_0xdab4('0x10')]()[_0xdab4('0x35')](_0x335cb7)[_0xdab4('0x13')](_0xdab4('0x3a'))[_0xdab4('0x14')](_0xdab4('0x36'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')['join']('cm_contact_has_items',null,_0xdab4('0x4f'))[_0xdab4('0x16')](_0xdab4('0x50'),_0x570383)[_0xdab4('0x16')](_0xdab4('0x44'),NOW))['toString']();}function insertCmContact(_0x28bb90,_0x5bc9ff,_0x36f260,_0x313374){var _0x536484=_[_0xdab4('0x51')](_[_0xdab4('0x52')](_0x313374),[_0xdab4('0x47'),'CompanyId',_0xdab4('0x43'),_0xdab4('0x31'),_0xdab4('0x53')]);return squel[_0xdab4('0x2d')]()['into'](_0xdab4('0x36'))[_0xdab4('0x2f')](_0x536484,squel['select']()[_0xdab4('0x35')](_0x536484)['from'](_0x5bc9ff)[_0xdab4('0x16')]('('+_0x36f260['join'](',')+_0xdab4('0x54'),squel[_0xdab4('0x10')]()[_0xdab4('0x35')](_0x36f260)['from']('cm_contacts')['where'](_0xdab4('0x55'),_0x28bb90)[_0xdab4('0x16')](_0xdab4('0x56')))[_0xdab4('0x16')](_0xdab4('0x57'),squel[_0xdab4('0x10')]()[_0xdab4('0x11')](_0xdab4('0x58'),_0xdab4('0x59'))[_0xdab4('0x13')](_0x5bc9ff)['group'](_0x36f260['join'](','))))[_0xdab4('0x3e')]();}function handleStop(){logger[_0xdab4('0x5a')](_0xdab4('0x5b'));stopped=!![];}function handleUncaughtException(_0xbb1d65){logger['error'](_0xbb1d65[_0xdab4('0x5c')]);process['exit'](0x1);}function handleError(_0x3e9811,_0x2c6c13){stats[_0xdab4('0x5d')][_0xdab4('0x1f')]({'name':_0x2c6c13[_0xdab4('0x5e')],'message':_0x2c6c13[_0xdab4('0x5c')],'row':_0x3e9811});}function handleQuery(_0x21ae48){logger[_0xdab4('0x5a')](_0x21ae48);return db[_0xdab4('0x5f')][_0xdab4('0x60')](_0x21ae48)[_0xdab4('0x61')](function(_0xf1fd2d){results['push'](_0xf1fd2d);})[_0xdab4('0x62')](function(_0x5b99d1){logger[_0xdab4('0x63')](_0x5b99d1[_0xdab4('0x5c')]);});}function updateTzCampaigns(_0x452ea1){return new Promise(function(_0x1effba,_0x244314){var _0xe987eb=squel['select']()[_0xdab4('0x35')]([_0xdab4('0x64'),_0xdab4('0x65')])['from'](_0xdab4('0x66'))[_0xdab4('0x14')](_0xdab4('0x67'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0xdab4('0x16')](_0xdab4('0x68')+_0x452ea1);db[_0xdab4('0x5f')][_0xdab4('0x60')](_0xe987eb[_0xdab4('0x3e')]())[_0xdab4('0x61')](function(_0x1fc46b){var _0xf812bb=[];for(var _0x287f6d=0x0;_0x287f6d<_0x1fc46b[_0xdab4('0x1b')];_0x287f6d++){_0xf812bb[_0xdab4('0x1f')](getTimezoneData(_0x1fc46b[_0x287f6d],tmp_campaigns));}BPromise['all'](_0xf812bb)[_0xdab4('0x1d')](function(){_0x1effba({'val':0x1});});})[_0xdab4('0x62')](function(_0x13e4d1){logger[_0xdab4('0x63')](_0x13e4d1[_0xdab4('0x5c')]);_0x1effba({'val':0x0});});});}function updateTzVoiceQueues(_0x3c88b9){return new Promise(function(_0x25f3a6,_0xcda000){var _0x1e39e9=squel[_0xdab4('0x10')]()[_0xdab4('0x35')]([_0xdab4('0x69'),_0xdab4('0x6a')])[_0xdab4('0x13')](_0xdab4('0x6b'))['join'](_0xdab4('0x6c'),null,_0xdab4('0x6d'))[_0xdab4('0x16')](_0xdab4('0x6e')+_0x3c88b9);db[_0xdab4('0x5f')][_0xdab4('0x60')](_0x1e39e9[_0xdab4('0x3e')]())['spread'](function(_0x357e1c){var _0x4e6caa=[];for(var _0x2e72c0=0x0;_0x2e72c0<_0x357e1c[_0xdab4('0x1b')];_0x2e72c0++){_0x4e6caa[_0xdab4('0x1f')](getTimezoneData(_0x357e1c[_0x2e72c0],tmp_voice_queues));}BPromise[_0xdab4('0x1c')](_0x4e6caa)['then'](function(){_0x25f3a6({'val':0x1});});})[_0xdab4('0x62')](function(_0x577832){logger['error'](_0x577832['message']);_0x25f3a6({'val':0x0});});});}function getTimezoneData(_0x2d6b93,_0x4df7a1){return new Promise(function(_0x228ce2,_0x553eba){var _0x52ffee=shared['timezones'];var _0x373da2=_0x52ffee[_0x2d6b93[_0xdab4('0x6f')]];if(_[_0xdab4('0x20')](_0x373da2)){_0x228ce2({'ret':0x1});}else{var _0x1faad1=_0x373da2[_0xdab4('0x70')];var _0x233fc3=squel[_0xdab4('0x2d')]()[_0xdab4('0x2e')](_0x4df7a1)[_0xdab4('0x71')]('id',_0x2d6b93['id'])['set'](_0xdab4('0x72'),_0x1faad1)['set'](_0xdab4('0x6f'),_0x2d6b93['dialTimezone'])[_0xdab4('0x3e')]();return db['sequelize']['query'](_0x233fc3)[_0xdab4('0x61')](function(_0xcc1ff1){_0x228ce2({'ret':0x1});})[_0xdab4('0x62')](function(_0x2e7b75){logger[_0xdab4('0x63')](_0x2e7b75[_0xdab4('0x5c')]);_0x553eba({'ret':0x1});});}});}function handleTZQuery(_0x11ab8d){logger['info'](_0x11ab8d);return db[_0xdab4('0x5f')][_0xdab4('0x60')](_0x11ab8d)['spread'](function(_0x51dc9a){})[_0xdab4('0x62')](function(_0x505830){logger[_0xdab4('0x63')](_0x505830['message']);});}function main(_0x3f97b0,_0x1da5a6,_0x252f0c,_0x3fcd9e){logger['info'](_0xdab4('0x73'),_0x3f97b0,JSON[_0xdab4('0x74')](_0x1da5a6));process[_0xdab4('0x75')](_0xdab4('0x76'));var _0x24fc7a=_0x1da5a6[_0xdab4('0x77')];var _0x38872f=_[_0xdab4('0x78')](_0x24fc7a);var _0x15212a=_0x1da5a6[_0xdab4('0x79')];var _0x7c4dc1=path[_0xdab4('0x14')](config[_0xdab4('0x7a')],_0xdab4('0x7b'),_0x15212a+_0xdab4('0x7c'));hasTZ=_[_0xdab4('0x52')](_0x24fc7a)[_0xdab4('0x7d')](_0xdab4('0x6f'));var _0x599de5=_['keys'](_0x24fc7a)['join']();logger[_0xdab4('0x5a')]('header',_0x599de5);db[_0xdab4('0x7e')][_0xdab4('0x19')]({'raw':!![],'attributes':['id','name']})[_0xdab4('0x1d')](function(_0x57771d){for(var _0x3f1bab=0x0;_0x3f1bab<_0x57771d[_0xdab4('0x1b')];_0x3f1bab++){if(_0x57771d[_0x3f1bab][_0xdab4('0x7f')]in _0x24fc7a){contactItemTypes[_0xdab4('0x1f')](_0x57771d[_0x3f1bab]);delete _0x38872f[_0x57771d[_0x3f1bab][_0xdab4('0x7f')]];hasAdditionalPhones=!![];}for(var _0x7775d5 in _0x24fc7a){if(_0x57771d[_0x3f1bab][_0xdab4('0x7f')]+_0xdab4('0x80')===_0x7775d5){phoneDescriptions[_0xdab4('0x1f')]({'itemTypeId':_0x57771d[_0x3f1bab]['id'],'description':_0x7775d5});delete _0x38872f[_0x7775d5];}}}if(hasAdditionalPhones)_0x38872f[_0xdab4('0x1a')]='';var _0x4a9742=_[_0xdab4('0x52')](_0x38872f)[_0xdab4('0x14')]();logger[_0xdab4('0x5a')]('header',_0x4a9742);fs[_0xdab4('0x81')](_0x7c4dc1,_0x4a9742+'\x0a');Papa['parse'](fs['createReadStream'](_0x3f97b0),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3ca35e,_0xb9485e){try{for(var _0x24fa99=0x0,_0x527277=[];_0x24fa99<_0x3ca35e[_0xdab4('0x82')]['length'];_0x24fa99++){stats[_0xdab4('0x83')]+=0x1;if(_0x3ca35e[_0xdab4('0x5d')][_0x24fa99]){handleError(_0x3ca35e[_0xdab4('0x82')][_0x24fa99],_0x3ca35e['errors'][_0x24fa99]);}else{var _0x417ff1=[];var _0x4a3d7d=[];var _0x133859={};for(var _0x1561ac in _0x24fc7a){let _0x21e41c=contactItemTypes[_0xdab4('0x84')](_0x3b4e97=>_0x3b4e97[_0xdab4('0x7f')]===_0x1561ac);let _0x12fa97=contactItemTypes['find'](_0x9e7a50=>_0x9e7a50['name']+_0xdab4('0x80')===_0x1561ac);if(_['isNil'](_0x21e41c)&&_[_0xdab4('0x20')](_0x12fa97)){if(_0x24fc7a[_0xdab4('0x85')](_0x1561ac)){if(_0x3ca35e[_0xdab4('0x82')][_0x24fa99][_0x24fc7a[_0x1561ac]]){var _0x2e6ed9=_[_0xdab4('0x86')](_0x3ca35e[_0xdab4('0x82')][_0x24fa99][_0x24fc7a[_0x1561ac]][_0xdab4('0x87')](/"/g,'\x27'));switch(_0x1561ac){case _0xdab4('0x30'):var _0x32ed90=moment(_0x2e6ed9,_0xdab4('0xe'),!![]);if(_0x32ed90['isValid']()){_0x527277[_0xdab4('0x1f')]('\x22'+_0x2e6ed9+'\x22');}else{_0x417ff1['push'](_0xdab4('0x88'));}break;case _0xdab4('0x32'):var _0x1bd36f=parseInt(_0x2e6ed9);_0x2e6ed9=_[_0xdab4('0x89')](_0x1bd36f)||_0x1bd36f<0x0||_0x1bd36f>0x4?_0x3fcd9e?0x3:0x2:_0x1bd36f;_0x527277['push']('\x22'+_0x2e6ed9+'\x22');break;case'UserId':var _0x581ca1=parseInt(_0x2e6ed9);if(_[_0xdab4('0x8a')](_0x581ca1)&&_['includes'](_0x252f0c,_0x581ca1)){_0x527277[_0xdab4('0x1f')]('\x22'+_0x581ca1+'\x22');}else{_0x417ff1['push'](_0xdab4('0x8b'));}break;case _0xdab4('0x8c'):if(isEmail(_0x2e6ed9)){_0x527277[_0xdab4('0x1f')]('\x22'+_0x2e6ed9+'\x22');}else{_0x417ff1[_0xdab4('0x1f')](_0xdab4('0x8d'));}break;case _0xdab4('0x8e'):var _0x4d1531=moment(_0x2e6ed9,'YYYY-MM-DD',!![]);if(_0x4d1531[_0xdab4('0x8f')]()){_0x527277['push']('\x22'+_0x2e6ed9+'\x22');}else{_0x417ff1[_0xdab4('0x1f')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0xdab4('0x6f'):var _0x15d20f=shared[_0xdab4('0x90')];var _0x5741aa=_0x15d20f[_0x2e6ed9];if(!_[_0xdab4('0x20')](_0x5741aa)){var _0x27b721=_0x5741aa['utcOffset'];_0x527277['push']('\x22'+_0x2e6ed9+'\x22');_0x527277[_0xdab4('0x1f')]('\x22'+_0x27b721+'\x22');}break;default:_0x527277[_0xdab4('0x1f')]('\x22'+_0x2e6ed9+'\x22');}}else{switch(_0x1561ac){case _0xdab4('0x91'):case'phone':_0x417ff1[_0xdab4('0x1f')](_0x1561ac+'\x20not\x20specified');break;default:_0x527277[_0xdab4('0x1f')]('\x22\x22');}}}}else{var _0x4bda76='';if(!_[_0xdab4('0x20')](_0x21e41c)){if(!_0x133859[_0xdab4('0x85')](_0x21e41c['id'])){if(!_['isNil'](_0x3ca35e[_0xdab4('0x82')][_0x24fa99][_0x24fc7a[_0x1561ac]])){var _0x2e6ed9=_['trim'](_0x3ca35e[_0xdab4('0x82')][_0x24fa99][_0x24fc7a[_0x1561ac]][_0xdab4('0x87')](/"/g,'\x27'));var _0x5eee92=phoneDescriptions['find'](_0x4e53f3=>_0x4e53f3[_0xdab4('0x92')]===_0x21e41c['id']);if(!_[_0xdab4('0x20')](_0x5eee92)){var _0x4ac874=_[_0xdab4('0x86')](_0x3ca35e[_0xdab4('0x82')][_0x24fa99][_0x24fc7a[_0x5eee92[_0xdab4('0x93')]]][_0xdab4('0x87')](/"/g,'\x27'));if(!_[_0xdab4('0x20')](_0x4ac874))_0x2e6ed9=_0x2e6ed9+'§'+_0x4ac874;}if(_0x4bda76=='')_0x4bda76=_0x2e6ed9;else _0x4bda76+='|'+_0x2e6ed9;}_0x4a3d7d['push'](_0x21e41c['id']+':'+_0x4bda76);_0x133859[_0x21e41c['id']]=0x1;}}}}if(hasAdditionalPhones){_0x527277[_0xdab4('0x1f')]('\x22'+_0x4a3d7d[_0xdab4('0x14')](';')+'\x22');}if(_0x417ff1[_0xdab4('0x1b')]){handleError(_0x3ca35e[_0xdab4('0x82')][_0x24fa99],{'code':'SystemRow','message':_0x417ff1[_0xdab4('0x14')]()});}else{fs[_0xdab4('0x94')](_0x7c4dc1,_0x527277[_0xdab4('0x14')]()+'\x0a');}_0x527277=[];}if(!(stats[_0xdab4('0x83')]%0xc8)){socket[_0xdab4('0x95')](_0xdab4('0x96')+_0x15212a,stats);stats[_0xdab4('0x5d')]=[];}}if(stopped){logger['info'](_0xdab4('0x97'));_0xb9485e[_0xdab4('0x98')]();}}catch(_0xb64f98){handleError(_0x3ca35e['data'][_0x24fa99],{'code':'SystemError','message':_0xb64f98[_0xdab4('0x5c')]});logger[_0xdab4('0x63')]('step',_0xb64f98[_0xdab4('0x5c')]);}},'complete':function(){try{var _0x5741b2=[];var _0x232043=[];var _0x6f4dc7=_0xdab4('0x36');if(_0x1da5a6['duplicates']&&_0x1da5a6[_0xdab4('0x99')]['length']){_0x6f4dc7=_0xdab4('0x9a')+_0x15212a;_0x5741b2[_0xdab4('0x1f')](_0xdab4('0x9b')+_0x6f4dc7+_0xdab4('0x9c'));}tmp_campaigns=_0xdab4('0x9d')+_0x15212a;tmp_voice_queues=_0xdab4('0x9e')+_0x15212a;_0x232043[_0xdab4('0x1f')](_0xdab4('0x9b')+tmp_campaigns+_0xdab4('0x9f'));_0x232043[_0xdab4('0x1f')](_0xdab4('0x9b')+tmp_voice_queues+_0xdab4('0x9f'));BPromise[_0xdab4('0xa0')](_0x232043,handleTZQuery)[_0xdab4('0x1d')](function(_0x4062a6){updateTzCampaigns(_0x1da5a6['ListId'])[_0xdab4('0x1d')](function(_0x376e31){updateTzVoiceQueues(_0x1da5a6[_0xdab4('0x47')])[_0xdab4('0x1d')](function(_0x975446){if(hasTZ)_0x4a9742=_0x4a9742[_0xdab4('0x87')]('dialTimezone',_0xdab4('0xa1'));var _0x27147b=util[_0xdab4('0xd')](_0xdab4('0xa2'),_0x7c4dc1,_0x6f4dc7,_0x4a9742,_0x1da5a6['ListId'],_0x1da5a6[_0xdab4('0xa3')]||null,NOW,NOW);if(_[_0xdab4('0x20')](_0x24fc7a[_0xdab4('0x30')])){_0x27147b+=_0xdab4('0xa4');}_0x5741b2[_0xdab4('0x1f')](_0x27147b);if(_0x1da5a6['duplicates']&&_0x1da5a6[_0xdab4('0x99')][_0xdab4('0x1b')]){_0x5741b2[_0xdab4('0x1f')](insertCmContact(_0x1da5a6['ListId'],_0x6f4dc7,_0x1da5a6[_0xdab4('0x99')],_0x24fc7a));_0x5741b2['push'](_0xdab4('0xa5')+_0x6f4dc7+';');}BPromise[_0xdab4('0xa0')](_0x5741b2,handleQuery)[_0xdab4('0x1d')](function(_0xa7f3cd){BPromise[_0xdab4('0x1c')]([handleAdditionalPhones()])[_0xdab4('0x1d')](function(){_0x5741b2=[];for(var _0x35199c=0x0;_0x35199c\x20\x20');}var _0x157211=path[_0xdab4('0x14')](config[_0xdab4('0x7a')],_0xdab4('0x7b'),process[_0xdab4('0xb0')][0x2]);if(!fs[_0xdab4('0xb1')](_0x157211)){throw new Error(_0xdab4('0xb2'));}var _0x5ab195={};try{_0x5ab195=JSON[_0xdab4('0xb3')](process[_0xdab4('0xb0')][0x3]);if(!_0x5ab195[_0xdab4('0x77')]){throw new Error(_0xdab4('0xb4'));}if(!_0x5ab195[_0xdab4('0x77')][_0xdab4('0x12')]){throw new Error(_0xdab4('0xb5'));}if(!_0x5ab195[_0xdab4('0x77')][_0xdab4('0x91')]){throw new Error('firstName\x20is\x20mandatory');}var _0x7a22ca=0x0;if(_0x5ab195[_0xdab4('0x77')][_0xdab4('0x33')]){_0x7a22ca=0x1;}if(!_0x5ab195[_0xdab4('0x47')]){throw new Error(_0xdab4('0xb6'));}}catch(_0x590610){throw new Error('body\x20id\x20mandatory');}var _0x5a30f8=[];try{_0x5a30f8=_[_0xdab4('0xb7')](JSON[_0xdab4('0xb3')](process['argv'][0x4]),'id');}catch(_0x448e16){logger[_0xdab4('0x5a')]('No\x20agent\x20available');}main(_0x157211,_0x5ab195,_0x5a30f8,_0x7a22ca);}validate();process['on'](_0xdab4('0xb8'),handleStop);process['on'](_0xdab4('0xb9'),handleUncaughtException); \ No newline at end of file +var _0x1eab=['name','_description','parse','createReadStream','data','rows','find','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','email','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','hasOwnProperty','emit','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','contactTypeId','orderBy','VoiceQueueId','campaigns','campaigns_has_cm_blacklists','CampaignId','voice_queues_has_cm_blacklists','finish','affectedRows','contact:import:','unlink','complete','argv','server/files/tmp','existsSync','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','uncaughtException','lodash','papaparse','util','bluebird','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','from','.id\x20=\x20','where','\x20=\x20','join','CmContact','findAll','AdditionalPhones','length','push','all','then','split','isNil','filter','CmContactHasItem','findOne','update','updated','PHONE','inserted','cm_contacts.scheduledat','cm_contacts.updatedAt','insert','into','fromQuery','phone','ContactId','createdAt','priority','UserId','recallme','select','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.ListId','cm_hopper_black','ListId','cm_contacts.phone','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','cm_hopper','scheduledat','cm_contacts.id','updatedAt','field','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','keys','scheduledAt',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','Received\x20SIGINT','message','exit','errors','code','info','query','spread','catch','error','campaigns.id','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','utcOffset','set','offset','main','stringify','send','start','binding','clone','root','.csv','includes','header'];(function(_0x4a9050,_0x525966){var _0x23c28e=function(_0x57c714){while(--_0x57c714){_0x4a9050['push'](_0x4a9050['shift']());}};_0x23c28e(++_0x525966);}(_0x1eab,0x1ad));var _0xb1ea=function(_0x44d323,_0x5f2ee1){_0x44d323=_0x44d323-0x0;var _0x3dd967=_0x1eab[_0x44d323];return _0x3dd967;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xb1ea('0x0'));var Papa=require(_0xb1ea('0x1'));var util=require(_0xb1ea('0x2'));var BPromise=require(_0xb1ea('0x3'));var moment=require('moment');var squel=require('squel');var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0xb1ea('0x4'));var shared=require(_0xb1ea('0x5'));var logger=require(_0xb1ea('0x6'))(_0xb1ea('0x7'));config[_0xb1ea('0x8')]=_[_0xb1ea('0x9')](config[_0xb1ea('0x8')],{'host':_0xb1ea('0xa'),'port':0x18eb});var socket=require(_0xb1ea('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()[_0xb1ea('0xc')](_0xb1ea('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xb1ea('0xc')](_0xb1ea('0xd'));function isEmail(_0x84cd81){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))*$/[_0xb1ea('0xe')](_0x84cd81);}function selectNotIn(_0x1ad300,_0x302ab3,_0x4df2a1,_0x32b88b,_0x809491){return squel['select']()['field']('phone')[_0xb1ea('0xf')](_0x32b88b)['join'](_0x302ab3,null,_0x302ab3+_0xb1ea('0x10')+_0x32b88b+'.'+_0x4df2a1)[_0xb1ea('0x11')](_0x32b88b+'.'+_0x4df2a1+_0xb1ea('0x12')+_0x1ad300+'.'+_0x4df2a1)[_0xb1ea('0x11')](_0x302ab3+'.dialCheckDuplicateType\x20IN\x20('+_0x809491[_0xb1ea('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3dd70e,_0x2807d6){promisesAdditionalPhones=[];return db[_0xb1ea('0x14')][_0xb1ea('0x15')]({'raw':!![],'attributes':['id',_0xb1ea('0x16')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x446e87){if(_0x446e87!==null){var _0xdd8849=[];for(var _0x371c24=0x0;_0x371c24<_0x446e87[_0xb1ea('0x17')];_0x371c24++){var _0xc998de=_0x446e87[_0x371c24];_0xdd8849[_0xb1ea('0x18')](insertAdditionalPhones(_0xc998de));}}Promise[_0xb1ea('0x19')](_0xdd8849)[_0xb1ea('0x1a')](function(){_0x3dd70e({'val':0x1});});});});}function insertAdditionalPhones(_0x3fd34c){return new Promise(function(_0x157728,_0x6b044a){var _0x2c72e8=_0x3fd34c[_0xb1ea('0x16')];var _0x304ecc=_0x2c72e8[_0xb1ea('0x1b')](';');var _0x18b8ef=[];orderBy=0x0;for(var _0x2a12ed=0x0;_0x2a12ed<_0x304ecc['length'];_0x2a12ed++){_0x18b8ef['push'](splitAdditionalPhone(_0x3fd34c['id'],_0x304ecc[_0x2a12ed]));}Promise[_0xb1ea('0x19')](_0x18b8ef)[_0xb1ea('0x1a')](function(){_0x157728({'val':_0x304ecc[_0xb1ea('0x17')]});});});}function splitAdditionalPhone(_0x17e720,_0x83a7ed){return new Promise(function(_0x5eb3e0,_0x4be964){var _0x2d250a=_0x83a7ed['split'](':');var _0x27161c=_0x2d250a[0x0];var _0x2d3be9=_0x2d250a[0x1];if(!_[_0xb1ea('0x1c')](_0x2d3be9)){var _0x19c430=_0x2d3be9[_0xb1ea('0x1b')]('|');var _0x1dbb43=[];for(var _0xfa14bf=0x0;_0xfa14bf<_0x19c430['length'];_0xfa14bf++){if(_0x19c430[_0xfa14bf]!==''){var _0x37829b=_[_0xb1ea('0x1d')](promisesAdditionalPhones,{'contactId':_0x17e720,'phone':_0x19c430[_0xfa14bf]});if(_0x37829b[_0xb1ea('0x17')]==0x0){orderBy++;promisesAdditionalPhones[_0xb1ea('0x18')]({'contactId':_0x17e720,'contactTypeId':_0x27161c,'phone':_0x19c430[_0xfa14bf],'orderBy':orderBy});}}}_0x5eb3e0({'ok':0x1});}else _0x5eb3e0({'res':0x0});});}function createAdditionalPhone(_0x5d1bcf,_0x330bed,_0x36f808,_0x44797b){var _0x2bb978='';var _0x39ea3f='';var _0x242097=_0x36f808[_0xb1ea('0x1b')]('§');_0x2bb978=_0x242097[0x0];if(_0x242097[_0xb1ea('0x17')]==0x2)_0x39ea3f=_0x242097[0x1];return new Promise(function(_0x4a9459,_0x5bd84e){return db[_0xb1ea('0x1e')][_0xb1ea('0x1f')]({'where':{'CmContactId':_0x5d1bcf,'item':_0x2bb978}})['then'](function(_0x4a90b3){if(_0x4a90b3){return db[_0xb1ea('0x1e')][_0xb1ea('0x20')]({'ItemTypeId':_0x330bed,'description':_0x39ea3f,'OrderBy':_0x44797b},{'where':{'CmContactId':_0x5d1bcf,'item':_0x2bb978}})[_0xb1ea('0x1a')](function(_0x1dad92){_0x4a9459({'res':_0xb1ea('0x21')});});}else{return db[_0xb1ea('0x1e')]['create']({'CmContactId':_0x5d1bcf,'item':_0x2bb978,'description':_0x39ea3f,'ItemTypeId':_0x330bed,'OrderBy':_0x44797b,'ItemClass':_0xb1ea('0x22')})['then'](function(_0x366aa2){_0x4a9459({'res':_0xb1ea('0x23')});});}});});}function insertCmHopper(_0x90e071,_0x39e20d,_0xb7b964,_0x2d80fd,_0x30dc03){var _0x8f4919=['cm_contacts.phone',_0xb1ea('0x24'),'cm_contacts.id','cm_contacts.ListId',_0x39e20d+'.'+_0x2d80fd,'cm_contacts.createdAt',_0xb1ea('0x25'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x30dc03+'\x22'];return squel[_0xb1ea('0x26')]()[_0xb1ea('0x27')]('cm_hopper')[_0xb1ea('0x28')]([_0xb1ea('0x29'),'scheduledat',_0xb1ea('0x2a'),'ListId',_0x2d80fd,_0xb1ea('0x2b'),'updatedAt',_0xb1ea('0x2c'),_0xb1ea('0x2d'),_0xb1ea('0x2e')],squel[_0xb1ea('0x2f')]()[_0xb1ea('0x30')](_0x8f4919)[_0xb1ea('0xf')](_0x39e20d)[_0xb1ea('0x13')](_0xb1ea('0x31'),null,_0xb1ea('0x32')+_0x39e20d+_0xb1ea('0x33'))[_0xb1ea('0x13')](_0xb7b964,null,_0xb7b964+_0xb1ea('0x10')+_0x39e20d+'.'+_0x2d80fd)[_0xb1ea('0x11')](_0x39e20d+_0xb1ea('0x34'),_0x90e071)[_0xb1ea('0x11')](_0xb1ea('0x35'),NOW)[_0xb1ea('0x11')](_0xb1ea('0x36'),selectNotIn(_0x39e20d,_0xb7b964,_0x2d80fd,'cm_hopper',[_0xb1ea('0x37'),_0xb1ea('0x38')]))[_0xb1ea('0x11')](_0xb1ea('0x36'),selectNotIn(_0x39e20d,_0xb7b964,_0x2d80fd,'cm_hopper',[_0xb1ea('0x37')])))[_0xb1ea('0x39')]();}function insertCmHopperBlack(_0x37d1ee,_0x4af53a,_0x3ce1fa,_0x14b7dc){var _0x14b0da=['cm_contacts.phone','cm_contacts.id',_0xb1ea('0x3a'),_0x4af53a+'.'+_0x14b7dc,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel['insert']()[_0xb1ea('0x27')](_0xb1ea('0x3b'))[_0xb1ea('0x28')]([_0xb1ea('0x29'),_0xb1ea('0x2a'),_0xb1ea('0x3c'),_0x14b7dc,_0xb1ea('0x2b'),'updatedAt'],squel[_0xb1ea('0x2f')]()[_0xb1ea('0x30')](_0x14b0da)['from'](_0x4af53a)['join'](_0xb1ea('0x31'),null,'cm_contacts.ListId\x20=\x20'+_0x4af53a+_0xb1ea('0x33'))[_0xb1ea('0x13')](_0x3ce1fa,null,_0x3ce1fa+_0xb1ea('0x10')+_0x4af53a+'.'+_0x14b7dc)['where'](_0x4af53a+_0xb1ea('0x34'),_0x37d1ee)[_0xb1ea('0x11')](_0xb1ea('0x35'),NOW)[_0xb1ea('0x11')](_0xb1ea('0x36'),squel[_0xb1ea('0x2f')]()['field'](_0xb1ea('0x29'))[_0xb1ea('0xf')]('cm_hopper_black')[_0xb1ea('0x11')]('ListId\x20=\x20?',_0x37d1ee)[_0xb1ea('0x11')](_0x14b7dc+_0xb1ea('0x12')+_0x4af53a+'.'+_0x14b7dc)))[_0xb1ea('0x39')]();}function insertTzCmHopper(_0x10e63d,_0x437790,_0x13c394,_0x38ad44,_0x50350a,_0x3f53a1){var _0x419bbc=[_0xb1ea('0x3d'),_0xb1ea('0x3e')+_0x3f53a1+_0xb1ea('0x3f'),'cm_contacts.id',_0xb1ea('0x3a'),_0x437790+'.'+_0x38ad44,_0xb1ea('0x40'),_0xb1ea('0x25'),_0xb1ea('0x41'),_0xb1ea('0x42'),'\x22'+_0x50350a+'\x22'];var _0x329044=squel[_0xb1ea('0x26')]()[_0xb1ea('0x27')](_0xb1ea('0x43'))[_0xb1ea('0x28')]([_0xb1ea('0x29'),_0xb1ea('0x44'),_0xb1ea('0x2a'),_0xb1ea('0x3c'),_0x38ad44,_0xb1ea('0x2b'),'updatedAt',_0xb1ea('0x2c'),'UserId',_0xb1ea('0x2e')],squel[_0xb1ea('0x2f')]()['fields'](_0x419bbc)[_0xb1ea('0xf')](_0x437790)[_0xb1ea('0x13')](_0xb1ea('0x31'),null,'cm_contacts.ListId\x20=\x20'+_0x437790+'.CmListId')['join'](_0x13c394,null,_0x13c394+_0xb1ea('0x10')+_0x437790+'.'+_0x38ad44)[_0xb1ea('0x13')](_0x3f53a1,null,_0x3f53a1+_0xb1ea('0x10')+_0x437790+'.'+_0x38ad44)[_0xb1ea('0x11')](_0x437790+'.CmListId\x20=\x20?',_0x10e63d)['where']('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xb1ea('0x36'),selectNotIn(_0x437790,_0x13c394,_0x38ad44,_0xb1ea('0x43'),[_0xb1ea('0x37'),_0xb1ea('0x38')]))['where'](_0xb1ea('0x36'),selectNotIn(_0x437790,_0x13c394,_0x38ad44,'cm_hopper',[_0xb1ea('0x37')])))['toString']();return _0x329044;}function insertTzCmHopperBlack(_0x36a72e,_0x4f6b06,_0x4ded13,_0x1bcae0){var _0x33140f=[_0xb1ea('0x3d'),_0xb1ea('0x45'),_0xb1ea('0x3a'),_0x4f6b06+'.'+_0x1bcae0,_0xb1ea('0x40'),_0xb1ea('0x25')];return squel[_0xb1ea('0x26')]()['into'](_0xb1ea('0x3b'))[_0xb1ea('0x28')]([_0xb1ea('0x29'),_0xb1ea('0x2a'),'ListId',_0x1bcae0,_0xb1ea('0x2b'),_0xb1ea('0x46')],squel[_0xb1ea('0x2f')]()[_0xb1ea('0x30')](_0x33140f)[_0xb1ea('0xf')](_0x4f6b06)[_0xb1ea('0x13')](_0xb1ea('0x31'),null,'cm_contacts.ListId\x20=\x20'+_0x4f6b06+_0xb1ea('0x33'))[_0xb1ea('0x13')](_0x4ded13,null,_0x4ded13+_0xb1ea('0x10')+_0x4f6b06+'.'+_0x1bcae0)[_0xb1ea('0x11')](_0x4f6b06+'.CmListId\x20=\x20?',_0x36a72e)[_0xb1ea('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xb1ea('0x11')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xb1ea('0x2f')]()[_0xb1ea('0x47')](_0xb1ea('0x29'))[_0xb1ea('0xf')]('cm_hopper_black')[_0xb1ea('0x11')](_0xb1ea('0x48'),_0x36a72e)[_0xb1ea('0x11')](_0x1bcae0+_0xb1ea('0x12')+_0x4f6b06+'.'+_0x1bcae0)))[_0xb1ea('0x39')]();}function insertCmHopperAdditionalPhones(_0x456036){var _0x410f4b=[_0xb1ea('0x49'),'cm_contact_has_items.item',_0xb1ea('0x4a'),_0xb1ea('0x4b'),_0xb1ea('0x4c')];return squel[_0xb1ea('0x26')]()[_0xb1ea('0x27')](_0xb1ea('0x4d'))[_0xb1ea('0x28')]([_0xb1ea('0x4e'),'phone','OrderBy',_0xb1ea('0x2b'),_0xb1ea('0x46')],squel['select']()[_0xb1ea('0x30')](_0x410f4b)['from']('cm_hopper')[_0xb1ea('0x13')](_0xb1ea('0x31'),null,_0xb1ea('0x4f'))[_0xb1ea('0x13')]('cm_contact_has_items',null,_0xb1ea('0x50'))['where']('cm_hopper.ListId\x20=\x20?',_0x456036)['where']('cm_contacts.createdAt\x20=\x20?',NOW))[_0xb1ea('0x39')]();}function insertCmContact(_0x400256,_0x4e9bf3,_0x166dfc,_0x195019){var _0x1f0909=_[_0xb1ea('0x51')](_[_0xb1ea('0x52')](_0x195019),[_0xb1ea('0x3c'),'CompanyId',_0xb1ea('0x2b'),_0xb1ea('0x46'),_0xb1ea('0x53')]);return squel['insert']()[_0xb1ea('0x27')]('cm_contacts')[_0xb1ea('0x28')](_0x1f0909,squel[_0xb1ea('0x2f')]()['fields'](_0x1f0909)[_0xb1ea('0xf')](_0x4e9bf3)[_0xb1ea('0x11')]('('+_0x166dfc[_0xb1ea('0x13')](',')+_0xb1ea('0x54'),squel[_0xb1ea('0x2f')]()[_0xb1ea('0x30')](_0x166dfc)[_0xb1ea('0xf')](_0xb1ea('0x31'))['where'](_0xb1ea('0x48'),_0x400256)['where'](_0xb1ea('0x55')))[_0xb1ea('0x11')](_0xb1ea('0x56'),squel[_0xb1ea('0x2f')]()[_0xb1ea('0x47')](_0xb1ea('0x57'),_0xb1ea('0x58'))[_0xb1ea('0xf')](_0x4e9bf3)[_0xb1ea('0x59')](_0x166dfc[_0xb1ea('0x13')](','))))[_0xb1ea('0x39')]();}function handleStop(){logger['info'](_0xb1ea('0x5a'));stopped=!![];}function handleUncaughtException(_0x3679b0){logger['error'](_0x3679b0[_0xb1ea('0x5b')]);process[_0xb1ea('0x5c')](0x1);}function handleError(_0x22cce,_0xd8eef6){stats[_0xb1ea('0x5d')][_0xb1ea('0x18')]({'name':_0xd8eef6[_0xb1ea('0x5e')],'message':_0xd8eef6[_0xb1ea('0x5b')],'row':_0x22cce});}function handleQuery(_0x3a0ea6){logger[_0xb1ea('0x5f')](_0x3a0ea6);return db['sequelize'][_0xb1ea('0x60')](_0x3a0ea6)[_0xb1ea('0x61')](function(_0x31ca92){results[_0xb1ea('0x18')](_0x31ca92);})[_0xb1ea('0x62')](function(_0x4b4ad9){logger[_0xb1ea('0x63')](_0x4b4ad9[_0xb1ea('0x5b')]);});}function updateTzCampaigns(_0x375b01){return new Promise(function(_0x4ac579,_0x9749eb){var _0x829122=squel['select']()[_0xb1ea('0x30')]([_0xb1ea('0x64'),'campaigns.dialTimezone'])[_0xb1ea('0xf')]('campaigns')[_0xb1ea('0x13')](_0xb1ea('0x65'),null,_0xb1ea('0x66'))['where'](_0xb1ea('0x67')+_0x375b01);db[_0xb1ea('0x68')][_0xb1ea('0x60')](_0x829122[_0xb1ea('0x39')]())[_0xb1ea('0x61')](function(_0x57109a){var _0x46a164=[];for(var _0x534f65=0x0;_0x534f65<_0x57109a['length'];_0x534f65++){_0x46a164[_0xb1ea('0x18')](getTimezoneData(_0x57109a[_0x534f65],tmp_campaigns));}BPromise[_0xb1ea('0x19')](_0x46a164)[_0xb1ea('0x1a')](function(){_0x4ac579({'val':0x1});});})[_0xb1ea('0x62')](function(_0x289672){logger[_0xb1ea('0x63')](_0x289672[_0xb1ea('0x5b')]);_0x4ac579({'val':0x0});});});}function updateTzVoiceQueues(_0x195ec9){return new Promise(function(_0x5ed1db,_0x353cd9){var _0x5d464a=squel['select']()[_0xb1ea('0x30')]([_0xb1ea('0x69'),_0xb1ea('0x6a')])[_0xb1ea('0xf')](_0xb1ea('0x6b'))['join'](_0xb1ea('0x6c'),null,_0xb1ea('0x6d'))[_0xb1ea('0x11')](_0xb1ea('0x6e')+_0x195ec9);db[_0xb1ea('0x68')]['query'](_0x5d464a[_0xb1ea('0x39')]())[_0xb1ea('0x61')](function(_0x4f6853){var _0x191a7d=[];for(var _0x3576d2=0x0;_0x3576d2<_0x4f6853[_0xb1ea('0x17')];_0x3576d2++){_0x191a7d[_0xb1ea('0x18')](getTimezoneData(_0x4f6853[_0x3576d2],tmp_voice_queues));}BPromise[_0xb1ea('0x19')](_0x191a7d)['then'](function(){_0x5ed1db({'val':0x1});});})[_0xb1ea('0x62')](function(_0x55701d){logger[_0xb1ea('0x63')](_0x55701d['message']);_0x5ed1db({'val':0x0});});});}function getTimezoneData(_0x5acde2,_0x23b20a){return new Promise(function(_0x2690aa,_0x3b3f38){var _0x3ff27d=shared[_0xb1ea('0x6f')];var _0xa83deb=_0x3ff27d[_0x5acde2[_0xb1ea('0x70')]];if(_[_0xb1ea('0x1c')](_0xa83deb)){_0x2690aa({'ret':0x1});}else{var _0x5ddd47=_0xa83deb[_0xb1ea('0x71')];var _0x2e724f=squel[_0xb1ea('0x26')]()[_0xb1ea('0x27')](_0x23b20a)['set']('id',_0x5acde2['id'])[_0xb1ea('0x72')](_0xb1ea('0x73'),_0x5ddd47)['set'](_0xb1ea('0x70'),_0x5acde2[_0xb1ea('0x70')])[_0xb1ea('0x39')]();return db['sequelize']['query'](_0x2e724f)[_0xb1ea('0x61')](function(_0x414476){_0x2690aa({'ret':0x1});})[_0xb1ea('0x62')](function(_0x27aaa8){logger[_0xb1ea('0x63')](_0x27aaa8[_0xb1ea('0x5b')]);_0x3b3f38({'ret':0x1});});}});}function handleTZQuery(_0x348e70){logger['info'](_0x348e70);return db[_0xb1ea('0x68')][_0xb1ea('0x60')](_0x348e70)[_0xb1ea('0x61')](function(_0x1a7a2c){})[_0xb1ea('0x62')](function(_0x1400fd){logger['error'](_0x1400fd['message']);});}function main(_0x3091a7,_0x16fc39,_0x330c2a,_0x364748){logger['info'](_0xb1ea('0x74'),_0x3091a7,JSON[_0xb1ea('0x75')](_0x16fc39));process[_0xb1ea('0x76')](_0xb1ea('0x77'));var _0x33a0a0=_0x16fc39[_0xb1ea('0x78')];var _0x40f056=_[_0xb1ea('0x79')](_0x33a0a0);var _0x39fc7e=_0x16fc39['socket_timestamp'];var _0xad9114=path[_0xb1ea('0x13')](config[_0xb1ea('0x7a')],'server/files/tmp',_0x39fc7e+_0xb1ea('0x7b'));hasTZ=_['keys'](_0x33a0a0)[_0xb1ea('0x7c')](_0xb1ea('0x70'));var _0x546434=_[_0xb1ea('0x52')](_0x33a0a0)['join']();logger[_0xb1ea('0x5f')](_0xb1ea('0x7d'),_0x546434);db['ContactItemType'][_0xb1ea('0x15')]({'raw':!![],'attributes':['id',_0xb1ea('0x7e')]})['then'](function(_0x2b4e33){for(var _0x4587c7=0x0;_0x4587c7<_0x2b4e33['length'];_0x4587c7++){if(_0x2b4e33[_0x4587c7][_0xb1ea('0x7e')]in _0x33a0a0){contactItemTypes[_0xb1ea('0x18')](_0x2b4e33[_0x4587c7]);delete _0x40f056[_0x2b4e33[_0x4587c7][_0xb1ea('0x7e')]];hasAdditionalPhones=!![];}for(var _0x1fefba in _0x33a0a0){if(_0x2b4e33[_0x4587c7][_0xb1ea('0x7e')]+_0xb1ea('0x7f')===_0x1fefba){phoneDescriptions[_0xb1ea('0x18')]({'itemTypeId':_0x2b4e33[_0x4587c7]['id'],'description':_0x1fefba});delete _0x40f056[_0x1fefba];}}}if(hasAdditionalPhones)_0x40f056[_0xb1ea('0x16')]='';var _0x5150dc=_[_0xb1ea('0x52')](_0x40f056)[_0xb1ea('0x13')]();logger[_0xb1ea('0x5f')](_0xb1ea('0x7d'),_0x5150dc);fs['writeFileSync'](_0xad9114,_0x5150dc+'\x0a');Papa[_0xb1ea('0x80')](fs[_0xb1ea('0x81')](_0x3091a7),{'header':!![],'skipEmptyLines':!![],'step':function(_0xd3a25f,_0x10f796){try{for(var _0x23a0b9=0x0,_0x36877d=[];_0x23a0b9<_0xd3a25f[_0xb1ea('0x82')]['length'];_0x23a0b9++){stats[_0xb1ea('0x83')]+=0x1;if(_0xd3a25f[_0xb1ea('0x5d')][_0x23a0b9]){handleError(_0xd3a25f[_0xb1ea('0x82')][_0x23a0b9],_0xd3a25f[_0xb1ea('0x5d')][_0x23a0b9]);}else{var _0x44d588=[];var _0x167f8e=[];var _0x452761={};for(var _0x37327d in _0x33a0a0){let _0x1debe7=contactItemTypes[_0xb1ea('0x84')](_0x5c9e9e=>_0x5c9e9e['name']===_0x37327d);let _0x429e68=contactItemTypes[_0xb1ea('0x84')](_0x231df2=>_0x231df2[_0xb1ea('0x7e')]+_0xb1ea('0x7f')===_0x37327d);if(_[_0xb1ea('0x1c')](_0x1debe7)&&_['isNil'](_0x429e68)){if(_0x33a0a0['hasOwnProperty'](_0x37327d)){if(_0xd3a25f[_0xb1ea('0x82')][_0x23a0b9][_0x33a0a0[_0x37327d]]){var _0x581e23=_[_0xb1ea('0x85')](_0xd3a25f[_0xb1ea('0x82')][_0x23a0b9][_0x33a0a0[_0x37327d]][_0xb1ea('0x86')](/"/g,'\x27'));switch(_0x37327d){case _0xb1ea('0x44'):var _0x4a7798=moment(_0x581e23,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x4a7798[_0xb1ea('0x87')]()){_0x36877d[_0xb1ea('0x18')]('\x22'+_0x581e23+'\x22');}else{_0x44d588[_0xb1ea('0x18')](_0xb1ea('0x88'));}break;case _0xb1ea('0x2c'):var _0x3ad89d=parseInt(_0x581e23);_0x581e23=_[_0xb1ea('0x89')](_0x3ad89d)||_0x3ad89d<0x0||_0x3ad89d>0x4?_0x364748?0x3:0x2:_0x3ad89d;_0x36877d['push']('\x22'+_0x581e23+'\x22');break;case _0xb1ea('0x2d'):var _0x442e22=parseInt(_0x581e23);if(_[_0xb1ea('0x8a')](_0x442e22)&&_[_0xb1ea('0x7c')](_0x330c2a,_0x442e22)){_0x36877d[_0xb1ea('0x18')]('\x22'+_0x442e22+'\x22');}else{_0x44d588['push']('agent\x20not\x20exists');}break;case _0xb1ea('0x8b'):if(isEmail(_0x581e23)){_0x36877d['push']('\x22'+_0x581e23+'\x22');}else{_0x44d588[_0xb1ea('0x18')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x10bb7e=moment(_0x581e23,_0xb1ea('0x8c'),!![]);if(_0x10bb7e['isValid']()){_0x36877d[_0xb1ea('0x18')]('\x22'+_0x581e23+'\x22');}else{_0x44d588[_0xb1ea('0x18')](_0xb1ea('0x8d'));}break;case _0xb1ea('0x70'):var _0xfd7d18=shared[_0xb1ea('0x6f')];var _0x5da673=_0xfd7d18[_0x581e23];if(!_[_0xb1ea('0x1c')](_0x5da673)){var _0x61eb14=_0x5da673[_0xb1ea('0x71')];_0x36877d[_0xb1ea('0x18')]('\x22'+_0x581e23+'\x22');_0x36877d[_0xb1ea('0x18')]('\x22'+_0x61eb14+'\x22');}break;default:_0x36877d[_0xb1ea('0x18')]('\x22'+_0x581e23+'\x22');}}else{switch(_0x37327d){case'firstName':case _0xb1ea('0x29'):_0x44d588[_0xb1ea('0x18')](_0x37327d+_0xb1ea('0x8e'));break;default:_0x36877d[_0xb1ea('0x18')]('\x22\x22');}}}}else{var _0x39bd09='';if(!_[_0xb1ea('0x1c')](_0x1debe7)){if(!_0x452761[_0xb1ea('0x8f')](_0x1debe7['id'])){if(!_[_0xb1ea('0x1c')](_0xd3a25f[_0xb1ea('0x82')][_0x23a0b9][_0x33a0a0[_0x37327d]])){var _0x581e23=_['trim'](_0xd3a25f[_0xb1ea('0x82')][_0x23a0b9][_0x33a0a0[_0x37327d]][_0xb1ea('0x86')](/"/g,'\x27'));var _0x44a01e=phoneDescriptions['find'](_0x1674b6=>_0x1674b6['itemTypeId']===_0x1debe7['id']);if(!_[_0xb1ea('0x1c')](_0x44a01e)){var _0x42b73f=_['trim'](_0xd3a25f[_0xb1ea('0x82')][_0x23a0b9][_0x33a0a0[_0x44a01e['description']]]['replace'](/"/g,'\x27'));if(!_['isNil'](_0x42b73f))_0x581e23=_0x581e23+'§'+_0x42b73f;}if(_0x39bd09=='')_0x39bd09=_0x581e23;else _0x39bd09+='|'+_0x581e23;}_0x167f8e[_0xb1ea('0x18')](_0x1debe7['id']+':'+_0x39bd09);_0x452761[_0x1debe7['id']]=0x1;}}}}if(hasAdditionalPhones){_0x36877d[_0xb1ea('0x18')]('\x22'+_0x167f8e['join'](';')+'\x22');}if(_0x44d588['length']){handleError(_0xd3a25f[_0xb1ea('0x82')][_0x23a0b9],{'code':'SystemRow','message':_0x44d588['join']()});}else{fs['appendFileSync'](_0xad9114,_0x36877d[_0xb1ea('0x13')]()+'\x0a');}_0x36877d=[];}if(!(stats['rows']%0xc8)){socket[_0xb1ea('0x90')]('contact:import:'+_0x39fc7e,stats);stats[_0xb1ea('0x5d')]=[];}}if(stopped){logger[_0xb1ea('0x5f')](_0xb1ea('0x91'));_0x10f796[_0xb1ea('0x92')]();}}catch(_0x181333){handleError(_0xd3a25f[_0xb1ea('0x82')][_0x23a0b9],{'code':_0xb1ea('0x93'),'message':_0x181333['message']});logger[_0xb1ea('0x63')](_0xb1ea('0x94'),_0x181333[_0xb1ea('0x5b')]);}},'complete':function(){try{var _0x3c2300=[];var _0x20a1d9=[];var _0x332b2c=_0xb1ea('0x31');if(_0x16fc39[_0xb1ea('0x95')]&&_0x16fc39[_0xb1ea('0x95')][_0xb1ea('0x17')]){_0x332b2c=_0xb1ea('0x96')+_0x39fc7e;_0x3c2300[_0xb1ea('0x18')](_0xb1ea('0x97')+_0x332b2c+_0xb1ea('0x98'));}tmp_campaigns=_0xb1ea('0x99')+_0x39fc7e;tmp_voice_queues=_0xb1ea('0x9a')+_0x39fc7e;_0x20a1d9[_0xb1ea('0x18')](_0xb1ea('0x97')+tmp_campaigns+_0xb1ea('0x9b'));_0x20a1d9[_0xb1ea('0x18')](_0xb1ea('0x97')+tmp_voice_queues+_0xb1ea('0x9b'));BPromise[_0xb1ea('0x9c')](_0x20a1d9,handleTZQuery)['then'](function(_0x4e7e70){updateTzCampaigns(_0x16fc39[_0xb1ea('0x3c')])[_0xb1ea('0x1a')](function(_0x2381f5){updateTzVoiceQueues(_0x16fc39['ListId'])[_0xb1ea('0x1a')](function(_0x13eb37){if(hasTZ)_0x5150dc=_0x5150dc[_0xb1ea('0x86')](_0xb1ea('0x70'),_0xb1ea('0x9d'));var _0x410b02=util[_0xb1ea('0xc')](_0xb1ea('0x9e'),_0xad9114,_0x332b2c,_0x5150dc,_0x16fc39[_0xb1ea('0x3c')],_0x16fc39['CompanyId']||null,NOW,NOW);if(_[_0xb1ea('0x1c')](_0x33a0a0[_0xb1ea('0x44')])){_0x410b02+=_0xb1ea('0x9f');}_0x3c2300['push'](_0x410b02);if(_0x16fc39[_0xb1ea('0x95')]&&_0x16fc39[_0xb1ea('0x95')]['length']){_0x3c2300[_0xb1ea('0x18')](insertCmContact(_0x16fc39[_0xb1ea('0x3c')],_0x332b2c,_0x16fc39[_0xb1ea('0x95')],_0x33a0a0));_0x3c2300[_0xb1ea('0x18')](_0xb1ea('0xa0')+_0x332b2c+';');}BPromise[_0xb1ea('0x9c')](_0x3c2300,handleQuery)[_0xb1ea('0x1a')](function(_0x5c0a78){BPromise['all']([handleAdditionalPhones()])[_0xb1ea('0x1a')](function(){_0x3c2300=[];for(var _0x453ad2=0x0;_0x453ad2\x20\x20');}var _0x578018=path['join'](config['root'],_0xb1ea('0xaf'),process[_0xb1ea('0xae')][0x2]);if(!fs[_0xb1ea('0xb0')](_0x578018)){throw new Error('file\x20doesn\x27t\x20exists');}var _0xa9362a={};try{_0xa9362a=JSON[_0xb1ea('0x80')](process[_0xb1ea('0xae')][0x3]);if(!_0xa9362a['binding']){throw new Error(_0xb1ea('0xb1'));}if(!_0xa9362a[_0xb1ea('0x78')][_0xb1ea('0x29')]){throw new Error(_0xb1ea('0xb2'));}if(!_0xa9362a['binding'][_0xb1ea('0xb3')]){throw new Error(_0xb1ea('0xb4'));}var _0x5913a1=0x0;if(_0xa9362a[_0xb1ea('0x78')][_0xb1ea('0x2d')]){_0x5913a1=0x1;}if(!_0xa9362a[_0xb1ea('0x3c')]){throw new Error(_0xb1ea('0xb5'));}}catch(_0x26627c){throw new Error(_0xb1ea('0xb6'));}var _0x42b78b=[];try{_0x42b78b=_['map'](JSON[_0xb1ea('0x80')](process[_0xb1ea('0xae')][0x4]),'id');}catch(_0x148455){logger[_0xb1ea('0x5f')](_0xb1ea('0xb7'));}main(_0x578018,_0xa9362a,_0x42b78b,_0x5913a1);}validate();process['on']('SIGINT',handleStop);process['on'](_0xb1ea('0xb8'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/import/cm/csvUpdates.js b/server/components/import/cm/csvUpdates.js index a1d0f64..3015581 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 _0x4dfd=['unlink','exit','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','UserId','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','all','then','catch','error','split','filter','CmContactHasItem','update','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','into','ContactId','ListId','updatedAt','priority','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.createdAt','insert','fromQuery','createdAt','cm_contacts','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','group','info','Received\x20SIGINT','errors','code','message','main','stringify','send','start','clone','socket_timestamp','root','server/files/tmp','.csv','body','ContactItemType','findAll','name','writeFileSync','parse','createReadStream','data','rows','find','_description','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','firstName','\x20not\x20specified','itemTypeId','description','appendFileSync','contact:import:','Abort\x20parser','SystemError','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','scheduledat','each','contact','contactTypeId','finish','affectedRows','emit'];(function(_0x56ed51,_0x5acddc){var _0x521784=function(_0x21c2e3){while(--_0x21c2e3){_0x56ed51['push'](_0x56ed51['shift']());}};_0x521784(++_0x5acddc);}(_0x4dfd,0x148));var _0xd4df=function(_0xdfd2d7,_0x148cc0){_0xdfd2d7=_0xdfd2d7-0x0;var _0x54e797=_0x4dfd[_0xdfd2d7];return _0x54e797;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require(_0xd4df('0x0'));var util=require(_0xd4df('0x1'));var BPromise=require(_0xd4df('0x2'));var moment=require(_0xd4df('0x3'));var squel=require(_0xd4df('0x4'));var Redis=require(_0xd4df('0x5'));var db=require(_0xd4df('0x6'))['db'];var config=require(_0xd4df('0x7'));var logger=require(_0xd4df('0x8'))(_0xd4df('0x9'));config[_0xd4df('0xa')]=_[_0xd4df('0xb')](config['redis'],{'host':_0xd4df('0xc'),'port':0x18eb});var socket=require(_0xd4df('0xd'))(new Redis(config[_0xd4df('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()[_0xd4df('0xe')](_0xd4df('0xf'));var tempTableName=_0xd4df('0x10')+moment()[_0xd4df('0xe')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x12f270){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))*$/[_0xd4df('0x11')](_0x12f270);}function selectNotIn(_0x369529,_0x1a845e,_0x18e559,_0x4764dd,_0x5acbcb){return squel[_0xd4df('0x12')]()[_0xd4df('0x13')](_0xd4df('0x14'))[_0xd4df('0x15')](_0x4764dd)[_0xd4df('0x16')](_0x1a845e,null,_0x1a845e+_0xd4df('0x17')+_0x4764dd+'.'+_0x18e559)[_0xd4df('0x18')](_0x4764dd+'.'+_0x18e559+_0xd4df('0x19')+_0x369529+'.'+_0x18e559)[_0xd4df('0x18')](_0x1a845e+'.dialCheckDuplicateType\x20IN\x20('+_0x5acbcb[_0xd4df('0x16')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4e2d80,_0x2bb12d){promisesAdditionalPhones=[];promisesContact=[];return db[_0xd4df('0x1a')][_0xd4df('0x1b')](_0xd4df('0x1c')+tempTableName)[_0xd4df('0x1d')](function(_0x15db6d){if(_0x15db6d!==null){var _0x2404ec=[];for(var _0x345031=0x0;_0x345031<_0x15db6d[_0xd4df('0x1e')];_0x345031++){var _0x5c6ce5=_0x15db6d[_0x345031];if(!_[_0xd4df('0x1f')](_0x5c6ce5[_0xd4df('0x14')])){if(!_[_0xd4df('0x1f')](_0x5c6ce5[_0xd4df('0x20')]))_0x2404ec[_0xd4df('0x21')](insertAdditionalPhones(_0x5c6ce5));promisesContact['push']({'contact':_0x5c6ce5});}}}Promise[_0xd4df('0x22')](_0x2404ec)[_0xd4df('0x23')](function(){_0x4e2d80({'val':0x1});});})[_0xd4df('0x24')](function(_0x525580){logger[_0xd4df('0x25')](_0x525580['message']);});});}function insertAdditionalPhones(_0x12a00a){return new Promise(function(_0x949bd4,_0x2f3f51){var _0x125bee=_0x12a00a[_0xd4df('0x20')];if(_[_0xd4df('0x1f')](_0x125bee))_0x2f3f51({'val':0x0});else{var _0x1913d9=_0x125bee['split'](';');var _0x4daa75=[];orderBy=0x0;for(var _0x544648=0x0;_0x544648<_0x1913d9['length'];_0x544648++){_0x4daa75[_0xd4df('0x21')](splitAdditionalPhone(_0x12a00a['id'],_0x1913d9[_0x544648]));}Promise[_0xd4df('0x22')](_0x4daa75)[_0xd4df('0x23')](function(){_0x949bd4({'val':_0x1913d9[_0xd4df('0x1e')]});});}});}function splitAdditionalPhone(_0xdff551,_0x259268){return new Promise(function(_0x160b1f,_0x31c7c7){var _0x48e34d=_0x259268['split'](':');var _0x5efc0f=_0x48e34d[0x0];var _0x22f6f6=_0x48e34d[0x1];if(_0x22f6f6!==''){var _0x54d937=_0x22f6f6[_0xd4df('0x26')]('|');var _0x3a5883=[];for(var _0x65eccb=0x0;_0x65eccb<_0x54d937[_0xd4df('0x1e')];_0x65eccb++){if(_0x54d937[_0x65eccb]!==''){var _0x1b418d=_[_0xd4df('0x27')](promisesAdditionalPhones,{'contactId':_0xdff551,'phone':_0x54d937[_0x65eccb]});if(_0x1b418d[_0xd4df('0x1e')]==0x0){orderBy++;promisesAdditionalPhones[_0xd4df('0x21')]({'contactId':_0xdff551,'contactTypeId':_0x5efc0f,'phone':_0x54d937[_0x65eccb],'orderBy':orderBy});}}}_0x160b1f({'ok':0x1});}else _0x160b1f({'res':0x0});});}function createAdditionalPhone(_0x131f99,_0x2d2e1a,_0x3db2ba,_0x47edc3){var _0x120577='';var _0x2c9e4d='';var _0x3e06ed=_0x3db2ba['split']('§');_0x120577=_0x3e06ed[0x0];if(_0x3e06ed[_0xd4df('0x1e')]==0x2)_0x2c9e4d=_0x3e06ed[0x1];return new Promise(function(_0x5cdd57,_0x331c33){return db[_0xd4df('0x28')]['findOne']({'where':{'CmContactId':_0x131f99,'item':_0x120577}})[_0xd4df('0x23')](function(_0x56e265){if(_0x56e265){return db['CmContactHasItem'][_0xd4df('0x29')]({'ItemTypeId':_0x2d2e1a,'description':_0x2c9e4d,'OrderBy':_0x47edc3},{'where':{'CmContactId':_0x131f99,'item':_0x120577}})[_0xd4df('0x23')](function(_0x386d57){_0x5cdd57({'res':'updated'});});}else{return db[_0xd4df('0x28')]['create']({'CmContactId':_0x131f99,'item':_0x120577,'ItemTypeId':_0x2d2e1a,'description':_0x2c9e4d,'OrderBy':_0x47edc3,'ItemClass':_0xd4df('0x2a')})[_0xd4df('0x23')](function(_0x58f48b){_0x5cdd57({'res':_0xd4df('0x2b')});});}});});}function updateContact(_0x548902){return new Promise(function(_0x851960,_0x4f38d1){var _0x45b48a=_0x548902['id'];delete _0x548902['id'];return db['CmContact']['update'](_0x548902,{'where':{'id':_0x45b48a}})[_0xd4df('0x23')](function(_0x38ede3){updatedRows+=0x1;return db['CmHopper'][_0xd4df('0x29')]({'phone':_0x548902[_0xd4df('0x14')]},{'where':{'ContactId':_0x45b48a}})[_0xd4df('0x23')](function(_0x155d5c){_0x851960({'ret':'OK'});});});});}function insertCmHopper(_0x194a8a,_0x537e64,_0x556f14,_0x2df1c5,_0x4304e5){var _0x33bce1=[_0xd4df('0x2c'),_0xd4df('0x2d'),_0xd4df('0x2e'),_0xd4df('0x2f'),_0x537e64+'.'+_0x2df1c5,'cm_contacts.createdAt',_0xd4df('0x30'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x4304e5+'\x22'];return squel['insert']()[_0xd4df('0x31')]('cm_hopper')['fromQuery'](['phone','scheduledat',_0xd4df('0x32'),_0xd4df('0x33'),_0x2df1c5,'createdAt',_0xd4df('0x34'),_0xd4df('0x35'),'UserId',_0xd4df('0x36')],squel[_0xd4df('0x12')]()[_0xd4df('0x37')](_0x33bce1)['from'](_0x537e64)[_0xd4df('0x16')]('cm_contacts',null,_0xd4df('0x38')+_0x537e64+_0xd4df('0x39'))[_0xd4df('0x16')](_0x556f14,null,_0x556f14+_0xd4df('0x17')+_0x537e64+'.'+_0x2df1c5)[_0xd4df('0x18')](_0x537e64+'.CmListId\x20=\x20?',_0x194a8a)[_0xd4df('0x18')](_0xd4df('0x3a'),NOW)[_0xd4df('0x18')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x537e64,_0x556f14,_0x2df1c5,_0xd4df('0x3b'),[_0xd4df('0x3c'),_0xd4df('0x3d')]))[_0xd4df('0x18')](_0xd4df('0x3e'),selectNotIn(_0x537e64,_0x556f14,_0x2df1c5,_0xd4df('0x3b'),[_0xd4df('0x3c')])))[_0xd4df('0x3f')]();}function insertCmHopperBlack(_0x27d9ad,_0x570edf,_0x5b0e45,_0x3921ca){var _0xb90bd6=[_0xd4df('0x2c'),_0xd4df('0x2e'),_0xd4df('0x2f'),_0x570edf+'.'+_0x3921ca,_0xd4df('0x40'),'cm_contacts.updatedAt'];return squel[_0xd4df('0x41')]()[_0xd4df('0x31')]('cm_hopper_black')[_0xd4df('0x42')]([_0xd4df('0x14'),_0xd4df('0x32'),_0xd4df('0x33'),_0x3921ca,_0xd4df('0x43'),_0xd4df('0x34')],squel[_0xd4df('0x12')]()['fields'](_0xb90bd6)[_0xd4df('0x15')](_0x570edf)[_0xd4df('0x16')](_0xd4df('0x44'),null,_0xd4df('0x38')+_0x570edf+_0xd4df('0x39'))[_0xd4df('0x16')](_0x5b0e45,null,_0x5b0e45+_0xd4df('0x17')+_0x570edf+'.'+_0x3921ca)[_0xd4df('0x18')](_0x570edf+'.CmListId\x20=\x20?',_0x27d9ad)[_0xd4df('0x18')](_0xd4df('0x3a'),NOW)['where'](_0xd4df('0x3e'),squel[_0xd4df('0x12')]()[_0xd4df('0x13')](_0xd4df('0x14'))[_0xd4df('0x15')](_0xd4df('0x45'))['where'](_0xd4df('0x46'),_0x27d9ad)['where'](_0x3921ca+_0xd4df('0x47'),_0x570edf+'.'+_0x3921ca)))[_0xd4df('0x3f')]();}function insertCmHopperAdditionalPhones(_0x2f82f1){var _0x1911cc=['cm_hopper.id',_0xd4df('0x48'),_0xd4df('0x49'),_0xd4df('0x4a'),_0xd4df('0x4b')];return squel[_0xd4df('0x41')]()[_0xd4df('0x31')](_0xd4df('0x4c'))[_0xd4df('0x42')](['CmHopperId',_0xd4df('0x14'),_0xd4df('0x4d'),_0xd4df('0x43'),_0xd4df('0x34')],squel[_0xd4df('0x12')]()[_0xd4df('0x37')](_0x1911cc)[_0xd4df('0x15')]('cm_hopper')[_0xd4df('0x16')]('cm_contacts',null,_0xd4df('0x4e'))[_0xd4df('0x16')](_0xd4df('0x4f'),null,_0xd4df('0x50'))[_0xd4df('0x18')](_0xd4df('0x51'),_0x2f82f1)['where'](_0xd4df('0x3a'),NOW))[_0xd4df('0x3f')]();}function insertCmContact(_0x387b88,_0x59ad61,_0xc4cec3,_0x520c1b){var _0x178616=_[_0xd4df('0x52')](_[_0xd4df('0x53')](_0x520c1b),[_0xd4df('0x33'),_0xd4df('0x54'),_0xd4df('0x43'),'updatedAt']);return squel[_0xd4df('0x41')]()[_0xd4df('0x31')](_0xd4df('0x44'))['fromQuery'](_0x178616,squel[_0xd4df('0x12')]()['fields'](_0x178616)[_0xd4df('0x15')](_0x59ad61)[_0xd4df('0x18')]('('+_0xc4cec3[_0xd4df('0x16')](',')+_0xd4df('0x55'),squel[_0xd4df('0x12')]()[_0xd4df('0x37')](_0xc4cec3)[_0xd4df('0x15')](_0xd4df('0x44'))[_0xd4df('0x18')](_0xd4df('0x46'),_0x387b88))[_0xd4df('0x18')](_0xd4df('0x56'),squel[_0xd4df('0x12')]()[_0xd4df('0x13')]('MIN(id)','min_id')[_0xd4df('0x15')](_0x59ad61)[_0xd4df('0x57')](_0xc4cec3[_0xd4df('0x16')](','))))['toString']();}function handleStop(){logger[_0xd4df('0x58')](_0xd4df('0x59'));stopped=!![];}function handleUncaughtException(_0x4ff919){logger[_0xd4df('0x25')](_0x4ff919['message']);process['exit'](0x1);}function handleError(_0x17a0d0,_0x4f4475){stats[_0xd4df('0x5a')][_0xd4df('0x21')]({'name':_0x4f4475[_0xd4df('0x5b')],'message':_0x4f4475['message'],'row':_0x17a0d0});}function handleQuery(_0x2cebe3){logger[_0xd4df('0x58')](_0x2cebe3);return db[_0xd4df('0x1a')][_0xd4df('0x1b')](_0x2cebe3)['spread'](function(_0x1c9e35){results[_0xd4df('0x21')](_0x1c9e35);})[_0xd4df('0x24')](function(_0x3fffef){logger[_0xd4df('0x25')](_0x3fffef[_0xd4df('0x5c')]);});}function main(_0x1aecf3,_0x527c30,_0x435f4b,_0x36323d){logger['info'](_0xd4df('0x5d'),_0x1aecf3,JSON[_0xd4df('0x5e')](_0x527c30));process[_0xd4df('0x5f')](_0xd4df('0x60'));var _0x4dbe44=_0x527c30['binding'];var _0x85f059=_[_0xd4df('0x61')](_0x4dbe44);var _0xdf063c=_0x527c30[_0xd4df('0x62')];var _0x3300aa=path[_0xd4df('0x16')](config[_0xd4df('0x63')],_0xd4df('0x64'),_0xdf063c+_0xd4df('0x65'));logger[_0xd4df('0x58')](_0xd4df('0x66'),_0x527c30);db[_0xd4df('0x67')][_0xd4df('0x68')]({'raw':!![],'attributes':['id',_0xd4df('0x69')]})[_0xd4df('0x23')](function(_0x2a98db){for(var _0x505b33=0x0;_0x505b33<_0x2a98db[_0xd4df('0x1e')];_0x505b33++){if(_0x2a98db[_0x505b33][_0xd4df('0x69')]in _0x4dbe44){contactItemTypes[_0xd4df('0x21')](_0x2a98db[_0x505b33]);delete _0x85f059[_0x2a98db[_0x505b33]['name']];hasAdditionalPhones=!![];}for(var _0xd6f7a2 in _0x4dbe44){if(_0x2a98db[_0x505b33][_0xd4df('0x69')]+'_description'===_0xd6f7a2){phoneDescriptions[_0xd4df('0x21')]({'itemTypeId':_0x2a98db[_0x505b33]['id'],'description':_0xd6f7a2});delete _0x85f059[_0xd6f7a2];}}}if(hasAdditionalPhones)_0x85f059['AdditionalPhones']='';var _0x45a0da=_[_0xd4df('0x53')](_0x85f059)[_0xd4df('0x16')]();logger['info']('header',_0x45a0da);fs[_0xd4df('0x6a')](_0x3300aa,_0x45a0da+'\x0a');Papa[_0xd4df('0x6b')](fs[_0xd4df('0x6c')](_0x1aecf3),{'header':!![],'skipEmptyLines':!![],'step':function(_0x357004,_0x39a5bd){try{for(var _0x3955bc=0x0,_0x251c15=[];_0x3955bc<_0x357004[_0xd4df('0x6d')][_0xd4df('0x1e')];_0x3955bc++){stats[_0xd4df('0x6e')]+=0x1;if(_0x357004['errors'][_0x3955bc]){handleError(_0x357004['data'][_0x3955bc],_0x357004['errors'][_0x3955bc]);}else{var _0x10bd56=[];var _0x4b9e2a=[];var _0x5040fd={};for(var _0x353c30 in _0x4dbe44){let _0x5b006e=contactItemTypes['find'](_0x2bd9d6=>_0x2bd9d6[_0xd4df('0x69')]===_0x353c30);let _0xbc2256=contactItemTypes[_0xd4df('0x6f')](_0x3ca565=>_0x3ca565[_0xd4df('0x69')]+_0xd4df('0x70')===_0x353c30);if(_['isNil'](_0x5b006e)&&_['isNil'](_0xbc2256)){if(_0x4dbe44[_0xd4df('0x71')](_0x353c30)){if(_0x357004[_0xd4df('0x6d')][_0x3955bc][_0x4dbe44[_0x353c30]]){var _0x577ee5=_[_0xd4df('0x72')](_0x357004[_0xd4df('0x6d')][_0x3955bc][_0x4dbe44[_0x353c30]][_0xd4df('0x73')](/"/g,'\x27'));switch(_0x353c30){case'scheduledat':var _0x7a78bb=moment(_0x577ee5,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x7a78bb[_0xd4df('0x74')]()){_0x251c15[_0xd4df('0x21')]('\x22'+_0x577ee5+'\x22');}else{_0x10bd56[_0xd4df('0x21')](_0xd4df('0x75'));}break;case _0xd4df('0x35'):var _0x1f7661=parseInt(_0x577ee5);_0x577ee5=_[_0xd4df('0x76')](_0x1f7661)||_0x1f7661<0x0||_0x1f7661>0x4?_0x36323d?0x3:0x2:_0x1f7661;_0x251c15['push']('\x22'+_0x577ee5+'\x22');break;case'UserId':var _0x4f3dea=parseInt(_0x577ee5);if(_[_0xd4df('0x77')](_0x4f3dea)&&_[_0xd4df('0x78')](_0x435f4b,_0x4f3dea)){_0x251c15['push']('\x22'+_0x4f3dea+'\x22');}else{_0x10bd56[_0xd4df('0x21')](_0xd4df('0x79'));}break;case _0xd4df('0x7a'):if(isEmail(_0x577ee5)){_0x251c15[_0xd4df('0x21')]('\x22'+_0x577ee5+'\x22');}else{_0x10bd56['push'](_0xd4df('0x7b'));}break;case _0xd4df('0x7c'):var _0x37c62d=moment(_0x577ee5,'YYYY-MM-DD',!![]);if(_0x37c62d['isValid']()){_0x251c15[_0xd4df('0x21')]('\x22'+_0x577ee5+'\x22');}else{_0x10bd56[_0xd4df('0x21')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x251c15[_0xd4df('0x21')]('\x22'+_0x577ee5+'\x22');}}else{switch(_0x353c30){case _0xd4df('0x7d'):case _0xd4df('0x14'):_0x10bd56[_0xd4df('0x21')](_0x353c30+_0xd4df('0x7e'));break;default:_0x251c15[_0xd4df('0x21')]('\x22\x22');}}}}else{var _0x3f58c0='';if(!_['isNil'](_0x5b006e)){if(!_0x5040fd[_0xd4df('0x71')](_0x5b006e['id'])){for(var _0x23cfea=0x0;_0x23cfea<_0x4dbe44[_0x353c30][_0xd4df('0x1e')];_0x23cfea++){var _0x577ee5=_['trim'](_0x357004[_0xd4df('0x6d')][_0x3955bc][_0x4dbe44[_0x353c30][_0x23cfea]][_0xd4df('0x73')](/"/g,'\x27'));var _0x3d8cb4=phoneDescriptions[_0xd4df('0x6f')](_0x50cc88=>_0x50cc88[_0xd4df('0x7f')]===_0x5b006e['id']);if(!_[_0xd4df('0x1f')](_0x3d8cb4)){var _0x58df03=_[_0xd4df('0x72')](_0x357004[_0xd4df('0x6d')][_0x3955bc][_0x4dbe44[_0x3d8cb4[_0xd4df('0x80')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0xd4df('0x1f')](_0x58df03))_0x577ee5=_0x577ee5+'§'+_0x58df03;}if(_0x3f58c0=='')_0x3f58c0=_0x577ee5;else _0x3f58c0+='|'+_0x577ee5;}_0x4b9e2a['push'](_0x5b006e['id']+':'+_0x3f58c0);_0x5040fd[_0x5b006e['id']]=0x1;}}}}if(hasAdditionalPhones){_0x251c15['push']('\x22'+_0x4b9e2a[_0xd4df('0x16')](';')+'\x22');}if(_0x10bd56[_0xd4df('0x1e')]){handleError(_0x357004[_0xd4df('0x6d')][_0x3955bc],{'code':'SystemRow','message':_0x10bd56[_0xd4df('0x16')]()});}else{fs[_0xd4df('0x81')](_0x3300aa,_0x251c15['join']()+'\x0a');}_0x251c15=[];}if(!(stats[_0xd4df('0x6e')]%0xc8)){socket['emit'](_0xd4df('0x82')+_0xdf063c,stats);stats[_0xd4df('0x5a')]=[];}}if(stopped){logger['info'](_0xd4df('0x83'));_0x39a5bd['abort']();}}catch(_0x153713){handleError(_0x357004['data'][_0x3955bc],{'code':_0xd4df('0x84'),'message':_0x153713[_0xd4df('0x5c')]});logger[_0xd4df('0x25')]('step',_0x153713[_0xd4df('0x5c')]);}},'complete':function(){try{var _0x2c20ec=[];var _0x2b3741=tempTableName;_0x2c20ec[_0xd4df('0x21')](_0xd4df('0x85')+_0x2b3741+_0xd4df('0x86'));logger[_0xd4df('0x58')](_0xd4df('0x87'),contactItemTypes[_0xd4df('0x1e')]);var _0x4a51db=util[_0xd4df('0xe')]('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',_0x3300aa,_0x2b3741,_0x45a0da,_0x527c30['ListId'],_0x527c30[_0xd4df('0x54')]||null,NOW,NOW);if(_[_0xd4df('0x1f')](_0x4dbe44[_0xd4df('0x88')])){_0x4a51db+=',\x20scheduledAt\x20=\x20NOW()';}_0x2c20ec[_0xd4df('0x21')](_0x4a51db);BPromise[_0xd4df('0x89')](_0x2c20ec,handleQuery)['then'](function(_0x198531){BPromise[_0xd4df('0x22')]([handleAdditionalPhones()])[_0xd4df('0x23')](function(){_0x2c20ec=[];for(var _0x3cbd7f=0x0;_0x3cbd7f\x20\x20','binding\x20doesn\x27t\x20exists','No\x20agent\x20available','SIGINT','uncaughtException','lodash','util','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','length','isNil','push','all','then','catch','error','message','AdditionalPhones','split','CmContactHasItem','update','PHONE','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','ContactId','updatedAt','priority','UserId'];(function(_0x3b1cea,_0x44a0ea){var _0x1a0b7a=function(_0x579fc1){while(--_0x579fc1){_0x3b1cea['push'](_0x3b1cea['shift']());}};_0x1a0b7a(++_0x44a0ea);}(_0x0972,0x64));var _0x2097=function(_0x32106b,_0x5d4d67){_0x32106b=_0x32106b-0x0;var _0x3bf643=_0x0972[_0x32106b];return _0x3bf643;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x2097('0x0'));var Papa=require('papaparse');var util=require(_0x2097('0x1'));var BPromise=require('bluebird');var moment=require(_0x2097('0x2'));var squel=require(_0x2097('0x3'));var Redis=require('ioredis');var db=require(_0x2097('0x4'))['db'];var config=require(_0x2097('0x5'));var logger=require(_0x2097('0x6'))(_0x2097('0x7'));config[_0x2097('0x8')]=_[_0x2097('0x9')](config[_0x2097('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x2097('0xa'))(new Redis(config[_0x2097('0x8')]));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()[_0x2097('0xb')](_0x2097('0xc'));var tempTableName=_0x2097('0xd')+moment()['format'](_0x2097('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x3b8b76){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))*$/[_0x2097('0xf')](_0x3b8b76);}function selectNotIn(_0x430754,_0x7baeb3,_0x3b5847,_0x3d5519,_0x1d1166){return squel[_0x2097('0x10')]()[_0x2097('0x11')](_0x2097('0x12'))[_0x2097('0x13')](_0x3d5519)[_0x2097('0x14')](_0x7baeb3,null,_0x7baeb3+_0x2097('0x15')+_0x3d5519+'.'+_0x3b5847)[_0x2097('0x16')](_0x3d5519+'.'+_0x3b5847+_0x2097('0x17')+_0x430754+'.'+_0x3b5847)[_0x2097('0x16')](_0x7baeb3+_0x2097('0x18')+_0x1d1166[_0x2097('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x354387,_0x5d0a43){promisesAdditionalPhones=[];promisesContact=[];return db[_0x2097('0x19')][_0x2097('0x1a')]('select\x20*\x20from\x20'+tempTableName)['spread'](function(_0x4fc8c5){if(_0x4fc8c5!==null){var _0x409deb=[];for(var _0x588396=0x0;_0x588396<_0x4fc8c5[_0x2097('0x1b')];_0x588396++){var _0xb12c94=_0x4fc8c5[_0x588396];if(!_[_0x2097('0x1c')](_0xb12c94[_0x2097('0x12')])){if(!_[_0x2097('0x1c')](_0xb12c94['AdditionalPhones']))_0x409deb[_0x2097('0x1d')](insertAdditionalPhones(_0xb12c94));promisesContact[_0x2097('0x1d')]({'contact':_0xb12c94});}}}Promise[_0x2097('0x1e')](_0x409deb)[_0x2097('0x1f')](function(){_0x354387({'val':0x1});});})[_0x2097('0x20')](function(_0x235304){logger[_0x2097('0x21')](_0x235304[_0x2097('0x22')]);});});}function insertAdditionalPhones(_0x5d8b9e){return new Promise(function(_0x4d957e,_0xf65dc6){var _0x569c21=_0x5d8b9e[_0x2097('0x23')];if(_[_0x2097('0x1c')](_0x569c21))_0xf65dc6({'val':0x0});else{var _0x49f601=_0x569c21[_0x2097('0x24')](';');var _0x5b0582=[];orderBy=0x0;for(var _0x2e17c8=0x0;_0x2e17c8<_0x49f601[_0x2097('0x1b')];_0x2e17c8++){_0x5b0582[_0x2097('0x1d')](splitAdditionalPhone(_0x5d8b9e['id'],_0x49f601[_0x2e17c8]));}Promise[_0x2097('0x1e')](_0x5b0582)[_0x2097('0x1f')](function(){_0x4d957e({'val':_0x49f601[_0x2097('0x1b')]});});}});}function splitAdditionalPhone(_0x56390a,_0xae5f9){return new Promise(function(_0x500234,_0x3f9279){var _0x32405b=_0xae5f9[_0x2097('0x24')](':');var _0x9f59bc=_0x32405b[0x0];var _0x499988=_0x32405b[0x1];if(_0x499988!==''){var _0x2d683a=_0x499988[_0x2097('0x24')]('|');var _0x56af3b=[];for(var _0x1229fc=0x0;_0x1229fc<_0x2d683a['length'];_0x1229fc++){if(_0x2d683a[_0x1229fc]!==''){var _0x29b879=_['filter'](promisesAdditionalPhones,{'contactId':_0x56390a,'phone':_0x2d683a[_0x1229fc]});if(_0x29b879[_0x2097('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0x2097('0x1d')]({'contactId':_0x56390a,'contactTypeId':_0x9f59bc,'phone':_0x2d683a[_0x1229fc],'orderBy':orderBy});}}}_0x500234({'ok':0x1});}else _0x500234({'res':0x0});});}function createAdditionalPhone(_0x407a2a,_0x7eefb4,_0x410afa,_0x36228c){var _0x450e0b='';var _0x4b443d='';var _0x11242f=_0x410afa[_0x2097('0x24')]('§');_0x450e0b=_0x11242f[0x0];if(_0x11242f['length']==0x2)_0x4b443d=_0x11242f[0x1];return new Promise(function(_0x1398d0,_0x41487d){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x407a2a,'item':_0x450e0b}})[_0x2097('0x1f')](function(_0x11b051){if(_0x11b051){return db[_0x2097('0x25')][_0x2097('0x26')]({'ItemTypeId':_0x7eefb4,'description':_0x4b443d,'OrderBy':_0x36228c},{'where':{'CmContactId':_0x407a2a,'item':_0x450e0b}})[_0x2097('0x1f')](function(_0x180654){_0x1398d0({'res':'updated'});});}else{return db[_0x2097('0x25')]['create']({'CmContactId':_0x407a2a,'item':_0x450e0b,'ItemTypeId':_0x7eefb4,'description':_0x4b443d,'OrderBy':_0x36228c,'ItemClass':_0x2097('0x27')})[_0x2097('0x1f')](function(_0x2bc39c){_0x1398d0({'res':_0x2097('0x28')});});}});});}function updateContact(_0x44e398){return new Promise(function(_0x395d9f,_0x9bc312){var _0x455cf7=_0x44e398['id'];delete _0x44e398['id'];return db[_0x2097('0x29')]['update'](_0x44e398,{'where':{'id':_0x455cf7}})[_0x2097('0x1f')](function(_0x40baed){updatedRows+=0x1;return db[_0x2097('0x2a')]['update']({'phone':_0x44e398[_0x2097('0x12')]},{'where':{'ContactId':_0x455cf7}})[_0x2097('0x1f')](function(_0x3c2fa6){_0x395d9f({'ret':'OK'});});});});}function insertCmHopper(_0x396162,_0x542a52,_0x50b101,_0x5689f6,_0x3484ff){var _0x8f464d=[_0x2097('0x2b'),_0x2097('0x2c'),_0x2097('0x2d'),_0x2097('0x2e'),_0x542a52+'.'+_0x5689f6,'cm_contacts.createdAt',_0x2097('0x2f'),_0x2097('0x30'),_0x2097('0x31'),'\x22'+_0x3484ff+'\x22'];return squel[_0x2097('0x32')]()[_0x2097('0x33')](_0x2097('0x34'))['fromQuery']([_0x2097('0x12'),_0x2097('0x35'),_0x2097('0x36'),'ListId',_0x5689f6,'createdAt',_0x2097('0x37'),_0x2097('0x38'),_0x2097('0x39'),_0x2097('0x3a')],squel[_0x2097('0x10')]()[_0x2097('0x3b')](_0x8f464d)[_0x2097('0x13')](_0x542a52)[_0x2097('0x14')](_0x2097('0x3c'),null,_0x2097('0x3d')+_0x542a52+_0x2097('0x3e'))[_0x2097('0x14')](_0x50b101,null,_0x50b101+'.id\x20=\x20'+_0x542a52+'.'+_0x5689f6)[_0x2097('0x16')](_0x542a52+_0x2097('0x3f'),_0x396162)[_0x2097('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x2097('0x16')](_0x2097('0x40'),selectNotIn(_0x542a52,_0x50b101,_0x5689f6,_0x2097('0x34'),[_0x2097('0x41'),_0x2097('0x42')]))[_0x2097('0x16')](_0x2097('0x40'),selectNotIn(_0x542a52,_0x50b101,_0x5689f6,_0x2097('0x34'),['\x22always\x22'])))[_0x2097('0x43')]();}function insertCmHopperBlack(_0x283adc,_0x186ca5,_0x3288ae,_0x12e0e2){var _0xe3ac1b=[_0x2097('0x2b'),_0x2097('0x2d'),'cm_contacts.ListId',_0x186ca5+'.'+_0x12e0e2,_0x2097('0x44'),'cm_contacts.updatedAt'];return squel[_0x2097('0x32')]()[_0x2097('0x33')](_0x2097('0x45'))[_0x2097('0x46')]([_0x2097('0x12'),'ContactId',_0x2097('0x47'),_0x12e0e2,_0x2097('0x48'),_0x2097('0x37')],squel[_0x2097('0x10')]()[_0x2097('0x3b')](_0xe3ac1b)['from'](_0x186ca5)[_0x2097('0x14')](_0x2097('0x3c'),null,_0x2097('0x3d')+_0x186ca5+_0x2097('0x3e'))[_0x2097('0x14')](_0x3288ae,null,_0x3288ae+_0x2097('0x15')+_0x186ca5+'.'+_0x12e0e2)[_0x2097('0x16')](_0x186ca5+_0x2097('0x3f'),_0x283adc)['where'](_0x2097('0x49'),NOW)[_0x2097('0x16')](_0x2097('0x40'),squel[_0x2097('0x10')]()['field']('phone')['from'](_0x2097('0x45'))[_0x2097('0x16')]('ListId\x20=\x20?',_0x283adc)[_0x2097('0x16')](_0x12e0e2+_0x2097('0x4a'),_0x186ca5+'.'+_0x12e0e2)))['toString']();}function insertCmHopperAdditionalPhones(_0x593033){var _0x23acf3=[_0x2097('0x4b'),_0x2097('0x4c'),'cm_contact_has_items.OrderBy',_0x2097('0x4d'),_0x2097('0x4e')];return squel['insert']()[_0x2097('0x33')](_0x2097('0x4f'))[_0x2097('0x46')]([_0x2097('0x50'),_0x2097('0x12'),'OrderBy','createdAt',_0x2097('0x37')],squel[_0x2097('0x10')]()[_0x2097('0x3b')](_0x23acf3)['from']('cm_hopper')[_0x2097('0x14')](_0x2097('0x3c'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x2097('0x14')](_0x2097('0x51'),null,_0x2097('0x52'))[_0x2097('0x16')](_0x2097('0x53'),_0x593033)['where'](_0x2097('0x49'),NOW))[_0x2097('0x43')]();}function insertCmContact(_0x190859,_0x54fe12,_0x4a25e2,_0xdf72c7){var _0x4edf1d=_[_0x2097('0x54')](_['keys'](_0xdf72c7),[_0x2097('0x47'),'CompanyId','createdAt','updatedAt']);return squel[_0x2097('0x32')]()['into']('cm_contacts')[_0x2097('0x46')](_0x4edf1d,squel['select']()[_0x2097('0x3b')](_0x4edf1d)[_0x2097('0x13')](_0x54fe12)['where']('('+_0x4a25e2[_0x2097('0x14')](',')+_0x2097('0x55'),squel[_0x2097('0x10')]()[_0x2097('0x3b')](_0x4a25e2)[_0x2097('0x13')]('cm_contacts')[_0x2097('0x16')]('ListId\x20=\x20?',_0x190859))[_0x2097('0x16')](_0x2097('0x56'),squel[_0x2097('0x10')]()['field'](_0x2097('0x57'),_0x2097('0x58'))[_0x2097('0x13')](_0x54fe12)[_0x2097('0x59')](_0x4a25e2[_0x2097('0x14')](','))))['toString']();}function handleStop(){logger['info'](_0x2097('0x5a'));stopped=!![];}function handleUncaughtException(_0x275578){logger['error'](_0x275578['message']);process['exit'](0x1);}function handleError(_0x5781aa,_0x14b2d4){stats['errors'][_0x2097('0x1d')]({'name':_0x14b2d4[_0x2097('0x5b')],'message':_0x14b2d4['message'],'row':_0x5781aa});}function handleQuery(_0x13558a){logger[_0x2097('0x5c')](_0x13558a);return db[_0x2097('0x19')][_0x2097('0x1a')](_0x13558a)[_0x2097('0x5d')](function(_0x60332a){results[_0x2097('0x1d')](_0x60332a);})[_0x2097('0x20')](function(_0x2ec365){logger['error'](_0x2ec365[_0x2097('0x22')]);});}function main(_0x28226d,_0x1546d9,_0x4705e1,_0x412321){logger[_0x2097('0x5c')]('main',_0x28226d,JSON[_0x2097('0x5e')](_0x1546d9));process[_0x2097('0x5f')](_0x2097('0x60'));var _0x3c3b38=_0x1546d9[_0x2097('0x61')];var _0x5d6b8a=_[_0x2097('0x62')](_0x3c3b38);var _0x28dd95=_0x1546d9['socket_timestamp'];var _0x4d053f=path['join'](config[_0x2097('0x63')],_0x2097('0x64'),_0x28dd95+_0x2097('0x65'));logger[_0x2097('0x5c')](_0x2097('0x66'),_0x1546d9);db[_0x2097('0x67')][_0x2097('0x68')]({'raw':!![],'attributes':['id',_0x2097('0x69')]})[_0x2097('0x1f')](function(_0x5453bc){for(var _0x5cfae9=0x0;_0x5cfae9<_0x5453bc[_0x2097('0x1b')];_0x5cfae9++){if(_0x5453bc[_0x5cfae9][_0x2097('0x69')]in _0x3c3b38){contactItemTypes[_0x2097('0x1d')](_0x5453bc[_0x5cfae9]);delete _0x5d6b8a[_0x5453bc[_0x5cfae9][_0x2097('0x69')]];hasAdditionalPhones=!![];}for(var _0x4649dc in _0x3c3b38){if(_0x5453bc[_0x5cfae9][_0x2097('0x69')]+'_description'===_0x4649dc){phoneDescriptions[_0x2097('0x1d')]({'itemTypeId':_0x5453bc[_0x5cfae9]['id'],'description':_0x4649dc});delete _0x5d6b8a[_0x4649dc];}}}if(hasAdditionalPhones)_0x5d6b8a[_0x2097('0x23')]='';var _0x1614ca=_[_0x2097('0x6a')](_0x5d6b8a)['join']();logger['info'](_0x2097('0x6b'),_0x1614ca);fs[_0x2097('0x6c')](_0x4d053f,_0x1614ca+'\x0a');Papa['parse'](fs[_0x2097('0x6d')](_0x28226d),{'header':!![],'skipEmptyLines':!![],'step':function(_0x426290,_0x17551b){try{for(var _0x17fd21=0x0,_0x1f824f=[];_0x17fd21<_0x426290[_0x2097('0x6e')][_0x2097('0x1b')];_0x17fd21++){stats[_0x2097('0x6f')]+=0x1;if(_0x426290['errors'][_0x17fd21]){handleError(_0x426290[_0x2097('0x6e')][_0x17fd21],_0x426290[_0x2097('0x70')][_0x17fd21]);}else{var _0x525325=[];var _0x1742a9=[];var _0xd81d45={};for(var _0x2bde2b in _0x3c3b38){let _0x143c4f=contactItemTypes[_0x2097('0x71')](_0x46d6b5=>_0x46d6b5[_0x2097('0x69')]===_0x2bde2b);let _0x22d1ce=contactItemTypes[_0x2097('0x71')](_0x1b7021=>_0x1b7021[_0x2097('0x69')]+'_description'===_0x2bde2b);if(_[_0x2097('0x1c')](_0x143c4f)&&_[_0x2097('0x1c')](_0x22d1ce)){if(_0x3c3b38[_0x2097('0x72')](_0x2bde2b)){if(_0x426290[_0x2097('0x6e')][_0x17fd21][_0x3c3b38[_0x2bde2b]]){var _0x34b687=_['trim'](_0x426290[_0x2097('0x6e')][_0x17fd21][_0x3c3b38[_0x2bde2b]][_0x2097('0x73')](/"/g,'\x27'));switch(_0x2bde2b){case _0x2097('0x35'):var _0x563235=moment(_0x34b687,_0x2097('0xc'),!![]);if(_0x563235['isValid']()){_0x1f824f[_0x2097('0x1d')]('\x22'+_0x34b687+'\x22');}else{_0x525325['push'](_0x2097('0x74'));}break;case'priority':var _0x274bd4=parseInt(_0x34b687);_0x34b687=_['isNaN'](_0x274bd4)||_0x274bd4<0x0||_0x274bd4>0x4?_0x412321?0x3:0x2:_0x274bd4;_0x1f824f[_0x2097('0x1d')]('\x22'+_0x34b687+'\x22');break;case _0x2097('0x39'):var _0x18f796=parseInt(_0x34b687);if(_[_0x2097('0x75')](_0x18f796)&&_[_0x2097('0x76')](_0x4705e1,_0x18f796)){_0x1f824f['push']('\x22'+_0x18f796+'\x22');}else{_0x525325[_0x2097('0x1d')](_0x2097('0x77'));}break;case _0x2097('0x78'):if(isEmail(_0x34b687)){_0x1f824f[_0x2097('0x1d')]('\x22'+_0x34b687+'\x22');}else{_0x525325[_0x2097('0x1d')](_0x2097('0x79'));}break;case _0x2097('0x7a'):var _0x360dd5=moment(_0x34b687,_0x2097('0x7b'),!![]);if(_0x360dd5[_0x2097('0x7c')]()){_0x1f824f[_0x2097('0x1d')]('\x22'+_0x34b687+'\x22');}else{_0x525325[_0x2097('0x1d')](_0x2097('0x7d'));}break;default:_0x1f824f[_0x2097('0x1d')]('\x22'+_0x34b687+'\x22');}}else{switch(_0x2bde2b){case _0x2097('0x7e'):case _0x2097('0x12'):_0x525325['push'](_0x2bde2b+_0x2097('0x7f'));break;default:_0x1f824f['push']('\x22\x22');}}}}else{var _0x5c886c='';if(!_[_0x2097('0x1c')](_0x143c4f)){if(!_0xd81d45[_0x2097('0x72')](_0x143c4f['id'])){for(var _0x107fab=0x0;_0x107fab<_0x3c3b38[_0x2bde2b]['length'];_0x107fab++){var _0x34b687=_[_0x2097('0x80')](_0x426290[_0x2097('0x6e')][_0x17fd21][_0x3c3b38[_0x2bde2b][_0x107fab]][_0x2097('0x73')](/"/g,'\x27'));var _0x568a15=phoneDescriptions[_0x2097('0x71')](_0x5088a2=>_0x5088a2[_0x2097('0x81')]===_0x143c4f['id']);if(!_[_0x2097('0x1c')](_0x568a15)){var _0x2619db=_[_0x2097('0x80')](_0x426290['data'][_0x17fd21][_0x3c3b38[_0x568a15[_0x2097('0x82')]][0x0]][_0x2097('0x73')](/"/g,'\x27'));if(!_[_0x2097('0x1c')](_0x2619db))_0x34b687=_0x34b687+'§'+_0x2619db;}if(_0x5c886c=='')_0x5c886c=_0x34b687;else _0x5c886c+='|'+_0x34b687;}_0x1742a9['push'](_0x143c4f['id']+':'+_0x5c886c);_0xd81d45[_0x143c4f['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1f824f[_0x2097('0x1d')]('\x22'+_0x1742a9[_0x2097('0x14')](';')+'\x22');}if(_0x525325[_0x2097('0x1b')]){handleError(_0x426290['data'][_0x17fd21],{'code':_0x2097('0x83'),'message':_0x525325[_0x2097('0x14')]()});}else{fs[_0x2097('0x84')](_0x4d053f,_0x1f824f[_0x2097('0x14')]()+'\x0a');}_0x1f824f=[];}if(!(stats[_0x2097('0x6f')]%0xc8)){socket[_0x2097('0x85')]('contact:import:'+_0x28dd95,stats);stats['errors']=[];}}if(stopped){logger[_0x2097('0x5c')](_0x2097('0x86'));_0x17551b[_0x2097('0x87')]();}}catch(_0x16451c){handleError(_0x426290[_0x2097('0x6e')][_0x17fd21],{'code':_0x2097('0x88'),'message':_0x16451c['message']});logger[_0x2097('0x21')](_0x2097('0x89'),_0x16451c[_0x2097('0x22')]);}},'complete':function(){try{var _0x36d42d=[];var _0x9b0763=tempTableName;_0x36d42d[_0x2097('0x1d')](_0x2097('0x8a')+_0x9b0763+'\x20LIKE\x20cm_contacts;');logger[_0x2097('0x5c')](_0x2097('0x8b'),contactItemTypes[_0x2097('0x1b')]);var _0x46bac8=util[_0x2097('0xb')](_0x2097('0x8c'),_0x4d053f,_0x9b0763,_0x1614ca,_0x1546d9['ListId'],_0x1546d9['CompanyId']||null,NOW,NOW);if(_[_0x2097('0x1c')](_0x3c3b38['scheduledat'])){_0x46bac8+=',\x20scheduledAt\x20=\x20NOW()';}_0x36d42d[_0x2097('0x1d')](_0x46bac8);BPromise[_0x2097('0x8d')](_0x36d42d,handleQuery)[_0x2097('0x1f')](function(_0x3c5a58){BPromise[_0x2097('0x1e')]([handleAdditionalPhones()])[_0x2097('0x1f')](function(){_0x36d42d=[];for(var _0x290481=0x0;_0x290481\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.updatedAt','i.closed','i.closedAt','i.lastMsgAt','i.subject','i.to','i.ContactId','i.MailAccountId','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.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','toString','groupBy','Setting','enableEmailPreview','all','clone','isEmpty','t.id\x20IN\x20?','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','getAccountFK','role','agent','select','field','name','color','from','u.id','u.fullname','ui.','users','where','\x20IN\x20?','getInteractionsTables','getInteractionFK','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','o.id\x20=\x20i.UserId','accounts','\x20=\x20i.id','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','length','conditions','find','buildExpression','type','default','text','start','value','end'];(function(_0x41f4ed,_0x1f646d){var _0x25c457=function(_0x2a9012){while(--_0x2a9012){_0x41f4ed['push'](_0x41f4ed['shift']());}};_0x25c457(++_0x1f646d);}(_0xadd7,0x1a0));var _0x7add=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xadd7[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x7add('0x0'));var squel=require(_0x7add('0x1'));var as=require(_0x7add('0x2'));var qs=require(_0x7add('0x3'));var updateInteraction=require(_0x7add('0x4'))[_0x7add('0x5')];var utils=require('./utils');var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x48e76d,_0x4c5738,_0x2b2492){var _0x5b8b87=![];var _0x12ca80=utils[_0x7add('0x6')](_0x48e76d);if(_0x4c5738[_0x7add('0x7')]===_0x7add('0x8')&&!_0x2b2492['search']&&!_0x2b2492[_0x12ca80]){_0x5b8b87=!![];}return _0x5b8b87;}function getTagsQuery(){return squel[_0x7add('0x9')]()[_0x7add('0xa')]('id')[_0x7add('0xa')](_0x7add('0xb'))[_0x7add('0xa')](_0x7add('0xc'))[_0x7add('0xd')]('tools_tags');}function getUsersQuery(_0x34e178,_0x3bcd09){var _0x203631=utils['getInteractionFK'](_0x34e178);var _0x3447d3='user_has_'+_0x34e178+'_interactions';var _0x17faad=squel['select']()[_0x7add('0xa')](_0x7add('0xe'))[_0x7add('0xa')](_0x7add('0xf'))[_0x7add('0xa')](_0x7add('0x10')+_0x203631)['from'](_0x3447d3,'ui')['left_join'](_0x7add('0x11'),'u','u.id\x20=\x20ui.UserId');if(_0x3bcd09['length']>0x0){_0x17faad[_0x7add('0x12')](_0x7add('0x10')+_0x203631+_0x7add('0x13'),_['map'](_0x3bcd09,'id'));}return _0x17faad;}function getInteractionsQuery(_0x20f465){var _0x325852=utils[_0x7add('0x14')](_0x20f465);var _0x2c7b0c=utils[_0x7add('0x6')](_0x20f465);var _0x4737d6=utils[_0x7add('0x15')](_0x20f465);return squel[_0x7add('0x9')]()[_0x7add('0xd')](_0x325852[_0x7add('0x16')],'i')['left_join'](_0x7add('0x17'),'c',_0x7add('0x18'))[_0x7add('0x19')](_0x7add('0x11'),'o',_0x7add('0x1a'))[_0x7add('0x19')](_0x325852[_0x7add('0x1b')],'a','a.id\x20=\x20i.'+_0x2c7b0c)[_0x7add('0x19')](_0x325852['messages'],'me','me.'+_0x4737d6+_0x7add('0x1c'))[_0x7add('0x19')](_0x325852['interactionsTags'],'it','it.'+_0x4737d6+'\x20=\x20i.id')['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x32778e={'body':squel[_0x7add('0x1d')](),'contact':squel[_0x7add('0x1d')](),'default':squel['expr'](),'fields':squel['expr'](),'filter':squel[_0x7add('0x1d')](),'read':squel['expr'](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0x7add('0x1d')]()};return _0x32778e;}function parseTagParameter(_0x7c11b3){var _0x38376e=squel[_0x7add('0x1d')]();if(_0x7c11b3){var _0x501a41=utils[_0x7add('0x1e')](_0x7c11b3);_0x501a41[_0x7add('0x1f')](function(_0x451457){_0x38376e['or'](_0x7add('0x20'),'%,'+_0x451457+',%');});}return _0x38376e;}function parseReadParameter(_0x2e57e5){var _0x33a680='';if(_0x2e57e5){_0x33a680='unreadMessages\x20{OPERATOR}\x200';if(_0x2e57e5==='1'){_0x33a680=_0x33a680[_0x7add('0x21')]('{OPERATOR}','=');}else{_0x33a680=_0x33a680[_0x7add('0x21')](_0x7add('0x22'),'>');}}return _0x33a680;}function parseSearchFilter(_0x3e5e99,_0x437300){var _0x53019f=squel[_0x7add('0x1d')]();if(_0x437300){var _0x314745=_0x437300['replace']('\x5c','\x5c\x5c')[_0x7add('0x21')](/'/g,'\x27\x27');if(qs[_0x7add('0x23')](_0x314745)){_0x53019f['or'](_0x7add('0x24'),_0x314745+'%');if([_0x7add('0x25'),'whatsapp']['includes'](_0x3e5e99)){_0x53019f['or'](_0x7add('0x26'),_0x314745+'%');}else if(_0x3e5e99===_0x7add('0x27')){_0x53019f['or'](_0x7add('0x28'),_0x314745+'%');}else if(_0x3e5e99===_0x7add('0x29')){_0x53019f['or'](_0x7add('0x2a'),_0x314745+'%');}}else if(_0x3e5e99===_0x7add('0x2b')&&qs['isEmail'](_0x314745)){_0x53019f['or'](_0x7add('0x2c'),_0x314745+'%');}else{if(_0x3e5e99===_0x7add('0x2b')){_0x53019f['or'](_0x7add('0x2d'),qs['getFullTextValue'](_0x314745,!![]))['or'](_0x7add('0x2e'),qs[_0x7add('0x2f')](_0x314745));}else if(_0x3e5e99!=='fax'){_0x53019f['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x7add('0x2f')](_0x314745));}_0x53019f['or'](_0x7add('0x30'),qs[_0x7add('0x2f')](_0x314745,!![]),null);}}return _0x53019f;}function parseAdvancedSearchFilter(_0x143ae9,_0x443543){var _0x130209=getSqlClauses();var _0x1fa9e4=as[_0x7add('0x31')](_0x143ae9);var _0x1ef6f0=_0x1fa9e4[_0x7add('0x32')];for(var _0x204e6b=0x0;_0x204e6b<_0x1fa9e4['conditions'][_0x7add('0x33')];_0x204e6b++){var _0x31326d=_0x1fa9e4[_0x7add('0x34')][_0x204e6b];var _0x215ac9='i';var _0x266944=_[_0x7add('0x35')](_0x443543,['name',_0x31326d[_0x7add('0xa')]]);if(_0x266944){var _0x161c5f=as[_0x7add('0x36')](_0x215ac9,_0x266944[_0x7add('0x37')],_0x31326d);_0x130209[_0x7add('0x38')][_0x1ef6f0](_0x161c5f[_0x7add('0x39')],_0x161c5f['value'][_0x7add('0x3a')],_0x161c5f[_0x7add('0x3b')][_0x7add('0x3c')]);}else{switch(_0x31326d[_0x7add('0xa')]){case _0x7add('0x3d'):var _0x543311=parseReadParameter(_0x31326d['value']);_0x130209[_0x7add('0x3e')][_0x7add('0x3f')](_0x543311);break;case _0x7add('0x40'):if(_0x31326d['operator']===_0x7add('0x41')){if(_0x31326d[_0x7add('0x3b')][_0x7add('0x42')]('\x20')[_0x7add('0x33')]>0x1){_0x130209[_0x7add('0x43')][_0x1ef6f0]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x31326d['value'],!![]),null);}else{var _0x3b198a='%'+_0x31326d[_0x7add('0x3b')]+'%';_0x130209['contact'][_0x1ef6f0](_0x7add('0x44'),_0x3b198a,_0x3b198a,_0x3b198a);}}else{_0x266944=_['find'](_0x443543,[_0x7add('0xb'),_0x7add('0x45')]);_0x31326d[_0x7add('0xa')]=_0x7add('0x45');_0x161c5f=as[_0x7add('0x36')](_0x215ac9,_0x266944['type'],_0x31326d);_0x130209[_0x7add('0x43')][_0x1ef6f0](_0x161c5f[_0x7add('0x39')],_0x161c5f[_0x7add('0x3b')]['start'],_0x161c5f[_0x7add('0x3b')]['end']);}break;case _0x7add('0x46'):var _0x5130f5=_0x31326d['value'][_0x7add('0x42')](',')[_0x7add('0x47')](function(_0x57b82c){return Number(_0x57b82c);});var _0x58a926=parseTagParameter(_0x5130f5);_0x130209['tags'][_0x7add('0x48')][_0x7add('0x3f')](_0x58a926);_0x130209['tags']['ids']=_0x5130f5;break;case _0x7add('0x49'):if(_0x31326d[_0x7add('0x4a')]==='$substring'){_0x130209[_0x7add('0x4b')][_0x1ef6f0](_0x7add('0x4c'),'%'+_0x31326d['value']+'%',null);}else{_0x266944=_['find'](_0x443543,[_0x7add('0xb'),_0x7add('0x4d')]);_0x31326d[_0x7add('0xa')]=_0x7add('0x4d');_0x161c5f=as[_0x7add('0x36')](_0x215ac9,_0x266944['type'],_0x31326d);_0x130209[_0x7add('0x4b')][_0x1ef6f0](_0x161c5f['text'],_0x161c5f[_0x7add('0x3b')][_0x7add('0x3a')],_0x161c5f[_0x7add('0x3b')][_0x7add('0x3c')]);}break;case'body':case _0x7add('0x4e'):_0x161c5f=as['buildExpression']('me',null,_0x31326d);_0x130209[_0x7add('0x4f')][_0x1ef6f0](_0x161c5f[_0x7add('0x39')],_0x161c5f['value'][_0x7add('0x3a')],_0x161c5f[_0x7add('0x3b')][_0x7add('0x3c')]);break;}}}return _0x130209;}function parseModelFields(_0x16de0e,_0x5de96a,_0x46c951){var _0x43aefa=utils[_0x7add('0x6')](_0x16de0e);var _0x42adad=squel[_0x7add('0x1d')]();var _0x3e220a=_(_0x5de96a)[_0x7add('0x50')]()[_0x7add('0x47')](function(_0x512190){return _['some'](_0x46c951,[_0x7add('0xb'),_0x512190])?_0x512190:undefined;})[_0x7add('0x51')]()[_0x7add('0x3b')]();if(_0x3e220a['length']>0x0){_0x3e220a['forEach'](function(_0x573d02){if(_0x573d02===_0x43aefa){_0x42adad[_0x7add('0x3f')]('i.'+_0x43aefa+'\x20IN\x20?',[][_0x7add('0x52')](_0x5de96a[_0x573d02]));}else if(_0x573d02===_0x7add('0x53')){var _0x3aeb0b=JSON['parse'](_0x5de96a[_0x573d02])[_0x7add('0x54')];var _0xe76d8=JSON[_0x7add('0x55')](_0x5de96a[_0x573d02])[_0x7add('0x56')];_0x42adad[_0x7add('0x3f')](_0x7add('0x57'),_0x3aeb0b,_0xe76d8);}else{if(_0x5de96a[_0x573d02]===_0x7add('0x58')){_0x42adad['and']('i.'+_0x573d02+_0x7add('0x59'));}else{_0x42adad[_0x7add('0x3f')]('i.'+_0x573d02+_0x7add('0x5a'),_0x5de96a[_0x573d02]);}}});}return _0x42adad;}function parseQueryParameters(_0x11c0a0,_0x4b7827,_0x3d2a9c){var _0x5db80b=getSqlClauses();return Promise['resolve']()[_0x7add('0x5b')](function(){return parseModelFields(_0x11c0a0,_0x4b7827,_0x3d2a9c);})[_0x7add('0x5b')](function(_0x56b570){_0x5db80b[_0x7add('0x5c')]['and'](_0x56b570);return parseReadParameter(_0x4b7827[_0x7add('0x3e')]);})[_0x7add('0x5b')](function(_0x10e9ee){_0x5db80b[_0x7add('0x3e')]['and'](_0x10e9ee);return parseTagParameter(_0x4b7827[_0x7add('0x5d')]);})['then'](function(_0x205c95){_0x5db80b[_0x7add('0x5e')]['clause']['and'](_0x205c95);return parseSearchFilter(_0x11c0a0,_0x4b7827[_0x7add('0x5f')]);})['then'](function(_0x185639){_0x5db80b[_0x7add('0x5f')]=_0x185639;return _0x5db80b;});}function checkAccountsRestrictions(_0x1535d7,_0x100533,_0x39f492){var _0x1f55a1=utils[_0x7add('0x6')](_0x1535d7);var _0x5f511f='get'+_[_0x7add('0x60')](_0x1535d7)+(_0x1535d7==='chat'?_0x7add('0x61'):_0x7add('0x62'));var _0x460a07=squel[_0x7add('0x1d')]();return Promise[_0x7add('0x63')]()[_0x7add('0x5b')](function(){if(_0x39f492['search']&&_0x100533[_0x7add('0x7')]===_0x7add('0x8')){return _0x100533[_0x5f511f]({'attributes':['id'],'raw':!![]});}})[_0x7add('0x5b')](function(_0x5a7698){if(_0x5a7698){if(_0x5a7698[_0x7add('0x33')]===0x0){_0x460a07[_0x7add('0x3f')]('i.'+_0x1f55a1+'\x20IS\x20NULL');}else{_0x460a07['and']('i.'+_0x1f55a1+_0x7add('0x13'),_['map'](_0x5a7698,'id'));}}else if(!_0x39f492[_0x1f55a1]){_0x460a07[_0x7add('0x3f')]('i.'+_0x1f55a1+_0x7add('0x64'));}})[_0x7add('0x5b')](function(){return _0x460a07;});}function getClosedOrderClause(_0x456d91,_0x2e2393){var _0x44c72a='';var _0x1b98d5=[_0x7add('0x65'),_0x7add('0x66'),_0x7add('0x67')];if(_0x456d91===_0x7add('0x2b')){_0x1b98d5[_0x7add('0x68')](_0x7add('0x69'));}if(_0x2e2393[_0x7add('0x6a')]==='0'&&_0x456d91===_0x7add('0x2b')){_0x44c72a=_0x7add('0x69');}else{if(_0x2e2393[_0x7add('0x6a')]==='1'){_0x1b98d5[_0x7add('0x6b')]();}_0x44c72a='CONCAT_WS(\x27\x27,\x20'+_0x1b98d5[_0x7add('0x6c')](',\x20')+')';}return _0x44c72a;}function getFilteredInteractions(_0xedd231,_0x3e8d0d,_0x48f80d,_0x54970f){var _0x484bdf=utils[_0x7add('0x15')](_0xedd231);var _0x12cf65=_[_0x7add('0x60')](_0xedd231)+'Interaction';var _0x3c5ed4=[];var _0x87b8d=getTagsQuery();var _0x1a12ae={'type':db[_0x7add('0x6d')][_0x7add('0x6e')][_0x7add('0x6f')],'raw':!![]};var _0x362f16=[];var _0x410e02=[];return db[_0x7add('0x70')][_0x7add('0x71')](_0x87b8d['toString'](),_0x1a12ae)[_0x7add('0x5b')](function(_0x276ea5){_0x3c5ed4=_[_0x7add('0x72')](_0x276ea5,'id');_0x1a12ae=_[_0x7add('0x73')](_0x1a12ae,{'model':db[_0x12cf65],'mapToModel':!![],'nest':!![]});if(_0x48f80d[_0x7add('0x5c')]){_0x54970f[_0x7add('0x74')][_0x7add('0x1f')](function(_0x20f24c){_0x3e8d0d[_0x7add('0xa')]('i.'+_0x20f24c);});}else{_0x3e8d0d['field'](_0x7add('0x75'),_0x7add('0x3d'));_0x3e8d0d[_0x7add('0xa')]('a.key',_0x7add('0x76'));_0x3e8d0d[_0x7add('0xa')]('a.mandatoryDisposition',_0x7add('0x77'));if(_0xedd231===_0x7add('0x2b')){_0x3e8d0d['field'](_0x7add('0x78'),_0x7add('0x79'));_0x3e8d0d['field'](_0x7add('0x7a'),_0x7add('0x7b'));_0x3e8d0d[_0x7add('0xa')](_0x7add('0x7c'));_0x3e8d0d[_0x7add('0xa')]('i.createdAt');_0x3e8d0d[_0x7add('0xa')](_0x7add('0x7d'));_0x3e8d0d[_0x7add('0xa')](_0x7add('0x7e'));_0x3e8d0d[_0x7add('0xa')](_0x7add('0x7f'));_0x3e8d0d[_0x7add('0xa')]('i.attach');_0x3e8d0d[_0x7add('0xa')](_0x7add('0x80'));_0x3e8d0d['field']('i.lastMsgDirection');_0x3e8d0d[_0x7add('0xa')](_0x7add('0x81'));_0x3e8d0d['field']('i.disposition');_0x3e8d0d['field'](_0x7add('0x66'));_0x3e8d0d[_0x7add('0xa')]('i.thirdDisposition');_0x3e8d0d[_0x7add('0xa')](_0x7add('0x69'));_0x3e8d0d['field'](_0x7add('0x82'));_0x3e8d0d[_0x7add('0xa')](_0x7add('0x83'));_0x3e8d0d[_0x7add('0xa')](_0x7add('0x84'));_0x3e8d0d[_0x7add('0xa')]('i.UserId');}else if(_0xedd231==='openchannel'){_0x3e8d0d[_0x7add('0xa')]('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');}else{_0x3e8d0d[_0x7add('0xa')](_0x7add('0x85'),_0x7add('0x7b'));}if(_0xedd231!==_0x7add('0x2b')){_0x3e8d0d['field']('i.*');}_0x3e8d0d['field'](_0x7add('0x86'),'Contact.firstName');_0x3e8d0d[_0x7add('0xa')]('c.lastName',_0x7add('0x87'));_0x3e8d0d[_0x7add('0xa')](_0x7add('0x88'),_0x7add('0x89'));_0x3e8d0d[_0x7add('0xa')](_0x7add('0x8a'),_0x7add('0x8b'));_0x3e8d0d[_0x7add('0xa')]('c.mobile',_0x7add('0x8c'));_0x3e8d0d[_0x7add('0xa')]('c.fax',_0x7add('0x8d'));_0x3e8d0d[_0x7add('0xa')](_0x7add('0x8e'),_0x7add('0x8f'));_0x3e8d0d[_0x7add('0xa')](_0x7add('0x90'),_0x7add('0x91'));_0x3e8d0d[_0x7add('0xa')](_0x7add('0x92'),_0x7add('0x93'));}if(_0x54970f[_0x7add('0x94')]){_0x3e8d0d['limit'](_0x54970f[_0x7add('0x94')]);}if(_0x54970f[_0x7add('0x95')]){_0x3e8d0d[_0x7add('0x95')](_0x54970f[_0x7add('0x95')]);}return db[_0x7add('0x70')][_0x7add('0x71')](_0x3e8d0d[_0x7add('0x96')](),_0x1a12ae);})['then'](function(_0x2e3df5){_0x362f16=_0x2e3df5;var _0x27f13b=getUsersQuery(_0xedd231,_0x362f16);return db[_0x7add('0x70')][_0x7add('0x71')](_0x27f13b[_0x7add('0x96')](),_0x1a12ae);})[_0x7add('0x5b')](function(_0x37bcf4){_0x410e02=_[_0x7add('0x97')](_0x37bcf4,_0x484bdf);if(_0xedd231===_0x7add('0x2b')){return db[_0x7add('0x98')]['findOne']({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x7add('0x5b')](function(_0x414eb4){var _0x599f3a=_0x414eb4?_0x414eb4[_0x7add('0x99')]:undefined;var _0x570e6e=_0x362f16[_0x7add('0x47')](function(_0x5e9420){return updateInteraction(_0x5e9420,_0x3c5ed4,_0x410e02,_0x599f3a);});return Promise[_0x7add('0x9a')](_0x570e6e);});}function countFilteredInteractions(_0x5125d2,_0x43d285){var _0x30fef2=_0x5125d2[_0x7add('0x9b')]();_0x30fef2[_0x7add('0xa')]('COUNT(*)');_0x30fef2['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');var _0x54f195=utils[_0x7add('0x1e')](_0x43d285);if(!_[_0x7add('0x9c')](_0x54f195)){_0x30fef2[_0x7add('0x12')](_0x7add('0x9d'),_0x54f195);}var _0x30ed30={'type':db[_0x7add('0x6d')][_0x7add('0x6e')][_0x7add('0x6f')],'raw':!![]};return db[_0x7add('0x70')][_0x7add('0x71')](_0x30fef2[_0x7add('0x96')](),_0x30ed30);}module[_0x7add('0x9e')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x1020=['me.','\x20=\x20i.id','interactionsTags','it.','expr','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','fax','i.fax\x20LIKE\x20?','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','buildExpression','type','default','text','value','end','read','and','operator','$substring','split','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','start','Tag','map','clause','tags','ids','User','user','UserId','plainBody','keys','some','compact','concat','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','tag','filter','get','capitalize','chat','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','i.substatus','shift','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','QueryTypes','SELECT','query','toString','keyBy','a.key','Account.key','a.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','i.id','i.createdAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.MailAccountId','i.UserId','contactName','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','Contact.lastName','Contact.email','Contact.mobile','c.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','limit','offset','sequelize','groupBy','Setting','enableEmailPreview','all','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','isEmpty','where','exports','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','agent','select','field','name','color','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','from','left_join','users','length','ui.','\x20IN\x20?','interactions','cm_contacts','messages'];(function(_0x20ec24,_0x29b81b){var _0x4890f9=function(_0x413b1f){while(--_0x413b1f){_0x20ec24['push'](_0x20ec24['shift']());}};_0x4890f9(++_0x29b81b);}(_0x1020,0x1ac));var _0x0102=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x1020[_0x256b72];return _0x2183e3;};'use strict';var _=require('lodash');var squel=require(_0x0102('0x0'));var as=require(_0x0102('0x1'));var qs=require(_0x0102('0x2'));var updateInteraction=require(_0x0102('0x3'))[_0x0102('0x4')];var utils=require(_0x0102('0x5'));var db=require(_0x0102('0x6'))['db'];function skipInteractionsQuery(_0x1c8721,_0x20de29,_0x33082d){var _0x50bdfc=![];var _0x6f148c=utils[_0x0102('0x7')](_0x1c8721);if(_0x20de29['role']===_0x0102('0x8')&&!_0x33082d['search']&&!_0x33082d[_0x6f148c]){_0x50bdfc=!![];}return _0x50bdfc;}function getTagsQuery(){return squel[_0x0102('0x9')]()[_0x0102('0xa')]('id')['field'](_0x0102('0xb'))[_0x0102('0xa')](_0x0102('0xc'))['from'](_0x0102('0xd'));}function getUsersQuery(_0x2344c1,_0x2fe78a){var _0x264920=utils[_0x0102('0xe')](_0x2344c1);var _0x163df7=_0x0102('0xf')+_0x2344c1+_0x0102('0x10');var _0x180f09=squel[_0x0102('0x9')]()[_0x0102('0xa')](_0x0102('0x11'))[_0x0102('0xa')](_0x0102('0x12'))['field']('ui.'+_0x264920)[_0x0102('0x13')](_0x163df7,'ui')[_0x0102('0x14')](_0x0102('0x15'),'u','u.id\x20=\x20ui.UserId');if(_0x2fe78a[_0x0102('0x16')]>0x0){_0x180f09['where'](_0x0102('0x17')+_0x264920+_0x0102('0x18'),_['map'](_0x2fe78a,'id'));}return _0x180f09;}function getInteractionsQuery(_0x196b9e){var _0x2c15a6=utils['getInteractionsTables'](_0x196b9e);var _0x5fcf3c=utils[_0x0102('0x7')](_0x196b9e);var _0x1732bd=utils[_0x0102('0xe')](_0x196b9e);return squel['select']()[_0x0102('0x13')](_0x2c15a6[_0x0102('0x19')],'i')[_0x0102('0x14')](_0x0102('0x1a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0102('0x14')](_0x0102('0x15'),'o','o.id\x20=\x20i.UserId')[_0x0102('0x14')](_0x2c15a6['accounts'],'a','a.id\x20=\x20i.'+_0x5fcf3c)[_0x0102('0x14')](_0x2c15a6[_0x0102('0x1b')],'me',_0x0102('0x1c')+_0x1732bd+_0x0102('0x1d'))[_0x0102('0x14')](_0x2c15a6[_0x0102('0x1e')],'it',_0x0102('0x1f')+_0x1732bd+_0x0102('0x1d'))[_0x0102('0x14')]('tools_tags','t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x57c5eb={'body':squel[_0x0102('0x20')](),'contact':squel[_0x0102('0x20')](),'default':squel[_0x0102('0x20')](),'fields':squel['expr'](),'filter':squel[_0x0102('0x20')](),'read':squel['expr'](),'tags':{'clause':squel[_0x0102('0x20')](),'ids':null},'user':squel['expr']()};return _0x57c5eb;}function parseTagParameter(_0x154384){var _0xa92841=squel[_0x0102('0x20')]();if(_0x154384){var _0x397296=utils['getSelectedTags'](_0x154384);_0x397296[_0x0102('0x21')](function(_0x41f208){_0xa92841['or'](_0x0102('0x22'),'%,'+_0x41f208+',%');});}return _0xa92841;}function parseReadParameter(_0x2c7263){var _0x19cc94='';if(_0x2c7263){_0x19cc94=_0x0102('0x23');if(_0x2c7263==='1'){_0x19cc94=_0x19cc94['replace']('{OPERATOR}','=');}else{_0x19cc94=_0x19cc94[_0x0102('0x24')](_0x0102('0x25'),'>');}}return _0x19cc94;}function parseSearchFilter(_0x3f5073,_0x1b0e6){var _0xb25734=squel[_0x0102('0x20')]();if(_0x1b0e6){var _0x2978e2=_0x1b0e6[_0x0102('0x24')]('\x5c','\x5c\x5c')[_0x0102('0x24')](/'/g,'\x27\x27');if(qs[_0x0102('0x26')](_0x2978e2)){_0xb25734['or'](_0x0102('0x27'),_0x2978e2+'%');if([_0x0102('0x28'),_0x0102('0x29')]['includes'](_0x3f5073)){_0xb25734['or']('i.phone\x20LIKE\x20?',_0x2978e2+'%');}else if(_0x3f5073===_0x0102('0x2a')){_0xb25734['or'](_0x0102('0x2b'),_0x2978e2+'%');}else if(_0x3f5073==='openchannel'){_0xb25734['or'](_0x0102('0x2c'),_0x2978e2+'%');}}else if(_0x3f5073===_0x0102('0x2d')&&qs[_0x0102('0x2e')](_0x2978e2)){_0xb25734['or'](_0x0102('0x2f'),_0x2978e2+'%');}else{if(_0x3f5073===_0x0102('0x2d')){_0xb25734['or'](_0x0102('0x30'),qs[_0x0102('0x31')](_0x2978e2,!![]))['or'](_0x0102('0x32'),qs['getFullTextValue'](_0x2978e2));}else if(_0x3f5073!==_0x0102('0x2a')){_0xb25734['or'](_0x0102('0x33'),qs[_0x0102('0x31')](_0x2978e2));}_0xb25734['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0102('0x31')](_0x2978e2,!![]),null);}}return _0xb25734;}function parseAdvancedSearchFilter(_0xad7b4a,_0x595ed5){var _0x4e703a=getSqlClauses();var _0xf5c945=as[_0x0102('0x34')](_0xad7b4a);var _0x26e66d=_0xf5c945[_0x0102('0x35')];for(var _0x840bbb=0x0;_0x840bbb<_0xf5c945[_0x0102('0x36')][_0x0102('0x16')];_0x840bbb++){var _0x25dc91=_0xf5c945[_0x0102('0x36')][_0x840bbb];var _0x157f66='i';var _0x3c6fe9=_['find'](_0x595ed5,['name',_0x25dc91[_0x0102('0xa')]]);if(_0x3c6fe9){var _0x2662ab=as[_0x0102('0x37')](_0x157f66,_0x3c6fe9[_0x0102('0x38')],_0x25dc91);_0x4e703a[_0x0102('0x39')][_0x26e66d](_0x2662ab[_0x0102('0x3a')],_0x2662ab[_0x0102('0x3b')]['start'],_0x2662ab[_0x0102('0x3b')][_0x0102('0x3c')]);}else{switch(_0x25dc91['field']){case'unreadMessages':var _0x293c68=parseReadParameter(_0x25dc91[_0x0102('0x3b')]);_0x4e703a[_0x0102('0x3d')][_0x0102('0x3e')](_0x293c68);break;case'Contact':if(_0x25dc91[_0x0102('0x3f')]===_0x0102('0x40')){if(_0x25dc91[_0x0102('0x3b')][_0x0102('0x41')]('\x20')['length']>0x1){_0x4e703a[_0x0102('0x42')][_0x26e66d](_0x0102('0x43'),qs[_0x0102('0x31')](_0x25dc91[_0x0102('0x3b')],!![]),null);}else{var _0x1a6a95='%'+_0x25dc91[_0x0102('0x3b')]+'%';_0x4e703a[_0x0102('0x42')][_0x26e66d](_0x0102('0x44'),_0x1a6a95,_0x1a6a95,_0x1a6a95);}}else{_0x3c6fe9=_[_0x0102('0x45')](_0x595ed5,[_0x0102('0xb'),_0x0102('0x46')]);_0x25dc91[_0x0102('0xa')]=_0x0102('0x46');_0x2662ab=as[_0x0102('0x37')](_0x157f66,_0x3c6fe9[_0x0102('0x38')],_0x25dc91);_0x4e703a['contact'][_0x26e66d](_0x2662ab[_0x0102('0x3a')],_0x2662ab['value'][_0x0102('0x47')],_0x2662ab[_0x0102('0x3b')][_0x0102('0x3c')]);}break;case _0x0102('0x48'):var _0x4701d2=_0x25dc91[_0x0102('0x3b')][_0x0102('0x41')](',')[_0x0102('0x49')](function(_0x2242c2){return Number(_0x2242c2);});var _0x248766=parseTagParameter(_0x4701d2);_0x4e703a['tags'][_0x0102('0x4a')][_0x0102('0x3e')](_0x248766);_0x4e703a[_0x0102('0x4b')][_0x0102('0x4c')]=_0x4701d2;break;case _0x0102('0x4d'):if(_0x25dc91[_0x0102('0x3f')]==='$substring'){_0x4e703a[_0x0102('0x4e')][_0x26e66d]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x25dc91[_0x0102('0x3b')]+'%',null);}else{_0x3c6fe9=_[_0x0102('0x45')](_0x595ed5,['name',_0x0102('0x4f')]);_0x25dc91[_0x0102('0xa')]=_0x0102('0x4f');_0x2662ab=as[_0x0102('0x37')](_0x157f66,_0x3c6fe9[_0x0102('0x38')],_0x25dc91);_0x4e703a[_0x0102('0x4e')][_0x26e66d](_0x2662ab[_0x0102('0x3a')],_0x2662ab['value'][_0x0102('0x47')],_0x2662ab[_0x0102('0x3b')][_0x0102('0x3c')]);}break;case'body':case _0x0102('0x50'):_0x2662ab=as[_0x0102('0x37')]('me',null,_0x25dc91);_0x4e703a['body'][_0x26e66d](_0x2662ab['text'],_0x2662ab[_0x0102('0x3b')][_0x0102('0x47')],_0x2662ab[_0x0102('0x3b')][_0x0102('0x3c')]);break;}}}return _0x4e703a;}function parseModelFields(_0x489d58,_0x572dca,_0x1bb2cf){var _0x38470d=utils[_0x0102('0x7')](_0x489d58);var _0x446cab=squel[_0x0102('0x20')]();var _0x242c65=_(_0x572dca)[_0x0102('0x51')]()[_0x0102('0x49')](function(_0x5deab3){return _[_0x0102('0x52')](_0x1bb2cf,[_0x0102('0xb'),_0x5deab3])?_0x5deab3:undefined;})[_0x0102('0x53')]()['value']();if(_0x242c65[_0x0102('0x16')]>0x0){_0x242c65[_0x0102('0x21')](function(_0x82b197){if(_0x82b197===_0x38470d){_0x446cab[_0x0102('0x3e')]('i.'+_0x38470d+_0x0102('0x18'),[][_0x0102('0x54')](_0x572dca[_0x82b197]));}else if(_0x82b197==='createdAt'){var _0xe74846=JSON['parse'](_0x572dca[_0x82b197])['$gte'];var _0x1ba207=JSON[_0x0102('0x55')](_0x572dca[_0x82b197])['$lte'];_0x446cab[_0x0102('0x3e')](_0x0102('0x56'),_0xe74846,_0x1ba207);}else{if(_0x572dca[_0x82b197]===_0x0102('0x57')){_0x446cab[_0x0102('0x3e')]('i.'+_0x82b197+_0x0102('0x58'));}else{_0x446cab['and']('i.'+_0x82b197+_0x0102('0x59'),_0x572dca[_0x82b197]);}}});}return _0x446cab;}function parseQueryParameters(_0x268b7b,_0x1e562b,_0x2b718e){var _0x6e65ca=getSqlClauses();return Promise[_0x0102('0x5a')]()[_0x0102('0x5b')](function(){return parseModelFields(_0x268b7b,_0x1e562b,_0x2b718e);})[_0x0102('0x5b')](function(_0x68386c){_0x6e65ca[_0x0102('0x5c')][_0x0102('0x3e')](_0x68386c);return parseReadParameter(_0x1e562b[_0x0102('0x3d')]);})['then'](function(_0x4d0ca1){_0x6e65ca[_0x0102('0x3d')][_0x0102('0x3e')](_0x4d0ca1);return parseTagParameter(_0x1e562b[_0x0102('0x5d')]);})[_0x0102('0x5b')](function(_0x54bcea){_0x6e65ca[_0x0102('0x4b')][_0x0102('0x4a')][_0x0102('0x3e')](_0x54bcea);return parseSearchFilter(_0x268b7b,_0x1e562b[_0x0102('0x5e')]);})[_0x0102('0x5b')](function(_0x4e5763){_0x6e65ca[_0x0102('0x5e')]=_0x4e5763;return _0x6e65ca;});}function checkAccountsRestrictions(_0x39a09c,_0x3e109a,_0x55ce88){var _0xb337a8=utils['getAccountFK'](_0x39a09c);var _0x49ba4f=_0x0102('0x5f')+_[_0x0102('0x60')](_0x39a09c)+(_0x39a09c===_0x0102('0x61')?'Websites':'Accounts');var _0x15e17f=squel['expr']();return Promise[_0x0102('0x5a')]()[_0x0102('0x5b')](function(){if(_0x55ce88['search']&&_0x3e109a['role']===_0x0102('0x8')){return _0x3e109a[_0x49ba4f]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x11b352){if(_0x11b352){if(_0x11b352[_0x0102('0x16')]===0x0){_0x15e17f['and']('i.'+_0xb337a8+_0x0102('0x58'));}else{_0x15e17f[_0x0102('0x3e')]('i.'+_0xb337a8+'\x20IN\x20?',_[_0x0102('0x49')](_0x11b352,'id'));}}else if(!_0x55ce88[_0xb337a8]){_0x15e17f[_0x0102('0x3e')]('i.'+_0xb337a8+_0x0102('0x62'));}})['then'](function(){return _0x15e17f;});}function getClosedOrderClause(_0x263fdc,_0x49e9fe){var _0x39759b='';var _0x2bd92f=[_0x0102('0x63'),_0x0102('0x64'),_0x0102('0x65')];if(_0x263fdc==='mail'){_0x2bd92f['unshift'](_0x0102('0x66'));}if(_0x49e9fe['closed']==='0'&&_0x263fdc===_0x0102('0x2d')){_0x39759b=_0x0102('0x66');}else{if(_0x49e9fe['closed']==='1'){_0x2bd92f[_0x0102('0x67')]();}_0x39759b=_0x0102('0x68')+_0x2bd92f[_0x0102('0x69')](',\x20')+')';}return _0x39759b;}function getFilteredInteractions(_0x12de50,_0x394b4d,_0x1e6808,_0x1a7b34){var _0x3a62d4=utils[_0x0102('0xe')](_0x12de50);var _0x3b45bc=_[_0x0102('0x60')](_0x12de50)+_0x0102('0x6a');var _0x30e6fb=[];var _0x2be2c1=getTagsQuery();var _0x2de788={'type':db[_0x0102('0x6b')][_0x0102('0x6c')][_0x0102('0x6d')],'raw':!![]};var _0x2d75b2=[];var _0x121a2d=[];return db['sequelize'][_0x0102('0x6e')](_0x2be2c1[_0x0102('0x6f')](),_0x2de788)[_0x0102('0x5b')](function(_0x48ef90){_0x30e6fb=_[_0x0102('0x70')](_0x48ef90,'id');_0x2de788=_['merge'](_0x2de788,{'model':db[_0x3b45bc],'mapToModel':!![],'nest':!![]});if(_0x1e6808['fields']){_0x1a7b34['attributes']['forEach'](function(_0x52476d){_0x394b4d[_0x0102('0xa')]('i.'+_0x52476d);});}else{_0x394b4d[_0x0102('0xa')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x394b4d[_0x0102('0xa')](_0x0102('0x71'),_0x0102('0x72'));_0x394b4d['field'](_0x0102('0x73'),'Account.mandatoryDisposition');if(_0x12de50===_0x0102('0x2d')){_0x394b4d[_0x0102('0xa')](_0x0102('0x74'),_0x0102('0x75'));_0x394b4d[_0x0102('0xa')](_0x0102('0x76'),'contactName');_0x394b4d[_0x0102('0xa')](_0x0102('0x77'));_0x394b4d['field'](_0x0102('0x78'));_0x394b4d[_0x0102('0xa')]('i.updatedAt');_0x394b4d[_0x0102('0xa')](_0x0102('0x79'));_0x394b4d[_0x0102('0xa')](_0x0102('0x7a'));_0x394b4d[_0x0102('0xa')](_0x0102('0x7b'));_0x394b4d[_0x0102('0xa')](_0x0102('0x7c'));_0x394b4d[_0x0102('0xa')](_0x0102('0x7d'));_0x394b4d[_0x0102('0xa')]('i.subject');_0x394b4d[_0x0102('0xa')]('i.disposition');_0x394b4d[_0x0102('0xa')]('i.secondDisposition');_0x394b4d[_0x0102('0xa')](_0x0102('0x63'));_0x394b4d[_0x0102('0xa')]('i.substatus');_0x394b4d[_0x0102('0xa')]('i.to');_0x394b4d[_0x0102('0xa')]('i.ContactId');_0x394b4d[_0x0102('0xa')](_0x0102('0x7e'));_0x394b4d['field'](_0x0102('0x7f'));}else if(_0x12de50==='openchannel'){_0x394b4d[_0x0102('0xa')]('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',_0x0102('0x80'));}else{_0x394b4d[_0x0102('0xa')](_0x0102('0x81'),'contactName');}if(_0x12de50!==_0x0102('0x2d')){_0x394b4d[_0x0102('0xa')]('i.*');}_0x394b4d[_0x0102('0xa')](_0x0102('0x82'),_0x0102('0x83'));_0x394b4d[_0x0102('0xa')]('c.lastName',_0x0102('0x84'));_0x394b4d[_0x0102('0xa')]('c.email',_0x0102('0x85'));_0x394b4d[_0x0102('0xa')]('c.phone','Contact.phone');_0x394b4d[_0x0102('0xa')]('c.mobile',_0x0102('0x86'));_0x394b4d['field'](_0x0102('0x87'),'Contact.fax');_0x394b4d[_0x0102('0xa')]('o.fullname','Owner.fullname');_0x394b4d['field'](_0x0102('0x88'),_0x0102('0x89'));_0x394b4d[_0x0102('0xa')](_0x0102('0x8a'),'TagIds');}if(_0x1a7b34[_0x0102('0x8b')]){_0x394b4d[_0x0102('0x8b')](_0x1a7b34['limit']);}if(_0x1a7b34[_0x0102('0x8c')]){_0x394b4d[_0x0102('0x8c')](_0x1a7b34['offset']);}return db[_0x0102('0x8d')][_0x0102('0x6e')](_0x394b4d[_0x0102('0x6f')](),_0x2de788);})[_0x0102('0x5b')](function(_0x3122b9){_0x2d75b2=_0x3122b9;var _0x385099=getUsersQuery(_0x12de50,_0x2d75b2);return db[_0x0102('0x8d')][_0x0102('0x6e')](_0x385099['toString'](),_0x2de788);})[_0x0102('0x5b')](function(_0x27a314){_0x121a2d=_[_0x0102('0x8e')](_0x27a314,_0x3a62d4);if(_0x12de50===_0x0102('0x2d')){return db[_0x0102('0x8f')]['findOne']({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x0102('0x5b')](function(_0x112591){var _0x1b37a4=_0x112591?_0x112591[_0x0102('0x90')]:undefined;var _0x51ced0=_0x2d75b2[_0x0102('0x49')](function(_0x358e18){return updateInteraction(_0x358e18,_0x30e6fb,_0x121a2d,_0x1b37a4);});return Promise[_0x0102('0x91')](_0x51ced0);});}function countFilteredInteractions(_0x4501eb,_0xd1f420){var _0x7f0a43=_0x4501eb[_0x0102('0x92')]();_0x7f0a43['field']('COUNT(*)');_0x7f0a43[_0x0102('0xa')](_0x0102('0x93'),_0x0102('0x94'));var _0x28a155=utils['getSelectedTags'](_0xd1f420);if(!_[_0x0102('0x95')](_0x28a155)){_0x7f0a43[_0x0102('0x96')]('t.id\x20IN\x20?',_0x28a155);}var _0x433a14={'type':db[_0x0102('0x6b')][_0x0102('0x6c')][_0x0102('0x6d')],'raw':!![]};return db[_0x0102('0x8d')][_0x0102('0x6e')](_0x7f0a43[_0x0102('0x6f')](),_0x433a14);}module[_0x0102('0x97')]={'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 ed7af62..a67d9d3 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 _0x535d=['MailMessage','findOne','out','then','plainBody','lastMsgText','catch','updateInteraction','TagIds','Tags','lodash','../../mysqldb','fullname','split','waiting','talking','answered','total','disposition','abandoned','unmanaged','UserId'];(function(_0x8d93ea,_0x679a4b){var _0x4db215=function(_0x4694f8){while(--_0x4694f8){_0x8d93ea['push'](_0x8d93ea['shift']());}};_0x4db215(++_0x679a4b);}(_0x535d,0xfc));var _0xd535=function(_0x32411e,_0x3053a3){_0x32411e=_0x32411e-0x0;var _0x3c8482=_0x535d[_0x32411e];return _0x3c8482;};'use strict';var _=require(_0xd535('0x0'));var db=require(_0xd535('0x1'))['db'];function getInteractionUsers(_0xd493f4,_0x2529d7){return new Promise(function(_0xcee55e,_0x1e8ddb){try{var _0x53a5ca=[];if(_0x2529d7[_0xd493f4]){_0x53a5ca=_0x2529d7[_0xd493f4]['map'](function(_0x596a01){return{'id':_0x596a01['id'],'fullname':_0x596a01[_0xd535('0x2')]};});}return _0xcee55e(_0x53a5ca);}catch(_0x92c08e){_0x1e8ddb(_0x92c08e);}});}function getInteractionTags(_0x51fa77,_0x9230d8){var _0x2a53fa=[];if(_0x51fa77){_0x51fa77[_0xd535('0x3')](',')['forEach'](function(_0x53c6f6){_0x2a53fa['push'](_0x9230d8[_0x53c6f6]);});}return _0x2a53fa;}function updateWaitingCounter(_0x57ce57){if(_0x57ce57[_0xd535('0x4')]){_0x57ce57[_0xd535('0x4')]-=0x1;}}function updateInteractionCounters(_0x32d7a1){_0x32d7a1[_0xd535('0x4')]=0x0;_0x32d7a1[_0xd535('0x5')]=0x0;_0x32d7a1[_0xd535('0x6')]=0x0;_0x32d7a1['unmanaged']=0x0;_0x32d7a1['abandoned']=0x0;_0x32d7a1[_0xd535('0x7')]=0x0;if(_0x32d7a1['closed']){if(_0x32d7a1[_0xd535('0x8')]==='abandoned'){_0x32d7a1[_0xd535('0x9')]+=0x1;updateWaitingCounter(_0x32d7a1);}if(_0x32d7a1['UserId']){_0x32d7a1[_0xd535('0x6')]+=0x1;if(_0x32d7a1[_0xd535('0x5')]){_0x32d7a1[_0xd535('0x5')]-=0x1;}}else{if(_0x32d7a1[_0xd535('0x8')]){_0x32d7a1[_0xd535('0xa')]+=0x1;updateWaitingCounter(_0x32d7a1);}}}else{if(!_0x32d7a1[_0xd535('0xb')]){_0x32d7a1[_0xd535('0x4')]+=0x1;}if(_0x32d7a1[_0xd535('0xb')]){_0x32d7a1[_0xd535('0x5')]+=0x1;updateWaitingCounter(_0x32d7a1);}}_0x32d7a1[_0xd535('0x7')]+=0x1;return _0x32d7a1;}function getLastMessageText(_0x41720e){return db[_0xd535('0xc')][_0xd535('0xd')]({'where':{'$and':[{'MailInteractionId':_0x41720e['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xd535('0xe')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})[_0xd535('0xf')](function(_0x22af66){if(_0x22af66&&_0x22af66[_0xd535('0x10')]){_0x41720e[_0xd535('0x11')]=_['trimStart'](_0x22af66['plainBody']);}return _0x41720e;})[_0xd535('0x12')](function(_0xd98f9c){throw _0xd98f9c;});}exports[_0xd535('0x13')]=function(_0x1b605e,_0x51615a,_0x6c34f5,_0x524fb4){return new Promise(function(_0x2656b5,_0xfa2110){return getInteractionUsers(_0x1b605e['id'],_0x6c34f5)[_0xd535('0xf')](function(_0x51065b){_0x1b605e['Users']=_0x51065b;return getInteractionTags(_0x1b605e[_0xd535('0x14')],_0x51615a);})['then'](function(_0x31b5c8){_0x1b605e[_0xd535('0x15')]=_0x31b5c8;delete _0x1b605e[_0xd535('0x14')];return updateInteractionCounters(_0x1b605e);})[_0xd535('0xf')](function(_0x2e74fd){if(_0x524fb4){return getLastMessageText(_0x2e74fd);}else{return _0x2e74fd;}})[_0xd535('0xf')](function(_0x33f1e1){_0x2656b5(_0x33f1e1);})[_0xd535('0x12')](function(_0x4f8bcf){_0xfa2110(_0x4f8bcf);});});}; \ No newline at end of file +var _0x463e=['abandoned','total','closed','disposition','answered','UserId','MailMessage','findOne','out','plainBody','then','lastMsgText','trimStart','catch','updateInteraction','Users','TagIds','Tags','lodash','../../mysqldb','map','fullname','split','forEach','push','waiting','talking','unmanaged'];(function(_0x363fcf,_0x8c89a5){var _0x5cf75=function(_0xa29b26){while(--_0xa29b26){_0x363fcf['push'](_0x363fcf['shift']());}};_0x5cf75(++_0x8c89a5);}(_0x463e,0x1b6));var _0xe463=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x463e[_0x433a86];return _0x23000c;};'use strict';var _=require(_0xe463('0x0'));var db=require(_0xe463('0x1'))['db'];function getInteractionUsers(_0x4b8142,_0x5242d3){return new Promise(function(_0x35bb7b,_0xd9aafb){try{var _0x438c96=[];if(_0x5242d3[_0x4b8142]){_0x438c96=_0x5242d3[_0x4b8142][_0xe463('0x2')](function(_0x4c1f3a){return{'id':_0x4c1f3a['id'],'fullname':_0x4c1f3a[_0xe463('0x3')]};});}return _0x35bb7b(_0x438c96);}catch(_0x38f4ac){_0xd9aafb(_0x38f4ac);}});}function getInteractionTags(_0x49b8f6,_0x5003dc){var _0x46ef35=[];if(_0x49b8f6){_0x49b8f6[_0xe463('0x4')](',')[_0xe463('0x5')](function(_0x327f8a){_0x46ef35[_0xe463('0x6')](_0x5003dc[_0x327f8a]);});}return _0x46ef35;}function updateWaitingCounter(_0x46d794){if(_0x46d794['waiting']){_0x46d794[_0xe463('0x7')]-=0x1;}}function updateInteractionCounters(_0x22debd){_0x22debd[_0xe463('0x7')]=0x0;_0x22debd[_0xe463('0x8')]=0x0;_0x22debd['answered']=0x0;_0x22debd[_0xe463('0x9')]=0x0;_0x22debd[_0xe463('0xa')]=0x0;_0x22debd[_0xe463('0xb')]=0x0;if(_0x22debd[_0xe463('0xc')]){if(_0x22debd[_0xe463('0xd')]==='abandoned'){_0x22debd[_0xe463('0xa')]+=0x1;updateWaitingCounter(_0x22debd);}if(_0x22debd['UserId']){_0x22debd[_0xe463('0xe')]+=0x1;if(_0x22debd[_0xe463('0x8')]){_0x22debd[_0xe463('0x8')]-=0x1;}}else{if(_0x22debd[_0xe463('0xd')]){_0x22debd[_0xe463('0x9')]+=0x1;updateWaitingCounter(_0x22debd);}}}else{if(!_0x22debd[_0xe463('0xf')]){_0x22debd['waiting']+=0x1;}if(_0x22debd['UserId']){_0x22debd[_0xe463('0x8')]+=0x1;updateWaitingCounter(_0x22debd);}}_0x22debd[_0xe463('0xb')]+=0x1;return _0x22debd;}function getLastMessageText(_0x23d63c){return db[_0xe463('0x10')][_0xe463('0x11')]({'where':{'$and':[{'MailInteractionId':_0x23d63c['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xe463('0x12')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xe463('0x13')],'order':'-id','raw':!![]})[_0xe463('0x14')](function(_0x36ee28){if(_0x36ee28&&_0x36ee28['plainBody']){_0x23d63c[_0xe463('0x15')]=_[_0xe463('0x16')](_0x36ee28[_0xe463('0x13')]);}return _0x23d63c;})[_0xe463('0x17')](function(_0x1622ce){throw _0x1622ce;});}exports[_0xe463('0x18')]=function(_0x26c6eb,_0x58c915,_0x248b58,_0x586f99){return new Promise(function(_0x477b1b,_0x41eaa9){return getInteractionUsers(_0x26c6eb['id'],_0x248b58)[_0xe463('0x14')](function(_0x34b6aa){_0x26c6eb[_0xe463('0x19')]=_0x34b6aa;return getInteractionTags(_0x26c6eb[_0xe463('0x1a')],_0x58c915);})[_0xe463('0x14')](function(_0x185d3f){_0x26c6eb[_0xe463('0x1b')]=_0x185d3f;delete _0x26c6eb[_0xe463('0x1a')];return updateInteractionCounters(_0x26c6eb);})[_0xe463('0x14')](function(_0x516dda){if(_0x586f99){return getLastMessageText(_0x516dda);}else{return _0x516dda;}})['then'](function(_0x237a27){_0x477b1b(_0x237a27);})[_0xe463('0x17')](function(_0x3375ee){_0x41eaa9(_0x3375ee);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index dbb144d..4b15f5b 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 _0x1683=['unknown','websites','_interactions','_messages','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','Interaction','then','update','catch','lodash','../../mysqldb','openchannel-interactions','../../config/logger','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1683,0x1a3));var _0x3168=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1683[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x3168('0x0'));var db=require(_0x3168('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x3168('0x2')),'mail':require(_0x3168('0x3'))('mail-interactions'),'fax':require(_0x3168('0x3'))('fax-interactions'),'sms':require(_0x3168('0x3'))(_0x3168('0x4')),'chat':require(_0x3168('0x3'))(_0x3168('0x5')),'whatsapp':require('../../config/logger')(_0x3168('0x6'))};function getAccountFK(_0x5b210b){return _[_0x3168('0x7')](_0x5b210b)+(_0x5b210b===_0x3168('0x8')?_0x3168('0x9'):_0x3168('0xa'))+'Id';}function getInteractionFK(_0x515c45){return _['capitalize'](_0x515c45)+_0x3168('0xb');}function getInteractionId(_0x234e3b,_0x521579,_0x24e4fa){if(_0x234e3b&&_0x234e3b[_[_0x3168('0xc')](_0x24e4fa)+_0x3168('0xb')]){return _0x234e3b[_[_0x3168('0xc')](_0x24e4fa)+_0x3168('0xb')];}else if(_0x234e3b&&_0x234e3b['id']){return _0x234e3b['id'];}else if(_0x521579&&_0x521579['id']){return _0x521579['id'];}else{return _0x3168('0xd');}}function getInteractionsTables(_0x18cf16){return{'accounts':_0x18cf16+'_'+(_0x18cf16===_0x3168('0x8')?_0x3168('0xe'):'accounts'),'interactions':_0x18cf16+_0x3168('0xf'),'interactionsTags':_0x18cf16+'_interaction_has_tags','messages':_0x18cf16+_0x3168('0x10'),'userInteractions':'user_has_'+_0x18cf16+'_interactions'};}function getSelectedTags(_0x468444){var _0x3b76fd=[];if(_0x468444){_0x3b76fd=Array['isArray'](_0x468444)?_0x468444:[_0x468444];}return _0x3b76fd;}function log(_0x5e5a67,_0x47df26,_0x3807b4,_0x3e6fa7,_0x57df2e,_0x5d9ef4){loggers[_0x57df2e[_0x3168('0x11')]()][_0x5e5a67](_0x3168('0x12'),_0x5d9ef4['toUpperCase'](),_0x47df26?_0x47df26['id']:null,_0x47df26?_0x47df26[_0x3168('0x13')]:null,_0x47df26?_0x47df26[_0x3168('0x14')]:null,getInteractionId(_0x3807b4,_0x3e6fa7,_0x57df2e),_0x3807b4?JSON[_0x3168('0x15')](_0x3807b4):_0x3168('0x16'));}function updateUser(_0x5790f9,_0x4faa5b,_0x52c5af,_0x2e0c48,_0xe85ce8){db[_['upperFirst'](_0x2e0c48)+_0x3168('0x17')]['findOne']({'where':{'id':getInteractionId(_0x4faa5b,_0x52c5af,_0x2e0c48)}})[_0x3168('0x18')](function(_0x30c036){if(_0x30c036){return _0x30c036[_0x3168('0x19')]({'UserId':_0x5790f9?_0x5790f9['id']:null});}})[_0x3168('0x18')](function(_0x5b7955){if(_0x5b7955){log('info',_0x5790f9,_0x4faa5b,_0x52c5af,_0x2e0c48,_0xe85ce8);}})[_0x3168('0x1a')](function(){log('error',_0x5790f9,_0x4faa5b,_0x52c5af,_0x2e0c48,_0xe85ce8);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0xa2f1=['user_has_','_interactions','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','Interaction','findOne','then','update','info','catch','exports','lodash','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','capitalize','chat','InteractionId','upperFirst','unknown','websites','accounts','_interaction_has_tags','_messages'];(function(_0x1e2c98,_0x515861){var _0x2b866a=function(_0xabc193){while(--_0xabc193){_0x1e2c98['push'](_0x1e2c98['shift']());}};_0x2b866a(++_0x515861);}(_0xa2f1,0x1d0));var _0x1a2f=function(_0x54e74d,_0x420af5){_0x54e74d=_0x54e74d-0x0;var _0x24e035=_0xa2f1[_0x54e74d];return _0x24e035;};'use strict';var _=require(_0x1a2f('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x1a2f('0x1'))(_0x1a2f('0x2')),'mail':require(_0x1a2f('0x1'))(_0x1a2f('0x3')),'fax':require(_0x1a2f('0x1'))(_0x1a2f('0x4')),'sms':require(_0x1a2f('0x1'))(_0x1a2f('0x5')),'chat':require(_0x1a2f('0x1'))(_0x1a2f('0x6')),'whatsapp':require(_0x1a2f('0x1'))('whatsapp-interactions')};function getAccountFK(_0x63f2bd){return _[_0x1a2f('0x7')](_0x63f2bd)+(_0x63f2bd===_0x1a2f('0x8')?'Website':'Account')+'Id';}function getInteractionFK(_0x37595d){return _[_0x1a2f('0x7')](_0x37595d)+_0x1a2f('0x9');}function getInteractionId(_0x4b73c4,_0x27fb9e,_0x11daf9){if(_0x4b73c4&&_0x4b73c4[_[_0x1a2f('0xa')](_0x11daf9)+_0x1a2f('0x9')]){return _0x4b73c4[_[_0x1a2f('0xa')](_0x11daf9)+_0x1a2f('0x9')];}else if(_0x4b73c4&&_0x4b73c4['id']){return _0x4b73c4['id'];}else if(_0x27fb9e&&_0x27fb9e['id']){return _0x27fb9e['id'];}else{return _0x1a2f('0xb');}}function getInteractionsTables(_0x30eb17){return{'accounts':_0x30eb17+'_'+(_0x30eb17==='chat'?_0x1a2f('0xc'):_0x1a2f('0xd')),'interactions':_0x30eb17+'_interactions','interactionsTags':_0x30eb17+_0x1a2f('0xe'),'messages':_0x30eb17+_0x1a2f('0xf'),'userInteractions':_0x1a2f('0x10')+_0x30eb17+_0x1a2f('0x11')};}function getSelectedTags(_0x4afd4c){var _0x461edf=[];if(_0x4afd4c){_0x461edf=Array[_0x1a2f('0x12')](_0x4afd4c)?_0x4afd4c:[_0x4afd4c];}return _0x461edf;}function log(_0x227648,_0x3a81de,_0x550f0b,_0x426d3f,_0x24e864,_0x362c02){loggers[_0x24e864[_0x1a2f('0x13')]()][_0x227648](_0x1a2f('0x14'),_0x362c02[_0x1a2f('0x15')](),_0x3a81de?_0x3a81de['id']:null,_0x3a81de?_0x3a81de[_0x1a2f('0x16')]:null,_0x3a81de?_0x3a81de[_0x1a2f('0x17')]:null,getInteractionId(_0x550f0b,_0x426d3f,_0x24e864),_0x550f0b?JSON[_0x1a2f('0x18')](_0x550f0b):'null');}function updateUser(_0x5336e8,_0x1d2df5,_0x1dd360,_0x5da674,_0x250069){db[_[_0x1a2f('0xa')](_0x5da674)+_0x1a2f('0x19')][_0x1a2f('0x1a')]({'where':{'id':getInteractionId(_0x1d2df5,_0x1dd360,_0x5da674)}})[_0x1a2f('0x1b')](function(_0x5c18d8){if(_0x5c18d8){return _0x5c18d8[_0x1a2f('0x1c')]({'UserId':_0x5336e8?_0x5336e8['id']:null});}})[_0x1a2f('0x1b')](function(_0x1c7d0f){if(_0x1c7d0f){log(_0x1a2f('0x1d'),_0x5336e8,_0x1d2df5,_0x1dd360,_0x5da674,_0x250069);}})[_0x1a2f('0x1e')](function(){log('error',_0x5336e8,_0x1d2df5,_0x1dd360,_0x5da674,_0x250069);});}module[_0x1a2f('0x1f')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 86cbb86..f936c5c 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 _0x4e39=['license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','final','utf8','parse','hasOwnProperty','use','License','then','status','json','users','User','admin','user','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1'];(function(_0x5a258c,_0x110d7b){var _0x3ed7ff=function(_0x10bb51){while(--_0x10bb51){_0x5a258c['push'](_0x5a258c['shift']());}};_0x3ed7ff(++_0x110d7b);}(_0x4e39,0x14d));var _0x94e3=function(_0x1eb585,_0x202476){_0x1eb585=_0x1eb585-0x0;var _0x497ee2=_0x4e39[_0x1eb585];return _0x497ee2;};'use strict';var crypto=require(_0x94e3('0x0'));var util=require(_0x94e3('0x1'));var compose=require('composable-middleware');var db=require(_0x94e3('0x2'))['db'];var config=require(_0x94e3('0x3'));function getValueFromLicense(_0x7e1233,_0x3c7d47){if(_0x7e1233&&_0x3c7d47){if(_0x3c7d47[_0x94e3('0x4')]&&_0x3c7d47[_0x94e3('0x5')]){var _0x15bf6a=_0x3c7d47['data1'];var _0x189222=_0x3c7d47['license'];var _0x204832=_0x15bf6a[_0x94e3('0x6')]('-')[0x4];var _0xd1cb6f=_0x15bf6a['split']('-')[0x0];var _0x103b2b=crypto[_0x94e3('0x7')](_0x94e3('0x8'),util[_0x94e3('0x9')](_0x94e3('0xa'),_0x204832,_0x15bf6a,_0xd1cb6f));var _0x58235b=_0x103b2b[_0x94e3('0xb')](_0x189222,'base64','utf8');_0x58235b+=_0x103b2b[_0x94e3('0xc')](_0x94e3('0xd'));var _0x39264c=JSON[_0x94e3('0xe')](_0x58235b);return _0x39264c[_0x94e3('0xf')](_0x7e1233)?_0x39264c[_0x7e1233]:null;}}return null;}function isLimit(_0x3e5003,_0x1b3a71,_0x35b85b,_0xb37ead){var _0xca9c62=_0x1b3a71;return compose()[_0x94e3('0x10')](function(_0x332421,_0x43d6dd,_0x24ddda){return db[_0x94e3('0x11')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x94e3('0x12')](function(_0x568c22){var _0xfc75d7=getValueFromLicense(_0x3e5003,_0x568c22);return _0xfc75d7?_0xfc75d7:_0xca9c62;})['then'](function(_0x267319){_0xca9c62=_0x267319;return _0x35b85b['count'](_0xb37ead);})[_0x94e3('0x12')](function(_0x1bdf96){if(_0x1bdf96>=_0xca9c62){return _0x43d6dd[_0x94e3('0x13')](0x193)[_0x94e3('0x14')]({'message':util[_0x94e3('0x9')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x3e5003)});}_0x24ddda();})['catch'](function(_0xa7dac2){_0x24ddda(_0xa7dac2);});});}function isUserLimit(){return isLimit(_0x94e3('0x15'),0x1,db[_0x94e3('0x16')],{'where':{'$or':[{'role':_0x94e3('0x17')},{'role':_0x94e3('0x18')}]}});}exports[_0x94e3('0x19')]=isUserLimit; \ No newline at end of file +var _0x1c68=['%s:%s:%s','update','base64','parse','hasOwnProperty','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','data1','license','split','createDecipher','aes-256-ctr','format'];(function(_0x3a840c,_0x71c4c0){var _0x59ecdc=function(_0x537b84){while(--_0x537b84){_0x3a840c['push'](_0x3a840c['shift']());}};_0x59ecdc(++_0x71c4c0);}(_0x1c68,0x9e));var _0x81c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c68[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require(_0x81c6('0x0'));var util=require(_0x81c6('0x1'));var compose=require(_0x81c6('0x2'));var db=require(_0x81c6('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x4009e3,_0x438ac9){if(_0x4009e3&&_0x438ac9){if(_0x438ac9['data1']&&_0x438ac9['license']){var _0x44f468=_0x438ac9[_0x81c6('0x4')];var _0x177eac=_0x438ac9[_0x81c6('0x5')];var _0x1551b1=_0x44f468[_0x81c6('0x6')]('-')[0x4];var _0x80a660=_0x44f468[_0x81c6('0x6')]('-')[0x0];var _0x402f13=crypto[_0x81c6('0x7')](_0x81c6('0x8'),util[_0x81c6('0x9')](_0x81c6('0xa'),_0x1551b1,_0x44f468,_0x80a660));var _0x3177d3=_0x402f13[_0x81c6('0xb')](_0x177eac,_0x81c6('0xc'),'utf8');_0x3177d3+=_0x402f13['final']('utf8');var _0x20a615=JSON[_0x81c6('0xd')](_0x3177d3);return _0x20a615[_0x81c6('0xe')](_0x4009e3)?_0x20a615[_0x4009e3]:null;}}return null;}function isLimit(_0xf9f622,_0x4aed87,_0x44302f,_0x5ee76d){var _0x498da7=_0x4aed87;return compose()['use'](function(_0x337ca8,_0x19c5b7,_0x5a3034){return db['License'][_0x81c6('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x81c6('0x10')](function(_0x584f18){var _0xed901e=getValueFromLicense(_0xf9f622,_0x584f18);return _0xed901e?_0xed901e:_0x498da7;})[_0x81c6('0x10')](function(_0xf3a3db){_0x498da7=_0xf3a3db;return _0x44302f[_0x81c6('0x11')](_0x5ee76d);})[_0x81c6('0x10')](function(_0x565d9a){if(_0x565d9a>=_0x498da7){return _0x19c5b7[_0x81c6('0x12')](0x193)[_0x81c6('0x13')]({'message':util[_0x81c6('0x9')](_0x81c6('0x14'),_0xf9f622)});}_0x5a3034();})['catch'](function(_0x16cbf7){_0x5a3034(_0x16cbf7);});});}function isUserLimit(){return isLimit(_0x81c6('0x15'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':_0x81c6('0x16')}]}});}exports[_0x81c6('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 4d9ad83..77f75b3 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 _0xc0e8=['moment','parseSearch','startsWith','replace','[$and]','[$or]','length','split','slice','forEach','shift','match','indexOf','map','conditions','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$notIn','=\x20?','<>\x20?','$startsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$lte','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$substring','$endsWith','utcOffset','minutes','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc0e8,0x117));var _0x8c0e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc0e8[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x8c0e('0x0'));var moment=require(_0x8c0e('0x1'));exports[_0x8c0e('0x2')]=function(_0x1235b8){var _0x4b3910={'conditions':[]};_0x4b3910['sqlOperator']=_[_0x8c0e('0x3')](_0x1235b8,'[$or]')?'or':'and';var _0x3c2d73=_0x1235b8[_0x8c0e('0x4')](_0x8c0e('0x5'),'')[_0x8c0e('0x4')](_0x8c0e('0x6'),'')['split']('||');for(var _0x2e2688=0x0;_0x2e2688<_0x3c2d73[_0x8c0e('0x7')];_0x2e2688++){var _0x48ecf7=_0x3c2d73[_0x2e2688][_0x8c0e('0x8')](':=');var _0x1a5b7b=_0x48ecf7[0x0];var _0x261323=_0x48ecf7[_0x8c0e('0x9')](0x1);_0x261323[_0x8c0e('0xa')](function(_0x3699fe){var _0xf167f2=_0x3699fe[_0x8c0e('0x8')]('[')[_0x8c0e('0xb')]();var _0x4e6730=_0x3699fe[_0x8c0e('0xc')](/\[(.*?)\]/g);_0x4e6730[_0x8c0e('0xa')](function(_0x118b7e){var _0x1f4ae0=_0x118b7e[_0x8c0e('0x8')]('[')['filter'](function(_0x21e345){return _0x21e345[_0x8c0e('0xd')](']')>-0x1;})[_0x8c0e('0xe')](function(_0xaac356){return _0xaac356[_0x8c0e('0x8')](']')[0x0];})[0x0];_0x4b3910[_0x8c0e('0xf')]['push']({'field':_0x1a5b7b,'operator':_0xf167f2,'value':_0x1f4ae0});});});}return _0x4b3910;};exports[_0x8c0e('0x10')]=function(_0x3ce050,_0x2cd79f,_0x13f6f3){var _0x5da847={};if(_0x2cd79f===_0x8c0e('0x11')){if(_0x13f6f3[_0x8c0e('0x12')]===_0x8c0e('0x13')){_0x13f6f3[_0x8c0e('0x12')]=_0x8c0e('0x14');_0x13f6f3[_0x8c0e('0x15')]+=','+_0x13f6f3['value'];}else if(_[_0x8c0e('0x16')]([_0x8c0e('0x17'),'$lte'],_0x13f6f3['operator'])){_0x13f6f3['value']=moment(_0x13f6f3[_0x8c0e('0x15')])[_0x8c0e('0x18')](0x1,_0x8c0e('0x19'))[_0x8c0e('0x1a')](_0x8c0e('0x1b'));}}if(_0x13f6f3[_0x8c0e('0x1c')]){_0x2cd79f=_0x13f6f3['castTo'];_0x5da847[_0x8c0e('0x1d')]=_0x8c0e('0x1e')+_0x3ce050+'.'+_0x13f6f3[_0x8c0e('0x1f')]+_0x8c0e('0x20')+_0x13f6f3[_0x8c0e('0x1c')]+')\x20'+parseOperator(_0x13f6f3[_0x8c0e('0x12')]);}else{_0x5da847['text']=_0x3ce050+'.'+_0x13f6f3[_0x8c0e('0x1f')]+'\x20'+parseOperator(_0x13f6f3[_0x8c0e('0x12')]);}if(_[_0x8c0e('0x16')]([_0x8c0e('0x21'),'$notIn'],_0x13f6f3[_0x8c0e('0x12')]))_0x5da847['text']='('+_0x5da847[_0x8c0e('0x1d')]+_0x8c0e('0x22')+_0x3ce050+'.'+_0x13f6f3[_0x8c0e('0x1f')]+_0x8c0e('0x23');_0x5da847[_0x8c0e('0x15')]=parseValue(_0x2cd79f,_0x13f6f3[_0x8c0e('0x12')],_0x13f6f3[_0x8c0e('0x15')]);return _0x5da847;};function parseOperator(_0x1b1c49){var _0x564cca;switch(_0x1b1c49){case _0x8c0e('0x24'):_0x564cca=_0x8c0e('0x25');break;case _0x8c0e('0x26'):_0x564cca='NOT\x20IN\x20?';break;case _0x8c0e('0x13'):_0x564cca=_0x8c0e('0x27');break;case'$ne':_0x564cca=_0x8c0e('0x28');break;case'$substring':case _0x8c0e('0x29'):case'$endsWith':_0x564cca=_0x8c0e('0x2a');break;case _0x8c0e('0x2b'):_0x564cca=_0x8c0e('0x2c');break;case _0x8c0e('0x17'):_0x564cca=_0x8c0e('0x2d');break;case _0x8c0e('0x2e'):_0x564cca=_0x8c0e('0x2f');break;case _0x8c0e('0x30'):_0x564cca=_0x8c0e('0x31');break;case _0x8c0e('0x14'):_0x564cca=_0x8c0e('0x32');break;}return _0x564cca;}function parseValue(_0x4af0ca,_0x31f2ab,_0x7b395f){var _0x22fd03={'start':undefined,'end':undefined};switch(_0x31f2ab){case _0x8c0e('0x24'):case _0x8c0e('0x26'):_0x22fd03[_0x8c0e('0x33')]=_0x7b395f['split'](',');break;case _0x8c0e('0x34'):_0x22fd03[_0x8c0e('0x33')]='%'+_0x7b395f+'%';break;case _0x8c0e('0x29'):_0x22fd03[_0x8c0e('0x33')]=_0x7b395f+'%';break;case _0x8c0e('0x35'):_0x22fd03[_0x8c0e('0x33')]='%'+_0x7b395f;break;case _0x8c0e('0x14'):var _0x8d2631=_0x7b395f['split'](',');var _0x7b395f=_0x8d2631[_0x8c0e('0xb')]();var _0x2eca59=_0x8d2631['pop']();if(_0x4af0ca==='DATE'){_0x7b395f=moment(_0x7b395f)['utcOffset'](0x0,!![])[_0x8c0e('0x1a')]();_0x2eca59=moment(_0x2eca59)[_0x8c0e('0x36')](0x0,!![])['add'](0x17,'hours')[_0x8c0e('0x18')](0x3b,_0x8c0e('0x37'))[_0x8c0e('0x18')](0x3b,'seconds')[_0x8c0e('0x1a')]();}_0x22fd03={'start':_0x7b395f,'end':_0x2eca59};break;default:_0x22fd03[_0x8c0e('0x33')]=_0x7b395f;break;}return _0x22fd03;} \ No newline at end of file +var _0xd57f=['<>\x20?','$substring','$endsWith','LIKE\x20?','<\x20?','$lte','<=\x20?','>=\x20?','$between','start','$startsWith','utcOffset','format','add','hours','lodash','moment','parseSearch','sqlOperator','[$or]','and','replace','[$and]','split','slice','forEach','shift','match','filter','indexOf','map','push','buildExpression','DATE','$eq','operator','value','$gt','days','YYYY-MM-DD','castTo','field','text','includes','$ne','$notIn','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?'];(function(_0x156371,_0xe7ddb7){var _0x12c7dc=function(_0x1ab17b){while(--_0x1ab17b){_0x156371['push'](_0x156371['shift']());}};_0x12c7dc(++_0xe7ddb7);}(_0xd57f,0x10e));var _0xfd57=function(_0x5668f0,_0x281b14){_0x5668f0=_0x5668f0-0x0;var _0x1c86ad=_0xd57f[_0x5668f0];return _0x1c86ad;};'use strict';var _=require(_0xfd57('0x0'));var moment=require(_0xfd57('0x1'));exports[_0xfd57('0x2')]=function(_0x1d1388){var _0xb85ede={'conditions':[]};_0xb85ede[_0xfd57('0x3')]=_['startsWith'](_0x1d1388,_0xfd57('0x4'))?'or':_0xfd57('0x5');var _0x4323c5=_0x1d1388[_0xfd57('0x6')](_0xfd57('0x7'),'')[_0xfd57('0x6')](_0xfd57('0x4'),'')['split']('||');for(var _0x28f833=0x0;_0x28f833<_0x4323c5['length'];_0x28f833++){var _0xf7299d=_0x4323c5[_0x28f833][_0xfd57('0x8')](':=');var _0x590e7e=_0xf7299d[0x0];var _0x4e4af1=_0xf7299d[_0xfd57('0x9')](0x1);_0x4e4af1[_0xfd57('0xa')](function(_0x822d5){var _0x369452=_0x822d5[_0xfd57('0x8')]('[')[_0xfd57('0xb')]();var _0x25ca73=_0x822d5[_0xfd57('0xc')](/\[(.*?)\]/g);_0x25ca73['forEach'](function(_0x6e38f1){var _0x1ad3f6=_0x6e38f1[_0xfd57('0x8')]('[')[_0xfd57('0xd')](function(_0x2496b8){return _0x2496b8[_0xfd57('0xe')](']')>-0x1;})[_0xfd57('0xf')](function(_0x316091){return _0x316091[_0xfd57('0x8')](']')[0x0];})[0x0];_0xb85ede['conditions'][_0xfd57('0x10')]({'field':_0x590e7e,'operator':_0x369452,'value':_0x1ad3f6});});});}return _0xb85ede;};exports[_0xfd57('0x11')]=function(_0x2728f0,_0x276dd9,_0x312e19){var _0x10cc7b={};if(_0x276dd9===_0xfd57('0x12')){if(_0x312e19['operator']===_0xfd57('0x13')){_0x312e19[_0xfd57('0x14')]='$between';_0x312e19[_0xfd57('0x15')]+=','+_0x312e19[_0xfd57('0x15')];}else if(_['includes']([_0xfd57('0x16'),'$lte'],_0x312e19['operator'])){_0x312e19[_0xfd57('0x15')]=moment(_0x312e19[_0xfd57('0x15')])['add'](0x1,_0xfd57('0x17'))['format'](_0xfd57('0x18'));}}if(_0x312e19[_0xfd57('0x19')]){_0x276dd9=_0x312e19[_0xfd57('0x19')];_0x10cc7b['text']='CAST('+_0x2728f0+'.'+_0x312e19[_0xfd57('0x1a')]+'\x20AS\x20'+_0x312e19['castTo']+')\x20'+parseOperator(_0x312e19[_0xfd57('0x14')]);}else{_0x10cc7b[_0xfd57('0x1b')]=_0x2728f0+'.'+_0x312e19[_0xfd57('0x1a')]+'\x20'+parseOperator(_0x312e19['operator']);}if(_[_0xfd57('0x1c')]([_0xfd57('0x1d'),_0xfd57('0x1e')],_0x312e19[_0xfd57('0x14')]))_0x10cc7b[_0xfd57('0x1b')]='('+_0x10cc7b[_0xfd57('0x1b')]+'\x20OR\x20'+_0x2728f0+'.'+_0x312e19['field']+_0xfd57('0x1f');_0x10cc7b[_0xfd57('0x15')]=parseValue(_0x276dd9,_0x312e19['operator'],_0x312e19[_0xfd57('0x15')]);return _0x10cc7b;};function parseOperator(_0x241d94){var _0x2ebb64;switch(_0x241d94){case _0xfd57('0x20'):_0x2ebb64=_0xfd57('0x21');break;case _0xfd57('0x1e'):_0x2ebb64=_0xfd57('0x22');break;case _0xfd57('0x13'):_0x2ebb64=_0xfd57('0x23');break;case'$ne':_0x2ebb64=_0xfd57('0x24');break;case _0xfd57('0x25'):case'$startsWith':case _0xfd57('0x26'):_0x2ebb64=_0xfd57('0x27');break;case'$lt':_0x2ebb64=_0xfd57('0x28');break;case _0xfd57('0x16'):_0x2ebb64='>\x20?';break;case _0xfd57('0x29'):_0x2ebb64=_0xfd57('0x2a');break;case'$gte':_0x2ebb64=_0xfd57('0x2b');break;case _0xfd57('0x2c'):_0x2ebb64='BETWEEN\x20?\x20AND\x20?';break;}return _0x2ebb64;}function parseValue(_0x285508,_0x5f25fd,_0x377279){var _0x92f0d8={'start':undefined,'end':undefined};switch(_0x5f25fd){case _0xfd57('0x20'):case _0xfd57('0x1e'):_0x92f0d8[_0xfd57('0x2d')]=_0x377279[_0xfd57('0x8')](',');break;case _0xfd57('0x25'):_0x92f0d8[_0xfd57('0x2d')]='%'+_0x377279+'%';break;case _0xfd57('0x2e'):_0x92f0d8[_0xfd57('0x2d')]=_0x377279+'%';break;case _0xfd57('0x26'):_0x92f0d8[_0xfd57('0x2d')]='%'+_0x377279;break;case _0xfd57('0x2c'):var _0xed681e=_0x377279[_0xfd57('0x8')](',');var _0x377279=_0xed681e[_0xfd57('0xb')]();var _0xbe7c47=_0xed681e['pop']();if(_0x285508==='DATE'){_0x377279=moment(_0x377279)[_0xfd57('0x2f')](0x0,!![])[_0xfd57('0x30')]();_0xbe7c47=moment(_0xbe7c47)[_0xfd57('0x2f')](0x0,!![])[_0xfd57('0x31')](0x17,_0xfd57('0x32'))[_0xfd57('0x31')](0x3b,'minutes')[_0xfd57('0x31')](0x3b,'seconds')[_0xfd57('0x30')]();}_0x92f0d8={'start':_0x377279,'end':_0xbe7c47};break;default:_0x92f0d8[_0xfd57('0x2d')]=_0x377279;break;}return _0x92f0d8;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 8577926..5bd201e 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 _0x0e2e=['{EXPR}','replace','push','getOptions','$id','query','filters','intersection','model','attributes','nolimit','limit','sort','where','pick','object','filter','columns','merge','type','lower','options','lodash','sequelize','moment','parse','keys','includes','fields','split','isEmpty','forOwn','find','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','offset','map','indexOf','priority','col','unsigned','DESC','cast','ASC','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22'];(function(_0x574e21,_0x5a5fa2){var _0x33a6dd=function(_0x58ab82){while(--_0x58ab82){_0x574e21['push'](_0x574e21['shift']());}};_0x33a6dd(++_0x5a5fa2);}(_0x0e2e,0x156));var _0xe0e2=function(_0x39759e,_0xb19f4d){_0x39759e=_0x39759e-0x0;var _0x563cd2=_0x0e2e[_0x39759e];return _0x563cd2;};'use strict';var _=require(_0xe0e2('0x0'));var sequelize=require(_0xe0e2('0x1'));var moment=require(_0xe0e2('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0xb0f892){var _0x3a53ba=['ne'];try{var _0x503c59=JSON[_0xe0e2('0x3')](_0xb0f892);var _0x184bbb=Object[_0xe0e2('0x4')](_0x503c59)[0x0];return _0x3a53ba[_0xe0e2('0x5')](_0x184bbb);}catch(_0x823547){return![];}}function getOperatorValue(_0x56ec04){var _0x20c77d=JSON[_0xe0e2('0x3')](_0x56ec04);var _0x4a8cdd=Object['keys'](_0x20c77d)[0x0];var _0x3c05dd=_0x20c77d[_0x4a8cdd];return{['$'+_0x4a8cdd]:_0x3c05dd};}exports[_0xe0e2('0x6')]=function(_0x508416){var _0x26a981=null;if(_0x508416){_0x26a981=_0x508416[_0xe0e2('0x7')](',');}return _0x26a981;};exports['filters']=function(_0xcecfab,_0x2520e0){var _0x47b4f3={};if(!_[_0xe0e2('0x8')](_0xcecfab)){_[_0xe0e2('0x9')](_0xcecfab,function(_0x104d40,_0x1279a8){try{if(_0x2520e0){var _0x24b840=_[_0xe0e2('0xa')](_0x2520e0,{'name':_0x1279a8})||{};if(hasSequelizeOperator(_0x104d40)){_0x47b4f3[_0x1279a8]=getOperatorValue(_0x104d40);}else if(_0x24b840['type']==='DATE'&&_[_0xe0e2('0xb')](_0x104d40)){var _0x3c6c48=JSON['parse'](_0x104d40);var _0x538981={'$gte':moment(moment(_0x3c6c48[_0xe0e2('0xc')])[_0xe0e2('0xd')](_0xe0e2('0xe')))[_0xe0e2('0xf')]()[_0xe0e2('0xd')](),'$lte':moment(moment(_0x3c6c48[_0xe0e2('0x10')])[_0xe0e2('0xd')](_0xe0e2('0xe')))[_0xe0e2('0xf')]()[_0xe0e2('0x11')](0x1,'s')[_0xe0e2('0xd')]()};_0x47b4f3[_0x1279a8]=_0x538981;}else if(_0x24b840[_0xe0e2('0x12')]===_0xe0e2('0x13')){_0x47b4f3[_0x1279a8]=_0x104d40;}else{_0x47b4f3[_0x1279a8]=_[_0xe0e2('0x14')](_0x104d40)?_0x104d40:JSON[_0xe0e2('0x3')](_0x104d40);}}else{_0x47b4f3[_0x1279a8]=_[_0xe0e2('0x14')](_0x104d40)?_0x104d40:JSON[_0xe0e2('0x3')](_0x104d40);}}catch(_0xbd246){_0x47b4f3[_0x1279a8]=_0x104d40[_0xe0e2('0x7')](',');}});}return _0x47b4f3;};exports['limit']=function(_0x308c9e){_0x308c9e=parseInt(_0x308c9e,0xa);if(!_0x308c9e||_0x308c9e<0x0){_0x308c9e=LIMIT_VALUE;}return _0x308c9e;};exports[_0xe0e2('0x15')]=function(_0x560174){_0x560174=parseInt(_0x560174,0xa);if(!_0x560174||_0x560174<0x0){_0x560174=0x0;}return _0x560174;};exports['sort']=function(_0x285cb0){var _0x3893c3,_0x13e8b0=null;if(_0x285cb0){_0x3893c3=_0x285cb0['split'](',');_0x13e8b0=_[_0xe0e2('0x16')](_0x3893c3,function(_0x1b5503){if(_0x1b5503[_0xe0e2('0x17')]('-')===0x0){return[_0x1b5503===_0xe0e2('0x18')?sequelize['cast'](sequelize[_0xe0e2('0x19')](_0xe0e2('0x18')),_0xe0e2('0x1a')):_0x1b5503['substr'](0x1),_0xe0e2('0x1b')];}else{return[_0x1b5503==='priority'?sequelize[_0xe0e2('0x1c')](sequelize['col'](_0xe0e2('0x18')),_0xe0e2('0x1a')):_0x1b5503,_0xe0e2('0x1d')];}});}return _0x13e8b0;};exports[_0xe0e2('0x1e')]=function(_0x2ff79d,_0x2eabfa){if(_[_0xe0e2('0x8')](_0x2ff79d)){return _0x2ff79d;}if(_[_0xe0e2('0x14')](_0x2ff79d)){for(var _0x3fd0d2=0x0;_0x3fd0d2<_0x2ff79d[_0xe0e2('0x1f')];_0x3fd0d2+=0x1){_0x2ff79d[_0x3fd0d2]=this[_0xe0e2('0x1e')](_0x2ff79d[_0x3fd0d2],_0x2eabfa);}return _0x2ff79d;}if(!_[_0xe0e2('0x20')](_0x2ff79d)){return _0x2ff79d;}if(_[_0xe0e2('0x21')](_0x2eabfa)){_0x2eabfa=[_0x2eabfa];}if(!_['isArray'](_0x2eabfa)){return _0x2ff79d;}for(var _0x2589e=0x0;_0x2589e<_0x2eabfa[_0xe0e2('0x1f')];_0x2589e+=0x1){_[_0xe0e2('0x22')](_0x2ff79d,_0x2eabfa[_0x2589e]);}for(var _0x58fdc2 in _0x2ff79d){if(_0x2ff79d[_0xe0e2('0x23')](_0x58fdc2)){_0x2ff79d[_0x58fdc2]=this[_0xe0e2('0x1e')](_0x2ff79d[_0x58fdc2],_0x2eabfa);}}return _0x2ff79d;};exports[_0xe0e2('0x24')]=function(_0x18e84a){return _0x18e84a[_0xe0e2('0x25')](RegExp(_0xe0e2('0x26')))?!![]:![];};exports[_0xe0e2('0x27')]=function(_0x342601){return _0x342601[_0xe0e2('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0xe0e2('0x28')]=function(_0x47f3ac,_0x17c569){var _0x468e93=[];var _0x3ac83a=/[ `!@#$%^&*()_\-?~]/;var _0x17227f=_0x17c569?_0xe0e2('0x29'):_0xe0e2('0x2a');_0x47f3ac[_0xe0e2('0x7')](/[ ,]+/)['forEach'](function(_0x176c98){_0x176c98=_0x176c98[_0xe0e2('0x2b')](/([^:]")"+/g,'$1');_0x176c98='+'+_0x176c98+'*';var _0x58e6a7=_0x176c98[_0xe0e2('0x25')](_0x3ac83a);if(_0x58e6a7){_0x176c98='\x22'+_0x176c98+'\x22';}_0x468e93[_0xe0e2('0x2c')](_0x176c98);});_0x17227f=_0x17227f[_0xe0e2('0x2b')]('{EXPR}',_0x468e93['join']('\x20'));return _0x17227f;};exports[_0xe0e2('0x2d')]=function(_0x8cc2f0,_0x471cde,_0x2cc623){var _0x37f35e={},_0x4f6e99={};if(_0x471cde['query'][_0xe0e2('0x2e')]){_0x471cde[_0xe0e2('0x2f')]['id']=_0x471cde[_0xe0e2('0x2f')][_0xe0e2('0x2e')];delete _0x471cde[_0xe0e2('0x2f')][_0xe0e2('0x2e')];}_0x37f35e['model']=_[_0xe0e2('0x16')](_0x8cc2f0,_0xe0e2('0x12'));_0x37f35e[_0xe0e2('0x2f')]=_['keys'](_0x471cde['query']);_0x37f35e[_0xe0e2('0x30')]=_[_0xe0e2('0x31')](_0x37f35e[_0xe0e2('0x32')],_0x37f35e['query']);_0x4f6e99['attributes']=_[_0xe0e2('0x31')](_0x37f35e['model'],this[_0xe0e2('0x6')](_0x471cde[_0xe0e2('0x2f')][_0xe0e2('0x6')]));_0x4f6e99['attributes']=_0x4f6e99[_0xe0e2('0x33')][_0xe0e2('0x1f')]?_0x4f6e99[_0xe0e2('0x33')]:_0x37f35e[_0xe0e2('0x32')];if(!_0x471cde[_0xe0e2('0x2f')][_0xe0e2('0x23')](_0xe0e2('0x34'))){_0x4f6e99['limit']=this[_0xe0e2('0x35')](_0x471cde[_0xe0e2('0x2f')][_0xe0e2('0x35')]);_0x4f6e99[_0xe0e2('0x15')]=this[_0xe0e2('0x15')](_0x471cde['query'][_0xe0e2('0x15')]);}_0x4f6e99['order']=this[_0xe0e2('0x36')](_0x471cde[_0xe0e2('0x2f')][_0xe0e2('0x36')]);_0x4f6e99[_0xe0e2('0x37')]=this[_0xe0e2('0x30')](_[_0xe0e2('0x38')](_0x471cde[_0xe0e2('0x2f')],_0x37f35e['filters']),_0x8cc2f0);if(_0x471cde[_0xe0e2('0x2f')]['filter']){var _0x52cd9b=_0x8cc2f0;var _0x24200d=_0x471cde[_0xe0e2('0x2f')]['filter'];if(typeof _0x24200d===_0xe0e2('0x39')){_0x52cd9b=_[_0xe0e2('0x3a')](_0x8cc2f0,function(_0xc99427){return _[_0xe0e2('0x5')](_0x24200d[_0xe0e2('0x3b')],_0xc99427[_0xe0e2('0x12')]);});_0x24200d=_0x24200d['value'];}_0x4f6e99[_0xe0e2('0x37')]=_[_0xe0e2('0x3c')](_0x4f6e99['where'],{'$or':_['map'](_0x52cd9b,function(_0xc11eb7){if(_0xc11eb7[_0xe0e2('0x3d')]!=='VIRTUAL'){if(_0x2cc623){return sequelize[_0xe0e2('0x37')](sequelize['fn']('lower',sequelize[_0xe0e2('0x19')](_0xc11eb7[_0xe0e2('0x12')])),{'$like':sequelize['fn'](_0xe0e2('0x3e'),'%'+_0x471cde[_0xe0e2('0x2f')]['filter']+'%')});}else{var _0x4157e4={};_0x4157e4[_0xc11eb7[_0xe0e2('0x12')]]={'$like':'%'+_0x471cde['query'][_0xe0e2('0x3a')]+'%'};return _0x4157e4;}}})});}_0x4f6e99=_[_0xe0e2('0x3c')]({},_0x4f6e99,_0x471cde[_0xe0e2('0x3f')]);return _0x4f6e99;}; \ No newline at end of file +var _0x6018=['columns','value','VIRTUAL','col','sequelize','keys','includes','parse','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','$lte','YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','offset','sort','map','indexOf','priority','cast','unsigned','substr','ASC','omit','length','isObject','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','\x22{EXPR}\x22','forEach','replace','push','{EXPR}','join','getOptions','query','$id','model','attributes','nolimit','limit','order','where','pick','filter'];(function(_0xd1dff5,_0x5f0269){var _0x280abf=function(_0x9b0f7e){while(--_0x9b0f7e){_0xd1dff5['push'](_0xd1dff5['shift']());}};_0x280abf(++_0x5f0269);}(_0x6018,0xf8));var _0x8601=function(_0x574573,_0x147478){_0x574573=_0x574573-0x0;var _0x17fa77=_0x6018[_0x574573];return _0x17fa77;};'use strict';var _=require('lodash');var sequelize=require(_0x8601('0x0'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x49830b){var _0x3b5910=['ne'];try{var _0x243619=JSON['parse'](_0x49830b);var _0x3270c3=Object[_0x8601('0x1')](_0x243619)[0x0];return _0x3b5910[_0x8601('0x2')](_0x3270c3);}catch(_0x438eb3){return![];}}function getOperatorValue(_0x3261ea){var _0x43dda1=JSON[_0x8601('0x3')](_0x3261ea);var _0x3c990c=Object[_0x8601('0x1')](_0x43dda1)[0x0];var _0x2e3bfc=_0x43dda1[_0x3c990c];return{['$'+_0x3c990c]:_0x2e3bfc};}exports[_0x8601('0x4')]=function(_0x30ead9){var _0x3048c2=null;if(_0x30ead9){_0x3048c2=_0x30ead9[_0x8601('0x5')](',');}return _0x3048c2;};exports[_0x8601('0x6')]=function(_0x53461c,_0x55526e){var _0xa9152a={};if(!_[_0x8601('0x7')](_0x53461c)){_[_0x8601('0x8')](_0x53461c,function(_0x3fae0b,_0x31a5c1){try{if(_0x55526e){var _0x4333ec=_[_0x8601('0x9')](_0x55526e,{'name':_0x31a5c1})||{};if(hasSequelizeOperator(_0x3fae0b)){_0xa9152a[_0x31a5c1]=getOperatorValue(_0x3fae0b);}else if(_0x4333ec[_0x8601('0xa')]===_0x8601('0xb')&&_[_0x8601('0xc')](_0x3fae0b)){var _0x14ce29=JSON['parse'](_0x3fae0b);var _0x2079cb={'$gte':moment(moment(_0x14ce29[_0x8601('0xd')])['format']('YYYY-MM-DD'))['utc']()[_0x8601('0xe')](),'$lte':moment(moment(_0x14ce29[_0x8601('0xf')])[_0x8601('0xe')](_0x8601('0x10')))[_0x8601('0x11')]()[_0x8601('0x12')](0x1,'s')[_0x8601('0xe')]()};_0xa9152a[_0x31a5c1]=_0x2079cb;}else if(_0x4333ec[_0x8601('0x13')]===_0x8601('0x14')){_0xa9152a[_0x31a5c1]=_0x3fae0b;}else{_0xa9152a[_0x31a5c1]=_[_0x8601('0x15')](_0x3fae0b)?_0x3fae0b:JSON[_0x8601('0x3')](_0x3fae0b);}}else{_0xa9152a[_0x31a5c1]=_['isArray'](_0x3fae0b)?_0x3fae0b:JSON['parse'](_0x3fae0b);}}catch(_0x32f7fb){_0xa9152a[_0x31a5c1]=_0x3fae0b[_0x8601('0x5')](',');}});}return _0xa9152a;};exports['limit']=function(_0x43cc2b){_0x43cc2b=parseInt(_0x43cc2b,0xa);if(!_0x43cc2b||_0x43cc2b<0x0){_0x43cc2b=LIMIT_VALUE;}return _0x43cc2b;};exports[_0x8601('0x16')]=function(_0xd39f1c){_0xd39f1c=parseInt(_0xd39f1c,0xa);if(!_0xd39f1c||_0xd39f1c<0x0){_0xd39f1c=0x0;}return _0xd39f1c;};exports[_0x8601('0x17')]=function(_0x3cb241){var _0x295149,_0x1003ba=null;if(_0x3cb241){_0x295149=_0x3cb241['split'](',');_0x1003ba=_[_0x8601('0x18')](_0x295149,function(_0x384189){if(_0x384189[_0x8601('0x19')]('-')===0x0){return[_0x384189===_0x8601('0x1a')?sequelize[_0x8601('0x1b')](sequelize['col']('priority'),_0x8601('0x1c')):_0x384189[_0x8601('0x1d')](0x1),'DESC'];}else{return[_0x384189===_0x8601('0x1a')?sequelize[_0x8601('0x1b')](sequelize['col'](_0x8601('0x1a')),'unsigned'):_0x384189,_0x8601('0x1e')];}});}return _0x1003ba;};exports[_0x8601('0x1f')]=function(_0x234df5,_0x21ddc0){if(_[_0x8601('0x7')](_0x234df5)){return _0x234df5;}if(_[_0x8601('0x15')](_0x234df5)){for(var _0x46e196=0x0;_0x46e196<_0x234df5[_0x8601('0x20')];_0x46e196+=0x1){_0x234df5[_0x46e196]=this[_0x8601('0x1f')](_0x234df5[_0x46e196],_0x21ddc0);}return _0x234df5;}if(!_[_0x8601('0x21')](_0x234df5)){return _0x234df5;}if(_[_0x8601('0x22')](_0x21ddc0)){_0x21ddc0=[_0x21ddc0];}if(!_[_0x8601('0x15')](_0x21ddc0)){return _0x234df5;}for(var _0x5a7403=0x0;_0x5a7403<_0x21ddc0[_0x8601('0x20')];_0x5a7403+=0x1){_['unset'](_0x234df5,_0x21ddc0[_0x5a7403]);}for(var _0x24a1a3 in _0x234df5){if(_0x234df5[_0x8601('0x23')](_0x24a1a3)){_0x234df5[_0x24a1a3]=this[_0x8601('0x1f')](_0x234df5[_0x24a1a3],_0x21ddc0);}}return _0x234df5;};exports[_0x8601('0x24')]=function(_0x194a1e){return _0x194a1e[_0x8601('0x25')](RegExp(_0x8601('0x26')))?!![]:![];};exports['isEmail']=function(_0x3df539){return _0x3df539[_0x8601('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0x8601('0x27')]=function(_0x5cdeb5,_0x541aab){var _0x22015d=[];var _0x1ad97d=/[ `!@#$%^&*()_\-?~]/;var _0x302222=_0x541aab?_0x8601('0x28'):'{EXPR}';_0x5cdeb5[_0x8601('0x5')](/[ ,]+/)[_0x8601('0x29')](function(_0x33e6a3){_0x33e6a3=_0x33e6a3[_0x8601('0x2a')](/([^:]")"+/g,'$1');_0x33e6a3='+'+_0x33e6a3+'*';var _0x2e7cb0=_0x33e6a3[_0x8601('0x25')](_0x1ad97d);if(_0x2e7cb0){_0x33e6a3='\x22'+_0x33e6a3+'\x22';}_0x22015d[_0x8601('0x2b')](_0x33e6a3);});_0x302222=_0x302222[_0x8601('0x2a')](_0x8601('0x2c'),_0x22015d[_0x8601('0x2d')]('\x20'));return _0x302222;};exports[_0x8601('0x2e')]=function(_0x17905f,_0x57a6ec,_0x463e85){var _0x4c30c9={},_0x4ebff5={};if(_0x57a6ec[_0x8601('0x2f')][_0x8601('0x30')]){_0x57a6ec[_0x8601('0x2f')]['id']=_0x57a6ec['query'][_0x8601('0x30')];delete _0x57a6ec[_0x8601('0x2f')][_0x8601('0x30')];}_0x4c30c9[_0x8601('0x31')]=_[_0x8601('0x18')](_0x17905f,_0x8601('0x13'));_0x4c30c9[_0x8601('0x2f')]=_[_0x8601('0x1')](_0x57a6ec[_0x8601('0x2f')]);_0x4c30c9[_0x8601('0x6')]=_['intersection'](_0x4c30c9[_0x8601('0x31')],_0x4c30c9[_0x8601('0x2f')]);_0x4ebff5['attributes']=_['intersection'](_0x4c30c9[_0x8601('0x31')],this[_0x8601('0x4')](_0x57a6ec['query'][_0x8601('0x4')]));_0x4ebff5[_0x8601('0x32')]=_0x4ebff5[_0x8601('0x32')][_0x8601('0x20')]?_0x4ebff5[_0x8601('0x32')]:_0x4c30c9[_0x8601('0x31')];if(!_0x57a6ec[_0x8601('0x2f')][_0x8601('0x23')](_0x8601('0x33'))){_0x4ebff5['limit']=this[_0x8601('0x34')](_0x57a6ec[_0x8601('0x2f')]['limit']);_0x4ebff5[_0x8601('0x16')]=this[_0x8601('0x16')](_0x57a6ec['query'][_0x8601('0x16')]);}_0x4ebff5[_0x8601('0x35')]=this['sort'](_0x57a6ec[_0x8601('0x2f')]['sort']);_0x4ebff5[_0x8601('0x36')]=this[_0x8601('0x6')](_[_0x8601('0x37')](_0x57a6ec[_0x8601('0x2f')],_0x4c30c9[_0x8601('0x6')]),_0x17905f);if(_0x57a6ec['query'][_0x8601('0x38')]){var _0x3d6544=_0x17905f;var _0x73ad41=_0x57a6ec[_0x8601('0x2f')][_0x8601('0x38')];if(typeof _0x73ad41==='object'){_0x3d6544=_['filter'](_0x17905f,function(_0x390b24){return _[_0x8601('0x2')](_0x73ad41[_0x8601('0x39')],_0x390b24[_0x8601('0x13')]);});_0x73ad41=_0x73ad41[_0x8601('0x3a')];}_0x4ebff5[_0x8601('0x36')]=_['merge'](_0x4ebff5[_0x8601('0x36')],{'$or':_['map'](_0x3d6544,function(_0x514b91){if(_0x514b91['type']!==_0x8601('0x3b')){if(_0x463e85){return sequelize['where'](sequelize['fn']('lower',sequelize[_0x8601('0x3c')](_0x514b91[_0x8601('0x13')])),{'$like':sequelize['fn']('lower','%'+_0x57a6ec[_0x8601('0x2f')][_0x8601('0x38')]+'%')});}else{var _0x99b79c={};_0x99b79c[_0x514b91[_0x8601('0x13')]]={'$like':'%'+_0x57a6ec[_0x8601('0x2f')][_0x8601('0x38')]+'%'};return _0x99b79c;}}})});}_0x4ebff5=_['merge']({},_0x4ebff5,_0x57a6ec['options']);return _0x4ebff5;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index e22a077..05aee25 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 _0xf27d=['Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','then','error','catch','getRealtimeAgents','unknown','getAgentStatus','isArray','Queue','map','findOne','getAgents','flatten','uniq','value','getAgentIdsByQueues','includes','resolve','User','findAll','name','fullname','faxPause','pauseType','find','merge','globalStatus','split','fields','order','startsWith','DESC','ASC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','sort','pause','toLowerCase','userpic','online','lastLoginAt','lastPauseAt','smsPause','chatCapacity','openchannelCapacity','mailCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','chatStatus','chatStatusTime','openchannelStatusTime','smsStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','pick','lodash','jayson/promise','../../mysqldb','client','http','chatPause','mailPause','openchannelPause','voicePause','whatsappPause','every','filter','length','idle','unavailable','ringing','isNil','voiceStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','request'];(function(_0x24ff6b,_0x2d35e4){var _0x1d6ed0=function(_0x4e4b09){while(--_0x4e4b09){_0x24ff6b['push'](_0x24ff6b['shift']());}};_0x1d6ed0(++_0x2d35e4);}(_0xf27d,0x1b0));var _0xdf27=function(_0x4337c6,_0x557665){_0x4337c6=_0x4337c6-0x0;var _0x5a50a=_0xf27d[_0x4337c6];return _0x5a50a;};'use strict';var _=require(_0xdf27('0x0'));var jayson=require(_0xdf27('0x1'));var db=require(_0xdf27('0x2'))['db'];var amiClient=jayson[_0xdf27('0x3')][_0xdf27('0x4')]({'port':0x232a});var routingClient=jayson[_0xdf27('0x3')][_0xdf27('0x4')]({'port':0x232c});function isAgentPaused(_0x175fce,_0x2e05ad){var _0x50b79c=[_0x175fce[_0xdf27('0x5')],_0x175fce['faxPause'],_0x175fce[_0xdf27('0x6')],_0x175fce[_0xdf27('0x7')],_0x175fce['smsPause'],_0x175fce[_0xdf27('0x8')],_0x175fce[_0xdf27('0x9')]];if(!_0x2e05ad)return _[_0xdf27('0xa')](_0x50b79c);var _0x401508=_[_0xdf27('0xb')](_0x50b79c);return _0x401508[_0xdf27('0xc')]>0x0&&_0x401508[_0xdf27('0xc')]<_0x50b79c[_0xdf27('0xc')]?!![]:![];}function isIdle(_0x308a21){return _0x308a21===_0xdf27('0xd')||_0x308a21==='unknown'||_0x308a21===_0xdf27('0xe')||_0x308a21===_0xdf27('0xf')||_[_0xdf27('0x10')](_0x308a21);}function isAgentIdle(_0x123db4){if(_0x123db4['voiceStatus']!==_0xdf27('0xd')&&_0x123db4[_0xdf27('0x8')]){_0x123db4[_0xdf27('0x11')]='pause';return![];}return _['every']([_0x123db4['chatStatus'],_0x123db4[_0xdf27('0x12')],_0x123db4[_0xdf27('0x13')],_0x123db4[_0xdf27('0x14')],_0x123db4['smsStatus'],_0x123db4[_0xdf27('0x11')],_0x123db4[_0xdf27('0x15')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xdf27('0x16')](_0xdf27('0x17'),{})['then'](function(_0x1648ad){if(_0x1648ad['error']){throw new Error(_0xdf27('0x18'));}var _0x49e239=_0x1648ad[_0xdf27('0x19')];return routingClient['request']('Agents',{})[_0xdf27('0x1a')](function(_0x26a0f4){if(_0x26a0f4[_0xdf27('0x1b')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x44c404=_0x26a0f4['result'];return _['merge']({},_0x49e239,_0x44c404);});})[_0xdf27('0x1c')](function(_0x3ae106){throw _0x3ae106;});}exports[_0xdf27('0x1d')]=getRealtimeAgents;function getAgentStatus(_0x5de32e){var _0x1fc4b1=_0xdf27('0x1e');if(isAgentPaused(_0x5de32e))_0x1fc4b1='pause';else if(isAgentPaused(_0x5de32e,!![]))_0x1fc4b1='*pause';else if(isAgentIdle(_0x5de32e))_0x1fc4b1=_0xdf27('0xd');else _0x1fc4b1='busy';return _0x1fc4b1;}exports[_0xdf27('0x1f')]=getAgentStatus;function getAgentIdsByQueues(_0x11ddbb,_0xee2604){var _0x44ff2f=_[_0xdf27('0x20')](_0x11ddbb)?_0x11ddbb:[_0x11ddbb];var _0x30bfe7=_['startCase'](_0xee2604)+_0xdf27('0x21');var _0x50ffda=_[_0xdf27('0x22')](_0x44ff2f,function(_0x40ccb1){return db[_0x30bfe7][_0xdf27('0x23')]({'where':{'id':_0x40ccb1}})[_0xdf27('0x1a')](function(_0x5d1c58){if(!_0x5d1c58)return[];return _0x5d1c58[_0xdf27('0x24')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x50ffda)[_0xdf27('0x1a')](function(_0x421365){var _0x52cc7f=_(_0x421365)[_0xdf27('0x25')]()[_0xdf27('0x22')]('id')[_0xdf27('0x26')]()[_0xdf27('0x27')]();return _0x52cc7f;});}exports[_0xdf27('0x28')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x27d4e7,_0x20ff0e,_0x2a9277){try{if(_0x20ff0e[_0xdf27('0xc')]>0x0){_0x27d4e7=_0x27d4e7[_0xdf27('0xb')](function(_0x21c76c){return _0x20ff0e[_0xdf27('0x29')](_0x21c76c['id']);});}var _0x5a0cb1=_0x27d4e7[_0xdf27('0xb')](function(_0x3d2b9d){var _0x15b955='busy';if(isAgentIdle(_0x3d2b9d)){_0x15b955=_0xdf27('0xd');}return _0x15b955===_0x2a9277;});return _[_0xdf27('0x22')](_0x5a0cb1,'id');}catch(_0xeeff27){throw _0xeeff27;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x1d0d2d,_0x2b1b43,_0x12e290){return Promise[_0xdf27('0x2a')]()[_0xdf27('0x1a')](function(){if(_0x2b1b43[_0xdf27('0xc')]>0x0){_0x1d0d2d=_0x1d0d2d[_0xdf27('0xb')](function(_0x3a0da1){return _0x2b1b43[_0xdf27('0x29')](_0x3a0da1['id']);});}return _0x1d0d2d;})['then'](function(){return db[_0xdf27('0x2b')][_0xdf27('0x2c')]({'attributes':['id',_0xdf27('0x2d'),_0xdf27('0x2e'),_0xdf27('0x5'),_0xdf27('0x2f'),_0xdf27('0x6'),'openchannelPause','smsPause',_0xdf27('0x8'),_0xdf27('0x9'),_0xdf27('0x30')],'where':{'id':{'$in':_['map'](_0x1d0d2d,'id')}},'raw':!![]});})[_0xdf27('0x1a')](function(_0x4c1554){return _0x4c1554[_0xdf27('0x22')](function(_0x48d95e){var _0x8f1b3e=_[_0xdf27('0x31')](_0x1d0d2d,['id',_0x48d95e['id']]);var _0x653e94=filterAgentAttributes(_0x8f1b3e);_[_0xdf27('0x32')](_0x48d95e,_0x653e94);_0x48d95e[_0xdf27('0x33')]=getAgentStatus(_0x48d95e);return _0x48d95e;});})[_0xdf27('0x1a')](function(_0x553097){var _0x20ee44=sortAgentsByStatus(_0x553097,_0x12e290);return _[_0xdf27('0x22')](_0x20ee44,'id');})['catch'](function(_0x4aa25a){throw _0x4aa25a;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x54294a){var _0x10f0cd={'fields':[],'order':null};var _0x5eea00=_0x54294a[_0xdf27('0x34')](',');_0x10f0cd[_0xdf27('0x35')]=_[_0xdf27('0xb')](_0x5eea00,function(_0x5dbae6){if(!_0x5dbae6['includes'](_0xdf27('0x33'))){return!![];}_0x10f0cd[_0xdf27('0x36')]=_[_0xdf27('0x37')](_0x5dbae6,'-')?_0xdf27('0x38'):_0xdf27('0x39');return![];});return _0x10f0cd;}exports[_0xdf27('0x3a')]=getUpdatedSortOptions;function validateSortParameter(_0x487691){if(_0x487691[_0xdf27('0x29')](_0xdf27('0x2e'))&&!_0x487691['includes'](_0xdf27('0x3b'))){var _0x5d47b7=_0x487691[_0xdf27('0x3c')](0x0,_0x487691[_0xdf27('0x3d')]('fullname'));_0x487691+=','+_0x5d47b7+_0xdf27('0x3b');}return _0x487691;}exports[_0xdf27('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x4fecc1,_0x8ba4b3){var _0x1fa25a=_0x4fecc1[_0xdf27('0x3f')](function(_0x193328,_0x32863b){if(_0x193328[_0xdf27('0x33')]===_0x32863b[_0xdf27('0x33')]){if(_0x193328[_0xdf27('0x33')]===_0xdf27('0x40')){if(_0x8ba4b3===_0xdf27('0x38')){return(_0x193328[_0xdf27('0x30')]||'')<(_0x32863b[_0xdf27('0x30')]||'')||_0x193328[_0xdf27('0x2e')][_0xdf27('0x41')]()>_0x32863b[_0xdf27('0x2e')][_0xdf27('0x41')]()?0x1:-0x1;}else{return(_0x193328[_0xdf27('0x30')]||'')<(_0x32863b[_0xdf27('0x30')]||'')||_0x193328['fullname']['toLowerCase']()>_0x32863b[_0xdf27('0x2e')][_0xdf27('0x41')]()?-0x1:0x1;}}else{if(_0x8ba4b3===_0xdf27('0x38')){return _0x193328[_0xdf27('0x2e')]['toLowerCase']()<_0x32863b[_0xdf27('0x2e')][_0xdf27('0x41')]()?0x1:-0x1;}else{return _0x193328[_0xdf27('0x2e')][_0xdf27('0x41')]()<_0x32863b['fullname'][_0xdf27('0x41')]()?-0x1:0x1;}}}else{if(_0x8ba4b3===_0xdf27('0x38')){return _0x193328[_0xdf27('0x33')]<_0x32863b['globalStatus']?0x1:-0x1;}else{return _0x193328[_0xdf27('0x33')]<_0x32863b[_0xdf27('0x33')]?-0x1:0x1;}}});return _0x1fa25a;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x50913c){var _0x51f251=[_0xdf27('0x42'),_0xdf27('0x43'),_0xdf27('0x44'),'lastPauseAt',_0xdf27('0x30'),_0xdf27('0x45'),'internal','address',_0xdf27('0x5'),_0xdf27('0x7'),_0xdf27('0x6'),_0xdf27('0x46'),_0xdf27('0x9'),_0xdf27('0x2f'),_0xdf27('0x8'),_0xdf27('0x47'),_0xdf27('0x48'),_0xdf27('0x49'),'smsCapacity','whatsappCapacity','faxCapacity',_0xdf27('0x4a'),_0xdf27('0x4b'),_0xdf27('0x4c'),_0xdf27('0x4d'),'whatsappCurrentCapacity',_0xdf27('0x4e'),_0xdf27('0x4f'),'openchannelStatus','mailStatus','smsStatus','whatsappStatus','faxStatus','voiceStatus',_0xdf27('0x50'),_0xdf27('0x51'),'mailStatusTime',_0xdf27('0x52'),'whatsappStatusTime',_0xdf27('0x53'),_0xdf27('0x54'),_0xdf27('0x55'),_0xdf27('0x56'),_0xdf27('0x57'),_0xdf27('0x58'),_0xdf27('0x59'),'routealias'];var _0x59a95c=[_0xdf27('0x5'),_0xdf27('0x7'),_0xdf27('0x6'),_0xdf27('0x46'),_0xdf27('0x9'),_0xdf27('0x2f'),_0xdf27('0x8'),_0xdf27('0x43')];var _0x141bc7=_(_0x50913c)['omit'](_0x59a95c)[_0xdf27('0x5a')](_0x51f251)[_0xdf27('0x27')]();return _0x141bc7;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file +var _0x148f=['Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','catch','getRealtimeAgents','getAgentStatus','isArray','startCase','Queue','findOne','getAgents','flatten','value','filter','busy','map','resolve','includes','findAll','name','chatPause','find','merge','globalStatus','fields','order','startsWith','DESC','ASC','getUpdatedSortOptions','indexOf','fullname','internal','validateSortParameter','sort','pause','pauseType','toLowerCase','userpic','online','lastLoginAt','lastPauseAt','address','openchannelPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','mailStatus','whatsappStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','lodash','jayson/promise','../../mysqldb','client','http','faxPause','mailPause','smsPause','voicePause','whatsappPause','every','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','chatStatus','faxStatus','openchannelStatus','smsStatus','Agents','then','error'];(function(_0x31fd8c,_0x30e511){var _0x3523d7=function(_0x2025ea){while(--_0x2025ea){_0x31fd8c['push'](_0x31fd8c['shift']());}};_0x3523d7(++_0x30e511);}(_0x148f,0x15b));var _0xf148=function(_0x537d26,_0xf8f9f6){_0x537d26=_0x537d26-0x0;var _0x35dd78=_0x148f[_0x537d26];return _0x35dd78;};'use strict';var _=require(_0xf148('0x0'));var jayson=require(_0xf148('0x1'));var db=require(_0xf148('0x2'))['db'];var amiClient=jayson[_0xf148('0x3')][_0xf148('0x4')]({'port':0x232a});var routingClient=jayson['client'][_0xf148('0x4')]({'port':0x232c});function isAgentPaused(_0x3c08dc,_0x4bf67b){var _0x537ff4=[_0x3c08dc['chatPause'],_0x3c08dc[_0xf148('0x5')],_0x3c08dc[_0xf148('0x6')],_0x3c08dc['openchannelPause'],_0x3c08dc[_0xf148('0x7')],_0x3c08dc[_0xf148('0x8')],_0x3c08dc[_0xf148('0x9')]];if(!_0x4bf67b)return _[_0xf148('0xa')](_0x537ff4);var _0x3d1775=_['filter'](_0x537ff4);return _0x3d1775[_0xf148('0xb')]>0x0&&_0x3d1775[_0xf148('0xb')]<_0x537ff4['length']?!![]:![];}function isIdle(_0x49942b){return _0x49942b===_0xf148('0xc')||_0x49942b===_0xf148('0xd')||_0x49942b===_0xf148('0xe')||_0x49942b===_0xf148('0xf')||_[_0xf148('0x10')](_0x49942b);}function isAgentIdle(_0x3e26ae){if(_0x3e26ae['voiceStatus']!=='idle'&&_0x3e26ae['voicePause']){_0x3e26ae[_0xf148('0x11')]='pause';return![];}return _[_0xf148('0xa')]([_0x3e26ae[_0xf148('0x12')],_0x3e26ae[_0xf148('0x13')],_0x3e26ae['mailStatus'],_0x3e26ae[_0xf148('0x14')],_0x3e26ae[_0xf148('0x15')],_0x3e26ae['voiceStatus'],_0x3e26ae['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0xf148('0x16'),{})[_0xf148('0x17')](function(_0x175181){if(_0x175181[_0xf148('0x18')]){throw new Error(_0xf148('0x19'));}var _0x23a1b8=_0x175181[_0xf148('0x1a')];return routingClient['request'](_0xf148('0x16'),{})[_0xf148('0x17')](function(_0x3d850f){if(_0x3d850f['error']){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x3c39bc=_0x3d850f['result'];return _['merge']({},_0x23a1b8,_0x3c39bc);});})[_0xf148('0x1b')](function(_0x514b81){throw _0x514b81;});}exports[_0xf148('0x1c')]=getRealtimeAgents;function getAgentStatus(_0x201132){var _0xfe580c=_0xf148('0xd');if(isAgentPaused(_0x201132))_0xfe580c='pause';else if(isAgentPaused(_0x201132,!![]))_0xfe580c='*pause';else if(isAgentIdle(_0x201132))_0xfe580c='idle';else _0xfe580c='busy';return _0xfe580c;}exports[_0xf148('0x1d')]=getAgentStatus;function getAgentIdsByQueues(_0x43df83,_0x5df6e8){var _0x4b28f9=_[_0xf148('0x1e')](_0x43df83)?_0x43df83:[_0x43df83];var _0x4fc44a=_[_0xf148('0x1f')](_0x5df6e8)+_0xf148('0x20');var _0x3e8718=_['map'](_0x4b28f9,function(_0x574a30){return db[_0x4fc44a][_0xf148('0x21')]({'where':{'id':_0x574a30}})['then'](function(_0x2fdca5){if(!_0x2fdca5)return[];return _0x2fdca5[_0xf148('0x22')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x3e8718)[_0xf148('0x17')](function(_0x1bc7ac){var _0x41c14f=_(_0x1bc7ac)[_0xf148('0x23')]()['map']('id')['uniq']()[_0xf148('0x24')]();return _0x41c14f;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x3759f3,_0x4a64c4,_0x1430c6){try{if(_0x4a64c4['length']>0x0){_0x3759f3=_0x3759f3[_0xf148('0x25')](function(_0x58a022){return _0x4a64c4['includes'](_0x58a022['id']);});}var _0x2a8a90=_0x3759f3[_0xf148('0x25')](function(_0x6a9bb){var _0x21e558=_0xf148('0x26');if(isAgentIdle(_0x6a9bb)){_0x21e558=_0xf148('0xc');}return _0x21e558===_0x1430c6;});return _[_0xf148('0x27')](_0x2a8a90,'id');}catch(_0x28b9ce){throw _0x28b9ce;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0xdf3aa9,_0x33655e,_0x4ee2d4){return Promise[_0xf148('0x28')]()[_0xf148('0x17')](function(){if(_0x33655e[_0xf148('0xb')]>0x0){_0xdf3aa9=_0xdf3aa9[_0xf148('0x25')](function(_0x87e82b){return _0x33655e[_0xf148('0x29')](_0x87e82b['id']);});}return _0xdf3aa9;})[_0xf148('0x17')](function(){return db['User'][_0xf148('0x2a')]({'attributes':['id',_0xf148('0x2b'),'fullname',_0xf148('0x2c'),_0xf148('0x5'),_0xf148('0x6'),'openchannelPause',_0xf148('0x7'),'voicePause',_0xf148('0x9'),'pauseType'],'where':{'id':{'$in':_[_0xf148('0x27')](_0xdf3aa9,'id')}},'raw':!![]});})[_0xf148('0x17')](function(_0x4c982a){return _0x4c982a['map'](function(_0x42610d){var _0x208239=_[_0xf148('0x2d')](_0xdf3aa9,['id',_0x42610d['id']]);var _0xd109d4=filterAgentAttributes(_0x208239);_[_0xf148('0x2e')](_0x42610d,_0xd109d4);_0x42610d[_0xf148('0x2f')]=getAgentStatus(_0x42610d);return _0x42610d;});})[_0xf148('0x17')](function(_0x4f3d2a){var _0x4cbf1e=sortAgentsByStatus(_0x4f3d2a,_0x4ee2d4);return _[_0xf148('0x27')](_0x4cbf1e,'id');})['catch'](function(_0x533e43){throw _0x533e43;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x36cb9e){var _0x43b305={'fields':[],'order':null};var _0x3e05c2=_0x36cb9e['split'](',');_0x43b305[_0xf148('0x30')]=_['filter'](_0x3e05c2,function(_0xfcb190){if(!_0xfcb190[_0xf148('0x29')](_0xf148('0x2f'))){return!![];}_0x43b305[_0xf148('0x31')]=_[_0xf148('0x32')](_0xfcb190,'-')?_0xf148('0x33'):_0xf148('0x34');return![];});return _0x43b305;}exports[_0xf148('0x35')]=getUpdatedSortOptions;function validateSortParameter(_0x39e9b2){if(_0x39e9b2[_0xf148('0x29')]('fullname')&&!_0x39e9b2['includes']('internal')){var _0x4ea016=_0x39e9b2['substring'](0x0,_0x39e9b2[_0xf148('0x36')](_0xf148('0x37')));_0x39e9b2+=','+_0x4ea016+_0xf148('0x38');}return _0x39e9b2;}exports[_0xf148('0x39')]=validateSortParameter;function sortAgentsByStatus(_0x12373a,_0x5cfb81){var _0xe0df7c=_0x12373a[_0xf148('0x3a')](function(_0x243486,_0x4418ad){if(_0x243486['globalStatus']===_0x4418ad[_0xf148('0x2f')]){if(_0x243486['globalStatus']===_0xf148('0x3b')){if(_0x5cfb81==='DESC'){return(_0x243486[_0xf148('0x3c')]||'')<(_0x4418ad['pauseType']||'')||_0x243486[_0xf148('0x37')]['toLowerCase']()>_0x4418ad[_0xf148('0x37')][_0xf148('0x3d')]()?0x1:-0x1;}else{return(_0x243486[_0xf148('0x3c')]||'')<(_0x4418ad[_0xf148('0x3c')]||'')||_0x243486[_0xf148('0x37')][_0xf148('0x3d')]()>_0x4418ad['fullname']['toLowerCase']()?-0x1:0x1;}}else{if(_0x5cfb81==='DESC'){return _0x243486['fullname'][_0xf148('0x3d')]()<_0x4418ad[_0xf148('0x37')][_0xf148('0x3d')]()?0x1:-0x1;}else{return _0x243486[_0xf148('0x37')]['toLowerCase']()<_0x4418ad['fullname'][_0xf148('0x3d')]()?-0x1:0x1;}}}else{if(_0x5cfb81===_0xf148('0x33')){return _0x243486[_0xf148('0x2f')]<_0x4418ad['globalStatus']?0x1:-0x1;}else{return _0x243486['globalStatus']<_0x4418ad['globalStatus']?-0x1:0x1;}}});return _0xe0df7c;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x169b77){var _0x17d3e2=[_0xf148('0x3e'),_0xf148('0x3f'),_0xf148('0x40'),_0xf148('0x41'),'pauseType',_0xf148('0x41'),_0xf148('0x38'),_0xf148('0x42'),_0xf148('0x2c'),_0xf148('0x43'),_0xf148('0x6'),_0xf148('0x7'),'whatsappPause',_0xf148('0x5'),_0xf148('0x8'),_0xf148('0x44'),_0xf148('0x45'),_0xf148('0x46'),_0xf148('0x47'),_0xf148('0x48'),_0xf148('0x49'),'chatCurrentCapacity',_0xf148('0x4a'),_0xf148('0x4b'),_0xf148('0x4c'),_0xf148('0x4d'),_0xf148('0x4e'),_0xf148('0x12'),_0xf148('0x14'),_0xf148('0x4f'),'smsStatus',_0xf148('0x50'),_0xf148('0x13'),_0xf148('0x11'),_0xf148('0x51'),_0xf148('0x52'),_0xf148('0x53'),_0xf148('0x54'),_0xf148('0x55'),_0xf148('0x56'),'voiceStatusTime',_0xf148('0x57'),_0xf148('0x58'),'screenrecording',_0xf148('0x59'),_0xf148('0x5a'),_0xf148('0x5b')];var _0x372eac=[_0xf148('0x2c'),_0xf148('0x43'),_0xf148('0x6'),_0xf148('0x7'),'whatsappPause',_0xf148('0x5'),'voicePause',_0xf148('0x3f')];var _0x1947a2=_(_0x169b77)[_0xf148('0x5c')](_0x372eac)['pick'](_0x17d3e2)[_0xf148('0x24')]();return _0x1947a2;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index d042aa9..2184a22 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 _0x0571=['startCase','then','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','concat','map','get','available','outbound','find','merge','pick','initializeQueues','util','http','client','paused','waiting','busy','invalid','loggedInDb','notInUse','onHold','ringing','ringInUse','talking','unavailable','unknown','pTalking','originated','message','statusMessage','dialActive','dialMethod','Trunk','startPredictive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x0571,0xdc));var _0x1057=function(_0x687ddc,_0x2092fa){_0x687ddc=_0x687ddc-0x0;var _0x441991=_0x0571[_0x687ddc];return _0x441991;};'use strict';var _=require('lodash');var jayson=require('jayson/promise');var util=require(_0x1057('0x0'));var amiClient=jayson['client'][_0x1057('0x1')]({'port':0x232a});var routingClient=jayson[_0x1057('0x2')][_0x1057('0x1')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available','loggedIn',_0x1057('0x3'),_0x1057('0x4')];var VOICE_QUEUE_ATTRIBUTES=[_0x1057('0x5'),'inUse',_0x1057('0x6'),_0x1057('0x7'),_0x1057('0x8'),_0x1057('0x9'),_0x1057('0xa'),_0x1057('0xb'),_0x1057('0xc'),_0x1057('0xd'),_0x1057('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x1057('0xf'),_0x1057('0x10'),_0x1057('0x11'),_0x1057('0x12'),_0x1057('0x13'),_0x1057('0x14'),_0x1057('0x15'),_0x1057('0x16'),'startProgressive',_0x1057('0x17'),'erlangCallToSecond',_0x1057('0x18'),_0x1057('0x19'),_0x1057('0x1a'),_0x1057('0x1b'),_0x1057('0x1c'),'predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls',_0x1057('0x1d'),_0x1057('0x1e'),_0x1057('0x1f'),_0x1057('0x20')];function getRealtimeQueues(_0x30c96b,_0xe35000){var _0x8e563d=_0xe35000===_0x1057('0x21')?amiClient:routingClient;return _0x8e563d[_0x1057('0x22')](_[_0x1057('0x23')](_0xe35000)+'Queues',_0x30c96b)[_0x1057('0x24')](function(_0xeaacbc){if(_0xeaacbc['error'])throw new Error(util['format'](_0x1057('0x25'),_0xe35000));return _0xeaacbc[_0x1057('0x26')];})[_0x1057('0x27')](function(_0x5b481d){throw _0x5b481d;});}exports[_0x1057('0x28')]=getRealtimeQueues;function initializeQueues(_0x2aa6a6,_0x232a60,_0x4d221b,_0x54022f){var _0x111e7b=DEFAULT_QUEUE_ATTRIBUTES;if(_0x4d221b===_0x1057('0x21')){if(_0x54022f===_0x1057('0x29')){_0x111e7b=_0x111e7b[_0x1057('0x2a')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x54022f==='outbound'){_0x111e7b=_0x111e7b['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x2aa6a6[_0x1057('0x2b')](function(_0x1011b8){var _0x1d2395=_0x1011b8[_0x1057('0x2c')]({'plain':!![]});_0x1d2395[_0x1057('0x3')]=0x0;_0x1d2395[_0x1057('0x7')]=0x0;_0x1d2395['loggedIn']=0x0;_0x1d2395[_0x1057('0x2d')]=0x0;_0x1d2395['waiting']=0x0;if(_0x4d221b===_0x1057('0x21')){_0x1d2395[_0x1057('0xc')]=0x0;_0x1d2395[_0x1057('0x5')]=0x0;if(_0x54022f===_0x1057('0x2e')){_0x1d2395[_0x1057('0xf')]=0x0;_0x1d2395[_0x1057('0x10')]=0x0;}}var _0x2a7e12=_[_0x1057('0x2f')](_0x232a60,['id',_0x1d2395['id']]);if(_0x2a7e12){_[_0x1057('0x30')](_0x1d2395,_[_0x1057('0x31')](_0x2a7e12,_0x111e7b));}return _0x1d2395;});}exports[_0x1057('0x32')]=initializeQueues; \ No newline at end of file +var _0xbaa7=['format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues','inbound','concat','outbound','map','find','pick','initializeQueues','jayson/promise','client','available','loggedIn','paused','waiting','busy','inUse','invalid','loggedInDb','ringing','ringInUse','talking','unavailable','unknown','pTalking','originated','message','dialMethod','Trunk','erlangCalls','erlangCallToSecond','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','Queues','then','error'];(function(_0x121b45,_0x45003b){var _0x5bb560=function(_0x96e321){while(--_0x96e321){_0x121b45['push'](_0x121b45['shift']());}};_0x5bb560(++_0x45003b);}(_0xbaa7,0x197));var _0x7baa=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xbaa7[_0x1d1779];return _0x2377e9;};'use strict';var _=require('lodash');var jayson=require(_0x7baa('0x0'));var util=require('util');var amiClient=jayson[_0x7baa('0x1')]['http']({'port':0x232a});var routingClient=jayson[_0x7baa('0x1')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x7baa('0x2'),_0x7baa('0x3'),_0x7baa('0x4'),_0x7baa('0x5')];var VOICE_QUEUE_ATTRIBUTES=[_0x7baa('0x6'),_0x7baa('0x7'),_0x7baa('0x8'),_0x7baa('0x9'),'notInUse','onHold',_0x7baa('0xa'),_0x7baa('0xb'),_0x7baa('0xc'),_0x7baa('0xd'),_0x7baa('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x7baa('0xf'),_0x7baa('0x10'),_0x7baa('0x11'),'statusMessage','dialActive',_0x7baa('0x12'),_0x7baa('0x13'),'startPredictive','startProgressive',_0x7baa('0x14'),_0x7baa('0x15'),'erlangAbandonmentRate','erlangBusyFactor',_0x7baa('0x16'),'dialPredictiveIntervalMaxThreshold',_0x7baa('0x17'),_0x7baa('0x18'),'predictiveIntervalTotalCalls',_0x7baa('0x19'),'predictiveIntervalDroppedCallsTimeout',_0x7baa('0x1a'),_0x7baa('0x1b'),_0x7baa('0x1c')];function getRealtimeQueues(_0x5f1ed6,_0x202697){var _0xbdbd6=_0x202697===_0x7baa('0x1d')?amiClient:routingClient;return _0xbdbd6['request'](_['startCase'](_0x202697)+_0x7baa('0x1e'),_0x5f1ed6)[_0x7baa('0x1f')](function(_0x40fd2d){if(_0x40fd2d[_0x7baa('0x20')])throw new Error(util[_0x7baa('0x21')](_0x7baa('0x22'),_0x202697));return _0x40fd2d[_0x7baa('0x23')];})['catch'](function(_0x4b21ce){throw _0x4b21ce;});}exports[_0x7baa('0x24')]=getRealtimeQueues;function initializeQueues(_0xe265c0,_0x1e2af7,_0xad5690,_0x447a5c){var _0x1d4a85=DEFAULT_QUEUE_ATTRIBUTES;if(_0xad5690===_0x7baa('0x1d')){if(_0x447a5c===_0x7baa('0x25')){_0x1d4a85=_0x1d4a85[_0x7baa('0x26')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x447a5c===_0x7baa('0x27')){_0x1d4a85=_0x1d4a85[_0x7baa('0x26')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0xe265c0[_0x7baa('0x28')](function(_0x4006d9){var _0x33c4b8=_0x4006d9['get']({'plain':!![]});_0x33c4b8[_0x7baa('0x4')]=0x0;_0x33c4b8[_0x7baa('0x9')]=0x0;_0x33c4b8[_0x7baa('0x3')]=0x0;_0x33c4b8['available']=0x0;_0x33c4b8['waiting']=0x0;if(_0xad5690===_0x7baa('0x1d')){_0x33c4b8['talking']=0x0;_0x33c4b8[_0x7baa('0x6')]=0x0;if(_0x447a5c==='outbound'){_0x33c4b8[_0x7baa('0xf')]=0x0;_0x33c4b8[_0x7baa('0x10')]=0x0;}}var _0x310308=_[_0x7baa('0x29')](_0x1e2af7,['id',_0x33c4b8['id']]);if(_0x310308){_['merge'](_0x33c4b8,_[_0x7baa('0x2a')](_0x310308,_0x1d4a85));}return _0x33c4b8;});}exports[_0x7baa('0x2b')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 9a44f90..80a587d 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(_0x1f1a97,_0xadfc15){var _0x29fc6a=function(_0x38c180){while(--_0x38c180){_0x1f1a97['push'](_0x1f1a97['shift']());}};_0x29fc6a(++_0xadfc15);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x4607e1,_0x596f78){var _0x22f1b2=function(_0x122dcc){while(--_0x122dcc){_0x4607e1['push'](_0x4607e1['shift']());}};_0x22f1b2(++_0x596f78);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 cce6a81..bd21ae8 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 _0x7a07=['dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress','createHash','md5','substring','lodash','crypto','bimedia-machine-uuid','execSync','../environment','keys','length','filter','family','internal','concat','head','mac','address','getFirstInterface','orderBy','map','model','update','digest','hex','platform','licenseToken','test','win32'];(function(_0x382ce3,_0x36af81){var _0x4d7486=function(_0x1adc0e){while(--_0x1adc0e){_0x382ce3['push'](_0x382ce3['shift']());}};_0x4d7486(++_0x36af81);}(_0x7a07,0x1d6));var _0x77a0=function(_0x4bdc28,_0x283875){_0x4bdc28=_0x4bdc28-0x0;var _0x1e415d=_0x7a07[_0x4bdc28];return _0x1e415d;};'use strict';var _=require(_0x77a0('0x0'));var os=require('os');var crypto=require(_0x77a0('0x1'));var machine=require(_0x77a0('0x2'));var exec=require('child_process')[_0x77a0('0x3')];var config=require(_0x77a0('0x4'));function getInterfaces(){var _0x452e7f=[];var _0x305816=os['networkInterfaces']();var _0x448fed=_['orderBy'](_[_0x77a0('0x5')](_0x305816));for(var _0x1d5102=0x0;_0x1d5102<_0x448fed[_0x77a0('0x6')];_0x1d5102++){var _0x1d5cd0=_0x305816[_0x448fed[_0x1d5102]][_0x77a0('0x7')](function(_0x44c227){return _0x44c227[_0x77a0('0x8')]==='IPv4'&&_0x44c227[_0x77a0('0x9')]===![];});_0x452e7f=_0x452e7f[_0x77a0('0xa')](_0x1d5cd0);}return _0x452e7f;}function getFirstInterface(){var _0x298385=_[_0x77a0('0xb')](getInterfaces());return{'macAddress':_0x298385&&_0x298385[_0x77a0('0xc')]?_0x298385['mac']:'00:00:00:00:00:00','ipAddress':_0x298385&&_0x298385[_0x77a0('0xd')]?_0x298385[_0x77a0('0xd')]:'127.0.0.1'};}exports[_0x77a0('0xe')]=getFirstInterface;function getCPUhash(){var _0x317460=_[_0x77a0('0xf')](os['cpus']()[_0x77a0('0x10')](function(_0x2d3588){return _0x2d3588[_0x77a0('0x11')];}))['join'](':');return crypto['createHash']('md5')[_0x77a0('0x12')](_0x317460)[_0x77a0('0x13')](_0x77a0('0x14'));}exports['getUuid']=function(){var _0x2ed7e4=os[_0x77a0('0x15')]();var _0x4e915a=/[0-9a-f-]{36}/;if(config[_0x77a0('0x16')]&&_0x4e915a[_0x77a0('0x17')](config[_0x77a0('0x16')])){return config[_0x77a0('0x16')];}else if(_0x2ed7e4===_0x77a0('0x18')){return exec(_0x77a0('0x19'),{'encoding':'utf8'})[_0x77a0('0x1a')]('\x0d\x0a','');}else{var _0x25735c=getFirstInterface();var _0x299825=getCPUhash();var _0x44fc3f=_0x299825+'|'+os[_0x77a0('0x1b')]()+'|'+_0x25735c[_0x77a0('0x1c')]+'|'+_0x25735c[_0x77a0('0x1d')];var _0x23fda=crypto[_0x77a0('0x1e')](_0x77a0('0x1f'))[_0x77a0('0x12')](_0x44fc3f)['digest'](_0x77a0('0x14'));return _0x23fda[_0x77a0('0x20')](0x0,0x8)+'-'+_0x23fda[_0x77a0('0x20')](0x8,0xc)+'-'+_0x23fda[_0x77a0('0x20')](0xc,0x10)+'-'+_0x23fda[_0x77a0('0x20')](0x10,0x14)+'-'+_0x23fda[_0x77a0('0x20')](0x14);}}; \ No newline at end of file +var _0x47ad=['../environment','networkInterfaces','orderBy','keys','length','filter','IPv4','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','model','join','md5','update','digest','hex','getUuid','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x47ad,0x10d));var _0xd47a=function(_0x108831,_0x5e4f70){_0x108831=_0x108831-0x0;var _0x4da77a=_0x47ad[_0x108831];return _0x4da77a;};'use strict';var _=require(_0xd47a('0x0'));var os=require('os');var crypto=require(_0xd47a('0x1'));var machine=require(_0xd47a('0x2'));var exec=require('child_process')['execSync'];var config=require(_0xd47a('0x3'));function getInterfaces(){var _0x283a6c=[];var _0x517372=os[_0xd47a('0x4')]();var _0xdaf93b=_[_0xd47a('0x5')](_[_0xd47a('0x6')](_0x517372));for(var _0x4b5944=0x0;_0x4b5944<_0xdaf93b[_0xd47a('0x7')];_0x4b5944++){var _0x4fad20=_0x517372[_0xdaf93b[_0x4b5944]][_0xd47a('0x8')](function(_0x3a56a9){return _0x3a56a9['family']===_0xd47a('0x9')&&_0x3a56a9['internal']===![];});_0x283a6c=_0x283a6c[_0xd47a('0xa')](_0x4fad20);}return _0x283a6c;}function getFirstInterface(){var _0x266f07=_[_0xd47a('0xb')](getInterfaces());return{'macAddress':_0x266f07&&_0x266f07['mac']?_0x266f07[_0xd47a('0xc')]:_0xd47a('0xd'),'ipAddress':_0x266f07&&_0x266f07[_0xd47a('0xe')]?_0x266f07['address']:_0xd47a('0xf')};}exports[_0xd47a('0x10')]=getFirstInterface;function getCPUhash(){var _0x2f66a5=_[_0xd47a('0x5')](os[_0xd47a('0x11')]()['map'](function(_0x518bb4){return _0x518bb4[_0xd47a('0x12')];}))[_0xd47a('0x13')](':');return crypto['createHash'](_0xd47a('0x14'))[_0xd47a('0x15')](_0x2f66a5)[_0xd47a('0x16')](_0xd47a('0x17'));}exports[_0xd47a('0x18')]=function(){var _0x147dbd=os['platform']();var _0x3fb66e=/[0-9a-f-]{36}/;if(config[_0xd47a('0x19')]&&_0x3fb66e['test'](config[_0xd47a('0x19')])){return config['licenseToken'];}else if(_0x147dbd===_0xd47a('0x1a')){return exec(_0xd47a('0x1b'),{'encoding':_0xd47a('0x1c')})[_0xd47a('0x1d')]('\x0d\x0a','');}else{var _0x41f40e=getFirstInterface();var _0x15728a=getCPUhash();var _0x257979=_0x15728a+'|'+os[_0xd47a('0x1e')]()+'|'+_0x41f40e[_0xd47a('0x1f')]+'|'+_0x41f40e[_0xd47a('0x20')];var _0x17081c=crypto['createHash'](_0xd47a('0x14'))[_0xd47a('0x15')](_0x257979)[_0xd47a('0x16')](_0xd47a('0x17'));return _0x17081c[_0xd47a('0x21')](0x0,0x8)+'-'+_0x17081c['substring'](0x8,0xc)+'-'+_0x17081c[_0xd47a('0x21')](0xc,0x10)+'-'+_0x17081c[_0xd47a('0x21')](0x10,0x14)+'-'+_0x17081c[_0xd47a('0x21')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 96600b3..dd70270 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 _0x0c81=['./hardware','../logger','license','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','finally','License','spread','message','util','request-promise','pkginfo','version'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c81,0x1b6));var _0x10c8=function(_0x299559,_0x27e064){_0x299559=_0x299559-0x0;var _0x526031=_0x0c81[_0x299559];return _0x526031;};'use strict';var util=require(_0x10c8('0x0'));var moment=require('moment');var rp=require(_0x10c8('0x1'));var BPromise=require('bluebird');var pkginfo=require(_0x10c8('0x2'))(module,_0x10c8('0x3'));var db=require('../../mysqldb')['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x10c8('0x4'));var logger=require(_0x10c8('0x5'))(_0x10c8('0x6'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3393dd){return new BPromise(function(_0x151b24,_0x48c453){var _0x3846ab=util[_0x10c8('0x7')](_0x10c8('0x8'),HOST,_0x3393dd,module[_0x10c8('0x9')]['version']);if(oldToken){_0x3846ab=util[_0x10c8('0x7')](_0x10c8('0xa'),HOST,_0x3393dd,module[_0x10c8('0x9')]['version'],oldToken);}var _0x450794={'uri':_0x3846ab,'method':_0x10c8('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x450794)[_0x10c8('0xc')](function(_0x3d219e){_0x151b24(_0x3d219e);})[_0x10c8('0xd')](function(_0x43c9e7){_0x48c453(_0x43c9e7);});});}function manageLicense(_0xef7e1c,_0x4101f2){var _0x3df6c5=_0x4101f2[_0x10c8('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x3df6c5[_0x10c8('0xf')]!==_0xef7e1c&&!_0x3df6c5['data2']){oldToken=_0x3df6c5[_0x10c8('0xf')];}httpRequest(_0xef7e1c)[_0x10c8('0xc')](function(_0x5b8169){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5b8169[_0x10c8('0x10')]){isOldTokenSent=![];if(!_0x3df6c5['license']&&_0x3df6c5[_0x10c8('0x6')]!=_0x5b8169['license']||_0x3df6c5['license']&&_0x3df6c5[_0x10c8('0x11')]){logger[_0x10c8('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x3df6c5[_0x10c8('0x6')]&&!_0x3df6c5[_0x10c8('0x11')]&&_0x3df6c5[_0x10c8('0x6')]!=_0x5b8169['license']){logger[_0x10c8('0x12')](_0x10c8('0x13'));}if(_0x3df6c5['license']&&!_0x3df6c5['data2']&&_0x3df6c5[_0x10c8('0x6')]==_0x5b8169[_0x10c8('0x6')]){return _0x4101f2;}return _0x4101f2[_0x10c8('0x14')]({'data1':_0xef7e1c,'data2':null,'license':_0x5b8169['license']});}else{if(_0x5b8169[_0x10c8('0x6')]||_0x3df6c5[_0x10c8('0x6')]){if(!_0x3df6c5['data2']){if(_0x3df6c5['data1']==_0xef7e1c){GRAY_PERIOD_REASON='Disabled';logger[_0x10c8('0x12')](_0x10c8('0x15'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x10c8('0x12')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x3df6c5[_0x10c8('0xf')],_0xef7e1c);}logger[_0x10c8('0x12')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x10c8('0x16')](),moment()['format'](_0x10c8('0x17')));return _0x4101f2[_0x10c8('0x14')]({'data2':encryptor[_0x10c8('0x18')](moment()[_0x10c8('0x7')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x10c8('0x19')](encryptor['decryptString'](_0x3df6c5[_0x10c8('0x11')]),_0x10c8('0x1a'))>DAYS){logger[_0x10c8('0x12')](_0x10c8('0x1b'),moment()[_0x10c8('0x7')](_0x10c8('0x17')));isOldTokenSent=![];return _0x4101f2[_0x10c8('0x14')]({'data1':_0xef7e1c,'data2':null,'license':null});}}}else{if(_0x3df6c5['data1']!=_0xef7e1c){logger[_0x10c8('0x12')](_0x10c8('0x1c'),_0x3df6c5['data1'],_0xef7e1c);return _0x4101f2[_0x10c8('0x14')]({'data1':_0xef7e1c,'data2':null,'license':null});}}}return _0x4101f2;})[_0x10c8('0xc')](function(_0x20683b){_0x4101f2=_0x20683b;})['catch'](function(_0x293e13){logger[_0x10c8('0x1d')](_0x293e13['message']);})[_0x10c8('0x1e')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x4101f2);},TIME);});}function defaultLicense(){var _0x3e475=hardware['getUuid']();if(_0x3e475){return db[_0x10c8('0x1f')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x3e475}})[_0x10c8('0x20')](function(_0x42c7c1,_0x11a3c5){logger['info']('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x3e475);manageLicense(_0x3e475,_0x42c7c1);})[_0x10c8('0xd')](function(_0x3a921c){logger['error'](_0x3a921c[_0x10c8('0x21')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x95c6=['error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','catch','util','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','%s/api/servers/%s/check?version=%s','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then','get','data1','data2','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'];(function(_0x344294,_0x5bd8c5){var _0x14a5e4=function(_0x59a62f){while(--_0x59a62f){_0x344294['push'](_0x344294['shift']());}};_0x14a5e4(++_0x5bd8c5);}(_0x95c6,0x1b7));var _0x695c=function(_0x5703d5,_0x125ba7){_0x5703d5=_0x5703d5-0x0;var _0x1e4625=_0x95c6[_0x5703d5];return _0x1e4625;};'use strict';var util=require(_0x695c('0x0'));var moment=require('moment');var rp=require(_0x695c('0x1'));var BPromise=require(_0x695c('0x2'));var pkginfo=require(_0x695c('0x3'))(module,_0x695c('0x4'));var db=require(_0x695c('0x5'))['db'];var encryptor=require(_0x695c('0x6'));var hardware=require(_0x695c('0x7'));var logger=require(_0x695c('0x8'))('license');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4967a0){return new BPromise(function(_0x25a968,_0x1367ba){var _0x383c8a=util['format'](_0x695c('0x9'),HOST,_0x4967a0,module['exports']['version']);if(oldToken){_0x383c8a=util[_0x695c('0xa')](_0x695c('0xb'),HOST,_0x4967a0,module[_0x695c('0xc')][_0x695c('0x4')],oldToken);}var _0x33b989={'uri':_0x383c8a,'method':_0x695c('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x33b989)[_0x695c('0xe')](function(_0x2266e6){_0x25a968(_0x2266e6);})['catch'](function(_0x594648){_0x1367ba(_0x594648);});});}function manageLicense(_0x39afca,_0x4fdbb4){var _0x4bde80=_0x4fdbb4[_0x695c('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x4bde80[_0x695c('0x10')]!==_0x39afca&&!_0x4bde80[_0x695c('0x11')]){oldToken=_0x4bde80[_0x695c('0x10')];}httpRequest(_0x39afca)[_0x695c('0xe')](function(_0x2b4086){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2b4086['active']){isOldTokenSent=![];if(!_0x4bde80[_0x695c('0x12')]&&_0x4bde80[_0x695c('0x12')]!=_0x2b4086['license']||_0x4bde80[_0x695c('0x12')]&&_0x4bde80[_0x695c('0x11')]){logger[_0x695c('0x13')](_0x695c('0x14'));}if(_0x4bde80['license']&&!_0x4bde80[_0x695c('0x11')]&&_0x4bde80[_0x695c('0x12')]!=_0x2b4086[_0x695c('0x12')]){logger['info'](_0x695c('0x15'));}if(_0x4bde80[_0x695c('0x12')]&&!_0x4bde80[_0x695c('0x11')]&&_0x4bde80['license']==_0x2b4086[_0x695c('0x12')]){return _0x4fdbb4;}return _0x4fdbb4[_0x695c('0x16')]({'data1':_0x39afca,'data2':null,'license':_0x2b4086['license']});}else{if(_0x2b4086['license']||_0x4bde80[_0x695c('0x12')]){if(!_0x4bde80[_0x695c('0x11')]){if(_0x4bde80[_0x695c('0x10')]==_0x39afca){GRAY_PERIOD_REASON=_0x695c('0x17');logger['info'](_0x695c('0x18'));}else{GRAY_PERIOD_REASON=_0x695c('0x19');logger[_0x695c('0x13')](_0x695c('0x1a'),_0x4bde80[_0x695c('0x10')],_0x39afca);}logger[_0x695c('0x13')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x695c('0x1b')](),moment()[_0x695c('0xa')](_0x695c('0x1c')));return _0x4fdbb4['update']({'data2':encryptor[_0x695c('0x1d')](moment()[_0x695c('0xa')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x695c('0x1e')](encryptor[_0x695c('0x1f')](_0x4bde80[_0x695c('0x11')]),_0x695c('0x20'))>DAYS){logger[_0x695c('0x13')](_0x695c('0x21'),moment()[_0x695c('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x4fdbb4['update']({'data1':_0x39afca,'data2':null,'license':null});}}}else{if(_0x4bde80[_0x695c('0x10')]!=_0x39afca){logger[_0x695c('0x13')](_0x695c('0x1a'),_0x4bde80['data1'],_0x39afca);return _0x4fdbb4[_0x695c('0x16')]({'data1':_0x39afca,'data2':null,'license':null});}}}return _0x4fdbb4;})[_0x695c('0xe')](function(_0x4dc6de){_0x4fdbb4=_0x4dc6de;})['catch'](function(_0x480fea){logger[_0x695c('0x22')](_0x480fea[_0x695c('0x23')]);})[_0x695c('0x24')](function(){setTimeout(function(){manageLicense(hardware[_0x695c('0x25')](),_0x4fdbb4);},TIME);});}function defaultLicense(){var _0x1917c2=hardware[_0x695c('0x25')]();if(_0x1917c2){return db[_0x695c('0x26')][_0x695c('0x27')]({'where':{'id':0x1},'defaults':{'data1':_0x1917c2}})[_0x695c('0x28')](function(_0x1f4e14,_0xe626ec){logger['info'](_0x695c('0x29'),_0x1917c2);manageLicense(_0x1917c2,_0x1f4e14);})[_0x695c('0x2a')](function(_0x5119a6){logger[_0x695c('0x22')](_0x5119a6[_0x695c('0x23')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 7453db6..ceac188 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 _0xb326=['disabled','message','User','findAll','role','COUNT','sequelize','user','telephone','telephones','forEach','admin','count','pick','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','getUuid','Breaking\x20license','License','defaults','then','catch','data1','license','isEmpty','split','format','%s:%s:%s','parse','demo','uuid','machineUuid','decryptString','deadline','add','grayReason','changed'];(function(_0x38e47a,_0xc032eb){var _0x1b0649=function(_0x392ba2){while(--_0x392ba2){_0x38e47a['push'](_0x38e47a['shift']());}};_0x1b0649(++_0xc032eb);}(_0xb326,0x125));var _0x6b32=function(_0x32a911,_0x5a6fb5){_0x32a911=_0x32a911-0x0;var _0x40867b=_0xb326[_0x32a911];return _0x40867b;};'use strict';var util=require(_0x6b32('0x0'));var _=require(_0x6b32('0x1'));var moment=require(_0x6b32('0x2'));var BPromise=require(_0x6b32('0x3'));var hardware=require(_0x6b32('0x4'));var encryptor=require(_0x6b32('0x5'));var db=require(_0x6b32('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6b32('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x6b32('0x8')](),'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':_0x6b32('0x9'),'machineUuid':hardware[_0x6b32('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x3af8b9){return new BPromise(function(_0x41bad4,_0x57f79d){return db[_0x6b32('0xa')]['find'](_[_0x6b32('0xb')](_0x3af8b9,{'raw':!![],'where':{'id':0x1}}))[_0x6b32('0xc')](function(_0x105fc9){return checkLicense(_0x105fc9,null);})[_0x6b32('0xc')](function(_0xc2d758){_0x41bad4(_0xc2d758);return;})[_0x6b32('0xd')](function(_0x12feb3){_0x57f79d(_0x12feb3);});});}function checkLicense(_0x2b7ec6,_0x431142){if(!_0x2b7ec6){demoLicense['uuid']=_0x2b7ec6[_0x6b32('0xe')];return demoLicense;}try{var _0xb129e5=_0x431142||_0x2b7ec6[_0x6b32('0xf')];if(_[_0x6b32('0x10')](_0xb129e5)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x47fc33=_0x2b7ec6['data1'];var _0x35d0fb=_0x2b7ec6['data2'];var _0x5e9b7d=_0x47fc33[_0x6b32('0x11')]('-')[0x4];var _0x119ec2=_0x47fc33['split']('-')[0x0];var _0x267e85=encryptor['decryptString'](_0xb129e5,util[_0x6b32('0x12')](_0x6b32('0x13'),_0x5e9b7d,_0x47fc33,_0x119ec2));var _0x37517d=JSON[_0x6b32('0x14')](_0x267e85);_0x37517d[_0x6b32('0x15')]=![];_0x37517d[_0x6b32('0x16')]=_0x47fc33;_0x37517d[_0x6b32('0x17')]=hardware['getUuid']();if(_0x35d0fb){var _0x12c6c4=encryptor[_0x6b32('0x18')](_0x35d0fb);_0x37517d['gray']=_0x12c6c4;_0x37517d[_0x6b32('0x19')]=moment(_0x12c6c4)[_0x6b32('0x1a')](0x7,'days')[_0x6b32('0x12')]();_0x37517d[_0x6b32('0x1b')]=_0x37517d[_0x6b32('0x16')]!=_0x37517d[_0x6b32('0x17')]?_0x6b32('0x1c'):_0x6b32('0x1d');}return _0x37517d;}catch(_0x196e88){breakingLicense['uuid']=_0x2b7ec6[_0x6b32('0xe')];breakingLicense[_0x6b32('0x1e')]=_0x196e88[_0x6b32('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x51c7c6,_0x49a603){getLicense()[_0x6b32('0xc')](function(_0x1dba20){return db[_0x6b32('0x1f')][_0x6b32('0x20')]({'attributes':[_0x6b32('0x21'),[db['sequelize']['fn'](_0x6b32('0x22'),db[_0x6b32('0x23')]['col'](_0x6b32('0x21'))),'count']],'group':_0x6b32('0x21'),'where':{'role':{'$or':['admin',_0x6b32('0x24'),_0x6b32('0x25')]}},'raw':!![]})[_0x6b32('0xc')](function(_0x34202d){var _0x13cf69={'user':_0x1dba20['users']||0x0,'telephone':_0x1dba20[_0x6b32('0x26')]||0x0};_0x34202d[_0x6b32('0x27')](function(_0x464770){var _0x5ac672=_0x464770[_0x6b32('0x21')]===_0x6b32('0x28')?_0x6b32('0x24'):_0x464770[_0x6b32('0x21')];_0x13cf69[_0x5ac672]-=_0x464770[_0x6b32('0x29')];if(_0x13cf69[_0x5ac672]<0x0)_0x13cf69[_0x5ac672]=0x0;});_0x51c7c6(_0x13cf69);return;});})[_0x6b32('0xd')](function(_0x227504){_0x49a603(_0x227504);});});}function checkUserLimits(_0x3c436a){return new BPromise(function(_0x48fcf8,_0x5e5251){getLimits()[_0x6b32('0xc')](function(_0x54988a){var _0x17907e=_[_0x6b32('0x2a')](_['countBy'](_0x3c436a,'role'),[_0x6b32('0x28'),'user','telephone']);var _0x33739e=(_0x17907e[_0x6b32('0x28')]||0x0)+(_0x17907e[_0x6b32('0x24')]||0x0);var _0x4d5860=_0x17907e[_0x6b32('0x25')]||0x0;if(_0x33739e>_0x54988a['user'])return _0x5e5251(_0x6b32('0x2b'));if(_0x4d5860>_0x54988a[_0x6b32('0x25')])return _0x5e5251(_0x6b32('0x2c'));return _0x48fcf8();})[_0x6b32('0xd')](function(_0x593604){_0x5e5251(_0x593604);});});}module[_0x6b32('0x2d')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xb115=['lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','find','defaults','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','demo','uuid','machineUuid','grayReason','disabled','message','then','User','findAll','role','sequelize','col','count','user','telephone','telephones','forEach','admin','catch','pick','countBy','License\x20limit\x20reached\x20for\x20users','exports','util'];(function(_0x40d032,_0x86acd4){var _0x2cdec1=function(_0x21b4f6){while(--_0x21b4f6){_0x40d032['push'](_0x40d032['shift']());}};_0x2cdec1(++_0x86acd4);}(_0xb115,0x18b));var _0x5b11=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb115[_0xfae23b];return _0x200640;};'use strict';var util=require(_0x5b11('0x0'));var _=require(_0x5b11('0x1'));var moment=require(_0x5b11('0x2'));var BPromise=require(_0x5b11('0x3'));var hardware=require(_0x5b11('0x4'));var encryptor=require(_0x5b11('0x5'));var db=require(_0x5b11('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5b11('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x5b11('0x8'),'machineUuid':hardware[_0x5b11('0x9')](),'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':'Breaking\x20license','machineUuid':hardware[_0x5b11('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xf0192e){return new BPromise(function(_0x2001cb,_0x290a9c){return db['License'][_0x5b11('0xa')](_[_0x5b11('0xb')](_0xf0192e,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x2e4af3){return checkLicense(_0x2e4af3,null);})['then'](function(_0x17d755){_0x2001cb(_0x17d755);return;})['catch'](function(_0x433057){_0x290a9c(_0x433057);});});}function checkLicense(_0x5538c9,_0x4cf849){if(!_0x5538c9){demoLicense['uuid']=_0x5538c9[_0x5b11('0xc')];return demoLicense;}try{var _0x54e368=_0x4cf849||_0x5538c9[_0x5b11('0xd')];if(_[_0x5b11('0xe')](_0x54e368)){throw new Error(_0x5b11('0xf'));}var _0x1ad058=_0x5538c9[_0x5b11('0xc')];var _0x1aa0e5=_0x5538c9[_0x5b11('0x10')];var _0x2ffea9=_0x1ad058[_0x5b11('0x11')]('-')[0x4];var _0x4a8c26=_0x1ad058['split']('-')[0x0];var _0x244ade=encryptor[_0x5b11('0x12')](_0x54e368,util[_0x5b11('0x13')](_0x5b11('0x14'),_0x2ffea9,_0x1ad058,_0x4a8c26));var _0x25eae1=JSON['parse'](_0x244ade);_0x25eae1[_0x5b11('0x15')]=![];_0x25eae1[_0x5b11('0x16')]=_0x1ad058;_0x25eae1[_0x5b11('0x17')]=hardware[_0x5b11('0x9')]();if(_0x1aa0e5){var _0x1cf72f=encryptor[_0x5b11('0x12')](_0x1aa0e5);_0x25eae1['gray']=_0x1cf72f;_0x25eae1['deadline']=moment(_0x1cf72f)['add'](0x7,'days')['format']();_0x25eae1[_0x5b11('0x18')]=_0x25eae1[_0x5b11('0x16')]!=_0x25eae1['machineUuid']?'changed':_0x5b11('0x19');}return _0x25eae1;}catch(_0x221556){breakingLicense[_0x5b11('0x16')]=_0x5538c9['data1'];breakingLicense[_0x5b11('0x1a')]=_0x221556[_0x5b11('0x1a')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x63b943,_0xc2e267){getLicense()[_0x5b11('0x1b')](function(_0x46ecb0){return db[_0x5b11('0x1c')][_0x5b11('0x1d')]({'attributes':[_0x5b11('0x1e'),[db[_0x5b11('0x1f')]['fn']('COUNT',db['sequelize'][_0x5b11('0x20')](_0x5b11('0x1e'))),_0x5b11('0x21')]],'group':_0x5b11('0x1e'),'where':{'role':{'$or':['admin',_0x5b11('0x22'),_0x5b11('0x23')]}},'raw':!![]})['then'](function(_0x4fd7d5){var _0x5ecb1f={'user':_0x46ecb0['users']||0x0,'telephone':_0x46ecb0[_0x5b11('0x24')]||0x0};_0x4fd7d5[_0x5b11('0x25')](function(_0x85112c){var _0x592a95=_0x85112c[_0x5b11('0x1e')]===_0x5b11('0x26')?_0x5b11('0x22'):_0x85112c[_0x5b11('0x1e')];_0x5ecb1f[_0x592a95]-=_0x85112c[_0x5b11('0x21')];if(_0x5ecb1f[_0x592a95]<0x0)_0x5ecb1f[_0x592a95]=0x0;});_0x63b943(_0x5ecb1f);return;});})[_0x5b11('0x27')](function(_0x1a1a3a){_0xc2e267(_0x1a1a3a);});});}function checkUserLimits(_0x3ca1d3){return new BPromise(function(_0x30030d,_0x434e90){getLimits()['then'](function(_0x19c4f6){var _0x1a70e3=_[_0x5b11('0x28')](_[_0x5b11('0x29')](_0x3ca1d3,_0x5b11('0x1e')),[_0x5b11('0x26'),_0x5b11('0x22'),_0x5b11('0x23')]);var _0xdc34c4=(_0x1a70e3[_0x5b11('0x26')]||0x0)+(_0x1a70e3[_0x5b11('0x22')]||0x0);var _0x436e49=_0x1a70e3[_0x5b11('0x23')]||0x0;if(_0xdc34c4>_0x19c4f6[_0x5b11('0x22')])return _0x434e90(_0x5b11('0x2a'));if(_0x436e49>_0x19c4f6[_0x5b11('0x23')])return _0x434e90('License\x20limit\x20reached\x20for\x20telephones');return _0x30030d();})[_0x5b11('0x27')](function(_0x409a65){_0x434e90(_0x409a65);});});}module[_0x5b11('0x2b')]={'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 18426d4..a6d743c 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 _0x6343=['myappanuglar-secret','app-id'];(function(_0x54cc09,_0x59b1de){var _0x3c8d1a=function(_0xbc2fd){while(--_0xbc2fd){_0x54cc09['push'](_0x54cc09['shift']());}};_0x3c8d1a(++_0x59b1de);}(_0x6343,0x168));var _0x3634=function(_0x37c087,_0x59b7eb){_0x37c087=_0x37c087-0x0;var _0x48f802=_0x6343[_0x37c087];return _0x48f802;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x3634('0x0'),'GOOGLE_ID':_0x3634('0x1'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0xe1e3=['http://localhost:9000','app-id','exports'];(function(_0x1d5cbb,_0x425e7f){var _0x1da5d5=function(_0x462f8d){while(--_0x462f8d){_0x1d5cbb['push'](_0x1d5cbb['shift']());}};_0x1da5d5(++_0x425e7f);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x2e212a,_0x34051a){_0x2e212a=_0x2e212a-0x0;var _0x291e40=_0xe1e3[_0x2e212a];return _0x291e40;};'use strict';module[_0x3e1e('0x0')]={'DOMAIN':_0x3e1e('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x3e1e('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index c767909..2a7ed8b 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5f0=['exports'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xe5f0,0x1f1));var _0x0e5f=function(_0x5cedfb,_0x38c1b2){_0x5cedfb=_0x5cedfb-0x0;var _0x27e955=_0xe5f0[_0x5cedfb];return _0x27e955;};'use strict';var fileLogger=require('../utils/loggers')['fileLogger'];module[_0x0e5f('0x0')]=fileLogger; \ No newline at end of file +var _0x87b2=['../utils/loggers'];(function(_0x2a43fc,_0x3f309f){var _0x3c5022=function(_0x257102){while(--_0x257102){_0x2a43fc['push'](_0x2a43fc['shift']());}};_0x3c5022(++_0x3f309f);}(_0x87b2,0xa7));var _0x287b=function(_0x288792,_0x52c342){_0x288792=_0x288792-0x0;var _0x1acecc=_0x87b2[_0x288792];return _0x1acecc;};'use strict';var fileLogger=require(_0x287b('0x0'))['fileLogger'];module['exports']=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 9c2da36..c7babbb 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 _0xf9fb=['legacy-libs','join','../../services/express/index.js','ami','agi','../../services/email/index.js','../../services/xdr/index.js','path','../../config/environment','root'];(function(_0x2f7672,_0x1768c7){var _0x468bd0=function(_0x54badc){while(--_0x54badc){_0x2f7672['push'](_0x2f7672['shift']());}};_0x468bd0(++_0x1768c7);}(_0xf9fb,0x93));var _0xbf9f=function(_0x4d321d,_0x7406c2){_0x4d321d=_0x4d321d-0x0;var _0x17408f=_0xf9fb[_0x4d321d];return _0x17408f;};'use strict';var path=require(_0xbf9f('0x0'));var cfg=require(_0xbf9f('0x1'));var env={'NODE_PATH':path['resolve'](path['join'](cfg[_0xbf9f('0x2')],_0xbf9f('0x3')))};var pm2config={'apps':[{'name':'express','script':path[_0xbf9f('0x4')](__dirname,_0xbf9f('0x5')),'env':env},{'name':_0xbf9f('0x6'),'script':path[_0xbf9f('0x4')](__dirname,'../../services/ami/index.js'),'env':env},{'name':_0xbf9f('0x7'),'script':path[_0xbf9f('0x4')](__dirname,'../../services/agi/index.js'),'env':env},{'name':'email','script':path[_0xbf9f('0x4')](__dirname,_0xbf9f('0x8')),'env':env},{'name':'routing','script':path[_0xbf9f('0x4')](__dirname,'../../services/routing/index.js'),'env':env},{'name':'xdr','script':path[_0xbf9f('0x4')](__dirname,_0xbf9f('0x9')),'env':env}]};module['exports']=pm2config; \ No newline at end of file +var _0x14b5=['../../services/express/index.js','ami','../../services/ami/index.js','agi','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','../../config/environment','join'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x14b5,0x1e7));var _0x514b=function(_0x882544,_0x51d29d){_0x882544=_0x882544-0x0;var _0x20b5f7=_0x14b5[_0x882544];return _0x20b5f7;};'use strict';var path=require(_0x514b('0x0'));var cfg=require(_0x514b('0x1'));var env={'NODE_PATH':path['resolve'](path[_0x514b('0x2')](cfg['root'],'legacy-libs'))};var pm2config={'apps':[{'name':'express','script':path[_0x514b('0x2')](__dirname,_0x514b('0x3')),'env':env},{'name':_0x514b('0x4'),'script':path['join'](__dirname,_0x514b('0x5')),'env':env},{'name':_0x514b('0x6'),'script':path[_0x514b('0x2')](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0x514b('0x7'),'script':path[_0x514b('0x2')](__dirname,_0x514b('0x8')),'env':env},{'name':_0x514b('0x9'),'script':path[_0x514b('0x2')](__dirname,_0x514b('0xa')),'env':env},{'name':_0x514b('0xb'),'script':path[_0x514b('0x2')](__dirname,_0x514b('0xc')),'env':env}]};module[_0x514b('0xd')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 7ae3aaa..7ec43f4 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 _0x2cdb=['stop','restart','list','describe','delete','dump','saved','pm2','bluebird','connect','start','then','disconnect'];(function(_0x1fa760,_0x1bf063){var _0xd8eda1=function(_0x4a21d6){while(--_0x4a21d6){_0x1fa760['push'](_0x1fa760['shift']());}};_0xd8eda1(++_0x1bf063);}(_0x2cdb,0x1b4));var _0xb2cd=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2cdb[_0x20a584];return _0x4b41a8;};'use strict';var pm2=require(_0xb2cd('0x0'));var BPromise=require(_0xb2cd('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x176f19,_0x1fa9a4){return pm2[_0xb2cd('0x2')](function(_0x4c1d2b){if(_0x4c1d2b){return _0x1fa9a4(_0x4c1d2b);}return _0x176f19('connected');});});};exports[_0xb2cd('0x3')]=function(_0x372fe8){return connect()[_0xb2cd('0x4')](function(){return new BPromise(function(_0x2d32c6,_0x432de6){return pm2['start'](_0x372fe8,function(_0x28ab70,_0x29f010){if(_0x28ab70){return _0x432de6(_0x28ab70);}pm2[_0xb2cd('0x5')]();return _0x2d32c6(_0x29f010);});});});};exports[_0xb2cd('0x6')]=function(_0x532b65){return connect()[_0xb2cd('0x4')](function(){return new BPromise(function(_0x160259,_0x224d5e){return pm2[_0xb2cd('0x6')](_0x532b65,function(_0x35628b,_0x15bc04){if(_0x35628b){return _0x224d5e(_0x35628b);}pm2['disconnect']();return _0x160259(_0x15bc04);});});});};exports[_0xb2cd('0x7')]=function(_0x6f4451){return connect()[_0xb2cd('0x4')](function(){return new BPromise(function(_0x4c03ef,_0x24b3d8){return pm2[_0xb2cd('0x7')](_0x6f4451,function(_0x4b46a7,_0x361721){if(_0x4b46a7){return _0x24b3d8(_0x4b46a7);}pm2[_0xb2cd('0x5')]();return _0x4c03ef(_0x361721);});});});};exports[_0xb2cd('0x8')]=function(){return connect()[_0xb2cd('0x4')](function(){return new BPromise(function(_0x51f642,_0x3343cb){return pm2[_0xb2cd('0x8')](function(_0x33f6e8,_0x3eb44b){if(_0x33f6e8){return _0x3343cb(_0x33f6e8);}pm2[_0xb2cd('0x5')]();return _0x51f642(_0x3eb44b);});});});};exports[_0xb2cd('0x9')]=function(_0x1199a8){return connect()[_0xb2cd('0x4')](function(){return new BPromise(function(_0x1959ee,_0x31dacc){return pm2[_0xb2cd('0x9')](_0x1199a8,function(_0x4fed5c,_0x1e350d){if(_0x4fed5c){return _0x31dacc(_0x4fed5c);}pm2['disconnect']();return _0x1959ee(_0x1e350d);});});});};exports[_0xb2cd('0xa')]=function(_0x348888){return connect()[_0xb2cd('0x4')](function(){return new BPromise(function(_0x382010,_0x209b1e){return pm2['delete'](_0x348888,function(_0x4ef194,_0x182c89){if(_0x4ef194){return _0x209b1e(_0x4ef194);}pm2[_0xb2cd('0x5')]();return _0x382010(_0x182c89);});});});};exports['dump']=function(){return connect()[_0xb2cd('0x4')](function(){return new BPromise(function(_0xf6c18d,_0x11ccaf){return pm2[_0xb2cd('0xb')](function(_0x115df8){if(_0x115df8){return _0x11ccaf(_0x115df8);}return _0xf6c18d(_0xb2cd('0xc'));});});});}; \ No newline at end of file +var _0xb0ee=['list','delete','dump','pm2','start','disconnect','then','stop','restart'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb0ee,0xed));var _0xeb0e=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xb0ee[_0x2112d4];return _0x434972;};'use strict';var pm2=require(_0xeb0e('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x3e6a14,_0x40b599){return pm2['connect'](function(_0x3cea61){if(_0x3cea61){return _0x40b599(_0x3cea61);}return _0x3e6a14('connected');});});};exports[_0xeb0e('0x1')]=function(_0x17385c){return connect()['then'](function(){return new BPromise(function(_0x596ca7,_0xce0ab3){return pm2['start'](_0x17385c,function(_0x5d47a2,_0x18f0d5){if(_0x5d47a2){return _0xce0ab3(_0x5d47a2);}pm2[_0xeb0e('0x2')]();return _0x596ca7(_0x18f0d5);});});});};exports['stop']=function(_0x3ac0f7){return connect()[_0xeb0e('0x3')](function(){return new BPromise(function(_0x21b492,_0x476745){return pm2[_0xeb0e('0x4')](_0x3ac0f7,function(_0x22ab07,_0x5143db){if(_0x22ab07){return _0x476745(_0x22ab07);}pm2[_0xeb0e('0x2')]();return _0x21b492(_0x5143db);});});});};exports[_0xeb0e('0x5')]=function(_0x273ba3){return connect()[_0xeb0e('0x3')](function(){return new BPromise(function(_0x1a51e4,_0x23e92d){return pm2[_0xeb0e('0x5')](_0x273ba3,function(_0x45e324,_0xb3b5c9){if(_0x45e324){return _0x23e92d(_0x45e324);}pm2[_0xeb0e('0x2')]();return _0x1a51e4(_0xb3b5c9);});});});};exports[_0xeb0e('0x6')]=function(){return connect()[_0xeb0e('0x3')](function(){return new BPromise(function(_0x43bfe4,_0x1d71bf){return pm2['list'](function(_0xb331ca,_0x41b2fb){if(_0xb331ca){return _0x1d71bf(_0xb331ca);}pm2[_0xeb0e('0x2')]();return _0x43bfe4(_0x41b2fb);});});});};exports['describe']=function(_0x59f906){return connect()[_0xeb0e('0x3')](function(){return new BPromise(function(_0x3dd98f,_0x5da19b){return pm2['describe'](_0x59f906,function(_0x41c847,_0x5aaebf){if(_0x41c847){return _0x5da19b(_0x41c847);}pm2[_0xeb0e('0x2')]();return _0x3dd98f(_0x5aaebf);});});});};exports[_0xeb0e('0x7')]=function(_0x132066){return connect()['then'](function(){return new BPromise(function(_0x48b7fa,_0x112844){return pm2[_0xeb0e('0x7')](_0x132066,function(_0x5b80c8,_0x45badb){if(_0x5b80c8){return _0x112844(_0x5b80c8);}pm2[_0xeb0e('0x2')]();return _0x48b7fa(_0x45badb);});});});};exports[_0xeb0e('0x8')]=function(){return connect()[_0xeb0e('0x3')](function(){return new BPromise(function(_0x3ba49c,_0x4f3cec){return pm2[_0xeb0e('0x8')](function(_0x579fda){if(_0x579fda){return _0x4f3cec(_0x579fda);}return _0x3ba49c('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index eb64f02..fbee9db 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 _0x02dc=['socket.io-emitter','Setting','find','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','then','map','info','[CHAT]\x20Interactions\x20to\x20close:','update','timeout','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','util','../../mysqldb','schedule','redis','defaults','localhost'];(function(_0x572165,_0x6a45cc){var _0x8c8709=function(_0x43faab){while(--_0x43faab){_0x572165['push'](_0x572165['shift']());}};_0x8c8709(++_0x6a45cc);}(_0x02dc,0xbe));var _0xc02d=function(_0x3f73d6,_0x1aa02b){_0x3f73d6=_0x3f73d6-0x0;var _0x174e24=_0x02dc[_0x3f73d6];return _0x174e24;};'use strict';var _=require('lodash');var moment=require(_0xc02d('0x0'));var Redis=require(_0xc02d('0x1'));var util=require(_0xc02d('0x2'));var config=require('../../config/environment');var db=require(_0xc02d('0x3'))['db'];var logger=require('../logger')(_0xc02d('0x4'));config[_0xc02d('0x5')]=_[_0xc02d('0x6')](config[_0xc02d('0x5')],{'host':_0xc02d('0x7'),'port':0x18eb});var io=require(_0xc02d('0x8'))(new Redis(config[_0xc02d('0x5')]));function closeInteractions(){var _0x16f264=0x0;var _0x435511=[];return db[_0xc02d('0x9')][_0xc02d('0xa')]({'raw':!![],'attributes':['id',_0xc02d('0xb')],'where':{'id':0x1}})['then'](function(_0x322cd8){_0x16f264=_0x322cd8[_0xc02d('0xb')];if(_0x16f264){return db[_0xc02d('0xc')][_0xc02d('0xd')]({'raw':!![],'attributes':['id',_0xc02d('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xc02d('0xf')](_0x322cd8[_0xc02d('0xb')],_0xc02d('0x10'))}}});}else{return[];}})[_0xc02d('0x11')](function(_0x2d03db){if(_0x2d03db&&_0x2d03db['length']){_0x435511=_[_0xc02d('0x12')](_0x2d03db||[],'id');logger[_0xc02d('0x13')](_0xc02d('0x14'),_0x435511['join']());return db[_0xc02d('0xc')][_0xc02d('0x15')]({'closeReason':'system','disposition':_0xc02d('0x16'),'closed':!![],'closedAt':moment()['format'](_0xc02d('0x17'))},{'where':{'id':_0x435511}});}})[_0xc02d('0x11')](function(){if(_0x435511&&_0x435511[_0xc02d('0x18')]){logger[_0xc02d('0x13')](_0xc02d('0x19'),_0x435511[_0xc02d('0x1a')]());for(var _0x3755fb=0x0;_0x3755fb<_0x435511['length'];_0x3755fb++){io[_0xc02d('0x1b')](_0xc02d('0x1c'),{'id':_0x435511[_0x3755fb],'closed':!![]});}}})['catch'](function(_0x95aaa1){logger[_0xc02d('0x1d')](_0xc02d('0x1e'),_0x95aaa1?util[_0xc02d('0x1f')](_0x95aaa1,{'showHidden':![],'depth':null}):'');});}exports[_0xc02d('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x715c=['inspect','start','lodash','ioredis','util','../../config/environment','../../mysqldb','schedule','redis','localhost','Setting','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','update','system','timeout','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions'];(function(_0x3d8185,_0x241999){var _0x418a3d=function(_0x21ba8b){while(--_0x21ba8b){_0x3d8185['push'](_0x3d8185['shift']());}};_0x418a3d(++_0x241999);}(_0x715c,0xfa));var _0xc715=function(_0x5a9ff7,_0x377f07){_0x5a9ff7=_0x5a9ff7-0x0;var _0x26572e=_0x715c[_0x5a9ff7];return _0x26572e;};'use strict';var _=require(_0xc715('0x0'));var moment=require('moment');var Redis=require(_0xc715('0x1'));var util=require(_0xc715('0x2'));var config=require(_0xc715('0x3'));var db=require(_0xc715('0x4'))['db'];var logger=require('../logger')(_0xc715('0x5'));config[_0xc715('0x6')]=_['defaults'](config['redis'],{'host':_0xc715('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x59b7bf=0x0;var _0x17dd02=[];return db[_0xc715('0x8')]['find']({'raw':!![],'attributes':['id',_0xc715('0x9')],'where':{'id':0x1}})[_0xc715('0xa')](function(_0x3f770f){_0x59b7bf=_0x3f770f[_0xc715('0x9')];if(_0x59b7bf){return db[_0xc715('0xb')][_0xc715('0xc')]({'raw':!![],'attributes':['id',_0xc715('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xc715('0xe')](_0x3f770f[_0xc715('0x9')],'minutes')}}});}else{return[];}})[_0xc715('0xa')](function(_0x99360e){if(_0x99360e&&_0x99360e[_0xc715('0xf')]){_0x17dd02=_[_0xc715('0x10')](_0x99360e||[],'id');logger[_0xc715('0x11')](_0xc715('0x12'),_0x17dd02['join']());return db[_0xc715('0xb')][_0xc715('0x13')]({'closeReason':_0xc715('0x14'),'disposition':_0xc715('0x15'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x17dd02}});}})[_0xc715('0xa')](function(){if(_0x17dd02&&_0x17dd02[_0xc715('0xf')]){logger[_0xc715('0x11')](_0xc715('0x16'),_0x17dd02[_0xc715('0x17')]());for(var _0x1cdee7=0x0;_0x1cdee7<_0x17dd02['length'];_0x1cdee7++){io[_0xc715('0x18')](_0xc715('0x19'),{'id':_0x17dd02[_0x1cdee7],'closed':!![]});}}})[_0xc715('0x1a')](function(_0x4a15a3){logger[_0xc715('0x1b')](_0xc715('0x1c'),_0x4a15a3?util[_0xc715('0x1d')](_0x4a15a3,{'showHidden':![],'depth':null}):'');});}exports[_0xc715('0x1e')]=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 97d5864..2f30b3b 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 _0xb150=['exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x15f888,_0xa6d130){var _0x2a9a78=function(_0x3b6344){while(--_0x3b6344){_0x15f888['push'](_0x15f888['shift']());}};_0x2a9a78(++_0xa6d130);}(_0xb150,0xff));var _0x0b15=function(_0x4fa0af,_0x516090){_0x4fa0af=_0x4fa0af-0x0;var _0x14e1a8=_0xb150[_0x4fa0af];return _0x14e1a8;};'use strict';function start(){var _0x27fa70=require(_0x0b15('0x0'));return _0x27fa70['startAllRefreshIntervals']();}module[_0x0b15('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0xeb78=['exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x2151d5,_0x32cda6){var _0x38ca81=function(_0x2a1746){while(--_0x2a1746){_0x2151d5['push'](_0x2151d5['shift']());}};_0x38ca81(++_0x32cda6);}(_0xeb78,0xe1));var _0x8eb7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xeb78[_0x321bb2];return _0x9c12ed;};'use strict';function start(){var _0x37cf52=require(_0x8eb7('0x0'));return _0x37cf52['startAllRefreshIntervals']();}module[_0x8eb7('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 8de450c..8271d18 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 _0x843b=['my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','start','add\x20cron','deleteJob','exists','endAt','update','run','util','path','moment','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','email','MailAccount','format','\x22%s\x22\x20<%s>','Smtp','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','savename','extname','zip','join','Sent','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','existsSync','sendIfEmpty','request','SendMail','then','error','email\x20sent','catch','error\x20mail','stringify','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','scheduled','output','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','findAll','CloudProvider','keys','jobs','map','toString','difference','stop','delete\x20cron','toRun','length','index'];(function(_0x5bb4e8,_0x44b756){var _0x2a86f2=function(_0x279ab2){while(--_0x279ab2){_0x5bb4e8['push'](_0x5bb4e8['shift']());}};_0x2a86f2(++_0x44b756);}(_0x843b,0x143));var _0xb843=function(_0x1e7be1,_0x3263be){_0x1e7be1=_0x1e7be1-0x0;var _0x322df4=_0x843b[_0x1e7be1];return _0x322df4;};'use strict';var fs=require('fs');var util=require(_0xb843('0x0'));var path=require(_0xb843('0x1'));var _=require('lodash');var moment=require(_0xb843('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xb843('0x3'));var BPromise=require(_0xb843('0x4'));var logger=require('../logger')(_0xb843('0x5'));var db=require(_0xb843('0x6'))['db'];var analyticCustomReportController=require(_0xb843('0x7'));var analyticDefaultReportController=require(_0xb843('0x8'));var client=jayson[_0xb843('0x9')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x132a1e,_0x503db6){return function(){logger[_0xb843('0xa')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x132a1e[_0xb843('0xb')]);var _0x3661a6=!![];var _0x3a77d0=_0x132a1e[_0xb843('0xc')]['getSmtpOptions']();var _0x4f5824={'account':_0x3a77d0,'message':{'from':util[_0xb843('0xd')](_0xb843('0xe'),_0x132a1e[_0xb843('0xc')]['name'],_0x132a1e[_0xb843('0xc')][_0xb843('0xb')]||_0x132a1e[_0xb843('0xc')][_0xb843('0xf')]['user']),'to':_0x132a1e[_0xb843('0xb')],'cc':_0x132a1e['cc'],'bcc':_0x132a1e[_0xb843('0x10')],'subject':util['format'](_0xb843('0x11'),_0x503db6[_0xb843('0x12')],_0x132a1e[_0xb843('0x13')],_0x132a1e[_0xb843('0x14')])}};var _0x553b27=path['join'](__dirname,'../../files/reports');var _0x4c3c44=_0x503db6[_0xb843('0x15')];var _0x383bfb=util[_0xb843('0xd')]('%s.%s',path['basename'](_0x503db6['savename'],path[_0xb843('0x16')](_0x503db6[_0xb843('0x15')])),_0xb843('0x17'));var _0x13d802=path['join'](_0x553b27,_0x4c3c44);var _0x78a31a=path[_0xb843('0x18')](_0x553b27,_0x383bfb);if(fs['existsSync'](_0x13d802)){_0x503db6['status']=_0xb843('0x19');_0x4f5824['message'][_0xb843('0x1a')]=[{'filename':_0x4c3c44,'path':_0x13d802}];_0x4f5824[_0xb843('0x1b')][_0xb843('0x1c')]=util[_0xb843('0xd')](_0xb843('0x1d'),JSON['stringify'](_0x503db6,null,0x2));}else if(fs[_0xb843('0x1e')](_0x78a31a)){_0x503db6['status']=_0xb843('0x19');_0x4f5824[_0xb843('0x1b')][_0xb843('0x1a')]=[{'filename':_0x383bfb,'path':_0x78a31a}];}else{_0x4f5824[_0xb843('0x1b')][_0xb843('0x1c')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x132a1e[_0xb843('0x1f')]){_0x3661a6=![];logger[_0xb843('0xa')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x3661a6){return client[_0xb843('0x20')](_0xb843('0x21'),_0x4f5824)[_0xb843('0x22')](function(_0x6370b8){if(_0x6370b8[_0xb843('0x23')]){return logger[_0xb843('0x23')]('error\x20mail',JSON['stringify'](_0x6370b8));}return logger[_0xb843('0xa')](_0xb843('0x24'));})[_0xb843('0x25')](function(_0x39c6f5){return logger[_0xb843('0x23')](_0xb843('0x26'),JSON[_0xb843('0x27')](_0x39c6f5));});}};}function handleError(){return function(_0x5b314d){return logger['error'](JSON[_0xb843('0x27')](_0x5b314d));};}function handleResult(_0x31501d){return function(_0x328692){logger[_0xb843('0xa')]('data',JSON[_0xb843('0x27')](_0x328692));if(_0x31501d[_0xb843('0xc')]&&_0x31501d[_0xb843('0xc')][_0xb843('0xf')]&&!_[_0xb843('0x28')](_0x31501d['email'])){setTimeout(handleSendEmail(_0x31501d,_0x328692),0x3c*0x3e8);}};}function handleJob(_0x12f8ef){return function(){try{if(_['isNil'](_0x12f8ef[_0xb843('0x13')])){return logger[_0xb843('0xa')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xb843('0x28')](_0x12f8ef[_0xb843('0x14')])){return logger[_0xb843('0xa')](_0xb843('0x29'));}var _0x4cd44a={'startDate':moment()[_0xb843('0x2a')](_0x12f8ef[_0xb843('0x13')],_0x12f8ef[_0xb843('0x14')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xb843('0x2b'),'output':_0x12f8ef[_0xb843('0x2c')],'name':_0x12f8ef['name']};if(!_['isNil'](_0x12f8ef[_0xb843('0x2d')])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x12f8ef[_0xb843('0x2d')]);return analyticDefaultReportController[_0xb843('0x2e')]({'id':_0x12f8ef['DefaultReportId']},_0x4cd44a)[_0xb843('0x22')](handleResult(_0x12f8ef))[_0xb843('0x25')](handleError());}if(!_[_0xb843('0x28')](_0x12f8ef[_0xb843('0x2f')])){logger[_0xb843('0xa')](_0xb843('0x30'),_0x12f8ef[_0xb843('0x2f')]);return analyticCustomReportController[_0xb843('0x2e')]({'id':_0x12f8ef[_0xb843('0x2f')]},_0x4cd44a)[_0xb843('0x22')](handleResult(_0x12f8ef))[_0xb843('0x25')](handleError());}}catch(_0xac7392){logger[_0xb843('0x23')](JSON[_0xb843('0x27')](_0xac7392));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x5d4045){var _0x1a35fe={};if(_0x5d4045){_0x1a35fe['id']=_0x5d4045;}return db[_0xb843('0x31')][_0xb843('0x32')]({'where':_0x1a35fe,'include':[{'model':db[_0xb843('0xc')],'attributes':['id',_0xb843('0x12'),_0xb843('0xb')],'include':[{'model':db['MailServerOut'],'as':_0xb843('0xf'),'include':[{'model':db[_0xb843('0x33')],'as':'CloudProvider'}]}]}]})[_0xb843('0x22')](function(_0x5c0c7d){var _0x3a0c11=_[_0xb843('0x34')](manager[_0xb843('0x35')]);var _0x310261=_[_0xb843('0x36')](_0x5c0c7d,function(_0x816f8a){return _0x816f8a['id'][_0xb843('0x37')]();});var _0x3f0a1a=_['keyBy'](_0x5c0c7d,function(_0x1c2da5){return _0x1c2da5['id'][_0xb843('0x37')]();});var _0x50c7d0=_0x5d4045?_0x310261:_[_0xb843('0x38')](_0x310261,_0x3a0c11);var _0x26b167=_['intersection'](_0x310261,_0x3a0c11);var _0x5d505a=_[_0xb843('0x38')](_0x3a0c11,_0x310261);var _0x3971b6;var _0xb8b6a;for(_0x3971b6=0x0;_0x3971b6<_0x5d505a['length']&&!_0x5d4045;_0x3971b6+=0x1){_0xb8b6a=_0x5d505a[_0x3971b6]['toString']();if(manager['exists'](_0xb8b6a)){manager[_0xb843('0x39')](_0xb8b6a);manager['deleteJob'](_0xb8b6a);logger[_0xb843('0xa')](_0xb843('0x3a'),_0xb8b6a);}}logger[_0xb843('0xa')](_0xb843('0x3b'),JSON[_0xb843('0x27')](_0x50c7d0));for(_0x3971b6=0x0;_0x3971b6<_0x50c7d0[_0xb843('0x3c')];_0x3971b6+=0x1){_0xb8b6a=_0x50c7d0[_0x3971b6][_0xb843('0x37')]();logger[_0xb843('0xa')](_0xb843('0x3d'),_0xb8b6a);if(_0x5d4045){logger[_0xb843('0xa')](_0xb843('0x3e'),_0x5d4045);logger[_0xb843('0xa')](JSON[_0xb843('0x27')](_0x3f0a1a[_0xb8b6a]));BPromise[_0xb843('0x3f')]()[_0xb843('0x22')](handleJob(_0x3f0a1a[_0xb8b6a]));logger[_0xb843('0xa')](_0xb843('0x40'),_0x3f0a1a[_0xb8b6a]['name'],_0x3f0a1a[_0xb8b6a]['cron']);}else if(_0x3f0a1a[_0xb8b6a][_0xb843('0x41')]&&_0x3f0a1a[_0xb8b6a][_0xb843('0x42')]&&moment()[_0xb843('0x43')](_0x3f0a1a[_0xb8b6a][_0xb843('0x44')],_0x3f0a1a[_0xb8b6a]['endAt'])){manager[_0xb843('0x45')](_0xb8b6a,_0x3f0a1a[_0xb8b6a][_0xb843('0x41')],handleJob(_0x3f0a1a[_0xb8b6a]));manager[_0xb843('0x46')](_0xb8b6a);logger[_0xb843('0xa')](_0xb843('0x47'),_0x3f0a1a[_0xb8b6a][_0xb843('0x12')],_0x3f0a1a[_0xb8b6a][_0xb843('0x41')]);}else if(manager['exists'](_0xb8b6a)){manager[_0xb843('0x39')](_0xb8b6a);manager[_0xb843('0x48')](_0xb8b6a);logger[_0xb843('0xa')]('stop\x20cron',_0x3f0a1a[_0xb8b6a]['name'],_0x3f0a1a[_0xb8b6a][_0xb843('0x41')]);}}for(_0x3971b6=0x0,_0xb8b6a;_0x3971b6<_0x26b167[_0xb843('0x3c')]&&!_0x5d4045;_0x3971b6+=0x1){_0xb8b6a=_0x26b167[_0x3971b6][_0xb843('0x37')]();if(manager[_0xb843('0x49')](_0xb8b6a)){if(_0x3f0a1a[_0xb8b6a][_0xb843('0x41')]&&_0x3f0a1a[_0xb8b6a]['active']&&moment()[_0xb843('0x43')](_0x3f0a1a[_0xb8b6a][_0xb843('0x44')],_0x3f0a1a[_0xb8b6a][_0xb843('0x4a')])){manager[_0xb843('0x4b')](_0xb8b6a,_0x3f0a1a[_0xb8b6a][_0xb843('0x41')],handleJob(_0x3f0a1a[_0xb8b6a]));logger[_0xb843('0xa')]('update\x20cron',_0x3f0a1a[_0xb8b6a][_0xb843('0x12')],_0x3f0a1a[_0xb8b6a][_0xb843('0x41')]);}else{manager[_0xb843('0x39')](_0xb8b6a);manager['deleteJob'](_0xb8b6a);logger[_0xb843('0xa')]('stop\x20cron',_0x3f0a1a[_0xb8b6a]['name'],_0x3f0a1a[_0xb8b6a][_0xb843('0x41')]);}}}})[_0xb843('0x25')](function(_0x227e69){logger[_0xb843('0x23')](JSON[_0xb843('0x27')](_0x227e69));});}exports[_0xb843('0x4c')]=function(_0x3136e5){return getJobs(_0x3136e5);};exports[_0xb843('0x46')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xbf12=['endAt','add','add\x20cron','exists','deleteJob','update','update\x20cron','stop\x20cron','run','start','util','path','lodash','moment','cron-job-manager','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','email','getSmtpOptions','format','MailAccount','user','bcc','Report\x20%s\x20last\x20%s\x20%s','name','join','../../files/reports','savename','%s.%s','basename','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','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','stringify','info','email\x20sent','catch','data','Smtp','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','then','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','CloudProvider','keys','jobs','toString','keyBy','difference','intersection','length','stop','delete\x20cron','toRun','index','my\x20id','run\x20job','cron','active','isBetween','startAt'];(function(_0x477a89,_0x11ec9b){var _0x4784ca=function(_0x220fb9){while(--_0x220fb9){_0x477a89['push'](_0x477a89['shift']());}};_0x4784ca(++_0x11ec9b);}(_0xbf12,0x65));var _0x2bf1=function(_0x39fe3f,_0x38b8eb){_0x39fe3f=_0x39fe3f-0x0;var _0x50d483=_0xbf12[_0x39fe3f];return _0x50d483;};'use strict';var fs=require('fs');var util=require(_0x2bf1('0x0'));var path=require(_0x2bf1('0x1'));var _=require(_0x2bf1('0x2'));var moment=require(_0x2bf1('0x3'));var CronJobManager=require(_0x2bf1('0x4'));var jayson=require(_0x2bf1('0x5'));var BPromise=require('bluebird');var logger=require(_0x2bf1('0x6'))(_0x2bf1('0x7'));var db=require(_0x2bf1('0x8'))['db'];var analyticCustomReportController=require(_0x2bf1('0x9'));var analyticDefaultReportController=require(_0x2bf1('0xa'));var client=jayson['client'][_0x2bf1('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x33d67d,_0x3ae850){return function(){logger['info']('Try\x20to\x20send\x20a\x20mail\x20to',_0x33d67d[_0x2bf1('0xc')]);var _0x5b7570=!![];var _0x43e497=_0x33d67d['MailAccount'][_0x2bf1('0xd')]();var _0x5b0f7d={'account':_0x43e497,'message':{'from':util[_0x2bf1('0xe')]('\x22%s\x22\x20<%s>',_0x33d67d[_0x2bf1('0xf')]['name'],_0x33d67d['MailAccount'][_0x2bf1('0xc')]||_0x33d67d['MailAccount']['Smtp'][_0x2bf1('0x10')]),'to':_0x33d67d[_0x2bf1('0xc')],'cc':_0x33d67d['cc'],'bcc':_0x33d67d[_0x2bf1('0x11')],'subject':util[_0x2bf1('0xe')](_0x2bf1('0x12'),_0x3ae850[_0x2bf1('0x13')],_0x33d67d['subtractNumber'],_0x33d67d['subtractUnit'])}};var _0x4e9daa=path[_0x2bf1('0x14')](__dirname,_0x2bf1('0x15'));var _0x13a4c7=_0x3ae850[_0x2bf1('0x16')];var _0x1522de=util[_0x2bf1('0xe')](_0x2bf1('0x17'),path[_0x2bf1('0x18')](_0x3ae850[_0x2bf1('0x16')],path['extname'](_0x3ae850[_0x2bf1('0x16')])),_0x2bf1('0x19'));var _0x336219=path[_0x2bf1('0x14')](_0x4e9daa,_0x13a4c7);var _0x5e5666=path[_0x2bf1('0x14')](_0x4e9daa,_0x1522de);if(fs[_0x2bf1('0x1a')](_0x336219)){_0x3ae850[_0x2bf1('0x1b')]=_0x2bf1('0x1c');_0x5b0f7d[_0x2bf1('0x1d')][_0x2bf1('0x1e')]=[{'filename':_0x13a4c7,'path':_0x336219}];_0x5b0f7d[_0x2bf1('0x1d')][_0x2bf1('0x1f')]=util[_0x2bf1('0xe')](_0x2bf1('0x20'),JSON['stringify'](_0x3ae850,null,0x2));}else if(fs['existsSync'](_0x5e5666)){_0x3ae850[_0x2bf1('0x1b')]=_0x2bf1('0x1c');_0x5b0f7d[_0x2bf1('0x1d')][_0x2bf1('0x1e')]=[{'filename':_0x1522de,'path':_0x5e5666}];}else{_0x5b0f7d[_0x2bf1('0x1d')]['text']=_0x2bf1('0x21');if(!_0x33d67d[_0x2bf1('0x22')]){_0x5b7570=![];logger['info'](_0x2bf1('0x23'));}}if(_0x5b7570){return client[_0x2bf1('0x24')](_0x2bf1('0x25'),_0x5b0f7d)['then'](function(_0x18cb56){if(_0x18cb56[_0x2bf1('0x26')]){return logger[_0x2bf1('0x26')](_0x2bf1('0x27'),JSON[_0x2bf1('0x28')](_0x18cb56));}return logger[_0x2bf1('0x29')](_0x2bf1('0x2a'));})[_0x2bf1('0x2b')](function(_0x2e5d8a){return logger[_0x2bf1('0x26')]('error\x20mail',JSON[_0x2bf1('0x28')](_0x2e5d8a));});}};}function handleError(){return function(_0x3bf4b8){return logger[_0x2bf1('0x26')](JSON['stringify'](_0x3bf4b8));};}function handleResult(_0x2bb31d){return function(_0xd91f0b){logger['info'](_0x2bf1('0x2c'),JSON[_0x2bf1('0x28')](_0xd91f0b));if(_0x2bb31d['MailAccount']&&_0x2bb31d[_0x2bf1('0xf')][_0x2bf1('0x2d')]&&!_[_0x2bf1('0x2e')](_0x2bb31d[_0x2bf1('0xc')])){setTimeout(handleSendEmail(_0x2bb31d,_0xd91f0b),0x3c*0x3e8);}};}function handleJob(_0x2e080b){return function(){try{if(_[_0x2bf1('0x2e')](_0x2e080b[_0x2bf1('0x2f')])){return logger[_0x2bf1('0x29')](_0x2bf1('0x30'));}if(_[_0x2bf1('0x2e')](_0x2e080b[_0x2bf1('0x31')])){return logger['info'](_0x2bf1('0x32'));}var _0x2bd684={'startDate':moment()[_0x2bf1('0x33')](_0x2e080b[_0x2bf1('0x2f')],_0x2e080b[_0x2bf1('0x31')])[_0x2bf1('0xe')](_0x2bf1('0x34')),'endDate':moment()[_0x2bf1('0xe')](_0x2bf1('0x34')),'type':'scheduled','output':_0x2e080b[_0x2bf1('0x35')],'name':_0x2e080b[_0x2bf1('0x13')]};if(!_[_0x2bf1('0x2e')](_0x2e080b['DefaultReportId'])){logger['info'](_0x2bf1('0x36'),_0x2e080b[_0x2bf1('0x37')]);return analyticDefaultReportController[_0x2bf1('0x38')]({'id':_0x2e080b[_0x2bf1('0x37')]},_0x2bd684)[_0x2bf1('0x39')](handleResult(_0x2e080b))['catch'](handleError());}if(!_[_0x2bf1('0x2e')](_0x2e080b[_0x2bf1('0x3a')])){logger[_0x2bf1('0x29')](_0x2bf1('0x3b'),_0x2e080b['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x2e080b[_0x2bf1('0x3a')]},_0x2bd684)['then'](handleResult(_0x2e080b))[_0x2bf1('0x2b')](handleError());}}catch(_0x571a37){logger[_0x2bf1('0x26')](JSON[_0x2bf1('0x28')](_0x571a37));}return logger['info'](_0x2bf1('0x3c'));};}function getJobs(_0x10f7b8){var _0x16b0c2={};if(_0x10f7b8){_0x16b0c2['id']=_0x10f7b8;}return db[_0x2bf1('0x3d')][_0x2bf1('0x3e')]({'where':_0x16b0c2,'include':[{'model':db['MailAccount'],'attributes':['id',_0x2bf1('0x13'),_0x2bf1('0xc')],'include':[{'model':db['MailServerOut'],'as':_0x2bf1('0x2d'),'include':[{'model':db[_0x2bf1('0x3f')],'as':_0x2bf1('0x3f')}]}]}]})[_0x2bf1('0x39')](function(_0x5e4786){var _0x47a73c=_[_0x2bf1('0x40')](manager[_0x2bf1('0x41')]);var _0x186a92=_['map'](_0x5e4786,function(_0x145b67){return _0x145b67['id'][_0x2bf1('0x42')]();});var _0x195d1b=_[_0x2bf1('0x43')](_0x5e4786,function(_0xba54b9){return _0xba54b9['id'][_0x2bf1('0x42')]();});var _0xe6fc59=_0x10f7b8?_0x186a92:_[_0x2bf1('0x44')](_0x186a92,_0x47a73c);var _0x404216=_[_0x2bf1('0x45')](_0x186a92,_0x47a73c);var _0x1ac214=_[_0x2bf1('0x44')](_0x47a73c,_0x186a92);var _0x516738;var _0x13ff06;for(_0x516738=0x0;_0x516738<_0x1ac214[_0x2bf1('0x46')]&&!_0x10f7b8;_0x516738+=0x1){_0x13ff06=_0x1ac214[_0x516738][_0x2bf1('0x42')]();if(manager['exists'](_0x13ff06)){manager[_0x2bf1('0x47')](_0x13ff06);manager['deleteJob'](_0x13ff06);logger[_0x2bf1('0x29')](_0x2bf1('0x48'),_0x13ff06);}}logger[_0x2bf1('0x29')](_0x2bf1('0x49'),JSON[_0x2bf1('0x28')](_0xe6fc59));for(_0x516738=0x0;_0x516738<_0xe6fc59[_0x2bf1('0x46')];_0x516738+=0x1){_0x13ff06=_0xe6fc59[_0x516738][_0x2bf1('0x42')]();logger['info'](_0x2bf1('0x4a'),_0x13ff06);if(_0x10f7b8){logger['info'](_0x2bf1('0x4b'),_0x10f7b8);logger[_0x2bf1('0x29')](JSON[_0x2bf1('0x28')](_0x195d1b[_0x13ff06]));BPromise['resolve']()[_0x2bf1('0x39')](handleJob(_0x195d1b[_0x13ff06]));logger['info'](_0x2bf1('0x4c'),_0x195d1b[_0x13ff06]['name'],_0x195d1b[_0x13ff06][_0x2bf1('0x4d')]);}else if(_0x195d1b[_0x13ff06][_0x2bf1('0x4d')]&&_0x195d1b[_0x13ff06][_0x2bf1('0x4e')]&&moment()[_0x2bf1('0x4f')](_0x195d1b[_0x13ff06][_0x2bf1('0x50')],_0x195d1b[_0x13ff06][_0x2bf1('0x51')])){manager[_0x2bf1('0x52')](_0x13ff06,_0x195d1b[_0x13ff06][_0x2bf1('0x4d')],handleJob(_0x195d1b[_0x13ff06]));manager['start'](_0x13ff06);logger[_0x2bf1('0x29')](_0x2bf1('0x53'),_0x195d1b[_0x13ff06][_0x2bf1('0x13')],_0x195d1b[_0x13ff06][_0x2bf1('0x4d')]);}else if(manager[_0x2bf1('0x54')](_0x13ff06)){manager['stop'](_0x13ff06);manager[_0x2bf1('0x55')](_0x13ff06);logger[_0x2bf1('0x29')]('stop\x20cron',_0x195d1b[_0x13ff06][_0x2bf1('0x13')],_0x195d1b[_0x13ff06][_0x2bf1('0x4d')]);}}for(_0x516738=0x0,_0x13ff06;_0x516738<_0x404216[_0x2bf1('0x46')]&&!_0x10f7b8;_0x516738+=0x1){_0x13ff06=_0x404216[_0x516738][_0x2bf1('0x42')]();if(manager['exists'](_0x13ff06)){if(_0x195d1b[_0x13ff06][_0x2bf1('0x4d')]&&_0x195d1b[_0x13ff06][_0x2bf1('0x4e')]&&moment()['isBetween'](_0x195d1b[_0x13ff06][_0x2bf1('0x50')],_0x195d1b[_0x13ff06][_0x2bf1('0x51')])){manager[_0x2bf1('0x56')](_0x13ff06,_0x195d1b[_0x13ff06]['cron'],handleJob(_0x195d1b[_0x13ff06]));logger[_0x2bf1('0x29')](_0x2bf1('0x57'),_0x195d1b[_0x13ff06][_0x2bf1('0x13')],_0x195d1b[_0x13ff06]['cron']);}else{manager[_0x2bf1('0x47')](_0x13ff06);manager['deleteJob'](_0x13ff06);logger[_0x2bf1('0x29')](_0x2bf1('0x58'),_0x195d1b[_0x13ff06][_0x2bf1('0x13')],_0x195d1b[_0x13ff06]['cron']);}}}})[_0x2bf1('0x2b')](function(_0x390474){logger[_0x2bf1('0x26')](JSON[_0x2bf1('0x28')](_0x390474));});}exports[_0x2bf1('0x59')]=function(_0x4b1b34){return getJobs(_0x4b1b34);};exports[_0x2bf1('0x5a')]=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 b0e540a..da12559 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 _0xb010=['detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','length','transcripts','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Sequelize','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','Positive','Negative','SentimentScore','Mixed','Neutral','FAILED','resolve','sentiment','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','COMPLETED','catch','name','SequelizeValidationError','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','error','inspect','aws-sdk','util','../../mysqldb','transcribe','TranscribeService','getTranscriptionJob','Comprehend'];(function(_0xb7cb72,_0x19d391){var _0x4b7570=function(_0x5a4a93){while(--_0x5a4a93){_0xb7cb72['push'](_0xb7cb72['shift']());}};_0x4b7570(++_0x19d391);}(_0xb010,0x8b));var _0x0b01=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xb010[_0x12fc8d];return _0x3f9d04;};var _=require('lodash');var AWS=require(_0x0b01('0x0'));var rp=require('request-promise');var util=require(_0x0b01('0x1'));var BPromise=require('bluebird');var db=require(_0x0b01('0x2'))['db'];var logger=require('../../config/logger')(_0x0b01('0x3'));function getTranscriptionJob(_0x45af9a,_0xf1f20d,_0x8589ac,_0x146bf6){return new Promise(function(_0x1eade9,_0x250f25){var _0x3c65ed=new AWS[(_0x0b01('0x4'))]({'accessKeyId':_0xf1f20d,'secretAccessKey':_0x45af9a,'region':_0x8589ac});_0x3c65ed[_0x0b01('0x5')]({'TranscriptionJobName':_0x146bf6},function(_0xcdfdfd,_0x15364b){if(_0xcdfdfd){return _0x250f25(_0xcdfdfd);}else{return _0x1eade9(_0x15364b);}});});}function sentiment(_0x4432f1,_0x5256bc,_0x46d839,_0xae6eac,_0x45108e){return new Promise(function(_0x22d309,_0x36bd93){var _0xfcc830=new AWS[(_0x0b01('0x6'))]({'accessKeyId':_0x5256bc,'secretAccessKey':_0x4432f1,'region':_0x46d839});_0xfcc830[_0x0b01('0x7')]({'Text':_0xae6eac,'LanguageCode':_0x45108e[_0x0b01('0x8')](0x0,0x2)},function(_0x1b0c72,_0x5bc932){if(_0x1b0c72){return _0x36bd93(_0x1b0c72);}else{return _0x22d309(_0x5bc932);}});});}function checkTranscribeJob(_0x323f67,_0x462720,_0x8834b5){var _0x1da264;return new BPromise(function(_0x2a0905,_0x112c3a){logger[_0x0b01('0x9')](util['format'](_0x0b01('0xa'),_0x323f67['id'],_0x323f67[_0x0b01('0xb')]));return getTranscriptionJob(_0x8834b5[_0x0b01('0xc')],_0x8834b5[_0x0b01('0xd')],_0x462720[_0x0b01('0xe')],_0x323f67[_0x0b01('0xb')])[_0x0b01('0xf')](function(_0x2348ef){logger[_0x0b01('0x9')](util[_0x0b01('0x10')](_0x0b01('0x11'),_0x323f67['id'],_0x323f67[_0x0b01('0xb')],_0x2348ef['TranscriptionJob'][_0x0b01('0x12')]));if(!_0x323f67[_0x0b01('0x13')]){switch(_0x2348ef[_0x0b01('0x14')]['TranscriptionJobStatus']){case'COMPLETED':var _0x52ee7a={'transcribeStatus':_0x2348ef[_0x0b01('0x14')][_0x0b01('0x12')],'fileUri':_0x2348ef[_0x0b01('0x14')][_0x0b01('0x15')][_0x0b01('0x16')]};logger[_0x0b01('0x9')](util['format'](_0x0b01('0x17'),_0x323f67['id']));return rp({'uri':_0x2348ef[_0x0b01('0x14')][_0x0b01('0x15')][_0x0b01('0x16')],'json':!![]})[_0x0b01('0xf')](function(_0x589324){logger['info'](util[_0x0b01('0x10')](_0x0b01('0x18'),_0x323f67['id']));if(_0x589324&&_0x589324[_0x0b01('0x19')]&&_0x589324[_0x0b01('0x19')]['transcripts']&&_0x589324['results']['transcripts'][_0x0b01('0x1a')]){_0x52ee7a['fileText']='';for(var _0x4af9f6=0x0;_0x4af9f6<_0x589324['results'][_0x0b01('0x1b')][_0x0b01('0x1a')];_0x4af9f6++){_0x52ee7a[_0x0b01('0x13')]+=_0x589324[_0x0b01('0x19')][_0x0b01('0x1b')][_0x4af9f6][_0x0b01('0x1c')]+'';}}return _0x323f67[_0x0b01('0x1d')](_0x52ee7a);})[_0x0b01('0xf')](function(){logger['info'](util[_0x0b01('0x10')](_0x0b01('0x1e'),_0x323f67['id']));if(!_0x323f67[_0x0b01('0x1f')]){throw new db['Sequelize']['ValidationError'](_0x0b01('0x20'));}if(!_0x462720['sentiment']||!_0x462720['sentimentAccountId']||!_0x462720[_0x0b01('0x21')]||!_0x462720[_0x0b01('0x22')]||!_0x462720[_0x0b01('0x23')]){throw new db['Sequelize'][(_0x0b01('0x24'))](_0x0b01('0x25'));}if(!_0x52ee7a[_0x0b01('0x13')]){throw new Error(_0x0b01('0x26'));}if(_0x462720[_0x0b01('0x27')]===_0x8834b5['id']){return _0x8834b5;}else{return db[_0x0b01('0x28')][_0x0b01('0x29')]({'where':{'id':_settings[_0x0b01('0x27')]}});}})['then'](function(_0x3bb0b0){if(!_0x3bb0b0){throw new db[(_0x0b01('0x2a'))][(_0x0b01('0x24'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3bb0b0[_0x0b01('0xc')]||!_0x3bb0b0['data2']){throw new db[(_0x0b01('0x2a'))]['ValidationError'](_0x0b01('0x2b'));}_0x1da264=_0x3bb0b0;logger['info'](util[_0x0b01('0x10')](_0x0b01('0x2c'),_0x323f67['id']));return sentiment(_0x1da264[_0x0b01('0xc')],_0x1da264['data2'],_0x462720[_0x0b01('0x21')],_0x52ee7a['fileText'],_0x462720[_0x0b01('0x22')]);})[_0x0b01('0xf')](function(_0x584c59){logger[_0x0b01('0x9')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x323f67['id']));return _0x323f67['update']({'sentiment':_0x584c59[_0x0b01('0x2d')],'sPositive':_0x584c59['SentimentScore'][_0x0b01('0x2e')],'sNegative':_0x584c59['SentimentScore'][_0x0b01('0x2f')],'sMixed':_0x584c59[_0x0b01('0x30')][_0x0b01('0x31')],'sNeutral':_0x584c59[_0x0b01('0x30')][_0x0b01('0x32')]});})['then'](function(){logger['info'](util[_0x0b01('0x10')](_0x0b01('0x1e'),_0x323f67['id']));_0x2a0905();});case _0x0b01('0x33'):return _0x323f67['update']({'transcribeStatus':'FAILED','failureReason':_0x2348ef[_0x0b01('0x14')]['FailureReason']})[_0x0b01('0xf')](function(){logger[_0x0b01('0x9')](util[_0x0b01('0x10')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x323f67['id']));_0x2a0905();});default:logger[_0x0b01('0x9')](util[_0x0b01('0x10')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x323f67['id']));break;}}else{return BPromise[_0x0b01('0x34')]()[_0x0b01('0xf')](function(){if(!_0x323f67[_0x0b01('0x1f')]){throw new db[(_0x0b01('0x2a'))][(_0x0b01('0x24'))](_0x0b01('0x20'));}if(!_0x462720[_0x0b01('0x35')]||!_0x462720[_0x0b01('0x27')]||!_0x462720['sentimentRegion']||!_0x462720[_0x0b01('0x22')]||!_0x462720[_0x0b01('0x23')]){throw new db[(_0x0b01('0x2a'))][(_0x0b01('0x24'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x323f67[_0x0b01('0x13')]){throw new Error(_0x0b01('0x26'));}if(_0x462720[_0x0b01('0x27')]===_0x8834b5['id']){return _0x8834b5;}else{return db[_0x0b01('0x28')][_0x0b01('0x29')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x4e372d){if(!_0x4e372d){throw new db[(_0x0b01('0x2a'))][(_0x0b01('0x24'))](_0x0b01('0x36'));}if(!_0x4e372d[_0x0b01('0xc')]||!_0x4e372d[_0x0b01('0xd')]){throw new db[(_0x0b01('0x2a'))][(_0x0b01('0x24'))](_0x0b01('0x2b'));}_0x1da264=_0x4e372d;logger[_0x0b01('0x9')](util[_0x0b01('0x10')](_0x0b01('0x2c'),_0x323f67['id']));return sentiment(_0x1da264[_0x0b01('0xc')],_0x1da264[_0x0b01('0xd')],_0x462720[_0x0b01('0x21')],_0x323f67['fileText'],_0x462720[_0x0b01('0x22')]);})[_0x0b01('0xf')](function(_0x552e2d){logger[_0x0b01('0x9')](util[_0x0b01('0x10')](_0x0b01('0x37'),_0x323f67['id']));return _0x323f67['update']({'sentiment':_0x552e2d[_0x0b01('0x2d')],'sPositive':_0x552e2d[_0x0b01('0x30')][_0x0b01('0x2e')],'sNegative':_0x552e2d['SentimentScore'][_0x0b01('0x2f')],'sMixed':_0x552e2d[_0x0b01('0x30')]['Mixed'],'sNeutral':_0x552e2d['SentimentScore'][_0x0b01('0x32')],'transcribeStatus':_0x0b01('0x38')});})[_0x0b01('0xf')](function(){logger['info'](util[_0x0b01('0x10')](_0x0b01('0x1e'),_0x323f67['id']));_0x2a0905();});}})[_0x0b01('0x39')](function(_0x1fc9e8){if(_0x1fc9e8){if(!_0x1fc9e8[_0x0b01('0x3a')]||_0x1fc9e8['name']!==_0x0b01('0x3b')){logger['error'](util[_0x0b01('0x10')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x323f67['id']),util['inspect'](_0x1fc9e8,{'showHidden':![],'depth':null}));}}_0x2a0905();});});}function checkTranscribe(){var _0x5e96fb;var _0x25b770;var _0x5b1b17;return db[_0x0b01('0x3c')][_0x0b01('0x3d')]({'where':{'transcribeStatus':_0x0b01('0x3e')}})[_0x0b01('0xf')](function(_0x2f8a9a){if(!_0x2f8a9a||!_0x2f8a9a['length']){throw new db[(_0x0b01('0x2a'))]['ValidationError'](_0x0b01('0x3f'));}_0x5e96fb=_0x2f8a9a;return db[_0x0b01('0x40')]['findOne']({'where':{'id':0x1}});})['then'](function(_0x85b840){if(!_0x85b840){throw new db['Sequelize'][(_0x0b01('0x24'))](_0x0b01('0x41'));}_0x25b770=_0x85b840;if(!_0x25b770[_0x0b01('0x3')]||!_0x25b770[_0x0b01('0x42')]||!_0x25b770[_0x0b01('0xe')]||!_0x25b770[_0x0b01('0x22')]||!_0x25b770[_0x0b01('0x23')]){throw new db[(_0x0b01('0x2a'))][(_0x0b01('0x24'))](_0x0b01('0x43'));}return db[_0x0b01('0x28')]['findOne']({'where':{'id':_0x25b770[_0x0b01('0x42')]}});})[_0x0b01('0xf')](function(_0x3b743a){if(!_0x3b743a){throw new db['Sequelize'][(_0x0b01('0x24'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3b743a[_0x0b01('0xc')]||!_0x3b743a[_0x0b01('0xd')]){throw new db[(_0x0b01('0x2a'))]['ValidationError'](_0x0b01('0x2b'));}_0x5b1b17=_0x3b743a;var _0x457564=[];_0x5e96fb[_0x0b01('0x44')](function(_0x5e8062){_0x457564[_0x0b01('0x45')](checkTranscribeJob(_0x5e8062,_0x25b770,_0x5b1b17));});return BPromise[_0x0b01('0x46')](_0x457564);})['catch'](function(_0x113cff){if(_0x113cff){if(!_0x113cff[_0x0b01('0x3a')]||_0x113cff[_0x0b01('0x3a')]!=='SequelizeValidationError'){logger[_0x0b01('0x47')](util[_0x0b01('0x48')](_0x113cff,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x7462=['substring','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','info','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','ValidationError','Sentiment\x20Analysis\x20not\x20configured','sentimentAccountId','CloudProvider','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','Positive','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','findOne','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','error','start','lodash','aws-sdk','bluebird','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment'];(function(_0x16fece,_0x316e78){var _0x321e11=function(_0x47b950){while(--_0x47b950){_0x16fece['push'](_0x16fece['shift']());}};_0x321e11(++_0x316e78);}(_0x7462,0x165));var _0x2746=function(_0x58eec7,_0x2353db){_0x58eec7=_0x58eec7-0x0;var _0x25c5d3=_0x7462[_0x58eec7];return _0x25c5d3;};var _=require(_0x2746('0x0'));var AWS=require(_0x2746('0x1'));var rp=require('request-promise');var util=require('util');var BPromise=require(_0x2746('0x2'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x2746('0x3'));function getTranscriptionJob(_0x2274b7,_0x57c788,_0x2afbbd,_0x2b4606){return new Promise(function(_0x1c3371,_0x280dfb){var _0x2a2f42=new AWS[(_0x2746('0x4'))]({'accessKeyId':_0x57c788,'secretAccessKey':_0x2274b7,'region':_0x2afbbd});_0x2a2f42[_0x2746('0x5')]({'TranscriptionJobName':_0x2b4606},function(_0x40ad2b,_0x283327){if(_0x40ad2b){return _0x280dfb(_0x40ad2b);}else{return _0x1c3371(_0x283327);}});});}function sentiment(_0x4ea43e,_0x2b908c,_0x2e4713,_0x4f9eb7,_0x19bec3){return new Promise(function(_0x1a6329,_0x2ea416){var _0x5aef7e=new AWS[(_0x2746('0x6'))]({'accessKeyId':_0x2b908c,'secretAccessKey':_0x4ea43e,'region':_0x2e4713});_0x5aef7e[_0x2746('0x7')]({'Text':_0x4f9eb7,'LanguageCode':_0x19bec3[_0x2746('0x8')](0x0,0x2)},function(_0x1a4c15,_0x221332){if(_0x1a4c15){return _0x2ea416(_0x1a4c15);}else{return _0x1a6329(_0x221332);}});});}function checkTranscribeJob(_0x1fbbc7,_0x51ddae,_0x126a1f){var _0x10c17d;return new BPromise(function(_0x3bfbe1,_0x1e7de7){logger['info'](util['format'](_0x2746('0x9'),_0x1fbbc7['id'],_0x1fbbc7[_0x2746('0xa')]));return getTranscriptionJob(_0x126a1f[_0x2746('0xb')],_0x126a1f[_0x2746('0xc')],_0x51ddae['transcribeRegion'],_0x1fbbc7[_0x2746('0xa')])[_0x2746('0xd')](function(_0x57edcd){logger['info'](util[_0x2746('0xe')](_0x2746('0xf'),_0x1fbbc7['id'],_0x1fbbc7[_0x2746('0xa')],_0x57edcd[_0x2746('0x10')][_0x2746('0x11')]));if(!_0x1fbbc7[_0x2746('0x12')]){switch(_0x57edcd[_0x2746('0x10')][_0x2746('0x11')]){case _0x2746('0x13'):var _0x509879={'transcribeStatus':_0x57edcd[_0x2746('0x10')]['TranscriptionJobStatus'],'fileUri':_0x57edcd[_0x2746('0x10')][_0x2746('0x14')][_0x2746('0x15')]};logger[_0x2746('0x16')](util[_0x2746('0xe')](_0x2746('0x17'),_0x1fbbc7['id']));return rp({'uri':_0x57edcd[_0x2746('0x10')][_0x2746('0x14')][_0x2746('0x15')],'json':!![]})['then'](function(_0x4acb70){logger[_0x2746('0x16')](util[_0x2746('0xe')](_0x2746('0x18'),_0x1fbbc7['id']));if(_0x4acb70&&_0x4acb70['results']&&_0x4acb70[_0x2746('0x19')][_0x2746('0x1a')]&&_0x4acb70['results'][_0x2746('0x1a')]['length']){_0x509879['fileText']='';for(var _0x5bc3c8=0x0;_0x5bc3c8<_0x4acb70['results'][_0x2746('0x1a')][_0x2746('0x1b')];_0x5bc3c8++){_0x509879['fileText']+=_0x4acb70[_0x2746('0x19')]['transcripts'][_0x5bc3c8][_0x2746('0x1c')]+'';}}return _0x1fbbc7[_0x2746('0x1d')](_0x509879);})[_0x2746('0xd')](function(){logger[_0x2746('0x16')](util[_0x2746('0xe')](_0x2746('0x1e'),_0x1fbbc7['id']));if(!_0x1fbbc7[_0x2746('0x1f')]){throw new db[(_0x2746('0x20'))]['ValidationError'](_0x2746('0x21'));}if(!_0x51ddae[_0x2746('0x22')]||!_0x51ddae['sentimentAccountId']||!_0x51ddae['sentimentRegion']||!_0x51ddae['language']||!_0x51ddae['bucket']){throw new db['Sequelize'][(_0x2746('0x23'))](_0x2746('0x24'));}if(!_0x509879['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x51ddae[_0x2746('0x25')]===_0x126a1f['id']){return _0x126a1f;}else{return db[_0x2746('0x26')]['findOne']({'where':{'id':_settings[_0x2746('0x25')]}});}})[_0x2746('0xd')](function(_0x537912){if(!_0x537912){throw new db[(_0x2746('0x20'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x537912[_0x2746('0xb')]||!_0x537912[_0x2746('0xc')]){throw new db[(_0x2746('0x20'))][(_0x2746('0x23'))]('Cloud\x20Provider\x20not\x20configured');}_0x10c17d=_0x537912;logger[_0x2746('0x16')](util[_0x2746('0xe')](_0x2746('0x27'),_0x1fbbc7['id']));return sentiment(_0x10c17d[_0x2746('0xb')],_0x10c17d[_0x2746('0xc')],_0x51ddae[_0x2746('0x28')],_0x509879[_0x2746('0x12')],_0x51ddae[_0x2746('0x29')]);})['then'](function(_0x34925b){logger[_0x2746('0x16')](util[_0x2746('0xe')](_0x2746('0x2a'),_0x1fbbc7['id']));return _0x1fbbc7[_0x2746('0x1d')]({'sentiment':_0x34925b[_0x2746('0x2b')],'sPositive':_0x34925b['SentimentScore']['Positive'],'sNegative':_0x34925b[_0x2746('0x2c')][_0x2746('0x2d')],'sMixed':_0x34925b[_0x2746('0x2c')][_0x2746('0x2e')],'sNeutral':_0x34925b[_0x2746('0x2c')]['Neutral']});})[_0x2746('0xd')](function(){logger[_0x2746('0x16')](util[_0x2746('0xe')](_0x2746('0x1e'),_0x1fbbc7['id']));_0x3bfbe1();});case _0x2746('0x2f'):return _0x1fbbc7[_0x2746('0x1d')]({'transcribeStatus':_0x2746('0x2f'),'failureReason':_0x57edcd[_0x2746('0x10')][_0x2746('0x30')]})[_0x2746('0xd')](function(){logger[_0x2746('0x16')](util[_0x2746('0xe')](_0x2746('0x1e'),_0x1fbbc7['id']));_0x3bfbe1();});default:logger['info'](util[_0x2746('0xe')](_0x2746('0x31'),_0x1fbbc7['id']));break;}}else{return BPromise[_0x2746('0x32')]()[_0x2746('0xd')](function(){if(!_0x1fbbc7[_0x2746('0x1f')]){throw new db[(_0x2746('0x20'))][(_0x2746('0x23'))](_0x2746('0x21'));}if(!_0x51ddae[_0x2746('0x22')]||!_0x51ddae['sentimentAccountId']||!_0x51ddae[_0x2746('0x28')]||!_0x51ddae[_0x2746('0x29')]||!_0x51ddae[_0x2746('0x33')]){throw new db[(_0x2746('0x20'))]['ValidationError'](_0x2746('0x24'));}if(!_0x1fbbc7[_0x2746('0x12')]){throw new Error('Transcript\x20not\x20available');}if(_0x51ddae[_0x2746('0x25')]===_0x126a1f['id']){return _0x126a1f;}else{return db[_0x2746('0x26')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0x2746('0xd')](function(_0x599257){if(!_0x599257){throw new db['Sequelize'][(_0x2746('0x23'))](_0x2746('0x34'));}if(!_0x599257[_0x2746('0xb')]||!_0x599257[_0x2746('0xc')]){throw new db[(_0x2746('0x20'))][(_0x2746('0x23'))](_0x2746('0x35'));}_0x10c17d=_0x599257;logger[_0x2746('0x16')](util[_0x2746('0xe')](_0x2746('0x27'),_0x1fbbc7['id']));return sentiment(_0x10c17d[_0x2746('0xb')],_0x10c17d[_0x2746('0xc')],_0x51ddae['sentimentRegion'],_0x1fbbc7[_0x2746('0x12')],_0x51ddae['language']);})[_0x2746('0xd')](function(_0x5a8162){logger[_0x2746('0x16')](util['format'](_0x2746('0x2a'),_0x1fbbc7['id']));return _0x1fbbc7[_0x2746('0x1d')]({'sentiment':_0x5a8162[_0x2746('0x2b')],'sPositive':_0x5a8162[_0x2746('0x2c')][_0x2746('0x36')],'sNegative':_0x5a8162[_0x2746('0x2c')][_0x2746('0x2d')],'sMixed':_0x5a8162[_0x2746('0x2c')][_0x2746('0x2e')],'sNeutral':_0x5a8162[_0x2746('0x2c')]['Neutral'],'transcribeStatus':_0x2746('0x13')});})['then'](function(){logger['info'](util[_0x2746('0xe')](_0x2746('0x1e'),_0x1fbbc7['id']));_0x3bfbe1();});}})[_0x2746('0x37')](function(_0x1c516a){if(_0x1c516a){if(!_0x1c516a[_0x2746('0x38')]||_0x1c516a[_0x2746('0x38')]!==_0x2746('0x39')){logger['error'](util[_0x2746('0xe')](_0x2746('0x3a'),_0x1fbbc7['id']),util[_0x2746('0x3b')](_0x1c516a,{'showHidden':![],'depth':null}));}}_0x3bfbe1();});});}function checkTranscribe(){var _0x23948e;var _0xcb2ad4;var _0x57191d;return db[_0x2746('0x3c')]['findAll']({'where':{'transcribeStatus':_0x2746('0x3d')}})[_0x2746('0xd')](function(_0x17da51){if(!_0x17da51||!_0x17da51[_0x2746('0x1b')]){throw new db[(_0x2746('0x20'))][(_0x2746('0x23'))](_0x2746('0x3e'));}_0x23948e=_0x17da51;return db[_0x2746('0x3f')][_0x2746('0x40')]({'where':{'id':0x1}});})['then'](function(_0x5cdd91){if(!_0x5cdd91){throw new db[(_0x2746('0x20'))][(_0x2746('0x23'))](_0x2746('0x41'));}_0xcb2ad4=_0x5cdd91;if(!_0xcb2ad4['transcribe']||!_0xcb2ad4[_0x2746('0x42')]||!_0xcb2ad4['transcribeRegion']||!_0xcb2ad4['language']||!_0xcb2ad4[_0x2746('0x33')]){throw new db[(_0x2746('0x20'))]['ValidationError'](_0x2746('0x43'));}return db['CloudProvider'][_0x2746('0x40')]({'where':{'id':_0xcb2ad4['transcribeAccountId']}});})[_0x2746('0xd')](function(_0x5f20fd){if(!_0x5f20fd){throw new db[(_0x2746('0x20'))][(_0x2746('0x23'))](_0x2746('0x34'));}if(!_0x5f20fd[_0x2746('0xb')]||!_0x5f20fd[_0x2746('0xc')]){throw new db[(_0x2746('0x20'))]['ValidationError'](_0x2746('0x35'));}_0x57191d=_0x5f20fd;var _0x1c2cc8=[];_0x23948e[_0x2746('0x44')](function(_0x319d88){_0x1c2cc8[_0x2746('0x45')](checkTranscribeJob(_0x319d88,_0xcb2ad4,_0x57191d));});return BPromise[_0x2746('0x46')](_0x1c2cc8);})[_0x2746('0x37')](function(_0x495b9e){if(_0x495b9e){if(!_0x495b9e[_0x2746('0x38')]||_0x495b9e[_0x2746('0x38')]!==_0x2746('0x39')){logger[_0x2746('0x47')](util[_0x2746('0x3b')](_0x495b9e,{'showHidden':![],'depth':null}));}}});}exports[_0x2746('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 914e396..c9fe1ef 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 _0xa8ce=['../../mysqldb','../logger','schedule','redis','socket.io-emitter','WhatsappInteraction','findAll','subtract','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','YYYY-MM-DD\x20HH:mm:ss','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','inspect','start','moment','ioredis','util','../../config/environment'];(function(_0x269b76,_0x373053){var _0x319cf9=function(_0x3c8673){while(--_0x3c8673){_0x269b76['push'](_0x269b76['shift']());}};_0x319cf9(++_0x373053);}(_0xa8ce,0x1d8));var _0xea8c=function(_0x4933fd,_0x162eb9){_0x4933fd=_0x4933fd-0x0;var _0x25087f=_0xa8ce[_0x4933fd];return _0x25087f;};'use strict';var _=require('lodash');var moment=require(_0xea8c('0x0'));var Redis=require(_0xea8c('0x1'));var util=require(_0xea8c('0x2'));var config=require(_0xea8c('0x3'));var db=require(_0xea8c('0x4'))['db'];var logger=require(_0xea8c('0x5'))(_0xea8c('0x6'));config[_0xea8c('0x7')]=_['defaults'](config[_0xea8c('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xea8c('0x8'))(new Redis(config[_0xea8c('0x7')]));function closeInteractions(){var _0x4b0d04=[];return db[_0xea8c('0x9')][_0xea8c('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xea8c('0xb')](0x18,_0xea8c('0xc'))}}})[_0xea8c('0xd')](function(_0x244823){if(_0x244823&&_0x244823['length']){_0x4b0d04=_[_0xea8c('0xe')](_0x244823||[],'id');logger[_0xea8c('0xf')](_0xea8c('0x10'),_0x4b0d04[_0xea8c('0x11')]());return db[_0xea8c('0x9')][_0xea8c('0x12')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0xea8c('0x13'))},{'where':{'id':_0x4b0d04}});}})[_0xea8c('0xd')](function(){if(_0x4b0d04&&_0x4b0d04[_0xea8c('0x14')]){logger['info'](_0xea8c('0x15'),_0x4b0d04[_0xea8c('0x11')]());for(var _0x261d89=0x0;_0x261d89<_0x4b0d04[_0xea8c('0x14')];_0x261d89++){io[_0xea8c('0x16')](_0xea8c('0x17'),{'id':_0x4b0d04[_0x261d89],'closed':!![]});}}})[_0xea8c('0x18')](function(_0x1ecdbd){logger[_0xea8c('0x19')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x1ecdbd?util[_0xea8c('0x1a')](_0x1ecdbd,{'showHidden':![],'depth':null}):'');});}exports[_0xea8c('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x8f73=['schedule','redis','defaults','WhatsappInteraction','findAll','lastMsgAt','hours','then','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','../../mysqldb','../logger'];(function(_0x5b8423,_0x4c3ec7){var _0x1131c3=function(_0x12462b){while(--_0x12462b){_0x5b8423['push'](_0x5b8423['shift']());}};_0x1131c3(++_0x4c3ec7);}(_0x8f73,0xe6));var _0x38f7=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x8f73[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0x38f7('0x0'));var moment=require(_0x38f7('0x1'));var Redis=require('ioredis');var util=require('util');var config=require('../../config/environment');var db=require(_0x38f7('0x2'))['db'];var logger=require(_0x38f7('0x3'))(_0x38f7('0x4'));config[_0x38f7('0x5')]=_[_0x38f7('0x6')](config[_0x38f7('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x38f7('0x5')]));function closeInteractions(){var _0x54aa70=[];return db[_0x38f7('0x7')][_0x38f7('0x8')]({'raw':!![],'attributes':['id',_0x38f7('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x38f7('0xa'))}}})[_0x38f7('0xb')](function(_0x1493c9){if(_0x1493c9&&_0x1493c9[_0x38f7('0xc')]){_0x54aa70=_[_0x38f7('0xd')](_0x1493c9||[],'id');logger['info'](_0x38f7('0xe'),_0x54aa70[_0x38f7('0xf')]());return db['WhatsappInteraction']['update']({'closeReason':_0x38f7('0x10'),'disposition':_0x38f7('0x11'),'closed':!![],'closedAt':moment()[_0x38f7('0x12')](_0x38f7('0x13'))},{'where':{'id':_0x54aa70}});}})[_0x38f7('0xb')](function(){if(_0x54aa70&&_0x54aa70[_0x38f7('0xc')]){logger[_0x38f7('0x14')](_0x38f7('0x15'),_0x54aa70[_0x38f7('0xf')]());for(var _0x19e159=0x0;_0x19e159<_0x54aa70[_0x38f7('0xc')];_0x19e159++){io['emit']('whatsappInteraction:update',{'id':_0x54aa70[_0x19e159],'closed':!![]});}}})[_0x38f7('0x16')](function(_0x335a04){logger[_0x38f7('0x17')](_0x38f7('0x18'),_0x335a04?util[_0x38f7('0x19')](_0x335a04,{'showHidden':![],'depth':null}):'');});}exports['start']=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 dac4b9a..ff881c8 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9dc1=['bulkCreate','finished\x20populating','contacts1','CmHopper','hopper1','log','contacts2','hopper2','catch','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','CmContact','destroy','then'];(function(_0x21e23d,_0x749755){var _0x423baa=function(_0x175290){while(--_0x175290){_0x21e23d['push'](_0x21e23d['shift']());}};_0x423baa(++_0x749755);}(_0x9dc1,0xc7));var _0x19dc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9dc1[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var db=require(_0x19dc('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x19dc('0x1')]({'id':i,'firstName':_0x19dc('0x2')+i,'lastName':_0x19dc('0x3')+i,'phone':0xf879fb460+i,'email':_0x19dc('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x19dc('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x19dc('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x19dc('0x5')](),'updatedAt':Date[_0x19dc('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x19dc('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x19dc('0x4')+i+_0x19dc('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x19dc('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[_0x19dc('0x5')]()});}db[_0x19dc('0x7')][_0x19dc('0x8')]({'where':{}})[_0x19dc('0x9')](function(){return db[_0x19dc('0x7')][_0x19dc('0xa')](contacts);})[_0x19dc('0x9')](function(){console['log'](_0x19dc('0xb'),_0x19dc('0xc'));return db[_0x19dc('0xd')][_0x19dc('0x8')]({'where':{}});})[_0x19dc('0x9')](function(){return db[_0x19dc('0xd')]['bulkCreate'](hopper);})['then'](function(){console['log'](_0x19dc('0xb'),_0x19dc('0xe'));return db[_0x19dc('0x7')][_0x19dc('0xa')](contacts2);})[_0x19dc('0x9')](function(){console[_0x19dc('0xf')]('finished\x20populating',_0x19dc('0x10'));return db[_0x19dc('0xd')][_0x19dc('0xa')](hopper2);})[_0x19dc('0x9')](function(){console['log'](_0x19dc('0xb'),_0x19dc('0x11'));})[_0x19dc('0x12')](function(_0x5e19e2){console[_0x19dc('0xf')](_0x5e19e2);}); \ No newline at end of file +var _0xcc77=['then','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','catch','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','bulkCreate'];(function(_0x172033,_0x1cd43a){var _0x5bf5fa=function(_0x2c9a36){while(--_0x2c9a36){_0x172033['push'](_0x172033['shift']());}};_0x5bf5fa(++_0x1cd43a);}(_0xcc77,0x198));var _0x7cc7=function(_0x5f218a,_0x278674){_0x5f218a=_0x5f218a-0x0;var _0x5056f2=_0xcc77[_0x5f218a];return _0x5056f2;};'use strict';var util=require('util');var db=require(_0x7cc7('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x7cc7('0x1')]({'id':i,'firstName':_0x7cc7('0x2')+i,'lastName':_0x7cc7('0x3')+i,'phone':0xf879fb460+i,'email':_0x7cc7('0x4')+i+_0x7cc7('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x7cc7('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x7cc7('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7cc7('0x6')](),'updatedAt':Date[_0x7cc7('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x7cc7('0x1')]({'id':i,'firstName':_0x7cc7('0x2')+i,'lastName':_0x7cc7('0x3')+i,'phone':0xf879fb460+i,'email':_0x7cc7('0x4')+i+_0x7cc7('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x7cc7('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7cc7('0x6')](),'updatedAt':Date[_0x7cc7('0x6')]()});}db[_0x7cc7('0x7')][_0x7cc7('0x8')]({'where':{}})['then'](function(){return db[_0x7cc7('0x7')][_0x7cc7('0x9')](contacts);})[_0x7cc7('0xa')](function(){console[_0x7cc7('0xb')](_0x7cc7('0xc'),_0x7cc7('0xd'));return db['CmHopper'][_0x7cc7('0x8')]({'where':{}});})[_0x7cc7('0xa')](function(){return db[_0x7cc7('0xe')][_0x7cc7('0x9')](hopper);})[_0x7cc7('0xa')](function(){console['log'](_0x7cc7('0xc'),_0x7cc7('0xf'));return db[_0x7cc7('0x7')][_0x7cc7('0x9')](contacts2);})[_0x7cc7('0xa')](function(){console[_0x7cc7('0xb')](_0x7cc7('0xc'),_0x7cc7('0x10'));return db['CmHopper'][_0x7cc7('0x9')](hopper2);})[_0x7cc7('0xa')](function(){console['log']('finished\x20populating',_0x7cc7('0x11'));})[_0x7cc7('0x12')](function(_0x30a3e4){console[_0x7cc7('0xb')](_0x30a3e4);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 748a389..0970b98 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc78=['wss','all','ulaw','yes','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','%s%s','agent','format','%s%s@xcally.com','password','friend','udp'];(function(_0x25e225,_0x4253fb){var _0x5ce20d=function(_0x4ada0d){while(--_0x4ada0d){_0x25e225['push'](_0x25e225['shift']());}};_0x5ce20d(++_0x4253fb);}(_0xdc78,0x16c));var _0x8dc7=function(_0x31db70,_0x62d245){_0x31db70=_0x31db70-0x0;var _0x5623a4=_0xdc78[_0x31db70];return _0x5623a4;};'use strict';var util=require(_0x8dc7('0x0'));var db=require(_0x8dc7('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x8dc7('0x2')]({'name':util['format'](_0x8dc7('0x3'),_0x8dc7('0x4'),i),'fullname':util['format'](_0x8dc7('0x3'),_0x8dc7('0x4'),i),'email':util[_0x8dc7('0x5')](_0x8dc7('0x6'),_0x8dc7('0x4'),i),'role':'agent','password':_0x8dc7('0x7'),'internal':0xfa0+i,'type':_0x8dc7('0x8'),'transport':[_0x8dc7('0x9'),'ws',_0x8dc7('0xa')],'disallow':[_0x8dc7('0xb')],'allow':[_0x8dc7('0xc')],'defaultuser':util[_0x8dc7('0x5')](_0x8dc7('0x3'),_0x8dc7('0x4'),i),'encryption':_0x8dc7('0xd'),'avpf':_0x8dc7('0xd'),'force_avp':_0x8dc7('0xd'),'icesupport':_0x8dc7('0xd'),'dtlsenable':_0x8dc7('0xd'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x8dc7('0xe'),'dtlssetup':'actpass','callerid':util['format'](_0x8dc7('0xf'),util[_0x8dc7('0x5')](_0x8dc7('0x3'),_0x8dc7('0x4'),i),0xfa0+i)});}db[_0x8dc7('0x10')][_0x8dc7('0x11')](users)[_0x8dc7('0x12')](function(){console[_0x8dc7('0x13')](_0x8dc7('0x14'));})[_0x8dc7('0x15')](function(_0xca33bf){console['log'](_0xca33bf);}); \ No newline at end of file +var _0x0ce3=['log','add\x20user','../mysqldb','format','agent','%s%s','%s%s@xcally.com','password','friend','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then'];(function(_0x27d13b,_0x1224fa){var _0x4e126a=function(_0xdbddeb){while(--_0xdbddeb){_0x27d13b['push'](_0x27d13b['shift']());}};_0x4e126a(++_0x1224fa);}(_0x0ce3,0x122));var _0x30ce=function(_0x155488,_0x5dd87b){_0x155488=_0x155488-0x0;var _0xbe08ab=_0x0ce3[_0x155488];return _0xbe08ab;};'use strict';var util=require('util');var db=require(_0x30ce('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x30ce('0x1')]('%s%s',_0x30ce('0x2'),i),'fullname':util[_0x30ce('0x1')](_0x30ce('0x3'),'agent',i),'email':util[_0x30ce('0x1')](_0x30ce('0x4'),'agent',i),'role':'agent','password':_0x30ce('0x5'),'internal':0xfa0+i,'type':_0x30ce('0x6'),'transport':['udp','ws','wss'],'disallow':['all'],'allow':[_0x30ce('0x7')],'defaultuser':util[_0x30ce('0x1')]('%s%s',_0x30ce('0x2'),i),'encryption':_0x30ce('0x8'),'avpf':_0x30ce('0x8'),'force_avp':_0x30ce('0x8'),'icesupport':_0x30ce('0x8'),'dtlsenable':_0x30ce('0x8'),'dtlsverify':'no','dtlscertfile':_0x30ce('0x9'),'dtlsprivatekey':_0x30ce('0xa'),'dtlssetup':_0x30ce('0xb'),'callerid':util[_0x30ce('0x1')](_0x30ce('0xc'),util[_0x30ce('0x1')](_0x30ce('0x3'),_0x30ce('0x2'),i),0xfa0+i)});}db[_0x30ce('0xd')][_0x30ce('0xe')](users)[_0x30ce('0xf')](function(){console[_0x30ce('0x10')](_0x30ce('0x11'));})['catch'](function(_0x33a2c9){console[_0x30ce('0x10')](_0x33a2c9);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 920d9e9..6bb80d9 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8b5c=['SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','ChatQueue','WhatsappQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length','voice','chat','fax','telephone:%s','trunk:%s','campaign:%s:%s','leave','map','removeChatInteractions','user_has_chat_interactions:remove','MailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','emit','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','log','join','default','setMaxListeners','address','request','connection','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','util','../mysqldb','./environment','Agents','User','role','name','telephone','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','Campaign','%s:queue:%s','format','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','FaxInteraction','FaxInteractions'];(function(_0x3a723e,_0x59d99a){var _0x3e9c03=function(_0x4a6947){while(--_0x4a6947){_0x3a723e['push'](_0x3a723e['shift']());}};_0x3e9c03(++_0x59d99a);}(_0x8b5c,0x10d));var _0xc8b5=function(_0x1d924c,_0x2c428d){_0x1d924c=_0x1d924c-0x0;var _0x5f49b7=_0x8b5c[_0x1d924c];return _0x5f49b7;};'use strict';var _=require('lodash');var util=require(_0xc8b5('0x0'));var BPromise=require('bluebird');var db=require(_0xc8b5('0x1'))['db'];var config=require(_0xc8b5('0x2'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0xc8b5('0x3'),'model':db[_0xc8b5('0x4')],'attributes':['id','name',_0xc8b5('0x5')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xc8b5('0x6')],'where':{'role':_0xc8b5('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0xc8b5('0x6')]};var queryAgents={'raw':!![],'attributes':['id',_0xc8b5('0x6')],'where':{'role':_0xc8b5('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xc8b5('0x6'),_0xc8b5('0x9')],'where':{'type':_0xc8b5('0xa')}};function getAssociatedResources(_0x5dd564,_0x2ad6fa,_0x1e73d6){return db[_0xc8b5('0xb')][_0xc8b5('0xc')]({'where':{'name':_0x5dd564,'userProfileId':_0x2ad6fa},'raw':!![]})[_0xc8b5('0xd')](function(_0x30948b){if(_0x30948b){if(_0x30948b[_0xc8b5('0xe')]){switch(_0x5dd564){case _0xc8b5('0xf'):case _0xc8b5('0x10'):case _0xc8b5('0x11'):case _0xc8b5('0x12'):case _0xc8b5('0x13'):case _0xc8b5('0x14'):case _0xc8b5('0x15'):return db[_0x1e73d6][_0xc8b5('0x16')](queryQueues);case _0xc8b5('0x17'):return db[_0x1e73d6][_0xc8b5('0x16')](queryTelephones);case _0xc8b5('0x18'):return db[_0x1e73d6][_0xc8b5('0x16')](queryTrunks);case _0xc8b5('0x19'):return db[_0x1e73d6][_0xc8b5('0x16')](queryCampaigns);}}else{return db[_0xc8b5('0x1a')][_0xc8b5('0x16')]({'attributes':[_0xc8b5('0x1b')],'where':{'sectionId':_0x30948b['id']},'raw':!![]})['then'](function(_0x593bc1){if(_0x593bc1){var _0x5c9bc7={'where':{'id':_['map'](_0x593bc1,_0xc8b5('0x1b'))},'raw':!![]};switch(_0x1e73d6){case'User':_0x5c9bc7['where'][_0xc8b5('0x5')]='telephone';break;case _0xc8b5('0x1c'):_0x5c9bc7['where'][_0xc8b5('0x9')]=_0xc8b5('0xa');break;}return db[_0x1e73d6][_0xc8b5('0x16')](_0x5c9bc7);}else{return[];}});}}else{return[];}})[_0xc8b5('0xd')](function(_0x1f3958){return _0x1f3958;});}function joinOrLeaveQueues(_0x222fc6,_0x47205d,_0x3f918f,_0x4241ba){_0x222fc6[_0x47205d](util['format'](_0xc8b5('0x1d'),_0x3f918f,_0x4241ba[_0xc8b5('0x6')]));if(_0x4241ba[_0xc8b5('0x3')]){for(var _0x46c586=0x0;_0x46c586<_0x4241ba['Agents']['length'];_0x46c586+=0x1){_0x222fc6[_0x47205d](util[_0xc8b5('0x1e')](_0xc8b5('0x1f'),_0x4241ba[_0xc8b5('0x3')][_0x46c586][_0xc8b5('0x6')]));}}}function joinOrLeave(_0x413e31,_0x15d9d4,_0x175525){var _0x469857;if(_0x413e31[_0xc8b5('0x20')][_0xc8b5('0x21')]['id']){db['User'][_0xc8b5('0x22')]({'attributes':['id',_0xc8b5('0x6'),'role',_0xc8b5('0x23')],'where':{'id':_0x413e31['handshake'][_0xc8b5('0x21')]['id']},'include':[{'model':db[_0xc8b5('0x24')],'as':_0xc8b5('0x25'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xc8b5('0x26')],'as':_0xc8b5('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xc8b5('0x28')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xc8b5('0x29')],'as':_0xc8b5('0x2a'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xc8b5('0x2b'),'attributes':['id'],'raw':!![]}]})[_0xc8b5('0xd')](function(_0x57f64a){if(_0x57f64a){_0x469857=_0x57f64a;_0x413e31[_0x15d9d4](util[_0xc8b5('0x1e')](_0xc8b5('0x1f'),_0x57f64a[_0xc8b5('0x6')]));var _0x5a88d0=[];switch(_0x57f64a['role']){case _0xc8b5('0x2c'):_0x413e31[_0x15d9d4](_0xc8b5('0x2d'));_0x413e31[_0x15d9d4](_0xc8b5('0x2e'));if(queryQueues[_0xc8b5('0x2f')](_0xc8b5('0x30'))){delete queryQueues[_0xc8b5('0x30')];}_0x5a88d0['push'](db[_0xc8b5('0x31')][_0xc8b5('0x16')](queryQueues));_0x5a88d0[_0xc8b5('0x32')](db['ChatQueue'][_0xc8b5('0x16')](queryQueues));_0x5a88d0[_0xc8b5('0x32')](db[_0xc8b5('0x33')][_0xc8b5('0x16')](queryQueues));_0x5a88d0['push'](db[_0xc8b5('0x34')][_0xc8b5('0x16')](queryQueues));_0x5a88d0['push'](db[_0xc8b5('0x35')]['findAll'](queryQueues));_0x5a88d0[_0xc8b5('0x32')](db[_0xc8b5('0x36')]['findAll'](queryQueues));_0x5a88d0['push'](db['WhatsappQueue']['findAll'](queryQueues));_0x5a88d0['push'](db[_0xc8b5('0x4')][_0xc8b5('0x16')](queryTelephones));_0x5a88d0[_0xc8b5('0x32')](db[_0xc8b5('0x37')][_0xc8b5('0x16')](queryTrunks));_0x5a88d0[_0xc8b5('0x32')](db[_0xc8b5('0x1c')]['findAll'](queryCampaigns));_0x5a88d0[_0xc8b5('0x32')](db[_0xc8b5('0x4')][_0xc8b5('0x16')](queryAgents));break;case _0xc8b5('0x38'):_0x413e31[_0x15d9d4](_0xc8b5('0x2d'));_0x413e31[_0x15d9d4](_0xc8b5('0x2e'));_0x5a88d0['push'](getAssociatedResources('VoiceQueues',_0x57f64a[_0xc8b5('0x23')],_0xc8b5('0x31')));_0x5a88d0[_0xc8b5('0x32')](getAssociatedResources(_0xc8b5('0x10'),_0x57f64a[_0xc8b5('0x23')],_0xc8b5('0x39')));_0x5a88d0['push'](getAssociatedResources(_0xc8b5('0x11'),_0x57f64a['userProfileId'],_0xc8b5('0x33')));_0x5a88d0[_0xc8b5('0x32')](getAssociatedResources('SmsQueues',_0x57f64a[_0xc8b5('0x23')],_0xc8b5('0x34')));_0x5a88d0[_0xc8b5('0x32')](getAssociatedResources(_0xc8b5('0x13'),_0x57f64a[_0xc8b5('0x23')],_0xc8b5('0x35')));_0x5a88d0['push'](getAssociatedResources(_0xc8b5('0x14'),_0x57f64a['userProfileId'],'OpenchannelQueue'));_0x5a88d0[_0xc8b5('0x32')](getAssociatedResources('WhatsappQueues',_0x57f64a[_0xc8b5('0x23')],_0xc8b5('0x3a')));_0x5a88d0[_0xc8b5('0x32')](getAssociatedResources(_0xc8b5('0x17'),_0x57f64a[_0xc8b5('0x23')],_0xc8b5('0x4')));_0x5a88d0[_0xc8b5('0x32')](getAssociatedResources('Trunks',_0x57f64a[_0xc8b5('0x23')],_0xc8b5('0x37')));_0x5a88d0['push'](getAssociatedResources(_0xc8b5('0x19'),_0x57f64a[_0xc8b5('0x23')],_0xc8b5('0x1c')));_0x5a88d0[_0xc8b5('0x32')](db['User'][_0xc8b5('0x16')](queryAgents));break;case _0xc8b5('0x8'):_0x413e31[_0x15d9d4](_0xc8b5('0x2d'));_0x413e31[_0x15d9d4](_0xc8b5('0x2e'));_0x5a88d0['push'](_0x57f64a[_0xc8b5('0x3b')]({'attributes':['id',_0xc8b5('0x6')]}));_0x5a88d0[_0xc8b5('0x32')](_0x57f64a[_0xc8b5('0x3c')]({'attributes':['id',_0xc8b5('0x6')]}));_0x5a88d0[_0xc8b5('0x32')](_0x57f64a[_0xc8b5('0x3d')]({'attributes':['id',_0xc8b5('0x6')]}));_0x5a88d0[_0xc8b5('0x32')](_0x57f64a[_0xc8b5('0x3e')]({'attributes':['id',_0xc8b5('0x6')]}));_0x5a88d0[_0xc8b5('0x32')](_0x57f64a[_0xc8b5('0x3f')]({'attributes':['id',_0xc8b5('0x6')]}));_0x5a88d0[_0xc8b5('0x32')](_0x57f64a[_0xc8b5('0x40')]({'attributes':['id','name']}));_0x5a88d0[_0xc8b5('0x32')](_0x57f64a[_0xc8b5('0x41')]({'attributes':['id',_0xc8b5('0x6')]}));break;}return BPromise[_0xc8b5('0x42')](_0x5a88d0);}})[_0xc8b5('0xd')](function(_0x3b9388){if(_0x3b9388&&_0x3b9388[_0xc8b5('0x43')]){for(var _0x517bf4=0x0;_0x517bf4<_0x3b9388['length'];_0x517bf4+=0x1){for(var _0x306fcf=0x0;_0x306fcf<_0x3b9388[_0x517bf4]['length'];_0x306fcf+=0x1){switch(_0x517bf4){case 0x0:joinOrLeaveQueues(_0x413e31,_0x15d9d4,_0xc8b5('0x44'),_0x3b9388[_0x517bf4][_0x306fcf]);break;case 0x1:joinOrLeaveQueues(_0x413e31,_0x15d9d4,_0xc8b5('0x45'),_0x3b9388[_0x517bf4][_0x306fcf]);break;case 0x2:joinOrLeaveQueues(_0x413e31,_0x15d9d4,_0xc8b5('0x46'),_0x3b9388[_0x517bf4][_0x306fcf]);break;case 0x3:joinOrLeaveQueues(_0x413e31,_0x15d9d4,'sms',_0x3b9388[_0x517bf4][_0x306fcf]);break;case 0x4:joinOrLeaveQueues(_0x413e31,_0x15d9d4,'mail',_0x3b9388[_0x517bf4][_0x306fcf]);break;case 0x5:joinOrLeaveQueues(_0x413e31,_0x15d9d4,'openchannel',_0x3b9388[_0x517bf4][_0x306fcf]);break;case 0x6:joinOrLeaveQueues(_0x413e31,_0x15d9d4,'whatsapp',_0x3b9388[_0x517bf4][_0x306fcf]);break;case 0x7:if(_0x469857[_0xc8b5('0x5')]!==_0xc8b5('0x8'))_0x413e31[_0x15d9d4](util[_0xc8b5('0x1e')](_0xc8b5('0x47'),_0x3b9388[_0x517bf4][_0x306fcf][_0xc8b5('0x6')]));break;case 0x8:if(_0x469857[_0xc8b5('0x5')]!==_0xc8b5('0x8'))_0x413e31[_0x15d9d4](util[_0xc8b5('0x1e')](_0xc8b5('0x48'),_0x3b9388[_0x517bf4][_0x306fcf][_0xc8b5('0x6')]));break;case 0x9:if(_0x469857[_0xc8b5('0x5')]!==_0xc8b5('0x8'))_0x413e31[_0x15d9d4](util['format'](_0xc8b5('0x49'),_0x3b9388[_0x517bf4][_0x306fcf][_0xc8b5('0x9')],_0x3b9388[_0x517bf4][_0x306fcf][_0xc8b5('0x6')]));break;case 0xa:_0x413e31[_0x15d9d4](util[_0xc8b5('0x1e')](_0xc8b5('0x1f'),_0x3b9388[_0x517bf4][_0x306fcf][_0xc8b5('0x6')]));break;}}}}})[_0xc8b5('0xd')](function(){if(_0x15d9d4===_0xc8b5('0x4a')){var _0x404bff=_[_0xc8b5('0x4b')](_0x469857[_0xc8b5('0x25')],'id');return _0x469857[_0xc8b5('0x4c')](_0x404bff)['then'](function(){for(var _0x55f5d9=0x0;_0x55f5d9<_0x404bff[_0xc8b5('0x43')];_0x55f5d9+=0x1){_0x175525['emit'](_0xc8b5('0x4d'),{'ChatInteractionId':Number(_0x404bff[_0x55f5d9]),'UserId':Number(_0x469857['id'])});}});}})[_0xc8b5('0xd')](function(){if(_0x15d9d4==='leave'){var _0x4ddd82=_[_0xc8b5('0x4b')](_0x469857[_0xc8b5('0x4e')],'id');return _0x469857['removeMailInteractions'](_0x4ddd82)[_0xc8b5('0xd')](function(){for(var _0x29aa3b=0x0;_0x29aa3b<_0x4ddd82['length'];_0x29aa3b+=0x1){_0x175525['emit'](_0xc8b5('0x4f'),{'MailInteractionId':Number(_0x4ddd82[_0x29aa3b]),'UserId':Number(_0x469857['id'])});}});}})['then'](function(){if(_0x15d9d4==='leave'){var _0x49f40b=_[_0xc8b5('0x4b')](_0x469857[_0xc8b5('0x27')],'id');return _0x469857[_0xc8b5('0x50')](_0x49f40b)['then'](function(){for(var _0x1c00f6=0x0;_0x1c00f6<_0x49f40b['length'];_0x1c00f6+=0x1){_0x175525[_0xc8b5('0x51')](_0xc8b5('0x52'),{'FaxInteractionId':Number(_0x49f40b[_0x1c00f6]),'UserId':Number(_0x469857['id'])});}});}})[_0xc8b5('0xd')](function(){if(_0x15d9d4===_0xc8b5('0x4a')){var _0x186d64=_['map'](_0x469857[_0xc8b5('0x53')],'id');return _0x469857[_0xc8b5('0x54')](_0x186d64)['then'](function(){for(var _0x180787=0x0;_0x180787<_0x186d64[_0xc8b5('0x43')];_0x180787+=0x1){_0x175525[_0xc8b5('0x51')](_0xc8b5('0x55'),{'SmsInteractionId':Number(_0x186d64[_0x180787]),'UserId':Number(_0x469857['id'])});}});}})[_0xc8b5('0xd')](function(){if(_0x15d9d4===_0xc8b5('0x4a')){var _0x166145=_[_0xc8b5('0x4b')](_0x469857[_0xc8b5('0x2a')],'id');return _0x469857['removeOpenchannelInteractions'](_0x166145)[_0xc8b5('0xd')](function(){for(var _0x169e16=0x0;_0x169e16<_0x166145[_0xc8b5('0x43')];_0x169e16+=0x1){_0x175525[_0xc8b5('0x51')](_0xc8b5('0x56'),{'OpenchannelInteractionId':Number(_0x166145[_0x169e16]),'UserId':Number(_0x469857['id'])});}});}})['then'](function(){if(_0x15d9d4===_0xc8b5('0x4a')){var _0x4cc47d=_[_0xc8b5('0x4b')](_0x469857['WhatsappInteractions'],'id');return _0x469857['removeWhatsappInteractions'](_0x4cc47d)[_0xc8b5('0xd')](function(){for(var _0x1e3f10=0x0;_0x1e3f10<_0x4cc47d[_0xc8b5('0x43')];_0x1e3f10+=0x1){_0x175525['emit'](_0xc8b5('0x57'),{'WhatsappInteractionId':Number(_0x4cc47d[_0x1e3f10]),'UserId':Number(_0x469857['id'])});}});}})[_0xc8b5('0x58')](function(_0x581bbb){_0x413e31[_0xc8b5('0x59')](_0x581bbb);});}}function onDisconnect(_0xadb488,_0x4d21d8){joinOrLeave(_0xadb488,'leave',_0x4d21d8);}function onConnect(_0x54e791){joinOrLeave(_0x54e791,_0xc8b5('0x5a'));}exports[_0xc8b5('0x5b')]=function(_0x36f54d){_0x36f54d['on']('connection',function(_0x1b6425){_0x1b6425[_0xc8b5('0x5c')](0x0);_0x1b6425[_0xc8b5('0x5d')]=_0x1b6425[_0xc8b5('0x5e')][_0xc8b5('0x5f')][_0xc8b5('0x60')]+':'+_0x1b6425[_0xc8b5('0x5e')][_0xc8b5('0x5f')][_0xc8b5('0x61')];_0x1b6425[_0xc8b5('0x62')]=new Date();_0x1b6425[_0xc8b5('0x59')]=function(_0x26d965){console[_0xc8b5('0x59')](_0xc8b5('0x63')+_0x1b6425[_0xc8b5('0x64')]['name']+'['+_0x1b6425[_0xc8b5('0x5d')]+']',_0x26d965);};_0x1b6425['on'](_0xc8b5('0x65'),function(){onDisconnect(_0x1b6425,_0x36f54d);_0x1b6425['log'](_0xc8b5('0x66'));});onConnect(_0x1b6425);_0x1b6425['log']('CONNECTED');});}; \ No newline at end of file +var _0x2507=['catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','Agents','name','role','agent','telephone','type','ivr','findOne','then','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','UserProfileResource','resourceId','map','User','Campaign','format','%s:queue:%s','user:%s','handshake','find','userProfileId','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:outbound','include','push','VoiceQueue','ChatQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','user','WhatsappQueues','Trunks','Trunk','voice:inbound','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','all','length','voice','chat','fax','sms','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions'];(function(_0x1d6d92,_0x2e6f0b){var _0x31ef3a=function(_0x134f39){while(--_0x134f39){_0x1d6d92['push'](_0x1d6d92['shift']());}};_0x31ef3a(++_0x2e6f0b);}(_0x2507,0xda));var _0x7250=function(_0x3610f3,_0x4bcf94){_0x3610f3=_0x3610f3-0x0;var _0x1fb087=_0x2507[_0x3610f3];return _0x1fb087;};'use strict';var _=require(_0x7250('0x0'));var util=require(_0x7250('0x1'));var BPromise=require(_0x7250('0x2'));var db=require(_0x7250('0x3'))['db'];var config=require(_0x7250('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x7250('0x5'),'model':db['User'],'attributes':['id',_0x7250('0x6'),_0x7250('0x7')],'raw':!![],'where':{'role':_0x7250('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x7250('0x6')],'where':{'role':_0x7250('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x7250('0x6')]};var queryAgents={'raw':!![],'attributes':['id',_0x7250('0x6')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x7250('0x6'),_0x7250('0xa')],'where':{'type':_0x7250('0xb')}};function getAssociatedResources(_0x1a176c,_0x5bdd5d,_0x324c49){return db['UserProfileSection'][_0x7250('0xc')]({'where':{'name':_0x1a176c,'userProfileId':_0x5bdd5d},'raw':!![]})[_0x7250('0xd')](function(_0x387920){if(_0x387920){if(_0x387920['autoAssociation']){switch(_0x1a176c){case _0x7250('0xe'):case _0x7250('0xf'):case _0x7250('0x10'):case _0x7250('0x11'):case _0x7250('0x12'):case _0x7250('0x13'):case'WhatsappQueues':return db[_0x324c49][_0x7250('0x14')](queryQueues);case _0x7250('0x15'):return db[_0x324c49]['findAll'](queryTelephones);case'Trunks':return db[_0x324c49]['findAll'](queryTrunks);case'IvrCampaigns':return db[_0x324c49][_0x7250('0x14')](queryCampaigns);}}else{return db[_0x7250('0x16')][_0x7250('0x14')]({'attributes':[_0x7250('0x17')],'where':{'sectionId':_0x387920['id']},'raw':!![]})[_0x7250('0xd')](function(_0x3cc084){if(_0x3cc084){var _0x1bc07b={'where':{'id':_[_0x7250('0x18')](_0x3cc084,'resourceId')},'raw':!![]};switch(_0x324c49){case _0x7250('0x19'):_0x1bc07b['where'][_0x7250('0x7')]=_0x7250('0x9');break;case _0x7250('0x1a'):_0x1bc07b['where'][_0x7250('0xa')]=_0x7250('0xb');break;}return db[_0x324c49][_0x7250('0x14')](_0x1bc07b);}else{return[];}});}}else{return[];}})[_0x7250('0xd')](function(_0xe5eb87){return _0xe5eb87;});}function joinOrLeaveQueues(_0x40f154,_0x4e8c07,_0x4acd29,_0x1ac465){_0x40f154[_0x4e8c07](util[_0x7250('0x1b')](_0x7250('0x1c'),_0x4acd29,_0x1ac465[_0x7250('0x6')]));if(_0x1ac465['Agents']){for(var _0x4c9245=0x0;_0x4c9245<_0x1ac465['Agents']['length'];_0x4c9245+=0x1){_0x40f154[_0x4e8c07](util[_0x7250('0x1b')](_0x7250('0x1d'),_0x1ac465['Agents'][_0x4c9245]['name']));}}}function joinOrLeave(_0x5ec630,_0x4fd807,_0x30bdc3){var _0x17fee4;if(_0x5ec630[_0x7250('0x1e')]['query']['id']){db[_0x7250('0x19')][_0x7250('0x1f')]({'attributes':['id',_0x7250('0x6'),_0x7250('0x7'),_0x7250('0x20')],'where':{'id':_0x5ec630[_0x7250('0x1e')][_0x7250('0x21')]['id']},'include':[{'model':db[_0x7250('0x22')],'as':_0x7250('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x7250('0x24')],'as':_0x7250('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x7250('0x26')],'as':_0x7250('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x7250('0x28')],'as':_0x7250('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x7250('0x2a')],'as':_0x7250('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x7250('0x2c')],'as':_0x7250('0x2d'),'attributes':['id'],'raw':!![]}]})[_0x7250('0xd')](function(_0x5b1cb1){if(_0x5b1cb1){_0x17fee4=_0x5b1cb1;_0x5ec630[_0x4fd807](util[_0x7250('0x1b')](_0x7250('0x1d'),_0x5b1cb1[_0x7250('0x6')]));var _0x5a2c80=[];switch(_0x5b1cb1[_0x7250('0x7')]){case _0x7250('0x2e'):_0x5ec630[_0x4fd807]('voice:inbound');_0x5ec630[_0x4fd807](_0x7250('0x2f'));if(queryQueues['hasOwnProperty'](_0x7250('0x30'))){delete queryQueues[_0x7250('0x30')];}_0x5a2c80[_0x7250('0x31')](db[_0x7250('0x32')]['findAll'](queryQueues));_0x5a2c80[_0x7250('0x31')](db[_0x7250('0x33')][_0x7250('0x14')](queryQueues));_0x5a2c80['push'](db['FaxQueue'][_0x7250('0x14')](queryQueues));_0x5a2c80[_0x7250('0x31')](db[_0x7250('0x34')][_0x7250('0x14')](queryQueues));_0x5a2c80['push'](db['MailQueue'][_0x7250('0x14')](queryQueues));_0x5a2c80[_0x7250('0x31')](db[_0x7250('0x35')][_0x7250('0x14')](queryQueues));_0x5a2c80['push'](db[_0x7250('0x36')]['findAll'](queryQueues));_0x5a2c80['push'](db[_0x7250('0x19')]['findAll'](queryTelephones));_0x5a2c80[_0x7250('0x31')](db['Trunk']['findAll'](queryTrunks));_0x5a2c80[_0x7250('0x31')](db[_0x7250('0x1a')][_0x7250('0x14')](queryCampaigns));_0x5a2c80[_0x7250('0x31')](db[_0x7250('0x19')][_0x7250('0x14')](queryAgents));break;case _0x7250('0x37'):_0x5ec630[_0x4fd807]('voice:inbound');_0x5ec630[_0x4fd807](_0x7250('0x2f'));_0x5a2c80[_0x7250('0x31')](getAssociatedResources(_0x7250('0xe'),_0x5b1cb1[_0x7250('0x20')],_0x7250('0x32')));_0x5a2c80[_0x7250('0x31')](getAssociatedResources('ChatQueues',_0x5b1cb1[_0x7250('0x20')],_0x7250('0x33')));_0x5a2c80[_0x7250('0x31')](getAssociatedResources(_0x7250('0x10'),_0x5b1cb1['userProfileId'],'FaxQueue'));_0x5a2c80[_0x7250('0x31')](getAssociatedResources('SmsQueues',_0x5b1cb1[_0x7250('0x20')],_0x7250('0x34')));_0x5a2c80['push'](getAssociatedResources(_0x7250('0x12'),_0x5b1cb1[_0x7250('0x20')],'MailQueue'));_0x5a2c80[_0x7250('0x31')](getAssociatedResources(_0x7250('0x13'),_0x5b1cb1['userProfileId'],_0x7250('0x35')));_0x5a2c80[_0x7250('0x31')](getAssociatedResources(_0x7250('0x38'),_0x5b1cb1[_0x7250('0x20')],'WhatsappQueue'));_0x5a2c80[_0x7250('0x31')](getAssociatedResources(_0x7250('0x15'),_0x5b1cb1[_0x7250('0x20')],_0x7250('0x19')));_0x5a2c80[_0x7250('0x31')](getAssociatedResources(_0x7250('0x39'),_0x5b1cb1[_0x7250('0x20')],_0x7250('0x3a')));_0x5a2c80[_0x7250('0x31')](getAssociatedResources('IvrCampaigns',_0x5b1cb1[_0x7250('0x20')],'Campaign'));_0x5a2c80[_0x7250('0x31')](db[_0x7250('0x19')][_0x7250('0x14')](queryAgents));break;case _0x7250('0x8'):_0x5ec630[_0x4fd807](_0x7250('0x3b'));_0x5ec630[_0x4fd807](_0x7250('0x2f'));_0x5a2c80[_0x7250('0x31')](_0x5b1cb1[_0x7250('0x3c')]({'attributes':['id',_0x7250('0x6')]}));_0x5a2c80[_0x7250('0x31')](_0x5b1cb1[_0x7250('0x3d')]({'attributes':['id',_0x7250('0x6')]}));_0x5a2c80['push'](_0x5b1cb1[_0x7250('0x3e')]({'attributes':['id','name']}));_0x5a2c80['push'](_0x5b1cb1['getSmsQueues']({'attributes':['id',_0x7250('0x6')]}));_0x5a2c80['push'](_0x5b1cb1[_0x7250('0x3f')]({'attributes':['id',_0x7250('0x6')]}));_0x5a2c80[_0x7250('0x31')](_0x5b1cb1[_0x7250('0x40')]({'attributes':['id',_0x7250('0x6')]}));_0x5a2c80[_0x7250('0x31')](_0x5b1cb1['getWhatsappQueues']({'attributes':['id','name']}));break;}return BPromise[_0x7250('0x41')](_0x5a2c80);}})['then'](function(_0x5292b4){if(_0x5292b4&&_0x5292b4[_0x7250('0x42')]){for(var _0x2244c4=0x0;_0x2244c4<_0x5292b4[_0x7250('0x42')];_0x2244c4+=0x1){for(var _0x8d2c62=0x0;_0x8d2c62<_0x5292b4[_0x2244c4][_0x7250('0x42')];_0x8d2c62+=0x1){switch(_0x2244c4){case 0x0:joinOrLeaveQueues(_0x5ec630,_0x4fd807,_0x7250('0x43'),_0x5292b4[_0x2244c4][_0x8d2c62]);break;case 0x1:joinOrLeaveQueues(_0x5ec630,_0x4fd807,_0x7250('0x44'),_0x5292b4[_0x2244c4][_0x8d2c62]);break;case 0x2:joinOrLeaveQueues(_0x5ec630,_0x4fd807,_0x7250('0x45'),_0x5292b4[_0x2244c4][_0x8d2c62]);break;case 0x3:joinOrLeaveQueues(_0x5ec630,_0x4fd807,_0x7250('0x46'),_0x5292b4[_0x2244c4][_0x8d2c62]);break;case 0x4:joinOrLeaveQueues(_0x5ec630,_0x4fd807,'mail',_0x5292b4[_0x2244c4][_0x8d2c62]);break;case 0x5:joinOrLeaveQueues(_0x5ec630,_0x4fd807,_0x7250('0x47'),_0x5292b4[_0x2244c4][_0x8d2c62]);break;case 0x6:joinOrLeaveQueues(_0x5ec630,_0x4fd807,_0x7250('0x48'),_0x5292b4[_0x2244c4][_0x8d2c62]);break;case 0x7:if(_0x17fee4[_0x7250('0x7')]!==_0x7250('0x8'))_0x5ec630[_0x4fd807](util[_0x7250('0x1b')](_0x7250('0x49'),_0x5292b4[_0x2244c4][_0x8d2c62][_0x7250('0x6')]));break;case 0x8:if(_0x17fee4[_0x7250('0x7')]!==_0x7250('0x8'))_0x5ec630[_0x4fd807](util[_0x7250('0x1b')]('trunk:%s',_0x5292b4[_0x2244c4][_0x8d2c62][_0x7250('0x6')]));break;case 0x9:if(_0x17fee4[_0x7250('0x7')]!==_0x7250('0x8'))_0x5ec630[_0x4fd807](util['format'](_0x7250('0x4a'),_0x5292b4[_0x2244c4][_0x8d2c62]['type'],_0x5292b4[_0x2244c4][_0x8d2c62][_0x7250('0x6')]));break;case 0xa:_0x5ec630[_0x4fd807](util[_0x7250('0x1b')](_0x7250('0x1d'),_0x5292b4[_0x2244c4][_0x8d2c62][_0x7250('0x6')]));break;}}}}})[_0x7250('0xd')](function(){if(_0x4fd807===_0x7250('0x4b')){var _0xfb30b8=_[_0x7250('0x18')](_0x17fee4[_0x7250('0x23')],'id');return _0x17fee4['removeChatInteractions'](_0xfb30b8)[_0x7250('0xd')](function(){for(var _0x31640b=0x0;_0x31640b<_0xfb30b8['length'];_0x31640b+=0x1){_0x30bdc3['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0xfb30b8[_0x31640b]),'UserId':Number(_0x17fee4['id'])});}});}})['then'](function(){if(_0x4fd807===_0x7250('0x4b')){var _0x3ffb6c=_['map'](_0x17fee4[_0x7250('0x25')],'id');return _0x17fee4[_0x7250('0x4c')](_0x3ffb6c)[_0x7250('0xd')](function(){for(var _0x4da41b=0x0;_0x4da41b<_0x3ffb6c[_0x7250('0x42')];_0x4da41b+=0x1){_0x30bdc3[_0x7250('0x4d')](_0x7250('0x4e'),{'MailInteractionId':Number(_0x3ffb6c[_0x4da41b]),'UserId':Number(_0x17fee4['id'])});}});}})['then'](function(){if(_0x4fd807===_0x7250('0x4b')){var _0x674a2f=_['map'](_0x17fee4[_0x7250('0x27')],'id');return _0x17fee4[_0x7250('0x4f')](_0x674a2f)[_0x7250('0xd')](function(){for(var _0x58d017=0x0;_0x58d017<_0x674a2f[_0x7250('0x42')];_0x58d017+=0x1){_0x30bdc3[_0x7250('0x4d')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x674a2f[_0x58d017]),'UserId':Number(_0x17fee4['id'])});}});}})[_0x7250('0xd')](function(){if(_0x4fd807===_0x7250('0x4b')){var _0x53d3ec=_['map'](_0x17fee4['SmsInteractions'],'id');return _0x17fee4[_0x7250('0x50')](_0x53d3ec)[_0x7250('0xd')](function(){for(var _0x5a3e65=0x0;_0x5a3e65<_0x53d3ec[_0x7250('0x42')];_0x5a3e65+=0x1){_0x30bdc3[_0x7250('0x4d')](_0x7250('0x51'),{'SmsInteractionId':Number(_0x53d3ec[_0x5a3e65]),'UserId':Number(_0x17fee4['id'])});}});}})[_0x7250('0xd')](function(){if(_0x4fd807===_0x7250('0x4b')){var _0x56cbc2=_[_0x7250('0x18')](_0x17fee4[_0x7250('0x2b')],'id');return _0x17fee4[_0x7250('0x52')](_0x56cbc2)[_0x7250('0xd')](function(){for(var _0x3fd618=0x0;_0x3fd618<_0x56cbc2[_0x7250('0x42')];_0x3fd618+=0x1){_0x30bdc3[_0x7250('0x4d')](_0x7250('0x53'),{'OpenchannelInteractionId':Number(_0x56cbc2[_0x3fd618]),'UserId':Number(_0x17fee4['id'])});}});}})['then'](function(){if(_0x4fd807===_0x7250('0x4b')){var _0x4d8c9a=_[_0x7250('0x18')](_0x17fee4[_0x7250('0x2d')],'id');return _0x17fee4[_0x7250('0x54')](_0x4d8c9a)[_0x7250('0xd')](function(){for(var _0x48f85d=0x0;_0x48f85d<_0x4d8c9a[_0x7250('0x42')];_0x48f85d+=0x1){_0x30bdc3[_0x7250('0x4d')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x4d8c9a[_0x48f85d]),'UserId':Number(_0x17fee4['id'])});}});}})[_0x7250('0x55')](function(_0x2d67f8){_0x5ec630[_0x7250('0x56')](_0x2d67f8);});}}function onDisconnect(_0x26bb7f,_0x5540d7){joinOrLeave(_0x26bb7f,_0x7250('0x4b'),_0x5540d7);}function onConnect(_0x50a283){joinOrLeave(_0x50a283,_0x7250('0x57'));}exports[_0x7250('0x58')]=function(_0x5739e6){_0x5739e6['on'](_0x7250('0x59'),function(_0x528364){_0x528364[_0x7250('0x5a')](0x0);_0x528364[_0x7250('0x5b')]=_0x528364[_0x7250('0x5c')][_0x7250('0x59')][_0x7250('0x5d')]+':'+_0x528364[_0x7250('0x5c')][_0x7250('0x59')][_0x7250('0x5e')];_0x528364[_0x7250('0x5f')]=new Date();_0x528364[_0x7250('0x56')]=function(_0x170e53){console['log'](_0x7250('0x60')+_0x528364[_0x7250('0x61')][_0x7250('0x6')]+'['+_0x528364['address']+']',_0x170e53);};_0x528364['on'](_0x7250('0x62'),function(){onDisconnect(_0x528364,_0x5739e6);_0x528364['log'](_0x7250('0x63'));});onConnect(_0x528364);_0x528364['log'](_0x7250('0x64'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 37443ad..1574254 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 _0x75f4=['Chat','ChatInteraction','afterCreate','newinteraction','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','afterUpdate','FaxMessage','Mail','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','EventManager','info','Trigger,\x20%s','error','code','catch','motionChannel','event','direction','resolve','then','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','contact','UserId','interface','format','name','channel','incomingmessage','outgoingmessage','get','offlineMessage','opened','Sequelize','SELECT','SIP/%s','agent','AfterCreate','changed','closed','substatus','QueryTypes','AfterUpdate','User','find','fullname','email','internal','length','model','hook','callback','toLowerCase','condition','../../mysqldb','jayson/promise','../logger','triggers','http'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x75f4,0x1c3));var _0x475f=function(_0x2850c0,_0x1363a7){_0x2850c0=_0x2850c0-0x0;var _0x21e830=_0x75f4[_0x2850c0];return _0x21e830;};'use strict';var util=require('util');var db=require(_0x475f('0x0'))['db'];var jayson=require(_0x475f('0x1'));var logger=require(_0x475f('0x2'))(_0x475f('0x3'));var client=jayson['client'][_0x475f('0x4')]({'port':0x232a});var triggers=[{'channel':_0x475f('0x5'),'model':_0x475f('0x6'),'event':_0x475f('0x7'),'condition':_0x475f('0x8'),'callback':afterCreate},{'channel':_0x475f('0x5'),'model':_0x475f('0x6'),'event':'afterUpdate','condition':_0x475f('0x9'),'callback':afterUpdate},{'channel':'Chat','model':_0x475f('0xa'),'event':_0x475f('0x7'),'condition':_0x475f('0xb'),'callback':afterCreateMessage},{'channel':_0x475f('0x5'),'model':_0x475f('0xc'),'event':'afterCreate','condition':_0x475f('0xb'),'callback':afterCreateOfflineMessage},{'channel':_0x475f('0xd'),'model':_0x475f('0xe'),'event':_0x475f('0x7'),'condition':_0x475f('0x8'),'callback':afterCreate},{'channel':_0x475f('0xd'),'model':_0x475f('0xe'),'event':'afterUpdate','condition':_0x475f('0x9'),'callback':afterUpdate},{'channel':_0x475f('0xd'),'model':_0x475f('0xf'),'event':_0x475f('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x475f('0x10'),'model':_0x475f('0x11'),'event':_0x475f('0x7'),'condition':_0x475f('0x8'),'callback':afterCreate},{'channel':_0x475f('0x10'),'model':'WhatsappInteraction','event':'afterUpdate','condition':_0x475f('0x9'),'callback':afterUpdate},{'channel':_0x475f('0x10'),'model':'WhatsappMessage','event':_0x475f('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x475f('0x12'),'model':_0x475f('0x13'),'event':_0x475f('0x7'),'condition':_0x475f('0x8'),'callback':afterCreate},{'channel':'Fax','model':_0x475f('0x13'),'event':_0x475f('0x14'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x475f('0x12'),'model':_0x475f('0x15'),'event':_0x475f('0x7'),'condition':_0x475f('0xb'),'callback':afterCreateMessage},{'channel':_0x475f('0x16'),'model':_0x475f('0x17'),'event':'afterCreate','condition':_0x475f('0x8'),'callback':afterCreate},{'channel':_0x475f('0x16'),'model':_0x475f('0x17'),'event':'afterUpdate','condition':_0x475f('0x9'),'callback':afterUpdate},{'channel':_0x475f('0x16'),'model':_0x475f('0x18'),'event':_0x475f('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Openchannel','model':'OpenchannelInteraction','event':_0x475f('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':'Openchannel','model':_0x475f('0x19'),'event':'afterUpdate','condition':_0x475f('0x9'),'callback':afterUpdate},{'channel':_0x475f('0x1a'),'model':_0x475f('0x1b'),'event':_0x475f('0x7'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x4bb756){return client['request'](_0x475f('0x1c'),_0x4bb756)['then'](function(_0x224b64){logger[_0x475f('0x1d')](_0x475f('0x1e'),_0x475f('0x1c'),_0x224b64);if(_0x224b64['error']){if(_0x224b64[_0x475f('0x1f')][_0x475f('0x20')]===0x1f4){logger[_0x475f('0x1f')]('Trigger,\x20%s','EventManager',_0x224b64[_0x475f('0x1f')]);}}})[_0x475f('0x21')](function(_0x2563b8){logger['error'](_0x475f('0x1e'),_0x475f('0x1c'),_0x2563b8);});}function afterCreateMessage(_0x1645c8){return function(_0x5989e4){_0x5989e4=_0x5989e4['get']({'plain':!![]});_0x5989e4['channel']=_0x1645c8;_0x5989e4[_0x475f('0x22')]=_0x1645c8;_0x5989e4[_0x475f('0x23')]=_0x5989e4[_0x475f('0x24')];Promise[_0x475f('0x25')]()[_0x475f('0x26')](function(){if(typeof _0x5989e4[_0x475f('0x27')]===_0x475f('0x28'))return null;var _0x18e79f=_0x475f('0x29')+_0x5989e4[_0x475f('0x27')];return db[_0x475f('0x2a')][_0x475f('0x2b')](_0x18e79f,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]});})[_0x475f('0x26')](function(_0x48e749){if(_0x48e749){_0x5989e4[_0x475f('0x2c')]=_0x48e749[0x0];}if(typeof _0x5989e4[_0x475f('0x2d')]===_0x475f('0x28'))return;return getAgent(_0x5989e4[_0x475f('0x2d')]);})[_0x475f('0x26')](function(_0x18e7b9){if(_0x18e7b9){_0x5989e4[_0x475f('0x2e')]=util[_0x475f('0x2f')]('SIP/%s',_0x18e7b9[_0x475f('0x30')]);_0x5989e4['agent']=_0x18e7b9;_0x5989e4[_0x475f('0x31')]=_0x1645c8;return request({'event':_0x475f('0x32'),'message':_0x5989e4});}else{return request({'event':_0x475f('0x33'),'message':_0x5989e4});}})[_0x475f('0x21')](function(_0x5fe9e1){logger[_0x475f('0x1f')](_0x475f('0x1e'),'AfterCreateMessage',_0x5fe9e1);});};}function afterCreateOfflineMessage(_0x563261){return function(_0x4a7152){_0x4a7152=_0x4a7152[_0x475f('0x34')]({'plain':!![]});_0x4a7152['channel']=_0x563261;_0x4a7152[_0x475f('0x22')]=_0x563261;_0x4a7152[_0x475f('0x23')]=_0x475f('0x35');return request({'event':_0x4a7152[_0x475f('0x23')],'message':_0x4a7152});};}function afterCreate(_0x521879,_0x513e1a){return function(_0x5eb00b){_0x5eb00b=_0x5eb00b['get']({'plain':!![]});_0x5eb00b['channel']=_0x521879;_0x5eb00b[_0x475f('0x22')]=_0x521879;_0x5eb00b[_0x475f('0x23')]=_0x475f('0x36');Promise[_0x475f('0x25')]()[_0x475f('0x26')](function(){var _0x49986e=_0x475f('0x29')+_0x5eb00b['ContactId'];return db['sequelize']['query'](_0x49986e,{'type':db[_0x475f('0x37')]['QueryTypes'][_0x475f('0x38')],'raw':!![]});})[_0x475f('0x26')](function(_0x30b35a){if(_0x30b35a){_0x5eb00b[_0x475f('0x2c')]=_0x30b35a[0x0];}if(typeof _0x5eb00b[_0x475f('0x2d')]===_0x475f('0x28'))return;return getAgent(_0x5eb00b[_0x475f('0x2d')]);})[_0x475f('0x26')](function(_0x35a1e4){if(_0x35a1e4){_0x5eb00b[_0x475f('0x2e')]=util[_0x475f('0x2f')](_0x475f('0x39'),_0x35a1e4['name']);_0x5eb00b[_0x475f('0x3a')]=_0x35a1e4;}return request({'event':_0x513e1a,'message':_0x5eb00b});})[_0x475f('0x21')](function(_0x39a72c){logger[_0x475f('0x1f')](_0x475f('0x1e'),_0x475f('0x3b'),_0x39a72c);});};}function afterUpdate(_0x4d41c8){return function(_0x1d88d5){var _0x527f82=_0x1d88d5[_0x475f('0x3c')](_0x475f('0x3d'))&&_0x1d88d5['closed'];var _0x1fc5b5=_0x1d88d5[_0x475f('0x3c')](_0x475f('0x3e'));if(_0x527f82||_0x1fc5b5){var _0x4af90f=_0x527f82?_0x475f('0x9'):'substatus';var _0x3d87de=_0x1d88d5['get']({'plain':!![]});_0x3d87de['channel']=_0x4d41c8;_0x3d87de[_0x475f('0x22')]=_0x4d41c8;_0x3d87de[_0x475f('0x23')]=_0x527f82?_0x475f('0x3d'):_0x475f('0x3e');var _0x2a1a4c=_0x475f('0x29')+_0x3d87de[_0x475f('0x27')];return db[_0x475f('0x2a')]['query'](_0x2a1a4c,{'type':db['Sequelize'][_0x475f('0x3f')][_0x475f('0x38')],'raw':!![]})[_0x475f('0x26')](function(_0x2732d5){if(_0x2732d5){_0x3d87de['contact']=_0x2732d5[0x0];}if(typeof _0x3d87de[_0x475f('0x2d')]===_0x475f('0x28'))return;return getAgent(_0x3d87de['UserId']);})[_0x475f('0x26')](function(_0x1451f5){if(_0x1451f5){_0x3d87de[_0x475f('0x2e')]=util[_0x475f('0x2f')](_0x475f('0x39'),_0x1451f5['name']);_0x3d87de['agent']=_0x1451f5;}return request({'event':_0x4af90f,'message':_0x3d87de});})[_0x475f('0x21')](function(_0x50bc78){logger[_0x475f('0x1f')]('Trigger,\x20%s',_0x475f('0x40'),_0x50bc78);});}};}function getAgent(_0x279c23){return db[_0x475f('0x41')][_0x475f('0x42')]({'where':{'id':_0x279c23},'attributes':['id',_0x475f('0x30'),_0x475f('0x43'),_0x475f('0x44'),_0x475f('0x45')],'raw':!![]})[_0x475f('0x26')](function(_0x9b20ca){return _0x9b20ca;});}exports['default']=function(){for(var _0x1d61da=0x0;_0x1d61da=_0x1d3d54[_0x2c4d('0x16')]){throw Error(_0x2c4d('0x17'));}_0x1fee75(_0x3c34fc);})[_0x2c4d('0x18')](function(_0x32a172){_0x3043f3(_0x32a172);});});}; \ No newline at end of file +var _0x7793=['sms','openchannel','getChannels','isValidChannel','includes','isUndefined','updateAttributes','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','../mysqldb','./license/util','voice','chat','fax'];(function(_0xbf6f32,_0x3d793a){var _0x1d3ecc=function(_0x2f236e){while(--_0x2f236e){_0xbf6f32['push'](_0xbf6f32['shift']());}};_0x1d3ecc(++_0x3d793a);}(_0x7793,0x175));var _0x3779=function(_0x576448,_0x5d03ae){_0x576448=_0x576448-0x0;var _0x2506f3=_0x7793[_0x576448];return _0x2506f3;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var db=require(_0x3779('0x0'))['db'];var util=require(_0x3779('0x1'));var channels=[_0x3779('0x2'),'mail',_0x3779('0x3'),_0x3779('0x4'),_0x3779('0x5'),'whatsapp',_0x3779('0x6')];exports[_0x3779('0x7')]=function(){return channels;};exports[_0x3779('0x8')]=function(_0xd25775){_0xd25775=_0xd25775['toLowerCase']();return _[_0x3779('0x9')](channels,_0xd25775);};exports['clearBlockUser']=function(_0x1c57c4,_0x5f14c5,_0x1fac6f,_0x16244a){var _0x81ea27={'loginAttempts':_0x5f14c5,'blocked':_0x1fac6f};if(!_[_0x3779('0xa')](_0x16244a)){_0x81ea27['blockedAt']=_0x16244a;}return _0x1c57c4[_0x3779('0xb')](_0x81ea27);};exports[_0x3779('0xc')]=function(_0x36878f){return new BPromise(function(_0x46bd28,_0x49c01d){var _0x5780c1=0x0;if(_0x36878f[_0x3779('0xd')]!==_0x3779('0xe')){_0x46bd28(_0x36878f);}db[_0x3779('0xf')][_0x3779('0x10')]({'where':{'role':_0x3779('0xe'),'online':!![],'id':{'$ne':_0x36878f['id']}}})[_0x3779('0x11')](function(_0x397984){_0x5780c1=_0x397984;return util['getLicense']();})[_0x3779('0x11')](function(_0x462218){if(_0x462218&&_0x462218['agents']&&_0x5780c1>=_0x462218[_0x3779('0x12')]){throw Error(_0x3779('0x13'));}_0x46bd28(_0x36878f);})[_0x3779('0x14')](function(_0x52ce74){_0x49c01d(_0x52ce74);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index a7e9c30..8b3469d 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda3f=['inherits','message','Bad\x20Request','Entity\x20not\x20found','name','Not\x20Found','Forbidden','OutOfInterval','error','stack','send','exports','../config/logger','api','Internal\x20Server\x20Error','Error'];(function(_0x582b4a,_0x542257){var _0x5c8888=function(_0x21806a){while(--_0x21806a){_0x582b4a['push'](_0x582b4a['shift']());}};_0x5c8888(++_0x542257);}(_0xda3f,0xec));var _0xfda3=function(_0x15dbfa,_0x3bf1b2){_0x15dbfa=_0x15dbfa-0x0;var _0x49942a=_0xda3f[_0x15dbfa];return _0x49942a;};'use strict';var util=require('util');var logger=require(_0xfda3('0x0'))(_0xfda3('0x1'));var APIError=function(_0x534697,_0x5299b0){this['message']=_0x534697||_0xfda3('0x2');this['name']=_0x5299b0||_0xfda3('0x3');util[_0xfda3('0x4')](APIError,Error);};var APIBadRequestError=function(_0x516500){this[_0xfda3('0x5')]=_0x516500||_0xfda3('0x6');this['name']='Bad\x20Request';util[_0xfda3('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x42476a){this[_0xfda3('0x5')]=_0x42476a||_0xfda3('0x7');this[_0xfda3('0x8')]=_0xfda3('0x9');util[_0xfda3('0x4')](APINotFoundError,APIError);};function getStatusCode(_0x1b1ea6){switch(_0x1b1ea6){case _0xfda3('0x6'):return 0x190;case _0xfda3('0xa'),_0xfda3('0xb'):return 0x193;case _0xfda3('0x9'):return 0x194;default:return 0x1f4;}}function handleError(_0x4d7841){return function(_0xe933f5){logger[_0xfda3('0xc')](_0xe933f5[_0xfda3('0xd')]);var _0x11afc1=getStatusCode(_0xe933f5[_0xfda3('0x8')]);if(_0xe933f5['name'])delete _0xe933f5[_0xfda3('0x8')];return _0x4d7841['status'](_0x11afc1)[_0xfda3('0xe')](_0xe933f5);};}module[_0xfda3('0xf')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xcb91=['Not\x20Found','error','stack','send','exports','api','message','name','Error','Bad\x20Request','Forbidden','OutOfInterval'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x137d1d,_0x35c663){_0x137d1d=_0x137d1d-0x0;var _0x485108=_0xcb91[_0x137d1d];return _0x485108;};'use strict';var util=require('util');var logger=require('../config/logger')(_0x1cb9('0x0'));var APIError=function(_0xe4a5bf,_0x17d4ec){this[_0x1cb9('0x1')]=_0xe4a5bf||'Internal\x20Server\x20Error';this[_0x1cb9('0x2')]=_0x17d4ec||_0x1cb9('0x3');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x13d5fd){this[_0x1cb9('0x1')]=_0x13d5fd||'Bad\x20Request';this[_0x1cb9('0x2')]=_0x1cb9('0x4');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x38737d){this[_0x1cb9('0x1')]=_0x38737d||'Entity\x20not\x20found';this[_0x1cb9('0x2')]='Not\x20Found';util['inherits'](APINotFoundError,APIError);};function getStatusCode(_0x45a12f){switch(_0x45a12f){case _0x1cb9('0x4'):return 0x190;case _0x1cb9('0x5'),_0x1cb9('0x6'):return 0x193;case _0x1cb9('0x7'):return 0x194;default:return 0x1f4;}}function handleError(_0x50ce71){return function(_0x9b58f1){logger[_0x1cb9('0x8')](_0x9b58f1[_0x1cb9('0x9')]);var _0x3fdd83=getStatusCode(_0x9b58f1[_0x1cb9('0x2')]);if(_0x9b58f1['name'])delete _0x9b58f1['name'];return _0x50ce71['status'](_0x3fdd83)[_0x1cb9('0xa')](_0x9b58f1);};}module[_0x1cb9('0xb')]={'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 0b95f7e..228dde2 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4787=['status','render','json','send'];(function(_0x26df48,_0x22aa50){var _0x209047=function(_0x1d068b){while(--_0x1d068b){_0x26df48['push'](_0x26df48['shift']());}};_0x209047(++_0x22aa50);}(_0x4787,0x148));var _0x7478=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x4787[_0x279d37];return _0x530173;};'use strict';module['exports'][0x194]=function pageNotFound(_0x900d55,_0x3c2f79){var _0x35eeb3='404';var _0x28f0d4=0x194;var _0x9bb47c={'status':_0x28f0d4};_0x3c2f79['status'](_0x9bb47c[_0x7478('0x0')]);_0x3c2f79[_0x7478('0x1')](_0x35eeb3,{},function(_0x23281c,_0x14a1f9){if(_0x23281c){return _0x3c2f79['status'](_0x9bb47c['status'])[_0x7478('0x2')](_0x9bb47c);}_0x3c2f79[_0x7478('0x3')](_0x14a1f9);});}; \ No newline at end of file +var _0x9a5c=['status','json','send','exports','404'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9a5c,0x184));var _0xc9a5=function(_0x17225e,_0x41a3ad){_0x17225e=_0x17225e-0x0;var _0x28536d=_0x9a5c[_0x17225e];return _0x28536d;};'use strict';module[_0xc9a5('0x0')][0x194]=function pageNotFound(_0x33a93d,_0x5cd502){var _0x35a64a=_0xc9a5('0x1');var _0x4374c0=0x194;var _0x1ad288={'status':_0x4374c0};_0x5cd502[_0xc9a5('0x2')](_0x1ad288[_0xc9a5('0x2')]);_0x5cd502['render'](_0x35a64a,{},function(_0x4b0a4b,_0x320e96){if(_0x4b0a4b){return _0x5cd502[_0xc9a5('0x2')](_0x1ad288[_0xc9a5('0x2')])[_0xc9a5('0x3')](_0x1ad288);}_0x5cd502[_0xc9a5('0x4')](_0x320e96);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 015608a..45cbab9 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0xd578cb,_0x2167a3){var _0x775533=function(_0x1c340d){while(--_0x1c340d){_0xd578cb['push'](_0xd578cb['shift']());}};_0x775533(++_0x2167a3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index a4dc6e8..49e4e9d 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3198=['./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','/api/jscripty/answers/reports','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','/api/rpc','/api/version','./api/version','/api/system','./api/system','./api/pm2','/api/webbar','./api/webbar','static','root','/apidoc','join','/www','/demo','snippet','/server/files/plugins','route','get','appPath','/index.html','path','express','./errors','./utils/client-side-logger','default','then','/api/users','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/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/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','/api/pauses','./api/pause','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/sounds','./api/sound','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations'];(function(_0x5e8c32,_0x1b1f3f){var _0x595f7b=function(_0x38840e){while(--_0x38840e){_0x5e8c32['push'](_0x5e8c32['shift']());}};_0x595f7b(++_0x1b1f3f);}(_0x3198,0x79));var _0x8319=function(_0x2670ee,_0x5ac140){_0x2670ee=_0x2670ee-0x0;var _0x251531=_0x3198[_0x2670ee];return _0x251531;};'use strict';var path=require(_0x8319('0x0'));var express=require(_0x8319('0x1'));var errors=require(_0x8319('0x2'));var config=require('./config/environment');var setupLoggers=require(_0x8319('0x3'))['setupLoggers'];var clientSideLogs=require('./api/client-side-logs');exports[_0x8319('0x4')]=function(_0x27a7d4){return setupLoggers(_0x27a7d4)[_0x8319('0x5')](function(){_0x27a7d4['use'](_0x8319('0x6'),require('./api/user'));_0x27a7d4[_0x8319('0x7')](_0x8319('0x8'),require(_0x8319('0x9')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xa'),require(_0x8319('0xb')));_0x27a7d4['use'](_0x8319('0xc'),require('./api/voiceExtension'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xd'),require('./api/voiceMusicOnHold'));_0x27a7d4[_0x8319('0x7')]('/api/voice/queues',require('./api/voiceQueue'));_0x27a7d4[_0x8319('0x7')]('/api/voice/recordings',require(_0x8319('0xe')));_0x27a7d4[_0x8319('0x7')]('/api/screen/recordings',require(_0x8319('0xf')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x10'),require(_0x8319('0x11')));_0x27a7d4[_0x8319('0x7')]('/api/voice/mails/messages',require(_0x8319('0x12')));_0x27a7d4['use'](_0x8319('0x13'),require(_0x8319('0x14')));_0x27a7d4['use'](_0x8319('0x15'),require(_0x8319('0x16')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x17'),require(_0x8319('0x18')));_0x27a7d4[_0x8319('0x7')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x27a7d4[_0x8319('0x7')](_0x8319('0x19'),require(_0x8319('0x1a')));_0x27a7d4[_0x8319('0x7')]('/api/trunks',require(_0x8319('0x1b')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x1c'),require(_0x8319('0x1d')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x1e'),require(_0x8319('0x1f')));_0x27a7d4[_0x8319('0x7')]('/api/mail/accounts',require(_0x8319('0x20')));_0x27a7d4['use'](_0x8319('0x21'),require(_0x8319('0x22')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x23'),require(_0x8319('0x24')));_0x27a7d4[_0x8319('0x7')]('/api/mail/interactions',require(_0x8319('0x25')));_0x27a7d4[_0x8319('0x7')]('/api/mail/messages',require(_0x8319('0x26')));_0x27a7d4[_0x8319('0x7')]('/api/mail/applications',require(_0x8319('0x27')));_0x27a7d4['use'](_0x8319('0x28'),require(_0x8319('0x29')));_0x27a7d4['use'](_0x8319('0x2a'),require('./api/dashboard'));_0x27a7d4[_0x8319('0x7')](_0x8319('0x2b'),require(_0x8319('0x2c')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x2d'),require(_0x8319('0x2e')));_0x27a7d4['use'](_0x8319('0x2f'),require(_0x8319('0x30')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x31'),require(_0x8319('0x32')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x33'),require('./api/faxMessage'));_0x27a7d4['use']('/api/fax/queues',require(_0x8319('0x34')));_0x27a7d4['use'](_0x8319('0x35'),require(_0x8319('0x36')));_0x27a7d4['use'](_0x8319('0x37'),require(_0x8319('0x38')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x39'),require(_0x8319('0x3a')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x3b'),require(_0x8319('0x3c')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x3d'),require(_0x8319('0x3e')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x3f'),require(_0x8319('0x40')));_0x27a7d4['use'](_0x8319('0x41'),require(_0x8319('0x42')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x43'),require(_0x8319('0x44')));_0x27a7d4['use'](_0x8319('0x45'),require(_0x8319('0x46')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x47'),require(_0x8319('0x48')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x49'),require('./api/openchannelQueue'));_0x27a7d4['use'](_0x8319('0x4a'),require(_0x8319('0x4b')));_0x27a7d4[_0x8319('0x7')]('/api/openchannel/reports/queue',require(_0x8319('0x4c')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x4d'),require(_0x8319('0x4e')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x4f'),require(_0x8319('0x50')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x51'),require('./api/chatMessage'));_0x27a7d4['use'](_0x8319('0x52'),require(_0x8319('0x53')));_0x27a7d4['use'](_0x8319('0x54'),require(_0x8319('0x55')));_0x27a7d4[_0x8319('0x7')]('/api/chat/groups',require(_0x8319('0x56')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x57'),require('./api/chatProactiveAction'));_0x27a7d4[_0x8319('0x7')](_0x8319('0x58'),require(_0x8319('0x59')));_0x27a7d4['use'](_0x8319('0x5a'),require(_0x8319('0x5b')));_0x27a7d4[_0x8319('0x7')]('/api/cm/hopper',require(_0x8319('0x5c')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x5d'),require(_0x8319('0x5e')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x5f'),require(_0x8319('0x60')));_0x27a7d4[_0x8319('0x7')]('/api/cm/hopper_history',require('./api/cmHopperHistory'));_0x27a7d4[_0x8319('0x7')](_0x8319('0x61'),require(_0x8319('0x62')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x63'),require(_0x8319('0x64')));_0x27a7d4[_0x8319('0x7')]('/api/automations',require(_0x8319('0x65')));_0x27a7d4['use'](_0x8319('0x66'),require('./api/cannedAnswer'));_0x27a7d4['use'](_0x8319('0x67'),require(_0x8319('0x68')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x69'),require('./api/condition'));_0x27a7d4[_0x8319('0x7')](_0x8319('0x6a'),require('./api/interval'));_0x27a7d4[_0x8319('0x7')](_0x8319('0x6b'),require(_0x8319('0x6c')));_0x27a7d4[_0x8319('0x7')]('/api/cdr',require('./api/cdr'));_0x27a7d4[_0x8319('0x7')](_0x8319('0x6d'),require(_0x8319('0x6e')));_0x27a7d4[_0x8319('0x7')]('/api/schedules',require('./api/schedule'));_0x27a7d4[_0x8319('0x7')](_0x8319('0x6f'),require(_0x8319('0x70')));_0x27a7d4[_0x8319('0x7')]('/api/tags',require('./api/tag'));_0x27a7d4['use']('/api/contact_item_types',require(_0x8319('0x71')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x72'),require(_0x8319('0x73')));_0x27a7d4['use'](_0x8319('0x74'),require(_0x8319('0x75')));_0x27a7d4['use'](_0x8319('0x76'),require(_0x8319('0x77')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x78'),require(_0x8319('0x79')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x7a'),require('./api/variable'));_0x27a7d4['use'](_0x8319('0x7b'),require(_0x8319('0x7c')));_0x27a7d4[_0x8319('0x7')]('/api/integrations/reports',require('./api/integrationReport'));_0x27a7d4[_0x8319('0x7')](_0x8319('0x7d'),require(_0x8319('0x7e')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x7f'),require('./api/analyticDefaultReport'));_0x27a7d4['use'](_0x8319('0x80'),require(_0x8319('0x81')));_0x27a7d4[_0x8319('0x7')]('/api/analytics/metrics',require(_0x8319('0x82')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x83'),require(_0x8319('0x84')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x85'),require(_0x8319('0x86')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x87'),require(_0x8319('0x88')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x89'),require(_0x8319('0x8a')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x8b'),require(_0x8319('0x8c')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x8d'),require(_0x8319('0x8e')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x8f'),require(_0x8319('0x90')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x91'),require(_0x8319('0x92')));_0x27a7d4[_0x8319('0x7')]('/api/integrations/desk/accounts',require(_0x8319('0x93')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x94'),require(_0x8319('0x95')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x96'),require('./api/intDeskField'));_0x27a7d4[_0x8319('0x7')](_0x8319('0x97'),require(_0x8319('0x98')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x99'),require(_0x8319('0x9a')));_0x27a7d4['use'](_0x8319('0x9b'),require(_0x8319('0x9c')));_0x27a7d4[_0x8319('0x7')](_0x8319('0x9d'),require(_0x8319('0x9e')));_0x27a7d4['use'](_0x8319('0x9f'),require(_0x8319('0xa0')));_0x27a7d4[_0x8319('0x7')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x27a7d4['use']('/api/integrations/freshdesk/accounts',require(_0x8319('0xa1')));_0x27a7d4[_0x8319('0x7')]('/api/integrations/freshdesk/configurations',require(_0x8319('0xa2')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xa3'),require('./api/intFreshdeskField'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xa4'),require(_0x8319('0xa5')));_0x27a7d4[_0x8319('0x7')]('/api/integrations/vtiger/configurations',require('./api/intVtigerConfiguration'));_0x27a7d4['use'](_0x8319('0xa6'),require(_0x8319('0xa7')));_0x27a7d4['use']('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x27a7d4[_0x8319('0x7')]('/api/integrations/servicenow/configurations',require(_0x8319('0xa8')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xa9'),require(_0x8319('0xaa')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xab'),require(_0x8319('0xac')));_0x27a7d4['use']('/api/integrations/dynamics365/configurations',require(_0x8319('0xad')));_0x27a7d4['use'](_0x8319('0xae'),require(_0x8319('0xaf')));_0x27a7d4[_0x8319('0x7')]('/api/integrations/freshsales/accounts',require(_0x8319('0xb0')));_0x27a7d4['use'](_0x8319('0xb1'),require(_0x8319('0xb2')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xb3'),require(_0x8319('0xb4')));_0x27a7d4[_0x8319('0x7')]('/api/networks',require(_0x8319('0xb5')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xb6'),require('./api/chatQueueReport'));_0x27a7d4[_0x8319('0x7')]('/api/chat/internal/messages',require('./api/chatInternalMessage'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xb7'),require('./api/jscriptyAnswerReport'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xb8'),require('./api/jscriptyQuestionReport'));_0x27a7d4['use'](_0x8319('0xb9'),require('./api/jscriptySessionReport'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xba'),require(_0x8319('0xbb')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xbc'),require(_0x8319('0xbd')));_0x27a7d4[_0x8319('0x7')]('/api/square/details/reports',require(_0x8319('0xbe')));_0x27a7d4['use']('/api/jscripty/projects',require(_0x8319('0xbf')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xc0'),require(_0x8319('0xc1')));_0x27a7d4[_0x8319('0x7')]('/api/square/odbc',require(_0x8319('0xc2')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xc3'),require(_0x8319('0xc4')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xc5'),require(_0x8319('0xc6')));_0x27a7d4['use'](_0x8319('0xc7'),require('./api/squareMessage'));_0x27a7d4[_0x8319('0x7')]('/api/teams',require('./api/team'));_0x27a7d4[_0x8319('0x7')]('/api/license',require(_0x8319('0xc8')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xc9'),require(_0x8319('0xca')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xcb'),require('./api/migration'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xcc'),require(_0x8319('0xcd')));_0x27a7d4[_0x8319('0x7')]('/api/plugins',require(_0x8319('0xce')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xcf'),require(_0x8319('0xd0')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xd1'),require(_0x8319('0xd2')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xd3'),require(_0x8319('0xd4')));_0x27a7d4[_0x8319('0x7')]('/api/openchannel/reports/transfer',require(_0x8319('0xd5')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xd6'),require('./api/smsTransferReport'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xd7'),require(_0x8319('0xd8')));_0x27a7d4['use'](_0x8319('0xd9'),require(_0x8319('0xda')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xdb'),require('./api/userProfile'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xdc'),require(_0x8319('0xdd')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xde'),require('./api/userProfileResource'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xdf'),require(_0x8319('0xe0')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xe1'),require('./api/whatsappAccount'));_0x27a7d4[_0x8319('0x7')]('/api/whatsapp/applications',require(_0x8319('0xe2')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xe3'),require(_0x8319('0xe4')));_0x27a7d4['use'](_0x8319('0xe5'),require(_0x8319('0xe6')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xe7'),require(_0x8319('0xe8')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xe9'),require(_0x8319('0xea')));_0x27a7d4[_0x8319('0x7')]('/api/whatsapp/queues',require(_0x8319('0xeb')));_0x27a7d4[_0x8319('0x7')]('/api/cloudProviders',require('./api/cloudProvider'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xec'),require(_0x8319('0xed')));_0x27a7d4[_0x8319('0x7')]('/api/user-settings',require('./api/user-setting'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xee'),require(_0x8319('0xef')));_0x27a7d4['use'](_0x8319('0xf0'),require(_0x8319('0xf1')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xf2'),require(_0x8319('0xf3')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xf4'),require('./api/jira'));_0x27a7d4['use'](_0x8319('0xf5'),require('./api/rpc'));_0x27a7d4[_0x8319('0x7')](_0x8319('0xf6'),require(_0x8319('0xf7')));_0x27a7d4['use'](_0x8319('0xf8'),require(_0x8319('0xf9')));_0x27a7d4['use']('/api/pm2',require(_0x8319('0xfa')));_0x27a7d4[_0x8319('0x7')](_0x8319('0xfb'),require(_0x8319('0xfc')));_0x27a7d4[_0x8319('0x7')]('/api/logs',clientSideLogs);_0x27a7d4[_0x8319('0x7')]('/apidoc',express[_0x8319('0xfd')](path['join'](config[_0x8319('0xfe')],_0x8319('0xff'))));_0x27a7d4[_0x8319('0x7')]('/www',express['static'](path[_0x8319('0x100')](config[_0x8319('0xfe')],_0x8319('0x101'))));_0x27a7d4[_0x8319('0x7')](_0x8319('0x102'),express[_0x8319('0xfd')](path[_0x8319('0x100')](config[_0x8319('0xfe')],_0x8319('0x102'))));_0x27a7d4[_0x8319('0x7')]('/snippet',express[_0x8319('0xfd')](path['join'](config[_0x8319('0xfe')],_0x8319('0x103'),'3.1.0')));_0x27a7d4[_0x8319('0x7')]('/plugins',express[_0x8319('0xfd')](path[_0x8319('0x100')](config['root'],_0x8319('0x104'))));_0x27a7d4[_0x8319('0x105')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x8319('0x106')](errors[0x194]);_0x27a7d4['route']('/*')[_0x8319('0x106')](function(_0x5b96b7,_0x2155f5){_0x2155f5['sendFile'](path['resolve'](_0x27a7d4[_0x8319('0x106')](_0x8319('0x107'))+_0x8319('0x108')));});return _0x27a7d4;});}; \ No newline at end of file +var _0x2dfd=['./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/interval','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/google','./api/authActiveDirectory','/api/jira','./api/rpc','/api/version','./api/version','/api/pm2','./api/pm2','/api/logs','/apidoc','static','join','/www','root','/demo','/snippet','snippet','3.1.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','path','express','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x2dfd,0x10f));var _0xd2df=function(_0x199a78,_0x3108b7){_0x199a78=_0x199a78-0x0;var _0x28fecb=_0x2dfd[_0x199a78];return _0x28fecb;};'use strict';var path=require(_0xd2df('0x0'));var express=require(_0xd2df('0x1'));var errors=require('./errors');var config=require('./config/environment');var setupLoggers=require(_0xd2df('0x2'))[_0xd2df('0x3')];var clientSideLogs=require(_0xd2df('0x4'));exports[_0xd2df('0x5')]=function(_0x35b6b8){return setupLoggers(_0x35b6b8)[_0xd2df('0x6')](function(){_0x35b6b8[_0xd2df('0x7')]('/api/users',require(_0xd2df('0x8')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x9'),require(_0xd2df('0xa')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xb'),require(_0xd2df('0xc')));_0x35b6b8[_0xd2df('0x7')]('/api/voice/extensions',require(_0xd2df('0xd')));_0x35b6b8['use'](_0xd2df('0xe'),require('./api/voiceMusicOnHold'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xf'),require(_0xd2df('0x10')));_0x35b6b8['use'](_0xd2df('0x11'),require(_0xd2df('0x12')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x13'),require(_0xd2df('0x14')));_0x35b6b8[_0xd2df('0x7')]('/api/voice/mails',require(_0xd2df('0x15')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x16'),require('./api/voiceMailMessage'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x17'),require('./api/voiceCallReport'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x18'),require(_0xd2df('0x19')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x1a'),require(_0xd2df('0x1b')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x1c'),require(_0xd2df('0x1d')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x1e'),require(_0xd2df('0x1f')));_0x35b6b8['use'](_0xd2df('0x20'),require(_0xd2df('0x21')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x22'),require(_0xd2df('0x23')));_0x35b6b8['use'](_0xd2df('0x24'),require(_0xd2df('0x25')));_0x35b6b8['use'](_0xd2df('0x26'),require(_0xd2df('0x27')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x28'),require('./api/mailQueue'));_0x35b6b8['use'](_0xd2df('0x29'),require(_0xd2df('0x2a')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x2b'),require(_0xd2df('0x2c')));_0x35b6b8['use'](_0xd2df('0x2d'),require(_0xd2df('0x2e')));_0x35b6b8['use'](_0xd2df('0x2f'),require('./api/mailApplication'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x30'),require(_0xd2df('0x31')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x32'),require(_0xd2df('0x33')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x34'),require(_0xd2df('0x35')));_0x35b6b8[_0xd2df('0x7')]('/api/fax/accounts',require(_0xd2df('0x36')));_0x35b6b8['use']('/api/fax/applications',require(_0xd2df('0x37')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x38'),require(_0xd2df('0x39')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x3a'),require(_0xd2df('0x3b')));_0x35b6b8['use'](_0xd2df('0x3c'),require(_0xd2df('0x3d')));_0x35b6b8[_0xd2df('0x7')]('/api/fax/reports/queue',require(_0xd2df('0x3e')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x3f'),require(_0xd2df('0x40')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x41'),require(_0xd2df('0x42')));_0x35b6b8['use'](_0xd2df('0x43'),require(_0xd2df('0x44')));_0x35b6b8[_0xd2df('0x7')]('/api/sms/messages',require(_0xd2df('0x45')));_0x35b6b8['use'](_0xd2df('0x46'),require('./api/smsQueue'));_0x35b6b8[_0xd2df('0x7')]('/api/openchannel/accounts',require(_0xd2df('0x47')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x48'),require(_0xd2df('0x49')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x4a'),require('./api/openchannelInteraction'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x4b'),require(_0xd2df('0x4c')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x4d'),require(_0xd2df('0x4e')));_0x35b6b8['use'](_0xd2df('0x4f'),require('./api/chatWebsite'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x50'),require(_0xd2df('0x51')));_0x35b6b8[_0xd2df('0x7')]('/api/chat/applications',require(_0xd2df('0x52')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x53'),require('./api/chatInteraction'));_0x35b6b8[_0xd2df('0x7')]('/api/chat/messages',require('./api/chatMessage'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x54'),require(_0xd2df('0x55')));_0x35b6b8['use']('/api/chat/queues',require(_0xd2df('0x56')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x57'),require(_0xd2df('0x58')));_0x35b6b8[_0xd2df('0x7')]('/api/chat/proactive_actions',require(_0xd2df('0x59')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x5a'),require(_0xd2df('0x5b')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x5c'),require('./api/cmContact'));_0x35b6b8[_0xd2df('0x7')]('/api/cm/hopper',require(_0xd2df('0x5d')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x5e'),require(_0xd2df('0x5f')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x60'),require(_0xd2df('0x61')));_0x35b6b8['use'](_0xd2df('0x62'),require(_0xd2df('0x63')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x64'),require('./api/cmCustomField'));_0x35b6b8['use'](_0xd2df('0x65'),require(_0xd2df('0x66')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x67'),require(_0xd2df('0x68')));_0x35b6b8[_0xd2df('0x7')]('/api/canned_answers',require(_0xd2df('0x69')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x6a'),require(_0xd2df('0x6b')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x6c'),require('./api/condition'));_0x35b6b8[_0xd2df('0x7')]('/api/intervals',require(_0xd2df('0x6d')));_0x35b6b8['use']('/api/pauses',require(_0xd2df('0x6e')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x6f'),require(_0xd2df('0x70')));_0x35b6b8['use'](_0xd2df('0x71'),require(_0xd2df('0x72')));_0x35b6b8['use'](_0xd2df('0x73'),require(_0xd2df('0x74')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x75'),require(_0xd2df('0x76')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x77'),require(_0xd2df('0x78')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x79'),require('./api/contactItemType'));_0x35b6b8['use'](_0xd2df('0x7a'),require(_0xd2df('0x7b')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x7c'),require('./api/cmHopperAdditionalPhone'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x7d'),require(_0xd2df('0x7e')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x7f'),require(_0xd2df('0x80')));_0x35b6b8['use'](_0xd2df('0x81'),require(_0xd2df('0x82')));_0x35b6b8['use'](_0xd2df('0x83'),require(_0xd2df('0x84')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x85'),require(_0xd2df('0x86')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x87'),require('./api/analyticCustomReport'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x88'),require('./api/analyticDefaultReport'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x89'),require(_0xd2df('0x8a')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x8b'),require(_0xd2df('0x8c')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x8d'),require(_0xd2df('0x8e')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x8f'),require(_0xd2df('0x90')));_0x35b6b8['use']('/api/integrations/salesforce/accounts',require(_0xd2df('0x91')));_0x35b6b8['use'](_0xd2df('0x92'),require('./api/intSalesforceConfiguration'));_0x35b6b8[_0xd2df('0x7')]('/api/integrations/salesforce/fields',require(_0xd2df('0x93')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x94'),require(_0xd2df('0x95')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x96'),require(_0xd2df('0x97')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x98'),require('./api/intSugarcrmField'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x99'),require(_0xd2df('0x9a')));_0x35b6b8[_0xd2df('0x7')]('/api/integrations/desk/configurations',require(_0xd2df('0x9b')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x9c'),require(_0xd2df('0x9d')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x9e'),require(_0xd2df('0x9f')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xa0'),require(_0xd2df('0xa1')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xa2'),require(_0xd2df('0xa3')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xa4'),require(_0xd2df('0xa5')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xa6'),require(_0xd2df('0xa7')));_0x35b6b8[_0xd2df('0x7')]('/api/integrations/zendesk/fields',require(_0xd2df('0xa8')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xa9'),require(_0xd2df('0xaa')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xab'),require(_0xd2df('0xac')));_0x35b6b8[_0xd2df('0x7')]('/api/integrations/freshdesk/fields',require(_0xd2df('0xad')));_0x35b6b8['use'](_0xd2df('0xae'),require('./api/intVtigerAccount'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xaf'),require(_0xd2df('0xb0')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xb1'),require('./api/intVtigerField'));_0x35b6b8[_0xd2df('0x7')]('/api/integrations/servicenow/accounts',require(_0xd2df('0xb2')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xb3'),require(_0xd2df('0xb4')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xb5'),require(_0xd2df('0xb6')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xb7'),require('./api/intDynamics365Account'));_0x35b6b8['use']('/api/integrations/dynamics365/configurations',require(_0xd2df('0xb8')));_0x35b6b8['use']('/api/integrations/dynamics365/fields',require(_0xd2df('0xb9')));_0x35b6b8[_0xd2df('0x7')]('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x35b6b8['use'](_0xd2df('0xba'),require(_0xd2df('0xbb')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xbc'),require(_0xd2df('0xbd')));_0x35b6b8['use']('/api/networks',require('./api/network'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xbe'),require('./api/chatQueueReport'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xbf'),require(_0xd2df('0xc0')));_0x35b6b8[_0xd2df('0x7')]('/api/jscripty/answers/reports',require(_0xd2df('0xc1')));_0x35b6b8['use'](_0xd2df('0xc2'),require(_0xd2df('0xc3')));_0x35b6b8['use'](_0xd2df('0xc4'),require('./api/jscriptySessionReport'));_0x35b6b8[_0xd2df('0x7')]('/api/sms/reports/queue',require(_0xd2df('0xc5')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xc6'),require('./api/squareReport'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xc7'),require(_0xd2df('0xc8')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xc9'),require(_0xd2df('0xca')));_0x35b6b8['use']('/api/settings',require(_0xd2df('0xcb')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xcc'),require(_0xd2df('0xcd')));_0x35b6b8['use'](_0xd2df('0xce'),require(_0xd2df('0xcf')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xd0'),require(_0xd2df('0xd1')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xd2'),require(_0xd2df('0xd3')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xd4'),require(_0xd2df('0xd5')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xd6'),require('./api/license'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xd7'),require(_0xd2df('0xd8')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xd9'),require('./api/migration'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xda'),require(_0xd2df('0xdb')));_0x35b6b8['use'](_0xd2df('0xdc'),require(_0xd2df('0xdd')));_0x35b6b8['use'](_0xd2df('0xde'),require(_0xd2df('0xdf')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xe0'),require(_0xd2df('0xe1')));_0x35b6b8[_0xd2df('0x7')]('/api/fax/reports/transfer',require(_0xd2df('0xe2')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xe3'),require(_0xd2df('0xe4')));_0x35b6b8[_0xd2df('0x7')]('/api/sms/reports/transfer',require(_0xd2df('0xe5')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xe6'),require('./api/cmList'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xe7'),require('./api/voicePrefix'));_0x35b6b8['use']('/api/userProfiles',require(_0xd2df('0xe8')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xe9'),require('./api/userProfileSection'));_0x35b6b8['use'](_0xd2df('0xea'),require(_0xd2df('0xeb')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xec'),require(_0xd2df('0xed')));_0x35b6b8['use'](_0xd2df('0xee'),require(_0xd2df('0xef')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xf0'),require('./api/whatsappApplication'));_0x35b6b8[_0xd2df('0x7')]('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xf1'),require(_0xd2df('0xf2')));_0x35b6b8[_0xd2df('0x7')]('/api/whatsapp/reports/queue',require(_0xd2df('0xf3')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xf4'),require(_0xd2df('0xf5')));_0x35b6b8[_0xd2df('0x7')]('/api/whatsapp/queues',require(_0xd2df('0xf6')));_0x35b6b8['use'](_0xd2df('0xf7'),require(_0xd2df('0xf8')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xf9'),require(_0xd2df('0xfa')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xfb'),require(_0xd2df('0xfc')));_0x35b6b8[_0xd2df('0x7')]('/api/auth/local',require('./api/authLocal'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0xfd'),require('./api/authGoogle'));_0x35b6b8[_0xd2df('0x7')]('/api/auth/activedirectory',require(_0xd2df('0xfe')));_0x35b6b8['use'](_0xd2df('0xff'),require('./api/jira'));_0x35b6b8['use']('/api/rpc',require(_0xd2df('0x100')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x101'),require(_0xd2df('0x102')));_0x35b6b8[_0xd2df('0x7')]('/api/system',require('./api/system'));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x103'),require(_0xd2df('0x104')));_0x35b6b8['use']('/api/webbar',require('./api/webbar'));_0x35b6b8['use'](_0xd2df('0x105'),clientSideLogs);_0x35b6b8['use'](_0xd2df('0x106'),express[_0xd2df('0x107')](path[_0xd2df('0x108')](config['root'],'/apidoc')));_0x35b6b8[_0xd2df('0x7')](_0xd2df('0x109'),express['static'](path['join'](config[_0xd2df('0x10a')],'/www')));_0x35b6b8['use'](_0xd2df('0x10b'),express[_0xd2df('0x107')](path[_0xd2df('0x108')](config[_0xd2df('0x10a')],_0xd2df('0x10b'))));_0x35b6b8['use'](_0xd2df('0x10c'),express[_0xd2df('0x107')](path[_0xd2df('0x108')](config[_0xd2df('0x10a')],_0xd2df('0x10d'),_0xd2df('0x10e'))));_0x35b6b8['use'](_0xd2df('0x10f'),express[_0xd2df('0x107')](path[_0xd2df('0x108')](config[_0xd2df('0x10a')],_0xd2df('0x110'))));_0x35b6b8[_0xd2df('0x111')](_0xd2df('0x112'))[_0xd2df('0x113')](errors[0x194]);_0x35b6b8[_0xd2df('0x111')]('/*')[_0xd2df('0x113')](function(_0x4b78b7,_0x19715e){_0x19715e[_0xd2df('0x114')](path[_0xd2df('0x115')](_0x35b6b8['get'](_0xd2df('0x116'))+'/index.html'));});return _0x35b6b8;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index efd9205..aa38534 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xddd3=['../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.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/smsMessage/smsMessage.rpc'];(function(_0x3c735d,_0x375277){var _0xdf563b=function(_0x3439b1){while(--_0x3439b1){_0x3c735d['push'](_0x3c735d['shift']());}};_0xdf563b(++_0x375277);}(_0xddd3,0x1e8));var _0x3ddd=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xddd3[_0x6c993a];return _0x27f547;};'use strict';var jayson=require(_0x3ddd('0x0'));var _=require('lodash');var config=require('../config/environment');exports[_0x3ddd('0x1')]=function(){return new Promise(function(_0x1aff83,_0x309013){var _0x115ba0={};_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require('../api/user/user.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x3')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x4')));_0x115ba0=_['merge'](_0x115ba0,require(_0x3ddd('0x5')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x6')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x7')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x115ba0=_['merge'](_0x115ba0,require(_0x3ddd('0x8')));_0x115ba0=_['merge'](_0x115ba0,require(_0x3ddd('0x9')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require('../api/trunk/trunk.rpc'));_0x115ba0=_['merge'](_0x115ba0,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0xa')));_0x115ba0=_['merge'](_0x115ba0,require('../api/mailServerIn/mailServerIn.rpc'));_0x115ba0=_['merge'](_0x115ba0,require('../api/mailAccount/mailAccount.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0xb')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0xc')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0xd')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require('../api/mailApplication/mailApplication.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0xe')));_0x115ba0=_['merge'](_0x115ba0,require(_0x3ddd('0xf')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x10')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x11')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x12')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require('../api/faxQueue/faxQueue.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x13')));_0x115ba0=_['merge'](_0x115ba0,require(_0x3ddd('0x14')));_0x115ba0=_['merge'](_0x115ba0,require(_0x3ddd('0x15')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x16')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x17')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x18')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x19')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x1a')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x1b')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x1c')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require('../api/chatMessage/chatMessage.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x1d')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x1e')));_0x115ba0=_['merge'](_0x115ba0,require(_0x3ddd('0x1f')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x20')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x21')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x22')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x23')));_0x115ba0=_['merge'](_0x115ba0,require('../api/pause/pause.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x24')));_0x115ba0=_['merge'](_0x115ba0,require(_0x3ddd('0x25')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x26')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x27')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x28')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x29')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x2a')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x2b')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x2c')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x2d')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x2e')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x2f')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x30')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x31')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x32')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x33')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x34')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x35')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x36')));_0x115ba0=_['merge'](_0x115ba0,require('../api/squareOdbc/squareOdbc.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x37')));_0x115ba0=_['merge'](_0x115ba0,require(_0x3ddd('0x38')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x39')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require('../api/campaign/campaign.rpc'));_0x115ba0=_['merge'](_0x115ba0,require('../api/attachment/attachment.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require('../api/plugin/plugin.rpc'));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x3a')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x3b')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x3c')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x3d')));_0x115ba0=_[_0x3ddd('0x2')](_0x115ba0,require(_0x3ddd('0x3e')));var _0x3c4dac=jayson[_0x3ddd('0x3f')](_0x115ba0)[_0x3ddd('0x40')]();var _0x5a80ee=config[_0x3ddd('0x41')][_0x3ddd('0x42')]||config[_0x3ddd('0x42')]+0x1;var _0x72c3ee=config[_0x3ddd('0x41')]['ip']||_0x3ddd('0x43');_0x3c4dac['on'](_0x3ddd('0x44'),function(_0x4f421d){return _0x309013(_0x4f421d);});_0x3c4dac[_0x3ddd('0x1')](_0x5a80ee,_0x72c3ee,function(){console['log'](_0x3ddd('0x45'),_0x72c3ee,_0x5a80ee);require(_0x3ddd('0x46'))[_0x3ddd('0x47')]();return _0x1aff83(_0x3ddd('0x48')+_0x72c3ee+':'+_0x5a80ee);});});}; \ No newline at end of file +var _0x66a9=['../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','port','rpc','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc'];(function(_0xedacb5,_0x3d9f18){var _0x3f5427=function(_0x36753b){while(--_0x36753b){_0xedacb5['push'](_0xedacb5['shift']());}};_0x3f5427(++_0x3d9f18);}(_0x66a9,0x1a3));var _0x966a=function(_0x14a05c,_0x304800){_0x14a05c=_0x14a05c-0x0;var _0x4199e=_0x66a9[_0x14a05c];return _0x4199e;};'use strict';var jayson=require(_0x966a('0x0'));var _=require(_0x966a('0x1'));var config=require('../config/environment');exports[_0x966a('0x2')]=function(){return new Promise(function(_0x23f246,_0x51e636){var _0x4935b7={};_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x4')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x5')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x6')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x7')));_0x4935b7=_['merge'](_0x4935b7,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x8')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x9')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0xa')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0xb')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/trunk/trunk.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0xc')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0xd')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0xe')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0xf')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x10')));_0x4935b7=_['merge'](_0x4935b7,require('../api/mailInteraction/mailInteraction.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/mailMessage/mailMessage.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x11')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x12')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x13')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x14')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x15')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x16')));_0x4935b7=_['merge'](_0x4935b7,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/smsAccount/smsAccount.rpc'));_0x4935b7=_['merge'](_0x4935b7,require('../api/smsInteraction/smsInteraction.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/smsMessage/smsMessage.rpc'));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x17')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x18')));_0x4935b7=_['merge'](_0x4935b7,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x4935b7=_['merge'](_0x4935b7,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x19')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x1a')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x1b')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/cmContact/cmContact.rpc'));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x1c')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x1d')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x1e')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x1f')));_0x4935b7=_['merge'](_0x4935b7,require('../api/interval/interval.rpc'));_0x4935b7=_['merge'](_0x4935b7,require('../api/pause/pause.rpc'));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x20')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x21')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x22')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x23')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x24')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x25')));_0x4935b7=_['merge'](_0x4935b7,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x26')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x27')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x28')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x29')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x2a')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x2b')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x2c')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x2d')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/setting/setting.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x2e')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x2f')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/squareRecording/squareRecording.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x30')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x31')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/attachment/attachment.rpc'));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x32')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x33')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require(_0x966a('0x34')));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x35')));_0x4935b7=_[_0x966a('0x3')](_0x4935b7,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x4935b7=_['merge'](_0x4935b7,require(_0x966a('0x36')));var _0x4d9bfb=jayson[_0x966a('0x37')](_0x4935b7)[_0x966a('0x38')]();var _0x116a19=config['rpc'][_0x966a('0x39')]||config[_0x966a('0x39')]+0x1;var _0x2b3d83=config[_0x966a('0x3a')]['ip']||_0x966a('0x3b');_0x4d9bfb['on'](_0x966a('0x3c'),function(_0x4bca7f){return _0x51e636(_0x4bca7f);});_0x4d9bfb[_0x966a('0x2')](_0x116a19,_0x2b3d83,function(){console[_0x966a('0x3d')](_0x966a('0x3e'),_0x2b3d83,_0x116a19);require(_0x966a('0x3f'))[_0x966a('0x40')]();return _0x23f246(_0x966a('0x41')+_0x2b3d83+':'+_0x116a19);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 3f18dc8..3e071b1 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 _0x5b51=['BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','utf8','setEncoding','headers','ready','line','toLowerCase','hangup','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sendRequest','sync','answer','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav'];(function(_0x266632,_0x18f72e){var _0x3dec6a=function(_0x563ca3){while(--_0x563ca3){_0x266632['push'](_0x266632['shift']());}};_0x3dec6a(++_0x18f72e);}(_0x5b51,0xa2));var _0x15b5=function(_0x23c6f2,_0x4e033c){_0x23c6f2=_0x23c6f2-0x0;var _0x4c270b=_0x5b51[_0x23c6f2];return _0x4c270b;};'use strict';var util=require(_0x15b5('0x0'));var _=require(_0x15b5('0x1'));var EventEmitter=require(_0x15b5('0x2'))[_0x15b5('0x3')];var AGIReply=require(_0x15b5('0x4'));var AGIError=require('./error');function AGIChannel(_0x1b0d7e){var _0x2bcc79=this,_0x5581b7=new AGIReply(),_0x381dd6=![],_0x3654e0={};EventEmitter['call'](_0x2bcc79);_0x1b0d7e['setEncoding'](_0x15b5('0x5'));_0x1b0d7e['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x5581b7[_0x15b5('0x6')](_0x15b5('0x5'));_0x5581b7['on'](_0x15b5('0x7'),function(_0x445b20){for(var _0x269264 in _0x445b20){_0x2bcc79[_0x269264]=_0x445b20[_0x269264];}_0x2bcc79['emit'](_0x15b5('0x8'));});_0x5581b7['on'](_0x15b5('0x9'),function(_0x399f12){if(_0x399f12[_0x15b5('0xa')]()==_0x15b5('0xb')){_0x2bcc79[_0x15b5('0xc')]('hangup');return;}if(_0x399f12[_0x15b5('0xd')](0x0,0xb)==_0x15b5('0xe')){_0x381dd6=!![];}if(_0x381dd6){_0x3654e0['rx']+=_0x399f12+'\x0a';if(_0x399f12[_0x15b5('0xf')](_0x15b5('0x10'))!=-0x1){_0x381dd6=![];}}else{_0x3654e0['rx']=_0x399f12;}if(_0x381dd6){return;}if(typeof _0x3654e0['cb']==_0x15b5('0x11')){var _0x41738c=_0x3654e0['rx'][_0x15b5('0xd')](0x0,0x3),_0x820346=null,_0x210913=null;_0x41738c=parseInt(_0x41738c);if(isNaN(_0x41738c)){_0x3654e0['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x15b5('0x12')});return;}if(_0x41738c!=0xc8){_0x3654e0['cb'](null,{'code':_0x41738c,'result':-0x1,'extra':'KO'});return;}_0x820346=_0x3654e0['rx'][_0x15b5('0xd')](0x4)[_0x15b5('0x13')](_0x15b5('0x14'),'');if(_0x820346[_0x15b5('0x15')]('\x20')!=-0x1){_0x820346=_0x820346[_0x15b5('0x16')](0x0,_0x820346[_0x15b5('0x15')]('\x20'));}if(_[_0x15b5('0x17')](_0x820346,'-1')){_0x820346=parseInt(_0x820346);}_0x210913=_0x3654e0['rx'][_0x15b5('0x18')]('\x20');if(_0x210913[_0x15b5('0x19')]==0x3){_0x210913=_0x210913[0x2][_0x15b5('0xd')](0x1,_0x210913[0x2][_0x15b5('0x19')]-0x1);}else if(_0x210913['length']>0x3){var _0x2676f1=/\((.+)\)/;var _0x53e00e=_0x3654e0['rx'][_0x15b5('0x1a')](_0x2676f1);if(_0x53e00e){_0x210913=_0x53e00e[0x1];}else{_0x210913=null;}}else{_0x210913=null;}_0x3654e0['cb'](null,{'code':_0x41738c,'result':_0x820346,'extra':_0x210913});}});_0x1b0d7e['on'](_0x15b5('0x1b'),function(_0x8e32e2){_0x2bcc79[_0x15b5('0xc')](_0x15b5('0x1b'),new AGIError('E_AGI_SOCKET_ERROR',_0x8e32e2['code']));});_0x1b0d7e['on'](_0x15b5('0x1c'),function(){_0x2bcc79['emit']('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x1b0d7e['on'](_0x15b5('0x1d'),function(){_0x2bcc79[_0x15b5('0xc')]('timeout',new AGIError(_0x15b5('0x1e')));_0x1b0d7e[_0x15b5('0x1f')]();});_0x1b0d7e[_0x15b5('0x20')](_0x5581b7);this[_0x15b5('0x21')]=function(_0x1ffb9d,_0x72d80b){var _0x1ffb9d=_0x1ffb9d||'',_0x72d80b=typeof _0x72d80b==_0x15b5('0x11')?_0x72d80b:new Function();_0x3654e0={'tx':_0x1ffb9d,'rx':'','cb':_0x72d80b};_0x1b0d7e[_0x15b5('0x22')](_0x1ffb9d+'\x0a');},this['close']=function(){_0x1b0d7e['destroy']();};}util[_0x15b5('0x23')](AGIChannel,EventEmitter);AGIChannel[_0x15b5('0x24')][_0x15b5('0x25')]=function(_0x316176){return this[_0x15b5('0x21')][_0x15b5('0x26')](this,_0x316176);};AGIChannel[_0x15b5('0x24')][_0x15b5('0x27')]=function(){return this[_0x15b5('0x25')]('ANSWER');};AGIChannel[_0x15b5('0x24')][_0x15b5('0x28')]=function(_0x3fefe0,_0x5609bb,_0x2d2d19){_0x3fefe0=_0x3fefe0===undefined?_0x15b5('0x29'):_0x3fefe0;_0x5609bb=_0x5609bb===undefined?'5':_0x5609bb;_0x2d2d19=_0x2d2d19===undefined?'1':_0x2d2d19;return this[_0x15b5('0x25')](util[_0x15b5('0x2a')](_0x15b5('0x2b'),_0x3fefe0,_0x5609bb*0x3e8,_0x2d2d19));};AGIChannel[_0x15b5('0x24')][_0x15b5('0x2c')]=function(_0x384bb4){_0x384bb4=_0x384bb4||_0x15b5('0x2d');return this[_0x15b5('0x25')](util[_0x15b5('0x2a')](_0x15b5('0x2e'),_0x384bb4));};AGIChannel[_0x15b5('0x24')][_0x15b5('0x2f')]=function(_0x1b718d,_0x409d7f){if(_['isArray'](_0x409d7f)){return this['sendRequest'](util[_0x15b5('0x2a')](_0x15b5('0x30'),_0x1b718d,_0x409d7f[_0x15b5('0x31')](',')));}return this[_0x15b5('0x25')](util[_0x15b5('0x2a')](_0x15b5('0x30'),_0x1b718d,_0x409d7f));};AGIChannel['prototype'][_0x15b5('0x32')]=function(_0x31a2c8){return this[_0x15b5('0x25')](util['format'](_0x15b5('0x33'),_0x31a2c8));};AGIChannel[_0x15b5('0x24')][_0x15b5('0x34')]=function(_0x29bcd9){return this['sendRequest'](util['format'](_0x15b5('0x35'),_0x29bcd9));};AGIChannel[_0x15b5('0x24')][_0x15b5('0x36')]=function(_0x278fd3){return this[_0x15b5('0x25')](util[_0x15b5('0x2a')](_0x15b5('0x37'),_0x278fd3));};AGIChannel[_0x15b5('0x24')][_0x15b5('0xb')]=function(){return this['sendRequest']('HANGUP');};AGIChannel[_0x15b5('0x24')]['setVariable']=function(_0x428214,_0x1a8636){var _0x37ecc4=_[_0x15b5('0x38')](_0x1a8636)||_[_0x15b5('0x39')](_0x1a8636)?_0x1a8636[_0x15b5('0x3a')]():_0x1a8636;return this['sendRequest'](util[_0x15b5('0x2a')](_0x15b5('0x3b'),_0x428214,_0x37ecc4?_0x37ecc4[_0x15b5('0x3a')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x15b5('0x3c')]=function(_0x1bd786,_0x12037b){return this[_0x15b5('0x25')](util[_0x15b5('0x2a')](_0x15b5('0x3d'),_0x1bd786,_0x12037b));};AGIChannel[_0x15b5('0x24')][_0x15b5('0x3e')]=function(_0x3d269d,_0xc589cd){return this[_0x15b5('0x25')](util[_0x15b5('0x2a')]('SAY\x20DIGITS\x20%s\x20%s',_0x3d269d,_0xc589cd));};AGIChannel['prototype'][_0x15b5('0x3f')]=function(_0x3cc535,_0x199258){return this['sendRequest'](util[_0x15b5('0x2a')](_0x15b5('0x40'),_0x3cc535,_0x199258));};AGIChannel['prototype'][_0x15b5('0x41')]=function(_0x1d18af,_0x5b5436,_0x3085af){_0x5b5436=_0x5b5436||this[_0x15b5('0x42')];_0x3085af=_0x3085af||0x1;this[_0x15b5('0x32')](_0x1d18af);this[_0x15b5('0x34')](_0x5b5436);this[_0x15b5('0x36')](_0x3085af);return this['noop'](util['format'](_0x15b5('0x43'),_0x1d18af,_0x5b5436,_0x3085af));};AGIChannel[_0x15b5('0x24')][_0x15b5('0x44')]=function(_0x45876b){return this[_0x15b5('0x25')](util[_0x15b5('0x2a')](_0x15b5('0x45'),_0x45876b));};AGIChannel[_0x15b5('0x24')][_0x15b5('0x46')]=function(_0x72fcd1,_0x3e6f92,_0x408d09,_0x5d5ddb,_0x2182ef,_0x2f8135){_0x3e6f92=_0x3e6f92||_0x15b5('0x47');_0x408d09=_0x408d09||'';_0x5d5ddb=_0x5d5ddb===undefined?-0x1:_0x5d5ddb==='-1'?-0x1:_0x5d5ddb*0x3e8;_0x2182ef=_0x2182ef===undefined?'':'s='+_0x2182ef;_0x2f8135=_0x2f8135?_0x15b5('0x48'):'';return this['sendRequest'](util[_0x15b5('0x2a')](_0x15b5('0x49'),_0x72fcd1,_0x3e6f92,_0x408d09,_0x5d5ddb,_0x2f8135,_0x2182ef));};AGIChannel[_0x15b5('0x24')]['streamFile']=function(_0x195344,_0x3dd4bf){_0x3dd4bf=_0x3dd4bf||'';return this[_0x15b5('0x25')](util[_0x15b5('0x2a')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x195344,_0x3dd4bf));};AGIChannel[_0x15b5('0x24')]['agi']=function(_0x2e3750){return this[_0x15b5('0x2f')]('AGI',_0x2e3750);};AGIChannel['prototype']['wait']=function(_0xf9e969){return this['exec'](_0x15b5('0x4a'),_0xf9e969);};AGIChannel[_0x15b5('0x24')]['error']=function(_0xcec351,_0x8022a0){this[_0x15b5('0x2c')](util[_0x15b5('0x2a')](_0x15b5('0x4b'),_0xcec351['id'],_0xcec351[_0x15b5('0x4c')],_0x8022a0));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x15b5('0x4d')]=AGIChannel; \ No newline at end of file +var _0x73c5=['label','exports','lodash','events','EventEmitter','./reply','./error','call','utf8','headers','line','toLowerCase','hangup','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','indexOf','substr','startsWith','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','sendRequest','sync','prototype','ANSWER','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','join','setContext','format','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','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','setPriority','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x73c5,0x197));var _0x573c=function(_0x141cd4,_0x13b5f9){_0x141cd4=_0x141cd4-0x0;var _0x514038=_0x73c5[_0x141cd4];return _0x514038;};'use strict';var util=require('util');var _=require(_0x573c('0x0'));var EventEmitter=require(_0x573c('0x1'))[_0x573c('0x2')];var AGIReply=require(_0x573c('0x3'));var AGIError=require(_0x573c('0x4'));function AGIChannel(_0x1ac483){var _0x33425c=this,_0x198b29=new AGIReply(),_0x2410f8=![],_0x1d0159={};EventEmitter[_0x573c('0x5')](_0x33425c);_0x1ac483['setEncoding'](_0x573c('0x6'));_0x1ac483['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x198b29['setEncoding'](_0x573c('0x6'));_0x198b29['on'](_0x573c('0x7'),function(_0xfe74a6){for(var _0x2e5af2 in _0xfe74a6){_0x33425c[_0x2e5af2]=_0xfe74a6[_0x2e5af2];}_0x33425c['emit']('ready');});_0x198b29['on'](_0x573c('0x8'),function(_0x464467){if(_0x464467[_0x573c('0x9')]()==_0x573c('0xa')){_0x33425c[_0x573c('0xb')]('hangup');return;}if(_0x464467[_0x573c('0xc')](0x0,0xb)==_0x573c('0xd')){_0x2410f8=!![];}if(_0x2410f8){_0x1d0159['rx']+=_0x464467+'\x0a';if(_0x464467[_0x573c('0xe')](_0x573c('0xf'))!=-0x1){_0x2410f8=![];}}else{_0x1d0159['rx']=_0x464467;}if(_0x2410f8){return;}if(typeof _0x1d0159['cb']==_0x573c('0x10')){var _0x3209cd=_0x1d0159['rx']['substring'](0x0,0x3),_0x129ba4=null,_0x5cc2e4=null;_0x3209cd=parseInt(_0x3209cd);if(isNaN(_0x3209cd)){_0x1d0159['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x573c('0x11')});return;}if(_0x3209cd!=0xc8){_0x1d0159['cb'](null,{'code':_0x3209cd,'result':-0x1,'extra':'KO'});return;}_0x129ba4=_0x1d0159['rx'][_0x573c('0xc')](0x4)[_0x573c('0x12')]('result=','');if(_0x129ba4[_0x573c('0x13')]('\x20')!=-0x1){_0x129ba4=_0x129ba4[_0x573c('0x14')](0x0,_0x129ba4['indexOf']('\x20'));}if(_[_0x573c('0x15')](_0x129ba4,'-1')){_0x129ba4=parseInt(_0x129ba4);}_0x5cc2e4=_0x1d0159['rx']['split']('\x20');if(_0x5cc2e4['length']==0x3){_0x5cc2e4=_0x5cc2e4[0x2][_0x573c('0xc')](0x1,_0x5cc2e4[0x2][_0x573c('0x16')]-0x1);}else if(_0x5cc2e4[_0x573c('0x16')]>0x3){var _0x35a616=/\((.+)\)/;var _0x2f9aa9=_0x1d0159['rx'][_0x573c('0x17')](_0x35a616);if(_0x2f9aa9){_0x5cc2e4=_0x2f9aa9[0x1];}else{_0x5cc2e4=null;}}else{_0x5cc2e4=null;}_0x1d0159['cb'](null,{'code':_0x3209cd,'result':_0x129ba4,'extra':_0x5cc2e4});}});_0x1ac483['on'](_0x573c('0x18'),function(_0x2c2754){_0x33425c[_0x573c('0xb')](_0x573c('0x18'),new AGIError(_0x573c('0x19'),_0x2c2754[_0x573c('0x1a')]));});_0x1ac483['on'](_0x573c('0x1b'),function(){_0x33425c['emit'](_0x573c('0x1b'),new AGIError(_0x573c('0x1c')));});_0x1ac483['on'](_0x573c('0x1d'),function(){_0x33425c['emit'](_0x573c('0x1d'),new AGIError(_0x573c('0x1e')));_0x1ac483[_0x573c('0x1f')]();});_0x1ac483[_0x573c('0x20')](_0x198b29);this[_0x573c('0x21')]=function(_0x3a9ed6,_0x333cbf){var _0x3a9ed6=_0x3a9ed6||'',_0x333cbf=typeof _0x333cbf==_0x573c('0x10')?_0x333cbf:new Function();_0x1d0159={'tx':_0x3a9ed6,'rx':'','cb':_0x333cbf};_0x1ac483[_0x573c('0x22')](_0x3a9ed6+'\x0a');},this[_0x573c('0x1b')]=function(){_0x1ac483[_0x573c('0x1f')]();};}util[_0x573c('0x23')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x573c('0x24')]=function(_0x393d1e){return this['command'][_0x573c('0x25')](this,_0x393d1e);};AGIChannel[_0x573c('0x26')]['answer']=function(){return this[_0x573c('0x24')](_0x573c('0x27'));};AGIChannel[_0x573c('0x26')]['getData']=function(_0x33441c,_0x2beb78,_0x10f009){_0x33441c=_0x33441c===undefined?'beep':_0x33441c;_0x2beb78=_0x2beb78===undefined?'5':_0x2beb78;_0x10f009=_0x10f009===undefined?'1':_0x10f009;return this[_0x573c('0x24')](util['format'](_0x573c('0x28'),_0x33441c,_0x2beb78*0x3e8,_0x10f009));};AGIChannel[_0x573c('0x26')][_0x573c('0x29')]=function(_0x573a1b){_0x573a1b=_0x573a1b||_0x573c('0x2a');return this['sendRequest'](util['format'](_0x573c('0x2b'),_0x573a1b));};AGIChannel[_0x573c('0x26')]['exec']=function(_0x2cdc39,_0x34c97e){if(_[_0x573c('0x2c')](_0x34c97e)){return this[_0x573c('0x24')](util['format'](_0x573c('0x2d'),_0x2cdc39,_0x34c97e[_0x573c('0x2e')](',')));}return this[_0x573c('0x24')](util['format'](_0x573c('0x2d'),_0x2cdc39,_0x34c97e));};AGIChannel[_0x573c('0x26')][_0x573c('0x2f')]=function(_0x46d5d5){return this[_0x573c('0x24')](util[_0x573c('0x30')](_0x573c('0x31'),_0x46d5d5));};AGIChannel[_0x573c('0x26')][_0x573c('0x32')]=function(_0x2391e6){return this[_0x573c('0x24')](util[_0x573c('0x30')](_0x573c('0x33'),_0x2391e6));};AGIChannel[_0x573c('0x26')]['setPriority']=function(_0x5cb419){return this[_0x573c('0x24')](util[_0x573c('0x30')](_0x573c('0x34'),_0x5cb419));};AGIChannel[_0x573c('0x26')][_0x573c('0xa')]=function(){return this[_0x573c('0x24')](_0x573c('0x35'));};AGIChannel['prototype'][_0x573c('0x36')]=function(_0x2f89bd,_0x2dc65d){var _0x110b2a=_[_0x573c('0x37')](_0x2dc65d)||_[_0x573c('0x38')](_0x2dc65d)?_0x2dc65d[_0x573c('0x39')]():_0x2dc65d;return this[_0x573c('0x24')](util[_0x573c('0x30')](_0x573c('0x3a'),_0x2f89bd,_0x110b2a?_0x110b2a[_0x573c('0x39')]()[_0x573c('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x573c('0x26')][_0x573c('0x3b')]=function(_0xd53c17,_0x47cc79){return this[_0x573c('0x24')](util[_0x573c('0x30')](_0x573c('0x3c'),_0xd53c17,_0x47cc79));};AGIChannel[_0x573c('0x26')][_0x573c('0x3d')]=function(_0x4d9407,_0x46c19d){return this[_0x573c('0x24')](util['format'](_0x573c('0x3e'),_0x4d9407,_0x46c19d));};AGIChannel[_0x573c('0x26')][_0x573c('0x3f')]=function(_0x455b9d,_0x2dbcdd){return this[_0x573c('0x24')](util[_0x573c('0x30')](_0x573c('0x40'),_0x455b9d,_0x2dbcdd));};AGIChannel[_0x573c('0x26')][_0x573c('0x41')]=function(_0x5c4193,_0x482678,_0x18221d){_0x482678=_0x482678||this[_0x573c('0x42')];_0x18221d=_0x18221d||0x1;this['setContext'](_0x5c4193);this[_0x573c('0x32')](_0x482678);this[_0x573c('0x43')](_0x18221d);return this['noop'](util[_0x573c('0x30')]('GOTO\x20%s\x20%s\x20%s',_0x5c4193,_0x482678,_0x18221d));};AGIChannel[_0x573c('0x26')][_0x573c('0x44')]=function(_0x176504){return this['sendRequest'](util[_0x573c('0x30')](_0x573c('0x45'),_0x176504));};AGIChannel['prototype']['recordFile']=function(_0x465ddc,_0x5e6894,_0x2b61f7,_0x539015,_0x26310d,_0x2616db){_0x5e6894=_0x5e6894||_0x573c('0x46');_0x2b61f7=_0x2b61f7||'';_0x539015=_0x539015===undefined?-0x1:_0x539015==='-1'?-0x1:_0x539015*0x3e8;_0x26310d=_0x26310d===undefined?'':'s='+_0x26310d;_0x2616db=_0x2616db?_0x573c('0x47'):'';return this['sendRequest'](util['format'](_0x573c('0x48'),_0x465ddc,_0x5e6894,_0x2b61f7,_0x539015,_0x2616db,_0x26310d));};AGIChannel['prototype'][_0x573c('0x49')]=function(_0x34d594,_0x2df41f){_0x2df41f=_0x2df41f||'';return this[_0x573c('0x24')](util[_0x573c('0x30')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x34d594,_0x2df41f));};AGIChannel[_0x573c('0x26')]['agi']=function(_0x3f07f1){return this[_0x573c('0x4a')](_0x573c('0x4b'),_0x3f07f1);};AGIChannel['prototype'][_0x573c('0x4c')]=function(_0x126cc){return this['exec'](_0x573c('0x4d'),_0x126cc);};AGIChannel[_0x573c('0x26')]['error']=function(_0x3d8929,_0x56e986){this['noop'](util[_0x573c('0x30')](_0x573c('0x4e'),_0x3d8929['id'],_0x3d8929[_0x573c('0x4f')],_0x56e986));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x573c('0x50')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index ce8fab7..ffd5e73 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 _0x6343=['Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','push','apply','message','name','exports','util','Undefined\x20error.'];(function(_0x5ec343,_0x4567b5){var _0x2a47e4=function(_0xf8775d){while(--_0xf8775d){_0x5ec343['push'](_0x5ec343['shift']());}};_0x2a47e4(++_0x4567b5);}(_0x6343,0xde));var _0x3634=function(_0x492b3d,_0x1979d7){_0x492b3d=_0x492b3d-0x0;var _0x53870b=_0x6343[_0x492b3d];return _0x53870b;};'use strict';var util=require(_0x3634('0x0'));var error={'E_AGI_UNDEFINED':_0x3634('0x1'),'E_AGI_ARGUMENT_PORT':_0x3634('0x2'),'E_AGI_SERVER_ERROR':_0x3634('0x3'),'E_AGI_SERVER_CLOSE':_0x3634('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x3634('0x5'),'E_AGI_SOCKET_ERROR':_0x3634('0x6'),'E_AGI_SOCKET_CLOSE':_0x3634('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x3634('0x8'),'E_AGI_COMMAND_EMPTY':_0x3634('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x3634('0xa'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x48f6a0){var _0x48f6a0=_0x48f6a0||null,_0x4849fe=_0x4849fe||[],_0x3c0e49=0x1,_0x5a4514='';if(!error[_0x48f6a0]){_0x48f6a0='E_AGI_UNDEFINED';}_0x4849fe[_0x3634('0xb')](error[_0x48f6a0]);while(arguments[_0x3c0e49]){_0x4849fe[_0x3634('0xb')](arguments[_0x3c0e49]);_0x3c0e49++;}_0x5a4514=util['format'][_0x3634('0xc')](util,_0x4849fe);this[_0x3634('0xd')]=_0x5a4514;this[_0x3634('0xe')]=_0x48f6a0;}module[_0x3634('0xf')]=AGIError; \ No newline at end of file +var _0x309d=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','push','format','apply','message','name','exports','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.'];(function(_0x26a5d3,_0x1eac55){var _0x2fb09d=function(_0x55e2f9){while(--_0x55e2f9){_0x26a5d3['push'](_0x26a5d3['shift']());}};_0x2fb09d(++_0x1eac55);}(_0x309d,0xa6));var _0xd309=function(_0x397e1f,_0x3193f7){_0x397e1f=_0x397e1f-0x0;var _0x452db3=_0x309d[_0x397e1f];return _0x452db3;};'use strict';var util=require(_0xd309('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xd309('0x1'),'E_AGI_SERVER_ERROR':_0xd309('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xd309('0x3'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xd309('0x4'),'E_AGI_COMMAND_EMPTY':_0xd309('0x5'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xd309('0x6'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x23566b){var _0x23566b=_0x23566b||null,_0x414d48=_0x414d48||[],_0x233050=0x1,_0x2870f8='';if(!error[_0x23566b]){_0x23566b='E_AGI_UNDEFINED';}_0x414d48['push'](error[_0x23566b]);while(arguments[_0x233050]){_0x414d48[_0xd309('0x7')](arguments[_0x233050]);_0x233050++;}_0x2870f8=util[_0xd309('0x8')][_0xd309('0x9')](util,_0x414d48);this[_0xd309('0xa')]=_0x2870f8;this[_0xd309('0xb')]=_0x23566b;}module[_0xd309('0xc')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 8fcefea..1dec60c 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 _0x93c5=['localhost','agi','error','E_AGI_SERVER_ERROR','message','parse','emit','exports','lodash','events','EventEmitter','ioredis','./error','../../config/environment','redis'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0x93c5,0x71));var _0x593c=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x93c5[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0x593c('0x0'));var EventEmitter=require(_0x593c('0x1'))[_0x593c('0x2')];var Redis=require(_0x593c('0x3'));var AGIError=require(_0x593c('0x4'));var config=require(_0x593c('0x5'));config[_0x593c('0x6')]=_['defaults'](config[_0x593c('0x6')],{'host':_0x593c('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub['subscribe'](_0x593c('0x8'),function(_0x4a56e8){if(_0x4a56e8)return eventEmitter['emit'](_0x593c('0x9'),new AGIError(_0x593c('0xa'),_0x4a56e8));});sub['on'](_0x593c('0xb'),function(_0x1b4135,_0x283731){if(_0x1b4135!==_0x593c('0x8'))return;try{var _0x224b53=JSON[_0x593c('0xc')](_0x283731);eventEmitter[_0x593c('0xd')]('projectUpdate',_0x224b53);}catch(_0x202c26){eventEmitter[_0x593c('0xd')](_0x593c('0x9'),new AGIError(_0x593c('0xa'),_0x202c26));}});module[_0x593c('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x0473=['message','projectUpdate','exports','lodash','events','EventEmitter','ioredis','./error','../../config/environment','redis','defaults','subscribe','agi','emit','error'];(function(_0x31f216,_0x5ea0d3){var _0x4fcada=function(_0x56eb01){while(--_0x56eb01){_0x31f216['push'](_0x31f216['shift']());}};_0x4fcada(++_0x5ea0d3);}(_0x0473,0x6c));var _0x3047=function(_0x59d692,_0x637365){_0x59d692=_0x59d692-0x0;var _0x13316a=_0x0473[_0x59d692];return _0x13316a;};'use strict';var _=require(_0x3047('0x0'));var EventEmitter=require(_0x3047('0x1'))[_0x3047('0x2')];var Redis=require(_0x3047('0x3'));var AGIError=require(_0x3047('0x4'));var config=require(_0x3047('0x5'));config[_0x3047('0x6')]=_[_0x3047('0x7')](config[_0x3047('0x6')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x3047('0x6')]);sub[_0x3047('0x8')](_0x3047('0x9'),function(_0xaadea5){if(_0xaadea5)return eventEmitter[_0x3047('0xa')](_0x3047('0xb'),new AGIError('E_AGI_SERVER_ERROR',_0xaadea5));});sub['on'](_0x3047('0xc'),function(_0xae78a5,_0x477eec){if(_0xae78a5!==_0x3047('0x9'))return;try{var _0x8a35b2=JSON['parse'](_0x477eec);eventEmitter['emit'](_0x3047('0xd'),_0x8a35b2);}catch(_0x39ec2d){eventEmitter[_0x3047('0xa')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x39ec2d));}});module[_0x3047('0xe')]={'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 cb1dda7..4040b54 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 _0x3218=['vswitch','target','default','agicommand','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getsecretdigits','vertices','edges','numberOfEdges','addVertex','prototype','size','relations','traverseBFS','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3218,0x74));var _0x8321=function(_0x2e0443,_0x7e5974){_0x2e0443=_0x2e0443-0x0;var _0x52d450=_0x3218[_0x2e0443];return _0x52d450;};'use strict';var _=require(_0x8321('0x0'));var logger=require(_0x8321('0x1'))(_0x8321('0x2'));var verticesWithRetry=[_0x8321('0x3'),'getdigits',_0x8321('0x4')];var Graph=function(){this[_0x8321('0x5')]={};this[_0x8321('0x6')]={};this[_0x8321('0x7')]=0x0;};Graph['prototype'][_0x8321('0x8')]=function(_0x3b0364){this['vertices'][_0x3b0364['id']]=_0x3b0364;this[_0x8321('0x6')][_0x3b0364['id']]=[];};Graph[_0x8321('0x9')]['addEdge']=function(_0x4fd1b0,_0x4f89b5,_0x208dc1){this[_0x8321('0x6')][_0x4fd1b0]['push']({'target':_0x4f89b5,'condition':_0x208dc1});this[_0x8321('0x7')]+=0x1;};Graph[_0x8321('0x9')][_0x8321('0xa')]=function(){return _['size'](this[_0x8321('0x5')]);};Graph['prototype'][_0x8321('0xb')]=function(){return this[_0x8321('0x7')];};Graph[_0x8321('0x9')]['getVertex']=function(_0x3eb5db){return this[_0x8321('0x5')][_0x3eb5db];};Graph[_0x8321('0x9')][_0x8321('0xc')]=function(_0x5a516c,_0x1f999d){if(!this[_0x8321('0x5')][_0x5a516c]){return logger[_0x8321('0xd')]('no\x20vertex\x20found');}var _0xa0601d=_0x1f999d(this[_0x8321('0x5')][_0x5a516c]);if(!_0xa0601d){return logger[_0x8321('0xd')](_0x8321('0xe'));}if(this[_0x8321('0x6')][_0x5a516c][_0x8321('0xf')]===0x0){return logger[_0x8321('0xd')](_0x8321('0x10'));}for(var _0x2a6318=0x0,_0x244eef=[],_0x4dbd34=![];_0x2a6318\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','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','arg_1','close','timeout'];(function(_0x4292b9,_0x5c9b8f){var _0x3c3c79=function(_0xee6f3c){while(--_0xee6f3c){_0x4292b9['push'](_0x4292b9['shift']());}};_0x3c3c79(++_0x5c9b8f);}(_0xb8f8,0xd2));var _0x8b8f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xb8f8[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x8b8f('0x0'));var syncho=require('syncho');var util=require(_0x8b8f('0x1'));var config=require(_0x8b8f('0x2'));var logger=require('../../config/logger')(_0x8b8f('0x3'));var utilLicense=require('../../config/license/util');var rpc=require(_0x8b8f('0x4'));var Project=require('./project');var AGIEmitter=require('./events')['EventEmitter'];var projects=[];config[_0x8b8f('0x3')]=_[_0x8b8f('0x5')](config['agi'],{'ip':_0x8b8f('0x6'),'port':0x11dd});AGIEmitter['on'](_0x8b8f('0x7'),projectUpdateHandler);function connectionHandler(_0x1b2d6b){process[_0x8b8f('0x8')](function(){syncho(function(){try{setChannelVariables(_0x1b2d6b);agiHandler(_0x1b2d6b);}catch(_0x273e72){logger['error'](_0x273e72[_0x8b8f('0x9')]);}});});}function projectUpdateHandler(_0x55b963){try{var _0x6dfd50=_[_0x8b8f('0xa')](projects,['id',_0x55b963['id']]);if(_0x6dfd50>-0x1){if(_0x55b963[_0x8b8f('0xb')]===!![]){projects[_0x8b8f('0xc')](_0x6dfd50,0x1);}else{projects[_0x6dfd50]=_0x55b963;}}else{projects[_0x8b8f('0xd')](_0x55b963);}}catch(_0x40c639){logger[_0x8b8f('0xe')](_0x40c639['stack']);}}function listeningHandler(){console[_0x8b8f('0xf')](_0x8b8f('0x10'),config[_0x8b8f('0x3')]['port']);logger['info'](util[_0x8b8f('0x11')](_0x8b8f('0x12'),config[_0x8b8f('0x3')]['ip'],config[_0x8b8f('0x3')][_0x8b8f('0x13')]));}function errorHandler(_0x5e1c44){if(_0x5e1c44&&_0x5e1c44[_0x8b8f('0x14')]&&_0x5e1c44['message']){logger['error'](util[_0x8b8f('0x11')](_0x8b8f('0x15'),_0x5e1c44['name'],_0x5e1c44[_0x8b8f('0x16')]));}else{logger['error'](util['format'](_0x8b8f('0x17'),_0x5e1c44[_0x8b8f('0x9')]));}}function closeHandler(){logger[_0x8b8f('0x18')](util['format'](_0x8b8f('0x19'),this['arg_1'],this[_0x8b8f('0x1a')],this[_0x8b8f('0x1b')],this[_0x8b8f('0x1c')],this[_0x8b8f('0x1d')]));try{createSquareReport(this);}catch(_0x5ce341){logger['error'](_0x5ce341[_0x8b8f('0x9')]);}}function timeoutHandler(){logger[_0x8b8f('0x18')](util[_0x8b8f('0x11')](_0x8b8f('0x1e'),this['arg_1'],this[_0x8b8f('0x1a')],this[_0x8b8f('0x1b')],this['dnid'],this[_0x8b8f('0x1d')]));}function hangupHandler(){logger['info'](util[_0x8b8f('0x11')](_0x8b8f('0x1f'),this['arg_1'],this['calleridname'],this[_0x8b8f('0x1b')],this[_0x8b8f('0x1c')],this[_0x8b8f('0x1d')]));this[_0x8b8f('0x20')]=!![];}function createSquareReport(_0xbb88dc,_0x231610){rpc[_0x8b8f('0x21')](_0xbb88dc)[_0x8b8f('0x22')](function(_0x483248){if(_0x231610){_0x231610(null,_0x483248);}})['catch'](function(_0x5a917e){if(_0x231610){_0x231610(null,_0x5a917e);}});}function setChannelVariables(_0x19014e){for(var _0x32626d in _0x19014e){if(_0x19014e[_0x8b8f('0x23')](_0x32626d)){if(_0x32626d[_0x8b8f('0x24')](_0x8b8f('0x25'))===0x0){_0x19014e[_0x32626d[_0x8b8f('0x26')](0x4)]=_0x19014e[_0x32626d];delete _0x19014e[_0x32626d];}}}}function agiHandler(_0x2939d4){logger[_0x8b8f('0x27')](_0x8b8f('0x28'),JSON[_0x8b8f('0x29')](_0x2939d4,null,0x2));logger['info'](util[_0x8b8f('0x11')](_0x8b8f('0x2a'),_0x2939d4[_0x8b8f('0x2b')],_0x2939d4['calleridname'],_0x2939d4[_0x8b8f('0x1b')],_0x2939d4[_0x8b8f('0x1c')],_0x2939d4[_0x8b8f('0x1d')]));_0x2939d4['on'](_0x8b8f('0xe'),errorHandler);_0x2939d4['on'](_0x8b8f('0x2c'),closeHandler);_0x2939d4['on'](_0x8b8f('0x2d'),timeoutHandler);_0x2939d4[_0x8b8f('0x20')]=![];_0x2939d4['on'](_0x8b8f('0x2e'),hangupHandler);var _0x58efe8=_[_0x8b8f('0x2f')](projects,['name',_0x2939d4[_0x8b8f('0x2b')]]);if(!_0x58efe8)return Project[_0x8b8f('0x30')](_0x2939d4);if(!_0x58efe8[_0x8b8f('0x31')])return Project[_0x8b8f('0x32')](_0x2939d4);return Project['initialize'](_0x58efe8,_0x2939d4);}function main(){var _0x22f4d6;return utilLicense[_0x8b8f('0x33')]()[_0x8b8f('0x22')](function(_0x555fd9){if(!_0x555fd9)return;if(_0x555fd9[_0x8b8f('0x34')]){if(_0x555fd9[_0x8b8f('0x35')]&&_0x555fd9[_0x8b8f('0x35')]>0x0){logger[_0x8b8f('0x18')](util[_0x8b8f('0x11')](_0x8b8f('0x36'),_0x555fd9[_0x8b8f('0x35')]));_0x22f4d6=_0x555fd9['callysquare'];}else{logger[_0x8b8f('0x18')](_0x8b8f('0x37'));}}else{logger[_0x8b8f('0x18')](_0x8b8f('0x38'));_0x22f4d6=-0x1;}})['then'](function(){return Project[_0x8b8f('0x39')]();})[_0x8b8f('0x22')](function(_0x5c75ed){projects=_0x5c75ed;return;})[_0x8b8f('0x3a')](function(_0x2b40ef){logger[_0x8b8f('0xe')](_0x8b8f('0x3b'),_0x2b40ef[_0x8b8f('0x9')]);})[_0x8b8f('0x3c')](function(){var _0x4e6bbe=require(_0x8b8f('0x3d'))(config[_0x8b8f('0x3')][_0x8b8f('0x13')],config[_0x8b8f('0x3')]['ip'],_0x22f4d6);_0x4e6bbe['on'](_0x8b8f('0xe'),errorHandler);_0x4e6bbe['on'](_0x8b8f('0x3e'),listeningHandler);_0x4e6bbe['on'](_0x8b8f('0x3f'),connectionHandler);_0x4e6bbe['on'](_0x8b8f('0x2c'),closeHandler);});}main(); \ No newline at end of file +var _0x2e38=['../../config/environment','../../config/logger','agi','../../config/license/util','./project','EventEmitter','127.0.0.1','projectUpdate','nextTick','error','stack','findIndex','splice','log','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','evtHangup','createSquareReport','catch','hasOwnProperty','indexOf','agi_','substring','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','find','production','initialize','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','listening','connection','syncho'];(function(_0x16a3f7,_0x57babe){var _0x362bf2=function(_0x9c3788){while(--_0x9c3788){_0x16a3f7['push'](_0x16a3f7['shift']());}};_0x362bf2(++_0x57babe);}(_0x2e38,0x143));var _0x82e3=function(_0x819d68,_0x4acdb0){_0x819d68=_0x819d68-0x0;var _0x35ce88=_0x2e38[_0x819d68];return _0x35ce88;};'use strict';var _=require('lodash');var syncho=require(_0x82e3('0x0'));var util=require('util');var config=require(_0x82e3('0x1'));var logger=require(_0x82e3('0x2'))(_0x82e3('0x3'));var utilLicense=require(_0x82e3('0x4'));var rpc=require('./rpc');var Project=require(_0x82e3('0x5'));var AGIEmitter=require('./events')[_0x82e3('0x6')];var projects=[];config[_0x82e3('0x3')]=_['defaults'](config['agi'],{'ip':_0x82e3('0x7'),'port':0x11dd});AGIEmitter['on'](_0x82e3('0x8'),projectUpdateHandler);function connectionHandler(_0x113ece){process[_0x82e3('0x9')](function(){syncho(function(){try{setChannelVariables(_0x113ece);agiHandler(_0x113ece);}catch(_0x2678cf){logger[_0x82e3('0xa')](_0x2678cf[_0x82e3('0xb')]);}});});}function projectUpdateHandler(_0x494ee1){try{var _0x58e7a9=_[_0x82e3('0xc')](projects,['id',_0x494ee1['id']]);if(_0x58e7a9>-0x1){if(_0x494ee1['deleted']===!![]){projects[_0x82e3('0xd')](_0x58e7a9,0x1);}else{projects[_0x58e7a9]=_0x494ee1;}}else{projects['push'](_0x494ee1);}}catch(_0x3e40d6){logger['error'](_0x3e40d6[_0x82e3('0xb')]);}}function listeningHandler(){console[_0x82e3('0xe')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x82e3('0x3')][_0x82e3('0xf')]);logger['info'](util[_0x82e3('0x10')](_0x82e3('0x11'),config[_0x82e3('0x3')]['ip'],config[_0x82e3('0x3')][_0x82e3('0xf')]));}function errorHandler(_0x2de8c3){if(_0x2de8c3&&_0x2de8c3[_0x82e3('0x12')]&&_0x2de8c3[_0x82e3('0x13')]){logger[_0x82e3('0xa')](util[_0x82e3('0x10')](_0x82e3('0x14'),_0x2de8c3[_0x82e3('0x12')],_0x2de8c3[_0x82e3('0x13')]));}else{logger[_0x82e3('0xa')](util['format']('[ERROR]\x20%s',_0x2de8c3[_0x82e3('0xb')]));}}function closeHandler(){logger[_0x82e3('0x15')](util[_0x82e3('0x10')](_0x82e3('0x16'),this[_0x82e3('0x17')],this[_0x82e3('0x18')],this[_0x82e3('0x19')],this[_0x82e3('0x1a')],this[_0x82e3('0x1b')]));try{createSquareReport(this);}catch(_0x2993cc){logger[_0x82e3('0xa')](_0x2993cc[_0x82e3('0xb')]);}}function timeoutHandler(){logger['info'](util[_0x82e3('0x10')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x82e3('0x17')],this['calleridname'],this['callerid'],this[_0x82e3('0x1a')],this[_0x82e3('0x1b')]));}function hangupHandler(){logger['info'](util[_0x82e3('0x10')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x82e3('0x17')],this[_0x82e3('0x18')],this[_0x82e3('0x19')],this['dnid'],this[_0x82e3('0x1b')]));this[_0x82e3('0x1c')]=!![];}function createSquareReport(_0x4aa7fc,_0x113682){rpc[_0x82e3('0x1d')](_0x4aa7fc)['then'](function(_0x1841cd){if(_0x113682){_0x113682(null,_0x1841cd);}})[_0x82e3('0x1e')](function(_0x588c13){if(_0x113682){_0x113682(null,_0x588c13);}});}function setChannelVariables(_0x5786a1){for(var _0x404594 in _0x5786a1){if(_0x5786a1[_0x82e3('0x1f')](_0x404594)){if(_0x404594[_0x82e3('0x20')](_0x82e3('0x21'))===0x0){_0x5786a1[_0x404594[_0x82e3('0x22')](0x4)]=_0x5786a1[_0x404594];delete _0x5786a1[_0x404594];}}}}function agiHandler(_0x2c3e04){logger[_0x82e3('0x23')](_0x82e3('0x24'),JSON['stringify'](_0x2c3e04,null,0x2));logger[_0x82e3('0x15')](util['format'](_0x82e3('0x25'),_0x2c3e04[_0x82e3('0x17')],_0x2c3e04[_0x82e3('0x18')],_0x2c3e04['callerid'],_0x2c3e04[_0x82e3('0x1a')],_0x2c3e04[_0x82e3('0x1b')]));_0x2c3e04['on']('error',errorHandler);_0x2c3e04['on'](_0x82e3('0x26'),closeHandler);_0x2c3e04['on']('timeout',timeoutHandler);_0x2c3e04['evtHangup']=![];_0x2c3e04['on']('hangup',hangupHandler);var _0x39c4ef=_[_0x82e3('0x27')](projects,[_0x82e3('0x12'),_0x2c3e04[_0x82e3('0x17')]]);if(!_0x39c4ef)return Project['handleNotFound'](_0x2c3e04);if(!_0x39c4ef[_0x82e3('0x28')])return Project['handleUnpublished'](_0x2c3e04);return Project[_0x82e3('0x29')](_0x39c4ef,_0x2c3e04);}function main(){var _0x574e03;return utilLicense['getLicense']()[_0x82e3('0x2a')](function(_0x103272){if(!_0x103272)return;if(_0x103272[_0x82e3('0x2b')]){if(_0x103272[_0x82e3('0x2c')]&&_0x103272['callysquare']>0x0){logger['info'](util[_0x82e3('0x10')](_0x82e3('0x2d'),_0x103272[_0x82e3('0x2c')]));_0x574e03=_0x103272[_0x82e3('0x2c')];}else{logger[_0x82e3('0x15')](_0x82e3('0x2e'));}}else{logger[_0x82e3('0x15')](_0x82e3('0x2f'));_0x574e03=-0x1;}})[_0x82e3('0x2a')](function(){return Project[_0x82e3('0x30')]();})[_0x82e3('0x2a')](function(_0x121ab4){projects=_0x121ab4;return;})[_0x82e3('0x1e')](function(_0x3ad6a9){logger[_0x82e3('0xa')](_0x82e3('0x31'),_0x3ad6a9[_0x82e3('0xb')]);})[_0x82e3('0x32')](function(){var _0x15f554=require(_0x82e3('0x33'))(config[_0x82e3('0x3')][_0x82e3('0xf')],config[_0x82e3('0x3')]['ip'],_0x574e03);_0x15f554['on'](_0x82e3('0xa'),errorHandler);_0x15f554['on'](_0x82e3('0x34'),listeningHandler);_0x15f554['on'](_0x82e3('0x35'),connectionHandler);_0x15f554['on'](_0x82e3('0x26'),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 646c9a2..46d2a3a 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 _0xeadb=['error','message','catch','bluebird','jayson/promise','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeadb,0xa4));var _0xbead=function(_0xd726b,_0x354504){_0xd726b=_0xd726b-0x0;var _0x12a3bb=_0xeadb[_0xd726b];return _0x12a3bb;};'use strict';var BPromise=require(_0xbead('0x0'));var jayson=require(_0xbead('0x1'));var client=jayson['client'][_0xbead('0x2')]({'port':0x232b});function request(_0x15e436,_0x5691e4){return new BPromise(function(_0x5ec2c6,_0x217eaa){return client[_0xbead('0x3')](_0x15e436,_0x5691e4)['then'](function(_0x26e36f){if(_0x26e36f[_0xbead('0x4')]){return _0x217eaa(_0x26e36f[_0xbead('0x4')][_0xbead('0x5')]);}else{return _0x5ec2c6(_0x26e36f['result']);}})[_0xbead('0x6')](function(_0x2d21b9){return _0x217eaa(_0x2d21b9);});});}exports['sendMailMessage']=function(_0x27244e,_0x36c297){return request('SendMail',{'account':_0x27244e,'message':_0x36c297});}; \ No newline at end of file +var _0xde7d=['catch','sendMailMessage','jayson/promise','http','request','then','error','message'];(function(_0x110924,_0x1374bb){var _0x12905b=function(_0x47d32c){while(--_0x47d32c){_0x110924['push'](_0x110924['shift']());}};_0x12905b(++_0x1374bb);}(_0xde7d,0x1b2));var _0xdde7=function(_0x5b0be6,_0x1b7517){_0x5b0be6=_0x5b0be6-0x0;var _0x4587c8=_0xde7d[_0x5b0be6];return _0x4587c8;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xdde7('0x0'));var client=jayson['client'][_0xdde7('0x1')]({'port':0x232b});function request(_0x223c0d,_0x19a554){return new BPromise(function(_0x224c1e,_0x1c599f){return client[_0xdde7('0x2')](_0x223c0d,_0x19a554)[_0xdde7('0x3')](function(_0x1f225e){if(_0x1f225e['error']){return _0x1c599f(_0x1f225e[_0xdde7('0x4')][_0xdde7('0x5')]);}else{return _0x224c1e(_0x1f225e['result']);}})[_0xdde7('0x6')](function(_0x1f6064){return _0x1c599f(_0x1f6064);});});}exports[_0xdde7('0x7')]=function(_0x11a626,_0x3d97dc){return request('SendMail',{'account':_0x11a626,'message':_0x3d97dc});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 46a039c..e297667 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 _0xd4d6=['priority','response','code','isUndefined','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','exports','lodash','moment','util','../../config/logger','agi','./rpc','./mailRpc','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','root','inspect','production','start','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','uniqueid','traverseBFS','clear','vertex','agicommand','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension'];(function(_0x33f4bf,_0x47e924){var _0x828f1f=function(_0x5ef84b){while(--_0x5ef84b){_0x33f4bf['push'](_0x33f4bf['shift']());}};_0x828f1f(++_0x47e924);}(_0xd4d6,0x111));var _0x6d4d=function(_0x5937aa,_0x171bf8){_0x5937aa=_0x5937aa-0x0;var _0x490ad3=_0xd4d6[_0x5937aa];return _0x490ad3;};'use strict';var _=require(_0x6d4d('0x0'));var moment=require(_0x6d4d('0x1'));var parser=require('xml2json');var util=require(_0x6d4d('0x2'));var logger=require(_0x6d4d('0x3'))(_0x6d4d('0x4'));var rpc=require(_0x6d4d('0x5'));var mailRpc=require(_0x6d4d('0x6'));var Graph=require('./graph');var Vertices=require(_0x6d4d('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x6d4d('0x8')]()[_0x6d4d('0x9')](function(_0x1fe2a9){logger[_0x6d4d('0xa')](_0x6d4d('0xb'),_0x1fe2a9[_0x6d4d('0xc')]);return[];});}function addVertex(_0x1effa6,_0x39a298,_0x4bf87c){_0x39a298['agicommand']=_0x4bf87c;if(_0x39a298[_0x6d4d('0xd')](_0x6d4d('0xe'))){_0x39a298['maxRetry']=parseInt(_0x39a298['retry'],0xa);}_0x1effa6[_0x6d4d('0xf')](_[_0x6d4d('0x10')](_0x39a298,_0x6d4d('0x11')));}function initGraph(_0x1d3a72,_0x334ee6){var _0xf0d926=new Graph();for(var _0x4f1565 in _0x1d3a72){if(_0x1d3a72[_0x6d4d('0xd')](_0x4f1565)){if(_[_0x6d4d('0x12')](_0x1d3a72[_0x4f1565])){for(var _0x237bd8=0x0;_0x237bd8<_0x1d3a72[_0x4f1565][_0x6d4d('0x13')];_0x237bd8+=0x1){addVertex(_0xf0d926,_0x1d3a72[_0x4f1565][_0x237bd8],_0x4f1565);}}else{addVertex(_0xf0d926,_0x1d3a72[_0x4f1565],_0x4f1565);}}}for(var _0x36ecf1=0x0;_0x36ecf1<_0x334ee6[_0x6d4d('0x13')];_0x36ecf1+=0x1){if(_0x334ee6[_0x36ecf1][_0x6d4d('0x14')]&&_0x334ee6[_0x36ecf1][_0x6d4d('0x15')]){_0xf0d926[_0x6d4d('0x16')](_0x334ee6[_0x36ecf1][_0x6d4d('0x14')],_0x334ee6[_0x36ecf1][_0x6d4d('0x15')],_0x334ee6[_0x36ecf1][_0x6d4d('0x17')]);}}return _0xf0d926;}function getRoot(_0x1579cf){return parser[_0x6d4d('0x18')](_0x1579cf,{'object':!![]})[_0x6d4d('0x19')][_0x6d4d('0x1a')];}function inspect(_0x4a20de){return util[_0x6d4d('0x1b')](_0x4a20de,{'showHidden':![],'depth':null});}function initialize(_0x503d14,_0x5aca87){var _0x35942b=getRoot(_0x503d14[_0x6d4d('0x1c')]);if(!_0x35942b||!_0x35942b[_0x6d4d('0x1d')])return;var _0xa5c239,_0x2f0ad6,_0x34583f;logger[_0x6d4d('0x1e')](_0x6d4d('0x1a'),JSON[_0x6d4d('0x1f')](_0x35942b,null,0x2));_0x5aca87[_0x6d4d('0x20')]=moment()[_0x6d4d('0x21')](_0x6d4d('0x22'));_0xa5c239=initGraph(_[_0x6d4d('0x10')](_0x35942b,_0x6d4d('0x11')),_0x35942b[_0x6d4d('0x11')]);_0x2f0ad6=new Vertices(_0x5aca87,rpc,mailRpc);logger[_0x6d4d('0x23')](util['format'](_0x6d4d('0x24'),_0x5aca87[_0x6d4d('0x25')],_0x5aca87['calleridname'],_0x5aca87[_0x6d4d('0x26')],_0x5aca87['dnid'],_0x5aca87[_0x6d4d('0x27')]));_0xa5c239[_0x6d4d('0x28')](_0x35942b[_0x6d4d('0x1d')]['id'],function(_0x1b1461){try{_0x1b1461=_0x2f0ad6[_0x6d4d('0x29')](_0x1b1461);logger['debug'](_0x6d4d('0x2a'),JSON[_0x6d4d('0x1f')](_0x1b1461,null,0x2));if(_0x1b1461[_0x6d4d('0x2b')]==='gotoc'){logger[_0x6d4d('0x23')](_0x6d4d('0x2c'));_0x5aca87['context']=_0x1b1461[_0x6d4d('0x2d')]||_0x5aca87[_0x6d4d('0x2d')];_0x5aca87[_0x6d4d('0x2e')]=_0x1b1461[_0x6d4d('0x2e')];_0x5aca87[_0x6d4d('0x2f')]=_0x1b1461[_0x6d4d('0x2f')]?_0x1b1461[_0x6d4d('0x2f')]-0x1:0x1;return null;}else if(_0x1b1461&&_0x2f0ad6[_0x1b1461[_0x6d4d('0x2b')]]){_0x34583f=_0x2f0ad6[_0x1b1461[_0x6d4d('0x2b')]](_0x1b1461);logger[_0x6d4d('0x23')](_0x6d4d('0x30'),JSON[_0x6d4d('0x1f')](_0x34583f,null,0x2));if(_0x34583f&&_0x34583f[_0x6d4d('0x31')]===AGI_CODE_SUCCESS&&_0x34583f['result']!==AGI_RESULT_ERROR&&!_0x5aca87['evtHangup']){logger['debug'](_0x6d4d('0x30'),inspect(_0x34583f));return _[_0x6d4d('0x32')](_0x34583f[_0x6d4d('0x33')])?null:_0x34583f[_0x6d4d('0x33')][_0x6d4d('0x34')]();}else{logger[_0x6d4d('0xa')](_0x6d4d('0x30'),inspect(_0x34583f));return null;}}else{logger[_0x6d4d('0xa')](_0x6d4d('0x35'));return null;}}catch(_0x832bec){logger['error'](_0x832bec[_0x6d4d('0xc')]);return null;}});if(_0x35942b[_0x6d4d('0x36')]){logger[_0x6d4d('0x23')](util[_0x6d4d('0x21')](_0x6d4d('0x37'),_0x5aca87[_0x6d4d('0x25')],_0x5aca87['calleridname'],_0x5aca87[_0x6d4d('0x26')],_0x5aca87[_0x6d4d('0x38')],_0x5aca87[_0x6d4d('0x27')]));_0xa5c239[_0x6d4d('0x28')](_0x35942b[_0x6d4d('0x36')]['id'],function(_0x4e5611){try{_0x4e5611=_0x2f0ad6[_0x6d4d('0x29')](_0x4e5611);logger[_0x6d4d('0x1e')](_0x6d4d('0x2a'),JSON['stringify'](_0x4e5611,null,0x2));if(_0x4e5611&&_0x2f0ad6[_0x4e5611[_0x6d4d('0x2b')]]){_0x34583f=_0x2f0ad6[_0x4e5611['agicommand']](_0x4e5611);if(_0x34583f){logger['debug'](_0x6d4d('0x30'),inspect(_0x34583f));return _[_0x6d4d('0x32')](_0x34583f[_0x6d4d('0x33')])?null:_0x34583f[_0x6d4d('0x33')][_0x6d4d('0x34')]();}else{logger['error'](_0x6d4d('0x30'),inspect(_0x34583f));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x11b939){logger[_0x6d4d('0xa')](_0x11b939['stack']);return null;}});}logger['info'](util['format'](_0x6d4d('0x39'),_0x5aca87['arg_1'],_0x5aca87[_0x6d4d('0x3a')],_0x5aca87[_0x6d4d('0x26')],_0x5aca87[_0x6d4d('0x38')],_0x5aca87[_0x6d4d('0x27')]));logger['info'](util[_0x6d4d('0x21')](_0x6d4d('0x3b'),_0x5aca87[_0x6d4d('0x2d')],_0x5aca87[_0x6d4d('0x2e')],parseInt(_0x5aca87[_0x6d4d('0x2f')],0xa)+0x1));_0x5aca87[_0x6d4d('0x3c')](_0x5aca87[_0x6d4d('0x2d')],_0x5aca87[_0x6d4d('0x2e')],parseInt(_0x5aca87[_0x6d4d('0x2f')],0xa)+0x1);_0x5aca87[_0x6d4d('0x3d')]();}function handleNotFound(_0x40cb3e){logger[_0x6d4d('0xa')](util[_0x6d4d('0x21')]('Project\x20%s\x20not\x20found',_0x40cb3e[_0x6d4d('0x25')]));_0x40cb3e[_0x6d4d('0x3c')](_0x40cb3e['context'],_0x40cb3e[_0x6d4d('0x2e')],parseInt(_0x40cb3e[_0x6d4d('0x2f')],0xa)+0x1);_0x40cb3e['close']();}function handleUnpublished(_0x28f35a){logger['error'](util[_0x6d4d('0x21')](_0x6d4d('0x3e'),_0x28f35a[_0x6d4d('0x25')]));_0x28f35a['continueAt'](_0x28f35a[_0x6d4d('0x2d')],_0x28f35a[_0x6d4d('0x2e')],parseInt(_0x28f35a[_0x6d4d('0x2f')],0xa)+0x1);_0x28f35a[_0x6d4d('0x3d')]();}module[_0x6d4d('0x3f')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x7cd3=['maxRetry','addVertex','mxCell','length','source','addEdge','target','mxGraphModel','root','inspect','production','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','omit','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','traverseBFS','start','clear','vertex','gotoc','context','extension','priority','response','result','evtHangup','debug','error','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','isUndefined','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','xml2json','util','agi','./rpc','./graph','catch','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry'];(function(_0x304632,_0x5a3cb1){var _0x170cc3=function(_0x104f65){while(--_0x104f65){_0x304632['push'](_0x304632['shift']());}};_0x170cc3(++_0x5a3cb1);}(_0x7cd3,0x67));var _0x37cd=function(_0x25d3f4,_0x372757){_0x25d3f4=_0x25d3f4-0x0;var _0x16e7b3=_0x7cd3[_0x25d3f4];return _0x16e7b3;};'use strict';var _=require('lodash');var moment=require('moment');var parser=require(_0x37cd('0x0'));var util=require(_0x37cd('0x1'));var logger=require('../../config/logger')(_0x37cd('0x2'));var rpc=require(_0x37cd('0x3'));var mailRpc=require('./mailRpc');var Graph=require(_0x37cd('0x4'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0x37cd('0x5')](function(_0x1151d6){logger['error'](_0x37cd('0x6'),_0x1151d6[_0x37cd('0x7')]);return[];});}function addVertex(_0x70ea2,_0xffeb4,_0x52a309){_0xffeb4[_0x37cd('0x8')]=_0x52a309;if(_0xffeb4[_0x37cd('0x9')](_0x37cd('0xa'))){_0xffeb4[_0x37cd('0xb')]=parseInt(_0xffeb4[_0x37cd('0xa')],0xa);}_0x70ea2[_0x37cd('0xc')](_['omit'](_0xffeb4,_0x37cd('0xd')));}function initGraph(_0x19478c,_0x22e953){var _0x303d12=new Graph();for(var _0x111b14 in _0x19478c){if(_0x19478c[_0x37cd('0x9')](_0x111b14)){if(_['isArray'](_0x19478c[_0x111b14])){for(var _0x5830c8=0x0;_0x5830c8<_0x19478c[_0x111b14][_0x37cd('0xe')];_0x5830c8+=0x1){addVertex(_0x303d12,_0x19478c[_0x111b14][_0x5830c8],_0x111b14);}}else{addVertex(_0x303d12,_0x19478c[_0x111b14],_0x111b14);}}}for(var _0x513130=0x0;_0x513130<_0x22e953['length'];_0x513130+=0x1){if(_0x22e953[_0x513130][_0x37cd('0xf')]&&_0x22e953[_0x513130]['target']){_0x303d12[_0x37cd('0x10')](_0x22e953[_0x513130]['source'],_0x22e953[_0x513130][_0x37cd('0x11')],_0x22e953[_0x513130]['value']);}}return _0x303d12;}function getRoot(_0x95ade4){return parser['toJson'](_0x95ade4,{'object':!![]})[_0x37cd('0x12')][_0x37cd('0x13')];}function inspect(_0x5170b2){return util[_0x37cd('0x14')](_0x5170b2,{'showHidden':![],'depth':null});}function initialize(_0xbd5235,_0x2462f2){var _0x111f66=getRoot(_0xbd5235[_0x37cd('0x15')]);if(!_0x111f66||!_0x111f66['start'])return;var _0x23b9c6,_0x3f70ca,_0x5cfe7b;logger['debug']('root',JSON[_0x37cd('0x16')](_0x111f66,null,0x2));_0x2462f2[_0x37cd('0x17')]=moment()[_0x37cd('0x18')](_0x37cd('0x19'));_0x23b9c6=initGraph(_[_0x37cd('0x1a')](_0x111f66,'mxCell'),_0x111f66[_0x37cd('0xd')]);_0x3f70ca=new Vertices(_0x2462f2,rpc,mailRpc);logger[_0x37cd('0x1b')](util[_0x37cd('0x18')](_0x37cd('0x1c'),_0x2462f2[_0x37cd('0x1d')],_0x2462f2['calleridname'],_0x2462f2[_0x37cd('0x1e')],_0x2462f2[_0x37cd('0x1f')],_0x2462f2[_0x37cd('0x20')]));_0x23b9c6[_0x37cd('0x21')](_0x111f66[_0x37cd('0x22')]['id'],function(_0x5cd03f){try{_0x5cd03f=_0x3f70ca[_0x37cd('0x23')](_0x5cd03f);logger['debug'](_0x37cd('0x24'),JSON[_0x37cd('0x16')](_0x5cd03f,null,0x2));if(_0x5cd03f[_0x37cd('0x8')]===_0x37cd('0x25')){logger[_0x37cd('0x1b')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x2462f2[_0x37cd('0x26')]=_0x5cd03f[_0x37cd('0x26')]||_0x2462f2[_0x37cd('0x26')];_0x2462f2[_0x37cd('0x27')]=_0x5cd03f[_0x37cd('0x27')];_0x2462f2['priority']=_0x5cd03f['priority']?_0x5cd03f[_0x37cd('0x28')]-0x1:0x1;return null;}else if(_0x5cd03f&&_0x3f70ca[_0x5cd03f[_0x37cd('0x8')]]){_0x5cfe7b=_0x3f70ca[_0x5cd03f[_0x37cd('0x8')]](_0x5cd03f);logger['info'](_0x37cd('0x29'),JSON['stringify'](_0x5cfe7b,null,0x2));if(_0x5cfe7b&&_0x5cfe7b['code']===AGI_CODE_SUCCESS&&_0x5cfe7b[_0x37cd('0x2a')]!==AGI_RESULT_ERROR&&!_0x2462f2[_0x37cd('0x2b')]){logger[_0x37cd('0x2c')]('response',inspect(_0x5cfe7b));return _['isUndefined'](_0x5cfe7b['result'])?null:_0x5cfe7b[_0x37cd('0x2a')]['toString']();}else{logger['error'](_0x37cd('0x29'),inspect(_0x5cfe7b));return null;}}else{logger[_0x37cd('0x2d')](_0x37cd('0x2e'));return null;}}catch(_0x9e6754){logger[_0x37cd('0x2d')](_0x9e6754[_0x37cd('0x7')]);return null;}});if(_0x111f66['finally']){logger[_0x37cd('0x1b')](util[_0x37cd('0x18')](_0x37cd('0x2f'),_0x2462f2[_0x37cd('0x1d')],_0x2462f2[_0x37cd('0x30')],_0x2462f2['callerid'],_0x2462f2['dnid'],_0x2462f2[_0x37cd('0x20')]));_0x23b9c6[_0x37cd('0x21')](_0x111f66['finally']['id'],function(_0x5bb9ee){try{_0x5bb9ee=_0x3f70ca['clear'](_0x5bb9ee);logger[_0x37cd('0x2c')](_0x37cd('0x24'),JSON['stringify'](_0x5bb9ee,null,0x2));if(_0x5bb9ee&&_0x3f70ca[_0x5bb9ee[_0x37cd('0x8')]]){_0x5cfe7b=_0x3f70ca[_0x5bb9ee['agicommand']](_0x5bb9ee);if(_0x5cfe7b){logger[_0x37cd('0x2c')](_0x37cd('0x29'),inspect(_0x5cfe7b));return _[_0x37cd('0x31')](_0x5cfe7b[_0x37cd('0x2a')])?null:_0x5cfe7b['result'][_0x37cd('0x32')]();}else{logger[_0x37cd('0x2d')]('response',inspect(_0x5cfe7b));return null;}}else{logger[_0x37cd('0x2d')](_0x37cd('0x2e'));return null;}}catch(_0x48d731){logger[_0x37cd('0x2d')](_0x48d731['stack']);return null;}});}logger[_0x37cd('0x1b')](util[_0x37cd('0x18')](_0x37cd('0x33'),_0x2462f2[_0x37cd('0x1d')],_0x2462f2['calleridname'],_0x2462f2['callerid'],_0x2462f2[_0x37cd('0x1f')],_0x2462f2['uniqueid']));logger['info'](util[_0x37cd('0x18')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x2462f2['context'],_0x2462f2[_0x37cd('0x27')],parseInt(_0x2462f2[_0x37cd('0x28')],0xa)+0x1));_0x2462f2[_0x37cd('0x34')](_0x2462f2[_0x37cd('0x26')],_0x2462f2[_0x37cd('0x27')],parseInt(_0x2462f2[_0x37cd('0x28')],0xa)+0x1);_0x2462f2[_0x37cd('0x35')]();}function handleNotFound(_0x22800e){logger[_0x37cd('0x2d')](util['format'](_0x37cd('0x36'),_0x22800e['arg_1']));_0x22800e[_0x37cd('0x34')](_0x22800e[_0x37cd('0x26')],_0x22800e['extension'],parseInt(_0x22800e[_0x37cd('0x28')],0xa)+0x1);_0x22800e['close']();}function handleUnpublished(_0x55f60c){logger[_0x37cd('0x2d')](util[_0x37cd('0x18')](_0x37cd('0x37'),_0x55f60c[_0x37cd('0x1d')]));_0x55f60c[_0x37cd('0x34')](_0x55f60c['context'],_0x55f60c[_0x37cd('0x27')],parseInt(_0x55f60c[_0x37cd('0x28')],0xa)+0x1);_0x55f60c[_0x37cd('0x35')]();}module[_0x37cd('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 90ab18f..10baa53 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 _0x928c=['indexOf','substring','slice','trim','length','emit','headers','line','exports','Transform','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString'];(function(_0x1e6902,_0x322881){var _0x3331d1=function(_0x528a2a){while(--_0x528a2a){_0x1e6902['push'](_0x1e6902['shift']());}};_0x3331d1(++_0x322881);}(_0x928c,0x17f));var _0xc928=function(_0x5ae29b,_0x20e940){_0x5ae29b=_0x5ae29b-0x0;var _0x257a06=_0x928c[_0x5ae29b];return _0x257a06;};'use strict';var util=require('util');var Transform=require('stream')[_0xc928('0x0')];function AGIReply(_0x191eb2){Transform['call'](this,_0x191eb2);this[_0xc928('0x1')]='';this[_0xc928('0x2')]=![];}util[_0xc928('0x3')](AGIReply,Transform);AGIReply[_0xc928('0x4')][_0xc928('0x5')]=function(_0x55f9b5,_0x3c7369,_0x4704bc){var _0x8c0fa5='\x0a',_0x4ff9e6=['\x0a\x0a',_0xc928('0x6')],_0x4fd2a0=-0x1,_0x5e433b=-0x1,_0x445248='',_0x4270ab=0x0,_0x6b7b61='',_0x2cd1ce='';this[_0xc928('0x1')]+=_0x55f9b5[_0xc928('0x7')]();_0x6b7b61=this[_0xc928('0x1')];if(!this['_inBody']){_0x4270ab=0x0;while(_0x4ff9e6[_0x4270ab]){while((_0x5e433b=_0x6b7b61[_0xc928('0x8')](_0x4ff9e6[_0x4270ab]))!=-0x1){_0x445248=_0x4ff9e6[_0x4270ab];_0x2cd1ce=_0x6b7b61[_0xc928('0x9')](0x0,_0x5e433b);_0x6b7b61=_0x6b7b61['substring'](_0x5e433b+_0x445248['length']);var _0x6bfbd3=_0x2cd1ce['split'](_0x8c0fa5),_0x516f3f=0x0,_0xfd6754={},_0x4fe512='',_0x425750='',_0x2e3a6f=-0x1;while(_0x6bfbd3[_0x516f3f]){_0x2e3a6f=_0x6bfbd3[_0x516f3f][_0xc928('0x8')](':');if(_0x2e3a6f!=-0x1){_0x4fe512=_0x6bfbd3[_0x516f3f][_0xc928('0xa')](0x0,_0x2e3a6f)['trim']();_0x425750=_0x6bfbd3[_0x516f3f][_0xc928('0xa')](_0x2e3a6f+0x1)[_0xc928('0xb')]();if(_0x4fe512[_0xc928('0xc')]>0x0){_0xfd6754[_0x4fe512]=_0x425750;}}else{}_0x516f3f++;}this[_0xc928('0xd')](_0xc928('0xe'),_0xfd6754);this[_0xc928('0x2')]=!![];}_0x4270ab++;}this['_localBuffer']=_0x6b7b61;}else{while((_0x4fd2a0=_0x6b7b61[_0xc928('0x8')](_0x8c0fa5))!=-0x1){_0x2cd1ce=_0x6b7b61[_0xc928('0x9')](0x0,_0x4fd2a0);this[_0xc928('0xd')](_0xc928('0xf'),_0x2cd1ce);_0x6b7b61=_0x6b7b61[_0xc928('0x9')](_0x4fd2a0+_0x8c0fa5[_0xc928('0xc')]);}this[_0xc928('0x1')]=_0x6b7b61;}_0x4704bc();};module[_0xc928('0x10')]=AGIReply; \ No newline at end of file +var _0xa4f3=['Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','toString','substring','length','split','indexOf','slice','trim','exports','stream'];(function(_0x3d0276,_0x4f9026){var _0x1d5139=function(_0x579ea6){while(--_0x579ea6){_0x3d0276['push'](_0x3d0276['shift']());}};_0x1d5139(++_0x4f9026);}(_0xa4f3,0x10f));var _0x3a4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa4f3[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var Transform=require(_0x3a4f('0x0'))[_0x3a4f('0x1')];function AGIReply(_0x34f8e8){Transform[_0x3a4f('0x2')](this,_0x34f8e8);this[_0x3a4f('0x3')]='';this[_0x3a4f('0x4')]=![];}util[_0x3a4f('0x5')](AGIReply,Transform);AGIReply[_0x3a4f('0x6')][_0x3a4f('0x7')]=function(_0x128c87,_0x530926,_0x1d8206){var _0xe297f1='\x0a',_0x279824=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x2235e7=-0x1,_0x18eec7=-0x1,_0x470ce='',_0x3d12d9=0x0,_0x75acbd='',_0x1dcab3='';this[_0x3a4f('0x3')]+=_0x128c87[_0x3a4f('0x8')]();_0x75acbd=this[_0x3a4f('0x3')];if(!this[_0x3a4f('0x4')]){_0x3d12d9=0x0;while(_0x279824[_0x3d12d9]){while((_0x18eec7=_0x75acbd['indexOf'](_0x279824[_0x3d12d9]))!=-0x1){_0x470ce=_0x279824[_0x3d12d9];_0x1dcab3=_0x75acbd['substring'](0x0,_0x18eec7);_0x75acbd=_0x75acbd[_0x3a4f('0x9')](_0x18eec7+_0x470ce[_0x3a4f('0xa')]);var _0x36d102=_0x1dcab3[_0x3a4f('0xb')](_0xe297f1),_0x3e8014=0x0,_0x55a92d={},_0x60d653='',_0x575edd='',_0x3b4294=-0x1;while(_0x36d102[_0x3e8014]){_0x3b4294=_0x36d102[_0x3e8014][_0x3a4f('0xc')](':');if(_0x3b4294!=-0x1){_0x60d653=_0x36d102[_0x3e8014][_0x3a4f('0xd')](0x0,_0x3b4294)[_0x3a4f('0xe')]();_0x575edd=_0x36d102[_0x3e8014][_0x3a4f('0xd')](_0x3b4294+0x1)[_0x3a4f('0xe')]();if(_0x60d653[_0x3a4f('0xa')]>0x0){_0x55a92d[_0x60d653]=_0x575edd;}}else{}_0x3e8014++;}this['emit']('headers',_0x55a92d);this[_0x3a4f('0x4')]=!![];}_0x3d12d9++;}this[_0x3a4f('0x3')]=_0x75acbd;}else{while((_0x2235e7=_0x75acbd[_0x3a4f('0xc')](_0xe297f1))!=-0x1){_0x1dcab3=_0x75acbd['substring'](0x0,_0x2235e7);this['emit']('line',_0x1dcab3);_0x75acbd=_0x75acbd[_0x3a4f('0x9')](_0x2235e7+_0xe297f1[_0x3a4f('0xa')]);}this['_localBuffer']=_0x75acbd;}_0x1d8206();};module[_0x3a4f('0xf')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index a7ee190..6c39ceb 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 _0x581a=['ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','LogoutUser','lodash','moment','client','http','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','dsn','getUserById','ShowUser','getContactByPhone','phone','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById'];(function(_0xa4bf8a,_0x1dc97c){var _0x535b9b=function(_0x537866){while(--_0x537866){_0xa4bf8a['push'](_0xa4bf8a['shift']());}};_0x535b9b(++_0x1dc97c);}(_0x581a,0x127));var _0xa581=function(_0x5a6e4b,_0x5ae28c){_0x5a6e4b=_0x5a6e4b-0x0;var _0x2e42ca=_0x581a[_0x5a6e4b];return _0x2e42ca;};'use strict';var _=require(_0xa581('0x0'));var moment=require(_0xa581('0x1'));var jayson=require('jayson/promise');var client=jayson[_0xa581('0x2')][_0xa581('0x3')]({'port':0x2329});function request(_0xbe2ff0,_0x22d913){return new Promise(function(_0x3f5c21,_0x4e64cc){return client['request'](_0xbe2ff0,_0x22d913)[_0xa581('0x4')](function(_0x510f40){if(_0x510f40[_0xa581('0x5')]){return _0x4e64cc(_0x510f40[_0xa581('0x5')][_0xa581('0x6')]);}else{return _0x3f5c21(_0x510f40[_0xa581('0x7')]);}})[_0xa581('0x8')](function(_0x1875a5){return _0x4e64cc(_0x1875a5);});});}exports[_0xa581('0x9')]=function(){return request(_0xa581('0xa'),{'options':{'raw':![],'attributes':['id',_0xa581('0xb'),_0xa581('0xc')]}});};exports[_0xa581('0xd')]=function(_0x59edee){return request(_0xa581('0xe'),{'options':{'raw':![],'where':{'name':_0x59edee},'attributes':[_0xa581('0xc')]}});};exports[_0xa581('0xf')]=function(_0x5034a2){return request(_0xa581('0x10'),{'options':{'raw':![],'where':{'id':_0x5034a2},'include':[{'model':_0xa581('0x11'),'as':_0xa581('0x12'),'include':[{'model':'CloudProvider','as':_0xa581('0x13')}]}],'attributes':['id',_0xa581('0xb'),_0xa581('0x14')],'smtp':!![]}});};exports[_0xa581('0x15')]=function(_0x202296){return request('ShowSquareProject',{'options':{'where':{'id':_0x202296},'attributes':[_0xa581('0xb')]}});};exports[_0xa581('0x16')]=function(_0x23b205){return request(_0xa581('0x17'),{'options':{'where':{'id':_0x23b205},'attributes':['name']}});};exports['getVariableById']=function(_0x57d86e){return request(_0xa581('0x18'),{'options':{'where':{'id':_0x57d86e},'attributes':[_0xa581('0xb')]}});};exports[_0xa581('0x19')]=function(_0xf6f762){return request('ShowSquareOdbc',{'options':{'where':{'id':_0xf6f762},'attributes':[_0xa581('0x1a')]}});};exports[_0xa581('0x1b')]=function(_0x1bebe0){return request(_0xa581('0x1c'),{'options':{'where':{'id':_0x1bebe0},'attributes':[_0xa581('0xb')]}});};exports[_0xa581('0x1d')]=function(_0x547074){return request('GetContactByPhone',{'options':{'where':{'phone':_0x547074[_0xa581('0x1e')]},'attributes':['id']}});};exports[_0xa581('0x1f')]=function(_0x2a789a){return request('ShowTrunk',{'options':{'where':{'id':_0x2a789a},'attributes':[_0xa581('0xb')]}});};exports[_0xa581('0x20')]=function(_0x13c4bc){return request(_0xa581('0x21'),{'options':{'where':{'id':_0x13c4bc},'attributes':[_0xa581('0x22')]}});};exports[_0xa581('0x23')]=function(_0x256e26){return request(_0xa581('0x24'),{'options':{'raw':![],'where':{'id':_0x256e26},'include':[{'model':_0xa581('0x25'),'as':_0xa581('0x26')}]}});};exports[_0xa581('0x27')]=function(_0x4706d0){return request(_0xa581('0x28'),{'options':{'where':{'id':_0x4706d0},'attributes':['id','name']}});};exports[_0xa581('0x29')]=function(_0x44fa06){return request(_0xa581('0x2a'),{'body':_0x44fa06});};exports[_0xa581('0x2b')]=function(_0x460d1e){return request(_0xa581('0x2c'),{'body':_0x460d1e});};exports[_0xa581('0x2d')]=function(_0x2207b7){return request(_0xa581('0x2e'),{'body':_[_0xa581('0x2f')](_0x2207b7,{'project_name':_0x2207b7[_0xa581('0x30')],'prev_project_name':_0x2207b7[_0xa581('0x31')]||'','is_subproject':_0x2207b7[_0xa581('0x31')]?!![]:![],'leaveAt':moment()[_0xa581('0x32')](_0xa581('0x33'))})});};exports[_0xa581('0x34')]=function(_0x49fd7b){return request(_0xa581('0x35'),{'body':_0x49fd7b});};exports[_0xa581('0x36')]=function(_0x32388a){return request('CreateSquareMessage',{'body':_0x32388a});};exports[_0xa581('0x37')]=function(_0x1d585b){return request(_0xa581('0x38'),{'options':{'raw':![],'where':{'phone':_0x1d585b[_0xa581('0x1e')],'ListId':_0x1d585b[_0xa581('0x39')]}}})['then'](function(_0x46243b){if(_0x46243b){return _0x46243b;}return request('CreateCmContact',{'body':_0x1d585b});});};exports[_0xa581('0x3a')]=function(_0x54f8db){return request(_0xa581('0x3b'),{'options':{'where':{'id':_0x54f8db},'attributes':[_0xa581('0xb')]}});};exports[_0xa581('0x3c')]=function(_0x329b2e,_0x597b98){return request(_0xa581('0x3d'),{'body':{'interface':_0x597b98},'options':{'where':_0x329b2e}});};exports[_0xa581('0x3e')]=function(_0x2f06c4,_0x5e047a,_0x3b9653){return request(_0xa581('0x3f'),{'body':{'type':_0x5e047a,'uniqueid':_0x3b9653},'options':{'where':_0x2f06c4}});};exports[_0xa581('0x40')]=function(_0x19ea24){return request(_0xa581('0x41'),{'body':{},'options':{'where':_0x19ea24}});};exports['agentLogout']=function(_0x24ec46){return request(_0xa581('0x42'),{'body':{},'options':{'where':_0x24ec46}});}; \ No newline at end of file +var _0x5395=['getMailAccountById','ShowMailAccount','Smtp','CloudProvider','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','GetContactByPhone','getTrunkById','ShowTrunk','getSoundById','save_name','ShowInterval','Interval','Intervals','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','createCmContact','phone','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','PauseUser','UnpauseUser','agentLogout','LogoutUser','lodash','jayson/promise','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production'];(function(_0x58c333,_0x3a9060){var _0x8bcfc=function(_0x33b317){while(--_0x33b317){_0x58c333['push'](_0x58c333['shift']());}};_0x8bcfc(++_0x3a9060);}(_0x5395,0x150));var _0x5539=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x5395[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x5539('0x0'));var moment=require('moment');var jayson=require(_0x5539('0x1'));var client=jayson['client']['http']({'port':0x2329});function request(_0xa713ee,_0x2d8e1c){return new Promise(function(_0x2d24c7,_0x4cd571){return client[_0x5539('0x2')](_0xa713ee,_0x2d8e1c)[_0x5539('0x3')](function(_0x12052b){if(_0x12052b[_0x5539('0x4')]){return _0x4cd571(_0x12052b[_0x5539('0x4')][_0x5539('0x5')]);}else{return _0x2d24c7(_0x12052b[_0x5539('0x6')]);}})[_0x5539('0x7')](function(_0x56b645){return _0x4cd571(_0x56b645);});});}exports[_0x5539('0x8')]=function(){return request(_0x5539('0x9'),{'options':{'raw':![],'attributes':['id',_0x5539('0xa'),_0x5539('0xb')]}});};exports['getSquareProject']=function(_0x5513f6){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x5513f6},'attributes':['production']}});};exports[_0x5539('0xc')]=function(_0x5867ed){return request(_0x5539('0xd'),{'options':{'raw':![],'where':{'id':_0x5867ed},'include':[{'model':'MailServerOut','as':_0x5539('0xe'),'include':[{'model':_0x5539('0xf'),'as':'CloudProvider'}]}],'attributes':['id',_0x5539('0xa'),_0x5539('0x10')],'smtp':!![]}});};exports[_0x5539('0x11')]=function(_0xe57fc5){return request(_0x5539('0x12'),{'options':{'where':{'id':_0xe57fc5},'attributes':[_0x5539('0xa')]}});};exports[_0x5539('0x13')]=function(_0x498eef){return request(_0x5539('0x14'),{'options':{'where':{'id':_0x498eef},'attributes':[_0x5539('0xa')]}});};exports['getVariableById']=function(_0x42129b){return request('ShowVariable',{'options':{'where':{'id':_0x42129b},'attributes':[_0x5539('0xa')]}});};exports[_0x5539('0x15')]=function(_0x3d1585){return request(_0x5539('0x16'),{'options':{'where':{'id':_0x3d1585},'attributes':[_0x5539('0x17')]}});};exports[_0x5539('0x18')]=function(_0x437b01){return request(_0x5539('0x19'),{'options':{'where':{'id':_0x437b01},'attributes':['name']}});};exports['getContactByPhone']=function(_0x52476f){return request(_0x5539('0x1a'),{'options':{'where':{'phone':_0x52476f['phone']},'attributes':['id']}});};exports[_0x5539('0x1b')]=function(_0x2f9cb1){return request(_0x5539('0x1c'),{'options':{'where':{'id':_0x2f9cb1},'attributes':['name']}});};exports[_0x5539('0x1d')]=function(_0x5c52e7){return request('ShowSound',{'options':{'where':{'id':_0x5c52e7},'attributes':[_0x5539('0x1e')]}});};exports['getIntervalById']=function(_0x2fb510){return request(_0x5539('0x1f'),{'options':{'raw':![],'where':{'id':_0x2fb510},'include':[{'model':_0x5539('0x20'),'as':_0x5539('0x21')}]}});};exports['getSmsAccountById']=function(_0x55732d){return request('ShowSmsAccount',{'options':{'where':{'id':_0x55732d},'attributes':['id',_0x5539('0xa')]}});};exports[_0x5539('0x22')]=function(_0x19b989){return request(_0x5539('0x23'),{'body':_0x19b989});};exports[_0x5539('0x24')]=function(_0x1f4744){return request(_0x5539('0x25'),{'body':_0x1f4744});};exports[_0x5539('0x26')]=function(_0x406385){return request(_0x5539('0x27'),{'body':_[_0x5539('0x28')](_0x406385,{'project_name':_0x406385[_0x5539('0x29')],'prev_project_name':_0x406385[_0x5539('0x2a')]||'','is_subproject':_0x406385[_0x5539('0x2a')]?!![]:![],'leaveAt':moment()[_0x5539('0x2b')](_0x5539('0x2c'))})});};exports[_0x5539('0x2d')]=function(_0x4e0e29){return request('CreateSquareRecording',{'body':_0x4e0e29});};exports[_0x5539('0x2e')]=function(_0x2bce98){return request('CreateSquareMessage',{'body':_0x2bce98});};exports[_0x5539('0x2f')]=function(_0x5c0be7){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x5c0be7[_0x5539('0x30')],'ListId':_0x5c0be7[_0x5539('0x31')]}}})['then'](function(_0x1e00ab){if(_0x1e00ab){return _0x1e00ab;}return request(_0x5539('0x32'),{'body':_0x5c0be7});});};exports['getPauseById']=function(_0x481f49){return request(_0x5539('0x33'),{'options':{'where':{'id':_0x481f49},'attributes':['name']}});};exports[_0x5539('0x34')]=function(_0x15fc1f,_0x593d5d){return request(_0x5539('0x35'),{'body':{'interface':_0x593d5d},'options':{'where':_0x15fc1f}});};exports['agentPause']=function(_0x30f054,_0x5e8d3d,_0x529f46){return request(_0x5539('0x36'),{'body':{'type':_0x5e8d3d,'uniqueid':_0x529f46},'options':{'where':_0x30f054}});};exports['agentUnpause']=function(_0xfb4b2b){return request(_0x5539('0x37'),{'body':{},'options':{'where':_0xfb4b2b}});};exports[_0x5539('0x38')]=function(_0x5cc66e){return request(_0x5539('0x39'),{'body':{},'options':{'where':_0x5cc66e}});}; \ 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 7699d6e..228dc82 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 _0x0960=['./polly','./lex'];(function(_0x3f0fde,_0x21a8ad){var _0xbd3b30=function(_0xb3c78e){while(--_0xb3c78e){_0x3f0fde['push'](_0x3f0fde['shift']());}};_0xbd3b30(++_0x21a8ad);}(_0x0960,0xc2));var _0x0096=function(_0x537f82,_0x8cd8f8){_0x537f82=_0x537f82-0x0;var _0x993db1=_0x0960[_0x537f82];return _0x993db1;};var polly=require(_0x0096('0x0'));var lex=require(_0x0096('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x5031=['./polly','./lex','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5031,0x144));var _0x1503=function(_0x4595a3,_0x5ed375){_0x4595a3=_0x4595a3-0x0;var _0x1e950f=_0x5031[_0x4595a3];return _0x1e950f;};var polly=require(_0x1503('0x0'));var lex=require(_0x1503('0x1'));module[_0x1503('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index f83a32c..50b6b6c 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4e6=['./lib/api'];(function(_0x3a3959,_0x5c8488){var _0x3b8f77=function(_0x410766){while(--_0x410766){_0x3a3959['push'](_0x3a3959['shift']());}};_0x3b8f77(++_0x5c8488);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x355ce8,_0x5f1d0a){_0x355ce8=_0x355ce8-0x0;var _0x1db8b8=_0xb4e6[_0x355ce8];return _0x1db8b8;};'use strict';var lex=require(_0x6b4e('0x0'));module['exports']=function(_0x2708ca,_0x1afd20,_0x365912,_0x25ffcb,_0x44e781,_0x31e8ad){return lex(_0x2708ca,_0x1afd20,_0x365912,_0x25ffcb,_0x44e781,_0x31e8ad);}; \ No newline at end of file +var _0xee5b=['./lib/api'];(function(_0x1c90b3,_0x42e708){var _0x413867=function(_0x19c6f4){while(--_0x19c6f4){_0x1c90b3['push'](_0x1c90b3['shift']());}};_0x413867(++_0x42e708);}(_0xee5b,0x1f4));var _0xbee5=function(_0x34dc4b,_0xdd40ea){_0x34dc4b=_0x34dc4b-0x0;var _0x173934=_0xee5b[_0x34dc4b];return _0x173934;};'use strict';var lex=require(_0xbee5('0x0'));module['exports']=function(_0x7b2344,_0x203bba,_0x4f850a,_0x1893e4,_0x2b93c2,_0x2eb857){return lex(_0x7b2344,_0x203bba,_0x4f850a,_0x1893e4,_0x2b93c2,_0x2eb857);}; \ 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 f59c104..349c108 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(_0x139742,_0x25749c){var _0xe6b9aa=function(_0x84aba6){while(--_0x84aba6){_0x139742['push'](_0x139742['shift']());}};_0xe6b9aa(++_0x25749c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_0x589e7b,_0x567422){var _0x331513=function(_0x281b16){while(--_0x281b16){_0x589e7b['push'](_0x589e7b['shift']());}};_0x331513(++_0x567422);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js index 47f4ce2..fd62900 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 _0x786c=['./lib/api'];(function(_0x32b9b3,_0x130be2){var _0x124086=function(_0x97be5a){while(--_0x97be5a){_0x32b9b3['push'](_0x32b9b3['shift']());}};_0x124086(++_0x130be2);}(_0x786c,0x168));var _0xc786=function(_0x38edfb,_0x45da65){_0x38edfb=_0x38edfb-0x0;var _0x1faa2b=_0x786c[_0x38edfb];return _0x1faa2b;};'use strict';var polly=require(_0xc786('0x0'));module['exports']=function(_0x3bf181,_0x5a4e51,_0x24ec1e,_0x5b6e28,_0x50d33b,_0x2faec1,_0x37aa34){return polly(_0x3bf181,_0x5a4e51,_0x24ec1e,_0x5b6e28,_0x50d33b,_0x2faec1,_0x37aa34);}; \ No newline at end of file +var _0x8150=['exports','./lib/api'];(function(_0x10887c,_0x273db2){var _0x33548a=function(_0x2f5002){while(--_0x2f5002){_0x10887c['push'](_0x10887c['shift']());}};_0x33548a(++_0x273db2);}(_0x8150,0x1ef));var _0x0815=function(_0x177af0,_0x494e75){_0x177af0=_0x177af0-0x0;var _0x4e2480=_0x8150[_0x177af0];return _0x4e2480;};'use strict';var polly=require(_0x0815('0x0'));module[_0x0815('0x1')]=function(_0x48a3cd,_0x289e99,_0x88eada,_0x262a59,_0x5c8792,_0x48ce46,_0x172d05){return polly(_0x48a3cd,_0x289e99,_0x88eada,_0x262a59,_0x5c8792,_0x48ce46,_0x172d05);}; \ 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 c44adbe..dd9a0d6 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 _0x1cfe=['AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech'];(function(_0x538dfb,_0x2d23a0){var _0x21bfad=function(_0x2afb6e){while(--_0x2afb6e){_0x538dfb['push'](_0x538dfb['shift']());}};_0x21bfad(++_0x2d23a0);}(_0x1cfe,0x14d));var _0xe1cf=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x1cfe[_0x4d07cc];return _0x42de3b;};'use strict';var fs=require('fs');var path=require(_0xe1cf('0x0'));var BPromise=require(_0xe1cf('0x1'));var rs=require(_0xe1cf('0x2'));var AWS=require(_0xe1cf('0x3'));function pollyResult(_0x3697c3,_0x5f19b0,_0x840562){return new BPromise(function(_0x380474,_0x65d697){_0x3697c3[_0xe1cf('0x4')](_0x5f19b0,function(_0x3feebc,_0x2d065d){if(_0x3feebc){_0x65d697(_0x3feebc);}else if(_0x2d065d){if(_0x2d065d[_0xe1cf('0x5')]instanceof Buffer){fs[_0xe1cf('0x6')](_0x840562,_0x2d065d[_0xe1cf('0x5')],function(_0xdd2910){if(_0xdd2910){_0x65d697(_0xdd2910);}else{_0x380474();}});}else{_0x65d697(new Error(_0xe1cf('0x7')));}}else{_0x65d697(new Error(_0xe1cf('0x8')));}});});}module[_0xe1cf('0x9')]=function(_0x54c785,_0xe93a08,_0x210590,_0xb56dab,_0xaded90,_0x4c5467,_0x1d8f8d){var _0x48dbfb=new AWS[(_0xe1cf('0xa'))]({'accessKeyId':_0x54c785,'secretAccessKey':_0xe93a08,'region':_0x210590});var _0x49570c={'Text':_0xaded90,'TextType':_0x4c5467||_0xe1cf('0xb'),'OutputFormat':_0xe1cf('0xc'),'VoiceId':_0xb56dab};return pollyResult(_0x48dbfb,_0x49570c,_0x1d8f8d);}; \ No newline at end of file +var _0x7fc4=['randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','path'];(function(_0x4009af,_0x1bc8ac){var _0x16e058=function(_0x1f5c30){while(--_0x1f5c30){_0x4009af['push'](_0x4009af['shift']());}};_0x16e058(++_0x1bc8ac);}(_0x7fc4,0x121));var _0x47fc=function(_0x2be785,_0x1ffda7){_0x2be785=_0x2be785-0x0;var _0x322198=_0x7fc4[_0x2be785];return _0x322198;};'use strict';var fs=require('fs');var path=require(_0x47fc('0x0'));var BPromise=require('bluebird');var rs=require(_0x47fc('0x1'));var AWS=require(_0x47fc('0x2'));function pollyResult(_0x3951c2,_0x3b27c6,_0x54ad0c){return new BPromise(function(_0x15ad2e,_0x4b83b9){_0x3951c2[_0x47fc('0x3')](_0x3b27c6,function(_0x157f72,_0x49ef75){if(_0x157f72){_0x4b83b9(_0x157f72);}else if(_0x49ef75){if(_0x49ef75[_0x47fc('0x4')]instanceof Buffer){fs[_0x47fc('0x5')](_0x54ad0c,_0x49ef75['AudioStream'],function(_0x2490be){if(_0x2490be){_0x4b83b9(_0x2490be);}else{_0x15ad2e();}});}else{_0x4b83b9(new Error(_0x47fc('0x6')));}}else{_0x4b83b9(new Error(_0x47fc('0x7')));}});});}module[_0x47fc('0x8')]=function(_0x3819b0,_0x4623a4,_0x380256,_0x599446,_0x3f21e9,_0x1dcf02,_0x5f2fc4){var _0x1b3ce8=new AWS[(_0x47fc('0x9'))]({'accessKeyId':_0x3819b0,'secretAccessKey':_0x4623a4,'region':_0x380256});var _0x3e5b34={'Text':_0x3f21e9,'TextType':_0x1dcf02||'text','OutputFormat':'mp3','VoiceId':_0x599446};return pollyResult(_0x1b3ce8,_0x3e5b34,_0x5f2fc4);}; \ 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 23dfb53..3f75829 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 _0xae78=['./lib/api','exports'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xae78,0xb2));var _0x8ae7=function(_0x24fdf2,_0x5a23bc){_0x24fdf2=_0x24fdf2-0x0;var _0x383017=_0xae78[_0x24fdf2];return _0x383017;};'use strict';var asr=require(_0x8ae7('0x0'));module[_0x8ae7('0x1')]=function(_0x1680a1,_0x5f2d42,_0x3f8893,_0x734a23){return asr(_0x1680a1,_0x5f2d42,_0x3f8893);}; \ No newline at end of file +var _0xc696=['exports'];(function(_0x54d1ca,_0xa99489){var _0x119f49=function(_0x1228ac){while(--_0x1228ac){_0x54d1ca['push'](_0x54d1ca['shift']());}};_0x119f49(++_0xa99489);}(_0xc696,0xe1));var _0x6c69=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc696[_0xa148b7];return _0x51efd3;};'use strict';var asr=require('./lib/api');module[_0x6c69('0x0')]=function(_0x92b8e6,_0x340f03,_0x5f0058,_0x42199a){return asr(_0x92b8e6,_0x340f03,_0x5f0058);}; \ 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 de96c72..089908d 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 _0xc368=['POST','/v1/speech:recognize?key=','8000','bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync'];(function(_0x924c29,_0x309120){var _0x24ddd6=function(_0x1c8a9e){while(--_0x1c8a9e){_0x924c29['push'](_0x924c29['shift']());}};_0x24ddd6(++_0x309120);}(_0xc368,0x7b));var _0x8c36=function(_0x49e55a,_0x70c2aa){_0x49e55a=_0x49e55a-0x0;var _0x1c2d88=_0xc368[_0x49e55a];return _0x1c2d88;};'use strict';var url=require('url');var BPromise=require(_0x8c36('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x8c36('0x1')]=function(_0x17fa33,_0x20e697,_0x2640c5){return new BPromise(function(_0x288b85,_0x5d3b27){var _0x3e9034;if(typeof _0x17fa33!==_0x8c36('0x2')||_0x17fa33[_0x8c36('0x3')]===0x0){return _0x5d3b27(_0x8c36('0x4'));}if(typeof _0x20e697!=='string'||_0x20e697['length']===0x0){return _0x5d3b27(_0x8c36('0x5'));}if(typeof _0x2640c5!==_0x8c36('0x6')&&(typeof _0x2640c5!==_0x8c36('0x2')||_0x2640c5[_0x8c36('0x3')]===0x0)){return _0x5d3b27(_0x8c36('0x7'));}try{_0x3e9034=fs[_0x8c36('0x8')](_0x17fa33)['toString']('base64');}catch(_0x49f227){return _0x5d3b27(_0x49f227);}return _0x288b85({'method':_0x8c36('0x9'),'uri':host+_0x8c36('0xa')+_0x20e697,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x8c36('0xb'),'languageCode':_0x2640c5},'audio':{'content':_0x3e9034}},'json':!![]});});}; \ No newline at end of file +var _0xee11=['base64','POST','LINEAR16','8000','url','exports','string','filepath\x20should\x20be\x20a\x20string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString'];(function(_0xf6528d,_0x73f4e7){var _0x45b975=function(_0x3ebfb1){while(--_0x3ebfb1){_0xf6528d['push'](_0xf6528d['shift']());}};_0x45b975(++_0x73f4e7);}(_0xee11,0x146));var _0x1ee1=function(_0x2158a6,_0x11993c){_0x2158a6=_0x2158a6-0x0;var _0x4da6ed=_0xee11[_0x2158a6];return _0x4da6ed;};'use strict';var url=require(_0x1ee1('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0x1ee1('0x1')]=function(_0x1a6844,_0x3a1711,_0x1eb386){return new BPromise(function(_0x2a94ef,_0x14d420){var _0x3eb96f;if(typeof _0x1a6844!==_0x1ee1('0x2')||_0x1a6844['length']===0x0){return _0x14d420(_0x1ee1('0x3'));}if(typeof _0x3a1711!==_0x1ee1('0x2')||_0x3a1711[_0x1ee1('0x4')]===0x0){return _0x14d420(_0x1ee1('0x5'));}if(typeof _0x1eb386!==_0x1ee1('0x6')&&(typeof _0x1eb386!=='string'||_0x1eb386['length']===0x0)){return _0x14d420(_0x1ee1('0x7'));}try{_0x3eb96f=fs[_0x1ee1('0x8')](_0x1a6844)[_0x1ee1('0x9')](_0x1ee1('0xa'));}catch(_0x5b5e05){return _0x14d420(_0x5b5e05);}return _0x2a94ef({'method':_0x1ee1('0xb'),'uri':host+'/v1/speech:recognize?key='+_0x3a1711,'body':{'config':{'encoding':_0x1ee1('0xc'),'sampleRateHertz':_0x1ee1('0xd'),'languageCode':_0x1eb386},'audio':{'content':_0x3eb96f}},'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 2e37dde..b84a250 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 _0x57d0=['exports','./asr'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x57d0,0x1e5));var _0x057d=function(_0x43c62a,_0x125d82){_0x43c62a=_0x43c62a-0x0;var _0x367fb8=_0x57d0[_0x43c62a];return _0x367fb8;};var asr=require(_0x057d('0x0'));module[_0x057d('0x1')]={'asr':asr}; \ No newline at end of file +var _0xce94=['exports','./asr'];(function(_0x3c6ae2,_0x5c52d8){var _0x4edda=function(_0x5593eb){while(--_0x5593eb){_0x3c6ae2['push'](_0x3c6ae2['shift']());}};_0x4edda(++_0x5c52d8);}(_0xce94,0x9f));var _0x4ce9=function(_0x464f26,_0x4d650a){_0x464f26=_0x464f26-0x0;var _0x3ae467=_0xce94[_0x464f26];return _0x3ae467;};var asr=require(_0x4ce9('0x0'));module[_0x4ce9('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 42f5061..067c4d5 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 _0x8672=['info','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','statusCode','name','message','googleDialogflow','textRequest','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','status','metadata','isFallbackIntent','googleDialogflowV2','replace','sessionPath','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','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','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','path','querystring','randomstring','google-tts-api','url','util','./aws','./google','./tilde','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','unlink','download\x20error','pipe','end','get','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','chmodSync','split','readFileSync','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','then','tmp','generate','.mp3','from','audioContent','writeFile','777','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','f.req=','stringify','null','generic','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','writeFileSync','.wav'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8672,0x1e2));var _0x2867=function(_0x3337f2,_0x265912){_0x3337f2=_0x3337f2-0x0;var _0xa93014=_0x8672[_0x3337f2];return _0xa93014;};'use strict';var apiai=require(_0x2867('0x0'));var BPromise=require(_0x2867('0x1'));var dialogflow=require(_0x2867('0x2'));var fs=require('fs');var http=require(_0x2867('0x3'));var https=require(_0x2867('0x4'));var md5=require('md5');var path=require(_0x2867('0x5'));var querystring=require(_0x2867('0x6'));var rp=require('request-promise');var rs=require(_0x2867('0x7'));var sox=require('sox');var tts=require(_0x2867('0x8'));var urlParse=require(_0x2867('0x9'))['parse'];var util=require(_0x2867('0xa'));var aws=require(_0x2867('0xb'));var google=require(_0x2867('0xc'));var sestek=require('./sestek');var tilde=require(_0x2867('0xd'));var logger=require('../../../config/logger')(_0x2867('0xe'));var ISPEECH_API=_0x2867('0xf');function downloadFile(_0x47a828,_0x7df286){return new BPromise(function(_0xc3a6d4,_0x5e1eea){var _0xf5c523=urlParse(_0x47a828);var _0x319689=_0xf5c523[_0x2867('0x10')]==='https:'?https:http;var _0x17b331={'host':_0xf5c523[_0x2867('0x11')],'path':_0xf5c523[_0x2867('0x5')],'headers':{'user-agent':_0x2867('0x12')}};_0x319689['get'](_0x17b331,function(_0x70a0e9){if(_0x70a0e9['statusCode']!==0xc8){logger[_0x2867('0x13')]('request\x20to\x20'+_0x47a828+_0x2867('0x14')+_0x70a0e9['statusCode']+'\x20('+_0x70a0e9[_0x2867('0x15')]+')');_0x5e1eea(new Error(_0x2867('0x16')+_0x47a828+'\x20failed,\x20status\x20code\x20=\x20'+_0x70a0e9['statusCode']+'\x20('+_0x70a0e9[_0x2867('0x15')]+')'));return;}var _0x2bf83a=fs[_0x2867('0x17')](_0x7df286);_0x2bf83a['on'](_0x2867('0x18'),function(){logger['info']('finish\x20download\x20file');_0x2bf83a['close'](_0xc3a6d4);});_0x2bf83a['on'](_0x2867('0x13'),function(_0x22d03e){fs[_0x2867('0x19')](_0x7df286);logger[_0x2867('0x13')](_0x2867('0x1a'),_0x22d03e);_0x5e1eea(_0x22d03e);});_0x70a0e9[_0x2867('0x1b')](_0x2bf83a);})['on'](_0x2867('0x13'),function(_0x25f6ce){logger[_0x2867('0x13')](_0x25f6ce);_0x5e1eea(_0x25f6ce);})[_0x2867('0x1c')]();});}function uploadFile(_0x1f7c5a){return new BPromise(function(_0x503189,_0x59b580){var _0x4c2f9f=urlParse(_0x1f7c5a);var _0x2b75f1=_0x4c2f9f['protocol']==='https:'?https:http;var _0x43456d={'host':_0x4c2f9f[_0x2867('0x11')],'path':_0x4c2f9f['path'],'headers':{'user-agent':_0x2867('0x12')}};_0x2b75f1[_0x2867('0x1d')](_0x43456d,function(_0x253548){if(_0x253548['statusCode']!==0xc8){_0x59b580(new Error(_0x2867('0x16')+_0x1f7c5a+'\x20failed,\x20status\x20code\x20=\x20'+_0x253548['statusCode']+'\x20('+_0x253548[_0x2867('0x15')]+')'));return;}var _0x15cd9b='';_0x253548['on'](_0x2867('0x1e'),function(_0x49eaa3){_0x15cd9b+=_0x49eaa3;});_0x253548['on']('end',function(){_0x503189(_0x15cd9b);});})['on']('error',function(_0x540508){_0x59b580(_0x540508);})['end']();});}function convertFile(_0x34497e,_0x37d1de){return new BPromise(function(_0x520501,_0x38772a){var _0x225123=sox[_0x2867('0x1f')](_0x34497e,_0x37d1de,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x225123['on']('error',function(_0x590bd6){logger['error'](_0x2867('0x20'),_0x590bd6);_0x38772a(_0x590bd6);});_0x225123['on']('end',function(){logger['info'](_0x2867('0x21'));_0x520501();});_0x225123[_0x2867('0x22')]();});}function base64Decode(_0x4c9f9f,_0x30cd8d){var _0x1cc4e6=path[_0x2867('0x23')](__dirname,'tmp',rs['generate'](0x4)+'.wav');fs['writeFileSync'](_0x1cc4e6,_0x4c9f9f,'base64');return convertFile(_0x1cc4e6,_0x30cd8d)['then'](function(){try{fs[_0x2867('0x19')](_0x1cc4e6);fs[_0x2867('0x24')](_0x30cd8d,'777');}catch(_0x267255){logger['error'](_0x267255);}return _0x30cd8d[_0x2867('0x25')]('.')[0x0];});}function base64Encode(_0x507da6){var _0x1dfd48=fs[_0x2867('0x26')](_0x507da6);return new Buffer(_0x1dfd48)['toString'](_0x2867('0x27'));}exports[_0x2867('0x28')]=function(_0x1a0149,_0x127603,_0x157798,_0x8276a,_0x13f3c1,_0x47adc2){var _0x15e741,_0x3eb2fc;var _0x35a92f=_0x2867('0x29');var _0x2e5c88=_0x2867('0x2a')+_0x1a0149;var _0x3519c2={};if(_0x127603===_0x2867('0x2b')){_0x3519c2[_0x2867('0x2c')]={'ssml':_0x157798};}else{_0x3519c2[_0x2867('0x2c')]={'text':_0x157798};};_0x3519c2[_0x2867('0x2d')]={'languageCode':_0x8276a,'ssmlGender':_0x13f3c1};_0x3519c2[_0x2867('0x2e')]={'audioEncoding':_0x2867('0x2f'),'sampleRateHertz':0x1f40};var _0x37a9bd={'url':_0x35a92f+_0x2867('0x30')+_0x2e5c88,'method':_0x2867('0x31'),'json':!![],'body':_0x3519c2};return rp(_0x37a9bd)[_0x2867('0x32')](function(_0x54e38b){return new BPromise(function(_0x567916,_0x2a9b9b){_0x15e741=path['resolve'](__dirname,_0x2867('0x33'),rs[_0x2867('0x34')](0x4)+_0x2867('0x35'));var _0x4d2310=Buffer[_0x2867('0x36')](_0x54e38b[_0x2867('0x37')],'base64');return fs[_0x2867('0x38')](_0x15e741,_0x4d2310,function(_0x2ef2a6){_0x2a9b9b(_0x2ef2a6);},function(_0x58e599){fs[_0x2867('0x24')](_0x15e741,_0x2867('0x39'));_0x567916(_0x58e599);});});})[_0x2867('0x32')](function(_0x538cb2){_0x3eb2fc=path[_0x2867('0x23')](__dirname,_0x2867('0x33'),rs[_0x2867('0x34')](0x4)+'.wav');return convertFile(_0x15e741,_0x3eb2fc);})[_0x2867('0x32')](function(){try{fs[_0x2867('0x19')](_0x15e741);fs[_0x2867('0x24')](_0x3eb2fc,_0x2867('0x39'));}catch(_0x5c39f2){logger['error'](_0x5c39f2);}logger['info']('googleCloudTTS\x20path',_0x3eb2fc[_0x2867('0x25')]('.')[0x0]);return _0x3eb2fc['split']('.')[0x0];});};exports[_0x2867('0x3a')]=function(_0x59adcc,_0x245f79){var _0x2b6223=_0x2867('0x3b');var _0x5a60c5,_0x24a438;var _0x1019fd;var _0x3fec77={'encoding':_0x2867('0x3c'),'method':_0x2867('0x31'),'timeout':0x2710,'url':_0x2b6223,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x2867('0x3d')+encodeURIComponent(JSON[_0x2867('0x3e')]([[['jQ1olc',JSON[_0x2867('0x3e')]([_0x59adcc,_0x245f79||'en',![],_0x2867('0x3f')]),null,_0x2867('0x40')]]]))};return rp(_0x3fec77)['then'](function(_0x103ab4){try{_0x1019fd=eval(_0x103ab4['slice'](0x5))[0x0][0x2];}catch(_0x554429){throw new Error('parse\x20response\x20failed:\x0a'+_0x103ab4['data']);}if(!_0x1019fd){if(_0x59adcc['length']>0xc8){throw new Error(_0x2867('0x41'));}else{throw new Error('lang\x20\x22'+_0x245f79+_0x2867('0x42'));}}try{_0x1019fd=eval(_0x1019fd)[0x0];}catch(_0x431cbf){throw new Error(_0x2867('0x43')+res[_0x2867('0x1e')]);}const _0x242ca2=_0x1019fd;_0x5a60c5=path[_0x2867('0x23')](__dirname,_0x2867('0x33'),rs[_0x2867('0x34')](0x4)+_0x2867('0x35'));fs[_0x2867('0x44')](_0x5a60c5,_0x1019fd,{'encoding':_0x2867('0x27')});_0x24a438=path['resolve'](__dirname,_0x2867('0x33'),rs['generate'](0x4)+_0x2867('0x45'));return convertFile(_0x5a60c5,_0x24a438);})[_0x2867('0x32')](function(){try{fs['unlink'](_0x5a60c5);fs['chmodSync'](_0x24a438,_0x2867('0x39'));}catch(_0x10ddf7){logger[_0x2867('0x13')](_0x10ddf7);}logger[_0x2867('0x46')](_0x2867('0x47'),_0x24a438[_0x2867('0x25')]('.')[0x0]);return _0x24a438[_0x2867('0x25')]('.')[0x0];});};exports['googleASR']=function(_0x2180b4,_0x7fc0e2,_0x1be802){return google[_0x2867('0x48')](_0x2180b4,_0x7fc0e2,_0x1be802)['then'](function(_0x58823e){logger[_0x2867('0x46')](_0x58823e[_0x2867('0x49')]);return rp(_0x58823e);})[_0x2867('0x32')](function(_0x3f07ae){var _0xc50a49='';var _0x3be336=0x0;try{fs[_0x2867('0x19')](_0x2180b4);}catch(_0x59dadc){logger[_0x2867('0x13')](_0x59dadc);}if(_0x3f07ae&&_0x3f07ae[_0x2867('0x4a')]){_0xc50a49=_0x3f07ae[_0x2867('0x4a')][_0x2867('0x4b')](function(_0x52edb6){return _0x52edb6&&_0x52edb6[_0x2867('0x4c')][0x0]&&_0x52edb6[_0x2867('0x4c')][0x0][_0x2867('0x4d')]?_0x52edb6[_0x2867('0x4c')][0x0][_0x2867('0x4d')]:'';})[_0x2867('0x4e')]('\x0a');_0x3be336=_0x3f07ae[_0x2867('0x4a')][_0x2867('0x4b')](function(_0x8e8b2){return _0x8e8b2&&_0x8e8b2[_0x2867('0x4c')][0x0]&&_0x8e8b2['alternatives'][0x0]['confidence']?_0x8e8b2[_0x2867('0x4c')][0x0][_0x2867('0x4f')]:0x0;})[_0x2867('0x4e')]('\x0a');}logger[_0x2867('0x46')](_0x2867('0x50'),_0xc50a49);logger[_0x2867('0x46')](_0x2867('0x51'),_0x3be336);return{'transcript':_0xc50a49,'confidence':_0x3be336};})[_0x2867('0x52')](function(_0x11c8b2){logger['error'](_0x2867('0x53'),_0x11c8b2[_0x2867('0x54')],_0x11c8b2[_0x2867('0x55')],_0x11c8b2[_0x2867('0x56')]);});};exports[_0x2867('0x57')]=function(_0x3c0fe5,_0x4f6408,_0x5b9b49,_0xbb1d09){var _0x4c369f=apiai(_0x4f6408,{'language':_0xbb1d09||'en'});return _0x4c369f[_0x2867('0x58')](_0x5b9b49,{'sessionId':md5(_0x3c0fe5)})['then'](function(_0xfc6074){logger['info'](JSON[_0x2867('0x3e')](_0xfc6074));return{'source':_0xfc6074[_0x2867('0x59')]['source'],'resolvedQuery':_0xfc6074['result'][_0x2867('0x5a')],'action':_0xfc6074[_0x2867('0x59')][_0x2867('0x5b')],'actionIncomplete':_0xfc6074[_0x2867('0x59')][_0x2867('0x5c')],'speech':_0xfc6074[_0x2867('0x59')][_0x2867('0x5d')][_0x2867('0x5e')],'score':_0xfc6074[_0x2867('0x59')]['score'],'statusCode':_0xfc6074[_0x2867('0x5f')]['code'],'endConversation':_0xfc6074[_0x2867('0x59')][_0x2867('0x60')]['endConversation']||![],'isFallbackIntent':_0xfc6074[_0x2867('0x59')][_0x2867('0x60')][_0x2867('0x61')]};});};exports[_0x2867('0x62')]=function(_0x4a82e9,_0x3d15c2,_0x994c42,_0x1615d6,_0x4e799c,_0x3d8492){var _0x1ae95b=_0x1615d6[_0x2867('0x63')](/\\n/g,'\x0a');var _0x5a22e5={'credentials':{'private_key':_0x1ae95b,'client_email':_0x994c42}};var _0x101c2a=new dialogflow['SessionsClient'](_0x5a22e5);var _0x34735d=_0x101c2a[_0x2867('0x64')](_0x3d15c2,md5(_0x4a82e9));var _0x3659da={'session':_0x34735d,'queryInput':{'text':{'text':_0x4e799c,'languageCode':_0x3d8492}}};return _0x101c2a[_0x2867('0x65')](_0x3659da)[_0x2867('0x32')](function(_0x38989b){if(_0x38989b&&_0x38989b[_0x2867('0x66')]){logger[_0x2867('0x46')](_0x2867('0x67'),JSON[_0x2867('0x3e')](_0x38989b));var _0x4e3d88=_0x38989b[0x0];if(_0x4e3d88){var _0x523460={'action':_0x4e3d88[_0x2867('0x68')][_0x2867('0x5b')],'allRequiredParamsPresent':_0x4e3d88[_0x2867('0x68')][_0x2867('0x69')],'endConversation':_0x4e3d88[_0x2867('0x68')][_0x2867('0x6a')]&&_0x4e3d88[_0x2867('0x68')][_0x2867('0x6a')]['fields']?_0x4e3d88[_0x2867('0x68')][_0x2867('0x6a')][_0x2867('0x6b')][_0x2867('0x6c')][_0x2867('0x6d')]:![],'fulfillmentText':_0x4e3d88['queryResult'][_0x2867('0x6e')],'intentName':_0x4e3d88[_0x2867('0x68')][_0x2867('0x6f')][_0x2867('0x55')],'intentDisplayName':_0x4e3d88['queryResult']['intent'][_0x2867('0x70')],'isFallbackIntent':_0x4e3d88[_0x2867('0x68')]['intent']['isFallback'],'languageCode':_0x4e3d88['queryResult']['languageCode'],'queryText':_0x4e3d88[_0x2867('0x68')][_0x2867('0x71')],'responseId':_0x4e3d88[_0x2867('0x72')],'score':_0x4e3d88[_0x2867('0x68')][_0x2867('0x73')],'speech':_0x4e3d88[_0x2867('0x68')][_0x2867('0x6e')],'providerResponse':JSON[_0x2867('0x3e')](_0x38989b)};return _0x523460;}}});};exports[_0x2867('0x74')]=function(_0x4b2ed5,_0x53252d,_0x475315,_0x5a75f6){return tilde['asr'](_0x4b2ed5,_0x53252d,_0x475315,_0x5a75f6)[_0x2867('0x32')](function(_0x4a83c7){try{fs[_0x2867('0x19')](_0x4b2ed5);}catch(_0x1ae67d){logger[_0x2867('0x13')](_0x1ae67d);}logger[_0x2867('0x46')](_0x2867('0x75'),_0x4a83c7['transcript']);logger[_0x2867('0x46')](_0x2867('0x76'),_0x4a83c7[_0x2867('0x4f')]);return _0x4a83c7;});};exports[_0x2867('0x77')]=function(_0x308b29,_0x25469e,_0x322e33,_0x4cf140,_0x4acba9,_0x5386f7){var _0xe6c56d=path[_0x2867('0x23')](__dirname,'tmp',rs[_0x2867('0x34')](0x4)+_0x2867('0x35'));var _0x5bf151;return aws[_0x2867('0x78')](_0x308b29,_0x25469e,_0x322e33,_0x4cf140,_0x4acba9,_0x5386f7,_0xe6c56d)['then'](function(){_0x5bf151=path['resolve'](__dirname,_0x2867('0x33'),rs[_0x2867('0x34')](0x4)+_0x2867('0x45'));return convertFile(_0xe6c56d,_0x5bf151);})[_0x2867('0x32')](function(){try{fs[_0x2867('0x19')](_0xe6c56d);fs['chmodSync'](_0x5bf151,_0x2867('0x39'));}catch(_0x36c5ee){logger[_0x2867('0x13')](_0x36c5ee);}return _0x5bf151[_0x2867('0x25')]('.')[0x0];});};exports['awsLex']=function(_0x5c9f32,_0xd477a4,_0xed8f60,_0x3b9d77,_0xcb19aa,_0x2d0690){return aws[_0x2867('0x79')](_0x5c9f32,_0xd477a4,_0xed8f60,_0x3b9d77,_0xcb19aa,_0x2d0690)['then'](function(_0x4c2f66){logger[_0x2867('0x46')](JSON['stringify'](_0x4c2f66));return _0x4c2f66;});};exports[_0x2867('0x7a')]=function(_0x6b2491,_0x2e0d9a,_0x2c0fc2,_0x317ff6){var _0x57426c=util[_0x2867('0x7b')](_0x2867('0x7c'),ISPEECH_API,_0x6b2491,encodeURIComponent(_0x2e0d9a),_0x2c0fc2,_0x317ff6);var _0x188e55=path['resolve'](__dirname,_0x2867('0x33'),rs[_0x2867('0x34')](0x4)+_0x2867('0x35'));var _0x5b5bc7;return downloadFile(_0x57426c,_0x188e55)['then'](function(){_0x5b5bc7=path[_0x2867('0x23')](__dirname,_0x2867('0x33'),rs[_0x2867('0x34')](0x4)+'.wav');return convertFile(_0x188e55,_0x5b5bc7);})[_0x2867('0x32')](function(){try{fs['unlink'](_0x188e55);fs['chmodSync'](_0x5b5bc7,_0x2867('0x39'));}catch(_0x5062d0){logger[_0x2867('0x13')](_0x5062d0);}return _0x5b5bc7[_0x2867('0x25')]('.')[0x0];});};exports[_0x2867('0x7d')]=function(_0x5194d7,_0x187e66,_0x29504c,_0x20c301){var _0x48c522=util['format'](_0x2867('0x7e'),ISPEECH_API,_0x187e66,_0x29504c,base64Encode(_0x5194d7),_0x20c301?util[_0x2867('0x7b')]('model=%s',encodeURIComponent(_0x20c301)):_0x2867('0x7f'));return uploadFile(_0x48c522)[_0x2867('0x32')](function(_0x86bb22){return querystring[_0x2867('0x80')](_0x86bb22);});};exports[_0x2867('0x81')]=function(_0x48c2fc,_0x17af95){return sestek['nda'](_0x48c2fc,_0x17af95)[_0x2867('0x32')](function(_0x51621a){logger[_0x2867('0x46')](JSON[_0x2867('0x3e')](_0x51621a));var _0xa7aba0={'speech':_0x51621a[_0x2867('0x82')],'action':_0x51621a[_0x2867('0x83')]?_0x51621a[_0x2867('0x83')][_0x2867('0x84')]:undefined,'actiondata':_0x51621a[_0x2867('0x83')]?_0x51621a[_0x2867('0x83')][_0x2867('0x85')]:undefined};if(_0x51621a['channelData']&&_0x51621a['channelData'][_0x2867('0x86')]){return base64Decode(_0x51621a['channelData'][_0x2867('0x86')][_0x2867('0x87')],path[_0x2867('0x23')](__dirname,_0x2867('0x33'),rs[_0x2867('0x34')](0x4)+_0x2867('0x45')))[_0x2867('0x32')](function(_0xf35d6e){_0xa7aba0[_0x2867('0x88')]=_0xf35d6e;return _0xa7aba0;});}return _0xa7aba0;});};exports[_0x2867('0x89')]=function(){return __dirname;}; \ No newline at end of file +var _0x77bc=['util','./aws','./google','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','close','download\x20error','https:','end','wav','error\x20convert','info','start','resolve','tmp','generate','.wav','writeFileSync','unlink','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','then','from','audioContent','base64','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','data','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','fulfillment','speech','score','status','code','metadata','isFallbackIntent','googleDialogflowV2','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','languageCode','responseId','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','.mp3','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','sox','google-tts-api','url','parse'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x77bc,0x196));var _0xc77b=function(_0x34f692,_0x31290b){_0x34f692=_0x34f692-0x0;var _0x3851e6=_0x77bc[_0x34f692];return _0x3851e6;};'use strict';var apiai=require(_0xc77b('0x0'));var BPromise=require(_0xc77b('0x1'));var dialogflow=require(_0xc77b('0x2'));var fs=require('fs');var http=require(_0xc77b('0x3'));var https=require(_0xc77b('0x4'));var md5=require(_0xc77b('0x5'));var path=require(_0xc77b('0x6'));var querystring=require('querystring');var rp=require('request-promise');var rs=require('randomstring');var sox=require(_0xc77b('0x7'));var tts=require(_0xc77b('0x8'));var urlParse=require(_0xc77b('0x9'))[_0xc77b('0xa')];var util=require(_0xc77b('0xb'));var aws=require(_0xc77b('0xc'));var google=require(_0xc77b('0xd'));var sestek=require(_0xc77b('0xe'));var tilde=require(_0xc77b('0xf'));var logger=require('../../../config/logger')(_0xc77b('0x10'));var ISPEECH_API=_0xc77b('0x11');function downloadFile(_0x4413e7,_0x344fe0){return new BPromise(function(_0x49d11b,_0x55c987){var _0x542d96=urlParse(_0x4413e7);var _0x216342=_0x542d96[_0xc77b('0x12')]==='https:'?https:http;var _0x5090df={'host':_0x542d96[_0xc77b('0x13')],'path':_0x542d96['path'],'headers':{'user-agent':_0xc77b('0x14')}};_0x216342[_0xc77b('0x15')](_0x5090df,function(_0x117606){if(_0x117606[_0xc77b('0x16')]!==0xc8){logger[_0xc77b('0x17')](_0xc77b('0x18')+_0x4413e7+_0xc77b('0x19')+_0x117606[_0xc77b('0x16')]+'\x20('+_0x117606['statusMessage']+')');_0x55c987(new Error(_0xc77b('0x18')+_0x4413e7+_0xc77b('0x19')+_0x117606[_0xc77b('0x16')]+'\x20('+_0x117606[_0xc77b('0x1a')]+')'));return;}var _0x2b0a76=fs[_0xc77b('0x1b')](_0x344fe0);_0x2b0a76['on'](_0xc77b('0x1c'),function(){logger['info']('finish\x20download\x20file');_0x2b0a76[_0xc77b('0x1d')](_0x49d11b);});_0x2b0a76['on']('error',function(_0xe6837){fs['unlink'](_0x344fe0);logger[_0xc77b('0x17')](_0xc77b('0x1e'),_0xe6837);_0x55c987(_0xe6837);});_0x117606['pipe'](_0x2b0a76);})['on'](_0xc77b('0x17'),function(_0x4728bb){logger[_0xc77b('0x17')](_0x4728bb);_0x55c987(_0x4728bb);})['end']();});}function uploadFile(_0x73f7c2){return new BPromise(function(_0x4af815,_0x2bb7ec){var _0x462612=urlParse(_0x73f7c2);var _0x14ac92=_0x462612[_0xc77b('0x12')]===_0xc77b('0x1f')?https:http;var _0x1642c2={'host':_0x462612['host'],'path':_0x462612[_0xc77b('0x6')],'headers':{'user-agent':_0xc77b('0x14')}};_0x14ac92[_0xc77b('0x15')](_0x1642c2,function(_0x23f5fe){if(_0x23f5fe[_0xc77b('0x16')]!==0xc8){_0x2bb7ec(new Error(_0xc77b('0x18')+_0x73f7c2+_0xc77b('0x19')+_0x23f5fe[_0xc77b('0x16')]+'\x20('+_0x23f5fe[_0xc77b('0x1a')]+')'));return;}var _0xeef821='';_0x23f5fe['on']('data',function(_0x276f96){_0xeef821+=_0x276f96;});_0x23f5fe['on'](_0xc77b('0x20'),function(){_0x4af815(_0xeef821);});})['on'](_0xc77b('0x17'),function(_0x18c668){_0x2bb7ec(_0x18c668);})[_0xc77b('0x20')]();});}function convertFile(_0x1d433c,_0x4bdaca){return new BPromise(function(_0x3e260f,_0x3d5df3){var _0x149d5c=sox['transcode'](_0x1d433c,_0x4bdaca,{'sampleRate':0x1f40,'format':_0xc77b('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x149d5c['on'](_0xc77b('0x17'),function(_0xaeea68){logger[_0xc77b('0x17')](_0xc77b('0x22'),_0xaeea68);_0x3d5df3(_0xaeea68);});_0x149d5c['on'](_0xc77b('0x20'),function(){logger[_0xc77b('0x23')]('finish\x20to\x20convert');_0x3e260f();});_0x149d5c[_0xc77b('0x24')]();});}function base64Decode(_0x5679ea,_0x1cc842){var _0x4c360a=path[_0xc77b('0x25')](__dirname,_0xc77b('0x26'),rs[_0xc77b('0x27')](0x4)+_0xc77b('0x28'));fs[_0xc77b('0x29')](_0x4c360a,_0x5679ea,'base64');return convertFile(_0x4c360a,_0x1cc842)['then'](function(){try{fs[_0xc77b('0x2a')](_0x4c360a);fs[_0xc77b('0x2b')](_0x1cc842,_0xc77b('0x2c'));}catch(_0x135885){logger[_0xc77b('0x17')](_0x135885);}return _0x1cc842[_0xc77b('0x2d')]('.')[0x0];});}function base64Encode(_0x49416c){var _0x1c7d9a=fs[_0xc77b('0x2e')](_0x49416c);return new Buffer(_0x1c7d9a)[_0xc77b('0x2f')]('base64');}exports[_0xc77b('0x30')]=function(_0x4fb837,_0x43817,_0x3f28f6,_0x3ea505,_0x25982a,_0x10d8b5){var _0xc0aa34,_0x1927c6;var _0x3f8772=_0xc77b('0x31');var _0x5b2901=_0xc77b('0x32')+_0x4fb837;var _0x3f9be0={};if(_0x43817===_0xc77b('0x33')){_0x3f9be0[_0xc77b('0x34')]={'ssml':_0x3f28f6};}else{_0x3f9be0[_0xc77b('0x34')]={'text':_0x3f28f6};};_0x3f9be0[_0xc77b('0x35')]={'languageCode':_0x3ea505,'ssmlGender':_0x25982a};_0x3f9be0[_0xc77b('0x36')]={'audioEncoding':_0xc77b('0x37'),'sampleRateHertz':0x1f40};var _0xef5772={'url':_0x3f8772+_0xc77b('0x38')+_0x5b2901,'method':_0xc77b('0x39'),'json':!![],'body':_0x3f9be0};return rp(_0xef5772)[_0xc77b('0x3a')](function(_0x5e82b2){return new BPromise(function(_0x4865d9,_0x39e46a){_0xc0aa34=path[_0xc77b('0x25')](__dirname,'tmp',rs[_0xc77b('0x27')](0x4)+'.mp3');var _0x1db25c=Buffer[_0xc77b('0x3b')](_0x5e82b2[_0xc77b('0x3c')],_0xc77b('0x3d'));return fs['writeFile'](_0xc0aa34,_0x1db25c,function(_0x32f179){_0x39e46a(_0x32f179);},function(_0x443564){fs['chmodSync'](_0xc0aa34,'777');_0x4865d9(_0x443564);});});})[_0xc77b('0x3a')](function(_0x573b7b){_0x1927c6=path[_0xc77b('0x25')](__dirname,_0xc77b('0x26'),rs[_0xc77b('0x27')](0x4)+_0xc77b('0x28'));return convertFile(_0xc0aa34,_0x1927c6);})[_0xc77b('0x3a')](function(){try{fs[_0xc77b('0x2a')](_0xc0aa34);fs[_0xc77b('0x2b')](_0x1927c6,_0xc77b('0x2c'));}catch(_0x2e5310){logger[_0xc77b('0x17')](_0x2e5310);}logger[_0xc77b('0x23')](_0xc77b('0x3e'),_0x1927c6['split']('.')[0x0]);return _0x1927c6['split']('.')[0x0];});};exports[_0xc77b('0x3f')]=function(_0x5cbac2,_0x123ee1){var _0x2855f5=_0xc77b('0x40');var _0x151f05,_0x3a1c30;var _0x109d23;var _0x188a76={'encoding':_0xc77b('0x41'),'method':_0xc77b('0x39'),'timeout':0x2710,'url':_0x2855f5,'headers':{'Content-Type':_0xc77b('0x42')},'body':_0xc77b('0x43')+encodeURIComponent(JSON[_0xc77b('0x44')]([[[_0xc77b('0x45'),JSON['stringify']([_0x5cbac2,_0x123ee1||'en',![],_0xc77b('0x46')]),null,'generic']]]))};return rp(_0x188a76)['then'](function(_0x308970){try{_0x109d23=eval(_0x308970[_0xc77b('0x47')](0x5))[0x0][0x2];}catch(_0x28b25f){throw new Error(_0xc77b('0x48')+_0x308970['data']);}if(!_0x109d23){if(_0x5cbac2[_0xc77b('0x49')]>0xc8){throw new Error(_0xc77b('0x4a'));}else{throw new Error('lang\x20\x22'+_0x123ee1+'\x22\x20might\x20not\x20exist');}}try{_0x109d23=eval(_0x109d23)[0x0];}catch(_0x4cc7d9){throw new Error(_0xc77b('0x48')+res[_0xc77b('0x4b')]);}const _0xdb0d6d=_0x109d23;_0x151f05=path[_0xc77b('0x25')](__dirname,_0xc77b('0x26'),rs[_0xc77b('0x27')](0x4)+'.mp3');fs[_0xc77b('0x29')](_0x151f05,_0x109d23,{'encoding':_0xc77b('0x3d')});_0x3a1c30=path[_0xc77b('0x25')](__dirname,_0xc77b('0x26'),rs[_0xc77b('0x27')](0x4)+_0xc77b('0x28'));return convertFile(_0x151f05,_0x3a1c30);})['then'](function(){try{fs[_0xc77b('0x2a')](_0x151f05);fs[_0xc77b('0x2b')](_0x3a1c30,_0xc77b('0x2c'));}catch(_0x4b9444){logger[_0xc77b('0x17')](_0x4b9444);}logger['info'](_0xc77b('0x4c'),_0x3a1c30['split']('.')[0x0]);return _0x3a1c30[_0xc77b('0x2d')]('.')[0x0];});};exports[_0xc77b('0x4d')]=function(_0x2bafd9,_0x331203,_0x50ff94){return google[_0xc77b('0x4e')](_0x2bafd9,_0x331203,_0x50ff94)[_0xc77b('0x3a')](function(_0x23cdaa){logger[_0xc77b('0x23')](_0x23cdaa[_0xc77b('0x4f')]);return rp(_0x23cdaa);})['then'](function(_0x1bb560){var _0xf5fcd5='';var _0x15ef01=0x0;try{fs['unlink'](_0x2bafd9);}catch(_0x3d07aa){logger[_0xc77b('0x17')](_0x3d07aa);}if(_0x1bb560&&_0x1bb560[_0xc77b('0x50')]){_0xf5fcd5=_0x1bb560['results']['map'](function(_0x178850){return _0x178850&&_0x178850[_0xc77b('0x51')][0x0]&&_0x178850[_0xc77b('0x51')][0x0]['transcript']?_0x178850[_0xc77b('0x51')][0x0][_0xc77b('0x52')]:'';})[_0xc77b('0x53')]('\x0a');_0x15ef01=_0x1bb560[_0xc77b('0x50')][_0xc77b('0x54')](function(_0x333df4){return _0x333df4&&_0x333df4[_0xc77b('0x51')][0x0]&&_0x333df4[_0xc77b('0x51')][0x0][_0xc77b('0x55')]?_0x333df4['alternatives'][0x0][_0xc77b('0x55')]:0x0;})[_0xc77b('0x53')]('\x0a');}logger[_0xc77b('0x23')](_0xc77b('0x56'),_0xf5fcd5);logger['info'](_0xc77b('0x57'),_0x15ef01);return{'transcript':_0xf5fcd5,'confidence':_0x15ef01};})[_0xc77b('0x58')](function(_0x139e8b){logger[_0xc77b('0x17')](_0xc77b('0x59'),_0x139e8b[_0xc77b('0x16')],_0x139e8b[_0xc77b('0x5a')],_0x139e8b[_0xc77b('0x5b')]);});};exports[_0xc77b('0x5c')]=function(_0x426f3e,_0x122289,_0x4000cf,_0x400593){var _0xa43f30=apiai(_0x122289,{'language':_0x400593||'en'});return _0xa43f30[_0xc77b('0x5d')](_0x4000cf,{'sessionId':md5(_0x426f3e)})['then'](function(_0x4d2fa7){logger[_0xc77b('0x23')](JSON[_0xc77b('0x44')](_0x4d2fa7));return{'source':_0x4d2fa7[_0xc77b('0x5e')][_0xc77b('0x5f')],'resolvedQuery':_0x4d2fa7['result'][_0xc77b('0x60')],'action':_0x4d2fa7['result'][_0xc77b('0x61')],'actionIncomplete':_0x4d2fa7['result']['actionIncomplete'],'speech':_0x4d2fa7[_0xc77b('0x5e')][_0xc77b('0x62')][_0xc77b('0x63')],'score':_0x4d2fa7[_0xc77b('0x5e')][_0xc77b('0x64')],'statusCode':_0x4d2fa7[_0xc77b('0x65')][_0xc77b('0x66')],'endConversation':_0x4d2fa7['result'][_0xc77b('0x67')]['endConversation']||![],'isFallbackIntent':_0x4d2fa7[_0xc77b('0x5e')][_0xc77b('0x67')][_0xc77b('0x68')]};});};exports[_0xc77b('0x69')]=function(_0x1f8997,_0x9da2af,_0x54d098,_0x113146,_0x21f1f6,_0x3a0816){var _0x7d4e71=_0x113146['replace'](/\\n/g,'\x0a');var _0x46f0e8={'credentials':{'private_key':_0x7d4e71,'client_email':_0x54d098}};var _0x5ed24d=new dialogflow['SessionsClient'](_0x46f0e8);var _0x17515c=_0x5ed24d['sessionPath'](_0x9da2af,md5(_0x1f8997));var _0x3b6487={'session':_0x17515c,'queryInput':{'text':{'text':_0x21f1f6,'languageCode':_0x3a0816}}};return _0x5ed24d[_0xc77b('0x6a')](_0x3b6487)['then'](function(_0xce1ca6){if(_0xce1ca6&&_0xce1ca6[_0xc77b('0x49')]){logger[_0xc77b('0x23')](_0xc77b('0x6b'),JSON[_0xc77b('0x44')](_0xce1ca6));var _0x35fd9d=_0xce1ca6[0x0];if(_0x35fd9d){var _0x53a32e={'action':_0x35fd9d[_0xc77b('0x6c')][_0xc77b('0x61')],'allRequiredParamsPresent':_0x35fd9d['queryResult']['allRequiredParamsPresent'],'endConversation':_0x35fd9d['queryResult']['diagnosticInfo']&&_0x35fd9d[_0xc77b('0x6c')][_0xc77b('0x6d')][_0xc77b('0x6e')]?_0x35fd9d[_0xc77b('0x6c')][_0xc77b('0x6d')][_0xc77b('0x6e')][_0xc77b('0x6f')][_0xc77b('0x70')]:![],'fulfillmentText':_0x35fd9d[_0xc77b('0x6c')][_0xc77b('0x71')],'intentName':_0x35fd9d[_0xc77b('0x6c')][_0xc77b('0x72')][_0xc77b('0x5a')],'intentDisplayName':_0x35fd9d['queryResult'][_0xc77b('0x72')][_0xc77b('0x73')],'isFallbackIntent':_0x35fd9d[_0xc77b('0x6c')][_0xc77b('0x72')]['isFallback'],'languageCode':_0x35fd9d[_0xc77b('0x6c')][_0xc77b('0x74')],'queryText':_0x35fd9d[_0xc77b('0x6c')]['queryText'],'responseId':_0x35fd9d[_0xc77b('0x75')],'score':_0x35fd9d[_0xc77b('0x6c')]['intentDetectionConfidence'],'speech':_0x35fd9d[_0xc77b('0x6c')]['fulfillmentText'],'providerResponse':JSON[_0xc77b('0x44')](_0xce1ca6)};return _0x53a32e;}}});};exports[_0xc77b('0x76')]=function(_0x408bb7,_0x234bf5,_0x46dc2f,_0x167eda){return tilde[_0xc77b('0x4e')](_0x408bb7,_0x234bf5,_0x46dc2f,_0x167eda)[_0xc77b('0x3a')](function(_0x1018f7){try{fs['unlink'](_0x408bb7);}catch(_0x16ce48){logger['error'](_0x16ce48);}logger[_0xc77b('0x23')](_0xc77b('0x77'),_0x1018f7[_0xc77b('0x52')]);logger[_0xc77b('0x23')](_0xc77b('0x78'),_0x1018f7[_0xc77b('0x55')]);return _0x1018f7;});};exports[_0xc77b('0x79')]=function(_0x52366b,_0x16c038,_0x1b7793,_0x56bc45,_0x4c6a4f,_0x4a3716){var _0x4ad172=path[_0xc77b('0x25')](__dirname,_0xc77b('0x26'),rs[_0xc77b('0x27')](0x4)+_0xc77b('0x7a'));var _0x725114;return aws['polly'](_0x52366b,_0x16c038,_0x1b7793,_0x56bc45,_0x4c6a4f,_0x4a3716,_0x4ad172)[_0xc77b('0x3a')](function(){_0x725114=path[_0xc77b('0x25')](__dirname,'tmp',rs[_0xc77b('0x27')](0x4)+_0xc77b('0x28'));return convertFile(_0x4ad172,_0x725114);})[_0xc77b('0x3a')](function(){try{fs[_0xc77b('0x2a')](_0x4ad172);fs[_0xc77b('0x2b')](_0x725114,'777');}catch(_0xe650e4){logger[_0xc77b('0x17')](_0xe650e4);}return _0x725114[_0xc77b('0x2d')]('.')[0x0];});};exports[_0xc77b('0x7b')]=function(_0x3b74e5,_0x23a858,_0x43497c,_0x33563d,_0x21ed96,_0x214753){return aws[_0xc77b('0x7c')](_0x3b74e5,_0x23a858,_0x43497c,_0x33563d,_0x21ed96,_0x214753)[_0xc77b('0x3a')](function(_0x2f9fb1){logger[_0xc77b('0x23')](JSON[_0xc77b('0x44')](_0x2f9fb1));return _0x2f9fb1;});};exports['ispeechTTS']=function(_0x2e9087,_0x381da2,_0x50d7c0,_0x563322){var _0x4b03a9=util[_0xc77b('0x7d')](_0xc77b('0x7e'),ISPEECH_API,_0x2e9087,encodeURIComponent(_0x381da2),_0x50d7c0,_0x563322);var _0x2b03c8=path[_0xc77b('0x25')](__dirname,_0xc77b('0x26'),rs['generate'](0x4)+'.mp3');var _0x16f51e;return downloadFile(_0x4b03a9,_0x2b03c8)[_0xc77b('0x3a')](function(){_0x16f51e=path['resolve'](__dirname,'tmp',rs[_0xc77b('0x27')](0x4)+_0xc77b('0x28'));return convertFile(_0x2b03c8,_0x16f51e);})[_0xc77b('0x3a')](function(){try{fs['unlink'](_0x2b03c8);fs['chmodSync'](_0x16f51e,'777');}catch(_0x2b670c){logger[_0xc77b('0x17')](_0x2b670c);}return _0x16f51e[_0xc77b('0x2d')]('.')[0x0];});};exports['ispeechASR']=function(_0x3052fc,_0x137e36,_0x3db1b8,_0x8192d7){var _0x7f17a5=util['format'](_0xc77b('0x7f'),ISPEECH_API,_0x137e36,_0x3db1b8,base64Encode(_0x3052fc),_0x8192d7?util[_0xc77b('0x7d')](_0xc77b('0x80'),encodeURIComponent(_0x8192d7)):_0xc77b('0x81'));return uploadFile(_0x7f17a5)['then'](function(_0x3c3f5a){return querystring['parse'](_0x3c3f5a);});};exports[_0xc77b('0x82')]=function(_0x4c6812,_0x494170){return sestek[_0xc77b('0x83')](_0x4c6812,_0x494170)[_0xc77b('0x3a')](function(_0x11b193){logger['info'](JSON[_0xc77b('0x44')](_0x11b193));var _0x4d9da1={'speech':_0x11b193[_0xc77b('0x84')],'action':_0x11b193[_0xc77b('0x85')]?_0x11b193[_0xc77b('0x85')][_0xc77b('0x86')]:undefined,'actiondata':_0x11b193[_0xc77b('0x85')]?_0x11b193['channelData'][_0xc77b('0x87')]:undefined};if(_0x11b193[_0xc77b('0x85')]&&_0x11b193['channelData']['AudioFromTts']){return base64Decode(_0x11b193[_0xc77b('0x85')][_0xc77b('0x88')][_0xc77b('0x89')],path[_0xc77b('0x25')](__dirname,'tmp',rs[_0xc77b('0x27')](0x4)+'.wav'))[_0xc77b('0x3a')](function(_0x2f2001){_0x4d9da1['audiofile']=_0x2f2001;return _0x4d9da1;});}return _0x4d9da1;});};exports[_0xc77b('0x8a')]=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 17404b3..c2d17e3 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 _0x946b=['./nda','exports'];(function(_0x579f9d,_0x827fad){var _0x2c640a=function(_0x5699be){while(--_0x5699be){_0x579f9d['push'](_0x579f9d['shift']());}};_0x2c640a(++_0x827fad);}(_0x946b,0x186));var _0xb946=function(_0x4cdeb6,_0x129d4c){_0x4cdeb6=_0x4cdeb6-0x0;var _0x2b68e0=_0x946b[_0x4cdeb6];return _0x2b68e0;};var nda=require(_0xb946('0x0'));module[_0xb946('0x1')]={'nda':nda}; \ No newline at end of file +var _0x50b4=['./nda','exports'];(function(_0x183f7b,_0x514925){var _0x3380e4=function(_0xa57138){while(--_0xa57138){_0x183f7b['push'](_0x183f7b['shift']());}};_0x3380e4(++_0x514925);}(_0x50b4,0xbc));var _0x450b=function(_0x32d9c6,_0x223bff){_0x32d9c6=_0x32d9c6-0x0;var _0x581958=_0x50b4[_0x32d9c6];return _0x581958;};var nda=require(_0x450b('0x0'));module[_0x450b('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 7dbbe31..fbde221 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 _0xc2cc=['calleridname','dnid','text','access_token','project','body','channelData','custom_action','CustomAction','custom_action_data','CustomActionData','stringify','url','../../../../../config/logger','agi','resolve','/token','password','POST','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2cc,0x70));var _0xcc2c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc2cc[_0x4a9fb1];return _0x348672;};'use strict';var rp=require('request-promise');var url=require(_0xcc2c('0x0'));var logger=require(_0xcc2c('0x1'))(_0xcc2c('0x2'));module['exports']=function(_0x2a1a4a,_0x52a81b){var _0x23bd62={'method':'POST','uri':url[_0xcc2c('0x3')](_0x52a81b['ndauth_url'],_0xcc2c('0x4')),'form':{'grant_type':'password','username':_0x52a81b['username'],'password':_0x52a81b[_0xcc2c('0x5')]},'json':!![]};return rp(_0x23bd62)['then'](function(_0x144b90){var _0x5a276f={'method':_0xcc2c('0x6'),'uri':url['resolve'](_0x52a81b['ndassistant_url'],_0xcc2c('0x7')),'body':{'type':_0x52a81b[_0xcc2c('0x8')]||_0xcc2c('0x9'),'channelId':_0xcc2c('0xa'),'conversation':{'id':_0x2a1a4a[_0xcc2c('0xb')]},'from':{'id':_0x2a1a4a[_0xcc2c('0xc')],'name':_0x2a1a4a[_0xcc2c('0xd')]},'recipient':{'id':_0x2a1a4a[_0xcc2c('0xe')],'name':_0x2a1a4a['extension']},'text':_0x52a81b[_0xcc2c('0xf')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x144b90[_0xcc2c('0x10')]},'json':!![]};if(_0x52a81b[_0xcc2c('0x11')]){_0x5a276f[_0xcc2c('0x12')][_0xcc2c('0x13')]['ProjectName']=_0x52a81b['project'];}if(_0x52a81b['ndagenerate_audio']=='1'){_0x5a276f[_0xcc2c('0x12')][_0xcc2c('0x13')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x52a81b[_0xcc2c('0x14')]){_0x5a276f['body'][_0xcc2c('0x13')][_0xcc2c('0x15')]=_0x52a81b[_0xcc2c('0x14')];if(_0x52a81b[_0xcc2c('0x16')]){_0x5a276f['body']['channelData'][_0xcc2c('0x17')]=_0x52a81b[_0xcc2c('0x16')];}}logger['info'](JSON[_0xcc2c('0x18')](_0x5a276f));return rp(_0x5a276f);});}; \ No newline at end of file +var _0xa1b9=['AudioOutputSettings','audio/wav','custom_action','CustomAction','CustomActionData','custom_action_data','info','stringify','request-promise','../../../../../config/logger','agi','exports','POST','ndauth_url','/token','password','username','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','calleridname','dnid','extension','Bearer\x20','access_token','project','channelData','ProjectName','ndagenerate_audio','body'];(function(_0x3877c1,_0x238c29){var _0x59056a=function(_0x3567cd){while(--_0x3567cd){_0x3877c1['push'](_0x3877c1['shift']());}};_0x59056a(++_0x238c29);}(_0xa1b9,0x71));var _0x9a1b=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa1b9[_0x3b5250];return _0xc844a1;};'use strict';var rp=require(_0x9a1b('0x0'));var url=require('url');var logger=require(_0x9a1b('0x1'))(_0x9a1b('0x2'));module[_0x9a1b('0x3')]=function(_0x3515cf,_0x353bb4){var _0x2250f4={'method':_0x9a1b('0x4'),'uri':url['resolve'](_0x353bb4[_0x9a1b('0x5')],_0x9a1b('0x6')),'form':{'grant_type':_0x9a1b('0x7'),'username':_0x353bb4[_0x9a1b('0x8')],'password':_0x353bb4['password']},'json':!![]};return rp(_0x2250f4)[_0x9a1b('0x9')](function(_0x534151){var _0x17b671={'method':_0x9a1b('0x4'),'uri':url[_0x9a1b('0xa')](_0x353bb4[_0x9a1b('0xb')],_0x9a1b('0xc')),'body':{'type':_0x353bb4['ndaactivity_type']||_0x9a1b('0xd'),'channelId':_0x9a1b('0xe'),'conversation':{'id':_0x3515cf[_0x9a1b('0xf')]},'from':{'id':_0x3515cf[_0x9a1b('0x10')],'name':_0x3515cf[_0x9a1b('0x11')]},'recipient':{'id':_0x3515cf[_0x9a1b('0x12')],'name':_0x3515cf[_0x9a1b('0x13')]},'text':_0x353bb4['text'],'channelData':{}},'headers':{'Authorization':_0x9a1b('0x14')+_0x534151[_0x9a1b('0x15')]},'json':!![]};if(_0x353bb4[_0x9a1b('0x16')]){_0x17b671['body'][_0x9a1b('0x17')][_0x9a1b('0x18')]=_0x353bb4[_0x9a1b('0x16')];}if(_0x353bb4[_0x9a1b('0x19')]=='1'){_0x17b671[_0x9a1b('0x1a')][_0x9a1b('0x17')][_0x9a1b('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x9a1b('0x1c')};}if(_0x353bb4[_0x9a1b('0x1d')]){_0x17b671[_0x9a1b('0x1a')]['channelData'][_0x9a1b('0x1e')]=_0x353bb4[_0x9a1b('0x1d')];if(_0x353bb4['custom_action_data']){_0x17b671[_0x9a1b('0x1a')][_0x9a1b('0x17')][_0x9a1b('0x1f')]=_0x353bb4[_0x9a1b('0x20')];}}logger[_0x9a1b('0x21')](JSON[_0x9a1b('0x22')](_0x17b671));return rp(_0x17b671);});}; \ 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 97f8717..79fec3b 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 _0xd765=['./lib/api','exports'];(function(_0x539fef,_0x17f310){var _0x1c9d6f=function(_0x562903){while(--_0x562903){_0x539fef['push'](_0x539fef['shift']());}};_0x1c9d6f(++_0x17f310);}(_0xd765,0xdc));var _0x5d76=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xd765[_0x1cc8fe];return _0x230054;};'use strict';var asr=require(_0x5d76('0x0'));module[_0x5d76('0x1')]=function(_0x514e8a,_0x7d80fb,_0x5886d0,_0x2c7783){return asr(_0x514e8a,_0x7d80fb,_0x5886d0,_0x2c7783);}; \ No newline at end of file +var _0x4ab9=['./lib/api'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x4ab9,0x15b));var _0x94ab=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x4ab9[_0x199572];return _0x13cfa3;};'use strict';var asr=require(_0x94ab('0x0'));module['exports']=function(_0x384585,_0x5bf072,_0x306129,_0x1b45f0){return asr(_0x384585,_0x5bf072,_0x306129,_0x1b45f0);}; \ 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 c3550b1..41b4424 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 _0x4d23=['send','createReadStream','data','close','stringify','terminate','parse','status','result','final','hypotheses','transcript','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','bluebird','lodash','moment','crypto','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','unix'];(function(_0xb2f2a2,_0x4726c3){var _0x3d5bcf=function(_0x5eef61){while(--_0x5eef61){_0xb2f2a2['push'](_0xb2f2a2['shift']());}};_0x3d5bcf(++_0x4726c3);}(_0x4d23,0xcf));var _0x34d2=function(_0x305ff9,_0x19aa7f){_0x305ff9=_0x305ff9-0x0;var _0x58095e=_0x4d23[_0x305ff9];return _0x58095e;};'use strict';var BPromise=require(_0x34d2('0x0'));var _=require(_0x34d2('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x34d2('0x2'));var crypto=require(_0x34d2('0x3'));var logger=require('../../../../../../config/logger')(_0x34d2('0x4'));module['exports']=function(_0x5e0bef,_0x11fbeb,_0x30f82f,_0x469084){return new BPromise(function(_0x14ba72,_0x13ea69){logger[_0x34d2('0x5')](_0x34d2('0x6'),_0x469084||_0x34d2('0x7'));var _0x7ae5ab=new WebSocket(_0x469084||_0x34d2('0x7'),{'perMessageDeflate':![]});var _0x58705e='';var _0x45e17a='0';var _0x4c1e22='1';var _0x250780=_0x34d2('0x8');function _0x3b3148(_0x12e10e){var _0x42d1fa=crypto[_0x34d2('0x9')]('sha1');_0x42d1fa[_0x34d2('0xa')](_0x12e10e);return _0x42d1fa[_0x34d2('0xb')](_0x34d2('0xc'));}function _0x126df0(){try{logger['info'](_0x34d2('0xd'));var _0x5edc99=moment()[_0x34d2('0xe')]();var _0x39daa8=_0x3b3148(_0x5edc99+_0x11fbeb+_0x30f82f);_0x7ae5ab[_0x34d2('0xf')](JSON['stringify']({'appID':_0x11fbeb,'timestamp':_0x5edc99,'appKey':_0x39daa8}));var _0x27c1c2=fs[_0x34d2('0x10')](_0x5e0bef);_0x27c1c2['on'](_0x34d2('0x11'),function(_0xbe41c1){_0x7ae5ab[_0x34d2('0xf')](_0xbe41c1);});_0x27c1c2['on'](_0x34d2('0x12'),function(){_0x7ae5ab[_0x34d2('0xf')]('EOS');});}catch(_0x10355f){logger['error']('Tilde\x20ASR\x20send\x20error',JSON[_0x34d2('0x13')](_0x10355f));_0x7ae5ab[_0x34d2('0x14')]();}}function _0x509d9c(_0x39efde){try{if(_0x39efde){var _0x318ebb=JSON[_0x34d2('0x15')](_0x39efde);switch(_0x318ebb[_0x34d2('0x16')]){case 0x0:if(_0x318ebb[_0x34d2('0x17')]){if(_0x318ebb[_0x34d2('0x17')][_0x34d2('0x18')]){logger[_0x34d2('0x5')]('Tilde\x20ASR\x20hypoteses',JSON[_0x34d2('0x13')](_0x318ebb[_0x34d2('0x17')][_0x34d2('0x19')]));_0x58705e=_0x318ebb[_0x34d2('0x17')][_0x34d2('0x19')][0x0][_0x34d2('0x1a')];_0x45e17a=_0x318ebb['result'][_0x34d2('0x19')][0x0]['likelihood'];_0x4c1e22='0';_0x250780='Success.';_0x7ae5ab[_0x34d2('0x14')]();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x4c1e22='1';_0x250780=_0x34d2('0x8');break;case 0x2:logger[_0x34d2('0x5')](_0x34d2('0x1b'));_0x4c1e22='2';_0x250780=_0x34d2('0x1b');break;case 0x9:logger[_0x34d2('0x5')](_0x34d2('0x1c'));_0x4c1e22='9';_0x250780=_0x34d2('0x1c');break;case 0xa:logger['info']('Authentication\x20failed.');_0x4c1e22='10';_0x250780=_0x34d2('0x1d');break;case 0xb:logger[_0x34d2('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x4c1e22='11';_0x250780=_0x34d2('0x1e');}}}catch(_0x226f9f){logger[_0x34d2('0x1f')](_0x34d2('0x20'),JSON[_0x34d2('0x13')](_0x226f9f));_0x7ae5ab[_0x34d2('0x14')]();}}function _0x41ce39(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x14ba72({'transcript':_0x58705e,'confidence':_0x45e17a,'status':_0x4c1e22,'status_message':_0x250780});}function _0x59d497(_0x9f3986){logger[_0x34d2('0x1f')](_0x34d2('0x21'));if(!_[_0x34d2('0x22')](_0x9f3986)){logger['error'](_[_0x34d2('0x23')](_0x9f3986)?JSON[_0x34d2('0x13')](_0x9f3986):_0x9f3986);}}_0x7ae5ab['on']('open',_0x126df0);_0x7ae5ab['on'](_0x34d2('0x24'),_0x509d9c);_0x7ae5ab['on'](_0x34d2('0x12'),_0x41ce39);_0x7ae5ab['on']('error',_0x59d497);});}; \ No newline at end of file +var _0x7b0f=['data','close','EOS','error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','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','isObject','message','bluebird','lodash','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','unix','send','stringify','createReadStream'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7b0f,0xd7));var _0xf7b0=function(_0xfb1832,_0x1e8ab4){_0xfb1832=_0xfb1832-0x0;var _0x48831e=_0x7b0f[_0xfb1832];return _0x48831e;};'use strict';var BPromise=require(_0xf7b0('0x0'));var _=require(_0xf7b0('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xf7b0('0x2'));var logger=require(_0xf7b0('0x3'))(_0xf7b0('0x4'));module[_0xf7b0('0x5')]=function(_0x13b8b2,_0x353fa5,_0x4407d4,_0x92239b){return new BPromise(function(_0x552f4a,_0x469f9a){logger[_0xf7b0('0x6')](_0xf7b0('0x7'),_0x92239b||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x46473b=new WebSocket(_0x92239b||_0xf7b0('0x8'),{'perMessageDeflate':![]});var _0x2c8188='';var _0x5ae47e='0';var _0x40352a='1';var _0x216523=_0xf7b0('0x9');function _0x29f937(_0x521aaf){var _0xe30156=crypto[_0xf7b0('0xa')](_0xf7b0('0xb'));_0xe30156[_0xf7b0('0xc')](_0x521aaf);return _0xe30156[_0xf7b0('0xd')](_0xf7b0('0xe'));}function _0x54e183(){try{logger[_0xf7b0('0x6')]('Open\x20Tilde\x20ASR\x20socket');var _0x14b9a4=moment()[_0xf7b0('0xf')]();var _0x1f8b77=_0x29f937(_0x14b9a4+_0x353fa5+_0x4407d4);_0x46473b[_0xf7b0('0x10')](JSON[_0xf7b0('0x11')]({'appID':_0x353fa5,'timestamp':_0x14b9a4,'appKey':_0x1f8b77}));var _0xdfb3c=fs[_0xf7b0('0x12')](_0x13b8b2);_0xdfb3c['on'](_0xf7b0('0x13'),function(_0x3bd7b0){_0x46473b['send'](_0x3bd7b0);});_0xdfb3c['on'](_0xf7b0('0x14'),function(){_0x46473b[_0xf7b0('0x10')](_0xf7b0('0x15'));});}catch(_0x4b4334){logger[_0xf7b0('0x16')]('Tilde\x20ASR\x20send\x20error',JSON[_0xf7b0('0x11')](_0x4b4334));_0x46473b[_0xf7b0('0x17')]();}}function _0x23d85f(_0x26b1d5){try{if(_0x26b1d5){var _0x474c7d=JSON[_0xf7b0('0x18')](_0x26b1d5);switch(_0x474c7d[_0xf7b0('0x19')]){case 0x0:if(_0x474c7d[_0xf7b0('0x1a')]){if(_0x474c7d[_0xf7b0('0x1a')][_0xf7b0('0x1b')]){logger[_0xf7b0('0x6')](_0xf7b0('0x1c'),JSON[_0xf7b0('0x11')](_0x474c7d[_0xf7b0('0x1a')]['hypotheses']));_0x2c8188=_0x474c7d[_0xf7b0('0x1a')][_0xf7b0('0x1d')][0x0]['transcript'];_0x5ae47e=_0x474c7d[_0xf7b0('0x1a')][_0xf7b0('0x1d')][0x0]['likelihood'];_0x40352a='0';_0x216523=_0xf7b0('0x1e');_0x46473b[_0xf7b0('0x17')]();}}break;case 0x1:logger[_0xf7b0('0x6')](_0xf7b0('0x9'));_0x40352a='1';_0x216523=_0xf7b0('0x9');break;case 0x2:logger[_0xf7b0('0x6')](_0xf7b0('0x1f'));_0x40352a='2';_0x216523=_0xf7b0('0x1f');break;case 0x9:logger[_0xf7b0('0x6')](_0xf7b0('0x20'));_0x40352a='9';_0x216523=_0xf7b0('0x20');break;case 0xa:logger['info']('Authentication\x20failed.');_0x40352a='10';_0x216523=_0xf7b0('0x21');break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x40352a='11';_0x216523=_0xf7b0('0x22');}}}catch(_0x386a6f){logger[_0xf7b0('0x16')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xf7b0('0x11')](_0x386a6f));_0x46473b[_0xf7b0('0x17')]();}}function _0x137749(){logger[_0xf7b0('0x6')](_0xf7b0('0x23'));_0x552f4a({'transcript':_0x2c8188,'confidence':_0x5ae47e,'status':_0x40352a,'status_message':_0x216523});}function _0x37fb0d(_0x3ef372){logger[_0xf7b0('0x16')](_0xf7b0('0x24'));if(!_['isNil'](_0x3ef372)){logger[_0xf7b0('0x16')](_[_0xf7b0('0x25')](_0x3ef372)?JSON[_0xf7b0('0x11')](_0x3ef372):_0x3ef372);}}_0x46473b['on']('open',_0x54e183);_0x46473b['on'](_0xf7b0('0x26'),_0x23d85f);_0x46473b['on'](_0xf7b0('0x14'),_0x137749);_0x46473b['on']('error',_0x37fb0d);});}; \ 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 406551d..15de46b 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 _0xee2e=['exports','./asr'];(function(_0x237d69,_0x59261d){var _0x2e07b8=function(_0xd3b27a){while(--_0xd3b27a){_0x237d69['push'](_0x237d69['shift']());}};_0x2e07b8(++_0x59261d);}(_0xee2e,0xb7));var _0xeee2=function(_0xf237cf,_0x4a111){_0xf237cf=_0xf237cf-0x0;var _0xad0e67=_0xee2e[_0xf237cf];return _0xad0e67;};var asr=require(_0xeee2('0x0'));module[_0xeee2('0x1')]={'asr':asr}; \ No newline at end of file +var _0xf77c=['./asr','exports'];(function(_0x24d754,_0x18e9ff){var _0x34c426=function(_0x266426){while(--_0x266426){_0x24d754['push'](_0x24d754['shift']());}};_0x34c426(++_0x18e9ff);}(_0xf77c,0x1dc));var _0xcf77=function(_0x53bde7,_0xe2ca44){_0x53bde7=_0x53bde7-0x0;var _0x52d7f1=_0xf77c[_0x53bde7];return _0x52d7f1;};var asr=require(_0xcf77('0x0'));module[_0xcf77('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 9992979..bd731c4 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c44[_0x2641f9];return _0x585741;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file +var _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(_0x5d07ff,_0x1f976f){var _0x5226ad=function(_0x1653a4){while(--_0x1653a4){_0x5d07ff['push'](_0x5d07ff['shift']());}};_0x5226ad(++_0x1f976f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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 7302032..40593fe 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 _0xcb10=['odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','Executed\x20command\x20%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','maxdigit','test','mindigit','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','GOAL\x20%s','goalname','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_access_key_id','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ispeechASR','ISPEECH_ASR_%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','.wav','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','maxRetry','response','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','statusMessage','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','join','exports','util','lodash','odbc','randomstring','mustache','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','getsecretdigits','channel','rpc','catch','prototype','getVoiceQueue','getVoiceQueueById','then','name','getSquareProjectById','getSquareOdbc','dsn','getUser','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','map','Intervals','interval','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','callerid','createSquareRecording','calleridname','context','priority','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','ssmlGender','MALE','MP3','googleTTS','restAPI','url','method','number','timeout','includes','POST','PUT','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeech_asr_language','isConfigured','model','awsPolly','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','googleASR','google_asr_language','tildeASR','appid','appsecret','agicommand','clone','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','format','setVariable','replaceAllVariables','split','replaceAll','getVariable','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','sync','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','command','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','list_id','no\x20list\x20selected','add','delay','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','noop','sestektts','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block'];(function(_0x2edf9e,_0x4f1203){var _0x33a6b1=function(_0xc4aa3c){while(--_0xc4aa3c){_0x2edf9e['push'](_0x2edf9e['shift']());}};_0x33a6b1(++_0x4f1203);}(_0xcb10,0x104));var _0x0cb1=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xcb10[_0x1beef3];return _0x5af964;};'use strict';var fs=require('fs');var util=require(_0x0cb1('0x0'));var _=require(_0x0cb1('0x1'));var sh=require('shelljs');var odbc=require(_0x0cb1('0x2'))();var rs=require(_0x0cb1('0x3'));var moment=require('moment');var Mustache=require(_0x0cb1('0x4'));var rp=require('request-promise');var logger=require(_0x0cb1('0x5'))(_0x0cb1('0x6'));var config=require(_0x0cb1('0x7'));var shared=require(_0x0cb1('0x8'));var scripts=require(_0x0cb1('0x9'));var FILES_PATH=_0x0cb1('0xa');var recursiveMapAttributes=[_0x0cb1('0xb'),_0x0cb1('0xc')];var verticesWithRetry=['menu',_0x0cb1('0xd'),_0x0cb1('0xe')];var AGIVertices=function(_0xe9ca1c,_0x46657b,_0x41e0d2){this[_0x0cb1('0xf')]=_0xe9ca1c;this[_0x0cb1('0x10')]=_0x46657b;this['mailRpc']=_0x41e0d2;};AGIVertices['prototype']['getVariable']=function(_0x1c97f2,_0x75e7d9){this['rpc']['getVariableById'](_0x1c97f2)['then'](function(_0x3201b5){_0x75e7d9(null,_0x3201b5?_0x3201b5['name']:![]);})[_0x0cb1('0x11')](function(_0x1c5680){_0x75e7d9(_0x1c5680);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x13')]=function(_0x831933,_0x29ff45){this['rpc'][_0x0cb1('0x14')](_0x831933)[_0x0cb1('0x15')](function(_0x49e6c7){_0x29ff45(null,_0x49e6c7?_0x49e6c7[_0x0cb1('0x16')]:![]);})['catch'](function(_0x3e6e6b){_0x29ff45(_0x3e6e6b);});};AGIVertices[_0x0cb1('0x12')]['getSquareProject']=function(_0x39d0ac,_0x24315d){this[_0x0cb1('0x10')][_0x0cb1('0x17')](_0x39d0ac)['then'](function(_0x2cda93){_0x24315d(null,_0x2cda93?_0x2cda93[_0x0cb1('0x16')]:![]);})[_0x0cb1('0x11')](function(_0x5bd690){_0x24315d(_0x5bd690);});};AGIVertices['prototype'][_0x0cb1('0x18')]=function(_0x109db9,_0x592a2b){this[_0x0cb1('0x10')]['getSquareOdbcById'](_0x109db9)[_0x0cb1('0x15')](function(_0x5d77c2){_0x592a2b(null,_0x5d77c2?_0x5d77c2[_0x0cb1('0x19')]:![]);})[_0x0cb1('0x11')](function(_0x39c2bb){_0x592a2b(_0x39c2bb);});};AGIVertices['prototype'][_0x0cb1('0x1a')]=function(_0x1f4702,_0x95f9a){this[_0x0cb1('0x10')]['getUserById'](_0x1f4702)[_0x0cb1('0x15')](function(_0x5215d7){_0x95f9a(null,_0x5215d7?_0x5215d7[_0x0cb1('0x16')]:![]);})[_0x0cb1('0x11')](function(_0x40b6a2){_0x95f9a(_0x40b6a2);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x1b')]=function(_0x1e82db,_0x571f50){this[_0x0cb1('0x10')][_0x0cb1('0x1c')](_0x1e82db)[_0x0cb1('0x15')](function(_0x21189f){_0x571f50(null,_0x21189f?_0x21189f[_0x0cb1('0x16')]:![]);})[_0x0cb1('0x11')](function(_0x4a45b5){_0x571f50(_0x4a45b5);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x1d')]=function(_0x2a187b,_0x4ea6e1){var _0x2e248e=this;this['rpc'][_0x0cb1('0x1e')](_0x2a187b)[_0x0cb1('0x15')](function(_0x2eea1a){_0x4ea6e1(null,_0x2eea1a?_0x2e248e[_0x0cb1('0x1f')](_0x2eea1a[_0x0cb1('0x20')]):![]);})['catch'](function(_0x38b859){_0x4ea6e1(_0x38b859);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x21')]=function(_0x91643e,_0x569058){this['rpc'][_0x0cb1('0x22')](_0x91643e)[_0x0cb1('0x15')](function(_0x269183){_0x569058(null,_0x269183?_0x269183:![]);})[_0x0cb1('0x11')](function(_0x2e9ff3){_0x569058(_0x2e9ff3);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x23')]=function(_0x369f30,_0x36622f,_0x2d4f12){this['mailRpc'][_0x0cb1('0x23')](_0x369f30,_0x36622f)['then'](function(){_0x2d4f12(null);})['catch'](function(_0x2b2830){_0x2d4f12(_0x2b2830);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x24')]=function(_0xbc3d46,_0x1bcdbb){this[_0x0cb1('0x10')]['getIntervalById'](_0xbc3d46)[_0x0cb1('0x15')](function(_0x313e66){if(_0x313e66){if(_0x313e66[_0x0cb1('0x25')]){_0x1bcdbb(null,[_0x313e66['interval']]);}else{_0x1bcdbb(null,_[_0x0cb1('0x26')](_0x313e66[_0x0cb1('0x27')],_0x0cb1('0x28')));}}else{_0x1bcdbb(null,![]);}})[_0x0cb1('0x11')](function(_0x438bd8){_0x1bcdbb(_0x438bd8);});};AGIVertices['prototype'][_0x0cb1('0x1f')]=function(_0x394835){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0x394835);};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x29')]=function(_0x5ba13a,_0x49e9f9,_0x5da7b3){odbc[_0x0cb1('0x2a')](_0x5ba13a,function(_0xc92b4b){if(_0xc92b4b){logger[_0x0cb1('0x2b')](_0x0cb1('0x2c'),_0xc92b4b);_0x5da7b3(_0xc92b4b);}else{logger[_0x0cb1('0x2d')](_0x0cb1('0x2e'));odbc[_0x0cb1('0x2f')](_0x49e9f9,function(_0x32b34c,_0x52e4ae){if(_0x32b34c){logger['info']('Error\x20executing\x20query\x20%s',_0x49e9f9);_0x5da7b3(_0x32b34c);}else{logger[_0x0cb1('0x2d')]('Query\x20executed\x20correctly\x20%s',_0x49e9f9);odbc[_0x0cb1('0x30')](function(_0x32f48b){if(_0x32f48b){logger[_0x0cb1('0x2b')](_0x0cb1('0x31'),_0x32f48b);}_0x5da7b3(null,_0x52e4ae);});}});}});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x32')]=function(_0x520930,_0x5c229a){this[_0x0cb1('0x10')][_0x0cb1('0x33')](_0x520930)[_0x0cb1('0x15')](function(_0x445b1c){_0x5c229a(null,_0x445b1c?_0x445b1c:![]);})[_0x0cb1('0x11')](function(_0x5e5a8d){_0x5c229a(_0x5e5a8d);});};AGIVertices['prototype'][_0x0cb1('0x34')]=function(_0x9f4662,_0x497e89){this[_0x0cb1('0x10')][_0x0cb1('0x34')](_0x9f4662)[_0x0cb1('0x15')](function(_0x295648){_0x497e89(null,_0x295648);})['catch'](function(_0x5e49b7){_0x497e89(_0x5e49b7);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x35')]=function(_0x14e9e3,_0xfbdf4a,_0x1a6c35){this[_0x0cb1('0x10')][_0x0cb1('0x35')]({'uniqueid':this[_0x0cb1('0xf')][_0x0cb1('0x36')],'node':_0x14e9e3[_0x0cb1('0x37')],'application':_0x14e9e3['agicommand'],'data':_0xfbdf4a||null,'project_name':this['channel']['arg_1'],'callerid':this[_0x0cb1('0xf')][_0x0cb1('0x38')]})[_0x0cb1('0x15')](function(_0x52274c){if(_0x1a6c35){_0x1a6c35(null,_0x52274c);}})['catch'](function(_0x20b2d7){if(_0x1a6c35){_0x1a6c35(_0x20b2d7);}});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x39')]=function(_0x314270,_0x872116,_0x180d33,_0x39462c){this[_0x0cb1('0x10')]['createSquareRecording']({'uniqueid':this[_0x0cb1('0xf')][_0x0cb1('0x36')],'callerid':this[_0x0cb1('0xf')][_0x0cb1('0x38')],'calleridname':this[_0x0cb1('0xf')][_0x0cb1('0x3a')],'context':this[_0x0cb1('0xf')][_0x0cb1('0x3b')],'extension':this[_0x0cb1('0xf')]['extension'],'priority':this[_0x0cb1('0xf')][_0x0cb1('0x3c')],'accountcode':this[_0x0cb1('0xf')][_0x0cb1('0x3d')],'dnid':this['channel'][_0x0cb1('0x3e')],'projectName':this['channel'][_0x0cb1('0x3f')],'saveName':_0x872116,'filename':_0x314270[_0x0cb1('0x40')]||_0x872116,'savePath':_0x180d33})[_0x0cb1('0x15')](function(_0x59021f){_0x39462c(null,_0x59021f);})[_0x0cb1('0x11')](function(_0x5ec99c){_0x39462c(_0x5ec99c);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x41')]=function(_0x3bf959,_0x30aafe,_0x39bfbb,_0x431f1b,_0x3dc6bb){this['rpc']['createSquareMessage']({'uniqueid':this[_0x0cb1('0xf')][_0x0cb1('0x36')],'body':_0x3bf959,'direction':_0x30aafe,'providerName':_0x39bfbb,'providerResponse':_0x431f1b})[_0x0cb1('0x15')](function(_0x39e48f){if(_0x3dc6bb){_0x3dc6bb(null,_0x39e48f);}})[_0x0cb1('0x11')](function(_0x37db74){if(_0x3dc6bb){_0x3dc6bb(_0x37db74);}});};AGIVertices[_0x0cb1('0x12')]['createCmContact']=function(_0x4f0d23,_0x337d6d){this[_0x0cb1('0x10')][_0x0cb1('0x42')]({'firstName':_[_0x0cb1('0x43')](_0x4f0d23['name'])||_[_0x0cb1('0x44')](_0x4f0d23[_0x0cb1('0x16')])?_0x0cb1('0x45')+Math[_0x0cb1('0x46')]():_0x4f0d23[_0x0cb1('0x16')],'lastName':_[_0x0cb1('0x43')](_0x4f0d23[_0x0cb1('0x47')])||_[_0x0cb1('0x44')](_0x4f0d23[_0x0cb1('0x47')])?null:_0x4f0d23[_0x0cb1('0x47')],'phone':_0x4f0d23[_0x0cb1('0x48')],'ListId':_0x4f0d23['list_id'],'scheduledat':_0x4f0d23[_0x0cb1('0x49')],'callbackUniqueid':this[_0x0cb1('0xf')][_0x0cb1('0x36')],'tags':'callback','description':_0x0cb1('0x4a')+_0x4f0d23[_0x0cb1('0x49')][_0x0cb1('0x4b')](),'priority':_0x4f0d23[_0x0cb1('0x4c')]})[_0x0cb1('0x15')](function(_0x35a48c){_0x337d6d(null,_0x35a48c);})['catch'](function(_0xfd0bf5){_0x337d6d(_0xfd0bf5);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x4d')]=function(_0x2ccc64,_0x394ce3){this['rpc'][_0x0cb1('0x4e')](_0x2ccc64)[_0x0cb1('0x15')](function(_0x79423b){_0x394ce3(null,_0x79423b?_0x79423b['name']:![]);})['catch'](function(_0x44de7d){_0x394ce3(_0x44de7d);});};AGIVertices['prototype'][_0x0cb1('0x4f')]=function(_0x5e82c3,_0x27bf62,_0x53d63b){var _0x2619cc={'role':_0x0cb1('0x50')};_0x2619cc[_0x5e82c3]=this[_0x0cb1('0xf')][_0x0cb1('0x38')];this[_0x0cb1('0x10')][_0x0cb1('0x4f')](_0x2619cc,_0x27bf62,this[_0x0cb1('0xf')][_0x0cb1('0x36')])[_0x0cb1('0x15')](function(_0x8baf55){_0x53d63b(null,_[_0x0cb1('0x44')](_0x8baf55)?![]:!![]);})[_0x0cb1('0x11')](function(_0x1fe009){logger['error'](_0x1fe009);_0x53d63b(null,![]);});};AGIVertices[_0x0cb1('0x12')]['agentUnpause']=function(_0x3fc09e,_0x27b4ff){var _0x114085={'role':_0x0cb1('0x50')};_0x114085[_0x3fc09e]=this[_0x0cb1('0xf')]['callerid'];this['rpc'][_0x0cb1('0x51')](_0x114085)[_0x0cb1('0x15')](function(_0x9b3e16){_0x27b4ff(null,_[_0x0cb1('0x44')](_0x9b3e16)?![]:!![]);})[_0x0cb1('0x11')](function(_0x23abd1){logger[_0x0cb1('0x2b')](_0x23abd1);_0x27b4ff(null,![]);});};AGIVertices[_0x0cb1('0x12')]['agentLogout']=function(_0x2ef04f,_0x19a402){var _0x363206={'role':_0x0cb1('0x50')};_0x363206[_0x2ef04f]=this[_0x0cb1('0xf')][_0x0cb1('0x38')];this['rpc'][_0x0cb1('0x52')](_0x363206)[_0x0cb1('0x15')](function(_0x2d9ee1){_0x19a402(null,_['isNil'](_0x2d9ee1)?![]:!![]);})['catch'](function(_0x3b102){logger[_0x0cb1('0x2b')](_0x3b102);_0x19a402(null,![]);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x53')]=function(_0x3330d0,_0x1e9d85){var _0x50e4df={'role':'agent'};_0x50e4df[_0x3330d0]=this['channel'][_0x0cb1('0x38')];var _0xb9714c=_0x3330d0!=_0x0cb1('0x54')?util['format'](_0x0cb1('0x55'),_0x0cb1('0x56'),this[_0x0cb1('0xf')]['callerid']):undefined;this['rpc']['agentLogin'](_0x50e4df,_0xb9714c)['then'](function(_0x32aa14){_0x1e9d85(null,_[_0x0cb1('0x44')](_0x32aa14)?![]:!![]);})[_0x0cb1('0x11')](function(_0x277a01){logger[_0x0cb1('0x2b')](_0x277a01);_0x1e9d85(null,![]);});};AGIVertices['prototype'][_0x0cb1('0x57')]=function(_0x24c1b0,_0xc5d2d9){sh[_0x0cb1('0x58')](_[_0x0cb1('0x59')](_0x24c1b0),function(_0x329cd9,_0xd1daf8){var _0x20071a=_0xd1daf8[_0x0cb1('0x5a')](/(\r\n|\n|\r)/gm,'');_0xc5d2d9(null,_0x20071a);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x5b')]=function(_0x16f23b,_0x405885){scripts[_0x0cb1('0x5b')](_0x16f23b[_0x0cb1('0x5c')],_0x16f23b['google_cloud_tts_text_type']||'text',_0x16f23b[_0x0cb1('0x5d')],_0x16f23b[_0x0cb1('0x5e')]||'en-US',_0x16f23b[_0x0cb1('0x5f')]||_0x0cb1('0x60'),_0x16f23b['audioEncoding']||_0x0cb1('0x61'))[_0x0cb1('0x15')](function(_0x5aa750){_0x405885(null,_0x5aa750);})['catch'](function(_0x1e4496){_0x405885(_0x1e4496);});};AGIVertices[_0x0cb1('0x12')]['googleTTS']=function(_0x287f31,_0x50080d){scripts[_0x0cb1('0x62')](_0x287f31['text'],_0x287f31['google_tts_language']||'en',0x1)[_0x0cb1('0x15')](function(_0x2f93d3){_0x50080d(null,_0x2f93d3);})[_0x0cb1('0x11')](function(_0x13a20d){_0x50080d(_0x13a20d);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x63')]=function(_0xa9bace,_0x4209a1){var _0x370df7={'uri':_0xa9bace[_0x0cb1('0x64')],'method':_0xa9bace[_0x0cb1('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0xa9bace['timeout'])===_0x0cb1('0x66')&&parseInt(_0xa9bace[_0x0cb1('0x67')])>=0x1?parseInt(_0xa9bace[_0x0cb1('0x67')])*0x3e8:0x5*0x3e8};if(_[_0x0cb1('0x68')]([_0x0cb1('0x69'),_0x0cb1('0x6a')],_0x370df7['method']['toUpperCase']())){try{_0x370df7[_0x0cb1('0x6b')]=_0xa9bace['rawBody']?JSON[_0x0cb1('0x6c')](_0xa9bace['rawBody']):{};}catch(_0x6ccdb7){logger[_0x0cb1('0x2b')](_0x0cb1('0x6d'),_0x6ccdb7);}}try{_0x370df7[_0x0cb1('0x6e')]=_0xa9bace[_0x0cb1('0xb')]?JSON[_0x0cb1('0x6c')](_0xa9bace[_0x0cb1('0xb')]):{};}catch(_0x3b5479){logger[_0x0cb1('0x2b')](_0x0cb1('0x6f'),_0x3b5479);}if(_0xa9bace[_0x0cb1('0x70')]){try{var _0x1a0ac8=require(_0xa9bace[_0x0cb1('0x70')])['sync'](this,_0x370df7);_0x370df7[_0x0cb1('0x71')]=Mustache[_0x0cb1('0x72')](_0xa9bace[_0x0cb1('0x64')],_0x1a0ac8,{},['$$','$$']);if(_0x370df7[_0x0cb1('0x6e')]){_0x370df7[_0x0cb1('0x6e')]=JSON[_0x0cb1('0x6c')](Mustache[_0x0cb1('0x72')](JSON[_0x0cb1('0x73')](_0x370df7[_0x0cb1('0x6e')]),_0x1a0ac8,{},['$$','$$']));}if(_0x370df7[_0x0cb1('0x6b')]){_0x370df7[_0x0cb1('0x6b')]=JSON[_0x0cb1('0x6c')](Mustache['render'](JSON[_0x0cb1('0x73')](_0x370df7['body']),_0x1a0ac8,{},['$$','$$']));}}catch(_0x1a5272){logger['error'](_0x0cb1('0x74'),_0x1a5272);}}rp(_0x370df7)[_0x0cb1('0x15')](function(_0x1b4e91){var _0x562253={'statusCode':_0x1b4e91[_0x0cb1('0x75')]||0xc8,'statusMessage':_0x1b4e91['statusMessage']||'OK','headers':_0x1b4e91[_0x0cb1('0x6e')]||{},'body':_0x1b4e91['body']||{}};_0x4209a1(null,_0x562253);})[_0x0cb1('0x11')](function(_0x27b3da){var _0x4caab6={'statusCode':_0x27b3da['statusCode']||0x1f4,'statusMessage':_0x27b3da[_0x0cb1('0x76')]||_0x0cb1('0x77'),'headers':_0x27b3da[_0x0cb1('0x78')][_0x0cb1('0x6e')]||{},'body':_0x27b3da[_0x0cb1('0x78')]['body']||{}};_0x4209a1(null,_0x4caab6);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x79')]=function(_0x328007,_0x2ea6a1){scripts[_0x0cb1('0x79')](this[_0x0cb1('0xf')][_0x0cb1('0x36')],_0x328007[_0x0cb1('0x7a')],_0x328007[_0x0cb1('0x5d')],_0x328007[_0x0cb1('0x7b')]||'en')[_0x0cb1('0x15')](function(_0x256e7e){_0x2ea6a1(null,_0x256e7e);})['catch'](function(_0x358532){_0x2ea6a1(_0x358532);});};AGIVertices['prototype'][_0x0cb1('0x7c')]=function(_0x30c3a0,_0x11f46c){scripts[_0x0cb1('0x7c')](this[_0x0cb1('0xf')]['uniqueid'],_0x30c3a0[_0x0cb1('0x7d')],_0x30c3a0['client_email'],_0x30c3a0[_0x0cb1('0x7e')],_0x30c3a0[_0x0cb1('0x5d')],_0x30c3a0[_0x0cb1('0x7f')]||'en')['then'](function(_0x57d7a7){_0x11f46c(null,_0x57d7a7);})[_0x0cb1('0x11')](function(_0x3c8132){_0x11f46c(_0x3c8132);});};AGIVertices[_0x0cb1('0x12')]['sestekNDA']=function(_0x428c86,_0x5637c4){scripts[_0x0cb1('0x80')](this[_0x0cb1('0xf')],_0x428c86)[_0x0cb1('0x15')](function(_0x2200ac){_0x5637c4(null,_0x2200ac);})[_0x0cb1('0x11')](function(_0x49a2ef){_0x5637c4(_0x49a2ef);});};AGIVertices['prototype'][_0x0cb1('0x81')]=function(_0x656b51,_0x3e2b07){scripts['ispeechTTS'](_0x656b51[_0x0cb1('0x7a')],_0x656b51[_0x0cb1('0x5d')],_0x656b51[_0x0cb1('0x82')]||_0x0cb1('0x83'),_0x656b51[_0x0cb1('0x84')])[_0x0cb1('0x15')](function(_0x5b6564){_0x3e2b07(null,_0x5b6564);})[_0x0cb1('0x11')](function(_0x17d1ac){_0x3e2b07(_0x17d1ac);});};AGIVertices['prototype']['ispeechASR']=function(_0x2185ff,_0x1418db,_0x535fa1){scripts['ispeechASR'](_0x1418db,_0x2185ff[_0x0cb1('0x7a')],_0x2185ff[_0x0cb1('0x85')]||_0x0cb1('0x83'),this[_0x0cb1('0x86')](_0x2185ff['model'])?_0x2185ff[_0x0cb1('0x87')]:undefined)[_0x0cb1('0x15')](function(_0x103db6){_0x535fa1(null,_0x103db6);})[_0x0cb1('0x11')](function(_0x38e32e){_0x535fa1(_0x38e32e);});};AGIVertices[_0x0cb1('0x12')]['awsPolly']=function(_0x27f600,_0x6562d3){scripts[_0x0cb1('0x88')](_0x27f600['aws_access_key_id'],_0x27f600['aws_secret_access_key'],_0x27f600[_0x0cb1('0x89')],_0x27f600[_0x0cb1('0x8a')]||_0x0cb1('0x8b'),_0x27f600[_0x0cb1('0x5d')],_0x27f600[_0x0cb1('0x8c')]||_0x0cb1('0x5d'))[_0x0cb1('0x15')](function(_0x325b9b){_0x6562d3(null,_0x325b9b);})[_0x0cb1('0x11')](function(_0x302fba){_0x6562d3(_0x302fba);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x8d')]=function(_0x14664c,_0x23b6c8){scripts[_0x0cb1('0x8d')](this['channel']['uniqueid'],_0x14664c['aws_access_key_id'],_0x14664c[_0x0cb1('0x8e')],_0x14664c['aws_lex_region'],_0x14664c[_0x0cb1('0x5d')],_0x14664c['aws_bot_name'])['then'](function(_0x2915f7){_0x23b6c8(null,_0x2915f7);})[_0x0cb1('0x11')](function(_0x277b0c){_0x23b6c8(_0x277b0c);});};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x8f')]=function(_0x507c3d,_0x1ce799,_0x2aef85){scripts['googleASR'](_0x1ce799,_0x507c3d[_0x0cb1('0x7a')],_0x507c3d[_0x0cb1('0x90')]||_0x0cb1('0x83'))[_0x0cb1('0x15')](function(_0x292228){_0x2aef85(null,_0x292228);})['catch'](function(_0x28ad8e){_0x2aef85(_0x28ad8e);});};AGIVertices['prototype'][_0x0cb1('0x91')]=function(_0x5496e6,_0xc6d745,_0x1a8f3a){scripts[_0x0cb1('0x91')](_0xc6d745,_0x5496e6[_0x0cb1('0x92')],_0x5496e6[_0x0cb1('0x93')],_0x5496e6['uri'])[_0x0cb1('0x15')](function(_0x1bf7f3){_0x1a8f3a(null,_0x1bf7f3);})[_0x0cb1('0x11')](function(_0x9eede){_0x1a8f3a(_0x9eede);});};AGIVertices[_0x0cb1('0x12')]['clear']=function(_0x3b9ef8){var _0x3a9a34=_['includes'](verticesWithRetry,_0x3b9ef8[_0x0cb1('0x94')])?_0x3b9ef8:_[_0x0cb1('0x95')](_0x3b9ef8);for(var _0x1f54c4 in _0x3a9a34){if(_0x3a9a34[_0x0cb1('0x96')](_0x1f54c4)){if(_0x3a9a34[_0x1f54c4]&&_[_0x0cb1('0x97')](_0x3a9a34[_0x1f54c4])){if(_[_0x0cb1('0x68')](recursiveMapAttributes,_0x1f54c4)){_0x3a9a34[_0x1f54c4]=this[_0x0cb1('0x98')](_0x3a9a34[_0x1f54c4]);}else{_0x3a9a34[_0x1f54c4]=this['replaceAllVariables'](_0x3a9a34[_0x1f54c4]);}}}}return _0x3a9a34;};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x99')]=function(_0xd90318){for(var _0x2600ce in _0xd90318){if(_0xd90318[_0x0cb1('0x96')](_0x2600ce)){if(_[_0x0cb1('0x9a')](_0xd90318[_0x2600ce])){this[_0x0cb1('0x99')](_0xd90318[_0x2600ce]);}else if(_[_0x0cb1('0x9b')](_0xd90318[_0x2600ce])){for(var _0x2891f9=0x0;_0x2891f9<_0xd90318[_0x2600ce][_0x0cb1('0x9c')];_0x2891f9++){this['recursiveNodeIndex'](_0xd90318[_0x2600ce][_0x2891f9]);}}else if(_[_0x0cb1('0x97')](_0xd90318[_0x2600ce])){_0xd90318[_0x2600ce]=this['replaceAllVariables'](_0xd90318[_0x2600ce]);}}}};AGIVertices[_0x0cb1('0x12')]['saveRestApiResult']=function(_0x3043da,_0x2d759e){for(var _0x59b04e in _0x3043da){if(_0x3043da['hasOwnProperty'](_0x59b04e)){if(_['isPlainObject'](_0x3043da[_0x59b04e])){if(!_[_0x0cb1('0x43')](_0x3043da[_0x59b04e])){this[_0x0cb1('0x9d')](_0x3043da[_0x59b04e],util['format'](_0x0cb1('0x9e'),_0x2d759e,_0x59b04e));}}else if(_[_0x0cb1('0x9b')](_0x3043da[_0x59b04e])){for(var _0x140398=0x0;_0x140398<_0x3043da[_0x59b04e]['length'];_0x140398++){this['saveRestApiResult'](_0x3043da[_0x59b04e][_0x140398],util[_0x0cb1('0x9f')](_0x0cb1('0x9e'),_0x2d759e,_0x59b04e+'['+_0x140398+']'));}}else{if(!_[_0x0cb1('0x44')](_0x3043da[_0x59b04e])){this[_0x0cb1('0xf')][_0x0cb1('0xa0')](util[_0x0cb1('0x9f')](_0x0cb1('0x9e'),_0x2d759e,_0x59b04e),_0x3043da[_0x59b04e]);}}}}};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x98')]=function(_0x5e2a1e){try{var _0xf3f060=JSON[_0x0cb1('0x6c')](_0x5e2a1e);this[_0x0cb1('0x99')](_0xf3f060);return JSON[_0x0cb1('0x73')](_0xf3f060);}catch(_0x24c6f1){return this[_0x0cb1('0xa1')](_0x5e2a1e);}};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xa1')]=function(_0x4856fe){var _0x395a52=_0x4856fe[_0x0cb1('0xa2')]('{');for(var _0x3ea306=0x1;_0x3ea306<_0x395a52[_0x0cb1('0x9c')];_0x3ea306+=0x1){var _0x1120ba=_0x395a52[_0x3ea306][_0x0cb1('0xa2')]('}');if(_0x1120ba[_0x0cb1('0x9c')]>0x1){_0x4856fe=_0x4856fe[_0x0cb1('0xa3')]('{'+_0x1120ba[0x0]+'}',this['channel'][_0x0cb1('0xa4')](_0x1120ba[0x0])[_0x0cb1('0xa5')]||_0x1120ba[0x0]);}}if(_0x395a52[_0x0cb1('0x9c')]===0x1){return _0x4856fe['toString']();}return this[_0x0cb1('0xa1')](_0x4856fe);};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xa6')]=function(_0x2096df,_0x41abec){var _0x1bb495=this[_0x0cb1('0xf')][_0x0cb1('0xa4')](_0x2096df);if(_0x1bb495[_0x0cb1('0xa7')]===-0x1){return _0x1bb495;}logger['info'](util['format'](_0x0cb1('0xa8'),_0x41abec,_0x1bb495[_0x0cb1('0xa5')]));return this[_0x0cb1('0xf')][_0x0cb1('0xa0')](_0x41abec,_0x1bb495['extra']);};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x86')]=function(_0x1a8dc2){return _0x1a8dc2&&_0x1a8dc2!=='0'&&_0x1a8dc2!=='-1'&&_0x1a8dc2!=='';};AGIVertices[_0x0cb1('0x12')]['maxRetry']=function(_0x5e3bbf){this[_0x0cb1('0x35')][_0x0cb1('0xa9')](this,_0x5e3bbf,'-');_0x5e3bbf[_0x0cb1('0xaa')]=_0x5e3bbf['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xab')]=function(_0x122859){logger['info'](util['format'](_0x0cb1('0xac'),_0x122859[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x122859[_0x0cb1('0x5d')])){return this[_0x0cb1('0xf')]['noop'](_0x0cb1('0xad'));}var _0x542467='\x22'+_0x122859[_0x0cb1('0x5d')]+'\x22';if(this[_0x0cb1('0x86')](_0x122859[_0x0cb1('0x78')])){_0x542467+=','+_0x122859['options'];}var _0xd5b7a1=this['channel']['exec'](_0x0cb1('0xae'),_0x542467);if(_0xd5b7a1[_0x0cb1('0xa7')]===-0x1){return _0xd5b7a1;}return this[_0x0cb1('0xf')]['noop'](util[_0x0cb1('0x9f')](_0x0cb1('0xaf'),_0x542467));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xb0')]=function(_0xb1771f){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0xb1771f[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0xb1771f[_0x0cb1('0xb1')])){return this[_0x0cb1('0xf')]['noop'](_0x0cb1('0xb2'));}var _0xa17911=_0xb1771f['grammar'];if(this[_0x0cb1('0x86')](_0xb1771f['options'])){_0xa17911+=','+_0xb1771f['options'];}var _0x5e3dec=this[_0x0cb1('0xf')][_0x0cb1('0x58')](_0x0cb1('0xb3'),_0xa17911);if(_0x5e3dec[_0x0cb1('0xa7')]===-0x1){return _0x5e3dec;}var _0x348d15=this['getAndSetVariable'](_0x0cb1('0xb4'),_0x0cb1('0xb5'));if(_0x348d15[_0x0cb1('0xa7')]===-0x1){return _0x348d15;}var _0x46d2f2=this[_0x0cb1('0xa6')](_0x0cb1('0xb6'),_0x0cb1('0xb7'));if(_0x46d2f2[_0x0cb1('0xa7')]===-0x1){return _0x46d2f2;}var _0x39a6e6=this['getAndSetVariable'](_0x0cb1('0xb8'),_0x0cb1('0xb9'));if(_0x39a6e6[_0x0cb1('0xa7')]===-0x1){return _0x39a6e6;}return this[_0x0cb1('0xf')]['noop'](util[_0x0cb1('0x9f')](_0x0cb1('0xba'),_0xa17911));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x6')]=function(_0x1238b2){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x1238b2[_0x0cb1('0x37')]));return this['channel'][_0x0cb1('0x6')]([_0x1238b2[_0x0cb1('0xbb')],_0x1238b2['args']]);};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xbc')]=function(_0xbba9c5){logger[_0x0cb1('0x2d')](util['format']('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0xbba9c5['label']));if(this['isConfigured'](_0xbba9c5[_0x0cb1('0x67')])){logger[_0x0cb1('0x2d')](util['format'](_0x0cb1('0xbd'),_0xbba9c5[_0x0cb1('0x67')]));var _0x376678=this[_0x0cb1('0xf')][_0x0cb1('0xbe')](_0xbba9c5['timeout']);if(_0x376678[_0x0cb1('0xa7')]===-0x1){return _0x376678;}}return this[_0x0cb1('0xf')][_0x0cb1('0xbc')]();};AGIVertices[_0x0cb1('0x12')]['callback']=function(_0x5144ac){logger[_0x0cb1('0x2d')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x5144ac['label']));if(!this[_0x0cb1('0x86')](_0x5144ac[_0x0cb1('0xbf')])){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x5144ac,_0x0cb1('0xc0'));}_0x5144ac[_0x0cb1('0x49')]=moment();if(this[_0x0cb1('0x86')](_0x5144ac['delay'])){_0x5144ac['scheduledAt']=moment()[_0x0cb1('0xc1')](_0x5144ac[_0x0cb1('0xc2')],_0x0cb1('0xc3'));}if(!this[_0x0cb1('0x86')](_0x5144ac[_0x0cb1('0x4c')])){_0x5144ac[_0x0cb1('0x4c')]=0x2;}this[_0x0cb1('0x42')][_0x0cb1('0xa9')](this,_0x5144ac);return this[_0x0cb1('0xf')]['noop'](util[_0x0cb1('0x9f')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x5144ac[_0x0cb1('0x48')],_0x5144ac[_0x0cb1('0xbf')],_0x5144ac['scheduledAt']));};AGIVertices['prototype'][_0x0cb1('0xc4')]=function(_0x19889a){logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0xc5'),_0x19889a[_0x0cb1('0x37')]));var _0xb6e777=this[_0x0cb1('0xf')][_0x0cb1('0x58')](_0x19889a['application'],_0x19889a[_0x0cb1('0x78')]);if(_0xb6e777['result']===-0x1){return _0xb6e777;}return this[_0x0cb1('0xf')]['noop'](util['format'](_0x0cb1('0xc6'),_0x19889a[_0x0cb1('0xc7')],_0x19889a[_0x0cb1('0x78')]));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xc8')]=function(_0x2c80a2){logger[_0x0cb1('0x2d')](util['format'](_0x0cb1('0xc9'),_0x2c80a2[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x2c80a2[_0x0cb1('0x5d')])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0xad'));}var _0x481949='\x22'+_0x2c80a2[_0x0cb1('0x5d')]+'\x22';if(this[_0x0cb1('0x86')](_0x2c80a2['options'])){_0x481949+=','+_0x2c80a2[_0x0cb1('0x78')];}var _0x49c28b=this['channel']['exec']('MRCPSynth',_0x481949);if(_0x49c28b[_0x0cb1('0xa7')]===-0x1){return _0x49c28b;}return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')]('Executed\x20command\x20MRCPSynth\x20%s',_0x481949));};AGIVertices['prototype'][_0x0cb1('0xcb')]=function(_0x5e1a00){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x5e1a00[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x5e1a00['text'])){return this['channel']['noop'](_0x0cb1('0xad'));}var _0x1dbcf5='\x22'+_0x5e1a00[_0x0cb1('0x5d')]+'\x22';if(this[_0x0cb1('0x86')](_0x5e1a00[_0x0cb1('0x78')])){_0x1dbcf5+=','+_0x5e1a00['options'];}var _0x1608e2=this[_0x0cb1('0xf')][_0x0cb1('0x58')]('MRCPSynth',_0x1dbcf5);if(_0x1608e2['result']===-0x1){return _0x1608e2;}return this[_0x0cb1('0xf')]['noop'](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x1dbcf5));};AGIVertices[_0x0cb1('0x12')]['lumenvoxasr']=function(_0x4ad1fc){logger[_0x0cb1('0x2d')](util['format'](_0x0cb1('0xcc'),_0x4ad1fc[_0x0cb1('0x37')]));if(!this['isConfigured'](_0x4ad1fc[_0x0cb1('0xb1')])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')]('no\x20grammar\x20configured');}var _0x473797=_0x4ad1fc[_0x0cb1('0xb1')];if(this[_0x0cb1('0x86')](_0x4ad1fc[_0x0cb1('0x78')])){_0x473797+=','+_0x4ad1fc[_0x0cb1('0x78')];}var _0x8fb59f=this[_0x0cb1('0xf')][_0x0cb1('0x58')]('MRCPRecog',_0x473797);if(_0x8fb59f[_0x0cb1('0xa7')]===-0x1){return _0x8fb59f;}var _0x3b8a84=this['getAndSetVariable'](_0x0cb1('0xb4'),_0x0cb1('0xcd'));if(_0x3b8a84[_0x0cb1('0xa7')]===-0x1){return _0x3b8a84;}var _0x28a0b4=this['getAndSetVariable']('RECOG_INPUT()',_0x0cb1('0xce'));if(_0x28a0b4['result']===-0x1){return _0x28a0b4;}var _0x56f30c=this[_0x0cb1('0xa6')](_0x0cb1('0xb8'),'LUMENVOX_ASR_INSTANCE');if(_0x56f30c[_0x0cb1('0xa7')]===-0x1){return _0x56f30c;}return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0xba'),_0x473797));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xcf')]=function(_0x3d5a14){logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0xd0'),_0x3d5a14[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x3d5a14[_0x0cb1('0xb1')])){return this[_0x0cb1('0xf')]['noop'](_0x0cb1('0xb2'));}var _0x1e85b4=_0x3d5a14[_0x0cb1('0xb1')];if(this['isConfigured'](_0x3d5a14[_0x0cb1('0x78')])){_0x1e85b4+=','+_0x3d5a14[_0x0cb1('0x78')];}var _0x208612=this[_0x0cb1('0xf')][_0x0cb1('0x58')](_0x0cb1('0xb3'),_0x1e85b4);if(_0x208612[_0x0cb1('0xa7')]===-0x1){return _0x208612;}var _0x149610=this[_0x0cb1('0xa6')](_0x0cb1('0xb4'),'SESTEK_ASR_CONFIDENCE');if(_0x149610[_0x0cb1('0xa7')]===-0x1){return _0x149610;}var _0x2a3dca=this[_0x0cb1('0xa6')](_0x0cb1('0xb6'),_0x0cb1('0xd1'));if(_0x2a3dca['result']===-0x1){return _0x2a3dca;}var _0x658318=this[_0x0cb1('0xa6')](_0x0cb1('0xb8'),_0x0cb1('0xd2'));if(_0x658318[_0x0cb1('0xa7')]===-0x1){return _0x658318;}return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0xba'),_0x1e85b4));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xd3')]=function(_0x1d92d4){logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0xd4'),_0x1d92d4[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x1d92d4[_0x0cb1('0xd5')])){return this['channel'][_0x0cb1('0x2b')](_0x1d92d4,'no\x20database\x20selected');}var _0x255016=this[_0x0cb1('0x18')][_0x0cb1('0xa9')](this,_0x1d92d4[_0x0cb1('0xd5')]);if(!_0x255016){return this['channel']['error'](_0x1d92d4,_0x0cb1('0xd6'));}if(!this[_0x0cb1('0x86')](_0x1d92d4[_0x0cb1('0x2f')])){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x1d92d4,_0x0cb1('0xd7'));}var _0x2b8f38=_0x1d92d4[_0x0cb1('0x2f')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0xd8'),_0x2b8f38));var _0xa5454f=this[_0x0cb1('0x29')][_0x0cb1('0xa9')](this,_0x255016,_0x2b8f38);this[_0x0cb1('0x35')][_0x0cb1('0xa9')](this,_0x1d92d4,_0x2b8f38);if(!this[_0x0cb1('0x86')](_0x1d92d4[_0x0cb1('0xd9')])){return this[_0x0cb1('0xf')]['noop'](_0x0cb1('0xda'));}var _0x3d3d23=this[_0x0cb1('0xa4')][_0x0cb1('0xa9')](this,_0x1d92d4['variable_id']);if(!_0x3d3d23){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x1d92d4,_0x0cb1('0xdb'));}var _0xed8721=this;_0xa5454f[_0x0cb1('0xdc')](function(_0x2a438b,_0x58a69a){Object[_0x0cb1('0xdd')](_0x2a438b)[_0x0cb1('0xdc')](function(_0x54bca8){_0xed8721[_0x0cb1('0xf')]['setVariable'](util[_0x0cb1('0x9f')](_0x0cb1('0xde'),_0x3d3d23,_0x58a69a,_0x54bca8),_0x2a438b[_0x54bca8]);});});this[_0x0cb1('0xf')][_0x0cb1('0xa0')](util[_0x0cb1('0x9f')](_0x0cb1('0xdf'),_0x3d3d23),_0xa5454f['length']);return this[_0x0cb1('0xf')]['noop'](util['format'](_0x0cb1('0xe0'),_0x3d3d23));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xe1')]=function(_0x12b768){logger[_0x0cb1('0xe2')](util[_0x0cb1('0x9f')](_0x0cb1('0xe3'),_0x12b768[_0x0cb1('0x37')]));if(!this['isConfigured'](_0x12b768[_0x0cb1('0xe4')])){return this['channel'][_0x0cb1('0x2b')](_0x12b768,_0x0cb1('0xe5'));}var _0x391157=this['getUser']['sync'](this,_0x12b768[_0x0cb1('0xe4')]);if(!_0x391157){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x12b768,_0x0cb1('0xe6'));}var _0x1553f0=this['channel'][_0x0cb1('0x58')]('DIAL',[util[_0x0cb1('0x9f')](_0x0cb1('0xe7'),_0x391157),_0x12b768[_0x0cb1('0x67')],_0x12b768[_0x0cb1('0xe8')],_0x12b768[_0x0cb1('0x64')]]);if(_0x1553f0[_0x0cb1('0xa7')]===-0x1){return _0x1553f0;}return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')]('Executed\x20command\x20%s',_0x0cb1('0xe9')));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xea')]=function(_0x258d7f){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0xeb'),_0x258d7f[_0x0cb1('0x37')]));if(!this['isConfigured'](_0x258d7f[_0x0cb1('0x7a')])){return this['channel'][_0x0cb1('0xca')](_0x0cb1('0xec'));}if(!this[_0x0cb1('0x86')](_0x258d7f['text'])){return this['channel'][_0x0cb1('0xca')]('no\x20text\x20configured');}this['channel'][_0x0cb1('0xed')]=!![];this[_0x0cb1('0x35')](_0x258d7f);this[_0x0cb1('0x41')](_0x258d7f['text'],'in','','');this['channel']['noop'](util[_0x0cb1('0x9f')](_0x0cb1('0xee'),_0x258d7f['text']));var _0x95cb85=this['googleDialogflow'][_0x0cb1('0xa9')](this,_0x258d7f);if(_0x95cb85){for(var _0x389bfc in _0x95cb85){if(_0x95cb85[_0x0cb1('0x96')](_0x389bfc)){this[_0x0cb1('0xf')][_0x0cb1('0xa0')](util['format'](_0x0cb1('0xef'),_0x389bfc[_0x0cb1('0xf0')]()),_0x95cb85[_0x389bfc]);}}this[_0x0cb1('0x41')](_0x95cb85[_0x0cb1('0xf1')],_0x0cb1('0xf2'),'dialogflow','');return this['channel'][_0x0cb1('0xca')](util[_0x0cb1('0x9f')]('Dialogflow\x20Result\x20%s',_0x95cb85[_0x0cb1('0xf1')]));}return this['channel'][_0x0cb1('0x2b')](_0x258d7f,_0x0cb1('0xf3'));};AGIVertices['prototype'][_0x0cb1('0xf4')]=function(_0x3e40bb){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0xf5'),_0x3e40bb['label']));if(!this[_0x0cb1('0x86')](_0x3e40bb[_0x0cb1('0x7d')])){return this['channel'][_0x0cb1('0xca')](_0x0cb1('0xf6'));}if(!this['isConfigured'](_0x3e40bb[_0x0cb1('0xf7')])){return this['channel'][_0x0cb1('0xca')](_0x0cb1('0xf8'));}if(!this[_0x0cb1('0x86')](_0x3e40bb['private_key'])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0xf9'));}if(!this[_0x0cb1('0x86')](_0x3e40bb[_0x0cb1('0x7f')])){return this['channel'][_0x0cb1('0xca')]('no\x20anguage\x20configured');}if(!this[_0x0cb1('0x86')](_0x3e40bb['text'])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0xad'));}this[_0x0cb1('0xf')]['bot']=!![];this[_0x0cb1('0x35')](_0x3e40bb);this[_0x0cb1('0x41')](_0x3e40bb['text'],'in','','');this['channel']['noop'](util[_0x0cb1('0x9f')](_0x0cb1('0xfa'),_0x3e40bb[_0x0cb1('0x5d')]));var _0xaf3dcc=this[_0x0cb1('0x7c')]['sync'](this,_0x3e40bb);if(_0xaf3dcc){for(var _0x2b82ac in _0xaf3dcc){if(_0xaf3dcc[_0x0cb1('0x96')](_0x2b82ac)){if(_0x2b82ac!==_0x0cb1('0xfb')){this['channel'][_0x0cb1('0xa0')](util[_0x0cb1('0x9f')]('DIALOGFLOW_%s',_0x2b82ac[_0x0cb1('0xf0')]()),_0xaf3dcc[_0x2b82ac]);}}}this[_0x0cb1('0x41')](_0xaf3dcc[_0x0cb1('0xf1')],_0x0cb1('0xf2'),_0x0cb1('0xf4'),_0xaf3dcc[_0x0cb1('0xfb')]);return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util['format'](_0x0cb1('0xfc'),_0xaf3dcc[_0x0cb1('0xf1')]));}return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x3e40bb,_0x0cb1('0xfd'));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xfe')]=function(_0x56ca9b){logger['info'](util[_0x0cb1('0x9f')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x56ca9b[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x56ca9b[_0x0cb1('0xff')])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0x100'));}if(!this[_0x0cb1('0x86')](_0x56ca9b['username'])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0x101'));}if(!this['isConfigured'](_0x56ca9b[_0x0cb1('0x102')])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0x103'));}if(!this[_0x0cb1('0x86')](_0x56ca9b['ndassistant_url'])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0xad'));}this[_0x0cb1('0xf')]['bot']=!![];this['createSquareDetailsReport'](_0x56ca9b);this[_0x0cb1('0x41')](_0x56ca9b['text'],'in','','');this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x104'),_0x56ca9b[_0x0cb1('0x5d')]));var _0x28488b=this[_0x0cb1('0x80')]['sync'](this,_0x56ca9b);if(_0x28488b){for(var _0x315e44 in _0x28488b){if(_0x28488b[_0x0cb1('0x96')](_0x315e44)){this['channel']['setVariable'](util[_0x0cb1('0x9f')](_0x0cb1('0x105'),_0x315e44[_0x0cb1('0xf0')]()),_0x28488b[_0x315e44]);}}this[_0x0cb1('0x41')](_0x28488b[_0x0cb1('0xf1')],_0x0cb1('0xf2'),_0x0cb1('0xfe'),'');if(_0x28488b[_0x0cb1('0x106')]){this['channel'][_0x0cb1('0xca')](util['format'](_0x0cb1('0x107'),_0x28488b['audiofile']));var _0x356cbf=this[_0x0cb1('0xf')][_0x0cb1('0x108')](_0x28488b[_0x0cb1('0x106')]);try{fs[_0x0cb1('0x109')](_0x28488b[_0x0cb1('0x106')]+'.wav');}catch(_0xac2988){logger[_0x0cb1('0x2b')](_0xac2988);}return _0x356cbf;}else{return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x10a'),_0x28488b['speech']));}}return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x56ca9b,_0x0cb1('0x10b'));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x10c')]=function(_0x3c6862){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x10d'),_0x3c6862['label']));return this[_0x0cb1('0xf')]['noop'](_0x0cb1('0x10c'));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x10e')]=function(_0x206654){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x10f'),_0x206654[_0x0cb1('0x37')]));var _0x2344e1='';if(_0x206654[_0x0cb1('0x110')]){if(!this[_0x0cb1('0x86')](_0x206654['trunk_id'])){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x206654,_0x0cb1('0x111'));}else{var _0x43b55f=parseInt(_0x206654[_0x0cb1('0x110')],0xa);if(isNaN(_0x43b55f)){_0x2344e1=_0x206654[_0x0cb1('0x110')];}else{_0x2344e1=this['getTrunk']['sync'](this,_0x206654['trunk_id']);if(!_0x2344e1){return this['channel'][_0x0cb1('0x2b')](_0x206654,_0x0cb1('0x112'));}}}}else if(_0x206654[_0x0cb1('0x113')]){_0x2344e1=_0x206654[_0x0cb1('0x113')];}else{return this[_0x0cb1('0xf')]['error'](_0x206654,_0x0cb1('0x111'));}var _0x3feb45=this[_0x0cb1('0xf')][_0x0cb1('0x58')]('DIAL',[util[_0x0cb1('0x9f')]('SIP/%s/%s',_0x2344e1,_0x206654[_0x0cb1('0x48')]),_0x206654['timeout'],_0x206654[_0x0cb1('0xe8')],_0x206654[_0x0cb1('0x64')]]);if(_0x3feb45['result']===-0x1){return _0x3feb45;}return this[_0x0cb1('0xf')]['noop'](util['format'](_0x0cb1('0x114'),_0x0cb1('0xe9')));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x115')]=function(_0x2d26f2){logger['info'](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x2d26f2[_0x0cb1('0x37')]));return this['channel'][_0x0cb1('0xca')](_0x0cb1('0x115'));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xd')]=function(_0x19ead0){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x116'),_0x19ead0[_0x0cb1('0x37')]));if(_0x19ead0[_0x0cb1('0xaa')]===0x0){return this['maxRetry'](_0x19ead0);}_0x19ead0[_0x0cb1('0xaa')]-=0x1;if(!this[_0x0cb1('0x86')](_0x19ead0[_0x0cb1('0x117')])){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x19ead0,_0x0cb1('0x118'));}var _0x5c29db=this['getSound'][_0x0cb1('0xa9')](this,_0x19ead0['file_id']);if(!_0x5c29db){return this['channel'][_0x0cb1('0x2b')](_0x19ead0,_0x0cb1('0x119'));}if(!this[_0x0cb1('0x86')](_0x19ead0[_0x0cb1('0xd9')])){return this['channel'][_0x0cb1('0x2b')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x59dadb=this['channel'][_0x0cb1('0x11a')](_0x5c29db,_0x19ead0['response'],_0x19ead0[_0x0cb1('0x11b')]);var _0x47c947=_0x59dadb[_0x0cb1('0xa7')]?_0x59dadb['result']['toString']():'';logger['info'](_0x0cb1('0x11c'),JSON['stringify'](_0x59dadb));if(_0x59dadb[_0x0cb1('0xa7')]===-0x1){this[_0x0cb1('0x35')][_0x0cb1('0xa9')](this,_0x19ead0,_0x47c947);return _0x59dadb;}else if(_0x59dadb[_0x0cb1('0xa5')]===_0x0cb1('0x67')){_0x59dadb[_0x0cb1('0xa7')]=_0x47c947[_0x0cb1('0x9c')]>=parseInt(_0x19ead0[_0x0cb1('0x11d')])?'x':'i';}else{_0x59dadb[_0x0cb1('0xa7')]=_0x47c947[_0x0cb1('0x9c')]>=parseInt(_0x19ead0[_0x0cb1('0x11d')])&&_0x47c947[_0x0cb1('0x9c')]<=parseInt(_0x19ead0[_0x0cb1('0x11b')])?'x':'i';}var _0x1b6276=this[_0x0cb1('0xa4')]['sync'](this,_0x19ead0[_0x0cb1('0xd9')]);if(!_0x1b6276){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x19ead0,_0x0cb1('0xdb'));}this['channel'][_0x0cb1('0xa0')](_0x1b6276,_0x47c947);if(this[_0x0cb1('0x86')](_0x19ead0[_0x0cb1('0x11e')])){var _0x1194e2=parseInt(_0x19ead0[_0x0cb1('0x11e')],0xa);var _0x15ffb1=rs[_0x0cb1('0x11f')]({'charset':'*','length':_0x1194e2});var _0x5644d5=_0x47c947[_0x0cb1('0x9c')];if(_0x5644d5>0x0){if(_0x5644d5>_0x1194e2){this[_0x0cb1('0x35')][_0x0cb1('0xa9')](this,_0x19ead0,_0x19ead0['hiddendigitspos']===_0x0cb1('0x120')?_0x15ffb1+_0x47c947[_0x0cb1('0x121')](_0x1194e2):_0x47c947[_0x0cb1('0x121')](0x0,_0x5644d5-_0x1194e2)+_0x15ffb1);}else{this[_0x0cb1('0x35')]['sync'](this,_0x19ead0,rs[_0x0cb1('0x11f')]({'charset':'*','length':_0x5644d5}));}}else{this[_0x0cb1('0x35')][_0x0cb1('0xa9')](this,_0x19ead0,'');}}else{this[_0x0cb1('0x35')][_0x0cb1('0xa9')](this,_0x19ead0,_0x47c947);}return _0x59dadb;};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xe')]=function(_0x42b620){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x122'),_0x42b620[_0x0cb1('0x37')]));return this[_0x0cb1('0xd')](_0x42b620);};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x123')]=function(_0x4fdff9){logger['info'](util[_0x0cb1('0x9f')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x4fdff9[_0x0cb1('0x37')]));this[_0x0cb1('0x35')][_0x0cb1('0xa9')](this,_0x4fdff9,_0x4fdff9['goalname']);return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x124'),_0x4fdff9[_0x0cb1('0x125')]));};AGIVertices[_0x0cb1('0x12')]['awspolly']=function(_0x44f1dd){logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0x126'),_0x44f1dd[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x44f1dd[_0x0cb1('0x127')])||!this[_0x0cb1('0x86')](_0x44f1dd[_0x0cb1('0x8e')])){return this['channel'][_0x0cb1('0xca')](_0x0cb1('0x128'));}if(!this['isConfigured'](_0x44f1dd['text'])){return this['channel']['noop'](_0x0cb1('0xad'));}this[_0x0cb1('0xf')]['noop'](util[_0x0cb1('0x9f')](_0x0cb1('0x129'),_0x44f1dd[_0x0cb1('0x5d')]));var _0x42ff97=this[_0x0cb1('0x88')][_0x0cb1('0xa9')](this,_0x44f1dd);if(_0x42ff97){this[_0x0cb1('0xf')]['noop'](util['format'](_0x0cb1('0x12a'),_0x42ff97));var _0x23a238=this['channel'][_0x0cb1('0x108')](_0x42ff97);try{fs[_0x0cb1('0x109')](_0x42ff97+'.wav');}catch(_0x3a54c5){logger[_0x0cb1('0x2b')](_0x3a54c5);}return _0x23a238;}return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x44f1dd,_0x0cb1('0x12b'));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x12c')]=function(_0x209caf){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x12d'),_0x209caf[_0x0cb1('0x37')]));if(!this['isConfigured'](_0x209caf[_0x0cb1('0x127')])||!this[_0x0cb1('0x86')](_0x209caf[_0x0cb1('0x8e')])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x0cb1('0x86')](_0x209caf['aws_bot_name'])){return this['channel'][_0x0cb1('0xca')](_0x0cb1('0x12e'));}if(!this['isConfigured'](_0x209caf['text'])){return this['channel']['noop'](_0x0cb1('0xad'));}this['channel'][_0x0cb1('0xed')]=!![];this[_0x0cb1('0x35')](_0x209caf);this[_0x0cb1('0x41')](_0x209caf[_0x0cb1('0x5d')],'in','','');this[_0x0cb1('0xf')][_0x0cb1('0xca')](util['format'](_0x0cb1('0x12f'),_0x209caf['text']));var _0x42ddb0=this['awsLex']['sync'](this,_0x209caf);if(_0x42ddb0){for(var _0x4ae0e3 in _0x42ddb0){if(_0x42ddb0[_0x0cb1('0x96')](_0x4ae0e3)&&_[_0x0cb1('0x97')](_0x42ddb0[_0x4ae0e3])){this['channel']['setVariable'](util['format'](_0x0cb1('0x130'),_0x4ae0e3[_0x0cb1('0xf0')]()),_0x42ddb0[_0x4ae0e3]);}}if(_[_0x0cb1('0x44')](_0x42ddb0[_0x0cb1('0x76')])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0x131'));}else{this[_0x0cb1('0x41')](_0x42ddb0['message'],'out',_0x0cb1('0x132'),'');return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util['format'](_0x0cb1('0x133'),_0x42ddb0[_0x0cb1('0x76')]));}}return this['channel'][_0x0cb1('0x2b')](_0x209caf,_0x0cb1('0x134'));};AGIVertices['prototype'][_0x0cb1('0x135')]=function(_0x2fc2db){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x136'),_0x2fc2db['label'],_0x2fc2db[_0x0cb1('0x67')]));if(!this['isConfigured'](_0x2fc2db[_0x0cb1('0x7a')])){return this[_0x0cb1('0xf')]['noop'](_0x0cb1('0xec'));}var _0x220715='wav';var _0x135625=util[_0x0cb1('0x9f')](_0x0cb1('0x137'),FILES_PATH,rs[_0x0cb1('0x11f')](0x4));var _0x29355e=util[_0x0cb1('0x9f')](_0x0cb1('0x9e'),_0x135625,_0x220715);var _0x3bad9c=!![];if(_0x2fc2db[_0x0cb1('0x138')]===_0x0cb1('0x139')){_0x3bad9c=![];}var _0x1799be=this[_0x0cb1('0xf')][_0x0cb1('0x13a')](_0x135625,_0x220715,_0x2fc2db[_0x0cb1('0x13b')],_0x2fc2db[_0x0cb1('0x67')],undefined,_0x3bad9c);if(_0x1799be[_0x0cb1('0xa7')]!==-0x1){this[_0x0cb1('0xf')][_0x0cb1('0xca')](util['format']('google\x20%s\x20file\x20created',_0x29355e));var _0x5d7682=this[_0x0cb1('0x8f')][_0x0cb1('0xa9')](this,_0x2fc2db,_0x29355e);if(_0x5d7682){for(var _0x52b723 in _0x5d7682){if(_0x5d7682[_0x0cb1('0x96')](_0x52b723)){this[_0x0cb1('0xf')]['setVariable'](util['format'](_0x0cb1('0x13c'),_0x52b723['toUpperCase']()),_0x5d7682[_0x52b723]);}}return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x13d'),JSON[_0x0cb1('0x73')](_0x5d7682)));}}return _0x1799be;};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x13e')]=function(_0x2aac03){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x13f'),_0x2aac03['label']));if(!this[_0x0cb1('0x86')](_0x2aac03[_0x0cb1('0x92')])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0x140'));}if(!this[_0x0cb1('0x86')](_0x2aac03[_0x0cb1('0x93')])){return this[_0x0cb1('0xf')]['noop'](_0x0cb1('0x141'));}var _0x2217f3=_0x0cb1('0x142');var _0x5e8b2d=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x0cb1('0x11f')](0x4));var _0x795187=util['format'](_0x0cb1('0x9e'),_0x5e8b2d,_0x2217f3);var _0x3cffa2=!![];if(_0x2aac03[_0x0cb1('0x138')]===_0x0cb1('0x139')){_0x3cffa2=![];}var _0x539a70=this[_0x0cb1('0xf')][_0x0cb1('0x13a')](_0x5e8b2d,_0x2217f3,_0x2aac03['intKey'],_0x2aac03['timeout'],undefined,_0x3cffa2);if(_0x539a70[_0x0cb1('0xa7')]!==-0x1){this[_0x0cb1('0xf')]['noop'](util[_0x0cb1('0x9f')]('tilde\x20%s\x20file\x20created',_0x795187));var _0x558300=this[_0x0cb1('0x91')][_0x0cb1('0xa9')](this,_0x2aac03,_0x795187);if(_0x558300){for(var _0x3278aa in _0x558300){if(_0x558300[_0x0cb1('0x96')](_0x3278aa)){this['channel']['setVariable'](util[_0x0cb1('0x9f')](_0x0cb1('0x143'),_0x3278aa[_0x0cb1('0xf0')]()),_0x558300[_0x3278aa]);}}return this['channel'][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x144'),JSON[_0x0cb1('0x73')](_0x558300)));}}return _0x539a70;};AGIVertices['prototype'][_0x0cb1('0x145')]=function(_0xf0a222){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x146'),_0xf0a222[_0x0cb1('0x37')]));return this[_0x0cb1('0xf')][_0x0cb1('0x147')](_0xf0a222[_0x0cb1('0x3b')],_0xf0a222[_0x0cb1('0x148')],_0xf0a222[_0x0cb1('0x3c')]);};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x149')]=function(_0x2b50ff){logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0x14a'),_0x2b50ff[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x2b50ff[_0x0cb1('0x14b')])){return this['channel'][_0x0cb1('0x2b')](_0x2b50ff,_0x0cb1('0x14c'));}try{var _0x6181c9=eval(_0x2b50ff[_0x0cb1('0x14b')])?_0x0cb1('0x14d'):_0x0cb1('0x14e');this[_0x0cb1('0xf')]['noop'](util[_0x0cb1('0x9f')](_0x0cb1('0x14f'),_0x2b50ff[_0x0cb1('0x14b')],_0x6181c9));return{'code':0xc8,'result':_0x6181c9};}catch(_0x1c6ab9){return{'code':0xc8,'result':_0x0cb1('0x14e')};}};AGIVertices['prototype'][_0x0cb1('0x150')]=function(_0x48fd01){logger['info'](util['format'](_0x0cb1('0x151'),_0x48fd01[_0x0cb1('0x37')]));if(!this['isConfigured'](_0x48fd01[_0x0cb1('0x152')])){return this[_0x0cb1('0xf')]['error'](_0x48fd01,_0x0cb1('0x153'));}var _0x1e78c9=this[_0x0cb1('0x24')]['sync'](this,_0x48fd01[_0x0cb1('0x152')]);if(!_0x1e78c9){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x48fd01,_0x0cb1('0x154'));}for(var _0x1163f2=0x0;_0x1163f2<_0x1e78c9[_0x0cb1('0x9c')];_0x1163f2+=0x1){var _0x22eeb5=this[_0x0cb1('0xf')][_0x0cb1('0xa4')](util[_0x0cb1('0x9f')](_0x0cb1('0x155'),_0x1e78c9[_0x1163f2]));if(_0x22eeb5[_0x0cb1('0xa7')]===-0x1){return _0x22eeb5;}logger[_0x0cb1('0x2d')](util['format'](_0x0cb1('0x156'),_0x1e78c9[_0x1163f2],_0x22eeb5[_0x0cb1('0xa5')]));if(_0x22eeb5['extra']===_0x0cb1('0x14d')){logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0x156'),_0x1e78c9[_0x1163f2],_0x0cb1('0x14d')));this[_0x0cb1('0xf')]['noop'](util['format'](_0x0cb1('0x156'),_0x1e78c9[_0x1163f2],'true'));return{'code':0xc8,'result':_0x0cb1('0x14d')};}else{logger[_0x0cb1('0x2d')](util['format']('IFTIME\x20%s\x20%s',_0x1e78c9[_0x1163f2],_0x0cb1('0x14e')));this['channel'][_0x0cb1('0xca')](util[_0x0cb1('0x9f')]('IFTIME\x20%s\x20%s',_0x1e78c9[_0x1163f2],_0x0cb1('0x14e')));}}return{'code':0xc8,'result':_0x0cb1('0x14e')};};AGIVertices['prototype'][_0x0cb1('0x157')]=function(_0xf7146c){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x158'),_0xf7146c['label']));return this['channel']['hangup']();};AGIVertices['prototype']['ispeechasr']=function(_0x591d3d){logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0x159'),_0x591d3d[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x591d3d['key'])){return this[_0x0cb1('0xf')]['noop'](_0x0cb1('0xec'));}var _0x4afd93=_0x0cb1('0x142');var _0x50f738=util[_0x0cb1('0x9f')]('%s/recordings/%s',FILES_PATH,rs[_0x0cb1('0x11f')](0x4));var _0x48e43f=util[_0x0cb1('0x9f')]('%s.%s',_0x50f738,_0x4afd93);var _0x1982e9=!![];if(_0x591d3d[_0x0cb1('0x138')]===_0x0cb1('0x139')){_0x1982e9=![];}var _0x547de7=this['channel'][_0x0cb1('0x13a')](_0x50f738,_0x4afd93,_0x591d3d['intKey'],_0x591d3d['timeout'],undefined,_0x1982e9);if(_0x547de7[_0x0cb1('0xa7')]!==-0x1){this['channel'][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x15a'),_0x48e43f));var _0x2cb50a=this[_0x0cb1('0x15b')][_0x0cb1('0xa9')](this,_0x591d3d,_0x48e43f);if(_0x2cb50a){for(var _0x356eac in _0x2cb50a){if(_0x2cb50a[_0x0cb1('0x96')](_0x356eac)){this[_0x0cb1('0xf')][_0x0cb1('0xa0')](util[_0x0cb1('0x9f')](_0x0cb1('0x15c'),_0x356eac['toUpperCase']()),_0x2cb50a[_0x356eac]);}}return this['channel'][_0x0cb1('0xca')](util[_0x0cb1('0x9f')]('IspeechASR\x20Result\x20%s',JSON[_0x0cb1('0x73')](_0x2cb50a)));}}return _0x547de7;};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x15d')]=function(_0x21c6b9){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x21c6b9[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x21c6b9['key'])){return this['channel']['noop'](_0x0cb1('0xec'));}if(!this['isConfigured'](_0x21c6b9[_0x0cb1('0x5d')])){return this['channel'][_0x0cb1('0xca')](_0x0cb1('0xad'));}this['channel'][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x15e'),_0x21c6b9[_0x0cb1('0x5d')]));var _0x5ae865=this[_0x0cb1('0x81')][_0x0cb1('0xa9')](this,_0x21c6b9);if(_0x5ae865){this['channel'][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x15a'),_0x5ae865));var _0x385262=this[_0x0cb1('0xf')][_0x0cb1('0x108')](_0x5ae865,_0x21c6b9[_0x0cb1('0x13b')]);try{fs[_0x0cb1('0x109')](_0x5ae865+_0x0cb1('0x15f'));}catch(_0x7c01ae){logger['error'](_0x7c01ae);}return _0x385262;}return this['channel'][_0x0cb1('0x2b')](_0x21c6b9,_0x0cb1('0x160'));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x161')]=function(_0x1140b7){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x162'),_0x1140b7[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x1140b7[_0x0cb1('0x163')])){return this[_0x0cb1('0xf')]['error'](_0x1140b7,_0x0cb1('0x164'));}logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x1140b7[_0x0cb1('0x163')]));var _0x435b28=this[_0x0cb1('0x53')]['sync'](this,_0x1140b7['findBy']);if(_0x435b28){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x165'),this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x1140b7[_0x0cb1('0x163')]));this[_0x0cb1('0xf')]['noop'](util[_0x0cb1('0x9f')](_0x0cb1('0x165'),this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x1140b7[_0x0cb1('0x163')]));return{'code':0xc8,'result':_0x0cb1('0x166')};}else{logger[_0x0cb1('0x2d')](util['format'](_0x0cb1('0x167'),this['channel'][_0x0cb1('0x38')],_0x1140b7[_0x0cb1('0x163')]));this[_0x0cb1('0xf')][_0x0cb1('0xca')](util['format'](_0x0cb1('0x167'),this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x1140b7[_0x0cb1('0x163')]));return{'code':0xc8,'result':_0x0cb1('0x168')};}};AGIVertices['prototype'][_0x0cb1('0x169')]=function(_0x387ecf){logger[_0x0cb1('0x2d')](util['format'](_0x0cb1('0x16a'),_0x387ecf[_0x0cb1('0x37')]));if(!this['isConfigured'](_0x387ecf['findBy'])){return this['channel'][_0x0cb1('0x2b')](_0x387ecf,_0x0cb1('0x164'));}logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x16b'),this['channel']['callerid'],_0x387ecf['findBy']));var _0x1c58e6=this[_0x0cb1('0x52')][_0x0cb1('0xa9')](this,_0x387ecf[_0x0cb1('0x163')]);if(_0x1c58e6){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x165'),this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x387ecf[_0x0cb1('0x163')]));this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x165'),this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x387ecf[_0x0cb1('0x163')]));return{'code':0xc8,'result':_0x0cb1('0x166')};}else{logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x387ecf[_0x0cb1('0x163')]));this['channel'][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x167'),this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x387ecf[_0x0cb1('0x163')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x16c')]=function(_0x26e6ce){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x16d'),_0x26e6ce['label']));if(!this['isConfigured'](_0x26e6ce['operation'])){return this[_0x0cb1('0xf')]['error'](_0x26e6ce,_0x0cb1('0x16e'));}this['channel'][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x16f'),_0x26e6ce[_0x0cb1('0x170')]));var _0xe1f72c=eval(_0x26e6ce[_0x0cb1('0x170')]);if(!this['isConfigured'](_0x26e6ce[_0x0cb1('0xd9')])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0xda'));}var _0x41da15=this[_0x0cb1('0xa4')][_0x0cb1('0xa9')](this,_0x26e6ce['variable_id']);if(!_0x41da15){return this[_0x0cb1('0xf')]['error'](_0x26e6ce,_0x0cb1('0xdb'));}if(_[_0x0cb1('0x9b')](_0xe1f72c)){var _0x363c69=this;_0xe1f72c['forEach'](function(_0x395b9e,_0x1ba47d){_0x363c69['channel'][_0x0cb1('0xa0')](util[_0x0cb1('0x9f')](_0x0cb1('0x171'),_0x41da15,_0x1ba47d),_0x395b9e);});return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util['format'](_0x0cb1('0x172'),_0x41da15));}else{return this[_0x0cb1('0xf')][_0x0cb1('0xa0')](_0x41da15,_0xe1f72c);}};AGIVertices[_0x0cb1('0x12')]['menu']=function(_0x5169b1){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x173'),_0x5169b1[_0x0cb1('0x37')]));if(_0x5169b1[_0x0cb1('0xaa')]===0x0){return this[_0x0cb1('0x174')](_0x5169b1);}_0x5169b1[_0x0cb1('0xaa')]-=0x1;if(!this[_0x0cb1('0x86')](_0x5169b1[_0x0cb1('0x117')])){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x5169b1,_0x0cb1('0x118'));}var _0x398bcd=this[_0x0cb1('0x1d')][_0x0cb1('0xa9')](this,_0x5169b1[_0x0cb1('0x117')]);if(!_0x398bcd){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x5169b1,_0x0cb1('0x119'));}var _0x3bbe7e=this[_0x0cb1('0xf')][_0x0cb1('0x11a')](_0x398bcd,_0x5169b1[_0x0cb1('0x175')],_0x5169b1['digit']);var _0x1fda37=_0x3bbe7e[_0x0cb1('0xa7')];if(_0x3bbe7e[_0x0cb1('0xa7')]===-0x1){this[_0x0cb1('0x35')]['sync'](this,_0x5169b1,'-1');return _0x3bbe7e;}else if(_0x3bbe7e['extra']===_0x0cb1('0x67')){_0x3bbe7e[_0x0cb1('0xa7')]=_0x3bbe7e['result'][_0x0cb1('0x9c')]>0x0?_0x3bbe7e['result']:'t';}else if(_[_0x0cb1('0x43')](_0x3bbe7e[_0x0cb1('0xa7')])){_0x3bbe7e[_0x0cb1('0xa7')]='#';_0x1fda37='#';}if(!this['isConfigured'](_0x5169b1[_0x0cb1('0xd9')])){this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0xda'));}else{var _0x512e2c=this['getVariable'][_0x0cb1('0xa9')](this,_0x5169b1[_0x0cb1('0xd9')]);if(!_0x512e2c){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x5169b1,'no\x20variable\x20found');}this['channel'][_0x0cb1('0xa0')](_0x512e2c,_0x1fda37);}this[_0x0cb1('0x35')][_0x0cb1('0xa9')](this,_0x5169b1,_0x1fda37);return _0x3bbe7e;};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0xca')]=function(_0x76ccb6){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x176'),_0x76ccb6[_0x0cb1('0x37')]));return this[_0x0cb1('0xf')]['noop'](_0x76ccb6['output']||_0x76ccb6['label']);};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x177')]=function(_0x296795){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x178'),_0x296795[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x296795['findBy'])){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x296795,_0x0cb1('0x164'));}logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0x16b'),this[_0x0cb1('0xf')]['callerid'],_0x296795['findBy']));var _0x352b89=this['getPause']['sync'](this,_0x296795[_0x0cb1('0x179')]);var _0x26052c=this[_0x0cb1('0x4f')]['sync'](this,_0x296795['findBy'],_0x352b89);if(_0x26052c){logger['info'](util[_0x0cb1('0x9f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x296795['findBy']));this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x165'),this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x296795['findBy']));return{'code':0xc8,'result':_0x0cb1('0x166')};}else{logger[_0x0cb1('0x2d')](util['format'](_0x0cb1('0x167'),this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x296795[_0x0cb1('0x163')]));this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x296795[_0x0cb1('0x163')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x0cb1('0x12')]['playback']=function(_0x889758){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x17a'),_0x889758[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x889758[_0x0cb1('0x117')])){return this['channel'][_0x0cb1('0x2b')](_0x889758,_0x0cb1('0x118'));}var _0x5c0da0=this['getSound'][_0x0cb1('0xa9')](this,_0x889758['file_id']);if(!_0x5c0da0){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x889758,'no\x20file\x20audio\x20found');}var _0x58bc0b=this[_0x0cb1('0xf')][_0x0cb1('0x58')](_0x0cb1('0x17b'),[_0x5c0da0,_0x889758['opts']]);if(_0x58bc0b[_0x0cb1('0xa7')]===-0x1){return _0x58bc0b;}return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')]('Executed\x20command\x20%s\x20%s',_0x0cb1('0x17b'),_0x5c0da0));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x17c')]=function(_0xbe4d50){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x17d'),_0xbe4d50[_0x0cb1('0x37')]));if(!this['isConfigured'](_0xbe4d50[_0x0cb1('0x17e')])){return this['channel'][_0x0cb1('0x2b')](_0xbe4d50,_0x0cb1('0x17f'));}var _0x1cbc19='';var _0x50cba9=parseInt(_0xbe4d50[_0x0cb1('0x17e')],0xa);if(isNaN(_0x50cba9)){_0x1cbc19=_0xbe4d50[_0x0cb1('0x17e')];}else{_0x1cbc19=this[_0x0cb1('0x13')]['sync'](this,_0xbe4d50[_0x0cb1('0x17e')]);if(!_0x1cbc19){return this['channel']['error'](_0xbe4d50,_0x0cb1('0x180'));}}var _0x137bbf='';if(this[_0x0cb1('0x86')](_0xbe4d50[_0x0cb1('0x117')])){var _0x4dffbf=this[_0x0cb1('0x1d')]['sync'](this,_0xbe4d50['file_id']);if(_0x4dffbf){_0x137bbf=_0x4dffbf;}}this['createSquareDetailsReport'][_0x0cb1('0xa9')](this,_0xbe4d50,_0x1cbc19);if(_0xbe4d50[_0x0cb1('0xe8')][_0x0cb1('0x181')]('x')<0x0){_0xbe4d50[_0x0cb1('0xe8')]+='x';}if(_0xbe4d50[_0x0cb1('0xe8')][_0x0cb1('0x181')]('X')<0x0){_0xbe4d50[_0x0cb1('0xe8')]+='X';}this[_0x0cb1('0xf')][_0x0cb1('0xa0')](_0x0cb1('0x182'),_0x1cbc19?_0x1cbc19[_0x0cb1('0x183')]():'');var _0x5001eb=this[_0x0cb1('0xf')][_0x0cb1('0x58')](_0x0cb1('0x184'),[_0x1cbc19,_0xbe4d50[_0x0cb1('0xe8')],_0xbe4d50['url'],_0x137bbf,_0xbe4d50[_0x0cb1('0x67')],_0xbe4d50[_0x0cb1('0x6')],_0xbe4d50[_0x0cb1('0x185')],_0xbe4d50[_0x0cb1('0x186')],'',_0xbe4d50['position']]);if(_0x5001eb[_0x0cb1('0xa7')]===-0x1){return _0x5001eb;}return this[_0x0cb1('0xf')]['noop'](util[_0x0cb1('0x9f')](_0x0cb1('0xc6'),_0x0cb1('0x184'),_0x1cbc19));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x187')]=function(_0x420cda){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x188'),_0x420cda[_0x0cb1('0x37')]));var _0x3f6613=_0x420cda[_0x0cb1('0x189')]||_0x0cb1('0x142');var _0x101617=util['format']('%s_%s',this[_0x0cb1('0xf')]['uniqueid'],rs[_0x0cb1('0x11f')](0x5));var _0x32d8e9=util[_0x0cb1('0x9f')]('%s/recordings/%s.%s',FILES_PATH,_0x101617,_0x3f6613);var _0x22c6e9=util[_0x0cb1('0x9f')](_0x0cb1('0x137'),FILES_PATH,_0x101617);this[_0x0cb1('0x39')]['sync'](this,_0x420cda,_0x101617,_0x32d8e9);this[_0x0cb1('0xf')]['setVariable']('RECORDING_SAVENAME',_0x101617);logger[_0x0cb1('0x2d')](_0x0cb1('0x18a'),_0x22c6e9,_0x3f6613,_0x420cda[_0x0cb1('0x18b')],_0x420cda[_0x0cb1('0x67')]);return this[_0x0cb1('0xf')][_0x0cb1('0x13a')](_0x22c6e9,_0x3f6613,_0x420cda[_0x0cb1('0x18b')],_0x420cda[_0x0cb1('0x67')],undefined,!![]);};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x18c')]=function(_0x1feaf0){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x18d'),_0x1feaf0['label']));if(!this[_0x0cb1('0x86')](_0x1feaf0[_0x0cb1('0x64')])){return this['channel'][_0x0cb1('0xca')](_0x0cb1('0x18e'));}var _0x46ef56=this[_0x0cb1('0x63')][_0x0cb1('0xa9')](this,_0x1feaf0);logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')]('Response:',util[_0x0cb1('0x18f')](_0x46ef56,{'showHidden':![],'depth':null})));if(!this[_0x0cb1('0x86')](_0x1feaf0[_0x0cb1('0xd9')])){return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0x190'));}var _0x11edf3=this[_0x0cb1('0xa4')][_0x0cb1('0xa9')](this,_0x1feaf0['variable_id']);if(!_0x11edf3){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x1feaf0,_0x0cb1('0xdb'));}this[_0x0cb1('0xf')][_0x0cb1('0xa0')](util[_0x0cb1('0x9f')](_0x0cb1('0x191'),_0x11edf3),_0x46ef56['statusCode']?_0x46ef56[_0x0cb1('0x75')]:'200');this[_0x0cb1('0xf')]['setVariable'](util['format'](_0x0cb1('0x192'),_0x11edf3),_0x46ef56[_0x0cb1('0x193')]?_0x46ef56[_0x0cb1('0x193')]:'OK');if(_0x46ef56[_0x0cb1('0x6b')]){try{this[_0x0cb1('0x9d')](_0x46ef56[_0x0cb1('0x6b')],_0x11edf3);}catch(_0x1a95d5){logger['error'](util[_0x0cb1('0x9f')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x11edf3));}}return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0xe0'),_0x11edf3));};AGIVertices['prototype'][_0x0cb1('0x194')]=function(_0x1adc42){logger[_0x0cb1('0x2d')](util['format'](_0x0cb1('0x195'),_0x1adc42['label']));return this['channel'][_0x0cb1('0x196')](_0x1adc42[_0x0cb1('0x197')][_0x0cb1('0x5a')](/\s+/g,''),_0x1adc42[_0x0cb1('0x18b')]);};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x198')]=function(_0x1b740b){logger[_0x0cb1('0x2d')](util['format'](_0x0cb1('0x199'),_0x1b740b['label']));return this[_0x0cb1('0xf')][_0x0cb1('0x19a')](_0x1b740b[_0x0cb1('0x66')][_0x0cb1('0x5a')](/\s+/g,''),_0x1b740b[_0x0cb1('0x18b')]);};AGIVertices[_0x0cb1('0x12')]['sayphonetic']=function(_0x28183){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x19b'),_0x28183[_0x0cb1('0x37')]));return this[_0x0cb1('0xf')][_0x0cb1('0x19c')](_0x28183[_0x0cb1('0x5d')],_0x28183[_0x0cb1('0x18b')]);};AGIVertices['prototype'][_0x0cb1('0x19d')]=function(_0x4c1712){logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0x19e'),_0x4c1712['label']));if(!this[_0x0cb1('0x86')](_0x4c1712[_0x0cb1('0x19f')])){return this[_0x0cb1('0xf')]['noop'](_0x0cb1('0x1a0'));}var _0x33ae7b=this[_0x0cb1('0x21')]['sync'](this,_0x4c1712[_0x0cb1('0x19f')]);if(!_0x33ae7b||!_0x33ae7b[_0x0cb1('0x1a1')]){return this['channel'][_0x0cb1('0x2b')](_0x4c1712,'no\x20mail\x20account\x20found');}var _0x3852ae={'from':util[_0x0cb1('0x9f')](_0x0cb1('0x1a2'),_0x33ae7b[_0x0cb1('0x16')],_0x33ae7b[_0x0cb1('0x1a3')]||_0x33ae7b[_0x0cb1('0x1a1')][_0x0cb1('0x1a4')]),'to':_0x4c1712['to']||'','cc':_0x4c1712['cc']||'','bcc':_0x4c1712[_0x0cb1('0x1a5')]||'','subject':_0x4c1712[_0x0cb1('0x1a6')],'html':_0x4c1712[_0x0cb1('0x5d')],'text':_0x4c1712[_0x0cb1('0x5d')]};if(this[_0x0cb1('0x86')](_0x4c1712['template_id'])){}logger[_0x0cb1('0xe2')](_0x0cb1('0x1a7'),JSON[_0x0cb1('0x73')](_0x3852ae));this[_0x0cb1('0x35')][_0x0cb1('0xa9')](this,_0x4c1712,_0x4c1712[_0x0cb1('0x19f')]);this[_0x0cb1('0xf')]['noop'](util[_0x0cb1('0x9f')](_0x0cb1('0x1a8'),_0x33ae7b[_0x0cb1('0x16')]));this['sendMailMessage'][_0x0cb1('0xa9')](this,_0x33ae7b[_0x0cb1('0x1a9')],_0x3852ae);return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0x1aa'));};AGIVertices['prototype'][_0x0cb1('0x1ab')]=function(_0x113a29){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x1ac'),_0x113a29[_0x0cb1('0x37')]));return this['channel'][_0x0cb1('0xca')](_0x0cb1('0x1ad'));};AGIVertices[_0x0cb1('0x12')]['sendSMS']=function(_0xe05f07){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x1ae'),_0xe05f07[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0xe05f07[_0x0cb1('0x1af')])){return this[_0x0cb1('0xf')]['noop'](_0x0cb1('0x1b0'));}var _0x4a662c=this[_0x0cb1('0x32')][_0x0cb1('0xa9')](this,_0xe05f07['sms_account_id']);if(!_0x4a662c){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0xe05f07,_0x0cb1('0x1b1'));}var _0x52fc6c={'body':_0xe05f07[_0x0cb1('0x1b2')],'phone':_0xe05f07['to']||'','SmsAccountId':_0x4a662c['id']};logger[_0x0cb1('0xe2')](_0x0cb1('0x1b3'),JSON[_0x0cb1('0x73')](_0x52fc6c));this[_0x0cb1('0x35')][_0x0cb1('0xa9')](this,_0xe05f07,_0xe05f07['sms_account_id']);this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x4a662c[_0x0cb1('0x16')]));this[_0x0cb1('0x34')]['sync'](this,_0x52fc6c);return this[_0x0cb1('0xf')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x1b4')]=function(_0x162f79){logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0x1b5'),_0x162f79[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x162f79[_0x0cb1('0xd9')])){return this['channel'][_0x0cb1('0x2b')](_0x162f79,_0x0cb1('0x1b6'));}var _0x5cff8d=this[_0x0cb1('0xa4')][_0x0cb1('0xa9')](this,_0x162f79['variable_id']);if(!_0x5cff8d){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x162f79,_0x0cb1('0xdb'));}return this[_0x0cb1('0xf')][_0x0cb1('0xa0')](_0x5cff8d,_0x162f79[_0x0cb1('0x1b7')]);};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x1b8')]=function(_0x73bb96){logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0x1b9'),_0x73bb96[_0x0cb1('0x37')]));this['channel'][_0x0cb1('0xca')](_0x0cb1('0x1ba'));if(_0x73bb96[_0x0cb1('0xbc')]==='yes'){this[_0x0cb1('0xf')][_0x0cb1('0xca')]('Answer');return this['channel'][_0x0cb1('0xbc')]();}return this[_0x0cb1('0xf')][_0x0cb1('0xca')](_0x0cb1('0x1bb'));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x1bc')]=function(_0xc5cd1d){logger[_0x0cb1('0x2d')](util['format'](_0x0cb1('0x1bd'),_0xc5cd1d[_0x0cb1('0x37')]));if(!this['isConfigured'](_0xc5cd1d['project_id'])){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0xc5cd1d,_0x0cb1('0x1be'));}var _0xdadcf8=this['getSquareProject']['sync'](this,_0xc5cd1d['project_id']);if(!this['isConfigured'](_0xdadcf8)){return this['channel'][_0x0cb1('0x2b')](_0xc5cd1d,util[_0x0cb1('0x9f')](_0x0cb1('0x1bf'),_0xc5cd1d[_0x0cb1('0x1c0')]));}if(_0xdadcf8===this[_0x0cb1('0xf')]['arg_1']){return this[_0x0cb1('0xf')]['error'](_0xc5cd1d,_0x0cb1('0x1c1'));}this['createSquareDetailsReport']['sync'](this,_0xc5cd1d,_0xdadcf8);var _0x4fb7bc=this[_0x0cb1('0xf')][_0x0cb1('0x58')]('AGI',util[_0x0cb1('0x9f')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x0cb1('0x6')]['host']||_0x0cb1('0x1c2'),_0xdadcf8,this[_0x0cb1('0xf')][_0x0cb1('0x3f')]));if(_0x4fb7bc[_0x0cb1('0xa7')]===-0x1){return _0x4fb7bc;}return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0xc6'),_0x0cb1('0x1c3'),_0xdadcf8));};AGIVertices['prototype'][_0x0cb1('0x1c4')]=function(_0x232c22){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x1c5'),_0x232c22[_0x0cb1('0x37')]));var _0x3e1d9d=this[_0x0cb1('0x57')][_0x0cb1('0xa9')](this,_0x232c22[_0x0cb1('0xbb')]);this['createSquareDetailsReport'][_0x0cb1('0xa9')](this,_0x232c22,_0x232c22[_0x0cb1('0xbb')]);if(this[_0x0cb1('0x86')](_0x232c22['variable_id'])){var _0x5753be=this[_0x0cb1('0xa4')][_0x0cb1('0xa9')](this,_0x232c22[_0x0cb1('0xd9')]);if(_0x5753be){this['channel'][_0x0cb1('0xa0')](_0x5753be,_0x3e1d9d);return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x1c6'),_0x232c22[_0x0cb1('0xbb')],_0x5753be));}}return this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x1c7'),_0x232c22[_0x0cb1('0xbb')]));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x1c8')]=function(_0x1dba6f){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x1dba6f['label']));_0x1dba6f['text']=_0x1dba6f[_0x0cb1('0x5d')][_0x0cb1('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0cb1('0x86')](_0x1dba6f[_0x0cb1('0x5c')])){return this['channel'][_0x0cb1('0xca')](_0x0cb1('0x1c9'));}if(!this[_0x0cb1('0x86')](_0x1dba6f[_0x0cb1('0x5d')])){return this['channel'][_0x0cb1('0xca')](_0x0cb1('0xad'));}this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x1ca'),_0x1dba6f['text']));var _0xc3628e=this['googleCloudTTS']['sync'](this,_0x1dba6f);if(_0xc3628e){this[_0x0cb1('0xf')]['noop'](util[_0x0cb1('0x9f')](_0x0cb1('0x1cb'),_0xc3628e));var _0x1e3e69=this[_0x0cb1('0xf')]['streamFile'](_0xc3628e);try{fs[_0x0cb1('0x109')](_0xc3628e+_0x0cb1('0x15f'));}catch(_0x2336f2){logger[_0x0cb1('0x2b')](_0x2336f2);}return _0x1e3e69;}return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x1dba6f,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x0cb1('0x1cc')]=function(_0x2e2156){logger[_0x0cb1('0x2d')](util['format'](_0x0cb1('0x1cd'),_0x2e2156[_0x0cb1('0x37')]));_0x2e2156[_0x0cb1('0x5d')]=_0x2e2156['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0cb1('0x86')](_0x2e2156[_0x0cb1('0x5d')])){return this['channel'][_0x0cb1('0xca')](_0x0cb1('0xad'));}this[_0x0cb1('0xf')][_0x0cb1('0xca')](util['format'](_0x0cb1('0x1ce'),_0x2e2156[_0x0cb1('0x5d')]));var _0xe29a90=this['googleTTS'][_0x0cb1('0xa9')](this,_0x2e2156);if(_0xe29a90){this[_0x0cb1('0xf')][_0x0cb1('0xca')](util['format'](_0x0cb1('0x1cf'),_0xe29a90));var _0x2d666f=this[_0x0cb1('0xf')][_0x0cb1('0x108')](_0xe29a90);try{fs[_0x0cb1('0x109')](_0xe29a90+'.wav');}catch(_0x317131){logger[_0x0cb1('0x2b')](_0x317131);}return _0x2d666f;}return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x2e2156,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x1d0')]=function(_0x102b22){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x1d1'),_0x102b22[_0x0cb1('0x37')]));if(!this[_0x0cb1('0x86')](_0x102b22['findBy'])){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x102b22,'no\x20find\x20by\x20configured');}logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x16b'),this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x102b22[_0x0cb1('0x163')]));var _0x47c16f=this['agentUnpause'][_0x0cb1('0xa9')](this,_0x102b22[_0x0cb1('0x163')]);if(_0x47c16f){logger['info'](util[_0x0cb1('0x9f')](_0x0cb1('0x165'),this[_0x0cb1('0xf')]['callerid'],_0x102b22[_0x0cb1('0x163')]));this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x165'),this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x102b22['findBy']));return{'code':0xc8,'result':_0x0cb1('0x166')};}else{logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x167'),this[_0x0cb1('0xf')][_0x0cb1('0x38')],_0x102b22[_0x0cb1('0x163')]));this[_0x0cb1('0xf')][_0x0cb1('0xca')](util[_0x0cb1('0x9f')](_0x0cb1('0x167'),this[_0x0cb1('0xf')]['callerid'],_0x102b22[_0x0cb1('0x163')]));return{'code':0xc8,'result':_0x0cb1('0x168')};}};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x1d2')]=function(_0xea650a){logger[_0x0cb1('0x2d')](util[_0x0cb1('0x9f')](_0x0cb1('0x1d3'),_0xea650a[_0x0cb1('0x37')]));var _0x47ba13=this[_0x0cb1('0xf')][_0x0cb1('0x58')](_0x0cb1('0x1d4'),[_0xea650a[_0x0cb1('0x1d5')],_0xea650a[_0x0cb1('0x78')]]);if(_0x47ba13[_0x0cb1('0xa7')]===-0x1){return _0x47ba13;}return this[_0x0cb1('0xf')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x0cb1('0x1d4'),_0xea650a['mailbox']));};AGIVertices[_0x0cb1('0x12')][_0x0cb1('0x1d6')]=function(_0x5a7b69){logger['info'](util[_0x0cb1('0x9f')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x5a7b69[_0x0cb1('0x37')]));if(!this['isConfigured'](_0x5a7b69['variable_id'])){return this[_0x0cb1('0xf')]['error'](_0x5a7b69,_0x0cb1('0x1b6'));}var _0x4f99d6=this['getVariable'][_0x0cb1('0xa9')](this,_0x5a7b69['variable_id']);if(!_0x4f99d6){return this[_0x0cb1('0xf')][_0x0cb1('0x2b')](_0x5a7b69,_0x0cb1('0xdb'));}var _0x331f3c=this['channel']['getVariable'](_0x4f99d6);return{'code':0xc8,'result':_0x331f3c[_0x0cb1('0xa5')]?_0x331f3c['extra']:'-'};};String[_0x0cb1('0x12')][_0x0cb1('0xa3')]=function(_0x3bf36e,_0x268fa1){return this[_0x0cb1('0xa2')](_0x3bf36e)[_0x0cb1('0x1d7')](_0x268fa1);};module[_0x0cb1('0x1d8')]=AGIVertices; \ No newline at end of file +var _0xc423=['toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','headers','stringify','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clone','hasOwnProperty','isString','recursiveNodeIndex','isPlainObject','length','replaceAllVariables','format','isArray','saveRestApiResult','replaceObjectAllVariables','split','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','MRCP_RECOG_CONFIDENCE','getAndSetVariable','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','minutes','custom_app','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','RECOG_CONFIDENCE()','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','query:\x20%s','getQueryOdbc','variable_id','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','getUser','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','dialogflow','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','out','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','%s.%s','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appsecret','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','digit','output','pause','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','no\x20url\x20configured','restAPI','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','template_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','host','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','util','lodash','shelljs','odbc','randomstring','mustache','request-promise','../../config/logger','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','channel','rpc','mailRpc','prototype','getVariable','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProjectById','getSquareOdbc','dsn','getUserById','getTrunk','getSound','getSoundById','getSoundPath','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','Intervals','%s/sounds/converted/%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','agicommand','arg_1','createSquareRecording','uniqueid','callerid','calleridname','context','priority','dnid','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agent','agentPause','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','googleTTS','google_tts_language','url','timeout','number','includes','POST','PUT','method'];(function(_0x5e26e9,_0x467282){var _0x5c3807=function(_0x506b86){while(--_0x506b86){_0x5e26e9['push'](_0x5e26e9['shift']());}};_0x5c3807(++_0x467282);}(_0xc423,0x159));var _0x3c42=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xc423[_0x138adb];return _0x1b27f2;};'use strict';var fs=require('fs');var util=require(_0x3c42('0x0'));var _=require(_0x3c42('0x1'));var sh=require(_0x3c42('0x2'));var odbc=require(_0x3c42('0x3'))();var rs=require(_0x3c42('0x4'));var moment=require('moment');var Mustache=require(_0x3c42('0x5'));var rp=require(_0x3c42('0x6'));var logger=require(_0x3c42('0x7'))('agi');var config=require(_0x3c42('0x8'));var shared=require(_0x3c42('0x9'));var scripts=require(_0x3c42('0xa'));var FILES_PATH=_0x3c42('0xb');var recursiveMapAttributes=[_0x3c42('0xc'),_0x3c42('0xd')];var verticesWithRetry=[_0x3c42('0xe'),_0x3c42('0xf'),'getsecretdigits'];var AGIVertices=function(_0x2c76a7,_0x5b51ca,_0x4aee99){this[_0x3c42('0x10')]=_0x2c76a7;this[_0x3c42('0x11')]=_0x5b51ca;this[_0x3c42('0x12')]=_0x4aee99;};AGIVertices[_0x3c42('0x13')][_0x3c42('0x14')]=function(_0x22da95,_0x7bfb7d){this[_0x3c42('0x11')]['getVariableById'](_0x22da95)[_0x3c42('0x15')](function(_0x2855e2){_0x7bfb7d(null,_0x2855e2?_0x2855e2[_0x3c42('0x16')]:![]);})[_0x3c42('0x17')](function(_0x1f802b){_0x7bfb7d(_0x1f802b);});};AGIVertices['prototype'][_0x3c42('0x18')]=function(_0x558caa,_0x385f99){this[_0x3c42('0x11')][_0x3c42('0x19')](_0x558caa)['then'](function(_0x21f75a){_0x385f99(null,_0x21f75a?_0x21f75a[_0x3c42('0x16')]:![]);})['catch'](function(_0x5880b7){_0x385f99(_0x5880b7);});};AGIVertices[_0x3c42('0x13')]['getSquareProject']=function(_0x1893c0,_0x493913){this[_0x3c42('0x11')][_0x3c42('0x1a')](_0x1893c0)['then'](function(_0x88b878){_0x493913(null,_0x88b878?_0x88b878[_0x3c42('0x16')]:![]);})[_0x3c42('0x17')](function(_0x3e1580){_0x493913(_0x3e1580);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x1b')]=function(_0x194f2e,_0x32a25e){this[_0x3c42('0x11')]['getSquareOdbcById'](_0x194f2e)[_0x3c42('0x15')](function(_0x34c476){_0x32a25e(null,_0x34c476?_0x34c476[_0x3c42('0x1c')]:![]);})[_0x3c42('0x17')](function(_0x4953e3){_0x32a25e(_0x4953e3);});};AGIVertices[_0x3c42('0x13')]['getUser']=function(_0x4a1a5d,_0x204fee){this[_0x3c42('0x11')][_0x3c42('0x1d')](_0x4a1a5d)[_0x3c42('0x15')](function(_0x2b7fdd){_0x204fee(null,_0x2b7fdd?_0x2b7fdd[_0x3c42('0x16')]:![]);})[_0x3c42('0x17')](function(_0x1902d8){_0x204fee(_0x1902d8);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x1e')]=function(_0x378696,_0x3b3e6e){this[_0x3c42('0x11')]['getTrunkById'](_0x378696)[_0x3c42('0x15')](function(_0x2f8a4a){_0x3b3e6e(null,_0x2f8a4a?_0x2f8a4a[_0x3c42('0x16')]:![]);})['catch'](function(_0x46d96c){_0x3b3e6e(_0x46d96c);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x1f')]=function(_0x3639e8,_0x4d183c){var _0x32b91e=this;this[_0x3c42('0x11')][_0x3c42('0x20')](_0x3639e8)[_0x3c42('0x15')](function(_0x21fc9b){_0x4d183c(null,_0x21fc9b?_0x32b91e[_0x3c42('0x21')](_0x21fc9b['save_name']):![]);})[_0x3c42('0x17')](function(_0x2e8c52){_0x4d183c(_0x2e8c52);});};AGIVertices[_0x3c42('0x13')]['getMailAccount']=function(_0x52971a,_0x567dcc){this[_0x3c42('0x11')][_0x3c42('0x22')](_0x52971a)[_0x3c42('0x15')](function(_0x495172){_0x567dcc(null,_0x495172?_0x495172:![]);})[_0x3c42('0x17')](function(_0x5cef43){_0x567dcc(_0x5cef43);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x23')]=function(_0x2559df,_0x3e17ae,_0x1ae6c0){this[_0x3c42('0x12')][_0x3c42('0x23')](_0x2559df,_0x3e17ae)[_0x3c42('0x15')](function(){_0x1ae6c0(null);})['catch'](function(_0xbdedd4){_0x1ae6c0(_0xbdedd4);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x24')]=function(_0x240f9f,_0x267c23){this['rpc']['getIntervalById'](_0x240f9f)[_0x3c42('0x15')](function(_0x14e09d){if(_0x14e09d){if(_0x14e09d[_0x3c42('0x25')]){_0x267c23(null,[_0x14e09d[_0x3c42('0x26')]]);}else{_0x267c23(null,_['map'](_0x14e09d[_0x3c42('0x27')],_0x3c42('0x26')));}}else{_0x267c23(null,![]);}})['catch'](function(_0x359a58){_0x267c23(_0x359a58);});};AGIVertices['prototype']['getSoundPath']=function(_0x20a1f9){return util['format'](_0x3c42('0x28'),FILES_PATH,_0x20a1f9);};AGIVertices[_0x3c42('0x13')]['getQueryOdbc']=function(_0x2da913,_0x3ce8bf,_0x6231d3){odbc['open'](_0x2da913,function(_0x367f7a){if(_0x367f7a){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x367f7a);_0x6231d3(_0x367f7a);}else{logger[_0x3c42('0x29')](_0x3c42('0x2a'));odbc[_0x3c42('0x2b')](_0x3ce8bf,function(_0x5b07da,_0x5614c1){if(_0x5b07da){logger[_0x3c42('0x29')]('Error\x20executing\x20query\x20%s',_0x3ce8bf);_0x6231d3(_0x5b07da);}else{logger[_0x3c42('0x29')](_0x3c42('0x2c'),_0x3ce8bf);odbc[_0x3c42('0x2d')](function(_0x4b9c5b){if(_0x4b9c5b){logger[_0x3c42('0x2e')](_0x3c42('0x2f'),_0x4b9c5b);}_0x6231d3(null,_0x5614c1);});}});}});};AGIVertices['prototype'][_0x3c42('0x30')]=function(_0xc34f9c,_0x2d12ba){this[_0x3c42('0x11')][_0x3c42('0x31')](_0xc34f9c)['then'](function(_0x36a708){_0x2d12ba(null,_0x36a708?_0x36a708:![]);})['catch'](function(_0x1eb5a9){_0x2d12ba(_0x1eb5a9);});};AGIVertices['prototype']['createSmsMessage']=function(_0x280d54,_0x33dbfc){this[_0x3c42('0x11')][_0x3c42('0x32')](_0x280d54)[_0x3c42('0x15')](function(_0x215783){_0x33dbfc(null,_0x215783);})[_0x3c42('0x17')](function(_0x484783){_0x33dbfc(_0x484783);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x33')]=function(_0x55db6e,_0x3ea017,_0x53b10a){this[_0x3c42('0x11')]['createSquareDetailsReport']({'uniqueid':this[_0x3c42('0x10')]['uniqueid'],'node':_0x55db6e['label'],'application':_0x55db6e[_0x3c42('0x34')],'data':_0x3ea017||null,'project_name':this['channel'][_0x3c42('0x35')],'callerid':this[_0x3c42('0x10')]['callerid']})['then'](function(_0x2b6367){if(_0x53b10a){_0x53b10a(null,_0x2b6367);}})[_0x3c42('0x17')](function(_0x723687){if(_0x53b10a){_0x53b10a(_0x723687);}});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x36')]=function(_0x5da4bf,_0x457cb1,_0x9d3c7e,_0x44761c){this[_0x3c42('0x11')]['createSquareRecording']({'uniqueid':this[_0x3c42('0x10')][_0x3c42('0x37')],'callerid':this[_0x3c42('0x10')][_0x3c42('0x38')],'calleridname':this[_0x3c42('0x10')][_0x3c42('0x39')],'context':this[_0x3c42('0x10')][_0x3c42('0x3a')],'extension':this[_0x3c42('0x10')]['extension'],'priority':this[_0x3c42('0x10')][_0x3c42('0x3b')],'accountcode':this[_0x3c42('0x10')]['accountcode'],'dnid':this[_0x3c42('0x10')][_0x3c42('0x3c')],'projectName':this[_0x3c42('0x10')][_0x3c42('0x35')],'saveName':_0x457cb1,'filename':_0x5da4bf['file']||_0x457cb1,'savePath':_0x9d3c7e})[_0x3c42('0x15')](function(_0x4e871f){_0x44761c(null,_0x4e871f);})[_0x3c42('0x17')](function(_0x3bce0c){_0x44761c(_0x3bce0c);});};AGIVertices['prototype'][_0x3c42('0x3d')]=function(_0x40c1a6,_0x1857ad,_0x269a47,_0x1aca8a,_0x16cb64){this['rpc']['createSquareMessage']({'uniqueid':this[_0x3c42('0x10')][_0x3c42('0x37')],'body':_0x40c1a6,'direction':_0x1857ad,'providerName':_0x269a47,'providerResponse':_0x1aca8a})[_0x3c42('0x15')](function(_0x10f5c2){if(_0x16cb64){_0x16cb64(null,_0x10f5c2);}})[_0x3c42('0x17')](function(_0x594f26){if(_0x16cb64){_0x16cb64(_0x594f26);}});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x3e')]=function(_0x14675a,_0x4e65d0){this['rpc'][_0x3c42('0x3e')]({'firstName':_[_0x3c42('0x3f')](_0x14675a[_0x3c42('0x16')])||_[_0x3c42('0x40')](_0x14675a[_0x3c42('0x16')])?_0x3c42('0x41')+Math['random']():_0x14675a['name'],'lastName':_[_0x3c42('0x3f')](_0x14675a[_0x3c42('0x42')])||_['isNil'](_0x14675a[_0x3c42('0x42')])?null:_0x14675a[_0x3c42('0x42')],'phone':_0x14675a[_0x3c42('0x43')],'ListId':_0x14675a[_0x3c42('0x44')],'scheduledat':_0x14675a[_0x3c42('0x45')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0x3c42('0x46'),'description':_0x3c42('0x47')+_0x14675a[_0x3c42('0x45')][_0x3c42('0x48')](),'priority':_0x14675a[_0x3c42('0x49')]})['then'](function(_0x31fc0f){_0x4e65d0(null,_0x31fc0f);})[_0x3c42('0x17')](function(_0x4e7b6f){_0x4e65d0(_0x4e7b6f);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x4a')]=function(_0x4b6ffc,_0x6a9745){this['rpc'][_0x3c42('0x4b')](_0x4b6ffc)[_0x3c42('0x15')](function(_0x382191){_0x6a9745(null,_0x382191?_0x382191[_0x3c42('0x16')]:![]);})['catch'](function(_0x1a79bd){_0x6a9745(_0x1a79bd);});};AGIVertices['prototype']['agentPause']=function(_0x480a83,_0x579370,_0x1190e1){var _0x5eab20={'role':_0x3c42('0x4c')};_0x5eab20[_0x480a83]=this[_0x3c42('0x10')][_0x3c42('0x38')];this[_0x3c42('0x11')][_0x3c42('0x4d')](_0x5eab20,_0x579370,this[_0x3c42('0x10')][_0x3c42('0x37')])[_0x3c42('0x15')](function(_0x41df90){_0x1190e1(null,_[_0x3c42('0x40')](_0x41df90)?![]:!![]);})[_0x3c42('0x17')](function(_0x3530b0){logger[_0x3c42('0x2e')](_0x3530b0);_0x1190e1(null,![]);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x4e')]=function(_0x5a1cf4,_0x32bc62){var _0x3c7bd5={'role':_0x3c42('0x4c')};_0x3c7bd5[_0x5a1cf4]=this[_0x3c42('0x10')][_0x3c42('0x38')];this[_0x3c42('0x11')][_0x3c42('0x4e')](_0x3c7bd5)[_0x3c42('0x15')](function(_0x44be3b){_0x32bc62(null,_['isNil'](_0x44be3b)?![]:!![]);})[_0x3c42('0x17')](function(_0x2101cf){logger['error'](_0x2101cf);_0x32bc62(null,![]);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x4f')]=function(_0x1a70c0,_0x5d816d){var _0x346931={'role':_0x3c42('0x4c')};_0x346931[_0x1a70c0]=this[_0x3c42('0x10')][_0x3c42('0x38')];this[_0x3c42('0x11')][_0x3c42('0x4f')](_0x346931)['then'](function(_0x2ef379){_0x5d816d(null,_[_0x3c42('0x40')](_0x2ef379)?![]:!![]);})[_0x3c42('0x17')](function(_0x2b9854){logger['error'](_0x2b9854);_0x5d816d(null,![]);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x50')]=function(_0x612032,_0x17bd3c){var _0x5c8986={'role':_0x3c42('0x4c')};_0x5c8986[_0x612032]=this[_0x3c42('0x10')][_0x3c42('0x38')];var _0xd98736=_0x612032!=_0x3c42('0x51')?util['format'](_0x3c42('0x52'),'LOCAL',this[_0x3c42('0x10')]['callerid']):undefined;this['rpc'][_0x3c42('0x50')](_0x5c8986,_0xd98736)['then'](function(_0x2e4572){_0x17bd3c(null,_['isNil'](_0x2e4572)?![]:!![]);})[_0x3c42('0x17')](function(_0x45de32){logger[_0x3c42('0x2e')](_0x45de32);_0x17bd3c(null,![]);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x53')]=function(_0x719730,_0x10099c){sh[_0x3c42('0x54')](_[_0x3c42('0x55')](_0x719730),function(_0x2275cb,_0x349e1c){var _0xdfeadf=_0x349e1c[_0x3c42('0x56')](/(\r\n|\n|\r)/gm,'');_0x10099c(null,_0xdfeadf);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x57')]=function(_0x332583,_0x10fd6a){scripts['googleCloudTTS'](_0x332583[_0x3c42('0x58')],_0x332583[_0x3c42('0x59')]||_0x3c42('0x5a'),_0x332583[_0x3c42('0x5a')],_0x332583[_0x3c42('0x5b')]||_0x3c42('0x5c'),_0x332583[_0x3c42('0x5d')]||_0x3c42('0x5e'),_0x332583[_0x3c42('0x5f')]||'MP3')[_0x3c42('0x15')](function(_0x563271){_0x10fd6a(null,_0x563271);})[_0x3c42('0x17')](function(_0x3ec39f){_0x10fd6a(_0x3ec39f);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x60')]=function(_0x46af8e,_0x3d1fbc){scripts[_0x3c42('0x60')](_0x46af8e[_0x3c42('0x5a')],_0x46af8e[_0x3c42('0x61')]||'en',0x1)[_0x3c42('0x15')](function(_0x95b1af){_0x3d1fbc(null,_0x95b1af);})['catch'](function(_0xd06556){_0x3d1fbc(_0xd06556);});};AGIVertices['prototype']['restAPI']=function(_0xb4813c,_0x2bf336){var _0x1821da={'uri':_0xb4813c[_0x3c42('0x62')],'method':_0xb4813c['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0xb4813c[_0x3c42('0x63')])===_0x3c42('0x64')&&parseInt(_0xb4813c[_0x3c42('0x63')])>=0x1?parseInt(_0xb4813c[_0x3c42('0x63')])*0x3e8:0x5*0x3e8};if(_[_0x3c42('0x65')]([_0x3c42('0x66'),_0x3c42('0x67')],_0x1821da[_0x3c42('0x68')][_0x3c42('0x69')]())){try{_0x1821da[_0x3c42('0x6a')]=_0xb4813c[_0x3c42('0xd')]?JSON['parse'](_0xb4813c['rawBody']):{};}catch(_0x39136d){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x39136d);}}try{_0x1821da['headers']=_0xb4813c['rawHeaders']?JSON[_0x3c42('0x6b')](_0xb4813c['rawHeaders']):{};}catch(_0x1f0844){logger['error'](_0x3c42('0x6c'),_0x1f0844);}if(_0xb4813c[_0x3c42('0x6d')]){try{var _0x3a8b69=require(_0xb4813c[_0x3c42('0x6d')])[_0x3c42('0x6e')](this,_0x1821da);_0x1821da[_0x3c42('0x6f')]=Mustache[_0x3c42('0x70')](_0xb4813c[_0x3c42('0x62')],_0x3a8b69,{},['$$','$$']);if(_0x1821da[_0x3c42('0x71')]){_0x1821da['headers']=JSON[_0x3c42('0x6b')](Mustache[_0x3c42('0x70')](JSON[_0x3c42('0x72')](_0x1821da['headers']),_0x3a8b69,{},['$$','$$']));}if(_0x1821da['body']){_0x1821da[_0x3c42('0x6a')]=JSON[_0x3c42('0x6b')](Mustache['render'](JSON[_0x3c42('0x72')](_0x1821da[_0x3c42('0x6a')]),_0x3a8b69,{},['$$','$$']));}}catch(_0x2f5faa){logger[_0x3c42('0x2e')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x2f5faa);}}rp(_0x1821da)[_0x3c42('0x15')](function(_0x5ee1c8){var _0x1a3620={'statusCode':_0x5ee1c8[_0x3c42('0x73')]||0xc8,'statusMessage':_0x5ee1c8[_0x3c42('0x74')]||'OK','headers':_0x5ee1c8[_0x3c42('0x71')]||{},'body':_0x5ee1c8[_0x3c42('0x6a')]||{}};_0x2bf336(null,_0x1a3620);})['catch'](function(_0x13458d){var _0x3550ec={'statusCode':_0x13458d[_0x3c42('0x73')]||0x1f4,'statusMessage':_0x13458d[_0x3c42('0x75')]||_0x3c42('0x76'),'headers':_0x13458d[_0x3c42('0x77')][_0x3c42('0x71')]||{},'body':_0x13458d[_0x3c42('0x77')][_0x3c42('0x6a')]||{}};_0x2bf336(null,_0x3550ec);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x78')]=function(_0x4c01e2,_0x16f8e6){scripts[_0x3c42('0x78')](this[_0x3c42('0x10')][_0x3c42('0x37')],_0x4c01e2[_0x3c42('0x79')],_0x4c01e2[_0x3c42('0x5a')],_0x4c01e2['dialogflow_language']||'en')['then'](function(_0x138b36){_0x16f8e6(null,_0x138b36);})[_0x3c42('0x17')](function(_0x2e3ac6){_0x16f8e6(_0x2e3ac6);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x7a')]=function(_0x136396,_0x1e37c8){scripts[_0x3c42('0x7a')](this[_0x3c42('0x10')][_0x3c42('0x37')],_0x136396[_0x3c42('0x7b')],_0x136396[_0x3c42('0x7c')],_0x136396[_0x3c42('0x7d')],_0x136396['text'],_0x136396[_0x3c42('0x7e')]||'en')[_0x3c42('0x15')](function(_0x2770c9){_0x1e37c8(null,_0x2770c9);})[_0x3c42('0x17')](function(_0x35c408){_0x1e37c8(_0x35c408);});};AGIVertices[_0x3c42('0x13')]['sestekNDA']=function(_0x5631fd,_0x1feea0){scripts[_0x3c42('0x7f')](this[_0x3c42('0x10')],_0x5631fd)[_0x3c42('0x15')](function(_0x1ee90a){_0x1feea0(null,_0x1ee90a);})[_0x3c42('0x17')](function(_0x5dc07d){_0x1feea0(_0x5dc07d);});};AGIVertices['prototype']['ispeechTTS']=function(_0x2c737f,_0x217baf){scripts['ispeechTTS'](_0x2c737f[_0x3c42('0x79')],_0x2c737f['text'],_0x2c737f[_0x3c42('0x80')]||'en-US',_0x2c737f[_0x3c42('0x81')])['then'](function(_0x2fd445){_0x217baf(null,_0x2fd445);})['catch'](function(_0x19d044){_0x217baf(_0x19d044);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x82')]=function(_0x54a517,_0x28d0e9,_0x262dae){scripts[_0x3c42('0x82')](_0x28d0e9,_0x54a517[_0x3c42('0x79')],_0x54a517[_0x3c42('0x83')]||_0x3c42('0x5c'),this[_0x3c42('0x84')](_0x54a517[_0x3c42('0x85')])?_0x54a517['model']:undefined)[_0x3c42('0x15')](function(_0x3cf767){_0x262dae(null,_0x3cf767);})[_0x3c42('0x17')](function(_0x5b1aec){_0x262dae(_0x5b1aec);});};AGIVertices['prototype'][_0x3c42('0x86')]=function(_0x104610,_0x332e24){scripts[_0x3c42('0x86')](_0x104610[_0x3c42('0x87')],_0x104610[_0x3c42('0x88')],_0x104610[_0x3c42('0x89')],_0x104610[_0x3c42('0x8a')]||_0x3c42('0x8b'),_0x104610[_0x3c42('0x5a')],_0x104610[_0x3c42('0x8c')]||_0x3c42('0x5a'))['then'](function(_0x16548c){_0x332e24(null,_0x16548c);})[_0x3c42('0x17')](function(_0x26c8a6){_0x332e24(_0x26c8a6);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x8d')]=function(_0x55e9f5,_0x35a72d){scripts[_0x3c42('0x8d')](this[_0x3c42('0x10')][_0x3c42('0x37')],_0x55e9f5[_0x3c42('0x87')],_0x55e9f5[_0x3c42('0x88')],_0x55e9f5[_0x3c42('0x8e')],_0x55e9f5[_0x3c42('0x5a')],_0x55e9f5[_0x3c42('0x8f')])[_0x3c42('0x15')](function(_0x328138){_0x35a72d(null,_0x328138);})[_0x3c42('0x17')](function(_0x1cecc3){_0x35a72d(_0x1cecc3);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x90')]=function(_0x5a3fa2,_0x542479,_0x25d0fd){scripts[_0x3c42('0x90')](_0x542479,_0x5a3fa2['key'],_0x5a3fa2[_0x3c42('0x91')]||_0x3c42('0x5c'))['then'](function(_0x3cf61a){_0x25d0fd(null,_0x3cf61a);})[_0x3c42('0x17')](function(_0x4c9146){_0x25d0fd(_0x4c9146);});};AGIVertices[_0x3c42('0x13')][_0x3c42('0x92')]=function(_0x501def,_0x142600,_0x429c36){scripts[_0x3c42('0x92')](_0x142600,_0x501def[_0x3c42('0x93')],_0x501def['appsecret'],_0x501def[_0x3c42('0x6f')])[_0x3c42('0x15')](function(_0x9a861d){_0x429c36(null,_0x9a861d);})[_0x3c42('0x17')](function(_0x192754){_0x429c36(_0x192754);});};AGIVertices[_0x3c42('0x13')]['clear']=function(_0x169e6d){var _0x3cab39=_[_0x3c42('0x65')](verticesWithRetry,_0x169e6d[_0x3c42('0x34')])?_0x169e6d:_[_0x3c42('0x94')](_0x169e6d);for(var _0xbb0277 in _0x3cab39){if(_0x3cab39[_0x3c42('0x95')](_0xbb0277)){if(_0x3cab39[_0xbb0277]&&_[_0x3c42('0x96')](_0x3cab39[_0xbb0277])){if(_[_0x3c42('0x65')](recursiveMapAttributes,_0xbb0277)){_0x3cab39[_0xbb0277]=this['replaceObjectAllVariables'](_0x3cab39[_0xbb0277]);}else{_0x3cab39[_0xbb0277]=this['replaceAllVariables'](_0x3cab39[_0xbb0277]);}}}}return _0x3cab39;};AGIVertices['prototype'][_0x3c42('0x97')]=function(_0x5b319c){for(var _0x3dc8ee in _0x5b319c){if(_0x5b319c[_0x3c42('0x95')](_0x3dc8ee)){if(_[_0x3c42('0x98')](_0x5b319c[_0x3dc8ee])){this[_0x3c42('0x97')](_0x5b319c[_0x3dc8ee]);}else if(_['isArray'](_0x5b319c[_0x3dc8ee])){for(var _0x41b046=0x0;_0x41b046<_0x5b319c[_0x3dc8ee][_0x3c42('0x99')];_0x41b046++){this['recursiveNodeIndex'](_0x5b319c[_0x3dc8ee][_0x41b046]);}}else if(_[_0x3c42('0x96')](_0x5b319c[_0x3dc8ee])){_0x5b319c[_0x3dc8ee]=this[_0x3c42('0x9a')](_0x5b319c[_0x3dc8ee]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x57b9ca,_0x5230df){for(var _0x4410fb in _0x57b9ca){if(_0x57b9ca['hasOwnProperty'](_0x4410fb)){if(_[_0x3c42('0x98')](_0x57b9ca[_0x4410fb])){if(!_[_0x3c42('0x3f')](_0x57b9ca[_0x4410fb])){this['saveRestApiResult'](_0x57b9ca[_0x4410fb],util[_0x3c42('0x9b')]('%s.%s',_0x5230df,_0x4410fb));}}else if(_[_0x3c42('0x9c')](_0x57b9ca[_0x4410fb])){for(var _0x3ff919=0x0;_0x3ff919<_0x57b9ca[_0x4410fb][_0x3c42('0x99')];_0x3ff919++){this[_0x3c42('0x9d')](_0x57b9ca[_0x4410fb][_0x3ff919],util[_0x3c42('0x9b')]('%s.%s',_0x5230df,_0x4410fb+'['+_0x3ff919+']'));}}else{if(!_['isNil'](_0x57b9ca[_0x4410fb])){this[_0x3c42('0x10')]['setVariable'](util['format']('%s.%s',_0x5230df,_0x4410fb),_0x57b9ca[_0x4410fb]);}}}}};AGIVertices[_0x3c42('0x13')][_0x3c42('0x9e')]=function(_0x3c03ff){try{var _0x1cce6c=JSON[_0x3c42('0x6b')](_0x3c03ff);this['recursiveNodeIndex'](_0x1cce6c);return JSON[_0x3c42('0x72')](_0x1cce6c);}catch(_0x125884){return this[_0x3c42('0x9a')](_0x3c03ff);}};AGIVertices['prototype']['replaceAllVariables']=function(_0x12612c){var _0x40ab15=_0x12612c[_0x3c42('0x9f')]('{');for(var _0x8752d0=0x1;_0x8752d0<_0x40ab15['length'];_0x8752d0+=0x1){var _0x18b11d=_0x40ab15[_0x8752d0][_0x3c42('0x9f')]('}');if(_0x18b11d[_0x3c42('0x99')]>0x1){_0x12612c=_0x12612c['replaceAll']('{'+_0x18b11d[0x0]+'}',this[_0x3c42('0x10')][_0x3c42('0x14')](_0x18b11d[0x0])[_0x3c42('0xa0')]||_0x18b11d[0x0]);}}if(_0x40ab15[_0x3c42('0x99')]===0x1){return _0x12612c[_0x3c42('0x48')]();}return this[_0x3c42('0x9a')](_0x12612c);};AGIVertices[_0x3c42('0x13')]['getAndSetVariable']=function(_0x1bd6d4,_0x19eef9){var _0x3d91ed=this['channel']['getVariable'](_0x1bd6d4);if(_0x3d91ed[_0x3c42('0xa1')]===-0x1){return _0x3d91ed;}logger['info'](util[_0x3c42('0x9b')](_0x3c42('0xa2'),_0x19eef9,_0x3d91ed[_0x3c42('0xa0')]));return this[_0x3c42('0x10')][_0x3c42('0xa3')](_0x19eef9,_0x3d91ed[_0x3c42('0xa0')]);};AGIVertices[_0x3c42('0x13')][_0x3c42('0x84')]=function(_0x32ed3e){return _0x32ed3e&&_0x32ed3e!=='0'&&_0x32ed3e!=='-1'&&_0x32ed3e!=='';};AGIVertices['prototype'][_0x3c42('0xa4')]=function(_0x5b0c16){this[_0x3c42('0x33')][_0x3c42('0x6e')](this,_0x5b0c16,'-');_0x5b0c16[_0x3c42('0xa5')]=_0x5b0c16[_0x3c42('0xa4')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x3c42('0xa6')]=function(_0x50b7b5){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0xa7'),_0x50b7b5[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x50b7b5[_0x3c42('0x5a')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xaa'));}var _0x1b0a40='\x22'+_0x50b7b5['text']+'\x22';if(this[_0x3c42('0x84')](_0x50b7b5['options'])){_0x1b0a40+=','+_0x50b7b5[_0x3c42('0x77')];}var _0x257098=this[_0x3c42('0x10')][_0x3c42('0x54')](_0x3c42('0xab'),_0x1b0a40);if(_0x257098[_0x3c42('0xa1')]===-0x1){return _0x257098;}return this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0xac'),_0x1b0a40));};AGIVertices[_0x3c42('0x13')][_0x3c42('0xad')]=function(_0x1de0d6){logger['info'](util[_0x3c42('0x9b')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x1de0d6[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x1de0d6[_0x3c42('0xae')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')]('no\x20grammar\x20configured');}var _0x3fec9b=_0x1de0d6[_0x3c42('0xae')];if(this[_0x3c42('0x84')](_0x1de0d6[_0x3c42('0x77')])){_0x3fec9b+=','+_0x1de0d6['options'];}var _0x376393=this[_0x3c42('0x10')][_0x3c42('0x54')]('MRCPRecog',_0x3fec9b);if(_0x376393[_0x3c42('0xa1')]===-0x1){return _0x376393;}var _0x3af7ab=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x3c42('0xaf'));if(_0x3af7ab[_0x3c42('0xa1')]===-0x1){return _0x3af7ab;}var _0x4ebfb9=this[_0x3c42('0xb0')](_0x3c42('0xb1'),_0x3c42('0xb2'));if(_0x4ebfb9[_0x3c42('0xa1')]===-0x1){return _0x4ebfb9;}var _0x2b7c96=this[_0x3c42('0xb0')](_0x3c42('0xb3'),_0x3c42('0xb4'));if(_0x2b7c96[_0x3c42('0xa1')]===-0x1){return _0x2b7c96;}return this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0xb5'),_0x3fec9b));};AGIVertices[_0x3c42('0x13')][_0x3c42('0xb6')]=function(_0x5ba5d8){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0xb7'),_0x5ba5d8['label']));return this['channel'][_0x3c42('0xb6')]([_0x5ba5d8[_0x3c42('0xb8')],_0x5ba5d8[_0x3c42('0xb9')]]);};AGIVertices['prototype'][_0x3c42('0xba')]=function(_0x200c59){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0xbb'),_0x200c59[_0x3c42('0xa8')]));if(this[_0x3c42('0x84')](_0x200c59[_0x3c42('0x63')])){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0xbc'),_0x200c59['timeout']));var _0x161bcb=this[_0x3c42('0x10')][_0x3c42('0xbd')](_0x200c59[_0x3c42('0x63')]);if(_0x161bcb['result']===-0x1){return _0x161bcb;}}return this[_0x3c42('0x10')][_0x3c42('0xba')]();};AGIVertices[_0x3c42('0x13')][_0x3c42('0x46')]=function(_0x3bb984){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0xbe'),_0x3bb984['label']));if(!this[_0x3c42('0x84')](_0x3bb984['list_id'])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x3bb984,_0x3c42('0xbf'));}_0x3bb984[_0x3c42('0x45')]=moment();if(this[_0x3c42('0x84')](_0x3bb984['delay'])){_0x3bb984[_0x3c42('0x45')]=moment()[_0x3c42('0xc0')](_0x3bb984['delay'],_0x3c42('0xc1'));}if(!this[_0x3c42('0x84')](_0x3bb984[_0x3c42('0x49')])){_0x3bb984[_0x3c42('0x49')]=0x2;}this[_0x3c42('0x3e')]['sync'](this,_0x3bb984);return this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x3bb984[_0x3c42('0x43')],_0x3bb984['list_id'],_0x3bb984[_0x3c42('0x45')]));};AGIVertices['prototype'][_0x3c42('0xc2')]=function(_0x5c89f4){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x5c89f4[_0x3c42('0xa8')]));var _0x5ae10f=this[_0x3c42('0x10')][_0x3c42('0x54')](_0x5c89f4['application'],_0x5c89f4['options']);if(_0x5ae10f[_0x3c42('0xa1')]===-0x1){return _0x5ae10f;}return this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0xc3'),_0x5c89f4[_0x3c42('0xc4')],_0x5c89f4[_0x3c42('0x77')]));};AGIVertices['prototype'][_0x3c42('0xc5')]=function(_0x5d9ec2){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0xc6'),_0x5d9ec2[_0x3c42('0xa8')]));if(!this['isConfigured'](_0x5d9ec2[_0x3c42('0x5a')])){return this['channel'][_0x3c42('0xa9')](_0x3c42('0xaa'));}var _0x50fa1d='\x22'+_0x5d9ec2[_0x3c42('0x5a')]+'\x22';if(this[_0x3c42('0x84')](_0x5d9ec2[_0x3c42('0x77')])){_0x50fa1d+=','+_0x5d9ec2[_0x3c42('0x77')];}var _0x29fb1a=this['channel']['exec'](_0x3c42('0xab'),_0x50fa1d);if(_0x29fb1a[_0x3c42('0xa1')]===-0x1){return _0x29fb1a;}return this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0xac'),_0x50fa1d));};AGIVertices[_0x3c42('0x13')][_0x3c42('0xc7')]=function(_0x551245){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0xc8'),_0x551245[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x551245[_0x3c42('0x5a')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xaa'));}var _0x2d5dae='\x22'+_0x551245[_0x3c42('0x5a')]+'\x22';if(this[_0x3c42('0x84')](_0x551245[_0x3c42('0x77')])){_0x2d5dae+=','+_0x551245[_0x3c42('0x77')];}var _0x371d5e=this[_0x3c42('0x10')][_0x3c42('0x54')](_0x3c42('0xab'),_0x2d5dae);if(_0x371d5e[_0x3c42('0xa1')]===-0x1){return _0x371d5e;}return this[_0x3c42('0x10')][_0x3c42('0xa9')](util['format'](_0x3c42('0xac'),_0x2d5dae));};AGIVertices[_0x3c42('0x13')][_0x3c42('0xc9')]=function(_0x1aff55){logger[_0x3c42('0x29')](util['format'](_0x3c42('0xca'),_0x1aff55['label']));if(!this['isConfigured'](_0x1aff55['grammar'])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xcb'));}var _0x4f01dc=_0x1aff55[_0x3c42('0xae')];if(this[_0x3c42('0x84')](_0x1aff55[_0x3c42('0x77')])){_0x4f01dc+=','+_0x1aff55[_0x3c42('0x77')];}var _0x5dbffe=this[_0x3c42('0x10')]['exec'](_0x3c42('0xcc'),_0x4f01dc);if(_0x5dbffe[_0x3c42('0xa1')]===-0x1){return _0x5dbffe;}var _0x18058d=this['getAndSetVariable']('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0x18058d[_0x3c42('0xa1')]===-0x1){return _0x18058d;}var _0x2c369b=this['getAndSetVariable'](_0x3c42('0xb1'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x2c369b[_0x3c42('0xa1')]===-0x1){return _0x2c369b;}var _0x407c5e=this[_0x3c42('0xb0')](_0x3c42('0xb3'),_0x3c42('0xcd'));if(_0x407c5e[_0x3c42('0xa1')]===-0x1){return _0x407c5e;}return this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0xb5'),_0x4f01dc));};AGIVertices['prototype'][_0x3c42('0xce')]=function(_0x67a964){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0xcf'),_0x67a964['label']));if(!this[_0x3c42('0x84')](_0x67a964[_0x3c42('0xae')])){return this['channel'][_0x3c42('0xa9')](_0x3c42('0xcb'));}var _0x246355=_0x67a964[_0x3c42('0xae')];if(this[_0x3c42('0x84')](_0x67a964[_0x3c42('0x77')])){_0x246355+=','+_0x67a964[_0x3c42('0x77')];}var _0x27995c=this[_0x3c42('0x10')][_0x3c42('0x54')]('MRCPRecog',_0x246355);if(_0x27995c[_0x3c42('0xa1')]===-0x1){return _0x27995c;}var _0x1e0f1c=this[_0x3c42('0xb0')](_0x3c42('0xd0'),'SESTEK_ASR_CONFIDENCE');if(_0x1e0f1c[_0x3c42('0xa1')]===-0x1){return _0x1e0f1c;}var _0x3e144b=this[_0x3c42('0xb0')]('RECOG_INPUT()',_0x3c42('0xd1'));if(_0x3e144b['result']===-0x1){return _0x3e144b;}var _0x2c925f=this[_0x3c42('0xb0')](_0x3c42('0xb3'),_0x3c42('0xd2'));if(_0x2c925f[_0x3c42('0xa1')]===-0x1){return _0x2c925f;}return this[_0x3c42('0x10')][_0x3c42('0xa9')](util['format'](_0x3c42('0xb5'),_0x246355));};AGIVertices[_0x3c42('0x13')][_0x3c42('0xd3')]=function(_0x597af3){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x597af3[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x597af3[_0x3c42('0xd4')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x597af3,_0x3c42('0xd5'));}var _0x5aee15=this[_0x3c42('0x1b')][_0x3c42('0x6e')](this,_0x597af3[_0x3c42('0xd4')]);if(!_0x5aee15){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x597af3,'no\x20odbc\x20database\x20found');}if(!this[_0x3c42('0x84')](_0x597af3[_0x3c42('0x2b')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x597af3,'no\x20query\x20configured');}var _0x4bddaf=_0x597af3[_0x3c42('0x2b')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0xd6'),_0x4bddaf));var _0x2b0be9=this[_0x3c42('0xd7')][_0x3c42('0x6e')](this,_0x5aee15,_0x4bddaf);this['createSquareDetailsReport'][_0x3c42('0x6e')](this,_0x597af3,_0x4bddaf);if(!this[_0x3c42('0x84')](_0x597af3[_0x3c42('0xd8')])){return this['channel'][_0x3c42('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x561a48=this[_0x3c42('0x14')][_0x3c42('0x6e')](this,_0x597af3[_0x3c42('0xd8')]);if(!_0x561a48){return this[_0x3c42('0x10')]['error'](_0x597af3,'no\x20variable\x20found');}var _0x294483=this;_0x2b0be9[_0x3c42('0xd9')](function(_0x120457,_0x1e22d8){Object[_0x3c42('0xda')](_0x120457)[_0x3c42('0xd9')](function(_0x4d88f7){_0x294483[_0x3c42('0x10')][_0x3c42('0xa3')](util[_0x3c42('0x9b')](_0x3c42('0xdb'),_0x561a48,_0x1e22d8,_0x4d88f7),_0x120457[_0x4d88f7]);});});this[_0x3c42('0x10')][_0x3c42('0xa3')](util[_0x3c42('0x9b')](_0x3c42('0xdc'),_0x561a48),_0x2b0be9[_0x3c42('0x99')]);return this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0xdd'),_0x561a48));};AGIVertices[_0x3c42('0x13')]['dial']=function(_0x52a837){logger[_0x3c42('0xde')](util['format'](_0x3c42('0xdf'),_0x52a837[_0x3c42('0xa8')]));if(!this['isConfigured'](_0x52a837[_0x3c42('0xe0')])){return this['channel'][_0x3c42('0x2e')](_0x52a837,'no\x20user\x20selected');}var _0x2fa400=this[_0x3c42('0xe1')]['sync'](this,_0x52a837[_0x3c42('0xe0')]);if(!_0x2fa400){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x52a837,_0x3c42('0xe2'));}var _0x42373d=this[_0x3c42('0x10')][_0x3c42('0x54')](_0x3c42('0xe3'),[util[_0x3c42('0x9b')](_0x3c42('0xe4'),_0x2fa400),_0x52a837[_0x3c42('0x63')],_0x52a837['opts'],_0x52a837[_0x3c42('0x62')]]);if(_0x42373d[_0x3c42('0xa1')]===-0x1){return _0x42373d;}return this['channel'][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0xe5'),_0x3c42('0xe3')));};AGIVertices[_0x3c42('0x13')]['dialogflow']=function(_0x8ebceb){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x8ebceb[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x8ebceb['key'])){return this['channel'][_0x3c42('0xa9')](_0x3c42('0xe6'));}if(!this[_0x3c42('0x84')](_0x8ebceb[_0x3c42('0x5a')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xaa'));}this[_0x3c42('0x10')]['bot']=!![];this['createSquareDetailsReport'](_0x8ebceb);this[_0x3c42('0x3d')](_0x8ebceb['text'],'in','','');this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0xe7'),_0x8ebceb[_0x3c42('0x5a')]));var _0x1b14a1=this[_0x3c42('0x78')][_0x3c42('0x6e')](this,_0x8ebceb);if(_0x1b14a1){for(var _0x953296 in _0x1b14a1){if(_0x1b14a1['hasOwnProperty'](_0x953296)){this['channel']['setVariable'](util[_0x3c42('0x9b')](_0x3c42('0xe8'),_0x953296[_0x3c42('0x69')]()),_0x1b14a1[_0x953296]);}}this[_0x3c42('0x3d')](_0x1b14a1['speech'],'out',_0x3c42('0xe9'),'');return this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')]('Dialogflow\x20Result\x20%s',_0x1b14a1[_0x3c42('0xea')]));}return this['channel'][_0x3c42('0x2e')](_0x8ebceb,_0x3c42('0xeb'));};AGIVertices['prototype'][_0x3c42('0xec')]=function(_0x70691f){logger[_0x3c42('0x29')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x70691f['label']));if(!this[_0x3c42('0x84')](_0x70691f[_0x3c42('0x7b')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xed'));}if(!this['isConfigured'](_0x70691f[_0x3c42('0x7c')])){return this['channel'][_0x3c42('0xa9')](_0x3c42('0xee'));}if(!this[_0x3c42('0x84')](_0x70691f[_0x3c42('0x7d')])){return this['channel'][_0x3c42('0xa9')]('no\x20private_key\x20configured');}if(!this[_0x3c42('0x84')](_0x70691f['dialogflowV2_language'])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xef'));}if(!this[_0x3c42('0x84')](_0x70691f[_0x3c42('0x5a')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xaa'));}this[_0x3c42('0x10')][_0x3c42('0xf0')]=!![];this[_0x3c42('0x33')](_0x70691f);this[_0x3c42('0x3d')](_0x70691f[_0x3c42('0x5a')],'in','','');this[_0x3c42('0x10')][_0x3c42('0xa9')](util['format'](_0x3c42('0xf1'),_0x70691f['text']));var _0x5a0055=this[_0x3c42('0x7a')][_0x3c42('0x6e')](this,_0x70691f);if(_0x5a0055){for(var _0x2501ca in _0x5a0055){if(_0x5a0055[_0x3c42('0x95')](_0x2501ca)){if(_0x2501ca!==_0x3c42('0xf2')){this['channel'][_0x3c42('0xa3')](util['format']('DIALOGFLOW_%s',_0x2501ca[_0x3c42('0x69')]()),_0x5a0055[_0x2501ca]);}}}this[_0x3c42('0x3d')](_0x5a0055[_0x3c42('0xea')],_0x3c42('0xf3'),_0x3c42('0xec'),_0x5a0055[_0x3c42('0xf2')]);return this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0xf4'),_0x5a0055[_0x3c42('0xea')]));}return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x70691f,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x3c42('0x13')][_0x3c42('0xf5')]=function(_0x3d1181){logger['info'](util['format'](_0x3c42('0xf6'),_0x3d1181['label']));if(!this[_0x3c42('0x84')](_0x3d1181['ndauth_url'])){return this[_0x3c42('0x10')]['noop'](_0x3c42('0xf7'));}if(!this[_0x3c42('0x84')](_0x3d1181[_0x3c42('0xf8')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xf9'));}if(!this[_0x3c42('0x84')](_0x3d1181[_0x3c42('0xfa')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xfb'));}if(!this['isConfigured'](_0x3d1181['ndassistant_url'])){return this['channel'][_0x3c42('0xa9')](_0x3c42('0xaa'));}this[_0x3c42('0x10')][_0x3c42('0xf0')]=!![];this[_0x3c42('0x33')](_0x3d1181);this['createSquareMessage'](_0x3d1181[_0x3c42('0x5a')],'in','','');this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0xfc'),_0x3d1181['text']));var _0x12c5f5=this[_0x3c42('0x7f')][_0x3c42('0x6e')](this,_0x3d1181);if(_0x12c5f5){for(var _0x2aa741 in _0x12c5f5){if(_0x12c5f5[_0x3c42('0x95')](_0x2aa741)){this[_0x3c42('0x10')]['setVariable'](util[_0x3c42('0x9b')](_0x3c42('0xfd'),_0x2aa741[_0x3c42('0x69')]()),_0x12c5f5[_0x2aa741]);}}this[_0x3c42('0x3d')](_0x12c5f5[_0x3c42('0xea')],_0x3c42('0xf3'),_0x3c42('0xf5'),'');if(_0x12c5f5[_0x3c42('0xfe')]){this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0xff'),_0x12c5f5[_0x3c42('0xfe')]));var _0x1a7ca4=this[_0x3c42('0x10')][_0x3c42('0x100')](_0x12c5f5[_0x3c42('0xfe')]);try{fs[_0x3c42('0x101')](_0x12c5f5[_0x3c42('0xfe')]+_0x3c42('0x102'));}catch(_0x55a886){logger[_0x3c42('0x2e')](_0x55a886);}return _0x1a7ca4;}else{return this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0x103'),_0x12c5f5[_0x3c42('0xea')]));}}return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x3d1181,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x3c42('0x13')][_0x3c42('0x104')]=function(_0x54aa35){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0x105'),_0x54aa35[_0x3c42('0xa8')]));return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0x104'));};AGIVertices[_0x3c42('0x13')]['ext_dial']=function(_0xb43196){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x106'),_0xb43196[_0x3c42('0xa8')]));var _0x33d9e1='';if(_0xb43196['trunk_id']){if(!this[_0x3c42('0x84')](_0xb43196[_0x3c42('0x107')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0xb43196,_0x3c42('0x108'));}else{var _0x5b7709=parseInt(_0xb43196[_0x3c42('0x107')],0xa);if(isNaN(_0x5b7709)){_0x33d9e1=_0xb43196[_0x3c42('0x107')];}else{_0x33d9e1=this[_0x3c42('0x1e')][_0x3c42('0x6e')](this,_0xb43196[_0x3c42('0x107')]);if(!_0x33d9e1){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0xb43196,_0x3c42('0x109'));}}}}else if(_0xb43196[_0x3c42('0x10a')]){_0x33d9e1=_0xb43196[_0x3c42('0x10a')];}else{return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0xb43196,_0x3c42('0x108'));}var _0x32f0af=this[_0x3c42('0x10')][_0x3c42('0x54')](_0x3c42('0xe3'),[util[_0x3c42('0x9b')](_0x3c42('0x10b'),_0x33d9e1,_0xb43196[_0x3c42('0x43')]),_0xb43196[_0x3c42('0x63')],_0xb43196[_0x3c42('0x10c')],_0xb43196[_0x3c42('0x62')]]);if(_0x32f0af[_0x3c42('0xa1')]===-0x1){return _0x32f0af;}return this['channel']['noop'](util[_0x3c42('0x9b')]('Executed\x20command\x20%s',_0x3c42('0xe3')));};AGIVertices['prototype']['finally']=function(_0x4f1d48){logger[_0x3c42('0x29')](util['format'](_0x3c42('0x10d'),_0x4f1d48['label']));return this['channel'][_0x3c42('0xa9')](_0x3c42('0x10e'));};AGIVertices[_0x3c42('0x13')][_0x3c42('0xf')]=function(_0x56ce51){logger[_0x3c42('0x29')](util['format'](_0x3c42('0x10f'),_0x56ce51[_0x3c42('0xa8')]));if(_0x56ce51['retry']===0x0){return this[_0x3c42('0xa4')](_0x56ce51);}_0x56ce51['retry']-=0x1;if(!this['isConfigured'](_0x56ce51[_0x3c42('0x110')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x56ce51,_0x3c42('0x111'));}var _0x4dccc4=this['getSound'][_0x3c42('0x6e')](this,_0x56ce51['file_id']);if(!_0x4dccc4){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x56ce51,_0x3c42('0x112'));}if(!this[_0x3c42('0x84')](_0x56ce51[_0x3c42('0xd8')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x3c42('0x113'));}var _0x9e0ef3=this[_0x3c42('0x10')][_0x3c42('0x114')](_0x4dccc4,_0x56ce51[_0x3c42('0x115')],_0x56ce51[_0x3c42('0x116')]);var _0xc20566=_0x9e0ef3['result']?_0x9e0ef3[_0x3c42('0xa1')][_0x3c42('0x48')]():'';logger['info']('test',JSON[_0x3c42('0x72')](_0x9e0ef3));if(_0x9e0ef3[_0x3c42('0xa1')]===-0x1){this['createSquareDetailsReport'][_0x3c42('0x6e')](this,_0x56ce51,_0xc20566);return _0x9e0ef3;}else if(_0x9e0ef3['extra']===_0x3c42('0x63')){_0x9e0ef3[_0x3c42('0xa1')]=_0xc20566[_0x3c42('0x99')]>=parseInt(_0x56ce51[_0x3c42('0x117')])?'x':'i';}else{_0x9e0ef3['result']=_0xc20566[_0x3c42('0x99')]>=parseInt(_0x56ce51['mindigit'])&&_0xc20566[_0x3c42('0x99')]<=parseInt(_0x56ce51[_0x3c42('0x116')])?'x':'i';}var _0x1a2212=this[_0x3c42('0x14')]['sync'](this,_0x56ce51[_0x3c42('0xd8')]);if(!_0x1a2212){return this['channel'][_0x3c42('0x2e')](_0x56ce51,_0x3c42('0x118'));}this[_0x3c42('0x10')][_0x3c42('0xa3')](_0x1a2212,_0xc20566);if(this[_0x3c42('0x84')](_0x56ce51[_0x3c42('0x119')])){var _0x3f2901=parseInt(_0x56ce51[_0x3c42('0x119')],0xa);var _0x7a64b0=rs[_0x3c42('0x11a')]({'charset':'*','length':_0x3f2901});var _0x173a18=_0xc20566[_0x3c42('0x99')];if(_0x173a18>0x0){if(_0x173a18>_0x3f2901){this[_0x3c42('0x33')][_0x3c42('0x6e')](this,_0x56ce51,_0x56ce51[_0x3c42('0x11b')]==='first'?_0x7a64b0+_0xc20566[_0x3c42('0x11c')](_0x3f2901):_0xc20566[_0x3c42('0x11c')](0x0,_0x173a18-_0x3f2901)+_0x7a64b0);}else{this[_0x3c42('0x33')][_0x3c42('0x6e')](this,_0x56ce51,rs[_0x3c42('0x11a')]({'charset':'*','length':_0x173a18}));}}else{this['createSquareDetailsReport'][_0x3c42('0x6e')](this,_0x56ce51,'');}}else{this[_0x3c42('0x33')][_0x3c42('0x6e')](this,_0x56ce51,_0xc20566);}return _0x9e0ef3;};AGIVertices[_0x3c42('0x13')]['getsecretdigits']=function(_0x51e790){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x51e790[_0x3c42('0xa8')]));return this[_0x3c42('0xf')](_0x51e790);};AGIVertices[_0x3c42('0x13')]['goal']=function(_0x17e193){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x11d'),_0x17e193['label']));this[_0x3c42('0x33')]['sync'](this,_0x17e193,_0x17e193[_0x3c42('0x11e')]);return this['channel']['noop'](util[_0x3c42('0x9b')](_0x3c42('0x11f'),_0x17e193[_0x3c42('0x11e')]));};AGIVertices['prototype'][_0x3c42('0x120')]=function(_0x5185a2){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x5185a2[_0x3c42('0xa8')]));if(!this['isConfigured'](_0x5185a2[_0x3c42('0x87')])||!this[_0x3c42('0x84')](_0x5185a2[_0x3c42('0x88')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0x121'));}if(!this[_0x3c42('0x84')](_0x5185a2['text'])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xaa'));}this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')]('Trying\x20aws\x20Polly\x20%s',_0x5185a2[_0x3c42('0x5a')]));var _0x33e6c2=this[_0x3c42('0x86')][_0x3c42('0x6e')](this,_0x5185a2);if(_0x33e6c2){this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0x122'),_0x33e6c2));var _0x1c6ee1=this[_0x3c42('0x10')][_0x3c42('0x100')](_0x33e6c2);try{fs[_0x3c42('0x101')](_0x33e6c2+'.wav');}catch(_0x265461){logger[_0x3c42('0x2e')](_0x265461);}return _0x1c6ee1;}return this[_0x3c42('0x10')]['error'](_0x5185a2,_0x3c42('0x123'));};AGIVertices[_0x3c42('0x13')]['awslex']=function(_0x195054){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0x124'),_0x195054[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x195054[_0x3c42('0x87')])||!this[_0x3c42('0x84')](_0x195054['aws_secret_access_key'])){return this[_0x3c42('0x10')]['noop'](_0x3c42('0x121'));}if(!this[_0x3c42('0x84')](_0x195054[_0x3c42('0x8f')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')]('no\x20bot\x20name\x20configured');}if(!this[_0x3c42('0x84')](_0x195054['text'])){return this[_0x3c42('0x10')]['noop'](_0x3c42('0xaa'));}this[_0x3c42('0x10')][_0x3c42('0xf0')]=!![];this[_0x3c42('0x33')](_0x195054);this[_0x3c42('0x3d')](_0x195054[_0x3c42('0x5a')],'in','','');this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')]('Trying\x20Amazon\x20Lex:\x20%s',_0x195054[_0x3c42('0x5a')]));var _0x2d3726=this[_0x3c42('0x8d')][_0x3c42('0x6e')](this,_0x195054);if(_0x2d3726){for(var _0x43e580 in _0x2d3726){if(_0x2d3726[_0x3c42('0x95')](_0x43e580)&&_[_0x3c42('0x96')](_0x2d3726[_0x43e580])){this['channel'][_0x3c42('0xa3')](util[_0x3c42('0x9b')](_0x3c42('0x125'),_0x43e580[_0x3c42('0x69')]()),_0x2d3726[_0x43e580]);}}if(_['isNil'](_0x2d3726[_0x3c42('0x75')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0x126'));}else{this[_0x3c42('0x3d')](_0x2d3726[_0x3c42('0x75')],_0x3c42('0xf3'),_0x3c42('0x127'),'');return this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0x128'),_0x2d3726[_0x3c42('0x75')]));}}return this['channel'][_0x3c42('0x2e')](_0x195054,_0x3c42('0x129'));};AGIVertices[_0x3c42('0x13')][_0x3c42('0x12a')]=function(_0x554418){logger[_0x3c42('0x29')](util['format'](_0x3c42('0x12b'),_0x554418['label'],_0x554418['timeout']));if(!this[_0x3c42('0x84')](_0x554418[_0x3c42('0x79')])){return this[_0x3c42('0x10')]['noop'](_0x3c42('0xe6'));}var _0x134831=_0x3c42('0x12c');var _0x44a6be=util[_0x3c42('0x9b')](_0x3c42('0x12d'),FILES_PATH,rs['generate'](0x4));var _0x581ae4=util['format'](_0x3c42('0x12e'),_0x44a6be,_0x134831);var _0x3b05ee=!![];if(_0x554418[_0x3c42('0x12f')]===_0x3c42('0x130')){_0x3b05ee=![];}var _0x3c8cac=this[_0x3c42('0x10')][_0x3c42('0x131')](_0x44a6be,_0x134831,_0x554418[_0x3c42('0x132')],_0x554418[_0x3c42('0x63')],undefined,_0x3b05ee);if(_0x3c8cac[_0x3c42('0xa1')]!==-0x1){this['channel'][_0x3c42('0xa9')](util['format']('google\x20%s\x20file\x20created',_0x581ae4));var _0xf55a7d=this[_0x3c42('0x90')]['sync'](this,_0x554418,_0x581ae4);if(_0xf55a7d){for(var _0x15f303 in _0xf55a7d){if(_0xf55a7d['hasOwnProperty'](_0x15f303)){this[_0x3c42('0x10')][_0x3c42('0xa3')](util[_0x3c42('0x9b')](_0x3c42('0x133'),_0x15f303['toUpperCase']()),_0xf55a7d[_0x15f303]);}}return this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0x134'),JSON[_0x3c42('0x72')](_0xf55a7d)));}}return _0x3c8cac;};AGIVertices[_0x3c42('0x13')][_0x3c42('0x135')]=function(_0x455a70){logger[_0x3c42('0x29')](util['format'](_0x3c42('0x136'),_0x455a70[_0x3c42('0xa8')]));if(!this['isConfigured'](_0x455a70[_0x3c42('0x93')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')]('no\x20appid\x20configured');}if(!this[_0x3c42('0x84')](_0x455a70[_0x3c42('0x137')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0x138'));}var _0x388f07=_0x3c42('0x12c');var _0x3f4f96=util[_0x3c42('0x9b')](_0x3c42('0x12d'),FILES_PATH,rs[_0x3c42('0x11a')](0x4));var _0x5ef6bd=util['format'](_0x3c42('0x12e'),_0x3f4f96,_0x388f07);var _0x235962=!![];if(_0x455a70[_0x3c42('0x12f')]==='NOBEEP'){_0x235962=![];}var _0x185c19=this[_0x3c42('0x10')][_0x3c42('0x131')](_0x3f4f96,_0x388f07,_0x455a70[_0x3c42('0x132')],_0x455a70[_0x3c42('0x63')],undefined,_0x235962);if(_0x185c19[_0x3c42('0xa1')]!==-0x1){this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0x139'),_0x5ef6bd));var _0x459011=this['tildeASR'][_0x3c42('0x6e')](this,_0x455a70,_0x5ef6bd);if(_0x459011){for(var _0x2687c3 in _0x459011){if(_0x459011[_0x3c42('0x95')](_0x2687c3)){this['channel'][_0x3c42('0xa3')](util[_0x3c42('0x9b')](_0x3c42('0x13a'),_0x2687c3['toUpperCase']()),_0x459011[_0x2687c3]);}}return this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')]('TildeASR\x20Result\x20%s',JSON[_0x3c42('0x72')](_0x459011)));}}return _0x185c19;};AGIVertices['prototype'][_0x3c42('0x13b')]=function(_0x4f1747){logger['info'](util['format'](_0x3c42('0x13c'),_0x4f1747['label']));return this['channel'][_0x3c42('0x13d')](_0x4f1747['context'],_0x4f1747['extension'],_0x4f1747[_0x3c42('0x3b')]);};AGIVertices[_0x3c42('0x13')]['gotoif']=function(_0x10a4a6){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x13e'),_0x10a4a6['label']));if(!this[_0x3c42('0x84')](_0x10a4a6[_0x3c42('0x13f')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x10a4a6,_0x3c42('0x140'));}try{var _0x5511c8=eval(_0x10a4a6[_0x3c42('0x13f')])?_0x3c42('0x141'):_0x3c42('0x142');this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0x143'),_0x10a4a6[_0x3c42('0x13f')],_0x5511c8));return{'code':0xc8,'result':_0x5511c8};}catch(_0x1b7031){return{'code':0xc8,'result':_0x3c42('0x142')};}};AGIVertices['prototype'][_0x3c42('0x144')]=function(_0x523b8c){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x145'),_0x523b8c['label']));if(!this['isConfigured'](_0x523b8c[_0x3c42('0x146')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x523b8c,'no\x20interval\x20configured');}var _0x20594b=this[_0x3c42('0x24')][_0x3c42('0x6e')](this,_0x523b8c['interval_id']);if(!_0x20594b){return this[_0x3c42('0x10')]['error'](_0x523b8c,_0x3c42('0x147'));}for(var _0x5d9103=0x0;_0x5d9103<_0x20594b['length'];_0x5d9103+=0x1){var _0x3fcc09=this[_0x3c42('0x10')][_0x3c42('0x14')](util[_0x3c42('0x9b')](_0x3c42('0x148'),_0x20594b[_0x5d9103]));if(_0x3fcc09[_0x3c42('0xa1')]===-0x1){return _0x3fcc09;}logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x149'),_0x20594b[_0x5d9103],_0x3fcc09[_0x3c42('0xa0')]));if(_0x3fcc09[_0x3c42('0xa0')]===_0x3c42('0x141')){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0x149'),_0x20594b[_0x5d9103],_0x3c42('0x141')));this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0x149'),_0x20594b[_0x5d9103],_0x3c42('0x141')));return{'code':0xc8,'result':_0x3c42('0x141')};}else{logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x149'),_0x20594b[_0x5d9103],_0x3c42('0x142')));this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0x149'),_0x20594b[_0x5d9103],_0x3c42('0x142')));}}return{'code':0xc8,'result':_0x3c42('0x142')};};AGIVertices[_0x3c42('0x13')][_0x3c42('0x14a')]=function(_0x149ace){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x149ace[_0x3c42('0xa8')]));return this[_0x3c42('0x10')][_0x3c42('0x14a')]();};AGIVertices[_0x3c42('0x13')][_0x3c42('0x14b')]=function(_0x4b80a2){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0x14c'),_0x4b80a2[_0x3c42('0xa8')]));if(!this['isConfigured'](_0x4b80a2[_0x3c42('0x79')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')]('no\x20key\x20configured');}var _0x4a6c84='wav';var _0x2007a6=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x3c42('0x11a')](0x4));var _0x38a3fa=util['format'](_0x3c42('0x12e'),_0x2007a6,_0x4a6c84);var _0x5240bd=!![];if(_0x4b80a2[_0x3c42('0x12f')]===_0x3c42('0x130')){_0x5240bd=![];}var _0x23d9c9=this['channel'][_0x3c42('0x131')](_0x2007a6,_0x4a6c84,_0x4b80a2['intKey'],_0x4b80a2['timeout'],undefined,_0x5240bd);if(_0x23d9c9[_0x3c42('0xa1')]!==-0x1){this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')]('ispeech\x20%s\x20file\x20created',_0x38a3fa));var _0x2112b5=this[_0x3c42('0x82')][_0x3c42('0x6e')](this,_0x4b80a2,_0x38a3fa);if(_0x2112b5){for(var _0x16be98 in _0x2112b5){if(_0x2112b5[_0x3c42('0x95')](_0x16be98)){this[_0x3c42('0x10')][_0x3c42('0xa3')](util['format']('ISPEECH_ASR_%s',_0x16be98[_0x3c42('0x69')]()),_0x2112b5[_0x16be98]);}}return this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0x14d'),JSON['stringify'](_0x2112b5)));}}return _0x23d9c9;};AGIVertices['prototype']['ispeechtts']=function(_0x8f1a47){logger[_0x3c42('0x29')](util['format'](_0x3c42('0x14e'),_0x8f1a47['label']));if(!this[_0x3c42('0x84')](_0x8f1a47[_0x3c42('0x79')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xe6'));}if(!this[_0x3c42('0x84')](_0x8f1a47[_0x3c42('0x5a')])){return this[_0x3c42('0x10')]['noop']('no\x20text\x20configured');}this['channel']['noop'](util[_0x3c42('0x9b')](_0x3c42('0x14f'),_0x8f1a47[_0x3c42('0x5a')]));var _0x444ba8=this['ispeechTTS'][_0x3c42('0x6e')](this,_0x8f1a47);if(_0x444ba8){this[_0x3c42('0x10')][_0x3c42('0xa9')](util['format']('ispeech\x20%s\x20file\x20created',_0x444ba8));var _0x1f09dc=this[_0x3c42('0x10')]['streamFile'](_0x444ba8,_0x8f1a47[_0x3c42('0x132')]);try{fs[_0x3c42('0x101')](_0x444ba8+_0x3c42('0x102'));}catch(_0x1b0ecb){logger['error'](_0x1b0ecb);}return _0x1f09dc;}return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x8f1a47,_0x3c42('0x150'));};AGIVertices['prototype']['login']=function(_0x43c276){logger[_0x3c42('0x29')](util['format'](_0x3c42('0x151'),_0x43c276[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x43c276[_0x3c42('0x152')])){return this[_0x3c42('0x10')]['error'](_0x43c276,_0x3c42('0x153'));}logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x154'),this[_0x3c42('0x10')][_0x3c42('0x38')],_0x43c276[_0x3c42('0x152')]));var _0x2f5cd5=this['agentLogin'][_0x3c42('0x6e')](this,_0x43c276[_0x3c42('0x152')]);if(_0x2f5cd5){logger['info'](util[_0x3c42('0x9b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x3c42('0x10')][_0x3c42('0x38')],_0x43c276['findBy']));this[_0x3c42('0x10')][_0x3c42('0xa9')](util['format'](_0x3c42('0x155'),this['channel'][_0x3c42('0x38')],_0x43c276[_0x3c42('0x152')]));return{'code':0xc8,'result':_0x3c42('0x156')};}else{logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x157'),this['channel'][_0x3c42('0x38')],_0x43c276[_0x3c42('0x152')]));this['channel']['noop'](util[_0x3c42('0x9b')](_0x3c42('0x157'),this['channel']['callerid'],_0x43c276[_0x3c42('0x152')]));return{'code':0xc8,'result':_0x3c42('0x158')};}};AGIVertices[_0x3c42('0x13')][_0x3c42('0x159')]=function(_0x2465ac){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0x15a'),_0x2465ac[_0x3c42('0xa8')]));if(!this['isConfigured'](_0x2465ac[_0x3c42('0x152')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x2465ac,_0x3c42('0x153'));}logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x3c42('0x10')][_0x3c42('0x38')],_0x2465ac[_0x3c42('0x152')]));var _0x185c14=this[_0x3c42('0x4f')]['sync'](this,_0x2465ac[_0x3c42('0x152')]);if(_0x185c14){logger[_0x3c42('0x29')](util['format'](_0x3c42('0x155'),this[_0x3c42('0x10')]['callerid'],_0x2465ac[_0x3c42('0x152')]));this['channel']['noop'](util['format'](_0x3c42('0x155'),this[_0x3c42('0x10')]['callerid'],_0x2465ac[_0x3c42('0x152')]));return{'code':0xc8,'result':_0x3c42('0x156')};}else{logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x157'),this[_0x3c42('0x10')]['callerid'],_0x2465ac[_0x3c42('0x152')]));this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0x157'),this[_0x3c42('0x10')]['callerid'],_0x2465ac[_0x3c42('0x152')]));return{'code':0xc8,'result':_0x3c42('0x158')};}};AGIVertices[_0x3c42('0x13')]['math']=function(_0x484da0){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x15b'),_0x484da0[_0x3c42('0xa8')]));if(!this['isConfigured'](_0x484da0[_0x3c42('0x15c')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x484da0,_0x3c42('0x15d'));}this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0x15e'),_0x484da0[_0x3c42('0x15c')]));var _0x43fe74=eval(_0x484da0[_0x3c42('0x15c')]);if(!this['isConfigured'](_0x484da0[_0x3c42('0xd8')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0x113'));}var _0x5aee19=this[_0x3c42('0x14')][_0x3c42('0x6e')](this,_0x484da0[_0x3c42('0xd8')]);if(!_0x5aee19){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x484da0,_0x3c42('0x118'));}if(_[_0x3c42('0x9c')](_0x43fe74)){var _0x201e3d=this;_0x43fe74['forEach'](function(_0x27eb7e,_0x31d853){_0x201e3d[_0x3c42('0x10')][_0x3c42('0xa3')](util[_0x3c42('0x9b')](_0x3c42('0x15f'),_0x5aee19,_0x31d853),_0x27eb7e);});return this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')]('variable\x20%s[key]\x20set',_0x5aee19));}else{return this['channel']['setVariable'](_0x5aee19,_0x43fe74);}};AGIVertices['prototype'][_0x3c42('0xe')]=function(_0x3b51e6){logger[_0x3c42('0x29')](util['format'](_0x3c42('0x160'),_0x3b51e6[_0x3c42('0xa8')]));if(_0x3b51e6['retry']===0x0){return this['maxRetry'](_0x3b51e6);}_0x3b51e6[_0x3c42('0xa5')]-=0x1;if(!this[_0x3c42('0x84')](_0x3b51e6[_0x3c42('0x110')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x3b51e6,_0x3c42('0x111'));}var _0x3066bd=this[_0x3c42('0x1f')][_0x3c42('0x6e')](this,_0x3b51e6['file_id']);if(!_0x3066bd){return this[_0x3c42('0x10')]['error'](_0x3b51e6,'no\x20file\x20audio\x20found');}var _0x15ad93=this[_0x3c42('0x10')]['getData'](_0x3066bd,_0x3b51e6['response'],_0x3b51e6[_0x3c42('0x161')]);var _0x1e9e7e=_0x15ad93[_0x3c42('0xa1')];if(_0x15ad93[_0x3c42('0xa1')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x3b51e6,'-1');return _0x15ad93;}else if(_0x15ad93[_0x3c42('0xa0')]===_0x3c42('0x63')){_0x15ad93[_0x3c42('0xa1')]=_0x15ad93[_0x3c42('0xa1')]['length']>0x0?_0x15ad93[_0x3c42('0xa1')]:'t';}else if(_[_0x3c42('0x3f')](_0x15ad93[_0x3c42('0xa1')])){_0x15ad93[_0x3c42('0xa1')]='#';_0x1e9e7e='#';}if(!this[_0x3c42('0x84')](_0x3b51e6[_0x3c42('0xd8')])){this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0x113'));}else{var _0x1bc63f=this[_0x3c42('0x14')][_0x3c42('0x6e')](this,_0x3b51e6[_0x3c42('0xd8')]);if(!_0x1bc63f){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x3b51e6,_0x3c42('0x118'));}this['channel']['setVariable'](_0x1bc63f,_0x1e9e7e);}this['createSquareDetailsReport'][_0x3c42('0x6e')](this,_0x3b51e6,_0x1e9e7e);return _0x15ad93;};AGIVertices[_0x3c42('0x13')][_0x3c42('0xa9')]=function(_0x331315){logger[_0x3c42('0x29')](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x331315[_0x3c42('0xa8')]));return this[_0x3c42('0x10')]['noop'](_0x331315[_0x3c42('0x162')]||_0x331315[_0x3c42('0xa8')]);};AGIVertices[_0x3c42('0x13')][_0x3c42('0x163')]=function(_0x25ae20){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x25ae20['label']));if(!this['isConfigured'](_0x25ae20[_0x3c42('0x152')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x25ae20,_0x3c42('0x153'));}logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x3c42('0x10')]['callerid'],_0x25ae20[_0x3c42('0x152')]));var _0x21a524=this[_0x3c42('0x4a')][_0x3c42('0x6e')](this,_0x25ae20['pause_id']);var _0xa8ffe9=this[_0x3c42('0x4d')][_0x3c42('0x6e')](this,_0x25ae20[_0x3c42('0x152')],_0x21a524);if(_0xa8ffe9){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0x155'),this[_0x3c42('0x10')]['callerid'],_0x25ae20['findBy']));this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0x155'),this['channel']['callerid'],_0x25ae20[_0x3c42('0x152')]));return{'code':0xc8,'result':_0x3c42('0x156')};}else{logger['info'](util[_0x3c42('0x9b')](_0x3c42('0x157'),this[_0x3c42('0x10')][_0x3c42('0x38')],_0x25ae20[_0x3c42('0x152')]));this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x3c42('0x10')]['callerid'],_0x25ae20['findBy']));return{'code':0xc8,'result':_0x3c42('0x158')};}};AGIVertices['prototype']['playback']=function(_0x282dbe){logger[_0x3c42('0x29')](util['format'](_0x3c42('0x164'),_0x282dbe[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x282dbe[_0x3c42('0x110')])){return this[_0x3c42('0x10')]['error'](_0x282dbe,'no\x20file\x20audio\x20selected');}var _0x1ad3a9=this[_0x3c42('0x1f')]['sync'](this,_0x282dbe[_0x3c42('0x110')]);if(!_0x1ad3a9){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x282dbe,'no\x20file\x20audio\x20found');}var _0x1e4ea1=this[_0x3c42('0x10')]['exec']('PLAYBACK',[_0x1ad3a9,_0x282dbe[_0x3c42('0x10c')]]);if(_0x1e4ea1[_0x3c42('0xa1')]===-0x1){return _0x1e4ea1;}return this['channel']['noop'](util[_0x3c42('0x9b')](_0x3c42('0xc3'),_0x3c42('0x165'),_0x1ad3a9));};AGIVertices[_0x3c42('0x13')][_0x3c42('0x166')]=function(_0x4a6d20){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x167'),_0x4a6d20[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x4a6d20[_0x3c42('0x168')])){return this[_0x3c42('0x10')]['error'](_0x4a6d20,_0x3c42('0x169'));}var _0x387e42='';var _0x4b19dc=parseInt(_0x4a6d20[_0x3c42('0x168')],0xa);if(isNaN(_0x4b19dc)){_0x387e42=_0x4a6d20[_0x3c42('0x168')];}else{_0x387e42=this[_0x3c42('0x18')][_0x3c42('0x6e')](this,_0x4a6d20[_0x3c42('0x168')]);if(!_0x387e42){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x4a6d20,_0x3c42('0x16a'));}}var _0x845535='';if(this['isConfigured'](_0x4a6d20[_0x3c42('0x110')])){var _0x402df5=this['getSound'][_0x3c42('0x6e')](this,_0x4a6d20[_0x3c42('0x110')]);if(_0x402df5){_0x845535=_0x402df5;}}this[_0x3c42('0x33')][_0x3c42('0x6e')](this,_0x4a6d20,_0x387e42);if(_0x4a6d20[_0x3c42('0x10c')][_0x3c42('0x16b')]('x')<0x0){_0x4a6d20['opts']+='x';}if(_0x4a6d20[_0x3c42('0x10c')][_0x3c42('0x16b')]('X')<0x0){_0x4a6d20['opts']+='X';}this['channel'][_0x3c42('0xa3')](_0x3c42('0x16c'),_0x387e42?_0x387e42['toLowerCase']():'');var _0x522a92=this['channel'][_0x3c42('0x54')](_0x3c42('0x16d'),[_0x387e42,_0x4a6d20[_0x3c42('0x10c')],_0x4a6d20['url'],_0x845535,_0x4a6d20[_0x3c42('0x63')],_0x4a6d20[_0x3c42('0xb6')],_0x4a6d20[_0x3c42('0x16e')],_0x4a6d20['gosub'],'',_0x4a6d20[_0x3c42('0x16f')]]);if(_0x522a92[_0x3c42('0xa1')]===-0x1){return _0x522a92;}return this['channel']['noop'](util['format'](_0x3c42('0xc3'),'QUEUE',_0x387e42));};AGIVertices[_0x3c42('0x13')][_0x3c42('0x170')]=function(_0x2627a4){logger['info'](util['format'](_0x3c42('0x171'),_0x2627a4[_0x3c42('0xa8')]));var _0x48b939=_0x2627a4[_0x3c42('0x172')]||_0x3c42('0x12c');var _0x1d2f5e=util[_0x3c42('0x9b')](_0x3c42('0x173'),this[_0x3c42('0x10')][_0x3c42('0x37')],rs[_0x3c42('0x11a')](0x5));var _0x18972e=util[_0x3c42('0x9b')](_0x3c42('0x174'),FILES_PATH,_0x1d2f5e,_0x48b939);var _0x2f066e=util[_0x3c42('0x9b')](_0x3c42('0x12d'),FILES_PATH,_0x1d2f5e);this[_0x3c42('0x36')][_0x3c42('0x6e')](this,_0x2627a4,_0x1d2f5e,_0x18972e);this[_0x3c42('0x10')]['setVariable'](_0x3c42('0x175'),_0x1d2f5e);logger[_0x3c42('0x29')](_0x3c42('0x176'),_0x2f066e,_0x48b939,_0x2627a4[_0x3c42('0x177')],_0x2627a4['timeout']);return this['channel']['recordFile'](_0x2f066e,_0x48b939,_0x2627a4[_0x3c42('0x177')],_0x2627a4[_0x3c42('0x63')],undefined,!![]);};AGIVertices[_0x3c42('0x13')]['restapi']=function(_0x13b40f){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x13b40f[_0x3c42('0xa8')]));if(!this['isConfigured'](_0x13b40f[_0x3c42('0x62')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0x178'));}var _0x3ef695=this[_0x3c42('0x179')][_0x3c42('0x6e')](this,_0x13b40f);logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x17a'),util['inspect'](_0x3ef695,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x13b40f[_0x3c42('0xd8')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0x17b'));}var _0x49ea9c=this[_0x3c42('0x14')][_0x3c42('0x6e')](this,_0x13b40f[_0x3c42('0xd8')]);if(!_0x49ea9c){return this['channel'][_0x3c42('0x2e')](_0x13b40f,_0x3c42('0x118'));}this[_0x3c42('0x10')][_0x3c42('0xa3')](util['format']('%s_STATUS_CODE',_0x49ea9c),_0x3ef695[_0x3c42('0x73')]?_0x3ef695['statusCode']:'200');this[_0x3c42('0x10')][_0x3c42('0xa3')](util[_0x3c42('0x9b')](_0x3c42('0x17c'),_0x49ea9c),_0x3ef695['statusMessage']?_0x3ef695[_0x3c42('0x74')]:'OK');if(_0x3ef695['body']){try{this[_0x3c42('0x9d')](_0x3ef695[_0x3c42('0x6a')],_0x49ea9c);}catch(_0x533bf1){logger[_0x3c42('0x2e')](util[_0x3c42('0x9b')](_0x3c42('0x17d'),_0x49ea9c));}}return this[_0x3c42('0x10')][_0x3c42('0xa9')](util['format'](_0x3c42('0xdd'),_0x49ea9c));};AGIVertices['prototype']['saydigits']=function(_0x3698ac){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x17e'),_0x3698ac[_0x3c42('0xa8')]));return this[_0x3c42('0x10')][_0x3c42('0x17f')](_0x3698ac[_0x3c42('0x180')]['replace'](/\s+/g,''),_0x3698ac['escape_digits']);};AGIVertices['prototype'][_0x3c42('0x181')]=function(_0x41a6aa){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x182'),_0x41a6aa[_0x3c42('0xa8')]));return this['channel'][_0x3c42('0x183')](_0x41a6aa['number'][_0x3c42('0x56')](/\s+/g,''),_0x41a6aa[_0x3c42('0x177')]);};AGIVertices[_0x3c42('0x13')][_0x3c42('0x184')]=function(_0x503891){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x185'),_0x503891[_0x3c42('0xa8')]));return this[_0x3c42('0x10')][_0x3c42('0x186')](_0x503891['text'],_0x503891[_0x3c42('0x177')]);};AGIVertices[_0x3c42('0x13')]['sendMail']=function(_0x59d51f){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x187'),_0x59d51f[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x59d51f['account_id'])){return this['channel'][_0x3c42('0xa9')](_0x3c42('0x188'));}var _0xae4d8f=this[_0x3c42('0x189')][_0x3c42('0x6e')](this,_0x59d51f['account_id']);if(!_0xae4d8f||!_0xae4d8f[_0x3c42('0x18a')]){return this[_0x3c42('0x10')]['error'](_0x59d51f,_0x3c42('0x18b'));}var _0x143295={'from':util[_0x3c42('0x9b')](_0x3c42('0x18c'),_0xae4d8f['name'],_0xae4d8f[_0x3c42('0x18d')]||_0xae4d8f[_0x3c42('0x18a')][_0x3c42('0x18e')]),'to':_0x59d51f['to']||'','cc':_0x59d51f['cc']||'','bcc':_0x59d51f[_0x3c42('0x18f')]||'','subject':_0x59d51f[_0x3c42('0x190')],'html':_0x59d51f[_0x3c42('0x5a')],'text':_0x59d51f[_0x3c42('0x5a')]};if(this[_0x3c42('0x84')](_0x59d51f[_0x3c42('0x191')])){}logger['debug']('sendMail\x20message',JSON['stringify'](_0x143295));this[_0x3c42('0x33')][_0x3c42('0x6e')](this,_0x59d51f,_0x59d51f['account_id']);this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0x192'),_0xae4d8f[_0x3c42('0x16')]));this[_0x3c42('0x23')][_0x3c42('0x6e')](this,_0xae4d8f[_0x3c42('0x193')],_0x143295);return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0x194'));};AGIVertices[_0x3c42('0x13')][_0x3c42('0x195')]=function(_0x2cdb9d){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x196'),_0x2cdb9d['label']));return this['channel'][_0x3c42('0xa9')](_0x3c42('0x197'));};AGIVertices[_0x3c42('0x13')][_0x3c42('0x198')]=function(_0x5f5552){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0x199'),_0x5f5552['label']));if(!this[_0x3c42('0x84')](_0x5f5552[_0x3c42('0x19a')])){return this['channel'][_0x3c42('0xa9')](_0x3c42('0x19b'));}var _0xfb81f9=this[_0x3c42('0x30')][_0x3c42('0x6e')](this,_0x5f5552['sms_account_id']);if(!_0xfb81f9){return this['channel'][_0x3c42('0x2e')](_0x5f5552,_0x3c42('0x19c'));}var _0xc43e02={'body':_0x5f5552[_0x3c42('0x19d')],'phone':_0x5f5552['to']||'','SmsAccountId':_0xfb81f9['id']};logger[_0x3c42('0xde')]('sendSMS\x20message',JSON[_0x3c42('0x72')](_0xc43e02));this['createSquareDetailsReport'][_0x3c42('0x6e')](this,_0x5f5552,_0x5f5552[_0x3c42('0x19a')]);this[_0x3c42('0x10')][_0x3c42('0xa9')](util['format'](_0x3c42('0x19e'),_0xfb81f9[_0x3c42('0x16')]));this[_0x3c42('0x32')][_0x3c42('0x6e')](this,_0xc43e02);return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0x19f'));};AGIVertices['prototype']['set']=function(_0x2e5101){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x1a0'),_0x2e5101[_0x3c42('0xa8')]));if(!this['isConfigured'](_0x2e5101[_0x3c42('0xd8')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x2e5101,_0x3c42('0x1a1'));}var _0x56ca3f=this[_0x3c42('0x14')][_0x3c42('0x6e')](this,_0x2e5101[_0x3c42('0xd8')]);if(!_0x56ca3f){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x2e5101,_0x3c42('0x118'));}return this[_0x3c42('0x10')][_0x3c42('0xa3')](_0x56ca3f,_0x2e5101[_0x3c42('0x1a2')]);};AGIVertices['prototype'][_0x3c42('0x1a3')]=function(_0x474fed){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')](_0x3c42('0x1a4'),_0x474fed[_0x3c42('0xa8')]));this['channel'][_0x3c42('0xa9')](_0x3c42('0x1a5'));if(_0x474fed['answer']==='yes'){this[_0x3c42('0x10')][_0x3c42('0xa9')]('Answer');return this[_0x3c42('0x10')][_0x3c42('0xba')]();}return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0x1a6'));};AGIVertices[_0x3c42('0x13')]['subproject']=function(_0x2e51f6){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0x1a7'),_0x2e51f6[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x2e51f6[_0x3c42('0x1a8')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x2e51f6,'no\x20subproject\x20selected');}var _0x43dd72=this[_0x3c42('0x1a9')][_0x3c42('0x6e')](this,_0x2e51f6[_0x3c42('0x1a8')]);if(!this[_0x3c42('0x84')](_0x43dd72)){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x2e51f6,util[_0x3c42('0x9b')](_0x3c42('0x1aa'),_0x2e51f6[_0x3c42('0x1a8')]));}if(_0x43dd72===this[_0x3c42('0x10')][_0x3c42('0x35')]){return this['channel'][_0x3c42('0x2e')](_0x2e51f6,_0x3c42('0x1ab'));}this[_0x3c42('0x33')][_0x3c42('0x6e')](this,_0x2e51f6,_0x43dd72);var _0xc1efcc=this[_0x3c42('0x10')][_0x3c42('0x54')](_0x3c42('0x1ac'),util[_0x3c42('0x9b')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0x3c42('0x1ad')]||_0x3c42('0x1ae'),_0x43dd72,this['channel']['arg_1']));if(_0xc1efcc[_0x3c42('0xa1')]===-0x1){return _0xc1efcc;}return this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')]('Executed\x20command\x20%s\x20%s',_0x3c42('0x1ac'),_0x43dd72));};AGIVertices[_0x3c42('0x13')][_0x3c42('0x1af')]=function(_0x33e0f1){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x33e0f1['label']));var _0x58227d=this['shellCommand'][_0x3c42('0x6e')](this,_0x33e0f1[_0x3c42('0xb8')]);this[_0x3c42('0x33')][_0x3c42('0x6e')](this,_0x33e0f1,_0x33e0f1['command']);if(this[_0x3c42('0x84')](_0x33e0f1[_0x3c42('0xd8')])){var _0x1b4a57=this['getVariable'][_0x3c42('0x6e')](this,_0x33e0f1[_0x3c42('0xd8')]);if(_0x1b4a57){this[_0x3c42('0x10')]['setVariable'](_0x1b4a57,_0x58227d);return this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0x1b0'),_0x33e0f1[_0x3c42('0xb8')],_0x1b4a57));}}return this['channel']['noop'](util[_0x3c42('0x9b')](_0x3c42('0x1b1'),_0x33e0f1[_0x3c42('0xb8')]));};AGIVertices[_0x3c42('0x13')]['google_cloud_tts']=function(_0x25f6dd){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x25f6dd[_0x3c42('0xa8')]));_0x25f6dd[_0x3c42('0x5a')]=_0x25f6dd[_0x3c42('0x5a')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x25f6dd[_0x3c42('0x58')])){return this[_0x3c42('0x10')]['noop'](_0x3c42('0x1b2'));}if(!this['isConfigured'](_0x25f6dd['text'])){return this[_0x3c42('0x10')]['noop']('no\x20text\x20configured');}this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0x1b3'),_0x25f6dd[_0x3c42('0x5a')]));var _0x3abf02=this['googleCloudTTS'][_0x3c42('0x6e')](this,_0x25f6dd);if(_0x3abf02){this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0x1b4'),_0x3abf02));var _0x4328ae=this[_0x3c42('0x10')][_0x3c42('0x100')](_0x3abf02);try{fs[_0x3c42('0x101')](_0x3abf02+_0x3c42('0x102'));}catch(_0x3dd902){logger['error'](_0x3dd902);}return _0x4328ae;}return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x25f6dd,_0x3c42('0x1b5'));};AGIVertices[_0x3c42('0x13')]['tts']=function(_0x597151){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0x1b6'),_0x597151[_0x3c42('0xa8')]));_0x597151['text']=_0x597151['text'][_0x3c42('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x597151[_0x3c42('0x5a')])){return this[_0x3c42('0x10')][_0x3c42('0xa9')](_0x3c42('0xaa'));}this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0x1b7'),_0x597151[_0x3c42('0x5a')]));var _0x3e15a6=this[_0x3c42('0x60')]['sync'](this,_0x597151);if(_0x3e15a6){this[_0x3c42('0x10')]['noop'](util[_0x3c42('0x9b')](_0x3c42('0x1b8'),_0x3e15a6));var _0x43c519=this[_0x3c42('0x10')]['streamFile'](_0x3e15a6);try{fs[_0x3c42('0x101')](_0x3e15a6+_0x3c42('0x102'));}catch(_0x21b854){logger[_0x3c42('0x2e')](_0x21b854);}return _0x43c519;}return this[_0x3c42('0x10')]['error'](_0x597151,_0x3c42('0x1b9'));};AGIVertices[_0x3c42('0x13')][_0x3c42('0x1ba')]=function(_0x49858c){logger[_0x3c42('0x29')](util['format'](_0x3c42('0x1bb'),_0x49858c[_0x3c42('0xa8')]));if(!this[_0x3c42('0x84')](_0x49858c[_0x3c42('0x152')])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x49858c,_0x3c42('0x153'));}logger['info'](util[_0x3c42('0x9b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x3c42('0x10')]['callerid'],_0x49858c[_0x3c42('0x152')]));var _0x446294=this[_0x3c42('0x4e')][_0x3c42('0x6e')](this,_0x49858c[_0x3c42('0x152')]);if(_0x446294){logger[_0x3c42('0x29')](util[_0x3c42('0x9b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x3c42('0x10')][_0x3c42('0x38')],_0x49858c[_0x3c42('0x152')]));this['channel'][_0x3c42('0xa9')](util['format'](_0x3c42('0x155'),this[_0x3c42('0x10')][_0x3c42('0x38')],_0x49858c['findBy']));return{'code':0xc8,'result':_0x3c42('0x156')};}else{logger[_0x3c42('0x29')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x3c42('0x10')][_0x3c42('0x38')],_0x49858c[_0x3c42('0x152')]));this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0x157'),this[_0x3c42('0x10')][_0x3c42('0x38')],_0x49858c[_0x3c42('0x152')]));return{'code':0xc8,'result':_0x3c42('0x158')};}};AGIVertices[_0x3c42('0x13')][_0x3c42('0x1bc')]=function(_0x3ab570){logger['info'](util[_0x3c42('0x9b')](_0x3c42('0x1bd'),_0x3ab570[_0x3c42('0xa8')]));var _0x28a797=this[_0x3c42('0x10')][_0x3c42('0x54')](_0x3c42('0x1be'),[_0x3ab570[_0x3c42('0x1bf')],_0x3ab570[_0x3c42('0x77')]]);if(_0x28a797[_0x3c42('0xa1')]===-0x1){return _0x28a797;}return this[_0x3c42('0x10')][_0x3c42('0xa9')](util[_0x3c42('0x9b')](_0x3c42('0xc3'),_0x3c42('0x1be'),_0x3ab570[_0x3c42('0x1bf')]));};AGIVertices[_0x3c42('0x13')]['vswitch']=function(_0x2bfaeb){logger[_0x3c42('0x29')](util['format'](_0x3c42('0x1c0'),_0x2bfaeb['label']));if(!this[_0x3c42('0x84')](_0x2bfaeb['variable_id'])){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x2bfaeb,_0x3c42('0x1a1'));}var _0x54087d=this[_0x3c42('0x14')]['sync'](this,_0x2bfaeb[_0x3c42('0xd8')]);if(!_0x54087d){return this[_0x3c42('0x10')][_0x3c42('0x2e')](_0x2bfaeb,'no\x20variable\x20found');}var _0x45ff7c=this[_0x3c42('0x10')][_0x3c42('0x14')](_0x54087d);return{'code':0xc8,'result':_0x45ff7c[_0x3c42('0xa0')]?_0x45ff7c[_0x3c42('0xa0')]:'-'};};String[_0x3c42('0x13')]['replaceAll']=function(_0x24e428,_0xb7372e){return this[_0x3c42('0x9f')](_0x24e428)[_0x3c42('0x1c1')](_0xb7372e);};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 b0d85af..21ccb61 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 _0x2490=['[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnectPreview','acw','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','secondtransfereruniqueid','transfertargetuniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','prototype','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','then','getAgent','info','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','timer','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]'];(function(_0x1b92a6,_0x14444b){var _0x24be5b=function(_0x3a5fb5){while(--_0x3a5fb5){_0x1b92a6['push'](_0x1b92a6['shift']());}};_0x24be5b(++_0x14444b);}(_0x2490,0xc0));var _0x0249=function(_0x5bf333,_0x49e69f){_0x5bf333=_0x5bf333-0x0;var _0x282e6c=_0x2490[_0x5bf333];return _0x282e6c;};'use strict';var _=require(_0x0249('0x0'));var moment=require(_0x0249('0x1'));var ami=require(_0x0249('0x2'));var logger=require(_0x0249('0x3'))('acw');var RpcUser=require(_0x0249('0x4'));var RpcVoiceAgentReport=require(_0x0249('0x5'));function Acw(_0x2b0e56){this[_0x0249('0x6')]=_0x2b0e56['voiceQueues'];this[_0x0249('0x7')]=_0x2b0e56['agents'];this['timers']=_0x2b0e56[_0x0249('0x8')];this[_0x0249('0x9')]={};ami['on']('agentconnect',this[_0x0249('0xa')][_0x0249('0xb')](this));ami['on'](_0x0249('0xc'),this[_0x0249('0xd')][_0x0249('0xb')](this));ami['on'](_0x0249('0xe'),this['syncHangup'][_0x0249('0xb')](this));ami['on'](_0x0249('0xf'),this[_0x0249('0x10')][_0x0249('0xb')](this));ami['on'](_0x0249('0x11'),this['syncAttendedTransfer'][_0x0249('0xb')](this));ami['on'](_0x0249('0x12'),this[_0x0249('0x13')][_0x0249('0xb')](this));ami['on'](_0x0249('0x14'),this['syncAgentConnectPreview'][_0x0249('0xb')](this));}function getDiff(_0x1f5274){var _0x5a093f=moment()[_0x0249('0x15')](0x0);var _0x4198d4=moment(_0x1f5274)[_0x0249('0x15')](0x0);return _0x5a093f[_0x0249('0x16')](_0x4198d4,'seconds');}Acw[_0x0249('0x17')]['startAcw']=function(_0x3790ea){try{var _0x1f2e95=this;var _0x26bd99=this[_0x0249('0x9')][_0x3790ea][_0x0249('0x18')];var _0x6e7187=this[_0x0249('0x9')][_0x3790ea][_0x0249('0x19')];var _0x214f51=this[_0x0249('0x6')][_0x6e7187];var _0x3cd4f0=![];var _0x38e02f=_0x0249('0x1a');if(_0x214f51[_0x0249('0x1b')]){if(_0x214f51[_0x0249('0x1c')][_0x0249('0x1d')]){_0x3cd4f0=!![];_0x38e02f=_0x214f51['mandatoryDispositionPause']['name'];}}return ami['Action']({'action':'QueuePause','interface':_0x26bd99,'paused':!![],'reason':_0x38e02f})[_0x0249('0x1e')](function(){if(_0x1f2e95[_0x0249('0x7')][_0x26bd99]){return RpcUser[_0x0249('0x1f')](_0x1f2e95[_0x0249('0x7')][_0x26bd99]['id'])[_0x0249('0x1e')](function(_0x77df03){if(_0x77df03&&!_0x77df03['voicePause']){logger[_0x0249('0x20')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x3790ea,_0x26bd99,_0x6e7187);var _0x4ff2ef=_0x1f2e95[_0x0249('0x9')][_0x3790ea][_0x0249('0x21')]&&_0x1f2e95[_0x0249('0x9')][_0x3790ea][_0x0249('0x22')]?_0x1f2e95['channels'][_0x3790ea]['destlinkedid']:_0x3790ea;return RpcUser[_0x0249('0x23')](_0x1f2e95[_0x0249('0x7')][_0x26bd99],_0x38e02f,_0x4ff2ef)[_0x0249('0x1e')](function(){if(!_0x3cd4f0){_0x1f2e95[_0x0249('0x8')][_0x26bd99]={};logger[_0x0249('0x20')](_0x0249('0x24'),_0x3790ea,_0x1f2e95[_0x0249('0x6')][_0x6e7187][_0x0249('0x25')],_0x26bd99,_0x6e7187);_0x1f2e95[_0x0249('0x8')][_0x26bd99]['timer']=setTimeout(_0x1f2e95[_0x0249('0x26')]['bind'](_0x1f2e95,_0x26bd99),_0x1f2e95[_0x0249('0x6')][_0x6e7187][_0x0249('0x25')]*0x3e8);_0x1f2e95[_0x0249('0x8')][_0x26bd99][_0x0249('0x27')]=moment()[_0x0249('0x28')](_0x0249('0x29'));_0x1f2e95[_0x0249('0x8')][_0x26bd99][_0x0249('0x2a')]=_0x3790ea;_0x1f2e95[_0x0249('0x8')][_0x26bd99][_0x0249('0x19')]=_0x6e7187;_0x1f2e95[_0x0249('0x8')][_0x26bd99]['updateAcw']=function(){var _0x5a223e=getDiff(_0x1f2e95[_0x0249('0x8')][_0x26bd99]['lastPauseAt']);clearTimeout(_0x1f2e95[_0x0249('0x8')][_0x26bd99][_0x0249('0x2b')]);_0x1f2e95[_0x0249('0x8')][_0x26bd99][_0x0249('0x2b')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x5a223e},_0x1f2e95[_0x0249('0x8')][_0x26bd99][_0x0249('0x2a')],_0x26bd99)[_0x0249('0x1e')](function(_0x1166a0){logger[_0x0249('0x20')](_0x0249('0x2c'),_0x3790ea,_0x5a223e,_0x1166a0);})[_0x0249('0x2d')](function(_0x151483){logger[_0x0249('0x2e')]('[%s][UPDATE][ERRORS:%s]',_0x3790ea,_0x151483);});delete _0x1f2e95['timers'][_0x26bd99];};}});}else{logger[_0x0249('0x20')](_0x0249('0x2f'),_0x3790ea,_0x26bd99,_0x6e7187);}});}})[_0x0249('0x2d')](function(){logger['error'](_0x0249('0x24'),_0x3790ea,_0x1f2e95[_0x0249('0x6')][_0x6e7187][_0x0249('0x25')],_0x26bd99,_0x6e7187);})['finally'](function(){delete _0x1f2e95[_0x0249('0x9')][_0x3790ea];});}catch(_0x4c1924){logger['error'](_0x0249('0x30'),_0x4c1924[_0x0249('0x31')]);}};Acw[_0x0249('0x17')][_0x0249('0x26')]=function(_0x2b6fbc){try{var _0x5a87d7=this;if(_0x5a87d7[_0x0249('0x8')][_0x2b6fbc]){_0x5a87d7[_0x0249('0x8')][_0x2b6fbc][_0x0249('0x2b')]=![];var _0x827bc9=_0x5a87d7['timers'][_0x2b6fbc][_0x0249('0x2a')];var _0x5ddc57=_0x5a87d7[_0x0249('0x8')][_0x2b6fbc][_0x0249('0x19')];var _0x351f73=_0x5a87d7[_0x0249('0x6')][_0x5ddc57][_0x0249('0x25')];logger[_0x0249('0x20')](_0x0249('0x32'),_0x827bc9,_0x2b6fbc);RpcUser[_0x0249('0x33')](this[_0x0249('0x7')][_0x2b6fbc]);RpcVoiceAgentReport['update']({'acwtime':_0x351f73,'agentacw':!![]},_0x827bc9,_0x2b6fbc)['then'](function(_0xb80eef){logger[_0x0249('0x20')](_0x0249('0x2c'),_0x827bc9,_0x351f73,_0xb80eef);})[_0x0249('0x2d')](function(_0x6c2823){logger[_0x0249('0x2e')](_0x0249('0x34'),_0x827bc9,_0x6c2823);});}else{logger[_0x0249('0x2e')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x2b6fbc);if(_0x5a87d7[_0x0249('0x8')]){logger['info'](_0x0249('0x35'),JSON[_0x0249('0x36')](_0x5a87d7[_0x0249('0x8')]));}}}catch(_0x3dbe09){logger[_0x0249('0x2e')](_0x0249('0x37'),_0x3dbe09[_0x0249('0x31')]);}};Acw[_0x0249('0x17')][_0x0249('0xa')]=function(_0x273a8b){try{if(this[_0x0249('0x6')][_0x273a8b[_0x0249('0x19')]]&&(this['voiceQueues'][_0x273a8b[_0x0249('0x19')]]['acw']||this[_0x0249('0x6')][_0x273a8b[_0x0249('0x19')]][_0x0249('0x1b')])){if(this['agents'][_0x273a8b[_0x0249('0x18')]]){this[_0x0249('0x9')][_0x273a8b['uniqueid']]={'queue':_0x273a8b['queue'],'interface':_0x273a8b[_0x0249('0x18')],'destlinkedid':_0x273a8b[_0x0249('0x22')]};}}}catch(_0x49d4d2){logger[_0x0249('0x2e')]('[ACW][syncAgentConnect]\x20%s',_0x49d4d2['message']);}};Acw[_0x0249('0x17')][_0x0249('0x38')]=function(_0x5ec8fb){try{if(this[_0x0249('0x6')][_0x5ec8fb[_0x0249('0x19')]]&&(this['voiceQueues'][_0x5ec8fb[_0x0249('0x19')]][_0x0249('0x39')]||this['voiceQueues'][_0x5ec8fb[_0x0249('0x19')]]['mandatoryDisposition'])){if(this[_0x0249('0x7')][_0x5ec8fb[_0x0249('0x18')]]){this['channels'][_0x5ec8fb['uniqueid']]={'queue':_0x5ec8fb['queue'],'interface':_0x5ec8fb[_0x0249('0x18')]};}}}catch(_0x19fc2d){logger[_0x0249('0x2e')](_0x0249('0x3a'),_0x19fc2d[_0x0249('0x31')]);}};Acw[_0x0249('0x17')]['syncHangupRequest']=function(_0x493e4a){try{if(this['channels'][_0x493e4a[_0x0249('0x2a')]]&&_[_0x0249('0x3b')](this[_0x0249('0x9')][_0x493e4a['uniqueid']][_0x0249('0x21')])){logger['info'](_0x0249('0x3c'),_0x493e4a[_0x0249('0x2a')]);this[_0x0249('0x3d')](_0x493e4a[_0x0249('0x2a')]);}else if(this['channels'][_0x493e4a[_0x0249('0x3e')]]&&_[_0x0249('0x3b')](this[_0x0249('0x9')][_0x493e4a[_0x0249('0x3e')]][_0x0249('0x21')])){logger[_0x0249('0x20')](_0x0249('0x3f'),_0x493e4a[_0x0249('0x3e')]);this['startAcw'](_0x493e4a['linkedid']);}}catch(_0x4f3a39){logger[_0x0249('0x2e')](_0x0249('0x40'),_0x4f3a39[_0x0249('0x31')]);}};Acw[_0x0249('0x17')][_0x0249('0x41')]=function(_0x5a581e){try{if(this[_0x0249('0x9')][_0x5a581e[_0x0249('0x2a')]]&&this[_0x0249('0x9')][_0x5a581e['uniqueid']][_0x0249('0x21')]){logger[_0x0249('0x20')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x5a581e[_0x0249('0x2a')]);this['startAcw'](_0x5a581e[_0x0249('0x2a')]);}else if(this['channels'][_0x5a581e[_0x0249('0x3e')]]&&this['channels'][_0x5a581e['linkedid']][_0x0249('0x21')]){logger[_0x0249('0x20')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x5a581e['linkedid']);this[_0x0249('0x3d')](_0x5a581e[_0x0249('0x3e')]);}}catch(_0x5a518a){logger[_0x0249('0x2e')](_0x0249('0x42'),_0x5a518a[_0x0249('0x31')]);}};Acw[_0x0249('0x17')][_0x0249('0x43')]=function(_0x334eba){try{if(!_[_0x0249('0x44')](this['channels'][_0x334eba['transfereeuniqueid']])){this['startAcw'](_0x334eba['transfereeuniqueid']);if(this[_0x0249('0x9')][_0x334eba['secondtransfereruniqueid']]){this['channels'][_0x334eba[_0x0249('0x45')]]['attended']=!![];this[_0x0249('0x9')][_0x334eba[_0x0249('0x46')]]=this['channels'][_0x334eba[_0x0249('0x45')]];delete this[_0x0249('0x9')][_0x334eba[_0x0249('0x45')]];}}else if(!_[_0x0249('0x44')](this['channels'][_0x334eba[_0x0249('0x46')]])){this[_0x0249('0x3d')](_0x334eba[_0x0249('0x46')]);if(this['channels'][_0x334eba['origtransfereruniqueid']]){this['channels'][_0x334eba['origtransfereruniqueid']][_0x0249('0x21')]=!![];this[_0x0249('0x9')][_0x334eba['transfereeuniqueid']]=this[_0x0249('0x9')][_0x334eba['origtransfereruniqueid']];delete this[_0x0249('0x9')][_0x334eba['origtransfereruniqueid']];}}}catch(_0x239c44){logger[_0x0249('0x2e')](_0x0249('0x47'),_0x239c44['message']);}};Acw[_0x0249('0x17')][_0x0249('0x13')]=function(_0x2d32f3){try{if(this['channels'][_0x2d32f3[_0x0249('0x48')]]){logger[_0x0249('0x20')](_0x0249('0x49'),JSON[_0x0249('0x36')](_0x2d32f3['transfereruniqueid']));this['startAcw'](_0x2d32f3[_0x0249('0x48')]);}else if(this[_0x0249('0x9')][_0x2d32f3[_0x0249('0x4a')]]){logger[_0x0249('0x20')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x0249('0x36')](_0x2d32f3['transfererlinkedid']));this['startAcw'](_0x2d32f3[_0x0249('0x4a')]);}}catch(_0x4f4fc8){logger[_0x0249('0x2e')](_0x0249('0x4b'),_0x4f4fc8[_0x0249('0x31')]);}};Acw['prototype'][_0x0249('0x10')]=function(_0x45269d){try{if(this[_0x0249('0x6')][_0x45269d[_0x0249('0x19')]]&&this['voiceQueues'][_0x45269d[_0x0249('0x19')]]['autopause']===_0x0249('0x4c')){if(this['agents'][_0x45269d[_0x0249('0x18')]]){logger['info'](_0x0249('0x4d'),_0x45269d['uniqueid'],_0x45269d[_0x0249('0x18')],_0x45269d[_0x0249('0x19')]);return RpcUser[_0x0249('0x23')](this['agents'][_0x45269d['interface']],'Auto-Pause',_0x45269d['uniqueid']);}}}catch(_0x1e8088){logger['error'](_0x0249('0x4e'),_0x1e8088[_0x0249('0x31')]);}};module[_0x0249('0x4f')]=Acw; \ No newline at end of file +var _0x13c3=['transfertargetuniqueid','isNil','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','prototype','startAcw','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','acw','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid'];(function(_0x2014e7,_0x2bd284){var _0x29452d=function(_0x76c1b0){while(--_0x76c1b0){_0x2014e7['push'](_0x2014e7['shift']());}};_0x29452d(++_0x2bd284);}(_0x13c3,0x110));var _0x313c=function(_0x58dba1,_0x530c35){_0x58dba1=_0x58dba1-0x0;var _0x5aae0e=_0x13c3[_0x58dba1];return _0x5aae0e;};'use strict';var _=require('lodash');var moment=require(_0x313c('0x0'));var ami=require(_0x313c('0x1'));var logger=require(_0x313c('0x2'))('acw');var RpcUser=require(_0x313c('0x3'));var RpcVoiceAgentReport=require(_0x313c('0x4'));function Acw(_0x26dde7){this[_0x313c('0x5')]=_0x26dde7[_0x313c('0x5')];this[_0x313c('0x6')]=_0x26dde7[_0x313c('0x6')];this[_0x313c('0x7')]=_0x26dde7[_0x313c('0x7')];this[_0x313c('0x8')]={};ami['on'](_0x313c('0x9'),this[_0x313c('0xa')][_0x313c('0xb')](this));ami['on'](_0x313c('0xc'),this[_0x313c('0xd')][_0x313c('0xb')](this));ami['on'](_0x313c('0xe'),this['syncHangup'][_0x313c('0xb')](this));ami['on'](_0x313c('0xf'),this[_0x313c('0x10')]['bind'](this));ami['on'](_0x313c('0x11'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x313c('0x12'),this[_0x313c('0x13')][_0x313c('0xb')](this));ami['on'](_0x313c('0x14'),this[_0x313c('0x15')][_0x313c('0xb')](this));}function getDiff(_0x3bc16d){var _0x14029e=moment()['milliseconds'](0x0);var _0x2abddf=moment(_0x3bc16d)['milliseconds'](0x0);return _0x14029e['diff'](_0x2abddf,'seconds');}Acw[_0x313c('0x16')][_0x313c('0x17')]=function(_0x2d3333){try{var _0x15088f=this;var _0x89720b=this['channels'][_0x2d3333][_0x313c('0x18')];var _0x3ab9ed=this[_0x313c('0x8')][_0x2d3333][_0x313c('0x19')];var _0x1e264a=this[_0x313c('0x5')][_0x3ab9ed];var _0x2538a7=![];var _0x5ae4a2='ACW';if(_0x1e264a[_0x313c('0x1a')]){if(_0x1e264a[_0x313c('0x1b')][_0x313c('0x1c')]){_0x2538a7=!![];_0x5ae4a2=_0x1e264a[_0x313c('0x1b')][_0x313c('0x1c')];}}return ami['Action']({'action':_0x313c('0x1d'),'interface':_0x89720b,'paused':!![],'reason':_0x5ae4a2})[_0x313c('0x1e')](function(){if(_0x15088f[_0x313c('0x6')][_0x89720b]){return RpcUser[_0x313c('0x1f')](_0x15088f['agents'][_0x89720b]['id'])['then'](function(_0x570298){if(_0x570298&&!_0x570298[_0x313c('0x20')]){logger['info'](_0x313c('0x21'),_0x2d3333,_0x89720b,_0x3ab9ed);var _0x2ce337=_0x15088f[_0x313c('0x8')][_0x2d3333]['attended']&&_0x15088f[_0x313c('0x8')][_0x2d3333][_0x313c('0x22')]?_0x15088f[_0x313c('0x8')][_0x2d3333]['destlinkedid']:_0x2d3333;return RpcUser[_0x313c('0x23')](_0x15088f[_0x313c('0x6')][_0x89720b],_0x5ae4a2,_0x2ce337)[_0x313c('0x1e')](function(){if(!_0x2538a7){_0x15088f[_0x313c('0x7')][_0x89720b]={};logger[_0x313c('0x24')](_0x313c('0x25'),_0x2d3333,_0x15088f[_0x313c('0x5')][_0x3ab9ed]['acwTimeout'],_0x89720b,_0x3ab9ed);_0x15088f['timers'][_0x89720b][_0x313c('0x26')]=setTimeout(_0x15088f[_0x313c('0x27')]['bind'](_0x15088f,_0x89720b),_0x15088f['voiceQueues'][_0x3ab9ed][_0x313c('0x28')]*0x3e8);_0x15088f[_0x313c('0x7')][_0x89720b][_0x313c('0x29')]=moment()[_0x313c('0x2a')](_0x313c('0x2b'));_0x15088f[_0x313c('0x7')][_0x89720b]['uniqueid']=_0x2d3333;_0x15088f[_0x313c('0x7')][_0x89720b]['queue']=_0x3ab9ed;_0x15088f[_0x313c('0x7')][_0x89720b][_0x313c('0x2c')]=function(){var _0x361876=getDiff(_0x15088f[_0x313c('0x7')][_0x89720b][_0x313c('0x29')]);clearTimeout(_0x15088f[_0x313c('0x7')][_0x89720b][_0x313c('0x26')]);_0x15088f[_0x313c('0x7')][_0x89720b][_0x313c('0x26')]=![];RpcVoiceAgentReport[_0x313c('0x2d')]({'acwtime':_0x361876},_0x15088f[_0x313c('0x7')][_0x89720b][_0x313c('0x2e')],_0x89720b)[_0x313c('0x1e')](function(_0x5b9b79){logger[_0x313c('0x24')](_0x313c('0x2f'),_0x2d3333,_0x361876,_0x5b9b79);})['catch'](function(_0x4b00c4){logger[_0x313c('0x30')](_0x313c('0x31'),_0x2d3333,_0x4b00c4);});delete _0x15088f[_0x313c('0x7')][_0x89720b];};}});}else{logger[_0x313c('0x24')](_0x313c('0x32'),_0x2d3333,_0x89720b,_0x3ab9ed);}});}})[_0x313c('0x33')](function(){logger[_0x313c('0x30')](_0x313c('0x25'),_0x2d3333,_0x15088f[_0x313c('0x5')][_0x3ab9ed][_0x313c('0x28')],_0x89720b,_0x3ab9ed);})[_0x313c('0x34')](function(){delete _0x15088f[_0x313c('0x8')][_0x2d3333];});}catch(_0x5cb92c){logger[_0x313c('0x30')](_0x313c('0x35'),_0x5cb92c[_0x313c('0x36')]);}};Acw[_0x313c('0x16')][_0x313c('0x27')]=function(_0x39c262){try{var _0xe462eb=this;if(_0xe462eb['timers'][_0x39c262]){_0xe462eb[_0x313c('0x7')][_0x39c262]['timer']=![];var _0x536f30=_0xe462eb[_0x313c('0x7')][_0x39c262][_0x313c('0x2e')];var _0x5b8846=_0xe462eb[_0x313c('0x7')][_0x39c262][_0x313c('0x19')];var _0x2defa1=_0xe462eb[_0x313c('0x5')][_0x5b8846][_0x313c('0x28')];logger[_0x313c('0x24')](_0x313c('0x37'),_0x536f30,_0x39c262);RpcUser[_0x313c('0x38')](this[_0x313c('0x6')][_0x39c262]);RpcVoiceAgentReport[_0x313c('0x2d')]({'acwtime':_0x2defa1,'agentacw':!![]},_0x536f30,_0x39c262)[_0x313c('0x1e')](function(_0x68a39b){logger[_0x313c('0x24')](_0x313c('0x2f'),_0x536f30,_0x2defa1,_0x68a39b);})['catch'](function(_0x69d850){logger[_0x313c('0x30')](_0x313c('0x31'),_0x536f30,_0x69d850);});}else{logger['error'](_0x313c('0x39'),_0x39c262);if(_0xe462eb[_0x313c('0x7')]){logger['info']('[ACW][TIMERS]',JSON['stringify'](_0xe462eb[_0x313c('0x7')]));}}}catch(_0x598bce){logger[_0x313c('0x30')](_0x313c('0x3a'),_0x598bce['message']);}};Acw['prototype'][_0x313c('0xa')]=function(_0x2ecabb){try{if(this[_0x313c('0x5')][_0x2ecabb[_0x313c('0x19')]]&&(this['voiceQueues'][_0x2ecabb[_0x313c('0x19')]]['acw']||this[_0x313c('0x5')][_0x2ecabb[_0x313c('0x19')]]['mandatoryDisposition'])){if(this[_0x313c('0x6')][_0x2ecabb[_0x313c('0x18')]]){this[_0x313c('0x8')][_0x2ecabb['uniqueid']]={'queue':_0x2ecabb[_0x313c('0x19')],'interface':_0x2ecabb[_0x313c('0x18')],'destlinkedid':_0x2ecabb[_0x313c('0x22')]};}}}catch(_0x9c3620){logger[_0x313c('0x30')](_0x313c('0x3b'),_0x9c3620[_0x313c('0x36')]);}};Acw['prototype'][_0x313c('0x15')]=function(_0x2f6ef7){try{if(this[_0x313c('0x5')][_0x2f6ef7[_0x313c('0x19')]]&&(this['voiceQueues'][_0x2f6ef7[_0x313c('0x19')]][_0x313c('0x3c')]||this['voiceQueues'][_0x2f6ef7[_0x313c('0x19')]][_0x313c('0x1a')])){if(this[_0x313c('0x6')][_0x2f6ef7['interface']]){this['channels'][_0x2f6ef7[_0x313c('0x2e')]]={'queue':_0x2f6ef7[_0x313c('0x19')],'interface':_0x2f6ef7[_0x313c('0x18')]};}}}catch(_0x4add28){logger[_0x313c('0x30')](_0x313c('0x3d'),_0x4add28[_0x313c('0x36')]);}};Acw['prototype'][_0x313c('0xd')]=function(_0x23cc0a){try{if(this[_0x313c('0x8')][_0x23cc0a[_0x313c('0x2e')]]&&_[_0x313c('0x3e')](this[_0x313c('0x8')][_0x23cc0a[_0x313c('0x2e')]][_0x313c('0x3f')])){logger[_0x313c('0x24')](_0x313c('0x40'),_0x23cc0a[_0x313c('0x2e')]);this['startAcw'](_0x23cc0a[_0x313c('0x2e')]);}else if(this['channels'][_0x23cc0a[_0x313c('0x41')]]&&_['isUndefined'](this[_0x313c('0x8')][_0x23cc0a[_0x313c('0x41')]][_0x313c('0x3f')])){logger[_0x313c('0x24')](_0x313c('0x42'),_0x23cc0a[_0x313c('0x41')]);this[_0x313c('0x17')](_0x23cc0a[_0x313c('0x41')]);}}catch(_0x9bcb19){logger[_0x313c('0x30')]('[ACW][syncHangupRequest]\x20%s',_0x9bcb19[_0x313c('0x36')]);}};Acw[_0x313c('0x16')][_0x313c('0x43')]=function(_0x297d8f){try{if(this['channels'][_0x297d8f[_0x313c('0x2e')]]&&this[_0x313c('0x8')][_0x297d8f[_0x313c('0x2e')]]['attended']){logger[_0x313c('0x24')](_0x313c('0x44'),_0x297d8f[_0x313c('0x2e')]);this[_0x313c('0x17')](_0x297d8f[_0x313c('0x2e')]);}else if(this[_0x313c('0x8')][_0x297d8f['linkedid']]&&this['channels'][_0x297d8f[_0x313c('0x41')]][_0x313c('0x3f')]){logger[_0x313c('0x24')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x297d8f[_0x313c('0x41')]);this[_0x313c('0x17')](_0x297d8f[_0x313c('0x41')]);}}catch(_0x1da63d){logger['error'](_0x313c('0x45'),_0x1da63d[_0x313c('0x36')]);}};Acw['prototype']['syncAttendedTransfer']=function(_0xdfc820){try{if(!_['isNil'](this[_0x313c('0x8')][_0xdfc820[_0x313c('0x46')]])){this[_0x313c('0x17')](_0xdfc820[_0x313c('0x46')]);if(this[_0x313c('0x8')][_0xdfc820[_0x313c('0x47')]]){this[_0x313c('0x8')][_0xdfc820[_0x313c('0x47')]][_0x313c('0x3f')]=!![];this[_0x313c('0x8')][_0xdfc820[_0x313c('0x48')]]=this[_0x313c('0x8')][_0xdfc820['secondtransfereruniqueid']];delete this[_0x313c('0x8')][_0xdfc820[_0x313c('0x47')]];}}else if(!_[_0x313c('0x49')](this[_0x313c('0x8')][_0xdfc820[_0x313c('0x48')]])){this[_0x313c('0x17')](_0xdfc820[_0x313c('0x48')]);if(this[_0x313c('0x8')][_0xdfc820[_0x313c('0x4a')]]){this['channels'][_0xdfc820[_0x313c('0x4a')]]['attended']=!![];this[_0x313c('0x8')][_0xdfc820['transfereeuniqueid']]=this[_0x313c('0x8')][_0xdfc820[_0x313c('0x4a')]];delete this[_0x313c('0x8')][_0xdfc820[_0x313c('0x4a')]];}}}catch(_0x40f32e){logger[_0x313c('0x30')]('[ACW][syncAttendedTransfer]\x20%s',_0x40f32e[_0x313c('0x36')]);}};Acw['prototype'][_0x313c('0x13')]=function(_0xb218ed){try{if(this[_0x313c('0x8')][_0xb218ed[_0x313c('0x4b')]]){logger[_0x313c('0x24')](_0x313c('0x4c'),JSON[_0x313c('0x4d')](_0xb218ed[_0x313c('0x4b')]));this[_0x313c('0x17')](_0xb218ed[_0x313c('0x4b')]);}else if(this[_0x313c('0x8')][_0xb218ed[_0x313c('0x4e')]]){logger[_0x313c('0x24')](_0x313c('0x4f'),JSON[_0x313c('0x4d')](_0xb218ed[_0x313c('0x4e')]));this['startAcw'](_0xb218ed[_0x313c('0x4e')]);}}catch(_0x452c59){logger['error'](_0x313c('0x50'),_0x452c59[_0x313c('0x36')]);}};Acw[_0x313c('0x16')][_0x313c('0x10')]=function(_0x5eb1d7){try{if(this[_0x313c('0x5')][_0x5eb1d7[_0x313c('0x19')]]&&this[_0x313c('0x5')][_0x5eb1d7[_0x313c('0x19')]][_0x313c('0x51')]===_0x313c('0x52')){if(this['agents'][_0x5eb1d7[_0x313c('0x18')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x5eb1d7[_0x313c('0x2e')],_0x5eb1d7[_0x313c('0x18')],_0x5eb1d7['queue']);return RpcUser[_0x313c('0x23')](this[_0x313c('0x6')][_0x5eb1d7['interface']],_0x313c('0x53'),_0x5eb1d7[_0x313c('0x2e')]);}}}catch(_0x304406){logger[_0x313c('0x30')](_0x313c('0x54'),_0x304406[_0x313c('0x36')]);}};module[_0x313c('0x55')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 28816fc..4055938 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 _0x21da=['asterisk-manager','bluebird','util','../../config/logger','ami','../../config/environment','asterisk','password','keepConnected','Action','promisify','error','format','username','port','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','info','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionQueueSummary','catch','[ami.js][fullybooted]','exports'];(function(_0x22663b,_0xc8c6e3){var _0x310d0a=function(_0x151e66){while(--_0x151e66){_0x22663b['push'](_0x22663b['shift']());}};_0x310d0a(++_0xc8c6e3);}(_0x21da,0x190));var _0xa21d=function(_0xa72d2c,_0x13f8a5){_0xa72d2c=_0xa72d2c-0x0;var _0x409891=_0x21da[_0xa72d2c];return _0x409891;};'use strict';var Manager=require(_0xa21d('0x0'));var BPromise=require(_0xa21d('0x1'));var util=require(_0xa21d('0x2'));var logger=require(_0xa21d('0x3'))(_0xa21d('0x4'));var config=require(_0xa21d('0x5'));var ami=new Manager(config[_0xa21d('0x6')]['port'],config[_0xa21d('0x6')]['ip'],config[_0xa21d('0x6')]['username'],config['asterisk'][_0xa21d('0x7')],!![]);ami[_0xa21d('0x8')]();ami[_0xa21d('0x9')]=BPromise[_0xa21d('0xa')](ami['action']);function error(_0x4ca07d){logger[_0xa21d('0xb')](util[_0xa21d('0xc')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0xa21d('0x6')][_0xa21d('0xd')],config[_0xa21d('0x6')]['ip'],config[_0xa21d('0x6')][_0xa21d('0xe')],util[_0xa21d('0xf')](_0x4ca07d,![],null)));}function close(){logger[_0xa21d('0xb')](util[_0xa21d('0xc')](_0xa21d('0x10'),config[_0xa21d('0x6')][_0xa21d('0xd')],config[_0xa21d('0x6')]['ip'],config[_0xa21d('0x6')]['port']));}ami[_0xa21d('0x11')]=function(){return function(){return ami['Action']({'action':_0xa21d('0x12')});};};ami[_0xa21d('0x13')]=function(){return function(){return ami[_0xa21d('0x9')]({'action':'devicestatelist'});};};ami[_0xa21d('0x14')]=function(){return function(){return ami[_0xa21d('0x9')]({'action':_0xa21d('0x15')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0xa21d('0x9')]({'action':_0xa21d('0x16')});};};ami[_0xa21d('0x17')]=function(){return function(){return ami[_0xa21d('0x9')]({'action':_0xa21d('0x18')});};};function connect(){logger['info'](util['format'](_0xa21d('0x19'),config[_0xa21d('0x6')][_0xa21d('0xd')],config[_0xa21d('0x6')]['ip'],config[_0xa21d('0x6')]['port']));ami[_0xa21d('0x1a')](_0xa21d('0xb'),error);ami[_0xa21d('0x1a')](_0xa21d('0x1b'),close);}ami['on'](_0xa21d('0x1c'),connect);ami['on'](_0xa21d('0x1d'),function(_0x4f5d7f){logger['info'](util[_0xa21d('0xc')](_0xa21d('0x1e'),config[_0xa21d('0x6')][_0xa21d('0xd')],config[_0xa21d('0x6')]['ip'],config[_0xa21d('0x6')][_0xa21d('0xe')],util[_0xa21d('0xf')](_0x4f5d7f,![],null)));});ami['on'](_0xa21d('0x1f'),function(){logger[_0xa21d('0x20')](util['format'](_0xa21d('0x21'),config[_0xa21d('0x6')][_0xa21d('0xd')],config[_0xa21d('0x6')]['ip'],config[_0xa21d('0x6')]['port']));return Promise[_0xa21d('0x22')]()[_0xa21d('0x23')](ami[_0xa21d('0x11')]())['then'](ami[_0xa21d('0x13')]())['then'](ami['actionSipPeerStatus']())['then'](ami[_0xa21d('0x24')]())['then'](ami[_0xa21d('0x17')]())[_0xa21d('0x25')](function(_0x49d2f9){logger[_0xa21d('0xb')](_0xa21d('0x26'),util[_0xa21d('0xf')](_0x49d2f9,{'showHidden':![],'depth':null}));});});ami[_0xa21d('0x1a')]('error',error);ami[_0xa21d('0x1a')](_0xa21d('0x1b'),close);module[_0xa21d('0x27')]=ami; \ No newline at end of file +var _0x5889=['devicestatelist','actionSipPeerStatus','sippeerstatus','actionCoreShowChannels','coreshowchannels','info','username','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','actionQueueSummary','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','../../config/logger','../../config/environment','asterisk','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','Action'];(function(_0x166e96,_0x55191d){var _0x553d73=function(_0x586142){while(--_0x586142){_0x166e96['push'](_0x166e96['shift']());}};_0x553d73(++_0x55191d);}(_0x5889,0x1b7));var _0x9588=function(_0x121fb7,_0x214eb3){_0x121fb7=_0x121fb7-0x0;var _0x491e64=_0x5889[_0x121fb7];return _0x491e64;};'use strict';var Manager=require(_0x9588('0x0'));var BPromise=require(_0x9588('0x1'));var util=require('util');var logger=require(_0x9588('0x2'))('ami');var config=require(_0x9588('0x3'));var ami=new Manager(config[_0x9588('0x4')]['port'],config['asterisk']['ip'],config['asterisk']['username'],config[_0x9588('0x4')]['password'],!![]);ami['keepConnected']();ami['Action']=BPromise[_0x9588('0x5')](ami[_0x9588('0x6')]);function error(_0x5c1f29){logger[_0x9588('0x7')](util[_0x9588('0x8')](_0x9588('0x9'),config[_0x9588('0x4')]['username'],config[_0x9588('0x4')]['ip'],config['asterisk'][_0x9588('0xa')],util[_0x9588('0xb')](_0x5c1f29,![],null)));}function close(){logger[_0x9588('0x7')](util[_0x9588('0x8')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x9588('0x4')]['username'],config[_0x9588('0x4')]['ip'],config[_0x9588('0x4')][_0x9588('0xa')]));}ami[_0x9588('0xc')]=function(){return function(){return ami['Action']({'action':_0x9588('0xd')});};};ami[_0x9588('0xe')]=function(){return function(){return ami[_0x9588('0xf')]({'action':_0x9588('0x10')});};};ami[_0x9588('0x11')]=function(){return function(){return ami[_0x9588('0xf')]({'action':_0x9588('0x12')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':'queuesummary'});};};ami[_0x9588('0x13')]=function(){return function(){return ami[_0x9588('0xf')]({'action':_0x9588('0x14')});};};function connect(){logger[_0x9588('0x15')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x9588('0x4')][_0x9588('0x16')],config[_0x9588('0x4')]['ip'],config[_0x9588('0x4')]['port']));ami[_0x9588('0x17')](_0x9588('0x7'),error);ami[_0x9588('0x17')](_0x9588('0x18'),close);}ami['on'](_0x9588('0x19'),connect);ami['on'](_0x9588('0x1a'),function(_0x168eec){logger['info'](util[_0x9588('0x8')](_0x9588('0x1b'),config[_0x9588('0x4')][_0x9588('0x16')],config[_0x9588('0x4')]['ip'],config['asterisk'][_0x9588('0xa')],util[_0x9588('0xb')](_0x168eec,![],null)));});ami['on'](_0x9588('0x1c'),function(){logger['info'](util[_0x9588('0x8')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x9588('0x4')][_0x9588('0x16')],config[_0x9588('0x4')]['ip'],config[_0x9588('0x4')][_0x9588('0xa')]));return Promise[_0x9588('0x1d')]()[_0x9588('0x1e')](ami[_0x9588('0xc')]())['then'](ami[_0x9588('0xe')]())[_0x9588('0x1e')](ami[_0x9588('0x11')]())[_0x9588('0x1e')](ami[_0x9588('0x1f')]())[_0x9588('0x1e')](ami['actionCoreShowChannels']())[_0x9588('0x20')](function(_0x209f7c){logger[_0x9588('0x7')](_0x9588('0x21'),util[_0x9588('0xb')](_0x209f7c,{'showHidden':![],'depth':null}));});});ami[_0x9588('0x17')](_0x9588('0x7'),error);ami[_0x9588('0x17')](_0x9588('0x18'),close);module[_0x9588('0x22')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 38eba8d..a25454a 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 _0xac4a=['ami','client','http','then','debug','memberReport','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger'];(function(_0x4a4922,_0x82cb8f){var _0x55a8c6=function(_0x59712e){while(--_0x59712e){_0x4a4922['push'](_0x4a4922['shift']());}};_0x55a8c6(++_0x82cb8f);}(_0xac4a,0x13f));var _0xaac4=function(_0x3cbca8,_0x5c2c23){_0x3cbca8=_0x3cbca8-0x0;var _0x449bd9=_0xac4a[_0x3cbca8];return _0x449bd9;};'use strict';var jayson=require(_0xaac4('0x0'));var BPromise=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var client=jayson[_0xaac4('0x4')][_0xaac4('0x5')]({'port':0x2329});client['Request']=function(_0x58626e,_0x2af0f6){return new BPromise(function(_0x2a5762,_0x32d34c){return client['request'](_0x58626e,_0x2af0f6)[_0xaac4('0x6')](function(_0x53d03a){logger[_0xaac4('0x7')]('rpc',_0xaac4('0x8'),_0x58626e,_0x2af0f6,_0x53d03a);if(_0x53d03a[_0xaac4('0x9')]){logger['error']('rpc',_0xaac4('0x8'),_0x58626e,_0x53d03a['error'][_0xaac4('0xa')],_0x2af0f6);return _0x32d34c(_0x53d03a['error']['message']);}else{return _0x2a5762(_0x53d03a[_0xaac4('0xb')]);}})[_0xaac4('0xc')](function(_0x38d1d0){logger[_0xaac4('0x9')](_0xaac4('0xd'),'memberReport',_0x58626e,_0x38d1d0,_0x2af0f6);return _0x32d34c(_0x38d1d0);});});};module['exports']=client; \ No newline at end of file +var _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0x22ae56,_0x16955c){var _0x1544f5=function(_0x2d525f){while(--_0x2d525f){_0x22ae56['push'](_0x22ae56['shift']());}};_0x1544f5(++_0x16955c);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1712c1,_0x2e1794){_0x1712c1=_0x1712c1-0x0;var _0x5af172=_0xb43b[_0x1712c1];return _0x5af172;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 03c553c..9c8e9c5 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 _0x906c=['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','erlangBusyFactor','erlangAbandonmentRate','merge','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','checkContactLowerLimitOriginate','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','\x20INTERVAL_IS_NULL','Intervals','NULL_INTERVAL','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','DISACTIVED','[ifTime][Action]','Error','isTrunkReachable','active','trunks','status','reachable','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTimeIntervals','ifTimeIvr','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','ifTime','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','Action','iftime\x20%s,%s','interval','timezones','true','catch','push','command','then','indexOf','all','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','Global:\x20','\x20Interval\x20is\x20overtime:\x20','resetActiveCalls','syncCampaigns','isIVRCampaignActive','checkIfTime','dialGlobalInterval','dialTimezone','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','method\x20not\x20recognized','silly','Voice\x20Queue\x20%s\x20$s','[ifTime][promiseAll]','Timezone:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','queue','uniqueid','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','type','outboundAnswerCallsDay','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','droptime','getSeconds','responsetime','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','countdropretry','countglobal','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','dialDropRetryFrequency','ContactId','ListId','VoiceQueueId','[rescheduleContact][Drop]','calleridname','calleridnum','swapAdditionalPhones','outboundDropCallsDayCallersExit','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','dialAbandonedMaxRetry','CampaignId','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','idHopper','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBooked','_rr','unlockRR','[booked][RR]','[booked][RR][finaly]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','getQueue','response','Success','callProgressDetecting','variable','amdstatus','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','buildObj','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','reason19\x20machine....','reason\x2019\x20machine....','minutes','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','resolve','available','inUse','talking','pTalking','[syncQueueSummary]','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','filter','dialPreviewRecallmeReminder','handlePreviewRecallNotifications','map','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','[uniqueid]','clearZombieChannels','[actions]','undefined','enqueue','No\x20such\x20channel','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','Agent','launchHandleIvr','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','isOutboundQueue','XMD-CAMPAIGNID','setXMDContactVariables','Contact','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdName','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','trim','dialCutDigit','dialPrefix','substring','xcally-motion-dialer','dialOriginateTimeout','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','evt\x20is\x20undefine','verifyAdditionalPhones','reason','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','reason\x205\x20busy','outboundCongestionCallsDay','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','Abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[callProgressDetecting]','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','predictiveIntervalHitRate','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','agentBusyFactor','dialPredictiveOptimizationPercentage','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','dialRecallMeTimeout','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','temp','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','checkIsBlackListIvr','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','getContactDialer','[countReScheduled]\x20','checkIsBlackList','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','dialOrderByScheduledAt','countReScheduled','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','util','lodash','uuid','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/interval','./models/history','./models/final','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','agentcomplete','custom:queuesummary','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','getSettings','isUndefined','emit','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','name','isEmpty','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','predictiveIntervalTotalCalls','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','erlangCallToSecond'];(function(_0x300a26,_0x1ad864){var _0x43bccd=function(_0x112388){while(--_0x112388){_0x300a26['push'](_0x300a26['shift']());}};_0x43bccd(++_0x1ad864);}(_0x906c,0x1c3));var _0xc906=function(_0x47fae3,_0x5e1ab6){_0x47fae3=_0x47fae3-0x0;var _0x51e4d8=_0x906c[_0x47fae3];return _0x51e4d8;};'use strict';var util=require(_0xc906('0x0'));var _=require(_0xc906('0x1'));var uuid=require(_0xc906('0x2'));var moment=require(_0xc906('0x3'));var rr=require('rr');var Redis=require(_0xc906('0x4'));var utils=require(_0xc906('0x5'));var hopperUtils=require(_0xc906('0x6'));var ut=require(_0xc906('0x7'));var config=require(_0xc906('0x8'));var logger=require(_0xc906('0x9'))(_0xc906('0xa'));var loggerBooked=require('../../../config/logger')(_0xc906('0xb'));var loggerPredictive=require('../../../config/logger')(_0xc906('0xc'));var loggerPredictiveCalls=require(_0xc906('0x9'))(_0xc906('0xd'));var loggerSyncQueueSummary=require(_0xc906('0x9'))('syncQueueSummary');var ami=require(_0xc906('0xe'));config[_0xc906('0xf')]=_[_0xc906('0x10')](config['redis'],{'host':_0xc906('0x11'),'port':0x18eb});var io=require(_0xc906('0x12'))(new Redis(config['redis']));var cmHopper=require(_0xc906('0x13'));var voiceQueueRt=require(_0xc906('0x14'));var RpcSetting=require('../rpc/setting');var Interval=require(_0xc906('0x15'));var Action=require('./models/action');var History=require(_0xc906('0x16'));var Final=require(_0xc906('0x17'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require(_0xc906('0x18'));var ipAgi=process[_0xc906('0x19')][_0xc906('0x1a')]||_0xc906('0x1b');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xc906('0x1c')]['enqueue']=function(_0x3bd116){this[_0xc906('0x1d')]=this[_0xc906('0x1d')]?this[_0xc906('0x1d')][_0xc906('0x1e')](_0x3bd116):_0x3bd116();};function Dialer(_0x1b91b2,_0x558d6d){this[_0xc906('0x1f')]=new Sequence();this[_0xc906('0x20')]=_0x558d6d;this[_0xc906('0x21')]=_0x1b91b2[_0xc906('0x21')];this[_0xc906('0x22')]=_0x1b91b2[_0xc906('0x22')];this[_0xc906('0x23')]=_0x1b91b2['agents'];this['trunks']=_0x1b91b2['trunks'];this[_0xc906('0x24')]=config['maxNumberOriginate']||0x2;this[_0xc906('0x25')]={};this[_0xc906('0x26')]={};this[_0xc906('0x27')]={};this[_0xc906('0x28')]={};this[_0xc906('0x29')]={};this[_0xc906('0x2a')]={};this[_0xc906('0x2b')]={};this[_0xc906('0x2c')]={};this['queueBooked']={};this[_0xc906('0x2d')]={};this[_0xc906('0x2e')]={};ami['on'](_0xc906('0x2f'),this[_0xc906('0x30')][_0xc906('0x31')](this));ami['on'](_0xc906('0x32'),this[_0xc906('0x33')][_0xc906('0x31')](this));ami['on'](_0xc906('0x34'),this['syncOriginateResponse'][_0xc906('0x31')](this));ami['on'](_0xc906('0x35'),this['syncAgentComplete'][_0xc906('0x31')](this));ami['on'](_0xc906('0x36'),this[_0xc906('0x37')][_0xc906('0x31')](this));ami['on'](_0xc906('0x38'),this[_0xc906('0x39')]['bind'](this));ami['on']('hangup',this['syncHangup'][_0xc906('0x31')](this));ami['on'](_0xc906('0x3a'),this[_0xc906('0x3b')]['bind'](this));ami['on'](_0xc906('0x3c'),this[_0xc906('0x3d')][_0xc906('0x31')](this));ami['on'](_0xc906('0x3e'),this[_0xc906('0x3f')][_0xc906('0x31')](this));ami['on'](_0xc906('0x40'),this[_0xc906('0x41')][_0xc906('0x31')](this));this[_0xc906('0x42')]();this['loopClearZombieChannels']();RpcSetting[_0xc906('0x43')]()['then'](function(_0x471850){previewRecallmeReminderInterval=_0x471850['previewRecallmeReminderInterval'];});}function isNotNull(_0x2956a3){return _0x2956a3!==null&&!_[_0xc906('0x44')](_0x2956a3);}function msgResponse(_0x48aee9,_0x16d6a1,_0x4457e1){return{'action':_0x48aee9,'response':_0x16d6a1,'message':_0x4457e1,'stack':_0x4457e1};}function emit(_0x241ed7,_0xd981b2,_0xec0b1d){io['to'](_0x241ed7)[_0xc906('0x45')](_0xd981b2,_0xec0b1d);}function emitOutboundVoiceQueueSummary(_0x191d98){if(_0x191d98['type']==='outbound'){logger[_0xc906('0x46')](_0xc906('0x47'),util[_0xc906('0x48')](_0x191d98,{'showHidden':![],'depth':null}));emit(util[_0xc906('0x49')]('voice:queue:%s',_0x191d98[_0xc906('0x4a')]),'voice_queue:save',_0x191d98);}}function checkGetDataPredictive(_0x52e5fa){if(isNotNull(_0x52e5fa)&&!_[_0xc906('0x4b')](_0x52e5fa)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive['info'](_0xc906('0x4c'),_0x52e5fa['predictiveIntervalTotalCalls']);loggerPredictive[_0xc906('0x4d')](_0xc906('0x4e'),_0x52e5fa['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xc906('0x4d')](_0xc906('0x4f'),_0x52e5fa[_0xc906('0x50')]);loggerPredictive[_0xc906('0x4d')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x52e5fa[_0xc906('0x51')]);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x52e5fa[_0xc906('0x52')]);loggerPredictive[_0xc906('0x4d')](_0xc906('0x53'),_0x52e5fa[_0xc906('0x54')]);loggerPredictive[_0xc906('0x4d')](_0xc906('0x55'));if(_0x52e5fa[_0xc906('0x56')]>0x0){if(!_[_0xc906('0x44')](_0x52e5fa[_0xc906('0x54')])&&_0x52e5fa[_0xc906('0x54')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x52e5fa['predictiveIntervalAvgHoldtime'])&&_0x52e5fa[_0xc906('0x52')]>0x0){return!![];}loggerPredictive[_0xc906('0x4d')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xc906('0x4d')](_0xc906('0x57'));}}else{loggerPredictive[_0xc906('0x4d')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0xd5f9d9){return function(_0x4c1910){loggerPredictive[_0xc906('0x4d')](_0xc906('0x58'));loggerPredictive[_0xc906('0x4d')](_0xc906('0x59'),_0x4c1910[_0xc906('0x5a')]);loggerPredictive['info']('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4c1910[_0xc906('0x5b')]);loggerPredictive[_0xc906('0x4d')](_0xc906('0x5c'),_0x4c1910['erlangAbandonmentRate']);loggerPredictive['info'](_0xc906('0x5d'),_0x4c1910[_0xc906('0x5e')]);loggerPredictive[_0xc906('0x4d')](_0xc906('0x5c'),_0x4c1910[_0xc906('0x5f')]);loggerPredictive[_0xc906('0x4d')](_0xc906('0x55'));_[_0xc906('0x60')](_0xd5f9d9,_0x4c1910);};}function ifInterval(_0x5783ac,_0x2c99bd){if(_['isUndefined'](_0x2c99bd)){return![];}return utils['getSeconds'](undefined,_0x2c99bd)<_0x5783ac*0x3c;}function clearPredictiveAttributes(_0x23cf81){if(_0x23cf81[_0xc906('0x2b')]){_0x23cf81[_0xc906('0x2b')]=undefined;loggerPredictive[_0xc906('0x46')](_0x23cf81[_0xc906('0x4a')],'startProgressive\x20value\x20cleared');}if(_0x23cf81['startPredictive']){_0x23cf81[_0xc906('0x2a')]=undefined;loggerPredictive[_0xc906('0x46')](_0x23cf81[_0xc906('0x4a')],_0xc906('0x61'));}if(_0x23cf81[_0xc906('0x62')]){clearInterval(_0x23cf81['handlePredictive']);_0x23cf81[_0xc906('0x62')]=undefined;loggerPredictive[_0xc906('0x46')](_0x23cf81[_0xc906('0x4a')],_0xc906('0x63'));}}function loggerCatchPredictive(_0x2d9dae,_0xd0c4cb){return function(_0x307766){loggerPredictive['error'](_0xd0c4cb[_0xc906('0x4a')],_0x2d9dae);loggerPredictive[_0xc906('0x64')](_0x307766['stack']);clearPredictiveAttributes(_0xd0c4cb);};}function loggerCatch(_0x168d87){return function(_0x85b5f4){logger['error'](_0x168d87,util[_0xc906('0x48')](_0x85b5f4,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x3e9e50,_0x56e4e5,_0x54bf5c){return function(_0x287299){utils[_0xc906('0x65')](_0x56e4e5,_0x54bf5c,0x0);logger[_0xc906('0x64')](_0x3e9e50,util['inspect'](_0x287299,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1ab6f7){return function(_0x5779f2){if(isNotNull(_0x5779f2)&&isNotNull(_0x5779f2[0x0])){if(_0x5779f2[0x0]['contactsRescheduled']>0x0){_0x1ab6f7[_0xc906('0x66')]=utils[_0xc906('0x67')][_0xc906('0x68')];logger[_0xc906('0x4d')](_0xc906('0x69')+_0x1ab6f7['name'],_0x5779f2[0x0][_0xc906('0x6a')],_0xc906('0x6b'));}else{_0x1ab6f7[_0xc906('0x66')]=utils[_0xc906('0x67')][_0xc906('0x6c')];logger[_0xc906('0x4d')](_0xc906('0x6d')+_0x1ab6f7[_0xc906('0x4a')]);}}};}function createObjHistory(_0x3fd27e,_0x49ef74,_0x31f3a3,_0x38858b,_0xf56611){_0x3fd27e[_0xc906('0x66')]=_0x31f3a3;var _0x548856=new Action(_0x3fd27e,_0x49ef74);var _0x3bbfb0=new History(_0x548856);_0x3bbfb0[_0xc906('0x6e')]=_0x38858b;_0x3bbfb0[_0xc906('0x6f')]=_0xf56611;_0x3bbfb0[_0xc906('0x70')]=_0x548856[_0xc906('0x71')];return _0x3bbfb0;}function unlockQueueStatus(_0x8c5f2e,_0x62fa9c){setTimeout(function(){if(_[_0xc906('0x44')](_0x8c5f2e[_0xc906('0x72')])){loggerBooked['error'](_0xc906('0x73'),_0x62fa9c);}_0x8c5f2e[_0xc906('0x72')]=!![];loggerBooked[_0xc906('0x4d')](_0xc906('0x74'),_0x62fa9c,JSON[_0xc906('0x75')](_[_0xc906('0x76')](_0x8c5f2e,[_0xc906('0x4a'),_0xc906('0x72')])));},0x1f3);}function checkInterval(_0x5a1ea5){return function(){if(!isNotNull(_0x5a1ea5[_0xc906('0x77')])){_0x5a1ea5[_0xc906('0x66')]=utils[_0xc906('0x67')]['NULL_INTERVAL'];throw _0x5a1ea5[_0xc906('0x4a')]+_0xc906('0x78');}if(!isNotNull(_0x5a1ea5[_0xc906('0x77')][_0xc906('0x79')])){_0x5a1ea5[_0xc906('0x66')]=utils['CAMPAIGN_STATUS'][_0xc906('0x7a')];throw _0x5a1ea5[_0xc906('0x4a')]+_0xc906('0x78');}if(!isNotNull(_[_0xc906('0x4b')](_0x5a1ea5['Interval'][_0xc906('0x79')]))){_0x5a1ea5[_0xc906('0x66')]=utils[_0xc906('0x67')]['NULL_INTERVAL'];throw _0x5a1ea5[_0xc906('0x4a')]+_0xc906('0x78');}};}function checkIsIVRCampaignActive(_0x731011){return function(){if(!utils['isIVRCampaignActive'](_0x731011)){_0x731011['message']=utils['CAMPAIGN_STATUS'][_0xc906('0x7b')];throw _0x731011[_0xc906('0x4a')]+_0xc906('0x7c');}};}function emitCampaignSummary(_0x56b980){if(utils[_0xc906('0x7d')](_0x56b980)){emit(util['format']('campaign:ivr:%s',_0x56b980[_0xc906('0x4a')]),_0xc906('0x7e'),_0x56b980);}}function loggerCatchQueueSummary(_0x497271,_0x564b8f){return function(_0x51426d){clearPredictiveAttributes(_0x564b8f);emitCampaignSummary(_0x564b8f);loggerSyncQueueSummary[_0xc906('0x46')](_0x497271,util[_0xc906('0x48')](_0x51426d,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x390659){if(_0x390659[_0xc906('0x7f')]){if(_0x390659[_0xc906('0x80')]===0x0){_0x390659[_0xc906('0x7f')]=![];_0x390659['message']=utils[_0xc906('0x67')]['INACTIVE'];loggerSyncQueueSummary['debug'](_0xc906('0x81'),_0x390659[_0xc906('0x4a')],'is\x20not\x20active');}else{_0x390659['message']=utils[_0xc906('0x67')][_0xc906('0x82')];loggerSyncQueueSummary[_0xc906('0x46')](_0xc906('0x81'),_0x390659[_0xc906('0x4a')],'is\x20disactive');}emitCampaignSummary(_0x390659);}}function myreject(_0x586078){return function(_0x2c427b){return _0x586078(msgResponse(_0xc906('0x83'),_0xc906('0x84'),JSON['stringify'](_0x2c427b)));};}Dialer[_0xc906('0x1c')][_0xc906('0x85')]=function(_0x366d36){return!_[_0xc906('0x44')](_0x366d36)&&_0x366d36&&!_['isUndefined'](_0x366d36['name'])&&!_[_0xc906('0x44')](_0x366d36[_0xc906('0x86')])&&_0x366d36['active']&&(this[_0xc906('0x87')][util[_0xc906('0x49')]('SIP/%s',_0x366d36['name'])][_0xc906('0x88')]===_0xc906('0x89')||this[_0xc906('0x87')][util[_0xc906('0x49')]('SIP/%s',_0x366d36[_0xc906('0x4a')])][_0xc906('0x88')]===_0xc906('0x8a'));};Dialer[_0xc906('0x1c')][_0xc906('0x8b')]=function(_0x48987e){var _0x2bf823=this;return function(){if(!_0x2bf823[_0xc906('0x85')](_0x48987e[_0xc906('0x8c')])){if(!_0x2bf823['isTrunkReachable'](_0x48987e[_0xc906('0x8d')])){_0x48987e[_0xc906('0x66')]=utils['CAMPAIGN_STATUS']['TRUNK_NOT_REACHABLE'];throw _0x48987e[_0xc906('0x4a')]+_0xc906('0x8e');}}};};Dialer[_0xc906('0x1c')]['checkIfTime']=function(_0x5f24eb,_0x26d46a,_0x440a47,_0x5cb0ef){var _0x5ce716=this;return function(){var _0xb2f4f7=!![];return _0x5ce716['ifTimeIvr'](_0x5f24eb,_0x26d46a,_0x440a47,_0x5cb0ef,_0xb2f4f7);};};Dialer[_0xc906('0x1c')][_0xc906('0x8f')]=function(_0x3d9ef9,_0x2d4ae1,_0x52ecb2,_0x3a1883){var _0x139d6d=this;return function(){var _0x274aa8=![];return _0x139d6d[_0xc906('0x90')](_0x3d9ef9[_0xc906('0x79')],_0x2d4ae1,_0x52ecb2,_0x3a1883,_0x274aa8);};};Dialer[_0xc906('0x1c')][_0xc906('0x90')]=function(_0x36d03c,_0x1c4141,_0x3cc735,_0x117940,_0x26314e){var _0x376d90=[];return new Promise(function(_0x548873,_0x28e7b5){if(!isNotNull(_0x36d03c)){_0x117940['message']=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];return _0x28e7b5(msgResponse('ifTime',_0xc906('0x91'),_0x3cc735+_0xc906('0x92')));}if(_['isEmpty'](_0x36d03c)){_0x117940['message']=utils['CAMPAIGN_STATUS'][_0xc906('0x93')];return _0x28e7b5(msgResponse(_0xc906('0x94'),_0xc906('0x91'),_0x3cc735+_0xc906('0x95')));}if(_0x1c4141&&_[_0xc906('0x44')](config['timezones'][_0x1c4141])){_0x117940[_0xc906('0x66')]=utils[_0xc906('0x67')][_0xc906('0x96')];return _0x28e7b5(msgResponse(_0xc906('0x94'),_0xc906('0x91'),_0x3cc735+_0xc906('0x97')+_0x1c4141));}if(_[_0xc906('0x98')](_0x36d03c)){for(var _0x3b581e=0x0;_0x3b581e<_0x36d03c[_0xc906('0x99')];_0x3b581e+=0x1){_0x376d90['push'](ami[_0xc906('0x9a')]({'action':'command','command':util[_0xc906('0x49')](_0xc906('0x9b'),_0x36d03c[_0x3b581e][_0xc906('0x9c')],!_['isUndefined'](config[_0xc906('0x9d')][_0x1c4141])?_0x1c4141:'')})['then'](function(_0x3437d2){return _0x3437d2['content']['indexOf'](_0xc906('0x9e'))>=0x0;})[_0xc906('0x9f')](myreject(_0x28e7b5)));}}else{_0x376d90[_0xc906('0xa0')](ami['Action']({'action':_0xc906('0xa1'),'command':util[_0xc906('0x49')](_0xc906('0x9b'),_0x36d03c,!_['isUndefined'](config[_0xc906('0x9d')][_0x1c4141])?_0x1c4141:'')})[_0xc906('0xa2')](function(_0x15583f){return _0x15583f['content'][_0xc906('0xa3')]('true')>=0x0;})[_0xc906('0x9f')](myreject(_0x28e7b5)));}Promise[_0xc906('0xa4')](_0x376d90)[_0xc906('0xa2')](function(_0x3f6e63){var _0x5a3f7a=_['some'](_0x3f6e63);if(_0x5a3f7a){return _0x548873(_0x5a3f7a);}else{_0x117940[_0xc906('0x66')]=_0x26314e?utils[_0xc906('0x67')][_0xc906('0xa5')]:utils['CAMPAIGN_STATUS'][_0xc906('0xa6')];return _0x28e7b5(msgResponse('[ifTime][promiseAll]',_0xc906('0x91'),_0xc906('0xa7')+_0x26314e+'\x20'+_0x3cc735+_0xc906('0xa8')+util['inspect'](_0x36d03c,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x1c4141));}})[_0xc906('0x9f')](function(_0x45e712){return _0x28e7b5(msgResponse('ifTime',_0xc906('0x91'),JSON['stringify'](_0x45e712)));});});};Dialer[_0xc906('0x1c')][_0xc906('0x42')]=function(){var _0x4d9df2=this;return cmHopper[_0xc906('0xa9')]({'active':![]},{'where':{'active':!![]}})[_0xc906('0xa2')](function(){setInterval(function(){_0x4d9df2[_0xc906('0xaa')]();},0x3e8);});};Dialer[_0xc906('0x1c')]['syncCampaigns']=function(){var _0x188720=this;var _0x5418fe;for(var _0x109fc8 in this['campaigns']){if(typeof this[_0xc906('0x22')][_0x109fc8]!=='undefined'){_0x5418fe=this[_0xc906('0x22')][_0x109fc8];if(utils[_0xc906('0x7d')](_0x5418fe)&&utils[_0xc906('0xab')](_0x5418fe)){_0x5418fe[_0xc906('0x7f')]=!![];Promise['resolve']()['then'](checkIsIVRCampaignActive(_0x5418fe))[_0xc906('0xa2')](checkInterval(_0x5418fe))[_0xc906('0xa2')](_0x188720['checkIsTrunkReachable'](_0x5418fe))[_0xc906('0xa2')](_0x188720[_0xc906('0xac')](_0x5418fe[_0xc906('0xad')],_0x5418fe[_0xc906('0xae')],_0x5418fe[_0xc906('0x4a')],_0x5418fe))[_0xc906('0xa2')](_0x188720['checkIfTimeIntervals'](_0x5418fe['Interval'],_0x5418fe['dialTimezone'],_0x5418fe['name'],_0x5418fe))[_0xc906('0xa2')](_0x188720['launchHandleIvr'](_0x5418fe))[_0xc906('0x9f')](loggerCatchQueueSummary(_0xc906('0xaf'),_0x5418fe));}else{notSendMessagesCampaign(_0x5418fe);}}}};Dialer[_0xc906('0x1c')][_0xc906('0xb0')]=function(_0x2364c6){if(_0x2364c6[_0xc906('0xb1')]!==_0xc906('0xc')){clearPredictiveAttributes(_0x2364c6);}switch(_0x2364c6[_0xc906('0xb1')]){case _0xc906('0xb2'):this[_0xc906('0xb3')](_0x2364c6,0x1);break;case _0xc906('0xb4'):this[_0xc906('0xb3')](_0x2364c6,_0x2364c6[_0xc906('0xb5')]);break;case'predictive':this['predictive'](_0x2364c6);break;case'booked':this['handlePower'](_0x2364c6,0x1);break;default:logger[_0xc906('0x64')]('Queue',_0x2364c6[_0xc906('0x4a')],_0xc906('0xb6'));}};Dialer['prototype'][_0xc906('0x94')]=function(_0x33bdf9,_0x253c93){var _0x5ccfdf=_0x33bdf9['dialTimezone'];var _0x51411c=_0x253c93?_0x33bdf9[_0xc906('0xad')]:_0x33bdf9[_0xc906('0x77')][_0xc906('0x79')];logger[_0xc906('0xb7')]('Dialer::ifTime()',_0x51411c,_0x5ccfdf,_0x33bdf9[_0xc906('0x4a')],util[_0xc906('0x49')](_0xc906('0xb8'),_0x33bdf9[_0xc906('0x4a')],_0x33bdf9['id']));var _0xead379=null;return Interval['intervalIftime'](_0x51411c,_0x5ccfdf)[_0xc906('0xa2')](function(_0x452581){if(_0x452581===!![]){return _0x452581;}else{_0x33bdf9[_0xc906('0x66')]=_0x253c93?utils[_0xc906('0x67')][_0xc906('0xa5')]:utils['CAMPAIGN_STATUS']['OVERTIME_INTERVAL'];_0xead379=msgResponse(_0xc906('0xb9'),_0xc906('0x91'),_0xc906('0xa7')+_0x253c93+'\x20'+_0x33bdf9[_0xc906('0x4a')]+_0xc906('0xa8')+util[_0xc906('0x48')](_0x51411c,{'showHidden':![],'depth':null})+_0xc906('0xba')+_0x5ccfdf);}if(_0xead379!==null){logger[_0xc906('0xb7')](_0xc906('0xbb'),_0xead379);_0xead379[_0xc906('0xbc')]=_0x253c93;throw _0xead379;}})[_0xc906('0x9f')](function(_0xfd7e95){logger[_0xc906('0x64')]('AMI\x20IfTime',_0xfd7e95);throw msgResponse(_0xc906('0x83'),'Error',util['inspect'](_0xfd7e95,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0xc906('0x30')]=function(_0x101151){if(this[_0xc906('0x21')][_0x101151[_0xc906('0xbd')]]){if(this[_0xc906('0x28')][_0x101151[_0xc906('0xbe')]]&&this['uniqueId'][_0x101151[_0xc906('0xbe')]]['type']!==_0xc906('0xbf')){this[_0xc906('0xc0')](this[_0xc906('0x21')][_0x101151['queue']]);this[_0xc906('0x28')][_0x101151[_0xc906('0xbe')]][_0xc906('0xc1')]=moment()[_0xc906('0x49')](_0xc906('0xc2'));}}};Dialer[_0xc906('0x1c')]['syncAgentComplete']=function(_0x42ee54){var _0x5ba945=this[_0xc906('0x28')][_0x42ee54['uniqueid']];if(this['voiceQueues'][_0x42ee54[_0xc906('0xbd')]]){if(_0x5ba945&&_0x5ba945[_0xc906('0xc3')]!==_0xc906('0xbf')){delete this['uniqueId'][_0x42ee54[_0xc906('0xbe')]];this[_0xc906('0x21')][_0x42ee54[_0xc906('0xbd')]][_0xc906('0xc4')]+=0x1;var _0x4732fa=new AgentComplete(_0x5ba945,_0x42ee54);if(_0x42ee54['reason']===_0xc906('0xc5')){_0x4732fa[_0xc906('0xc6')]=this[_0xc906('0x21')][_0x42ee54['queue']][_0xc906('0xc7')]&&this[_0xc906('0x21')][_0x42ee54[_0xc906('0xbd')]][_0xc906('0xc8')]?moment()[_0xc906('0x49')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils[_0xc906('0xc9')](_0x4732fa)['catch'](loggerCatch(_0xc906('0xca')));hopperUtils[_0xc906('0xcb')](_0x4732fa)['catch'](loggerCatch(_0xc906('0xcc')));}}};Dialer[_0xc906('0x1c')][_0xc906('0x33')]=function(_0x1acc15){var _0xbe7a11=this[_0xc906('0x28')][_0x1acc15[_0xc906('0xbe')]];var _0x472909=this;var _0x3b4659=![];var _0x3e3bbd;var _0x1b45f3;if(this['voiceQueues'][_0x1acc15[_0xc906('0xbd')]]){if(_0xbe7a11&&_0xbe7a11[_0xc906('0xc3')]!==_0xc906('0xbf')){delete this[_0xc906('0x28')][_0x1acc15[_0xc906('0xbe')]];this[_0xc906('0xc0')](this[_0xc906('0x21')][_0x1acc15[_0xc906('0xbd')]]);_0xbe7a11[_0xc906('0xcd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x35354a=new QueueCallerAbandon(_0xbe7a11,_0x1acc15);if(utils[_0xc906('0xce')](_0xbe7a11['droptime'],_0xbe7a11[_0xc906('0xcf')])>=_0xbe7a11['dialQueueTimeout']){this[_0xc906('0x21')][_0x1acc15[_0xc906('0xbd')]][_0xc906('0x50')]+=0x1;this[_0xc906('0x21')][_0x1acc15[_0xc906('0xbd')]][_0xc906('0xd0')]+=0x1;this[_0xc906('0x21')][_0x1acc15[_0xc906('0xbd')]][_0xc906('0xd1')]+=0x1;_0x35354a['state']=0xa;_0x35354a[_0xc906('0x6f')]=_0xc906('0xd2');_0x35354a[_0xc906('0xd3')]=_0xc906('0xd4');_0x35354a[_0xc906('0xc6')]=this['voiceQueues'][_0x1acc15[_0xc906('0xbd')]]['dialQueueProject2']?moment()[_0xc906('0x49')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x35354a[_0xc906('0xd5')]+=0x1;_0x35354a[_0xc906('0xd6')]+=0x1;_0x3e3bbd=this[_0xc906('0x21')][_0x1acc15['queue']]['dialDropRetryFrequency'];_0x1b45f3=this[_0xc906('0x21')][_0x1acc15[_0xc906('0xbd')]]['callAdditionalPhoneAfterMin'];hopperUtils['verifyAdditionalPhones'](_0x35354a,_0x35354a[_0xc906('0x6e')],_0xbe7a11[_0xc906('0xd7')])['then'](function(_0xf331d8){_0x3b4659=_0xf331d8[_0xc906('0xd8')]==0x1;if(_0x35354a['countdropretry']>=_0x472909[_0xc906('0x21')][_0x1acc15['queue']][_0xc906('0xd9')]){_0x472909[_0xc906('0xda')](_0x35354a,_0xf331d8['additional']);}else{hopperUtils[_0xc906('0xdb')]({'active':![],'countdropretry':_0x35354a['countdropretry'],'scheduledat':moment()[_0xc906('0xdc')](_0x472909[_0xc906('0x21')][_0x1acc15[_0xc906('0xbd')]][_0xc906('0xdd')],'minutes')[_0xc906('0x49')](_0xc906('0xc2')),'ContactId':_0xbe7a11[_0xc906('0xde')],'ListId':_0xbe7a11[_0xc906('0xdf')],'VoiceQueueId':_0xbe7a11[_0xc906('0xe0')]||undefined,'CampaignId':_0xbe7a11['CampaignId']||undefined})['catch'](loggerCatch(_0xc906('0xe1')));var _0x5373de=new History(_0x35354a);_0x5373de[_0xc906('0x6e')]=0xa;_0x5373de[_0xc906('0x6f')]='Drop';_0x5373de[_0xc906('0x71')]=moment()[_0xc906('0x49')](_0xc906('0xc2'));_0x5373de[_0xc906('0x70')]=_0x5373de[_0xc906('0x71')];_0x5373de[_0xc906('0xe2')]=_0x35354a[_0xc906('0xe2')];_0x5373de[_0xc906('0xe3')]=_0x35354a[_0xc906('0xe3')];hopperUtils[_0xc906('0xc9')](_0x5373de)[_0xc906('0x9f')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0xc906('0xa2')](function(){if(_0x3b4659)hopperUtils[_0xc906('0xe4')](_0x35354a,_0x3e3bbd,_0x1b45f3)[_0xc906('0xa2')](function(){return 0x1;});});}else{this['voiceQueues'][_0x1acc15[_0xc906('0xbd')]][_0xc906('0x51')]+=0x1;this['voiceQueues'][_0x1acc15[_0xc906('0xbd')]][_0xc906('0xe5')]+=0x1;_0x35354a[_0xc906('0x6e')]=0xb;_0x35354a[_0xc906('0x6f')]='Abandoned';_0x35354a[_0xc906('0xd3')]=_0xc906('0xe6');_0x35354a[_0xc906('0xe7')]+=0x1;_0x35354a[_0xc906('0xd6')]+=0x1;_0x3e3bbd=this['voiceQueues'][_0x1acc15[_0xc906('0xbd')]][_0xc906('0xe8')];_0x1b45f3=this[_0xc906('0x21')][_0x1acc15['queue']][_0xc906('0xe9')];hopperUtils['verifyAdditionalPhones'](_0x35354a,_0x35354a['state'],_0xbe7a11['voiceQueue'])['then'](function(_0x562573){if(_0x35354a[_0xc906('0xe7')]>=_0x472909[_0xc906('0x21')][_0x1acc15['queue']][_0xc906('0xea')]){_0x472909[_0xc906('0xda')](_0x35354a,_0x562573[_0xc906('0xd8')]);}else{hopperUtils[_0xc906('0xdb')]({'active':![],'countabandonedretry':_0x35354a[_0xc906('0xe7')],'scheduledat':moment()['add'](_0x472909[_0xc906('0x21')][_0x1acc15[_0xc906('0xbd')]][_0xc906('0xe8')],'minutes')[_0xc906('0x49')](_0xc906('0xc2')),'ContactId':_0xbe7a11[_0xc906('0xde')],'ListId':_0xbe7a11[_0xc906('0xdf')],'VoiceQueueId':_0xbe7a11[_0xc906('0xe0')]||undefined,'CampaignId':_0xbe7a11[_0xc906('0xeb')]||undefined})[_0xc906('0x9f')](loggerCatch(_0xc906('0xec')));var _0x34a430=new History(_0x35354a);_0x34a430[_0xc906('0x6e')]=0xb;_0x34a430[_0xc906('0x6f')]='Abandoned';_0x34a430[_0xc906('0x71')]=moment()[_0xc906('0x49')](_0xc906('0xc2'));_0x34a430['endtime']=_0x34a430['starttime'];_0x34a430['calleridname']=_0x35354a[_0xc906('0xe2')];_0x34a430['calleridnum']=_0x35354a['calleridnum'];hopperUtils[_0xc906('0xc9')](_0x34a430)[_0xc906('0x9f')](loggerCatch(_0xc906('0xed')));}})[_0xc906('0xa2')](function(){if(_0x3b4659)hopperUtils[_0xc906('0xe4')](_0x35354a,_0x3e3bbd,_0x1b45f3)['then'](function(){return 0x1;});});}}}};Dialer[_0xc906('0x1c')]['syncNewExten']=function(_0x54696c){if(this[_0xc906('0x26')][_0x54696c[_0xc906('0xbe')]]){this[_0xc906('0x26')][_0x54696c[_0xc906('0xbe')]]['channel']=_0x54696c['channel'];}if(this[_0xc906('0x28')][_0x54696c[_0xc906('0xbe')]]){this['uniqueId'][_0x54696c[_0xc906('0xbe')]][_0xc906('0xee')]=_0x54696c[_0xc906('0xee')];}};Dialer[_0xc906('0x1c')][_0xc906('0x3f')]=function(_0x350954){if(!this[_0xc906('0x26')][_0x350954[_0xc906('0xef')]]){return;}var _0x24d843=this[_0xc906('0x21')][this['actions'][_0x350954['actionid']][_0xc906('0xbd')]][_0xc906('0xf0')]||_0xc906('0xf1');if(_0x24d843===_0xc906('0xf2')){if(this[_0xc906('0x26')][_0x350954[_0xc906('0xef')]]&&_[_0xc906('0xf3')](this['actions'][_0x350954[_0xc906('0xef')]][_0xc906('0xf4')])&&_0x350954[_0xc906('0x88')]==='1'&&_0x350954[_0xc906('0xf5')]==='0'){if(this[_0xc906('0x23')][_0x350954['stateinterface']]){if(!this[_0xc906('0x23')][_0x350954[_0xc906('0xf6')]]['locked']){this[_0xc906('0x23')][_0x350954[_0xc906('0xf6')]][_0xc906('0xf4')]=!![];this[_0xc906('0x26')][_0x350954[_0xc906('0xef')]][_0xc906('0xf4')]=!![];this['actions'][_0x350954[_0xc906('0xef')]]['stateinterface']=_0x350954['stateinterface'];}}}}else if(_0x24d843===_0xc906('0xf1')){if(this['actions'][_0x350954[_0xc906('0xef')]]){if(this[_0xc906('0x23')][_0x350954[_0xc906('0xf6')]]){this[_0xc906('0x26')][_0x350954['actionid']][_0xc906('0xf6')]=_0x350954[_0xc906('0xf6')];if(_['isNil'](this['queueBooked'][this[_0xc906('0x26')][_0x350954[_0xc906('0xef')]]['queue']])){this['queueBooked'][this[_0xc906('0x26')][_0x350954['actionid']]['queue']]=[];}this['queueBooked'][this[_0xc906('0x26')][_0x350954[_0xc906('0xef')]][_0xc906('0xbd')]][_0xc906('0xa0')](_[_0xc906('0x60')](_[_0xc906('0x76')](this[_0xc906('0x26')][_0x350954[_0xc906('0xef')]],[_0xc906('0xf7'),_0xc906('0xf6')]),{'status':_0x350954[_0xc906('0x88')],'paused':_0x350954[_0xc906('0xf5')]}));}}}};Dialer[_0xc906('0x1c')][_0xc906('0x41')]=function(_0x2130b2){if(!this[_0xc906('0x26')][_0x2130b2['actionid']]){return;}var _0x34146e=this;var _0x3223eb=this['voiceQueues'][this[_0xc906('0x26')][_0x2130b2['actionid']]['queue']];var _0x40a617=_0x3223eb[_0xc906('0xf0')]||'rrmemory';if(_0x40a617===_0xc906('0xf2')){if(this[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]]&&this['actions'][_0x2130b2[_0xc906('0xef')]][_0xc906('0xf6')]){this[_0xc906('0x20')][_0xc906('0xf8')](this[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]]['idHopper'],this[_0xc906('0x26')][_0x2130b2['actionid']][_0xc906('0xf6')])[_0xc906('0x9f')](function(_0x34ae84){logger[_0xc906('0x64')](_0xc906('0xf9'),util[_0xc906('0x48')](_0x34ae84,{'showHidden':![],'depth':null}));})[_0xc906('0x1e')](function(){_0x34146e[_0xc906('0xc0')](_0x34146e['voiceQueues'][_0x34146e[_0xc906('0x26')][_0x2130b2['actionid']][_0xc906('0xbd')]]);_0x34146e['agents'][_0x34146e[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]][_0xc906('0xf6')]][_0xc906('0xf4')]=![];delete _0x34146e[_0xc906('0x26')][_0x2130b2['actionid']];unlockQueueStatus(_0x3223eb);});}else{this[_0xc906('0xc0')](this[_0xc906('0x21')][this[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]][_0xc906('0xbd')]]);hopperUtils[_0xc906('0xdb')]({'active':![],'ContactId':this['actions'][_0x2130b2[_0xc906('0xef')]][_0xc906('0xde')],'ListId':this[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]]['ListId'],'VoiceQueueId':this[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]][_0xc906('0xe0')]||undefined,'CampaignId':this['actions'][_0x2130b2['actionid']][_0xc906('0xeb')]||undefined})[_0xc906('0x9f')](loggerCatch(_0xc906('0xfa')));delete this[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]];unlockQueueStatus(_0x3223eb);}}else if(_0x40a617===_0xc906('0xf1')){var _0x76d9ec;if(this[_0xc906('0x26')][_0x2130b2['actionid']]&&!_[_0xc906('0x4b')](this[_0xc906('0xfb')][this[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]]['queue']])){if(this[_0xc906('0x2d')][_0x34146e[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]][_0xc906('0xbd')]]){this[_0xc906('0x2d')][_0x34146e['actions'][_0x2130b2[_0xc906('0xef')]][_0xc906('0xbd')]]=this[_0xc906('0x2d')][this['actions'][_0x2130b2[_0xc906('0xef')]]['queue']]?this['queueBookedRR'][this[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]][_0xc906('0xbd')]]:this['queueBooked'][this[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]][_0xc906('0xbd')]]?this[_0xc906('0xfb')][this[_0xc906('0x26')][_0x2130b2['actionid']][_0xc906('0xbd')]][_0xc906('0xfc')]||0x0:0x0;}this['queueBooked'][this[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]][_0xc906('0xbd')]][_0xc906('0xfc')]=this['queueBookedRR'][this[_0xc906('0x26')][_0x2130b2[_0xc906('0xef')]][_0xc906('0xbd')]];for(var _0x4ea2cb=0x0;_0x4ea2cb=_0x3f82bd[_0xc906('0x122')]){_0xec2fe9[_0xc906('0x123')](_0xc29bfe,_0x531dfa,_0x10fcc5,'reason19\x20machine....');}else{if(_0xc29bfe[_0xc906('0x11b')]>=_0x3f82bd[_0xc906('0x124')]){_0xec2fe9[_0xc906('0x125')](_0xc29bfe,_0x531dfa,_0x10fcc5,'reason\x2019\x20machine....');}else{hopperUtils[_0xc906('0xdb')]({'active':![],'countmachineretry':_0xc29bfe[_0xc906('0x11b')],'scheduledat':moment()[_0xc906('0xdc')](_0x3f82bd[_0xc906('0x126')],'minutes')[_0xc906('0x49')](_0xc906('0xc2')),'ContactId':_0xc29bfe[_0xc906('0xde')],'ListId':_0xc29bfe[_0xc906('0xdf')],'VoiceQueueId':_0xc29bfe[_0xc906('0xe0')]||undefined,'CampaignId':_0xc29bfe[_0xc906('0xeb')]||undefined})[_0xc906('0x9f')](loggerCatch(_0xc906('0x127')));_0x531dfa({'reschedule':0x1});}}});}if(_0x3f14f7[_0xc906('0xc3')]===_0xc906('0xbf')&&this[_0xc906('0x22')][_0x3f14f7[_0xc906('0xbd')]][_0xc906('0x10d')]&&_0x226219['value']===_0xc906('0x10f')){delete this[_0xc906('0x28')][_0x226219['uniqueid']];this[_0xc906('0xc0')](this[_0xc906('0x22')][_0x3f14f7[_0xc906('0xbd')]]);_0x5cf18b=new Hangup(_0x3f14f7,_0x226219);_0x5cf18b[_0xc906('0x6e')]=0x12;_0x5cf18b[_0xc906('0x6f')]=_0xc906('0x111');_0x5cf18b[_0xc906('0x112')]='AMD';ami[_0xc906('0x45')](_0xc906('0x114'),ut[_0xc906('0x11c')](_0x5cf18b,_0xc906('0x115')));this[_0xc906('0x116')](_0x5cf18b,'[syncHangupInAMDIvr][createHistory]',_0xc906('0x128'));}if(_0x3f14f7['type']==='ivr'&&this[_0xc906('0x22')][_0x3f14f7[_0xc906('0xbd')]][_0xc906('0x10d')]&&_0x226219[_0xc906('0x10e')]===_0xc906('0x119')){return new Promise(function(_0x38c555,_0xef9d54){delete _0xec2fe9[_0xc906('0x28')][_0x226219[_0xc906('0xbe')]];_0xec2fe9['updateOriginated'](_0xec2fe9[_0xc906('0x22')][_0x3f14f7[_0xc906('0xbd')]]);_0xec2fe9['campaigns'][_0x3f14f7[_0xc906('0xbd')]][_0xc906('0xc4')]+=0x1;_0xec2fe9[_0xc906('0x22')][_0x3f14f7['queue']][_0xc906('0x110')]+=0x1;var _0x5cb0e8=_0xec2fe9[_0xc906('0x22')][_0x3f14f7[_0xc906('0xbd')]];var _0x3a218a=new Hangup(_0x3f14f7,_0x226219);_0x3a218a[_0xc906('0x6e')]=0x13;_0x3a218a[_0xc906('0x6f')]='Machine';_0x3a218a[_0xc906('0x112')]=_0xc906('0x113');_0x3a218a[_0xc906('0x11b')]+=0x1;_0x3a218a[_0xc906('0xd6')]+=0x1;_0x3a218a[_0xc906('0x115')]=!![];ami[_0xc906('0x45')](_0xc906('0x114'),ut['buildObj'](_0x3a218a,_0xc906('0x115')));hopperUtils[_0xc906('0xc9')](_0x3a218a)[_0xc906('0x9f')](loggerCatch(_0xc906('0x129')));if(_0x3a218a['countbusyretry']+_0x3a218a[_0xc906('0x11e')]+_0x3a218a[_0xc906('0x11f')]+_0x3a218a[_0xc906('0x120')]+_0x3a218a[_0xc906('0xd5')]+_0x3a218a[_0xc906('0xe7')]+_0x3a218a[_0xc906('0x11b')]+_0x3a218a[_0xc906('0x121')]>=_0x5cb0e8[_0xc906('0x122')]){_0xec2fe9[_0xc906('0x123')](_0x3a218a,_0x38c555,_0xef9d54,_0xc906('0x12a'));}else{if(_0x3a218a[_0xc906('0x11b')]>=_0x5cb0e8[_0xc906('0x124')]){_0xec2fe9[_0xc906('0x125')](_0x3a218a,_0x38c555,_0xef9d54,_0xc906('0x12b'));}else{hopperUtils[_0xc906('0xdb')]({'active':![],'countmachineretry':_0x3a218a['countmachineretry'],'scheduledat':moment()[_0xc906('0xdc')](_0x5cb0e8[_0xc906('0x126')],_0xc906('0x12c'))[_0xc906('0x49')](_0xc906('0xc2')),'ContactId':_0x3a218a[_0xc906('0xde')],'ListId':_0x3a218a[_0xc906('0xdf')],'VoiceQueueId':_0x3a218a['VoiceQueueId']||undefined,'CampaignId':_0x3a218a[_0xc906('0xeb')]||undefined})[_0xc906('0x9f')](loggerCatch(_0xc906('0x127')));_0x38c555({'reschedule':0x1});}}});}}};Dialer[_0xc906('0x1c')][_0xc906('0x12d')]=function(_0x275bbc){var _0x170f49=this['uniqueId'][_0x275bbc[_0xc906('0xbe')]];var _0x13c5b9;if(_0x170f49&&_0x170f49['type']===_0xc906('0xbf')){delete this[_0xc906('0x28')][_0x275bbc[_0xc906('0xbe')]];this[_0xc906('0xc0')](this[_0xc906('0x22')][_0x170f49[_0xc906('0xbd')]]);this[_0xc906('0x22')][_0x170f49[_0xc906('0xbd')]][_0xc906('0x12e')]+=0x1;_0x13c5b9=new Hangup(_0x170f49,_0x275bbc);hopperUtils[_0xc906('0xc9')](_0x13c5b9)['catch'](loggerCatch(_0xc906('0x12f')));hopperUtils['moveContactManagedDialer'](_0x13c5b9)[_0xc906('0x9f')](loggerCatch(_0xc906('0x130')));}if(_0x170f49&&_0x170f49[_0xc906('0xc3')]!==_0xc906('0xbf')&&isNotNull(this['voiceQueues'][_0x170f49[_0xc906('0xbd')]][_0xc906('0x131')])){delete this[_0xc906('0x28')][_0x275bbc[_0xc906('0xbe')]];this[_0xc906('0xc0')](this[_0xc906('0x21')][_0x170f49[_0xc906('0xbd')]]);this['voiceQueues'][_0x170f49[_0xc906('0xbd')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x170f49['queue']][_0xc906('0x110')]+=0x1;_0x13c5b9=new Hangup(_0x170f49,_0x275bbc);_0x13c5b9[_0xc906('0x6e')]=0x10;_0x13c5b9['statedesc']=_0xc906('0x132');_0x13c5b9[_0xc906('0x112')]='AGI';hopperUtils[_0xc906('0xc9')](_0x13c5b9)[_0xc906('0x9f')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xc906('0xcb')](_0x13c5b9)[_0xc906('0x9f')](loggerCatch('[syncHangupIvr]'));}if(_0x170f49&&_0x170f49[_0xc906('0xc3')]!==_0xc906('0xbf')&&!isNotNull(this[_0xc906('0x21')][_0x170f49[_0xc906('0xbd')]]['dialQueueProject'])){delete this[_0xc906('0x28')][_0x275bbc[_0xc906('0xbe')]];this['updateOriginated'](this[_0xc906('0x21')][_0x170f49[_0xc906('0xbd')]]);this[_0xc906('0x21')][_0x170f49['queue']][_0xc906('0x133')]+=0x1;_0x13c5b9=new Hangup(_0x170f49,_0x275bbc);_0x13c5b9[_0xc906('0x6e')]=0xc;_0x13c5b9[_0xc906('0x6f')]=_0x275bbc[_0xc906('0x134')];_0x13c5b9[_0xc906('0x112')]=_0xc906('0x135');hopperUtils[_0xc906('0xc9')](_0x13c5b9)['catch'](loggerCatch(_0xc906('0x12f')));hopperUtils['moveContactManagedDialer'](_0x13c5b9)['catch'](loggerCatch(_0xc906('0x130')));}};Dialer[_0xc906('0x1c')]['syncQueueSummary']=function(_0x47eb62){var _0x50bb52=this;if(!_0x50bb52[_0xc906('0x2e')][_0x47eb62[_0xc906('0x4a')]]){_0x50bb52[_0xc906('0x2e')][_0x47eb62[_0xc906('0x4a')]]={'running':![]};}else if(_0x50bb52[_0xc906('0x2e')][_0x47eb62[_0xc906('0x4a')]][_0xc906('0x136')]===!![]){return;}else if(_0x50bb52[_0xc906('0x2e')][_0x47eb62[_0xc906('0x4a')]][_0xc906('0x136')]===![]){_0x50bb52[_0xc906('0x2e')][_0x47eb62[_0xc906('0x4a')]][_0xc906('0x136')]=!![];}var _0x4b1ad2=_0x50bb52[_0xc906('0x21')][_0x47eb62[_0xc906('0x4a')]];var _0x353ef5=_0x4b1ad2[_0xc906('0x66')]!==utils[_0xc906('0x67')][_0xc906('0x7b')];var _0x5b7c92=utils[_0xc906('0x137')](_0x4b1ad2);_0x4b1ad2[_0xc906('0x138')]=utils['getQueueCampaignStatusMessage'](_0x4b1ad2,_0x50bb52[_0xc906('0x87')]);Promise[_0xc906('0x139')]()[_0xc906('0xa2')](function(){if(_0x4b1ad2['statusMessage']===utils[_0xc906('0x67')][_0xc906('0x7b')]){if(_0x353ef5){clearPredictiveAttributes(_0x4b1ad2);_0x47eb62[_0xc906('0x2a')]=undefined;_0x47eb62[_0xc906('0x2b')]=undefined;}if(_0x4b1ad2[_0xc906('0x138')]===utils[_0xc906('0x67')][_0xc906('0x7b')]){_0x47eb62[_0xc906('0x13a')]=0x0;_0x47eb62['paused']=0x0;_0x47eb62[_0xc906('0x13b')]=0x0;_0x47eb62[_0xc906('0x13c')]=0x0;_0x47eb62[_0xc906('0x13d')]=0x0;}}else if(_0x4b1ad2[_0xc906('0x138')]===utils[_0xc906('0x67')]['ACTIVE']&&!_0x5b7c92){return _0x50bb52['ifTime'](_0x4b1ad2,!![])[_0xc906('0xa2')](function(){return _0x50bb52[_0xc906('0x94')](_0x4b1ad2,![]);})[_0xc906('0xa2')](function(){return _0x50bb52['checkDialMethod'](_0x4b1ad2);})['catch'](function(_0x29bf9a){loggerSyncQueueSummary[_0xc906('0x46')](_0xc906('0x13e'),util[_0xc906('0x48')](_0x29bf9a,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x4b1ad2);});}else{clearPredictiveAttributes(_0x4b1ad2);}})[_0xc906('0xa2')](function(){var _0x1692f6=_0x47eb62['compareToOutboundQueue'](_0x4b1ad2);if(_0x1692f6||_0x4b1ad2[_0xc906('0x13f')]){_0x4b1ad2[_0xc906('0x13f')]=![];_0x47eb62[_0xc906('0x140')](_0x4b1ad2);Object[_0xc906('0x141')](_0x4b1ad2,_0x47eb62);emitOutboundVoiceQueueSummary(_0x47eb62);}_0x50bb52[_0xc906('0x2e')][_0x4b1ad2[_0xc906('0x4a')]]['running']=![];})[_0xc906('0x9f')](function(_0x531679){logger[_0xc906('0x64')](_0xc906('0x13e'),util['inspect'](_0x531679,{'showHidden':![],'depth':null}));_0x50bb52['queuesSummary'][_0x4b1ad2[_0xc906('0x4a')]][_0xc906('0x136')]=![];});};Dialer[_0xc906('0x1c')][_0xc906('0x39')]=_['throttle'](function(){var _0x3d8edf=_[_0xc906('0x142')](this[_0xc906('0x21')],function(_0x2258b9){return _0x2258b9[_0xc906('0x143')];});var _0x33aaa9=_['filter'](this[_0xc906('0x23')],function(_0x379d03){return _0x379d03['online']&&_0x379d03[_0xc906('0x88')]==='reachable';});if(_0x3d8edf[_0xc906('0x99')]>0x0&&_0x33aaa9['length']>0x0){return Promise[_0xc906('0x139')]()[_0xc906('0xa2')](cmHopper[_0xc906('0x144')](_['map'](_0x3d8edf,'id'),previewRecallmeReminderInterval,_[_0xc906('0x145')](_0x33aaa9,'id')))[_0xc906('0xa2')](function(_0x4f010e){for(var _0xff252c=0x0;_0xff252c<_0x4f010e[_0xc906('0x99')];_0xff252c++){var _0x309fcc=_0x4f010e[_0xff252c]['Agent'][_0xc906('0x4a')];if(_0x309fcc)io['to'](util[_0xc906('0x49')](_0xc906('0x146'),_0x309fcc))['emit'](_0xc906('0x147'),{'hopper':_0x4f010e[_0xff252c]});}})['catch'](function(_0xee586b){logger[_0xc906('0x64')](_0xc906('0x148'),_0xee586b);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype']['loopClearZombieChannels']=function(){var _0x55acd0=this;setInterval(function(){_0x55acd0['clearZombieChannels'](_0x55acd0[_0xc906('0x28')],_0xc906('0x149'));_0x55acd0[_0xc906('0x14a')](_0x55acd0[_0xc906('0x26')],_0xc906('0x14b'));},0x32c8);};Dialer[_0xc906('0x1c')][_0xc906('0x14a')]=function(_0x9211e6,_0x195c4b){var _0x5736b7=this;for(var _0x51fee9 in _0x9211e6){if(typeof _0x9211e6[_0x51fee9]!==_0xc906('0x14c')){this[_0xc906('0x1f')][_0xc906('0x14d')](function(){if(!_['isNil'](_0x9211e6[_0x51fee9])){return ami[_0xc906('0x9a')]({'action':_0xc906('0x88'),'channel':_0x9211e6[_0x51fee9]['channel']})['catch'](function(_0x48add8){if(_0x48add8[_0xc906('0x66')]===_0xc906('0x14e')){setTimeout(function(){if(_0x9211e6[_0x51fee9]&&_0x9211e6[_0x51fee9][_0xc906('0xc3')]!==_0xc906('0xbf')){_0x5736b7[_0xc906('0xc0')](_0x5736b7[_0xc906('0x21')][_0x9211e6[_0x51fee9][_0xc906('0xbd')]]);logger[_0xc906('0x64')]('[Dialer][checkChannel]',_0x195c4b,_0x51fee9,_0x9211e6[_0x51fee9][_0xc906('0xbd')]);delete _0x9211e6[_0x51fee9];}if(_0x9211e6[_0x51fee9]&&_0x9211e6[_0x51fee9][_0xc906('0xc3')]===_0xc906('0xbf')){_0x5736b7['updateOriginated'](_0x5736b7[_0xc906('0x22')][_0x9211e6[_0x51fee9]['queue']]);logger[_0xc906('0x64')](_0xc906('0x14f'),_0x195c4b,_0x51fee9,_0x9211e6[_0x51fee9][_0xc906('0xbd')]);delete _0x9211e6[_0x51fee9];}},0x2328);}});}});}}};Dialer[_0xc906('0x1c')][_0xc906('0x150')]=function(_0x375635){return Promise[_0xc906('0x139')]()[_0xc906('0xa2')](voiceQueueRt[_0xc906('0x150')](_0x375635))['catch'](loggerCatch(_0xc906('0x151')));};Dialer[_0xc906('0x1c')][_0xc906('0xc0')]=function(_0x237b12){if(!_[_0xc906('0x44')](_0x237b12)&&_0x237b12!==null){if(typeof _0x237b12['originated']!==_0xc906('0x14c')){if(_0x237b12[_0xc906('0x80')]>0x0){_0x237b12[_0xc906('0x80')]-=0x1;}else{logger[_0xc906('0x64')](_0xc906('0x152'));}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xc906('0x1c')][_0xc906('0x153')]=function(_0x421955,_0x19d48a){var _0x572f1c=this;return function(_0x1bf3b0){_0x572f1c[_0xc906('0xc0')](_0x19d48a);logger[_0xc906('0x64')](_0x421955,util[_0xc906('0x48')](_0x1bf3b0,{'showHidden':![],'depth':null}));};};Dialer[_0xc906('0x1c')]['emptyContact']=function(_0xbaa85f,_0x5762c7,_0x3610e0){var _0x3426ca={'state':0x19,'statedesc':'notFound'};this[_0xc906('0xc0')](_0x5762c7);this['saveInDb'](_[_0xc906('0x60')](_0x3426ca,_['pick'](_0x3610e0,['ContactId','ListId',_0xc906('0x154'),_0xc906('0xe0'),'CampaignId'])),_0xc906('0x155'),_0xc906('0x156'));logger['error'](_0xbaa85f);};Dialer[_0xc906('0x1c')]['saveInDb']=function(_0xceb93a,_0xe38497,_0x454d6f){hopperUtils['createHistory'](_0xceb93a)['catch'](loggerCatch(_0xe38497));hopperUtils[_0xc906('0xcb')](_0xceb93a)[_0xc906('0x9f')](loggerCatch(_0x454d6f));};Dialer[_0xc906('0x1c')][_0xc906('0xda')]=function(_0x40269f,_0x56e54d){hopperUtils['createHistory'](_0x40269f)[_0xc906('0x9f')](loggerCatch(_0xc906('0xca')));if(_0x56e54d==0x0){hopperUtils[_0xc906('0xcb')](_0x40269f)[_0xc906('0x9f')](loggerCatch(_0xc906('0x157')));}};Dialer['prototype']['checkPreviewRecallReminder']=function(_0x629aa7){return Promise['resolve']()[_0xc906('0xa2')](cmHopper['handlePreviewRecallNotifications'](_0x629aa7['id'],previewRecallmeReminderInterval))[_0xc906('0xa2')](function(_0xb0b054){for(var _0x5522fe=0x0;_0x5522fe<_0xb0b054[_0xc906('0x99')];_0x5522fe++){var _0x412d91=_0xb0b054[_0x5522fe][_0xc906('0x158')][_0xc906('0x4a')];if(_0x412d91)io['to'](util[_0xc906('0x49')]('user:%s',_0x412d91))['emit'](_0xc906('0x147'),{'hopper':_0xb0b054[_0x5522fe]});}})[_0xc906('0x9f')](function(){});};Dialer[_0xc906('0x1c')][_0xc906('0x159')]=function(_0xfbef65){var _0x91206b=this;return function(){_0x91206b[_0xc906('0x15a')](_0xfbef65);};};Dialer[_0xc906('0x1c')][_0xc906('0x15b')]=function(_0x55b7d3,_0x1b8930){var _0x4650b4=this;var _0x14503b=uuid['v4']();this['actions'][_0x14503b]=new Action(_0x55b7d3,_0x1b8930,_0x14503b);return new Promise(function(_0x1e68fa,_0x457849){if(_[_0xc906('0x44')](_0x55b7d3)&&typeof _0x55b7d3!==_0xc906('0x15c')){return _0x457849(msgResponse(_0xc906('0x15d'),_0xc906('0x91'),_0xc906('0x15e')));}if(_[_0xc906('0x44')](_0x1b8930[_0xc906('0x15f')])||_0x1b8930['phone']===null){return _0x457849(msgResponse(_0xc906('0x15d'),'Failure',_0xc906('0x160')));}var _0x3e5803={'XMD-CALLERID':_0x4650b4[_0xc906('0x26')][_0x14503b][_0xc906('0x161')](),'XMD-AGI':_0x55b7d3[_0xc906('0x131')]?util[_0xc906('0x49')](_0xc906('0x162'),ipAgi,_0x55b7d3[_0xc906('0x131')]):'NONE','XMD-AGIAFTER':_0x55b7d3[_0xc906('0xc7')]?util[_0xc906('0x49')](_0xc906('0x162'),ipAgi,_0x55b7d3['dialQueueProject2']):_0xc906('0x163'),'XMD-QUEUE':utils['isOutboundQueue'](_0x55b7d3)?util['format'](_0xc906('0x164'),_0x55b7d3[_0xc906('0x4a')],_0x55b7d3[_0xc906('0x165')]||'',_0x55b7d3[_0xc906('0xc8')]?'c':'',_0x55b7d3[_0xc906('0x166')]||0x3):_0xc906('0x163'),'XMD-CONTACTID':_0x1b8930[_0xc906('0xde')],'XMD-CDRTYPE':_0xc906('0xa'),'CALLERID(all)':_0x4650b4['actions'][_0x14503b][_0xc906('0x161')](),'XMD-AMD':_0x55b7d3[_0xc906('0x10d')]?_0xc906('0x167'):_0xc906('0x163'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x55b7d3['dialAMDActive']){_0x3e5803[_0xc906('0x168')]=_0x55b7d3[_0xc906('0x169')]||0x9c4;_0x3e5803[_0xc906('0x16a')]=_0x55b7d3[_0xc906('0x16b')]||0x5dc;_0x3e5803[_0xc906('0x16c')]=_0x55b7d3[_0xc906('0x16d')]||0x320;_0x3e5803['XMD-AMDTOTALANALYSISTIME']=_0x55b7d3[_0xc906('0x16e')]||0x1388;_0x3e5803[_0xc906('0x16f')]=_0x55b7d3[_0xc906('0x170')]||0x64;_0x3e5803[_0xc906('0x171')]=_0x55b7d3[_0xc906('0x172')]||0x32;_0x3e5803[_0xc906('0x173')]=_0x55b7d3[_0xc906('0x174')]||0x3;_0x3e5803[_0xc906('0x175')]=_0x55b7d3[_0xc906('0x176')]||0x100;_0x3e5803[_0xc906('0x177')]=_0x55b7d3['dialAMDMaximumWordLength']||0x1388;}if(utils[_0xc906('0x178')](_0x55b7d3)){_0x3e5803['XMD-VOICEQUEUEID']=_0x1b8930[_0xc906('0xe0')];}else{_0x3e5803[_0xc906('0x179')]=_0x1b8930[_0xc906('0xeb')];}var _0x35759b=utils[_0xc906('0x17a')](_0x1b8930[_0xc906('0x17b')]);Object[_0xc906('0x141')](_0x3e5803,_0x35759b);var _0x463294=_0x4650b4[_0xc906('0x85')](_0x55b7d3[_0xc906('0x8c')])?utils[_0xc906('0x17c')](_0x55b7d3[_0xc906('0x8c')][_0xc906('0x17d')],_0x55b7d3['dialOriginateCallerIdName'],_0x55b7d3[_0xc906('0x17e')]>0x0?utils['getCallerIdRandom'](_0x55b7d3['dialOriginateCallerIdNumber'],_0x55b7d3[_0xc906('0x17e')]):_0x55b7d3['dialOriginateCallerIdNumber']):utils[_0xc906('0x17c')](_['isNil'](_0x55b7d3['TrunkBackup'])?_0x55b7d3['Trunk'][_0xc906('0x17d')]:_0x55b7d3['TrunkBackup'][_0xc906('0x17d')],_0x55b7d3[_0xc906('0x17f')],_0x55b7d3[_0xc906('0x17e')]>0x0?utils['getCallerIdRandom'](_0x55b7d3['dialOriginateCallerIdNumber'],_0x55b7d3['dialRandomLastDigitCallerIdNumber']):_0x55b7d3[_0xc906('0x180')]);if(_0x463294){_0x3e5803[_0xc906('0x181')]=_0x4650b4[_0xc906('0x26')][_0x14503b]['originatecalleridname']=utils[_0xc906('0x182')](_0x463294);_0x3e5803[_0xc906('0x183')]=_0x1b8930['phone'];}_0x55b7d3[_0xc906('0x184')]=_0x3e5803;return ami[_0xc906('0x9a')]({'actionid':_0x14503b,'action':_0xc906('0x15d'),'channel':_0x4650b4[_0xc906('0x85')](_0x55b7d3['Trunk'])?util[_0xc906('0x49')](_0xc906('0x185'),_0x55b7d3[_0xc906('0x8c')][_0xc906('0x4a')],isNotNull(_0x55b7d3['dialPrefix'])?_0x55b7d3['dialPrefix'][_0xc906('0x186')]()||'':'',_0x55b7d3[_0xc906('0x187')]>0x0?_0x1b8930[_0xc906('0x15f')]['substring'](_0x55b7d3[_0xc906('0x187')]):_0x1b8930[_0xc906('0x15f')]):util['format'](_0xc906('0x185'),_[_0xc906('0xf3')](_0x55b7d3[_0xc906('0x8d')])?_0x55b7d3[_0xc906('0x8c')][_0xc906('0x4a')]:_0x55b7d3['TrunkBackup'][_0xc906('0x4a')],isNotNull(_0x55b7d3[_0xc906('0x188')])?_0x55b7d3['dialPrefix'][_0xc906('0x186')]()||'':'',_0x55b7d3[_0xc906('0x187')]>0x0?_0x1b8930[_0xc906('0x15f')][_0xc906('0x189')](_0x55b7d3[_0xc906('0x187')]):_0x1b8930['phone']),'callerid':_0x463294,'Exten':_0xc906('0x18a'),'Context':'from-sip','Priority':'1','variable':_0x3e5803,'timeout':(_0x55b7d3[_0xc906('0x18b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x14503b})[_0xc906('0xa2')](function(_0x564d01){return _0x1e68fa(_0x564d01);})[_0xc906('0x9f')](function(_0x220efe){_0x55b7d3[_0xc906('0x18c')]+=0x1;var _0x3e1a0a=new History(_0x4650b4[_0xc906('0x26')][_0x14503b]);logger[_0xc906('0x64')](util['format']('[originateError]:\x20%s',JSON[_0xc906('0x75')](_0x220efe)));_0x3e1a0a[_0xc906('0x6e')]=0xe;_0x3e1a0a[_0xc906('0x6f')]=_0xc906('0x18d');_0x3e1a0a['starttime']=moment()['format'](_0xc906('0xc2'));_0x3e1a0a[_0xc906('0x70')]=_0x3e1a0a[_0xc906('0x71')];hopperUtils['createHistory'](_0x3e1a0a)[_0xc906('0x9f')](loggerCatch(_0xc906('0x18e')));_0x4650b4[_0xc906('0xcb')](_0x3e1a0a)[_0xc906('0x9f')](loggerCatch(_0xc906('0x18e')))[_0xc906('0x1e')](function(){delete _0x4650b4[_0xc906('0x26')][_0x14503b];return _0x457849(msgResponse(_0xc906('0x15d'),'Error','originate\x20action\x20Error'));});});});};Dialer[_0xc906('0x1c')][_0xc906('0x18f')]=function(_0xb4dab1,_0x2dcba4,_0x4e201b){var _0x38b444=new History(_0x2dcba4);if(_0x38b444[_0xc906('0x11d')]+_0x38b444[_0xc906('0x11e')]+_0x38b444[_0xc906('0x11f')]+_0x38b444[_0xc906('0x120')]+_0x38b444[_0xc906('0xd5')]+_0x38b444[_0xc906('0xe7')]+_0x38b444['countmachineretry']+_0x38b444[_0xc906('0x121')]>=_0x4e201b[_0xc906('0x122')]-0x1){return!![];}switch(_0xb4dab1){case 0x3:if(_0x38b444[_0xc906('0x11f')]>=_0x4e201b[_0xc906('0x190')]-0x1){return!![];}hopperUtils[_0xc906('0xdb')]({'active':![],'countnoanswerretry':_0x38b444[_0xc906('0x11f')]+=0x1,'scheduledat':moment()[_0xc906('0xdc')](_0x4e201b[_0xc906('0x191')],_0xc906('0x12c'))[_0xc906('0x49')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x38b444[_0xc906('0xde')],'ListId':_0x38b444[_0xc906('0xdf')],'VoiceQueueId':_0x38b444['VoiceQueueId']||undefined,'CampaignId':_0x38b444[_0xc906('0xeb')]||undefined})[_0xc906('0x9f')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x38b444['countbusyretry']>=_0x4e201b[_0xc906('0x192')]-0x1){return!![];}hopperUtils[_0xc906('0xdb')]({'active':![],'countbusyretry':_0x38b444[_0xc906('0x11d')]+=0x1,'scheduledat':moment()[_0xc906('0xdc')](_0x4e201b[_0xc906('0x193')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x38b444[_0xc906('0xde')],'ListId':_0x38b444[_0xc906('0xdf')],'VoiceQueueId':_0x38b444['VoiceQueueId']||undefined,'CampaignId':_0x38b444['CampaignId']||undefined})[_0xc906('0x9f')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x38b444[_0xc906('0x11e')]>=_0x4e201b[_0xc906('0x194')]-0x1){return!![];}hopperUtils[_0xc906('0xdb')]({'active':![],'countcongestionretry':_0x38b444[_0xc906('0x11e')]+=0x1,'scheduledat':moment()['add'](_0x4e201b[_0xc906('0x195')],'minutes')[_0xc906('0x49')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x38b444[_0xc906('0xde')],'ListId':_0x38b444[_0xc906('0xdf')],'VoiceQueueId':_0x38b444[_0xc906('0xe0')]||undefined,'CampaignId':_0x38b444[_0xc906('0xeb')]||undefined})[_0xc906('0x9f')](loggerCatch(_0xc906('0x196')));break;case 0x0:if(_0x38b444[_0xc906('0x120')]>=_0x4e201b[_0xc906('0x197')]-0x1){return!![];}else{hopperUtils[_0xc906('0xdb')]({'active':![],'countnosuchnumberretry':_0x38b444[_0xc906('0x120')]+=0x1,'scheduledat':moment()[_0xc906('0xdc')](_0x4e201b[_0xc906('0x198')],_0xc906('0x12c'))[_0xc906('0x49')](_0xc906('0xc2')),'ContactId':_0x38b444[_0xc906('0xde')],'ListId':_0x38b444[_0xc906('0xdf')],'VoiceQueueId':_0x38b444[_0xc906('0xe0')]||undefined,'CampaignId':_0x38b444[_0xc906('0xeb')]||undefined})[_0xc906('0x9f')](loggerCatch(_0xc906('0x199')));}break;case 0xa:if(_0x38b444[_0xc906('0xd5')]>=_0x4e201b['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0xc906('0xdb')]({'active':![],'countdropretry':_0x38b444['countdropretry']+=0x1,'scheduledat':moment()['add'](_0x4e201b[_0xc906('0xdd')],'minutes')[_0xc906('0x49')](_0xc906('0xc2')),'ContactId':_0x38b444[_0xc906('0xde')],'ListId':_0x38b444[_0xc906('0xdf')],'VoiceQueueId':_0x38b444[_0xc906('0xe0')]||undefined,'CampaignId':_0x38b444[_0xc906('0xeb')]||undefined})[_0xc906('0x9f')](loggerCatch(_0xc906('0xe1')));break;case 0xb:if(_0x38b444[_0xc906('0xe7')]>=_0x4e201b['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0xc906('0xdb')]({'active':![],'countabandonedretry':_0x38b444['countabandonedretry']+=0x1,'scheduledat':moment()[_0xc906('0xdc')](_0x4e201b['dialAbandonedRetryFrequency'],_0xc906('0x12c'))[_0xc906('0x49')](_0xc906('0xc2')),'ContactId':_0x38b444[_0xc906('0xde')],'ListId':_0x38b444[_0xc906('0xdf')],'VoiceQueueId':_0x38b444[_0xc906('0xe0')]||undefined,'CampaignId':_0x38b444[_0xc906('0xeb')]||undefined})[_0xc906('0x9f')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x38b444[_0xc906('0x11b')]>=_0x4e201b[_0xc906('0x124')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x38b444['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x4e201b[_0xc906('0x126')],_0xc906('0x12c'))['format'](_0xc906('0xc2')),'ContactId':_0x38b444[_0xc906('0xde')],'ListId':_0x38b444['ListId'],'VoiceQueueId':_0x38b444[_0xc906('0xe0')]||undefined,'CampaignId':_0x38b444[_0xc906('0xeb')]||undefined})[_0xc906('0x9f')](loggerCatch(_0xc906('0x127')));break;case 0x14:if(_0x38b444[_0xc906('0x121')]>=_0x4e201b[_0xc906('0x19a')]-0x1){return!![];}hopperUtils[_0xc906('0xdb')]({'active':![],'countagentrejectretry':_0x38b444['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xc906('0xdc')](_0x4e201b[_0xc906('0x19b')],'minutes')[_0xc906('0x49')](_0xc906('0xc2')),'ContactId':_0x38b444[_0xc906('0xde')],'ListId':_0x38b444[_0xc906('0xdf')],'VoiceQueueId':_0x38b444[_0xc906('0xe0')]||undefined,'CampaignId':_0x38b444[_0xc906('0xeb')]||undefined})[_0xc906('0x9f')](loggerCatch(_0xc906('0x19c')));break;default:return!![];}};Dialer['prototype'][_0xc906('0x10a')]=function(_0x363f20,_0x14997a,_0x6e9eb4){var _0x2509bf=this;var _0x28d7eb=new History(_0x363f20);var _0x4467a0=![];var _0x353b42;var _0x4e9743;return new Promise(function(_0x2ac370,_0x23e6f7){if(_['isUndefined'](_0x14997a)&&typeof _0x14997a!=='object'){return _0x23e6f7(msgResponse('[callProgressDetecting]',_0xc906('0x91'),_0xc906('0x19d')));}if(_[_0xc906('0x44')](_0x6e9eb4)&&typeof _0x6e9eb4!==_0xc906('0x15c')){return _0x23e6f7(msgResponse('[callProgressDetecting]',_0xc906('0x91'),_0xc906('0x19e')));}hopperUtils[_0xc906('0x19f')](_0x28d7eb,_0x6e9eb4[_0xc906('0x1a0')],_0x14997a)[_0xc906('0xa2')](function(_0x2fed16){if(_0x2fed16['additional']==0x1)_0x4467a0=!![];switch(_0x6e9eb4[_0xc906('0x1a0')]){case'0':_0x14997a[_0xc906('0x1a1')]+=0x1;_0x28d7eb[_0xc906('0x6e')]=0x0;_0x28d7eb[_0xc906('0x6f')]=_0xc906('0x1a2');_0x28d7eb['countnosuchnumberretry']+=0x1;_0x28d7eb[_0xc906('0xd6')]+=0x1;ami['emit'](_0xc906('0x1a3'),ut[_0xc906('0x11c')](_0x363f20,'nosuchnumber'));_0x353b42=_0x14997a[_0xc906('0x198')];_0x4e9743=_0x14997a[_0xc906('0xe9')];hopperUtils['createHistory'](_0x28d7eb)['catch'](loggerCatch(_0xc906('0x129')));if(_0x2509bf[_0xc906('0x18f')](0x0,_0x363f20,_0x14997a)&&!_0x4467a0){if(_0x28d7eb[_0xc906('0x120')]>=_0x14997a['dialNoSuchNumberMaxRetry']){_0x2509bf['createStateFinal'](_0x28d7eb,_0x2ac370,_0x23e6f7,_0xc906('0x1a4'));}else{_0x2509bf['stateGlobal'](_0x28d7eb,_0x2ac370,_0x23e6f7,_0xc906('0x1a4'));}}break;case'3':_0x14997a[_0xc906('0x1a5')]+=0x1;_0x28d7eb[_0xc906('0x6e')]=0x3;_0x28d7eb['statedesc']=_0xc906('0x1a6');_0x28d7eb[_0xc906('0x11f')]+=0x1;_0x28d7eb[_0xc906('0xd6')]+=0x1;var _0x2d5da8=ut['buildNoAnswerEventPayload'](_0x363f20,_0x14997a);ami['emit']('custom:agentnoanswer',_0x2d5da8);_0x353b42=_0x14997a['dialNoAnswerRetryFrequency'];_0x4e9743=_0x14997a[_0xc906('0xe9')];hopperUtils['createHistory'](_0x28d7eb)[_0xc906('0x9f')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x2509bf[_0xc906('0x18f')](0x3,_0x363f20,_0x14997a)&&!_0x4467a0){if(_0x28d7eb[_0xc906('0x11f')]>=_0x14997a[_0xc906('0x190')]){_0x2509bf[_0xc906('0x125')](_0x28d7eb,_0x2ac370,_0x23e6f7,_0xc906('0x1a7'));}else{_0x2509bf[_0xc906('0x123')](_0x28d7eb,_0x2ac370,_0x23e6f7,_0xc906('0x1a7'));}}break;case'5':_0x14997a[_0xc906('0x1a8')]+=0x1;_0x28d7eb[_0xc906('0x6e')]=0x5;_0x28d7eb[_0xc906('0x6f')]=_0xc906('0x1a9');_0x28d7eb[_0xc906('0x11d')]+=0x1;_0x28d7eb[_0xc906('0xd6')]+=0x1;ami[_0xc906('0x45')](_0xc906('0x1aa'),ut[_0xc906('0x11c')](_0x363f20,_0xc906('0x1ab')));_0x353b42=_0x14997a[_0xc906('0x193')];_0x4e9743=_0x14997a[_0xc906('0xe9')];hopperUtils[_0xc906('0xc9')](_0x28d7eb)[_0xc906('0x9f')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x2509bf['checkRetriveMax'](0x5,_0x363f20,_0x14997a)&&!_0x4467a0){if(_0x28d7eb[_0xc906('0x11d')]>=_0x14997a[_0xc906('0x192')]){_0x2509bf['createStateFinal'](_0x28d7eb,_0x2ac370,_0x23e6f7,'reason\x205\x20busy');}else{_0x2509bf[_0xc906('0x123')](_0x28d7eb,_0x2ac370,_0x23e6f7,_0xc906('0x1ac'));}}break;case'8':_0x14997a[_0xc906('0x1ad')]+=0x1;_0x28d7eb[_0xc906('0x6e')]=0x8;_0x28d7eb[_0xc906('0x6f')]='Congestion';_0x28d7eb[_0xc906('0x11e')]+=0x1;_0x28d7eb[_0xc906('0xd6')]+=0x1;_0x353b42=_0x14997a[_0xc906('0x195')];_0x4e9743=_0x14997a[_0xc906('0xe9')];ami['emit'](_0xc906('0x1ae'),ut['buildObj'](_0x363f20,'congestion'));hopperUtils['createHistory'](_0x28d7eb)[_0xc906('0x9f')](loggerCatch(_0xc906('0x1af')));if(_0x2509bf[_0xc906('0x18f')](0x8,_0x363f20,_0x14997a)&&!_0x4467a0){if(_0x28d7eb[_0xc906('0x11e')]>=_0x14997a['dialCongestionMaxRetry']){_0x2509bf[_0xc906('0x125')](_0x28d7eb,_0x2ac370,_0x23e6f7,_0xc906('0x1b0'));}else{_0x2509bf['stateGlobal'](_0x28d7eb,_0x2ac370,_0x23e6f7,'reason\x208\x20congestion');}}break;case'11':_0x14997a['outboundAbandonedCallsDay']+=0x1;_0x28d7eb['state']=0xb;_0x28d7eb['statedesc']=_0xc906('0x1b1');_0x28d7eb[_0xc906('0xe7')]+=0x1;_0x28d7eb[_0xc906('0xd6')]+=0x1;_0x353b42=_0x14997a['dialAbandonedRetryFrequency'];_0x4e9743=_0x14997a['callAdditionalPhoneAfterMin'];hopperUtils[_0xc906('0xc9')](_0x28d7eb)['catch'](loggerCatch(_0xc906('0xed')));if(_0x2509bf[_0xc906('0x18f')](0xb,_0x363f20,_0x14997a)&&!_0x4467a0){if(_0x28d7eb[_0xc906('0xe7')]>=_0x14997a['dialAbandonedMaxRetry']){_0x2509bf[_0xc906('0x125')](_0x28d7eb,_0x2ac370,_0x23e6f7,'reason\x2011\x20abandoned');}else{_0x2509bf['stateGlobal'](_0x28d7eb,_0x2ac370,_0x23e6f7,'reason\x2011\x20abandoned');}}break;case'20':_0x14997a['outboundRejectCallsDay']+=0x1;_0x28d7eb[_0xc906('0x6e')]=0x14;_0x28d7eb[_0xc906('0x6f')]=_0xc906('0x1b2');_0x28d7eb[_0xc906('0x121')]+=0x1;_0x28d7eb['countglobal']+=0x1;_0x353b42=_0x14997a[_0xc906('0x19b')];_0x4e9743=_0x14997a[_0xc906('0xe9')];ami[_0xc906('0x45')](_0xc906('0x1b3'),ut['buildObj'](_0x363f20,_0xc906('0x1b4')));hopperUtils[_0xc906('0xc9')](_0x28d7eb)[_0xc906('0x9f')](loggerCatch(_0xc906('0x1b5')));if(_0x2509bf[_0xc906('0x18f')](0x14,_0x363f20,_0x14997a)&&!_0x4467a0){if(_0x28d7eb[_0xc906('0x121')]>=_0x14997a[_0xc906('0x19a')]){_0x2509bf['createStateFinal'](_0x28d7eb,_0x2ac370,_0x23e6f7,_0xc906('0x1b6'));}else{_0x2509bf[_0xc906('0x123')](_0x28d7eb,_0x2ac370,_0x23e6f7,'reason\x2020\x20agentreject');}}break;default:_0x14997a[_0xc906('0x133')]+=0x1;_0x28d7eb[_0xc906('0x6e')]=0xc;_0x28d7eb[_0xc906('0x6f')]=_0x6e9eb4[_0xc906('0x1a0')];_0x353b42=_0x14997a[_0xc906('0x19b')];_0x4e9743=_0x14997a[_0xc906('0xe9')];hopperUtils['createHistory'](_0x28d7eb)['catch'](loggerCatch(_0xc906('0x1b7')));if(_0x2509bf[_0xc906('0x18f')](_0x6e9eb4['reason'],_0x363f20,_0x14997a)&&!_0x4467a0){if(_0x28d7eb['countbusyretry']+_0x28d7eb[_0xc906('0x11e')]+_0x28d7eb['countnoanswerretry']+_0x28d7eb[_0xc906('0x120')]+_0x28d7eb[_0xc906('0xd5')]+_0x28d7eb['countabandonedretry']+_0x28d7eb[_0xc906('0x11b')]+_0x28d7eb[_0xc906('0x121')]>=_0x14997a['dialGlobalMaxRetry']){_0x2509bf[_0xc906('0x123')](_0x28d7eb,_0x2ac370,_0x23e6f7,_0x6e9eb4[_0xc906('0x1a0')]);}else{_0x2509bf[_0xc906('0x125')](_0x28d7eb,_0x2ac370,_0x23e6f7,_0x6e9eb4['reason']);}}}})[_0xc906('0xa2')](function(){if(_0x4467a0){hopperUtils[_0xc906('0xe4')](_0x28d7eb,_0x353b42,_0x4e9743)[_0xc906('0xa2')](function(){return _0x2ac370(0x1);});}});});};Dialer[_0xc906('0x1c')][_0xc906('0x123')]=function(_0x347c0b,_0x3b509e,_0x1f2d20,_0x11afb3){var _0x2d8be7=new Final(_0x347c0b);_0x2d8be7[_0xc906('0x6e')]=0xf;_0x2d8be7[_0xc906('0x6f')]=_0xc906('0x1b8');this[_0xc906('0x125')](_0x2d8be7,_0x3b509e,_0x1f2d20,_0x11afb3);};Dialer['prototype']['createStateFinal']=function(_0x1d3530,_0x2c3323,_0x4c2310,_0x1ab643){hopperUtils[_0xc906('0xcb')](_0x1d3530)[_0xc906('0xa2')](function(){return _0x2c3323(msgResponse(_0xc906('0x1b9'),_0xc906('0x109'),_0x1ab643));})['catch'](function(){return _0x4c2310(msgResponse(_0xc906('0x1ba'),_0xc906('0x91'),_0xc906('0x1bb')));});};Dialer[_0xc906('0x1c')]['predictive']=function(_0x270d93){var _0x48c812=_0x270d93['dialPredictiveOptimizationPercentage']/0x64;var _0x453860=_0x270d93[_0xc906('0xd0')]/(_0x270d93['outboundDropCallsDayTimeout']+_0x270d93[_0xc906('0xc4')]);var _0x4ada67=Math[_0xc906('0x1bc')](_0x270d93['predictiveIntervalAvailable']*(_0x270d93[_0xc906('0x1bd')]/0x64));var _0x29957b=Math[_0xc906('0x1bc')](_0x270d93[_0xc906('0x1be')]*(_0x270d93[_0xc906('0x1bf')]/0x64));var _0x34947c=_0x270d93[_0xc906('0x13a')]+_0x270d93['talking'];var _0x27c328=Math[_0xc906('0x1c0')](_0x270d93[_0xc906('0x5a')]*_0x270d93[_0xc906('0x5f')]*_0x270d93['predictiveIntervalHitRate']*_0x270d93['predictiveIntervalMultiplicativeFactor']);if(_[_0xc906('0x44')](_0x270d93[_0xc906('0x2b')])){if(!_[_0xc906('0x44')](_0x270d93[_0xc906('0x2a')])){_0x270d93[_0xc906('0x2a')]=undefined;loggerPredictive[_0xc906('0x64')](_0xc906('0x1c1'),_0xc906('0x1c2'));}if(!_[_0xc906('0x44')](_0x270d93[_0xc906('0x62')])){loggerPredictive[_0xc906('0x64')](_0xc906('0x1c1'),_0xc906('0x1c3'));clearInterval(_0x270d93[_0xc906('0x62')]);_0x270d93[_0xc906('0x62')]=undefined;}_0x270d93[_0xc906('0x2b')]=moment()[_0xc906('0x49')](_0xc906('0xc2'));loggerPredictive[_0xc906('0x4d')](_0x270d93['name'],_0xc906('0x1c4'),_0x270d93[_0xc906('0x2b')]);this[_0xc906('0xb3')](_0x270d93,0x1);}else if(ifInterval(_0x270d93['dialPredictiveInterval'],_0x270d93[_0xc906('0x2b')])){this['handlePower'](_0x270d93,0x1);loggerPredictiveCalls['info'](_0xc906('0x1c5'),_0x270d93[_0xc906('0x2b')],_0x270d93[_0xc906('0x4a')]);_0x270d93[_0xc906('0x5a')]=0x0;_0x270d93[_0xc906('0xd1')]=0x0;}else if(_0x48c812<_0x453860&&_0x270d93[_0xc906('0x1c6')]===_0xc906('0x1c7')){clearPredictiveAttributes(_0x270d93);loggerPredictive[_0xc906('0x4d')](_0xc906('0x1c8'),_0xc906('0x1c9'),_0x453860,'startProgressive',_0x270d93[_0xc906('0x4a')]);}else if(_0x27c328<_0x270d93[_0xc906('0xd1')]&&_0x270d93[_0xc906('0x1c6')]===_0xc906('0x1c7')){clearPredictiveAttributes(_0x270d93);loggerPredictive[_0xc906('0x4d')](_0xc906('0x1ca'),_0xc906('0x1cb'),_0x27c328,_0xc906('0x1cc'),_0x270d93[_0xc906('0xd1')],_0xc906('0x2b'),_0x270d93[_0xc906('0x4a')]);}else if(!ifInterval(_0x270d93[_0xc906('0x1cd')],_0x270d93[_0xc906('0x2b')])&&_[_0xc906('0x44')](_0x270d93['startPredictive'])&&!_['isUndefined'](_0x270d93[_0xc906('0x2b')])){_0x270d93['startPredictive']=moment()[_0xc906('0x49')](_0xc906('0xc2'));loggerPredictive[_0xc906('0x4d')](_0x270d93[_0xc906('0x4a')],_0xc906('0x1ce'),_0x270d93['startPredictive']);hopperUtils[_0xc906('0x1cf')](_0x270d93[_0xc906('0x1cd')])[_0xc906('0xa2')](this[_0xc906('0x1d0')](_0x270d93))['then'](mergeDataErlangB(_0x270d93))[_0xc906('0xa2')](this[_0xc906('0x1d1')](_0x270d93))[_0xc906('0x9f')](loggerCatchPredictive(_0xc906('0x1d2'),_0x270d93));}else if(!ifInterval(_0x270d93['dialPredictiveInterval'],_0x270d93[_0xc906('0x2a')])){_0x270d93[_0xc906('0xd1')]=0x0;_0x270d93[_0xc906('0x2a')]=moment()[_0xc906('0x49')](_0xc906('0xc2'));loggerPredictive['info'](_0x270d93[_0xc906('0x4a')],'recalculate\x20predictive\x20at',_0x270d93[_0xc906('0x2a')]);clearInterval(_0x270d93[_0xc906('0x62')]);_0x270d93['handlePredictive']=undefined;hopperUtils['avgHandleTime'](_0x270d93['dialPredictiveInterval'])[_0xc906('0xa2')](this['getDataPredictive'](_0x270d93))[_0xc906('0xa2')](mergeDataErlangB(_0x270d93))['then'](this['startMethodPredictive'](_0x270d93))[_0xc906('0x9f')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x270d93));}else if(_0x270d93[_0xc906('0x1be')]&&_0x34947c<_0x270d93[_0xc906('0x1be')]-_0x29957b){clearPredictiveAttributes(_0x270d93);loggerPredictive[_0xc906('0x4d')](_0x270d93[_0xc906('0x4a')],_0xc906('0x1d3'),_0x34947c,_0xc906('0x1d4'),_0x270d93[_0xc906('0x1be')],'-',_0x29957b,'=',_0x270d93[_0xc906('0x1be')]-_0x29957b,')');}else if(_0x270d93[_0xc906('0x1be')]&&_0x34947c>_0x270d93[_0xc906('0x1be')]+_0x4ada67){clearPredictiveAttributes(_0x270d93);loggerPredictive['info'](_0x270d93[_0xc906('0x4a')],_0xc906('0x1d3'),_0x34947c,_0xc906('0x1d5'),_0x270d93[_0xc906('0x1be')],'+',_0x4ada67,'=',_0x270d93[_0xc906('0x1be')]+_0x4ada67,')');}};Dialer[_0xc906('0x1c')][_0xc906('0x1d0')]=function(_0x450347){var _0x54eea6=this;return function(_0x134dc4){return new Promise(function(_0x5dbaf0,_0x22e059){_[_0xc906('0x60')](_0x450347,_0x134dc4[0x0]);if(checkGetDataPredictive(_0x134dc4[0x0])){var _0x3ce330=_0x450347[_0xc906('0x1be')]=_0x450347['talking']+_0x450347[_0xc906('0x13a')];var _0x4244e1=_0x450347[_0xc906('0x1cd')]*0x3c;var _0x3e6535=_0x134dc4[0x0][_0xc906('0x54')]+_0x134dc4[0x0]['predictiveIntervalAvgHoldtime'];var _0xc44c2e=(_0x134dc4[0x0][_0xc906('0x1d6')]+_0x134dc4[0x0][_0xc906('0x50')]+_0x134dc4[0x0][_0xc906('0x51')])/_0x134dc4[0x0]['predictiveIntervalTotalCalls'];_0x450347[_0xc906('0x1d7')]=_0xc44c2e>0x0?_0xc44c2e:0x1;switch(_0x450347[_0xc906('0x1c6')]){case'dropRate':var _0x29569d=_0x450347['dialPredictiveOptimizationPercentage']/0x64;return _0x54eea6[_0xc906('0x1d8')](_0x3ce330,_0x4244e1,_0x3e6535,_0xc44c2e,_0x29569d)['then'](function(_0x1a93e4){return _0x5dbaf0(_0x1a93e4);});case'agentBusyFactor':var _0xf62649=_0x450347['dialPredictiveOptimizationPercentage']/0x64;return _0x54eea6[_0xc906('0x1d9')](_0x3ce330,_0x4244e1,_0x3e6535,_0xc44c2e,_0xf62649)[_0xc906('0xa2')](function(_0xb76027){return _0x5dbaf0(_0xb76027);});default:return _0x22e059(msgResponse(_0xc906('0x1da'),'Failure',_0xc906('0x1db')));}}else{return _0x22e059(msgResponse(_0xc906('0x1da'),_0xc906('0x91'),_0xc906('0x1dc')));}});};};Dialer['prototype'][_0xc906('0x1dd')]=function(_0x168514){var _0x11cbed=this;return function(_0x4b9129){return new Promise(function(_0x579bb7,_0x2559d9){_['merge'](_0x168514,_0x4b9129[0x0]);if(checkGetDataPredictive(_0x4b9129[0x0])){loggerPredictive[_0xc906('0x4d')](JSON[_0xc906('0x75')](_0x4b9129[0x0]));if(_0x168514['dialPredictiveOptimization']==='dropRate'){return _0x11cbed[_0xc906('0x150')](_0x168514['id'])[_0xc906('0xa2')](function(_0x69cf06){var _0x140f56=_0x168514[_0xc906('0x1de')]-_0x69cf06[0x0][_0xc906('0x1df')];var _0x3d0a7d=_0x168514[_0xc906('0x1cd')]*0x3c;var _0x59c5e1=_0x4b9129[0x0][_0xc906('0x54')]+_0x4b9129[0x0][_0xc906('0x52')];var _0x3d43a3=(_0x4b9129[0x0][_0xc906('0x1d6')]+_0x4b9129[0x0][_0xc906('0x50')]+_0x4b9129[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x4b9129[0x0][_0xc906('0x56')];var _0x53b4cd=_0x168514['dialPredictiveOptimizationPercentage']/0x64;_0x168514[_0xc906('0x1e0')]=_0x69cf06[0x0]['outboundQueuePauses']||0x0;_0x168514[_0xc906('0x1d7')]=_0x3d43a3>0x0?_0x3d43a3:0x1;return _0x11cbed[_0xc906('0x1d8')](_0x140f56,_0x3d0a7d,_0x59c5e1,_0x3d43a3,_0x53b4cd);})[_0xc906('0xa2')](function(_0x16c803){return _0x579bb7(_0x16c803);})['catch'](function(_0x2c76af){return _0x2559d9(msgResponse('[CatchErlangB]','Failure',JSON[_0xc906('0x75')](_0x2c76af)));});}if(_0x168514[_0xc906('0x1c6')]===_0xc906('0x1e1')){return _0x11cbed[_0xc906('0x150')](_0x168514['id'])[_0xc906('0xa2')](function(_0x19ea94){var _0x355a51=_0x168514[_0xc906('0x1de')]-_0x19ea94[0x0][_0xc906('0x1df')];var _0x444baf=_0x168514['dialPredictiveInterval']*0x3c;var _0x20fc0a=_0x4b9129[0x0][_0xc906('0x54')]+_0x4b9129[0x0][_0xc906('0x52')];var _0x5874f5=(_0x4b9129[0x0][_0xc906('0x1d6')]+_0x4b9129[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4b9129[0x0][_0xc906('0x51')])/_0x4b9129[0x0][_0xc906('0x56')];var _0x471d50=_0x168514[_0xc906('0x1e2')]/0x64;_0x168514['predictiveIntervalPauses']=_0x19ea94[0x0][_0xc906('0x1df')]||0x0;_0x168514[_0xc906('0x1d7')]=_0x5874f5>0x0?_0x5874f5:0x1;return _0x11cbed[_0xc906('0x1d9')](_0x355a51,_0x444baf,_0x20fc0a,_0x5874f5,_0x471d50);})[_0xc906('0xa2')](function(_0x30cb11){return _0x579bb7(_0x30cb11);})[_0xc906('0x9f')](function(_0x52dd9a){return _0x2559d9(msgResponse('[CatchErlangB]',_0xc906('0x91'),JSON['stringify'](_0x52dd9a)));});}}else{return _0x2559d9(msgResponse(_0xc906('0x1da'),_0xc906('0x91'),_0xc906('0x1dc')));}});};};Dialer[_0xc906('0x1c')][_0xc906('0x1d1')]=function(_0x35d106){var _0x32a570=this;return function(){var _0x474e21=0x0;var _0x3235bc=Math[_0xc906('0x1c0')](_0x35d106[_0xc906('0x5b')]*0x3e8);if(_0x3235bc>0x0){_0x3235bc=_0x3235bc<0x64?0x64:_0x3235bc;loggerPredictive[_0xc906('0x4d')](_0x35d106['name'],_0xc906('0x1e3'),_0x3235bc,_0xc906('0x1e4'));_0x35d106[_0xc906('0x62')]=setInterval(function(){_0x32a570[_0xc906('0x62')](_0x35d106);loggerPredictiveCalls['info'](_0xc906('0x1e5'),_0x474e21+=0x1);},_0x3235bc);}else{loggerPredictive['info'](_0x35d106['name'],_0xc906('0x1e6'));}};};Dialer[_0xc906('0x1c')][_0xc906('0x1e7')]=function(_0x4dc397,_0x4d0d96){var _0x1cf7c9=this;return function(_0x14de6e){if(_[_0xc906('0x4b')](_0x14de6e)){if(_[_0xc906('0xf3')](_0x4d0d96[_0xc906('0x154')])||!_0x4d0d96[_0xc906('0x1e8')]){if(_0x4dc397[_0xc906('0xb1')]===_0xc906('0xb')){_0x4dc397[_0xc906('0x72')]=_[_0xc906('0x44')](_0x4dc397[_0xc906('0x72')])?!![]:_0x4dc397[_0xc906('0x72')];var _0x520ca9=uuid['v4']();_0x1cf7c9['actions'][_0x520ca9]=new Action(_0x4dc397,_0x4d0d96,_0x520ca9);loggerBooked[_0xc906('0x4d')](_0xc906('0x1e9'),_0x520ca9,_0xc906('0x1ea'),JSON[_0xc906('0x75')](_0x4dc397[_0xc906('0x72')]),'Queue:\x20',_0x4dc397[_0xc906('0x4a')]);if(_0x4dc397[_0xc906('0x72')]){_0x4dc397[_0xc906('0x72')]=![];_0x1cf7c9[_0xc906('0xfb')][_0x1cf7c9[_0xc906('0x26')][_0x520ca9]['queue']]=[];ami[_0xc906('0x9a')]({'actionid':_0x520ca9,'action':'queuestatus','queue':_0x4dc397[_0xc906('0x4a')]})[_0xc906('0x9f')](function(){_0x1cf7c9[_0xc906('0xc0')](_0x4dc397);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x1cf7c9[_0xc906('0x26')][_0x520ca9][_0xc906('0xde')],'ListId':_0x1cf7c9[_0xc906('0x26')][_0x520ca9][_0xc906('0xdf')],'VoiceQueueId':_0x1cf7c9[_0xc906('0x26')][_0x520ca9][_0xc906('0xe0')]||undefined,'CampaignId':_0x1cf7c9[_0xc906('0x26')][_0x520ca9]['CampaignId']||undefined})[_0xc906('0x9f')](loggerCatch(_0xc906('0x1eb')));delete _0x1cf7c9[_0xc906('0x26')][_0x520ca9];});}else{loggerBooked[_0xc906('0x4d')](_0xc906('0x1ec'),JSON[_0xc906('0x75')](_0x4dc397[_0xc906('0x72')]),_0xc906('0x1ed'),_0x4dc397['name']);_0x1cf7c9[_0xc906('0xc0')](_0x4dc397);hopperUtils[_0xc906('0xdb')]({'active':![],'ContactId':_0x1cf7c9['actions'][_0x520ca9][_0xc906('0xde')],'ListId':_0x1cf7c9[_0xc906('0x26')][_0x520ca9][_0xc906('0xdf')],'VoiceQueueId':_0x1cf7c9[_0xc906('0x26')][_0x520ca9]['VoiceQueueId']||undefined,'CampaignId':_0x1cf7c9['actions'][_0x520ca9][_0xc906('0xeb')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x1cf7c9[_0xc906('0x26')][_0x520ca9];}}else{return _0x1cf7c9[_0xc906('0x15b')](_0x4dc397,_0x4d0d96);}}else{if(utils[_0xc906('0xce')](undefined,_0x4d0d96['scheduledat'])<_0x4dc397[_0xc906('0x1ee')]*0x3c){if(_0x4d0d96[_0xc906('0x158')]&&!_0x4d0d96[_0xc906('0x158')][_0xc906('0x1ef')]){_0x1cf7c9[_0xc906('0x20')][_0xc906('0xf8')](_0x4d0d96['id'])[_0xc906('0x1e')](function(){_0x1cf7c9[_0xc906('0xc0')](_0x4dc397);});}else{hopperUtils['unlockContact']({'active':![]},_0x4d0d96['id'],0x1)['finally'](function(){_0x1cf7c9['updateOriginated'](_0x4dc397);});}}else{_0x4dc397['outboundReCallsDay']+=0x1;_0x1cf7c9['updateOriginated'](_0x4dc397);if(_0x4dc397[_0xc906('0x1f0')]){hopperUtils[_0xc906('0xdb')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4d0d96[_0xc906('0xde')],'ListId':_0x4d0d96[_0xc906('0xdf')],'VoiceQueueId':_0x4d0d96[_0xc906('0xe0')]||undefined,'CampaignId':_0x4d0d96['CampaignId']||undefined})[_0xc906('0x9f')](loggerCatch(_0xc906('0x1f1')));hopperUtils[_0xc906('0xc9')](createObjHistory(_0x4dc397,_0x4d0d96,utils[_0xc906('0x67')][_0xc906('0x1f2')],0x17,'RecallInQueue'))[_0xc906('0x9f')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x1cf7c9[_0xc906('0x116')](createObjHistory(_0x4dc397,_0x4d0d96,utils[_0xc906('0x67')][_0xc906('0x1f3')],0x16,_0xc906('0x1f4')),_0xc906('0x1f5'),_0xc906('0x1f6'));}}}}else{_0x4dc397[_0xc906('0x1f7')]+=0x1;_0x1cf7c9[_0xc906('0x116')](createObjHistory(_0x4dc397,_0x4d0d96,utils[_0xc906('0x67')][_0xc906('0x1f8')],0xd,'Blacklist'),_0xc906('0x1f9'),_0xc906('0x1fa'));throw _0xc906('0x1fb');}};};Dialer[_0xc906('0x1c')][_0xc906('0x15a')]=function(_0x3627cd){var _0x4441de=this;var _0x47b634=_0x3627cd['limitCalls']-_0x3627cd[_0xc906('0x80')];emitCampaignSummary(_0x3627cd);if(_0x47b634>0x0&&_0x3627cd[_0xc906('0x1fc')]==0x0){if(_0x47b634>this[_0xc906('0x24')]){_0x47b634=this[_0xc906('0x24')];}_0x3627cd[_0xc906('0x1fc')]=0x1;hopperUtils[_0xc906('0x1fd')](_0x3627cd,_0x47b634)[_0xc906('0xa2')](function(_0x4560c4){_0x3627cd[_0xc906('0x1fc')]=0x0;if(_0x4560c4){if(!utils[_0xc906('0x1fe')](_0x4560c4)){_0x3627cd['message']=utils[_0xc906('0x67')][_0xc906('0x6c')];logger['info'](_0xc906('0x1ff')+_0x3627cd['name']);}else{_0x3627cd['originated']+=_0x4560c4[_0xc906('0x99')];_0x3627cd[_0xc906('0x66')]=utils[_0xc906('0x67')][_0xc906('0x200')];for(var _0x26c189=0x0;_0x26c189<_0x4560c4['length'];_0x26c189+=0x1){_0x3627cd[_0xc906('0x201')]+=0x1;if(_[_0xc906('0xf3')](_0x4560c4[_0x26c189])||_[_0xc906('0xf3')](_0x4560c4[_0x26c189][_0xc906('0x17b')])||_[_0xc906('0xf3')](_0x4560c4[_0x26c189][_0xc906('0x15f')])){_0x4441de[_0xc906('0x202')]('[actionOriginate]\x20',_0x3627cd,_0x4560c4[_0x26c189]);}else{hopperUtils[_0xc906('0x203')](_[_0xc906('0x76')](_0x4560c4[_0x26c189],[_0xc906('0xeb'),_0xc906('0x15f')]))['then'](_0x4441de[_0xc906('0x1e7')](_0x3627cd,_0x4560c4[_0x26c189]))[_0xc906('0x9f')](_0x4441de[_0xc906('0x153')](_0xc906('0x204'),_0x3627cd));}}}}})[_0xc906('0x9f')](loggerGetContactDialer('[getContactCampaign2]',_0x3627cd,_0x47b634));}};Dialer['prototype'][_0xc906('0xb3')]=function(_0x236dfe,_0x5b94c1){var _0x665baa=this;var _0xc2c407=[];if(_0x5b94c1<0x1||_0x236dfe['dialMethod']==='booked'){_0x5b94c1=0x1;}var _0x339d65=Math[_0xc906('0x1c0')](_0x236dfe[_0xc906('0x13a')]*_0x5b94c1)-_0x236dfe['originated'];if(_0x236dfe[_0xc906('0x205')]>0x0){var _0xaa3f4c=_0x236dfe[_0xc906('0x205')]-_0x236dfe[_0xc906('0x80')]-_0x236dfe[_0xc906('0x13c')]-_0x236dfe[_0xc906('0x13d')];if(_0x339d65>_0xaa3f4c){_0x339d65=_0xaa3f4c;}}if(_0x339d65>0x0&&_0x236dfe[_0xc906('0x1fc')]==0x0){if(_0x236dfe[_0xc906('0xb1')]==='booked'){_0x339d65=0x1;}if(_0x339d65>this[_0xc906('0x24')]){_0x339d65=this[_0xc906('0x24')];}for(var _0x372992 in this[_0xc906('0x23')]){if(typeof this[_0xc906('0x23')][_0x372992]!==_0xc906('0x14c')){if(this['agents'][_0x372992][_0xc906('0x6e')]===_0xc906('0x206')&&this[_0xc906('0x23')][_0x372992][_0xc906('0x88')]===_0xc906('0x89')){_0xc2c407[_0xc906('0xa0')](this[_0xc906('0x23')][_0x372992]['id']);}}}_0x236dfe['temp']=0x1;hopperUtils[_0xc906('0x207')](_0x236dfe,_0xc2c407,_0x339d65)[_0xc906('0xa2')](function(_0x27074){_0x236dfe[_0xc906('0x1fc')]=0x0;if(_0x27074){if(!utils[_0xc906('0x1fe')](_0x27074)){hopperUtils['countReScheduled'](_0x236dfe)[_0xc906('0xa2')](sendMessageReschedule(_0x236dfe))[_0xc906('0x9f')](loggerCatch(_0xc906('0x208')));}else{_0x236dfe[_0xc906('0x80')]+=_0x27074[_0xc906('0x99')];_0x236dfe['message']=_0x236dfe[_0xc906('0xb1')]===_0xc906('0xb')?utils[_0xc906('0x67')]['ACTIVE']:utils[_0xc906('0x67')][_0xc906('0x200')];for(var _0x5970ec=0x0;_0x5970ec<_0x27074[_0xc906('0x99')];_0x5970ec+=0x1){if(_[_0xc906('0xf3')](_0x27074[_0x5970ec])||_[_0xc906('0xf3')](_0x27074[_0x5970ec]['Contact'])||_[_0xc906('0xf3')](_0x27074[_0x5970ec][_0xc906('0x15f')])){_0x665baa[_0xc906('0x202')]('[actionOriginate]\x20',_0x236dfe,_0x27074[_0x5970ec]);}else{hopperUtils[_0xc906('0x209')](_[_0xc906('0x76')](_0x27074[_0x5970ec],[_0xc906('0xe0'),_0xc906('0x15f')]))[_0xc906('0xa2')](_0x665baa[_0xc906('0x1e7')](_0x236dfe,_0x27074[_0x5970ec]))[_0xc906('0x9f')](_0x665baa[_0xc906('0x153')](_0xc906('0x20a'),_0x236dfe));}}}}})[_0xc906('0x9f')](loggerGetContactDialer(_0xc906('0x20b'),_0x236dfe,_0x339d65));}};Dialer['prototype'][_0xc906('0x62')]=function(_0x2e25aa){if(_0x2e25aa[_0xc906('0x205')]>0x0){var _0x563ce3=_0x2e25aa[_0xc906('0x205')]-_0x2e25aa[_0xc906('0x80')]-_0x2e25aa[_0xc906('0x13c')];if(_0x563ce3>0x0&&_0x2e25aa[_0xc906('0x1fc')]==0x0){this[_0xc906('0x20c')](_0x2e25aa);}else{loggerPredictiveCalls[_0xc906('0x4d')]('[handlePredictive][limitChannel]');}}else{this[_0xc906('0x20c')](_0x2e25aa);}};Dialer[_0xc906('0x1c')][_0xc906('0x20c')]=function(_0x1c2261){var _0x57e9b6=this;var _0x123e71=[];_0x1c2261[_0xc906('0x80')]+=0x1;for(var _0x32b318 in this[_0xc906('0x23')]){if(typeof this['agents'][_0x32b318]!==_0xc906('0x14c')){if(this['agents'][_0x32b318][_0xc906('0x6e')]===_0xc906('0x206')&&this[_0xc906('0x23')][_0x32b318]['status']===_0xc906('0x89')){_0x123e71['push'](this[_0xc906('0x23')][_0x32b318]['id']);}}}_0x1c2261['temp']=0x1;return this['getContactDialer'](_0x1c2261['id'],_0x123e71,0x1,_0x1c2261[_0xc906('0x20d')],_0x1c2261)[_0xc906('0xa2')](function(_0x460d4c){_0x1c2261[_0xc906('0x1fc')]=0x1;if(_0x460d4c){if(!utils[_0xc906('0x1fe')](_0x460d4c)){utils[_0xc906('0x65')](_0x1c2261,0x1,0x0);return hopperUtils[_0xc906('0x20e')](_0x1c2261)[_0xc906('0xa2')](sendMessageReschedule(_0x1c2261))[_0xc906('0x9f')](loggerCatch('[countReScheduled]\x20'));}else{_0x1c2261['message']=utils[_0xc906('0x67')]['RUNNING'];if(_['isNil'](_0x460d4c[0x0])||_['isNil'](_0x460d4c[0x0]['Contact'])||_[_0xc906('0xf3')](_0x460d4c[0x0][_0xc906('0x15f')])){_0x57e9b6[_0xc906('0x202')](_0xc906('0x20a'),_0x1c2261,_0x460d4c[0x0]);}else{return hopperUtils['checkIsBlackList'](_['pick'](_0x460d4c[0x0],['VoiceQueueId',_0xc906('0x15f')]))[_0xc906('0xa2')](_0x57e9b6[_0xc906('0x1e7')](_0x1c2261,_0x460d4c[0x0]))[_0xc906('0x9f')](_0x57e9b6['loggerHandler']('[actionOriginatePredictive]\x20',_0x1c2261));}}}})['catch'](loggerGetContactDialer(_0xc906('0x20f'),_0x1c2261,0x1));};Dialer[_0xc906('0x1c')][_0xc906('0x1d8')]=function(_0x308e27,_0x340c97,_0x5ec41e,_0x3cf6aa,_0xd312b0,_0x5877d1){loggerPredictive['info'](_0xc906('0x210'));loggerPredictive[_0xc906('0x4d')](_0xc906('0x211'),_0x308e27);loggerPredictive[_0xc906('0x4d')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x340c97);loggerPredictive[_0xc906('0x4d')](_0xc906('0x212'),_0x5ec41e);loggerPredictive[_0xc906('0x4d')](_0xc906('0x213'),_0x3cf6aa);loggerPredictive['info'](_0xc906('0x214'),_0xd312b0);loggerPredictive['info']('---------------------------');return new Promise(function(_0x382bb7,_0x3d2304){if(_0x308e27<=0x0||isNaN(_0x308e27)){return _0x3d2304(msgResponse(_0xc906('0x215'),'Error',_0xc906('0x216')+_0x308e27));}if(_0x5ec41e<=0x0||isNaN(_0x5ec41e)){return _0x3d2304(msgResponse(_0xc906('0x215'),_0xc906('0x84'),_0xc906('0x217')+_0x5ec41e));}if(_0x3cf6aa<=0x0||isNaN(_0x3cf6aa)){return _0x3d2304(msgResponse(_0xc906('0x215'),_0xc906('0x84'),_0xc906('0x218')+_0x3cf6aa));}if(_0x340c97<=0x0||isNaN(_0x340c97)){return _0x3d2304(msgResponse(_0xc906('0x215'),_0xc906('0x84'),'interval\x20=\x20'+_0x340c97));}if(_0xd312b0<=0x0||isNaN(_0xd312b0)){return _0x3d2304(msgResponse(_0xc906('0x215'),'Error',_0xc906('0x219')+_0xd312b0));}_0x5877d1=_0x5877d1||0x0;var _0x13f892=0x1/_0x5ec41e;var _0x4a1d0c=0x0;var _0x29ac7c=0x0;var _0x5882d9=0x0;var _0x2a0028=0x0;for(var _0x357363=0x0;_0x5882d9<_0xd312b0;_0x357363+=0x1){_0x29ac7c=_0x357363/_0x340c97;_0x4a1d0c=(_0x3cf6aa*_0x29ac7c+_0x5877d1)/_0x13f892;_0x5882d9=utils[_0xc906('0x21a')](_0x4a1d0c,_0x308e27);_0x2a0028=_0x4a1d0c/_0x308e27*(0x1-utils[_0xc906('0x21a')](_0x4a1d0c,_0x308e27));}return _0x382bb7({'erlangCalls':_0x357363,'erlangCallToSecond':_0x340c97/_0x357363,'erlangAbandonmentRate':_0x5882d9,'erlangBusyFactor':_0x2a0028});});};Dialer[_0xc906('0x1c')][_0xc906('0x1d9')]=function(_0x3df2a9,_0x482203,_0x39be28,_0x502a6a,_0x21e907,_0x3d0774){loggerPredictive[_0xc906('0x4d')](_0xc906('0x21b'));loggerPredictive[_0xc906('0x4d')](_0xc906('0x211'),_0x3df2a9);loggerPredictive[_0xc906('0x4d')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x482203);loggerPredictive[_0xc906('0x4d')]('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',_0x39be28);loggerPredictive['info'](_0xc906('0x213'),_0x502a6a);loggerPredictive[_0xc906('0x4d')](_0xc906('0x21c'),_0x21e907);loggerPredictive['info'](_0xc906('0x55'));return new Promise(function(_0x17409c,_0x32ac38){if(_0x3df2a9<=0x0||isNaN(_0x3df2a9)){return _0x32ac38(msgResponse('[busyFactor]',_0xc906('0x84'),_0xc906('0x216')+_0x3df2a9));}if(_0x39be28<=0x0||isNaN(_0x39be28)){return _0x32ac38(msgResponse(_0xc906('0x21d'),'Error','Ts\x20=\x20'+_0x39be28));}if(_0x502a6a<=0x0||isNaN(_0x502a6a)){return _0x32ac38(msgResponse(_0xc906('0x21d'),_0xc906('0x84'),'p\x20=\x20'+_0x502a6a));}if(_0x482203<=0x0||isNaN(_0x482203)){return _0x32ac38(msgResponse(_0xc906('0x21d'),'Error','interval\x20=\x20'+_0x482203));}if(_0x21e907<=0x0||isNaN(_0x21e907)){return _0x32ac38(msgResponse('[busyFactor]',_0xc906('0x84'),'Umin\x20=\x20'+_0x21e907));}_0x3d0774=_0x3d0774||0x0;var _0x3cc49c=0x1/_0x39be28;var _0x5ed871=0x0;var _0x2117d6=0x0;var _0x4831d5=0x0;var _0x598e8b=0x0;for(var _0x11cb81=0x0;_0x598e8b<_0x21e907;_0x11cb81+=0x1){_0x2117d6=_0x11cb81/_0x482203;_0x5ed871=(_0x502a6a*_0x2117d6+_0x3d0774)/_0x3cc49c;_0x4831d5=utils[_0xc906('0x21a')](_0x5ed871,_0x3df2a9);_0x598e8b=_0x5ed871/_0x3df2a9*(0x1-utils['erlangb'](_0x5ed871,_0x3df2a9));}return _0x17409c({'erlangCalls':_0x11cb81,'erlangCallToSecond':_0x482203/_0x11cb81,'erlangAbandonmentRate':_0x4831d5,'erlangBusyFactor':_0x598e8b});});};module[_0xc906('0x21e')]=Dialer; \ No newline at end of file +var _0x0779=['[syncHangupIvr][createHistory]','dialQueueProject','AGI','cause-txt','Unknow','[syncHangupIvr]','running','statusMessage','getQueueCampaignStatusMessage','resolve','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','assign','throttle','filter','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','loopClearZombieChannels','clearZombieChannels','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','user:%s','handleIvr','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','originate','contact\x20is\x20undefine','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','getCaller','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerIdRandom','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','verifyAdditionalPhones','custom:agentnosuchnumber','dialNoSuchNumberRetryFrequency','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','busy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','available','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','startMethodPredictive','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','busyFactor','erlangCallToSecond','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','Blacklist','inBlackList','limitCalls','temp','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','Contact','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','getContactDialer','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','checkContactLowerLimitOriginate','[actionOriginatePredictive]\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----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','uuid','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','syncQueueStatusComplete','loopCampaigns','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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','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','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','erlangBusyFactor','merge','getSeconds','startProgressive','startPredictive\x20value\x20cleared','handlePredictive','error','stack','contactsRescheduled','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','message','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','endtime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','\x20INTERVAL_IS_NULL','Interval','Intervals','NULL_INTERVAL','isEmpty','CAMPAIGN_STATUS','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','[ifTime][Action]','Error','isTrunkReachable','active','status','reachable','SIP/%s','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','\x20Timezone\x20unknow\x20','length','push','Action','command','iftime\x20%s,%s','interval','timezones','content','indexOf','true','catch','all','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','isIVRCampaignActive','checkIfTime','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','power','handlePower','booked','Queue','method\x20not\x20recognized','dialGlobalInterval','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','silly','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','queue','uniqueid','ivr','updateOriginated','YYYY-MM-DD\x20HH:mm:ss','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','syncQueueCallerAbandon','droptime','predictiveIntervalDroppedCallsTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','countdropretry','dialDropRetryFrequency','callAdditionalPhoneAfterMin','state','voiceQueue','additional','queueCallerAbandonCreateState','add','minutes','ContactId','ListId','VoiceQueueId','[rescheduleContact][Drop]','Drop','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','statedesc','dropreason','CALLEREXIT','countabandonedretry','countglobal','dialAbandonedMaxRetry','rescheduleContact','CampaignId','Abandoned','channel','actionid','strategy','rrmemory','isNil','locked','stateinterface','idHopper','paused','roundrobin','run','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','response','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','custom:amd','buildObj','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','AMD','countmachineretry','amd','countbusyretry','countcongestionretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','outboundAnswerCallsDay','[syncAgentComplete][createHistory][0]','countnoanswerretry','ivrAnswerCallsDay'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0779,0xf5));var _0x9077=function(_0x557aed,_0x481fb1){_0x557aed=_0x557aed-0x0;var _0x42d0d9=_0x0779[_0x557aed];return _0x42d0d9;};'use strict';var util=require(_0x9077('0x0'));var _=require('lodash');var uuid=require(_0x9077('0x1'));var moment=require('moment');var rr=require('rr');var Redis=require('ioredis');var utils=require(_0x9077('0x2'));var hopperUtils=require(_0x9077('0x3'));var ut=require(_0x9077('0x4'));var config=require(_0x9077('0x5'));var logger=require(_0x9077('0x6'))(_0x9077('0x7'));var loggerBooked=require('../../../config/logger')('booked');var loggerPredictive=require('../../../config/logger')(_0x9077('0x8'));var loggerPredictiveCalls=require(_0x9077('0x6'))(_0x9077('0x9'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x9077('0xa'));var ami=require(_0x9077('0xb'));config[_0x9077('0xc')]=_[_0x9077('0xd')](config['redis'],{'host':_0x9077('0xe'),'port':0x18eb});var io=require(_0x9077('0xf'))(new Redis(config[_0x9077('0xc')]));var cmHopper=require(_0x9077('0x10'));var voiceQueueRt=require(_0x9077('0x11'));var RpcSetting=require(_0x9077('0x12'));var Interval=require(_0x9077('0x13'));var Action=require(_0x9077('0x14'));var History=require(_0x9077('0x15'));var Final=require(_0x9077('0x16'));var AgentComplete=require(_0x9077('0x17'));var QueueCallerAbandon=require(_0x9077('0x18'));var Hangup=require(_0x9077('0x19'));var ipAgi=process[_0x9077('0x1a')][_0x9077('0x1b')]||_0x9077('0x1c');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x9077('0x1d')][_0x9077('0x1e')]=function(_0x159519){this[_0x9077('0x1f')]=this[_0x9077('0x1f')]?this[_0x9077('0x1f')]['finally'](_0x159519):_0x159519();};function Dialer(_0x504a84,_0x90f750){this[_0x9077('0x20')]=new Sequence();this[_0x9077('0x21')]=_0x90f750;this[_0x9077('0x22')]=_0x504a84['voiceQueues'];this[_0x9077('0x23')]=_0x504a84['campaigns'];this[_0x9077('0x24')]=_0x504a84[_0x9077('0x24')];this[_0x9077('0x25')]=_0x504a84[_0x9077('0x25')];this[_0x9077('0x26')]=config[_0x9077('0x26')]||0x2;this[_0x9077('0x27')]={};this[_0x9077('0x28')]={};this[_0x9077('0x29')]={};this[_0x9077('0x2a')]={};this['optionPredictive']={};this[_0x9077('0x2b')]={};this['startProgressive']={};this[_0x9077('0x2c')]={};this[_0x9077('0x2d')]={};this[_0x9077('0x2e')]={};this[_0x9077('0x2f')]={};ami['on'](_0x9077('0x30'),this[_0x9077('0x31')][_0x9077('0x32')](this));ami['on'](_0x9077('0x33'),this['syncQueueCallerAbandon'][_0x9077('0x32')](this));ami['on'](_0x9077('0x34'),this['syncOriginateResponse'][_0x9077('0x32')](this));ami['on'](_0x9077('0x35'),this[_0x9077('0x36')][_0x9077('0x32')](this));ami['on'](_0x9077('0x37'),this[_0x9077('0xa')][_0x9077('0x32')](this));ami['on']('custom:queuesummarycomplete',this[_0x9077('0x38')][_0x9077('0x32')](this));ami['on'](_0x9077('0x39'),this[_0x9077('0x3a')][_0x9077('0x32')](this));ami['on'](_0x9077('0x3b'),this[_0x9077('0x3c')][_0x9077('0x32')](this));ami['on'](_0x9077('0x3d'),this[_0x9077('0x3e')]['bind'](this));ami['on']('queuemember',this[_0x9077('0x3f')]['bind'](this));ami['on']('queuestatuscomplete',this[_0x9077('0x40')][_0x9077('0x32')](this));this[_0x9077('0x41')]();this['loopClearZombieChannels']();RpcSetting[_0x9077('0x42')]()[_0x9077('0x43')](function(_0x4992f0){previewRecallmeReminderInterval=_0x4992f0[_0x9077('0x44')];});}function isNotNull(_0x3b8ecf){return _0x3b8ecf!==null&&!_[_0x9077('0x45')](_0x3b8ecf);}function msgResponse(_0x18fb48,_0x2f9a7a,_0x4492fd){return{'action':_0x18fb48,'response':_0x2f9a7a,'message':_0x4492fd,'stack':_0x4492fd};}function emit(_0x1001d7,_0x2f696e,_0x2b5979){io['to'](_0x1001d7)[_0x9077('0x46')](_0x2f696e,_0x2b5979);}function emitOutboundVoiceQueueSummary(_0x4588fe){if(_0x4588fe[_0x9077('0x47')]===_0x9077('0x48')){logger[_0x9077('0x49')](_0x9077('0x4a'),util[_0x9077('0x4b')](_0x4588fe,{'showHidden':![],'depth':null}));emit(util[_0x9077('0x4c')](_0x9077('0x4d'),_0x4588fe[_0x9077('0x4e')]),'voice_queue:save',_0x4588fe);}}function checkGetDataPredictive(_0x4297d9){if(isNotNull(_0x4297d9)&&!_['isEmpty'](_0x4297d9)){loggerPredictive[_0x9077('0x4f')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x9077('0x4f')](_0x9077('0x50'),_0x4297d9[_0x9077('0x51')]);loggerPredictive[_0x9077('0x4f')](_0x9077('0x52'),_0x4297d9[_0x9077('0x53')]);loggerPredictive[_0x9077('0x4f')](_0x9077('0x54'),_0x4297d9['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x9077('0x4f')](_0x9077('0x55'),_0x4297d9[_0x9077('0x56')]);loggerPredictive[_0x9077('0x4f')](_0x9077('0x57'),_0x4297d9['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x9077('0x4f')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4297d9[_0x9077('0x58')]);loggerPredictive[_0x9077('0x4f')](_0x9077('0x59'));if(_0x4297d9['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x4297d9['predictiveIntervalAvgTalktime'])&&_0x4297d9[_0x9077('0x58')]>0x0){return!![];}loggerPredictive[_0x9077('0x4f')](_0x9077('0x5a'));if(!_[_0x9077('0x45')](_0x4297d9[_0x9077('0x5b')])&&_0x4297d9['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive['info'](_0x9077('0x5c'));}else{loggerPredictive[_0x9077('0x4f')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x9077('0x4f')](_0x9077('0x5d'));}return![];}function mergeDataErlangB(_0x27f97d){return function(_0x57b4f3){loggerPredictive['info'](_0x9077('0x5e'));loggerPredictive[_0x9077('0x4f')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x57b4f3[_0x9077('0x5f')]);loggerPredictive[_0x9077('0x4f')](_0x9077('0x60'),_0x57b4f3['erlangCallToSecond']);loggerPredictive[_0x9077('0x4f')](_0x9077('0x61'),_0x57b4f3[_0x9077('0x62')]);loggerPredictive[_0x9077('0x4f')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x57b4f3[_0x9077('0x63')]);loggerPredictive[_0x9077('0x4f')](_0x9077('0x61'),_0x57b4f3['erlangAbandonmentRate']);loggerPredictive[_0x9077('0x4f')]('---------------------------');_[_0x9077('0x64')](_0x27f97d,_0x57b4f3);};}function ifInterval(_0xcdae6f,_0x38761f){if(_[_0x9077('0x45')](_0x38761f)){return![];}return utils[_0x9077('0x65')](undefined,_0x38761f)<_0xcdae6f*0x3c;}function clearPredictiveAttributes(_0x283374){if(_0x283374[_0x9077('0x66')]){_0x283374['startProgressive']=undefined;loggerPredictive[_0x9077('0x49')](_0x283374[_0x9077('0x4e')],'startProgressive\x20value\x20cleared');}if(_0x283374[_0x9077('0x2b')]){_0x283374['startPredictive']=undefined;loggerPredictive['debug'](_0x283374['name'],_0x9077('0x67'));}if(_0x283374['handlePredictive']){clearInterval(_0x283374[_0x9077('0x68')]);_0x283374[_0x9077('0x68')]=undefined;loggerPredictive[_0x9077('0x49')](_0x283374[_0x9077('0x4e')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x3d900a,_0x35d6a9){return function(_0x639fb8){loggerPredictive[_0x9077('0x69')](_0x35d6a9['name'],_0x3d900a);loggerPredictive[_0x9077('0x69')](_0x639fb8[_0x9077('0x6a')]);clearPredictiveAttributes(_0x35d6a9);};}function loggerCatch(_0x249170){return function(_0x3c1ae9){logger[_0x9077('0x69')](_0x249170,util[_0x9077('0x4b')](_0x3c1ae9,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x3d41f4,_0x35fd19,_0xfa9050){return function(_0x3baa06){utils['checkContactLowerLimitOriginate'](_0x35fd19,_0xfa9050,0x0);logger[_0x9077('0x69')](_0x3d41f4,util['inspect'](_0x3baa06,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5dfd80){return function(_0x4263fc){if(isNotNull(_0x4263fc)&&isNotNull(_0x4263fc[0x0])){if(_0x4263fc[0x0][_0x9077('0x6b')]>0x0){_0x5dfd80['message']=utils['CAMPAIGN_STATUS'][_0x9077('0x6c')];logger[_0x9077('0x4f')](_0x9077('0x6d')+_0x5dfd80[_0x9077('0x4e')],_0x4263fc[0x0][_0x9077('0x6b')],_0x9077('0x6e'));}else{_0x5dfd80[_0x9077('0x6f')]=utils['CAMPAIGN_STATUS'][_0x9077('0x70')];logger['info'](_0x9077('0x71')+_0x5dfd80[_0x9077('0x4e')]);}}};}function createObjHistory(_0x3fc485,_0x262a5c,_0xec053d,_0x10d988,_0x7da43){_0x3fc485[_0x9077('0x6f')]=_0xec053d;var _0xa0994c=new Action(_0x3fc485,_0x262a5c);var _0x3e4d64=new History(_0xa0994c);_0x3e4d64['state']=_0x10d988;_0x3e4d64['statedesc']=_0x7da43;_0x3e4d64[_0x9077('0x72')]=_0xa0994c['starttime'];return _0x3e4d64;}function unlockQueueStatus(_0x184056,_0x5b4e89){setTimeout(function(){if(_['isUndefined'](_0x184056[_0x9077('0x73')])){loggerBooked[_0x9077('0x69')](_0x9077('0x74'),_0x5b4e89);}_0x184056[_0x9077('0x73')]=!![];loggerBooked[_0x9077('0x4f')](_0x9077('0x75'),_0x5b4e89,JSON[_0x9077('0x76')](_[_0x9077('0x77')](_0x184056,[_0x9077('0x4e'),'queueStatusComplete'])));},0x1f3);}function checkInterval(_0x5a22ee){return function(){if(!isNotNull(_0x5a22ee['Interval'])){_0x5a22ee[_0x9077('0x6f')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0x5a22ee[_0x9077('0x4e')]+_0x9077('0x78');}if(!isNotNull(_0x5a22ee[_0x9077('0x79')][_0x9077('0x7a')])){_0x5a22ee[_0x9077('0x6f')]=utils['CAMPAIGN_STATUS'][_0x9077('0x7b')];throw _0x5a22ee['name']+_0x9077('0x78');}if(!isNotNull(_[_0x9077('0x7c')](_0x5a22ee['Interval'][_0x9077('0x7a')]))){_0x5a22ee['message']=utils[_0x9077('0x7d')]['NULL_INTERVAL'];throw _0x5a22ee[_0x9077('0x4e')]+_0x9077('0x78');}};}function checkIsIVRCampaignActive(_0x19d0d9){return function(){if(!utils['isIVRCampaignActive'](_0x19d0d9)){_0x19d0d9[_0x9077('0x6f')]=utils[_0x9077('0x7d')][_0x9077('0x7e')];throw _0x19d0d9[_0x9077('0x4e')]+_0x9077('0x7f');}};}function emitCampaignSummary(_0x255748){if(utils[_0x9077('0x80')](_0x255748)){emit(util[_0x9077('0x4c')](_0x9077('0x81'),_0x255748[_0x9077('0x4e')]),_0x9077('0x82'),_0x255748);}}function loggerCatchQueueSummary(_0x4d37b0,_0x291501){return function(_0x33fba7){clearPredictiveAttributes(_0x291501);emitCampaignSummary(_0x291501);loggerSyncQueueSummary[_0x9077('0x49')](_0x4d37b0,util[_0x9077('0x4b')](_0x33fba7,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x1733cf){if(_0x1733cf[_0x9077('0x83')]){if(_0x1733cf['originated']===0x0){_0x1733cf['sendMessageOneNotActive']=![];_0x1733cf[_0x9077('0x6f')]=utils[_0x9077('0x7d')][_0x9077('0x7e')];loggerSyncQueueSummary[_0x9077('0x49')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x1733cf[_0x9077('0x4e')],_0x9077('0x84'));}else{_0x1733cf[_0x9077('0x6f')]=utils[_0x9077('0x7d')]['DISACTIVED'];loggerSyncQueueSummary[_0x9077('0x49')](_0x9077('0x85'),_0x1733cf['name'],'is\x20disactive');}emitCampaignSummary(_0x1733cf);}}function myreject(_0x544e27){return function(_0x43277c){return _0x544e27(msgResponse(_0x9077('0x86'),_0x9077('0x87'),JSON[_0x9077('0x76')](_0x43277c)));};}Dialer[_0x9077('0x1d')][_0x9077('0x88')]=function(_0x4fd1e8){return!_['isUndefined'](_0x4fd1e8)&&_0x4fd1e8&&!_['isUndefined'](_0x4fd1e8[_0x9077('0x4e')])&&!_[_0x9077('0x45')](_0x4fd1e8[_0x9077('0x89')])&&_0x4fd1e8['active']&&(this['trunks'][util[_0x9077('0x4c')]('SIP/%s',_0x4fd1e8['name'])][_0x9077('0x8a')]===_0x9077('0x8b')||this[_0x9077('0x25')][util[_0x9077('0x4c')](_0x9077('0x8c'),_0x4fd1e8[_0x9077('0x4e')])][_0x9077('0x8a')]===_0x9077('0x8d'));};Dialer[_0x9077('0x1d')][_0x9077('0x8e')]=function(_0x348516){var _0x3a822f=this;return function(){if(!_0x3a822f['isTrunkReachable'](_0x348516[_0x9077('0x8f')])){if(!_0x3a822f[_0x9077('0x88')](_0x348516[_0x9077('0x90')])){_0x348516['message']=utils[_0x9077('0x7d')][_0x9077('0x91')];throw _0x348516[_0x9077('0x4e')]+_0x9077('0x92');}}};};Dialer[_0x9077('0x1d')]['checkIfTime']=function(_0x350e1e,_0x4763b9,_0x114b52,_0x52f8e9){var _0x32604a=this;return function(){var _0x152f9d=!![];return _0x32604a[_0x9077('0x93')](_0x350e1e,_0x4763b9,_0x114b52,_0x52f8e9,_0x152f9d);};};Dialer[_0x9077('0x1d')]['checkIfTimeIntervals']=function(_0x2e89f2,_0x2b496f,_0x1cd5c8,_0x282083){var _0x2785d5=this;return function(){var _0x3b14aa=![];return _0x2785d5[_0x9077('0x93')](_0x2e89f2[_0x9077('0x7a')],_0x2b496f,_0x1cd5c8,_0x282083,_0x3b14aa);};};Dialer[_0x9077('0x1d')][_0x9077('0x93')]=function(_0x1a2c2c,_0x463d65,_0x17623b,_0x541af3,_0x260801){var _0x2cf8f5=[];return new Promise(function(_0xf906bb,_0x4af4e1){if(!isNotNull(_0x1a2c2c)){_0x541af3['message']=utils[_0x9077('0x7d')][_0x9077('0x7b')];return _0x4af4e1(msgResponse(_0x9077('0x94'),_0x9077('0x95'),_0x17623b+_0x9077('0x96')));}if(_[_0x9077('0x7c')](_0x1a2c2c)){_0x541af3['message']=utils[_0x9077('0x7d')]['EMPTY_INTERVAL'];return _0x4af4e1(msgResponse(_0x9077('0x94'),_0x9077('0x95'),_0x17623b+_0x9077('0x97')));}if(_0x463d65&&_['isUndefined'](config['timezones'][_0x463d65])){_0x541af3[_0x9077('0x6f')]=utils[_0x9077('0x7d')]['UNKNOWN_TIMEZONE'];return _0x4af4e1(msgResponse(_0x9077('0x94'),_0x9077('0x95'),_0x17623b+_0x9077('0x98')+_0x463d65));}if(_['isArray'](_0x1a2c2c)){for(var _0x4ceb30=0x0;_0x4ceb30<_0x1a2c2c[_0x9077('0x99')];_0x4ceb30+=0x1){_0x2cf8f5[_0x9077('0x9a')](ami[_0x9077('0x9b')]({'action':_0x9077('0x9c'),'command':util['format'](_0x9077('0x9d'),_0x1a2c2c[_0x4ceb30][_0x9077('0x9e')],!_[_0x9077('0x45')](config[_0x9077('0x9f')][_0x463d65])?_0x463d65:'')})[_0x9077('0x43')](function(_0x4e6968){return _0x4e6968[_0x9077('0xa0')][_0x9077('0xa1')](_0x9077('0xa2'))>=0x0;})[_0x9077('0xa3')](myreject(_0x4af4e1)));}}else{_0x2cf8f5['push'](ami['Action']({'action':_0x9077('0x9c'),'command':util[_0x9077('0x4c')](_0x9077('0x9d'),_0x1a2c2c,!_['isUndefined'](config[_0x9077('0x9f')][_0x463d65])?_0x463d65:'')})[_0x9077('0x43')](function(_0x41befd){return _0x41befd['content'][_0x9077('0xa1')](_0x9077('0xa2'))>=0x0;})[_0x9077('0xa3')](myreject(_0x4af4e1)));}Promise[_0x9077('0xa4')](_0x2cf8f5)[_0x9077('0x43')](function(_0x6321f0){var _0x5cd2e3=_['some'](_0x6321f0);if(_0x5cd2e3){return _0xf906bb(_0x5cd2e3);}else{_0x541af3[_0x9077('0x6f')]=_0x260801?utils[_0x9077('0x7d')][_0x9077('0xa5')]:utils[_0x9077('0x7d')][_0x9077('0xa6')];return _0x4af4e1(msgResponse(_0x9077('0xa7'),'Failure',_0x9077('0xa8')+_0x260801+'\x20'+_0x17623b+_0x9077('0xa9')+util[_0x9077('0x4b')](_0x1a2c2c,{'showHidden':![],'depth':null})+_0x9077('0xaa')+_0x463d65));}})[_0x9077('0xa3')](function(_0x17dccd){return _0x4af4e1(msgResponse('ifTime','Failure',JSON[_0x9077('0x76')](_0x17dccd)));});});};Dialer[_0x9077('0x1d')][_0x9077('0x41')]=function(){var _0x44fbc9=this;return cmHopper[_0x9077('0xab')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x44fbc9['syncCampaigns']();},0x3e8);});};Dialer[_0x9077('0x1d')][_0x9077('0xac')]=function(){var _0x3e07be=this;var _0x27a236;for(var _0x40d46c in this[_0x9077('0x23')]){if(typeof this['campaigns'][_0x40d46c]!==_0x9077('0xad')){_0x27a236=this['campaigns'][_0x40d46c];if(utils[_0x9077('0x80')](_0x27a236)&&utils[_0x9077('0xae')](_0x27a236)){_0x27a236[_0x9077('0x83')]=!![];Promise['resolve']()[_0x9077('0x43')](checkIsIVRCampaignActive(_0x27a236))[_0x9077('0x43')](checkInterval(_0x27a236))[_0x9077('0x43')](_0x3e07be[_0x9077('0x8e')](_0x27a236))[_0x9077('0x43')](_0x3e07be[_0x9077('0xaf')](_0x27a236['dialGlobalInterval'],_0x27a236[_0x9077('0xb0')],_0x27a236[_0x9077('0x4e')],_0x27a236))['then'](_0x3e07be['checkIfTimeIntervals'](_0x27a236[_0x9077('0x79')],_0x27a236[_0x9077('0xb0')],_0x27a236['name'],_0x27a236))[_0x9077('0x43')](_0x3e07be[_0x9077('0xb1')](_0x27a236))[_0x9077('0xa3')](loggerCatchQueueSummary(_0x9077('0xb2'),_0x27a236));}else{notSendMessagesCampaign(_0x27a236);}}}};Dialer[_0x9077('0x1d')][_0x9077('0xb3')]=function(_0x480e82){if(_0x480e82[_0x9077('0xb4')]!==_0x9077('0x8')){clearPredictiveAttributes(_0x480e82);}switch(_0x480e82[_0x9077('0xb4')]){case _0x9077('0xb5'):this['handlePower'](_0x480e82,0x1);break;case _0x9077('0xb6'):this[_0x9077('0xb7')](_0x480e82,_0x480e82['dialPowerLevel']);break;case _0x9077('0x8'):this[_0x9077('0x8')](_0x480e82);break;case _0x9077('0xb8'):this[_0x9077('0xb7')](_0x480e82,0x1);break;default:logger[_0x9077('0x69')](_0x9077('0xb9'),_0x480e82[_0x9077('0x4e')],_0x9077('0xba'));}};Dialer[_0x9077('0x1d')][_0x9077('0x94')]=function(_0x2f7369,_0xc6141){var _0x149645=_0x2f7369[_0x9077('0xb0')];var _0x2dcc4e=_0xc6141?_0x2f7369[_0x9077('0xbb')]:_0x2f7369[_0x9077('0x79')][_0x9077('0x7a')];logger['silly'](_0x9077('0xbc'),_0x2dcc4e,_0x149645,_0x2f7369[_0x9077('0x4e')],util[_0x9077('0x4c')](_0x9077('0xbd'),_0x2f7369[_0x9077('0x4e')],_0x2f7369['id']));var _0x3303d1=null;return Interval[_0x9077('0xbe')](_0x2dcc4e,_0x149645)[_0x9077('0x43')](function(_0x5e452d){if(_0x5e452d===!![]){return _0x5e452d;}else{_0x2f7369[_0x9077('0x6f')]=_0xc6141?utils[_0x9077('0x7d')][_0x9077('0xa5')]:utils[_0x9077('0x7d')][_0x9077('0xa6')];_0x3303d1=msgResponse(_0x9077('0xa7'),_0x9077('0x95'),'Global:\x20'+_0xc6141+'\x20'+_0x2f7369['name']+_0x9077('0xa9')+util[_0x9077('0x4b')](_0x2dcc4e,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x149645);}if(_0x3303d1!==null){logger[_0x9077('0xbf')](_0x9077('0xc0'),_0x3303d1);_0x3303d1[_0x9077('0xc1')]=_0xc6141;throw _0x3303d1;}})[_0x9077('0xa3')](function(_0x202690){logger['error'](_0x9077('0xc2'),_0x202690);throw msgResponse(_0x9077('0x86'),'Error',util[_0x9077('0x4b')](_0x202690,{'showHidden':![],'depth':null}));});};Dialer[_0x9077('0x1d')][_0x9077('0x31')]=function(_0x137b78){if(this[_0x9077('0x22')][_0x137b78[_0x9077('0xc3')]]){if(this['uniqueId'][_0x137b78['uniqueid']]&&this[_0x9077('0x2a')][_0x137b78[_0x9077('0xc4')]]['type']!==_0x9077('0xc5')){this[_0x9077('0xc6')](this[_0x9077('0x22')][_0x137b78[_0x9077('0xc3')]]);this['uniqueId'][_0x137b78[_0x9077('0xc4')]]['answertime']=moment()[_0x9077('0x4c')](_0x9077('0xc7'));}}};Dialer[_0x9077('0x1d')][_0x9077('0x36')]=function(_0x583a52){var _0x3d1580=this[_0x9077('0x2a')][_0x583a52['uniqueid']];if(this['voiceQueues'][_0x583a52[_0x9077('0xc3')]]){if(_0x3d1580&&_0x3d1580[_0x9077('0x47')]!=='ivr'){delete this[_0x9077('0x2a')][_0x583a52['uniqueid']];this['voiceQueues'][_0x583a52[_0x9077('0xc3')]]['outboundAnswerCallsDay']+=0x1;var _0x379e2d=new AgentComplete(_0x3d1580,_0x583a52);if(_0x583a52[_0x9077('0xc8')]==='agent'){_0x379e2d[_0x9077('0xc9')]=this[_0x9077('0x22')][_0x583a52[_0x9077('0xc3')]][_0x9077('0xca')]&&this[_0x9077('0x22')][_0x583a52[_0x9077('0xc3')]][_0x9077('0xcb')]?moment()[_0x9077('0x4c')](_0x9077('0xc7')):undefined;}hopperUtils[_0x9077('0xcc')](_0x379e2d)[_0x9077('0xa3')](loggerCatch(_0x9077('0xcd')));hopperUtils[_0x9077('0xce')](_0x379e2d)['catch'](loggerCatch(_0x9077('0xcf')));}}};Dialer[_0x9077('0x1d')][_0x9077('0xd0')]=function(_0x430a87){var _0x2e2e33=this[_0x9077('0x2a')][_0x430a87['uniqueid']];var _0x22483f=this;var _0x55b772=![];var _0x3fc01b;var _0x37d83d;if(this[_0x9077('0x22')][_0x430a87[_0x9077('0xc3')]]){if(_0x2e2e33&&_0x2e2e33[_0x9077('0x47')]!=='ivr'){delete this['uniqueId'][_0x430a87['uniqueid']];this[_0x9077('0xc6')](this[_0x9077('0x22')][_0x430a87[_0x9077('0xc3')]]);_0x2e2e33['droptime']=moment()[_0x9077('0x4c')](_0x9077('0xc7'));var _0x4b3f32=new QueueCallerAbandon(_0x2e2e33,_0x430a87);if(utils[_0x9077('0x65')](_0x2e2e33[_0x9077('0xd1')],_0x2e2e33['responsetime'])>=_0x2e2e33['dialQueueTimeout']){this['voiceQueues'][_0x430a87['queue']][_0x9077('0xd2')]+=0x1;this[_0x9077('0x22')][_0x430a87['queue']][_0x9077('0xd3')]+=0x1;this[_0x9077('0x22')][_0x430a87['queue']][_0x9077('0xd4')]+=0x1;_0x4b3f32['state']=0xa;_0x4b3f32['statedesc']='Drop';_0x4b3f32['dropreason']='TIMEOUT';_0x4b3f32['agiafterat']=this[_0x9077('0x22')][_0x430a87[_0x9077('0xc3')]][_0x9077('0xca')]?moment()[_0x9077('0x4c')](_0x9077('0xc7')):undefined;_0x4b3f32[_0x9077('0xd5')]+=0x1;_0x4b3f32['countglobal']+=0x1;_0x3fc01b=this[_0x9077('0x22')][_0x430a87[_0x9077('0xc3')]][_0x9077('0xd6')];_0x37d83d=this['voiceQueues'][_0x430a87['queue']][_0x9077('0xd7')];hopperUtils['verifyAdditionalPhones'](_0x4b3f32,_0x4b3f32[_0x9077('0xd8')],_0x2e2e33[_0x9077('0xd9')])[_0x9077('0x43')](function(_0x4843b3){_0x55b772=_0x4843b3[_0x9077('0xda')]==0x1;if(_0x4b3f32[_0x9077('0xd5')]>=_0x22483f['voiceQueues'][_0x430a87['queue']]['dialDropMaxRetry']){_0x22483f[_0x9077('0xdb')](_0x4b3f32,_0x4843b3['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x4b3f32['countdropretry'],'scheduledat':moment()[_0x9077('0xdc')](_0x22483f[_0x9077('0x22')][_0x430a87['queue']][_0x9077('0xd6')],_0x9077('0xdd'))['format'](_0x9077('0xc7')),'ContactId':_0x2e2e33[_0x9077('0xde')],'ListId':_0x2e2e33[_0x9077('0xdf')],'VoiceQueueId':_0x2e2e33[_0x9077('0xe0')]||undefined,'CampaignId':_0x2e2e33['CampaignId']||undefined})[_0x9077('0xa3')](loggerCatch(_0x9077('0xe1')));var _0x3f34a0=new History(_0x4b3f32);_0x3f34a0['state']=0xa;_0x3f34a0['statedesc']=_0x9077('0xe2');_0x3f34a0['starttime']=moment()[_0x9077('0x4c')](_0x9077('0xc7'));_0x3f34a0[_0x9077('0x72')]=_0x3f34a0[_0x9077('0xe3')];_0x3f34a0['calleridname']=_0x4b3f32[_0x9077('0xe4')];_0x3f34a0[_0x9077('0xe5')]=_0x4b3f32[_0x9077('0xe5')];hopperUtils['createHistory'](_0x3f34a0)[_0x9077('0xa3')](loggerCatch(_0x9077('0xe6')));}})[_0x9077('0x43')](function(){if(_0x55b772)hopperUtils[_0x9077('0xe7')](_0x4b3f32,_0x3fc01b,_0x37d83d)[_0x9077('0x43')](function(){return 0x1;});});}else{this[_0x9077('0x22')][_0x430a87['queue']][_0x9077('0x56')]+=0x1;this[_0x9077('0x22')][_0x430a87[_0x9077('0xc3')]][_0x9077('0xe8')]+=0x1;_0x4b3f32['state']=0xb;_0x4b3f32[_0x9077('0xe9')]='Abandoned';_0x4b3f32[_0x9077('0xea')]=_0x9077('0xeb');_0x4b3f32[_0x9077('0xec')]+=0x1;_0x4b3f32[_0x9077('0xed')]+=0x1;_0x3fc01b=this['voiceQueues'][_0x430a87[_0x9077('0xc3')]]['dialAbandonedRetryFrequency'];_0x37d83d=this[_0x9077('0x22')][_0x430a87[_0x9077('0xc3')]][_0x9077('0xd7')];hopperUtils['verifyAdditionalPhones'](_0x4b3f32,_0x4b3f32[_0x9077('0xd8')],_0x2e2e33[_0x9077('0xd9')])[_0x9077('0x43')](function(_0x10a7bf){if(_0x4b3f32[_0x9077('0xec')]>=_0x22483f[_0x9077('0x22')][_0x430a87[_0x9077('0xc3')]][_0x9077('0xee')]){_0x22483f[_0x9077('0xdb')](_0x4b3f32,_0x10a7bf[_0x9077('0xda')]);}else{hopperUtils[_0x9077('0xef')]({'active':![],'countabandonedretry':_0x4b3f32[_0x9077('0xec')],'scheduledat':moment()['add'](_0x22483f['voiceQueues'][_0x430a87[_0x9077('0xc3')]]['dialAbandonedRetryFrequency'],_0x9077('0xdd'))[_0x9077('0x4c')](_0x9077('0xc7')),'ContactId':_0x2e2e33[_0x9077('0xde')],'ListId':_0x2e2e33[_0x9077('0xdf')],'VoiceQueueId':_0x2e2e33[_0x9077('0xe0')]||undefined,'CampaignId':_0x2e2e33[_0x9077('0xf0')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));var _0x34b43a=new History(_0x4b3f32);_0x34b43a[_0x9077('0xd8')]=0xb;_0x34b43a['statedesc']=_0x9077('0xf1');_0x34b43a[_0x9077('0xe3')]=moment()[_0x9077('0x4c')](_0x9077('0xc7'));_0x34b43a['endtime']=_0x34b43a['starttime'];_0x34b43a['calleridname']=_0x4b3f32[_0x9077('0xe4')];_0x34b43a[_0x9077('0xe5')]=_0x4b3f32['calleridnum'];hopperUtils[_0x9077('0xcc')](_0x34b43a)[_0x9077('0xa3')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x9077('0x43')](function(){if(_0x55b772)hopperUtils[_0x9077('0xe7')](_0x4b3f32,_0x3fc01b,_0x37d83d)[_0x9077('0x43')](function(){return 0x1;});});}}}};Dialer['prototype'][_0x9077('0x3c')]=function(_0x305c4b){if(this['actions'][_0x305c4b[_0x9077('0xc4')]]){this[_0x9077('0x28')][_0x305c4b[_0x9077('0xc4')]][_0x9077('0xf2')]=_0x305c4b['channel'];}if(this[_0x9077('0x2a')][_0x305c4b[_0x9077('0xc4')]]){this[_0x9077('0x2a')][_0x305c4b[_0x9077('0xc4')]][_0x9077('0xf2')]=_0x305c4b[_0x9077('0xf2')];}};Dialer[_0x9077('0x1d')]['syncQueueMember']=function(_0x3b096a){if(!this[_0x9077('0x28')][_0x3b096a[_0x9077('0xf3')]]){return;}var _0x35d1b5=this[_0x9077('0x22')][this['actions'][_0x3b096a['actionid']]['queue']][_0x9077('0xf4')]||_0x9077('0xf5');if(_0x35d1b5==='roundrobin'){if(this['actions'][_0x3b096a['actionid']]&&_[_0x9077('0xf6')](this['actions'][_0x3b096a[_0x9077('0xf3')]][_0x9077('0xf7')])&&_0x3b096a[_0x9077('0x8a')]==='1'&&_0x3b096a['paused']==='0'){if(this[_0x9077('0x24')][_0x3b096a[_0x9077('0xf8')]]){if(!this[_0x9077('0x24')][_0x3b096a[_0x9077('0xf8')]][_0x9077('0xf7')]){this['agents'][_0x3b096a[_0x9077('0xf8')]][_0x9077('0xf7')]=!![];this[_0x9077('0x28')][_0x3b096a[_0x9077('0xf3')]][_0x9077('0xf7')]=!![];this[_0x9077('0x28')][_0x3b096a[_0x9077('0xf3')]][_0x9077('0xf8')]=_0x3b096a[_0x9077('0xf8')];}}}}else if(_0x35d1b5===_0x9077('0xf5')){if(this[_0x9077('0x28')][_0x3b096a[_0x9077('0xf3')]]){if(this[_0x9077('0x24')][_0x3b096a['stateinterface']]){this[_0x9077('0x28')][_0x3b096a[_0x9077('0xf3')]]['stateinterface']=_0x3b096a[_0x9077('0xf8')];if(_[_0x9077('0xf6')](this['queueBooked'][this['actions'][_0x3b096a['actionid']][_0x9077('0xc3')]])){this[_0x9077('0x2d')][this['actions'][_0x3b096a[_0x9077('0xf3')]][_0x9077('0xc3')]]=[];}this[_0x9077('0x2d')][this[_0x9077('0x28')][_0x3b096a['actionid']][_0x9077('0xc3')]][_0x9077('0x9a')](_[_0x9077('0x64')](_[_0x9077('0x77')](this[_0x9077('0x28')][_0x3b096a[_0x9077('0xf3')]],[_0x9077('0xf9'),_0x9077('0xf8')]),{'status':_0x3b096a[_0x9077('0x8a')],'paused':_0x3b096a[_0x9077('0xfa')]}));}}}};Dialer['prototype'][_0x9077('0x40')]=function(_0x3a3db7){if(!this['actions'][_0x3a3db7[_0x9077('0xf3')]]){return;}var _0x417189=this;var _0x9edae2=this[_0x9077('0x22')][this['actions'][_0x3a3db7[_0x9077('0xf3')]]['queue']];var _0x18b3bb=_0x9edae2[_0x9077('0xf4')]||_0x9077('0xf5');if(_0x18b3bb===_0x9077('0xfb')){if(this[_0x9077('0x28')][_0x3a3db7['actionid']]&&this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]][_0x9077('0xf8')]){this['preview'][_0x9077('0xfc')](this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]][_0x9077('0xf9')],this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]]['stateinterface'])[_0x9077('0xa3')](function(_0x1856b6){logger['error'](_0x9077('0xfd'),util[_0x9077('0x4b')](_0x1856b6,{'showHidden':![],'depth':null}));})[_0x9077('0xfe')](function(){_0x417189[_0x9077('0xc6')](_0x417189[_0x9077('0x22')][_0x417189['actions'][_0x3a3db7['actionid']][_0x9077('0xc3')]]);_0x417189['agents'][_0x417189['actions'][_0x3a3db7[_0x9077('0xf3')]]['stateinterface']][_0x9077('0xf7')]=![];delete _0x417189['actions'][_0x3a3db7['actionid']];unlockQueueStatus(_0x9edae2);});}else{this[_0x9077('0xc6')](this['voiceQueues'][this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]][_0x9077('0xc3')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]][_0x9077('0xde')],'ListId':this[_0x9077('0x28')][_0x3a3db7['actionid']][_0x9077('0xdf')],'VoiceQueueId':this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]][_0x9077('0xe0')]||undefined,'CampaignId':this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]][_0x9077('0xf0')]||undefined})[_0x9077('0xa3')](loggerCatch(_0x9077('0xff')));delete this[_0x9077('0x28')][_0x3a3db7['actionid']];unlockQueueStatus(_0x9edae2);}}else if(_0x18b3bb==='rrmemory'){var _0x2a4edb;if(this['actions'][_0x3a3db7[_0x9077('0xf3')]]&&!_[_0x9077('0x7c')](this['queueBooked'][this['actions'][_0x3a3db7[_0x9077('0xf3')]][_0x9077('0xc3')]])){if(this['queueBookedRR'][_0x417189[_0x9077('0x28')][_0x3a3db7['actionid']][_0x9077('0xc3')]]){this[_0x9077('0x2e')][_0x417189['actions'][_0x3a3db7[_0x9077('0xf3')]][_0x9077('0xc3')]]=this['queueBookedRR'][this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]][_0x9077('0xc3')]]?this[_0x9077('0x2e')][this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]]['queue']]:this[_0x9077('0x2d')][this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]][_0x9077('0xc3')]]?this[_0x9077('0x2d')][this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]][_0x9077('0xc3')]]['_rr']||0x0:0x0;}this[_0x9077('0x2d')][this[_0x9077('0x28')][_0x3a3db7[_0x9077('0xf3')]]['queue']]['_rr']=this['queueBookedRR'][this['actions'][_0x3a3db7['actionid']][_0x9077('0xc3')]];for(var _0x2a5657=0x0;_0x2a5657=_0x2cf5cd[_0x9077('0x126')]){_0x199cd6[_0x9077('0x127')](_0x47d4ed,_0x30b3d0,_0x380a03,_0x9077('0x128'));}else{if(_0x47d4ed['countmachineretry']>=_0x2cf5cd[_0x9077('0x129')]){_0x199cd6[_0x9077('0x12a')](_0x47d4ed,_0x30b3d0,_0x380a03,_0x9077('0x12b'));}else{hopperUtils[_0x9077('0xef')]({'active':![],'countmachineretry':_0x47d4ed[_0x9077('0x120')],'scheduledat':moment()['add'](_0x2cf5cd[_0x9077('0x12c')],_0x9077('0xdd'))[_0x9077('0x4c')](_0x9077('0xc7')),'ContactId':_0x47d4ed[_0x9077('0xde')],'ListId':_0x47d4ed[_0x9077('0xdf')],'VoiceQueueId':_0x47d4ed[_0x9077('0xe0')]||undefined,'CampaignId':_0x47d4ed[_0x9077('0xf0')]||undefined})[_0x9077('0xa3')](loggerCatch(_0x9077('0x12d')));_0x30b3d0({'reschedule':0x1});}}});}if(_0x198d23[_0x9077('0x47')]===_0x9077('0xc5')&&this[_0x9077('0x23')][_0x198d23[_0x9077('0xc3')]][_0x9077('0x112')]&&_0x41bcdb[_0x9077('0x113')]===_0x9077('0x114')){delete this[_0x9077('0x2a')][_0x41bcdb[_0x9077('0xc4')]];this[_0x9077('0xc6')](this['campaigns'][_0x198d23[_0x9077('0xc3')]]);_0x137867=new Hangup(_0x198d23,_0x41bcdb);_0x137867[_0x9077('0xd8')]=0x12;_0x137867[_0x9077('0xe9')]=_0x9077('0x116');_0x137867[_0x9077('0x117')]=_0x9077('0x11f');ami['emit'](_0x9077('0x118'),ut[_0x9077('0x119')](_0x137867,'amd'));this[_0x9077('0x11a')](_0x137867,_0x9077('0x12e'),_0x9077('0x12f'));}if(_0x198d23[_0x9077('0x47')]==='ivr'&&this[_0x9077('0x23')][_0x198d23[_0x9077('0xc3')]][_0x9077('0x112')]&&_0x41bcdb[_0x9077('0x113')]===_0x9077('0x11d')){return new Promise(function(_0x3a1d08,_0x1a4773){delete _0x199cd6[_0x9077('0x2a')][_0x41bcdb[_0x9077('0xc4')]];_0x199cd6[_0x9077('0xc6')](_0x199cd6[_0x9077('0x23')][_0x198d23[_0x9077('0xc3')]]);_0x199cd6[_0x9077('0x23')][_0x198d23[_0x9077('0xc3')]][_0x9077('0x130')]+=0x1;_0x199cd6[_0x9077('0x23')][_0x198d23['queue']][_0x9077('0x115')]+=0x1;var _0x2d4dd9=_0x199cd6[_0x9077('0x23')][_0x198d23[_0x9077('0xc3')]];var _0x4fe667=new Hangup(_0x198d23,_0x41bcdb);_0x4fe667[_0x9077('0xd8')]=0x13;_0x4fe667[_0x9077('0xe9')]='Machine';_0x4fe667[_0x9077('0x117')]=_0x9077('0x11f');_0x4fe667[_0x9077('0x120')]+=0x1;_0x4fe667['countglobal']+=0x1;_0x4fe667[_0x9077('0x121')]=!![];ami[_0x9077('0x46')](_0x9077('0x118'),ut[_0x9077('0x119')](_0x4fe667,_0x9077('0x121')));hopperUtils[_0x9077('0xcc')](_0x4fe667)[_0x9077('0xa3')](loggerCatch(_0x9077('0x131')));if(_0x4fe667['countbusyretry']+_0x4fe667[_0x9077('0x123')]+_0x4fe667[_0x9077('0x132')]+_0x4fe667['countnosuchnumberretry']+_0x4fe667[_0x9077('0xd5')]+_0x4fe667[_0x9077('0xec')]+_0x4fe667['countmachineretry']+_0x4fe667[_0x9077('0x125')]>=_0x2d4dd9[_0x9077('0x126')]){_0x199cd6[_0x9077('0x127')](_0x4fe667,_0x3a1d08,_0x1a4773,_0x9077('0x128'));}else{if(_0x4fe667['countmachineretry']>=_0x2d4dd9[_0x9077('0x129')]){_0x199cd6[_0x9077('0x12a')](_0x4fe667,_0x3a1d08,_0x1a4773,'reason\x2019\x20machine....');}else{hopperUtils[_0x9077('0xef')]({'active':![],'countmachineretry':_0x4fe667[_0x9077('0x120')],'scheduledat':moment()[_0x9077('0xdc')](_0x2d4dd9[_0x9077('0x12c')],_0x9077('0xdd'))['format'](_0x9077('0xc7')),'ContactId':_0x4fe667[_0x9077('0xde')],'ListId':_0x4fe667[_0x9077('0xdf')],'VoiceQueueId':_0x4fe667['VoiceQueueId']||undefined,'CampaignId':_0x4fe667[_0x9077('0xf0')]||undefined})[_0x9077('0xa3')](loggerCatch(_0x9077('0x12d')));_0x3a1d08({'reschedule':0x1});}}});}}};Dialer[_0x9077('0x1d')]['syncHangup']=function(_0x2e792e){var _0x34a49a=this[_0x9077('0x2a')][_0x2e792e[_0x9077('0xc4')]];var _0x3c68cc;if(_0x34a49a&&_0x34a49a[_0x9077('0x47')]===_0x9077('0xc5')){delete this[_0x9077('0x2a')][_0x2e792e[_0x9077('0xc4')]];this[_0x9077('0xc6')](this[_0x9077('0x23')][_0x34a49a[_0x9077('0xc3')]]);this[_0x9077('0x23')][_0x34a49a[_0x9077('0xc3')]][_0x9077('0x133')]+=0x1;_0x3c68cc=new Hangup(_0x34a49a,_0x2e792e);hopperUtils[_0x9077('0xcc')](_0x3c68cc)['catch'](loggerCatch(_0x9077('0x134')));hopperUtils[_0x9077('0xce')](_0x3c68cc)[_0x9077('0xa3')](loggerCatch('[syncHangupIvr]'));}if(_0x34a49a&&_0x34a49a[_0x9077('0x47')]!==_0x9077('0xc5')&&isNotNull(this[_0x9077('0x22')][_0x34a49a[_0x9077('0xc3')]][_0x9077('0x135')])){delete this[_0x9077('0x2a')][_0x2e792e[_0x9077('0xc4')]];this[_0x9077('0xc6')](this[_0x9077('0x22')][_0x34a49a['queue']]);this[_0x9077('0x22')][_0x34a49a['queue']][_0x9077('0x130')]+=0x1;this['voiceQueues'][_0x34a49a[_0x9077('0xc3')]]['outboundAnswerAgiCallsDay']+=0x1;_0x3c68cc=new Hangup(_0x34a49a,_0x2e792e);_0x3c68cc['state']=0x10;_0x3c68cc[_0x9077('0xe9')]='AnswerAGI';_0x3c68cc[_0x9077('0x117')]=_0x9077('0x136');hopperUtils[_0x9077('0xcc')](_0x3c68cc)[_0x9077('0xa3')](loggerCatch(_0x9077('0x134')));hopperUtils[_0x9077('0xce')](_0x3c68cc)[_0x9077('0xa3')](loggerCatch('[syncHangupIvr]'));}if(_0x34a49a&&_0x34a49a[_0x9077('0x47')]!==_0x9077('0xc5')&&!isNotNull(this[_0x9077('0x22')][_0x34a49a[_0x9077('0xc3')]][_0x9077('0x135')])){delete this[_0x9077('0x2a')][_0x2e792e[_0x9077('0xc4')]];this[_0x9077('0xc6')](this[_0x9077('0x22')][_0x34a49a[_0x9077('0xc3')]]);this[_0x9077('0x22')][_0x34a49a[_0x9077('0xc3')]]['outboundUnknownCallsDay']+=0x1;_0x3c68cc=new Hangup(_0x34a49a,_0x2e792e);_0x3c68cc['state']=0xc;_0x3c68cc[_0x9077('0xe9')]=_0x2e792e[_0x9077('0x137')];_0x3c68cc['membername']=_0x9077('0x138');hopperUtils[_0x9077('0xcc')](_0x3c68cc)[_0x9077('0xa3')](loggerCatch(_0x9077('0x134')));hopperUtils[_0x9077('0xce')](_0x3c68cc)[_0x9077('0xa3')](loggerCatch(_0x9077('0x139')));}};Dialer[_0x9077('0x1d')][_0x9077('0xa')]=function(_0x3033b7){var _0x27fc33=this;if(!_0x27fc33[_0x9077('0x2f')][_0x3033b7[_0x9077('0x4e')]]){_0x27fc33[_0x9077('0x2f')][_0x3033b7[_0x9077('0x4e')]]={'running':![]};}else if(_0x27fc33[_0x9077('0x2f')][_0x3033b7[_0x9077('0x4e')]]['running']===!![]){return;}else if(_0x27fc33[_0x9077('0x2f')][_0x3033b7[_0x9077('0x4e')]][_0x9077('0x13a')]===![]){_0x27fc33[_0x9077('0x2f')][_0x3033b7[_0x9077('0x4e')]][_0x9077('0x13a')]=!![];}var _0x566fab=_0x27fc33[_0x9077('0x22')][_0x3033b7[_0x9077('0x4e')]];var _0x52ba07=_0x566fab[_0x9077('0x6f')]!==utils[_0x9077('0x7d')][_0x9077('0x7e')];var _0x6fcb38=utils['isPreviewCampaign'](_0x566fab);_0x566fab[_0x9077('0x13b')]=utils[_0x9077('0x13c')](_0x566fab,_0x27fc33[_0x9077('0x25')]);Promise[_0x9077('0x13d')]()[_0x9077('0x43')](function(){if(_0x566fab['statusMessage']===utils[_0x9077('0x7d')]['INACTIVE']){if(_0x52ba07){clearPredictiveAttributes(_0x566fab);_0x3033b7[_0x9077('0x2b')]=undefined;_0x3033b7[_0x9077('0x66')]=undefined;}if(_0x566fab[_0x9077('0x13b')]===utils['CAMPAIGN_STATUS'][_0x9077('0x7e')]){_0x3033b7['available']=0x0;_0x3033b7[_0x9077('0xfa')]=0x0;_0x3033b7[_0x9077('0x13e')]=0x0;_0x3033b7[_0x9077('0x13f')]=0x0;_0x3033b7[_0x9077('0x140')]=0x0;}}else if(_0x566fab[_0x9077('0x13b')]===utils[_0x9077('0x7d')][_0x9077('0x141')]&&!_0x6fcb38){return _0x27fc33[_0x9077('0x94')](_0x566fab,!![])['then'](function(){return _0x27fc33[_0x9077('0x94')](_0x566fab,![]);})[_0x9077('0x43')](function(){return _0x27fc33[_0x9077('0xb3')](_0x566fab);})['catch'](function(_0x2c65ad){loggerSyncQueueSummary['debug'](_0x9077('0x142'),util[_0x9077('0x4b')](_0x2c65ad,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x566fab);});}else{clearPredictiveAttributes(_0x566fab);}})[_0x9077('0x43')](function(){var _0x80084f=_0x3033b7[_0x9077('0x143')](_0x566fab);if(_0x80084f||_0x566fab[_0x9077('0x144')]){_0x566fab[_0x9077('0x144')]=![];_0x3033b7['updateReportFromOutboundQueue'](_0x566fab);Object[_0x9077('0x145')](_0x566fab,_0x3033b7);emitOutboundVoiceQueueSummary(_0x3033b7);}_0x27fc33[_0x9077('0x2f')][_0x566fab[_0x9077('0x4e')]]['running']=![];})[_0x9077('0xa3')](function(_0x177645){logger[_0x9077('0x69')](_0x9077('0x142'),util['inspect'](_0x177645,{'showHidden':![],'depth':null}));_0x27fc33[_0x9077('0x2f')][_0x566fab[_0x9077('0x4e')]]['running']=![];});};Dialer[_0x9077('0x1d')]['syncQueueSummaryComplete']=_[_0x9077('0x146')](function(){var _0x1f5cdf=_[_0x9077('0x147')](this['voiceQueues'],function(_0x305f0c){return _0x305f0c['dialPreviewRecallmeReminder'];});var _0x24aba3=_[_0x9077('0x147')](this[_0x9077('0x24')],function(_0x277a2d){return _0x277a2d['online']&&_0x277a2d['status']==='reachable';});if(_0x1f5cdf[_0x9077('0x99')]>0x0&&_0x24aba3[_0x9077('0x99')]>0x0){return Promise[_0x9077('0x13d')]()[_0x9077('0x43')](cmHopper[_0x9077('0x148')](_[_0x9077('0x149')](_0x1f5cdf,'id'),previewRecallmeReminderInterval,_[_0x9077('0x149')](_0x24aba3,'id')))[_0x9077('0x43')](function(_0x277a54){for(var _0x5cbef1=0x0;_0x5cbef1<_0x277a54['length'];_0x5cbef1++){var _0x618e89=_0x277a54[_0x5cbef1][_0x9077('0x14a')]['name'];if(_0x618e89)io['to'](util[_0x9077('0x4c')]('user:%s',_0x618e89))[_0x9077('0x46')](_0x9077('0x14b'),{'hopper':_0x277a54[_0x5cbef1]});}})[_0x9077('0xa3')](function(_0x3c7399){logger['error']('checkPreviewRecallReminder',_0x3c7399);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x9077('0x1d')][_0x9077('0x14c')]=function(){var _0x5c796c=this;setInterval(function(){_0x5c796c[_0x9077('0x14d')](_0x5c796c[_0x9077('0x2a')],'[uniqueid]');_0x5c796c[_0x9077('0x14d')](_0x5c796c[_0x9077('0x28')],'[actions]');},0x32c8);};Dialer[_0x9077('0x1d')][_0x9077('0x14d')]=function(_0x4d30e6,_0x2f805e){var _0x1046a8=this;for(var _0x528b0c in _0x4d30e6){if(typeof _0x4d30e6[_0x528b0c]!==_0x9077('0xad')){this[_0x9077('0x20')][_0x9077('0x1e')](function(){if(!_['isNil'](_0x4d30e6[_0x528b0c])){return ami[_0x9077('0x9b')]({'action':_0x9077('0x8a'),'channel':_0x4d30e6[_0x528b0c]['channel']})[_0x9077('0xa3')](function(_0x249a62){if(_0x249a62[_0x9077('0x6f')]===_0x9077('0x14e')){setTimeout(function(){if(_0x4d30e6[_0x528b0c]&&_0x4d30e6[_0x528b0c][_0x9077('0x47')]!==_0x9077('0xc5')){_0x1046a8['updateOriginated'](_0x1046a8[_0x9077('0x22')][_0x4d30e6[_0x528b0c][_0x9077('0xc3')]]);logger[_0x9077('0x69')](_0x9077('0x14f'),_0x2f805e,_0x528b0c,_0x4d30e6[_0x528b0c][_0x9077('0xc3')]);delete _0x4d30e6[_0x528b0c];}if(_0x4d30e6[_0x528b0c]&&_0x4d30e6[_0x528b0c][_0x9077('0x47')]==='ivr'){_0x1046a8[_0x9077('0xc6')](_0x1046a8[_0x9077('0x23')][_0x4d30e6[_0x528b0c][_0x9077('0xc3')]]);logger[_0x9077('0x69')](_0x9077('0x150'),_0x2f805e,_0x528b0c,_0x4d30e6[_0x528b0c][_0x9077('0xc3')]);delete _0x4d30e6[_0x528b0c];}},0x2328);}});}});}}};Dialer[_0x9077('0x1d')][_0x9077('0x151')]=function(_0xc1339a){return Promise[_0x9077('0x13d')]()[_0x9077('0x43')](voiceQueueRt[_0x9077('0x151')](_0xc1339a))[_0x9077('0xa3')](loggerCatch(_0x9077('0x152')));};Dialer['prototype'][_0x9077('0xc6')]=function(_0x5d4339){if(!_['isUndefined'](_0x5d4339)&&_0x5d4339!==null){if(typeof _0x5d4339[_0x9077('0x153')]!==_0x9077('0xad')){if(_0x5d4339[_0x9077('0x153')]>0x0){_0x5d4339[_0x9077('0x153')]-=0x1;}else{logger['error'](_0x9077('0x154'));}}}else{logger[_0x9077('0x69')](_0x9077('0x155'));}};Dialer[_0x9077('0x1d')][_0x9077('0x156')]=function(_0x42d53b,_0x4f5b0e){var _0x258ff7=this;return function(_0x34ac1e){_0x258ff7['updateOriginated'](_0x4f5b0e);logger['error'](_0x42d53b,util[_0x9077('0x4b')](_0x34ac1e,{'showHidden':![],'depth':null}));};};Dialer[_0x9077('0x1d')][_0x9077('0x157')]=function(_0x1027a3,_0xa56c34,_0x43067c){var _0x5f494d={'state':0x19,'statedesc':_0x9077('0x158')};this[_0x9077('0xc6')](_0xa56c34);this['saveInDb'](_[_0x9077('0x64')](_0x5f494d,_[_0x9077('0x77')](_0x43067c,[_0x9077('0xde'),_0x9077('0xdf'),'UserId',_0x9077('0xe0'),_0x9077('0xf0')])),_0x9077('0x159'),_0x9077('0x15a'));logger[_0x9077('0x69')](_0x1027a3);};Dialer[_0x9077('0x1d')]['saveInDb']=function(_0x274d01,_0x5a21bd,_0x49c6e5){hopperUtils['createHistory'](_0x274d01)[_0x9077('0xa3')](loggerCatch(_0x5a21bd));hopperUtils[_0x9077('0xce')](_0x274d01)[_0x9077('0xa3')](loggerCatch(_0x49c6e5));};Dialer[_0x9077('0x1d')][_0x9077('0xdb')]=function(_0x3952b4,_0x3eef52){hopperUtils['createHistory'](_0x3952b4)[_0x9077('0xa3')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x3eef52==0x0){hopperUtils['moveContactManagedDialer'](_0x3952b4)['catch'](loggerCatch(_0x9077('0x15b')));}};Dialer[_0x9077('0x1d')][_0x9077('0x15c')]=function(_0x1dc59a){return Promise[_0x9077('0x13d')]()[_0x9077('0x43')](cmHopper['handlePreviewRecallNotifications'](_0x1dc59a['id'],previewRecallmeReminderInterval))[_0x9077('0x43')](function(_0x4783b7){for(var _0x363e86=0x0;_0x363e86<_0x4783b7[_0x9077('0x99')];_0x363e86++){var _0x32e6ff=_0x4783b7[_0x363e86][_0x9077('0x14a')][_0x9077('0x4e')];if(_0x32e6ff)io['to'](util[_0x9077('0x4c')](_0x9077('0x15d'),_0x32e6ff))[_0x9077('0x46')](_0x9077('0x14b'),{'hopper':_0x4783b7[_0x363e86]});}})[_0x9077('0xa3')](function(){});};Dialer['prototype'][_0x9077('0xb1')]=function(_0x22c688){var _0x140c49=this;return function(){_0x140c49[_0x9077('0x15e')](_0x22c688);};};Dialer[_0x9077('0x1d')][_0x9077('0x15f')]=function(_0x63cb1e,_0x1e02ac){var _0x2282b4=this;var _0x22f5f1=uuid['v4']();this[_0x9077('0x28')][_0x22f5f1]=new Action(_0x63cb1e,_0x1e02ac,_0x22f5f1);return new Promise(function(_0x20c01d,_0x469782){if(_[_0x9077('0x45')](_0x63cb1e)&&typeof _0x63cb1e!==_0x9077('0x160')){return _0x469782(msgResponse('originate',_0x9077('0x95'),_0x9077('0x161')));}if(_['isUndefined'](_0x1e02ac[_0x9077('0x162')])||_0x1e02ac['phone']===null){return _0x469782(msgResponse(_0x9077('0x163'),'Failure',_0x9077('0x164')));}var _0x4b78b5={'XMD-CALLERID':_0x2282b4['actions'][_0x22f5f1]['getCaller'](),'XMD-AGI':_0x63cb1e[_0x9077('0x135')]?util[_0x9077('0x4c')]('\x22agi://%s/square,%s\x22',ipAgi,_0x63cb1e[_0x9077('0x135')]):_0x9077('0x165'),'XMD-AGIAFTER':_0x63cb1e['dialQueueProject2']?util[_0x9077('0x4c')]('\x22agi://%s/square,%s\x22',ipAgi,_0x63cb1e[_0x9077('0xca')]):_0x9077('0x165'),'XMD-QUEUE':utils[_0x9077('0x166')](_0x63cb1e)?util['format'](_0x9077('0x167'),_0x63cb1e[_0x9077('0x4e')],_0x63cb1e[_0x9077('0x168')]||'',_0x63cb1e[_0x9077('0xcb')]?'c':'',_0x63cb1e[_0x9077('0x169')]||0x3):_0x9077('0x165'),'XMD-CONTACTID':_0x1e02ac['ContactId'],'XMD-CDRTYPE':_0x9077('0x7'),'CALLERID(all)':_0x2282b4[_0x9077('0x28')][_0x22f5f1][_0x9077('0x16a')](),'XMD-AMD':_0x63cb1e[_0x9077('0x112')]?_0x9077('0x141'):_0x9077('0x165'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x63cb1e[_0x9077('0x112')]){_0x4b78b5[_0x9077('0x16b')]=_0x63cb1e[_0x9077('0x16c')]||0x9c4;_0x4b78b5['XMD-AMDGREETING']=_0x63cb1e[_0x9077('0x16d')]||0x5dc;_0x4b78b5[_0x9077('0x16e')]=_0x63cb1e[_0x9077('0x16f')]||0x320;_0x4b78b5[_0x9077('0x170')]=_0x63cb1e[_0x9077('0x171')]||0x1388;_0x4b78b5[_0x9077('0x172')]=_0x63cb1e[_0x9077('0x173')]||0x64;_0x4b78b5[_0x9077('0x174')]=_0x63cb1e[_0x9077('0x175')]||0x32;_0x4b78b5['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x63cb1e[_0x9077('0x176')]||0x3;_0x4b78b5[_0x9077('0x177')]=_0x63cb1e['dialAMDSilenceThreshold']||0x100;_0x4b78b5[_0x9077('0x178')]=_0x63cb1e[_0x9077('0x179')]||0x1388;}if(utils['isOutboundQueue'](_0x63cb1e)){_0x4b78b5[_0x9077('0x17a')]=_0x1e02ac[_0x9077('0xe0')];}else{_0x4b78b5[_0x9077('0x17b')]=_0x1e02ac['CampaignId'];}var _0x14368c=utils[_0x9077('0x17c')](_0x1e02ac['Contact']);Object[_0x9077('0x145')](_0x4b78b5,_0x14368c);var _0x3d18a5=_0x2282b4[_0x9077('0x88')](_0x63cb1e[_0x9077('0x8f')])?utils['getCallerId'](_0x63cb1e[_0x9077('0x8f')][_0x9077('0x17d')],_0x63cb1e[_0x9077('0x17e')],_0x63cb1e[_0x9077('0x17f')]>0x0?utils['getCallerIdRandom'](_0x63cb1e[_0x9077('0x180')],_0x63cb1e[_0x9077('0x17f')]):_0x63cb1e[_0x9077('0x180')]):utils['getCallerId'](_[_0x9077('0xf6')](_0x63cb1e[_0x9077('0x90')])?_0x63cb1e['Trunk'][_0x9077('0x17d')]:_0x63cb1e[_0x9077('0x90')][_0x9077('0x17d')],_0x63cb1e['dialOriginateCallerIdName'],_0x63cb1e[_0x9077('0x17f')]>0x0?utils[_0x9077('0x181')](_0x63cb1e[_0x9077('0x180')],_0x63cb1e['dialRandomLastDigitCallerIdNumber']):_0x63cb1e['dialOriginateCallerIdNumber']);if(_0x3d18a5){_0x4b78b5['XMD-ORIGINATECALLERIDNAME']=_0x2282b4[_0x9077('0x28')][_0x22f5f1]['originatecalleridname']=utils[_0x9077('0x182')](_0x3d18a5);_0x4b78b5[_0x9077('0x183')]=_0x1e02ac[_0x9077('0x162')];}_0x63cb1e[_0x9077('0x184')]=_0x4b78b5;return ami[_0x9077('0x9b')]({'actionid':_0x22f5f1,'action':'originate','channel':_0x2282b4['isTrunkReachable'](_0x63cb1e[_0x9077('0x8f')])?util['format'](_0x9077('0x185'),_0x63cb1e[_0x9077('0x8f')][_0x9077('0x4e')],isNotNull(_0x63cb1e[_0x9077('0x186')])?_0x63cb1e['dialPrefix'][_0x9077('0x187')]()||'':'',_0x63cb1e[_0x9077('0x188')]>0x0?_0x1e02ac[_0x9077('0x162')][_0x9077('0x189')](_0x63cb1e[_0x9077('0x188')]):_0x1e02ac['phone']):util[_0x9077('0x4c')](_0x9077('0x185'),_[_0x9077('0xf6')](_0x63cb1e[_0x9077('0x90')])?_0x63cb1e[_0x9077('0x8f')][_0x9077('0x4e')]:_0x63cb1e[_0x9077('0x90')][_0x9077('0x4e')],isNotNull(_0x63cb1e['dialPrefix'])?_0x63cb1e[_0x9077('0x186')][_0x9077('0x187')]()||'':'',_0x63cb1e[_0x9077('0x188')]>0x0?_0x1e02ac['phone'][_0x9077('0x189')](_0x63cb1e[_0x9077('0x188')]):_0x1e02ac[_0x9077('0x162')]),'callerid':_0x3d18a5,'Exten':_0x9077('0x111'),'Context':_0x9077('0x18a'),'Priority':'1','variable':_0x4b78b5,'timeout':(_0x63cb1e[_0x9077('0x18b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x22f5f1})[_0x9077('0x43')](function(_0x9b9431){return _0x20c01d(_0x9b9431);})['catch'](function(_0x95595d){_0x63cb1e[_0x9077('0x18c')]+=0x1;var _0x33ee67=new History(_0x2282b4[_0x9077('0x28')][_0x22f5f1]);logger[_0x9077('0x69')](util[_0x9077('0x4c')](_0x9077('0x18d'),JSON['stringify'](_0x95595d)));_0x33ee67['state']=0xe;_0x33ee67['statedesc']=_0x9077('0x18e');_0x33ee67[_0x9077('0xe3')]=moment()['format'](_0x9077('0xc7'));_0x33ee67[_0x9077('0x72')]=_0x33ee67[_0x9077('0xe3')];hopperUtils[_0x9077('0xcc')](_0x33ee67)[_0x9077('0xa3')](loggerCatch(_0x9077('0x18f')));_0x2282b4[_0x9077('0xce')](_0x33ee67)[_0x9077('0xa3')](loggerCatch(_0x9077('0x18f')))[_0x9077('0xfe')](function(){delete _0x2282b4['actions'][_0x22f5f1];return _0x469782(msgResponse(_0x9077('0x163'),_0x9077('0x87'),'originate\x20action\x20Error'));});});});};Dialer[_0x9077('0x1d')]['checkRetriveMax']=function(_0xfa0780,_0x4ba994,_0x1bf893){var _0x152b43=new History(_0x4ba994);if(_0x152b43[_0x9077('0x122')]+_0x152b43['countcongestionretry']+_0x152b43[_0x9077('0x132')]+_0x152b43[_0x9077('0x124')]+_0x152b43[_0x9077('0xd5')]+_0x152b43['countabandonedretry']+_0x152b43[_0x9077('0x120')]+_0x152b43[_0x9077('0x125')]>=_0x1bf893[_0x9077('0x126')]-0x1){return!![];}switch(_0xfa0780){case 0x3:if(_0x152b43[_0x9077('0x132')]>=_0x1bf893['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0x9077('0xef')]({'active':![],'countnoanswerretry':_0x152b43[_0x9077('0x132')]+=0x1,'scheduledat':moment()[_0x9077('0xdc')](_0x1bf893[_0x9077('0x190')],'minutes')[_0x9077('0x4c')](_0x9077('0xc7')),'ContactId':_0x152b43[_0x9077('0xde')],'ListId':_0x152b43[_0x9077('0xdf')],'VoiceQueueId':_0x152b43[_0x9077('0xe0')]||undefined,'CampaignId':_0x152b43[_0x9077('0xf0')]||undefined})['catch'](loggerCatch(_0x9077('0x191')));break;case 0x5:if(_0x152b43['countbusyretry']>=_0x1bf893[_0x9077('0x192')]-0x1){return!![];}hopperUtils[_0x9077('0xef')]({'active':![],'countbusyretry':_0x152b43[_0x9077('0x122')]+=0x1,'scheduledat':moment()['add'](_0x1bf893['dialBusyRetryFrequency'],_0x9077('0xdd'))[_0x9077('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x152b43[_0x9077('0xde')],'ListId':_0x152b43[_0x9077('0xdf')],'VoiceQueueId':_0x152b43[_0x9077('0xe0')]||undefined,'CampaignId':_0x152b43[_0x9077('0xf0')]||undefined})[_0x9077('0xa3')](loggerCatch(_0x9077('0x193')));break;case 0x8:if(_0x152b43[_0x9077('0x123')]>=_0x1bf893['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0x9077('0xef')]({'active':![],'countcongestionretry':_0x152b43[_0x9077('0x123')]+=0x1,'scheduledat':moment()['add'](_0x1bf893['dialCongestionRetryFrequency'],_0x9077('0xdd'))[_0x9077('0x4c')](_0x9077('0xc7')),'ContactId':_0x152b43[_0x9077('0xde')],'ListId':_0x152b43[_0x9077('0xdf')],'VoiceQueueId':_0x152b43[_0x9077('0xe0')]||undefined,'CampaignId':_0x152b43[_0x9077('0xf0')]||undefined})[_0x9077('0xa3')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x152b43[_0x9077('0x124')]>=_0x1bf893[_0x9077('0x194')]-0x1){return!![];}else{hopperUtils[_0x9077('0xef')]({'active':![],'countnosuchnumberretry':_0x152b43[_0x9077('0x124')]+=0x1,'scheduledat':moment()[_0x9077('0xdc')](_0x1bf893['dialNoSuchNumberRetryFrequency'],_0x9077('0xdd'))[_0x9077('0x4c')](_0x9077('0xc7')),'ContactId':_0x152b43[_0x9077('0xde')],'ListId':_0x152b43[_0x9077('0xdf')],'VoiceQueueId':_0x152b43['VoiceQueueId']||undefined,'CampaignId':_0x152b43[_0x9077('0xf0')]||undefined})['catch'](loggerCatch(_0x9077('0x195')));}break;case 0xa:if(_0x152b43['countdropretry']>=_0x1bf893[_0x9077('0x196')]-0x1){return!![];}hopperUtils[_0x9077('0xef')]({'active':![],'countdropretry':_0x152b43[_0x9077('0xd5')]+=0x1,'scheduledat':moment()['add'](_0x1bf893[_0x9077('0xd6')],'minutes')[_0x9077('0x4c')](_0x9077('0xc7')),'ContactId':_0x152b43['ContactId'],'ListId':_0x152b43[_0x9077('0xdf')],'VoiceQueueId':_0x152b43['VoiceQueueId']||undefined,'CampaignId':_0x152b43[_0x9077('0xf0')]||undefined})[_0x9077('0xa3')](loggerCatch(_0x9077('0xe1')));break;case 0xb:if(_0x152b43[_0x9077('0xec')]>=_0x1bf893['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0x9077('0xef')]({'active':![],'countabandonedretry':_0x152b43[_0x9077('0xec')]+=0x1,'scheduledat':moment()[_0x9077('0xdc')](_0x1bf893[_0x9077('0x197')],_0x9077('0xdd'))[_0x9077('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x152b43['ContactId'],'ListId':_0x152b43[_0x9077('0xdf')],'VoiceQueueId':_0x152b43[_0x9077('0xe0')]||undefined,'CampaignId':_0x152b43[_0x9077('0xf0')]||undefined})[_0x9077('0xa3')](loggerCatch(_0x9077('0x198')));break;case 0x13:if(_0x152b43['countmachineretry']>=_0x1bf893['dialMachineMaxRetry']-0x1){return!![];}hopperUtils[_0x9077('0xef')]({'active':![],'countmachineretry':_0x152b43[_0x9077('0x120')]+=0x1,'scheduledat':moment()[_0x9077('0xdc')](_0x1bf893['dialMachineRetryFrequency'],_0x9077('0xdd'))[_0x9077('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x152b43[_0x9077('0xde')],'ListId':_0x152b43[_0x9077('0xdf')],'VoiceQueueId':_0x152b43[_0x9077('0xe0')]||undefined,'CampaignId':_0x152b43[_0x9077('0xf0')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x152b43[_0x9077('0x125')]>=_0x1bf893['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x9077('0xef')]({'active':![],'countagentrejectretry':_0x152b43[_0x9077('0x125')]+=0x1,'scheduledat':moment()[_0x9077('0xdc')](_0x1bf893[_0x9077('0x199')],'minutes')[_0x9077('0x4c')](_0x9077('0xc7')),'ContactId':_0x152b43[_0x9077('0xde')],'ListId':_0x152b43[_0x9077('0xdf')],'VoiceQueueId':_0x152b43[_0x9077('0xe0')]||undefined,'CampaignId':_0x152b43['CampaignId']||undefined})[_0x9077('0xa3')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x9077('0x1d')]['callProgressDetecting']=function(_0x1f5644,_0x12eb68,_0x438e34){var _0x372b69=this;var _0x503a60=new History(_0x1f5644);var _0x1aea1a=![];var _0x1edb27;var _0x25ed0b;return new Promise(function(_0x98952f,_0xa9f2ab){if(_['isUndefined'](_0x12eb68)&&typeof _0x12eb68!==_0x9077('0x160')){return _0xa9f2ab(msgResponse(_0x9077('0x19a'),_0x9077('0x95'),_0x9077('0x19b')));}if(_[_0x9077('0x45')](_0x438e34)&&typeof _0x438e34!=='object'){return _0xa9f2ab(msgResponse(_0x9077('0x19a'),_0x9077('0x95'),'evt\x20is\x20undefine'));}hopperUtils[_0x9077('0x19c')](_0x503a60,_0x438e34[_0x9077('0xc8')],_0x12eb68)[_0x9077('0x43')](function(_0xea213){if(_0xea213['additional']==0x1)_0x1aea1a=!![];switch(_0x438e34[_0x9077('0xc8')]){case'0':_0x12eb68['outboundNoSuchCallsDay']+=0x1;_0x503a60[_0x9077('0xd8')]=0x0;_0x503a60['statedesc']='NoSuchNumber';_0x503a60[_0x9077('0x124')]+=0x1;_0x503a60[_0x9077('0xed')]+=0x1;ami[_0x9077('0x46')](_0x9077('0x19d'),ut[_0x9077('0x119')](_0x1f5644,'nosuchnumber'));_0x1edb27=_0x12eb68[_0x9077('0x19e')];_0x25ed0b=_0x12eb68['callAdditionalPhoneAfterMin'];hopperUtils[_0x9077('0xcc')](_0x503a60)[_0x9077('0xa3')](loggerCatch(_0x9077('0x131')));if(_0x372b69[_0x9077('0x19f')](0x0,_0x1f5644,_0x12eb68)&&!_0x1aea1a){if(_0x503a60['countnosuchnumberretry']>=_0x12eb68[_0x9077('0x194')]){_0x372b69[_0x9077('0x12a')](_0x503a60,_0x98952f,_0xa9f2ab,_0x9077('0x1a0'));}else{_0x372b69[_0x9077('0x127')](_0x503a60,_0x98952f,_0xa9f2ab,_0x9077('0x1a0'));}}break;case'3':_0x12eb68[_0x9077('0x1a1')]+=0x1;_0x503a60['state']=0x3;_0x503a60[_0x9077('0xe9')]=_0x9077('0x1a2');_0x503a60['countnoanswerretry']+=0x1;_0x503a60['countglobal']+=0x1;var _0x30729a=ut[_0x9077('0x1a3')](_0x1f5644,_0x12eb68);ami[_0x9077('0x46')](_0x9077('0x1a4'),_0x30729a);_0x1edb27=_0x12eb68[_0x9077('0x190')];_0x25ed0b=_0x12eb68[_0x9077('0xd7')];hopperUtils['createHistory'](_0x503a60)[_0x9077('0xa3')](loggerCatch(_0x9077('0x1a5')));if(_0x372b69[_0x9077('0x19f')](0x3,_0x1f5644,_0x12eb68)&&!_0x1aea1a){if(_0x503a60['countnoanswerretry']>=_0x12eb68[_0x9077('0x1a6')]){_0x372b69['createStateFinal'](_0x503a60,_0x98952f,_0xa9f2ab,_0x9077('0x1a7'));}else{_0x372b69[_0x9077('0x127')](_0x503a60,_0x98952f,_0xa9f2ab,_0x9077('0x1a7'));}}break;case'5':_0x12eb68['outboundBusyCallsDay']+=0x1;_0x503a60[_0x9077('0xd8')]=0x5;_0x503a60[_0x9077('0xe9')]=_0x9077('0x1a8');_0x503a60[_0x9077('0x122')]+=0x1;_0x503a60['countglobal']+=0x1;ami[_0x9077('0x46')]('custom:agentbusy',ut[_0x9077('0x119')](_0x1f5644,_0x9077('0x1a9')));_0x1edb27=_0x12eb68[_0x9077('0x1aa')];_0x25ed0b=_0x12eb68[_0x9077('0xd7')];hopperUtils[_0x9077('0xcc')](_0x503a60)[_0x9077('0xa3')](loggerCatch(_0x9077('0x1ab')));if(_0x372b69[_0x9077('0x19f')](0x5,_0x1f5644,_0x12eb68)&&!_0x1aea1a){if(_0x503a60[_0x9077('0x122')]>=_0x12eb68['dialBusyMaxRetry']){_0x372b69[_0x9077('0x12a')](_0x503a60,_0x98952f,_0xa9f2ab,_0x9077('0x1ac'));}else{_0x372b69[_0x9077('0x127')](_0x503a60,_0x98952f,_0xa9f2ab,_0x9077('0x1ac'));}}break;case'8':_0x12eb68[_0x9077('0x1ad')]+=0x1;_0x503a60[_0x9077('0xd8')]=0x8;_0x503a60[_0x9077('0xe9')]='Congestion';_0x503a60[_0x9077('0x123')]+=0x1;_0x503a60['countglobal']+=0x1;_0x1edb27=_0x12eb68[_0x9077('0x1ae')];_0x25ed0b=_0x12eb68[_0x9077('0xd7')];ami['emit'](_0x9077('0x1af'),ut[_0x9077('0x119')](_0x1f5644,_0x9077('0x1b0')));hopperUtils[_0x9077('0xcc')](_0x503a60)[_0x9077('0xa3')](loggerCatch(_0x9077('0x1b1')));if(_0x372b69[_0x9077('0x19f')](0x8,_0x1f5644,_0x12eb68)&&!_0x1aea1a){if(_0x503a60[_0x9077('0x123')]>=_0x12eb68[_0x9077('0x1b2')]){_0x372b69[_0x9077('0x12a')](_0x503a60,_0x98952f,_0xa9f2ab,_0x9077('0x1b3'));}else{_0x372b69[_0x9077('0x127')](_0x503a60,_0x98952f,_0xa9f2ab,'reason\x208\x20congestion');}}break;case'11':_0x12eb68[_0x9077('0x1b4')]+=0x1;_0x503a60[_0x9077('0xd8')]=0xb;_0x503a60[_0x9077('0xe9')]=_0x9077('0xf1');_0x503a60[_0x9077('0xec')]+=0x1;_0x503a60[_0x9077('0xed')]+=0x1;_0x1edb27=_0x12eb68[_0x9077('0x197')];_0x25ed0b=_0x12eb68[_0x9077('0xd7')];hopperUtils['createHistory'](_0x503a60)[_0x9077('0xa3')](loggerCatch(_0x9077('0x1b5')));if(_0x372b69[_0x9077('0x19f')](0xb,_0x1f5644,_0x12eb68)&&!_0x1aea1a){if(_0x503a60[_0x9077('0xec')]>=_0x12eb68[_0x9077('0xee')]){_0x372b69['createStateFinal'](_0x503a60,_0x98952f,_0xa9f2ab,'reason\x2011\x20abandoned');}else{_0x372b69[_0x9077('0x127')](_0x503a60,_0x98952f,_0xa9f2ab,_0x9077('0x1b6'));}}break;case'20':_0x12eb68[_0x9077('0x1b7')]+=0x1;_0x503a60[_0x9077('0xd8')]=0x14;_0x503a60['statedesc']=_0x9077('0x1b8');_0x503a60[_0x9077('0x125')]+=0x1;_0x503a60['countglobal']+=0x1;_0x1edb27=_0x12eb68['dialAgentRejectRetryFrequency'];_0x25ed0b=_0x12eb68['callAdditionalPhoneAfterMin'];ami[_0x9077('0x46')]('custom:agentreject',ut['buildObj'](_0x1f5644,_0x9077('0x1b9')));hopperUtils['createHistory'](_0x503a60)[_0x9077('0xa3')](loggerCatch(_0x9077('0x1ba')));if(_0x372b69[_0x9077('0x19f')](0x14,_0x1f5644,_0x12eb68)&&!_0x1aea1a){if(_0x503a60['countagentrejectretry']>=_0x12eb68[_0x9077('0x1bb')]){_0x372b69[_0x9077('0x12a')](_0x503a60,_0x98952f,_0xa9f2ab,_0x9077('0x1bc'));}else{_0x372b69[_0x9077('0x127')](_0x503a60,_0x98952f,_0xa9f2ab,_0x9077('0x1bc'));}}break;default:_0x12eb68[_0x9077('0x1bd')]+=0x1;_0x503a60[_0x9077('0xd8')]=0xc;_0x503a60['statedesc']=_0x438e34[_0x9077('0xc8')];_0x1edb27=_0x12eb68[_0x9077('0x199')];_0x25ed0b=_0x12eb68[_0x9077('0xd7')];hopperUtils['createHistory'](_0x503a60)[_0x9077('0xa3')](loggerCatch(_0x9077('0x1be')));if(_0x372b69['checkRetriveMax'](_0x438e34[_0x9077('0xc8')],_0x1f5644,_0x12eb68)&&!_0x1aea1a){if(_0x503a60[_0x9077('0x122')]+_0x503a60[_0x9077('0x123')]+_0x503a60[_0x9077('0x132')]+_0x503a60[_0x9077('0x124')]+_0x503a60['countdropretry']+_0x503a60[_0x9077('0xec')]+_0x503a60[_0x9077('0x120')]+_0x503a60[_0x9077('0x125')]>=_0x12eb68[_0x9077('0x126')]){_0x372b69[_0x9077('0x127')](_0x503a60,_0x98952f,_0xa9f2ab,_0x438e34[_0x9077('0xc8')]);}else{_0x372b69['createStateFinal'](_0x503a60,_0x98952f,_0xa9f2ab,_0x438e34[_0x9077('0xc8')]);}}}})[_0x9077('0x43')](function(){if(_0x1aea1a){hopperUtils[_0x9077('0xe7')](_0x503a60,_0x1edb27,_0x25ed0b)[_0x9077('0x43')](function(){return _0x98952f(0x1);});}});});};Dialer[_0x9077('0x1d')][_0x9077('0x127')]=function(_0x30d2ac,_0x133016,_0x505176,_0x8ddf3d){var _0x15e9d8=new Final(_0x30d2ac);_0x15e9d8[_0x9077('0xd8')]=0xf;_0x15e9d8['statedesc']=_0x9077('0x1bf');this[_0x9077('0x12a')](_0x15e9d8,_0x133016,_0x505176,_0x8ddf3d);};Dialer[_0x9077('0x1d')][_0x9077('0x12a')]=function(_0x5f3d85,_0xde615c,_0x40239d,_0x180b8b){hopperUtils[_0x9077('0xce')](_0x5f3d85)[_0x9077('0x43')](function(){return _0xde615c(msgResponse(_0x9077('0x19a'),'Success',_0x180b8b));})[_0x9077('0xa3')](function(){return _0x40239d(msgResponse(_0x9077('0x1c0'),_0x9077('0x95'),_0x9077('0x1c1')));});};Dialer['prototype'][_0x9077('0x8')]=function(_0x1bd632){var _0xf45605=_0x1bd632[_0x9077('0x1c2')]/0x64;var _0x30fe51=_0x1bd632[_0x9077('0xd3')]/(_0x1bd632['outboundDropCallsDayTimeout']+_0x1bd632['outboundAnswerCallsDay']);var _0x4bfc5f=Math[_0x9077('0x1c3')](_0x1bd632[_0x9077('0x1c4')]*(_0x1bd632[_0x9077('0x1c5')]/0x64));var _0x309684=Math['round'](_0x1bd632[_0x9077('0x1c4')]*(_0x1bd632[_0x9077('0x1c6')]/0x64));var _0x447e9d=_0x1bd632[_0x9077('0x1c7')]+_0x1bd632[_0x9077('0x13f')];var _0x3ccb9b=Math[_0x9077('0x1c8')](_0x1bd632[_0x9077('0x5f')]*_0x1bd632['erlangAbandonmentRate']*_0x1bd632[_0x9077('0x1c9')]*_0x1bd632[_0x9077('0x1ca')]);if(_[_0x9077('0x45')](_0x1bd632[_0x9077('0x66')])){if(!_['isUndefined'](_0x1bd632[_0x9077('0x2b')])){_0x1bd632[_0x9077('0x2b')]=undefined;loggerPredictive[_0x9077('0x69')](_0x9077('0x1cb'),_0x9077('0x1cc'));}if(!_['isUndefined'](_0x1bd632['handlePredictive'])){loggerPredictive[_0x9077('0x69')](_0x9077('0x1cb'),_0x9077('0x1cd'));clearInterval(_0x1bd632[_0x9077('0x68')]);_0x1bd632[_0x9077('0x68')]=undefined;}_0x1bd632['startProgressive']=moment()[_0x9077('0x4c')](_0x9077('0xc7'));loggerPredictive['info'](_0x1bd632['name'],'collection\x20data\x20in\x20progressive\x20at',_0x1bd632['startProgressive']);this[_0x9077('0xb7')](_0x1bd632,0x1);}else if(ifInterval(_0x1bd632[_0x9077('0x1ce')],_0x1bd632[_0x9077('0x66')])){this[_0x9077('0xb7')](_0x1bd632,0x1);loggerPredictiveCalls[_0x9077('0x4f')](_0x9077('0x1cf'),_0x1bd632['startProgressive'],_0x1bd632[_0x9077('0x4e')]);_0x1bd632[_0x9077('0x5f')]=0x0;_0x1bd632[_0x9077('0xd4')]=0x0;}else if(_0xf45605<_0x30fe51&&_0x1bd632[_0x9077('0x1d0')]===_0x9077('0x1d1')){clearPredictiveAttributes(_0x1bd632);loggerPredictive[_0x9077('0x4f')](_0x9077('0x1d2'),_0x9077('0x1d3'),_0x30fe51,'startProgressive',_0x1bd632[_0x9077('0x4e')]);}else if(_0x3ccb9b<_0x1bd632[_0x9077('0xd4')]&&_0x1bd632[_0x9077('0x1d0')]==='dropRate'){clearPredictiveAttributes(_0x1bd632);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x9077('0x1d4'),_0x3ccb9b,_0x9077('0x1d5'),_0x1bd632[_0x9077('0xd4')],_0x9077('0x66'),_0x1bd632[_0x9077('0x4e')]);}else if(!ifInterval(_0x1bd632['dialPredictiveInterval'],_0x1bd632['startProgressive'])&&_['isUndefined'](_0x1bd632[_0x9077('0x2b')])&&!_['isUndefined'](_0x1bd632['startProgressive'])){_0x1bd632[_0x9077('0x2b')]=moment()['format'](_0x9077('0xc7'));loggerPredictive['info'](_0x1bd632['name'],_0x9077('0x1d6'),_0x1bd632[_0x9077('0x2b')]);hopperUtils[_0x9077('0x1d7')](_0x1bd632[_0x9077('0x1ce')])[_0x9077('0x43')](this['getDataPredictive'](_0x1bd632))[_0x9077('0x43')](mergeDataErlangB(_0x1bd632))[_0x9077('0x43')](this[_0x9077('0x1d8')](_0x1bd632))[_0x9077('0xa3')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x1bd632));}else if(!ifInterval(_0x1bd632[_0x9077('0x1ce')],_0x1bd632['startPredictive'])){_0x1bd632[_0x9077('0xd4')]=0x0;_0x1bd632[_0x9077('0x2b')]=moment()['format'](_0x9077('0xc7'));loggerPredictive[_0x9077('0x4f')](_0x1bd632[_0x9077('0x4e')],_0x9077('0x1d9'),_0x1bd632[_0x9077('0x2b')]);clearInterval(_0x1bd632['handlePredictive']);_0x1bd632[_0x9077('0x68')]=undefined;hopperUtils[_0x9077('0x1d7')](_0x1bd632[_0x9077('0x1ce')])[_0x9077('0x43')](this[_0x9077('0x1da')](_0x1bd632))['then'](mergeDataErlangB(_0x1bd632))[_0x9077('0x43')](this['startMethodPredictive'](_0x1bd632))[_0x9077('0xa3')](loggerCatchPredictive(_0x9077('0x1db'),_0x1bd632));}else if(_0x1bd632[_0x9077('0x1c4')]&&_0x447e9d<_0x1bd632[_0x9077('0x1c4')]-_0x309684){clearPredictiveAttributes(_0x1bd632);loggerPredictive[_0x9077('0x4f')](_0x1bd632[_0x9077('0x4e')],_0x9077('0x1dc'),_0x447e9d,')\x20are\x20less\x20than\x20threshold\x20(',_0x1bd632[_0x9077('0x1c4')],'-',_0x309684,'=',_0x1bd632['predictiveIntervalAvailable']-_0x309684,')');}else if(_0x1bd632[_0x9077('0x1c4')]&&_0x447e9d>_0x1bd632[_0x9077('0x1c4')]+_0x4bfc5f){clearPredictiveAttributes(_0x1bd632);loggerPredictive[_0x9077('0x4f')](_0x1bd632[_0x9077('0x4e')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x447e9d,_0x9077('0x1dd'),_0x1bd632['predictiveIntervalAvailable'],'+',_0x4bfc5f,'=',_0x1bd632[_0x9077('0x1c4')]+_0x4bfc5f,')');}};Dialer[_0x9077('0x1d')]['getDataPredictive']=function(_0x5c12d5){var _0x34b12a=this;return function(_0xc128b9){return new Promise(function(_0x5c23fb,_0x2aa152){_['merge'](_0x5c12d5,_0xc128b9[0x0]);if(checkGetDataPredictive(_0xc128b9[0x0])){var _0x5cef03=_0x5c12d5[_0x9077('0x1c4')]=_0x5c12d5[_0x9077('0x13f')]+_0x5c12d5['available'];var _0xc8902c=_0x5c12d5[_0x9077('0x1ce')]*0x3c;var _0x233098=_0xc128b9[0x0][_0x9077('0x58')]+_0xc128b9[0x0]['predictiveIntervalAvgHoldtime'];var _0x5d9cf6=(_0xc128b9[0x0][_0x9077('0x53')]+_0xc128b9[0x0][_0x9077('0xd2')]+_0xc128b9[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xc128b9[0x0][_0x9077('0x51')];_0x5c12d5[_0x9077('0x1c9')]=_0x5d9cf6>0x0?_0x5d9cf6:0x1;switch(_0x5c12d5[_0x9077('0x1d0')]){case'dropRate':var _0x4a0bcf=_0x5c12d5[_0x9077('0x1c2')]/0x64;return _0x34b12a[_0x9077('0x1de')](_0x5cef03,_0xc8902c,_0x233098,_0x5d9cf6,_0x4a0bcf)['then'](function(_0x37493a){return _0x5c23fb(_0x37493a);});case _0x9077('0x1df'):var _0x52348=_0x5c12d5[_0x9077('0x1c2')]/0x64;return _0x34b12a['busyFactor'](_0x5cef03,_0xc8902c,_0x233098,_0x5d9cf6,_0x52348)[_0x9077('0x43')](function(_0x2b3e3a){return _0x5c23fb(_0x2b3e3a);});default:return _0x2aa152(msgResponse(_0x9077('0x1e0'),_0x9077('0x95'),_0x9077('0x1e1')));}}else{return _0x2aa152(msgResponse(_0x9077('0x1e0'),_0x9077('0x95'),_0x9077('0x1e2')));}});};};Dialer[_0x9077('0x1d')]['getDataPredictiveOld']=function(_0x35cd6c){var _0x73f664=this;return function(_0x13de80){return new Promise(function(_0x3b92bb,_0x4d9cec){_[_0x9077('0x64')](_0x35cd6c,_0x13de80[0x0]);if(checkGetDataPredictive(_0x13de80[0x0])){loggerPredictive['info'](JSON[_0x9077('0x76')](_0x13de80[0x0]));if(_0x35cd6c[_0x9077('0x1d0')]===_0x9077('0x1d1')){return _0x73f664[_0x9077('0x151')](_0x35cd6c['id'])[_0x9077('0x43')](function(_0x2a37ea){var _0x2aeb87=_0x35cd6c[_0x9077('0x1e3')]-_0x2a37ea[0x0][_0x9077('0x1e4')];var _0x50c4d2=_0x35cd6c['dialPredictiveInterval']*0x3c;var _0x12cad6=_0x13de80[0x0]['predictiveIntervalAvgTalktime']+_0x13de80[0x0]['predictiveIntervalAvgHoldtime'];var _0x32d6f1=(_0x13de80[0x0]['predictiveIntervalAnsweredCalls']+_0x13de80[0x0][_0x9077('0xd2')]+_0x13de80[0x0][_0x9077('0x56')])/_0x13de80[0x0]['predictiveIntervalTotalCalls'];var _0xe75c41=_0x35cd6c['dialPredictiveOptimizationPercentage']/0x64;_0x35cd6c[_0x9077('0x1e5')]=_0x2a37ea[0x0]['outboundQueuePauses']||0x0;_0x35cd6c[_0x9077('0x1c9')]=_0x32d6f1>0x0?_0x32d6f1:0x1;return _0x73f664[_0x9077('0x1de')](_0x2aeb87,_0x50c4d2,_0x12cad6,_0x32d6f1,_0xe75c41);})[_0x9077('0x43')](function(_0x34fb69){return _0x3b92bb(_0x34fb69);})['catch'](function(_0x36aa46){return _0x4d9cec(msgResponse(_0x9077('0x1e6'),_0x9077('0x95'),JSON[_0x9077('0x76')](_0x36aa46)));});}if(_0x35cd6c[_0x9077('0x1d0')]==='agentBusyFactor'){return _0x73f664['getVoiceQueueRtPauses'](_0x35cd6c['id'])[_0x9077('0x43')](function(_0x3eb08f){var _0x5c3127=_0x35cd6c[_0x9077('0x1e3')]-_0x3eb08f[0x0][_0x9077('0x1e4')];var _0x5b67df=_0x35cd6c[_0x9077('0x1ce')]*0x3c;var _0x551aad=_0x13de80[0x0]['predictiveIntervalAvgTalktime']+_0x13de80[0x0][_0x9077('0x5b')];var _0x454a36=(_0x13de80[0x0][_0x9077('0x53')]+_0x13de80[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x13de80[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x13de80[0x0][_0x9077('0x51')];var _0x3097b4=_0x35cd6c[_0x9077('0x1c2')]/0x64;_0x35cd6c['predictiveIntervalPauses']=_0x3eb08f[0x0]['outboundQueuePauses']||0x0;_0x35cd6c[_0x9077('0x1c9')]=_0x454a36>0x0?_0x454a36:0x1;return _0x73f664[_0x9077('0x1e7')](_0x5c3127,_0x5b67df,_0x551aad,_0x454a36,_0x3097b4);})[_0x9077('0x43')](function(_0x52e353){return _0x3b92bb(_0x52e353);})[_0x9077('0xa3')](function(_0x516ea3){return _0x4d9cec(msgResponse(_0x9077('0x1e6'),_0x9077('0x95'),JSON[_0x9077('0x76')](_0x516ea3)));});}}else{return _0x4d9cec(msgResponse(_0x9077('0x1e0'),_0x9077('0x95'),_0x9077('0x1e2')));}});};};Dialer['prototype'][_0x9077('0x1d8')]=function(_0xa17cd4){var _0x27f1fe=this;return function(){var _0x487c7f=0x0;var _0x3768e5=Math[_0x9077('0x1c8')](_0xa17cd4[_0x9077('0x1e8')]*0x3e8);if(_0x3768e5>0x0){_0x3768e5=_0x3768e5<0x64?0x64:_0x3768e5;loggerPredictive[_0x9077('0x4f')](_0xa17cd4[_0x9077('0x4e')],_0x9077('0x1e9'),_0x3768e5,_0x9077('0x1ea'));_0xa17cd4[_0x9077('0x68')]=setInterval(function(){_0x27f1fe[_0x9077('0x68')](_0xa17cd4);loggerPredictiveCalls['info'](_0x9077('0x1eb'),_0x487c7f+=0x1);},_0x3768e5);}else{loggerPredictive[_0x9077('0x4f')](_0xa17cd4[_0x9077('0x4e')],_0x9077('0x1ec'));}};};Dialer[_0x9077('0x1d')][_0x9077('0x1ed')]=function(_0xa3d0ec,_0x16e62d){var _0x207d07=this;return function(_0x93ce37){if(_[_0x9077('0x7c')](_0x93ce37)){if(_[_0x9077('0xf6')](_0x16e62d[_0x9077('0x1ee')])||!_0x16e62d[_0x9077('0x1ef')]){if(_0xa3d0ec['dialMethod']===_0x9077('0xb8')){_0xa3d0ec[_0x9077('0x73')]=_[_0x9077('0x45')](_0xa3d0ec[_0x9077('0x73')])?!![]:_0xa3d0ec['queueStatusComplete'];var _0x2a1a3e=uuid['v4']();_0x207d07[_0x9077('0x28')][_0x2a1a3e]=new Action(_0xa3d0ec,_0x16e62d,_0x2a1a3e);loggerBooked[_0x9077('0x4f')](_0x9077('0x1f0'),_0x2a1a3e,'queueStatusComplete:\x20',JSON[_0x9077('0x76')](_0xa3d0ec[_0x9077('0x73')]),_0x9077('0x1f1'),_0xa3d0ec[_0x9077('0x4e')]);if(_0xa3d0ec[_0x9077('0x73')]){_0xa3d0ec[_0x9077('0x73')]=![];_0x207d07[_0x9077('0x2d')][_0x207d07[_0x9077('0x28')][_0x2a1a3e][_0x9077('0xc3')]]=[];ami['Action']({'actionid':_0x2a1a3e,'action':_0x9077('0x1f2'),'queue':_0xa3d0ec[_0x9077('0x4e')]})['catch'](function(){_0x207d07[_0x9077('0xc6')](_0xa3d0ec);hopperUtils[_0x9077('0xef')]({'active':![],'ContactId':_0x207d07[_0x9077('0x28')][_0x2a1a3e]['ContactId'],'ListId':_0x207d07[_0x9077('0x28')][_0x2a1a3e][_0x9077('0xdf')],'VoiceQueueId':_0x207d07[_0x9077('0x28')][_0x2a1a3e][_0x9077('0xe0')]||undefined,'CampaignId':_0x207d07[_0x9077('0x28')][_0x2a1a3e][_0x9077('0xf0')]||undefined})[_0x9077('0xa3')](loggerCatch(_0x9077('0x1f3')));delete _0x207d07[_0x9077('0x28')][_0x2a1a3e];});}else{loggerBooked[_0x9077('0x4f')](_0x9077('0x1f4'),JSON[_0x9077('0x76')](_0xa3d0ec[_0x9077('0x73')]),_0x9077('0x1f1'),_0xa3d0ec[_0x9077('0x4e')]);_0x207d07[_0x9077('0xc6')](_0xa3d0ec);hopperUtils[_0x9077('0xef')]({'active':![],'ContactId':_0x207d07[_0x9077('0x28')][_0x2a1a3e][_0x9077('0xde')],'ListId':_0x207d07['actions'][_0x2a1a3e][_0x9077('0xdf')],'VoiceQueueId':_0x207d07[_0x9077('0x28')][_0x2a1a3e][_0x9077('0xe0')]||undefined,'CampaignId':_0x207d07[_0x9077('0x28')][_0x2a1a3e]['CampaignId']||undefined})[_0x9077('0xa3')](loggerCatch(_0x9077('0x1f3')));delete _0x207d07[_0x9077('0x28')][_0x2a1a3e];}}else{return _0x207d07['actionOriginate'](_0xa3d0ec,_0x16e62d);}}else{if(utils[_0x9077('0x65')](undefined,_0x16e62d[_0x9077('0x1f5')])<_0xa3d0ec[_0x9077('0x1f6')]*0x3c){if(_0x16e62d[_0x9077('0x14a')]&&!_0x16e62d[_0x9077('0x14a')][_0x9077('0x1f7')]){_0x207d07[_0x9077('0x21')][_0x9077('0xfc')](_0x16e62d['id'])['finally'](function(){_0x207d07[_0x9077('0xc6')](_0xa3d0ec);});}else{hopperUtils['unlockContact']({'active':![]},_0x16e62d['id'],0x1)[_0x9077('0xfe')](function(){_0x207d07[_0x9077('0xc6')](_0xa3d0ec);});}}else{_0xa3d0ec[_0x9077('0x1f8')]+=0x1;_0x207d07[_0x9077('0xc6')](_0xa3d0ec);if(_0xa3d0ec['dialRecallInQueue']){hopperUtils[_0x9077('0xef')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x16e62d[_0x9077('0xde')],'ListId':_0x16e62d[_0x9077('0xdf')],'VoiceQueueId':_0x16e62d['VoiceQueueId']||undefined,'CampaignId':_0x16e62d[_0x9077('0xf0')]||undefined})[_0x9077('0xa3')](loggerCatch(_0x9077('0x1f9')));hopperUtils['createHistory'](createObjHistory(_0xa3d0ec,_0x16e62d,utils[_0x9077('0x7d')][_0x9077('0x1fa')],0x17,'RecallInQueue'))[_0x9077('0xa3')](loggerCatch(_0x9077('0x1fb')));}else{_0x207d07[_0x9077('0x11a')](createObjHistory(_0xa3d0ec,_0x16e62d,utils[_0x9077('0x7d')][_0x9077('0x1fc')],0x16,'RecallFailedTimeout'),_0x9077('0x1fd'),_0x9077('0x1fe'));}}}}else{_0xa3d0ec[_0x9077('0x1ff')]+=0x1;_0x207d07[_0x9077('0x11a')](createObjHistory(_0xa3d0ec,_0x16e62d,utils['CAMPAIGN_STATUS']['BLACKLIST'],0xd,_0x9077('0x200')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0x9077('0x201');}};};Dialer[_0x9077('0x1d')]['handleIvr']=function(_0x3f38c0){var _0x59ab60=this;var _0x361375=_0x3f38c0[_0x9077('0x202')]-_0x3f38c0['originated'];emitCampaignSummary(_0x3f38c0);if(_0x361375>0x0&&_0x3f38c0[_0x9077('0x203')]==0x0){if(_0x361375>this[_0x9077('0x26')]){_0x361375=this[_0x9077('0x26')];}_0x3f38c0[_0x9077('0x203')]=0x1;hopperUtils[_0x9077('0x204')](_0x3f38c0,_0x361375)[_0x9077('0x43')](function(_0x3f9132){_0x3f38c0['temp']=0x0;if(_0x3f9132){if(!utils[_0x9077('0x205')](_0x3f9132)){_0x3f38c0[_0x9077('0x6f')]=utils[_0x9077('0x7d')][_0x9077('0x70')];logger[_0x9077('0x4f')](_0x9077('0x206')+_0x3f38c0[_0x9077('0x4e')]);}else{_0x3f38c0[_0x9077('0x153')]+=_0x3f9132[_0x9077('0x99')];_0x3f38c0[_0x9077('0x6f')]=utils[_0x9077('0x7d')][_0x9077('0x207')];for(var _0x36bea6=0x0;_0x36bea6<_0x3f9132[_0x9077('0x99')];_0x36bea6+=0x1){_0x3f38c0['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x3f9132[_0x36bea6])||_[_0x9077('0xf6')](_0x3f9132[_0x36bea6][_0x9077('0x208')])||_['isNil'](_0x3f9132[_0x36bea6][_0x9077('0x162')])){_0x59ab60['emptyContact'](_0x9077('0x209'),_0x3f38c0,_0x3f9132[_0x36bea6]);}else{hopperUtils[_0x9077('0x20a')](_[_0x9077('0x77')](_0x3f9132[_0x36bea6],['CampaignId',_0x9077('0x162')]))[_0x9077('0x43')](_0x59ab60[_0x9077('0x1ed')](_0x3f38c0,_0x3f9132[_0x36bea6]))['catch'](_0x59ab60[_0x9077('0x156')](_0x9077('0x20b'),_0x3f38c0));}}}}})[_0x9077('0xa3')](loggerGetContactDialer(_0x9077('0x20c'),_0x3f38c0,_0x361375));}};Dialer[_0x9077('0x1d')][_0x9077('0xb7')]=function(_0x26ddba,_0x151a65){var _0x40947e=this;var _0x844026=[];if(_0x151a65<0x1||_0x26ddba[_0x9077('0xb4')]===_0x9077('0xb8')){_0x151a65=0x1;}var _0x15d359=Math[_0x9077('0x1c8')](_0x26ddba['available']*_0x151a65)-_0x26ddba['originated'];if(_0x26ddba[_0x9077('0x20d')]>0x0){var _0x57ac32=_0x26ddba['dialLimitQueue']-_0x26ddba[_0x9077('0x153')]-_0x26ddba[_0x9077('0x13f')]-_0x26ddba[_0x9077('0x140')];if(_0x15d359>_0x57ac32){_0x15d359=_0x57ac32;}}if(_0x15d359>0x0&&_0x26ddba[_0x9077('0x203')]==0x0){if(_0x26ddba['dialMethod']===_0x9077('0xb8')){_0x15d359=0x1;}if(_0x15d359>this['maxNumberOriginate']){_0x15d359=this[_0x9077('0x26')];}for(var _0x346e33 in this[_0x9077('0x24')]){if(typeof this['agents'][_0x346e33]!=='undefined'){if(this['agents'][_0x346e33][_0x9077('0xd8')]==='not_inuse'&&this[_0x9077('0x24')][_0x346e33][_0x9077('0x8a')]===_0x9077('0x8b')){_0x844026[_0x9077('0x9a')](this[_0x9077('0x24')][_0x346e33]['id']);}}}_0x26ddba[_0x9077('0x203')]=0x1;hopperUtils[_0x9077('0x20e')](_0x26ddba,_0x844026,_0x15d359)['then'](function(_0x272917){_0x26ddba['temp']=0x0;if(_0x272917){if(!utils[_0x9077('0x205')](_0x272917)){hopperUtils[_0x9077('0x20f')](_0x26ddba)[_0x9077('0x43')](sendMessageReschedule(_0x26ddba))[_0x9077('0xa3')](loggerCatch(_0x9077('0x210')));}else{_0x26ddba['originated']+=_0x272917[_0x9077('0x99')];_0x26ddba['message']=_0x26ddba[_0x9077('0xb4')]===_0x9077('0xb8')?utils[_0x9077('0x7d')][_0x9077('0x141')]:utils[_0x9077('0x7d')][_0x9077('0x207')];for(var _0x1ee922=0x0;_0x1ee922<_0x272917[_0x9077('0x99')];_0x1ee922+=0x1){if(_['isNil'](_0x272917[_0x1ee922])||_[_0x9077('0xf6')](_0x272917[_0x1ee922]['Contact'])||_[_0x9077('0xf6')](_0x272917[_0x1ee922][_0x9077('0x162')])){_0x40947e['emptyContact']('[actionOriginate]\x20',_0x26ddba,_0x272917[_0x1ee922]);}else{hopperUtils[_0x9077('0x211')](_[_0x9077('0x77')](_0x272917[_0x1ee922],['VoiceQueueId','phone']))[_0x9077('0x43')](_0x40947e['checkContactBlack'](_0x26ddba,_0x272917[_0x1ee922]))[_0x9077('0xa3')](_0x40947e[_0x9077('0x156')](_0x9077('0x209'),_0x26ddba));}}}}})[_0x9077('0xa3')](loggerGetContactDialer(_0x9077('0x212'),_0x26ddba,_0x15d359));}};Dialer[_0x9077('0x1d')][_0x9077('0x68')]=function(_0x40fbdf){if(_0x40fbdf['dialLimitQueue']>0x0){var _0x4e6abd=_0x40fbdf['dialLimitQueue']-_0x40fbdf[_0x9077('0x153')]-_0x40fbdf[_0x9077('0x13f')];if(_0x4e6abd>0x0&&_0x40fbdf[_0x9077('0x203')]==0x0){this[_0x9077('0x213')](_0x40fbdf);}else{loggerPredictiveCalls[_0x9077('0x4f')](_0x9077('0x214'));}}else{this[_0x9077('0x213')](_0x40fbdf);}};Dialer['prototype'][_0x9077('0x213')]=function(_0x4e5a86){var _0x4e4433=this;var _0x5916e4=[];_0x4e5a86['originated']+=0x1;for(var _0x96ddc4 in this[_0x9077('0x24')]){if(typeof this['agents'][_0x96ddc4]!==_0x9077('0xad')){if(this[_0x9077('0x24')][_0x96ddc4]['state']===_0x9077('0x215')&&this[_0x9077('0x24')][_0x96ddc4]['status']===_0x9077('0x8b')){_0x5916e4[_0x9077('0x9a')](this[_0x9077('0x24')][_0x96ddc4]['id']);}}}_0x4e5a86[_0x9077('0x203')]=0x1;return this['getContactDialer'](_0x4e5a86['id'],_0x5916e4,0x1,_0x4e5a86['dialOrderByScheduledAt'],_0x4e5a86)[_0x9077('0x43')](function(_0x2f53d5){_0x4e5a86[_0x9077('0x203')]=0x1;if(_0x2f53d5){if(!utils[_0x9077('0x205')](_0x2f53d5)){utils[_0x9077('0x216')](_0x4e5a86,0x1,0x0);return hopperUtils[_0x9077('0x20f')](_0x4e5a86)['then'](sendMessageReschedule(_0x4e5a86))[_0x9077('0xa3')](loggerCatch(_0x9077('0x210')));}else{_0x4e5a86['message']=utils[_0x9077('0x7d')]['RUNNING'];if(_[_0x9077('0xf6')](_0x2f53d5[0x0])||_[_0x9077('0xf6')](_0x2f53d5[0x0][_0x9077('0x208')])||_['isNil'](_0x2f53d5[0x0][_0x9077('0x162')])){_0x4e4433[_0x9077('0x157')](_0x9077('0x209'),_0x4e5a86,_0x2f53d5[0x0]);}else{return hopperUtils[_0x9077('0x211')](_[_0x9077('0x77')](_0x2f53d5[0x0],[_0x9077('0xe0'),_0x9077('0x162')]))[_0x9077('0x43')](_0x4e4433[_0x9077('0x1ed')](_0x4e5a86,_0x2f53d5[0x0]))[_0x9077('0xa3')](_0x4e4433[_0x9077('0x156')](_0x9077('0x217'),_0x4e5a86));}}}})[_0x9077('0xa3')](loggerGetContactDialer('[getContactDialerPredictive]',_0x4e5a86,0x1));};Dialer[_0x9077('0x1d')][_0x9077('0x1de')]=function(_0x165146,_0x273cc0,_0x356d6a,_0x10a869,_0x417d50,_0x3f4739){loggerPredictive[_0x9077('0x4f')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive['info'](_0x9077('0x218'),_0x165146);loggerPredictive['info'](_0x9077('0x219'),_0x273cc0);loggerPredictive[_0x9077('0x4f')](_0x9077('0x21a'),_0x356d6a);loggerPredictive['info'](_0x9077('0x21b'),_0x10a869);loggerPredictive[_0x9077('0x4f')](_0x9077('0x21c'),_0x417d50);loggerPredictive[_0x9077('0x4f')](_0x9077('0x59'));return new Promise(function(_0x1bad89,_0x5605ba){if(_0x165146<=0x0||isNaN(_0x165146)){return _0x5605ba(msgResponse(_0x9077('0x21d'),'Error',_0x9077('0x21e')+_0x165146));}if(_0x356d6a<=0x0||isNaN(_0x356d6a)){return _0x5605ba(msgResponse('[abandonmentRate]',_0x9077('0x87'),_0x9077('0x21f')+_0x356d6a));}if(_0x10a869<=0x0||isNaN(_0x10a869)){return _0x5605ba(msgResponse('[abandonmentRate]',_0x9077('0x87'),_0x9077('0x220')+_0x10a869));}if(_0x273cc0<=0x0||isNaN(_0x273cc0)){return _0x5605ba(msgResponse(_0x9077('0x21d'),_0x9077('0x87'),_0x9077('0x221')+_0x273cc0));}if(_0x417d50<=0x0||isNaN(_0x417d50)){return _0x5605ba(msgResponse(_0x9077('0x21d'),_0x9077('0x87'),_0x9077('0x222')+_0x417d50));}_0x3f4739=_0x3f4739||0x0;var _0xf74b61=0x1/_0x356d6a;var _0x5863c9=0x0;var _0x37292b=0x0;var _0x5beffe=0x0;var _0x34ec5c=0x0;for(var _0x11feca=0x0;_0x5beffe<_0x417d50;_0x11feca+=0x1){_0x37292b=_0x11feca/_0x273cc0;_0x5863c9=(_0x10a869*_0x37292b+_0x3f4739)/_0xf74b61;_0x5beffe=utils[_0x9077('0x223')](_0x5863c9,_0x165146);_0x34ec5c=_0x5863c9/_0x165146*(0x1-utils[_0x9077('0x223')](_0x5863c9,_0x165146));}return _0x1bad89({'erlangCalls':_0x11feca,'erlangCallToSecond':_0x273cc0/_0x11feca,'erlangAbandonmentRate':_0x5beffe,'erlangBusyFactor':_0x34ec5c});});};Dialer[_0x9077('0x1d')][_0x9077('0x1e7')]=function(_0x51f0e6,_0xb4deeb,_0x59fde0,_0x3a5c6d,_0x49c6b7,_0x5b8106){loggerPredictive[_0x9077('0x4f')](_0x9077('0x224'));loggerPredictive[_0x9077('0x4f')](_0x9077('0x218'),_0x51f0e6);loggerPredictive[_0x9077('0x4f')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xb4deeb);loggerPredictive[_0x9077('0x4f')]('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',_0x59fde0);loggerPredictive['info'](_0x9077('0x21b'),_0x3a5c6d);loggerPredictive[_0x9077('0x4f')](_0x9077('0x225'),_0x49c6b7);loggerPredictive['info']('---------------------------');return new Promise(function(_0x4c9c35,_0x20df4d){if(_0x51f0e6<=0x0||isNaN(_0x51f0e6)){return _0x20df4d(msgResponse('[busyFactor]',_0x9077('0x87'),_0x9077('0x21e')+_0x51f0e6));}if(_0x59fde0<=0x0||isNaN(_0x59fde0)){return _0x20df4d(msgResponse('[busyFactor]',_0x9077('0x87'),_0x9077('0x21f')+_0x59fde0));}if(_0x3a5c6d<=0x0||isNaN(_0x3a5c6d)){return _0x20df4d(msgResponse('[busyFactor]','Error',_0x9077('0x220')+_0x3a5c6d));}if(_0xb4deeb<=0x0||isNaN(_0xb4deeb)){return _0x20df4d(msgResponse(_0x9077('0x226'),'Error',_0x9077('0x221')+_0xb4deeb));}if(_0x49c6b7<=0x0||isNaN(_0x49c6b7)){return _0x20df4d(msgResponse(_0x9077('0x226'),_0x9077('0x87'),_0x9077('0x227')+_0x49c6b7));}_0x5b8106=_0x5b8106||0x0;var _0x5616d9=0x1/_0x59fde0;var _0x28fd01=0x0;var _0x2f0564=0x0;var _0x38458a=0x0;var _0x4eb86b=0x0;for(var _0x48e63d=0x0;_0x4eb86b<_0x49c6b7;_0x48e63d+=0x1){_0x2f0564=_0x48e63d/_0xb4deeb;_0x28fd01=(_0x3a5c6d*_0x2f0564+_0x5b8106)/_0x5616d9;_0x38458a=utils[_0x9077('0x223')](_0x28fd01,_0x51f0e6);_0x4eb86b=_0x28fd01/_0x51f0e6*(0x1-utils[_0x9077('0x223')](_0x28fd01,_0x51f0e6));}return _0x4c9c35({'erlangCalls':_0x48e63d,'erlangCallToSecond':_0xb4deeb/_0x48e63d,'erlangAbandonmentRate':_0x38458a,'erlangBusyFactor':_0x4eb86b});});};module[_0x9077('0x228')]=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 906af55..f3cf5bd 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 _0x20a6=['dialCutDigit','substring','voiceQueue','getQueue','exports','util','lodash','moment','isNil','string','uniqueid','name','Contact','phone','firstName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>'];(function(_0x269a1b,_0x5a7b4a){var _0x5198a9=function(_0x49381c){while(--_0x49381c){_0x269a1b['push'](_0x269a1b['shift']());}};_0x5198a9(++_0x5a7b4a);}(_0x20a6,0x139));var _0x620a=function(_0x5194df,_0x1fd095){_0x5194df=_0x5194df-0x0;var _0x1ce866=_0x20a6[_0x5194df];return _0x1ce866;};'use strict';var util=require(_0x620a('0x0'));var _=require(_0x620a('0x1'));var moment=require(_0x620a('0x2'));function checkNameSurname(_0x4071d3,_0x3f0fef,_0x3cdbd1){var _0x5d845c='';if(!_[_0x620a('0x3')](_0x3f0fef)&&_0x620a('0x4')===typeof _0x3f0fef){_0x5d845c+=_0x3f0fef;}if(!_['isNil'](_0x3cdbd1)&&_0x620a('0x4')===typeof _0x3cdbd1){_0x5d845c+='\x20'+_0x3cdbd1;}if(_0x5d845c!==''){return _0x5d845c;}return _0x4071d3;}function Action(_0xfd6a6d,_0x3b73bb,_0x3d72e1){this['voiceQueue']=_0xfd6a6d;this[_0x620a('0x5')]=_0x3d72e1||undefined;this[_0x620a('0x6')]=checkNameSurname(_0x3b73bb[_0x620a('0x7')][_0x620a('0x8')],_0x3b73bb[_0x620a('0x7')][_0x620a('0x9')],_0x3b73bb[_0x620a('0x7')]['lastName']);this[_0x620a('0xa')]=_0x3b73bb[_0x620a('0x8')];this[_0x620a('0xb')]=_0xfd6a6d[_0x620a('0x6')];this[_0x620a('0xc')]=_0x3b73bb['active']||![];this[_0x620a('0xd')]=_0xfd6a6d[_0x620a('0xd')];this[_0x620a('0xe')]=_0xfd6a6d[_0x620a('0xe')]||0x3;this[_0x620a('0xf')]=_0x3b73bb[_0x620a('0xf')];this[_0x620a('0x10')]=_0x3b73bb[_0x620a('0x10')];this[_0x620a('0x11')]=_0x3b73bb[_0x620a('0x11')];this['countnoanswerretry']=_0x3b73bb[_0x620a('0x12')];this[_0x620a('0x13')]=_0x3b73bb[_0x620a('0x13')];this[_0x620a('0x14')]=_0x3b73bb[_0x620a('0x14')];this['countabandonedretry']=_0x3b73bb['countabandonedretry'];this[_0x620a('0x15')]=_0x3b73bb['countmachineretry'];this['countagentrejectretry']=_0x3b73bb[_0x620a('0x16')];this['ContactId']=_0x3b73bb['ContactId'];this[_0x620a('0x17')]=_0x3b73bb[_0x620a('0x17')];this[_0x620a('0x18')]=_0x3b73bb['UserId'];this[_0x620a('0x19')]=_0x3b73bb[_0x620a('0x19')];this['CampaignId']=_0x3b73bb[_0x620a('0x1a')];this[_0x620a('0x1b')]=_0x3b73bb['id'];this[_0x620a('0x1c')]=_0x3b73bb[_0x620a('0x7')][_0x620a('0x9')]||'';this[_0x620a('0x1d')]=moment()['format'](_0x620a('0x1e'));this[_0x620a('0x1f')]=_0x3b73bb[_0x620a('0x1f')];this[_0x620a('0x20')]=_0x3b73bb[_0x620a('0x20')];this['callbackat']=_0x3b73bb[_0x620a('0x21')];this[_0x620a('0x22')]=_0x3b73bb['recallme'];this[_0x620a('0x23')]='';this[_0x620a('0x24')]='';}Action[_0x620a('0x25')]['getCaller']=function(){return util['format'](_0x620a('0x26'),this['name'],this['voiceQueue'][_0x620a('0x27')]>0x0?this[_0x620a('0xa')][_0x620a('0x28')](this[_0x620a('0x29')]['dialCutDigit']):this[_0x620a('0xa')]);};Action[_0x620a('0x25')][_0x620a('0x2a')]=function(){return this[_0x620a('0xb')];};module[_0x620a('0x2b')]=Action; \ No newline at end of file +var _0x2a97=['originatecalleridname','dialCutDigit','substring','prototype','getQueue','exports','util','moment','isNil','string','voiceQueue','uniqueid','name','Contact','lastName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum'];(function(_0x29fb75,_0x53ab6e){var _0xd73edc=function(_0x2aa4a4){while(--_0x2aa4a4){_0x29fb75['push'](_0x29fb75['shift']());}};_0xd73edc(++_0x53ab6e);}(_0x2a97,0xec));var _0x72a9=function(_0x164010,_0x5d3f7d){_0x164010=_0x164010-0x0;var _0x1680ac=_0x2a97[_0x164010];return _0x1680ac;};'use strict';var util=require(_0x72a9('0x0'));var _=require('lodash');var moment=require(_0x72a9('0x1'));function checkNameSurname(_0x526e29,_0x339e71,_0xa87964){var _0x2599e='';if(!_[_0x72a9('0x2')](_0x339e71)&&_0x72a9('0x3')===typeof _0x339e71){_0x2599e+=_0x339e71;}if(!_[_0x72a9('0x2')](_0xa87964)&&_0x72a9('0x3')===typeof _0xa87964){_0x2599e+='\x20'+_0xa87964;}if(_0x2599e!==''){return _0x2599e;}return _0x526e29;}function Action(_0x51a315,_0x373047,_0x3c0d39){this[_0x72a9('0x4')]=_0x51a315;this[_0x72a9('0x5')]=_0x3c0d39||undefined;this[_0x72a9('0x6')]=checkNameSurname(_0x373047[_0x72a9('0x7')]['phone'],_0x373047['Contact']['firstName'],_0x373047[_0x72a9('0x7')][_0x72a9('0x8')]);this[_0x72a9('0x9')]=_0x373047[_0x72a9('0xa')];this[_0x72a9('0xb')]=_0x51a315[_0x72a9('0x6')];this['active']=_0x373047[_0x72a9('0xc')]||![];this['type']=_0x51a315[_0x72a9('0xd')];this[_0x72a9('0xe')]=_0x51a315['dialQueueTimeout']||0x3;this[_0x72a9('0xf')]=_0x373047[_0x72a9('0xf')];this[_0x72a9('0x10')]=_0x373047[_0x72a9('0x10')];this['countcongestionretry']=_0x373047[_0x72a9('0x11')];this[_0x72a9('0x12')]=_0x373047[_0x72a9('0x12')];this[_0x72a9('0x13')]=_0x373047['countnosuchnumberretry'];this[_0x72a9('0x14')]=_0x373047['countdropretry'];this['countabandonedretry']=_0x373047[_0x72a9('0x15')];this[_0x72a9('0x16')]=_0x373047[_0x72a9('0x16')];this['countagentrejectretry']=_0x373047[_0x72a9('0x17')];this[_0x72a9('0x18')]=_0x373047['ContactId'];this[_0x72a9('0x19')]=_0x373047[_0x72a9('0x19')];this[_0x72a9('0x1a')]=_0x373047[_0x72a9('0x1a')];this[_0x72a9('0x1b')]=_0x373047[_0x72a9('0x1b')];this[_0x72a9('0x1c')]=_0x373047['CampaignId'];this[_0x72a9('0x1d')]=_0x373047['id'];this[_0x72a9('0x1e')]=_0x373047[_0x72a9('0x7')][_0x72a9('0x1f')]||'';this[_0x72a9('0x20')]=moment()[_0x72a9('0x21')](_0x72a9('0x22'));this[_0x72a9('0x23')]=_0x373047[_0x72a9('0x23')];this[_0x72a9('0x24')]=_0x373047[_0x72a9('0x24')];this['callbackat']=_0x373047[_0x72a9('0x25')];this[_0x72a9('0x26')]=_0x373047[_0x72a9('0x26')];this[_0x72a9('0x27')]='';this[_0x72a9('0x28')]='';}Action['prototype']['getCaller']=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0x72a9('0x6')],this['voiceQueue'][_0x72a9('0x29')]>0x0?this['number'][_0x72a9('0x2a')](this[_0x72a9('0x4')][_0x72a9('0x29')]):this[_0x72a9('0x9')]);};Action[_0x72a9('0x2b')][_0x72a9('0x2c')]=function(){return this[_0x72a9('0xb')];};module[_0x72a9('0x2d')]=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 faf8944..8a6a229 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 _0xc799=['countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','../utils','state','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countnosuchnumberretry','countmachineretry'];(function(_0x5c1d09,_0xa7641d){var _0x21b539=function(_0x441e93){while(--_0x441e93){_0x5c1d09['push'](_0x5c1d09['shift']());}};_0x21b539(++_0xa7641d);}(_0xc799,0x12c));var _0x9c79=function(_0x4c31d6,_0x4312f6){_0x4c31d6=_0x4c31d6-0x0;var _0x1c654e=_0xc799[_0x4c31d6];return _0x1c654e;};'use strict';var moment=require('moment');var utils=require(_0x9c79('0x0'));function AgentComplete(_0x2beb6e,_0x251922){this[_0x9c79('0x1')]=0x4;this['statedesc']='Answer';this[_0x9c79('0x2')]=_0x2beb6e[_0x9c79('0x2')];this[_0x9c79('0x3')]=_0x2beb6e['type'];this[_0x9c79('0x4')]=_0x2beb6e['type']===_0x9c79('0x5')?_0x9c79('0x6'):_0x2beb6e[_0x9c79('0x3')];this[_0x9c79('0x7')]=_0x2beb6e['countbusyretry'];this['countcongestionretry']=_0x2beb6e[_0x9c79('0x8')];this[_0x9c79('0x9')]=_0x2beb6e[_0x9c79('0x9')];this[_0x9c79('0xa')]=_0x2beb6e[_0x9c79('0x7')]+_0x2beb6e['countcongestionretry']+_0x2beb6e[_0x9c79('0x9')]+_0x2beb6e['countnosuchnumberretry']+_0x2beb6e[_0x9c79('0xb')]+_0x2beb6e[_0x9c79('0xc')]+_0x2beb6e['countmachineretry']+_0x2beb6e['countagentrejectretry'];this[_0x9c79('0xd')]=_0x2beb6e['countnosuchnumberretry'];this[_0x9c79('0xb')]=_0x2beb6e[_0x9c79('0xb')];this[_0x9c79('0xc')]=_0x2beb6e[_0x9c79('0xc')];this['countmachineretry']=_0x2beb6e[_0x9c79('0xe')];this[_0x9c79('0xf')]=_0x2beb6e[_0x9c79('0xf')];this[_0x9c79('0x10')]=_0x251922['uniqueid'];this[_0x9c79('0x11')]=_0x2beb6e[_0x9c79('0x12')];this[_0x9c79('0x13')]=_0x2beb6e[_0x9c79('0x14')];this[_0x9c79('0x15')]=_0x2beb6e['starttime'];this[_0x9c79('0x16')]=_0x2beb6e['responsetime'];this[_0x9c79('0x17')]=_0x2beb6e[_0x9c79('0x17')];this['endtime']=moment()['format'](_0x9c79('0x18'));this[_0x9c79('0x19')]=utils[_0x9c79('0x1a')](_0x2beb6e['responsetime'],_0x2beb6e[_0x9c79('0x15')]);this[_0x9c79('0x1b')]=utils[_0x9c79('0x1a')](_0x2beb6e[_0x9c79('0x17')],_0x2beb6e[_0x9c79('0x16')]);this[_0x9c79('0x1c')]=utils[_0x9c79('0x1a')](this[_0x9c79('0x1d')],_0x2beb6e[_0x9c79('0x17')]);this[_0x9c79('0x6')]=_0x251922[_0x9c79('0x6')];this['membername']=_0x251922[_0x9c79('0x1e')];this[_0x9c79('0x1f')]=_0x251922[_0x9c79('0x1f')];this['callback']=_0x2beb6e[_0x9c79('0x20')];this[_0x9c79('0x21')]=_0x2beb6e[_0x9c79('0x21')];this[_0x9c79('0x22')]=_0x2beb6e[_0x9c79('0x22')];this[_0x9c79('0x23')]=_0x2beb6e[_0x9c79('0x23')];this[_0x9c79('0x24')]=_0x2beb6e[_0x9c79('0x24')];this[_0x9c79('0x25')]=_0x2beb6e[_0x9c79('0x25')];this[_0x9c79('0x26')]=_0x2beb6e['UserId'];this['VoiceQueueId']=_0x2beb6e[_0x9c79('0x27')];this[_0x9c79('0x28')]=_0x2beb6e[_0x9c79('0x28')];this[_0x9c79('0x29')]=_0x2beb6e[_0x9c79('0x29')]||'';this[_0x9c79('0x2a')]=_0x2beb6e[_0x9c79('0x2a')]||'';this[_0x9c79('0x2b')]=_0x2beb6e['agiafterat'];}module[_0x9c79('0x2c')]=AgentComplete; \ No newline at end of file +var _0x5286=['originatecalleridname','agiafterat','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','membername','reason','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x4e9287,_0x3b84d){var _0x546585=function(_0x22c57c){while(--_0x22c57c){_0x4e9287['push'](_0x4e9287['shift']());}};_0x546585(++_0x3b84d);}(_0x5286,0x1f2));var _0x6528=function(_0x4eebe4,_0x26fb3f){_0x4eebe4=_0x4eebe4-0x0;var _0x328c1d=_0x5286[_0x4eebe4];return _0x328c1d;};'use strict';var moment=require(_0x6528('0x0'));var utils=require(_0x6528('0x1'));function AgentComplete(_0xa5028,_0x4107c7){this[_0x6528('0x2')]=0x4;this[_0x6528('0x3')]=_0x6528('0x4');this[_0x6528('0x5')]=_0xa5028[_0x6528('0x5')];this[_0x6528('0x6')]=_0xa5028[_0x6528('0x6')];this[_0x6528('0x7')]=_0xa5028[_0x6528('0x6')]===_0x6528('0x8')?_0x6528('0x9'):_0xa5028[_0x6528('0x6')];this[_0x6528('0xa')]=_0xa5028[_0x6528('0xa')];this[_0x6528('0xb')]=_0xa5028[_0x6528('0xb')];this[_0x6528('0xc')]=_0xa5028[_0x6528('0xc')];this[_0x6528('0xd')]=_0xa5028[_0x6528('0xa')]+_0xa5028[_0x6528('0xb')]+_0xa5028[_0x6528('0xc')]+_0xa5028[_0x6528('0xe')]+_0xa5028['countdropretry']+_0xa5028['countabandonedretry']+_0xa5028[_0x6528('0xf')]+_0xa5028[_0x6528('0x10')];this[_0x6528('0xe')]=_0xa5028[_0x6528('0xe')];this['countdropretry']=_0xa5028[_0x6528('0x11')];this[_0x6528('0x12')]=_0xa5028[_0x6528('0x12')];this[_0x6528('0xf')]=_0xa5028['countmachineretry'];this[_0x6528('0x10')]=_0xa5028[_0x6528('0x10')];this[_0x6528('0x13')]=_0x4107c7[_0x6528('0x13')];this['calleridname']=_0xa5028[_0x6528('0x14')];this['calleridnum']=_0xa5028[_0x6528('0x15')];this[_0x6528('0x16')]=_0xa5028[_0x6528('0x16')];this['responsetime']=_0xa5028[_0x6528('0x17')];this['answertime']=_0xa5028[_0x6528('0x18')];this[_0x6528('0x19')]=moment()[_0x6528('0x1a')](_0x6528('0x1b'));this[_0x6528('0x1c')]=utils[_0x6528('0x1d')](_0xa5028[_0x6528('0x17')],_0xa5028[_0x6528('0x16')]);this[_0x6528('0x1e')]=utils[_0x6528('0x1d')](_0xa5028[_0x6528('0x18')],_0xa5028['responsetime']);this[_0x6528('0x1f')]=utils['getSeconds'](this[_0x6528('0x19')],_0xa5028['answertime']);this[_0x6528('0x9')]=_0x4107c7[_0x6528('0x9')];this[_0x6528('0x20')]=_0x4107c7[_0x6528('0x20')];this[_0x6528('0x21')]=_0x4107c7[_0x6528('0x21')];this['callback']=_0xa5028['callback'];this[_0x6528('0x22')]=_0xa5028[_0x6528('0x22')];this[_0x6528('0x23')]=_0xa5028[_0x6528('0x23')];this['recallme']=_0xa5028['recallme'];this[_0x6528('0x24')]=_0xa5028[_0x6528('0x24')];this['ListId']=_0xa5028[_0x6528('0x25')];this[_0x6528('0x26')]=_0xa5028[_0x6528('0x26')];this[_0x6528('0x27')]=_0xa5028[_0x6528('0x27')];this[_0x6528('0x28')]=_0xa5028[_0x6528('0x28')];this['originatecalleridnum']=_0xa5028[_0x6528('0x29')]||'';this[_0x6528('0x2a')]=_0xa5028[_0x6528('0x2a')]||'';this[_0x6528('0x2b')]=_0xa5028[_0x6528('0x2b')];}module[_0x6528('0x2c')]=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 b13fa98..3400ecf 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 _0x5f3b=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','exports','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback'];(function(_0x381650,_0x3a57b9){var _0x3b40da=function(_0x30247b){while(--_0x30247b){_0x381650['push'](_0x381650['shift']());}};_0x3b40da(++_0x3a57b9);}(_0x5f3b,0x101));var _0xb5f3=function(_0x5e27cc,_0x3f6cbd){_0x5e27cc=_0x5e27cc-0x0;var _0x1e2342=_0x5f3b[_0x5e27cc];return _0x1e2342;};'use strict';function Final(_0x10cbbb){this['uniqueid']=_0x10cbbb[_0xb5f3('0x0')];this[_0xb5f3('0x1')]=_0x10cbbb[_0xb5f3('0x1')];this['type']=_0x10cbbb[_0xb5f3('0x2')];this[_0xb5f3('0x3')]=_0x10cbbb[_0xb5f3('0x2')]===_0xb5f3('0x4')?'queue':_0x10cbbb[_0xb5f3('0x2')];this[_0xb5f3('0x5')]=_0x10cbbb[_0xb5f3('0x5')];this[_0xb5f3('0x6')]=_0x10cbbb[_0xb5f3('0x6')];this[_0xb5f3('0x7')]=_0x10cbbb['countnoanswerretry'];this[_0xb5f3('0x8')]=_0x10cbbb['countbusyretry']+_0x10cbbb[_0xb5f3('0x6')]+_0x10cbbb[_0xb5f3('0x7')]+_0x10cbbb[_0xb5f3('0x9')]+_0x10cbbb[_0xb5f3('0xa')]+_0x10cbbb[_0xb5f3('0xb')]+_0x10cbbb[_0xb5f3('0xc')]+_0x10cbbb[_0xb5f3('0xd')];this[_0xb5f3('0x9')]=_0x10cbbb['countnosuchnumberretry'];this[_0xb5f3('0xa')]=_0x10cbbb[_0xb5f3('0xa')];this[_0xb5f3('0xb')]=_0x10cbbb[_0xb5f3('0xb')];this['countmachineretry']=_0x10cbbb[_0xb5f3('0xc')];this[_0xb5f3('0xd')]=_0x10cbbb[_0xb5f3('0xd')];this[_0xb5f3('0xe')]=_0x10cbbb[_0xb5f3('0xe')];this['calleridname']=_0x10cbbb['calleridname'];this[_0xb5f3('0xf')]=_0x10cbbb['calleridnum'];this[_0xb5f3('0x10')]=_0x10cbbb['starttime'];this[_0xb5f3('0x11')]=_0x10cbbb['responsetime'];this[_0xb5f3('0x12')]=_0x10cbbb[_0xb5f3('0x11')];this[_0xb5f3('0x13')]=_0x10cbbb[_0xb5f3('0x13')]||0x0;this[_0xb5f3('0x14')]=_0x10cbbb['holdtime']||0x0;this[_0xb5f3('0x15')]=_0x10cbbb[_0xb5f3('0x15')]||0x0;this[_0xb5f3('0x16')]=_0x10cbbb[_0xb5f3('0x16')];this[_0xb5f3('0x17')]=_0x10cbbb[_0xb5f3('0x17')];this[_0xb5f3('0x18')]=_0x10cbbb[_0xb5f3('0x18')];this[_0xb5f3('0x19')]=_0x10cbbb['recallme'];this[_0xb5f3('0x1a')]=_0x10cbbb[_0xb5f3('0x1a')];this[_0xb5f3('0x1b')]=_0x10cbbb['ListId'];this[_0xb5f3('0x1c')]=_0x10cbbb[_0xb5f3('0x1c')];this[_0xb5f3('0x1d')]=_0x10cbbb['VoiceQueueId'];this['CampaignId']=_0x10cbbb[_0xb5f3('0x1e')];this[_0xb5f3('0x1f')]=_0x10cbbb['originatecalleridnum']||'';this[_0xb5f3('0x20')]=_0x10cbbb['originatecalleridname']||'';this[_0xb5f3('0x21')]=_0x10cbbb[_0xb5f3('0x21')];this['statedesc']=_0x10cbbb['statedesc'];}module[_0xb5f3('0x22')]=Final; \ No newline at end of file +var _0xa636=['countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','state','statedesc','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x3b2137,_0xa40206){var _0x190198=function(_0x38ee1f){while(--_0x38ee1f){_0x3b2137['push'](_0x3b2137['shift']());}};_0x190198(++_0xa40206);}(_0xa636,0x14f));var _0x6a63=function(_0x589274,_0xa3f1bd){_0x589274=_0x589274-0x0;var _0x21814b=_0xa636[_0x589274];return _0x21814b;};'use strict';function Final(_0x5c72b6){this['uniqueid']=_0x5c72b6['uniqueid'];this['scheduledat']=_0x5c72b6['scheduledat'];this['type']=_0x5c72b6[_0x6a63('0x0')];this[_0x6a63('0x1')]=_0x5c72b6[_0x6a63('0x0')]==='outbound'?_0x6a63('0x2'):_0x5c72b6['type'];this[_0x6a63('0x3')]=_0x5c72b6[_0x6a63('0x3')];this[_0x6a63('0x4')]=_0x5c72b6[_0x6a63('0x4')];this[_0x6a63('0x5')]=_0x5c72b6['countnoanswerretry'];this[_0x6a63('0x6')]=_0x5c72b6[_0x6a63('0x3')]+_0x5c72b6[_0x6a63('0x4')]+_0x5c72b6['countnoanswerretry']+_0x5c72b6[_0x6a63('0x7')]+_0x5c72b6[_0x6a63('0x8')]+_0x5c72b6[_0x6a63('0x9')]+_0x5c72b6[_0x6a63('0xa')]+_0x5c72b6['countagentrejectretry'];this['countnosuchnumberretry']=_0x5c72b6[_0x6a63('0x7')];this[_0x6a63('0x8')]=_0x5c72b6[_0x6a63('0x8')];this['countabandonedretry']=_0x5c72b6[_0x6a63('0x9')];this[_0x6a63('0xa')]=_0x5c72b6[_0x6a63('0xa')];this[_0x6a63('0xb')]=_0x5c72b6[_0x6a63('0xb')];this[_0x6a63('0x2')]=_0x5c72b6['queue'];this['calleridname']=_0x5c72b6['calleridname'];this['calleridnum']=_0x5c72b6[_0x6a63('0xc')];this['starttime']=_0x5c72b6[_0x6a63('0xd')];this['responsetime']=_0x5c72b6[_0x6a63('0xe')];this[_0x6a63('0xf')]=_0x5c72b6['responsetime'];this['ringtime']=_0x5c72b6[_0x6a63('0x10')]||0x0;this[_0x6a63('0x11')]=_0x5c72b6[_0x6a63('0x11')]||0x0;this['talktime']=_0x5c72b6[_0x6a63('0x12')]||0x0;this[_0x6a63('0x13')]=_0x5c72b6[_0x6a63('0x13')];this[_0x6a63('0x14')]=_0x5c72b6[_0x6a63('0x14')];this[_0x6a63('0x15')]=_0x5c72b6['callbackat'];this[_0x6a63('0x16')]=_0x5c72b6[_0x6a63('0x16')];this[_0x6a63('0x17')]=_0x5c72b6['ContactId'];this[_0x6a63('0x18')]=_0x5c72b6[_0x6a63('0x18')];this[_0x6a63('0x19')]=_0x5c72b6[_0x6a63('0x19')];this[_0x6a63('0x1a')]=_0x5c72b6['VoiceQueueId'];this['CampaignId']=_0x5c72b6['CampaignId'];this[_0x6a63('0x1b')]=_0x5c72b6['originatecalleridnum']||'';this['originatecalleridname']=_0x5c72b6[_0x6a63('0x1c')]||'';this['state']=_0x5c72b6[_0x6a63('0x1d')];this[_0x6a63('0x1e')]=_0x5c72b6[_0x6a63('0x1e')];}module['exports']=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 aafb1fc..b85d8e9 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 _0x6d9c=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','membername','IVR','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','state','statedesc','Answer','scheduledat','type','outbound','queue','amd','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countdropretry','countabandonedretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','starttime','responsetime'];(function(_0x48396f,_0x2303c2){var _0x37cb9e=function(_0x4e250b){while(--_0x4e250b){_0x48396f['push'](_0x48396f['shift']());}};_0x37cb9e(++_0x2303c2);}(_0x6d9c,0x1e1));var _0xc6d9=function(_0x954e33,_0x11fbd9){_0x954e33=_0x954e33-0x0;var _0x2b17b4=_0x6d9c[_0x954e33];return _0x2b17b4;};'use strict';var moment=require(_0xc6d9('0x0'));var utils=require('../utils');function Hangup(_0x34f9e5,_0x551366){this[_0xc6d9('0x1')]=0x4;this[_0xc6d9('0x2')]=_0xc6d9('0x3');this[_0xc6d9('0x4')]=_0x34f9e5[_0xc6d9('0x4')];this['type']=_0x34f9e5[_0xc6d9('0x5')];this['campaigntype']=_0x34f9e5[_0xc6d9('0x5')]===_0xc6d9('0x6')?_0xc6d9('0x7'):_0x34f9e5[_0xc6d9('0x5')];this[_0xc6d9('0x8')]=_0x34f9e5[_0xc6d9('0x8')]||![];this[_0xc6d9('0x9')]=_0x34f9e5['countbusyretry'];this[_0xc6d9('0xa')]=_0x34f9e5[_0xc6d9('0xa')];this['countnoanswerretry']=_0x34f9e5['countnoanswerretry'];this[_0xc6d9('0xb')]=_0x34f9e5['countbusyretry']+_0x34f9e5[_0xc6d9('0xa')]+_0x34f9e5[_0xc6d9('0xc')]+_0x34f9e5['countnosuchnumberretry']+_0x34f9e5[_0xc6d9('0xd')]+_0x34f9e5[_0xc6d9('0xe')]+_0x34f9e5['countmachineretry']+_0x34f9e5['countagentrejectretry'];this[_0xc6d9('0xf')]=_0x34f9e5[_0xc6d9('0xf')];this[_0xc6d9('0xd')]=_0x34f9e5[_0xc6d9('0xd')];this[_0xc6d9('0xe')]=_0x34f9e5[_0xc6d9('0xe')];this[_0xc6d9('0x10')]=_0x34f9e5['countmachineretry'];this[_0xc6d9('0x11')]=_0x34f9e5[_0xc6d9('0x11')];this[_0xc6d9('0x12')]=_0x551366[_0xc6d9('0x12')];this[_0xc6d9('0x13')]=_0x34f9e5['name'];this[_0xc6d9('0x14')]=_0x34f9e5['number'];this[_0xc6d9('0x15')]=_0x34f9e5[_0xc6d9('0x15')];this['responsetime']=_0x34f9e5[_0xc6d9('0x16')];this[_0xc6d9('0x17')]=moment()[_0xc6d9('0x18')](_0xc6d9('0x19'));this[_0xc6d9('0x1a')]=utils[_0xc6d9('0x1b')](_0x34f9e5[_0xc6d9('0x16')],_0x34f9e5[_0xc6d9('0x15')]);this[_0xc6d9('0x1c')]=0x0;this[_0xc6d9('0x1d')]=utils[_0xc6d9('0x1b')](this['endtime'],_0x34f9e5[_0xc6d9('0x16')]);this[_0xc6d9('0x7')]=_0x34f9e5[_0xc6d9('0x7')];this[_0xc6d9('0x1e')]=_0xc6d9('0x1f');this[_0xc6d9('0x20')]=_0x551366['cause-txt'];this[_0xc6d9('0x21')]=_0x34f9e5[_0xc6d9('0x21')];this[_0xc6d9('0x22')]=_0x34f9e5[_0xc6d9('0x22')];this['callbackat']=_0x34f9e5['callbackat'];this['recallme']=_0x34f9e5[_0xc6d9('0x23')];this[_0xc6d9('0x24')]=_0x34f9e5[_0xc6d9('0x24')];this[_0xc6d9('0x25')]=_0x34f9e5[_0xc6d9('0x25')];this[_0xc6d9('0x26')]=_0x34f9e5['UserId'];this[_0xc6d9('0x27')]=_0x34f9e5[_0xc6d9('0x27')];this[_0xc6d9('0x28')]=_0x34f9e5[_0xc6d9('0x28')];}module[_0xc6d9('0x29')]=Hangup; \ No newline at end of file +var _0xbbee=['moment','../utils','statedesc','scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countnoanswerretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','talktime','membername','IVR','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports'];(function(_0x392e2b,_0x15625a){var _0x49fbc0=function(_0x294d67){while(--_0x294d67){_0x392e2b['push'](_0x392e2b['shift']());}};_0x49fbc0(++_0x15625a);}(_0xbbee,0x10a));var _0xebbe=function(_0x1e9c05,_0x60d7a0){_0x1e9c05=_0x1e9c05-0x0;var _0x417e78=_0xbbee[_0x1e9c05];return _0x417e78;};'use strict';var moment=require(_0xebbe('0x0'));var utils=require(_0xebbe('0x1'));function Hangup(_0x29a424,_0x4feaae){this['state']=0x4;this[_0xebbe('0x2')]='Answer';this[_0xebbe('0x3')]=_0x29a424['scheduledat'];this[_0xebbe('0x4')]=_0x29a424['type'];this[_0xebbe('0x5')]=_0x29a424[_0xebbe('0x4')]===_0xebbe('0x6')?_0xebbe('0x7'):_0x29a424[_0xebbe('0x4')];this[_0xebbe('0x8')]=_0x29a424[_0xebbe('0x8')]||![];this['countbusyretry']=_0x29a424[_0xebbe('0x9')];this['countcongestionretry']=_0x29a424['countcongestionretry'];this[_0xebbe('0xa')]=_0x29a424[_0xebbe('0xa')];this['countglobal']=_0x29a424[_0xebbe('0x9')]+_0x29a424['countcongestionretry']+_0x29a424[_0xebbe('0xa')]+_0x29a424['countnosuchnumberretry']+_0x29a424['countdropretry']+_0x29a424[_0xebbe('0xb')]+_0x29a424[_0xebbe('0xc')]+_0x29a424[_0xebbe('0xd')];this[_0xebbe('0xe')]=_0x29a424[_0xebbe('0xe')];this[_0xebbe('0xf')]=_0x29a424[_0xebbe('0xf')];this['countabandonedretry']=_0x29a424[_0xebbe('0xb')];this[_0xebbe('0xc')]=_0x29a424[_0xebbe('0xc')];this[_0xebbe('0xd')]=_0x29a424['countagentrejectretry'];this[_0xebbe('0x10')]=_0x4feaae['uniqueid'];this[_0xebbe('0x11')]=_0x29a424['name'];this['calleridnum']=_0x29a424[_0xebbe('0x12')];this[_0xebbe('0x13')]=_0x29a424['starttime'];this[_0xebbe('0x14')]=_0x29a424[_0xebbe('0x14')];this[_0xebbe('0x15')]=moment()[_0xebbe('0x16')](_0xebbe('0x17'));this['ringtime']=utils[_0xebbe('0x18')](_0x29a424[_0xebbe('0x14')],_0x29a424[_0xebbe('0x13')]);this['holdtime']=0x0;this[_0xebbe('0x19')]=utils[_0xebbe('0x18')](this[_0xebbe('0x15')],_0x29a424[_0xebbe('0x14')]);this[_0xebbe('0x7')]=_0x29a424['queue'];this[_0xebbe('0x1a')]=_0xebbe('0x1b');this['reason']=_0x4feaae['cause-txt'];this[_0xebbe('0x1c')]=_0x29a424['callback'];this['callbackuniqueid']=_0x29a424[_0xebbe('0x1d')];this[_0xebbe('0x1e')]=_0x29a424[_0xebbe('0x1e')];this[_0xebbe('0x1f')]=_0x29a424[_0xebbe('0x1f')];this['ContactId']=_0x29a424[_0xebbe('0x20')];this['ListId']=_0x29a424[_0xebbe('0x21')];this[_0xebbe('0x22')]=_0x29a424[_0xebbe('0x22')];this[_0xebbe('0x23')]=_0x29a424[_0xebbe('0x23')];this[_0xebbe('0x24')]=_0x29a424['CampaignId'];}module[_0xebbe('0x25')]=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 e76c464..7f7556b 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 _0xc3a6=['exports','../utils','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','getSeconds','holdtime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','state','statedesc'];(function(_0x230cbd,_0x1b110a){var _0x21e766=function(_0x34d647){while(--_0x34d647){_0x230cbd['push'](_0x230cbd['shift']());}};_0x21e766(++_0x1b110a);}(_0xc3a6,0x15f));var _0x6c3a=function(_0x832803,_0x2b918e){_0x832803=_0x832803-0x0;var _0x159e77=_0xc3a6[_0x832803];return _0x159e77;};'use strict';var utils=require(_0x6c3a('0x0'));function History(_0x20dc51){this[_0x6c3a('0x1')]=_0x20dc51[_0x6c3a('0x1')];this[_0x6c3a('0x2')]=_0x20dc51[_0x6c3a('0x2')]||undefined;this[_0x6c3a('0x3')]=_0x20dc51['type'];this['campaigntype']=_0x20dc51[_0x6c3a('0x3')]===_0x6c3a('0x4')?_0x6c3a('0x5'):_0x20dc51[_0x6c3a('0x3')];this['countbusyretry']=_0x20dc51[_0x6c3a('0x6')];this['countcongestionretry']=_0x20dc51[_0x6c3a('0x7')];this[_0x6c3a('0x8')]=_0x20dc51[_0x6c3a('0x8')];this[_0x6c3a('0x9')]=_0x20dc51[_0x6c3a('0x6')]+_0x20dc51[_0x6c3a('0x7')]+_0x20dc51[_0x6c3a('0x8')]+_0x20dc51['countnosuchnumberretry']+_0x20dc51['countdropretry']+_0x20dc51['countabandonedretry']+_0x20dc51[_0x6c3a('0xa')]+_0x20dc51[_0x6c3a('0xb')];this['countnosuchnumberretry']=_0x20dc51['countnosuchnumberretry'];this[_0x6c3a('0xc')]=_0x20dc51[_0x6c3a('0xc')];this[_0x6c3a('0xd')]=_0x20dc51[_0x6c3a('0xd')];this[_0x6c3a('0xa')]=_0x20dc51[_0x6c3a('0xa')];this[_0x6c3a('0xb')]=_0x20dc51['countagentrejectretry'];this[_0x6c3a('0x5')]=_0x20dc51[_0x6c3a('0x5')];this[_0x6c3a('0xe')]=_0x20dc51[_0x6c3a('0xf')];this[_0x6c3a('0x10')]=_0x20dc51[_0x6c3a('0x11')];this[_0x6c3a('0x12')]=_0x20dc51[_0x6c3a('0x12')];this['responsetime']=_0x20dc51[_0x6c3a('0x13')];this[_0x6c3a('0x14')]=_0x20dc51[_0x6c3a('0x13')];this['ringtime']=utils[_0x6c3a('0x15')](_0x20dc51[_0x6c3a('0x13')],_0x20dc51[_0x6c3a('0x12')]);this[_0x6c3a('0x16')]=0x0;this['talktime']=0x0;this['callback']=_0x20dc51['callback'];this[_0x6c3a('0x17')]=_0x20dc51[_0x6c3a('0x17')];this[_0x6c3a('0x18')]=_0x20dc51[_0x6c3a('0x18')];this[_0x6c3a('0x19')]=_0x20dc51[_0x6c3a('0x19')];this[_0x6c3a('0x1a')]=_0x20dc51[_0x6c3a('0x1a')];this[_0x6c3a('0x1b')]=_0x20dc51[_0x6c3a('0x1b')];this[_0x6c3a('0x1c')]=_0x20dc51[_0x6c3a('0x1c')];this[_0x6c3a('0x1d')]=_0x20dc51[_0x6c3a('0x1d')];this['CampaignId']=_0x20dc51['CampaignId'];this['originatecalleridnum']=_0x20dc51[_0x6c3a('0x1e')]||'';this[_0x6c3a('0x1f')]=_0x20dc51[_0x6c3a('0x1f')]||'';this[_0x6c3a('0x20')]=_0x20dc51[_0x6c3a('0x20')];this['statedesc']=_0x20dc51[_0x6c3a('0x21')];}module[_0x6c3a('0x22')]=History; \ No newline at end of file +var _0x1add=['countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countabandonedretry','queue','calleridname','name','number','starttime','responsetime','endtime','getSeconds','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','state','statedesc','exports','uniqueid','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x4d3309,_0xcb6015){var _0x5aee3b=function(_0x55b610){while(--_0x55b610){_0x4d3309['push'](_0x4d3309['shift']());}};_0x5aee3b(++_0xcb6015);}(_0x1add,0x1d5));var _0xd1ad=function(_0x5e8ec3,_0x23491c){_0x5e8ec3=_0x5e8ec3-0x0;var _0x326f97=_0x1add[_0x5e8ec3];return _0x326f97;};'use strict';var utils=require('../utils');function History(_0x250063){this['uniqueid']=_0x250063[_0xd1ad('0x0')];this['scheduledat']=_0x250063[_0xd1ad('0x1')]||undefined;this['type']=_0x250063[_0xd1ad('0x2')];this['campaigntype']=_0x250063[_0xd1ad('0x2')]==='outbound'?'queue':_0x250063[_0xd1ad('0x2')];this[_0xd1ad('0x3')]=_0x250063[_0xd1ad('0x3')];this[_0xd1ad('0x4')]=_0x250063[_0xd1ad('0x4')];this[_0xd1ad('0x5')]=_0x250063[_0xd1ad('0x5')];this[_0xd1ad('0x6')]=_0x250063['countbusyretry']+_0x250063['countcongestionretry']+_0x250063[_0xd1ad('0x5')]+_0x250063['countnosuchnumberretry']+_0x250063['countdropretry']+_0x250063['countabandonedretry']+_0x250063[_0xd1ad('0x7')]+_0x250063[_0xd1ad('0x8')];this['countnosuchnumberretry']=_0x250063[_0xd1ad('0x9')];this[_0xd1ad('0xa')]=_0x250063[_0xd1ad('0xa')];this[_0xd1ad('0xb')]=_0x250063[_0xd1ad('0xb')];this[_0xd1ad('0x7')]=_0x250063[_0xd1ad('0x7')];this[_0xd1ad('0x8')]=_0x250063[_0xd1ad('0x8')];this[_0xd1ad('0xc')]=_0x250063['queue'];this[_0xd1ad('0xd')]=_0x250063[_0xd1ad('0xe')];this['calleridnum']=_0x250063[_0xd1ad('0xf')];this[_0xd1ad('0x10')]=_0x250063[_0xd1ad('0x10')];this[_0xd1ad('0x11')]=_0x250063['responsetime'];this[_0xd1ad('0x12')]=_0x250063[_0xd1ad('0x11')];this['ringtime']=utils[_0xd1ad('0x13')](_0x250063[_0xd1ad('0x11')],_0x250063[_0xd1ad('0x10')]);this['holdtime']=0x0;this[_0xd1ad('0x14')]=0x0;this[_0xd1ad('0x15')]=_0x250063[_0xd1ad('0x15')];this[_0xd1ad('0x16')]=_0x250063[_0xd1ad('0x16')];this['callbackat']=_0x250063[_0xd1ad('0x17')];this[_0xd1ad('0x18')]=_0x250063[_0xd1ad('0x18')];this[_0xd1ad('0x19')]=_0x250063[_0xd1ad('0x19')];this[_0xd1ad('0x1a')]=_0x250063[_0xd1ad('0x1a')];this[_0xd1ad('0x1b')]=_0x250063[_0xd1ad('0x1b')];this[_0xd1ad('0x1c')]=_0x250063[_0xd1ad('0x1c')];this[_0xd1ad('0x1d')]=_0x250063[_0xd1ad('0x1d')];this[_0xd1ad('0x1e')]=_0x250063[_0xd1ad('0x1e')]||'';this['originatecalleridname']=_0x250063['originatecalleridname']||'';this[_0xd1ad('0x1f')]=_0x250063[_0xd1ad('0x1f')];this[_0xd1ad('0x20')]=_0x250063[_0xd1ad('0x20')];}module[_0xd1ad('0x21')]=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 ce3da9b..c021991 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 _0x2b23=['getSeconds','starttime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','uniqueid','calleridname','name','number','responsetime','droptime','dropreason','endtime'];(function(_0x22b0fc,_0x1f563e){var _0x4a2ced=function(_0x42b8af){while(--_0x42b8af){_0x22b0fc['push'](_0x22b0fc['shift']());}};_0x4a2ced(++_0x1f563e);}(_0x2b23,0x1e3));var _0x32b2=function(_0x246185,_0x2bbe8d){_0x246185=_0x246185-0x0;var _0x4e68c5=_0x2b23[_0x246185];return _0x4e68c5;};'use strict';var utils=require(_0x32b2('0x0'));function QueueCallerAbandon(_0x3846a6,_0x3b04db){this[_0x32b2('0x1')]=_0x3846a6[_0x32b2('0x1')];this[_0x32b2('0x2')]=_0x3846a6[_0x32b2('0x2')];this[_0x32b2('0x3')]=_0x3846a6[_0x32b2('0x2')]===_0x32b2('0x4')?'queue':_0x3846a6[_0x32b2('0x2')];this['countbusyretry']=_0x3846a6['countbusyretry'];this[_0x32b2('0x5')]=_0x3846a6['countcongestionretry'];this[_0x32b2('0x6')]=_0x3846a6['countnoanswerretry'];this[_0x32b2('0x7')]=_0x3846a6['countbusyretry']+_0x3846a6[_0x32b2('0x5')]+_0x3846a6[_0x32b2('0x6')]+_0x3846a6['countnosuchnumberretry']+_0x3846a6[_0x32b2('0x8')]+_0x3846a6['countabandonedretry']+_0x3846a6[_0x32b2('0x9')]+_0x3846a6[_0x32b2('0xa')];this['countnosuchnumberretry']=_0x3846a6[_0x32b2('0xb')];this[_0x32b2('0x8')]=_0x3846a6[_0x32b2('0x8')];this['countabandonedretry']=_0x3846a6[_0x32b2('0xc')];this[_0x32b2('0x9')]=_0x3846a6[_0x32b2('0x9')];this[_0x32b2('0xa')]=_0x3846a6['countagentrejectretry'];this['uniqueid']=_0x3b04db[_0x32b2('0xd')];this[_0x32b2('0xe')]=_0x3846a6[_0x32b2('0xf')];this['calleridnum']=_0x3846a6[_0x32b2('0x10')];this['starttime']=_0x3846a6['starttime'];this['responsetime']=_0x3846a6[_0x32b2('0x11')];this[_0x32b2('0x12')]=_0x3846a6[_0x32b2('0x12')];this[_0x32b2('0x13')]=_0x3846a6[_0x32b2('0x13')];this[_0x32b2('0x14')]=this[_0x32b2('0x12')];this['ringtime']=utils[_0x32b2('0x15')](_0x3846a6['responsetime'],_0x3846a6[_0x32b2('0x16')]);this['holdtime']=utils[_0x32b2('0x15')](this[_0x32b2('0x12')],_0x3846a6[_0x32b2('0x11')]);this[_0x32b2('0x17')]=0x0;this[_0x32b2('0x18')]=_0x3b04db[_0x32b2('0x18')];this[_0x32b2('0x19')]=_0x3b04db[_0x32b2('0x1a')];this[_0x32b2('0x1b')]=_0x3b04db['reason'];this['callback']=_0x3846a6[_0x32b2('0x1c')];this['callbackuniqueid']=_0x3846a6[_0x32b2('0x1d')];this[_0x32b2('0x1e')]=_0x3846a6[_0x32b2('0x1e')];this[_0x32b2('0x1f')]=_0x3846a6['recallme'];this[_0x32b2('0x20')]=_0x3846a6['ContactId'];this[_0x32b2('0x21')]=_0x3846a6[_0x32b2('0x21')];this[_0x32b2('0x22')]=_0x3846a6[_0x32b2('0x22')];this[_0x32b2('0x23')]=_0x3846a6[_0x32b2('0x23')];this['CampaignId']=_0x3846a6['CampaignId'];this[_0x32b2('0x24')]=_0x3846a6[_0x32b2('0x24')]||'';this['originatecalleridname']=_0x3846a6[_0x32b2('0x25')]||'';this[_0x32b2('0x26')]=_0x3846a6[_0x32b2('0x26')];this['state']=_0x3846a6[_0x32b2('0x27')];this[_0x32b2('0x28')]=_0x3846a6[_0x32b2('0x28')];}module[_0x32b2('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0xd2ab=['queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','ringtime','getSeconds','talktime'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xd2ab,0x15a));var _0xbd2a=function(_0x53bfdf,_0x481ffd){_0x53bfdf=_0x53bfdf-0x0;var _0x5ec08f=_0xd2ab[_0x53bfdf];return _0x5ec08f;};'use strict';var utils=require('../utils');function QueueCallerAbandon(_0x4a2088,_0x4643d1){this[_0xbd2a('0x0')]=_0x4a2088[_0xbd2a('0x0')];this[_0xbd2a('0x1')]=_0x4a2088['type'];this[_0xbd2a('0x2')]=_0x4a2088[_0xbd2a('0x1')]===_0xbd2a('0x3')?'queue':_0x4a2088[_0xbd2a('0x1')];this[_0xbd2a('0x4')]=_0x4a2088[_0xbd2a('0x4')];this['countcongestionretry']=_0x4a2088[_0xbd2a('0x5')];this[_0xbd2a('0x6')]=_0x4a2088[_0xbd2a('0x6')];this[_0xbd2a('0x7')]=_0x4a2088[_0xbd2a('0x4')]+_0x4a2088[_0xbd2a('0x5')]+_0x4a2088['countnoanswerretry']+_0x4a2088[_0xbd2a('0x8')]+_0x4a2088[_0xbd2a('0x9')]+_0x4a2088[_0xbd2a('0xa')]+_0x4a2088[_0xbd2a('0xb')]+_0x4a2088[_0xbd2a('0xc')];this['countnosuchnumberretry']=_0x4a2088[_0xbd2a('0x8')];this[_0xbd2a('0x9')]=_0x4a2088[_0xbd2a('0x9')];this[_0xbd2a('0xa')]=_0x4a2088[_0xbd2a('0xa')];this[_0xbd2a('0xb')]=_0x4a2088[_0xbd2a('0xb')];this[_0xbd2a('0xc')]=_0x4a2088[_0xbd2a('0xc')];this[_0xbd2a('0xd')]=_0x4643d1['uniqueid'];this['calleridname']=_0x4a2088[_0xbd2a('0xe')];this[_0xbd2a('0xf')]=_0x4a2088[_0xbd2a('0x10')];this[_0xbd2a('0x11')]=_0x4a2088[_0xbd2a('0x11')];this[_0xbd2a('0x12')]=_0x4a2088['responsetime'];this[_0xbd2a('0x13')]=_0x4a2088[_0xbd2a('0x13')];this['dropreason']=_0x4a2088['dropreason'];this['endtime']=this['droptime'];this[_0xbd2a('0x14')]=utils[_0xbd2a('0x15')](_0x4a2088[_0xbd2a('0x12')],_0x4a2088[_0xbd2a('0x11')]);this['holdtime']=utils['getSeconds'](this[_0xbd2a('0x13')],_0x4a2088[_0xbd2a('0x12')]);this[_0xbd2a('0x16')]=0x0;this['queue']=_0x4643d1[_0xbd2a('0x17')];this[_0xbd2a('0x18')]=_0x4643d1[_0xbd2a('0x19')];this[_0xbd2a('0x1a')]=_0x4643d1[_0xbd2a('0x1a')];this[_0xbd2a('0x1b')]=_0x4a2088['callback'];this[_0xbd2a('0x1c')]=_0x4a2088[_0xbd2a('0x1c')];this[_0xbd2a('0x1d')]=_0x4a2088[_0xbd2a('0x1d')];this[_0xbd2a('0x1e')]=_0x4a2088['recallme'];this['ContactId']=_0x4a2088['ContactId'];this[_0xbd2a('0x1f')]=_0x4a2088[_0xbd2a('0x1f')];this[_0xbd2a('0x20')]=_0x4a2088['UserId'];this[_0xbd2a('0x21')]=_0x4a2088[_0xbd2a('0x21')];this[_0xbd2a('0x22')]=_0x4a2088['CampaignId'];this[_0xbd2a('0x23')]=_0x4a2088['originatecalleridnum']||'';this[_0xbd2a('0x24')]=_0x4a2088['originatecalleridname']||'';this[_0xbd2a('0x25')]=_0x4a2088[_0xbd2a('0x25')];this[_0xbd2a('0x26')]=_0x4a2088[_0xbd2a('0x26')];this[_0xbd2a('0x27')]=_0x4a2088['statedesc'];}module[_0xbd2a('0x28')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 7507bb6..7bc8301 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 _0xdf55=['createHistory','util','../../../../config/logger','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','countReScheduled','[countReScheduled]','rescheduleContact','unlockContact','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','[avgHandleTime]'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xdf55,0x83));var _0x5df5=function(_0x31826c,_0x1995c5){_0x31826c=_0x31826c-0x0;var _0x20bbd7=_0xdf55[_0x31826c];return _0x20bbd7;};'use strict';var util=require(_0x5df5('0x0'));var logger=require(_0x5df5('0x1'))('dialer');var cmHopper=require(_0x5df5('0x2'));var cmHopperAdditionalPhone=require(_0x5df5('0x3'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0x5df5('0x4'));function inspectError(_0x773e15){return util[_0x5df5('0x5')](_0x773e15,{'showHidden':![],'depth':null});}function getContactDialer(_0x521007,_0x289af4,_0x417341){return cmHopper[_0x5df5('0x6')](_0x521007['id'],_0x289af4,_0x417341,_0x521007[_0x5df5('0x7')])[_0x5df5('0x8')](function(_0x2b7ed9){_0x521007[_0x5df5('0x9')]=0x0;logger[_0x5df5('0xa')]('[getContactDialer]',inspectError(_0x2b7ed9));});}exports[_0x5df5('0x6')]=getContactDialer;function getContactDialerIvr(_0x403d8b,_0x41941e){return cmHopper['getContactDialerIvr'](_0x403d8b['id'],_0x41941e,_0x403d8b['dialOrderByScheduledAt'])[_0x5df5('0x8')](function(_0x4e80bd){_0x403d8b[_0x5df5('0x9')]=0x0;logger[_0x5df5('0xa')]('[getContactDialerIvr]',inspectError(_0x4e80bd));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x40322d){return cmHopper[_0x5df5('0xb')](_0x40322d)[_0x5df5('0x8')](function(_0x4c3d6f){logger[_0x5df5('0xa')](_0x5df5('0xc'),inspectError(_0x4c3d6f));});}exports[_0x5df5('0xb')]=countReScheduled;function rescheduleContact(_0x463990){return cmHopper[_0x5df5('0xd')](_0x463990)[_0x5df5('0x8')](function(_0x555d3f){logger[_0x5df5('0xa')]('[rescheduleContact]',inspectError(_0x555d3f));});}exports[_0x5df5('0xd')]=rescheduleContact;function unlockContact(_0x33f818,_0x5b0ad9,_0x3657c8){return cmHopper[_0x5df5('0xe')](_0x33f818,_0x5b0ad9,_0x3657c8)['catch'](function(_0x27b3fb){logger[_0x5df5('0xa')]('[unlockContact]',inspectError(_0x27b3fb));});}exports[_0x5df5('0xe')]=unlockContact;function moveContactManagedDialer(_0x45813f){return cmHopper[_0x5df5('0xf')](_0x45813f)[_0x5df5('0x8')](function(_0x215d59){logger['error']('[moveContactManagedDialer]',inspectError(_0x215d59));});}exports[_0x5df5('0xf')]=moveContactManagedDialer;function checkIsBlackList(_0x5d8dfd){return cmHopperBlack[_0x5df5('0x10')](_0x5d8dfd)[_0x5df5('0x8')](function(_0xa939e4){logger[_0x5df5('0xa')](_0x5df5('0x11'),inspectError(_0xa939e4));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0x1d6474){return cmHopperBlack[_0x5df5('0x12')](_0x1d6474)[_0x5df5('0x8')](function(_0x34af1d){logger[_0x5df5('0xa')](_0x5df5('0x13'),inspectError(_0x34af1d));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x2e99a1,_0x2e862d,_0x8742a7){return cmHopperAdditionalPhone[_0x5df5('0x14')](_0x2e99a1,_0x2e862d,_0x8742a7)['catch'](function(_0x4358ba){logger[_0x5df5('0xa')](_0x5df5('0x15'),inspectError(_0x4358ba));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x52206d,_0x532923,_0x357fb0){return cmHopperAdditionalPhone[_0x5df5('0x16')](_0x52206d,_0x532923,_0x357fb0)[_0x5df5('0x8')](function(_0xa7f4b3){logger[_0x5df5('0xa')](_0x5df5('0x17'),inspectError(_0xa7f4b3));});}exports[_0x5df5('0x16')]=swapAdditionalPhones;function avgHandleTime(_0x28723e){return cmHopperHistory['avgHandleTime'](_0x28723e)[_0x5df5('0x8')](function(_0x4fc1a1){logger[_0x5df5('0xa')](_0x5df5('0x18'),inspectError(_0x4fc1a1));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x3854d0){return cmHopperHistory['createHistory'](_0x3854d0)[_0x5df5('0x8')](function(_0x4cccf1){logger[_0x5df5('0xa')]('[createHistory]',inspectError(_0x4cccf1));});}exports[_0x5df5('0x19')]=createHistory; \ No newline at end of file +var _0xfdbd=['[createHistory]','createHistory','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','error','[getContactDialer]','getContactDialerIvr','catch','temp','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','unlockContact','[unlockContact]','[moveContactManagedDialer]','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','[avgHandleTime]','avgHandleTime'];(function(_0x23989a,_0xe9eab9){var _0x168b80=function(_0x1dfb4e){while(--_0x1dfb4e){_0x23989a['push'](_0x23989a['shift']());}};_0x168b80(++_0xe9eab9);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x4d7116,_0xdb8175){_0x4d7116=_0x4d7116-0x0;var _0x4593dc=_0xfdbd[_0x4d7116];return _0x4593dc;};'use strict';var util=require(_0xdfdb('0x0'));var logger=require(_0xdfdb('0x1'))(_0xdfdb('0x2'));var cmHopper=require(_0xdfdb('0x3'));var cmHopperAdditionalPhone=require(_0xdfdb('0x4'));var cmHopperBlack=require(_0xdfdb('0x5'));var cmHopperHistory=require(_0xdfdb('0x6'));function inspectError(_0x66533b){return util[_0xdfdb('0x7')](_0x66533b,{'showHidden':![],'depth':null});}function getContactDialer(_0x5945e0,_0x3f5b2d,_0x4a4a3f){return cmHopper[_0xdfdb('0x8')](_0x5945e0['id'],_0x3f5b2d,_0x4a4a3f,_0x5945e0[_0xdfdb('0x9')])['catch'](function(_0x556dc0){_0x5945e0['temp']=0x0;logger[_0xdfdb('0xa')](_0xdfdb('0xb'),inspectError(_0x556dc0));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x11d845,_0x444c19){return cmHopper[_0xdfdb('0xc')](_0x11d845['id'],_0x444c19,_0x11d845[_0xdfdb('0x9')])[_0xdfdb('0xd')](function(_0x1ace28){_0x11d845[_0xdfdb('0xe')]=0x0;logger['error'](_0xdfdb('0xf'),inspectError(_0x1ace28));});}exports[_0xdfdb('0xc')]=getContactDialerIvr;function countReScheduled(_0x527c05){return cmHopper[_0xdfdb('0x10')](_0x527c05)[_0xdfdb('0xd')](function(_0x2bee3b){logger[_0xdfdb('0xa')](_0xdfdb('0x11'),inspectError(_0x2bee3b));});}exports[_0xdfdb('0x10')]=countReScheduled;function rescheduleContact(_0xf5d903){return cmHopper[_0xdfdb('0x12')](_0xf5d903)['catch'](function(_0x48a66a){logger[_0xdfdb('0xa')]('[rescheduleContact]',inspectError(_0x48a66a));});}exports[_0xdfdb('0x12')]=rescheduleContact;function unlockContact(_0x9f3039,_0x11a56a,_0x40bc8a){return cmHopper[_0xdfdb('0x13')](_0x9f3039,_0x11a56a,_0x40bc8a)[_0xdfdb('0xd')](function(_0x54ff23){logger['error'](_0xdfdb('0x14'),inspectError(_0x54ff23));});}exports[_0xdfdb('0x13')]=unlockContact;function moveContactManagedDialer(_0x2c1070){return cmHopper['moveContactManagedDialer'](_0x2c1070)[_0xdfdb('0xd')](function(_0xb677b1){logger[_0xdfdb('0xa')](_0xdfdb('0x15'),inspectError(_0xb677b1));});}exports[_0xdfdb('0x16')]=moveContactManagedDialer;function checkIsBlackList(_0x2294de){return cmHopperBlack[_0xdfdb('0x17')](_0x2294de)[_0xdfdb('0xd')](function(_0x5b8cb5){logger[_0xdfdb('0xa')](_0xdfdb('0x18'),inspectError(_0x5b8cb5));});}exports[_0xdfdb('0x17')]=checkIsBlackList;function checkIsBlackListIvr(_0x5cc70b){return cmHopperBlack[_0xdfdb('0x19')](_0x5cc70b)[_0xdfdb('0xd')](function(_0x2c7dd1){logger['error'](_0xdfdb('0x1a'),inspectError(_0x2c7dd1));});}exports[_0xdfdb('0x19')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x334cdd,_0x489fd4,_0x2a80c1){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x334cdd,_0x489fd4,_0x2a80c1)[_0xdfdb('0xd')](function(_0x145350){logger[_0xdfdb('0xa')](_0xdfdb('0x1b'),inspectError(_0x145350));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x4c253e,_0x4363d8,_0x956843){return cmHopperAdditionalPhone[_0xdfdb('0x1c')](_0x4c253e,_0x4363d8,_0x956843)[_0xdfdb('0xd')](function(_0x305954){logger['error'](_0xdfdb('0x1d'),inspectError(_0x305954));});}exports[_0xdfdb('0x1c')]=swapAdditionalPhones;function avgHandleTime(_0xdf3a5c){return cmHopperHistory['avgHandleTime'](_0xdf3a5c)[_0xdfdb('0xd')](function(_0x5df454){logger[_0xdfdb('0xa')](_0xdfdb('0x1e'),inspectError(_0x5df454));});}exports[_0xdfdb('0x1f')]=avgHandleTime;function createHistory(_0x513fa0){return cmHopperHistory['createHistory'](_0x513fa0)[_0xdfdb('0xd')](function(_0xc56435){logger[_0xdfdb('0xa')](_0xdfdb('0x20'),inspectError(_0xc56435));});}exports[_0xdfdb('0x21')]=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 44be9a6..0c7554b 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 _0x681d=['INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','isOutboundQueue','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','dialActive','message','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','dialGlobalInterval','isNil','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','status','TrunkBackup','includes','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','match','extractCalleridName','isUndefined','string','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','checkContactEmpty','erlangb','createdAt','description','tags','updatedAt','%s%s','XMD-','toUpperCase','lodash','../../../../config/logger','dialer','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','INTERVAL_IS_NULL'];(function(_0x489224,_0x1fb343){var _0xf055b7=function(_0x48ab9e){while(--_0x48ab9e){_0x489224['push'](_0x489224['shift']());}};_0xf055b7(++_0x1fb343);}(_0x681d,0xa8));var _0xd681=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0x681d[_0x163040];return _0x364667;};'use strict';var _=require(_0xd681('0x0'));var moment=require('moment');var util=require('util');var logger=require(_0xd681('0x1'))(_0xd681('0x2'));var timezones=require('../../../../config/environment/shared')[_0xd681('0x3')];var CAMPAIGN_STATUS={'ACTIVE':_0xd681('0x4'),'BLACKLIST':_0xd681('0x5'),'CONTACTS_RESCHEDULED':_0xd681('0x6'),'DEACTIVATED':_0xd681('0x7'),'DISACTIVED':_0xd681('0x8'),'EMPTY_INTERVAL':_0xd681('0x9'),'INACTIVE':_0xd681('0xa'),'NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':'AVAILABLE_CONTACTS_FINISHED','NULL_INTERVAL':_0xd681('0xb'),'OVERTIME_INTERVAL':_0xd681('0xc'),'OVERTIME_GLOBAL_INTERVAL':_0xd681('0xd'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0xd681('0xe'),'RUNNING':'RUNNING','UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':_0xd681('0xf')};exports[_0xd681('0x10')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x1e6ed0){return _0x1e6ed0[_0xd681('0x11')]===_0xd681('0x12');}exports[_0xd681('0x13')]=isPreviewCampaign;function isIVRCampaign(_0x46b8f8){return _0x46b8f8[_0xd681('0x14')]===_0xd681('0x15');}exports[_0xd681('0x16')]=isIVRCampaign;function isOutboundQueue(_0x40df9b){return _0x40df9b['type']===_0xd681('0x17');}exports[_0xd681('0x18')]=isOutboundQueue;function isQueueCampaignActive(_0x27cd3d){return _0x27cd3d['dialActive'];}exports[_0xd681('0x19')]=isQueueCampaignActive;function isIVRCampaignActive(_0x19cae0){return _0x19cae0[_0xd681('0x1a')];}exports[_0xd681('0x1b')]=isIVRCampaignActive;function getSeconds(_0x25efe3,_0x100cf9){var _0x887982=moment(_0x25efe3)['milliseconds'](0x0);var _0x3f46ef=moment(_0x100cf9)[_0xd681('0x1c')](0x0);return _0x887982[_0xd681('0x1d')](_0x3f46ef,_0xd681('0x1e'));}exports[_0xd681('0x1f')]=getSeconds;function hasQueueCampaignDataChanged(_0x335d71,_0x3ad26e){var _0x2b9744=![];var _0x4db44c=_0x335d71['dialMethod']!==_0x3ad26e['dialMethod']||_0x335d71['dialActive']!==_0x3ad26e[_0xd681('0x20')]||_0x335d71['message']!==_0x3ad26e[_0xd681('0x21')];var _0xaf22fb=_0x335d71['available']!==_0x3ad26e['available']||_0x335d71[_0xd681('0x22')]!==_0x3ad26e[_0xd681('0x22')]||_0x335d71['loggedInDb']!==_0x3ad26e[_0xd681('0x23')]||_0x335d71[_0xd681('0x24')]!==_0x3ad26e[_0xd681('0x24')]||_0x335d71[_0xd681('0x25')]!==_0x3ad26e['talking']||_0x335d71['pTalking']!==_0x3ad26e[_0xd681('0x26')]||_0x335d71[_0xd681('0x27')]!==_0x3ad26e['waiting']||_0x335d71[_0xd681('0x28')]!==_0x3ad26e[_0xd681('0x28')]||_0x335d71[_0xd681('0x29')]!==_0x3ad26e[_0xd681('0x29')];if(_0x335d71['Trunk']&&_0x3ad26e['Trunk']){_0x2b9744=_0x335d71[_0xd681('0x2a')][_0xd681('0x2b')]!==_0x3ad26e[_0xd681('0x2a')][_0xd681('0x2b')]||_0x335d71[_0xd681('0x2a')]['active']!==_0x3ad26e[_0xd681('0x2a')][_0xd681('0x1a')];}return _0x4db44c||_0xaf22fb||_0x2b9744;}exports[_0xd681('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x3a6841){var _0x31f1eb=null;var _0x2086ac=_0x3a6841[_0xd681('0x2d')];if(_['isNil'](_0x3a6841[_0xd681('0x2e')])||_[_0xd681('0x2f')](_0x3a6841[_0xd681('0x30')])||_[_0xd681('0x2f')](_0x3a6841[_0xd681('0x30')][_0xd681('0x31')])){_0x31f1eb=CAMPAIGN_STATUS[_0xd681('0x32')];}else if(_['isEmpty'](_0x3a6841[_0xd681('0x2e')])||_[_0xd681('0x33')](_0x3a6841[_0xd681('0x30')]['Intervals'])){_0x31f1eb=CAMPAIGN_STATUS[_0xd681('0x34')];}else if(_0x2086ac&&!timezones[_0x2086ac]){_0x31f1eb=CAMPAIGN_STATUS[_0xd681('0x35')];}return _0x31f1eb;}function checkAnyValidTrunk(_0x555888,_0x34e1f4){var _0x20c55b=null;var _0x31a9a4=_0xd681('0x36');var _0x32fecf=[_0xd681('0x37'),_0xd681('0x38')];var _0x5e0805=!![];if(_0x555888[_0xd681('0x2a')]&&_0x555888[_0xd681('0x2a')][_0xd681('0x1a')]){_0x31a9a4+=_0x555888[_0xd681('0x2a')]['name'];_0x20c55b=_0x34e1f4[_0x31a9a4];_0x5e0805=_0x32fecf['includes'](_0x20c55b[_0xd681('0x39')]);}else if(_0x555888[_0xd681('0x3a')]&&_0x555888[_0xd681('0x3a')][_0xd681('0x1a')]){_0x31a9a4+=_0x555888[_0xd681('0x3a')][_0xd681('0x2b')];_0x20c55b=_0x34e1f4[_0x31a9a4];_0x5e0805=_0x32fecf[_0xd681('0x3b')](_0x20c55b[_0xd681('0x39')]);}return _0x5e0805;}function getQueueCampaignStatusMessage(_0x479961,_0x52bd9a){var _0x429df0=CAMPAIGN_STATUS[_0xd681('0x4')];var _0xc1ac1e=isPreviewCampaign(_0x479961);if(!isQueueCampaignActive(_0x479961)){if(_0xc1ac1e){_0x429df0=CAMPAIGN_STATUS[_0xd681('0x3c')];}else{if(_0x479961[_0xd681('0x29')]===0x0&&_0x479961[_0xd681('0x25')]===0x0&&_0x479961[_0xd681('0x27')]===0x0&&(_0x479961['pTalking']||0x0)===0x0){_0x429df0=CAMPAIGN_STATUS[_0xd681('0x3c')];}else{_0x429df0=CAMPAIGN_STATUS[_0xd681('0x3d')];}}}else if(_0x479961[_0xd681('0x22')]===0x0){_0x429df0=CAMPAIGN_STATUS[_0xd681('0x3e')];}else if(!checkAnyValidTrunk(_0x479961,_0x52bd9a)){_0x429df0=CAMPAIGN_STATUS[_0xd681('0x3f')];}else if(!isPreviewCampaign(_0x479961)){var _0x255dab=checkAnyValidQueueCampaignInterval(_0x479961);if(_0x255dab){_0x429df0=_0x255dab;}}return _0x429df0;}exports[_0xd681('0x40')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x1f8127){var _0x355280=CAMPAIGN_STATUS['DISACTIVED'];if(_0x1f8127[_0xd681('0x29')]===0x0&&_0x1f8127['talking']===0x0&&_0x1f8127['waiting']===0x0&&(_0x1f8127[_0xd681('0x26')]||0x0)===0x0){_0x355280=CAMPAIGN_STATUS[_0xd681('0x3c')];}return _0x355280;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x45ad79){var _0x5c4169=_0x45ad79[_0xd681('0x41')](/"(.*?)"/);return _0x5c4169?_0x5c4169[0x1]:_0x45ad79;}exports[_0xd681('0x42')]=extractCalleridName;function getCallerId(_0x29a12e,_0x327ac0,_0x487b0e){if(!_[_0xd681('0x43')](_0x487b0e)&&typeof _0x487b0e===_0xd681('0x44')&&!_[_0xd681('0x33')](_0x487b0e)){if(!_['isUndefined'](_0x327ac0)&&typeof _0x327ac0===_0xd681('0x44')&&!_[_0xd681('0x33')](_0x327ac0)){return util['format'](_0xd681('0x45'),_0x327ac0,_0x487b0e);}return util[_0xd681('0x46')](_0xd681('0x45'),_0x487b0e,_0x487b0e);}if(!_['isUndefined'](_0x29a12e)&&typeof _0x29a12e===_0xd681('0x44')&&!_['isEmpty'](_0x29a12e)){return _0x29a12e;}return _0xd681('0x47');}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x47ffca,_0x266e78){var _0x404062;var _0x1f908b;var _0x351715;if(_0x266e78<=0x0){_0x266e78=0x1;}_0x404062=new RegExp(_0xd681('0x48')+_0x266e78+'}$');_0x1f908b=Math['pow'](0xa,_0x266e78-0x1);_0x351715=Math[_0xd681('0x49')](0xa,_0x266e78)-0x1;return util[_0xd681('0x46')]('%s',_[_0xd681('0x4a')](_0x47ffca,_0x404062,_[_0xd681('0x4b')](_0x1f908b,_0x351715)[_0xd681('0x4c')]()));}exports[_0xd681('0x4d')]=getCallerIdRandom;function decrementOriginate(_0x2faf31){if(_0x2faf31['originated']&&_0x2faf31[_0xd681('0x29')]>0x0){_0x2faf31[_0xd681('0x29')]-=0x1;}else{logger[_0xd681('0x4e')](_0xd681('0x4f'));}}exports[_0xd681('0x50')]=decrementOriginate;function checkContactEmpty(_0x59ca58){return _0x59ca58&&_0x59ca58['length']>0x0;}exports[_0xd681('0x51')]=checkContactEmpty;function erlangb(_0x5f59c5,_0xe053c7){if(_0xe053c7===0x0){return 0x0;}var _0x496d12=0x1;for(var _0x436f56=0x1;_0x436f56<=_0xe053c7;_0x436f56+=0x1){_0x496d12=0x1+_0x496d12*_0x436f56/_0x5f59c5;}return 0x1/_0x496d12;}exports[_0xd681('0x52')]=erlangb;function checkContactLowerLimitOriginate(_0x21a27f,_0x31a9dd,_0xf7615b){if(_0x31a9dd>_0xf7615b){for(var _0x2726f5=0x0;_0x2726f5<_0x31a9dd-_0xf7615b;_0x2726f5+=0x1){decrementOriginate(_0x21a27f);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x1076b2){var _0x3adb8b={};var _0x1cea4e=['id',_0xd681('0x53'),_0xd681('0x54'),_0xd681('0x55'),_0xd681('0x56')];if(_0x1076b2){for(var _0x438cac in _0x1076b2){if(typeof _0x1076b2[_0x438cac]!=='undefined'){if(!_[_0xd681('0x2f')](_0x1076b2[_0x438cac])&&!_0x1cea4e[_0xd681('0x3b')](_0x438cac)){_0x3adb8b[util['format'](_0xd681('0x57'),_0xd681('0x58'),_0x438cac[_0xd681('0x59')]())]=_0x1076b2[_0x438cac];}}}}return _0x3adb8b;}exports['setXMDContactVariables']=setXMDContactVariables; \ No newline at end of file +var _0xecda=['error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','description','tags','updatedAt','undefined','%s%s','toUpperCase','setXMDContactVariables','lodash','moment','util','dialer','../../../../config/environment/shared','timezones','BLACKLIST','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','CAMPAIGN_STATUS','dialMethod','preview','type','ivr','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','isIVRCampaignActive','milliseconds','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','status','TrunkBackup','includes','ACTIVE','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom'];(function(_0x7544a,_0x3032f8){var _0x3eb052=function(_0x7b21e1){while(--_0x7b21e1){_0x7544a['push'](_0x7544a['shift']());}};_0x3eb052(++_0x3032f8);}(_0xecda,0x6c));var _0xaecd=function(_0x4005e8,_0x52a3b5){_0x4005e8=_0x4005e8-0x0;var _0x2d2903=_0xecda[_0x4005e8];return _0x2d2903;};'use strict';var _=require(_0xaecd('0x0'));var moment=require(_0xaecd('0x1'));var util=require(_0xaecd('0x2'));var logger=require('../../../../config/logger')(_0xaecd('0x3'));var timezones=require(_0xaecd('0x4'))[_0xaecd('0x5')];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0xaecd('0x6'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':_0xaecd('0x7'),'DISACTIVED':_0xaecd('0x8'),'EMPTY_INTERVAL':_0xaecd('0x9'),'INACTIVE':_0xaecd('0xa'),'NO_AGENTS_LOGGED':_0xaecd('0xb'),'NO_AVAILABLE_CONTACTS':_0xaecd('0xc'),'NULL_INTERVAL':_0xaecd('0xd'),'OVERTIME_INTERVAL':_0xaecd('0xe'),'OVERTIME_GLOBAL_INTERVAL':_0xaecd('0xf'),'QUEUE_RECALL':_0xaecd('0x10'),'RECALL_TIMEOUT':_0xaecd('0x11'),'RUNNING':_0xaecd('0x12'),'UNKNOWN_TIMEZONE':_0xaecd('0x13'),'UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports[_0xaecd('0x14')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x42646a){return _0x42646a[_0xaecd('0x15')]===_0xaecd('0x16');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x4549d8){return _0x4549d8[_0xaecd('0x17')]===_0xaecd('0x18');}exports[_0xaecd('0x19')]=isIVRCampaign;function isOutboundQueue(_0x593ec7){return _0x593ec7[_0xaecd('0x17')]===_0xaecd('0x1a');}exports[_0xaecd('0x1b')]=isOutboundQueue;function isQueueCampaignActive(_0x5ee342){return _0x5ee342[_0xaecd('0x1c')];}exports[_0xaecd('0x1d')]=isQueueCampaignActive;function isIVRCampaignActive(_0x59efa1){return _0x59efa1['active'];}exports[_0xaecd('0x1e')]=isIVRCampaignActive;function getSeconds(_0x217549,_0xa40baa){var _0x30e92b=moment(_0x217549)['milliseconds'](0x0);var _0xfd8b99=moment(_0xa40baa)[_0xaecd('0x1f')](0x0);return _0x30e92b['diff'](_0xfd8b99,_0xaecd('0x20'));}exports[_0xaecd('0x21')]=getSeconds;function hasQueueCampaignDataChanged(_0xfb37ed,_0xc3e8a){var _0x1c0c86=![];var _0x32dff4=_0xfb37ed['dialMethod']!==_0xc3e8a[_0xaecd('0x15')]||_0xfb37ed[_0xaecd('0x1c')]!==_0xc3e8a[_0xaecd('0x1c')]||_0xfb37ed[_0xaecd('0x22')]!==_0xc3e8a[_0xaecd('0x22')];var _0x3ba5f7=_0xfb37ed[_0xaecd('0x23')]!==_0xc3e8a[_0xaecd('0x23')]||_0xfb37ed[_0xaecd('0x24')]!==_0xc3e8a[_0xaecd('0x24')]||_0xfb37ed[_0xaecd('0x25')]!==_0xc3e8a[_0xaecd('0x25')]||_0xfb37ed['paused']!==_0xc3e8a[_0xaecd('0x26')]||_0xfb37ed[_0xaecd('0x27')]!==_0xc3e8a[_0xaecd('0x27')]||_0xfb37ed[_0xaecd('0x28')]!==_0xc3e8a[_0xaecd('0x28')]||_0xfb37ed[_0xaecd('0x29')]!==_0xc3e8a['waiting']||_0xfb37ed[_0xaecd('0x2a')]!==_0xc3e8a['inUse']||_0xfb37ed[_0xaecd('0x2b')]!==_0xc3e8a[_0xaecd('0x2b')];if(_0xfb37ed[_0xaecd('0x2c')]&&_0xc3e8a[_0xaecd('0x2c')]){_0x1c0c86=_0xfb37ed['Trunk'][_0xaecd('0x2d')]!==_0xc3e8a['Trunk'][_0xaecd('0x2d')]||_0xfb37ed['Trunk'][_0xaecd('0x2e')]!==_0xc3e8a[_0xaecd('0x2c')]['active'];}return _0x32dff4||_0x3ba5f7||_0x1c0c86;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x387a0a){var _0x55c03a=null;var _0x5b055c=_0x387a0a[_0xaecd('0x2f')];if(_[_0xaecd('0x30')](_0x387a0a[_0xaecd('0x31')])||_['isNil'](_0x387a0a[_0xaecd('0x32')])||_[_0xaecd('0x30')](_0x387a0a[_0xaecd('0x32')][_0xaecd('0x33')])){_0x55c03a=CAMPAIGN_STATUS[_0xaecd('0x34')];}else if(_[_0xaecd('0x35')](_0x387a0a[_0xaecd('0x31')])||_[_0xaecd('0x35')](_0x387a0a[_0xaecd('0x32')][_0xaecd('0x33')])){_0x55c03a=CAMPAIGN_STATUS[_0xaecd('0x36')];}else if(_0x5b055c&&!timezones[_0x5b055c]){_0x55c03a=CAMPAIGN_STATUS[_0xaecd('0x37')];}return _0x55c03a;}function checkAnyValidTrunk(_0xc364c8,_0x3077f8){var _0x2d43d0=null;var _0x39676e=_0xaecd('0x38');var _0x1517b5=[_0xaecd('0x39'),_0xaecd('0x3a')];var _0x94e64f=!![];if(_0xc364c8['Trunk']&&_0xc364c8[_0xaecd('0x2c')][_0xaecd('0x2e')]){_0x39676e+=_0xc364c8[_0xaecd('0x2c')][_0xaecd('0x2d')];_0x2d43d0=_0x3077f8[_0x39676e];_0x94e64f=_0x1517b5['includes'](_0x2d43d0[_0xaecd('0x3b')]);}else if(_0xc364c8['TrunkBackup']&&_0xc364c8[_0xaecd('0x3c')][_0xaecd('0x2e')]){_0x39676e+=_0xc364c8[_0xaecd('0x3c')][_0xaecd('0x2d')];_0x2d43d0=_0x3077f8[_0x39676e];_0x94e64f=_0x1517b5[_0xaecd('0x3d')](_0x2d43d0[_0xaecd('0x3b')]);}return _0x94e64f;}function getQueueCampaignStatusMessage(_0x55849d,_0x29469e){var _0x4baf66=CAMPAIGN_STATUS[_0xaecd('0x3e')];var _0x297d7b=isPreviewCampaign(_0x55849d);if(!isQueueCampaignActive(_0x55849d)){if(_0x297d7b){_0x4baf66=CAMPAIGN_STATUS[_0xaecd('0x3f')];}else{if(_0x55849d[_0xaecd('0x2b')]===0x0&&_0x55849d[_0xaecd('0x27')]===0x0&&_0x55849d[_0xaecd('0x29')]===0x0&&(_0x55849d[_0xaecd('0x28')]||0x0)===0x0){_0x4baf66=CAMPAIGN_STATUS['INACTIVE'];}else{_0x4baf66=CAMPAIGN_STATUS[_0xaecd('0x40')];}}}else if(_0x55849d[_0xaecd('0x24')]===0x0){_0x4baf66=CAMPAIGN_STATUS[_0xaecd('0x41')];}else if(!checkAnyValidTrunk(_0x55849d,_0x29469e)){_0x4baf66=CAMPAIGN_STATUS[_0xaecd('0x42')];}else if(!isPreviewCampaign(_0x55849d)){var _0x2fb11d=checkAnyValidQueueCampaignInterval(_0x55849d);if(_0x2fb11d){_0x4baf66=_0x2fb11d;}}return _0x4baf66;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x3bf626){var _0x12dd41=CAMPAIGN_STATUS[_0xaecd('0x40')];if(_0x3bf626['originated']===0x0&&_0x3bf626['talking']===0x0&&_0x3bf626[_0xaecd('0x29')]===0x0&&(_0x3bf626[_0xaecd('0x28')]||0x0)===0x0){_0x12dd41=CAMPAIGN_STATUS[_0xaecd('0x3f')];}return _0x12dd41;}exports[_0xaecd('0x43')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x185cac){var _0x23ebcb=_0x185cac[_0xaecd('0x44')](/"(.*?)"/);return _0x23ebcb?_0x23ebcb[0x1]:_0x185cac;}exports[_0xaecd('0x45')]=extractCalleridName;function getCallerId(_0xe3d79b,_0x647e2f,_0x40df54){if(!_[_0xaecd('0x46')](_0x40df54)&&typeof _0x40df54===_0xaecd('0x47')&&!_[_0xaecd('0x35')](_0x40df54)){if(!_[_0xaecd('0x46')](_0x647e2f)&&typeof _0x647e2f==='string'&&!_[_0xaecd('0x35')](_0x647e2f)){return util[_0xaecd('0x48')](_0xaecd('0x49'),_0x647e2f,_0x40df54);}return util[_0xaecd('0x48')](_0xaecd('0x49'),_0x40df54,_0x40df54);}if(!_[_0xaecd('0x46')](_0xe3d79b)&&typeof _0xe3d79b===_0xaecd('0x47')&&!_['isEmpty'](_0xe3d79b)){return _0xe3d79b;}return _0xaecd('0x4a');}exports[_0xaecd('0x4b')]=getCallerId;function getCallerIdRandom(_0x29b276,_0x2ff60b){var _0x117854;var _0x1174bb;var _0x5783d4;if(_0x2ff60b<=0x0){_0x2ff60b=0x1;}_0x117854=new RegExp(_0xaecd('0x4c')+_0x2ff60b+'}$');_0x1174bb=Math['pow'](0xa,_0x2ff60b-0x1);_0x5783d4=Math[_0xaecd('0x4d')](0xa,_0x2ff60b)-0x1;return util['format']('%s',_[_0xaecd('0x4e')](_0x29b276,_0x117854,_[_0xaecd('0x4f')](_0x1174bb,_0x5783d4)[_0xaecd('0x50')]()));}exports[_0xaecd('0x51')]=getCallerIdRandom;function decrementOriginate(_0x93ef1e){if(_0x93ef1e['originated']&&_0x93ef1e[_0xaecd('0x2b')]>0x0){_0x93ef1e['originated']-=0x1;}else{logger[_0xaecd('0x52')](_0xaecd('0x53'));}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x5ef334){return _0x5ef334&&_0x5ef334['length']>0x0;}exports[_0xaecd('0x54')]=checkContactEmpty;function erlangb(_0x241d85,_0x49040e){if(_0x49040e===0x0){return 0x0;}var _0x46c6f7=0x1;for(var _0x5d63de=0x1;_0x5d63de<=_0x49040e;_0x5d63de+=0x1){_0x46c6f7=0x1+_0x46c6f7*_0x5d63de/_0x241d85;}return 0x1/_0x46c6f7;}exports[_0xaecd('0x55')]=erlangb;function checkContactLowerLimitOriginate(_0x35da73,_0x1aff37,_0x42b918){if(_0x1aff37>_0x42b918){for(var _0x30fe0e=0x0;_0x30fe0e<_0x1aff37-_0x42b918;_0x30fe0e+=0x1){decrementOriginate(_0x35da73);}}}exports[_0xaecd('0x56')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x1e2e0b){var _0x17b88d={};var _0x4d9c8a=['id',_0xaecd('0x57'),_0xaecd('0x58'),_0xaecd('0x59'),_0xaecd('0x5a')];if(_0x1e2e0b){for(var _0x13d093 in _0x1e2e0b){if(typeof _0x1e2e0b[_0x13d093]!==_0xaecd('0x5b')){if(!_['isNil'](_0x1e2e0b[_0x13d093])&&!_0x4d9c8a[_0xaecd('0x3d')](_0x13d093)){_0x17b88d[util[_0xaecd('0x48')](_0xaecd('0x5c'),'XMD-',_0x13d093[_0xaecd('0x5d')]())]=_0x1e2e0b[_0x13d093];}}}}return _0x17b88d;}exports[_0xaecd('0x5e')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index f473788..4df2fa9 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(_0x45f1f0,_0x56cba2){var _0x1b0983=function(_0x4868cd){while(--_0x4868cd){_0x45f1f0['push'](_0x45f1f0['shift']());}};_0x1b0983(++_0x56cba2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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(_0x5191e5,_0x354417){var _0x5c57d4=function(_0x475bd9){while(--_0x475bd9){_0x5191e5['push'](_0x5191e5['shift']());}};_0x5c57d4(++_0x354417);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 81f4bee..c0e6c6f 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 _0x5ea8=['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','variablesAction','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','lodash','uuid','moment','path','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','value','channelstatedesc','variable','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','send','execOriginate','FaxAccountId','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk'];(function(_0x342a10,_0x4e1be0){var _0x4b0975=function(_0x2dfae0){while(--_0x2dfae0){_0x342a10['push'](_0x342a10['shift']());}};_0x4b0975(++_0x4e1be0);}(_0x5ea8,0x8f));var _0x85ea=function(_0x24617d,_0x160983){_0x24617d=_0x24617d-0x0;var _0x9d336=_0x5ea8[_0x24617d];return _0x9d336;};'use strict';var util=require('util');var _=require(_0x85ea('0x0'));var BPromise=require('bluebird');var uuid=require(_0x85ea('0x1'));var moment=require(_0x85ea('0x2'));var path=require(_0x85ea('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x85ea('0x4'));var logger=require(_0x85ea('0x5'))(_0x85ea('0x6'));var ami=require(_0x85ea('0x7'));var rpcDb=require(_0x85ea('0x8'));var Channel=require(_0x85ea('0x9'));var ut=require(_0x85ea('0xa'));var Action=require(_0x85ea('0xb'));var faxAccount=require(_0x85ea('0xc'));var attachment=require(_0x85ea('0xd'));var faxMessage=require(_0x85ea('0xe'));function Fax(_0x38a050){this[_0x85ea('0xf')]={};this[_0x85ea('0x10')]=_0x38a050['faxAccounts'];this[_0x85ea('0x11')]=_0x38a050[_0x85ea('0x11')];this[_0x85ea('0x12')]={};ami['on']('newchannel',this['syncNewchannel'][_0x85ea('0x13')](this));ami['on'](_0x85ea('0x14'),this[_0x85ea('0x15')][_0x85ea('0x13')](this));ami['on'](_0x85ea('0x16'),this[_0x85ea('0x17')][_0x85ea('0x13')](this));ami['on'](_0x85ea('0x18'),this[_0x85ea('0x19')]['bind'](this));ami['on'](_0x85ea('0x1a'),this[_0x85ea('0x1b')][_0x85ea('0x13')](this));ami['on'](_0x85ea('0x1c'),this[_0x85ea('0x1d')][_0x85ea('0x13')](this));ami['on'](_0x85ea('0x1e'),this[_0x85ea('0x1f')][_0x85ea('0x13')](this));ami['on'](_0x85ea('0x20'),this[_0x85ea('0x21')]['bind'](this));}Fax[_0x85ea('0x22')][_0x85ea('0x23')]=function(_0x15a2a0){if(_0x15a2a0[_0x85ea('0x24')]==='from-voip-provider'){for(var _0x47b38e in this['faxAccounts']){if(this[_0x85ea('0x10')][_0x85ea('0x25')](_0x47b38e)){if(_0x15a2a0[_0x85ea('0x26')]===this[_0x85ea('0x10')][_0x47b38e][_0x85ea('0x27')]){this[_0x85ea('0xf')][_0x15a2a0['uniqueid']]={};this['channels'][_0x15a2a0[_0x85ea('0x28')]][_0x85ea('0x29')]=_0x15a2a0[_0x85ea('0x29')];this[_0x85ea('0xf')][_0x15a2a0[_0x85ea('0x28')]]['id']=this[_0x85ea('0x10')][_0x47b38e]['id'];this['channels'][_0x15a2a0[_0x85ea('0x28')]][_0x85ea('0x2a')]=this['faxAccounts'][_0x47b38e][_0x85ea('0x2a')];logger['info'](_0x15a2a0['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0x85ea('0x12')][_0x15a2a0[_0x85ea('0x28')]]){this[_0x85ea('0xf')][_0x15a2a0[_0x85ea('0x28')]]={};this[_0x85ea('0xf')][_0x15a2a0[_0x85ea('0x28')]]['channel']=_0x15a2a0[_0x85ea('0x29')];logger[_0x85ea('0x2b')](_0x15a2a0[_0x85ea('0x28')],_0x85ea('0x2c'));}};Fax[_0x85ea('0x22')]['syncVarSet']=function(_0x21ff55){if(this['channels'][_0x21ff55['uniqueid']]){for(var _0xee5dc3 in _0x21ff55['variable']){if(_0x21ff55['variable']['hasOwnProperty'](_0xee5dc3)){this[_0x85ea('0xf')][_0x21ff55[_0x85ea('0x28')]][_0xee5dc3]=_0x21ff55[_0x85ea('0x2d')];}}}};Fax[_0x85ea('0x22')][_0x85ea('0x17')]=function(_0xf3f1f1){if(this[_0x85ea('0xf')][_0xf3f1f1[_0x85ea('0x28')]]){this[_0x85ea('0xf')][_0xf3f1f1['uniqueid']]['channelstate']=_0xf3f1f1['channelstate'];this['channels'][_0xf3f1f1[_0x85ea('0x28')]][_0x85ea('0x2e')]=_0xf3f1f1[_0x85ea('0x2e')];}};Fax[_0x85ea('0x22')][_0x85ea('0x19')]=function(_0x88ccc8){if(this['channels'][_0x88ccc8[_0x85ea('0x28')]]){for(var _0x5caa64 in _0x88ccc8[_0x85ea('0x2f')]){if(_0x88ccc8['variable'][_0x85ea('0x25')](_0x5caa64)){this[_0x85ea('0xf')][_0x88ccc8[_0x85ea('0x28')]][_0x5caa64]=_0x88ccc8[_0x85ea('0x2d')];}}}};Fax[_0x85ea('0x22')]['syncFaxStatus']=function(_0x517502){if(this[_0x85ea('0xf')][_0x517502['uniqueid']]){this[_0x85ea('0xf')][_0x517502[_0x85ea('0x28')]][_0x85ea('0x30')]=_0x517502[_0x85ea('0x30')];this['channels'][_0x517502['uniqueid']][_0x85ea('0x31')]=_0x517502['status'];this[_0x85ea('0xf')][_0x517502[_0x85ea('0x28')]]['localstationid']=_0x517502['localstationid'];this[_0x85ea('0xf')][_0x517502[_0x85ea('0x28')]][_0x85ea('0x32')]=_0x517502[_0x85ea('0x32')];logger[_0x85ea('0x2b')](_0x517502[_0x85ea('0x28')],_0x85ea('0x33'));}};Fax[_0x85ea('0x22')][_0x85ea('0x1d')]=function(_0x26ba4c){var _0x3cdd2d=this;if(this['channels'][_0x26ba4c[_0x85ea('0x28')]]){var _0x55e582=this[_0x85ea('0xf')][_0x26ba4c[_0x85ea('0x28')]]['id'];this['channels'][_0x26ba4c[_0x85ea('0x28')]]['remotestationid']=_0x26ba4c[_0x85ea('0x34')];this[_0x85ea('0xf')][_0x26ba4c['uniqueid']][_0x85ea('0x35')]=_0x26ba4c[_0x85ea('0x35')];this[_0x85ea('0xf')][_0x26ba4c['uniqueid']][_0x85ea('0x27')]=_0x26ba4c[_0x85ea('0x27')];this[_0x85ea('0xf')][_0x26ba4c[_0x85ea('0x28')]][_0x85ea('0x36')]=_0x26ba4c[_0x85ea('0x36')];this['channels'][_0x26ba4c[_0x85ea('0x28')]][_0x85ea('0x37')]=_0x26ba4c[_0x85ea('0x37')];this[_0x85ea('0xf')][_0x26ba4c[_0x85ea('0x28')]][_0x85ea('0x32')]=_0x26ba4c[_0x85ea('0x32')];this[_0x85ea('0xf')][_0x26ba4c['uniqueid']][_0x85ea('0x38')]=_0x26ba4c[_0x85ea('0x38')];if(this[_0x85ea('0xf')][_0x26ba4c[_0x85ea('0x28')]][_0x85ea('0x35')]>0x0){tiff2pdf(_0x26ba4c[_0x85ea('0x32')],'/var/opt/motion2/server/files/attachments/',function(_0x37e2a3){logger[_0x85ea('0x2b')](_0x26ba4c[_0x85ea('0x28')],_0x85ea('0x39'),_0x37e2a3[_0x85ea('0x3a')]);attachment[_0x85ea('0x3b')]({'name':path[_0x85ea('0x3c')](_0x26ba4c[_0x85ea('0x32')])[_0x85ea('0x2a')],'basename':path[_0x85ea('0x3c')](_0x26ba4c[_0x85ea('0x32')])['name']+_0x85ea('0x3d'),'type':_0x85ea('0x3e')})['then'](function(_0x125c18){faxAccount[_0x85ea('0x3f')](_0x55e582,{'from':_0x26ba4c[_0x85ea('0x38')],'mapKey':'fax','body':path[_0x85ea('0x3c')](_0x26ba4c[_0x85ea('0x32')])[_0x85ea('0x2a')]+_0x85ea('0x3d'),'AttachmentId':_0x125c18['id']})[_0x85ea('0x40')](function(_0x38daf0){logger[_0x85ea('0x41')](_0x26ba4c[_0x85ea('0x28')],_0x85ea('0x42'),JSON[_0x85ea('0x43')](_0x38daf0));});})[_0x85ea('0x40')](function(_0x1ae025){logger['error'](_0x26ba4c[_0x85ea('0x28')],_0x85ea('0x44'),JSON['stringify'](_0x1ae025));});});}logger[_0x85ea('0x2b')](_0x26ba4c[_0x85ea('0x28')],_0x85ea('0x44'));}};Fax[_0x85ea('0x22')]['syncOriginateResponse']=function(_0x3619f8){if(this[_0x85ea('0x12')][_0x3619f8[_0x85ea('0x28')]]){_['merge'](this[_0x85ea('0xf')][_0x3619f8['uniqueid']],_['pick'](_0x3619f8,[_0x85ea('0x45'),_0x85ea('0x46')]));}};function updateStatus(_0x2bff14){if(_0x2bff14[_0x85ea('0x47')]){faxMessage[_0x85ea('0x48')](_0x2bff14['AttachmentId'],{'failMessage':_0x85ea('0x49')})[_0x85ea('0x4a')](function(_0x910c91){ut['logger'](_0x85ea('0x4b'),_0x910c91);})[_0x85ea('0x40')](function(_0x1d01bd){ut[_0x85ea('0x4c')](_0x85ea('0x4d'),_0x1d01bd);});}else{ut['logger'](_0x85ea('0x4e'));}}Fax[_0x85ea('0x22')][_0x85ea('0x4f')]=function(_0x188bfb,_0x47462a,_0x3a6d40){var _0x42a685=this;var _0x1261ee={};if(_0x47462a){_0x1261ee={'read':_0x47462a};}else{_0x1261ee={'failMessage':_0x3a6d40};}if(this[_0x85ea('0x12')][_0x188bfb][_0x85ea('0x47')]){faxMessage[_0x85ea('0x48')](this[_0x85ea('0x12')][_0x188bfb][_0x85ea('0x47')],_0x1261ee)['then'](function(_0x187c40){ut['logger'](_0x85ea('0x50'),_0x187c40);})[_0x85ea('0x40')](function(_0x4c3939){ut['logger'](_0x85ea('0x51'),_0x4c3939);})['finally'](function(){delete _0x42a685[_0x85ea('0xf')][_0x188bfb];delete _0x42a685[_0x85ea('0x12')][_0x188bfb];});}else{ut['logger']('[Fax][Message][NoUpdate2]');delete this[_0x85ea('0xf')][_0x188bfb];delete this['actions'][_0x188bfb];}};Fax[_0x85ea('0x22')]['syncHangup']=function(_0x4596b3){var _0xac6ff1=this;if(this[_0x85ea('0xf')][_0x4596b3[_0x85ea('0x28')]]){if(this[_0x85ea('0x12')][_0x4596b3[_0x85ea('0x28')]]){this[_0x85ea('0xf')][_0x4596b3[_0x85ea('0x28')]]['id']=this['actions'][_0x4596b3[_0x85ea('0x28')]]['id'];this[_0x85ea('0xf')][_0x4596b3[_0x85ea('0x28')]][_0x85ea('0x2a')]=this[_0x85ea('0x12')][_0x4596b3[_0x85ea('0x28')]]['name'];}logger['info'](_0x4596b3[_0x85ea('0x28')],this[_0x85ea('0x12')][_0x4596b3[_0x85ea('0x28')]]?_0x85ea('0x52'):'\x20hangup\x20faxRiceive\x20',JSON[_0x85ea('0x43')](this['channels'][_0x4596b3[_0x85ea('0x28')]]));if(this[_0x85ea('0x12')][_0x4596b3['uniqueid']]){if(this[_0x85ea('0xf')][_0x4596b3[_0x85ea('0x28')]][_0x85ea('0x53')]>0x0&&this['channels'][_0x4596b3[_0x85ea('0x28')]]['faxstatus']===_0x85ea('0x54')){this[_0x85ea('0x4f')](_0x4596b3[_0x85ea('0x28')],!![]);}else{this[_0x85ea('0x4f')](_0x4596b3[_0x85ea('0x28')],![],this[_0x85ea('0xf')][_0x4596b3['uniqueid']]['faxstatusstring']?_0x85ea('0x55')+this[_0x85ea('0xf')][_0x4596b3[_0x85ea('0x28')]][_0x85ea('0x56')]:'SENDING\x20FAILED');}}}};Fax[_0x85ea('0x22')][_0x85ea('0x57')]=function(_0x189d91){var _0x2a702a=this;return new BPromise(function(_0x34be3e,_0x76cf8b){_0x2a702a[_0x85ea('0x58')](_0x189d91,_0x2a702a[_0x85ea('0x10')][_0x189d91[_0x85ea('0x59')]])[_0x85ea('0x4a')](function(_0x54e341){ut[_0x85ea('0x4c')]('[Fax][execOriginate][success]',_0x54e341);_0x34be3e(ut[_0x85ea('0x3a')](_0x85ea('0x5a')));})['catch'](function(_0x5ef295){ut['logger']('[Fax][execOriginate][failure]',_0x5ef295);updateStatus(_0x189d91);_0x76cf8b(ut[_0x85ea('0x3a')](_0x85ea('0x5b')));});});};Fax[_0x85ea('0x22')][_0x85ea('0x5c')]=function(_0x5a8c24){var _0x38776f=this;return new BPromise(function(_0x2bb141,_0x260739){var _0xaeac92=_0x38776f[_0x85ea('0x5d')](_0x38776f[_0x85ea('0x10')][_0x5a8c24[_0x85ea('0x59')]][_0x85ea('0x5e')],_0x5a8c24);if(_0xaeac92[_0x85ea('0x5f')]){_0x2bb141(ut[_0x85ea('0x3a')](_0x85ea('0x60')));}else{_0x260739(ut[_0x85ea('0x3a')](_0xaeac92['message']));}});};function originate(_0x12b536,_0x5bc491,_0x2c85d3){return new BPromise(function(_0x2d693f,_0x130d81){if(_0x2c85d3){var _0x2ce2c2=util[_0x85ea('0x61')](_0x85ea('0x62'),path[_0x85ea('0x3c')](_0x12b536[_0x85ea('0x3')])[_0x85ea('0x2a')],_0x12b536['path']);gs[_0x85ea('0x63')](_0x2ce2c2)['then'](function(){_0x12b536[_0x85ea('0x3')]=util['format'](_0x85ea('0x64'),path['parse'](_0x12b536[_0x85ea('0x3')])[_0x85ea('0x65')],path[_0x85ea('0x3c')](_0x12b536[_0x85ea('0x3')])[_0x85ea('0x2a')]);_0x5bc491[_0x85ea('0x66')]=_0x12b536[_0x85ea('0x3')];ut[_0x85ea('0x4c')](_0x85ea('0x67'),'');ami['Action'](ut[_0x85ea('0x68')](_0x12b536,_0x5bc491))[_0x85ea('0x4a')](function(_0x22bf2d){_0x2d693f(_0x22bf2d);})[_0x85ea('0x40')](function(_0x4de06c){_0x130d81(_0x4de06c);});})[_0x85ea('0x40')](function(_0x26a718){_0x130d81(_0x26a718);});}else{ami[_0x85ea('0x69')](ut['variablesAction'](_0x12b536,_0x5bc491))[_0x85ea('0x4a')](function(_0x3cb196){_0x2d693f(_0x3cb196);})[_0x85ea('0x40')](function(_0x3d9e88){_0x130d81(_0x3d9e88);});}});}Fax['prototype'][_0x85ea('0x58')]=function(_0x36c930,_0x3de6b6){var _0x3969d1=this;return new BPromise(function(_0x3d9208,_0x42e366){var _0xfa9422=uuid['v4']();var _0x2fd08b=ut[_0x85ea('0x6a')](_0x36c930,_0x3de6b6);_0x3969d1['actions'][_0xfa9422]=new Action(_0xfa9422,_0x3de6b6,_0x36c930);var _0x1ca3c7=_0x3969d1[_0x85ea('0x12')][_0xfa9422];if(path[_0x85ea('0x3c')](_0x36c930[_0x85ea('0x3')])[_0x85ea('0x6b')]==='.pdf'){originate(_0x1ca3c7,_0x2fd08b,!![])['then'](function(_0x1c5aba){_0x3d9208(_0x1c5aba);})[_0x85ea('0x40')](function(_0x23a569){_0x42e366(_0x23a569);});}else{originate(_0x1ca3c7,_0x2fd08b,![])[_0x85ea('0x4a')](function(_0x40f706){_0x3d9208(_0x40f706);})[_0x85ea('0x40')](function(_0x1b57a7){_0x42e366(_0x1b57a7);});}});};Fax[_0x85ea('0x22')][_0x85ea('0x6c')]=function(_0x45b156){return!_['isNil'](_0x45b156)&&!_[_0x85ea('0x6d')](_0x45b156[_0x85ea('0x2a')])&&!_['isNil'](_0x45b156['active'])&&_0x45b156[_0x85ea('0x6e')]&&!_['isNil'](this[_0x85ea('0x11')][util[_0x85ea('0x61')](_0x85ea('0x6f'),_0x45b156['name'])])&&!_[_0x85ea('0x6d')](this[_0x85ea('0x11')][util['format'](_0x85ea('0x6f'),_0x45b156['name'])]['status'])&&(this[_0x85ea('0x11')][util[_0x85ea('0x61')](_0x85ea('0x6f'),_0x45b156[_0x85ea('0x2a')])]['status']==='reachable'||this[_0x85ea('0x11')][util[_0x85ea('0x61')](_0x85ea('0x6f'),_0x45b156['name'])][_0x85ea('0x31')]==='unmonitored');};Fax[_0x85ea('0x22')][_0x85ea('0x5d')]=function(_0x40b9b4,_0x540517){if(!this[_0x85ea('0x6c')](_0x40b9b4)){ut[_0x85ea('0x4c')](_0x85ea('0x70'),_[_0x85ea('0x6d')](_0x40b9b4)?'':_0x40b9b4[_0x85ea('0x2a')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x85ea('0x71')};}if(_[_0x85ea('0x6d')](_0x540517[_0x85ea('0x6')])){ut[_0x85ea('0x4c')](_0x85ea('0x72'),JSON[_0x85ea('0x43')](_0x540517));return{'isValid':![],'message':_0x85ea('0x73')};}if(_['isNil'](_0x540517[_0x85ea('0x3')])){ut[_0x85ea('0x4c')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x540517));return{'isValid':![],'message':_0x85ea('0x74')};}return{'isValid':!![],'message':_0x85ea('0x75')};};module[_0x85ea('0x76')]=Fax; \ No newline at end of file +var _0xb245=['newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','hangup','originateresponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','remotestationid','pagestransferred','resolution','transferrate','filename','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','\x20notify\x20','stringify','catch','\x20receiveFax\x20','merge','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','format','%s/%s.tif','dir','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','bluebird','moment','path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./util/util','./action','faxAccounts','trunks','actions','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState'];(function(_0x1c6815,_0x39a650){var _0x244537=function(_0x2c11c5){while(--_0x2c11c5){_0x1c6815['push'](_0x1c6815['shift']());}};_0x244537(++_0x39a650);}(_0xb245,0xc5));var _0x5b24=function(_0x254254,_0x23dc4d){_0x254254=_0x254254-0x0;var _0x302c27=_0xb245[_0x254254];return _0x302c27;};'use strict';var util=require(_0x5b24('0x0'));var _=require(_0x5b24('0x1'));var BPromise=require(_0x5b24('0x2'));var uuid=require('uuid');var moment=require(_0x5b24('0x3'));var path=require(_0x5b24('0x4'));var tiff2pdf=require(_0x5b24('0x5'));var gs=require('./util/gs');var logger=require(_0x5b24('0x6'))(_0x5b24('0x7'));var ami=require(_0x5b24('0x8'));var rpcDb=require(_0x5b24('0x9'));var Channel=require('./channel');var ut=require(_0x5b24('0xa'));var Action=require(_0x5b24('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0x59d07e){this['channels']={};this[_0x5b24('0xc')]=_0x59d07e[_0x5b24('0xc')];this[_0x5b24('0xd')]=_0x59d07e[_0x5b24('0xd')];this[_0x5b24('0xe')]={};ami['on']('newchannel',this[_0x5b24('0xf')][_0x5b24('0x10')](this));ami['on'](_0x5b24('0x11'),this[_0x5b24('0x12')][_0x5b24('0x10')](this));ami['on'](_0x5b24('0x13'),this[_0x5b24('0x14')][_0x5b24('0x10')](this));ami['on'](_0x5b24('0x15'),this[_0x5b24('0x16')][_0x5b24('0x10')](this));ami['on'](_0x5b24('0x17'),this[_0x5b24('0x18')][_0x5b24('0x10')](this));ami['on'](_0x5b24('0x19'),this['syncReceiveFax'][_0x5b24('0x10')](this));ami['on'](_0x5b24('0x1a'),this['syncHangup'][_0x5b24('0x10')](this));ami['on'](_0x5b24('0x1b'),this['syncOriginateResponse'][_0x5b24('0x10')](this));}Fax[_0x5b24('0x1c')]['syncNewchannel']=function(_0x8cbe05){if(_0x8cbe05[_0x5b24('0x1d')]===_0x5b24('0x1e')){for(var _0x6ccdd9 in this[_0x5b24('0xc')]){if(this[_0x5b24('0xc')][_0x5b24('0x1f')](_0x6ccdd9)){if(_0x8cbe05[_0x5b24('0x20')]===this[_0x5b24('0xc')][_0x6ccdd9][_0x5b24('0x21')]){this[_0x5b24('0x22')][_0x8cbe05[_0x5b24('0x23')]]={};this[_0x5b24('0x22')][_0x8cbe05[_0x5b24('0x23')]][_0x5b24('0x24')]=_0x8cbe05['channel'];this['channels'][_0x8cbe05[_0x5b24('0x23')]]['id']=this[_0x5b24('0xc')][_0x6ccdd9]['id'];this[_0x5b24('0x22')][_0x8cbe05[_0x5b24('0x23')]]['name']=this['faxAccounts'][_0x6ccdd9][_0x5b24('0x25')];logger[_0x5b24('0x26')](_0x8cbe05[_0x5b24('0x23')],_0x5b24('0x27'));}}}}if(this[_0x5b24('0xe')][_0x8cbe05['uniqueid']]){this[_0x5b24('0x22')][_0x8cbe05['uniqueid']]={};this[_0x5b24('0x22')][_0x8cbe05[_0x5b24('0x23')]]['channel']=_0x8cbe05[_0x5b24('0x24')];logger[_0x5b24('0x26')](_0x8cbe05[_0x5b24('0x23')],'\x20syncNewchannel\x20');}};Fax[_0x5b24('0x1c')][_0x5b24('0x12')]=function(_0x1fb2e1){if(this[_0x5b24('0x22')][_0x1fb2e1[_0x5b24('0x23')]]){for(var _0x166c97 in _0x1fb2e1[_0x5b24('0x28')]){if(_0x1fb2e1['variable'][_0x5b24('0x1f')](_0x166c97)){this['channels'][_0x1fb2e1['uniqueid']][_0x166c97]=_0x1fb2e1[_0x5b24('0x29')];}}}};Fax[_0x5b24('0x1c')][_0x5b24('0x14')]=function(_0x4daef0){if(this['channels'][_0x4daef0['uniqueid']]){this[_0x5b24('0x22')][_0x4daef0[_0x5b24('0x23')]]['channelstate']=_0x4daef0[_0x5b24('0x2a')];this[_0x5b24('0x22')][_0x4daef0['uniqueid']][_0x5b24('0x2b')]=_0x4daef0[_0x5b24('0x2b')];}};Fax['prototype'][_0x5b24('0x16')]=function(_0x350339){if(this['channels'][_0x350339[_0x5b24('0x23')]]){for(var _0x1cc271 in _0x350339['variable']){if(_0x350339['variable'][_0x5b24('0x1f')](_0x1cc271)){this['channels'][_0x350339['uniqueid']][_0x1cc271]=_0x350339[_0x5b24('0x29')];}}}};Fax[_0x5b24('0x1c')][_0x5b24('0x18')]=function(_0x1dfbe0){if(this[_0x5b24('0x22')][_0x1dfbe0[_0x5b24('0x23')]]){this[_0x5b24('0x22')][_0x1dfbe0['uniqueid']][_0x5b24('0x2c')]=_0x1dfbe0[_0x5b24('0x2c')];this['channels'][_0x1dfbe0[_0x5b24('0x23')]][_0x5b24('0x2d')]=_0x1dfbe0[_0x5b24('0x2d')];this['channels'][_0x1dfbe0[_0x5b24('0x23')]][_0x5b24('0x21')]=_0x1dfbe0[_0x5b24('0x21')];this[_0x5b24('0x22')][_0x1dfbe0[_0x5b24('0x23')]]['filename']=_0x1dfbe0['filename'];logger[_0x5b24('0x26')](_0x1dfbe0[_0x5b24('0x23')],'\x20syncFaxStatus\x20');}};Fax[_0x5b24('0x1c')]['syncReceiveFax']=function(_0x2c444b){var _0x2fa66b=this;if(this[_0x5b24('0x22')][_0x2c444b[_0x5b24('0x23')]]){var _0xbdf818=this[_0x5b24('0x22')][_0x2c444b[_0x5b24('0x23')]]['id'];this[_0x5b24('0x22')][_0x2c444b[_0x5b24('0x23')]][_0x5b24('0x2e')]=_0x2c444b['remotestationid'];this[_0x5b24('0x22')][_0x2c444b['uniqueid']][_0x5b24('0x2f')]=_0x2c444b[_0x5b24('0x2f')];this[_0x5b24('0x22')][_0x2c444b[_0x5b24('0x23')]][_0x5b24('0x21')]=_0x2c444b[_0x5b24('0x21')];this['channels'][_0x2c444b[_0x5b24('0x23')]][_0x5b24('0x30')]=_0x2c444b['resolution'];this[_0x5b24('0x22')][_0x2c444b[_0x5b24('0x23')]][_0x5b24('0x31')]=_0x2c444b[_0x5b24('0x31')];this[_0x5b24('0x22')][_0x2c444b[_0x5b24('0x23')]][_0x5b24('0x32')]=_0x2c444b[_0x5b24('0x32')];this['channels'][_0x2c444b[_0x5b24('0x23')]][_0x5b24('0x33')]=_0x2c444b[_0x5b24('0x33')];if(this[_0x5b24('0x22')][_0x2c444b[_0x5b24('0x23')]]['pagestransferred']>0x0){tiff2pdf(_0x2c444b[_0x5b24('0x32')],'/var/opt/motion2/server/files/attachments/',function(_0x2c7546){logger[_0x5b24('0x26')](_0x2c444b[_0x5b24('0x23')],_0x5b24('0x34'),_0x2c7546[_0x5b24('0x35')]);attachment[_0x5b24('0x36')]({'name':path[_0x5b24('0x37')](_0x2c444b['filename'])[_0x5b24('0x25')],'basename':path['parse'](_0x2c444b[_0x5b24('0x32')])[_0x5b24('0x25')]+_0x5b24('0x38'),'type':_0x5b24('0x39')})[_0x5b24('0x3a')](function(_0x3c86c1){faxAccount['notify'](_0xbdf818,{'from':_0x2c444b[_0x5b24('0x33')],'mapKey':_0x5b24('0x7'),'body':path[_0x5b24('0x37')](_0x2c444b[_0x5b24('0x32')])[_0x5b24('0x25')]+_0x5b24('0x38'),'AttachmentId':_0x3c86c1['id']})['catch'](function(_0x1e8d2e){logger['error'](_0x2c444b[_0x5b24('0x23')],_0x5b24('0x3b'),JSON[_0x5b24('0x3c')](_0x1e8d2e));});})[_0x5b24('0x3d')](function(_0x18bfb7){logger['error'](_0x2c444b[_0x5b24('0x23')],_0x5b24('0x3e'),JSON[_0x5b24('0x3c')](_0x18bfb7));});});}logger[_0x5b24('0x26')](_0x2c444b[_0x5b24('0x23')],_0x5b24('0x3e'));}};Fax[_0x5b24('0x1c')]['syncOriginateResponse']=function(_0x2e54fd){if(this[_0x5b24('0xe')][_0x2e54fd[_0x5b24('0x23')]]){_[_0x5b24('0x3f')](this[_0x5b24('0x22')][_0x2e54fd[_0x5b24('0x23')]],_['pick'](_0x2e54fd,['response','reason']));}};function updateStatus(_0x1045b8){if(_0x1045b8[_0x5b24('0x40')]){faxMessage[_0x5b24('0x41')](_0x1045b8[_0x5b24('0x40')],{'failMessage':_0x5b24('0x42')})[_0x5b24('0x3a')](function(_0x2c3635){ut[_0x5b24('0x43')]('[Fax][Message][Error][Updated]',_0x2c3635);})[_0x5b24('0x3d')](function(_0x458aa4){ut[_0x5b24('0x43')](_0x5b24('0x44'),_0x458aa4);});}else{ut[_0x5b24('0x43')](_0x5b24('0x45'));}}Fax[_0x5b24('0x1c')][_0x5b24('0x46')]=function(_0x7fa341,_0x4e045c,_0x5c3298){var _0x4ce53b=this;var _0x7f499b={};if(_0x4e045c){_0x7f499b={'read':_0x4e045c};}else{_0x7f499b={'failMessage':_0x5c3298};}if(this['actions'][_0x7fa341][_0x5b24('0x40')]){faxMessage[_0x5b24('0x41')](this[_0x5b24('0xe')][_0x7fa341][_0x5b24('0x40')],_0x7f499b)[_0x5b24('0x3a')](function(_0x2d3711){ut[_0x5b24('0x43')](_0x5b24('0x47'),_0x2d3711);})[_0x5b24('0x3d')](function(_0x3541ae){ut[_0x5b24('0x43')](_0x5b24('0x48'),_0x3541ae);})['finally'](function(){delete _0x4ce53b[_0x5b24('0x22')][_0x7fa341];delete _0x4ce53b[_0x5b24('0xe')][_0x7fa341];});}else{ut[_0x5b24('0x43')](_0x5b24('0x49'));delete this['channels'][_0x7fa341];delete this[_0x5b24('0xe')][_0x7fa341];}};Fax[_0x5b24('0x1c')][_0x5b24('0x4a')]=function(_0x27298f){var _0x2e3661=this;if(this[_0x5b24('0x22')][_0x27298f[_0x5b24('0x23')]]){if(this[_0x5b24('0xe')][_0x27298f[_0x5b24('0x23')]]){this[_0x5b24('0x22')][_0x27298f[_0x5b24('0x23')]]['id']=this[_0x5b24('0xe')][_0x27298f['uniqueid']]['id'];this[_0x5b24('0x22')][_0x27298f[_0x5b24('0x23')]]['name']=this['actions'][_0x27298f[_0x5b24('0x23')]][_0x5b24('0x25')];}logger[_0x5b24('0x26')](_0x27298f['uniqueid'],this[_0x5b24('0xe')][_0x27298f[_0x5b24('0x23')]]?'\x20hangup\x20sendFile\x20':_0x5b24('0x4b'),JSON[_0x5b24('0x3c')](this[_0x5b24('0x22')][_0x27298f[_0x5b24('0x23')]]));if(this[_0x5b24('0xe')][_0x27298f[_0x5b24('0x23')]]){if(this[_0x5b24('0x22')][_0x27298f[_0x5b24('0x23')]][_0x5b24('0x4c')]>0x0&&this[_0x5b24('0x22')][_0x27298f[_0x5b24('0x23')]][_0x5b24('0x17')]==='SUCCESS'){this[_0x5b24('0x46')](_0x27298f[_0x5b24('0x23')],!![]);}else{this[_0x5b24('0x46')](_0x27298f[_0x5b24('0x23')],![],this[_0x5b24('0x22')][_0x27298f['uniqueid']][_0x5b24('0x4d')]?_0x5b24('0x4e')+this[_0x5b24('0x22')][_0x27298f['uniqueid']][_0x5b24('0x4d')]:_0x5b24('0x4f'));}}}};Fax[_0x5b24('0x1c')][_0x5b24('0x50')]=function(_0xa1c333){var _0xc46242=this;return new BPromise(function(_0x3b2a3d,_0x199484){_0xc46242[_0x5b24('0x51')](_0xa1c333,_0xc46242[_0x5b24('0xc')][_0xa1c333[_0x5b24('0x52')]])[_0x5b24('0x3a')](function(_0x30d7ce){ut[_0x5b24('0x43')]('[Fax][execOriginate][success]',_0x30d7ce);_0x3b2a3d(ut[_0x5b24('0x35')]('Fax\x20received'));})[_0x5b24('0x3d')](function(_0x5cc6bc){ut[_0x5b24('0x43')](_0x5b24('0x53'),_0x5cc6bc);updateStatus(_0xa1c333);_0x199484(ut[_0x5b24('0x35')]('Fax\x20failed'));});});};Fax['prototype'][_0x5b24('0x54')]=function(_0x43cca4){var _0x104555=this;return new BPromise(function(_0x4b4639,_0x54cd20){var _0x7a2e80=_0x104555[_0x5b24('0x55')](_0x104555['faxAccounts'][_0x43cca4['FaxAccountId']]['Trunk'],_0x43cca4);if(_0x7a2e80[_0x5b24('0x56')]){_0x4b4639(ut['message'](_0x5b24('0x57')));}else{_0x54cd20(ut[_0x5b24('0x35')](_0x7a2e80['message']));}});};function originate(_0xe38052,_0x2ca0fc,_0x4cc11d){return new BPromise(function(_0x145740,_0x3d0bac){if(_0x4cc11d){var _0x19a97d=util['format'](_0x5b24('0x58'),path[_0x5b24('0x37')](_0xe38052[_0x5b24('0x4')])['name'],_0xe38052[_0x5b24('0x4')]);gs[_0x5b24('0x59')](_0x19a97d)[_0x5b24('0x3a')](function(){_0xe38052[_0x5b24('0x4')]=util[_0x5b24('0x5a')](_0x5b24('0x5b'),path[_0x5b24('0x37')](_0xe38052[_0x5b24('0x4')])[_0x5b24('0x5c')],path[_0x5b24('0x37')](_0xe38052[_0x5b24('0x4')])[_0x5b24('0x25')]);_0x2ca0fc['XMF-PATH']=_0xe38052[_0x5b24('0x4')];ut['logger']('Convert\x20pdf\x20to\x20tif','');ami[_0x5b24('0x5d')](ut['variablesAction'](_0xe38052,_0x2ca0fc))['then'](function(_0x45d06b){_0x145740(_0x45d06b);})[_0x5b24('0x3d')](function(_0x18c312){_0x3d0bac(_0x18c312);});})['catch'](function(_0x47d174){_0x3d0bac(_0x47d174);});}else{ami[_0x5b24('0x5d')](ut[_0x5b24('0x5e')](_0xe38052,_0x2ca0fc))[_0x5b24('0x3a')](function(_0x594f64){_0x145740(_0x594f64);})[_0x5b24('0x3d')](function(_0xb12715){_0x3d0bac(_0xb12715);});}});}Fax[_0x5b24('0x1c')][_0x5b24('0x51')]=function(_0x2372b3,_0x137189){var _0x4c359b=this;return new BPromise(function(_0x25167a,_0x3800c5){var _0x263b0e=uuid['v4']();var _0x2faedb=ut[_0x5b24('0x5f')](_0x2372b3,_0x137189);_0x4c359b[_0x5b24('0xe')][_0x263b0e]=new Action(_0x263b0e,_0x137189,_0x2372b3);var _0x3ab65e=_0x4c359b[_0x5b24('0xe')][_0x263b0e];if(path[_0x5b24('0x37')](_0x2372b3[_0x5b24('0x4')])['ext']===_0x5b24('0x38')){originate(_0x3ab65e,_0x2faedb,!![])[_0x5b24('0x3a')](function(_0x27d68c){_0x25167a(_0x27d68c);})[_0x5b24('0x3d')](function(_0x12221a){_0x3800c5(_0x12221a);});}else{originate(_0x3ab65e,_0x2faedb,![])[_0x5b24('0x3a')](function(_0x184a40){_0x25167a(_0x184a40);})[_0x5b24('0x3d')](function(_0x480656){_0x3800c5(_0x480656);});}});};Fax[_0x5b24('0x1c')][_0x5b24('0x60')]=function(_0xbe0f86){return!_['isNil'](_0xbe0f86)&&!_[_0x5b24('0x61')](_0xbe0f86[_0x5b24('0x25')])&&!_[_0x5b24('0x61')](_0xbe0f86['active'])&&_0xbe0f86[_0x5b24('0x62')]&&!_[_0x5b24('0x61')](this[_0x5b24('0xd')][util['format'](_0x5b24('0x63'),_0xbe0f86[_0x5b24('0x25')])])&&!_['isNil'](this[_0x5b24('0xd')][util['format'](_0x5b24('0x63'),_0xbe0f86[_0x5b24('0x25')])][_0x5b24('0x2d')])&&(this[_0x5b24('0xd')][util[_0x5b24('0x5a')](_0x5b24('0x63'),_0xbe0f86['name'])][_0x5b24('0x2d')]===_0x5b24('0x64')||this[_0x5b24('0xd')][util[_0x5b24('0x5a')](_0x5b24('0x63'),_0xbe0f86[_0x5b24('0x25')])]['status']===_0x5b24('0x65'));};Fax[_0x5b24('0x1c')][_0x5b24('0x55')]=function(_0x555e1a,_0x2a80b5){if(!this[_0x5b24('0x60')](_0x555e1a)){ut[_0x5b24('0x43')](_0x5b24('0x66'),_[_0x5b24('0x61')](_0x555e1a)?'':_0x555e1a[_0x5b24('0x25')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x5b24('0x67')};}if(_[_0x5b24('0x61')](_0x2a80b5[_0x5b24('0x7')])){ut[_0x5b24('0x43')](_0x5b24('0x68'),JSON[_0x5b24('0x3c')](_0x2a80b5));return{'isValid':![],'message':_0x5b24('0x69')};}if(_['isNil'](_0x2a80b5[_0x5b24('0x4')])){ut['logger'](_0x5b24('0x6a'),JSON[_0x5b24('0x3c')](_0x2a80b5));return{'isValid':![],'message':_0x5b24('0x6b')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x5b24('0x6c')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index f1c8327..af5b6c2 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 _0xe3fd=['preview','lodash','error','inspect','notify','then','[Notify]\x20','util'];(function(_0xfb5678,_0x4c1963){var _0x5c0083=function(_0x1bb7bc){while(--_0x1bb7bc){_0xfb5678['push'](_0xfb5678['shift']());}};_0x5c0083(++_0x4c1963);}(_0xe3fd,0x1df));var _0xde3f=function(_0x197fea,_0x42ce35){_0x197fea=_0x197fea-0x0;var _0x85474e=_0xe3fd[_0x197fea];return _0x85474e;};'use strict';var util=require(_0xde3f('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0xde3f('0x1'));var _=require(_0xde3f('0x2'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x2a374c){return function(_0x27c688){logger[_0xde3f('0x3')](_0x2a374c,util[_0xde3f('0x4')](_0x27c688,{'showHidden':![],'depth':null}));};}exports[_0xde3f('0x5')]=function(_0x2ccc67,_0x239e0b){return BPromise['resolve']()[_0xde3f('0x6')](faxAccount[_0xde3f('0x5')](_0x2ccc67,_0x239e0b))['catch'](loggerCatch(_0xde3f('0x7')));}; \ No newline at end of file +var _0x1a10=['preview','../rpc/faxAccount','notify','catch','[Notify]\x20','util'];(function(_0x376bbe,_0x15f5a0){var _0x2f5ea2=function(_0x33a18f){while(--_0x33a18f){_0x376bbe['push'](_0x376bbe['shift']());}};_0x2f5ea2(++_0x15f5a0);}(_0x1a10,0x15b));var _0x01a1=function(_0x32c91f,_0x3454e8){_0x32c91f=_0x32c91f-0x0;var _0x26c6ec=_0x1a10[_0x32c91f];return _0x26c6ec;};'use strict';var util=require(_0x01a1('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0x01a1('0x1'));var _=require('lodash');var faxAccount=require(_0x01a1('0x2'));function loggerCatch(_0x51da19){return function(_0x47af8f){logger['error'](_0x51da19,util['inspect'](_0x47af8f,{'showHidden':![],'depth':null}));};}exports[_0x01a1('0x3')]=function(_0x53348f,_0xabee0b){return BPromise['resolve']()['then'](faxAccount[_0x01a1('0x3')](_0x53348f,_0xabee0b))[_0x01a1('0x4')](loggerCatch(_0x01a1('0x5')));}; \ 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 d0ffa5b..81a55d7 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 _0xd119=['child_process','exec','execute','Exec\x20gs','info','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird'];(function(_0x57a844,_0x5b7559){var _0x47cc52=function(_0x33f873){while(--_0x33f873){_0x57a844['push'](_0x57a844['shift']());}};_0x47cc52(++_0x5b7559);}(_0xd119,0x80));var _0x9d11=function(_0x8af54b,_0x280be5){_0x8af54b=_0x8af54b-0x0;var _0x27d8f0=_0xd119[_0x8af54b];return _0x27d8f0;};'use strict';var util=require(_0x9d11('0x0'));var logger=require(_0x9d11('0x1'))(_0x9d11('0x2'));var BPromise=require(_0x9d11('0x3'));var exec=require(_0x9d11('0x4'))[_0x9d11('0x5')];exports[_0x9d11('0x6')]=function(_0x26663a){return new BPromise(function(_0x1f008d,_0x571db4){exec(_0x26663a,function(_0x5c7f05,_0x41baf8,_0x14cf35){logger['info'](_0x9d11('0x7'),_0x41baf8);if(_0x5c7f05){logger[_0x9d11('0x8')](_0x9d11('0x7'),_0x9d11('0x9'),util[_0x9d11('0xa')](_0x5c7f05,{'showHidden':![],'depth':null}),_0x41baf8,_0x14cf35);_0x571db4(_0x5c7f05);}_0x1f008d(_0x41baf8);});});}; \ No newline at end of file +var _0x267f=['inspect','util','../../../../config/logger','fax','child_process','execute','info','Exec\x20gs'];(function(_0x5b40ed,_0x6a237){var _0x2e0440=function(_0x53b6f7){while(--_0x53b6f7){_0x5b40ed['push'](_0x5b40ed['shift']());}};_0x2e0440(++_0x6a237);}(_0x267f,0x99));var _0xf267=function(_0x50f74,_0x5a7a23){_0x50f74=_0x50f74-0x0;var _0x5cdada=_0x267f[_0x50f74];return _0x5cdada;};'use strict';var util=require(_0xf267('0x0'));var logger=require(_0xf267('0x1'))(_0xf267('0x2'));var BPromise=require('bluebird');var exec=require(_0xf267('0x3'))['exec'];exports[_0xf267('0x4')]=function(_0x26ed5c){return new BPromise(function(_0x532a81,_0x1ffd27){exec(_0x26ed5c,function(_0x255d1b,_0x47fc70,_0xf59788){logger[_0xf267('0x5')](_0xf267('0x6'),_0x47fc70);if(_0x255d1b){logger[_0xf267('0x5')](_0xf267('0x6'),'\x20Error\x20:',util[_0xf267('0x7')](_0x255d1b,{'showHidden':![],'depth':null}),_0x47fc70,_0xf59788);_0x1ffd27(_0x255d1b);}_0x532a81(_0x47fc70);});});}; \ 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 0fb4051..37991c5 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 _0xeecb=['uniqueid','util','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','variablesAction','originate','from-sip','\x22%s\x22\x20<%s>'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xeecb,0x178));var _0xbeec=function(_0x50b750,_0xe5817b){_0x50b750=_0x50b750-0x0;var _0x1b60a8=_0xeecb[_0x50b750];return _0x1b60a8;};'use strict';var util=require(_0xbeec('0x0'));var _=require(_0xbeec('0x1'));var moment=require(_0xbeec('0x2'));var logger=require(_0xbeec('0x3'))(_0xbeec('0x4'));exports[_0xbeec('0x5')]=function(_0x475148){return{'message':_0x475148};};exports[_0xbeec('0x6')]=function(_0x2f7029,_0x350696){logger[_0xbeec('0x7')](_0x2f7029,util[_0xbeec('0x8')](_0x350696,{'showHidden':![],'depth':null}));};exports[_0xbeec('0x9')]=function(_0x5f1e2d,_0x1b5fdf){var _0x1b80be={'XMF-ECM':_0x1b5fdf['ecm'],'XMF-HEADERINFO':_0x1b5fdf[_0xbeec('0xa')],'XMF-MINRATE':_0x1b5fdf[_0xbeec('0xb')],'XMF-MAXRATE':_0x1b5fdf[_0xbeec('0xc')],'XMF-MODEM':util[_0xbeec('0xd')](_0xbeec('0xe'),_0x1b5fdf[_0xbeec('0xf')]),'XMF-GATEWAY':_0x1b5fdf[_0xbeec('0x10')],'XMF-FAXDETECT':_0x1b5fdf[_0xbeec('0x11')],'XMF-T38TIMEOUT':_0x1b5fdf[_0xbeec('0x12')],'XMF-LOCALSTATIONID':_0x1b5fdf[_0xbeec('0x13')],'XMF-PATH':_0x5f1e2d['path']};return _0x1b80be;};exports[_0xbeec('0x14')]=function(_0x5341f8,_0x5adbf4){return{'actionid':_0x5341f8['uniqueid'],'action':_0xbeec('0x15'),'channel':_0x5341f8['channel'],'Exten':'xcally-motion-fax','Context':_0xbeec('0x16'),'Priority':'1','callerid':util[_0xbeec('0xd')](_0xbeec('0x17'),_0x5341f8[_0xbeec('0xa')]?_0x5341f8[_0xbeec('0xa')]:'',_0x5341f8[_0xbeec('0x13')]),'variable':_0x5adbf4,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5341f8[_0xbeec('0x18')]};}; \ No newline at end of file +var _0xa89c=['headerinfo','maxrate','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','channel','xcally-motion-fax','from-sip','format','util','moment','fax','message','logger','inspect','ecm'];(function(_0x1e6fa6,_0x459d6f){var _0x35ec83=function(_0x4543f6){while(--_0x4543f6){_0x1e6fa6['push'](_0x1e6fa6['shift']());}};_0x35ec83(++_0x459d6f);}(_0xa89c,0xbf));var _0xca89=function(_0x1931e4,_0x183bca){_0x1931e4=_0x1931e4-0x0;var _0x2042ac=_0xa89c[_0x1931e4];return _0x2042ac;};'use strict';var util=require(_0xca89('0x0'));var _=require('lodash');var moment=require(_0xca89('0x1'));var logger=require('../../../../config/logger')(_0xca89('0x2'));exports[_0xca89('0x3')]=function(_0x1e1ee7){return{'message':_0x1e1ee7};};exports[_0xca89('0x4')]=function(_0x35bd6e,_0xd5e4e7){logger['info'](_0x35bd6e,util[_0xca89('0x5')](_0xd5e4e7,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x5571ac,_0x49745f){var _0x40a072={'XMF-ECM':_0x49745f[_0xca89('0x6')],'XMF-HEADERINFO':_0x49745f[_0xca89('0x7')],'XMF-MINRATE':_0x49745f['minrate'],'XMF-MAXRATE':_0x49745f[_0xca89('0x8')],'XMF-MODEM':util['format'](_0xca89('0x9'),_0x49745f[_0xca89('0xa')]),'XMF-GATEWAY':_0x49745f[_0xca89('0xb')],'XMF-FAXDETECT':_0x49745f[_0xca89('0xc')],'XMF-T38TIMEOUT':_0x49745f[_0xca89('0xd')],'XMF-LOCALSTATIONID':_0x49745f[_0xca89('0xe')],'XMF-PATH':_0x5571ac[_0xca89('0xf')]};return _0x40a072;};exports[_0xca89('0x10')]=function(_0x67f39c,_0x17951c){return{'actionid':_0x67f39c[_0xca89('0x11')],'action':'originate','channel':_0x67f39c[_0xca89('0x12')],'Exten':_0xca89('0x13'),'Context':_0xca89('0x14'),'Priority':'1','callerid':util[_0xca89('0x15')]('\x22%s\x22\x20<%s>',_0x67f39c[_0xca89('0x7')]?_0x67f39c['headerinfo']:'',_0x67f39c['localstationid']),'variable':_0x17951c,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x67f39c['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 62f0192..8cbe512 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 _0xa880=['initAgents','initTelephones','initTrunks','getVoiceQueues','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','[index.js][initParams]','inspect','listen','[index.js][main]','moment','./realtime','./report','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./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/dynamics365','../../config/logger','get','resolve','getAgents','then'];(function(_0x210b93,_0x133e6d){var _0x2b020f=function(_0x3f9601){while(--_0x3f9601){_0x210b93['push'](_0x210b93['shift']());}};_0x2b020f(++_0x133e6d);}(_0xa880,0xe5));var _0x0a88=function(_0x5c9f56,_0x42c9ad){_0x5c9f56=_0x5c9f56-0x0;var _0x2a726b=_0xa880[_0x5c9f56];return _0x2a726b;};'use strict';var util=require('util');var moment=require(_0x0a88('0x0'));var server=require('./server');var Realtime=require(_0x0a88('0x1'));var Report=require(_0x0a88('0x2'));var Acw=require(_0x0a88('0x3'));var Trigger=require(_0x0a88('0x4'));var Dialer=require('./dialer');var Preview=require(_0x0a88('0x5'));var Fax=require(_0x0a88('0x6'));var user=require(_0x0a88('0x7'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x0a88('0x8'));var voiceCallReport=require(_0x0a88('0x9'));var trunk=require(_0x0a88('0xa'));var trigger=require('./rpc/trigger');var template=require(_0x0a88('0xb'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x0a88('0xc'));var voiceExtension=require(_0x0a88('0xd'));var faxAccount=require(_0x0a88('0xe'));var zendesk=require(_0x0a88('0xf'));var salesforce=require(_0x0a88('0x10'));var sugarcrm=require(_0x0a88('0x11'));var freshdesk=require(_0x0a88('0x12'));var desk=require(_0x0a88('0x13'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x0a88('0x14'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x0a88('0x15'));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(_0x0a88('0x16'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x0a88('0x17')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x0a88('0x17')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x0a88('0x18')]()['then'](user[_0x0a88('0x19')]())[_0x0a88('0x1a')](realtime[_0x0a88('0x1b')]())[_0x0a88('0x1a')](user['getTelephones']())[_0x0a88('0x1a')](realtime[_0x0a88('0x1c')]())['then'](trunk['getTrunks']())[_0x0a88('0x1a')](realtime[_0x0a88('0x1d')]())[_0x0a88('0x1a')](voiceQueue[_0x0a88('0x1e')]())[_0x0a88('0x1a')](realtime['initVoiceQueues']())[_0x0a88('0x1a')](trigger['getTriggers']())['then'](realtime['initTriggers']())['then'](template['getTemplates']())[_0x0a88('0x1a')](realtime['initTemplates']())[_0x0a88('0x1a')](zendesk[_0x0a88('0x1f')]())['then'](realtime[_0x0a88('0x20')]())[_0x0a88('0x1a')](salesforce[_0x0a88('0x21')]())[_0x0a88('0x1a')](realtime[_0x0a88('0x22')]())[_0x0a88('0x1a')](sugarcrm[_0x0a88('0x23')]())[_0x0a88('0x1a')](realtime[_0x0a88('0x24')]())['then'](freshdesk['getFreshdeskAccounts']())['then'](realtime[_0x0a88('0x25')]())['then'](desk[_0x0a88('0x26')]())['then'](realtime[_0x0a88('0x27')]())['then'](zoho['getZohoAccounts']())[_0x0a88('0x1a')](realtime[_0x0a88('0x28')]())[_0x0a88('0x1a')](vtiger['getVtigerAccounts']())[_0x0a88('0x1a')](realtime['initVtigerAccounts']())[_0x0a88('0x1a')](freshsales[_0x0a88('0x29')]())[_0x0a88('0x1a')](realtime[_0x0a88('0x2a')]())[_0x0a88('0x1a')](servicenow[_0x0a88('0x2b')]())['then'](realtime[_0x0a88('0x2c')]())[_0x0a88('0x1a')](dynamics365[_0x0a88('0x2d')]())[_0x0a88('0x1a')](realtime['initDynamics365Accounts']())[_0x0a88('0x1a')](campaign[_0x0a88('0x2e')]())[_0x0a88('0x1a')](realtime[_0x0a88('0x2f')]())['then'](voiceExtension[_0x0a88('0x30')]())['then'](realtime[_0x0a88('0x31')]())[_0x0a88('0x1a')](faxAccount['getFaxAccounts']())[_0x0a88('0x1a')](realtime[_0x0a88('0x32')]())[_0x0a88('0x1a')](function(){return realtime;});}function initParams(){return Promise[_0x0a88('0x18')]()[_0x0a88('0x1a')](voiceQueueReport[_0x0a88('0x33')]())[_0x0a88('0x1a')](realtime[_0x0a88('0x34')]())[_0x0a88('0x1a')](cmHopperHistory[_0x0a88('0x35')]())[_0x0a88('0x1a')](realtime[_0x0a88('0x36')]())[_0x0a88('0x1a')](cmHopperHistory[_0x0a88('0x37')]())['then'](realtime[_0x0a88('0x38')]())[_0x0a88('0x1a')](voiceCallReport[_0x0a88('0x39')]())[_0x0a88('0x1a')](realtime[_0x0a88('0x3a')]())[_0x0a88('0x3b')](function(_0x556f97){logger['error'](_0x0a88('0x3c'),util[_0x0a88('0x3d')](_0x556f97,{'showHidden':![],'depth':null}));});}function main(){return server[_0x0a88('0x3e')](realtime,preview,fax)['then'](function(){return initRealtime();})[_0x0a88('0x1a')](function(){return initParams();})[_0x0a88('0x1a')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x0a88('0x3b')](function(_0x15e155){logger['error'](_0x0a88('0x3f'),util[_0x0a88('0x3d')](_0x15e155,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x1215=['then','getAgents','getTelephones','initTrunks','getVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','error','inspect','[index.js][main]','util','./realtime','./acw','./trigger','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','../../config/logger','ami','get','hour','resolve'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x1215,0x1b0));var _0x5121=function(_0xb46ca8,_0x4f87be){_0xb46ca8=_0xb46ca8-0x0;var _0x52ed62=_0x1215[_0xb46ca8];return _0x52ed62;};'use strict';var util=require(_0x5121('0x0'));var moment=require('moment');var server=require('./server');var Realtime=require(_0x5121('0x1'));var Report=require('./report');var Acw=require(_0x5121('0x2'));var Trigger=require(_0x5121('0x3'));var Dialer=require(_0x5121('0x4'));var Preview=require(_0x5121('0x5'));var Fax=require(_0x5121('0x6'));var user=require('./rpc/user');var voiceQueue=require(_0x5121('0x7'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x5121('0x8'));var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require(_0x5121('0x9'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x5121('0xa'));var faxAccount=require(_0x5121('0xb'));var zendesk=require(_0x5121('0xc'));var salesforce=require(_0x5121('0xd'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x5121('0xe'));var desk=require(_0x5121('0xf'));var zoho=require(_0x5121('0x10'));var vtiger=require(_0x5121('0x11'));var freshsales=require('./rpc/integrations/freshsales');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(_0x5121('0x12'))(_0x5121('0x13'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x5121('0x14')](_0x5121('0x15'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x5121('0x15'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x5121('0x16')]()[_0x5121('0x17')](user[_0x5121('0x18')]())[_0x5121('0x17')](realtime['initAgents']())['then'](user[_0x5121('0x19')]())[_0x5121('0x17')](realtime['initTelephones']())['then'](trunk['getTrunks']())['then'](realtime[_0x5121('0x1a')]())[_0x5121('0x17')](voiceQueue[_0x5121('0x1b')]())[_0x5121('0x17')](realtime['initVoiceQueues']())['then'](trigger[_0x5121('0x1c')]())[_0x5121('0x17')](realtime['initTriggers']())['then'](template[_0x5121('0x1d')]())[_0x5121('0x17')](realtime[_0x5121('0x1e')]())['then'](zendesk[_0x5121('0x1f')]())[_0x5121('0x17')](realtime[_0x5121('0x20')]())[_0x5121('0x17')](salesforce['getSalesforceAccounts']())[_0x5121('0x17')](realtime[_0x5121('0x21')]())[_0x5121('0x17')](sugarcrm[_0x5121('0x22')]())[_0x5121('0x17')](realtime[_0x5121('0x23')]())[_0x5121('0x17')](freshdesk[_0x5121('0x24')]())['then'](realtime[_0x5121('0x25')]())[_0x5121('0x17')](desk[_0x5121('0x26')]())['then'](realtime[_0x5121('0x27')]())[_0x5121('0x17')](zoho['getZohoAccounts']())['then'](realtime[_0x5121('0x28')]())[_0x5121('0x17')](vtiger[_0x5121('0x29')]())[_0x5121('0x17')](realtime[_0x5121('0x2a')]())[_0x5121('0x17')](freshsales['getFreshsalesAccounts']())[_0x5121('0x17')](realtime[_0x5121('0x2b')]())[_0x5121('0x17')](servicenow[_0x5121('0x2c')]())[_0x5121('0x17')](realtime[_0x5121('0x2d')]())[_0x5121('0x17')](dynamics365[_0x5121('0x2e')]())[_0x5121('0x17')](realtime[_0x5121('0x2f')]())[_0x5121('0x17')](campaign[_0x5121('0x30')]())[_0x5121('0x17')](realtime[_0x5121('0x31')]())[_0x5121('0x17')](voiceExtension[_0x5121('0x32')]())[_0x5121('0x17')](realtime[_0x5121('0x33')]())[_0x5121('0x17')](faxAccount[_0x5121('0x34')]())[_0x5121('0x17')](realtime[_0x5121('0x35')]())[_0x5121('0x17')](function(){return realtime;});}function initParams(){return Promise[_0x5121('0x16')]()[_0x5121('0x17')](voiceQueueReport[_0x5121('0x36')]())[_0x5121('0x17')](realtime[_0x5121('0x37')]())[_0x5121('0x17')](cmHopperHistory[_0x5121('0x38')]())['then'](realtime[_0x5121('0x39')]())[_0x5121('0x17')](cmHopperHistory[_0x5121('0x3a')]())[_0x5121('0x17')](realtime[_0x5121('0x3b')]())[_0x5121('0x17')](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0x5121('0x3c')]())[_0x5121('0x3d')](function(_0x12bedb){logger[_0x5121('0x3e')]('[index.js][initParams]',util[_0x5121('0x3f')](_0x12bedb,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)['then'](function(){return initRealtime();})[_0x5121('0x17')](function(){return initParams();})[_0x5121('0x17')](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x3d5bda){logger[_0x5121('0x3e')](_0x5121('0x40'),util['inspect'](_0x3d5bda,{'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 3d63f6e..36acf24 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 _0xb345=['prototype','updateStatusRealtime','toLowerCase','inuse','talking','statePause','toNumber','format','name','fullname','voiceStatusQueue','user:%s','emit','user:save','exports','lodash','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','email','accountcode','state','unknown','stateTime','status','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xb345,0x15c));var _0x5b34=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xb345[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x5b34('0x0'));var util=require('util');var moment=require('moment');var md5=require(_0x5b34('0x1'));var Redis=require(_0x5b34('0x2'));var config=require(_0x5b34('0x3'));config['redis']=_['defaults'](config[_0x5b34('0x4')],{'host':_0x5b34('0x5'),'port':0x18eb});var io=require(_0x5b34('0x6'))(new Redis(config[_0x5b34('0x4')]));function Agent(_0x5f5495){this['id']=_0x5f5495['id']||0x0;this['name']=_0x5f5495['name']||'';this[_0x5b34('0x7')]=_0x5f5495['email']||'';this[_0x5b34('0x8')]=_0x5f5495[_0x5b34('0x8')]||'';this['fullname']=_0x5f5495['fullname']||'';this[_0x5b34('0x9')]=_0x5b34('0xa');this[_0x5b34('0xb')]=0x0;this[_0x5b34('0xc')]=_0x5b34('0xa');this['address']='';this[_0x5b34('0xd')]='';this[_0x5b34('0xe')]='';this[_0x5b34('0xf')]='';this[_0x5b34('0x10')]=_0x5f5495[_0x5b34('0x10')]||![];this[_0x5b34('0x11')]=_0x5b34('0xa');this[_0x5b34('0x12')]=0x0;this[_0x5b34('0x13')]='';this['voiceStatusQueue']='';this[_0x5b34('0x14')]=![];this[_0x5b34('0x15')]=![];this['md5']='';}Agent[_0x5b34('0x16')][_0x5b34('0x17')]=function(_0x46b391){var _0x3db2fa;if(_0x46b391&&_0x46b391[_0x5b34('0x9')]){_0x3db2fa=_0x46b391[_0x5b34('0x9')][_0x5b34('0x18')]();switch(_0x3db2fa){case'not_inuse':_0x3db2fa='idle';break;case _0x5b34('0x19'):_0x3db2fa=_0x5b34('0x1a');break;}}if(_0x3db2fa&&this[_0x5b34('0x11')]!==_0x3db2fa||_0x46b391[_0x5b34('0x1b')]){this[_0x5b34('0x12')]=_[_0x5b34('0x1c')](moment()[_0x5b34('0x1d')]('x'));}if(_0x3db2fa){this[_0x5b34('0x11')]=_0x3db2fa;}var _0x164942={'id':this['id'],'name':this[_0x5b34('0x1e')],'email':this[_0x5b34('0x7')],'accountcode':this['accountcode'],'fullname':this[_0x5b34('0x1f')],'state':this[_0x5b34('0x9')],'stateTime':this[_0x5b34('0xb')],'status':this[_0x5b34('0xc')],'address':this['address'],'online':this[_0x5b34('0x10')],'voiceStatus':this[_0x5b34('0x11')],'voiceStatusTime':this[_0x5b34('0x12')],'voiceStatusCallerIdNumber':this[_0x5b34('0x13')],'voiceStatusQueue':this[_0x5b34('0x20')],'interface':this[_0x5b34('0xf')],'onhold':this[_0x5b34('0x14')]};var _0x3929e8=md5(JSON['stringify'](_0x164942));if(this[_0x5b34('0x1')]!==_0x3929e8){this[_0x5b34('0x1')]=_0x3929e8;io['to'](util[_0x5b34('0x1d')](_0x5b34('0x21'),_0x164942[_0x5b34('0x1e')]))[_0x5b34('0x22')](_0x5b34('0x23'),_0x164942);io[_0x5b34('0x22')]('user:presence',_0x164942);}};module[_0x5b34('0x24')]=Agent; \ No newline at end of file +var _0x0f3e=['status','unknown','address','phone','mobile','interface','online','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','updateStatusRealtime','not_inuse','idle','talking','voiceStatus','statePause','toNumber','onhold','stringify','format','user:%s','user:save','emit','user:presence','exports','util','moment','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','stateTime'];(function(_0x2f8b74,_0x550f71){var _0x1b6a96=function(_0x55ac51){while(--_0x55ac51){_0x2f8b74['push'](_0x2f8b74['shift']());}};_0x1b6a96(++_0x550f71);}(_0x0f3e,0x92));var _0xe0f3=function(_0x272e71,_0x3aeff4){_0x272e71=_0x272e71-0x0;var _0x2f1ff3=_0x0f3e[_0x272e71];return _0x2f1ff3;};'use strict';var _=require('lodash');var util=require(_0xe0f3('0x0'));var moment=require(_0xe0f3('0x1'));var md5=require(_0xe0f3('0x2'));var Redis=require(_0xe0f3('0x3'));var config=require('../../../config/environment');config[_0xe0f3('0x4')]=_[_0xe0f3('0x5')](config[_0xe0f3('0x4')],{'host':_0xe0f3('0x6'),'port':0x18eb});var io=require(_0xe0f3('0x7'))(new Redis(config[_0xe0f3('0x4')]));function Agent(_0x5a8357){this['id']=_0x5a8357['id']||0x0;this['name']=_0x5a8357[_0xe0f3('0x8')]||'';this[_0xe0f3('0x9')]=_0x5a8357[_0xe0f3('0x9')]||'';this[_0xe0f3('0xa')]=_0x5a8357[_0xe0f3('0xa')]||'';this[_0xe0f3('0xb')]=_0x5a8357['fullname']||'';this[_0xe0f3('0xc')]='unknown';this[_0xe0f3('0xd')]=0x0;this[_0xe0f3('0xe')]=_0xe0f3('0xf');this[_0xe0f3('0x10')]='';this[_0xe0f3('0x11')]='';this[_0xe0f3('0x12')]='';this[_0xe0f3('0x13')]='';this[_0xe0f3('0x14')]=_0x5a8357['online']||![];this['voiceStatus']=_0xe0f3('0xf');this[_0xe0f3('0x15')]=0x0;this[_0xe0f3('0x16')]='';this[_0xe0f3('0x17')]='';this['onhold']=![];this[_0xe0f3('0x18')]=![];this[_0xe0f3('0x2')]='';}Agent['prototype'][_0xe0f3('0x19')]=function(_0xd61883){var _0x325442;if(_0xd61883&&_0xd61883['state']){_0x325442=_0xd61883[_0xe0f3('0xc')]['toLowerCase']();switch(_0x325442){case _0xe0f3('0x1a'):_0x325442=_0xe0f3('0x1b');break;case'inuse':_0x325442=_0xe0f3('0x1c');break;}}if(_0x325442&&this[_0xe0f3('0x1d')]!==_0x325442||_0xd61883[_0xe0f3('0x1e')]){this['voiceStatusTime']=_[_0xe0f3('0x1f')](moment()['format']('x'));}if(_0x325442){this[_0xe0f3('0x1d')]=_0x325442;}var _0x23eae3={'id':this['id'],'name':this[_0xe0f3('0x8')],'email':this[_0xe0f3('0x9')],'accountcode':this[_0xe0f3('0xa')],'fullname':this['fullname'],'state':this[_0xe0f3('0xc')],'stateTime':this['stateTime'],'status':this['status'],'address':this[_0xe0f3('0x10')],'online':this[_0xe0f3('0x14')],'voiceStatus':this[_0xe0f3('0x1d')],'voiceStatusTime':this[_0xe0f3('0x15')],'voiceStatusCallerIdNumber':this[_0xe0f3('0x16')],'voiceStatusQueue':this[_0xe0f3('0x17')],'interface':this[_0xe0f3('0x13')],'onhold':this[_0xe0f3('0x20')]};var _0x535f11=md5(JSON[_0xe0f3('0x21')](_0x23eae3));if(this['md5']!==_0x535f11){this[_0xe0f3('0x2')]=_0x535f11;io['to'](util[_0xe0f3('0x22')](_0xe0f3('0x23'),_0x23eae3[_0xe0f3('0x8')]))['emit'](_0xe0f3('0x24'),_0x23eae3);io[_0xe0f3('0x25')](_0xe0f3('0x26'),_0x23eae3);}};module[_0xe0f3('0x27')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 5b76bb5..ac8b814 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 _0xcd31=['sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message'];(function(_0x47b15f,_0x103e93){var _0x55bf25=function(_0x51fe7f){while(--_0x51fe7f){_0x47b15f['push'](_0x47b15f['shift']());}};_0x55bf25(++_0x103e93);}(_0xcd31,0x1a0));var _0x1cd3=function(_0x11c2b7,_0x2e2717){_0x11c2b7=_0x11c2b7-0x0;var _0x20631f=_0xcd31[_0x11c2b7];return _0x20631f;};'use strict';function Campaign(_0x167ce0){this['id']=_0x167ce0['id']||0x0;this[_0x1cd3('0x0')]=_0x167ce0[_0x1cd3('0x0')]||'';this[_0x1cd3('0x1')]=_0x167ce0[_0x1cd3('0x1')]||_0x1cd3('0x2');this[_0x1cd3('0x3')]=0x0;this[_0x1cd3('0x4')]=0x0;this[_0x1cd3('0x5')]=0x0;this[_0x1cd3('0x6')]=0x0;this[_0x1cd3('0x7')]='';this[_0x1cd3('0x8')]=!![];this['active']=_0x167ce0[_0x1cd3('0x9')];this[_0x1cd3('0xa')]=_0x167ce0[_0x1cd3('0xa')];this[_0x1cd3('0xb')]=_0x167ce0[_0x1cd3('0xb')]||null;this[_0x1cd3('0xc')]=_0x167ce0[_0x1cd3('0xc')]?_0x167ce0[_0x1cd3('0xc')]:null;this[_0x1cd3('0xd')]=_0x167ce0['dialOriginateCallerIdName'];this[_0x1cd3('0xe')]=_0x167ce0[_0x1cd3('0xe')];this['dialOriginateTimeout']=_0x167ce0[_0x1cd3('0xf')]||0x1e;this[_0x1cd3('0x10')]=_0x167ce0[_0x1cd3('0x10')];this[_0x1cd3('0x11')]=_0x167ce0['dialCongestionRetryFrequency'];this[_0x1cd3('0x12')]=_0x167ce0[_0x1cd3('0x12')];this['dialBusyRetryFrequency']=_0x167ce0[_0x1cd3('0x13')];this[_0x1cd3('0x14')]=_0x167ce0['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x167ce0[_0x1cd3('0x15')];this[_0x1cd3('0x16')]=_0x167ce0[_0x1cd3('0x16')];this[_0x1cd3('0x17')]=_0x167ce0[_0x1cd3('0x17')]||0x3;this[_0x1cd3('0x18')]=_0x167ce0[_0x1cd3('0x18')]||0x96;this[_0x1cd3('0x19')]=_0x167ce0[_0x1cd3('0x19')]||0x3;this[_0x1cd3('0x1a')]=_0x167ce0['dialDropRetryFrequency']||0x96;this[_0x1cd3('0x1b')]=_0x167ce0[_0x1cd3('0x1b')]||0x3;this[_0x1cd3('0x1c')]=_0x167ce0[_0x1cd3('0x1c')]||0x96;this[_0x1cd3('0x1d')]=_0x167ce0[_0x1cd3('0x1d')]||0x3;this[_0x1cd3('0x1e')]=_0x167ce0[_0x1cd3('0x1e')]||0x96;this['dialAgentRejectMaxRetry']=_0x167ce0[_0x1cd3('0x1f')]||0x3;this[_0x1cd3('0x20')]=_0x167ce0[_0x1cd3('0x20')]||0x96;this[_0x1cd3('0x21')]=_0x167ce0['dialOrderByScheduledAt']||_0x1cd3('0x22');this[_0x1cd3('0x23')]=_0x167ce0[_0x1cd3('0x23')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x167ce0[_0x1cd3('0x24')]||undefined;this[_0x1cd3('0x25')]=_0x167ce0[_0x1cd3('0x25')]||undefined;this[_0x1cd3('0x26')]=_0x167ce0['TrunkBackup']?_0x167ce0[_0x1cd3('0x26')]:undefined;this[_0x1cd3('0x27')]=_0x167ce0[_0x1cd3('0x27')]?_0x167ce0[_0x1cd3('0x27')]:undefined;this[_0x1cd3('0x28')]=_0x167ce0['Interval']?_0x167ce0[_0x1cd3('0x28')]:undefined;this['SquareProject']=_0x167ce0[_0x1cd3('0x29')]?_0x167ce0['SquareProject']:undefined;this[_0x1cd3('0x2a')]=_0x167ce0[_0x1cd3('0x29')]?_0x167ce0[_0x1cd3('0x29')]['name']:undefined;this[_0x1cd3('0x2b')]=_0x167ce0[_0x1cd3('0x2b')]||![];this[_0x1cd3('0x2c')]=_0x167ce0[_0x1cd3('0x2c')];this[_0x1cd3('0x2d')]=_0x167ce0[_0x1cd3('0x2d')];this['dialAMDAfterGreetingSilence']=_0x167ce0[_0x1cd3('0x2e')];this[_0x1cd3('0x2f')]=_0x167ce0['dialAMDTotalAnalysisTime'];this[_0x1cd3('0x30')]=_0x167ce0['dialAMDMinWordLength'];this[_0x1cd3('0x31')]=_0x167ce0[_0x1cd3('0x31')];this[_0x1cd3('0x32')]=_0x167ce0[_0x1cd3('0x32')];this[_0x1cd3('0x33')]=_0x167ce0[_0x1cd3('0x33')];this[_0x1cd3('0x34')]=_0x167ce0['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file +var _0x0b71=['dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength'];(function(_0x69a3c1,_0x4dfbff){var _0x5cdf04=function(_0x4ade30){while(--_0x4ade30){_0x69a3c1['push'](_0x69a3c1['shift']());}};_0x5cdf04(++_0x4dfbff);}(_0x0b71,0x65));var _0x10b7=function(_0xaaec73,_0x3b0d5a){_0xaaec73=_0xaaec73-0x0;var _0xfa096e=_0x0b71[_0xaaec73];return _0xfa096e;};'use strict';function Campaign(_0x1fc8da){this['id']=_0x1fc8da['id']||0x0;this[_0x10b7('0x0')]=_0x1fc8da[_0x10b7('0x0')]||'';this[_0x10b7('0x1')]=_0x1fc8da[_0x10b7('0x1')]||_0x10b7('0x2');this[_0x10b7('0x3')]=0x0;this[_0x10b7('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x10b7('0x5')]=0x0;this[_0x10b7('0x6')]='';this[_0x10b7('0x7')]=!![];this['active']=_0x1fc8da[_0x10b7('0x8')];this['limitCalls']=_0x1fc8da[_0x10b7('0x9')];this['dialTimezone']=_0x1fc8da[_0x10b7('0xa')]||null;this[_0x10b7('0xb')]=_0x1fc8da['dialGlobalInterval']?_0x1fc8da[_0x10b7('0xb')]:null;this['dialOriginateCallerIdName']=_0x1fc8da['dialOriginateCallerIdName'];this[_0x10b7('0xc')]=_0x1fc8da[_0x10b7('0xc')];this[_0x10b7('0xd')]=_0x1fc8da['dialOriginateTimeout']||0x1e;this[_0x10b7('0xe')]=_0x1fc8da[_0x10b7('0xe')];this[_0x10b7('0xf')]=_0x1fc8da[_0x10b7('0xf')];this[_0x10b7('0x10')]=_0x1fc8da[_0x10b7('0x10')];this[_0x10b7('0x11')]=_0x1fc8da[_0x10b7('0x11')];this[_0x10b7('0x12')]=_0x1fc8da[_0x10b7('0x12')];this['dialNoAnswerRetryFrequency']=_0x1fc8da['dialNoAnswerRetryFrequency'];this[_0x10b7('0x13')]=_0x1fc8da[_0x10b7('0x13')];this[_0x10b7('0x14')]=_0x1fc8da[_0x10b7('0x14')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x1fc8da[_0x10b7('0x15')]||0x96;this[_0x10b7('0x16')]=_0x1fc8da[_0x10b7('0x16')]||0x3;this['dialDropRetryFrequency']=_0x1fc8da[_0x10b7('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0x1fc8da['dialAbandonedMaxRetry']||0x3;this[_0x10b7('0x18')]=_0x1fc8da['dialAbandonedRetryFrequency']||0x96;this[_0x10b7('0x19')]=_0x1fc8da[_0x10b7('0x19')]||0x3;this['dialMachineRetryFrequency']=_0x1fc8da[_0x10b7('0x1a')]||0x96;this[_0x10b7('0x1b')]=_0x1fc8da[_0x10b7('0x1b')]||0x3;this[_0x10b7('0x1c')]=_0x1fc8da[_0x10b7('0x1c')]||0x96;this[_0x10b7('0x1d')]=_0x1fc8da['dialOrderByScheduledAt']||'DESC';this[_0x10b7('0x1e')]=_0x1fc8da['dialPrefix']||undefined;this[_0x10b7('0x1f')]=_0x1fc8da[_0x10b7('0x1f')]||undefined;this['dialCutDigit']=_0x1fc8da['dialCutDigit']||undefined;this['TrunkBackup']=_0x1fc8da[_0x10b7('0x20')]?_0x1fc8da[_0x10b7('0x20')]:undefined;this[_0x10b7('0x21')]=_0x1fc8da[_0x10b7('0x21')]?_0x1fc8da[_0x10b7('0x21')]:undefined;this[_0x10b7('0x22')]=_0x1fc8da[_0x10b7('0x22')]?_0x1fc8da['Interval']:undefined;this[_0x10b7('0x23')]=_0x1fc8da[_0x10b7('0x23')]?_0x1fc8da[_0x10b7('0x23')]:undefined;this[_0x10b7('0x24')]=_0x1fc8da['SquareProject']?_0x1fc8da['SquareProject'][_0x10b7('0x0')]:undefined;this[_0x10b7('0x25')]=_0x1fc8da[_0x10b7('0x25')]||![];this[_0x10b7('0x26')]=_0x1fc8da[_0x10b7('0x26')];this['dialAMDGreeting']=_0x1fc8da[_0x10b7('0x27')];this[_0x10b7('0x28')]=_0x1fc8da[_0x10b7('0x28')];this[_0x10b7('0x29')]=_0x1fc8da['dialAMDTotalAnalysisTime'];this[_0x10b7('0x2a')]=_0x1fc8da[_0x10b7('0x2a')];this[_0x10b7('0x2b')]=_0x1fc8da[_0x10b7('0x2b')];this[_0x10b7('0x2c')]=_0x1fc8da[_0x10b7('0x2c')];this[_0x10b7('0x2d')]=_0x1fc8da['dialAMDSilenceThreshold'];this[_0x10b7('0x2e')]=_0x1fc8da['dialAMDMaximumWordLength'];}module[_0x10b7('0x2f')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 716e472..80aa3a3 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 _0x3256=['connectedlinenum','connectedlinename','accountcode','context','linkedid','exten','answered','endtime','lastapplication','duration','billableseconds','holdtime','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','destinationchannel','calleridnum'];(function(_0x27fccb,_0x58edcf){var _0x24cfb0=function(_0x1daaf8){while(--_0x1daaf8){_0x27fccb['push'](_0x27fccb['shift']());}};_0x24cfb0(++_0x58edcf);}(_0x3256,0xee));var _0x6325=function(_0x5a0185,_0x5801cb){_0x5a0185=_0x5a0185-0x0;var _0x434f6c=_0x3256[_0x5a0185];return _0x434f6c;};'use strict';function Channel(){this['starttime']=null;this['channel']='';this[_0x6325('0x0')]='';this[_0x6325('0x1')]=0x0;this['calleridname']='';this[_0x6325('0x2')]=undefined;this[_0x6325('0x3')]=undefined;this[_0x6325('0x4')]=0x0;this[_0x6325('0x5')]='';this['uniqueid']=0x0;this[_0x6325('0x6')]=0x0;this[_0x6325('0x7')]=0x0;this[_0x6325('0x8')]=![];this['answertime']=null;this[_0x6325('0x9')]=null;this['unmanaged']=![];this['abandoned']=![];this[_0x6325('0xa')]='';this['lastdata']='';this[_0x6325('0xb')]=0x0;this[_0x6325('0xc')]=0x0;this[_0x6325('0xd')]=0x0;this['type']=null;this['tag']=null;this[_0x6325('0xe')]=null;this[_0x6325('0xf')]=![];this[_0x6325('0x10')]=null;this[_0x6325('0x11')]=null;this[_0x6325('0x12')]=[];this[_0x6325('0x13')]=undefined;this[_0x6325('0x14')]=undefined;this[_0x6325('0x15')]=undefined;this[_0x6325('0x16')]=0x0;}module[_0x6325('0x17')]=Channel; \ No newline at end of file +var _0x08d3=['duration','type','tag','disposition','monitorFilename','queue','monitors','transfercalleridnum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','connectedlinename','accountcode','context','uniqueid','linkedid','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x08d3,0x119));var _0x308d=function(_0x5a53d8,_0x289696){_0x5a53d8=_0x5a53d8-0x0;var _0x58f920=_0x08d3[_0x5a53d8];return _0x58f920;};'use strict';function Channel(){this[_0x308d('0x0')]=null;this[_0x308d('0x1')]='';this[_0x308d('0x2')]='';this[_0x308d('0x3')]=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this[_0x308d('0x4')]=undefined;this[_0x308d('0x5')]=0x0;this[_0x308d('0x6')]='';this[_0x308d('0x7')]=0x0;this[_0x308d('0x8')]=0x0;this['exten']=0x0;this[_0x308d('0x9')]=![];this[_0x308d('0xa')]=null;this[_0x308d('0xb')]=null;this[_0x308d('0xc')]=![];this[_0x308d('0xd')]=![];this[_0x308d('0xe')]='';this[_0x308d('0xf')]='';this[_0x308d('0x10')]=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this[_0x308d('0x11')]=null;this[_0x308d('0x12')]=null;this[_0x308d('0x13')]=null;this['monitor']=![];this[_0x308d('0x14')]=null;this[_0x308d('0x15')]=null;this[_0x308d('0x16')]=[];this[_0x308d('0x17')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x308d('0x18')]=undefined;this[_0x308d('0x19')]=0x0;}module[_0x308d('0x1a')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index a91802b..e6b1fb2 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 _0x552f=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x552f,0x177));var _0xf552=function(_0x190ff6,_0x515cfd){_0x190ff6=_0x190ff6-0x0;var _0x5356d2=_0x552f[_0x190ff6];return _0x5356d2;};'use strict';function DeskAccount(_0x3fc407){this['id']=_0x3fc407['id']||0x0;this[_0xf552('0x0')]=_0x3fc407[_0xf552('0x0')]||'';this[_0xf552('0x1')]=_0x3fc407[_0xf552('0x1')]||'';this['remoteUri']=_0x3fc407[_0xf552('0x2')]||'';this[_0xf552('0x3')]=_0x3fc407[_0xf552('0x3')]||'';this[_0xf552('0x4')]=_0x3fc407[_0xf552('0x4')]||'';this['consumerKey']=_0x3fc407[_0xf552('0x5')]||'';this[_0xf552('0x6')]=_0x3fc407[_0xf552('0x6')]||'';this[_0xf552('0x7')]=_0x3fc407[_0xf552('0x7')]||'';this[_0xf552('0x8')]=_0x3fc407[_0xf552('0x8')]||'';this[_0xf552('0x9')]=_0x3fc407['type']||'';this[_0xf552('0xa')]=_0x3fc407[_0xf552('0xa')]||'';this[_0xf552('0xb')]=_0x3fc407[_0xf552('0xb')]||{};}module[_0xf552('0xc')]=DeskAccount; \ No newline at end of file +var _0xd98b=['username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name'];(function(_0x28f33f,_0x45b63b){var _0x3443be=function(_0x4b231b){while(--_0x4b231b){_0x28f33f['push'](_0x28f33f['shift']());}};_0x3443be(++_0x45b63b);}(_0xd98b,0xa8));var _0xbd98=function(_0x441dd4,_0x582db9){_0x441dd4=_0x441dd4-0x0;var _0x54ea8b=_0xd98b[_0x441dd4];return _0x54ea8b;};'use strict';function DeskAccount(_0x3e0c02){this['id']=_0x3e0c02['id']||0x0;this[_0xbd98('0x0')]=_0x3e0c02['name']||'';this[_0xbd98('0x1')]=_0x3e0c02['username']||'';this[_0xbd98('0x2')]=_0x3e0c02[_0xbd98('0x2')]||'';this[_0xbd98('0x3')]=_0x3e0c02['authType']||'';this[_0xbd98('0x4')]=_0x3e0c02[_0xbd98('0x4')]||'';this[_0xbd98('0x5')]=_0x3e0c02[_0xbd98('0x5')]||'';this[_0xbd98('0x6')]=_0x3e0c02[_0xbd98('0x6')]||'';this['token']=_0x3e0c02[_0xbd98('0x7')]||'';this[_0xbd98('0x8')]=_0x3e0c02[_0xbd98('0x8')]||'';this[_0xbd98('0x9')]=_0x3e0c02[_0xbd98('0x9')]||'';this[_0xbd98('0xa')]=_0x3e0c02[_0xbd98('0xa')]||'';this[_0xbd98('0xb')]=_0x3e0c02[_0xbd98('0xb')]||{};}module[_0xbd98('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index c0e4c04..e01a0aa 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 _0xcc85=['Configurations','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication'];(function(_0x3e1a64,_0x39a3c5){var _0x31d0a5=function(_0x369578){while(--_0x369578){_0x3e1a64['push'](_0x3e1a64['shift']());}};_0x31d0a5(++_0x39a3c5);}(_0xcc85,0xf4));var _0x5cc8=function(_0x2bc3f4,_0x470b26){_0x2bc3f4=_0x2bc3f4-0x0;var _0x14ac53=_0xcc85[_0x2bc3f4];return _0x14ac53;};'use strict';function Dynamics365Account(_0x2ce1c7){this['id']=_0x2ce1c7['id']||0x0;this[_0x5cc8('0x0')]=_0x2ce1c7[_0x5cc8('0x0')]||'';this[_0x5cc8('0x1')]=_0x2ce1c7[_0x5cc8('0x1')]||'';this[_0x5cc8('0x2')]=_0x2ce1c7[_0x5cc8('0x2')]||'';this[_0x5cc8('0x3')]=_0x2ce1c7[_0x5cc8('0x3')]||'';this[_0x5cc8('0x4')]=_0x2ce1c7[_0x5cc8('0x4')]||'';this[_0x5cc8('0x5')]=_0x2ce1c7[_0x5cc8('0x5')]||'';this[_0x5cc8('0x6')]=_0x2ce1c7[_0x5cc8('0x6')]||{};this[_0x5cc8('0x7')]=_0x2ce1c7['serverUrl']||'';this[_0x5cc8('0x8')]=_0x2ce1c7[_0x5cc8('0x8')]||![];this[_0x5cc8('0x9')]=_0x2ce1c7[_0x5cc8('0x9')]||{};this['CloudProvider']=_0x2ce1c7['CloudProvider']||{};}module[_0x5cc8('0xa')]=Dynamics365Account; \ No newline at end of file +var _0x5d33=['modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0x5d33,0x118));var _0x35d3=function(_0x14c17f,_0xb4b92f){_0x14c17f=_0x14c17f-0x0;var _0x23dadc=_0x5d33[_0x14c17f];return _0x23dadc;};'use strict';function Dynamics365Account(_0x40f14a){this['id']=_0x40f14a['id']||0x0;this['name']=_0x40f14a[_0x35d3('0x0')]||'';this[_0x35d3('0x1')]=_0x40f14a[_0x35d3('0x1')]||'';this[_0x35d3('0x2')]=_0x40f14a[_0x35d3('0x2')]||'';this[_0x35d3('0x3')]=_0x40f14a[_0x35d3('0x3')]||'';this['tenantId']=_0x40f14a[_0x35d3('0x4')]||'';this[_0x35d3('0x5')]=_0x40f14a[_0x35d3('0x5')]||'';this[_0x35d3('0x6')]=_0x40f14a['clientSecret']||{};this[_0x35d3('0x7')]=_0x40f14a[_0x35d3('0x7')]||'';this[_0x35d3('0x8')]=_0x40f14a[_0x35d3('0x8')]||![];this[_0x35d3('0x9')]=_0x40f14a[_0x35d3('0x9')]||{};this['CloudProvider']=_0x40f14a[_0x35d3('0xa')]||{};}module[_0x35d3('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 93517c6..59327df 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 _0x9893=['localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo'];(function(_0x3c3fbb,_0x5c1d30){var _0x56de35=function(_0x48f0a8){while(--_0x48f0a8){_0x3c3fbb['push'](_0x3c3fbb['shift']());}};_0x56de35(++_0x5c1d30);}(_0x9893,0x73));var _0x3989=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9893[_0x14add3];return _0x4a174f;};'use strict';function FaxAccount(_0x1642bb){this['id']=_0x1642bb['id']||0x0;this[_0x3989('0x0')]=_0x1642bb['name']||'';this[_0x3989('0x1')]=_0x1642bb[_0x3989('0x1')];this[_0x3989('0x2')]=_0x1642bb[_0x3989('0x2')];this[_0x3989('0x3')]=_0x1642bb['headerinfo'];this[_0x3989('0x4')]=_0x1642bb['localstationid'];this[_0x3989('0x5')]=_0x1642bb[_0x3989('0x5')]||0x960;this['maxrate']=_0x1642bb[_0x3989('0x6')]||0x3840;this['modem']=_0x1642bb[_0x3989('0x7')]||_0x3989('0x8');this['gateway']=_0x1642bb[_0x3989('0x9')]||'no';this[_0x3989('0xa')]=_0x1642bb[_0x3989('0xa')]||'no';this[_0x3989('0xb')]=_0x1642bb[_0x3989('0xb')]||0x1388;this[_0x3989('0xc')]=_0x1642bb['tech']||'SIP';this['Trunk']=_0x1642bb[_0x3989('0xd')]?_0x1642bb['Trunk']:undefined;this[_0x3989('0xe')]=_0x1642bb[_0x3989('0xe')];this[_0x3989('0xf')]=_0x1642bb[_0x3989('0xf')];}module[_0x3989('0x10')]=FaxAccount; \ No newline at end of file +var _0x7abd=['SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech'];(function(_0x44cb92,_0x59afa3){var _0x56b9e6=function(_0x2841e0){while(--_0x2841e0){_0x44cb92['push'](_0x44cb92['shift']());}};_0x56b9e6(++_0x59afa3);}(_0x7abd,0x16d));var _0xd7ab=function(_0x4cdb1e,_0x291f0d){_0x4cdb1e=_0x4cdb1e-0x0;var _0x1a978c=_0x7abd[_0x4cdb1e];return _0x1a978c;};'use strict';function FaxAccount(_0x155f4d){this['id']=_0x155f4d['id']||0x0;this['name']=_0x155f4d[_0xd7ab('0x0')]||'';this[_0xd7ab('0x1')]=_0x155f4d[_0xd7ab('0x1')];this[_0xd7ab('0x2')]=_0x155f4d['ecm'];this['headerinfo']=_0x155f4d[_0xd7ab('0x3')];this[_0xd7ab('0x4')]=_0x155f4d[_0xd7ab('0x4')];this[_0xd7ab('0x5')]=_0x155f4d['minrate']||0x960;this['maxrate']=_0x155f4d[_0xd7ab('0x6')]||0x3840;this['modem']=_0x155f4d[_0xd7ab('0x7')]||_0xd7ab('0x8');this[_0xd7ab('0x9')]=_0x155f4d[_0xd7ab('0x9')]||'no';this[_0xd7ab('0xa')]=_0x155f4d['faxdetect']||'no';this[_0xd7ab('0xb')]=_0x155f4d[_0xd7ab('0xb')]||0x1388;this[_0xd7ab('0xc')]=_0x155f4d['tech']||_0xd7ab('0xd');this[_0xd7ab('0xe')]=_0x155f4d[_0xd7ab('0xe')]?_0x155f4d[_0xd7ab('0xe')]:undefined;this[_0xd7ab('0xf')]=_0x155f4d[_0xd7ab('0xf')];this['key']=_0x155f4d[_0xd7ab('0x10')];}module[_0xd7ab('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index eeb3446..89b1e22 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 _0x52aa=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0xc27aef,_0x5bd885){var _0x20c546=function(_0x416ec4){while(--_0x416ec4){_0xc27aef['push'](_0xc27aef['shift']());}};_0x20c546(++_0x5bd885);}(_0x52aa,0x197));var _0xa52a=function(_0x4fc122,_0x17a61b){_0x4fc122=_0x4fc122-0x0;var _0x9d8bbd=_0x52aa[_0x4fc122];return _0x9d8bbd;};'use strict';function FreshdeskAccount(_0x228fde){this['id']=_0x228fde['id']||0x0;this['name']=_0x228fde[_0xa52a('0x0')]||'';this['username']=_0x228fde[_0xa52a('0x1')]||'';this[_0xa52a('0x2')]=_0x228fde[_0xa52a('0x3')]||'';this[_0xa52a('0x4')]=_0x228fde[_0xa52a('0x4')]||'';this[_0xa52a('0x5')]=_0x228fde[_0xa52a('0x5')]||'';this['Configurations']=_0x228fde[_0xa52a('0x6')]||{};}module[_0xa52a('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x1694=['token','remoteUri','serverUrl','Configurations','exports','name','apiKey'];(function(_0x852045,_0x2769f5){var _0x46b545=function(_0x56151c){while(--_0x56151c){_0x852045['push'](_0x852045['shift']());}};_0x46b545(++_0x2769f5);}(_0x1694,0x124));var _0x4169=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x1694[_0x4baae2];return _0x1a2285;};'use strict';function FreshdeskAccount(_0x2a4ad8){this['id']=_0x2a4ad8['id']||0x0;this[_0x4169('0x0')]=_0x2a4ad8['name']||'';this['username']=_0x2a4ad8['username']||'';this[_0x4169('0x1')]=_0x2a4ad8[_0x4169('0x2')]||'';this['remoteUri']=_0x2a4ad8[_0x4169('0x3')]||'';this[_0x4169('0x4')]=_0x2a4ad8['serverUrl']||'';this['Configurations']=_0x2a4ad8[_0x4169('0x5')]||{};}module[_0x4169('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 fa52cfb..eb2fc4a 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 _0xd43e=['serverUrl','Configurations','exports','name','username','apiKey','remoteUri'];(function(_0x30e65e,_0x4fe600){var _0x57ee8=function(_0xf7f605){while(--_0xf7f605){_0x30e65e['push'](_0x30e65e['shift']());}};_0x57ee8(++_0x4fe600);}(_0xd43e,0x88));var _0xed43=function(_0x4d2628,_0x10e350){_0x4d2628=_0x4d2628-0x0;var _0x38ad81=_0xd43e[_0x4d2628];return _0x38ad81;};'use strict';function FreshsalesAccount(_0xeeeef3){this['id']=_0xeeeef3['id']||0x0;this['name']=_0xeeeef3[_0xed43('0x0')]||'';this[_0xed43('0x1')]=_0xeeeef3[_0xed43('0x1')]||'';this[_0xed43('0x2')]=_0xeeeef3['token']||'';this['remoteUri']=_0xeeeef3[_0xed43('0x3')]||'';this[_0xed43('0x4')]=_0xeeeef3[_0xed43('0x4')]||'';this[_0xed43('0x5')]=_0xeeeef3['Configurations']||{};}module[_0xed43('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x0e76=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x5b2249,_0x128eef){var _0x5f3737=function(_0x418fd4){while(--_0x418fd4){_0x5b2249['push'](_0x5b2249['shift']());}};_0x5f3737(++_0x128eef);}(_0x0e76,0xc4));var _0x60e7=function(_0x2a3a1e,_0x391126){_0x2a3a1e=_0x2a3a1e-0x0;var _0x417a1c=_0x0e76[_0x2a3a1e];return _0x417a1c;};'use strict';function FreshsalesAccount(_0x412a52){this['id']=_0x412a52['id']||0x0;this['name']=_0x412a52['name']||'';this[_0x60e7('0x0')]=_0x412a52['username']||'';this[_0x60e7('0x1')]=_0x412a52[_0x60e7('0x2')]||'';this[_0x60e7('0x3')]=_0x412a52[_0x60e7('0x3')]||'';this[_0x60e7('0x4')]=_0x412a52['serverUrl']||'';this[_0x60e7('0x5')]=_0x412a52[_0x60e7('0x5')]||{};}module[_0x60e7('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index e2df37c..7222122 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 _0xf471=['queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinename','context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','routealias','mohtime','exports','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt'];(function(_0x3ec6ca,_0x16126d){var _0x565cb5=function(_0x158202){while(--_0x158202){_0x3ec6ca['push'](_0x3ec6ca['shift']());}};_0x565cb5(++_0x16126d);}(_0xf471,0x1db));var _0x1f47=function(_0x4e3fa1,_0x453772){_0x4e3fa1=_0x4e3fa1-0x0;var _0x509ccf=_0xf471[_0x4e3fa1];return _0x509ccf;};'use strict';function QueueReport(){this['type']=_0x1f47('0x0');this[_0x1f47('0x1')]='';this[_0x1f47('0x2')]='';this[_0x1f47('0x3')]='';this[_0x1f47('0x4')]='';this[_0x1f47('0x5')]=null;this[_0x1f47('0x6')]=null;this[_0x1f47('0x7')]=0x1;this[_0x1f47('0x8')]=0x1;this[_0x1f47('0x9')]=![];this[_0x1f47('0xa')]=null;this[_0x1f47('0xb')]=![];this[_0x1f47('0xc')]=null;this['queuecallerexit']=![];this[_0x1f47('0xd')]=null;this[_0x1f47('0xe')]=0x1;this[_0x1f47('0xf')]='';this['connectedlinenum']='';this[_0x1f47('0x10')]='';this['accountcode']='';this[_0x1f47('0x11')]='';this[_0x1f47('0x12')]='';this[_0x1f47('0x13')]='';this[_0x1f47('0x14')]=0x0;this[_0x1f47('0x15')]=![];this[_0x1f47('0x16')]='';this[_0x1f47('0x17')]='voice';this[_0x1f47('0x18')]=null;this[_0x1f47('0x19')]=0x0;this['variables']={};}module[_0x1f47('0x1a')]=QueueReport; \ No newline at end of file +var _0x4c06=['queuecallerexit','queuecallerexitAt','connectedlinenum','connectedlinename','accountcode','context','exten','priority','assigned','lastAssignedTo','motionChannel','routealias','variables','exports','type','inbound','uniqueid','calleridnum','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallercomplete','queuecallercompleteAt'];(function(_0x4d7379,_0x4b4e63){var _0x46d7cf=function(_0x53f5f0){while(--_0x53f5f0){_0x4d7379['push'](_0x4d7379['shift']());}};_0x46d7cf(++_0x4b4e63);}(_0x4c06,0x1d6));var _0x64c0=function(_0x58a4ac,_0x43fd42){_0x58a4ac=_0x58a4ac-0x0;var _0x545810=_0x4c06[_0x58a4ac];return _0x545810;};'use strict';function QueueReport(){this[_0x64c0('0x0')]=_0x64c0('0x1');this[_0x64c0('0x2')]='';this[_0x64c0('0x3')]='';this['calleridname']='';this['queue']='';this[_0x64c0('0x4')]=null;this[_0x64c0('0x5')]=null;this[_0x64c0('0x6')]=0x1;this['count']=0x1;this[_0x64c0('0x7')]=![];this['queuecallerabandonAt']=null;this[_0x64c0('0x8')]=![];this[_0x64c0('0x9')]=null;this[_0x64c0('0xa')]=![];this[_0x64c0('0xb')]=null;this['originalposition']=0x1;this['channel']='';this[_0x64c0('0xc')]='';this[_0x64c0('0xd')]='';this[_0x64c0('0xe')]='';this[_0x64c0('0xf')]='';this[_0x64c0('0x10')]='';this[_0x64c0('0x11')]='';this['holdtime']=0x0;this[_0x64c0('0x12')]=![];this[_0x64c0('0x13')]='';this[_0x64c0('0x14')]='voice';this[_0x64c0('0x15')]=null;this['mohtime']=0x0;this[_0x64c0('0x16')]={};}module[_0x64c0('0x17')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index df2a93f..c7ac08d 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 _0x6992=['name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x855405,_0xdd5895){var _0x5e3d6a=function(_0x2c6093){while(--_0x2c6093){_0x855405['push'](_0x855405['shift']());}};_0x5e3d6a(++_0xdd5895);}(_0x6992,0x168));var _0x2699=function(_0x12edc5,_0x1383f7){_0x12edc5=_0x12edc5-0x0;var _0xdb8db2=_0x6992[_0x12edc5];return _0xdb8db2;};'use strict';function SalesforceAccount(_0x4f5844){this['id']=_0x4f5844['id']||0x0;this[_0x2699('0x0')]=_0x4f5844[_0x2699('0x0')]||'';this[_0x2699('0x1')]=_0x4f5844[_0x2699('0x1')]||'';this[_0x2699('0x2')]=_0x4f5844[_0x2699('0x2')]||'';this[_0x2699('0x3')]=_0x4f5844[_0x2699('0x3')]||'';this['clientId']=_0x4f5844[_0x2699('0x4')]||'';this[_0x2699('0x5')]=_0x4f5844[_0x2699('0x5')]||'';this['securityToken']=_0x4f5844[_0x2699('0x6')]||'';this[_0x2699('0x7')]=_0x4f5844[_0x2699('0x7')]||_0x2699('0x8');this[_0x2699('0x9')]=_0x4f5844[_0x2699('0x9')]||'';this[_0x2699('0xa')]=_0x4f5844[_0x2699('0xa')]||{};}module[_0x2699('0xb')]=SalesforceAccount; \ No newline at end of file +var _0xcc5b=['serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x4cebf0,_0x1b2de0){var _0x5d869c=function(_0x518459){while(--_0x518459){_0x4cebf0['push'](_0x4cebf0['shift']());}};_0x5d869c(++_0x1b2de0);}(_0xcc5b,0x1e3));var _0xbcc5=function(_0x5f8d3b,_0xa35280){_0x5f8d3b=_0x5f8d3b-0x0;var _0x337d02=_0xcc5b[_0x5f8d3b];return _0x337d02;};'use strict';function SalesforceAccount(_0xedd65b){this['id']=_0xedd65b['id']||0x0;this[_0xbcc5('0x0')]=_0xedd65b['name']||'';this[_0xbcc5('0x1')]=_0xedd65b['username']||'';this[_0xbcc5('0x2')]=_0xedd65b['remoteUri']||'';this['password']=_0xedd65b[_0xbcc5('0x3')]||'';this['clientId']=_0xedd65b[_0xbcc5('0x4')]||'';this[_0xbcc5('0x5')]=_0xedd65b[_0xbcc5('0x5')]||'';this[_0xbcc5('0x6')]=_0xedd65b[_0xbcc5('0x6')]||'';this[_0xbcc5('0x7')]=_0xedd65b[_0xbcc5('0x7')]||_0xbcc5('0x8');this['serverUrl']=_0xedd65b[_0xbcc5('0x9')]||'';this[_0xbcc5('0xa')]=_0xedd65b['Configurations']||{};}module[_0xbcc5('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 955f57c..9c2f643 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 _0x55ce=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x1ec8d8,_0x1ecc22){var _0x284b0f=function(_0x14a794){while(--_0x14a794){_0x1ec8d8['push'](_0x1ec8d8['shift']());}};_0x284b0f(++_0x1ecc22);}(_0x55ce,0xd4));var _0xe55c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x55ce[_0x20a584];return _0x4b41a8;};'use strict';function ServicenowAccount(_0x3e7e09){this['id']=_0x3e7e09['id']||0x0;this[_0xe55c('0x0')]=_0x3e7e09[_0xe55c('0x0')]||'';this[_0xe55c('0x1')]=_0x3e7e09[_0xe55c('0x1')]||'';this[_0xe55c('0x2')]=_0x3e7e09[_0xe55c('0x2')]||'';this[_0xe55c('0x3')]=_0x3e7e09[_0xe55c('0x3')]||'';this[_0xe55c('0x4')]=_0x3e7e09[_0xe55c('0x4')]||'';this[_0xe55c('0x5')]=_0x3e7e09['Configurations']||{};}module[_0xe55c('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x4dad=['serverUrl','Configurations','name','password','remoteUri'];(function(_0x3c1122,_0x2a502b){var _0x2e2f8e=function(_0x193e1d){while(--_0x193e1d){_0x3c1122['push'](_0x3c1122['shift']());}};_0x2e2f8e(++_0x2a502b);}(_0x4dad,0x15b));var _0xd4da=function(_0x46b6a1,_0x5f75b7){_0x46b6a1=_0x46b6a1-0x0;var _0x428b88=_0x4dad[_0x46b6a1];return _0x428b88;};'use strict';function ServicenowAccount(_0x38c266){this['id']=_0x38c266['id']||0x0;this[_0xd4da('0x0')]=_0x38c266[_0xd4da('0x0')]||'';this['username']=_0x38c266['username']||'';this[_0xd4da('0x1')]=_0x38c266[_0xd4da('0x1')]||'';this[_0xd4da('0x2')]=_0x38c266[_0xd4da('0x2')]||'';this['serverUrl']=_0x38c266[_0xd4da('0x3')]||'';this[_0xd4da('0x4')]=_0x38c266['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index aaa1dd6..4dd9908 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 _0x6d00=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x4c8290,_0x4b0869){var _0x46c106=function(_0x5ef757){while(--_0x5ef757){_0x4c8290['push'](_0x4c8290['shift']());}};_0x46c106(++_0x4b0869);}(_0x6d00,0xab));var _0x06d0=function(_0xd8baf3,_0x238fd0){_0xd8baf3=_0xd8baf3-0x0;var _0x492838=_0x6d00[_0xd8baf3];return _0x492838;};'use strict';function SugarcrmAccount(_0x3a3e42){this['id']=_0x3a3e42['id']||0x0;this[_0x06d0('0x0')]=_0x3a3e42['name']||'';this[_0x06d0('0x1')]=_0x3a3e42[_0x06d0('0x1')]||'';this[_0x06d0('0x2')]=_0x3a3e42['password']||'';this[_0x06d0('0x3')]=_0x3a3e42[_0x06d0('0x3')]||'';this[_0x06d0('0x4')]=_0x3a3e42[_0x06d0('0x4')]||'';this['Configurations']=_0x3a3e42[_0x06d0('0x5')]||{};}module[_0x06d0('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xb9ce=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x5d57fb,_0x3683a5){var _0x5d9327=function(_0x2b1536){while(--_0x2b1536){_0x5d57fb['push'](_0x5d57fb['shift']());}};_0x5d9327(++_0x3683a5);}(_0xb9ce,0x11c));var _0xeb9c=function(_0x4f397b,_0x78337d){_0x4f397b=_0x4f397b-0x0;var _0x12e7a1=_0xb9ce[_0x4f397b];return _0x12e7a1;};'use strict';function SugarcrmAccount(_0x4849e7){this['id']=_0x4849e7['id']||0x0;this[_0xeb9c('0x0')]=_0x4849e7[_0xeb9c('0x0')]||'';this[_0xeb9c('0x1')]=_0x4849e7[_0xeb9c('0x1')]||'';this[_0xeb9c('0x2')]=_0x4849e7[_0xeb9c('0x2')]||'';this[_0xeb9c('0x3')]=_0x4849e7[_0xeb9c('0x3')]||'';this[_0xeb9c('0x4')]=_0x4849e7[_0xeb9c('0x4')]||'';this[_0xeb9c('0x5')]=_0x4849e7[_0xeb9c('0x5')]||{};}module[_0xeb9c('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 d3b9085..9ab2e5c 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 _0x7866=['stateTime','status','address','exports','name','accountcode','state','unknown'];(function(_0x18724a,_0x3fb130){var _0x3cfc0a=function(_0x2e1cf6){while(--_0x2e1cf6){_0x18724a['push'](_0x18724a['shift']());}};_0x3cfc0a(++_0x3fb130);}(_0x7866,0x114));var _0x6786=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x7866[_0x599f41];return _0x2e4d58;};'use strict';function Telephone(_0x175f08){this['id']=_0x175f08['id']||0x0;this[_0x6786('0x0')]=_0x175f08['name']||'';this[_0x6786('0x1')]=_0x175f08[_0x6786('0x1')]||'';this[_0x6786('0x2')]=_0x6786('0x3');this[_0x6786('0x4')]=0x0;this[_0x6786('0x5')]=_0x6786('0x3');this[_0x6786('0x6')]='';}module[_0x6786('0x7')]=Telephone; \ No newline at end of file +var _0x315f=['name','state','address'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x315f,0x174));var _0xf315=function(_0x1dfa63,_0x362bd4){_0x1dfa63=_0x1dfa63-0x0;var _0x26f2a9=_0x315f[_0x1dfa63];return _0x26f2a9;};'use strict';function Telephone(_0x5bc489){this['id']=_0x5bc489['id']||0x0;this['name']=_0x5bc489[_0xf315('0x0')]||'';this['accountcode']=_0x5bc489['accountcode']||'';this[_0xf315('0x1')]='unknown';this['stateTime']=0x0;this['status']='unknown';this[_0xf315('0x2')]='';}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 15ac1e5..10d355d 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(_0x18a059,_0x41fe86){var _0x7be951=function(_0x4bfb57){while(--_0x4bfb57){_0x18a059['push'](_0x18a059['shift']());}};_0x7be951(++_0x41fe86);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 _0xb10b=['name','html'];(function(_0x34809b,_0x2ce939){var _0x466cd4=function(_0x2fbe86){while(--_0x2fbe86){_0x34809b['push'](_0x34809b['shift']());}};_0x466cd4(++_0x2ce939);}(_0xb10b,0x12a));var _0xbb10=function(_0x2a2e72,_0x1de962){_0x2a2e72=_0x2a2e72-0x0;var _0x3cfb4a=_0xb10b[_0x2a2e72];return _0x3cfb4a;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 24fabc6..9f6425a 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 _0xb10b=['AllConditions','AnyConditions','Actions','exports','name','channel','status'];(function(_0x2eff68,_0x222e46){var _0x5cda1d=function(_0x4712e8){while(--_0x4712e8){_0x2eff68['push'](_0x2eff68['shift']());}};_0x5cda1d(++_0x222e46);}(_0xb10b,0x12a));var _0xbb10=function(_0x609988,_0x507944){_0x609988=_0x609988-0x0;var _0x159984=_0xb10b[_0x609988];return _0x159984;};'use strict';function Trigger(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'voice';this[_0xbb10('0x2')]=_0x13ce8d[_0xbb10('0x2')]||![];this[_0xbb10('0x3')]=_0x13ce8d[_0xbb10('0x3')]||[];this[_0xbb10('0x4')]=_0x13ce8d[_0xbb10('0x4')]||[];this['Actions']=_0x13ce8d[_0xbb10('0x5')]||[];}module[_0xbb10('0x6')]=Trigger; \ No newline at end of file +var _0xda2d=['channel','voice','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x50a902,_0x127447){var _0x44b05b=function(_0x531920){while(--_0x531920){_0x50a902['push'](_0x50a902['shift']());}};_0x44b05b(++_0x127447);}(_0xda2d,0x102));var _0xdda2=function(_0x255c48,_0x1de1a5){_0x255c48=_0x255c48-0x0;var _0x2917c8=_0xda2d[_0x255c48];return _0x2917c8;};'use strict';function Trigger(_0x2625ed){this['id']=_0x2625ed['id']||0x0;this[_0xdda2('0x0')]=_0x2625ed[_0xdda2('0x0')]||'';this[_0xdda2('0x1')]=_0x2625ed[_0xdda2('0x1')]||_0xdda2('0x2');this['status']=_0x2625ed['status']||![];this['AllConditions']=_0x2625ed[_0xdda2('0x3')]||[];this[_0xdda2('0x4')]=_0x2625ed[_0xdda2('0x4')]||[];this[_0xdda2('0x5')]=_0x2625ed[_0xdda2('0x5')]||[];}module[_0xdda2('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index f738cc5..b0ae631 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 _0xd7a2=['stateTime','registry','indexOf','host','port','domainport','refresh','stateRegistry','address','defaultuser','exports','active','name','unknown'];(function(_0xd4c04e,_0x33a428){var _0x509959=function(_0x40e531){while(--_0x40e531){_0xd4c04e['push'](_0xd4c04e['shift']());}};_0x509959(++_0x33a428);}(_0xd7a2,0x169));var _0x2d7a=function(_0x2eea1c,_0x555aae){_0x2eea1c=_0x2eea1c-0x0;var _0x55f270=_0xd7a2[_0x2eea1c];return _0x55f270;};'use strict';function Trunk(_0x400db7){this['id']=_0x400db7['id']||0x0;this[_0x2d7a('0x0')]=_0x400db7[_0x2d7a('0x0')]||![];this[_0x2d7a('0x1')]=_0x400db7[_0x2d7a('0x1')]||'';this['state']=_0x2d7a('0x2');this[_0x2d7a('0x3')]=0x0;this['status']=_0x2d7a('0x2');this[_0x2d7a('0x4')]=_0x400db7['registry']&&_0x400db7[_0x2d7a('0x4')][_0x2d7a('0x5')](':')?_0x400db7[_0x2d7a('0x4')]['split'](':')[0x0]:'';this[_0x2d7a('0x6')]='';this[_0x2d7a('0x7')]='';this['domain']='';this[_0x2d7a('0x8')]='';this[_0x2d7a('0x9')]='';this[_0x2d7a('0xa')]=_0x2d7a('0x2');this['registrationtime']='';this[_0x2d7a('0xb')]='';this[_0x2d7a('0xc')]=_0x400db7[_0x2d7a('0xc')]||'';}module[_0x2d7a('0xd')]=Trunk; \ No newline at end of file +var _0x664a=['registry','indexOf','split','host','domain','domainport','refresh','stateRegistry','address','defaultuser','exports','active','name','state','unknown','status'];(function(_0x3042c5,_0x36cb88){var _0x7cd140=function(_0x4cdcd8){while(--_0x4cdcd8){_0x3042c5['push'](_0x3042c5['shift']());}};_0x7cd140(++_0x36cb88);}(_0x664a,0xfb));var _0xa664=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x664a[_0xa464c9];return _0x3d73c4;};'use strict';function Trunk(_0x4ddaf3){this['id']=_0x4ddaf3['id']||0x0;this[_0xa664('0x0')]=_0x4ddaf3[_0xa664('0x0')]||![];this[_0xa664('0x1')]=_0x4ddaf3['name']||'';this[_0xa664('0x2')]=_0xa664('0x3');this['stateTime']=0x0;this[_0xa664('0x4')]=_0xa664('0x3');this[_0xa664('0x5')]=_0x4ddaf3[_0xa664('0x5')]&&_0x4ddaf3[_0xa664('0x5')][_0xa664('0x6')](':')?_0x4ddaf3[_0xa664('0x5')][_0xa664('0x7')](':')[0x0]:'';this[_0xa664('0x8')]='';this['port']='';this[_0xa664('0x9')]='';this[_0xa664('0xa')]='';this[_0xa664('0xb')]='';this[_0xa664('0xc')]='unknown';this['registrationtime']='';this[_0xa664('0xd')]='';this['defaultuser']=_0x4ddaf3[_0xa664('0xe')]||'';}module[_0xa664('0xf')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 4741306..c364a17 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 _0x6631=['mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x56e32e,_0x9eb2f6){var _0x2a757b=function(_0x50b7bc){while(--_0x50b7bc){_0x56e32e['push'](_0x56e32e['shift']());}};_0x2a757b(++_0x9eb2f6);}(_0x6631,0x11e));var _0x1663=function(_0x51834b,_0xe299b7){_0x51834b=_0x51834b-0x0;var _0x3ec0ae=_0x6631[_0x51834b];return _0x3ec0ae;};'use strict';function voiceExtension(_0x5710d7){this['id']=_0x5710d7['id']||0x0;this[_0x1663('0x0')]=_0x5710d7['exten']||'';this[_0x1663('0x1')]=_0x5710d7[_0x1663('0x1')]||'none';this['mandatoryDisposition']=_0x5710d7[_0x1663('0x2')]||![];}module[_0x1663('0x3')]=voiceExtension; \ No newline at end of file +var _0x7c83=['exten','recordingFormat'];(function(_0x9b0b5a,_0xabb2cb){var _0x5370c2=function(_0x5e1b30){while(--_0x5e1b30){_0x9b0b5a['push'](_0x9b0b5a['shift']());}};_0x5370c2(++_0xabb2cb);}(_0x7c83,0x1e8));var _0x37c8=function(_0x3dc7d1,_0x2508c4){_0x3dc7d1=_0x3dc7d1-0x0;var _0x160fb2=_0x7c83[_0x3dc7d1];return _0x160fb2;};'use strict';function voiceExtension(_0x55891a){this['id']=_0x55891a['id']||0x0;this[_0x37c8('0x0')]=_0x55891a[_0x37c8('0x0')]||'';this['recordingFormat']=_0x55891a[_0x37c8('0x1')]||'none';this['mandatoryDisposition']=_0x55891a['mandatoryDisposition']||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index da68144..3d908ee 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 _0xc17f=['sendMessageOneNotActive','message','statusMessage','originated','temp','dialGlobalInterval','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','wav','wav49','gsm','fewestcalls','leastrecent','linear','random','ringall','roundrobin','rrmemory','rrordered','wrandom','monitor_format','type','waiting','total','sumHoldTime','abandoned','busy','inUse','paused','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause'];(function(_0x303b5e,_0x4004a3){var _0x5573d8=function(_0x3e2ac1){while(--_0x3e2ac1){_0x303b5e['push'](_0x303b5e['shift']());}};_0x5573d8(++_0x4004a3);}(_0xc17f,0x155));var _0xfc17=function(_0x49afd6,_0x3e9cf1){_0x49afd6=_0x49afd6-0x0;var _0x19c69d=_0xc17f[_0x49afd6];return _0x19c69d;};'use strict';var monitorFormat={'wav':_0xfc17('0x0'),'wav49':_0xfc17('0x1'),'gsm':_0xfc17('0x2')};var strategy={'fewestcalls':_0xfc17('0x3'),'leastrecent':_0xfc17('0x4'),'linear':_0xfc17('0x5'),'random':_0xfc17('0x6'),'ringall':_0xfc17('0x7'),'rr':_0xfc17('0x8'),'rrmemory':_0xfc17('0x9'),'rrordered':_0xfc17('0xa'),'wrandom':_0xfc17('0xb')};function VoiceQueue(_0x4c4e96){this['id']=_0x4c4e96['id']||0x0;this['name']=_0x4c4e96['name']||'';this[_0xfc17('0xc')]=_0x4c4e96['monitor_format']||'';this[_0xfc17('0xd')]=_0x4c4e96[_0xfc17('0xd')]||'inbound';this[_0xfc17('0xe')]=0x0;this[_0xfc17('0xf')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this[_0xfc17('0x10')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0xfc17('0x11')]=0x0;this['available']=0x0;this[_0xfc17('0x12')]=0x0;this[_0xfc17('0x13')]=0x0;this['invalid']=0x0;this['loggedIn']=0x0;this['notInUse']=0x0;this['onHold']=0x0;this[_0xfc17('0x14')]=0x0;this['ringing']=0x0;this[_0xfc17('0x15')]=0x0;this[_0xfc17('0x16')]=0x0;this[_0xfc17('0x17')]=0x0;this[_0xfc17('0x18')]=0x0;this[_0xfc17('0x19')]=_0x4c4e96[_0xfc17('0x19')]||![];this[_0xfc17('0x1a')]=_0x4c4e96[_0xfc17('0x1a')]||0xa;this[_0xfc17('0x1b')]=_0x4c4e96[_0xfc17('0x1b')]||'no';this[_0xfc17('0x1c')]=!![];this[_0xfc17('0x1d')]='';this[_0xfc17('0x1e')]='';this[_0xfc17('0x1f')]=0x0;this[_0xfc17('0x20')]=0x0;this['dialTimezone']=_0x4c4e96['dialTimezone']||null;this[_0xfc17('0x21')]=_0x4c4e96[_0xfc17('0x21')]?_0x4c4e96[_0xfc17('0x21')]:null;this['dialActive']=_0x4c4e96['dialActive'];this[_0xfc17('0x22')]=_0x4c4e96[_0xfc17('0x22')]||'progressive';this[_0xfc17('0x23')]=_0x4c4e96[_0xfc17('0x23')]||0x0;this[_0xfc17('0x24')]=_0x4c4e96[_0xfc17('0x24')]||0x0;this['dialPowerLevel']=_0x4c4e96[_0xfc17('0x25')]||0x1;this['dialPredictiveOptimization']=_0x4c4e96[_0xfc17('0x26')]||_0xfc17('0x27');this[_0xfc17('0x28')]=_0x4c4e96[_0xfc17('0x28')]||0.03;this['dialPredictiveInterval']=_0x4c4e96[_0xfc17('0x29')]||0x258;this[_0xfc17('0x2a')]=_0x4c4e96[_0xfc17('0x2a')]||_0xfc17('0x2b');this['dialOriginateCallerIdNumber']=_0x4c4e96[_0xfc17('0x2c')]||_0xfc17('0x2b');this[_0xfc17('0x2d')]=_0x4c4e96[_0xfc17('0x2d')]||0x1e;this[_0xfc17('0x2e')]=_0x4c4e96[_0xfc17('0x2e')]||_0xfc17('0x2f');this[_0xfc17('0x30')]=_0x4c4e96['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x4c4e96[_0xfc17('0x31')]||undefined;this[_0xfc17('0x32')]=_0x4c4e96[_0xfc17('0x32')]||0x3;this[_0xfc17('0x33')]=_0x4c4e96['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0x4c4e96['dialBusyMaxRetry']||0x3;this[_0xfc17('0x34')]=_0x4c4e96[_0xfc17('0x34')]||0x96;this['dialNoAnswerMaxRetry']=_0x4c4e96[_0xfc17('0x35')]||0x3;this['dialNoAnswerRetryFrequency']=_0x4c4e96[_0xfc17('0x36')]||0x96;this[_0xfc17('0x37')]=_0x4c4e96[_0xfc17('0x37')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x4c4e96[_0xfc17('0x38')]||0x96;this['dialDropMaxRetry']=_0x4c4e96['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x4c4e96[_0xfc17('0x39')]||0x96;this[_0xfc17('0x3a')]=_0x4c4e96[_0xfc17('0x3a')]||0x3;this['dialAbandonedRetryFrequency']=_0x4c4e96[_0xfc17('0x3b')]||0x96;this['dialMachineMaxRetry']=_0x4c4e96['dialMachineMaxRetry']||0x3;this[_0xfc17('0x3c')]=_0x4c4e96[_0xfc17('0x3c')]||0x96;this[_0xfc17('0x3d')]=_0x4c4e96[_0xfc17('0x3d')]||0x3;this[_0xfc17('0x3e')]=_0x4c4e96[_0xfc17('0x3e')]||0x96;this[_0xfc17('0x3f')]=_0x4c4e96['callAdditionalPhoneAfterMin']||0x3;this[_0xfc17('0x40')]=_0x4c4e96[_0xfc17('0x40')]||0x4;this['Trunk']=_0x4c4e96[_0xfc17('0x41')]?_0x4c4e96[_0xfc17('0x41')]:undefined;this['TrunkBackup']=_0x4c4e96[_0xfc17('0x42')]?_0x4c4e96[_0xfc17('0x42')]:undefined;this[_0xfc17('0x43')]=_0x4c4e96[_0xfc17('0x43')]||undefined;this[_0xfc17('0x44')]=_0x4c4e96[_0xfc17('0x44')]?_0x4c4e96[_0xfc17('0x44')]:undefined;this[_0xfc17('0x45')]=_0x4c4e96[_0xfc17('0x45')]||_0xfc17('0x46');this[_0xfc17('0x47')]=_0x4c4e96['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x4c4e96[_0xfc17('0x48')]||undefined;this['strategy']=strategy[_0x4c4e96[_0xfc17('0x49')]];this[_0xfc17('0x4a')]=!![];this[_0xfc17('0x4b')]=_0x4c4e96['dialAMDActive']||![];this[_0xfc17('0x4c')]=_0x4c4e96[_0xfc17('0x4c')];this[_0xfc17('0x4d')]=_0x4c4e96['dialAMDGreeting'];this[_0xfc17('0x4e')]=_0x4c4e96['dialAMDAfterGreetingSilence'];this[_0xfc17('0x4f')]=_0x4c4e96[_0xfc17('0x4f')];this[_0xfc17('0x50')]=_0x4c4e96[_0xfc17('0x50')];this[_0xfc17('0x51')]=_0x4c4e96[_0xfc17('0x51')];this[_0xfc17('0x52')]=_0x4c4e96[_0xfc17('0x52')];this['dialAMDSilenceThreshold']=_0x4c4e96[_0xfc17('0x53')];this[_0xfc17('0x54')]=_0x4c4e96[_0xfc17('0x54')];this[_0xfc17('0x55')]=0x0;this['pTalking']=0x0;this[_0xfc17('0x56')]=_0x4c4e96['timeout'];this[_0xfc17('0x57')]=0x0;this[_0xfc17('0x58')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0xfc17('0x59')]=0x0;this[_0xfc17('0x5a')]=0x0;this[_0xfc17('0x5b')]=0x0;this[_0xfc17('0x5c')]=0x0;this[_0xfc17('0x5d')]=0x0;this[_0xfc17('0x5e')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xfc17('0x5f')]=0x0;this[_0xfc17('0x60')]=0x0;this[_0xfc17('0x61')]=0x0;this[_0xfc17('0x62')]=0x0;this[_0xfc17('0x63')]=undefined;this[_0xfc17('0x64')]=undefined;this[_0xfc17('0x65')]=undefined;this[_0xfc17('0x66')]=1.05;this[_0xfc17('0x67')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xfc17('0x68')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xfc17('0x69')]=0x0;this[_0xfc17('0x6a')]=0x0;this[_0xfc17('0x6b')]=0x0;this[_0xfc17('0x6c')]=_0x4c4e96[_0xfc17('0x6d')]||0x14;this[_0xfc17('0x6e')]=_0x4c4e96[_0xfc17('0x6d')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xfc17('0x6f')]=0x0;this[_0xfc17('0x70')]=0x1;this[_0xfc17('0x71')]=0x0;this['erlangCallToSecond']=0x0;this[_0xfc17('0x72')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x4c4e96[_0xfc17('0x73')]||0x1e;this[_0xfc17('0x74')]=_0x4c4e96['dialRecallInQueue']||![];this[_0xfc17('0x75')]=!!_0x4c4e96[_0xfc17('0x75')]||![];this['dialPreviewRecallmeReminder']=!!_0x4c4e96[_0xfc17('0x76')]||![];this['dialQueueProject2']=_0x4c4e96['dialQueueProject2']||undefined;this['dialAgiAfterHangupClient']=_0x4c4e96[_0xfc17('0x77')]||![];this[_0xfc17('0x78')]=_0x4c4e96['dialAgiAfterHangupAgent']||![];this[_0xfc17('0xc')]=monitorFormat[_0x4c4e96[_0xfc17('0xc')]]?monitorFormat[_0x4c4e96[_0xfc17('0xc')]]:undefined;this[_0xfc17('0x79')]=_0x4c4e96[_0xfc17('0x79')]||![];this[_0xfc17('0x7a')]=_0x4c4e96[_0xfc17('0x7a')]?_0x4c4e96[_0xfc17('0x7a')]:undefined;this['queueSummaryCountersUpdated']=![];}module['exports']=VoiceQueue; \ No newline at end of file +var _0x5a43=['unavailable','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','wav','wav49','gsm','fewestcalls','leastrecent','linear','random','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','abandoned','busy','inUse','invalid','notInUse','onHold','paused','ringing','talking'];(function(_0x2c541b,_0x281f54){var _0x1453bd=function(_0x39c2d6){while(--_0x39c2d6){_0x2c541b['push'](_0x2c541b['shift']());}};_0x1453bd(++_0x281f54);}(_0x5a43,0xf1));var _0x35a4=function(_0x2c180b,_0x51d396){_0x2c180b=_0x2c180b-0x0;var _0x590047=_0x5a43[_0x2c180b];return _0x590047;};'use strict';var monitorFormat={'wav':_0x35a4('0x0'),'wav49':_0x35a4('0x1'),'gsm':_0x35a4('0x2')};var strategy={'fewestcalls':_0x35a4('0x3'),'leastrecent':_0x35a4('0x4'),'linear':_0x35a4('0x5'),'random':_0x35a4('0x6'),'ringall':'ringall','rr':'roundrobin','rrmemory':'rrmemory','rrordered':'rrordered','wrandom':_0x35a4('0x7')};function VoiceQueue(_0x38c350){this['id']=_0x38c350['id']||0x0;this[_0x35a4('0x8')]=_0x38c350[_0x35a4('0x8')]||'';this[_0x35a4('0x9')]=_0x38c350[_0x35a4('0x9')]||'';this['type']=_0x38c350[_0x35a4('0xa')]||_0x35a4('0xb');this[_0x35a4('0xc')]=0x0;this[_0x35a4('0xd')]=0x0;this[_0x35a4('0xe')]=0x0;this[_0x35a4('0xf')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0x35a4('0x10')]=0x0;this['available']=0x0;this[_0x35a4('0x11')]=0x0;this[_0x35a4('0x12')]=0x0;this[_0x35a4('0x13')]=0x0;this['loggedIn']=0x0;this[_0x35a4('0x14')]=0x0;this[_0x35a4('0x15')]=0x0;this[_0x35a4('0x16')]=0x0;this[_0x35a4('0x17')]=0x0;this['ringInUse']=0x0;this[_0x35a4('0x18')]=0x0;this[_0x35a4('0x19')]=0x0;this['unknown']=0x0;this[_0x35a4('0x1a')]=_0x38c350['acw']||![];this[_0x35a4('0x1b')]=_0x38c350[_0x35a4('0x1b')]||0xa;this[_0x35a4('0x1c')]=_0x38c350[_0x35a4('0x1c')]||'no';this[_0x35a4('0x1d')]=!![];this[_0x35a4('0x1e')]='';this[_0x35a4('0x1f')]='';this[_0x35a4('0x20')]=0x0;this[_0x35a4('0x21')]=0x0;this['dialTimezone']=_0x38c350[_0x35a4('0x22')]||null;this[_0x35a4('0x23')]=_0x38c350[_0x35a4('0x23')]?_0x38c350[_0x35a4('0x23')]:null;this[_0x35a4('0x24')]=_0x38c350[_0x35a4('0x24')];this[_0x35a4('0x25')]=_0x38c350[_0x35a4('0x25')]||'progressive';this[_0x35a4('0x26')]=_0x38c350['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x38c350[_0x35a4('0x27')]||0x0;this[_0x35a4('0x28')]=_0x38c350[_0x35a4('0x28')]||0x1;this['dialPredictiveOptimization']=_0x38c350[_0x35a4('0x29')]||_0x35a4('0x2a');this[_0x35a4('0x2b')]=_0x38c350['dialPredictiveOptimizationPercentage']||0.03;this[_0x35a4('0x2c')]=_0x38c350[_0x35a4('0x2c')]||0x258;this['dialOriginateCallerIdName']=_0x38c350[_0x35a4('0x2d')]||_0x35a4('0x2e');this[_0x35a4('0x2f')]=_0x38c350[_0x35a4('0x2f')]||'anonymous';this['dialOriginateTimeout']=_0x38c350[_0x35a4('0x30')]||0x1e;this['dialQueueOptions']=_0x38c350[_0x35a4('0x31')]||_0x35a4('0x32');this[_0x35a4('0x33')]=_0x38c350[_0x35a4('0x33')]||0x3;this[_0x35a4('0x34')]=_0x38c350[_0x35a4('0x34')]||undefined;this['dialCongestionMaxRetry']=_0x38c350['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x38c350[_0x35a4('0x35')]||0x96;this[_0x35a4('0x36')]=_0x38c350['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x38c350[_0x35a4('0x37')]||0x96;this[_0x35a4('0x38')]=_0x38c350[_0x35a4('0x38')]||0x3;this[_0x35a4('0x39')]=_0x38c350['dialNoAnswerRetryFrequency']||0x96;this['dialNoSuchNumberMaxRetry']=_0x38c350['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x38c350[_0x35a4('0x3a')]||0x96;this[_0x35a4('0x3b')]=_0x38c350[_0x35a4('0x3b')]||0x3;this[_0x35a4('0x3c')]=_0x38c350[_0x35a4('0x3c')]||0x96;this[_0x35a4('0x3d')]=_0x38c350[_0x35a4('0x3d')]||0x3;this[_0x35a4('0x3e')]=_0x38c350[_0x35a4('0x3e')]||0x96;this[_0x35a4('0x3f')]=_0x38c350[_0x35a4('0x3f')]||0x3;this[_0x35a4('0x40')]=_0x38c350[_0x35a4('0x40')]||0x96;this[_0x35a4('0x41')]=_0x38c350[_0x35a4('0x41')]||0x3;this[_0x35a4('0x42')]=_0x38c350['dialAgentRejectRetryFrequency']||0x96;this[_0x35a4('0x43')]=_0x38c350[_0x35a4('0x43')]||0x3;this[_0x35a4('0x44')]=_0x38c350['dialGlobalMaxRetry']||0x4;this[_0x35a4('0x45')]=_0x38c350[_0x35a4('0x45')]?_0x38c350[_0x35a4('0x45')]:undefined;this['TrunkBackup']=_0x38c350['TrunkBackup']?_0x38c350[_0x35a4('0x46')]:undefined;this['dialPrefix']=_0x38c350[_0x35a4('0x47')]||undefined;this[_0x35a4('0x48')]=_0x38c350[_0x35a4('0x48')]?_0x38c350['Interval']:undefined;this['dialOrderByScheduledAt']=_0x38c350[_0x35a4('0x49')]||_0x35a4('0x4a');this[_0x35a4('0x4b')]=_0x38c350[_0x35a4('0x4b')]||undefined;this[_0x35a4('0x4c')]=_0x38c350[_0x35a4('0x4c')]||undefined;this[_0x35a4('0x4d')]=strategy[_0x38c350[_0x35a4('0x4d')]];this['queueStatusComplete']=!![];this['dialAMDActive']=_0x38c350[_0x35a4('0x4e')]||![];this[_0x35a4('0x4f')]=_0x38c350[_0x35a4('0x4f')];this[_0x35a4('0x50')]=_0x38c350[_0x35a4('0x50')];this['dialAMDAfterGreetingSilence']=_0x38c350[_0x35a4('0x51')];this['dialAMDTotalAnalysisTime']=_0x38c350[_0x35a4('0x52')];this['dialAMDMinWordLength']=_0x38c350[_0x35a4('0x53')];this[_0x35a4('0x54')]=_0x38c350[_0x35a4('0x54')];this[_0x35a4('0x55')]=_0x38c350[_0x35a4('0x55')];this[_0x35a4('0x56')]=_0x38c350['dialAMDSilenceThreshold'];this[_0x35a4('0x57')]=_0x38c350[_0x35a4('0x57')];this[_0x35a4('0x58')]=0x0;this[_0x35a4('0x59')]=0x0;this[_0x35a4('0x5a')]=_0x38c350[_0x35a4('0x5a')];this[_0x35a4('0x5b')]=0x0;this[_0x35a4('0x5c')]=0x0;this[_0x35a4('0x5d')]=0x0;this[_0x35a4('0x5e')]=0x0;this[_0x35a4('0x5f')]=0x0;this[_0x35a4('0x60')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x35a4('0x61')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x35a4('0x62')]=0x0;this[_0x35a4('0x63')]=0x0;this[_0x35a4('0x64')]=0x0;this[_0x35a4('0x65')]=0x0;this[_0x35a4('0x66')]=0x0;this[_0x35a4('0x67')]=undefined;this[_0x35a4('0x68')]=undefined;this[_0x35a4('0x69')]=undefined;this[_0x35a4('0x6a')]=1.05;this[_0x35a4('0x6b')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x35a4('0x6c')]=0x0;this[_0x35a4('0x6d')]=0x0;this[_0x35a4('0x6e')]=0x0;this[_0x35a4('0x6f')]=0x0;this[_0x35a4('0x70')]=0x0;this[_0x35a4('0x71')]=0x0;this[_0x35a4('0x72')]=_0x38c350['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x35a4('0x73')]=_0x38c350[_0x35a4('0x74')]||0xa;this[_0x35a4('0x75')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x35a4('0x76')]=0x1;this[_0x35a4('0x77')]=0x0;this[_0x35a4('0x78')]=0x0;this[_0x35a4('0x79')]=0x0;this[_0x35a4('0x7a')]=0x0;this[_0x35a4('0x7b')]=_0x38c350[_0x35a4('0x7b')]||0x1e;this['dialRecallInQueue']=_0x38c350[_0x35a4('0x7c')]||![];this['dialPreviewAutoRecallMe']=!!_0x38c350[_0x35a4('0x7d')]||![];this[_0x35a4('0x7e')]=!!_0x38c350[_0x35a4('0x7e')]||![];this[_0x35a4('0x7f')]=_0x38c350['dialQueueProject2']||undefined;this[_0x35a4('0x80')]=_0x38c350[_0x35a4('0x80')]||![];this[_0x35a4('0x81')]=_0x38c350[_0x35a4('0x81')]||![];this[_0x35a4('0x9')]=monitorFormat[_0x38c350[_0x35a4('0x9')]]?monitorFormat[_0x38c350[_0x35a4('0x9')]]:undefined;this[_0x35a4('0x82')]=_0x38c350[_0x35a4('0x82')]||![];this['mandatoryDispositionPause']=_0x38c350[_0x35a4('0x83')]?_0x38c350[_0x35a4('0x83')]:undefined;this['queueSummaryCountersUpdated']=![];}module[_0x35a4('0x84')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index ee9e57b..96f45f8 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 _0xc949=['erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','loggedin','callers','length','SIP/','online','includes','status','booked','keys','queue','dialer','xcally-motion-preview','some','updateReportFromOutboundQueue','outboundAnswerCallsDay','preview','exports','available','loggedInDb','paused','ringing','talking','answered','loggedIn','originated','outboundAbandonedCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','total','waiting','name','strategy','abandoned','busy','inUse','invalid','onHold','notInUse','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls'];(function(_0x26d776,_0x3d2f59){var _0x30dba1=function(_0x1beaaa){while(--_0x1beaaa){_0x26d776['push'](_0x26d776['shift']());}};_0x30dba1(++_0x3d2f59);}(_0xc949,0x181));var _0x9c94=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xc949[_0x491a7f];return _0x3d8f44;};'use strict';var INBOUND_COUNTERS=[_0x9c94('0x0'),'loggedIn',_0x9c94('0x1'),_0x9c94('0x2'),_0x9c94('0x3'),_0x9c94('0x4'),'waiting'];var OUTBOUND_COUNTERS=[_0x9c94('0x0'),_0x9c94('0x5'),'inUse',_0x9c94('0x6'),_0x9c94('0x1'),_0x9c94('0x7'),_0x9c94('0x8'),'outboundAnswerCallsDay',_0x9c94('0x9'),_0x9c94('0xa'),_0x9c94('0xb'),_0x9c94('0xc'),_0x9c94('0xd'),_0x9c94('0xe'),_0x9c94('0xf'),_0x9c94('0x10'),_0x9c94('0x2'),_0x9c94('0x11'),'talking',_0x9c94('0x12'),_0x9c94('0x13'),_0x9c94('0x14'),_0x9c94('0x15')];function VoiceQueueSummary(_0x2ce750){this['id']=_0x2ce750['id'];this[_0x9c94('0x16')]=_0x2ce750[_0x9c94('0x16')];this[_0x9c94('0x17')]=_0x2ce750[_0x9c94('0x17')];this[_0x9c94('0x18')]=_0x2ce750[_0x9c94('0x18')]||0x0;this[_0x9c94('0x5')]=_0x2ce750[_0x9c94('0x5')]||0x0;this[_0x9c94('0x0')]=_0x2ce750['available']||0x0;this[_0x9c94('0x19')]=_0x2ce750['busy']||0x0;this[_0x9c94('0x1a')]=_0x2ce750[_0x9c94('0x1a')]||0x0;this['invalid']=_0x2ce750[_0x9c94('0x1b')]||0x0;this['loggedIn']=_0x2ce750['loggedIn']||0x0;this[_0x9c94('0x1')]=_0x2ce750['loggedInDb']||0x0;this[_0x9c94('0x1c')]=_0x2ce750[_0x9c94('0x1c')]||0x0;this['notInUse']=_0x2ce750[_0x9c94('0x1d')]||0x0;this[_0x9c94('0x2')]=_0x2ce750[_0x9c94('0x2')]||0x0;this[_0x9c94('0x3')]=_0x2ce750[_0x9c94('0x3')]||0x0;this[_0x9c94('0x1e')]=_0x2ce750[_0x9c94('0x1e')];this['sumBillable']=_0x2ce750[_0x9c94('0x12')];this[_0x9c94('0x13')]=_0x2ce750['sumDuration'];this[_0x9c94('0x1f')]=_0x2ce750[_0x9c94('0x1f')]||0x0;this[_0x9c94('0x4')]=_0x2ce750[_0x9c94('0x4')]||0x0;this[_0x9c94('0x14')]=_0x2ce750[_0x9c94('0x14')]||0x0;this[_0x9c94('0x20')]=_0x2ce750[_0x9c94('0x20')];this[_0x9c94('0x21')]=_0x2ce750[_0x9c94('0x21')]||0x0;this[_0x9c94('0x22')]=_0x2ce750[_0x9c94('0x22')]||0x0;this[_0x9c94('0x23')]=_0x2ce750[_0x9c94('0x23')]||0x0;this['waiting']=_0x2ce750[_0x9c94('0x15')]||0x0;if(_0x2ce750[_0x9c94('0x20')]==='outbound'){this[_0x9c94('0x11')]=_0x2ce750[_0x9c94('0x11')]||0x0;this[_0x9c94('0x24')]=_0x2ce750[_0x9c94('0x24')];this[_0x9c94('0x25')]=_0x2ce750['dialMethod'];this[_0x9c94('0x26')]=_0x2ce750[_0x9c94('0x26')];this['dialOriginateCallerIdNumber']=_0x2ce750[_0x9c94('0x27')];this['dialOriginateTimeout']=_0x2ce750[_0x9c94('0x28')];this[_0x9c94('0x29')]=_0x2ce750[_0x9c94('0x29')];this[_0x9c94('0x2a')]=_0x2ce750[_0x9c94('0x2a')];this[_0x9c94('0x2b')]=_0x2ce750[_0x9c94('0x2b')];this['outboundAnswerCallsDay']=_0x2ce750['outboundAnswerCallsDay'];this[_0x9c94('0x9')]=_0x2ce750[_0x9c94('0x9')];this[_0x9c94('0xa')]=_0x2ce750['outboundBusyCallsDay'];this[_0x9c94('0xb')]=_0x2ce750['outboundCongestionCallsDay'];this[_0x9c94('0x2c')]=_0x2ce750[_0x9c94('0x2c')];this[_0x9c94('0x2d')]=_0x2ce750['outboundDropCallsDayCallersExit'];this['outboundDropCallsDayTimeout']=_0x2ce750[_0x9c94('0x2e')];this[_0x9c94('0xc')]=_0x2ce750[_0x9c94('0xc')];this['outboundNoSuchCallsDay']=_0x2ce750['outboundNoSuchCallsDay'];this['outboundOriginateFailureCallsDay']=_0x2ce750['outboundOriginateFailureCallsDay'];this[_0x9c94('0xe')]=_0x2ce750['outboundReCallsDay'];this[_0x9c94('0xf')]=_0x2ce750[_0x9c94('0xf')];this['outboundUnknownCallsDay']=_0x2ce750['outboundUnknownCallsDay'];this[_0x9c94('0x2f')]=_0x2ce750[_0x9c94('0x2f')];this[_0x9c94('0x30')]=_0x2ce750[_0x9c94('0x30')];this[_0x9c94('0x31')]=_0x2ce750[_0x9c94('0x31')];this[_0x9c94('0x32')]=_0x2ce750[_0x9c94('0x32')];this[_0x9c94('0x33')]=_0x2ce750[_0x9c94('0x33')];this[_0x9c94('0x34')]=_0x2ce750[_0x9c94('0x34')];this[_0x9c94('0x35')]=_0x2ce750[_0x9c94('0x35')];this[_0x9c94('0x36')]=_0x2ce750[_0x9c94('0x36')];this[_0x9c94('0x37')]=_0x2ce750[_0x9c94('0x37')];this['predictiveIntervalPauses']=_0x2ce750[_0x9c94('0x38')];this[_0x9c94('0x39')]=_0x2ce750[_0x9c94('0x39')];this[_0x9c94('0x3a')]=_0x2ce750[_0x9c94('0x3a')];this[_0x9c94('0x7')]=_0x2ce750[_0x9c94('0x7')];this['erlangCalls']=_0x2ce750[_0x9c94('0x3b')];this['erlangCallToSecond']=_0x2ce750[_0x9c94('0x3c')];this[_0x9c94('0x3d')]=_0x2ce750[_0x9c94('0x3d')];this[_0x9c94('0x3e')]=_0x2ce750['erlangBusyFactor'];this[_0x9c94('0x3f')]=_0x2ce750['startPredictive'];this[_0x9c94('0x40')]=_0x2ce750[_0x9c94('0x40')];this[_0x9c94('0x41')]=_0x2ce750['message'];this[_0x9c94('0x42')]=_0x2ce750['statusMessage'];}if(_0x2ce750[_0x9c94('0x43')]){this['Trunk']={'id':_0x2ce750['Trunk']['id'],'name':_0x2ce750[_0x9c94('0x43')][_0x9c94('0x16')],'active':_0x2ce750[_0x9c94('0x43')][_0x9c94('0x44')],'callerid':_0x2ce750['Trunk'][_0x9c94('0x45')]};}}VoiceQueueSummary[_0x9c94('0x46')][_0x9c94('0x47')]=function(_0x360960,_0x57ab57,_0x1039e8,_0x365e7e){this['loggedInDb']=0x0;this[_0x9c94('0x4')]=0x0;this[_0x9c94('0x2')]=0x0;this[_0x9c94('0x22')]=0x0;this['notInUse']=0x0;this['inUse']=0x0;this[_0x9c94('0x19')]=0x0;this[_0x9c94('0x1b')]=0x0;this[_0x9c94('0x21')]=0x0;this[_0x9c94('0x3')]=0x0;this[_0x9c94('0x1e')]=0x0;this[_0x9c94('0x1c')]=0x0;if(_0x1039e8){if(_0x1039e8[_0x9c94('0x0')]){this[_0x9c94('0x0')]=Number(_0x1039e8[_0x9c94('0x0')]);}if(_0x1039e8[_0x9c94('0x48')]){this[_0x9c94('0x6')]=Number(_0x1039e8['loggedin']);}if(_0x1039e8[_0x9c94('0x49')]){this['waiting']=Number(_0x1039e8[_0x9c94('0x49')]);}}for(var _0x311f72=0x0;_0x311f72<_0x360960[_0x9c94('0x4a')];_0x311f72++){var _0xd0b3a9=_0x57ab57[_0x9c94('0x4b')+_0x360960[_0x311f72][_0x9c94('0x16')]];if(_0xd0b3a9&&_0xd0b3a9[_0x9c94('0x4c')]){this['loggedInDb']+=0x1;}if(_0x360960[_0x311f72]['incall']==='1'){this[_0x9c94('0x4')]+=0x1;}if(_0x360960[_0x311f72][_0x9c94('0x2')]==='1'&&!['2','7','8'][_0x9c94('0x4d')](_0x360960[_0x311f72]['status'])){this[_0x9c94('0x2')]+=0x1;}switch(_0x360960[_0x311f72][_0x9c94('0x4e')]){case'0':this['unknown']+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0x9c94('0x1b')]+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this[_0x9c94('0x1e')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this[_0x9c94('0x25')]===_0x9c94('0x4f')){var _0x8a41fc=Object[_0x9c94('0x50')](_0x365e7e);for(var _0x22eaa4=0x0;_0x22eaa4<_0x8a41fc['length'];_0x22eaa4++){var _0x33ccef=_0x8a41fc[_0x22eaa4];var _0x475feb=_0x365e7e[_0x33ccef];if(_0x475feb[_0x9c94('0x51')]===this[_0x9c94('0x16')]&&_0x475feb[_0x9c94('0x20')]===_0x9c94('0x52')&&_0x475feb['exten']===_0x9c94('0x53')){this['talking']+=0x1;}}if(this[_0x9c94('0x4')]>this[_0x9c94('0x1a')]){this[_0x9c94('0x4')]=this['inUse'];}this[_0x9c94('0x11')]=0x0;}return this;};VoiceQueueSummary[_0x9c94('0x46')]['compareToInboundQueue']=function(_0x3a4bc6){var _0x58a683=![];if(_0x3a4bc6){_0x58a683=INBOUND_COUNTERS[_0x9c94('0x54')](function(_0x3aa1dd){return this[_0x3aa1dd]!==_0x3a4bc6[_0x3aa1dd];},this);}return _0x58a683;};VoiceQueueSummary['prototype']['compareToOutboundQueue']=function(_0x2d80ed){var _0x4c5cdc=![];var _0x472107=![];var _0x3f8448=![];if(_0x2d80ed){_0x4c5cdc=this[_0x9c94('0x25')]!==_0x2d80ed[_0x9c94('0x25')]||this['dialActive']!==_0x2d80ed[_0x9c94('0x24')]||this[_0x9c94('0x41')]!==_0x2d80ed['message']||this['statusMessage']!==_0x2d80ed[_0x9c94('0x42')];_0x472107=OUTBOUND_COUNTERS[_0x9c94('0x54')](function(_0x1c2ae8){return this[_0x1c2ae8]!==_0x2d80ed[_0x1c2ae8];},this);if(this[_0x9c94('0x43')]&&_0x2d80ed[_0x9c94('0x43')]){_0x3f8448=this[_0x9c94('0x43')]['name']!==_0x2d80ed[_0x9c94('0x43')][_0x9c94('0x16')]||this[_0x9c94('0x43')][_0x9c94('0x44')]!==_0x2d80ed[_0x9c94('0x43')][_0x9c94('0x44')];}}return _0x4c5cdc||_0x472107||_0x3f8448;};VoiceQueueSummary['prototype'][_0x9c94('0x55')]=function(_0x4bf026){this[_0x9c94('0x5')]=_0x4bf026[_0x9c94('0x5')];this[_0x9c94('0x41')]=_0x4bf026['message'];this[_0x9c94('0x42')]=_0x4bf026['statusMessage'];this['originated']=_0x4bf026[_0x9c94('0x7')];this[_0x9c94('0x8')]=_0x4bf026['outboundAbandonedCallsDay'];this[_0x9c94('0x56')]=_0x4bf026[_0x9c94('0x56')];this[_0x9c94('0x9')]=_0x4bf026[_0x9c94('0x9')];this[_0x9c94('0xa')]=_0x4bf026[_0x9c94('0xa')];this[_0x9c94('0xb')]=_0x4bf026[_0x9c94('0xb')];this[_0x9c94('0xc')]=_0x4bf026[_0x9c94('0xc')];this[_0x9c94('0xd')]=_0x4bf026['outboundNoSuchCallsDay'];this['outboundReCallsDay']=_0x4bf026[_0x9c94('0xe')];this[_0x9c94('0xf')]=_0x4bf026['outboundRejectCallsDay'];this[_0x9c94('0x10')]=_0x4bf026[_0x9c94('0x10')];this[_0x9c94('0x12')]=_0x4bf026[_0x9c94('0x12')];this[_0x9c94('0x13')]=_0x4bf026[_0x9c94('0x13')];this['total']=_0x4bf026['total'];if(this['dialMethod']===_0x9c94('0x57')){this['pTalking']=_0x4bf026['pTalking'];}};module[_0x9c94('0x58')]=VoiceQueueSummary; \ No newline at end of file +var _0xeea0=['unknown','unmanaged','outbound','pTalking','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','busy','loggedin','callers','length','online','incall','includes','status','booked','queue','dialer','xcally-motion-preview','compareToInboundQueue','some','compareToOutboundQueue','updateReportFromOutboundQueue','outboundAbandonedCallsDay','preview','exports','available','loggedIn','loggedInDb','paused','ringing','waiting','answered','inUse','originated','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','sumBillable','name','strategy','abandoned','invalid','onHold','notInUse','ringInUse','sumDuration','sumHoldTime','talking','total','type','unavailable'];(function(_0x3bdbd9,_0x5df43a){var _0x1df32d=function(_0x30e79e){while(--_0x30e79e){_0x3bdbd9['push'](_0x3bdbd9['shift']());}};_0x1df32d(++_0x5df43a);}(_0xeea0,0x91));var _0x0eea=function(_0x1dba94,_0x13f39f){_0x1dba94=_0x1dba94-0x0;var _0x23f0d1=_0xeea0[_0x1dba94];return _0x23f0d1;};'use strict';var INBOUND_COUNTERS=[_0x0eea('0x0'),_0x0eea('0x1'),_0x0eea('0x2'),_0x0eea('0x3'),_0x0eea('0x4'),'talking',_0x0eea('0x5')];var OUTBOUND_COUNTERS=[_0x0eea('0x0'),_0x0eea('0x6'),_0x0eea('0x7'),_0x0eea('0x1'),_0x0eea('0x2'),_0x0eea('0x8'),'outboundAbandonedCallsDay',_0x0eea('0x9'),_0x0eea('0xa'),_0x0eea('0xb'),_0x0eea('0xc'),_0x0eea('0xd'),'outboundNoSuchCallsDay',_0x0eea('0xe'),_0x0eea('0xf'),_0x0eea('0x10'),_0x0eea('0x3'),'pTalking','talking',_0x0eea('0x11'),'sumDuration','total',_0x0eea('0x5')];function VoiceQueueSummary(_0x6e9c6e){this['id']=_0x6e9c6e['id'];this['name']=_0x6e9c6e[_0x0eea('0x12')];this['strategy']=_0x6e9c6e[_0x0eea('0x13')];this['abandoned']=_0x6e9c6e[_0x0eea('0x14')]||0x0;this['answered']=_0x6e9c6e['answered']||0x0;this[_0x0eea('0x0')]=_0x6e9c6e[_0x0eea('0x0')]||0x0;this['busy']=_0x6e9c6e['busy']||0x0;this['inUse']=_0x6e9c6e[_0x0eea('0x7')]||0x0;this[_0x0eea('0x15')]=_0x6e9c6e[_0x0eea('0x15')]||0x0;this[_0x0eea('0x1')]=_0x6e9c6e[_0x0eea('0x1')]||0x0;this[_0x0eea('0x2')]=_0x6e9c6e['loggedInDb']||0x0;this[_0x0eea('0x16')]=_0x6e9c6e[_0x0eea('0x16')]||0x0;this[_0x0eea('0x17')]=_0x6e9c6e[_0x0eea('0x17')]||0x0;this['paused']=_0x6e9c6e[_0x0eea('0x3')]||0x0;this[_0x0eea('0x4')]=_0x6e9c6e[_0x0eea('0x4')]||0x0;this[_0x0eea('0x18')]=_0x6e9c6e[_0x0eea('0x18')];this[_0x0eea('0x11')]=_0x6e9c6e['sumBillable'];this[_0x0eea('0x19')]=_0x6e9c6e[_0x0eea('0x19')];this['sumHoldTime']=_0x6e9c6e[_0x0eea('0x1a')]||0x0;this[_0x0eea('0x1b')]=_0x6e9c6e[_0x0eea('0x1b')]||0x0;this[_0x0eea('0x1c')]=_0x6e9c6e['total']||0x0;this[_0x0eea('0x1d')]=_0x6e9c6e['type'];this[_0x0eea('0x1e')]=_0x6e9c6e['unavailable']||0x0;this[_0x0eea('0x1f')]=_0x6e9c6e[_0x0eea('0x1f')]||0x0;this[_0x0eea('0x20')]=_0x6e9c6e['unmanaged']||0x0;this['waiting']=_0x6e9c6e[_0x0eea('0x5')]||0x0;if(_0x6e9c6e[_0x0eea('0x1d')]===_0x0eea('0x21')){this[_0x0eea('0x22')]=_0x6e9c6e['pTalking']||0x0;this[_0x0eea('0x23')]=_0x6e9c6e[_0x0eea('0x23')];this[_0x0eea('0x24')]=_0x6e9c6e[_0x0eea('0x24')];this[_0x0eea('0x25')]=_0x6e9c6e[_0x0eea('0x25')];this[_0x0eea('0x26')]=_0x6e9c6e[_0x0eea('0x26')];this[_0x0eea('0x27')]=_0x6e9c6e[_0x0eea('0x27')];this[_0x0eea('0x28')]=_0x6e9c6e[_0x0eea('0x28')];this[_0x0eea('0x29')]=_0x6e9c6e[_0x0eea('0x29')];this[_0x0eea('0x2a')]=_0x6e9c6e[_0x0eea('0x2a')];this[_0x0eea('0x9')]=_0x6e9c6e['outboundAnswerCallsDay'];this[_0x0eea('0xa')]=_0x6e9c6e[_0x0eea('0xa')];this[_0x0eea('0xb')]=_0x6e9c6e[_0x0eea('0xb')];this[_0x0eea('0xc')]=_0x6e9c6e[_0x0eea('0xc')];this[_0x0eea('0x2b')]=_0x6e9c6e[_0x0eea('0x2b')];this['outboundDropCallsDayCallersExit']=_0x6e9c6e['outboundDropCallsDayCallersExit'];this[_0x0eea('0x2c')]=_0x6e9c6e[_0x0eea('0x2c')];this[_0x0eea('0xd')]=_0x6e9c6e[_0x0eea('0xd')];this[_0x0eea('0x2d')]=_0x6e9c6e['outboundNoSuchCallsDay'];this['outboundOriginateFailureCallsDay']=_0x6e9c6e['outboundOriginateFailureCallsDay'];this[_0x0eea('0xe')]=_0x6e9c6e['outboundReCallsDay'];this[_0x0eea('0xf')]=_0x6e9c6e['outboundRejectCallsDay'];this['outboundUnknownCallsDay']=_0x6e9c6e[_0x0eea('0x10')];this[_0x0eea('0x2e')]=_0x6e9c6e[_0x0eea('0x2e')];this[_0x0eea('0x2f')]=_0x6e9c6e['predictiveIntervalAvgHoldtime'];this[_0x0eea('0x30')]=_0x6e9c6e[_0x0eea('0x30')];this[_0x0eea('0x31')]=_0x6e9c6e[_0x0eea('0x31')];this[_0x0eea('0x32')]=_0x6e9c6e[_0x0eea('0x32')];this[_0x0eea('0x33')]=_0x6e9c6e[_0x0eea('0x33')];this[_0x0eea('0x34')]=_0x6e9c6e[_0x0eea('0x34')];this['predictiveIntervalHitRate']=_0x6e9c6e['predictiveIntervalHitRate'];this['predictiveIntervalMultiplicativeFactor']=_0x6e9c6e[_0x0eea('0x35')];this[_0x0eea('0x36')]=_0x6e9c6e[_0x0eea('0x36')];this[_0x0eea('0x37')]=_0x6e9c6e[_0x0eea('0x37')];this['predictiveIntervalTotalCalls']=_0x6e9c6e[_0x0eea('0x38')];this['originated']=_0x6e9c6e[_0x0eea('0x8')];this['erlangCalls']=_0x6e9c6e['erlangCalls'];this[_0x0eea('0x39')]=_0x6e9c6e[_0x0eea('0x39')];this[_0x0eea('0x3a')]=_0x6e9c6e[_0x0eea('0x3a')];this[_0x0eea('0x3b')]=_0x6e9c6e[_0x0eea('0x3b')];this[_0x0eea('0x3c')]=_0x6e9c6e['startPredictive'];this[_0x0eea('0x3d')]=_0x6e9c6e[_0x0eea('0x3d')];this['message']=_0x6e9c6e[_0x0eea('0x3e')];this[_0x0eea('0x3f')]=_0x6e9c6e[_0x0eea('0x3f')];}if(_0x6e9c6e['Trunk']){this[_0x0eea('0x40')]={'id':_0x6e9c6e[_0x0eea('0x40')]['id'],'name':_0x6e9c6e['Trunk'][_0x0eea('0x12')],'active':_0x6e9c6e['Trunk'][_0x0eea('0x41')],'callerid':_0x6e9c6e['Trunk'][_0x0eea('0x42')]};}}VoiceQueueSummary[_0x0eea('0x43')][_0x0eea('0x44')]=function(_0x155b0f,_0xe51e79,_0x381916,_0x4455bb){this['loggedInDb']=0x0;this[_0x0eea('0x1b')]=0x0;this['paused']=0x0;this[_0x0eea('0x1f')]=0x0;this[_0x0eea('0x17')]=0x0;this[_0x0eea('0x7')]=0x0;this[_0x0eea('0x45')]=0x0;this[_0x0eea('0x15')]=0x0;this[_0x0eea('0x1e')]=0x0;this[_0x0eea('0x4')]=0x0;this[_0x0eea('0x18')]=0x0;this[_0x0eea('0x16')]=0x0;if(_0x381916){if(_0x381916[_0x0eea('0x0')]){this[_0x0eea('0x0')]=Number(_0x381916[_0x0eea('0x0')]);}if(_0x381916[_0x0eea('0x46')]){this['loggedIn']=Number(_0x381916[_0x0eea('0x46')]);}if(_0x381916[_0x0eea('0x47')]){this[_0x0eea('0x5')]=Number(_0x381916['callers']);}}for(var _0x1d3034=0x0;_0x1d3034<_0x155b0f[_0x0eea('0x48')];_0x1d3034++){var _0x28a6e0=_0xe51e79['SIP/'+_0x155b0f[_0x1d3034][_0x0eea('0x12')]];if(_0x28a6e0&&_0x28a6e0[_0x0eea('0x49')]){this[_0x0eea('0x2')]+=0x1;}if(_0x155b0f[_0x1d3034][_0x0eea('0x4a')]==='1'){this[_0x0eea('0x1b')]+=0x1;}if(_0x155b0f[_0x1d3034][_0x0eea('0x3')]==='1'&&!['2','7','8'][_0x0eea('0x4b')](_0x155b0f[_0x1d3034][_0x0eea('0x4c')])){this['paused']+=0x1;}switch(_0x155b0f[_0x1d3034]['status']){case'0':this[_0x0eea('0x1f')]+=0x1;break;case'1':this[_0x0eea('0x17')]+=0x1;break;case'2':this[_0x0eea('0x7')]+=0x1;break;case'3':this[_0x0eea('0x45')]+=0x1;break;case'4':this[_0x0eea('0x15')]+=0x1;break;case'5':this[_0x0eea('0x1e')]+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this[_0x0eea('0x18')]+=0x1;break;case'8':this[_0x0eea('0x16')]+=0x1;break;}}if(this[_0x0eea('0x24')]===_0x0eea('0x4d')){var _0x6de9c1=Object['keys'](_0x4455bb);for(var _0xb266c4=0x0;_0xb266c4<_0x6de9c1['length'];_0xb266c4++){var _0x571853=_0x6de9c1[_0xb266c4];var _0x360eb1=_0x4455bb[_0x571853];if(_0x360eb1[_0x0eea('0x4e')]===this[_0x0eea('0x12')]&&_0x360eb1[_0x0eea('0x1d')]===_0x0eea('0x4f')&&_0x360eb1['exten']===_0x0eea('0x50')){this[_0x0eea('0x1b')]+=0x1;}}if(this[_0x0eea('0x1b')]>this[_0x0eea('0x7')]){this[_0x0eea('0x1b')]=this[_0x0eea('0x7')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary['prototype'][_0x0eea('0x51')]=function(_0x5c1ef){var _0x3f118d=![];if(_0x5c1ef){_0x3f118d=INBOUND_COUNTERS[_0x0eea('0x52')](function(_0x4e1cfd){return this[_0x4e1cfd]!==_0x5c1ef[_0x4e1cfd];},this);}return _0x3f118d;};VoiceQueueSummary[_0x0eea('0x43')][_0x0eea('0x53')]=function(_0x562e6f){var _0x2a3a4e=![];var _0x217dac=![];var _0x30e6c9=![];if(_0x562e6f){_0x2a3a4e=this[_0x0eea('0x24')]!==_0x562e6f['dialMethod']||this[_0x0eea('0x23')]!==_0x562e6f[_0x0eea('0x23')]||this[_0x0eea('0x3e')]!==_0x562e6f[_0x0eea('0x3e')]||this[_0x0eea('0x3f')]!==_0x562e6f[_0x0eea('0x3f')];_0x217dac=OUTBOUND_COUNTERS[_0x0eea('0x52')](function(_0x4cf65b){return this[_0x4cf65b]!==_0x562e6f[_0x4cf65b];},this);if(this[_0x0eea('0x40')]&&_0x562e6f[_0x0eea('0x40')]){_0x30e6c9=this['Trunk'][_0x0eea('0x12')]!==_0x562e6f[_0x0eea('0x40')][_0x0eea('0x12')]||this[_0x0eea('0x40')][_0x0eea('0x41')]!==_0x562e6f[_0x0eea('0x40')]['active'];}}return _0x2a3a4e||_0x217dac||_0x30e6c9;};VoiceQueueSummary[_0x0eea('0x43')][_0x0eea('0x54')]=function(_0x29055c){this['answered']=_0x29055c[_0x0eea('0x6')];this[_0x0eea('0x3e')]=_0x29055c[_0x0eea('0x3e')];this[_0x0eea('0x3f')]=_0x29055c[_0x0eea('0x3f')];this['originated']=_0x29055c[_0x0eea('0x8')];this[_0x0eea('0x55')]=_0x29055c[_0x0eea('0x55')];this[_0x0eea('0x9')]=_0x29055c['outboundAnswerCallsDay'];this['outboundBlacklistCallsDay']=_0x29055c[_0x0eea('0xa')];this[_0x0eea('0xb')]=_0x29055c[_0x0eea('0xb')];this[_0x0eea('0xc')]=_0x29055c['outboundCongestionCallsDay'];this[_0x0eea('0xd')]=_0x29055c[_0x0eea('0xd')];this[_0x0eea('0x2d')]=_0x29055c['outboundNoSuchCallsDay'];this[_0x0eea('0xe')]=_0x29055c[_0x0eea('0xe')];this[_0x0eea('0xf')]=_0x29055c[_0x0eea('0xf')];this[_0x0eea('0x10')]=_0x29055c[_0x0eea('0x10')];this[_0x0eea('0x11')]=_0x29055c['sumBillable'];this[_0x0eea('0x19')]=_0x29055c['sumDuration'];this[_0x0eea('0x1c')]=_0x29055c[_0x0eea('0x1c')];if(this[_0x0eea('0x24')]===_0x0eea('0x56')){this[_0x0eea('0x22')]=_0x29055c['pTalking'];}};module[_0x0eea('0x57')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index c5c0296..c02937c 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 _0xc430=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x28a0b3,_0x39b7d1){var _0x4fd5f3=function(_0x507988){while(--_0x507988){_0x28a0b3['push'](_0x28a0b3['shift']());}};_0x4fd5f3(++_0x39b7d1);}(_0xc430,0x7d));var _0x0c43=function(_0x274a1f,_0x3cd338){_0x274a1f=_0x274a1f-0x0;var _0x733ee0=_0xc430[_0x274a1f];return _0x733ee0;};'use strict';function VtigerAccount(_0x1cea0b){this['id']=_0x1cea0b['id']||0x0;this[_0x0c43('0x0')]=_0x1cea0b[_0x0c43('0x0')]||'';this[_0x0c43('0x1')]=_0x1cea0b['username']||'';this['accessKey']=_0x1cea0b[_0x0c43('0x2')]||'';this['remoteUri']=_0x1cea0b[_0x0c43('0x3')]||'';this[_0x0c43('0x4')]=_0x1cea0b[_0x0c43('0x4')]||'';this['Configurations']=_0x1cea0b[_0x0c43('0x5')]||{};}module[_0x0c43('0x6')]=VtigerAccount; \ No newline at end of file +var _0xffb8=['Configurations','exports','name','accessKey','remoteUri','serverUrl'];(function(_0x211149,_0x2c95bb){var _0x26db7e=function(_0x40e4fe){while(--_0x40e4fe){_0x211149['push'](_0x211149['shift']());}};_0x26db7e(++_0x2c95bb);}(_0xffb8,0x164));var _0x8ffb=function(_0x155d2a,_0x2f7a99){_0x155d2a=_0x155d2a-0x0;var _0x24a26f=_0xffb8[_0x155d2a];return _0x24a26f;};'use strict';function VtigerAccount(_0x578c3f){this['id']=_0x578c3f['id']||0x0;this[_0x8ffb('0x0')]=_0x578c3f[_0x8ffb('0x0')]||'';this['username']=_0x578c3f['username']||'';this[_0x8ffb('0x1')]=_0x578c3f['accessKey']||'';this[_0x8ffb('0x2')]=_0x578c3f[_0x8ffb('0x2')]||'';this[_0x8ffb('0x3')]=_0x578c3f[_0x8ffb('0x3')]||'';this[_0x8ffb('0x4')]=_0x578c3f[_0x8ffb('0x4')]||{};}module[_0x8ffb('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index ed94cf4..035e325 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 _0xaaca=['authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xaaca,0x103));var _0xaaac=function(_0x5c5c52,_0x36d085){_0x5c5c52=_0x5c5c52-0x0;var _0x4229ff=_0xaaca[_0x5c5c52];return _0x4229ff;};'use strict';function ZendeskAccount(_0x3ba58c){this['id']=_0x3ba58c['id']||0x0;this[_0xaaac('0x0')]=_0x3ba58c[_0xaaac('0x0')]||'';this[_0xaaac('0x1')]=_0x3ba58c[_0xaaac('0x1')]||'';this['password']=_0x3ba58c[_0xaaac('0x2')]||'';this[_0xaaac('0x3')]=_0x3ba58c[_0xaaac('0x3')]||'';this[_0xaaac('0x4')]=_0x3ba58c['remoteUri']||'';this[_0xaaac('0x5')]=_0x3ba58c[_0xaaac('0x5')]||'';this[_0xaaac('0x6')]=_0x3ba58c[_0xaaac('0x6')]||_0xaaac('0x7');this[_0xaaac('0x8')]=_0x3ba58c['serverUrl']||'';this[_0xaaac('0x9')]=_0x3ba58c[_0xaaac('0x9')]||{};}module[_0xaaac('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x5263=['Configurations','exports','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl'];(function(_0x36702a,_0x7a2902){var _0x4a4730=function(_0x53ec67){while(--_0x53ec67){_0x36702a['push'](_0x36702a['shift']());}};_0x4a4730(++_0x7a2902);}(_0x5263,0x1a4));var _0x3526=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x5263[_0x3b0731];return _0x4204d7;};'use strict';function ZendeskAccount(_0x3bc4a8){this['id']=_0x3bc4a8['id']||0x0;this[_0x3526('0x0')]=_0x3bc4a8[_0x3526('0x0')]||'';this[_0x3526('0x1')]=_0x3bc4a8[_0x3526('0x1')]||'';this[_0x3526('0x2')]=_0x3bc4a8[_0x3526('0x2')]||'';this[_0x3526('0x3')]=_0x3bc4a8[_0x3526('0x3')]||'';this[_0x3526('0x4')]=_0x3bc4a8[_0x3526('0x4')]||'';this['authType']=_0x3bc4a8[_0x3526('0x5')]||'';this[_0x3526('0x6')]=_0x3bc4a8[_0x3526('0x6')]||_0x3526('0x7');this['serverUrl']=_0x3bc4a8[_0x3526('0x8')]||'';this[_0x3526('0x9')]=_0x3bc4a8['Configurations']||{};}module[_0x3526('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 7cf279c..f740e19 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 _0x76a6=['exports','description','host','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x22df37,_0x3dc845){var _0x35c13e=function(_0x4489a1){while(--_0x4489a1){_0x22df37['push'](_0x22df37['shift']());}};_0x35c13e(++_0x3dc845);}(_0x76a6,0x157));var _0x676a=function(_0x20d6f0,_0x33e54c){_0x20d6f0=_0x20d6f0-0x0;var _0x105ceb=_0x76a6[_0x20d6f0];return _0x105ceb;};'use strict';function ZohoAccount(_0x228870){this['id']=_0x228870['id']||0x0;this['name']=_0x228870['name']||'';this['description']=_0x228870[_0x676a('0x0')]||'';this[_0x676a('0x1')]=_0x228870[_0x676a('0x1')]||'';this['zone']=_0x228870['zone']||'';this[_0x676a('0x2')]=_0x228870[_0x676a('0x2')]||'';this[_0x676a('0x3')]=_0x228870[_0x676a('0x3')]||'';this[_0x676a('0x4')]=_0x228870[_0x676a('0x4')]||'';this[_0x676a('0x5')]=_0x228870[_0x676a('0x5')]||'';this[_0x676a('0x6')]=_0x228870[_0x676a('0x6')]||'';this['Configurations']=_0x228870[_0x676a('0x7')]||{};}module[_0x676a('0x8')]=ZohoAccount; \ No newline at end of file +var _0x9f00=['zone','clientId','serverUrl','code','refreshToken','Configurations','name','description','host'];(function(_0x930141,_0x4367c2){var _0x5bbad7=function(_0x1c9ba2){while(--_0x1c9ba2){_0x930141['push'](_0x930141['shift']());}};_0x5bbad7(++_0x4367c2);}(_0x9f00,0x69));var _0x09f0=function(_0x4237dc,_0x171899){_0x4237dc=_0x4237dc-0x0;var _0x35ed7f=_0x9f00[_0x4237dc];return _0x35ed7f;};'use strict';function ZohoAccount(_0x5ddf0b){this['id']=_0x5ddf0b['id']||0x0;this['name']=_0x5ddf0b[_0x09f0('0x0')]||'';this[_0x09f0('0x1')]=_0x5ddf0b[_0x09f0('0x1')]||'';this[_0x09f0('0x2')]=_0x5ddf0b[_0x09f0('0x2')]||'';this[_0x09f0('0x3')]=_0x5ddf0b[_0x09f0('0x3')]||'';this[_0x09f0('0x4')]=_0x5ddf0b[_0x09f0('0x4')]||'';this['clientSecret']=_0x5ddf0b['clientSecret']||'';this[_0x09f0('0x5')]=_0x5ddf0b['serverUrl']||'';this['code']=_0x5ddf0b[_0x09f0('0x6')]||'';this[_0x09f0('0x7')]=_0x5ddf0b[_0x09f0('0x7')]||'';this['Configurations']=_0x5ddf0b[_0x09f0('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 8d41b01..4c1bb55 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 _0x4bd3=['name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','format','\x22%s\x22\x20<%s>','number','exports','util','moment','isNil','string','idContact','queue'];(function(_0x5c16a9,_0x22d61d){var _0x59b3a6=function(_0x1672b5){while(--_0x1672b5){_0x5c16a9['push'](_0x5c16a9['shift']());}};_0x59b3a6(++_0x22d61d);}(_0x4bd3,0x174));var _0x34bd=function(_0x3c7500,_0x19e0e1){_0x3c7500=_0x3c7500-0x0;var _0x3cf84f=_0x4bd3[_0x3c7500];return _0x3cf84f;};'use strict';var util=require(_0x34bd('0x0'));var _=require('lodash');var moment=require(_0x34bd('0x1'));function checkNameSurname(_0x22a9f9,_0x5369c1,_0x4997bc){var _0x4cad21='';if(!_[_0x34bd('0x2')](_0x5369c1)&&_0x34bd('0x3')===typeof _0x5369c1){_0x4cad21+=_0x5369c1;}if(!_[_0x34bd('0x2')](_0x4997bc)&&'string'===typeof _0x4997bc){_0x4cad21+='\x20'+_0x4997bc;}if(_0x4cad21!==''){return _0x4cad21;}return _0x22a9f9;}function Action(_0x2133c5,_0x2a15a2,_0x5c2a7a,_0x3e8744,_0x213716){this['uniqueid']=_0x5c2a7a||undefined;this[_0x34bd('0x4')]=_0x2133c5['id'];this[_0x34bd('0x5')]=_0x2a15a2[_0x34bd('0x6')];this[_0x34bd('0x7')]=_0x2a15a2[_0x34bd('0x7')];this[_0x34bd('0x8')]='queue';this[_0x34bd('0x9')]=![];this[_0x34bd('0xa')]=_[_0x34bd('0x2')](_0x2133c5[_0x34bd('0xb')])?undefined:_0x2133c5['Agent']['name'];this[_0x34bd('0xc')]=this['membername']?util['format'](_0x34bd('0xd'),this[_0x34bd('0xa')]):_0x3e8744||undefined;this[_0x34bd('0xe')]=checkNameSurname(_0x2133c5[_0x34bd('0xf')][_0x34bd('0x10')],_0x2133c5[_0x34bd('0xf')][_0x34bd('0x11')],_0x2133c5[_0x34bd('0xf')][_0x34bd('0x12')]);this['active']=_0x2133c5[_0x34bd('0x13')]||![];this['calleridnum']=_0x2133c5['phone'];this[_0x34bd('0x14')]=_0x2133c5[_0x34bd('0x14')];this[_0x34bd('0x15')]=_0x2133c5[_0x34bd('0x15')]||0x0;this[_0x34bd('0x16')]=_0x2133c5[_0x34bd('0x16')]||0x0;this[_0x34bd('0x17')]=_0x2133c5[_0x34bd('0x17')]||0x0;this[_0x34bd('0x18')]=(_0x2133c5[_0x34bd('0x15')]||0x0)+(_0x2133c5[_0x34bd('0x16')]||0x0)+(_0x2133c5['countnoanswerretry']||0x0)+(_0x2133c5[_0x34bd('0x19')]||0x0)+(_0x2133c5[_0x34bd('0x1a')]||0x0)+(_0x2133c5[_0x34bd('0x1b')]||0x0)+(_0x2133c5[_0x34bd('0x1c')]||0x0)+(_0x2133c5[_0x34bd('0x1d')]||0x0);this[_0x34bd('0x19')]=_0x2133c5[_0x34bd('0x19')]||0x0;this[_0x34bd('0x1a')]=_0x2133c5[_0x34bd('0x1a')]||0x0;this['countabandonedretry']=_0x2133c5[_0x34bd('0x1b')]||0x0;this[_0x34bd('0x1c')]=_0x2133c5[_0x34bd('0x1c')]||0x0;this[_0x34bd('0x1d')]=_0x2133c5[_0x34bd('0x1d')]||0x0;this['callback']=_0x2133c5['callback'];this['callbackuniqueid']=_0x2133c5['callbackuniqueid'];this[_0x34bd('0x1e')]=_0x2133c5['callbackat'];this[_0x34bd('0x1f')]=_0x2133c5[_0x34bd('0x1f')];this[_0x34bd('0x20')]=_0x2133c5['ContactId'];this[_0x34bd('0x21')]=_0x2133c5[_0x34bd('0x21')];this[_0x34bd('0x22')]=_[_0x34bd('0x2')](_0x2133c5['Agent'])?_0x2133c5[_0x34bd('0x22')]:_0x2133c5[_0x34bd('0xb')]['id'];this[_0x34bd('0x23')]=_0x2133c5[_0x34bd('0x23')];this['originatecalleridnum']='';this[_0x34bd('0x24')]='';}Action[_0x34bd('0x25')]['getCaller']=function(){return util[_0x34bd('0x26')](_0x34bd('0x27'),this[_0x34bd('0xe')],this[_0x34bd('0x28')]);};module[_0x34bd('0x29')]=Action; \ No newline at end of file +var _0x4888=['SIP/%s','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','calleridname','number','exports','lodash','moment','isNil','string','name','type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent'];(function(_0x3d5c91,_0x47cdbe){var _0x2fb2d8=function(_0x5eec7a){while(--_0x5eec7a){_0x3d5c91['push'](_0x3d5c91['shift']());}};_0x2fb2d8(++_0x47cdbe);}(_0x4888,0x198));var _0x8488=function(_0x59fc33,_0x2e182d){_0x59fc33=_0x59fc33-0x0;var _0x39066f=_0x4888[_0x59fc33];return _0x39066f;};'use strict';var util=require('util');var _=require(_0x8488('0x0'));var moment=require(_0x8488('0x1'));function checkNameSurname(_0x2af900,_0x13b2f0,_0x257275){var _0xacc8f0='';if(!_[_0x8488('0x2')](_0x13b2f0)&&'string'===typeof _0x13b2f0){_0xacc8f0+=_0x13b2f0;}if(!_[_0x8488('0x2')](_0x257275)&&_0x8488('0x3')===typeof _0x257275){_0xacc8f0+='\x20'+_0x257275;}if(_0xacc8f0!==''){return _0xacc8f0;}return _0x2af900;}function Action(_0x1a97f4,_0x421292,_0x326887,_0x19e508,_0x5250a1){this['uniqueid']=_0x326887||undefined;this['idContact']=_0x1a97f4['id'];this['queue']=_0x421292[_0x8488('0x4')];this[_0x8488('0x5')]=_0x421292['type'];this[_0x8488('0x6')]=_0x8488('0x7');this[_0x8488('0x8')]=![];this[_0x8488('0x9')]=_['isNil'](_0x1a97f4[_0x8488('0xa')])?undefined:_0x1a97f4[_0x8488('0xa')][_0x8488('0x4')];this[_0x8488('0xb')]=this[_0x8488('0x9')]?util['format'](_0x8488('0xc'),this[_0x8488('0x9')]):_0x19e508||undefined;this['calleridname']=checkNameSurname(_0x1a97f4['Contact'][_0x8488('0xd')],_0x1a97f4['Contact'][_0x8488('0xe')],_0x1a97f4['Contact']['lastName']);this[_0x8488('0xf')]=_0x1a97f4[_0x8488('0xf')]||![];this[_0x8488('0x10')]=_0x1a97f4[_0x8488('0xd')];this[_0x8488('0x11')]=_0x1a97f4[_0x8488('0x11')];this[_0x8488('0x12')]=_0x1a97f4['countbusyretry']||0x0;this[_0x8488('0x13')]=_0x1a97f4[_0x8488('0x13')]||0x0;this[_0x8488('0x14')]=_0x1a97f4[_0x8488('0x14')]||0x0;this[_0x8488('0x15')]=(_0x1a97f4[_0x8488('0x12')]||0x0)+(_0x1a97f4[_0x8488('0x13')]||0x0)+(_0x1a97f4[_0x8488('0x14')]||0x0)+(_0x1a97f4[_0x8488('0x16')]||0x0)+(_0x1a97f4[_0x8488('0x17')]||0x0)+(_0x1a97f4[_0x8488('0x18')]||0x0)+(_0x1a97f4[_0x8488('0x19')]||0x0)+(_0x1a97f4[_0x8488('0x1a')]||0x0);this['countnosuchnumberretry']=_0x1a97f4['countnosuchnumberretry']||0x0;this[_0x8488('0x17')]=_0x1a97f4[_0x8488('0x17')]||0x0;this[_0x8488('0x18')]=_0x1a97f4[_0x8488('0x18')]||0x0;this[_0x8488('0x19')]=_0x1a97f4[_0x8488('0x19')]||0x0;this[_0x8488('0x1a')]=_0x1a97f4[_0x8488('0x1a')]||0x0;this[_0x8488('0x1b')]=_0x1a97f4['callback'];this[_0x8488('0x1c')]=_0x1a97f4[_0x8488('0x1c')];this[_0x8488('0x1d')]=_0x1a97f4[_0x8488('0x1d')];this[_0x8488('0x1e')]=_0x1a97f4['recallme'];this['ContactId']=_0x1a97f4['ContactId'];this['ListId']=_0x1a97f4[_0x8488('0x1f')];this['UserId']=_['isNil'](_0x1a97f4[_0x8488('0xa')])?_0x1a97f4[_0x8488('0x20')]:_0x1a97f4[_0x8488('0xa')]['id'];this[_0x8488('0x21')]=_0x1a97f4[_0x8488('0x21')];this['originatecalleridnum']='';this[_0x8488('0x22')]='';}Action[_0x8488('0x23')][_0x8488('0x24')]=function(){return util[_0x8488('0x25')](_0x8488('0x26'),this[_0x8488('0x27')],this[_0x8488('0x28')]);};module[_0x8488('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index acdf30f..cdf0e00 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 _0xd16d=['stringify','format','voice:queue:%s','name','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','paused','message','CAMPAIGN_STATUS','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','preview','dialMethod','booked','type','outbound','clockClearZombieChannels','clearZombieChannels','hasOwnProperty','dialActive','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','Queue','queue','pick','contactId','VoiceQueueId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','disableContact','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','INACTIVE','isTrunkReachable','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','answertime','[syncHangup][talking][increment]','\x20Queue','pTalking:\x20','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','answered','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','uniqueid','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','AgentReject','dialAgentRejectRetryFrequency','agentreject','[syncHangupRequest][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','ABANDONED','outboundAbandonedCallsDay','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','ANSWER','destlinkedid','queueSummaryCountersUpdated','object','isUndefined','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','originated:\x20','[verifyAdditionalPhone]\x20','checkInBlack','phone','Contact\x20is\x20undefined','isEmpty','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','execRun','unlock','unlockContact','getContactPreview','recallme','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','validateContact','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','\x20Not\x20Active','Is\x20Valid','Trunk','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','setXMDContactVariables','Contact','assign','merge','toLowerVariables','variables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','lookAgent','logLookAgent','responsetime','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','starttime','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','destuniqueid','addVariable','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','lodash','uuid','ioredis','../../../config/environment','actionPreview','../rpc/cmHopperAdditionalPhone','./action','./util/util','../dialer/utils','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','bind','syncHangup','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event'];(function(_0x25e9bd,_0x141153){var _0x3a627d=function(_0x42a328){while(--_0x42a328){_0x25e9bd['push'](_0x25e9bd['shift']());}};_0x3a627d(++_0x141153);}(_0xd16d,0x123));var _0xdd16=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xd16d[_0x8c43de];return _0xa6591b;};'use strict';var util=require('util');var _=require(_0xdd16('0x0'));var uuid=require(_0xdd16('0x1'));var moment=require('moment');var Redis=require(_0xdd16('0x2'));var config=require(_0xdd16('0x3'));var logger=require('../../../config/logger')('preview');var loggerAction=require('../../../config/logger')(_0xdd16('0x4'));var ami=require('../ami');var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0xdd16('0x5'));var Action=require(_0xdd16('0x6'));var ut=require(_0xdd16('0x7'));var utils=require(_0xdd16('0x8'));config[_0xdd16('0x9')]=_[_0xdd16('0xa')](config[_0xdd16('0x9')],{'host':_0xdd16('0xb'),'port':0x18eb});var io=require(_0xdd16('0xc'))(new Redis(config[_0xdd16('0x9')]));var Sequence=function(){};Sequence[_0xdd16('0xd')][_0xdd16('0xe')]=function(_0x59f4a6){this['tail']=this[_0xdd16('0xf')]?this[_0xdd16('0xf')][_0xdd16('0x10')](_0x59f4a6):_0x59f4a6();};function Preview(_0x4402ef){this[_0xdd16('0x11')]=new Sequence();this[_0xdd16('0x12')]=_0x4402ef[_0xdd16('0x13')];this['trunks']=_0x4402ef[_0xdd16('0x14')];this[_0xdd16('0x15')]={};this['agents']=_0x4402ef[_0xdd16('0x16')];this['clockClearZombieChannels']=0x0;ami['on']('originateresponse',this['syncOriginateResponse'][_0xdd16('0x17')](this));ami['on']('hangup',this[_0xdd16('0x18')]['bind'](this));ami['on']('hanguprequest',this[_0xdd16('0x19')][_0xdd16('0x17')](this));ami['on']('dialend',this[_0xdd16('0x1a')]['bind'](this));ami['on'](_0xdd16('0x1b'),this[_0xdd16('0x1c')][_0xdd16('0x17')](this));ami['on'](_0xdd16('0x1d'),this[_0xdd16('0x1e')][_0xdd16('0x17')](this));ami['on'](_0xdd16('0x1f'),this[_0xdd16('0x20')][_0xdd16('0x17')](this));ami['on']('blindtransfer',this[_0xdd16('0x21')]['bind'](this));this[_0xdd16('0x22')](this['campaignsPreview']);}function emit(_0x1494e7,_0x3d5737,_0x3f63b5){io['to'](_0x1494e7)[_0xdd16('0x23')](_0x3d5737,_0x3f63b5);}function emitVoiceQueueChannelRemove(_0x2f14ff){logger[_0xdd16('0x24')](_0xdd16('0x25'),JSON[_0xdd16('0x26')](_0x2f14ff));emit(util[_0xdd16('0x27')](_0xdd16('0x28'),_0x2f14ff[_0xdd16('0x29')]),'voice_queue_channel:remove',_0x2f14ff);io[_0xdd16('0x23')](_0xdd16('0x2a'),_0x2f14ff);}function notSendMessagesQueue(_0x35f8a1){if(_0x35f8a1[_0xdd16('0x2b')]){if(_0x35f8a1[_0xdd16('0x2c')]===0x0&&_0x35f8a1[_0xdd16('0x2d')]===0x0){_0x35f8a1[_0xdd16('0x2b')]=![];_0x35f8a1[_0xdd16('0x2e')]=0x0;_0x35f8a1[_0xdd16('0x2f')]=0x0;_0x35f8a1[_0xdd16('0x30')]=utils[_0xdd16('0x31')]['INACTIVE'];ut[_0xdd16('0x32')](_0xdd16('0x33'),_0x35f8a1[_0xdd16('0x29')]+_0xdd16('0x34'));}else{_0x35f8a1[_0xdd16('0x30')]=utils[_0xdd16('0x31')]['DEACTIVATED'];ut['logger'](_0xdd16('0x33'),_0x35f8a1['name']+_0xdd16('0x35'));}}}Preview[_0xdd16('0xd')][_0xdd16('0x22')]=function(){var _0x4a6cd9=this;setInterval(function(){_0x4a6cd9['syncCampaigns']();},0x7cf);};Preview[_0xdd16('0xd')][_0xdd16('0x36')]=function(){var _0x5cc60f=this[_0xdd16('0x12')];this['clockClearZombieChannels']+=0x1;for(var _0x566c48 in _0x5cc60f){if(_0x5cc60f['hasOwnProperty'](_0x566c48)&&(_0x5cc60f[_0x566c48]['dialMethod']===_0xdd16('0x37')||_0x5cc60f[_0x566c48][_0xdd16('0x38')]===_0xdd16('0x39'))&&_0x5cc60f[_0x566c48][_0xdd16('0x3a')]===_0xdd16('0x3b')){if(this[_0xdd16('0x3c')]>0x7){this[_0xdd16('0x3c')]=0x0;this[_0xdd16('0x3d')]();}}if(_0x5cc60f[_0xdd16('0x3e')](_0x566c48)&&_0x5cc60f[_0x566c48][_0xdd16('0x38')]==='preview'&&_0x5cc60f[_0x566c48]['type']===_0xdd16('0x3b')){if(_0x5cc60f[_0x566c48][_0xdd16('0x3f')]){this['setMessage'](_0x5cc60f[_0x566c48]);if(_0x5cc60f[_0x566c48][_0xdd16('0x40')])this[_0xdd16('0x41')](_0x5cc60f[_0x566c48]);}else{notSendMessagesQueue(_0x5cc60f[_0x566c48]);}}}};Preview[_0xdd16('0xd')][_0xdd16('0x42')]=function(_0x28effd){var _0x107c3d=this;this[_0xdd16('0x11')][_0xdd16('0xe')](function(){if(!_[_0xdd16('0x43')](_0x107c3d[_0xdd16('0x15')][_0x28effd])){loggerAction[_0xdd16('0x24')]('[clearZombieChannels][talking]',_0x28effd,_0xdd16('0x44'),_0x107c3d['actions'][_0x28effd][_0xdd16('0x45')],'originated:\x20',JSON['stringify'](_0x107c3d[_0xdd16('0x12')][_0x107c3d[_0xdd16('0x15')][_0x28effd]['queue']][_0xdd16('0x2c')]),'pTalking:\x20',JSON[_0xdd16('0x26')](_0x107c3d['campaignsPreview'][_0x107c3d[_0xdd16('0x15')][_0x28effd][_0xdd16('0x45')]]['pTalking']),JSON[_0xdd16('0x26')](_0x107c3d[_0xdd16('0x15')][_0x28effd]['dialAnswer']),JSON[_0xdd16('0x26')](_[_0xdd16('0x46')](_0x107c3d[_0xdd16('0x15')][_0x28effd],[_0xdd16('0x47'),'UserId',_0xdd16('0x48'),'ListId'])));return ami[_0xdd16('0x49')]({'action':_0xdd16('0x4a'),'channel':_0x107c3d[_0xdd16('0x15')][_0x28effd][_0xdd16('0x4b')]})[_0xdd16('0x4c')](function(_0x1445e5){if(_0x1445e5[_0xdd16('0x30')]===_0xdd16('0x4d')){setTimeout(function(){if(_0x107c3d['actions'][_0x28effd]){ut[_0xdd16('0x4e')](_0x107c3d['campaignsPreview'][_0x107c3d[_0xdd16('0x15')][_0x28effd]['queue']],_0xdd16('0x4f'));if(_0x107c3d[_0xdd16('0x15')][_0x28effd][_0xdd16('0x50')]===!![]){ut[_0xdd16('0x51')](_0x107c3d['campaignsPreview'][_0x107c3d[_0xdd16('0x15')][_0x28effd][_0xdd16('0x45')]],'[clearZombieChannel]');ut[_0xdd16('0x52')](_0xdd16('0x53')+_0x28effd,_0x107c3d['actions'][_0x28effd][_0xdd16('0x45')]);}ut[_0xdd16('0x52')](_0xdd16('0x54')+_0x28effd,_0x107c3d[_0xdd16('0x15')][_0x28effd]['queue']);delete _0x107c3d[_0xdd16('0x15')][_0x28effd];}},0x2328);}});}});};Preview[_0xdd16('0xd')][_0xdd16('0x3d')]=function(){var _0x1f9349=this;loggerAction[_0xdd16('0x24')](_0xdd16('0x55'),_[_0xdd16('0x56')](this[_0xdd16('0x15')]));for(var _0x6aca5a in this['actions']){if(_0x1f9349[_0xdd16('0x15')][_0xdd16('0x3e')](_0x6aca5a)){_0x1f9349['clearZombieChannel'](_0x6aca5a);}}};Preview[_0xdd16('0xd')][_0xdd16('0x41')]=function(_0x4eeb8f){var _0x101ee6=this;rpcDb[_0xdd16('0x57')](_0x4eeb8f['id'],ut[_0xdd16('0x58')](this[_0xdd16('0x16')]))[_0xdd16('0x59')](function(_0x50d8ce){if(!_[_0xdd16('0x43')](_0x50d8ce)){for(var _0x190c65=0x0;_0x190c65<_0x50d8ce[_0xdd16('0x5a')];_0x190c65+=0x1){if(ut[_0xdd16('0x5b')](_0x50d8ce[_0x190c65][_0xdd16('0x5c')])<_0x4eeb8f[_0xdd16('0x5d')]*0x3c){if(_0x50d8ce[_0x190c65][_0xdd16('0x5e')]&&!_0x50d8ce[_0x190c65][_0xdd16('0x5e')]['voicePause']){_0x101ee6[_0xdd16('0x5f')](_0x50d8ce[_0x190c65]['id'])[_0xdd16('0x59')](ut[_0xdd16('0x60')](_0xdd16('0x61')))[_0xdd16('0x4c')](ut[_0xdd16('0x60')]('[RecallMe]'));}else{rpcDb[_0xdd16('0x62')](_0x50d8ce[_0x190c65]['id']);}}else{var _0x300be1=new Action(_0x50d8ce[_0x190c65],_0x4eeb8f);_0x300be1['starttime']=moment()[_0xdd16('0x27')](_0xdd16('0x63'));_0x4eeb8f[_0xdd16('0x64')]+=0x1;ut[_0xdd16('0x65')](_0x300be1,0x17,_0xdd16('0x66'));if(_0x4eeb8f[_0xdd16('0x67')]){rpcDb[_0xdd16('0x68')](ut['createBody'](_0x50d8ce[_0x190c65]));rpcDb['createCustomerHistory'](_0x300be1,_0xdd16('0x69'));}else{ut[_0xdd16('0x65')](_0x300be1,0x16,_0xdd16('0x6a'));rpcDb[_0xdd16('0x6b')](_0x300be1,_0xdd16('0x6c'));rpcDb[_0xdd16('0x6d')](_0x300be1,_0xdd16('0x6c'));}}}}})['catch'](ut[_0xdd16('0x60')](_0xdd16('0x6e')));};Preview[_0xdd16('0xd')][_0xdd16('0x6f')]=function(_0x340d6e){_0x340d6e[_0xdd16('0x2b')]=!![];if(ut[_0xdd16('0x70')](_0x340d6e['loggedIn'])){_0x340d6e[_0xdd16('0x30')]=utils['CAMPAIGN_STATUS'][_0xdd16('0x71')];}else if(!ut[_0xdd16('0x72')](_0x340d6e[_0xdd16('0x3f')])){_0x340d6e[_0xdd16('0x30')]=utils[_0xdd16('0x31')][_0xdd16('0x73')];}else if(!this[_0xdd16('0x74')](_0x340d6e['Trunk'])){if(!this['isTrunkReachable'](_0x340d6e[_0xdd16('0x75')])){_0x340d6e[_0xdd16('0x30')]=utils[_0xdd16('0x31')][_0xdd16('0x76')];}else{_0x340d6e[_0xdd16('0x30')]=utils[_0xdd16('0x31')][_0xdd16('0x77')];}}else{_0x340d6e[_0xdd16('0x30')]=utils[_0xdd16('0x31')][_0xdd16('0x77')];}};Preview[_0xdd16('0xd')][_0xdd16('0x78')]=function(_0x1aa574,_0x2e9688,_0x85c3f){var _0x946700=this;var _0x1d065e=this['actions'][_0x2e9688];var _0x4c98a4=this[_0xdd16('0x12')][_0x1d065e[_0xdd16('0x45')]];var _0x5e2ff2;var _0x44deb7=![];var _0x58b75c=0x2;var _0x2e2b13=0x3;if(_0x4c98a4){switch(_0x85c3f){case'1':_0x4c98a4['outboundNoSuchCallsDay']+=0x1;_0x1d065e[_0xdd16('0x79')]+=0x1;_0x1d065e[_0xdd16('0x7a')]=ut[_0xdd16('0x7b')](_0x1d065e);ut[_0xdd16('0x65')](_0x1d065e,0x0,_0xdd16('0x7c'));ami[_0xdd16('0x23')](_0xdd16('0x7d'),ut[_0xdd16('0x7e')](_0x1d065e,_0xdd16('0x7f')));rpcDb[_0xdd16('0x6b')](_0x1d065e,'[callProgressDetectingCustomer][logNoSuch]');_0x946700[_0xdd16('0x80')](_0x1d065e,'0',_0x4c98a4)[_0xdd16('0x59')](function(_0x33f6a6){_0x44deb7=_0x33f6a6[_0xdd16('0x81')]==0x1;_0x58b75c=_0x4c98a4[_0xdd16('0x82')];_0x2e2b13=_0x4c98a4[_0xdd16('0x83')];if(!_0x44deb7){if(ut['totalGlobal'](_0x1d065e)>=_0x4c98a4[_0xdd16('0x84')]){_0x5e2ff2=ut[_0xdd16('0x85')](_0x1d065e,0xf,_0xdd16('0x86'));rpcDb[_0xdd16('0x6d')](_0x5e2ff2,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x1d065e['countnosuchnumberretry']>=_0x4c98a4[_0xdd16('0x87')]){rpcDb['createCustomerFinal'](_0x1d065e,_0xdd16('0x88'));}else{rpcDb[_0xdd16('0x89')](ut[_0xdd16('0x8a')](_0x1d065e,_0xdd16('0x79'),_0x4c98a4[_0xdd16('0x82')]),_0x1d065e[_0xdd16('0x8b')],_0x1d065e[_0xdd16('0x8c')]);}}delete this[_0xdd16('0x15')][_0x1aa574[_0xdd16('0x8d')]];}else{_0x1d065e[_0xdd16('0x79')]++;logger[_0xdd16('0x24')](_0xdd16('0x8e'),_0x1d065e['countnosuchnumberretry']);logger[_0xdd16('0x24')]('id',_0x1d065e[_0xdd16('0x8f')]);_0x946700[_0xdd16('0x90')]({'id':_0x1d065e[_0xdd16('0x8f')],'field':{'countnosuchnumberretry':_0x1d065e[_0xdd16('0x79')]}})[_0xdd16('0x59')](function(){_0x946700[_0xdd16('0x91')](_0x1d065e,_0x58b75c,_0x2e2b13)[_0xdd16('0x59')](function(){});});}});break;case'ANSWER':var _0x4b90b4=moment()[_0xdd16('0x27')]('YYYY-MM-DD\x20HH:mm:ss');_0x1d065e['responsetime']=_0x4b90b4;_0x1d065e[_0xdd16('0x92')]=_0x4b90b4;_0x1d065e[_0xdd16('0x50')]=!![];_0x4c98a4[_0xdd16('0x2d')]+=0x1;logger[_0xdd16('0x24')](_0xdd16('0x93'),_0x1d065e['uniqueid'],_0xdd16('0x94'),_0x4c98a4[_0xdd16('0x29')],_0xdd16('0x95'),_0x4c98a4[_0xdd16('0x2d')]);ami[_0xdd16('0x23')](_0xdd16('0x96'),ut['buildObj'](_0x1d065e,_0xdd16('0x97'),this[_0xdd16('0x12')][_0x1d065e[_0xdd16('0x45')]]));if(_0x4c98a4[_0xdd16('0x98')]){ami['emit'](_0xdd16('0x99'),ut[_0xdd16('0x9a')](_0x1d065e));}break;case'16':ami[_0xdd16('0x23')](_0xdd16('0x9b'),ut[_0xdd16('0x7e')](_0x1d065e,_0xdd16('0x9c'),this['campaignsPreview'][_0x1d065e[_0xdd16('0x45')]]));emitVoiceQueueChannelRemove(ut[_0xdd16('0x7e')](_0x1d065e,_0xdd16('0x9c')));_0x4c98a4[_0xdd16('0x9d')]+=0x1;_0x4c98a4[_0xdd16('0x9e')]+=0x1;_0x4c98a4[_0xdd16('0x9f')]+=0x1;ut[_0xdd16('0x51')](_0x4c98a4,'[16]');_0x1d065e[_0xdd16('0x7a')]=ut[_0xdd16('0x7b')](_0x1d065e);ut[_0xdd16('0x65')](_0x1d065e,0x4,_0xdd16('0xa0'));rpcDb[_0xdd16('0x6b')](_0x1d065e,_0xdd16('0xa1'));rpcDb['createCustomerFinal'](_0x1d065e,_0xdd16('0xa2'));rpcDb[_0xdd16('0xa3')](_0x1d065e);_0x4c98a4[_0xdd16('0xa4')]+=_0x1d065e[_0xdd16('0xa5')];_0x4c98a4['sumBillable']+=_0x1d065e[_0xdd16('0xa5')];logger[_0xdd16('0x24')]('[syncHangup][talking][decrement]',_0x1d065e[_0xdd16('0xa6')],_0xdd16('0x94'),_0x4c98a4[_0xdd16('0x29')],'pTalking:\x20',_0x4c98a4[_0xdd16('0x2d')]);delete this[_0xdd16('0x15')][_0x1aa574[_0xdd16('0x8d')]];break;case'BUSY':_0x4c98a4['outboundBusyCallsDay']+=0x1;_0x1d065e[_0xdd16('0xa7')]+=0x1;_0x1d065e[_0xdd16('0x7a')]=ut[_0xdd16('0x7b')](_0x1d065e);ut['logCustomer'](_0x1d065e,0x5,_0xdd16('0xa8'));_0x58b75c=_0x4c98a4[_0xdd16('0xa9')];_0x2e2b13=_0x4c98a4[_0xdd16('0x83')];ami[_0xdd16('0x23')](_0xdd16('0xaa'),ut['buildObj'](_0x1d065e,_0xdd16('0xab')));rpcDb[_0xdd16('0x6b')](_0x1d065e,'[callProgressDetectingCustomer][logBusy]');_0x946700[_0xdd16('0x80')](_0x1d065e,'5',_0x4c98a4)[_0xdd16('0x59')](function(_0x5507c7){_0x44deb7=_0x5507c7[_0xdd16('0x81')]==0x1;if(!_0x44deb7){if(ut[_0xdd16('0x7b')](_0x1d065e)>=_0x4c98a4['dialGlobalMaxRetry']){_0x5e2ff2=ut['cloneAction'](_0x1d065e,0xf,_0xdd16('0x86'));rpcDb[_0xdd16('0x6d')](_0x5e2ff2,_0xdd16('0xac'));}else{if(_0x1d065e[_0xdd16('0xa7')]>=_0x4c98a4[_0xdd16('0xad')]){rpcDb['createCustomerFinal'](_0x1d065e,_0xdd16('0xae'));}else{rpcDb[_0xdd16('0x89')](ut['scheduledAt'](_0x1d065e,_0xdd16('0xa7'),_0x4c98a4[_0xdd16('0xa9')]),_0x1d065e['unlockAgent'],_0x1d065e[_0xdd16('0x8c')]);}}}else{_0x1d065e[_0xdd16('0xa7')]++;_0x946700['incrementPreviewCounters']({'id':_0x1d065e[_0xdd16('0x8f')],'field':{'countbusyretry':_0x1d065e[_0xdd16('0xa7')]}})[_0xdd16('0x59')](function(){_0x946700[_0xdd16('0x91')](_0x1d065e,_0x58b75c,_0x2e2b13)[_0xdd16('0x59')](function(){});});}});break;case'NOANSWER':_0x4c98a4[_0xdd16('0xaf')]+=0x1;_0x1d065e[_0xdd16('0xb0')]+=0x1;_0x1d065e['countglobal']=ut['totalGlobal'](_0x1d065e);ut[_0xdd16('0x65')](_0x1d065e,0x3,_0xdd16('0xb1'));_0x58b75c=_0x4c98a4[_0xdd16('0xb2')];_0x2e2b13=_0x4c98a4[_0xdd16('0x83')];var _0x48c8ce=ut[_0xdd16('0xb3')](_0x1d065e,_0x4c98a4);ami[_0xdd16('0x23')](_0xdd16('0xb4'),_0x48c8ce);rpcDb[_0xdd16('0x6b')](_0x1d065e,'[callProgressDetectingCustomer][logNoAnswer]');_0x946700[_0xdd16('0x80')](_0x1d065e,'3',_0x4c98a4)[_0xdd16('0x59')](function(_0x215078){_0x44deb7=_0x215078[_0xdd16('0x81')]==0x1;if(!_0x44deb7){if(ut['totalGlobal'](_0x1d065e)>=_0x4c98a4[_0xdd16('0x84')]){_0x5e2ff2=ut[_0xdd16('0x85')](_0x1d065e,0xf,'Global');rpcDb[_0xdd16('0x6d')](_0x5e2ff2,_0xdd16('0xb5'));}else{if(_0x1d065e[_0xdd16('0xb0')]>=_0x4c98a4['dialNoAnswerMaxRetry']){rpcDb[_0xdd16('0x6d')](_0x1d065e,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xdd16('0x89')](ut['scheduledAt'](_0x1d065e,_0xdd16('0xb0'),_0x4c98a4[_0xdd16('0xb2')]),_0x1d065e[_0xdd16('0x8b')],_0x1d065e['activeContact']);}}}else{_0x1d065e[_0xdd16('0xb0')]++;_0x946700['incrementPreviewCounters']({'id':_0x1d065e[_0xdd16('0x8f')],'field':{'countnoanswerretry':_0x1d065e[_0xdd16('0xb0')]}})[_0xdd16('0x59')](function(){_0x946700[_0xdd16('0x91')](_0x1d065e,_0x58b75c,_0x2e2b13)[_0xdd16('0x59')](function(){});});}});break;case _0xdd16('0xb6'):_0x4c98a4['outboundCongestionCallsDay']+=0x1;_0x1d065e[_0xdd16('0xb7')]+=0x1;_0x1d065e[_0xdd16('0x7a')]=ut[_0xdd16('0x7b')](_0x1d065e);ut['logCustomer'](_0x1d065e,0x8,_0xdd16('0xb8'));_0x58b75c=_0x4c98a4['dialCongestionRetryFrequency'];_0x2e2b13=_0x4c98a4['callAdditionalPhoneAfterMin'];ami['emit'](_0xdd16('0xb9'),ut['buildObj'](_0x1d065e,_0xdd16('0xba')));rpcDb[_0xdd16('0x6b')](_0x1d065e,_0xdd16('0xbb'));_0x946700[_0xdd16('0x80')](_0x1d065e,'8',_0x4c98a4)['then'](function(_0x2b81bc){_0x44deb7=_0x2b81bc[_0xdd16('0x81')]==0x1;if(!_0x44deb7){if(ut[_0xdd16('0x7b')](_0x1d065e)>=_0x4c98a4[_0xdd16('0x84')]){_0x5e2ff2=ut[_0xdd16('0x85')](_0x1d065e,0xf,_0xdd16('0x86'));rpcDb['createCustomerFinal'](_0x5e2ff2,_0xdd16('0xbc'));}else{if(_0x1d065e[_0xdd16('0xb7')]>=_0x4c98a4[_0xdd16('0xbd')]){rpcDb['createCustomerFinal'](_0x1d065e,_0xdd16('0xbb'));}else{rpcDb[_0xdd16('0x89')](ut[_0xdd16('0x8a')](_0x1d065e,'countcongestionretry',_0x4c98a4[_0xdd16('0xa9')]),_0x1d065e['unlockAgent'],_0x1d065e[_0xdd16('0x8c')]);}}}else{_0x1d065e[_0xdd16('0xb7')]++;_0x946700[_0xdd16('0x90')]({'id':_0x1d065e[_0xdd16('0x8f')],'field':{'countcongestionretry':_0x1d065e[_0xdd16('0xb7')]}})['then'](function(){_0x946700['swapAdditionalPhones'](_0x1d065e,_0x58b75c,_0x2e2b13)[_0xdd16('0x59')](function(){});});}});break;case'CANCEL':_0x4c98a4['outboundRejectCallsDay']+=0x1;_0x1d065e['countagentrejectretry']+=0x1;_0x1d065e[_0xdd16('0x7a')]=ut[_0xdd16('0x7b')](_0x1d065e);ut[_0xdd16('0x65')](_0x1d065e,0x14,_0xdd16('0xbe'));_0x58b75c=_0x4c98a4[_0xdd16('0xbf')];_0x2e2b13=_0x4c98a4[_0xdd16('0x83')];ami[_0xdd16('0x23')]('custom:agentreject',ut[_0xdd16('0x7e')](_0x1d065e,_0xdd16('0xc0')));rpcDb[_0xdd16('0x6b')](_0x1d065e,_0xdd16('0xc1'));_0x946700[_0xdd16('0x80')](_0x1d065e,'20',_0x4c98a4)[_0xdd16('0x59')](function(_0x3343bd){_0x44deb7=_0x3343bd['additional']==0x1;if(!_0x44deb7){if(ut[_0xdd16('0x7b')](_0x1d065e)>=_0x4c98a4[_0xdd16('0x84')]){_0x5e2ff2=ut[_0xdd16('0x85')](_0x1d065e,0x14,_0xdd16('0xbe'));rpcDb[_0xdd16('0x6d')](_0x5e2ff2,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x1d065e[_0xdd16('0xc2')]>=_0x4c98a4[_0xdd16('0xc3')]){rpcDb[_0xdd16('0x6d')](_0x1d065e,_0xdd16('0xc4'));}else{rpcDb[_0xdd16('0x89')](ut[_0xdd16('0x8a')](_0x1d065e,_0xdd16('0xc2'),_0x4c98a4[_0xdd16('0xbf')]),_0x1d065e[_0xdd16('0x8b')],_0x1d065e['activeContact']);}}}else{_0x1d065e[_0xdd16('0xb0')]++;_0x946700[_0xdd16('0x90')]({'id':_0x1d065e['idContact'],'field':{'countnoanswerretry':_0x1d065e[_0xdd16('0xb0')]}})[_0xdd16('0x59')](function(){_0x946700['swapAdditionalPhones'](_0x1d065e,_0x58b75c,_0x2e2b13)['then'](function(){});});}});break;case _0xdd16('0xc5'):_0x4c98a4[_0xdd16('0xc6')]+=0x1;_0x1d065e['countabandonedretry']+=0x1;_0x1d065e[_0xdd16('0x7a')]=ut[_0xdd16('0x7b')](_0x1d065e);ut[_0xdd16('0x65')](_0x1d065e,0xb,_0xdd16('0xc7'));rpcDb[_0xdd16('0x6b')](_0x1d065e,'[callProgressDetectingCustomer][logAbandoned]');_0x946700['verifyAdditionalPhones'](_0x1d065e,'11',_0x4c98a4)['then'](function(_0x4d8946){_0x44deb7=_0x4d8946[_0xdd16('0x81')]==0x1;if(!_0x44deb7){if(ut[_0xdd16('0x7b')](_0x1d065e)>=_0x4c98a4[_0xdd16('0x84')]){_0x5e2ff2=ut[_0xdd16('0x85')](_0x1d065e,0xf,_0xdd16('0x86'));rpcDb[_0xdd16('0x6d')](_0x5e2ff2,_0xdd16('0xc8'));}else{if(_0x1d065e[_0xdd16('0xc9')]>=_0x4c98a4[_0xdd16('0xca')]){rpcDb['createCustomerFinal'](_0x1d065e,_0xdd16('0xc8'));}else{rpcDb['rescheduleContact'](ut[_0xdd16('0x8a')](_0x1d065e,_0xdd16('0xcb'),_0x4c98a4[_0xdd16('0xcc')]),_0x1d065e[_0xdd16('0x8b')],_0x1d065e[_0xdd16('0x8c')]);}}}else{_0x1d065e[_0xdd16('0xb0')]++;_0x946700[_0xdd16('0x90')]({'id':_0x1d065e['idContact'],'field':{'countnoanswerretry':_0x1d065e[_0xdd16('0xb0')]}})['then'](function(){_0x946700['swapAdditionalPhones'](_0x1d065e,_0x58b75c,_0x2e2b13)[_0xdd16('0x59')](function(){});});}});break;case'18':_0x4c98a4['outboundUnknownCallsDay']+=0x1;_0x1d065e[_0xdd16('0xcd')]+=0x1;_0x1d065e[_0xdd16('0x7a')]=ut[_0xdd16('0x7b')](_0x1d065e);ut[_0xdd16('0x65')](_0x1d065e,0x12,_0x1aa574['cause-txt']||_0x1aa574['dialstatus']);ami['emit']('custom:amd',ut[_0xdd16('0x7e')](_0x1d065e,'amd'));rpcDb[_0xdd16('0x6b')](_0x1d065e,'[callProgressDetectingCustomer][hangupInAMD]');_0x946700[_0xdd16('0x80')](_0x1d065e,'18',_0x4c98a4)[_0xdd16('0x59')](function(_0x1204a9){_0x44deb7=_0x1204a9[_0xdd16('0x81')]==0x1;if(!_0x44deb7){if(ut[_0xdd16('0x7b')](_0x1d065e)>=_0x4c98a4['dialGlobalMaxRetry']){_0x5e2ff2=ut['cloneAction'](_0x1d065e,0x12,'Global');rpcDb[_0xdd16('0x6d')](_0x5e2ff2,_0xdd16('0xce'));}else{rpcDb[_0xdd16('0x6d')](_0x1d065e,_0xdd16('0xce'));}}else{_0x1d065e[_0xdd16('0xb0')]++;_0x946700[_0xdd16('0x90')]({'id':_0x1d065e['idContact'],'field':{'countnoanswerretry':_0x1d065e['countnoanswerretry']}})[_0xdd16('0x59')](function(){_0x946700['swapAdditionalPhones'](_0x1d065e,_0x58b75c,_0x2e2b13)[_0xdd16('0x59')](function(){});});}});delete this[_0xdd16('0x15')][_0x1aa574[_0xdd16('0x8d')]];break;case'19':_0x4c98a4[_0xdd16('0xcf')]+=0x1;_0x1d065e[_0xdd16('0x7a')]=ut['totalGlobal'](_0x1d065e);ut['logCustomer'](_0x1d065e,0x13,_0x1aa574[_0xdd16('0xd0')]||_0x1aa574['dialstatus']);ami[_0xdd16('0x23')](_0xdd16('0xd1'),ut[_0xdd16('0x7e')](_0x1d065e,_0xdd16('0xd2')));rpcDb[_0xdd16('0x6b')](_0x1d065e,'[callProgressDetectingCustomer][machine]');_0x946700[_0xdd16('0x80')](_0x1d065e,'18',_0x4c98a4)[_0xdd16('0x59')](function(_0x25cf9a){_0x44deb7=_0x25cf9a[_0xdd16('0x81')]==0x1;if(!_0x44deb7){if(ut['totalGlobal'](_0x1d065e)>=_0x4c98a4['dialGlobalMaxRetry']){_0x5e2ff2=ut[_0xdd16('0x85')](_0x1d065e,0xf,_0xdd16('0x86'));rpcDb[_0xdd16('0x6d')](_0x5e2ff2,'[callProgressDetectingCustomer][machine]');}else{rpcDb['createCustomerFinal'](_0x1d065e,_0xdd16('0xd3'));}}else{_0x1d065e[_0xdd16('0xb0')]++;_0x946700['incrementPreviewCounters']({'id':_0x1d065e[_0xdd16('0x8f')],'field':{'countnoanswerretry':_0x1d065e[_0xdd16('0xb0')]}})[_0xdd16('0x59')](function(){_0x946700[_0xdd16('0x91')](_0x1d065e,_0x58b75c,_0x2e2b13)[_0xdd16('0x59')](function(){});});}});delete this['actions'][_0x1aa574['linkedid']];break;default:if(_0x1d065e[_0xdd16('0x50')]){ut[_0xdd16('0x51')](_0x4c98a4,_0xdd16('0xd4'));ut[_0xdd16('0x52')](_0xdd16('0xd5')+_0x4c98a4[_0xdd16('0x29')],_0x1aa574);}_0x4c98a4[_0xdd16('0xcf')]+=0x1;_0x1d065e['countglobal']=ut[_0xdd16('0x7b')](_0x1d065e);ut[_0xdd16('0x65')](_0x1d065e,0xc,_0x1aa574[_0xdd16('0xd0')]||_0x1aa574[_0xdd16('0xd6')]);_0x58b75c=_0x4c98a4[_0xdd16('0xbf')];_0x2e2b13=_0x4c98a4[_0xdd16('0x83')];rpcDb[_0xdd16('0x6b')](_0x1d065e,_0xdd16('0xd7'));_0x946700[_0xdd16('0x80')](_0x1d065e,'20',_0x4c98a4)[_0xdd16('0x59')](function(_0x41eb30){_0x44deb7=_0x41eb30[_0xdd16('0x81')]==0x1;if(!_0x44deb7){if(ut['totalGlobal'](_0x1d065e)>=_0x4c98a4['dialGlobalMaxRetry']){_0x5e2ff2=ut[_0xdd16('0x85')](_0x1d065e,0xf,_0xdd16('0x86'));rpcDb[_0xdd16('0x6d')](_0x5e2ff2,_0xdd16('0xd8'));}else{rpcDb[_0xdd16('0x6d')](_0x1d065e,_0xdd16('0xd8'));}delete this[_0xdd16('0x15')][_0x1aa574[_0xdd16('0x8d')]];}else{_0x946700[_0xdd16('0x91')](_0x1d065e,_0x58b75c,_0x2e2b13)[_0xdd16('0x59')](function(){});}});}if(!(_0x1d065e[_0xdd16('0x50')]&&_0x85c3f==='16')){ut[_0xdd16('0x4e')](_0x4c98a4,_0xdd16('0xd9'));logger[_0xdd16('0x24')]('[originated][decrement][callProgressDetectingCustomer]',_0x1d065e['uniqueid'],_0xdd16('0x94'),_0x4c98a4[_0xdd16('0x29')],'originated:\x20',_0x4c98a4['originated']);}if(_0x85c3f!==_0xdd16('0xda')){delete this[_0xdd16('0x15')][_0x1aa574[_0xdd16('0x8d')]];delete this[_0xdd16('0x15')][_0x1aa574[_0xdd16('0xdb')]];}_0x4c98a4[_0xdd16('0xdc')]=!![];}};Preview[_0xdd16('0xd')]['callProgressDetectingAgent']=function(_0x21a4f8,_0x2f883b,_0xd055b2){if(_['isUndefined'](_0x2f883b)&&_0xdd16('0xdd')!==typeof _0x2f883b){return;}if(_[_0xdd16('0xde')](_0xd055b2)&&_0xdd16('0xdd')!==typeof _0xd055b2){return;}switch(_0xd055b2[_0xdd16('0xdf')]){case'0':ut[_0xdd16('0xe0')](_0x21a4f8,0x0,_0xdd16('0x7c'));rpcDb[_0xdd16('0xe1')](_0x21a4f8,_0xdd16('0xe2'));break;case'3':ut[_0xdd16('0xe0')](_0x21a4f8,0x3,_0xdd16('0xb1'));rpcDb[_0xdd16('0xe1')](_0x21a4f8,_0xdd16('0xe3'));break;case'5':ut[_0xdd16('0xe0')](_0x21a4f8,0x5,_0xdd16('0xa8'));rpcDb[_0xdd16('0xe1')](_0x21a4f8,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xdd16('0xe0')](_0x21a4f8,0x8,_0xdd16('0xb8'));rpcDb['createAgentHistory'](_0x21a4f8,_0xdd16('0xe4'));break;case'22':ut[_0xdd16('0xe0')](_0x21a4f8,0x16,_0xdd16('0xe5'));rpcDb[_0xdd16('0xe1')](_0x21a4f8,_0xdd16('0xe6'));break;default:ut[_0xdd16('0xe0')](_0x21a4f8,0xc,_0xd055b2[_0xdd16('0xdf')]);rpcDb['createAgentHistory'](_0x21a4f8,'[callProgressDetectingAgent][logCongestion]');}ut['updateOriginated'](_0x2f883b,_0xdd16('0xe7'));logger[_0xdd16('0x24')](_0xdd16('0xe8'),_0x21a4f8[_0xdd16('0xa6')],_0xdd16('0x94'),_0x2f883b[_0xdd16('0x29')],_0xdd16('0xe9'),_0x2f883b[_0xdd16('0x2c')]);delete this[_0xdd16('0x15')][_0x21a4f8[_0xdd16('0xa6')]];};Preview[_0xdd16('0xd')][_0xdd16('0x80')]=function(_0x560149,_0xf73f43,_0x54d3be){return cmHopperAdditionalPhone[_0xdd16('0x80')](_0x560149,_0xf73f43,_0x54d3be)[_0xdd16('0x4c')](logger[_0xdd16('0x24')](_0xdd16('0xea')));};Preview[_0xdd16('0xd')]['swapAdditionalPhones']=function(_0x2bd944,_0x1739ec,_0x41f2d9){return cmHopperAdditionalPhone[_0xdd16('0x91')](_0x2bd944,_0x1739ec,_0x41f2d9)[_0xdd16('0x4c')](logger[_0xdd16('0x24')]('[swapAdditionalPhone]\x20'));};Preview['prototype'][_0xdd16('0x90')]=function(_0x22323f){return Promise['resolve']()['then'](cmHopperAdditionalPhone[_0xdd16('0x90')](_0x22323f))['catch'](logger[_0xdd16('0x24')]('[incrementPreviewCounters]\x20'));};Preview[_0xdd16('0xd')][_0xdd16('0xeb')]=function(_0xa0a49e,_0x27d4e0,_0x3fb068,_0x35c24a,_0x2b69cb){var _0x2699ac=this;return new Promise(function(_0x3c0485,_0x5453bc){if(_[_0xdd16('0x43')](_0x27d4e0)||_[_0xdd16('0x43')](_0x27d4e0['Contact'])||_['isNil'](_0x27d4e0[_0xdd16('0xec')])||_[_0xdd16('0x43')](_0x27d4e0[_0xdd16('0x48')])){_0x5453bc(ut[_0xdd16('0x30')](_0xdd16('0xed'),_0x35c24a,_0x2b69cb));return;}var _0x3e7d21=uuid['v4']();var _0x4d52fd=_0x2699ac[_0xdd16('0x12')][_0x27d4e0[_0xdd16('0x44')][_0xdd16('0x29')]];var _0x354c33=_0x3fb068?_0x2699ac['agents'][_0x3fb068]['id']:undefined;_0x2699ac[_0xdd16('0x15')][_0x3e7d21]=new Action(_0x27d4e0,_0x4d52fd,_0x3e7d21,_0x3fb068,_0x354c33);var _0x96b136=_0x2699ac['actions'][_0x3e7d21];_0x96b136[_0xdd16('0x8b')]=_0x35c24a;_0x96b136['activeContact']=_0x2b69cb;_0x96b136['lookAgent']=_0x3fb068;if(_[_0xdd16('0xee')](_0xa0a49e)){_0x2699ac[_0xdd16('0xef')](_0x96b136,_0x4d52fd,_0x27d4e0,_0x3fb068)[_0xdd16('0x59')](function(_0x5ee004){logger[_0xdd16('0x24')](_0xdd16('0xf0'),'Queue:\x20'+_0x96b136[_0xdd16('0x45')]+_0xdd16('0xf1')+_0x96b136[_0xdd16('0x8f')],JSON['stringify'](_0x5ee004));ami['emit'](_0xdd16('0xf2'),ut[_0xdd16('0x7e')](_0x96b136,_0xdd16('0xf3'),_0x2699ac[_0xdd16('0x12')][_0x96b136[_0xdd16('0x45')]]));_0x3c0485(ut[_0xdd16('0x30')](_0xdd16('0xf4')));})['catch'](function(_0x1c281a){ut[_0xdd16('0x32')](_0xdd16('0xf5'),_0x1c281a);_0x5453bc(ut[_0xdd16('0x30')](_0xdd16('0xf6'),_0x35c24a,_0x2b69cb));});}else{_0x4d52fd['outboundBlacklistCallsDay']+=0x1;ut[_0xdd16('0xf7')](_0x96b136);rpcDb[_0xdd16('0xf8')](_0x96b136,'[Blacklist][error]');delete _0x2699ac['actions'][_0x3e7d21];_0x5453bc(ut[_0xdd16('0x30')](_0xdd16('0xf9'),_0x35c24a,_0x2b69cb));}});};Preview[_0xdd16('0xd')][_0xdd16('0x74')]=function(_0x5b9554){return!_[_0xdd16('0x43')](_0x5b9554)&&!_['isNil'](_0x5b9554[_0xdd16('0x29')])&&!_[_0xdd16('0x43')](_0x5b9554[_0xdd16('0xfa')])&&_0x5b9554[_0xdd16('0xfa')]&&!_[_0xdd16('0x43')](this[_0xdd16('0x14')][util[_0xdd16('0x27')](_0xdd16('0xfb'),_0x5b9554[_0xdd16('0x29')])])&&!_[_0xdd16('0x43')](this[_0xdd16('0x14')][util[_0xdd16('0x27')](_0xdd16('0xfb'),_0x5b9554['name'])][_0xdd16('0x4a')])&&(this[_0xdd16('0x14')][util['format'](_0xdd16('0xfb'),_0x5b9554['name'])][_0xdd16('0x4a')]===_0xdd16('0xfc')||this[_0xdd16('0x14')][util[_0xdd16('0x27')]('SIP/%s',_0x5b9554[_0xdd16('0x29')])]['status']==='unmonitored');};Preview['prototype'][_0xdd16('0x5f')]=function(_0x2ce010,_0x3aad64){return this[_0xdd16('0xfd')](_0x2ce010,_0x3aad64)[_0xdd16('0x59')](function(_0x37cacd){return _[_0xdd16('0x46')](_0x37cacd,[_0xdd16('0x30')]);})['catch'](function(_0x5d098c){if(_0x5d098c[_0xdd16('0xfe')]){rpcDb[_0xdd16('0xff')](_0x2ce010);}if(_0x5d098c[_0xdd16('0xfa')]){rpcDb[_0xdd16('0x62')](_0x2ce010);}throw _[_0xdd16('0x46')](_0x5d098c,[_0xdd16('0x30')]);});};Preview[_0xdd16('0xd')][_0xdd16('0xfd')]=function(_0x2f9481,_0x83c20b){var _0x4740e7=this;var _0x539173,_0x3ec26c;return rpcDb[_0xdd16('0x100')](_0x2f9481)[_0xdd16('0x59')](function(_0x19c8d9){if(!_['isNil'](_0x19c8d9[0x0])){_0x3ec26c=_0x19c8d9[0x0][_0xdd16('0x101')]?![]:!![];_0x539173=_0x19c8d9[0x0][_0xdd16('0x101')]?!![]:![];_0x539173=_0x83c20b?!![]:_0x539173;}var _0x314cc2=_0x4740e7['validateContact'](_0x19c8d9);if(_0x314cc2[_0xdd16('0x102')]){rpcDb[_0xdd16('0x103')](_[_0xdd16('0x46')](_0x19c8d9[0x0],[_0xdd16('0x48'),_0xdd16('0xec')]))[_0xdd16('0x59')](function(_0x59d281){_0x4740e7[_0xdd16('0xeb')](_0x59d281,_0x19c8d9[0x0],_0x83c20b,_0x3ec26c,_0x539173)[_0xdd16('0x59')](function(_0x28590f){return _0x28590f;})[_0xdd16('0x4c')](function(_0x1fb980){throw _0x1fb980;});})[_0xdd16('0x4c')](function(_0x5c8589){ut['logger'](_0xdd16('0x104'),_0x5c8589);throw ut[_0xdd16('0x30')](_0xdd16('0x105'),_0x3ec26c,_0x539173);});}else{throw ut['message'](_0x314cc2[_0xdd16('0x30')],_0x3ec26c,_0x539173);}})[_0xdd16('0x4c')](function(_0x1845ca){ut[_0xdd16('0x32')]('[Preview][getContactPreview]',_0x1845ca);throw ut[_0xdd16('0x30')](_0xdd16('0x105'),![],!![]);});};Preview[_0xdd16('0xd')][_0xdd16('0x106')]=function(_0x2c6730){if(_['isNil'](_0x2c6730)||_['isEmpty'](_0x2c6730)||!_['isNil'](_0x2c6730[0x0][_0xdd16('0x5e')])&&_['isNil'](_0x2c6730[0x0][_0xdd16('0x5e')][_0xdd16('0x29')])){ut[_0xdd16('0x32')](_0xdd16('0x107'),_0x2c6730);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x126a0f=this['campaignsPreview'][_0x2c6730[0x0][_0xdd16('0x44')][_0xdd16('0x29')]];_0x126a0f[_0xdd16('0x30')]=utils['CAMPAIGN_STATUS'][_0xdd16('0x77')];if(_['isNil'](_0x126a0f)){ut['logger'](_0xdd16('0x108'),_0x126a0f);return{'isValid':![],'message':_0xdd16('0x109')};}if(!this[_0xdd16('0x74')](_0x126a0f['Trunk'])){ut[_0xdd16('0x32')](_0xdd16('0x10a'),_0xdd16('0x10b')+_0x126a0f[_0xdd16('0x29')]+_0xdd16('0x10c'));if(!this[_0xdd16('0x74')](_0x126a0f[_0xdd16('0x75')])){ut['logger'](_0xdd16('0x10a'),_0x126a0f[_0xdd16('0x29')]+_0xdd16('0x10d'));return{'isValid':![],'message':_0xdd16('0x10e')};}}if(!ut[_0xdd16('0x72')](_0x126a0f[_0xdd16('0x3f')])){ut['logger']('[Preview][validateContact][Campaign\x20Active]',_0x126a0f['name']+_0xdd16('0x10f'));return{'isValid':![],'message':_0xdd16('0x10b')+_0x126a0f['name']+_0xdd16('0x10f')};}return{'isValid':!![],'message':_0xdd16('0x110')};};Preview[_0xdd16('0xd')][_0xdd16('0xef')]=function(_0x2c5046,_0x185d7f,_0x3e3d98,_0x21d117){var _0x277f0a=this;return new Promise(function(_0x4823f6,_0x3b51ed){var _0x3750c6=_0x2c5046[_0xdd16('0xa6')];var _0x2f502d=_0x277f0a['isTrunkReachable'](_0x185d7f[_0xdd16('0x111')])?util[_0xdd16('0x27')](_0xdd16('0x112'),_0x185d7f[_0xdd16('0x111')][_0xdd16('0x29')],_[_0xdd16('0x43')](_0x185d7f['dialPrefix'])?'':_0x185d7f[_0xdd16('0x113')]['trim']()||'',_0x185d7f[_0xdd16('0x114')]>0x0?_0x3e3d98[_0xdd16('0xec')][_0xdd16('0x115')](_0x185d7f[_0xdd16('0x114')]):_0x3e3d98[_0xdd16('0xec')]):util[_0xdd16('0x27')](_0xdd16('0x112'),_['isNil'](_0x185d7f['TrunkBackup'])?_0x185d7f[_0xdd16('0x111')][_0xdd16('0x29')]:_0x185d7f[_0xdd16('0x75')][_0xdd16('0x29')],_[_0xdd16('0x43')](_0x185d7f['dialPrefix'])?'':_0x185d7f[_0xdd16('0x113')][_0xdd16('0x116')]()||'',_0x185d7f[_0xdd16('0x114')]>0x0?_0x3e3d98[_0xdd16('0xec')][_0xdd16('0x115')](_0x185d7f[_0xdd16('0x114')]):_0x3e3d98[_0xdd16('0xec')]);var _0x44374f=_0x277f0a[_0xdd16('0x74')](_0x185d7f[_0xdd16('0x111')])?ut['getCallerId'](_0x185d7f[_0xdd16('0x111')][_0xdd16('0x117')],_0x185d7f[_0xdd16('0x118')],_0x185d7f[_0xdd16('0x119')]>0x0?ut[_0xdd16('0x11a')](_0x185d7f[_0xdd16('0x11b')],_0x185d7f['dialRandomLastDigitCallerIdNumber']):_0x185d7f['dialOriginateCallerIdNumber']):ut[_0xdd16('0x11c')](_[_0xdd16('0x43')](_0x185d7f[_0xdd16('0x75')])?_0x185d7f[_0xdd16('0x111')][_0xdd16('0x117')]:_0x185d7f[_0xdd16('0x75')][_0xdd16('0x117')],_0x185d7f['dialOriginateCallerIdName'],_0x185d7f['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x185d7f[_0xdd16('0x11b')],_0x185d7f[_0xdd16('0x119')]):_0x185d7f[_0xdd16('0x11b')]);if(_0x44374f){_0x2c5046[_0xdd16('0x11d')]=ut[_0xdd16('0x11e')](_0x44374f);_0x2c5046[_0xdd16('0x11f')]=ut[_0xdd16('0x120')](_0x44374f);}var _0x59e83c=ut[_0xdd16('0x121')](_0x185d7f,_0x3e3d98,_0x2f502d,_0x44374f,_0x3750c6,_0x2c5046);var _0x6447a6=utils[_0xdd16('0x122')](_0x3e3d98[_0xdd16('0x123')]);Object[_0xdd16('0x124')](_0x59e83c,_0x6447a6);_[_0xdd16('0x125')](_0x2c5046,ut[_0xdd16('0x126')](_0x59e83c));_0x2c5046['starttime']=moment()[_0xdd16('0x27')](_0xdd16('0x63'));_0x185d7f[_0xdd16('0x127')]=_0x59e83c;var _0x144512=ut['variablesAction'](_0x2c5046,_0x185d7f,_0x59e83c,_0x2c5046[_0xdd16('0x8c')],_0x21d117);return ami[_0xdd16('0x49')](_0x144512)[_0xdd16('0x59')](function(_0x1b8a15){_0x185d7f[_0xdd16('0x2c')]+=0x1;logger['info'](_0xdd16('0x128'),_0x3750c6,_0xdd16('0x94'),_0x185d7f[_0xdd16('0x29')],'originated:\x20',_0x185d7f[_0xdd16('0x2c')]);_0x4823f6(_0x1b8a15);})['catch'](function(_0x3f1b5c){ut[_0xdd16('0xe0')](_0x2c5046,0xe,_0xdd16('0x129'));rpcDb['createAgentHistory'](_0x2c5046,_0xdd16('0x12a'));_0x3b51ed(_0x3f1b5c);});});};Preview[_0xdd16('0xd')][_0xdd16('0x1c')]=function(_0x264489){if(this[_0xdd16('0x15')][_0x264489['linkedid']]){this[_0xdd16('0x15')][_0x264489['linkedid']][_0xdd16('0x4b')]=_0x264489[_0xdd16('0x4b')];}};Preview['prototype'][_0xdd16('0x12b')]=function(_0x45617a){var _0x595de0=this;var _0x21d868=this['actions'][_0x45617a[_0xdd16('0x12c')]];if(_0x21d868){if(_0x21d868['lookAgent']&&this[_0xdd16('0x16')][_0x21d868[_0xdd16('0x12d')]]){ut[_0xdd16('0x12e')](_0x21d868,this[_0xdd16('0x16')][_0x21d868[_0xdd16('0x12d')]]['name'],this['agents'][_0x21d868[_0xdd16('0x12d')]]['id']);}var _0x4eaa45=_['clone'](_0x21d868);_0x4eaa45[_0xdd16('0x12f')]=moment()['format'](_0xdd16('0x63'));var _0x454499=_0x595de0[_0xdd16('0x12')][_0x21d868[_0xdd16('0x45')]];if(ut['isFailure'](_0x45617a[_0xdd16('0x130')])){if(_0x21d868['unlockAgent']){rpcDb[_0xdd16('0xff')](_0x21d868[_0xdd16('0x8f')]);}if(_0x21d868[_0xdd16('0x8c')]){rpcDb[_0xdd16('0x62')](_0x21d868[_0xdd16('0x8f')]);}ami[_0xdd16('0x23')](_0xdd16('0x131'),ut[_0xdd16('0x7e')](_0x21d868,_0xdd16('0x132'),this[_0xdd16('0x12')][_0x21d868[_0xdd16('0x45')]]));this[_0xdd16('0x133')](_0x4eaa45,_0x454499,_0x45617a);}else{_0x21d868[_0xdd16('0x134')]=moment()['format'](_0xdd16('0x63'));ut[_0xdd16('0xe0')](_0x4eaa45,0x4,'Answer');rpcDb[_0xdd16('0xe1')](_0x4eaa45,_0xdd16('0x135'));}}};Preview[_0xdd16('0xd')][_0xdd16('0x18')]=function(_0x8e780a){var _0x50f41a=this[_0xdd16('0x15')][_0x8e780a[_0xdd16('0x8d')]];var _0x1a8e61;if(_0x50f41a){_0x1a8e61=this['campaignsPreview'][_0x50f41a[_0xdd16('0x45')]];logger['info'](_0xdd16('0x136'),_0x8e780a[_0xdd16('0x8d')],_0xdd16('0x94'),_0x1a8e61[_0xdd16('0x29')],'pTalking:\x20',_0x1a8e61[_0xdd16('0x2d')]);}if(this[_0xdd16('0x15')][_0x8e780a[_0xdd16('0x8d')]]&&_0x8e780a[_0xdd16('0x8d')]!==_0x8e780a[_0xdd16('0xa6')]){if(_0x8e780a[_0xdd16('0x137')]==='16'&&this[_0xdd16('0x15')][_0x8e780a[_0xdd16('0x8d')]][_0xdd16('0x50')]){this[_0xdd16('0x78')](_0x8e780a,_0x8e780a['linkedid'],_0x8e780a['cause']);}else if(this[_0xdd16('0x15')][_0x8e780a['linkedid']]['dialAnswer']){logger[_0xdd16('0x24')](_0xdd16('0x138'),_0x8e780a[_0xdd16('0x8d')],_0x8e780a['cause'],'\x20Queue',_0x1a8e61['name'],_0xdd16('0x95'),_0x1a8e61[_0xdd16('0x2d')]);this['callProgressDetectingCustomer'](_0x8e780a,_0x8e780a[_0xdd16('0x8d')],_0x8e780a[_0xdd16('0x137')]);}}else if(_0x50f41a&&_[_0xdd16('0x43')](_0x50f41a[_0xdd16('0x139')])&&_0x1a8e61[_0xdd16('0x13a')]&&_0x8e780a['linkedid']===_0x8e780a[_0xdd16('0xa6')]&&_[_0xdd16('0x43')](_0x8e780a[_0xdd16('0xdf')])&&_0x8e780a[_0xdd16('0x137')]==='16'&&_0x8e780a[_0xdd16('0x13b')]==='6'&&_[_0xdd16('0xde')](_0x50f41a[_0xdd16('0x13c')])){if(_0x50f41a[_0xdd16('0x8b')]){rpcDb[_0xdd16('0xff')](_0x50f41a['idContact']);}if(_0x50f41a['activeContact']){rpcDb[_0xdd16('0x62')](_0x50f41a['idContact']);}_0x8e780a[_0xdd16('0xdf')]='22';this[_0xdd16('0x133')](_0x50f41a,_0x1a8e61,_0x8e780a);}else if(_0x50f41a&&_0x50f41a[_0xdd16('0x13c')]){if(_0x8e780a[_0xdd16('0x137')]==='16'&&this['actions'][_0x8e780a[_0xdd16('0x8d')]][_0xdd16('0x50')]){logger[_0xdd16('0x24')]('[syncHangup][talking][transfer]',_0x8e780a[_0xdd16('0x8d')],_0x8e780a[_0xdd16('0x137')],_0xdd16('0x94'),_0x1a8e61[_0xdd16('0x29')],'pTalking:\x20',_0x1a8e61[_0xdd16('0x2d')]);this[_0xdd16('0x78')](_0x8e780a,_0x8e780a[_0xdd16('0x8d')],_0x8e780a[_0xdd16('0x137')]);}else if(this[_0xdd16('0x15')][_0x8e780a[_0xdd16('0x8d')]][_0xdd16('0x50')]){logger[_0xdd16('0x24')]('[syncHangup][talking][cause]',_0x8e780a[_0xdd16('0x8d')],_0x8e780a['cause'],_0xdd16('0x94'),_0x1a8e61[_0xdd16('0x29')],_0xdd16('0x95'),_0x1a8e61['pTalking']);this[_0xdd16('0x78')](_0x8e780a,_0x8e780a['linkedid'],_0x8e780a[_0xdd16('0x137')]);}}};Preview[_0xdd16('0xd')]['syncDialEnd']=function(_0x566219){if(this[_0xdd16('0x15')][_0x566219[_0xdd16('0xdb')]]&&_0x566219['destlinkedid']!==_0x566219[_0xdd16('0x13d')]){this['callProgressDetectingCustomer'](_0x566219,_0x566219[_0xdd16('0xdb')],_0x566219[_0xdd16('0xd6')]);}};Preview['prototype'][_0xdd16('0x19')]=function(_0xaff14d){if(this[_0xdd16('0x15')][_0xaff14d['linkedid']]&&_0xaff14d['linkedid']!==_0xaff14d[_0xdd16('0xa6')]&&!this[_0xdd16('0x15')][_0xaff14d[_0xdd16('0x8d')]][_0xdd16('0x50')]){if(_0xaff14d[_0xdd16('0x137')]==='1'){this[_0xdd16('0x78')](_0xaff14d,_0xaff14d[_0xdd16('0x8d')],_0xaff14d['cause']);}}};Preview[_0xdd16('0xd')][_0xdd16('0x13e')]=function(_0x20b641,_0x5d70bd,_0x491d70){if(this[_0xdd16('0x15')][_0x20b641]){if(_['isNil'](this[_0xdd16('0x15')][_0x20b641][_0xdd16('0x127')])){this[_0xdd16('0x15')][_0x20b641][_0xdd16('0x127')]={};}this[_0xdd16('0x15')][_0x20b641][_0xdd16('0x127')][_0x5d70bd]=_0x491d70;}};Preview[_0xdd16('0xd')][_0xdd16('0x1e')]=function(_0x5aa88b){try{if(!_[_0xdd16('0x43')](_0x5aa88b)){if(ut[_0xdd16('0x13f')](_[_0xdd16('0x140')](_0x5aa88b[_0xdd16('0x141')])[0x0])){this[_0xdd16('0x13e')](_0x5aa88b['uniqueid'],_['keys'](_0x5aa88b[_0xdd16('0x141')])[0x0],_0x5aa88b[_0xdd16('0x142')]);}}}catch(_0x1d267e){logger[_0xdd16('0x143')](_0xdd16('0x144'),util[_0xdd16('0x145')](_0x1d267e,{'showHidden':![],'depth':null}));}};Preview[_0xdd16('0xd')][_0xdd16('0x20')]=function(_0x3444c2){if(_0x3444c2){if(this[_0xdd16('0x15')][_0x3444c2[_0xdd16('0x146')]]){this[_0xdd16('0x15')][_0x3444c2[_0xdd16('0x146')]]['transfer']=!![];}}};Preview['prototype'][_0xdd16('0x21')]=function(_0x1c5517){if(_0x1c5517){if(this['actions'][_0x1c5517[_0xdd16('0x147')]]){this[_0xdd16('0x15')][_0x1c5517[_0xdd16('0x147')]]['transfer']=!![];}}};module[_0xdd16('0x148')]=Preview; \ No newline at end of file +var _0x0278=['dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[originated][decrement][callProgressDetectingCustomer]','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','phone','lookAgent','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','active','SIP/%s','reachable','unmonitored','unlockContact','execRun','getContactPreview','recallme','validateContact','isValid','[Preview][checkIsBlackList]','Call\x20unsuccessful','isEmpty','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','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','execCall','Trunk','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','callerid','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','getCallerId','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','setXMDContactVariables','Contact','merge','toLowerVariables','starttime','variables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','response','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','channelstate','transfer','callProgressDetectingAgent','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','addVariable','filterKey','variable','value','error','inspect','transfertargetlinkedid','transfererlinkedid','lodash','uuid','moment','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./util/util','../dialer/utils','redis','defaults','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','originated','pTalking','available','paused','message','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','name','\x20is\x20not\x20active','DEACTIVATED','\x20is\x20deactivated','hasOwnProperty','dialMethod','booked','outbound','clearZombieChannels','type','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','info','[clearZombieChannels][talking]','queue','originated:\x20','stringify','pTalking:\x20','pick','contactId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','format','outboundReCallsDay','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','sendMessageOneNotActive','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','callAdditionalPhoneAfterMin','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','answered','decrementTalkink','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','talktime','sumBillable','linkedid','BUSY','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','busy','[callProgressDetectingCustomer][logBusy]','additional','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','unlockAgent','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','activeContact','outboundCongestionCallsDay','Congestion','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','countcongestionretry','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry'];(function(_0x257e8f,_0xdc7fc9){var _0x2d8b1e=function(_0x24739a){while(--_0x24739a){_0x257e8f['push'](_0x257e8f['shift']());}};_0x2d8b1e(++_0xdc7fc9);}(_0x0278,0x7d));var _0x8027=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x0278[_0x4fde08];return _0x12e725;};'use strict';var util=require('util');var _=require(_0x8027('0x0'));var uuid=require(_0x8027('0x1'));var moment=require(_0x8027('0x2'));var Redis=require(_0x8027('0x3'));var config=require(_0x8027('0x4'));var logger=require('../../../config/logger')(_0x8027('0x5'));var loggerAction=require(_0x8027('0x6'))(_0x8027('0x7'));var ami=require(_0x8027('0x8'));var rpcDb=require(_0x8027('0x9'));var cmHopperAdditionalPhone=require(_0x8027('0xa'));var Action=require('./action');var ut=require(_0x8027('0xb'));var utils=require(_0x8027('0xc'));config[_0x8027('0xd')]=_[_0x8027('0xe')](config[_0x8027('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0x8027('0xf'))(new Redis(config[_0x8027('0xd')]));var Sequence=function(){};Sequence[_0x8027('0x10')]['enqueue']=function(_0x404c05){this['tail']=this[_0x8027('0x11')]?this[_0x8027('0x11')][_0x8027('0x12')](_0x404c05):_0x404c05();};function Preview(_0x4eef66){this[_0x8027('0x13')]=new Sequence();this[_0x8027('0x14')]=_0x4eef66[_0x8027('0x15')];this[_0x8027('0x16')]=_0x4eef66['trunks'];this[_0x8027('0x17')]={};this[_0x8027('0x18')]=_0x4eef66[_0x8027('0x18')];this[_0x8027('0x19')]=0x0;ami['on'](_0x8027('0x1a'),this[_0x8027('0x1b')][_0x8027('0x1c')](this));ami['on'](_0x8027('0x1d'),this['syncHangup'][_0x8027('0x1c')](this));ami['on']('hanguprequest',this[_0x8027('0x1e')][_0x8027('0x1c')](this));ami['on'](_0x8027('0x1f'),this[_0x8027('0x20')][_0x8027('0x1c')](this));ami['on'](_0x8027('0x21'),this[_0x8027('0x22')][_0x8027('0x1c')](this));ami['on'](_0x8027('0x23'),this[_0x8027('0x24')][_0x8027('0x1c')](this));ami['on'](_0x8027('0x25'),this[_0x8027('0x26')][_0x8027('0x1c')](this));ami['on'](_0x8027('0x27'),this[_0x8027('0x28')][_0x8027('0x1c')](this));this[_0x8027('0x29')](this[_0x8027('0x14')]);}function emit(_0x26f6aa,_0x396ac3,_0x5078fc){io['to'](_0x26f6aa)[_0x8027('0x2a')](_0x396ac3,_0x5078fc);}function emitVoiceQueueChannelRemove(_0x20eff1){logger['info']('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x20eff1));emit(util['format'](_0x8027('0x2b'),_0x20eff1['name']),_0x8027('0x2c'),_0x20eff1);io['emit'](_0x8027('0x2d'),_0x20eff1);}function notSendMessagesQueue(_0xd56427){if(_0xd56427['sendMessageOneNotActive']){if(_0xd56427[_0x8027('0x2e')]===0x0&&_0xd56427[_0x8027('0x2f')]===0x0){_0xd56427['sendMessageOneNotActive']=![];_0xd56427[_0x8027('0x30')]=0x0;_0xd56427[_0x8027('0x31')]=0x0;_0xd56427[_0x8027('0x32')]=utils[_0x8027('0x33')][_0x8027('0x34')];ut[_0x8027('0x35')](_0x8027('0x36'),_0xd56427[_0x8027('0x37')]+_0x8027('0x38'));}else{_0xd56427[_0x8027('0x32')]=utils[_0x8027('0x33')][_0x8027('0x39')];ut[_0x8027('0x35')](_0x8027('0x36'),_0xd56427[_0x8027('0x37')]+_0x8027('0x3a'));}}}Preview[_0x8027('0x10')][_0x8027('0x29')]=function(){var _0x336ccb=this;setInterval(function(){_0x336ccb['syncCampaigns']();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x2069e4=this[_0x8027('0x14')];this['clockClearZombieChannels']+=0x1;for(var _0x2e5c4b in _0x2069e4){if(_0x2069e4[_0x8027('0x3b')](_0x2e5c4b)&&(_0x2069e4[_0x2e5c4b][_0x8027('0x3c')]===_0x8027('0x5')||_0x2069e4[_0x2e5c4b][_0x8027('0x3c')]===_0x8027('0x3d'))&&_0x2069e4[_0x2e5c4b]['type']===_0x8027('0x3e')){if(this[_0x8027('0x19')]>0x7){this[_0x8027('0x19')]=0x0;this[_0x8027('0x3f')]();}}if(_0x2069e4[_0x8027('0x3b')](_0x2e5c4b)&&_0x2069e4[_0x2e5c4b][_0x8027('0x3c')]===_0x8027('0x5')&&_0x2069e4[_0x2e5c4b][_0x8027('0x40')]===_0x8027('0x3e')){if(_0x2069e4[_0x2e5c4b][_0x8027('0x41')]){this[_0x8027('0x42')](_0x2069e4[_0x2e5c4b]);if(_0x2069e4[_0x2e5c4b][_0x8027('0x43')])this[_0x8027('0x44')](_0x2069e4[_0x2e5c4b]);}else{notSendMessagesQueue(_0x2069e4[_0x2e5c4b]);}}}};Preview[_0x8027('0x10')][_0x8027('0x45')]=function(_0x2c25ff){var _0x8ce276=this;this[_0x8027('0x13')]['enqueue'](function(){if(!_[_0x8027('0x46')](_0x8ce276[_0x8027('0x17')][_0x2c25ff])){loggerAction[_0x8027('0x47')](_0x8027('0x48'),_0x2c25ff,'Queue',_0x8ce276[_0x8027('0x17')][_0x2c25ff][_0x8027('0x49')],_0x8027('0x4a'),JSON[_0x8027('0x4b')](_0x8ce276[_0x8027('0x14')][_0x8ce276[_0x8027('0x17')][_0x2c25ff][_0x8027('0x49')]]['originated']),_0x8027('0x4c'),JSON[_0x8027('0x4b')](_0x8ce276[_0x8027('0x14')][_0x8ce276[_0x8027('0x17')][_0x2c25ff]['queue']][_0x8027('0x2f')]),JSON[_0x8027('0x4b')](_0x8ce276[_0x8027('0x17')][_0x2c25ff]['dialAnswer']),JSON[_0x8027('0x4b')](_[_0x8027('0x4d')](_0x8ce276[_0x8027('0x17')][_0x2c25ff],[_0x8027('0x4e'),'UserId',_0x8027('0x4f'),_0x8027('0x50')])));return ami[_0x8027('0x51')]({'action':_0x8027('0x52'),'channel':_0x8ce276[_0x8027('0x17')][_0x2c25ff][_0x8027('0x53')]})[_0x8027('0x54')](function(_0x1759ec){if(_0x1759ec[_0x8027('0x32')]===_0x8027('0x55')){setTimeout(function(){if(_0x8ce276['actions'][_0x2c25ff]){ut[_0x8027('0x56')](_0x8ce276[_0x8027('0x14')][_0x8ce276[_0x8027('0x17')][_0x2c25ff][_0x8027('0x49')]],_0x8027('0x57'));if(_0x8ce276[_0x8027('0x17')][_0x2c25ff][_0x8027('0x58')]===!![]){ut['decrementTalkink'](_0x8ce276[_0x8027('0x14')][_0x8ce276[_0x8027('0x17')][_0x2c25ff]['queue']],'[clearZombieChannel]');ut['loggerError'](_0x8027('0x59')+_0x2c25ff,_0x8ce276[_0x8027('0x17')][_0x2c25ff]['queue']);}ut[_0x8027('0x5a')](_0x8027('0x5b')+_0x2c25ff,_0x8ce276[_0x8027('0x17')][_0x2c25ff][_0x8027('0x49')]);delete _0x8ce276[_0x8027('0x17')][_0x2c25ff];}},0x2328);}});}});};Preview[_0x8027('0x10')][_0x8027('0x3f')]=function(){var _0x2e7c01=this;loggerAction[_0x8027('0x47')](_0x8027('0x5c'),_[_0x8027('0x5d')](this[_0x8027('0x17')]));for(var _0x5dd7d2 in this[_0x8027('0x17')]){if(_0x2e7c01['actions']['hasOwnProperty'](_0x5dd7d2)){_0x2e7c01['clearZombieChannel'](_0x5dd7d2);}}};Preview[_0x8027('0x10')][_0x8027('0x44')]=function(_0x15ce43){var _0x260e41=this;rpcDb[_0x8027('0x5e')](_0x15ce43['id'],ut[_0x8027('0x5f')](this[_0x8027('0x18')]))[_0x8027('0x60')](function(_0x478059){if(!_[_0x8027('0x46')](_0x478059)){for(var _0x4b708b=0x0;_0x4b708b<_0x478059['length'];_0x4b708b+=0x1){if(ut['getDiff'](_0x478059[_0x4b708b][_0x8027('0x61')])<_0x15ce43[_0x8027('0x62')]*0x3c){if(_0x478059[_0x4b708b][_0x8027('0x63')]&&!_0x478059[_0x4b708b]['Agent'][_0x8027('0x64')]){_0x260e41[_0x8027('0x65')](_0x478059[_0x4b708b]['id'])[_0x8027('0x60')](ut[_0x8027('0x66')](_0x8027('0x67')))[_0x8027('0x54')](ut[_0x8027('0x66')](_0x8027('0x67')));}else{rpcDb[_0x8027('0x68')](_0x478059[_0x4b708b]['id']);}}else{var _0x1237d6=new Action(_0x478059[_0x4b708b],_0x15ce43);_0x1237d6['starttime']=moment()[_0x8027('0x69')]('YYYY-MM-DD\x20HH:mm:ss');_0x15ce43[_0x8027('0x6a')]+=0x1;ut[_0x8027('0x6b')](_0x1237d6,0x17,'RecallInQueue');if(_0x15ce43[_0x8027('0x6c')]){rpcDb[_0x8027('0x6d')](ut['createBody'](_0x478059[_0x4b708b]));rpcDb[_0x8027('0x6e')](_0x1237d6,_0x8027('0x6f'));}else{ut['logCustomer'](_0x1237d6,0x16,_0x8027('0x70'));rpcDb['createCustomerHistory'](_0x1237d6,_0x8027('0x71'));rpcDb[_0x8027('0x72')](_0x1237d6,_0x8027('0x71'));}}}}})[_0x8027('0x54')](ut[_0x8027('0x66')](_0x8027('0x73')));};Preview[_0x8027('0x10')]['setMessage']=function(_0x996e07){_0x996e07[_0x8027('0x74')]=!![];if(ut['IsNotLoggedIn'](_0x996e07['loggedIn'])){_0x996e07[_0x8027('0x32')]=utils[_0x8027('0x33')][_0x8027('0x75')];}else if(!ut[_0x8027('0x76')](_0x996e07[_0x8027('0x41')])){_0x996e07[_0x8027('0x32')]=utils[_0x8027('0x33')]['INACTIVE'];}else if(!this[_0x8027('0x77')](_0x996e07['Trunk'])){if(!this['isTrunkReachable'](_0x996e07['TrunkBackup'])){_0x996e07['message']=utils['CAMPAIGN_STATUS'][_0x8027('0x78')];}else{_0x996e07[_0x8027('0x32')]=utils[_0x8027('0x33')][_0x8027('0x79')];}}else{_0x996e07[_0x8027('0x32')]=utils['CAMPAIGN_STATUS']['ACTIVE'];}};Preview[_0x8027('0x10')][_0x8027('0x7a')]=function(_0x6c65c9,_0x3f2442,_0x135e44){var _0x195cec=this;var _0x2d83df=this[_0x8027('0x17')][_0x3f2442];var _0x3bc256=this[_0x8027('0x14')][_0x2d83df[_0x8027('0x49')]];var _0x144d0e;var _0x1949d5=![];var _0x19a93d=0x2;var _0xd089c7=0x3;if(_0x3bc256){switch(_0x135e44){case'1':_0x3bc256[_0x8027('0x7b')]+=0x1;_0x2d83df[_0x8027('0x7c')]+=0x1;_0x2d83df[_0x8027('0x7d')]=ut[_0x8027('0x7e')](_0x2d83df);ut[_0x8027('0x6b')](_0x2d83df,0x0,_0x8027('0x7f'));ami[_0x8027('0x2a')](_0x8027('0x80'),ut['buildObj'](_0x2d83df,_0x8027('0x81')));rpcDb[_0x8027('0x6e')](_0x2d83df,_0x8027('0x82'));_0x195cec[_0x8027('0x83')](_0x2d83df,'0',_0x3bc256)[_0x8027('0x60')](function(_0x155b5c){_0x1949d5=_0x155b5c['additional']==0x1;_0x19a93d=_0x3bc256['dialNoSuchNumberRetryFrequency'];_0xd089c7=_0x3bc256[_0x8027('0x84')];if(!_0x1949d5){if(ut[_0x8027('0x7e')](_0x2d83df)>=_0x3bc256['dialGlobalMaxRetry']){_0x144d0e=ut[_0x8027('0x85')](_0x2d83df,0xf,'Global');rpcDb[_0x8027('0x72')](_0x144d0e,_0x8027('0x86'));}else{if(_0x2d83df['countnosuchnumberretry']>=_0x3bc256[_0x8027('0x87')]){rpcDb[_0x8027('0x72')](_0x2d83df,_0x8027('0x86'));}else{rpcDb[_0x8027('0x88')](ut[_0x8027('0x89')](_0x2d83df,'countnosuchnumberretry',_0x3bc256[_0x8027('0x8a')]),_0x2d83df['unlockAgent'],_0x2d83df['activeContact']);}}delete this[_0x8027('0x17')][_0x6c65c9['linkedid']];}else{_0x2d83df[_0x8027('0x7c')]++;logger[_0x8027('0x47')](_0x8027('0x8b'),_0x2d83df['countnosuchnumberretry']);logger[_0x8027('0x47')]('id',_0x2d83df[_0x8027('0x8c')]);_0x195cec[_0x8027('0x8d')]({'id':_0x2d83df[_0x8027('0x8c')],'field':{'countnosuchnumberretry':_0x2d83df[_0x8027('0x7c')]}})[_0x8027('0x60')](function(){_0x195cec[_0x8027('0x8e')](_0x2d83df,_0x19a93d,_0xd089c7)['then'](function(){});});}});break;case _0x8027('0x8f'):var _0x386d1b=moment()[_0x8027('0x69')](_0x8027('0x90'));_0x2d83df[_0x8027('0x91')]=_0x386d1b;_0x2d83df[_0x8027('0x92')]=_0x386d1b;_0x2d83df[_0x8027('0x58')]=!![];_0x3bc256[_0x8027('0x2f')]+=0x1;logger[_0x8027('0x47')](_0x8027('0x93'),_0x2d83df[_0x8027('0x94')],_0x8027('0x95'),_0x3bc256[_0x8027('0x37')],'pTalking:\x20',_0x3bc256[_0x8027('0x2f')]);ami[_0x8027('0x2a')](_0x8027('0x96'),ut[_0x8027('0x97')](_0x2d83df,_0x8027('0x98'),this[_0x8027('0x14')][_0x2d83df[_0x8027('0x49')]]));if(_0x3bc256[_0x8027('0x99')]){ami[_0x8027('0x2a')](_0x8027('0x9a'),ut[_0x8027('0x9b')](_0x2d83df));}break;case'16':ami[_0x8027('0x2a')](_0x8027('0x9c'),ut[_0x8027('0x97')](_0x2d83df,'complete',this[_0x8027('0x14')][_0x2d83df[_0x8027('0x49')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x2d83df,_0x8027('0x9d')));_0x3bc256[_0x8027('0x9e')]+=0x1;_0x3bc256[_0x8027('0x9f')]+=0x1;_0x3bc256[_0x8027('0xa0')]+=0x1;ut[_0x8027('0xa1')](_0x3bc256,_0x8027('0xa2'));_0x2d83df['countglobal']=ut[_0x8027('0x7e')](_0x2d83df);ut[_0x8027('0x6b')](_0x2d83df,0x4,'Answer');rpcDb[_0x8027('0x6e')](_0x2d83df,_0x8027('0xa3'));rpcDb[_0x8027('0x72')](_0x2d83df,_0x8027('0xa4'));rpcDb['crateCustomerReportQueue'](_0x2d83df);_0x3bc256[_0x8027('0xa5')]+=_0x2d83df[_0x8027('0xa6')];_0x3bc256[_0x8027('0xa7')]+=_0x2d83df[_0x8027('0xa6')];logger[_0x8027('0x47')]('[syncHangup][talking][decrement]',_0x2d83df[_0x8027('0x94')],_0x8027('0x95'),_0x3bc256[_0x8027('0x37')],_0x8027('0x4c'),_0x3bc256['pTalking']);delete this[_0x8027('0x17')][_0x6c65c9[_0x8027('0xa8')]];break;case _0x8027('0xa9'):_0x3bc256[_0x8027('0xaa')]+=0x1;_0x2d83df[_0x8027('0xab')]+=0x1;_0x2d83df[_0x8027('0x7d')]=ut[_0x8027('0x7e')](_0x2d83df);ut[_0x8027('0x6b')](_0x2d83df,0x5,_0x8027('0xac'));_0x19a93d=_0x3bc256[_0x8027('0xad')];_0xd089c7=_0x3bc256[_0x8027('0x84')];ami['emit']('custom:agentbusy',ut[_0x8027('0x97')](_0x2d83df,_0x8027('0xae')));rpcDb[_0x8027('0x6e')](_0x2d83df,_0x8027('0xaf'));_0x195cec['verifyAdditionalPhones'](_0x2d83df,'5',_0x3bc256)[_0x8027('0x60')](function(_0x3a5248){_0x1949d5=_0x3a5248[_0x8027('0xb0')]==0x1;if(!_0x1949d5){if(ut[_0x8027('0x7e')](_0x2d83df)>=_0x3bc256[_0x8027('0xb1')]){_0x144d0e=ut[_0x8027('0x85')](_0x2d83df,0xf,_0x8027('0xb2'));rpcDb[_0x8027('0x72')](_0x144d0e,_0x8027('0xb3'));}else{if(_0x2d83df[_0x8027('0xab')]>=_0x3bc256['dialBusyMaxRetry']){rpcDb[_0x8027('0x72')](_0x2d83df,_0x8027('0xaf'));}else{rpcDb[_0x8027('0x88')](ut[_0x8027('0x89')](_0x2d83df,_0x8027('0xab'),_0x3bc256['dialBusyRetryFrequency']),_0x2d83df[_0x8027('0xb4')],_0x2d83df['activeContact']);}}}else{_0x2d83df['countbusyretry']++;_0x195cec[_0x8027('0x8d')]({'id':_0x2d83df[_0x8027('0x8c')],'field':{'countbusyretry':_0x2d83df[_0x8027('0xab')]}})[_0x8027('0x60')](function(){_0x195cec[_0x8027('0x8e')](_0x2d83df,_0x19a93d,_0xd089c7)['then'](function(){});});}});break;case _0x8027('0xb5'):_0x3bc256[_0x8027('0xb6')]+=0x1;_0x2d83df[_0x8027('0xb7')]+=0x1;_0x2d83df[_0x8027('0x7d')]=ut[_0x8027('0x7e')](_0x2d83df);ut[_0x8027('0x6b')](_0x2d83df,0x3,_0x8027('0xb8'));_0x19a93d=_0x3bc256[_0x8027('0xb9')];_0xd089c7=_0x3bc256[_0x8027('0x84')];var _0x5e10f1=ut['buildNoAnswerEventPayload'](_0x2d83df,_0x3bc256);ami[_0x8027('0x2a')](_0x8027('0xba'),_0x5e10f1);rpcDb[_0x8027('0x6e')](_0x2d83df,'[callProgressDetectingCustomer][logNoAnswer]');_0x195cec[_0x8027('0x83')](_0x2d83df,'3',_0x3bc256)['then'](function(_0x348a65){_0x1949d5=_0x348a65[_0x8027('0xb0')]==0x1;if(!_0x1949d5){if(ut[_0x8027('0x7e')](_0x2d83df)>=_0x3bc256[_0x8027('0xb1')]){_0x144d0e=ut[_0x8027('0x85')](_0x2d83df,0xf,_0x8027('0xb2'));rpcDb[_0x8027('0x72')](_0x144d0e,_0x8027('0xbb'));}else{if(_0x2d83df['countnoanswerretry']>=_0x3bc256[_0x8027('0xbc')]){rpcDb[_0x8027('0x72')](_0x2d83df,_0x8027('0xbd'));}else{rpcDb['rescheduleContact'](ut[_0x8027('0x89')](_0x2d83df,'countnoanswerretry',_0x3bc256[_0x8027('0xb9')]),_0x2d83df[_0x8027('0xb4')],_0x2d83df[_0x8027('0xbe')]);}}}else{_0x2d83df[_0x8027('0xb7')]++;_0x195cec[_0x8027('0x8d')]({'id':_0x2d83df[_0x8027('0x8c')],'field':{'countnoanswerretry':_0x2d83df['countnoanswerretry']}})[_0x8027('0x60')](function(){_0x195cec['swapAdditionalPhones'](_0x2d83df,_0x19a93d,_0xd089c7)[_0x8027('0x60')](function(){});});}});break;case'CONGESTION':_0x3bc256[_0x8027('0xbf')]+=0x1;_0x2d83df['countcongestionretry']+=0x1;_0x2d83df['countglobal']=ut[_0x8027('0x7e')](_0x2d83df);ut['logCustomer'](_0x2d83df,0x8,_0x8027('0xc0'));_0x19a93d=_0x3bc256['dialCongestionRetryFrequency'];_0xd089c7=_0x3bc256['callAdditionalPhoneAfterMin'];ami['emit'](_0x8027('0xc1'),ut[_0x8027('0x97')](_0x2d83df,'congestion'));rpcDb[_0x8027('0x6e')](_0x2d83df,_0x8027('0xc2'));_0x195cec[_0x8027('0x83')](_0x2d83df,'8',_0x3bc256)[_0x8027('0x60')](function(_0x27bd1f){_0x1949d5=_0x27bd1f['additional']==0x1;if(!_0x1949d5){if(ut[_0x8027('0x7e')](_0x2d83df)>=_0x3bc256['dialGlobalMaxRetry']){_0x144d0e=ut[_0x8027('0x85')](_0x2d83df,0xf,_0x8027('0xb2'));rpcDb[_0x8027('0x72')](_0x144d0e,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x2d83df[_0x8027('0xc3')]>=_0x3bc256[_0x8027('0xc4')]){rpcDb[_0x8027('0x72')](_0x2d83df,_0x8027('0xc2'));}else{rpcDb['rescheduleContact'](ut[_0x8027('0x89')](_0x2d83df,'countcongestionretry',_0x3bc256['dialBusyRetryFrequency']),_0x2d83df[_0x8027('0xb4')],_0x2d83df[_0x8027('0xbe')]);}}}else{_0x2d83df['countcongestionretry']++;_0x195cec[_0x8027('0x8d')]({'id':_0x2d83df[_0x8027('0x8c')],'field':{'countcongestionretry':_0x2d83df[_0x8027('0xc3')]}})['then'](function(){_0x195cec[_0x8027('0x8e')](_0x2d83df,_0x19a93d,_0xd089c7)[_0x8027('0x60')](function(){});});}});break;case _0x8027('0xc5'):_0x3bc256[_0x8027('0xc6')]+=0x1;_0x2d83df[_0x8027('0xc7')]+=0x1;_0x2d83df['countglobal']=ut[_0x8027('0x7e')](_0x2d83df);ut[_0x8027('0x6b')](_0x2d83df,0x14,'AgentReject');_0x19a93d=_0x3bc256[_0x8027('0xc8')];_0xd089c7=_0x3bc256[_0x8027('0x84')];ami[_0x8027('0x2a')](_0x8027('0xc9'),ut[_0x8027('0x97')](_0x2d83df,_0x8027('0xca')));rpcDb[_0x8027('0x6e')](_0x2d83df,_0x8027('0xcb'));_0x195cec[_0x8027('0x83')](_0x2d83df,'20',_0x3bc256)[_0x8027('0x60')](function(_0x4b78a5){_0x1949d5=_0x4b78a5[_0x8027('0xb0')]==0x1;if(!_0x1949d5){if(ut[_0x8027('0x7e')](_0x2d83df)>=_0x3bc256[_0x8027('0xb1')]){_0x144d0e=ut[_0x8027('0x85')](_0x2d83df,0x14,_0x8027('0xcc'));rpcDb['createCustomerFinal'](_0x144d0e,_0x8027('0xcd'));}else{if(_0x2d83df[_0x8027('0xc7')]>=_0x3bc256[_0x8027('0xce')]){rpcDb['createCustomerFinal'](_0x2d83df,_0x8027('0xcd'));}else{rpcDb[_0x8027('0x88')](ut[_0x8027('0x89')](_0x2d83df,'countagentrejectretry',_0x3bc256[_0x8027('0xc8')]),_0x2d83df['unlockAgent'],_0x2d83df[_0x8027('0xbe')]);}}}else{_0x2d83df[_0x8027('0xb7')]++;_0x195cec['incrementPreviewCounters']({'id':_0x2d83df[_0x8027('0x8c')],'field':{'countnoanswerretry':_0x2d83df['countnoanswerretry']}})[_0x8027('0x60')](function(){_0x195cec[_0x8027('0x8e')](_0x2d83df,_0x19a93d,_0xd089c7)[_0x8027('0x60')](function(){});});}});break;case _0x8027('0xcf'):_0x3bc256[_0x8027('0xd0')]+=0x1;_0x2d83df['countabandonedretry']+=0x1;_0x2d83df[_0x8027('0x7d')]=ut[_0x8027('0x7e')](_0x2d83df);ut[_0x8027('0x6b')](_0x2d83df,0xb,_0x8027('0xd1'));rpcDb[_0x8027('0x6e')](_0x2d83df,_0x8027('0xd2'));_0x195cec[_0x8027('0x83')](_0x2d83df,'11',_0x3bc256)[_0x8027('0x60')](function(_0x242e68){_0x1949d5=_0x242e68[_0x8027('0xb0')]==0x1;if(!_0x1949d5){if(ut[_0x8027('0x7e')](_0x2d83df)>=_0x3bc256[_0x8027('0xb1')]){_0x144d0e=ut[_0x8027('0x85')](_0x2d83df,0xf,_0x8027('0xb2'));rpcDb['createCustomerFinal'](_0x144d0e,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x2d83df[_0x8027('0xd3')]>=_0x3bc256[_0x8027('0xd4')]){rpcDb[_0x8027('0x72')](_0x2d83df,_0x8027('0xd2'));}else{rpcDb[_0x8027('0x88')](ut['scheduledAt'](_0x2d83df,'countabandonedretry',_0x3bc256['dialAbandonedRetryFrequency']),_0x2d83df[_0x8027('0xb4')],_0x2d83df[_0x8027('0xbe')]);}}}else{_0x2d83df[_0x8027('0xb7')]++;_0x195cec[_0x8027('0x8d')]({'id':_0x2d83df[_0x8027('0x8c')],'field':{'countnoanswerretry':_0x2d83df[_0x8027('0xb7')]}})['then'](function(){_0x195cec[_0x8027('0x8e')](_0x2d83df,_0x19a93d,_0xd089c7)['then'](function(){});});}});break;case'18':_0x3bc256['outboundUnknownCallsDay']+=0x1;_0x2d83df[_0x8027('0xd5')]+=0x1;_0x2d83df[_0x8027('0x7d')]=ut['totalGlobal'](_0x2d83df);ut[_0x8027('0x6b')](_0x2d83df,0x12,_0x6c65c9[_0x8027('0xd6')]||_0x6c65c9[_0x8027('0xd7')]);ami[_0x8027('0x2a')](_0x8027('0xd8'),ut['buildObj'](_0x2d83df,_0x8027('0xd9')));rpcDb[_0x8027('0x6e')](_0x2d83df,_0x8027('0xda'));_0x195cec['verifyAdditionalPhones'](_0x2d83df,'18',_0x3bc256)[_0x8027('0x60')](function(_0x516de3){_0x1949d5=_0x516de3[_0x8027('0xb0')]==0x1;if(!_0x1949d5){if(ut['totalGlobal'](_0x2d83df)>=_0x3bc256[_0x8027('0xb1')]){_0x144d0e=ut['cloneAction'](_0x2d83df,0x12,'Global');rpcDb[_0x8027('0x72')](_0x144d0e,_0x8027('0xda'));}else{rpcDb[_0x8027('0x72')](_0x2d83df,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x2d83df['countnoanswerretry']++;_0x195cec[_0x8027('0x8d')]({'id':_0x2d83df[_0x8027('0x8c')],'field':{'countnoanswerretry':_0x2d83df[_0x8027('0xb7')]}})[_0x8027('0x60')](function(){_0x195cec[_0x8027('0x8e')](_0x2d83df,_0x19a93d,_0xd089c7)[_0x8027('0x60')](function(){});});}});delete this[_0x8027('0x17')][_0x6c65c9[_0x8027('0xa8')]];break;case'19':_0x3bc256[_0x8027('0xdb')]+=0x1;_0x2d83df[_0x8027('0x7d')]=ut[_0x8027('0x7e')](_0x2d83df);ut[_0x8027('0x6b')](_0x2d83df,0x13,_0x6c65c9['cause-txt']||_0x6c65c9[_0x8027('0xd7')]);ami[_0x8027('0x2a')](_0x8027('0xd8'),ut[_0x8027('0x97')](_0x2d83df,_0x8027('0xd9')));rpcDb[_0x8027('0x6e')](_0x2d83df,'[callProgressDetectingCustomer][machine]');_0x195cec[_0x8027('0x83')](_0x2d83df,'18',_0x3bc256)[_0x8027('0x60')](function(_0x5c1fe3){_0x1949d5=_0x5c1fe3['additional']==0x1;if(!_0x1949d5){if(ut[_0x8027('0x7e')](_0x2d83df)>=_0x3bc256[_0x8027('0xb1')]){_0x144d0e=ut['cloneAction'](_0x2d83df,0xf,_0x8027('0xb2'));rpcDb['createCustomerFinal'](_0x144d0e,_0x8027('0xdc'));}else{rpcDb[_0x8027('0x72')](_0x2d83df,_0x8027('0xdc'));}}else{_0x2d83df['countnoanswerretry']++;_0x195cec[_0x8027('0x8d')]({'id':_0x2d83df[_0x8027('0x8c')],'field':{'countnoanswerretry':_0x2d83df[_0x8027('0xb7')]}})[_0x8027('0x60')](function(){_0x195cec[_0x8027('0x8e')](_0x2d83df,_0x19a93d,_0xd089c7)[_0x8027('0x60')](function(){});});}});delete this[_0x8027('0x17')][_0x6c65c9[_0x8027('0xa8')]];break;default:if(_0x2d83df[_0x8027('0x58')]){ut[_0x8027('0xa1')](_0x3bc256,'[default]');ut['loggerError'](_0x8027('0xdd')+_0x3bc256[_0x8027('0x37')],_0x6c65c9);}_0x3bc256[_0x8027('0xdb')]+=0x1;_0x2d83df[_0x8027('0x7d')]=ut[_0x8027('0x7e')](_0x2d83df);ut[_0x8027('0x6b')](_0x2d83df,0xc,_0x6c65c9['cause-txt']||_0x6c65c9[_0x8027('0xd7')]);_0x19a93d=_0x3bc256[_0x8027('0xc8')];_0xd089c7=_0x3bc256[_0x8027('0x84')];rpcDb['createCustomerHistory'](_0x2d83df,'[callProgressDetectingCustomer][logUnknown]');_0x195cec[_0x8027('0x83')](_0x2d83df,'20',_0x3bc256)[_0x8027('0x60')](function(_0x13113f){_0x1949d5=_0x13113f[_0x8027('0xb0')]==0x1;if(!_0x1949d5){if(ut['totalGlobal'](_0x2d83df)>=_0x3bc256[_0x8027('0xb1')]){_0x144d0e=ut['cloneAction'](_0x2d83df,0xf,'Global');rpcDb[_0x8027('0x72')](_0x144d0e,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x8027('0x72')](_0x2d83df,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x8027('0x17')][_0x6c65c9[_0x8027('0xa8')]];}else{_0x195cec['swapAdditionalPhones'](_0x2d83df,_0x19a93d,_0xd089c7)['then'](function(){});}});}if(!(_0x2d83df['dialAnswer']&&_0x135e44==='16')){ut['updateOriginated'](_0x3bc256,'[callProgressDetectingCustomer]');logger[_0x8027('0x47')](_0x8027('0xde'),_0x2d83df[_0x8027('0x94')],_0x8027('0x95'),_0x3bc256[_0x8027('0x37')],_0x8027('0x4a'),_0x3bc256[_0x8027('0x2e')]);}if(_0x135e44!==_0x8027('0x8f')){delete this[_0x8027('0x17')][_0x6c65c9['linkedid']];delete this[_0x8027('0x17')][_0x6c65c9['destlinkedid']];}_0x3bc256['queueSummaryCountersUpdated']=!![];}};Preview[_0x8027('0x10')]['callProgressDetectingAgent']=function(_0x3974f0,_0x3bb975,_0x13df40){if(_[_0x8027('0xdf')](_0x3bb975)&&_0x8027('0xe0')!==typeof _0x3bb975){return;}if(_[_0x8027('0xdf')](_0x13df40)&&_0x8027('0xe0')!==typeof _0x13df40){return;}switch(_0x13df40[_0x8027('0xe1')]){case'0':ut[_0x8027('0xe2')](_0x3974f0,0x0,_0x8027('0x7f'));rpcDb[_0x8027('0xe3')](_0x3974f0,_0x8027('0xe4'));break;case'3':ut['logAgent'](_0x3974f0,0x3,'NoAnswer');rpcDb[_0x8027('0xe3')](_0x3974f0,_0x8027('0xe5'));break;case'5':ut['logAgent'](_0x3974f0,0x5,'Busy');rpcDb[_0x8027('0xe3')](_0x3974f0,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x8027('0xe2')](_0x3974f0,0x8,_0x8027('0xc0'));rpcDb[_0x8027('0xe3')](_0x3974f0,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x8027('0xe2')](_0x3974f0,0x16,_0x8027('0xe6'));rpcDb[_0x8027('0xe3')](_0x3974f0,_0x8027('0xe7'));break;default:ut[_0x8027('0xe2')](_0x3974f0,0xc,_0x13df40['reason']);rpcDb[_0x8027('0xe3')](_0x3974f0,_0x8027('0xe8'));}ut['updateOriginated'](_0x3bb975,_0x8027('0xe9'));logger[_0x8027('0x47')](_0x8027('0xea'),_0x3974f0[_0x8027('0x94')],_0x8027('0x95'),_0x3bb975[_0x8027('0x37')],_0x8027('0x4a'),_0x3bb975[_0x8027('0x2e')]);delete this['actions'][_0x3974f0[_0x8027('0x94')]];};Preview[_0x8027('0x10')][_0x8027('0x83')]=function(_0x5a652e,_0x26bead,_0x237f6e){return cmHopperAdditionalPhone[_0x8027('0x83')](_0x5a652e,_0x26bead,_0x237f6e)[_0x8027('0x54')](logger[_0x8027('0x47')](_0x8027('0xeb')));};Preview[_0x8027('0x10')][_0x8027('0x8e')]=function(_0x4c9519,_0x17409f,_0x467463){return cmHopperAdditionalPhone[_0x8027('0x8e')](_0x4c9519,_0x17409f,_0x467463)['catch'](logger[_0x8027('0x47')](_0x8027('0xec')));};Preview[_0x8027('0x10')][_0x8027('0x8d')]=function(_0xeea65){return Promise[_0x8027('0xed')]()['then'](cmHopperAdditionalPhone[_0x8027('0x8d')](_0xeea65))[_0x8027('0x54')](logger[_0x8027('0x47')]('[incrementPreviewCounters]\x20'));};Preview[_0x8027('0x10')]['checkInBlack']=function(_0x3f0ad7,_0x42ff73,_0x67e484,_0x5db2fe,_0x308eb5){var _0x59a245=this;return new Promise(function(_0x4257ef,_0x32ac3b){if(_[_0x8027('0x46')](_0x42ff73)||_[_0x8027('0x46')](_0x42ff73['Contact'])||_[_0x8027('0x46')](_0x42ff73[_0x8027('0xee')])||_[_0x8027('0x46')](_0x42ff73[_0x8027('0x4f')])){_0x32ac3b(ut['message']('Contact\x20is\x20undefined',_0x5db2fe,_0x308eb5));return;}var _0x3a40e5=uuid['v4']();var _0x1a8035=_0x59a245[_0x8027('0x14')][_0x42ff73['Queue'][_0x8027('0x37')]];var _0x2714e4=_0x67e484?_0x59a245['agents'][_0x67e484]['id']:undefined;_0x59a245[_0x8027('0x17')][_0x3a40e5]=new Action(_0x42ff73,_0x1a8035,_0x3a40e5,_0x67e484,_0x2714e4);var _0x449ce0=_0x59a245['actions'][_0x3a40e5];_0x449ce0[_0x8027('0xb4')]=_0x5db2fe;_0x449ce0[_0x8027('0xbe')]=_0x308eb5;_0x449ce0[_0x8027('0xef')]=_0x67e484;if(_['isEmpty'](_0x3f0ad7)){_0x59a245['execCall'](_0x449ce0,_0x1a8035,_0x42ff73,_0x67e484)[_0x8027('0x60')](function(_0x4e11b0){logger[_0x8027('0x47')](_0x8027('0xf0'),'Queue:\x20'+_0x449ce0[_0x8027('0x49')]+'\x20IdHopper:\x20'+_0x449ce0[_0x8027('0x8c')],JSON['stringify'](_0x4e11b0));ami['emit'](_0x8027('0xf1'),ut[_0x8027('0x97')](_0x449ce0,_0x8027('0xf2'),_0x59a245[_0x8027('0x14')][_0x449ce0['queue']]));_0x4257ef(ut[_0x8027('0x32')](_0x8027('0xf3')));})['catch'](function(_0x149754){ut[_0x8027('0x35')](_0x8027('0xf4'),_0x149754);_0x32ac3b(ut['message'](_0x8027('0xf5'),_0x5db2fe,_0x308eb5));});}else{_0x1a8035[_0x8027('0xf6')]+=0x1;ut[_0x8027('0xf7')](_0x449ce0);rpcDb[_0x8027('0xf8')](_0x449ce0,_0x8027('0xf9'));delete _0x59a245[_0x8027('0x17')][_0x3a40e5];_0x32ac3b(ut[_0x8027('0x32')]('Contact\x20in\x20black\x20List',_0x5db2fe,_0x308eb5));}});};Preview['prototype'][_0x8027('0x77')]=function(_0x4643f0){return!_[_0x8027('0x46')](_0x4643f0)&&!_[_0x8027('0x46')](_0x4643f0[_0x8027('0x37')])&&!_['isNil'](_0x4643f0[_0x8027('0xfa')])&&_0x4643f0[_0x8027('0xfa')]&&!_['isNil'](this[_0x8027('0x16')][util['format']('SIP/%s',_0x4643f0[_0x8027('0x37')])])&&!_[_0x8027('0x46')](this['trunks'][util[_0x8027('0x69')](_0x8027('0xfb'),_0x4643f0[_0x8027('0x37')])]['status'])&&(this[_0x8027('0x16')][util[_0x8027('0x69')]('SIP/%s',_0x4643f0[_0x8027('0x37')])]['status']===_0x8027('0xfc')||this[_0x8027('0x16')][util['format'](_0x8027('0xfb'),_0x4643f0['name'])][_0x8027('0x52')]===_0x8027('0xfd'));};Preview['prototype']['run']=function(_0xe684de,_0x18b165){return this['execRun'](_0xe684de,_0x18b165)[_0x8027('0x60')](function(_0x2320ac){return _['pick'](_0x2320ac,[_0x8027('0x32')]);})['catch'](function(_0x5127fa){if(_0x5127fa['unlock']){rpcDb[_0x8027('0xfe')](_0xe684de);}if(_0x5127fa['active']){rpcDb[_0x8027('0x68')](_0xe684de);}throw _[_0x8027('0x4d')](_0x5127fa,['message']);});};Preview[_0x8027('0x10')][_0x8027('0xff')]=function(_0x33c7af,_0x2345e8){var _0x2b1bff=this;var _0x556f29,_0x4f1bd8;return rpcDb[_0x8027('0x100')](_0x33c7af)[_0x8027('0x60')](function(_0x3502c2){if(!_[_0x8027('0x46')](_0x3502c2[0x0])){_0x4f1bd8=_0x3502c2[0x0][_0x8027('0x101')]?![]:!![];_0x556f29=_0x3502c2[0x0][_0x8027('0x101')]?!![]:![];_0x556f29=_0x2345e8?!![]:_0x556f29;}var _0x44ce6a=_0x2b1bff[_0x8027('0x102')](_0x3502c2);if(_0x44ce6a[_0x8027('0x103')]){rpcDb['checkIsBlackList'](_[_0x8027('0x4d')](_0x3502c2[0x0],[_0x8027('0x4f'),_0x8027('0xee')]))[_0x8027('0x60')](function(_0x2d3a2d){_0x2b1bff['checkInBlack'](_0x2d3a2d,_0x3502c2[0x0],_0x2345e8,_0x4f1bd8,_0x556f29)[_0x8027('0x60')](function(_0x1cd0d4){return _0x1cd0d4;})[_0x8027('0x54')](function(_0x9c4e54){throw _0x9c4e54;});})[_0x8027('0x54')](function(_0x26688d){ut[_0x8027('0x35')](_0x8027('0x104'),_0x26688d);throw ut[_0x8027('0x32')](_0x8027('0x105'),_0x4f1bd8,_0x556f29);});}else{throw ut[_0x8027('0x32')](_0x44ce6a['message'],_0x4f1bd8,_0x556f29);}})[_0x8027('0x54')](function(_0x5c15e5){ut[_0x8027('0x35')]('[Preview][getContactPreview]',_0x5c15e5);throw ut[_0x8027('0x32')](_0x8027('0x105'),![],!![]);});};Preview[_0x8027('0x10')]['validateContact']=function(_0x23ebdf){if(_[_0x8027('0x46')](_0x23ebdf)||_[_0x8027('0x106')](_0x23ebdf)||!_['isNil'](_0x23ebdf[0x0]['Agent'])&&_['isNil'](_0x23ebdf[0x0]['Agent'][_0x8027('0x37')])){ut[_0x8027('0x35')]('[Preview][validateContact][Empty\x20Contact]',_0x23ebdf);return{'isValid':![],'message':_0x8027('0x107')};}var _0x2ebde6=this[_0x8027('0x14')][_0x23ebdf[0x0][_0x8027('0x108')]['name']];_0x2ebde6[_0x8027('0x32')]=utils['CAMPAIGN_STATUS'][_0x8027('0x79')];if(_[_0x8027('0x46')](_0x2ebde6)){ut[_0x8027('0x35')](_0x8027('0x109'),_0x2ebde6);return{'isValid':![],'message':_0x8027('0x10a')};}if(!this[_0x8027('0x77')](_0x2ebde6['Trunk'])){ut[_0x8027('0x35')](_0x8027('0x10b'),_0x8027('0x10c')+_0x2ebde6[_0x8027('0x37')]+_0x8027('0x10d'));if(!this['isTrunkReachable'](_0x2ebde6[_0x8027('0x10e')])){ut[_0x8027('0x35')](_0x8027('0x10b'),_0x2ebde6['name']+_0x8027('0x10f'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x8027('0x76')](_0x2ebde6[_0x8027('0x41')])){ut['logger'](_0x8027('0x110'),_0x2ebde6[_0x8027('0x37')]+_0x8027('0x111'));return{'isValid':![],'message':_0x8027('0x10c')+_0x2ebde6['name']+_0x8027('0x111')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x8027('0x10')][_0x8027('0x112')]=function(_0x3be856,_0x714a6d,_0x56bb18,_0x501bdb){var _0x5c39ce=this;return new Promise(function(_0x505c8d,_0x4cc5b0){var _0x3c70a7=_0x3be856['uniqueid'];var _0x3bb1b7=_0x5c39ce['isTrunkReachable'](_0x714a6d[_0x8027('0x113')])?util[_0x8027('0x69')](_0x8027('0x114'),_0x714a6d[_0x8027('0x113')][_0x8027('0x37')],_['isNil'](_0x714a6d[_0x8027('0x115')])?'':_0x714a6d[_0x8027('0x115')][_0x8027('0x116')]()||'',_0x714a6d[_0x8027('0x117')]>0x0?_0x56bb18[_0x8027('0xee')][_0x8027('0x118')](_0x714a6d['dialCutDigit']):_0x56bb18['phone']):util['format'](_0x8027('0x114'),_[_0x8027('0x46')](_0x714a6d[_0x8027('0x10e')])?_0x714a6d[_0x8027('0x113')][_0x8027('0x37')]:_0x714a6d[_0x8027('0x10e')]['name'],_[_0x8027('0x46')](_0x714a6d[_0x8027('0x115')])?'':_0x714a6d[_0x8027('0x115')][_0x8027('0x116')]()||'',_0x714a6d[_0x8027('0x117')]>0x0?_0x56bb18[_0x8027('0xee')][_0x8027('0x118')](_0x714a6d[_0x8027('0x117')]):_0x56bb18[_0x8027('0xee')]);var _0x3752cd=_0x5c39ce['isTrunkReachable'](_0x714a6d[_0x8027('0x113')])?ut['getCallerId'](_0x714a6d['Trunk'][_0x8027('0x119')],_0x714a6d[_0x8027('0x11a')],_0x714a6d['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x714a6d[_0x8027('0x11b')],_0x714a6d[_0x8027('0x11c')]):_0x714a6d['dialOriginateCallerIdNumber']):ut[_0x8027('0x11d')](_[_0x8027('0x46')](_0x714a6d[_0x8027('0x10e')])?_0x714a6d[_0x8027('0x113')][_0x8027('0x119')]:_0x714a6d[_0x8027('0x10e')]['callerid'],_0x714a6d[_0x8027('0x11a')],_0x714a6d['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x8027('0x11e')](_0x714a6d['dialOriginateCallerIdNumber'],_0x714a6d[_0x8027('0x11c')]):_0x714a6d[_0x8027('0x11b')]);if(_0x3752cd){_0x3be856[_0x8027('0x11f')]=ut[_0x8027('0x120')](_0x3752cd);_0x3be856[_0x8027('0x121')]=ut['extractCalleridNumber'](_0x3752cd);}var _0x23d1ca=ut[_0x8027('0x122')](_0x714a6d,_0x56bb18,_0x3bb1b7,_0x3752cd,_0x3c70a7,_0x3be856);var _0x5f5d7e=utils[_0x8027('0x123')](_0x56bb18[_0x8027('0x124')]);Object['assign'](_0x23d1ca,_0x5f5d7e);_[_0x8027('0x125')](_0x3be856,ut[_0x8027('0x126')](_0x23d1ca));_0x3be856[_0x8027('0x127')]=moment()[_0x8027('0x69')](_0x8027('0x90'));_0x714a6d[_0x8027('0x128')]=_0x23d1ca;var _0x5138c4=ut[_0x8027('0x129')](_0x3be856,_0x714a6d,_0x23d1ca,_0x3be856[_0x8027('0xbe')],_0x501bdb);return ami[_0x8027('0x51')](_0x5138c4)[_0x8027('0x60')](function(_0x40727a){_0x714a6d[_0x8027('0x2e')]+=0x1;logger[_0x8027('0x47')](_0x8027('0x12a'),_0x3c70a7,_0x8027('0x95'),_0x714a6d[_0x8027('0x37')],'originated:\x20',_0x714a6d['originated']);_0x505c8d(_0x40727a);})[_0x8027('0x54')](function(_0x3475c3){ut['logAgent'](_0x3be856,0xe,_0x8027('0x12b'));rpcDb[_0x8027('0xe3')](_0x3be856,_0x8027('0x12c'));_0x4cc5b0(_0x3475c3);});});};Preview['prototype'][_0x8027('0x22')]=function(_0x26021d){if(this[_0x8027('0x17')][_0x26021d[_0x8027('0xa8')]]){this[_0x8027('0x17')][_0x26021d[_0x8027('0xa8')]][_0x8027('0x53')]=_0x26021d[_0x8027('0x53')];}};Preview[_0x8027('0x10')][_0x8027('0x1b')]=function(_0x9fcd80){var _0x23c221=this;var _0x17156f=this[_0x8027('0x17')][_0x9fcd80[_0x8027('0x12d')]];if(_0x17156f){if(_0x17156f['lookAgent']&&this[_0x8027('0x18')][_0x17156f[_0x8027('0xef')]]){ut[_0x8027('0x12e')](_0x17156f,this[_0x8027('0x18')][_0x17156f[_0x8027('0xef')]][_0x8027('0x37')],this[_0x8027('0x18')][_0x17156f[_0x8027('0xef')]]['id']);}var _0xd99e69=_[_0x8027('0x12f')](_0x17156f);_0xd99e69[_0x8027('0x91')]=moment()[_0x8027('0x69')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3ccd8f=_0x23c221['campaignsPreview'][_0x17156f[_0x8027('0x49')]];if(ut['isFailure'](_0x9fcd80[_0x8027('0x130')])){if(_0x17156f[_0x8027('0xb4')]){rpcDb[_0x8027('0xfe')](_0x17156f[_0x8027('0x8c')]);}if(_0x17156f[_0x8027('0xbe')]){rpcDb[_0x8027('0x68')](_0x17156f[_0x8027('0x8c')]);}ami[_0x8027('0x2a')]('custom:agentringnoanswer',ut['buildObj'](_0x17156f,_0x8027('0x131'),this[_0x8027('0x14')][_0x17156f[_0x8027('0x49')]]));this['callProgressDetectingAgent'](_0xd99e69,_0x3ccd8f,_0x9fcd80);}else{_0x17156f[_0x8027('0x127')]=moment()[_0x8027('0x69')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x8027('0xe2')](_0xd99e69,0x4,'Answer');rpcDb[_0x8027('0xe3')](_0xd99e69,_0x8027('0x132'));}}};Preview[_0x8027('0x10')][_0x8027('0x133')]=function(_0x397a21){var _0x91ff49=this['actions'][_0x397a21['linkedid']];var _0x11f7f3;if(_0x91ff49){_0x11f7f3=this[_0x8027('0x14')][_0x91ff49['queue']];logger[_0x8027('0x47')](_0x8027('0x134'),_0x397a21['linkedid'],_0x8027('0x95'),_0x11f7f3['name'],_0x8027('0x4c'),_0x11f7f3[_0x8027('0x2f')]);}if(this[_0x8027('0x17')][_0x397a21[_0x8027('0xa8')]]&&_0x397a21[_0x8027('0xa8')]!==_0x397a21['uniqueid']){if(_0x397a21[_0x8027('0x135')]==='16'&&this[_0x8027('0x17')][_0x397a21['linkedid']]['dialAnswer']){this[_0x8027('0x7a')](_0x397a21,_0x397a21[_0x8027('0xa8')],_0x397a21[_0x8027('0x135')]);}else if(this['actions'][_0x397a21['linkedid']][_0x8027('0x58')]){logger['info'](_0x8027('0x136'),_0x397a21[_0x8027('0xa8')],_0x397a21[_0x8027('0x135')],_0x8027('0x95'),_0x11f7f3[_0x8027('0x37')],_0x8027('0x4c'),_0x11f7f3[_0x8027('0x2f')]);this[_0x8027('0x7a')](_0x397a21,_0x397a21['linkedid'],_0x397a21['cause']);}}else if(_0x91ff49&&_[_0x8027('0x46')](_0x91ff49['statedesc'])&&_0x11f7f3['dialQueueProject']&&_0x397a21[_0x8027('0xa8')]===_0x397a21['uniqueid']&&_[_0x8027('0x46')](_0x397a21[_0x8027('0xe1')])&&_0x397a21[_0x8027('0x135')]==='16'&&_0x397a21[_0x8027('0x137')]==='6'&&_[_0x8027('0xdf')](_0x91ff49[_0x8027('0x138')])){if(_0x91ff49[_0x8027('0xb4')]){rpcDb[_0x8027('0xfe')](_0x91ff49['idContact']);}if(_0x91ff49[_0x8027('0xbe')]){rpcDb[_0x8027('0x68')](_0x91ff49[_0x8027('0x8c')]);}_0x397a21[_0x8027('0xe1')]='22';this[_0x8027('0x139')](_0x91ff49,_0x11f7f3,_0x397a21);}else if(_0x91ff49&&_0x91ff49['transfer']){if(_0x397a21['cause']==='16'&&this[_0x8027('0x17')][_0x397a21[_0x8027('0xa8')]][_0x8027('0x58')]){logger['info'](_0x8027('0x13a'),_0x397a21['linkedid'],_0x397a21['cause'],'\x20Queue',_0x11f7f3['name'],_0x8027('0x4c'),_0x11f7f3['pTalking']);this['callProgressDetectingCustomer'](_0x397a21,_0x397a21[_0x8027('0xa8')],_0x397a21[_0x8027('0x135')]);}else if(this[_0x8027('0x17')][_0x397a21[_0x8027('0xa8')]]['dialAnswer']){logger[_0x8027('0x47')](_0x8027('0x136'),_0x397a21[_0x8027('0xa8')],_0x397a21[_0x8027('0x135')],_0x8027('0x95'),_0x11f7f3[_0x8027('0x37')],_0x8027('0x4c'),_0x11f7f3[_0x8027('0x2f')]);this[_0x8027('0x7a')](_0x397a21,_0x397a21[_0x8027('0xa8')],_0x397a21['cause']);}}};Preview[_0x8027('0x10')][_0x8027('0x20')]=function(_0x33e29c){if(this[_0x8027('0x17')][_0x33e29c[_0x8027('0x13b')]]&&_0x33e29c['destlinkedid']!==_0x33e29c[_0x8027('0x13c')]){this['callProgressDetectingCustomer'](_0x33e29c,_0x33e29c[_0x8027('0x13b')],_0x33e29c['dialstatus']);}};Preview[_0x8027('0x10')][_0x8027('0x1e')]=function(_0x7dbb88){if(this[_0x8027('0x17')][_0x7dbb88[_0x8027('0xa8')]]&&_0x7dbb88[_0x8027('0xa8')]!==_0x7dbb88[_0x8027('0x94')]&&!this[_0x8027('0x17')][_0x7dbb88[_0x8027('0xa8')]][_0x8027('0x58')]){if(_0x7dbb88['cause']==='1'){this[_0x8027('0x7a')](_0x7dbb88,_0x7dbb88['linkedid'],_0x7dbb88[_0x8027('0x135')]);}}};Preview['prototype'][_0x8027('0x13d')]=function(_0xa70954,_0x424928,_0x4af591){if(this[_0x8027('0x17')][_0xa70954]){if(_[_0x8027('0x46')](this[_0x8027('0x17')][_0xa70954]['variables'])){this[_0x8027('0x17')][_0xa70954][_0x8027('0x128')]={};}this['actions'][_0xa70954][_0x8027('0x128')][_0x424928]=_0x4af591;}};Preview[_0x8027('0x10')]['syncVarSet']=function(_0x4046bc){try{if(!_[_0x8027('0x46')](_0x4046bc)){if(ut[_0x8027('0x13e')](_['keys'](_0x4046bc[_0x8027('0x13f')])[0x0])){this[_0x8027('0x13d')](_0x4046bc[_0x8027('0x94')],_['keys'](_0x4046bc[_0x8027('0x13f')])[0x0],_0x4046bc[_0x8027('0x140')]);}}}catch(_0x6541f5){logger[_0x8027('0x141')]('[syncVarSet][Preview]',util[_0x8027('0x142')](_0x6541f5,{'showHidden':![],'depth':null}));}};Preview[_0x8027('0x10')][_0x8027('0x26')]=function(_0x5a7690){if(_0x5a7690){if(this[_0x8027('0x17')][_0x5a7690[_0x8027('0x143')]]){this['actions'][_0x5a7690[_0x8027('0x143')]]['transfer']=!![];}}};Preview[_0x8027('0x10')][_0x8027('0x28')]=function(_0x191c1e){if(_0x191c1e){if(this[_0x8027('0x17')][_0x191c1e[_0x8027('0x144')]]){this[_0x8027('0x17')][_0x191c1e[_0x8027('0x144')]][_0x8027('0x138')]=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 08f306f..5b8e1c4 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 _0xd959=['getContactRecallMe','then','[GetContactRecallMe]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','createHistory','[createHistory]\x20','resolve','catch','moveContactManagedDialer','checkIsBlackList','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','from-sip','exten','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20'];(function(_0x566c40,_0x3c2178){var _0x5152ec=function(_0x3e2112){while(--_0x3e2112){_0x566c40['push'](_0x566c40['shift']());}};_0x5152ec(++_0x3c2178);}(_0xd959,0x69));var _0x9d95=function(_0xe95c74,_0x55367a){_0xe95c74=_0xe95c74-0x0;var _0x323655=_0xd959[_0xe95c74];return _0x323655;};'use strict';var util=require(_0x9d95('0x0'));var BPromise=require(_0x9d95('0x1'));var logger=require(_0x9d95('0x2'))(_0x9d95('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x9d95('0x4'));var cmHopperBlack=require(_0x9d95('0x5'));var agentReportPreview=require(_0x9d95('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x30f536){return function(_0x580f7f){logger[_0x9d95('0x7')](_0x30f536,util['inspect'](_0x580f7f,{'showHidden':![],'depth':null}));};}function create(_0x8df220){return cmHopperHistory[_0x9d95('0x8')](_0x8df220)['catch'](loggerCatch(_0x9d95('0x9')));}function createAgent(_0x4a9e04){return BPromise[_0x9d95('0xa')]()['then'](agentReportPreview['createHistory'](_0x4a9e04))[_0x9d95('0xb')](loggerCatch(_0x9d95('0x9')));}function moveContact(_0x12626d){return cmHopper[_0x9d95('0xc')](_0x12626d,!![])['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x9d95('0xd')]=function(_0x526c9f){return cmHopperBlack[_0x9d95('0xd')](_0x526c9f)[_0x9d95('0xb')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x9d95('0xe')]=function(_0x35c4aa){return BPromise['resolve']()['then'](cmHopper['getContactPreview'](_0x35c4aa))[_0x9d95('0xb')](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0x3772d0,_0x2be774){create(_0x3772d0)[_0x9d95('0xb')](loggerCatch(_0x2be774));moveContact(_0x3772d0)[_0x9d95('0xb')](loggerCatch(_0x2be774));};exports[_0x9d95('0xf')]=function(_0x6176b5,_0x1be148){createAgent(_0x6176b5)[_0x9d95('0xb')](loggerCatch(_0x1be148));};exports[_0x9d95('0x10')]=function(_0x33e2ef,_0x497f00){create(_0x33e2ef)[_0x9d95('0xb')](loggerCatch(_0x497f00));};exports[_0x9d95('0x11')]=function(_0x1c6314,_0x2aece3){moveContact(_0x1c6314)[_0x9d95('0xb')](loggerCatch(_0x2aece3));};exports[_0x9d95('0x12')]=function(_0xaec14a,_0x151c82,_0x3138a5){if(_0x151c82){_0xaec14a['UserId']=null;}if(_0x3138a5){_0xaec14a['active']=![];}return cmHopper['rescheduleContact'](_0xaec14a)['catch'](loggerCatch(_0x9d95('0x13')));};exports[_0x9d95('0x14')]=function(_0xbd04d4){return cmHopper[_0x9d95('0x14')](_0xbd04d4)[_0x9d95('0xb')](loggerCatch(_0x9d95('0x15')));};exports['unlockContact']=function(_0x1b56c1){return cmHopper[_0x9d95('0x16')]({'UserId':null},_0x1b56c1,0x1)['catch'](loggerCatch(_0x9d95('0x17')));};exports['disableContact']=function(_0x2f211e){return cmHopper['unlockContact']({'active':![]},_0x2f211e,0x1)[_0x9d95('0xb')](loggerCatch(_0x9d95('0x18')));};exports[_0x9d95('0x19')]=function(_0x420833){var _0x27b978={};_0x27b978[_0x9d95('0x1a')]=_0x420833[_0x9d95('0x1a')];_0x27b978['uniqueid']=_0x420833[_0x9d95('0x1b')];_0x27b978[_0x9d95('0x1c')]=_0x420833[_0x9d95('0x1c')];_0x27b978[_0x9d95('0x1d')]=_0x420833[_0x9d95('0x1d')];_0x27b978[_0x9d95('0x1e')]=_0x420833[_0x9d95('0x1e')];_0x27b978['queuecallerjoinAt']=_0x420833['answertime'];_0x27b978[_0x9d95('0x1f')]=_0x420833[_0x9d95('0x20')];_0x27b978[_0x9d95('0x21')]=0x1;_0x27b978[_0x9d95('0x22')]=_0x420833[_0x9d95('0x23')];_0x27b978[_0x9d95('0x24')]=_0x420833['membername'];_0x27b978[_0x9d95('0x25')]=_0x9d95('0x26');_0x27b978[_0x9d95('0x27')]='xcally-motion-preview';_0x27b978[_0x9d95('0x28')]=0x0;_0x27b978[_0x9d95('0x29')]=0x1;_0x27b978[_0x9d95('0x2a')]=_0x420833[_0x9d95('0x2b')];_0x27b978[_0x9d95('0x2c')]=_0x9d95('0x2d');return BPromise[_0x9d95('0xa')]()['then'](voiceQueueReport[_0x9d95('0x2e')](_0x27b978))[_0x9d95('0xb')](loggerCatch(_0x9d95('0x2f')));};exports[_0x9d95('0x30')]=function(_0x5ec57c,_0x5d3377){return BPromise[_0x9d95('0xa')]()[_0x9d95('0x31')](cmHopper[_0x9d95('0x30')](_0x5ec57c,_0x5d3377))[_0x9d95('0xb')](loggerCatch(_0x9d95('0x32')));};exports['rescheduleContactInQueue']=function(_0x40cac1){return cmHopper[_0x9d95('0x12')](_0x40cac1,!![],!![])[_0x9d95('0xb')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x613b=['rescheduleContact','[rescheduleContactInQueue]\x20','util','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','createHistory','[createHistory]\x20','resolve','then','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','from-sip','exten','xcally-motion-preview','holdtime','lastAssignedTo','membername','COMPLETED','getContactRecallMe','rescheduleContactInQueue'];(function(_0x507f38,_0x542216){var _0x59f8cb=function(_0x1d4e9c){while(--_0x1d4e9c){_0x507f38['push'](_0x507f38['shift']());}};_0x59f8cb(++_0x542216);}(_0x613b,0xd6));var _0xb613=function(_0x1b753c,_0x59fe55){_0x1b753c=_0x1b753c-0x0;var _0x4b2078=_0x613b[_0x1b753c];return _0x4b2078;};'use strict';var util=require(_0xb613('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0xb613('0x1'));var cmHopper=require(_0xb613('0x2'));var cmHopperHistory=require(_0xb613('0x3'));var cmHopperBlack=require(_0xb613('0x4'));var agentReportPreview=require(_0xb613('0x5'));var voiceQueueReport=require(_0xb613('0x6'));function loggerCatch(_0x19548f){return function(_0x3d58e8){logger['error'](_0x19548f,util[_0xb613('0x7')](_0x3d58e8,{'showHidden':![],'depth':null}));};}function create(_0x24329e){return cmHopperHistory[_0xb613('0x8')](_0x24329e)['catch'](loggerCatch(_0xb613('0x9')));}function createAgent(_0x15ca8a){return BPromise[_0xb613('0xa')]()[_0xb613('0xb')](agentReportPreview[_0xb613('0x8')](_0x15ca8a))[_0xb613('0xc')](loggerCatch(_0xb613('0x9')));}function moveContact(_0x52691d){return cmHopper[_0xb613('0xd')](_0x52691d,!![])[_0xb613('0xc')](loggerCatch(_0xb613('0xe')));}exports[_0xb613('0xf')]=function(_0x51036d){return cmHopperBlack[_0xb613('0xf')](_0x51036d)[_0xb613('0xc')](loggerCatch(_0xb613('0x10')));};exports[_0xb613('0x11')]=function(_0x8ff7ab){return BPromise[_0xb613('0xa')]()[_0xb613('0xb')](cmHopper[_0xb613('0x11')](_0x8ff7ab))[_0xb613('0xc')](loggerCatch(_0xb613('0x12')));};exports[_0xb613('0x8')]=function(_0x34aa44,_0x15b0f7){create(_0x34aa44)[_0xb613('0xc')](loggerCatch(_0x15b0f7));moveContact(_0x34aa44)['catch'](loggerCatch(_0x15b0f7));};exports[_0xb613('0x13')]=function(_0x4dd25d,_0x35cfcd){createAgent(_0x4dd25d)[_0xb613('0xc')](loggerCatch(_0x35cfcd));};exports['createCustomerHistory']=function(_0x5e49ae,_0x3b7900){create(_0x5e49ae)[_0xb613('0xc')](loggerCatch(_0x3b7900));};exports[_0xb613('0x14')]=function(_0x5b7ceb,_0x245319){moveContact(_0x5b7ceb)[_0xb613('0xc')](loggerCatch(_0x245319));};exports['rescheduleContact']=function(_0x2c4a7f,_0x299358,_0xa1863a){if(_0x299358){_0x2c4a7f[_0xb613('0x15')]=null;}if(_0xa1863a){_0x2c4a7f[_0xb613('0x16')]=![];}return cmHopper['rescheduleContact'](_0x2c4a7f)[_0xb613('0xc')](loggerCatch(_0xb613('0x17')));};exports[_0xb613('0x18')]=function(_0x2eb6fe){return cmHopper[_0xb613('0x18')](_0x2eb6fe)[_0xb613('0xc')](loggerCatch(_0xb613('0x19')));};exports['unlockContact']=function(_0x269fd4){return cmHopper[_0xb613('0x1a')]({'UserId':null},_0x269fd4,0x1)[_0xb613('0xc')](loggerCatch(_0xb613('0x1b')));};exports[_0xb613('0x1c')]=function(_0xa5bcde){return cmHopper[_0xb613('0x1a')]({'active':![]},_0xa5bcde,0x1)[_0xb613('0xc')](loggerCatch(_0xb613('0x1d')));};exports[_0xb613('0x1e')]=function(_0x4f6dcc){var _0x2b48ea={};_0x2b48ea['type']=_0x4f6dcc[_0xb613('0x1f')];_0x2b48ea['uniqueid']=_0x4f6dcc[_0xb613('0x20')];_0x2b48ea[_0xb613('0x21')]=_0x4f6dcc['calleridnum'];_0x2b48ea[_0xb613('0x22')]=_0x4f6dcc[_0xb613('0x22')];_0x2b48ea[_0xb613('0x23')]=_0x4f6dcc[_0xb613('0x23')];_0x2b48ea[_0xb613('0x24')]=_0x4f6dcc[_0xb613('0x25')];_0x2b48ea['queuecallerleaveAt']=_0x4f6dcc[_0xb613('0x25')];_0x2b48ea[_0xb613('0x26')]=0x1;_0x2b48ea[_0xb613('0x27')]=_0x4f6dcc[_0xb613('0x28')];_0x2b48ea[_0xb613('0x29')]=_0x4f6dcc['membername'];_0x2b48ea['context']=_0xb613('0x2a');_0x2b48ea[_0xb613('0x2b')]=_0xb613('0x2c');_0x2b48ea[_0xb613('0x2d')]=0x0;_0x2b48ea['assigned']=0x1;_0x2b48ea[_0xb613('0x2e')]=_0x4f6dcc[_0xb613('0x2f')];_0x2b48ea['queuecallerexitreason']=_0xb613('0x30');return BPromise['resolve']()['then'](voiceQueueReport['create'](_0x2b48ea))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xb613('0x31')]=function(_0x5827dd,_0x2bfa12){return BPromise[_0xb613('0xa')]()['then'](cmHopper[_0xb613('0x31')](_0x5827dd,_0x2bfa12))[_0xb613('0xc')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xb613('0x32')]=function(_0x49d816){return cmHopper[_0xb613('0x33')](_0x49d816,!![],!![])[_0xb613('0xc')](loggerCatch(_0xb613('0x34')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index c87c457..7629a26 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 _0x37d6=['bridgepvtcallid','\x5cw{0,','pow','replace','random','match','noanswer','variables','keys','forEach','toLowerCase','util','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','inspect','logger','info','loggerError','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isNil','addVariables','Queue','calleridname','ContactId','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','logAgent','ringtime','logLookAgent','membername','UserId','logCustomer','endtime','answertime','getSeconds','Failure','variablesAction','RECALL','uniqueid','originate','channelAgent','calleridnum','xcally-motion-preview','from-sip','timeout','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','cloneAction','statedesc','Global','active','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','name','interface','motionChannel','voice','buildObj','queue','agentReadyId','not_inuse','status','reachable','push','getDiff','milliseconds','diff','seconds','createBody','CampaignId','filterKey','idContact','type','dialAnswer','countcongestionretry','countglobal','callback','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','bridgepeer'];(function(_0x22c4d0,_0x5ea81f){var _0x3463ae=function(_0x41c948){while(--_0x41c948){_0x22c4d0['push'](_0x22c4d0['shift']());}};_0x3463ae(++_0x5ea81f);}(_0x37d6,0x129));var _0x637d=function(_0x436073,_0x11b1d6){_0x436073=_0x436073-0x0;var _0x564463=_0x37d6[_0x436073];return _0x564463;};'use strict';var util=require(_0x637d('0x0'));var _=require(_0x637d('0x1'));var moment=require(_0x637d('0x2'));var logger=require(_0x637d('0x3'))(_0x637d('0x4'));var ipAgi=process['env'][_0x637d('0x5')]||_0x637d('0x6');var utils=require(_0x637d('0x7'));exports[_0x637d('0x8')]=function(_0x392b56){return function(_0x4459f6){logger[_0x637d('0x9')](_0x392b56,util[_0x637d('0xa')](_0x4459f6,{'showHidden':![],'depth':null}));};};exports[_0x637d('0xb')]=function(_0x189b2f,_0x4bd2e2){logger[_0x637d('0xc')](_0x189b2f,util['inspect'](_0x4bd2e2,{'showHidden':![],'depth':null}));};exports[_0x637d('0xd')]=function(_0x1e6977,_0x20c646){logger['error'](_0x1e6977,util[_0x637d('0xa')](_0x20c646,{'showHidden':![],'depth':null}));};exports[_0x637d('0xe')]=function(_0x341469){return function(_0x2c1a98){logger['info'](_0x341469,util['inspect'](_0x2c1a98,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x206860,_0x4bf3c2,_0x3f778c){return{'message':_0x206860,'unlock':_0x4bf3c2,'active':_0x3f778c};};exports[_0x637d('0xf')]=function(_0x43d39a,_0x1dc667,_0x3543be){if(!_[_0x637d('0x10')](_0x3543be)&&_0x637d('0x11')===typeof _0x3543be&&!_[_0x637d('0x12')](_0x3543be)){if(!_[_0x637d('0x10')](_0x1dc667)&&_0x637d('0x11')===typeof _0x1dc667&&!_[_0x637d('0x12')](_0x1dc667)){return util[_0x637d('0x13')](_0x637d('0x14'),_0x1dc667,_0x3543be);}return util['format'](_0x637d('0x14'),_0x3543be,_0x3543be);}if(!_['isUndefined'](_0x43d39a)&&'string'===typeof _0x43d39a&&!_[_0x637d('0x12')](_0x43d39a)){return _0x43d39a;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x10a5f3){if(_[_0x637d('0x15')](_0x10a5f3)){return![];}return _0x10a5f3;};exports[_0x637d('0x16')]=function(_0x465676,_0x12e54c,_0x4d9c83,_0x3fe55a,_0x313c8c,_0x3134cc){var _0x5c03d7={'XMD-QUEUE':_0x12e54c[_0x637d('0x17')]?_0x12e54c[_0x637d('0x17')]['name']:'','XMD-CALLERID':_0x3fe55a,'XMD-CALLERID-PREVIEW':_0x3134cc?util[_0x637d('0x13')](_0x637d('0x14'),_0x3134cc[_0x637d('0x18')],_0x3134cc['calleridnum']):_0x3fe55a,'XMD-DIALID':_0x313c8c,'XMD-CONTACTID':_0x12e54c[_0x637d('0x19')],'XMD-CDRTYPE':_0x637d('0x1a'),'CALLERID(all)':_0x3fe55a,'XMD-VOICEQUEUEID':_0x12e54c[_0x637d('0x1b')],'XMD-DIALCHANNEL':_0x4d9c83,'XMD-DIALTIMEOUT':_0x465676['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x637d('0x13')](_0x637d('0x1c'),_0x465676[_0x637d('0x1d')]?'g':'',_[_0x637d('0x12')](_0x465676[_0x637d('0x1e')])?'':_0x637d('0x1f')),'XMD-DIALURL':_0x465676[_0x637d('0x20')]||'','XMD-AGI':_0x465676[_0x637d('0x21')]?util[_0x637d('0x13')](_0x637d('0x22'),ipAgi,_0x465676[_0x637d('0x21')]):_0x637d('0x23'),'XMD-AGIAFTER':_0x465676['dialQueueProject2']?util[_0x637d('0x13')](_0x637d('0x22'),ipAgi,_0x465676['dialQueueProject2']):_0x637d('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x3134cc?_0x3134cc[_0x637d('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x3134cc?_0x3134cc['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x637d('0x25')};if(!_[_0x637d('0x12')](_0x465676[_0x637d('0x1e')])){_0x5c03d7[util[_0x637d('0x13')]('%s',_0x637d('0x26'))]=_0x465676[_0x637d('0x1e')];_0x5c03d7[util[_0x637d('0x13')]('%s',_0x637d('0x27'))]=_0x313c8c;}return _0x5c03d7;};exports[_0x637d('0x28')]=function(_0x5f106a){var _0x5443f4={};for(var _0x514de2 in _0x5f106a){if(_0x5f106a[_0x637d('0x29')](_0x514de2)){_0x5443f4[util[_0x637d('0x13')]('%s',_['toLower'](_0x514de2))]=_0x5f106a[_0x514de2];}}return{'variables':_0x5443f4};};exports['updateOriginated']=function(_0x16dc3a,_0x4f8ea9){if(!_[_0x637d('0x15')](_0x16dc3a)){if(_0x16dc3a['hasOwnProperty'](_0x637d('0x2a'))){if(_0x16dc3a[_0x637d('0x2a')]>0x0){_0x16dc3a[_0x637d('0x2a')]-=0x1;}else{logger[_0x637d('0x9')](_0x637d('0x2b'),_0x4f8ea9);}}}else{logger['error'](_0x637d('0x2c'),_0x4f8ea9);}};exports[_0x637d('0x2d')]=function(_0x5e1223){var _0x2d5639=moment()[_0x637d('0x13')](_0x637d('0x2e'));_0x5e1223[_0x637d('0x2f')]=0xd;_0x5e1223['statedesc']=_0x637d('0x30');_0x5e1223[_0x637d('0x31')]=_0x2d5639;_0x5e1223[_0x637d('0x32')]=_0x2d5639;_0x5e1223['endtime']=_0x2d5639;};exports[_0x637d('0x33')]=function(_0x58afae,_0xe20b83,_0x58fa6d){var _0x4d4675=moment()[_0x637d('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x58afae[_0x637d('0x2f')]=_0xe20b83;_0x58afae['statedesc']=_0x58fa6d;_0x58afae[_0x637d('0x32')]=_0x4d4675;_0x58afae[_0x637d('0x34')]=utils['getSeconds'](_0x58afae[_0x637d('0x32')],_0x58afae['starttime']);};exports[_0x637d('0x35')]=function(_0x109177,_0x1d280e,_0x38310a){_0x109177[_0x637d('0x36')]=_0x1d280e;_0x109177[_0x637d('0x37')]=_0x38310a;};exports[_0x637d('0x38')]=function(_0xbe117c,_0x3e74ac,_0x45e865){var _0x48f1ae=moment()[_0x637d('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0xbe117c[_0x637d('0x2f')]=_0x3e74ac;_0xbe117c['statedesc']=_0x45e865;_0xbe117c[_0x637d('0x32')]=_0xbe117c[_0x637d('0x32')]?_0xbe117c['responsetime']:_0x48f1ae;_0xbe117c[_0x637d('0x39')]=_0xbe117c[_0x637d('0x39')]?_0xbe117c[_0x637d('0x39')]:_0x48f1ae;_0xbe117c['ringtime']=utils['getSeconds'](_0xbe117c[_0x637d('0x32')]||0x0,_0xbe117c[_0x637d('0x31')]||0x0);_0xbe117c['talktime']=_0xbe117c[_0x637d('0x3a')]?utils[_0x637d('0x3b')](_0xbe117c[_0x637d('0x39')],_0xbe117c['answertime']):0x0;};exports['isFailure']=function(_0x19e689){return _0x19e689===_0x637d('0x3c');};exports[_0x637d('0x3d')]=function(_0x55fb14,_0x548032,_0x43c0ff,_0x3cfc8a,_0x5e083e){var _0xd186a2=_0x3cfc8a?_0x637d('0x3e'):_0x55fb14['calleridname'];_0xd186a2=_0x5e083e?'BOOKED':_0xd186a2;return{'actionid':_0x55fb14[_0x637d('0x3f')],'action':_0x637d('0x40'),'channel':_0x55fb14[_0x637d('0x41')],'callerid':util[_0x637d('0x13')](_0x637d('0x14'),_0xd186a2,_0x55fb14[_0x637d('0x42')]),'Exten':_0x637d('0x43'),'Context':_0x637d('0x44'),'Priority':'1','variable':_0x43c0ff,'timeout':(_0x548032[_0x637d('0x45')]||0x1e)*0x3e8,'async':!![],'channelid':_0x55fb14[_0x637d('0x3f')]};};exports[_0x637d('0x46')]=function(_0x332175){return _0x332175[_0x637d('0x47')]+_0x332175['countcongestionretry']+_0x332175[_0x637d('0x48')]+_0x332175[_0x637d('0x49')]+_0x332175['countnosuchnumberretry'];};exports[_0x637d('0x4a')]=function(_0x3d927f){var _0x2940bd=_['clone'](_0x3d927f);_0x2940bd['state']=0xf;_0x2940bd[_0x637d('0x4b')]=_0x637d('0x4c');return _0x2940bd;};exports['scheduledAt']=function(_0x10db8a,_0x5abe69,_0x539804){var _0x2fca4d={};_0x2fca4d[_0x5abe69]=_0x10db8a[_0x5abe69];_0x2fca4d[_0x637d('0x4d')]=![];_0x2fca4d[_0x637d('0x4e')]=moment()[_0x637d('0x4f')](_0x539804,'minutes')[_0x637d('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x2fca4d['ContactId']=_0x10db8a[_0x637d('0x19')];_0x2fca4d[_0x637d('0x50')]=_0x10db8a[_0x637d('0x50')];_0x2fca4d['VoiceQueueId']=_0x10db8a[_0x637d('0x1b')]||undefined;return _0x2fca4d;};exports[_0x637d('0x51')]=function(_0x3be71f,_0x58845e){if(!_[_0x637d('0x15')](_0x3be71f)){if(_0x3be71f[_0x637d('0x52')]>0x0){_0x3be71f[_0x637d('0x52')]-=0x1;}else{logger[_0x637d('0x9')](_0x58845e,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x637d('0x9')](_0x58845e,_0x637d('0x53'));}};exports['IsNotLoggedIn']=function(_0x3c80be){if(_0x3c80be<=0x0){return!![];}return![];};function buildObj(_0x440d9c,_0x49d968,_0x59281d){_0x440d9c[_0x637d('0x54')]=_0x49d968;_0x440d9c[_0x637d('0x55')]=_0x440d9c['queue'];_0x440d9c[_0x637d('0x56')]=_0x440d9c[_0x637d('0x41')];_0x440d9c[_0x637d('0x57')]=_0x637d('0x58');if(_0x59281d){_0x440d9c['mandatoryDisposition']=_0x59281d['mandatoryDisposition'];}return _0x440d9c;}exports[_0x637d('0x59')]=buildObj;exports['buildAcw']=function(_0x5d45d5){var _0x3192f6={};_0x3192f6[_0x637d('0x5a')]=_0x5d45d5[_0x637d('0x5a')];_0x3192f6[_0x637d('0x56')]=_0x5d45d5[_0x637d('0x41')];_0x3192f6[_0x637d('0x3f')]=_0x5d45d5['uniqueid'];return _0x3192f6;};exports[_0x637d('0x5b')]=function(_0xbb3420){var _0x5e3c2b=[];for(var _0x5a0d4d in _0xbb3420){if(_0xbb3420['hasOwnProperty'](_0x5a0d4d)){if(!_[_0x637d('0x15')](_0xbb3420[_0x5a0d4d])&&_0xbb3420[_0x5a0d4d][_0x637d('0x2f')]===_0x637d('0x5c')&&_0xbb3420[_0x5a0d4d][_0x637d('0x5d')]===_0x637d('0x5e')){_0x5e3c2b[_0x637d('0x5f')](_0xbb3420[_0x5a0d4d]['id']);}}}return _0x5e3c2b;};exports[_0x637d('0x60')]=function(_0x2d5550){var _0x4a33c0=moment()[_0x637d('0x61')](0x0);var _0x44de08=moment(_0x2d5550)[_0x637d('0x61')](0x0);return _0x4a33c0[_0x637d('0x62')](_0x44de08,_0x637d('0x63'));};exports[_0x637d('0x64')]=function(_0x313b6f){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x313b6f['ContactId'],'ListId':_0x313b6f[_0x637d('0x50')],'VoiceQueueId':_0x313b6f[_0x637d('0x1b')]||undefined,'CampaignId':_0x313b6f[_0x637d('0x65')]||undefined};};exports[_0x637d('0x66')]=function(_0x5aa1ac){if(_0x5aa1ac===_0x637d('0x3f')||_0x5aa1ac===_0x637d('0x67')||_0x5aa1ac==='queue'||_0x5aa1ac===_0x637d('0x68')||_0x5aa1ac==='campaigntype'||_0x5aa1ac===_0x637d('0x69')||_0x5aa1ac==='membername'||_0x5aa1ac===_0x637d('0x41')||_0x5aa1ac===_0x637d('0x18')||_0x5aa1ac==='active'||_0x5aa1ac==='calleridnum'||_0x5aa1ac===_0x637d('0x4e')||_0x5aa1ac===_0x637d('0x47')||_0x5aa1ac===_0x637d('0x6a')||_0x5aa1ac===_0x637d('0x48')||_0x5aa1ac===_0x637d('0x6b')||_0x5aa1ac===_0x637d('0x6c')||_0x5aa1ac==='callbackuniqueid'||_0x5aa1ac===_0x637d('0x6d')||_0x5aa1ac===_0x637d('0x6e')||_0x5aa1ac===_0x637d('0x19')||_0x5aa1ac==='ListId'||_0x5aa1ac===_0x637d('0x37')||_0x5aa1ac==='VoiceQueueId'||_0x5aa1ac===_0x637d('0x6f')||_0x5aa1ac===_0x637d('0x70')||_0x5aa1ac==='xmd-queue'||_0x5aa1ac===_0x637d('0x71')||_0x5aa1ac===_0x637d('0x72')||_0x5aa1ac===_0x637d('0x73')||_0x5aa1ac===_0x637d('0x74')||_0x5aa1ac===_0x637d('0x75')||_0x5aa1ac===_0x637d('0x76')||_0x5aa1ac===_0x637d('0x77')||_0x5aa1ac===_0x637d('0x78')||_0x5aa1ac===_0x637d('0x79')||_0x5aa1ac===_0x637d('0x7a')||_0x5aa1ac===_0x637d('0x7b')||_0x5aa1ac===_0x637d('0x7c')||_0x5aa1ac==='rtpaudioqos'||_0x5aa1ac==='rtpaudioqosbridged'||_0x5aa1ac===_0x637d('0x7d')||_0x5aa1ac==='rtpaudioqosjitterbridged'||_0x5aa1ac===_0x637d('0x7e')||_0x5aa1ac==='rtpaudioqoslossbridged'||_0x5aa1ac==='rtpaudioqosrtt'||_0x5aa1ac===_0x637d('0x7f')||_0x5aa1ac==='rtpaudioqos'||_0x5aa1ac===_0x637d('0x80')||_0x5aa1ac===_0x637d('0x7d')||_0x5aa1ac===_0x637d('0x81')||_0x5aa1ac===_0x637d('0x7e')||_0x5aa1ac===_0x637d('0x82')||_0x5aa1ac==='rtpaudioqosrtt'||_0x5aa1ac===_0x637d('0x7f')||_0x5aa1ac===_0x637d('0x83')||_0x5aa1ac===_0x637d('0x84')||_0x5aa1ac===_0x637d('0x2f')||_0x5aa1ac===_0x637d('0x4b')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2f0d3c,_0x3b8209){var _0x261ffe,_0x4a5af1,_0x516415;if(_0x3b8209<=0x0){_0x3b8209=0x1;}_0x261ffe=new RegExp(_0x637d('0x85')+_0x3b8209+'}$');_0x4a5af1=Math[_0x637d('0x86')](0xa,_0x3b8209-0x1);_0x516415=Math[_0x637d('0x86')](0xa,_0x3b8209)-0x1;return util[_0x637d('0x13')]('%s',_[_0x637d('0x87')](_0x2f0d3c,_0x261ffe,_[_0x637d('0x88')](_0x4a5af1,_0x516415)));};exports['extractCalleridName']=function(_0x3dd956){var _0x5b30e2=_0x3dd956[_0x637d('0x89')](/"(.*?)"/);return _0x5b30e2?_0x5b30e2[0x1]:_0x3dd956;};exports['extractCalleridNumber']=function(_0x382f7b){var _0x129ca6=_0x382f7b[_0x637d('0x89')](/<(.*?)>/);return _0x129ca6?_0x129ca6[0x1]:_0x382f7b;};function buildNoAnswerEventPayload(_0x31b63d,_0x30a072){var _0xb7962a=buildObj(_0x31b63d,_0x637d('0x8a'));if(!_[_0x637d('0x12')](_0x30a072[_0x637d('0x8b')])){Object[_0x637d('0x8c')](_0x30a072[_0x637d('0x8b')])[_0x637d('0x8d')](function(_0x2b02dc){_0xb7962a[_0x2b02dc[_0x637d('0x8e')]()]=_0x30a072[_0x637d('0x8b')][_0x2b02dc];});}return _0xb7962a;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file +var _0xd303=['extractCalleridName','match','extractCalleridNumber','noanswer','keys','variables','forEach','toLowerCase','buildNoAnswerEventPayload','util','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','inspect','logger','info','loggerError','error','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','Queue','name','calleridname','calleridnum','ContactId','dialer','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','endtime','responsetime','ringtime','getSeconds','logLookAgent','membername','starttime','talktime','answertime','variablesAction','RECALL','uniqueid','originate','channelAgent','from-sip','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','minutes','ListId','VoiceQueueId','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','reachable','push','getDiff','milliseconds','createBody','CampaignId','idContact','campaigntype','dialAnswer','countglobal','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','random'];(function(_0x39106e,_0x586f3d){var _0x892aec=function(_0xded1b5){while(--_0xded1b5){_0x39106e['push'](_0x39106e['shift']());}};_0x892aec(++_0x586f3d);}(_0xd303,0x95));var _0x3d30=function(_0x2c3a8f,_0x374e56){_0x2c3a8f=_0x2c3a8f-0x0;var _0x189412=_0xd303[_0x2c3a8f];return _0x189412;};'use strict';var util=require(_0x3d30('0x0'));var _=require('lodash');var moment=require(_0x3d30('0x1'));var logger=require(_0x3d30('0x2'))(_0x3d30('0x3'));var ipAgi=process[_0x3d30('0x4')][_0x3d30('0x5')]||_0x3d30('0x6');var utils=require(_0x3d30('0x7'));exports[_0x3d30('0x8')]=function(_0x16ae73){return function(_0x2d6299){logger['error'](_0x16ae73,util[_0x3d30('0x9')](_0x2d6299,{'showHidden':![],'depth':null}));};};exports[_0x3d30('0xa')]=function(_0x162370,_0xcb1f61){logger[_0x3d30('0xb')](_0x162370,util[_0x3d30('0x9')](_0xcb1f61,{'showHidden':![],'depth':null}));};exports[_0x3d30('0xc')]=function(_0x575549,_0x26a1ea){logger[_0x3d30('0xd')](_0x575549,util[_0x3d30('0x9')](_0x26a1ea,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x1f9171){return function(_0x1be48a){logger[_0x3d30('0xb')](_0x1f9171,util[_0x3d30('0x9')](_0x1be48a,{'showHidden':![],'depth':null}));};};exports[_0x3d30('0xe')]=function(_0x1b754e,_0x322eb1,_0x4de26b){return{'message':_0x1b754e,'unlock':_0x322eb1,'active':_0x4de26b};};exports['getCallerId']=function(_0x270eae,_0x30221e,_0x5a0cb4){if(!_[_0x3d30('0xf')](_0x5a0cb4)&&_0x3d30('0x10')===typeof _0x5a0cb4&&!_[_0x3d30('0x11')](_0x5a0cb4)){if(!_[_0x3d30('0xf')](_0x30221e)&&_0x3d30('0x10')===typeof _0x30221e&&!_[_0x3d30('0x11')](_0x30221e)){return util[_0x3d30('0x12')](_0x3d30('0x13'),_0x30221e,_0x5a0cb4);}return util['format']('\x22%s\x22\x20<%s>',_0x5a0cb4,_0x5a0cb4);}if(!_['isUndefined'](_0x270eae)&&_0x3d30('0x10')===typeof _0x270eae&&!_[_0x3d30('0x11')](_0x270eae)){return _0x270eae;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x5a03d8){if(_['isNil'](_0x5a03d8)){return![];}return _0x5a03d8;};exports['addVariables']=function(_0x3225df,_0x393512,_0xa427fe,_0x4d7a70,_0x2cba08,_0x5921de){var _0x195e87={'XMD-QUEUE':_0x393512['Queue']?_0x393512[_0x3d30('0x14')][_0x3d30('0x15')]:'','XMD-CALLERID':_0x4d7a70,'XMD-CALLERID-PREVIEW':_0x5921de?util[_0x3d30('0x12')](_0x3d30('0x13'),_0x5921de[_0x3d30('0x16')],_0x5921de[_0x3d30('0x17')]):_0x4d7a70,'XMD-DIALID':_0x2cba08,'XMD-CONTACTID':_0x393512[_0x3d30('0x18')],'XMD-CDRTYPE':_0x3d30('0x19'),'CALLERID(all)':_0x4d7a70,'XMD-VOICEQUEUEID':_0x393512['VoiceQueueId'],'XMD-DIALCHANNEL':_0xa427fe,'XMD-DIALTIMEOUT':_0x3225df['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format'](_0x3d30('0x1a'),_0x3225df['dialQueueProject2']?'g':'',_['isEmpty'](_0x3225df[_0x3d30('0x1b')])?'':_0x3d30('0x1c')),'XMD-DIALURL':_0x3225df['dialPreviewUrl']||'','XMD-AGI':_0x3225df[_0x3d30('0x1d')]?util[_0x3d30('0x12')](_0x3d30('0x1e'),ipAgi,_0x3225df['dialQueueProject']):_0x3d30('0x1f'),'XMD-AGIAFTER':_0x3225df['dialQueueProject2']?util[_0x3d30('0x12')](_0x3d30('0x1e'),ipAgi,_0x3225df[_0x3d30('0x20')]):_0x3d30('0x1f'),'XMD-ORIGINATECALLERIDNUM':_0x5921de?_0x5921de[_0x3d30('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x5921de?_0x5921de[_0x3d30('0x22')]:'','XMD-DESTINATION':_0x3d30('0x23'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_['isEmpty'](_0x3225df[_0x3d30('0x1b')])){_0x195e87[util['format']('%s',_0x3d30('0x24'))]=_0x3225df[_0x3d30('0x1b')];_0x195e87[util['format']('%s',_0x3d30('0x25'))]=_0x2cba08;}return _0x195e87;};exports[_0x3d30('0x26')]=function(_0x30b66){var _0x30cce0={};for(var _0x1bc1c2 in _0x30b66){if(_0x30b66[_0x3d30('0x27')](_0x1bc1c2)){_0x30cce0[util['format']('%s',_[_0x3d30('0x28')](_0x1bc1c2))]=_0x30b66[_0x1bc1c2];}}return{'variables':_0x30cce0};};exports['updateOriginated']=function(_0x43ea2b,_0x487951){if(!_[_0x3d30('0x29')](_0x43ea2b)){if(_0x43ea2b['hasOwnProperty'](_0x3d30('0x2a'))){if(_0x43ea2b[_0x3d30('0x2a')]>0x0){_0x43ea2b[_0x3d30('0x2a')]-=0x1;}else{logger[_0x3d30('0xd')](_0x3d30('0x2b'),_0x487951);}}}else{logger[_0x3d30('0xd')](_0x3d30('0x2c'),_0x487951);}};exports[_0x3d30('0x2d')]=function(_0x584ee4){var _0x2c7215=moment()[_0x3d30('0x12')](_0x3d30('0x2e'));_0x584ee4[_0x3d30('0x2f')]=0xd;_0x584ee4[_0x3d30('0x30')]=_0x3d30('0x31');_0x584ee4['starttime']=_0x2c7215;_0x584ee4['responsetime']=_0x2c7215;_0x584ee4[_0x3d30('0x32')]=_0x2c7215;};exports['logAgent']=function(_0x192b3d,_0x296a15,_0x36d4a0){var _0x1f7d68=moment()[_0x3d30('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x192b3d[_0x3d30('0x2f')]=_0x296a15;_0x192b3d[_0x3d30('0x30')]=_0x36d4a0;_0x192b3d[_0x3d30('0x33')]=_0x1f7d68;_0x192b3d[_0x3d30('0x34')]=utils[_0x3d30('0x35')](_0x192b3d[_0x3d30('0x33')],_0x192b3d['starttime']);};exports[_0x3d30('0x36')]=function(_0x4f0568,_0x39ee55,_0xdb86e7){_0x4f0568[_0x3d30('0x37')]=_0x39ee55;_0x4f0568['UserId']=_0xdb86e7;};exports['logCustomer']=function(_0x52f1f6,_0x2eb2bd,_0x5be6f1){var _0x588c3c=moment()[_0x3d30('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x52f1f6['state']=_0x2eb2bd;_0x52f1f6[_0x3d30('0x30')]=_0x5be6f1;_0x52f1f6[_0x3d30('0x33')]=_0x52f1f6[_0x3d30('0x33')]?_0x52f1f6[_0x3d30('0x33')]:_0x588c3c;_0x52f1f6[_0x3d30('0x32')]=_0x52f1f6[_0x3d30('0x32')]?_0x52f1f6[_0x3d30('0x32')]:_0x588c3c;_0x52f1f6[_0x3d30('0x34')]=utils[_0x3d30('0x35')](_0x52f1f6[_0x3d30('0x33')]||0x0,_0x52f1f6[_0x3d30('0x38')]||0x0);_0x52f1f6[_0x3d30('0x39')]=_0x52f1f6[_0x3d30('0x3a')]?utils[_0x3d30('0x35')](_0x52f1f6[_0x3d30('0x32')],_0x52f1f6['answertime']):0x0;};exports['isFailure']=function(_0x1d3a6a){return _0x1d3a6a==='Failure';};exports[_0x3d30('0x3b')]=function(_0x17042f,_0x36ec4c,_0x12a506,_0x487943,_0xb4612e){var _0x2bdbbc=_0x487943?_0x3d30('0x3c'):_0x17042f[_0x3d30('0x16')];_0x2bdbbc=_0xb4612e?'BOOKED':_0x2bdbbc;return{'actionid':_0x17042f[_0x3d30('0x3d')],'action':_0x3d30('0x3e'),'channel':_0x17042f[_0x3d30('0x3f')],'callerid':util[_0x3d30('0x12')](_0x3d30('0x13'),_0x2bdbbc,_0x17042f[_0x3d30('0x17')]),'Exten':_0x3d30('0x23'),'Context':_0x3d30('0x40'),'Priority':'1','variable':_0x12a506,'timeout':(_0x36ec4c['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x17042f[_0x3d30('0x3d')]};};exports[_0x3d30('0x41')]=function(_0x643515){return _0x643515[_0x3d30('0x42')]+_0x643515[_0x3d30('0x43')]+_0x643515[_0x3d30('0x44')]+_0x643515[_0x3d30('0x45')]+_0x643515['countnosuchnumberretry'];};exports[_0x3d30('0x46')]=function(_0x2f4de0){var _0x45c535=_[_0x3d30('0x47')](_0x2f4de0);_0x45c535[_0x3d30('0x2f')]=0xf;_0x45c535[_0x3d30('0x30')]=_0x3d30('0x48');return _0x45c535;};exports[_0x3d30('0x49')]=function(_0x4ecac6,_0x546211,_0xd7548c){var _0x1905bb={};_0x1905bb[_0x546211]=_0x4ecac6[_0x546211];_0x1905bb[_0x3d30('0x4a')]=![];_0x1905bb[_0x3d30('0x4b')]=moment()['add'](_0xd7548c,_0x3d30('0x4c'))[_0x3d30('0x12')](_0x3d30('0x2e'));_0x1905bb[_0x3d30('0x18')]=_0x4ecac6['ContactId'];_0x1905bb[_0x3d30('0x4d')]=_0x4ecac6[_0x3d30('0x4d')];_0x1905bb[_0x3d30('0x4e')]=_0x4ecac6['VoiceQueueId']||undefined;return _0x1905bb;};exports['decrementTalkink']=function(_0x4fcedd,_0x201a31){if(!_[_0x3d30('0x29')](_0x4fcedd)){if(_0x4fcedd['pTalking']>0x0){_0x4fcedd[_0x3d30('0x4f')]-=0x1;}else{logger[_0x3d30('0xd')](_0x201a31,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x3d30('0xd')](_0x201a31,_0x3d30('0x50'));}};exports[_0x3d30('0x51')]=function(_0x4607ff){if(_0x4607ff<=0x0){return!![];}return![];};function buildObj(_0x3a0dcb,_0x4dfc5c,_0x2b883b){_0x3a0dcb[_0x3d30('0x52')]=_0x4dfc5c;_0x3a0dcb[_0x3d30('0x15')]=_0x3a0dcb[_0x3d30('0x53')];_0x3a0dcb[_0x3d30('0x54')]=_0x3a0dcb[_0x3d30('0x3f')];_0x3a0dcb[_0x3d30('0x55')]=_0x3d30('0x56');if(_0x2b883b){_0x3a0dcb[_0x3d30('0x57')]=_0x2b883b[_0x3d30('0x57')];}return _0x3a0dcb;}exports[_0x3d30('0x58')]=buildObj;exports[_0x3d30('0x59')]=function(_0x4229b7){var _0x321d43={};_0x321d43[_0x3d30('0x53')]=_0x4229b7['queue'];_0x321d43[_0x3d30('0x54')]=_0x4229b7[_0x3d30('0x3f')];_0x321d43[_0x3d30('0x3d')]=_0x4229b7[_0x3d30('0x3d')];return _0x321d43;};exports[_0x3d30('0x5a')]=function(_0x3e215c){var _0xc59b15=[];for(var _0x4e86dd in _0x3e215c){if(_0x3e215c['hasOwnProperty'](_0x4e86dd)){if(!_['isNil'](_0x3e215c[_0x4e86dd])&&_0x3e215c[_0x4e86dd][_0x3d30('0x2f')]===_0x3d30('0x5b')&&_0x3e215c[_0x4e86dd]['status']===_0x3d30('0x5c')){_0xc59b15[_0x3d30('0x5d')](_0x3e215c[_0x4e86dd]['id']);}}}return _0xc59b15;};exports[_0x3d30('0x5e')]=function(_0x1d93af){var _0x466f14=moment()[_0x3d30('0x5f')](0x0);var _0xf69c99=moment(_0x1d93af)[_0x3d30('0x5f')](0x0);return _0x466f14['diff'](_0xf69c99,'seconds');};exports[_0x3d30('0x60')]=function(_0x3fdb54){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3fdb54[_0x3d30('0x18')],'ListId':_0x3fdb54[_0x3d30('0x4d')],'VoiceQueueId':_0x3fdb54['VoiceQueueId']||undefined,'CampaignId':_0x3fdb54[_0x3d30('0x61')]||undefined};};exports['filterKey']=function(_0x5bb942){if(_0x5bb942===_0x3d30('0x3d')||_0x5bb942===_0x3d30('0x62')||_0x5bb942===_0x3d30('0x53')||_0x5bb942==='type'||_0x5bb942===_0x3d30('0x63')||_0x5bb942===_0x3d30('0x64')||_0x5bb942===_0x3d30('0x37')||_0x5bb942===_0x3d30('0x3f')||_0x5bb942==='calleridname'||_0x5bb942===_0x3d30('0x4a')||_0x5bb942===_0x3d30('0x17')||_0x5bb942===_0x3d30('0x4b')||_0x5bb942===_0x3d30('0x42')||_0x5bb942===_0x3d30('0x43')||_0x5bb942===_0x3d30('0x44')||_0x5bb942===_0x3d30('0x65')||_0x5bb942==='callback'||_0x5bb942===_0x3d30('0x66')||_0x5bb942===_0x3d30('0x67')||_0x5bb942===_0x3d30('0x68')||_0x5bb942===_0x3d30('0x18')||_0x5bb942==='ListId'||_0x5bb942===_0x3d30('0x69')||_0x5bb942===_0x3d30('0x4e')||_0x5bb942===_0x3d30('0x6a')||_0x5bb942===_0x3d30('0x6b')||_0x5bb942===_0x3d30('0x6c')||_0x5bb942===_0x3d30('0x6d')||_0x5bb942===_0x3d30('0x6e')||_0x5bb942===_0x3d30('0x6f')||_0x5bb942===_0x3d30('0x70')||_0x5bb942===_0x3d30('0x71')||_0x5bb942==='xmd-dialid'||_0x5bb942==='xmd-dialchannel'||_0x5bb942===_0x3d30('0x72')||_0x5bb942===_0x3d30('0x73')||_0x5bb942===_0x3d30('0x74')||_0x5bb942==='xmd-agiafter'||_0x5bb942===_0x3d30('0x75')||_0x5bb942===_0x3d30('0x76')||_0x5bb942===_0x3d30('0x77')||_0x5bb942===_0x3d30('0x78')||_0x5bb942===_0x3d30('0x79')||_0x5bb942===_0x3d30('0x7a')||_0x5bb942===_0x3d30('0x7b')||_0x5bb942===_0x3d30('0x7c')||_0x5bb942==='rtpaudioqosrttbridged'||_0x5bb942===_0x3d30('0x76')||_0x5bb942===_0x3d30('0x77')||_0x5bb942===_0x3d30('0x78')||_0x5bb942===_0x3d30('0x79')||_0x5bb942===_0x3d30('0x7a')||_0x5bb942==='rtpaudioqoslossbridged'||_0x5bb942===_0x3d30('0x7c')||_0x5bb942===_0x3d30('0x7d')||_0x5bb942===_0x3d30('0x7e')||_0x5bb942===_0x3d30('0x7f')||_0x5bb942===_0x3d30('0x2f')||_0x5bb942===_0x3d30('0x30')){return![];}return!![];};exports[_0x3d30('0x80')]=function(_0x392f7c,_0x32e293){var _0x3e6473,_0x51dcfb,_0x5bfde1;if(_0x32e293<=0x0){_0x32e293=0x1;}_0x3e6473=new RegExp(_0x3d30('0x81')+_0x32e293+'}$');_0x51dcfb=Math['pow'](0xa,_0x32e293-0x1);_0x5bfde1=Math['pow'](0xa,_0x32e293)-0x1;return util[_0x3d30('0x12')]('%s',_['replace'](_0x392f7c,_0x3e6473,_[_0x3d30('0x82')](_0x51dcfb,_0x5bfde1)));};exports[_0x3d30('0x83')]=function(_0x46daa0){var _0x58fcc0=_0x46daa0[_0x3d30('0x84')](/"(.*?)"/);return _0x58fcc0?_0x58fcc0[0x1]:_0x46daa0;};exports[_0x3d30('0x85')]=function(_0x32762a){var _0x56447b=_0x32762a[_0x3d30('0x84')](/<(.*?)>/);return _0x56447b?_0x56447b[0x1]:_0x32762a;};function buildNoAnswerEventPayload(_0x275add,_0x506341){var _0x288e46=buildObj(_0x275add,_0x3d30('0x86'));if(!_[_0x3d30('0x11')](_0x506341['variables'])){Object[_0x3d30('0x87')](_0x506341[_0x3d30('0x88')])[_0x3d30('0x89')](function(_0xd5f3bb){_0x288e46[_0xd5f3bb[_0x3d30('0x8a')]()]=_0x506341[_0x3d30('0x88')][_0xd5f3bb];});}return _0x288e46;}exports[_0x3d30('0x8b')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 6cb13eb..507207f 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 _0xf09b=['string','number','queueremove','boolean','reload','voicequeuechannel','voicechannel','voicequeuechannelredirect','queueadd'];(function(_0x208b67,_0x328815){var _0x4dd1b7=function(_0x4c5b57){while(--_0x4c5b57){_0x208b67['push'](_0x208b67['shift']());}};_0x4dd1b7(++_0x328815);}(_0xf09b,0xa1));var _0xbf09=function(_0x78a14c,_0x260f6d){_0x78a14c=_0x78a14c-0x0;var _0x4ed3e8=_0xf09b[_0x78a14c];return _0x4ed3e8;};'use strict';exports[_0xbf09('0x0')]={'queue':{'type':_0xbf09('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xbf09('0x1'),'required':!![]},'penalty':{'type':_0xbf09('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xbf09('0x3')]={'queue':{'type':_0xbf09('0x1'),'required':!![]},'interface':{'type':_0xbf09('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0xbf09('0x1'),'required':!![]},'paused':{'type':_0xbf09('0x4')},'reason':{'type':'string','required':![]}};exports[_0xbf09('0x5')]={'module':{'type':_0xbf09('0x1'),'required':![]}};exports[_0xbf09('0x6')]={'uniqueid':{'type':_0xbf09('0x1'),'required':!![]}};exports[_0xbf09('0x7')]={'uniqueid':{'type':_0xbf09('0x1'),'required':!![]},'filename':{'type':_0xbf09('0x1')},'format':{'type':_0xbf09('0x1')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0xbf09('0x1'),'required':!![]}};exports[_0xbf09('0x8')]={'uniqueid':{'type':_0xbf09('0x1'),'required':!![]},'exten':{'type':_0xbf09('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0xba37=['queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','number','boolean'];(function(_0x8592c8,_0x4abba3){var _0x45e3d2=function(_0x4ea8ef){while(--_0x4ea8ef){_0x8592c8['push'](_0x8592c8['shift']());}};_0x45e3d2(++_0x4abba3);}(_0xba37,0x93));var _0x7ba3=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xba37[_0x36ed48];return _0x51c63a;};'use strict';exports['queueadd']={'queue':{'type':_0x7ba3('0x0'),'required':!![]},'interface':{'type':_0x7ba3('0x0'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x7ba3('0x1'),'required':![]},'paused':{'type':_0x7ba3('0x2'),'required':![]}};exports[_0x7ba3('0x3')]={'queue':{'type':_0x7ba3('0x0'),'required':!![]},'interface':{'type':_0x7ba3('0x0'),'required':!![]}};exports[_0x7ba3('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x7ba3('0x2')},'reason':{'type':_0x7ba3('0x0'),'required':![]}};exports[_0x7ba3('0x5')]={'module':{'type':_0x7ba3('0x0'),'required':![]}};exports[_0x7ba3('0x6')]={'uniqueid':{'type':_0x7ba3('0x0'),'required':!![]}};exports[_0x7ba3('0x7')]={'uniqueid':{'type':_0x7ba3('0x0'),'required':!![]},'filename':{'type':_0x7ba3('0x0')},'format':{'type':'string'},'mixmonitorid':{'type':_0x7ba3('0x0')}};exports[_0x7ba3('0x8')]={'uniqueid':{'type':_0x7ba3('0x0'),'required':!![]}};exports[_0x7ba3('0x9')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x7ba3('0x0'),'required':!![]},'context':{'type':_0x7ba3('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 351b9de..1162364 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 _0x757a=['queuecallerabandonAt','queuecallerexitAt','total','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','billableseconds','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','moment','util','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','timers','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','isNil','interface','name','hasOwnProperty','answered','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','sumHoldTime','sumBillable','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initTriggers','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','diff','queuecallerjoinAt','seconds','queuecallercompleteAt'];(function(_0x6e1595,_0x1ed0e4){var _0x297165=function(_0x4f56d0){while(--_0x4f56d0){_0x6e1595['push'](_0x6e1595['shift']());}};_0x297165(++_0x1ed0e4);}(_0x757a,0xde));var _0xa757=function(_0x3f5d18,_0x191243){_0x3f5d18=_0x3f5d18-0x0;var _0x25867b=_0x757a[_0x3f5d18];return _0x25867b;};'use strict';var _=require('lodash');var moment=require(_0xa757('0x0'));var util=require(_0xa757('0x1'));var Agent=require('../model/agent');var Telephone=require('../model/telephone');var Trunk=require('../model/trunk');var VoiceQueue=require(_0xa757('0x2'));var Trigger=require(_0xa757('0x3'));var Template=require(_0xa757('0x4'));var Campaign=require(_0xa757('0x5'));var VoiceExtension=require(_0xa757('0x6'));var ZendeskAccount=require(_0xa757('0x7'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xa757('0x8'));var SugarcrmAccount=require(_0xa757('0x9'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xa757('0xa'));var VtigerAccount=require(_0xa757('0xb'));var ServicenowAccount=require(_0xa757('0xc'));var Dynamics365Account=require(_0xa757('0xd'));var FreshsalesAccount=require(_0xa757('0xe'));var FaxAccount=require('../model/faxAccount');function Realtime(){this[_0xa757('0xf')]={};this[_0xa757('0x10')]={};this[_0xa757('0x11')]={};this[_0xa757('0x12')]={};this[_0xa757('0x13')]={};this[_0xa757('0x14')]={};this[_0xa757('0x15')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this['queueChannels']={};this['outboundChannels']={};this[_0xa757('0x16')]={};this['settings']={};this['zendeskAccounts']={};this[_0xa757('0x17')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this[_0xa757('0x18')]={};this[_0xa757('0x19')]={};this[_0xa757('0x1a')]={};this[_0xa757('0x1b')]={};this[_0xa757('0x1c')]={};this[_0xa757('0x1d')]={};this[_0xa757('0x1e')]={};}function freeIsNotKey(_0x2f7947,_0x185011,_0x3df1f9){var _0x50aac1=_[_0xa757('0x1f')](_0x2f7947,function(_0x44eab8){return _0x44eab8[_0x3df1f9];});for(var _0xde8248 in _0x185011){if(_0x185011['hasOwnProperty'](_0xde8248)){if(!_0x50aac1[_0xde8248]){delete _0x185011[_0xde8248];}}}}function freeIsNotKeySip(_0x54b305,_0x151c04){var _0x468d45=_[_0xa757('0x1f')](_0x54b305,function(_0x340599){return util[_0xa757('0x20')](_0xa757('0x21'),_0x340599['name']);});for(var _0x58954 in _0x151c04){if(_0x151c04['hasOwnProperty'](_0x58954)){if(!_0x468d45[_0x58954]){delete _0x151c04[_0x58954];}}}}function freeIsNotKeyAgent(_0x32c2a1,_0x167640){var _0x14014c=_[_0xa757('0x1f')](_0x32c2a1,function(_0x4d598c){var _0x5638c7=_[_0xa757('0x22')](_0x4d598c[_0xa757('0x23')])?util[_0xa757('0x20')](_0xa757('0x21'),_0x4d598c[_0xa757('0x24')]):_0x4d598c[_0xa757('0x23')];return _0x5638c7;});for(var _0x2ca10d in _0x167640){if(_0x167640[_0xa757('0x25')](_0x2ca10d)){if(!_0x14014c[_0x2ca10d]){delete _0x167640[_0x2ca10d];}}}}function clearVoiceCallReports(_0x2bf276){_0x2bf276['total']=0x0;_0x2bf276[_0xa757('0x26')]=0x0;_0x2bf276['sumHoldTime']=0x0;_0x2bf276[_0xa757('0x27')]=0x0;_0x2bf276['sumBillable']=0x0;}function clearCampaigns(_0x40551d){if(!_[_0xa757('0x28')](_0x40551d)){for(var _0x37c7e6 in _0x40551d){if(_0x40551d['hasOwnProperty'](_0x37c7e6)){_0x40551d[_0x37c7e6][_0xa757('0x29')]=0x0;_0x40551d[_0x37c7e6][_0xa757('0x2a')]=0x0;}}}}function clearVoiceQueues(_0x471e84){if(!_[_0xa757('0x28')](_0x471e84)){for(var _0x5b4779 in _0x471e84){if(_0x471e84[_0xa757('0x25')](_0x5b4779)){_0x471e84[_0x5b4779]['total']=0x0;_0x471e84[_0x5b4779]['answered']=0x0;_0x471e84[_0x5b4779]['unmanaged']=0x0;_0x471e84[_0x5b4779]['abandoned']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2b')]=0x0;_0x471e84[_0x5b4779]['sumDuration']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2c')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x2d')]=0x0;_0x471e84[_0x5b4779]['outboundNoAnswerCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2e')]=0x0;_0x471e84[_0x5b4779]['outboundCongestionCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2f')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x30')]=0x0;_0x471e84[_0x5b4779]['outboundDropCallsDayTimeout']=0x0;_0x471e84[_0x5b4779][_0xa757('0x31')]=0x0;_0x471e84[_0x5b4779]['outboundBlacklistCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x32')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x33')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x34')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x2d')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x35')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x36')]=!![];}}}}Realtime[_0xa757('0x37')][_0xa757('0x38')]=function(_0x112282,_0x384424){for(var _0x1f5d5a in _0x384424){if(_0x112282[_0xa757('0x25')](_0x1f5d5a)){_0x112282[_0x1f5d5a]=_0x384424[_0x1f5d5a];}}};Realtime[_0xa757('0x37')][_0xa757('0x39')]=function(){var _0x27be88=this;return function(_0xc1cc20){if(_0xc1cc20){freeIsNotKeyAgent(_0xc1cc20,_0x27be88[_0xa757('0xf')]);for(var _0x1ad384=0x0,_0x1eacde={};_0x1ad384<_0xc1cc20[_0xa757('0x3a')];_0x1ad384+=0x1){_0x1eacde=_0xc1cc20[_0x1ad384];var _0x3de18f=_[_0xa757('0x22')](_0x1eacde[_0xa757('0x23')])?util[_0xa757('0x20')]('SIP/%s',_0x1eacde[_0xa757('0x24')]):_0x1eacde[_0xa757('0x23')];if(_[_0xa757('0x3b')](_0x27be88[_0xa757('0xf')][_0x3de18f])){_0x27be88[_0xa757('0xf')][_0x3de18f]=new Agent(_0x1eacde);}else{_0x27be88['mergeFromDatabase'](_0x27be88[_0xa757('0xf')][_0x3de18f],_0x1eacde);}}}return _0x27be88[_0xa757('0xf')];};};Realtime[_0xa757('0x37')][_0xa757('0x3c')]=function(){var _0xd54446=this;return function(_0xc97cb8){if(_0xc97cb8){freeIsNotKeySip(_0xc97cb8,_0xd54446['telephones']);for(var _0x1346c2=0x0,_0x444639={};_0x1346c2<_0xc97cb8[_0xa757('0x3a')];_0x1346c2+=0x1){_0x444639=_0xc97cb8[_0x1346c2];if(_[_0xa757('0x3b')](_0xd54446[_0xa757('0x10')][util[_0xa757('0x20')](_0xa757('0x21'),_0x444639[_0xa757('0x24')])])){_0xd54446[_0xa757('0x10')][util['format'](_0xa757('0x21'),_0x444639[_0xa757('0x24')])]=new Telephone(_0x444639);}else{_0xd54446[_0xa757('0x38')](_0xd54446[_0xa757('0x10')][util[_0xa757('0x20')](_0xa757('0x21'),_0x444639['name'])],_0x444639);}}}return _0xd54446[_0xa757('0x10')];};};Realtime[_0xa757('0x37')]['initTrunks']=function(){var _0x5eae0b=this;return function(_0x9607af){if(_0x9607af){freeIsNotKeySip(_0x9607af,_0x5eae0b[_0xa757('0x11')]);for(var _0x5b11fe=0x0,_0x51c3d1={};_0x5b11fe<_0x9607af[_0xa757('0x3a')];_0x5b11fe+=0x1){_0x51c3d1=_0x9607af[_0x5b11fe];if(_[_0xa757('0x3b')](_0x5eae0b[_0xa757('0x11')][util['format'](_0xa757('0x21'),_0x51c3d1[_0xa757('0x24')])])){_0x5eae0b[_0xa757('0x11')][util[_0xa757('0x20')](_0xa757('0x21'),_0x51c3d1['name'])]=new Trunk(_0x51c3d1);}else{_0x5eae0b[_0xa757('0x38')](_0x5eae0b['trunks'][util['format'](_0xa757('0x21'),_0x51c3d1[_0xa757('0x24')])],_0x51c3d1);}}}return _0x5eae0b[_0xa757('0x11')];};};Realtime[_0xa757('0x37')][_0xa757('0x3d')]=function(){var _0x5d347c=this;return function(_0x5d25bb){if(_0x5d25bb){freeIsNotKey(_0x5d25bb,_0x5d347c[_0xa757('0x13')],'id');for(var _0x129d77=0x0,_0x2b171c={};_0x129d77<_0x5d25bb[_0xa757('0x3a')];_0x129d77+=0x1){_0x2b171c=_0x5d25bb[_0x129d77];if(_[_0xa757('0x3b')](_0x5d347c[_0xa757('0x13')][_0x2b171c['id']])){_0x5d347c['triggers'][_0x2b171c['id']]=new Trigger(_0x2b171c);}else{_0x5d347c[_0xa757('0x38')](_0x5d347c[_0xa757('0x13')][_0x2b171c['id']],_0x2b171c);}}}return _0x5d347c['triggers'];};};Realtime[_0xa757('0x37')]['initTemplates']=function(){var _0x2d111e=this;return function(_0x4518dc){if(_0x4518dc){freeIsNotKey(_0x4518dc,_0x2d111e['templates'],'id');for(var _0x267d68=0x0,_0x23efad={};_0x267d68<_0x4518dc['length'];_0x267d68+=0x1){_0x23efad=_0x4518dc[_0x267d68];if(_[_0xa757('0x3b')](_0x2d111e[_0xa757('0x15')][_0x23efad['id']])){_0x2d111e[_0xa757('0x15')][_0x23efad['id']]=new Template(_0x23efad);}else{_0x2d111e[_0xa757('0x38')](_0x2d111e['templates'][_0x23efad['id']],_0x23efad);}}}return _0x2d111e[_0xa757('0x15')];};};Realtime[_0xa757('0x37')][_0xa757('0x3e')]=function(){var _0xec4610=this;return function(_0x4d7493){if(_0x4d7493){freeIsNotKey(_0x4d7493,_0xec4610[_0xa757('0x3f')],'id');for(var _0x5b6017=0x0,_0x50c131={};_0x5b6017<_0x4d7493[_0xa757('0x3a')];_0x5b6017+=0x1){_0x50c131=_0x4d7493[_0x5b6017];if(_[_0xa757('0x3b')](_0xec4610[_0xa757('0x3f')][_0x50c131['id']])){_0xec4610['zendeskAccounts'][_0x50c131['id']]=new ZendeskAccount(_0x50c131);}else{_0xec4610[_0xa757('0x38')](_0xec4610['zendeskAccounts'][_0x50c131['id']],_0x50c131);}}}return _0xec4610[_0xa757('0x3f')];};};Realtime[_0xa757('0x37')][_0xa757('0x40')]=function(){var _0xbef575=this;return function(_0x18b0ca){if(_0x18b0ca){freeIsNotKey(_0x18b0ca,_0xbef575[_0xa757('0x17')],'id');for(var _0x57bf73=0x0,_0x505cd={};_0x57bf73<_0x18b0ca['length'];_0x57bf73+=0x1){_0x505cd=_0x18b0ca[_0x57bf73];if(_[_0xa757('0x3b')](_0xbef575[_0xa757('0x17')][_0x505cd['id']])){_0xbef575[_0xa757('0x17')][_0x505cd['id']]=new SalesforceAccount(_0x505cd);}else{_0xbef575[_0xa757('0x38')](_0xbef575[_0xa757('0x17')][_0x505cd['id']],_0x505cd);}}}return _0xbef575[_0xa757('0x17')];};};Realtime[_0xa757('0x37')][_0xa757('0x41')]=function(){var _0x405397=this;return function(_0x1d05d7){if(_0x1d05d7){freeIsNotKey(_0x1d05d7,_0x405397[_0xa757('0x42')],'id');for(var _0x19ceef=0x0,_0x2367c7={};_0x19ceef<_0x1d05d7[_0xa757('0x3a')];_0x19ceef+=0x1){_0x2367c7=_0x1d05d7[_0x19ceef];if(_[_0xa757('0x3b')](_0x405397[_0xa757('0x42')][_0x2367c7['id']])){_0x405397['freshdeskAccounts'][_0x2367c7['id']]=new FreshdeskAccount(_0x2367c7);}else{_0x405397[_0xa757('0x38')](_0x405397['freshdeskAccounts'][_0x2367c7['id']],_0x2367c7);}}}return _0x405397[_0xa757('0x42')];};};Realtime[_0xa757('0x37')][_0xa757('0x43')]=function(){var _0x24c0ad=this;return function(_0x4cb461){if(_0x4cb461){freeIsNotKey(_0x4cb461,_0x24c0ad[_0xa757('0x18')],'id');for(var _0x1ee01e=0x0,_0x8614f9={};_0x1ee01e<_0x4cb461[_0xa757('0x3a')];_0x1ee01e+=0x1){_0x8614f9=_0x4cb461[_0x1ee01e];if(_['isUndefined'](_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']])){_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']]=new ZohoAccount(_0x8614f9);}else{_0x24c0ad[_0xa757('0x38')](_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']],_0x8614f9);}}}return _0x24c0ad[_0xa757('0x18')];};};Realtime[_0xa757('0x37')]['initDeskAccounts']=function(){var _0x485100=this;return function(_0x5d21c1){if(_0x5d21c1){freeIsNotKey(_0x5d21c1,_0x485100['deskAccounts'],'id');for(var _0x1d8742=0x0,_0x9b3779={};_0x1d8742<_0x5d21c1[_0xa757('0x3a')];_0x1d8742+=0x1){_0x9b3779=_0x5d21c1[_0x1d8742];if(_[_0xa757('0x3b')](_0x485100[_0xa757('0x19')][_0x9b3779['id']])){_0x485100[_0xa757('0x19')][_0x9b3779['id']]=new DeskAccount(_0x9b3779);}else{_0x485100['mergeFromDatabase'](_0x485100[_0xa757('0x19')][_0x9b3779['id']],_0x9b3779);}}}return _0x485100[_0xa757('0x19')];};};Realtime[_0xa757('0x37')][_0xa757('0x44')]=function(){var _0x48b578=this;return function(_0x26c74e){if(_0x26c74e){freeIsNotKey(_0x26c74e,_0x48b578[_0xa757('0x45')],'id');for(var _0x4af840=0x0,_0x39699d={};_0x4af840<_0x26c74e['length'];_0x4af840+=0x1){_0x39699d=_0x26c74e[_0x4af840];if(_[_0xa757('0x3b')](_0x48b578['sugarcrmAccounts'][_0x39699d['id']])){_0x48b578[_0xa757('0x45')][_0x39699d['id']]=new SugarcrmAccount(_0x39699d);}else{_0x48b578['mergeFromDatabase'](_0x48b578['sugarcrmAccounts'][_0x39699d['id']],_0x39699d);}}}return _0x48b578[_0xa757('0x45')];};};Realtime[_0xa757('0x37')][_0xa757('0x46')]=function(){var _0x1b5db5=this;return function(_0x14e226){if(_0x14e226){freeIsNotKey(_0x14e226,_0x1b5db5[_0xa757('0x1a')],'id');for(var _0x4c19a6=0x0,_0x4f0d7b={};_0x4c19a6<_0x14e226[_0xa757('0x3a')];_0x4c19a6+=0x1){_0x4f0d7b=_0x14e226[_0x4c19a6];if(_[_0xa757('0x3b')](_0x1b5db5[_0xa757('0x1a')][_0x4f0d7b['id']])){_0x1b5db5['vtigerAccounts'][_0x4f0d7b['id']]=new VtigerAccount(_0x4f0d7b);}else{_0x1b5db5['mergeFromDatabase'](_0x1b5db5[_0xa757('0x1a')][_0x4f0d7b['id']],_0x4f0d7b);}}}return _0x1b5db5[_0xa757('0x1a')];};};Realtime[_0xa757('0x37')][_0xa757('0x47')]=function(){var _0x12b802=this;return function(_0x3e6d40){if(_0x3e6d40){freeIsNotKey(_0x3e6d40,_0x12b802['servicenowAccounts'],'id');for(var _0x466728=0x0,_0x45f2a4={};_0x466728<_0x3e6d40[_0xa757('0x3a')];_0x466728+=0x1){_0x45f2a4=_0x3e6d40[_0x466728];if(_[_0xa757('0x3b')](_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']])){_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']]=new ServicenowAccount(_0x45f2a4);}else{_0x12b802[_0xa757('0x38')](_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']],_0x45f2a4);}}}return _0x12b802[_0xa757('0x1b')];};};Realtime[_0xa757('0x37')]['initDynamics365Accounts']=function(){var _0x9e96e6=this;return function(_0x5c803a){if(_0x5c803a){freeIsNotKey(_0x5c803a,_0x9e96e6['dynamics365Accounts'],'id');for(var _0x40ce42=0x0,_0x3da8c1={};_0x40ce42<_0x5c803a[_0xa757('0x3a')];_0x40ce42+=0x1){_0x3da8c1=_0x5c803a[_0x40ce42];if(_[_0xa757('0x3b')](_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']])){_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']]=new Dynamics365Account(_0x3da8c1);}else{_0x9e96e6[_0xa757('0x38')](_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']],_0x3da8c1);}}}return _0x9e96e6[_0xa757('0x1c')];};};Realtime[_0xa757('0x37')][_0xa757('0x48')]=function(){var _0x4fc507=this;return function(_0x3f8c5c){if(_0x3f8c5c){freeIsNotKey(_0x3f8c5c,_0x4fc507[_0xa757('0x1d')],'id');for(var _0x5f0b71=0x0,_0x11ebb3={};_0x5f0b71<_0x3f8c5c[_0xa757('0x3a')];_0x5f0b71+=0x1){_0x11ebb3=_0x3f8c5c[_0x5f0b71];if(_[_0xa757('0x3b')](_0x4fc507[_0xa757('0x1d')][_0x11ebb3['id']])){_0x4fc507[_0xa757('0x1d')][_0x11ebb3['id']]=new FreshsalesAccount(_0x11ebb3);}else{_0x4fc507[_0xa757('0x38')](_0x4fc507['freshsalesAccounts'][_0x11ebb3['id']],_0x11ebb3);}}}return _0x4fc507[_0xa757('0x1d')];};};Realtime['prototype'][_0xa757('0x49')]=function(){var _0x3250d0=this;return function(_0x2d9d97){for(var _0x3c87c0=0x0;_0x3c87c0<_0x2d9d97[_0xa757('0x3a')];_0x3c87c0+=0x1){_['merge'](_0x3250d0['voiceQueues'][_0x2d9d97[_0x3c87c0][_0xa757('0x24')]],_0x2d9d97[_0x3c87c0]);}return _0x3250d0[_0xa757('0x12')];};};Realtime[_0xa757('0x37')]['initVoiceQueueReports']=function(){var _0x115a94=this;return function(_0x55bc0f){clearVoiceQueues(_0x115a94[_0xa757('0x12')]);if(_0x55bc0f){_0x55bc0f=_[_0xa757('0x4a')](_0x55bc0f,_0xa757('0x4b'));for(var _0xbf1bbf in _0x55bc0f){if(_0x55bc0f[_0xa757('0x25')](_0xbf1bbf)){for(var _0x40a79b=0x0;_0x40a79b<_0x55bc0f[_0xbf1bbf]['length'];_0x40a79b+=0x1){var _0xa28144=_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4c')];if(_0x115a94[_0xa757('0x12')][_0xa28144]){if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4d')]){_0x115a94[_0xa757('0x12')][_0xa28144]['unmanaged']+=0x1;}if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4e')]){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x4f')]+=0x1;}_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x2b')]+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b]['queuecallerleaveAt'])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x51')]),_0xa757('0x52'))||0x0;if(_0x40a79b===_0x55bc0f[_0xbf1bbf]['length']-0x1){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x27')]+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x53')]||_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x54')]||_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x55')])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x51')]),_0xa757('0x52'))||0x0;_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x56')]+=0x1;if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x57')]){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x26')]+=0x1;_0x115a94[_0xa757('0x12')][_0xa28144]['sumBillable']+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x53')])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b]['queuecallerleaveAt']),_0xa757('0x52'))||0x0;}}else{_0x115a94[_0xa757('0x12')][_0xa28144]['sumDuration']+=_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x2b')]||0x0;}}}}}}return _0x115a94[_0xa757('0x12')];};};Realtime[_0xa757('0x37')][_0xa757('0x58')]=function(){var _0x312542=this;return function(_0xdb2ac6){clearVoiceCallReports(_0x312542[_0xa757('0x59')]);if(_0xdb2ac6){for(var _0x1f74af=0x0;_0x1f74af<_0xdb2ac6[_0xa757('0x3a')];_0x1f74af+=0x1){_0x312542[_0xa757('0x59')][_0xa757('0x56')]+=0x1;_0x312542[_0xa757('0x59')][_0xa757('0x27')]+=_0xdb2ac6[_0x1f74af][_0xa757('0x5a')];if(_0xdb2ac6[_0x1f74af][_0xa757('0x5b')]==='ANSWERED'){_0x312542[_0xa757('0x59')]['answered']+=0x1;_0x312542[_0xa757('0x59')][_0xa757('0x2b')]+=_0xdb2ac6[_0x1f74af][_0xa757('0x5a')]-_0xdb2ac6[_0x1f74af][_0xa757('0x5c')]||0x0;_0x312542[_0xa757('0x59')]['sumBillable']+=_0xdb2ac6[_0x1f74af][_0xa757('0x5c')];}}}return _0x312542[_0xa757('0x59')];};};Realtime[_0xa757('0x37')]['initCampaigns']=function(){var _0x3317d8=this;return function(_0x3619ec){if(_0x3619ec){freeIsNotKey(_0x3619ec,_0x3317d8[_0xa757('0x14')],'name');for(var _0x501134=0x0,_0x1f437d={};_0x501134<_0x3619ec[_0xa757('0x3a')];_0x501134+=0x1){_0x1f437d=_0x3619ec[_0x501134];if(_[_0xa757('0x3b')](_0x3317d8['campaigns'][_0x1f437d[_0xa757('0x24')]])){_0x3317d8['campaigns'][_0x1f437d['name']]=new Campaign(_0x1f437d);}else{_0x3317d8[_0xa757('0x38')](_0x3317d8[_0xa757('0x14')][_0x1f437d[_0xa757('0x24')]],_0x1f437d);_0x3317d8['campaigns'][_0x1f437d[_0xa757('0x24')]][_0xa757('0x5d')]=_0x1f437d[_0xa757('0x5e')]?_0x1f437d[_0xa757('0x5e')][_0xa757('0x24')]:undefined;}}}return _0x3317d8[_0xa757('0x14')];};};Realtime[_0xa757('0x37')][_0xa757('0x5f')]=function(){var _0xe38e76=this;return function(_0x35c1aa){if(_0x35c1aa){freeIsNotKey(_0x35c1aa,_0xe38e76[_0xa757('0x60')],'id');for(var _0xafcf19=0x0,_0x5a7042={};_0xafcf19<_0x35c1aa[_0xa757('0x3a')];_0xafcf19+=0x1){_0x5a7042=_0x35c1aa[_0xafcf19];if(_[_0xa757('0x3b')](_0xe38e76[_0xa757('0x60')][_0x5a7042['id']])){_0xe38e76[_0xa757('0x60')][_0x5a7042['id']]=new VoiceExtension(_0x5a7042);}else{_0xe38e76[_0xa757('0x38')](_0xe38e76[_0xa757('0x60')][_0x5a7042['id']],_0x5a7042);}}}return _0xe38e76[_0xa757('0x60')];};};Realtime[_0xa757('0x37')][_0xa757('0x61')]=function(){var _0x2d34b7=this;return function(_0x3997f8){clearCampaigns(_0x2d34b7[_0xa757('0x14')]);for(var _0x132033=0x0;_0x132033<_0x3997f8[_0xa757('0x3a')];_0x132033+=0x1){_[_0xa757('0x62')](_0x2d34b7[_0xa757('0x14')][_0x3997f8[_0x132033][_0xa757('0x24')]],_0x3997f8[_0x132033]);}return _0x2d34b7[_0xa757('0x14')];};};Realtime[_0xa757('0x37')][_0xa757('0x63')]=function(){var _0x1bcb2e=this;return function(_0x20ea21){if(_0x20ea21){freeIsNotKey(_0x20ea21,_0x1bcb2e['faxAccounts'],'id');for(var _0x768a79=0x0,_0x39c52a={};_0x768a79<_0x20ea21['length'];_0x768a79+=0x1){_0x39c52a=_0x20ea21[_0x768a79];if(_[_0xa757('0x3b')](_0x1bcb2e['faxAccounts'][_0x39c52a['id']])){_0x1bcb2e[_0xa757('0x1e')][_0x39c52a['id']]=new FaxAccount(_0x39c52a);}else{_0x1bcb2e[_0xa757('0x38')](_0x1bcb2e['faxAccounts'][_0x39c52a['id']],_0x39c52a);}}}return _0x1bcb2e[_0xa757('0x1e')];};};Realtime[_0xa757('0x37')][_0xa757('0x64')]=function(){var _0x7ba6b3=this;return function(_0x535ff7){if(_0x535ff7){freeIsNotKey(_0x535ff7,_0x7ba6b3[_0xa757('0x12')],_0xa757('0x24'));for(var _0x4bf5c2=0x0,_0x30716a={};_0x4bf5c2<_0x535ff7[_0xa757('0x3a')];_0x4bf5c2+=0x1){_0x30716a=_0x535ff7[_0x4bf5c2];if(_['isUndefined'](_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]])){_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]]=new VoiceQueue(_0x30716a);}else{_0x7ba6b3[_0xa757('0x38')](_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]],_0x30716a);}}}return _0x7ba6b3[_0xa757('0x12')];};};module[_0xa757('0x65')]=Realtime; \ No newline at end of file +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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x0b0e,0x187));var _0xe0b0=function(_0x45aa72,_0x8af642){_0x45aa72=_0x45aa72-0x0;var _0x75adaa=_0x0b0e[_0x45aa72];return _0x75adaa;};'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 diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 881f727..36838c5 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 _0xe7af=['hasOwnProperty','assign'];(function(_0x20e51b,_0x3e9eb6){var _0x4e12a8=function(_0x271b0d){while(--_0x271b0d){_0x20e51b['push'](_0x20e51b['shift']());}};_0x4e12a8(++_0x3e9eb6);}(_0xe7af,0x119));var _0xfe7a=function(_0x29e3ec,_0x138a18){_0x29e3ec=_0x29e3ec-0x0;var _0x25727e=_0xe7af[_0x29e3ec];return _0x25727e;};'use strict';function mergeDBDataToRealtime(_0x4aa85c,_0x3ed645){var _0xb8eeae=Object[_0xfe7a('0x0')]({},_0x4aa85c);for(var _0x2cd1cd in _0x3ed645){if(_0xb8eeae[_0xfe7a('0x1')](_0x2cd1cd)){_0xb8eeae[_0x2cd1cd]=_0x3ed645[_0x2cd1cd];}}return _0xb8eeae;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime; \ No newline at end of file +var _0xd7d4=['assign','mergeDBDataToRealtime'];(function(_0x5d7139,_0x30dd9a){var _0x2d960a=function(_0x162ba5){while(--_0x162ba5){_0x5d7139['push'](_0x5d7139['shift']());}};_0x2d960a(++_0x30dd9a);}(_0xd7d4,0xe8));var _0x4d7d=function(_0x2f54b6,_0x3cc6cb){_0x2f54b6=_0x2f54b6-0x0;var _0x169f21=_0xd7d4[_0x2f54b6];return _0x169f21;};'use strict';function mergeDBDataToRealtime(_0x41c91c,_0x28d824){var _0x3491f9=Object[_0x4d7d('0x0')]({},_0x41c91c);for(var _0x40376d in _0x28d824){if(_0x3491f9['hasOwnProperty'](_0x40376d)){_0x3491f9[_0x40376d]=_0x28d824[_0x40376d];}}return _0x3491f9;}exports[_0x4d7d('0x1')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index f5ef8c7..348b8d7 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 _0x63bc=['./userReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','accountcode','name','isNil','find','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','getAgentByInternal','keys','getCallType','channel','split','outbound','internal','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','originatecalleridnum','destinationchannel','calleridpreview','calleridnum','calleridname','linkedid','transfereelinkedid','uniqueid','transfers','UserId','membername','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','xcally-motion-dialer','startsWith','indexOf','mobile','phone','exports','lodash','moment','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport'];(function(_0x5b821f,_0x4eafaf){var _0x42e952=function(_0x41a51c){while(--_0x41a51c){_0x5b821f['push'](_0x5b821f['shift']());}};_0x42e952(++_0x4eafaf);}(_0x63bc,0xa6));var _0xc63b=function(_0x1c1fc3,_0x2f3959){_0x1c1fc3=_0x1c1fc3-0x0;var _0xfd0db1=_0x63bc[_0x1c1fc3];return _0xfd0db1;};'use strict';var _=require(_0xc63b('0x0'));var moment=require(_0xc63b('0x1'));var util=require('util');var config=require(_0xc63b('0x2'));var ami=require(_0xc63b('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xc63b('0x4'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xc63b('0x5'));var RpcVoiceTransferReport=require(_0xc63b('0x6'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xc63b('0x7'));var VoiceAgentReport=require(_0xc63b('0x8'));var VoiceDialReport=require(_0xc63b('0x9'));var UserReport=require(_0xc63b('0xa'));function Report(_0x5ccf19){this[_0xc63b('0xb')]=_0x5ccf19;this['agents']=_0x5ccf19[_0xc63b('0xc')];this[_0xc63b('0xd')]=_0x5ccf19['telephones'];}Report[_0xc63b('0xe')][_0xc63b('0xf')]=function(_0x49d81a){var _0x14c235=new VoiceQueueReport(this['realtime']);var _0x4874cd=new VoiceAgentReport(this[_0xc63b('0xb')]);var _0x401cbe=new VoiceDialReport(this['realtime']);var _0x5066dd=new VoiceCallReport(this[_0xc63b('0xb')]);var _0x48d18d=new UserReport(this[_0xc63b('0xb')]);if(config[_0xc63b('0x10')]&&config[_0xc63b('0x10')]['disabled']){ami['on'](_0xc63b('0x11'),this[_0xc63b('0x12')][_0xc63b('0x13')](this));ami['on'](_0xc63b('0x14'),this[_0xc63b('0x15')][_0xc63b('0x13')](this));ami['on'](_0xc63b('0x16'),this[_0xc63b('0x17')]['bind'](this));ami['on'](_0xc63b('0x18'),this[_0xc63b('0x19')][_0xc63b('0x13')](this));ami['on'](_0xc63b('0x1a'),this[_0xc63b('0x1b')][_0xc63b('0x13')](this));ami['on'](_0xc63b('0x1c'),this[_0xc63b('0x1d')][_0xc63b('0x13')](this));}};Report[_0xc63b('0xe')][_0xc63b('0x1e')]=function(_0xdfc90a){var _0x7f8d22;_0x7f8d22=_['find'](this[_0xc63b('0xc')],function(_0x3330b1){return _0x3330b1[_0xc63b('0x1f')]==_0xdfc90a||_0x3330b1[_0xc63b('0x20')]==_0xdfc90a;});if(_[_0xc63b('0x21')](_0x7f8d22)){var _0x29f341=_[_0xc63b('0x22')](this['telephones'],function(_0x3f4c77){return _0x3f4c77[_0xc63b('0x1f')]==_0xdfc90a||_0x3f4c77['name']==_0xdfc90a;});if(_0x29f341){_0x7f8d22=_[_0xc63b('0x22')](this[_0xc63b('0xc')],function(_0x2f1d66){return _0x2f1d66[_0xc63b('0x23')]==util[_0xc63b('0x24')](_0xc63b('0x25'),_0x29f341[_0xc63b('0x20')]);});}}return _0x7f8d22;};Report[_0xc63b('0xe')][_0xc63b('0x12')]=function(_0x12b834){for(var _0x5d6134=0x0;_0x5d6134<_0x12b834[_0xc63b('0x26')];_0x5d6134+=0x1){var _0x57bb49=this[_0xc63b('0x1e')](_0x12b834[_0x5d6134][_0xc63b('0x27')]);if(_0x57bb49){_0x12b834[_0x5d6134][_0xc63b('0x1f')]=_0x57bb49[_0xc63b('0x1f')];_0x12b834[_0x5d6134][_0xc63b('0x28')]=!![];_0x12b834[_0x5d6134][_0xc63b('0x29')]=_0x57bb49['name'];_0x12b834[_0x5d6134]['interface']=_[_0xc63b('0x21')](_0x57bb49[_0xc63b('0x23')])?util['format'](_0xc63b('0x25'),_0x57bb49[_0xc63b('0x20')]):_0x57bb49[_0xc63b('0x23')];if(_0x12b834[_0x5d6134]['queuecallercomplete']){_0x12b834[_0x5d6134][_0xc63b('0x2a')]=moment()[_0xc63b('0x24')](_0xc63b('0x2b'));}if(_0x12b834[_0x5d6134]['queuecallerexit']){_0x12b834[_0x5d6134][_0xc63b('0x2c')]=moment()['format'](_0xc63b('0x2b'));}RpcMemberReport[_0xc63b('0x12')](_0x12b834[_0x5d6134]);}RpcVoiceQueueReport[_0xc63b('0x2d')](_0x12b834[_0x5d6134]);}};function extractCalleridNumber(_0x58580e){var _0x114f0e=_0x58580e['match'](/<(.*?)>/);return _0x114f0e?_0x114f0e[0x1]:_0x58580e;}Report[_0xc63b('0xe')][_0xc63b('0x2e')]=function(_0x2e90e7){for(var _0x233682=0x0;_0x233682',_0x579150[_0xc63b('0x45')],_0x579150[_0xc63b('0x44')]);}if(RpcVoiceTransferReport['transfers'][_0x579150[_0xc63b('0x46')]]){var _0x1bec5a=RpcVoiceTransferReport['transfers'][_0x579150[_0xc63b('0x46')]];_0x1bec5a[_0xc63b('0x47')]=_0x579150[_0xc63b('0x48')];RpcVoiceTransferReport[_0xc63b('0x1b')](_0x1bec5a);delete RpcVoiceTransferReport[_0xc63b('0x49')][_0x579150[_0xc63b('0x46')]];}if(_[_0xc63b('0x21')](_0x579150[_0xc63b('0x37')])){_0x579150[_0xc63b('0x37')]=this['getCallType'](_0x579150);}if(_[_0xc63b('0x21')](_0x579150[_0xc63b('0x4a')])){var _0x281eed=_0x579150[_0xc63b('0x31')][_0xc63b('0x32')]('-')[0x0];var _0x250b48=this[_0xc63b('0xc')][_0x281eed];if(!_0x250b48)_0x250b48=this[_0xc63b('0x2e')](_0x579150[_0xc63b('0x1f')]);if(_0x250b48){_0x579150['UserId']=_0x250b48['id'];_0x579150[_0xc63b('0x4b')]=_0x250b48['name'];}}RpcVoiceCallReport[_0xc63b('0x2d')](_0x579150);if(_0x579150[_0xc63b('0x4c')]){for(var _0x5cbcb3=0x0;_0x5cbcb3<_0x579150[_0xc63b('0x4d')]['length'];_0x5cbcb3+=0x1){_0x579150[_0xc63b('0x4e')]=_0x579150[_0xc63b('0x4d')][_0x5cbcb3][_0xc63b('0x4f')];_0x579150[_0xc63b('0x50')]=_0x579150[_0xc63b('0x4d')][_0x5cbcb3][_0xc63b('0x50')];if(_0x579150[_0xc63b('0x36')]==_0xc63b('0x40')){_0x579150[_0xc63b('0x44')]=_0x579150[_0xc63b('0x27')];_0x579150[_0xc63b('0x45')]=_0x579150[_0xc63b('0x51')];_0x579150[_0xc63b('0x27')]=_0x579150[_0xc63b('0x1f')];_0x579150['connectedlinename']=_0x579150[_0xc63b('0x4b')];_0x579150[_0xc63b('0x36')]=_0x579150[_0xc63b('0x41')];}else if(_0x579150[_0xc63b('0x36')]==_0xc63b('0x52')){_0x579150[_0xc63b('0x44')]=_0x579150[_0xc63b('0x35')];_0x579150[_0xc63b('0x36')]=_0x579150[_0xc63b('0x41')];}RpcVoiceRecording['create'](_0x579150);}}};Report[_0xc63b('0xe')][_0xc63b('0x17')]=function(_0x186280){if(_['isArray'](_0x186280)){_0x186280['forEach'](function(_0x26b792){RpcVoiceAgentReport[_0xc63b('0x2d')](_0x26b792);});}else{RpcVoiceAgentReport[_0xc63b('0x2d')](_0x186280);}};Report['prototype'][_0xc63b('0x19')]=function(_0x544143){RpcVoiceDialReport[_0xc63b('0x2d')](_0x544143);var _0x58c769;var _0xa5ceff;var _0x5ae884=_0x544143[_0xc63b('0x31')];if(_[_0xc63b('0x53')](_0x5ae884,'Local')){_0xa5ceff=_0x5ae884['substring'](_0x5ae884[_0xc63b('0x54')]('/')+0x1,_0x5ae884['indexOf']('@'));_0x58c769=_[_0xc63b('0x22')](this[_0xc63b('0xc')],function(_0x4610a5){return _0x4610a5[_0xc63b('0x55')]==_0xa5ceff||_0x4610a5[_0xc63b('0x56')]==_0xa5ceff||_0x4610a5[_0xc63b('0x1f')]==_0xa5ceff;});}else{_0xa5ceff=_0x5ae884['substring'](_0x5ae884[_0xc63b('0x54')]('/')+0x1,_0x5ae884['lastIndexOf']('-'));_0x58c769=this[_0xc63b('0x1e')](_0xa5ceff);}if(_0x58c769){_0x544143[_0xc63b('0x23')]=_[_0xc63b('0x21')](_0x58c769[_0xc63b('0x23')])?util[_0xc63b('0x24')]('SIP/%s',_0x58c769[_0xc63b('0x20')]):_0x58c769[_0xc63b('0x23')];_0x544143['membername']=_0x58c769['name'];_0x544143['accountcode']=_0x58c769['accountcode'];RpcMemberReport['voiceDialReport'](_0x544143);}};Report[_0xc63b('0xe')][_0xc63b('0x1b')]=function(_0x20f760){RpcVoiceTransferReport[_0xc63b('0x49')][_0x20f760['transfererlinkedid']]=_0x20f760;};Report[_0xc63b('0xe')][_0xc63b('0x1d')]=function(_0x14f1cf){RpcVoiceTransferReport['attendedTransfer'](_0x14f1cf);};module[_0xc63b('0x57')]=Report; \ No newline at end of file +var _0xdd7c=['destinationchannel','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','membername','monitors','monitorFilename','filename','createdAt','connectedlinename','exten','isArray','forEach','startsWith','Local','indexOf','mobile','phone','substring','transfererlinkedid','exports','lodash','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','isNil','accountcode','name','SIP/%s','length','connectedlinenum','assigned','interface','queuecallercomplete','queuecallercompleteAt','format','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','keys','split','getAgentByInternal','outbound','internal','voiceCallReport','destination','type','lastdata','from-voip-provider','callerid','context','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum'];(function(_0x9b251e,_0x148914){var _0x2e4d35=function(_0x3d0b43){while(--_0x3d0b43){_0x9b251e['push'](_0x9b251e['shift']());}};_0x2e4d35(++_0x148914);}(_0xdd7c,0xd7));var _0xcdd7=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0xdd7c[_0x3c51d4];return _0x53c45f;};'use strict';var _=require(_0xcdd7('0x0'));var moment=require('moment');var util=require(_0xcdd7('0x1'));var config=require(_0xcdd7('0x2'));var ami=require(_0xcdd7('0x3'));var RpcVoiceAgentReport=require(_0xcdd7('0x4'));var RpcVoiceCallReport=require(_0xcdd7('0x5'));var RpcVoiceDialReport=require(_0xcdd7('0x6'));var RpcMemberReport=require(_0xcdd7('0x7'));var RpcVoiceQueueReport=require(_0xcdd7('0x8'));var RpcVoiceRecording=require(_0xcdd7('0x9'));var RpcVoiceTransferReport=require(_0xcdd7('0xa'));var VoiceQueueReport=require(_0xcdd7('0xb'));var VoiceCallReport=require(_0xcdd7('0xc'));var VoiceAgentReport=require(_0xcdd7('0xd'));var VoiceDialReport=require(_0xcdd7('0xe'));var UserReport=require(_0xcdd7('0xf'));function Report(_0x2139d9){this[_0xcdd7('0x10')]=_0x2139d9;this[_0xcdd7('0x11')]=_0x2139d9[_0xcdd7('0x11')];this[_0xcdd7('0x12')]=_0x2139d9['telephones'];}Report['prototype'][_0xcdd7('0x13')]=function(_0xf9a677){var _0x13749b=new VoiceQueueReport(this[_0xcdd7('0x10')]);var _0x318a05=new VoiceAgentReport(this[_0xcdd7('0x10')]);var _0x1f895d=new VoiceDialReport(this['realtime']);var _0x3d6a38=new VoiceCallReport(this['realtime']);var _0x373639=new UserReport(this['realtime']);if(config['xdr']&&config[_0xcdd7('0x14')][_0xcdd7('0x15')]){ami['on'](_0xcdd7('0x16'),this[_0xcdd7('0x17')]['bind'](this));ami['on']('custom:voiceCallReport',this['voiceCallReport'][_0xcdd7('0x18')](this));ami['on']('custom:voiceAgentReport',this[_0xcdd7('0x19')][_0xcdd7('0x18')](this));ami['on'](_0xcdd7('0x1a'),this[_0xcdd7('0x1b')][_0xcdd7('0x18')](this));ami['on'](_0xcdd7('0x1c'),this[_0xcdd7('0x1d')][_0xcdd7('0x18')](this));ami['on'](_0xcdd7('0x1e'),this[_0xcdd7('0x1f')][_0xcdd7('0x18')](this));}};Report[_0xcdd7('0x20')][_0xcdd7('0x21')]=function(_0x5b58fa){var _0xb05df;_0xb05df=_[_0xcdd7('0x22')](this[_0xcdd7('0x11')],function(_0x2e1940){return _0x2e1940['accountcode']==_0x5b58fa||_0x2e1940['name']==_0x5b58fa;});if(_[_0xcdd7('0x23')](_0xb05df)){var _0x45a63c=_[_0xcdd7('0x22')](this['telephones'],function(_0x2f80ba){return _0x2f80ba[_0xcdd7('0x24')]==_0x5b58fa||_0x2f80ba[_0xcdd7('0x25')]==_0x5b58fa;});if(_0x45a63c){_0xb05df=_[_0xcdd7('0x22')](this[_0xcdd7('0x11')],function(_0x141661){return _0x141661['interface']==util['format'](_0xcdd7('0x26'),_0x45a63c['name']);});}}return _0xb05df;};Report[_0xcdd7('0x20')][_0xcdd7('0x17')]=function(_0x1c0364){for(var _0x150813=0x0;_0x150813<_0x1c0364[_0xcdd7('0x27')];_0x150813+=0x1){var _0x505340=this[_0xcdd7('0x21')](_0x1c0364[_0x150813][_0xcdd7('0x28')]);if(_0x505340){_0x1c0364[_0x150813][_0xcdd7('0x24')]=_0x505340[_0xcdd7('0x24')];_0x1c0364[_0x150813][_0xcdd7('0x29')]=!![];_0x1c0364[_0x150813]['lastAssignedTo']=_0x505340[_0xcdd7('0x25')];_0x1c0364[_0x150813][_0xcdd7('0x2a')]=_[_0xcdd7('0x23')](_0x505340[_0xcdd7('0x2a')])?util['format'](_0xcdd7('0x26'),_0x505340[_0xcdd7('0x25')]):_0x505340[_0xcdd7('0x2a')];if(_0x1c0364[_0x150813][_0xcdd7('0x2b')]){_0x1c0364[_0x150813][_0xcdd7('0x2c')]=moment()[_0xcdd7('0x2d')](_0xcdd7('0x2e'));}if(_0x1c0364[_0x150813][_0xcdd7('0x2f')]){_0x1c0364[_0x150813][_0xcdd7('0x30')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xcdd7('0x17')](_0x1c0364[_0x150813]);}RpcVoiceQueueReport[_0xcdd7('0x31')](_0x1c0364[_0x150813]);}};function extractCalleridNumber(_0x293b4c){var _0x85569d=_0x293b4c[_0xcdd7('0x32')](/<(.*?)>/);return _0x85569d?_0x85569d[0x1]:_0x293b4c;}Report[_0xcdd7('0x20')]['getAgentByInternal']=function(_0x30405f){for(var _0x2f273d=0x0;_0x2f273d0x0?!![]:![];if(!_0x58310c){return this[_0x892b('0x1c')](this[_0x892b('0x17')][_0x892b('0x6b')]);}};VoiceQueueReport['prototype'][_0x892b('0x1f')]=function(_0x30804e){var _0xf1da5c=this[_0x892b('0x17')]['id'];if(this[_0x892b('0x17')][_0x892b('0x68')][_0xf1da5c]&&this[_0x892b('0x17')][_0x892b('0x68')][_0xf1da5c][_0x30804e['actionid']]){this[_0x892b('0x17')][_0x892b('0x68')][_0xf1da5c][_0x30804e[_0x892b('0x5f')]][_0x892b('0x12')][_0x892b('0x6c')](_0x30804e);}};VoiceQueueReport[_0x892b('0xd')][_0x892b('0x1a')]=function(_0x3e7fdf){var _0x33d95e=this;try{if(this[_0x892b('0x5b')](_0x3e7fdf)&&this['isNotNull'](_0x3e7fdf[_0x892b('0x54')])){logger[_0x892b('0x4c')](_0x892b('0x6d'),util[_0x892b('0x43')](_0x3e7fdf,{'showHidden':![],'depth':null}));var _0x5d9a92=this[_0x892b('0x15')][_0x3e7fdf['queue']];if(_0x5d9a92){logger[_0x892b('0x4c')](_0x892b('0x6e'),_0x5d9a92['name']);this[_0x892b('0x17')][_0x892b('0x5c')][_0x5d9a92[_0x892b('0x5a')]]={'summaryEvent':_0x3e7fdf};this[_0x892b('0x17')][_0x892b('0x6a')]+=0x1;return ami[_0x892b('0x3f')]({'action':_0x892b('0x68'),'queue':_0x5d9a92[_0x892b('0x5a')]})[_0x892b('0x5e')](function(_0x33cfa2){if(!_0x33d95e['summary'][_0x892b('0x68')][_0x3e7fdf[_0x892b('0x5f')]]){_0x33d95e['summary']['queuestatus'][_0x3e7fdf[_0x892b('0x5f')]]={};}_0x33d95e[_0x892b('0x17')][_0x892b('0x68')][_0x3e7fdf[_0x892b('0x5f')]][_0x33cfa2[_0x892b('0x5f')]]={'queue':_0x5d9a92[_0x892b('0x5a')],'agents':[]};})[_0x892b('0x60')](function(_0x3dba3f){throw _0x3dba3f;});}}}catch(_0x254250){logger['error']('[voiceQueueReport][queuesummary]',util['inspect'](_0x254250,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x892b('0x1c')]=function(_0x5e644b){if(this['summary']['statusRequests']>0x0){this[_0x892b('0x17')][_0x892b('0x6b')]=_0x5e644b;return;}logger[_0x892b('0x4c')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x892b('0x43')](_0x5e644b,{'showHidden':![],'depth':null}));this[_0x892b('0x17')]=initializeSummary();ami[_0x892b('0x4a')](_0x892b('0x6f'),{});};VoiceQueueReport[_0x892b('0xd')][_0x892b('0x21')]=function(_0x11912f){try{if(this['isNotNull'](_0x11912f)){logger['debug'](_0x892b('0x70'),_0x11912f[_0x892b('0x4f')],util['inspect'](_0x11912f,{'showHidden':![],'depth':null}));if(_[_0x892b('0x71')](this[_0x892b('0x44')][_0x11912f[_0x892b('0x4f')]])){this[_0x892b('0x44')][_0x11912f['uniqueid']]=[];}if(_[_0x892b('0x71')](this[_0x892b('0x13')][_0x11912f['uniqueid']])){this[_0x892b('0x13')][_0x11912f['uniqueid']]={};}var _0x207ead=new QueueReport();_0x207ead[_0x892b('0x54')]=_0x11912f[_0x892b('0x54')];_0x207ead[_0x892b('0x58')]=this['voiceQueues'][_0x207ead[_0x892b('0x54')]]&&this[_0x892b('0x15')][_0x207ead['queue']][_0x892b('0x58')]?this['voiceQueues'][_0x207ead[_0x892b('0x54')]][_0x892b('0x58')]||_0x892b('0x72'):_0x892b('0x72');_0x207ead['queuecallerjoinAt']=moment()[_0x892b('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x207ead[_0x892b('0x73')]=_0x11912f[_0x892b('0x73')];_0x207ead['count']=_0x11912f[_0x892b('0x74')];_0x207ead[_0x892b('0x4f')]=_0x11912f['uniqueid'];_0x207ead[_0x892b('0x75')]=this[_0x892b('0x13')][_0x11912f[_0x892b('0x4f')]][_0x892b('0x75')];logger[_0x892b('0x76')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x207ead[_0x892b('0x54')],_0x207ead[_0x892b('0x58')]);Object[_0x892b('0x66')](_0x207ead,_[_0x892b('0x77')](_0x11912f,_[_0x892b('0x78')](_0x207ead)));this[_0x892b('0x44')][_0x11912f[_0x892b('0x4f')]][_0x892b('0x6c')](_0x207ead);this['channels'][_0x11912f[_0x892b('0x4f')]]=_0x207ead;this['emitVoiceQueueChannelSave'](_0x207ead,_0x892b('0x79'));}}catch(_0x226b3a){logger[_0x892b('0x41')]('[%s][voiceQueueReport][queuecallerjoin]',_0x11912f[_0x892b('0x4f')],util[_0x892b('0x43')](_0x226b3a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x892b('0xd')]['syncQueueCallerAbandon']=function(_0x45e7a7){try{if(this['isNotNull'](_0x45e7a7)){logger['debug'](_0x892b('0x7a'),_0x45e7a7['uniqueid'],util[_0x892b('0x43')](_0x45e7a7,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x45e7a7[_0x892b('0x4f')]]){var _0x4e92ba=_[_0x892b('0x7b')](this[_0x892b('0x44')][_0x45e7a7['uniqueid']]);_0x4e92ba[_0x892b('0x3b')]=![];_0x4e92ba[_0x892b('0x7c')]=null;_0x4e92ba['holdtime']=_0x45e7a7[_0x892b('0x7d')];_0x4e92ba['originalposition']=_0x45e7a7[_0x892b('0x7e')];_0x4e92ba[_0x892b('0x22')]=!![];_0x4e92ba[_0x892b('0x7f')]=moment()[_0x892b('0x50')](_0x892b('0x80'));_0x4e92ba[_0x892b('0x53')]=_0x892b('0x81');_0x4e92ba[_0x892b('0x82')]=null;logger[_0x892b('0x76')](_0x892b('0x83'),_0x4e92ba[_0x892b('0x54')],_0x4e92ba['type']);this[_0x892b('0x13')][_0x45e7a7[_0x892b('0x4f')]]=_0x4e92ba;this[_0x892b('0x49')](_0x4e92ba,_0x892b('0x22'));}}}catch(_0x597356){logger[_0x892b('0x41')](_0x892b('0x7a'),_0x45e7a7[_0x892b('0x4f')],util[_0x892b('0x43')](_0x597356,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x892b('0xd')][_0x892b('0x24')]=function(_0x1722a1){try{if(this['isNotNull'](_0x1722a1)){logger[_0x892b('0x4c')]('[%s][voiceQueueReport][queuecallerleave]',_0x1722a1[_0x892b('0x4f')],util[_0x892b('0x43')](_0x1722a1,{'showHidden':![],'depth':null}));if(this[_0x892b('0x44')][_0x1722a1['uniqueid']]){var _0x5ecad2=_[_0x892b('0x7b')](this[_0x892b('0x44')][_0x1722a1['uniqueid']]);_0x5ecad2[_0x892b('0x84')]=moment()[_0x892b('0x50')](_0x892b('0x80'));_0x5ecad2[_0x892b('0x85')]=_0x1722a1[_0x892b('0x85')];_0x5ecad2[_0x892b('0x86')]=_0x1722a1[_0x892b('0x86')];logger[_0x892b('0x76')](_0x892b('0x87'),_0x5ecad2[_0x892b('0x54')],_0x5ecad2[_0x892b('0x58')],_0x1722a1[_0x892b('0x85')],_0x1722a1[_0x892b('0x86')]);this[_0x892b('0x13')][_0x1722a1[_0x892b('0x4f')]]=_0x5ecad2;this[_0x892b('0x4b')](_0x5ecad2,_0x892b('0x88'));}}}catch(_0x11b5ac){logger[_0x892b('0x41')](_0x892b('0x89'),_0x1722a1['uniqueid'],util[_0x892b('0x43')](_0x11b5ac,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x892b('0xd')][_0x892b('0x27')]=function(_0x113d46){try{if(this[_0x892b('0x5b')](_0x113d46)){logger[_0x892b('0x4c')](_0x892b('0x8a'),_0x113d46['uniqueid'],util[_0x892b('0x43')](_0x113d46,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x113d46[_0x892b('0x4f')]]){var _0x5681e2=_['last'](this[_0x892b('0x44')][_0x113d46[_0x892b('0x4f')]]);_0x5681e2[_0x892b('0x3b')]=!![];_0x5681e2[_0x892b('0x53')]=_0x892b('0x8b');logger[_0x892b('0x76')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x5681e2[_0x892b('0x54')],_0x5681e2[_0x892b('0x58')]);}}}catch(_0x497b8a){logger[_0x892b('0x41')](_0x892b('0x8a'),_0x113d46[_0x892b('0x4f')],util[_0x892b('0x43')](_0x497b8a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x892b('0xd')]['syncAgentComplete']=function(_0x2f3657){try{if(this[_0x892b('0x5b')](_0x2f3657)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x2f3657[_0x892b('0x4f')],util[_0x892b('0x43')](_0x2f3657,{'showHidden':![],'depth':null}));if(this[_0x892b('0x44')][_0x2f3657[_0x892b('0x4f')]]){var _0x2e8aa2=_[_0x892b('0x7b')](this['queueReports'][_0x2f3657['uniqueid']]);_0x2e8aa2['queuecallerabandon']=![];_0x2e8aa2['queuecallerabandonAt']=null;_0x2e8aa2[_0x892b('0x8c')]=!![];_0x2e8aa2[_0x892b('0x82')]=_0x2f3657['membername'];_0x2e8aa2['holdtime']=_0x2f3657[_0x892b('0x7d')];_0x2e8aa2[_0x892b('0x3b')]=!![];_0x2e8aa2['queuecallerexit']=![];_0x2e8aa2[_0x892b('0x8d')]=null;if(!_0x2e8aa2['transfer']){if(_0x2f3657['reason']=='transfer'){_0x2e8aa2[_0x892b('0x53')]=_0x892b('0x8e');logger[_0x892b('0x76')](_0x892b('0x8f'),_0x2e8aa2[_0x892b('0x54')],_0x2e8aa2[_0x892b('0x58')]);}else{if(_['startsWith'](_0x2f3657['channel'][_0x892b('0x90')](),'local/')){if(this[_0x892b('0x44')][_0x2f3657['linkedid']]){var _0x8ab6f2=_[_0x892b('0x7b')](this[_0x892b('0x44')][_0x2f3657['linkedid']]);_0x8ab6f2['queuecallercomplete']=![];_0x8ab6f2[_0x892b('0x3a')]=!![];_0x8ab6f2[_0x892b('0x8d')]=moment(_0x2e8aa2[_0x892b('0x91')])[_0x892b('0x92')](_0x2f3657[_0x892b('0x7d')],_0x892b('0x93'))[_0x892b('0x50')](_0x892b('0x80'));_0x8ab6f2[_0x892b('0x53')]=_0x892b('0x94');_0x8ab6f2['transfer']=!![];_0x8ab6f2['transfertype']=_0x892b('0x95');_0x8ab6f2[_0x892b('0x96')]=_0x2f3657[_0x892b('0x97')];_0x8ab6f2[_0x892b('0x98')]=_0x2f3657[_0x892b('0x4f')];logger['info'](_0x892b('0x99'),_0x8ab6f2[_0x892b('0x54')],_0x8ab6f2[_0x892b('0x58')]);var _0x5d130c=this['queueReports'][_0x2f3657[_0x892b('0x9a')]];this[_0x892b('0x44')][_0x2f3657[_0x892b('0x9a')]]=this[_0x892b('0x44')][_0x2f3657[_0x892b('0x4f')]];this[_0x892b('0x44')][_0x2f3657['uniqueid']]=_0x5d130c;}}else{_0x2e8aa2[_0x892b('0x53')]=_0x892b('0x9b')+_0x2f3657['reason'][_0x892b('0x9c')]();logger['info'](_0x892b('0x9d'),_0x2e8aa2[_0x892b('0x54')],_0x2e8aa2[_0x892b('0x58')],_0x2e8aa2[_0x892b('0x53')]);}}}this[_0x892b('0x13')][_0x2f3657[_0x892b('0x4f')]]=_0x2e8aa2;}}}catch(_0x2052b6){logger[_0x892b('0x41')]('[%s][voiceQueueReport][agentcomplete]',_0x2f3657['uniqueid'],util['inspect'](_0x2052b6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x892b('0xd')][_0x892b('0x28')]=function(_0x5f3bf9){try{if(this['isNotNull'](_0x5f3bf9)){logger[_0x892b('0x4c')](_0x892b('0x9e'),_0x5f3bf9['uniqueid'],util[_0x892b('0x43')](_0x5f3bf9,{'showHidden':![],'depth':null}));this[_0x892b('0x9f')](_0x5f3bf9['uniqueid'],_[_0x892b('0x78')](_0x5f3bf9[_0x892b('0xa0')])[0x0],_0x5f3bf9[_0x892b('0xa1')]);if(this['queueReports'][_0x5f3bf9[_0x892b('0x4f')]]){var _0x1ff2fc=_[_0x892b('0x7b')](this[_0x892b('0x44')][_0x5f3bf9[_0x892b('0x4f')]]);if(_0x1ff2fc){if(this[_0x892b('0x5b')](_0x5f3bf9[_0x892b('0xa0')])&&this['isNotNull'](_0x5f3bf9[_0x892b('0xa0')][_0x892b('0x68')])){switch(_0x5f3bf9[_0x892b('0xa1')]){case _0x892b('0xa2'):_0x1ff2fc[_0x892b('0x3a')]=![];_0x1ff2fc[_0x892b('0x8d')]=null;break;case'TIMEOUT':_0x1ff2fc[_0x892b('0xa3')]=_0x892b('0xa4');_0x1ff2fc[_0x892b('0x3a')]=!![];_0x1ff2fc[_0x892b('0x8d')]=moment()[_0x892b('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x1ff2fc[_0x892b('0x84')]=moment()[_0x892b('0x50')](_0x892b('0x80'));logger[_0x892b('0x4c')](_0x892b('0xa5'),_0x5f3bf9[_0x892b('0x4f')],util['inspect'](_0x1ff2fc,{'showHidden':![],'depth':null}));ami[_0x892b('0x4a')](_0x892b('0xa6'),_0x1ff2fc);break;default:_0x1ff2fc[_0x892b('0x3a')]=!![];_0x1ff2fc[_0x892b('0x8d')]=moment()[_0x892b('0x50')](_0x892b('0x80'));_0x1ff2fc[_0x892b('0x84')]=moment()[_0x892b('0x50')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1ff2fc['queuecallerabandon']=![];_0x1ff2fc['queuecallerabandonAt']=null;_0x1ff2fc[_0x892b('0x53')]=_0x5f3bf9[_0x892b('0xa1')];this[_0x892b('0x13')][_0x5f3bf9[_0x892b('0x4f')]]=_0x1ff2fc;this[_0x892b('0x49')](_0x1ff2fc,'varset');}else if(this[_0x892b('0x5b')](_0x5f3bf9['variable'])&&this[_0x892b('0x5b')](_0x5f3bf9['variable'][_0x892b('0xa7')])){if(!_0x1ff2fc[_0x892b('0x22')]){_0x1ff2fc[_0x892b('0x3a')]=!![];_0x1ff2fc[_0x892b('0x8d')]=moment()['format'](_0x892b('0x80'));_0x1ff2fc['queuecallerexitreason']=_0x892b('0xa8');_0x1ff2fc[_0x892b('0x84')]=moment()[_0x892b('0x50')](_0x892b('0x80'));this[_0x892b('0x13')][_0x5f3bf9[_0x892b('0x4f')]]=_0x1ff2fc;}}logger['info'](_0x892b('0xa9'),_0x5f3bf9[_0x892b('0x4f')],_0x1ff2fc[_0x892b('0x54')],_0x1ff2fc[_0x892b('0x58')],_['keys'](_0x5f3bf9[_0x892b('0xa0')])[0x0],_0x5f3bf9[_0x892b('0xa1')]);_0x1ff2fc[_0x892b('0x18')]=this[_0x892b('0x18')][_0x5f3bf9['uniqueid']];}}}}catch(_0x32772f){logger['error'](_0x892b('0x9e'),_0x5f3bf9[_0x892b('0x4f')],util[_0x892b('0x43')](_0x32772f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x892b('0xd')][_0x892b('0x9f')]=function(_0x41dcbb,_0x396edc,_0x3ca557){var _0x2fdb75=[_0x892b('0xaa'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x892b('0xab'),_0x892b('0xac'),_0x892b('0xad'),_0x892b('0xae'),_0x892b('0xaf'),_0x892b('0xb0'),'sipuri',_0x892b('0xb1'),'bridgepvtcallid',_0x892b('0xb2'),_0x892b('0xb3'),_0x892b('0xb4'),_0x892b('0xb5'),_0x892b('0xb6'),_0x892b('0xb7'),_0x892b('0xb8')];if(!_[_0x892b('0xb9')](_0x396edc)&&!_[_0x892b('0xba')](_0x2fdb75,_0x396edc)){if(_[_0x892b('0x71')](this[_0x892b('0x18')][_0x41dcbb])){this['variables'][_0x41dcbb]={};}this[_0x892b('0x18')][_0x41dcbb][_0x396edc]=_0x3ca557;}};VoiceQueueReport[_0x892b('0xd')][_0x892b('0xbb')]=function(_0x1f4f9a,_0x5e62a1,_0x279f01){var _0x3dc029={};for(var _0x471119=0x0;_0x4711190x0?!![]:![];if(!_0x367904){return this[_0x9174('0x19')](this[_0x9174('0x16')][_0x9174('0x69')]);}};VoiceQueueReport[_0x9174('0x42')][_0x9174('0x1b')]=function(_0x8a9644){var _0x332fae=this['summary']['id'];if(this[_0x9174('0x16')][_0x9174('0x61')][_0x332fae]&&this['summary'][_0x9174('0x61')][_0x332fae][_0x8a9644[_0x9174('0x60')]]){this['summary'][_0x9174('0x61')][_0x332fae][_0x8a9644[_0x9174('0x60')]][_0x9174('0x12')][_0x9174('0x6a')](_0x8a9644);}};VoiceQueueReport[_0x9174('0x42')][_0x9174('0x6b')]=function(_0x58bc17){var _0x83c898=this;try{if(this['isNotNull'](_0x58bc17)&&this[_0x9174('0x5b')](_0x58bc17[_0x9174('0x4f')])){logger[_0x9174('0x49')](_0x9174('0x6c'),util[_0x9174('0x3f')](_0x58bc17,{'showHidden':![],'depth':null}));var _0x3ffa85=this[_0x9174('0x14')][_0x58bc17[_0x9174('0x4f')]];if(_0x3ffa85){logger[_0x9174('0x49')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x3ffa85['name']);this[_0x9174('0x16')][_0x9174('0x5d')][_0x3ffa85[_0x9174('0x59')]]={'summaryEvent':_0x58bc17};this[_0x9174('0x16')][_0x9174('0x68')]+=0x1;return ami[_0x9174('0x39')]({'action':'queuestatus','queue':_0x3ffa85[_0x9174('0x59')]})[_0x9174('0x6d')](function(_0x17386c){if(!_0x83c898[_0x9174('0x16')][_0x9174('0x61')][_0x58bc17[_0x9174('0x60')]]){_0x83c898[_0x9174('0x16')][_0x9174('0x61')][_0x58bc17[_0x9174('0x60')]]={};}_0x83c898[_0x9174('0x16')][_0x9174('0x61')][_0x58bc17['actionid']][_0x17386c[_0x9174('0x60')]]={'queue':_0x3ffa85[_0x9174('0x59')],'agents':[]};})[_0x9174('0x5e')](function(_0x5d4494){throw _0x5d4494;});}}}catch(_0x2fb81c){logger[_0x9174('0x3d')](_0x9174('0x62'),util[_0x9174('0x3f')](_0x2fb81c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9174('0x42')][_0x9174('0x19')]=function(_0x16389c){if(this[_0x9174('0x16')]['statusRequests']>0x0){this['summary'][_0x9174('0x69')]=_0x16389c;return;}logger[_0x9174('0x49')](_0x9174('0x6e'),util[_0x9174('0x3f')](_0x16389c,{'showHidden':![],'depth':null}));this[_0x9174('0x16')]=initializeSummary();ami[_0x9174('0x47')](_0x9174('0x6f'),{});};VoiceQueueReport[_0x9174('0x42')][_0x9174('0x1f')]=function(_0x115f16){try{if(this['isNotNull'](_0x115f16)){logger[_0x9174('0x49')](_0x9174('0x70'),_0x115f16[_0x9174('0x4c')],util[_0x9174('0x3f')](_0x115f16,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x9174('0x10')][_0x115f16[_0x9174('0x4c')]])){this[_0x9174('0x10')][_0x115f16[_0x9174('0x4c')]]=[];}if(_[_0x9174('0x5c')](this[_0x9174('0x13')][_0x115f16[_0x9174('0x4c')]])){this[_0x9174('0x13')][_0x115f16[_0x9174('0x4c')]]={};}var _0x4df0c3=new QueueReport();_0x4df0c3['queue']=_0x115f16[_0x9174('0x4f')];_0x4df0c3[_0x9174('0x64')]=this[_0x9174('0x14')][_0x4df0c3[_0x9174('0x4f')]]&&this[_0x9174('0x14')][_0x4df0c3[_0x9174('0x4f')]]['type']?this['voiceQueues'][_0x4df0c3[_0x9174('0x4f')]][_0x9174('0x64')]||_0x9174('0x57'):_0x9174('0x57');_0x4df0c3['queuecallerjoinAt']=moment()[_0x9174('0x4d')](_0x9174('0x71'));_0x4df0c3['position']=_0x115f16[_0x9174('0x72')];_0x4df0c3['count']=_0x115f16[_0x9174('0x73')];_0x4df0c3[_0x9174('0x4c')]=_0x115f16[_0x9174('0x4c')];_0x4df0c3[_0x9174('0x74')]=this[_0x9174('0x13')][_0x115f16[_0x9174('0x4c')]][_0x9174('0x74')];logger['info']('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x4df0c3['queue'],_0x4df0c3[_0x9174('0x64')]);Object['assign'](_0x4df0c3,_[_0x9174('0x75')](_0x115f16,_[_0x9174('0x76')](_0x4df0c3)));this[_0x9174('0x10')][_0x115f16['uniqueid']][_0x9174('0x6a')](_0x4df0c3);this['channels'][_0x115f16['uniqueid']]=_0x4df0c3;this[_0x9174('0x48')](_0x4df0c3,_0x9174('0x1e'));}}catch(_0x7ae70a){logger[_0x9174('0x3d')](_0x9174('0x70'),_0x115f16[_0x9174('0x4c')],util[_0x9174('0x3f')](_0x7ae70a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9174('0x42')]['syncQueueCallerAbandon']=function(_0x57aa40){try{if(this['isNotNull'](_0x57aa40)){logger[_0x9174('0x49')](_0x9174('0x77'),_0x57aa40[_0x9174('0x4c')],util[_0x9174('0x3f')](_0x57aa40,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x57aa40[_0x9174('0x4c')]]){var _0x1936c2=_['last'](this[_0x9174('0x10')][_0x57aa40[_0x9174('0x4c')]]);_0x1936c2[_0x9174('0x37')]=![];_0x1936c2['queuecallercompleteAt']=null;_0x1936c2[_0x9174('0x78')]=_0x57aa40[_0x9174('0x78')];_0x1936c2[_0x9174('0x79')]=_0x57aa40['originalposition'];_0x1936c2[_0x9174('0x36')]=!![];_0x1936c2['queuecallerabandonAt']=moment()[_0x9174('0x4d')](_0x9174('0x71'));_0x1936c2[_0x9174('0x52')]=_0x9174('0x7a');_0x1936c2[_0x9174('0x7b')]=null;logger[_0x9174('0x7c')](_0x9174('0x7d'),_0x1936c2[_0x9174('0x4f')],_0x1936c2[_0x9174('0x64')]);this['channels'][_0x57aa40['uniqueid']]=_0x1936c2;this[_0x9174('0x46')](_0x1936c2,_0x9174('0x36'));}}}catch(_0x367ca6){logger['error'](_0x9174('0x77'),_0x57aa40['uniqueid'],util[_0x9174('0x3f')](_0x367ca6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9174('0x42')][_0x9174('0x21')]=function(_0x286ae6){try{if(this[_0x9174('0x5b')](_0x286ae6)){logger[_0x9174('0x49')](_0x9174('0x7e'),_0x286ae6[_0x9174('0x4c')],util['inspect'](_0x286ae6,{'showHidden':![],'depth':null}));if(this[_0x9174('0x10')][_0x286ae6[_0x9174('0x4c')]]){var _0x11100f=_[_0x9174('0x7f')](this[_0x9174('0x10')][_0x286ae6['uniqueid']]);_0x11100f['queuecallerleaveAt']=moment()[_0x9174('0x4d')](_0x9174('0x71'));_0x11100f[_0x9174('0x80')]=_0x286ae6[_0x9174('0x80')];_0x11100f['connectedlinename']=_0x286ae6[_0x9174('0x81')];logger[_0x9174('0x7c')](_0x9174('0x82'),_0x11100f[_0x9174('0x4f')],_0x11100f[_0x9174('0x64')],_0x286ae6[_0x9174('0x80')],_0x286ae6[_0x9174('0x81')]);this[_0x9174('0x13')][_0x286ae6['uniqueid']]=_0x11100f;this[_0x9174('0x48')](_0x11100f,'queuecallerleave');}}}catch(_0x319cea){logger['error'](_0x9174('0x7e'),_0x286ae6['uniqueid'],util['inspect'](_0x319cea,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9174('0x42')][_0x9174('0x25')]=function(_0x38866d){try{if(this['isNotNull'](_0x38866d)){logger[_0x9174('0x49')](_0x9174('0x83'),_0x38866d['uniqueid'],util['inspect'](_0x38866d,{'showHidden':![],'depth':null}));if(this[_0x9174('0x10')][_0x38866d[_0x9174('0x4c')]]){var _0x28b4d9=_[_0x9174('0x7f')](this[_0x9174('0x10')][_0x38866d[_0x9174('0x4c')]]);_0x28b4d9[_0x9174('0x37')]=!![];_0x28b4d9[_0x9174('0x52')]='COMPLETEDBYAGENT';logger[_0x9174('0x7c')](_0x9174('0x84'),_0x28b4d9[_0x9174('0x4f')],_0x28b4d9['type']);}}}catch(_0x53dec4){logger['error'](_0x9174('0x83'),_0x38866d[_0x9174('0x4c')],util[_0x9174('0x3f')](_0x53dec4,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9174('0x23')]=function(_0x443b54){try{if(this[_0x9174('0x5b')](_0x443b54)){logger['debug'](_0x9174('0x85'),_0x443b54[_0x9174('0x4c')],util['inspect'](_0x443b54,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x443b54[_0x9174('0x4c')]]){var _0x414962=_[_0x9174('0x7f')](this['queueReports'][_0x443b54[_0x9174('0x4c')]]);_0x414962[_0x9174('0x36')]=![];_0x414962[_0x9174('0x86')]=null;_0x414962[_0x9174('0x87')]=!![];_0x414962[_0x9174('0x7b')]=_0x443b54[_0x9174('0x88')];_0x414962['holdtime']=_0x443b54['holdtime'];_0x414962[_0x9174('0x37')]=!![];_0x414962[_0x9174('0x35')]=![];_0x414962[_0x9174('0x89')]=null;if(!_0x414962[_0x9174('0x8a')]){if(_0x443b54[_0x9174('0x8b')]==_0x9174('0x8a')){_0x414962[_0x9174('0x52')]='COMPLETED';logger[_0x9174('0x7c')](_0x9174('0x8c'),_0x414962[_0x9174('0x4f')],_0x414962[_0x9174('0x64')]);}else{if(_[_0x9174('0x8d')](_0x443b54['channel'][_0x9174('0x8e')](),'local/')){if(this['queueReports'][_0x443b54['linkedid']]){var _0x200b2c=_[_0x9174('0x7f')](this['queueReports'][_0x443b54[_0x9174('0x8f')]]);_0x200b2c[_0x9174('0x37')]=![];_0x200b2c[_0x9174('0x35')]=!![];_0x200b2c['queuecallerexitAt']=moment(_0x414962['queuecallerjoinAt'])['add'](_0x443b54[_0x9174('0x78')],_0x9174('0x90'))[_0x9174('0x4d')](_0x9174('0x71'));_0x200b2c[_0x9174('0x52')]=_0x9174('0x91');_0x200b2c[_0x9174('0x8a')]=!![];_0x200b2c[_0x9174('0x92')]=_0x9174('0x93');_0x200b2c[_0x9174('0x94')]=_0x443b54[_0x9174('0x95')];_0x200b2c['transferuniqueid']=_0x443b54['uniqueid'];logger[_0x9174('0x7c')](_0x9174('0x96'),_0x200b2c['queue'],_0x200b2c[_0x9174('0x64')]);var _0x1f72b5=this['queueReports'][_0x443b54[_0x9174('0x8f')]];this['queueReports'][_0x443b54[_0x9174('0x8f')]]=this[_0x9174('0x10')][_0x443b54[_0x9174('0x4c')]];this[_0x9174('0x10')][_0x443b54[_0x9174('0x4c')]]=_0x1f72b5;}}else{_0x414962[_0x9174('0x52')]=_0x9174('0x97')+_0x443b54['reason'][_0x9174('0x98')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x414962['queue'],_0x414962[_0x9174('0x64')],_0x414962['queuecallerexitreason']);}}}this[_0x9174('0x13')][_0x443b54['uniqueid']]=_0x414962;}}}catch(_0x408786){logger['error'](_0x9174('0x85'),_0x443b54[_0x9174('0x4c')],util[_0x9174('0x3f')](_0x408786,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9174('0x42')][_0x9174('0x99')]=function(_0x18d47a){try{if(this[_0x9174('0x5b')](_0x18d47a)){logger[_0x9174('0x49')](_0x9174('0x9a'),_0x18d47a[_0x9174('0x4c')],util[_0x9174('0x3f')](_0x18d47a,{'showHidden':![],'depth':null}));this[_0x9174('0x9b')](_0x18d47a[_0x9174('0x4c')],_[_0x9174('0x76')](_0x18d47a[_0x9174('0x9c')])[0x0],_0x18d47a[_0x9174('0x9d')]);if(this['queueReports'][_0x18d47a[_0x9174('0x4c')]]){var _0xa849b6=_[_0x9174('0x7f')](this[_0x9174('0x10')][_0x18d47a['uniqueid']]);if(_0xa849b6){if(this[_0x9174('0x5b')](_0x18d47a[_0x9174('0x9c')])&&this[_0x9174('0x5b')](_0x18d47a[_0x9174('0x9c')]['queuestatus'])){switch(_0x18d47a['value']){case _0x9174('0x9e'):_0xa849b6[_0x9174('0x35')]=![];_0xa849b6['queuecallerexitAt']=null;break;case'TIMEOUT':_0xa849b6[_0x9174('0x9f')]=_0x9174('0xa0');_0xa849b6[_0x9174('0x35')]=!![];_0xa849b6[_0x9174('0x89')]=moment()['format'](_0x9174('0x71'));_0xa849b6[_0x9174('0xa1')]=moment()['format'](_0x9174('0x71'));logger[_0x9174('0x49')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x18d47a[_0x9174('0x4c')],util[_0x9174('0x3f')](_0xa849b6,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0xa849b6);break;default:_0xa849b6[_0x9174('0x35')]=!![];_0xa849b6[_0x9174('0x89')]=moment()[_0x9174('0x4d')](_0x9174('0x71'));_0xa849b6[_0x9174('0xa1')]=moment()[_0x9174('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');}_0xa849b6[_0x9174('0x36')]=![];_0xa849b6[_0x9174('0x86')]=null;_0xa849b6[_0x9174('0x52')]=_0x18d47a['value'];this['channels'][_0x18d47a[_0x9174('0x4c')]]=_0xa849b6;this[_0x9174('0x46')](_0xa849b6,'varset');}else if(this[_0x9174('0x5b')](_0x18d47a[_0x9174('0x9c')])&&this[_0x9174('0x5b')](_0x18d47a['variable']['queueposition'])){if(!_0xa849b6[_0x9174('0x36')]){_0xa849b6[_0x9174('0x35')]=!![];_0xa849b6['queuecallerexitAt']=moment()[_0x9174('0x4d')](_0x9174('0x71'));_0xa849b6[_0x9174('0x52')]='EXITWITHKEY';_0xa849b6[_0x9174('0xa1')]=moment()[_0x9174('0x4d')](_0x9174('0x71'));this[_0x9174('0x13')][_0x18d47a[_0x9174('0x4c')]]=_0xa849b6;}}logger[_0x9174('0x7c')](_0x9174('0xa2'),_0x18d47a[_0x9174('0x4c')],_0xa849b6[_0x9174('0x4f')],_0xa849b6[_0x9174('0x64')],_[_0x9174('0x76')](_0x18d47a['variable'])[0x0],_0x18d47a[_0x9174('0x9d')]);_0xa849b6['variables']=this[_0x9174('0x41')][_0x18d47a['uniqueid']];}}}}catch(_0x56ca64){logger[_0x9174('0x3d')]('[%s][voiceQueueReport][varset]',_0x18d47a[_0x9174('0x4c')],util[_0x9174('0x3f')](_0x56ca64,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['addVariable']=function(_0x75be9d,_0x16418b,_0x4a4cfb){var _0x4492b3=[_0x9174('0xa3'),'rtpaudioqosbridged',_0x9174('0xa4'),_0x9174('0xa5'),_0x9174('0xa6'),_0x9174('0xa7'),_0x9174('0xa8'),_0x9174('0xa9'),_0x9174('0xaa'),_0x9174('0xab'),_0x9174('0xac'),_0x9174('0xad'),_0x9174('0xae'),_0x9174('0xaf'),_0x9174('0xb0'),_0x9174('0xb1'),_0x9174('0x88'),_0x9174('0xb2'),_0x9174('0xb3')];if(!_[_0x9174('0xb4')](_0x16418b)&&!_[_0x9174('0xb5')](_0x4492b3,_0x16418b)){if(_[_0x9174('0x5c')](this[_0x9174('0x41')][_0x75be9d])){this['variables'][_0x75be9d]={};}this[_0x9174('0x41')][_0x75be9d][_0x16418b]=_0x4a4cfb;}};VoiceQueueReport[_0x9174('0x42')][_0x9174('0xb6')]=function(_0x4f9d4c,_0x4ac79e,_0x1574cb){var _0x3ed3be={};for(var _0x11de19=0x0;_0x11de19=0x0?moment(_0x51d1df[_0x297b('0x18')])[_0x297b('0xc')](_0x51d1df['starttime'],_0x297b('0xe')):null,'data1':_0x297b('0x19'),'data2':_0x51d1df[_0x297b('0x13')],'data3':_0x51d1df[_0x297b('0x10')],'data4':_0x51d1df[_0x297b('0x1a')]||null,'role':_0x297b('0x1b'),'internal':_0x51d1df[_0x297b('0x13')]?_[_0x297b('0x12')](_0x51d1df[_0x297b('0x13')]):undefined,'uniqueid':_0x51d1df[_0x297b('0x1c')]},'log':_0x297b('0x5')});}; \ No newline at end of file +var _0x3af1=['voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','lastAssignedTo','isNil','interface','format','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','queue','agent','toNumber','accountcode','voice','membername','endtime','starttime','dialstring','uniqueid','lodash','util','../client'];(function(_0x258b61,_0x59dd7e){var _0x41f3b6=function(_0x4af646){while(--_0x4af646){_0x258b61['push'](_0x258b61['shift']());}};_0x41f3b6(++_0x59dd7e);}(_0x3af1,0x169));var _0x13af=function(_0x9678ed,_0xefa5db){_0x9678ed=_0x9678ed-0x0;var _0x4e589c=_0x3af1[_0x9678ed];return _0x4e589c;};'use strict';var moment=require('moment');var _=require(_0x13af('0x0'));var util=require(_0x13af('0x1'));var client=require(_0x13af('0x2'));exports[_0x13af('0x3')]=function(_0x1fba23){var _0x2b7f01=_0x1fba23[_0x13af('0x4')]||_0x1fba23[_0x13af('0x5')];return client[_0x13af('0x6')](_0x13af('0x7'),{'body':{'channel':'voice','membername':_0x1fba23[_0x13af('0x8')],'interface':_[_0x13af('0x9')](_0x1fba23[_0x13af('0xa')])?util[_0x13af('0xb')]('SIP/%s',_0x1fba23['lastAssignedTo']):_0x1fba23[_0x13af('0xa')],'type':'TALKING','enterAt':_0x1fba23[_0x13af('0xc')],'exitAt':_0x2b7f01,'duration':moment(_0x2b7f01)[_0x13af('0xd')](_0x1fba23['queuecallerleaveAt'],_0x13af('0xe')),'data1':_0x13af('0xf'),'data2':_0x1fba23[_0x13af('0x10')],'data3':_0x1fba23[_0x13af('0x11')],'data4':null,'data5':_0x1fba23[_0x13af('0x12')],'role':_0x13af('0x13'),'internal':_0x1fba23['accountcode']?_[_0x13af('0x14')](_0x1fba23[_0x13af('0x15')]):undefined,'uniqueid':_0x1fba23['uniqueid']},'log':'CreateMemberReport'});};exports['voiceDialReport']=function(_0x172416){return client[_0x13af('0x6')]('CreateMemberReport',{'body':{'channel':_0x13af('0x16'),'membername':_0x172416[_0x13af('0x17')],'interface':_0x172416[_0x13af('0xa')],'type':'TALKING','enterAt':_0x172416['starttime'],'exitAt':_0x172416['endtime'],'duration':moment(_0x172416[_0x13af('0x18')])[_0x13af('0xd')](_0x172416[_0x13af('0x19')],_0x13af('0xe'))>=0x0?moment(_0x172416[_0x13af('0x18')])[_0x13af('0xd')](_0x172416[_0x13af('0x19')],_0x13af('0xe')):null,'data1':'outbound','data2':_0x172416['accountcode'],'data3':_0x172416['exten'],'data4':_0x172416[_0x13af('0x1a')]||null,'role':_0x13af('0x13'),'internal':_0x172416[_0x13af('0x15')]?_[_0x13af('0x14')](_0x172416[_0x13af('0x15')]):undefined,'uniqueid':_0x172416[_0x13af('0x1b')]},'log':_0x13af('0x7')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 39d9e20..1ac8138 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 _0x0457=['previewRecallmeReminderInterval','GetSettings','getSettings','Request','stopRecordingOnTransfer'];(function(_0x40d8d7,_0x30dd5e){var _0x3454cc=function(_0x512c1b){while(--_0x512c1b){_0x40d8d7['push'](_0x40d8d7['shift']());}};_0x3454cc(++_0x30dd5e);}(_0x0457,0x11f));var _0x7045=function(_0xf9016f,_0x1fca5e){_0xf9016f=_0xf9016f-0x0;var _0x5e3ce2=_0x0457[_0xf9016f];return _0x5e3ce2;};'use strict';var client=require('../client');exports[_0x7045('0x0')]=function(){return client[_0x7045('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7045('0x2'),_0x7045('0x3')]},'log':_0x7045('0x4')});}; \ No newline at end of file +var _0x065e=['stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client'];(function(_0x34f72d,_0x5f376c){var _0x4289d8=function(_0x25b5dc){while(--_0x25b5dc){_0x34f72d['push'](_0x34f72d['shift']());}};_0x4289d8(++_0x5f376c);}(_0x065e,0x1a7));var _0xe065=function(_0x4bf615,_0xc5f51e){_0x4bf615=_0x4bf615-0x0;var _0x5744e7=_0x065e[_0x4bf615];return _0x5744e7;};'use strict';var client=require(_0xe065('0x0'));exports['getSettings']=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xe065('0x1'),_0xe065('0x2')]},'log':_0xe065('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index de1d549..a481b0c 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 _0x45e2=['html','getTemplates','Request','GetTemplate','name'];(function(_0x50b79e,_0x542c39){var _0x280164=function(_0x151c2c){while(--_0x151c2c){_0x50b79e['push'](_0x50b79e['shift']());}};_0x280164(++_0x542c39);}(_0x45e2,0x1a0));var _0x245e=function(_0x56b6a0,_0x3d7c28){_0x56b6a0=_0x56b6a0-0x0;var _0xf7904=_0x45e2[_0x56b6a0];return _0xf7904;};'use strict';var client=require('../client');exports[_0x245e('0x0')]=function(_0x183855){return function(_0x57a7de){return client[_0x245e('0x1')](_0x245e('0x2'),{'options':{'raw':!![],'attributes':['id',_0x245e('0x3'),_0x245e('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0xd5ee=['Request','name','GetTemplate','../client'];(function(_0x1aa4c4,_0xc969a4){var _0x50da18=function(_0x15d53e){while(--_0x15d53e){_0x1aa4c4['push'](_0x1aa4c4['shift']());}};_0x50da18(++_0xc969a4);}(_0xd5ee,0x93));var _0xed5e=function(_0x195223,_0x121404){_0x195223=_0x195223-0x0;var _0x3a62dd=_0xd5ee[_0x195223];return _0x3a62dd;};'use strict';var client=require(_0xed5e('0x0'));exports['getTemplates']=function(_0x276b8a){return function(_0x1cd899){return client[_0xed5e('0x1')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xed5e('0x2'),'html']},'log':_0xed5e('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 557a8f0..d640976 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 _0x20c9=['data6','../client','Request','GetTrigger','name','channel','status','Condition','AllConditions','field','operator','value','Action','Actions','action','data1','data2','data3','data4'];(function(_0x54ec51,_0xae0e32){var _0x40b630=function(_0x37c299){while(--_0x37c299){_0x54ec51['push'](_0x54ec51['shift']());}};_0x40b630(++_0xae0e32);}(_0x20c9,0x16a));var _0x920c=function(_0x2f3ecd,_0x57976b){_0x2f3ecd=_0x2f3ecd-0x0;var _0xffdc44=_0x20c9[_0x2f3ecd];return _0xffdc44;};'use strict';var client=require(_0x920c('0x0'));exports['getTriggers']=function(_0x5e1690){return function(_0x5a120d){return client[_0x920c('0x1')](_0x920c('0x2'),{'options':{'raw':![],'attributes':['id',_0x920c('0x3'),_0x920c('0x4'),_0x920c('0x5')],'include':[{'model':_0x920c('0x6'),'as':_0x920c('0x7'),'attributes':['id',_0x920c('0x8'),_0x920c('0x9'),_0x920c('0xa')]},{'model':_0x920c('0x6'),'as':'AnyConditions','attributes':['id',_0x920c('0x8'),'operator',_0x920c('0xa')]},{'model':_0x920c('0xb'),'as':_0x920c('0xc'),'attributes':['id',_0x920c('0xd'),_0x920c('0xe'),_0x920c('0xf'),_0x920c('0x10'),_0x920c('0x11'),'data5',_0x920c('0x12'),'data7']}]},'log':_0x920c('0x2')});};}; \ No newline at end of file +var _0x65ec=['data6','data7','getTriggers','Request','GetTrigger','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','action','data1','data2','data4','data5'];(function(_0x5cbd7b,_0x207439){var _0x3fdfb8=function(_0x4eb12e){while(--_0x4eb12e){_0x5cbd7b['push'](_0x5cbd7b['shift']());}};_0x3fdfb8(++_0x207439);}(_0x65ec,0x11f));var _0xc65e=function(_0x759283,_0x34e291){_0x759283=_0x759283-0x0;var _0x924af9=_0x65ec[_0x759283];return _0x924af9;};'use strict';var client=require('../client');exports[_0xc65e('0x0')]=function(_0x3c6f61){return function(_0x1a631f){return client[_0xc65e('0x1')](_0xc65e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xc65e('0x3'),_0xc65e('0x4')],'include':[{'model':_0xc65e('0x5'),'as':_0xc65e('0x6'),'attributes':['id',_0xc65e('0x7'),_0xc65e('0x8'),_0xc65e('0x9')]},{'model':_0xc65e('0x5'),'as':_0xc65e('0xa'),'attributes':['id',_0xc65e('0x7'),'operator','value']},{'model':_0xc65e('0xb'),'as':'Actions','attributes':['id',_0xc65e('0xc'),_0xc65e('0xd'),_0xc65e('0xe'),'data3',_0xc65e('0xf'),_0xc65e('0x10'),_0xc65e('0x11'),_0xc65e('0x12')]}]},'log':_0xc65e('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index bea4ad5..d2a6426 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 _0xd331=['registry','defaultuser','GetTrunk','../client','Request','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd331,0xed));var _0x1d33=function(_0x331ce8,_0x57ec88){_0x331ce8=_0x331ce8-0x0;var _0x380183=_0xd331[_0x331ce8];return _0x380183;};'use strict';var client=require(_0x1d33('0x0'));exports['getTrunks']=function(_0x5dd8fe){return function(_0x3f5747){return client[_0x1d33('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x1d33('0x2'),_0x1d33('0x3'),_0x1d33('0x4')]},'log':_0x1d33('0x5')});};}; \ No newline at end of file +var _0xb332=['registry','../client','GetTrunk'];(function(_0x543215,_0x19bc06){var _0x4157bd=function(_0x5bda8a){while(--_0x5bda8a){_0x543215['push'](_0x543215['shift']());}};_0x4157bd(++_0x19bc06);}(_0xb332,0xd9));var _0x2b33=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xb332[_0x43d11d];return _0x38cd08;};'use strict';var client=require(_0x2b33('0x0'));exports['getTrunks']=function(_0x196261){return function(_0x199daa){return client['Request'](_0x2b33('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x2b33('0x2'),'defaultuser']},'log':_0x2b33('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 43e7d06..eb9bd9e 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x385924,_0x1c1f93){var _0x105937=function(_0x13fa6c){while(--_0x13fa6c){_0x385924['push'](_0x385924['shift']());}};_0x105937(++_0x1c1f93);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file +var _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x1222b3,_0x3bbd73){var _0x51a4f0=function(_0x3f6879){while(--_0x3f6879){_0x1222b3['push'](_0x1222b3['shift']());}};_0x51a4f0(++_0x3bbd73);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x53b8e0,_0x55d46e){_0x53b8e0=_0x53b8e0-0x0;var _0x10630c=_0xcb91[_0x53b8e0];return _0x10630c;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 68d457f..3e2f2f8 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 _0xd584=['../client','create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x5f41ba,_0x3c32a0){var _0x4e4aa8=function(_0x2c9fed){while(--_0x2c9fed){_0x5f41ba['push'](_0x5f41ba['shift']());}};_0x4e4aa8(++_0x3c32a0);}(_0xd584,0x114));var _0x4d58=function(_0xe0e5aa,_0x161729){_0xe0e5aa=_0xe0e5aa-0x0;var _0x467e16=_0xd584[_0xe0e5aa];return _0x467e16;};'use strict';var client=require(_0x4d58('0x0'));exports[_0x4d58('0x1')]=function(_0xe781fc){return client[_0x4d58('0x2')]('CreateVoiceAgentReport',{'body':_0xe781fc,'log':_0x4d58('0x3')});};exports[_0x4d58('0x4')]=function(_0x56fcbf,_0xdcb005,_0x1c7238){return client[_0x4d58('0x2')](_0x4d58('0x5'),{'body':_0x56fcbf,'options':{'where':{'uniqueid':_0xdcb005,'interface':_0x1c7238,'agentcomplete':!![]}},'log':_0x4d58('0x5')});}; \ No newline at end of file +var _0xd1d7=['create','CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport','../client'];(function(_0x4a4248,_0x30660d){var _0x1a76ed=function(_0xbaf3c1){while(--_0xbaf3c1){_0x4a4248['push'](_0x4a4248['shift']());}};_0x1a76ed(++_0x30660d);}(_0xd1d7,0x17f));var _0x7d1d=function(_0x4bf77c,_0x53999d){_0x4bf77c=_0x4bf77c-0x0;var _0x5d73c5=_0xd1d7[_0x4bf77c];return _0x5d73c5;};'use strict';var client=require(_0x7d1d('0x0'));exports[_0x7d1d('0x1')]=function(_0x804408){return client['Request'](_0x7d1d('0x2'),{'body':_0x804408,'log':_0x7d1d('0x2')});};exports[_0x7d1d('0x3')]=function(_0x347a39,_0x4389b0,_0x28cb11){return client[_0x7d1d('0x4')](_0x7d1d('0x5'),{'body':_0x347a39,'options':{'where':{'uniqueid':_0x4389b0,'interface':_0x28cb11,'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 2cf76b2..90cb258 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 _0x4772=['getVoiceCallReports','GetVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','duration','billableseconds','moment','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION'];(function(_0x122992,_0x1198fa){var _0x2102e7=function(_0x23d206){while(--_0x23d206){_0x122992['push'](_0x122992['shift']());}};_0x2102e7(++_0x1198fa);}(_0x4772,0x128));var _0x2477=function(_0x16a601,_0x471465){_0x16a601=_0x16a601-0x0;var _0x3a67ab=_0x4772[_0x16a601];return _0x3a67ab;};'use strict';var moment=require(_0x2477('0x0'));var util=require('util');var _=require(_0x2477('0x1'));var client=require(_0x2477('0x2'));exports[_0x2477('0x3')]=function(_0x36748b){return client[_0x2477('0x4')](_0x2477('0x5'),{'body':_[_0x2477('0x6')](_0x36748b,{'source':_0x36748b[_0x2477('0x7')],'destinationcontext':_0x36748b['context'],'callerid':_0x36748b[_0x2477('0x8')],'amaflags':_0x2477('0x9')}),'log':'CreateVoiceCallReport'});};exports[_0x2477('0xa')]=function(){return function(){return client['Request'](_0x2477('0xb'),{'options':{'where':{'type':[_0x2477('0xc')],'createdAt':{'$between':[moment()['startOf'](_0x2477('0xd'))[_0x2477('0xe')](_0x2477('0xf')),moment()['endOf']('day')['format'](_0x2477('0xf'))]}},'attributes':['type','disposition',_0x2477('0x10'),_0x2477('0x11')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0xd5b9=['moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','outbound','startOf','day','endOf','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports'];(function(_0x4df66b,_0x4413b0){var _0x106d14=function(_0xff2207){while(--_0xff2207){_0x4df66b['push'](_0x4df66b['shift']());}};_0x106d14(++_0x4413b0);}(_0xd5b9,0x1e0));var _0x9d5b=function(_0x43772d,_0x2dbbd5){_0x43772d=_0x43772d-0x0;var _0x81657c=_0xd5b9[_0x43772d];return _0x81657c;};'use strict';var moment=require(_0x9d5b('0x0'));var util=require(_0x9d5b('0x1'));var _=require(_0x9d5b('0x2'));var client=require(_0x9d5b('0x3'));exports[_0x9d5b('0x4')]=function(_0x3252ce){return client[_0x9d5b('0x5')](_0x9d5b('0x6'),{'body':_[_0x9d5b('0x7')](_0x3252ce,{'source':_0x3252ce[_0x9d5b('0x8')],'destinationcontext':_0x3252ce[_0x9d5b('0x9')],'callerid':_0x3252ce[_0x9d5b('0xa')],'amaflags':_0x9d5b('0xb')}),'log':_0x9d5b('0x6')});};exports[_0x9d5b('0xc')]=function(){return function(){return client[_0x9d5b('0x5')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x9d5b('0xd')],'createdAt':{'$between':[moment()[_0x9d5b('0xe')](_0x9d5b('0xf'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x9d5b('0x10')](_0x9d5b('0xf'))[_0x9d5b('0x11')](_0x9d5b('0x12'))]}},'attributes':[_0x9d5b('0x13'),_0x9d5b('0x14'),_0x9d5b('0x15'),_0x9d5b('0x16')]},'log':_0x9d5b('0x17')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 3635f21..490f998 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 _0x2a7a=['Request','CreateVoiceDialReport','../client','create'];(function(_0x30f59e,_0x2ff9a1){var _0xa43aff=function(_0x3baef1){while(--_0x3baef1){_0x30f59e['push'](_0x30f59e['shift']());}};_0xa43aff(++_0x2ff9a1);}(_0x2a7a,0x96));var _0xa2a7=function(_0x5349c7,_0x3ac4b6){_0x5349c7=_0x5349c7-0x0;var _0x2d80f1=_0x2a7a[_0x5349c7];return _0x2d80f1;};'use strict';var client=require(_0xa2a7('0x0'));exports[_0xa2a7('0x1')]=function(_0xe3fc1d){return client[_0xa2a7('0x2')]('CreateVoiceDialReport',{'body':_0xe3fc1d,'log':_0xa2a7('0x3')});}; \ No newline at end of file +var _0xfb1b=['../client','CreateVoiceDialReport'];(function(_0x3e18fc,_0x3ae02f){var _0x2c0d28=function(_0x3aa3bf){while(--_0x3aa3bf){_0x3e18fc['push'](_0x3e18fc['shift']());}};_0x2c0d28(++_0x3ae02f);}(_0xfb1b,0xda));var _0xbfb1=function(_0x2503b3,_0x2c22a5){_0x2503b3=_0x2503b3-0x0;var _0x3cfe68=_0xfb1b[_0x2503b3];return _0x3cfe68;};'use strict';var client=require(_0xbfb1('0x0'));exports['create']=function(_0x8be556){return client['Request'](_0xbfb1('0x1'),{'body':_0x8be556,'log':_0xbfb1('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index bd73b94..ed0dc3a 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 _0xf257=['exten','recordingFormat','Request','GetVoiceExtension'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0xf257,0x82));var _0x7f25=function(_0x4d9bb4,_0x5d7a1b){_0x4d9bb4=_0x4d9bb4-0x0;var _0x34deea=_0xf257[_0x4d9bb4];return _0x34deea;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0x7f25('0x0')](_0x7f25('0x1'),{'options':{'raw':!![],'attributes':['id',_0x7f25('0x2'),_0x7f25('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xbc9d=['../client','getVoiceExtensions','Request','GetVoiceExtension','exten'];(function(_0x56a616,_0x5a3c7c){var _0xe94844=function(_0x1d3816){while(--_0x1d3816){_0x56a616['push'](_0x56a616['shift']());}};_0xe94844(++_0x5a3c7c);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x48dbe0,_0x382761){_0x48dbe0=_0x48dbe0-0x0;var _0x412c2c=_0xbc9d[_0x48dbe0];return _0x412c2c;};'use strict';var client=require(_0xdbc9('0x0'));exports[_0xdbc9('0x1')]=function(){return function(){return client[_0xdbc9('0x2')](_0xdbc9('0x3'),{'options':{'raw':!![],'attributes':['id',_0xdbc9('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 69124ac..f5efcc8 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 _0x3081=['dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','name','callerid','mandatoryDispositionPause','TrunkBackup','Interval','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitQueue','dialPredictiveOptimization','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x3081,0x1d6));var _0x1308=function(_0x2fd8fe,_0x1290e8){_0x2fd8fe=_0x2fd8fe-0x0;var _0x48aa6a=_0x3081[_0x2fd8fe];return _0x48aa6a;};'use strict';var client=require(_0x1308('0x0'));exports[_0x1308('0x1')]=function(){return function(){return client[_0x1308('0x2')](_0x1308('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x1308('0x4'),_0x1308('0x5'),_0x1308('0x6'),_0x1308('0x7'),_0x1308('0x8'),'dialActive',_0x1308('0x9'),'dialLimitChannel',_0x1308('0xa'),'dialPowerLevel',_0x1308('0xb'),'dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0x1308('0xc'),_0x1308('0xd'),_0x1308('0xe'),_0x1308('0xf'),_0x1308('0x10'),_0x1308('0x11'),_0x1308('0x12'),_0x1308('0x13'),'dialNoAnswerMaxRetry',_0x1308('0x14'),_0x1308('0x15'),'dialTimezone','dialGlobalInterval','dialPrefix',_0x1308('0x16'),_0x1308('0x17'),'dialAMDInitialSilence',_0x1308('0x18'),_0x1308('0x19'),'dialAMDTotalAnalysisTime',_0x1308('0x1a'),_0x1308('0x1b'),_0x1308('0x1c'),_0x1308('0x1d'),'dialAMDMaximumWordLength',_0x1308('0x1e'),'dialRecallMeTimeout',_0x1308('0x1f'),_0x1308('0x20'),'dialAgiAfterHangupAgent',_0x1308('0x21'),_0x1308('0x22'),_0x1308('0x7'),'strategy',_0x1308('0x23'),_0x1308('0x24'),'dialNoSuchNumberMaxRetry',_0x1308('0x25'),_0x1308('0x26'),_0x1308('0x27'),_0x1308('0x28'),_0x1308('0x29'),_0x1308('0x2a'),_0x1308('0x2b'),_0x1308('0x2c'),_0x1308('0x2d'),_0x1308('0x2e'),_0x1308('0x2f'),'dialPredictiveIntervalMinThreshold',_0x1308('0x30'),_0x1308('0x31')],'include':[{'model':'Trunk','as':_0x1308('0x32'),'attributes':['id',_0x1308('0x33'),_0x1308('0x34'),'active']},{'model':'Pause','as':_0x1308('0x35'),'attributes':['id',_0x1308('0x33')]},{'model':'Trunk','as':_0x1308('0x36'),'attributes':['id',_0x1308('0x33'),_0x1308('0x34'),'active']},{'model':_0x1308('0x37'),'as':_0x1308('0x37'),'attributes':['id',_0x1308('0x33')],'include':[{'model':_0x1308('0x37'),'as':'Intervals','attributes':['id',_0x1308('0x33'),_0x1308('0x38')]}]}]},'log':_0x1308('0x1')});};}; \ No newline at end of file +var _0x10d1=['type','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','name','active','Pause','TrunkBackup','callerid','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format'];(function(_0x4c1df8,_0x36b758){var _0x3deb52=function(_0x2350d0){while(--_0x2350d0){_0x4c1df8['push'](_0x4c1df8['shift']());}};_0x3deb52(++_0x36b758);}(_0x10d1,0xec));var _0x110d=function(_0x717974,_0x24b354){_0x717974=_0x717974-0x0;var _0x4b38fa=_0x10d1[_0x717974];return _0x4b38fa;};'use strict';var client=require(_0x110d('0x0'));exports[_0x110d('0x1')]=function(){return function(){return client[_0x110d('0x2')](_0x110d('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x110d('0x4'),_0x110d('0x5'),_0x110d('0x6'),_0x110d('0x7'),_0x110d('0x8'),'dialActive','dialMethod',_0x110d('0x9'),_0x110d('0xa'),_0x110d('0xb'),'dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval',_0x110d('0xc'),'dialOriginateCallerIdNumber',_0x110d('0xd'),_0x110d('0xe'),_0x110d('0xf'),'dialQueueProject',_0x110d('0x10'),_0x110d('0x11'),'dialBusyMaxRetry',_0x110d('0x12'),_0x110d('0x13'),_0x110d('0x14'),_0x110d('0x15'),_0x110d('0x16'),_0x110d('0x17'),_0x110d('0x18'),'dialCheckDuplicateType',_0x110d('0x19'),_0x110d('0x1a'),_0x110d('0x1b'),_0x110d('0x1c'),_0x110d('0x1d'),_0x110d('0x1e'),_0x110d('0x1f'),_0x110d('0x20'),'dialAMDSilenceThreshold',_0x110d('0x21'),'timeout',_0x110d('0x22'),_0x110d('0x23'),_0x110d('0x24'),_0x110d('0x25'),'dialAgiAfterHangupClient','dialQueueProject2','monitor_format',_0x110d('0x26'),_0x110d('0x27'),_0x110d('0x28'),_0x110d('0x29'),_0x110d('0x2a'),'dialDropMaxRetry',_0x110d('0x2b'),_0x110d('0x2c'),_0x110d('0x2d'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0x110d('0x2e'),_0x110d('0x2f'),_0x110d('0x30'),'dialPredictiveIntervalMaxThreshold',_0x110d('0x31'),_0x110d('0x32'),_0x110d('0x33')],'include':[{'model':_0x110d('0x34'),'as':_0x110d('0x34'),'attributes':['id',_0x110d('0x35'),'callerid',_0x110d('0x36')]},{'model':_0x110d('0x37'),'as':'mandatoryDispositionPause','attributes':['id',_0x110d('0x35')]},{'model':_0x110d('0x34'),'as':_0x110d('0x38'),'attributes':['id',_0x110d('0x35'),_0x110d('0x39'),'active']},{'model':'Interval','as':_0x110d('0x3a'),'attributes':['id',_0x110d('0x35')],'include':[{'model':_0x110d('0x3a'),'as':_0x110d('0x3b'),'attributes':['id','name',_0x110d('0x3c')]}]}]},'log':_0x110d('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index cbf03b1..2031290 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(_0x15b83d,_0x2e1aa8){var _0x2fac0d=function(_0x47d886){while(--_0x47d886){_0x15b83d['push'](_0x15b83d['shift']());}};_0x2fac0d(++_0x2e1aa8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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(_0x527ba6,_0x436856){var _0x4fc507=function(_0x4d91f4){while(--_0x4d91f4){_0x527ba6['push'](_0x527ba6['shift']());}};_0x4fc507(++_0x436856);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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 de42fbc..1139808 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 _0xcbd9=['getVoiceQueueRtPauses','../client','Request'];(function(_0x147a32,_0x4f79cd){var _0xaa0775=function(_0x2f3a86){while(--_0x2f3a86){_0x147a32['push'](_0x147a32['shift']());}};_0xaa0775(++_0x4f79cd);}(_0xcbd9,0x1d2));var _0x9cbd=function(_0x186124,_0x2c86a8){_0x186124=_0x186124-0x0;var _0x56c7b9=_0xcbd9[_0x186124];return _0x56c7b9;};'use strict';var client=require(_0x9cbd('0x0'));exports['getVoiceQueueRtPauses']=function(_0xd91d06){return function(){return client[_0x9cbd('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0xd91d06,'paused':!![]},'raw':!![]},'log':_0x9cbd('0x2')});};}; \ No newline at end of file +var _0x1f70=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x1f70,0x1a3));var _0x01f7=function(_0x1ebc0f,_0x12171a){_0x1ebc0f=_0x1ebc0f-0x0;var _0x5d9cbd=_0x1f70[_0x1ebc0f];return _0x5d9cbd;};'use strict';var client=require('../client');exports[_0x01f7('0x0')]=function(_0x988cbb){return function(){return client[_0x01f7('0x1')](_0x01f7('0x2'),{'options':{'where':{'VoiceQueueId':_0x988cbb,'paused':!![]},'raw':!![]},'log':_0x01f7('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 08965f4..50b7f6b 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(_0x20c8e0,_0x174289){var _0x323476=function(_0x106c7c){while(--_0x106c7c){_0x20c8e0['push'](_0x20c8e0['shift']());}};_0x323476(++_0x174289);}(_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 +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x413eb2,_0x6d4001){var _0x2cd538=function(_0x12c8d0){while(--_0x12c8d0){_0x413eb2['push'](_0x413eb2['shift']());}};_0x2cd538(++_0x6d4001);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 e2e97bd..90d75ed 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 _0xbcaa=['transfererexten','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','attended','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercontext'];(function(_0x19a49f,_0x444d74){var _0x5351ae=function(_0x58b1ed){while(--_0x58b1ed){_0x19a49f['push'](_0x19a49f['shift']());}};_0x5351ae(++_0x444d74);}(_0xbcaa,0xdc));var _0xabca=function(_0x27f809,_0x213851){_0x27f809=_0x27f809-0x0;var _0x12cf64=_0xbcaa[_0x27f809];return _0x12cf64;};'use strict';var client=require('../client');exports[_0xabca('0x0')]={};exports[_0xabca('0x1')]=function(_0x247c2c){return client[_0xabca('0x2')](_0xabca('0x3'),{'body':{'result':_0x247c2c[_0xabca('0x4')],'transfererchannel':_0x247c2c[_0xabca('0x5')],'transferercalleridnum':_0x247c2c[_0xabca('0x6')],'transferercalleridname':_0x247c2c['transferercalleridname'],'transfererconnectedlinenum':_0x247c2c['transfererconnectedlinenum'],'transfererconnectedlinename':_0x247c2c['transfererconnectedlinename'],'transfereraccountcode':_0x247c2c['transfereraccountcode'],'transferercontext':_0x247c2c[_0xabca('0x7')],'transfererexten':_0x247c2c[_0xabca('0x8')],'transfererlinkedid':_0x247c2c[_0xabca('0x9')],'transfereechannel':_0x247c2c['transfereechannel'],'transfereecalleridnum':_0x247c2c[_0xabca('0xa')],'transfereecalleridname':_0x247c2c[_0xabca('0xb')],'transfereeconnectedlinenum':_0x247c2c[_0xabca('0xc')],'transfereeconnectedlinename':_0x247c2c[_0xabca('0xd')],'transfereeaccountcode':_0x247c2c[_0xabca('0xe')],'transfereecontext':_0x247c2c[_0xabca('0xf')],'transfereeexten':_0x247c2c[_0xabca('0x10')],'transfereelinkedid':_0x247c2c[_0xabca('0x11')],'isexternal':_0x247c2c['isexternal'],'context':_0x247c2c[_0xabca('0x12')],'extension':_0x247c2c[_0xabca('0x13')],'type':_0xabca('0x14')},'log':'CreateVoiceTransferReport'});};exports[_0xabca('0x15')]=function(_0x3b5757){return client[_0xabca('0x2')](_0xabca('0x3'),{'body':{'result':_0x3b5757[_0xabca('0x4')],'transfererchannel':_0x3b5757[_0xabca('0x16')],'transferercalleridnum':_0x3b5757[_0xabca('0x17')],'transferercalleridname':_0x3b5757[_0xabca('0x18')],'transfererconnectedlinenum':_0x3b5757[_0xabca('0x19')],'transfererconnectedlinename':_0x3b5757['secondtransfererconnectedlinename'],'transfereraccountcode':_0x3b5757[_0xabca('0x1a')],'transferercontext':_0x3b5757[_0xabca('0x1b')],'transfererexten':_0x3b5757[_0xabca('0x1c')],'transfererlinkedid':_0x3b5757['origtransfererlinkedid'],'transfereechannel':_0x3b5757['transfertargetchannel'],'transfereecalleridnum':_0x3b5757[_0xabca('0x1d')],'transfereecalleridname':_0x3b5757[_0xabca('0x1e')],'transfereeconnectedlinenum':_0x3b5757[_0xabca('0x1f')],'transfereeconnectedlinename':_0x3b5757[_0xabca('0x20')],'transfereeaccountcode':_0x3b5757[_0xabca('0x21')],'transfereecontext':_0x3b5757[_0xabca('0x22')],'transfereeexten':_0x3b5757['transfertargetexten'],'transfereelinkedid':_0x3b5757[_0xabca('0x23')],'isexternal':_0x3b5757['isexternal'],'context':_0x3b5757[_0xabca('0x24')],'extension':_0x3b5757['origtransfererexten'],'type':_0xabca('0x25')},'log':_0xabca('0x3')});}; \ No newline at end of file +var _0x0580=['transfererexten','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereelinkedid','isexternal','context','extension','blind','CreateVoiceTransferReport','attendedTransfer','Request','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode'];(function(_0x5b67a3,_0x17f056){var _0x4a71d8=function(_0x48b775){while(--_0x48b775){_0x5b67a3['push'](_0x5b67a3['shift']());}};_0x4a71d8(++_0x17f056);}(_0x0580,0xe6));var _0x0058=function(_0x580d7f,_0x380a5a){_0x580d7f=_0x580d7f-0x0;var _0x4d5d9b=_0x0580[_0x580d7f];return _0x4d5d9b;};'use strict';var client=require(_0x0058('0x0'));exports['transfers']={};exports[_0x0058('0x1')]=function(_0x584d63){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x584d63[_0x0058('0x2')],'transfererchannel':_0x584d63[_0x0058('0x3')],'transferercalleridnum':_0x584d63['transferercalleridnum'],'transferercalleridname':_0x584d63[_0x0058('0x4')],'transfererconnectedlinenum':_0x584d63[_0x0058('0x5')],'transfererconnectedlinename':_0x584d63[_0x0058('0x6')],'transfereraccountcode':_0x584d63[_0x0058('0x7')],'transferercontext':_0x584d63['transferercontext'],'transfererexten':_0x584d63[_0x0058('0x8')],'transfererlinkedid':_0x584d63['transfererlinkedid'],'transfereechannel':_0x584d63['transfereechannel'],'transfereecalleridnum':_0x584d63[_0x0058('0x9')],'transfereecalleridname':_0x584d63[_0x0058('0xa')],'transfereeconnectedlinenum':_0x584d63['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x584d63[_0x0058('0xb')],'transfereeaccountcode':_0x584d63['transfereeaccountcode'],'transfereecontext':_0x584d63['transfereecontext'],'transfereeexten':_0x584d63['transfereeexten'],'transfereelinkedid':_0x584d63[_0x0058('0xc')],'isexternal':_0x584d63[_0x0058('0xd')],'context':_0x584d63[_0x0058('0xe')],'extension':_0x584d63[_0x0058('0xf')],'type':_0x0058('0x10')},'log':_0x0058('0x11')});};exports[_0x0058('0x12')]=function(_0x1486be){return client[_0x0058('0x13')]('CreateVoiceTransferReport',{'body':{'result':_0x1486be['result'],'transfererchannel':_0x1486be['origtransfererchannel'],'transferercalleridnum':_0x1486be['origtransferercalleridnum'],'transferercalleridname':_0x1486be[_0x0058('0x14')],'transfererconnectedlinenum':_0x1486be['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x1486be[_0x0058('0x15')],'transfereraccountcode':_0x1486be[_0x0058('0x16')],'transferercontext':_0x1486be[_0x0058('0x17')],'transfererexten':_0x1486be['secondtransfererexten'],'transfererlinkedid':_0x1486be[_0x0058('0x18')],'transfereechannel':_0x1486be[_0x0058('0x19')],'transfereecalleridnum':_0x1486be[_0x0058('0x1a')],'transfereecalleridname':_0x1486be['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x1486be['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x1486be[_0x0058('0x1b')],'transfereeaccountcode':_0x1486be['transfertargetaccountcode'],'transfereecontext':_0x1486be[_0x0058('0x1c')],'transfereeexten':_0x1486be[_0x0058('0x1d')],'transfereelinkedid':_0x1486be[_0x0058('0x1e')],'isexternal':_0x1486be[_0x0058('0xd')],'context':_0x1486be[_0x0058('0x1f')],'extension':_0x1486be[_0x0058('0x20')],'type':_0x0058('0x21')},'log':_0x0058('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 1903a7a..bbde725 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 _0xa41a=['exten','context','trunks','outboundChannels','run','event','emit','custom:','faxAccounts','send','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','validate','moment','../../../config/environment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','agents','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','reload','action','Reload','Action','then','message','catch','command','Command','content','hasOwnProperty','push','length','find','voiceQueues','omit','undefined','values','channels','uniqueid','%s.%s','wav','MixMonitor','monitors','isNil','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','map','channel','destinationchannel','StopMixMonitor','stop','filename','StopMixMonitor\x20Success','queueChannels','type','inbound','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup'];(function(_0x409f61,_0x12c91f){var _0x220266=function(_0x46c44e){while(--_0x46c44e){_0x409f61['push'](_0x409f61['shift']());}};_0x220266(++_0x12c91f);}(_0xa41a,0x6b));var _0xaa41=function(_0x522486,_0x49e645){_0x522486=_0x522486-0x0;var _0x546ca5=_0xa41a[_0x522486];return _0x546ca5;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var jayson=require('jayson/promise');var schema=require(_0xaa41('0x2'));var moment=require(_0xaa41('0x3'));var config=require(_0xaa41('0x4'));var properties=require(_0xaa41('0x5'));var ami=require(_0xaa41('0x6'));var VoiceQueueSummary=require(_0xaa41('0x7'));exports[_0xaa41('0x8')]=function(_0x251efa,_0x5dad7c,_0x2122a0){return new Promise(function(_0x1ec9d4,_0x54bc5a){var _0x5b1fff={'QueuePause':function(_0x179545){return new Promise(function(_0x202cce){var _0x588ab4=util[_0xaa41('0x9')](_0xaa41('0xa'),_0xaa41('0xb'),_0x179545[_0xaa41('0xc')]);if(_0x251efa[_0xaa41('0xd')]&&_0x251efa[_0xaa41('0xd')][_0x588ab4]&&_0x251efa[_0xaa41('0xd')][_0x588ab4][_0xaa41('0xe')]){_0x251efa[_0xaa41('0xd')][_0x588ab4]['updateAcw']();}if(_0x251efa[_0xaa41('0xf')][_0x588ab4]){_0x251efa[_0xaa41('0xf')][_0x588ab4]['updateStatusRealtime']({'statePause':_0x179545['pause']?!![]:![]});}_0x202cce({'code':0xc8,'message':_0xaa41('0x10')});});},'Reload':function(_0x518b5b){var _0x19bd69=this;return new Promise(function(_0x12d9e6,_0x2f64bc){if(ami[_0xaa41('0x11')]()==![]){return _0x2f64bc(_0x19bd69[_0xaa41('0x12')](0x1f4,[config['asterisk']['ip'],config[_0xaa41('0x13')][_0xaa41('0x14')],_0xaa41('0x15')][_0xaa41('0x16')]('\x20')));}_0x518b5b=_[_0xaa41('0x17')](_0x518b5b,_[_0xaa41('0x18')](properties[_0xaa41('0x19')]['module']));_0x518b5b[_0xaa41('0x1a')]=_0xaa41('0x1b');return ami[_0xaa41('0x1c')](_0x518b5b)[_0xaa41('0x1d')](function(_0x230a6a){_0x12d9e6({'code':0xc8,'message':_0x230a6a[_0xaa41('0x1e')]});})[_0xaa41('0x1f')](function(_0x46e6d3){_0x2f64bc(_0x19bd69[_0xaa41('0x12')](0x1f5,_0x46e6d3['message']));});});},'Command':function(_0x5cd936){var _0x1f502a=this;return new Promise(function(_0x22de55,_0x35c753){if(ami['isConnected']()==![]){return _0x35c753(_0x1f502a[_0xaa41('0x12')](0x1f4,[config[_0xaa41('0x13')]['ip'],config['asterisk']['username'],_0xaa41('0x15')]['join']('\x20')));}_0x5cd936=_[_0xaa41('0x17')](_0x5cd936,_0xaa41('0x20'));_0x5cd936[_0xaa41('0x1a')]=_0xaa41('0x21');return ami[_0xaa41('0x1c')](_0x5cd936)['then'](function(_0x43c430){_0x22de55({'code':0xc8,'message':_0x43c430[_0xaa41('0x22')]});})[_0xaa41('0x1f')](function(_0x21f596){_0x35c753(_0x1f502a[_0xaa41('0x12')](0x1f5,_0x21f596[_0xaa41('0x1e')]));});});},'VoiceQueues':function(){return new Promise(function(_0x5c3074){var _0x5795f4=[];for(var _0x16aec5 in _0x251efa['voiceQueues']){if(_0x251efa['voiceQueues'][_0xaa41('0x23')](_0x16aec5)){var _0x59707f=_0x251efa['voiceQueues'][_0x16aec5];var _0x2d0ac0=new VoiceQueueSummary(_0x59707f);_0x5795f4[_0xaa41('0x24')](_0x2d0ac0);}}_0x5c3074({'count':_0x5795f4[_0xaa41('0x25')],'rows':_0x5795f4});});},'UpdateVoiceQueue':function(_0x632fd2){return new Promise(function(_0x3f5272,_0xa7269f){var _0x57ef96=_[_0xaa41('0x26')](_0x251efa[_0xaa41('0x27')],{'id':parseInt(_0x632fd2['id'])});var _0x63c18c=_[_0xaa41('0x28')](_0x632fd2,['id']);if(_0x57ef96){for(var _0x1d8c2b in _0x63c18c){if(typeof _0x63c18c[_0x1d8c2b]!==_0xaa41('0x29')&&typeof _0x57ef96[_0x1d8c2b]!==_0xaa41('0x29')){_0x57ef96[_0x1d8c2b]=_0x63c18c[_0x1d8c2b];}}_0x3f5272(_0x57ef96);}else{_0xa7269f();}});},'VoiceChannels':function(){return new Promise(function(_0x104a95){var _0x4b1800=_[_0xaa41('0x2a')](_0x251efa['channels']);_0x104a95({'count':_0x4b1800['length'],'rows':_0x4b1800});});},'VoiceChannelMixMonitor':function(_0x714537){var _0x1176bd=this;return new Promise(function(_0x534a85,_0x392b5d){if(ami[_0xaa41('0x11')]()==![]){return _0x392b5d(_0x1176bd['error'](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xaa41('0x14')],_0xaa41('0x15')][_0xaa41('0x16')]('\x20')));}var _0x38afc4=schema(properties['voicechannel'])[_0xaa41('0x2')](_0x714537);if(_0x38afc4[_0xaa41('0x25')]>0x0){return _0x392b5d(_0x1176bd[_0xaa41('0x12')](0x1f4,_['map'](_0x38afc4,_0xaa41('0x1e'))[_0xaa41('0x16')](',\x20')));}var _0x321eb7=_['find'](_0x251efa[_0xaa41('0x2b')],{'uniqueid':_0x714537[_0xaa41('0x2c')]});if(_0x321eb7&&_0x321eb7['channel']){var _0x23eb50=util[_0xaa41('0x9')](_0xaa41('0x2d'),_0x714537['filename']||_0x714537[_0xaa41('0x2c')],_0x714537['format']||_0xaa41('0x2e'));return ami[_0xaa41('0x1c')]({'action':_0xaa41('0x2f'),'channel':_0x321eb7['channel'],'file':_0x23eb50,'options':'ai(mixmonitorid)'})['then'](function(_0x2dc05a){var _0x2e785f=_[_0xaa41('0x26')](_0x321eb7[_0xaa41('0x30')],{'filename':'/var/spool/asterisk/monitor/'+_0x23eb50['toLowerCase']()});if(_[_0xaa41('0x31')](_0x2e785f)){_0x321eb7[_0xaa41('0x30')][_0xaa41('0x24')]({'filename':_0xaa41('0x32')+_0x23eb50[_0xaa41('0x33')](),'createdAt':moment()[_0xaa41('0x9')](_0xaa41('0x34')),'mixmonitorid':_0x2dc05a['mixmonitorid'],'status':_0xaa41('0x35')});}else{_0x2e785f[_0xaa41('0x36')]=_0x2dc05a[_0xaa41('0x36')];_0x2e785f[_0xaa41('0x37')]='rec';}_0x534a85({'code':0xc8,'message':[_0x714537['uniqueid'],_0xaa41('0x38'),_0x2dc05a[_0xaa41('0x36')]]['join']('\x20'),'mixmonitorid':_0x2dc05a[_0xaa41('0x36')]});})['catch'](function(_0x9243d9){_0x392b5d(_0x1176bd[_0xaa41('0x12')](0x1f5,[_0x714537[_0xaa41('0x2c')],_0x9243d9[_0xaa41('0x1e')][_0xaa41('0x33')]()][_0xaa41('0x16')]('\x20')));});}else{return _0x392b5d(_0x1176bd[_0xaa41('0x12')](0x1f5,_0xaa41('0x39')));}});},'VoiceChannelStopMixMonitor':function(_0x5d9b22){var _0x236ff4=this;return new Promise(function(_0x2abf39,_0x35c685){if(ami[_0xaa41('0x11')]()==![]){return _0x35c685(_0x236ff4[_0xaa41('0x12')](0x1f4,[config[_0xaa41('0x13')]['ip'],config['asterisk']['username'],_0xaa41('0x15')]['join']('\x20')));}var _0x1ed366=schema(properties[_0xaa41('0x3a')])[_0xaa41('0x2')](_0x5d9b22);if(_0x1ed366[_0xaa41('0x25')]>0x0){return _0x35c685(_0x236ff4[_0xaa41('0x12')](0x1f4,_[_0xaa41('0x3b')](_0x1ed366,_0xaa41('0x1e'))['join'](',\x20')));}var _0x124992=_['find'](_0x251efa['channels'],{'uniqueid':_0x5d9b22[_0xaa41('0x2c')]});if(_0x124992){return Promise['resolve']()['then'](function(){if(_0x124992['channel']){return ami[_0xaa41('0x1c')]({'action':'StopMixMonitor','channel':_0x124992[_0xaa41('0x3c')],'mixmonitorid':_0x5d9b22[_0xaa41('0x36')]})['catch'](function(){});}})['then'](function(){if(_0x124992[_0xaa41('0x3d')]){return ami[_0xaa41('0x1c')]({'action':_0xaa41('0x3e'),'channel':_0x124992[_0xaa41('0x3d')],'mixmonitorid':_0x5d9b22[_0xaa41('0x36')]})[_0xaa41('0x1f')](function(){});}})[_0xaa41('0x1d')](function(){var _0x37bf5d=_[_0xaa41('0x26')](_0x124992['monitors'],{'mixmonitorid':_0x5d9b22[_0xaa41('0x36')]});if(_0x37bf5d){_0x37bf5d[_0xaa41('0x37')]=_0xaa41('0x3f');}})[_0xaa41('0x1d')](function(){var _0x206d86=util[_0xaa41('0x9')]('%s.%s',_0x5d9b22[_0xaa41('0x40')]||_0x5d9b22[_0xaa41('0x2c')],_0x5d9b22[_0xaa41('0x9')]||_0xaa41('0x2e'));var _0x57d1f6=_[_0xaa41('0x26')](_0x124992['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x206d86[_0xaa41('0x33')]()});if(_0x57d1f6){_0x57d1f6[_0xaa41('0x37')]=_0xaa41('0x3f');}})['then'](function(){_0x2abf39({'code':0xc8,'message':[_0x5d9b22[_0xaa41('0x2c')],_0xaa41('0x41')][_0xaa41('0x16')]('\x20')});})['catch'](function(_0x321cc3){_0x35c685(_0x236ff4[_0xaa41('0x12')](0x1f5,[_0x5d9b22[_0xaa41('0x2c')],_0x321cc3[_0xaa41('0x1e')][_0xaa41('0x33')]()][_0xaa41('0x16')]('\x20')));});}else{return _0x35c685(_0x236ff4[_0xaa41('0x12')](0x1f5,_0xaa41('0x39')));}});},'VoiceQueuesChannels':function(_0x4eab60){var _0x9f0a81=this;return new Promise(function(_0x5bef5f){var _0x5ae65e=_[_0xaa41('0x2a')](_0x251efa[_0xaa41('0x42')]);var _0x3fef3e={'count':_0x5ae65e[_0xaa41('0x25')],'rows':_0x5ae65e};if(_0x4eab60&&_0x4eab60[_0xaa41('0x43')]){if(![_0xaa41('0x44'),_0xaa41('0x45')][_0xaa41('0x46')](_0x4eab60['type'])){return _0x54bc5a(_0x9f0a81[_0xaa41('0x12')](0x190,_0xaa41('0x47')));}var _0x1d518f=_['filter'](_0x5ae65e,function(_0x2e0f53){return _0x2e0f53[_0xaa41('0x43')]===_0x4eab60['type'];});_0x3fef3e[_0xaa41('0x48')]=_0x1d518f[_0xaa41('0x25')];_0x3fef3e[_0xaa41('0x49')]=_0x1d518f;}_0x5bef5f(_0x3fef3e);});},'VoiceQueuesChannel':function(_0x4e5a2e){var _0x2cf32c=this;return new Promise(function(_0xc8e626,_0x4e3b13){var _0x49789a=schema(properties[_0xaa41('0x4a')])[_0xaa41('0x2')](_0x4e5a2e);if(_0x49789a[_0xaa41('0x25')]>0x0){return _0x4e3b13(_0x2cf32c['error'](0x1f4,_[_0xaa41('0x3b')](_0x49789a,_0xaa41('0x1e'))[_0xaa41('0x16')](',\x20')));}var _0x32f2b4=_[_0xaa41('0x26')](_0x251efa['queueChannels'],{'uniqueid':_0x4e5a2e[_0xaa41('0x2c')]});if(_0x32f2b4){_0xc8e626(_0x32f2b4);}else{return _0x4e3b13(_0x2cf32c['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x3ba305){var _0x52ae7f=this;return new Promise(function(_0x3621c0,_0xbbf261){if(ami[_0xaa41('0x11')]()==![]){return _0xbbf261(_0x52ae7f['error'](0x1f4,[config[_0xaa41('0x13')]['ip'],config[_0xaa41('0x13')][_0xaa41('0x14')],_0xaa41('0x15')][_0xaa41('0x16')]('\x20')));}var _0x332a3c=schema(properties[_0xaa41('0x4b')])[_0xaa41('0x2')](_0x3ba305);if(_0x332a3c[_0xaa41('0x25')]>0x0){return _0xbbf261(_0x52ae7f['error'](0x1f4,_[_0xaa41('0x3b')](_0x332a3c,_0xaa41('0x1e'))[_0xaa41('0x16')](',\x20')));}var _0x5a5a55=_[_0xaa41('0x26')](_0x251efa[_0xaa41('0x42')],{'uniqueid':_0x3ba305[_0xaa41('0x2c')]});if(_0x5a5a55&&_0x5a5a55[_0xaa41('0x3c')]){return ami[_0xaa41('0x1c')]({'action':_0xaa41('0x4c'),'channel':_0x5a5a55[_0xaa41('0x3c')]})['then'](function(_0x55a85c){_0x3621c0({'code':0xc8,'message':[_0x3ba305['uniqueid'],_0x55a85c['message']['toLowerCase']()]['join']('\x20')});})[_0xaa41('0x1f')](function(_0x50b598){_0xbbf261(_0x52ae7f['error'](0x1f5,[_0x3ba305[_0xaa41('0x2c')],_0x50b598[_0xaa41('0x1e')][_0xaa41('0x33')]()][_0xaa41('0x16')]('\x20')));});}else{return _0xbbf261(_0x52ae7f['error'](0x1f5,_0xaa41('0x39')));}});},'VoiceQueuesChannelRedirect':function(_0x2a8313){var _0x1ddb6c=this;return new Promise(function(_0x46822f,_0xa71432){if(ami[_0xaa41('0x11')]()==![]){return _0xa71432(_0x1ddb6c[_0xaa41('0x12')](0x1f4,[config[_0xaa41('0x13')]['ip'],config[_0xaa41('0x13')]['username'],_0xaa41('0x15')][_0xaa41('0x16')]('\x20')));}var _0x50170f=schema(properties['voicequeuechannelredirect'])['validate'](_0x2a8313);if(_0x50170f[_0xaa41('0x25')]>0x0){return _0xa71432(_0x1ddb6c['error'](0x1f4,_[_0xaa41('0x3b')](_0x50170f,'message')[_0xaa41('0x16')](',\x20')));}var _0x18d18b=_['find'](_0x251efa[_0xaa41('0x42')],{'uniqueid':_0x2a8313[_0xaa41('0x2c')]});if(_0x18d18b&&_0x18d18b[_0xaa41('0x3c')]){return ami[_0xaa41('0x1c')]({'action':'Redirect','channel':_0x18d18b['channel'],'exten':_0x2a8313[_0xaa41('0x4d')],'context':_0x2a8313[_0xaa41('0x4e')]||_0x18d18b['context'],'priority':0x1})['then'](function(_0x2169b8){_0x46822f({'code':0xc8,'message':[_0x2a8313[_0xaa41('0x2c')],_0x2169b8[_0xaa41('0x1e')][_0xaa41('0x33')]()][_0xaa41('0x16')]('\x20')});})['catch'](function(_0x475ceb){_0xa71432(_0x1ddb6c['error'](0x1f5,[_0x2a8313['uniqueid'],_0x475ceb['message'][_0xaa41('0x33')]()][_0xaa41('0x16')]('\x20')));});}else{return _0xa71432(_0x1ddb6c[_0xaa41('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x229297){return new Promise(function(_0x2adf93){var _0x19ed68=_[_0xaa41('0x2a')](_0x251efa[_0xaa41('0xf')]);if(_0x229297&&_0x229297['id']){var _0x3ffbf8=_[_0xaa41('0x26')](_0x19ed68,function(_0x50a53b){return _0x50a53b['id']===_0x229297['id'];});_0x2adf93(_0x3ffbf8);}else{_0x2adf93({'count':_0x19ed68[_0xaa41('0x25')],'rows':_0x19ed68});}});},'Telephones':function(){return new Promise(function(_0x3031e5){var _0x40b47c=_[_0xaa41('0x2a')](_0x251efa['telephones']);_0x3031e5({'count':_0x40b47c[_0xaa41('0x25')],'rows':_0x40b47c});});},'Trunks':function(){return new Promise(function(_0x4c2c99){var _0x194423=_[_0xaa41('0x2a')](_0x251efa[_0xaa41('0x4f')]);_0x4c2c99({'count':_0x194423[_0xaa41('0x25')],'rows':_0x194423});});},'OutboundChannels':function(){return new Promise(function(_0x491cad){var _0xf456c1=_[_0xaa41('0x2a')](_0x251efa[_0xaa41('0x50')]);_0x491cad({'count':_0xf456c1[_0xaa41('0x25')],'rows':_0xf456c1});});},'Outbound':function(){return new Promise(function(_0x59052d){_0x59052d(_0x251efa[_0xaa41('0x45')]);});},'Campaigns':function(){return new Promise(function(_0x50197b){var _0x55d380=_[_0xaa41('0x2a')](_0x251efa['campaigns']);_0x50197b({'count':_0x55d380[_0xaa41('0x25')],'rows':_0x55d380});});},'VoiceQueuesPreview':function(_0x133368){var _0x2ba160=this;return new Promise(function(_0x582d79,_0x1c5df8){_0x5dad7c[_0xaa41('0x51')](_0x133368['id'])[_0xaa41('0x1d')](function(_0x297ec6){_0x582d79({'code':0xc8,'message':_0x297ec6[_0xaa41('0x1e')]});})[_0xaa41('0x1f')](function(_0x25a064){_0x1c5df8(_0x2ba160['error'](0x1f4,_0x25a064[_0xaa41('0x1e')]));});});},'EventManager':function(_0x1b7fee){var _0x198547=this;return new Promise(function(_0x530982,_0x5ec19b){if(!_0x1b7fee[_0xaa41('0x52')]){return _0x5ec19b(_0x198547[_0xaa41('0x12')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xaa41('0x53')](_0xaa41('0x54')+_0x1b7fee['event'],_0x1b7fee[_0xaa41('0x1e')]);_0x530982({'code':0xc8,'message':_0x1b7fee});});},'FaxAccounts':function(){return new Promise(function(_0x3dd47e){var _0x3e6926=_[_0xaa41('0x2a')](_0x251efa[_0xaa41('0x55')]);_0x3dd47e({'count':_0x3e6926[_0xaa41('0x25')],'rows':_0x3e6926});});},'SendFax':function(_0x9313fd){var _0x1472be=this;return new Promise(function(_0x5c67d1,_0x4d0390){_0x2122a0[_0xaa41('0x56')](_0x9313fd)['then'](function(_0x654594){_0x5c67d1({'code':0xc8,'message':_0x654594[_0xaa41('0x1e')]});})[_0xaa41('0x1f')](function(_0x53d64c){_0x4d0390(_0x1472be[_0xaa41('0x12')](0x1f4,_0x53d64c[_0xaa41('0x1e')]));});});},'CheckAfterSend':function(_0x2d7493){var _0x521f58=this;return new Promise(function(_0x173549,_0x39052b){_0x2122a0['checkAfterSend'](_0x2d7493)[_0xaa41('0x1d')](function(_0x4de25c){_0x173549({'code':0xc8,'message':_0x4de25c['message']});})[_0xaa41('0x1f')](function(_0x34d0e4){_0x39052b(_0x521f58['error'](0x1f4,_0x34d0e4['message']));});});}};var _0x241e1a=jayson[_0xaa41('0x57')](_0x5b1fff)[_0xaa41('0x58')]();_0x241e1a['on'](_0xaa41('0x12'),function(_0x5be2e7){return _0x54bc5a(_0x5be2e7);});_0x241e1a[_0xaa41('0x8')](0x232a,_0xaa41('0x59'),function(){console[_0xaa41('0x5a')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x1ec9d4(_0xaa41('0x5b')+0x232a);});});}; \ No newline at end of file +var _0x2bd8=['/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','MixMonitor\x20Success','voicechannel','resolve','StopMixMonitor','destinationchannel','status','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','outbound','includes','type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','queueChannels','voicequeuechannelhangup','Redirect','context','telephones','trunks','outboundChannels','event','Event\x20name\x20mandatory','emit','custom:','send','server','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','../model/voiceQueueSummary','format','timers','timer','agents','pause','isConnected','error','asterisk','username','join','keys','reload','module','action','Reload','Action','then','message','catch','ami\x20disconnected','pick','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','values','channels','map','uniqueid','channel','%s.%s','filename','wav','MixMonitor','monitors'];(function(_0x15b33d,_0x3a17b0){var _0x3b09b6=function(_0xe5870e){while(--_0xe5870e){_0x15b33d['push'](_0x15b33d['shift']());}};_0x3b09b6(++_0x3a17b0);}(_0x2bd8,0x130));var _0x82bd=function(_0x3c57de,_0x1cff78){_0x3c57de=_0x3c57de-0x0;var _0x490977=_0x2bd8[_0x3c57de];return _0x490977;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var jayson=require(_0x82bd('0x1'));var schema=require(_0x82bd('0x2'));var moment=require(_0x82bd('0x3'));var config=require(_0x82bd('0x4'));var properties=require(_0x82bd('0x5'));var ami=require(_0x82bd('0x6'));var VoiceQueueSummary=require(_0x82bd('0x7'));exports['listen']=function(_0x41584e,_0x2e1a98,_0x3bf810){return new Promise(function(_0x5ceb60,_0x19dbb1){var _0x77d7a9={'QueuePause':function(_0x226f60){return new Promise(function(_0x1f7463){var _0x4dc3a6=util[_0x82bd('0x8')]('%s/%s','SIP',_0x226f60['name']);if(_0x41584e[_0x82bd('0x9')]&&_0x41584e['timers'][_0x4dc3a6]&&_0x41584e['timers'][_0x4dc3a6][_0x82bd('0xa')]){_0x41584e['timers'][_0x4dc3a6]['updateAcw']();}if(_0x41584e[_0x82bd('0xb')][_0x4dc3a6]){_0x41584e[_0x82bd('0xb')][_0x4dc3a6]['updateStatusRealtime']({'statePause':_0x226f60[_0x82bd('0xc')]?!![]:![]});}_0x1f7463({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0xfaccf7){var _0x51e17e=this;return new Promise(function(_0x338bb4,_0x3c4042){if(ami[_0x82bd('0xd')]()==![]){return _0x3c4042(_0x51e17e[_0x82bd('0xe')](0x1f4,[config['asterisk']['ip'],config[_0x82bd('0xf')][_0x82bd('0x10')],'ami\x20disconnected'][_0x82bd('0x11')]('\x20')));}_0xfaccf7=_['pick'](_0xfaccf7,_[_0x82bd('0x12')](properties[_0x82bd('0x13')][_0x82bd('0x14')]));_0xfaccf7[_0x82bd('0x15')]=_0x82bd('0x16');return ami[_0x82bd('0x17')](_0xfaccf7)[_0x82bd('0x18')](function(_0xb7a986){_0x338bb4({'code':0xc8,'message':_0xb7a986[_0x82bd('0x19')]});})[_0x82bd('0x1a')](function(_0x390107){_0x3c4042(_0x51e17e[_0x82bd('0xe')](0x1f5,_0x390107[_0x82bd('0x19')]));});});},'Command':function(_0x253741){var _0x4a1e62=this;return new Promise(function(_0x5688ed,_0x283ce7){if(ami[_0x82bd('0xd')]()==![]){return _0x283ce7(_0x4a1e62[_0x82bd('0xe')](0x1f4,[config[_0x82bd('0xf')]['ip'],config[_0x82bd('0xf')][_0x82bd('0x10')],_0x82bd('0x1b')][_0x82bd('0x11')]('\x20')));}_0x253741=_[_0x82bd('0x1c')](_0x253741,_0x82bd('0x1d'));_0x253741[_0x82bd('0x15')]=_0x82bd('0x1e');return ami[_0x82bd('0x17')](_0x253741)[_0x82bd('0x18')](function(_0x3d9f03){_0x5688ed({'code':0xc8,'message':_0x3d9f03[_0x82bd('0x1f')]});})[_0x82bd('0x1a')](function(_0x3b6b93){_0x283ce7(_0x4a1e62[_0x82bd('0xe')](0x1f5,_0x3b6b93['message']));});});},'VoiceQueues':function(){return new Promise(function(_0x4b3215){var _0x4248be=[];for(var _0x436ecd in _0x41584e[_0x82bd('0x20')]){if(_0x41584e[_0x82bd('0x20')][_0x82bd('0x21')](_0x436ecd)){var _0x10d101=_0x41584e[_0x82bd('0x20')][_0x436ecd];var _0xbef23b=new VoiceQueueSummary(_0x10d101);_0x4248be[_0x82bd('0x22')](_0xbef23b);}}_0x4b3215({'count':_0x4248be[_0x82bd('0x23')],'rows':_0x4248be});});},'UpdateVoiceQueue':function(_0x53a2a6){return new Promise(function(_0x5bd22f,_0x5609b7){var _0x5d1015=_[_0x82bd('0x24')](_0x41584e[_0x82bd('0x20')],{'id':parseInt(_0x53a2a6['id'])});var _0x351d3d=_[_0x82bd('0x25')](_0x53a2a6,['id']);if(_0x5d1015){for(var _0x363ef9 in _0x351d3d){if(typeof _0x351d3d[_0x363ef9]!=='undefined'&&typeof _0x5d1015[_0x363ef9]!=='undefined'){_0x5d1015[_0x363ef9]=_0x351d3d[_0x363ef9];}}_0x5bd22f(_0x5d1015);}else{_0x5609b7();}});},'VoiceChannels':function(){return new Promise(function(_0x5b21ce){var _0x1e6866=_[_0x82bd('0x26')](_0x41584e[_0x82bd('0x27')]);_0x5b21ce({'count':_0x1e6866['length'],'rows':_0x1e6866});});},'VoiceChannelMixMonitor':function(_0x166c46){var _0x4f209e=this;return new Promise(function(_0x9cc69b,_0x1a1e24){if(ami[_0x82bd('0xd')]()==![]){return _0x1a1e24(_0x4f209e[_0x82bd('0xe')](0x1f4,[config[_0x82bd('0xf')]['ip'],config[_0x82bd('0xf')]['username'],_0x82bd('0x1b')][_0x82bd('0x11')]('\x20')));}var _0x3a7d07=schema(properties['voicechannel'])[_0x82bd('0x2')](_0x166c46);if(_0x3a7d07['length']>0x0){return _0x1a1e24(_0x4f209e['error'](0x1f4,_[_0x82bd('0x28')](_0x3a7d07,_0x82bd('0x19'))[_0x82bd('0x11')](',\x20')));}var _0x44e1d9=_[_0x82bd('0x24')](_0x41584e[_0x82bd('0x27')],{'uniqueid':_0x166c46[_0x82bd('0x29')]});if(_0x44e1d9&&_0x44e1d9[_0x82bd('0x2a')]){var _0x42dc7f=util[_0x82bd('0x8')](_0x82bd('0x2b'),_0x166c46[_0x82bd('0x2c')]||_0x166c46[_0x82bd('0x29')],_0x166c46[_0x82bd('0x8')]||_0x82bd('0x2d'));return ami[_0x82bd('0x17')]({'action':_0x82bd('0x2e'),'channel':_0x44e1d9['channel'],'file':_0x42dc7f,'options':'ai(mixmonitorid)'})['then'](function(_0x3fea10){var _0x4420dc=_['find'](_0x44e1d9[_0x82bd('0x2f')],{'filename':'/var/spool/asterisk/monitor/'+_0x42dc7f['toLowerCase']()});if(_['isNil'](_0x4420dc)){_0x44e1d9[_0x82bd('0x2f')][_0x82bd('0x22')]({'filename':_0x82bd('0x30')+_0x42dc7f[_0x82bd('0x31')](),'createdAt':moment()[_0x82bd('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x3fea10['mixmonitorid'],'status':'rec'});}else{_0x4420dc[_0x82bd('0x32')]=_0x3fea10['mixmonitorid'];_0x4420dc['status']=_0x82bd('0x33');}_0x9cc69b({'code':0xc8,'message':[_0x166c46[_0x82bd('0x29')],_0x82bd('0x34'),_0x3fea10[_0x82bd('0x32')]][_0x82bd('0x11')]('\x20'),'mixmonitorid':_0x3fea10[_0x82bd('0x32')]});})[_0x82bd('0x1a')](function(_0x1f27f5){_0x1a1e24(_0x4f209e[_0x82bd('0xe')](0x1f5,[_0x166c46['uniqueid'],_0x1f27f5['message'][_0x82bd('0x31')]()][_0x82bd('0x11')]('\x20')));});}else{return _0x1a1e24(_0x4f209e['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x277b7a){var _0x18a697=this;return new Promise(function(_0x4d310b,_0x121f1f){if(ami[_0x82bd('0xd')]()==![]){return _0x121f1f(_0x18a697[_0x82bd('0xe')](0x1f4,[config[_0x82bd('0xf')]['ip'],config[_0x82bd('0xf')][_0x82bd('0x10')],_0x82bd('0x1b')][_0x82bd('0x11')]('\x20')));}var _0x21d7d4=schema(properties[_0x82bd('0x35')])[_0x82bd('0x2')](_0x277b7a);if(_0x21d7d4[_0x82bd('0x23')]>0x0){return _0x121f1f(_0x18a697['error'](0x1f4,_[_0x82bd('0x28')](_0x21d7d4,_0x82bd('0x19'))['join'](',\x20')));}var _0x5b736e=_[_0x82bd('0x24')](_0x41584e[_0x82bd('0x27')],{'uniqueid':_0x277b7a[_0x82bd('0x29')]});if(_0x5b736e){return Promise[_0x82bd('0x36')]()[_0x82bd('0x18')](function(){if(_0x5b736e['channel']){return ami['Action']({'action':_0x82bd('0x37'),'channel':_0x5b736e[_0x82bd('0x2a')],'mixmonitorid':_0x277b7a['mixmonitorid']})[_0x82bd('0x1a')](function(){});}})['then'](function(){if(_0x5b736e[_0x82bd('0x38')]){return ami[_0x82bd('0x17')]({'action':'StopMixMonitor','channel':_0x5b736e[_0x82bd('0x38')],'mixmonitorid':_0x277b7a[_0x82bd('0x32')]})['catch'](function(){});}})['then'](function(){var _0x403afe=_['find'](_0x5b736e[_0x82bd('0x2f')],{'mixmonitorid':_0x277b7a[_0x82bd('0x32')]});if(_0x403afe){_0x403afe[_0x82bd('0x39')]=_0x82bd('0x3a');}})['then'](function(){var _0x53fd25=util[_0x82bd('0x8')](_0x82bd('0x2b'),_0x277b7a['filename']||_0x277b7a[_0x82bd('0x29')],_0x277b7a[_0x82bd('0x8')]||_0x82bd('0x2d'));var _0x4d58af=_[_0x82bd('0x24')](_0x5b736e[_0x82bd('0x2f')],{'filename':_0x82bd('0x30')+_0x53fd25[_0x82bd('0x31')]()});if(_0x4d58af){_0x4d58af[_0x82bd('0x39')]=_0x82bd('0x3a');}})[_0x82bd('0x18')](function(){_0x4d310b({'code':0xc8,'message':[_0x277b7a[_0x82bd('0x29')],_0x82bd('0x3b')][_0x82bd('0x11')]('\x20')});})[_0x82bd('0x1a')](function(_0x1c7e47){_0x121f1f(_0x18a697[_0x82bd('0xe')](0x1f5,[_0x277b7a['uniqueid'],_0x1c7e47[_0x82bd('0x19')][_0x82bd('0x31')]()]['join']('\x20')));});}else{return _0x121f1f(_0x18a697[_0x82bd('0xe')](0x1f5,_0x82bd('0x3c')));}});},'VoiceQueuesChannels':function(_0x8dfe63){var _0x4237ef=this;return new Promise(function(_0x55a2e6){var _0x5b4fd2=_[_0x82bd('0x26')](_0x41584e['queueChannels']);var _0x49ec28={'count':_0x5b4fd2[_0x82bd('0x23')],'rows':_0x5b4fd2};if(_0x8dfe63&&_0x8dfe63['type']){if(!['inbound',_0x82bd('0x3d')][_0x82bd('0x3e')](_0x8dfe63[_0x82bd('0x3f')])){return _0x19dbb1(_0x4237ef[_0x82bd('0xe')](0x190,_0x82bd('0x40')));}var _0x1a7402=_[_0x82bd('0x41')](_0x5b4fd2,function(_0x11a7bb){return _0x11a7bb[_0x82bd('0x3f')]===_0x8dfe63[_0x82bd('0x3f')];});_0x49ec28[_0x82bd('0x42')]=_0x1a7402[_0x82bd('0x23')];_0x49ec28[_0x82bd('0x43')]=_0x1a7402;}_0x55a2e6(_0x49ec28);});},'VoiceQueuesChannel':function(_0x1a1cdc){var _0x265f88=this;return new Promise(function(_0x589ea4,_0x16599d){var _0x459021=schema(properties[_0x82bd('0x44')])[_0x82bd('0x2')](_0x1a1cdc);if(_0x459021[_0x82bd('0x23')]>0x0){return _0x16599d(_0x265f88['error'](0x1f4,_['map'](_0x459021,'message')['join'](',\x20')));}var _0x3b91fb=_[_0x82bd('0x24')](_0x41584e[_0x82bd('0x45')],{'uniqueid':_0x1a1cdc[_0x82bd('0x29')]});if(_0x3b91fb){_0x589ea4(_0x3b91fb);}else{return _0x16599d(_0x265f88['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x26621c){var _0x6ef12d=this;return new Promise(function(_0x28121a,_0x4d7fb4){if(ami[_0x82bd('0xd')]()==![]){return _0x4d7fb4(_0x6ef12d[_0x82bd('0xe')](0x1f4,[config[_0x82bd('0xf')]['ip'],config[_0x82bd('0xf')][_0x82bd('0x10')],_0x82bd('0x1b')][_0x82bd('0x11')]('\x20')));}var _0x28b2be=schema(properties[_0x82bd('0x46')])[_0x82bd('0x2')](_0x26621c);if(_0x28b2be[_0x82bd('0x23')]>0x0){return _0x4d7fb4(_0x6ef12d[_0x82bd('0xe')](0x1f4,_[_0x82bd('0x28')](_0x28b2be,_0x82bd('0x19'))[_0x82bd('0x11')](',\x20')));}var _0x202477=_[_0x82bd('0x24')](_0x41584e[_0x82bd('0x45')],{'uniqueid':_0x26621c['uniqueid']});if(_0x202477&&_0x202477[_0x82bd('0x2a')]){return ami['Action']({'action':'Hangup','channel':_0x202477[_0x82bd('0x2a')]})['then'](function(_0x306247){_0x28121a({'code':0xc8,'message':[_0x26621c[_0x82bd('0x29')],_0x306247[_0x82bd('0x19')][_0x82bd('0x31')]()][_0x82bd('0x11')]('\x20')});})[_0x82bd('0x1a')](function(_0x39385f){_0x4d7fb4(_0x6ef12d[_0x82bd('0xe')](0x1f5,[_0x26621c[_0x82bd('0x29')],_0x39385f[_0x82bd('0x19')][_0x82bd('0x31')]()]['join']('\x20')));});}else{return _0x4d7fb4(_0x6ef12d['error'](0x1f5,_0x82bd('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0xd283d9){var _0x513e1d=this;return new Promise(function(_0x47d136,_0x227a08){if(ami[_0x82bd('0xd')]()==![]){return _0x227a08(_0x513e1d[_0x82bd('0xe')](0x1f4,[config[_0x82bd('0xf')]['ip'],config['asterisk'][_0x82bd('0x10')],'ami\x20disconnected'][_0x82bd('0x11')]('\x20')));}var _0x6ff77c=schema(properties['voicequeuechannelredirect'])[_0x82bd('0x2')](_0xd283d9);if(_0x6ff77c[_0x82bd('0x23')]>0x0){return _0x227a08(_0x513e1d[_0x82bd('0xe')](0x1f4,_[_0x82bd('0x28')](_0x6ff77c,'message')[_0x82bd('0x11')](',\x20')));}var _0x5dc55=_[_0x82bd('0x24')](_0x41584e[_0x82bd('0x45')],{'uniqueid':_0xd283d9[_0x82bd('0x29')]});if(_0x5dc55&&_0x5dc55[_0x82bd('0x2a')]){return ami[_0x82bd('0x17')]({'action':_0x82bd('0x47'),'channel':_0x5dc55[_0x82bd('0x2a')],'exten':_0xd283d9['exten'],'context':_0xd283d9[_0x82bd('0x48')]||_0x5dc55['context'],'priority':0x1})['then'](function(_0x31b50e){_0x47d136({'code':0xc8,'message':[_0xd283d9[_0x82bd('0x29')],_0x31b50e['message'][_0x82bd('0x31')]()]['join']('\x20')});})[_0x82bd('0x1a')](function(_0x4f53a1){_0x227a08(_0x513e1d['error'](0x1f5,[_0xd283d9[_0x82bd('0x29')],_0x4f53a1[_0x82bd('0x19')]['toLowerCase']()]['join']('\x20')));});}else{return _0x227a08(_0x513e1d['error'](0x1f5,_0x82bd('0x3c')));}});},'Agents':function(_0x320559){return new Promise(function(_0x513b9c){var _0x1e9df2=_[_0x82bd('0x26')](_0x41584e['agents']);if(_0x320559&&_0x320559['id']){var _0x5591af=_[_0x82bd('0x24')](_0x1e9df2,function(_0x5357c4){return _0x5357c4['id']===_0x320559['id'];});_0x513b9c(_0x5591af);}else{_0x513b9c({'count':_0x1e9df2['length'],'rows':_0x1e9df2});}});},'Telephones':function(){return new Promise(function(_0x308b8e){var _0x130dc5=_[_0x82bd('0x26')](_0x41584e[_0x82bd('0x49')]);_0x308b8e({'count':_0x130dc5[_0x82bd('0x23')],'rows':_0x130dc5});});},'Trunks':function(){return new Promise(function(_0x537fdf){var _0xeeb228=_['values'](_0x41584e[_0x82bd('0x4a')]);_0x537fdf({'count':_0xeeb228['length'],'rows':_0xeeb228});});},'OutboundChannels':function(){return new Promise(function(_0x2fbf08){var _0x4e1d32=_['values'](_0x41584e[_0x82bd('0x4b')]);_0x2fbf08({'count':_0x4e1d32[_0x82bd('0x23')],'rows':_0x4e1d32});});},'Outbound':function(){return new Promise(function(_0x4c1136){_0x4c1136(_0x41584e[_0x82bd('0x3d')]);});},'Campaigns':function(){return new Promise(function(_0x15a849){var _0x16acb7=_['values'](_0x41584e['campaigns']);_0x15a849({'count':_0x16acb7[_0x82bd('0x23')],'rows':_0x16acb7});});},'VoiceQueuesPreview':function(_0x3c476d){var _0x528742=this;return new Promise(function(_0x222f9d,_0x26f0a2){_0x2e1a98['run'](_0x3c476d['id'])[_0x82bd('0x18')](function(_0x68653b){_0x222f9d({'code':0xc8,'message':_0x68653b[_0x82bd('0x19')]});})[_0x82bd('0x1a')](function(_0x3af021){_0x26f0a2(_0x528742[_0x82bd('0xe')](0x1f4,_0x3af021['message']));});});},'EventManager':function(_0x12cb53){var _0x11fa86=this;return new Promise(function(_0x12bc87,_0x4b91c6){if(!_0x12cb53[_0x82bd('0x4c')]){return _0x4b91c6(_0x11fa86['error'](0x1f4,_0x82bd('0x4d')));}ami[_0x82bd('0x4e')](_0x82bd('0x4f')+_0x12cb53[_0x82bd('0x4c')],_0x12cb53[_0x82bd('0x19')]);_0x12bc87({'code':0xc8,'message':_0x12cb53});});},'FaxAccounts':function(){return new Promise(function(_0x5de4dc){var _0x1177de=_[_0x82bd('0x26')](_0x41584e['faxAccounts']);_0x5de4dc({'count':_0x1177de[_0x82bd('0x23')],'rows':_0x1177de});});},'SendFax':function(_0x12dbeb){var _0x57858b=this;return new Promise(function(_0x38314e,_0x3d9a3e){_0x3bf810[_0x82bd('0x50')](_0x12dbeb)['then'](function(_0x533c42){_0x38314e({'code':0xc8,'message':_0x533c42[_0x82bd('0x19')]});})[_0x82bd('0x1a')](function(_0x3346c5){_0x3d9a3e(_0x57858b['error'](0x1f4,_0x3346c5[_0x82bd('0x19')]));});});},'CheckAfterSend':function(_0x4721c3){var _0x116fb6=this;return new Promise(function(_0x4f1ddb,_0x5d6291){_0x3bf810['checkAfterSend'](_0x4721c3)['then'](function(_0x437463){_0x4f1ddb({'code':0xc8,'message':_0x437463[_0x82bd('0x19')]});})['catch'](function(_0x35d111){_0x5d6291(_0x116fb6['error'](0x1f4,_0x35d111[_0x82bd('0x19')]));});});}};var _0x4a08d7=jayson[_0x82bd('0x51')](_0x77d7a9)[_0x82bd('0x52')]();_0x4a08d7['on'](_0x82bd('0xe'),function(_0x5ed3fb){return _0x19dbb1(_0x5ed3fb);});_0x4a08d7[_0x82bd('0x53')](0x232a,_0x82bd('0x54'),function(){console[_0x82bd('0x55')](_0x82bd('0x56'),0x232a);return _0x5ceb60(_0x82bd('0x57')+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 8054927..e011215 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 _0x70de=['resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','data4','[CM][%s][%s]\x20Autocreate\x20enabled','firstName','calleridname','','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','name','format','trigger:%s','action','toLowerCase','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','defaults','redis','info','[CM][%s][%s]','stringify','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','routeId','destcalleridnum','calleridnum','lastName','createdAt','scheduledAt','updatedAt','union'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0x70de,0xb3));var _0xe70d=function(_0x4ca160,_0x14886c){_0x4ca160=_0x4ca160-0x0;var _0x303ae9=_0x70de[_0x4ca160];return _0x303ae9;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0xe70d('0x0'));var util=require('util');var config=require(_0xe70d('0x1'));var logger=require(_0xe70d('0x2'))(_0xe70d('0x3'));var cmContactRpc=require(_0xe70d('0x4'));config['redis']=_[_0xe70d('0x5')](config[_0xe70d('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe70d('0x6')]));function emit(_0x4110d0,_0x4e87de,_0x2f8642,_0x35c75c,_0x28e73c){logger[_0xe70d('0x7')](_0xe70d('0x8'),_0x4110d0,_0x4e87de['id'],_0x2f8642,_0x35c75c,JSON[_0xe70d('0x9')](_0x28e73c));io['to'](_0x2f8642)['emit'](_0x35c75c,_0x28e73c);}exports[_0xe70d('0xa')]=function(_0x5190f7,_0x4c6860,_0x100a4b,_0x5c984b){var _0x5999d7,_0x328c4e;var _0x31ab32={};var _0x5d8dcb;var _0x261be9=Number(_0x100a4b[_0xe70d('0xb')]);var _0x411cca=_0x100a4b[_0xe70d('0xc')]?Boolean(Number(_0x100a4b[_0xe70d('0xc')])):![];var _0x47845b;var _0x121b1d=![];if(!_[_0xe70d('0xd')](_0x100a4b[_0xe70d('0xe')])){if(_0x100a4b[_0xe70d('0xe')]=='1')_0x121b1d=!![];}if(!_0x121b1d){if(_0x5c984b['xmd-contactid']){_0x31ab32['id']=_0x5c984b[_0xe70d('0xf')];}}if(!_0x31ab32['id']){_0x31ab32[_0xe70d('0x10')]=_0x261be9;_0x47845b=_0x100a4b[_0xe70d('0x11')]&&_0x100a4b[_0xe70d('0x11')]!=='0'?_0x100a4b[_0xe70d('0x11')][_0xe70d('0x12')](','):[_0xe70d('0x13')];_0x31ab32[_0xe70d('0x14')]=_['map'](_0x47845b,function(_0x209c35){var _0x36e86a={};_0x36e86a[_0x209c35]=_0x5c984b[_0xe70d('0x15')]?_0x5c984b[_0xe70d('0x16')]:_0x5c984b[_0xe70d('0x17')];return _0x36e86a;});_0x5d8dcb=_0x5c984b[_0xe70d('0x15')]?_0x5c984b[_0xe70d('0x16')]:_0x5c984b[_0xe70d('0x17')];}var _0x48ddeb=['id','firstName',_0xe70d('0x18'),'phone','mobile','fax',_0xe70d('0x10'),_0xe70d('0x19'),_0xe70d('0x1a'),_0xe70d('0x1b')];var _0x1ac381=_[_0xe70d('0x1c')](_0x48ddeb,_0x47845b);BPromise[_0xe70d('0x1d')]()[_0xe70d('0x1e')](cmContactRpc[_0xe70d('0x1f')]({'attributes':_0x1ac381,'where':_0x31ab32,'phone':_0x5d8dcb}))['then'](function(_0x554122){_0x328c4e=_0x554122;if(!_[_0xe70d('0x20')](_0x328c4e)){if(_0x328c4e[_0xe70d('0x21')]===0x1){_0x5999d7=_0x328c4e[0x0];logger[_0xe70d('0x7')](_0xe70d('0x22'),_0x5c984b[_0xe70d('0x23')],_0x4c6860['id'],_0x5999d7['id']);}else{logger['info'](_0xe70d('0x24'),_0x5c984b['uniqueid'],_0x4c6860['id'],_['map'](_0x328c4e,'id')['join'](','));}return;}else{logger[_0xe70d('0x7')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x5c984b['uniqueid'],_0x4c6860['id']);var _0x23566f={'ListId':_0x261be9};var _0x5ced6c=_0x100a4b[_0xe70d('0x25')]&&_0x100a4b[_0xe70d('0x25')]!=='0'?_0x100a4b[_0xe70d('0x25')]:_0xe70d('0x13');if(_0x411cca){logger[_0xe70d('0x7')](_0xe70d('0x26'),_0x5c984b['uniqueid'],_0x4c6860['id']);_0x23566f[_0x5ced6c]=_['isNil'](_0x5c984b['routeId'])?_0x5c984b[_0xe70d('0x17')]:_0x5c984b['destcalleridnum'];if(_[_0xe70d('0xd')](_0x5c984b[_0xe70d('0x15')])){_0x23566f[_0xe70d('0x27')]=_0x5c984b[_0xe70d('0x28')]&&_0x5c984b[_0xe70d('0x28')]!==_0xe70d('0x29')?_0x5c984b[_0xe70d('0x28')]:_0xe70d('0x2a');}else{_0x23566f[_0xe70d('0x27')]=_0x5c984b[_0xe70d('0x2b')]&&_0x5c984b[_0xe70d('0x2b')]!==''?_0x5c984b[_0xe70d('0x2b')]:_0xe70d('0x2a');}return BPromise[_0xe70d('0x1d')]()['then'](cmContactRpc['createContact'](_0x23566f))[_0xe70d('0x1e')](function(_0x44921d){_0x5999d7=_0x44921d;_0x328c4e[_0xe70d('0x2c')](_0x44921d);if(_0x5999d7){logger[_0xe70d('0x7')](_0xe70d('0x2d'),_0x5c984b[_0xe70d('0x23')],_0x4c6860['id'],_0x5999d7['id']);}return;});}else{logger[_0xe70d('0x7')](_0xe70d('0x2e'),_0x5c984b[_0xe70d('0x23')],_0x4c6860['id']);_0x23566f[_0x5ced6c]=_[_0xe70d('0xd')](_0x5c984b[_0xe70d('0x15')])?_0x5c984b[_0xe70d('0x17')]:_0x5c984b[_0xe70d('0x16')];if(_[_0xe70d('0xd')](_0x5c984b[_0xe70d('0x15')])){_0x23566f[_0xe70d('0x27')]=_0x5c984b[_0xe70d('0x28')]&&_0x5c984b[_0xe70d('0x28')]!==_0xe70d('0x29')?_0x5c984b[_0xe70d('0x28')]:_0xe70d('0x2a');}else{_0x23566f['firstName']=_0x5c984b['destcalleridname']&&_0x5c984b[_0xe70d('0x2b')]!==''?_0x5c984b[_0xe70d('0x2b')]:_0xe70d('0x2a');}_0x5999d7=_0x23566f;_0x328c4e['push'](_0x23566f);return;}}})[_0xe70d('0x1e')](function(){if(_0x5190f7){emit(_0x5c984b['uniqueid'],_0x4c6860,util['format']('user:%s',_0x5190f7[_0xe70d('0x2f')]),util[_0xe70d('0x30')](_0xe70d('0x31'),_0x100a4b[_0xe70d('0x32')][_0xe70d('0x33')]()),{'evt':_['merge'](_0x5c984b,{'autoCreate':_0x411cca}),'contact':_0x5999d7===undefined?{}:_0x5999d7,'contacts':_0x328c4e[_0xe70d('0x21')]===0x0?undefined:_0x328c4e});}});}; \ No newline at end of file +var _0xa1c9=['ListId','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','destcalleridname','Unknown','createContact','[CM][%s][%s]\x20Contact\x20created:%s','format','user:%s','name','trigger:%s','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','emit','exec','data1','data2','isNil','data5','xmd-contactid','data3','split','$or','routeId','destcalleridnum','calleridnum','firstName','phone','mobile'];(function(_0x239e63,_0x446420){var _0x469c27=function(_0x1491ef){while(--_0x1491ef){_0x239e63['push'](_0x239e63['shift']());}};_0x469c27(++_0x446420);}(_0xa1c9,0x135));var _0x9a1c=function(_0x1dc0b9,_0x43ffca){_0x1dc0b9=_0x1dc0b9-0x0;var _0x20013a=_0xa1c9[_0x1dc0b9];return _0x20013a;};'use strict';var _=require(_0x9a1c('0x0'));var BPromise=require(_0x9a1c('0x1'));var Redis=require(_0x9a1c('0x2'));var util=require(_0x9a1c('0x3'));var config=require(_0x9a1c('0x4'));var logger=require(_0x9a1c('0x5'))(_0x9a1c('0x6'));var cmContactRpc=require(_0x9a1c('0x7'));config[_0x9a1c('0x8')]=_['defaults'](config[_0x9a1c('0x8')],{'host':_0x9a1c('0x9'),'port':0x18eb});var io=require(_0x9a1c('0xa'))(new Redis(config[_0x9a1c('0x8')]));function emit(_0xb1a3a4,_0x54ab19,_0x2aa263,_0x98387f,_0x586994){logger['info']('[CM][%s][%s]',_0xb1a3a4,_0x54ab19['id'],_0x2aa263,_0x98387f,JSON['stringify'](_0x586994));io['to'](_0x2aa263)[_0x9a1c('0xb')](_0x98387f,_0x586994);}exports[_0x9a1c('0xc')]=function(_0x5b02e3,_0x147962,_0x17ef35,_0x2524e3){var _0x3f955b,_0x12d101;var _0x63d80c={};var _0x4a18db;var _0x10e3bb=Number(_0x17ef35[_0x9a1c('0xd')]);var _0x5f4b4a=_0x17ef35['data2']?Boolean(Number(_0x17ef35[_0x9a1c('0xe')])):![];var _0x1783ff;var _0x518b1e=![];if(!_[_0x9a1c('0xf')](_0x17ef35[_0x9a1c('0x10')])){if(_0x17ef35[_0x9a1c('0x10')]=='1')_0x518b1e=!![];}if(!_0x518b1e){if(_0x2524e3[_0x9a1c('0x11')]){_0x63d80c['id']=_0x2524e3[_0x9a1c('0x11')];}}if(!_0x63d80c['id']){_0x63d80c['ListId']=_0x10e3bb;_0x1783ff=_0x17ef35[_0x9a1c('0x12')]&&_0x17ef35[_0x9a1c('0x12')]!=='0'?_0x17ef35['data3'][_0x9a1c('0x13')](','):['phone'];_0x63d80c[_0x9a1c('0x14')]=_['map'](_0x1783ff,function(_0x5bbfc){var _0x4980c9={};_0x4980c9[_0x5bbfc]=_0x2524e3[_0x9a1c('0x15')]?_0x2524e3[_0x9a1c('0x16')]:_0x2524e3['calleridnum'];return _0x4980c9;});_0x4a18db=_0x2524e3[_0x9a1c('0x15')]?_0x2524e3[_0x9a1c('0x16')]:_0x2524e3[_0x9a1c('0x17')];}var _0x3c8d9d=['id',_0x9a1c('0x18'),'lastName',_0x9a1c('0x19'),_0x9a1c('0x1a'),'fax',_0x9a1c('0x1b'),_0x9a1c('0x1c'),_0x9a1c('0x1d'),_0x9a1c('0x1e')];var _0x29293a=_[_0x9a1c('0x1f')](_0x3c8d9d,_0x1783ff);BPromise[_0x9a1c('0x20')]()[_0x9a1c('0x21')](cmContactRpc[_0x9a1c('0x22')]({'attributes':_0x29293a,'where':_0x63d80c,'phone':_0x4a18db}))[_0x9a1c('0x21')](function(_0x45fa32){_0x12d101=_0x45fa32;if(!_['isEmpty'](_0x12d101)){if(_0x12d101[_0x9a1c('0x23')]===0x1){_0x3f955b=_0x12d101[0x0];logger[_0x9a1c('0x24')](_0x9a1c('0x25'),_0x2524e3[_0x9a1c('0x26')],_0x147962['id'],_0x3f955b['id']);}else{logger['info'](_0x9a1c('0x27'),_0x2524e3[_0x9a1c('0x26')],_0x147962['id'],_[_0x9a1c('0x28')](_0x12d101,'id')[_0x9a1c('0x29')](','));}return;}else{logger[_0x9a1c('0x24')](_0x9a1c('0x2a'),_0x2524e3[_0x9a1c('0x26')],_0x147962['id']);var _0x36194e={'ListId':_0x10e3bb};var _0x59ace4=_0x17ef35[_0x9a1c('0x2b')]&&_0x17ef35[_0x9a1c('0x2b')]!=='0'?_0x17ef35[_0x9a1c('0x2b')]:_0x9a1c('0x19');if(_0x5f4b4a){logger[_0x9a1c('0x24')](_0x9a1c('0x2c'),_0x2524e3[_0x9a1c('0x26')],_0x147962['id']);_0x36194e[_0x59ace4]=_['isNil'](_0x2524e3[_0x9a1c('0x15')])?_0x2524e3[_0x9a1c('0x17')]:_0x2524e3[_0x9a1c('0x16')];if(_['isNil'](_0x2524e3[_0x9a1c('0x15')])){_0x36194e['firstName']=_0x2524e3['calleridname']&&_0x2524e3[_0x9a1c('0x2d')]!==''?_0x2524e3[_0x9a1c('0x2d')]:'Unknown';}else{_0x36194e[_0x9a1c('0x18')]=_0x2524e3['destcalleridname']&&_0x2524e3[_0x9a1c('0x2e')]!==''?_0x2524e3[_0x9a1c('0x2e')]:_0x9a1c('0x2f');}return BPromise[_0x9a1c('0x20')]()['then'](cmContactRpc[_0x9a1c('0x30')](_0x36194e))[_0x9a1c('0x21')](function(_0x12baf3){_0x3f955b=_0x12baf3;_0x12d101['push'](_0x12baf3);if(_0x3f955b){logger[_0x9a1c('0x24')](_0x9a1c('0x31'),_0x2524e3[_0x9a1c('0x26')],_0x147962['id'],_0x3f955b['id']);}return;});}else{logger[_0x9a1c('0x24')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x2524e3[_0x9a1c('0x26')],_0x147962['id']);_0x36194e[_0x59ace4]=_[_0x9a1c('0xf')](_0x2524e3[_0x9a1c('0x15')])?_0x2524e3['calleridnum']:_0x2524e3['destcalleridnum'];if(_[_0x9a1c('0xf')](_0x2524e3[_0x9a1c('0x15')])){_0x36194e[_0x9a1c('0x18')]=_0x2524e3['calleridname']&&_0x2524e3[_0x9a1c('0x2d')]!==''?_0x2524e3[_0x9a1c('0x2d')]:_0x9a1c('0x2f');}else{_0x36194e[_0x9a1c('0x18')]=_0x2524e3['destcalleridname']&&_0x2524e3[_0x9a1c('0x2e')]!==''?_0x2524e3[_0x9a1c('0x2e')]:'Unknown';}_0x3f955b=_0x36194e;_0x12d101['push'](_0x36194e);return;}}})[_0x9a1c('0x21')](function(){if(_0x5b02e3){emit(_0x2524e3[_0x9a1c('0x26')],_0x147962,util[_0x9a1c('0x32')](_0x9a1c('0x33'),_0x5b02e3[_0x9a1c('0x34')]),util['format'](_0x9a1c('0x35'),_0x17ef35['action'][_0x9a1c('0x36')]()),{'evt':_[_0x9a1c('0x37')](_0x2524e3,{'autoCreate':_0x5f4b4a}),'contact':_0x3f955b===undefined?{}:_0x3f955b,'contacts':_0x12d101['length']===0x0?undefined:_0x12d101});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 26e9a3c..dbb0319 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 _0x6f6c=['operator','upperFirst','interaction','message','event','agent','membername','lastevent','mailSubstatus','null','substatus','offlineMessage','created','equals','exports','util','lodash','url','./urlforward','./integration','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','vtigerAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','motionChannel','undefined','voice','debug','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','action','toLowerCase','motionbar','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','uriLocation','data4','windowWidth','data5','data6','600','winApplication','winArguments','format','name','trigger:%s:%s','jscripty','user:%s','trigger:%s','contactmanager','exec','integration','queue','routeId','urlforward','script','parse','query','replace','channel','AllConditions','every','checkConditions','AnyConditions','evt','inspect','account','chat','ChatWebsiteId','value','AccountId'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0x6f6c,0x19b));var _0xc6f6=function(_0x1a1361,_0x53f4eb){_0x1a1361=_0x1a1361-0x0;var _0x2e133b=_0x6f6c[_0x1a1361];return _0x2e133b;};'use strict';var util=require(_0xc6f6('0x0'));var _=require(_0xc6f6('0x1'));var url=require(_0xc6f6('0x2'));var Mustache=require('mustache');var Redis=require('ioredis');var urlforward=require(_0xc6f6('0x3'));var integration=require(_0xc6f6('0x4'));var cmContact=require('./cmContact');var script=require(_0xc6f6('0x5'));var config=require(_0xc6f6('0x6'));var logger=require(_0xc6f6('0x7'))(_0xc6f6('0x8'));var ami=require(_0xc6f6('0x9'));config[_0xc6f6('0xa')]=_[_0xc6f6('0xb')](config[_0xc6f6('0xa')],{'host':_0xc6f6('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var operators={'equals':function(_0x43a629,_0x2107ae){return _0x43a629==_0x2107ae;},'not_equals':function(_0x2b99e3,_0x4a1936){return _0x2b99e3!=_0x4a1936;}};var barAndWebActions=[_0xc6f6('0xd'),'url',_0xc6f6('0xe')];function Trigger(_0x5115ef){this[_0xc6f6('0xf')]=_0x5115ef[_0xc6f6('0xf')];this[_0xc6f6('0x10')]=_0x5115ef['agents'];this['voiceQueues']=_0x5115ef[_0xc6f6('0x11')];this[_0xc6f6('0x12')]=_0x5115ef['templates'];this[_0xc6f6('0x13')]=_0x5115ef['voiceExtensions'];this[_0xc6f6('0x14')]=_0x5115ef[_0xc6f6('0x14')];this[_0xc6f6('0x15')]=_0x5115ef[_0xc6f6('0x15')];this['salesforceAccounts']=_0x5115ef[_0xc6f6('0x16')];this[_0xc6f6('0x17')]=_0x5115ef[_0xc6f6('0x17')];this['zohoAccounts']=_0x5115ef[_0xc6f6('0x18')];this['deskAccounts']=_0x5115ef[_0xc6f6('0x19')];this['vtigerAccounts']=_0x5115ef['vtigerAccounts'];this[_0xc6f6('0x1a')]=_0x5115ef[_0xc6f6('0x1a')];this[_0xc6f6('0x1b')]=_0x5115ef[_0xc6f6('0x1b')];this[_0xc6f6('0x1c')]=_0x5115ef[_0xc6f6('0x1c')];this['accounts']={'zendesk':this[_0xc6f6('0x14')],'salesforce':this[_0xc6f6('0x16')],'freshdesk':this[_0xc6f6('0x15')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0xc6f6('0x18')],'desk':this[_0xc6f6('0x19')],'vtiger':this[_0xc6f6('0x1d')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0xc6f6('0x1c')],'servicenow':this[_0xc6f6('0x1a')]};ami['on'](_0xc6f6('0x1e'),this[_0xc6f6('0x1f')]['bind'](this));ami['on']('custom:agentconnect',this['syncCustomEvent'][_0xc6f6('0x20')](this));ami['on']('custom:agentringnoanswer',this[_0xc6f6('0x1f')][_0xc6f6('0x20')](this));ami['on'](_0xc6f6('0x21'),this[_0xc6f6('0x1f')][_0xc6f6('0x20')](this));ami['on'](_0xc6f6('0x22'),this[_0xc6f6('0x1f')][_0xc6f6('0x20')](this));ami['on'](_0xc6f6('0x23'),this[_0xc6f6('0x1f')][_0xc6f6('0x20')](this));ami['on'](_0xc6f6('0x24'),this[_0xc6f6('0x1f')]['bind'](this));ami['on'](_0xc6f6('0x25'),this[_0xc6f6('0x1f')][_0xc6f6('0x20')](this));ami['on'](_0xc6f6('0x26'),this[_0xc6f6('0x1f')][_0xc6f6('0x20')](this));ami['on'](_0xc6f6('0x27'),this[_0xc6f6('0x1f')][_0xc6f6('0x20')](this));ami['on'](_0xc6f6('0x28'),this['syncCustomEvent'][_0xc6f6('0x20')](this));ami['on'](_0xc6f6('0x29'),this['syncCustomEvent'][_0xc6f6('0x20')](this));ami['on'](_0xc6f6('0x2a'),this[_0xc6f6('0x2b')][_0xc6f6('0x20')](this));ami['on'](_0xc6f6('0x2c'),this[_0xc6f6('0x2b')][_0xc6f6('0x20')](this));ami['on'](_0xc6f6('0x2d'),this[_0xc6f6('0x2b')][_0xc6f6('0x20')](this));ami['on']('custom:newinteraction',this[_0xc6f6('0x1f')]['bind'](this));ami['on'](_0xc6f6('0x2e'),this['syncCustomEvent'][_0xc6f6('0x20')](this));ami['on']('custom:substatus',this[_0xc6f6('0x1f')][_0xc6f6('0x20')](this));ami['on'](_0xc6f6('0x2f'),this[_0xc6f6('0x1f')][_0xc6f6('0x20')](this));ami['on'](_0xc6f6('0x30'),this['syncCustomEvent']['bind'](this));ami['on'](_0xc6f6('0x31'),this['syncCustomEvent'][_0xc6f6('0x20')](this));ami['on'](_0xc6f6('0x32'),this[_0xc6f6('0x1f')][_0xc6f6('0x20')](this));ami['on'](_0xc6f6('0x33'),this[_0xc6f6('0x1f')]['bind'](this));}Trigger[_0xc6f6('0x34')][_0xc6f6('0x35')]=function(_0x36c7c9,_0xe08c23,_0x126792){logger[_0xc6f6('0x36')](_0x36c7c9,_0xe08c23,JSON['stringify'](_0x126792));io['to'](_0x36c7c9)[_0xc6f6('0x35')](_0xe08c23,_0x126792);};Trigger[_0xc6f6('0x34')][_0xc6f6('0x1f')]=function(_0x2afaaa){var _0x23cd03=_['clone'](_0x2afaaa);if(typeof _0x23cd03[_0xc6f6('0x37')]===_0xc6f6('0x38')){_0x23cd03[_0xc6f6('0x37')]=_0xc6f6('0x39');}logger[_0xc6f6('0x3a')](_0xc6f6('0x1f'),util['inspect'](_0x23cd03,{'showHidden':!![],'depth':null}));this[_0xc6f6('0x3b')](_0x23cd03);};Trigger[_0xc6f6('0x34')][_0xc6f6('0x2b')]=function(_0x4ba142){if(this[_0xc6f6('0x10')][_0x4ba142[_0xc6f6('0x3c')]]){this[_0xc6f6('0x1f')](_0x4ba142);}};Trigger['prototype'][_0xc6f6('0x3b')]=function(_0x354875){var _0x2f5b20;for(var _0x4d2351 in this[_0xc6f6('0xf')]){if(this[_0xc6f6('0xf')][_0xc6f6('0x3d')](_0x4d2351)){if(this[_0xc6f6('0xf')][_0x4d2351][_0xc6f6('0x3e')]){_0x2f5b20=this[_0xc6f6('0x3f')](this[_0xc6f6('0xf')][_0x4d2351],_0x354875);if(_0x2f5b20){_[_0xc6f6('0x40')](_0x354875,_0x354875[_0xc6f6('0x41')]);for(var _0x259a14=0x0,_0x38735b,_0xa04182,_0x4fdf25;_0x259a140x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file +var _0x7217=['format','%s/users','remoteUri','then','total_entries','find','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','stringify','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','_embedded','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','length','map','forEach','string','picklist','nameField','customField','content','toString','includes','idField','custom_fields','variable','variableName','type','customVariable','Variable','name','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','new','xCALLY','Motion','CTI','Tags','Descriptions','user','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','catch','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','unmanaged','lastevent','toUpperCase','calleridname','lodash','md5','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','application/json','validateEmail','Getting\x20agent\x20with\x20email'];(function(_0xe17a35,_0x3022a5){var _0x4222dd=function(_0x46d2fb){while(--_0x46d2fb){_0xe17a35['push'](_0xe17a35['shift']());}};_0x4222dd(++_0x3022a5);}(_0x7217,0x19e));var _0x7721=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x7217[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x7721('0x0'));var rp=require('request-promise');var md5=require(_0x7721('0x1'));var util=require(_0x7721('0x2'));var Redis=require(_0x7721('0x3'));var intUtil=require(_0x7721('0x4'));var config=require(_0x7721('0x5'));var logger=require('../../../../config/logger')('desk');config[_0x7721('0x6')]=_[_0x7721('0x7')](config[_0x7721('0x6')],{'host':_0x7721('0x8'),'port':0x18eb});var io=require(_0x7721('0x9'))(new Redis(config[_0x7721('0x6')]));function emit(_0x18ab6b,_0x21f680,_0x225610){io['to'](_0x18ab6b)[_0x7721('0xa')](_0x21f680,_0x225610);}var headers={'Content-Type':_0x7721('0xb'),'Accept':_0x7721('0xb')};function getUser(_0xfa8835,_0x138740){if(intUtil[_0x7721('0xc')](_0x138740)===!![]){logger['info'](_0x7721('0xd'),_0x138740);return request({'uri':util[_0x7721('0xe')](_0x7721('0xf'),_0xfa8835[_0x7721('0x10')])})[_0x7721('0x11')](function(_0x409b37){if(_0x409b37[_0x7721('0x12')]){return _[_0x7721('0x13')](_0x409b37['_embedded'][_0x7721('0x14')],{'email':_0x138740});}})[_0x7721('0x11')](function(_0x57ff6d){if(_0x57ff6d){logger[_0x7721('0x15')](_0x7721('0x16'));return _0x57ff6d;}else{logger[_0x7721('0x15')](_0x7721('0x17'));return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}}function request(_0x3cc909){logger[_0x7721('0x19')]('[HTTP]',JSON[_0x7721('0x1a')](_0x3cc909));return rp(_['defaults'](_0x3cc909,{'method':_0x7721('0x1b'),'headers':headers,'json':!![]}));}function getAuth(_0x5cb0e6){var _0xfec626;if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x1d')){_0xfec626=util[_0x7721('0xe')](_0x7721('0x1e'),_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x20')]);}else if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x21')){_0xfec626=util[_0x7721('0xe')]('%s/token:%s',_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x21')]);}return util[_0x7721('0xe')](_0x7721('0x22'),new Buffer(_0xfec626)['toString'](_0x7721('0x23')));}function getEndUser(_0x512f31,_0xb9e9dd,_0x288e3a){logger[_0x7721('0x15')](_0x7721('0x24'),_0x288e3a);return request({'uri':util[_0x7721('0xe')](_0x7721('0x25'),_0x512f31[_0x7721('0x10')]),'qs':{'phone':_0x288e3a}})['then'](function(_0x216f20){if(_0x216f20[_0x7721('0x12')]){logger[_0x7721('0x15')](_0x7721('0x26'));return _0x216f20[_0x7721('0x27')][_0x7721('0x14')][0x0];}else{logger[_0x7721('0x15')](_0x7721('0x28'));return request({'uri':util[_0x7721('0xe')]('%s/customers',_0x512f31[_0x7721('0x10')]),'method':'POST','body':{'first_name':_0xb9e9dd,'title':_0xb9e9dd,'phone_numbers':[{'type':'work','value':_0x288e3a}]}});}});}function getTags(_0x315202,_0x343c19){var _0x53c904=[];if(_0x315202&&_0x315202[_0x7721('0x29')]>0x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 91e434b..ef646e5 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 _0x5480=['data5','clientId','username','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info','toUpperCase','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','destcalleridnum','calleridnum','POST','contacts','Bearer\x20','headers','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','outbound','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','string','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','/contacts(','Fields','phonecall','/systemusers(','callDirection','queue','Descriptions','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:','openNewTab','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','util','./util','md5','ioredis','../../../../config/logger','dynamics365','redis','localhost','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve'];(function(_0x2649cb,_0x44122f){var _0x4eb66e=function(_0x206d76){while(--_0x206d76){_0x2649cb['push'](_0x2649cb['shift']());}};_0x4eb66e(++_0x44122f);}(_0x5480,0x13e));var _0x0548=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0x5480[_0x2405bc];return _0x5272d4;};'use strict';var _=require('lodash');var rp=require('request-promise');var util=require(_0x0548('0x0'));var intUtil=require(_0x0548('0x1'));var md5=require(_0x0548('0x2'));var Redis=require(_0x0548('0x3'));var logger=require(_0x0548('0x4'))(_0x0548('0x5'));var config=require('../../../../config/environment');config[_0x0548('0x6')]=_['defaults'](config[_0x0548('0x6')],{'host':_0x0548('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0548('0x6')]));function getAuthToken(_0x35a922,_0x196c92,_0x4ab8d8){if(_0x35a922[_0x0548('0x8')]){_0x35a922[_0x0548('0x9')]=_0x35a922[_0x0548('0xa')][_0x0548('0xb')];_0x35a922[_0x0548('0xc')]=_0x35a922[_0x0548('0xa')][_0x0548('0xd')];return Promise[_0x0548('0xe')](_0x35a922[_0x0548('0xa')][_0x0548('0xf')]);}var _0xe6ed20={'method':'POST','uri':_0x196c92,'form':{'client_id':_0x35a922[_0x0548('0x10')],'resource':_0x35a922['remoteUri'],'username':_0x35a922[_0x0548('0x11')],'password':_0x35a922['password'],'grant_type':_0x0548('0x12'),'client_secret':_0x35a922[_0x0548('0x13')]},'json':!![]};return rp(_0xe6ed20)[_0x0548('0x14')](function(_0x365bcd){return _0x365bcd[_0x0548('0x15')];})[_0x0548('0x16')](function(_0x3e3734){logger[_0x0548('0x17')]('['+[_0x4ab8d8['toUpperCase']()]+_0x0548('0x18'));return _0x3e3734[_0x0548('0x19')];});}function getUser(_0x20db83,_0x39937c,_0x3b45f7,_0x204541,_0x58e3c7,_0x593587){return new Promise(function(_0x42e536,_0x2e3530){return getAuthToken(_0x39937c,_0x204541,_0x593587)['then'](function(_0x160e3b){var _0x1ce600={'method':_0x0548('0x1a'),'uri':_0x58e3c7+_0x0548('0x1b'),'headers':{'Authorization':'Bearer\x20'+_0x160e3b,'OData-Version':_0x0548('0x1c')},'json':!![]};return rp(_0x1ce600);})['then'](function(_0x161f81){var _0x393738=_0x161f81[_0x0548('0x1d')];var _0x4dd771=![];var _0x392f96=null;if(!_[_0x0548('0x1e')](_0x3b45f7)){if(intUtil[_0x0548('0x1f')](_0x3b45f7[_0x0548('0x20')])){_0x20db83[_0x0548('0x21')]=_0x3b45f7[_0x0548('0x20')];for(_0x392f96=0x0;_0x392f96<_0x393738[_0x0548('0x22')];_0x392f96++){if(_0x393738[_0x392f96][_0x0548('0x23')]===_0x3b45f7[_0x0548('0x20')]&&!_0x393738[_0x392f96][_0x0548('0x24')]){_0x4dd771=!![];logger[_0x0548('0x25')]('['+[_0x593587[_0x0548('0x26')]()]+']\x20Agent\x20found\x20'+_0x393738[_0x392f96][_0x0548('0x27')]+'!');_0x20db83[_0x0548('0x28')]=_0x393738[_0x392f96][_0x0548('0x27')];}}}}if(!_0x4dd771){logger[_0x0548('0x25')]('['+[_0x593587['toUpperCase']()]+_0x0548('0x29'));_0x20db83[_0x0548('0x21')]=_0x39937c[_0x0548('0x11')];for(_0x392f96=0x0;_0x392f96<_0x393738[_0x0548('0x22')];_0x392f96++){if(_0x393738[_0x392f96]['internalemailaddress']===_0x39937c[_0x0548('0x11')]){_0x20db83[_0x0548('0x28')]=_0x393738[_0x392f96][_0x0548('0x27')];}}}_0x42e536(_0x20db83);})[_0x0548('0x16')](function(_0xd9f05d){_0x2e3530(_0xd9f05d[_0x0548('0x19')]);});});}function createEndUser(_0x4df180,_0x142f5e,_0x4f5198,_0x132895,_0x3cc7fa,_0x385b47,_0x3eea34){return new Promise(function(_0xcbe552,_0x144a1d){return getAuthToken(_0x142f5e,_0x4f5198,_0x385b47)[_0x0548('0x14')](function(_0x21f443){var _0x3d42f7=_0x385b47['toLowerCase']()==='outbound'?_0x3cc7fa[_0x0548('0x2a')]:_0x3cc7fa[_0x0548('0x2b')];var _0x3debcf={'method':_0x0548('0x2c'),'uri':_0x132895+_0x0548('0x2d'),'body':{'fullname':_0x3d42f7,'firstname':_0x3d42f7,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x4df180[_0x0548('0x28')]+')'},'headers':{'Authorization':_0x0548('0x2e')+_0x21f443,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x3debcf['body'][_0x3eea34]=_0x3d42f7;return rp(_0x3debcf);})[_0x0548('0x14')](function(_0x4de388){var _0x7583b9=_0x4de388[_0x0548('0x2f')][_0x0548('0x30')];var _0x2834e6=_0x7583b9[_0x0548('0x31')](_0x7583b9[_0x0548('0x32')]('(')+0x1,_0x7583b9[_0x0548('0x32')](')'));_0x4df180[_0x0548('0x33')]=_0x2834e6;_0xcbe552(_0x4df180);})[_0x0548('0x16')](function(_0x25238f){_0x144a1d(_0x25238f[_0x0548('0x19')]);});});}function getEndUser(_0x5645c5,_0x144feb,_0x1f4cb8,_0x2d4760,_0x1388e9,_0x144b10,_0x167116,_0x1b993c){var _0x27bc0d=_0x144b10[_0x0548('0x34')]()===_0x0548('0x35')?_0x1388e9[_0x0548('0x2a')]:_0x1388e9['calleridnum'];return getAuthToken(_0x144feb,_0x1f4cb8,_0x144b10)[_0x0548('0x14')](function(_0x364cfb){_0x1b993c=_0x1b993c?_0x1b993c:_0x0548('0x36');var _0x181b98={'method':_0x0548('0x1a'),'uri':_0x2d4760+_0x0548('0x37')+_0x1b993c+_0x0548('0x38')+_0x1b993c+_0x0548('0x39')+_0x27bc0d[_0x0548('0x3a')]('+','%2b')+'\x27','headers':{'Authorization':'Bearer\x20'+_0x364cfb,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x181b98);})[_0x0548('0x14')](function(_0x289695){var _0x2db9a=![];if(!_0x289695)return _0x2db9a;var _0x2b3910=_0x289695[_0x0548('0x1d')];for(var _0x3ea883=0x0;_0x3ea883<_0x2b3910['length'];_0x3ea883++){if(_0x2b3910[_0x3ea883][_0x1b993c]===_0x27bc0d){_0x2db9a=!![];_0x5645c5[_0x0548('0x33')]=_0x2b3910[_0x3ea883][_0x0548('0x3b')];}}return _0x2db9a;})['then'](function(_0x23bdd2){if(_0x23bdd2)return _0x5645c5;if(_0x167116===_0x0548('0x3c')){logger['info']('['+[_0x144b10[_0x0548('0x26')]()]+_0x0548('0x3d'));return _0x5645c5;}return createEndUser(_0x5645c5,_0x144feb,_0x1f4cb8,_0x2d4760,_0x1388e9,_0x144b10,_0x1b993c)[_0x0548('0x14')](function(_0x389c6b){logger[_0x0548('0x25')]('['+[_0x144b10['toUpperCase']()]+']\x20Enduser\x20created!',_0x389c6b[_0x0548('0x33')]);return _0x389c6b;});});}function getCustomFields(_0x2aa9fe,_0x1a7745,_0x2d216d){var _0x56ecbb={};if(_0x2aa9fe[_0x0548('0x22')]>0x0){_[_0x0548('0x3e')](_0x2aa9fe,function(_0x42a0ac){if(_['includes']([_0x0548('0x3f'),_0x0548('0x40')],_0x42a0ac[_0x0548('0x41')])&&_0x42a0ac[_0x0548('0x42')]&&!_0x42a0ac[_0x0548('0x43')]){var _0x21c3c1=_0x42a0ac[_0x0548('0x44')][_0x0548('0x34')]();var _0x3f4e8d=_0x21c3c1[_0x0548('0x31')](0x0,_0x21c3c1['indexOf']('_'));var _0x1c686e=_0x21c3c1[_0x0548('0x31')](_0x21c3c1[_0x0548('0x45')]('_')+0x1);if(_0x3f4e8d===_0x2d216d){_0x56ecbb[_0x1c686e]=_0x42a0ac[_0x0548('0x46')];}}});}return _0x56ecbb;}function getTicket(_0x3543d8,_0x5f2b67,_0x2eca72,_0x5a3e7d,_0x4eab02,_0x38edb8,_0x20deeb){return new Promise(function(_0x48098b,_0x14f6b7){var _0x4c8d26;return getAuthToken(_0x5f2b67,_0x2eca72,_0x20deeb)[_0x0548('0x14')](function(_0x20bfc3){if(_0x38edb8[_0x0548('0x47')]===_0x0548('0x48')){_0x4c8d26={'method':_0x0548('0x2c'),'uri':_0x5a3e7d+_0x0548('0x49'),'body':Object[_0x0548('0x4a')]({},{'title':intUtil[_0x0548('0x4b')](_0x38edb8[_0x0548('0x4c')],_0x4eab02,'\x20'),'description':intUtil[_0x0548('0x4b')](_0x38edb8['Descriptions'],_0x4eab02,'\x0a'),'customerid_contact@odata.bind':_0x3543d8['enduserId']?_0x0548('0x4d')+_0x3543d8[_0x0548('0x33')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x3543d8[_0x0548('0x28')]+')','caseorigincode':'1'},getCustomFields(_0x38edb8[_0x0548('0x4e')],_0x4eab02,_0x38edb8['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x20bfc3,'OData-Version':_0x0548('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x38edb8[_0x0548('0x47')]===_0x0548('0x4f')){var _0x526736=_0x3543d8[_0x0548('0x33')]?[{'partyid_systemuser@odata.bind':_0x0548('0x50')+_0x3543d8[_0x0548('0x28')]+')','participationtypemask':_0x3543d8[_0x0548('0x51')]===_0x0548('0x52')?0x2:0x1},{'partyid_contact@odata.bind':_0x0548('0x4d')+_0x3543d8['enduserId']+')','participationtypemask':_0x3543d8[_0x0548('0x51')]===_0x0548('0x52')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x0548('0x50')+_0x3543d8[_0x0548('0x28')]+')','participationtypemask':_0x3543d8[_0x0548('0x51')]===_0x0548('0x52')?0x2:0x1}];_0x4c8d26={'method':_0x0548('0x2c'),'uri':_0x5a3e7d+'phonecalls','body':Object[_0x0548('0x4a')]({},{'subject':intUtil[_0x0548('0x4b')](_0x38edb8[_0x0548('0x4c')],_0x4eab02,'\x20'),'phonenumber':String(_0x4eab02[_0x0548('0x2b')]),'description':intUtil['getString'](_0x38edb8[_0x0548('0x53')],_0x4eab02,'\x0a'),'regardingobjectid_contact@odata.bind':_0x3543d8[_0x0548('0x33')]?'/contacts('+_0x3543d8[_0x0548('0x33')]+')':undefined,'ownerid@odata.bind':_0x0548('0x50')+_0x3543d8['userId']+')','directioncode':_0x3543d8['callDirection']===_0x0548('0x52')?![]:!![],'phonecall_activity_parties':_0x526736},getCustomFields(_0x38edb8[_0x0548('0x4e')],_0x4eab02,_0x38edb8[_0x0548('0x47')])),'headers':{'Authorization':_0x0548('0x2e')+_0x20bfc3,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4c8d26);})[_0x0548('0x14')](function(_0x334c34){var _0x4792d2=_0x334c34[_0x0548('0x2f')]['odata-entityid'];var _0x283049=_0x4792d2[_0x0548('0x31')](_0x4792d2[_0x0548('0x32')]('(')+0x1,_0x4792d2[_0x0548('0x32')](')'));_0x3543d8[_0x0548('0x54')]=_0x283049;_0x48098b(_0x3543d8);})[_0x0548('0x16')](function(_0x2c5846){_0x14f6b7(_0x2c5846[_0x0548('0x19')]);});});}function emit(_0x638482,_0x31ce5d,_0xb5965b,_0xdb605f){var _0x46443d={'uri':util[_0x0548('0x55')](_0x0548('0x56'),_0x638482,_0xb5965b,_0xdb605f)};io['to'](util[_0x0548('0x55')](_0x0548('0x57'),_0x31ce5d))[_0x0548('0x58')](_0x0548('0x59'),_0x46443d);}exports['cs']=function(_0x5b8bde,_0x506356,_0x264f69,_0x46a0ea,_0x381930,_0x5a6b0b,_0x5d0a50,_0x111415){var _0x34c1de={};_0x5a6b0b[_0x0548('0x9')]=_0x5a6b0b['modernAuthentication']?intUtil[_0x0548('0x5a')](_0x5a6b0b['CloudProvider']['data7']):intUtil[_0x0548('0x5a')](_0x5a6b0b[_0x0548('0x9')]);_0x5a6b0b['serverUrl']=intUtil[_0x0548('0x5a')](_0x5a6b0b[_0x0548('0x5b')]);_0x34c1de[_0x0548('0x51')]=_0x111415===_0x0548('0x52')||_0x111415===_0x0548('0x5c')?_0x0548('0x52'):'outbound';var _0x17dd49=_0x5a6b0b[_0x0548('0x8')]?util[_0x0548('0x55')](_0x0548('0x5d'),_0x5a6b0b[_0x0548('0xa')][_0x0548('0xb')]):util[_0x0548('0x55')](_0x0548('0x5d'),_0x5a6b0b[_0x0548('0x9')]);var _0x44f580=util[_0x0548('0x55')](_0x0548('0x5e'),_0x5a6b0b[_0x0548('0xc')]);var _0x4a57fb=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5a6b0b['serverUrl'],_0x506356[_0x0548('0x5f')],md5(_0x506356[_0x0548('0x5f')]));if(_0x381930&&_0x381930[_0x0548('0x60')]){logger['info'](_0x0548('0x61'),_0x0548('0x62'));_0x506356[_0x0548('0x63')]=_0x4a57fb;}else if(_0x5d0a50&&_0x5d0a50[_0x0548('0x64')]&&_0x5d0a50[_0x0548('0x64')]!==_0x0548('0x65')){logger[_0x0548('0x25')]('[OUTBOUND]',_0x0548('0x62'));_0x506356[_0x0548('0x63')]=_0x4a57fb;}else{_0x506356[_0x0548('0x63')]='';}return getUser(_0x34c1de,_0x5a6b0b,_0x46a0ea,_0x44f580,_0x17dd49,_0x111415)[_0x0548('0x14')](function(_0x318857){logger[_0x0548('0x25')]('['+_0x111415[_0x0548('0x26')]()+_0x0548('0x66'),_0x318857[_0x0548('0x28')]);logger[_0x0548('0x25')]('['+_0x111415[_0x0548('0x26')]()+_0x0548('0x67'),_0x318857['userEmail']);return getEndUser(_0x318857,_0x5a6b0b,_0x44f580,_0x17dd49,_0x506356,_0x111415,_0x264f69['moduleCreate'],_0x264f69[_0x0548('0x68')]);})['then'](function(_0x45964d){logger[_0x0548('0x25')]('['+_0x111415[_0x0548('0x26')]()+_0x0548('0x69'),_0x45964d[_0x0548('0x33')]);logger['info']('['+_0x111415[_0x0548('0x26')]()+_0x0548('0x6a'),_0x506356[_0x0548('0x2b')]);return getTicket(_0x45964d,_0x5a6b0b,_0x44f580,_0x17dd49,_0x506356,_0x264f69,_0x111415);})[_0x0548('0x14')](function(_0x55f83e){logger[_0x0548('0x25')](util[_0x0548('0x55')]('['+_0x111415['toUpperCase']()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x264f69['ticketType'],_0x55f83e[_0x0548('0x54')]));logger[_0x0548('0x25')](util[_0x0548('0x55')]('['+_0x111415[_0x0548('0x26')]()+']\x20Call\x20direction:\x20%s',_0x111415));if(_0x111415!=='unmanaged'&&_0x264f69[_0x0548('0x6b')]){logger[_0x0548('0x25')]('['+_0x111415[_0x0548('0x26')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x5a6b0b[_0x0548('0x9')],_0x46a0ea[_0x0548('0x6c')],_0x264f69['ticketType'],_0x55f83e['ticketId']);}})[_0x0548('0x16')](function(_0x402757){logger[_0x0548('0x17')]('['+_0x111415[_0x0548('0x26')]()+_0x0548('0x6d'),_0x402757[_0x0548('0x19')]);console[_0x0548('0x17')](_0x0548('0x6e'),_0x402757);});}; \ No newline at end of file +var _0x229c=['destcalleridnum','calleridnum','contacts','/systemusers(','body','headers','substring','lastIndexOf','telephone1','GET','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','value','enduserId','contactid','nothing',']\x20Enduser\x20created!','includes','picklist','type','nameField','customField','idField','indexOf','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','ticketType','phonecall','callDirection','queue','phonecalls','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','trigger:browser:url','stripTrailingSlash','data7','serverUrl','unmanaged','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','lodash','request-promise','md5','ioredis','../../../../config/logger','localhost','socket.io-emitter','redis','modernAuthentication','CloudProvider','data2','resolve','data5','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','validateEmail','email','userEmail','length','isdisabled','info','systemuserid','toUpperCase',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','message','toLowerCase','outbound'];(function(_0x361525,_0x43a30f){var _0x50b35b=function(_0x4b1634){while(--_0x4b1634){_0x361525['push'](_0x361525['shift']());}};_0x50b35b(++_0x43a30f);}(_0x229c,0x1ea));var _0xc229=function(_0x243e1e,_0x5c75ea){_0x243e1e=_0x243e1e-0x0;var _0x3a7cea=_0x229c[_0x243e1e];return _0x3a7cea;};'use strict';var _=require(_0xc229('0x0'));var rp=require(_0xc229('0x1'));var util=require('util');var intUtil=require('./util');var md5=require(_0xc229('0x2'));var Redis=require(_0xc229('0x3'));var logger=require(_0xc229('0x4'))('dynamics365');var config=require('../../../../config/environment');config['redis']=_['defaults'](config['redis'],{'host':_0xc229('0x5'),'port':0x18eb});var io=require(_0xc229('0x6'))(new Redis(config[_0xc229('0x7')]));function getAuthToken(_0x57f68c,_0x49c9cc,_0x4e9af0){if(_0x57f68c[_0xc229('0x8')]){_0x57f68c['remoteUri']=_0x57f68c[_0xc229('0x9')]['data7'];_0x57f68c['tenantId']=_0x57f68c[_0xc229('0x9')][_0xc229('0xa')];return Promise[_0xc229('0xb')](_0x57f68c[_0xc229('0x9')][_0xc229('0xc')]);}var _0x19c5f2={'method':_0xc229('0xd'),'uri':_0x49c9cc,'form':{'client_id':_0x57f68c[_0xc229('0xe')],'resource':_0x57f68c[_0xc229('0xf')],'username':_0x57f68c[_0xc229('0x10')],'password':_0x57f68c[_0xc229('0x11')],'grant_type':'password','client_secret':_0x57f68c[_0xc229('0x12')]},'json':!![]};return rp(_0x19c5f2)[_0xc229('0x13')](function(_0x143886){return _0x143886[_0xc229('0x14')];})[_0xc229('0x15')](function(_0x2ea8e5){logger[_0xc229('0x16')]('['+[_0x4e9af0['toUpperCase']()]+_0xc229('0x17'));return _0x2ea8e5['message'];});}function getUser(_0x2e17b3,_0x56bf7f,_0xb0554e,_0x173589,_0x20adef,_0x17ccfe){return new Promise(function(_0x5f558f,_0x137481){return getAuthToken(_0x56bf7f,_0x173589,_0x17ccfe)[_0xc229('0x13')](function(_0x16c9cc){var _0x5e636d={'method':'GET','uri':_0x20adef+_0xc229('0x18'),'headers':{'Authorization':_0xc229('0x19')+_0x16c9cc,'OData-Version':_0xc229('0x1a')},'json':!![]};return rp(_0x5e636d);})[_0xc229('0x13')](function(_0x1911eb){var _0x1c5933=_0x1911eb['value'];var _0x4e1b22=![];var _0x2819a1=null;if(!_['isNil'](_0xb0554e)){if(intUtil[_0xc229('0x1b')](_0xb0554e[_0xc229('0x1c')])){_0x2e17b3[_0xc229('0x1d')]=_0xb0554e[_0xc229('0x1c')];for(_0x2819a1=0x0;_0x2819a1<_0x1c5933[_0xc229('0x1e')];_0x2819a1++){if(_0x1c5933[_0x2819a1]['internalemailaddress']===_0xb0554e[_0xc229('0x1c')]&&!_0x1c5933[_0x2819a1][_0xc229('0x1f')]){_0x4e1b22=!![];logger[_0xc229('0x20')]('['+[_0x17ccfe['toUpperCase']()]+']\x20Agent\x20found\x20'+_0x1c5933[_0x2819a1][_0xc229('0x21')]+'!');_0x2e17b3['userId']=_0x1c5933[_0x2819a1][_0xc229('0x21')];}}}}if(!_0x4e1b22){logger[_0xc229('0x20')]('['+[_0x17ccfe[_0xc229('0x22')]()]+_0xc229('0x23'));_0x2e17b3[_0xc229('0x1d')]=_0x56bf7f[_0xc229('0x10')];for(_0x2819a1=0x0;_0x2819a1<_0x1c5933[_0xc229('0x1e')];_0x2819a1++){if(_0x1c5933[_0x2819a1]['internalemailaddress']===_0x56bf7f['username']){_0x2e17b3[_0xc229('0x24')]=_0x1c5933[_0x2819a1][_0xc229('0x21')];}}}_0x5f558f(_0x2e17b3);})['catch'](function(_0x361e53){_0x137481(_0x361e53[_0xc229('0x25')]);});});}function createEndUser(_0x5e5f7f,_0x2d6f3c,_0x209dc8,_0x1f3ad7,_0x35f794,_0x989449,_0x6bb1c1){return new Promise(function(_0x2c742c,_0x30d96f){return getAuthToken(_0x2d6f3c,_0x209dc8,_0x989449)[_0xc229('0x13')](function(_0x5db44f){var _0x327405=_0x989449[_0xc229('0x26')]()===_0xc229('0x27')?_0x35f794[_0xc229('0x28')]:_0x35f794[_0xc229('0x29')];var _0x1a862c={'method':_0xc229('0xd'),'uri':_0x1f3ad7+_0xc229('0x2a'),'body':{'fullname':_0x327405,'firstname':_0x327405,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xc229('0x2b')+_0x5e5f7f['userId']+')'},'headers':{'Authorization':_0xc229('0x19')+_0x5db44f,'OData-Version':_0xc229('0x1a')},'json':!![],'resolveWithFullResponse':!![]};_0x1a862c[_0xc229('0x2c')][_0x6bb1c1]=_0x327405;return rp(_0x1a862c);})['then'](function(_0x42fd08){var _0x1b87d0=_0x42fd08[_0xc229('0x2d')]['odata-entityid'];var _0x4c9467=_0x1b87d0[_0xc229('0x2e')](_0x1b87d0[_0xc229('0x2f')]('(')+0x1,_0x1b87d0['lastIndexOf'](')'));_0x5e5f7f['enduserId']=_0x4c9467;_0x2c742c(_0x5e5f7f);})['catch'](function(_0x10ad2e){_0x30d96f(_0x10ad2e['message']);});});}function getEndUser(_0x1ff476,_0x4bd72d,_0x103a30,_0x567826,_0x49ed34,_0x41e710,_0x2f10d2,_0x4364fc){var _0xb812e3=_0x41e710[_0xc229('0x26')]()===_0xc229('0x27')?_0x49ed34['destcalleridnum']:_0x49ed34[_0xc229('0x29')];return getAuthToken(_0x4bd72d,_0x103a30,_0x41e710)[_0xc229('0x13')](function(_0x3174c4){_0x4364fc=_0x4364fc?_0x4364fc:_0xc229('0x30');var _0x36b522={'method':_0xc229('0x31'),'uri':_0x567826+_0xc229('0x32')+_0x4364fc+_0xc229('0x33')+_0x4364fc+_0xc229('0x34')+_0xb812e3[_0xc229('0x35')]('+',_0xc229('0x36'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x3174c4,'If-None-Match':null,'OData-Version':_0xc229('0x1a')},'json':!![]};return rp(_0x36b522);})['then'](function(_0x20594f){var _0x4b4b9f=![];if(!_0x20594f)return _0x4b4b9f;var _0x5df05a=_0x20594f[_0xc229('0x37')];for(var _0x42f6b6=0x0;_0x42f6b6<_0x5df05a['length'];_0x42f6b6++){if(_0x5df05a[_0x42f6b6][_0x4364fc]===_0xb812e3){_0x4b4b9f=!![];_0x1ff476[_0xc229('0x38')]=_0x5df05a[_0x42f6b6][_0xc229('0x39')];}}return _0x4b4b9f;})[_0xc229('0x13')](function(_0x18b615){if(_0x18b615)return _0x1ff476;if(_0x2f10d2===_0xc229('0x3a')){logger['info']('['+[_0x41e710[_0xc229('0x22')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x1ff476;}return createEndUser(_0x1ff476,_0x4bd72d,_0x103a30,_0x567826,_0x49ed34,_0x41e710,_0x4364fc)[_0xc229('0x13')](function(_0x54a37e){logger[_0xc229('0x20')]('['+[_0x41e710[_0xc229('0x22')]()]+_0xc229('0x3b'),_0x54a37e[_0xc229('0x38')]);return _0x54a37e;});});}function getCustomFields(_0x2e6915,_0x4638de,_0x365233){var _0x141ea9={};if(_0x2e6915['length']>0x0){_['forEach'](_0x2e6915,function(_0x19048a){if(_[_0xc229('0x3c')](['string',_0xc229('0x3d')],_0x19048a[_0xc229('0x3e')])&&_0x19048a[_0xc229('0x3f')]&&!_0x19048a[_0xc229('0x40')]){var _0x4ecc3e=_0x19048a[_0xc229('0x41')][_0xc229('0x26')]();var _0x2b4379=_0x4ecc3e[_0xc229('0x2e')](0x0,_0x4ecc3e[_0xc229('0x42')]('_'));var _0x4fb228=_0x4ecc3e[_0xc229('0x2e')](_0x4ecc3e[_0xc229('0x42')]('_')+0x1);if(_0x2b4379===_0x365233){_0x141ea9[_0x4fb228]=_0x19048a['content'];}}});}return _0x141ea9;}function getTicket(_0x412103,_0x483015,_0x505a81,_0x423ad7,_0x30bfbf,_0x365e3d,_0x2d3f44){return new Promise(function(_0x1bd9d5,_0x41418a){var _0x133b30;return getAuthToken(_0x483015,_0x505a81,_0x2d3f44)['then'](function(_0x45648d){if(_0x365e3d['ticketType']===_0xc229('0x43')){_0x133b30={'method':_0xc229('0xd'),'uri':_0x423ad7+_0xc229('0x44'),'body':Object[_0xc229('0x45')]({},{'title':intUtil[_0xc229('0x46')](_0x365e3d[_0xc229('0x47')],_0x30bfbf,'\x20'),'description':intUtil['getString'](_0x365e3d[_0xc229('0x48')],_0x30bfbf,'\x0a'),'customerid_contact@odata.bind':_0x412103[_0xc229('0x38')]?_0xc229('0x49')+_0x412103[_0xc229('0x38')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x412103[_0xc229('0x24')]+')','caseorigincode':'1'},getCustomFields(_0x365e3d[_0xc229('0x4a')],_0x30bfbf,_0x365e3d['ticketType'])),'headers':{'Authorization':_0xc229('0x19')+_0x45648d,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x365e3d[_0xc229('0x4b')]===_0xc229('0x4c')){var _0x3bc2a9=_0x412103[_0xc229('0x38')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x412103[_0xc229('0x24')]+')','participationtypemask':_0x412103[_0xc229('0x4d')]===_0xc229('0x4e')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x412103['enduserId']+')','participationtypemask':_0x412103[_0xc229('0x4d')]===_0xc229('0x4e')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xc229('0x2b')+_0x412103[_0xc229('0x24')]+')','participationtypemask':_0x412103[_0xc229('0x4d')]===_0xc229('0x4e')?0x2:0x1}];_0x133b30={'method':'POST','uri':_0x423ad7+_0xc229('0x4f'),'body':Object[_0xc229('0x45')]({},{'subject':intUtil[_0xc229('0x46')](_0x365e3d['Subjects'],_0x30bfbf,'\x20'),'phonenumber':String(_0x30bfbf[_0xc229('0x29')]),'description':intUtil[_0xc229('0x46')](_0x365e3d[_0xc229('0x48')],_0x30bfbf,'\x0a'),'regardingobjectid_contact@odata.bind':_0x412103[_0xc229('0x38')]?'/contacts('+_0x412103[_0xc229('0x38')]+')':undefined,'ownerid@odata.bind':_0xc229('0x2b')+_0x412103[_0xc229('0x24')]+')','directioncode':_0x412103[_0xc229('0x4d')]===_0xc229('0x4e')?![]:!![],'phonecall_activity_parties':_0x3bc2a9},getCustomFields(_0x365e3d[_0xc229('0x4a')],_0x30bfbf,_0x365e3d[_0xc229('0x4b')])),'headers':{'Authorization':_0xc229('0x19')+_0x45648d,'OData-Version':_0xc229('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x133b30);})[_0xc229('0x13')](function(_0x2ba1c4){var _0x5edfc8=_0x2ba1c4['headers']['odata-entityid'];var _0x5773af=_0x5edfc8[_0xc229('0x2e')](_0x5edfc8['lastIndexOf']('(')+0x1,_0x5edfc8[_0xc229('0x2f')](')'));_0x412103[_0xc229('0x50')]=_0x5773af;_0x1bd9d5(_0x412103);})[_0xc229('0x15')](function(_0x35db2a){_0x41418a(_0x35db2a[_0xc229('0x25')]);});});}function emit(_0x43deb5,_0x1e8243,_0x4b7ef7,_0x262d66){var _0x30b351={'uri':util[_0xc229('0x51')](_0xc229('0x52'),_0x43deb5,_0x4b7ef7,_0x262d66)};io['to'](util[_0xc229('0x51')]('user:%s',_0x1e8243))['emit'](_0xc229('0x53'),_0x30b351);}exports['cs']=function(_0xbd043,_0x2bedde,_0x22efba,_0x3a308a,_0x2aba4f,_0x388378,_0x555a52,_0x41045d){var _0x4e111f={};_0x388378[_0xc229('0xf')]=_0x388378[_0xc229('0x8')]?intUtil[_0xc229('0x54')](_0x388378[_0xc229('0x9')][_0xc229('0x55')]):intUtil['stripTrailingSlash'](_0x388378[_0xc229('0xf')]);_0x388378[_0xc229('0x56')]=intUtil[_0xc229('0x54')](_0x388378[_0xc229('0x56')]);_0x4e111f['callDirection']=_0x41045d==='queue'||_0x41045d===_0xc229('0x57')?_0xc229('0x4e'):_0xc229('0x27');var _0x354f44=_0x388378['modernAuthentication']?util['format'](_0xc229('0x58'),_0x388378['CloudProvider'][_0xc229('0x55')]):util['format'](_0xc229('0x58'),_0x388378[_0xc229('0xf')]);var _0x33e931=util[_0xc229('0x51')]('https://login.microsoftonline.com/%s/oauth2/token',_0x388378[_0xc229('0x59')]);var _0x3ff65c=util[_0xc229('0x51')](_0xc229('0x5a'),_0x388378[_0xc229('0x56')],_0x2bedde[_0xc229('0x5b')],md5(_0x2bedde[_0xc229('0x5b')]));if(_0x2aba4f&&_0x2aba4f[_0xc229('0x5c')]){logger[_0xc229('0x20')](_0xc229('0x5d'),_0xc229('0x5e'));_0x2bedde[_0xc229('0x5f')]=_0x3ff65c;}else if(_0x555a52&&_0x555a52[_0xc229('0x60')]&&_0x555a52[_0xc229('0x60')]!=='none'){logger['info'](_0xc229('0x61'),'Recording\x20is\x20enabled!');_0x2bedde[_0xc229('0x5f')]=_0x3ff65c;}else{_0x2bedde[_0xc229('0x5f')]='';}return getUser(_0x4e111f,_0x388378,_0x3a308a,_0x33e931,_0x354f44,_0x41045d)[_0xc229('0x13')](function(_0x45ec8d){logger[_0xc229('0x20')]('['+_0x41045d[_0xc229('0x22')]()+_0xc229('0x62'),_0x45ec8d['userId']);logger['info']('['+_0x41045d[_0xc229('0x22')]()+_0xc229('0x63'),_0x45ec8d[_0xc229('0x1d')]);return getEndUser(_0x45ec8d,_0x388378,_0x33e931,_0x354f44,_0x2bedde,_0x41045d,_0x22efba[_0xc229('0x64')],_0x22efba[_0xc229('0x65')]);})[_0xc229('0x13')](function(_0x3e0451){logger[_0xc229('0x20')]('['+_0x41045d[_0xc229('0x22')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x3e0451['enduserId']);logger['info']('['+_0x41045d[_0xc229('0x22')]()+_0xc229('0x66'),_0x2bedde[_0xc229('0x29')]);return getTicket(_0x3e0451,_0x388378,_0x33e931,_0x354f44,_0x2bedde,_0x22efba,_0x41045d);})[_0xc229('0x13')](function(_0xbdb4b9){logger[_0xc229('0x20')](util[_0xc229('0x51')]('['+_0x41045d[_0xc229('0x22')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x22efba['ticketType'],_0xbdb4b9[_0xc229('0x50')]));logger[_0xc229('0x20')](util['format']('['+_0x41045d['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0x41045d));if(_0x41045d!==_0xc229('0x57')&&_0x22efba[_0xc229('0x67')]){logger[_0xc229('0x20')]('['+_0x41045d[_0xc229('0x22')]()+']',_0xc229('0x68'));emit(_0x388378['remoteUri'],_0x3a308a[_0xc229('0x69')],_0x22efba[_0xc229('0x4b')],_0xbdb4b9[_0xc229('0x50')]);}})[_0xc229('0x15')](function(_0x32e0ce){logger[_0xc229('0x16')]('['+_0x41045d[_0xc229('0x22')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x32e0ce[_0xc229('0x25')]);console[_0xc229('0x16')]('Error\x20running\x20Dynamics365\x20integration',_0x32e0ce);});}; \ 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 79d0bbf..a156eab 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 _0xf757=['The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','trigger:browser:url','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!','Ticket\x20created!','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','value','format','%s/api/v2/tickets','remoteUri','POST','then','validateEmail','%s/api/v2/agents','length','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','string','picklist','type','nameField','toLowerCase','content','idField','customField','push','variableName','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:'];(function(_0x52cede,_0x4a77e3){var _0x2f1045=function(_0xc99af5){while(--_0xc99af5){_0x52cede['push'](_0x52cede['shift']());}};_0x2f1045(++_0x4a77e3);}(_0xf757,0x127));var _0x7f75=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0xf757[_0xd0a847];return _0x2536ec;};'use strict';var _=require(_0x7f75('0x0'));var rp=require(_0x7f75('0x1'));var md5=require(_0x7f75('0x2'));var util=require(_0x7f75('0x3'));var Redis=require(_0x7f75('0x4'));var intUtil=require(_0x7f75('0x5'));var config=require('../../../../config/environment');var logger=require(_0x7f75('0x6'))('freshdesk');config[_0x7f75('0x7')]=_['defaults'](config[_0x7f75('0x7')],{'host':_0x7f75('0x8'),'port':0x18eb});var io=require(_0x7f75('0x9'))(new Redis(config[_0x7f75('0x7')]));var headers={'Content-Type':_0x7f75('0xa'),'Accept':_0x7f75('0xa')};function emit(_0x252d20,_0x3ab247,_0xacc0b3){io['to'](_0x252d20)['emit'](_0x3ab247,_0xacc0b3);}function getTicket(_0x14893c,_0x5b30d6,_0x22343c,_0xcb14f8,_0x52025b){logger[_0x7f75('0xb')](_0x7f75('0xc'));var _0x42b3b5=_['merge']({'responder_id':_0x5b30d6['id'],'requester_id':_0x22343c['id'],'name':util['format'](_0x7f75('0xd'),_0x52025b[_0x7f75('0xe')]),'phone':_0x52025b[_0x7f75('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x7f75('0x10')](_0xcb14f8[_0x7f75('0x11')],_0x52025b,'\x20'),'description':intUtil['getString'](_0xcb14f8[_0x7f75('0x12')],_0x52025b,_0x7f75('0x13')),'tags':getTags(_0xcb14f8[_0x7f75('0x14')],_0x7f75('0x15'))},getCustomFields(_0xcb14f8[_0x7f75('0x16')],_0x52025b));_0x42b3b5[_0x7f75('0x17')]=_[_0x7f75('0x18')](_['keyBy'](_0x42b3b5[_0x7f75('0x17')],'id'),_0x7f75('0x19'));return request({'uri':util[_0x7f75('0x1a')](_0x7f75('0x1b'),_0x14893c[_0x7f75('0x1c')]),'method':_0x7f75('0x1d'),'body':_0x42b3b5})[_0x7f75('0x1e')](function(_0x29cf60){logger['info']('Ticket\x20created!');return _0x29cf60;});}function getUser(_0x44fb0e,_0x46c3c6){if(intUtil[_0x7f75('0x1f')](_0x46c3c6)){return request({'uri':util[_0x7f75('0x1a')](_0x7f75('0x20'),_0x44fb0e[_0x7f75('0x1c')]),'qs':{'email':_0x46c3c6}})[_0x7f75('0x1e')](function(_0x307f0d){if(_0x307f0d[_0x7f75('0x21')]){logger[_0x7f75('0xb')]('Agent\x20found!');return _[_0x7f75('0x22')](_0x307f0d,function(_0x347e74){return _0x347e74[_0x7f75('0x23')]['email']===_0x46c3c6;});}else{logger[_0x7f75('0xb')](_0x7f75('0x24'));return request({'uri':util[_0x7f75('0x1a')](_0x7f75('0x25'),_0x44fb0e[_0x7f75('0x1c')])})['then'](function(_0x47b2d5){logger['info']('Admin\x20account\x20selected.');return _0x47b2d5;});}});}else{logger['info'](_0x7f75('0x26'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x44fb0e[_0x7f75('0x1c')])})[_0x7f75('0x1e')](function(_0x2dae95){logger[_0x7f75('0xb')]('Admin\x20account\x20selected.');return _0x2dae95;});}}function getEndUser(_0x4dd24c,_0x48455c,_0x3e18f2){logger[_0x7f75('0xb')](_0x7f75('0x27'),_0x3e18f2);return request({'uri':util[_0x7f75('0x1a')]('%s/api/v2/contacts',_0x4dd24c['remoteUri']),'qs':{'phone':_0x3e18f2}})[_0x7f75('0x1e')](function(_0x5360b9){if(_0x5360b9[_0x7f75('0x21')]){logger[_0x7f75('0xb')]('Enduser\x20found!');return _[_0x7f75('0x22')](_0x5360b9,{'phone':_0x3e18f2});}else{logger[_0x7f75('0xb')](_0x7f75('0x28'));return request({'uri':util[_0x7f75('0x1a')](_0x7f75('0x29'),_0x4dd24c['remoteUri']),'method':_0x7f75('0x1d'),'body':{'name':_0x48455c,'phone':_0x3e18f2}})[_0x7f75('0x1e')](function(_0x5732e7){logger[_0x7f75('0xb')](_0x7f75('0x2a'));return _0x5732e7;});}});}function getAuth(_0x763c0d){return util[_0x7f75('0x1a')](_0x7f75('0x2b'),new Buffer(_0x763c0d[_0x7f75('0x2c')]+':X')[_0x7f75('0x2d')](_0x7f75('0x2e')));}function request(_0x3bfda0){logger[_0x7f75('0x2f')](_0x7f75('0x30'),JSON[_0x7f75('0x31')](_0x3bfda0));return rp(_[_0x7f75('0x32')](_0x3bfda0,{'method':_0x7f75('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x363a9a,_0x56e2a1){var _0xb7cdc8=[];if(_0x363a9a&&_0x363a9a[_0x7f75('0x21')]>0x0){_0xb7cdc8=_[_0x7f75('0x34')](_0x363a9a,_0x56e2a1);}return _0xb7cdc8;}function getCustomFields(_0x512519,_0x494566){var _0x73bc60=[];var _0x37e815={'custom_fields':[]};if(_0x512519[_0x7f75('0x21')]>0x0){_[_0x7f75('0x35')](_0x512519,function(_0x4fc785){if(_['includes']([_0x7f75('0x36'),_0x7f75('0x37')],_0x4fc785[_0x7f75('0x38')])&&_0x4fc785[_0x7f75('0x39')]&&!_0x4fc785['customField']){_0x37e815[_0x4fc785[_0x7f75('0x39')][_0x7f75('0x3a')]()]=_0x4fc785[_0x7f75('0x3b')][_0x7f75('0x2d')]();}else if(_['includes']([_0x7f75('0x36'),_0x7f75('0x37')],_0x4fc785[_0x7f75('0x38')])&&_0x4fc785[_0x7f75('0x3c')]&&_0x4fc785[_0x7f75('0x3d')]){_0x37e815[_0x7f75('0x17')][_0x7f75('0x3e')]({'id':_0x4fc785[_0x7f75('0x3c')],'value':_0x4fc785[_0x7f75('0x3b')][_0x7f75('0x2d')]()});}else if(_0x4fc785[_0x7f75('0x38')]==='variable'&&_0x4fc785[_0x7f75('0x3f')]&&_0x4fc785[_0x7f75('0x3c')]&&_0x4fc785[_0x7f75('0x3d')]){_0x494566[_0x4fc785[_0x7f75('0x3f')]]&&_0x37e815[_0x7f75('0x17')]['push']({'id':_0x4fc785['idField'],'value':_0x494566[_0x4fc785[_0x7f75('0x3f')]][_0x7f75('0x2d')]()});}else if(_0x4fc785[_0x7f75('0x38')]==='customVariable'&&_0x4fc785[_0x7f75('0x40')]&&_0x4fc785[_0x7f75('0x40')][_0x7f75('0x15')]&&_0x4fc785[_0x7f75('0x3c')]&&_0x4fc785[_0x7f75('0x3d')]){_0x494566[_0x4fc785['Variable'][_0x7f75('0x15')][_0x7f75('0x3a')]()]&&_0x37e815[_0x7f75('0x17')]['push']({'id':_0x4fc785[_0x7f75('0x3c')],'value':_0x494566[_0x4fc785[_0x7f75('0x40')][_0x7f75('0x15')]['toLowerCase']()][_0x7f75('0x2d')]()});}});}return _0x37e815;}exports[_0x7f75('0x41')]=function(_0x3da43d,_0x46f6f3,_0x5b9f80,_0x3220be,_0x1ee1c3,_0x110b23){var _0x2e834f,_0x5bcb20;_0x110b23['remoteUri']=intUtil[_0x7f75('0x42')](_0x110b23['remoteUri']);_0x110b23[_0x7f75('0x43')]=intUtil[_0x7f75('0x42')](_0x110b23[_0x7f75('0x43')]);if(_0x1ee1c3&&_0x1ee1c3[_0x7f75('0x44')]){logger[_0x7f75('0xb')](_0x7f75('0x45'),'Recording\x20is\x20enabled!');_0x46f6f3[_0x7f75('0x46')]=util['format'](_0x7f75('0x47'),_0x110b23[_0x7f75('0x43')],_0x46f6f3[_0x7f75('0x48')],md5(_0x46f6f3[_0x7f75('0x48')]));}else{_0x46f6f3['recordingURL']='';}headers[_0x7f75('0x49')]=getAuth(_0x110b23);return getUser(_0x110b23,_0x3220be[_0x7f75('0x4a')])[_0x7f75('0x1e')](function(_0x29eade){_0x2e834f=_0x29eade;logger[_0x7f75('0xb')](_0x7f75('0x4b'),_0x2e834f['id']);return getEndUser(_0x110b23,_0x46f6f3[_0x7f75('0xe')],_0x46f6f3[_0x7f75('0xf')]);})[_0x7f75('0x1e')](function(_0x4b74f9){_0x5bcb20=_0x4b74f9;logger['info'](_0x7f75('0x4c'),_0x5bcb20['id']);return getTicket(_0x110b23,_0x2e834f,_0x5bcb20,_0x5b9f80,_0x46f6f3);})[_0x7f75('0x1e')](function(_0x2b6675){if(_0x2b6675&&_0x2b6675['id']){logger[_0x7f75('0xb')]('Ticket\x20created!');logger[_0x7f75('0xb')](_0x7f75('0x4d'),_0x2b6675['id']);logger[_0x7f75('0xb')](_0x7f75('0x45'),_0x7f75('0x4e'));emit(util['format'](_0x7f75('0x4f'),_0x3220be[_0x7f75('0x15')]),'trigger:browser:url',{'uri':util[_0x7f75('0x1a')]('%s/helpdesk/tickets/%d',_0x110b23['remoteUri'],_0x2b6675['id'])});}})[_0x7f75('0x50')](function(_0x16613e){logger[_0x7f75('0x51')](_0x7f75('0x45'),JSON['stringify'](_0x16613e));});};exports[_0x7f75('0x52')]=function(_0x284613,_0x444aa1,_0x8d97d6,_0x407a73,_0x592e95,_0xde892b,_0x33f067){var _0x253075,_0x5f289b;_0xde892b['remoteUri']=intUtil['stripTrailingSlash'](_0xde892b['remoteUri']);_0xde892b['serverUrl']=intUtil[_0x7f75('0x42')](_0xde892b[_0x7f75('0x43')]);if(_0x33f067&&_0x33f067[_0x7f75('0x53')]&&_0x33f067[_0x7f75('0x53')]!==_0x7f75('0x54')){logger['info'](_0x7f75('0x55'),'Recording\x20is\x20enabled!');_0x444aa1[_0x7f75('0x46')]=util[_0x7f75('0x1a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xde892b['serverUrl'],_0x444aa1[_0x7f75('0x48')],md5(_0x444aa1['uniqueid']));}headers['Authorization']=getAuth(_0xde892b);return getUser(_0xde892b,_0x407a73[_0x7f75('0x4a')])[_0x7f75('0x1e')](function(_0x5b7ff7){_0x253075=_0x5b7ff7;logger[_0x7f75('0xb')](_0x7f75('0x4b'),_0x253075['id']);return getEndUser(_0xde892b,_0x444aa1[_0x7f75('0x56')],_0x444aa1['destcalleridnum']);})['then'](function(_0x41de3f){_0x5f289b=_0x41de3f;logger[_0x7f75('0xb')](_0x7f75('0x4c'),_0x5f289b['id']);return getTicket(_0xde892b,_0x253075,_0x5f289b,_0x8d97d6,_0x444aa1);})[_0x7f75('0x1e')](function(_0x39c87a){if(_0x39c87a&&_0x39c87a['id']){logger[_0x7f75('0xb')]('Ticket\x20created!');logger[_0x7f75('0xb')]('The\x20Ticket\x20ID\x20is:',_0x39c87a['id']);logger[_0x7f75('0xb')](_0x7f75('0x55'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7f75('0x1a')](_0x7f75('0x4f'),_0x407a73['name']),_0x7f75('0x57'),{'uri':util[_0x7f75('0x1a')]('%s/helpdesk/tickets/%d',_0xde892b[_0x7f75('0x1c')],_0x39c87a['id'])});}})[_0x7f75('0x50')](function(_0x59d793){logger['error'](_0x7f75('0x55'),JSON[_0x7f75('0x31')](_0x59d793));});};exports[_0x7f75('0x58')]=function(_0x18293b,_0x38d6de,_0x29d7cc,_0x581bd0,_0x38268e,_0x316146){var _0x354605,_0x1c9aa2;_0x316146[_0x7f75('0x1c')]=intUtil['stripTrailingSlash'](_0x316146[_0x7f75('0x1c')]);_0x316146['serverUrl']=intUtil['stripTrailingSlash'](_0x316146[_0x7f75('0x43')]);if(_0x38268e&&_0x38268e['monitor_format']){logger['info']('['+_0x38d6de[_0x7f75('0x59')][_0x7f75('0x5a')]()+']',_0x7f75('0x5b'));_0x38d6de[_0x7f75('0x46')]=util[_0x7f75('0x1a')](_0x7f75('0x47'),_0x316146['serverUrl'],_0x38d6de['uniqueid'],md5(_0x38d6de['uniqueid']));}else{_0x38d6de['recordingURL']='';}headers[_0x7f75('0x49')]=getAuth(_0x316146);return getUser(_0x316146,'')[_0x7f75('0x1e')](function(_0x12f455){_0x354605=_0x12f455;logger['info']('The\x20User\x20ID\x20is:',_0x354605['id']);return getEndUser(_0x316146,_0x38d6de[_0x7f75('0xe')],_0x38d6de[_0x7f75('0xf')]);})[_0x7f75('0x1e')](function(_0x366338){_0x1c9aa2=_0x366338;logger[_0x7f75('0xb')](_0x7f75('0x4c'),_0x1c9aa2['id']);return getTicket(_0x316146,_0x354605,_0x1c9aa2,_0x29d7cc,_0x38d6de);})['then'](function(_0x508957){if(_0x508957){logger[_0x7f75('0xb')](_0x7f75('0x5c'));logger[_0x7f75('0xb')]('The\x20Ticket\x20ID\x20is:',_0x508957['id']);}})[_0x7f75('0x50')](function(_0x4f3e2a){logger[_0x7f75('0x51')]('['+_0x38d6de[_0x7f75('0x59')]['toUpperCase']()+']',JSON[_0x7f75('0x31')](_0x4f3e2a));});}; \ No newline at end of file +var _0xc136=['monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','toUpperCase','lodash','md5','util','ioredis','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridnum','Subjects','getString','Descriptions','Tags','Fields','mapValues','keyBy','custom_fields','value','%s/api/v2/tickets','remoteUri','POST','then','info','Ticket\x20created!','validateEmail','length','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','base64','stringify','map','forEach','includes','string','type','nameField','customField','content','toString','picklist','idField','push','variableName','customVariable','Variable','toLowerCase','name','stripTrailingSlash','serverUrl'];(function(_0x170772,_0x1f1ee7){var _0x3ef69c=function(_0x4cde12){while(--_0x4cde12){_0x170772['push'](_0x170772['shift']());}};_0x3ef69c(++_0x1f1ee7);}(_0xc136,0x6f));var _0x6c13=function(_0x58619b,_0x6bd8c7){_0x58619b=_0x58619b-0x0;var _0x507201=_0xc136[_0x58619b];return _0x507201;};'use strict';var _=require(_0x6c13('0x0'));var rp=require('request-promise');var md5=require(_0x6c13('0x1'));var util=require(_0x6c13('0x2'));var Redis=require(_0x6c13('0x3'));var intUtil=require(_0x6c13('0x4'));var config=require('../../../../config/environment');var logger=require(_0x6c13('0x5'))('freshdesk');config[_0x6c13('0x6')]=_[_0x6c13('0x7')](config[_0x6c13('0x6')],{'host':_0x6c13('0x8'),'port':0x18eb});var io=require(_0x6c13('0x9'))(new Redis(config['redis']));var headers={'Content-Type':_0x6c13('0xa'),'Accept':_0x6c13('0xa')};function emit(_0x1e0b5f,_0x39191d,_0x181f30){io['to'](_0x1e0b5f)[_0x6c13('0xb')](_0x39191d,_0x181f30);}function getTicket(_0x18d1aa,_0x4951cb,_0xf145d0,_0x5c4de5,_0x25d937){logger['info'](_0x6c13('0xc'));var _0x2b3b6c=_['merge']({'responder_id':_0x4951cb['id'],'requester_id':_0xf145d0['id'],'name':util[_0x6c13('0xd')](_0x6c13('0xe'),_0x25d937['calleridname']),'phone':_0x25d937[_0x6c13('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x5c4de5[_0x6c13('0x10')],_0x25d937,'\x20'),'description':intUtil[_0x6c13('0x11')](_0x5c4de5[_0x6c13('0x12')],_0x25d937,'
'),'tags':getTags(_0x5c4de5[_0x6c13('0x13')],'name')},getCustomFields(_0x5c4de5[_0x6c13('0x14')],_0x25d937));_0x2b3b6c['custom_fields']=_[_0x6c13('0x15')](_[_0x6c13('0x16')](_0x2b3b6c[_0x6c13('0x17')],'id'),_0x6c13('0x18'));return request({'uri':util[_0x6c13('0xd')](_0x6c13('0x19'),_0x18d1aa[_0x6c13('0x1a')]),'method':_0x6c13('0x1b'),'body':_0x2b3b6c})[_0x6c13('0x1c')](function(_0x2ead3c){logger[_0x6c13('0x1d')](_0x6c13('0x1e'));return _0x2ead3c;});}function getUser(_0x555517,_0x32b81b){if(intUtil[_0x6c13('0x1f')](_0x32b81b)){return request({'uri':util['format']('%s/api/v2/agents',_0x555517[_0x6c13('0x1a')]),'qs':{'email':_0x32b81b}})['then'](function(_0x532063){if(_0x532063[_0x6c13('0x20')]){logger[_0x6c13('0x1d')](_0x6c13('0x21'));return _[_0x6c13('0x22')](_0x532063,function(_0x2350e6){return _0x2350e6[_0x6c13('0x23')][_0x6c13('0x24')]===_0x32b81b;});}else{logger[_0x6c13('0x1d')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x6c13('0xd')](_0x6c13('0x25'),_0x555517[_0x6c13('0x1a')])})[_0x6c13('0x1c')](function(_0x5c0a15){logger[_0x6c13('0x1d')](_0x6c13('0x26'));return _0x5c0a15;});}});}else{logger[_0x6c13('0x1d')](_0x6c13('0x27'));return request({'uri':util[_0x6c13('0xd')]('%s/api/v2/agents/me',_0x555517['remoteUri'])})[_0x6c13('0x1c')](function(_0x1e310b){logger[_0x6c13('0x1d')](_0x6c13('0x26'));return _0x1e310b;});}}function getEndUser(_0x27c44e,_0x2ba87b,_0x41b34f){logger[_0x6c13('0x1d')]('Searching\x20enduser\x20with\x20phone',_0x41b34f);return request({'uri':util[_0x6c13('0xd')](_0x6c13('0x28'),_0x27c44e[_0x6c13('0x1a')]),'qs':{'phone':_0x41b34f}})[_0x6c13('0x1c')](function(_0x38a60f){if(_0x38a60f['length']){logger[_0x6c13('0x1d')]('Enduser\x20found!');return _['find'](_0x38a60f,{'phone':_0x41b34f});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x6c13('0xd')]('%s/api/v2/contacts',_0x27c44e[_0x6c13('0x1a')]),'method':_0x6c13('0x1b'),'body':{'name':_0x2ba87b,'phone':_0x41b34f}})[_0x6c13('0x1c')](function(_0x23a399){logger[_0x6c13('0x1d')](_0x6c13('0x29'));return _0x23a399;});}});}function getAuth(_0x56a44d){return util['format'](_0x6c13('0x2a'),new Buffer(_0x56a44d[_0x6c13('0x2b')]+':X')['toString'](_0x6c13('0x2c')));}function request(_0x4424ec){logger['debug']('[HTTP]',JSON[_0x6c13('0x2d')](_0x4424ec));return rp(_[_0x6c13('0x7')](_0x4424ec,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x225d53,_0x528621){var _0x302419=[];if(_0x225d53&&_0x225d53[_0x6c13('0x20')]>0x0){_0x302419=_[_0x6c13('0x2e')](_0x225d53,_0x528621);}return _0x302419;}function getCustomFields(_0x8bba3c,_0xcdab2d){var _0x4eb2d4=[];var _0x411cb7={'custom_fields':[]};if(_0x8bba3c[_0x6c13('0x20')]>0x0){_[_0x6c13('0x2f')](_0x8bba3c,function(_0x2c6f25){if(_[_0x6c13('0x30')]([_0x6c13('0x31'),'picklist'],_0x2c6f25[_0x6c13('0x32')])&&_0x2c6f25[_0x6c13('0x33')]&&!_0x2c6f25[_0x6c13('0x34')]){_0x411cb7[_0x2c6f25['nameField']['toLowerCase']()]=_0x2c6f25[_0x6c13('0x35')][_0x6c13('0x36')]();}else if(_['includes']([_0x6c13('0x31'),_0x6c13('0x37')],_0x2c6f25['type'])&&_0x2c6f25[_0x6c13('0x38')]&&_0x2c6f25[_0x6c13('0x34')]){_0x411cb7['custom_fields'][_0x6c13('0x39')]({'id':_0x2c6f25[_0x6c13('0x38')],'value':_0x2c6f25[_0x6c13('0x35')][_0x6c13('0x36')]()});}else if(_0x2c6f25['type']==='variable'&&_0x2c6f25[_0x6c13('0x3a')]&&_0x2c6f25['idField']&&_0x2c6f25[_0x6c13('0x34')]){_0xcdab2d[_0x2c6f25[_0x6c13('0x3a')]]&&_0x411cb7[_0x6c13('0x17')][_0x6c13('0x39')]({'id':_0x2c6f25[_0x6c13('0x38')],'value':_0xcdab2d[_0x2c6f25['variableName']][_0x6c13('0x36')]()});}else if(_0x2c6f25['type']===_0x6c13('0x3b')&&_0x2c6f25[_0x6c13('0x3c')]&&_0x2c6f25['Variable']['name']&&_0x2c6f25[_0x6c13('0x38')]&&_0x2c6f25[_0x6c13('0x34')]){_0xcdab2d[_0x2c6f25[_0x6c13('0x3c')]['name'][_0x6c13('0x3d')]()]&&_0x411cb7['custom_fields'][_0x6c13('0x39')]({'id':_0x2c6f25['idField'],'value':_0xcdab2d[_0x2c6f25[_0x6c13('0x3c')][_0x6c13('0x3e')][_0x6c13('0x3d')]()][_0x6c13('0x36')]()});}});}return _0x411cb7;}exports['queue']=function(_0x2d6a58,_0x407be6,_0x3755ef,_0x59e5c9,_0x168020,_0x128169){var _0xfea20b,_0xbe50df;_0x128169[_0x6c13('0x1a')]=intUtil[_0x6c13('0x3f')](_0x128169[_0x6c13('0x1a')]);_0x128169[_0x6c13('0x40')]=intUtil[_0x6c13('0x3f')](_0x128169['serverUrl']);if(_0x168020&&_0x168020[_0x6c13('0x41')]){logger[_0x6c13('0x1d')](_0x6c13('0x42'),'Recording\x20is\x20enabled!');_0x407be6[_0x6c13('0x43')]=util[_0x6c13('0xd')](_0x6c13('0x44'),_0x128169['serverUrl'],_0x407be6[_0x6c13('0x45')],md5(_0x407be6['uniqueid']));}else{_0x407be6[_0x6c13('0x43')]='';}headers[_0x6c13('0x46')]=getAuth(_0x128169);return getUser(_0x128169,_0x59e5c9[_0x6c13('0x24')])[_0x6c13('0x1c')](function(_0x313082){_0xfea20b=_0x313082;logger['info']('The\x20User\x20ID\x20is:',_0xfea20b['id']);return getEndUser(_0x128169,_0x407be6[_0x6c13('0x47')],_0x407be6[_0x6c13('0xf')]);})['then'](function(_0x35f5fc){_0xbe50df=_0x35f5fc;logger[_0x6c13('0x1d')](_0x6c13('0x48'),_0xbe50df['id']);return getTicket(_0x128169,_0xfea20b,_0xbe50df,_0x3755ef,_0x407be6);})[_0x6c13('0x1c')](function(_0x46a545){if(_0x46a545&&_0x46a545['id']){logger[_0x6c13('0x1d')](_0x6c13('0x1e'));logger['info'](_0x6c13('0x49'),_0x46a545['id']);logger['info'](_0x6c13('0x42'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x6c13('0x4a'),_0x59e5c9['name']),_0x6c13('0x4b'),{'uri':util['format'](_0x6c13('0x4c'),_0x128169[_0x6c13('0x1a')],_0x46a545['id'])});}})[_0x6c13('0x4d')](function(_0x162a02){logger[_0x6c13('0x4e')]('[QUEUE]',JSON[_0x6c13('0x2d')](_0x162a02));});};exports[_0x6c13('0x4f')]=function(_0x3a286d,_0x3031ce,_0x1dad5a,_0x5a1797,_0x15d8f7,_0x2c7ac9,_0x5e244d){var _0x13025a,_0x22cb7a;_0x2c7ac9['remoteUri']=intUtil[_0x6c13('0x3f')](_0x2c7ac9[_0x6c13('0x1a')]);_0x2c7ac9[_0x6c13('0x40')]=intUtil['stripTrailingSlash'](_0x2c7ac9['serverUrl']);if(_0x5e244d&&_0x5e244d['recordingFormat']&&_0x5e244d['recordingFormat']!==_0x6c13('0x50')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3031ce['recordingURL']=util[_0x6c13('0xd')](_0x6c13('0x44'),_0x2c7ac9[_0x6c13('0x40')],_0x3031ce['uniqueid'],md5(_0x3031ce[_0x6c13('0x45')]));}headers[_0x6c13('0x46')]=getAuth(_0x2c7ac9);return getUser(_0x2c7ac9,_0x5a1797[_0x6c13('0x24')])[_0x6c13('0x1c')](function(_0x3b02dc){_0x13025a=_0x3b02dc;logger[_0x6c13('0x1d')](_0x6c13('0x51'),_0x13025a['id']);return getEndUser(_0x2c7ac9,_0x3031ce[_0x6c13('0x52')],_0x3031ce[_0x6c13('0x53')]);})[_0x6c13('0x1c')](function(_0x99c366){_0x22cb7a=_0x99c366;logger[_0x6c13('0x1d')]('The\x20Enduser\x20ID\x20is:',_0x22cb7a['id']);return getTicket(_0x2c7ac9,_0x13025a,_0x22cb7a,_0x1dad5a,_0x3031ce);})[_0x6c13('0x1c')](function(_0x534bab){if(_0x534bab&&_0x534bab['id']){logger[_0x6c13('0x1d')]('Ticket\x20created!');logger[_0x6c13('0x1d')](_0x6c13('0x49'),_0x534bab['id']);logger[_0x6c13('0x1d')](_0x6c13('0x54'),_0x6c13('0x55'));emit(util[_0x6c13('0xd')](_0x6c13('0x4a'),_0x5a1797[_0x6c13('0x3e')]),_0x6c13('0x4b'),{'uri':util[_0x6c13('0xd')](_0x6c13('0x4c'),_0x2c7ac9[_0x6c13('0x1a')],_0x534bab['id'])});}})[_0x6c13('0x4d')](function(_0x590d58){logger[_0x6c13('0x4e')](_0x6c13('0x54'),JSON[_0x6c13('0x2d')](_0x590d58));});};exports[_0x6c13('0x56')]=function(_0x4ec37d,_0x3d4368,_0x549f8e,_0x4bac0b,_0x18ed00,_0x7af771){var _0x11ab0e,_0x1a005f;_0x7af771[_0x6c13('0x1a')]=intUtil['stripTrailingSlash'](_0x7af771[_0x6c13('0x1a')]);_0x7af771[_0x6c13('0x40')]=intUtil[_0x6c13('0x3f')](_0x7af771[_0x6c13('0x40')]);if(_0x18ed00&&_0x18ed00[_0x6c13('0x41')]){logger[_0x6c13('0x1d')]('['+_0x3d4368['lastevent'][_0x6c13('0x57')]()+']','Recording\x20is\x20enabled!');_0x3d4368[_0x6c13('0x43')]=util[_0x6c13('0xd')](_0x6c13('0x44'),_0x7af771[_0x6c13('0x40')],_0x3d4368['uniqueid'],md5(_0x3d4368[_0x6c13('0x45')]));}else{_0x3d4368[_0x6c13('0x43')]='';}headers[_0x6c13('0x46')]=getAuth(_0x7af771);return getUser(_0x7af771,'')[_0x6c13('0x1c')](function(_0x35ce4d){_0x11ab0e=_0x35ce4d;logger['info'](_0x6c13('0x51'),_0x11ab0e['id']);return getEndUser(_0x7af771,_0x3d4368[_0x6c13('0x47')],_0x3d4368['calleridnum']);})['then'](function(_0x3197bf){_0x1a005f=_0x3197bf;logger[_0x6c13('0x1d')]('The\x20Enduser\x20ID\x20is:',_0x1a005f['id']);return getTicket(_0x7af771,_0x11ab0e,_0x1a005f,_0x549f8e,_0x3d4368);})[_0x6c13('0x1c')](function(_0xceffed){if(_0xceffed){logger[_0x6c13('0x1d')](_0x6c13('0x1e'));logger[_0x6c13('0x1d')](_0x6c13('0x49'),_0xceffed['id']);}})['catch'](function(_0x11a65c){logger[_0x6c13('0x4e')]('['+_0x3d4368['lastevent']['toUpperCase']()+']',JSON[_0x6c13('0x2d')](_0x11a65c));});}; \ 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 030da24..5f0505a 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 _0x60d1=['message','Getting\x20user\x20list','then','agentEmail','userId','User\x20found:','Admin\x20selected','userEmail','error','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','YYYY-MM-DDTHH:mm:ss','ticketId','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','serverUrl','stripTrailingSlash','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','defaults','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x60d1,0x1a6));var _0x160d=function(_0x48be78,_0x53dd6a){_0x48be78=_0x48be78-0x0;var _0x521f10=_0x60d1[_0x48be78];return _0x521f10;};'use strict';var _=require(_0x160d('0x0'));var rp=require(_0x160d('0x1'));var md5=require(_0x160d('0x2'));var util=require('util');var moment=require(_0x160d('0x3'));var Promise=require(_0x160d('0x4'));var Redis=require(_0x160d('0x5'));var intUtil=require(_0x160d('0x6'));var config=require(_0x160d('0x7'));var logger=require(_0x160d('0x8'))(_0x160d('0x9'));config['redis']=_[_0x160d('0xa')](config[_0x160d('0xb')],{'host':_0x160d('0xc'),'port':0x18eb});var io=require(_0x160d('0xd'))(new Redis(config[_0x160d('0xb')]));function getAdminId(_0x3b5efa,_0x348d54,_0x210c2b,_0xfffbd){return new Promise(function(_0x2fbe3d,_0x166bbe){var _0x25528d=![];var _0x2c83dc={'method':_0x160d('0xe'),'uri':_0xfffbd+_0x160d('0xf'),'json':!![]};_0x2c83dc[_0x160d('0x10')]=_0x210c2b;logger[_0x160d('0x11')](_0x160d('0x12'));return rp(_0x2c83dc)['then'](function(_0x1c0def){if(_0x1c0def){var _0x334966=_0x1c0def[_0x160d('0x13')];var _0x5d006b=null;for(_0x5d006b=0x0;_0x5d006b<_0x334966[_0x160d('0x14')];_0x5d006b++){if(_0x334966[_0x5d006b][_0x160d('0x15')]===_0x3b5efa[_0x160d('0x16')]){_0x3b5efa[_0x160d('0x17')]=_0x334966[_0x5d006b]['id'];_0x25528d=!![];}}if(_0x25528d){logger[_0x160d('0x11')](_0x160d('0x18'),_0x3b5efa[_0x160d('0x17')]);_0x2fbe3d(_0x3b5efa);}else{_0x166bbe({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x166bbe({'statusCode':0x194,'message':_0x160d('0x19')});}})[_0x160d('0x1a')](function(_0x54fd08){logger['error']('['+[_0x348d54[_0x160d('0x1b')]()]+']',_0x54fd08[_0x160d('0x1c')]);_0x166bbe(_0x54fd08);});});}function getUser(_0x380c05,_0x13158d,_0x32eee8){return function(_0xf8b018){return new Promise(function(_0x37eafe,_0xb9d227){var _0x23f8c6={'method':_0x160d('0xe'),'uri':_0x32eee8+_0x160d('0xf'),'json':!![]};_0x23f8c6['headers']=_0x13158d;logger[_0x160d('0x11')](_0x160d('0x1d'));return rp(_0x23f8c6)[_0x160d('0x1e')](function(_0x553461){if(_0x553461){var _0x123f9f=_0x553461[_0x160d('0x13')];var _0x1fc413=![];var _0x3404e4=null;if(_0xf8b018['agentEmail']!==null){logger[_0x160d('0x11')]('Getting\x20user\x20with\x20email',_0xf8b018['agentEmail']);_0xf8b018['userEmail']=_0xf8b018[_0x160d('0x1f')];for(_0x3404e4=0x0;_0x3404e4<_0x123f9f['length'];_0x3404e4++){if(_0x123f9f[_0x3404e4][_0x160d('0x15')]===_0xf8b018[_0x160d('0x1f')]){_0x1fc413=!![];_0xf8b018[_0x160d('0x20')]=_0x123f9f[_0x3404e4]['id'];logger[_0x160d('0x11')](_0x160d('0x21'),_0xf8b018[_0x160d('0x20')]);}}}if(!_0x1fc413){logger[_0x160d('0x11')](_0x160d('0x22'));_0xf8b018[_0x160d('0x23')]=_0xf8b018[_0x160d('0x16')];_0xf8b018[_0x160d('0x20')]=_0xf8b018[_0x160d('0x17')];_0x1fc413=!![];}if(_0x1fc413){_0x37eafe(_0xf8b018);}else{_0xb9d227({'statusCode':0x194,'message':_0x160d('0x19')});}}else{_0xb9d227({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x2771a7){logger[_0x160d('0x24')]('['+[_0x380c05[_0x160d('0x1b')]()]+']',_0x2771a7[_0x160d('0x1c')]);_0xb9d227(_0x2771a7);});});};}function searchContact(_0x3173e8,_0x57d589,_0x41a017,_0x5042c3){return new Promise(function(_0x2b356d,_0x8edcff){var _0x220cf7={'method':_0x160d('0xe'),'headers':_0x57d589,'uri':_0x3173e8+_0x160d('0x25')+_0x5042c3+_0x160d('0x26')+_0x41a017+_0x160d('0x27'),'json':!![]};rp(_0x220cf7)['then'](function(_0x2a2160){var _0x5e80e1=_[_0x160d('0x28')](_0x2a2160['contacts'][_0x160d('0x29')],[_0x41a017,_0x5042c3]);_0x2b356d(_0x5e80e1);})[_0x160d('0x1a')](function(_0x4e8878){_0x8edcff(_0x4e8878);});});}function getEndUser(_0xb8a83b,_0x5579f0,_0x2ede5d){return function(_0x2402d3){return new Promise(function(_0x3feeb6,_0x66b41a){logger[_0x160d('0x11')](util[_0x160d('0x2a')]('Searching\x20contact\x20with\x20phone\x20%s',_0x2402d3[_0x160d('0x2b')]));searchContact(_0x2ede5d,_0x5579f0,_0x160d('0x2c'),_0x2402d3[_0x160d('0x2b')])[_0x160d('0x1e')](function(_0x2bcd43){if(_0x2bcd43){_0x2402d3[_0x160d('0x2d')]=_0x2bcd43['id'];logger[_0x160d('0x11')](_0x160d('0x2e'),_0x2402d3[_0x160d('0x2d')]);return _0x3feeb6(_0x2402d3);}searchContact(_0x2ede5d,_0x5579f0,_0x160d('0x2f'),_0x2402d3[_0x160d('0x2b')])[_0x160d('0x1e')](function(_0x347bf3){if(_0x347bf3){_0x2402d3[_0x160d('0x2d')]=_0x347bf3['id'];logger[_0x160d('0x11')]('Contact\x20found\x20work_number:',_0x2402d3[_0x160d('0x2d')]);return _0x3feeb6(_0x2402d3);}createEndUser(_0x2402d3,_0xb8a83b,_0x5579f0,_0x2ede5d)[_0x160d('0x1e')](function(_0x2ae794){logger['info'](_0x160d('0x30'),_0x2ae794[_0x160d('0x2d')]);return _0x3feeb6(_0x2ae794);});});})[_0x160d('0x1a')](function(_0x286378){_0x66b41a(_0x286378);});});};}function createEndUser(_0x194deb,_0x13999e,_0xaf9d90,_0x58c178){return new Promise(function(_0x597f52,_0x5eea72){var _0x2aedb1=moment();var _0x56193e={'method':_0x160d('0x31'),'uri':_0x58c178+_0x160d('0x32'),'body':{'contact':{'last_name':_0x194deb[_0x160d('0x2b')],'work_number':_0x194deb['contactNumber'],'mobile_number':_0x194deb[_0x160d('0x2b')],'owner_id':_0x194deb['userId'],'created_at':_0x2aedb1['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x56193e[_0x160d('0x10')]=_0xaf9d90;logger[_0x160d('0x11')](_0x160d('0x33'));return rp(_0x56193e)[_0x160d('0x1e')](function(_0x21539b){_0x194deb[_0x160d('0x2d')]=_0x21539b['contact']['id'];_0x597f52(_0x194deb);})[_0x160d('0x1a')](function(_0x497b62){logger[_0x160d('0x24')]('['+[_0x13999e[_0x160d('0x1b')]()]+']',_0x497b62['message']);_0x5eea72(_0x497b62[_0x160d('0x1c')]);});});}function getTicket(_0x1274ad,_0x44adb4,_0x3960e1,_0x5e3f98,_0x103b85){return function(_0x3e6881){logger[_0x160d('0x11')](_0x160d('0x34'));return new Promise(function(_0x1f39be,_0x57349e){var _0x1b16c7=moment();var _0x4a71c9={'method':_0x160d('0x31'),'uri':_0x3960e1+_0x160d('0x35'),'body':{'title':intUtil[_0x160d('0x36')](_0x5e3f98[_0x160d('0x37')],_0x103b85,'\x20'),'description':intUtil[_0x160d('0x36')](_0x5e3f98[_0x160d('0x38')],_0x103b85,'\x0a'),'owner_id':_0x3e6881[_0x160d('0x20')],'creater_id':_0x3e6881['adminId'],'targetable_id':_0x3e6881[_0x160d('0x2d')],'targetable_type':_0x160d('0x39'),'created_at':_0x1b16c7[_0x160d('0x2a')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x1b16c7[_0x160d('0x3a')](0x1e,'m')['format'](_0x160d('0x3b'))},'json':!![]};_0x4a71c9['headers']=_0x44adb4;return rp(_0x4a71c9)[_0x160d('0x1e')](function(_0x17dc2b){_0x3e6881[_0x160d('0x3c')]=_0x17dc2b['task']['id'];logger[_0x160d('0x11')]('Task\x20created:',_0x3e6881[_0x160d('0x3c')]);_0x1f39be(_0x3e6881);})['catch'](function(_0x4035d3){logger[_0x160d('0x24')]('['+[_0x1274ad[_0x160d('0x1b')]()]+']',_0x4035d3['message']);_0x57349e(_0x4035d3[_0x160d('0x1c')]);});});};}function emit(_0x2c22f6,_0x5d336e,_0x2346b7){var _0x5177c8={'uri':_0x2c22f6+_0x160d('0x3d')+_0x2346b7};io['to'](util[_0x160d('0x2a')](_0x160d('0x3e'),_0x5d336e))[_0x160d('0x3f')](_0x160d('0x40'),_0x5177c8);}exports['cs']=function(_0x11a354,_0x51520d,_0x66d672,_0x4037bb,_0x307632,_0x293368,_0x22fc67,_0x384030){var _0xefe5eb={};var _0x3fbfca={'Authorization':_0x160d('0x41')+_0x293368['apiKey']};_0x293368[_0x160d('0x42')]=intUtil['stripTrailingSlash'](_0x293368[_0x160d('0x42')]);_0x293368[_0x160d('0x43')]=intUtil[_0x160d('0x44')](_0x293368[_0x160d('0x43')]);var _0xa4142d=_0x293368[_0x160d('0x42')];_0xefe5eb[_0x160d('0x16')]=_0x293368[_0x160d('0x45')];_0xefe5eb['contactNumber']=_0x384030[_0x160d('0x46')]()===_0x160d('0x47')?_0x51520d[_0x160d('0x48')]:_0x51520d[_0x160d('0x49')];_0xefe5eb[_0x160d('0x4a')]=_0x384030===_0x160d('0x4b')||_0x384030===_0x160d('0x4c')?'queue':_0x160d('0x47');if(_0x4037bb){_0xefe5eb[_0x160d('0x1f')]=_0x4037bb['email'];}var _0x27fd36=util[_0x160d('0x2a')](_0x160d('0x4d'),_0x293368[_0x160d('0x43')],_0x51520d['uniqueid'],md5(_0x51520d[_0x160d('0x4e')]));if(_0x307632&&_0x307632[_0x160d('0x4f')]){logger['info'](_0x160d('0x50'),'Recording\x20is\x20enabled!');_0x51520d['recordingURL']=_0x27fd36;}else if(_0x22fc67&&_0x22fc67['recordingFormat']&&_0x22fc67[_0x160d('0x51')]!=='none'){logger['info'](_0x160d('0x52'),_0x160d('0x53'));_0x51520d['recordingURL']=_0x27fd36;}else{_0x51520d[_0x160d('0x54')]='';}return getAdminId(_0xefe5eb,_0x384030,_0x3fbfca,_0xa4142d)[_0x160d('0x1e')](getUser(_0x384030,_0x3fbfca,_0xa4142d))[_0x160d('0x1e')](getEndUser(_0x384030,_0x3fbfca,_0xa4142d))[_0x160d('0x1e')](getTicket(_0x384030,_0x3fbfca,_0xa4142d,_0x66d672,_0x51520d))[_0x160d('0x1e')](function(_0x2a951e){logger[_0x160d('0x11')](util[_0x160d('0x2a')](_0x160d('0x55'),_0x2a951e[_0x160d('0x3c')]));if(_0x384030!==_0x160d('0x4c')){logger[_0x160d('0x11')]('['+[_0x384030['toUpperCase']()]+']',_0x160d('0x56'));emit(_0xa4142d,_0x4037bb[_0x160d('0x57')],_0x2a951e[_0x160d('0x2d')]);}})['catch'](function(_0x12c490){logger['error']('['+[_0x384030[_0x160d('0x1b')]()]+_0x160d('0x58'),util[_0x160d('0x59')](_0x12c490,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x105b=['serverUrl','remoteUri','username','toLowerCase','outbound','destcalleridnum','calleridnum','unmanaged','email','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','md5','util','bluebird','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','info','then','length','adminEmail','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','message','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','Admin\x20selected','adminId','toUpperCase','/api/lookup?q=','&f=','&entities=contact','find','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','headers','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','getString','Subjects','Contact','add','task','Task\x20created:','ticketId','/contacts/','user:%s','emit','trigger:browser:url','apiKey','stripTrailingSlash'];(function(_0x5873c3,_0x2ee2d1){var _0xf51d04=function(_0x3f5344){while(--_0x3f5344){_0x5873c3['push'](_0x5873c3['shift']());}};_0xf51d04(++_0x2ee2d1);}(_0x105b,0x15a));var _0xb105=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x105b[_0x1ac595];return _0x455fff;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xb105('0x0'));var util=require(_0xb105('0x1'));var moment=require('moment');var Promise=require(_0xb105('0x2'));var Redis=require('ioredis');var intUtil=require(_0xb105('0x3'));var config=require('../../../../config/environment');var logger=require(_0xb105('0x4'))('freshsales');config[_0xb105('0x5')]=_[_0xb105('0x6')](config[_0xb105('0x5')],{'host':_0xb105('0x7'),'port':0x18eb});var io=require(_0xb105('0x8'))(new Redis(config[_0xb105('0x5')]));function getAdminId(_0x500635,_0x17a309,_0x2c8b27,_0x45a9fa){return new Promise(function(_0x42d904,_0x16a031){var _0x5c874b=![];var _0x2c3c40={'method':_0xb105('0x9'),'uri':_0x45a9fa+_0xb105('0xa'),'json':!![]};_0x2c3c40['headers']=_0x2c8b27;logger[_0xb105('0xb')]('Getting\x20admin\x20information');return rp(_0x2c3c40)[_0xb105('0xc')](function(_0x45d264){if(_0x45d264){var _0x42ca13=_0x45d264['users'];var _0x4e18f7=null;for(_0x4e18f7=0x0;_0x4e18f7<_0x42ca13[_0xb105('0xd')];_0x4e18f7++){if(_0x42ca13[_0x4e18f7]['email']===_0x500635[_0xb105('0xe')]){_0x500635['adminId']=_0x42ca13[_0x4e18f7]['id'];_0x5c874b=!![];}}if(_0x5c874b){logger[_0xb105('0xb')](_0xb105('0xf'),_0x500635['adminId']);_0x42d904(_0x500635);}else{_0x16a031({'statusCode':0x194,'message':_0xb105('0x10')});}}else{_0x16a031({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xb105('0x11')](function(_0x235c83){logger[_0xb105('0x12')]('['+[_0x17a309['toUpperCase']()]+']',_0x235c83[_0xb105('0x13')]);_0x16a031(_0x235c83);});});}function getUser(_0x5b7ef7,_0x51a7c6,_0x4a924c){return function(_0x27ec31){return new Promise(function(_0x142aae,_0xb49268){var _0x3bf588={'method':_0xb105('0x9'),'uri':_0x4a924c+'/api/selector/owners','json':!![]};_0x3bf588['headers']=_0x51a7c6;logger[_0xb105('0xb')]('Getting\x20user\x20list');return rp(_0x3bf588)[_0xb105('0xc')](function(_0x107abc){if(_0x107abc){var _0x4a2140=_0x107abc['users'];var _0xf42f49=![];var _0x53e65f=null;if(_0x27ec31[_0xb105('0x14')]!==null){logger[_0xb105('0xb')](_0xb105('0x15'),_0x27ec31[_0xb105('0x14')]);_0x27ec31[_0xb105('0x16')]=_0x27ec31[_0xb105('0x14')];for(_0x53e65f=0x0;_0x53e65f<_0x4a2140[_0xb105('0xd')];_0x53e65f++){if(_0x4a2140[_0x53e65f]['email']===_0x27ec31['agentEmail']){_0xf42f49=!![];_0x27ec31[_0xb105('0x17')]=_0x4a2140[_0x53e65f]['id'];logger['info']('User\x20found:',_0x27ec31['userId']);}}}if(!_0xf42f49){logger['info'](_0xb105('0x18'));_0x27ec31[_0xb105('0x16')]=_0x27ec31[_0xb105('0xe')];_0x27ec31[_0xb105('0x17')]=_0x27ec31[_0xb105('0x19')];_0xf42f49=!![];}if(_0xf42f49){_0x142aae(_0x27ec31);}else{_0xb49268({'statusCode':0x194,'message':_0xb105('0x10')});}}else{_0xb49268({'statusCode':0x194,'message':_0xb105('0x10')});}})['catch'](function(_0x46a2ba){logger[_0xb105('0x12')]('['+[_0x5b7ef7[_0xb105('0x1a')]()]+']',_0x46a2ba[_0xb105('0x13')]);_0xb49268(_0x46a2ba);});});};}function searchContact(_0x4fb02f,_0x3f8bcf,_0x5e4c23,_0xfd1c0b){return new Promise(function(_0x2435ac,_0x267e8a){var _0x9438e6={'method':_0xb105('0x9'),'headers':_0x3f8bcf,'uri':_0x4fb02f+_0xb105('0x1b')+_0xfd1c0b+_0xb105('0x1c')+_0x5e4c23+_0xb105('0x1d'),'json':!![]};rp(_0x9438e6)[_0xb105('0xc')](function(_0x44a1c5){var _0xab8dfb=_[_0xb105('0x1e')](_0x44a1c5['contacts']['contacts'],[_0x5e4c23,_0xfd1c0b]);_0x2435ac(_0xab8dfb);})['catch'](function(_0x44e9ce){_0x267e8a(_0x44e9ce);});});}function getEndUser(_0x4d05d3,_0x47eaf0,_0x21d7ff){return function(_0x206e76){return new Promise(function(_0x5285dd,_0x1453d0){logger['info'](util['format'](_0xb105('0x1f'),_0x206e76[_0xb105('0x20')]));searchContact(_0x21d7ff,_0x47eaf0,_0xb105('0x21'),_0x206e76['contactNumber'])['then'](function(_0x59040d){if(_0x59040d){_0x206e76[_0xb105('0x22')]=_0x59040d['id'];logger[_0xb105('0xb')](_0xb105('0x23'),_0x206e76['endUserId']);return _0x5285dd(_0x206e76);}searchContact(_0x21d7ff,_0x47eaf0,_0xb105('0x24'),_0x206e76['contactNumber'])[_0xb105('0xc')](function(_0x2df641){if(_0x2df641){_0x206e76[_0xb105('0x22')]=_0x2df641['id'];logger[_0xb105('0xb')](_0xb105('0x25'),_0x206e76[_0xb105('0x22')]);return _0x5285dd(_0x206e76);}createEndUser(_0x206e76,_0x4d05d3,_0x47eaf0,_0x21d7ff)[_0xb105('0xc')](function(_0x12d059){logger[_0xb105('0xb')](_0xb105('0x26'),_0x12d059[_0xb105('0x22')]);return _0x5285dd(_0x12d059);});});})[_0xb105('0x11')](function(_0x3436f7){_0x1453d0(_0x3436f7);});});};}function createEndUser(_0x1d9daf,_0x345eff,_0x20aef5,_0x53dca8){return new Promise(function(_0x48d933,_0x19394c){var _0x32a4e4=moment();var _0x2ee99d={'method':_0xb105('0x27'),'uri':_0x53dca8+_0xb105('0x28'),'body':{'contact':{'last_name':_0x1d9daf[_0xb105('0x20')],'work_number':_0x1d9daf[_0xb105('0x20')],'mobile_number':_0x1d9daf['contactNumber'],'owner_id':_0x1d9daf[_0xb105('0x17')],'created_at':_0x32a4e4[_0xb105('0x29')](_0xb105('0x2a'))}},'json':!![]};_0x2ee99d[_0xb105('0x2b')]=_0x20aef5;logger[_0xb105('0xb')](_0xb105('0x2c'));return rp(_0x2ee99d)[_0xb105('0xc')](function(_0x42d778){_0x1d9daf[_0xb105('0x22')]=_0x42d778['contact']['id'];_0x48d933(_0x1d9daf);})[_0xb105('0x11')](function(_0x5193c0){logger[_0xb105('0x12')]('['+[_0x345eff[_0xb105('0x1a')]()]+']',_0x5193c0[_0xb105('0x13')]);_0x19394c(_0x5193c0[_0xb105('0x13')]);});});}function getTicket(_0x567cb1,_0xed33a0,_0x393a38,_0x2e88d3,_0x27e168){return function(_0x5a4c52){logger['info'](_0xb105('0x2d'));return new Promise(function(_0x10155d,_0x38f93e){var _0x239355=moment();var _0x4f09f4={'method':_0xb105('0x27'),'uri':_0x393a38+'/api/tasks','body':{'title':intUtil[_0xb105('0x2e')](_0x2e88d3[_0xb105('0x2f')],_0x27e168,'\x20'),'description':intUtil[_0xb105('0x2e')](_0x2e88d3['Descriptions'],_0x27e168,'\x0a'),'owner_id':_0x5a4c52['userId'],'creater_id':_0x5a4c52[_0xb105('0x19')],'targetable_id':_0x5a4c52[_0xb105('0x22')],'targetable_type':_0xb105('0x30'),'created_at':_0x239355[_0xb105('0x29')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x239355[_0xb105('0x31')](0x1e,'m')['format'](_0xb105('0x2a'))},'json':!![]};_0x4f09f4[_0xb105('0x2b')]=_0xed33a0;return rp(_0x4f09f4)['then'](function(_0x554de1){_0x5a4c52['ticketId']=_0x554de1[_0xb105('0x32')]['id'];logger[_0xb105('0xb')](_0xb105('0x33'),_0x5a4c52[_0xb105('0x34')]);_0x10155d(_0x5a4c52);})[_0xb105('0x11')](function(_0x4058a8){logger[_0xb105('0x12')]('['+[_0x567cb1[_0xb105('0x1a')]()]+']',_0x4058a8[_0xb105('0x13')]);_0x38f93e(_0x4058a8[_0xb105('0x13')]);});});};}function emit(_0x2e2cc4,_0x339703,_0x3a61dc){var _0x2a37ba={'uri':_0x2e2cc4+_0xb105('0x35')+_0x3a61dc};io['to'](util['format'](_0xb105('0x36'),_0x339703))[_0xb105('0x37')](_0xb105('0x38'),_0x2a37ba);}exports['cs']=function(_0x4d11c1,_0x57dcf6,_0x4be6a5,_0xfdd3e1,_0x499453,_0x5b2486,_0xc154f4,_0x1efbe2){var _0x59d172={};var _0x1294a2={'Authorization':'Token\x20token='+_0x5b2486[_0xb105('0x39')]};_0x5b2486['remoteUri']=intUtil[_0xb105('0x3a')](_0x5b2486['remoteUri']);_0x5b2486[_0xb105('0x3b')]=intUtil['stripTrailingSlash'](_0x5b2486[_0xb105('0x3b')]);var _0x2dbd65=_0x5b2486[_0xb105('0x3c')];_0x59d172[_0xb105('0xe')]=_0x5b2486[_0xb105('0x3d')];_0x59d172[_0xb105('0x20')]=_0x1efbe2[_0xb105('0x3e')]()===_0xb105('0x3f')?_0x57dcf6[_0xb105('0x40')]:_0x57dcf6[_0xb105('0x41')];_0x59d172['callDirection']=_0x1efbe2==='queue'||_0x1efbe2===_0xb105('0x42')?'queue':_0xb105('0x3f');if(_0xfdd3e1){_0x59d172[_0xb105('0x14')]=_0xfdd3e1[_0xb105('0x43')];}var _0x1c3210=util[_0xb105('0x29')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5b2486[_0xb105('0x3b')],_0x57dcf6[_0xb105('0x44')],md5(_0x57dcf6[_0xb105('0x44')]));if(_0x499453&&_0x499453[_0xb105('0x45')]){logger['info'](_0xb105('0x46'),_0xb105('0x47'));_0x57dcf6[_0xb105('0x48')]=_0x1c3210;}else if(_0xc154f4&&_0xc154f4['recordingFormat']&&_0xc154f4[_0xb105('0x49')]!==_0xb105('0x4a')){logger[_0xb105('0xb')](_0xb105('0x4b'),_0xb105('0x47'));_0x57dcf6[_0xb105('0x48')]=_0x1c3210;}else{_0x57dcf6[_0xb105('0x48')]='';}return getAdminId(_0x59d172,_0x1efbe2,_0x1294a2,_0x2dbd65)['then'](getUser(_0x1efbe2,_0x1294a2,_0x2dbd65))[_0xb105('0xc')](getEndUser(_0x1efbe2,_0x1294a2,_0x2dbd65))[_0xb105('0xc')](getTicket(_0x1efbe2,_0x1294a2,_0x2dbd65,_0x4be6a5,_0x57dcf6))[_0xb105('0xc')](function(_0x227a3b){logger[_0xb105('0xb')](util['format'](_0xb105('0x4c'),_0x227a3b['ticketId']));if(_0x1efbe2!==_0xb105('0x42')){logger['info']('['+[_0x1efbe2[_0xb105('0x1a')]()]+']',_0xb105('0x4d'));emit(_0x2dbd65,_0xfdd3e1[_0xb105('0x4e')],_0x227a3b['endUserId']);}})[_0xb105('0x11')](function(_0x2d830c){logger[_0xb105('0x12')]('['+[_0x1efbe2[_0xb105('0x1a')]()]+_0xb105('0x4f'),util[_0xb105('0x50')](_0x2d830c,{'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 4093b22..0c7052c 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 _0x8026=['data1','toLowerCase','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','freshdesk','freshsales','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','data2','util','./zendesk','./sugarcrm','./freshdesk','./zoho','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','zoho','desk','vtiger','dynamics365','servicenow','exec','includes'];(function(_0x5bc647,_0x37db43){var _0x48fc98=function(_0x191bf2){while(--_0x191bf2){_0x5bc647['push'](_0x5bc647['shift']());}};_0x48fc98(++_0x37db43);}(_0x8026,0xfe));var _0x6802=function(_0x53f740,_0x1c689c){_0x53f740=_0x53f740-0x0;var _0x50636a=_0x8026[_0x53f740];return _0x50636a;};'use strict';var _=require('lodash');var util=require(_0x6802('0x0'));var zendesk=require(_0x6802('0x1'));var salesforce=require('./salesforce');var sugarcrm=require(_0x6802('0x2'));var freshdesk=require(_0x6802('0x3'));var zoho=require(_0x6802('0x4'));var desk=require('./desk');var vtiger=require(_0x6802('0x5'));var servicenow=require(_0x6802('0x6'));var dynamics365=require(_0x6802('0x7'));var freshsales=require(_0x6802('0x8'));var integrations=[_0x6802('0x9'),_0x6802('0xa'),_0x6802('0xb'),'freshdesk',_0x6802('0xc'),_0x6802('0xd'),_0x6802('0xe'),_0x6802('0xf'),'freshsales',_0x6802('0x10')];exports[_0x6802('0x11')]=function(_0x196ac4,_0x56d925,_0x491b1e,_0x3344c9,_0x4ceff7,_0x10b2a8){if(_0x491b1e){if(_[_0x6802('0x12')](integrations,_0x196ac4[_0x6802('0x13')][_0x6802('0x14')]())){try{var _0x37e654=null;var _0xcc9a62='';var _0x4bf330=_0x491b1e[_0x196ac4[_0x6802('0x13')][_0x6802('0x14')]()];if(_0x4bf330){var _0x42b708=_0x4bf330[_0x196ac4['data2']];if(_0x42b708){var _0xdd174a=_[_0x6802('0x15')](_0x42b708[_0x6802('0x16')],{'id':parseInt(_0x196ac4[_0x6802('0x17')],0xa)});if(_0xdd174a){if(_0x3344c9){if(_0x4ceff7&&_0x56d925[_0x6802('0x18')]){_0xcc9a62=_0x6802('0x18');}else if(_0x56d925[_0x6802('0x19')]){_0xcc9a62=_0x6802('0x1a');}else{console[_0x6802('0x1b')](_0x6802('0x1c'),_0x56d925);}}else{_0xcc9a62=_0x6802('0x1d');}switch(_0x196ac4[_0x6802('0x13')][_0x6802('0x14')]()){case _0x6802('0x9'):zendesk[_0xcc9a62](_0x196ac4,_0x56d925,_0xdd174a,_0x3344c9,_0x4ceff7,_0x42b708,_0x10b2a8);break;case _0x6802('0xa'):salesforce[_0xcc9a62](_0x196ac4,_0x56d925,_0xdd174a,_0x3344c9,_0x4ceff7,_0x42b708,_0x10b2a8);break;case _0x6802('0xb'):sugarcrm[_0xcc9a62](_0x196ac4,_0x56d925,_0xdd174a,_0x3344c9,_0x4ceff7,_0x42b708,_0x10b2a8);break;case _0x6802('0x1e'):freshdesk[_0xcc9a62](_0x196ac4,_0x56d925,_0xdd174a,_0x3344c9,_0x4ceff7,_0x42b708,_0x10b2a8);break;case _0x6802('0xc'):zoho[_0xcc9a62](_0x196ac4,_0x56d925,_0xdd174a,_0x3344c9,_0x4ceff7,_0x42b708,_0x10b2a8);break;case _0x6802('0xd'):desk[_0xcc9a62](_0x196ac4,_0x56d925,_0xdd174a,_0x3344c9,_0x4ceff7,_0x42b708,_0x10b2a8);break;case _0x6802('0xe'):vtiger[_0xcc9a62](_0x196ac4,_0x56d925,_0xdd174a,_0x3344c9,_0x4ceff7,_0x42b708,_0x10b2a8);break;case _0x6802('0x1f'):freshsales['cs'](_0x196ac4,_0x56d925,_0xdd174a,_0x3344c9,_0x4ceff7,_0x42b708,_0x10b2a8,_0xcc9a62);break;case _0x6802('0x10'):servicenow['cs'](_0x196ac4,_0x56d925,_0xdd174a,_0x3344c9,_0x4ceff7,_0x42b708,_0x10b2a8,_0xcc9a62);break;case _0x6802('0xf'):dynamics365['cs'](_0x196ac4,_0x56d925,_0xdd174a,_0x3344c9,_0x4ceff7,_0x42b708,_0x10b2a8,_0xcc9a62);break;default:console['log']('unknown\x20integration');}}else{_0x37e654=require(_0x6802('0x20'))(_0x196ac4[_0x6802('0x13')][_0x6802('0x14')]());_0x37e654[_0x6802('0x21')](_0x6802('0x22'),util[_0x6802('0x23')](_0x6802('0x24'),_0x196ac4[_0x6802('0x13')]['toLowerCase'](),_0x196ac4['data3']));}}else{_0x37e654=require(_0x6802('0x20'))(_0x196ac4[_0x6802('0x13')][_0x6802('0x14')]());_0x37e654[_0x6802('0x21')](_0x6802('0x22'),util[_0x6802('0x23')](_0x6802('0x25'),_0x196ac4[_0x6802('0x13')]['toLowerCase'](),_0x196ac4[_0x6802('0x26')]));}}else{}}catch(_0x5f2f3a){console[_0x6802('0x21')](_0x5f2f3a);}}}}; \ No newline at end of file +var _0x9f56=['error','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./dynamics365','./freshsales','salesforce','sugarcrm','zoho','desk','vtiger','dynamics365','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','outbound','log','unmanaged','zendesk','freshdesk','freshsales','unknown\x20integration','../../../../config/logger'];(function(_0x229b13,_0x4ac627){var _0x4be521=function(_0x339a61){while(--_0x339a61){_0x229b13['push'](_0x229b13['shift']());}};_0x4be521(++_0x4ac627);}(_0x9f56,0x7a));var _0x69f5=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x9f56[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x69f5('0x0'));var util=require('util');var zendesk=require(_0x69f5('0x1'));var salesforce=require(_0x69f5('0x2'));var sugarcrm=require(_0x69f5('0x3'));var freshdesk=require(_0x69f5('0x4'));var zoho=require(_0x69f5('0x5'));var desk=require(_0x69f5('0x6'));var vtiger=require(_0x69f5('0x7'));var servicenow=require('./servicenow');var dynamics365=require(_0x69f5('0x8'));var freshsales=require(_0x69f5('0x9'));var integrations=['zendesk',_0x69f5('0xa'),_0x69f5('0xb'),'freshdesk',_0x69f5('0xc'),_0x69f5('0xd'),_0x69f5('0xe'),_0x69f5('0xf'),'freshsales',_0x69f5('0x10')];exports[_0x69f5('0x11')]=function(_0x80820f,_0x2f1a0b,_0x545004,_0x68da0,_0x4b1a07,_0x16e267){if(_0x545004){if(_[_0x69f5('0x12')](integrations,_0x80820f[_0x69f5('0x13')][_0x69f5('0x14')]())){try{var _0x4fa297=null;var _0x4ce2d4='';var _0x3d4f9d=_0x545004[_0x80820f[_0x69f5('0x13')][_0x69f5('0x14')]()];if(_0x3d4f9d){var _0x4c25b7=_0x3d4f9d[_0x80820f[_0x69f5('0x15')]];if(_0x4c25b7){var _0x4b6ab9=_[_0x69f5('0x16')](_0x4c25b7[_0x69f5('0x17')],{'id':parseInt(_0x80820f[_0x69f5('0x18')],0xa)});if(_0x4b6ab9){if(_0x68da0){if(_0x4b1a07&&_0x2f1a0b['queue']){_0x4ce2d4=_0x69f5('0x19');}else if(_0x2f1a0b['routeId']){_0x4ce2d4=_0x69f5('0x1a');}else{console[_0x69f5('0x1b')]('EVENT\x20UNKNOWN',_0x2f1a0b);}}else{_0x4ce2d4=_0x69f5('0x1c');}switch(_0x80820f[_0x69f5('0x13')][_0x69f5('0x14')]()){case _0x69f5('0x1d'):zendesk[_0x4ce2d4](_0x80820f,_0x2f1a0b,_0x4b6ab9,_0x68da0,_0x4b1a07,_0x4c25b7,_0x16e267);break;case'salesforce':salesforce[_0x4ce2d4](_0x80820f,_0x2f1a0b,_0x4b6ab9,_0x68da0,_0x4b1a07,_0x4c25b7,_0x16e267);break;case _0x69f5('0xb'):sugarcrm[_0x4ce2d4](_0x80820f,_0x2f1a0b,_0x4b6ab9,_0x68da0,_0x4b1a07,_0x4c25b7,_0x16e267);break;case _0x69f5('0x1e'):freshdesk[_0x4ce2d4](_0x80820f,_0x2f1a0b,_0x4b6ab9,_0x68da0,_0x4b1a07,_0x4c25b7,_0x16e267);break;case _0x69f5('0xc'):zoho[_0x4ce2d4](_0x80820f,_0x2f1a0b,_0x4b6ab9,_0x68da0,_0x4b1a07,_0x4c25b7,_0x16e267);break;case _0x69f5('0xd'):desk[_0x4ce2d4](_0x80820f,_0x2f1a0b,_0x4b6ab9,_0x68da0,_0x4b1a07,_0x4c25b7,_0x16e267);break;case _0x69f5('0xe'):vtiger[_0x4ce2d4](_0x80820f,_0x2f1a0b,_0x4b6ab9,_0x68da0,_0x4b1a07,_0x4c25b7,_0x16e267);break;case _0x69f5('0x1f'):freshsales['cs'](_0x80820f,_0x2f1a0b,_0x4b6ab9,_0x68da0,_0x4b1a07,_0x4c25b7,_0x16e267,_0x4ce2d4);break;case _0x69f5('0x10'):servicenow['cs'](_0x80820f,_0x2f1a0b,_0x4b6ab9,_0x68da0,_0x4b1a07,_0x4c25b7,_0x16e267,_0x4ce2d4);break;case _0x69f5('0xf'):dynamics365['cs'](_0x80820f,_0x2f1a0b,_0x4b6ab9,_0x68da0,_0x4b1a07,_0x4c25b7,_0x16e267,_0x4ce2d4);break;default:console[_0x69f5('0x1b')](_0x69f5('0x20'));}}else{_0x4fa297=require(_0x69f5('0x21'))(_0x80820f[_0x69f5('0x13')][_0x69f5('0x14')]());_0x4fa297[_0x69f5('0x22')]('[EXEC]',util['format'](_0x69f5('0x23'),_0x80820f[_0x69f5('0x13')][_0x69f5('0x14')](),_0x80820f['data3']));}}else{_0x4fa297=require('../../../../config/logger')(_0x80820f['data1'][_0x69f5('0x14')]());_0x4fa297[_0x69f5('0x22')](_0x69f5('0x24'),util[_0x69f5('0x25')](_0x69f5('0x26'),_0x80820f['data1']['toLowerCase'](),_0x80820f['data2']));}}else{}}catch(_0x3edee6){console[_0x69f5('0x22')](_0x3edee6);}}}}; \ 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 9b0176b..f1854e5 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 _0xdde7=['[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','newTab','%s/%s/e','instanceUrl','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.','catch','lodash','bluebird','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','salesforce','localhost','socket.io-emitter','emit','getString','Subjects','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','Case','leadId','info','sobject','create','isNil','validateEmail','find','execute','then','length','Email','Agent\x20%s\x20found.','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','additionalSearchContact','Contact','cloneDeep','additionalSearchLead','merge','$or','account_contact_lead','additionalSearchAccount','Account','Lead','first','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','forEach','includes','picklist','idField','toString','variable','variableName','Variable','toLowerCase','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields'];(function(_0x5f191f,_0x5c5033){var _0x41e2c3=function(_0x48f778){while(--_0x48f778){_0x5f191f['push'](_0x5f191f['shift']());}};_0x41e2c3(++_0x5c5033);}(_0xdde7,0x115));var _0x7dde=function(_0x4327fe,_0x4f8040){_0x4327fe=_0x4327fe-0x0;var _0x138651=_0xdde7[_0x4327fe];return _0x138651;};'use strict';var _=require(_0x7dde('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7dde('0x1'));var md5=require(_0x7dde('0x2'));var jsforce=require(_0x7dde('0x3'));var util=require(_0x7dde('0x4'));var Redis=require('ioredis');var intUtil=require(_0x7dde('0x5'));var config=require(_0x7dde('0x6'));var logger=require(_0x7dde('0x7'))(_0x7dde('0x8'));config['redis']=_['defaults'](config['redis'],{'host':_0x7dde('0x9'),'port':0x18eb});var io=require(_0x7dde('0xa'))(new Redis(config['redis']));function emit(_0x42eacb,_0x3606bb,_0x235de4){io['to'](_0x42eacb)[_0x7dde('0xb')](_0x3606bb,_0x235de4);}function getTicket(_0x5dc424,_0x59ace3,_0x173743,_0x4cb717,_0x302ab4,_0x1bb758,_0x4916a8,_0x73ac59){var _0x4d4530=Object['assign']({},{'OwnerId':_0x59ace3['id'],'Subject':intUtil[_0x7dde('0xc')](_0x4cb717[_0x7dde('0xd')],_0x302ab4,'\x20'),'Description':intUtil['getString'](_0x4cb717['Descriptions'],_0x302ab4,'\x0a')},getCustomFields(_0x1bb758,_0x302ab4));if(_0x173743){if(_0x4cb717[_0x7dde('0xe')]===_0x7dde('0xf')){_0x4d4530[_0x7dde('0x10')]=moment[_0x7dde('0x11')]();_0x4d4530[_0x7dde('0x12')]=![];_0x4d4530[_0x7dde('0x13')]=![];if(_0x173743[_0x7dde('0x14')]===_0x7dde('0x15')||_0x173743[_0x7dde('0x14')]===_0x7dde('0x16')){_0x4d4530[_0x7dde('0x17')]=_0x173743['id'];}else if(_0x173743['endUserType']===_0x7dde('0x18')){_0x4d4530['WhatId']=_0x173743['id'];}}else if(_0x4cb717['ticketType']===_0x7dde('0x19')){if(_0x173743[_0x7dde('0x14')]==='contact'){_0x4d4530['ContactId']=_0x173743['id'];}else if(_0x173743[_0x7dde('0x14')]===_0x7dde('0x18')){_0x4d4530['AccountId']=_0x173743['id'];}else if(_0x173743[_0x7dde('0x14')]===_0x7dde('0x16')&&_0x4cb717[_0x7dde('0x1a')]){_0x4d4530[_0x4cb717[_0x7dde('0x1a')]]=_0x173743['id'];}else{logger[_0x7dde('0x1b')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x4916a8[_0x7dde('0x1c')](_0x4cb717['ticketType'])[_0x7dde('0x1d')](_0x4d4530);}function getUser(_0x573e3b,_0x510754,_0x24e8b8){if(!_[_0x7dde('0x1e')](_0x510754)&&intUtil[_0x7dde('0x1f')](_0x510754)){var _0x3838b0={'Email':_0x510754};var _0x3512aa={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x24e8b8['sobject']('User')[_0x7dde('0x20')](_0x3838b0,_0x3512aa)[_0x7dde('0x21')]()[_0x7dde('0x22')](function(_0x523d57){if(_0x523d57[_0x7dde('0x23')]){var _0x3bedf6=_[_0x7dde('0x20')](_0x523d57,function(_0x246892){return _0x246892[_0x7dde('0x24')]===_0x510754;});if(_0x3bedf6){logger['info'](_0x7dde('0x25'),_0x510754);return BPromise[_0x7dde('0x26')]({'id':_0x3bedf6['Id'],'name':_0x3bedf6[_0x7dde('0x27')]});}}else{logger['info'](_0x7dde('0x28'),_0x510754);return _0x24e8b8[_0x7dde('0x29')]()[_0x7dde('0x22')](function(_0x48d73f){return BPromise[_0x7dde('0x26')]({'id':_0x48d73f[_0x7dde('0x2a')],'name':_0x48d73f['display_name']});});}});}else{logger['info'](_0x7dde('0x28'),_0x510754);return _0x24e8b8[_0x7dde('0x29')]()[_0x7dde('0x22')](function(_0x1b1cc5){return BPromise[_0x7dde('0x26')]({'id':_0x1b1cc5[_0x7dde('0x2a')],'name':_0x1b1cc5[_0x7dde('0x2b')]});});}}function getEndUser(_0x15fc50,_0x4795e4,_0x5eb44d,_0x41fbb4,_0x2bec49){var _0x5ac365={'$or':{'Phone':_0x41fbb4}};var _0x3236d3={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x7dde('0x26')]()['then'](function(){logger[_0x7dde('0x1b')](_0x7dde('0x2c'),_0x41fbb4,_0x4795e4[_0x7dde('0x2d')]);switch(_0x4795e4[_0x7dde('0x2d')]){case _0x7dde('0x2e'):var _0x25c83b=_['cloneDeep'](_0x5ac365);if(_0x4795e4[_0x7dde('0x2f')]){var _0x978c6f={};_0x978c6f[_0x4795e4['additionalSearchContact']]=_0x41fbb4;_['merge'](_0x25c83b['$or'],_0x978c6f);}return _0x2bec49[_0x7dde('0x1c')](_0x7dde('0x30'))[_0x7dde('0x20')](_0x25c83b,_0x3236d3)[_0x7dde('0x21')]()[_0x7dde('0x22')](function(_0x241dcf){if(_0x241dcf&&_0x241dcf[_0x7dde('0x23')]){return _0x241dcf;}else{var _0x294b1d=_[_0x7dde('0x31')](_0x5ac365);if(_0x4795e4[_0x7dde('0x32')]){var _0x207059={};_0x207059[_0x4795e4[_0x7dde('0x32')]]=_0x41fbb4;_[_0x7dde('0x33')](_0x294b1d[_0x7dde('0x34')],_0x207059);}return _0x2bec49[_0x7dde('0x1c')]('Lead')[_0x7dde('0x20')](_0x294b1d,_0x3236d3);}});case _0x7dde('0x35'):var _0x22fb35=_[_0x7dde('0x31')](_0x5ac365);if(_0x4795e4[_0x7dde('0x36')]){var _0x978c6f={};_0x978c6f[_0x4795e4['additionalSearchAccount']]=_0x41fbb4;_[_0x7dde('0x33')](_0x22fb35['$or'],_0x978c6f);}return _0x2bec49[_0x7dde('0x1c')](_0x7dde('0x37'))[_0x7dde('0x20')](_0x22fb35,_0x3236d3)[_0x7dde('0x21')]()[_0x7dde('0x22')](function(_0x7d75fe){if(_0x7d75fe&&_0x7d75fe[_0x7dde('0x23')]){return _0x7d75fe;}else{var _0x1852cc=_[_0x7dde('0x31')](_0x5ac365);if(_0x4795e4[_0x7dde('0x2f')]){var _0x312c53={};_0x312c53[_0x4795e4['additionalSearchContact']]=_0x41fbb4;_['merge'](_0x1852cc[_0x7dde('0x34')],_0x312c53);}return _0x2bec49[_0x7dde('0x1c')](_0x7dde('0x30'))[_0x7dde('0x20')](_0x1852cc,_0x3236d3)[_0x7dde('0x22')](function(_0x433939){if(_0x433939&&_0x433939[_0x7dde('0x23')]){return _0x433939;}else{var _0x52b9db=_[_0x7dde('0x31')](_0x5ac365);if(_0x4795e4[_0x7dde('0x32')]){var _0x2b4e57={};_0x2b4e57[_0x4795e4[_0x7dde('0x32')]]=_0x41fbb4;_[_0x7dde('0x33')](_0x52b9db[_0x7dde('0x34')],_0x2b4e57);}return _0x2bec49[_0x7dde('0x1c')](_0x7dde('0x38'))[_0x7dde('0x20')](_0x52b9db,_0x3236d3);}});}});case _0x7dde('0x15'):var _0x25c83b=_['cloneDeep'](_0x5ac365);if(_0x4795e4['additionalSearchContact']){var _0x978c6f={};_0x978c6f[_0x4795e4[_0x7dde('0x2f')]]=_0x41fbb4;_[_0x7dde('0x33')](_0x25c83b[_0x7dde('0x34')],_0x978c6f);}return _0x2bec49[_0x7dde('0x1c')](_0x7dde('0x30'))[_0x7dde('0x20')](_0x25c83b,_0x3236d3)[_0x7dde('0x21')]();case _0x7dde('0x16'):var _0x3ef3bc=_[_0x7dde('0x31')](_0x5ac365);if(_0x4795e4[_0x7dde('0x32')]){var _0x978c6f={};_0x978c6f[_0x4795e4[_0x7dde('0x32')]]=_0x41fbb4;_[_0x7dde('0x33')](_0x3ef3bc[_0x7dde('0x34')],_0x978c6f);}return _0x2bec49[_0x7dde('0x1c')](_0x7dde('0x38'))['find'](_0x3ef3bc,_0x3236d3);case _0x7dde('0x18'):var _0x22fb35=_['cloneDeep'](_0x5ac365);if(_0x4795e4[_0x7dde('0x36')]){var _0x978c6f={};_0x978c6f[_0x4795e4[_0x7dde('0x36')]]=_0x41fbb4;_[_0x7dde('0x33')](_0x22fb35['$or'],_0x978c6f);}return _0x2bec49[_0x7dde('0x1c')]('Account')[_0x7dde('0x20')](_0x22fb35,_0x3236d3);default:return null;}})[_0x7dde('0x22')](function(_0x509459){if(_0x509459&&_0x509459['length']){var _0x1af23b=_[_0x7dde('0x39')](_0x509459);if(_0x1af23b){return BPromise[_0x7dde('0x26')]({'id':_0x1af23b['Id'],'name':_0x1af23b[_0x7dde('0x27')],'phone':_0x1af23b['Phone'],'endUserType':_0x1af23b['attributes'][_0x7dde('0x3a')]['toLowerCase']()});}}})[_0x7dde('0x22')](function(_0x2664df){if(_0x2664df){logger[_0x7dde('0x1b')](_0x7dde('0x3b'),_0x2664df[_0x7dde('0x14')],_0x41fbb4);return BPromise[_0x7dde('0x26')](_0x2664df);}else{logger['info'](_0x7dde('0x3c'),_0x41fbb4);var _0xf166fd={'Phone':_0x41fbb4};if(_0x4795e4[_0x7dde('0x3d')]){if(_0x4795e4['moduleCreate']===_0x7dde('0x15')){logger[_0x7dde('0x1b')](_0x7dde('0x3e'),_0x41fbb4,_0x4795e4[_0x7dde('0x3d')]);_0xf166fd['LastName']=_0x5eb44d!==''?_0x5eb44d:util['format']('Caller\x20-\x20%s',_0x41fbb4);}else if(_0x4795e4[_0x7dde('0x3d')]===_0x7dde('0x16')){logger[_0x7dde('0x1b')](_0x7dde('0x3e'),_0x41fbb4,_0x4795e4['moduleCreate']);_0xf166fd[_0x7dde('0x3f')]=_0x5eb44d!==_0x7dde('0x40')?_0x5eb44d:util[_0x7dde('0x41')](_0x7dde('0x42'),_0x41fbb4);_0xf166fd[_0x7dde('0x43')]='No\x20Company';}else if(_0x4795e4[_0x7dde('0x3d')]===_0x7dde('0x18')){logger[_0x7dde('0x1b')](_0x7dde('0x3e'),_0x41fbb4,_0x4795e4[_0x7dde('0x3d')]);_0xf166fd[_0x7dde('0x27')]=_0x5eb44d!==''?_0x5eb44d:util[_0x7dde('0x41')](_0x7dde('0x42'),_0x41fbb4);}else{return null;}}return _0x2bec49['sobject'](_['upperFirst'](_0x4795e4[_0x7dde('0x3d')]))[_0x7dde('0x1d')](_0xf166fd)[_0x7dde('0x22')](function(_0x3d411d){return BPromise[_0x7dde('0x26')]({'id':_0x3d411d['id'],'endUserType':_0x4795e4['moduleCreate']});});}});}function getCustomFields(_0x50662e,_0xcb4b5){var _0x5d323b={};if(_0x50662e[_0x7dde('0x23')]>0x0){_[_0x7dde('0x44')](_0x50662e,function(_0x37ef7f){if(_[_0x7dde('0x45')](['string',_0x7dde('0x46')],_0x37ef7f[_0x7dde('0x3a')])&&_0x37ef7f[_0x7dde('0x47')]){_0x5d323b[_0x37ef7f[_0x7dde('0x47')]]=_0x37ef7f['content'][_0x7dde('0x48')]();}else if(_0x37ef7f[_0x7dde('0x3a')]===_0x7dde('0x49')&&_0x37ef7f[_0x7dde('0x4a')]&&_0x37ef7f[_0x7dde('0x47')]){_0xcb4b5[_0x37ef7f[_0x7dde('0x4a')]]&&(_0x5d323b[_0x37ef7f[_0x7dde('0x47')]]=_0xcb4b5[_0x37ef7f[_0x7dde('0x4a')]][_0x7dde('0x48')]());}else if(_0x37ef7f[_0x7dde('0x3a')]==='customVariable'&&_0x37ef7f[_0x7dde('0x4b')]&&_0x37ef7f[_0x7dde('0x4b')]['name']&&_0x37ef7f[_0x7dde('0x47')]){_0xcb4b5[_0x37ef7f['Variable']['name'][_0x7dde('0x4c')]()]&&(_0x5d323b[_0x37ef7f[_0x7dde('0x47')]]=_0xcb4b5[_0x37ef7f[_0x7dde('0x4b')][_0x7dde('0x4d')][_0x7dde('0x4c')]()][_0x7dde('0x48')]());}});}return _0x5d323b;}function getConnection(_0x3ca25f){var _0xa2d87=_0x3ca25f[_0x7dde('0x4e')][_0x7dde('0x4f')](_0x3ca25f[_0x7dde('0x50')]);var _0x538ee=new jsforce[(_0x7dde('0x51'))]({'oauth2':{'loginUrl':_0x3ca25f[_0x7dde('0x52')]||_0x7dde('0x53'),'clientId':_0x3ca25f[_0x7dde('0x54')],'clientSecret':_0x3ca25f[_0x7dde('0x55')]}});return _0x538ee[_0x7dde('0x56')](_0x3ca25f[_0x7dde('0x57')],_0xa2d87)[_0x7dde('0x22')](function(){logger[_0x7dde('0x1b')](_0x7dde('0x58'));return _0x538ee;});}exports[_0x7dde('0x59')]=function(_0x41c574,_0x967a6d,_0x4de143,_0x2913b2,_0xc59d5,_0x257916){var _0x25906a,_0x38f7ba,_0x2e9308,_0x30aaae;_0x257916[_0x7dde('0x5a')]=intUtil[_0x7dde('0x5b')](_0x257916[_0x7dde('0x5a')]);_0x257916[_0x7dde('0x52')]=intUtil[_0x7dde('0x5b')](_0x257916['remoteUri']);if(_0xc59d5&&_0xc59d5[_0x7dde('0x5c')]){logger[_0x7dde('0x1b')](_0x7dde('0x5d'),'Recording\x20is\x20enabled!');_0x967a6d[_0x7dde('0x5e')]=util[_0x7dde('0x41')](_0x7dde('0x5f'),_0x257916[_0x7dde('0x5a')],_0x967a6d[_0x7dde('0x60')],md5(_0x967a6d[_0x7dde('0x60')]));}else{_0x967a6d['recordingURL']='';}return getConnection(_0x257916)[_0x7dde('0x22')](function(_0x454be9){_0x30aaae=_0x454be9;return getUser(_0x257916,_0x2913b2[_0x7dde('0x61')],_0x30aaae);})[_0x7dde('0x22')](function(_0x46796f){_0x25906a=_0x46796f;return getEndUser(_0x257916,_0x4de143,_0x967a6d[_0x7dde('0x62')],_0x967a6d[_0x7dde('0x63')],_0x30aaae);})[_0x7dde('0x22')](function(_0x1c3988){_0x38f7ba=_0x1c3988;return getTicket(_0x257916,_0x25906a,_0x38f7ba,_0x4de143,_0x967a6d,_0x4de143[_0x7dde('0x64')],_0x30aaae,_0x7dde('0x59'));})[_0x7dde('0x22')](function(_0x3b9404){_0x2e9308=_0x3b9404;logger[_0x7dde('0x1b')](_0x7dde('0x65'),_0x2e9308['id']);logger['info'](_0x7dde('0x66'),_0x2e9308['id'],_0x2913b2['name'],_0x257916[_0x7dde('0x3a')]);switch(_0x257916['type']){case _0x7dde('0x67'):emit(util[_0x7dde('0x41')](_0x7dde('0x68'),_0x2913b2['name']),_0x7dde('0x69'),{'recordId':_0x2e9308['id']});break;case _0x7dde('0x6a'):emit(util[_0x7dde('0x41')]('user:%s',_0x2913b2[_0x7dde('0x4d')]),'trigger:browser:url',{'uri':util[_0x7dde('0x41')](_0x7dde('0x6b'),_0x30aaae[_0x7dde('0x6c')],_0x2e9308['id'])});break;default:logger[_0x7dde('0x6d')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x524f2a){logger[_0x7dde('0x6d')](_0x7dde('0x5d'),_0x524f2a);});};exports[_0x7dde('0x6e')]=function(_0x3459fd,_0x50922f,_0x39d2e1,_0xe3c84e,_0x2092ad,_0x3cbd22,_0x58e2d8){var _0xdc6720,_0x32e759,_0x2bdf41,_0x55d8df;_0x3cbd22[_0x7dde('0x5a')]=intUtil[_0x7dde('0x5b')](_0x3cbd22['serverUrl']);_0x3cbd22['remoteUri']=intUtil[_0x7dde('0x5b')](_0x3cbd22['remoteUri']);if(_0x58e2d8&&_0x58e2d8[_0x7dde('0x6f')]&&_0x58e2d8['recordingFormat']!==_0x7dde('0x70')){logger[_0x7dde('0x1b')](_0x7dde('0x71'),_0x7dde('0x72'));_0x50922f[_0x7dde('0x5e')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3cbd22['serverUrl'],_0x50922f[_0x7dde('0x60')],md5(_0x50922f[_0x7dde('0x60')]));}return getConnection(_0x3cbd22)[_0x7dde('0x22')](function(_0x56f85c){_0x55d8df=_0x56f85c;return getUser(_0x3cbd22,_0xe3c84e['email'],_0x55d8df);})[_0x7dde('0x22')](function(_0x5c964d){_0xdc6720=_0x5c964d;return getEndUser(_0x3cbd22,_0x39d2e1,_0x50922f[_0x7dde('0x73')],_0x50922f[_0x7dde('0x74')],_0x55d8df);})[_0x7dde('0x22')](function(_0x285815){_0x32e759=_0x285815;return getTicket(_0x3cbd22,_0xdc6720,_0x32e759,_0x39d2e1,_0x50922f,_0x39d2e1['Fields'],_0x55d8df,'outbound');})['then'](function(_0x36d2ee){_0x2bdf41=_0x36d2ee;logger[_0x7dde('0x1b')](_0x7dde('0x75'),_0x2bdf41['id']);logger['info'](_0x7dde('0x76'),_0x2bdf41['id'],_0xe3c84e['name'],_0x3cbd22[_0x7dde('0x3a')]);switch(_0x3cbd22['type']){case'integrationTab':emit(util[_0x7dde('0x41')](_0x7dde('0x68'),_0xe3c84e[_0x7dde('0x4d')]),_0x7dde('0x69'),{'recordId':_0x2bdf41['id']});break;case'newTab':emit(util['format']('user:%s',_0xe3c84e[_0x7dde('0x4d')]),_0x7dde('0x77'),{'uri':util[_0x7dde('0x41')](_0x7dde('0x6b'),_0x55d8df[_0x7dde('0x6c')],_0x2bdf41['id'])});break;default:logger['error'](_0x7dde('0x71'),_0x7dde('0x78'));}})['catch'](function(_0x51091d){logger[_0x7dde('0x6d')]('[OUTBOUND]',_0x51091d);});};exports[_0x7dde('0x79')]=function(_0x183b59,_0x337e92,_0x5d8b02,_0x1006d6,_0x9f43fa,_0x3f1b38){var _0x4fbbeb,_0x430d59,_0x50ca08,_0x456ae9;_0x3f1b38[_0x7dde('0x5a')]=intUtil[_0x7dde('0x5b')](_0x3f1b38[_0x7dde('0x5a')]);_0x3f1b38[_0x7dde('0x52')]=intUtil[_0x7dde('0x5b')](_0x3f1b38[_0x7dde('0x52')]);if(_0x9f43fa&&_0x9f43fa['monitor_format']){logger['info']('['+_0x337e92[_0x7dde('0x7a')][_0x7dde('0x7b')]()+']',_0x7dde('0x72'));_0x337e92[_0x7dde('0x5e')]=util['format'](_0x7dde('0x5f'),_0x3f1b38[_0x7dde('0x5a')],_0x337e92[_0x7dde('0x60')],md5(_0x337e92[_0x7dde('0x60')]));}else{_0x337e92[_0x7dde('0x5e')]='';}return getConnection(_0x3f1b38)[_0x7dde('0x22')](function(_0x2b0028){_0x456ae9=_0x2b0028;if(!_['isNil'](_0x1006d6)){return getUser(_0x3f1b38,_0x1006d6[_0x7dde('0x4d')],_0x456ae9);}else{return getUser(_0x3f1b38,null,_0x456ae9);}})[_0x7dde('0x22')](function(_0x374dec){_0x4fbbeb=_0x374dec;return getEndUser(_0x3f1b38,_0x5d8b02,_0x337e92['calleridname'],_0x337e92['calleridnum'],_0x456ae9);})[_0x7dde('0x22')](function(_0xd4ba81){_0x430d59=_0xd4ba81;return getTicket(_0x3f1b38,_0x4fbbeb,_0x430d59,_0x5d8b02,_0x337e92,_0x5d8b02[_0x7dde('0x64')],_0x456ae9);})[_0x7dde('0x22')](function(_0x188348){_0x50ca08=_0x188348;logger['info']('['+_0x337e92[_0x7dde('0x7a')]['toUpperCase']()+_0x7dde('0x7c'),_0x50ca08['id']);logger[_0x7dde('0x1b')]('['+_0x337e92[_0x7dde('0x7a')][_0x7dde('0x7b')]()+']\x20Integration\x20account\x20type\x20%s.',_0x3f1b38[_0x7dde('0x3a')]);})[_0x7dde('0x7d')](function(_0x16e3b8){logger[_0x7dde('0x6d')]('['+_0x337e92[_0x7dde('0x7a')][_0x7dde('0x7b')]()+']',_0x16e3b8);});}; \ No newline at end of file +var _0xc0f4=['../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','socket.io-emitter','emit','getString','Subjects','ticketType','Task','utc','IsRecurrence','endUserType','contact','account','WhatId','ContactId','AccountId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','User','find','execute','then','length','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','additionalSearchContact','$or','cloneDeep','additionalSearchLead','merge','Lead','additionalSearchAccount','Contact','Account','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','Caller\x20-\x20%s','LastName','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','variable','variableName','toString','customVariable','Variable','name','concat','securityToken','Connection','clientSecret','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','jsforce','util','ioredis'];(function(_0x570c8a,_0x4a11cc){var _0x25dc12=function(_0x4585d9){while(--_0x4585d9){_0x570c8a['push'](_0x570c8a['shift']());}};_0x25dc12(++_0x4a11cc);}(_0xc0f4,0x75));var _0x4c0f=function(_0x452a25,_0x961997){_0x452a25=_0x452a25-0x0;var _0x1cb080=_0xc0f4[_0x452a25];return _0x1cb080;};'use strict';var _=require('lodash');var rp=require(_0x4c0f('0x0'));var moment=require(_0x4c0f('0x1'));var BPromise=require(_0x4c0f('0x2'));var md5=require('md5');var jsforce=require(_0x4c0f('0x3'));var util=require(_0x4c0f('0x4'));var Redis=require(_0x4c0f('0x5'));var intUtil=require('./util');var config=require(_0x4c0f('0x6'));var logger=require(_0x4c0f('0x7'))(_0x4c0f('0x8'));config[_0x4c0f('0x9')]=_[_0x4c0f('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x4c0f('0xb'))(new Redis(config['redis']));function emit(_0x5585ed,_0x297b39,_0x530cbb){io['to'](_0x5585ed)[_0x4c0f('0xc')](_0x297b39,_0x530cbb);}function getTicket(_0x55d42a,_0x474c35,_0x4f38a7,_0x58cdf8,_0x3ca1ef,_0x599f4e,_0x329e23,_0x8fd13d){var _0x4cd833=Object['assign']({},{'OwnerId':_0x474c35['id'],'Subject':intUtil[_0x4c0f('0xd')](_0x58cdf8[_0x4c0f('0xe')],_0x3ca1ef,'\x20'),'Description':intUtil[_0x4c0f('0xd')](_0x58cdf8['Descriptions'],_0x3ca1ef,'\x0a')},getCustomFields(_0x599f4e,_0x3ca1ef));if(_0x4f38a7){if(_0x58cdf8[_0x4c0f('0xf')]===_0x4c0f('0x10')){_0x4cd833['ActivityDate']=moment[_0x4c0f('0x11')]();_0x4cd833['IsReminderSet']=![];_0x4cd833[_0x4c0f('0x12')]=![];if(_0x4f38a7[_0x4c0f('0x13')]===_0x4c0f('0x14')||_0x4f38a7['endUserType']==='lead'){_0x4cd833['WhoId']=_0x4f38a7['id'];}else if(_0x4f38a7[_0x4c0f('0x13')]===_0x4c0f('0x15')){_0x4cd833[_0x4c0f('0x16')]=_0x4f38a7['id'];}}else if(_0x58cdf8[_0x4c0f('0xf')]==='Case'){if(_0x4f38a7[_0x4c0f('0x13')]===_0x4c0f('0x14')){_0x4cd833[_0x4c0f('0x17')]=_0x4f38a7['id'];}else if(_0x4f38a7['endUserType']==='account'){_0x4cd833[_0x4c0f('0x18')]=_0x4f38a7['id'];}else if(_0x4f38a7['endUserType']===_0x4c0f('0x19')&&_0x58cdf8[_0x4c0f('0x1a')]){_0x4cd833[_0x58cdf8[_0x4c0f('0x1a')]]=_0x4f38a7['id'];}else{logger[_0x4c0f('0x1b')](_0x4c0f('0x1c'));}}}return _0x329e23[_0x4c0f('0x1d')](_0x58cdf8['ticketType'])[_0x4c0f('0x1e')](_0x4cd833);}function getUser(_0x51e25f,_0x5cfc6e,_0x532793){if(!_[_0x4c0f('0x1f')](_0x5cfc6e)&&intUtil['validateEmail'](_0x5cfc6e)){var _0x398246={'Email':_0x5cfc6e};var _0x2d7cfc={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x532793[_0x4c0f('0x1d')](_0x4c0f('0x20'))[_0x4c0f('0x21')](_0x398246,_0x2d7cfc)[_0x4c0f('0x22')]()[_0x4c0f('0x23')](function(_0x3d931b){if(_0x3d931b[_0x4c0f('0x24')]){var _0xb99e2e=_[_0x4c0f('0x21')](_0x3d931b,function(_0x4c4022){return _0x4c4022['Email']===_0x5cfc6e;});if(_0xb99e2e){logger[_0x4c0f('0x1b')](_0x4c0f('0x25'),_0x5cfc6e);return BPromise[_0x4c0f('0x26')]({'id':_0xb99e2e['Id'],'name':_0xb99e2e[_0x4c0f('0x27')]});}}else{logger[_0x4c0f('0x1b')](_0x4c0f('0x28'),_0x5cfc6e);return _0x532793[_0x4c0f('0x29')]()[_0x4c0f('0x23')](function(_0x43b004){return BPromise[_0x4c0f('0x26')]({'id':_0x43b004['user_id'],'name':_0x43b004[_0x4c0f('0x2a')]});});}});}else{logger[_0x4c0f('0x1b')](_0x4c0f('0x28'),_0x5cfc6e);return _0x532793[_0x4c0f('0x29')]()[_0x4c0f('0x23')](function(_0x54c34c){return BPromise[_0x4c0f('0x26')]({'id':_0x54c34c[_0x4c0f('0x2b')],'name':_0x54c34c[_0x4c0f('0x2a')]});});}}function getEndUser(_0x23b417,_0xceb5f0,_0x137610,_0x47b604,_0x4aa840){var _0x614617={'$or':{'Phone':_0x47b604}};var _0xf5af31={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x4c0f('0x26')]()[_0x4c0f('0x23')](function(){logger[_0x4c0f('0x1b')](_0x4c0f('0x2c'),_0x47b604,_0xceb5f0['moduleSearch']);switch(_0xceb5f0[_0x4c0f('0x2d')]){case'contact_lead':var _0x1997c4=_['cloneDeep'](_0x614617);if(_0xceb5f0['additionalSearchContact']){var _0x8d8b4b={};_0x8d8b4b[_0xceb5f0[_0x4c0f('0x2e')]]=_0x47b604;_['merge'](_0x1997c4[_0x4c0f('0x2f')],_0x8d8b4b);}return _0x4aa840['sobject']('Contact')[_0x4c0f('0x21')](_0x1997c4,_0xf5af31)['execute']()[_0x4c0f('0x23')](function(_0x227f13){if(_0x227f13&&_0x227f13[_0x4c0f('0x24')]){return _0x227f13;}else{var _0xe054c=_[_0x4c0f('0x30')](_0x614617);if(_0xceb5f0[_0x4c0f('0x31')]){var _0x3df333={};_0x3df333[_0xceb5f0['additionalSearchLead']]=_0x47b604;_[_0x4c0f('0x32')](_0xe054c[_0x4c0f('0x2f')],_0x3df333);}return _0x4aa840['sobject'](_0x4c0f('0x33'))['find'](_0xe054c,_0xf5af31);}});case'account_contact_lead':var _0x44bdcf=_[_0x4c0f('0x30')](_0x614617);if(_0xceb5f0[_0x4c0f('0x34')]){var _0x8d8b4b={};_0x8d8b4b[_0xceb5f0[_0x4c0f('0x34')]]=_0x47b604;_[_0x4c0f('0x32')](_0x44bdcf[_0x4c0f('0x2f')],_0x8d8b4b);}return _0x4aa840['sobject']('Account')[_0x4c0f('0x21')](_0x44bdcf,_0xf5af31)['execute']()['then'](function(_0x12c9a6){if(_0x12c9a6&&_0x12c9a6[_0x4c0f('0x24')]){return _0x12c9a6;}else{var _0xc05af0=_[_0x4c0f('0x30')](_0x614617);if(_0xceb5f0[_0x4c0f('0x2e')]){var _0x2a8718={};_0x2a8718[_0xceb5f0[_0x4c0f('0x2e')]]=_0x47b604;_['merge'](_0xc05af0['$or'],_0x2a8718);}return _0x4aa840[_0x4c0f('0x1d')](_0x4c0f('0x35'))[_0x4c0f('0x21')](_0xc05af0,_0xf5af31)[_0x4c0f('0x23')](function(_0x51a1be){if(_0x51a1be&&_0x51a1be[_0x4c0f('0x24')]){return _0x51a1be;}else{var _0x6e4aff=_[_0x4c0f('0x30')](_0x614617);if(_0xceb5f0[_0x4c0f('0x31')]){var _0x5bf11c={};_0x5bf11c[_0xceb5f0['additionalSearchLead']]=_0x47b604;_[_0x4c0f('0x32')](_0x6e4aff[_0x4c0f('0x2f')],_0x5bf11c);}return _0x4aa840[_0x4c0f('0x1d')](_0x4c0f('0x33'))[_0x4c0f('0x21')](_0x6e4aff,_0xf5af31);}});}});case _0x4c0f('0x14'):var _0x1997c4=_['cloneDeep'](_0x614617);if(_0xceb5f0[_0x4c0f('0x2e')]){var _0x8d8b4b={};_0x8d8b4b[_0xceb5f0['additionalSearchContact']]=_0x47b604;_['merge'](_0x1997c4[_0x4c0f('0x2f')],_0x8d8b4b);}return _0x4aa840['sobject']('Contact')[_0x4c0f('0x21')](_0x1997c4,_0xf5af31)[_0x4c0f('0x22')]();case _0x4c0f('0x19'):var _0x118b4e=_[_0x4c0f('0x30')](_0x614617);if(_0xceb5f0[_0x4c0f('0x31')]){var _0x8d8b4b={};_0x8d8b4b[_0xceb5f0[_0x4c0f('0x31')]]=_0x47b604;_[_0x4c0f('0x32')](_0x118b4e[_0x4c0f('0x2f')],_0x8d8b4b);}return _0x4aa840[_0x4c0f('0x1d')](_0x4c0f('0x33'))[_0x4c0f('0x21')](_0x118b4e,_0xf5af31);case'account':var _0x44bdcf=_[_0x4c0f('0x30')](_0x614617);if(_0xceb5f0[_0x4c0f('0x34')]){var _0x8d8b4b={};_0x8d8b4b[_0xceb5f0[_0x4c0f('0x34')]]=_0x47b604;_['merge'](_0x44bdcf[_0x4c0f('0x2f')],_0x8d8b4b);}return _0x4aa840[_0x4c0f('0x1d')](_0x4c0f('0x36'))[_0x4c0f('0x21')](_0x44bdcf,_0xf5af31);default:return null;}})[_0x4c0f('0x23')](function(_0x161474){if(_0x161474&&_0x161474[_0x4c0f('0x24')]){var _0x3d4ba0=_[_0x4c0f('0x37')](_0x161474);if(_0x3d4ba0){return BPromise[_0x4c0f('0x26')]({'id':_0x3d4ba0['Id'],'name':_0x3d4ba0['Name'],'phone':_0x3d4ba0[_0x4c0f('0x38')],'endUserType':_0x3d4ba0[_0x4c0f('0x39')][_0x4c0f('0x3a')][_0x4c0f('0x3b')]()});}}})[_0x4c0f('0x23')](function(_0x8feb01){if(_0x8feb01){logger[_0x4c0f('0x1b')](_0x4c0f('0x3c'),_0x8feb01[_0x4c0f('0x13')],_0x47b604);return BPromise['resolve'](_0x8feb01);}else{logger[_0x4c0f('0x1b')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x47b604);var _0x18d96d={'Phone':_0x47b604};if(_0xceb5f0[_0x4c0f('0x3d')]){if(_0xceb5f0[_0x4c0f('0x3d')]===_0x4c0f('0x14')){logger[_0x4c0f('0x1b')](_0x4c0f('0x3e'),_0x47b604,_0xceb5f0[_0x4c0f('0x3d')]);_0x18d96d['LastName']=_0x137610!==_0x4c0f('0x3f')?_0x137610:util[_0x4c0f('0x40')](_0x4c0f('0x41'),_0x47b604);}else if(_0xceb5f0[_0x4c0f('0x3d')]==='lead'){logger[_0x4c0f('0x1b')](_0x4c0f('0x3e'),_0x47b604,_0xceb5f0[_0x4c0f('0x3d')]);_0x18d96d[_0x4c0f('0x42')]=_0x137610!==_0x4c0f('0x3f')?_0x137610:util[_0x4c0f('0x40')]('Caller\x20-\x20%s',_0x47b604);_0x18d96d[_0x4c0f('0x43')]=_0x4c0f('0x44');}else if(_0xceb5f0[_0x4c0f('0x3d')]===_0x4c0f('0x15')){logger[_0x4c0f('0x1b')](_0x4c0f('0x3e'),_0x47b604,_0xceb5f0['moduleCreate']);_0x18d96d[_0x4c0f('0x27')]=_0x137610!==_0x4c0f('0x3f')?_0x137610:util[_0x4c0f('0x40')](_0x4c0f('0x41'),_0x47b604);}else{return null;}}return _0x4aa840[_0x4c0f('0x1d')](_[_0x4c0f('0x45')](_0xceb5f0[_0x4c0f('0x3d')]))[_0x4c0f('0x1e')](_0x18d96d)[_0x4c0f('0x23')](function(_0x4b3a95){return BPromise[_0x4c0f('0x26')]({'id':_0x4b3a95['id'],'endUserType':_0xceb5f0[_0x4c0f('0x3d')]});});}});}function getCustomFields(_0x277e45,_0x57a6e4){var _0x4f7ae5={};if(_0x277e45['length']>0x0){_[_0x4c0f('0x46')](_0x277e45,function(_0x45eb2e){if(_[_0x4c0f('0x47')]([_0x4c0f('0x48'),_0x4c0f('0x49')],_0x45eb2e[_0x4c0f('0x3a')])&&_0x45eb2e[_0x4c0f('0x4a')]){_0x4f7ae5[_0x45eb2e[_0x4c0f('0x4a')]]=_0x45eb2e['content']['toString']();}else if(_0x45eb2e[_0x4c0f('0x3a')]===_0x4c0f('0x4b')&&_0x45eb2e['variableName']&&_0x45eb2e[_0x4c0f('0x4a')]){_0x57a6e4[_0x45eb2e[_0x4c0f('0x4c')]]&&(_0x4f7ae5[_0x45eb2e['idField']]=_0x57a6e4[_0x45eb2e[_0x4c0f('0x4c')]][_0x4c0f('0x4d')]());}else if(_0x45eb2e[_0x4c0f('0x3a')]===_0x4c0f('0x4e')&&_0x45eb2e['Variable']&&_0x45eb2e[_0x4c0f('0x4f')][_0x4c0f('0x50')]&&_0x45eb2e[_0x4c0f('0x4a')]){_0x57a6e4[_0x45eb2e[_0x4c0f('0x4f')][_0x4c0f('0x50')][_0x4c0f('0x3b')]()]&&(_0x4f7ae5[_0x45eb2e[_0x4c0f('0x4a')]]=_0x57a6e4[_0x45eb2e[_0x4c0f('0x4f')]['name'][_0x4c0f('0x3b')]()][_0x4c0f('0x4d')]());}});}return _0x4f7ae5;}function getConnection(_0x37f051){var _0x3e6481=_0x37f051['password'][_0x4c0f('0x51')](_0x37f051[_0x4c0f('0x52')]);var _0x355841=new jsforce[(_0x4c0f('0x53'))]({'oauth2':{'loginUrl':_0x37f051['remoteUri']||'https://login.salesforce.com','clientId':_0x37f051['clientId'],'clientSecret':_0x37f051[_0x4c0f('0x54')]}});return _0x355841['login'](_0x37f051[_0x4c0f('0x55')],_0x3e6481)[_0x4c0f('0x23')](function(){logger[_0x4c0f('0x1b')](_0x4c0f('0x56'));return _0x355841;});}exports[_0x4c0f('0x57')]=function(_0x6e949d,_0x39c576,_0x20c55f,_0x18c22c,_0x40eb96,_0x4ecaf2){var _0x1546d9,_0xb772c6,_0x4a4bc8,_0x470fff;_0x4ecaf2[_0x4c0f('0x58')]=intUtil[_0x4c0f('0x59')](_0x4ecaf2[_0x4c0f('0x58')]);_0x4ecaf2[_0x4c0f('0x5a')]=intUtil[_0x4c0f('0x59')](_0x4ecaf2[_0x4c0f('0x5a')]);if(_0x40eb96&&_0x40eb96[_0x4c0f('0x5b')]){logger['info'](_0x4c0f('0x5c'),'Recording\x20is\x20enabled!');_0x39c576[_0x4c0f('0x5d')]=util['format'](_0x4c0f('0x5e'),_0x4ecaf2['serverUrl'],_0x39c576[_0x4c0f('0x5f')],md5(_0x39c576['uniqueid']));}else{_0x39c576[_0x4c0f('0x5d')]='';}return getConnection(_0x4ecaf2)[_0x4c0f('0x23')](function(_0x5e13f5){_0x470fff=_0x5e13f5;return getUser(_0x4ecaf2,_0x18c22c[_0x4c0f('0x60')],_0x470fff);})[_0x4c0f('0x23')](function(_0x253cc3){_0x1546d9=_0x253cc3;return getEndUser(_0x4ecaf2,_0x20c55f,_0x39c576[_0x4c0f('0x61')],_0x39c576[_0x4c0f('0x62')],_0x470fff);})[_0x4c0f('0x23')](function(_0x3475cf){_0xb772c6=_0x3475cf;return getTicket(_0x4ecaf2,_0x1546d9,_0xb772c6,_0x20c55f,_0x39c576,_0x20c55f[_0x4c0f('0x63')],_0x470fff,_0x4c0f('0x57'));})['then'](function(_0x49bb0b){_0x4a4bc8=_0x49bb0b;logger[_0x4c0f('0x1b')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x4a4bc8['id']);logger[_0x4c0f('0x1b')](_0x4c0f('0x64'),_0x4a4bc8['id'],_0x18c22c[_0x4c0f('0x50')],_0x4ecaf2[_0x4c0f('0x3a')]);switch(_0x4ecaf2['type']){case _0x4c0f('0x65'):emit(util['format']('user:%s',_0x18c22c[_0x4c0f('0x50')]),_0x4c0f('0x66'),{'recordId':_0x4a4bc8['id']});break;case _0x4c0f('0x67'):emit(util[_0x4c0f('0x40')]('user:%s',_0x18c22c[_0x4c0f('0x50')]),_0x4c0f('0x68'),{'uri':util[_0x4c0f('0x40')](_0x4c0f('0x69'),_0x470fff[_0x4c0f('0x6a')],_0x4a4bc8['id'])});break;default:logger['error']('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x4c0f('0x6b')](function(_0x2a5c87){logger[_0x4c0f('0x6c')]('[QUEUE]',_0x2a5c87);});};exports[_0x4c0f('0x6d')]=function(_0x3f0831,_0x474c8f,_0x4ccbec,_0x5cc58a,_0x3772b1,_0x20d104,_0xa90d96){var _0x2b63e9,_0x31d21f,_0x315a6c,_0x2db689;_0x20d104[_0x4c0f('0x58')]=intUtil[_0x4c0f('0x59')](_0x20d104[_0x4c0f('0x58')]);_0x20d104['remoteUri']=intUtil[_0x4c0f('0x59')](_0x20d104[_0x4c0f('0x5a')]);if(_0xa90d96&&_0xa90d96[_0x4c0f('0x6e')]&&_0xa90d96[_0x4c0f('0x6e')]!==_0x4c0f('0x6f')){logger[_0x4c0f('0x1b')](_0x4c0f('0x70'),_0x4c0f('0x71'));_0x474c8f[_0x4c0f('0x5d')]=util[_0x4c0f('0x40')](_0x4c0f('0x5e'),_0x20d104['serverUrl'],_0x474c8f[_0x4c0f('0x5f')],md5(_0x474c8f[_0x4c0f('0x5f')]));}return getConnection(_0x20d104)[_0x4c0f('0x23')](function(_0x260aec){_0x2db689=_0x260aec;return getUser(_0x20d104,_0x5cc58a['email'],_0x2db689);})[_0x4c0f('0x23')](function(_0x725919){_0x2b63e9=_0x725919;return getEndUser(_0x20d104,_0x4ccbec,_0x474c8f[_0x4c0f('0x72')],_0x474c8f[_0x4c0f('0x73')],_0x2db689);})['then'](function(_0x9ca579){_0x31d21f=_0x9ca579;return getTicket(_0x20d104,_0x2b63e9,_0x31d21f,_0x4ccbec,_0x474c8f,_0x4ccbec['Fields'],_0x2db689,_0x4c0f('0x6d'));})[_0x4c0f('0x23')](function(_0x52b4f1){_0x315a6c=_0x52b4f1;logger[_0x4c0f('0x1b')](_0x4c0f('0x74'),_0x315a6c['id']);logger['info'](_0x4c0f('0x75'),_0x315a6c['id'],_0x5cc58a[_0x4c0f('0x50')],_0x20d104['type']);switch(_0x20d104[_0x4c0f('0x3a')]){case _0x4c0f('0x65'):emit(util[_0x4c0f('0x40')]('user:%s',_0x5cc58a[_0x4c0f('0x50')]),_0x4c0f('0x66'),{'recordId':_0x315a6c['id']});break;case _0x4c0f('0x67'):emit(util['format']('user:%s',_0x5cc58a[_0x4c0f('0x50')]),_0x4c0f('0x68'),{'uri':util[_0x4c0f('0x40')]('%s/%s/e',_0x2db689[_0x4c0f('0x6a')],_0x315a6c['id'])});break;default:logger[_0x4c0f('0x6c')]('[OUTBOUND]',_0x4c0f('0x76'));}})['catch'](function(_0x326521){logger[_0x4c0f('0x6c')](_0x4c0f('0x70'),_0x326521);});};exports['unmanaged']=function(_0x29c9f9,_0x58ae8a,_0x2ad5cf,_0x12289a,_0x4d1d58,_0x1c7126){var _0x459cad,_0x27c11f,_0x3e15b8,_0x19820a;_0x1c7126[_0x4c0f('0x58')]=intUtil[_0x4c0f('0x59')](_0x1c7126[_0x4c0f('0x58')]);_0x1c7126[_0x4c0f('0x5a')]=intUtil[_0x4c0f('0x59')](_0x1c7126[_0x4c0f('0x5a')]);if(_0x4d1d58&&_0x4d1d58['monitor_format']){logger[_0x4c0f('0x1b')]('['+_0x58ae8a[_0x4c0f('0x77')][_0x4c0f('0x78')]()+']',_0x4c0f('0x71'));_0x58ae8a[_0x4c0f('0x5d')]=util[_0x4c0f('0x40')](_0x4c0f('0x5e'),_0x1c7126[_0x4c0f('0x58')],_0x58ae8a[_0x4c0f('0x5f')],md5(_0x58ae8a['uniqueid']));}else{_0x58ae8a[_0x4c0f('0x5d')]='';}return getConnection(_0x1c7126)[_0x4c0f('0x23')](function(_0x577045){_0x19820a=_0x577045;if(!_[_0x4c0f('0x1f')](_0x12289a)){return getUser(_0x1c7126,_0x12289a[_0x4c0f('0x50')],_0x19820a);}else{return getUser(_0x1c7126,null,_0x19820a);}})['then'](function(_0x1866aa){_0x459cad=_0x1866aa;return getEndUser(_0x1c7126,_0x2ad5cf,_0x58ae8a['calleridname'],_0x58ae8a['calleridnum'],_0x19820a);})['then'](function(_0x4a2b70){_0x27c11f=_0x4a2b70;return getTicket(_0x1c7126,_0x459cad,_0x27c11f,_0x2ad5cf,_0x58ae8a,_0x2ad5cf[_0x4c0f('0x63')],_0x19820a);})[_0x4c0f('0x23')](function(_0x468429){_0x3e15b8=_0x468429;logger[_0x4c0f('0x1b')]('['+_0x58ae8a[_0x4c0f('0x77')][_0x4c0f('0x78')]()+_0x4c0f('0x79'),_0x3e15b8['id']);logger[_0x4c0f('0x1b')]('['+_0x58ae8a['lastevent']['toUpperCase']()+_0x4c0f('0x7a'),_0x1c7126[_0x4c0f('0x3a')]);})['catch'](function(_0x16ba24){logger['error']('['+_0x58ae8a[_0x4c0f('0x77')][_0x4c0f('0x78')]()+']',_0x16ba24);});}; \ 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 3e6fd3d..a4a78c5 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 _0x8fec=['push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','true','userId','adminEmail','],\x20getUser\x20crm','],\x20createEndUser\x20input\x20crm','POST','user','endUserNumber','endUserId','error','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','nameField','toLowerCase','type','idField','customField','content','toString','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','incident','Incident','ticketId','Incident\x20-\x20'];(function(_0x2eea00,_0x9b5ba5){var _0xcd5f98=function(_0xd54a6c){while(--_0xd54a6c){_0x2eea00['push'](_0x2eea00['shift']());}};_0xcd5f98(++_0x9b5ba5);}(_0x8fec,0xf8));var _0xc8fe=function(_0x2bde1e,_0x48f914){_0x2bde1e=_0x2bde1e-0x0;var _0xebf89b=_0x8fec[_0x2bde1e];return _0xebf89b;};'use strict';var _=require('lodash');var Promise=require(_0xc8fe('0x0'));var rp=require(_0xc8fe('0x1'));var util=require(_0xc8fe('0x2'));var md5=require(_0xc8fe('0x3'));var Redis=require(_0xc8fe('0x4'));var intUtil=require(_0xc8fe('0x5'));var config=require('../../../../config/environment');var logger=require(_0xc8fe('0x6'))(_0xc8fe('0x7'));config[_0xc8fe('0x8')]=_['defaults'](config[_0xc8fe('0x8')],{'host':_0xc8fe('0x9'),'port':0x18eb});var io=require(_0xc8fe('0xa'))(new Redis(config[_0xc8fe('0x8')]));function getAdminUser(_0x5a4660,_0x298ee8,_0x192186,_0x14328a,_0x346b4f,_0x56d116){return new Promise(function(_0x308662,_0x35a866){var _0x2e290f={'method':_0xc8fe('0xb'),'uri':_0x14328a+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x346b4f+'&'+_0x56d116,'auth':_0x298ee8,'json':!![]};return rp(_0x2e290f)[_0xc8fe('0xc')](function(_0x551574){if(_0x551574[_0xc8fe('0xd')][_0xc8fe('0xe')]>0x0){_0x192186[_0xc8fe('0xf')]=_0x551574[_0xc8fe('0xd')][0x0][_0xc8fe('0x10')];}logger[_0xc8fe('0x11')]('['+[_0x5a4660[_0xc8fe('0x12')]()]+_0xc8fe('0x13'),_0x192186);_0x308662(_0x192186);})[_0xc8fe('0x14')](function(_0x472a0b){logger['error']('['+[_0x5a4660['toUpperCase']()]+']',_0x472a0b['message']);_0x35a866(_0x472a0b[_0xc8fe('0x15')]);});});}function getUser(_0x30414a,_0x552eaa,_0x2195c3,_0x33adfe,_0x9ef902){return function(_0x149102){logger['info']('['+[_0x30414a[_0xc8fe('0x12')]()]+_0xc8fe('0x16'),_0x149102);return new Promise(function(_0xb56b55,_0x456853){if(intUtil[_0xc8fe('0x17')](_0x149102[_0xc8fe('0x18')])){var _0x12f0c9={'method':_0xc8fe('0xb'),'uri':_0x2195c3+_0xc8fe('0x19')+_0x149102[_0xc8fe('0x18')]+'&'+_0x33adfe+'&'+_0x9ef902,'auth':_0x552eaa,'json':!![]};logger['info']('['+[_0x30414a[_0xc8fe('0x12')]()]+_0xc8fe('0x1a'),_0x12f0c9);return rp(_0x12f0c9)[_0xc8fe('0xc')](function(_0x482a82){logger[_0xc8fe('0x11')]('['+[_0x30414a['toUpperCase']()]+_0xc8fe('0x1b'),_0x482a82);if(_0x482a82[_0xc8fe('0xd')][_0xc8fe('0xe')]>0x0&&String(_0x482a82[_0xc8fe('0xd')][0x0]['active'])===_0xc8fe('0x1c')){_0x149102[_0xc8fe('0x1d')]=_0x482a82[_0xc8fe('0xd')][0x0][_0xc8fe('0x10')];}else{_0x149102[_0xc8fe('0x1d')]=_0x149102[_0xc8fe('0xf')];_0x149102[_0xc8fe('0x18')]=_0x149102[_0xc8fe('0x1e')];}logger[_0xc8fe('0x11')]('['+[_0x30414a[_0xc8fe('0x12')]()]+_0xc8fe('0x1f'),_0x149102);_0xb56b55(_0x149102);})[_0xc8fe('0x14')](function(_0x2e802f){logger['error']('['+[_0x30414a[_0xc8fe('0x12')]()]+']',_0x2e802f['message']);_0x456853(_0x2e802f[_0xc8fe('0x15')]);});}else{logger[_0xc8fe('0x11')]('['+[_0x30414a[_0xc8fe('0x12')]()]+']\x20using\x20admin\x20profile');_0x149102['userId']=_0x149102['adminId'];_0x149102['userEmail']=_0x149102['adminEmail'];_0xb56b55(_0x149102);}});};}function createEndUser(_0x35e7ba,_0x36a509,_0x361446,_0xf59d7c,_0x59ba9c){logger['info']('['+[_0x35e7ba[_0xc8fe('0x12')]()]+_0xc8fe('0x20'),_0x361446);return new Promise(function(_0x32bd0a,_0x36eb64){var _0x5737af={'method':_0xc8fe('0x21'),'uri':_0xf59d7c+'sys_user?'+_0x59ba9c,'body':{'user_name':_0x361446['endUserNumber'],'roles':_0xc8fe('0x22'),'first_name':_0x361446[_0xc8fe('0x23')],'active':'true','date_format':'System','phone':_0x361446[_0xc8fe('0x23')]},'auth':_0x36a509,'json':!![]};return rp(_0x5737af)[_0xc8fe('0xc')](function(_0x3e2bb2){logger['info']('['+[_0x35e7ba[_0xc8fe('0x12')]()]+'],\x20EndUser\x20schema',_0x3e2bb2[_0xc8fe('0xd')]);_0x361446[_0xc8fe('0x24')]=_0x3e2bb2[_0xc8fe('0xd')][_0xc8fe('0x10')];_0x32bd0a(_0x361446);})[_0xc8fe('0x14')](function(_0x2531f7){logger[_0xc8fe('0x25')]('['+[_0x35e7ba[_0xc8fe('0x12')]()]+']',_0x2531f7[_0xc8fe('0x15')]);_0x36eb64(_0x2531f7[_0xc8fe('0x15')]);});});}function getEndUser(_0x3cad54,_0x3afc35,_0xfc1c57,_0x2ecfca,_0x2a43db){return function(_0x4f23de){logger[_0xc8fe('0x11')]('['+[_0x3cad54[_0xc8fe('0x12')]()]+'],\x20getEndUser\x20input\x20crm',_0x4f23de);return new Promise(function(_0x247794,_0x1fd2a5){var _0x48afbe={'method':_0xc8fe('0xb'),'uri':_0xfc1c57+_0xc8fe('0x26')+_0x4f23de[_0xc8fe('0x23')]+'&'+_0x2ecfca+'&'+_0x2a43db,'auth':_0x3afc35,'json':!![]};return rp(_0x48afbe)[_0xc8fe('0xc')](function(_0xd7c97e){if(_0xd7c97e['result'][_0xc8fe('0xe')]>0x0){_0x4f23de[_0xc8fe('0x24')]=_0xd7c97e[_0xc8fe('0xd')][0x0][_0xc8fe('0x10')];logger[_0xc8fe('0x11')]('['+[_0x3cad54['toUpperCase']()]+_0xc8fe('0x27'),_0x4f23de);_0x247794(_0x4f23de);}else{return createEndUser(_0x3cad54,_0x3afc35,_0x4f23de,_0xfc1c57,_0x2ecfca)[_0xc8fe('0xc')](function(_0x2fba53){logger[_0xc8fe('0x11')]('['+[_0x3cad54['toUpperCase']()]+_0xc8fe('0x28'),_0x2fba53);_0x247794(_0x2fba53);});}})[_0xc8fe('0x14')](function(_0x4d5df0){logger['error']('['+[_0x3cad54[_0xc8fe('0x12')]()]+']',_0x4d5df0[_0xc8fe('0x15')]);_0x1fd2a5(_0x4d5df0[_0xc8fe('0x15')]);});});};}function getCustomFields(_0x56e100,_0x1fba48){var _0x23f4ac={};if(_0x56e100[_0xc8fe('0xe')]>0x0){_[_0xc8fe('0x29')](_0x56e100,function(_0x346994){if(_[_0xc8fe('0x2a')]([_0xc8fe('0x2b'),'picklist'],_0x346994['type'])&&_0x346994[_0xc8fe('0x2c')]&&!_0x346994['customField']){_0x23f4ac[_0x346994[_0xc8fe('0x2c')][_0xc8fe('0x2d')]()]=_0x346994['content']['toString']();}else if(_[_0xc8fe('0x2a')]([_0xc8fe('0x2b'),'picklist'],_0x346994[_0xc8fe('0x2e')])&&_0x346994[_0xc8fe('0x2f')]&&_0x346994[_0xc8fe('0x30')]){_0x23f4ac[_0x346994[_0xc8fe('0x2f')][_0xc8fe('0x2d')]()]=_0x346994[_0xc8fe('0x31')][_0xc8fe('0x32')]();}else if(_0x346994[_0xc8fe('0x2e')]==='variable'&&_0x346994['variableName']&&_0x346994[_0xc8fe('0x2f')]&&_0x346994[_0xc8fe('0x30')]){_0x23f4ac[_0x346994[_0xc8fe('0x2f')]['toLowerCase']()]=_0x1fba48[_0x346994[_0xc8fe('0x33')]]['toString']();}else if(_0x346994['type']===_0xc8fe('0x34')&&_0x346994[_0xc8fe('0x35')]&&_0x346994[_0xc8fe('0x35')][_0xc8fe('0x36')]&&_0x346994[_0xc8fe('0x2f')]&&_0x346994[_0xc8fe('0x30')]){_0x23f4ac[_0x346994[_0xc8fe('0x2f')][_0xc8fe('0x2d')]()]=_0x1fba48[_0x346994['Variable'][_0xc8fe('0x36')][_0xc8fe('0x2d')]()]['toString']();}});}return _0x23f4ac;}function getTicket(_0x379096,_0x386d2c,_0x39485d,_0x40787b,_0x2c3434,_0x1b3fb9){return function(_0x19eec5){logger['info']('['+[_0x379096['toUpperCase']()]+_0xc8fe('0x37'),_0x19eec5);return new Promise(function(_0x48bdb8,_0x211005){var _0x54ffd3=_0x379096[_0xc8fe('0x2d')]()==='outbound'?_0x19eec5[_0xc8fe('0x1d')]:_0x19eec5[_0xc8fe('0x24')];var _0x46351a={'method':'POST','uri':_0x39485d+'incident'+'?'+_0x1b3fb9,'body':Object[_0xc8fe('0x38')]({},{'active':_0xc8fe('0x1c'),'caller_id':_0x54ffd3,'assigned_to':_0x19eec5[_0xc8fe('0x1d')],'short_description':intUtil[_0xc8fe('0x39')](_0x40787b[_0xc8fe('0x3a')],_0x2c3434,'\x20'),'description':intUtil[_0xc8fe('0x39')](_0x40787b['Descriptions'],_0x2c3434,'\x0a')},getCustomFields(_0x40787b[_0xc8fe('0x3b')],_0x2c3434)),'auth':_0x386d2c,'json':!![]};return rp(_0x46351a)['then'](function(_0x1e524f){logger[_0xc8fe('0x11')]('['+[_0x379096[_0xc8fe('0x12')]()]+_0xc8fe('0x3c'),_0x1e524f[_0xc8fe('0xd')]);_0x19eec5['ticketId']=_0x1e524f[_0xc8fe('0xd')][_0xc8fe('0x10')];_0x19eec5[_0xc8fe('0x3d')]=_0x1e524f['result']['number'];logger['info']('['+[_0x379096[_0xc8fe('0x12')]()]+_0xc8fe('0x3e'),_0x19eec5);_0x48bdb8(_0x19eec5);})[_0xc8fe('0x14')](function(_0x2507d2){logger[_0xc8fe('0x25')]('['+[_0x379096[_0xc8fe('0x12')]()]+']',_0x2507d2[_0xc8fe('0x15')]);_0x211005(_0x2507d2['message']);});});};}function createRemoteTag(_0x10af10,_0xfdefc2,_0x2dec51,_0x50d296){return new Promise(function(_0x3c0523,_0xa280ce){var _0x1188e1={'method':_0xc8fe('0x21'),'uri':_0x2dec51+_0xc8fe('0x3f')+'?'+_0x50d296,'body':{'short_description':_0x10af10,'global':!![],'active':!![],'name':_0x10af10},'auth':_0xfdefc2,'json':!![]};return rp(_0x1188e1)[_0xc8fe('0xc')](function(_0x416ede){var _0x4c1ddd=_0x416ede[_0xc8fe('0xd')]['sys_id'];_0x3c0523(_0x4c1ddd);});});}function getRemoteTag(_0x1dbcfc,_0x482ff6,_0x31ae81,_0x588d90,_0x384792){return new Promise(function(_0x1b3f4c,_0x5ee6c0){var _0x1c754d={'method':'GET','uri':_0x31ae81+_0xc8fe('0x3f')+_0xc8fe('0x40')+_0x1dbcfc+'&'+_0x588d90,'auth':_0x482ff6,'json':!![]};return rp(_0x1c754d)['then'](function(_0x4a8077){if(_0x4a8077[_0xc8fe('0xd')][_0xc8fe('0xe')]>0x0){var _0x8666dd=_0x4a8077[_0xc8fe('0xd')][0x0]['sys_id'];_0x1b3f4c(_0x8666dd);}else{return createRemoteTag(_0x1dbcfc,_0x482ff6,_0x31ae81,_0x588d90)[_0xc8fe('0xc')](function(_0x49f216){_0x1b3f4c(_0x49f216);});}});});}function assignTagToIncident(_0x2926b6,_0x1940c6,_0x6d6efa,_0x23c4c7,_0x582c52){return new Promise(function(_0x2c9bf8,_0x13f8ad){var _0x542b02={'method':_0xc8fe('0x21'),'uri':_0x6d6efa+_0xc8fe('0x41')+'?'+_0x582c52,'body':{'label':_0x2926b6,'table':_0xc8fe('0x42'),'id_type':_0xc8fe('0x43'),'table_key':_0x23c4c7[_0xc8fe('0x44')],'title':_0xc8fe('0x45')+_0x23c4c7[_0xc8fe('0x3d')],'id_display':_0x23c4c7[_0xc8fe('0x3d')]},'auth':_0x1940c6,'json':!![]};return rp(_0x542b02)[_0xc8fe('0xc')](function(_0x4f6757){_0x2c9bf8();})[_0xc8fe('0x14')](function(){_0x2c9bf8();});});}function manageTags(_0x2a9a50,_0x5342fb,_0x31a941,_0x30a6d8,_0x30ff1f,_0x5680ce,_0x28f1c2){return new Promise(function(_0x46fc44,_0x9991b5){var _0x4f6d73=[];_0x5342fb[_0xc8fe('0x29')](function(_0x1b713f){_0x4f6d73[_0xc8fe('0x46')](getRemoteTag(_0x1b713f,_0x31a941,_0x30a6d8,_0x5680ce,_0x28f1c2));});return Promise[_0xc8fe('0x47')](_0x4f6d73)['then'](function(_0x406ae6){if(_0x406ae6['length']){logger[_0xc8fe('0x11')]('['+[_0x2a9a50['toUpperCase']()]+_0xc8fe('0x48'),_0x406ae6);var _0x5d8de9=[];_0x406ae6[_0xc8fe('0x29')](function(_0x20603d){_0x5d8de9['push'](assignTagToIncident(_0x20603d,_0x31a941,_0x30a6d8,_0x30ff1f,_0x5680ce));});return Promise[_0xc8fe('0x47')](_0x5d8de9)[_0xc8fe('0xc')](function(){_0x46fc44();})['catch'](function(){_0x46fc44();});}else{_0x46fc44();}});});}function getTags(_0x445c6f,_0x46c1f9,_0x272a5b,_0x1475ad,_0x106269,_0x297c91){return function(_0x54a288){return new Promise(function(_0x163043,_0x14d9cf){var _0x338dbe=[];var _0x56761c=_0x1475ad[_0xc8fe('0x49')];if(_0x56761c&&_0x56761c[_0xc8fe('0xe')]>0x0){_0x338dbe=_[_0xc8fe('0x4a')](_0x56761c,_0xc8fe('0x36'));}if(_0x338dbe[_0xc8fe('0xe')]>0x0){return manageTags(_0x445c6f,_0x338dbe,_0x46c1f9,_0x272a5b,_0x54a288,_0x106269,_0x297c91)[_0xc8fe('0xc')](function(){_0x163043(_0x54a288);});}else{_0x163043(_0x54a288);}});};}function emit(_0x4d1caf,_0x24f42d,_0x2c83a5){var _0x116584=_0xc8fe('0x4b')+_0xc8fe('0x4c')+_0xc8fe('0x4d')+_0xc8fe('0x4e');var _0x59cbcc={'uri':_0x4d1caf+_0xc8fe('0x4f')+_0x2c83a5+_0x116584};io['to'](util['format'](_0xc8fe('0x50'),_0x24f42d))['emit'](_0xc8fe('0x51'),_0x59cbcc);}exports['cs']=function(_0x38f453,_0x45a225,_0x184433,_0x1423a5,_0x2f1928,_0xd1c641,_0x12dcf8,_0x5108a1){var _0x1276a4={};var _0x86104d={'user':_0xd1c641[_0xc8fe('0x52')],'pass':_0xd1c641[_0xc8fe('0x53')]};var _0x4c9265=_0xc8fe('0x54');var _0x2af50b='sysparm_display_value=true';_0xd1c641[_0xc8fe('0x55')]=intUtil[_0xc8fe('0x56')](_0xd1c641[_0xc8fe('0x55')]);_0xd1c641[_0xc8fe('0x57')]=intUtil[_0xc8fe('0x56')](_0xd1c641[_0xc8fe('0x57')]);var _0x4ed015=util[_0xc8fe('0x58')](_0xc8fe('0x59'),_0xd1c641[_0xc8fe('0x55')]);_0x1276a4['userEmail']=!_[_0xc8fe('0x5a')](_0x1423a5)?_0x1423a5['email']:null;_0x1276a4[_0xc8fe('0x1e')]=_0xd1c641['email'];_0x1276a4['endUserNumber']=_0x5108a1[_0xc8fe('0x2d')]()===_0xc8fe('0x5b')?_0x45a225[_0xc8fe('0x5c')]:_0x45a225[_0xc8fe('0x5d')];_0x1276a4[_0xc8fe('0x5e')]=_0x5108a1===_0xc8fe('0x5f')||_0x5108a1===_0xc8fe('0x60')?_0xc8fe('0x5f'):_0xc8fe('0x5b');var _0x36b99a=util[_0xc8fe('0x58')](_0xc8fe('0x61'),_0xd1c641['serverUrl'],_0x45a225[_0xc8fe('0x62')],md5(_0x45a225[_0xc8fe('0x62')]));if(_0x2f1928&&_0x2f1928['monitor_format']){logger[_0xc8fe('0x11')](_0xc8fe('0x63'),'Recording\x20is\x20enabled!');_0x45a225[_0xc8fe('0x64')]=_0x36b99a;}else if(_0x12dcf8&&_0x12dcf8[_0xc8fe('0x65')]&&_0x12dcf8[_0xc8fe('0x65')]!=='none'){logger[_0xc8fe('0x11')](_0xc8fe('0x66'),'Recording\x20is\x20enabled!');_0x45a225['recordingURL']=_0x36b99a;}else{_0x45a225[_0xc8fe('0x64')]='';}return getAdminUser(_0x5108a1,_0x86104d,_0x1276a4,_0x4ed015,_0x2af50b,_0x4c9265)['then'](getUser(_0x5108a1,_0x86104d,_0x4ed015,_0x2af50b,_0x4c9265))[_0xc8fe('0xc')](getEndUser(_0x5108a1,_0x86104d,_0x4ed015,_0x2af50b,_0x4c9265))['then'](getTicket(_0x5108a1,_0x86104d,_0x4ed015,_0x184433,_0x45a225,_0x2af50b))['then'](function(_0x31aa2e){logger[_0xc8fe('0x11')](util[_0xc8fe('0x58')]('The\x20ticket\x20ID\x20is:\x20%s',_0x31aa2e[_0xc8fe('0x44')]));logger[_0xc8fe('0x11')](util[_0xc8fe('0x58')](_0xc8fe('0x67'),_0x5108a1));if(_0x5108a1!==_0xc8fe('0x60')){logger[_0xc8fe('0x11')]('['+[_0x5108a1[_0xc8fe('0x12')]()]+']',_0xc8fe('0x68'));emit(_0xd1c641[_0xc8fe('0x55')],_0x1423a5['name'],_0x31aa2e[_0xc8fe('0x44')]);}})[_0xc8fe('0x14')](function(_0x24856d){logger[_0xc8fe('0x25')]('['+[_0x5108a1[_0xc8fe('0x12')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xc8fe('0x69')](_0x24856d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x7aaa=[']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','catch','length','forEach','includes','string','picklist','type','customField','content','toString','idField','toLowerCase','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','Incident','Incident\x20-\x20','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','util','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','defaults','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','sys_id','toUpperCase','error','message','info','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','active','true','userId','adminId','adminEmail'];(function(_0x69a451,_0x49fd37){var _0x3d6ef5=function(_0x27ebf4){while(--_0x27ebf4){_0x69a451['push'](_0x69a451['shift']());}};_0x3d6ef5(++_0x49fd37);}(_0x7aaa,0xbd));var _0xa7aa=function(_0x159454,_0x29f4f9){_0x159454=_0x159454-0x0;var _0x4311bb=_0x7aaa[_0x159454];return _0x4311bb;};'use strict';var _=require(_0xa7aa('0x0'));var Promise=require('bluebird');var rp=require('request-promise');var util=require(_0xa7aa('0x1'));var md5=require(_0xa7aa('0x2'));var Redis=require(_0xa7aa('0x3'));var intUtil=require('./util');var config=require(_0xa7aa('0x4'));var logger=require(_0xa7aa('0x5'))(_0xa7aa('0x6'));config['redis']=_[_0xa7aa('0x7')](config[_0xa7aa('0x8')],{'host':_0xa7aa('0x9'),'port':0x18eb});var io=require(_0xa7aa('0xa'))(new Redis(config['redis']));function getAdminUser(_0x494652,_0x526c90,_0x3f440d,_0x13745d,_0x2568af,_0x1e0674){return new Promise(function(_0x4e0ed,_0x31578c){var _0x496178={'method':_0xa7aa('0xb'),'uri':_0x13745d+_0xa7aa('0xc')+'&'+_0x2568af+'&'+_0x1e0674,'auth':_0x526c90,'json':!![]};return rp(_0x496178)['then'](function(_0x222c18){if(_0x222c18[_0xa7aa('0xd')]['length']>0x0){_0x3f440d['adminId']=_0x222c18[_0xa7aa('0xd')][0x0][_0xa7aa('0xe')];}logger['info']('['+[_0x494652[_0xa7aa('0xf')]()]+'],\x20getAdminUser\x20crm',_0x3f440d);_0x4e0ed(_0x3f440d);})['catch'](function(_0x10659b){logger[_0xa7aa('0x10')]('['+[_0x494652[_0xa7aa('0xf')]()]+']',_0x10659b[_0xa7aa('0x11')]);_0x31578c(_0x10659b[_0xa7aa('0x11')]);});});}function getUser(_0x1cf0a2,_0x365550,_0x2fe472,_0x5570bc,_0x333f44){return function(_0x148c37){logger[_0xa7aa('0x12')]('['+[_0x1cf0a2['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x148c37);return new Promise(function(_0x643022,_0x2fabfd){if(intUtil[_0xa7aa('0x13')](_0x148c37[_0xa7aa('0x14')])){var _0x49c0c4={'method':_0xa7aa('0xb'),'uri':_0x2fe472+_0xa7aa('0x15')+_0x148c37[_0xa7aa('0x14')]+'&'+_0x5570bc+'&'+_0x333f44,'auth':_0x365550,'json':!![]};logger[_0xa7aa('0x12')]('['+[_0x1cf0a2['toUpperCase']()]+_0xa7aa('0x16'),_0x49c0c4);return rp(_0x49c0c4)[_0xa7aa('0x17')](function(_0x5e7b3c){logger['info']('['+[_0x1cf0a2[_0xa7aa('0xf')]()]+'],\x20getUser\x20entity',_0x5e7b3c);if(_0x5e7b3c[_0xa7aa('0xd')]['length']>0x0&&String(_0x5e7b3c[_0xa7aa('0xd')][0x0][_0xa7aa('0x18')])===_0xa7aa('0x19')){_0x148c37[_0xa7aa('0x1a')]=_0x5e7b3c[_0xa7aa('0xd')][0x0][_0xa7aa('0xe')];}else{_0x148c37['userId']=_0x148c37[_0xa7aa('0x1b')];_0x148c37[_0xa7aa('0x14')]=_0x148c37[_0xa7aa('0x1c')];}logger[_0xa7aa('0x12')]('['+[_0x1cf0a2[_0xa7aa('0xf')]()]+'],\x20getUser\x20crm',_0x148c37);_0x643022(_0x148c37);})['catch'](function(_0x84f076){logger[_0xa7aa('0x10')]('['+[_0x1cf0a2['toUpperCase']()]+']',_0x84f076[_0xa7aa('0x11')]);_0x2fabfd(_0x84f076[_0xa7aa('0x11')]);});}else{logger[_0xa7aa('0x12')]('['+[_0x1cf0a2[_0xa7aa('0xf')]()]+_0xa7aa('0x1d'));_0x148c37[_0xa7aa('0x1a')]=_0x148c37['adminId'];_0x148c37[_0xa7aa('0x14')]=_0x148c37['adminEmail'];_0x643022(_0x148c37);}});};}function createEndUser(_0x52c320,_0x29b6e6,_0x2836ba,_0x426314,_0x5964b3){logger[_0xa7aa('0x12')]('['+[_0x52c320['toUpperCase']()]+_0xa7aa('0x1e'),_0x2836ba);return new Promise(function(_0x427da4,_0x9fbc97){var _0x14d933={'method':_0xa7aa('0x1f'),'uri':_0x426314+_0xa7aa('0x20')+_0x5964b3,'body':{'user_name':_0x2836ba[_0xa7aa('0x21')],'roles':_0xa7aa('0x22'),'first_name':_0x2836ba[_0xa7aa('0x21')],'active':_0xa7aa('0x19'),'date_format':'System','phone':_0x2836ba[_0xa7aa('0x21')]},'auth':_0x29b6e6,'json':!![]};return rp(_0x14d933)[_0xa7aa('0x17')](function(_0x558b93){logger[_0xa7aa('0x12')]('['+[_0x52c320[_0xa7aa('0xf')]()]+_0xa7aa('0x23'),_0x558b93['result']);_0x2836ba[_0xa7aa('0x24')]=_0x558b93['result'][_0xa7aa('0xe')];_0x427da4(_0x2836ba);})['catch'](function(_0x1c0c0d){logger['error']('['+[_0x52c320[_0xa7aa('0xf')]()]+']',_0x1c0c0d[_0xa7aa('0x11')]);_0x9fbc97(_0x1c0c0d['message']);});});}function getEndUser(_0x3afb36,_0x11e503,_0x1d8c3a,_0x507e73,_0x3d5142){return function(_0x328ad3){logger['info']('['+[_0x3afb36[_0xa7aa('0xf')]()]+'],\x20getEndUser\x20input\x20crm',_0x328ad3);return new Promise(function(_0x4522f9,_0x37da00){var _0x397ce5={'method':'GET','uri':_0x1d8c3a+'sys_user?sysparm_query=phone%3D'+_0x328ad3[_0xa7aa('0x21')]+'&'+_0x507e73+'&'+_0x3d5142,'auth':_0x11e503,'json':!![]};return rp(_0x397ce5)[_0xa7aa('0x17')](function(_0x30fbda){if(_0x30fbda[_0xa7aa('0xd')]['length']>0x0){_0x328ad3[_0xa7aa('0x24')]=_0x30fbda[_0xa7aa('0xd')][0x0][_0xa7aa('0xe')];logger['info']('['+[_0x3afb36[_0xa7aa('0xf')]()]+_0xa7aa('0x25'),_0x328ad3);_0x4522f9(_0x328ad3);}else{return createEndUser(_0x3afb36,_0x11e503,_0x328ad3,_0x1d8c3a,_0x507e73)[_0xa7aa('0x17')](function(_0x569a11){logger[_0xa7aa('0x12')]('['+[_0x3afb36[_0xa7aa('0xf')]()]+_0xa7aa('0x26'),_0x569a11);_0x4522f9(_0x569a11);});}})[_0xa7aa('0x27')](function(_0x30d09e){logger[_0xa7aa('0x10')]('['+[_0x3afb36[_0xa7aa('0xf')]()]+']',_0x30d09e['message']);_0x37da00(_0x30d09e['message']);});});};}function getCustomFields(_0x1e9d91,_0x286bd1){var _0x51b4aa={};if(_0x1e9d91[_0xa7aa('0x28')]>0x0){_[_0xa7aa('0x29')](_0x1e9d91,function(_0x39a6ef){if(_[_0xa7aa('0x2a')]([_0xa7aa('0x2b'),_0xa7aa('0x2c')],_0x39a6ef[_0xa7aa('0x2d')])&&_0x39a6ef['nameField']&&!_0x39a6ef[_0xa7aa('0x2e')]){_0x51b4aa[_0x39a6ef['nameField']['toLowerCase']()]=_0x39a6ef[_0xa7aa('0x2f')][_0xa7aa('0x30')]();}else if(_['includes']([_0xa7aa('0x2b'),_0xa7aa('0x2c')],_0x39a6ef[_0xa7aa('0x2d')])&&_0x39a6ef[_0xa7aa('0x31')]&&_0x39a6ef['customField']){_0x51b4aa[_0x39a6ef[_0xa7aa('0x31')][_0xa7aa('0x32')]()]=_0x39a6ef['content']['toString']();}else if(_0x39a6ef[_0xa7aa('0x2d')]===_0xa7aa('0x33')&&_0x39a6ef[_0xa7aa('0x34')]&&_0x39a6ef[_0xa7aa('0x31')]&&_0x39a6ef['customField']){_0x51b4aa[_0x39a6ef[_0xa7aa('0x31')]['toLowerCase']()]=_0x286bd1[_0x39a6ef[_0xa7aa('0x34')]][_0xa7aa('0x30')]();}else if(_0x39a6ef[_0xa7aa('0x2d')]===_0xa7aa('0x35')&&_0x39a6ef['Variable']&&_0x39a6ef[_0xa7aa('0x36')][_0xa7aa('0x37')]&&_0x39a6ef[_0xa7aa('0x31')]&&_0x39a6ef['customField']){_0x51b4aa[_0x39a6ef[_0xa7aa('0x31')]['toLowerCase']()]=_0x286bd1[_0x39a6ef[_0xa7aa('0x36')][_0xa7aa('0x37')][_0xa7aa('0x32')]()][_0xa7aa('0x30')]();}});}return _0x51b4aa;}function getTicket(_0x1c1fb5,_0x29c863,_0x43df74,_0x152a46,_0x2af6e2,_0x5d69fa){return function(_0x3e1897){logger[_0xa7aa('0x12')]('['+[_0x1c1fb5['toUpperCase']()]+_0xa7aa('0x38'),_0x3e1897);return new Promise(function(_0x84d08c,_0x295d1e){var _0x51bb0f=_0x1c1fb5[_0xa7aa('0x32')]()===_0xa7aa('0x39')?_0x3e1897['userId']:_0x3e1897[_0xa7aa('0x24')];var _0x1bb845={'method':_0xa7aa('0x1f'),'uri':_0x43df74+_0xa7aa('0x3a')+'?'+_0x5d69fa,'body':Object[_0xa7aa('0x3b')]({},{'active':'true','caller_id':_0x51bb0f,'assigned_to':_0x3e1897[_0xa7aa('0x1a')],'short_description':intUtil[_0xa7aa('0x3c')](_0x152a46[_0xa7aa('0x3d')],_0x2af6e2,'\x20'),'description':intUtil[_0xa7aa('0x3c')](_0x152a46[_0xa7aa('0x3e')],_0x2af6e2,'\x0a')},getCustomFields(_0x152a46['Fields'],_0x2af6e2)),'auth':_0x29c863,'json':!![]};return rp(_0x1bb845)[_0xa7aa('0x17')](function(_0x7216e1){logger[_0xa7aa('0x12')]('['+[_0x1c1fb5['toUpperCase']()]+_0xa7aa('0x3f'),_0x7216e1[_0xa7aa('0xd')]);_0x3e1897[_0xa7aa('0x40')]=_0x7216e1['result']['sys_id'];_0x3e1897[_0xa7aa('0x41')]=_0x7216e1[_0xa7aa('0xd')][_0xa7aa('0x42')];logger[_0xa7aa('0x12')]('['+[_0x1c1fb5[_0xa7aa('0xf')]()]+_0xa7aa('0x43'),_0x3e1897);_0x84d08c(_0x3e1897);})[_0xa7aa('0x27')](function(_0x58386c){logger['error']('['+[_0x1c1fb5[_0xa7aa('0xf')]()]+']',_0x58386c[_0xa7aa('0x11')]);_0x295d1e(_0x58386c[_0xa7aa('0x11')]);});});};}function createRemoteTag(_0x5b0822,_0x5e8121,_0xa2ecb2,_0x578b7a){return new Promise(function(_0xc0201b,_0x2ed86e){var _0x274a00={'method':_0xa7aa('0x1f'),'uri':_0xa2ecb2+_0xa7aa('0x44')+'?'+_0x578b7a,'body':{'short_description':_0x5b0822,'global':!![],'active':!![],'name':_0x5b0822},'auth':_0x5e8121,'json':!![]};return rp(_0x274a00)[_0xa7aa('0x17')](function(_0x1fcb39){var _0xdb4ddc=_0x1fcb39[_0xa7aa('0xd')][_0xa7aa('0xe')];_0xc0201b(_0xdb4ddc);});});}function getRemoteTag(_0x4173fd,_0x535530,_0x59bc7b,_0x4974b2,_0x2d7a6c){return new Promise(function(_0x34a9c0,_0xb8412c){var _0x19b14b={'method':_0xa7aa('0xb'),'uri':_0x59bc7b+_0xa7aa('0x44')+'?sysparm_query=name%3D'+_0x4173fd+'&'+_0x4974b2,'auth':_0x535530,'json':!![]};return rp(_0x19b14b)[_0xa7aa('0x17')](function(_0x1e7635){if(_0x1e7635[_0xa7aa('0xd')][_0xa7aa('0x28')]>0x0){var _0x283e92=_0x1e7635['result'][0x0][_0xa7aa('0xe')];_0x34a9c0(_0x283e92);}else{return createRemoteTag(_0x4173fd,_0x535530,_0x59bc7b,_0x4974b2)[_0xa7aa('0x17')](function(_0x4a825a){_0x34a9c0(_0x4a825a);});}});});}function assignTagToIncident(_0x28f860,_0x475c3b,_0x4fada0,_0x40f397,_0x1e7c72){return new Promise(function(_0xc91516,_0x356edb){var _0x5e4ce8={'method':_0xa7aa('0x1f'),'uri':_0x4fada0+_0xa7aa('0x45')+'?'+_0x1e7c72,'body':{'label':_0x28f860,'table':'incident','id_type':_0xa7aa('0x46'),'table_key':_0x40f397[_0xa7aa('0x40')],'title':_0xa7aa('0x47')+_0x40f397[_0xa7aa('0x41')],'id_display':_0x40f397[_0xa7aa('0x41')]},'auth':_0x475c3b,'json':!![]};return rp(_0x5e4ce8)[_0xa7aa('0x17')](function(_0x737c6){_0xc91516();})['catch'](function(){_0xc91516();});});}function manageTags(_0x217483,_0x525bb9,_0x8d8f0,_0xe91be5,_0x57f779,_0x2c7f9f,_0x1c6154){return new Promise(function(_0x1c435c,_0x2f18a4){var _0x407243=[];_0x525bb9['forEach'](function(_0x2f552f){_0x407243[_0xa7aa('0x48')](getRemoteTag(_0x2f552f,_0x8d8f0,_0xe91be5,_0x2c7f9f,_0x1c6154));});return Promise[_0xa7aa('0x49')](_0x407243)[_0xa7aa('0x17')](function(_0x21a70c){if(_0x21a70c['length']){logger[_0xa7aa('0x12')]('['+[_0x217483[_0xa7aa('0xf')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x21a70c);var _0x5577ec=[];_0x21a70c[_0xa7aa('0x29')](function(_0x90c532){_0x5577ec[_0xa7aa('0x48')](assignTagToIncident(_0x90c532,_0x8d8f0,_0xe91be5,_0x57f779,_0x2c7f9f));});return Promise[_0xa7aa('0x49')](_0x5577ec)[_0xa7aa('0x17')](function(){_0x1c435c();})['catch'](function(){_0x1c435c();});}else{_0x1c435c();}});});}function getTags(_0x3b28ce,_0x59920e,_0x2852a2,_0x132766,_0xe4b3d9,_0x2261a8){return function(_0x2f4657){return new Promise(function(_0x4ab55a,_0x772d3f){var _0x2722dd=[];var _0x44fdfe=_0x132766[_0xa7aa('0x4a')];if(_0x44fdfe&&_0x44fdfe[_0xa7aa('0x28')]>0x0){_0x2722dd=_[_0xa7aa('0x4b')](_0x44fdfe,_0xa7aa('0x37'));}if(_0x2722dd[_0xa7aa('0x28')]>0x0){return manageTags(_0x3b28ce,_0x2722dd,_0x59920e,_0x2852a2,_0x2f4657,_0xe4b3d9,_0x2261a8)[_0xa7aa('0x17')](function(){_0x4ab55a(_0x2f4657);});}else{_0x4ab55a(_0x2f4657);}});};}function emit(_0x446b97,_0x4be2a0,_0x340fc1){var _0x5629e8=_0xa7aa('0x4c')+_0xa7aa('0x4d')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xa7aa('0x4e');var _0x3d85b6={'uri':_0x446b97+_0xa7aa('0x4f')+_0x340fc1+_0x5629e8};io['to'](util['format']('user:%s',_0x4be2a0))[_0xa7aa('0x50')](_0xa7aa('0x51'),_0x3d85b6);}exports['cs']=function(_0x48078a,_0x421e8c,_0x25f5c5,_0x25b44a,_0x5def22,_0x3814cb,_0x2d8afa,_0x21eb0f){var _0x4e4de3={};var _0x167d85={'user':_0x3814cb[_0xa7aa('0x52')],'pass':_0x3814cb[_0xa7aa('0x53')]};var _0x4dd745=_0xa7aa('0x54');var _0x3c64ce=_0xa7aa('0x55');_0x3814cb[_0xa7aa('0x56')]=intUtil[_0xa7aa('0x57')](_0x3814cb[_0xa7aa('0x56')]);_0x3814cb['serverUrl']=intUtil['stripTrailingSlash'](_0x3814cb[_0xa7aa('0x58')]);var _0x553d8f=util[_0xa7aa('0x59')](_0xa7aa('0x5a'),_0x3814cb[_0xa7aa('0x56')]);_0x4e4de3[_0xa7aa('0x14')]=!_[_0xa7aa('0x5b')](_0x25b44a)?_0x25b44a[_0xa7aa('0x5c')]:null;_0x4e4de3['adminEmail']=_0x3814cb[_0xa7aa('0x5c')];_0x4e4de3[_0xa7aa('0x21')]=_0x21eb0f[_0xa7aa('0x32')]()===_0xa7aa('0x39')?_0x421e8c[_0xa7aa('0x5d')]:_0x421e8c[_0xa7aa('0x5e')];_0x4e4de3[_0xa7aa('0x5f')]=_0x21eb0f===_0xa7aa('0x60')||_0x21eb0f===_0xa7aa('0x61')?_0xa7aa('0x60'):_0xa7aa('0x39');var _0x319268=util[_0xa7aa('0x59')](_0xa7aa('0x62'),_0x3814cb[_0xa7aa('0x58')],_0x421e8c[_0xa7aa('0x63')],md5(_0x421e8c[_0xa7aa('0x63')]));if(_0x5def22&&_0x5def22['monitor_format']){logger['info'](_0xa7aa('0x64'),_0xa7aa('0x65'));_0x421e8c[_0xa7aa('0x66')]=_0x319268;}else if(_0x2d8afa&&_0x2d8afa['recordingFormat']&&_0x2d8afa['recordingFormat']!==_0xa7aa('0x67')){logger[_0xa7aa('0x12')](_0xa7aa('0x68'),_0xa7aa('0x65'));_0x421e8c[_0xa7aa('0x66')]=_0x319268;}else{_0x421e8c[_0xa7aa('0x66')]='';}return getAdminUser(_0x21eb0f,_0x167d85,_0x4e4de3,_0x553d8f,_0x3c64ce,_0x4dd745)[_0xa7aa('0x17')](getUser(_0x21eb0f,_0x167d85,_0x553d8f,_0x3c64ce,_0x4dd745))[_0xa7aa('0x17')](getEndUser(_0x21eb0f,_0x167d85,_0x553d8f,_0x3c64ce,_0x4dd745))[_0xa7aa('0x17')](getTicket(_0x21eb0f,_0x167d85,_0x553d8f,_0x25f5c5,_0x421e8c,_0x3c64ce))[_0xa7aa('0x17')](function(_0x19a4d8){logger[_0xa7aa('0x12')](util[_0xa7aa('0x59')](_0xa7aa('0x69'),_0x19a4d8[_0xa7aa('0x40')]));logger[_0xa7aa('0x12')](util['format']('call\x20direction:\x20%s',_0x21eb0f));if(_0x21eb0f!=='unmanaged'){logger[_0xa7aa('0x12')]('['+[_0x21eb0f['toUpperCase']()]+']',_0xa7aa('0x6a'));emit(_0x3814cb[_0xa7aa('0x56')],_0x25b44a[_0xa7aa('0x37')],_0x19a4d8['ticketId']);}})[_0xa7aa('0x27')](function(_0x5f3e22){logger[_0xa7aa('0x10')]('['+[_0x21eb0f[_0xa7aa('0xf')]()]+_0xa7aa('0x6b'),util[_0xa7aa('0x6c')](_0x5f3e22,{'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 4f3aa4a..8609ed6 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 _0x6653=['then','entry_list','find','value','Agent\x20found!','resolve','name_value_list','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','format','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','nameField','customField','toString','string','idField','custom_fields','variable','push','customVariable','Variable','toLowerCase','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','uri','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','catch','unmanaged','lastevent','toUpperCase','isNil','calleridname','Inbound','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','POST','Creating\x20new\x20ticket...','name','getString','assigned_user_id','Descriptions','date_start','toISOString','slice','replace','parent_id','parent_type','Contacts','parent_name','direction','length','variableName','set_entry','JSON','stringify','Basic\x20%s','apiKey','get_server_info','info','Employees','user_name'];(function(_0x14928e,_0x5d7920){var _0x331116=function(_0x3d7022){while(--_0x3d7022){_0x14928e['push'](_0x14928e['shift']());}};_0x331116(++_0x5d7920);}(_0x6653,0x1c3));var _0x3665=function(_0x3c3ee8,_0x18a386){_0x3c3ee8=_0x3c3ee8-0x0;var _0x35d0f1=_0x6653[_0x3c3ee8];return _0x35d0f1;};'use strict';var _=require(_0x3665('0x0'));var rp=require(_0x3665('0x1'));var BPromise=require('bluebird');var md5=require(_0x3665('0x2'));var util=require(_0x3665('0x3'));var Redis=require('ioredis');var intUtil=require(_0x3665('0x4'));var config=require(_0x3665('0x5'));var logger=require(_0x3665('0x6'))(_0x3665('0x7'));config[_0x3665('0x8')]=_[_0x3665('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x3665('0xa'))(new Redis(config[_0x3665('0x8')]));var def={'method':_0x3665('0xb'),'json':!![]};function emit(_0x478ac7,_0x37a892,_0x262a2d){io['to'](_0x478ac7)['emit'](_0x37a892,_0x262a2d);}function getTicket(_0x37f534,_0x2f1241,_0x289818,_0x63efae,_0x3a36c8,_0x478e1e,_0x17bdde,_0x2d7b62){logger['info'](_0x3665('0xc'));var _0x7f971c=new Date();var _0x33f106=[{'name':_0x3665('0xd'),'value':intUtil[_0x3665('0xe')](_0x63efae['Subjects'],_0x3a36c8,'\x20')},{'name':_0x3665('0xf'),'value':_0x2f1241['id']},{'name':'created_by','value':_0x2f1241['id']},{'name':'description','value':intUtil[_0x3665('0xe')](_0x63efae[_0x3665('0x10')],_0x3a36c8,'\x0a')},{'name':_0x3665('0x11'),'value':_0x7f971c[_0x3665('0x12')]()[_0x3665('0x13')](0x0,0x13)[_0x3665('0x14')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x3665('0x15'),'value':_0x289818['id']},{'name':_0x3665('0x16'),'value':_0x3665('0x17')},{'name':_0x3665('0x18'),'value':_0x289818[_0x3665('0xd')]},{'name':_0x3665('0x19'),'value':_0x2d7b62}];if(_0x478e1e[_0x3665('0x1a')]){_['forEach'](_0x478e1e,function(_0x19a6ef){if(_0x3a36c8[_0x19a6ef[_0x3665('0x1b')]]){_0x33f106['push']({'name':_0x19a6ef['idField'],'value':_0x3a36c8[_0x19a6ef[_0x3665('0x1b')]]});}});}return request({'form':{'method':_0x3665('0x1c'),'input_type':_0x3665('0x1d'),'response_type':_0x3665('0x1d'),'rest_data':JSON[_0x3665('0x1e')]({'session':_0x17bdde['id'],'module_name':'Calls','name_value_list':_0x33f106})}});}function getAuth(_0x590cac){return util['format'](_0x3665('0x1f'),new Buffer(_0x590cac[_0x3665('0x20')]+':X')['toString']('base64'));}function getServerInfo(_0x53db47){return request({'form':{'method':_0x3665('0x21'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x3665('0x1e')]({'session':_0x53db47['id']})}});}function getUser(_0x27e6ec,_0x1829f6,_0x29d99f){if(!_['isNil'](_0x1829f6)){logger[_0x3665('0x22')]('Getting\x20agent\x20with\x20name',_0x1829f6);return request({'form':{'method':'get_entry_list','input_type':_0x3665('0x1d'),'response_type':'JSON','rest_data':JSON[_0x3665('0x1e')]({'session':_0x29d99f['id'],'module_name':_0x3665('0x23'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x1829f6),'order_by':'','offset':'0','select_fields':['id',_0x3665('0xd'),_0x3665('0x24')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3665('0x25')](function(_0x1838bc){if(_0x1838bc[_0x3665('0x26')][_0x3665('0x1a')]){var _0x42ca49=_[_0x3665('0x27')](_0x1838bc['entry_list'],function(_0x1e38be){return _0x1e38be['name_value_list'][_0x3665('0x24')][_0x3665('0x28')]===_0x1829f6;});if(_0x42ca49){logger[_0x3665('0x22')](_0x3665('0x29'));return BPromise[_0x3665('0x2a')]({'id':_0x42ca49[_0x3665('0x2b')]['id']['value'],'name':_0x42ca49[_0x3665('0x2b')][_0x3665('0xd')]['value']});}}logger[_0x3665('0x22')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x3665('0x2a')]({'id':_0x29d99f['name_value_list'][_0x3665('0x2c')][_0x3665('0x28')],'name':_0x29d99f[_0x3665('0x2b')][_0x3665('0x24')]['value']});});}else{logger[_0x3665('0x22')](_0x3665('0x2d'));return BPromise['resolve']({'id':_0x29d99f['name_value_list']['user_id'][_0x3665('0x28')],'name':_0x29d99f[_0x3665('0x2b')][_0x3665('0x24')]['value']});}}function getEndUser(_0x658aa5,_0x1d1679,_0x21942a,_0x39e7d5){logger[_0x3665('0x22')](_0x3665('0x2e'),_0x21942a);return request({'form':{'method':_0x3665('0x2f'),'input_type':_0x3665('0x1d'),'response_type':_0x3665('0x1d'),'rest_data':JSON[_0x3665('0x1e')]({'session':_0x39e7d5['id'],'module_name':_0x3665('0x17'),'query':util[_0x3665('0x30')](_0x3665('0x31'),_0x21942a),'order_by':'','offset':'0','select_fields':['id',_0x3665('0xd'),_0x3665('0x32')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3665('0x25')](function(_0x28c3b7){if(_0x28c3b7[_0x3665('0x26')][_0x3665('0x1a')]){var _0x1fafff=_[_0x3665('0x27')](_0x28c3b7[_0x3665('0x26')],function(_0x28197a){return _0x28197a[_0x3665('0x2b')]['phone_home'][_0x3665('0x28')]===_0x21942a;});if(_0x1fafff){logger['info'](_0x3665('0x33'));return BPromise[_0x3665('0x2a')]({'id':_0x1fafff[_0x3665('0x2b')]['id'][_0x3665('0x28')],'name':_0x1fafff['name_value_list'][_0x3665('0xd')]['value'],'phone':_0x1fafff[_0x3665('0x2b')][_0x3665('0x32')][_0x3665('0x28')]});}}else{logger[_0x3665('0x22')](_0x3665('0x34'));return request({'form':{'method':_0x3665('0x1c'),'input_type':_0x3665('0x1d'),'response_type':_0x3665('0x1d'),'rest_data':JSON[_0x3665('0x1e')]({'session':_0x39e7d5['id'],'module_name':_0x3665('0x17'),'name_value_list':[{'name':_0x3665('0x35'),'value':_0x1d1679!==_0x3665('0x36')?_0x1d1679:util[_0x3665('0x30')](_0x3665('0x37'),_0x21942a)},{'name':_0x3665('0x32'),'value':_0x21942a}]})}})[_0x3665('0x25')](function(_0x5a9fcc){logger['info'](_0x3665('0x38'));return BPromise[_0x3665('0x2a')]({'id':_0x5a9fcc['id'],'name':_0x5a9fcc[_0x3665('0x26')][_0x3665('0x35')][_0x3665('0x28')],'phone':_0x5a9fcc[_0x3665('0x26')]['phone_home'][_0x3665('0x28')]});});}});}function request(_0x3855b0){logger[_0x3665('0x39')](_0x3665('0x3a'),JSON[_0x3665('0x1e')](_0x3855b0));return rp(_[_0x3665('0x3b')](def,_0x3855b0));}function getTags(_0x5dc746,_0x2211f8){var _0xa036a8=[];if(_0x5dc746&&_0x5dc746[_0x3665('0x1a')]>0x0){_0xa036a8=_[_0x3665('0x3c')](_0x5dc746,_0x2211f8);}return _0xa036a8;}function getCustomFields(_0x203357,_0x557b30){var _0x3d14fc=[];var _0x2b898b={'custom_fields':[]};if(_0x203357[_0x3665('0x1a')]>0x0){_['forEach'](_0x203357,function(_0x13c065){if(_0x13c065[_0x3665('0x3d')]==='string'&&_0x13c065[_0x3665('0x3e')]&&!_0x13c065[_0x3665('0x3f')]){_0x2b898b[_0x13c065['nameField']['toLowerCase']()]=_0x13c065['content'][_0x3665('0x40')]();}else if(_0x13c065['type']===_0x3665('0x41')&&_0x13c065[_0x3665('0x42')]&&_0x13c065[_0x3665('0x3f')]){_0x2b898b[_0x3665('0x43')]['push']({'id':_0x13c065[_0x3665('0x42')],'value':_0x13c065['content'][_0x3665('0x40')]()});}else if(_0x13c065[_0x3665('0x3d')]===_0x3665('0x44')&&_0x13c065[_0x3665('0x1b')]&&_0x13c065[_0x3665('0x42')]&&_0x13c065[_0x3665('0x3f')]){_0x557b30[_0x13c065[_0x3665('0x1b')]]&&_0x2b898b[_0x3665('0x43')][_0x3665('0x45')]({'id':_0x13c065[_0x3665('0x42')],'value':_0x557b30[_0x13c065[_0x3665('0x1b')]][_0x3665('0x40')]()});}else if(_0x13c065[_0x3665('0x3d')]===_0x3665('0x46')&&_0x13c065[_0x3665('0x47')]&&_0x13c065[_0x3665('0x47')][_0x3665('0xd')]&&_0x13c065[_0x3665('0x42')]&&_0x13c065[_0x3665('0x3f')]){_0x557b30[_0x13c065[_0x3665('0x47')]['name'][_0x3665('0x48')]()]&&_0x2b898b['custom_fields']['push']({'id':_0x13c065['idField'],'value':_0x557b30[_0x13c065['Variable']['name'][_0x3665('0x48')]()][_0x3665('0x40')]()});}});}return _0x2b898b;}function getConnection(_0xb2a236){return request({'method':_0x3665('0xb'),'form':{'method':_0x3665('0x49'),'input_type':'JSON','response_type':_0x3665('0x1d'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0xb2a236[_0x3665('0x4a')],'password':_0xb2a236['password'],'encryption':_0x3665('0x4b')},'application':_0x3665('0x4c')})}})[_0x3665('0x25')](function(_0x486209){var _0x3ed6b4=_0x486209;if(_0x3ed6b4['id']){def[_0x3665('0x4d')]=_0x3ed6b4['id'];return BPromise[_0x3665('0x2a')](_0x3ed6b4);}else{throw new Error(util['format'](_0x3665('0x4e'),_0xb2a236['id']));}});}function setRelationship(_0x253aa3,_0x359481,_0x50a2fe,_0xc84ad6){return request({'form':{'method':_0x3665('0x4f'),'input_type':_0x3665('0x1d'),'response_type':_0x3665('0x1d'),'rest_data':JSON[_0x3665('0x1e')]({'session':_0x253aa3['id'],'module_name':_0x3665('0x50'),'module_id':_0x50a2fe['id'],'link_field_name':_0xc84ad6,'related_ids':[_0x359481['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x3665('0x51')]=function(_0x4eeaa4,_0x3c1d59,_0x1f6457,_0x593e88,_0x3b65e8,_0x1f74bb){var _0xe5f846,_0x480fef,_0x79934c,_0x342f93;_0x1f74bb[_0x3665('0x52')]=intUtil[_0x3665('0x53')](_0x1f74bb[_0x3665('0x52')]);_0x1f74bb[_0x3665('0x54')]=intUtil[_0x3665('0x53')](_0x1f74bb[_0x3665('0x54')]);def['uri']=util[_0x3665('0x30')](_0x3665('0x55'),_0x1f74bb[_0x3665('0x52')]);if(_0x3b65e8&&_0x3b65e8[_0x3665('0x56')]){logger['info'](_0x3665('0x57'),_0x3665('0x58'));_0x3c1d59[_0x3665('0x59')]=util['format'](_0x3665('0x5a'),_0x1f74bb[_0x3665('0x54')],_0x3c1d59['uniqueid'],md5(_0x3c1d59[_0x3665('0x5b')]));}else{_0x3c1d59[_0x3665('0x59')]='';}return getConnection(_0x1f74bb)[_0x3665('0x25')](function(_0x2b89fc){_0x342f93=_0x2b89fc;return getUser(_0x1f74bb,_0x593e88[_0x3665('0xd')],_0x342f93);})[_0x3665('0x25')](function(_0x4b6926){_0xe5f846=_0x4b6926;logger[_0x3665('0x22')](_0x3665('0x5c'),_0xe5f846['id']);return getEndUser(_0x1f74bb,_0x3c1d59['calleridname'],_0x3c1d59[_0x3665('0x5d')],_0x342f93);})['then'](function(_0x498da9){_0x480fef=_0x498da9;logger[_0x3665('0x22')]('The\x20Enduser\x20ID\x20is:',_0x480fef['id']);return getTicket(_0x1f74bb,_0xe5f846,_0x480fef,_0x1f6457,_0x3c1d59,_0x1f6457[_0x3665('0x5e')],_0x342f93,'Inbound');})[_0x3665('0x25')](function(_0x47a07b){_0x79934c=_0x47a07b;logger['info'](_0x3665('0x5f'));logger[_0x3665('0x22')](_0x3665('0x60'),_0x79934c['id']);return setRelationship(_0x342f93,_0xe5f846,_0x79934c,_0x3665('0x61'));})[_0x3665('0x25')](function(){return setRelationship(_0x342f93,_0x480fef,_0x79934c,_0x3665('0x62'));})['then'](function(){return getServerInfo(_0x342f93);})[_0x3665('0x25')](function(_0x9ff4c9){var _0x5f02f9=parseInt(_0x9ff4c9[_0x3665('0x63')][_0x3665('0x64')](0x0));var _0xeb1171=util['format'](_0x3665('0x65'),_0x1f74bb['remoteUri'],_0x79934c['id']);if(_0x5f02f9>0x6){_0xeb1171=util[_0x3665('0x30')](_0x3665('0x66'),_0x1f74bb[_0x3665('0x52')],_0x79934c['id']);}logger[_0x3665('0x22')](_0x3665('0x57'),_0x3665('0x67'));emit(util[_0x3665('0x30')](_0x3665('0x68'),_0x593e88['name']),_0x3665('0x69'),{'uri':_0xeb1171});})['catch'](function(_0x2dabca){logger[_0x3665('0x6a')]('[QUEUE]',JSON[_0x3665('0x1e')](_0x2dabca));});};exports['outbound']=function(_0x2c6eab,_0x7464a0,_0x448f41,_0x1db24f,_0x285b0e,_0xec5e31,_0x36a00a){var _0x257e53,_0xaccfbc,_0x312337,_0x39c91f;_0xec5e31[_0x3665('0x52')]=intUtil[_0x3665('0x53')](_0xec5e31[_0x3665('0x52')]);_0xec5e31['serverUrl']=intUtil[_0x3665('0x53')](_0xec5e31[_0x3665('0x54')]);def[_0x3665('0x6b')]=util[_0x3665('0x30')](_0x3665('0x55'),_0xec5e31['remoteUri']);if(_0x36a00a&&_0x36a00a[_0x3665('0x6c')]&&_0x36a00a[_0x3665('0x6c')]!==_0x3665('0x6d')){logger[_0x3665('0x22')](_0x3665('0x6e'),_0x3665('0x58'));_0x7464a0['recordingURL']=util[_0x3665('0x30')](_0x3665('0x5a'),_0xec5e31[_0x3665('0x54')],_0x7464a0[_0x3665('0x5b')],md5(_0x7464a0[_0x3665('0x5b')]));}return getConnection(_0xec5e31)['then'](function(_0x2c9f4f){_0x39c91f=_0x2c9f4f;return getUser(_0xec5e31,_0x1db24f[_0x3665('0xd')],_0x39c91f);})[_0x3665('0x25')](function(_0x32b172){_0x257e53=_0x32b172;logger[_0x3665('0x22')](_0x3665('0x5c'),_0x257e53['id']);return getEndUser(_0xec5e31,_0x7464a0[_0x3665('0x6f')],_0x7464a0[_0x3665('0x70')],_0x39c91f);})[_0x3665('0x25')](function(_0x53a136){_0xaccfbc=_0x53a136;logger[_0x3665('0x22')](_0x3665('0x71'),_0xaccfbc['id']);return getTicket(_0xec5e31,_0x257e53,_0xaccfbc,_0x448f41,_0x7464a0,_0x448f41[_0x3665('0x5e')],_0x39c91f,_0x3665('0x72'));})[_0x3665('0x25')](function(_0xd6407d){_0x312337=_0xd6407d;logger[_0x3665('0x22')]('Ticket\x20created!');logger[_0x3665('0x22')](_0x3665('0x60'),_0x312337['id']);return setRelationship(_0x39c91f,_0x257e53,_0x312337,_0x3665('0x61'));})['then'](function(){return setRelationship(_0x39c91f,_0xaccfbc,_0x312337,_0x3665('0x62'));})[_0x3665('0x25')](function(){return getServerInfo(_0x39c91f);})[_0x3665('0x25')](function(_0x38b0bd){var _0x31927f=parseInt(_0x38b0bd[_0x3665('0x63')][_0x3665('0x64')](0x0));var _0x3af348=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0xec5e31[_0x3665('0x52')],_0x312337['id']);if(_0x31927f>0x6){_0x3af348=util[_0x3665('0x30')](_0x3665('0x66'),_0xec5e31['remoteUri'],_0x312337['id']);}logger[_0x3665('0x22')]('[OUTBOUND]',_0x3665('0x67'));emit(util['format'](_0x3665('0x68'),_0x1db24f[_0x3665('0xd')]),_0x3665('0x69'),{'uri':_0x3af348});})[_0x3665('0x73')](function(_0x2f83a7){logger['error'](_0x3665('0x6e'),JSON[_0x3665('0x1e')](_0x2f83a7));});};exports[_0x3665('0x74')]=function(_0x161f68,_0x3ec983,_0x5a4085,_0x4f03e9,_0x485850,_0x34affb){var _0x4bd21b,_0x3baeb1,_0x37a437,_0x3a6c3c;_0x34affb['remoteUri']=intUtil[_0x3665('0x53')](_0x34affb['remoteUri']);_0x34affb[_0x3665('0x54')]=intUtil['stripTrailingSlash'](_0x34affb[_0x3665('0x54')]);def[_0x3665('0x6b')]=util[_0x3665('0x30')]('%s/service/v4_1/rest.php',_0x34affb['remoteUri']);if(_0x485850&&_0x485850['monitor_format']){logger['info']('['+_0x3ec983[_0x3665('0x75')][_0x3665('0x76')]()+']',_0x3665('0x58'));_0x3ec983[_0x3665('0x59')]=util['format'](_0x3665('0x5a'),_0x34affb[_0x3665('0x54')],_0x3ec983['uniqueid'],md5(_0x3ec983['uniqueid']));}else{_0x3ec983[_0x3665('0x59')]='';}return getConnection(_0x34affb)['then'](function(_0xaf06c5){_0x3a6c3c=_0xaf06c5;if(!_[_0x3665('0x77')](_0x4f03e9)){return getUser(_0x34affb,_0x4f03e9[_0x3665('0xd')],_0x3a6c3c);}else{return getUser(_0x34affb,null,_0x3a6c3c);}})[_0x3665('0x25')](function(_0x50087b){_0x4bd21b=_0x50087b;logger['info'](_0x3665('0x5c'),_0x4bd21b['id']);return getEndUser(_0x34affb,_0x3ec983[_0x3665('0x78')],_0x3ec983['calleridnum'],_0x3a6c3c);})[_0x3665('0x25')](function(_0x5142bf){_0x3baeb1=_0x5142bf;logger['info'](_0x3665('0x71'),_0x3baeb1['id']);return getTicket(_0x34affb,_0x4bd21b,_0x3baeb1,_0x5a4085,_0x3ec983,_0x5a4085[_0x3665('0x5e')],_0x3a6c3c,_0x3665('0x79'));})[_0x3665('0x25')](function(_0x35e3f2){_0x37a437=_0x35e3f2;logger[_0x3665('0x22')]('Ticket\x20created!');logger[_0x3665('0x22')](_0x3665('0x60'),_0x37a437['id']);return setRelationship(_0x3a6c3c,_0x4bd21b,_0x37a437,_0x3665('0x61'));})['then'](function(){return setRelationship(_0x3a6c3c,_0x3baeb1,_0x37a437,_0x3665('0x62'));})[_0x3665('0x25')](function(){return getServerInfo(_0x3a6c3c);})[_0x3665('0x73')](function(_0x54692f){logger[_0x3665('0x6a')]('['+_0x3ec983[_0x3665('0x75')][_0x3665('0x76')]()+']',JSON['stringify'](_0x54692f));});}; \ No newline at end of file +var _0x40f3=['md5','util','ioredis','./util','../../../../config/logger','sugarcrm','redis','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','Basic\x20%s','apiKey','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','entry_list','find','name_value_list','user_name','value','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','format','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Enduser\x20created.','[HTTP]','map','type','string','nameField','customField','toLowerCase','content','custom_fields','toString','variable','customVariable','Variable','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Fields','Outbound','Ticket\x20created!','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','error','unmanaged','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridnum','Inbound','bluebird'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x40f3,0x17c));var _0x340f=function(_0x1fcaf1,_0x21c3c2){_0x1fcaf1=_0x1fcaf1-0x0;var _0x55f464=_0x40f3[_0x1fcaf1];return _0x55f464;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x340f('0x0'));var md5=require(_0x340f('0x1'));var util=require(_0x340f('0x2'));var Redis=require(_0x340f('0x3'));var intUtil=require(_0x340f('0x4'));var config=require('../../../../config/environment');var logger=require(_0x340f('0x5'))(_0x340f('0x6'));config[_0x340f('0x7')]=_['defaults'](config[_0x340f('0x7')],{'host':_0x340f('0x8'),'port':0x18eb});var io=require(_0x340f('0x9'))(new Redis(config[_0x340f('0x7')]));var def={'method':_0x340f('0xa'),'json':!![]};function emit(_0x5dd1b8,_0x2da9e8,_0x5a7090){io['to'](_0x5dd1b8)[_0x340f('0xb')](_0x2da9e8,_0x5a7090);}function getTicket(_0x364924,_0x45e051,_0x130253,_0x2937bd,_0x2e8fc2,_0x2a0a2c,_0x1da22b,_0xd89079){logger[_0x340f('0xc')](_0x340f('0xd'));var _0x4baa64=new Date();var _0x2ab695=[{'name':_0x340f('0xe'),'value':intUtil[_0x340f('0xf')](_0x2937bd['Subjects'],_0x2e8fc2,'\x20')},{'name':_0x340f('0x10'),'value':_0x45e051['id']},{'name':_0x340f('0x11'),'value':_0x45e051['id']},{'name':_0x340f('0x12'),'value':intUtil[_0x340f('0xf')](_0x2937bd[_0x340f('0x13')],_0x2e8fc2,'\x0a')},{'name':_0x340f('0x14'),'value':_0x4baa64[_0x340f('0x15')]()[_0x340f('0x16')](0x0,0x13)[_0x340f('0x17')]('T','\x20')},{'name':_0x340f('0x18'),'value':'0'},{'name':_0x340f('0x19'),'value':'15'},{'name':_0x340f('0x1a'),'value':_0x130253['id']},{'name':_0x340f('0x1b'),'value':_0x340f('0x1c')},{'name':_0x340f('0x1d'),'value':_0x130253[_0x340f('0xe')]},{'name':_0x340f('0x1e'),'value':_0xd89079}];if(_0x2a0a2c[_0x340f('0x1f')]){_[_0x340f('0x20')](_0x2a0a2c,function(_0x6786d1){if(_0x2e8fc2[_0x6786d1[_0x340f('0x21')]]){_0x2ab695[_0x340f('0x22')]({'name':_0x6786d1[_0x340f('0x23')],'value':_0x2e8fc2[_0x6786d1['variableName']]});}});}return request({'form':{'method':_0x340f('0x24'),'input_type':'JSON','response_type':_0x340f('0x25'),'rest_data':JSON[_0x340f('0x26')]({'session':_0x1da22b['id'],'module_name':_0x340f('0x27'),'name_value_list':_0x2ab695})}});}function getAuth(_0x3315fb){return util['format'](_0x340f('0x28'),new Buffer(_0x3315fb[_0x340f('0x29')]+':X')['toString'](_0x340f('0x2a')));}function getServerInfo(_0x2cd951){return request({'form':{'method':_0x340f('0x2b'),'input_type':_0x340f('0x25'),'response_type':_0x340f('0x25'),'rest_data':JSON[_0x340f('0x26')]({'session':_0x2cd951['id']})}});}function getUser(_0x13744f,_0xe7805b,_0xac4133){if(!_[_0x340f('0x2c')](_0xe7805b)){logger[_0x340f('0xc')](_0x340f('0x2d'),_0xe7805b);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x340f('0x25'),'rest_data':JSON['stringify']({'session':_0xac4133['id'],'module_name':'Employees','query':util['format'](_0x340f('0x2e'),_0xe7805b),'order_by':'','offset':'0','select_fields':['id',_0x340f('0xe'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x4afd53){if(_0x4afd53[_0x340f('0x2f')][_0x340f('0x1f')]){var _0x8c986=_[_0x340f('0x30')](_0x4afd53[_0x340f('0x2f')],function(_0x2507ad){return _0x2507ad[_0x340f('0x31')][_0x340f('0x32')][_0x340f('0x33')]===_0xe7805b;});if(_0x8c986){logger['info'](_0x340f('0x34'));return BPromise['resolve']({'id':_0x8c986['name_value_list']['id'][_0x340f('0x33')],'name':_0x8c986['name_value_list'][_0x340f('0xe')]['value']});}}logger[_0x340f('0xc')](_0x340f('0x35'));return BPromise[_0x340f('0x36')]({'id':_0xac4133[_0x340f('0x31')][_0x340f('0x37')]['value'],'name':_0xac4133[_0x340f('0x31')][_0x340f('0x32')][_0x340f('0x33')]});});}else{logger[_0x340f('0xc')](_0x340f('0x38'));return BPromise[_0x340f('0x36')]({'id':_0xac4133[_0x340f('0x31')][_0x340f('0x37')][_0x340f('0x33')],'name':_0xac4133[_0x340f('0x31')][_0x340f('0x32')][_0x340f('0x33')]});}}function getEndUser(_0x54d5d0,_0x5d4153,_0x21700a,_0x197417){logger['info'](_0x340f('0x39'),_0x21700a);return request({'form':{'method':_0x340f('0x3a'),'input_type':_0x340f('0x25'),'response_type':_0x340f('0x25'),'rest_data':JSON[_0x340f('0x26')]({'session':_0x197417['id'],'module_name':'Contacts','query':util[_0x340f('0x3b')](_0x340f('0x3c'),_0x21700a),'order_by':'','offset':'0','select_fields':['id',_0x340f('0xe'),_0x340f('0x3d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x340f('0x3e')](function(_0x19a73d){if(_0x19a73d['entry_list'][_0x340f('0x1f')]){var _0x3d3b05=_[_0x340f('0x30')](_0x19a73d[_0x340f('0x2f')],function(_0x2ec5b6){return _0x2ec5b6[_0x340f('0x31')][_0x340f('0x3d')][_0x340f('0x33')]===_0x21700a;});if(_0x3d3b05){logger[_0x340f('0xc')](_0x340f('0x3f'));return BPromise[_0x340f('0x36')]({'id':_0x3d3b05[_0x340f('0x31')]['id'][_0x340f('0x33')],'name':_0x3d3b05[_0x340f('0x31')][_0x340f('0xe')][_0x340f('0x33')],'phone':_0x3d3b05[_0x340f('0x31')][_0x340f('0x3d')][_0x340f('0x33')]});}}else{logger[_0x340f('0xc')](_0x340f('0x40'));return request({'form':{'method':_0x340f('0x24'),'input_type':_0x340f('0x25'),'response_type':_0x340f('0x25'),'rest_data':JSON[_0x340f('0x26')]({'session':_0x197417['id'],'module_name':_0x340f('0x1c'),'name_value_list':[{'name':_0x340f('0x41'),'value':_0x5d4153!==_0x340f('0x42')?_0x5d4153:util[_0x340f('0x3b')]('Caller\x20-\x20%s',_0x21700a)},{'name':'phone_home','value':_0x21700a}]})}})[_0x340f('0x3e')](function(_0x3aeedf){logger[_0x340f('0xc')](_0x340f('0x43'));return BPromise[_0x340f('0x36')]({'id':_0x3aeedf['id'],'name':_0x3aeedf['entry_list']['first_name'][_0x340f('0x33')],'phone':_0x3aeedf['entry_list'][_0x340f('0x3d')][_0x340f('0x33')]});});}});}function request(_0x523b94){logger['debug'](_0x340f('0x44'),JSON[_0x340f('0x26')](_0x523b94));return rp(_['merge'](def,_0x523b94));}function getTags(_0x519427,_0x59dddd){var _0x22e5e1=[];if(_0x519427&&_0x519427[_0x340f('0x1f')]>0x0){_0x22e5e1=_[_0x340f('0x45')](_0x519427,_0x59dddd);}return _0x22e5e1;}function getCustomFields(_0x59f062,_0x494dbf){var _0x4a6b4c=[];var _0x46ef98={'custom_fields':[]};if(_0x59f062[_0x340f('0x1f')]>0x0){_['forEach'](_0x59f062,function(_0x146913){if(_0x146913[_0x340f('0x46')]===_0x340f('0x47')&&_0x146913[_0x340f('0x48')]&&!_0x146913[_0x340f('0x49')]){_0x46ef98[_0x146913['nameField'][_0x340f('0x4a')]()]=_0x146913[_0x340f('0x4b')]['toString']();}else if(_0x146913[_0x340f('0x46')]===_0x340f('0x47')&&_0x146913[_0x340f('0x23')]&&_0x146913[_0x340f('0x49')]){_0x46ef98[_0x340f('0x4c')][_0x340f('0x22')]({'id':_0x146913['idField'],'value':_0x146913['content'][_0x340f('0x4d')]()});}else if(_0x146913[_0x340f('0x46')]===_0x340f('0x4e')&&_0x146913[_0x340f('0x21')]&&_0x146913[_0x340f('0x23')]&&_0x146913[_0x340f('0x49')]){_0x494dbf[_0x146913[_0x340f('0x21')]]&&_0x46ef98['custom_fields']['push']({'id':_0x146913['idField'],'value':_0x494dbf[_0x146913['variableName']][_0x340f('0x4d')]()});}else if(_0x146913[_0x340f('0x46')]===_0x340f('0x4f')&&_0x146913['Variable']&&_0x146913[_0x340f('0x50')]['name']&&_0x146913['idField']&&_0x146913[_0x340f('0x49')]){_0x494dbf[_0x146913[_0x340f('0x50')][_0x340f('0xe')][_0x340f('0x4a')]()]&&_0x46ef98[_0x340f('0x4c')]['push']({'id':_0x146913[_0x340f('0x23')],'value':_0x494dbf[_0x146913[_0x340f('0x50')]['name'][_0x340f('0x4a')]()][_0x340f('0x4d')]()});}});}return _0x46ef98;}function getConnection(_0x42e238){return request({'method':_0x340f('0xa'),'form':{'method':_0x340f('0x51'),'input_type':'JSON','response_type':_0x340f('0x25'),'rest_data':JSON[_0x340f('0x26')]({'user_auth':{'user_name':_0x42e238[_0x340f('0x52')],'password':_0x42e238['password'],'encryption':_0x340f('0x53')},'application':_0x340f('0x54')})}})['then'](function(_0x24c401){var _0x6702b8=_0x24c401;if(_0x6702b8['id']){def[_0x340f('0x55')]=_0x6702b8['id'];return BPromise['resolve'](_0x6702b8);}else{throw new Error(util[_0x340f('0x3b')](_0x340f('0x56'),_0x42e238['id']));}});}function setRelationship(_0x3042a5,_0x2fbd34,_0x31bd1a,_0x385905){return request({'form':{'method':'set_relationship','input_type':_0x340f('0x25'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x3042a5['id'],'module_name':_0x340f('0x27'),'module_id':_0x31bd1a['id'],'link_field_name':_0x385905,'related_ids':[_0x2fbd34['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x340f('0x57')]=function(_0x2e8125,_0x251dfc,_0x3a72d5,_0x245373,_0x1cd6a9,_0x562e88){var _0x1ea170,_0x38782d,_0x3e9978,_0x31fc75;_0x562e88[_0x340f('0x58')]=intUtil[_0x340f('0x59')](_0x562e88[_0x340f('0x58')]);_0x562e88['serverUrl']=intUtil[_0x340f('0x59')](_0x562e88['serverUrl']);def[_0x340f('0x5a')]=util[_0x340f('0x3b')](_0x340f('0x5b'),_0x562e88[_0x340f('0x58')]);if(_0x1cd6a9&&_0x1cd6a9[_0x340f('0x5c')]){logger['info'](_0x340f('0x5d'),_0x340f('0x5e'));_0x251dfc[_0x340f('0x5f')]=util[_0x340f('0x3b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x562e88[_0x340f('0x60')],_0x251dfc[_0x340f('0x61')],md5(_0x251dfc['uniqueid']));}else{_0x251dfc['recordingURL']='';}return getConnection(_0x562e88)[_0x340f('0x3e')](function(_0x3ed142){_0x31fc75=_0x3ed142;return getUser(_0x562e88,_0x245373[_0x340f('0xe')],_0x31fc75);})['then'](function(_0xa89a41){_0x1ea170=_0xa89a41;logger[_0x340f('0xc')](_0x340f('0x62'),_0x1ea170['id']);return getEndUser(_0x562e88,_0x251dfc[_0x340f('0x63')],_0x251dfc['calleridnum'],_0x31fc75);})[_0x340f('0x3e')](function(_0x3a638e){_0x38782d=_0x3a638e;logger[_0x340f('0xc')](_0x340f('0x64'),_0x38782d['id']);return getTicket(_0x562e88,_0x1ea170,_0x38782d,_0x3a72d5,_0x251dfc,_0x3a72d5['Fields'],_0x31fc75,'Inbound');})[_0x340f('0x3e')](function(_0x3c8607){_0x3e9978=_0x3c8607;logger['info']('Ticket\x20created!');logger[_0x340f('0xc')](_0x340f('0x65'),_0x3e9978['id']);return setRelationship(_0x31fc75,_0x1ea170,_0x3e9978,_0x340f('0x66'));})[_0x340f('0x3e')](function(){return setRelationship(_0x31fc75,_0x38782d,_0x3e9978,_0x340f('0x67'));})['then'](function(){return getServerInfo(_0x31fc75);})['then'](function(_0xa93cd6){var _0x3acfb1=parseInt(_0xa93cd6['version'][_0x340f('0x68')](0x0));var _0xcd5341=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x562e88[_0x340f('0x58')],_0x3e9978['id']);if(_0x3acfb1>0x6){_0xcd5341=util['format'](_0x340f('0x69'),_0x562e88['remoteUri'],_0x3e9978['id']);}logger[_0x340f('0xc')]('[QUEUE]',_0x340f('0x6a'));emit(util[_0x340f('0x3b')](_0x340f('0x6b'),_0x245373[_0x340f('0xe')]),_0x340f('0x6c'),{'uri':_0xcd5341});})[_0x340f('0x6d')](function(_0x437e4c){logger['error'](_0x340f('0x5d'),JSON[_0x340f('0x26')](_0x437e4c));});};exports[_0x340f('0x6e')]=function(_0x1a337e,_0x5a86a1,_0x3ce5c2,_0xa0c6ef,_0x531fb6,_0xe1974a,_0x3e1bce){var _0x3530e3,_0x255038,_0x5bd8eb,_0x986485;_0xe1974a[_0x340f('0x58')]=intUtil['stripTrailingSlash'](_0xe1974a[_0x340f('0x58')]);_0xe1974a[_0x340f('0x60')]=intUtil[_0x340f('0x59')](_0xe1974a[_0x340f('0x60')]);def['uri']=util[_0x340f('0x3b')](_0x340f('0x5b'),_0xe1974a[_0x340f('0x58')]);if(_0x3e1bce&&_0x3e1bce[_0x340f('0x6f')]&&_0x3e1bce[_0x340f('0x6f')]!==_0x340f('0x70')){logger[_0x340f('0xc')](_0x340f('0x71'),'Recording\x20is\x20enabled!');_0x5a86a1[_0x340f('0x5f')]=util[_0x340f('0x3b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xe1974a[_0x340f('0x60')],_0x5a86a1['uniqueid'],md5(_0x5a86a1['uniqueid']));}return getConnection(_0xe1974a)[_0x340f('0x3e')](function(_0x5d5bca){_0x986485=_0x5d5bca;return getUser(_0xe1974a,_0xa0c6ef['name'],_0x986485);})[_0x340f('0x3e')](function(_0x333708){_0x3530e3=_0x333708;logger[_0x340f('0xc')](_0x340f('0x62'),_0x3530e3['id']);return getEndUser(_0xe1974a,_0x5a86a1[_0x340f('0x72')],_0x5a86a1[_0x340f('0x73')],_0x986485);})[_0x340f('0x3e')](function(_0x573e74){_0x255038=_0x573e74;logger['info'](_0x340f('0x64'),_0x255038['id']);return getTicket(_0xe1974a,_0x3530e3,_0x255038,_0x3ce5c2,_0x5a86a1,_0x3ce5c2[_0x340f('0x74')],_0x986485,_0x340f('0x75'));})['then'](function(_0x43b591){_0x5bd8eb=_0x43b591;logger[_0x340f('0xc')](_0x340f('0x76'));logger[_0x340f('0xc')]('The\x20Ticket\x20ID\x20is:',_0x5bd8eb['id']);return setRelationship(_0x986485,_0x3530e3,_0x5bd8eb,_0x340f('0x66'));})['then'](function(){return setRelationship(_0x986485,_0x255038,_0x5bd8eb,_0x340f('0x67'));})[_0x340f('0x3e')](function(){return getServerInfo(_0x986485);})[_0x340f('0x3e')](function(_0x711dc0){var _0x4c3196=parseInt(_0x711dc0['version'][_0x340f('0x68')](0x0));var _0x47136e=util[_0x340f('0x3b')](_0x340f('0x77'),_0xe1974a[_0x340f('0x58')],_0x5bd8eb['id']);if(_0x4c3196>0x6){_0x47136e=util[_0x340f('0x3b')](_0x340f('0x69'),_0xe1974a[_0x340f('0x58')],_0x5bd8eb['id']);}logger[_0x340f('0xc')](_0x340f('0x71'),_0x340f('0x6a'));emit(util[_0x340f('0x3b')](_0x340f('0x6b'),_0xa0c6ef[_0x340f('0xe')]),_0x340f('0x6c'),{'uri':_0x47136e});})[_0x340f('0x6d')](function(_0x1c2292){logger[_0x340f('0x78')](_0x340f('0x71'),JSON[_0x340f('0x26')](_0x1c2292));});};exports[_0x340f('0x79')]=function(_0x395fa3,_0x2993c4,_0x2b0523,_0x36fe41,_0x43df13,_0x5881ea){var _0x53e55f,_0x410309,_0x12a46a,_0x4f6cad;_0x5881ea[_0x340f('0x58')]=intUtil[_0x340f('0x59')](_0x5881ea['remoteUri']);_0x5881ea[_0x340f('0x60')]=intUtil['stripTrailingSlash'](_0x5881ea['serverUrl']);def[_0x340f('0x5a')]=util[_0x340f('0x3b')](_0x340f('0x5b'),_0x5881ea[_0x340f('0x58')]);if(_0x43df13&&_0x43df13[_0x340f('0x5c')]){logger[_0x340f('0xc')]('['+_0x2993c4[_0x340f('0x7a')][_0x340f('0x7b')]()+']',_0x340f('0x5e'));_0x2993c4['recordingURL']=util[_0x340f('0x3b')](_0x340f('0x7c'),_0x5881ea[_0x340f('0x60')],_0x2993c4[_0x340f('0x61')],md5(_0x2993c4[_0x340f('0x61')]));}else{_0x2993c4[_0x340f('0x5f')]='';}return getConnection(_0x5881ea)[_0x340f('0x3e')](function(_0x2c4872){_0x4f6cad=_0x2c4872;if(!_[_0x340f('0x2c')](_0x36fe41)){return getUser(_0x5881ea,_0x36fe41[_0x340f('0xe')],_0x4f6cad);}else{return getUser(_0x5881ea,null,_0x4f6cad);}})['then'](function(_0x45b39e){_0x53e55f=_0x45b39e;logger[_0x340f('0xc')](_0x340f('0x62'),_0x53e55f['id']);return getEndUser(_0x5881ea,_0x2993c4[_0x340f('0x63')],_0x2993c4[_0x340f('0x7d')],_0x4f6cad);})[_0x340f('0x3e')](function(_0x1d21eb){_0x410309=_0x1d21eb;logger[_0x340f('0xc')](_0x340f('0x64'),_0x410309['id']);return getTicket(_0x5881ea,_0x53e55f,_0x410309,_0x2b0523,_0x2993c4,_0x2b0523[_0x340f('0x74')],_0x4f6cad,_0x340f('0x7e'));})['then'](function(_0x366b0e){_0x12a46a=_0x366b0e;logger['info']('Ticket\x20created!');logger[_0x340f('0xc')](_0x340f('0x65'),_0x12a46a['id']);return setRelationship(_0x4f6cad,_0x53e55f,_0x12a46a,_0x340f('0x66'));})[_0x340f('0x3e')](function(){return setRelationship(_0x4f6cad,_0x410309,_0x12a46a,_0x340f('0x67'));})['then'](function(){return getServerInfo(_0x4f6cad);})[_0x340f('0x6d')](function(_0x3aa6da){logger[_0x340f('0x78')]('['+_0x2993c4[_0x340f('0x7a')][_0x340f('0x7b')]()+']',JSON[_0x340f('0x26')](_0x3aa6da));});}; \ 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 66d6552..6356886 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 _0x5d2a=['join','stripTrailingSlash','slice','substring','validateEmail','getString','length','sortBy','string','push','variableName','toString','customVariable','Variable','name','toLowerCase','type','keyValue','keyType','key','%s:\x20%s','keyContent','format'];(function(_0x2509d6,_0x2b451a){var _0x4ab20a=function(_0x4315b4){while(--_0x4315b4){_0x2509d6['push'](_0x2509d6['shift']());}};_0x4ab20a(++_0x2b451a);}(_0x5d2a,0x175));var _0xa5d2=function(_0x4ff038,_0x567ee5){_0x4ff038=_0x4ff038-0x0;var _0x28e7b4=_0x5d2a[_0x4ff038];return _0x28e7b4;};'use strict';var _=require('lodash');var util=require('util');exports[_0xa5d2('0x0')]=function(_0x128843,_0x734f0d,_0x1be83f){var _0x2efc89=[];if(_0x128843[_0xa5d2('0x1')]>0x0){var _0x16801f=_[_0xa5d2('0x2')](_0x128843,['id']);for(var _0x2866a3=0x0;_0x2866a3<_0x16801f[_0xa5d2('0x1')];_0x2866a3++){var _0x270663=_0x16801f[_0x2866a3];if(_0x270663['type']===_0xa5d2('0x3')){_0x2efc89[_0xa5d2('0x4')](_0x270663['content']);}else if(_0x270663['type']==='variable'&&_0x270663[_0xa5d2('0x5')]){_0x734f0d[_0x270663[_0xa5d2('0x5')]]&&_0x2efc89[_0xa5d2('0x4')](_0x734f0d[_0x270663['variableName']][_0xa5d2('0x6')]());}else if(_0x270663['type']===_0xa5d2('0x7')&&_0x270663[_0xa5d2('0x8')]&&_0x270663['Variable'][_0xa5d2('0x9')]){_0x734f0d[_0x270663[_0xa5d2('0x8')][_0xa5d2('0x9')][_0xa5d2('0xa')]()]&&_0x2efc89[_0xa5d2('0x4')](_0x734f0d[_0x270663[_0xa5d2('0x8')][_0xa5d2('0x9')]['toLowerCase']()]['toString']());}else if(_0x270663[_0xa5d2('0xb')]===_0xa5d2('0xc')){if(_0x270663[_0xa5d2('0xd')]===_0xa5d2('0x3')&&_0x270663[_0xa5d2('0xe')]){_0x2efc89['push'](util['format'](_0xa5d2('0xf'),_0x270663[_0xa5d2('0xe')],_0x270663[_0xa5d2('0x10')]));}else if(_0x270663[_0xa5d2('0xd')]==='variable'&&_0x270663[_0xa5d2('0x5')]&&_0x270663[_0xa5d2('0xe')]){_0x734f0d[_0x270663[_0xa5d2('0x5')]]&&_0x2efc89['push'](util[_0xa5d2('0x11')](_0xa5d2('0xf'),_0x270663[_0xa5d2('0xe')],_0x734f0d[_0x270663[_0xa5d2('0x5')]]));}else if(_0x270663[_0xa5d2('0xd')]==='customVariable'&&_0x270663[_0xa5d2('0x8')]&&_0x270663['Variable'][_0xa5d2('0x9')]&&_0x270663['key']){_0x734f0d[_0x270663[_0xa5d2('0x8')][_0xa5d2('0x9')][_0xa5d2('0xa')]()]&&_0x2efc89[_0xa5d2('0x4')](util[_0xa5d2('0x11')](_0xa5d2('0xf'),_0x270663[_0xa5d2('0xe')],_0x734f0d[_0x270663[_0xa5d2('0x8')][_0xa5d2('0x9')]['toLowerCase']()]));}}}}return _0x2efc89[_0xa5d2('0x12')](_0x1be83f);};exports[_0xa5d2('0x13')]=function(_0x533e02){var _0x25ca9f=_0x533e02[_0xa5d2('0x14')](-0x1);if(_0x25ca9f==='/'){_0x533e02=_0x533e02[_0xa5d2('0x15')](0x0,_0x533e02['lastIndexOf'](_0x25ca9f));}return _0x533e02;};exports[_0xa5d2('0x16')]=function(_0x2d9cbf){if(!_['isNil'](_0x2d9cbf)&&_0x2d9cbf!==''){var _0x344c5d=/^(([^<>()\[\]\\.,;:\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 _0x344c5d['test'](String(_0x2d9cbf)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0x0814=['format','%s:\x20%s','key','keyContent','join','slice','lastIndexOf','validateEmail','isNil','test','util','type','push','content','variable','variableName','toString','customVariable','Variable','toLowerCase','name','keyValue','keyType','string'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0814,0xfa));var _0x4081=function(_0x2e2d03,_0x568948){_0x2e2d03=_0x2e2d03-0x0;var _0x5d1738=_0x0814[_0x2e2d03];return _0x5d1738;};'use strict';var _=require('lodash');var util=require(_0x4081('0x0'));exports['getString']=function(_0x619b8b,_0x5c0c42,_0x34c251){var _0x429326=[];if(_0x619b8b['length']>0x0){var _0x4daaab=_['sortBy'](_0x619b8b,['id']);for(var _0x11625c=0x0;_0x11625c<_0x4daaab['length'];_0x11625c++){var _0x574a6e=_0x4daaab[_0x11625c];if(_0x574a6e[_0x4081('0x1')]==='string'){_0x429326[_0x4081('0x2')](_0x574a6e[_0x4081('0x3')]);}else if(_0x574a6e['type']===_0x4081('0x4')&&_0x574a6e[_0x4081('0x5')]){_0x5c0c42[_0x574a6e[_0x4081('0x5')]]&&_0x429326[_0x4081('0x2')](_0x5c0c42[_0x574a6e[_0x4081('0x5')]][_0x4081('0x6')]());}else if(_0x574a6e['type']===_0x4081('0x7')&&_0x574a6e[_0x4081('0x8')]&&_0x574a6e['Variable']['name']){_0x5c0c42[_0x574a6e[_0x4081('0x8')]['name'][_0x4081('0x9')]()]&&_0x429326[_0x4081('0x2')](_0x5c0c42[_0x574a6e['Variable'][_0x4081('0xa')][_0x4081('0x9')]()]['toString']());}else if(_0x574a6e[_0x4081('0x1')]===_0x4081('0xb')){if(_0x574a6e[_0x4081('0xc')]===_0x4081('0xd')&&_0x574a6e['key']){_0x429326[_0x4081('0x2')](util[_0x4081('0xe')](_0x4081('0xf'),_0x574a6e[_0x4081('0x10')],_0x574a6e[_0x4081('0x11')]));}else if(_0x574a6e[_0x4081('0xc')]==='variable'&&_0x574a6e[_0x4081('0x5')]&&_0x574a6e[_0x4081('0x10')]){_0x5c0c42[_0x574a6e['variableName']]&&_0x429326[_0x4081('0x2')](util[_0x4081('0xe')](_0x4081('0xf'),_0x574a6e[_0x4081('0x10')],_0x5c0c42[_0x574a6e[_0x4081('0x5')]]));}else if(_0x574a6e['keyType']==='customVariable'&&_0x574a6e[_0x4081('0x8')]&&_0x574a6e['Variable'][_0x4081('0xa')]&&_0x574a6e[_0x4081('0x10')]){_0x5c0c42[_0x574a6e[_0x4081('0x8')]['name'][_0x4081('0x9')]()]&&_0x429326[_0x4081('0x2')](util[_0x4081('0xe')](_0x4081('0xf'),_0x574a6e[_0x4081('0x10')],_0x5c0c42[_0x574a6e[_0x4081('0x8')][_0x4081('0xa')][_0x4081('0x9')]()]));}}}}return _0x429326[_0x4081('0x12')](_0x34c251);};exports['stripTrailingSlash']=function(_0x5d91e2){var _0x1bb310=_0x5d91e2[_0x4081('0x13')](-0x1);if(_0x1bb310==='/'){_0x5d91e2=_0x5d91e2['substring'](0x0,_0x5d91e2[_0x4081('0x14')](_0x1bb310));}return _0x5d91e2;};exports[_0x4081('0x15')]=function(_0x193134){if(!_[_0x4081('0x16')](_0x193134)&&_0x193134!==''){var _0x3ae20d=/^(([^<>()\[\]\\.,;:\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 _0x3ae20d[_0x4081('0x17')](String(_0x193134)[_0x4081('0x9')]());}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 265165d..3abf2a5 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file +var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x28630c,_0xfc9816){var _0x464065=function(_0x4edf30){while(--_0x4edf30){_0x28630c['push'](_0x28630c['shift']());}};_0x464065(++_0xfc9816);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 38813de..4e859ee 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 _0x8d0d=['[OUTBOUND]','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','calleridname','The\x20Ticket\x20ID\x20is:','lodash','request-promise','util','ioredis','./util','../../../../config/environment','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','format','%s/search.json','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','map','includes','picklist','type','nameField','toLowerCase','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','POST','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:'];(function(_0x2786ea,_0x16c3c3){var _0x5c38e5=function(_0x5a53c5){while(--_0x5a53c5){_0x2786ea['push'](_0x2786ea['shift']());}};_0x5c38e5(++_0x16c3c3);}(_0x8d0d,0xe2));var _0xd8d0=function(_0x2f6706,_0x3d38a2){_0x2f6706=_0x2f6706-0x0;var _0x12a84e=_0x8d0d[_0x2f6706];return _0x12a84e;};'use strict';var _=require(_0xd8d0('0x0'));var rp=require(_0xd8d0('0x1'));var md5=require('md5');var util=require(_0xd8d0('0x2'));var Redis=require(_0xd8d0('0x3'));var intUtil=require(_0xd8d0('0x4'));var config=require(_0xd8d0('0x5'));var logger=require('../../../../config/logger')(_0xd8d0('0x6'));config[_0xd8d0('0x7')]=_[_0xd8d0('0x8')](config[_0xd8d0('0x7')],{'host':_0xd8d0('0x9'),'port':0x18eb});var io=require(_0xd8d0('0xa'))(new Redis(config[_0xd8d0('0x7')]));function emit(_0x196828,_0x381c16,_0x371144){io['to'](_0x196828)[_0xd8d0('0xb')](_0x381c16,_0x371144);}var headers={'Content-Type':_0xd8d0('0xc'),'Accept':'application/json'};function getTicket(_0x2956c3,_0x594087,_0x4cca9b,_0x1910a0,_0x72ed70){logger[_0xd8d0('0xd')](_0xd8d0('0xe'));return request({'uri':util['format'](_0xd8d0('0xf'),_0x2956c3[_0xd8d0('0x10')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x4cca9b['id'],'submitter_id':_0x594087?_0x594087['id']:undefined,'assignee_id':_0x594087?_0x594087['id']:undefined,'tags':getTags(_0x1910a0[_0xd8d0('0x11')],_0xd8d0('0x12')),'subject':intUtil[_0xd8d0('0x13')](_0x1910a0[_0xd8d0('0x14')],_0x72ed70,'\x20'),'description':intUtil[_0xd8d0('0x13')](_0x1910a0[_0xd8d0('0x15')],_0x72ed70,'\x0a'),'comment':{'public':![],'body':intUtil[_0xd8d0('0x13')](_0x1910a0[_0xd8d0('0x15')],_0x72ed70,'\x0a')}},getCustomFields(_0x1910a0[_0xd8d0('0x16')],_0x72ed70))}})[_0xd8d0('0x17')](function(_0x238ae9){logger[_0xd8d0('0xd')](_0xd8d0('0x18'));return _0x238ae9['ticket'];});}function getUser(_0x38bf8d,_0x5bed49){if(intUtil['validateEmail'](_0x5bed49)){logger['info']('Getting\x20agent\x20with\x20email',_0x5bed49);return request({'uri':util[_0xd8d0('0x19')](_0xd8d0('0x1a'),_0x38bf8d['remoteUri']),'qs':{'query':util[_0xd8d0('0x19')]('type:user\x20role:agent\x20email:%s',_0x5bed49)}})[_0xd8d0('0x17')](function(_0x23edae){if(_0x23edae[_0xd8d0('0x1b')]){logger['info'](_0xd8d0('0x1c'));return _[_0xd8d0('0x1d')](_0x23edae[_0xd8d0('0x1e')],{'email':_0x5bed49,'role':_0xd8d0('0x1f')});}else{logger[_0xd8d0('0xd')](_0xd8d0('0x20'));return request({'uri':util[_0xd8d0('0x19')](_0xd8d0('0x21'),_0x38bf8d['remoteUri'])})[_0xd8d0('0x17')](function(_0x26f8ee){logger[_0xd8d0('0xd')](_0xd8d0('0x22'));return _0x26f8ee[_0xd8d0('0x23')];});}});}else{logger[_0xd8d0('0xd')](_0xd8d0('0x20'));return request({'uri':util[_0xd8d0('0x19')](_0xd8d0('0x21'),_0x38bf8d[_0xd8d0('0x10')])})[_0xd8d0('0x17')](function(_0x1b38f6){logger['info'](_0xd8d0('0x22'));return _0x1b38f6[_0xd8d0('0x23')];});}}function getEndUser(_0x119f33,_0x194ccb,_0x44cf48){logger[_0xd8d0('0xd')](_0xd8d0('0x24'),_0x44cf48);return request({'uri':util[_0xd8d0('0x19')]('%s/search.json',_0x119f33[_0xd8d0('0x10')]),'qs':{'query':util[_0xd8d0('0x19')](_0xd8d0('0x25'),_0x44cf48)}})['then'](function(_0x3871cd){var _0x2cba23;if(_0x3871cd[_0xd8d0('0x1e')][_0xd8d0('0x26')]){_0x3871cd[_0xd8d0('0x1e')]=_[_0xd8d0('0x27')](_0x3871cd['results'],{'suspended':![],'role':'end-user'});if(_0x3871cd['results'][_0xd8d0('0x26')]){_0x2cba23=_[_0xd8d0('0x28')](_0x3871cd[_0xd8d0('0x1e')]);}}if(_0x2cba23){logger[_0xd8d0('0xd')](_0xd8d0('0x29'));return _0x2cba23;}else{logger['info'](_0xd8d0('0x2a'));return request({'uri':util[_0xd8d0('0x19')](_0xd8d0('0x2b'),_0x119f33[_0xd8d0('0x10')]),'method':'POST','body':{'user':{'role':_0xd8d0('0x2c'),'name':util['format'](_0xd8d0('0x2d'),_0x194ccb||_0x44cf48),'phone':_0x44cf48}}})[_0xd8d0('0x17')](function(_0x53eb65){logger[_0xd8d0('0xd')](_0xd8d0('0x2e'));return _0x53eb65[_0xd8d0('0x23')];});}});}function getAuth(_0x360963){var _0x2fc945;if(_0x360963[_0xd8d0('0x2f')]==='password'){_0x2fc945=util[_0xd8d0('0x19')]('%s:%s',_0x360963[_0xd8d0('0x30')],_0x360963['password']);}else if(_0x360963[_0xd8d0('0x2f')]===_0xd8d0('0x31')){_0x2fc945=util[_0xd8d0('0x19')](_0xd8d0('0x32'),_0x360963['username'],_0x360963[_0xd8d0('0x31')]);}return util['format'](_0xd8d0('0x33'),new Buffer(_0x2fc945)[_0xd8d0('0x34')](_0xd8d0('0x35')));}function request(_0x3c6c79){logger[_0xd8d0('0x36')](_0xd8d0('0x37'),JSON[_0xd8d0('0x38')](_0x3c6c79));return rp(_[_0xd8d0('0x8')](_0x3c6c79,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3d44f7,_0x40525f){var _0x102149=[];if(_0x3d44f7&&_0x3d44f7['length']>0x0){_0x102149=_[_0xd8d0('0x39')](_0x3d44f7,_0x40525f);}return _0x102149;}function getCustomFields(_0x265a91,_0x5d7f2d){var _0x27e7c5=[];var _0x58de9b={'custom_fields':[]};if(_0x265a91[_0xd8d0('0x26')]>0x0){_['forEach'](_0x265a91,function(_0x301222){if(_[_0xd8d0('0x3a')](['string',_0xd8d0('0x3b')],_0x301222[_0xd8d0('0x3c')])&&_0x301222[_0xd8d0('0x3d')]&&!_0x301222['customField']){_0x58de9b[_0x301222[_0xd8d0('0x3d')][_0xd8d0('0x3e')]()]=_0x301222[_0xd8d0('0x3f')][_0xd8d0('0x34')]();}else if(_[_0xd8d0('0x3a')](['string',_0xd8d0('0x3b')],_0x301222[_0xd8d0('0x3c')])&&_0x301222[_0xd8d0('0x40')]&&_0x301222['customField']){_0x58de9b[_0xd8d0('0x41')][_0xd8d0('0x42')]({'id':_0x301222[_0xd8d0('0x40')],'value':_0x301222[_0xd8d0('0x3f')]['toString']()});}else if(_0x301222[_0xd8d0('0x3c')]===_0xd8d0('0x43')&&_0x301222[_0xd8d0('0x44')]&&_0x301222[_0xd8d0('0x40')]&&_0x301222['customField']){_0x5d7f2d[_0x301222[_0xd8d0('0x44')]]&&_0x58de9b['custom_fields'][_0xd8d0('0x42')]({'id':_0x301222[_0xd8d0('0x40')],'value':_0x5d7f2d[_0x301222[_0xd8d0('0x44')]]['toString']()});}else if(_0x301222[_0xd8d0('0x3c')]===_0xd8d0('0x45')&&_0x301222[_0xd8d0('0x46')]&&_0x301222[_0xd8d0('0x46')][_0xd8d0('0x12')]&&_0x301222[_0xd8d0('0x40')]&&_0x301222['customField']){_0x5d7f2d[_0x301222[_0xd8d0('0x46')]['name'][_0xd8d0('0x3e')]()]&&_0x58de9b['custom_fields'][_0xd8d0('0x42')]({'id':_0x301222[_0xd8d0('0x40')],'value':_0x5d7f2d[_0x301222[_0xd8d0('0x46')][_0xd8d0('0x12')][_0xd8d0('0x3e')]()][_0xd8d0('0x34')]()});}});}return _0x58de9b;}exports[_0xd8d0('0x47')]=function(_0x5bab89,_0x2f941f,_0x973f28,_0x3ec486,_0x2d48af,_0x311302){var _0x237aa7,_0x33faed;_0x311302[_0xd8d0('0x10')]=intUtil['stripTrailingSlash'](_0x311302[_0xd8d0('0x10')]);_0x311302['serverUrl']=intUtil[_0xd8d0('0x48')](_0x311302[_0xd8d0('0x49')]);if(_0x2d48af&&_0x2d48af[_0xd8d0('0x4a')]){logger['info'](_0xd8d0('0x4b'),_0xd8d0('0x4c'));_0x2f941f[_0xd8d0('0x4d')]=util[_0xd8d0('0x19')](_0xd8d0('0x4e'),_0x311302[_0xd8d0('0x49')],_0x2f941f['uniqueid'],md5(_0x2f941f[_0xd8d0('0x4f')]));}else{_0x2f941f['recordingURL']='';}headers['Authorization']=getAuth(_0x311302);return getUser(_0x311302,_0x3ec486[_0xd8d0('0x50')])[_0xd8d0('0x17')](function(_0x455d00){_0x237aa7=_0x455d00;logger[_0xd8d0('0xd')](_0xd8d0('0x51'),_0x237aa7['id']);return getEndUser(_0x311302,_0x2f941f['calleridname'],_0x2f941f['calleridnum']);})[_0xd8d0('0x17')](function(_0x30a934){_0x33faed=_0x30a934;logger[_0xd8d0('0xd')]('The\x20Enduser\x20ID\x20is:',_0x33faed['id']);return getTicket(_0x311302,_0x237aa7,_0x33faed,_0x973f28,_0x2f941f);})[_0xd8d0('0x17')](function(_0x53f082){if(_0x53f082){logger[_0xd8d0('0xd')]('The\x20Ticket\x20ID\x20is:',_0x53f082['id']);switch(_0x311302[_0xd8d0('0x3c')]){case _0xd8d0('0x52'):logger['info']('[QUEUE]',_0xd8d0('0x53'));return request({'uri':util[_0xd8d0('0x19')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x311302[_0xd8d0('0x10')],_0x237aa7['id'],_0x53f082['id']),'method':_0xd8d0('0x54')});case _0xd8d0('0x55'):logger[_0xd8d0('0xd')](_0xd8d0('0x4b'),_0xd8d0('0x56'));emit(util[_0xd8d0('0x19')](_0xd8d0('0x57'),_0x3ec486[_0xd8d0('0x12')]),_0xd8d0('0x58'),{'uri':util[_0xd8d0('0x19')]('%s/agent/tickets/%s',_0x311302[_0xd8d0('0x10')][_0xd8d0('0x59')](_0xd8d0('0x5a'),''),_0x53f082['id'])});break;default:logger[_0xd8d0('0x5b')](_0xd8d0('0x4b'),_0xd8d0('0x5c'));}}})[_0xd8d0('0x5d')](function(_0x417f26){logger['error'](_0xd8d0('0x5e'),util[_0xd8d0('0x5f')](_0x417f26,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x3da85f,_0x3b15e6,_0x3dddff,_0x45ab08,_0x5de709,_0x39394f,_0xdd14cf){var _0x4b705a,_0x32ba93;_0x39394f[_0xd8d0('0x10')]=intUtil[_0xd8d0('0x48')](_0x39394f[_0xd8d0('0x10')]);_0x39394f[_0xd8d0('0x49')]=intUtil[_0xd8d0('0x48')](_0x39394f['serverUrl']);if(_0xdd14cf&&_0xdd14cf[_0xd8d0('0x60')]&&_0xdd14cf['recordingFormat']!==_0xd8d0('0x61')){logger[_0xd8d0('0xd')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3b15e6[_0xd8d0('0x4d')]=util[_0xd8d0('0x19')](_0xd8d0('0x4e'),_0x39394f[_0xd8d0('0x49')],_0x3b15e6['uniqueid'],md5(_0x3b15e6[_0xd8d0('0x4f')]));}headers['Authorization']=getAuth(_0x39394f);return getUser(_0x39394f,_0x45ab08[_0xd8d0('0x50')])[_0xd8d0('0x17')](function(_0x34319c){_0x4b705a=_0x34319c;logger[_0xd8d0('0xd')](_0xd8d0('0x51'),_0x4b705a['id']);return getEndUser(_0x39394f,_0x3b15e6[_0xd8d0('0x62')],_0x3b15e6[_0xd8d0('0x63')]);})['then'](function(_0x495e4a){_0x32ba93=_0x495e4a;logger[_0xd8d0('0xd')](_0xd8d0('0x64'),_0x32ba93['id']);return getTicket(_0x39394f,_0x4b705a,_0x32ba93,_0x3dddff,_0x3b15e6);})[_0xd8d0('0x17')](function(_0x460206){if(_0x460206){logger[_0xd8d0('0xd')]('The\x20Ticket\x20ID\x20is:',_0x460206['id']);switch(_0x39394f[_0xd8d0('0x3c')]){case _0xd8d0('0x52'):logger[_0xd8d0('0xd')](_0xd8d0('0x65'),_0xd8d0('0x53'));return request({'uri':util[_0xd8d0('0x19')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x39394f[_0xd8d0('0x10')],_0x4b705a['id'],_0x460206['id']),'method':_0xd8d0('0x54')});case _0xd8d0('0x55'):logger[_0xd8d0('0xd')]('[OUTBOUND]',_0xd8d0('0x56'));emit(util[_0xd8d0('0x19')]('user:%s',_0x45ab08['name']),_0xd8d0('0x58'),{'uri':util['format'](_0xd8d0('0x66'),_0x39394f[_0xd8d0('0x10')]['replace']('/api/v2',''),_0x460206['id'])});break;default:logger[_0xd8d0('0x5b')]('[OUTBOUND]',_0xd8d0('0x5c'));}}})[_0xd8d0('0x5d')](function(_0x43c333){logger[_0xd8d0('0x5b')](_0xd8d0('0x67'),util[_0xd8d0('0x5f')](_0x43c333,{'showHidden':!![],'depth':null}));});};exports[_0xd8d0('0x68')]=function(_0x1d5f61,_0x44a591,_0x34afbb,_0x55ec6a,_0x20a0a0,_0xc5c3b1){var _0x52dfd1,_0x3ba9a8;_0xc5c3b1[_0xd8d0('0x10')]=intUtil['stripTrailingSlash'](_0xc5c3b1[_0xd8d0('0x10')]);_0xc5c3b1[_0xd8d0('0x49')]=intUtil[_0xd8d0('0x48')](_0xc5c3b1['serverUrl']);if(_0x20a0a0&&_0x20a0a0[_0xd8d0('0x4a')]){logger[_0xd8d0('0xd')]('['+_0x44a591[_0xd8d0('0x69')][_0xd8d0('0x6a')]()+']',_0xd8d0('0x4c'));_0x44a591['recordingURL']=util[_0xd8d0('0x19')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xc5c3b1[_0xd8d0('0x49')],_0x44a591[_0xd8d0('0x4f')],md5(_0x44a591['uniqueid']));}else{_0x44a591['recordingURL']='';}headers['Authorization']=getAuth(_0xc5c3b1);return getUser(_0xc5c3b1)[_0xd8d0('0x17')](function(_0x48179b){_0x52dfd1=_0x48179b;logger[_0xd8d0('0xd')](_0xd8d0('0x51'),_0x52dfd1['id']);return getEndUser(_0xc5c3b1,_0x44a591[_0xd8d0('0x6b')],_0x44a591['calleridnum']);})[_0xd8d0('0x17')](function(_0x27e21a){_0x3ba9a8=_0x27e21a;logger[_0xd8d0('0xd')]('The\x20Enduser\x20ID\x20is:',_0x3ba9a8['id']);return getTicket(_0xc5c3b1,_0x52dfd1,_0x3ba9a8,_0x34afbb,_0x44a591);})[_0xd8d0('0x17')](function(_0x4bed45){if(_0x4bed45){logger[_0xd8d0('0xd')](_0xd8d0('0x6c'),_0x4bed45['id']);}})['catch'](function(_0x3f2026){logger[_0xd8d0('0x5b')]('['+_0x44a591[_0xd8d0('0x69')][_0xd8d0('0x6a')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x3f2026,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa2a1=['../../../../config/environment','zendesk','redis','defaults','localhost','socket.io-emitter','application/json','info','format','%s/tickets.json','POST','merge','Tags','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','authType','username','token','Basic\x20%s','toString','base64','[HTTP]','GET','forEach','string','picklist','type','customField','nameField','toLowerCase','includes','custom_fields','idField','variable','variableName','push','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','lastevent','toUpperCase','calleridname','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util'];(function(_0x5b372b,_0x5f12d5){var _0x13d107=function(_0xc3e356){while(--_0xc3e356){_0x5b372b['push'](_0x5b372b['shift']());}};_0x13d107(++_0x5f12d5);}(_0xa2a1,0x144));var _0x1a2a=function(_0x4d9030,_0x580c89){_0x4d9030=_0x4d9030-0x0;var _0xb5e4b7=_0xa2a1[_0x4d9030];return _0xb5e4b7;};'use strict';var _=require(_0x1a2a('0x0'));var rp=require(_0x1a2a('0x1'));var md5=require(_0x1a2a('0x2'));var util=require(_0x1a2a('0x3'));var Redis=require(_0x1a2a('0x4'));var intUtil=require(_0x1a2a('0x5'));var config=require(_0x1a2a('0x6'));var logger=require('../../../../config/logger')(_0x1a2a('0x7'));config[_0x1a2a('0x8')]=_[_0x1a2a('0x9')](config['redis'],{'host':_0x1a2a('0xa'),'port':0x18eb});var io=require(_0x1a2a('0xb'))(new Redis(config[_0x1a2a('0x8')]));function emit(_0x2f4bb4,_0x3b4ed4,_0x49219a){io['to'](_0x2f4bb4)['emit'](_0x3b4ed4,_0x49219a);}var headers={'Content-Type':_0x1a2a('0xc'),'Accept':'application/json'};function getTicket(_0x4c7456,_0x3387c6,_0x2ae497,_0x44e826,_0x32b1ee){logger[_0x1a2a('0xd')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x1a2a('0xe')](_0x1a2a('0xf'),_0x4c7456['remoteUri']),'method':_0x1a2a('0x10'),'body':{'ticket':_[_0x1a2a('0x11')]({'requester_id':_0x2ae497['id'],'submitter_id':_0x3387c6?_0x3387c6['id']:undefined,'assignee_id':_0x3387c6?_0x3387c6['id']:undefined,'tags':getTags(_0x44e826[_0x1a2a('0x12')],'name'),'subject':intUtil[_0x1a2a('0x13')](_0x44e826['Subjects'],_0x32b1ee,'\x20'),'description':intUtil[_0x1a2a('0x13')](_0x44e826[_0x1a2a('0x14')],_0x32b1ee,'\x0a'),'comment':{'public':![],'body':intUtil[_0x1a2a('0x13')](_0x44e826[_0x1a2a('0x14')],_0x32b1ee,'\x0a')}},getCustomFields(_0x44e826[_0x1a2a('0x15')],_0x32b1ee))}})[_0x1a2a('0x16')](function(_0x980a84){logger['info'](_0x1a2a('0x17'));return _0x980a84[_0x1a2a('0x18')];});}function getUser(_0x34597a,_0x2c48b4){if(intUtil[_0x1a2a('0x19')](_0x2c48b4)){logger['info'](_0x1a2a('0x1a'),_0x2c48b4);return request({'uri':util[_0x1a2a('0xe')](_0x1a2a('0x1b'),_0x34597a[_0x1a2a('0x1c')]),'qs':{'query':util[_0x1a2a('0xe')](_0x1a2a('0x1d'),_0x2c48b4)}})[_0x1a2a('0x16')](function(_0x5d4adb){if(_0x5d4adb[_0x1a2a('0x1e')]){logger[_0x1a2a('0xd')](_0x1a2a('0x1f'));return _[_0x1a2a('0x20')](_0x5d4adb[_0x1a2a('0x21')],{'email':_0x2c48b4,'role':'agent'});}else{logger[_0x1a2a('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x1a2a('0xe')](_0x1a2a('0x22'),_0x34597a[_0x1a2a('0x1c')])})['then'](function(_0x165581){logger['info'](_0x1a2a('0x23'));return _0x165581[_0x1a2a('0x24')];});}});}else{logger['info'](_0x1a2a('0x25'));return request({'uri':util[_0x1a2a('0xe')](_0x1a2a('0x22'),_0x34597a[_0x1a2a('0x1c')])})[_0x1a2a('0x16')](function(_0x3fb333){logger[_0x1a2a('0xd')](_0x1a2a('0x23'));return _0x3fb333[_0x1a2a('0x24')];});}}function getEndUser(_0x57fb3d,_0x4a7d86,_0x154b7c){logger[_0x1a2a('0xd')]('Searching\x20enduser\x20with\x20phone',_0x154b7c);return request({'uri':util[_0x1a2a('0xe')]('%s/search.json',_0x57fb3d[_0x1a2a('0x1c')]),'qs':{'query':util[_0x1a2a('0xe')](_0x1a2a('0x26'),_0x154b7c)}})[_0x1a2a('0x16')](function(_0x17f735){var _0x269691;if(_0x17f735[_0x1a2a('0x21')][_0x1a2a('0x27')]){_0x17f735['results']=_[_0x1a2a('0x28')](_0x17f735[_0x1a2a('0x21')],{'suspended':![],'role':_0x1a2a('0x29')});if(_0x17f735[_0x1a2a('0x21')]['length']){_0x269691=_['first'](_0x17f735[_0x1a2a('0x21')]);}}if(_0x269691){logger[_0x1a2a('0xd')](_0x1a2a('0x2a'));return _0x269691;}else{logger[_0x1a2a('0xd')](_0x1a2a('0x2b'));return request({'uri':util[_0x1a2a('0xe')]('%s/users.json',_0x57fb3d['remoteUri']),'method':_0x1a2a('0x10'),'body':{'user':{'role':_0x1a2a('0x29'),'name':util[_0x1a2a('0xe')](_0x1a2a('0x2c'),_0x4a7d86||_0x154b7c),'phone':_0x154b7c}}})[_0x1a2a('0x16')](function(_0x3d586f){logger[_0x1a2a('0xd')](_0x1a2a('0x2d'));return _0x3d586f[_0x1a2a('0x24')];});}});}function getAuth(_0x13c79e){var _0x56f80d;if(_0x13c79e['authType']===_0x1a2a('0x2e')){_0x56f80d=util[_0x1a2a('0xe')](_0x1a2a('0x2f'),_0x13c79e['username'],_0x13c79e[_0x1a2a('0x2e')]);}else if(_0x13c79e[_0x1a2a('0x30')]==='token'){_0x56f80d=util[_0x1a2a('0xe')]('%s/token:%s',_0x13c79e[_0x1a2a('0x31')],_0x13c79e[_0x1a2a('0x32')]);}return util[_0x1a2a('0xe')](_0x1a2a('0x33'),new Buffer(_0x56f80d)[_0x1a2a('0x34')](_0x1a2a('0x35')));}function request(_0x265e7b){logger['debug'](_0x1a2a('0x36'),JSON['stringify'](_0x265e7b));return rp(_[_0x1a2a('0x9')](_0x265e7b,{'method':_0x1a2a('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x5b0cad,_0x221b00){var _0xcb2a7f=[];if(_0x5b0cad&&_0x5b0cad[_0x1a2a('0x27')]>0x0){_0xcb2a7f=_['map'](_0x5b0cad,_0x221b00);}return _0xcb2a7f;}function getCustomFields(_0x2f0056,_0x18056e){var _0x330f6f=[];var _0x1622c9={'custom_fields':[]};if(_0x2f0056[_0x1a2a('0x27')]>0x0){_[_0x1a2a('0x38')](_0x2f0056,function(_0x4c8305){if(_['includes']([_0x1a2a('0x39'),_0x1a2a('0x3a')],_0x4c8305[_0x1a2a('0x3b')])&&_0x4c8305['nameField']&&!_0x4c8305[_0x1a2a('0x3c')]){_0x1622c9[_0x4c8305[_0x1a2a('0x3d')][_0x1a2a('0x3e')]()]=_0x4c8305['content']['toString']();}else if(_[_0x1a2a('0x3f')]([_0x1a2a('0x39'),_0x1a2a('0x3a')],_0x4c8305['type'])&&_0x4c8305['idField']&&_0x4c8305['customField']){_0x1622c9[_0x1a2a('0x40')]['push']({'id':_0x4c8305[_0x1a2a('0x41')],'value':_0x4c8305['content'][_0x1a2a('0x34')]()});}else if(_0x4c8305[_0x1a2a('0x3b')]===_0x1a2a('0x42')&&_0x4c8305[_0x1a2a('0x43')]&&_0x4c8305[_0x1a2a('0x41')]&&_0x4c8305[_0x1a2a('0x3c')]){_0x18056e[_0x4c8305[_0x1a2a('0x43')]]&&_0x1622c9[_0x1a2a('0x40')][_0x1a2a('0x44')]({'id':_0x4c8305[_0x1a2a('0x41')],'value':_0x18056e[_0x4c8305['variableName']]['toString']()});}else if(_0x4c8305[_0x1a2a('0x3b')]==='customVariable'&&_0x4c8305['Variable']&&_0x4c8305[_0x1a2a('0x45')][_0x1a2a('0x46')]&&_0x4c8305[_0x1a2a('0x41')]&&_0x4c8305[_0x1a2a('0x3c')]){_0x18056e[_0x4c8305['Variable'][_0x1a2a('0x46')][_0x1a2a('0x3e')]()]&&_0x1622c9[_0x1a2a('0x40')][_0x1a2a('0x44')]({'id':_0x4c8305[_0x1a2a('0x41')],'value':_0x18056e[_0x4c8305[_0x1a2a('0x45')][_0x1a2a('0x46')][_0x1a2a('0x3e')]()][_0x1a2a('0x34')]()});}});}return _0x1622c9;}exports[_0x1a2a('0x47')]=function(_0x587499,_0x16c859,_0x3a3eef,_0x5cc74c,_0x598790,_0x245295){var _0x3fa607,_0x1e5a0f;_0x245295[_0x1a2a('0x1c')]=intUtil[_0x1a2a('0x48')](_0x245295[_0x1a2a('0x1c')]);_0x245295[_0x1a2a('0x49')]=intUtil['stripTrailingSlash'](_0x245295[_0x1a2a('0x49')]);if(_0x598790&&_0x598790[_0x1a2a('0x4a')]){logger['info'](_0x1a2a('0x4b'),_0x1a2a('0x4c'));_0x16c859['recordingURL']=util[_0x1a2a('0xe')](_0x1a2a('0x4d'),_0x245295[_0x1a2a('0x49')],_0x16c859[_0x1a2a('0x4e')],md5(_0x16c859[_0x1a2a('0x4e')]));}else{_0x16c859['recordingURL']='';}headers[_0x1a2a('0x4f')]=getAuth(_0x245295);return getUser(_0x245295,_0x5cc74c[_0x1a2a('0x50')])['then'](function(_0x15653f){_0x3fa607=_0x15653f;logger[_0x1a2a('0xd')](_0x1a2a('0x51'),_0x3fa607['id']);return getEndUser(_0x245295,_0x16c859['calleridname'],_0x16c859['calleridnum']);})[_0x1a2a('0x16')](function(_0x347360){_0x1e5a0f=_0x347360;logger['info'](_0x1a2a('0x52'),_0x1e5a0f['id']);return getTicket(_0x245295,_0x3fa607,_0x1e5a0f,_0x3a3eef,_0x16c859);})[_0x1a2a('0x16')](function(_0x21ba54){if(_0x21ba54){logger[_0x1a2a('0xd')](_0x1a2a('0x53'),_0x21ba54['id']);switch(_0x245295[_0x1a2a('0x3b')]){case _0x1a2a('0x54'):logger[_0x1a2a('0xd')](_0x1a2a('0x4b'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x1a2a('0xe')](_0x1a2a('0x55'),_0x245295[_0x1a2a('0x1c')],_0x3fa607['id'],_0x21ba54['id']),'method':'POST'});case _0x1a2a('0x56'):logger[_0x1a2a('0xd')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x1a2a('0x57'),_0x5cc74c[_0x1a2a('0x46')]),_0x1a2a('0x58'),{'uri':util[_0x1a2a('0xe')]('%s/agent/tickets/%s',_0x245295['remoteUri']['replace'](_0x1a2a('0x59'),''),_0x21ba54['id'])});break;default:logger[_0x1a2a('0x5a')](_0x1a2a('0x4b'),_0x1a2a('0x5b'));}}})[_0x1a2a('0x5c')](function(_0x45e66b){logger[_0x1a2a('0x5a')](_0x1a2a('0x5d'),util['inspect'](_0x45e66b,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x19a219,_0x118176,_0x2e8304,_0x22afa7,_0x3f60d3,_0x12574b,_0x4e11a2){var _0x1e8dd5,_0x4ae8b6;_0x12574b['remoteUri']=intUtil[_0x1a2a('0x48')](_0x12574b[_0x1a2a('0x1c')]);_0x12574b[_0x1a2a('0x49')]=intUtil['stripTrailingSlash'](_0x12574b[_0x1a2a('0x49')]);if(_0x4e11a2&&_0x4e11a2[_0x1a2a('0x5e')]&&_0x4e11a2['recordingFormat']!==_0x1a2a('0x5f')){logger[_0x1a2a('0xd')](_0x1a2a('0x60'),'Recording\x20is\x20enabled!');_0x118176[_0x1a2a('0x61')]=util[_0x1a2a('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x12574b[_0x1a2a('0x49')],_0x118176[_0x1a2a('0x4e')],md5(_0x118176[_0x1a2a('0x4e')]));}headers['Authorization']=getAuth(_0x12574b);return getUser(_0x12574b,_0x22afa7[_0x1a2a('0x50')])[_0x1a2a('0x16')](function(_0x1e0c14){_0x1e8dd5=_0x1e0c14;logger[_0x1a2a('0xd')]('The\x20User\x20ID\x20is:',_0x1e8dd5['id']);return getEndUser(_0x12574b,_0x118176[_0x1a2a('0x62')],_0x118176[_0x1a2a('0x63')]);})[_0x1a2a('0x16')](function(_0x35444d){_0x4ae8b6=_0x35444d;logger[_0x1a2a('0xd')](_0x1a2a('0x52'),_0x4ae8b6['id']);return getTicket(_0x12574b,_0x1e8dd5,_0x4ae8b6,_0x2e8304,_0x118176);})[_0x1a2a('0x16')](function(_0xa64a8b){if(_0xa64a8b){logger['info'](_0x1a2a('0x53'),_0xa64a8b['id']);switch(_0x12574b[_0x1a2a('0x3b')]){case _0x1a2a('0x54'):logger[_0x1a2a('0xd')]('[OUTBOUND]',_0x1a2a('0x64'));return request({'uri':util[_0x1a2a('0xe')](_0x1a2a('0x55'),_0x12574b['remoteUri'],_0x1e8dd5['id'],_0xa64a8b['id']),'method':_0x1a2a('0x10')});case'newTab':logger[_0x1a2a('0xd')](_0x1a2a('0x60'),_0x1a2a('0x65'));emit(util[_0x1a2a('0xe')](_0x1a2a('0x57'),_0x22afa7[_0x1a2a('0x46')]),_0x1a2a('0x58'),{'uri':util[_0x1a2a('0xe')](_0x1a2a('0x66'),_0x12574b['remoteUri']['replace']('/api/v2',''),_0xa64a8b['id'])});break;default:logger[_0x1a2a('0x5a')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x5397f1){logger['error'](_0x1a2a('0x67'),util[_0x1a2a('0x68')](_0x5397f1,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x23dd1f,_0x13db07,_0x42dd4d,_0x3e07c2,_0x38152d,_0xb0ff2c){var _0xb66d1f,_0x4bb8ce;_0xb0ff2c[_0x1a2a('0x1c')]=intUtil['stripTrailingSlash'](_0xb0ff2c['remoteUri']);_0xb0ff2c[_0x1a2a('0x49')]=intUtil['stripTrailingSlash'](_0xb0ff2c[_0x1a2a('0x49')]);if(_0x38152d&&_0x38152d[_0x1a2a('0x4a')]){logger['info']('['+_0x13db07[_0x1a2a('0x69')][_0x1a2a('0x6a')]()+']',_0x1a2a('0x4c'));_0x13db07[_0x1a2a('0x61')]=util[_0x1a2a('0xe')](_0x1a2a('0x4d'),_0xb0ff2c[_0x1a2a('0x49')],_0x13db07['uniqueid'],md5(_0x13db07[_0x1a2a('0x4e')]));}else{_0x13db07[_0x1a2a('0x61')]='';}headers[_0x1a2a('0x4f')]=getAuth(_0xb0ff2c);return getUser(_0xb0ff2c)[_0x1a2a('0x16')](function(_0x15b8c6){_0xb66d1f=_0x15b8c6;logger[_0x1a2a('0xd')]('The\x20User\x20ID\x20is:',_0xb66d1f['id']);return getEndUser(_0xb0ff2c,_0x13db07[_0x1a2a('0x6b')],_0x13db07[_0x1a2a('0x6c')]);})[_0x1a2a('0x16')](function(_0x266209){_0x4bb8ce=_0x266209;logger[_0x1a2a('0xd')](_0x1a2a('0x52'),_0x4bb8ce['id']);return getTicket(_0xb0ff2c,_0xb66d1f,_0x4bb8ce,_0x42dd4d,_0x13db07);})['then'](function(_0x568557){if(_0x568557){logger[_0x1a2a('0xd')]('The\x20Ticket\x20ID\x20is:',_0x568557['id']);}})['catch'](function(_0x3c3241){logger[_0x1a2a('0x5a')]('['+_0x13db07['lastevent'][_0x1a2a('0x6a')]()+']'+_0x1a2a('0x6d'),util[_0x1a2a('0x68')](_0x3c3241,{'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 c7f90ce..2f29e3f 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 _0xa8ff=['trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','none','[OUTBOUND]','com','destcalleridname','destcalleridnum','unmanaged','toUpperCase','calleridname','calleridnum','lastevent','lodash','moment','bluebird','zoho','redis','localhost','socket.io-emitter','debug','stringify','length','string','picklist','type','idField','content','toString','variableName','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientSecret','add','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','ActiveUsers','users','isArrayLikeObject','findIndex','email','Using\x20the\x20admin\x20account!','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','error','then','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','details','Error:\x20','log','CREATE\x20ERROR','Zoho-oauthtoken\x20','moduleSearch','contact_lead','uri','contact','Contacts','nothing','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','Owner','administrator','Subject','Subjects','Description','getString','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','utc','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','called','Call_Result','connect','Answered','Rejected','abandoned','Abandoned','agentcalledAt','merge','SUCCESS','err','queue','stripTrailingSlash','host','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','The\x20User\x20ID\x20is:','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s'];(function(_0x47e70a,_0x1c3714){var _0x3a9900=function(_0x19ec6a){while(--_0x19ec6a){_0x47e70a['push'](_0x47e70a['shift']());}};_0x3a9900(++_0x1c3714);}(_0xa8ff,0x1ab));var _0xfa8f=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xa8ff[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0xfa8f('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require('util');var intUtil=require('./util');var moment=require(_0xfa8f('0x1'));var Redis=require('ioredis');var BPromise=require(_0xfa8f('0x2'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xfa8f('0x3'));config[_0xfa8f('0x4')]=_['defaults'](config[_0xfa8f('0x4')],{'host':_0xfa8f('0x5'),'port':0x18eb});var io=require(_0xfa8f('0x6'))(new Redis(config[_0xfa8f('0x4')]));function emit(_0xb43311,_0x25dae3,_0x24e5f0){io['to'](_0xb43311)['emit'](_0x25dae3,_0x24e5f0);}function request(_0xf76e20){logger[_0xfa8f('0x7')]('[HTTP]',JSON[_0xfa8f('0x8')](_0xf76e20));return rp(_0xf76e20);}function getCustomFields(_0x407f0b,_0x526d43){var _0x31a17b={};if(_0x407f0b[_0xfa8f('0x9')]>0x0){_['forEach'](_0x407f0b,function(_0x1afae4){if(_['includes']([_0xfa8f('0xa'),_0xfa8f('0xb')],_0x1afae4[_0xfa8f('0xc')])&&_0x1afae4[_0xfa8f('0xd')]){_0x31a17b[_0x1afae4[_0xfa8f('0xd')]]=_0x1afae4[_0xfa8f('0xe')][_0xfa8f('0xf')]();}else if(_0x1afae4[_0xfa8f('0xc')]==='variable'&&_0x1afae4[_0xfa8f('0x10')]&&_0x1afae4[_0xfa8f('0xd')]&&_0x526d43[_0x1afae4[_0xfa8f('0x10')]]){_0x31a17b[_0x1afae4[_0xfa8f('0xd')]]=_0x526d43[_0x1afae4[_0xfa8f('0x10')]][_0xfa8f('0xf')]();}else if(_0x1afae4[_0xfa8f('0xc')]==='customVariable'&&_0x1afae4[_0xfa8f('0x11')]&&_0x1afae4[_0xfa8f('0x11')][_0xfa8f('0x12')]&&_0x1afae4['idField']&&_0x526d43[_0x1afae4[_0xfa8f('0x11')][_0xfa8f('0x12')][_0xfa8f('0x13')]()]){_0x31a17b[_0x1afae4[_0xfa8f('0xd')]]=_0x526d43[_0x1afae4['Variable'][_0xfa8f('0x12')][_0xfa8f('0x13')]()]['toString']();}});}return _0x31a17b;}function getName(_0x59e031){if(_0x59e031[_0xfa8f('0x14')]('\x20')>0x0){var _0x2dd7a4=_0x59e031[_0xfa8f('0x15')](/ (.+)/);if(_0x2dd7a4[0x1]){return _0x2dd7a4;}}return[_0x59e031,_0x59e031];}var accountsTokens={};function getAccessToken(_0xd13d4){return new Promise(function(_0x34b360,_0xe3abc8){if(!_[_0xfa8f('0x16')](accountsTokens[_0xd13d4['id']])&&!_['isNil'](accountsTokens[_0xd13d4['id']][_0xfa8f('0x17')])){if(moment()[_0xfa8f('0x18')](accountsTokens[_0xd13d4['id']]['expires_in'])){_0x34b360(accountsTokens[_0xd13d4['id']][_0xfa8f('0x17')]);}}var _0x1febe5;switch(_0xd13d4['zone']){case'US':_0x1febe5=_0xfa8f('0x19');break;case'AU':_0x1febe5=_0xfa8f('0x1a');break;case'EU':_0x1febe5='https://accounts.zoho.eu';break;case'IN':_0x1febe5=_0xfa8f('0x1b');break;case'CN':_0x1febe5=_0xfa8f('0x1c');break;default:_0x1febe5=_0xfa8f('0x1d');break;}var _0x581ebd={'method':_0xfa8f('0x1e'),'uri':_0x1febe5+_0xfa8f('0x1f'),'qs':{'refresh_token':_0xd13d4[_0xfa8f('0x20')],'client_id':_0xd13d4['clientId'],'client_secret':_0xd13d4[_0xfa8f('0x21')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x581ebd)['then'](function(_0x1fde2b){accountsTokens[_0xd13d4['id']]={'access_token':_0x1fde2b['access_token'],'expires_in':moment()[_0xfa8f('0x22')](_0x1fde2b['expires_in'],_0xfa8f('0x23'))};_0x34b360(_0x1fde2b['access_token']);})[_0xfa8f('0x24')](function(_0x3f5ea7){logger['error'](_0xfa8f('0x25'),_0x3f5ea7[_0xfa8f('0x26')]);_0xe3abc8(_0x3f5ea7);});});}function getUser(_0x16253f,_0x484027,_0x23718a,_0x3812c7){logger[_0xfa8f('0x27')](_0xfa8f('0x28'));return request({'method':_0xfa8f('0x29'),'uri':util[_0xfa8f('0x2a')]('https://www.zohoapis.%s/crm/v2/users',_0x484027),'qs':{'type':_0xfa8f('0x2b')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x16253f},'json':!![]})['then'](function(_0x2c60cc){if(_0x2c60cc[_0xfa8f('0x2c')]){var _0x5275d5=-0x1;if(_[_0xfa8f('0x2d')](_0x2c60cc['users'])){if(!_[_0xfa8f('0x16')](_0x3812c7)){_0x5275d5=_[_0xfa8f('0x2e')](_0x2c60cc['users'],function(_0x4357f4){return _0x4357f4[_0xfa8f('0x2f')]===_0x3812c7;});}if(_0x5275d5>=0x0){logger[_0xfa8f('0x27')]('Agent\x20found!');}else{logger[_0xfa8f('0x27')](_0xfa8f('0x30'));_0x5275d5=_[_0xfa8f('0x2e')](_0x2c60cc[_0xfa8f('0x2c')],function(_0xc54952){return _0xc54952[_0xfa8f('0x31')][_0xfa8f('0x12')]===_0xfa8f('0x32');});}return _0x2c60cc['users'][_0x5275d5];}else{if(_0x2c60cc['user'][_0xfa8f('0x31')][_0xfa8f('0x12')]===_0xfa8f('0x32')){logger[_0xfa8f('0x27')](_0xfa8f('0x30'));user=_0x2c60cc[_0xfa8f('0x33')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON['stringify'](_0x2c60cc));throw new Error(_0xfa8f('0x34')+JSON[_0xfa8f('0x8')](_0x2c60cc));}}}else{logger['error'](_0xfa8f('0x35'),JSON[_0xfa8f('0x8')](_0x2c60cc));throw new Error(_0xfa8f('0x34')+JSON[_0xfa8f('0x8')](_0x2c60cc));}})[_0xfa8f('0x24')](function(_0xbd2fb4){console[_0xfa8f('0x36')](_0xbd2fb4);});}function getZohoUser(_0x2d2a91,_0x12beb0){return new BPromise(function(_0x176d76,_0x4ad7d8){request(_0x2d2a91)[_0xfa8f('0x37')](function(_0x4bad90){var _0x3eb2a9=null;if(_0x4bad90){_0x3eb2a9=_0x4bad90[_0xfa8f('0x38')][0x0];_0x3eb2a9[_0xfa8f('0x39')]=_0x12beb0;}_0x176d76(_0x3eb2a9);})['catch'](function(_0x5e1d31){_0x4ad7d8(_0x5e1d31);});});}function createEndUser(_0x4c5dac,_0x39209f,_0x1557f3,_0x238c2a,_0x54a633,_0x3cf763){var _0x1557f3=getName(_0x1557f3);return request({'method':_0xfa8f('0x1e'),'uri':_0xfa8f('0x3a')+_0x39209f+_0xfa8f('0x3b')+_[_0xfa8f('0x3c')](_0x3cf763[_0xfa8f('0x3d')])+'s','body':{'data':[{'Last_Name':_0x1557f3[0x1],'First_Name':_0x1557f3[0x0],'Phone':_0x238c2a,'Owner':{'name':!_[_0xfa8f('0x16')](_0x54a633[_0xfa8f('0x3e')][_0xfa8f('0x12')])?_0x54a633[_0xfa8f('0x3e')][_0xfa8f('0x12')]:!_[_0xfa8f('0x16')](_0x54a633[_0xfa8f('0x3f')])?_0x54a633[_0xfa8f('0x3f')]+'\x20'+_0x54a633['last_name']:_0x54a633[_0xfa8f('0x40')],'id':_0x54a633['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4c5dac},'json':!![]})[_0xfa8f('0x37')](function(_0x3e12da){if(_0x3e12da&&_0x3e12da[_0xfa8f('0x38')][0x0][_0xfa8f('0x41')]==='SUCCESS'){var _0x40e1ac=_0x3e12da[_0xfa8f('0x38')][0x0][_0xfa8f('0x42')];_0x40e1ac['enduserType']=_['startCase'](_0x3cf763['moduleCreate'])+'s';return _0x40e1ac;}logger[_0xfa8f('0x36')](_0xfa8f('0x35'),JSON[_0xfa8f('0x8')](data));throw new Error(_0xfa8f('0x43')+JSON['stringify'](data));})[_0xfa8f('0x24')](function(_0x4552bd){console[_0xfa8f('0x44')](_0xfa8f('0x45'),_0x4552bd);});}function getEndUser(_0x5d8a75,_0x12d4f4,_0x3d14dd,_0x5797b6,_0x3ac522,_0x37fda8,_0x2d8b1c){var _0x20f755={'method':_0xfa8f('0x29'),'uri':'','headers':{'Authorization':_0xfa8f('0x46')+_0x5d8a75},'json':!![]};switch(_0x2d8b1c[_0xfa8f('0x47')]){case _0xfa8f('0x48'):_0x20f755[_0xfa8f('0x49')]=_0xfa8f('0x3a')+_0x12d4f4+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3ac522+'))';return getZohoUser(_0x20f755,'Contacts')[_0xfa8f('0x37')](function(_0x3e1c0d){if(_0x3e1c0d)return _0x3e1c0d;_0x20f755[_0xfa8f('0x49')]=_0xfa8f('0x3a')+_0x12d4f4+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x3ac522+'))';return getZohoUser(_0x20f755,'Leads')[_0xfa8f('0x37')](function(_0x491f04){if(_0x491f04)return _0x491f04;if(_0x2d8b1c[_0xfa8f('0x3d')]!='nothing'){return createEndUser(_0x5d8a75,_0x12d4f4,_0x5797b6,_0x3ac522,_0x37fda8,_0x2d8b1c);}else{return{};}});});break;case _0xfa8f('0x4a'):_0x20f755[_0xfa8f('0x49')]='https://www.zohoapis.'+_0x12d4f4+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3ac522+'))';return getZohoUser(_0x20f755,_0xfa8f('0x4b'))[_0xfa8f('0x37')](function(_0x43b8ba){if(_0x43b8ba)return _0x43b8ba;if(_0x2d8b1c['moduleCreate']!=_0xfa8f('0x4c')){return createEndUser(_0x5d8a75,_0x12d4f4,_0x5797b6,_0x3ac522,_0x37fda8,_0x2d8b1c);}else{return{};}});break;case _0xfa8f('0x4d'):_0x20f755[_0xfa8f('0x49')]=_0xfa8f('0x3a')+_0x12d4f4+_0xfa8f('0x4e')+_0x3ac522+'))';return getZohoUser(_0x20f755,_0xfa8f('0x4f'))[_0xfa8f('0x37')](function(_0x4a6e6b){if(_0x4a6e6b)return _0x4a6e6b;if(_0x2d8b1c[_0xfa8f('0x3d')]!=_0xfa8f('0x4c')){return createEndUser(_0x5d8a75,_0x12d4f4,_0x5797b6,_0x3ac522,_0x37fda8,_0x2d8b1c);}else{return{};}});break;}}function getCall(_0x36b145,_0x3e60e9,_0x1b3541,_0x31cfb8,_0x253cae,_0x31af9f,_0x2339e0,_0x1a3a64){logger[_0xfa8f('0x27')]('Creating\x20new\x20call...');var _0x357d23={};_0x357d23[_0xfa8f('0x50')]={'name':!_[_0xfa8f('0x16')](_0x31cfb8['role']['name'])&&!_[_0xfa8f('0x16')](_0x31cfb8['profile']['name'])&&_0x31cfb8['profile'][_0xfa8f('0x12')]===_0xfa8f('0x51')?_0x31cfb8[_0xfa8f('0x3e')][_0xfa8f('0x12')]:!_[_0xfa8f('0x16')](_0x31cfb8[_0xfa8f('0x3f')])?_0x31cfb8['first_name']+'\x20'+_0x31cfb8[_0xfa8f('0x40')]:_0x31cfb8[_0xfa8f('0x40')],'id':_0x31cfb8['id']};_0x357d23[_0xfa8f('0x52')]=intUtil['getString'](_0x31af9f[_0xfa8f('0x53')],_0x2339e0,'\x20');_0x357d23[_0xfa8f('0x54')]=intUtil[_0xfa8f('0x55')](_0x31af9f['Descriptions'],_0x2339e0,'\x0a');if(_0x253cae[_0xfa8f('0x39')]===_0xfa8f('0x4b')){_0x357d23[_0xfa8f('0x56')]={'name':!_[_0xfa8f('0x16')](_0x253cae['Full_Name'])?_0x253cae[_0xfa8f('0x57')]:!_[_0xfa8f('0x16')](_0x253cae[_0xfa8f('0x58')])?_0x253cae[_0xfa8f('0x58')]+'\x20'+_0x253cae[_0xfa8f('0x59')]:_0x253cae[_0xfa8f('0x59')],'id':_0x253cae['id']};}if(_0x253cae[_0xfa8f('0x39')]==='Leads'){_0x357d23['What_Id']={'name':!_[_0xfa8f('0x16')](_0x253cae[_0xfa8f('0x57')])?_0x253cae['Full_Name']:!_[_0xfa8f('0x16')](_0x253cae[_0xfa8f('0x58')])?_0x253cae[_0xfa8f('0x58')]+'\x20'+_0x253cae[_0xfa8f('0x59')]:_0x253cae[_0xfa8f('0x59')],'id':_0x253cae['id']};_0x357d23[_0xfa8f('0x5a')]=_[_0xfa8f('0x3c')](_0x253cae[_0xfa8f('0x39')]);}if(_0x2339e0[_0xfa8f('0x5b')]){_0x357d23['Call_Duration']=moment[_0xfa8f('0x5c')](parseInt(_0x2339e0[_0xfa8f('0x5b')])*0x3e8)[_0xfa8f('0x2a')]('mm:ss');}else if(_0x2339e0['answertime']&&_0x2339e0['endtime']){_0x357d23[_0xfa8f('0x5d')]=moment[_0xfa8f('0x5c')](moment(_0x2339e0['endtime'],_0xfa8f('0x5e'))[_0xfa8f('0x5f')](moment(_0x2339e0[_0xfa8f('0x60')],_0xfa8f('0x5e'))))[_0xfa8f('0x2a')](_0xfa8f('0x61'));}switch(_0x2339e0['lastevent']){case _0xfa8f('0x62'):_0x357d23[_0xfa8f('0x63')]='Called';break;case'complete':case _0xfa8f('0x64'):_0x357d23[_0xfa8f('0x63')]=_0xfa8f('0x65');break;case'rejected':_0x357d23[_0xfa8f('0x63')]=_0xfa8f('0x66');break;case _0xfa8f('0x67'):_0x357d23[_0xfa8f('0x63')]=_0xfa8f('0x68');break;case'timeout':_0x357d23[_0xfa8f('0x63')]='Timeout';default:}_0x357d23['Call_Start_Time']=(_0x1a3a64==='outbound'?moment(_0x2339e0[_0xfa8f('0x60')])[_0xfa8f('0x2a')](_0xfa8f('0x5e')):moment(_0x2339e0[_0xfa8f('0x69')])[_0xfa8f('0x2a')](_0xfa8f('0x5e')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x357d23['Call_Type']=_0x1a3a64||'Inbound';_0x357d23=_[_0xfa8f('0x6a')](_0x357d23,getCustomFields(_0x31af9f['Fields'],_0x2339e0));return request({'method':_0xfa8f('0x1e'),'uri':_0xfa8f('0x3a')+_0x3e60e9+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x36b145},'body':{'data':[_0x357d23]},'json':!![]})[_0xfa8f('0x37')](function(_0x276376){if(_0x276376&&_0x276376['data'][0x0][_0xfa8f('0x41')]===_0xfa8f('0x6b')){logger[_0xfa8f('0x27')]('Call\x20created!');return{'id':_0x276376[_0xfa8f('0x38')][0x0]['details']['id']};}})['catch'](function(_0x498420){logger[_0xfa8f('0x27')]('err',_0x498420[_0xfa8f('0x26')]);console[_0xfa8f('0x44')](_0xfa8f('0x6c'),_0x498420);});}exports[_0xfa8f('0x6d')]=function(_0x2c2966,_0x2dbc2b,_0xccfe6b,_0x4a0801,_0x1876c8,_0x72920){var _0x5c5344,_0xd4c26c,_0x190ae1;_0x72920['host']=intUtil[_0xfa8f('0x6e')](_0x72920[_0xfa8f('0x6f')]);_0x72920[_0xfa8f('0x70')]=intUtil['stripTrailingSlash'](_0x72920[_0xfa8f('0x70')]);if(_0x1876c8&&_0x1876c8[_0xfa8f('0x71')]){logger[_0xfa8f('0x27')](_0xfa8f('0x72'),_0xfa8f('0x73'));_0x2dbc2b[_0xfa8f('0x74')]=_0x72920[_0xfa8f('0x70')]+_0xfa8f('0x75')+_0x2dbc2b[_0xfa8f('0x76')]+_0xfa8f('0x77')+md5(_0x2dbc2b['uniqueid']);}else{_0x2dbc2b[_0xfa8f('0x74')]='';}var _0x5e105b=_0x72920[_0xfa8f('0x6f')]===_0xfa8f('0x78')?'eu':'com';return getAccessToken(_0x72920)[_0xfa8f('0x37')](function(_0x2a722c){_0x190ae1=_0x2a722c;return getUser(_0x190ae1,_0x5e105b,_0x72920,_0x4a0801[_0xfa8f('0x2f')]);})[_0xfa8f('0x37')](function(_0x3ddbbc){_0x5c5344=_0x3ddbbc;logger[_0xfa8f('0x27')](_0xfa8f('0x79'),_0x5c5344['id']);return getEndUser(_0x190ae1,_0x5e105b,_0x72920,_0x2dbc2b['calleridname'],_0x2dbc2b['calleridnum'],_0x5c5344,_0xccfe6b);})['then'](function(_0x142ac3){_0xd4c26c=_0x142ac3;return getCall(_0x190ae1,_0x5e105b,_0x72920,_0x5c5344,_0xd4c26c,_0xccfe6b,_0x2dbc2b,'Inbound');})['then'](function(_0x197729){if(_0x197729){logger[_0xfa8f('0x27')](_0xfa8f('0x7a'),_0x197729['id']);logger[_0xfa8f('0x27')](_0xfa8f('0x72'),_0xfa8f('0x7b'));emit(util[_0xfa8f('0x2a')](_0xfa8f('0x7c'),_0x4a0801[_0xfa8f('0x12')]),_0xfa8f('0x7d'),{'uri':_0xfa8f('0x7e')+_0x72920[_0xfa8f('0x6f')]+_0xfa8f('0x7f')+_0x197729['id']});}})[_0xfa8f('0x24')](function(_0x190399){logger['error']('[QUEUE]',JSON[_0xfa8f('0x8')](_0x190399));});};exports['outbound']=function(_0x4efe9c,_0x5af75f,_0x48f2a3,_0x1290c2,_0x16fbc4,_0x1a05b5,_0x512f9d){var _0x489b6a,_0x3998c5,_0x4d9491;_0x1a05b5['host']=intUtil[_0xfa8f('0x6e')](_0x1a05b5['host']);_0x1a05b5[_0xfa8f('0x70')]=intUtil[_0xfa8f('0x6e')](_0x1a05b5[_0xfa8f('0x70')]);if(_0x512f9d&&_0x512f9d['recordingFormat']&&_0x512f9d['recordingFormat']!==_0xfa8f('0x80')){logger['info'](_0xfa8f('0x81'),_0xfa8f('0x73'));_0x5af75f[_0xfa8f('0x74')]=_0x1a05b5[_0xfa8f('0x70')]+_0xfa8f('0x75')+_0x5af75f[_0xfa8f('0x76')]+_0xfa8f('0x77')+md5(_0x5af75f['uniqueid']);}var _0x4dd2dd=_0x1a05b5[_0xfa8f('0x6f')]===_0xfa8f('0x78')?'eu':_0xfa8f('0x82');return getAccessToken(_0x1a05b5)['then'](function(_0x38699b){_0x4d9491=_0x38699b;return getUser(_0x4d9491,_0x4dd2dd,_0x1a05b5,_0x1290c2['email']);})[_0xfa8f('0x37')](function(_0x227619){_0x489b6a=_0x227619;logger[_0xfa8f('0x27')](_0xfa8f('0x79'),_0x489b6a['id']);return getEndUser(_0x4d9491,_0x4dd2dd,_0x1a05b5,_0x5af75f[_0xfa8f('0x83')],_0x5af75f[_0xfa8f('0x84')],_0x489b6a,_0x48f2a3);})[_0xfa8f('0x37')](function(_0x43bd43){_0x3998c5=_0x43bd43;return getCall(_0x4d9491,_0x4dd2dd,_0x1a05b5,_0x489b6a,_0x3998c5,_0x48f2a3,_0x5af75f,'Outbound');})[_0xfa8f('0x37')](function(_0x2c1b5c){if(_0x2c1b5c){logger['info'](_0xfa8f('0x7a'),_0x2c1b5c['id']);logger[_0xfa8f('0x27')](_0xfa8f('0x81'),_0xfa8f('0x7b'));emit(util[_0xfa8f('0x2a')](_0xfa8f('0x7c'),_0x1290c2[_0xfa8f('0x12')]),_0xfa8f('0x7d'),{'uri':_0xfa8f('0x7e')+_0x1a05b5[_0xfa8f('0x6f')]+_0xfa8f('0x7f')+_0x2c1b5c['id']});}})[_0xfa8f('0x24')](function(_0x25715f){logger[_0xfa8f('0x36')](_0xfa8f('0x81'),JSON[_0xfa8f('0x8')](_0x25715f));});};exports[_0xfa8f('0x85')]=function(_0xc02149,_0x2d114a,_0xab6a9d,_0x1da82a,_0x27ef07,_0x343ee9){var _0x3b1ea8,_0x52279c,_0x55d6e9;_0x343ee9['host']=intUtil[_0xfa8f('0x6e')](_0x343ee9[_0xfa8f('0x6f')]);_0x343ee9[_0xfa8f('0x70')]=intUtil['stripTrailingSlash'](_0x343ee9[_0xfa8f('0x70')]);if(_0x27ef07&&_0x27ef07[_0xfa8f('0x71')]){logger['info']('['+_0x2d114a['lastevent'][_0xfa8f('0x86')]()+']',_0xfa8f('0x73'));_0x2d114a[_0xfa8f('0x74')]=_0x343ee9[_0xfa8f('0x70')]+'/api/voice/recordings/'+_0x2d114a[_0xfa8f('0x76')]+'/downloads?type=uniqueid&token='+md5(_0x2d114a[_0xfa8f('0x76')]);}else{_0x2d114a['recordingURL']='';}var _0x195bd7=_0x343ee9['host']===_0xfa8f('0x78')?'eu':_0xfa8f('0x82');return getAccessToken(_0x343ee9)[_0xfa8f('0x37')](function(_0x550532){_0x55d6e9=_0x550532;return getUser(_0x55d6e9,_0x195bd7,_0x343ee9);})[_0xfa8f('0x37')](function(_0x1aeef2){_0x3b1ea8=_0x1aeef2;logger[_0xfa8f('0x27')]('The\x20User\x20ID\x20is:',_0x3b1ea8['id']);return getEndUser(_0x55d6e9,_0x195bd7,_0x343ee9,_0x2d114a[_0xfa8f('0x87')],_0x2d114a[_0xfa8f('0x88')],_0x3b1ea8,_0xab6a9d);})['then'](function(_0x112ffc){_0x52279c=_0x112ffc;return getCall(_0x55d6e9,_0x195bd7,_0x343ee9,_0x3b1ea8,_0x52279c,_0xab6a9d,_0x2d114a,'Inbound');})[_0xfa8f('0x37')](function(_0x1ca679){if(_0x1ca679){logger[_0xfa8f('0x27')](_0xfa8f('0x7a'),_0x1ca679['id']);}})[_0xfa8f('0x24')](function(_0x11186d){logger[_0xfa8f('0x36')]('['+_0x2d114a[_0xfa8f('0x89')][_0xfa8f('0x86')]()+']',JSON['stringify'](_0x11186d));});}; \ No newline at end of file +var _0x3487=['getString','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','talktime','mm:ss','endtime','utc','diff','YYYY-MM-DDTHH:mm:ss','lastevent','Call_Result','Called','complete','Answered','rejected','abandoned','Abandoned','Timeout','outbound','starttime','Call_Type','merge','Fields','/crm/v2/Calls','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','com','calleridnum','The\x20Call\x20ID\x20is:','trigger:browser:url','https://crm.','recordingFormat','none','[OUTBOUND]','uniqueid','zoho.eu','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','/crm/EntityInfo.do?module=Calls&id=','unmanaged','toUpperCase','calleridname','Inbound','lodash','request-promise','md5','./util','moment','bluebird','../../../../config/environment','zoho','redis','defaults','socket.io-emitter','[HTTP]','stringify','length','forEach','includes','string','type','idField','content','toString','variable','variableName','Variable','name','toLowerCase','isNil','access_token','isBefore','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','then','add','expires_in','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','findIndex','email','info','Agent\x20found!','users','Administrator','user','profile','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','last_name','code','SUCCESS','details','Error:\x20','CREATE\x20ERROR','moduleSearch','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','Creating\x20new\x20call...','Owner','administrator','first_name','Subject'];(function(_0x5f48bc,_0xb157dd){var _0x12ca6a=function(_0x2d287b){while(--_0x2d287b){_0x5f48bc['push'](_0x5f48bc['shift']());}};_0x12ca6a(++_0xb157dd);}(_0x3487,0xd8));var _0x7348=function(_0x15ec4e,_0x40b7e0){_0x15ec4e=_0x15ec4e-0x0;var _0xb5e5dd=_0x3487[_0x15ec4e];return _0xb5e5dd;};'use strict';var _=require(_0x7348('0x0'));var rp=require(_0x7348('0x1'));var md5=require(_0x7348('0x2'));var util=require('util');var intUtil=require(_0x7348('0x3'));var moment=require(_0x7348('0x4'));var Redis=require('ioredis');var BPromise=require(_0x7348('0x5'));var config=require(_0x7348('0x6'));var logger=require('../../../../config/logger')(_0x7348('0x7'));config[_0x7348('0x8')]=_[_0x7348('0x9')](config[_0x7348('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x7348('0xa'))(new Redis(config['redis']));function emit(_0x4ddafb,_0x40e2d1,_0x21a0b6){io['to'](_0x4ddafb)['emit'](_0x40e2d1,_0x21a0b6);}function request(_0x5d1819){logger['debug'](_0x7348('0xb'),JSON[_0x7348('0xc')](_0x5d1819));return rp(_0x5d1819);}function getCustomFields(_0x313788,_0x3904b7){var _0x5cda08={};if(_0x313788[_0x7348('0xd')]>0x0){_[_0x7348('0xe')](_0x313788,function(_0x332de1){if(_[_0x7348('0xf')]([_0x7348('0x10'),'picklist'],_0x332de1[_0x7348('0x11')])&&_0x332de1[_0x7348('0x12')]){_0x5cda08[_0x332de1['idField']]=_0x332de1[_0x7348('0x13')][_0x7348('0x14')]();}else if(_0x332de1['type']===_0x7348('0x15')&&_0x332de1[_0x7348('0x16')]&&_0x332de1[_0x7348('0x12')]&&_0x3904b7[_0x332de1[_0x7348('0x16')]]){_0x5cda08[_0x332de1[_0x7348('0x12')]]=_0x3904b7[_0x332de1['variableName']][_0x7348('0x14')]();}else if(_0x332de1[_0x7348('0x11')]==='customVariable'&&_0x332de1[_0x7348('0x17')]&&_0x332de1[_0x7348('0x17')][_0x7348('0x18')]&&_0x332de1['idField']&&_0x3904b7[_0x332de1[_0x7348('0x17')][_0x7348('0x18')][_0x7348('0x19')]()]){_0x5cda08[_0x332de1[_0x7348('0x12')]]=_0x3904b7[_0x332de1[_0x7348('0x17')][_0x7348('0x18')][_0x7348('0x19')]()][_0x7348('0x14')]();}});}return _0x5cda08;}function getName(_0x259614){if(_0x259614['indexOf']('\x20')>0x0){var _0x595fcc=_0x259614['split'](/ (.+)/);if(_0x595fcc[0x1]){return _0x595fcc;}}return[_0x259614,_0x259614];}var accountsTokens={};function getAccessToken(_0x415178){return new Promise(function(_0x1b3df0,_0x51b248){if(!_[_0x7348('0x1a')](accountsTokens[_0x415178['id']])&&!_[_0x7348('0x1a')](accountsTokens[_0x415178['id']][_0x7348('0x1b')])){if(moment()[_0x7348('0x1c')](accountsTokens[_0x415178['id']]['expires_in'])){_0x1b3df0(accountsTokens[_0x415178['id']][_0x7348('0x1b')]);}}var _0x360c76;switch(_0x415178['zone']){case'US':_0x360c76=_0x7348('0x1d');break;case'AU':_0x360c76=_0x7348('0x1e');break;case'EU':_0x360c76='https://accounts.zoho.eu';break;case'IN':_0x360c76='https://accounts.zoho.in';break;case'CN':_0x360c76=_0x7348('0x1f');break;default:_0x360c76=_0x7348('0x20');break;}var _0x12e6cf={'method':_0x7348('0x21'),'uri':_0x360c76+_0x7348('0x22'),'qs':{'refresh_token':_0x415178[_0x7348('0x23')],'client_id':_0x415178[_0x7348('0x24')],'client_secret':_0x415178['clientSecret'],'grant_type':_0x7348('0x25')},'json':!![]};return rp(_0x12e6cf)[_0x7348('0x26')](function(_0x11213b){accountsTokens[_0x415178['id']]={'access_token':_0x11213b[_0x7348('0x1b')],'expires_in':moment()[_0x7348('0x27')](_0x11213b[_0x7348('0x28')],'seconds')};_0x1b3df0(_0x11213b[_0x7348('0x1b')]);})[_0x7348('0x29')](function(_0x553b51){logger[_0x7348('0x2a')](_0x7348('0x2b'),_0x553b51[_0x7348('0x2c')]);_0x51b248(_0x553b51);});});}function getUser(_0xb8a378,_0x33f614,_0x28352c,_0xd00b44){logger['info'](_0x7348('0x2d'));return request({'method':_0x7348('0x2e'),'uri':util[_0x7348('0x2f')](_0x7348('0x30'),_0x33f614),'qs':{'type':_0x7348('0x31')},'headers':{'Authorization':_0x7348('0x32')+_0xb8a378},'json':!![]})[_0x7348('0x26')](function(_0x37f01e){if(_0x37f01e['users']){var _0x25bc54=-0x1;if(_[_0x7348('0x33')](_0x37f01e['users'])){if(!_['isNil'](_0xd00b44)){_0x25bc54=_[_0x7348('0x34')](_0x37f01e['users'],function(_0x498649){return _0x498649[_0x7348('0x35')]===_0xd00b44;});}if(_0x25bc54>=0x0){logger[_0x7348('0x36')](_0x7348('0x37'));}else{logger[_0x7348('0x36')]('Using\x20the\x20admin\x20account!');_0x25bc54=_[_0x7348('0x34')](_0x37f01e[_0x7348('0x38')],function(_0x41ed87){return _0x41ed87['profile'][_0x7348('0x18')]===_0x7348('0x39');});}return _0x37f01e[_0x7348('0x38')][_0x25bc54];}else{if(_0x37f01e[_0x7348('0x3a')][_0x7348('0x3b')][_0x7348('0x18')]===_0x7348('0x39')){logger[_0x7348('0x36')](_0x7348('0x3c'));user=_0x37f01e['user'];return user;}else{logger[_0x7348('0x2a')](_0x7348('0x3d'),JSON[_0x7348('0xc')](_0x37f01e));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x7348('0xc')](_0x37f01e));}}}else{logger[_0x7348('0x2a')](_0x7348('0x3d'),JSON[_0x7348('0xc')](_0x37f01e));throw new Error(_0x7348('0x3e')+JSON[_0x7348('0xc')](_0x37f01e));}})[_0x7348('0x29')](function(_0x3bcffb){console[_0x7348('0x2a')](_0x3bcffb);});}function getZohoUser(_0x16f2c7,_0xfe3675){return new BPromise(function(_0x45e538,_0x5ec487){request(_0x16f2c7)[_0x7348('0x26')](function(_0x202ff1){var _0x1ff962=null;if(_0x202ff1){_0x1ff962=_0x202ff1[_0x7348('0x3f')][0x0];_0x1ff962[_0x7348('0x40')]=_0xfe3675;}_0x45e538(_0x1ff962);})['catch'](function(_0x11304c){_0x5ec487(_0x11304c);});});}function createEndUser(_0x4d5f06,_0x19ab97,_0x371669,_0x1a0b95,_0x175992,_0x4b7539){var _0x371669=getName(_0x371669);return request({'method':_0x7348('0x21'),'uri':_0x7348('0x41')+_0x19ab97+_0x7348('0x42')+_[_0x7348('0x43')](_0x4b7539[_0x7348('0x44')])+'s','body':{'data':[{'Last_Name':_0x371669[0x1],'First_Name':_0x371669[0x0],'Phone':_0x1a0b95,'Owner':{'name':!_[_0x7348('0x1a')](_0x175992[_0x7348('0x45')][_0x7348('0x18')])?_0x175992[_0x7348('0x45')][_0x7348('0x18')]:!_[_0x7348('0x1a')](_0x175992['first_name'])?_0x175992['first_name']+'\x20'+_0x175992[_0x7348('0x46')]:_0x175992[_0x7348('0x46')],'id':_0x175992['id']}}]},'headers':{'Authorization':_0x7348('0x32')+_0x4d5f06},'json':!![]})['then'](function(_0x166ace){if(_0x166ace&&_0x166ace[_0x7348('0x3f')][0x0][_0x7348('0x47')]===_0x7348('0x48')){var _0x6b2cec=_0x166ace[_0x7348('0x3f')][0x0][_0x7348('0x49')];_0x6b2cec['enduserType']=_['startCase'](_0x4b7539['moduleCreate'])+'s';return _0x6b2cec;}logger[_0x7348('0x2a')](_0x7348('0x3d'),JSON[_0x7348('0xc')](data));throw new Error(_0x7348('0x4a')+JSON[_0x7348('0xc')](data));})[_0x7348('0x29')](function(_0x23c72d){console['log'](_0x7348('0x4b'),_0x23c72d);});}function getEndUser(_0x3a8ade,_0x324114,_0x1870e3,_0x691541,_0x3b5f5e,_0x14ca9f,_0x718800){var _0xd0a302={'method':_0x7348('0x2e'),'uri':'','headers':{'Authorization':_0x7348('0x32')+_0x3a8ade},'json':!![]};switch(_0x718800[_0x7348('0x4c')]){case'contact_lead':_0xd0a302[_0x7348('0x4d')]=_0x7348('0x41')+_0x324114+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3b5f5e+'))';return getZohoUser(_0xd0a302,_0x7348('0x4e'))[_0x7348('0x26')](function(_0x53563c){if(_0x53563c)return _0x53563c;_0xd0a302[_0x7348('0x4d')]=_0x7348('0x41')+_0x324114+_0x7348('0x4f')+_0x3b5f5e+'))';return getZohoUser(_0xd0a302,_0x7348('0x50'))['then'](function(_0xa26752){if(_0xa26752)return _0xa26752;if(_0x718800[_0x7348('0x44')]!=_0x7348('0x51')){return createEndUser(_0x3a8ade,_0x324114,_0x691541,_0x3b5f5e,_0x14ca9f,_0x718800);}else{return{};}});});break;case _0x7348('0x52'):_0xd0a302[_0x7348('0x4d')]=_0x7348('0x41')+_0x324114+_0x7348('0x53')+_0x3b5f5e+'))';return getZohoUser(_0xd0a302,_0x7348('0x4e'))['then'](function(_0x505e22){if(_0x505e22)return _0x505e22;if(_0x718800[_0x7348('0x44')]!='nothing'){return createEndUser(_0x3a8ade,_0x324114,_0x691541,_0x3b5f5e,_0x14ca9f,_0x718800);}else{return{};}});break;case _0x7348('0x54'):_0xd0a302[_0x7348('0x4d')]='https://www.zohoapis.'+_0x324114+_0x7348('0x4f')+_0x3b5f5e+'))';return getZohoUser(_0xd0a302,_0x7348('0x50'))[_0x7348('0x26')](function(_0x37c620){if(_0x37c620)return _0x37c620;if(_0x718800[_0x7348('0x44')]!=_0x7348('0x51')){return createEndUser(_0x3a8ade,_0x324114,_0x691541,_0x3b5f5e,_0x14ca9f,_0x718800);}else{return{};}});break;}}function getCall(_0x23b065,_0x196a6f,_0x1618a8,_0x46e6a0,_0x1e2ca7,_0x450331,_0x3fde09,_0x45a395){logger[_0x7348('0x36')](_0x7348('0x55'));var _0x24c899={};_0x24c899[_0x7348('0x56')]={'name':!_[_0x7348('0x1a')](_0x46e6a0['role']['name'])&&!_['isNil'](_0x46e6a0[_0x7348('0x3b')][_0x7348('0x18')])&&_0x46e6a0[_0x7348('0x3b')][_0x7348('0x18')]===_0x7348('0x57')?_0x46e6a0['role']['name']:!_['isNil'](_0x46e6a0[_0x7348('0x58')])?_0x46e6a0[_0x7348('0x58')]+'\x20'+_0x46e6a0[_0x7348('0x46')]:_0x46e6a0[_0x7348('0x46')],'id':_0x46e6a0['id']};_0x24c899[_0x7348('0x59')]=intUtil[_0x7348('0x5a')](_0x450331['Subjects'],_0x3fde09,'\x20');_0x24c899[_0x7348('0x5b')]=intUtil['getString'](_0x450331[_0x7348('0x5c')],_0x3fde09,'\x0a');if(_0x1e2ca7[_0x7348('0x40')]===_0x7348('0x4e')){_0x24c899['Who_Id']={'name':!_['isNil'](_0x1e2ca7[_0x7348('0x5d')])?_0x1e2ca7[_0x7348('0x5d')]:!_['isNil'](_0x1e2ca7[_0x7348('0x5e')])?_0x1e2ca7['First_Name']+'\x20'+_0x1e2ca7[_0x7348('0x5f')]:_0x1e2ca7['Last_Name'],'id':_0x1e2ca7['id']};}if(_0x1e2ca7[_0x7348('0x40')]===_0x7348('0x50')){_0x24c899[_0x7348('0x60')]={'name':!_[_0x7348('0x1a')](_0x1e2ca7[_0x7348('0x5d')])?_0x1e2ca7[_0x7348('0x5d')]:!_['isNil'](_0x1e2ca7['First_Name'])?_0x1e2ca7[_0x7348('0x5e')]+'\x20'+_0x1e2ca7['Last_Name']:_0x1e2ca7[_0x7348('0x5f')],'id':_0x1e2ca7['id']};_0x24c899[_0x7348('0x61')]=_[_0x7348('0x43')](_0x1e2ca7[_0x7348('0x40')]);}if(_0x3fde09['talktime']){_0x24c899[_0x7348('0x62')]=moment['utc'](parseInt(_0x3fde09[_0x7348('0x63')])*0x3e8)['format'](_0x7348('0x64'));}else if(_0x3fde09['answertime']&&_0x3fde09[_0x7348('0x65')]){_0x24c899[_0x7348('0x62')]=moment[_0x7348('0x66')](moment(_0x3fde09[_0x7348('0x65')],'YYYY-MM-DDTHH:mm:ss')[_0x7348('0x67')](moment(_0x3fde09['starttime'],_0x7348('0x68'))))[_0x7348('0x2f')](_0x7348('0x64'));}switch(_0x3fde09[_0x7348('0x69')]){case'called':_0x24c899[_0x7348('0x6a')]=_0x7348('0x6b');break;case _0x7348('0x6c'):case'connect':_0x24c899[_0x7348('0x6a')]=_0x7348('0x6d');break;case _0x7348('0x6e'):_0x24c899[_0x7348('0x6a')]='Rejected';break;case _0x7348('0x6f'):_0x24c899['Call_Result']=_0x7348('0x70');break;case'timeout':_0x24c899[_0x7348('0x6a')]=_0x7348('0x71');default:}_0x24c899['Call_Start_Time']=(_0x45a395===_0x7348('0x72')?moment(_0x3fde09[_0x7348('0x73')])[_0x7348('0x2f')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x3fde09['agentcalledAt'])[_0x7348('0x2f')](_0x7348('0x68')))||moment()[_0x7348('0x2f')](_0x7348('0x68'));_0x24c899[_0x7348('0x74')]=_0x45a395||'Inbound';_0x24c899=_[_0x7348('0x75')](_0x24c899,getCustomFields(_0x450331[_0x7348('0x76')],_0x3fde09));return request({'method':_0x7348('0x21'),'uri':_0x7348('0x41')+_0x196a6f+_0x7348('0x77'),'headers':{'Authorization':_0x7348('0x32')+_0x23b065},'body':{'data':[_0x24c899]},'json':!![]})[_0x7348('0x26')](function(_0x452f04){if(_0x452f04&&_0x452f04[_0x7348('0x3f')][0x0][_0x7348('0x47')]===_0x7348('0x48')){logger[_0x7348('0x36')]('Call\x20created!');return{'id':_0x452f04[_0x7348('0x3f')][0x0][_0x7348('0x49')]['id']};}})['catch'](function(_0xd10b14){logger['info'](_0x7348('0x78'),_0xd10b14['stack']);console[_0x7348('0x79')](_0x7348('0x78'),_0xd10b14);});}exports[_0x7348('0x7a')]=function(_0x21284f,_0x281ff7,_0x1551bc,_0x3ebc79,_0x1160dd,_0x41708d){var _0x411adb,_0x2e41a7,_0xc02298;_0x41708d[_0x7348('0x7b')]=intUtil[_0x7348('0x7c')](_0x41708d['host']);_0x41708d[_0x7348('0x7d')]=intUtil[_0x7348('0x7c')](_0x41708d[_0x7348('0x7d')]);if(_0x1160dd&&_0x1160dd[_0x7348('0x7e')]){logger['info'](_0x7348('0x7f'),_0x7348('0x80'));_0x281ff7[_0x7348('0x81')]=_0x41708d[_0x7348('0x7d')]+_0x7348('0x82')+_0x281ff7['uniqueid']+_0x7348('0x83')+md5(_0x281ff7['uniqueid']);}else{_0x281ff7[_0x7348('0x81')]='';}var _0x2b3ced=_0x41708d[_0x7348('0x7b')]==='zoho.eu'?'eu':_0x7348('0x84');return getAccessToken(_0x41708d)[_0x7348('0x26')](function(_0x432491){_0xc02298=_0x432491;return getUser(_0xc02298,_0x2b3ced,_0x41708d,_0x3ebc79[_0x7348('0x35')]);})[_0x7348('0x26')](function(_0x46e60a){_0x411adb=_0x46e60a;logger[_0x7348('0x36')]('The\x20User\x20ID\x20is:',_0x411adb['id']);return getEndUser(_0xc02298,_0x2b3ced,_0x41708d,_0x281ff7['calleridname'],_0x281ff7[_0x7348('0x85')],_0x411adb,_0x1551bc);})[_0x7348('0x26')](function(_0x3cc907){_0x2e41a7=_0x3cc907;return getCall(_0xc02298,_0x2b3ced,_0x41708d,_0x411adb,_0x2e41a7,_0x1551bc,_0x281ff7,'Inbound');})['then'](function(_0x7da680){if(_0x7da680){logger['info'](_0x7348('0x86'),_0x7da680['id']);logger[_0x7348('0x36')](_0x7348('0x7f'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7348('0x2f')]('user:%s',_0x3ebc79[_0x7348('0x18')]),_0x7348('0x87'),{'uri':_0x7348('0x88')+_0x41708d[_0x7348('0x7b')]+'/crm/EntityInfo.do?module=Calls&id='+_0x7da680['id']});}})[_0x7348('0x29')](function(_0x7e1371){logger[_0x7348('0x2a')](_0x7348('0x7f'),JSON[_0x7348('0xc')](_0x7e1371));});};exports[_0x7348('0x72')]=function(_0x3c2518,_0x371288,_0x19cd50,_0x2525f5,_0xd29def,_0x45d568,_0x2a4e12){var _0x4e9f1b,_0xf7aad9,_0x5a334a;_0x45d568['host']=intUtil[_0x7348('0x7c')](_0x45d568['host']);_0x45d568['serverUrl']=intUtil[_0x7348('0x7c')](_0x45d568[_0x7348('0x7d')]);if(_0x2a4e12&&_0x2a4e12[_0x7348('0x89')]&&_0x2a4e12[_0x7348('0x89')]!==_0x7348('0x8a')){logger['info'](_0x7348('0x8b'),_0x7348('0x80'));_0x371288['recordingURL']=_0x45d568[_0x7348('0x7d')]+'/api/voice/recordings/'+_0x371288[_0x7348('0x8c')]+_0x7348('0x83')+md5(_0x371288['uniqueid']);}var _0x10b4e7=_0x45d568[_0x7348('0x7b')]===_0x7348('0x8d')?'eu':'com';return getAccessToken(_0x45d568)['then'](function(_0x265eef){_0x5a334a=_0x265eef;return getUser(_0x5a334a,_0x10b4e7,_0x45d568,_0x2525f5[_0x7348('0x35')]);})[_0x7348('0x26')](function(_0x5dd598){_0x4e9f1b=_0x5dd598;logger['info'](_0x7348('0x8e'),_0x4e9f1b['id']);return getEndUser(_0x5a334a,_0x10b4e7,_0x45d568,_0x371288[_0x7348('0x8f')],_0x371288[_0x7348('0x90')],_0x4e9f1b,_0x19cd50);})[_0x7348('0x26')](function(_0x2e7d5b){_0xf7aad9=_0x2e7d5b;return getCall(_0x5a334a,_0x10b4e7,_0x45d568,_0x4e9f1b,_0xf7aad9,_0x19cd50,_0x371288,_0x7348('0x91'));})[_0x7348('0x26')](function(_0x3d3ca0){if(_0x3d3ca0){logger[_0x7348('0x36')]('The\x20Call\x20ID\x20is:',_0x3d3ca0['id']);logger[_0x7348('0x36')]('[OUTBOUND]',_0x7348('0x92'));emit(util[_0x7348('0x2f')](_0x7348('0x93'),_0x2525f5[_0x7348('0x18')]),_0x7348('0x87'),{'uri':_0x7348('0x88')+_0x45d568['host']+_0x7348('0x94')+_0x3d3ca0['id']});}})[_0x7348('0x29')](function(_0x2adb6f){logger[_0x7348('0x2a')](_0x7348('0x8b'),JSON[_0x7348('0xc')](_0x2adb6f));});};exports[_0x7348('0x95')]=function(_0x58d0c0,_0x55376f,_0x3e1f93,_0x1f1255,_0x518fbb,_0x274df2){var _0x1cced5,_0x1c2791,_0x1a368c;_0x274df2['host']=intUtil['stripTrailingSlash'](_0x274df2[_0x7348('0x7b')]);_0x274df2[_0x7348('0x7d')]=intUtil['stripTrailingSlash'](_0x274df2['serverUrl']);if(_0x518fbb&&_0x518fbb[_0x7348('0x7e')]){logger[_0x7348('0x36')]('['+_0x55376f[_0x7348('0x69')][_0x7348('0x96')]()+']',_0x7348('0x80'));_0x55376f[_0x7348('0x81')]=_0x274df2[_0x7348('0x7d')]+'/api/voice/recordings/'+_0x55376f[_0x7348('0x8c')]+_0x7348('0x83')+md5(_0x55376f[_0x7348('0x8c')]);}else{_0x55376f[_0x7348('0x81')]='';}var _0x438881=_0x274df2[_0x7348('0x7b')]===_0x7348('0x8d')?'eu':'com';return getAccessToken(_0x274df2)[_0x7348('0x26')](function(_0x2f7263){_0x1a368c=_0x2f7263;return getUser(_0x1a368c,_0x438881,_0x274df2);})[_0x7348('0x26')](function(_0x46a818){_0x1cced5=_0x46a818;logger['info'](_0x7348('0x8e'),_0x1cced5['id']);return getEndUser(_0x1a368c,_0x438881,_0x274df2,_0x55376f[_0x7348('0x97')],_0x55376f['calleridnum'],_0x1cced5,_0x3e1f93);})[_0x7348('0x26')](function(_0x40bc1e){_0x1c2791=_0x40bc1e;return getCall(_0x1a368c,_0x438881,_0x274df2,_0x1cced5,_0x1c2791,_0x3e1f93,_0x55376f,_0x7348('0x98'));})['then'](function(_0xb2a4d6){if(_0xb2a4d6){logger['info']('The\x20Call\x20ID\x20is:',_0xb2a4d6['id']);}})[_0x7348('0x29')](function(_0x4348e6){logger[_0x7348('0x2a')]('['+_0x55376f['lastevent']['toUpperCase']()+']',JSON[_0x7348('0xc')](_0x4348e6));});}; \ 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 ec1317d..6754c8b 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 _0x0732=['shelljs','mustache','../../../../config/logger','trigger','exec','data2','data3','error','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x0732,0x8f));var _0x2073=function(_0x261999,_0x15f7e8){_0x261999=_0x261999-0x0;var _0x109e04=_0x0732[_0x261999];return _0x109e04;};'use strict';var util=require('util');var sh=require(_0x2073('0x0'));var Mustache=require(_0x2073('0x1'));var logger=require(_0x2073('0x2'))(_0x2073('0x3'));exports[_0x2073('0x4')]=function(_0x681c0c,_0x3e62e8){var _0x3d1c4f=_0x681c0c[_0x2073('0x5')]?_0x681c0c[_0x2073('0x5')]:'Script';var _0x337087=_0x681c0c['data3']?Mustache['render'](_0x681c0c[_0x2073('0x6')],_0x3e62e8):_0x3e62e8;sh[_0x2073('0x4')](_0x337087,function(_0xdd0e4,_0x53ca69,_0x2b4d34){if(_0xdd0e4!==0x0){logger[_0x2073('0x7')](util['format']('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x3d1c4f,_0x337087,_0xdd0e4,_0x2b4d34));}else{logger[_0x2073('0x8')](util[_0x2073('0x9')](_0x2073('0xa'),_0x3d1c4f,_0x337087,_0x53ca69));}});}; \ No newline at end of file +var _0x671a=['info','../../../../config/logger','trigger','data2','Script','data3','render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x671a,0x118));var _0xa671=function(_0x3c78e7,_0x19a615){_0x3c78e7=_0x3c78e7-0x0;var _0x46c763=_0x671a[_0x3c78e7];return _0x46c763;};'use strict';var util=require('util');var sh=require('shelljs');var Mustache=require('mustache');var logger=require(_0xa671('0x0'))(_0xa671('0x1'));exports['exec']=function(_0x4bfa24,_0x755009){var _0x228135=_0x4bfa24[_0xa671('0x2')]?_0x4bfa24[_0xa671('0x2')]:_0xa671('0x3');var _0x2fab28=_0x4bfa24[_0xa671('0x4')]?Mustache[_0xa671('0x5')](_0x4bfa24[_0xa671('0x4')],_0x755009):_0x755009;sh['exec'](_0x2fab28,function(_0x21ae3a,_0xf84045,_0x196861){if(_0x21ae3a!==0x0){logger[_0xa671('0x6')](util['format'](_0xa671('0x7'),_0x228135,_0x2fab28,_0x21ae3a,_0x196861));}else{logger[_0xa671('0x8')](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x228135,_0x2fab28,_0xf84045));}});}; \ 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 4a4c238..fe8a429 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 _0x101e=['data5','headers','data6','parse','error','POST','PUT','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','message','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2'];(function(_0x44b7d6,_0x4a3f3f){var _0x5346f0=function(_0x35ac17){while(--_0x35ac17){_0x44b7d6['push'](_0x44b7d6['shift']());}};_0x5346f0(++_0x4a3f3f);}(_0x101e,0x140));var _0xe101=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x101e[_0x4cf98e];return _0x1623ac;};'use strict';var rp=require('request-promise');var util=require(_0xe101('0x0'));var _=require(_0xe101('0x1'));var Mustache=require(_0xe101('0x2'));var logger=require(_0xe101('0x3'))(_0xe101('0x4'));exports[_0xe101('0x5')]=function(_0x51b351,_0x53c6d9){var _0x6d732e,_0xaa0ebc;var _0x2607c5={'method':_0x51b351[_0xe101('0x6')][_0xe101('0x7')](),'uri':Mustache[_0xe101('0x8')](_0x51b351[_0xe101('0x9')],_0x53c6d9),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x51b351[_0xe101('0xa')])==='number'&&parseInt(_0x51b351[_0xe101('0xa')])>=0x1&&parseInt(_0x51b351[_0xe101('0xa')])<=0xa?parseInt(_0x51b351[_0xe101('0xa')])*0x3e8:0x5*0x3e8};try{_0x2607c5[_0xe101('0xb')]=_0x51b351[_0xe101('0xc')]?JSON[_0xe101('0xd')](Mustache[_0xe101('0x8')](_0x51b351[_0xe101('0xc')],_0x53c6d9)):{};}catch(_0x3d488a){logger[_0xe101('0xe')](_0x3d488a['stack']);}switch(_0x51b351[_0xe101('0x6')][_0xe101('0x7')]()){case'GET':case'DELETE':_0x6d732e=null;_0x2607c5['qs']=_0x53c6d9;break;case _0xe101('0xf'):case _0xe101('0x10'):if(_0x51b351['data7']){try{_0x6d732e=JSON[_0xe101('0xd')](Mustache[_0xe101('0x8')](_0x51b351['data7'],_0x53c6d9));_0x2607c5[_0xe101('0x11')]=_0x6d732e;}catch(_0x1bf5f9){logger[_0xe101('0xe')](_0x1bf5f9[_0xe101('0x12')]);logger['error'](_0xe101('0x13'));}}else{_0x6d732e=_0x53c6d9;_0x2607c5['body']=_0x6d732e;}break;}logger[_0xe101('0x14')](util[_0xe101('0x15')](_0xe101('0x16'),_0x51b351[_0xe101('0x6')],_0x51b351['data2'],JSON[_0xe101('0x17')](_0x2607c5)));rp(_0x2607c5)[_0xe101('0x18')](function(_0x8b65e6){_0x6d732e=!_[_0xe101('0x19')](_0x6d732e)?',\x20request\x20body:\x20'+_0x6d732e:'';_0xaa0ebc=typeof _0x8b65e6[_0xe101('0x11')]==='object'?JSON[_0xe101('0x17')](_0x8b65e6[_0xe101('0x11')]):_0x8b65e6[_0xe101('0x11')];logger[_0xe101('0x14')](util[_0xe101('0x15')](_0xe101('0x1a'),_0x51b351[_0xe101('0x6')],_0x51b351[_0xe101('0x9')],_0x8b65e6[_0xe101('0x1b')],_0xaa0ebc));})[_0xe101('0x1c')](function(_0x3c9c53){logger['error'](util[_0xe101('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x51b351['data1'],_0x51b351['data2'],_0x3c9c53[_0xe101('0x1b')],_0x3c9c53['name'],_0x3c9c53[_0xe101('0x1d')]));});}; \ No newline at end of file +var _0xb2b8=['mustache','../../../../config/logger','trigger','data1','toUpperCase','render','number','data5','headers','data6','error','stack','POST','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','then','isNil',',\x20request\x20body:\x20','object','stringify','%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'];(function(_0x5890b1,_0x5bbf0e){var _0xe77d95=function(_0x3e01f0){while(--_0x3e01f0){_0x5890b1['push'](_0x5890b1['shift']());}};_0xe77d95(++_0x5bbf0e);}(_0xb2b8,0x11f));var _0x8b2b=function(_0x260a19,_0x1c5a82){_0x260a19=_0x260a19-0x0;var _0x55ab6f=_0xb2b8[_0x260a19];return _0x55ab6f;};'use strict';var rp=require(_0x8b2b('0x0'));var util=require('util');var _=require('lodash');var Mustache=require(_0x8b2b('0x1'));var logger=require(_0x8b2b('0x2'))(_0x8b2b('0x3'));exports['exec']=function(_0x4bc18e,_0x22bf4b){var _0x1c52d9,_0x59e827;var _0x50b780={'method':_0x4bc18e[_0x8b2b('0x4')][_0x8b2b('0x5')](),'uri':Mustache[_0x8b2b('0x6')](_0x4bc18e['data2'],_0x22bf4b),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4bc18e['data5'])===_0x8b2b('0x7')&&parseInt(_0x4bc18e[_0x8b2b('0x8')])>=0x1&&parseInt(_0x4bc18e[_0x8b2b('0x8')])<=0xa?parseInt(_0x4bc18e['data5'])*0x3e8:0x5*0x3e8};try{_0x50b780[_0x8b2b('0x9')]=_0x4bc18e[_0x8b2b('0xa')]?JSON['parse'](Mustache[_0x8b2b('0x6')](_0x4bc18e[_0x8b2b('0xa')],_0x22bf4b)):{};}catch(_0x40da22){logger[_0x8b2b('0xb')](_0x40da22[_0x8b2b('0xc')]);}switch(_0x4bc18e[_0x8b2b('0x4')][_0x8b2b('0x5')]()){case'GET':case'DELETE':_0x1c52d9=null;_0x50b780['qs']=_0x22bf4b;break;case _0x8b2b('0xd'):case'PUT':if(_0x4bc18e['data7']){try{_0x1c52d9=JSON['parse'](Mustache[_0x8b2b('0x6')](_0x4bc18e[_0x8b2b('0xe')],_0x22bf4b));_0x50b780[_0x8b2b('0xf')]=_0x1c52d9;}catch(_0x10aeda){logger['error'](_0x10aeda[_0x8b2b('0xc')]);logger['error'](_0x8b2b('0x10'));}}else{_0x1c52d9=_0x22bf4b;_0x50b780[_0x8b2b('0xf')]=_0x1c52d9;}break;}logger[_0x8b2b('0x11')](util[_0x8b2b('0x12')](_0x8b2b('0x13'),_0x4bc18e[_0x8b2b('0x4')],_0x4bc18e[_0x8b2b('0x14')],JSON['stringify'](_0x50b780)));rp(_0x50b780)[_0x8b2b('0x15')](function(_0x7e18ed){_0x1c52d9=!_[_0x8b2b('0x16')](_0x1c52d9)?_0x8b2b('0x17')+_0x1c52d9:'';_0x59e827=typeof _0x7e18ed['body']===_0x8b2b('0x18')?JSON[_0x8b2b('0x19')](_0x7e18ed[_0x8b2b('0xf')]):_0x7e18ed[_0x8b2b('0xf')];logger[_0x8b2b('0x11')](util[_0x8b2b('0x12')](_0x8b2b('0x1a'),_0x4bc18e[_0x8b2b('0x4')],_0x4bc18e['data2'],_0x7e18ed[_0x8b2b('0x1b')],_0x59e827));})[_0x8b2b('0x1c')](function(_0x33bcda){logger[_0x8b2b('0xb')](util['format'](_0x8b2b('0x1d'),_0x4bc18e[_0x8b2b('0x4')],_0x4bc18e[_0x8b2b('0x14')],_0x33bcda['statusCode'],_0x33bcda[_0x8b2b('0x1e')],_0x33bcda[_0x8b2b('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index b34640e..537e5f1 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 _0x742d=['result','catch','exports','jayson/promise','bluebird','../../config/logger','Request','request','then','debug','rpc','routing','error','message'];(function(_0x5cd961,_0x2db11c){var _0x277d87=function(_0x5859a4){while(--_0x5859a4){_0x5cd961['push'](_0x5cd961['shift']());}};_0x277d87(++_0x2db11c);}(_0x742d,0x161));var _0xd742=function(_0x18e80b,_0x581e67){_0x18e80b=_0x18e80b-0x0;var _0x178605=_0x742d[_0x18e80b];return _0x178605;};'use strict';var jayson=require(_0xd742('0x0'));var BPromise=require(_0xd742('0x1'));var logger=require(_0xd742('0x2'))('routing');var client=jayson['client']['http']({'port':0x2329});client[_0xd742('0x3')]=function(_0xf22e85,_0x14fd19){return new BPromise(function(_0x262b88,_0x263284){return client[_0xd742('0x4')](_0xf22e85,_0x14fd19)[_0xd742('0x5')](function(_0x3f4748){logger[_0xd742('0x6')](_0xd742('0x7'),_0xd742('0x8'),_0xf22e85,_0x14fd19,_0x3f4748);if(_0x3f4748[_0xd742('0x9')]){logger[_0xd742('0x9')](_0xd742('0x7'),_0xd742('0x8'),_0xf22e85,_0x3f4748[_0xd742('0x9')]['message'],_0x14fd19);return _0x263284(_0x3f4748['error'][_0xd742('0xa')]);}else{return _0x262b88(_0x3f4748[_0xd742('0xb')]);}})[_0xd742('0xc')](function(_0x2f249d){logger[_0xd742('0x9')](_0xd742('0x7'),_0xd742('0x8'),_0xf22e85,_0x2f249d,_0x14fd19);return _0x263284(_0x2f249d);});});};module[_0xd742('0xd')]=client; \ No newline at end of file +var _0x8e9c=['error','message','result','catch','exports','bluebird','../../config/logger','routing','http','Request','request','then','debug','rpc'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x8e9c,0x11d));var _0xc8e9=function(_0x6b809e,_0x5c6c4d){_0x6b809e=_0x6b809e-0x0;var _0x26bb44=_0x8e9c[_0x6b809e];return _0x26bb44;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xc8e9('0x0'));var logger=require(_0xc8e9('0x1'))(_0xc8e9('0x2'));var client=jayson['client'][_0xc8e9('0x3')]({'port':0x2329});client[_0xc8e9('0x4')]=function(_0x31f50d,_0x2199f4){return new BPromise(function(_0x3f66b4,_0xf0f2a4){return client[_0xc8e9('0x5')](_0x31f50d,_0x2199f4)[_0xc8e9('0x6')](function(_0x60a68f){logger[_0xc8e9('0x7')](_0xc8e9('0x8'),'routing',_0x31f50d,_0x2199f4,_0x60a68f);if(_0x60a68f['error']){logger['error'](_0xc8e9('0x8'),_0xc8e9('0x2'),_0x31f50d,_0x60a68f[_0xc8e9('0x9')][_0xc8e9('0xa')],_0x2199f4);return _0xf0f2a4(_0x60a68f[_0xc8e9('0x9')]['message']);}else{return _0x3f66b4(_0x60a68f[_0xc8e9('0xb')]);}})[_0xc8e9('0xc')](function(_0x4e4065){logger[_0xc8e9('0x9')](_0xc8e9('0x8'),_0xc8e9('0x2'),_0x31f50d,_0x4e4065,_0x2199f4);return _0xf0f2a4(_0x4e4065);});});};module[_0xc8e9('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index dd65cf3..85f4d78 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 _0x45dc=['resolve','then','initMailAccounts','mailAccounts','getSettings','loginMailFrequency','catch','Email\x20service\x20initialization','./server','./realtime','./rpc/mailAccount','./rpc/setting','../../config/logger','email'];(function(_0x47ad1a,_0x467d68){var _0x586211=function(_0x169364){while(--_0x169364){_0x47ad1a['push'](_0x47ad1a['shift']());}};_0x586211(++_0x467d68);}(_0x45dc,0x6a));var _0xc45d=function(_0x4871a9,_0x8e0e9e){_0x4871a9=_0x4871a9-0x0;var _0x43279e=_0x45dc[_0x4871a9];return _0x43279e;};'use strict';var server=require(_0xc45d('0x0'));var Realtime=require(_0xc45d('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0xc45d('0x2'));var setting=require(_0xc45d('0x3'));var logger=require(_0xc45d('0x4'))(_0xc45d('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xc45d('0x6')]()['then'](mailAccount['getMailAccounts']())[_0xc45d('0x7')](realtime[_0xc45d('0x8')]())[_0xc45d('0x7')](function(){email['refresh'](realtime[_0xc45d('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(){return initRealtime();})[_0xc45d('0x7')](function(){return setting[_0xc45d('0xa')]();})['then'](function(_0x52444a){return setInterval(initRealtime,_0x52444a[_0xc45d('0xb')]*0x3e8);})[_0xc45d('0xc')](function(_0x46d577){logger['error'](_0xc45d('0xd'),_0x46d577);});}main(); \ No newline at end of file +var _0x65ac=['catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','then','initMailAccounts','refresh','listen','getSettings','loginMailFrequency'];(function(_0x1602de,_0x3e083a){var _0x807947=function(_0x269b71){while(--_0x269b71){_0x1602de['push'](_0x1602de['shift']());}};_0x807947(++_0x3e083a);}(_0x65ac,0x113));var _0xc65a=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x65ac[_0x15bc81];return _0x59440e;};'use strict';var server=require(_0xc65a('0x0'));var Realtime=require(_0xc65a('0x1'));var EmailChannel=require(_0xc65a('0x2'));var mailAccount=require(_0xc65a('0x3'));var setting=require(_0xc65a('0x4'));var logger=require(_0xc65a('0x5'))(_0xc65a('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0xc65a('0x7')](mailAccount['getMailAccounts']())['then'](realtime[_0xc65a('0x8')]())['then'](function(){email[_0xc65a('0x9')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xc65a('0xa')](realtime,email)[_0xc65a('0x7')](function(){return initRealtime();})[_0xc65a('0x7')](function(){return setting[_0xc65a('0xb')]();})[_0xc65a('0x7')](function(_0x581463){return setInterval(initRealtime,_0x581463[_0xc65a('0xc')]*0x3e8);})[_0xc65a('0xd')](function(_0xfe717e){logger[_0xc65a('0xe')](_0xc65a('0xf'),_0xfe717e);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index b361d51..a42dd23 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 _0xe0f5=['verified','catch','exports','lodash','moment','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','emit','name','key','active','Imap','status','total','isNil','stringify','md5','mailAccount:update','refresh','hasOwnProperty','service','custom','provider','box','bind','end','handleImapEnd','error','handleImapError','handleImapBox','connected','messageStatus','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','notify','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','smtp','send','Smtp','verify'];(function(_0x186ea2,_0x4218ef){var _0x229419=function(_0x17d7ef){while(--_0x17d7ef){_0x186ea2['push'](_0x186ea2['shift']());}};_0x229419(++_0x4218ef);}(_0xe0f5,0x77));var _0x5e0f=function(_0xf8e173,_0x519a9a){_0xf8e173=_0xf8e173-0x0;var _0x5efdf0=_0xe0f5[_0xf8e173];return _0x5efdf0;};'use strict';var _=require(_0x5e0f('0x0'));var moment=require(_0x5e0f('0x1'));var BPromise=require('bluebird');var md5=require('md5');var Redis=require('ioredis');var config=require(_0x5e0f('0x2'));var logger=require(_0x5e0f('0x3'))(_0x5e0f('0x4'));config[_0x5e0f('0x5')]=_[_0x5e0f('0x6')](config[_0x5e0f('0x5')],{'host':_0x5e0f('0x7'),'port':0x18eb});var io=require(_0x5e0f('0x8'))(new Redis(config['redis']));var EmailImap=require(_0x5e0f('0x9'));var EmailSmtp=require(_0x5e0f('0xa'));var mailAccount=require(_0x5e0f('0xb'));var md5Accounts={};function EmailChannel(_0x34b187){logger[_0x5e0f('0xc')](_0x5e0f('0xd'));this[_0x5e0f('0xe')]=_0x34b187[_0x5e0f('0xe')];this[_0x5e0f('0xf')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x5e0f('0x10')][_0x5e0f('0x11')]=function(_0xa541fb){var _0x1a2354=this[_0x5e0f('0xe')][_0xa541fb];var _0x5ec52e={'id':_0x1a2354['id'],'name':_0x1a2354[_0x5e0f('0x12')],'key':_0x1a2354[_0x5e0f('0x13')],'active':_0x1a2354[_0x5e0f('0x14')],'Imap':{'status':_0x1a2354[_0x5e0f('0x15')][_0x5e0f('0x16')],'messageStatus':_0x1a2354[_0x5e0f('0x15')]['messageStatus'],'total':_0x1a2354['Imap'][_0x5e0f('0x17')]}};if(_[_0x5e0f('0x18')](md5Accounts[_0xa541fb])){md5Accounts[_0xa541fb]={};}var _0x4745e9=md5(JSON[_0x5e0f('0x19')](_0x5ec52e));if(md5Accounts[_0xa541fb][_0x5e0f('0x1a')]!==_0x4745e9){md5Accounts[_0xa541fb]['md5']=_0x4745e9;io['emit'](_0x5e0f('0x1b'),_0x5ec52e);}};EmailChannel[_0x5e0f('0x10')][_0x5e0f('0x1c')]=function(_0x26ba60){for(var _0x5b5be9 in _0x26ba60){if(_0x26ba60[_0x5e0f('0x1d')](_0x5b5be9)){if(_0x26ba60[_0x5b5be9]['Imap']&&_0x26ba60[_0x5b5be9][_0x5e0f('0x14')]){var _0x3a6916=_0x26ba60[_0x5b5be9][_0x5e0f('0x15')];if(!_0x3a6916[_0x5e0f('0x1e')]&&_0x26ba60[_0x5b5be9]['provider']!==_0x5e0f('0x1f'))_0x3a6916[_0x5e0f('0x1e')]=_0x26ba60[_0x5b5be9][_0x5e0f('0x20')];if(!this['imapAccounts'][_0x5e0f('0x1d')](_0x3a6916['id'])){this[_0x5e0f('0xf')][_0x3a6916['id']]=new EmailImap(_0x3a6916,_0x26ba60[_0x5b5be9][_0x5e0f('0x4')]);this[_0x5e0f('0xf')][_0x3a6916['id']]['on'](_0x5e0f('0x21'),this['handleImapBox'][_0x5e0f('0x22')](this,_0x5b5be9));this['imapAccounts'][_0x3a6916['id']]['on'](_0x5e0f('0x4'),this['handleImapEmail']['bind'](this,_0x5b5be9));this[_0x5e0f('0xf')][_0x3a6916['id']]['on'](_0x5e0f('0x23'),this[_0x5e0f('0x24')][_0x5e0f('0x22')](this,_0x5b5be9));this[_0x5e0f('0xf')][_0x3a6916['id']]['on'](_0x5e0f('0x25'),this[_0x5e0f('0x26')][_0x5e0f('0x22')](this,_0x5b5be9));}}else{if(_[_0x5e0f('0x18')](this['mailAccounts'][_0x5b5be9][_0x5e0f('0x15')])){this[_0x5e0f('0xe')][_0x5b5be9][_0x5e0f('0x15')]={};}this[_0x5e0f('0xe')][_0x5b5be9][_0x5e0f('0x15')][_0x5e0f('0x16')]='disabled';this[_0x5e0f('0xe')][_0x5b5be9][_0x5e0f('0x15')]['messageStatus']='';this[_0x5e0f('0x11')](_0x5b5be9);}}}};EmailChannel[_0x5e0f('0x10')][_0x5e0f('0x27')]=function(_0x51f454,_0x5b00ee){if(this[_0x5e0f('0xe')][_0x51f454]){this['mailAccounts'][_0x51f454][_0x5e0f('0x15')][_0x5e0f('0x16')]=_0x5e0f('0x28');this['mailAccounts'][_0x51f454][_0x5e0f('0x15')][_0x5e0f('0x29')]=_0x5b00ee[_0x5e0f('0x12')];if(_0x5b00ee['messages']){this[_0x5e0f('0xe')][_0x51f454]['Imap'][_0x5e0f('0x17')]=_0x5b00ee[_0x5e0f('0x2a')][_0x5e0f('0x17')];}return this[_0x5e0f('0x11')](_0x51f454);}};EmailChannel[_0x5e0f('0x10')][_0x5e0f('0x2b')]=function(_0x4be319,_0x548a83){logger[_0x5e0f('0xc')](_0x5e0f('0x2c'),_0x548a83['firstName'],_0x548a83[_0x5e0f('0x2d')],_0x548a83['from'],_0x4be319);if(this[_0x5e0f('0xe')][_0x4be319]){return mailAccount[_0x5e0f('0x2e')](_0x4be319,_0x548a83)['then'](function(_0x286e5f){if(_0x286e5f){logger[_0x5e0f('0xc')](_0x5e0f('0x2f'));}})['catch'](function(_0x46b8ab){logger[_0x5e0f('0x25')](_0x5e0f('0x30'),JSON['stringify'](_0x46b8ab));});}};EmailChannel[_0x5e0f('0x10')]['handleImapEnd']=function(_0x13ebb3){if(this['mailAccounts'][_0x13ebb3]&&this[_0x5e0f('0xe')][_0x13ebb3][_0x5e0f('0x15')]){if(this[_0x5e0f('0xf')][this[_0x5e0f('0xe')][_0x13ebb3][_0x5e0f('0x15')]['id']]){delete this[_0x5e0f('0xf')][this[_0x5e0f('0xe')][_0x13ebb3][_0x5e0f('0x15')]['id']];}this['mailAccounts'][_0x13ebb3][_0x5e0f('0x15')][_0x5e0f('0x31')]=moment();this[_0x5e0f('0x11')](_0x13ebb3);}};EmailChannel['prototype'][_0x5e0f('0x26')]=function(_0x312e8a,_0x512c16){if(this[_0x5e0f('0xe')][_0x312e8a]){this[_0x5e0f('0xe')][_0x312e8a][_0x5e0f('0x15')][_0x5e0f('0x16')]='error';this[_0x5e0f('0xe')][_0x312e8a][_0x5e0f('0x15')][_0x5e0f('0x29')]=_0x512c16;return this[_0x5e0f('0x11')](_0x312e8a);}};EmailChannel[_0x5e0f('0x10')][_0x5e0f('0x32')]=function(_0x326ea2,_0x5824ff){return this[_0x5e0f('0x33')][_0x5e0f('0x34')](_0x326ea2,_0x5824ff);};EmailChannel[_0x5e0f('0x10')]['verifySmtp']=function(_0xfcaf6e){var _0x143001=this;if(this[_0x5e0f('0xe')][_0xfcaf6e['id']]){if(_['isNil'](this[_0x5e0f('0xe')][_0xfcaf6e['id']][_0x5e0f('0x35')])){this['mailAccounts'][_0xfcaf6e['id']][_0x5e0f('0x35')]={};}this[_0x5e0f('0xe')][_0xfcaf6e['id']][_0x5e0f('0x35')]['lastSync']=moment();return new BPromise(function(_0x466e2b,_0x230b74){return _0x143001['smtp'][_0x5e0f('0x36')](_0xfcaf6e)['then'](function(_0x3d9c48){_0x143001[_0x5e0f('0xe')][_0xfcaf6e['id']][_0x5e0f('0x35')][_0x5e0f('0x16')]=_0x5e0f('0x37');_0x143001[_0x5e0f('0xe')][_0xfcaf6e['id']]['Smtp'][_0x5e0f('0x29')]='';_0x143001[_0x5e0f('0x11')](_0xfcaf6e['id']);_0x466e2b(_0x3d9c48);})[_0x5e0f('0x38')](function(_0x2f53c7){_0x143001[_0x5e0f('0xe')][_0xfcaf6e['id']]['Smtp']['status']=_0x5e0f('0x25');_0x143001[_0x5e0f('0xe')][_0xfcaf6e['id']][_0x5e0f('0x35')][_0x5e0f('0x29')]=_0x2f53c7;_0x143001['emit'](_0xfcaf6e['id']);_0x230b74(_0x2f53c7);});});}return this[_0x5e0f('0x33')][_0x5e0f('0x36')](_0xfcaf6e);};module[_0x5e0f('0x39')]=EmailChannel; \ No newline at end of file +var _0x305e=['catch','handleImapEnd','sendMail','send','verifySmtp','Smtp','verify','verified','lodash','moment','md5','../../../config/environment','../../../config/logger','email','defaults','localhost','socket.io-emitter','redis','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','isNil','stringify','mailAccount:update','refresh','service','custom','box','handleImapBox','bind','handleImapEmail','end','error','handleImapError','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x305e,0x74));var _0xe305=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x305e[_0x432682];return _0x463d05;};'use strict';var _=require(_0xe305('0x0'));var moment=require(_0xe305('0x1'));var BPromise=require('bluebird');var md5=require(_0xe305('0x2'));var Redis=require('ioredis');var config=require(_0xe305('0x3'));var logger=require(_0xe305('0x4'))(_0xe305('0x5'));config['redis']=_[_0xe305('0x6')](config['redis'],{'host':_0xe305('0x7'),'port':0x18eb});var io=require(_0xe305('0x8'))(new Redis(config[_0xe305('0x9')]));var EmailImap=require(_0xe305('0xa'));var EmailSmtp=require(_0xe305('0xb'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x3b89ff){logger[_0xe305('0xc')](_0xe305('0xd'));this[_0xe305('0xe')]=_0x3b89ff['mailAccounts'];this[_0xe305('0xf')]={};this[_0xe305('0x10')]=new EmailSmtp();}EmailChannel[_0xe305('0x11')][_0xe305('0x12')]=function(_0x1fd990){var _0x55c041=this['mailAccounts'][_0x1fd990];var _0x420f9e={'id':_0x55c041['id'],'name':_0x55c041[_0xe305('0x13')],'key':_0x55c041[_0xe305('0x14')],'active':_0x55c041[_0xe305('0x15')],'Imap':{'status':_0x55c041[_0xe305('0x16')][_0xe305('0x17')],'messageStatus':_0x55c041[_0xe305('0x16')][_0xe305('0x18')],'total':_0x55c041['Imap']['total']}};if(_[_0xe305('0x19')](md5Accounts[_0x1fd990])){md5Accounts[_0x1fd990]={};}var _0x1be99b=md5(JSON[_0xe305('0x1a')](_0x420f9e));if(md5Accounts[_0x1fd990][_0xe305('0x2')]!==_0x1be99b){md5Accounts[_0x1fd990][_0xe305('0x2')]=_0x1be99b;io[_0xe305('0x12')](_0xe305('0x1b'),_0x420f9e);}};EmailChannel['prototype'][_0xe305('0x1c')]=function(_0x563914){for(var _0x107c43 in _0x563914){if(_0x563914['hasOwnProperty'](_0x107c43)){if(_0x563914[_0x107c43][_0xe305('0x16')]&&_0x563914[_0x107c43][_0xe305('0x15')]){var _0x327c1c=_0x563914[_0x107c43][_0xe305('0x16')];if(!_0x327c1c[_0xe305('0x1d')]&&_0x563914[_0x107c43]['provider']!==_0xe305('0x1e'))_0x327c1c[_0xe305('0x1d')]=_0x563914[_0x107c43]['provider'];if(!this[_0xe305('0xf')]['hasOwnProperty'](_0x327c1c['id'])){this[_0xe305('0xf')][_0x327c1c['id']]=new EmailImap(_0x327c1c,_0x563914[_0x107c43][_0xe305('0x5')]);this[_0xe305('0xf')][_0x327c1c['id']]['on'](_0xe305('0x1f'),this[_0xe305('0x20')][_0xe305('0x21')](this,_0x107c43));this[_0xe305('0xf')][_0x327c1c['id']]['on']('email',this[_0xe305('0x22')][_0xe305('0x21')](this,_0x107c43));this[_0xe305('0xf')][_0x327c1c['id']]['on'](_0xe305('0x23'),this['handleImapEnd'][_0xe305('0x21')](this,_0x107c43));this[_0xe305('0xf')][_0x327c1c['id']]['on'](_0xe305('0x24'),this[_0xe305('0x25')][_0xe305('0x21')](this,_0x107c43));}}else{if(_[_0xe305('0x19')](this[_0xe305('0xe')][_0x107c43][_0xe305('0x16')])){this[_0xe305('0xe')][_0x107c43][_0xe305('0x16')]={};}this[_0xe305('0xe')][_0x107c43][_0xe305('0x16')]['status']='disabled';this[_0xe305('0xe')][_0x107c43][_0xe305('0x16')][_0xe305('0x18')]='';this[_0xe305('0x12')](_0x107c43);}}}};EmailChannel[_0xe305('0x11')]['handleImapBox']=function(_0x442094,_0x4e68cb){if(this['mailAccounts'][_0x442094]){this['mailAccounts'][_0x442094]['Imap'][_0xe305('0x17')]='connected';this['mailAccounts'][_0x442094]['Imap'][_0xe305('0x18')]=_0x4e68cb[_0xe305('0x13')];if(_0x4e68cb[_0xe305('0x26')]){this['mailAccounts'][_0x442094][_0xe305('0x16')]['total']=_0x4e68cb[_0xe305('0x26')][_0xe305('0x27')];}return this[_0xe305('0x12')](_0x442094);}};EmailChannel[_0xe305('0x11')]['handleImapEmail']=function(_0x1e7eb4,_0x3e8de7){logger['info'](_0xe305('0x28'),_0x3e8de7[_0xe305('0x29')],_0x3e8de7[_0xe305('0x2a')],_0x3e8de7[_0xe305('0x2b')],_0x1e7eb4);if(this[_0xe305('0xe')][_0x1e7eb4]){return mailAccount['notify'](_0x1e7eb4,_0x3e8de7)[_0xe305('0x2c')](function(_0x3d4e2c){if(_0x3d4e2c){logger[_0xe305('0xc')](_0xe305('0x2d'));}})[_0xe305('0x2e')](function(_0x124eed){logger['error']('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xe305('0x1a')](_0x124eed));});}};EmailChannel['prototype'][_0xe305('0x2f')]=function(_0x40b48a){if(this[_0xe305('0xe')][_0x40b48a]&&this[_0xe305('0xe')][_0x40b48a]['Imap']){if(this[_0xe305('0xf')][this[_0xe305('0xe')][_0x40b48a][_0xe305('0x16')]['id']]){delete this[_0xe305('0xf')][this[_0xe305('0xe')][_0x40b48a][_0xe305('0x16')]['id']];}this[_0xe305('0xe')][_0x40b48a][_0xe305('0x16')]['lastSync']=moment();this[_0xe305('0x12')](_0x40b48a);}};EmailChannel['prototype'][_0xe305('0x25')]=function(_0x406b1d,_0x1afe34){if(this[_0xe305('0xe')][_0x406b1d]){this[_0xe305('0xe')][_0x406b1d]['Imap'][_0xe305('0x17')]='error';this[_0xe305('0xe')][_0x406b1d][_0xe305('0x16')][_0xe305('0x18')]=_0x1afe34;return this[_0xe305('0x12')](_0x406b1d);}};EmailChannel[_0xe305('0x11')][_0xe305('0x30')]=function(_0x42461e,_0x53f8dd){return this[_0xe305('0x10')][_0xe305('0x31')](_0x42461e,_0x53f8dd);};EmailChannel[_0xe305('0x11')][_0xe305('0x32')]=function(_0x3494fc){var _0x98f9cb=this;if(this[_0xe305('0xe')][_0x3494fc['id']]){if(_[_0xe305('0x19')](this[_0xe305('0xe')][_0x3494fc['id']][_0xe305('0x33')])){this[_0xe305('0xe')][_0x3494fc['id']][_0xe305('0x33')]={};}this[_0xe305('0xe')][_0x3494fc['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x447d55,_0x34f0e9){return _0x98f9cb[_0xe305('0x10')][_0xe305('0x34')](_0x3494fc)[_0xe305('0x2c')](function(_0x766af8){_0x98f9cb[_0xe305('0xe')][_0x3494fc['id']][_0xe305('0x33')][_0xe305('0x17')]=_0xe305('0x35');_0x98f9cb['mailAccounts'][_0x3494fc['id']][_0xe305('0x33')]['messageStatus']='';_0x98f9cb['emit'](_0x3494fc['id']);_0x447d55(_0x766af8);})[_0xe305('0x2e')](function(_0x368e65){_0x98f9cb[_0xe305('0xe')][_0x3494fc['id']][_0xe305('0x33')][_0xe305('0x17')]=_0xe305('0x24');_0x98f9cb['mailAccounts'][_0x3494fc['id']][_0xe305('0x33')][_0xe305('0x18')]=_0x368e65;_0x98f9cb[_0xe305('0x12')](_0x3494fc['id']);_0x34f0e9(_0x368e65);});});}return this[_0xe305('0x10')][_0xe305('0x34')](_0x3494fc);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 7ea9296..6ebcbf9 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 _0x2b61=['connTimeout','authTimeout','service','modernAuthentication','xoauth2','CloudProvider','data5','user','password','anonymous@xcally.com','host','port','tls','openBox','handleOpenBox','handleError','emit','box','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd','parser','email','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','simpleParser','Iconv','events','EventEmitter','./utils','mailbox','account','handleReady','bind','once','end','handleEnd','error','connect','inherits','prototype','getAccount'];(function(_0x24b53b,_0x57c20d){var _0x3b5c00=function(_0xed1211){while(--_0xed1211){_0x24b53b['push'](_0x24b53b['shift']());}};_0x3b5c00(++_0x57c20d);}(_0x2b61,0x15a));var _0x12b6=function(_0x5f44c3,_0x460f76){_0x5f44c3=_0x5f44c3-0x0;var _0x577bf7=_0x2b61[_0x5f44c3];return _0x577bf7;};'use strict';var _=require(_0x12b6('0x0'));var util=require(_0x12b6('0x1'));var Imap=require(_0x12b6('0x2'));var simpleParser=require('mailparser')[_0x12b6('0x3')];var Iconv=require('iconv')[_0x12b6('0x4')];var EventEmitter=require(_0x12b6('0x5'))[_0x12b6('0x6')];var utils=require(_0x12b6('0x7'));var logger=require('../../../config/logger')('email');function EmailImap(_0x3d26f6,_0x4a30a1){this[_0x12b6('0x8')]=_0x3d26f6[_0x12b6('0x8')];this[_0x12b6('0x9')]=this['getAccount'](_0x3d26f6,_0x4a30a1);this[_0x12b6('0x2')]=new Imap(this[_0x12b6('0x9')]);this['imap']['once']('ready',this[_0x12b6('0xa')][_0x12b6('0xb')](this));this[_0x12b6('0x2')][_0x12b6('0xc')](_0x12b6('0xd'),this[_0x12b6('0xe')][_0x12b6('0xb')](this));this['imap']['on'](_0x12b6('0xf'),this['handleError'][_0x12b6('0xb')](this));this[_0x12b6('0x2')][_0x12b6('0x10')]();}util[_0x12b6('0x11')](EmailImap,EventEmitter);EmailImap[_0x12b6('0x12')][_0x12b6('0x13')]=function(_0x1709a1,_0x3d7c20){var _0x3a156b={'connTimeout':_0x1709a1[_0x12b6('0x14')]?_0x1709a1['connTimeout']*0x3e8:0x2710,'authTimeout':_0x1709a1[_0x12b6('0x15')]?_0x1709a1[_0x12b6('0x15')]*0x3e8:0x1388};if(_0x1709a1[_0x12b6('0x16')]){_0x3a156b['user']=_0x1709a1['user'];if(_0x1709a1[_0x12b6('0x17')]){_0x3a156b[_0x12b6('0x18')]=utils['generateXOAuth2Token'](_0x1709a1[_0x12b6('0x19')][_0x12b6('0x1a')],_0x1709a1[_0x12b6('0x1b')]);}else{_0x3a156b[_0x12b6('0x1c')]=_0x1709a1['password'];}}else{if(_0x1709a1['authentication']){_0x3a156b[_0x12b6('0x1b')]=_0x1709a1['user'];_0x3a156b[_0x12b6('0x1c')]=_0x1709a1['password'];}}_0x3a156b['email']=_0x3d7c20||_0x1709a1['user']||_0x12b6('0x1d');_0x3a156b[_0x12b6('0x1e')]=_0x1709a1[_0x12b6('0x1e')];_0x3a156b[_0x12b6('0x1f')]=_0x1709a1['port']||0x3e1;if(_0x1709a1['tls']){_0x3a156b[_0x12b6('0x20')]=!![];}else{_0x3a156b[_0x12b6('0x20')]=![];_0x3a156b['autotls']='required';}return _0x3a156b;};EmailImap[_0x12b6('0x12')][_0x12b6('0xa')]=function(){this[_0x12b6('0x2')][_0x12b6('0x21')](this['mailbox'],![],this[_0x12b6('0x22')][_0x12b6('0xb')](this));};EmailImap[_0x12b6('0x12')]['handleOpenBox']=function(_0x105c6b,_0x4393d0){if(_0x105c6b){this[_0x12b6('0x23')](_0x105c6b,!![]);}else{this[_0x12b6('0x24')](_0x12b6('0x25'),_0x4393d0);this['readUnseen']();}};EmailImap[_0x12b6('0x12')][_0x12b6('0x26')]=function(_0x2b4b47){if(_0x2b4b47){this[_0x12b6('0x23')](_0x2b4b47,!![]);}else{this[_0x12b6('0x2')][_0x12b6('0xd')]();}};EmailImap['prototype']['readUnseen']=function(){this[_0x12b6('0x2')][_0x12b6('0x27')]([_0x12b6('0x28')],this['handleReadUnseen']['bind'](this));};EmailImap[_0x12b6('0x12')][_0x12b6('0x29')]=function(_0x32b479,_0x5df4b2){if(_0x32b479){this['handleError'](_0x32b479,!![]);}else{if(_0x5df4b2[_0x12b6('0x2a')]){try{var _0x5ce245=this[_0x12b6('0x2')][_0x12b6('0x2b')](_0x5df4b2,{'bodies':'','markSeen':!![]});_0x5ce245['on'](_0x12b6('0x2c'),this[_0x12b6('0x2d')]['bind'](this));_0x5ce245[_0x12b6('0xc')]('error',this['handleFetchError'][_0x12b6('0xb')](this));_0x5ce245['once'](_0x12b6('0xd'),this[_0x12b6('0x2e')][_0x12b6('0xb')](this));}catch(_0x61b98d){logger[_0x12b6('0xf')](_0x61b98d);}}else{this[_0x12b6('0x2')][_0x12b6('0x2f')](!![],this[_0x12b6('0x26')]['bind'](this));}}};EmailImap[_0x12b6('0x12')][_0x12b6('0x2d')]=function(_0x2ded3e){_0x2ded3e['on'](_0x12b6('0x30'),this[_0x12b6('0x31')]['bind'](this));_0x2ded3e['once'](_0x12b6('0x32'),this[_0x12b6('0x33')][_0x12b6('0xb')](this));_0x2ded3e['once'](_0x12b6('0xd'),this['handleMessageEnd'][_0x12b6('0xb')](this));};EmailImap['prototype'][_0x12b6('0x31')]=function(_0x12dace){simpleParser(_0x12dace,{'Iconv':Iconv},this[_0x12b6('0x34')][_0x12b6('0xb')](this));};EmailImap[_0x12b6('0x12')][_0x12b6('0x33')]=function(){};EmailImap[_0x12b6('0x12')][_0x12b6('0x35')]=function(){};EmailImap[_0x12b6('0x12')][_0x12b6('0x34')]=function(_0x51fafd,_0x35ec31){if(_0x51fafd){logger[_0x12b6('0xf')](_0x51fafd);}else{var _0x1cd3fb=this;utils[_0x12b6('0x36')](this[_0x12b6('0x9')],_0x35ec31,function(_0x203d6a){_0x1cd3fb[_0x12b6('0x24')](_0x12b6('0x37'),_0x203d6a);});}};EmailImap[_0x12b6('0x12')][_0x12b6('0x2e')]=function(){this['imap'][_0x12b6('0x2f')](!![],this['handleCloseBox'][_0x12b6('0xb')](this));};EmailImap[_0x12b6('0x12')]['handleFetchError']=function(_0x4a585c){this[_0x12b6('0x23')](_0x4a585c);this[_0x12b6('0x2')][_0x12b6('0x2f')](!![],this[_0x12b6('0x26')]['bind'](this));};EmailImap[_0x12b6('0x12')]['handleEnd']=function(){this[_0x12b6('0x24')](_0x12b6('0xd'));};EmailImap[_0x12b6('0x12')][_0x12b6('0x23')]=function(_0x5794f3,_0x36e4f4){logger[_0x12b6('0xf')]('handleError',this[_0x12b6('0x9')][_0x12b6('0x37')],JSON[_0x12b6('0x38')](_0x5794f3));var _0x2d3b5c='';if(_0x5794f3){if(_0x5794f3[_0x12b6('0x39')]){_0x2d3b5c=_0x5794f3[_0x12b6('0x39')];}else{for(var _0x3b5670 in _0x5794f3){if(_0x5794f3[_0x12b6('0x3a')](_0x3b5670)){_0x2d3b5c+=_[_0x12b6('0x3b')](_0x3b5670)+':\x20'+_0x5794f3[_0x3b5670]+'\x0a';}}}}if(_0x36e4f4){this[_0x12b6('0x2')]['end']();}else{this[_0x12b6('0x24')]('error',_0x2d3b5c);this['emit'](_0x12b6('0xd'));}};module[_0x12b6('0x3c')]=EmailImap; \ No newline at end of file +var _0xad8a=['mailbox','account','getAccount','ready','handleReady','bind','once','end','handleEnd','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','handleReadUnseen','length','message','handleFetchMessage','error','body','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchEnd','closeBox','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','Iconv','events','EventEmitter','../../../config/logger','email'];(function(_0x2ca616,_0x384ec8){var _0x53155f=function(_0x108627){while(--_0x108627){_0x2ca616['push'](_0x2ca616['shift']());}};_0x53155f(++_0x384ec8);}(_0xad8a,0xb0));var _0xaad8=function(_0x29375e,_0x332ffc){_0x29375e=_0x29375e-0x0;var _0x48354b=_0xad8a[_0x29375e];return _0x48354b;};'use strict';var _=require(_0xaad8('0x0'));var util=require(_0xaad8('0x1'));var Imap=require(_0xaad8('0x2'));var simpleParser=require(_0xaad8('0x3'))[_0xaad8('0x4')];var Iconv=require('iconv')[_0xaad8('0x5')];var EventEmitter=require(_0xaad8('0x6'))[_0xaad8('0x7')];var utils=require('./utils');var logger=require(_0xaad8('0x8'))(_0xaad8('0x9'));function EmailImap(_0x22c799,_0xeb5d15){this[_0xaad8('0xa')]=_0x22c799[_0xaad8('0xa')];this[_0xaad8('0xb')]=this[_0xaad8('0xc')](_0x22c799,_0xeb5d15);this[_0xaad8('0x2')]=new Imap(this[_0xaad8('0xb')]);this['imap']['once'](_0xaad8('0xd'),this[_0xaad8('0xe')][_0xaad8('0xf')](this));this[_0xaad8('0x2')][_0xaad8('0x10')](_0xaad8('0x11'),this[_0xaad8('0x12')][_0xaad8('0xf')](this));this[_0xaad8('0x2')]['on']('error',this[_0xaad8('0x13')][_0xaad8('0xf')](this));this[_0xaad8('0x2')][_0xaad8('0x14')]();}util[_0xaad8('0x15')](EmailImap,EventEmitter);EmailImap[_0xaad8('0x16')][_0xaad8('0xc')]=function(_0x357bf6,_0x1c70d3){var _0x4372fc={'connTimeout':_0x357bf6[_0xaad8('0x17')]?_0x357bf6[_0xaad8('0x17')]*0x3e8:0x2710,'authTimeout':_0x357bf6[_0xaad8('0x18')]?_0x357bf6['authTimeout']*0x3e8:0x1388};if(_0x357bf6[_0xaad8('0x19')]){_0x4372fc[_0xaad8('0x1a')]=_0x357bf6['user'];if(_0x357bf6[_0xaad8('0x1b')]){_0x4372fc[_0xaad8('0x1c')]=utils[_0xaad8('0x1d')](_0x357bf6[_0xaad8('0x1e')][_0xaad8('0x1f')],_0x357bf6[_0xaad8('0x1a')]);}else{_0x4372fc['password']=_0x357bf6[_0xaad8('0x20')];}}else{if(_0x357bf6[_0xaad8('0x21')]){_0x4372fc['user']=_0x357bf6[_0xaad8('0x1a')];_0x4372fc['password']=_0x357bf6[_0xaad8('0x20')];}}_0x4372fc[_0xaad8('0x9')]=_0x1c70d3||_0x357bf6[_0xaad8('0x1a')]||_0xaad8('0x22');_0x4372fc['host']=_0x357bf6[_0xaad8('0x23')];_0x4372fc[_0xaad8('0x24')]=_0x357bf6['port']||0x3e1;if(_0x357bf6[_0xaad8('0x25')]){_0x4372fc[_0xaad8('0x25')]=!![];}else{_0x4372fc[_0xaad8('0x25')]=![];_0x4372fc['autotls']='required';}return _0x4372fc;};EmailImap[_0xaad8('0x16')][_0xaad8('0xe')]=function(){this[_0xaad8('0x2')][_0xaad8('0x26')](this[_0xaad8('0xa')],![],this[_0xaad8('0x27')][_0xaad8('0xf')](this));};EmailImap[_0xaad8('0x16')][_0xaad8('0x27')]=function(_0xba9919,_0x1bbac4){if(_0xba9919){this[_0xaad8('0x13')](_0xba9919,!![]);}else{this[_0xaad8('0x28')](_0xaad8('0x29'),_0x1bbac4);this[_0xaad8('0x2a')]();}};EmailImap['prototype'][_0xaad8('0x2b')]=function(_0x94e799){if(_0x94e799){this[_0xaad8('0x13')](_0x94e799,!![]);}else{this['imap'][_0xaad8('0x11')]();}};EmailImap[_0xaad8('0x16')][_0xaad8('0x2a')]=function(){this[_0xaad8('0x2')][_0xaad8('0x2c')](['UNSEEN'],this[_0xaad8('0x2d')][_0xaad8('0xf')](this));};EmailImap[_0xaad8('0x16')][_0xaad8('0x2d')]=function(_0x151c26,_0x5bd911){if(_0x151c26){this[_0xaad8('0x13')](_0x151c26,!![]);}else{if(_0x5bd911[_0xaad8('0x2e')]){try{var _0x20ea82=this[_0xaad8('0x2')]['fetch'](_0x5bd911,{'bodies':'','markSeen':!![]});_0x20ea82['on'](_0xaad8('0x2f'),this[_0xaad8('0x30')][_0xaad8('0xf')](this));_0x20ea82[_0xaad8('0x10')](_0xaad8('0x31'),this['handleFetchError'][_0xaad8('0xf')](this));_0x20ea82[_0xaad8('0x10')]('end',this['handleFetchEnd'][_0xaad8('0xf')](this));}catch(_0x307fa7){logger[_0xaad8('0x31')](_0x307fa7);}}else{this[_0xaad8('0x2')]['closeBox'](!![],this[_0xaad8('0x2b')][_0xaad8('0xf')](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x2fb533){_0x2fb533['on'](_0xaad8('0x32'),this['handleMessageBody'][_0xaad8('0xf')](this));_0x2fb533['once']('attributes',this[_0xaad8('0x33')][_0xaad8('0xf')](this));_0x2fb533['once'](_0xaad8('0x11'),this[_0xaad8('0x34')][_0xaad8('0xf')](this));};EmailImap[_0xaad8('0x16')]['handleMessageBody']=function(_0xe72f69){simpleParser(_0xe72f69,{'Iconv':Iconv},this[_0xaad8('0x35')][_0xaad8('0xf')](this));};EmailImap[_0xaad8('0x16')][_0xaad8('0x33')]=function(){};EmailImap[_0xaad8('0x16')]['handleMessageEnd']=function(){};EmailImap[_0xaad8('0x16')][_0xaad8('0x35')]=function(_0xe55ab3,_0x5a35bb){if(_0xe55ab3){logger[_0xaad8('0x31')](_0xe55ab3);}else{var _0x39374b=this;utils[_0xaad8('0x36')](this[_0xaad8('0xb')],_0x5a35bb,function(_0x146518){_0x39374b[_0xaad8('0x28')](_0xaad8('0x9'),_0x146518);});}};EmailImap['prototype'][_0xaad8('0x37')]=function(){this[_0xaad8('0x2')][_0xaad8('0x38')](!![],this[_0xaad8('0x2b')][_0xaad8('0xf')](this));};EmailImap[_0xaad8('0x16')]['handleFetchError']=function(_0x354735){this[_0xaad8('0x13')](_0x354735);this[_0xaad8('0x2')][_0xaad8('0x38')](!![],this['handleCloseBox']['bind'](this));};EmailImap['prototype'][_0xaad8('0x12')]=function(){this[_0xaad8('0x28')](_0xaad8('0x11'));};EmailImap['prototype'][_0xaad8('0x13')]=function(_0x355fc2,_0x4af930){logger[_0xaad8('0x31')](_0xaad8('0x13'),this[_0xaad8('0xb')][_0xaad8('0x9')],JSON[_0xaad8('0x39')](_0x355fc2));var _0x17fb2b='';if(_0x355fc2){if(_0x355fc2[_0xaad8('0x3a')]){_0x17fb2b=_0x355fc2[_0xaad8('0x3a')];}else{for(var _0x150436 in _0x355fc2){if(_0x355fc2[_0xaad8('0x3b')](_0x150436)){_0x17fb2b+=_[_0xaad8('0x3c')](_0x150436)+':\x20'+_0x355fc2[_0x150436]+'\x0a';}}}}if(_0x4af930){this[_0xaad8('0x2')]['end']();}else{this['emit']('error',_0x17fb2b);this[_0xaad8('0x28')]('end');}};module[_0xaad8('0x3d')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index f5d68ea..0f1119b 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 _0xa285=['nodemailer','nodemailer-plugin-inline-base64','prototype','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired','exports'];(function(_0x5afde7,_0x3fb080){var _0x5669a0=function(_0x9b7096){while(--_0x9b7096){_0x5afde7['push'](_0x5afde7['shift']());}};_0x5669a0(++_0x3fb080);}(_0xa285,0xbb));var _0x5a28=function(_0x1eb07b,_0x1f2c37){_0x1eb07b=_0x1eb07b-0x0;var _0x16867f=_0xa285[_0x1eb07b];return _0x16867f;};'use strict';var nodemailer=require(_0x5a28('0x0'));var inlineBase64=require(_0x5a28('0x1'));function EmailSmtp(){}EmailSmtp[_0x5a28('0x2')]['send']=function(_0x51ff78,_0x3dee61){return new Promise(function(_0x19ea93,_0x4de21e){var _0x305b4d=nodemailer[_0x5a28('0x3')](_0x51ff78);_0x305b4d[_0x5a28('0x4')](_0x5a28('0x5'),inlineBase64());_0x305b4d[_0x5a28('0x6')](_0x3dee61,function(_0x445385,_0x4d1249){if(_0x445385){_0x4de21e(_0x445385[_0x5a28('0x7')]());}else{_0x19ea93(_0x4d1249);}});});};EmailSmtp[_0x5a28('0x2')][_0x5a28('0x8')]=function(_0x1c41f6){return new Promise(function(_0x5326ff,_0x4702a7){var _0x5265f4=nodemailer[_0x5a28('0x3')](_0x1c41f6);_0x5265f4[_0x5a28('0x8')](function(_0x179450,_0x4ea853){if(_0x179450){_0x4702a7(_0x179450[_0x5a28('0x7')]());}else{if(_0x4ea853){_0x5326ff(_0x4ea853);}else{_0x4702a7(_0x5a28('0x9'));}}});});};module[_0x5a28('0xa')]=EmailSmtp; \ No newline at end of file +var _0xe1b5=['verify','createTransport','nodemailer-plugin-inline-base64','use','compile','toString'];(function(_0x223400,_0x29a1e0){var _0xcec92e=function(_0x20231f){while(--_0x20231f){_0x223400['push'](_0x223400['shift']());}};_0xcec92e(++_0x29a1e0);}(_0xe1b5,0x1ca));var _0x5e1b=function(_0x302f55,_0x31872f){_0x302f55=_0x302f55-0x0;var _0x55ca94=_0xe1b5[_0x302f55];return _0x55ca94;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x5e1b('0x0'));function EmailSmtp(){}EmailSmtp['prototype']['send']=function(_0x52eddf,_0x4db86e){return new Promise(function(_0x25f6f7,_0x806c1f){var _0x4c54ef=nodemailer['createTransport'](_0x52eddf);_0x4c54ef[_0x5e1b('0x1')](_0x5e1b('0x2'),inlineBase64());_0x4c54ef['sendMail'](_0x4db86e,function(_0xed1c89,_0x5c69c5){if(_0xed1c89){_0x806c1f(_0xed1c89[_0x5e1b('0x3')]());}else{_0x25f6f7(_0x5c69c5);}});});};EmailSmtp['prototype'][_0x5e1b('0x4')]=function(_0x1965d3){return new Promise(function(_0x35e765,_0x285385){var _0x1a3c54=nodemailer[_0x5e1b('0x5')](_0x1965d3);_0x1a3c54['verify'](function(_0x372bdc,_0x166b97){if(_0x372bdc){_0x285385(_0x372bdc[_0x5e1b('0x3')]());}else{if(_0x166b97){_0x35e765(_0x166b97);}else{_0x285385('Not\x20verifired');}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 2c90ef4..7ced770 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 _0xcdba=['value','address','anonymous','generate','@xcally.com','name','substring','split','length','slice','Anonymous','pop','isEmpty','test','replace','\x20[Attachment:\x20','\x20]','body','Empty\x20message

','Attachments','Data','generateXOAuth2Token','user=','auth=Bearer\x20','toString','base64','lodash','randomstring','path','../../../config/logger','email','head'];(function(_0x184ea9,_0x261b66){var _0x1ee0d=function(_0x16f4a2){while(--_0x16f4a2){_0x184ea9['push'](_0x184ea9['shift']());}};_0x1ee0d(++_0x261b66);}(_0xcdba,0x84));var _0xacdb=function(_0x3141b3,_0xfb6bd5){_0x3141b3=_0x3141b3-0x0;var _0x8b3ec1=_0xcdba[_0x3141b3];return _0x8b3ec1;};'use strict';var _=require(_0xacdb('0x0'));var moment=require('moment');var random=require(_0xacdb('0x1'));var fs=require('fs');var path=require(_0xacdb('0x2'));var util=require('util');var tnef=require('node-tnef');var logger=require(_0xacdb('0x3'))(_0xacdb('0x4'));var config=require('../../../config/environment');function getAddress(_0x409026){var _0x4a786f=_[_0xacdb('0x5')](_0x409026[_0xacdb('0x6')]);return _0x4a786f&&_0x4a786f['address']?_0x4a786f[_0xacdb('0x7')]:_0xacdb('0x8')+random[_0xacdb('0x9')](0x6)+_0xacdb('0xa');}function getFirstName(_0x15e281){var _0x4c876c=_[_0xacdb('0x5')](_0x15e281[_0xacdb('0x6')]);if(_0x4c876c&&_0x4c876c['name']){if(_0x4c876c[_0xacdb('0xb')]==_0x4c876c[_0xacdb('0x7')]){return _0x4c876c['name'][_0xacdb('0xc')](0x0,_0x4c876c['name']['indexOf']('@'));}var _0xc51924=_0x4c876c[_0xacdb('0xb')][_0xacdb('0xd')](/\s+/);return _0xc51924[_0xacdb('0xe')]>0x1?_0xc51924[_0xacdb('0xf')](0x0,-0x1)['join']('\x20'):_0x4c876c['name'];}return _0xacdb('0x10');}function getLastName(_0x339fc8){var _0x5b3a2d=_[_0xacdb('0x5')](_0x339fc8[_0xacdb('0x6')]);if(_0x5b3a2d&&_0x5b3a2d[_0xacdb('0xb')]){var _0x2c8d83=_0x5b3a2d[_0xacdb('0xb')][_0xacdb('0xd')](/\s+/);return _0x2c8d83[_0xacdb('0xe')]>0x1?_0x2c8d83[_0xacdb('0x11')]():'';}return'';}function getMails(_0x26c899,_0x55cf50){var _0x51c47a='';for(var _0x28cce1=0x0;_0x28cce1<_0x55cf50[_0xacdb('0x6')][_0xacdb('0xe')];_0x28cce1+=0x1){if(_0x55cf50[_0xacdb('0x6')][_0x28cce1][_0xacdb('0x7')]!==_0x26c899){if(!_[_0xacdb('0x12')](_0x51c47a)){_0x51c47a+=',';}_0x51c47a+=_0x55cf50[_0xacdb('0x6')][_0x28cce1][_0xacdb('0xb')]||_0x55cf50['value'][_0x28cce1][_0xacdb('0x7')]||'';_0x51c47a+='\x20<';_0x51c47a+=_0x55cf50[_0xacdb('0x6')][_0x28cce1][_0xacdb('0x7')]?_0x55cf50[_0xacdb('0x6')][_0x28cce1][_0xacdb('0x7')]:'anonymous'+random['generate'](0x6)+_0xacdb('0xa');_0x51c47a+='>';}}return _0x51c47a;}function parseEmail(_0x9f2d67,_0x1a6f3a,_0xc0b57a){if(_0x1a6f3a['html']){var _0x1c7705=/)<[^<]*)*<\/script>/gi;while(_0x1c7705[_0xacdb('0x13')](_0x1a6f3a['html'])){_0x1a6f3a['html']=_0x1a6f3a['html'][_0xacdb('0x14')](_0x1c7705,'');}if(_0x1a6f3a['html']['includes'](_0xacdb('0x15'))){var _0x3bab21=[];_0x1a6f3a[_0xacdb('0x16')]['forEach'](_0x20c9c8=>{_0x3bab21[_0xacdb('0x17')](_0x20c9c8[_0xacdb('0x18')]);});var _0x505a1e=/]+>/g;var _0x2e3f6e=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x329827=_0x1a6f3a[_0xacdb('0x19')]['replace'](_0x2e3f6e,'_SRC');var _0x58b959=_0x329827['replace'](_0x505a1e,'_IMG');for(let _0x36853e=0x0;_0x36853e<_0x3bab21['length'];_0x36853e++){var _0x1923d4=_0x58b959[_0xacdb('0x14')](_0xacdb('0x1a'),_0xacdb('0x1b')+_0x3bab21[_0x36853e]+_0xacdb('0x1c'));_0x58b959=_0x1923d4;}_0x1a6f3a[_0xacdb('0x19')]=_0x58b959;}_0xc0b57a[_0xacdb('0x1d')]=_0x1a6f3a[_0xacdb('0x19')];}else{_0xc0b57a[_0xacdb('0x1d')]=_0x1a6f3a['textAsHtml'];}if(_0xc0b57a[_0xacdb('0x1d')]){_0xc0b57a[_0xacdb('0x1d')]=_0xc0b57a[_0xacdb('0x1d')][_0xacdb('0x14')](/0x0){var _0x5c5d28=[_0xacdb('0x30'),_0xacdb('0x31'),'Precedence:\x20auto_reply'];for(var _0x1c2127=0x0;_0x1c2127<_0x1a6f3a[_0xacdb('0x2f')]['length'];_0x1c2127++){var _0x2f374e=_[_0xacdb('0x32')](_0x5c5d28,_0x1a6f3a[_0xacdb('0x2f')][_0x1c2127]['line']);if(_0x2f374e>=0x0){_0xc0b57a[_0xacdb('0x33')]=!![];}}}return _0xc0b57a;}exports['parser']=function(_0x10edf3,_0x10239a,_0x71b9f1){var _0x4e7466={'from':getAddress(_0x10239a['from']),'firstName':getFirstName(_0x10239a[_0xacdb('0x34')]),'lastName':getLastName(_0x10239a[_0xacdb('0x34')]),'mapKey':_0xacdb('0x4'),'message':{'from':getMails(_0x10edf3[_0xacdb('0x4')],_0x10239a[_0xacdb('0x34')]),'to':_0x10edf3[_0xacdb('0x4')],'cc':'','subject':_0x10239a[_0xacdb('0x35')]||'','messageId':_0x10239a[_0xacdb('0x36')],'inReplyTo':_0x10239a[_0xacdb('0x37')],'sentAt':moment(_0x10239a[_0xacdb('0x38')])[_0xacdb('0x26')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x10239a[_0xacdb('0x19')]&&!_0x10239a[_0xacdb('0x39')]){var _0x3f30cb=_[_0xacdb('0x3a')](_0x10239a[_0xacdb('0x16')],{'contentType':'application/ms-tnef'});if(_0x3f30cb[_0xacdb('0xe')]){logger['info'](util['format'](_0xacdb('0x3b'),_0x10239a[_0xacdb('0x36')]));tnef['parseBuffer'](_['first'](_0x3f30cb)[_0xacdb('0x2d')],function(_0xc108d1,_0x42b6b8){if(_0x42b6b8){_0x10239a[_0xacdb('0x19')]=_0x42b6b8[_0xacdb('0x3c')]||_0xacdb('0x3d');if(_0x42b6b8[_0xacdb('0x3e')]){for(var _0x4f10fe=0x0;_0x4f10fe<_0x42b6b8[_0xacdb('0x3e')][_0xacdb('0xe')];_0x4f10fe++){var _0x2ac456=_0x42b6b8[_0xacdb('0x3e')][_0x4f10fe];_0x4e7466['message'][_0xacdb('0x16')]['push']({'filename':_0x2ac456['Title'],'content':Buffer[_0xacdb('0x34')](_0x2ac456[_0xacdb('0x3f')])});}}}_0x71b9f1(parseEmail(_0x10edf3,_0x10239a,_0x4e7466));});}else{_0x10239a[_0xacdb('0x19')]='

Empty\x20message

';_0x71b9f1(parseEmail(_0x10edf3,_0x10239a,_0x4e7466));}}else{_0x71b9f1(parseEmail(_0x10edf3,_0x10239a,_0x4e7466));}};exports[_0xacdb('0x40')]=function(_0x203d70,_0x3a9ea1){var _0x3bc034=[_0xacdb('0x41')+(_0x3a9ea1||''),_0xacdb('0x42')+_0x203d70,'',''];return Buffer['from'](_0x3bc034[_0xacdb('0x29')](''),'utf-8')[_0xacdb('0x43')](_0xacdb('0x44'));}; \ No newline at end of file +var _0x5c95=['forEach','filename','_IMG','\x20[Attachment:\x20','body','textAsHtml','message','originTo','originCc','bcc','attach','type','attachment','attachment-','format','%s-%s','now','root','server/files/attachments/','push','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','messageId','date','YYYY-MM-DD\x20HH:mm:ss','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','content','BodyHTML','Attachments','Title','Data','

Empty\x20message

','generateXOAuth2Token','user=','auth=Bearer\x20','base64','lodash','randomstring','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','test','html','replace','includes','0x1?_0x377b21[_0x55c9('0x10')](0x0,-0x1)[_0x55c9('0x11')]('\x20'):_0x598dbf[_0x55c9('0xc')];}return _0x55c9('0x12');}function getLastName(_0x5700ce){var _0x3ab8a4=_[_0x55c9('0x6')](_0x5700ce[_0x55c9('0x7')]);if(_0x3ab8a4&&_0x3ab8a4[_0x55c9('0xc')]){var _0x58cbbf=_0x3ab8a4[_0x55c9('0xc')]['split'](/\s+/);return _0x58cbbf['length']>0x1?_0x58cbbf[_0x55c9('0x13')]():'';}return'';}function getMails(_0x55c7cb,_0x21d23d){var _0x9e9a7c='';for(var _0x3ee95d=0x0;_0x3ee95d<_0x21d23d[_0x55c9('0x7')]['length'];_0x3ee95d+=0x1){if(_0x21d23d['value'][_0x3ee95d][_0x55c9('0x8')]!==_0x55c7cb){if(!_[_0x55c9('0x14')](_0x9e9a7c)){_0x9e9a7c+=',';}_0x9e9a7c+=_0x21d23d['value'][_0x3ee95d][_0x55c9('0xc')]||_0x21d23d[_0x55c9('0x7')][_0x3ee95d][_0x55c9('0x8')]||'';_0x9e9a7c+='\x20<';_0x9e9a7c+=_0x21d23d['value'][_0x3ee95d][_0x55c9('0x8')]?_0x21d23d[_0x55c9('0x7')][_0x3ee95d][_0x55c9('0x8')]:_0x55c9('0x9')+random[_0x55c9('0xa')](0x6)+_0x55c9('0xb');_0x9e9a7c+='>';}}return _0x9e9a7c;}function parseEmail(_0x3a2e43,_0x5911a7,_0x12f09b){if(_0x5911a7['html']){var _0xea714c=/)<[^<]*)*<\/script>/gi;while(_0xea714c[_0x55c9('0x15')](_0x5911a7[_0x55c9('0x16')])){_0x5911a7[_0x55c9('0x16')]=_0x5911a7[_0x55c9('0x16')][_0x55c9('0x17')](_0xea714c,'');}if(_0x5911a7[_0x55c9('0x16')][_0x55c9('0x18')](_0x55c9('0x19'))){var _0x2f4a8e=[];_0x5911a7[_0x55c9('0x1a')][_0x55c9('0x1b')](_0x451fc4=>{_0x2f4a8e['push'](_0x451fc4[_0x55c9('0x1c')]);});var _0x134785=/]+>/g;var _0x12035c=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2f41d0=_0x5911a7[_0x55c9('0x16')][_0x55c9('0x17')](_0x12035c,'_SRC');var _0x3a79f7=_0x2f41d0[_0x55c9('0x17')](_0x134785,'_IMG');for(let _0x3a63cb=0x0;_0x3a63cb<_0x2f4a8e['length'];_0x3a63cb++){var _0x5c254d=_0x3a79f7['replace'](_0x55c9('0x1d'),_0x55c9('0x1e')+_0x2f4a8e[_0x3a63cb]+'\x20]');_0x3a79f7=_0x5c254d;}_0x5911a7[_0x55c9('0x16')]=_0x3a79f7;}_0x12f09b[_0x55c9('0x1f')]=_0x5911a7[_0x55c9('0x16')];}else{_0x12f09b[_0x55c9('0x1f')]=_0x5911a7[_0x55c9('0x20')];}if(_0x12f09b[_0x55c9('0x1f')]){_0x12f09b['body']=_0x12f09b[_0x55c9('0x1f')][_0x55c9('0x17')](/0x0){var _0xaeb766=[_0x55c9('0x31'),_0x55c9('0x32'),_0x55c9('0x33')];for(var _0x1d2c1e=0x0;_0x1d2c1e<_0x5911a7[_0x55c9('0x30')]['length'];_0x1d2c1e++){var _0x3b8999=_[_0x55c9('0xd')](_0xaeb766,_0x5911a7[_0x55c9('0x30')][_0x1d2c1e][_0x55c9('0x34')]);if(_0x3b8999>=0x0){_0x12f09b[_0x55c9('0x35')]=!![];}}}return _0x12f09b;}exports[_0x55c9('0x36')]=function(_0x4c3eb3,_0x37cf05,_0x3ed5b5){var _0x229617={'from':getAddress(_0x37cf05[_0x55c9('0x37')]),'firstName':getFirstName(_0x37cf05[_0x55c9('0x37')]),'lastName':getLastName(_0x37cf05[_0x55c9('0x37')]),'mapKey':_0x55c9('0x4'),'message':{'from':getMails(_0x4c3eb3[_0x55c9('0x4')],_0x37cf05[_0x55c9('0x37')]),'to':_0x4c3eb3[_0x55c9('0x4')],'cc':'','subject':_0x37cf05[_0x55c9('0x38')]||'','messageId':_0x37cf05[_0x55c9('0x39')],'inReplyTo':_0x37cf05['inReplyTo'],'sentAt':moment(_0x37cf05[_0x55c9('0x3a')])['format'](_0x55c9('0x3b')),'attach':![],'attachments':[]}};if(!_0x37cf05[_0x55c9('0x16')]&&!_0x37cf05[_0x55c9('0x20')]){var _0x3cf6e5=_[_0x55c9('0x3c')](_0x37cf05['attachments'],{'contentType':'application/ms-tnef'});if(_0x3cf6e5['length']){logger[_0x55c9('0x3d')](util[_0x55c9('0x29')](_0x55c9('0x3e'),_0x37cf05['messageId']));tnef[_0x55c9('0x3f')](_[_0x55c9('0x40')](_0x3cf6e5)[_0x55c9('0x41')],function(_0x33994a,_0x2dfd8d){if(_0x2dfd8d){_0x37cf05[_0x55c9('0x16')]=_0x2dfd8d[_0x55c9('0x42')]||'

Empty\x20message

';if(_0x2dfd8d[_0x55c9('0x43')]){for(var _0x123407=0x0;_0x123407<_0x2dfd8d['Attachments'][_0x55c9('0xf')];_0x123407++){var _0x925ddf=_0x2dfd8d[_0x55c9('0x43')][_0x123407];_0x229617['message'][_0x55c9('0x1a')][_0x55c9('0x2e')]({'filename':_0x925ddf[_0x55c9('0x44')],'content':Buffer[_0x55c9('0x37')](_0x925ddf[_0x55c9('0x45')])});}}}_0x3ed5b5(parseEmail(_0x4c3eb3,_0x37cf05,_0x229617));});}else{_0x37cf05[_0x55c9('0x16')]=_0x55c9('0x46');_0x3ed5b5(parseEmail(_0x4c3eb3,_0x37cf05,_0x229617));}}else{_0x3ed5b5(parseEmail(_0x4c3eb3,_0x37cf05,_0x229617));}};exports[_0x55c9('0x47')]=function(_0x2257c2,_0x34b51a){var _0x184ebc=[_0x55c9('0x48')+(_0x34b51a||''),_0x55c9('0x49')+_0x2257c2,'',''];return Buffer[_0x55c9('0x37')](_0x184ebc['join'](''),'utf-8')['toString'](_0x55c9('0x4a'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index c1e98bd..7211c4f 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 _0x1093=['name','Service','key','active','Imap','Smtp','exports'];(function(_0x2c1ab6,_0x2748ba){var _0x39be2d=function(_0x21130a){while(--_0x21130a){_0x2c1ab6['push'](_0x2c1ab6['shift']());}};_0x39be2d(++_0x2748ba);}(_0x1093,0xf5));var _0x3109=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0x1093[_0x186376];return _0x2dbdd9;};'use strict';var _=require('lodash');function MailAccount(_0x5ca36c){this['id']=_0x5ca36c['id']||0x0;this[_0x3109('0x0')]=_0x5ca36c['name']||_0x3109('0x1');this[_0x3109('0x2')]=_0x5ca36c['key']||'SERV';this[_0x3109('0x3')]=_0x5ca36c[_0x3109('0x3')]||![];this['Imap']=_0x5ca36c[_0x3109('0x4')]||[];this[_0x3109('0x5')]=_0x5ca36c[_0x3109('0x5')]||[];}module[_0x3109('0x6')]=MailAccount; \ No newline at end of file +var _0x8d3a=['Imap','Smtp','exports','name','Service','key','active'];(function(_0x4b7253,_0x40f708){var _0x29f09a=function(_0x18d91c){while(--_0x18d91c){_0x4b7253['push'](_0x4b7253['shift']());}};_0x29f09a(++_0x40f708);}(_0x8d3a,0x16f));var _0xa8d3=function(_0x48f32b,_0x579905){_0x48f32b=_0x48f32b-0x0;var _0x505f99=_0x8d3a[_0x48f32b];return _0x505f99;};'use strict';var _=require('lodash');function MailAccount(_0x1648d3){this['id']=_0x1648d3['id']||0x0;this[_0xa8d3('0x0')]=_0x1648d3[_0xa8d3('0x0')]||_0xa8d3('0x1');this['key']=_0x1648d3[_0xa8d3('0x2')]||'SERV';this['active']=_0x1648d3[_0xa8d3('0x3')]||![];this[_0xa8d3('0x4')]=_0x1648d3[_0xa8d3('0x4')]||[];this[_0xa8d3('0x5')]=_0x1648d3[_0xa8d3('0x5')]||[];}module[_0xa8d3('0x6')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 2122301..1171d2a 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 _0xeedd=['prototype','mergeFromDatabase','initMailAccounts','length','merge','exports','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty'];(function(_0x2e9658,_0x2f221a){var _0x2b4287=function(_0x213a15){while(--_0x213a15){_0x2e9658['push'](_0x2e9658['shift']());}};_0x2b4287(++_0x2f221a);}(_0xeedd,0x132));var _0xdeed=function(_0xdc3631,_0x5daf4e){_0xdc3631=_0xdc3631-0x0;var _0x4e5258=_0xeedd[_0xdc3631];return _0x4e5258;};'use strict';var _=require('lodash');var MailAccount=require(_0xdeed('0x0'));var Realtime=function(){this[_0xdeed('0x1')]={};};function freeIsNotKey(_0xbf8e66,_0x19f0ab,_0x2fe01e){var _0x19a93b=_[_0xdeed('0x2')](_0xbf8e66,function(_0x6be0c9,_0x2ca93c){return _0x6be0c9[_0x2fe01e];});for(var _0x57a5fd in _0x19f0ab){if(_0x19f0ab[_0xdeed('0x3')](_0x57a5fd)){if(!_0x19a93b[_0x57a5fd]){delete _0x19f0ab[_0x57a5fd];}}}}Realtime[_0xdeed('0x4')][_0xdeed('0x5')]=function(_0x1f654e,_0x330720){for(var _0x1e4277 in _0x330720){if(_0x1f654e[_0xdeed('0x3')](_0x1e4277)){_0x1f654e[_0x1e4277]=_0x330720[_0x1e4277];}}};Realtime[_0xdeed('0x4')][_0xdeed('0x6')]=function(){var _0x4f7b3c=this;return function(_0x259e3c){if(_0x259e3c){freeIsNotKey(_0x259e3c,_0x4f7b3c[_0xdeed('0x1')],'id');for(var _0x5d576e=0x0,_0x326702={},_0x41aa56={};_0x5d576e<_0x259e3c[_0xdeed('0x7')];_0x5d576e+=0x1){_0x326702=_0x259e3c[_0x5d576e];if(_['isUndefined'](_0x4f7b3c[_0xdeed('0x1')][_0x326702['id']])){_0x4f7b3c['mailAccounts'][_0x326702['id']]=new MailAccount(_0x326702);}else{_[_0xdeed('0x8')](_0x4f7b3c[_0xdeed('0x1')][_0x326702['id']],_0x326702);}}}return _0x4f7b3c[_0xdeed('0x1')];};};module[_0xdeed('0x9')]=Realtime; \ No newline at end of file +var _0x4056=['mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts'];(function(_0x5dbc67,_0x12dd29){var _0x8782a5=function(_0x6df0d8){while(--_0x6df0d8){_0x5dbc67['push'](_0x5dbc67['shift']());}};_0x8782a5(++_0x12dd29);}(_0x4056,0x75));var _0x6405=function(_0xb53fb1,_0x58a815){_0xb53fb1=_0xb53fb1-0x0;var _0x5579b5=_0x4056[_0xb53fb1];return _0x5579b5;};'use strict';var _=require(_0x6405('0x0'));var MailAccount=require(_0x6405('0x1'));var Realtime=function(){this[_0x6405('0x2')]={};};function freeIsNotKey(_0x490cf1,_0x447c0b,_0x10d810){var _0x4f99ae=_[_0x6405('0x3')](_0x490cf1,function(_0x1cd633,_0x3bbe29){return _0x1cd633[_0x10d810];});for(var _0x33cd52 in _0x447c0b){if(_0x447c0b[_0x6405('0x4')](_0x33cd52)){if(!_0x4f99ae[_0x33cd52]){delete _0x447c0b[_0x33cd52];}}}}Realtime[_0x6405('0x5')][_0x6405('0x6')]=function(_0x15e53,_0x1f0bbf){for(var _0x1d6ba7 in _0x1f0bbf){if(_0x15e53['hasOwnProperty'](_0x1d6ba7)){_0x15e53[_0x1d6ba7]=_0x1f0bbf[_0x1d6ba7];}}};Realtime['prototype'][_0x6405('0x7')]=function(){var _0x50968d=this;return function(_0x35b77a){if(_0x35b77a){freeIsNotKey(_0x35b77a,_0x50968d[_0x6405('0x2')],'id');for(var _0xf66479=0x0,_0x347537={},_0x23adce={};_0xf66479<_0x35b77a[_0x6405('0x8')];_0xf66479+=0x1){_0x347537=_0x35b77a[_0xf66479];if(_[_0x6405('0x9')](_0x50968d[_0x6405('0x2')][_0x347537['id']])){_0x50968d[_0x6405('0x2')][_0x347537['id']]=new MailAccount(_0x347537);}else{_[_0x6405('0xa')](_0x50968d[_0x6405('0x2')][_0x347537['id']],_0x347537);}}}return _0x50968d[_0x6405('0x2')];};};module[_0x6405('0xb')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index aabe89b..128b86c 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 _0xe5a6=['../client','getMailAccounts','Request','GetMailAccount','name','provider','email','active','ListId','TemplateId','MailServerIn','Imap','CloudProvider','service','type','Smtp','data5','getMailAccount','notify','NotifyMailAccount'];(function(_0x48ae80,_0x4b9d9d){var _0xaa6e26=function(_0x3dd05f){while(--_0x3dd05f){_0x48ae80['push'](_0x48ae80['shift']());}};_0xaa6e26(++_0x4b9d9d);}(_0xe5a6,0x104));var _0x6e5a=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0xe5a6[_0x15ea09];return _0x3e9c78;};'use strict';var client=require(_0x6e5a('0x0'));exports[_0x6e5a('0x1')]=function(){return function(){return client[_0x6e5a('0x2')](_0x6e5a('0x3'),{'options':{'attributes':['id',_0x6e5a('0x4'),_0x6e5a('0x5'),'service',_0x6e5a('0x6'),_0x6e5a('0x7'),'key',_0x6e5a('0x8'),_0x6e5a('0x9')],'raw':![],'include':[{'model':_0x6e5a('0xa'),'as':_0x6e5a('0xb'),'include':[{'model':_0x6e5a('0xc'),'attributes':['id',_0x6e5a('0x4'),_0x6e5a('0xd'),_0x6e5a('0xe'),'data5'],'as':'CloudProvider'}]},{'model':'MailServerOut','as':_0x6e5a('0xf'),'include':[{'model':'CloudProvider','attributes':['id',_0x6e5a('0x4'),_0x6e5a('0xd'),_0x6e5a('0xe'),_0x6e5a('0x10')],'as':'CloudProvider'}]}]},'log':_0x6e5a('0x11')});};};exports[_0x6e5a('0x12')]=function(_0x46a228,_0x25590f){return client[_0x6e5a('0x2')]('NotifyMailAccount',{'account':{'id':_0x46a228},'body':_0x25590f,'log':_0x6e5a('0x13')});}; \ No newline at end of file +var _0x4af9=['active','key','ListId','MailServerIn','Imap','CloudProvider','type','data5','notify','Request','NotifyMailAccount','../client','getMailAccounts','name','provider','service','email'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4af9,0x12c));var _0x94af=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4af9[_0x3bf83f];return _0x22c4a9;};'use strict';var client=require(_0x94af('0x0'));exports[_0x94af('0x1')]=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id',_0x94af('0x2'),_0x94af('0x3'),_0x94af('0x4'),_0x94af('0x5'),_0x94af('0x6'),_0x94af('0x7'),_0x94af('0x8'),'TemplateId'],'raw':![],'include':[{'model':_0x94af('0x9'),'as':_0x94af('0xa'),'include':[{'model':_0x94af('0xb'),'attributes':['id',_0x94af('0x2'),'service',_0x94af('0xc'),_0x94af('0xd')],'as':_0x94af('0xb')}]},{'model':'MailServerOut','as':'Smtp','include':[{'model':_0x94af('0xb'),'attributes':['id',_0x94af('0x2'),_0x94af('0x4'),_0x94af('0xc'),_0x94af('0xd')],'as':_0x94af('0xb')}]}]},'log':'getMailAccount'});};};exports[_0x94af('0xe')]=function(_0x3a1610,_0x5a67e5){return client[_0x94af('0xf')](_0x94af('0x10'),{'account':{'id':_0x3a1610},'body':_0x5a67e5,'log':_0x94af('0x10')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 8c38200..4260d4e 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 _0x368b=['../client','getSettings','Request','loginMailFrequency'];(function(_0xca6909,_0x31d421){var _0x44d08e=function(_0x528844){while(--_0x528844){_0xca6909['push'](_0xca6909['shift']());}};_0x44d08e(++_0x31d421);}(_0x368b,0x1c0));var _0xb368=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x368b[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xb368('0x0'));exports[_0xb368('0x1')]=function(){return client[_0xb368('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb368('0x3')]},'log':'GetSettings'});}; \ No newline at end of file +var _0xdd6e=['GetSettings','Request','ShowSetting','loginMailFrequency'];(function(_0x51655a,_0x428e93){var _0x47bc17=function(_0x453e9f){while(--_0x453e9f){_0x51655a['push'](_0x51655a['shift']());}};_0x47bc17(++_0x428e93);}(_0xdd6e,0xe5));var _0xedd6=function(_0x5baaf7,_0x3fa8b0){_0x5baaf7=_0x5baaf7-0x0;var _0x4406c6=_0xdd6e[_0x5baaf7];return _0x4406c6;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0xedd6('0x0')](_0xedd6('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xedd6('0x2')]},'log':_0xedd6('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 9a28190..87d4bed 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(_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 +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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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 cb1b653..e9841bf 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 _0x1b52=['timeout','listen','port','socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../routes','once','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer'];(function(_0x3b69cb,_0x348a92){var _0x387672=function(_0x166279){while(--_0x166279){_0x3b69cb['push'](_0x3b69cb['shift']());}};_0x387672(++_0x348a92);}(_0x1b52,0xc1));var _0x21b5=function(_0xfb42e6,_0x5f5d4b){_0xfb42e6=_0xfb42e6-0x0;var _0x27265b=_0x1b52[_0xfb42e6];return _0x27265b;};'use strict';var _=require(_0x21b5('0x0'));var http=require(_0x21b5('0x1'));var express=require(_0x21b5('0x2'));var sticky=require(_0x21b5('0x3'));var Redis=require(_0x21b5('0x4'));var config=require(_0x21b5('0x5'));var app=express();var server=http[_0x21b5('0x6')](app);server[_0x21b5('0x7')]=0xdbba0;if(sticky[_0x21b5('0x8')](server,config[_0x21b5('0x9')])){var socketio=require(_0x21b5('0xa'))(server,{'transports':[_0x21b5('0xb'),_0x21b5('0xc')]});config[_0x21b5('0xd')]=_[_0x21b5('0xe')](config[_0x21b5('0xd')],{'host':_0x21b5('0xf'),'port':0x18eb});socketio[_0x21b5('0x10')](require(_0x21b5('0x11'))({'pubClient':new Redis(config[_0x21b5('0xd')]),'subClient':new Redis(config['redis'])}));require(_0x21b5('0x12'))[_0x21b5('0x13')]();require(_0x21b5('0x14'))[_0x21b5('0x13')](socketio);require('../../config/express')[_0x21b5('0x13')](app);require(_0x21b5('0x15'))[_0x21b5('0x13')](app);}else{server[_0x21b5('0x16')]('listening',function(){console['log'](_0x21b5('0x17'),config['port']);});}exports=module[_0x21b5('0x18')]=app; \ No newline at end of file +var _0xb95e=['express','ioredis','createServer','timeout','listen','polling','redis','defaults','localhost','adapter','../../config/triggers','../../config/socketio','default','../../config/express','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','http'];(function(_0x612d75,_0x429c60){var _0x42c85f=function(_0x2ba28f){while(--_0x2ba28f){_0x612d75['push'](_0x612d75['shift']());}};_0x42c85f(++_0x429c60);}(_0xb95e,0x132));var _0xeb95=function(_0x156193,_0x40ad2a){_0x156193=_0x156193-0x0;var _0x472822=_0xb95e[_0x156193];return _0x472822;};'use strict';var _=require(_0xeb95('0x0'));var http=require(_0xeb95('0x1'));var express=require(_0xeb95('0x2'));var sticky=require('sticky-session');var Redis=require(_0xeb95('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0xeb95('0x4')](app);server[_0xeb95('0x5')]=0xdbba0;if(sticky[_0xeb95('0x6')](server,config['port'])){var socketio=require('socket.io')(server,{'transports':['websocket',_0xeb95('0x7')]});config[_0xeb95('0x8')]=_[_0xeb95('0x9')](config[_0xeb95('0x8')],{'host':_0xeb95('0xa'),'port':0x18eb});socketio[_0xeb95('0xb')](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require(_0xeb95('0xc'))['default']();require(_0xeb95('0xd'))[_0xeb95('0xe')](socketio);require(_0xeb95('0xf'))[_0xeb95('0xe')](app);require('../../routes')[_0xeb95('0xe')](app);}else{server[_0xeb95('0x10')](_0xeb95('0x11'),function(){console[_0xeb95('0x12')](_0xeb95('0x13'),config[_0xeb95('0x14')]);});}exports=module[_0xeb95('0x15')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 6807147..37597f8 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 _0x0f7c=['result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','Request','request','then','debug','error','rpc','message'];(function(_0x26ec0e,_0x55d2e3){var _0x4da538=function(_0x2aecf0){while(--_0x2aecf0){_0x26ec0e['push'](_0x26ec0e['shift']());}};_0x4da538(++_0x55d2e3);}(_0x0f7c,0x16b));var _0xc0f7=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x0f7c[_0x178e48];return _0x440d7e;};'use strict';var jayson=require(_0xc0f7('0x0'));var BPromise=require(_0xc0f7('0x1'));var logger=require(_0xc0f7('0x2'))(_0xc0f7('0x3'));var client=jayson[_0xc0f7('0x4')]['http']({'port':0x2329});client[_0xc0f7('0x5')]=function(_0x536e89,_0x1944b2){return new BPromise(function(_0x147a22,_0x195c36){return client[_0xc0f7('0x6')](_0x536e89,_0x1944b2)[_0xc0f7('0x7')](function(_0x2f0103){logger[_0xc0f7('0x8')]('rpc',_0xc0f7('0x3'),_0x536e89,_0x1944b2,_0x2f0103);if(_0x2f0103[_0xc0f7('0x9')]){logger[_0xc0f7('0x9')](_0xc0f7('0xa'),'routing',_0x536e89,_0x2f0103[_0xc0f7('0x9')][_0xc0f7('0xb')],_0x1944b2);return _0x195c36(_0x2f0103['error']['message']);}else{return _0x147a22(_0x2f0103[_0xc0f7('0xc')]);}})[_0xc0f7('0xd')](function(_0x24c30e){logger[_0xc0f7('0x9')](_0xc0f7('0xa'),_0xc0f7('0x3'),_0x536e89,_0x24c30e,_0x1944b2);return _0x195c36(_0x24c30e);});});};module[_0xc0f7('0xe')]=client; \ No newline at end of file +var _0x2d85=['catch','exports','jayson/promise','../../config/logger','routing','http','Request','request','then','rpc','error'];(function(_0x21001b,_0x3ff1a8){var _0x665a00=function(_0x98d912){while(--_0x98d912){_0x21001b['push'](_0x21001b['shift']());}};_0x665a00(++_0x3ff1a8);}(_0x2d85,0x91));var _0x52d8=function(_0x1d1d3c,_0x69ec46){_0x1d1d3c=_0x1d1d3c-0x0;var _0x409280=_0x2d85[_0x1d1d3c];return _0x409280;};'use strict';var jayson=require(_0x52d8('0x0'));var BPromise=require('bluebird');var logger=require(_0x52d8('0x1'))(_0x52d8('0x2'));var client=jayson['client'][_0x52d8('0x3')]({'port':0x2329});client[_0x52d8('0x4')]=function(_0x1c0b59,_0x4e0185){return new BPromise(function(_0x3af091,_0x3eb6f2){return client[_0x52d8('0x5')](_0x1c0b59,_0x4e0185)[_0x52d8('0x6')](function(_0x11c31b){logger['debug'](_0x52d8('0x7'),_0x52d8('0x2'),_0x1c0b59,_0x4e0185,_0x11c31b);if(_0x11c31b['error']){logger[_0x52d8('0x8')]('rpc',_0x52d8('0x2'),_0x1c0b59,_0x11c31b[_0x52d8('0x8')]['message'],_0x4e0185);return _0x3eb6f2(_0x11c31b[_0x52d8('0x8')]['message']);}else{return _0x3af091(_0x11c31b['result']);}})[_0x52d8('0x9')](function(_0x3636c5){logger[_0x52d8('0x8')]('rpc',_0x52d8('0x2'),_0x1c0b59,_0x3636c5,_0x4e0185);return _0x3eb6f2(_0x3636c5);});});};module[_0x52d8('0xa')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index dd2e8d3..c245729 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 _0x87c7=['getOpenchannelQueues','initChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','bluebird','./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','initAgents','getIntervals'];(function(_0xed48c5,_0x49ed30){var _0x49cdb5=function(_0x44a522){while(--_0x44a522){_0xed48c5['push'](_0xed48c5['shift']());}};_0x49cdb5(++_0x49ed30);}(_0x87c7,0xcf));var _0x787c=function(_0x383e89,_0x78784c){_0x383e89=_0x383e89-0x0;var _0x3bfbca=_0x87c7[_0x383e89];return _0x3bfbca;};'use strict';var BPromise=require(_0x787c('0x0'));var server=require(_0x787c('0x1'));var Realtime=require(_0x787c('0x2'));var user=require('./rpc/user');var interval=require(_0x787c('0x3'));var openchannelQueue=require(_0x787c('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x787c('0x5'));var mailQueue=require(_0x787c('0x6'));var faxQueue=require(_0x787c('0x7'));var whatsappQueue=require(_0x787c('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x787c('0x9')]()[_0x787c('0xa')](user['getAgents']())[_0x787c('0xa')](realtime[_0x787c('0xb')]())[_0x787c('0xa')](interval[_0x787c('0xc')]())['then'](realtime['initIntervals']())[_0x787c('0xa')](openchannelQueue[_0x787c('0xd')]())[_0x787c('0xa')](realtime['initOpenchannelQueues']())[_0x787c('0xa')](chatQueue['getChatQueues']())[_0x787c('0xa')](realtime[_0x787c('0xe')]())['then'](smsQueue['getSmsQueues']())[_0x787c('0xa')](realtime[_0x787c('0xf')]())['then'](mailQueue[_0x787c('0x10')]())[_0x787c('0xa')](realtime[_0x787c('0x11')]())[_0x787c('0xa')](faxQueue[_0x787c('0x12')]())[_0x787c('0xa')](realtime[_0x787c('0x13')]())[_0x787c('0xa')](whatsappQueue['getWhatsappQueues']())[_0x787c('0xa')](realtime['initWhatsappQueues']())[_0x787c('0xa')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x787c('0xa')](function(_0x5914e3){return initRealtime();})[_0x787c('0xa')](function(_0x3b6f85){return setInterval(initRealtime,0x1388);})['catch'](function(_0x1fdba4){console['log'](_0x1fdba4);});}main(); \ No newline at end of file +var _0x894c=['getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','getSmsQueues','getMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','initAgents','then'];(function(_0x45cbf3,_0x55fdc1){var _0x73323b=function(_0x502d20){while(--_0x502d20){_0x45cbf3['push'](_0x45cbf3['shift']());}};_0x73323b(++_0x55fdc1);}(_0x894c,0x7a));var _0xc894=function(_0x3aa73e,_0x33a0e8){_0x3aa73e=_0x3aa73e-0x0;var _0x2144db=_0x894c[_0x3aa73e];return _0x2144db;};'use strict';var BPromise=require(_0xc894('0x0'));var server=require(_0xc894('0x1'));var Realtime=require(_0xc894('0x2'));var user=require(_0xc894('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require(_0xc894('0x4'));var chatQueue=require(_0xc894('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xc894('0x6'));var faxQueue=require(_0xc894('0x7'));var whatsappQueue=require(_0xc894('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xc894('0x9')]()['then'](user[_0xc894('0xa')]())['then'](realtime[_0xc894('0xb')]())[_0xc894('0xc')](interval[_0xc894('0xd')]())[_0xc894('0xc')](realtime[_0xc894('0xe')]())[_0xc894('0xc')](openchannelQueue[_0xc894('0xf')]())[_0xc894('0xc')](realtime[_0xc894('0x10')]())['then'](chatQueue[_0xc894('0x11')]())[_0xc894('0xc')](realtime['initChatQueues']())[_0xc894('0xc')](smsQueue[_0xc894('0x12')]())['then'](realtime['initSmsQueues']())[_0xc894('0xc')](mailQueue[_0xc894('0x13')]())[_0xc894('0xc')](realtime['initMailQueues']())['then'](faxQueue[_0xc894('0x14')]())['then'](realtime[_0xc894('0x15')]())[_0xc894('0xc')](whatsappQueue[_0xc894('0x16')]())[_0xc894('0xc')](realtime[_0xc894('0x17')]())[_0xc894('0xc')](function(){return realtime;});}function main(){return server[_0xc894('0x18')](realtime)[_0xc894('0xc')](function(_0x3bd5c7){return initRealtime();})['then'](function(_0x282e79){return setInterval(initRealtime,0x1388);})[_0xc894('0x19')](function(_0x2a58b1){console[_0xc894('0x1a')](_0x2a58b1);});}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 48d856e..984d523 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 _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x554f40,_0x4269d6){var _0x9b300f=function(_0x313193){while(--_0x313193){_0x554f40['push'](_0x554f40['shift']());}};_0x9b300f(++_0x4269d6);}(_0xe14b,0x93));var _0xbe14=function(_0x104238,_0x252c50){_0x104238=_0x104238-0x0;var _0x43910b=_0xe14b[_0x104238];return _0x43910b;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file +var _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x24041a,_0xbd8af0){var _0x56fcae=function(_0x2538da){while(--_0x2538da){_0x24041a['push'](_0x24041a['shift']());}};_0x56fcae(++_0xbd8af0);}(_0x7a54,0x106));var _0x47a5=function(_0x331d13,_0xfa22c5){_0x331d13=_0x331d13-0x0;var _0x4af22e=_0x7a54[_0x331d13];return _0x4af22e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 9e4f925..186e2ac 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 _0x2902=['SendMail','bluebird','jayson/promise','client','request','then','error','message','result','sendMailMessage'];(function(_0x3d5d43,_0x9d65ef){var _0x54cebc=function(_0x27984e){while(--_0x27984e){_0x3d5d43['push'](_0x3d5d43['shift']());}};_0x54cebc(++_0x9d65ef);}(_0x2902,0x191));var _0x2290=function(_0x22377a,_0x3397cb){_0x22377a=_0x22377a-0x0;var _0x36f105=_0x2902[_0x22377a];return _0x36f105;};'use strict';var BPromise=require(_0x2290('0x0'));var jayson=require(_0x2290('0x1'));var client=jayson[_0x2290('0x2')]['http']({'port':0x232b});function request(_0x280520,_0x11a6ae){return new BPromise(function(_0x3707be,_0x3ab567){return client[_0x2290('0x3')](_0x280520,_0x11a6ae)[_0x2290('0x4')](function(_0x19c20c){if(_0x19c20c[_0x2290('0x5')]){return _0x3ab567(_0x19c20c['error'][_0x2290('0x6')]);}else{return _0x3707be(_0x19c20c[_0x2290('0x7')]);}})['catch'](function(_0x169fcb){return _0x3ab567(_0x169fcb);});});}exports[_0x2290('0x8')]=function(_0x59f372,_0x2e4363){return request(_0x2290('0x9'),{'account':_0x59f372,'message':_0x2e4363});}; \ No newline at end of file +var _0x4bdb=['catch','sendMailMessage','jayson/promise','http','request','then','error','message','result'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4bdb,0x1df));var _0xb4bd=function(_0x41af5c,_0x48567a){_0x41af5c=_0x41af5c-0x0;var _0x29c2e6=_0x4bdb[_0x41af5c];return _0x29c2e6;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xb4bd('0x0'));var client=jayson['client'][_0xb4bd('0x1')]({'port':0x232b});function request(_0x187871,_0x5007ff){return new BPromise(function(_0x54524a,_0x3d6868){return client[_0xb4bd('0x2')](_0x187871,_0x5007ff)[_0xb4bd('0x3')](function(_0x38166d){if(_0x38166d[_0xb4bd('0x4')]){return _0x3d6868(_0x38166d[_0xb4bd('0x4')][_0xb4bd('0x5')]);}else{return _0x54524a(_0x38166d[_0xb4bd('0x6')]);}})[_0xb4bd('0x7')](function(_0x33ad4a){return _0x3d6868(_0x33ad4a);});});}exports[_0xb4bd('0x8')]=function(_0x585820,_0x5441e0){return request('SendMail',{'account':_0x585820,'message':_0x5441e0});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index d62df05..6578318 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 _0x8903=['getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','updateRealtime','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','chatStatusTime','mailCapacity','faxStatus','faxStatusTime','smsCurrentCapacity','whatsappStatus','openchannelCurrentCapacity','mailWaitingInteractions','smsWaitingInteractions','stringify','emit','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','defaults','redis','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCurrentCapacity','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','openchannelWaitingInteractions','whatsappWaitingInteractions','prototype'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x8903,0xed));var _0x3890=function(_0x40ff3b,_0x238af7){_0x40ff3b=_0x40ff3b-0x0;var _0x3ccf4f=_0x8903[_0x40ff3b];return _0x3ccf4f;};'use strict';var _=require(_0x3890('0x0'));var moment=require(_0x3890('0x1'));var md5=require(_0x3890('0x2'));var Redis=require(_0x3890('0x3'));var config=require(_0x3890('0x4'));config['redis']=_[_0x3890('0x5')](config[_0x3890('0x6')],{'host':_0x3890('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3890('0x6')]));function Agent(_0x48ed65){this['id']=_0x48ed65['id']||0x0;this[_0x3890('0x8')]=_0x48ed65[_0x3890('0x8')]||'';this[_0x3890('0x9')]=_0x48ed65[_0x3890('0x9')]||!![];this[_0x3890('0xa')]=_0x48ed65[_0x3890('0xa')]||![];this[_0x3890('0xb')]=_0x48ed65['chatPause']||![];this[_0x3890('0xc')]=_0x48ed65[_0x3890('0xc')]||![];this[_0x3890('0xd')]=_0x48ed65['faxPause']||![];this[_0x3890('0xe')]=_0x48ed65[_0x3890('0xe')]||![];this[_0x3890('0xf')]=_0x48ed65['openchannelPause']||![];this[_0x3890('0x10')]=_0x3890('0x11');this['chatStatusTime']=0x0;this['chatCapacity']=_0x48ed65[_0x3890('0x12')]||0x0;this[_0x3890('0x13')]=0x0;this[_0x3890('0x14')]=_0x3890('0x11');this[_0x3890('0x15')]=0x0;this['mailCapacity']=_0x48ed65['mailCapacity']||0x0;this[_0x3890('0x16')]=0x0;this['faxStatus']=_0x3890('0x11');this['faxStatusTime']=0x0;this[_0x3890('0x17')]=_0x48ed65[_0x3890('0x17')]||0x0;this[_0x3890('0x18')]=0x0;this[_0x3890('0x19')]=_0x3890('0x11');this['smsStatusTime']=0x0;this[_0x3890('0x1a')]=_0x48ed65[_0x3890('0x1a')]||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']='unknown';this[_0x3890('0x1b')]=0x0;this['whatsappCapacity']=_0x48ed65[_0x3890('0x1c')]||0x0;this[_0x3890('0x1d')]=0x0;this['openchannelStatus']='unknown';this[_0x3890('0x1e')]=0x0;this[_0x3890('0x1f')]=_0x48ed65[_0x3890('0x1f')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x3890('0x20')]=![];this[_0x3890('0x21')]=undefined;this[_0x3890('0x2')]='';this[_0x3890('0x22')]={};this[_0x3890('0x23')]={};this['mailWaitingInteractions']={};this[_0x3890('0x24')]={};this['smsWaitingInteractions']={};this[_0x3890('0x25')]={};this['updateRealtime']();}Agent[_0x3890('0x26')][_0x3890('0x27')]=function(_0x19459f){if(this[_0x19459f+_0x3890('0x28')]>0x0){if(this[_0x19459f+_0x3890('0x29')]>0x0&&this[_0x19459f+_0x3890('0x28')]>=this[_0x19459f+'Capacity']){return _0x3890('0x2a');}else{return _0x3890('0x2b');}}else{return _0x3890('0x2c');}};Agent['prototype'][_0x3890('0x2d')]=function(){var _0x34765e=['mail',_0x3890('0x2e'),_0x3890('0x2f'),_0x3890('0x30'),_0x3890('0x31'),_0x3890('0x32')];for(var _0x3e3c8c=0x0;_0x3e3c8c<_0x34765e[_0x3890('0x33')];_0x3e3c8c+=0x1){var _0x297b0a=this[_0x3890('0x27')](_0x34765e[_0x3e3c8c]);if(this[_0x34765e[_0x3e3c8c]+_0x3890('0x34')]!==_0x297b0a){this[_0x34765e[_0x3e3c8c]+_0x3890('0x35')]=_[_0x3890('0x36')](moment()[_0x3890('0x37')]('x'));}this[_0x34765e[_0x3e3c8c]+_0x3890('0x34')]=_0x297b0a;}var _0x4cc905={'id':this['id'],'name':this[_0x3890('0x8')],'online':this[_0x3890('0x9')],'voicePause':this[_0x3890('0xa')],'chatPause':this['chatPause'],'mailPause':this[_0x3890('0xc')],'smsPause':this['smsPause'],'faxPause':this[_0x3890('0xd')],'openchannelPause':this[_0x3890('0xf')],'chatStatus':this[_0x3890('0x10')],'chatStatusTime':this[_0x3890('0x38')],'chatCapacity':this[_0x3890('0x12')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x3890('0x14')],'mailStatusTime':this[_0x3890('0x15')],'mailCapacity':this[_0x3890('0x39')],'mailCurrentCapacity':this[_0x3890('0x16')],'faxStatus':this[_0x3890('0x3a')],'faxStatusTime':this[_0x3890('0x3b')],'faxCapacity':this[_0x3890('0x17')],'faxCurrentCapacity':this[_0x3890('0x18')],'smsStatus':this[_0x3890('0x19')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x3890('0x1a')],'smsCurrentCapacity':this[_0x3890('0x3c')],'whatsappStatus':this[_0x3890('0x3d')],'whatsappStatusTime':this[_0x3890('0x1b')],'whatsappCapacity':this[_0x3890('0x1c')],'whatsappCurrentCapacity':this[_0x3890('0x1d')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x3890('0x1e')],'openchannelCapacity':this[_0x3890('0x1f')],'openchannelCurrentCapacity':this[_0x3890('0x3e')],'busy':this[_0x3890('0x20')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x3890('0x22')],'faxWaitingInteractions':this[_0x3890('0x23')],'mailWaitingInteractions':this[_0x3890('0x3f')],'openchannelWaitingInteractions':this[_0x3890('0x24')],'smsWaitingInteractions':this[_0x3890('0x40')],'whatsappWaitingInteractions':this[_0x3890('0x25')]};var _0x27013c=md5(JSON[_0x3890('0x41')](_0x4cc905));if(this[_0x3890('0x2')]!==_0x27013c){this[_0x3890('0x2')]=_0x27013c;io[_0x3890('0x42')](_0x3890('0x43'),_0x4cc905);}};module[_0x3890('0x44')]=Agent; \ No newline at end of file +var _0x1f70=['ioredis','../../../config/environment','redis','defaults','localhost','name','online','voicePause','chatPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatus','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','whatsappWaitingInteractions','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','mailPause','chatCurrentCapacity','mailCurrentCapacity','smsStatusTime','whatsappCurrentCapacity','busyQueue','smsWaitingInteractions','stringify','emit','user:save','exports','moment','md5'];(function(_0x303064,_0x12f0c2){var _0x5a1d3d=function(_0x5b9d81){while(--_0x5b9d81){_0x303064['push'](_0x303064['shift']());}};_0x5a1d3d(++_0x12f0c2);}(_0x1f70,0x1be));var _0x01f7=function(_0x5ae27c,_0x408069){_0x5ae27c=_0x5ae27c-0x0;var _0xd79b05=_0x1f70[_0x5ae27c];return _0xd79b05;};'use strict';var _=require('lodash');var moment=require(_0x01f7('0x0'));var md5=require(_0x01f7('0x1'));var Redis=require(_0x01f7('0x2'));var config=require(_0x01f7('0x3'));config[_0x01f7('0x4')]=_[_0x01f7('0x5')](config[_0x01f7('0x4')],{'host':_0x01f7('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x01f7('0x4')]));function Agent(_0x239a06){this['id']=_0x239a06['id']||0x0;this[_0x01f7('0x7')]=_0x239a06['name']||'';this[_0x01f7('0x8')]=_0x239a06['online']||!![];this[_0x01f7('0x9')]=_0x239a06[_0x01f7('0x9')]||![];this[_0x01f7('0xa')]=_0x239a06[_0x01f7('0xa')]||![];this['mailPause']=_0x239a06['mailPause']||![];this['faxPause']=_0x239a06[_0x01f7('0xb')]||![];this[_0x01f7('0xc')]=_0x239a06[_0x01f7('0xc')]||![];this['openchannelPause']=_0x239a06[_0x01f7('0xd')]||![];this[_0x01f7('0xe')]=_0x01f7('0xf');this[_0x01f7('0x10')]=0x0;this[_0x01f7('0x11')]=_0x239a06[_0x01f7('0x11')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x01f7('0x12')]=_0x01f7('0xf');this['mailStatusTime']=0x0;this[_0x01f7('0x13')]=_0x239a06[_0x01f7('0x13')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x01f7('0x14')]=_0x01f7('0xf');this[_0x01f7('0x15')]=0x0;this[_0x01f7('0x16')]=_0x239a06[_0x01f7('0x16')]||0x0;this[_0x01f7('0x17')]=0x0;this[_0x01f7('0x18')]='unknown';this['smsStatusTime']=0x0;this[_0x01f7('0x19')]=_0x239a06[_0x01f7('0x19')]||0x0;this[_0x01f7('0x1a')]=0x0;this[_0x01f7('0x1b')]='unknown';this['whatsappStatusTime']=0x0;this['whatsappCapacity']=_0x239a06[_0x01f7('0x1c')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x01f7('0x1d')]='unknown';this['openchannelStatusTime']=0x0;this[_0x01f7('0x1e')]=_0x239a06[_0x01f7('0x1e')]||0x0;this[_0x01f7('0x1f')]=0x0;this[_0x01f7('0x20')]=![];this['busyQueue']=undefined;this['md5']='';this[_0x01f7('0x21')]={};this[_0x01f7('0x22')]={};this[_0x01f7('0x23')]={};this[_0x01f7('0x24')]={};this['smsWaitingInteractions']={};this[_0x01f7('0x25')]={};this['updateRealtime']();}Agent['prototype'][_0x01f7('0x26')]=function(_0x45cc20){if(this[_0x45cc20+_0x01f7('0x27')]>0x0){if(this[_0x45cc20+'Capacity']>0x0&&this[_0x45cc20+'CurrentCapacity']>=this[_0x45cc20+_0x01f7('0x28')]){return _0x01f7('0x29');}else{return _0x01f7('0x2a');}}else{return _0x01f7('0x2b');}};Agent['prototype']['updateRealtime']=function(){var _0x2dd873=['mail','chat',_0x01f7('0x2c'),_0x01f7('0x2d'),_0x01f7('0x2e'),_0x01f7('0x2f')];for(var _0xa33143=0x0;_0xa33143<_0x2dd873[_0x01f7('0x30')];_0xa33143+=0x1){var _0x517ac3=this[_0x01f7('0x26')](_0x2dd873[_0xa33143]);if(this[_0x2dd873[_0xa33143]+_0x01f7('0x31')]!==_0x517ac3){this[_0x2dd873[_0xa33143]+_0x01f7('0x32')]=_[_0x01f7('0x33')](moment()[_0x01f7('0x34')]('x'));}this[_0x2dd873[_0xa33143]+_0x01f7('0x31')]=_0x517ac3;}var _0x4f1877={'id':this['id'],'name':this[_0x01f7('0x7')],'online':this[_0x01f7('0x8')],'voicePause':this['voicePause'],'chatPause':this['chatPause'],'mailPause':this[_0x01f7('0x35')],'smsPause':this[_0x01f7('0xc')],'faxPause':this[_0x01f7('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x01f7('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x01f7('0x11')],'chatCurrentCapacity':this[_0x01f7('0x36')],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x01f7('0x37')],'faxStatus':this[_0x01f7('0x14')],'faxStatusTime':this[_0x01f7('0x15')],'faxCapacity':this[_0x01f7('0x16')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x01f7('0x18')],'smsStatusTime':this[_0x01f7('0x38')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x01f7('0x1a')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x01f7('0x1c')],'whatsappCurrentCapacity':this[_0x01f7('0x39')],'openchannelStatus':this[_0x01f7('0x1d')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x01f7('0x1e')],'openchannelCurrentCapacity':this[_0x01f7('0x1f')],'busy':this[_0x01f7('0x20')],'busyQueue':this[_0x01f7('0x3a')],'chatWaitingInteractions':this[_0x01f7('0x21')],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this[_0x01f7('0x23')],'openchannelWaitingInteractions':this[_0x01f7('0x24')],'smsWaitingInteractions':this[_0x01f7('0x3b')],'whatsappWaitingInteractions':this[_0x01f7('0x25')]};var _0x2eeccc=md5(JSON[_0x01f7('0x3c')](_0x4f1877));if(this[_0x01f7('0x1')]!==_0x2eeccc){this['md5']=_0x2eeccc;io[_0x01f7('0x3d')](_0x01f7('0x3e'),_0x4f1877);}};module[_0x01f7('0x3f')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index d9c982f..98c1ec6 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 _0x88b7=['loggedIn','available','stringify','chat_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','paused','length','online'];(function(_0x5c8cfb,_0x5a6787){var _0x1492f7=function(_0x3e18f2){while(--_0x3e18f2){_0x5c8cfb['push'](_0x5c8cfb['shift']());}};_0x1492f7(++_0x5a6787);}(_0x88b7,0x112));var _0x788b=function(_0x217468,_0x202266){_0x217468=_0x217468-0x0;var _0x38b284=_0x88b7[_0x217468];return _0x38b284;};'use strict';var _=require(_0x788b('0x0'));var md5=require(_0x788b('0x1'));var util=require(_0x788b('0x2'));var Redis=require(_0x788b('0x3'));var config=require(_0x788b('0x4'));config[_0x788b('0x5')]=_['defaults'](config[_0x788b('0x5')],{'host':_0x788b('0x6'),'port':0x18eb});var io=require(_0x788b('0x7'))(new Redis(config[_0x788b('0x5')]));function ChatQueue(_0x8ebc93){this['id']=_0x8ebc93['id']||0x0;this[_0x788b('0x8')]=_0x8ebc93[_0x788b('0x8')]||'';this[_0x788b('0x9')]=_0x8ebc93[_0x788b('0x9')]||0xa;this[_0x788b('0xa')]=_0x8ebc93[_0x788b('0xa')]||_0x788b('0xb');this[_0x788b('0xc')]=_0x8ebc93['Agents'];this[_0x788b('0xd')]={};this[_0x788b('0xe')]=0x0;this[_0x788b('0x1')]='';this['updateRouting']();this[_0x788b('0xf')]();}ChatQueue[_0x788b('0x10')][_0x788b('0x11')]=function(){var _0x50342b=this[_0x788b('0xd')][_0x788b('0x12')];this[_0x788b('0xd')]=_[_0x788b('0x13')](this[_0x788b('0xc')],'id');this['mapAgentsId'][_0x788b('0x12')]=_0x50342b;};ChatQueue['prototype'][_0x788b('0xf')]=function(){this['loggedIn']=0x0;this[_0x788b('0x14')]=0x0;for(var _0x2abb3c=0x0;_0x2abb3c=0x0?this['available']:0x0;var _0x243326={'id':this['id'],'available':this[_0x788b('0x18')],'loggedIn':this[_0x788b('0x17')],'name':this['name'],'paused':this[_0x788b('0x14')],'waiting':this[_0x788b('0xe')]};var _0x1dbe64=md5(JSON[_0x788b('0x19')](_0x243326));if(this[_0x788b('0x1')]!==_0x1dbe64){this[_0x788b('0x1')]=_0x1dbe64;io['to'](util['format']('chat:queue:%s',_0x243326[_0x788b('0x8')]))['emit'](_0x788b('0x1a'),_0x243326);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x8f21=['updateRouting','updateRealtime','_rr','map','prototype','loggedIn','length','chatPause','available','paused','stringify','chat:queue:%s','chat_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x1598bb,_0x3fb456){var _0x135546=function(_0xf63a1a){while(--_0xf63a1a){_0x1598bb['push'](_0x1598bb['shift']());}};_0x135546(++_0x3fb456);}(_0x8f21,0xee));var _0x18f2=function(_0x15353c,_0x5d98a8){_0x15353c=_0x15353c-0x0;var _0x4622d7=_0x8f21[_0x15353c];return _0x4622d7;};'use strict';var _=require(_0x18f2('0x0'));var md5=require(_0x18f2('0x1'));var util=require('util');var Redis=require(_0x18f2('0x2'));var config=require(_0x18f2('0x3'));config[_0x18f2('0x4')]=_[_0x18f2('0x5')](config[_0x18f2('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x18f2('0x6'))(new Redis(config['redis']));function ChatQueue(_0x2ee7a5){this['id']=_0x2ee7a5['id']||0x0;this[_0x18f2('0x7')]=_0x2ee7a5['name']||'';this[_0x18f2('0x8')]=_0x2ee7a5[_0x18f2('0x8')]||0xa;this[_0x18f2('0x9')]=_0x2ee7a5[_0x18f2('0x9')]||_0x18f2('0xa');this[_0x18f2('0xb')]=_0x2ee7a5[_0x18f2('0xb')];this[_0x18f2('0xc')]={};this[_0x18f2('0xd')]=0x0;this['md5']='';this[_0x18f2('0xe')]();this[_0x18f2('0xf')]();}ChatQueue['prototype'][_0x18f2('0xe')]=function(){var _0x2142a5=this[_0x18f2('0xc')][_0x18f2('0x10')];this[_0x18f2('0xc')]=_[_0x18f2('0x11')](this[_0x18f2('0xb')],'id');this[_0x18f2('0xc')][_0x18f2('0x10')]=_0x2142a5;};ChatQueue[_0x18f2('0x12')][_0x18f2('0xf')]=function(){this[_0x18f2('0x13')]=0x0;this['paused']=0x0;for(var _0x4a2a1e=0x0;_0x4a2a1e=0x0?this[_0x18f2('0x16')]:0x0;var _0x370dbc={'id':this['id'],'available':this['available'],'loggedIn':this[_0x18f2('0x13')],'name':this[_0x18f2('0x7')],'paused':this['paused'],'waiting':this[_0x18f2('0xd')]};var _0x5544dc=md5(JSON[_0x18f2('0x18')](_0x370dbc));if(this[_0x18f2('0x1')]!==_0x5544dc){this[_0x18f2('0x1')]=_0x5544dc;io['to'](util['format'](_0x18f2('0x19'),_0x370dbc[_0x18f2('0x7')]))['emit'](_0x18f2('0x1a'),_0x370dbc);}};module[_0x18f2('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 32d3f32..247aab2 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 _0x8535=['util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','prototype','map','_rr','loggedIn','paused','length','online','faxPause','available','waiting','stringify','md5','format','fax:queue:%s','emit','fax_queue:save','exports','lodash'];(function(_0xeac991,_0xbdeb9a){var _0x1491a8=function(_0x5673a3){while(--_0x5673a3){_0xeac991['push'](_0xeac991['shift']());}};_0x1491a8(++_0xbdeb9a);}(_0x8535,0x9a));var _0x5853=function(_0xc03c4d,_0x19fe14){_0xc03c4d=_0xc03c4d-0x0;var _0x2c55c1=_0x8535[_0xc03c4d];return _0x2c55c1;};'use strict';var _=require(_0x5853('0x0'));var md5=require('md5');var util=require(_0x5853('0x1'));var Redis=require(_0x5853('0x2'));var config=require('../../../config/environment');config[_0x5853('0x3')]=_[_0x5853('0x4')](config[_0x5853('0x3')],{'host':_0x5853('0x5'),'port':0x18eb});var io=require(_0x5853('0x6'))(new Redis(config[_0x5853('0x3')]));function FaxQueue(_0x43e9ab){this['id']=_0x43e9ab['id']||0x0;this[_0x5853('0x7')]=_0x43e9ab[_0x5853('0x7')]||'';this[_0x5853('0x8')]=_0x43e9ab['timeout']||0xa;this['strategy']=_0x43e9ab[_0x5853('0x9')]||_0x5853('0xa');this[_0x5853('0xb')]=_0x43e9ab[_0x5853('0xb')];this[_0x5853('0xc')]={};this['waiting']=0x0;this['md5']='';this['updateRouting']();this[_0x5853('0xd')]();}FaxQueue[_0x5853('0xe')]['updateRouting']=function(){var _0x26b034=this[_0x5853('0xc')]['_rr'];this[_0x5853('0xc')]=_[_0x5853('0xf')](this[_0x5853('0xb')],'id');this[_0x5853('0xc')][_0x5853('0x10')]=_0x26b034;};FaxQueue[_0x5853('0xe')][_0x5853('0xd')]=function(){this[_0x5853('0x11')]=0x0;this[_0x5853('0x12')]=0x0;for(var _0x15c3c8=0x0;_0x15c3c8=0x0?this[_0x5853('0x16')]:0x0;var _0xb52e72={'id':this['id'],'available':this[_0x5853('0x16')],'loggedIn':this[_0x5853('0x11')],'name':this[_0x5853('0x7')],'paused':this[_0x5853('0x12')],'waiting':this[_0x5853('0x17')]};var _0x1a25f2=md5(JSON[_0x5853('0x18')](_0xb52e72));if(this[_0x5853('0x19')]!==_0x1a25f2){this['md5']=_0x1a25f2;io['to'](util[_0x5853('0x1a')](_0x5853('0x1b'),_0xb52e72['name']))[_0x5853('0x1c')](_0x5853('0x1d'),_0xb52e72);}};module[_0x5853('0x1e')]=FaxQueue; \ No newline at end of file +var _0xcb10=['prototype','_rr','mapAgentsId','map','Agents','loggedIn','paused','length','online','faxPause','available','stringify','fax:queue:%s','emit','lodash','md5','util','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','waiting','updateRouting','updateRealtime'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xcb10,0x1be));var _0x0cb1=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xcb10[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x0cb1('0x0'));var md5=require(_0x0cb1('0x1'));var util=require(_0x0cb1('0x2'));var Redis=require(_0x0cb1('0x3'));var config=require('../../../config/environment');config[_0x0cb1('0x4')]=_['defaults'](config[_0x0cb1('0x4')],{'host':_0x0cb1('0x5'),'port':0x18eb});var io=require(_0x0cb1('0x6'))(new Redis(config['redis']));function FaxQueue(_0x52d19f){this['id']=_0x52d19f['id']||0x0;this[_0x0cb1('0x7')]=_0x52d19f['name']||'';this[_0x0cb1('0x8')]=_0x52d19f[_0x0cb1('0x8')]||0xa;this[_0x0cb1('0x9')]=_0x52d19f[_0x0cb1('0x9')]||'beepall';this['Agents']=_0x52d19f['Agents'];this['mapAgentsId']={};this[_0x0cb1('0xa')]=0x0;this['md5']='';this[_0x0cb1('0xb')]();this[_0x0cb1('0xc')]();}FaxQueue[_0x0cb1('0xd')]['updateRouting']=function(){var _0x44814e=this['mapAgentsId'][_0x0cb1('0xe')];this[_0x0cb1('0xf')]=_[_0x0cb1('0x10')](this[_0x0cb1('0x11')],'id');this[_0x0cb1('0xf')]['_rr']=_0x44814e;};FaxQueue[_0x0cb1('0xd')][_0x0cb1('0xc')]=function(){this[_0x0cb1('0x12')]=0x0;this[_0x0cb1('0x13')]=0x0;for(var _0x46f40c=0x0;_0x46f40c=0x0?this['available']:0x0;var _0x489dc2={'id':this['id'],'available':this[_0x0cb1('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x0cb1('0x13')],'waiting':this[_0x0cb1('0xa')]};var _0x3dc4d5=md5(JSON[_0x0cb1('0x18')](_0x489dc2));if(this[_0x0cb1('0x1')]!==_0x3dc4d5){this[_0x0cb1('0x1')]=_0x3dc4d5;io['to'](util['format'](_0x0cb1('0x19'),_0x489dc2[_0x0cb1('0x7')]))[_0x0cb1('0x1a')]('fax_queue:save',_0x489dc2);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index b983932..fc42288 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 _0xec60=['name'];(function(_0x3dfe75,_0x4519d8){var _0x56b54a=function(_0xc6f08c){while(--_0xc6f08c){_0x3dfe75['push'](_0x3dfe75['shift']());}};_0x56b54a(++_0x4519d8);}(_0xec60,0x1b4));var _0x0ec6=function(_0x3fb637,_0x1482a3){_0x3fb637=_0x3fb637-0x0;var _0x581de8=_0xec60[_0x3fb637];return _0x581de8;};'use strict';function Interval(_0x8225f9){this['id']=_0x8225f9['id']||0x0;this[_0x0ec6('0x0')]=_0x8225f9[_0x0ec6('0x0')]||'';this['Intervals']=_0x8225f9['Intervals']||{};}module['exports']=Interval; \ No newline at end of file +var _0xb9ab=['name','Intervals','exports'];(function(_0x5c365a,_0xd48ae){var _0xeb3924=function(_0xce5e22){while(--_0xce5e22){_0x5c365a['push'](_0x5c365a['shift']());}};_0xeb3924(++_0xd48ae);}(_0xb9ab,0x10e));var _0xbb9a=function(_0x5c0061,_0x58f643){_0x5c0061=_0x5c0061-0x0;var _0x490b55=_0xb9ab[_0x5c0061];return _0x490b55;};'use strict';function Interval(_0x22e984){this['id']=_0x22e984['id']||0x0;this[_0xbb9a('0x0')]=_0x22e984[_0xbb9a('0x0')]||'';this[_0xbb9a('0x1')]=_0x22e984[_0xbb9a('0x1')]||{};}module[_0xbb9a('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 abf1d79..6d17d7b 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 _0x0ba6=['_rr','loggedIn','paused','online','available','stringify','format','mail:queue:%s','emit','exports','lodash','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','map'];(function(_0x462774,_0x4953d2){var _0x280503=function(_0x3fde13){while(--_0x3fde13){_0x462774['push'](_0x462774['shift']());}};_0x280503(++_0x4953d2);}(_0x0ba6,0x166));var _0x60ba=function(_0x1f9f5f,_0x509fb7){_0x1f9f5f=_0x1f9f5f-0x0;var _0x51d649=_0x0ba6[_0x1f9f5f];return _0x51d649;};'use strict';var _=require(_0x60ba('0x0'));var md5=require('md5');var util=require(_0x60ba('0x1'));var Redis=require(_0x60ba('0x2'));var config=require(_0x60ba('0x3'));config['redis']=_['defaults'](config[_0x60ba('0x4')],{'host':_0x60ba('0x5'),'port':0x18eb});var io=require(_0x60ba('0x6'))(new Redis(config[_0x60ba('0x4')]));function MailQueue(_0x110f71){this['id']=_0x110f71['id']||0x0;this[_0x60ba('0x7')]=_0x110f71[_0x60ba('0x7')]||'';this[_0x60ba('0x8')]=_0x110f71[_0x60ba('0x8')]||0xa;this[_0x60ba('0x9')]=_0x110f71['strategy']||_0x60ba('0xa');this[_0x60ba('0xb')]=_0x110f71['Agents'];this[_0x60ba('0xc')]={};this[_0x60ba('0xd')]=0x0;this[_0x60ba('0xe')]='';this[_0x60ba('0xf')]();this[_0x60ba('0x10')]();}MailQueue[_0x60ba('0x11')][_0x60ba('0xf')]=function(){var _0x346331=this[_0x60ba('0xc')]['_rr'];this[_0x60ba('0xc')]=_[_0x60ba('0x12')](this[_0x60ba('0xb')],'id');this['mapAgentsId'][_0x60ba('0x13')]=_0x346331;};MailQueue['prototype']['updateRealtime']=function(){this[_0x60ba('0x14')]=0x0;this[_0x60ba('0x15')]=0x0;for(var _0x36ee68=0x0;_0x36ee68=0x0?this[_0x60ba('0x17')]:0x0;var _0x444c5f={'id':this['id'],'available':this[_0x60ba('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0x60ba('0xd')]};var _0x157e05=md5(JSON[_0x60ba('0x18')](_0x444c5f));if(this['md5']!==_0x157e05){this['md5']=_0x157e05;io['to'](util[_0x60ba('0x19')](_0x60ba('0x1a'),_0x444c5f[_0x60ba('0x7')]))[_0x60ba('0x1b')]('mail_queue:save',_0x444c5f);}};module[_0x60ba('0x1c')]=MailQueue; \ No newline at end of file +var _0xe601=['length','available','paused','stringify','format','mail:queue:%s','emit','mail_queue:save','lodash','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','map','prototype','updateRealtime','loggedIn'];(function(_0x5aa8d1,_0x276daf){var _0x550bba=function(_0x1eb972){while(--_0x1eb972){_0x5aa8d1['push'](_0x5aa8d1['shift']());}};_0x550bba(++_0x276daf);}(_0xe601,0x174));var _0x1e60=function(_0x15f578,_0x5cca58){_0x15f578=_0x15f578-0x0;var _0x5afcf9=_0xe601[_0x15f578];return _0x5afcf9;};'use strict';var _=require(_0x1e60('0x0'));var md5=require(_0x1e60('0x1'));var util=require('util');var Redis=require(_0x1e60('0x2'));var config=require(_0x1e60('0x3'));config[_0x1e60('0x4')]=_['defaults'](config['redis'],{'host':_0x1e60('0x5'),'port':0x18eb});var io=require(_0x1e60('0x6'))(new Redis(config['redis']));function MailQueue(_0x38cdac){this['id']=_0x38cdac['id']||0x0;this[_0x1e60('0x7')]=_0x38cdac[_0x1e60('0x7')]||'';this[_0x1e60('0x8')]=_0x38cdac['timeout']||0xa;this[_0x1e60('0x9')]=_0x38cdac[_0x1e60('0x9')]||_0x1e60('0xa');this[_0x1e60('0xb')]=_0x38cdac[_0x1e60('0xb')];this[_0x1e60('0xc')]={};this[_0x1e60('0xd')]=0x0;this[_0x1e60('0x1')]='';this[_0x1e60('0xe')]();this['updateRealtime']();}MailQueue['prototype'][_0x1e60('0xe')]=function(){var _0x313236=this[_0x1e60('0xc')][_0x1e60('0xf')];this['mapAgentsId']=_[_0x1e60('0x10')](this[_0x1e60('0xb')],'id');this[_0x1e60('0xc')]['_rr']=_0x313236;};MailQueue[_0x1e60('0x11')][_0x1e60('0x12')]=function(){this[_0x1e60('0x13')]=0x0;this['paused']=0x0;for(var _0xf6cf7f=0x0;_0xf6cf7f=0x0?this[_0x1e60('0x15')]:0x0;var _0x26fd2a={'id':this['id'],'available':this[_0x1e60('0x15')],'loggedIn':this[_0x1e60('0x13')],'name':this[_0x1e60('0x7')],'paused':this['paused'],'waiting':this[_0x1e60('0xd')]};var _0x3773c9=md5(JSON[_0x1e60('0x17')](_0x26fd2a));if(this[_0x1e60('0x1')]!==_0x3773c9){this[_0x1e60('0x1')]=_0x3773c9;io['to'](util[_0x1e60('0x18')](_0x1e60('0x19'),_0x26fd2a[_0x1e60('0x7')]))[_0x1e60('0x1a')](_0x1e60('0x1b'),_0x26fd2a);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 47300d7..6d2e602 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 _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x326f,0xd1));var _0xf326=function(_0x42d17c,_0x3f4a5a){_0x42d17c=_0x42d17c-0x0;var _0x5e8a8b=_0x326f[_0x42d17c];return _0x5e8a8b;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file +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(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x7a54,0x106));var _0x47a5=function(_0x1282bc,_0x2f1eed){_0x1282bc=_0x1282bc-0x0;var _0x4aa432=_0x7a54[_0x1282bc];return _0x4aa432;};'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 diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 6c79b38..c274078 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 _0x402f=['mapAgentsId','waiting','md5','updateRouting','updateRealtime','paused','length','online','loggedIn','available','stringify','format','sms:queue:%s','emit','sms_queue:save','lodash','util','redis','defaults','socket.io-emitter','name','timeout','beepall','Agents'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x402f,0x6f));var _0xf402=function(_0x4e6cf1,_0x4d775d){_0x4e6cf1=_0x4e6cf1-0x0;var _0x1bde4d=_0x402f[_0x4e6cf1];return _0x1bde4d;};'use strict';var _=require(_0xf402('0x0'));var md5=require('md5');var util=require(_0xf402('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xf402('0x2')]=_[_0xf402('0x3')](config[_0xf402('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0xf402('0x4'))(new Redis(config['redis']));function SmsQueue(_0x20c2cc){this['id']=_0x20c2cc['id']||0x0;this[_0xf402('0x5')]=_0x20c2cc[_0xf402('0x5')]||'';this[_0xf402('0x6')]=_0x20c2cc[_0xf402('0x6')]||0xa;this['strategy']=_0x20c2cc['strategy']||_0xf402('0x7');this[_0xf402('0x8')]=_0x20c2cc[_0xf402('0x8')];this[_0xf402('0x9')]={};this[_0xf402('0xa')]=0x0;this[_0xf402('0xb')]='';this[_0xf402('0xc')]();this[_0xf402('0xd')]();}SmsQueue['prototype'][_0xf402('0xc')]=function(){var _0x496916=this['mapAgentsId']['_rr'];this['mapAgentsId']=_['map'](this[_0xf402('0x8')],'id');this['mapAgentsId']['_rr']=_0x496916;};SmsQueue['prototype'][_0xf402('0xd')]=function(){this['loggedIn']=0x0;this[_0xf402('0xe')]=0x0;for(var _0xb3deb6=0x0;_0xb3deb6=0x0?this[_0xf402('0x12')]:0x0;var _0x5d7236={'id':this['id'],'available':this[_0xf402('0x12')],'loggedIn':this[_0xf402('0x11')],'name':this[_0xf402('0x5')],'paused':this[_0xf402('0xe')],'waiting':this['waiting']};var _0x14fdcc=md5(JSON[_0xf402('0x13')](_0x5d7236));if(this[_0xf402('0xb')]!==_0x14fdcc){this[_0xf402('0xb')]=_0x14fdcc;io['to'](util[_0xf402('0x14')](_0xf402('0x15'),_0x5d7236[_0xf402('0x5')]))[_0xf402('0x16')](_0xf402('0x17'),_0x5d7236);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x063c=['paused','length','online','loggedIn','smsPause','available','waiting','stringify','format','emit','sms_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','updateRealtime'];(function(_0x3a2685,_0x1721b9){var _0x5b5300=function(_0x46acc2){while(--_0x46acc2){_0x3a2685['push'](_0x3a2685['shift']());}};_0x5b5300(++_0x1721b9);}(_0x063c,0xba));var _0xc063=function(_0x589786,_0x3b0a20){_0x589786=_0x589786-0x0;var _0x34519d=_0x063c[_0x589786];return _0x34519d;};'use strict';var _=require('lodash');var md5=require(_0xc063('0x0'));var util=require(_0xc063('0x1'));var Redis=require(_0xc063('0x2'));var config=require(_0xc063('0x3'));config[_0xc063('0x4')]=_[_0xc063('0x5')](config['redis'],{'host':_0xc063('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function SmsQueue(_0x59b81f){this['id']=_0x59b81f['id']||0x0;this[_0xc063('0x7')]=_0x59b81f[_0xc063('0x7')]||'';this['timeout']=_0x59b81f[_0xc063('0x8')]||0xa;this[_0xc063('0x9')]=_0x59b81f[_0xc063('0x9')]||_0xc063('0xa');this['Agents']=_0x59b81f[_0xc063('0xb')];this[_0xc063('0xc')]={};this['waiting']=0x0;this[_0xc063('0x0')]='';this[_0xc063('0xd')]();this['updateRealtime']();}SmsQueue[_0xc063('0xe')]['updateRouting']=function(){var _0x54c605=this['mapAgentsId'][_0xc063('0xf')];this[_0xc063('0xc')]=_['map'](this[_0xc063('0xb')],'id');this['mapAgentsId'][_0xc063('0xf')]=_0x54c605;};SmsQueue[_0xc063('0xe')][_0xc063('0x10')]=function(){this['loggedIn']=0x0;this[_0xc063('0x11')]=0x0;for(var _0x1249b2=0x0;_0x1249b2=0x0?this['available']:0x0;var _0x238ecb={'id':this['id'],'available':this[_0xc063('0x16')],'loggedIn':this[_0xc063('0x14')],'name':this[_0xc063('0x7')],'paused':this['paused'],'waiting':this[_0xc063('0x17')]};var _0x28d3ce=md5(JSON[_0xc063('0x18')](_0x238ecb));if(this['md5']!==_0x28d3ce){this[_0xc063('0x0')]=_0x28d3ce;io['to'](util[_0xc063('0x19')]('sms:queue:%s',_0x238ecb[_0xc063('0x7')]))[_0xc063('0x1a')](_0xc063('0x1b'),_0x238ecb);}};module[_0xc063('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index d83d8c9..735dec2 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 _0x50f9=['../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','online','paused','available','stringify','md5','format','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','util','ioredis'];(function(_0x2952a0,_0x1adc0c){var _0x275f2c=function(_0x253ace){while(--_0x253ace){_0x2952a0['push'](_0x2952a0['shift']());}};_0x275f2c(++_0x1adc0c);}(_0x50f9,0x1cd));var _0x950f=function(_0x27753c,_0x45cc39){_0x27753c=_0x27753c-0x0;var _0x17421c=_0x50f9[_0x27753c];return _0x17421c;};'use strict';var _=require(_0x950f('0x0'));var md5=require('md5');var util=require(_0x950f('0x1'));var Redis=require(_0x950f('0x2'));var config=require(_0x950f('0x3'));config[_0x950f('0x4')]=_[_0x950f('0x5')](config[_0x950f('0x4')],{'host':_0x950f('0x6'),'port':0x18eb});var io=require(_0x950f('0x7'))(new Redis(config[_0x950f('0x4')]));function WhatsappQueue(_0x18505a){this['id']=_0x18505a['id']||0x0;this[_0x950f('0x8')]=_0x18505a[_0x950f('0x8')]||'';this['timeout']=_0x18505a['timeout']||0xa;this[_0x950f('0x9')]=_0x18505a['strategy']||_0x950f('0xa');this[_0x950f('0xb')]=_0x18505a[_0x950f('0xb')];this['mapAgentsId']={};this[_0x950f('0xc')]=0x0;this['md5']='';this[_0x950f('0xd')]();this[_0x950f('0xe')]();}WhatsappQueue[_0x950f('0xf')]['updateRouting']=function(){var _0x243d88=this[_0x950f('0x10')][_0x950f('0x11')];this['mapAgentsId']=_[_0x950f('0x12')](this[_0x950f('0xb')],'id');this[_0x950f('0x10')][_0x950f('0x11')]=_0x243d88;};WhatsappQueue['prototype']['updateRealtime']=function(){this[_0x950f('0x13')]=0x0;this['paused']=0x0;for(var _0x2c1846=0x0;_0x2c1846=0x0?this[_0x950f('0x16')]:0x0;var _0x4512ac={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x950f('0x8')],'paused':this[_0x950f('0x15')],'waiting':this[_0x950f('0xc')]};var _0x1d794a=md5(JSON[_0x950f('0x17')](_0x4512ac));if(this[_0x950f('0x18')]!==_0x1d794a){this[_0x950f('0x18')]=_0x1d794a;io['to'](util[_0x950f('0x19')](_0x950f('0x1a'),_0x4512ac[_0x950f('0x8')]))[_0x950f('0x1b')](_0x950f('0x1c'),_0x4512ac);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x3f60=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','loggedIn','paused','length','online','available','stringify','format','whatsapp:queue:%s','whatsapp_queue:save','exports','lodash','md5','util'];(function(_0x3aec43,_0x1edcfd){var _0x58ad56=function(_0x17b251){while(--_0x17b251){_0x3aec43['push'](_0x3aec43['shift']());}};_0x58ad56(++_0x1edcfd);}(_0x3f60,0x159));var _0x03f6=function(_0x56f935,_0xbb3e13){_0x56f935=_0x56f935-0x0;var _0x25ff2f=_0x3f60[_0x56f935];return _0x25ff2f;};'use strict';var _=require(_0x03f6('0x0'));var md5=require(_0x03f6('0x1'));var util=require(_0x03f6('0x2'));var Redis=require(_0x03f6('0x3'));var config=require(_0x03f6('0x4'));config[_0x03f6('0x5')]=_[_0x03f6('0x6')](config['redis'],{'host':_0x03f6('0x7'),'port':0x18eb});var io=require(_0x03f6('0x8'))(new Redis(config[_0x03f6('0x5')]));function WhatsappQueue(_0x20e71f){this['id']=_0x20e71f['id']||0x0;this['name']=_0x20e71f[_0x03f6('0x9')]||'';this[_0x03f6('0xa')]=_0x20e71f[_0x03f6('0xa')]||0xa;this[_0x03f6('0xb')]=_0x20e71f[_0x03f6('0xb')]||_0x03f6('0xc');this[_0x03f6('0xd')]=_0x20e71f[_0x03f6('0xd')];this[_0x03f6('0xe')]={};this[_0x03f6('0xf')]=0x0;this[_0x03f6('0x1')]='';this[_0x03f6('0x10')]();this['updateRealtime']();}WhatsappQueue[_0x03f6('0x11')][_0x03f6('0x10')]=function(){var _0x2940e6=this[_0x03f6('0xe')][_0x03f6('0x12')];this[_0x03f6('0xe')]=_['map'](this[_0x03f6('0xd')],'id');this[_0x03f6('0xe')][_0x03f6('0x12')]=_0x2940e6;};WhatsappQueue[_0x03f6('0x11')]['updateRealtime']=function(){this[_0x03f6('0x13')]=0x0;this[_0x03f6('0x14')]=0x0;for(var _0x2e8da1=0x0;_0x2e8da1=0x0?this['available']:0x0;var _0x4e3915={'id':this['id'],'available':this[_0x03f6('0x17')],'loggedIn':this[_0x03f6('0x13')],'name':this[_0x03f6('0x9')],'paused':this[_0x03f6('0x14')],'waiting':this[_0x03f6('0xf')]};var _0x1b51c3=md5(JSON[_0x03f6('0x18')](_0x4e3915));if(this[_0x03f6('0x1')]!==_0x1b51c3){this[_0x03f6('0x1')]=_0x1b51c3;io['to'](util[_0x03f6('0x19')](_0x03f6('0x1a'),_0x4e3915[_0x03f6('0x9')]))['emit'](_0x03f6('0x1b'),_0x4e3915);}};module[_0x03f6('0x1c')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 212d42b..f91cc78 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x2d7446,_0x207652){var _0x26cf26=function(_0x4ebfbc){while(--_0x4ebfbc){_0x2d7446['push'](_0x2d7446['shift']());}};_0x26cf26(++_0x207652);}(_0xb10b,0x12a));var _0xbb10=function(_0xcbe787,_0x401e4c){_0xcbe787=_0xcbe787-0x0;var _0x4c78fa=_0xb10b[_0xcbe787];return _0x4c78fa;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index e9203e0..2d01393 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 _0x12a5=['AddTagsToChatInteraction','../client','Request','addTags'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0x12a5,0x1d9));var _0x512a=function(_0x325ba8,_0x2e8da6){_0x325ba8=_0x325ba8-0x0;var _0x55f7aa=_0x12a5[_0x325ba8];return _0x55f7aa;};'use strict';var client=require(_0x512a('0x0'));exports['update']=function(_0x32b143,_0x10dd99){return client[_0x512a('0x1')]('UpdateChatInteraction',{'body':_0x10dd99,'options':{'where':{'id':_0x32b143}},'log':'updateChatInteraction'});};exports[_0x512a('0x2')]=function(_0x3641a5,_0x145752){return client['Request'](_0x512a('0x3'),{'body':_0x145752,'options':{'where':{'id':_0x3641a5}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x3403=['UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x3403,0xe5));var _0x3340=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x3403[_0x4ae6ef];return _0x3cbb4e;};'use strict';var client=require(_0x3340('0x0'));exports[_0x3340('0x1')]=function(_0x481be2,_0x35d566){return client['Request'](_0x3340('0x2'),{'body':_0x35d566,'options':{'where':{'id':_0x481be2}},'log':_0x3340('0x3')});};exports[_0x3340('0x4')]=function(_0x420cb8,_0x433af0){return client['Request'](_0x3340('0x5'),{'body':_0x433af0,'options':{'where':{'id':_0x420cb8}},'log':_0x3340('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index ab7e028..91faf40 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 _0xebdd=['Request','CreateChatMessage','createChatMessage','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xebdd,0x133));var _0xdebd=function(_0x1c6089,_0x3816e2){_0x1c6089=_0x1c6089-0x0;var _0x4d97c1=_0xebdd[_0x1c6089];return _0x4d97c1;};'use strict';var client=require('../client');exports[_0xdebd('0x0')]=function(_0x43a939){return client[_0xdebd('0x1')](_0xdebd('0x2'),{'body':_0x43a939,'log':_0xdebd('0x3')});}; \ No newline at end of file +var _0x9700=['create','CreateChatMessage','createChatMessage','../client'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0x9700,0xa3));var _0x0970=function(_0x23daa6,_0x4cb95a){_0x23daa6=_0x23daa6-0x0;var _0xf8d7c8=_0x9700[_0x23daa6];return _0xf8d7c8;};'use strict';var client=require(_0x0970('0x0'));exports[_0x0970('0x1')]=function(_0xef709a){return client['Request'](_0x0970('0x2'),{'body':_0xef709a,'log':_0x0970('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 7955dc6..9f98f75 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 _0x3561=['User','Agents','online','chatPause','getChatQueues','../client','Request','GetChatQueue','name','timeout','strategy'];(function(_0x1d37a2,_0x3f60a0){var _0x14630c=function(_0xa923fb){while(--_0xa923fb){_0x1d37a2['push'](_0x1d37a2['shift']());}};_0x14630c(++_0x3f60a0);}(_0x3561,0x94));var _0x1356=function(_0x4cf0b2,_0x4686c9){_0x4cf0b2=_0x4cf0b2-0x0;var _0xe8ae2f=_0x3561[_0x4cf0b2];return _0xe8ae2f;};'use strict';var client=require(_0x1356('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x1356('0x1')](_0x1356('0x2'),{'options':{'raw':![],'attributes':['id',_0x1356('0x3'),_0x1356('0x4'),_0x1356('0x5')],'include':[{'model':_0x1356('0x6'),'as':_0x1356('0x7'),'attributes':['id',_0x1356('0x3'),_0x1356('0x8'),_0x1356('0x9')]}]},'log':_0x1356('0xa')});};}; \ No newline at end of file +var _0xe1dc=['strategy','Agents','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout'];(function(_0x40b13e,_0x2837ab){var _0x3a949a=function(_0x2d1a86){while(--_0x2d1a86){_0x40b13e['push'](_0x40b13e['shift']());}};_0x3a949a(++_0x2837ab);}(_0xe1dc,0x8a));var _0xce1d=function(_0x50819b,_0x1e105b){_0x50819b=_0x50819b-0x0;var _0x2d42e6=_0xe1dc[_0x50819b];return _0x2d42e6;};'use strict';var client=require(_0xce1d('0x0'));exports[_0xce1d('0x1')]=function(){return function(){return client[_0xce1d('0x2')](_0xce1d('0x3'),{'options':{'raw':![],'attributes':['id',_0xce1d('0x4'),_0xce1d('0x5'),_0xce1d('0x6')],'include':[{'model':'User','as':_0xce1d('0x7'),'attributes':['id','name','online',_0xce1d('0x8')]}]},'log':_0xce1d('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 79ef17c..d89633c 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 _0x6597=['../client','create','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0x5022f1,_0x46baec){var _0x4eba96=function(_0x20b570){while(--_0x20b570){_0x5022f1['push'](_0x5022f1['shift']());}};_0x4eba96(++_0x46baec);}(_0x6597,0x16e));var _0x7659=function(_0x4cc891,_0x39197e){_0x4cc891=_0x4cc891-0x0;var _0x163cf7=_0x6597[_0x4cc891];return _0x163cf7;};'use strict';var client=require(_0x7659('0x0'));exports[_0x7659('0x1')]=function(_0x2720d8){return client['Request'](_0x7659('0x2'),{'body':_0x2720d8,'log':'CreateChatQueueReport'});};exports[_0x7659('0x3')]=function(_0x4f5b89,_0x5e96ed){return client['Request'](_0x7659('0x4'),{'body':_0x5e96ed,'options':{'where':{'uniqueid':_0x4f5b89},'order':[['id',_0x7659('0x5')]],'limit':0x1},'log':_0x7659('0x4')});}; \ No newline at end of file +var _0xc1c4=['../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0x2c3aa6,_0xa7f5b5){var _0x87b451=function(_0x490e09){while(--_0x490e09){_0x2c3aa6['push'](_0x2c3aa6['shift']());}};_0x87b451(++_0xa7f5b5);}(_0xc1c4,0x1c7));var _0x4c1c=function(_0x31b936,_0x1a05a6){_0x31b936=_0x31b936-0x0;var _0x5d5f19=_0xc1c4[_0x31b936];return _0x5d5f19;};'use strict';var client=require(_0x4c1c('0x0'));exports[_0x4c1c('0x1')]=function(_0x2fb284){return client[_0x4c1c('0x2')](_0x4c1c('0x3'),{'body':_0x2fb284,'log':_0x4c1c('0x3')});};exports[_0x4c1c('0x4')]=function(_0x5b8a39,_0x5c1e2c){return client[_0x4c1c('0x2')](_0x4c1c('0x5'),{'body':_0x5c1e2c,'options':{'where':{'uniqueid':_0x5b8a39},'order':[['id',_0x4c1c('0x6')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 79d95c4..6107790 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(_0x146a97,_0x2d8483){var _0x259d5c=function(_0x3ca436){while(--_0x3ca436){_0x146a97['push'](_0x146a97['shift']());}};_0x259d5c(++_0x2d8483);}(_0x7a54,0x106));var _0x47a5=function(_0x1d7c6a,_0x57927){_0x1d7c6a=_0x1d7c6a-0x0;var _0x3339b6=_0x7a54[_0x1d7c6a];return _0x3339b6;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x500b07,_0x506e2b){var _0x588be9=function(_0x2baadb){while(--_0x2baadb){_0x500b07['push'](_0x500b07['shift']());}};_0x588be9(++_0x506e2b);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index d35aa43..819b27e 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 _0x903d=['Request','CreateFaxMessage','../client','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x903d,0x7e));var _0xd903=function(_0x2b98c4,_0x7c8283){_0x2b98c4=_0x2b98c4-0x0;var _0x2799a9=_0x903d[_0x2b98c4];return _0x2799a9;};'use strict';var client=require(_0xd903('0x0'));exports[_0xd903('0x1')]=function(_0x540e15){return client[_0xd903('0x2')](_0xd903('0x3'),{'body':_0x540e15,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x8752=['../client','create','Request','CreateFaxMessage'];(function(_0x185377,_0x34ea56){var _0x56634e=function(_0x469dc1){while(--_0x469dc1){_0x185377['push'](_0x185377['shift']());}};_0x56634e(++_0x34ea56);}(_0x8752,0x1e4));var _0x2875=function(_0x1adb00,_0x38e2eb){_0x1adb00=_0x1adb00-0x0;var _0x46fb0e=_0x8752[_0x1adb00];return _0x46fb0e;};'use strict';var client=require(_0x2875('0x0'));exports[_0x2875('0x1')]=function(_0x2d8579){return client[_0x2875('0x2')](_0x2875('0x3'),{'body':_0x2d8579,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 8398580..fd56722 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 _0xb3a3=['Agents','online','faxPause','../client','getFaxQueues','GetFaxQueue','name','timeout','strategy','User'];(function(_0x1a4fe7,_0x151e99){var _0x3375f6=function(_0x46ac3a){while(--_0x46ac3a){_0x1a4fe7['push'](_0x1a4fe7['shift']());}};_0x3375f6(++_0x151e99);}(_0xb3a3,0x157));var _0x3b3a=function(_0xc40206,_0x478eb5){_0xc40206=_0xc40206-0x0;var _0xb8d550=_0xb3a3[_0xc40206];return _0xb8d550;};'use strict';var client=require(_0x3b3a('0x0'));exports[_0x3b3a('0x1')]=function(){return function(){return client['Request'](_0x3b3a('0x2'),{'options':{'raw':![],'attributes':['id',_0x3b3a('0x3'),_0x3b3a('0x4'),_0x3b3a('0x5')],'include':[{'model':_0x3b3a('0x6'),'as':_0x3b3a('0x7'),'attributes':['id',_0x3b3a('0x3'),_0x3b3a('0x8'),_0x3b3a('0x9')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x3b8b=['name','timeout','online','faxPause','getFaxQueues','Request','GetFaxQueue'];(function(_0x314448,_0x49f79c){var _0x983bbf=function(_0x37fcd0){while(--_0x37fcd0){_0x314448['push'](_0x314448['shift']());}};_0x983bbf(++_0x49f79c);}(_0x3b8b,0x193));var _0xb3b8=function(_0x1f5a63,_0x511504){_0x1f5a63=_0x1f5a63-0x0;var _0x30bb7a=_0x3b8b[_0x1f5a63];return _0x30bb7a;};'use strict';var client=require('../client');exports[_0xb3b8('0x0')]=function(){return function(){return client[_0xb3b8('0x1')](_0xb3b8('0x2'),{'options':{'raw':![],'attributes':['id',_0xb3b8('0x3'),_0xb3b8('0x4'),'strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0xb3b8('0x3'),_0xb3b8('0x5'),_0xb3b8('0x6')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 4f047ec..f98f48c 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 _0xe3ec=['UpdateFaxQueueReport','../client','create','CreateFaxQueueReport','Request'];(function(_0x25383a,_0xd9b3c5){var _0x25fdb1=function(_0x343ca3){while(--_0x343ca3){_0x25383a['push'](_0x25383a['shift']());}};_0x25fdb1(++_0xd9b3c5);}(_0xe3ec,0x119));var _0xce3e=function(_0x5cf961,_0x580f55){_0x5cf961=_0x5cf961-0x0;var _0x376ae9=_0xe3ec[_0x5cf961];return _0x376ae9;};'use strict';var client=require(_0xce3e('0x0'));exports[_0xce3e('0x1')]=function(_0x3fc706){return client['Request'](_0xce3e('0x2'),{'body':_0x3fc706,'log':_0xce3e('0x2')});};exports['update']=function(_0xe1706d,_0x400876){return client[_0xce3e('0x3')](_0xce3e('0x4'),{'body':_0x400876,'options':{'where':{'uniqueid':_0xe1706d},'order':[['id','DESC']],'limit':0x1},'log':_0xce3e('0x4')});}; \ No newline at end of file +var _0xa82c=['DESC','../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x10181,_0x477366){var _0xb6ea48=function(_0x43ef10){while(--_0x43ef10){_0x10181['push'](_0x10181['shift']());}};_0xb6ea48(++_0x477366);}(_0xa82c,0x197));var _0xca82=function(_0x2aee95,_0x23aeb6){_0x2aee95=_0x2aee95-0x0;var _0x31b9bf=_0xa82c[_0x2aee95];return _0x31b9bf;};'use strict';var client=require(_0xca82('0x0'));exports[_0xca82('0x1')]=function(_0x2248ff){return client[_0xca82('0x2')](_0xca82('0x3'),{'body':_0x2248ff,'log':_0xca82('0x3')});};exports[_0xca82('0x4')]=function(_0x21aed9,_0x368974){return client[_0xca82('0x2')](_0xca82('0x5'),{'body':_0x368974,'options':{'where':{'uniqueid':_0x21aed9},'order':[['id',_0xca82('0x6')]],'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 b083581..0c38f5d 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 _0x4f27=['../client','Request','Interval','Intervals','name','interval','getIntervals'];(function(_0x255a92,_0x23f0b7){var _0xeac2f4=function(_0x234a7f){while(--_0x234a7f){_0x255a92['push'](_0x255a92['shift']());}};_0xeac2f4(++_0x23f0b7);}(_0x4f27,0x8c));var _0x74f2=function(_0x5accb4,_0x744a33){_0x5accb4=_0x5accb4-0x0;var _0x79df3e=_0x4f27[_0x5accb4];return _0x79df3e;};'use strict';var client=require(_0x74f2('0x0'));exports['getIntervals']=function(){return function(){return client[_0x74f2('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x74f2('0x2'),'as':_0x74f2('0x3'),'attributes':['id',_0x74f2('0x4'),_0x74f2('0x5')]}]},'log':_0x74f2('0x6')});};}; \ No newline at end of file +var _0x1e1d=['getIntervals','GetInterval','name','interval'];(function(_0x4fddf2,_0x496587){var _0x115e13=function(_0x5db836){while(--_0x5db836){_0x4fddf2['push'](_0x4fddf2['shift']());}};_0x115e13(++_0x496587);}(_0x1e1d,0x1d4));var _0xd1e1=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x1e1d[_0x5f309e];return _0x487b5e;};'use strict';var client=require('../client');exports[_0xd1e1('0x0')]=function(){return function(){return client['Request'](_0xd1e1('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xd1e1('0x2')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0xd1e1('0x2'),_0xd1e1('0x3')]}]},'log':_0xd1e1('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 3cc1c80..0c682b4 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 _0x896e=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','../client'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x896e,0x1e9));var _0xe896=function(_0x327145,_0x4915cb){_0x327145=_0x327145-0x0;var _0x9343a7=_0x896e[_0x327145];return _0x9343a7;};'use strict';var client=require(_0xe896('0x0'));exports[_0xe896('0x1')]=function(_0x3feebe,_0x229b59){return client[_0xe896('0x2')](_0xe896('0x3'),{'body':_0x229b59,'options':{'where':{'id':_0x3feebe}},'log':_0xe896('0x4')});};exports[_0xe896('0x5')]=function(_0x3f85e5,_0x2d3521){return client[_0xe896('0x2')](_0xe896('0x6'),{'body':_0x2d3521,'options':{'where':{'id':_0x3f85e5}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x056b=['addTags','AddTagsToMailInteraction','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x2c4c3e,_0x380a36){var _0x4a652b=function(_0x5a8796){while(--_0x5a8796){_0x2c4c3e['push'](_0x2c4c3e['shift']());}};_0x4a652b(++_0x380a36);}(_0x056b,0xb6));var _0xb056=function(_0x3733eb,_0x2d9450){_0x3733eb=_0x3733eb-0x0;var _0x4c80e3=_0x056b[_0x3733eb];return _0x4c80e3;};'use strict';var client=require('../client');exports[_0xb056('0x0')]=function(_0x556e84,_0xed6810){return client[_0xb056('0x1')](_0xb056('0x2'),{'body':_0xed6810,'options':{'where':{'id':_0x556e84}},'log':_0xb056('0x3')});};exports[_0xb056('0x4')]=function(_0x4157e0,_0x343d88){return client[_0xb056('0x1')](_0xb056('0x5'),{'body':_0x343d88,'options':{'where':{'id':_0x4157e0}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index d2f92a1..2743f44 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 _0xfc8e=['CreateMailMessage','create','Request'];(function(_0xea595,_0x444b3b){var _0x3f10ab=function(_0x2ff7b7){while(--_0x2ff7b7){_0xea595['push'](_0xea595['shift']());}};_0x3f10ab(++_0x444b3b);}(_0xfc8e,0x17b));var _0xefc8=function(_0x3dc2e8,_0x550ef9){_0x3dc2e8=_0x3dc2e8-0x0;var _0x27e6f9=_0xfc8e[_0x3dc2e8];return _0x27e6f9;};'use strict';var client=require('../client');exports[_0xefc8('0x0')]=function(_0x521c52){return client[_0xefc8('0x1')](_0xefc8('0x2'),{'body':_0x521c52,'log':'createMailMessage'});}; \ No newline at end of file +var _0x27ea=['create','../client'];(function(_0x5d4fe5,_0x1484a0){var _0x46e677=function(_0x597626){while(--_0x597626){_0x5d4fe5['push'](_0x5d4fe5['shift']());}};_0x46e677(++_0x1484a0);}(_0x27ea,0x67));var _0xa27e=function(_0x296a28,_0x196683){_0x296a28=_0x296a28-0x0;var _0x4c2c02=_0x27ea[_0x296a28];return _0x4c2c02;};'use strict';var client=require(_0xa27e('0x0'));exports[_0xa27e('0x1')]=function(_0x1206a8){return client['Request']('CreateMailMessage',{'body':_0x1206a8,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index aaef9ff..5a0a2a2 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 _0xf832=['strategy','User','Agents','name','online','mailPause','getMailQueues','../client','Request'];(function(_0x30e26d,_0x19b19c){var _0x12b3f7=function(_0x16b878){while(--_0x16b878){_0x30e26d['push'](_0x30e26d['shift']());}};_0x12b3f7(++_0x19b19c);}(_0xf832,0xc4));var _0x2f83=function(_0x2fde14,_0xb161dc){_0x2fde14=_0x2fde14-0x0;var _0x36bc78=_0xf832[_0x2fde14];return _0x36bc78;};'use strict';var client=require(_0x2f83('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x2f83('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0x2f83('0x2')],'include':[{'model':_0x2f83('0x3'),'as':_0x2f83('0x4'),'attributes':['id',_0x2f83('0x5'),_0x2f83('0x6'),_0x2f83('0x7')]}]},'log':_0x2f83('0x8')});};}; \ No newline at end of file +var _0x6799=['User','Agents','../client','Request','GetMailQueue','name','timeout','strategy'];(function(_0x125205,_0x2159a6){var _0x38e5de=function(_0x1cba72){while(--_0x1cba72){_0x125205['push'](_0x125205['shift']());}};_0x38e5de(++_0x2159a6);}(_0x6799,0x172));var _0x9679=function(_0x4b5a3d,_0x3438eb){_0x4b5a3d=_0x4b5a3d-0x0;var _0x7edab8=_0x6799[_0x4b5a3d];return _0x7edab8;};'use strict';var client=require(_0x9679('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x9679('0x1')](_0x9679('0x2'),{'options':{'raw':![],'attributes':['id',_0x9679('0x3'),_0x9679('0x4'),_0x9679('0x5')],'include':[{'model':_0x9679('0x6'),'as':_0x9679('0x7'),'attributes':['id',_0x9679('0x3'),'online','mailPause']}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 4943701..cf14cbe 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 _0xf7ea=['Request','UpdateMailQueueReport','DESC','../client','create','CreateMailQueueReport','update'];(function(_0x1329fb,_0x1cd0a3){var _0x1f5c0b=function(_0x5e410e){while(--_0x5e410e){_0x1329fb['push'](_0x1329fb['shift']());}};_0x1f5c0b(++_0x1cd0a3);}(_0xf7ea,0x137));var _0xaf7e=function(_0x3e7e99,_0x307f70){_0x3e7e99=_0x3e7e99-0x0;var _0x320794=_0xf7ea[_0x3e7e99];return _0x320794;};'use strict';var client=require(_0xaf7e('0x0'));exports[_0xaf7e('0x1')]=function(_0x376aaf){return client['Request']('CreateMailQueueReport',{'body':_0x376aaf,'log':_0xaf7e('0x2')});};exports[_0xaf7e('0x3')]=function(_0x186dc4,_0xd45ba8){return client[_0xaf7e('0x4')](_0xaf7e('0x5'),{'body':_0xd45ba8,'options':{'where':{'uniqueid':_0x186dc4},'order':[['id',_0xaf7e('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x3e88=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client'];(function(_0x2fe90e,_0x4cbf3c){var _0x46a4f4=function(_0x2187e1){while(--_0x2187e1){_0x2fe90e['push'](_0x2fe90e['shift']());}};_0x46a4f4(++_0x4cbf3c);}(_0x3e88,0x92));var _0x83e8=function(_0x5c26d7,_0x5ecd19){_0x5c26d7=_0x5c26d7-0x0;var _0x39b9f6=_0x3e88[_0x5c26d7];return _0x39b9f6;};'use strict';var client=require(_0x83e8('0x0'));exports[_0x83e8('0x1')]=function(_0x5b6377){return client[_0x83e8('0x2')](_0x83e8('0x3'),{'body':_0x5b6377,'log':_0x83e8('0x3')});};exports[_0x83e8('0x4')]=function(_0x39a7b1,_0x380b11){return client['Request'](_0x83e8('0x5'),{'body':_0x380b11,'options':{'where':{'uniqueid':_0x39a7b1},'order':[['id',_0x83e8('0x6')]],'limit':0x1},'log':_0x83e8('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 4c7b33a..6095271 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 _0xed93=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xed93,0x19f));var _0x3ed9=function(_0x5ab9fb,_0x14634f){_0x5ab9fb=_0x5ab9fb-0x0;var _0x26ca14=_0xed93[_0x5ab9fb];return _0x26ca14;};'use strict';var client=require('../client');exports[_0x3ed9('0x0')]=function(_0xe10daf,_0x1c1cd3){return client[_0x3ed9('0x1')](_0x3ed9('0x2'),{'body':_0x1c1cd3,'options':{'where':{'id':_0xe10daf}},'log':_0x3ed9('0x3')});};exports[_0x3ed9('0x4')]=function(_0x332c06,_0x3accfb){return client[_0x3ed9('0x1')](_0x3ed9('0x5'),{'body':_0x3accfb,'options':{'where':{'id':_0x332c06}},'log':_0x3ed9('0x6')});}; \ No newline at end of file +var _0x56cf=['AddTagsToOpenchannelInteraction','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x87d385,_0x1b2297){var _0x1d890f=function(_0x4a3060){while(--_0x4a3060){_0x87d385['push'](_0x87d385['shift']());}};_0x1d890f(++_0x1b2297);}(_0x56cf,0xeb));var _0xf56c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56cf[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xf56c('0x0')]=function(_0x16d177,_0x5728e4){return client[_0xf56c('0x1')](_0xf56c('0x2'),{'body':_0x5728e4,'options':{'where':{'id':_0x16d177}},'log':_0xf56c('0x3')});};exports[_0xf56c('0x4')]=function(_0x214312,_0x1efa8b){return client['Request'](_0xf56c('0x5'),{'body':_0x1efa8b,'options':{'where':{'id':_0x214312}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 8860837..b66e6f9 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 _0xdeb6=['CreateOpenchannelMessage','createOpenchannelMessage','../client','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdeb6,0x1b2));var _0x6deb=function(_0x2447d7,_0x3466fe){_0x2447d7=_0x2447d7-0x0;var _0x262442=_0xdeb6[_0x2447d7];return _0x262442;};'use strict';var client=require(_0x6deb('0x0'));exports['create']=function(_0x4f57fa){return client[_0x6deb('0x1')](_0x6deb('0x2'),{'body':_0x4f57fa,'log':_0x6deb('0x3')});}; \ No newline at end of file +var _0xd23a=['CreateOpenchannelMessage','../client','Request'];(function(_0x2a0350,_0x249319){var _0x425220=function(_0x1d5f78){while(--_0x1d5f78){_0x2a0350['push'](_0x2a0350['shift']());}};_0x425220(++_0x249319);}(_0xd23a,0x6a));var _0xad23=function(_0x5b68df,_0x30d4d9){_0x5b68df=_0x5b68df-0x0;var _0x319c5d=_0xd23a[_0x5b68df];return _0x319c5d;};'use strict';var client=require(_0xad23('0x0'));exports['create']=function(_0xfcc40d){return client[_0xad23('0x1')](_0xad23('0x2'),{'body':_0xfcc40d,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 6b91883..2f33104 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 _0x6aa7=['GetOpenchannelQueue','name','timeout','strategy','Agents','online','openchannelPause','../client','getOpenchannelQueues','Request'];(function(_0x1b347a,_0x666370){var _0x1572b5=function(_0x5c0968){while(--_0x5c0968){_0x1b347a['push'](_0x1b347a['shift']());}};_0x1572b5(++_0x666370);}(_0x6aa7,0x165));var _0x76aa=function(_0x14ebb9,_0x5c1e09){_0x14ebb9=_0x14ebb9-0x0;var _0x540c29=_0x6aa7[_0x14ebb9];return _0x540c29;};'use strict';var client=require(_0x76aa('0x0'));exports[_0x76aa('0x1')]=function(){return function(){return client[_0x76aa('0x2')](_0x76aa('0x3'),{'options':{'raw':![],'attributes':['id',_0x76aa('0x4'),_0x76aa('0x5'),_0x76aa('0x6')],'include':[{'model':'User','as':_0x76aa('0x7'),'attributes':['id',_0x76aa('0x4'),_0x76aa('0x8'),_0x76aa('0x9')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x2e77=['GetOpenchannelQueue','name','strategy','User','Agents','online','../client','getOpenchannelQueues','Request'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x2e77,0x12f));var _0x72e7=function(_0x33292b,_0x5360a9){_0x33292b=_0x33292b-0x0;var _0x294aa1=_0x2e77[_0x33292b];return _0x294aa1;};'use strict';var client=require(_0x72e7('0x0'));exports[_0x72e7('0x1')]=function(){return function(){return client[_0x72e7('0x2')](_0x72e7('0x3'),{'options':{'raw':![],'attributes':['id',_0x72e7('0x4'),'timeout',_0x72e7('0x5')],'include':[{'model':_0x72e7('0x6'),'as':_0x72e7('0x7'),'attributes':['id','name',_0x72e7('0x8'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index ea90ae9..a98339e 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 _0x624a=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','create','Request'];(function(_0x349c79,_0x3d4563){var _0x78bfd2=function(_0x3c0e58){while(--_0x3c0e58){_0x349c79['push'](_0x349c79['shift']());}};_0x78bfd2(++_0x3d4563);}(_0x624a,0x143));var _0xa624=function(_0x1d8a15,_0x4acbca){_0x1d8a15=_0x1d8a15-0x0;var _0x17b14b=_0x624a[_0x1d8a15];return _0x17b14b;};'use strict';var client=require('../client');exports[_0xa624('0x0')]=function(_0x48b4ee){return client[_0xa624('0x1')](_0xa624('0x2'),{'body':_0x48b4ee,'log':_0xa624('0x2')});};exports[_0xa624('0x3')]=function(_0x5b55d0,_0x5d780c){return client[_0xa624('0x1')]('UpdateOpenchannelQueueReport',{'body':_0x5d780c,'options':{'where':{'uniqueid':_0x5b55d0},'order':[['id','DESC']],'limit':0x1},'log':_0xa624('0x4')});}; \ No newline at end of file +var _0xc9fb=['CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport','../client','create'];(function(_0x49378e,_0xa42d4b){var _0x243264=function(_0xed1456){while(--_0xed1456){_0x49378e['push'](_0x49378e['shift']());}};_0x243264(++_0xa42d4b);}(_0xc9fb,0x148));var _0xbc9f=function(_0x3b1fb7,_0x2ea375){_0x3b1fb7=_0x3b1fb7-0x0;var _0x31d6c5=_0xc9fb[_0x3b1fb7];return _0x31d6c5;};'use strict';var client=require(_0xbc9f('0x0'));exports[_0xbc9f('0x1')]=function(_0x3b19e1){return client['Request'](_0xbc9f('0x2'),{'body':_0x3b19e1,'log':'CreateOpenchannelQueueReport'});};exports[_0xbc9f('0x3')]=function(_0x38a859,_0x347405){return client[_0xbc9f('0x4')](_0xbc9f('0x5'),{'body':_0x347405,'options':{'where':{'uniqueid':_0x38a859},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index e6e3fca..fcbb9cd 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 _0x864a=['../client','update','addTags','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x4cc921,_0x4c43f4){var _0x15f72a=function(_0x1b7965){while(--_0x1b7965){_0x4cc921['push'](_0x4cc921['shift']());}};_0x15f72a(++_0x4c43f4);}(_0x864a,0x8a));var _0xa864=function(_0x1abcec,_0x18db4d){_0x1abcec=_0x1abcec-0x0;var _0x5729ba=_0x864a[_0x1abcec];return _0x5729ba;};'use strict';var client=require(_0xa864('0x0'));exports[_0xa864('0x1')]=function(_0x3ac90c,_0x389e6e){return client['Request']('UpdateSmsInteraction',{'body':_0x389e6e,'options':{'where':{'id':_0x3ac90c}},'log':'updateSmsInteraction'});};exports[_0xa864('0x2')]=function(_0x5b7903,_0x5747bc){return client[_0xa864('0x3')](_0xa864('0x4'),{'body':_0x5747bc,'options':{'where':{'id':_0x5b7903}},'log':_0xa864('0x5')});}; \ No newline at end of file +var _0x2209=['update','Request','updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x297be0,_0x108af9){var _0x163430=function(_0x4ded27){while(--_0x4ded27){_0x297be0['push'](_0x297be0['shift']());}};_0x163430(++_0x108af9);}(_0x2209,0x95));var _0x9220=function(_0x3239ff,_0x2bd7da){_0x3239ff=_0x3239ff-0x0;var _0x4cf834=_0x2209[_0x3239ff];return _0x4cf834;};'use strict';var client=require(_0x9220('0x0'));exports[_0x9220('0x1')]=function(_0x165787,_0x19bb93){return client[_0x9220('0x2')]('UpdateSmsInteraction',{'body':_0x19bb93,'options':{'where':{'id':_0x165787}},'log':_0x9220('0x3')});};exports['addTags']=function(_0x348220,_0x2fddae){return client[_0x9220('0x2')](_0x9220('0x4'),{'body':_0x2fddae,'options':{'where':{'id':_0x348220}},'log':_0x9220('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 64451c2..8581057 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 _0xafa9=['../client','create','Request','CreateSmsMessage'];(function(_0x298670,_0x48e9d2){var _0x586fbb=function(_0x5afa86){while(--_0x5afa86){_0x298670['push'](_0x298670['shift']());}};_0x586fbb(++_0x48e9d2);}(_0xafa9,0xb4));var _0x9afa=function(_0xe5287b,_0x26b8ab){_0xe5287b=_0xe5287b-0x0;var _0x346f77=_0xafa9[_0xe5287b];return _0x346f77;};'use strict';var client=require(_0x9afa('0x0'));exports[_0x9afa('0x1')]=function(_0x47d42e){return client[_0x9afa('0x2')](_0x9afa('0x3'),{'body':_0x47d42e,'log':'createSmsMessage'});}; \ No newline at end of file +var _0xcd16=['createSmsMessage','../client','create','Request','CreateSmsMessage'];(function(_0x2254a0,_0x41f33e){var _0x35cd31=function(_0x5242d5){while(--_0x5242d5){_0x2254a0['push'](_0x2254a0['shift']());}};_0x35cd31(++_0x41f33e);}(_0xcd16,0x1be));var _0x6cd1=function(_0x42ac9f,_0x3677c6){_0x42ac9f=_0x42ac9f-0x0;var _0xe2e7d0=_0xcd16[_0x42ac9f];return _0xe2e7d0;};'use strict';var client=require(_0x6cd1('0x0'));exports[_0x6cd1('0x1')]=function(_0x4103ac){return client[_0x6cd1('0x2')](_0x6cd1('0x3'),{'body':_0x4103ac,'log':_0x6cd1('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index cf906af..0a8e755 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(_0x3b42f0,_0x746dbd){var _0x2c548d=function(_0x52d1d7){while(--_0x52d1d7){_0x3b42f0['push'](_0x3b42f0['shift']());}};_0x2c548d(++_0x746dbd);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1911ed,_0x4e8c73){_0x1911ed=_0x1911ed-0x0;var _0x11edaa=_0xcb91[_0x1911ed];return _0x11edaa;};'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(_0x26b59d,_0xbf2e8a){var _0x3c1f19=function(_0x3efa63){while(--_0x3efa63){_0x26b59d['push'](_0x26b59d['shift']());}};_0x3c1f19(++_0xbf2e8a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 ff01fa6..8c868f3 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x3e2b57,_0x491b70){var _0x3dd4f7=function(_0x40a3e6){while(--_0x40a3e6){_0x3e2b57['push'](_0x3e2b57['shift']());}};_0x3dd4f7(++_0x491b70);}(_0x34e8,0x12c));var _0x834e=function(_0x152a53,_0x5bece0){_0x152a53=_0x152a53-0x0;var _0x12ad3d=_0x34e8[_0x152a53];return _0x12ad3d;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file +var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0xf979e8,_0x42c7f3){var _0x9a7d69=function(_0x478713){while(--_0x478713){_0xf979e8['push'](_0xf979e8['shift']());}};_0x9a7d69(++_0x42c7f3);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 803c40f..2647409 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(_0x5486e5,_0x97d4ed){var _0x13267f=function(_0x44f01c){while(--_0x44f01c){_0x5486e5['push'](_0x5486e5['shift']());}};_0x13267f(++_0x97d4ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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(_0x168094,_0x3a2cb1){var _0x2c2a7a=function(_0x277a85){while(--_0x277a85){_0x168094['push'](_0x168094['shift']());}};_0x2c2a7a(++_0x3a2cb1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 157138b..99f7cda 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 _0x3837=['update','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction'];(function(_0x5b26cb,_0x527ab0){var _0x563d12=function(_0x472b38){while(--_0x472b38){_0x5b26cb['push'](_0x5b26cb['shift']());}};_0x563d12(++_0x527ab0);}(_0x3837,0x1d1));var _0x7383=function(_0x122677,_0x15184b){_0x122677=_0x122677-0x0;var _0x574286=_0x3837[_0x122677];return _0x574286;};'use strict';var client=require('../client');exports[_0x7383('0x0')]=function(_0x54e81e,_0xccf9d4){return client['Request'](_0x7383('0x1'),{'body':_0xccf9d4,'options':{'where':{'id':_0x54e81e}},'log':_0x7383('0x2')});};exports[_0x7383('0x3')]=function(_0x227ab2,_0xf57468){return client['Request']('AddTagsToWhatsappInteraction',{'body':_0xf57468,'options':{'where':{'id':_0x227ab2}},'log':_0x7383('0x4')});}; \ No newline at end of file +var _0x307e=['Request','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update'];(function(_0x43a65b,_0xf6f770){var _0x201e50=function(_0x8a9718){while(--_0x8a9718){_0x43a65b['push'](_0x43a65b['shift']());}};_0x201e50(++_0xf6f770);}(_0x307e,0xc9));var _0xe307=function(_0x2ca6ba,_0x35adc8){_0x2ca6ba=_0x2ca6ba-0x0;var _0x2ba5c1=_0x307e[_0x2ca6ba];return _0x2ba5c1;};'use strict';var client=require(_0xe307('0x0'));exports[_0xe307('0x1')]=function(_0x3104f1,_0x4689ed){return client[_0xe307('0x2')]('UpdateWhatsappInteraction',{'body':_0x4689ed,'options':{'where':{'id':_0x3104f1}},'log':_0xe307('0x3')});};exports[_0xe307('0x4')]=function(_0x516a1d,_0x1eee4d){return client['Request'](_0xe307('0x5'),{'body':_0x1eee4d,'options':{'where':{'id':_0x516a1d}},'log':_0xe307('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index ff0e3a5..4c8c1d9 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 _0xc8c6=['Request','CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc8c6,0x80));var _0x6c8c=function(_0x56ad78,_0x52c1ad){_0x56ad78=_0x56ad78-0x0;var _0x1a0e7a=_0xc8c6[_0x56ad78];return _0x1a0e7a;};'use strict';var client=require(_0x6c8c('0x0'));exports[_0x6c8c('0x1')]=function(_0x859abf){return client[_0x6c8c('0x2')](_0x6c8c('0x3'),{'body':_0x859abf,'log':_0x6c8c('0x4')});}; \ No newline at end of file +var _0xd64d=['Request','CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x43fe70,_0xd87ace){var _0x4f8159=function(_0xb24446){while(--_0xb24446){_0x43fe70['push'](_0x43fe70['shift']());}};_0x4f8159(++_0xd87ace);}(_0xd64d,0x8a));var _0xdd64=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd64d[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0xdd64('0x0'));exports[_0xdd64('0x1')]=function(_0xf3a83b){return client[_0xdd64('0x2')](_0xdd64('0x3'),{'body':_0xf3a83b,'log':_0xdd64('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index ead2496..66f77fd 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 _0xf3ac=['../client','Request','GetWhatsappQueue','name','timeout','strategy','Agents','online','getWhatsappQueues'];(function(_0x331c05,_0x66025e){var _0x3f145a=function(_0x4a1377){while(--_0x4a1377){_0x331c05['push'](_0x331c05['shift']());}};_0x3f145a(++_0x66025e);}(_0xf3ac,0x1cb));var _0xcf3a=function(_0x2eef33,_0x45ac94){_0x2eef33=_0x2eef33-0x0;var _0x342d54=_0xf3ac[_0x2eef33];return _0x342d54;};'use strict';var client=require(_0xcf3a('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0xcf3a('0x1')](_0xcf3a('0x2'),{'options':{'raw':![],'attributes':['id',_0xcf3a('0x3'),_0xcf3a('0x4'),_0xcf3a('0x5')],'include':[{'model':'User','as':_0xcf3a('0x6'),'attributes':['id',_0xcf3a('0x3'),_0xcf3a('0x7'),'whatsappPause']}]},'log':_0xcf3a('0x8')});};}; \ No newline at end of file +var _0xa438=['whatsappPause','../client','Request','GetWhatsappQueue','name','timeout','strategy','Agents','online'];(function(_0x35927c,_0x176a39){var _0x28f630=function(_0x4d58e5){while(--_0x4d58e5){_0x35927c['push'](_0x35927c['shift']());}};_0x28f630(++_0x176a39);}(_0xa438,0x14e));var _0x8a43=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa438[_0x8de54f];return _0x14cba4;};'use strict';var client=require(_0x8a43('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x8a43('0x1')](_0x8a43('0x2'),{'options':{'raw':![],'attributes':['id',_0x8a43('0x3'),_0x8a43('0x4'),_0x8a43('0x5')],'include':[{'model':'User','as':_0x8a43('0x6'),'attributes':['id',_0x8a43('0x3'),_0x8a43('0x7'),_0x8a43('0x8')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index f1c5d8f..ee4a0cb 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 _0xd785=['DESC','../client','create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport'];(function(_0x5b422d,_0x44bfde){var _0x226691=function(_0xcb564e){while(--_0xcb564e){_0x5b422d['push'](_0x5b422d['shift']());}};_0x226691(++_0x44bfde);}(_0xd785,0x14a));var _0x5d78=function(_0x4a9a17,_0x273a09){_0x4a9a17=_0x4a9a17-0x0;var _0x30e831=_0xd785[_0x4a9a17];return _0x30e831;};'use strict';var client=require(_0x5d78('0x0'));exports[_0x5d78('0x1')]=function(_0xd8f939){return client[_0x5d78('0x2')](_0x5d78('0x3'),{'body':_0xd8f939,'log':_0x5d78('0x3')});};exports[_0x5d78('0x4')]=function(_0x4dcef1,_0x207af9){return client[_0x5d78('0x2')](_0x5d78('0x5'),{'body':_0x207af9,'options':{'where':{'uniqueid':_0x4dcef1},'order':[['id',_0x5d78('0x6')]],'limit':0x1},'log':_0x5d78('0x5')});}; \ No newline at end of file +var _0x5312=['create','Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x3febf8,_0x3a20b1){var _0x56b67d=function(_0x123166){while(--_0x123166){_0x3febf8['push'](_0x3febf8['shift']());}};_0x56b67d(++_0x3a20b1);}(_0x5312,0x113));var _0x2531=function(_0x171cfc,_0x173a65){_0x171cfc=_0x171cfc-0x0;var _0x164df=_0x5312[_0x171cfc];return _0x164df;};'use strict';var client=require(_0x2531('0x0'));exports[_0x2531('0x1')]=function(_0xec8cab){return client[_0x2531('0x2')](_0x2531('0x3'),{'body':_0xec8cab,'log':_0x2531('0x3')});};exports['update']=function(_0x553b0d,_0x31e410){return client[_0x2531('0x2')](_0x2531('0x4'),{'body':_0x31e410,'options':{'where':{'uniqueid':_0x553b0d},'order':[['id',_0x2531('0x5')]],'limit':0x1},'log':_0x2531('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 603f7b9..0876704 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 _0x8a85=['next','agent','error','log','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','../../../../config/logger','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','format','name','toLowerCase','consequence','[%s][AGENT]\x20%s','map','join','stop','timeout','createQueue','atimeout','channel','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x8a85,0x106));var _0x58a8=function(_0x1222bf,_0x33eab0){_0x1222bf=_0x1222bf-0x0;var _0x1da3e9=_0x8a85[_0x1222bf];return _0x1da3e9;};'use strict';var schema=require(_0x58a8('0x0'));var _=require('lodash');var util=require(_0x58a8('0x1'));var seqqueue=require(_0x58a8('0x2'));var logger=require(_0x58a8('0x3'))(_0x58a8('0x4'));var strategy=require(_0x58a8('0x5'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x58a8('0x6')},'timeout':{'type':_0x58a8('0x7'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x19914b,_0x4e9ece,_0x592a3d){return logger['info'](util[_0x58a8('0x8')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x19914b,_0x4e9ece[_0x58a8('0x9')],_0x592a3d));}function handleFindAgent(_0x5be750){return function(_0x4fa0e4){return _0x4fa0e4['name'][_0x58a8('0xa')]()===_0x5be750[_0x58a8('0xa')]();};}exports[_0x58a8('0xb')]=function(_0x2a351f,_0x76732d,_0x2d325f,_0x3e3a7b){return function(_0x50c81e){try{var _0xf9ab73={'name':_0x76732d[0x0],'timeout':_0x76732d[0x1]};var _0x40945a=queue[_0x58a8('0x0')](_0xf9ab73,{'typecast':!![]});if(_0x40945a['length']){logger['error'](_0x58a8('0xc'),_0x2a351f,_[_0x58a8('0xd')](_0x40945a,'message')[_0x58a8('0xe')](',\x20'));_0x50c81e[_0x58a8('0xf')]();}else{var _0x1c13da=_['find'](_0x2d325f['agents'],handleFindAgent(_0xf9ab73[_0x58a8('0x9')]));if(_0x1c13da){var _0x236f10=(_0xf9ab73[_0x58a8('0x10')]||0xa)*0x3e8;var _0x116a47,_0x101002;var _0x131eb5=seqqueue[_0x58a8('0x11')](_0x236f10);_0x131eb5['id']=_0x2a351f;_0x131eb5[_0x58a8('0x12')]=_0x236f10;_0x131eb5[_0x58a8('0x13')]=_0x3e3a7b['channel'];writeLog(_0x2a351f,_0x1c13da,util['format']('START:%s',_0x236f10));_0x2d325f['rules'][_0x2a351f]['on'](_0x58a8('0x14'),function(){logger[_0x58a8('0x15')](_0x58a8('0x16'),_0x2a351f);clearTimeout(_0x101002);_0x101002=undefined;_0x131eb5[_0x58a8('0x17')]();if(_0x2d325f[_0x58a8('0x18')][_0x2a351f]){delete _0x2d325f[_0x58a8('0x18')][_0x2a351f];}_0x50c81e[_0x58a8('0xf')]();});_0x2d325f['rules'][_0x2a351f]['on'](_0x58a8('0x19'),function(){if(_0x2d325f[_0x58a8('0x18')][_0x2a351f]){delete _0x2d325f[_0x58a8('0x18')][_0x2a351f];}});_0x101002=setTimeout(function(){logger[_0x58a8('0x15')]('[%s][AGENT]\x20ROUTING\x20END',_0x2a351f);clearTimeout(_0x101002);_0x131eb5[_0x58a8('0x17')]();_0x50c81e[_0x58a8('0x1a')]();},_0x236f10);strategy[_0x58a8('0x1b')](_0x131eb5,_0x1c13da,_0x2d325f,_0x3e3a7b);}else{logger[_0x58a8('0x1c')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x2a351f,_0xf9ab73[_0x58a8('0x9')]);_0x50c81e[_0x58a8('0xf')]();}}}catch(_0x15cdd6){console[_0x58a8('0x1d')](_0x15cdd6);logger['error'](_0x58a8('0x1e'),_0x2a351f,_0x15cdd6[_0x58a8('0x1f')]);_0x50c81e[_0x58a8('0xf')]();}};}; \ No newline at end of file +var _0x6cf4=['stack','validate','lodash','seq-queue','../../../../config/logger','routing','./strategy','string','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','atimeout','channel','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END','agent','error','log'];(function(_0x5b99bb,_0x437f83){var _0x3cf721=function(_0x180f57){while(--_0x180f57){_0x5b99bb['push'](_0x5b99bb['shift']());}};_0x3cf721(++_0x437f83);}(_0x6cf4,0x14b));var _0x46cf=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0x6cf4[_0x349367];return _0x14179b;};'use strict';var schema=require(_0x46cf('0x0'));var _=require(_0x46cf('0x1'));var util=require('util');var seqqueue=require(_0x46cf('0x2'));var logger=require(_0x46cf('0x3'))(_0x46cf('0x4'));var strategy=require(_0x46cf('0x5'));var queue=schema({'name':{'type':_0x46cf('0x6'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x46cf('0x7')}});function writeLog(_0x5c01ac,_0x525bda,_0x16d6e5){return logger['info'](util[_0x46cf('0x8')](_0x46cf('0x9'),_0x5c01ac,_0x525bda[_0x46cf('0xa')],_0x16d6e5));}function handleFindAgent(_0xf5ce9){return function(_0x6cbbd2){return _0x6cbbd2['name']['toLowerCase']()===_0xf5ce9[_0x46cf('0xb')]();};}exports[_0x46cf('0xc')]=function(_0x129967,_0x3dd385,_0x1e13bc,_0x4db7e0){return function(_0x277d6f){try{var _0x69b7d7={'name':_0x3dd385[0x0],'timeout':_0x3dd385[0x1]};var _0x2c96f3=queue['validate'](_0x69b7d7,{'typecast':!![]});if(_0x2c96f3['length']){logger['error'](_0x46cf('0xd'),_0x129967,_[_0x46cf('0xe')](_0x2c96f3,_0x46cf('0xf'))[_0x46cf('0x10')](',\x20'));_0x277d6f[_0x46cf('0x11')]();}else{var _0x17632d=_[_0x46cf('0x12')](_0x1e13bc[_0x46cf('0x13')],handleFindAgent(_0x69b7d7['name']));if(_0x17632d){var _0x3bc140=(_0x69b7d7[_0x46cf('0x14')]||0xa)*0x3e8;var _0x537e05,_0x2c9530;var _0x197876=seqqueue['createQueue'](_0x3bc140);_0x197876['id']=_0x129967;_0x197876[_0x46cf('0x15')]=_0x3bc140;_0x197876['channel']=_0x4db7e0[_0x46cf('0x16')];writeLog(_0x129967,_0x17632d,util['format']('START:%s',_0x3bc140));_0x1e13bc[_0x46cf('0x17')][_0x129967]['on'](_0x46cf('0x18'),function(){logger[_0x46cf('0x19')](_0x46cf('0x1a'),_0x129967);clearTimeout(_0x2c9530);_0x2c9530=undefined;_0x197876[_0x46cf('0x1b')]();if(_0x1e13bc['rules'][_0x129967]){delete _0x1e13bc[_0x46cf('0x17')][_0x129967];}_0x277d6f[_0x46cf('0x11')]();});_0x1e13bc[_0x46cf('0x17')][_0x129967]['on']('complete',function(){if(_0x1e13bc[_0x46cf('0x17')][_0x129967]){delete _0x1e13bc['rules'][_0x129967];}});_0x2c9530=setTimeout(function(){logger[_0x46cf('0x19')](_0x46cf('0x1c'),_0x129967);clearTimeout(_0x2c9530);_0x197876[_0x46cf('0x1b')]();_0x277d6f['next']();},_0x3bc140);strategy[_0x46cf('0x1d')](_0x197876,_0x17632d,_0x1e13bc,_0x4db7e0);}else{logger[_0x46cf('0x1e')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x129967,_0x69b7d7[_0x46cf('0xa')]);_0x277d6f[_0x46cf('0x11')]();}}}catch(_0x2833d0){console[_0x46cf('0x1f')](_0x2833d0);logger[_0x46cf('0x1e')]('[%s][QUEUE]\x20%s',_0x129967,_0x2833d0[_0x46cf('0x20')]);_0x277d6f[_0x46cf('0x11')]();}};}; \ 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 b299fd8..29d0aa6 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 _0xb081=['../../rpc/smsMessage','../../rpc/faxMessage','isNil','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','interaction','chat','ChatWebsiteId','upperFirst','account','InteractionId','isEmpty','getMustacheRender','create','then','body','catch','error','stringify','finally','info','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString','postText','amazonlex','providerResponse','Message','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage'];(function(_0x51f50c,_0x1a1d17){var _0x330a64=function(_0xac3388){while(--_0xac3388){_0x51f50c['push'](_0x51f50c['shift']());}};_0x330a64(++_0x1a1d17);}(_0xb081,0x8b));var _0x1b08=function(_0x25b854,_0x2e19ff){_0x25b854=_0x25b854-0x0;var _0x35bcd8=_0xb081[_0x25b854];return _0x35bcd8;};'use strict';var _=require(_0x1b08('0x0'));var moment=require(_0x1b08('0x1'));var AWS=require(_0x1b08('0x2'));var utils=require(_0x1b08('0x3'));var logger=require(_0x1b08('0x4'))(_0x1b08('0x5'));var rpc={'chatMessage':require(_0x1b08('0x6')),'openchannelMessage':require(_0x1b08('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x1b08('0x8')),'faxMessage':require(_0x1b08('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x32b761,_0xab6dec){return function(_0x5db309){try{if(!_[_0x1b08('0xa')](this['interaction'][_0x1b08('0xb')])){logger['info'](_0x1b08('0xc'),_0x32b761,_0x1b08('0xd'));return _0x5db309[_0x1b08('0xe')]();}var _0x3817c3={'ContactId':this['contact']['id'],'sentAt':moment()[_0x1b08('0xf')](_0x1b08('0x10')),'direction':'out'};if(this[_0x1b08('0x11')]===_0x1b08('0x12')||this[_0x1b08('0x11')]===_0x1b08('0x13')){_0x3817c3[_0x1b08('0x14')]=this[_0x1b08('0x15')]['phone'];}var _0x5de786=this[_0x1b08('0x11')];if(_0x5de786===_0x1b08('0x16')){_0x3817c3[_0x1b08('0x17')]=this['account']['id'];}else{_0x3817c3[_[_0x1b08('0x18')](_0x5de786)+'AccountId']=this[_0x1b08('0x19')]['id'];}_0x3817c3[_[_0x1b08('0x18')](_0x5de786)+_0x1b08('0x1a')]=this[_0x1b08('0x15')]['id'];if(this[_0x1b08('0x15')]['created']){var _0x1a25e2=_0xab6dec[0x4];if(!_[_0x1b08('0x1b')](_0x1a25e2)){_0x3817c3['body']=utils[_0x1b08('0x1c')](_0x1a25e2,this);return rpc[_0x5de786+'Message'][_0x1b08('0x1d')](_0x3817c3)[_0x1b08('0x1e')](function(_0x4864c1){logger['info'](_0x1b08('0xc'),_0x32b761,_0x3817c3[_0x1b08('0x1f')]);})[_0x1b08('0x20')](function(_0xd15750){logger[_0x1b08('0x21')](_0x1b08('0xc'),_0x32b761,JSON[_0x1b08('0x22')](_0xd15750));})[_0x1b08('0x23')](function(){logger[_0x1b08('0x24')](_0x1b08('0x25'),_0x32b761);_0x5db309[_0x1b08('0x26')]();});}else{logger[_0x1b08('0x24')](_0x1b08('0x27'),_0x32b761);_0x5db309[_0x1b08('0x26')]();}}else{var _0x42a1ff=this;var _0xbcfb13=new AWS['LexRuntime']({'accessKeyId':_0xab6dec[0x0],'secretAccessKey':_0xab6dec[0x1],'region':_0xab6dec[0x2]});var _0x2dfdbd={'botAlias':_0x1b08('0x28'),'botName':_0xab6dec[0x3],'inputText':this[_0x1b08('0x29')][_0x1b08('0x1f')],'userId':this[_0x1b08('0x11')]+':'+this[_0x1b08('0x15')]['id'][_0x1b08('0x2a')]()};_0xbcfb13[_0x1b08('0x2b')](_0x2dfdbd,function(_0x46852d,_0x1c84f4){if(_0x46852d){logger[_0x1b08('0x21')]('[%s][AMAZONLEX]\x20%s',_0x32b761,_0x46852d['message']);_0x5db309[_0x1b08('0xe')]();}else if(_0x1c84f4&&_0x1c84f4[_0x1b08('0x29')]){_0x42a1ff[_0x1b08('0x1f')][_0x1b08('0x2c')]=_0x1c84f4;_0x3817c3['body']=_0x1c84f4[_0x1b08('0x29')];_0x3817c3['providerName']=_0x1b08('0x2c');_0x3817c3[_0x1b08('0x2d')]=JSON[_0x1b08('0x22')](_0x1c84f4);return rpc[_0x5de786+_0x1b08('0x2e')]['create'](_0x3817c3)['then'](function(_0x1b5036){logger[_0x1b08('0x24')](_0x1b08('0xc'),_0x32b761,_0x3817c3['body']);if(_0x1c84f4[_0x1b08('0x2f')]==_0x1b08('0x30')){_0x5db309[_0x1b08('0xe')]();}else{_0x5db309[_0x1b08('0x26')]();}})['catch'](function(_0x5b627b){logger[_0x1b08('0x21')](_0x1b08('0xc'),_0x32b761,JSON[_0x1b08('0x22')](_0x5b627b));_0x5db309[_0x1b08('0xe')]();});}else{_0x5db309[_0x1b08('0xe')]();}});}}catch(_0x3f53b0){logger['error']('[%s][AMAZONLEX]\x20%s',_0x32b761,JSON['stringify'](_0x3f53b0));_0x5db309[_0x1b08('0x26')]();}};}; \ No newline at end of file +var _0xb07b=['Failed','lodash','aws-sdk','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','[%s][AMAZONLEX]\x20%s','stringify','stop','LexRuntime','$LATEST','message','toString','postText','next','amazonlex','providerName','providerResponse','dialogState'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0xb07b,0x189));var _0xbb07=function(_0x37473e,_0x4a1aa8){_0x37473e=_0x37473e-0x0;var _0x2635f7=_0xb07b[_0x37473e];return _0x2635f7;};'use strict';var _=require(_0xbb07('0x0'));var moment=require('moment');var AWS=require(_0xbb07('0x1'));var utils=require('./utils');var logger=require(_0xbb07('0x2'))(_0xbb07('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xbb07('0x4')),'mailMessage':require(_0xbb07('0x5')),'smsMessage':require(_0xbb07('0x6')),'faxMessage':require(_0xbb07('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xbb07('0x8')]=function(_0x533348,_0x2a05a3){return function(_0x444370){try{if(!_[_0xbb07('0x9')](this[_0xbb07('0xa')][_0xbb07('0xb')])){logger[_0xbb07('0xc')]('[%s][AMAZONLEX]\x20%s',_0x533348,_0xbb07('0xd'));return _0x444370['next']();}var _0x3db203={'ContactId':this[_0xbb07('0xe')]['id'],'sentAt':moment()[_0xbb07('0xf')](_0xbb07('0x10')),'direction':'out'};if(this[_0xbb07('0x11')]===_0xbb07('0x12')||this[_0xbb07('0x11')]===_0xbb07('0x13')){_0x3db203['phone']=this[_0xbb07('0xa')][_0xbb07('0x14')];}var _0x22a552=this[_0xbb07('0x11')];if(_0x22a552==='chat'){_0x3db203[_0xbb07('0x15')]=this[_0xbb07('0x16')]['id'];}else{_0x3db203[_['upperFirst'](_0x22a552)+_0xbb07('0x17')]=this[_0xbb07('0x16')]['id'];}_0x3db203[_[_0xbb07('0x18')](_0x22a552)+_0xbb07('0x19')]=this['interaction']['id'];if(this['interaction'][_0xbb07('0x1a')]){var _0x1e0a56=_0x2a05a3[0x4];if(!_[_0xbb07('0x1b')](_0x1e0a56)){_0x3db203[_0xbb07('0x1c')]=utils[_0xbb07('0x1d')](_0x1e0a56,this);return rpc[_0x22a552+_0xbb07('0x1e')][_0xbb07('0x1f')](_0x3db203)[_0xbb07('0x20')](function(_0x4056da){logger[_0xbb07('0xc')]('[%s][AMAZONLEX]\x20%s',_0x533348,_0x3db203['body']);})[_0xbb07('0x21')](function(_0x47f19f){logger[_0xbb07('0x22')](_0xbb07('0x23'),_0x533348,JSON[_0xbb07('0x24')](_0x47f19f));})['finally'](function(){logger[_0xbb07('0xc')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x533348);_0x444370['stop']();});}else{logger[_0xbb07('0xc')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x533348);_0x444370[_0xbb07('0x25')]();}}else{var _0xe408fb=this;var _0x220747=new AWS[(_0xbb07('0x26'))]({'accessKeyId':_0x2a05a3[0x0],'secretAccessKey':_0x2a05a3[0x1],'region':_0x2a05a3[0x2]});var _0x16bf34={'botAlias':_0xbb07('0x27'),'botName':_0x2a05a3[0x3],'inputText':this[_0xbb07('0x28')][_0xbb07('0x1c')],'userId':this[_0xbb07('0x11')]+':'+this[_0xbb07('0xa')]['id'][_0xbb07('0x29')]()};_0x220747[_0xbb07('0x2a')](_0x16bf34,function(_0x53ab03,_0x269cce){if(_0x53ab03){logger['error'](_0xbb07('0x23'),_0x533348,_0x53ab03[_0xbb07('0x28')]);_0x444370[_0xbb07('0x2b')]();}else if(_0x269cce&&_0x269cce['message']){_0xe408fb[_0xbb07('0x1c')][_0xbb07('0x2c')]=_0x269cce;_0x3db203[_0xbb07('0x1c')]=_0x269cce[_0xbb07('0x28')];_0x3db203[_0xbb07('0x2d')]=_0xbb07('0x2c');_0x3db203[_0xbb07('0x2e')]=JSON[_0xbb07('0x24')](_0x269cce);return rpc[_0x22a552+_0xbb07('0x1e')][_0xbb07('0x1f')](_0x3db203)[_0xbb07('0x20')](function(_0x3448f4){logger[_0xbb07('0xc')](_0xbb07('0x23'),_0x533348,_0x3db203[_0xbb07('0x1c')]);if(_0x269cce[_0xbb07('0x2f')]==_0xbb07('0x30')){_0x444370[_0xbb07('0x2b')]();}else{_0x444370[_0xbb07('0x25')]();}})[_0xbb07('0x21')](function(_0x564f31){logger['error'](_0xbb07('0x23'),_0x533348,JSON['stringify'](_0x564f31));_0x444370[_0xbb07('0x2b')]();});}else{_0x444370['next']();}});}}catch(_0x48ebfe){logger['error'](_0xbb07('0x23'),_0x533348,JSON[_0xbb07('0x24')](_0x48ebfe));_0x444370[_0xbb07('0x25')]();}};}; \ 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 cbf3807..e0ff893 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 _0xae82=['stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','Interaction','update','error','resolve','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','lodash','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','channel','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','YYYY-MM-DD\x20HH:mm:ss','out','mail','body','getMustacheRender','from','phone','message','subject','startsWith','Re:','Re:\x20','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','inReplyTo','messageId','html','','replace','','headers','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','create'];(function(_0x441f64,_0xf8d0c1){var _0x50f21a=function(_0x4b83be){while(--_0x4b83be){_0x441f64['push'](_0x441f64['shift']());}};_0x50f21a(++_0xf8d0c1);}(_0xae82,0x1ba));var _0x2ae8=function(_0x49b403,_0xa51b1a){_0x49b403=_0x49b403-0x0;var _0x545e9a=_0xae82[_0x49b403];return _0x545e9a;};'use strict';var _=require(_0x2ae8('0x0'));var moment=require('moment');var utils=require(_0x2ae8('0x1'));var logger=require(_0x2ae8('0x2'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x2ae8('0x3')),'mailMessage':require(_0x2ae8('0x4')),'smsMessage':require(_0x2ae8('0x5')),'faxMessage':require(_0x2ae8('0x6')),'whatsappMessage':require(_0x2ae8('0x7')),'chatInteraction':require(_0x2ae8('0x8')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x2ae8('0x9')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require('../../mailRpc');exports['consequence']=function(_0x4dc2eb,_0xc1b690,_0x57af42,_0x20c154){return function(_0x270e46){try{var _0x3cb72c=this[_0x2ae8('0xa')];if(_0x3cb72c==='mail'&&_0x20c154['body']['isAutoreply']){logger[_0x2ae8('0xb')](_0x2ae8('0xc'),_0x4dc2eb,_0x2ae8('0xd'));return _0x270e46[_0x2ae8('0xe')]();}if(_0xc1b690[0x0]==='1'&&(_['isNil'](this['interaction']['created'])||!this[_0x2ae8('0xf')][_0x2ae8('0x10')])){logger[_0x2ae8('0xb')](_0x2ae8('0xc'),_0x4dc2eb,_0x2ae8('0x11'));return _0x270e46[_0x2ae8('0xe')]();}if(_0xc1b690[0x0]==='2'&&this[_0x2ae8('0xf')][_0x2ae8('0x12')]){logger['info'](_0x2ae8('0x13'),_0x4dc2eb,_0x2ae8('0x14'));return _0x270e46[_0x2ae8('0xe')]();}var _0x1b9480={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x2ae8('0x15')),'direction':_0x2ae8('0x16')};if(this[_0x2ae8('0xa')]===_0x2ae8('0x17')){_0x1b9480[_0x2ae8('0x18')]=utils[_0x2ae8('0x19')](_0xc1b690[0x2],this);}else{_0x1b9480[_0x2ae8('0x18')]=utils[_0x2ae8('0x19')](_0xc1b690[0x1],this);}if(this['message']){_0x1b9480['to']=this['message']['from']||'';if(this[_0x2ae8('0xa')]===_0x2ae8('0x17')&&_0xc1b690[0x1]==='1'){_0x1b9480['cc']=this['message']['cc']||'';}_0x1b9480[_0x2ae8('0x1a')]=this['message']['to']||'';_0x1b9480[_0x2ae8('0x1b')]=this[_0x2ae8('0x1c')][_0x2ae8('0x1b')]||'';_0x1b9480['read']=!![];if(this['message'][_0x2ae8('0x1d')]){_0x1b9480['subject']='';_0x1b9480[_0x2ae8('0x1d')]+=_[_0x2ae8('0x1e')](this[_0x2ae8('0x1c')]['subject'],_0x2ae8('0x1f'))?'':_0x2ae8('0x20');_0x1b9480[_0x2ae8('0x1d')]+=this[_0x2ae8('0x1c')][_0x2ae8('0x1d')];}}if(this['channel']==='chat'){_0x1b9480[_0x2ae8('0x21')]=this['account']['id'];}else{_0x1b9480[_['upperFirst'](this[_0x2ae8('0xa')])+_0x2ae8('0x22')]=this[_0x2ae8('0x23')]['id'];}_0x1b9480[_[_0x2ae8('0x24')](this[_0x2ae8('0xa')])+_0x2ae8('0x25')]=this[_0x2ae8('0xf')]['id'];var _0x4010d1=this[_0x2ae8('0xf')];if(rpc[this[_0x2ae8('0xa')]+'Message']){if(this[_0x2ae8('0xa')]===_0x2ae8('0x17')){_0x1b9480[_0x2ae8('0x26')]=this[_0x2ae8('0x1c')][_0x2ae8('0x27')];_0x1b9480[_0x2ae8('0x28')]=_0x2ae8('0x29')+_[_0x2ae8('0x2a')](_0x1b9480[_0x2ae8('0x18')],_0x2ae8('0x2b'),_0x2ae8('0x2c'))+_0x2ae8('0x2d');_0x1b9480[_0x2ae8('0x2e')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':'All','Precedence':_0x2ae8('0x2f')};return mailRpc[_0x2ae8('0x30')](this[_0x2ae8('0x23')][_0x2ae8('0x31')],_0x1b9480)[_0x2ae8('0x32')](function(_0x238389){logger['info'](_0x2ae8('0x33'),_0x4dc2eb);_0x1b9480['messageId']=_0x238389[_0x2ae8('0x1c')][_0x2ae8('0x27')];return rpc[_0x3cb72c+_0x2ae8('0x34')][_0x2ae8('0x35')](_0x1b9480);})['then'](function(_0xe4a81){logger[_0x2ae8('0xb')](_0x2ae8('0xc'),_0x4dc2eb,JSON[_0x2ae8('0x36')](_0xe4a81));})[_0x2ae8('0x37')](function(_0x551221){logger['error'](_0x2ae8('0x38'),_0x4dc2eb,JSON[_0x2ae8('0x36')](_0x551221));})['finally'](function(){Promise['resolve']()[_0x2ae8('0x32')](function(){if(_0xc1b690[0x0]!=='2'||_0x4010d1[_0x2ae8('0x12')])return;return rpc[_0x3cb72c+_0x2ae8('0x39')][_0x2ae8('0x3a')](_0x4010d1['id'],{'autoreplyExecuted':!![]})[_0x2ae8('0x32')](function(_0x756f1a){logger[_0x2ae8('0xb')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4dc2eb,JSON[_0x2ae8('0x36')](_0x756f1a));})[_0x2ae8('0x37')](function(_0x262ed4){logger[_0x2ae8('0x3b')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4dc2eb,JSON[_0x2ae8('0x36')](_0x262ed4));});})[_0x2ae8('0x32')](function(){_0x270e46[_0x2ae8('0xe')]();});});}else{return rpc[this['channel']+_0x2ae8('0x34')][_0x2ae8('0x35')](_0x1b9480)[_0x2ae8('0x32')](function(){logger['info'](_0x2ae8('0xc'),_0x4dc2eb,_0x1b9480[_0x2ae8('0x18')]);})[_0x2ae8('0x37')](function(_0x2a45dd){logger[_0x2ae8('0x3b')](_0x2ae8('0xc'),_0x4dc2eb,JSON['stringify'](_0x2a45dd));})['finally'](function(){Promise[_0x2ae8('0x3c')]()[_0x2ae8('0x32')](function(){if(_0xc1b690[0x0]!=='2'||_0x4010d1['autoreplyExecuted'])return;return rpc[_0x3cb72c+_0x2ae8('0x39')]['update'](_0x4010d1['id'],{'autoreplyExecuted':!![]})[_0x2ae8('0x32')](function(_0x1f0155){logger[_0x2ae8('0xb')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4dc2eb,JSON[_0x2ae8('0x36')](_0x1f0155));})[_0x2ae8('0x37')](function(_0x1227bc){logger[_0x2ae8('0x3b')](_0x2ae8('0x3d'),_0x4dc2eb,JSON[_0x2ae8('0x36')](_0x1227bc));});})[_0x2ae8('0x32')](function(){_0x270e46[_0x2ae8('0xe')]();});});}}}catch(_0x5a7602){logger[_0x2ae8('0x3b')]('[%s][AUTOREPLY]\x20%s',_0x4dc2eb,JSON[_0x2ae8('0x36')](_0x5a7602));_0x270e46['stop']();}};}; \ No newline at end of file +var _0x9437=['[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','error','finally','resolve','then','autoreplyExecuted','Interaction','update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','interaction','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','channel','getMustacheRender','message','from','phone','subject','Re:\x20','chat','account','upperFirst','AccountId','inReplyTo','messageId','html','','replace','';_0x5c99d2[_0x7943('0x31')]={'Auto-Submitted':_0x7943('0x32'),'X-Auto-Response-Suppress':'All','Precedence':_0x7943('0x33')};return mailRpc['sendMailMessage'](this['account'][_0x7943('0x34')],_0x5c99d2)['then'](function(_0x507527){logger['info'](_0x7943('0x35'),_0x17d08c);_0x5c99d2[_0x7943('0x2b')]=_0x507527[_0x7943('0x21')][_0x7943('0x2b')];return rpc[_0x303a5c+'Message'][_0x7943('0x36')](_0x5c99d2);})['then'](function(_0x411cbc){logger[_0x7943('0x13')](_0x7943('0x14'),_0x17d08c,JSON[_0x7943('0x37')](_0x411cbc));})['catch'](function(_0x1fceca){logger[_0x7943('0x38')]('[RPC][%s][AUTOREPLY]\x20%s',_0x17d08c,JSON['stringify'](_0x1fceca));})[_0x7943('0x39')](function(){Promise[_0x7943('0x3a')]()[_0x7943('0x3b')](function(){if(_0x254d1e[0x0]!=='2'||_0x37d230[_0x7943('0x3c')])return;return rpc[_0x303a5c+_0x7943('0x3d')][_0x7943('0x3e')](_0x37d230['id'],{'autoreplyExecuted':!![]})[_0x7943('0x3b')](function(_0x2cc828){logger['info'](_0x7943('0x1b'),_0x17d08c,JSON[_0x7943('0x37')](_0x2cc828));})[_0x7943('0x3f')](function(_0x52fa38){logger[_0x7943('0x38')](_0x7943('0x40'),_0x17d08c,JSON[_0x7943('0x37')](_0x52fa38));});})[_0x7943('0x3b')](function(){_0x5f2d51['next']();});});}else{return rpc[this['channel']+'Message'][_0x7943('0x36')](_0x5c99d2)['then'](function(){logger[_0x7943('0x13')](_0x7943('0x14'),_0x17d08c,_0x5c99d2[_0x7943('0x11')]);})[_0x7943('0x3f')](function(_0x53f03d){logger[_0x7943('0x38')](_0x7943('0x14'),_0x17d08c,JSON[_0x7943('0x37')](_0x53f03d));})[_0x7943('0x39')](function(){Promise[_0x7943('0x3a')]()[_0x7943('0x3b')](function(){if(_0x254d1e[0x0]!=='2'||_0x37d230[_0x7943('0x3c')])return;return rpc[_0x303a5c+_0x7943('0x3d')]['update'](_0x37d230['id'],{'autoreplyExecuted':!![]})[_0x7943('0x3b')](function(_0x5edcf4){logger[_0x7943('0x13')](_0x7943('0x1b'),_0x17d08c,JSON[_0x7943('0x37')](_0x5edcf4));})[_0x7943('0x3f')](function(_0x3391f5){logger[_0x7943('0x38')](_0x7943('0x40'),_0x17d08c,JSON[_0x7943('0x37')](_0x3391f5));});})[_0x7943('0x3b')](function(){_0x5f2d51[_0x7943('0x16')]();});});}}}catch(_0x35b961){logger[_0x7943('0x38')](_0x7943('0x14'),_0x17d08c,JSON[_0x7943('0x37')](_0x35b961));_0x5f2d51[_0x7943('0x41')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 24a4f0d..d09d982 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad7f=['../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','../../rpc/chatInteraction'];(function(_0x16a7bc,_0x3ee4fb){var _0x54e51d=function(_0x37aa57){while(--_0x37aa57){_0x16a7bc['push'](_0x16a7bc['shift']());}};_0x54e51d(++_0x3ee4fb);}(_0xad7f,0x1e1));var _0xfad7=function(_0x2ab251,_0x41f7bb){_0x2ab251=_0x2ab251-0x0;var _0x4461c4=_0xad7f[_0x2ab251];return _0x4461c4;};'use strict';var moment=require(_0xfad7('0x0'));var logger=require(_0xfad7('0x1'))('routing');var rpc={'chatInteraction':require(_0xfad7('0x2')),'openchannelInteraction':require(_0xfad7('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xfad7('0x4')),'faxInteraction':require(_0xfad7('0x5')),'whatsappInteraction':require(_0xfad7('0x6'))};exports[_0xfad7('0x7')]=function(_0x4b1c19,_0x1e3a10,_0xb2343e,_0x31464f){return function(_0x4f3e6d){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x4b1c19,_0x1e3a10[0x0]);var _0x36394a={'closed':0x1,'closedAt':moment()['format'](_0xfad7('0x8')),'closeReason':'system','disposition':_0x1e3a10[0x0]};if(rpc[_0x31464f['channel']+'Interaction']){rpc[_0x31464f[_0xfad7('0x9')]+_0xfad7('0xa')][_0xfad7('0xb')](_0x31464f['interaction']['id'],_0x36394a)[_0xfad7('0xc')](function(_0x1a93da){logger[_0xfad7('0xd')](_0xfad7('0xe'),_0x4b1c19,_0x31464f[_0xfad7('0xf')]['id']);})[_0xfad7('0x10')](function(_0x4e3b84){logger[_0xfad7('0x11')](_0xfad7('0x12'),_0x4b1c19,JSON[_0xfad7('0x13')](_0x4e3b84));})[_0xfad7('0x14')](function(){_0x4f3e6d[_0xfad7('0x15')]();});}}catch(_0x1432f3){logger['error'](_0xfad7('0x12'),_0x4b1c19,JSON[_0xfad7('0x13')](_0x1432f3));_0x4f3e6d[_0xfad7('0x15')]();}};}; \ No newline at end of file +var _0xa656=['[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','interaction','then','catch','error'];(function(_0x21d5a8,_0x237be5){var _0x25ce6d=function(_0x58963e){while(--_0x58963e){_0x21d5a8['push'](_0x21d5a8['shift']());}};_0x25ce6d(++_0x237be5);}(_0xa656,0x115));var _0x6a65=function(_0x93b6f6,_0x5e603d){_0x93b6f6=_0x93b6f6-0x0;var _0x142f15=_0xa656[_0x93b6f6];return _0x142f15;};'use strict';var moment=require(_0x6a65('0x0'));var logger=require(_0x6a65('0x1'))('routing');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x6a65('0x2')),'mailInteraction':require(_0x6a65('0x3')),'faxInteraction':require(_0x6a65('0x4')),'whatsappInteraction':require(_0x6a65('0x5'))};exports[_0x6a65('0x6')]=function(_0x30a559,_0x43f74a,_0x4d0a65,_0x42308a){return function(_0x2bb985){try{logger[_0x6a65('0x7')](_0x6a65('0x8'),_0x30a559,_0x43f74a[0x0]);var _0x1af64a={'closed':0x1,'closedAt':moment()['format'](_0x6a65('0x9')),'closeReason':'system','disposition':_0x43f74a[0x0]};if(rpc[_0x42308a[_0x6a65('0xa')]+_0x6a65('0xb')]){rpc[_0x42308a['channel']+'Interaction'][_0x6a65('0xc')](_0x42308a[_0x6a65('0xd')]['id'],_0x1af64a)[_0x6a65('0xe')](function(_0x21c154){logger[_0x6a65('0x7')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x30a559,_0x42308a[_0x6a65('0xd')]['id']);})[_0x6a65('0xf')](function(_0x5eb376){logger[_0x6a65('0x10')](_0x6a65('0x11'),_0x30a559,JSON[_0x6a65('0x12')](_0x5eb376));})[_0x6a65('0x13')](function(){_0x2bb985[_0x6a65('0x14')]();});}}catch(_0x3abde9){logger['error'](_0x6a65('0x11'),_0x30a559,JSON[_0x6a65('0x12')](_0x3abde9));_0x2bb985['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 4a3d8c3..d4a9eb8 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7c3=['routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','create','then','catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','speech','providerName','providerResponse','endConversation','error','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger'];(function(_0x20c6f1,_0x21fa65){var _0x43c3bf=function(_0x40c2dd){while(--_0x40c2dd){_0x20c6f1['push'](_0x20c6f1['shift']());}};_0x43c3bf(++_0x21fa65);}(_0xd7c3,0x1c5));var _0x3d7c=function(_0x963d4f,_0x44373b){_0x963d4f=_0x963d4f-0x0;var _0x6f5825=_0xd7c3[_0x963d4f];return _0x6f5825;};'use strict';var _=require(_0x3d7c('0x0'));var moment=require(_0x3d7c('0x1'));var apiai=require(_0x3d7c('0x2'));var md5=require(_0x3d7c('0x3'));var utils=require(_0x3d7c('0x4'));var logger=require(_0x3d7c('0x5'))(_0x3d7c('0x6'));var rpc={'chatMessage':require(_0x3d7c('0x7')),'openchannelMessage':require(_0x3d7c('0x8')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x3d7c('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0xeccebe,_0x1047f5){return function(_0x3416dd){try{if(!_[_0x3d7c('0xa')](this[_0x3d7c('0xb')][_0x3d7c('0xc')])){logger[_0x3d7c('0xd')](_0x3d7c('0xe'),_0xeccebe,_0x3d7c('0xf'));return _0x3416dd[_0x3d7c('0x10')]();}var _0x222e27={'ContactId':this[_0x3d7c('0x11')]['id'],'sentAt':moment()[_0x3d7c('0x12')](_0x3d7c('0x13')),'direction':_0x3d7c('0x14')};if(this[_0x3d7c('0x15')]===_0x3d7c('0x16')||this[_0x3d7c('0x15')]==='whatsapp'){_0x222e27[_0x3d7c('0x17')]=this[_0x3d7c('0xb')][_0x3d7c('0x17')];}var _0x223ae1=this[_0x3d7c('0x15')];if(_0x223ae1===_0x3d7c('0x18')){_0x222e27[_0x3d7c('0x19')]=this[_0x3d7c('0x1a')]['id'];}else{_0x222e27[_[_0x3d7c('0x1b')](_0x223ae1)+_0x3d7c('0x1c')]=this[_0x3d7c('0x1a')]['id'];}_0x222e27[_[_0x3d7c('0x1b')](_0x223ae1)+_0x3d7c('0x1d')]=this[_0x3d7c('0xb')]['id'];if(this[_0x3d7c('0xb')][_0x3d7c('0x1e')]){var _0x4cf556=_0x1047f5[0x2];if(!_[_0x3d7c('0x1f')](_0x4cf556)){_0x222e27[_0x3d7c('0x20')]=utils['getMustacheRender'](_0x4cf556,this);return rpc[_0x223ae1+'Message'][_0x3d7c('0x21')](_0x222e27)[_0x3d7c('0x22')](function(_0x323204){logger[_0x3d7c('0xd')]('[%s][DIALOGFLOW]\x20%s',_0xeccebe,_0x222e27[_0x3d7c('0x20')]);})[_0x3d7c('0x23')](function(_0x3ebe2a){logger['error'](_0x3d7c('0xe'),_0xeccebe,JSON[_0x3d7c('0x24')](_0x3ebe2a));})[_0x3d7c('0x25')](function(){logger[_0x3d7c('0xd')](_0x3d7c('0x26'),_0xeccebe);_0x3416dd[_0x3d7c('0x27')]();});}else{logger[_0x3d7c('0xd')](_0x3d7c('0x28'),_0xeccebe);_0x3416dd[_0x3d7c('0x27')]();}}else{var _0x4c977f=this;var _0x126c5e=apiai(_0x1047f5[0x0],{'language':_0x1047f5[0x1]||'en'});return _0x126c5e[_0x3d7c('0x29')](this[_0x3d7c('0x2a')][_0x3d7c('0x20')],{'sessionId':md5(this['interaction']['id'])})['then'](function(_0x3518c9){_0x4c977f[_0x3d7c('0x20')][_0x3d7c('0x2b')]=_0x3518c9;_0x222e27[_0x3d7c('0x20')]=_0x3518c9[_0x3d7c('0x2c')][_0x3d7c('0x2d')][_0x3d7c('0x2e')];_0x222e27[_0x3d7c('0x2f')]=_0x3d7c('0x2b');_0x222e27[_0x3d7c('0x30')]=JSON[_0x3d7c('0x24')](_0x3518c9);return rpc[_0x223ae1+'Message']['create'](_0x222e27)[_0x3d7c('0x22')](function(_0x21137a){logger['info'](_0x3d7c('0xe'),_0xeccebe,_0x222e27[_0x3d7c('0x20')]);if(_0x3518c9[_0x3d7c('0x2c')]['metadata'][_0x3d7c('0x31')]){_0x3416dd[_0x3d7c('0x10')]();}else{_0x3416dd[_0x3d7c('0x27')]();}})[_0x3d7c('0x23')](function(_0x257dde){logger['error'](_0x3d7c('0xe'),_0xeccebe,JSON[_0x3d7c('0x24')](_0x257dde));_0x3416dd[_0x3d7c('0x10')]();});})['catch'](function(_0x77d399){logger[_0x3d7c('0x32')](_0x3d7c('0xe'),_0xeccebe,_0x77d399[_0x3d7c('0x2a')]);_0x3416dd[_0x3d7c('0x10')]();});}}catch(_0xb3eb39){logger['error']('[%s][DIALOGFLOW]\x20%s',_0xeccebe,JSON[_0x3d7c('0x24')](_0xb3eb39));_0x3416dd[_0x3d7c('0x27')]();}};}; \ No newline at end of file +var _0x524e=['apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','account','created','isEmpty','create','body','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','then','fulfillment','speech','providerName','dialogflow','providerResponse','Message','result','catch'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x524e,0x15e));var _0xe524=function(_0x12489f,_0x7b7dd){_0x12489f=_0x12489f-0x0;var _0x316b12=_0x524e[_0x12489f];return _0x316b12;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require(_0xe524('0x0'));var md5=require(_0xe524('0x1'));var utils=require(_0xe524('0x2'));var logger=require(_0xe524('0x3'))(_0xe524('0x4'));var rpc={'chatMessage':require(_0xe524('0x5')),'openchannelMessage':require(_0xe524('0x6')),'mailMessage':require(_0xe524('0x7')),'smsMessage':require(_0xe524('0x8')),'faxMessage':require(_0xe524('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xe524('0xa')]=function(_0x41e1a3,_0x347bed){return function(_0x533c14){try{if(!_[_0xe524('0xb')](this[_0xe524('0xc')][_0xe524('0xd')])){logger[_0xe524('0xe')](_0xe524('0xf'),_0x41e1a3,_0xe524('0x10'));return _0x533c14[_0xe524('0x11')]();}var _0xb3eb9f={'ContactId':this[_0xe524('0x12')]['id'],'sentAt':moment()[_0xe524('0x13')](_0xe524('0x14')),'direction':_0xe524('0x15')};if(this[_0xe524('0x16')]===_0xe524('0x17')||this[_0xe524('0x16')]===_0xe524('0x18')){_0xb3eb9f['phone']=this['interaction'][_0xe524('0x19')];}var _0x1541d8=this[_0xe524('0x16')];if(_0x1541d8===_0xe524('0x1a')){_0xb3eb9f[_0xe524('0x1b')]=this['account']['id'];}else{_0xb3eb9f[_[_0xe524('0x1c')](_0x1541d8)+'AccountId']=this[_0xe524('0x1d')]['id'];}_0xb3eb9f[_[_0xe524('0x1c')](_0x1541d8)+'InteractionId']=this[_0xe524('0xc')]['id'];if(this['interaction'][_0xe524('0x1e')]){var _0x538754=_0x347bed[0x2];if(!_[_0xe524('0x1f')](_0x538754)){_0xb3eb9f['body']=utils['getMustacheRender'](_0x538754,this);return rpc[_0x1541d8+'Message'][_0xe524('0x20')](_0xb3eb9f)['then'](function(_0x11b2a1){logger[_0xe524('0xe')](_0xe524('0xf'),_0x41e1a3,_0xb3eb9f[_0xe524('0x21')]);})['catch'](function(_0x1fd93a){logger[_0xe524('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x41e1a3,JSON[_0xe524('0x23')](_0x1fd93a));})[_0xe524('0x24')](function(){logger[_0xe524('0xe')](_0xe524('0x25'),_0x41e1a3);_0x533c14[_0xe524('0x26')]();});}else{logger[_0xe524('0xe')](_0xe524('0x27'),_0x41e1a3);_0x533c14[_0xe524('0x26')]();}}else{var _0x7dfe97=this;var _0x5c4d21=apiai(_0x347bed[0x0],{'language':_0x347bed[0x1]||'en'});return _0x5c4d21[_0xe524('0x28')](this['message']['body'],{'sessionId':md5(this[_0xe524('0xc')]['id'])})[_0xe524('0x29')](function(_0x1ad106){_0x7dfe97[_0xe524('0x21')]['dialogflow']=_0x1ad106;_0xb3eb9f[_0xe524('0x21')]=_0x1ad106['result'][_0xe524('0x2a')][_0xe524('0x2b')];_0xb3eb9f[_0xe524('0x2c')]=_0xe524('0x2d');_0xb3eb9f[_0xe524('0x2e')]=JSON[_0xe524('0x23')](_0x1ad106);return rpc[_0x1541d8+_0xe524('0x2f')]['create'](_0xb3eb9f)['then'](function(_0x283f18){logger[_0xe524('0xe')](_0xe524('0xf'),_0x41e1a3,_0xb3eb9f[_0xe524('0x21')]);if(_0x1ad106[_0xe524('0x30')]['metadata']['endConversation']){_0x533c14[_0xe524('0x11')]();}else{_0x533c14[_0xe524('0x26')]();}})[_0xe524('0x31')](function(_0x8070e4){logger[_0xe524('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x41e1a3,JSON[_0xe524('0x23')](_0x8070e4));_0x533c14[_0xe524('0x11')]();});})['catch'](function(_0x5b7ded){logger[_0xe524('0x22')](_0xe524('0xf'),_0x41e1a3,_0x5b7ded['message']);_0x533c14[_0xe524('0x11')]();});}}catch(_0x535354){logger[_0xe524('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x41e1a3,JSON[_0xe524('0x23')](_0x535354));_0x533c14[_0xe524('0x26')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 47b1ea4..7a2f235 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34b6=['detectIntent','length','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','fulfillmentText','push','stack','lodash','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','then','info','[%s][DIALOGFLOWV2]\x20%s','body','catch','error','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','getMustacheRender','create','stringify','finally','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath'];(function(_0xcaa268,_0x1e5ad1){var _0xa94049=function(_0x19423f){while(--_0x19423f){_0xcaa268['push'](_0xcaa268['shift']());}};_0xa94049(++_0x1e5ad1);}(_0x34b6,0xa0));var _0x634b=function(_0x5c55ad,_0x5c9093){_0x5c55ad=_0x5c55ad-0x0;var _0x59a2db=_0x34b6[_0x5c55ad];return _0x59a2db;};'use strict';var _=require(_0x634b('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x634b('0x1'));var moment=require(_0x634b('0x2'));var Promise=require(_0x634b('0x3'));var logger=require(_0x634b('0x4'))(_0x634b('0x5'));var utils=require(_0x634b('0x6'));var rpc={'chatMessage':require(_0x634b('0x7')),'openchannelMessage':require(_0x634b('0x8')),'mailMessage':require(_0x634b('0x9')),'smsMessage':require(_0x634b('0xa')),'faxMessage':require(_0x634b('0xb')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x10ff86,_0x1b1a92,_0xb6ea7b,_0x19163a){return new Promise(function(_0x21600c,_0x101807){var _0x56d75a=_['clone'](_0xb6ea7b);_0x56d75a['body']=_0x19163a;return rpc[_0x1b1a92+'Message']['create'](_0x56d75a)[_0x634b('0xc')](function(){logger[_0x634b('0xd')](_0x634b('0xe'),_0x10ff86,_0x56d75a[_0x634b('0xf')]);_0x21600c();})[_0x634b('0x10')](function(_0x5676bb){logger[_0x634b('0x11')](_0x634b('0xe'),_0x10ff86,JSON['stringify'](_0x5676bb));_0x101807(_0x5676bb);});});}exports[_0x634b('0x12')]=function(_0xc23b43,_0x5ecbd5){return function(_0x8aaa1a){try{if(!_[_0x634b('0x13')](this[_0x634b('0x14')][_0x634b('0x15')])){logger['info'](_0x634b('0xe'),_0xc23b43,_0x634b('0x16'));return _0x8aaa1a[_0x634b('0x17')]();}var _0x2d18e2={'ContactId':this[_0x634b('0x18')]['id'],'sentAt':moment()[_0x634b('0x19')](_0x634b('0x1a')),'direction':'out'};if(this[_0x634b('0x1b')]==='sms'||this['channel']==='whatsapp'){_0x2d18e2[_0x634b('0x1c')]=this[_0x634b('0x14')]['phone'];}var _0x47dec8=this[_0x634b('0x1b')];if(_0x47dec8===_0x634b('0x1d')){_0x2d18e2[_0x634b('0x1e')]=this[_0x634b('0x1f')]['id'];}else{_0x2d18e2[_[_0x634b('0x20')](_0x47dec8)+_0x634b('0x21')]=this[_0x634b('0x1f')]['id'];}_0x2d18e2[_[_0x634b('0x20')](_0x47dec8)+'InteractionId']=this['interaction']['id'];if(this['interaction'][_0x634b('0x22')]){var _0x185c1f=_0x5ecbd5[0x4];if(!_['isEmpty'](_0x185c1f)){_0x2d18e2['body']=utils[_0x634b('0x23')](_0x185c1f,this);return rpc[_0x47dec8+'Message'][_0x634b('0x24')](_0x2d18e2)['then'](function(_0x33398a){logger[_0x634b('0xd')](_0x634b('0xe'),_0xc23b43,_0x2d18e2[_0x634b('0xf')]);})[_0x634b('0x10')](function(_0x3a98c8){logger[_0x634b('0x11')](_0x634b('0xe'),_0xc23b43,JSON[_0x634b('0x25')](_0x3a98c8));})[_0x634b('0x26')](function(){logger[_0x634b('0xd')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0xc23b43);_0x8aaa1a[_0x634b('0x27')]();});}else{logger[_0x634b('0xd')](_0x634b('0x28'),_0xc23b43);_0x8aaa1a[_0x634b('0x27')]();}}else{var _0x2c0472=this;var _0xb8d8f7=_0x5ecbd5[0x2][_0x634b('0x29')](/\\n/g,'\x0a');var _0x6a2c93={'credentials':{'private_key':_0xb8d8f7,'client_email':_0x5ecbd5[0x1]}};var _0x4c7441=new dialogflow[(_0x634b('0x2a'))](_0x6a2c93);var _0x5d0267=_0x4c7441[_0x634b('0x2b')](_0x5ecbd5[0x0],md5(_0x2c0472['interaction']['id']));var _0x38191a={'session':_0x5d0267,'queryInput':{'text':{'text':_0x2c0472['message']['body'],'languageCode':_0x5ecbd5[0x3]||'en'}}};return _0x4c7441[_0x634b('0x2c')](_0x38191a)[_0x634b('0xc')](function(_0x4df794){if(_0x4df794&&_0x4df794[_0x634b('0x2d')]){_0x2c0472[_0x634b('0xf')]['dialogflowV2']=_0x4df794;var _0x3101b2=_0x4df794[0x0];var _0x259b26=_0x3101b2[_0x634b('0x2e')]['diagnosticInfo']&&_0x3101b2['queryResult'][_0x634b('0x2f')][_0x634b('0x30')]?_0x3101b2[_0x634b('0x2e')][_0x634b('0x2f')]['fields'][_0x634b('0x31')][_0x634b('0x32')]:![];_0x2c0472['body'][_0x634b('0x33')]=_0x3101b2['queryResult']['action'];_0x2c0472[_0x634b('0xf')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x3101b2[_0x634b('0x2e')]['allRequiredParamsPresent'];_0x2c0472['body']['DIALOGFLOWV2_ENDCONVERSATION']=_0x3101b2[_0x634b('0x2e')][_0x634b('0x2f')]&&_0x3101b2['queryResult']['diagnosticInfo'][_0x634b('0x30')]?_0x3101b2[_0x634b('0x2e')][_0x634b('0x2f')][_0x634b('0x30')][_0x634b('0x31')][_0x634b('0x32')]:![];_0x2c0472['body'][_0x634b('0x34')]=_0x3101b2['queryResult']['intent'][_0x634b('0x35')];_0x2c0472['body'][_0x634b('0x36')]=_0x3101b2['queryResult']['intent'][_0x634b('0x37')];_0x2c0472[_0x634b('0xf')][_0x634b('0x38')]=_0x3101b2['queryResult']['intent']['isFallback'];_0x2c0472[_0x634b('0xf')][_0x634b('0x39')]=_0x3101b2[_0x634b('0x2e')][_0x634b('0x3a')];_0x2c0472[_0x634b('0xf')]['DIALOGFLOWV2_QUERYTEXT']=_0x3101b2[_0x634b('0x2e')][_0x634b('0x3b')];_0x2c0472[_0x634b('0xf')][_0x634b('0x3c')]=_0x3101b2['queryResult'][_0x634b('0x3d')];_0x2d18e2[_0x634b('0x3e')]=_0x634b('0x3f');_0x2d18e2[_0x634b('0x40')]=JSON['stringify'](_0x4df794);var _0x24b436=[];for(var _0xadc08a=0x0;_0xadc08a<_0x4df794['length'];_0xadc08a++){var _0x10e4d6=_0x4df794[_0xadc08a];if(_0x10e4d6&&_0x10e4d6[_0x634b('0x2e')]&&_0x10e4d6[_0x634b('0x2e')][_0x634b('0x41')]){_0x24b436[_0x634b('0x42')](createMessage(_0xc23b43,_0x47dec8,_0x2d18e2,_0x10e4d6['queryResult'][_0x634b('0x41')]));}}return Promise['all'](_0x24b436)[_0x634b('0xc')](function(){if(_0x259b26){_0x8aaa1a['next']();}else{_0x8aaa1a[_0x634b('0x27')]();}})[_0x634b('0x10')](function(_0x1a40ee){logger[_0x634b('0x11')](_0x634b('0xe'),_0xc23b43,JSON[_0x634b('0x25')](_0x1a40ee));_0x8aaa1a[_0x634b('0x17')]();});}})['catch'](function(_0x5382d8){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0xc23b43,_0x5382d8['message'],_0x5382d8[_0x634b('0x43')]);_0x8aaa1a[_0x634b('0x17')]();});}}catch(_0x42de7f){logger[_0x634b('0x11')](_0x634b('0xe'),_0xc23b43,JSON[_0x634b('0x25')](_0x42de7f));_0x8aaa1a[_0x634b('0x27')]();}};}; \ No newline at end of file +var _0x5259=['getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','detectIntent','length','queryResult','diagnosticInfo','fields','end_conversation','boolValue','action','allRequiredParamsPresent','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','push','fulfillmentText','next','stack','lodash','dialogflow','md5','bluebird','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','isNil','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','interaction','chat','account','upperFirst','InteractionId','isEmpty'];(function(_0x415b5d,_0x3b99f7){var _0x58b75e=function(_0x5f25fb){while(--_0x5f25fb){_0x415b5d['push'](_0x415b5d['shift']());}};_0x58b75e(++_0x3b99f7);}(_0x5259,0xae));var _0x9525=function(_0x53828f,_0x8772f1){_0x53828f=_0x53828f-0x0;var _0x2a897a=_0x5259[_0x53828f];return _0x2a897a;};'use strict';var _=require(_0x9525('0x0'));var dialogflow=require(_0x9525('0x1'));var md5=require(_0x9525('0x2'));var moment=require('moment');var Promise=require(_0x9525('0x3'));var logger=require(_0x9525('0x4'))(_0x9525('0x5'));var utils=require('./utils');var rpc={'chatMessage':require(_0x9525('0x6')),'openchannelMessage':require(_0x9525('0x7')),'mailMessage':require(_0x9525('0x8')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x9525('0x9')),'whatsappMessage':require(_0x9525('0xa'))};function createMessage(_0x67e476,_0x38aea9,_0x450269,_0x1231fc){return new Promise(function(_0x3adc55,_0x348942){var _0x4dbf8d=_[_0x9525('0xb')](_0x450269);_0x4dbf8d[_0x9525('0xc')]=_0x1231fc;return rpc[_0x38aea9+_0x9525('0xd')][_0x9525('0xe')](_0x4dbf8d)[_0x9525('0xf')](function(){logger['info'](_0x9525('0x10'),_0x67e476,_0x4dbf8d[_0x9525('0xc')]);_0x3adc55();})[_0x9525('0x11')](function(_0x247db5){logger[_0x9525('0x12')](_0x9525('0x10'),_0x67e476,JSON[_0x9525('0x13')](_0x247db5));_0x348942(_0x247db5);});});}exports['consequence']=function(_0x5d18d3,_0x57bfd6){return function(_0xf6e11d){try{if(!_[_0x9525('0x14')](this['interaction'][_0x9525('0x15')])){logger[_0x9525('0x16')](_0x9525('0x10'),_0x5d18d3,_0x9525('0x17'));return _0xf6e11d['next']();}var _0xe07e2b={'ContactId':this[_0x9525('0x18')]['id'],'sentAt':moment()['format'](_0x9525('0x19')),'direction':'out'};if(this[_0x9525('0x1a')]===_0x9525('0x1b')||this[_0x9525('0x1a')]===_0x9525('0x1c')){_0xe07e2b[_0x9525('0x1d')]=this[_0x9525('0x1e')][_0x9525('0x1d')];}var _0x777386=this[_0x9525('0x1a')];if(_0x777386===_0x9525('0x1f')){_0xe07e2b['ChatWebsiteId']=this[_0x9525('0x20')]['id'];}else{_0xe07e2b[_[_0x9525('0x21')](_0x777386)+'AccountId']=this['account']['id'];}_0xe07e2b[_[_0x9525('0x21')](_0x777386)+_0x9525('0x22')]=this['interaction']['id'];if(this['interaction']['created']){var _0x3b96f2=_0x57bfd6[0x4];if(!_[_0x9525('0x23')](_0x3b96f2)){_0xe07e2b[_0x9525('0xc')]=utils[_0x9525('0x24')](_0x3b96f2,this);return rpc[_0x777386+_0x9525('0xd')][_0x9525('0xe')](_0xe07e2b)['then'](function(_0x22bc07){logger[_0x9525('0x16')](_0x9525('0x10'),_0x5d18d3,_0xe07e2b[_0x9525('0xc')]);})[_0x9525('0x11')](function(_0x144d5f){logger['error'](_0x9525('0x10'),_0x5d18d3,JSON[_0x9525('0x13')](_0x144d5f));})[_0x9525('0x25')](function(){logger[_0x9525('0x16')](_0x9525('0x26'),_0x5d18d3);_0xf6e11d[_0x9525('0x27')]();});}else{logger[_0x9525('0x16')](_0x9525('0x28'),_0x5d18d3);_0xf6e11d[_0x9525('0x27')]();}}else{var _0x74a0b=this;var _0x5bf5a9=_0x57bfd6[0x2][_0x9525('0x29')](/\\n/g,'\x0a');var _0x26d479={'credentials':{'private_key':_0x5bf5a9,'client_email':_0x57bfd6[0x1]}};var _0x1239a2=new dialogflow[(_0x9525('0x2a'))](_0x26d479);var _0x27a9b5=_0x1239a2['sessionPath'](_0x57bfd6[0x0],md5(_0x74a0b['interaction']['id']));var _0x14f581={'session':_0x27a9b5,'queryInput':{'text':{'text':_0x74a0b['message']['body'],'languageCode':_0x57bfd6[0x3]||'en'}}};return _0x1239a2[_0x9525('0x2b')](_0x14f581)[_0x9525('0xf')](function(_0xda32b3){if(_0xda32b3&&_0xda32b3[_0x9525('0x2c')]){_0x74a0b['body']['dialogflowV2']=_0xda32b3;var _0x42de76=_0xda32b3[0x0];var _0x42f588=_0x42de76[_0x9525('0x2d')][_0x9525('0x2e')]&&_0x42de76['queryResult'][_0x9525('0x2e')]['fields']?_0x42de76[_0x9525('0x2d')]['diagnosticInfo'][_0x9525('0x2f')][_0x9525('0x30')][_0x9525('0x31')]:![];_0x74a0b[_0x9525('0xc')]['DIALOGFLOWV2_ACTION']=_0x42de76[_0x9525('0x2d')][_0x9525('0x32')];_0x74a0b[_0x9525('0xc')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x42de76[_0x9525('0x2d')][_0x9525('0x33')];_0x74a0b['body']['DIALOGFLOWV2_ENDCONVERSATION']=_0x42de76['queryResult']['diagnosticInfo']&&_0x42de76[_0x9525('0x2d')]['diagnosticInfo']['fields']?_0x42de76['queryResult'][_0x9525('0x2e')][_0x9525('0x2f')]['end_conversation']['boolValue']:![];_0x74a0b[_0x9525('0xc')]['DIALOGFLOWV2_INTENTNAME']=_0x42de76[_0x9525('0x2d')][_0x9525('0x34')][_0x9525('0x35')];_0x74a0b[_0x9525('0xc')][_0x9525('0x36')]=_0x42de76['queryResult'][_0x9525('0x34')][_0x9525('0x37')];_0x74a0b[_0x9525('0xc')][_0x9525('0x38')]=_0x42de76[_0x9525('0x2d')]['intent'][_0x9525('0x39')];_0x74a0b[_0x9525('0xc')][_0x9525('0x3a')]=_0x42de76[_0x9525('0x2d')][_0x9525('0x3b')];_0x74a0b[_0x9525('0xc')][_0x9525('0x3c')]=_0x42de76[_0x9525('0x2d')]['queryText'];_0x74a0b['body'][_0x9525('0x3d')]=_0x42de76[_0x9525('0x2d')][_0x9525('0x3e')];_0xe07e2b[_0x9525('0x3f')]=_0x9525('0x40');_0xe07e2b[_0x9525('0x41')]=JSON['stringify'](_0xda32b3);var _0x119299=[];for(var _0x1716c1=0x0;_0x1716c1<_0xda32b3[_0x9525('0x2c')];_0x1716c1++){var _0x234c32=_0xda32b3[_0x1716c1];if(_0x234c32&&_0x234c32[_0x9525('0x2d')]&&_0x234c32[_0x9525('0x2d')]['fulfillmentText']){_0x119299[_0x9525('0x42')](createMessage(_0x5d18d3,_0x777386,_0xe07e2b,_0x234c32[_0x9525('0x2d')][_0x9525('0x43')]));}}return Promise['all'](_0x119299)['then'](function(){if(_0x42f588){_0xf6e11d['next']();}else{_0xf6e11d[_0x9525('0x27')]();}})[_0x9525('0x11')](function(_0x2aa0e6){logger[_0x9525('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x5d18d3,JSON[_0x9525('0x13')](_0x2aa0e6));_0xf6e11d[_0x9525('0x44')]();});}})['catch'](function(_0x3e256d){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x5d18d3,_0x3e256d['message'],_0x3e256d[_0x9525('0x45')]);_0xf6e11d[_0x9525('0x44')]();});}}catch(_0x1b629c){logger[_0x9525('0x12')](_0x9525('0x10'),_0x5d18d3,JSON[_0x9525('0x13')](_0x1b629c));_0xf6e11d[_0x9525('0x27')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index ca10ec3..bba9946 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x86dc=['priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','findIndex','rules','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','html-to-text','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','validate','length','[%s][GOTOIF]\x20%s','map','message','join','stop','priorityTrue'];(function(_0x397cb5,_0x60d6b2){var _0x2a5444=function(_0x2e430d){while(--_0x2e430d){_0x397cb5['push'](_0x397cb5['shift']());}};_0x2a5444(++_0x60d6b2);}(_0x86dc,0x167));var _0xc86d=function(_0x4256ed,_0x5a32cf){_0x4256ed=_0x4256ed-0x0;var _0x40d392=_0x86dc[_0x4256ed];return _0x40d392;};'use strict';var schema=require('validate');var _=require('lodash');var htmlToText=require(_0xc86d('0x0'));var utils=require(_0xc86d('0x1'));var logger=require(_0xc86d('0x2'))('routing');var gotoif=schema({'condition':{'type':_0xc86d('0x3'),'required':!![],'message':_0xc86d('0x4')},'priorityTrue':{'type':_0xc86d('0x5'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':_0xc86d('0x6')}});exports[_0xc86d('0x7')]=function(_0x3d1d9c,_0x191b35){return function(_0x201cbd){try{var _0x469707={'condition':htmlToText[_0xc86d('0x8')](utils[_0xc86d('0x9')](_0x191b35[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x191b35[0x1],'priorityFalse':_0x191b35[0x2]};var _0x191b10=gotoif[_0xc86d('0xa')](_0x469707,{'typecast':!![]});if(_0x191b10[_0xc86d('0xb')]){logger['error'](_0xc86d('0xc'),_0x3d1d9c,_[_0xc86d('0xd')](_0x191b10,_0xc86d('0xe'))[_0xc86d('0xf')](',\x20'));_0x201cbd[_0xc86d('0x10')]();}else{try{var _0x2be2f0=eval('('+_0x469707['condition']+')');var _0x45f93f=_0x2be2f0?_0x469707[_0xc86d('0x11')]:_0x469707[_0xc86d('0x12')];logger[_0xc86d('0x13')](_0xc86d('0x14'),_0x3d1d9c,_0x469707[_0xc86d('0x15')],_0x2be2f0,_0x45f93f||'next');if(_0x45f93f){var _0x3291ce=_[_0xc86d('0x16')](_0x201cbd[_0xc86d('0x17')](),{'p':_0x45f93f});if(_0x3291ce>=0x0){logger[_0xc86d('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3d1d9c,_0x45f93f||_0xc86d('0x18'),_0x3291ce);_0x201cbd['next'](_0x3291ce);}else{logger[_0xc86d('0x13')](_0xc86d('0x19'),_0x3d1d9c,_0x45f93f||'next');_0x201cbd[_0xc86d('0x10')]();}}else{_0x201cbd[_0xc86d('0x18')]();}}catch(_0x3be3d7){logger[_0xc86d('0x1a')](_0xc86d('0x1b'),_0x3d1d9c,_0x3be3d7[_0xc86d('0xe')]);_0x201cbd[_0xc86d('0x10')]();}}}catch(_0x5e8338){logger[_0xc86d('0x1a')](_0xc86d('0xc'),_0x3d1d9c,JSON[_0xc86d('0x1c')](_0x5e8338));_0x201cbd['stop']();}};}; \ No newline at end of file +var _0x25f8=['../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','getMustacheRender','length','[%s][GOTOIF]\x20%s','map','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','stringify','validate','lodash','html-to-text','./utils'];(function(_0x1a6e1a,_0x4c1247){var _0x4c19fc=function(_0x24ecea){while(--_0x24ecea){_0x1a6e1a['push'](_0x1a6e1a['shift']());}};_0x4c19fc(++_0x4c1247);}(_0x25f8,0xdd));var _0x825f=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x25f8[_0x178e48];return _0x440d7e;};'use strict';var schema=require(_0x825f('0x0'));var _=require(_0x825f('0x1'));var htmlToText=require(_0x825f('0x2'));var utils=require(_0x825f('0x3'));var logger=require(_0x825f('0x4'))(_0x825f('0x5'));var gotoif=schema({'condition':{'type':_0x825f('0x6'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x825f('0x7'),'message':_0x825f('0x8')},'priorityFalse':{'type':_0x825f('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports['consequence']=function(_0x5ab192,_0x1ed3ac){return function(_0x48534b){try{var _0x23eb1c={'condition':htmlToText['fromString'](utils[_0x825f('0x9')](_0x1ed3ac[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1ed3ac[0x1],'priorityFalse':_0x1ed3ac[0x2]};var _0x336e7a=gotoif[_0x825f('0x0')](_0x23eb1c,{'typecast':!![]});if(_0x336e7a[_0x825f('0xa')]){logger['error'](_0x825f('0xb'),_0x5ab192,_[_0x825f('0xc')](_0x336e7a,'message')['join'](',\x20'));_0x48534b[_0x825f('0xd')]();}else{try{var _0x45ced1=eval('('+_0x23eb1c[_0x825f('0xe')]+')');var _0x5ce3c4=_0x45ced1?_0x23eb1c[_0x825f('0xf')]:_0x23eb1c[_0x825f('0x10')];logger[_0x825f('0x11')](_0x825f('0x12'),_0x5ab192,_0x23eb1c[_0x825f('0xe')],_0x45ced1,_0x5ce3c4||_0x825f('0x13'));if(_0x5ce3c4){var _0xcdf411=_[_0x825f('0x14')](_0x48534b['rules'](),{'p':_0x5ce3c4});if(_0xcdf411>=0x0){logger[_0x825f('0x11')](_0x825f('0x15'),_0x5ab192,_0x5ce3c4||_0x825f('0x13'),_0xcdf411);_0x48534b[_0x825f('0x13')](_0xcdf411);}else{logger['info'](_0x825f('0x16'),_0x5ab192,_0x5ce3c4||_0x825f('0x13'));_0x48534b['stop']();}}else{_0x48534b[_0x825f('0x13')]();}}catch(_0x37d9f2){logger['error']('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x5ab192,_0x37d9f2['message']);_0x48534b[_0x825f('0xd')]();}}}catch(_0x24a6c5){logger[_0x825f('0x17')](_0x825f('0xb'),_0x5ab192,JSON[_0x825f('0x18')](_0x24a6c5));_0x48534b[_0x825f('0xd')]();}};}; \ 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 760e923..f6a2dbc 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 _0xa400=['info','priority','findIndex','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','message','join'];(function(_0x55e8aa,_0x15a751){var _0xd4ec46=function(_0x386cd8){while(--_0x386cd8){_0x55e8aa['push'](_0x55e8aa['shift']());}};_0xd4ec46(++_0x15a751);}(_0xa400,0xb2));var _0x0a40=function(_0xd9d145,_0x338e90){_0xd9d145=_0xd9d145-0x0;var _0x34a84c=_0xa400[_0xd9d145];return _0x34a84c;};'use strict';var schema=require(_0x0a40('0x0'));var _=require(_0x0a40('0x1'));var logger=require(_0x0a40('0x2'))(_0x0a40('0x3'));var gotop=schema({'priority':{'type':_0x0a40('0x4'),'required':!![],'message':_0x0a40('0x5')}});exports[_0x0a40('0x6')]=function(_0x3b98f8,_0x43c03b){return function(_0x12a87d){try{var _0x5386d6={'priority':_0x43c03b[0x0]};var _0x1a3155=gotop[_0x0a40('0x0')](_0x5386d6,{'typecast':!![]});if(_0x1a3155[_0x0a40('0x7')]){logger[_0x0a40('0x8')](_0x0a40('0x9'),_0x3b98f8,_['map'](_0x1a3155,_0x0a40('0xa'))[_0x0a40('0xb')](',\x20'));_0x12a87d['stop']();}else{logger[_0x0a40('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x3b98f8,_0x5386d6[_0x0a40('0xd')]);if(_0x5386d6[_0x0a40('0xd')]){var _0x4ff006=_[_0x0a40('0xe')](_0x12a87d[_0x0a40('0xf')](),{'p':_0x5386d6['priority']});if(_0x4ff006>=0x0){logger[_0x0a40('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3b98f8,_0x5386d6['priority']||_0x0a40('0x10'),_0x4ff006);_0x12a87d[_0x0a40('0x10')](_0x4ff006);}else{logger[_0x0a40('0xc')](_0x0a40('0x11'),_0x3b98f8,_0x5386d6[_0x0a40('0xd')]||_0x0a40('0x10'));_0x12a87d[_0x0a40('0x12')]();}}else{_0x12a87d[_0x0a40('0x10')]();}}}catch(_0x47cb9f){logger[_0x0a40('0x8')]('[%s][GOTOP]\x20%s',_0x3b98f8,JSON['stringify'](_0x47cb9f));_0x12a87d[_0x0a40('0x12')]();}};}; \ No newline at end of file +var _0x0572=['priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify','validate','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','join','stop','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0572,0x156));var _0x2057=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x0572[_0x4ff09b];return _0x3f5c2e;};'use strict';var schema=require(_0x2057('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')(_0x2057('0x1'));var gotop=schema({'priority':{'type':_0x2057('0x2'),'required':!![],'message':_0x2057('0x3')}});exports[_0x2057('0x4')]=function(_0x35baee,_0x26ce1f){return function(_0x10d7ab){try{var _0x5aa919={'priority':_0x26ce1f[0x0]};var _0x5ebdc5=gotop['validate'](_0x5aa919,{'typecast':!![]});if(_0x5ebdc5['length']){logger[_0x2057('0x5')](_0x2057('0x6'),_0x35baee,_['map'](_0x5ebdc5,'message')[_0x2057('0x7')](',\x20'));_0x10d7ab[_0x2057('0x8')]();}else{logger[_0x2057('0x9')]('[%s][GOTOP]\x20priority\x20%s',_0x35baee,_0x5aa919[_0x2057('0xa')]);if(_0x5aa919['priority']){var _0x3f658f=_[_0x2057('0xb')](_0x10d7ab[_0x2057('0xc')](),{'p':_0x5aa919[_0x2057('0xa')]});if(_0x3f658f>=0x0){logger['info'](_0x2057('0xd'),_0x35baee,_0x5aa919['priority']||_0x2057('0xe'),_0x3f658f);_0x10d7ab[_0x2057('0xe')](_0x3f658f);}else{logger[_0x2057('0x9')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x35baee,_0x5aa919[_0x2057('0xa')]||_0x2057('0xe'));_0x10d7ab[_0x2057('0x8')]();}}else{_0x10d7ab[_0x2057('0xe')]();}}}catch(_0x21500f){logger[_0x2057('0x5')](_0x2057('0x6'),_0x35baee,JSON[_0x2057('0xf')](_0x21500f));_0x10d7ab[_0x2057('0x8')]();}};}; \ 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 eb3ff08..e610b3a 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 _0x354b=['../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','chat','account','channel','AccountId','upperFirst','InteractionId','interaction','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stop','stringify','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage'];(function(_0x510823,_0xf746a2){var _0x2802ff=function(_0x1471fa){while(--_0x1471fa){_0x510823['push'](_0x510823['shift']());}};_0x2802ff(++_0xf746a2);}(_0x354b,0x85));var _0xb354=function(_0x34c55d,_0x45444c){_0x34c55d=_0x34c55d-0x0;var _0x598e11=_0x354b[_0x34c55d];return _0x598e11;};'use strict';var _=require(_0xb354('0x0'));var utils=require(_0xb354('0x1'));var logger=require(_0xb354('0x2'))(_0xb354('0x3'));var rpc={'chatMessage':require(_0xb354('0x4')),'openchannelMessage':require(_0xb354('0x5')),'mailMessage':require(_0xb354('0x6')),'smsMessage':require(_0xb354('0x7')),'faxMessage':require(_0xb354('0x8')),'whatsappMessage':require(_0xb354('0x9'))};exports['consequence']=function(_0x2f7cdf,_0x5a5bee){return function(_0x104e7d){try{var _0xaad045={'body':utils[_0xb354('0xa')](_0x5a5bee[0x0],this),'ContactId':this['contact']['id']};if(this['channel']===_0xb354('0xb')){_0xaad045['ChatWebsiteId']=this[_0xb354('0xc')]['id'];}else{_0xaad045[_['upperFirst'](this[_0xb354('0xd')])+_0xb354('0xe')]=this[_0xb354('0xc')]['id'];}_0xaad045[_[_0xb354('0xf')](this[_0xb354('0xd')])+_0xb354('0x10')]=this[_0xb354('0x11')]['id'];if(rpc[this['channel']+'Message']){return rpc[this['channel']+'Message'][_0xb354('0x12')](_0xaad045)[_0xb354('0x13')](function(_0x4692dd){logger[_0xb354('0x14')](_0xb354('0x15'),_0x2f7cdf,_0xaad045[_0xb354('0x16')]);_0x104e7d[_0xb354('0x17')]();})[_0xb354('0x18')](function(_0x2ad35a){logger[_0xb354('0x19')](_0xb354('0x15'),_0x2f7cdf,JSON['stringify'](_0x2ad35a));_0x104e7d[_0xb354('0x1a')]();});}}catch(_0x3cefac){logger[_0xb354('0x19')](_0xb354('0x15'),_0x2f7cdf,JSON[_0xb354('0x1b')](_0x3cefac));_0x104e7d[_0xb354('0x1a')]();}};}; \ No newline at end of file +var _0x34a4=['[%s][MESSAGE]\x20%s','next','catch','error','stringify','stop','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','upperFirst','account','InteractionId','interaction','Message','create'];(function(_0x1b8b1b,_0x1edbbe){var _0x1e536b=function(_0x3d6e3c){while(--_0x3d6e3c){_0x1b8b1b['push'](_0x1b8b1b['shift']());}};_0x1e536b(++_0x1edbbe);}(_0x34a4,0xec));var _0x434a=function(_0x5b013d,_0xc7691c){_0x5b013d=_0x5b013d-0x0;var _0x2b6eef=_0x34a4[_0x5b013d];return _0x2b6eef;};'use strict';var _=require(_0x434a('0x0'));var utils=require('./utils');var logger=require(_0x434a('0x1'))(_0x434a('0x2'));var rpc={'chatMessage':require(_0x434a('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x434a('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x434a('0x5'))};exports[_0x434a('0x6')]=function(_0x84dd73,_0x3e3636){return function(_0x12b6b6){try{var _0x338544={'body':utils[_0x434a('0x7')](_0x3e3636[0x0],this),'ContactId':this[_0x434a('0x8')]['id']};if(this[_0x434a('0x9')]===_0x434a('0xa')){_0x338544['ChatWebsiteId']=this['account']['id'];}else{_0x338544[_[_0x434a('0xb')](this['channel'])+'AccountId']=this[_0x434a('0xc')]['id'];}_0x338544[_[_0x434a('0xb')](this[_0x434a('0x9')])+_0x434a('0xd')]=this[_0x434a('0xe')]['id'];if(rpc[this[_0x434a('0x9')]+_0x434a('0xf')]){return rpc[this['channel']+_0x434a('0xf')][_0x434a('0x10')](_0x338544)['then'](function(_0x2c85c5){logger['info'](_0x434a('0x11'),_0x84dd73,_0x338544['body']);_0x12b6b6[_0x434a('0x12')]();})[_0x434a('0x13')](function(_0x3a2214){logger[_0x434a('0x14')](_0x434a('0x11'),_0x84dd73,JSON[_0x434a('0x15')](_0x3a2214));_0x12b6b6[_0x434a('0x16')]();});}}catch(_0x236442){logger['error']('[%s][MESSAGE]\x20%s',_0x84dd73,JSON[_0x434a('0x15')](_0x236442));_0x12b6b6[_0x434a('0x16')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index b6e91f2..797f3bb 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 _0x11e5=['getMustacheRender','next','error','[%s][NOOP]\x20%s','stringify','stop','../../../../config/logger','routing','info'];(function(_0x140034,_0x538e1f){var _0x295ee2=function(_0x21dd0f){while(--_0x21dd0f){_0x140034['push'](_0x140034['shift']());}};_0x295ee2(++_0x538e1f);}(_0x11e5,0x1b6));var _0x511e=function(_0x5dc123,_0x1a7217){_0x5dc123=_0x5dc123-0x0;var _0xd98e38=_0x11e5[_0x5dc123];return _0xd98e38;};'use strict';var utils=require('./utils');var logger=require(_0x511e('0x0'))(_0x511e('0x1'));exports['consequence']=function(_0x637ad7,_0x550650){return function(_0x3d89d4){try{logger[_0x511e('0x2')]('[%s][NOOP]\x20%s',_0x637ad7,utils[_0x511e('0x3')](_0x550650[0x0],this));_0x3d89d4[_0x511e('0x4')]();}catch(_0x3b523d){logger[_0x511e('0x5')](_0x511e('0x6'),_0x637ad7,JSON[_0x511e('0x7')](_0x3b523d));_0x3d89d4[_0x511e('0x8')]();}};}; \ No newline at end of file +var _0x994e=['next','error','[%s][NOOP]\x20%s','stop','./utils','../../../../config/logger','routing','info'];(function(_0x15def9,_0x33453b){var _0x613ec4=function(_0x5ab902){while(--_0x5ab902){_0x15def9['push'](_0x15def9['shift']());}};_0x613ec4(++_0x33453b);}(_0x994e,0xa4));var _0xe994=function(_0x3f9ff0,_0x38fda0){_0x3f9ff0=_0x3f9ff0-0x0;var _0x423578=_0x994e[_0x3f9ff0];return _0x423578;};'use strict';var utils=require(_0xe994('0x0'));var logger=require(_0xe994('0x1'))(_0xe994('0x2'));exports['consequence']=function(_0x5daa8d,_0x565257){return function(_0x5af764){try{logger[_0xe994('0x3')]('[%s][NOOP]\x20%s',_0x5daa8d,utils['getMustacheRender'](_0x565257[0x0],this));_0x5af764[_0xe994('0x4')]();}catch(_0x1fca8b){logger[_0xe994('0x5')](_0xe994('0x6'),_0x5daa8d,JSON['stringify'](_0x1fca8b));_0x5af764[_0xe994('0x7')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index b941e41..fc6d4d4 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 _0xcbd2=['qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','close','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','account','queue','from','joinAt','emit','clone','push','InteractionId','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','QueueId','interaction','upperFirst','MessageId','message','channel','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','[%s][STOP:QUEUE][NAME:%s]','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','[%s][QUEUE]\x20%s','map','join','stop','find','createQueue'];(function(_0xbec8e6,_0x2841b5){var _0x4aa6f2=function(_0x583a0a){while(--_0x583a0a){_0xbec8e6['push'](_0xbec8e6['shift']());}};_0x4aa6f2(++_0x2841b5);}(_0xcbd2,0xa2));var _0x2cbd=function(_0x57928b,_0x29a111){_0x57928b=_0x57928b-0x0;var _0x49aad6=_0xcbd2[_0x57928b];return _0x49aad6;};'use strict';var schema=require(_0x2cbd('0x0'));var _=require(_0x2cbd('0x1'));var util=require(_0x2cbd('0x2'));var seqqueue=require(_0x2cbd('0x3'));var moment=require(_0x2cbd('0x4'));var Redis=require(_0x2cbd('0x5'));var config=require(_0x2cbd('0x6'));var logger=require(_0x2cbd('0x7'))(_0x2cbd('0x8'));var strategy=require(_0x2cbd('0x9'));config[_0x2cbd('0xa')]=_['defaults'](config[_0x2cbd('0xa')],{'host':_0x2cbd('0xb'),'port':0x18eb});var io=require(_0x2cbd('0xc'))(new Redis(config[_0x2cbd('0xa')]));var attributes=['id','queue_id',_0x2cbd('0xd'),_0x2cbd('0xe'),_0x2cbd('0xf'),_0x2cbd('0x10')];function emit(_0x5a9905,_0x3c0976,_0x5632a3){io['to'](_0x5a9905)[_0x2cbd('0x11')](_0x3c0976,_0x5632a3);}function emitChannelQueueInteraction(_0x1d5f3c,_0x411bfe,_0x58accd,_0x16cd7a,_0x5dec30,_0x316cda,_0x20eb4f,_0x4edaf1){var _0x41fd76=_[_0x2cbd('0x12')](_0x58accd);_0x41fd76['queue_id']=_0x4edaf1;_0x41fd76[_0x2cbd('0xe')]=_0x411bfe;_0x41fd76[_0x2cbd('0xd')]=_0x16cd7a;_0x41fd76['id']=_0x5dec30;if(_0x316cda){attributes[_0x2cbd('0x13')](_['capitalize'](_0x1d5f3c)+_0x2cbd('0x14'));_0x20eb4f[util[_0x2cbd('0x15')](_0x2cbd('0x16'),_0x1d5f3c)][_0x5dec30]=_[_0x2cbd('0x17')](_0x41fd76,attributes);}else{delete _0x20eb4f[util[_0x2cbd('0x15')](_0x2cbd('0x16'),_0x1d5f3c)][_0x5dec30];}emit(util['format']('%s:queue:%s',_0x1d5f3c,_0x411bfe),util['format'](_0x2cbd('0x18'),_0x1d5f3c,_0x316cda?_0x2cbd('0x19'):'remove'),_[_0x2cbd('0x17')](_0x41fd76,attributes));}var rpc={'openchannelQueueReport':require(_0x2cbd('0x1a')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x2cbd('0x1b')),'faxQueueReport':require(_0x2cbd('0x1c')),'whatsappQueueReport':require(_0x2cbd('0x1d'))};var queue=schema({'name':{'type':_0x2cbd('0x1e'),'required':!![],'message':_0x2cbd('0x1f')},'timeout':{'type':_0x2cbd('0x20'),'message':_0x2cbd('0x21')}});function startRouting(_0x2e9a32,_0x4bf2f6,_0x3bc4f1,_0x1a5cb9){if(_0x2e9a32&&_0x4bf2f6&&_0x3bc4f1){_0x4bf2f6[_0x2cbd('0x22')]+=0x1;var _0x4df8fb={'uniqueid':_0x2e9a32,'from':_0x3bc4f1[_0x2cbd('0x23')]?_0x3bc4f1['body'][_0x2cbd('0xf')]:'','joinAt':moment()[_0x2cbd('0x15')](_0x2cbd('0x24')),'ContactId':_0x3bc4f1[_0x2cbd('0x25')]?_0x3bc4f1[_0x2cbd('0x25')]['id']:null,'ListId':_0x3bc4f1[_0x2cbd('0x26')]?_0x3bc4f1[_0x2cbd('0x26')]['id']:null};_0x4df8fb[_['upperFirst'](_0x3bc4f1['channel'])+_0x2cbd('0x27')]=_0x4bf2f6['id']||null;_0x4df8fb[_['upperFirst'](_0x3bc4f1['channel'])+_0x2cbd('0x14')]=_0x3bc4f1[_0x2cbd('0x28')]?_0x3bc4f1[_0x2cbd('0x28')]['id']:null;_0x4df8fb[_[_0x2cbd('0x29')](_0x3bc4f1['channel'])+_0x2cbd('0x2a')]=_0x3bc4f1[_0x2cbd('0x2b')]?_0x3bc4f1[_0x2cbd('0x2b')]['id']:null;_0x4df8fb[_['upperFirst'](_0x3bc4f1[_0x2cbd('0x2c')])+(_0x3bc4f1[_0x2cbd('0x2c')]!=='chat'?'AccountId':_0x2cbd('0x2d'))]=_0x3bc4f1[_0x2cbd('0xd')]?_0x3bc4f1[_0x2cbd('0xd')]['id']:null;logger[_0x2cbd('0x2e')](util['format'](_0x2cbd('0x2f'),_0x2e9a32,_0x4bf2f6[_0x2cbd('0x30')]));emitChannelQueueInteraction(_0x3bc4f1[_0x2cbd('0x2c')],_0x4bf2f6[_0x2cbd('0x30')],_0x4df8fb,_0x3bc4f1[_0x2cbd('0xd')]['name'],_0x3bc4f1['message']['id'],!![],_0x1a5cb9,_0x4bf2f6['id']);if(rpc[_0x3bc4f1[_0x2cbd('0x2c')]+_0x2cbd('0x31')]){return rpc[_0x3bc4f1[_0x2cbd('0x2c')]+_0x2cbd('0x31')][_0x2cbd('0x32')](_0x4df8fb)[_0x2cbd('0x33')](function(_0x136c73){logger[_0x2cbd('0x34')]('create\x20queue\x20report');});}}}function stopRouting(_0x17d676,_0x1745d1,_0x5d4ccf,_0x4d193a){if(_0x17d676&&_0x1745d1){_0x1745d1[_0x2cbd('0x22')]-=0x1;var _0x181089={'leaveAt':moment()['format'](_0x2cbd('0x24')),'acceptAt':moment()[_0x2cbd('0x15')](_0x2cbd('0x24')),'reason':'accepted'};logger[_0x2cbd('0x2e')](util[_0x2cbd('0x15')](_0x2cbd('0x35'),_0x17d676,_0x1745d1[_0x2cbd('0x30')]));emitChannelQueueInteraction(_0x5d4ccf['channel'],_0x1745d1[_0x2cbd('0x30')],_0x5d4ccf[_0x2cbd('0x23')],_0x5d4ccf[_0x2cbd('0xd')]['name'],_0x5d4ccf[_0x2cbd('0x2b')]['id'],![],_0x4d193a,_0x1745d1['id']);if(rpc[_0x5d4ccf[_0x2cbd('0x2c')]+'QueueReport']){return rpc[_0x5d4ccf[_0x2cbd('0x2c')]+_0x2cbd('0x31')]['update'](_0x17d676,_0x181089)[_0x2cbd('0x33')](function(_0x288b56){logger[_0x2cbd('0x34')](_0x2cbd('0x36'));});}}}function endRouting(_0x1a3589,_0x13b387,_0x4c8b67,_0x465c3b){if(_0x1a3589&&_0x13b387){_0x13b387[_0x2cbd('0x22')]-=0x1;var _0x196241={'leaveAt':moment()[_0x2cbd('0x15')](_0x2cbd('0x24')),'exitAt':moment()[_0x2cbd('0x15')](_0x2cbd('0x24')),'reason':_0x2cbd('0x37')};logger[_0x2cbd('0x2e')](util[_0x2cbd('0x15')](_0x2cbd('0x38'),_0x1a3589,_0x13b387[_0x2cbd('0x30')]));emitChannelQueueInteraction(_0x4c8b67[_0x2cbd('0x2c')],_0x13b387['name'],_0x4c8b67[_0x2cbd('0x23')],_0x4c8b67[_0x2cbd('0xd')][_0x2cbd('0x30')],_0x4c8b67[_0x2cbd('0x2b')]['id'],![],_0x465c3b);if(rpc[_0x4c8b67['channel']+_0x2cbd('0x31')]){return rpc[_0x4c8b67[_0x2cbd('0x2c')]+_0x2cbd('0x31')][_0x2cbd('0x39')](_0x1a3589,_0x196241)[_0x2cbd('0x33')](function(_0x7d067){logger[_0x2cbd('0x34')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x1c1005){return function(_0x4bfd83){return _0x4bfd83[_0x2cbd('0x30')][_0x2cbd('0x3a')]()===_0x1c1005[_0x2cbd('0x3a')]();};}exports[_0x2cbd('0x3b')]=function(_0x57e814,_0x22faeb,_0x1994e6,_0x4b3e33){return function(_0x3f1621){try{var _0x2c9c89={'name':_0x22faeb[0x0],'timeout':_0x22faeb[0x1]};var _0x5adb19=queue[_0x2cbd('0x0')](_0x2c9c89,{'typecast':!![]});if(_0x5adb19['length']){logger[_0x2cbd('0x34')](_0x2cbd('0x3c'),_0x57e814,_[_0x2cbd('0x3d')](_0x5adb19,_0x2cbd('0x2b'))[_0x2cbd('0x3e')](',\x20'));_0x3f1621[_0x2cbd('0x3f')]();}else{var _0x49cae8=_[_0x2cbd('0x40')](_0x1994e6[_0x4b3e33[_0x2cbd('0x2c')]+'Queues'],handleFindQueue(_0x2c9c89[_0x2cbd('0x30')]));if(_0x49cae8){startRouting(_0x57e814,_0x49cae8,_0x4b3e33,_0x1994e6);var _0x2402d2=(_0x49cae8['timeout']||0xa)*0x3e8;var _0x4f1fb5=(_0x2c9c89[_0x2cbd('0x37')]||0x14)*0x3e8;var _0x2c6a55;if(_0x2402d2>_0x4f1fb5){_0x4f1fb5=_0x2402d2;}var _0x5733f1=seqqueue[_0x2cbd('0x41')](_0x2402d2);_0x5733f1['id']=_0x57e814;_0x5733f1['atimeout']=_0x2402d2;_0x5733f1[_0x2cbd('0x42')]=_0x4f1fb5;_0x5733f1['channel']=_0x4b3e33[_0x2cbd('0x2c')];_0x1994e6[_0x2cbd('0x43')][_0x57e814]['on'](_0x2cbd('0x44'),function(){logger[_0x2cbd('0x2e')](_0x2cbd('0x45'),_0x57e814);stopRouting(_0x57e814,_0x49cae8,_0x4b3e33,_0x1994e6);clearTimeout(_0x2c6a55);_0x2c6a55=undefined;_0x5733f1['close'](!![]);if(_0x1994e6[_0x2cbd('0x43')][_0x57e814]){delete _0x1994e6[_0x2cbd('0x43')][_0x57e814];}_0x3f1621[_0x2cbd('0x3f')]();});_0x1994e6['rules'][_0x57e814]['on'](_0x2cbd('0x46'),function(){if(_0x1994e6[_0x2cbd('0x43')][_0x57e814]){delete _0x1994e6[_0x2cbd('0x43')][_0x57e814];}});_0x2c6a55=setTimeout(function(){logger[_0x2cbd('0x2e')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x57e814);endRouting(_0x57e814,_0x49cae8,_0x4b3e33,_0x1994e6);clearTimeout(_0x2c6a55);_0x5733f1[_0x2cbd('0x47')](!![]);_0x3f1621[_0x2cbd('0x48')]();},_0x4f1fb5);switch(_0x49cae8[_0x2cbd('0x49')]){case _0x2cbd('0x4a'):strategy[_0x2cbd('0x4a')](_0x5733f1,_0x49cae8,_0x1994e6,_0x4b3e33);break;default:strategy['beepall'](_0x5733f1,_0x49cae8,_0x1994e6,_0x4b3e33);}}else{logger[_0x2cbd('0x34')](_0x2cbd('0x4b'),_0x57e814,_0x2c9c89[_0x2cbd('0x30')]);_0x3f1621[_0x2cbd('0x3f')]();}}}catch(_0x2ab519){console['log'](_0x2ab519);logger[_0x2cbd('0x34')](_0x2cbd('0x3c'),_0x57e814,_0x2ab519['stack']);_0x3f1621[_0x2cbd('0x3f')]();}};}; \ No newline at end of file +var _0x224b=['update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','find','createQueue','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','beepall','stop','log','stack','validate','lodash','util','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','defaults','redis','socket.io-emitter','account','queue','from','joinAt','emit','clone','queue_id','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','pick','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','create\x20queue\x20report','waiting','YYYY-MM-DD\x20HH:mm:ss','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update'];(function(_0xb4d928,_0x579093){var _0x47166e=function(_0x198064){while(--_0x198064){_0xb4d928['push'](_0xb4d928['shift']());}};_0x47166e(++_0x579093);}(_0x224b,0x66));var _0xb224=function(_0x52a16a,_0x5312cf){_0x52a16a=_0x52a16a-0x0;var _0x563194=_0x224b[_0x52a16a];return _0x563194;};'use strict';var schema=require(_0xb224('0x0'));var _=require(_0xb224('0x1'));var util=require(_0xb224('0x2'));var seqqueue=require('seq-queue');var moment=require(_0xb224('0x3'));var Redis=require(_0xb224('0x4'));var config=require(_0xb224('0x5'));var logger=require(_0xb224('0x6'))(_0xb224('0x7'));var strategy=require(_0xb224('0x8'));config['redis']=_[_0xb224('0x9')](config[_0xb224('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xb224('0xb'))(new Redis(config[_0xb224('0xa')]));var attributes=['id','queue_id',_0xb224('0xc'),_0xb224('0xd'),_0xb224('0xe'),_0xb224('0xf')];function emit(_0x3a5acb,_0x508db3,_0x27c3f9){io['to'](_0x3a5acb)[_0xb224('0x10')](_0x508db3,_0x27c3f9);}function emitChannelQueueInteraction(_0x582779,_0x3bcbc8,_0x26c115,_0x3d2fb8,_0x35251a,_0x22e34c,_0x3d4940,_0x2b6b88){var _0x424b3b=_[_0xb224('0x11')](_0x26c115);_0x424b3b[_0xb224('0x12')]=_0x2b6b88;_0x424b3b['queue']=_0x3bcbc8;_0x424b3b[_0xb224('0xc')]=_0x3d2fb8;_0x424b3b['id']=_0x35251a;if(_0x22e34c){attributes[_0xb224('0x13')](_[_0xb224('0x14')](_0x582779)+_0xb224('0x15'));_0x3d4940[util[_0xb224('0x16')](_0xb224('0x17'),_0x582779)][_0x35251a]=_['pick'](_0x424b3b,attributes);}else{delete _0x3d4940[util['format']('%sQueuesWaitingInteractions',_0x582779)][_0x35251a];}emit(util[_0xb224('0x16')](_0xb224('0x18'),_0x582779,_0x3bcbc8),util[_0xb224('0x16')](_0xb224('0x19'),_0x582779,_0x22e34c?_0xb224('0x1a'):'remove'),_[_0xb224('0x1b')](_0x424b3b,attributes));}var rpc={'openchannelQueueReport':require(_0xb224('0x1c')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xb224('0x1d')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xb224('0x1e')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0xb224('0x1f'),'required':!![],'message':_0xb224('0x20')},'timeout':{'type':_0xb224('0x21'),'message':_0xb224('0x22')}});function startRouting(_0x151700,_0x3ef675,_0x4a7472,_0x943dd8){if(_0x151700&&_0x3ef675&&_0x4a7472){_0x3ef675['waiting']+=0x1;var _0x27361c={'uniqueid':_0x151700,'from':_0x4a7472[_0xb224('0x23')]?_0x4a7472['body']['from']:'','joinAt':moment()[_0xb224('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4a7472[_0xb224('0x24')]?_0x4a7472['contact']['id']:null,'ListId':_0x4a7472[_0xb224('0x25')]?_0x4a7472[_0xb224('0x25')]['id']:null};_0x27361c[_[_0xb224('0x26')](_0x4a7472[_0xb224('0x27')])+_0xb224('0x28')]=_0x3ef675['id']||null;_0x27361c[_['upperFirst'](_0x4a7472[_0xb224('0x27')])+'InteractionId']=_0x4a7472[_0xb224('0x29')]?_0x4a7472['interaction']['id']:null;_0x27361c[_['upperFirst'](_0x4a7472[_0xb224('0x27')])+_0xb224('0x2a')]=_0x4a7472[_0xb224('0x2b')]?_0x4a7472[_0xb224('0x2b')]['id']:null;_0x27361c[_[_0xb224('0x26')](_0x4a7472['channel'])+(_0x4a7472[_0xb224('0x27')]!=='chat'?_0xb224('0x2c'):_0xb224('0x2d'))]=_0x4a7472[_0xb224('0xc')]?_0x4a7472[_0xb224('0xc')]['id']:null;logger['info'](util[_0xb224('0x16')](_0xb224('0x2e'),_0x151700,_0x3ef675[_0xb224('0x2f')]));emitChannelQueueInteraction(_0x4a7472[_0xb224('0x27')],_0x3ef675[_0xb224('0x2f')],_0x27361c,_0x4a7472[_0xb224('0xc')][_0xb224('0x2f')],_0x4a7472[_0xb224('0x2b')]['id'],!![],_0x943dd8,_0x3ef675['id']);if(rpc[_0x4a7472['channel']+_0xb224('0x30')]){return rpc[_0x4a7472[_0xb224('0x27')]+_0xb224('0x30')]['create'](_0x27361c)[_0xb224('0x31')](function(_0x36cc37){logger[_0xb224('0x32')](_0xb224('0x33'));});}}}function stopRouting(_0x5cd215,_0xaa465b,_0x5605ab,_0x49a261){if(_0x5cd215&&_0xaa465b){_0xaa465b[_0xb224('0x34')]-=0x1;var _0x19b0d4={'leaveAt':moment()[_0xb224('0x16')](_0xb224('0x35')),'acceptAt':moment()['format'](_0xb224('0x35')),'reason':_0xb224('0x36')};logger[_0xb224('0x37')](util['format'](_0xb224('0x38'),_0x5cd215,_0xaa465b[_0xb224('0x2f')]));emitChannelQueueInteraction(_0x5605ab[_0xb224('0x27')],_0xaa465b[_0xb224('0x2f')],_0x5605ab[_0xb224('0x23')],_0x5605ab['account'][_0xb224('0x2f')],_0x5605ab[_0xb224('0x2b')]['id'],![],_0x49a261,_0xaa465b['id']);if(rpc[_0x5605ab[_0xb224('0x27')]+_0xb224('0x30')]){return rpc[_0x5605ab[_0xb224('0x27')]+_0xb224('0x30')][_0xb224('0x39')](_0x5cd215,_0x19b0d4)[_0xb224('0x31')](function(_0xffb317){logger[_0xb224('0x32')](_0xb224('0x3a'));});}}}function endRouting(_0x2d4a37,_0x4ddffb,_0x456ef8,_0x427d9a){if(_0x2d4a37&&_0x4ddffb){_0x4ddffb[_0xb224('0x34')]-=0x1;var _0x1dee45={'leaveAt':moment()[_0xb224('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format'](_0xb224('0x35')),'reason':_0xb224('0x3b')};logger[_0xb224('0x37')](util[_0xb224('0x16')](_0xb224('0x3c'),_0x2d4a37,_0x4ddffb[_0xb224('0x2f')]));emitChannelQueueInteraction(_0x456ef8[_0xb224('0x27')],_0x4ddffb[_0xb224('0x2f')],_0x456ef8[_0xb224('0x23')],_0x456ef8['account']['name'],_0x456ef8[_0xb224('0x2b')]['id'],![],_0x427d9a);if(rpc[_0x456ef8['channel']+'QueueReport']){return rpc[_0x456ef8[_0xb224('0x27')]+'QueueReport']['update'](_0x2d4a37,_0x1dee45)[_0xb224('0x31')](function(_0x4c7408){logger[_0xb224('0x32')](_0xb224('0x3a'));});}}}function handleFindQueue(_0x4acfe5){return function(_0x465c03){return _0x465c03[_0xb224('0x2f')][_0xb224('0x3d')]()===_0x4acfe5[_0xb224('0x3d')]();};}exports[_0xb224('0x3e')]=function(_0x5bb881,_0x2d0fbf,_0x5e9d2f,_0x5d555f){return function(_0x273f21){try{var _0x3b28ca={'name':_0x2d0fbf[0x0],'timeout':_0x2d0fbf[0x1]};var _0x9629a3=queue[_0xb224('0x0')](_0x3b28ca,{'typecast':!![]});if(_0x9629a3[_0xb224('0x3f')]){logger[_0xb224('0x32')](_0xb224('0x40'),_0x5bb881,_[_0xb224('0x41')](_0x9629a3,_0xb224('0x2b'))[_0xb224('0x42')](',\x20'));_0x273f21['stop']();}else{var _0x47d7dd=_[_0xb224('0x43')](_0x5e9d2f[_0x5d555f[_0xb224('0x27')]+'Queues'],handleFindQueue(_0x3b28ca[_0xb224('0x2f')]));if(_0x47d7dd){startRouting(_0x5bb881,_0x47d7dd,_0x5d555f,_0x5e9d2f);var _0x252203=(_0x47d7dd['timeout']||0xa)*0x3e8;var _0x55c4fa=(_0x3b28ca[_0xb224('0x3b')]||0x14)*0x3e8;var _0x53753b;if(_0x252203>_0x55c4fa){_0x55c4fa=_0x252203;}var _0x13f95f=seqqueue[_0xb224('0x44')](_0x252203);_0x13f95f['id']=_0x5bb881;_0x13f95f['atimeout']=_0x252203;_0x13f95f['qtimeout']=_0x55c4fa;_0x13f95f['channel']=_0x5d555f[_0xb224('0x27')];_0x5e9d2f[_0xb224('0x45')][_0x5bb881]['on']('end',function(){logger['info'](_0xb224('0x46'),_0x5bb881);stopRouting(_0x5bb881,_0x47d7dd,_0x5d555f,_0x5e9d2f);clearTimeout(_0x53753b);_0x53753b=undefined;_0x13f95f[_0xb224('0x47')](!![]);if(_0x5e9d2f[_0xb224('0x45')][_0x5bb881]){delete _0x5e9d2f[_0xb224('0x45')][_0x5bb881];}_0x273f21['stop']();});_0x5e9d2f[_0xb224('0x45')][_0x5bb881]['on'](_0xb224('0x48'),function(){if(_0x5e9d2f[_0xb224('0x45')][_0x5bb881]){delete _0x5e9d2f['rules'][_0x5bb881];}});_0x53753b=setTimeout(function(){logger['info'](_0xb224('0x49'),_0x5bb881);endRouting(_0x5bb881,_0x47d7dd,_0x5d555f,_0x5e9d2f);clearTimeout(_0x53753b);_0x13f95f[_0xb224('0x47')](!![]);_0x273f21[_0xb224('0x4a')]();},_0x55c4fa);switch(_0x47d7dd[_0xb224('0x4b')]){case'rrmemory':strategy['rrmemory'](_0x13f95f,_0x47d7dd,_0x5e9d2f,_0x5d555f);break;default:strategy[_0xb224('0x4c')](_0x13f95f,_0x47d7dd,_0x5e9d2f,_0x5d555f);}}else{logger[_0xb224('0x32')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x5bb881,_0x3b28ca[_0xb224('0x2f')]);_0x273f21[_0xb224('0x4d')]();}}}catch(_0x5305f6){console[_0xb224('0x4e')](_0x5305f6);logger[_0xb224('0x32')]('[%s][QUEUE]\x20%s',_0x5bb881,_0x5305f6[_0xb224('0x4f')]);_0x273f21['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 785825f..bd18ef4 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 _0xb821=['squeue','agent','routing','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','realtime','channel','agents','busy','busyQueue','saveWaitingNotification','showNotification','forcedOwnership',':FORCED','debug','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','writeLog','STOP','TIMEOUT','exports','uuid','./util','notificationId'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xb821,0xa7));var _0x1b82=function(_0x1a7e12,_0x3e40ad){_0x1a7e12=_0x1a7e12-0x0;var _0x2d28ef=_0xb821[_0x1a7e12];return _0x2d28ef;};'use strict';var _=require('lodash');var uuid=require(_0x1b82('0x0'));var util=require(_0x1b82('0x1'));var logger=require('../../../../../config/logger')('routing');var Agent=function(_0xbab478,_0x578a10,_0x4b1809,_0x3b1d14){this[_0x1b82('0x2')]=uuid['v4']();this[_0x1b82('0x3')]=_0xbab478;this[_0x1b82('0x4')]=_0x578a10;this['realtime']=_0x4b1809;this[_0x1b82('0x5')]=_0x3b1d14;this[_0x1b82('0x3')][_0x1b82('0x6')](this[_0x1b82('0x7')][_0x1b82('0x8')](this),this[_0x1b82('0x9')][_0x1b82('0x8')](this));this[_0x1b82('0x3')]['on'](_0x1b82('0xa'),this['handleTimeout'][_0x1b82('0x8')](this));this[_0x1b82('0x3')]['on'](_0x1b82('0xb'),this[_0x1b82('0xc')][_0x1b82('0x8')](this));};Agent[_0x1b82('0xd')][_0x1b82('0x6')]=function(){this[_0x1b82('0x3')]['push'](this[_0x1b82('0x7')][_0x1b82('0x8')](this),this[_0x1b82('0x9')][_0x1b82('0x8')](this));};Agent['prototype'][_0x1b82('0xc')]=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0x1b82('0x7')]=function(){logger['debug'](_0x1b82('0xe'),this[_0x1b82('0x3')]['id'],this['agent']['id']);if(_[_0x1b82('0xf')](this['realtime']['agents'][this[_0x1b82('0x4')]['id']])){logger['debug'](_0x1b82('0x10'),this[_0x1b82('0x3')]['id'],this[_0x1b82('0x4')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this[_0x1b82('0x5')]['forcedOwnership']||util[_0x1b82('0x11')](this[_0x1b82('0x3')]['id'],this[_0x1b82('0x12')]['agents'][this[_0x1b82('0x4')]['id']],this[_0x1b82('0x3')][_0x1b82('0x13')],![])){this[_0x1b82('0x12')][_0x1b82('0x14')][this['agent']['id']][_0x1b82('0x15')]=!![];this[_0x1b82('0x12')][_0x1b82('0x14')][this[_0x1b82('0x4')]['id']][_0x1b82('0x16')]=undefined;util[_0x1b82('0x17')](this[_0x1b82('0x12')],this['routing'],this[_0x1b82('0x4')],this[_0x1b82('0x3')]['channel']);util[_0x1b82('0x18')](this[_0x1b82('0x2')],this[_0x1b82('0x3')]['id'],this['realtime'][_0x1b82('0x14')][this['agent']['id']],null,this['routing']);util['writeLog'](this[_0x1b82('0x3')]['id'],this[_0x1b82('0x12')][_0x1b82('0x14')][this[_0x1b82('0x4')]['id']],'RINGING'+(this[_0x1b82('0x5')][_0x1b82('0x19')]?_0x1b82('0x1a'):''));}else{logger[_0x1b82('0x1b')](_0x1b82('0x1c'),this[_0x1b82('0x3')]['id'],this[_0x1b82('0x4')]['id']);setTimeout(this[_0x1b82('0x6')][_0x1b82('0x8')](this),0x3e8);}}};Agent[_0x1b82('0xd')][_0x1b82('0x9')]=function(_0x37275f){if(_[_0x1b82('0xf')](this['realtime'][_0x1b82('0x14')][this[_0x1b82('0x4')]['id']])){return logger[_0x1b82('0x1b')](_0x1b82('0x10'),this[_0x1b82('0x3')]['id'],this[_0x1b82('0x4')]['id']);}else{logger[_0x1b82('0x1b')](_0x1b82('0x1d'),this[_0x1b82('0x3')]['id'],this[_0x1b82('0x4')]['id']);util['hideNotification'](this[_0x1b82('0x2')],this[_0x1b82('0x3')]['id'],this[_0x1b82('0x12')][_0x1b82('0x14')][this['agent']['id']],null,this[_0x1b82('0x5')]);this[_0x1b82('0x12')]['agents'][this[_0x1b82('0x4')]['id']][_0x1b82('0x15')]=![];this[_0x1b82('0x12')]['agents'][this['agent']['id']][_0x1b82('0x16')]=undefined;util['removeWaitingNotification'](this['realtime'],this[_0x1b82('0x5')],this[_0x1b82('0x4')],this[_0x1b82('0x3')]['channel']);util[_0x1b82('0x1e')](this[_0x1b82('0x3')]['id'],this[_0x1b82('0x12')][_0x1b82('0x14')][this['agent']['id']],_0x37275f?_0x1b82('0x1f'):_0x1b82('0x20'));}if(!_0x37275f){setTimeout(this[_0x1b82('0x6')]['bind'](this),0x3e8);}};function agent(_0x48fd54,_0x21e859,_0x5d7e6a,_0x1d3e68){return new Agent(_0x48fd54,_0x21e859,_0x5d7e6a,_0x1d3e68);}module[_0x1b82('0x21')]=agent; \ No newline at end of file +var _0x4bc3=['hideNotification','STOP','exports','lodash','uuid','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','bind','handleTimeout','timeout','drained','handleDrained','push','handleRun','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','debug','forcedOwnership','busy','busyQueue','saveWaitingNotification','channel','showNotification','writeLog','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s'];(function(_0x2d8aae,_0x4dc2c5){var _0x4add8a=function(_0x2ba1d9){while(--_0x2ba1d9){_0x2d8aae['push'](_0x2d8aae['shift']());}};_0x4add8a(++_0x4dc2c5);}(_0x4bc3,0x16e));var _0x34bc=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x4bc3[_0x2b9b7f];return _0x4ed19a;};'use strict';var _=require(_0x34bc('0x0'));var uuid=require(_0x34bc('0x1'));var util=require('./util');var logger=require(_0x34bc('0x2'))(_0x34bc('0x3'));var Agent=function(_0x5b45c7,_0x178fc0,_0x616014,_0x3ce1c3){this[_0x34bc('0x4')]=uuid['v4']();this[_0x34bc('0x5')]=_0x5b45c7;this[_0x34bc('0x6')]=_0x178fc0;this[_0x34bc('0x7')]=_0x616014;this['routing']=_0x3ce1c3;this[_0x34bc('0x5')]['push'](this['handleRun'][_0x34bc('0x8')](this),this[_0x34bc('0x9')][_0x34bc('0x8')](this));this[_0x34bc('0x5')]['on'](_0x34bc('0xa'),this[_0x34bc('0x9')]['bind'](this));this['squeue']['on'](_0x34bc('0xb'),this[_0x34bc('0xc')][_0x34bc('0x8')](this));};Agent['prototype'][_0x34bc('0xd')]=function(){this['squeue'][_0x34bc('0xd')](this[_0x34bc('0xe')][_0x34bc('0x8')](this),this['handleTimeout'][_0x34bc('0x8')](this));};Agent['prototype'][_0x34bc('0xc')]=function(){this[_0x34bc('0x9')](!![]);};Agent[_0x34bc('0xf')]['handleRun']=function(){logger['debug'](_0x34bc('0x10'),this['squeue']['id'],this[_0x34bc('0x6')]['id']);if(_[_0x34bc('0x11')](this[_0x34bc('0x7')][_0x34bc('0x12')][this[_0x34bc('0x6')]['id']])){logger[_0x34bc('0x13')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x34bc('0xd')][_0x34bc('0x8')](this),0x3e8);}else{if(this[_0x34bc('0x3')][_0x34bc('0x14')]||util['isAgentAvailable'](this[_0x34bc('0x5')]['id'],this[_0x34bc('0x7')]['agents'][this[_0x34bc('0x6')]['id']],this[_0x34bc('0x5')]['channel'],![])){this[_0x34bc('0x7')][_0x34bc('0x12')][this[_0x34bc('0x6')]['id']][_0x34bc('0x15')]=!![];this[_0x34bc('0x7')][_0x34bc('0x12')][this['agent']['id']][_0x34bc('0x16')]=undefined;util[_0x34bc('0x17')](this[_0x34bc('0x7')],this['routing'],this['agent'],this[_0x34bc('0x5')][_0x34bc('0x18')]);util[_0x34bc('0x19')](this[_0x34bc('0x4')],this[_0x34bc('0x5')]['id'],this[_0x34bc('0x7')][_0x34bc('0x12')][this[_0x34bc('0x6')]['id']],null,this[_0x34bc('0x3')]);util[_0x34bc('0x1a')](this[_0x34bc('0x5')]['id'],this[_0x34bc('0x7')]['agents'][this[_0x34bc('0x6')]['id']],'RINGING'+(this['routing'][_0x34bc('0x14')]?':FORCED':''));}else{logger[_0x34bc('0x13')](_0x34bc('0x1b'),this[_0x34bc('0x5')]['id'],this['agent']['id']);setTimeout(this[_0x34bc('0xd')][_0x34bc('0x8')](this),0x3e8);}}};Agent[_0x34bc('0xf')][_0x34bc('0x9')]=function(_0x2bb874){if(_[_0x34bc('0x11')](this['realtime'][_0x34bc('0x12')][this[_0x34bc('0x6')]['id']])){return logger[_0x34bc('0x13')](_0x34bc('0x1c'),this[_0x34bc('0x5')]['id'],this[_0x34bc('0x6')]['id']);}else{logger['debug'](_0x34bc('0x1d'),this['squeue']['id'],this['agent']['id']);util[_0x34bc('0x1e')](this['notificationId'],this[_0x34bc('0x5')]['id'],this[_0x34bc('0x7')][_0x34bc('0x12')][this[_0x34bc('0x6')]['id']],null,this[_0x34bc('0x3')]);this[_0x34bc('0x7')][_0x34bc('0x12')][this['agent']['id']][_0x34bc('0x15')]=![];this[_0x34bc('0x7')][_0x34bc('0x12')][this[_0x34bc('0x6')]['id']][_0x34bc('0x16')]=undefined;util['removeWaitingNotification'](this[_0x34bc('0x7')],this[_0x34bc('0x3')],this[_0x34bc('0x6')],this[_0x34bc('0x5')][_0x34bc('0x18')]);util['writeLog'](this['squeue']['id'],this[_0x34bc('0x7')][_0x34bc('0x12')][this[_0x34bc('0x6')]['id']],_0x2bb874?_0x34bc('0x1f'):'TIMEOUT');}if(!_0x2bb874){setTimeout(this[_0x34bc('0xd')][_0x34bc('0x8')](this),0x3e8);}};function agent(_0x32cf3b,_0x5b6acd,_0x37cd30,_0x42d1eb){return new Agent(_0x32cf3b,_0x5b6acd,_0x37cd30,_0x42d1eb);}module[_0x34bc('0x20')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 4535103..d73e356 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 _0x9424=['agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busy','busyQueue','name','showNotification','debug','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','removeWaitingNotification','exports','lodash','uuid','routing','notificationId','squeue','realtime','push','handleRun','handleTimeout','bind','timeout','drained','handleDrained','prototype','isNil','queue','Agents','length'];(function(_0x2eeced,_0x343736){var _0x5eb667=function(_0x271592){while(--_0x271592){_0x2eeced['push'](_0x2eeced['shift']());}};_0x5eb667(++_0x343736);}(_0x9424,0x14e));var _0x4942=function(_0x3360bf,_0x2a393d){_0x3360bf=_0x3360bf-0x0;var _0x2182b9=_0x9424[_0x3360bf];return _0x2182b9;};'use strict';var _=require(_0x4942('0x0'));var uuid=require(_0x4942('0x1'));var util=require('./util');var logger=require('../../../../../config/logger')(_0x4942('0x2'));var Beepall=function(_0x31dd24,_0x49b89f,_0x1e546f,_0x13e609){this[_0x4942('0x3')]=uuid['v4']();this[_0x4942('0x4')]=_0x31dd24;this['queue']=_0x49b89f;this[_0x4942('0x5')]=_0x1e546f;this[_0x4942('0x2')]=_0x13e609;this['squeue'][_0x4942('0x6')](this[_0x4942('0x7')]['bind'](this),this[_0x4942('0x8')][_0x4942('0x9')](this));this[_0x4942('0x4')]['on'](_0x4942('0xa'),this[_0x4942('0x8')][_0x4942('0x9')](this));this['squeue']['on'](_0x4942('0xb'),this[_0x4942('0xc')][_0x4942('0x9')](this));};Beepall['prototype'][_0x4942('0x6')]=function(){this[_0x4942('0x4')][_0x4942('0x6')](this[_0x4942('0x7')][_0x4942('0x9')](this),this[_0x4942('0x8')][_0x4942('0x9')](this));};Beepall[_0x4942('0xd')][_0x4942('0xc')]=function(){this[_0x4942('0x8')](!![]);};Beepall[_0x4942('0xd')][_0x4942('0x7')]=function(){var _0x126171=!![];if(!_[_0x4942('0xe')](this['queue'])&&!_[_0x4942('0xe')](this[_0x4942('0xf')][_0x4942('0x10')])&&this[_0x4942('0xf')][_0x4942('0x10')][_0x4942('0x11')]>0x0){for(var _0x956b2a=0x0,_0x3caf4f;_0x956b2a0x0){for(var _0x200683=0x0,_0x26c111;_0x2006830x0&&_0x469dcf[_0x2e5463+_0x99d7('0x20')]>=_0x469dcf[_0x2e5463+_0x99d7('0x1f')]){writeLog(_0x4713b2,_0x469dcf,_0x2e5463[_0x99d7('0x21')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports['showNotification']=function(_0x821da2,_0x6395bc,_0x5795d4,_0x37681f,_0x3f06ca){return sendNotification(!![],_0x821da2,_0x6395bc,_0x5795d4,_0x37681f,_0x3f06ca);};exports[_0x99d7('0x22')]=function(_0x44541d,_0x3da67f,_0x5f202e,_0xc9e7ab,_0x559726){return sendNotification(![],_0x44541d,_0x3da67f,_0x5f202e,_0xc9e7ab,_0x559726);};exports[_0x99d7('0x23')]=function(_0x31836c,_0x410df3,_0x2b08be){var _0x20042a=_0x410df3[_0x99d7('0x24')][_0x99d7('0x25')];if(!_0x20042a&&_0x2b08be){_0x20042a=_0x2b08be['id'];}var _0x27413f=_[_0x99d7('0x26')](_0x31836c[_0x410df3[_0x99d7('0x27')]+_0x99d7('0x28')],function(_0x29da87){var _0x56f544=_[_0x99d7('0x29')](_0x410df3[_0x99d7('0x27')])+_0x99d7('0x2a');return _0x29da87[_0x56f544]===_0x410df3[_0x99d7('0x24')]['id'];});if(!_0x27413f&&_0x20042a){_0x27413f=_[_0x99d7('0x26')](_0x31836c['agents'][_0x20042a][_0x410df3[_0x99d7('0x27')]+_0x99d7('0x2b')],function(_0xe9e064){return _0xe9e064['id']===_0x410df3[_0x99d7('0x24')]['id'];});}return _0x27413f;};exports[_0x99d7('0x2c')]=function(_0x56f9b1,_0xa73b4e,_0xf3beed,_0x1d0726){_0x56f9b1[_0x99d7('0x2d')][_0xf3beed['id']][_0x1d0726+_0x99d7('0x2b')][_0xa73b4e[_0x99d7('0x2e')]['id']]={'id':_0xa73b4e[_0x99d7('0x24')]['id']};};exports['removeWaitingNotification']=function(_0x279f06,_0x10ad6b,_0x3067c5,_0x2e1100){delete _0x279f06[_0x99d7('0x2d')][_0x3067c5['id']][_0x2e1100+_0x99d7('0x2b')][_0x10ad6b[_0x99d7('0x2e')]['id']];};exports['writeLog']=writeLog; \ No newline at end of file +var _0x0cf6=['WaitingInteractions','removeWaitingNotification','writeLog','lodash','util','ioredis','redis','defaults','localhost','socket.io-emitter','format','user:%s','name','user:save','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','I\x20can\x27t\x20render\x20your\x20template','error','message','emit','save','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','OFFLINE','Pause','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','checkWaitingNotifications','interaction','UserId','channel','QueuesWaitingInteractions','capitalize','InteractionId','some','agents','saveWaitingNotification'];(function(_0x32c3c9,_0x42bd3c){var _0x3a9405=function(_0x35cdfa){while(--_0x35cdfa){_0x32c3c9['push'](_0x32c3c9['shift']());}};_0x3a9405(++_0x42bd3c);}(_0x0cf6,0x67));var _0x60cf=function(_0x509f06,_0x2fbbde){_0x509f06=_0x509f06-0x0;var _0x360b11=_0x0cf6[_0x509f06];return _0x360b11;};'use strict';var _=require(_0x60cf('0x0'));var util=require(_0x60cf('0x1'));var utils=require('../utils');var Redis=require(_0x60cf('0x2'));var config=require('../../../../../config/environment');var logger=require('../../../../../config/logger')('routing');config[_0x60cf('0x3')]=_[_0x60cf('0x4')](config['redis'],{'host':_0x60cf('0x5'),'port':0x18eb});var io=require(_0x60cf('0x6'))(new Redis(config[_0x60cf('0x3')]));function sendNotification(_0x4637bc,_0x5f359a,_0xe4c749,_0x16dcd3,_0x2698a1,_0x237e3c){io['to'](util[_0x60cf('0x7')](_0x60cf('0x8'),_0x16dcd3[_0x60cf('0x9')]))['emit'](_0x60cf('0xa'),_0x16dcd3);var _0x421088=_0x237e3c||{};var _0x29d70f=_0xe4c749['split']('.');var _0x4d370e={'uniqueid':_0x5f359a,'channel':_0x29d70f[0x0],'id':_0x29d70f[0x1],'title':_0x29d70f[0x0]+_0x60cf('0xb'),'interactionId':_0x29d70f[0x2],'queue':_0x2698a1?_0x2698a1[_0x60cf('0x9')]:null,'sound':_0x421088[_0x60cf('0xc')][_0x60cf('0xd')],'shake':_0x421088[_0x60cf('0xc')][_0x60cf('0xe')]};try{if(!_0x421088['body']){_0x421088[_0x60cf('0xf')]={};}if(_0x2698a1){_0x421088[_0x60cf('0xf')][_0x60cf('0x10')]=_0x2698a1;}else if(_0x421088[_0x60cf('0xf')][_0x60cf('0x10')]){delete _0x421088[_0x60cf('0xf')][_0x60cf('0x10')];}_0x4d370e[_0x60cf('0x11')]=utils['getMustacheRender'](_0x421088[_0x60cf('0xc')]['notificationTemplate'],_0x421088);}catch(_0x4f4b1a){_0x4d370e['msg']=_0x60cf('0x12');logger[_0x60cf('0x13')](util[_0x60cf('0x7')]('[%s][QUEUE]\x20%s',_0x5f359a,_0x4f4b1a[_0x60cf('0x14')]));}io['to'](util[_0x60cf('0x7')](_0x60cf('0x8'),_0x16dcd3[_0x60cf('0x9')]))[_0x60cf('0x15')](util[_0x60cf('0x7')]('notification:%s',_0x4637bc?_0x60cf('0x16'):'remove'),_0x4d370e);}function writeLog(_0xf0c48a,_0x42da7b,_0x3902e4){return logger[_0x60cf('0x17')](util['format'](_0x60cf('0x18'),_0xf0c48a,_0x42da7b[_0x60cf('0x9')],_0x3902e4));}exports[_0x60cf('0x19')]=function(_0x4d73b1,_0x16dc3f,_0x5413ec,_0x4d6587){if(_0x16dc3f[_0x60cf('0x1a')]){writeLog(_0x4d73b1,_0x16dc3f,_0x60cf('0x1b'));return![];}if(!_0x16dc3f['online']){writeLog(_0x4d73b1,_0x16dc3f,_0x60cf('0x1c'));return![];}if(_0x16dc3f[_0x5413ec+_0x60cf('0x1d')]){writeLog(_0x4d73b1,_0x16dc3f,'PAUSE');return![];}if(_0x4d6587&&_0x16dc3f[_0x60cf('0x1e')](_0x5413ec+'Capacity')&&_0x16dc3f[_0x60cf('0x1e')](_0x5413ec+'CurrentCapacity')){if(_0x16dc3f[_0x5413ec+_0x60cf('0x1f')]>0x0&&_0x16dc3f[_0x5413ec+_0x60cf('0x20')]>=_0x16dc3f[_0x5413ec+_0x60cf('0x1f')]){writeLog(_0x4d73b1,_0x16dc3f,_0x5413ec[_0x60cf('0x21')]()+_0x60cf('0x22'));return![];}}return!![];};exports[_0x60cf('0x23')]=function(_0xc14bb7,_0x424640,_0x1ef2d9,_0xdb76aa,_0x4f8467){return sendNotification(!![],_0xc14bb7,_0x424640,_0x1ef2d9,_0xdb76aa,_0x4f8467);};exports[_0x60cf('0x24')]=function(_0x54cd3e,_0x2a7b3d,_0x4665a4,_0x2e1557,_0x21f973){return sendNotification(![],_0x54cd3e,_0x2a7b3d,_0x4665a4,_0x2e1557,_0x21f973);};exports[_0x60cf('0x25')]=function(_0x328fac,_0x30667d,_0x3d7213){var _0x366a57=_0x30667d[_0x60cf('0x26')][_0x60cf('0x27')];if(!_0x366a57&&_0x3d7213){_0x366a57=_0x3d7213['id'];}var _0x44f307=_['some'](_0x328fac[_0x30667d[_0x60cf('0x28')]+_0x60cf('0x29')],function(_0x395336){var _0xc06ddc=_[_0x60cf('0x2a')](_0x30667d['channel'])+_0x60cf('0x2b');return _0x395336[_0xc06ddc]===_0x30667d[_0x60cf('0x26')]['id'];});if(!_0x44f307&&_0x366a57){_0x44f307=_[_0x60cf('0x2c')](_0x328fac[_0x60cf('0x2d')][_0x366a57][_0x30667d[_0x60cf('0x28')]+'WaitingInteractions'],function(_0x2526b1){return _0x2526b1['id']===_0x30667d[_0x60cf('0x26')]['id'];});}return _0x44f307;};exports[_0x60cf('0x2e')]=function(_0x5d4d9b,_0x452e40,_0x2df88f,_0x21b8f7){_0x5d4d9b['agents'][_0x2df88f['id']][_0x21b8f7+_0x60cf('0x2f')][_0x452e40[_0x60cf('0x14')]['id']]={'id':_0x452e40[_0x60cf('0x26')]['id']};};exports[_0x60cf('0x30')]=function(_0x1c6ea7,_0x51762f,_0xd80b3c,_0x5562d2){delete _0x1c6ea7[_0x60cf('0x2d')][_0xd80b3c['id']][_0x5562d2+_0x60cf('0x2f')][_0x51762f[_0x60cf('0x14')]['id']];};exports[_0x60cf('0x31')]=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 0ba9f68..d233e44 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 _0x713d=['isObject','stringify','next','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][SYSTEM]\x20%s','map','message','join','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','info','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x713d,0x16f));var _0xd713=function(_0x2e707c,_0x278fda){_0x2e707c=_0x2e707c-0x0;var _0x59b919=_0x713d[_0x2e707c];return _0x59b919;};'use strict';var schema=require('validate');var sh=require(_0xd713('0x0'));var _=require(_0xd713('0x1'));var utils=require(_0xd713('0x2'));var logger=require(_0xd713('0x3'))(_0xd713('0x4'));var system=schema({'command':{'type':_0xd713('0x5'),'required':!![],'message':_0xd713('0x6')}});exports[_0xd713('0x7')]=function(_0x21d08f,_0x4532a1){return function(_0x314f2a){try{var _0x4fabea={'command':_0x4532a1[0x0]};var _0x5a5f84=system[_0xd713('0x8')](_0x4fabea,{'typecast':!![]});if(_0x5a5f84[_0xd713('0x9')]){logger[_0xd713('0xa')](_0xd713('0xb'),_0x21d08f,_[_0xd713('0xc')](_0x5a5f84,_0xd713('0xd'))[_0xd713('0xe')](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x21d08f);_0x314f2a['next']();}else{var _0x5f4ebc=this;var _0x272f8f=utils[_0xd713('0xf')](_0x4532a1[0x0],this);logger['info'](_0xd713('0x10'),_0x21d08f,_0x272f8f);sh[_0xd713('0x11')](_[_0xd713('0x12')](_0x272f8f),function(_0x5a1a10,_0x5e57f5){logger[_0xd713('0x13')](_0xd713('0x14'),_0x21d08f,_0x5a1a10);if(_0x5a1a10==0x0){var _0x5c8035=_0x5e57f5[_0xd713('0x15')](/(\r\n|\n|\r)/gm,'');if(_[_0xd713('0x16')](_0x4532a1[0x1])||_['isEmpty'](_0x4532a1[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x21d08f);_0x5f4ebc['body'][_0x4532a1[0x1]]=_0x5c8035;}else{logger['info'](_0xd713('0x17'),_0x21d08f,_0x4532a1[0x1],_0x5c8035);_0x5f4ebc[_0xd713('0x18')][_0x4532a1[0x1]]=_0x5c8035;}}_0x314f2a['next']();});}}catch(_0x44801e){logger['error'](_0xd713('0xb'),_0x21d08f,_[_0xd713('0x19')](_0x44801e)?JSON[_0xd713('0x1a')](_0x44801e):_0x44801e);logger[_0xd713('0x13')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x21d08f);_0x314f2a[_0xd713('0x1b')]();}};}; \ No newline at end of file +var _0xa67b=['getMustacheRender','info','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','body','stringify','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','next'];(function(_0x424273,_0x628f19){var _0x3fb77d=function(_0x51c346){while(--_0x51c346){_0x424273['push'](_0x424273['shift']());}};_0x3fb77d(++_0x628f19);}(_0xa67b,0x14a));var _0xba67=function(_0x44fd07,_0x40f3e0){_0x44fd07=_0x44fd07-0x0;var _0x1e6808=_0xa67b[_0x44fd07];return _0x1e6808;};'use strict';var schema=require(_0xba67('0x0'));var sh=require(_0xba67('0x1'));var _=require(_0xba67('0x2'));var utils=require(_0xba67('0x3'));var logger=require(_0xba67('0x4'))(_0xba67('0x5'));var system=schema({'command':{'type':'string','required':!![],'message':_0xba67('0x6')}});exports[_0xba67('0x7')]=function(_0x5be871,_0x227c69){return function(_0x547272){try{var _0x39baa2={'command':_0x227c69[0x0]};var _0x351b19=system[_0xba67('0x0')](_0x39baa2,{'typecast':!![]});if(_0x351b19[_0xba67('0x8')]){logger[_0xba67('0x9')](_0xba67('0xa'),_0x5be871,_[_0xba67('0xb')](_0x351b19,_0xba67('0xc'))[_0xba67('0xd')](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x5be871);_0x547272[_0xba67('0xe')]();}else{var _0xb00962=this;var _0x573ce4=utils[_0xba67('0xf')](_0x227c69[0x0],this);logger[_0xba67('0x10')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x5be871,_0x573ce4);sh['exec'](_[_0xba67('0x11')](_0x573ce4),function(_0x557cc3,_0x1bc7ac){logger[_0xba67('0x10')](_0xba67('0x12'),_0x5be871,_0x557cc3);if(_0x557cc3==0x0){var _0x413af7=_0x1bc7ac[_0xba67('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xba67('0x14')](_0x227c69[0x1])||_['isEmpty'](_0x227c69[0x1])){logger[_0xba67('0x10')]('[%s][SYSTEM]\x20no\x20variable',_0x5be871);_0xb00962[_0xba67('0x15')][_0x227c69[0x1]]=_0x413af7;}else{logger['info']('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x5be871,_0x227c69[0x1],_0x413af7);_0xb00962[_0xba67('0x15')][_0x227c69[0x1]]=_0x413af7;}}_0x547272[_0xba67('0xe')]();});}}catch(_0x529634){logger['error'](_0xba67('0xa'),_0x5be871,_['isObject'](_0x529634)?JSON[_0xba67('0x16')](_0x529634):_0x529634);logger[_0xba67('0x10')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x5be871);_0x547272[_0xba67('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 96c85cf..e0c9eaa 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 _0x65f5=['validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','channel','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','finally','isObject'];(function(_0x57f0b3,_0x2dc826){var _0x1bab34=function(_0x44fc6c){while(--_0x44fc6c){_0x57f0b3['push'](_0x57f0b3['shift']());}};_0x1bab34(++_0x2dc826);}(_0x65f5,0x17a));var _0x565f=function(_0x48c008,_0x157df3){_0x48c008=_0x48c008-0x0;var _0x3138c0=_0x65f5[_0x48c008];return _0x3138c0;};'use strict';var schema=require(_0x565f('0x0'));var _=require(_0x565f('0x1'));var rpc={'chatInteraction':require(_0x565f('0x2')),'openchannelInteraction':require(_0x565f('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x565f('0x4')),'faxInteraction':require(_0x565f('0x5')),'whatsappInteraction':require(_0x565f('0x6'))};var logger=require(_0x565f('0x7'))(_0x565f('0x8'));var tag=schema({'tag':{'type':_0x565f('0x9'),'required':!![],'message':_0x565f('0xa')}});exports[_0x565f('0xb')]=function(_0x342832,_0x1acafe,_0x377e6d,_0x528d37){return function(_0x21d921){try{var _0x346198={'tag':_0x1acafe[0x0]};var _0x113a6f=tag[_0x565f('0x0')](_0x346198,{'typecast':!![]});if(_0x113a6f['length']){logger[_0x565f('0xc')](_0x565f('0xd'),_0x342832,_['map'](_0x113a6f,_0x565f('0xe'))[_0x565f('0xf')](',\x20'));logger[_0x565f('0x10')](_0x565f('0x11'),_0x342832);_0x21d921[_0x565f('0x12')]();}else{var _0x2270f9={'ids':[_0x1acafe[0x0]]};if(rpc[_0x528d37['channel']+_0x565f('0x13')]){rpc[_0x528d37[_0x565f('0x14')]+_0x565f('0x13')][_0x565f('0x15')](_0x528d37[_0x565f('0x16')]['id'],_0x2270f9)['then'](function(_0x2b378f){logger[_0x565f('0x10')](_0x565f('0x17'),_0x342832,_0x1acafe[0x1],_0x528d37[_0x565f('0x14')],_0x528d37[_0x565f('0x16')]['id']);})['catch'](function(_0x47f47d){logger[_0x565f('0xc')]('[%s][TAG]\x20%s',_0x342832,JSON[_0x565f('0x18')](_0x47f47d));logger[_0x565f('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x342832);})[_0x565f('0x19')](function(){_0x21d921[_0x565f('0x12')]();});}}}catch(_0x38e008){logger[_0x565f('0xc')](_0x565f('0xd'),_0x342832,_[_0x565f('0x1a')](_0x38e008)?JSON[_0x565f('0x18')](_0x38e008):_0x38e008);logger['info'](_0x565f('0x11'),_0x342832);_0x21d921[_0x565f('0x12')]();}};}; \ No newline at end of file +var _0xe662=['../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','[%s][TAG]\x20%s','map','message','join','channel','Interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','stringify','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','next','isObject','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction'];(function(_0x3da2cc,_0x90820d){var _0x396973=function(_0x272f86){while(--_0x272f86){_0x3da2cc['push'](_0x3da2cc['shift']());}};_0x396973(++_0x90820d);}(_0xe662,0x1b6));var _0x2e66=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xe662[_0x5b561d];return _0x431060;};'use strict';var schema=require('validate');var _=require(_0x2e66('0x0'));var rpc={'chatInteraction':require(_0x2e66('0x1')),'openchannelInteraction':require(_0x2e66('0x2')),'smsInteraction':require(_0x2e66('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x2e66('0x4')),'whatsappInteraction':require(_0x2e66('0x5'))};var logger=require(_0x2e66('0x6'))(_0x2e66('0x7'));var tag=schema({'tag':{'type':_0x2e66('0x8'),'required':!![],'message':_0x2e66('0x9')}});exports['consequence']=function(_0x2f1e44,_0x3b9d28,_0x20c28f,_0x2abd9e){return function(_0x2235e2){try{var _0x59b5d4={'tag':_0x3b9d28[0x0]};var _0x2a78c8=tag['validate'](_0x59b5d4,{'typecast':!![]});if(_0x2a78c8['length']){logger[_0x2e66('0xa')](_0x2e66('0xb'),_0x2f1e44,_[_0x2e66('0xc')](_0x2a78c8,_0x2e66('0xd'))[_0x2e66('0xe')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x2f1e44);_0x2235e2['next']();}else{var _0x40a12b={'ids':[_0x3b9d28[0x0]]};if(rpc[_0x2abd9e[_0x2e66('0xf')]+_0x2e66('0x10')]){rpc[_0x2abd9e[_0x2e66('0xf')]+'Interaction']['addTags'](_0x2abd9e['interaction']['id'],_0x40a12b)[_0x2e66('0x11')](function(_0x21600e){logger['info'](_0x2e66('0x12'),_0x2f1e44,_0x3b9d28[0x1],_0x2abd9e['channel'],_0x2abd9e[_0x2e66('0x13')]['id']);})['catch'](function(_0x28eca5){logger['error'](_0x2e66('0xb'),_0x2f1e44,JSON[_0x2e66('0x14')](_0x28eca5));logger[_0x2e66('0x15')](_0x2e66('0x16'),_0x2f1e44);})[_0x2e66('0x17')](function(){_0x2235e2[_0x2e66('0x18')]();});}}}catch(_0x50298d){logger['error'](_0x2e66('0xb'),_0x2f1e44,_[_0x2e66('0x19')](_0x50298d)?JSON[_0x2e66('0x14')](_0x50298d):_0x50298d);logger['info'](_0x2e66('0x16'),_0x2f1e44);_0x2235e2['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 6b3094d..d998b50 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 _0x4f4e=['../../../../config/logger','lodash','replace','\x20-\x20','push','urlOnAnswer','?params=','title','jsonrpc','2.0','method','login','POST','then','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','stringify','info','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise'];(function(_0x4ab3fb,_0x776775){var _0x34fe1e=function(_0x1c94c5){while(--_0x1c94c5){_0x4ab3fb['push'](_0x4ab3fb['shift']());}};_0x34fe1e(++_0x776775);}(_0x4f4e,0x1c1));var _0xe4f4=function(_0x34bc6c,_0x10d089){_0x34bc6c=_0x34bc6c-0x0;var _0x168820=_0x4f4e[_0x34bc6c];return _0x168820;};'use strict';var rp=require(_0xe4f4('0x0'));var logger=require(_0xe4f4('0x1'))('routing');var _=require(_0xe4f4('0x2'));var arr=[];exports['consequence']=function(_0x6818be,_0x40cabb){return function(_0x576340){var _0x2b1a3e=_0x40cabb[0xa];var _0x29ca25=_0x40cabb[0xb];var _0xbb47cd=_0x40cabb[0xc];var _0x288d51=_0x40cabb[0xd];var _0x2ec52d=_0x40cabb[0xe];var _0x356afc=_0x40cabb[0xf][_0xe4f4('0x3')](/\n/g,_0xe4f4('0x4'));var _0x41f278=_0x40cabb[0x10][_0xe4f4('0x3')](/\n/g,'\x20');if(!arr['includes'](_0x29ca25)){arr[_0xe4f4('0x5')](_0x29ca25);var _0x19bd8e=_0x40cabb[0x3];var _0x4ed970=_0x40cabb[0x4];var _0x35c656=_0x40cabb[0x1];var _0x5c5eb0=_0x40cabb[0x0];var _0x230df4={};_0x230df4[_0xe4f4('0x6')]=_0x40cabb[0x8]+'?params='+_0xbb47cd+'|'+_0x2b1a3e+'|'+_0x288d51+'|'+_0x29ca25+'|'+_0x2ec52d;_0x230df4['urlOnRing']=_0x40cabb[0x7]+_0xe4f4('0x7')+_0xbb47cd+'|'+_0x2b1a3e+'|'+_0x288d51+'|'+_0x29ca25+'|'+_0x2ec52d+'|'+_0x356afc+'|'+_0x41f278;_0x230df4[_0xe4f4('0x8')]=_0x40cabb[0x9];var _0x1e1cc7={};_0x1e1cc7[_0xe4f4('0x9')]=_0xe4f4('0xa');_0x1e1cc7[_0xe4f4('0xb')]=_0xe4f4('0xc');var _0x2433c5=[];_0x2433c5[_0xe4f4('0x5')](_0x40cabb[0x2]);_0x2433c5['push'](_0x40cabb[0x5]);_0x2433c5[_0xe4f4('0x5')](_0x40cabb[0x6]);_0x1e1cc7['params']=_0x2433c5;_0x1e1cc7['id']=0x1;var _0x13f03c=JSON['stringify'](_0x1e1cc7);var _0x63d638={'encoding':'utf8','method':_0xe4f4('0xd'),'timeout':0x2710,'url':_0x19bd8e,'headers':{'Content-Type':'application/json-rpc'},'body':_0x13f03c};return rp(_0x63d638)[_0xe4f4('0xe')](function(_0x217999){const _0x56f409=JSON[_0xe4f4('0xf')](_0x217999);if(!_0x56f409['result'][_0xe4f4('0x10')]){throw new Error(_0xe4f4('0x11'));}var _0x3cf3b4=_0x29ca25;var _0x4a6a65=_0xe4f4('0x12')+_0x35c656+_0xe4f4('0x13')+_0x5c5eb0+_0xe4f4('0x14')+_0x3cf3b4+'&data='+JSON[_0xe4f4('0x15')](_0x230df4);var _0x4f5645=_0x4ed970+'?'+_0x4a6a65;return rp(_0x4f5645);})['then'](function(_0x51c26e){logger[_0xe4f4('0x16')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x6818be,_0x51c26e);_0x576340[_0xe4f4('0x17')]();})[_0xe4f4('0x18')](function(_0x4c15cd){logger[_0xe4f4('0x19')](_0xe4f4('0x1a'),_0x6818be,_[_0xe4f4('0x1b')](_0x4c15cd)?JSON['stringify'](_0x4c15cd):_0x4c15cd);_0x576340[_0xe4f4('0x17')]();});}else{logger[_0xe4f4('0x16')](_0xe4f4('0x1c'),_0x6818be);_0x576340[_0xe4f4('0x1d')]();}};}; \ No newline at end of file +var _0xd123=['stop','error','[%s][TVOX]\x20%s','isObject','stringify','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','urlOnAnswer','?params=','urlOnRing','2.0','method','login','push','params','utf8','POST','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s'];(function(_0x2a46b2,_0x43ff46){var _0x53ae15=function(_0x54e167){while(--_0x54e167){_0x2a46b2['push'](_0x2a46b2['shift']());}};_0x53ae15(++_0x43ff46);}(_0xd123,0x13c));var _0x3d12=function(_0x420f2a,_0x2cc58d){_0x420f2a=_0x420f2a-0x0;var _0x28f802=_0xd123[_0x420f2a];return _0x28f802;};'use strict';var rp=require(_0x3d12('0x0'));var logger=require(_0x3d12('0x1'))(_0x3d12('0x2'));var _=require(_0x3d12('0x3'));var arr=[];exports[_0x3d12('0x4')]=function(_0x194950,_0x1fc5de){return function(_0x1db6f6){var _0x5a6ab4=_0x1fc5de[0xa];var _0x3592ce=_0x1fc5de[0xb];var _0x3535c7=_0x1fc5de[0xc];var _0x2e4f6c=_0x1fc5de[0xd];var _0x5c3c13=_0x1fc5de[0xe];var _0x120d3b=_0x1fc5de[0xf][_0x3d12('0x5')](/\n/g,'\x20-\x20');var _0x4291db=_0x1fc5de[0x10][_0x3d12('0x5')](/\n/g,'\x20');if(!arr['includes'](_0x3592ce)){arr['push'](_0x3592ce);var _0x298da7=_0x1fc5de[0x3];var _0x5c69f6=_0x1fc5de[0x4];var _0x199a4f=_0x1fc5de[0x1];var _0x4ea79f=_0x1fc5de[0x0];var _0x3569ed={};_0x3569ed[_0x3d12('0x6')]=_0x1fc5de[0x8]+_0x3d12('0x7')+_0x3535c7+'|'+_0x5a6ab4+'|'+_0x2e4f6c+'|'+_0x3592ce+'|'+_0x5c3c13;_0x3569ed[_0x3d12('0x8')]=_0x1fc5de[0x7]+_0x3d12('0x7')+_0x3535c7+'|'+_0x5a6ab4+'|'+_0x2e4f6c+'|'+_0x3592ce+'|'+_0x5c3c13+'|'+_0x120d3b+'|'+_0x4291db;_0x3569ed['title']=_0x1fc5de[0x9];var _0x336a03={};_0x336a03['jsonrpc']=_0x3d12('0x9');_0x336a03[_0x3d12('0xa')]=_0x3d12('0xb');var _0x3b4359=[];_0x3b4359[_0x3d12('0xc')](_0x1fc5de[0x2]);_0x3b4359[_0x3d12('0xc')](_0x1fc5de[0x5]);_0x3b4359[_0x3d12('0xc')](_0x1fc5de[0x6]);_0x336a03[_0x3d12('0xd')]=_0x3b4359;_0x336a03['id']=0x1;var _0x44e6ad=JSON['stringify'](_0x336a03);var _0x59afb3={'encoding':_0x3d12('0xe'),'method':_0x3d12('0xf'),'timeout':0x2710,'url':_0x298da7,'headers':{'Content-Type':_0x3d12('0x10')},'body':_0x44e6ad};return rp(_0x59afb3)[_0x3d12('0x11')](function(_0x27daa9){const _0x1a8007=JSON[_0x3d12('0x12')](_0x27daa9);if(!_0x1a8007[_0x3d12('0x13')][_0x3d12('0x14')]){throw new Error(_0x3d12('0x15'));}var _0x160638=_0x3592ce;var _0x4e6215='channelId='+_0x199a4f+_0x3d12('0x16')+_0x4ea79f+'&sessionId='+_0x160638+'&data='+JSON['stringify'](_0x3569ed);var _0xd9da53=_0x5c69f6+'?'+_0x4e6215;return rp(_0xd9da53);})[_0x3d12('0x11')](function(_0x303c60){logger[_0x3d12('0x17')](_0x3d12('0x18'),_0x194950,_0x303c60);_0x1db6f6[_0x3d12('0x19')]();})['catch'](function(_0x3e8c8e){logger[_0x3d12('0x1a')](_0x3d12('0x1b'),_0x194950,_[_0x3d12('0x1c')](_0x3e8c8e)?JSON[_0x3d12('0x1d')](_0x3e8c8e):_0x3e8c8e);_0x1db6f6[_0x3d12('0x19')]();});}else{logger[_0x3d12('0x17')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x194950);_0x1db6f6[_0x3d12('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 6cbd2df..8df8894 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 _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x11fd46,_0x3d8c3f){var _0x4c0f45=function(_0x54c50c){while(--_0x54c50c){_0x11fd46['push'](_0x11fd46['shift']());}};_0x4c0f45(++_0x3d8c3f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x300b6b,_0x24fd66){var _0x25a363=function(_0x4fb7b3){while(--_0x4fb7b3){_0x300b6b['push'](_0x300b6b['shift']());}};_0x25a363(++_0x24fd66);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 125803c..d640f35 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 _0xb17c=['map','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','applications','isArray','length','existsSync','app','.js','toLowerCase','appdata','push','slice','join','dialogflow','split','dialogflowv2','amazonlex','getMustacheRender','account','notificationTemplate','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','stack','error','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals'];(function(_0x3f058f,_0x99337b){var _0x4d8522=function(_0x12017f){while(--_0x12017f){_0x3f058f['push'](_0x3f058f['shift']());}};_0x4d8522(++_0x99337b);}(_0xb17c,0x18b));var _0xcb17=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xb17c[_0x17928f];return _0x500b63;};'use strict';var _=require(_0xcb17('0x0'));var util=require(_0xcb17('0x1'));var path=require(_0xcb17('0x2'));var fs=require('fs');var jayson=require(_0xcb17('0x3'));var BPromise=require('bluebird');var utils=require('./applications/utils');var sUtils=require(_0xcb17('0x4'));var logger=require(_0xcb17('0x5'))(_0xcb17('0x6'));var rpc={'openchannelQueueReport':require(_0xcb17('0x7')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xcb17('0x8')),'smsQueueReport':require(_0xcb17('0x9')),'faxQueueReport':require(_0xcb17('0xa')),'whatsappQueueReport':require(_0xcb17('0xb'))};var RuleEngine=require(_0xcb17('0xc'));function getId(_0x1251a1,_0x586212,_0x4788ae){return util[_0xcb17('0xd')]('%s.%s.%s',_0x1251a1,_0x586212||0x0,_0x4788ae||0x0);}function getIntervals(_0x49bca4,_0x4e4fba){var _0x4e8427=[];if(!_[_0xcb17('0xe')](_0x4e4fba['IntervalId'])&&!_['isNil'](_0x49bca4[_0x4e4fba[_0xcb17('0xf')]])&&!_[_0xcb17('0xe')](_0x49bca4[_0x4e4fba['IntervalId']][_0xcb17('0x10')])){_0x4e8427=_[_0xcb17('0x11')](_0x49bca4[_0x4e4fba[_0xcb17('0xf')]][_0xcb17('0x10')],_0xcb17('0x12'));}else if(!_[_0xcb17('0xe')](_0x4e4fba['interval'])){_0x4e8427=[_0x4e4fba[_0xcb17('0x12')]];}return _0x4e8427;}exports[_0xcb17('0x13')]=function(_0x41cf9a){_0x41cf9a[_0xcb17('0x14')]={};return new BPromise(function(_0x5b50b0,_0xe8f3df){var _0x3761e1={'Start':function(_0x5d1ea5){var _0xed101c=this;return new Promise(function(_0x24707b,_0x11f6d1){if(_0x5d1ea5){try{var _0x5f1054=[];var _0x450eda=getId(_0x5d1ea5[_0xcb17('0x15')],_0x5d1ea5[_0xcb17('0x16')]?_0x5d1ea5[_0xcb17('0x16')]['id']:0x0,_0x5d1ea5[_0xcb17('0x17')]?_0x5d1ea5['interaction']['id']:0x0);var _0x4a033f=sUtils[_0xcb17('0x18')](_0x41cf9a,_0x5d1ea5);if(!_0x4a033f&&_0x5d1ea5[_0xcb17('0x19')]&&_[_0xcb17('0x1a')](_0x5d1ea5[_0xcb17('0x19')])&&_0x5d1ea5[_0xcb17('0x19')][_0xcb17('0x1b')]){for(var _0x2d2d6d=0x0;_0x2d2d6d<_0x5d1ea5['applications'][_0xcb17('0x1b')];_0x2d2d6d+=0x1){var _0x24c1ab=_0x5d1ea5['applications'][_0x2d2d6d];if(fs[_0xcb17('0x1c')](path['join'](__dirname,_0xcb17('0x19'),_0x24c1ab[_0xcb17('0x1d')]+_0xcb17('0x1e')))){var _0x59263d=[];switch(_0x24c1ab['app'][_0xcb17('0x1f')]()){case'autoreply':var _0x29d80f=_0x24c1ab[_0xcb17('0x20')]['split'](',');if(_0x5d1ea5['channel']==='mail'){_0x59263d['push'](_0x29d80f[0x0]);_0x59263d[_0xcb17('0x21')](_0x29d80f[0x1]);_0x59263d[_0xcb17('0x21')](_0x29d80f[_0xcb17('0x22')](0x2,_0x29d80f[_0xcb17('0x1b')])[_0xcb17('0x23')](','));}else{_0x59263d[_0xcb17('0x21')](_0x29d80f[0x0]);_0x59263d[_0xcb17('0x21')](_0x29d80f[_0xcb17('0x22')](0x1,_0x29d80f['length'])[_0xcb17('0x23')](','));}break;case _0xcb17('0x24'):var _0x572f7b=_0x24c1ab[_0xcb17('0x20')][_0xcb17('0x25')](',');_0x59263d['push'](_0x572f7b[0x0]);_0x59263d[_0xcb17('0x21')](_0x572f7b[0x1]);_0x59263d['push'](_0x572f7b[_0xcb17('0x22')](0x2,_0x572f7b[_0xcb17('0x1b')])['join'](','));break;case _0xcb17('0x26'):var _0x13030a=_0x24c1ab[_0xcb17('0x20')][_0xcb17('0x25')](',');_0x59263d[_0xcb17('0x21')](_0x13030a[0x0]);_0x59263d[_0xcb17('0x21')](_0x13030a[0x1]);_0x59263d[_0xcb17('0x21')](_0x13030a[0x2]);_0x59263d[_0xcb17('0x21')](_0x13030a[0x3]);_0x59263d[_0xcb17('0x21')](_0x13030a['slice'](0x4,_0x13030a['length'])['join'](','));break;case _0xcb17('0x27'):var _0x4e6da1=_0x24c1ab[_0xcb17('0x20')][_0xcb17('0x25')](',');_0x59263d[_0xcb17('0x21')](_0x4e6da1[0x0]);_0x59263d[_0xcb17('0x21')](_0x4e6da1[0x1]);_0x59263d[_0xcb17('0x21')](_0x4e6da1[0x2]);_0x59263d['push'](_0x4e6da1[0x3]);_0x59263d[_0xcb17('0x21')](_0x4e6da1['slice'](0x4,_0x4e6da1[_0xcb17('0x1b')])[_0xcb17('0x23')](','));break;case _0xcb17('0x16'):_0x59263d[_0xcb17('0x21')](_0x24c1ab[_0xcb17('0x20')]);break;case'tag':_0x59263d[_0xcb17('0x21')](_0x24c1ab['TagId']);_0x59263d[_0xcb17('0x21')](_0x24c1ab[_0xcb17('0x20')]);break;case'tvox':var _0x97931b=utils[_0xcb17('0x28')](_0x5d1ea5[_0xcb17('0x29')][_0xcb17('0x2a')],_0x5d1ea5);var _0x354c8a=_0x24c1ab[_0xcb17('0x20')]['split'](',');_0x59263d[_0xcb17('0x21')](_0x354c8a[0x0]);_0x59263d[_0xcb17('0x21')](_0x354c8a[0x1]);_0x59263d[_0xcb17('0x21')](_0x354c8a[0x2]);_0x59263d['push'](_0x354c8a[0x3]);_0x59263d[_0xcb17('0x21')](_0x354c8a[0x4]);_0x59263d[_0xcb17('0x21')](_0x354c8a[0x5]);_0x59263d[_0xcb17('0x21')](_0x354c8a[0x6]);_0x59263d['push'](_0x354c8a[0x7]);_0x59263d['push'](_0x354c8a[0x8]);_0x59263d[_0xcb17('0x21')](_0x354c8a[0x9]);_0x59263d[_0xcb17('0x21')](_0x354c8a[0xa]);_0x59263d[_0xcb17('0x21')](_0x5d1ea5[_0xcb17('0x17')]['id']);_0x59263d[_0xcb17('0x21')](_0x5d1ea5[_0xcb17('0x16')]['id']);_0x59263d[_0xcb17('0x21')](_0x24c1ab['ChatWebsiteId']);_0x59263d[_0xcb17('0x21')](_0x5d1ea5[_0xcb17('0x17')][_0xcb17('0x2b')]);_0x59263d[_0xcb17('0x21')](_0x5d1ea5[_0xcb17('0x2c')][_0xcb17('0x2c')]);_0x59263d[_0xcb17('0x21')](_0x97931b);break;default:_0x59263d=_[_0xcb17('0xe')](_0x24c1ab[_0xcb17('0x20')])?[]:_0x24c1ab[_0xcb17('0x20')]['split'](',');}var _0x383771={'id':util['format'](_0xcb17('0x2d'),_0x450eda,_0x24c1ab['id'],_0x24c1ab[_0xcb17('0x1d')]),'condition':require(_0xcb17('0x2e'))[_0xcb17('0x2f')](_0x450eda,getIntervals(_0x41cf9a[_0xcb17('0x30')],_0x24c1ab),_0x41cf9a),'consequence':require(_0xcb17('0x31')+_0x24c1ab[_0xcb17('0x1d')])[_0xcb17('0x32')](_0x450eda,_0x59263d,_0x41cf9a,_0x5d1ea5),'p':_0x24c1ab[_0xcb17('0x33')]||0x0};logger[_0xcb17('0x34')](_0xcb17('0x35'),_0x383771['id'],_0xcb17('0x36'),getIntervals(_0x41cf9a['intervals'],_0x24c1ab)[_0xcb17('0x23')](_0xcb17('0x37')));_0x5f1054[_0xcb17('0x21')](_0x383771);}else{logger['error'](_0xcb17('0x38'),path[_0xcb17('0x23')](__dirname,_0xcb17('0x19'),_0x24c1ab[_0xcb17('0x1d')]+_0xcb17('0x1e')));}}_0x41cf9a[_0xcb17('0x14')][_0x450eda]=new RuleEngine(_0x5f1054);_0x41cf9a['rules'][_0x450eda]['execute'](_0x5d1ea5,function(_0x2ee448){logger['info']('Applications\x20executed',JSON[_0xcb17('0x39')](_0x2ee448[_0xcb17('0x3a')]));if(_0x41cf9a[_0xcb17('0x14')][_0x450eda]){_0x41cf9a['rules'][_0x450eda][_0xcb17('0x3b')](_0xcb17('0x3c'));}});return _0x24707b({'code':0xc8,'message':_0x5d1ea5});}else{if(_0x4a033f){logger['info'](util[_0xcb17('0xd')](_0xcb17('0x3d'),_0x450eda));}else{logger[_0xcb17('0x34')]('No\x20applications\x20to\x20execute');}return _0x24707b({'code':0xc8,'message':_0x5d1ea5});}}catch(_0x55419a){logger['error'](_0x55419a[_0xcb17('0x3e')]);return _0x11f6d1(_0xed101c[_0xcb17('0x3f')](0x1f4,_0x55419a));}}return _0x11f6d1(_0xcb17('0x40'));});},'AcceptMessage':function(_0x80ca27){var _0x39a39f=this;return new Promise(function(_0x147872,_0x67f9d1){if(_0x80ca27[_0xcb17('0x41')]&&_0x80ca27[_0xcb17('0x41')]['id']){if(_0x41cf9a[_0xcb17('0x42')][_0x80ca27[_0xcb17('0x41')]['id']]){_0x41cf9a[_0xcb17('0x42')][_0x80ca27[_0xcb17('0x41')]['id']]['busy']=![];_0x41cf9a[_0xcb17('0x42')][_0x80ca27['agent']['id']][_0xcb17('0x43')]=undefined;}}if(_0x80ca27[_0xcb17('0x16')]&&_0x80ca27[_0xcb17('0x16')]['id']){try{var _0xafd617=getId(_0x80ca27[_0xcb17('0x15')],_0x80ca27[_0xcb17('0x16')]?_0x80ca27[_0xcb17('0x16')]['id']:0x0,_0x80ca27[_0xcb17('0x17')]?_0x80ca27['interaction']['id']:0x0);if(_0x41cf9a[_0xcb17('0x14')][_0xafd617]){_0x41cf9a[_0xcb17('0x14')][_0xafd617]['emit'](_0xcb17('0x44'));if(rpc[_0x80ca27[_0xcb17('0x15')]+'QueueReport']){rpc[_0x80ca27['channel']+_0xcb17('0x45')]['update'](_0xafd617,{'UserId':_0x80ca27['message'][_0xcb17('0x46')]})['catch'](function(){logger[_0xcb17('0x3f')](_0xcb17('0x47'));});}}return _0x147872({'code':0xc8,'message':_0x80ca27});}catch(_0x4b5d55){logger[_0xcb17('0x3f')](_0x4b5d55[_0xcb17('0x3e')]);return _0x67f9d1(_0x39a39f[_0xcb17('0x3f')](0x1f4,_0x4b5d55));}}logger[_0xcb17('0x3f')]('message\x20is\x20empty');return _0x67f9d1(_0x39a39f[_0xcb17('0x3f')](0x1f4,_0xcb17('0x48')));});},'RejectMessage':function(_0x288503){var _0x512f81=this;return new Promise(function(_0x5d87b5,_0x4da463){if(_0x288503[_0xcb17('0x41')]&&_0x288503['agent']['id']){try{if(_0x41cf9a[_0xcb17('0x42')][_0x288503[_0xcb17('0x41')]['id']]){_0x41cf9a[_0xcb17('0x42')][_0x288503['agent']['id']][_0xcb17('0x49')]=![];_0x41cf9a[_0xcb17('0x42')][_0x288503[_0xcb17('0x41')]['id']][_0xcb17('0x43')]=undefined;}return _0x5d87b5({'code':0xc8,'message':_0x288503});}catch(_0x99ca64){logger['error'](_0x99ca64[_0xcb17('0x3e')]);return _0x4da463(_0x512f81['error'](0x1f4,_0x99ca64));}}logger[_0xcb17('0x3f')]('message\x20is\x20empty');return _0x4da463(_0x512f81['error'](0x1f4,_0xcb17('0x48')));});},'AbandonInteraction':function(_0x87c347){var _0x3aa95f=this;return new Promise(function(_0x2cf885,_0x8345a9){if(_0x87c347[_0xcb17('0x15')]&&_0x87c347[_0xcb17('0x17')]&&_0x87c347[_0xcb17('0x17')]['id']){try{var _0x41ebfd=getId(_0x87c347[_0xcb17('0x15')],_0x87c347[_0xcb17('0x16')]?_0x87c347['message']['id']:0x0,_0x87c347[_0xcb17('0x17')]?_0x87c347[_0xcb17('0x17')]['id']:0x0);if(_0x41cf9a[_0xcb17('0x14')][_0x41ebfd]){_0x41cf9a['rules'][_0x41ebfd][_0xcb17('0x3b')](_0xcb17('0x44'));}return _0x2cf885({'code':0xc8,'message':_0x87c347});}catch(_0x57a193){logger[_0xcb17('0x3f')](_0x57a193[_0xcb17('0x3e')]);return _0x8345a9(_0x3aa95f[_0xcb17('0x3f')](0x1f4,_0x57a193));}}logger[_0xcb17('0x3f')](_0xcb17('0x48'));return _0x8345a9(_0x3aa95f[_0xcb17('0x3f')](0x1f4,_0xcb17('0x48')));});},'AgentCapacity':function(_0x489e30){var _0x2986b5=this;return new Promise(function(_0x3d0ac3,_0x5ac9e7){if(_0x41cf9a[_0xcb17('0x42')][_0xcb17('0x4a')](_0x489e30['id'])){for(var _0x94813 in _0x489e30['capacity']){if(_0x489e30[_0xcb17('0x4b')][_0xcb17('0x4a')](_0x94813)){if(_0x41cf9a['agents'][_0x489e30['id']][_0xcb17('0x4a')](_0x94813+_0xcb17('0x4c'))){_0x41cf9a['agents'][_0x489e30['id']][_0x94813+'CurrentCapacity']=parseInt(_0x489e30[_0xcb17('0x4b')][_0x94813],0xa);}}}_0x41cf9a[_0xcb17('0x42')][_0x489e30['id']][_0xcb17('0x4d')]();return _0x3d0ac3({'code':0xc8,'message':_0x41cf9a[_0xcb17('0x42')][_0x489e30['id']]});}else{return _0x5ac9e7(_0x2986b5[_0xcb17('0x3f')](0x1f4,_0xcb17('0x4e')));}});},'Agents':function(_0x513cbd){return new Promise(function(_0x4ef2ae){var _0x4455a6=_[_0xcb17('0x4f')](_0x41cf9a[_0xcb17('0x42')]);if(_0x513cbd&&_0x513cbd['id']){var _0x5b4bb1=_[_0xcb17('0x50')](_0x4455a6,function(_0x5617df){return _0x5617df['id']===_0x513cbd['id'];});_0x4ef2ae(_0x5b4bb1);}else{_0x4ef2ae({'count':_0x4455a6[_0xcb17('0x1b')],'rows':_0x4455a6});}});},'ChatQueues':function(){return new Promise(function(_0x366731){var _0x2a0153=[];for(var _0x39d4bd in _0x41cf9a[_0xcb17('0x51')]){if(_0x41cf9a[_0xcb17('0x51')][_0xcb17('0x4a')](_0x39d4bd)){var _0xf1fd8b=_0x41cf9a[_0xcb17('0x51')][_0x39d4bd];var _0x513bb3={'id':_0xf1fd8b['id'],'available':_0xf1fd8b['available'],'loggedIn':_0xf1fd8b[_0xcb17('0x52')],'name':_0xf1fd8b[_0xcb17('0x53')],'paused':_0xf1fd8b[_0xcb17('0x54')],'waiting':_0xf1fd8b[_0xcb17('0x55')]};_0x2a0153['push'](_0x513bb3);}}_0x366731({'count':_0x2a0153[_0xcb17('0x1b')],'rows':_0x2a0153});});},'MailQueues':function(){return new Promise(function(_0x289afb){var _0x51e856=[];for(var _0x5be92a in _0x41cf9a[_0xcb17('0x56')]){if(_0x41cf9a[_0xcb17('0x56')][_0xcb17('0x4a')](_0x5be92a)){var _0x2b910c=_0x41cf9a[_0xcb17('0x56')][_0x5be92a];var _0x3c54c5={'id':_0x2b910c['id'],'available':_0x2b910c[_0xcb17('0x57')],'loggedIn':_0x2b910c[_0xcb17('0x52')],'name':_0x2b910c['name'],'paused':_0x2b910c[_0xcb17('0x54')],'waiting':_0x2b910c[_0xcb17('0x55')]};_0x51e856[_0xcb17('0x21')](_0x3c54c5);}}_0x289afb({'count':_0x51e856[_0xcb17('0x1b')],'rows':_0x51e856});});},'OpenchannelQueues':function(){return new Promise(function(_0x312dcb){var _0x35a64d=[];for(var _0x9b306a in _0x41cf9a[_0xcb17('0x58')]){if(_0x41cf9a[_0xcb17('0x58')][_0xcb17('0x4a')](_0x9b306a)){var _0x484ce9=_0x41cf9a[_0xcb17('0x58')][_0x9b306a];var _0x532a66={'id':_0x484ce9['id'],'available':_0x484ce9[_0xcb17('0x57')],'loggedIn':_0x484ce9[_0xcb17('0x52')],'name':_0x484ce9['name'],'paused':_0x484ce9[_0xcb17('0x54')],'waiting':_0x484ce9[_0xcb17('0x55')]};_0x35a64d[_0xcb17('0x21')](_0x532a66);}}_0x312dcb({'count':_0x35a64d[_0xcb17('0x1b')],'rows':_0x35a64d});});},'SmsQueues':function(){return new Promise(function(_0x1d4ceb){var _0x448021=[];for(var _0x3f1d78 in _0x41cf9a['smsQueues']){if(_0x41cf9a[_0xcb17('0x59')][_0xcb17('0x4a')](_0x3f1d78)){var _0x1c4891=_0x41cf9a[_0xcb17('0x59')][_0x3f1d78];var _0xed985={'id':_0x1c4891['id'],'available':_0x1c4891[_0xcb17('0x57')],'loggedIn':_0x1c4891[_0xcb17('0x52')],'name':_0x1c4891['name'],'paused':_0x1c4891[_0xcb17('0x54')],'waiting':_0x1c4891['waiting']};_0x448021[_0xcb17('0x21')](_0xed985);}}_0x1d4ceb({'count':_0x448021[_0xcb17('0x1b')],'rows':_0x448021});});},'FaxQueues':function(){return new Promise(function(_0x36fe31){var _0x20546e=[];for(var _0x368647 in _0x41cf9a[_0xcb17('0x5a')]){if(_0x41cf9a[_0xcb17('0x5a')][_0xcb17('0x4a')](_0x368647)){var _0x125aca=_0x41cf9a[_0xcb17('0x5a')][_0x368647];var _0x353fc8={'id':_0x125aca['id'],'available':_0x125aca['available'],'loggedIn':_0x125aca[_0xcb17('0x52')],'name':_0x125aca[_0xcb17('0x53')],'paused':_0x125aca[_0xcb17('0x54')],'waiting':_0x125aca[_0xcb17('0x55')]};_0x20546e[_0xcb17('0x21')](_0x353fc8);}}_0x36fe31({'count':_0x20546e['length'],'rows':_0x20546e});});},'WhatsappQueues':function(){return new Promise(function(_0x521e41){var _0x411aa8=[];for(var _0x338e86 in _0x41cf9a[_0xcb17('0x5b')]){if(_0x41cf9a['whatsappQueues'][_0xcb17('0x4a')](_0x338e86)){var _0x3bbcc6=_0x41cf9a[_0xcb17('0x5b')][_0x338e86];var _0x3d9584={'id':_0x3bbcc6['id'],'available':_0x3bbcc6[_0xcb17('0x57')],'loggedIn':_0x3bbcc6[_0xcb17('0x52')],'name':_0x3bbcc6[_0xcb17('0x53')],'paused':_0x3bbcc6[_0xcb17('0x54')],'waiting':_0x3bbcc6[_0xcb17('0x55')]};_0x411aa8[_0xcb17('0x21')](_0x3d9584);}}_0x521e41({'count':_0x411aa8[_0xcb17('0x1b')],'rows':_0x411aa8});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x266470){var _0x5745f4=_[_0xcb17('0x4f')](_0x41cf9a[_0xcb17('0x5c')]);_0x266470({'count':_0x5745f4[_0xcb17('0x1b')],'rows':_0x5745f4});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x2fefbd){var _0x3eeb2a=_[_0xcb17('0x4f')](_0x41cf9a[_0xcb17('0x5d')]);_0x2fefbd({'count':_0x3eeb2a[_0xcb17('0x1b')],'rows':_0x3eeb2a});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x2c0af3){var _0x42143e=_[_0xcb17('0x4f')](_0x41cf9a[_0xcb17('0x5e')]);_0x2c0af3({'count':_0x42143e['length'],'rows':_0x42143e});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x52bd43){var _0x230045=_[_0xcb17('0x4f')](_0x41cf9a[_0xcb17('0x5f')]);_0x52bd43({'count':_0x230045['length'],'rows':_0x230045});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x1f66e3){var _0x5ebbe1=_['values'](_0x41cf9a[_0xcb17('0x60')]);_0x1f66e3({'count':_0x5ebbe1['length'],'rows':_0x5ebbe1});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x4815ce){var _0x449ab8=_[_0xcb17('0x4f')](_0x41cf9a[_0xcb17('0x61')]);_0x4815ce({'count':_0x449ab8['length'],'rows':_0x449ab8});});}};var _0x8d4154=jayson[_0xcb17('0x62')](_0x3761e1)[_0xcb17('0x63')]();_0x8d4154['on']('error',function(_0x24db00){logger[_0xcb17('0x3f')](JSON['stringify'](_0x24db00));return _0xe8f3df(_0x24db00);});_0x8d4154['listen'](0x232c,_0xcb17('0x64'),function(){console['log'](_0xcb17('0x65'),0x232c);return _0x5b50b0(_0xcb17('0x66')+0x232c);});});}; \ No newline at end of file +var _0x1aa7=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','bluebird','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','app','.js','toLowerCase','autoreply','appdata','mail','push','join','split','slice','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','error','routing\x20is\x20empty','agent','agents','busy','end','QueueReport','update','UserId','stack','busyQueue','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues'];(function(_0x2945bb,_0x236487){var _0x23707e=function(_0x767c7e){while(--_0x767c7e){_0x2945bb['push'](_0x2945bb['shift']());}};_0x23707e(++_0x236487);}(_0x1aa7,0x1a9));var _0x71aa=function(_0x124247,_0x117bc8){_0x124247=_0x124247-0x0;var _0x451e63=_0x1aa7[_0x124247];return _0x451e63;};'use strict';var _=require(_0x71aa('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x71aa('0x1'));var utils=require('./applications/utils');var sUtils=require(_0x71aa('0x2'));var logger=require(_0x71aa('0x3'))(_0x71aa('0x4'));var rpc={'openchannelQueueReport':require(_0x71aa('0x5')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x71aa('0x6')),'smsQueueReport':require(_0x71aa('0x7')),'faxQueueReport':require(_0x71aa('0x8')),'whatsappQueueReport':require(_0x71aa('0x9'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x2773b1,_0x34cac7,_0x4deee4){return util[_0x71aa('0xa')]('%s.%s.%s',_0x2773b1,_0x34cac7||0x0,_0x4deee4||0x0);}function getIntervals(_0x31f3c0,_0x4c6a58){var _0x5a527a=[];if(!_[_0x71aa('0xb')](_0x4c6a58['IntervalId'])&&!_['isNil'](_0x31f3c0[_0x4c6a58['IntervalId']])&&!_['isNil'](_0x31f3c0[_0x4c6a58[_0x71aa('0xc')]][_0x71aa('0xd')])){_0x5a527a=_['map'](_0x31f3c0[_0x4c6a58['IntervalId']][_0x71aa('0xd')],_0x71aa('0xe'));}else if(!_[_0x71aa('0xb')](_0x4c6a58[_0x71aa('0xe')])){_0x5a527a=[_0x4c6a58['interval']];}return _0x5a527a;}exports[_0x71aa('0xf')]=function(_0x135c20){_0x135c20[_0x71aa('0x10')]={};return new BPromise(function(_0x2744a4,_0x152873){var _0x357fdc={'Start':function(_0x557d94){var _0x56af93=this;return new Promise(function(_0x3751ca,_0x2bda8e){if(_0x557d94){try{var _0x1da4e7=[];var _0x405ca1=getId(_0x557d94[_0x71aa('0x11')],_0x557d94[_0x71aa('0x12')]?_0x557d94[_0x71aa('0x12')]['id']:0x0,_0x557d94[_0x71aa('0x13')]?_0x557d94[_0x71aa('0x13')]['id']:0x0);var _0x36417e=sUtils['checkWaitingNotifications'](_0x135c20,_0x557d94);if(!_0x36417e&&_0x557d94[_0x71aa('0x14')]&&_[_0x71aa('0x15')](_0x557d94[_0x71aa('0x14')])&&_0x557d94[_0x71aa('0x14')][_0x71aa('0x16')]){for(var _0x5809e8=0x0;_0x5809e8<_0x557d94[_0x71aa('0x14')]['length'];_0x5809e8+=0x1){var _0x523bbf=_0x557d94['applications'][_0x5809e8];if(fs[_0x71aa('0x17')](path['join'](__dirname,'applications',_0x523bbf[_0x71aa('0x18')]+_0x71aa('0x19')))){var _0x3baa6d=[];switch(_0x523bbf[_0x71aa('0x18')][_0x71aa('0x1a')]()){case _0x71aa('0x1b'):var _0x5c9170=_0x523bbf[_0x71aa('0x1c')]['split'](',');if(_0x557d94[_0x71aa('0x11')]===_0x71aa('0x1d')){_0x3baa6d[_0x71aa('0x1e')](_0x5c9170[0x0]);_0x3baa6d[_0x71aa('0x1e')](_0x5c9170[0x1]);_0x3baa6d[_0x71aa('0x1e')](_0x5c9170['slice'](0x2,_0x5c9170['length'])[_0x71aa('0x1f')](','));}else{_0x3baa6d[_0x71aa('0x1e')](_0x5c9170[0x0]);_0x3baa6d[_0x71aa('0x1e')](_0x5c9170['slice'](0x1,_0x5c9170[_0x71aa('0x16')])[_0x71aa('0x1f')](','));}break;case'dialogflow':var _0x1244f9=_0x523bbf['appdata'][_0x71aa('0x20')](',');_0x3baa6d[_0x71aa('0x1e')](_0x1244f9[0x0]);_0x3baa6d['push'](_0x1244f9[0x1]);_0x3baa6d[_0x71aa('0x1e')](_0x1244f9[_0x71aa('0x21')](0x2,_0x1244f9[_0x71aa('0x16')])['join'](','));break;case _0x71aa('0x22'):var _0x52d2a8=_0x523bbf[_0x71aa('0x1c')]['split'](',');_0x3baa6d[_0x71aa('0x1e')](_0x52d2a8[0x0]);_0x3baa6d[_0x71aa('0x1e')](_0x52d2a8[0x1]);_0x3baa6d[_0x71aa('0x1e')](_0x52d2a8[0x2]);_0x3baa6d[_0x71aa('0x1e')](_0x52d2a8[0x3]);_0x3baa6d[_0x71aa('0x1e')](_0x52d2a8['slice'](0x4,_0x52d2a8[_0x71aa('0x16')])['join'](','));break;case _0x71aa('0x23'):var _0x390578=_0x523bbf[_0x71aa('0x1c')][_0x71aa('0x20')](',');_0x3baa6d[_0x71aa('0x1e')](_0x390578[0x0]);_0x3baa6d[_0x71aa('0x1e')](_0x390578[0x1]);_0x3baa6d[_0x71aa('0x1e')](_0x390578[0x2]);_0x3baa6d[_0x71aa('0x1e')](_0x390578[0x3]);_0x3baa6d[_0x71aa('0x1e')](_0x390578[_0x71aa('0x21')](0x4,_0x390578[_0x71aa('0x16')])[_0x71aa('0x1f')](','));break;case _0x71aa('0x12'):_0x3baa6d[_0x71aa('0x1e')](_0x523bbf['appdata']);break;case _0x71aa('0x24'):_0x3baa6d[_0x71aa('0x1e')](_0x523bbf[_0x71aa('0x25')]);_0x3baa6d['push'](_0x523bbf[_0x71aa('0x1c')]);break;case _0x71aa('0x26'):var _0x803277=utils[_0x71aa('0x27')](_0x557d94['account'][_0x71aa('0x28')],_0x557d94);var _0x3d0523=_0x523bbf['appdata'][_0x71aa('0x20')](',');_0x3baa6d[_0x71aa('0x1e')](_0x3d0523[0x0]);_0x3baa6d[_0x71aa('0x1e')](_0x3d0523[0x1]);_0x3baa6d['push'](_0x3d0523[0x2]);_0x3baa6d[_0x71aa('0x1e')](_0x3d0523[0x3]);_0x3baa6d['push'](_0x3d0523[0x4]);_0x3baa6d['push'](_0x3d0523[0x5]);_0x3baa6d[_0x71aa('0x1e')](_0x3d0523[0x6]);_0x3baa6d[_0x71aa('0x1e')](_0x3d0523[0x7]);_0x3baa6d[_0x71aa('0x1e')](_0x3d0523[0x8]);_0x3baa6d['push'](_0x3d0523[0x9]);_0x3baa6d['push'](_0x3d0523[0xa]);_0x3baa6d[_0x71aa('0x1e')](_0x557d94['interaction']['id']);_0x3baa6d[_0x71aa('0x1e')](_0x557d94[_0x71aa('0x12')]['id']);_0x3baa6d[_0x71aa('0x1e')](_0x523bbf[_0x71aa('0x29')]);_0x3baa6d['push'](_0x557d94[_0x71aa('0x13')][_0x71aa('0x2a')]);_0x3baa6d['push'](_0x557d94[_0x71aa('0x2b')][_0x71aa('0x2b')]);_0x3baa6d[_0x71aa('0x1e')](_0x803277);break;default:_0x3baa6d=_[_0x71aa('0xb')](_0x523bbf[_0x71aa('0x1c')])?[]:_0x523bbf[_0x71aa('0x1c')][_0x71aa('0x20')](',');}var _0x21f6c7={'id':util[_0x71aa('0xa')](_0x71aa('0x2c'),_0x405ca1,_0x523bbf['id'],_0x523bbf['app']),'condition':require(_0x71aa('0x2d'))['condition'](_0x405ca1,getIntervals(_0x135c20[_0x71aa('0x2e')],_0x523bbf),_0x135c20),'consequence':require(_0x71aa('0x2f')+_0x523bbf[_0x71aa('0x18')])[_0x71aa('0x30')](_0x405ca1,_0x3baa6d,_0x135c20,_0x557d94),'p':_0x523bbf[_0x71aa('0x31')]||0x0};logger[_0x71aa('0x32')](_0x71aa('0x33'),_0x21f6c7['id'],_0x71aa('0x34'),getIntervals(_0x135c20[_0x71aa('0x2e')],_0x523bbf)[_0x71aa('0x1f')](_0x71aa('0x35')));_0x1da4e7['push'](_0x21f6c7);}else{logger['error'](_0x71aa('0x36'),path['join'](__dirname,_0x71aa('0x14'),_0x523bbf[_0x71aa('0x18')]+_0x71aa('0x19')));}}_0x135c20[_0x71aa('0x10')][_0x405ca1]=new RuleEngine(_0x1da4e7);_0x135c20['rules'][_0x405ca1][_0x71aa('0x37')](_0x557d94,function(_0x5d58e5){logger[_0x71aa('0x32')](_0x71aa('0x38'),JSON[_0x71aa('0x39')](_0x5d58e5[_0x71aa('0x3a')]));if(_0x135c20[_0x71aa('0x10')][_0x405ca1]){_0x135c20[_0x71aa('0x10')][_0x405ca1][_0x71aa('0x3b')](_0x71aa('0x3c'));}});return _0x3751ca({'code':0xc8,'message':_0x557d94});}else{if(_0x36417e){logger[_0x71aa('0x32')](util[_0x71aa('0xa')](_0x71aa('0x3d'),_0x405ca1));}else{logger[_0x71aa('0x32')](_0x71aa('0x3e'));}return _0x3751ca({'code':0xc8,'message':_0x557d94});}}catch(_0x503723){logger[_0x71aa('0x3f')](_0x503723['stack']);return _0x2bda8e(_0x56af93[_0x71aa('0x3f')](0x1f4,_0x503723));}}return _0x2bda8e(_0x71aa('0x40'));});},'AcceptMessage':function(_0x5ddc2d){var _0x52cd0a=this;return new Promise(function(_0x2f3084,_0xc632e0){if(_0x5ddc2d[_0x71aa('0x41')]&&_0x5ddc2d['agent']['id']){if(_0x135c20[_0x71aa('0x42')][_0x5ddc2d[_0x71aa('0x41')]['id']]){_0x135c20[_0x71aa('0x42')][_0x5ddc2d[_0x71aa('0x41')]['id']][_0x71aa('0x43')]=![];_0x135c20[_0x71aa('0x42')][_0x5ddc2d[_0x71aa('0x41')]['id']]['busyQueue']=undefined;}}if(_0x5ddc2d[_0x71aa('0x12')]&&_0x5ddc2d[_0x71aa('0x12')]['id']){try{var _0x1e9cd7=getId(_0x5ddc2d[_0x71aa('0x11')],_0x5ddc2d[_0x71aa('0x12')]?_0x5ddc2d[_0x71aa('0x12')]['id']:0x0,_0x5ddc2d[_0x71aa('0x13')]?_0x5ddc2d[_0x71aa('0x13')]['id']:0x0);if(_0x135c20[_0x71aa('0x10')][_0x1e9cd7]){_0x135c20[_0x71aa('0x10')][_0x1e9cd7][_0x71aa('0x3b')](_0x71aa('0x44'));if(rpc[_0x5ddc2d[_0x71aa('0x11')]+_0x71aa('0x45')]){rpc[_0x5ddc2d['channel']+_0x71aa('0x45')][_0x71aa('0x46')](_0x1e9cd7,{'UserId':_0x5ddc2d['message'][_0x71aa('0x47')]})['catch'](function(){logger[_0x71aa('0x3f')]('error\x20update\x20queue\x20report');});}}return _0x2f3084({'code':0xc8,'message':_0x5ddc2d});}catch(_0x229211){logger['error'](_0x229211[_0x71aa('0x48')]);return _0xc632e0(_0x52cd0a['error'](0x1f4,_0x229211));}}logger[_0x71aa('0x3f')]('message\x20is\x20empty');return _0xc632e0(_0x52cd0a['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0xe8beb6){var _0x416a44=this;return new Promise(function(_0x503158,_0x49592c){if(_0xe8beb6['agent']&&_0xe8beb6[_0x71aa('0x41')]['id']){try{if(_0x135c20['agents'][_0xe8beb6[_0x71aa('0x41')]['id']]){_0x135c20[_0x71aa('0x42')][_0xe8beb6['agent']['id']][_0x71aa('0x43')]=![];_0x135c20[_0x71aa('0x42')][_0xe8beb6[_0x71aa('0x41')]['id']][_0x71aa('0x49')]=undefined;}return _0x503158({'code':0xc8,'message':_0xe8beb6});}catch(_0x5e81ec){logger[_0x71aa('0x3f')](_0x5e81ec['stack']);return _0x49592c(_0x416a44[_0x71aa('0x3f')](0x1f4,_0x5e81ec));}}logger[_0x71aa('0x3f')](_0x71aa('0x4a'));return _0x49592c(_0x416a44[_0x71aa('0x3f')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x56d7d0){var _0x1e2f38=this;return new Promise(function(_0x554d07,_0x28a648){if(_0x56d7d0[_0x71aa('0x11')]&&_0x56d7d0[_0x71aa('0x13')]&&_0x56d7d0['interaction']['id']){try{var _0x34b0a8=getId(_0x56d7d0['channel'],_0x56d7d0['message']?_0x56d7d0[_0x71aa('0x12')]['id']:0x0,_0x56d7d0[_0x71aa('0x13')]?_0x56d7d0[_0x71aa('0x13')]['id']:0x0);if(_0x135c20['rules'][_0x34b0a8]){_0x135c20[_0x71aa('0x10')][_0x34b0a8][_0x71aa('0x3b')](_0x71aa('0x44'));}return _0x554d07({'code':0xc8,'message':_0x56d7d0});}catch(_0x6d1588){logger[_0x71aa('0x3f')](_0x6d1588['stack']);return _0x28a648(_0x1e2f38[_0x71aa('0x3f')](0x1f4,_0x6d1588));}}logger[_0x71aa('0x3f')](_0x71aa('0x4a'));return _0x28a648(_0x1e2f38[_0x71aa('0x3f')](0x1f4,_0x71aa('0x4a')));});},'AgentCapacity':function(_0x50706d){var _0x177df8=this;return new Promise(function(_0x52b563,_0x4a0eec){if(_0x135c20[_0x71aa('0x42')][_0x71aa('0x4b')](_0x50706d['id'])){for(var _0x240f62 in _0x50706d[_0x71aa('0x4c')]){if(_0x50706d[_0x71aa('0x4c')][_0x71aa('0x4b')](_0x240f62)){if(_0x135c20[_0x71aa('0x42')][_0x50706d['id']][_0x71aa('0x4b')](_0x240f62+_0x71aa('0x4d'))){_0x135c20[_0x71aa('0x42')][_0x50706d['id']][_0x240f62+_0x71aa('0x4d')]=parseInt(_0x50706d[_0x71aa('0x4c')][_0x240f62],0xa);}}}_0x135c20['agents'][_0x50706d['id']][_0x71aa('0x4e')]();return _0x52b563({'code':0xc8,'message':_0x135c20[_0x71aa('0x42')][_0x50706d['id']]});}else{return _0x4a0eec(_0x177df8[_0x71aa('0x3f')](0x1f4,_0x71aa('0x4f')));}});},'Agents':function(_0xa37026){return new Promise(function(_0x4304b8){var _0x365966=_[_0x71aa('0x50')](_0x135c20[_0x71aa('0x42')]);if(_0xa37026&&_0xa37026['id']){var _0x23c6ea=_['find'](_0x365966,function(_0x173a1d){return _0x173a1d['id']===_0xa37026['id'];});_0x4304b8(_0x23c6ea);}else{_0x4304b8({'count':_0x365966[_0x71aa('0x16')],'rows':_0x365966});}});},'ChatQueues':function(){return new Promise(function(_0x516719){var _0x1fc1d8=[];for(var _0x27388f in _0x135c20[_0x71aa('0x51')]){if(_0x135c20[_0x71aa('0x51')][_0x71aa('0x4b')](_0x27388f)){var _0x2d255a=_0x135c20[_0x71aa('0x51')][_0x27388f];var _0x3a3e6f={'id':_0x2d255a['id'],'available':_0x2d255a[_0x71aa('0x52')],'loggedIn':_0x2d255a[_0x71aa('0x53')],'name':_0x2d255a[_0x71aa('0x54')],'paused':_0x2d255a[_0x71aa('0x55')],'waiting':_0x2d255a[_0x71aa('0x56')]};_0x1fc1d8[_0x71aa('0x1e')](_0x3a3e6f);}}_0x516719({'count':_0x1fc1d8[_0x71aa('0x16')],'rows':_0x1fc1d8});});},'MailQueues':function(){return new Promise(function(_0x4d142e){var _0x24b778=[];for(var _0x1a18b6 in _0x135c20[_0x71aa('0x57')]){if(_0x135c20[_0x71aa('0x57')]['hasOwnProperty'](_0x1a18b6)){var _0x5b2526=_0x135c20['mailQueues'][_0x1a18b6];var _0x37394c={'id':_0x5b2526['id'],'available':_0x5b2526[_0x71aa('0x52')],'loggedIn':_0x5b2526[_0x71aa('0x53')],'name':_0x5b2526[_0x71aa('0x54')],'paused':_0x5b2526[_0x71aa('0x55')],'waiting':_0x5b2526[_0x71aa('0x56')]};_0x24b778['push'](_0x37394c);}}_0x4d142e({'count':_0x24b778['length'],'rows':_0x24b778});});},'OpenchannelQueues':function(){return new Promise(function(_0x6b68aa){var _0x426f58=[];for(var _0x39cc26 in _0x135c20[_0x71aa('0x58')]){if(_0x135c20['openchannelQueues']['hasOwnProperty'](_0x39cc26)){var _0x37bb16=_0x135c20[_0x71aa('0x58')][_0x39cc26];var _0x63a07b={'id':_0x37bb16['id'],'available':_0x37bb16[_0x71aa('0x52')],'loggedIn':_0x37bb16['loggedIn'],'name':_0x37bb16[_0x71aa('0x54')],'paused':_0x37bb16[_0x71aa('0x55')],'waiting':_0x37bb16['waiting']};_0x426f58[_0x71aa('0x1e')](_0x63a07b);}}_0x6b68aa({'count':_0x426f58[_0x71aa('0x16')],'rows':_0x426f58});});},'SmsQueues':function(){return new Promise(function(_0x4d03f2){var _0x280519=[];for(var _0x35cd5a in _0x135c20[_0x71aa('0x59')]){if(_0x135c20[_0x71aa('0x59')]['hasOwnProperty'](_0x35cd5a)){var _0x5b4408=_0x135c20[_0x71aa('0x59')][_0x35cd5a];var _0x190911={'id':_0x5b4408['id'],'available':_0x5b4408[_0x71aa('0x52')],'loggedIn':_0x5b4408[_0x71aa('0x53')],'name':_0x5b4408[_0x71aa('0x54')],'paused':_0x5b4408[_0x71aa('0x55')],'waiting':_0x5b4408['waiting']};_0x280519[_0x71aa('0x1e')](_0x190911);}}_0x4d03f2({'count':_0x280519[_0x71aa('0x16')],'rows':_0x280519});});},'FaxQueues':function(){return new Promise(function(_0x2f7a60){var _0x186e2d=[];for(var _0x2ff2c8 in _0x135c20[_0x71aa('0x5a')]){if(_0x135c20[_0x71aa('0x5a')][_0x71aa('0x4b')](_0x2ff2c8)){var _0x5015f4=_0x135c20[_0x71aa('0x5a')][_0x2ff2c8];var _0x5ed482={'id':_0x5015f4['id'],'available':_0x5015f4[_0x71aa('0x52')],'loggedIn':_0x5015f4['loggedIn'],'name':_0x5015f4[_0x71aa('0x54')],'paused':_0x5015f4['paused'],'waiting':_0x5015f4[_0x71aa('0x56')]};_0x186e2d[_0x71aa('0x1e')](_0x5ed482);}}_0x2f7a60({'count':_0x186e2d[_0x71aa('0x16')],'rows':_0x186e2d});});},'WhatsappQueues':function(){return new Promise(function(_0xc7deac){var _0x1d3dfc=[];for(var _0x40fdea in _0x135c20['whatsappQueues']){if(_0x135c20[_0x71aa('0x5b')]['hasOwnProperty'](_0x40fdea)){var _0x234662=_0x135c20['whatsappQueues'][_0x40fdea];var _0x2c5344={'id':_0x234662['id'],'available':_0x234662[_0x71aa('0x52')],'loggedIn':_0x234662['loggedIn'],'name':_0x234662[_0x71aa('0x54')],'paused':_0x234662[_0x71aa('0x55')],'waiting':_0x234662[_0x71aa('0x56')]};_0x1d3dfc[_0x71aa('0x1e')](_0x2c5344);}}_0xc7deac({'count':_0x1d3dfc[_0x71aa('0x16')],'rows':_0x1d3dfc});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0xe85755){var _0x2d5528=_[_0x71aa('0x50')](_0x135c20[_0x71aa('0x5c')]);_0xe85755({'count':_0x2d5528[_0x71aa('0x16')],'rows':_0x2d5528});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x139178){var _0x2ad259=_[_0x71aa('0x50')](_0x135c20[_0x71aa('0x5d')]);_0x139178({'count':_0x2ad259['length'],'rows':_0x2ad259});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x589a00){var _0x204997=_['values'](_0x135c20[_0x71aa('0x5e')]);_0x589a00({'count':_0x204997[_0x71aa('0x16')],'rows':_0x204997});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x2f6a13){var _0x5b1de1=_[_0x71aa('0x50')](_0x135c20[_0x71aa('0x5f')]);_0x2f6a13({'count':_0x5b1de1['length'],'rows':_0x5b1de1});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x5d6141){var _0x8dfd51=_[_0x71aa('0x50')](_0x135c20[_0x71aa('0x60')]);_0x5d6141({'count':_0x8dfd51[_0x71aa('0x16')],'rows':_0x8dfd51});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x3c67a1){var _0x195c49=_[_0x71aa('0x50')](_0x135c20[_0x71aa('0x61')]);_0x3c67a1({'count':_0x195c49[_0x71aa('0x16')],'rows':_0x195c49});});}};var _0x2d7a16=jayson[_0x71aa('0x62')](_0x357fdc)[_0x71aa('0x63')]();_0x2d7a16['on'](_0x71aa('0x3f'),function(_0x1f419d){logger[_0x71aa('0x3f')](JSON[_0x71aa('0x39')](_0x1f419d));return _0x152873(_0x1f419d);});_0x2d7a16[_0x71aa('0xf')](0x232c,_0x71aa('0x64'),function(){console['log'](_0x71aa('0x65'),0x232c);return _0x2744a4(_0x71aa('0x66')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 59db7e6..658b96a 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 _0x09aa=['log','stop','bluebird','jayson/promise','lodash','routing','client','http','request','then','error','message','result','catch','condition','rules','info','length','push','Command','format','indexOf','true','[%s][INTERVAL]\x20%s','all','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x09aa,0x16e));var _0xa09a=function(_0x160762,_0x221ba9){_0x160762=_0x160762-0x0;var _0xb54309=_0x09aa[_0x160762];return _0xb54309;};'use strict';var util=require('util');var BPromise=require(_0xa09a('0x0'));var jayson=require(_0xa09a('0x1'));var _=require(_0xa09a('0x2'));var logger=require('../../../config/logger')(_0xa09a('0x3'));var client=jayson[_0xa09a('0x4')][_0xa09a('0x5')]({'port':0x232a});function request(_0x219ce4,_0x21d211){return new BPromise(function(_0x230c4e,_0x1ab0fc){return client[_0xa09a('0x6')](_0x219ce4,_0x21d211)[_0xa09a('0x7')](function(_0x2bef84){if(_0x2bef84[_0xa09a('0x8')]){return _0x1ab0fc(_0x2bef84[_0xa09a('0x8')][_0xa09a('0x9')]);}else{return _0x230c4e(_0x2bef84[_0xa09a('0xa')]);}})[_0xa09a('0xb')](function(_0x4cbf57){return _0x1ab0fc(_0x4cbf57);});});}exports[_0xa09a('0xc')]=function(_0x402d42,_0x3caa7e,_0x948e29){return function(_0x31b623){if(_0x948e29[_0xa09a('0xd')]&&!_0x948e29[_0xa09a('0xd')][_0x402d42]){logger[_0xa09a('0xe')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x402d42);return _0x31b623['stop']();}var _0x5f2cb8=[];for(var _0xe14282=0x0;_0xe14282<_0x3caa7e[_0xa09a('0xf')];_0xe14282+=0x1){_0x5f2cb8[_0xa09a('0x10')](request(_0xa09a('0x11'),{'command':util[_0xa09a('0x12')]('iftime\x20%s',_0x3caa7e[_0xe14282])})[_0xa09a('0x7')](function(_0x15e8b7){return _0x15e8b7&&_0x15e8b7[_0xa09a('0x9')]&&_0x15e8b7[_0xa09a('0x9')][_0xa09a('0x13')](_0xa09a('0x14'))>=0x0?!![]:![];})['catch'](function(_0x22dd91){logger[_0xa09a('0x8')](_0xa09a('0x15'),_0x402d42,_0x3caa7e[_0xe14282]);}));}BPromise[_0xa09a('0x16')](_0x5f2cb8)['then'](function(_0x3690a5){var _0x3d94b9=_['some'](_0x3690a5);logger[_0xa09a('0xe')](_0xa09a('0x17'),_0x402d42,_0x3caa7e[_0xa09a('0x18')](_0xa09a('0x19')),_0x3d94b9);_0x31b623['when'](_0x3d94b9);})[_0xa09a('0xb')](function(_0x31bc91){console[_0xa09a('0x1a')](_0x31bc91);logger[_0xa09a('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x402d42,_0x3caa7e[_0xa09a('0x18')](_0xa09a('0x19')),_0x31bc91['stack']);_0x31b623[_0xa09a('0x1b')]();});};}; \ No newline at end of file +var _0x9a9f=['rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','catch','log','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','http','request','then','error','message','result','condition'];(function(_0x20fc27,_0x4dfaeb){var _0x5415ea=function(_0x3575b3){while(--_0x3575b3){_0x20fc27['push'](_0x20fc27['shift']());}};_0x5415ea(++_0x4dfaeb);}(_0x9a9f,0x101));var _0xf9a9=function(_0x2032b2,_0x23af78){_0x2032b2=_0x2032b2-0x0;var _0x24b2ea=_0x9a9f[_0x2032b2];return _0x24b2ea;};'use strict';var util=require(_0xf9a9('0x0'));var BPromise=require(_0xf9a9('0x1'));var jayson=require(_0xf9a9('0x2'));var _=require(_0xf9a9('0x3'));var logger=require(_0xf9a9('0x4'))(_0xf9a9('0x5'));var client=jayson['client'][_0xf9a9('0x6')]({'port':0x232a});function request(_0x3d9532,_0x39ee84){return new BPromise(function(_0x5d93ea,_0x50fcab){return client[_0xf9a9('0x7')](_0x3d9532,_0x39ee84)[_0xf9a9('0x8')](function(_0x19390a){if(_0x19390a[_0xf9a9('0x9')]){return _0x50fcab(_0x19390a[_0xf9a9('0x9')][_0xf9a9('0xa')]);}else{return _0x5d93ea(_0x19390a[_0xf9a9('0xb')]);}})['catch'](function(_0x8fcc7a){return _0x50fcab(_0x8fcc7a);});});}exports[_0xf9a9('0xc')]=function(_0x2708c8,_0x45092a,_0x37982e){return function(_0x577ab8){if(_0x37982e[_0xf9a9('0xd')]&&!_0x37982e[_0xf9a9('0xd')][_0x2708c8]){logger[_0xf9a9('0xe')](_0xf9a9('0xf'),_0x2708c8);return _0x577ab8[_0xf9a9('0x10')]();}var _0x24609a=[];for(var _0x143d27=0x0;_0x143d27<_0x45092a[_0xf9a9('0x11')];_0x143d27+=0x1){_0x24609a[_0xf9a9('0x12')](request(_0xf9a9('0x13'),{'command':util[_0xf9a9('0x14')](_0xf9a9('0x15'),_0x45092a[_0x143d27])})[_0xf9a9('0x8')](function(_0x542f28){return _0x542f28&&_0x542f28[_0xf9a9('0xa')]&&_0x542f28['message'][_0xf9a9('0x16')](_0xf9a9('0x17'))>=0x0?!![]:![];})['catch'](function(_0x321190){logger[_0xf9a9('0x9')]('[%s][INTERVAL]\x20%s',_0x2708c8,_0x45092a[_0x143d27]);}));}BPromise['all'](_0x24609a)[_0xf9a9('0x8')](function(_0x5d58fe){var _0xcd206e=_['some'](_0x5d58fe);logger['info'](_0xf9a9('0x18'),_0x2708c8,_0x45092a[_0xf9a9('0x19')](_0xf9a9('0x1a')),_0xcd206e);_0x577ab8['when'](_0xcd206e);})[_0xf9a9('0x1b')](function(_0xe14de){console[_0xf9a9('0x1c')](_0xe14de);logger['error'](_0xf9a9('0x18'),_0x2708c8,_0x45092a[_0xf9a9('0x19')]('\x20|\x20'),_0xe14de[_0xf9a9('0x1d')]);_0x577ab8['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 2145ee2..31884f0 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 _0x373d=['transfereruniqueid','transfer','blind','extension','transferuniqueid','[%s][agents][blindtransfer]','attendedtransfer','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','secondtransfereruniqueid','transfertype','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','complete','lodash','./utils','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','agentcomplete','acw','acwTimeout','request','CreateVoiceAgentReport','agentcalled','format','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','agentringnoanswer','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connect','answered_elsewhere','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s'];(function(_0x3de7ef,_0xd1063e){var _0x62a6b7=function(_0x1c18b8){while(--_0x1c18b8){_0x3de7ef['push'](_0x3de7ef['shift']());}};_0x62a6b7(++_0xd1063e);}(_0x373d,0x1e2));var _0xd373=function(_0x1254a5,_0x2ba0be){_0x1254a5=_0x1254a5-0x0;var _0x2fbf81=_0x373d[_0x1254a5];return _0x2fbf81;};'use strict';var _=require(_0xd373('0x0'));var util=require('util');var utils=require(_0xd373('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x53f3b7,_0x30e9ce){utils[_0xd373('0x2')](util['format'](_0xd373('0x3'),_0x53f3b7[_0xd373('0x4')],_0x53f3b7[_0xd373('0x5')],_0x53f3b7['queue'],_0x53f3b7['membername'],_0x53f3b7[_0xd373('0x6')],_0x53f3b7[_0xd373('0x7')],_0x53f3b7[_0xd373('0x8')],_0x53f3b7[_0xd373('0x9')]));if(_0x53f3b7['queue']){utils[_0xd373('0xa')](_0x53f3b7['queue'])['then'](function(_0x59ed5e){if(_0x59ed5e){_0x53f3b7[_0xd373('0xb')]=_0x59ed5e[_0xd373('0xb')];_0x53f3b7['agentacw']=_0x53f3b7[_0xd373('0xc')]?_0x59ed5e[_0xd373('0xd')]:![];_0x53f3b7['acwtime']=_0x53f3b7['agentacw']?_0x59ed5e[_0xd373('0xe')]:0x0;}utils[_0xd373('0xf')](_0xd373('0x10'),_0x53f3b7);});}else{utils[_0xd373('0xf')]('CreateVoiceAgentReport',_0x53f3b7);}if(_0x30e9ce){delete transfers[_0x53f3b7['uniqueid']];}else{delete agents[_0x53f3b7['destuniqueid']];}}exports[_0xd373('0x11')]=function(_0x14a0ee){try{utils['debug'](util[_0xd373('0x12')](_0xd373('0x13'),_0x14a0ee[_0xd373('0x4')]),_0x14a0ee);agents[_0x14a0ee[_0xd373('0x14')]]=_0x14a0ee;agents[_0x14a0ee[_0xd373('0x14')]][_0xd373('0x15')]=utils[_0xd373('0x16')]();agents[_0x14a0ee[_0xd373('0x14')]][_0xd373('0x9')]=_0xd373('0x17');agents[_0x14a0ee[_0xd373('0x14')]][_0xd373('0x8')]=null;agents[_0x14a0ee[_0xd373('0x14')]]['connectedlinename']=null;utils[_0xd373('0x2')](util['format'](_0xd373('0x18'),_0x14a0ee[_0xd373('0x4')],agents[_0x14a0ee['destuniqueid']][_0xd373('0x19')],_0x14a0ee['destuniqueid']));}catch(_0x4d7d72){utils[_0xd373('0x1a')](util[_0xd373('0x12')](_0xd373('0x13'),_0x14a0ee[_0xd373('0x4')]),_0x4d7d72);}};exports[_0xd373('0x1b')]=function(_0x181eb2){try{if(!_['isNil'](agents[_0x181eb2[_0xd373('0x14')]])){utils[_0xd373('0x1c')](util[_0xd373('0x12')](_0xd373('0x1d'),_0x181eb2[_0xd373('0x4')]),_0x181eb2);utils[_0xd373('0x2')](util['format'](_0xd373('0x1e'),_0x181eb2[_0xd373('0x4')],agents[_0x181eb2[_0xd373('0x14')]][_0xd373('0x19')],_0x181eb2[_0xd373('0x14')]));agents[_0x181eb2[_0xd373('0x14')]][_0xd373('0x1b')]=!![];agents[_0x181eb2[_0xd373('0x14')]][_0xd373('0x1f')]=utils[_0xd373('0x16')]();agents[_0x181eb2[_0xd373('0x14')]][_0xd373('0x9')]=_0xd373('0x20');agents[_0x181eb2[_0xd373('0x14')]][_0xd373('0x21')]=_0xd373('0x20');agents[_0x181eb2[_0xd373('0x14')]][_0xd373('0x22')]=_0x181eb2[_0xd373('0x23')]?parseInt(_0x181eb2[_0xd373('0x23')])/0x3e8:0x0;agents[_0x181eb2[_0xd373('0x14')]][_0xd373('0x24')]=0x0;unanswered[_0xd373('0x25')](_0x181eb2[_0xd373('0x14')]);}}catch(_0xf85ca8){utils[_0xd373('0x1a')](util[_0xd373('0x12')](_0xd373('0x1d'),_0x181eb2[_0xd373('0x4')]),_0xf85ca8);}};exports[_0xd373('0x26')]=function(_0x5287e7){try{_[_0xd373('0x27')](agents,function(_0x490842,_0x498aaa){if(_0x490842[_0xd373('0x4')]==_0x5287e7[_0xd373('0x4')]&&!_[_0xd373('0x28')](unanswered,_0x490842[_0xd373('0x14')])){utils[_0xd373('0x1c')](util['format'](_0xd373('0x29'),_0x5287e7[_0xd373('0x4')]),_0x5287e7);utils['info'](util[_0xd373('0x12')](_0xd373('0x2a'),_0x5287e7[_0xd373('0x4')],_0x490842[_0xd373('0x19')],_0x490842[_0xd373('0x14')]));_0x490842[_0xd373('0x1b')]=!![];_0x490842[_0xd373('0x1f')]=utils[_0xd373('0x16')]();_0x490842[_0xd373('0x9')]='abandoned';_0x490842[_0xd373('0x21')]=_0xd373('0x2b');_0x490842[_0xd373('0x22')]=_0x5287e7[_0xd373('0x22')];_0x490842[_0xd373('0x24')]=0x0;writeDB(_0x490842);}});}catch(_0x28da03){utils[_0xd373('0x1a')](util[_0xd373('0x12')](_0xd373('0x29'),_0x5287e7[_0xd373('0x4')]),_0x28da03);}};exports[_0xd373('0x2c')]=function(_0x13a1cd){try{if(agents[_0x13a1cd[_0xd373('0x14')]]){utils[_0xd373('0x1c')](util[_0xd373('0x12')]('[%s][agents][agentconnect]',_0x13a1cd[_0xd373('0x4')]),_0x13a1cd);utils[_0xd373('0x2')](util[_0xd373('0x12')](_0xd373('0x2d'),_0x13a1cd['uniqueid'],agents[_0x13a1cd[_0xd373('0x14')]][_0xd373('0x19')],_0x13a1cd[_0xd373('0x14')]));agents[_0x13a1cd[_0xd373('0x14')]][_0xd373('0x2e')]=utils[_0xd373('0x16')]();agents[_0x13a1cd['destuniqueid']]['connectedlinenum']=_0x13a1cd[_0xd373('0x8')];agents[_0x13a1cd['destuniqueid']][_0xd373('0x2f')]=_0x13a1cd[_0xd373('0x2f')];agents[_0x13a1cd[_0xd373('0x14')]]['holdtime']=_0x13a1cd[_0xd373('0x23')];agents[_0x13a1cd[_0xd373('0x14')]][_0xd373('0x9')]=_0xd373('0x30');_['forIn'](agents,function(_0x513038,_0x5de74e){if(_0x513038[_0xd373('0x14')]!=_0x13a1cd['destuniqueid']&&_0x513038[_0xd373('0x4')]==_0x13a1cd[_0xd373('0x4')]){_0x513038['talktime']=0x0;_0x513038['holdtime']=_0x13a1cd['ringtime'];_0x513038[_0xd373('0x1b')]=!![];_0x513038[_0xd373('0x1f')]=utils[_0xd373('0x16')]();_0x513038['lastevent']='answered_elsewhere';_0x513038[_0xd373('0x21')]=_0xd373('0x31');_0x513038['answeredelsewheredestinationuniqueid']=_0x13a1cd[_0xd373('0x14')];_0x513038[_0xd373('0x32')]=_0x13a1cd[_0xd373('0x19')];writeDB(_0x513038);}});}}catch(_0x9989e4){utils[_0xd373('0x1a')](util['format']('[%s][agents][agentconnect]',_0x13a1cd[_0xd373('0x4')]),_0x9989e4);}};exports[_0xd373('0xc')]=function(_0x30b423){try{if(!_[_0xd373('0x33')](agents[_0x30b423['destuniqueid']])){utils[_0xd373('0x1c')](util['format'](_0xd373('0x34'),_0x30b423[_0xd373('0x4')]),_0x30b423);utils[_0xd373('0x2')](util[_0xd373('0x12')](_0xd373('0x35'),_0x30b423['uniqueid'],agents[_0x30b423[_0xd373('0x14')]][_0xd373('0x19')],_0x30b423['destuniqueid']));agents[_0x30b423[_0xd373('0x14')]][_0xd373('0xc')]=!![];agents[_0x30b423[_0xd373('0x14')]][_0xd373('0x36')]=utils[_0xd373('0x16')]();agents[_0x30b423[_0xd373('0x14')]][_0xd373('0x24')]=utils[_0xd373('0x37')](agents[_0x30b423[_0xd373('0x14')]][_0xd373('0x36')],agents[_0x30b423['destuniqueid']]['agentconnectAt']);agents[_0x30b423[_0xd373('0x14')]]['reason']=_0x30b423[_0xd373('0x21')];agents[_0x30b423['destuniqueid']]['lastevent']='complete';writeDB(agents[_0x30b423[_0xd373('0x14')]]);}}catch(_0x39d995){utils[_0xd373('0x1a')](util[_0xd373('0x12')](_0xd373('0x34'),_0x30b423[_0xd373('0x4')]),_0x39d995);}};exports[_0xd373('0x38')]=function(_0x4d1088){try{if(!_[_0xd373('0x33')](agents[_0x4d1088['transfereruniqueid']])){utils[_0xd373('0x1c')](util[_0xd373('0x12')]('[%s][agents][blindtransfer]',_0x4d1088[_0xd373('0x4')]),_0x4d1088);utils['info'](util[_0xd373('0x12')](_0xd373('0x39'),_0x4d1088[_0xd373('0x4')],agents[_0x4d1088[_0xd373('0x3a')]][_0xd373('0x19')],agents[_0x4d1088['transfereruniqueid']]['uniqueid']));agents[_0x4d1088['transfereruniqueid']][_0xd373('0x3b')]=!![];agents[_0x4d1088[_0xd373('0x3a')]]['transfertype']=_0xd373('0x3c');agents[_0x4d1088[_0xd373('0x3a')]]['transferexten']=_0x4d1088[_0xd373('0x3d')];agents[_0x4d1088[_0xd373('0x3a')]][_0xd373('0x3e')]=agents[_0x4d1088[_0xd373('0x3a')]][_0xd373('0x4')];}}catch(_0xa2758){utils[_0xd373('0x1a')](util[_0xd373('0x12')](_0xd373('0x3f'),_0x4d1088[_0xd373('0x4')]),_0xa2758);}};exports[_0xd373('0x40')]=function(_0x5b88ea){try{utils['debug'](util['format']('[%s][agents][attendedtransfer]',_0x5b88ea['origtransfereruniqueid']),_0x5b88ea);if(_0x5b88ea['origtransfereruniqueid']==_0x5b88ea[_0xd373('0x41')]){if(!_[_0xd373('0x33')](agents[_0x5b88ea['secondtransfereruniqueid']])){utils['info'](util['format'](_0xd373('0x42'),_0x5b88ea[_0xd373('0x43')],agents[_0x5b88ea['secondtransfereruniqueid']]['membername']));agents[_0x5b88ea[_0xd373('0x44')]][_0xd373('0x3b')]=!![];agents[_0x5b88ea[_0xd373('0x44')]][_0xd373('0x45')]=_0xd373('0x46');agents[_0x5b88ea['secondtransfereruniqueid']][_0xd373('0x47')]=_0x5b88ea[_0xd373('0x48')];agents[_0x5b88ea[_0xd373('0x44')]][_0xd373('0x3e')]=_0x5b88ea[_0xd373('0x43')];}if(_0x5b88ea[_0xd373('0x49')]&&agents[_0x5b88ea[_0xd373('0x49')]]){agents[_0x5b88ea[_0xd373('0x49')]][_0xd373('0x4a')]=0x1;transfers[_0x5b88ea[_0xd373('0x49')]]=_[_0xd373('0x4b')](agents[_0x5b88ea[_0xd373('0x49')]]);transfers[_0x5b88ea[_0xd373('0x49')]][_0xd373('0x7')]=agents[_0x5b88ea[_0xd373('0x44')]]['calleridnum'];transfers[_0x5b88ea[_0xd373('0x49')]][_0xd373('0x4c')]=agents[_0x5b88ea[_0xd373('0x44')]]['calleridname'];transfers[_0x5b88ea[_0xd373('0x49')]]['agentcalledAt']=utils[_0xd373('0x16')]();transfers[_0x5b88ea['transfereeuniqueid']][_0xd373('0x2e')]=utils[_0xd373('0x16')]();transfers[_0x5b88ea[_0xd373('0x49')]][_0xd373('0x22')]=0x0;transfers[_0x5b88ea[_0xd373('0x49')]][_0xd373('0x4a')]=0x2;}}else if(_0x5b88ea[_0xd373('0x44')]==_0x5b88ea[_0xd373('0x4d')]){if(!_[_0xd373('0x33')](agents[_0x5b88ea[_0xd373('0x43')]])){utils[_0xd373('0x2')](util[_0xd373('0x12')](_0xd373('0x42'),_0x5b88ea[_0xd373('0x43')],agents[_0x5b88ea[_0xd373('0x43')]][_0xd373('0x19')]));agents[_0x5b88ea[_0xd373('0x43')]][_0xd373('0x3b')]=!![];agents[_0x5b88ea[_0xd373('0x43')]][_0xd373('0x45')]=_0xd373('0x46');agents[_0x5b88ea[_0xd373('0x43')]][_0xd373('0x47')]=_0x5b88ea[_0xd373('0x4e')];agents[_0x5b88ea[_0xd373('0x43')]][_0xd373('0x3e')]=_0x5b88ea['secondtransfereruniqueid'];}if(_0x5b88ea[_0xd373('0x4f')]&&agents[_0x5b88ea[_0xd373('0x4f')]]){agents[_0x5b88ea[_0xd373('0x4f')]]['agententerreason']=0x1;transfers[_0x5b88ea[_0xd373('0x4f')]]=_[_0xd373('0x4b')](agents[_0x5b88ea[_0xd373('0x4f')]]);transfers[_0x5b88ea[_0xd373('0x4f')]][_0xd373('0x7')]=agents[_0x5b88ea[_0xd373('0x43')]][_0xd373('0x7')];transfers[_0x5b88ea['transfertargetuniqueid']][_0xd373('0x4c')]=agents[_0x5b88ea[_0xd373('0x43')]][_0xd373('0x4c')];transfers[_0x5b88ea[_0xd373('0x4f')]][_0xd373('0x15')]=utils[_0xd373('0x16')]();transfers[_0x5b88ea[_0xd373('0x4f')]][_0xd373('0x2e')]=utils['now']();transfers[_0x5b88ea[_0xd373('0x4f')]]['holdtime']=0x0;transfers[_0x5b88ea[_0xd373('0x4f')]][_0xd373('0x4a')]=0x2;}}}catch(_0x1337c4){utils[_0xd373('0x1a')](util[_0xd373('0x12')](_0xd373('0x50'),_0x5b88ea[_0xd373('0x43')]),_0x1337c4);}};exports[_0xd373('0x51')]=function(_0x5f1bfd){try{utils[_0xd373('0x1c')](util['format'](_0xd373('0x52'),_0x5f1bfd[_0xd373('0x4')]),_0x5f1bfd);if(agents[_0x5f1bfd[_0xd373('0x4')]]&&agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x21')]===_0xd373('0x20')){if(_0x5f1bfd[_0xd373('0x53')]==='21'){agents[_0x5f1bfd['uniqueid']][_0xd373('0x21')]=_0xd373('0x54');agents[_0x5f1bfd[_0xd373('0x4')]]['lastevent']=_0xd373('0x54');}utils[_0xd373('0x2')](util[_0xd373('0x12')](_0xd373('0x55'),_0x5f1bfd[_0xd373('0x4')],agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x19')],agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x21')],agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x9')]));writeDB(agents[_0x5f1bfd[_0xd373('0x4')]]);var _0x5bbea5=unanswered[_0xd373('0x56')](_0x5f1bfd[_0xd373('0x4')]);if(_0x5bbea5>-0x1){unanswered[_0xd373('0x57')](_0x5bbea5,0x1);}}if(transfers[_0x5f1bfd['uniqueid']]){transfers[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0xc')]=!![];transfers[_0x5f1bfd[_0xd373('0x4')]]['agentcompleteAt']=utils[_0xd373('0x16')]();transfers[_0x5f1bfd['uniqueid']][_0xd373('0x24')]=utils[_0xd373('0x37')](transfers[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x36')],transfers[_0x5f1bfd['uniqueid']][_0xd373('0x2e')]);transfers[_0x5f1bfd['uniqueid']][_0xd373('0x21')]=_0xd373('0x58');transfers[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x9')]=_0xd373('0x59');utils[_0xd373('0x2')](util['format'](_0xd373('0x55'),_0x5f1bfd['uniqueid'],transfers[_0x5f1bfd[_0xd373('0x4')]]['membername'],transfers[_0x5f1bfd['uniqueid']][_0xd373('0x21')],transfers[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x9')]));writeDB(transfers[_0x5f1bfd[_0xd373('0x4')]],!![]);}if(agents[_0x5f1bfd['uniqueid']]&&agents[_0x5f1bfd['uniqueid']][_0xd373('0x2e')]){agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0xc')]=!![];agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x36')]=utils[_0xd373('0x16')]();agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x24')]=utils[_0xd373('0x37')](agents[_0x5f1bfd[_0xd373('0x4')]]['agentcompleteAt'],agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x2e')]);agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x21')]=agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x3b')]?_0xd373('0x3b'):'agent';agents[_0x5f1bfd[_0xd373('0x4')]]['lastevent']='complete';utils[_0xd373('0x2')](util[_0xd373('0x12')](_0xd373('0x55'),_0x5f1bfd[_0xd373('0x4')],agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x19')],agents[_0x5f1bfd['uniqueid']][_0xd373('0x21')],agents[_0x5f1bfd[_0xd373('0x4')]][_0xd373('0x9')]));writeDB(agents[_0x5f1bfd['uniqueid']]);}}catch(_0x467ac8){utils[_0xd373('0x1a')](util[_0xd373('0x12')]('[%s][agents][hangup]',_0x5f1bfd[_0xd373('0x4')]),_0x467ac8);}}; \ No newline at end of file +var _0xa74f=['calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','[%s][agents][agentcalled]','now','called','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','queuecallerabandon','debug','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','forIn','answered_elsewhere','[%s][agents][agentconnect]','agentcomplete','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfertype','blind','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfer','transferexten','transferuniqueid','transfereeuniqueid','calleridname','agentcalledAt','agententerreason','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','[%s][agents][hangup]','cause','rejected','indexOf','splice','complete','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue'];(function(_0x31fa2f,_0x1cb4df){var _0x288b37=function(_0x185033){while(--_0x185033){_0x31fa2f['push'](_0x31fa2f['shift']());}};_0x288b37(++_0x1cb4df);}(_0xa74f,0x9a));var _0xfa74=function(_0xcfc44,_0x179bc1){_0xcfc44=_0xcfc44-0x0;var _0x307a25=_0xa74f[_0xcfc44];return _0x307a25;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xfa74('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x4c4c00,_0x4b5765){utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x3'),_0x4c4c00[_0xfa74('0x4')],_0x4c4c00['channel'],_0x4c4c00[_0xfa74('0x5')],_0x4c4c00['membername'],_0x4c4c00['interface'],_0x4c4c00[_0xfa74('0x6')],_0x4c4c00[_0xfa74('0x7')],_0x4c4c00[_0xfa74('0x8')]));if(_0x4c4c00[_0xfa74('0x5')]){utils[_0xfa74('0x9')](_0x4c4c00[_0xfa74('0x5')])['then'](function(_0x32f55c){if(_0x32f55c){_0x4c4c00[_0xfa74('0xa')]=_0x32f55c[_0xfa74('0xa')];_0x4c4c00[_0xfa74('0xb')]=_0x4c4c00['agentcomplete']?_0x32f55c[_0xfa74('0xc')]:![];_0x4c4c00[_0xfa74('0xd')]=_0x4c4c00['agentacw']?_0x32f55c[_0xfa74('0xe')]:0x0;}utils[_0xfa74('0xf')](_0xfa74('0x10'),_0x4c4c00);});}else{utils[_0xfa74('0xf')]('CreateVoiceAgentReport',_0x4c4c00);}if(_0x4b5765){delete transfers[_0x4c4c00[_0xfa74('0x4')]];}else{delete agents[_0x4c4c00[_0xfa74('0x11')]];}}exports[_0xfa74('0x12')]=function(_0x278e8b){try{utils['debug'](util[_0xfa74('0x2')](_0xfa74('0x13'),_0x278e8b[_0xfa74('0x4')]),_0x278e8b);agents[_0x278e8b[_0xfa74('0x11')]]=_0x278e8b;agents[_0x278e8b[_0xfa74('0x11')]]['agentcalledAt']=utils[_0xfa74('0x14')]();agents[_0x278e8b[_0xfa74('0x11')]][_0xfa74('0x8')]=_0xfa74('0x15');agents[_0x278e8b[_0xfa74('0x11')]][_0xfa74('0x7')]=null;agents[_0x278e8b[_0xfa74('0x11')]]['connectedlinename']=null;utils[_0xfa74('0x1')](util[_0xfa74('0x2')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x278e8b['uniqueid'],agents[_0x278e8b[_0xfa74('0x11')]][_0xfa74('0x16')],_0x278e8b[_0xfa74('0x11')]));}catch(_0x5a863f){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x13'),_0x278e8b['uniqueid']),_0x5a863f);}};exports[_0xfa74('0x18')]=function(_0x302eb4){try{if(!_[_0xfa74('0x19')](agents[_0x302eb4['destuniqueid']])){utils['debug'](util[_0xfa74('0x2')](_0xfa74('0x1a'),_0x302eb4[_0xfa74('0x4')]),_0x302eb4);utils[_0xfa74('0x1')](util[_0xfa74('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x302eb4['uniqueid'],agents[_0x302eb4[_0xfa74('0x11')]]['membername'],_0x302eb4['destuniqueid']));agents[_0x302eb4['destuniqueid']][_0xfa74('0x18')]=!![];agents[_0x302eb4[_0xfa74('0x11')]][_0xfa74('0x1b')]=utils['now']();agents[_0x302eb4['destuniqueid']][_0xfa74('0x8')]=_0xfa74('0x1c');agents[_0x302eb4['destuniqueid']][_0xfa74('0x1d')]='timeout';agents[_0x302eb4[_0xfa74('0x11')]][_0xfa74('0x1e')]=_0x302eb4['ringtime']?parseInt(_0x302eb4[_0xfa74('0x1f')])/0x3e8:0x0;agents[_0x302eb4[_0xfa74('0x11')]][_0xfa74('0x20')]=0x0;unanswered[_0xfa74('0x21')](_0x302eb4['destuniqueid']);}}catch(_0xd9c55d){utils[_0xfa74('0x17')](util[_0xfa74('0x2')]('[%s][agents][agentringnoanswer]',_0x302eb4['uniqueid']),_0xd9c55d);}};exports[_0xfa74('0x22')]=function(_0x8b706e){try{_['forIn'](agents,function(_0x4b38fc,_0x343466){if(_0x4b38fc['uniqueid']==_0x8b706e[_0xfa74('0x4')]&&!_['includes'](unanswered,_0x4b38fc[_0xfa74('0x11')])){utils[_0xfa74('0x23')](util[_0xfa74('0x2')](_0xfa74('0x24'),_0x8b706e['uniqueid']),_0x8b706e);utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x25'),_0x8b706e[_0xfa74('0x4')],_0x4b38fc[_0xfa74('0x16')],_0x4b38fc[_0xfa74('0x11')]));_0x4b38fc[_0xfa74('0x18')]=!![];_0x4b38fc['agentringnoanswerAt']=utils[_0xfa74('0x14')]();_0x4b38fc['lastevent']=_0xfa74('0x26');_0x4b38fc[_0xfa74('0x1d')]=_0xfa74('0x26');_0x4b38fc[_0xfa74('0x1e')]=_0x8b706e['holdtime'];_0x4b38fc['talktime']=0x0;writeDB(_0x4b38fc);}});}catch(_0x390ed4){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x24'),_0x8b706e['uniqueid']),_0x390ed4);}};exports[_0xfa74('0x27')]=function(_0x231698){try{if(agents[_0x231698['destuniqueid']]){utils['debug'](util['format']('[%s][agents][agentconnect]',_0x231698['uniqueid']),_0x231698);utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x28'),_0x231698[_0xfa74('0x4')],agents[_0x231698[_0xfa74('0x11')]][_0xfa74('0x16')],_0x231698[_0xfa74('0x11')]));agents[_0x231698[_0xfa74('0x11')]][_0xfa74('0x29')]=utils['now']();agents[_0x231698[_0xfa74('0x11')]][_0xfa74('0x7')]=_0x231698[_0xfa74('0x7')];agents[_0x231698[_0xfa74('0x11')]][_0xfa74('0x2a')]=_0x231698[_0xfa74('0x2a')];agents[_0x231698['destuniqueid']][_0xfa74('0x1e')]=_0x231698[_0xfa74('0x1f')];agents[_0x231698[_0xfa74('0x11')]][_0xfa74('0x8')]='connect';_[_0xfa74('0x2b')](agents,function(_0x13d9a5,_0xe8491b){if(_0x13d9a5[_0xfa74('0x11')]!=_0x231698['destuniqueid']&&_0x13d9a5[_0xfa74('0x4')]==_0x231698[_0xfa74('0x4')]){_0x13d9a5[_0xfa74('0x20')]=0x0;_0x13d9a5['holdtime']=_0x231698['ringtime'];_0x13d9a5[_0xfa74('0x18')]=!![];_0x13d9a5[_0xfa74('0x1b')]=utils[_0xfa74('0x14')]();_0x13d9a5[_0xfa74('0x8')]='answered_elsewhere';_0x13d9a5[_0xfa74('0x1d')]=_0xfa74('0x2c');_0x13d9a5['answeredelsewheredestinationuniqueid']=_0x231698['destuniqueid'];_0x13d9a5['answeredelsewheremembername']=_0x231698['membername'];writeDB(_0x13d9a5);}});}}catch(_0x95c891){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x2d'),_0x231698[_0xfa74('0x4')]),_0x95c891);}};exports[_0xfa74('0x2e')]=function(_0x7735c5){try{if(!_['isNil'](agents[_0x7735c5[_0xfa74('0x11')]])){utils[_0xfa74('0x23')](util[_0xfa74('0x2')](_0xfa74('0x2f'),_0x7735c5[_0xfa74('0x4')]),_0x7735c5);utils['info'](util[_0xfa74('0x2')](_0xfa74('0x30'),_0x7735c5[_0xfa74('0x4')],agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x16')],_0x7735c5[_0xfa74('0x11')]));agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x2e')]=!![];agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x31')]=utils['now']();agents[_0x7735c5[_0xfa74('0x11')]]['talktime']=utils[_0xfa74('0x32')](agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x31')],agents[_0x7735c5[_0xfa74('0x11')]]['agentconnectAt']);agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x1d')]=_0x7735c5['reason'];agents[_0x7735c5[_0xfa74('0x11')]][_0xfa74('0x8')]='complete';writeDB(agents[_0x7735c5[_0xfa74('0x11')]]);}}catch(_0x134d95){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x2f'),_0x7735c5['uniqueid']),_0x134d95);}};exports['blindtransfer']=function(_0x36f6ca){try{if(!_[_0xfa74('0x19')](agents[_0x36f6ca['transfereruniqueid']])){utils[_0xfa74('0x23')](util[_0xfa74('0x2')](_0xfa74('0x33'),_0x36f6ca['uniqueid']),_0x36f6ca);utils['info'](util[_0xfa74('0x2')](_0xfa74('0x34'),_0x36f6ca[_0xfa74('0x4')],agents[_0x36f6ca[_0xfa74('0x35')]][_0xfa74('0x16')],agents[_0x36f6ca[_0xfa74('0x35')]][_0xfa74('0x4')]));agents[_0x36f6ca[_0xfa74('0x35')]]['transfer']=!![];agents[_0x36f6ca[_0xfa74('0x35')]][_0xfa74('0x36')]=_0xfa74('0x37');agents[_0x36f6ca[_0xfa74('0x35')]]['transferexten']=_0x36f6ca['extension'];agents[_0x36f6ca[_0xfa74('0x35')]]['transferuniqueid']=agents[_0x36f6ca[_0xfa74('0x35')]][_0xfa74('0x4')];}}catch(_0x427469){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x33'),_0x36f6ca[_0xfa74('0x4')]),_0x427469);}};exports['attendedtransfer']=function(_0x118cfc){try{utils['debug'](util[_0xfa74('0x2')]('[%s][agents][attendedtransfer]',_0x118cfc['origtransfereruniqueid']),_0x118cfc);if(_0x118cfc[_0xfa74('0x38')]==_0x118cfc[_0xfa74('0x39')]){if(!_['isNil'](agents[_0x118cfc['secondtransfereruniqueid']])){utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x3a'),_0x118cfc[_0xfa74('0x38')],agents[_0x118cfc[_0xfa74('0x3b')]][_0xfa74('0x16')]));agents[_0x118cfc[_0xfa74('0x3b')]][_0xfa74('0x3c')]=!![];agents[_0x118cfc[_0xfa74('0x3b')]][_0xfa74('0x36')]='ATTENDED';agents[_0x118cfc[_0xfa74('0x3b')]][_0xfa74('0x3d')]=_0x118cfc['origtransfererexten'];agents[_0x118cfc['secondtransfereruniqueid']][_0xfa74('0x3e')]=_0x118cfc[_0xfa74('0x38')];}if(_0x118cfc[_0xfa74('0x3f')]&&agents[_0x118cfc[_0xfa74('0x3f')]]){agents[_0x118cfc[_0xfa74('0x3f')]]['agententerreason']=0x1;transfers[_0x118cfc[_0xfa74('0x3f')]]=_['clone'](agents[_0x118cfc[_0xfa74('0x3f')]]);transfers[_0x118cfc[_0xfa74('0x3f')]][_0xfa74('0x6')]=agents[_0x118cfc['secondtransfereruniqueid']]['calleridnum'];transfers[_0x118cfc[_0xfa74('0x3f')]][_0xfa74('0x40')]=agents[_0x118cfc[_0xfa74('0x3b')]][_0xfa74('0x40')];transfers[_0x118cfc['transfereeuniqueid']][_0xfa74('0x41')]=utils[_0xfa74('0x14')]();transfers[_0x118cfc['transfereeuniqueid']][_0xfa74('0x29')]=utils[_0xfa74('0x14')]();transfers[_0x118cfc[_0xfa74('0x3f')]][_0xfa74('0x1e')]=0x0;transfers[_0x118cfc['transfereeuniqueid']][_0xfa74('0x42')]=0x2;}}else if(_0x118cfc['secondtransfereruniqueid']==_0x118cfc[_0xfa74('0x43')]){if(!_[_0xfa74('0x19')](agents[_0x118cfc[_0xfa74('0x38')]])){utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x3a'),_0x118cfc[_0xfa74('0x38')],agents[_0x118cfc[_0xfa74('0x38')]][_0xfa74('0x16')]));agents[_0x118cfc[_0xfa74('0x38')]][_0xfa74('0x3c')]=!![];agents[_0x118cfc[_0xfa74('0x38')]][_0xfa74('0x36')]=_0xfa74('0x44');agents[_0x118cfc[_0xfa74('0x38')]]['transferexten']=_0x118cfc[_0xfa74('0x45')];agents[_0x118cfc[_0xfa74('0x38')]]['transferuniqueid']=_0x118cfc['secondtransfereruniqueid'];}if(_0x118cfc[_0xfa74('0x46')]&&agents[_0x118cfc['transfertargetuniqueid']]){agents[_0x118cfc[_0xfa74('0x46')]][_0xfa74('0x42')]=0x1;transfers[_0x118cfc[_0xfa74('0x46')]]=_['clone'](agents[_0x118cfc[_0xfa74('0x46')]]);transfers[_0x118cfc['transfertargetuniqueid']]['calleridnum']=agents[_0x118cfc[_0xfa74('0x38')]][_0xfa74('0x6')];transfers[_0x118cfc[_0xfa74('0x46')]][_0xfa74('0x40')]=agents[_0x118cfc[_0xfa74('0x38')]][_0xfa74('0x40')];transfers[_0x118cfc[_0xfa74('0x46')]][_0xfa74('0x41')]=utils[_0xfa74('0x14')]();transfers[_0x118cfc[_0xfa74('0x46')]][_0xfa74('0x29')]=utils['now']();transfers[_0x118cfc[_0xfa74('0x46')]]['holdtime']=0x0;transfers[_0x118cfc[_0xfa74('0x46')]][_0xfa74('0x42')]=0x2;}}}catch(_0x15b586){utils['error'](util[_0xfa74('0x2')](_0xfa74('0x47'),_0x118cfc[_0xfa74('0x38')]),_0x15b586);}};exports['hangup']=function(_0x1b8c06){try{utils[_0xfa74('0x23')](util[_0xfa74('0x2')](_0xfa74('0x48'),_0x1b8c06[_0xfa74('0x4')]),_0x1b8c06);if(agents[_0x1b8c06['uniqueid']]&&agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x1d')]===_0xfa74('0x1c')){if(_0x1b8c06[_0xfa74('0x49')]==='21'){agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x1d')]=_0xfa74('0x4a');agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x8')]=_0xfa74('0x4a');}utils[_0xfa74('0x1')](util[_0xfa74('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1b8c06[_0xfa74('0x4')],agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x16')],agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x1d')],agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x8')]));writeDB(agents[_0x1b8c06[_0xfa74('0x4')]]);var _0x491529=unanswered[_0xfa74('0x4b')](_0x1b8c06[_0xfa74('0x4')]);if(_0x491529>-0x1){unanswered[_0xfa74('0x4c')](_0x491529,0x1);}}if(transfers[_0x1b8c06[_0xfa74('0x4')]]){transfers[_0x1b8c06['uniqueid']][_0xfa74('0x2e')]=!![];transfers[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x31')]=utils[_0xfa74('0x14')]();transfers[_0x1b8c06['uniqueid']][_0xfa74('0x20')]=utils['diffTime'](transfers[_0x1b8c06['uniqueid']][_0xfa74('0x31')],transfers[_0x1b8c06['uniqueid']][_0xfa74('0x29')]);transfers[_0x1b8c06[_0xfa74('0x4')]]['reason']='agent';transfers[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x8')]=_0xfa74('0x4d');utils[_0xfa74('0x1')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1b8c06['uniqueid'],transfers[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x16')],transfers[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x1d')],transfers[_0x1b8c06[_0xfa74('0x4')]]['lastevent']));writeDB(transfers[_0x1b8c06[_0xfa74('0x4')]],!![]);}if(agents[_0x1b8c06[_0xfa74('0x4')]]&&agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x29')]){agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x2e')]=!![];agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x31')]=utils[_0xfa74('0x14')]();agents[_0x1b8c06['uniqueid']]['talktime']=utils['diffTime'](agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x31')],agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x29')]);agents[_0x1b8c06[_0xfa74('0x4')]]['reason']=agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x3c')]?'transfer':_0xfa74('0x4e');agents[_0x1b8c06['uniqueid']][_0xfa74('0x8')]=_0xfa74('0x4d');utils[_0xfa74('0x1')](util[_0xfa74('0x2')](_0xfa74('0x4f'),_0x1b8c06[_0xfa74('0x4')],agents[_0x1b8c06[_0xfa74('0x4')]][_0xfa74('0x16')],agents[_0x1b8c06['uniqueid']]['reason'],agents[_0x1b8c06['uniqueid']][_0xfa74('0x8')]));writeDB(agents[_0x1b8c06[_0xfa74('0x4')]]);}}catch(_0x4d46e1){utils[_0xfa74('0x17')](util[_0xfa74('0x2')](_0xfa74('0x48'),_0x1b8c06[_0xfa74('0x4')]),_0x4d46e1);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 0636f65..2853385 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 _0xb7f0=['secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][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','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','execif','lastapplication','lodash','util','./utils','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','then','UserId','request','CreateVoiceCallReport','recording','debug','[%s][calls][newchannel]','linkedid','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','now','DOCUMENTATION','error','newstate','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','cause-txt','duration','diffTime','starttime','billableseconds','endtime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb7f0,0x1eb));var _0x0b7f=function(_0x2fbf2c,_0xb5a8f9){_0x2fbf2c=_0x2fbf2c-0x0;var _0x132005=_0xb7f0[_0x2fbf2c];return _0x132005;};'use strict';var _=require(_0x0b7f('0x0'));var util=require(_0x0b7f('0x1'));var utils=require(_0x0b7f('0x2'));var transfers=require(_0x0b7f('0x3'));var dispositions=['NO\x20ANSWER','FAILED',_0x0b7f('0x4'),_0x0b7f('0x5'),_0x0b7f('0x5'),_0x0b7f('0x5'),_0x0b7f('0x6'),_0x0b7f('0x7'),_0x0b7f('0x4'),_0x0b7f('0x4'),_0x0b7f('0x4')];var channels={};function writeDB(_0x36ff5c){var _0x53f9a5;if(transfers[_0x0b7f('0x8')][_0x36ff5c[_0x0b7f('0x9')]]){_0x53f9a5=_0x36ff5c['uniqueid'];_0x36ff5c[_0x0b7f('0x9')]=transfers[_0x0b7f('0x8')][_0x36ff5c['uniqueid']]['transfereeuniqueid'];}utils['info'](util[_0x0b7f('0xa')](_0x0b7f('0xb'),_0x36ff5c[_0x0b7f('0x9')],_0x36ff5c[_0x0b7f('0xc')],_0x36ff5c[_0x0b7f('0xd')],_0x36ff5c[_0x0b7f('0xe')],_0x36ff5c[_0x0b7f('0xf')],_0x36ff5c[_0x0b7f('0x10')],_0x36ff5c[_0x0b7f('0x11')],_0x36ff5c[_0x0b7f('0x12')]));if(_0x36ff5c[_0x0b7f('0x13')]){utils['getUserByInternal'](_0x36ff5c[_0x0b7f('0x13')])[_0x0b7f('0x14')](function(_0x1e3f86){if(_0x1e3f86){_0x36ff5c[_0x0b7f('0x15')]=_0x1e3f86['id'];}utils[_0x0b7f('0x16')](_0x0b7f('0x17'),_0x36ff5c);});}else{utils[_0x0b7f('0x16')](_0x0b7f('0x17'),_0x36ff5c);}if(channels[_0x36ff5c['uniqueid']]){delete channels[_0x36ff5c[_0x0b7f('0x9')]];}else if(_0x53f9a5&&channels[_0x53f9a5]){if(!transfers[_0x0b7f('0x8')][_0x53f9a5][_0x0b7f('0x18')])delete transfers[_0x0b7f('0x8')][_0x53f9a5];delete channels[_0x53f9a5];}}exports['newchannel']=function(_0x355fdd){try{utils[_0x0b7f('0x19')](util[_0x0b7f('0xa')](_0x0b7f('0x1a'),_0x355fdd[_0x0b7f('0x9')]),_0x355fdd);if(_0x355fdd['uniqueid']==_0x355fdd[_0x0b7f('0x1b')]&&_0x355fdd['channel']!='OutgoingSpoolFailed'){utils[_0x0b7f('0x1c')](util[_0x0b7f('0xa')](_0x0b7f('0x1d'),_0x355fdd[_0x0b7f('0x9')],_0x355fdd[_0x0b7f('0x1e')],_0x355fdd['exten']));channels[_0x355fdd['uniqueid']]={'uniqueid':_0x355fdd[_0x0b7f('0x9')],'accountcode':_0x355fdd[_0x0b7f('0x13')],'source':_0x355fdd[_0x0b7f('0x10')],'destination':_0x355fdd['exten'],'destinationcontext':_0x355fdd[_0x0b7f('0x1e')],'channel':_0x355fdd[_0x0b7f('0xc')],'starttime':utils[_0x0b7f('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x0b7f('0x5'),'amaflags':_0x0b7f('0x20')};}}catch(_0x44a0ae){utils[_0x0b7f('0x21')](util[_0x0b7f('0xa')](_0x0b7f('0x1a'),_0x355fdd['uniqueid']),_0x44a0ae);}};exports[_0x0b7f('0x22')]=function(_0x2ce9fa){try{utils['debug'](util['format']('[%s][calls][newstate]',_0x2ce9fa[_0x0b7f('0x9')]),_0x2ce9fa);if(!_[_0x0b7f('0x23')](channels[_0x2ce9fa['uniqueid']])&&_0x2ce9fa[_0x0b7f('0x24')]==0x6){utils[_0x0b7f('0x1c')](util[_0x0b7f('0xa')](_0x0b7f('0x25'),_0x2ce9fa[_0x0b7f('0x9')],_0x2ce9fa[_0x0b7f('0x1e')],_0x2ce9fa[_0x0b7f('0xc')]));if(_[_0x0b7f('0x23')](channels[_0x2ce9fa[_0x0b7f('0x9')]]['systemanswertime'])){channels[_0x2ce9fa['uniqueid']]['systemanswertime']=utils[_0x0b7f('0x1f')]();}}else if(!_['isNil'](channels[_0x2ce9fa[_0x0b7f('0x1b')]])&&_0x2ce9fa[_0x0b7f('0x24')]==0x6&&_0x2ce9fa[_0x0b7f('0x1e')]!=_0x0b7f('0x26')){utils[_0x0b7f('0x1c')](util[_0x0b7f('0xa')](_0x0b7f('0x27'),_0x2ce9fa['uniqueid'],_0x2ce9fa['linkedid'],_0x2ce9fa[_0x0b7f('0x1e')],_0x2ce9fa['channel']));channels[_0x2ce9fa[_0x0b7f('0x1b')]][_0x0b7f('0x13')]=_0x2ce9fa[_0x0b7f('0x13')];channels[_0x2ce9fa[_0x0b7f('0x1b')]][_0x0b7f('0x28')]=_0x2ce9fa[_0x0b7f('0xc')];if(_[_0x0b7f('0x23')](channels[_0x2ce9fa[_0x0b7f('0x1b')]][_0x0b7f('0x29')])){channels[_0x2ce9fa['linkedid']]['answertime']=utils[_0x0b7f('0x1f')]();}channels[_0x2ce9fa[_0x0b7f('0x1b')]][_0x0b7f('0x2a')]=dispositions[_[_0x0b7f('0x2b')](_0x2ce9fa[_0x0b7f('0x24')])]||_0x0b7f('0x6');}}catch(_0xf6de1b){utils[_0x0b7f('0x21')](util[_0x0b7f('0xa')]('[%s][calls][newstate]',_0x2ce9fa['uniqueid']),_0xf6de1b);}};exports[_0x0b7f('0x2c')]=function(_0x5ab2eb){try{if(!_[_0x0b7f('0x23')](channels[_0x5ab2eb['uniqueid']])){utils[_0x0b7f('0x19')](util[_0x0b7f('0xa')](_0x0b7f('0x2d'),_0x5ab2eb[_0x0b7f('0x9')]),_0x5ab2eb);if(_[_0x0b7f('0x23')](channels[_0x5ab2eb[_0x0b7f('0x9')]][_0x0b7f('0x2e')])){channels[_0x5ab2eb[_0x0b7f('0x9')]][_0x0b7f('0x2e')]=_0x5ab2eb['calleridname']+'\x20<'+_0x5ab2eb['calleridnum']+'>';}utils['info'](util[_0x0b7f('0xa')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x5ab2eb[_0x0b7f('0x9')],channels[_0x5ab2eb[_0x0b7f('0x9')]][_0x0b7f('0x2e')],_0x5ab2eb[_0x0b7f('0x2f')]));channels[_0x5ab2eb[_0x0b7f('0x9')]]['endtime']=utils[_0x0b7f('0x1f')]();channels[_0x5ab2eb[_0x0b7f('0x9')]][_0x0b7f('0x30')]=utils[_0x0b7f('0x31')](channels[_0x5ab2eb[_0x0b7f('0x9')]]['endtime'],channels[_0x5ab2eb[_0x0b7f('0x9')]][_0x0b7f('0x32')]);channels[_0x5ab2eb[_0x0b7f('0x9')]][_0x0b7f('0x33')]=channels[_0x5ab2eb[_0x0b7f('0x9')]][_0x0b7f('0x29')]?utils[_0x0b7f('0x31')](channels[_0x5ab2eb[_0x0b7f('0x9')]][_0x0b7f('0x34')],channels[_0x5ab2eb[_0x0b7f('0x9')]][_0x0b7f('0x29')]):0x0;writeDB(channels[_0x5ab2eb[_0x0b7f('0x9')]]);}}catch(_0x3de266){utils['error'](util['format'](_0x0b7f('0x2d'),_0x5ab2eb[_0x0b7f('0x9')]),_0x3de266);}};exports[_0x0b7f('0x35')]=function(_0x7a3af0){try{if(!_[_0x0b7f('0x23')](channels[_0x7a3af0[_0x0b7f('0x36')]])){utils['debug'](util[_0x0b7f('0xa')](_0x0b7f('0x37'),_0x7a3af0[_0x0b7f('0x38')]),_0x7a3af0);if(channels[_0x7a3af0[_0x0b7f('0x36')]]['channel']==_0x7a3af0[_0x0b7f('0x39')]){utils['info'](util[_0x0b7f('0xa')](_0x0b7f('0x3a'),_0x7a3af0[_0x0b7f('0x38')],_0x7a3af0[_0x0b7f('0x36')],_0x7a3af0[_0x0b7f('0x3b')]));channels[_0x7a3af0['localtwolinkedid']][_0x0b7f('0x28')]=_0x7a3af0[_0x0b7f('0x3b')];channels[_0x7a3af0[_0x0b7f('0x36')]][_0x0b7f('0x3c')]=_0x0b7f('0x3d');}else if(channels[_0x7a3af0[_0x0b7f('0x36')]][_0x0b7f('0xc')]=_0x7a3af0[_0x0b7f('0x3e')]){utils[_0x0b7f('0x1c')](util[_0x0b7f('0xa')](_0x0b7f('0x3a'),_0x7a3af0[_0x0b7f('0x38')],_0x7a3af0[_0x0b7f('0x36')],_0x7a3af0['origtransfererchannel']));channels[_0x7a3af0[_0x0b7f('0x36')]][_0x0b7f('0x28')]=_0x7a3af0[_0x0b7f('0x3f')];channels[_0x7a3af0[_0x0b7f('0x36')]][_0x0b7f('0x3c')]=_0x0b7f('0x3d');}}}catch(_0x187d71){utils['error'](util['format']('[%s][calls][attendedtransfer]',_0x7a3af0[_0x0b7f('0x38')]),_0x187d71);}};exports[_0x0b7f('0x40')]=function(_0x4a6fe0){try{if(!_[_0x0b7f('0x23')](channels[_0x4a6fe0[_0x0b7f('0x9')]])){utils['debug'](util[_0x0b7f('0xa')]('[%s][calls][musiconholdstart]',_0x4a6fe0[_0x0b7f('0x9')]),_0x4a6fe0);channels[_0x4a6fe0['uniqueid']][_0x0b7f('0x41')]=utils[_0x0b7f('0x1f')]();utils[_0x0b7f('0x1c')](util[_0x0b7f('0xa')](_0x0b7f('0x42'),_0x4a6fe0[_0x0b7f('0x9')],channels[_0x4a6fe0[_0x0b7f('0x9')]][_0x0b7f('0x41')]));}}catch(_0x21e210){utils[_0x0b7f('0x21')](util[_0x0b7f('0xa')](_0x0b7f('0x43'),_0x4a6fe0[_0x0b7f('0x9')]),_0x21e210);}};exports[_0x0b7f('0x44')]=function(_0x5a57e9){try{if(!_[_0x0b7f('0x23')](channels[_0x5a57e9[_0x0b7f('0x9')]])){utils[_0x0b7f('0x19')](util[_0x0b7f('0xa')](_0x0b7f('0x45'),_0x5a57e9[_0x0b7f('0x9')]),_0x5a57e9);if(!_['isNil'](channels[_0x5a57e9[_0x0b7f('0x9')]]['musiconholdstartAt'])){channels[_0x5a57e9['uniqueid']][_0x0b7f('0x46')]+=utils['diffTime'](utils['now'](),channels[_0x5a57e9['uniqueid']][_0x0b7f('0x41')]);utils[_0x0b7f('0x1c')](util['format']('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x5a57e9[_0x0b7f('0x9')],channels[_0x5a57e9[_0x0b7f('0x9')]][_0x0b7f('0x46')]));delete channels[_0x5a57e9[_0x0b7f('0x9')]][_0x0b7f('0x41')];}}}catch(_0xe4fd8){utils[_0x0b7f('0x21')](util['format']('[%s][calls][musiconholdstop]',_0x5a57e9['uniqueid']),_0xe4fd8);}};exports[_0x0b7f('0x47')]=function(_0x2d06de){try{if(!_[_0x0b7f('0x23')](channels[_0x2d06de[_0x0b7f('0x9')]])){utils[_0x0b7f('0x19')](util[_0x0b7f('0xa')](_0x0b7f('0x48'),_0x2d06de[_0x0b7f('0x9')]),_0x2d06de);if(!_[_0x0b7f('0x23')](_0x2d06de['variable'][_0x0b7f('0x49')])){utils['info'](util[_0x0b7f('0xa')](_0x0b7f('0x4a'),_0x2d06de['uniqueid'],_0x2d06de[_0x0b7f('0x4b')]));channels[_0x2d06de['uniqueid']]['source']=_0x2d06de[_0x0b7f('0x4b')];}if(!_[_0x0b7f('0x23')](_0x2d06de[_0x0b7f('0x4c')][_0x0b7f('0x4d')])){utils[_0x0b7f('0x1c')](util[_0x0b7f('0xa')](_0x0b7f('0x4e'),_0x2d06de[_0x0b7f('0x9')],_0x2d06de[_0x0b7f('0x4b')]));channels[_0x2d06de[_0x0b7f('0x9')]][_0x0b7f('0x4f')]=_0x2d06de[_0x0b7f('0x4b')];channels[_0x2d06de[_0x0b7f('0x9')]][_0x0b7f('0x2e')]='\x22'+_0x2d06de[_0x0b7f('0x4b')]+_0x0b7f('0x50')+_0x2d06de[_0x0b7f('0x4b')]+'>';}if(!_[_0x0b7f('0x23')](_0x2d06de[_0x0b7f('0x4c')]['xmd-callerid-preview'])||!_[_0x0b7f('0x23')](_0x2d06de[_0x0b7f('0x4c')]['xmd-callerid'])){utils[_0x0b7f('0x1c')](util[_0x0b7f('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x2d06de[_0x0b7f('0x9')],!_['isNil'](_0x2d06de[_0x0b7f('0x4c')][_0x0b7f('0x51')])?_0x0b7f('0x51'):_0x0b7f('0x52'),_0x2d06de['value']));channels[_0x2d06de[_0x0b7f('0x9')]][_0x0b7f('0x2e')]=_0x2d06de['value'];}if(!_['isNil'](_0x2d06de[_0x0b7f('0x4c')][_0x0b7f('0x53')])||!_[_0x0b7f('0x23')](_0x2d06de[_0x0b7f('0x4c')][_0x0b7f('0x54')])){utils[_0x0b7f('0x1c')](util[_0x0b7f('0xa')](_0x0b7f('0x55'),_0x2d06de[_0x0b7f('0x9')],!_[_0x0b7f('0x23')](_0x2d06de[_0x0b7f('0x4c')]['xmd-queue'])?_0x0b7f('0x53'):_0x0b7f('0x54'),_0x2d06de['value']));channels[_0x2d06de[_0x0b7f('0x9')]]['lastapplication']=_0x0b7f('0x56');channels[_0x2d06de['uniqueid']]['lastdata']=_0x2d06de['value'];channels[_0x2d06de[_0x0b7f('0x9')]]['queue']=!![];}if(!_['isNil'](_0x2d06de[_0x0b7f('0x4c')][_0x0b7f('0x57')])){utils[_0x0b7f('0x1c')](util[_0x0b7f('0xa')](_0x0b7f('0x58'),_0x2d06de[_0x0b7f('0x9')],_0x2d06de[_0x0b7f('0x4b')]));channels[_0x2d06de[_0x0b7f('0x9')]][_0x0b7f('0x59')]=_0x2d06de[_0x0b7f('0x4b')];}if(!_[_0x0b7f('0x23')](_0x2d06de[_0x0b7f('0x4c')][_0x0b7f('0x5a')])){utils['info'](util[_0x0b7f('0xa')](_0x0b7f('0x5b'),_0x2d06de[_0x0b7f('0x9')],_0x2d06de[_0x0b7f('0x4b')]));channels[_0x2d06de[_0x0b7f('0x9')]][_0x0b7f('0x5c')]=_0x2d06de[_0x0b7f('0x4b')];}if(!_['isNil'](_0x2d06de[_0x0b7f('0x4c')][_0x0b7f('0x5d')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x2d06de['uniqueid'],_0x2d06de[_0x0b7f('0x4b')]));channels[_0x2d06de[_0x0b7f('0x9')]][_0x0b7f('0x5e')]=_0x2d06de[_0x0b7f('0x4b')];}if(!_[_0x0b7f('0x23')](_0x2d06de[_0x0b7f('0x4c')]['sipcallid'])){utils['info'](util[_0x0b7f('0xa')](_0x0b7f('0x5f'),_0x2d06de[_0x0b7f('0x9')],_0x2d06de[_0x0b7f('0x4b')]));channels[_0x2d06de['uniqueid']]['sipcallid']=_0x2d06de[_0x0b7f('0x4b')];}}}catch(_0x2125ff){utils[_0x0b7f('0x21')](util[_0x0b7f('0xa')](_0x0b7f('0x48'),_0x2d06de[_0x0b7f('0x9')]),_0x2125ff);}};exports[_0x0b7f('0x60')]=function(_0xd7aae9){try{if(!_[_0x0b7f('0x23')](channels[_0xd7aae9[_0x0b7f('0x9')]])){utils[_0x0b7f('0x19')](util[_0x0b7f('0xa')]('[%s][calls][newexten]',_0xd7aae9['uniqueid']),_0xd7aae9);utils[_0x0b7f('0x1c')](util['format']('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0xd7aae9['uniqueid'],_0xd7aae9[_0x0b7f('0x61')],_0xd7aae9[_0x0b7f('0x62')]));if(_0xd7aae9['application'][_0x0b7f('0x63')]()==_0x0b7f('0x64')&&_[_0x0b7f('0x65')](_0xd7aae9[_0x0b7f('0x62')][_0x0b7f('0x63')](),_0x0b7f('0x66'))){var _0x1216bc=_0xd7aae9[_0x0b7f('0x62')][_0x0b7f('0x67')]('=');var _0x1debb5=_0x1216bc[0x0][_0x0b7f('0x68')](_0x1216bc[0x0][_0x0b7f('0x69')]('(')+0x1,_0x1216bc[0x0][_0x0b7f('0x69')](')'));var _0x37c72b=_0x1216bc[0x1];channels[_0xd7aae9[_0x0b7f('0x9')]][_0x1debb5]=_0x37c72b;}if(!_[_0x0b7f('0x6a')]([_0x0b7f('0x2c'),_0x0b7f('0x6b'),_0x0b7f('0x6c'),'set','gotoif'],_0xd7aae9[_0x0b7f('0x61')][_0x0b7f('0x63')]())){channels[_0xd7aae9[_0x0b7f('0x9')]][_0x0b7f('0x6d')]=_0xd7aae9['application'];channels[_0xd7aae9[_0x0b7f('0x9')]]['lastdata']=_0xd7aae9[_0x0b7f('0x62')];}}}catch(_0x4ac551){utils[_0x0b7f('0x21')](util[_0x0b7f('0xa')]('[%s][calls][newexten]',_0xd7aae9[_0x0b7f('0x9')]),_0x4ac551);}}; \ No newline at end of file +var _0x3e9c=['includes','noop','execif','gotoif','lastapplication','lastdata','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','accountcode','UserId','CreateVoiceCallReport','request','debug','format','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','[%s][calls][newstate]','isNil','channelstate','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','billableseconds','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][calls][musiconholdstop]','mohtime','variable','[%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','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','[%s][calls][newexten]','application','appdata','toLowerCase','set','split','substring','lastIndexOf'];(function(_0x390733,_0x1e3d32){var _0x33beb9=function(_0x4491a3){while(--_0x4491a3){_0x390733['push'](_0x390733['shift']());}};_0x33beb9(++_0x1e3d32);}(_0x3e9c,0x6f));var _0xc3e9=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x3e9c[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xc3e9('0x0'));var util=require(_0xc3e9('0x1'));var utils=require(_0xc3e9('0x2'));var transfers=require(_0xc3e9('0x3'));var dispositions=[_0xc3e9('0x4'),_0xc3e9('0x5'),_0xc3e9('0x5'),_0xc3e9('0x4'),_0xc3e9('0x4'),_0xc3e9('0x4'),_0xc3e9('0x6'),_0xc3e9('0x7'),_0xc3e9('0x5'),_0xc3e9('0x5'),_0xc3e9('0x5')];var channels={};function writeDB(_0x27eaf3){var _0x219e7a;if(transfers[_0xc3e9('0x8')][_0x27eaf3['uniqueid']]){_0x219e7a=_0x27eaf3[_0xc3e9('0x9')];_0x27eaf3[_0xc3e9('0x9')]=transfers[_0xc3e9('0x8')][_0x27eaf3[_0xc3e9('0x9')]]['transfereeuniqueid'];}utils[_0xc3e9('0xa')](util['format'](_0xc3e9('0xb'),_0x27eaf3[_0xc3e9('0x9')],_0x27eaf3[_0xc3e9('0xc')],_0x27eaf3[_0xc3e9('0xd')],_0x27eaf3[_0xc3e9('0xe')],_0x27eaf3[_0xc3e9('0xf')],_0x27eaf3[_0xc3e9('0x10')],_0x27eaf3[_0xc3e9('0x11')],_0x27eaf3['lastevent']));if(_0x27eaf3[_0xc3e9('0x12')]){utils['getUserByInternal'](_0x27eaf3[_0xc3e9('0x12')])['then'](function(_0x3d9771){if(_0x3d9771){_0x27eaf3[_0xc3e9('0x13')]=_0x3d9771['id'];}utils['request'](_0xc3e9('0x14'),_0x27eaf3);});}else{utils[_0xc3e9('0x15')](_0xc3e9('0x14'),_0x27eaf3);}if(channels[_0x27eaf3[_0xc3e9('0x9')]]){delete channels[_0x27eaf3['uniqueid']];}else if(_0x219e7a&&channels[_0x219e7a]){if(!transfers[_0xc3e9('0x8')][_0x219e7a]['recording'])delete transfers[_0xc3e9('0x8')][_0x219e7a];delete channels[_0x219e7a];}}exports['newchannel']=function(_0x2c1e22){try{utils[_0xc3e9('0x16')](util[_0xc3e9('0x17')](_0xc3e9('0x18'),_0x2c1e22[_0xc3e9('0x9')]),_0x2c1e22);if(_0x2c1e22[_0xc3e9('0x9')]==_0x2c1e22[_0xc3e9('0x19')]&&_0x2c1e22[_0xc3e9('0xc')]!=_0xc3e9('0x1a')){utils[_0xc3e9('0xa')](util[_0xc3e9('0x17')](_0xc3e9('0x1b'),_0x2c1e22[_0xc3e9('0x9')],_0x2c1e22[_0xc3e9('0x1c')],_0x2c1e22['exten']));channels[_0x2c1e22[_0xc3e9('0x9')]]={'uniqueid':_0x2c1e22[_0xc3e9('0x9')],'accountcode':_0x2c1e22['accountcode'],'source':_0x2c1e22[_0xc3e9('0x10')],'destination':_0x2c1e22[_0xc3e9('0x1d')],'destinationcontext':_0x2c1e22[_0xc3e9('0x1c')],'channel':_0x2c1e22[_0xc3e9('0xc')],'starttime':utils[_0xc3e9('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xc3e9('0x4'),'amaflags':_0xc3e9('0x1f')};}}catch(_0x9908f5){utils[_0xc3e9('0x20')](util['format'](_0xc3e9('0x18'),_0x2c1e22[_0xc3e9('0x9')]),_0x9908f5);}};exports['newstate']=function(_0x53160a){try{utils[_0xc3e9('0x16')](util['format'](_0xc3e9('0x21'),_0x53160a[_0xc3e9('0x9')]),_0x53160a);if(!_[_0xc3e9('0x22')](channels[_0x53160a[_0xc3e9('0x9')]])&&_0x53160a[_0xc3e9('0x23')]==0x6){utils[_0xc3e9('0xa')](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x53160a[_0xc3e9('0x9')],_0x53160a[_0xc3e9('0x1c')],_0x53160a['channel']));if(_[_0xc3e9('0x22')](channels[_0x53160a[_0xc3e9('0x9')]][_0xc3e9('0x24')])){channels[_0x53160a[_0xc3e9('0x9')]][_0xc3e9('0x24')]=utils[_0xc3e9('0x1e')]();}}else if(!_['isNil'](channels[_0x53160a[_0xc3e9('0x19')]])&&_0x53160a[_0xc3e9('0x23')]==0x6&&_0x53160a['context']!=_0xc3e9('0x25')){utils[_0xc3e9('0xa')](util[_0xc3e9('0x17')](_0xc3e9('0x26'),_0x53160a['uniqueid'],_0x53160a[_0xc3e9('0x19')],_0x53160a[_0xc3e9('0x1c')],_0x53160a[_0xc3e9('0xc')]));channels[_0x53160a[_0xc3e9('0x19')]][_0xc3e9('0x12')]=_0x53160a[_0xc3e9('0x12')];channels[_0x53160a[_0xc3e9('0x19')]][_0xc3e9('0x27')]=_0x53160a[_0xc3e9('0xc')];if(_[_0xc3e9('0x22')](channels[_0x53160a[_0xc3e9('0x19')]][_0xc3e9('0x28')])){channels[_0x53160a[_0xc3e9('0x19')]][_0xc3e9('0x28')]=utils[_0xc3e9('0x1e')]();}channels[_0x53160a[_0xc3e9('0x19')]][_0xc3e9('0x29')]=dispositions[_[_0xc3e9('0x2a')](_0x53160a[_0xc3e9('0x23')])]||'ANSWERED';}}catch(_0x4f1076){utils['error'](util['format'](_0xc3e9('0x21'),_0x53160a[_0xc3e9('0x9')]),_0x4f1076);}};exports[_0xc3e9('0x2b')]=function(_0x1f136f){try{if(!_[_0xc3e9('0x22')](channels[_0x1f136f[_0xc3e9('0x9')]])){utils[_0xc3e9('0x16')](util['format'](_0xc3e9('0x2c'),_0x1f136f[_0xc3e9('0x9')]),_0x1f136f);if(_['isNil'](channels[_0x1f136f[_0xc3e9('0x9')]][_0xc3e9('0x2d')])){channels[_0x1f136f['uniqueid']][_0xc3e9('0x2d')]=_0x1f136f[_0xc3e9('0x2e')]+'\x20<'+_0x1f136f[_0xc3e9('0x10')]+'>';}utils[_0xc3e9('0xa')](util[_0xc3e9('0x17')](_0xc3e9('0x2f'),_0x1f136f[_0xc3e9('0x9')],channels[_0x1f136f[_0xc3e9('0x9')]][_0xc3e9('0x2d')],_0x1f136f[_0xc3e9('0x30')]));channels[_0x1f136f['uniqueid']][_0xc3e9('0x31')]=utils[_0xc3e9('0x1e')]();channels[_0x1f136f[_0xc3e9('0x9')]][_0xc3e9('0x32')]=utils[_0xc3e9('0x33')](channels[_0x1f136f[_0xc3e9('0x9')]][_0xc3e9('0x31')],channels[_0x1f136f[_0xc3e9('0x9')]]['starttime']);channels[_0x1f136f['uniqueid']][_0xc3e9('0x34')]=channels[_0x1f136f[_0xc3e9('0x9')]][_0xc3e9('0x28')]?utils[_0xc3e9('0x33')](channels[_0x1f136f[_0xc3e9('0x9')]][_0xc3e9('0x31')],channels[_0x1f136f['uniqueid']][_0xc3e9('0x28')]):0x0;writeDB(channels[_0x1f136f[_0xc3e9('0x9')]]);}}catch(_0x520b72){utils[_0xc3e9('0x20')](util[_0xc3e9('0x17')]('[%s][calls][hangup]',_0x1f136f[_0xc3e9('0x9')]),_0x520b72);}};exports[_0xc3e9('0x35')]=function(_0xa02001){try{if(!_['isNil'](channels[_0xa02001['localtwolinkedid']])){utils['debug'](util[_0xc3e9('0x17')](_0xc3e9('0x36'),_0xa02001[_0xc3e9('0x37')]),_0xa02001);if(channels[_0xa02001[_0xc3e9('0x38')]][_0xc3e9('0xc')]==_0xa02001[_0xc3e9('0x39')]){utils['info'](util[_0xc3e9('0x17')](_0xc3e9('0x3a'),_0xa02001['origtransfereruniqueid'],_0xa02001['localtwolinkedid'],_0xa02001[_0xc3e9('0x3b')]));channels[_0xa02001[_0xc3e9('0x38')]]['destinationchannel']=_0xa02001[_0xc3e9('0x3b')];channels[_0xa02001[_0xc3e9('0x38')]]['userfield']=_0xc3e9('0x3c');}else if(channels[_0xa02001[_0xc3e9('0x38')]][_0xc3e9('0xc')]=_0xa02001[_0xc3e9('0x3d')]){utils[_0xc3e9('0xa')](util[_0xc3e9('0x17')](_0xc3e9('0x3a'),_0xa02001[_0xc3e9('0x37')],_0xa02001[_0xc3e9('0x38')],_0xa02001[_0xc3e9('0x3e')]));channels[_0xa02001['localtwolinkedid']][_0xc3e9('0x27')]=_0xa02001['origtransfererchannel'];channels[_0xa02001[_0xc3e9('0x38')]]['userfield']=_0xc3e9('0x3c');}}}catch(_0x2865bb){utils[_0xc3e9('0x20')](util['format'](_0xc3e9('0x36'),_0xa02001['origtransfereruniqueid']),_0x2865bb);}};exports[_0xc3e9('0x3f')]=function(_0x1eb267){try{if(!_[_0xc3e9('0x22')](channels[_0x1eb267[_0xc3e9('0x9')]])){utils[_0xc3e9('0x16')](util['format'](_0xc3e9('0x40'),_0x1eb267[_0xc3e9('0x9')]),_0x1eb267);channels[_0x1eb267[_0xc3e9('0x9')]]['musiconholdstartAt']=utils[_0xc3e9('0x1e')]();utils[_0xc3e9('0xa')](util['format'](_0xc3e9('0x41'),_0x1eb267[_0xc3e9('0x9')],channels[_0x1eb267[_0xc3e9('0x9')]][_0xc3e9('0x42')]));}}catch(_0x1771f0){utils['error'](util['format'](_0xc3e9('0x40'),_0x1eb267[_0xc3e9('0x9')]),_0x1771f0);}};exports['musiconholdstop']=function(_0x496f7c){try{if(!_[_0xc3e9('0x22')](channels[_0x496f7c[_0xc3e9('0x9')]])){utils[_0xc3e9('0x16')](util[_0xc3e9('0x17')](_0xc3e9('0x43'),_0x496f7c[_0xc3e9('0x9')]),_0x496f7c);if(!_['isNil'](channels[_0x496f7c[_0xc3e9('0x9')]][_0xc3e9('0x42')])){channels[_0x496f7c[_0xc3e9('0x9')]][_0xc3e9('0x44')]+=utils[_0xc3e9('0x33')](utils[_0xc3e9('0x1e')](),channels[_0x496f7c[_0xc3e9('0x9')]][_0xc3e9('0x42')]);utils['info'](util[_0xc3e9('0x17')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x496f7c['uniqueid'],channels[_0x496f7c['uniqueid']][_0xc3e9('0x44')]));delete channels[_0x496f7c[_0xc3e9('0x9')]][_0xc3e9('0x42')];}}}catch(_0x2f104a){utils['error'](util['format']('[%s][calls][musiconholdstop]',_0x496f7c[_0xc3e9('0x9')]),_0x2f104a);}};exports['varset']=function(_0x893462){try{if(!_[_0xc3e9('0x22')](channels[_0x893462[_0xc3e9('0x9')]])){utils[_0xc3e9('0x16')](util['format']('[%s][calls][varset]',_0x893462[_0xc3e9('0x9')]),_0x893462);if(!_[_0xc3e9('0x22')](_0x893462[_0xc3e9('0x45')]['xmd-originatecalleridnum'])){utils[_0xc3e9('0xa')](util[_0xc3e9('0x17')](_0xc3e9('0x46'),_0x893462['uniqueid'],_0x893462[_0xc3e9('0x47')]));channels[_0x893462[_0xc3e9('0x9')]][_0xc3e9('0x48')]=_0x893462[_0xc3e9('0x47')];}if(!_[_0xc3e9('0x22')](_0x893462[_0xc3e9('0x45')][_0xc3e9('0x49')])){utils[_0xc3e9('0xa')](util['format'](_0xc3e9('0x4a'),_0x893462[_0xc3e9('0x9')],_0x893462['value']));channels[_0x893462[_0xc3e9('0x9')]][_0xc3e9('0x4b')]=_0x893462[_0xc3e9('0x47')];channels[_0x893462[_0xc3e9('0x9')]][_0xc3e9('0x2d')]='\x22'+_0x893462['value']+_0xc3e9('0x4c')+_0x893462[_0xc3e9('0x47')]+'>';}if(!_[_0xc3e9('0x22')](_0x893462['variable'][_0xc3e9('0x4d')])||!_[_0xc3e9('0x22')](_0x893462[_0xc3e9('0x45')][_0xc3e9('0x4e')])){utils[_0xc3e9('0xa')](util['format'](_0xc3e9('0x4f'),_0x893462['uniqueid'],!_[_0xc3e9('0x22')](_0x893462[_0xc3e9('0x45')][_0xc3e9('0x4d')])?_0xc3e9('0x4d'):_0xc3e9('0x4e'),_0x893462[_0xc3e9('0x47')]));channels[_0x893462['uniqueid']][_0xc3e9('0x2d')]=_0x893462[_0xc3e9('0x47')];}if(!_[_0xc3e9('0x22')](_0x893462[_0xc3e9('0x45')][_0xc3e9('0x50')])||!_['isNil'](_0x893462['variable'][_0xc3e9('0x51')])){utils[_0xc3e9('0xa')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x893462[_0xc3e9('0x9')],!_[_0xc3e9('0x22')](_0x893462[_0xc3e9('0x45')]['xmd-queue'])?_0xc3e9('0x50'):_0xc3e9('0x51'),_0x893462[_0xc3e9('0x47')]));channels[_0x893462[_0xc3e9('0x9')]]['lastapplication']='Queue';channels[_0x893462[_0xc3e9('0x9')]]['lastdata']=_0x893462[_0xc3e9('0x47')];channels[_0x893462['uniqueid']]['queue']=!![];}if(!_[_0xc3e9('0x22')](_0x893462['variable'][_0xc3e9('0x52')])){utils[_0xc3e9('0xa')](util[_0xc3e9('0x17')](_0xc3e9('0x53'),_0x893462['uniqueid'],_0x893462['value']));channels[_0x893462[_0xc3e9('0x9')]][_0xc3e9('0x54')]=_0x893462[_0xc3e9('0x47')];}if(!_['isNil'](_0x893462[_0xc3e9('0x45')][_0xc3e9('0x55')])){utils['info'](util[_0xc3e9('0x17')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x893462[_0xc3e9('0x9')],_0x893462['value']));channels[_0x893462[_0xc3e9('0x9')]][_0xc3e9('0x56')]=_0x893462[_0xc3e9('0x47')];}if(!_[_0xc3e9('0x22')](_0x893462[_0xc3e9('0x45')]['outboundrouteid'])){utils[_0xc3e9('0xa')](util[_0xc3e9('0x17')](_0xc3e9('0x57'),_0x893462['uniqueid'],_0x893462[_0xc3e9('0x47')]));channels[_0x893462[_0xc3e9('0x9')]][_0xc3e9('0x58')]=_0x893462[_0xc3e9('0x47')];}if(!_[_0xc3e9('0x22')](_0x893462[_0xc3e9('0x45')]['sipcallid'])){utils['info'](util[_0xc3e9('0x17')](_0xc3e9('0x59'),_0x893462[_0xc3e9('0x9')],_0x893462['value']));channels[_0x893462[_0xc3e9('0x9')]]['sipcallid']=_0x893462[_0xc3e9('0x47')];}}}catch(_0x582b72){utils[_0xc3e9('0x20')](util['format'](_0xc3e9('0x5a'),_0x893462[_0xc3e9('0x9')]),_0x582b72);}};exports['newexten']=function(_0x7292de){try{if(!_[_0xc3e9('0x22')](channels[_0x7292de[_0xc3e9('0x9')]])){utils[_0xc3e9('0x16')](util[_0xc3e9('0x17')](_0xc3e9('0x5b'),_0x7292de[_0xc3e9('0x9')]),_0x7292de);utils['info'](util['format']('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x7292de[_0xc3e9('0x9')],_0x7292de[_0xc3e9('0x5c')],_0x7292de[_0xc3e9('0x5d')]));if(_0x7292de[_0xc3e9('0x5c')][_0xc3e9('0x5e')]()==_0xc3e9('0x5f')&&_['startsWith'](_0x7292de['appdata']['toLowerCase'](),'cdr')){var _0x3aa963=_0x7292de[_0xc3e9('0x5d')][_0xc3e9('0x60')]('=');var _0x33976e=_0x3aa963[0x0][_0xc3e9('0x61')](_0x3aa963[0x0]['lastIndexOf']('(')+0x1,_0x3aa963[0x0][_0xc3e9('0x62')](')'));var _0x1cb10b=_0x3aa963[0x1];channels[_0x7292de[_0xc3e9('0x9')]][_0x33976e]=_0x1cb10b;}if(!_[_0xc3e9('0x63')]([_0xc3e9('0x2b'),_0xc3e9('0x64'),_0xc3e9('0x65'),_0xc3e9('0x5f'),_0xc3e9('0x66')],_0x7292de[_0xc3e9('0x5c')][_0xc3e9('0x5e')]())){channels[_0x7292de[_0xc3e9('0x9')]][_0xc3e9('0x67')]=_0x7292de[_0xc3e9('0x5c')];channels[_0x7292de[_0xc3e9('0x9')]][_0xc3e9('0x68')]=_0x7292de[_0xc3e9('0x5d')];}}}catch(_0x2c2453){utils[_0xc3e9('0x20')](util[_0xc3e9('0x17')]('[%s][calls][newexten]',_0x7292de['uniqueid']),_0x2c2453);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 0f17b51..02ff21a 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 _0xb129=['managerevent','connect','shutdown','info','[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xb129,0x1eb));var _0x9b12=function(_0x2b816c,_0x8ff259){_0x2b816c=_0x2b816c-0x0;var _0x335d20=_0xb129[_0x2b816c];return _0x335d20;};'use strict';var utils=require('./utils');exports[_0x9b12('0x0')]=function(){utils['info']('[core]\x20connected');};exports[_0x9b12('0x1')]=function(){utils[_0x9b12('0x2')](_0x9b12('0x3'));};exports['fullybooted']=function(){utils[_0x9b12('0x2')](_0x9b12('0x4'));};exports[_0x9b12('0x5')]=function(_0x7fd9bf){utils[_0x9b12('0x5')](_0x9b12('0x6'),_0x7fd9bf);};exports[_0x9b12('0x7')]=function(){utils[_0x9b12('0x2')](_0x9b12('0x8'));};exports[_0x9b12('0x9')]=function(_0x517203){}; \ No newline at end of file +var _0xec56=['[core]\x20shutdown','fullybooted','error','[core]\x20close','managerevent','info','[core]\x20connected','shutdown'];(function(_0x4edfec,_0x581a4a){var _0x22c10b=function(_0x6c3054){while(--_0x6c3054){_0x4edfec['push'](_0x4edfec['shift']());}};_0x22c10b(++_0x581a4a);}(_0xec56,0x11d));var _0x6ec5=function(_0x43ae8f,_0x53b6df){_0x43ae8f=_0x43ae8f-0x0;var _0x334aa0=_0xec56[_0x43ae8f];return _0x334aa0;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0x6ec5('0x0')](_0x6ec5('0x1'));};exports[_0x6ec5('0x2')]=function(){utils[_0x6ec5('0x0')](_0x6ec5('0x3'));};exports[_0x6ec5('0x4')]=function(){utils[_0x6ec5('0x0')]('[core]\x20fullybooted');};exports['error']=function(_0x8c1f80){utils[_0x6ec5('0x5')]('[core]\x20error',_0x8c1f80);};exports['close']=function(){utils[_0x6ec5('0x0')](_0x6ec5('0x6'));};exports[_0x6ec5('0x7')]=function(_0x15909d){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 87b6492..132bbce 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 _0x0705=['error','dialstatus','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','./utils','info','format','uniqueid','dialstring','calleridnum','connectedlinenum','request','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','startsWith','cdr(routeid)','split','varset','[%s][dials][varset]','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','isNil','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called'];(function(_0x7abd7,_0x1ca3f9){var _0x3a2577=function(_0x18456d){while(--_0x18456d){_0x7abd7['push'](_0x7abd7['shift']());}};_0x3a2577(++_0x1ca3f9);}(_0x0705,0xd5));var _0x5070=function(_0x4d3329,_0x53e55b){_0x4d3329=_0x4d3329-0x0;var _0x3abb35=_0x0705[_0x4d3329];return _0x3abb35;};'use strict';var _=require(_0x5070('0x0'));var util=require('util');var utils=require(_0x5070('0x1'));var dials={};function writeDB(_0x42cc46){utils[_0x5070('0x2')](util[_0x5070('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x42cc46[_0x5070('0x4')],_0x42cc46['channel'],_0x42cc46[_0x5070('0x5')],_0x42cc46[_0x5070('0x6')],_0x42cc46[_0x5070('0x7')],_0x42cc46['dialstatus']));utils[_0x5070('0x8')]('CreateVoiceDialReport',_0x42cc46);delete dials[_0x42cc46[_0x5070('0x4')]];}exports['newexten']=function(_0x15d09e){try{utils[_0x5070('0x9')](util[_0x5070('0x3')](_0x5070('0xa'),_0x15d09e[_0x5070('0x4')]),_0x15d09e);utils[_0x5070('0x2')](util[_0x5070('0x3')](_0x5070('0xb'),_0x15d09e[_0x5070('0x4')],_0x15d09e['application'],_0x15d09e[_0x5070('0xc')]));if(_0x15d09e[_0x5070('0xd')]['toLowerCase']()==_0x5070('0xe')&&_[_0x5070('0xf')](_0x15d09e['appdata']['toLowerCase'](),_0x5070('0x10'))){var _0x22e044=_0x15d09e[_0x5070('0xc')][_0x5070('0x11')]('=');dials[_0x15d09e[_0x5070('0x4')]]={'routeId':_0x22e044[0x1]};}}catch(_0x33b492){utils['error'](util[_0x5070('0x3')](_0x5070('0xa'),_0x15d09e[_0x5070('0x4')]),_0x33b492);}};exports[_0x5070('0x12')]=function(_0x570089){try{utils['debug'](util[_0x5070('0x3')](_0x5070('0x13'),_0x570089[_0x5070('0x4')]),_0x570089);if(!_['isNil'](_0x570089['variable'][_0x5070('0x14')])){utils['info'](util['format'](_0x5070('0x15'),_0x570089[_0x5070('0x4')],_0x570089[_0x5070('0x16')]));dials[_0x570089[_0x5070('0x4')]]={'routeId':_0x570089[_0x5070('0x16')]};}}catch(_0x3d72f7){utils['error'](util[_0x5070('0x3')](_0x5070('0x13'),_0x570089[_0x5070('0x4')]),_0x3d72f7);}};exports[_0x5070('0x17')]=function(_0x469614){try{if(!_[_0x5070('0x18')](dials[_0x469614['uniqueid']])){utils[_0x5070('0x9')](util[_0x5070('0x3')](_0x5070('0x19'),_0x469614[_0x5070('0x4')]),_0x469614);dials[_0x469614[_0x5070('0x4')]]=_[_0x5070('0x1a')](dials[_0x469614[_0x5070('0x4')]],_0x469614);dials[_0x469614['uniqueid']][_0x5070('0x1b')]=utils[_0x5070('0x1c')]();dials[_0x469614[_0x5070('0x4')]][_0x5070('0x1d')]=_0x5070('0x1e');utils[_0x5070('0x2')](util['format'](_0x5070('0x1f'),_0x469614[_0x5070('0x4')],dials[_0x469614[_0x5070('0x4')]][_0x5070('0x1b')]));}}catch(_0x366efc){utils[_0x5070('0x20')](util[_0x5070('0x3')]('[%s][dials][dialbegin]',_0x469614['uniqueid']),_0x366efc);}};exports['dialend']=function(_0x1df8bb){try{if(!_[_0x5070('0x18')](dials[_0x1df8bb['uniqueid']])){utils[_0x5070('0x9')](util['format']('[%s][dials][dialend]',_0x1df8bb[_0x5070('0x4')]),_0x1df8bb);dials[_0x1df8bb[_0x5070('0x4')]][_0x5070('0x21')]=_0x1df8bb[_0x5070('0x21')];if(_0x1df8bb[_0x5070('0x21')]=='ANSWER'){dials[_0x1df8bb[_0x5070('0x4')]]=_[_0x5070('0x1a')](dials[_0x1df8bb[_0x5070('0x4')]],_0x1df8bb);dials[_0x1df8bb[_0x5070('0x4')]]['answertime']=utils['now']();dials[_0x1df8bb['uniqueid']][_0x5070('0x1d')]=_0x5070('0x22');utils[_0x5070('0x2')](util[_0x5070('0x3')](_0x5070('0x23'),_0x1df8bb[_0x5070('0x4')],_0x1df8bb['dialstatus'],dials[_0x1df8bb[_0x5070('0x4')]][_0x5070('0x24')]));}else{utils['info'](util[_0x5070('0x3')](_0x5070('0x25'),_0x1df8bb[_0x5070('0x4')],_0x1df8bb[_0x5070('0x21')]));}}}catch(_0x184631){utils[_0x5070('0x20')](util['format'](_0x5070('0x26'),_0x1df8bb[_0x5070('0x4')]),_0x184631);}};exports[_0x5070('0x27')]=function(_0x59e034){try{if(!_['isNil'](dials[_0x59e034['uniqueid']])){utils['debug'](util[_0x5070('0x3')](_0x5070('0x28'),_0x59e034['uniqueid']),_0x59e034);utils[_0x5070('0x2')](util['format'](_0x5070('0x29'),_0x59e034[_0x5070('0x4')],_0x59e034['calleridnum'],_0x59e034['calleridname'],_0x59e034[_0x5070('0x2a')]));dials[_0x59e034[_0x5070('0x4')]]=_[_0x5070('0x1a')](dials[_0x59e034[_0x5070('0x4')]],{'endtime':utils[_0x5070('0x1c')](),'lastevent':_0x5070('0x2b')});dials[_0x59e034[_0x5070('0x4')]][_0x5070('0x2c')]=utils[_0x5070('0x2d')](dials[_0x59e034[_0x5070('0x4')]][_0x5070('0x2e')],dials[_0x59e034['uniqueid']]['starttime']);dials[_0x59e034[_0x5070('0x4')]][_0x5070('0x2f')]=utils['diffTime'](dials[_0x59e034['uniqueid']][_0x5070('0x24')]||dials[_0x59e034[_0x5070('0x4')]]['endtime'],dials[_0x59e034[_0x5070('0x4')]][_0x5070('0x1b')]);dials[_0x59e034[_0x5070('0x4')]][_0x5070('0x30')]=dials[_0x59e034['uniqueid']]['answertime']?utils[_0x5070('0x2d')](dials[_0x59e034[_0x5070('0x4')]][_0x5070('0x2e')],dials[_0x59e034[_0x5070('0x4')]][_0x5070('0x24')]):0x0;writeDB(dials[_0x59e034[_0x5070('0x4')]]);}}catch(_0x545006){utils[_0x5070('0x20')](util[_0x5070('0x3')](_0x5070('0x28'),_0x59e034[_0x5070('0x4')]),_0x545006);}}; \ No newline at end of file +var _0x5580=['calleridnum','connectedlinenum','dialstatus','request','uniqueid','debug','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','error','[%s][dials][varset]','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','isNil','assign','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','ANSWER','lastevent','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','[%s][dials][hangup]','lodash','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','dialstring'];(function(_0x5503ef,_0x3539e5){var _0x134a35=function(_0x415981){while(--_0x415981){_0x5503ef['push'](_0x5503ef['shift']());}};_0x134a35(++_0x3539e5);}(_0x5580,0x15b));var _0x0558=function(_0x265ce1,_0x1ba6fe){_0x265ce1=_0x265ce1-0x0;var _0xa836dd=_0x5580[_0x265ce1];return _0xa836dd;};'use strict';var _=require(_0x0558('0x0'));var util=require('util');var utils=require(_0x0558('0x1'));var dials={};function writeDB(_0x498956){utils[_0x0558('0x2')](util['format'](_0x0558('0x3'),_0x498956['uniqueid'],_0x498956['channel'],_0x498956[_0x0558('0x4')],_0x498956[_0x0558('0x5')],_0x498956[_0x0558('0x6')],_0x498956[_0x0558('0x7')]));utils[_0x0558('0x8')]('CreateVoiceDialReport',_0x498956);delete dials[_0x498956[_0x0558('0x9')]];}exports['newexten']=function(_0x1b1d14){try{utils[_0x0558('0xa')](util[_0x0558('0xb')](_0x0558('0xc'),_0x1b1d14[_0x0558('0x9')]),_0x1b1d14);utils[_0x0558('0x2')](util['format'](_0x0558('0xd'),_0x1b1d14[_0x0558('0x9')],_0x1b1d14[_0x0558('0xe')],_0x1b1d14[_0x0558('0xf')]));if(_0x1b1d14[_0x0558('0xe')][_0x0558('0x10')]()==_0x0558('0x11')&&_[_0x0558('0x12')](_0x1b1d14[_0x0558('0xf')][_0x0558('0x10')](),_0x0558('0x13'))){var _0x18db3d=_0x1b1d14['appdata']['split']('=');dials[_0x1b1d14[_0x0558('0x9')]]={'routeId':_0x18db3d[0x1]};}}catch(_0x4a6686){utils[_0x0558('0x14')](util[_0x0558('0xb')](_0x0558('0xc'),_0x1b1d14[_0x0558('0x9')]),_0x4a6686);}};exports['varset']=function(_0x155311){try{utils[_0x0558('0xa')](util[_0x0558('0xb')](_0x0558('0x15'),_0x155311[_0x0558('0x9')]),_0x155311);if(!_['isNil'](_0x155311['variable']['outboundrouteid'])){utils[_0x0558('0x2')](util['format'](_0x0558('0x16'),_0x155311['uniqueid'],_0x155311[_0x0558('0x17')]));dials[_0x155311[_0x0558('0x9')]]={'routeId':_0x155311[_0x0558('0x17')]};}}catch(_0x75909e){utils['error'](util['format'](_0x0558('0x15'),_0x155311[_0x0558('0x9')]),_0x75909e);}};exports['dialbegin']=function(_0x1421b3){try{if(!_[_0x0558('0x18')](dials[_0x1421b3[_0x0558('0x9')]])){utils['debug'](util[_0x0558('0xb')]('[%s][dials][dialbegin]',_0x1421b3[_0x0558('0x9')]),_0x1421b3);dials[_0x1421b3[_0x0558('0x9')]]=_[_0x0558('0x19')](dials[_0x1421b3[_0x0558('0x9')]],_0x1421b3);dials[_0x1421b3[_0x0558('0x9')]][_0x0558('0x1a')]=utils[_0x0558('0x1b')]();dials[_0x1421b3[_0x0558('0x9')]]['lastevent']=_0x0558('0x1c');utils[_0x0558('0x2')](util['format'](_0x0558('0x1d'),_0x1421b3[_0x0558('0x9')],dials[_0x1421b3[_0x0558('0x9')]]['starttime']));}}catch(_0x19e712){utils[_0x0558('0x14')](util['format']('[%s][dials][dialbegin]',_0x1421b3[_0x0558('0x9')]),_0x19e712);}};exports['dialend']=function(_0x4abde0){try{if(!_[_0x0558('0x18')](dials[_0x4abde0[_0x0558('0x9')]])){utils[_0x0558('0xa')](util[_0x0558('0xb')](_0x0558('0x1e'),_0x4abde0[_0x0558('0x9')]),_0x4abde0);dials[_0x4abde0[_0x0558('0x9')]][_0x0558('0x7')]=_0x4abde0[_0x0558('0x7')];if(_0x4abde0[_0x0558('0x7')]==_0x0558('0x1f')){dials[_0x4abde0[_0x0558('0x9')]]=_[_0x0558('0x19')](dials[_0x4abde0['uniqueid']],_0x4abde0);dials[_0x4abde0['uniqueid']]['answertime']=utils['now']();dials[_0x4abde0['uniqueid']][_0x0558('0x20')]='connect';utils['info'](util[_0x0558('0xb')](_0x0558('0x21'),_0x4abde0['uniqueid'],_0x4abde0[_0x0558('0x7')],dials[_0x4abde0['uniqueid']][_0x0558('0x22')]));}else{utils['info'](util['format'](_0x0558('0x23'),_0x4abde0[_0x0558('0x9')],_0x4abde0['dialstatus']));}}}catch(_0x5489cf){utils[_0x0558('0x14')](util[_0x0558('0xb')](_0x0558('0x1e'),_0x4abde0[_0x0558('0x9')]),_0x5489cf);}};exports['hangup']=function(_0x55db81){try{if(!_[_0x0558('0x18')](dials[_0x55db81[_0x0558('0x9')]])){utils['debug'](util[_0x0558('0xb')]('[%s][dials][hangup]',_0x55db81[_0x0558('0x9')]),_0x55db81);utils['info'](util[_0x0558('0xb')](_0x0558('0x24'),_0x55db81[_0x0558('0x9')],_0x55db81['calleridnum'],_0x55db81[_0x0558('0x25')],_0x55db81[_0x0558('0x26')]));dials[_0x55db81[_0x0558('0x9')]]=_[_0x0558('0x19')](dials[_0x55db81[_0x0558('0x9')]],{'endtime':utils['now'](),'lastevent':_0x0558('0x27')});dials[_0x55db81[_0x0558('0x9')]][_0x0558('0x28')]=utils[_0x0558('0x29')](dials[_0x55db81['uniqueid']][_0x0558('0x2a')],dials[_0x55db81['uniqueid']]['starttime']);dials[_0x55db81[_0x0558('0x9')]]['holdtime']=utils[_0x0558('0x29')](dials[_0x55db81[_0x0558('0x9')]][_0x0558('0x22')]||dials[_0x55db81[_0x0558('0x9')]]['endtime'],dials[_0x55db81['uniqueid']][_0x0558('0x1a')]);dials[_0x55db81[_0x0558('0x9')]]['billableseconds']=dials[_0x55db81[_0x0558('0x9')]][_0x0558('0x22')]?utils[_0x0558('0x29')](dials[_0x55db81[_0x0558('0x9')]][_0x0558('0x2a')],dials[_0x55db81[_0x0558('0x9')]][_0x0558('0x22')]):0x0;writeDB(dials[_0x55db81[_0x0558('0x9')]]);}}catch(_0x39cbd4){utils[_0x0558('0x14')](util[_0x0558('0xb')](_0x0558('0x2b'),_0x55db81[_0x0558('0x9')]),_0x39cbd4);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 3436ef6..ef00541 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 _0x15ea=['varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','local','asterisk','port','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid'];(function(_0x4cbeda,_0x2db597){var _0x3a03b9=function(_0x3cd005){while(--_0x3cd005){_0x4cbeda['push'](_0x4cbeda['shift']());}};_0x3a03b9(++_0x2db597);}(_0x15ea,0x9c));var _0xa15e=function(_0x56a6f5,_0x486556){_0x56a6f5=_0x56a6f5-0x0;var _0x30f99b=_0x15ea[_0x56a6f5];return _0x30f99b;};var AsteriskManager=require(_0xa15e('0x0'));var config=require(_0xa15e('0x1'));var utils=require(_0xa15e('0x2'));var util=require(_0xa15e('0x3'));var isXDREnabled=config[_0xa15e('0x4')]&&config['xdr'][_0xa15e('0x5')]?!config[_0xa15e('0x4')][_0xa15e('0x5')]:!![];var isProduction=config[_0xa15e('0x6')]==='production'||![];var isLocalAsterisk=config[_0xa15e('0x4')]&&config[_0xa15e('0x4')][_0xa15e('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0xa15e('0x8')][_0xa15e('0x9')],config[_0xa15e('0x8')]['ip'],config['asterisk']['username'],config['asterisk'][_0xa15e('0xa')],!![]);ami[_0xa15e('0xb')]();if(!isXDREnabled){utils[_0xa15e('0xc')](_0xa15e('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xa15e('0xc')](_0xa15e('0xe'));}else{var agents=require(_0xa15e('0xf'));var calls=require(_0xa15e('0x10'));var queues=require(_0xa15e('0x11'));var recordings=require(_0xa15e('0x12'));var members=require(_0xa15e('0x13'));var dials=require(_0xa15e('0x14'));var transfers=require(_0xa15e('0x15'));var core=require(_0xa15e('0x16'));ami['on'](_0xa15e('0x17'),core[_0xa15e('0x17')]);ami['on'](_0xa15e('0x18'),core[_0xa15e('0x18')]);ami['on'](_0xa15e('0x19'),core[_0xa15e('0x19')]);ami['on'](_0xa15e('0x1a'),core[_0xa15e('0x1a')]);ami['on'](_0xa15e('0x1b'),core[_0xa15e('0x1b')]);ami['on'](_0xa15e('0x1c'),core[_0xa15e('0x1c')]);ami['on'](_0xa15e('0x1d'),function(_0x329229){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x20'),_0x329229[_0xa15e('0x21')]),_0x329229);members[_0xa15e('0x1d')](_0x329229);}catch(_0x2d643a){utils[_0xa15e('0x1a')](util[_0xa15e('0x1f')](_0xa15e('0x20'),_0x329229[_0xa15e('0x21')]),_0x2d643a);}});ami['on'](_0xa15e('0x22'),function(_0xbddc5d){try{utils[_0xa15e('0x1e')](util['format'](_0xa15e('0x23'),_0xbddc5d[_0xa15e('0x24')]),_0xbddc5d);agents[_0xa15e('0x22')](_0xbddc5d);}catch(_0x4d8677){utils[_0xa15e('0x1a')](util['format'](_0xa15e('0x23'),_0xbddc5d[_0xa15e('0x24')]),_0x4d8677);}});ami['on'](_0xa15e('0x25'),function(_0x5ab4a4){try{utils[_0xa15e('0x1e')](util['format'](_0xa15e('0x26'),_0x5ab4a4[_0xa15e('0x24')]),_0x5ab4a4);agents['agentringnoanswer'](_0x5ab4a4);}catch(_0x30de35){utils['error'](util[_0xa15e('0x1f')](_0xa15e('0x26'),_0x5ab4a4[_0xa15e('0x24')]),_0x30de35);}});ami['on'](_0xa15e('0x27'),function(_0x23b38b){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x28'),_0x23b38b[_0xa15e('0x24')]),_0x23b38b);agents[_0xa15e('0x27')](_0x23b38b);queues[_0xa15e('0x27')](_0x23b38b);}catch(_0x532711){utils['error'](util[_0xa15e('0x1f')](_0xa15e('0x28'),_0x23b38b[_0xa15e('0x24')]),_0x532711);}});ami['on'](_0xa15e('0x29'),function(_0x19eaf9){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x2a'),_0x19eaf9['uniqueid']),_0x19eaf9);agents['agentcomplete'](_0x19eaf9);queues[_0xa15e('0x29')](_0x19eaf9);members[_0xa15e('0x29')](_0x19eaf9);}catch(_0xc00dbe){utils[_0xa15e('0x1a')](util['format']('[%s][index][agentcomplete]',_0x19eaf9['uniqueid']),_0xc00dbe);}});ami['on'](_0xa15e('0x2b'),function(_0x294050){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x2c'),_0x294050[_0xa15e('0x24')]),_0x294050);agents['queuecallerabandon'](_0x294050);queues[_0xa15e('0x2b')](_0x294050);}catch(_0x48bf72){utils[_0xa15e('0x1a')](util['format'](_0xa15e('0x2c'),_0x294050[_0xa15e('0x24')]),_0x48bf72);}});ami['on'](_0xa15e('0x2d'),function(_0x14e736){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x2e'),_0x14e736[_0xa15e('0x24')]),_0x14e736);queues['queuecallerjoin'](_0x14e736);recordings[_0xa15e('0x2d')](_0x14e736);}catch(_0x5aad16){utils['error'](util[_0xa15e('0x1f')](_0xa15e('0x2e'),_0x14e736['uniqueid']),_0x5aad16);}});ami['on'](_0xa15e('0x2f'),function(_0x2fbf58){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x30'),_0x2fbf58[_0xa15e('0x24')]),_0x2fbf58);queues[_0xa15e('0x2f')](_0x2fbf58);}catch(_0x18873f){utils[_0xa15e('0x1a')](util[_0xa15e('0x1f')](_0xa15e('0x30'),_0x2fbf58['uniqueid']),_0x18873f);}});ami['on']('musiconholdstart',function(_0x51e553){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x31'),_0x51e553['uniqueid']),_0x51e553);queues[_0xa15e('0x32')](_0x51e553);calls['musiconholdstart'](_0x51e553);}catch(_0xab6978){utils['error'](util['format']('[%s][index][musiconholdstart]',_0x51e553[_0xa15e('0x24')]),_0xab6978);}});ami['on'](_0xa15e('0x33'),function(_0xb18a0){try{utils['debug'](util[_0xa15e('0x1f')]('[%s][index][musiconholdstop]',_0xb18a0[_0xa15e('0x24')]),_0xb18a0);queues[_0xa15e('0x33')](_0xb18a0);calls[_0xa15e('0x33')](_0xb18a0);}catch(_0xd3b71d){utils['error'](util[_0xa15e('0x1f')]('[%s][index][musiconholdstop]',_0xb18a0[_0xa15e('0x24')]),_0xd3b71d);}});ami['on'](_0xa15e('0x34'),function(_0x277309){try{utils['debug'](util[_0xa15e('0x1f')](_0xa15e('0x35'),_0x277309[_0xa15e('0x24')]),_0x277309);calls[_0xa15e('0x34')](_0x277309);recordings[_0xa15e('0x34')](_0x277309);}catch(_0x2c3257){utils[_0xa15e('0x1a')](util[_0xa15e('0x1f')](_0xa15e('0x35'),_0x277309[_0xa15e('0x24')]),_0x2c3257);}});ami['on'](_0xa15e('0x36'),function(_0x146811){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x37'),_0x146811[_0xa15e('0x24')]),_0x146811);calls[_0xa15e('0x36')](_0x146811);recordings['hangup'](_0x146811);dials[_0xa15e('0x36')](_0x146811);agents['hangup'](_0x146811);queues[_0xa15e('0x36')](_0x146811);}catch(_0x764ebd){utils[_0xa15e('0x1a')](util[_0xa15e('0x1f')](_0xa15e('0x37'),_0x146811[_0xa15e('0x24')]),_0x764ebd);}});ami['on'](_0xa15e('0x38'),function(_0x5cdbfb){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x39'),_0x5cdbfb[_0xa15e('0x24')]),_0x5cdbfb);members[_0xa15e('0x38')](_0x5cdbfb);}catch(_0x5eea22){utils[_0xa15e('0x1a')](util[_0xa15e('0x1f')]('[%s][index][cdr]',_0x5cdbfb[_0xa15e('0x24')]),_0x5eea22);}});ami['on']('blindtransfer',function(_0x411d5f){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x3a'),_0x411d5f[_0xa15e('0x24')]),_0x411d5f);queues[_0xa15e('0x3b')](_0x411d5f);agents['blindtransfer'](_0x411d5f);transfers[_0xa15e('0x3b')](_0x411d5f);recordings[_0xa15e('0x3b')](_0x411d5f);}catch(_0x16cd8f){utils['error'](util[_0xa15e('0x1f')](_0xa15e('0x3a'),_0x411d5f[_0xa15e('0x24')]),_0x16cd8f);}});ami['on'](_0xa15e('0x3c'),function(_0x3088cb){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x3d'),_0x3088cb['origtransfereruniqueid']),_0x3088cb);queues[_0xa15e('0x3c')](_0x3088cb);transfers[_0xa15e('0x3c')](_0x3088cb);agents[_0xa15e('0x3c')](_0x3088cb);calls[_0xa15e('0x3c')](_0x3088cb);}catch(_0x5b1040){utils[_0xa15e('0x1a')](util[_0xa15e('0x1f')](_0xa15e('0x3d'),_0x3088cb[_0xa15e('0x3e')]),_0x5b1040);}});ami['on'](_0xa15e('0x3f'),function(_0x5115bb){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x40'),_0x5115bb[_0xa15e('0x24')]),_0x5115bb);queues[_0xa15e('0x3f')](_0x5115bb);recordings[_0xa15e('0x3f')](_0x5115bb);calls[_0xa15e('0x3f')](_0x5115bb);dials[_0xa15e('0x3f')](_0x5115bb);}catch(_0x1237dd){utils['error'](util[_0xa15e('0x1f')]('[%s][index][varset]',_0x5115bb[_0xa15e('0x24')]),_0x1237dd);}});ami['on']('newexten',function(_0xf5436c){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x41'),_0xf5436c[_0xa15e('0x24')]),_0xf5436c);calls['newexten'](_0xf5436c);recordings[_0xa15e('0x42')](_0xf5436c);dials[_0xa15e('0x42')](_0xf5436c);}catch(_0x25fe87){utils[_0xa15e('0x1a')](util[_0xa15e('0x1f')](_0xa15e('0x41'),_0xf5436c[_0xa15e('0x24')]),_0x25fe87);}});ami['on'](_0xa15e('0x43'),function(_0x2fab97){try{utils['debug'](util[_0xa15e('0x1f')](_0xa15e('0x44'),_0x2fab97[_0xa15e('0x24')]),_0x2fab97);calls[_0xa15e('0x43')](_0x2fab97);recordings[_0xa15e('0x43')](_0x2fab97);}catch(_0x23840f){utils[_0xa15e('0x1a')](util[_0xa15e('0x1f')]('[%s][index][newchannel]',_0x2fab97[_0xa15e('0x24')]),_0x23840f);}});ami['on'](_0xa15e('0x45'),function(_0x199f19){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x46'),_0x199f19['uniqueid']),_0x199f19);dials[_0xa15e('0x45')](_0x199f19);}catch(_0x2c588f){utils[_0xa15e('0x1a')](util[_0xa15e('0x1f')](_0xa15e('0x47'),_0x199f19[_0xa15e('0x24')]),_0x2c588f);}});ami['on']('dialend',function(_0x418cd7){try{utils[_0xa15e('0x1e')](util[_0xa15e('0x1f')](_0xa15e('0x48'),_0x418cd7[_0xa15e('0x24')]),_0x418cd7);dials['dialend'](_0x418cd7);}catch(_0xd27ab4){utils['error'](util[_0xa15e('0x1f')](_0xa15e('0x48'),_0x418cd7[_0xa15e('0x24')]),_0xd27ab4);}});} \ No newline at end of file +var _0x1e85=['queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','xdr','disabled','production','asterisk','port','username','password','keepConnected','info','./calls.controller','./queues.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','managerevent','debug','device','devicestatechange','format','[%s][index][devicestatechange]','[%s][index][agentcalled]','uniqueid','agentcalled','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]'];(function(_0xeaf29e,_0x4bdcad){var _0x44a815=function(_0x4ded7c){while(--_0x4ded7c){_0xeaf29e['push'](_0xeaf29e['shift']());}};_0x44a815(++_0x4bdcad);}(_0x1e85,0x116));var _0x51e8=function(_0x536418,_0x2cffec){_0x536418=_0x536418-0x0;var _0x2a6d6d=_0x1e85[_0x536418];return _0x2a6d6d;};var AsteriskManager=require(_0x51e8('0x0'));var config=require('../../config/environment');var utils=require(_0x51e8('0x1'));var util=require('util');var isXDREnabled=config[_0x51e8('0x2')]&&config[_0x51e8('0x2')][_0x51e8('0x3')]?!config[_0x51e8('0x2')][_0x51e8('0x3')]:!![];var isProduction=config['env']===_0x51e8('0x4')||![];var isLocalAsterisk=config['xdr']&&config['xdr']['local']===!![]||![];var ami=new AsteriskManager(config[_0x51e8('0x5')][_0x51e8('0x6')],config['asterisk']['ip'],config[_0x51e8('0x5')][_0x51e8('0x7')],config[_0x51e8('0x5')][_0x51e8('0x8')],!![]);ami[_0x51e8('0x9')]();if(!isXDREnabled){utils[_0x51e8('0xa')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x51e8('0xa')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require('./agents.controller');var calls=require(_0x51e8('0xb'));var queues=require(_0x51e8('0xc'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0x51e8('0xd'));var transfers=require(_0x51e8('0xe'));var core=require('./core.controller');ami['on'](_0x51e8('0xf'),core[_0x51e8('0xf')]);ami['on'](_0x51e8('0x10'),core[_0x51e8('0x10')]);ami['on']('fullybooted',core[_0x51e8('0x11')]);ami['on']('error',core[_0x51e8('0x12')]);ami['on']('close',core['close']);ami['on'](_0x51e8('0x13'),core[_0x51e8('0x13')]);ami['on']('devicestatechange',function(_0xca479e){try{utils[_0x51e8('0x14')](util['format']('[%s][index][devicestatechange]',_0xca479e[_0x51e8('0x15')]),_0xca479e);members[_0x51e8('0x16')](_0xca479e);}catch(_0x4f7207){utils[_0x51e8('0x12')](util[_0x51e8('0x17')](_0x51e8('0x18'),_0xca479e[_0x51e8('0x15')]),_0x4f7207);}});ami['on']('agentcalled',function(_0x4cc691){try{utils['debug'](util[_0x51e8('0x17')](_0x51e8('0x19'),_0x4cc691[_0x51e8('0x1a')]),_0x4cc691);agents[_0x51e8('0x1b')](_0x4cc691);}catch(_0x39114c){utils[_0x51e8('0x12')](util[_0x51e8('0x17')](_0x51e8('0x19'),_0x4cc691[_0x51e8('0x1a')]),_0x39114c);}});ami['on']('agentringnoanswer',function(_0x5bf226){try{utils[_0x51e8('0x14')](util[_0x51e8('0x17')](_0x51e8('0x1c'),_0x5bf226[_0x51e8('0x1a')]),_0x5bf226);agents[_0x51e8('0x1d')](_0x5bf226);}catch(_0x515925){utils[_0x51e8('0x12')](util[_0x51e8('0x17')](_0x51e8('0x1c'),_0x5bf226[_0x51e8('0x1a')]),_0x515925);}});ami['on'](_0x51e8('0x1e'),function(_0x53dddc){try{utils[_0x51e8('0x14')](util[_0x51e8('0x17')]('[%s][index][agentconnect]',_0x53dddc[_0x51e8('0x1a')]),_0x53dddc);agents[_0x51e8('0x1e')](_0x53dddc);queues['agentconnect'](_0x53dddc);}catch(_0x326c7e){utils[_0x51e8('0x12')](util[_0x51e8('0x17')]('[%s][index][agentconnect]',_0x53dddc[_0x51e8('0x1a')]),_0x326c7e);}});ami['on'](_0x51e8('0x1f'),function(_0x41c51e){try{utils[_0x51e8('0x14')](util[_0x51e8('0x17')](_0x51e8('0x20'),_0x41c51e[_0x51e8('0x1a')]),_0x41c51e);agents[_0x51e8('0x1f')](_0x41c51e);queues[_0x51e8('0x1f')](_0x41c51e);members[_0x51e8('0x1f')](_0x41c51e);}catch(_0x3685c6){utils[_0x51e8('0x12')](util[_0x51e8('0x17')]('[%s][index][agentcomplete]',_0x41c51e[_0x51e8('0x1a')]),_0x3685c6);}});ami['on']('queuecallerabandon',function(_0x52d94d){try{utils[_0x51e8('0x14')](util[_0x51e8('0x17')]('[%s][index][queuecallerabandon]',_0x52d94d[_0x51e8('0x1a')]),_0x52d94d);agents[_0x51e8('0x21')](_0x52d94d);queues[_0x51e8('0x21')](_0x52d94d);}catch(_0x54e200){utils[_0x51e8('0x12')](util['format']('[%s][index][queuecallerabandon]',_0x52d94d[_0x51e8('0x1a')]),_0x54e200);}});ami['on'](_0x51e8('0x22'),function(_0x793c0d){try{utils[_0x51e8('0x14')](util[_0x51e8('0x17')](_0x51e8('0x23'),_0x793c0d['uniqueid']),_0x793c0d);queues[_0x51e8('0x22')](_0x793c0d);recordings[_0x51e8('0x22')](_0x793c0d);}catch(_0x2d4b06){utils[_0x51e8('0x12')](util[_0x51e8('0x17')](_0x51e8('0x23'),_0x793c0d[_0x51e8('0x1a')]),_0x2d4b06);}});ami['on']('queuecallerleave',function(_0x2f73af){try{utils[_0x51e8('0x14')](util[_0x51e8('0x17')](_0x51e8('0x24'),_0x2f73af[_0x51e8('0x1a')]),_0x2f73af);queues[_0x51e8('0x25')](_0x2f73af);}catch(_0x267ddb){utils['error'](util['format'](_0x51e8('0x24'),_0x2f73af[_0x51e8('0x1a')]),_0x267ddb);}});ami['on'](_0x51e8('0x26'),function(_0x4e4764){try{utils[_0x51e8('0x14')](util[_0x51e8('0x17')](_0x51e8('0x27'),_0x4e4764[_0x51e8('0x1a')]),_0x4e4764);queues['musiconholdstart'](_0x4e4764);calls[_0x51e8('0x26')](_0x4e4764);}catch(_0x58f26d){utils['error'](util[_0x51e8('0x17')](_0x51e8('0x27'),_0x4e4764[_0x51e8('0x1a')]),_0x58f26d);}});ami['on'](_0x51e8('0x28'),function(_0x4bc124){try{utils['debug'](util[_0x51e8('0x17')](_0x51e8('0x29'),_0x4bc124[_0x51e8('0x1a')]),_0x4bc124);queues['musiconholdstop'](_0x4bc124);calls['musiconholdstop'](_0x4bc124);}catch(_0xd1fe5d){utils[_0x51e8('0x12')](util[_0x51e8('0x17')](_0x51e8('0x29'),_0x4bc124['uniqueid']),_0xd1fe5d);}});ami['on'](_0x51e8('0x2a'),function(_0x211f9a){try{utils['debug'](util[_0x51e8('0x17')](_0x51e8('0x2b'),_0x211f9a[_0x51e8('0x1a')]),_0x211f9a);calls[_0x51e8('0x2a')](_0x211f9a);recordings['newstate'](_0x211f9a);}catch(_0x553c1f){utils[_0x51e8('0x12')](util['format'](_0x51e8('0x2b'),_0x211f9a['uniqueid']),_0x553c1f);}});ami['on']('hangup',function(_0x18ae4e){try{utils[_0x51e8('0x14')](util['format'](_0x51e8('0x2c'),_0x18ae4e[_0x51e8('0x1a')]),_0x18ae4e);calls[_0x51e8('0x2d')](_0x18ae4e);recordings[_0x51e8('0x2d')](_0x18ae4e);dials['hangup'](_0x18ae4e);agents[_0x51e8('0x2d')](_0x18ae4e);queues[_0x51e8('0x2d')](_0x18ae4e);}catch(_0x20dea0){utils[_0x51e8('0x12')](util[_0x51e8('0x17')](_0x51e8('0x2c'),_0x18ae4e[_0x51e8('0x1a')]),_0x20dea0);}});ami['on'](_0x51e8('0x2e'),function(_0x32a7b3){try{utils['debug'](util[_0x51e8('0x17')](_0x51e8('0x2f'),_0x32a7b3[_0x51e8('0x1a')]),_0x32a7b3);members[_0x51e8('0x2e')](_0x32a7b3);}catch(_0x3f9f91){utils[_0x51e8('0x12')](util[_0x51e8('0x17')](_0x51e8('0x2f'),_0x32a7b3[_0x51e8('0x1a')]),_0x3f9f91);}});ami['on'](_0x51e8('0x30'),function(_0x2d4b74){try{utils[_0x51e8('0x14')](util[_0x51e8('0x17')](_0x51e8('0x31'),_0x2d4b74[_0x51e8('0x1a')]),_0x2d4b74);queues[_0x51e8('0x30')](_0x2d4b74);agents[_0x51e8('0x30')](_0x2d4b74);transfers[_0x51e8('0x30')](_0x2d4b74);recordings['blindtransfer'](_0x2d4b74);}catch(_0x62eb16){utils[_0x51e8('0x12')](util[_0x51e8('0x17')](_0x51e8('0x31'),_0x2d4b74[_0x51e8('0x1a')]),_0x62eb16);}});ami['on'](_0x51e8('0x32'),function(_0x3fdd62){try{utils[_0x51e8('0x14')](util[_0x51e8('0x17')](_0x51e8('0x33'),_0x3fdd62[_0x51e8('0x34')]),_0x3fdd62);queues[_0x51e8('0x32')](_0x3fdd62);transfers[_0x51e8('0x32')](_0x3fdd62);agents[_0x51e8('0x32')](_0x3fdd62);calls[_0x51e8('0x32')](_0x3fdd62);}catch(_0x30aa69){utils[_0x51e8('0x12')](util[_0x51e8('0x17')](_0x51e8('0x33'),_0x3fdd62[_0x51e8('0x34')]),_0x30aa69);}});ami['on'](_0x51e8('0x35'),function(_0x3ed463){try{utils[_0x51e8('0x14')](util[_0x51e8('0x17')](_0x51e8('0x36'),_0x3ed463[_0x51e8('0x1a')]),_0x3ed463);queues[_0x51e8('0x35')](_0x3ed463);recordings['varset'](_0x3ed463);calls['varset'](_0x3ed463);dials[_0x51e8('0x35')](_0x3ed463);}catch(_0x392acb){utils[_0x51e8('0x12')](util[_0x51e8('0x17')]('[%s][index][varset]',_0x3ed463[_0x51e8('0x1a')]),_0x392acb);}});ami['on'](_0x51e8('0x37'),function(_0x591c1a){try{utils[_0x51e8('0x14')](util[_0x51e8('0x17')](_0x51e8('0x38'),_0x591c1a[_0x51e8('0x1a')]),_0x591c1a);calls[_0x51e8('0x37')](_0x591c1a);recordings[_0x51e8('0x37')](_0x591c1a);dials[_0x51e8('0x37')](_0x591c1a);}catch(_0x370378){utils['error'](util[_0x51e8('0x17')](_0x51e8('0x38'),_0x591c1a[_0x51e8('0x1a')]),_0x370378);}});ami['on'](_0x51e8('0x39'),function(_0x79c39f){try{utils['debug'](util[_0x51e8('0x17')](_0x51e8('0x3a'),_0x79c39f[_0x51e8('0x1a')]),_0x79c39f);calls[_0x51e8('0x39')](_0x79c39f);recordings[_0x51e8('0x39')](_0x79c39f);}catch(_0x4e6a79){utils[_0x51e8('0x12')](util['format'](_0x51e8('0x3a'),_0x79c39f[_0x51e8('0x1a')]),_0x4e6a79);}});ami['on'](_0x51e8('0x3b'),function(_0x583999){try{utils[_0x51e8('0x14')](util['format']('[%s][index][dialbegin]',_0x583999[_0x51e8('0x1a')]),_0x583999);dials[_0x51e8('0x3b')](_0x583999);}catch(_0x291ca8){utils[_0x51e8('0x12')](util[_0x51e8('0x17')](_0x51e8('0x3c'),_0x583999[_0x51e8('0x1a')]),_0x291ca8);}});ami['on'](_0x51e8('0x3d'),function(_0x676bb4){try{utils['debug'](util[_0x51e8('0x17')](_0x51e8('0x3e'),_0x676bb4[_0x51e8('0x1a')]),_0x676bb4);dials[_0x51e8('0x3d')](_0x676bb4);}catch(_0x41f032){utils[_0x51e8('0x12')](util[_0x51e8('0x17')](_0x51e8('0x3e'),_0x676bb4['uniqueid']),_0x41f032);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 641f438..0d81f79 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 _0x8aae=['isNil','exitAt','now','duration','diffTime','enterAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','[%s][members][cdr]','split','assign','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','source','lodash','util','./utils','Queue:','info','uniqueid','interface','channel','data2','membername','type','then','name','internal','CreateMemberReport','error','format','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','agent','NOT_INUSE'];(function(_0x5232a9,_0x30a72d){var _0x5cc4e2=function(_0x2e8236){while(--_0x2e8236){_0x5232a9['push'](_0x5232a9['shift']());}};_0x5cc4e2(++_0x30a72d);}(_0x8aae,0x138));var _0xe8aa=function(_0x5c8fa4,_0x372771){_0x5c8fa4=_0x5c8fa4-0x0;var _0x136b8f=_0x8aae[_0x5c8fa4];return _0x136b8f;};'use strict';var _=require(_0xe8aa('0x0'));var util=require(_0xe8aa('0x1'));var utils=require(_0xe8aa('0x2'));var members={};var exclude=['Local/_attended@transfer',_0xe8aa('0x3')];function writeDB(_0x3107fd){utils[_0xe8aa('0x4')](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x3107fd[_0xe8aa('0x5')],_0x3107fd[_0xe8aa('0x6')],_0x3107fd[_0xe8aa('0x7')],_0x3107fd[_0xe8aa('0x8')],_0x3107fd[_0xe8aa('0x9')],_0x3107fd[_0xe8aa('0xa')]));if(_0x3107fd['interface']){utils['getUserByInterface'](_0x3107fd[_0xe8aa('0x6')])[_0xe8aa('0xb')](function(_0x5753a6){if(_0x5753a6){_0x3107fd['membername']=_0x5753a6[_0xe8aa('0xc')];_0x3107fd[_0xe8aa('0xd')]=_0x5753a6[_0xe8aa('0xd')];utils['request'](_0xe8aa('0xe'),_0x3107fd);}else{utils['getUserByName'](_0x3107fd['interface']['split']('/')[0x1])[_0xe8aa('0xb')](function(_0x167688){if(_0x167688){_0x3107fd[_0xe8aa('0x9')]=_0x167688[_0xe8aa('0xc')];_0x3107fd['internal']=_0x167688[_0xe8aa('0xd')];utils['request'](_0xe8aa('0xe'),_0x3107fd);}});}})['catch'](function(_0x321146){utils[_0xe8aa('0xf')](util[_0xe8aa('0x10')](_0xe8aa('0x11'),_0x3107fd['uniqueid']),_0x321146);});}delete members[_0x3107fd[_0xe8aa('0x6')]];}function startsWith(_0x4ee43b,_0x47cbd6){return _[_0xe8aa('0x12')](_0x4ee43b,function(_0xc1adcf){return _[_0xe8aa('0x13')](_0x47cbd6,_0xc1adcf);});}exports[_0xe8aa('0x14')]=function(_0x38f79f){try{utils[_0xe8aa('0x15')](util['format'](_0xe8aa('0x16'),members[_0x38f79f[_0xe8aa('0x17')]]?members[_0x38f79f[_0xe8aa('0x17')]]['uniqueid']:_0x38f79f[_0xe8aa('0x17')]),_0x38f79f);utils[_0xe8aa('0x4')](util[_0xe8aa('0x10')](_0xe8aa('0x18'),members[_0x38f79f[_0xe8aa('0x17')]]?members[_0x38f79f['device']][_0xe8aa('0x5')]:_0x38f79f[_0xe8aa('0x17')],_0x38f79f[_0xe8aa('0x19')],_0x38f79f[_0xe8aa('0x17')]));switch(_0x38f79f[_0xe8aa('0x19')]){case _0xe8aa('0x1a'):case _0xe8aa('0x1b'):if(!startsWith(exclude,_0x38f79f['device'])){members[_0x38f79f[_0xe8aa('0x17')]]={'channel':_0xe8aa('0x1c'),'interface':_0x38f79f['device'],'type':'TALKING','enterAt':utils['now'](),'role':_0xe8aa('0x1d')};}break;case _0xe8aa('0x1e'):if(!_[_0xe8aa('0x1f')](members[_0x38f79f[_0xe8aa('0x17')]])){members[_0x38f79f[_0xe8aa('0x17')]][_0xe8aa('0x20')]=utils[_0xe8aa('0x21')]();members[_0x38f79f[_0xe8aa('0x17')]][_0xe8aa('0x22')]=utils[_0xe8aa('0x23')](members[_0x38f79f[_0xe8aa('0x17')]][_0xe8aa('0x20')],members[_0x38f79f[_0xe8aa('0x17')]][_0xe8aa('0x24')]);if(members[_0x38f79f[_0xe8aa('0x17')]]['uniqueid']){writeDB(members[_0x38f79f[_0xe8aa('0x17')]]);}}break;default:break;}}catch(_0xe1f0c1){utils[_0xe8aa('0xf')](util['format']('[%s][members][devicestatechange]',members[_0x38f79f[_0xe8aa('0x17')]]?members[_0x38f79f[_0xe8aa('0x17')]][_0xe8aa('0x5')]:_0x38f79f[_0xe8aa('0x17')]),_0xe1f0c1);}};exports['agentcomplete']=function(_0xc1523b){try{if(!_[_0xe8aa('0x1f')](members[_0xc1523b[_0xe8aa('0x6')]])){utils[_0xe8aa('0x15')](util[_0xe8aa('0x10')](_0xe8aa('0x25'),_0xc1523b[_0xe8aa('0x5')]),_0xc1523b);utils[_0xe8aa('0x4')](util[_0xe8aa('0x10')](_0xe8aa('0x26'),_0xc1523b[_0xe8aa('0x5')],_0xc1523b[_0xe8aa('0x6')],_0xc1523b[_0xe8aa('0x27')]));members[_0xc1523b['interface']]=_['assign'](members[_0xc1523b[_0xe8aa('0x6')]],{'data4':_0xc1523b['queue'],'uniqueid':_0xc1523b[_0xe8aa('0x5')]});}}catch(_0x332a29){utils['error'](util['format'](_0xe8aa('0x25'),_0xc1523b[_0xe8aa('0x5')]),_0x332a29);}};exports[_0xe8aa('0x28')]=function(_0x2753ec){try{utils[_0xe8aa('0x15')](util[_0xe8aa('0x10')](_0xe8aa('0x29'),_0x2753ec[_0xe8aa('0x5')]),_0x2753ec);if(_0x2753ec[_0xe8aa('0x7')]){var _0x30e08b=_0x2753ec[_0xe8aa('0x7')][_0xe8aa('0x2a')]('-')[0x0];if(!_[_0xe8aa('0x1f')](members[_0x30e08b])){members[_0x30e08b]=_[_0xe8aa('0x2b')](members[_0x30e08b],{'data1':members[_0x30e08b]['data1']||_0x2753ec[_0xe8aa('0xa')],'data2':members[_0x30e08b][_0xe8aa('0x8')]||_0x2753ec['source'],'data3':members[_0x30e08b][_0xe8aa('0x2c')]||_0x2753ec[_0xe8aa('0x2d')],'uniqueid':members[_0x30e08b][_0xe8aa('0x5')]||_0x2753ec['uniqueid']});utils[_0xe8aa('0x4')](util[_0xe8aa('0x10')](_0xe8aa('0x2e'),_0x2753ec[_0xe8aa('0x5')],members[_0x30e08b][_0xe8aa('0x2f')],members[_0x30e08b][_0xe8aa('0x8')],members[_0x30e08b][_0xe8aa('0x2c')]));if(members[_0x30e08b][_0xe8aa('0x20')]){writeDB(members[_0x30e08b]);}}}if(_0x2753ec['destinationchannel']){var _0x197ed4=_0x2753ec['destinationchannel'][_0xe8aa('0x2a')]('-')[0x0];if(!_[_0xe8aa('0x1f')](members[_0x197ed4])){members[_0x197ed4]=_[_0xe8aa('0x2b')](members[_0x197ed4],{'data1':members[_0x197ed4][_0xe8aa('0x2f')]||_0x2753ec['type'],'data2':members[_0x197ed4][_0xe8aa('0x8')]||_0x2753ec[_0xe8aa('0x30')],'data3':members[_0x197ed4]['data3']||_0x2753ec[_0xe8aa('0x2d')],'uniqueid':members[_0x197ed4]['uniqueid']||_0x2753ec['uniqueid']});utils[_0xe8aa('0x4')](util[_0xe8aa('0x10')](_0xe8aa('0x2e'),_0x2753ec[_0xe8aa('0x5')],members[_0x197ed4][_0xe8aa('0x2f')],members[_0x197ed4][_0xe8aa('0x8')],members[_0x197ed4]['data3']));if(members[_0x197ed4]['exitAt']){writeDB(members[_0x197ed4]);}}}}catch(_0xf95c17){utils[_0xe8aa('0xf')](util[_0xe8aa('0x10')](_0xe8aa('0x29'),_0x2753ec['uniqueid']),_0xf95c17);}}; \ No newline at end of file +var _0xb01a=['agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','queue','assign','[%s][members][cdr]','channel','split','data2','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','type','getUserByInterface','then','membername','internal','request','CreateMemberReport','getUserByName','name','catch','error','some','devicestatechange','debug','[%s][members][devicestatechange]','device','state','BUSY','voice','TALKING','now'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb01a,0xe0));var _0xab01=function(_0xdc0c40,_0x18a854){_0xdc0c40=_0xdc0c40-0x0;var _0x12e045=_0xb01a[_0xdc0c40];return _0x12e045;};'use strict';var _=require(_0xab01('0x0'));var util=require(_0xab01('0x1'));var utils=require(_0xab01('0x2'));var members={};var exclude=[_0xab01('0x3'),_0xab01('0x4')];function writeDB(_0x189081){utils[_0xab01('0x5')](util[_0xab01('0x6')](_0xab01('0x7'),_0x189081[_0xab01('0x8')],_0x189081[_0xab01('0x9')],_0x189081['channel'],_0x189081['data2'],_0x189081['membername'],_0x189081[_0xab01('0xa')]));if(_0x189081['interface']){utils[_0xab01('0xb')](_0x189081[_0xab01('0x9')])[_0xab01('0xc')](function(_0x34ae06){if(_0x34ae06){_0x189081[_0xab01('0xd')]=_0x34ae06['name'];_0x189081[_0xab01('0xe')]=_0x34ae06[_0xab01('0xe')];utils[_0xab01('0xf')](_0xab01('0x10'),_0x189081);}else{utils[_0xab01('0x11')](_0x189081[_0xab01('0x9')]['split']('/')[0x1])[_0xab01('0xc')](function(_0x577075){if(_0x577075){_0x189081[_0xab01('0xd')]=_0x577075[_0xab01('0x12')];_0x189081[_0xab01('0xe')]=_0x577075[_0xab01('0xe')];utils[_0xab01('0xf')](_0xab01('0x10'),_0x189081);}});}})[_0xab01('0x13')](function(_0x58a121){utils[_0xab01('0x14')](util['format']('[%s][members][writeDB]',_0x189081[_0xab01('0x8')]),_0x58a121);});}delete members[_0x189081[_0xab01('0x9')]];}function startsWith(_0xd73f6a,_0x4f2e2d){return _[_0xab01('0x15')](_0xd73f6a,function(_0x1e366e){return _['startsWith'](_0x4f2e2d,_0x1e366e);});}exports[_0xab01('0x16')]=function(_0x4967a5){try{utils[_0xab01('0x17')](util['format'](_0xab01('0x18'),members[_0x4967a5['device']]?members[_0x4967a5['device']][_0xab01('0x8')]:_0x4967a5[_0xab01('0x19')]),_0x4967a5);utils[_0xab01('0x5')](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x4967a5[_0xab01('0x19')]]?members[_0x4967a5[_0xab01('0x19')]]['uniqueid']:_0x4967a5[_0xab01('0x19')],_0x4967a5[_0xab01('0x1a')],_0x4967a5[_0xab01('0x19')]));switch(_0x4967a5[_0xab01('0x1a')]){case'INUSE':case _0xab01('0x1b'):if(!startsWith(exclude,_0x4967a5[_0xab01('0x19')])){members[_0x4967a5[_0xab01('0x19')]]={'channel':_0xab01('0x1c'),'interface':_0x4967a5[_0xab01('0x19')],'type':_0xab01('0x1d'),'enterAt':utils[_0xab01('0x1e')](),'role':_0xab01('0x1f')};}break;case _0xab01('0x20'):if(!_[_0xab01('0x21')](members[_0x4967a5[_0xab01('0x19')]])){members[_0x4967a5['device']][_0xab01('0x22')]=utils[_0xab01('0x1e')]();members[_0x4967a5[_0xab01('0x19')]][_0xab01('0x23')]=utils[_0xab01('0x24')](members[_0x4967a5[_0xab01('0x19')]][_0xab01('0x22')],members[_0x4967a5[_0xab01('0x19')]][_0xab01('0x25')]);if(members[_0x4967a5['device']][_0xab01('0x8')]){writeDB(members[_0x4967a5[_0xab01('0x19')]]);}}break;default:break;}}catch(_0x3cc5b9){utils[_0xab01('0x14')](util[_0xab01('0x6')](_0xab01('0x18'),members[_0x4967a5['device']]?members[_0x4967a5[_0xab01('0x19')]][_0xab01('0x8')]:_0x4967a5[_0xab01('0x19')]),_0x3cc5b9);}};exports[_0xab01('0x26')]=function(_0x100375){try{if(!_[_0xab01('0x21')](members[_0x100375['interface']])){utils[_0xab01('0x17')](util[_0xab01('0x6')](_0xab01('0x27'),_0x100375[_0xab01('0x8')]),_0x100375);utils[_0xab01('0x5')](util[_0xab01('0x6')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x100375['uniqueid'],_0x100375['interface'],_0x100375[_0xab01('0x28')]));members[_0x100375[_0xab01('0x9')]]=_[_0xab01('0x29')](members[_0x100375[_0xab01('0x9')]],{'data4':_0x100375[_0xab01('0x28')],'uniqueid':_0x100375[_0xab01('0x8')]});}}catch(_0x123bd1){utils['error'](util[_0xab01('0x6')](_0xab01('0x27'),_0x100375[_0xab01('0x8')]),_0x123bd1);}};exports['cdr']=function(_0x378c97){try{utils[_0xab01('0x17')](util[_0xab01('0x6')](_0xab01('0x2a'),_0x378c97['uniqueid']),_0x378c97);if(_0x378c97[_0xab01('0x2b')]){var _0x13f8cb=_0x378c97[_0xab01('0x2b')][_0xab01('0x2c')]('-')[0x0];if(!_['isNil'](members[_0x13f8cb])){members[_0x13f8cb]=_[_0xab01('0x29')](members[_0x13f8cb],{'data1':members[_0x13f8cb]['data1']||_0x378c97[_0xab01('0xa')],'data2':members[_0x13f8cb][_0xab01('0x2d')]||_0x378c97['source'],'data3':members[_0x13f8cb][_0xab01('0x2e')]||_0x378c97[_0xab01('0x2f')],'uniqueid':members[_0x13f8cb][_0xab01('0x8')]||_0x378c97['uniqueid']});utils['info'](util[_0xab01('0x6')](_0xab01('0x30'),_0x378c97[_0xab01('0x8')],members[_0x13f8cb][_0xab01('0x31')],members[_0x13f8cb][_0xab01('0x2d')],members[_0x13f8cb][_0xab01('0x2e')]));if(members[_0x13f8cb][_0xab01('0x22')]){writeDB(members[_0x13f8cb]);}}}if(_0x378c97[_0xab01('0x32')]){var _0x26c110=_0x378c97[_0xab01('0x32')][_0xab01('0x2c')]('-')[0x0];if(!_[_0xab01('0x21')](members[_0x26c110])){members[_0x26c110]=_[_0xab01('0x29')](members[_0x26c110],{'data1':members[_0x26c110]['data1']||_0x378c97[_0xab01('0xa')],'data2':members[_0x26c110][_0xab01('0x2d')]||_0x378c97['source'],'data3':members[_0x26c110][_0xab01('0x2e')]||_0x378c97[_0xab01('0x2f')],'uniqueid':members[_0x26c110][_0xab01('0x8')]||_0x378c97[_0xab01('0x8')]});utils[_0xab01('0x5')](util[_0xab01('0x6')](_0xab01('0x30'),_0x378c97[_0xab01('0x8')],members[_0x26c110][_0xab01('0x31')],members[_0x26c110][_0xab01('0x2d')],members[_0x26c110][_0xab01('0x2e')]));if(members[_0x26c110]['exitAt']){writeDB(members[_0x26c110]);}}}}catch(_0x31c740){utils['error'](util[_0xab01('0x6')]('[%s][members][cdr]',_0x378c97[_0xab01('0x8')]),_0x31c740);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index aff65ed..bf6d5b8 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 _0x041f=['BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','transfertype','transferexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','holdtime','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','ATTENDED','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','format','uniqueid','channel','queue','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','error','hangup','isNil','debug','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','info','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','[%s][queues][varset]','variable','value','CONTINUE','queuecallerabandon','queuecallerabandonAt','now','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','diffTime','queuecallerjoinAt','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','lastAssignedTo','[%s][queues][agentcomplete]','assigned','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','BLIND','extension'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x041f,0x85));var _0xf041=function(_0x110385,_0x2a4196){_0x110385=_0x110385-0x0;var _0x19262f=_0x041f[_0x110385];return _0x19262f;};'use strict';var _=require(_0xf041('0x0'));var util=require('util');var utils=require(_0xf041('0x1'));var queues={};function writeDB(_0x42eee7){utils['info'](util[_0xf041('0x2')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x42eee7[_0xf041('0x3')],_0x42eee7[_0xf041('0x4')],_0x42eee7[_0xf041('0x5')],_0x42eee7['lastAssignedTo'],_0x42eee7[_0xf041('0x6')],_0x42eee7[_0xf041('0x7')],_0x42eee7[_0xf041('0x8')]));if(_0x42eee7[_0xf041('0x5')]){utils[_0xf041('0x9')](_0x42eee7['queue'])[_0xf041('0xa')](function(_0x3c44ad){if(_0x3c44ad){_0x42eee7[_0xf041('0xb')]=_0x3c44ad[_0xf041('0xb')];}utils[_0xf041('0xc')]('CreateVoiceQueueReport',_0x42eee7);});}else{utils[_0xf041('0xc')](_0xf041('0xd'),_0x42eee7);}if(_0x42eee7[_0xf041('0xe')]){delete queues[_0x42eee7[_0xf041('0xe')]];}else{delete queues[_0x42eee7['uniqueid']];}}exports[_0xf041('0xf')]=function(_0x3257ef){try{utils['debug'](util[_0xf041('0x2')](_0xf041('0x10'),_0x3257ef[_0xf041('0x3')]),_0x3257ef);utils['info'](util[_0xf041('0x2')](_0xf041('0x11'),_0x3257ef['uniqueid'],_0x3257ef[_0xf041('0x5')],_0x3257ef[_0xf041('0x12')]));queues[_0x3257ef[_0xf041('0x3')]]=_[_0xf041('0x13')](_0x3257ef,{'originalposition':_0x3257ef['position'],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x4a4545){utils[_0xf041('0x14')](util['format']('[%s][queues][queuecallerjoin]',_0x3257ef['uniqueid']),_0x4a4545);}};exports[_0xf041('0x15')]=function(_0x16a1d0){try{if(!_[_0xf041('0x16')](queues[_0x16a1d0['uniqueid']])){utils[_0xf041('0x17')](util[_0xf041('0x2')](_0xf041('0x18'),_0x16a1d0[_0xf041('0x3')]),_0x16a1d0);if(queues[_0x16a1d0[_0xf041('0x3')]][_0xf041('0x19')]){if(!queues[_0x16a1d0[_0xf041('0x3')]]['queuecallerabandon']&&!queues[_0x16a1d0[_0xf041('0x3')]][_0xf041('0x1a')]){queues[_0x16a1d0['uniqueid']][_0xf041('0x1b')]=!![];queues[_0x16a1d0[_0xf041('0x3')]][_0xf041('0x1c')]=utils['now']();queues[_0x16a1d0['uniqueid']][_0xf041('0x8')]='COMPLETEDBYAGENT';}utils[_0xf041('0x1d')](util[_0xf041('0x2')](_0xf041('0x1e'),_0x16a1d0[_0xf041('0x3')],queues[_0x16a1d0[_0xf041('0x3')]][_0xf041('0x1f')],queues[_0x16a1d0[_0xf041('0x3')]][_0xf041('0x8')]));writeDB(queues[_0x16a1d0[_0xf041('0x3')]]);}else if(queues[_0x16a1d0[_0xf041('0x3')]][_0xf041('0xe')]){utils[_0xf041('0x1d')](util[_0xf041('0x2')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x16a1d0[_0xf041('0x3')],queues[_0x16a1d0[_0xf041('0x3')]][_0xf041('0x1f')],queues[_0x16a1d0[_0xf041('0x3')]][_0xf041('0xe')]));queues[queues[_0x16a1d0[_0xf041('0x3')]][_0xf041('0xe')]]=queues[_0x16a1d0[_0xf041('0x3')]];queues[queues[_0x16a1d0[_0xf041('0x3')]][_0xf041('0xe')]][_0xf041('0x20')]=0x2;delete queues[_0x16a1d0[_0xf041('0x3')]];}}}catch(_0x1e1fb4){utils[_0xf041('0x14')](util[_0xf041('0x2')](_0xf041('0x18'),_0x16a1d0['uniqueid']),_0x1e1fb4);}};exports['varset']=function(_0x59254c){try{utils['debug'](util[_0xf041('0x2')](_0xf041('0x21'),_0x59254c[_0xf041('0x3')]),_0x59254c);if(!_[_0xf041('0x16')](_0x59254c[_0xf041('0x22')]['queuestatus'])&&_0x59254c[_0xf041('0x23')]['toUpperCase']()!==_0xf041('0x24')){if(!_[_0xf041('0x16')](queues[_0x59254c[_0xf041('0x3')]])){queues[_0x59254c[_0xf041('0x3')]][_0xf041('0x25')]=![];queues[_0x59254c[_0xf041('0x3')]][_0xf041('0x26')]=null;queues[_0x59254c['uniqueid']][_0xf041('0x1a')]=!![];queues[_0x59254c[_0xf041('0x3')]]['queuecallerexitAt']=utils[_0xf041('0x27')]();queues[_0x59254c[_0xf041('0x3')]][_0xf041('0x8')]=_0x59254c['value'][_0xf041('0x28')]();utils[_0xf041('0x1d')](util[_0xf041('0x2')](_0xf041('0x29'),_0x59254c[_0xf041('0x3')],queues[_0x59254c[_0xf041('0x3')]][_0xf041('0x1f')],_0x59254c[_0xf041('0x23')],queues[_0x59254c[_0xf041('0x3')]]['queuecallerexitreason']));writeDB(queues[_0x59254c[_0xf041('0x3')]]);}}else if(!_[_0xf041('0x16')](_0x59254c[_0xf041('0x22')]['queueposition'])){if(!_[_0xf041('0x16')](queues[_0x59254c[_0xf041('0x3')]])&&!queues[_0x59254c[_0xf041('0x3')]][_0xf041('0x25')]){queues[_0x59254c[_0xf041('0x3')]][_0xf041('0x25')]=![];queues[_0x59254c[_0xf041('0x3')]][_0xf041('0x26')]=null;queues[_0x59254c['uniqueid']]['queuecallerexit']=!![];queues[_0x59254c['uniqueid']][_0xf041('0x2a')]=utils[_0xf041('0x27')]();queues[_0x59254c[_0xf041('0x3')]][_0xf041('0x8')]=_0xf041('0x2b');utils[_0xf041('0x1d')](util['format'](_0xf041('0x2c'),_0x59254c[_0xf041('0x3')],queues[_0x59254c[_0xf041('0x3')]][_0xf041('0x1f')],_0x59254c[_0xf041('0x23')],queues[_0x59254c[_0xf041('0x3')]]['queuecallerexitreason']));}}}catch(_0x4cd580){utils[_0xf041('0x14')](util[_0xf041('0x2')](_0xf041('0x21'),_0x59254c[_0xf041('0x3')]),_0x4cd580);}};exports[_0xf041('0x25')]=function(_0x890b3a){try{if(!_['isNil'](queues[_0x890b3a['uniqueid']])){utils['debug'](util[_0xf041('0x2')](_0xf041('0x2d'),_0x890b3a[_0xf041('0x3')]),_0x890b3a);queues[_0x890b3a['uniqueid']][_0xf041('0x1a')]=![];queues[_0x890b3a[_0xf041('0x3')]][_0xf041('0x2a')]=null;queues[_0x890b3a[_0xf041('0x3')]][_0xf041('0x25')]=!![];queues[_0x890b3a['uniqueid']][_0xf041('0x26')]=utils[_0xf041('0x27')]();queues[_0x890b3a[_0xf041('0x3')]]['queuecallerexitreason']=_0xf041('0x2e');utils['info'](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x890b3a[_0xf041('0x3')],queues[_0x890b3a[_0xf041('0x3')]][_0xf041('0x1f')],queues[_0x890b3a['uniqueid']]['queuecallerexitreason']));}}catch(_0x1ea9c1){utils[_0xf041('0x14')](util[_0xf041('0x2')](_0xf041('0x2d'),_0x890b3a[_0xf041('0x3')]),_0x1ea9c1);}};exports[_0xf041('0x2f')]=function(_0x5afbf0){try{if(!_[_0xf041('0x16')](queues[_0x5afbf0[_0xf041('0x3')]])){utils[_0xf041('0x17')](util[_0xf041('0x2')](_0xf041('0x30'),_0x5afbf0[_0xf041('0x3')]),_0x5afbf0);utils[_0xf041('0x1d')](util[_0xf041('0x2')](_0xf041('0x31'),_0x5afbf0[_0xf041('0x3')],queues[_0x5afbf0['uniqueid']][_0xf041('0x1f')],_0x5afbf0[_0xf041('0x32')],_0x5afbf0[_0xf041('0x33')]));queues[_0x5afbf0[_0xf041('0x3')]][_0xf041('0x2f')]=!![];queues[_0x5afbf0[_0xf041('0x3')]][_0xf041('0x19')]=utils[_0xf041('0x27')]();queues[_0x5afbf0[_0xf041('0x3')]]['holdtime']=utils[_0xf041('0x34')](queues[_0x5afbf0['uniqueid']][_0xf041('0x19')],queues[_0x5afbf0[_0xf041('0x3')]][_0xf041('0x35')]);queues[_0x5afbf0[_0xf041('0x3')]][_0xf041('0x12')]=_0x5afbf0[_0xf041('0x12')];queues[_0x5afbf0[_0xf041('0x3')]]['count']=_0x5afbf0['count'];queues[_0x5afbf0[_0xf041('0x3')]][_0xf041('0x32')]=_0x5afbf0[_0xf041('0x32')];queues[_0x5afbf0[_0xf041('0x3')]][_0xf041('0x33')]=_0x5afbf0[_0xf041('0x33')];}}catch(_0x5e78cb){utils['error'](util['format']('[%s][queues][queuecallerleave]',_0x5afbf0[_0xf041('0x3')]),_0x5e78cb);}};exports[_0xf041('0x36')]=function(_0x4163cd){try{if(!_[_0xf041('0x16')](queues[_0x4163cd[_0xf041('0x3')]])){utils[_0xf041('0x17')](util[_0xf041('0x2')](_0xf041('0x37'),_0x4163cd[_0xf041('0x3')]),_0x4163cd);utils[_0xf041('0x1d')](util[_0xf041('0x2')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x4163cd[_0xf041('0x3')],queues[_0x4163cd[_0xf041('0x3')]][_0xf041('0x1f')],_0x4163cd[_0xf041('0x38')],_0x4163cd[_0xf041('0x39')]));queues[_0x4163cd[_0xf041('0x3')]][_0xf041('0x25')]=![];queues[_0x4163cd[_0xf041('0x3')]][_0xf041('0x25')]=![];queues[_0x4163cd['uniqueid']][_0xf041('0x26')]=null;queues[_0x4163cd['uniqueid']][_0xf041('0x1a')]=![];queues[_0x4163cd[_0xf041('0x3')]][_0xf041('0x8')]=null;queues[_0x4163cd[_0xf041('0x3')]][_0xf041('0x2a')]=null;queues[_0x4163cd[_0xf041('0x3')]]['assigned']=!![];queues[_0x4163cd[_0xf041('0x3')]][_0xf041('0x7')]=_0x4163cd[_0xf041('0x39')];queues[_0x4163cd[_0xf041('0x3')]][_0xf041('0x3a')]=_0x4163cd[_0xf041('0x38')];}}catch(_0x2058ad){utils[_0xf041('0x14')](util['format'](_0xf041('0x37'),_0x4163cd[_0xf041('0x3')]),_0x2058ad);}};exports['agentcomplete']=function(_0x398813){try{if(!_[_0xf041('0x16')](queues[_0x398813['uniqueid']])){if(queues[_0x398813['uniqueid']][_0xf041('0x19')]){utils[_0xf041('0x17')](util[_0xf041('0x2')](_0xf041('0x3b'),_0x398813[_0xf041('0x3')]),_0x398813);queues[_0x398813[_0xf041('0x3')]][_0xf041('0x25')]=![];queues[_0x398813['uniqueid']][_0xf041('0x25')]=![];queues[_0x398813[_0xf041('0x3')]][_0xf041('0x26')]=null;queues[_0x398813['uniqueid']]['queuecallerexit']=![];queues[_0x398813[_0xf041('0x3')]][_0xf041('0x2a')]=null;queues[_0x398813[_0xf041('0x3')]][_0xf041('0x3c')]=!![];queues[_0x398813[_0xf041('0x3')]][_0xf041('0x3a')]=_0x398813[_0xf041('0x38')];queues[_0x398813['uniqueid']][_0xf041('0x1b')]=!![];queues[_0x398813[_0xf041('0x3')]][_0xf041('0x1c')]=utils[_0xf041('0x27')]();if(_0x398813[_0xf041('0x3d')]==_0xf041('0x3e')){if(!queues[_0x398813[_0xf041('0x3')]][_0xf041('0x3e')]){queues[_0x398813[_0xf041('0x3')]][_0xf041('0x8')]=_0xf041('0x3f');}}else{queues[_0x398813[_0xf041('0x3')]][_0xf041('0x8')]=_0xf041('0x40')+_0x398813[_0xf041('0x3d')][_0xf041('0x28')]();}utils[_0xf041('0x1d')](util['format'](_0xf041('0x41'),_0x398813[_0xf041('0x3')],queues[_0x398813[_0xf041('0x3')]]['name'],_0x398813['membername'],queues[_0x398813[_0xf041('0x3')]]['queuecallerexitreason']));writeDB(queues[_0x398813['uniqueid']]);}}}catch(_0x2cfb13){utils['error'](util[_0xf041('0x2')]('[%s][queues][agentcomplete]',_0x398813[_0xf041('0x3')]),_0x2cfb13);}};exports['blindtransfer']=function(_0x49ae09){try{if(!_['isNil'](queues[_0x49ae09[_0xf041('0x42')]])){utils['debug'](util[_0xf041('0x2')]('[%s][queues][blindtransfer]',_0x49ae09[_0xf041('0x3')]),_0x49ae09);queues[_0x49ae09[_0xf041('0x42')]]['transfer']=!![];queues[_0x49ae09[_0xf041('0x42')]]['transfertype']=_0xf041('0x43');queues[_0x49ae09[_0xf041('0x42')]]['transferexten']=_0x49ae09[_0xf041('0x44')];queues[_0x49ae09[_0xf041('0x42')]]['transferuniqueid']=_0x49ae09['transfereeuniqueid'];queues[_0x49ae09[_0xf041('0x42')]][_0xf041('0x8')]=_0xf041('0x45');utils['info'](util[_0xf041('0x2')](_0xf041('0x46'),_0x49ae09[_0xf041('0x3')],queues[_0x49ae09[_0xf041('0x42')]][_0xf041('0x1f')],_0x49ae09[_0xf041('0x42')],_0x49ae09[_0xf041('0x44')]));}}catch(_0xea6621){utils['error'](util[_0xf041('0x2')](_0xf041('0x47'),_0x49ae09[_0xf041('0x3')]),_0xea6621);}};exports[_0xf041('0x48')]=function(_0x193683){try{utils[_0xf041('0x17')](util[_0xf041('0x2')](_0xf041('0x49'),_0x193683[_0xf041('0x4a')]),_0x193683);if(_0x193683[_0xf041('0x4a')]==_0x193683[_0xf041('0x4b')]){if(!_[_0xf041('0x16')](queues[_0x193683[_0xf041('0x4c')]])){utils['info'](util[_0xf041('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x193683['origtransfereruniqueid'],queues[_0x193683['secondtransfererlinkedid']][_0xf041('0x1f')],_0x193683[_0xf041('0x4d')]));queues[_0x193683[_0xf041('0x4c')]][_0xf041('0x3e')]=!![];queues[_0x193683[_0xf041('0x4c')]][_0xf041('0x4e')]='ATTENDED';queues[_0x193683[_0xf041('0x4c')]][_0xf041('0x4f')]=_0x193683['origtransfererexten'];queues[_0x193683[_0xf041('0x4c')]][_0xf041('0x50')]=_0x193683[_0xf041('0x4a')];queues[_0x193683[_0xf041('0x4c')]][_0xf041('0x8')]=_0xf041('0x51');}if(!_[_0xf041('0x16')](queues[_0x193683['origtransfererlinkedid']])){if(_0x193683[_0xf041('0x52')]&&queues[_0x193683[_0xf041('0x52')]]){queues[_0x193683[_0xf041('0x52')]][_0xf041('0x20')]=0x1;queues[_0x193683[_0xf041('0x42')]]=_['clone'](queues[_0x193683[_0xf041('0x52')]]);queues[_0x193683[_0xf041('0x42')]][_0xf041('0xe')]=_0x193683[_0xf041('0x53')];queues[_0x193683[_0xf041('0x42')]]['queuecallerenterreason']=0x2;queues[_0x193683['transfereeuniqueid']][_0xf041('0x6')]=queues[_0x193683[_0xf041('0x4c')]][_0xf041('0x6')];queues[_0x193683['transfereeuniqueid']][_0xf041('0x54')]=queues[_0x193683[_0xf041('0x4c')]][_0xf041('0x54')];queues[_0x193683[_0xf041('0x42')]][_0xf041('0x35')]=utils['now']();queues[_0x193683[_0xf041('0x42')]]['queuecallerleaveAt']=utils[_0xf041('0x27')]();queues[_0x193683[_0xf041('0x42')]][_0xf041('0x55')]=0x0;queues[_0x193683[_0xf041('0x42')]][_0xf041('0x56')]=0x0;utils[_0xf041('0x1d')](util['format'](_0xf041('0x57'),_0x193683['origtransfereruniqueid'],queues[_0x193683[_0xf041('0x42')]]['name'],queues[_0x193683[_0xf041('0x42')]]['calleridnum'],queues[_0x193683[_0xf041('0x42')]]['calleridname']));}else{utils[_0xf041('0x1d')](util[_0xf041('0x2')](_0xf041('0x58'),_0x193683[_0xf041('0x4a')],queues[_0x193683[_0xf041('0x4b')]]['name'],_0x193683[_0xf041('0x4c')]));queues[_0x193683[_0xf041('0x4b')]][_0xf041('0xe')]=_0x193683['secondtransfererlinkedid'];}}}else if(_0x193683[_0xf041('0x59')]==_0x193683[_0xf041('0x4c')]){if(!_[_0xf041('0x16')](queues[_0x193683[_0xf041('0x4b')]])){utils[_0xf041('0x1d')](util[_0xf041('0x2')](_0xf041('0x5a'),_0x193683[_0xf041('0x4a')],queues[_0x193683[_0xf041('0x4b')]]['name'],_0x193683[_0xf041('0x59')],_0x193683[_0xf041('0x5b')]));queues[_0x193683[_0xf041('0x4b')]]['transfer']=!![];queues[_0x193683['origtransfererlinkedid']]['transfertype']=_0xf041('0x5c');queues[_0x193683[_0xf041('0x4b')]][_0xf041('0x4f')]=_0x193683[_0xf041('0x5b')];queues[_0x193683[_0xf041('0x4b')]][_0xf041('0x50')]=_0x193683[_0xf041('0x59')];queues[_0x193683[_0xf041('0x4b')]]['queuecallerexitreason']=_0xf041('0x51');}if(!_[_0xf041('0x16')](queues[_0x193683[_0xf041('0x4c')]])){if(_0x193683[_0xf041('0x5d')]&&queues[_0x193683[_0xf041('0x5d')]]){queues[_0x193683[_0xf041('0x5d')]][_0xf041('0x20')]=0x1;queues[_0x193683[_0xf041('0x53')]]=_[_0xf041('0x5e')](queues[_0x193683[_0xf041('0x5d')]]);queues[_0x193683[_0xf041('0x53')]][_0xf041('0xe')]=_0x193683[_0xf041('0x53')];queues[_0x193683['transfertargetuniqueid']][_0xf041('0x20')]=0x2;queues[_0x193683[_0xf041('0x53')]][_0xf041('0x6')]=queues[_0x193683[_0xf041('0x4b')]][_0xf041('0x6')];queues[_0x193683['transfertargetuniqueid']][_0xf041('0x54')]=queues[_0x193683[_0xf041('0x4b')]][_0xf041('0x54')];queues[_0x193683[_0xf041('0x53')]][_0xf041('0x35')]=utils[_0xf041('0x27')]();queues[_0x193683['transfertargetuniqueid']][_0xf041('0x19')]=utils[_0xf041('0x27')]();queues[_0x193683['transfertargetuniqueid']][_0xf041('0x55')]=0x0;queues[_0x193683[_0xf041('0x53')]][_0xf041('0x56')]=0x0;utils[_0xf041('0x1d')](util['format'](_0xf041('0x5f'),_0x193683[_0xf041('0x4a')],queues[_0x193683[_0xf041('0x53')]][_0xf041('0x1f')],queues[_0x193683[_0xf041('0x53')]][_0xf041('0xe')],queues[_0x193683[_0xf041('0x53')]][_0xf041('0x6')],queues[_0x193683[_0xf041('0x53')]][_0xf041('0x54')]));}else{utils[_0xf041('0x1d')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x193683['origtransfereruniqueid'],queues[_0x193683[_0xf041('0x4c')]][_0xf041('0x1f')],_0x193683['origtransfererlinkedid']));queues[_0x193683[_0xf041('0x4c')]][_0xf041('0xe')]=_0x193683[_0xf041('0x4b')];}}}}catch(_0x39bb77){utils[_0xf041('0x14')](util[_0xf041('0x2')](_0xf041('0x49'),_0x193683[_0xf041('0x4a')]),_0x39bb77);}};exports['musiconholdstart']=function(_0x29bb68){try{if(!_[_0xf041('0x16')](queues[_0x29bb68[_0xf041('0x3')]])){utils[_0xf041('0x17')](util[_0xf041('0x2')](_0xf041('0x60'),_0x29bb68[_0xf041('0x3')]),_0x29bb68);queues[_0x29bb68[_0xf041('0x3')]]['musiconholdstartAt']=utils[_0xf041('0x27')]();utils['info'](util[_0xf041('0x2')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x29bb68[_0xf041('0x3')],queues[_0x29bb68[_0xf041('0x3')]]['name'],queues[_0x29bb68[_0xf041('0x3')]][_0xf041('0x61')]));}}catch(_0x136ff8){utils[_0xf041('0x14')](util[_0xf041('0x2')](_0xf041('0x60'),_0x29bb68[_0xf041('0x3')]),_0x136ff8);}};exports[_0xf041('0x62')]=function(_0x42e9fd){try{if(!_['isNil'](queues[_0x42e9fd[_0xf041('0x3')]])){if(!_[_0xf041('0x16')](queues[_0x42e9fd[_0xf041('0x3')]][_0xf041('0x61')])){utils[_0xf041('0x17')](util[_0xf041('0x2')](_0xf041('0x63'),_0x42e9fd[_0xf041('0x3')]),_0x42e9fd);queues[_0x42e9fd[_0xf041('0x3')]][_0xf041('0x56')]+=utils[_0xf041('0x34')](utils[_0xf041('0x27')](),queues[_0x42e9fd[_0xf041('0x3')]][_0xf041('0x61')]);utils[_0xf041('0x1d')](util[_0xf041('0x2')](_0xf041('0x64'),_0x42e9fd[_0xf041('0x3')],queues[_0x42e9fd[_0xf041('0x3')]][_0xf041('0x1f')],queues[_0x42e9fd[_0xf041('0x3')]][_0xf041('0x56')]));delete queues[_0x42e9fd[_0xf041('0x3')]][_0xf041('0x61')];}}}catch(_0x2b6657){utils[_0xf041('0x14')](util[_0xf041('0x2')]('[%s][queues][musiconholdstop]',_0x42e9fd[_0xf041('0x3')]),_0x2b6657);}}; \ No newline at end of file +var _0x5d9d=['connectedlinenum','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','membername','assigned','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','COMPLETEDBY','reason','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transfereelinkedid','queuecallerenterreason','clone','calleridnum','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','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','lodash','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','then','type','CreateVoiceQueueReport','request','transfereduniqueid','uniqueid','debug','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','[%s][queues][queuecallerjoin]','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','error','varset','[%s][queues][varset]','isNil','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]'];(function(_0x34221b,_0x337748){var _0x5a421e=function(_0x14309c){while(--_0x14309c){_0x34221b['push'](_0x34221b['shift']());}};_0x5a421e(++_0x337748);}(_0x5d9d,0x9d));var _0xd5d9=function(_0x17d6c2,_0x3248b4){_0x17d6c2=_0x17d6c2-0x0;var _0x3e5168=_0x5d9d[_0x17d6c2];return _0x3e5168;};'use strict';var _=require(_0xd5d9('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x34c3aa){utils['info'](util[_0xd5d9('0x1')](_0xd5d9('0x2'),_0x34c3aa['uniqueid'],_0x34c3aa[_0xd5d9('0x3')],_0x34c3aa[_0xd5d9('0x4')],_0x34c3aa[_0xd5d9('0x5')],_0x34c3aa['calleridnum'],_0x34c3aa[_0xd5d9('0x6')],_0x34c3aa[_0xd5d9('0x7')]));if(_0x34c3aa[_0xd5d9('0x4')]){utils['getVoiceQueueByName'](_0x34c3aa[_0xd5d9('0x4')])[_0xd5d9('0x8')](function(_0x480dc6){if(_0x480dc6){_0x34c3aa[_0xd5d9('0x9')]=_0x480dc6['type'];}utils['request'](_0xd5d9('0xa'),_0x34c3aa);});}else{utils[_0xd5d9('0xb')]('CreateVoiceQueueReport',_0x34c3aa);}if(_0x34c3aa[_0xd5d9('0xc')]){delete queues[_0x34c3aa[_0xd5d9('0xc')]];}else{delete queues[_0x34c3aa[_0xd5d9('0xd')]];}}exports['queuecallerjoin']=function(_0x22f63b){try{utils[_0xd5d9('0xe')](util[_0xd5d9('0x1')]('[%s][queues][queuecallerjoin]',_0x22f63b['uniqueid']),_0x22f63b);utils[_0xd5d9('0xf')](util[_0xd5d9('0x1')](_0xd5d9('0x10'),_0x22f63b['uniqueid'],_0x22f63b['queue'],_0x22f63b[_0xd5d9('0x11')]));queues[_0x22f63b[_0xd5d9('0xd')]]=_[_0xd5d9('0x12')](_0x22f63b,{'originalposition':_0x22f63b[_0xd5d9('0x11')],'queuecallerjoinAt':utils[_0xd5d9('0x13')](),'mohtime':0x0});}catch(_0x2c1885){utils['error'](util[_0xd5d9('0x1')](_0xd5d9('0x14'),_0x22f63b[_0xd5d9('0xd')]),_0x2c1885);}};exports['hangup']=function(_0x1cf5bf){try{if(!_['isNil'](queues[_0x1cf5bf['uniqueid']])){utils[_0xd5d9('0xe')](util['format'](_0xd5d9('0x15'),_0x1cf5bf['uniqueid']),_0x1cf5bf);if(queues[_0x1cf5bf[_0xd5d9('0xd')]][_0xd5d9('0x16')]){if(!queues[_0x1cf5bf[_0xd5d9('0xd')]][_0xd5d9('0x17')]&&!queues[_0x1cf5bf[_0xd5d9('0xd')]][_0xd5d9('0x18')]){queues[_0x1cf5bf[_0xd5d9('0xd')]][_0xd5d9('0x19')]=!![];queues[_0x1cf5bf[_0xd5d9('0xd')]][_0xd5d9('0x1a')]=utils[_0xd5d9('0x13')]();queues[_0x1cf5bf[_0xd5d9('0xd')]][_0xd5d9('0x7')]=_0xd5d9('0x1b');}utils[_0xd5d9('0xf')](util[_0xd5d9('0x1')](_0xd5d9('0x1c'),_0x1cf5bf[_0xd5d9('0xd')],queues[_0x1cf5bf['uniqueid']][_0xd5d9('0x1d')],queues[_0x1cf5bf[_0xd5d9('0xd')]][_0xd5d9('0x7')]));writeDB(queues[_0x1cf5bf[_0xd5d9('0xd')]]);}else if(queues[_0x1cf5bf['uniqueid']][_0xd5d9('0xc')]){utils[_0xd5d9('0xf')](util['format'](_0xd5d9('0x1e'),_0x1cf5bf[_0xd5d9('0xd')],queues[_0x1cf5bf['uniqueid']][_0xd5d9('0x1d')],queues[_0x1cf5bf[_0xd5d9('0xd')]][_0xd5d9('0xc')]));queues[queues[_0x1cf5bf[_0xd5d9('0xd')]][_0xd5d9('0xc')]]=queues[_0x1cf5bf[_0xd5d9('0xd')]];queues[queues[_0x1cf5bf[_0xd5d9('0xd')]][_0xd5d9('0xc')]]['queuecallerenterreason']=0x2;delete queues[_0x1cf5bf['uniqueid']];}}}catch(_0x2762fc){utils[_0xd5d9('0x1f')](util[_0xd5d9('0x1')]('[%s][queues][hangup]',_0x1cf5bf['uniqueid']),_0x2762fc);}};exports[_0xd5d9('0x20')]=function(_0x179360){try{utils[_0xd5d9('0xe')](util[_0xd5d9('0x1')](_0xd5d9('0x21'),_0x179360[_0xd5d9('0xd')]),_0x179360);if(!_[_0xd5d9('0x22')](_0x179360[_0xd5d9('0x23')]['queuestatus'])&&_0x179360[_0xd5d9('0x24')][_0xd5d9('0x25')]()!==_0xd5d9('0x26')){if(!_[_0xd5d9('0x22')](queues[_0x179360[_0xd5d9('0xd')]])){queues[_0x179360['uniqueid']]['queuecallerabandon']=![];queues[_0x179360[_0xd5d9('0xd')]][_0xd5d9('0x27')]=null;queues[_0x179360['uniqueid']][_0xd5d9('0x18')]=!![];queues[_0x179360[_0xd5d9('0xd')]]['queuecallerexitAt']=utils[_0xd5d9('0x13')]();queues[_0x179360[_0xd5d9('0xd')]][_0xd5d9('0x7')]=_0x179360['value'][_0xd5d9('0x25')]();utils['info'](util[_0xd5d9('0x1')](_0xd5d9('0x28'),_0x179360[_0xd5d9('0xd')],queues[_0x179360['uniqueid']]['name'],_0x179360['value'],queues[_0x179360['uniqueid']][_0xd5d9('0x7')]));writeDB(queues[_0x179360[_0xd5d9('0xd')]]);}}else if(!_['isNil'](_0x179360[_0xd5d9('0x23')][_0xd5d9('0x29')])){if(!_[_0xd5d9('0x22')](queues[_0x179360[_0xd5d9('0xd')]])&&!queues[_0x179360['uniqueid']][_0xd5d9('0x17')]){queues[_0x179360[_0xd5d9('0xd')]][_0xd5d9('0x17')]=![];queues[_0x179360[_0xd5d9('0xd')]][_0xd5d9('0x27')]=null;queues[_0x179360[_0xd5d9('0xd')]][_0xd5d9('0x18')]=!![];queues[_0x179360[_0xd5d9('0xd')]][_0xd5d9('0x2a')]=utils[_0xd5d9('0x13')]();queues[_0x179360['uniqueid']][_0xd5d9('0x7')]=_0xd5d9('0x2b');utils[_0xd5d9('0xf')](util[_0xd5d9('0x1')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x179360['uniqueid'],queues[_0x179360[_0xd5d9('0xd')]][_0xd5d9('0x1d')],_0x179360[_0xd5d9('0x24')],queues[_0x179360[_0xd5d9('0xd')]][_0xd5d9('0x7')]));}}}catch(_0x1b36be){utils['error'](util[_0xd5d9('0x1')]('[%s][queues][varset]',_0x179360[_0xd5d9('0xd')]),_0x1b36be);}};exports['queuecallerabandon']=function(_0x191b7c){try{if(!_[_0xd5d9('0x22')](queues[_0x191b7c[_0xd5d9('0xd')]])){utils[_0xd5d9('0xe')](util['format'](_0xd5d9('0x2c'),_0x191b7c[_0xd5d9('0xd')]),_0x191b7c);queues[_0x191b7c[_0xd5d9('0xd')]][_0xd5d9('0x18')]=![];queues[_0x191b7c[_0xd5d9('0xd')]][_0xd5d9('0x2a')]=null;queues[_0x191b7c[_0xd5d9('0xd')]][_0xd5d9('0x17')]=!![];queues[_0x191b7c['uniqueid']][_0xd5d9('0x27')]=utils[_0xd5d9('0x13')]();queues[_0x191b7c['uniqueid']][_0xd5d9('0x7')]=_0xd5d9('0x2d');utils[_0xd5d9('0xf')](util[_0xd5d9('0x1')](_0xd5d9('0x2e'),_0x191b7c[_0xd5d9('0xd')],queues[_0x191b7c[_0xd5d9('0xd')]]['name'],queues[_0x191b7c[_0xd5d9('0xd')]][_0xd5d9('0x7')]));}}catch(_0x2ed92f){utils[_0xd5d9('0x1f')](util['format'](_0xd5d9('0x2c'),_0x191b7c[_0xd5d9('0xd')]),_0x2ed92f);}};exports[_0xd5d9('0x2f')]=function(_0x284d6f){try{if(!_[_0xd5d9('0x22')](queues[_0x284d6f[_0xd5d9('0xd')]])){utils[_0xd5d9('0xe')](util[_0xd5d9('0x1')](_0xd5d9('0x30'),_0x284d6f[_0xd5d9('0xd')]),_0x284d6f);utils['info'](util['format']('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x284d6f[_0xd5d9('0xd')],queues[_0x284d6f[_0xd5d9('0xd')]]['name'],_0x284d6f[_0xd5d9('0x31')],_0x284d6f['connectedlinename']));queues[_0x284d6f[_0xd5d9('0xd')]][_0xd5d9('0x2f')]=!![];queues[_0x284d6f[_0xd5d9('0xd')]][_0xd5d9('0x16')]=utils[_0xd5d9('0x13')]();queues[_0x284d6f[_0xd5d9('0xd')]][_0xd5d9('0x32')]=utils[_0xd5d9('0x33')](queues[_0x284d6f['uniqueid']][_0xd5d9('0x16')],queues[_0x284d6f[_0xd5d9('0xd')]][_0xd5d9('0x34')]);queues[_0x284d6f[_0xd5d9('0xd')]][_0xd5d9('0x11')]=_0x284d6f['position'];queues[_0x284d6f[_0xd5d9('0xd')]][_0xd5d9('0x35')]=_0x284d6f[_0xd5d9('0x35')];queues[_0x284d6f[_0xd5d9('0xd')]][_0xd5d9('0x31')]=_0x284d6f[_0xd5d9('0x31')];queues[_0x284d6f[_0xd5d9('0xd')]][_0xd5d9('0x36')]=_0x284d6f[_0xd5d9('0x36')];}}catch(_0x9c5125){utils[_0xd5d9('0x1f')](util[_0xd5d9('0x1')](_0xd5d9('0x30'),_0x284d6f[_0xd5d9('0xd')]),_0x9c5125);}};exports[_0xd5d9('0x37')]=function(_0x30b722){try{if(!_[_0xd5d9('0x22')](queues[_0x30b722['uniqueid']])){utils[_0xd5d9('0xe')](util['format'](_0xd5d9('0x38'),_0x30b722['uniqueid']),_0x30b722);utils[_0xd5d9('0xf')](util[_0xd5d9('0x1')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x30b722[_0xd5d9('0xd')],queues[_0x30b722['uniqueid']]['name'],_0x30b722[_0xd5d9('0x39')],_0x30b722['destaccountcode']));queues[_0x30b722[_0xd5d9('0xd')]]['queuecallerabandon']=![];queues[_0x30b722['uniqueid']][_0xd5d9('0x17')]=![];queues[_0x30b722['uniqueid']][_0xd5d9('0x27')]=null;queues[_0x30b722['uniqueid']][_0xd5d9('0x18')]=![];queues[_0x30b722[_0xd5d9('0xd')]]['queuecallerexitreason']=null;queues[_0x30b722['uniqueid']][_0xd5d9('0x2a')]=null;queues[_0x30b722[_0xd5d9('0xd')]][_0xd5d9('0x3a')]=!![];queues[_0x30b722[_0xd5d9('0xd')]][_0xd5d9('0x6')]=_0x30b722[_0xd5d9('0x3b')];queues[_0x30b722[_0xd5d9('0xd')]][_0xd5d9('0x5')]=_0x30b722[_0xd5d9('0x39')];}}catch(_0x1e5b1d){utils[_0xd5d9('0x1f')](util[_0xd5d9('0x1')](_0xd5d9('0x38'),_0x30b722[_0xd5d9('0xd')]),_0x1e5b1d);}};exports[_0xd5d9('0x3c')]=function(_0xe3ed0d){try{if(!_['isNil'](queues[_0xe3ed0d[_0xd5d9('0xd')]])){if(queues[_0xe3ed0d['uniqueid']][_0xd5d9('0x16')]){utils[_0xd5d9('0xe')](util[_0xd5d9('0x1')](_0xd5d9('0x3d'),_0xe3ed0d[_0xd5d9('0xd')]),_0xe3ed0d);queues[_0xe3ed0d[_0xd5d9('0xd')]]['queuecallerabandon']=![];queues[_0xe3ed0d[_0xd5d9('0xd')]][_0xd5d9('0x17')]=![];queues[_0xe3ed0d['uniqueid']][_0xd5d9('0x27')]=null;queues[_0xe3ed0d[_0xd5d9('0xd')]][_0xd5d9('0x18')]=![];queues[_0xe3ed0d[_0xd5d9('0xd')]][_0xd5d9('0x2a')]=null;queues[_0xe3ed0d[_0xd5d9('0xd')]][_0xd5d9('0x3a')]=!![];queues[_0xe3ed0d[_0xd5d9('0xd')]][_0xd5d9('0x5')]=_0xe3ed0d[_0xd5d9('0x39')];queues[_0xe3ed0d['uniqueid']][_0xd5d9('0x19')]=!![];queues[_0xe3ed0d['uniqueid']][_0xd5d9('0x1a')]=utils[_0xd5d9('0x13')]();if(_0xe3ed0d['reason']==_0xd5d9('0x3e')){if(!queues[_0xe3ed0d[_0xd5d9('0xd')]][_0xd5d9('0x3e')]){queues[_0xe3ed0d[_0xd5d9('0xd')]]['queuecallerexitreason']=_0xd5d9('0x3f');}}else{queues[_0xe3ed0d[_0xd5d9('0xd')]][_0xd5d9('0x7')]=_0xd5d9('0x40')+_0xe3ed0d[_0xd5d9('0x41')][_0xd5d9('0x25')]();}utils[_0xd5d9('0xf')](util[_0xd5d9('0x1')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0xe3ed0d[_0xd5d9('0xd')],queues[_0xe3ed0d[_0xd5d9('0xd')]][_0xd5d9('0x1d')],_0xe3ed0d[_0xd5d9('0x39')],queues[_0xe3ed0d[_0xd5d9('0xd')]][_0xd5d9('0x7')]));writeDB(queues[_0xe3ed0d[_0xd5d9('0xd')]]);}}}catch(_0x5baefa){utils[_0xd5d9('0x1f')](util[_0xd5d9('0x1')](_0xd5d9('0x3d'),_0xe3ed0d[_0xd5d9('0xd')]),_0x5baefa);}};exports[_0xd5d9('0x42')]=function(_0x4456db){try{if(!_['isNil'](queues[_0x4456db[_0xd5d9('0x43')]])){utils[_0xd5d9('0xe')](util[_0xd5d9('0x1')](_0xd5d9('0x44'),_0x4456db[_0xd5d9('0xd')]),_0x4456db);queues[_0x4456db[_0xd5d9('0x43')]]['transfer']=!![];queues[_0x4456db['transfereeuniqueid']][_0xd5d9('0x45')]=_0xd5d9('0x46');queues[_0x4456db[_0xd5d9('0x43')]][_0xd5d9('0x47')]=_0x4456db['extension'];queues[_0x4456db['transfereeuniqueid']][_0xd5d9('0x48')]=_0x4456db[_0xd5d9('0x43')];queues[_0x4456db['transfereeuniqueid']][_0xd5d9('0x7')]=_0xd5d9('0x49');utils['info'](util['format'](_0xd5d9('0x4a'),_0x4456db['uniqueid'],queues[_0x4456db[_0xd5d9('0x43')]][_0xd5d9('0x1d')],_0x4456db['transfereeuniqueid'],_0x4456db['extension']));}}catch(_0x23cfe3){utils[_0xd5d9('0x1f')](util['format'](_0xd5d9('0x44'),_0x4456db[_0xd5d9('0xd')]),_0x23cfe3);}};exports[_0xd5d9('0x4b')]=function(_0xd193f6){try{utils[_0xd5d9('0xe')](util[_0xd5d9('0x1')](_0xd5d9('0x4c'),_0xd193f6['origtransfereruniqueid']),_0xd193f6);if(_0xd193f6[_0xd5d9('0x4d')]==_0xd193f6[_0xd5d9('0x4e')]){if(!_[_0xd5d9('0x22')](queues[_0xd193f6[_0xd5d9('0x4f')]])){utils['info'](util[_0xd5d9('0x1')](_0xd5d9('0x50'),_0xd193f6[_0xd5d9('0x4d')],queues[_0xd193f6[_0xd5d9('0x4f')]][_0xd5d9('0x1d')],_0xd193f6[_0xd5d9('0x51')]));queues[_0xd193f6[_0xd5d9('0x4f')]][_0xd5d9('0x3e')]=!![];queues[_0xd193f6[_0xd5d9('0x4f')]][_0xd5d9('0x45')]=_0xd5d9('0x52');queues[_0xd193f6[_0xd5d9('0x4f')]][_0xd5d9('0x47')]=_0xd193f6[_0xd5d9('0x51')];queues[_0xd193f6[_0xd5d9('0x4f')]][_0xd5d9('0x48')]=_0xd193f6['origtransfereruniqueid'];queues[_0xd193f6[_0xd5d9('0x4f')]][_0xd5d9('0x7')]='ATTENDEDTRANSFER';}if(!_[_0xd5d9('0x22')](queues[_0xd193f6[_0xd5d9('0x4e')]])){if(_0xd193f6['transfereelinkedid']&&queues[_0xd193f6[_0xd5d9('0x53')]]){queues[_0xd193f6['transfereelinkedid']][_0xd5d9('0x54')]=0x1;queues[_0xd193f6['transfereeuniqueid']]=_[_0xd5d9('0x55')](queues[_0xd193f6[_0xd5d9('0x53')]]);queues[_0xd193f6['transfereeuniqueid']][_0xd5d9('0xc')]=_0xd193f6['transfertargetuniqueid'];queues[_0xd193f6[_0xd5d9('0x43')]][_0xd5d9('0x54')]=0x2;queues[_0xd193f6['transfereeuniqueid']]['calleridnum']=queues[_0xd193f6[_0xd5d9('0x4f')]][_0xd5d9('0x56')];queues[_0xd193f6['transfereeuniqueid']][_0xd5d9('0x57')]=queues[_0xd193f6['secondtransfererlinkedid']][_0xd5d9('0x57')];queues[_0xd193f6['transfereeuniqueid']][_0xd5d9('0x34')]=utils[_0xd5d9('0x13')]();queues[_0xd193f6['transfereeuniqueid']][_0xd5d9('0x16')]=utils[_0xd5d9('0x13')]();queues[_0xd193f6['transfereeuniqueid']][_0xd5d9('0x32')]=0x0;queues[_0xd193f6['transfereeuniqueid']][_0xd5d9('0x58')]=0x0;utils[_0xd5d9('0xf')](util[_0xd5d9('0x1')](_0xd5d9('0x59'),_0xd193f6[_0xd5d9('0x4d')],queues[_0xd193f6[_0xd5d9('0x43')]][_0xd5d9('0x1d')],queues[_0xd193f6['transfereeuniqueid']][_0xd5d9('0x56')],queues[_0xd193f6['transfereeuniqueid']][_0xd5d9('0x57')]));}else{utils[_0xd5d9('0xf')](util[_0xd5d9('0x1')](_0xd5d9('0x5a'),_0xd193f6[_0xd5d9('0x4d')],queues[_0xd193f6[_0xd5d9('0x4e')]]['name'],_0xd193f6[_0xd5d9('0x4f')]));queues[_0xd193f6[_0xd5d9('0x4e')]][_0xd5d9('0xc')]=_0xd193f6['secondtransfererlinkedid'];}}}else if(_0xd193f6[_0xd5d9('0x5b')]==_0xd193f6[_0xd5d9('0x4f')]){if(!_['isNil'](queues[_0xd193f6['origtransfererlinkedid']])){utils[_0xd5d9('0xf')](util[_0xd5d9('0x1')](_0xd5d9('0x5c'),_0xd193f6[_0xd5d9('0x4d')],queues[_0xd193f6['origtransfererlinkedid']][_0xd5d9('0x1d')],_0xd193f6[_0xd5d9('0x5b')],_0xd193f6['secondtransfererexten']));queues[_0xd193f6[_0xd5d9('0x4e')]][_0xd5d9('0x3e')]=!![];queues[_0xd193f6[_0xd5d9('0x4e')]][_0xd5d9('0x45')]=_0xd5d9('0x52');queues[_0xd193f6[_0xd5d9('0x4e')]][_0xd5d9('0x47')]=_0xd193f6[_0xd5d9('0x5d')];queues[_0xd193f6[_0xd5d9('0x4e')]][_0xd5d9('0x48')]=_0xd193f6['secondtransfereruniqueid'];queues[_0xd193f6[_0xd5d9('0x4e')]][_0xd5d9('0x7')]='ATTENDEDTRANSFER';}if(!_[_0xd5d9('0x22')](queues[_0xd193f6['secondtransfererlinkedid']])){if(_0xd193f6[_0xd5d9('0x5e')]&&queues[_0xd193f6[_0xd5d9('0x5e')]]){queues[_0xd193f6[_0xd5d9('0x5e')]][_0xd5d9('0x54')]=0x1;queues[_0xd193f6[_0xd5d9('0x5f')]]=_[_0xd5d9('0x55')](queues[_0xd193f6['transfertargetlinkedid']]);queues[_0xd193f6[_0xd5d9('0x5f')]]['transfereduniqueid']=_0xd193f6[_0xd5d9('0x5f')];queues[_0xd193f6[_0xd5d9('0x5f')]]['queuecallerenterreason']=0x2;queues[_0xd193f6[_0xd5d9('0x5f')]][_0xd5d9('0x56')]=queues[_0xd193f6[_0xd5d9('0x4e')]][_0xd5d9('0x56')];queues[_0xd193f6[_0xd5d9('0x5f')]][_0xd5d9('0x57')]=queues[_0xd193f6[_0xd5d9('0x4e')]]['calleridname'];queues[_0xd193f6[_0xd5d9('0x5f')]]['queuecallerjoinAt']=utils[_0xd5d9('0x13')]();queues[_0xd193f6[_0xd5d9('0x5f')]][_0xd5d9('0x16')]=utils['now']();queues[_0xd193f6[_0xd5d9('0x5f')]][_0xd5d9('0x32')]=0x0;queues[_0xd193f6[_0xd5d9('0x5f')]][_0xd5d9('0x58')]=0x0;utils['info'](util[_0xd5d9('0x1')](_0xd5d9('0x60'),_0xd193f6[_0xd5d9('0x4d')],queues[_0xd193f6[_0xd5d9('0x5f')]][_0xd5d9('0x1d')],queues[_0xd193f6['transfertargetuniqueid']]['transfereduniqueid'],queues[_0xd193f6[_0xd5d9('0x5f')]][_0xd5d9('0x56')],queues[_0xd193f6[_0xd5d9('0x5f')]][_0xd5d9('0x57')]));}else{utils[_0xd5d9('0xf')](util['format'](_0xd5d9('0x5a'),_0xd193f6[_0xd5d9('0x4d')],queues[_0xd193f6[_0xd5d9('0x4f')]]['name'],_0xd193f6[_0xd5d9('0x4e')]));queues[_0xd193f6[_0xd5d9('0x4f')]][_0xd5d9('0xc')]=_0xd193f6[_0xd5d9('0x4e')];}}}}catch(_0x3ca235){utils[_0xd5d9('0x1f')](util['format']('[%s][queues][attendedtransfer]',_0xd193f6[_0xd5d9('0x4d')]),_0x3ca235);}};exports[_0xd5d9('0x61')]=function(_0x433fc1){try{if(!_[_0xd5d9('0x22')](queues[_0x433fc1[_0xd5d9('0xd')]])){utils[_0xd5d9('0xe')](util[_0xd5d9('0x1')](_0xd5d9('0x62'),_0x433fc1[_0xd5d9('0xd')]),_0x433fc1);queues[_0x433fc1[_0xd5d9('0xd')]][_0xd5d9('0x63')]=utils[_0xd5d9('0x13')]();utils[_0xd5d9('0xf')](util['format'](_0xd5d9('0x64'),_0x433fc1[_0xd5d9('0xd')],queues[_0x433fc1[_0xd5d9('0xd')]]['name'],queues[_0x433fc1[_0xd5d9('0xd')]][_0xd5d9('0x63')]));}}catch(_0x2b10d3){utils[_0xd5d9('0x1f')](util[_0xd5d9('0x1')](_0xd5d9('0x62'),_0x433fc1[_0xd5d9('0xd')]),_0x2b10d3);}};exports[_0xd5d9('0x65')]=function(_0x2deb49){try{if(!_['isNil'](queues[_0x2deb49[_0xd5d9('0xd')]])){if(!_['isNil'](queues[_0x2deb49[_0xd5d9('0xd')]][_0xd5d9('0x63')])){utils['debug'](util[_0xd5d9('0x1')]('[%s][queues][musiconholdstop]',_0x2deb49['uniqueid']),_0x2deb49);queues[_0x2deb49['uniqueid']]['mohtime']+=utils['diffTime'](utils[_0xd5d9('0x13')](),queues[_0x2deb49[_0xd5d9('0xd')]]['musiconholdstartAt']);utils['info'](util['format'](_0xd5d9('0x66'),_0x2deb49[_0xd5d9('0xd')],queues[_0x2deb49[_0xd5d9('0xd')]][_0xd5d9('0x1d')],queues[_0x2deb49['uniqueid']][_0xd5d9('0x58')]));delete queues[_0x2deb49[_0xd5d9('0xd')]][_0xd5d9('0x63')];}}}catch(_0x273688){utils[_0xd5d9('0x1f')](util[_0xd5d9('0x1')]('[%s][queues][musiconholdstop]',_0x2deb49[_0xd5d9('0xd')]),_0x273688);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 9ef7d8e..7d662e4 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 _0x89b3=['name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','context','exten','channel','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','varset','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','.WAV','monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfereecalleridname','transfereruniqueid','recording','lodash','./utils','info','format','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername'];(function(_0x5ebc2a,_0x188637){var _0x256a03=function(_0x223b50){while(--_0x223b50){_0x5ebc2a['push'](_0x5ebc2a['shift']());}};_0x256a03(++_0x188637);}(_0x89b3,0xc7));var _0x389b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x89b3[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x389b('0x0'));var util=require('util');var utils=require(_0x389b('0x1'));var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x4e73ab){var _0x119f31;utils[_0x389b('0x2')](util[_0x389b('0x3')]('[%s][recordings][writeDB]',_0x4e73ab[_0x389b('0x4')]));if(transfers['blinds'][_0x4e73ab['uniqueid']]){_0x119f31=_0x4e73ab[_0x389b('0x4')];_0x4e73ab[_0x389b('0x4')]=transfers[_0x389b('0x5')][_0x4e73ab['uniqueid']][_0x389b('0x6')];}if(_0x4e73ab[_0x389b('0x7')]){utils[_0x389b('0x8')](_0x4e73ab[_0x389b('0x7')])[_0x389b('0x9')](function(_0x31ae27){if(_0x31ae27){_0x4e73ab[_0x389b('0xa')]=_0x31ae27[_0x389b('0xb')];_0x4e73ab[_0x389b('0xc')]=_0x31ae27['id'];}utils[_0x389b('0xd')]('CreateVoiceRecording',_0x4e73ab);});}else{utils[_0x389b('0xd')](_0x389b('0xe'),_0x4e73ab);}if(_0x119f31)delete transfers[_0x389b('0x5')][_0x119f31];}exports[_0x389b('0xf')]=function(_0xc069f8){try{utils[_0x389b('0x10')](util[_0x389b('0x3')](_0x389b('0x11'),_0xc069f8[_0x389b('0x4')]),_0xc069f8);if(_0xc069f8['uniqueid']==_0xc069f8['linkedid']){utils['info'](util['format']('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0xc069f8[_0x389b('0x4')],_0xc069f8[_0x389b('0x12')],_0xc069f8[_0x389b('0x13')]));recordings[_0xc069f8[_0x389b('0x4')]]={'uniqueid':_0xc069f8[_0x389b('0x4')],'accountcode':_0xc069f8[_0x389b('0x7')],'exten':_0xc069f8[_0x389b('0x13')],'context':_0xc069f8[_0x389b('0x12')],'channel':_0xc069f8[_0x389b('0x14')],'monitors':[]};}}catch(_0x48014d){utils['error'](util[_0x389b('0x3')](_0x389b('0x11'),_0xc069f8[_0x389b('0x4')]),_0x48014d);}};exports[_0x389b('0x15')]=function(_0x2d766b){try{utils[_0x389b('0x10')](util['format'](_0x389b('0x16'),_0x2d766b[_0x389b('0x4')]),_0x2d766b);if(!_[_0x389b('0x17')](recordings[_0x2d766b['uniqueid']])&&_0x2d766b[_0x389b('0x18')]==0x6){utils[_0x389b('0x2')](util['format'](_0x389b('0x19'),_0x2d766b['uniqueid'],_0x2d766b[_0x389b('0x12')],_0x2d766b[_0x389b('0x14')]));}else if(!_[_0x389b('0x17')](recordings[_0x2d766b[_0x389b('0x1a')]])&&_0x2d766b[_0x389b('0x18')]==0x6&&_0x2d766b['context']!=_0x389b('0x1b')){utils[_0x389b('0x2')](util[_0x389b('0x3')](_0x389b('0x1c'),_0x2d766b['uniqueid'],_0x2d766b['linkedid'],_0x2d766b[_0x389b('0x12')],_0x2d766b[_0x389b('0x14')]));recordings[_0x2d766b['linkedid']]['accountcode']=_0x2d766b[_0x389b('0x7')];}}catch(_0x3d7eb0){utils[_0x389b('0x1d')](util['format']('[%s][recordings][newstate]',_0x2d766b[_0x389b('0x4')]),_0x3d7eb0);}};exports[_0x389b('0x1e')]=function(_0x13260a){try{if(!_[_0x389b('0x17')](_0x13260a[_0x389b('0x1f')])&&!_['isNil'](_0x13260a[_0x389b('0x1f')]['mixmonitor_filename'])){utils['debug'](util['format'](_0x389b('0x20'),_0x13260a[_0x389b('0x4')]),_0x13260a);utils['info'](util[_0x389b('0x3')](_0x389b('0x21'),_0x13260a[_0x389b('0x4')],_0x13260a[_0x389b('0x1f')],_0x13260a[_0x389b('0x22')]));if(_[_0x389b('0x23')](_0x13260a[_0x389b('0x22')],'.wav49')){_0x13260a[_0x389b('0x22')]=_0x13260a[_0x389b('0x22')]['replace'](_0x389b('0x24'),_0x389b('0x25'));}if(recordings[_0x13260a['linkedid']]){var _0x427c2f=_['find'](recordings[_0x13260a[_0x389b('0x1a')]][_0x389b('0x26')],{'value':_0x13260a['value']});if(_[_0x389b('0x17')](_0x427c2f)){recordings[_0x13260a[_0x389b('0x1a')]]['monitors'][_0x389b('0x27')]({'value':_0x13260a[_0x389b('0x22')]});}}}}catch(_0x30a43d){utils[_0x389b('0x1d')](util[_0x389b('0x3')](_0x389b('0x20'),_0x13260a[_0x389b('0x4')]),_0x30a43d);}};exports['hangup']=function(_0x2d3135){try{if(!_['isNil'](recordings[_0x2d3135[_0x389b('0x4')]])){utils[_0x389b('0x10')](util[_0x389b('0x3')](_0x389b('0x28'),_0x2d3135[_0x389b('0x4')]),_0x2d3135);utils['info'](util[_0x389b('0x3')](_0x389b('0x29'),_0x2d3135[_0x389b('0x4')],_0x2d3135['calleridnum'],_0x2d3135[_0x389b('0x2a')],_0x2d3135[_0x389b('0x2b')]));recordings[_0x2d3135['uniqueid']][_0x389b('0x2c')]=_0x2d3135[_0x389b('0x2c')];recordings[_0x2d3135['uniqueid']][_0x389b('0x2a')]=_0x2d3135[_0x389b('0x2a')];recordings[_0x2d3135[_0x389b('0x4')]][_0x389b('0x2d')]=_0x2d3135[_0x389b('0x2d')];recordings[_0x2d3135[_0x389b('0x4')]]['connectedlinename']=_0x2d3135[_0x389b('0x2e')];if(recordings[_0x2d3135[_0x389b('0x4')]][_0x389b('0x2f')]==_0x389b('0x30')&&recordings[_0x2d3135[_0x389b('0x4')]][_0x389b('0x7')]){recordings[_0x2d3135[_0x389b('0x4')]][_0x389b('0x2d')]=recordings[_0x2d3135[_0x389b('0x4')]]['accountcode'];recordings[_0x2d3135[_0x389b('0x4')]][_0x389b('0x2e')]='';}recordings[_0x2d3135[_0x389b('0x4')]][_0x389b('0x26')][_0x389b('0x31')](function(_0xbb2ca2){var _0x391644=_['clone'](recordings[_0x2d3135[_0x389b('0x4')]]);_0x391644[_0x389b('0x22')]=_0xbb2ca2['value'];writeDB(_0x391644);});delete recordings[_0x2d3135[_0x389b('0x4')]];}}catch(_0x568a02){utils['error'](util[_0x389b('0x3')](_0x389b('0x28'),_0x2d3135[_0x389b('0x4')]),_0x568a02);}};exports[_0x389b('0x32')]=function(_0x3acb1a){try{if(!_[_0x389b('0x17')](recordings[_0x3acb1a[_0x389b('0x4')]])){utils['debug'](util[_0x389b('0x3')](_0x389b('0x33'),_0x3acb1a[_0x389b('0x4')]),_0x3acb1a);utils[_0x389b('0x2')](util[_0x389b('0x3')](_0x389b('0x34'),_0x3acb1a['uniqueid'],_0x3acb1a[_0x389b('0x35')],_0x3acb1a[_0x389b('0x36')]));if(_0x3acb1a[_0x389b('0x35')][_0x389b('0x37')]()==_0x389b('0x38')&&_[_0x389b('0x39')](_0x3acb1a['appdata'][_0x389b('0x37')](),_0x389b('0x3a'))){var _0x83f59=_0x3acb1a[_0x389b('0x36')]['split']('=');var _0x1ae1ee=_0x83f59[0x0][_0x389b('0x3b')](_0x83f59[0x0][_0x389b('0x3c')]('(')+0x1,_0x83f59[0x0][_0x389b('0x3c')](')'));var _0x2c56b8=_0x83f59[0x1];recordings[_0x3acb1a[_0x389b('0x4')]][_0x1ae1ee]=_0x2c56b8;}}}catch(_0x289bf3){utils[_0x389b('0x1d')](util[_0x389b('0x3')](_0x389b('0x33'),_0x3acb1a['uniqueid']),_0x289bf3);}};exports[_0x389b('0x3d')]=function(_0x3d1dd1){try{if(!_[_0x389b('0x17')](recordings[_0x3d1dd1['uniqueid']])){utils[_0x389b('0x10')](util['format']('[%s][recordings][queuecallerjoin]',_0x3d1dd1[_0x389b('0x4')]),_0x3d1dd1);utils[_0x389b('0x2')](util[_0x389b('0x3')](_0x389b('0x3e'),_0x3d1dd1[_0x389b('0x4')],_0x3d1dd1[_0x389b('0x3f')]));recordings[_0x3d1dd1[_0x389b('0x4')]][_0x389b('0x3f')]=_0x3d1dd1[_0x389b('0x3f')];}}catch(_0x89a889){utils[_0x389b('0x1d')](util[_0x389b('0x3')]('[%s][recordings][queuecallerjoin]',_0x3d1dd1[_0x389b('0x4')]),_0x89a889);}};exports[_0x389b('0x40')]=function(_0x58724b){try{utils['debug'](util[_0x389b('0x3')](_0x389b('0x41'),_0x58724b['uniqueid']),_0x58724b);utils[_0x389b('0x2')](util[_0x389b('0x3')](_0x389b('0x42'),_0x58724b[_0x389b('0x4')],_0x58724b['transferercalleridnum'],_0x58724b['transferercalleridname'],_0x58724b['transfereecalleridnum'],_0x58724b[_0x389b('0x43')]));if(recordings[_0x58724b[_0x389b('0x44')]]&&transfers[_0x389b('0x5')][_0x58724b[_0x389b('0x44')]]){transfers[_0x389b('0x5')][_0x58724b['transfereruniqueid']][_0x389b('0x45')]=!![];}}catch(_0x5ef8b3){utils[_0x389b('0x1d')](util[_0x389b('0x3')](_0x389b('0x41'),_0x58724b[_0x389b('0x4')]),_0x5ef8b3);}}; \ No newline at end of file +var _0x5808=['debug','[%s][recordings][newstate]','channelstate','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','[%s][recordings][newexten]','application','appdata','toLowerCase','startsWith','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','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','then','membername','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','linkedid','context','exten','channel'];(function(_0x469510,_0x1bceac){var _0x3bc121=function(_0x5c300c){while(--_0x5c300c){_0x469510['push'](_0x469510['shift']());}};_0x3bc121(++_0x1bceac);}(_0x5808,0x1a6));var _0x8580=function(_0x356e8d,_0x24c719){_0x356e8d=_0x356e8d-0x0;var _0x39e65a=_0x5808[_0x356e8d];return _0x39e65a;};'use strict';var _=require(_0x8580('0x0'));var util=require(_0x8580('0x1'));var utils=require(_0x8580('0x2'));var transfers=require(_0x8580('0x3'));var recordings={};function writeDB(_0x4795b9){var _0x2adc7c;utils[_0x8580('0x4')](util[_0x8580('0x5')](_0x8580('0x6'),_0x4795b9['uniqueid']));if(transfers[_0x8580('0x7')][_0x4795b9[_0x8580('0x8')]]){_0x2adc7c=_0x4795b9[_0x8580('0x8')];_0x4795b9['uniqueid']=transfers[_0x8580('0x7')][_0x4795b9[_0x8580('0x8')]][_0x8580('0x9')];}if(_0x4795b9[_0x8580('0xa')]){utils[_0x8580('0xb')](_0x4795b9[_0x8580('0xa')])[_0x8580('0xc')](function(_0x3225d6){if(_0x3225d6){_0x4795b9[_0x8580('0xd')]=_0x3225d6['name'];_0x4795b9['UserId']=_0x3225d6['id'];}utils[_0x8580('0xe')](_0x8580('0xf'),_0x4795b9);});}else{utils[_0x8580('0xe')](_0x8580('0xf'),_0x4795b9);}if(_0x2adc7c)delete transfers[_0x8580('0x7')][_0x2adc7c];}exports[_0x8580('0x10')]=function(_0x118410){try{utils['debug'](util[_0x8580('0x5')](_0x8580('0x11'),_0x118410['uniqueid']),_0x118410);if(_0x118410['uniqueid']==_0x118410[_0x8580('0x12')]){utils[_0x8580('0x4')](util[_0x8580('0x5')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x118410['uniqueid'],_0x118410[_0x8580('0x13')],_0x118410['exten']));recordings[_0x118410[_0x8580('0x8')]]={'uniqueid':_0x118410[_0x8580('0x8')],'accountcode':_0x118410[_0x8580('0xa')],'exten':_0x118410[_0x8580('0x14')],'context':_0x118410[_0x8580('0x13')],'channel':_0x118410[_0x8580('0x15')],'monitors':[]};}}catch(_0xc7348a){utils['error'](util[_0x8580('0x5')](_0x8580('0x11'),_0x118410[_0x8580('0x8')]),_0xc7348a);}};exports['newstate']=function(_0x1b1b5b){try{utils[_0x8580('0x16')](util[_0x8580('0x5')](_0x8580('0x17'),_0x1b1b5b['uniqueid']),_0x1b1b5b);if(!_['isNil'](recordings[_0x1b1b5b[_0x8580('0x8')]])&&_0x1b1b5b[_0x8580('0x18')]==0x6){utils[_0x8580('0x4')](util[_0x8580('0x5')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x1b1b5b[_0x8580('0x8')],_0x1b1b5b['context'],_0x1b1b5b[_0x8580('0x15')]));}else if(!_[_0x8580('0x19')](recordings[_0x1b1b5b[_0x8580('0x12')]])&&_0x1b1b5b[_0x8580('0x18')]==0x6&&_0x1b1b5b[_0x8580('0x13')]!=_0x8580('0x1a')){utils['info'](util[_0x8580('0x5')](_0x8580('0x1b'),_0x1b1b5b[_0x8580('0x8')],_0x1b1b5b[_0x8580('0x12')],_0x1b1b5b['context'],_0x1b1b5b['channel']));recordings[_0x1b1b5b[_0x8580('0x12')]][_0x8580('0xa')]=_0x1b1b5b[_0x8580('0xa')];}}catch(_0x16e667){utils[_0x8580('0x1c')](util[_0x8580('0x5')](_0x8580('0x17'),_0x1b1b5b[_0x8580('0x8')]),_0x16e667);}};exports[_0x8580('0x1d')]=function(_0x2ee78a){try{if(!_['isNil'](_0x2ee78a[_0x8580('0x1e')])&&!_[_0x8580('0x19')](_0x2ee78a[_0x8580('0x1e')][_0x8580('0x1f')])){utils[_0x8580('0x16')](util['format'](_0x8580('0x20'),_0x2ee78a[_0x8580('0x8')]),_0x2ee78a);utils[_0x8580('0x4')](util[_0x8580('0x5')](_0x8580('0x21'),_0x2ee78a[_0x8580('0x8')],_0x2ee78a[_0x8580('0x1e')],_0x2ee78a[_0x8580('0x22')]));if(_[_0x8580('0x23')](_0x2ee78a['value'],_0x8580('0x24'))){_0x2ee78a['value']=_0x2ee78a[_0x8580('0x22')][_0x8580('0x25')](_0x8580('0x24'),_0x8580('0x26'));}if(recordings[_0x2ee78a[_0x8580('0x12')]]){var _0x4fd8db=_[_0x8580('0x27')](recordings[_0x2ee78a[_0x8580('0x12')]]['monitors'],{'value':_0x2ee78a['value']});if(_[_0x8580('0x19')](_0x4fd8db)){recordings[_0x2ee78a['linkedid']][_0x8580('0x28')]['push']({'value':_0x2ee78a[_0x8580('0x22')]});}}}}catch(_0x2e0aa0){utils[_0x8580('0x1c')](util['format']('[%s][recordings][varset]',_0x2ee78a[_0x8580('0x8')]),_0x2e0aa0);}};exports[_0x8580('0x29')]=function(_0x538075){try{if(!_['isNil'](recordings[_0x538075[_0x8580('0x8')]])){utils[_0x8580('0x16')](util[_0x8580('0x5')](_0x8580('0x2a'),_0x538075[_0x8580('0x8')]),_0x538075);utils['info'](util['format'](_0x8580('0x2b'),_0x538075['uniqueid'],_0x538075[_0x8580('0x2c')],_0x538075[_0x8580('0x2d')],_0x538075[_0x8580('0x2e')]));recordings[_0x538075[_0x8580('0x8')]][_0x8580('0x2c')]=_0x538075[_0x8580('0x2c')];recordings[_0x538075['uniqueid']][_0x8580('0x2d')]=_0x538075[_0x8580('0x2d')];recordings[_0x538075['uniqueid']][_0x8580('0x2f')]=_0x538075[_0x8580('0x2f')];recordings[_0x538075[_0x8580('0x8')]][_0x8580('0x30')]=_0x538075[_0x8580('0x30')];if(recordings[_0x538075['uniqueid']][_0x8580('0x31')]==_0x8580('0x32')&&recordings[_0x538075[_0x8580('0x8')]]['accountcode']){recordings[_0x538075[_0x8580('0x8')]][_0x8580('0x2f')]=recordings[_0x538075[_0x8580('0x8')]]['accountcode'];recordings[_0x538075[_0x8580('0x8')]][_0x8580('0x30')]='';}recordings[_0x538075[_0x8580('0x8')]]['monitors'][_0x8580('0x33')](function(_0x4d7eea){var _0x6f13ce=_['clone'](recordings[_0x538075[_0x8580('0x8')]]);_0x6f13ce['value']=_0x4d7eea[_0x8580('0x22')];writeDB(_0x6f13ce);});delete recordings[_0x538075[_0x8580('0x8')]];}}catch(_0x1ec42f){utils[_0x8580('0x1c')](util[_0x8580('0x5')](_0x8580('0x2a'),_0x538075[_0x8580('0x8')]),_0x1ec42f);}};exports[_0x8580('0x34')]=function(_0x156798){try{if(!_[_0x8580('0x19')](recordings[_0x156798['uniqueid']])){utils[_0x8580('0x16')](util['format'](_0x8580('0x35'),_0x156798[_0x8580('0x8')]),_0x156798);utils[_0x8580('0x4')](util[_0x8580('0x5')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x156798[_0x8580('0x8')],_0x156798[_0x8580('0x36')],_0x156798[_0x8580('0x37')]));if(_0x156798[_0x8580('0x36')][_0x8580('0x38')]()=='set'&&_[_0x8580('0x39')](_0x156798[_0x8580('0x37')][_0x8580('0x38')](),_0x8580('0x3a'))){var _0x3e901d=_0x156798[_0x8580('0x37')][_0x8580('0x3b')]('=');var _0x35a990=_0x3e901d[0x0][_0x8580('0x3c')](_0x3e901d[0x0][_0x8580('0x3d')]('(')+0x1,_0x3e901d[0x0][_0x8580('0x3d')](')'));var _0x394cf8=_0x3e901d[0x1];recordings[_0x156798['uniqueid']][_0x35a990]=_0x394cf8;}}}catch(_0x214118){utils[_0x8580('0x1c')](util[_0x8580('0x5')]('[%s][recordings][newexten]',_0x156798[_0x8580('0x8')]),_0x214118);}};exports[_0x8580('0x3e')]=function(_0x1f5f10){try{if(!_[_0x8580('0x19')](recordings[_0x1f5f10[_0x8580('0x8')]])){utils[_0x8580('0x16')](util[_0x8580('0x5')](_0x8580('0x3f'),_0x1f5f10[_0x8580('0x8')]),_0x1f5f10);utils['info'](util[_0x8580('0x5')](_0x8580('0x40'),_0x1f5f10[_0x8580('0x8')],_0x1f5f10[_0x8580('0x41')]));recordings[_0x1f5f10[_0x8580('0x8')]][_0x8580('0x41')]=_0x1f5f10['queue'];}}catch(_0x92ef41){utils[_0x8580('0x1c')](util['format']('[%s][recordings][queuecallerjoin]',_0x1f5f10['uniqueid']),_0x92ef41);}};exports[_0x8580('0x42')]=function(_0x2b9615){try{utils[_0x8580('0x16')](util['format'](_0x8580('0x43'),_0x2b9615['uniqueid']),_0x2b9615);utils[_0x8580('0x4')](util[_0x8580('0x5')](_0x8580('0x44'),_0x2b9615[_0x8580('0x8')],_0x2b9615[_0x8580('0x45')],_0x2b9615[_0x8580('0x46')],_0x2b9615['transfereecalleridnum'],_0x2b9615[_0x8580('0x47')]));if(recordings[_0x2b9615[_0x8580('0x48')]]&&transfers[_0x8580('0x7')][_0x2b9615[_0x8580('0x48')]]){transfers['blinds'][_0x2b9615[_0x8580('0x48')]][_0x8580('0x49')]=!![];}}catch(_0x518bd5){utils[_0x8580('0x1c')](util['format']('[%s][recordings][blindtransfer]',_0x2b9615[_0x8580('0x8')]),_0x518bd5);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 3b9c8e8..bf7598f 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 _0x8b5c=['info','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','format','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransferercalleridnum','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils'];(function(_0x167871,_0xdbc24){var _0x3ae532=function(_0x4e9ab5){while(--_0x4e9ab5){_0x167871['push'](_0x167871['shift']());}};_0x3ae532(++_0xdbc24);}(_0x8b5c,0x1a1));var _0xc8b5=function(_0x48e41c,_0xdb8e10){_0x48e41c=_0x48e41c-0x0;var _0x1259b2=_0x8b5c[_0x48e41c];return _0x1259b2;};'use strict';var _=require(_0xc8b5('0x0'));var util=require(_0xc8b5('0x1'));var utils=require(_0xc8b5('0x2'));function writeDB(_0x1f8006){utils[_0xc8b5('0x3')](util['format'](_0xc8b5('0x4'),_0x1f8006[_0xc8b5('0x5')]===_0xc8b5('0x6')?_0x1f8006[_0xc8b5('0x7')]:_0x1f8006['uniqueid'],_0x1f8006['type']));utils[_0xc8b5('0x8')](_0xc8b5('0x9'),_0x1f8006);}exports[_0xc8b5('0xa')]={};exports[_0xc8b5('0xb')]=function(_0x208461){try{utils[_0xc8b5('0xc')](util[_0xc8b5('0xd')](_0xc8b5('0xe'),_0x208461[_0xc8b5('0xf')]),_0x208461);utils[_0xc8b5('0x3')](util[_0xc8b5('0xd')](_0xc8b5('0x10'),_0x208461['uniqueid'],_0x208461[_0xc8b5('0x11')],_0x208461[_0xc8b5('0x12')],_0x208461[_0xc8b5('0x13')],_0x208461['transfereecalleridname']));_0x208461[_0xc8b5('0x5')]=_0xc8b5('0x14');exports[_0xc8b5('0xa')][_0x208461['transfereruniqueid']]=_0x208461;writeDB(_0x208461);}catch(_0x382fe7){utils[_0xc8b5('0x15')](util[_0xc8b5('0xd')]('[%s][transfers][blindtransfer]',_0x208461['uniqueid']),_0x382fe7);}};exports[_0xc8b5('0x16')]=function(_0x5c9adc){try{utils[_0xc8b5('0xc')](util[_0xc8b5('0xd')](_0xc8b5('0x17'),_0x5c9adc[_0xc8b5('0x7')]),_0x5c9adc);utils[_0xc8b5('0x3')](util[_0xc8b5('0xd')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x5c9adc[_0xc8b5('0x7')],_0x5c9adc[_0xc8b5('0x18')],_0x5c9adc['origtransferercalleridname'],_0x5c9adc[_0xc8b5('0x19')],_0x5c9adc['transfertargetcalleridname']));_0x5c9adc=_[_0xc8b5('0x1a')](_0x5c9adc,{'transfererchannel':_0x5c9adc[_0xc8b5('0x1b')],'transferercalleridnum':_0x5c9adc[_0xc8b5('0x18')],'transferercalleridname':_0x5c9adc['origtransferercalleridname'],'transfererconnectedlinenum':_0x5c9adc[_0xc8b5('0x1c')],'transfererconnectedlinename':_0x5c9adc[_0xc8b5('0x1d')],'transfereraccountcode':_0x5c9adc[_0xc8b5('0x1e')],'transferercontext':_0x5c9adc[_0xc8b5('0x1f')],'transfererexten':_0x5c9adc[_0xc8b5('0x20')],'transfererlinkedid':_0x5c9adc['origtransfererlinkedid'],'context':_0x5c9adc[_0xc8b5('0x21')],'extension':_0x5c9adc[_0xc8b5('0x22')],'type':_0xc8b5('0x6')});if(_['isNil'](_0x5c9adc[_0xc8b5('0x23')])){_0x5c9adc=_[_0xc8b5('0x1a')](_0x5c9adc,{'transfereechannel':_0x5c9adc[_0xc8b5('0x24')],'transfereecalleridnum':_0x5c9adc[_0xc8b5('0x19')],'transfereecalleridname':_0x5c9adc[_0xc8b5('0x25')],'transfereeconnectedlinenum':_0x5c9adc['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x5c9adc['transfertargetconnectedlinename'],'transfereeaccountcode':_0x5c9adc[_0xc8b5('0x26')],'transfereecontext':_0x5c9adc[_0xc8b5('0x27')],'transfereeexten':_0x5c9adc[_0xc8b5('0x28')],'transfereelinkedid':_0x5c9adc[_0xc8b5('0x29')]});}writeDB(_0x5c9adc);}catch(_0x23d81b){utils[_0xc8b5('0x15')](util[_0xc8b5('0xd')](_0xc8b5('0x17'),_0x5c9adc['origtransfereruniqueid']),_0x23d81b);}}; \ No newline at end of file +var _0x098b=['origtransferercalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','util','info','format','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','debug','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','error','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum'];(function(_0x386c3e,_0x44a375){var _0x4b8e13=function(_0x583c8f){while(--_0x583c8f){_0x386c3e['push'](_0x386c3e['shift']());}};_0x4b8e13(++_0x44a375);}(_0x098b,0xd6));var _0xb098=function(_0x328088,_0x1d475b){_0x328088=_0x328088-0x0;var _0xb6662a=_0x098b[_0x328088];return _0xb6662a;};'use strict';var _=require('lodash');var util=require(_0xb098('0x0'));var utils=require('./utils');function writeDB(_0x49b68a){utils[_0xb098('0x1')](util[_0xb098('0x2')]('[%s][transfers][writeDB]\x20type:%s',_0x49b68a[_0xb098('0x3')]===_0xb098('0x4')?_0x49b68a[_0xb098('0x5')]:_0x49b68a[_0xb098('0x6')],_0x49b68a[_0xb098('0x3')]));utils[_0xb098('0x7')](_0xb098('0x8'),_0x49b68a);}exports[_0xb098('0x9')]={};exports['blindtransfer']=function(_0xd064e7){try{utils[_0xb098('0xa')](util[_0xb098('0x2')]('[%s][transfers][blindtransfer]',_0xd064e7[_0xb098('0x6')]),_0xd064e7);utils[_0xb098('0x1')](util[_0xb098('0x2')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0xd064e7[_0xb098('0x6')],_0xd064e7['transferercalleridnum'],_0xd064e7[_0xb098('0xb')],_0xd064e7[_0xb098('0xc')],_0xd064e7[_0xb098('0xd')]));_0xd064e7[_0xb098('0x3')]='blind';exports['blinds'][_0xd064e7[_0xb098('0xe')]]=_0xd064e7;writeDB(_0xd064e7);}catch(_0x15bc31){utils[_0xb098('0xf')](util['format'](_0xb098('0x10'),_0xd064e7[_0xb098('0x6')]),_0x15bc31);}};exports[_0xb098('0x11')]=function(_0x54ed11){try{utils[_0xb098('0xa')](util['format']('[%s][transfers][attendedtransfer]',_0x54ed11[_0xb098('0x5')]),_0x54ed11);utils[_0xb098('0x1')](util['format'](_0xb098('0x12'),_0x54ed11[_0xb098('0x5')],_0x54ed11[_0xb098('0x13')],_0x54ed11[_0xb098('0x14')],_0x54ed11['transfertargetcalleridnum'],_0x54ed11['transfertargetcalleridname']));_0x54ed11=_[_0xb098('0x15')](_0x54ed11,{'transfererchannel':_0x54ed11[_0xb098('0x16')],'transferercalleridnum':_0x54ed11['origtransferercalleridnum'],'transferercalleridname':_0x54ed11[_0xb098('0x14')],'transfererconnectedlinenum':_0x54ed11[_0xb098('0x17')],'transfererconnectedlinename':_0x54ed11[_0xb098('0x18')],'transfereraccountcode':_0x54ed11[_0xb098('0x19')],'transferercontext':_0x54ed11['secondtransferercontext'],'transfererexten':_0x54ed11['secondtransfererexten'],'transfererlinkedid':_0x54ed11[_0xb098('0x1a')],'context':_0x54ed11[_0xb098('0x1b')],'extension':_0x54ed11[_0xb098('0x1c')],'type':_0xb098('0x4')});if(_[_0xb098('0x1d')](_0x54ed11[_0xb098('0x1e')])){_0x54ed11=_[_0xb098('0x15')](_0x54ed11,{'transfereechannel':_0x54ed11[_0xb098('0x1f')],'transfereecalleridnum':_0x54ed11['transfertargetcalleridnum'],'transfereecalleridname':_0x54ed11[_0xb098('0x20')],'transfereeconnectedlinenum':_0x54ed11[_0xb098('0x21')],'transfereeconnectedlinename':_0x54ed11[_0xb098('0x22')],'transfereeaccountcode':_0x54ed11['transfertargetaccountcode'],'transfereecontext':_0x54ed11[_0xb098('0x23')],'transfereeexten':_0x54ed11[_0xb098('0x24')],'transfereelinkedid':_0x54ed11[_0xb098('0x25')]});}writeDB(_0x54ed11);}catch(_0x5be054){utils['error'](util['format'](_0xb098('0x26'),_0x54ed11[_0xb098('0x5')]),_0x5be054);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index e7136df..8755129 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 _0xbeba=['isAfter','isBefore','bluebird','jayson/promise','util','client','http','../../config/logger','xdr','info','inspect','debug','request','then','[utils][request]\x20name:%s','catch','error','GetUser','internal','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','found','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','name','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','format'];(function(_0x4246b2,_0x26e732){var _0xee2f39=function(_0x14c62e){while(--_0x14c62e){_0x4246b2['push'](_0x4246b2['shift']());}};_0xee2f39(++_0x26e732);}(_0xbeba,0x64));var _0xabeb=function(_0x2be6d3,_0x3b748d){_0x2be6d3=_0x2be6d3-0x0;var _0x17afa3=_0xbeba[_0x2be6d3];return _0x17afa3;};'use strict';var BPromise=require(_0xabeb('0x0'));var jayson=require(_0xabeb('0x1'));var moment=require('moment');var util=require(_0xabeb('0x2'));var client=jayson[_0xabeb('0x3')][_0xabeb('0x4')]({'port':0x2329});var logger=require(_0xabeb('0x5'))(_0xabeb('0x6'));exports['info']=function(_0x330e13,_0x3d496e){logger[_0xabeb('0x7')](_0x330e13,_0x3d496e?util[_0xabeb('0x8')](_0x3d496e,{'showHidden':![],'depth':null}):'');};exports[_0xabeb('0x9')]=function(_0x14e4bf,_0x39b3dc){logger[_0xabeb('0x9')](_0x14e4bf,_0x39b3dc?util['inspect'](_0x39b3dc,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x75d8,_0x36b859){logger['error'](_0x75d8,_0x36b859?util[_0xabeb('0x8')](_0x36b859,{'showHidden':![],'depth':null}):'');};exports[_0xabeb('0xa')]=function(_0x25ebef,_0x4ce765){return client[_0xabeb('0xa')](_0x25ebef,{'body':_0x4ce765})[_0xabeb('0xb')](function(_0x4822e2){logger[_0xabeb('0x9')](_0xabeb('0xc'),_0x25ebef,_0x4822e2?util[_0xabeb('0x8')](_0x4822e2,{'showHidden':![],'depth':null}):'');})[_0xabeb('0xd')](function(_0x1902a2){logger[_0xabeb('0xe')](_0xabeb('0xc'),_0x25ebef,_0x1902a2?util[_0xabeb('0x8')](_0x1902a2,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2dd4d6){return client[_0xabeb('0xa')](_0xabeb('0xf'),{'options':{'raw':!![],'attributes':['id',_0xabeb('0x10'),'name',_0xabeb('0x11')],'where':_0x2dd4d6,'limit':0x1}})[_0xabeb('0xb')](function(_0x1da4e1){logger['debug'](_0xabeb('0x12'),JSON[_0xabeb('0x13')](_0x2dd4d6),_0x1da4e1?util[_0xabeb('0x8')](_0x1da4e1,{'showHidden':![],'depth':null}):'');return _0x1da4e1[_0xabeb('0x14')][_0xabeb('0x15')]?_0x1da4e1[_0xabeb('0x14')][0x0]:null;});}exports[_0xabeb('0x16')]=function(_0x254b3c){return new BPromise(function(_0x1ce9b4,_0x3984ff){if(_0x254b3c){return getUser({'internal':_0x254b3c})[_0xabeb('0xb')](function(_0xf5abe4){logger['info']('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x254b3c,_0xf5abe4?_0xabeb('0x17'):_0xabeb('0x18'));return _0x1ce9b4(_0xf5abe4);})[_0xabeb('0xd')](function(_0x1bcc40){logger['error']('[utils][getUserByInternal]',_0x1bcc40?util[_0xabeb('0x8')](_0x1bcc40,{'showHidden':![],'depth':null}):'');return _0x1ce9b4(null);});}return _0x1ce9b4(null);});};exports[_0xabeb('0x19')]=function(_0x5c55f1){return new BPromise(function(_0x2f01c2,_0x3ab209){if(_0x5c55f1){return getUser({'interface':_0x5c55f1})['then'](function(_0x4bbc21){logger['info'](_0xabeb('0x1a'),_0x5c55f1,_0x4bbc21?_0xabeb('0x17'):_0xabeb('0x18'));return _0x2f01c2(_0x4bbc21);})[_0xabeb('0xd')](function(_0x57b10b){logger[_0xabeb('0xe')](_0xabeb('0x1b'),_0x57b10b?util[_0xabeb('0x8')](_0x57b10b,{'showHidden':![],'depth':null}):'');return _0x2f01c2(null);});}return _0x2f01c2(null);});};exports['getUserByName']=function(_0x458c06){return new BPromise(function(_0x4526a2,_0x5e8a7b){if(_0x458c06){return getUser({'name':_0x458c06})['then'](function(_0x4497d5){logger[_0xabeb('0x7')](_0xabeb('0x1c'),_0x458c06,_0x4497d5?_0xabeb('0x17'):_0xabeb('0x18'));return _0x4526a2(_0x4497d5);})[_0xabeb('0xd')](function(_0x48530c){logger[_0xabeb('0xe')]('[utils][getUserByName]',_0x48530c?util['inspect'](_0x48530c,{'showHidden':![],'depth':null}):'');return _0x4526a2(null);});}return _0x4526a2(null);});};exports[_0xabeb('0x1d')]=function(_0x54e8a2){return new BPromise(function(_0x2e957b,_0xd2ca4f){if(_0x54e8a2){return client[_0xabeb('0xa')](_0xabeb('0x1e'),{'options':{'raw':!![],'attributes':['id',_0xabeb('0x1f'),_0xabeb('0x20'),_0xabeb('0x21'),'acwTimeout'],'where':{'name':_0x54e8a2},'limit':0x1}})[_0xabeb('0xb')](function(_0x58a82d){logger[_0xabeb('0x9')](_0xabeb('0x22'),_0x54e8a2,_0x58a82d?util[_0xabeb('0x8')](_0x58a82d,{'showHidden':![],'depth':null}):'');logger[_0xabeb('0x7')](_0xabeb('0x23'),_0x54e8a2,_0x58a82d?_0xabeb('0x17'):_0xabeb('0x18'));return _0x2e957b(_0x58a82d[_0xabeb('0x14')][_0xabeb('0x15')]?_0x58a82d[_0xabeb('0x14')][0x0]:null);})['catch'](function(_0x2521c5){logger[_0xabeb('0xe')](_0xabeb('0x24'),_0x2521c5?util[_0xabeb('0x8')](_0x2521c5,{'showHidden':![],'depth':null}):'');return _0x2e957b(null);});}return _0x2e957b(null);});};exports[_0xabeb('0x25')]=function(_0x364f31,_0x18b6a8){return moment(_0x364f31)[_0xabeb('0x26')](_0x18b6a8,'seconds')['format'](_0xabeb('0x27'));};exports[_0xabeb('0x28')]=function(_0x2dac1d,_0x54129f){return moment(_0x2dac1d)[_0xabeb('0x29')](_0x54129f,'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xabeb('0x2a')]=function(_0x33fab3,_0x49a8ef){return moment(_0x33fab3)[_0xabeb('0x2b')](moment(_0x49a8ef),'seconds');};exports[_0xabeb('0x2c')]=function(_0x1638e3,_0x9e0f87){return parseInt(_0x1638e3,0xa)+parseInt(_0x9e0f87,0xa);};exports[_0xabeb('0x2d')]=function(){return moment()[_0xabeb('0x2e')](_0xabeb('0x27'));};exports[_0xabeb('0x2f')]=function(_0x4ecff0,_0x1c83fa){if(_0x1c83fa){return moment(_0x4ecff0)[_0xabeb('0x2f')](_0x1c83fa);}return!![];};exports['isBefore']=function(_0x3e140c,_0x485b82){if(_0x485b82){return moment(_0x3e140c)[_0xabeb('0x30')](_0x485b82);}else if(_0x3e140c){return!![];}return![];}; \ No newline at end of file +var _0xc833=['notfound','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','format','diffTime','diff','seconds','now','isAfter','isBefore','jayson/promise','moment','util','client','http','../../config/logger','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0xc833,0xfd));var _0x3c83=function(_0x2498d9,_0x274155){_0x2498d9=_0x2498d9-0x0;var _0x412f7b=_0xc833[_0x2498d9];return _0x412f7b;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x3c83('0x0'));var moment=require(_0x3c83('0x1'));var util=require(_0x3c83('0x2'));var client=jayson[_0x3c83('0x3')][_0x3c83('0x4')]({'port':0x2329});var logger=require(_0x3c83('0x5'))('xdr');exports[_0x3c83('0x6')]=function(_0x4dfd9b,_0x1fa4ca){logger['info'](_0x4dfd9b,_0x1fa4ca?util[_0x3c83('0x7')](_0x1fa4ca,{'showHidden':![],'depth':null}):'');};exports[_0x3c83('0x8')]=function(_0x5af4cb,_0x582d3f){logger[_0x3c83('0x8')](_0x5af4cb,_0x582d3f?util[_0x3c83('0x7')](_0x582d3f,{'showHidden':![],'depth':null}):'');};exports[_0x3c83('0x9')]=function(_0x7a45fa,_0x122967){logger[_0x3c83('0x9')](_0x7a45fa,_0x122967?util[_0x3c83('0x7')](_0x122967,{'showHidden':![],'depth':null}):'');};exports[_0x3c83('0xa')]=function(_0x26a550,_0x1ca9b6){return client['request'](_0x26a550,{'body':_0x1ca9b6})[_0x3c83('0xb')](function(_0x3577d3){logger[_0x3c83('0x8')](_0x3c83('0xc'),_0x26a550,_0x3577d3?util[_0x3c83('0x7')](_0x3577d3,{'showHidden':![],'depth':null}):'');})[_0x3c83('0xd')](function(_0x521055){logger[_0x3c83('0x9')]('[utils][request]\x20name:%s',_0x26a550,_0x521055?util['inspect'](_0x521055,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1f33bb){return client[_0x3c83('0xa')](_0x3c83('0xe'),{'options':{'raw':!![],'attributes':['id',_0x3c83('0xf'),_0x3c83('0x10'),_0x3c83('0x11')],'where':_0x1f33bb,'limit':0x1}})[_0x3c83('0xb')](function(_0x8cf1){logger[_0x3c83('0x8')]('[utils][getUser]\x20where:%s',JSON['stringify'](_0x1f33bb),_0x8cf1?util[_0x3c83('0x7')](_0x8cf1,{'showHidden':![],'depth':null}):'');return _0x8cf1[_0x3c83('0x12')][_0x3c83('0x13')]?_0x8cf1[_0x3c83('0x12')][0x0]:null;});}exports[_0x3c83('0x14')]=function(_0x2273a){return new BPromise(function(_0x5f3d0a,_0x528d09){if(_0x2273a){return getUser({'internal':_0x2273a})[_0x3c83('0xb')](function(_0x38d6d7){logger[_0x3c83('0x6')](_0x3c83('0x15'),_0x2273a,_0x38d6d7?_0x3c83('0x16'):_0x3c83('0x17'));return _0x5f3d0a(_0x38d6d7);})['catch'](function(_0x3b6bf3){logger['error']('[utils][getUserByInternal]',_0x3b6bf3?util['inspect'](_0x3b6bf3,{'showHidden':![],'depth':null}):'');return _0x5f3d0a(null);});}return _0x5f3d0a(null);});};exports['getUserByInterface']=function(_0x291c41){return new BPromise(function(_0x187e58,_0xd25c6c){if(_0x291c41){return getUser({'interface':_0x291c41})[_0x3c83('0xb')](function(_0x3379f1){logger[_0x3c83('0x6')](_0x3c83('0x18'),_0x291c41,_0x3379f1?'found':_0x3c83('0x17'));return _0x187e58(_0x3379f1);})[_0x3c83('0xd')](function(_0x5e2eeb){logger[_0x3c83('0x9')](_0x3c83('0x19'),_0x5e2eeb?util[_0x3c83('0x7')](_0x5e2eeb,{'showHidden':![],'depth':null}):'');return _0x187e58(null);});}return _0x187e58(null);});};exports[_0x3c83('0x1a')]=function(_0x2b7f01){return new BPromise(function(_0x2bee89,_0xed9592){if(_0x2b7f01){return getUser({'name':_0x2b7f01})[_0x3c83('0xb')](function(_0x52a108){logger[_0x3c83('0x6')](_0x3c83('0x1b'),_0x2b7f01,_0x52a108?_0x3c83('0x16'):_0x3c83('0x17'));return _0x2bee89(_0x52a108);})[_0x3c83('0xd')](function(_0x1310d5){logger['error'](_0x3c83('0x1c'),_0x1310d5?util[_0x3c83('0x7')](_0x1310d5,{'showHidden':![],'depth':null}):'');return _0x2bee89(null);});}return _0x2bee89(null);});};exports[_0x3c83('0x1d')]=function(_0x20316d){return new BPromise(function(_0x57a4da,_0x3d6e14){if(_0x20316d){return client[_0x3c83('0xa')](_0x3c83('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x3c83('0x10'),_0x3c83('0x1f'),'acw',_0x3c83('0x20')],'where':{'name':_0x20316d},'limit':0x1}})['then'](function(_0x248e77){logger[_0x3c83('0x8')]('[utils][getVoiceQueueByName]\x20name:%s',_0x20316d,_0x248e77?util[_0x3c83('0x7')](_0x248e77,{'showHidden':![],'depth':null}):'');logger['info'](_0x3c83('0x21'),_0x20316d,_0x248e77?_0x3c83('0x16'):_0x3c83('0x17'));return _0x57a4da(_0x248e77[_0x3c83('0x12')]['length']?_0x248e77[_0x3c83('0x12')][0x0]:null);})[_0x3c83('0xd')](function(_0x190658){logger[_0x3c83('0x9')]('[utils][getVoiceQueueByName]',_0x190658?util['inspect'](_0x190658,{'showHidden':![],'depth':null}):'');return _0x57a4da(null);});}return _0x57a4da(null);});};exports[_0x3c83('0x22')]=function(_0x120949,_0x33e27a){return moment(_0x120949)[_0x3c83('0x23')](_0x33e27a,'seconds')['format'](_0x3c83('0x24'));};exports[_0x3c83('0x25')]=function(_0x1509f6,_0x3452a3){return moment(_0x1509f6)[_0x3c83('0x26')](_0x3452a3,'seconds')[_0x3c83('0x27')](_0x3c83('0x24'));};exports[_0x3c83('0x28')]=function(_0x425b25,_0x3cdf6b){return moment(_0x425b25)[_0x3c83('0x29')](moment(_0x3cdf6b),_0x3c83('0x2a'));};exports['sumTime']=function(_0x149091,_0x342c0c){return parseInt(_0x149091,0xa)+parseInt(_0x342c0c,0xa);};exports[_0x3c83('0x2b')]=function(){return moment()[_0x3c83('0x27')](_0x3c83('0x24'));};exports[_0x3c83('0x2c')]=function(_0x13579d,_0x46de54){if(_0x46de54){return moment(_0x13579d)['isAfter'](_0x46de54);}return!![];};exports[_0x3c83('0x2d')]=function(_0x3c4b9f,_0xf63c06){if(_0xf63c06){return moment(_0x3c4b9f)[_0x3c83('0x2d')](_0xf63c06);}else if(_0x3c4b9f){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 0c1c31b..32ceb90 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 _0x4091=['client-side-logger','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','method','headers','connection','remoteAddress','responseTime','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','x-forwarded-for','url','statusCode','other','agent_name','test','setupLoggers','fs-extra','express-winston','path','util','./loggers','fileLogger','./mask-sensitive-data','join','/var','log','xcally','client','name','ensureDir','catch','user','then','no-user','data','timestamp','api','auth'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x4091,0x1b6));var _0x1409=function(_0x4c5cd4,_0x268643){_0x4c5cd4=_0x4c5cd4-0x0;var _0x210bcf=_0x4091[_0x4c5cd4];return _0x210bcf;};var fs=require(_0x1409('0x0'));var _=require('lodash');var ewinston=require(_0x1409('0x1'));var path=require(_0x1409('0x2'));var util=require(_0x1409('0x3'));var fileLogger=require(_0x1409('0x4'))[_0x1409('0x5')];var safeTemplate=require('./safe-template')['safeTemplate'];var maskSensitiveData=require(_0x1409('0x6'))['maskSensitiveData'];function ClientSideLogger(){function _0x139618(_0x45e40c){var _0x54c69a=path[_0x1409('0x7')](_0x1409('0x8'),_0x1409('0x9'),_0x1409('0xa'));var _0x5335fa=path[_0x1409('0x7')](_0x1409('0xb'),_0x45e40c['role']+'-'+_0x45e40c[_0x1409('0xc')]);return fs[_0x1409('0xd')](path['join'](_0x54c69a,_0x5335fa))['then'](function(){var _0xf94226=fileLogger('client',path[_0x1409('0x7')](_0x54c69a,_0x5335fa));return _0xf94226;})[_0x1409('0xe')](function(_0x3e63ef){throw _0x3e63ef;});}this[_0x1409('0x9')]=function(_0x55281b,_0x362bec,_0x120fac,_0x56e32c){return _0x139618(_0x55281b[_0x1409('0xf')])[_0x1409('0x10')](function(_0x3bbe71){var _0x1872f5=_0x3bbe71[_0x362bec];return _0x1872f5;})['then'](function(_0x4c89cb){var _0x2d6464=_0x55281b[_0x1409('0xf')]?_0x55281b['user']['id']:_0x1409('0x11');var _0x27c51a=_0x56e32c[_0x1409('0x12')];var _0x409733=_0x56e32c[_0x1409('0x13')];var _0x56b3aa=new Date(Number(_0x409733));return _0x4c89cb(_0x2d6464,_0x56b3aa,_0x120fac,_0x27c51a);})[_0x1409('0xe')](function(_0x24d061){fileLogger('client')['error'](_0x24d061);});};}function setupLoggers(_0x99da58){return new Promise(function(_0x3d3579){var _0x35fe96=new ClientSideLogger();var _0x198533=fileLogger(_0x1409('0x14'));var _0xf5d5e8=fileLogger(_0x1409('0x15'));_0x99da58['set'](_0x1409('0x16'),_0x35fe96);_0x99da58[_0x1409('0x17')](ewinston['logger']({'winstonInstance':_0x198533,'meta':![],'statusLevels':!![],'msg':function(_0x3474f6,_0x5ef0d2){var _0x68c02c=_0x1409('0x18');if(!_[_0x1409('0x19')](_0x3474f6[_0x1409('0x1a')])){_0x68c02c+='\x20body=%s';var _0x1379bd=_0x3474f6[_0x1409('0x1a')];maskSensitiveData(_0x1379bd);}return safeTemplate(util['format'](_0x68c02c,_0x3474f6[_0x1409('0x1b')],_0x3474f6[_0x1409('0x1c')]['x-forwarded-for']?_0x3474f6['headers']['x-forwarded-for']:_0x3474f6[_0x1409('0x1d')][_0x1409('0x1e')]||_0x3474f6['ip'],_0x3474f6['url'],_0x5ef0d2['statusCode'],_0x5ef0d2[_0x1409('0x1f')],_0x3474f6[_0x1409('0xf')]?_0x3474f6['user']['id']:null,_0x3474f6[_0x1409('0xf')]?_0x3474f6[_0x1409('0xf')][_0x1409('0xc')]:null,_0x3474f6['user']?_0x3474f6['user'][_0x1409('0x20')]:null,_0x1379bd?util[_0x1409('0x21')](_0x1379bd,![],null):''));}}));_0x99da58['use'](ewinston['logger']({'winstonInstance':_0xf5d5e8,'meta':![],'statusLevels':!![],'msg':function(_0x251fdd,_0x442402){var _0x337b4c=_0x1409('0x22');if(_0x251fdd[_0x1409('0x1a')]&&_0x251fdd['body'][_0x1409('0x23')]&&_0x251fdd[_0x1409('0x1a')][_0x1409('0x24')]){_0x337b4c=_0x1409('0x25');}return util[_0x1409('0x26')](_0x337b4c,_0x251fdd['method'],_0x251fdd[_0x1409('0x1c')][_0x1409('0x27')]?_0x251fdd[_0x1409('0x1c')][_0x1409('0x27')]:_0x251fdd[_0x1409('0x1d')][_0x1409('0x1e')]||_0x251fdd['ip'],_0x251fdd[_0x1409('0x28')],_0x442402[_0x1409('0x29')],_0x442402[_0x1409('0x1f')],_0x251fdd['user']?_0x251fdd[_0x1409('0xf')]['id']:null,_0x251fdd[_0x1409('0xf')]?_0x251fdd[_0x1409('0xf')][_0x1409('0xc')]:null,_0x251fdd[_0x1409('0xf')]?_0x251fdd['user'][_0x1409('0x20')]:null,_0x251fdd[_0x1409('0x1a')]&&_0x251fdd['body'][_0x1409('0x23')]?_0x251fdd[_0x1409('0x1a')][_0x1409('0x23')]:_0x1409('0x2a'),_0x251fdd[_0x1409('0x1a')]&&_0x251fdd[_0x1409('0x1a')][_0x1409('0x24')]?_0x251fdd[_0x1409('0x1a')][_0x1409('0x24')]:'',_0x251fdd['body']&&_0x251fdd[_0x1409('0x1a')][_0x1409('0x2b')]?_0x251fdd[_0x1409('0x1a')][_0x1409('0x2b')]:'');},'ignoreRoute':function(_0xcb9e34){var _0x1d7692=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1d7692[_0x1409('0x2c')](_0xcb9e34[_0x1409('0x28')]);}}));return _0x3d3579();});}exports[_0x1409('0x2d')]=setupLoggers; \ No newline at end of file +var _0xe206=['x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','inspect','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','device','other','agent_name','test','fs-extra','lodash','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','role','name','ensureDir','then','client','catch','user','data','error','api','auth','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','format','method','headers'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe206,0x127));var _0x6e20=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0xe206[_0x8b8564];return _0x360c61;};var fs=require(_0x6e20('0x0'));var _=require(_0x6e20('0x1'));var ewinston=require('express-winston');var path=require(_0x6e20('0x2'));var util=require(_0x6e20('0x3'));var fileLogger=require(_0x6e20('0x4'))[_0x6e20('0x5')];var safeTemplate=require(_0x6e20('0x6'))[_0x6e20('0x7')];var maskSensitiveData=require(_0x6e20('0x8'))[_0x6e20('0x9')];function ClientSideLogger(){function _0x23020b(_0x2a0cee){var _0x141168=path[_0x6e20('0xa')](_0x6e20('0xb'),_0x6e20('0xc'),_0x6e20('0xd'));var _0x5eb9b8=path[_0x6e20('0xa')]('client',_0x2a0cee[_0x6e20('0xe')]+'-'+_0x2a0cee[_0x6e20('0xf')]);return fs[_0x6e20('0x10')](path[_0x6e20('0xa')](_0x141168,_0x5eb9b8))[_0x6e20('0x11')](function(){var _0x3c7648=fileLogger(_0x6e20('0x12'),path[_0x6e20('0xa')](_0x141168,_0x5eb9b8));return _0x3c7648;})[_0x6e20('0x13')](function(_0x15cbdd){throw _0x15cbdd;});}this[_0x6e20('0xc')]=function(_0x390743,_0x4780d5,_0x3a1f89,_0x25924b){return _0x23020b(_0x390743[_0x6e20('0x14')])[_0x6e20('0x11')](function(_0x8bf5f0){var _0x39c644=_0x8bf5f0[_0x4780d5];return _0x39c644;})['then'](function(_0x25288c){var _0x3e281a=_0x390743[_0x6e20('0x14')]?_0x390743[_0x6e20('0x14')]['id']:'no-user';var _0x5eafa9=_0x25924b[_0x6e20('0x15')];var _0xc59f3d=_0x25924b['timestamp'];var _0x1f6336=new Date(Number(_0xc59f3d));return _0x25288c(_0x3e281a,_0x1f6336,_0x3a1f89,_0x5eafa9);})[_0x6e20('0x13')](function(_0x1aa70a){fileLogger(_0x6e20('0x12'))[_0x6e20('0x16')](_0x1aa70a);});};}function setupLoggers(_0x538f81){return new Promise(function(_0x2c364d){var _0x404486=new ClientSideLogger();var _0x1d58b3=fileLogger(_0x6e20('0x17'));var _0x2d14ea=fileLogger(_0x6e20('0x18'));_0x538f81['set']('client-side-logger',_0x404486);_0x538f81[_0x6e20('0x19')](ewinston[_0x6e20('0x1a')]({'winstonInstance':_0x1d58b3,'meta':![],'statusLevels':!![],'msg':function(_0x463269,_0x18091d){var _0x51f2d0=_0x6e20('0x1b');if(!_[_0x6e20('0x1c')](_0x463269['body'])){_0x51f2d0+=_0x6e20('0x1d');var _0x1719eb=_0x463269[_0x6e20('0x1e')];maskSensitiveData(_0x1719eb);}return safeTemplate(util[_0x6e20('0x1f')](_0x51f2d0,_0x463269[_0x6e20('0x20')],_0x463269[_0x6e20('0x21')][_0x6e20('0x22')]?_0x463269[_0x6e20('0x21')]['x-forwarded-for']:_0x463269[_0x6e20('0x23')][_0x6e20('0x24')]||_0x463269['ip'],_0x463269[_0x6e20('0x25')],_0x18091d[_0x6e20('0x26')],_0x18091d[_0x6e20('0x27')],_0x463269['user']?_0x463269[_0x6e20('0x14')]['id']:null,_0x463269[_0x6e20('0x14')]?_0x463269[_0x6e20('0x14')][_0x6e20('0xf')]:null,_0x463269[_0x6e20('0x14')]?_0x463269['user']['role']:null,_0x1719eb?util[_0x6e20('0x28')](_0x1719eb,![],null):''));}}));_0x538f81[_0x6e20('0x19')](ewinston[_0x6e20('0x1a')]({'winstonInstance':_0x2d14ea,'meta':![],'statusLevels':!![],'msg':function(_0x1fe78b,_0x2bec12){var _0x420583='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x1fe78b[_0x6e20('0x1e')]&&_0x1fe78b['body']['device']&&_0x1fe78b[_0x6e20('0x1e')][_0x6e20('0x29')]){_0x420583=_0x6e20('0x2a');}return util[_0x6e20('0x1f')](_0x420583,_0x1fe78b['method'],_0x1fe78b[_0x6e20('0x21')][_0x6e20('0x22')]?_0x1fe78b[_0x6e20('0x21')][_0x6e20('0x22')]:_0x1fe78b[_0x6e20('0x23')][_0x6e20('0x24')]||_0x1fe78b['ip'],_0x1fe78b[_0x6e20('0x25')],_0x2bec12[_0x6e20('0x26')],_0x2bec12[_0x6e20('0x27')],_0x1fe78b[_0x6e20('0x14')]?_0x1fe78b[_0x6e20('0x14')]['id']:null,_0x1fe78b[_0x6e20('0x14')]?_0x1fe78b[_0x6e20('0x14')][_0x6e20('0xf')]:null,_0x1fe78b[_0x6e20('0x14')]?_0x1fe78b['user'][_0x6e20('0xe')]:null,_0x1fe78b['body']&&_0x1fe78b[_0x6e20('0x1e')][_0x6e20('0x2b')]?_0x1fe78b[_0x6e20('0x1e')]['device']:_0x6e20('0x2c'),_0x1fe78b[_0x6e20('0x1e')]&&_0x1fe78b[_0x6e20('0x1e')]['agent_id']?_0x1fe78b[_0x6e20('0x1e')]['agent_id']:'',_0x1fe78b['body']&&_0x1fe78b[_0x6e20('0x1e')][_0x6e20('0x2d')]?_0x1fe78b[_0x6e20('0x1e')][_0x6e20('0x2d')]:'');},'ignoreRoute':function(_0x2f2063){var _0x5d6216=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5d6216[_0x6e20('0x2e')](_0x2f2063['url']);}}));return _0x2c364d();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 801b788..a6198b2 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0550=['split','padStart','length','iftime','lodash','moment-timezone','map','source','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','locale','weekdaysShort','toLowerCase','slice','concat','exports','circularDoWInterval','monthsShort','indexOf','clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','ddd','dowCompare','date','max','min','format','MMM','includes','guess','test','isMoment'];(function(_0x557f5f,_0x31d8e7){var _0x196eba=function(_0x433d89){while(--_0x433d89){_0x557f5f['push'](_0x557f5f['shift']());}};_0x196eba(++_0x31d8e7);}(_0x0550,0xee));var _0x0055=function(_0x5deea5,_0x230d81){_0x5deea5=_0x5deea5-0x0;var _0x3d1998=_0x0550[_0x5deea5];return _0x3d1998;};var _=require(_0x0055('0x0'));var moment=require(_0x0055('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][_0x0055('0x2')](function(_0x4f7ec5){return _0x4f7ec5[_0x0055('0x3')];})['join'](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x0055('0x4');var EINVALID_DATE=_0x0055('0x5');function throwIfDateNotValid(_0x1ed345){if(!_0x1ed345[_0x0055('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x43abae){var _0x4bb75b=_0x43abae['split'](':')['map'](function(_0x4449c5){return parseInt(_0x4449c5,0xa);});var _0x68350b=_0x4bb75b[0x0];var _0x35183e=_0x4bb75b[0x1];if(_0x68350b<0x0||_0x68350b>0x17||_0x35183e<0x0||_0x35183e>0x3b){throw new Error(EINVALID_DATE);}return[_0x68350b,_0x35183e];}function circularDoWInterval(_0x32d98e,_0x3f1551){if(_0x32d98e===_0x3f1551){return[_0x32d98e];}else{var _0xae12a6=moment['locale']();moment[_0x0055('0x7')]('en');var _0x5971c1=moment[_0x0055('0x8')]()['map'](function(_0x20f644){return _0x20f644[_0x0055('0x9')]();});moment[_0x0055('0x7')](_0xae12a6);var _0x11f248=_0x5971c1['indexOf'](_0x32d98e);var _0x9fd961=_0x5971c1['indexOf'](_0x3f1551);if(_0x9fd961>_0x11f248){return _0x5971c1[_0x0055('0xa')](_0x11f248,_0x9fd961+0x1);}else{var _0x28b8bf=_0x5971c1[_0x0055('0xa')](0x0,_0x9fd961+0x1);var _0x313cdd=_0x5971c1['slice'](_0x11f248);return _0x313cdd[_0x0055('0xb')](_0x28b8bf);}}}module[_0x0055('0xc')][_0x0055('0xd')]=circularDoWInterval;function circularMonthInterval(_0x5851a5,_0x244ecd){if(_0x5851a5===_0x244ecd){return[_0x5851a5];}else{var _0x403440=moment['locale']();moment[_0x0055('0x7')]('en');var _0x400dc2=moment[_0x0055('0xe')]()[_0x0055('0x2')](function(_0x3b4c92){return _0x3b4c92[_0x0055('0x9')]();});moment[_0x0055('0x7')](_0x403440);var _0x2a9b88=_0x400dc2[_0x0055('0xf')](_0x5851a5);var _0x4e9737=_0x400dc2['indexOf'](_0x244ecd);if(_0x4e9737>_0x2a9b88){return _0x400dc2[_0x0055('0xa')](_0x2a9b88,_0x4e9737+0x1);}else{var _0x4b3542=_0x400dc2[_0x0055('0xa')](0x0,_0x4e9737+0x1);var _0x51e256=_0x400dc2['slice'](_0x2a9b88);return _0x51e256[_0x0055('0xb')](_0x4b3542);}}}module[_0x0055('0xc')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x452948){var _0x474122=parseInt(_0x452948,0xa);if(_0x474122<0x1||_0x474122>0x1f){throw new Error(EINVALID_DATE);}return _0x474122;}function timeCompare(_0x1fa154,_0x407ca4,_0x490b33){var _0x584110=_0x1fa154['clone']();var _0x1bf8d1=extractTime(_0x407ca4);var _0x15786f=_0x1bf8d1[0x0];var _0x1c0c05=_0x1bf8d1[0x1];var _0xcc8ce=_0x1fa154[_0x0055('0x10')]()[_0x0055('0x11')](_0x15786f)[_0x0055('0x12')](_0x1c0c05);throwIfDateNotValid(_0xcc8ce);var _0x28787e=extractTime(_0x490b33);var _0x3401f4=_0x28787e[0x0];var _0x59dfae=_0x28787e[0x1];var _0x1df066=_0x1fa154['clone']()[_0x0055('0x11')](_0x3401f4)[_0x0055('0x12')](_0x59dfae);throwIfDateNotValid(_0x1df066);if(_0x1df066[_0x0055('0x13')](_0xcc8ce)){var _0x3dfa58=_0x584110[_0x0055('0x10')]()[_0x0055('0x14')](_0x0055('0x15'));var _0xa734b7=_0x584110[_0x0055('0x10')]()[_0x0055('0x16')](_0x0055('0x15'));return _0x584110['isBetween'](_0xcc8ce,_0xa734b7,undefined,'[]')||_0x584110[_0x0055('0x17')](_0x3dfa58,_0x1df066,undefined,'[]');}else{return _0x584110[_0x0055('0x17')](_0xcc8ce,_0x1df066,undefined,'[]');}}module[_0x0055('0xc')]['timeCompare']=timeCompare;function dowCompare(_0xe6ebdb,_0x35eb42,_0x2e6918){var _0x1b8983=_0xe6ebdb[_0x0055('0x7')]('en')['format'](_0x0055('0x18'))[_0x0055('0x9')]();return circularDoWInterval(_0x35eb42,_0x2e6918)['includes'](_0x1b8983);}module[_0x0055('0xc')][_0x0055('0x19')]=dowCompare;function domCompare(_0x473005,_0x1867d5,_0x66e63e){var _0x426023=_0x473005[_0x0055('0x1a')]();if(_0x1867d5===_0x66e63e){return _0x426023===_0x1867d5;}else{var _0x3a7d8d=_0x473005['daysInMonth']();var _0x5e7bbc=_0x1867d5<_0x66e63e;let _0x30fafd=![];var _0x11a3ef=0x0;var _0x206364=0x0;if(_0x5e7bbc){_0x11a3ef=Math[_0x0055('0x1b')](0x1,_0x1867d5);_0x206364=Math[_0x0055('0x1c')](_0x66e63e,_0x3a7d8d);_0x30fafd=_0x426023>=_0x11a3ef&&_0x426023<=_0x206364;}else{_0x11a3ef=Math['min'](_0x1867d5,_0x3a7d8d);_0x206364=Math[_0x0055('0x1b')](0x1,_0x66e63e);_0x30fafd=_0x426023>=_0x11a3ef||_0x426023<=_0x206364;}return _0x30fafd;}}module[_0x0055('0xc')]['domCompare']=domCompare;function monthCompare(_0x43c998,_0x5e677a,_0xedbc16){var _0x36212c=_0x43c998[_0x0055('0x7')]('en')[_0x0055('0x1d')](_0x0055('0x1e'))[_0x0055('0x9')]();return circularMonthInterval(_0x5e677a,_0xedbc16)[_0x0055('0x1f')](_0x36212c);}module[_0x0055('0xc')]['monthCompare']=monthCompare;function iftime(_0x49b409,_0xe3b7a5=moment['tz'][_0x0055('0x20')](),_0x585fd9=moment()){if(!validateRx[_0x0055('0x21')](_0x49b409)){throw new Error(EINVALID_STRING);}else{var _0x5b85bb=(moment[_0x0055('0x22')](_0x585fd9)?_0x585fd9[_0x0055('0x10')]():moment(_0x585fd9))['tz'](_0xe3b7a5)[_0x0055('0x7')]('en');throwIfDateNotValid(_0x5b85bb);var _0x4d4d12=_0x49b409[_0x0055('0x23')](',');var _0x161fba=_0x4d4d12[0x0];var _0x584cd9=_0x4d4d12[0x1];var _0x500679=_0x4d4d12[0x2];var _0x4d0db7=_0x4d4d12[0x3];let _0x37c35d=!![];if(_0x161fba!=='*'){var _0x11291b=_0x161fba[_0x0055('0x23')]('-');var _0x122d20=_[_0x0055('0x24')](_0x11291b[0x0],0x5,'0');var _0x5a2621=_0x11291b[_0x0055('0x25')]===0x2?_['padStart'](_0x11291b[0x1],0x5,'0'):_0x122d20;_0x37c35d=timeCompare(_0x5b85bb,_0x122d20,_0x5a2621);}let _0x1bb353=!![];if(_0x584cd9!=='*'){var _0xd548e6=_0x584cd9[_0x0055('0x23')]('-');var _0x58809f=_0xd548e6[0x0];var _0x396a7f=_0xd548e6['length']===0x2?_0xd548e6[0x1]:_0x58809f;_0x1bb353=dowCompare(_0x5b85bb,_0x58809f,_0x396a7f);}let _0x241050=!![];if(_0x500679!=='*'){var _0x201ab5=_0x500679[_0x0055('0x23')]('-');var _0x5dcc85=parseDom(_0x201ab5[0x0]);var _0x25e146=_0x201ab5[_0x0055('0x25')]===0x2?parseDom(_0x201ab5[0x1]):_0x5dcc85;_0x241050=domCompare(_0x5b85bb,_0x5dcc85,_0x25e146);}let _0x3f77ce=!![];if(_0x4d0db7!=='*'){var _0xa7703e=_0x4d0db7[_0x0055('0x23')]('-');var _0x508591=_0xa7703e[0x0];var _0x360a23=_0xa7703e['length']===0x2?_0xa7703e[0x1]:_0xa7703e[0x0];_0x3f77ce=monthCompare(_0x5b85bb,_0x508591,_0x360a23);}return _0x37c35d&&_0x1bb353&&_0x241050&&_0x3f77ce;}}module[_0x0055('0xc')][_0x0055('0x26')]=iftime; \ No newline at end of file +var _0x001c=['guess','isMoment','padStart','length','iftime','lodash','map','join','Date\x20not\x20valid','isValid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','exports','concat','circularMonthInterval','clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','timeCompare','format','ddd','includes','date','daysInMonth','min','domCompare','MMM','monthCompare'];(function(_0x3f1861,_0x7b4285){var _0x7ca70a=function(_0x119b09){while(--_0x119b09){_0x3f1861['push'](_0x3f1861['shift']());}};_0x7ca70a(++_0x7b4285);}(_0x001c,0x12d));var _0xc001=function(_0x3960e4,_0x58d123){_0x3960e4=_0x3960e4-0x0;var _0x4cbd7a=_0x001c[_0x3960e4];return _0x4cbd7a;};var _=require(_0xc001('0x0'));var moment=require('moment-timezone');var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xc001('0x1')](function(_0x174275){return _0x174275['source'];})[_0xc001('0x2')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE=_0xc001('0x3');function throwIfDateNotValid(_0x3ab0cd){if(!_0x3ab0cd[_0xc001('0x4')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x5cfab3){var _0x24b4b5=_0x5cfab3[_0xc001('0x5')](':')[_0xc001('0x1')](function(_0x410302){return parseInt(_0x410302,0xa);});var _0x2e3814=_0x24b4b5[0x0];var _0x4690e5=_0x24b4b5[0x1];if(_0x2e3814<0x0||_0x2e3814>0x17||_0x4690e5<0x0||_0x4690e5>0x3b){throw new Error(EINVALID_DATE);}return[_0x2e3814,_0x4690e5];}function circularDoWInterval(_0x110d6b,_0x29c454){if(_0x110d6b===_0x29c454){return[_0x110d6b];}else{var _0x400234=moment[_0xc001('0x6')]();moment[_0xc001('0x6')]('en');var _0x127005=moment[_0xc001('0x7')]()[_0xc001('0x1')](function(_0x1b2a51){return _0x1b2a51[_0xc001('0x8')]();});moment[_0xc001('0x6')](_0x400234);var _0x438332=_0x127005[_0xc001('0x9')](_0x110d6b);var _0x3563a0=_0x127005[_0xc001('0x9')](_0x29c454);if(_0x3563a0>_0x438332){return _0x127005[_0xc001('0xa')](_0x438332,_0x3563a0+0x1);}else{var _0x51a372=_0x127005[_0xc001('0xa')](0x0,_0x3563a0+0x1);var _0x21881c=_0x127005[_0xc001('0xa')](_0x438332);return _0x21881c['concat'](_0x51a372);}}}module[_0xc001('0xb')]['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x19dccd,_0x112d34){if(_0x19dccd===_0x112d34){return[_0x19dccd];}else{var _0x5bcdde=moment[_0xc001('0x6')]();moment[_0xc001('0x6')]('en');var _0x565206=moment['monthsShort']()[_0xc001('0x1')](function(_0x4a2247){return _0x4a2247[_0xc001('0x8')]();});moment['locale'](_0x5bcdde);var _0x33856f=_0x565206[_0xc001('0x9')](_0x19dccd);var _0x5530fe=_0x565206['indexOf'](_0x112d34);if(_0x5530fe>_0x33856f){return _0x565206[_0xc001('0xa')](_0x33856f,_0x5530fe+0x1);}else{var _0x45b441=_0x565206[_0xc001('0xa')](0x0,_0x5530fe+0x1);var _0x482cc0=_0x565206['slice'](_0x33856f);return _0x482cc0[_0xc001('0xc')](_0x45b441);}}}module[_0xc001('0xb')][_0xc001('0xd')]=circularMonthInterval;function parseDom(_0x2eb4de){var _0x30358e=parseInt(_0x2eb4de,0xa);if(_0x30358e<0x1||_0x30358e>0x1f){throw new Error(EINVALID_DATE);}return _0x30358e;}function timeCompare(_0x47789f,_0x173844,_0x4ec33b){var _0x53afa9=_0x47789f[_0xc001('0xe')]();var _0x3a24fd=extractTime(_0x173844);var _0x95c651=_0x3a24fd[0x0];var _0x1f8608=_0x3a24fd[0x1];var _0x2cc2ed=_0x47789f[_0xc001('0xe')]()[_0xc001('0xf')](_0x95c651)['minutes'](_0x1f8608);throwIfDateNotValid(_0x2cc2ed);var _0x84f954=extractTime(_0x4ec33b);var _0x4be621=_0x84f954[0x0];var _0x40b885=_0x84f954[0x1];var _0x511cde=_0x47789f[_0xc001('0xe')]()[_0xc001('0xf')](_0x4be621)[_0xc001('0x10')](_0x40b885);throwIfDateNotValid(_0x511cde);if(_0x511cde[_0xc001('0x11')](_0x2cc2ed)){var _0x2ef67f=_0x53afa9[_0xc001('0xe')]()[_0xc001('0x12')](_0xc001('0x13'));var _0x325ef8=_0x53afa9[_0xc001('0xe')]()[_0xc001('0x14')](_0xc001('0x13'));return _0x53afa9[_0xc001('0x15')](_0x2cc2ed,_0x325ef8,undefined,'[]')||_0x53afa9['isBetween'](_0x2ef67f,_0x511cde,undefined,'[]');}else{return _0x53afa9[_0xc001('0x15')](_0x2cc2ed,_0x511cde,undefined,'[]');}}module[_0xc001('0xb')][_0xc001('0x16')]=timeCompare;function dowCompare(_0x58d223,_0x250490,_0x7fae86){var _0x447190=_0x58d223[_0xc001('0x6')]('en')[_0xc001('0x17')](_0xc001('0x18'))[_0xc001('0x8')]();return circularDoWInterval(_0x250490,_0x7fae86)[_0xc001('0x19')](_0x447190);}module[_0xc001('0xb')]['dowCompare']=dowCompare;function domCompare(_0x242168,_0x1c98af,_0x18b237){var _0x40ffe7=_0x242168[_0xc001('0x1a')]();if(_0x1c98af===_0x18b237){return _0x40ffe7===_0x1c98af;}else{var _0xb38a2d=_0x242168[_0xc001('0x1b')]();var _0x1c82e9=_0x1c98af<_0x18b237;let _0x3b34e7=![];var _0x1e0f3f=0x0;var _0x43b3cb=0x0;if(_0x1c82e9){_0x1e0f3f=Math['max'](0x1,_0x1c98af);_0x43b3cb=Math[_0xc001('0x1c')](_0x18b237,_0xb38a2d);_0x3b34e7=_0x40ffe7>=_0x1e0f3f&&_0x40ffe7<=_0x43b3cb;}else{_0x1e0f3f=Math['min'](_0x1c98af,_0xb38a2d);_0x43b3cb=Math['max'](0x1,_0x18b237);_0x3b34e7=_0x40ffe7>=_0x1e0f3f||_0x40ffe7<=_0x43b3cb;}return _0x3b34e7;}}module['exports'][_0xc001('0x1d')]=domCompare;function monthCompare(_0x3dad72,_0x318a52,_0x18ea61){var _0x2ad582=_0x3dad72[_0xc001('0x6')]('en')[_0xc001('0x17')](_0xc001('0x1e'))[_0xc001('0x8')]();return circularMonthInterval(_0x318a52,_0x18ea61)[_0xc001('0x19')](_0x2ad582);}module['exports'][_0xc001('0x1f')]=monthCompare;function iftime(_0x1e7667,_0x39c1a6=moment['tz'][_0xc001('0x20')](),_0x13bc33=moment()){if(!validateRx['test'](_0x1e7667)){throw new Error(EINVALID_STRING);}else{var _0x3d2dac=(moment[_0xc001('0x21')](_0x13bc33)?_0x13bc33[_0xc001('0xe')]():moment(_0x13bc33))['tz'](_0x39c1a6)[_0xc001('0x6')]('en');throwIfDateNotValid(_0x3d2dac);var _0xc9bde0=_0x1e7667[_0xc001('0x5')](',');var _0x83e28e=_0xc9bde0[0x0];var _0x1eafc9=_0xc9bde0[0x1];var _0x3a2163=_0xc9bde0[0x2];var _0x59dacb=_0xc9bde0[0x3];let _0x1553c2=!![];if(_0x83e28e!=='*'){var _0x2b3ed6=_0x83e28e[_0xc001('0x5')]('-');var _0x4b6c1e=_[_0xc001('0x22')](_0x2b3ed6[0x0],0x5,'0');var _0x1908c6=_0x2b3ed6[_0xc001('0x23')]===0x2?_['padStart'](_0x2b3ed6[0x1],0x5,'0'):_0x4b6c1e;_0x1553c2=timeCompare(_0x3d2dac,_0x4b6c1e,_0x1908c6);}let _0x2a04dd=!![];if(_0x1eafc9!=='*'){var _0x4cd08f=_0x1eafc9[_0xc001('0x5')]('-');var _0xa32a1c=_0x4cd08f[0x0];var _0x11b522=_0x4cd08f['length']===0x2?_0x4cd08f[0x1]:_0xa32a1c;_0x2a04dd=dowCompare(_0x3d2dac,_0xa32a1c,_0x11b522);}let _0x123ef5=!![];if(_0x3a2163!=='*'){var _0x1bd799=_0x3a2163[_0xc001('0x5')]('-');var _0x1133fc=parseDom(_0x1bd799[0x0]);var _0x4e0cca=_0x1bd799[_0xc001('0x23')]===0x2?parseDom(_0x1bd799[0x1]):_0x1133fc;_0x123ef5=domCompare(_0x3d2dac,_0x1133fc,_0x4e0cca);}let _0x34bffb=!![];if(_0x59dacb!=='*'){var _0x58c9e0=_0x59dacb['split']('-');var _0x2d91ec=_0x58c9e0[0x0];var _0x49d1dc=_0x58c9e0[_0xc001('0x23')]===0x2?_0x58c9e0[0x1]:_0x58c9e0[0x0];_0x34bffb=monthCompare(_0x3d2dac,_0x2d91ec,_0x49d1dc);}return _0x1553c2&&_0x2a04dd&&_0x123ef5&&_0x34bffb;}}module[_0xc001('0xb')][_0xc001('0x24')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 6d628d6..51fa985 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84c0=['white','bold\x20green','bold\x20magenta','bold\x20blue','bold\x20cyan','join','format','%s-%s.log','message','replace','}}}','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','{{{','meta','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Console','warn','Logger','transports','File','%s-%s','error','consoleLogger','fileLogger','path','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow'];(function(_0x1e6659,_0x1f860c){var _0x4d16e4=function(_0x21c05a){while(--_0x21c05a){_0x1e6659['push'](_0x1e6659['shift']());}};_0x4d16e4(++_0x1f860c);}(_0x84c0,0x1b2));var _0x084c=function(_0x266a62,_0x13ad06){_0x266a62=_0x266a62-0x0;var _0x2bf628=_0x84c0[_0x266a62];return _0x2bf628;};'use strict';var path=require(_0x084c('0x0'));var util=require('util');var moment=require(_0x084c('0x1'));var winston=require(_0x084c('0x2'));var config=require(_0x084c('0x3'));var debugLevel=config['debugLevel']?config[_0x084c('0x4')][_0x084c('0x5')]():_0x084c('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x084c('0x7'),'error':_0x084c('0x8'),'warn':_0x084c('0x9'),'info':_0x084c('0xa'),'print':'bold\x20white','success':_0x084c('0xb'),'http':'gray','verbose':_0x084c('0xc'),'debug':_0x084c('0xd'),'silly':_0x084c('0xe')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x1f8a01,_0x74ad70,_0x1ca765){var _0x21e84d=_0x1f8a01||'/var/log/xcally';return path[_0x084c('0xf')](_0x21e84d,util[_0x084c('0x10')](_0x084c('0x11'),_0x74ad70,_0x1ca765));}function formatter(_0xcbb042,_0x13f55f){_0x13f55f['message']=_0x13f55f[_0x084c('0x12')][_0x084c('0x13')](/@@{/g,'{{{')[_0x084c('0x13')](/}@@/g,_0x084c('0x14'))['replace'](/@{/g,'{{')[_0x084c('0x13')](/}@/g,'}}');return util[_0x084c('0x10')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()['format'](_0x084c('0x15')),_0x13f55f[_0x084c('0x16')][_0x084c('0x17')](),_0xcbb042,_0x13f55f[_0x084c('0x12')]);}function fileFormat(_0x1085f9,_0x548227){_0x548227[_0x084c('0x12')]=_0x548227[_0x084c('0x12')][_0x084c('0x13')](/@@{/g,_0x084c('0x18'))['replace'](/}@@/g,_0x084c('0x14'))['replace'](/@{/g,'{{')[_0x084c('0x13')](/}@/g,'}}');var _0x5d2eff=_0x548227[_0x084c('0x19')]&&Object['keys'](_0x548227[_0x084c('0x19')])['length']?'\x0a\x09'+JSON[_0x084c('0x1a')](_0x548227[_0x084c('0x19')]):'';return util[_0x084c('0x10')](_0x084c('0x1b'),moment()[_0x084c('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),_0x548227[_0x084c('0x16')][_0x084c('0x17')](),_0x1085f9,_0x548227[_0x084c('0x12')],_0x5d2eff);}function consoleLogger(){var _0xf580b=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x084c('0x1c'))]({'level':_0x084c('0x1d'),'json':![],'formatter':function(_0x1a2fac){return formatter('',_0x1a2fac);}})]});return _0xf580b;}function fileLogger(_0x506463,_0x121f6d){var _0x4c723a=new winston[(_0x084c('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x084c('0x1f'))][(_0x084c('0x20'))]({'name':util[_0x084c('0x10')](_0x084c('0x21'),_0x506463,_0x084c('0x22')),'filename':getLogFileName(_0x121f6d,_0x506463,_0x084c('0x22')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x6eb353){return fileFormat(_0x506463,_0x6eb353);}}),new winston['transports'][(_0x084c('0x20'))]({'name':util[_0x084c('0x10')](_0x084c('0x21'),_0x506463,debugLevel),'filename':getLogFileName(_0x121f6d,_0x506463,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x14bc44){return fileFormat(_0x506463,_0x14bc44);}}),new winston[(_0x084c('0x1f'))][(_0x084c('0x1c'))]({'level':'warn','json':![],'formatter':function(_0x53823a){return fileFormat(_0x506463,_0x53823a);}})]});return _0x4c723a;}exports[_0x084c('0x23')]=consoleLogger;exports[_0x084c('0x24')]=fileLogger; \ No newline at end of file +var _0xafc5=['util','moment','winston','../config/environment','debugLevel','toLowerCase','red','bold\x20yellow','white','bold\x20green','gray','bold\x20magenta','bold\x20cyan','addColors','/var/log/xcally','format','message','{{{','replace','}}}','level','toUpperCase','meta','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','transports','Console','warn','Logger','File','%s-%s','error','consoleLogger','path'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xafc5,0x1e9));var _0x5afc=function(_0x47eddd,_0x405e8e){_0x47eddd=_0x47eddd-0x0;var _0x28f500=_0xafc5[_0x47eddd];return _0x28f500;};'use strict';var path=require(_0x5afc('0x0'));var util=require(_0x5afc('0x1'));var moment=require(_0x5afc('0x2'));var winston=require(_0x5afc('0x3'));var config=require(_0x5afc('0x4'));var debugLevel=config[_0x5afc('0x5')]?config[_0x5afc('0x5')][_0x5afc('0x6')]():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x5afc('0x7'),'warn':_0x5afc('0x8'),'info':_0x5afc('0x9'),'print':'bold\x20white','success':_0x5afc('0xa'),'http':_0x5afc('0xb'),'verbose':_0x5afc('0xc'),'debug':'bold\x20blue','silly':_0x5afc('0xd')};winston[_0x5afc('0xe')](XC_LOG_COLORS);function getLogFileName(_0xac68a1,_0x2f1af5,_0x2123d4){var _0x3aee6a=_0xac68a1||_0x5afc('0xf');return path['join'](_0x3aee6a,util[_0x5afc('0x10')]('%s-%s.log',_0x2f1af5,_0x2123d4));}function formatter(_0x40f255,_0x233a67){_0x233a67[_0x5afc('0x11')]=_0x233a67['message']['replace'](/@@{/g,_0x5afc('0x12'))[_0x5afc('0x13')](/}@@/g,_0x5afc('0x14'))[_0x5afc('0x13')](/@{/g,'{{')[_0x5afc('0x13')](/}@/g,'}}');return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x233a67[_0x5afc('0x15')][_0x5afc('0x16')](),_0x40f255,_0x233a67[_0x5afc('0x11')]);}function fileFormat(_0x4e00c2,_0x565b45){_0x565b45[_0x5afc('0x11')]=_0x565b45[_0x5afc('0x11')][_0x5afc('0x13')](/@@{/g,'{{{')[_0x5afc('0x13')](/}@@/g,_0x5afc('0x14'))[_0x5afc('0x13')](/@{/g,'{{')[_0x5afc('0x13')](/}@/g,'}}');var _0x4097bb=_0x565b45[_0x5afc('0x17')]&&Object['keys'](_0x565b45['meta'])[_0x5afc('0x18')]?'\x0a\x09'+JSON['stringify'](_0x565b45['meta']):'';return util['format'](_0x5afc('0x19'),moment()[_0x5afc('0x10')](_0x5afc('0x1a')),_0x565b45[_0x5afc('0x15')][_0x5afc('0x16')](),_0x4e00c2,_0x565b45['message'],_0x4097bb);}function consoleLogger(){var _0x3b02e7=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x5afc('0x1b'))][(_0x5afc('0x1c'))]({'level':_0x5afc('0x1d'),'json':![],'formatter':function(_0x5b4ffe){return formatter('',_0x5b4ffe);}})]});return _0x3b02e7;}function fileLogger(_0x4dbf90,_0x2650a5){var _0x43c206=new winston[(_0x5afc('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x5afc('0x1b'))][(_0x5afc('0x1f'))]({'name':util['format'](_0x5afc('0x20'),_0x4dbf90,_0x5afc('0x21')),'filename':getLogFileName(_0x2650a5,_0x4dbf90,_0x5afc('0x21')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1b11a0){return fileFormat(_0x4dbf90,_0x1b11a0);}}),new winston['transports'][(_0x5afc('0x1f'))]({'name':util[_0x5afc('0x10')]('%s-%s',_0x4dbf90,debugLevel),'filename':getLogFileName(_0x2650a5,_0x4dbf90,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x248b08){return fileFormat(_0x4dbf90,_0x248b08);}}),new winston[(_0x5afc('0x1b'))]['Console']({'level':_0x5afc('0x1d'),'json':![],'formatter':function(_0x3a6a78){return fileFormat(_0x4dbf90,_0x3a6a78);}})]});return _0x43c206;}exports[_0x5afc('0x22')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index ee5a7ac..9c033cb 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1967=['secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x1967,0x173));var _0x7196=function(_0x5e3a38,_0x340bac){_0x5e3a38=_0x5e3a38-0x0;var _0x2662a5=_0x1967[_0x5e3a38];return _0x2662a5;};var _=require('lodash');var sensitiveFields=[_0x7196('0x0'),_0x7196('0x1'),_0x7196('0x2'),_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7'),_0x7196('0x8'),_0x7196('0x9'),'email',_0x7196('0xa'),_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd'),_0x7196('0xe'),_0x7196('0xf'),'token',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0x12'),_0x7196('0x13'),_0x7196('0x14'),'consumerSecret','membername',_0x7196('0x15'),_0x7196('0x16'),_0x7196('0x17'),_0x7196('0x18'),_0x7196('0x19'),_0x7196('0x1a'),_0x7196('0x1b'),_0x7196('0x1c'),_0x7196('0x1d'),_0x7196('0x1e'),_0x7196('0x1f'),'accountSid',_0x7196('0x20'),_0x7196('0x21'),_0x7196('0x22'),_0x7196('0x23'),'oldPassword'];function maskSensitiveData(_0x31c778){const _0x539414=/(?!^)[\s\S](?!$)/g;if(_[_0x7196('0x24')](_0x31c778)){for(const _0x2590a6 in _0x31c778){if(_[_0x7196('0x25')](_0x31c778[_0x2590a6])){for(let _0x3ed1ad=0x0;_0x3ed1ad<_0x31c778[_0x2590a6][_0x7196('0x26')];_0x3ed1ad++){maskSensitiveData(_0x31c778[_0x2590a6][_0x3ed1ad]);}}else if(_[_0x7196('0x24')](_0x31c778[_0x2590a6])){maskSensitiveData(_0x31c778[_0x2590a6]);}else if(_[_0x7196('0x27')](_0x31c778[_0x2590a6])){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](/{{{/g,_0x7196('0x29'))[_0x7196('0x28')](/}}}/g,_0x7196('0x2a'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x7196('0x2b')](sensitiveFields,_0x2590a6)){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](_0x539414,'*');}}}}}module[_0x7196('0x2c')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0xadb5=['exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','street','phone','mobile','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum'];(function(_0x23a96d,_0x3918d4){var _0x4a6288=function(_0x3f67ab){while(--_0x3f67ab){_0x23a96d['push'](_0x23a96d['shift']());}};_0x4a6288(++_0x3918d4);}(_0xadb5,0xad));var _0x5adb=function(_0x480535,_0x197a55){_0x480535=_0x480535-0x0;var _0x57886e=_0xadb5[_0x480535];return _0x57886e;};var _=require('lodash');var sensitiveFields=[_0x5adb('0x0'),'password',_0x5adb('0x1'),_0x5adb('0x2'),_0x5adb('0x3'),'lastName',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'fax',_0x5adb('0x7'),_0x5adb('0x8'),_0x5adb('0x9'),_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe'),_0x5adb('0xf'),_0x5adb('0x10'),_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),_0x5adb('0x14'),'membername','calleridname',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0x17'),'clientEmail',_0x5adb('0x18'),'accesskeyid',_0x5adb('0x19'),'key',_0x5adb('0x1a'),_0x5adb('0x1b'),_0x5adb('0x1c'),'localstationid',_0x5adb('0x1d'),_0x5adb('0x1e'),_0x5adb('0x1f'),'oldPassword'];function maskSensitiveData(_0x2312de){const _0x518823=/(?!^)[\s\S](?!$)/g;if(_[_0x5adb('0x20')](_0x2312de)){for(const _0x42a482 in _0x2312de){if(_[_0x5adb('0x21')](_0x2312de[_0x42a482])){for(let _0x304784=0x0;_0x304784<_0x2312de[_0x42a482][_0x5adb('0x22')];_0x304784++){maskSensitiveData(_0x2312de[_0x42a482][_0x304784]);}}else if(_[_0x5adb('0x20')](_0x2312de[_0x42a482])){maskSensitiveData(_0x2312de[_0x42a482]);}else if(_[_0x5adb('0x23')](_0x2312de[_0x42a482])){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](/{{{/g,_0x5adb('0x25'))['replace'](/}}}/g,_0x5adb('0x26'))['replace'](/{{/g,'@{')[_0x5adb('0x24')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x42a482)){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](_0x518823,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index a44521b..6c33f8a 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 _0xea28=['isPlainObject','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','map'];(function(_0x2009eb,_0x1a0d5d){var _0xd13fae=function(_0x4f0e7b){while(--_0x4f0e7b){_0x2009eb['push'](_0x2009eb['shift']());}};_0xd13fae(++_0x1a0d5d);}(_0xea28,0x13a));var _0x8ea2=function(_0x4afa8d,_0x12e592){_0x4afa8d=_0x4afa8d-0x0;var _0x3aad80=_0xea28[_0x4afa8d];return _0x3aad80;};var _=require(_0x8ea2('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2e031a){return _0x2e031a==='{{'?_0x8ea2('0x1'):_0x8ea2('0x2');}function safeTemplate(_0x459c4e){var _0x25e47e=_0x459c4e;if(typeof _0x459c4e===_0x8ea2('0x3')){_0x25e47e=_0x459c4e[_0x8ea2('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x459c4e)){_0x25e47e=_0x459c4e[_0x8ea2('0x5')](function(_0x23aaf1){return safeTemplate(_0x23aaf1);});}else if(_[_0x8ea2('0x6')](_0x459c4e)){_0x25e47e=Object['keys'](_0x459c4e)[_0x8ea2('0x7')](function(_0x435d78,_0xb7f278){_0x435d78[_0xb7f278]=safeTemplate(_0x459c4e[_0xb7f278]);return _0x435d78;},{});}return _0x25e47e;}module[_0x8ea2('0x8')][_0x8ea2('0x9')]=safeTemplate; \ No newline at end of file +var _0xd4a2=['exports','safeTemplate','lodash','\x20}\x20}','replace','map','isPlainObject','keys','reduce'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xd4a2,0x173));var _0x2d4a=function(_0x1dad6a,_0x3b8004){_0x1dad6a=_0x1dad6a-0x0;var _0x5f192a=_0xd4a2[_0x1dad6a];return _0x5f192a;};var _=require(_0x2d4a('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x5d70e1){return _0x5d70e1==='{{'?'{\x20{\x20':_0x2d4a('0x1');}function safeTemplate(_0x576ffe){var _0x2a8a71=_0x576ffe;if(typeof _0x576ffe==='string'){_0x2a8a71=_0x576ffe[_0x2d4a('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x576ffe)){_0x2a8a71=_0x576ffe[_0x2d4a('0x3')](function(_0x40d744){return safeTemplate(_0x40d744);});}else if(_[_0x2d4a('0x4')](_0x576ffe)){_0x2a8a71=Object[_0x2d4a('0x5')](_0x576ffe)[_0x2d4a('0x6')](function(_0x57058f,_0x45fefb){_0x57058f[_0x45fefb]=safeTemplate(_0x576ffe[_0x45fefb]);return _0x57058f;},{});}return _0x2a8a71;}module[_0x2d4a('0x7')][_0x2d4a('0x8')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 0a1ac69..e7b78de 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 _0x8d7f=['name','motion2','env','NODE_PATH','pathExists','then','readJSON','updated','info','Updating\x20app.json','writeJSON','exports','fs-extra','path','root','resolve','legacy-libs','isArray','apps'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x8d7f,0x129));var _0xf8d7=function(_0x402aeb,_0x659d8a){_0x402aeb=_0x402aeb-0x0;var _0x20710d=_0x8d7f[_0x402aeb];return _0x20710d;};var fs=require(_0xf8d7('0x0'));var path=require(_0xf8d7('0x1'));var config=require('../config/environment');var root=config[_0xf8d7('0x2')];var APP_JSON_PATH=path[_0xf8d7('0x3')](root,'server/app.json');var NODEPATH=path['resolve'](root,_0xf8d7('0x4'));function setLegacyLibsNodeEnvPath(_0xa4ab16){let _0x3a10a6=![];if(Array[_0xf8d7('0x5')](_0xa4ab16['apps'])){var _0x434be1=_0xa4ab16[_0xf8d7('0x6')]['findIndex'](function(_0x146017){return _0x146017[_0xf8d7('0x7')]===_0xf8d7('0x8');});if(_0x434be1>-0x1){var _0x5a79ce=_0xa4ab16[_0xf8d7('0x6')][_0x434be1];if(typeof _0x5a79ce[_0xf8d7('0x9')][_0xf8d7('0xa')]!=='string'){_0x5a79ce[_0xf8d7('0x9')][_0xf8d7('0xa')]=NODEPATH;_0x3a10a6=!![];}}return{'appConfig':_0xa4ab16,'updated':_0x3a10a6};}}function updateAppConfig(_0x490120){return fs[_0xf8d7('0xb')](APP_JSON_PATH)[_0xf8d7('0xc')](function(_0x156614){if(_0x156614){return fs[_0xf8d7('0xd')](APP_JSON_PATH)['then'](function(_0x40440f){var _0x5aad1d=setLegacyLibsNodeEnvPath(_0x40440f);if(_0x5aad1d[_0xf8d7('0xe')]){_0x490120[_0xf8d7('0xf')](_0xf8d7('0x10'));return fs[_0xf8d7('0x11')](APP_JSON_PATH,_0x40440f,{'spaces':0x2});}else{return Promise[_0xf8d7('0x3')]();}});}else{return Promise[_0xf8d7('0x3')]();}});}module[_0xf8d7('0x12')]=updateAppConfig; \ No newline at end of file +var _0x3efe=['../config/environment','root','resolve','server/app.json','legacy-libs','apps','findIndex','name','env','string','NODE_PATH','pathExists','readJSON','then','updated','info','writeJSON','fs-extra','path'];(function(_0x38c164,_0x235295){var _0x593a3c=function(_0x41c775){while(--_0x41c775){_0x38c164['push'](_0x38c164['shift']());}};_0x593a3c(++_0x235295);}(_0x3efe,0xa9));var _0xe3ef=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x3efe[_0x42cae2];return _0x5f256f;};var fs=require(_0xe3ef('0x0'));var path=require(_0xe3ef('0x1'));var config=require(_0xe3ef('0x2'));var root=config[_0xe3ef('0x3')];var APP_JSON_PATH=path[_0xe3ef('0x4')](root,_0xe3ef('0x5'));var NODEPATH=path[_0xe3ef('0x4')](root,_0xe3ef('0x6'));function setLegacyLibsNodeEnvPath(_0x55702f){let _0x27d937=![];if(Array['isArray'](_0x55702f[_0xe3ef('0x7')])){var _0x102e4c=_0x55702f[_0xe3ef('0x7')][_0xe3ef('0x8')](function(_0x2d4e56){return _0x2d4e56[_0xe3ef('0x9')]==='motion2';});if(_0x102e4c>-0x1){var _0x4a63fa=_0x55702f[_0xe3ef('0x7')][_0x102e4c];if(typeof _0x4a63fa[_0xe3ef('0xa')]['NODE_PATH']!==_0xe3ef('0xb')){_0x4a63fa[_0xe3ef('0xa')][_0xe3ef('0xc')]=NODEPATH;_0x27d937=!![];}}return{'appConfig':_0x55702f,'updated':_0x27d937};}}function updateAppConfig(_0x17f0e4){return fs[_0xe3ef('0xd')](APP_JSON_PATH)['then'](function(_0x3d0f57){if(_0x3d0f57){return fs[_0xe3ef('0xe')](APP_JSON_PATH)[_0xe3ef('0xf')](function(_0x40eebf){var _0x44b8e1=setLegacyLibsNodeEnvPath(_0x40eebf);if(_0x44b8e1[_0xe3ef('0x10')]){_0x17f0e4[_0xe3ef('0x11')]('Updating\x20app.json');return fs[_0xe3ef('0x12')](APP_JSON_PATH,_0x40eebf,{'spaces':0x2});}else{return Promise['resolve']();}});}else{return Promise[_0xe3ef('0x4')]();}});}module['exports']=updateAppConfig; \ No newline at end of file